diff --git a/bsp/nxp/mcx/mcxa/Libraries/CMSIS/Core/Include/cmsis_armclang.h b/bsp/nxp/mcx/mcxa/Libraries/CMSIS/Core/Include/cmsis_armclang.h deleted file mode 100644 index 69114177477..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/CMSIS/Core/Include/cmsis_armclang.h +++ /dev/null @@ -1,1503 +0,0 @@ -/**************************************************************************//** - * @file cmsis_armclang.h - * @brief CMSIS compiler armclang (Arm Compiler 6) header file - * @version V5.4.3 - * @date 27. May 2021 - ******************************************************************************/ -/* - * Copyright (c) 2009-2021 Arm Limited. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - * - * 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. - */ - -/*lint -esym(9058, IRQn)*/ /* disable MISRA 2012 Rule 2.4 for IRQn */ - -#ifndef __CMSIS_ARMCLANG_H -#define __CMSIS_ARMCLANG_H - -#pragma clang system_header /* treat file as system include file */ - -/* CMSIS compiler specific defines */ -#ifndef __ASM - #define __ASM __asm -#endif -#ifndef __INLINE - #define __INLINE __inline -#endif -#ifndef __STATIC_INLINE - #define __STATIC_INLINE static __inline -#endif -#ifndef __STATIC_FORCEINLINE - #define __STATIC_FORCEINLINE __attribute__((always_inline)) static __inline -#endif -#ifndef __NO_RETURN - #define __NO_RETURN __attribute__((__noreturn__)) -#endif -#ifndef __USED - #define __USED __attribute__((used)) -#endif -#ifndef __WEAK - #define __WEAK __attribute__((weak)) -#endif -#ifndef __PACKED - #define __PACKED __attribute__((packed, aligned(1))) -#endif -#ifndef __PACKED_STRUCT - #define __PACKED_STRUCT struct __attribute__((packed, aligned(1))) -#endif -#ifndef __PACKED_UNION - #define __PACKED_UNION union __attribute__((packed, aligned(1))) -#endif -#ifndef __UNALIGNED_UINT32 /* deprecated */ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpacked" -/*lint -esym(9058, T_UINT32)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32 */ - struct __attribute__((packed)) T_UINT32 { uint32_t v; }; - #pragma clang diagnostic pop - #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) -#endif -#ifndef __UNALIGNED_UINT16_WRITE - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpacked" -/*lint -esym(9058, T_UINT16_WRITE)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT16_WRITE */ - __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; - #pragma clang diagnostic pop - #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) -#endif -#ifndef __UNALIGNED_UINT16_READ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpacked" -/*lint -esym(9058, T_UINT16_READ)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT16_READ */ - __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; - #pragma clang diagnostic pop - #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) -#endif -#ifndef __UNALIGNED_UINT32_WRITE - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpacked" -/*lint -esym(9058, T_UINT32_WRITE)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32_WRITE */ - __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; - #pragma clang diagnostic pop - #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) -#endif -#ifndef __UNALIGNED_UINT32_READ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpacked" -/*lint -esym(9058, T_UINT32_READ)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32_READ */ - __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; - #pragma clang diagnostic pop - #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) -#endif -#ifndef __ALIGNED - #define __ALIGNED(x) __attribute__((aligned(x))) -#endif -#ifndef __RESTRICT - #define __RESTRICT __restrict -#endif -#ifndef __COMPILER_BARRIER - #define __COMPILER_BARRIER() __ASM volatile("":::"memory") -#endif - -/* ######################### Startup and Lowlevel Init ######################## */ - -#ifndef __PROGRAM_START -#define __PROGRAM_START __main -#endif - -#ifndef __INITIAL_SP -#define __INITIAL_SP Image$$ARM_LIB_STACK$$ZI$$Limit -#endif - -#ifndef __STACK_LIMIT -#define __STACK_LIMIT Image$$ARM_LIB_STACK$$ZI$$Base -#endif - -#ifndef __VECTOR_TABLE -#define __VECTOR_TABLE __Vectors -#endif - -#ifndef __VECTOR_TABLE_ATTRIBUTE -#define __VECTOR_TABLE_ATTRIBUTE __attribute__((used, section("RESET"))) -#endif - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) -#ifndef __STACK_SEAL -#define __STACK_SEAL Image$$STACKSEAL$$ZI$$Base -#endif - -#ifndef __TZ_STACK_SEAL_SIZE -#define __TZ_STACK_SEAL_SIZE 8U -#endif - -#ifndef __TZ_STACK_SEAL_VALUE -#define __TZ_STACK_SEAL_VALUE 0xFEF5EDA5FEF5EDA5ULL -#endif - - -__STATIC_FORCEINLINE void __TZ_set_STACKSEAL_S (uint32_t* stackTop) { - *((uint64_t *)stackTop) = __TZ_STACK_SEAL_VALUE; -} -#endif - - -/* ########################## Core Instruction Access ######################### */ -/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface - Access to dedicated instructions - @{ -*/ - -/* Define macros for porting to both thumb1 and thumb2. - * For thumb1, use low register (r0-r7), specified by constraint "l" - * Otherwise, use general registers, specified by constraint "r" */ -#if defined (__thumb__) && !defined (__thumb2__) -#define __CMSIS_GCC_OUT_REG(r) "=l" (r) -#define __CMSIS_GCC_RW_REG(r) "+l" (r) -#define __CMSIS_GCC_USE_REG(r) "l" (r) -#else -#define __CMSIS_GCC_OUT_REG(r) "=r" (r) -#define __CMSIS_GCC_RW_REG(r) "+r" (r) -#define __CMSIS_GCC_USE_REG(r) "r" (r) -#endif - -/** - \brief No Operation - \details No Operation does nothing. This instruction can be used for code alignment purposes. - */ -#define __NOP __builtin_arm_nop - -/** - \brief Wait For Interrupt - \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. - */ -#define __WFI __builtin_arm_wfi - - -/** - \brief Wait For Event - \details Wait For Event is a hint instruction that permits the processor to enter - a low-power state until one of a number of events occurs. - */ -#define __WFE __builtin_arm_wfe - - -/** - \brief Send Event - \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. - */ -#define __SEV __builtin_arm_sev - - -/** - \brief Instruction Synchronization Barrier - \details Instruction Synchronization Barrier flushes the pipeline in the processor, - so that all instructions following the ISB are fetched from cache or memory, - after the instruction has been completed. - */ -#define __ISB() __builtin_arm_isb(0xF) - -/** - \brief Data Synchronization Barrier - \details Acts as a special kind of Data Memory Barrier. - It completes when all explicit memory accesses before this instruction complete. - */ -#define __DSB() __builtin_arm_dsb(0xF) - - -/** - \brief Data Memory Barrier - \details Ensures the apparent order of the explicit memory operations before - and after the instruction, without ensuring their completion. - */ -#define __DMB() __builtin_arm_dmb(0xF) - - -/** - \brief Reverse byte order (32 bit) - \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV(value) __builtin_bswap32(value) - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV16(value) __ROR(__REV(value), 16) - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REVSH(value) (int16_t)__builtin_bswap16(value) - - -/** - \brief Rotate Right in unsigned value (32 bit) - \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. - \param [in] op1 Value to rotate - \param [in] op2 Number of Bits to rotate - \return Rotated value - */ -__STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2) -{ - op2 %= 32U; - if (op2 == 0U) - { - return op1; - } - return (op1 >> op2) | (op1 << (32U - op2)); -} - - -/** - \brief Breakpoint - \details Causes the processor to enter Debug state. - Debug tools can use this to investigate system state when the instruction at a particular address is reached. - \param [in] value is ignored by the processor. - If required, a debugger can use it to store additional information about the breakpoint. - */ -#define __BKPT(value) __ASM volatile ("bkpt "#value) - - -/** - \brief Reverse bit order of value - \details Reverses the bit order of the given value. - \param [in] value Value to reverse - \return Reversed value - */ -#define __RBIT __builtin_arm_rbit - -/** - \brief Count leading zeros - \details Counts the number of leading zeros of a data value. - \param [in] value Value to count the leading zeros - \return number of leading zeros in value - */ -__STATIC_FORCEINLINE uint8_t __CLZ(uint32_t value) -{ - /* Even though __builtin_clz produces a CLZ instruction on ARM, formally - __builtin_clz(0) is undefined behaviour, so handle this case specially. - This guarantees ARM-compatible results if happening to compile on a non-ARM - target, and ensures the compiler doesn't decide to activate any - optimisations using the logic "value was passed to __builtin_clz, so it - is non-zero". - ARM Compiler 6.10 and possibly earlier will optimise this test away, leaving a - single CLZ instruction. - */ - if (value == 0U) - { - return 32U; - } - return __builtin_clz(value); -} - - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) - -/** - \brief LDR Exclusive (8 bit) - \details Executes a exclusive LDR instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -#define __LDREXB (uint8_t)__builtin_arm_ldrex - - -/** - \brief LDR Exclusive (16 bit) - \details Executes a exclusive LDR instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -#define __LDREXH (uint16_t)__builtin_arm_ldrex - - -/** - \brief LDR Exclusive (32 bit) - \details Executes a exclusive LDR instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -#define __LDREXW (uint32_t)__builtin_arm_ldrex - - -/** - \brief STR Exclusive (8 bit) - \details Executes a exclusive STR instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STREXB (uint32_t)__builtin_arm_strex - - -/** - \brief STR Exclusive (16 bit) - \details Executes a exclusive STR instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STREXH (uint32_t)__builtin_arm_strex - - -/** - \brief STR Exclusive (32 bit) - \details Executes a exclusive STR instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STREXW (uint32_t)__builtin_arm_strex - - -/** - \brief Remove the exclusive lock - \details Removes the exclusive lock which is created by LDREX. - */ -#define __CLREX __builtin_arm_clrex - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) - -/** - \brief Signed Saturate - \details Saturates a signed value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (1..32) - \return Saturated value - */ -#define __SSAT __builtin_arm_ssat - - -/** - \brief Unsigned Saturate - \details Saturates an unsigned value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value - */ -#define __USAT __builtin_arm_usat - - -/** - \brief Rotate Right with Extend (32 bit) - \details Moves each bit of a bitstring right by one bit. - The carry input is shifted in at the left end of the bitstring. - \param [in] value Value to rotate - \return Rotated value - */ -__STATIC_FORCEINLINE uint32_t __RRX(uint32_t value) -{ - uint32_t result; - - __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return(result); -} - - -/** - \brief LDRT Unprivileged (8 bit) - \details Executes a Unprivileged LDRT instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -__STATIC_FORCEINLINE uint8_t __LDRBT(volatile uint8_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) ); - return ((uint8_t) result); /* Add explicit type cast here */ -} - - -/** - \brief LDRT Unprivileged (16 bit) - \details Executes a Unprivileged LDRT instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -__STATIC_FORCEINLINE uint16_t __LDRHT(volatile uint16_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) ); - return ((uint16_t) result); /* Add explicit type cast here */ -} - - -/** - \brief LDRT Unprivileged (32 bit) - \details Executes a Unprivileged LDRT instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -__STATIC_FORCEINLINE uint32_t __LDRT(volatile uint32_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*ptr) ); - return(result); -} - - -/** - \brief STRT Unprivileged (8 bit) - \details Executes a Unprivileged STRT instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STRBT(uint8_t value, volatile uint8_t *ptr) -{ - __ASM volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); -} - - -/** - \brief STRT Unprivileged (16 bit) - \details Executes a Unprivileged STRT instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STRHT(uint16_t value, volatile uint16_t *ptr) -{ - __ASM volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); -} - - -/** - \brief STRT Unprivileged (32 bit) - \details Executes a Unprivileged STRT instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STRT(uint32_t value, volatile uint32_t *ptr) -{ - __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) ); -} - -#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) */ - -/** - \brief Signed Saturate - \details Saturates a signed value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (1..32) - \return Saturated value - */ -__STATIC_FORCEINLINE int32_t __SSAT(int32_t val, uint32_t sat) -{ - if ((sat >= 1U) && (sat <= 32U)) - { - const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); - const int32_t min = -1 - max ; - if (val > max) - { - return max; - } - else if (val < min) - { - return min; - } - } - return val; -} - -/** - \brief Unsigned Saturate - \details Saturates an unsigned value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value - */ -__STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat) -{ - if (sat <= 31U) - { - const uint32_t max = ((1U << sat) - 1U); - if (val > (int32_t)max) - { - return max; - } - else if (val < 0) - { - return 0U; - } - } - return (uint32_t)val; -} - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) - -/** - \brief Load-Acquire (8 bit) - \details Executes a LDAB instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -__STATIC_FORCEINLINE uint8_t __LDAB(volatile uint8_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldab %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint8_t) result); -} - - -/** - \brief Load-Acquire (16 bit) - \details Executes a LDAH instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -__STATIC_FORCEINLINE uint16_t __LDAH(volatile uint16_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldah %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint16_t) result); -} - - -/** - \brief Load-Acquire (32 bit) - \details Executes a LDA instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -__STATIC_FORCEINLINE uint32_t __LDA(volatile uint32_t *ptr) -{ - uint32_t result; - - __ASM volatile ("lda %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return(result); -} - - -/** - \brief Store-Release (8 bit) - \details Executes a STLB instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STLB(uint8_t value, volatile uint8_t *ptr) -{ - __ASM volatile ("stlb %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); -} - - -/** - \brief Store-Release (16 bit) - \details Executes a STLH instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STLH(uint16_t value, volatile uint16_t *ptr) -{ - __ASM volatile ("stlh %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); -} - - -/** - \brief Store-Release (32 bit) - \details Executes a STL instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STL(uint32_t value, volatile uint32_t *ptr) -{ - __ASM volatile ("stl %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); -} - - -/** - \brief Load-Acquire Exclusive (8 bit) - \details Executes a LDAB exclusive instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -#define __LDAEXB (uint8_t)__builtin_arm_ldaex - - -/** - \brief Load-Acquire Exclusive (16 bit) - \details Executes a LDAH exclusive instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -#define __LDAEXH (uint16_t)__builtin_arm_ldaex - - -/** - \brief Load-Acquire Exclusive (32 bit) - \details Executes a LDA exclusive instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -#define __LDAEX (uint32_t)__builtin_arm_ldaex - - -/** - \brief Store-Release Exclusive (8 bit) - \details Executes a STLB exclusive instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STLEXB (uint32_t)__builtin_arm_stlex - - -/** - \brief Store-Release Exclusive (16 bit) - \details Executes a STLH exclusive instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STLEXH (uint32_t)__builtin_arm_stlex - - -/** - \brief Store-Release Exclusive (32 bit) - \details Executes a STL exclusive instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STLEX (uint32_t)__builtin_arm_stlex - -#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) */ - -/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ - - -/* ########################### Core Function Access ########################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions - @{ - */ - -/** - \brief Enable IRQ Interrupts - \details Enables IRQ interrupts by clearing special-purpose register PRIMASK. - Can only be executed in Privileged modes. - */ -#ifndef __ARM_COMPAT_H -__STATIC_FORCEINLINE void __enable_irq(void) -{ - __ASM volatile ("cpsie i" : : : "memory"); -} -#endif - - -/** - \brief Disable IRQ Interrupts - \details Disables IRQ interrupts by setting special-purpose register PRIMASK. - Can only be executed in Privileged modes. - */ -#ifndef __ARM_COMPAT_H -__STATIC_FORCEINLINE void __disable_irq(void) -{ - __ASM volatile ("cpsid i" : : : "memory"); -} -#endif - - -/** - \brief Get Control Register - \details Returns the content of the Control Register. - \return Control Register value - */ -__STATIC_FORCEINLINE uint32_t __get_CONTROL(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, control" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Control Register (non-secure) - \details Returns the content of the non-secure Control Register when in secure mode. - \return non-secure Control Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_CONTROL_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, control_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Control Register - \details Writes the given value to the Control Register. - \param [in] control Control Register value to set - */ -__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control) -{ - __ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); - __ISB(); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Control Register (non-secure) - \details Writes the given value to the non-secure Control Register when in secure state. - \param [in] control Control Register value to set - */ -__STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control) -{ - __ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory"); - __ISB(); -} -#endif - - -/** - \brief Get IPSR Register - \details Returns the content of the IPSR Register. - \return IPSR Register value - */ -__STATIC_FORCEINLINE uint32_t __get_IPSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, ipsr" : "=r" (result) ); - return(result); -} - - -/** - \brief Get APSR Register - \details Returns the content of the APSR Register. - \return APSR Register value - */ -__STATIC_FORCEINLINE uint32_t __get_APSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, apsr" : "=r" (result) ); - return(result); -} - - -/** - \brief Get xPSR Register - \details Returns the content of the xPSR Register. - \return xPSR Register value - */ -__STATIC_FORCEINLINE uint32_t __get_xPSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, xpsr" : "=r" (result) ); - return(result); -} - - -/** - \brief Get Process Stack Pointer - \details Returns the current value of the Process Stack Pointer (PSP). - \return PSP Register value - */ -__STATIC_FORCEINLINE uint32_t __get_PSP(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, psp" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Process Stack Pointer (non-secure) - \details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state. - \return PSP Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PSP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, psp_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Process Stack Pointer - \details Assigns the given value to the Process Stack Pointer (PSP). - \param [in] topOfProcStack Process Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack) -{ - __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : ); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Process Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state. - \param [in] topOfProcStack Process Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack) -{ - __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : ); -} -#endif - - -/** - \brief Get Main Stack Pointer - \details Returns the current value of the Main Stack Pointer (MSP). - \return MSP Register value - */ -__STATIC_FORCEINLINE uint32_t __get_MSP(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, msp" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Main Stack Pointer (non-secure) - \details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state. - \return MSP Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_MSP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, msp_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Main Stack Pointer - \details Assigns the given value to the Main Stack Pointer (MSP). - \param [in] topOfMainStack Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack) -{ - __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : ); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Main Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state. - \param [in] topOfMainStack Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack) -{ - __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : ); -} -#endif - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Stack Pointer (non-secure) - \details Returns the current value of the non-secure Stack Pointer (SP) when in secure state. - \return SP Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_SP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, sp_ns" : "=r" (result) ); - return(result); -} - - -/** - \brief Set Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Stack Pointer (SP) when in secure state. - \param [in] topOfStack Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_SP_NS(uint32_t topOfStack) -{ - __ASM volatile ("MSR sp_ns, %0" : : "r" (topOfStack) : ); -} -#endif - - -/** - \brief Get Priority Mask - \details Returns the current state of the priority mask bit from the Priority Mask Register. - \return Priority Mask value - */ -__STATIC_FORCEINLINE uint32_t __get_PRIMASK(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, primask" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Priority Mask (non-secure) - \details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state. - \return Priority Mask value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PRIMASK_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, primask_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Priority Mask - \details Assigns the given value to the Priority Mask Register. - \param [in] priMask Priority Mask - */ -__STATIC_FORCEINLINE void __set_PRIMASK(uint32_t priMask) -{ - __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Priority Mask (non-secure) - \details Assigns the given value to the non-secure Priority Mask Register when in secure state. - \param [in] priMask Priority Mask - */ -__STATIC_FORCEINLINE void __TZ_set_PRIMASK_NS(uint32_t priMask) -{ - __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory"); -} -#endif - - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) -/** - \brief Enable FIQ - \details Enables FIQ interrupts by clearing special-purpose register FAULTMASK. - Can only be executed in Privileged modes. - */ -__STATIC_FORCEINLINE void __enable_fault_irq(void) -{ - __ASM volatile ("cpsie f" : : : "memory"); -} - - -/** - \brief Disable FIQ - \details Disables FIQ interrupts by setting special-purpose register FAULTMASK. - Can only be executed in Privileged modes. - */ -__STATIC_FORCEINLINE void __disable_fault_irq(void) -{ - __ASM volatile ("cpsid f" : : : "memory"); -} - - -/** - \brief Get Base Priority - \details Returns the current value of the Base Priority register. - \return Base Priority register value - */ -__STATIC_FORCEINLINE uint32_t __get_BASEPRI(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, basepri" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Base Priority (non-secure) - \details Returns the current value of the non-secure Base Priority register when in secure state. - \return Base Priority register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_BASEPRI_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, basepri_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Base Priority - \details Assigns the given value to the Base Priority register. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __set_BASEPRI(uint32_t basePri) -{ - __ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory"); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Base Priority (non-secure) - \details Assigns the given value to the non-secure Base Priority register when in secure state. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __TZ_set_BASEPRI_NS(uint32_t basePri) -{ - __ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "memory"); -} -#endif - - -/** - \brief Set Base Priority with condition - \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, - or the new value increases the BASEPRI priority level. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __set_BASEPRI_MAX(uint32_t basePri) -{ - __ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory"); -} - - -/** - \brief Get Fault Mask - \details Returns the current value of the Fault Mask register. - \return Fault Mask register value - */ -__STATIC_FORCEINLINE uint32_t __get_FAULTMASK(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Fault Mask (non-secure) - \details Returns the current value of the non-secure Fault Mask register when in secure state. - \return Fault Mask register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_FAULTMASK_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, faultmask_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Fault Mask - \details Assigns the given value to the Fault Mask register. - \param [in] faultMask Fault Mask value to set - */ -__STATIC_FORCEINLINE void __set_FAULTMASK(uint32_t faultMask) -{ - __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Fault Mask (non-secure) - \details Assigns the given value to the non-secure Fault Mask register when in secure state. - \param [in] faultMask Fault Mask value to set - */ -__STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) -{ - __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory"); -} -#endif - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) - -/** - \brief Get Process Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always in non-secure - mode. - - \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). - \return PSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __get_PSPLIM(void) -{ -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, psplim" : "=r" (result) ); - return result; -#endif -} - -#if (defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Process Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always in non-secure - mode. - - \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \return PSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS(void) -{ -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) ) - // without main extensions, the non-secure PSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, psplim_ns" : "=r" (result) ); - return result; -#endif -} -#endif - - -/** - \brief Set Process Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored in non-secure - mode. - - \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set - */ -__STATIC_FORCEINLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) -{ -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - (void)ProcStackPtrLimit; -#else - __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit)); -#endif -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Process Stack Pointer (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored in non-secure - mode. - - \details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set - */ -__STATIC_FORCEINLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) -{ -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) ) - // without main extensions, the non-secure PSPLIM is RAZ/WI - (void)ProcStackPtrLimit; -#else - __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit)); -#endif -} -#endif - - -/** - \brief Get Main Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always. - - \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). - \return MSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __get_MSPLIM(void) -{ -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, msplim" : "=r" (result) ); - return result; -#endif -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Main Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always. - - \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. - \return MSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS(void) -{ -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) ) - // without main extensions, the non-secure MSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) ); - return result; -#endif -} -#endif - - -/** - \brief Set Main Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored. - - \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). - \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set - */ -__STATIC_FORCEINLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) -{ -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - (void)MainStackPtrLimit; -#else - __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit)); -#endif -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Main Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored. - - \details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state. - \param [in] MainStackPtrLimit Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) -{ -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) ) - // without main extensions, the non-secure MSPLIM is RAZ/WI - (void)MainStackPtrLimit; -#else - __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit)); -#endif -} -#endif - -#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) */ - -/** - \brief Get FPSCR - \details Returns the current value of the Floating Point Status/Control register. - \return Floating Point Status/Control register value - */ -#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) -#define __get_FPSCR (uint32_t)__builtin_arm_get_fpscr -#else -#define __get_FPSCR() ((uint32_t)0U) -#endif - -/** - \brief Set FPSCR - \details Assigns the given value to the Floating Point Status/Control register. - \param [in] fpscr Floating Point Status/Control value to set - */ -#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) -#define __set_FPSCR __builtin_arm_set_fpscr -#else -#define __set_FPSCR(x) ((void)(x)) -#endif - - -/*@} end of CMSIS_Core_RegAccFunctions */ - - -/* ################### Compiler specific Intrinsics ########################### */ -/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics - Access to dedicated SIMD instructions - @{ -*/ - -#if (defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1)) - -#define __SADD8 __builtin_arm_sadd8 -#define __QADD8 __builtin_arm_qadd8 -#define __SHADD8 __builtin_arm_shadd8 -#define __UADD8 __builtin_arm_uadd8 -#define __UQADD8 __builtin_arm_uqadd8 -#define __UHADD8 __builtin_arm_uhadd8 -#define __SSUB8 __builtin_arm_ssub8 -#define __QSUB8 __builtin_arm_qsub8 -#define __SHSUB8 __builtin_arm_shsub8 -#define __USUB8 __builtin_arm_usub8 -#define __UQSUB8 __builtin_arm_uqsub8 -#define __UHSUB8 __builtin_arm_uhsub8 -#define __SADD16 __builtin_arm_sadd16 -#define __QADD16 __builtin_arm_qadd16 -#define __SHADD16 __builtin_arm_shadd16 -#define __UADD16 __builtin_arm_uadd16 -#define __UQADD16 __builtin_arm_uqadd16 -#define __UHADD16 __builtin_arm_uhadd16 -#define __SSUB16 __builtin_arm_ssub16 -#define __QSUB16 __builtin_arm_qsub16 -#define __SHSUB16 __builtin_arm_shsub16 -#define __USUB16 __builtin_arm_usub16 -#define __UQSUB16 __builtin_arm_uqsub16 -#define __UHSUB16 __builtin_arm_uhsub16 -#define __SASX __builtin_arm_sasx -#define __QASX __builtin_arm_qasx -#define __SHASX __builtin_arm_shasx -#define __UASX __builtin_arm_uasx -#define __UQASX __builtin_arm_uqasx -#define __UHASX __builtin_arm_uhasx -#define __SSAX __builtin_arm_ssax -#define __QSAX __builtin_arm_qsax -#define __SHSAX __builtin_arm_shsax -#define __USAX __builtin_arm_usax -#define __UQSAX __builtin_arm_uqsax -#define __UHSAX __builtin_arm_uhsax -#define __USAD8 __builtin_arm_usad8 -#define __USADA8 __builtin_arm_usada8 -#define __SSAT16 __builtin_arm_ssat16 -#define __USAT16 __builtin_arm_usat16 -#define __UXTB16 __builtin_arm_uxtb16 -#define __UXTAB16 __builtin_arm_uxtab16 -#define __SXTB16 __builtin_arm_sxtb16 -#define __SXTAB16 __builtin_arm_sxtab16 -#define __SMUAD __builtin_arm_smuad -#define __SMUADX __builtin_arm_smuadx -#define __SMLAD __builtin_arm_smlad -#define __SMLADX __builtin_arm_smladx -#define __SMLALD __builtin_arm_smlald -#define __SMLALDX __builtin_arm_smlaldx -#define __SMUSD __builtin_arm_smusd -#define __SMUSDX __builtin_arm_smusdx -#define __SMLSD __builtin_arm_smlsd -#define __SMLSDX __builtin_arm_smlsdx -#define __SMLSLD __builtin_arm_smlsld -#define __SMLSLDX __builtin_arm_smlsldx -#define __SEL __builtin_arm_sel -#define __QADD __builtin_arm_qadd -#define __QSUB __builtin_arm_qsub - -#define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \ - ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) ) - -#define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \ - ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) ) - -#define __SXTB16_RORn(ARG1, ARG2) __SXTB16(__ROR(ARG1, ARG2)) - -#define __SXTAB16_RORn(ARG1, ARG2, ARG3) __SXTAB16(ARG1, __ROR(ARG2, ARG3)) - -__STATIC_FORCEINLINE int32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3) -{ - int32_t result; - - __ASM volatile ("smmla %0, %1, %2, %3" : "=r" (result): "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -#endif /* (__ARM_FEATURE_DSP == 1) */ -/*@} end of group CMSIS_SIMD_intrinsics */ - - -#endif /* __CMSIS_ARMCLANG_H */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/CMSIS/Core/Include/cmsis_armclang_ltm.h b/bsp/nxp/mcx/mcxa/Libraries/CMSIS/Core/Include/cmsis_armclang_ltm.h deleted file mode 100644 index 1e255d5907f..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/CMSIS/Core/Include/cmsis_armclang_ltm.h +++ /dev/null @@ -1,1928 +0,0 @@ -/**************************************************************************//** - * @file cmsis_armclang_ltm.h - * @brief CMSIS compiler armclang (Arm Compiler 6) header file - * @version V1.5.3 - * @date 27. May 2021 - ******************************************************************************/ -/* - * Copyright (c) 2018-2021 Arm Limited. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - * - * 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. - */ - -/*lint -esym(9058, IRQn)*/ /* disable MISRA 2012 Rule 2.4 for IRQn */ - -#ifndef __CMSIS_ARMCLANG_H -#define __CMSIS_ARMCLANG_H - -#pragma clang system_header /* treat file as system include file */ - -/* CMSIS compiler specific defines */ -#ifndef __ASM - #define __ASM __asm -#endif -#ifndef __INLINE - #define __INLINE __inline -#endif -#ifndef __STATIC_INLINE - #define __STATIC_INLINE static __inline -#endif -#ifndef __STATIC_FORCEINLINE - #define __STATIC_FORCEINLINE __attribute__((always_inline)) static __inline -#endif -#ifndef __NO_RETURN - #define __NO_RETURN __attribute__((__noreturn__)) -#endif -#ifndef __USED - #define __USED __attribute__((used)) -#endif -#ifndef __WEAK - #define __WEAK __attribute__((weak)) -#endif -#ifndef __PACKED - #define __PACKED __attribute__((packed, aligned(1))) -#endif -#ifndef __PACKED_STRUCT - #define __PACKED_STRUCT struct __attribute__((packed, aligned(1))) -#endif -#ifndef __PACKED_UNION - #define __PACKED_UNION union __attribute__((packed, aligned(1))) -#endif -#ifndef __UNALIGNED_UINT32 /* deprecated */ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpacked" -/*lint -esym(9058, T_UINT32)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32 */ - struct __attribute__((packed)) T_UINT32 { uint32_t v; }; - #pragma clang diagnostic pop - #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) -#endif -#ifndef __UNALIGNED_UINT16_WRITE - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpacked" -/*lint -esym(9058, T_UINT16_WRITE)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT16_WRITE */ - __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; - #pragma clang diagnostic pop - #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) -#endif -#ifndef __UNALIGNED_UINT16_READ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpacked" -/*lint -esym(9058, T_UINT16_READ)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT16_READ */ - __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; - #pragma clang diagnostic pop - #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) -#endif -#ifndef __UNALIGNED_UINT32_WRITE - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpacked" -/*lint -esym(9058, T_UINT32_WRITE)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32_WRITE */ - __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; - #pragma clang diagnostic pop - #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) -#endif -#ifndef __UNALIGNED_UINT32_READ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpacked" -/*lint -esym(9058, T_UINT32_READ)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32_READ */ - __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; - #pragma clang diagnostic pop - #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) -#endif -#ifndef __ALIGNED - #define __ALIGNED(x) __attribute__((aligned(x))) -#endif -#ifndef __RESTRICT - #define __RESTRICT __restrict -#endif -#ifndef __COMPILER_BARRIER - #define __COMPILER_BARRIER() __ASM volatile("":::"memory") -#endif - -/* ######################### Startup and Lowlevel Init ######################## */ - -#ifndef __PROGRAM_START -#define __PROGRAM_START __main -#endif - -#ifndef __INITIAL_SP -#define __INITIAL_SP Image$$ARM_LIB_STACK$$ZI$$Limit -#endif - -#ifndef __STACK_LIMIT -#define __STACK_LIMIT Image$$ARM_LIB_STACK$$ZI$$Base -#endif - -#ifndef __VECTOR_TABLE -#define __VECTOR_TABLE __Vectors -#endif - -#ifndef __VECTOR_TABLE_ATTRIBUTE -#define __VECTOR_TABLE_ATTRIBUTE __attribute__((used, section("RESET"))) -#endif - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) -#ifndef __STACK_SEAL -#define __STACK_SEAL Image$$STACKSEAL$$ZI$$Base -#endif - -#ifndef __TZ_STACK_SEAL_SIZE -#define __TZ_STACK_SEAL_SIZE 8U -#endif - -#ifndef __TZ_STACK_SEAL_VALUE -#define __TZ_STACK_SEAL_VALUE 0xFEF5EDA5FEF5EDA5ULL -#endif - - -__STATIC_FORCEINLINE void __TZ_set_STACKSEAL_S (uint32_t* stackTop) { - *((uint64_t *)stackTop) = __TZ_STACK_SEAL_VALUE; -} -#endif - - -/* ########################## Core Instruction Access ######################### */ -/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface - Access to dedicated instructions - @{ -*/ - -/* Define macros for porting to both thumb1 and thumb2. - * For thumb1, use low register (r0-r7), specified by constraint "l" - * Otherwise, use general registers, specified by constraint "r" */ -#if defined (__thumb__) && !defined (__thumb2__) -#define __CMSIS_GCC_OUT_REG(r) "=l" (r) -#define __CMSIS_GCC_USE_REG(r) "l" (r) -#else -#define __CMSIS_GCC_OUT_REG(r) "=r" (r) -#define __CMSIS_GCC_USE_REG(r) "r" (r) -#endif - -/** - \brief No Operation - \details No Operation does nothing. This instruction can be used for code alignment purposes. - */ -#define __NOP __builtin_arm_nop - -/** - \brief Wait For Interrupt - \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. - */ -#define __WFI __builtin_arm_wfi - - -/** - \brief Wait For Event - \details Wait For Event is a hint instruction that permits the processor to enter - a low-power state until one of a number of events occurs. - */ -#define __WFE __builtin_arm_wfe - - -/** - \brief Send Event - \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. - */ -#define __SEV __builtin_arm_sev - - -/** - \brief Instruction Synchronization Barrier - \details Instruction Synchronization Barrier flushes the pipeline in the processor, - so that all instructions following the ISB are fetched from cache or memory, - after the instruction has been completed. - */ -#define __ISB() __builtin_arm_isb(0xF) - -/** - \brief Data Synchronization Barrier - \details Acts as a special kind of Data Memory Barrier. - It completes when all explicit memory accesses before this instruction complete. - */ -#define __DSB() __builtin_arm_dsb(0xF) - - -/** - \brief Data Memory Barrier - \details Ensures the apparent order of the explicit memory operations before - and after the instruction, without ensuring their completion. - */ -#define __DMB() __builtin_arm_dmb(0xF) - - -/** - \brief Reverse byte order (32 bit) - \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV(value) __builtin_bswap32(value) - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV16(value) __ROR(__REV(value), 16) - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REVSH(value) (int16_t)__builtin_bswap16(value) - - -/** - \brief Rotate Right in unsigned value (32 bit) - \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. - \param [in] op1 Value to rotate - \param [in] op2 Number of Bits to rotate - \return Rotated value - */ -__STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2) -{ - op2 %= 32U; - if (op2 == 0U) - { - return op1; - } - return (op1 >> op2) | (op1 << (32U - op2)); -} - - -/** - \brief Breakpoint - \details Causes the processor to enter Debug state. - Debug tools can use this to investigate system state when the instruction at a particular address is reached. - \param [in] value is ignored by the processor. - If required, a debugger can use it to store additional information about the breakpoint. - */ -#define __BKPT(value) __ASM volatile ("bkpt "#value) - - -/** - \brief Reverse bit order of value - \details Reverses the bit order of the given value. - \param [in] value Value to reverse - \return Reversed value - */ -#define __RBIT __builtin_arm_rbit - -/** - \brief Count leading zeros - \details Counts the number of leading zeros of a data value. - \param [in] value Value to count the leading zeros - \return number of leading zeros in value - */ -__STATIC_FORCEINLINE uint8_t __CLZ(uint32_t value) -{ - /* Even though __builtin_clz produces a CLZ instruction on ARM, formally - __builtin_clz(0) is undefined behaviour, so handle this case specially. - This guarantees ARM-compatible results if happening to compile on a non-ARM - target, and ensures the compiler doesn't decide to activate any - optimisations using the logic "value was passed to __builtin_clz, so it - is non-zero". - ARM Compiler 6.10 and possibly earlier will optimise this test away, leaving a - single CLZ instruction. - */ - if (value == 0U) - { - return 32U; - } - return __builtin_clz(value); -} - - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) -/** - \brief LDR Exclusive (8 bit) - \details Executes a exclusive LDR instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -#define __LDREXB (uint8_t)__builtin_arm_ldrex - - -/** - \brief LDR Exclusive (16 bit) - \details Executes a exclusive LDR instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -#define __LDREXH (uint16_t)__builtin_arm_ldrex - - -/** - \brief LDR Exclusive (32 bit) - \details Executes a exclusive LDR instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -#define __LDREXW (uint32_t)__builtin_arm_ldrex - - -/** - \brief STR Exclusive (8 bit) - \details Executes a exclusive STR instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STREXB (uint32_t)__builtin_arm_strex - - -/** - \brief STR Exclusive (16 bit) - \details Executes a exclusive STR instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STREXH (uint32_t)__builtin_arm_strex - - -/** - \brief STR Exclusive (32 bit) - \details Executes a exclusive STR instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STREXW (uint32_t)__builtin_arm_strex - - -/** - \brief Remove the exclusive lock - \details Removes the exclusive lock which is created by LDREX. - */ -#define __CLREX __builtin_arm_clrex - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) - -/** - \brief Signed Saturate - \details Saturates a signed value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (1..32) - \return Saturated value - */ -#define __SSAT __builtin_arm_ssat - - -/** - \brief Unsigned Saturate - \details Saturates an unsigned value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value - */ -#define __USAT __builtin_arm_usat - - -/** - \brief Rotate Right with Extend (32 bit) - \details Moves each bit of a bitstring right by one bit. - The carry input is shifted in at the left end of the bitstring. - \param [in] value Value to rotate - \return Rotated value - */ -__STATIC_FORCEINLINE uint32_t __RRX(uint32_t value) -{ - uint32_t result; - - __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return(result); -} - - -/** - \brief LDRT Unprivileged (8 bit) - \details Executes a Unprivileged LDRT instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -__STATIC_FORCEINLINE uint8_t __LDRBT(volatile uint8_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) ); - return ((uint8_t) result); /* Add explicit type cast here */ -} - - -/** - \brief LDRT Unprivileged (16 bit) - \details Executes a Unprivileged LDRT instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -__STATIC_FORCEINLINE uint16_t __LDRHT(volatile uint16_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) ); - return ((uint16_t) result); /* Add explicit type cast here */ -} - - -/** - \brief LDRT Unprivileged (32 bit) - \details Executes a Unprivileged LDRT instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -__STATIC_FORCEINLINE uint32_t __LDRT(volatile uint32_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*ptr) ); - return(result); -} - - -/** - \brief STRT Unprivileged (8 bit) - \details Executes a Unprivileged STRT instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STRBT(uint8_t value, volatile uint8_t *ptr) -{ - __ASM volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); -} - - -/** - \brief STRT Unprivileged (16 bit) - \details Executes a Unprivileged STRT instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STRHT(uint16_t value, volatile uint16_t *ptr) -{ - __ASM volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); -} - - -/** - \brief STRT Unprivileged (32 bit) - \details Executes a Unprivileged STRT instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STRT(uint32_t value, volatile uint32_t *ptr) -{ - __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) ); -} - -#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ - -/** - \brief Signed Saturate - \details Saturates a signed value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (1..32) - \return Saturated value - */ -__STATIC_FORCEINLINE int32_t __SSAT(int32_t val, uint32_t sat) -{ - if ((sat >= 1U) && (sat <= 32U)) - { - const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); - const int32_t min = -1 - max ; - if (val > max) - { - return max; - } - else if (val < min) - { - return min; - } - } - return val; -} - -/** - \brief Unsigned Saturate - \details Saturates an unsigned value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value - */ -__STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat) -{ - if (sat <= 31U) - { - const uint32_t max = ((1U << sat) - 1U); - if (val > (int32_t)max) - { - return max; - } - else if (val < 0) - { - return 0U; - } - } - return (uint32_t)val; -} - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) -/** - \brief Load-Acquire (8 bit) - \details Executes a LDAB instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -__STATIC_FORCEINLINE uint8_t __LDAB(volatile uint8_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldab %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint8_t) result); -} - - -/** - \brief Load-Acquire (16 bit) - \details Executes a LDAH instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -__STATIC_FORCEINLINE uint16_t __LDAH(volatile uint16_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldah %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint16_t) result); -} - - -/** - \brief Load-Acquire (32 bit) - \details Executes a LDA instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -__STATIC_FORCEINLINE uint32_t __LDA(volatile uint32_t *ptr) -{ - uint32_t result; - - __ASM volatile ("lda %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return(result); -} - - -/** - \brief Store-Release (8 bit) - \details Executes a STLB instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STLB(uint8_t value, volatile uint8_t *ptr) -{ - __ASM volatile ("stlb %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); -} - - -/** - \brief Store-Release (16 bit) - \details Executes a STLH instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STLH(uint16_t value, volatile uint16_t *ptr) -{ - __ASM volatile ("stlh %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); -} - - -/** - \brief Store-Release (32 bit) - \details Executes a STL instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STL(uint32_t value, volatile uint32_t *ptr) -{ - __ASM volatile ("stl %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); -} - - -/** - \brief Load-Acquire Exclusive (8 bit) - \details Executes a LDAB exclusive instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -#define __LDAEXB (uint8_t)__builtin_arm_ldaex - - -/** - \brief Load-Acquire Exclusive (16 bit) - \details Executes a LDAH exclusive instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -#define __LDAEXH (uint16_t)__builtin_arm_ldaex - - -/** - \brief Load-Acquire Exclusive (32 bit) - \details Executes a LDA exclusive instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -#define __LDAEX (uint32_t)__builtin_arm_ldaex - - -/** - \brief Store-Release Exclusive (8 bit) - \details Executes a STLB exclusive instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STLEXB (uint32_t)__builtin_arm_stlex - - -/** - \brief Store-Release Exclusive (16 bit) - \details Executes a STLH exclusive instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STLEXH (uint32_t)__builtin_arm_stlex - - -/** - \brief Store-Release Exclusive (32 bit) - \details Executes a STL exclusive instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STLEX (uint32_t)__builtin_arm_stlex - -#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ - -/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ - - -/* ########################### Core Function Access ########################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions - @{ - */ - -/** - \brief Enable IRQ Interrupts - \details Enables IRQ interrupts by clearing special-purpose register PRIMASK. - Can only be executed in Privileged modes. - */ -#ifndef __ARM_COMPAT_H -__STATIC_FORCEINLINE void __enable_irq(void) -{ - __ASM volatile ("cpsie i" : : : "memory"); -} -#endif - - -/** - \brief Disable IRQ Interrupts - \details Disables IRQ interrupts by setting special-purpose register PRIMASK. - Can only be executed in Privileged modes. - */ -#ifndef __ARM_COMPAT_H -__STATIC_FORCEINLINE void __disable_irq(void) -{ - __ASM volatile ("cpsid i" : : : "memory"); -} -#endif - - -/** - \brief Get Control Register - \details Returns the content of the Control Register. - \return Control Register value - */ -__STATIC_FORCEINLINE uint32_t __get_CONTROL(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, control" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Control Register (non-secure) - \details Returns the content of the non-secure Control Register when in secure mode. - \return non-secure Control Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_CONTROL_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, control_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Control Register - \details Writes the given value to the Control Register. - \param [in] control Control Register value to set - */ -__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control) -{ - __ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); - __ISB(); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Control Register (non-secure) - \details Writes the given value to the non-secure Control Register when in secure state. - \param [in] control Control Register value to set - */ -__STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control) -{ - __ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory"); - __ISB(); -} -#endif - - -/** - \brief Get IPSR Register - \details Returns the content of the IPSR Register. - \return IPSR Register value - */ -__STATIC_FORCEINLINE uint32_t __get_IPSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, ipsr" : "=r" (result) ); - return(result); -} - - -/** - \brief Get APSR Register - \details Returns the content of the APSR Register. - \return APSR Register value - */ -__STATIC_FORCEINLINE uint32_t __get_APSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, apsr" : "=r" (result) ); - return(result); -} - - -/** - \brief Get xPSR Register - \details Returns the content of the xPSR Register. - \return xPSR Register value - */ -__STATIC_FORCEINLINE uint32_t __get_xPSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, xpsr" : "=r" (result) ); - return(result); -} - - -/** - \brief Get Process Stack Pointer - \details Returns the current value of the Process Stack Pointer (PSP). - \return PSP Register value - */ -__STATIC_FORCEINLINE uint32_t __get_PSP(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, psp" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Process Stack Pointer (non-secure) - \details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state. - \return PSP Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PSP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, psp_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Process Stack Pointer - \details Assigns the given value to the Process Stack Pointer (PSP). - \param [in] topOfProcStack Process Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack) -{ - __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : ); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Process Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state. - \param [in] topOfProcStack Process Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack) -{ - __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : ); -} -#endif - - -/** - \brief Get Main Stack Pointer - \details Returns the current value of the Main Stack Pointer (MSP). - \return MSP Register value - */ -__STATIC_FORCEINLINE uint32_t __get_MSP(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, msp" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Main Stack Pointer (non-secure) - \details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state. - \return MSP Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_MSP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, msp_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Main Stack Pointer - \details Assigns the given value to the Main Stack Pointer (MSP). - \param [in] topOfMainStack Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack) -{ - __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : ); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Main Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state. - \param [in] topOfMainStack Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack) -{ - __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : ); -} -#endif - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Stack Pointer (non-secure) - \details Returns the current value of the non-secure Stack Pointer (SP) when in secure state. - \return SP Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_SP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, sp_ns" : "=r" (result) ); - return(result); -} - - -/** - \brief Set Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Stack Pointer (SP) when in secure state. - \param [in] topOfStack Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_SP_NS(uint32_t topOfStack) -{ - __ASM volatile ("MSR sp_ns, %0" : : "r" (topOfStack) : ); -} -#endif - - -/** - \brief Get Priority Mask - \details Returns the current state of the priority mask bit from the Priority Mask Register. - \return Priority Mask value - */ -__STATIC_FORCEINLINE uint32_t __get_PRIMASK(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, primask" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Priority Mask (non-secure) - \details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state. - \return Priority Mask value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PRIMASK_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, primask_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Priority Mask - \details Assigns the given value to the Priority Mask Register. - \param [in] priMask Priority Mask - */ -__STATIC_FORCEINLINE void __set_PRIMASK(uint32_t priMask) -{ - __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Priority Mask (non-secure) - \details Assigns the given value to the non-secure Priority Mask Register when in secure state. - \param [in] priMask Priority Mask - */ -__STATIC_FORCEINLINE void __TZ_set_PRIMASK_NS(uint32_t priMask) -{ - __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory"); -} -#endif - - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) -/** - \brief Enable FIQ - \details Enables FIQ interrupts by clearing special-purpose register FAULTMASK. - Can only be executed in Privileged modes. - */ -__STATIC_FORCEINLINE void __enable_fault_irq(void) -{ - __ASM volatile ("cpsie f" : : : "memory"); -} - - -/** - \brief Disable FIQ - \details Disables FIQ interrupts by setting special-purpose register FAULTMASK. - Can only be executed in Privileged modes. - */ -__STATIC_FORCEINLINE void __disable_fault_irq(void) -{ - __ASM volatile ("cpsid f" : : : "memory"); -} - - -/** - \brief Get Base Priority - \details Returns the current value of the Base Priority register. - \return Base Priority register value - */ -__STATIC_FORCEINLINE uint32_t __get_BASEPRI(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, basepri" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Base Priority (non-secure) - \details Returns the current value of the non-secure Base Priority register when in secure state. - \return Base Priority register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_BASEPRI_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, basepri_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Base Priority - \details Assigns the given value to the Base Priority register. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __set_BASEPRI(uint32_t basePri) -{ - __ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory"); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Base Priority (non-secure) - \details Assigns the given value to the non-secure Base Priority register when in secure state. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __TZ_set_BASEPRI_NS(uint32_t basePri) -{ - __ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "memory"); -} -#endif - - -/** - \brief Set Base Priority with condition - \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, - or the new value increases the BASEPRI priority level. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __set_BASEPRI_MAX(uint32_t basePri) -{ - __ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory"); -} - - -/** - \brief Get Fault Mask - \details Returns the current value of the Fault Mask register. - \return Fault Mask register value - */ -__STATIC_FORCEINLINE uint32_t __get_FAULTMASK(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Fault Mask (non-secure) - \details Returns the current value of the non-secure Fault Mask register when in secure state. - \return Fault Mask register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_FAULTMASK_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, faultmask_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Fault Mask - \details Assigns the given value to the Fault Mask register. - \param [in] faultMask Fault Mask value to set - */ -__STATIC_FORCEINLINE void __set_FAULTMASK(uint32_t faultMask) -{ - __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Fault Mask (non-secure) - \details Assigns the given value to the non-secure Fault Mask register when in secure state. - \param [in] faultMask Fault Mask value to set - */ -__STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) -{ - __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory"); -} -#endif - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) - -/** - \brief Get Process Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always in non-secure - mode. - - \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). - \return PSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __get_PSPLIM(void) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, psplim" : "=r" (result) ); - return result; -#endif -} - -#if (defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Process Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always in non-secure - mode. - - \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \return PSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS(void) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, psplim_ns" : "=r" (result) ); - return result; -#endif -} -#endif - - -/** - \brief Set Process Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored in non-secure - mode. - - \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set - */ -__STATIC_FORCEINLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - (void)ProcStackPtrLimit; -#else - __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit)); -#endif -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Process Stack Pointer (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored in non-secure - mode. - - \details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set - */ -__STATIC_FORCEINLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - (void)ProcStackPtrLimit; -#else - __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit)); -#endif -} -#endif - - -/** - \brief Get Main Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always. - - \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). - \return MSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __get_MSPLIM(void) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, msplim" : "=r" (result) ); - return result; -#endif -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Main Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always. - - \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. - \return MSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS(void) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) ); - return result; -#endif -} -#endif - - -/** - \brief Set Main Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored. - - \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). - \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set - */ -__STATIC_FORCEINLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - (void)MainStackPtrLimit; -#else - __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit)); -#endif -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Main Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored. - - \details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state. - \param [in] MainStackPtrLimit Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - (void)MainStackPtrLimit; -#else - __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit)); -#endif -} -#endif - -#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ - -/** - \brief Get FPSCR - \details Returns the current value of the Floating Point Status/Control register. - \return Floating Point Status/Control register value - */ -#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) -#define __get_FPSCR (uint32_t)__builtin_arm_get_fpscr -#else -#define __get_FPSCR() ((uint32_t)0U) -#endif - -/** - \brief Set FPSCR - \details Assigns the given value to the Floating Point Status/Control register. - \param [in] fpscr Floating Point Status/Control value to set - */ -#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) -#define __set_FPSCR __builtin_arm_set_fpscr -#else -#define __set_FPSCR(x) ((void)(x)) -#endif - - -/*@} end of CMSIS_Core_RegAccFunctions */ - - -/* ################### Compiler specific Intrinsics ########################### */ -/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics - Access to dedicated SIMD instructions - @{ -*/ - -#if (defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1)) - -__STATIC_FORCEINLINE uint32_t __SADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - - -__STATIC_FORCEINLINE uint32_t __SSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("ssub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __USUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - - -__STATIC_FORCEINLINE uint32_t __SADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("ssub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __USUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("ssax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __USAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __USAD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usad8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __USADA8(uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("usada8 %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -#define __SSAT16(ARG1,ARG2) \ -({ \ - int32_t __RES, __ARG1 = (ARG1); \ - __ASM ("ssat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ - __RES; \ - }) - -#define __USAT16(ARG1,ARG2) \ -({ \ - uint32_t __RES, __ARG1 = (ARG1); \ - __ASM ("usat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ - __RES; \ - }) - -__STATIC_FORCEINLINE uint32_t __UXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile ("uxtb16 %0, %1" : "=r" (result) : "r" (op1)); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UXTAB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile ("sxtb16 %0, %1" : "=r" (result) : "r" (op1)); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SXTAB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMUAD (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smuad %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMUADX (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smuadx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMLAD (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smlad %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMLADX (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smladx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__STATIC_FORCEINLINE uint64_t __SMLALD (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__STATIC_FORCEINLINE uint64_t __SMLALDX (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__STATIC_FORCEINLINE uint32_t __SMUSD (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smusd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMUSDX (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smusdx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMLSD (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smlsd %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMLSDX (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smlsdx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__STATIC_FORCEINLINE uint64_t __SMLSLD (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__STATIC_FORCEINLINE uint64_t __SMLSLDX (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__STATIC_FORCEINLINE uint32_t __SEL (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sel %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE int32_t __QADD( int32_t op1, int32_t op2) -{ - int32_t result; - - __ASM volatile ("qadd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE int32_t __QSUB( int32_t op1, int32_t op2) -{ - int32_t result; - - __ASM volatile ("qsub %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -#define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \ - ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) ) - -#define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \ - ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) ) - -#define __SXTB16_RORn(ARG1, ARG2) __SXTB16(__ROR(ARG1, ARG2)) - -#define __SXTAB16_RORn(ARG1, ARG2, ARG3) __SXTAB16(ARG1, __ROR(ARG2, ARG3)) - -__STATIC_FORCEINLINE int32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3) -{ - int32_t result; - - __ASM volatile ("smmla %0, %1, %2, %3" : "=r" (result): "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -#endif /* (__ARM_FEATURE_DSP == 1) */ -/*@} end of group CMSIS_SIMD_intrinsics */ - - -#endif /* __CMSIS_ARMCLANG_H */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/CMSIS/Core/Include/cmsis_compiler.h b/bsp/nxp/mcx/mcxa/Libraries/CMSIS/Core/Include/cmsis_compiler.h deleted file mode 100644 index adbf296f15a..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/CMSIS/Core/Include/cmsis_compiler.h +++ /dev/null @@ -1,283 +0,0 @@ -/**************************************************************************//** - * @file cmsis_compiler.h - * @brief CMSIS compiler generic header file - * @version V5.1.0 - * @date 09. October 2018 - ******************************************************************************/ -/* - * Copyright (c) 2009-2018 Arm Limited. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - * - * 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 __CMSIS_COMPILER_H -#define __CMSIS_COMPILER_H - -#include - -/* - * Arm Compiler 4/5 - */ -#if defined ( __CC_ARM ) - #include "cmsis_armcc.h" - - -/* - * Arm Compiler 6.6 LTM (armclang) - */ -#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) && (__ARMCC_VERSION < 6100100) - #include "cmsis_armclang_ltm.h" - - /* - * Arm Compiler above 6.10.1 (armclang) - */ -#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6100100) - #include "cmsis_armclang.h" - - -/* - * GNU Compiler - */ -#elif defined ( __GNUC__ ) - #include "cmsis_gcc.h" - - -/* - * IAR Compiler - */ -#elif defined ( __ICCARM__ ) - #include - - -/* - * TI Arm Compiler - */ -#elif defined ( __TI_ARM__ ) - #include - - #ifndef __ASM - #define __ASM __asm - #endif - #ifndef __INLINE - #define __INLINE inline - #endif - #ifndef __STATIC_INLINE - #define __STATIC_INLINE static inline - #endif - #ifndef __STATIC_FORCEINLINE - #define __STATIC_FORCEINLINE __STATIC_INLINE - #endif - #ifndef __NO_RETURN - #define __NO_RETURN __attribute__((noreturn)) - #endif - #ifndef __USED - #define __USED __attribute__((used)) - #endif - #ifndef __WEAK - #define __WEAK __attribute__((weak)) - #endif - #ifndef __PACKED - #define __PACKED __attribute__((packed)) - #endif - #ifndef __PACKED_STRUCT - #define __PACKED_STRUCT struct __attribute__((packed)) - #endif - #ifndef __PACKED_UNION - #define __PACKED_UNION union __attribute__((packed)) - #endif - #ifndef __UNALIGNED_UINT32 /* deprecated */ - struct __attribute__((packed)) T_UINT32 { uint32_t v; }; - #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) - #endif - #ifndef __UNALIGNED_UINT16_WRITE - __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; - #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void*)(addr))->v) = (val)) - #endif - #ifndef __UNALIGNED_UINT16_READ - __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; - #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) - #endif - #ifndef __UNALIGNED_UINT32_WRITE - __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; - #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) - #endif - #ifndef __UNALIGNED_UINT32_READ - __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; - #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) - #endif - #ifndef __ALIGNED - #define __ALIGNED(x) __attribute__((aligned(x))) - #endif - #ifndef __RESTRICT - #define __RESTRICT __restrict - #endif - #ifndef __COMPILER_BARRIER - #warning No compiler specific solution for __COMPILER_BARRIER. __COMPILER_BARRIER is ignored. - #define __COMPILER_BARRIER() (void)0 - #endif - - -/* - * TASKING Compiler - */ -#elif defined ( __TASKING__ ) - /* - * The CMSIS functions have been implemented as intrinsics in the compiler. - * Please use "carm -?i" to get an up to date list of all intrinsics, - * Including the CMSIS ones. - */ - - #ifndef __ASM - #define __ASM __asm - #endif - #ifndef __INLINE - #define __INLINE inline - #endif - #ifndef __STATIC_INLINE - #define __STATIC_INLINE static inline - #endif - #ifndef __STATIC_FORCEINLINE - #define __STATIC_FORCEINLINE __STATIC_INLINE - #endif - #ifndef __NO_RETURN - #define __NO_RETURN __attribute__((noreturn)) - #endif - #ifndef __USED - #define __USED __attribute__((used)) - #endif - #ifndef __WEAK - #define __WEAK __attribute__((weak)) - #endif - #ifndef __PACKED - #define __PACKED __packed__ - #endif - #ifndef __PACKED_STRUCT - #define __PACKED_STRUCT struct __packed__ - #endif - #ifndef __PACKED_UNION - #define __PACKED_UNION union __packed__ - #endif - #ifndef __UNALIGNED_UINT32 /* deprecated */ - struct __packed__ T_UINT32 { uint32_t v; }; - #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) - #endif - #ifndef __UNALIGNED_UINT16_WRITE - __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; - #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) - #endif - #ifndef __UNALIGNED_UINT16_READ - __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; - #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) - #endif - #ifndef __UNALIGNED_UINT32_WRITE - __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; - #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) - #endif - #ifndef __UNALIGNED_UINT32_READ - __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; - #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) - #endif - #ifndef __ALIGNED - #define __ALIGNED(x) __align(x) - #endif - #ifndef __RESTRICT - #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored. - #define __RESTRICT - #endif - #ifndef __COMPILER_BARRIER - #warning No compiler specific solution for __COMPILER_BARRIER. __COMPILER_BARRIER is ignored. - #define __COMPILER_BARRIER() (void)0 - #endif - - -/* - * COSMIC Compiler - */ -#elif defined ( __CSMC__ ) - #include - - #ifndef __ASM - #define __ASM _asm - #endif - #ifndef __INLINE - #define __INLINE inline - #endif - #ifndef __STATIC_INLINE - #define __STATIC_INLINE static inline - #endif - #ifndef __STATIC_FORCEINLINE - #define __STATIC_FORCEINLINE __STATIC_INLINE - #endif - #ifndef __NO_RETURN - // NO RETURN is automatically detected hence no warning here - #define __NO_RETURN - #endif - #ifndef __USED - #warning No compiler specific solution for __USED. __USED is ignored. - #define __USED - #endif - #ifndef __WEAK - #define __WEAK __weak - #endif - #ifndef __PACKED - #define __PACKED @packed - #endif - #ifndef __PACKED_STRUCT - #define __PACKED_STRUCT @packed struct - #endif - #ifndef __PACKED_UNION - #define __PACKED_UNION @packed union - #endif - #ifndef __UNALIGNED_UINT32 /* deprecated */ - @packed struct T_UINT32 { uint32_t v; }; - #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) - #endif - #ifndef __UNALIGNED_UINT16_WRITE - __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; - #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) - #endif - #ifndef __UNALIGNED_UINT16_READ - __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; - #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) - #endif - #ifndef __UNALIGNED_UINT32_WRITE - __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; - #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) - #endif - #ifndef __UNALIGNED_UINT32_READ - __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; - #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) - #endif - #ifndef __ALIGNED - #warning No compiler specific solution for __ALIGNED. __ALIGNED is ignored. - #define __ALIGNED(x) - #endif - #ifndef __RESTRICT - #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored. - #define __RESTRICT - #endif - #ifndef __COMPILER_BARRIER - #warning No compiler specific solution for __COMPILER_BARRIER. __COMPILER_BARRIER is ignored. - #define __COMPILER_BARRIER() (void)0 - #endif - - -#else - #error Unknown compiler. -#endif - - -#endif /* __CMSIS_COMPILER_H */ - diff --git a/bsp/nxp/mcx/mcxa/Libraries/CMSIS/Core/Include/cmsis_gcc.h b/bsp/nxp/mcx/mcxa/Libraries/CMSIS/Core/Include/cmsis_gcc.h deleted file mode 100644 index 67bda4ef3c3..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/CMSIS/Core/Include/cmsis_gcc.h +++ /dev/null @@ -1,2211 +0,0 @@ -/**************************************************************************//** - * @file cmsis_gcc.h - * @brief CMSIS compiler GCC header file - * @version V5.4.1 - * @date 27. May 2021 - ******************************************************************************/ -/* - * Copyright (c) 2009-2021 Arm Limited. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - * - * 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 __CMSIS_GCC_H -#define __CMSIS_GCC_H - -/* ignore some GCC warnings */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-conversion" -#pragma GCC diagnostic ignored "-Wconversion" -#pragma GCC diagnostic ignored "-Wunused-parameter" - -/* Fallback for __has_builtin */ -#ifndef __has_builtin - #define __has_builtin(x) (0) -#endif - -/* CMSIS compiler specific defines */ -#ifndef __ASM - #define __ASM __asm -#endif -#ifndef __INLINE - #define __INLINE inline -#endif -#ifndef __STATIC_INLINE - #define __STATIC_INLINE static inline -#endif -#ifndef __STATIC_FORCEINLINE - #define __STATIC_FORCEINLINE __attribute__((always_inline)) static inline -#endif -#ifndef __NO_RETURN - #define __NO_RETURN __attribute__((__noreturn__)) -#endif -#ifndef __USED - #define __USED __attribute__((used)) -#endif -#ifndef __WEAK - #define __WEAK __attribute__((weak)) -#endif -#ifndef __PACKED - #define __PACKED __attribute__((packed, aligned(1))) -#endif -#ifndef __PACKED_STRUCT - #define __PACKED_STRUCT struct __attribute__((packed, aligned(1))) -#endif -#ifndef __PACKED_UNION - #define __PACKED_UNION union __attribute__((packed, aligned(1))) -#endif -#ifndef __UNALIGNED_UINT32 /* deprecated */ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wpacked" - #pragma GCC diagnostic ignored "-Wattributes" - struct __attribute__((packed)) T_UINT32 { uint32_t v; }; - #pragma GCC diagnostic pop - #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) -#endif -#ifndef __UNALIGNED_UINT16_WRITE - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wpacked" - #pragma GCC diagnostic ignored "-Wattributes" - __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; - #pragma GCC diagnostic pop - #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) -#endif -#ifndef __UNALIGNED_UINT16_READ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wpacked" - #pragma GCC diagnostic ignored "-Wattributes" - __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; - #pragma GCC diagnostic pop - #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) -#endif -#ifndef __UNALIGNED_UINT32_WRITE - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wpacked" - #pragma GCC diagnostic ignored "-Wattributes" - __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; - #pragma GCC diagnostic pop - #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) -#endif -#ifndef __UNALIGNED_UINT32_READ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wpacked" - #pragma GCC diagnostic ignored "-Wattributes" - __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; - #pragma GCC diagnostic pop - #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) -#endif -#ifndef __ALIGNED - #define __ALIGNED(x) __attribute__((aligned(x))) -#endif -#ifndef __RESTRICT - #define __RESTRICT __restrict -#endif -#ifndef __COMPILER_BARRIER - #define __COMPILER_BARRIER() __ASM volatile("":::"memory") -#endif - -/* ######################### Startup and Lowlevel Init ######################## */ - -#ifndef __PROGRAM_START - -/** - \brief Initializes data and bss sections - \details This default implementations initialized all data and additional bss - sections relying on .copy.table and .zero.table specified properly - in the used linker script. - - */ -__STATIC_FORCEINLINE __NO_RETURN void __cmsis_start(void) -{ - extern void _start(void) __NO_RETURN; - - typedef struct { - uint32_t const* src; - uint32_t* dest; - uint32_t wlen; - } __copy_table_t; - - typedef struct { - uint32_t* dest; - uint32_t wlen; - } __zero_table_t; - - extern const __copy_table_t __copy_table_start__; - extern const __copy_table_t __copy_table_end__; - extern const __zero_table_t __zero_table_start__; - extern const __zero_table_t __zero_table_end__; - - for (__copy_table_t const* pTable = &__copy_table_start__; pTable < &__copy_table_end__; ++pTable) { - for(uint32_t i=0u; iwlen; ++i) { - pTable->dest[i] = pTable->src[i]; - } - } - - for (__zero_table_t const* pTable = &__zero_table_start__; pTable < &__zero_table_end__; ++pTable) { - for(uint32_t i=0u; iwlen; ++i) { - pTable->dest[i] = 0u; - } - } - - _start(); -} - -#define __PROGRAM_START __cmsis_start -#endif - -#ifndef __INITIAL_SP -#define __INITIAL_SP __StackTop -#endif - -#ifndef __STACK_LIMIT -#define __STACK_LIMIT __StackLimit -#endif - -#ifndef __VECTOR_TABLE -#define __VECTOR_TABLE __Vectors -#endif - -#ifndef __VECTOR_TABLE_ATTRIBUTE -#define __VECTOR_TABLE_ATTRIBUTE __attribute__((used, section(".vectors"))) -#endif - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) -#ifndef __STACK_SEAL -#define __STACK_SEAL __StackSeal -#endif - -#ifndef __TZ_STACK_SEAL_SIZE -#define __TZ_STACK_SEAL_SIZE 8U -#endif - -#ifndef __TZ_STACK_SEAL_VALUE -#define __TZ_STACK_SEAL_VALUE 0xFEF5EDA5FEF5EDA5ULL -#endif - - -__STATIC_FORCEINLINE void __TZ_set_STACKSEAL_S (uint32_t* stackTop) { - *((uint64_t *)stackTop) = __TZ_STACK_SEAL_VALUE; -} -#endif - - -/* ########################## Core Instruction Access ######################### */ -/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface - Access to dedicated instructions - @{ -*/ - -/* Define macros for porting to both thumb1 and thumb2. - * For thumb1, use low register (r0-r7), specified by constraint "l" - * Otherwise, use general registers, specified by constraint "r" */ -#if defined (__thumb__) && !defined (__thumb2__) -#define __CMSIS_GCC_OUT_REG(r) "=l" (r) -#define __CMSIS_GCC_RW_REG(r) "+l" (r) -#define __CMSIS_GCC_USE_REG(r) "l" (r) -#else -#define __CMSIS_GCC_OUT_REG(r) "=r" (r) -#define __CMSIS_GCC_RW_REG(r) "+r" (r) -#define __CMSIS_GCC_USE_REG(r) "r" (r) -#endif - -/** - \brief No Operation - \details No Operation does nothing. This instruction can be used for code alignment purposes. - */ -#define __NOP() __ASM volatile ("nop") - -/** - \brief Wait For Interrupt - \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. - */ -#define __WFI() __ASM volatile ("wfi":::"memory") - - -/** - \brief Wait For Event - \details Wait For Event is a hint instruction that permits the processor to enter - a low-power state until one of a number of events occurs. - */ -#define __WFE() __ASM volatile ("wfe":::"memory") - - -/** - \brief Send Event - \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. - */ -#define __SEV() __ASM volatile ("sev") - - -/** - \brief Instruction Synchronization Barrier - \details Instruction Synchronization Barrier flushes the pipeline in the processor, - so that all instructions following the ISB are fetched from cache or memory, - after the instruction has been completed. - */ -__STATIC_FORCEINLINE void __ISB(void) -{ - __ASM volatile ("isb 0xF":::"memory"); -} - - -/** - \brief Data Synchronization Barrier - \details Acts as a special kind of Data Memory Barrier. - It completes when all explicit memory accesses before this instruction complete. - */ -__STATIC_FORCEINLINE void __DSB(void) -{ - __ASM volatile ("dsb 0xF":::"memory"); -} - - -/** - \brief Data Memory Barrier - \details Ensures the apparent order of the explicit memory operations before - and after the instruction, without ensuring their completion. - */ -__STATIC_FORCEINLINE void __DMB(void) -{ - __ASM volatile ("dmb 0xF":::"memory"); -} - - -/** - \brief Reverse byte order (32 bit) - \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412. - \param [in] value Value to reverse - \return Reversed value - */ -__STATIC_FORCEINLINE uint32_t __REV(uint32_t value) -{ -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) - return __builtin_bswap32(value); -#else - uint32_t result; - - __ASM ("rev %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return result; -#endif -} - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856. - \param [in] value Value to reverse - \return Reversed value - */ -__STATIC_FORCEINLINE uint32_t __REV16(uint32_t value) -{ - uint32_t result; - - __ASM ("rev16 %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return result; -} - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000. - \param [in] value Value to reverse - \return Reversed value - */ -__STATIC_FORCEINLINE int16_t __REVSH(int16_t value) -{ -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - return (int16_t)__builtin_bswap16(value); -#else - int16_t result; - - __ASM ("revsh %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return result; -#endif -} - - -/** - \brief Rotate Right in unsigned value (32 bit) - \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. - \param [in] op1 Value to rotate - \param [in] op2 Number of Bits to rotate - \return Rotated value - */ -__STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2) -{ - op2 %= 32U; - if (op2 == 0U) - { - return op1; - } - return (op1 >> op2) | (op1 << (32U - op2)); -} - - -/** - \brief Breakpoint - \details Causes the processor to enter Debug state. - Debug tools can use this to investigate system state when the instruction at a particular address is reached. - \param [in] value is ignored by the processor. - If required, a debugger can use it to store additional information about the breakpoint. - */ -#define __BKPT(value) __ASM volatile ("bkpt "#value) - - -/** - \brief Reverse bit order of value - \details Reverses the bit order of the given value. - \param [in] value Value to reverse - \return Reversed value - */ -__STATIC_FORCEINLINE uint32_t __RBIT(uint32_t value) -{ - uint32_t result; - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) - __ASM ("rbit %0, %1" : "=r" (result) : "r" (value) ); -#else - uint32_t s = (4U /*sizeof(v)*/ * 8U) - 1U; /* extra shift needed at end */ - - result = value; /* r will be reversed bits of v; first get LSB of v */ - for (value >>= 1U; value != 0U; value >>= 1U) - { - result <<= 1U; - result |= value & 1U; - s--; - } - result <<= s; /* shift when v's highest bits are zero */ -#endif - return result; -} - - -/** - \brief Count leading zeros - \details Counts the number of leading zeros of a data value. - \param [in] value Value to count the leading zeros - \return number of leading zeros in value - */ -__STATIC_FORCEINLINE uint8_t __CLZ(uint32_t value) -{ - /* Even though __builtin_clz produces a CLZ instruction on ARM, formally - __builtin_clz(0) is undefined behaviour, so handle this case specially. - This guarantees ARM-compatible results if happening to compile on a non-ARM - target, and ensures the compiler doesn't decide to activate any - optimisations using the logic "value was passed to __builtin_clz, so it - is non-zero". - ARM GCC 7.3 and possibly earlier will optimise this test away, leaving a - single CLZ instruction. - */ - if (value == 0U) - { - return 32U; - } - return __builtin_clz(value); -} - - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) -/** - \brief LDR Exclusive (8 bit) - \details Executes a exclusive LDR instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -__STATIC_FORCEINLINE uint8_t __LDREXB(volatile uint8_t *addr) -{ - uint32_t result; - -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - __ASM volatile ("ldrexb %0, %1" : "=r" (result) : "Q" (*addr) ); -#else - /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not - accepted by assembler. So has to use following less efficient pattern. - */ - __ASM volatile ("ldrexb %0, [%1]" : "=r" (result) : "r" (addr) : "memory" ); -#endif - return ((uint8_t) result); /* Add explicit type cast here */ -} - - -/** - \brief LDR Exclusive (16 bit) - \details Executes a exclusive LDR instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -__STATIC_FORCEINLINE uint16_t __LDREXH(volatile uint16_t *addr) -{ - uint32_t result; - -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - __ASM volatile ("ldrexh %0, %1" : "=r" (result) : "Q" (*addr) ); -#else - /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not - accepted by assembler. So has to use following less efficient pattern. - */ - __ASM volatile ("ldrexh %0, [%1]" : "=r" (result) : "r" (addr) : "memory" ); -#endif - return ((uint16_t) result); /* Add explicit type cast here */ -} - - -/** - \brief LDR Exclusive (32 bit) - \details Executes a exclusive LDR instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -__STATIC_FORCEINLINE uint32_t __LDREXW(volatile uint32_t *addr) -{ - uint32_t result; - - __ASM volatile ("ldrex %0, %1" : "=r" (result) : "Q" (*addr) ); - return(result); -} - - -/** - \brief STR Exclusive (8 bit) - \details Executes a exclusive STR instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -__STATIC_FORCEINLINE uint32_t __STREXB(uint8_t value, volatile uint8_t *addr) -{ - uint32_t result; - - __ASM volatile ("strexb %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) ); - return(result); -} - - -/** - \brief STR Exclusive (16 bit) - \details Executes a exclusive STR instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -__STATIC_FORCEINLINE uint32_t __STREXH(uint16_t value, volatile uint16_t *addr) -{ - uint32_t result; - - __ASM volatile ("strexh %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) ); - return(result); -} - - -/** - \brief STR Exclusive (32 bit) - \details Executes a exclusive STR instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -__STATIC_FORCEINLINE uint32_t __STREXW(uint32_t value, volatile uint32_t *addr) -{ - uint32_t result; - - __ASM volatile ("strex %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" (value) ); - return(result); -} - - -/** - \brief Remove the exclusive lock - \details Removes the exclusive lock which is created by LDREX. - */ -__STATIC_FORCEINLINE void __CLREX(void) -{ - __ASM volatile ("clrex" ::: "memory"); -} - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) -/** - \brief Signed Saturate - \details Saturates a signed value. - \param [in] ARG1 Value to be saturated - \param [in] ARG2 Bit position to saturate to (1..32) - \return Saturated value - */ -#define __SSAT(ARG1, ARG2) \ -__extension__ \ -({ \ - int32_t __RES, __ARG1 = (ARG1); \ - __ASM volatile ("ssat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) : "cc" ); \ - __RES; \ - }) - - -/** - \brief Unsigned Saturate - \details Saturates an unsigned value. - \param [in] ARG1 Value to be saturated - \param [in] ARG2 Bit position to saturate to (0..31) - \return Saturated value - */ -#define __USAT(ARG1, ARG2) \ -__extension__ \ -({ \ - uint32_t __RES, __ARG1 = (ARG1); \ - __ASM volatile ("usat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) : "cc" ); \ - __RES; \ - }) - - -/** - \brief Rotate Right with Extend (32 bit) - \details Moves each bit of a bitstring right by one bit. - The carry input is shifted in at the left end of the bitstring. - \param [in] value Value to rotate - \return Rotated value - */ -__STATIC_FORCEINLINE uint32_t __RRX(uint32_t value) -{ - uint32_t result; - - __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return(result); -} - - -/** - \brief LDRT Unprivileged (8 bit) - \details Executes a Unprivileged LDRT instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -__STATIC_FORCEINLINE uint8_t __LDRBT(volatile uint8_t *ptr) -{ - uint32_t result; - -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) ); -#else - /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not - accepted by assembler. So has to use following less efficient pattern. - */ - __ASM volatile ("ldrbt %0, [%1]" : "=r" (result) : "r" (ptr) : "memory" ); -#endif - return ((uint8_t) result); /* Add explicit type cast here */ -} - - -/** - \brief LDRT Unprivileged (16 bit) - \details Executes a Unprivileged LDRT instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -__STATIC_FORCEINLINE uint16_t __LDRHT(volatile uint16_t *ptr) -{ - uint32_t result; - -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) ); -#else - /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not - accepted by assembler. So has to use following less efficient pattern. - */ - __ASM volatile ("ldrht %0, [%1]" : "=r" (result) : "r" (ptr) : "memory" ); -#endif - return ((uint16_t) result); /* Add explicit type cast here */ -} - - -/** - \brief LDRT Unprivileged (32 bit) - \details Executes a Unprivileged LDRT instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -__STATIC_FORCEINLINE uint32_t __LDRT(volatile uint32_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*ptr) ); - return(result); -} - - -/** - \brief STRT Unprivileged (8 bit) - \details Executes a Unprivileged STRT instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STRBT(uint8_t value, volatile uint8_t *ptr) -{ - __ASM volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); -} - - -/** - \brief STRT Unprivileged (16 bit) - \details Executes a Unprivileged STRT instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STRHT(uint16_t value, volatile uint16_t *ptr) -{ - __ASM volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); -} - - -/** - \brief STRT Unprivileged (32 bit) - \details Executes a Unprivileged STRT instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STRT(uint32_t value, volatile uint32_t *ptr) -{ - __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) ); -} - -#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ - -/** - \brief Signed Saturate - \details Saturates a signed value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (1..32) - \return Saturated value - */ -__STATIC_FORCEINLINE int32_t __SSAT(int32_t val, uint32_t sat) -{ - if ((sat >= 1U) && (sat <= 32U)) - { - const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); - const int32_t min = -1 - max ; - if (val > max) - { - return max; - } - else if (val < min) - { - return min; - } - } - return val; -} - -/** - \brief Unsigned Saturate - \details Saturates an unsigned value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value - */ -__STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat) -{ - if (sat <= 31U) - { - const uint32_t max = ((1U << sat) - 1U); - if (val > (int32_t)max) - { - return max; - } - else if (val < 0) - { - return 0U; - } - } - return (uint32_t)val; -} - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) -/** - \brief Load-Acquire (8 bit) - \details Executes a LDAB instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -__STATIC_FORCEINLINE uint8_t __LDAB(volatile uint8_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldab %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint8_t) result); -} - - -/** - \brief Load-Acquire (16 bit) - \details Executes a LDAH instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -__STATIC_FORCEINLINE uint16_t __LDAH(volatile uint16_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldah %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint16_t) result); -} - - -/** - \brief Load-Acquire (32 bit) - \details Executes a LDA instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -__STATIC_FORCEINLINE uint32_t __LDA(volatile uint32_t *ptr) -{ - uint32_t result; - - __ASM volatile ("lda %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return(result); -} - - -/** - \brief Store-Release (8 bit) - \details Executes a STLB instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STLB(uint8_t value, volatile uint8_t *ptr) -{ - __ASM volatile ("stlb %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); -} - - -/** - \brief Store-Release (16 bit) - \details Executes a STLH instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STLH(uint16_t value, volatile uint16_t *ptr) -{ - __ASM volatile ("stlh %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); -} - - -/** - \brief Store-Release (32 bit) - \details Executes a STL instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STL(uint32_t value, volatile uint32_t *ptr) -{ - __ASM volatile ("stl %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); -} - - -/** - \brief Load-Acquire Exclusive (8 bit) - \details Executes a LDAB exclusive instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -__STATIC_FORCEINLINE uint8_t __LDAEXB(volatile uint8_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldaexb %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint8_t) result); -} - - -/** - \brief Load-Acquire Exclusive (16 bit) - \details Executes a LDAH exclusive instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -__STATIC_FORCEINLINE uint16_t __LDAEXH(volatile uint16_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldaexh %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint16_t) result); -} - - -/** - \brief Load-Acquire Exclusive (32 bit) - \details Executes a LDA exclusive instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -__STATIC_FORCEINLINE uint32_t __LDAEX(volatile uint32_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldaex %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return(result); -} - - -/** - \brief Store-Release Exclusive (8 bit) - \details Executes a STLB exclusive instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -__STATIC_FORCEINLINE uint32_t __STLEXB(uint8_t value, volatile uint8_t *ptr) -{ - uint32_t result; - - __ASM volatile ("stlexb %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); - return(result); -} - - -/** - \brief Store-Release Exclusive (16 bit) - \details Executes a STLH exclusive instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -__STATIC_FORCEINLINE uint32_t __STLEXH(uint16_t value, volatile uint16_t *ptr) -{ - uint32_t result; - - __ASM volatile ("stlexh %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); - return(result); -} - - -/** - \brief Store-Release Exclusive (32 bit) - \details Executes a STL exclusive instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -__STATIC_FORCEINLINE uint32_t __STLEX(uint32_t value, volatile uint32_t *ptr) -{ - uint32_t result; - - __ASM volatile ("stlex %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); - return(result); -} - -#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ - -/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ - - -/* ########################### Core Function Access ########################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions - @{ - */ - -/** - \brief Enable IRQ Interrupts - \details Enables IRQ interrupts by clearing special-purpose register PRIMASK. - Can only be executed in Privileged modes. - */ -__STATIC_FORCEINLINE void __enable_irq(void) -{ - __ASM volatile ("cpsie i" : : : "memory"); -} - - -/** - \brief Disable IRQ Interrupts - \details Disables IRQ interrupts by setting special-purpose register PRIMASK. - Can only be executed in Privileged modes. - */ -__STATIC_FORCEINLINE void __disable_irq(void) -{ - __ASM volatile ("cpsid i" : : : "memory"); -} - - -/** - \brief Get Control Register - \details Returns the content of the Control Register. - \return Control Register value - */ -__STATIC_FORCEINLINE uint32_t __get_CONTROL(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, control" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Control Register (non-secure) - \details Returns the content of the non-secure Control Register when in secure mode. - \return non-secure Control Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_CONTROL_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, control_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Control Register - \details Writes the given value to the Control Register. - \param [in] control Control Register value to set - */ -__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control) -{ - __ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); - __ISB(); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Control Register (non-secure) - \details Writes the given value to the non-secure Control Register when in secure state. - \param [in] control Control Register value to set - */ -__STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control) -{ - __ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory"); - __ISB(); -} -#endif - - -/** - \brief Get IPSR Register - \details Returns the content of the IPSR Register. - \return IPSR Register value - */ -__STATIC_FORCEINLINE uint32_t __get_IPSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, ipsr" : "=r" (result) ); - return(result); -} - - -/** - \brief Get APSR Register - \details Returns the content of the APSR Register. - \return APSR Register value - */ -__STATIC_FORCEINLINE uint32_t __get_APSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, apsr" : "=r" (result) ); - return(result); -} - - -/** - \brief Get xPSR Register - \details Returns the content of the xPSR Register. - \return xPSR Register value - */ -__STATIC_FORCEINLINE uint32_t __get_xPSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, xpsr" : "=r" (result) ); - return(result); -} - - -/** - \brief Get Process Stack Pointer - \details Returns the current value of the Process Stack Pointer (PSP). - \return PSP Register value - */ -__STATIC_FORCEINLINE uint32_t __get_PSP(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, psp" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Process Stack Pointer (non-secure) - \details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state. - \return PSP Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PSP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, psp_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Process Stack Pointer - \details Assigns the given value to the Process Stack Pointer (PSP). - \param [in] topOfProcStack Process Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack) -{ - __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : ); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Process Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state. - \param [in] topOfProcStack Process Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack) -{ - __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : ); -} -#endif - - -/** - \brief Get Main Stack Pointer - \details Returns the current value of the Main Stack Pointer (MSP). - \return MSP Register value - */ -__STATIC_FORCEINLINE uint32_t __get_MSP(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, msp" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Main Stack Pointer (non-secure) - \details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state. - \return MSP Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_MSP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, msp_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Main Stack Pointer - \details Assigns the given value to the Main Stack Pointer (MSP). - \param [in] topOfMainStack Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack) -{ - __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : ); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Main Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state. - \param [in] topOfMainStack Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack) -{ - __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : ); -} -#endif - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Stack Pointer (non-secure) - \details Returns the current value of the non-secure Stack Pointer (SP) when in secure state. - \return SP Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_SP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, sp_ns" : "=r" (result) ); - return(result); -} - - -/** - \brief Set Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Stack Pointer (SP) when in secure state. - \param [in] topOfStack Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_SP_NS(uint32_t topOfStack) -{ - __ASM volatile ("MSR sp_ns, %0" : : "r" (topOfStack) : ); -} -#endif - - -/** - \brief Get Priority Mask - \details Returns the current state of the priority mask bit from the Priority Mask Register. - \return Priority Mask value - */ -__STATIC_FORCEINLINE uint32_t __get_PRIMASK(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, primask" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Priority Mask (non-secure) - \details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state. - \return Priority Mask value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PRIMASK_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, primask_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Priority Mask - \details Assigns the given value to the Priority Mask Register. - \param [in] priMask Priority Mask - */ -__STATIC_FORCEINLINE void __set_PRIMASK(uint32_t priMask) -{ - __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Priority Mask (non-secure) - \details Assigns the given value to the non-secure Priority Mask Register when in secure state. - \param [in] priMask Priority Mask - */ -__STATIC_FORCEINLINE void __TZ_set_PRIMASK_NS(uint32_t priMask) -{ - __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory"); -} -#endif - - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) -/** - \brief Enable FIQ - \details Enables FIQ interrupts by clearing special-purpose register FAULTMASK. - Can only be executed in Privileged modes. - */ -__STATIC_FORCEINLINE void __enable_fault_irq(void) -{ - __ASM volatile ("cpsie f" : : : "memory"); -} - - -/** - \brief Disable FIQ - \details Disables FIQ interrupts by setting special-purpose register FAULTMASK. - Can only be executed in Privileged modes. - */ -__STATIC_FORCEINLINE void __disable_fault_irq(void) -{ - __ASM volatile ("cpsid f" : : : "memory"); -} - - -/** - \brief Get Base Priority - \details Returns the current value of the Base Priority register. - \return Base Priority register value - */ -__STATIC_FORCEINLINE uint32_t __get_BASEPRI(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, basepri" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Base Priority (non-secure) - \details Returns the current value of the non-secure Base Priority register when in secure state. - \return Base Priority register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_BASEPRI_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, basepri_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Base Priority - \details Assigns the given value to the Base Priority register. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __set_BASEPRI(uint32_t basePri) -{ - __ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory"); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Base Priority (non-secure) - \details Assigns the given value to the non-secure Base Priority register when in secure state. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __TZ_set_BASEPRI_NS(uint32_t basePri) -{ - __ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "memory"); -} -#endif - - -/** - \brief Set Base Priority with condition - \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, - or the new value increases the BASEPRI priority level. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __set_BASEPRI_MAX(uint32_t basePri) -{ - __ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory"); -} - - -/** - \brief Get Fault Mask - \details Returns the current value of the Fault Mask register. - \return Fault Mask register value - */ -__STATIC_FORCEINLINE uint32_t __get_FAULTMASK(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Fault Mask (non-secure) - \details Returns the current value of the non-secure Fault Mask register when in secure state. - \return Fault Mask register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_FAULTMASK_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, faultmask_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Fault Mask - \details Assigns the given value to the Fault Mask register. - \param [in] faultMask Fault Mask value to set - */ -__STATIC_FORCEINLINE void __set_FAULTMASK(uint32_t faultMask) -{ - __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Fault Mask (non-secure) - \details Assigns the given value to the non-secure Fault Mask register when in secure state. - \param [in] faultMask Fault Mask value to set - */ -__STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) -{ - __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory"); -} -#endif - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) - -/** - \brief Get Process Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always in non-secure - mode. - - \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). - \return PSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __get_PSPLIM(void) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, psplim" : "=r" (result) ); - return result; -#endif -} - -#if (defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Process Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always. - - \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \return PSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS(void) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, psplim_ns" : "=r" (result) ); - return result; -#endif -} -#endif - - -/** - \brief Set Process Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored in non-secure - mode. - - \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set - */ -__STATIC_FORCEINLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - (void)ProcStackPtrLimit; -#else - __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit)); -#endif -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Process Stack Pointer (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored. - - \details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set - */ -__STATIC_FORCEINLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - (void)ProcStackPtrLimit; -#else - __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit)); -#endif -} -#endif - - -/** - \brief Get Main Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always in non-secure - mode. - - \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). - \return MSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __get_MSPLIM(void) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, msplim" : "=r" (result) ); - return result; -#endif -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Main Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always. - - \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. - \return MSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS(void) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) ); - return result; -#endif -} -#endif - - -/** - \brief Set Main Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored in non-secure - mode. - - \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). - \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set - */ -__STATIC_FORCEINLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - (void)MainStackPtrLimit; -#else - __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit)); -#endif -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Main Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored. - - \details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state. - \param [in] MainStackPtrLimit Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - (void)MainStackPtrLimit; -#else - __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit)); -#endif -} -#endif - -#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ - - -/** - \brief Get FPSCR - \details Returns the current value of the Floating Point Status/Control register. - \return Floating Point Status/Control register value - */ -__STATIC_FORCEINLINE uint32_t __get_FPSCR(void) -{ -#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) -#if __has_builtin(__builtin_arm_get_fpscr) -// Re-enable using built-in when GCC has been fixed -// || (__GNUC__ > 7) || (__GNUC__ == 7 && __GNUC_MINOR__ >= 2) - /* see https://gcc.gnu.org/ml/gcc-patches/2017-04/msg00443.html */ - return __builtin_arm_get_fpscr(); -#else - uint32_t result; - - __ASM volatile ("VMRS %0, fpscr" : "=r" (result) ); - return(result); -#endif -#else - return(0U); -#endif -} - - -/** - \brief Set FPSCR - \details Assigns the given value to the Floating Point Status/Control register. - \param [in] fpscr Floating Point Status/Control value to set - */ -__STATIC_FORCEINLINE void __set_FPSCR(uint32_t fpscr) -{ -#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) -#if __has_builtin(__builtin_arm_set_fpscr) -// Re-enable using built-in when GCC has been fixed -// || (__GNUC__ > 7) || (__GNUC__ == 7 && __GNUC_MINOR__ >= 2) - /* see https://gcc.gnu.org/ml/gcc-patches/2017-04/msg00443.html */ - __builtin_arm_set_fpscr(fpscr); -#else - __ASM volatile ("VMSR fpscr, %0" : : "r" (fpscr) : "vfpcc", "memory"); -#endif -#else - (void)fpscr; -#endif -} - - -/*@} end of CMSIS_Core_RegAccFunctions */ - - -/* ################### Compiler specific Intrinsics ########################### */ -/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics - Access to dedicated SIMD instructions - @{ -*/ - -#if (defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1)) - -__STATIC_FORCEINLINE uint32_t __SADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("qadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("shadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uqadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uhadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - - -__STATIC_FORCEINLINE uint32_t __SSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("ssub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("qsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("shsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __USUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uqsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uhsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - - -__STATIC_FORCEINLINE uint32_t __SADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("qadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("shadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uqadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uhadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("ssub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("qsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("shsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __USUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uqsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uhsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("qasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("shasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uqasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uhasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("ssax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("qsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("shsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __USAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uqsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uhsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __USAD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("usad8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __USADA8(uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM ("usada8 %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -#define __SSAT16(ARG1, ARG2) \ -__extension__ \ -({ \ - int32_t __RES, __ARG1 = (ARG1); \ - __ASM volatile ("ssat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) : "cc" ); \ - __RES; \ - }) - -#define __USAT16(ARG1, ARG2) \ -__extension__ \ -({ \ - uint32_t __RES, __ARG1 = (ARG1); \ - __ASM volatile ("usat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) : "cc" ); \ - __RES; \ - }) - -__STATIC_FORCEINLINE uint32_t __UXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM ("uxtb16 %0, %1" : "=r" (result) : "r" (op1)); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UXTAB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM ("sxtb16 %0, %1" : "=r" (result) : "r" (op1)); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SXTB16_RORn(uint32_t op1, uint32_t rotate) -{ - uint32_t result; - if (__builtin_constant_p(rotate) && ((rotate == 8U) || (rotate == 16U) || (rotate == 24U))) { - __ASM volatile ("sxtb16 %0, %1, ROR %2" : "=r" (result) : "r" (op1), "i" (rotate) ); - } else { - result = __SXTB16(__ROR(op1, rotate)) ; - } - return result; -} - -__STATIC_FORCEINLINE uint32_t __SXTAB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("sxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SXTAB16_RORn(uint32_t op1, uint32_t op2, uint32_t rotate) -{ - uint32_t result; - if (__builtin_constant_p(rotate) && ((rotate == 8U) || (rotate == 16U) || (rotate == 24U))) { - __ASM volatile ("sxtab16 %0, %1, %2, ROR %3" : "=r" (result) : "r" (op1) , "r" (op2) , "i" (rotate)); - } else { - result = __SXTAB16(op1, __ROR(op2, rotate)); - } - return result; -} - - -__STATIC_FORCEINLINE uint32_t __SMUAD (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smuad %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMUADX (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smuadx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMLAD (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smlad %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMLADX (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smladx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__STATIC_FORCEINLINE uint64_t __SMLALD (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__STATIC_FORCEINLINE uint64_t __SMLALDX (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__STATIC_FORCEINLINE uint32_t __SMUSD (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smusd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMUSDX (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smusdx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMLSD (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smlsd %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMLSDX (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smlsdx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__STATIC_FORCEINLINE uint64_t __SMLSLD (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__STATIC_FORCEINLINE uint64_t __SMLSLDX (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__STATIC_FORCEINLINE uint32_t __SEL (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sel %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE int32_t __QADD( int32_t op1, int32_t op2) -{ - int32_t result; - - __ASM volatile ("qadd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE int32_t __QSUB( int32_t op1, int32_t op2) -{ - int32_t result; - - __ASM volatile ("qsub %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - - -#define __PKHBT(ARG1,ARG2,ARG3) \ -__extension__ \ -({ \ - uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \ - __ASM ("pkhbt %0, %1, %2, lsl %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \ - __RES; \ - }) - -#define __PKHTB(ARG1,ARG2,ARG3) \ -__extension__ \ -({ \ - uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \ - if (ARG3 == 0) \ - __ASM ("pkhtb %0, %1, %2" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2) ); \ - else \ - __ASM ("pkhtb %0, %1, %2, asr %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \ - __RES; \ - }) - - -__STATIC_FORCEINLINE int32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3) -{ - int32_t result; - - __ASM ("smmla %0, %1, %2, %3" : "=r" (result): "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -#endif /* (__ARM_FEATURE_DSP == 1) */ -/*@} end of group CMSIS_SIMD_intrinsics */ - - -#pragma GCC diagnostic pop - -#endif /* __CMSIS_GCC_H */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/CMSIS/Core/Include/cmsis_iccarm.h b/bsp/nxp/mcx/mcxa/Libraries/CMSIS/Core/Include/cmsis_iccarm.h deleted file mode 100644 index 65b824b009c..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/CMSIS/Core/Include/cmsis_iccarm.h +++ /dev/null @@ -1,1002 +0,0 @@ -/**************************************************************************//** - * @file cmsis_iccarm.h - * @brief CMSIS compiler ICCARM (IAR Compiler for Arm) header file - * @version V5.3.0 - * @date 14. April 2021 - ******************************************************************************/ - -//------------------------------------------------------------------------------ -// -// Copyright (c) 2017-2021 IAR Systems -// Copyright (c) 2017-2021 Arm Limited. All rights reserved. -// -// SPDX-License-Identifier: Apache-2.0 -// -// 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 __CMSIS_ICCARM_H__ -#define __CMSIS_ICCARM_H__ - -#ifndef __ICCARM__ - #error This file should only be compiled by ICCARM -#endif - -#pragma system_include - -#define __IAR_FT _Pragma("inline=forced") __intrinsic - -#if (__VER__ >= 8000000) - #define __ICCARM_V8 1 -#else - #define __ICCARM_V8 0 -#endif - -#ifndef __ALIGNED - #if __ICCARM_V8 - #define __ALIGNED(x) __attribute__((aligned(x))) - #elif (__VER__ >= 7080000) - /* Needs IAR language extensions */ - #define __ALIGNED(x) __attribute__((aligned(x))) - #else - #warning No compiler specific solution for __ALIGNED.__ALIGNED is ignored. - #define __ALIGNED(x) - #endif -#endif - - -/* Define compiler macros for CPU architecture, used in CMSIS 5. - */ -#if __ARM_ARCH_6M__ || __ARM_ARCH_7M__ || __ARM_ARCH_7EM__ || __ARM_ARCH_8M_BASE__ || __ARM_ARCH_8M_MAIN__ -/* Macros already defined */ -#else - #if defined(__ARM8M_MAINLINE__) || defined(__ARM8EM_MAINLINE__) - #define __ARM_ARCH_8M_MAIN__ 1 - #elif defined(__ARM8M_BASELINE__) - #define __ARM_ARCH_8M_BASE__ 1 - #elif defined(__ARM_ARCH_PROFILE) && __ARM_ARCH_PROFILE == 'M' - #if __ARM_ARCH == 6 - #define __ARM_ARCH_6M__ 1 - #elif __ARM_ARCH == 7 - #if __ARM_FEATURE_DSP - #define __ARM_ARCH_7EM__ 1 - #else - #define __ARM_ARCH_7M__ 1 - #endif - #endif /* __ARM_ARCH */ - #endif /* __ARM_ARCH_PROFILE == 'M' */ -#endif - -/* Alternativ core deduction for older ICCARM's */ -#if !defined(__ARM_ARCH_6M__) && !defined(__ARM_ARCH_7M__) && !defined(__ARM_ARCH_7EM__) && \ - !defined(__ARM_ARCH_8M_BASE__) && !defined(__ARM_ARCH_8M_MAIN__) - #if defined(__ARM6M__) && (__CORE__ == __ARM6M__) - #define __ARM_ARCH_6M__ 1 - #elif defined(__ARM7M__) && (__CORE__ == __ARM7M__) - #define __ARM_ARCH_7M__ 1 - #elif defined(__ARM7EM__) && (__CORE__ == __ARM7EM__) - #define __ARM_ARCH_7EM__ 1 - #elif defined(__ARM8M_BASELINE__) && (__CORE == __ARM8M_BASELINE__) - #define __ARM_ARCH_8M_BASE__ 1 - #elif defined(__ARM8M_MAINLINE__) && (__CORE == __ARM8M_MAINLINE__) - #define __ARM_ARCH_8M_MAIN__ 1 - #elif defined(__ARM8EM_MAINLINE__) && (__CORE == __ARM8EM_MAINLINE__) - #define __ARM_ARCH_8M_MAIN__ 1 - #else - #error "Unknown target." - #endif -#endif - - - -#if defined(__ARM_ARCH_6M__) && __ARM_ARCH_6M__==1 - #define __IAR_M0_FAMILY 1 -#elif defined(__ARM_ARCH_8M_BASE__) && __ARM_ARCH_8M_BASE__==1 - #define __IAR_M0_FAMILY 1 -#else - #define __IAR_M0_FAMILY 0 -#endif - - -#ifndef __ASM - #define __ASM __asm -#endif - -#ifndef __COMPILER_BARRIER - #define __COMPILER_BARRIER() __ASM volatile("":::"memory") -#endif - -#ifndef __INLINE - #define __INLINE inline -#endif - -#ifndef __NO_RETURN - #if __ICCARM_V8 - #define __NO_RETURN __attribute__((__noreturn__)) - #else - #define __NO_RETURN _Pragma("object_attribute=__noreturn") - #endif -#endif - -#ifndef __PACKED - #if __ICCARM_V8 - #define __PACKED __attribute__((packed, aligned(1))) - #else - /* Needs IAR language extensions */ - #define __PACKED __packed - #endif -#endif - -#ifndef __PACKED_STRUCT - #if __ICCARM_V8 - #define __PACKED_STRUCT struct __attribute__((packed, aligned(1))) - #else - /* Needs IAR language extensions */ - #define __PACKED_STRUCT __packed struct - #endif -#endif - -#ifndef __PACKED_UNION - #if __ICCARM_V8 - #define __PACKED_UNION union __attribute__((packed, aligned(1))) - #else - /* Needs IAR language extensions */ - #define __PACKED_UNION __packed union - #endif -#endif - -#ifndef __RESTRICT - #if __ICCARM_V8 - #define __RESTRICT __restrict - #else - /* Needs IAR language extensions */ - #define __RESTRICT restrict - #endif -#endif - -#ifndef __STATIC_INLINE - #define __STATIC_INLINE static inline -#endif - -#ifndef __FORCEINLINE - #define __FORCEINLINE _Pragma("inline=forced") -#endif - -#ifndef __STATIC_FORCEINLINE - #define __STATIC_FORCEINLINE __FORCEINLINE __STATIC_INLINE -#endif - -#ifndef __UNALIGNED_UINT16_READ -#pragma language=save -#pragma language=extended -__IAR_FT uint16_t __iar_uint16_read(void const *ptr) -{ - return *(__packed uint16_t*)(ptr); -} -#pragma language=restore -#define __UNALIGNED_UINT16_READ(PTR) __iar_uint16_read(PTR) -#endif - - -#ifndef __UNALIGNED_UINT16_WRITE -#pragma language=save -#pragma language=extended -__IAR_FT void __iar_uint16_write(void const *ptr, uint16_t val) -{ - *(__packed uint16_t*)(ptr) = val;; -} -#pragma language=restore -#define __UNALIGNED_UINT16_WRITE(PTR,VAL) __iar_uint16_write(PTR,VAL) -#endif - -#ifndef __UNALIGNED_UINT32_READ -#pragma language=save -#pragma language=extended -__IAR_FT uint32_t __iar_uint32_read(void const *ptr) -{ - return *(__packed uint32_t*)(ptr); -} -#pragma language=restore -#define __UNALIGNED_UINT32_READ(PTR) __iar_uint32_read(PTR) -#endif - -#ifndef __UNALIGNED_UINT32_WRITE -#pragma language=save -#pragma language=extended -__IAR_FT void __iar_uint32_write(void const *ptr, uint32_t val) -{ - *(__packed uint32_t*)(ptr) = val;; -} -#pragma language=restore -#define __UNALIGNED_UINT32_WRITE(PTR,VAL) __iar_uint32_write(PTR,VAL) -#endif - -#ifndef __UNALIGNED_UINT32 /* deprecated */ -#pragma language=save -#pragma language=extended -__packed struct __iar_u32 { uint32_t v; }; -#pragma language=restore -#define __UNALIGNED_UINT32(PTR) (((struct __iar_u32 *)(PTR))->v) -#endif - -#ifndef __USED - #if __ICCARM_V8 - #define __USED __attribute__((used)) - #else - #define __USED _Pragma("__root") - #endif -#endif - -#undef __WEAK /* undo the definition from DLib_Defaults.h */ -#ifndef __WEAK - #if __ICCARM_V8 - #define __WEAK __attribute__((weak)) - #else - #define __WEAK _Pragma("__weak") - #endif -#endif - -#ifndef __PROGRAM_START -#define __PROGRAM_START __iar_program_start -#endif - -#ifndef __INITIAL_SP -#define __INITIAL_SP CSTACK$$Limit -#endif - -#ifndef __STACK_LIMIT -#define __STACK_LIMIT CSTACK$$Base -#endif - -#ifndef __VECTOR_TABLE -#define __VECTOR_TABLE __vector_table -#endif - -#ifndef __VECTOR_TABLE_ATTRIBUTE -#define __VECTOR_TABLE_ATTRIBUTE @".intvec" -#endif - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) -#ifndef __STACK_SEAL -#define __STACK_SEAL STACKSEAL$$Base -#endif - -#ifndef __TZ_STACK_SEAL_SIZE -#define __TZ_STACK_SEAL_SIZE 8U -#endif - -#ifndef __TZ_STACK_SEAL_VALUE -#define __TZ_STACK_SEAL_VALUE 0xFEF5EDA5FEF5EDA5ULL -#endif - -__STATIC_FORCEINLINE void __TZ_set_STACKSEAL_S (uint32_t* stackTop) { - *((uint64_t *)stackTop) = __TZ_STACK_SEAL_VALUE; -} -#endif - -#ifndef __ICCARM_INTRINSICS_VERSION__ - #define __ICCARM_INTRINSICS_VERSION__ 0 -#endif - -#if __ICCARM_INTRINSICS_VERSION__ == 2 - - #if defined(__CLZ) - #undef __CLZ - #endif - #if defined(__REVSH) - #undef __REVSH - #endif - #if defined(__RBIT) - #undef __RBIT - #endif - #if defined(__SSAT) - #undef __SSAT - #endif - #if defined(__USAT) - #undef __USAT - #endif - - #include "iccarm_builtin.h" - - #define __disable_fault_irq __iar_builtin_disable_fiq - #define __disable_irq __iar_builtin_disable_interrupt - #define __enable_fault_irq __iar_builtin_enable_fiq - #define __enable_irq __iar_builtin_enable_interrupt - #define __arm_rsr __iar_builtin_rsr - #define __arm_wsr __iar_builtin_wsr - - - #define __get_APSR() (__arm_rsr("APSR")) - #define __get_BASEPRI() (__arm_rsr("BASEPRI")) - #define __get_CONTROL() (__arm_rsr("CONTROL")) - #define __get_FAULTMASK() (__arm_rsr("FAULTMASK")) - - #if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) - #define __get_FPSCR() (__arm_rsr("FPSCR")) - #define __set_FPSCR(VALUE) (__arm_wsr("FPSCR", (VALUE))) - #else - #define __get_FPSCR() ( 0 ) - #define __set_FPSCR(VALUE) ((void)VALUE) - #endif - - #define __get_IPSR() (__arm_rsr("IPSR")) - #define __get_MSP() (__arm_rsr("MSP")) - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - #define __get_MSPLIM() (0U) - #else - #define __get_MSPLIM() (__arm_rsr("MSPLIM")) - #endif - #define __get_PRIMASK() (__arm_rsr("PRIMASK")) - #define __get_PSP() (__arm_rsr("PSP")) - - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - #define __get_PSPLIM() (0U) - #else - #define __get_PSPLIM() (__arm_rsr("PSPLIM")) - #endif - - #define __get_xPSR() (__arm_rsr("xPSR")) - - #define __set_BASEPRI(VALUE) (__arm_wsr("BASEPRI", (VALUE))) - #define __set_BASEPRI_MAX(VALUE) (__arm_wsr("BASEPRI_MAX", (VALUE))) - -__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control) -{ - __arm_wsr("CONTROL", control); - __iar_builtin_ISB(); -} - - #define __set_FAULTMASK(VALUE) (__arm_wsr("FAULTMASK", (VALUE))) - #define __set_MSP(VALUE) (__arm_wsr("MSP", (VALUE))) - - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - #define __set_MSPLIM(VALUE) ((void)(VALUE)) - #else - #define __set_MSPLIM(VALUE) (__arm_wsr("MSPLIM", (VALUE))) - #endif - #define __set_PRIMASK(VALUE) (__arm_wsr("PRIMASK", (VALUE))) - #define __set_PSP(VALUE) (__arm_wsr("PSP", (VALUE))) - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - #define __set_PSPLIM(VALUE) ((void)(VALUE)) - #else - #define __set_PSPLIM(VALUE) (__arm_wsr("PSPLIM", (VALUE))) - #endif - - #define __TZ_get_CONTROL_NS() (__arm_rsr("CONTROL_NS")) - -__STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control) -{ - __arm_wsr("CONTROL_NS", control); - __iar_builtin_ISB(); -} - - #define __TZ_get_PSP_NS() (__arm_rsr("PSP_NS")) - #define __TZ_set_PSP_NS(VALUE) (__arm_wsr("PSP_NS", (VALUE))) - #define __TZ_get_MSP_NS() (__arm_rsr("MSP_NS")) - #define __TZ_set_MSP_NS(VALUE) (__arm_wsr("MSP_NS", (VALUE))) - #define __TZ_get_SP_NS() (__arm_rsr("SP_NS")) - #define __TZ_set_SP_NS(VALUE) (__arm_wsr("SP_NS", (VALUE))) - #define __TZ_get_PRIMASK_NS() (__arm_rsr("PRIMASK_NS")) - #define __TZ_set_PRIMASK_NS(VALUE) (__arm_wsr("PRIMASK_NS", (VALUE))) - #define __TZ_get_BASEPRI_NS() (__arm_rsr("BASEPRI_NS")) - #define __TZ_set_BASEPRI_NS(VALUE) (__arm_wsr("BASEPRI_NS", (VALUE))) - #define __TZ_get_FAULTMASK_NS() (__arm_rsr("FAULTMASK_NS")) - #define __TZ_set_FAULTMASK_NS(VALUE)(__arm_wsr("FAULTMASK_NS", (VALUE))) - - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - #define __TZ_get_PSPLIM_NS() (0U) - #define __TZ_set_PSPLIM_NS(VALUE) ((void)(VALUE)) - #else - #define __TZ_get_PSPLIM_NS() (__arm_rsr("PSPLIM_NS")) - #define __TZ_set_PSPLIM_NS(VALUE) (__arm_wsr("PSPLIM_NS", (VALUE))) - #endif - - #define __TZ_get_MSPLIM_NS() (__arm_rsr("MSPLIM_NS")) - #define __TZ_set_MSPLIM_NS(VALUE) (__arm_wsr("MSPLIM_NS", (VALUE))) - - #define __NOP __iar_builtin_no_operation - - #define __CLZ __iar_builtin_CLZ - #define __CLREX __iar_builtin_CLREX - - #define __DMB __iar_builtin_DMB - #define __DSB __iar_builtin_DSB - #define __ISB __iar_builtin_ISB - - #define __LDREXB __iar_builtin_LDREXB - #define __LDREXH __iar_builtin_LDREXH - #define __LDREXW __iar_builtin_LDREX - - #define __RBIT __iar_builtin_RBIT - #define __REV __iar_builtin_REV - #define __REV16 __iar_builtin_REV16 - - __IAR_FT int16_t __REVSH(int16_t val) - { - return (int16_t) __iar_builtin_REVSH(val); - } - - #define __ROR __iar_builtin_ROR - #define __RRX __iar_builtin_RRX - - #define __SEV __iar_builtin_SEV - - #if !__IAR_M0_FAMILY - #define __SSAT __iar_builtin_SSAT - #endif - - #define __STREXB __iar_builtin_STREXB - #define __STREXH __iar_builtin_STREXH - #define __STREXW __iar_builtin_STREX - - #if !__IAR_M0_FAMILY - #define __USAT __iar_builtin_USAT - #endif - - #define __WFE __iar_builtin_WFE - #define __WFI __iar_builtin_WFI - - #if __ARM_MEDIA__ - #define __SADD8 __iar_builtin_SADD8 - #define __QADD8 __iar_builtin_QADD8 - #define __SHADD8 __iar_builtin_SHADD8 - #define __UADD8 __iar_builtin_UADD8 - #define __UQADD8 __iar_builtin_UQADD8 - #define __UHADD8 __iar_builtin_UHADD8 - #define __SSUB8 __iar_builtin_SSUB8 - #define __QSUB8 __iar_builtin_QSUB8 - #define __SHSUB8 __iar_builtin_SHSUB8 - #define __USUB8 __iar_builtin_USUB8 - #define __UQSUB8 __iar_builtin_UQSUB8 - #define __UHSUB8 __iar_builtin_UHSUB8 - #define __SADD16 __iar_builtin_SADD16 - #define __QADD16 __iar_builtin_QADD16 - #define __SHADD16 __iar_builtin_SHADD16 - #define __UADD16 __iar_builtin_UADD16 - #define __UQADD16 __iar_builtin_UQADD16 - #define __UHADD16 __iar_builtin_UHADD16 - #define __SSUB16 __iar_builtin_SSUB16 - #define __QSUB16 __iar_builtin_QSUB16 - #define __SHSUB16 __iar_builtin_SHSUB16 - #define __USUB16 __iar_builtin_USUB16 - #define __UQSUB16 __iar_builtin_UQSUB16 - #define __UHSUB16 __iar_builtin_UHSUB16 - #define __SASX __iar_builtin_SASX - #define __QASX __iar_builtin_QASX - #define __SHASX __iar_builtin_SHASX - #define __UASX __iar_builtin_UASX - #define __UQASX __iar_builtin_UQASX - #define __UHASX __iar_builtin_UHASX - #define __SSAX __iar_builtin_SSAX - #define __QSAX __iar_builtin_QSAX - #define __SHSAX __iar_builtin_SHSAX - #define __USAX __iar_builtin_USAX - #define __UQSAX __iar_builtin_UQSAX - #define __UHSAX __iar_builtin_UHSAX - #define __USAD8 __iar_builtin_USAD8 - #define __USADA8 __iar_builtin_USADA8 - #define __SSAT16 __iar_builtin_SSAT16 - #define __USAT16 __iar_builtin_USAT16 - #define __UXTB16 __iar_builtin_UXTB16 - #define __UXTAB16 __iar_builtin_UXTAB16 - #define __SXTB16 __iar_builtin_SXTB16 - #define __SXTAB16 __iar_builtin_SXTAB16 - #define __SMUAD __iar_builtin_SMUAD - #define __SMUADX __iar_builtin_SMUADX - #define __SMMLA __iar_builtin_SMMLA - #define __SMLAD __iar_builtin_SMLAD - #define __SMLADX __iar_builtin_SMLADX - #define __SMLALD __iar_builtin_SMLALD - #define __SMLALDX __iar_builtin_SMLALDX - #define __SMUSD __iar_builtin_SMUSD - #define __SMUSDX __iar_builtin_SMUSDX - #define __SMLSD __iar_builtin_SMLSD - #define __SMLSDX __iar_builtin_SMLSDX - #define __SMLSLD __iar_builtin_SMLSLD - #define __SMLSLDX __iar_builtin_SMLSLDX - #define __SEL __iar_builtin_SEL - #define __QADD __iar_builtin_QADD - #define __QSUB __iar_builtin_QSUB - #define __PKHBT __iar_builtin_PKHBT - #define __PKHTB __iar_builtin_PKHTB - #endif - -#else /* __ICCARM_INTRINSICS_VERSION__ == 2 */ - - #if __IAR_M0_FAMILY - /* Avoid clash between intrinsics.h and arm_math.h when compiling for Cortex-M0. */ - #define __CLZ __cmsis_iar_clz_not_active - #define __SSAT __cmsis_iar_ssat_not_active - #define __USAT __cmsis_iar_usat_not_active - #define __RBIT __cmsis_iar_rbit_not_active - #define __get_APSR __cmsis_iar_get_APSR_not_active - #endif - - - #if (!((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) )) - #define __get_FPSCR __cmsis_iar_get_FPSR_not_active - #define __set_FPSCR __cmsis_iar_set_FPSR_not_active - #endif - - #ifdef __INTRINSICS_INCLUDED - #error intrinsics.h is already included previously! - #endif - - #include - - #if __IAR_M0_FAMILY - /* Avoid clash between intrinsics.h and arm_math.h when compiling for Cortex-M0. */ - #undef __CLZ - #undef __SSAT - #undef __USAT - #undef __RBIT - #undef __get_APSR - - __STATIC_INLINE uint8_t __CLZ(uint32_t data) - { - if (data == 0U) { return 32U; } - - uint32_t count = 0U; - uint32_t mask = 0x80000000U; - - while ((data & mask) == 0U) - { - count += 1U; - mask = mask >> 1U; - } - return count; - } - - __STATIC_INLINE uint32_t __RBIT(uint32_t v) - { - uint8_t sc = 31U; - uint32_t r = v; - for (v >>= 1U; v; v >>= 1U) - { - r <<= 1U; - r |= v & 1U; - sc--; - } - return (r << sc); - } - - __STATIC_INLINE uint32_t __get_APSR(void) - { - uint32_t res; - __asm("MRS %0,APSR" : "=r" (res)); - return res; - } - - #endif - - #if (!((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) )) - #undef __get_FPSCR - #undef __set_FPSCR - #define __get_FPSCR() (0) - #define __set_FPSCR(VALUE) ((void)VALUE) - #endif - - #pragma diag_suppress=Pe940 - #pragma diag_suppress=Pe177 - - #define __enable_irq __enable_interrupt - #define __disable_irq __disable_interrupt - #define __NOP __no_operation - - #define __get_xPSR __get_PSR - - #if (!defined(__ARM_ARCH_6M__) || __ARM_ARCH_6M__==0) - - __IAR_FT uint32_t __LDREXW(uint32_t volatile *ptr) - { - return __LDREX((unsigned long *)ptr); - } - - __IAR_FT uint32_t __STREXW(uint32_t value, uint32_t volatile *ptr) - { - return __STREX(value, (unsigned long *)ptr); - } - #endif - - - /* __CORTEX_M is defined in core_cm0.h, core_cm3.h and core_cm4.h. */ - #if (__CORTEX_M >= 0x03) - - __IAR_FT uint32_t __RRX(uint32_t value) - { - uint32_t result; - __ASM volatile("RRX %0, %1" : "=r"(result) : "r" (value)); - return(result); - } - - __IAR_FT void __set_BASEPRI_MAX(uint32_t value) - { - __asm volatile("MSR BASEPRI_MAX,%0"::"r" (value)); - } - - - #define __enable_fault_irq __enable_fiq - #define __disable_fault_irq __disable_fiq - - - #endif /* (__CORTEX_M >= 0x03) */ - - __IAR_FT uint32_t __ROR(uint32_t op1, uint32_t op2) - { - return (op1 >> op2) | (op1 << ((sizeof(op1)*8)-op2)); - } - - #if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) - - __IAR_FT uint32_t __get_MSPLIM(void) - { - uint32_t res; - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - res = 0U; - #else - __asm volatile("MRS %0,MSPLIM" : "=r" (res)); - #endif - return res; - } - - __IAR_FT void __set_MSPLIM(uint32_t value) - { - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - (void)value; - #else - __asm volatile("MSR MSPLIM,%0" :: "r" (value)); - #endif - } - - __IAR_FT uint32_t __get_PSPLIM(void) - { - uint32_t res; - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - res = 0U; - #else - __asm volatile("MRS %0,PSPLIM" : "=r" (res)); - #endif - return res; - } - - __IAR_FT void __set_PSPLIM(uint32_t value) - { - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - (void)value; - #else - __asm volatile("MSR PSPLIM,%0" :: "r" (value)); - #endif - } - - __IAR_FT uint32_t __TZ_get_CONTROL_NS(void) - { - uint32_t res; - __asm volatile("MRS %0,CONTROL_NS" : "=r" (res)); - return res; - } - - __IAR_FT void __TZ_set_CONTROL_NS(uint32_t value) - { - __asm volatile("MSR CONTROL_NS,%0" :: "r" (value)); - __iar_builtin_ISB(); - } - - __IAR_FT uint32_t __TZ_get_PSP_NS(void) - { - uint32_t res; - __asm volatile("MRS %0,PSP_NS" : "=r" (res)); - return res; - } - - __IAR_FT void __TZ_set_PSP_NS(uint32_t value) - { - __asm volatile("MSR PSP_NS,%0" :: "r" (value)); - } - - __IAR_FT uint32_t __TZ_get_MSP_NS(void) - { - uint32_t res; - __asm volatile("MRS %0,MSP_NS" : "=r" (res)); - return res; - } - - __IAR_FT void __TZ_set_MSP_NS(uint32_t value) - { - __asm volatile("MSR MSP_NS,%0" :: "r" (value)); - } - - __IAR_FT uint32_t __TZ_get_SP_NS(void) - { - uint32_t res; - __asm volatile("MRS %0,SP_NS" : "=r" (res)); - return res; - } - __IAR_FT void __TZ_set_SP_NS(uint32_t value) - { - __asm volatile("MSR SP_NS,%0" :: "r" (value)); - } - - __IAR_FT uint32_t __TZ_get_PRIMASK_NS(void) - { - uint32_t res; - __asm volatile("MRS %0,PRIMASK_NS" : "=r" (res)); - return res; - } - - __IAR_FT void __TZ_set_PRIMASK_NS(uint32_t value) - { - __asm volatile("MSR PRIMASK_NS,%0" :: "r" (value)); - } - - __IAR_FT uint32_t __TZ_get_BASEPRI_NS(void) - { - uint32_t res; - __asm volatile("MRS %0,BASEPRI_NS" : "=r" (res)); - return res; - } - - __IAR_FT void __TZ_set_BASEPRI_NS(uint32_t value) - { - __asm volatile("MSR BASEPRI_NS,%0" :: "r" (value)); - } - - __IAR_FT uint32_t __TZ_get_FAULTMASK_NS(void) - { - uint32_t res; - __asm volatile("MRS %0,FAULTMASK_NS" : "=r" (res)); - return res; - } - - __IAR_FT void __TZ_set_FAULTMASK_NS(uint32_t value) - { - __asm volatile("MSR FAULTMASK_NS,%0" :: "r" (value)); - } - - __IAR_FT uint32_t __TZ_get_PSPLIM_NS(void) - { - uint32_t res; - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - res = 0U; - #else - __asm volatile("MRS %0,PSPLIM_NS" : "=r" (res)); - #endif - return res; - } - - __IAR_FT void __TZ_set_PSPLIM_NS(uint32_t value) - { - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - (void)value; - #else - __asm volatile("MSR PSPLIM_NS,%0" :: "r" (value)); - #endif - } - - __IAR_FT uint32_t __TZ_get_MSPLIM_NS(void) - { - uint32_t res; - __asm volatile("MRS %0,MSPLIM_NS" : "=r" (res)); - return res; - } - - __IAR_FT void __TZ_set_MSPLIM_NS(uint32_t value) - { - __asm volatile("MSR MSPLIM_NS,%0" :: "r" (value)); - } - - #endif /* __ARM_ARCH_8M_MAIN__ or __ARM_ARCH_8M_BASE__ */ - -#endif /* __ICCARM_INTRINSICS_VERSION__ == 2 */ - -#define __BKPT(value) __asm volatile ("BKPT %0" : : "i"(value)) - -#if __IAR_M0_FAMILY - __STATIC_INLINE int32_t __SSAT(int32_t val, uint32_t sat) - { - if ((sat >= 1U) && (sat <= 32U)) - { - const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); - const int32_t min = -1 - max ; - if (val > max) - { - return max; - } - else if (val < min) - { - return min; - } - } - return val; - } - - __STATIC_INLINE uint32_t __USAT(int32_t val, uint32_t sat) - { - if (sat <= 31U) - { - const uint32_t max = ((1U << sat) - 1U); - if (val > (int32_t)max) - { - return max; - } - else if (val < 0) - { - return 0U; - } - } - return (uint32_t)val; - } -#endif - -#if (__CORTEX_M >= 0x03) /* __CORTEX_M is defined in core_cm0.h, core_cm3.h and core_cm4.h. */ - - __IAR_FT uint8_t __LDRBT(volatile uint8_t *addr) - { - uint32_t res; - __ASM volatile ("LDRBT %0, [%1]" : "=r" (res) : "r" (addr) : "memory"); - return ((uint8_t)res); - } - - __IAR_FT uint16_t __LDRHT(volatile uint16_t *addr) - { - uint32_t res; - __ASM volatile ("LDRHT %0, [%1]" : "=r" (res) : "r" (addr) : "memory"); - return ((uint16_t)res); - } - - __IAR_FT uint32_t __LDRT(volatile uint32_t *addr) - { - uint32_t res; - __ASM volatile ("LDRT %0, [%1]" : "=r" (res) : "r" (addr) : "memory"); - return res; - } - - __IAR_FT void __STRBT(uint8_t value, volatile uint8_t *addr) - { - __ASM volatile ("STRBT %1, [%0]" : : "r" (addr), "r" ((uint32_t)value) : "memory"); - } - - __IAR_FT void __STRHT(uint16_t value, volatile uint16_t *addr) - { - __ASM volatile ("STRHT %1, [%0]" : : "r" (addr), "r" ((uint32_t)value) : "memory"); - } - - __IAR_FT void __STRT(uint32_t value, volatile uint32_t *addr) - { - __ASM volatile ("STRT %1, [%0]" : : "r" (addr), "r" (value) : "memory"); - } - -#endif /* (__CORTEX_M >= 0x03) */ - -#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) - - - __IAR_FT uint8_t __LDAB(volatile uint8_t *ptr) - { - uint32_t res; - __ASM volatile ("LDAB %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); - return ((uint8_t)res); - } - - __IAR_FT uint16_t __LDAH(volatile uint16_t *ptr) - { - uint32_t res; - __ASM volatile ("LDAH %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); - return ((uint16_t)res); - } - - __IAR_FT uint32_t __LDA(volatile uint32_t *ptr) - { - uint32_t res; - __ASM volatile ("LDA %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); - return res; - } - - __IAR_FT void __STLB(uint8_t value, volatile uint8_t *ptr) - { - __ASM volatile ("STLB %1, [%0]" :: "r" (ptr), "r" (value) : "memory"); - } - - __IAR_FT void __STLH(uint16_t value, volatile uint16_t *ptr) - { - __ASM volatile ("STLH %1, [%0]" :: "r" (ptr), "r" (value) : "memory"); - } - - __IAR_FT void __STL(uint32_t value, volatile uint32_t *ptr) - { - __ASM volatile ("STL %1, [%0]" :: "r" (ptr), "r" (value) : "memory"); - } - - __IAR_FT uint8_t __LDAEXB(volatile uint8_t *ptr) - { - uint32_t res; - __ASM volatile ("LDAEXB %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); - return ((uint8_t)res); - } - - __IAR_FT uint16_t __LDAEXH(volatile uint16_t *ptr) - { - uint32_t res; - __ASM volatile ("LDAEXH %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); - return ((uint16_t)res); - } - - __IAR_FT uint32_t __LDAEX(volatile uint32_t *ptr) - { - uint32_t res; - __ASM volatile ("LDAEX %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); - return res; - } - - __IAR_FT uint32_t __STLEXB(uint8_t value, volatile uint8_t *ptr) - { - uint32_t res; - __ASM volatile ("STLEXB %0, %2, [%1]" : "=r" (res) : "r" (ptr), "r" (value) : "memory"); - return res; - } - - __IAR_FT uint32_t __STLEXH(uint16_t value, volatile uint16_t *ptr) - { - uint32_t res; - __ASM volatile ("STLEXH %0, %2, [%1]" : "=r" (res) : "r" (ptr), "r" (value) : "memory"); - return res; - } - - __IAR_FT uint32_t __STLEX(uint32_t value, volatile uint32_t *ptr) - { - uint32_t res; - __ASM volatile ("STLEX %0, %2, [%1]" : "=r" (res) : "r" (ptr), "r" (value) : "memory"); - return res; - } - -#endif /* __ARM_ARCH_8M_MAIN__ or __ARM_ARCH_8M_BASE__ */ - -#undef __IAR_FT -#undef __IAR_M0_FAMILY -#undef __ICCARM_V8 - -#pragma diag_default=Pe940 -#pragma diag_default=Pe177 - -#define __SXTB16_RORn(ARG1, ARG2) __SXTB16(__ROR(ARG1, ARG2)) - -#define __SXTAB16_RORn(ARG1, ARG2, ARG3) __SXTAB16(ARG1, __ROR(ARG2, ARG3)) - -#endif /* __CMSIS_ICCARM_H__ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/CMSIS/Core/Include/cmsis_version.h b/bsp/nxp/mcx/mcxa/Libraries/CMSIS/Core/Include/cmsis_version.h deleted file mode 100644 index 2f048e4552d..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/CMSIS/Core/Include/cmsis_version.h +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************//** - * @file cmsis_version.h - * @brief CMSIS Core(M) Version definitions - * @version V5.0.4 - * @date 23. July 2019 - ******************************************************************************/ -/* - * Copyright (c) 2009-2019 ARM Limited. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined (__clang__) - #pragma clang system_header /* treat file as system include file */ -#endif - -#ifndef __CMSIS_VERSION_H -#define __CMSIS_VERSION_H - -/* CMSIS Version definitions */ -#define __CM_CMSIS_VERSION_MAIN ( 5U) /*!< [31:16] CMSIS Core(M) main version */ -#define __CM_CMSIS_VERSION_SUB ( 4U) /*!< [15:0] CMSIS Core(M) sub version */ -#define __CM_CMSIS_VERSION ((__CM_CMSIS_VERSION_MAIN << 16U) | \ - __CM_CMSIS_VERSION_SUB ) /*!< CMSIS Core(M) version number */ -#endif diff --git a/bsp/nxp/mcx/mcxa/Libraries/CMSIS/Core/Include/core_cm33.h b/bsp/nxp/mcx/mcxa/Libraries/CMSIS/Core/Include/core_cm33.h deleted file mode 100644 index f9cf6ab183a..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/CMSIS/Core/Include/core_cm33.h +++ /dev/null @@ -1,3265 +0,0 @@ -/**************************************************************************//** - * @file core_cm33.h - * @brief CMSIS Cortex-M33 Core Peripheral Access Layer Header File - * @version V5.2.2 - * @date 04. June 2021 - ******************************************************************************/ -/* - * Copyright (c) 2009-2021 Arm Limited. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined (__clang__) - #pragma clang system_header /* treat file as system include file */ -#elif defined ( __GNUC__ ) - #pragma GCC diagnostic ignored "-Wpedantic" /* disable pedantic warning due to unnamed structs/unions */ -#endif - -#ifndef __CORE_CM33_H_GENERIC -#define __CORE_CM33_H_GENERIC - -#include - -#ifdef __cplusplus - extern "C" { -#endif - -/** - \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions - CMSIS violates the following MISRA-C:2004 rules: - - \li Required Rule 8.5, object/function definition in header file.
- Function definitions in header files are used to allow 'inlining'. - - \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
- Unions are used for effective representation of core registers. - - \li Advisory Rule 19.7, Function-like macro defined.
- Function-like macros are used to allow more efficient code. - */ - - -/******************************************************************************* - * CMSIS definitions - ******************************************************************************/ -/** - \ingroup Cortex_M33 - @{ - */ - -#include "cmsis_version.h" - -/* CMSIS CM33 definitions */ -#define __CM33_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ -#define __CM33_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ -#define __CM33_CMSIS_VERSION ((__CM33_CMSIS_VERSION_MAIN << 16U) | \ - __CM33_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ - -#define __CORTEX_M (33U) /*!< Cortex-M Core */ - -/** __FPU_USED indicates whether an FPU is used or not. - For this, __FPU_PRESENT has to be checked prior to making use of FPU specific registers and functions. -*/ -#if defined ( __CC_ARM ) - #if defined (__TARGET_FPU_VFP) - #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) - #define __FPU_USED 1U - #else - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0U - #endif - #else - #define __FPU_USED 0U - #endif - - #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U) - #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U) - #define __DSP_USED 1U - #else - #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" - #define __DSP_USED 0U - #endif - #else - #define __DSP_USED 0U - #endif - -#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #if defined (__ARM_FP) - #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) - #define __FPU_USED 1U - #else - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0U - #endif - #else - #define __FPU_USED 0U - #endif - - #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U) - #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U) - #define __DSP_USED 1U - #else - #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" - #define __DSP_USED 0U - #endif - #else - #define __DSP_USED 0U - #endif - -#elif defined ( __GNUC__ ) - #if defined (__VFP_FP__) && !defined(__SOFTFP__) - #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) - #define __FPU_USED 1U - #else - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0U - #endif - #else - #define __FPU_USED 0U - #endif - - #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U) - #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U) - #define __DSP_USED 1U - #else - #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" - #define __DSP_USED 0U - #endif - #else - #define __DSP_USED 0U - #endif - -#elif defined ( __ICCARM__ ) - #if defined (__ARMVFP__) - #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) - #define __FPU_USED 1U - #else - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0U - #endif - #else - #define __FPU_USED 0U - #endif - - #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U) - #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U) - #define __DSP_USED 1U - #else - #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" - #define __DSP_USED 0U - #endif - #else - #define __DSP_USED 0U - #endif - -#elif defined ( __TI_ARM__ ) - #if defined (__TI_VFP_SUPPORT__) - #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) - #define __FPU_USED 1U - #else - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0U - #endif - #else - #define __FPU_USED 0U - #endif - -#elif defined ( __TASKING__ ) - #if defined (__FPU_VFP__) - #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) - #define __FPU_USED 1U - #else - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0U - #endif - #else - #define __FPU_USED 0U - #endif - -#elif defined ( __CSMC__ ) - #if ( __CSMC__ & 0x400U) - #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) - #define __FPU_USED 1U - #else - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0U - #endif - #else - #define __FPU_USED 0U - #endif - -#endif - -#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ - - -#ifdef __cplusplus -} -#endif - -#endif /* __CORE_CM33_H_GENERIC */ - -#ifndef __CMSIS_GENERIC - -#ifndef __CORE_CM33_H_DEPENDANT -#define __CORE_CM33_H_DEPENDANT - -#ifdef __cplusplus - extern "C" { -#endif - -/* check device defines and use defaults */ -#if defined __CHECK_DEVICE_DEFINES - #ifndef __CM33_REV - #define __CM33_REV 0x0000U - #warning "__CM33_REV not defined in device header file; using default!" - #endif - - #ifndef __FPU_PRESENT - #define __FPU_PRESENT 0U - #warning "__FPU_PRESENT not defined in device header file; using default!" - #endif - - #ifndef __MPU_PRESENT - #define __MPU_PRESENT 0U - #warning "__MPU_PRESENT not defined in device header file; using default!" - #endif - - #ifndef __SAUREGION_PRESENT - #define __SAUREGION_PRESENT 0U - #warning "__SAUREGION_PRESENT not defined in device header file; using default!" - #endif - - #ifndef __DSP_PRESENT - #define __DSP_PRESENT 0U - #warning "__DSP_PRESENT not defined in device header file; using default!" - #endif - - #ifndef __VTOR_PRESENT - #define __VTOR_PRESENT 1U - #warning "__VTOR_PRESENT not defined in device header file; using default!" - #endif - - #ifndef __NVIC_PRIO_BITS - #define __NVIC_PRIO_BITS 3U - #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" - #endif - - #ifndef __Vendor_SysTickConfig - #define __Vendor_SysTickConfig 0U - #warning "__Vendor_SysTickConfig not defined in device header file; using default!" - #endif -#endif - -/* IO definitions (access restrictions to peripheral registers) */ -/** - \defgroup CMSIS_glob_defs CMSIS Global Defines - - IO Type Qualifiers are used - \li to specify the access to peripheral variables. - \li for automatic generation of peripheral register debug information. -*/ -#ifdef __cplusplus - #define __I volatile /*!< Defines 'read only' permissions */ -#else - #define __I volatile const /*!< Defines 'read only' permissions */ -#endif -#define __O volatile /*!< Defines 'write only' permissions */ -#define __IO volatile /*!< Defines 'read / write' permissions */ - -/* following defines should be used for structure members */ -#define __IM volatile const /*! Defines 'read only' structure member permissions */ -#define __OM volatile /*! Defines 'write only' structure member permissions */ -#define __IOM volatile /*! Defines 'read / write' structure member permissions */ - -/*@} end of group Cortex_M33 */ - - - -/******************************************************************************* - * Register Abstraction - Core Register contain: - - Core Register - - Core NVIC Register - - Core SCB Register - - Core SysTick Register - - Core Debug Register - - Core MPU Register - - Core SAU Register - - Core FPU Register - ******************************************************************************/ -/** - \defgroup CMSIS_core_register Defines and Type Definitions - \brief Type definitions and defines for Cortex-M processor based devices. -*/ - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_CORE Status and Control Registers - \brief Core Register type definitions. - @{ - */ - -/** - \brief Union type to access the Application Program Status Register (APSR). - */ -typedef union -{ - struct - { - uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */ - uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ - uint32_t _reserved1:7; /*!< bit: 20..26 Reserved */ - uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ - uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ - uint32_t C:1; /*!< bit: 29 Carry condition code flag */ - uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ - uint32_t N:1; /*!< bit: 31 Negative condition code flag */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} APSR_Type; - -/* APSR Register Definitions */ -#define APSR_N_Pos 31U /*!< APSR: N Position */ -#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ - -#define APSR_Z_Pos 30U /*!< APSR: Z Position */ -#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ - -#define APSR_C_Pos 29U /*!< APSR: C Position */ -#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ - -#define APSR_V_Pos 28U /*!< APSR: V Position */ -#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ - -#define APSR_Q_Pos 27U /*!< APSR: Q Position */ -#define APSR_Q_Msk (1UL << APSR_Q_Pos) /*!< APSR: Q Mask */ - -#define APSR_GE_Pos 16U /*!< APSR: GE Position */ -#define APSR_GE_Msk (0xFUL << APSR_GE_Pos) /*!< APSR: GE Mask */ - - -/** - \brief Union type to access the Interrupt Program Status Register (IPSR). - */ -typedef union -{ - struct - { - uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ - uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} IPSR_Type; - -/* IPSR Register Definitions */ -#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ -#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ - - -/** - \brief Union type to access the Special-Purpose Program Status Registers (xPSR). - */ -typedef union -{ - struct - { - uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ - uint32_t _reserved0:7; /*!< bit: 9..15 Reserved */ - uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ - uint32_t _reserved1:4; /*!< bit: 20..23 Reserved */ - uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ - uint32_t IT:2; /*!< bit: 25..26 saved IT state (read 0) */ - uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ - uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ - uint32_t C:1; /*!< bit: 29 Carry condition code flag */ - uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ - uint32_t N:1; /*!< bit: 31 Negative condition code flag */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} xPSR_Type; - -/* xPSR Register Definitions */ -#define xPSR_N_Pos 31U /*!< xPSR: N Position */ -#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ - -#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ -#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ - -#define xPSR_C_Pos 29U /*!< xPSR: C Position */ -#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ - -#define xPSR_V_Pos 28U /*!< xPSR: V Position */ -#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ - -#define xPSR_Q_Pos 27U /*!< xPSR: Q Position */ -#define xPSR_Q_Msk (1UL << xPSR_Q_Pos) /*!< xPSR: Q Mask */ - -#define xPSR_IT_Pos 25U /*!< xPSR: IT Position */ -#define xPSR_IT_Msk (3UL << xPSR_IT_Pos) /*!< xPSR: IT Mask */ - -#define xPSR_T_Pos 24U /*!< xPSR: T Position */ -#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ - -#define xPSR_GE_Pos 16U /*!< xPSR: GE Position */ -#define xPSR_GE_Msk (0xFUL << xPSR_GE_Pos) /*!< xPSR: GE Mask */ - -#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ -#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ - - -/** - \brief Union type to access the Control Registers (CONTROL). - */ -typedef union -{ - struct - { - uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ - uint32_t SPSEL:1; /*!< bit: 1 Stack-pointer select */ - uint32_t FPCA:1; /*!< bit: 2 Floating-point context active */ - uint32_t SFPA:1; /*!< bit: 3 Secure floating-point active */ - uint32_t _reserved1:28; /*!< bit: 4..31 Reserved */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} CONTROL_Type; - -/* CONTROL Register Definitions */ -#define CONTROL_SFPA_Pos 3U /*!< CONTROL: SFPA Position */ -#define CONTROL_SFPA_Msk (1UL << CONTROL_SFPA_Pos) /*!< CONTROL: SFPA Mask */ - -#define CONTROL_FPCA_Pos 2U /*!< CONTROL: FPCA Position */ -#define CONTROL_FPCA_Msk (1UL << CONTROL_FPCA_Pos) /*!< CONTROL: FPCA Mask */ - -#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ -#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ - -#define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */ -#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ - -/*@} end of group CMSIS_CORE */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) - \brief Type definitions for the NVIC Registers - @{ - */ - -/** - \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). - */ -typedef struct -{ - __IOM uint32_t ISER[16U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ - uint32_t RESERVED0[16U]; - __IOM uint32_t ICER[16U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ - uint32_t RSERVED1[16U]; - __IOM uint32_t ISPR[16U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ - uint32_t RESERVED2[16U]; - __IOM uint32_t ICPR[16U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ - uint32_t RESERVED3[16U]; - __IOM uint32_t IABR[16U]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ - uint32_t RESERVED4[16U]; - __IOM uint32_t ITNS[16U]; /*!< Offset: 0x280 (R/W) Interrupt Non-Secure State Register */ - uint32_t RESERVED5[16U]; - __IOM uint8_t IPR[496U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */ - uint32_t RESERVED6[580U]; - __OM uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */ -} NVIC_Type; - -/* Software Triggered Interrupt Register Definitions */ -#define NVIC_STIR_INTID_Pos 0U /*!< STIR: INTLINESNUM Position */ -#define NVIC_STIR_INTID_Msk (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/) /*!< STIR: INTLINESNUM Mask */ - -/*@} end of group CMSIS_NVIC */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_SCB System Control Block (SCB) - \brief Type definitions for the System Control Block Registers - @{ - */ - -/** - \brief Structure type to access the System Control Block (SCB). - */ -typedef struct -{ - __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ - __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ - __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ - __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ - __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ - __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ - __IOM uint8_t SHPR[12U]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */ - __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ - __IOM uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */ - __IOM uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */ - __IOM uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */ - __IOM uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */ - __IOM uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */ - __IOM uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ - __IM uint32_t ID_PFR[2U]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ - __IM uint32_t ID_DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ - __IM uint32_t ID_ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ - __IM uint32_t ID_MMFR[4U]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ - __IM uint32_t ID_ISAR[6U]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ - __IM uint32_t CLIDR; /*!< Offset: 0x078 (R/ ) Cache Level ID register */ - __IM uint32_t CTR; /*!< Offset: 0x07C (R/ ) Cache Type register */ - __IM uint32_t CCSIDR; /*!< Offset: 0x080 (R/ ) Cache Size ID Register */ - __IOM uint32_t CSSELR; /*!< Offset: 0x084 (R/W) Cache Size Selection Register */ - __IOM uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ - __IOM uint32_t NSACR; /*!< Offset: 0x08C (R/W) Non-Secure Access Control Register */ - uint32_t RESERVED3[92U]; - __OM uint32_t STIR; /*!< Offset: 0x200 ( /W) Software Triggered Interrupt Register */ - uint32_t RESERVED4[15U]; - __IM uint32_t MVFR0; /*!< Offset: 0x240 (R/ ) Media and VFP Feature Register 0 */ - __IM uint32_t MVFR1; /*!< Offset: 0x244 (R/ ) Media and VFP Feature Register 1 */ - __IM uint32_t MVFR2; /*!< Offset: 0x248 (R/ ) Media and VFP Feature Register 2 */ - uint32_t RESERVED5[1U]; - __OM uint32_t ICIALLU; /*!< Offset: 0x250 ( /W) I-Cache Invalidate All to PoU */ - uint32_t RESERVED6[1U]; - __OM uint32_t ICIMVAU; /*!< Offset: 0x258 ( /W) I-Cache Invalidate by MVA to PoU */ - __OM uint32_t DCIMVAC; /*!< Offset: 0x25C ( /W) D-Cache Invalidate by MVA to PoC */ - __OM uint32_t DCISW; /*!< Offset: 0x260 ( /W) D-Cache Invalidate by Set-way */ - __OM uint32_t DCCMVAU; /*!< Offset: 0x264 ( /W) D-Cache Clean by MVA to PoU */ - __OM uint32_t DCCMVAC; /*!< Offset: 0x268 ( /W) D-Cache Clean by MVA to PoC */ - __OM uint32_t DCCSW; /*!< Offset: 0x26C ( /W) D-Cache Clean by Set-way */ - __OM uint32_t DCCIMVAC; /*!< Offset: 0x270 ( /W) D-Cache Clean and Invalidate by MVA to PoC */ - __OM uint32_t DCCISW; /*!< Offset: 0x274 ( /W) D-Cache Clean and Invalidate by Set-way */ - __OM uint32_t BPIALL; /*!< Offset: 0x278 ( /W) Branch Predictor Invalidate All */ -} SCB_Type; - -/* SCB CPUID Register Definitions */ -#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ -#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ - -#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ -#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ - -#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ -#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ - -#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ -#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ - -#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ -#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ - -/* SCB Interrupt Control State Register Definitions */ -#define SCB_ICSR_PENDNMISET_Pos 31U /*!< SCB ICSR: PENDNMISET Position */ -#define SCB_ICSR_PENDNMISET_Msk (1UL << SCB_ICSR_PENDNMISET_Pos) /*!< SCB ICSR: PENDNMISET Mask */ - -#define SCB_ICSR_NMIPENDSET_Pos SCB_ICSR_PENDNMISET_Pos /*!< SCB ICSR: NMIPENDSET Position, backward compatibility */ -#define SCB_ICSR_NMIPENDSET_Msk SCB_ICSR_PENDNMISET_Msk /*!< SCB ICSR: NMIPENDSET Mask, backward compatibility */ - -#define SCB_ICSR_PENDNMICLR_Pos 30U /*!< SCB ICSR: PENDNMICLR Position */ -#define SCB_ICSR_PENDNMICLR_Msk (1UL << SCB_ICSR_PENDNMICLR_Pos) /*!< SCB ICSR: PENDNMICLR Mask */ - -#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ -#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ - -#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ -#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ - -#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ -#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ - -#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ -#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ - -#define SCB_ICSR_STTNS_Pos 24U /*!< SCB ICSR: STTNS Position (Security Extension) */ -#define SCB_ICSR_STTNS_Msk (1UL << SCB_ICSR_STTNS_Pos) /*!< SCB ICSR: STTNS Mask (Security Extension) */ - -#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ -#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ - -#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ -#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ - -#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ -#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ - -#define SCB_ICSR_RETTOBASE_Pos 11U /*!< SCB ICSR: RETTOBASE Position */ -#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ - -#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ -#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ - -/* SCB Vector Table Offset Register Definitions */ -#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */ -#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ - -/* SCB Application Interrupt and Reset Control Register Definitions */ -#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ -#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ - -#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ -#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ - -#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ -#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ - -#define SCB_AIRCR_PRIS_Pos 14U /*!< SCB AIRCR: PRIS Position */ -#define SCB_AIRCR_PRIS_Msk (1UL << SCB_AIRCR_PRIS_Pos) /*!< SCB AIRCR: PRIS Mask */ - -#define SCB_AIRCR_BFHFNMINS_Pos 13U /*!< SCB AIRCR: BFHFNMINS Position */ -#define SCB_AIRCR_BFHFNMINS_Msk (1UL << SCB_AIRCR_BFHFNMINS_Pos) /*!< SCB AIRCR: BFHFNMINS Mask */ - -#define SCB_AIRCR_PRIGROUP_Pos 8U /*!< SCB AIRCR: PRIGROUP Position */ -#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ - -#define SCB_AIRCR_SYSRESETREQS_Pos 3U /*!< SCB AIRCR: SYSRESETREQS Position */ -#define SCB_AIRCR_SYSRESETREQS_Msk (1UL << SCB_AIRCR_SYSRESETREQS_Pos) /*!< SCB AIRCR: SYSRESETREQS Mask */ - -#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ -#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ - -#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ -#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ - -/* SCB System Control Register Definitions */ -#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ -#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ - -#define SCB_SCR_SLEEPDEEPS_Pos 3U /*!< SCB SCR: SLEEPDEEPS Position */ -#define SCB_SCR_SLEEPDEEPS_Msk (1UL << SCB_SCR_SLEEPDEEPS_Pos) /*!< SCB SCR: SLEEPDEEPS Mask */ - -#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ -#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ - -#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ -#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ - -/* SCB Configuration Control Register Definitions */ -#define SCB_CCR_BP_Pos 18U /*!< SCB CCR: BP Position */ -#define SCB_CCR_BP_Msk (1UL << SCB_CCR_BP_Pos) /*!< SCB CCR: BP Mask */ - -#define SCB_CCR_IC_Pos 17U /*!< SCB CCR: IC Position */ -#define SCB_CCR_IC_Msk (1UL << SCB_CCR_IC_Pos) /*!< SCB CCR: IC Mask */ - -#define SCB_CCR_DC_Pos 16U /*!< SCB CCR: DC Position */ -#define SCB_CCR_DC_Msk (1UL << SCB_CCR_DC_Pos) /*!< SCB CCR: DC Mask */ - -#define SCB_CCR_STKOFHFNMIGN_Pos 10U /*!< SCB CCR: STKOFHFNMIGN Position */ -#define SCB_CCR_STKOFHFNMIGN_Msk (1UL << SCB_CCR_STKOFHFNMIGN_Pos) /*!< SCB CCR: STKOFHFNMIGN Mask */ - -#define SCB_CCR_BFHFNMIGN_Pos 8U /*!< SCB CCR: BFHFNMIGN Position */ -#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ - -#define SCB_CCR_DIV_0_TRP_Pos 4U /*!< SCB CCR: DIV_0_TRP Position */ -#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ - -#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ -#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ - -#define SCB_CCR_USERSETMPEND_Pos 1U /*!< SCB CCR: USERSETMPEND Position */ -#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ - -/* SCB System Handler Control and State Register Definitions */ -#define SCB_SHCSR_HARDFAULTPENDED_Pos 21U /*!< SCB SHCSR: HARDFAULTPENDED Position */ -#define SCB_SHCSR_HARDFAULTPENDED_Msk (1UL << SCB_SHCSR_HARDFAULTPENDED_Pos) /*!< SCB SHCSR: HARDFAULTPENDED Mask */ - -#define SCB_SHCSR_SECUREFAULTPENDED_Pos 20U /*!< SCB SHCSR: SECUREFAULTPENDED Position */ -#define SCB_SHCSR_SECUREFAULTPENDED_Msk (1UL << SCB_SHCSR_SECUREFAULTPENDED_Pos) /*!< SCB SHCSR: SECUREFAULTPENDED Mask */ - -#define SCB_SHCSR_SECUREFAULTENA_Pos 19U /*!< SCB SHCSR: SECUREFAULTENA Position */ -#define SCB_SHCSR_SECUREFAULTENA_Msk (1UL << SCB_SHCSR_SECUREFAULTENA_Pos) /*!< SCB SHCSR: SECUREFAULTENA Mask */ - -#define SCB_SHCSR_USGFAULTENA_Pos 18U /*!< SCB SHCSR: USGFAULTENA Position */ -#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */ - -#define SCB_SHCSR_BUSFAULTENA_Pos 17U /*!< SCB SHCSR: BUSFAULTENA Position */ -#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */ - -#define SCB_SHCSR_MEMFAULTENA_Pos 16U /*!< SCB SHCSR: MEMFAULTENA Position */ -#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */ - -#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ -#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ - -#define SCB_SHCSR_BUSFAULTPENDED_Pos 14U /*!< SCB SHCSR: BUSFAULTPENDED Position */ -#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */ - -#define SCB_SHCSR_MEMFAULTPENDED_Pos 13U /*!< SCB SHCSR: MEMFAULTPENDED Position */ -#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */ - -#define SCB_SHCSR_USGFAULTPENDED_Pos 12U /*!< SCB SHCSR: USGFAULTPENDED Position */ -#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */ - -#define SCB_SHCSR_SYSTICKACT_Pos 11U /*!< SCB SHCSR: SYSTICKACT Position */ -#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ - -#define SCB_SHCSR_PENDSVACT_Pos 10U /*!< SCB SHCSR: PENDSVACT Position */ -#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ - -#define SCB_SHCSR_MONITORACT_Pos 8U /*!< SCB SHCSR: MONITORACT Position */ -#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */ - -#define SCB_SHCSR_SVCALLACT_Pos 7U /*!< SCB SHCSR: SVCALLACT Position */ -#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ - -#define SCB_SHCSR_NMIACT_Pos 5U /*!< SCB SHCSR: NMIACT Position */ -#define SCB_SHCSR_NMIACT_Msk (1UL << SCB_SHCSR_NMIACT_Pos) /*!< SCB SHCSR: NMIACT Mask */ - -#define SCB_SHCSR_SECUREFAULTACT_Pos 4U /*!< SCB SHCSR: SECUREFAULTACT Position */ -#define SCB_SHCSR_SECUREFAULTACT_Msk (1UL << SCB_SHCSR_SECUREFAULTACT_Pos) /*!< SCB SHCSR: SECUREFAULTACT Mask */ - -#define SCB_SHCSR_USGFAULTACT_Pos 3U /*!< SCB SHCSR: USGFAULTACT Position */ -#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */ - -#define SCB_SHCSR_HARDFAULTACT_Pos 2U /*!< SCB SHCSR: HARDFAULTACT Position */ -#define SCB_SHCSR_HARDFAULTACT_Msk (1UL << SCB_SHCSR_HARDFAULTACT_Pos) /*!< SCB SHCSR: HARDFAULTACT Mask */ - -#define SCB_SHCSR_BUSFAULTACT_Pos 1U /*!< SCB SHCSR: BUSFAULTACT Position */ -#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */ - -#define SCB_SHCSR_MEMFAULTACT_Pos 0U /*!< SCB SHCSR: MEMFAULTACT Position */ -#define SCB_SHCSR_MEMFAULTACT_Msk (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/) /*!< SCB SHCSR: MEMFAULTACT Mask */ - -/* SCB Configurable Fault Status Register Definitions */ -#define SCB_CFSR_USGFAULTSR_Pos 16U /*!< SCB CFSR: Usage Fault Status Register Position */ -#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */ - -#define SCB_CFSR_BUSFAULTSR_Pos 8U /*!< SCB CFSR: Bus Fault Status Register Position */ -#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */ - -#define SCB_CFSR_MEMFAULTSR_Pos 0U /*!< SCB CFSR: Memory Manage Fault Status Register Position */ -#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ - -/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */ -#define SCB_CFSR_MMARVALID_Pos (SCB_CFSR_MEMFAULTSR_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ -#define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */ - -#define SCB_CFSR_MLSPERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */ -#define SCB_CFSR_MLSPERR_Msk (1UL << SCB_CFSR_MLSPERR_Pos) /*!< SCB CFSR (MMFSR): MLSPERR Mask */ - -#define SCB_CFSR_MSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ -#define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */ - -#define SCB_CFSR_MUNSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ -#define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */ - -#define SCB_CFSR_DACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ -#define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */ - -#define SCB_CFSR_IACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ -#define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */ - -/* BusFault Status Register (part of SCB Configurable Fault Status Register) */ -#define SCB_CFSR_BFARVALID_Pos (SCB_CFSR_BUSFAULTSR_Pos + 7U) /*!< SCB CFSR (BFSR): BFARVALID Position */ -#define SCB_CFSR_BFARVALID_Msk (1UL << SCB_CFSR_BFARVALID_Pos) /*!< SCB CFSR (BFSR): BFARVALID Mask */ - -#define SCB_CFSR_LSPERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 5U) /*!< SCB CFSR (BFSR): LSPERR Position */ -#define SCB_CFSR_LSPERR_Msk (1UL << SCB_CFSR_LSPERR_Pos) /*!< SCB CFSR (BFSR): LSPERR Mask */ - -#define SCB_CFSR_STKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 4U) /*!< SCB CFSR (BFSR): STKERR Position */ -#define SCB_CFSR_STKERR_Msk (1UL << SCB_CFSR_STKERR_Pos) /*!< SCB CFSR (BFSR): STKERR Mask */ - -#define SCB_CFSR_UNSTKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 3U) /*!< SCB CFSR (BFSR): UNSTKERR Position */ -#define SCB_CFSR_UNSTKERR_Msk (1UL << SCB_CFSR_UNSTKERR_Pos) /*!< SCB CFSR (BFSR): UNSTKERR Mask */ - -#define SCB_CFSR_IMPRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 2U) /*!< SCB CFSR (BFSR): IMPRECISERR Position */ -#define SCB_CFSR_IMPRECISERR_Msk (1UL << SCB_CFSR_IMPRECISERR_Pos) /*!< SCB CFSR (BFSR): IMPRECISERR Mask */ - -#define SCB_CFSR_PRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 1U) /*!< SCB CFSR (BFSR): PRECISERR Position */ -#define SCB_CFSR_PRECISERR_Msk (1UL << SCB_CFSR_PRECISERR_Pos) /*!< SCB CFSR (BFSR): PRECISERR Mask */ - -#define SCB_CFSR_IBUSERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 0U) /*!< SCB CFSR (BFSR): IBUSERR Position */ -#define SCB_CFSR_IBUSERR_Msk (1UL << SCB_CFSR_IBUSERR_Pos) /*!< SCB CFSR (BFSR): IBUSERR Mask */ - -/* UsageFault Status Register (part of SCB Configurable Fault Status Register) */ -#define SCB_CFSR_DIVBYZERO_Pos (SCB_CFSR_USGFAULTSR_Pos + 9U) /*!< SCB CFSR (UFSR): DIVBYZERO Position */ -#define SCB_CFSR_DIVBYZERO_Msk (1UL << SCB_CFSR_DIVBYZERO_Pos) /*!< SCB CFSR (UFSR): DIVBYZERO Mask */ - -#define SCB_CFSR_UNALIGNED_Pos (SCB_CFSR_USGFAULTSR_Pos + 8U) /*!< SCB CFSR (UFSR): UNALIGNED Position */ -#define SCB_CFSR_UNALIGNED_Msk (1UL << SCB_CFSR_UNALIGNED_Pos) /*!< SCB CFSR (UFSR): UNALIGNED Mask */ - -#define SCB_CFSR_STKOF_Pos (SCB_CFSR_USGFAULTSR_Pos + 4U) /*!< SCB CFSR (UFSR): STKOF Position */ -#define SCB_CFSR_STKOF_Msk (1UL << SCB_CFSR_STKOF_Pos) /*!< SCB CFSR (UFSR): STKOF Mask */ - -#define SCB_CFSR_NOCP_Pos (SCB_CFSR_USGFAULTSR_Pos + 3U) /*!< SCB CFSR (UFSR): NOCP Position */ -#define SCB_CFSR_NOCP_Msk (1UL << SCB_CFSR_NOCP_Pos) /*!< SCB CFSR (UFSR): NOCP Mask */ - -#define SCB_CFSR_INVPC_Pos (SCB_CFSR_USGFAULTSR_Pos + 2U) /*!< SCB CFSR (UFSR): INVPC Position */ -#define SCB_CFSR_INVPC_Msk (1UL << SCB_CFSR_INVPC_Pos) /*!< SCB CFSR (UFSR): INVPC Mask */ - -#define SCB_CFSR_INVSTATE_Pos (SCB_CFSR_USGFAULTSR_Pos + 1U) /*!< SCB CFSR (UFSR): INVSTATE Position */ -#define SCB_CFSR_INVSTATE_Msk (1UL << SCB_CFSR_INVSTATE_Pos) /*!< SCB CFSR (UFSR): INVSTATE Mask */ - -#define SCB_CFSR_UNDEFINSTR_Pos (SCB_CFSR_USGFAULTSR_Pos + 0U) /*!< SCB CFSR (UFSR): UNDEFINSTR Position */ -#define SCB_CFSR_UNDEFINSTR_Msk (1UL << SCB_CFSR_UNDEFINSTR_Pos) /*!< SCB CFSR (UFSR): UNDEFINSTR Mask */ - -/* SCB Hard Fault Status Register Definitions */ -#define SCB_HFSR_DEBUGEVT_Pos 31U /*!< SCB HFSR: DEBUGEVT Position */ -#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */ - -#define SCB_HFSR_FORCED_Pos 30U /*!< SCB HFSR: FORCED Position */ -#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */ - -#define SCB_HFSR_VECTTBL_Pos 1U /*!< SCB HFSR: VECTTBL Position */ -#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */ - -/* SCB Debug Fault Status Register Definitions */ -#define SCB_DFSR_EXTERNAL_Pos 4U /*!< SCB DFSR: EXTERNAL Position */ -#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */ - -#define SCB_DFSR_VCATCH_Pos 3U /*!< SCB DFSR: VCATCH Position */ -#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */ - -#define SCB_DFSR_DWTTRAP_Pos 2U /*!< SCB DFSR: DWTTRAP Position */ -#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */ - -#define SCB_DFSR_BKPT_Pos 1U /*!< SCB DFSR: BKPT Position */ -#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */ - -#define SCB_DFSR_HALTED_Pos 0U /*!< SCB DFSR: HALTED Position */ -#define SCB_DFSR_HALTED_Msk (1UL /*<< SCB_DFSR_HALTED_Pos*/) /*!< SCB DFSR: HALTED Mask */ - -/* SCB Non-Secure Access Control Register Definitions */ -#define SCB_NSACR_CP11_Pos 11U /*!< SCB NSACR: CP11 Position */ -#define SCB_NSACR_CP11_Msk (1UL << SCB_NSACR_CP11_Pos) /*!< SCB NSACR: CP11 Mask */ - -#define SCB_NSACR_CP10_Pos 10U /*!< SCB NSACR: CP10 Position */ -#define SCB_NSACR_CP10_Msk (1UL << SCB_NSACR_CP10_Pos) /*!< SCB NSACR: CP10 Mask */ - -#define SCB_NSACR_CPn_Pos 0U /*!< SCB NSACR: CPn Position */ -#define SCB_NSACR_CPn_Msk (1UL /*<< SCB_NSACR_CPn_Pos*/) /*!< SCB NSACR: CPn Mask */ - -/* SCB Cache Level ID Register Definitions */ -#define SCB_CLIDR_LOUU_Pos 27U /*!< SCB CLIDR: LoUU Position */ -#define SCB_CLIDR_LOUU_Msk (7UL << SCB_CLIDR_LOUU_Pos) /*!< SCB CLIDR: LoUU Mask */ - -#define SCB_CLIDR_LOC_Pos 24U /*!< SCB CLIDR: LoC Position */ -#define SCB_CLIDR_LOC_Msk (7UL << SCB_CLIDR_LOC_Pos) /*!< SCB CLIDR: LoC Mask */ - -/* SCB Cache Type Register Definitions */ -#define SCB_CTR_FORMAT_Pos 29U /*!< SCB CTR: Format Position */ -#define SCB_CTR_FORMAT_Msk (7UL << SCB_CTR_FORMAT_Pos) /*!< SCB CTR: Format Mask */ - -#define SCB_CTR_CWG_Pos 24U /*!< SCB CTR: CWG Position */ -#define SCB_CTR_CWG_Msk (0xFUL << SCB_CTR_CWG_Pos) /*!< SCB CTR: CWG Mask */ - -#define SCB_CTR_ERG_Pos 20U /*!< SCB CTR: ERG Position */ -#define SCB_CTR_ERG_Msk (0xFUL << SCB_CTR_ERG_Pos) /*!< SCB CTR: ERG Mask */ - -#define SCB_CTR_DMINLINE_Pos 16U /*!< SCB CTR: DminLine Position */ -#define SCB_CTR_DMINLINE_Msk (0xFUL << SCB_CTR_DMINLINE_Pos) /*!< SCB CTR: DminLine Mask */ - -#define SCB_CTR_IMINLINE_Pos 0U /*!< SCB CTR: ImInLine Position */ -#define SCB_CTR_IMINLINE_Msk (0xFUL /*<< SCB_CTR_IMINLINE_Pos*/) /*!< SCB CTR: ImInLine Mask */ - -/* SCB Cache Size ID Register Definitions */ -#define SCB_CCSIDR_WT_Pos 31U /*!< SCB CCSIDR: WT Position */ -#define SCB_CCSIDR_WT_Msk (1UL << SCB_CCSIDR_WT_Pos) /*!< SCB CCSIDR: WT Mask */ - -#define SCB_CCSIDR_WB_Pos 30U /*!< SCB CCSIDR: WB Position */ -#define SCB_CCSIDR_WB_Msk (1UL << SCB_CCSIDR_WB_Pos) /*!< SCB CCSIDR: WB Mask */ - -#define SCB_CCSIDR_RA_Pos 29U /*!< SCB CCSIDR: RA Position */ -#define SCB_CCSIDR_RA_Msk (1UL << SCB_CCSIDR_RA_Pos) /*!< SCB CCSIDR: RA Mask */ - -#define SCB_CCSIDR_WA_Pos 28U /*!< SCB CCSIDR: WA Position */ -#define SCB_CCSIDR_WA_Msk (1UL << SCB_CCSIDR_WA_Pos) /*!< SCB CCSIDR: WA Mask */ - -#define SCB_CCSIDR_NUMSETS_Pos 13U /*!< SCB CCSIDR: NumSets Position */ -#define SCB_CCSIDR_NUMSETS_Msk (0x7FFFUL << SCB_CCSIDR_NUMSETS_Pos) /*!< SCB CCSIDR: NumSets Mask */ - -#define SCB_CCSIDR_ASSOCIATIVITY_Pos 3U /*!< SCB CCSIDR: Associativity Position */ -#define SCB_CCSIDR_ASSOCIATIVITY_Msk (0x3FFUL << SCB_CCSIDR_ASSOCIATIVITY_Pos) /*!< SCB CCSIDR: Associativity Mask */ - -#define SCB_CCSIDR_LINESIZE_Pos 0U /*!< SCB CCSIDR: LineSize Position */ -#define SCB_CCSIDR_LINESIZE_Msk (7UL /*<< SCB_CCSIDR_LINESIZE_Pos*/) /*!< SCB CCSIDR: LineSize Mask */ - -/* SCB Cache Size Selection Register Definitions */ -#define SCB_CSSELR_LEVEL_Pos 1U /*!< SCB CSSELR: Level Position */ -#define SCB_CSSELR_LEVEL_Msk (7UL << SCB_CSSELR_LEVEL_Pos) /*!< SCB CSSELR: Level Mask */ - -#define SCB_CSSELR_IND_Pos 0U /*!< SCB CSSELR: InD Position */ -#define SCB_CSSELR_IND_Msk (1UL /*<< SCB_CSSELR_IND_Pos*/) /*!< SCB CSSELR: InD Mask */ - -/* SCB Software Triggered Interrupt Register Definitions */ -#define SCB_STIR_INTID_Pos 0U /*!< SCB STIR: INTID Position */ -#define SCB_STIR_INTID_Msk (0x1FFUL /*<< SCB_STIR_INTID_Pos*/) /*!< SCB STIR: INTID Mask */ - -/* SCB D-Cache Invalidate by Set-way Register Definitions */ -#define SCB_DCISW_WAY_Pos 30U /*!< SCB DCISW: Way Position */ -#define SCB_DCISW_WAY_Msk (3UL << SCB_DCISW_WAY_Pos) /*!< SCB DCISW: Way Mask */ - -#define SCB_DCISW_SET_Pos 5U /*!< SCB DCISW: Set Position */ -#define SCB_DCISW_SET_Msk (0x1FFUL << SCB_DCISW_SET_Pos) /*!< SCB DCISW: Set Mask */ - -/* SCB D-Cache Clean by Set-way Register Definitions */ -#define SCB_DCCSW_WAY_Pos 30U /*!< SCB DCCSW: Way Position */ -#define SCB_DCCSW_WAY_Msk (3UL << SCB_DCCSW_WAY_Pos) /*!< SCB DCCSW: Way Mask */ - -#define SCB_DCCSW_SET_Pos 5U /*!< SCB DCCSW: Set Position */ -#define SCB_DCCSW_SET_Msk (0x1FFUL << SCB_DCCSW_SET_Pos) /*!< SCB DCCSW: Set Mask */ - -/* SCB D-Cache Clean and Invalidate by Set-way Register Definitions */ -#define SCB_DCCISW_WAY_Pos 30U /*!< SCB DCCISW: Way Position */ -#define SCB_DCCISW_WAY_Msk (3UL << SCB_DCCISW_WAY_Pos) /*!< SCB DCCISW: Way Mask */ - -#define SCB_DCCISW_SET_Pos 5U /*!< SCB DCCISW: Set Position */ -#define SCB_DCCISW_SET_Msk (0x1FFUL << SCB_DCCISW_SET_Pos) /*!< SCB DCCISW: Set Mask */ - -/*@} end of group CMSIS_SCB */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) - \brief Type definitions for the System Control and ID Register not in the SCB - @{ - */ - -/** - \brief Structure type to access the System Control and ID Register not in the SCB. - */ -typedef struct -{ - uint32_t RESERVED0[1U]; - __IM uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */ - __IOM uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ - __IOM uint32_t CPPWR; /*!< Offset: 0x00C (R/W) Coprocessor Power Control Register */ -} SCnSCB_Type; - -/* Interrupt Controller Type Register Definitions */ -#define SCnSCB_ICTR_INTLINESNUM_Pos 0U /*!< ICTR: INTLINESNUM Position */ -#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */ - -/*@} end of group CMSIS_SCnotSCB */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_SysTick System Tick Timer (SysTick) - \brief Type definitions for the System Timer Registers. - @{ - */ - -/** - \brief Structure type to access the System Timer (SysTick). - */ -typedef struct -{ - __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ - __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ - __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ - __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ -} SysTick_Type; - -/* SysTick Control / Status Register Definitions */ -#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ -#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ - -#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ -#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ - -#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ -#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ - -#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ -#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ - -/* SysTick Reload Register Definitions */ -#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ -#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ - -/* SysTick Current Register Definitions */ -#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ -#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ - -/* SysTick Calibration Register Definitions */ -#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ -#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ - -#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ -#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ - -#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ -#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ - -/*@} end of group CMSIS_SysTick */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM) - \brief Type definitions for the Instrumentation Trace Macrocell (ITM) - @{ - */ - -/** - \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM). - */ -typedef struct -{ - __OM union - { - __OM uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */ - __OM uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */ - __OM uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */ - } PORT [32U]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */ - uint32_t RESERVED0[864U]; - __IOM uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */ - uint32_t RESERVED1[15U]; - __IOM uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */ - uint32_t RESERVED2[15U]; - __IOM uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */ - uint32_t RESERVED3[32U]; - uint32_t RESERVED4[43U]; - __OM uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */ - __IM uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */ - uint32_t RESERVED5[1U]; - __IM uint32_t DEVARCH; /*!< Offset: 0xFBC (R/ ) ITM Device Architecture Register */ - uint32_t RESERVED6[4U]; - __IM uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */ - __IM uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */ - __IM uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */ - __IM uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */ - __IM uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */ - __IM uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */ - __IM uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */ - __IM uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */ - __IM uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */ - __IM uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */ - __IM uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */ - __IM uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */ -} ITM_Type; - -/* ITM Stimulus Port Register Definitions */ -#define ITM_STIM_DISABLED_Pos 1U /*!< ITM STIM: DISABLED Position */ -#define ITM_STIM_DISABLED_Msk (0x1UL << ITM_STIM_DISABLED_Pos) /*!< ITM STIM: DISABLED Mask */ - -#define ITM_STIM_FIFOREADY_Pos 0U /*!< ITM STIM: FIFOREADY Position */ -#define ITM_STIM_FIFOREADY_Msk (0x1UL /*<< ITM_STIM_FIFOREADY_Pos*/) /*!< ITM STIM: FIFOREADY Mask */ - -/* ITM Trace Privilege Register Definitions */ -#define ITM_TPR_PRIVMASK_Pos 0U /*!< ITM TPR: PRIVMASK Position */ -#define ITM_TPR_PRIVMASK_Msk (0xFFFFFFFFUL /*<< ITM_TPR_PRIVMASK_Pos*/) /*!< ITM TPR: PRIVMASK Mask */ - -/* ITM Trace Control Register Definitions */ -#define ITM_TCR_BUSY_Pos 23U /*!< ITM TCR: BUSY Position */ -#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */ - -#define ITM_TCR_TRACEBUSID_Pos 16U /*!< ITM TCR: ATBID Position */ -#define ITM_TCR_TRACEBUSID_Msk (0x7FUL << ITM_TCR_TRACEBUSID_Pos) /*!< ITM TCR: ATBID Mask */ - -#define ITM_TCR_GTSFREQ_Pos 10U /*!< ITM TCR: Global timestamp frequency Position */ -#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */ - -#define ITM_TCR_TSPRESCALE_Pos 8U /*!< ITM TCR: TSPRESCALE Position */ -#define ITM_TCR_TSPRESCALE_Msk (3UL << ITM_TCR_TSPRESCALE_Pos) /*!< ITM TCR: TSPRESCALE Mask */ - -#define ITM_TCR_STALLENA_Pos 5U /*!< ITM TCR: STALLENA Position */ -#define ITM_TCR_STALLENA_Msk (1UL << ITM_TCR_STALLENA_Pos) /*!< ITM TCR: STALLENA Mask */ - -#define ITM_TCR_SWOENA_Pos 4U /*!< ITM TCR: SWOENA Position */ -#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */ - -#define ITM_TCR_DWTENA_Pos 3U /*!< ITM TCR: DWTENA Position */ -#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */ - -#define ITM_TCR_SYNCENA_Pos 2U /*!< ITM TCR: SYNCENA Position */ -#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */ - -#define ITM_TCR_TSENA_Pos 1U /*!< ITM TCR: TSENA Position */ -#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */ - -#define ITM_TCR_ITMENA_Pos 0U /*!< ITM TCR: ITM Enable bit Position */ -#define ITM_TCR_ITMENA_Msk (1UL /*<< ITM_TCR_ITMENA_Pos*/) /*!< ITM TCR: ITM Enable bit Mask */ - -/* ITM Lock Status Register Definitions */ -#define ITM_LSR_ByteAcc_Pos 2U /*!< ITM LSR: ByteAcc Position */ -#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */ - -#define ITM_LSR_Access_Pos 1U /*!< ITM LSR: Access Position */ -#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */ - -#define ITM_LSR_Present_Pos 0U /*!< ITM LSR: Present Position */ -#define ITM_LSR_Present_Msk (1UL /*<< ITM_LSR_Present_Pos*/) /*!< ITM LSR: Present Mask */ - -/*@}*/ /* end of group CMSIS_ITM */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT) - \brief Type definitions for the Data Watchpoint and Trace (DWT) - @{ - */ - -/** - \brief Structure type to access the Data Watchpoint and Trace Register (DWT). - */ -typedef struct -{ - __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ - __IOM uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */ - __IOM uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */ - __IOM uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */ - __IOM uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */ - __IOM uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */ - __IOM uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */ - __IM uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ - __IOM uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ - uint32_t RESERVED1[1U]; - __IOM uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ - uint32_t RESERVED2[1U]; - __IOM uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ - uint32_t RESERVED3[1U]; - __IOM uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ - uint32_t RESERVED4[1U]; - __IOM uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ - uint32_t RESERVED5[1U]; - __IOM uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ - uint32_t RESERVED6[1U]; - __IOM uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ - uint32_t RESERVED7[1U]; - __IOM uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ - uint32_t RESERVED8[1U]; - __IOM uint32_t COMP4; /*!< Offset: 0x060 (R/W) Comparator Register 4 */ - uint32_t RESERVED9[1U]; - __IOM uint32_t FUNCTION4; /*!< Offset: 0x068 (R/W) Function Register 4 */ - uint32_t RESERVED10[1U]; - __IOM uint32_t COMP5; /*!< Offset: 0x070 (R/W) Comparator Register 5 */ - uint32_t RESERVED11[1U]; - __IOM uint32_t FUNCTION5; /*!< Offset: 0x078 (R/W) Function Register 5 */ - uint32_t RESERVED12[1U]; - __IOM uint32_t COMP6; /*!< Offset: 0x080 (R/W) Comparator Register 6 */ - uint32_t RESERVED13[1U]; - __IOM uint32_t FUNCTION6; /*!< Offset: 0x088 (R/W) Function Register 6 */ - uint32_t RESERVED14[1U]; - __IOM uint32_t COMP7; /*!< Offset: 0x090 (R/W) Comparator Register 7 */ - uint32_t RESERVED15[1U]; - __IOM uint32_t FUNCTION7; /*!< Offset: 0x098 (R/W) Function Register 7 */ - uint32_t RESERVED16[1U]; - __IOM uint32_t COMP8; /*!< Offset: 0x0A0 (R/W) Comparator Register 8 */ - uint32_t RESERVED17[1U]; - __IOM uint32_t FUNCTION8; /*!< Offset: 0x0A8 (R/W) Function Register 8 */ - uint32_t RESERVED18[1U]; - __IOM uint32_t COMP9; /*!< Offset: 0x0B0 (R/W) Comparator Register 9 */ - uint32_t RESERVED19[1U]; - __IOM uint32_t FUNCTION9; /*!< Offset: 0x0B8 (R/W) Function Register 9 */ - uint32_t RESERVED20[1U]; - __IOM uint32_t COMP10; /*!< Offset: 0x0C0 (R/W) Comparator Register 10 */ - uint32_t RESERVED21[1U]; - __IOM uint32_t FUNCTION10; /*!< Offset: 0x0C8 (R/W) Function Register 10 */ - uint32_t RESERVED22[1U]; - __IOM uint32_t COMP11; /*!< Offset: 0x0D0 (R/W) Comparator Register 11 */ - uint32_t RESERVED23[1U]; - __IOM uint32_t FUNCTION11; /*!< Offset: 0x0D8 (R/W) Function Register 11 */ - uint32_t RESERVED24[1U]; - __IOM uint32_t COMP12; /*!< Offset: 0x0E0 (R/W) Comparator Register 12 */ - uint32_t RESERVED25[1U]; - __IOM uint32_t FUNCTION12; /*!< Offset: 0x0E8 (R/W) Function Register 12 */ - uint32_t RESERVED26[1U]; - __IOM uint32_t COMP13; /*!< Offset: 0x0F0 (R/W) Comparator Register 13 */ - uint32_t RESERVED27[1U]; - __IOM uint32_t FUNCTION13; /*!< Offset: 0x0F8 (R/W) Function Register 13 */ - uint32_t RESERVED28[1U]; - __IOM uint32_t COMP14; /*!< Offset: 0x100 (R/W) Comparator Register 14 */ - uint32_t RESERVED29[1U]; - __IOM uint32_t FUNCTION14; /*!< Offset: 0x108 (R/W) Function Register 14 */ - uint32_t RESERVED30[1U]; - __IOM uint32_t COMP15; /*!< Offset: 0x110 (R/W) Comparator Register 15 */ - uint32_t RESERVED31[1U]; - __IOM uint32_t FUNCTION15; /*!< Offset: 0x118 (R/W) Function Register 15 */ - uint32_t RESERVED32[934U]; - __IM uint32_t LSR; /*!< Offset: 0xFB4 (R ) Lock Status Register */ - uint32_t RESERVED33[1U]; - __IM uint32_t DEVARCH; /*!< Offset: 0xFBC (R/ ) Device Architecture Register */ -} DWT_Type; - -/* DWT Control Register Definitions */ -#define DWT_CTRL_NUMCOMP_Pos 28U /*!< DWT CTRL: NUMCOMP Position */ -#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ - -#define DWT_CTRL_NOTRCPKT_Pos 27U /*!< DWT CTRL: NOTRCPKT Position */ -#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ - -#define DWT_CTRL_NOEXTTRIG_Pos 26U /*!< DWT CTRL: NOEXTTRIG Position */ -#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ - -#define DWT_CTRL_NOCYCCNT_Pos 25U /*!< DWT CTRL: NOCYCCNT Position */ -#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ - -#define DWT_CTRL_NOPRFCNT_Pos 24U /*!< DWT CTRL: NOPRFCNT Position */ -#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ - -#define DWT_CTRL_CYCDISS_Pos 23U /*!< DWT CTRL: CYCDISS Position */ -#define DWT_CTRL_CYCDISS_Msk (0x1UL << DWT_CTRL_CYCDISS_Pos) /*!< DWT CTRL: CYCDISS Mask */ - -#define DWT_CTRL_CYCEVTENA_Pos 22U /*!< DWT CTRL: CYCEVTENA Position */ -#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */ - -#define DWT_CTRL_FOLDEVTENA_Pos 21U /*!< DWT CTRL: FOLDEVTENA Position */ -#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */ - -#define DWT_CTRL_LSUEVTENA_Pos 20U /*!< DWT CTRL: LSUEVTENA Position */ -#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */ - -#define DWT_CTRL_SLEEPEVTENA_Pos 19U /*!< DWT CTRL: SLEEPEVTENA Position */ -#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */ - -#define DWT_CTRL_EXCEVTENA_Pos 18U /*!< DWT CTRL: EXCEVTENA Position */ -#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */ - -#define DWT_CTRL_CPIEVTENA_Pos 17U /*!< DWT CTRL: CPIEVTENA Position */ -#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */ - -#define DWT_CTRL_EXCTRCENA_Pos 16U /*!< DWT CTRL: EXCTRCENA Position */ -#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */ - -#define DWT_CTRL_PCSAMPLENA_Pos 12U /*!< DWT CTRL: PCSAMPLENA Position */ -#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */ - -#define DWT_CTRL_SYNCTAP_Pos 10U /*!< DWT CTRL: SYNCTAP Position */ -#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */ - -#define DWT_CTRL_CYCTAP_Pos 9U /*!< DWT CTRL: CYCTAP Position */ -#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */ - -#define DWT_CTRL_POSTINIT_Pos 5U /*!< DWT CTRL: POSTINIT Position */ -#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */ - -#define DWT_CTRL_POSTPRESET_Pos 1U /*!< DWT CTRL: POSTPRESET Position */ -#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */ - -#define DWT_CTRL_CYCCNTENA_Pos 0U /*!< DWT CTRL: CYCCNTENA Position */ -#define DWT_CTRL_CYCCNTENA_Msk (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/) /*!< DWT CTRL: CYCCNTENA Mask */ - -/* DWT CPI Count Register Definitions */ -#define DWT_CPICNT_CPICNT_Pos 0U /*!< DWT CPICNT: CPICNT Position */ -#define DWT_CPICNT_CPICNT_Msk (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/) /*!< DWT CPICNT: CPICNT Mask */ - -/* DWT Exception Overhead Count Register Definitions */ -#define DWT_EXCCNT_EXCCNT_Pos 0U /*!< DWT EXCCNT: EXCCNT Position */ -#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/) /*!< DWT EXCCNT: EXCCNT Mask */ - -/* DWT Sleep Count Register Definitions */ -#define DWT_SLEEPCNT_SLEEPCNT_Pos 0U /*!< DWT SLEEPCNT: SLEEPCNT Position */ -#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/) /*!< DWT SLEEPCNT: SLEEPCNT Mask */ - -/* DWT LSU Count Register Definitions */ -#define DWT_LSUCNT_LSUCNT_Pos 0U /*!< DWT LSUCNT: LSUCNT Position */ -#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/) /*!< DWT LSUCNT: LSUCNT Mask */ - -/* DWT Folded-instruction Count Register Definitions */ -#define DWT_FOLDCNT_FOLDCNT_Pos 0U /*!< DWT FOLDCNT: FOLDCNT Position */ -#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/) /*!< DWT FOLDCNT: FOLDCNT Mask */ - -/* DWT Comparator Function Register Definitions */ -#define DWT_FUNCTION_ID_Pos 27U /*!< DWT FUNCTION: ID Position */ -#define DWT_FUNCTION_ID_Msk (0x1FUL << DWT_FUNCTION_ID_Pos) /*!< DWT FUNCTION: ID Mask */ - -#define DWT_FUNCTION_MATCHED_Pos 24U /*!< DWT FUNCTION: MATCHED Position */ -#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ - -#define DWT_FUNCTION_DATAVSIZE_Pos 10U /*!< DWT FUNCTION: DATAVSIZE Position */ -#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ - -#define DWT_FUNCTION_ACTION_Pos 4U /*!< DWT FUNCTION: ACTION Position */ -#define DWT_FUNCTION_ACTION_Msk (0x1UL << DWT_FUNCTION_ACTION_Pos) /*!< DWT FUNCTION: ACTION Mask */ - -#define DWT_FUNCTION_MATCH_Pos 0U /*!< DWT FUNCTION: MATCH Position */ -#define DWT_FUNCTION_MATCH_Msk (0xFUL /*<< DWT_FUNCTION_MATCH_Pos*/) /*!< DWT FUNCTION: MATCH Mask */ - -/*@}*/ /* end of group CMSIS_DWT */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_TPI Trace Port Interface (TPI) - \brief Type definitions for the Trace Port Interface (TPI) - @{ - */ - -/** - \brief Structure type to access the Trace Port Interface Register (TPI). - */ -typedef struct -{ - __IM uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Size Register */ - __IOM uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Size Register */ - uint32_t RESERVED0[2U]; - __IOM uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ - uint32_t RESERVED1[55U]; - __IOM uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ - uint32_t RESERVED2[131U]; - __IM uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ - __IOM uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ - __IOM uint32_t PSCR; /*!< Offset: 0x308 (R/W) Periodic Synchronization Control Register */ - uint32_t RESERVED3[759U]; - __IM uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER Register */ - __IM uint32_t ITFTTD0; /*!< Offset: 0xEEC (R/ ) Integration Test FIFO Test Data 0 Register */ - __IOM uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/W) Integration Test ATB Control Register 2 */ - uint32_t RESERVED4[1U]; - __IM uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) Integration Test ATB Control Register 0 */ - __IM uint32_t ITFTTD1; /*!< Offset: 0xEFC (R/ ) Integration Test FIFO Test Data 1 Register */ - __IOM uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */ - uint32_t RESERVED5[39U]; - __IOM uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */ - __IOM uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */ - uint32_t RESERVED7[8U]; - __IM uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) Device Configuration Register */ - __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) Device Type Identifier Register */ -} TPI_Type; - -/* TPI Asynchronous Clock Prescaler Register Definitions */ -#define TPI_ACPR_PRESCALER_Pos 0U /*!< TPI ACPR: PRESCALER Position */ -#define TPI_ACPR_PRESCALER_Msk (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/) /*!< TPI ACPR: PRESCALER Mask */ - -/* TPI Selected Pin Protocol Register Definitions */ -#define TPI_SPPR_TXMODE_Pos 0U /*!< TPI SPPR: TXMODE Position */ -#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */ - -/* TPI Formatter and Flush Status Register Definitions */ -#define TPI_FFSR_FtNonStop_Pos 3U /*!< TPI FFSR: FtNonStop Position */ -#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ - -#define TPI_FFSR_TCPresent_Pos 2U /*!< TPI FFSR: TCPresent Position */ -#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ - -#define TPI_FFSR_FtStopped_Pos 1U /*!< TPI FFSR: FtStopped Position */ -#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ - -#define TPI_FFSR_FlInProg_Pos 0U /*!< TPI FFSR: FlInProg Position */ -#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */ - -/* TPI Formatter and Flush Control Register Definitions */ -#define TPI_FFCR_TrigIn_Pos 8U /*!< TPI FFCR: TrigIn Position */ -#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ - -#define TPI_FFCR_FOnMan_Pos 6U /*!< TPI FFCR: FOnMan Position */ -#define TPI_FFCR_FOnMan_Msk (0x1UL << TPI_FFCR_FOnMan_Pos) /*!< TPI FFCR: FOnMan Mask */ - -#define TPI_FFCR_EnFCont_Pos 1U /*!< TPI FFCR: EnFCont Position */ -#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */ - -/* TPI TRIGGER Register Definitions */ -#define TPI_TRIGGER_TRIGGER_Pos 0U /*!< TPI TRIGGER: TRIGGER Position */ -#define TPI_TRIGGER_TRIGGER_Msk (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/) /*!< TPI TRIGGER: TRIGGER Mask */ - -/* TPI Integration Test FIFO Test Data 0 Register Definitions */ -#define TPI_ITFTTD0_ATB_IF2_ATVALID_Pos 29U /*!< TPI ITFTTD0: ATB Interface 2 ATVALIDPosition */ -#define TPI_ITFTTD0_ATB_IF2_ATVALID_Msk (0x3UL << TPI_ITFTTD0_ATB_IF2_ATVALID_Pos) /*!< TPI ITFTTD0: ATB Interface 2 ATVALID Mask */ - -#define TPI_ITFTTD0_ATB_IF2_bytecount_Pos 27U /*!< TPI ITFTTD0: ATB Interface 2 byte count Position */ -#define TPI_ITFTTD0_ATB_IF2_bytecount_Msk (0x3UL << TPI_ITFTTD0_ATB_IF2_bytecount_Pos) /*!< TPI ITFTTD0: ATB Interface 2 byte count Mask */ - -#define TPI_ITFTTD0_ATB_IF1_ATVALID_Pos 26U /*!< TPI ITFTTD0: ATB Interface 1 ATVALID Position */ -#define TPI_ITFTTD0_ATB_IF1_ATVALID_Msk (0x3UL << TPI_ITFTTD0_ATB_IF1_ATVALID_Pos) /*!< TPI ITFTTD0: ATB Interface 1 ATVALID Mask */ - -#define TPI_ITFTTD0_ATB_IF1_bytecount_Pos 24U /*!< TPI ITFTTD0: ATB Interface 1 byte count Position */ -#define TPI_ITFTTD0_ATB_IF1_bytecount_Msk (0x3UL << TPI_ITFTTD0_ATB_IF1_bytecount_Pos) /*!< TPI ITFTTD0: ATB Interface 1 byte countt Mask */ - -#define TPI_ITFTTD0_ATB_IF1_data2_Pos 16U /*!< TPI ITFTTD0: ATB Interface 1 data2 Position */ -#define TPI_ITFTTD0_ATB_IF1_data2_Msk (0xFFUL << TPI_ITFTTD0_ATB_IF1_data1_Pos) /*!< TPI ITFTTD0: ATB Interface 1 data2 Mask */ - -#define TPI_ITFTTD0_ATB_IF1_data1_Pos 8U /*!< TPI ITFTTD0: ATB Interface 1 data1 Position */ -#define TPI_ITFTTD0_ATB_IF1_data1_Msk (0xFFUL << TPI_ITFTTD0_ATB_IF1_data1_Pos) /*!< TPI ITFTTD0: ATB Interface 1 data1 Mask */ - -#define TPI_ITFTTD0_ATB_IF1_data0_Pos 0U /*!< TPI ITFTTD0: ATB Interface 1 data0 Position */ -#define TPI_ITFTTD0_ATB_IF1_data0_Msk (0xFFUL /*<< TPI_ITFTTD0_ATB_IF1_data0_Pos*/) /*!< TPI ITFTTD0: ATB Interface 1 data0 Mask */ - -/* TPI Integration Test ATB Control Register 2 Register Definitions */ -#define TPI_ITATBCTR2_AFVALID2S_Pos 1U /*!< TPI ITATBCTR2: AFVALID2S Position */ -#define TPI_ITATBCTR2_AFVALID2S_Msk (0x1UL << TPI_ITATBCTR2_AFVALID2S_Pos) /*!< TPI ITATBCTR2: AFVALID2SS Mask */ - -#define TPI_ITATBCTR2_AFVALID1S_Pos 1U /*!< TPI ITATBCTR2: AFVALID1S Position */ -#define TPI_ITATBCTR2_AFVALID1S_Msk (0x1UL << TPI_ITATBCTR2_AFVALID1S_Pos) /*!< TPI ITATBCTR2: AFVALID1SS Mask */ - -#define TPI_ITATBCTR2_ATREADY2S_Pos 0U /*!< TPI ITATBCTR2: ATREADY2S Position */ -#define TPI_ITATBCTR2_ATREADY2S_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY2S_Pos*/) /*!< TPI ITATBCTR2: ATREADY2S Mask */ - -#define TPI_ITATBCTR2_ATREADY1S_Pos 0U /*!< TPI ITATBCTR2: ATREADY1S Position */ -#define TPI_ITATBCTR2_ATREADY1S_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY1S_Pos*/) /*!< TPI ITATBCTR2: ATREADY1S Mask */ - -/* TPI Integration Test FIFO Test Data 1 Register Definitions */ -#define TPI_ITFTTD1_ATB_IF2_ATVALID_Pos 29U /*!< TPI ITFTTD1: ATB Interface 2 ATVALID Position */ -#define TPI_ITFTTD1_ATB_IF2_ATVALID_Msk (0x3UL << TPI_ITFTTD1_ATB_IF2_ATVALID_Pos) /*!< TPI ITFTTD1: ATB Interface 2 ATVALID Mask */ - -#define TPI_ITFTTD1_ATB_IF2_bytecount_Pos 27U /*!< TPI ITFTTD1: ATB Interface 2 byte count Position */ -#define TPI_ITFTTD1_ATB_IF2_bytecount_Msk (0x3UL << TPI_ITFTTD1_ATB_IF2_bytecount_Pos) /*!< TPI ITFTTD1: ATB Interface 2 byte count Mask */ - -#define TPI_ITFTTD1_ATB_IF1_ATVALID_Pos 26U /*!< TPI ITFTTD1: ATB Interface 1 ATVALID Position */ -#define TPI_ITFTTD1_ATB_IF1_ATVALID_Msk (0x3UL << TPI_ITFTTD1_ATB_IF1_ATVALID_Pos) /*!< TPI ITFTTD1: ATB Interface 1 ATVALID Mask */ - -#define TPI_ITFTTD1_ATB_IF1_bytecount_Pos 24U /*!< TPI ITFTTD1: ATB Interface 1 byte count Position */ -#define TPI_ITFTTD1_ATB_IF1_bytecount_Msk (0x3UL << TPI_ITFTTD1_ATB_IF1_bytecount_Pos) /*!< TPI ITFTTD1: ATB Interface 1 byte countt Mask */ - -#define TPI_ITFTTD1_ATB_IF2_data2_Pos 16U /*!< TPI ITFTTD1: ATB Interface 2 data2 Position */ -#define TPI_ITFTTD1_ATB_IF2_data2_Msk (0xFFUL << TPI_ITFTTD1_ATB_IF2_data1_Pos) /*!< TPI ITFTTD1: ATB Interface 2 data2 Mask */ - -#define TPI_ITFTTD1_ATB_IF2_data1_Pos 8U /*!< TPI ITFTTD1: ATB Interface 2 data1 Position */ -#define TPI_ITFTTD1_ATB_IF2_data1_Msk (0xFFUL << TPI_ITFTTD1_ATB_IF2_data1_Pos) /*!< TPI ITFTTD1: ATB Interface 2 data1 Mask */ - -#define TPI_ITFTTD1_ATB_IF2_data0_Pos 0U /*!< TPI ITFTTD1: ATB Interface 2 data0 Position */ -#define TPI_ITFTTD1_ATB_IF2_data0_Msk (0xFFUL /*<< TPI_ITFTTD1_ATB_IF2_data0_Pos*/) /*!< TPI ITFTTD1: ATB Interface 2 data0 Mask */ - -/* TPI Integration Test ATB Control Register 0 Definitions */ -#define TPI_ITATBCTR0_AFVALID2S_Pos 1U /*!< TPI ITATBCTR0: AFVALID2S Position */ -#define TPI_ITATBCTR0_AFVALID2S_Msk (0x1UL << TPI_ITATBCTR0_AFVALID2S_Pos) /*!< TPI ITATBCTR0: AFVALID2SS Mask */ - -#define TPI_ITATBCTR0_AFVALID1S_Pos 1U /*!< TPI ITATBCTR0: AFVALID1S Position */ -#define TPI_ITATBCTR0_AFVALID1S_Msk (0x1UL << TPI_ITATBCTR0_AFVALID1S_Pos) /*!< TPI ITATBCTR0: AFVALID1SS Mask */ - -#define TPI_ITATBCTR0_ATREADY2S_Pos 0U /*!< TPI ITATBCTR0: ATREADY2S Position */ -#define TPI_ITATBCTR0_ATREADY2S_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY2S_Pos*/) /*!< TPI ITATBCTR0: ATREADY2S Mask */ - -#define TPI_ITATBCTR0_ATREADY1S_Pos 0U /*!< TPI ITATBCTR0: ATREADY1S Position */ -#define TPI_ITATBCTR0_ATREADY1S_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY1S_Pos*/) /*!< TPI ITATBCTR0: ATREADY1S Mask */ - -/* TPI Integration Mode Control Register Definitions */ -#define TPI_ITCTRL_Mode_Pos 0U /*!< TPI ITCTRL: Mode Position */ -#define TPI_ITCTRL_Mode_Msk (0x3UL /*<< TPI_ITCTRL_Mode_Pos*/) /*!< TPI ITCTRL: Mode Mask */ - -/* TPI DEVID Register Definitions */ -#define TPI_DEVID_NRZVALID_Pos 11U /*!< TPI DEVID: NRZVALID Position */ -#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ - -#define TPI_DEVID_MANCVALID_Pos 10U /*!< TPI DEVID: MANCVALID Position */ -#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ - -#define TPI_DEVID_PTINVALID_Pos 9U /*!< TPI DEVID: PTINVALID Position */ -#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ - -#define TPI_DEVID_FIFOSZ_Pos 6U /*!< TPI DEVID: FIFOSZ Position */ -#define TPI_DEVID_FIFOSZ_Msk (0x7UL << TPI_DEVID_FIFOSZ_Pos) /*!< TPI DEVID: FIFOSZ Mask */ - -#define TPI_DEVID_NrTraceInput_Pos 0U /*!< TPI DEVID: NrTraceInput Position */ -#define TPI_DEVID_NrTraceInput_Msk (0x3FUL /*<< TPI_DEVID_NrTraceInput_Pos*/) /*!< TPI DEVID: NrTraceInput Mask */ - -/* TPI DEVTYPE Register Definitions */ -#define TPI_DEVTYPE_SubType_Pos 4U /*!< TPI DEVTYPE: SubType Position */ -#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */ - -#define TPI_DEVTYPE_MajorType_Pos 0U /*!< TPI DEVTYPE: MajorType Position */ -#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ - -/*@}*/ /* end of group CMSIS_TPI */ - - -#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_MPU Memory Protection Unit (MPU) - \brief Type definitions for the Memory Protection Unit (MPU) - @{ - */ - -/** - \brief Structure type to access the Memory Protection Unit (MPU). - */ -typedef struct -{ - __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ - __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ - __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region Number Register */ - __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ - __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) MPU Region Limit Address Register */ - __IOM uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Region Base Address Register Alias 1 */ - __IOM uint32_t RLAR_A1; /*!< Offset: 0x018 (R/W) MPU Region Limit Address Register Alias 1 */ - __IOM uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Region Base Address Register Alias 2 */ - __IOM uint32_t RLAR_A2; /*!< Offset: 0x020 (R/W) MPU Region Limit Address Register Alias 2 */ - __IOM uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Region Base Address Register Alias 3 */ - __IOM uint32_t RLAR_A3; /*!< Offset: 0x028 (R/W) MPU Region Limit Address Register Alias 3 */ - uint32_t RESERVED0[1]; - union { - __IOM uint32_t MAIR[2]; - struct { - __IOM uint32_t MAIR0; /*!< Offset: 0x030 (R/W) MPU Memory Attribute Indirection Register 0 */ - __IOM uint32_t MAIR1; /*!< Offset: 0x034 (R/W) MPU Memory Attribute Indirection Register 1 */ - }; - }; -} MPU_Type; - -#define MPU_TYPE_RALIASES 4U - -/* MPU Type Register Definitions */ -#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */ -#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ - -#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */ -#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ - -#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */ -#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ - -/* MPU Control Register Definitions */ -#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */ -#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ - -#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */ -#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ - -#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */ -#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ - -/* MPU Region Number Register Definitions */ -#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */ -#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ - -/* MPU Region Base Address Register Definitions */ -#define MPU_RBAR_BASE_Pos 5U /*!< MPU RBAR: BASE Position */ -#define MPU_RBAR_BASE_Msk (0x7FFFFFFUL << MPU_RBAR_BASE_Pos) /*!< MPU RBAR: BASE Mask */ - -#define MPU_RBAR_SH_Pos 3U /*!< MPU RBAR: SH Position */ -#define MPU_RBAR_SH_Msk (0x3UL << MPU_RBAR_SH_Pos) /*!< MPU RBAR: SH Mask */ - -#define MPU_RBAR_AP_Pos 1U /*!< MPU RBAR: AP Position */ -#define MPU_RBAR_AP_Msk (0x3UL << MPU_RBAR_AP_Pos) /*!< MPU RBAR: AP Mask */ - -#define MPU_RBAR_XN_Pos 0U /*!< MPU RBAR: XN Position */ -#define MPU_RBAR_XN_Msk (01UL /*<< MPU_RBAR_XN_Pos*/) /*!< MPU RBAR: XN Mask */ - -/* MPU Region Limit Address Register Definitions */ -#define MPU_RLAR_LIMIT_Pos 5U /*!< MPU RLAR: LIMIT Position */ -#define MPU_RLAR_LIMIT_Msk (0x7FFFFFFUL << MPU_RLAR_LIMIT_Pos) /*!< MPU RLAR: LIMIT Mask */ - -#define MPU_RLAR_AttrIndx_Pos 1U /*!< MPU RLAR: AttrIndx Position */ -#define MPU_RLAR_AttrIndx_Msk (0x7UL << MPU_RLAR_AttrIndx_Pos) /*!< MPU RLAR: AttrIndx Mask */ - -#define MPU_RLAR_EN_Pos 0U /*!< MPU RLAR: Region enable bit Position */ -#define MPU_RLAR_EN_Msk (1UL /*<< MPU_RLAR_EN_Pos*/) /*!< MPU RLAR: Region enable bit Disable Mask */ - -/* MPU Memory Attribute Indirection Register 0 Definitions */ -#define MPU_MAIR0_Attr3_Pos 24U /*!< MPU MAIR0: Attr3 Position */ -#define MPU_MAIR0_Attr3_Msk (0xFFUL << MPU_MAIR0_Attr3_Pos) /*!< MPU MAIR0: Attr3 Mask */ - -#define MPU_MAIR0_Attr2_Pos 16U /*!< MPU MAIR0: Attr2 Position */ -#define MPU_MAIR0_Attr2_Msk (0xFFUL << MPU_MAIR0_Attr2_Pos) /*!< MPU MAIR0: Attr2 Mask */ - -#define MPU_MAIR0_Attr1_Pos 8U /*!< MPU MAIR0: Attr1 Position */ -#define MPU_MAIR0_Attr1_Msk (0xFFUL << MPU_MAIR0_Attr1_Pos) /*!< MPU MAIR0: Attr1 Mask */ - -#define MPU_MAIR0_Attr0_Pos 0U /*!< MPU MAIR0: Attr0 Position */ -#define MPU_MAIR0_Attr0_Msk (0xFFUL /*<< MPU_MAIR0_Attr0_Pos*/) /*!< MPU MAIR0: Attr0 Mask */ - -/* MPU Memory Attribute Indirection Register 1 Definitions */ -#define MPU_MAIR1_Attr7_Pos 24U /*!< MPU MAIR1: Attr7 Position */ -#define MPU_MAIR1_Attr7_Msk (0xFFUL << MPU_MAIR1_Attr7_Pos) /*!< MPU MAIR1: Attr7 Mask */ - -#define MPU_MAIR1_Attr6_Pos 16U /*!< MPU MAIR1: Attr6 Position */ -#define MPU_MAIR1_Attr6_Msk (0xFFUL << MPU_MAIR1_Attr6_Pos) /*!< MPU MAIR1: Attr6 Mask */ - -#define MPU_MAIR1_Attr5_Pos 8U /*!< MPU MAIR1: Attr5 Position */ -#define MPU_MAIR1_Attr5_Msk (0xFFUL << MPU_MAIR1_Attr5_Pos) /*!< MPU MAIR1: Attr5 Mask */ - -#define MPU_MAIR1_Attr4_Pos 0U /*!< MPU MAIR1: Attr4 Position */ -#define MPU_MAIR1_Attr4_Msk (0xFFUL /*<< MPU_MAIR1_Attr4_Pos*/) /*!< MPU MAIR1: Attr4 Mask */ - -/*@} end of group CMSIS_MPU */ -#endif - - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_SAU Security Attribution Unit (SAU) - \brief Type definitions for the Security Attribution Unit (SAU) - @{ - */ - -/** - \brief Structure type to access the Security Attribution Unit (SAU). - */ -typedef struct -{ - __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SAU Control Register */ - __IM uint32_t TYPE; /*!< Offset: 0x004 (R/ ) SAU Type Register */ -#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) - __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) SAU Region Number Register */ - __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) SAU Region Base Address Register */ - __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) SAU Region Limit Address Register */ -#else - uint32_t RESERVED0[3]; -#endif - __IOM uint32_t SFSR; /*!< Offset: 0x014 (R/W) Secure Fault Status Register */ - __IOM uint32_t SFAR; /*!< Offset: 0x018 (R/W) Secure Fault Address Register */ -} SAU_Type; - -/* SAU Control Register Definitions */ -#define SAU_CTRL_ALLNS_Pos 1U /*!< SAU CTRL: ALLNS Position */ -#define SAU_CTRL_ALLNS_Msk (1UL << SAU_CTRL_ALLNS_Pos) /*!< SAU CTRL: ALLNS Mask */ - -#define SAU_CTRL_ENABLE_Pos 0U /*!< SAU CTRL: ENABLE Position */ -#define SAU_CTRL_ENABLE_Msk (1UL /*<< SAU_CTRL_ENABLE_Pos*/) /*!< SAU CTRL: ENABLE Mask */ - -/* SAU Type Register Definitions */ -#define SAU_TYPE_SREGION_Pos 0U /*!< SAU TYPE: SREGION Position */ -#define SAU_TYPE_SREGION_Msk (0xFFUL /*<< SAU_TYPE_SREGION_Pos*/) /*!< SAU TYPE: SREGION Mask */ - -#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) -/* SAU Region Number Register Definitions */ -#define SAU_RNR_REGION_Pos 0U /*!< SAU RNR: REGION Position */ -#define SAU_RNR_REGION_Msk (0xFFUL /*<< SAU_RNR_REGION_Pos*/) /*!< SAU RNR: REGION Mask */ - -/* SAU Region Base Address Register Definitions */ -#define SAU_RBAR_BADDR_Pos 5U /*!< SAU RBAR: BADDR Position */ -#define SAU_RBAR_BADDR_Msk (0x7FFFFFFUL << SAU_RBAR_BADDR_Pos) /*!< SAU RBAR: BADDR Mask */ - -/* SAU Region Limit Address Register Definitions */ -#define SAU_RLAR_LADDR_Pos 5U /*!< SAU RLAR: LADDR Position */ -#define SAU_RLAR_LADDR_Msk (0x7FFFFFFUL << SAU_RLAR_LADDR_Pos) /*!< SAU RLAR: LADDR Mask */ - -#define SAU_RLAR_NSC_Pos 1U /*!< SAU RLAR: NSC Position */ -#define SAU_RLAR_NSC_Msk (1UL << SAU_RLAR_NSC_Pos) /*!< SAU RLAR: NSC Mask */ - -#define SAU_RLAR_ENABLE_Pos 0U /*!< SAU RLAR: ENABLE Position */ -#define SAU_RLAR_ENABLE_Msk (1UL /*<< SAU_RLAR_ENABLE_Pos*/) /*!< SAU RLAR: ENABLE Mask */ - -#endif /* defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) */ - -/* Secure Fault Status Register Definitions */ -#define SAU_SFSR_LSERR_Pos 7U /*!< SAU SFSR: LSERR Position */ -#define SAU_SFSR_LSERR_Msk (1UL << SAU_SFSR_LSERR_Pos) /*!< SAU SFSR: LSERR Mask */ - -#define SAU_SFSR_SFARVALID_Pos 6U /*!< SAU SFSR: SFARVALID Position */ -#define SAU_SFSR_SFARVALID_Msk (1UL << SAU_SFSR_SFARVALID_Pos) /*!< SAU SFSR: SFARVALID Mask */ - -#define SAU_SFSR_LSPERR_Pos 5U /*!< SAU SFSR: LSPERR Position */ -#define SAU_SFSR_LSPERR_Msk (1UL << SAU_SFSR_LSPERR_Pos) /*!< SAU SFSR: LSPERR Mask */ - -#define SAU_SFSR_INVTRAN_Pos 4U /*!< SAU SFSR: INVTRAN Position */ -#define SAU_SFSR_INVTRAN_Msk (1UL << SAU_SFSR_INVTRAN_Pos) /*!< SAU SFSR: INVTRAN Mask */ - -#define SAU_SFSR_AUVIOL_Pos 3U /*!< SAU SFSR: AUVIOL Position */ -#define SAU_SFSR_AUVIOL_Msk (1UL << SAU_SFSR_AUVIOL_Pos) /*!< SAU SFSR: AUVIOL Mask */ - -#define SAU_SFSR_INVER_Pos 2U /*!< SAU SFSR: INVER Position */ -#define SAU_SFSR_INVER_Msk (1UL << SAU_SFSR_INVER_Pos) /*!< SAU SFSR: INVER Mask */ - -#define SAU_SFSR_INVIS_Pos 1U /*!< SAU SFSR: INVIS Position */ -#define SAU_SFSR_INVIS_Msk (1UL << SAU_SFSR_INVIS_Pos) /*!< SAU SFSR: INVIS Mask */ - -#define SAU_SFSR_INVEP_Pos 0U /*!< SAU SFSR: INVEP Position */ -#define SAU_SFSR_INVEP_Msk (1UL /*<< SAU_SFSR_INVEP_Pos*/) /*!< SAU SFSR: INVEP Mask */ - -/*@} end of group CMSIS_SAU */ -#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_FPU Floating Point Unit (FPU) - \brief Type definitions for the Floating Point Unit (FPU) - @{ - */ - -/** - \brief Structure type to access the Floating Point Unit (FPU). - */ -typedef struct -{ - uint32_t RESERVED0[1U]; - __IOM uint32_t FPCCR; /*!< Offset: 0x004 (R/W) Floating-Point Context Control Register */ - __IOM uint32_t FPCAR; /*!< Offset: 0x008 (R/W) Floating-Point Context Address Register */ - __IOM uint32_t FPDSCR; /*!< Offset: 0x00C (R/W) Floating-Point Default Status Control Register */ - __IM uint32_t MVFR0; /*!< Offset: 0x010 (R/ ) Media and VFP Feature Register 0 */ - __IM uint32_t MVFR1; /*!< Offset: 0x014 (R/ ) Media and VFP Feature Register 1 */ - __IM uint32_t MVFR2; /*!< Offset: 0x018 (R/ ) Media and VFP Feature Register 2 */ -} FPU_Type; - -/* Floating-Point Context Control Register Definitions */ -#define FPU_FPCCR_ASPEN_Pos 31U /*!< FPCCR: ASPEN bit Position */ -#define FPU_FPCCR_ASPEN_Msk (1UL << FPU_FPCCR_ASPEN_Pos) /*!< FPCCR: ASPEN bit Mask */ - -#define FPU_FPCCR_LSPEN_Pos 30U /*!< FPCCR: LSPEN Position */ -#define FPU_FPCCR_LSPEN_Msk (1UL << FPU_FPCCR_LSPEN_Pos) /*!< FPCCR: LSPEN bit Mask */ - -#define FPU_FPCCR_LSPENS_Pos 29U /*!< FPCCR: LSPENS Position */ -#define FPU_FPCCR_LSPENS_Msk (1UL << FPU_FPCCR_LSPENS_Pos) /*!< FPCCR: LSPENS bit Mask */ - -#define FPU_FPCCR_CLRONRET_Pos 28U /*!< FPCCR: CLRONRET Position */ -#define FPU_FPCCR_CLRONRET_Msk (1UL << FPU_FPCCR_CLRONRET_Pos) /*!< FPCCR: CLRONRET bit Mask */ - -#define FPU_FPCCR_CLRONRETS_Pos 27U /*!< FPCCR: CLRONRETS Position */ -#define FPU_FPCCR_CLRONRETS_Msk (1UL << FPU_FPCCR_CLRONRETS_Pos) /*!< FPCCR: CLRONRETS bit Mask */ - -#define FPU_FPCCR_TS_Pos 26U /*!< FPCCR: TS Position */ -#define FPU_FPCCR_TS_Msk (1UL << FPU_FPCCR_TS_Pos) /*!< FPCCR: TS bit Mask */ - -#define FPU_FPCCR_UFRDY_Pos 10U /*!< FPCCR: UFRDY Position */ -#define FPU_FPCCR_UFRDY_Msk (1UL << FPU_FPCCR_UFRDY_Pos) /*!< FPCCR: UFRDY bit Mask */ - -#define FPU_FPCCR_SPLIMVIOL_Pos 9U /*!< FPCCR: SPLIMVIOL Position */ -#define FPU_FPCCR_SPLIMVIOL_Msk (1UL << FPU_FPCCR_SPLIMVIOL_Pos) /*!< FPCCR: SPLIMVIOL bit Mask */ - -#define FPU_FPCCR_MONRDY_Pos 8U /*!< FPCCR: MONRDY Position */ -#define FPU_FPCCR_MONRDY_Msk (1UL << FPU_FPCCR_MONRDY_Pos) /*!< FPCCR: MONRDY bit Mask */ - -#define FPU_FPCCR_SFRDY_Pos 7U /*!< FPCCR: SFRDY Position */ -#define FPU_FPCCR_SFRDY_Msk (1UL << FPU_FPCCR_SFRDY_Pos) /*!< FPCCR: SFRDY bit Mask */ - -#define FPU_FPCCR_BFRDY_Pos 6U /*!< FPCCR: BFRDY Position */ -#define FPU_FPCCR_BFRDY_Msk (1UL << FPU_FPCCR_BFRDY_Pos) /*!< FPCCR: BFRDY bit Mask */ - -#define FPU_FPCCR_MMRDY_Pos 5U /*!< FPCCR: MMRDY Position */ -#define FPU_FPCCR_MMRDY_Msk (1UL << FPU_FPCCR_MMRDY_Pos) /*!< FPCCR: MMRDY bit Mask */ - -#define FPU_FPCCR_HFRDY_Pos 4U /*!< FPCCR: HFRDY Position */ -#define FPU_FPCCR_HFRDY_Msk (1UL << FPU_FPCCR_HFRDY_Pos) /*!< FPCCR: HFRDY bit Mask */ - -#define FPU_FPCCR_THREAD_Pos 3U /*!< FPCCR: processor mode bit Position */ -#define FPU_FPCCR_THREAD_Msk (1UL << FPU_FPCCR_THREAD_Pos) /*!< FPCCR: processor mode active bit Mask */ - -#define FPU_FPCCR_S_Pos 2U /*!< FPCCR: Security status of the FP context bit Position */ -#define FPU_FPCCR_S_Msk (1UL << FPU_FPCCR_S_Pos) /*!< FPCCR: Security status of the FP context bit Mask */ - -#define FPU_FPCCR_USER_Pos 1U /*!< FPCCR: privilege level bit Position */ -#define FPU_FPCCR_USER_Msk (1UL << FPU_FPCCR_USER_Pos) /*!< FPCCR: privilege level bit Mask */ - -#define FPU_FPCCR_LSPACT_Pos 0U /*!< FPCCR: Lazy state preservation active bit Position */ -#define FPU_FPCCR_LSPACT_Msk (1UL /*<< FPU_FPCCR_LSPACT_Pos*/) /*!< FPCCR: Lazy state preservation active bit Mask */ - -/* Floating-Point Context Address Register Definitions */ -#define FPU_FPCAR_ADDRESS_Pos 3U /*!< FPCAR: ADDRESS bit Position */ -#define FPU_FPCAR_ADDRESS_Msk (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos) /*!< FPCAR: ADDRESS bit Mask */ - -/* Floating-Point Default Status Control Register Definitions */ -#define FPU_FPDSCR_AHP_Pos 26U /*!< FPDSCR: AHP bit Position */ -#define FPU_FPDSCR_AHP_Msk (1UL << FPU_FPDSCR_AHP_Pos) /*!< FPDSCR: AHP bit Mask */ - -#define FPU_FPDSCR_DN_Pos 25U /*!< FPDSCR: DN bit Position */ -#define FPU_FPDSCR_DN_Msk (1UL << FPU_FPDSCR_DN_Pos) /*!< FPDSCR: DN bit Mask */ - -#define FPU_FPDSCR_FZ_Pos 24U /*!< FPDSCR: FZ bit Position */ -#define FPU_FPDSCR_FZ_Msk (1UL << FPU_FPDSCR_FZ_Pos) /*!< FPDSCR: FZ bit Mask */ - -#define FPU_FPDSCR_RMode_Pos 22U /*!< FPDSCR: RMode bit Position */ -#define FPU_FPDSCR_RMode_Msk (3UL << FPU_FPDSCR_RMode_Pos) /*!< FPDSCR: RMode bit Mask */ - -/* Media and VFP Feature Register 0 Definitions */ -#define FPU_MVFR0_FP_rounding_modes_Pos 28U /*!< MVFR0: FP rounding modes bits Position */ -#define FPU_MVFR0_FP_rounding_modes_Msk (0xFUL << FPU_MVFR0_FP_rounding_modes_Pos) /*!< MVFR0: FP rounding modes bits Mask */ - -#define FPU_MVFR0_Short_vectors_Pos 24U /*!< MVFR0: Short vectors bits Position */ -#define FPU_MVFR0_Short_vectors_Msk (0xFUL << FPU_MVFR0_Short_vectors_Pos) /*!< MVFR0: Short vectors bits Mask */ - -#define FPU_MVFR0_Square_root_Pos 20U /*!< MVFR0: Square root bits Position */ -#define FPU_MVFR0_Square_root_Msk (0xFUL << FPU_MVFR0_Square_root_Pos) /*!< MVFR0: Square root bits Mask */ - -#define FPU_MVFR0_Divide_Pos 16U /*!< MVFR0: Divide bits Position */ -#define FPU_MVFR0_Divide_Msk (0xFUL << FPU_MVFR0_Divide_Pos) /*!< MVFR0: Divide bits Mask */ - -#define FPU_MVFR0_FP_excep_trapping_Pos 12U /*!< MVFR0: FP exception trapping bits Position */ -#define FPU_MVFR0_FP_excep_trapping_Msk (0xFUL << FPU_MVFR0_FP_excep_trapping_Pos) /*!< MVFR0: FP exception trapping bits Mask */ - -#define FPU_MVFR0_Double_precision_Pos 8U /*!< MVFR0: Double-precision bits Position */ -#define FPU_MVFR0_Double_precision_Msk (0xFUL << FPU_MVFR0_Double_precision_Pos) /*!< MVFR0: Double-precision bits Mask */ - -#define FPU_MVFR0_Single_precision_Pos 4U /*!< MVFR0: Single-precision bits Position */ -#define FPU_MVFR0_Single_precision_Msk (0xFUL << FPU_MVFR0_Single_precision_Pos) /*!< MVFR0: Single-precision bits Mask */ - -#define FPU_MVFR0_A_SIMD_registers_Pos 0U /*!< MVFR0: A_SIMD registers bits Position */ -#define FPU_MVFR0_A_SIMD_registers_Msk (0xFUL /*<< FPU_MVFR0_A_SIMD_registers_Pos*/) /*!< MVFR0: A_SIMD registers bits Mask */ - -/* Media and VFP Feature Register 1 Definitions */ -#define FPU_MVFR1_FP_fused_MAC_Pos 28U /*!< MVFR1: FP fused MAC bits Position */ -#define FPU_MVFR1_FP_fused_MAC_Msk (0xFUL << FPU_MVFR1_FP_fused_MAC_Pos) /*!< MVFR1: FP fused MAC bits Mask */ - -#define FPU_MVFR1_FP_HPFP_Pos 24U /*!< MVFR1: FP HPFP bits Position */ -#define FPU_MVFR1_FP_HPFP_Msk (0xFUL << FPU_MVFR1_FP_HPFP_Pos) /*!< MVFR1: FP HPFP bits Mask */ - -#define FPU_MVFR1_D_NaN_mode_Pos 4U /*!< MVFR1: D_NaN mode bits Position */ -#define FPU_MVFR1_D_NaN_mode_Msk (0xFUL << FPU_MVFR1_D_NaN_mode_Pos) /*!< MVFR1: D_NaN mode bits Mask */ - -#define FPU_MVFR1_FtZ_mode_Pos 0U /*!< MVFR1: FtZ mode bits Position */ -#define FPU_MVFR1_FtZ_mode_Msk (0xFUL /*<< FPU_MVFR1_FtZ_mode_Pos*/) /*!< MVFR1: FtZ mode bits Mask */ - -/* Media and VFP Feature Register 2 Definitions */ -#define FPU_MVFR2_FPMisc_Pos 4U /*!< MVFR2: FPMisc bits Position */ -#define FPU_MVFR2_FPMisc_Msk (0xFUL << FPU_MVFR2_FPMisc_Pos) /*!< MVFR2: FPMisc bits Mask */ - -/*@} end of group CMSIS_FPU */ - -/* CoreDebug is deprecated. replaced by DCB (Debug Control Block) */ -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) - \brief Type definitions for the Core Debug Registers - @{ - */ - -/** - \brief \deprecated Structure type to access the Core Debug Register (CoreDebug). - */ -typedef struct -{ - __IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ - __OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ - __IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ - __IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ - uint32_t RESERVED0[1U]; - __IOM uint32_t DAUTHCTRL; /*!< Offset: 0x014 (R/W) Debug Authentication Control Register */ - __IOM uint32_t DSCSR; /*!< Offset: 0x018 (R/W) Debug Security Control and Status Register */ -} CoreDebug_Type; - -/* Debug Halting Control and Status Register Definitions */ -#define CoreDebug_DHCSR_DBGKEY_Pos 16U /*!< \deprecated CoreDebug DHCSR: DBGKEY Position */ -#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< \deprecated CoreDebug DHCSR: DBGKEY Mask */ - -#define CoreDebug_DHCSR_S_RESTART_ST_Pos 26U /*!< \deprecated CoreDebug DHCSR: S_RESTART_ST Position */ -#define CoreDebug_DHCSR_S_RESTART_ST_Msk (1UL << CoreDebug_DHCSR_S_RESTART_ST_Pos) /*!< \deprecated CoreDebug DHCSR: S_RESTART_ST Mask */ - -#define CoreDebug_DHCSR_S_RESET_ST_Pos 25U /*!< \deprecated CoreDebug DHCSR: S_RESET_ST Position */ -#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< \deprecated CoreDebug DHCSR: S_RESET_ST Mask */ - -#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24U /*!< \deprecated CoreDebug DHCSR: S_RETIRE_ST Position */ -#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< \deprecated CoreDebug DHCSR: S_RETIRE_ST Mask */ - -#define CoreDebug_DHCSR_S_LOCKUP_Pos 19U /*!< \deprecated CoreDebug DHCSR: S_LOCKUP Position */ -#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< \deprecated CoreDebug DHCSR: S_LOCKUP Mask */ - -#define CoreDebug_DHCSR_S_SLEEP_Pos 18U /*!< \deprecated CoreDebug DHCSR: S_SLEEP Position */ -#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< \deprecated CoreDebug DHCSR: S_SLEEP Mask */ - -#define CoreDebug_DHCSR_S_HALT_Pos 17U /*!< \deprecated CoreDebug DHCSR: S_HALT Position */ -#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< \deprecated CoreDebug DHCSR: S_HALT Mask */ - -#define CoreDebug_DHCSR_S_REGRDY_Pos 16U /*!< \deprecated CoreDebug DHCSR: S_REGRDY Position */ -#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< \deprecated CoreDebug DHCSR: S_REGRDY Mask */ - -#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5U /*!< \deprecated CoreDebug DHCSR: C_SNAPSTALL Position */ -#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< \deprecated CoreDebug DHCSR: C_SNAPSTALL Mask */ - -#define CoreDebug_DHCSR_C_MASKINTS_Pos 3U /*!< \deprecated CoreDebug DHCSR: C_MASKINTS Position */ -#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< \deprecated CoreDebug DHCSR: C_MASKINTS Mask */ - -#define CoreDebug_DHCSR_C_STEP_Pos 2U /*!< \deprecated CoreDebug DHCSR: C_STEP Position */ -#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< \deprecated CoreDebug DHCSR: C_STEP Mask */ - -#define CoreDebug_DHCSR_C_HALT_Pos 1U /*!< \deprecated CoreDebug DHCSR: C_HALT Position */ -#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< \deprecated CoreDebug DHCSR: C_HALT Mask */ - -#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0U /*!< \deprecated CoreDebug DHCSR: C_DEBUGEN Position */ -#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< \deprecated CoreDebug DHCSR: C_DEBUGEN Mask */ - -/* Debug Core Register Selector Register Definitions */ -#define CoreDebug_DCRSR_REGWnR_Pos 16U /*!< \deprecated CoreDebug DCRSR: REGWnR Position */ -#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< \deprecated CoreDebug DCRSR: REGWnR Mask */ - -#define CoreDebug_DCRSR_REGSEL_Pos 0U /*!< \deprecated CoreDebug DCRSR: REGSEL Position */ -#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< \deprecated CoreDebug DCRSR: REGSEL Mask */ - -/* Debug Exception and Monitor Control Register Definitions */ -#define CoreDebug_DEMCR_TRCENA_Pos 24U /*!< \deprecated CoreDebug DEMCR: TRCENA Position */ -#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< \deprecated CoreDebug DEMCR: TRCENA Mask */ - -#define CoreDebug_DEMCR_MON_REQ_Pos 19U /*!< \deprecated CoreDebug DEMCR: MON_REQ Position */ -#define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< \deprecated CoreDebug DEMCR: MON_REQ Mask */ - -#define CoreDebug_DEMCR_MON_STEP_Pos 18U /*!< \deprecated CoreDebug DEMCR: MON_STEP Position */ -#define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< \deprecated CoreDebug DEMCR: MON_STEP Mask */ - -#define CoreDebug_DEMCR_MON_PEND_Pos 17U /*!< \deprecated CoreDebug DEMCR: MON_PEND Position */ -#define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< \deprecated CoreDebug DEMCR: MON_PEND Mask */ - -#define CoreDebug_DEMCR_MON_EN_Pos 16U /*!< \deprecated CoreDebug DEMCR: MON_EN Position */ -#define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< \deprecated CoreDebug DEMCR: MON_EN Mask */ - -#define CoreDebug_DEMCR_VC_HARDERR_Pos 10U /*!< \deprecated CoreDebug DEMCR: VC_HARDERR Position */ -#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< \deprecated CoreDebug DEMCR: VC_HARDERR Mask */ - -#define CoreDebug_DEMCR_VC_INTERR_Pos 9U /*!< \deprecated CoreDebug DEMCR: VC_INTERR Position */ -#define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< \deprecated CoreDebug DEMCR: VC_INTERR Mask */ - -#define CoreDebug_DEMCR_VC_BUSERR_Pos 8U /*!< \deprecated CoreDebug DEMCR: VC_BUSERR Position */ -#define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< \deprecated CoreDebug DEMCR: VC_BUSERR Mask */ - -#define CoreDebug_DEMCR_VC_STATERR_Pos 7U /*!< \deprecated CoreDebug DEMCR: VC_STATERR Position */ -#define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< \deprecated CoreDebug DEMCR: VC_STATERR Mask */ - -#define CoreDebug_DEMCR_VC_CHKERR_Pos 6U /*!< \deprecated CoreDebug DEMCR: VC_CHKERR Position */ -#define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< \deprecated CoreDebug DEMCR: VC_CHKERR Mask */ - -#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5U /*!< \deprecated CoreDebug DEMCR: VC_NOCPERR Position */ -#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< \deprecated CoreDebug DEMCR: VC_NOCPERR Mask */ - -#define CoreDebug_DEMCR_VC_MMERR_Pos 4U /*!< \deprecated CoreDebug DEMCR: VC_MMERR Position */ -#define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< \deprecated CoreDebug DEMCR: VC_MMERR Mask */ - -#define CoreDebug_DEMCR_VC_CORERESET_Pos 0U /*!< \deprecated CoreDebug DEMCR: VC_CORERESET Position */ -#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< \deprecated CoreDebug DEMCR: VC_CORERESET Mask */ - -/* Debug Authentication Control Register Definitions */ -#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos 3U /*!< \deprecated CoreDebug DAUTHCTRL: INTSPNIDEN, Position */ -#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos) /*!< \deprecated CoreDebug DAUTHCTRL: INTSPNIDEN, Mask */ - -#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos 2U /*!< \deprecated CoreDebug DAUTHCTRL: SPNIDENSEL Position */ -#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Msk (1UL << CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos) /*!< \deprecated CoreDebug DAUTHCTRL: SPNIDENSEL Mask */ - -#define CoreDebug_DAUTHCTRL_INTSPIDEN_Pos 1U /*!< \deprecated CoreDebug DAUTHCTRL: INTSPIDEN Position */ -#define CoreDebug_DAUTHCTRL_INTSPIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPIDEN_Pos) /*!< \deprecated CoreDebug DAUTHCTRL: INTSPIDEN Mask */ - -#define CoreDebug_DAUTHCTRL_SPIDENSEL_Pos 0U /*!< \deprecated CoreDebug DAUTHCTRL: SPIDENSEL Position */ -#define CoreDebug_DAUTHCTRL_SPIDENSEL_Msk (1UL /*<< CoreDebug_DAUTHCTRL_SPIDENSEL_Pos*/) /*!< \deprecated CoreDebug DAUTHCTRL: SPIDENSEL Mask */ - -/* Debug Security Control and Status Register Definitions */ -#define CoreDebug_DSCSR_CDS_Pos 16U /*!< \deprecated CoreDebug DSCSR: CDS Position */ -#define CoreDebug_DSCSR_CDS_Msk (1UL << CoreDebug_DSCSR_CDS_Pos) /*!< \deprecated CoreDebug DSCSR: CDS Mask */ - -#define CoreDebug_DSCSR_SBRSEL_Pos 1U /*!< \deprecated CoreDebug DSCSR: SBRSEL Position */ -#define CoreDebug_DSCSR_SBRSEL_Msk (1UL << CoreDebug_DSCSR_SBRSEL_Pos) /*!< \deprecated CoreDebug DSCSR: SBRSEL Mask */ - -#define CoreDebug_DSCSR_SBRSELEN_Pos 0U /*!< \deprecated CoreDebug DSCSR: SBRSELEN Position */ -#define CoreDebug_DSCSR_SBRSELEN_Msk (1UL /*<< CoreDebug_DSCSR_SBRSELEN_Pos*/) /*!< \deprecated CoreDebug DSCSR: SBRSELEN Mask */ - -/*@} end of group CMSIS_CoreDebug */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_DCB Debug Control Block - \brief Type definitions for the Debug Control Block Registers - @{ - */ - -/** - \brief Structure type to access the Debug Control Block Registers (DCB). - */ -typedef struct -{ - __IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ - __OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ - __IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ - __IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ - uint32_t RESERVED0[1U]; - __IOM uint32_t DAUTHCTRL; /*!< Offset: 0x014 (R/W) Debug Authentication Control Register */ - __IOM uint32_t DSCSR; /*!< Offset: 0x018 (R/W) Debug Security Control and Status Register */ -} DCB_Type; - -/* DHCSR, Debug Halting Control and Status Register Definitions */ -#define DCB_DHCSR_DBGKEY_Pos 16U /*!< DCB DHCSR: Debug key Position */ -#define DCB_DHCSR_DBGKEY_Msk (0xFFFFUL << DCB_DHCSR_DBGKEY_Pos) /*!< DCB DHCSR: Debug key Mask */ - -#define DCB_DHCSR_S_RESTART_ST_Pos 26U /*!< DCB DHCSR: Restart sticky status Position */ -#define DCB_DHCSR_S_RESTART_ST_Msk (0x1UL << DCB_DHCSR_S_RESTART_ST_Pos) /*!< DCB DHCSR: Restart sticky status Mask */ - -#define DCB_DHCSR_S_RESET_ST_Pos 25U /*!< DCB DHCSR: Reset sticky status Position */ -#define DCB_DHCSR_S_RESET_ST_Msk (0x1UL << DCB_DHCSR_S_RESET_ST_Pos) /*!< DCB DHCSR: Reset sticky status Mask */ - -#define DCB_DHCSR_S_RETIRE_ST_Pos 24U /*!< DCB DHCSR: Retire sticky status Position */ -#define DCB_DHCSR_S_RETIRE_ST_Msk (0x1UL << DCB_DHCSR_S_RETIRE_ST_Pos) /*!< DCB DHCSR: Retire sticky status Mask */ - -#define DCB_DHCSR_S_SDE_Pos 20U /*!< DCB DHCSR: Secure debug enabled Position */ -#define DCB_DHCSR_S_SDE_Msk (0x1UL << DCB_DHCSR_S_SDE_Pos) /*!< DCB DHCSR: Secure debug enabled Mask */ - -#define DCB_DHCSR_S_LOCKUP_Pos 19U /*!< DCB DHCSR: Lockup status Position */ -#define DCB_DHCSR_S_LOCKUP_Msk (0x1UL << DCB_DHCSR_S_LOCKUP_Pos) /*!< DCB DHCSR: Lockup status Mask */ - -#define DCB_DHCSR_S_SLEEP_Pos 18U /*!< DCB DHCSR: Sleeping status Position */ -#define DCB_DHCSR_S_SLEEP_Msk (0x1UL << DCB_DHCSR_S_SLEEP_Pos) /*!< DCB DHCSR: Sleeping status Mask */ - -#define DCB_DHCSR_S_HALT_Pos 17U /*!< DCB DHCSR: Halted status Position */ -#define DCB_DHCSR_S_HALT_Msk (0x1UL << DCB_DHCSR_S_HALT_Pos) /*!< DCB DHCSR: Halted status Mask */ - -#define DCB_DHCSR_S_REGRDY_Pos 16U /*!< DCB DHCSR: Register ready status Position */ -#define DCB_DHCSR_S_REGRDY_Msk (0x1UL << DCB_DHCSR_S_REGRDY_Pos) /*!< DCB DHCSR: Register ready status Mask */ - -#define DCB_DHCSR_C_SNAPSTALL_Pos 5U /*!< DCB DHCSR: Snap stall control Position */ -#define DCB_DHCSR_C_SNAPSTALL_Msk (0x1UL << DCB_DHCSR_C_SNAPSTALL_Pos) /*!< DCB DHCSR: Snap stall control Mask */ - -#define DCB_DHCSR_C_MASKINTS_Pos 3U /*!< DCB DHCSR: Mask interrupts control Position */ -#define DCB_DHCSR_C_MASKINTS_Msk (0x1UL << DCB_DHCSR_C_MASKINTS_Pos) /*!< DCB DHCSR: Mask interrupts control Mask */ - -#define DCB_DHCSR_C_STEP_Pos 2U /*!< DCB DHCSR: Step control Position */ -#define DCB_DHCSR_C_STEP_Msk (0x1UL << DCB_DHCSR_C_STEP_Pos) /*!< DCB DHCSR: Step control Mask */ - -#define DCB_DHCSR_C_HALT_Pos 1U /*!< DCB DHCSR: Halt control Position */ -#define DCB_DHCSR_C_HALT_Msk (0x1UL << DCB_DHCSR_C_HALT_Pos) /*!< DCB DHCSR: Halt control Mask */ - -#define DCB_DHCSR_C_DEBUGEN_Pos 0U /*!< DCB DHCSR: Debug enable control Position */ -#define DCB_DHCSR_C_DEBUGEN_Msk (0x1UL /*<< DCB_DHCSR_C_DEBUGEN_Pos*/) /*!< DCB DHCSR: Debug enable control Mask */ - -/* DCRSR, Debug Core Register Select Register Definitions */ -#define DCB_DCRSR_REGWnR_Pos 16U /*!< DCB DCRSR: Register write/not-read Position */ -#define DCB_DCRSR_REGWnR_Msk (0x1UL << DCB_DCRSR_REGWnR_Pos) /*!< DCB DCRSR: Register write/not-read Mask */ - -#define DCB_DCRSR_REGSEL_Pos 0U /*!< DCB DCRSR: Register selector Position */ -#define DCB_DCRSR_REGSEL_Msk (0x7FUL /*<< DCB_DCRSR_REGSEL_Pos*/) /*!< DCB DCRSR: Register selector Mask */ - -/* DCRDR, Debug Core Register Data Register Definitions */ -#define DCB_DCRDR_DBGTMP_Pos 0U /*!< DCB DCRDR: Data temporary buffer Position */ -#define DCB_DCRDR_DBGTMP_Msk (0xFFFFFFFFUL /*<< DCB_DCRDR_DBGTMP_Pos*/) /*!< DCB DCRDR: Data temporary buffer Mask */ - -/* DEMCR, Debug Exception and Monitor Control Register Definitions */ -#define DCB_DEMCR_TRCENA_Pos 24U /*!< DCB DEMCR: Trace enable Position */ -#define DCB_DEMCR_TRCENA_Msk (0x1UL << DCB_DEMCR_TRCENA_Pos) /*!< DCB DEMCR: Trace enable Mask */ - -#define DCB_DEMCR_MONPRKEY_Pos 23U /*!< DCB DEMCR: Monitor pend req key Position */ -#define DCB_DEMCR_MONPRKEY_Msk (0x1UL << DCB_DEMCR_MONPRKEY_Pos) /*!< DCB DEMCR: Monitor pend req key Mask */ - -#define DCB_DEMCR_UMON_EN_Pos 21U /*!< DCB DEMCR: Unprivileged monitor enable Position */ -#define DCB_DEMCR_UMON_EN_Msk (0x1UL << DCB_DEMCR_UMON_EN_Pos) /*!< DCB DEMCR: Unprivileged monitor enable Mask */ - -#define DCB_DEMCR_SDME_Pos 20U /*!< DCB DEMCR: Secure DebugMonitor enable Position */ -#define DCB_DEMCR_SDME_Msk (0x1UL << DCB_DEMCR_SDME_Pos) /*!< DCB DEMCR: Secure DebugMonitor enable Mask */ - -#define DCB_DEMCR_MON_REQ_Pos 19U /*!< DCB DEMCR: Monitor request Position */ -#define DCB_DEMCR_MON_REQ_Msk (0x1UL << DCB_DEMCR_MON_REQ_Pos) /*!< DCB DEMCR: Monitor request Mask */ - -#define DCB_DEMCR_MON_STEP_Pos 18U /*!< DCB DEMCR: Monitor step Position */ -#define DCB_DEMCR_MON_STEP_Msk (0x1UL << DCB_DEMCR_MON_STEP_Pos) /*!< DCB DEMCR: Monitor step Mask */ - -#define DCB_DEMCR_MON_PEND_Pos 17U /*!< DCB DEMCR: Monitor pend Position */ -#define DCB_DEMCR_MON_PEND_Msk (0x1UL << DCB_DEMCR_MON_PEND_Pos) /*!< DCB DEMCR: Monitor pend Mask */ - -#define DCB_DEMCR_MON_EN_Pos 16U /*!< DCB DEMCR: Monitor enable Position */ -#define DCB_DEMCR_MON_EN_Msk (0x1UL << DCB_DEMCR_MON_EN_Pos) /*!< DCB DEMCR: Monitor enable Mask */ - -#define DCB_DEMCR_VC_SFERR_Pos 11U /*!< DCB DEMCR: Vector Catch SecureFault Position */ -#define DCB_DEMCR_VC_SFERR_Msk (0x1UL << DCB_DEMCR_VC_SFERR_Pos) /*!< DCB DEMCR: Vector Catch SecureFault Mask */ - -#define DCB_DEMCR_VC_HARDERR_Pos 10U /*!< DCB DEMCR: Vector Catch HardFault errors Position */ -#define DCB_DEMCR_VC_HARDERR_Msk (0x1UL << DCB_DEMCR_VC_HARDERR_Pos) /*!< DCB DEMCR: Vector Catch HardFault errors Mask */ - -#define DCB_DEMCR_VC_INTERR_Pos 9U /*!< DCB DEMCR: Vector Catch interrupt errors Position */ -#define DCB_DEMCR_VC_INTERR_Msk (0x1UL << DCB_DEMCR_VC_INTERR_Pos) /*!< DCB DEMCR: Vector Catch interrupt errors Mask */ - -#define DCB_DEMCR_VC_BUSERR_Pos 8U /*!< DCB DEMCR: Vector Catch BusFault errors Position */ -#define DCB_DEMCR_VC_BUSERR_Msk (0x1UL << DCB_DEMCR_VC_BUSERR_Pos) /*!< DCB DEMCR: Vector Catch BusFault errors Mask */ - -#define DCB_DEMCR_VC_STATERR_Pos 7U /*!< DCB DEMCR: Vector Catch state errors Position */ -#define DCB_DEMCR_VC_STATERR_Msk (0x1UL << DCB_DEMCR_VC_STATERR_Pos) /*!< DCB DEMCR: Vector Catch state errors Mask */ - -#define DCB_DEMCR_VC_CHKERR_Pos 6U /*!< DCB DEMCR: Vector Catch check errors Position */ -#define DCB_DEMCR_VC_CHKERR_Msk (0x1UL << DCB_DEMCR_VC_CHKERR_Pos) /*!< DCB DEMCR: Vector Catch check errors Mask */ - -#define DCB_DEMCR_VC_NOCPERR_Pos 5U /*!< DCB DEMCR: Vector Catch NOCP errors Position */ -#define DCB_DEMCR_VC_NOCPERR_Msk (0x1UL << DCB_DEMCR_VC_NOCPERR_Pos) /*!< DCB DEMCR: Vector Catch NOCP errors Mask */ - -#define DCB_DEMCR_VC_MMERR_Pos 4U /*!< DCB DEMCR: Vector Catch MemManage errors Position */ -#define DCB_DEMCR_VC_MMERR_Msk (0x1UL << DCB_DEMCR_VC_MMERR_Pos) /*!< DCB DEMCR: Vector Catch MemManage errors Mask */ - -#define DCB_DEMCR_VC_CORERESET_Pos 0U /*!< DCB DEMCR: Vector Catch Core reset Position */ -#define DCB_DEMCR_VC_CORERESET_Msk (0x1UL /*<< DCB_DEMCR_VC_CORERESET_Pos*/) /*!< DCB DEMCR: Vector Catch Core reset Mask */ - -/* DAUTHCTRL, Debug Authentication Control Register Definitions */ -#define DCB_DAUTHCTRL_INTSPNIDEN_Pos 3U /*!< DCB DAUTHCTRL: Internal Secure non-invasive debug enable Position */ -#define DCB_DAUTHCTRL_INTSPNIDEN_Msk (0x1UL << DCB_DAUTHCTRL_INTSPNIDEN_Pos) /*!< DCB DAUTHCTRL: Internal Secure non-invasive debug enable Mask */ - -#define DCB_DAUTHCTRL_SPNIDENSEL_Pos 2U /*!< DCB DAUTHCTRL: Secure non-invasive debug enable select Position */ -#define DCB_DAUTHCTRL_SPNIDENSEL_Msk (0x1UL << DCB_DAUTHCTRL_SPNIDENSEL_Pos) /*!< DCB DAUTHCTRL: Secure non-invasive debug enable select Mask */ - -#define DCB_DAUTHCTRL_INTSPIDEN_Pos 1U /*!< DCB DAUTHCTRL: Internal Secure invasive debug enable Position */ -#define DCB_DAUTHCTRL_INTSPIDEN_Msk (0x1UL << DCB_DAUTHCTRL_INTSPIDEN_Pos) /*!< DCB DAUTHCTRL: Internal Secure invasive debug enable Mask */ - -#define DCB_DAUTHCTRL_SPIDENSEL_Pos 0U /*!< DCB DAUTHCTRL: Secure invasive debug enable select Position */ -#define DCB_DAUTHCTRL_SPIDENSEL_Msk (0x1UL /*<< DCB_DAUTHCTRL_SPIDENSEL_Pos*/) /*!< DCB DAUTHCTRL: Secure invasive debug enable select Mask */ - -/* DSCSR, Debug Security Control and Status Register Definitions */ -#define DCB_DSCSR_CDSKEY_Pos 17U /*!< DCB DSCSR: CDS write-enable key Position */ -#define DCB_DSCSR_CDSKEY_Msk (0x1UL << DCB_DSCSR_CDSKEY_Pos) /*!< DCB DSCSR: CDS write-enable key Mask */ - -#define DCB_DSCSR_CDS_Pos 16U /*!< DCB DSCSR: Current domain Secure Position */ -#define DCB_DSCSR_CDS_Msk (0x1UL << DCB_DSCSR_CDS_Pos) /*!< DCB DSCSR: Current domain Secure Mask */ - -#define DCB_DSCSR_SBRSEL_Pos 1U /*!< DCB DSCSR: Secure banked register select Position */ -#define DCB_DSCSR_SBRSEL_Msk (0x1UL << DCB_DSCSR_SBRSEL_Pos) /*!< DCB DSCSR: Secure banked register select Mask */ - -#define DCB_DSCSR_SBRSELEN_Pos 0U /*!< DCB DSCSR: Secure banked register select enable Position */ -#define DCB_DSCSR_SBRSELEN_Msk (0x1UL /*<< DCB_DSCSR_SBRSELEN_Pos*/) /*!< DCB DSCSR: Secure banked register select enable Mask */ - -/*@} end of group CMSIS_DCB */ - - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_DIB Debug Identification Block - \brief Type definitions for the Debug Identification Block Registers - @{ - */ - -/** - \brief Structure type to access the Debug Identification Block Registers (DIB). - */ -typedef struct -{ - __OM uint32_t DLAR; /*!< Offset: 0x000 ( /W) SCS Software Lock Access Register */ - __IM uint32_t DLSR; /*!< Offset: 0x004 (R/ ) SCS Software Lock Status Register */ - __IM uint32_t DAUTHSTATUS; /*!< Offset: 0x008 (R/ ) Debug Authentication Status Register */ - __IM uint32_t DDEVARCH; /*!< Offset: 0x00C (R/ ) SCS Device Architecture Register */ - __IM uint32_t DDEVTYPE; /*!< Offset: 0x010 (R/ ) SCS Device Type Register */ -} DIB_Type; - -/* DLAR, SCS Software Lock Access Register Definitions */ -#define DIB_DLAR_KEY_Pos 0U /*!< DIB DLAR: KEY Position */ -#define DIB_DLAR_KEY_Msk (0xFFFFFFFFUL /*<< DIB_DLAR_KEY_Pos */) /*!< DIB DLAR: KEY Mask */ - -/* DLSR, SCS Software Lock Status Register Definitions */ -#define DIB_DLSR_nTT_Pos 2U /*!< DIB DLSR: Not thirty-two bit Position */ -#define DIB_DLSR_nTT_Msk (0x1UL << DIB_DLSR_nTT_Pos ) /*!< DIB DLSR: Not thirty-two bit Mask */ - -#define DIB_DLSR_SLK_Pos 1U /*!< DIB DLSR: Software Lock status Position */ -#define DIB_DLSR_SLK_Msk (0x1UL << DIB_DLSR_SLK_Pos ) /*!< DIB DLSR: Software Lock status Mask */ - -#define DIB_DLSR_SLI_Pos 0U /*!< DIB DLSR: Software Lock implemented Position */ -#define DIB_DLSR_SLI_Msk (0x1UL /*<< DIB_DLSR_SLI_Pos*/) /*!< DIB DLSR: Software Lock implemented Mask */ - -/* DAUTHSTATUS, Debug Authentication Status Register Definitions */ -#define DIB_DAUTHSTATUS_SNID_Pos 6U /*!< DIB DAUTHSTATUS: Secure Non-invasive Debug Position */ -#define DIB_DAUTHSTATUS_SNID_Msk (0x3UL << DIB_DAUTHSTATUS_SNID_Pos ) /*!< DIB DAUTHSTATUS: Secure Non-invasive Debug Mask */ - -#define DIB_DAUTHSTATUS_SID_Pos 4U /*!< DIB DAUTHSTATUS: Secure Invasive Debug Position */ -#define DIB_DAUTHSTATUS_SID_Msk (0x3UL << DIB_DAUTHSTATUS_SID_Pos ) /*!< DIB DAUTHSTATUS: Secure Invasive Debug Mask */ - -#define DIB_DAUTHSTATUS_NSNID_Pos 2U /*!< DIB DAUTHSTATUS: Non-secure Non-invasive Debug Position */ -#define DIB_DAUTHSTATUS_NSNID_Msk (0x3UL << DIB_DAUTHSTATUS_NSNID_Pos ) /*!< DIB DAUTHSTATUS: Non-secure Non-invasive Debug Mask */ - -#define DIB_DAUTHSTATUS_NSID_Pos 0U /*!< DIB DAUTHSTATUS: Non-secure Invasive Debug Position */ -#define DIB_DAUTHSTATUS_NSID_Msk (0x3UL /*<< DIB_DAUTHSTATUS_NSID_Pos*/) /*!< DIB DAUTHSTATUS: Non-secure Invasive Debug Mask */ - -/* DDEVARCH, SCS Device Architecture Register Definitions */ -#define DIB_DDEVARCH_ARCHITECT_Pos 21U /*!< DIB DDEVARCH: Architect Position */ -#define DIB_DDEVARCH_ARCHITECT_Msk (0x7FFUL << DIB_DDEVARCH_ARCHITECT_Pos ) /*!< DIB DDEVARCH: Architect Mask */ - -#define DIB_DDEVARCH_PRESENT_Pos 20U /*!< DIB DDEVARCH: DEVARCH Present Position */ -#define DIB_DDEVARCH_PRESENT_Msk (0x1FUL << DIB_DDEVARCH_PRESENT_Pos ) /*!< DIB DDEVARCH: DEVARCH Present Mask */ - -#define DIB_DDEVARCH_REVISION_Pos 16U /*!< DIB DDEVARCH: Revision Position */ -#define DIB_DDEVARCH_REVISION_Msk (0xFUL << DIB_DDEVARCH_REVISION_Pos ) /*!< DIB DDEVARCH: Revision Mask */ - -#define DIB_DDEVARCH_ARCHVER_Pos 12U /*!< DIB DDEVARCH: Architecture Version Position */ -#define DIB_DDEVARCH_ARCHVER_Msk (0xFUL << DIB_DDEVARCH_ARCHVER_Pos ) /*!< DIB DDEVARCH: Architecture Version Mask */ - -#define DIB_DDEVARCH_ARCHPART_Pos 0U /*!< DIB DDEVARCH: Architecture Part Position */ -#define DIB_DDEVARCH_ARCHPART_Msk (0xFFFUL /*<< DIB_DDEVARCH_ARCHPART_Pos*/) /*!< DIB DDEVARCH: Architecture Part Mask */ - -/* DDEVTYPE, SCS Device Type Register Definitions */ -#define DIB_DDEVTYPE_SUB_Pos 4U /*!< DIB DDEVTYPE: Sub-type Position */ -#define DIB_DDEVTYPE_SUB_Msk (0xFUL << DIB_DDEVTYPE_SUB_Pos ) /*!< DIB DDEVTYPE: Sub-type Mask */ - -#define DIB_DDEVTYPE_MAJOR_Pos 0U /*!< DIB DDEVTYPE: Major type Position */ -#define DIB_DDEVTYPE_MAJOR_Msk (0xFUL /*<< DIB_DDEVTYPE_MAJOR_Pos*/) /*!< DIB DDEVTYPE: Major type Mask */ - - -/*@} end of group CMSIS_DIB */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_core_bitfield Core register bit field macros - \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). - @{ - */ - -/** - \brief Mask and shift a bit field value for use in a register bit range. - \param[in] field Name of the register bit field. - \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. - \return Masked and shifted value. -*/ -#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) - -/** - \brief Mask and shift a register value to extract a bit filed value. - \param[in] field Name of the register bit field. - \param[in] value Value of register. This parameter is interpreted as an uint32_t type. - \return Masked and shifted bit field value. -*/ -#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) - -/*@} end of group CMSIS_core_bitfield */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_core_base Core Definitions - \brief Definitions for base addresses, unions, and structures. - @{ - */ - -/* Memory mapping of Core Hardware */ - #define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ - #define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */ - #define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ - #define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ - #define CoreDebug_BASE (0xE000EDF0UL) /*!< \deprecated Core Debug Base Address */ - #define DCB_BASE (0xE000EDF0UL) /*!< DCB Base Address */ - #define DIB_BASE (0xE000EFB0UL) /*!< DIB Base Address */ - #define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ - #define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ - #define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ - - #define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ - #define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ - #define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ - #define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ - #define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */ - #define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */ - #define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */ - #define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE ) /*!< \deprecated Core Debug configuration struct */ - #define DCB ((DCB_Type *) DCB_BASE ) /*!< DCB configuration struct */ - #define DIB ((DIB_Type *) DIB_BASE ) /*!< DIB configuration struct */ - - #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) - #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ - #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ - #endif - - #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) - #define SAU_BASE (SCS_BASE + 0x0DD0UL) /*!< Security Attribution Unit */ - #define SAU ((SAU_Type *) SAU_BASE ) /*!< Security Attribution Unit */ - #endif - - #define FPU_BASE (SCS_BASE + 0x0F30UL) /*!< Floating Point Unit */ - #define FPU ((FPU_Type *) FPU_BASE ) /*!< Floating Point Unit */ - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) - #define SCS_BASE_NS (0xE002E000UL) /*!< System Control Space Base Address (non-secure address space) */ - #define CoreDebug_BASE_NS (0xE002EDF0UL) /*!< \deprecated Core Debug Base Address (non-secure address space) */ - #define DCB_BASE_NS (0xE002EDF0UL) /*!< DCB Base Address (non-secure address space) */ - #define DIB_BASE_NS (0xE002EFB0UL) /*!< DIB Base Address (non-secure address space) */ - #define SysTick_BASE_NS (SCS_BASE_NS + 0x0010UL) /*!< SysTick Base Address (non-secure address space) */ - #define NVIC_BASE_NS (SCS_BASE_NS + 0x0100UL) /*!< NVIC Base Address (non-secure address space) */ - #define SCB_BASE_NS (SCS_BASE_NS + 0x0D00UL) /*!< System Control Block Base Address (non-secure address space) */ - - #define SCnSCB_NS ((SCnSCB_Type *) SCS_BASE_NS ) /*!< System control Register not in SCB(non-secure address space) */ - #define SCB_NS ((SCB_Type *) SCB_BASE_NS ) /*!< SCB configuration struct (non-secure address space) */ - #define SysTick_NS ((SysTick_Type *) SysTick_BASE_NS ) /*!< SysTick configuration struct (non-secure address space) */ - #define NVIC_NS ((NVIC_Type *) NVIC_BASE_NS ) /*!< NVIC configuration struct (non-secure address space) */ - #define CoreDebug_NS ((CoreDebug_Type *) CoreDebug_BASE_NS) /*!< \deprecated Core Debug configuration struct (non-secure address space) */ - #define DCB_NS ((DCB_Type *) DCB_BASE_NS ) /*!< DCB configuration struct (non-secure address space) */ - #define DIB_NS ((DIB_Type *) DIB_BASE_NS ) /*!< DIB configuration struct (non-secure address space) */ - - #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) - #define MPU_BASE_NS (SCS_BASE_NS + 0x0D90UL) /*!< Memory Protection Unit (non-secure address space) */ - #define MPU_NS ((MPU_Type *) MPU_BASE_NS ) /*!< Memory Protection Unit (non-secure address space) */ - #endif - - #define FPU_BASE_NS (SCS_BASE_NS + 0x0F30UL) /*!< Floating Point Unit (non-secure address space) */ - #define FPU_NS ((FPU_Type *) FPU_BASE_NS ) /*!< Floating Point Unit (non-secure address space) */ - -#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ -/*@} */ - - - -/******************************************************************************* - * Hardware Abstraction Layer - Core Function Interface contains: - - Core NVIC Functions - - Core SysTick Functions - - Core Debug Functions - - Core Register Access Functions - ******************************************************************************/ -/** - \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference -*/ - - - -/* ########################## NVIC functions #################################### */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_NVICFunctions NVIC Functions - \brief Functions that manage interrupts and exceptions via the NVIC. - @{ - */ - -#ifdef CMSIS_NVIC_VIRTUAL - #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE - #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" - #endif - #include CMSIS_NVIC_VIRTUAL_HEADER_FILE -#else - #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping - #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping - #define NVIC_EnableIRQ __NVIC_EnableIRQ - #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ - #define NVIC_DisableIRQ __NVIC_DisableIRQ - #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ - #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ - #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ - #define NVIC_GetActive __NVIC_GetActive - #define NVIC_SetPriority __NVIC_SetPriority - #define NVIC_GetPriority __NVIC_GetPriority - #define NVIC_SystemReset __NVIC_SystemReset -#endif /* CMSIS_NVIC_VIRTUAL */ - -#ifdef CMSIS_VECTAB_VIRTUAL - #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE - #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" - #endif - #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE -#else - #define NVIC_SetVector __NVIC_SetVector - #define NVIC_GetVector __NVIC_GetVector -#endif /* (CMSIS_VECTAB_VIRTUAL) */ - -#define NVIC_USER_IRQ_OFFSET 16 - - -/* Special LR values for Secure/Non-Secure call handling and exception handling */ - -/* Function Return Payload (from ARMv8-M Architecture Reference Manual) LR value on entry from Secure BLXNS */ -#define FNC_RETURN (0xFEFFFFFFUL) /* bit [0] ignored when processing a branch */ - -/* The following EXC_RETURN mask values are used to evaluate the LR on exception entry */ -#define EXC_RETURN_PREFIX (0xFF000000UL) /* bits [31:24] set to indicate an EXC_RETURN value */ -#define EXC_RETURN_S (0x00000040UL) /* bit [6] stack used to push registers: 0=Non-secure 1=Secure */ -#define EXC_RETURN_DCRS (0x00000020UL) /* bit [5] stacking rules for called registers: 0=skipped 1=saved */ -#define EXC_RETURN_FTYPE (0x00000010UL) /* bit [4] allocate stack for floating-point context: 0=done 1=skipped */ -#define EXC_RETURN_MODE (0x00000008UL) /* bit [3] processor mode for return: 0=Handler mode 1=Thread mode */ -#define EXC_RETURN_SPSEL (0x00000004UL) /* bit [2] stack pointer used to restore context: 0=MSP 1=PSP */ -#define EXC_RETURN_ES (0x00000001UL) /* bit [0] security state exception was taken to: 0=Non-secure 1=Secure */ - -/* Integrity Signature (from ARMv8-M Architecture Reference Manual) for exception context stacking */ -#if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) /* Value for processors with floating-point extension: */ -#define EXC_INTEGRITY_SIGNATURE (0xFEFA125AUL) /* bit [0] SFTC must match LR bit[4] EXC_RETURN_FTYPE */ -#else -#define EXC_INTEGRITY_SIGNATURE (0xFEFA125BUL) /* Value for processors without floating-point extension */ -#endif - - -/** - \brief Set Priority Grouping - \details Sets the priority grouping field using the required unlock sequence. - The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. - Only values from 0..7 are used. - In case of a conflict between priority grouping and available - priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. - \param [in] PriorityGroup Priority grouping field. - */ -__STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup) -{ - uint32_t reg_value; - uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ - - reg_value = SCB->AIRCR; /* read old register configuration */ - reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ - reg_value = (reg_value | - ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | - (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority group */ - SCB->AIRCR = reg_value; -} - - -/** - \brief Get Priority Grouping - \details Reads the priority grouping field from the NVIC Interrupt Controller. - \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). - */ -__STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void) -{ - return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); -} - - -/** - \brief Enable Interrupt - \details Enables a device specific interrupt in the NVIC interrupt controller. - \param [in] IRQn Device specific interrupt number. - \note IRQn must not be negative. - */ -__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - __COMPILER_BARRIER(); - NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); - __COMPILER_BARRIER(); - } -} - - -/** - \brief Get Interrupt Enable status - \details Returns a device specific interrupt enable status from the NVIC interrupt controller. - \param [in] IRQn Device specific interrupt number. - \return 0 Interrupt is not enabled. - \return 1 Interrupt is enabled. - \note IRQn must not be negative. - */ -__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); - } - else - { - return(0U); - } -} - - -/** - \brief Disable Interrupt - \details Disables a device specific interrupt in the NVIC interrupt controller. - \param [in] IRQn Device specific interrupt number. - \note IRQn must not be negative. - */ -__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); - __DSB(); - __ISB(); - } -} - - -/** - \brief Get Pending Interrupt - \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. - \param [in] IRQn Device specific interrupt number. - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - \note IRQn must not be negative. - */ -__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); - } - else - { - return(0U); - } -} - - -/** - \brief Set Pending Interrupt - \details Sets the pending bit of a device specific interrupt in the NVIC pending register. - \param [in] IRQn Device specific interrupt number. - \note IRQn must not be negative. - */ -__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); - } -} - - -/** - \brief Clear Pending Interrupt - \details Clears the pending bit of a device specific interrupt in the NVIC pending register. - \param [in] IRQn Device specific interrupt number. - \note IRQn must not be negative. - */ -__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); - } -} - - -/** - \brief Get Active Interrupt - \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt. - \param [in] IRQn Device specific interrupt number. - \return 0 Interrupt status is not active. - \return 1 Interrupt status is active. - \note IRQn must not be negative. - */ -__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); - } - else - { - return(0U); - } -} - - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) -/** - \brief Get Interrupt Target State - \details Reads the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. - \param [in] IRQn Device specific interrupt number. - \return 0 if interrupt is assigned to Secure - \return 1 if interrupt is assigned to Non Secure - \note IRQn must not be negative. - */ -__STATIC_INLINE uint32_t NVIC_GetTargetState(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); - } - else - { - return(0U); - } -} - - -/** - \brief Set Interrupt Target State - \details Sets the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. - \param [in] IRQn Device specific interrupt number. - \return 0 if interrupt is assigned to Secure - 1 if interrupt is assigned to Non Secure - \note IRQn must not be negative. - */ -__STATIC_INLINE uint32_t NVIC_SetTargetState(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] |= ((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL))); - return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); - } - else - { - return(0U); - } -} - - -/** - \brief Clear Interrupt Target State - \details Clears the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. - \param [in] IRQn Device specific interrupt number. - \return 0 if interrupt is assigned to Secure - 1 if interrupt is assigned to Non Secure - \note IRQn must not be negative. - */ -__STATIC_INLINE uint32_t NVIC_ClearTargetState(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] &= ~((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL))); - return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); - } - else - { - return(0U); - } -} -#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ - - -/** - \brief Set Interrupt Priority - \details Sets the priority of a device specific interrupt or a processor exception. - The interrupt number can be positive to specify a device specific interrupt, - or negative to specify a processor exception. - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - \note The priority cannot be set for every processor exception. - */ -__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if ((int32_t)(IRQn) >= 0) - { - NVIC->IPR[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } -} - - -/** - \brief Get Interrupt Priority - \details Reads the priority of a device specific interrupt or a processor exception. - The interrupt number can be positive to specify a device specific interrupt, - or negative to specify a processor exception. - \param [in] IRQn Interrupt number. - \return Interrupt Priority. - Value is aligned automatically to the implemented priority bits of the microcontroller. - */ -__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) -{ - - if ((int32_t)(IRQn) >= 0) - { - return(((uint32_t)NVIC->IPR[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return(((uint32_t)SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); - } -} - - -/** - \brief Encode Priority - \details Encodes the priority for an interrupt with the given priority group, - preemptive priority value, and subpriority value. - In case of a conflict between priority grouping and available - priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. - \param [in] PriorityGroup Used priority group. - \param [in] PreemptPriority Preemptive priority value (starting from 0). - \param [in] SubPriority Subpriority value (starting from 0). - \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). - */ -__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) -{ - uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ - uint32_t PreemptPriorityBits; - uint32_t SubPriorityBits; - - PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); - SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); - - return ( - ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | - ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) - ); -} - - -/** - \brief Decode Priority - \details Decodes an interrupt priority value with a given priority group to - preemptive priority value and subpriority value. - In case of a conflict between priority grouping and available - priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. - \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). - \param [in] PriorityGroup Used priority group. - \param [out] pPreemptPriority Preemptive priority value (starting from 0). - \param [out] pSubPriority Subpriority value (starting from 0). - */ -__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) -{ - uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ - uint32_t PreemptPriorityBits; - uint32_t SubPriorityBits; - - PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); - SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); - - *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); - *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); -} - - -/** - \brief Set Interrupt Vector - \details Sets an interrupt vector in SRAM based interrupt vector table. - The interrupt number can be positive to specify a device specific interrupt, - or negative to specify a processor exception. - VTOR must been relocated to SRAM before. - \param [in] IRQn Interrupt number - \param [in] vector Address of interrupt handler function - */ -__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) -{ - uint32_t *vectors = (uint32_t *)SCB->VTOR; - vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector; - __DSB(); -} - - -/** - \brief Get Interrupt Vector - \details Reads an interrupt vector from interrupt vector table. - The interrupt number can be positive to specify a device specific interrupt, - or negative to specify a processor exception. - \param [in] IRQn Interrupt number. - \return Address of interrupt handler function - */ -__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) -{ - uint32_t *vectors = (uint32_t *)SCB->VTOR; - return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET]; -} - - -/** - \brief System Reset - \details Initiates a system reset request to reset the MCU. - */ -__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) -{ - __DSB(); /* Ensure all outstanding memory accesses included - buffered write are completed before reset */ - SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | - (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | - SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */ - __DSB(); /* Ensure completion of memory access */ - - for(;;) /* wait until reset */ - { - __NOP(); - } -} - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) -/** - \brief Set Priority Grouping (non-secure) - \details Sets the non-secure priority grouping field when in secure state using the required unlock sequence. - The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. - Only values from 0..7 are used. - In case of a conflict between priority grouping and available - priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. - \param [in] PriorityGroup Priority grouping field. - */ -__STATIC_INLINE void TZ_NVIC_SetPriorityGrouping_NS(uint32_t PriorityGroup) -{ - uint32_t reg_value; - uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ - - reg_value = SCB_NS->AIRCR; /* read old register configuration */ - reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ - reg_value = (reg_value | - ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | - (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority group */ - SCB_NS->AIRCR = reg_value; -} - - -/** - \brief Get Priority Grouping (non-secure) - \details Reads the priority grouping field from the non-secure NVIC when in secure state. - \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). - */ -__STATIC_INLINE uint32_t TZ_NVIC_GetPriorityGrouping_NS(void) -{ - return ((uint32_t)((SCB_NS->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); -} - - -/** - \brief Enable Interrupt (non-secure) - \details Enables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state. - \param [in] IRQn Device specific interrupt number. - \note IRQn must not be negative. - */ -__STATIC_INLINE void TZ_NVIC_EnableIRQ_NS(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); - } -} - - -/** - \brief Get Interrupt Enable status (non-secure) - \details Returns a device specific interrupt enable status from the non-secure NVIC interrupt controller when in secure state. - \param [in] IRQn Device specific interrupt number. - \return 0 Interrupt is not enabled. - \return 1 Interrupt is enabled. - \note IRQn must not be negative. - */ -__STATIC_INLINE uint32_t TZ_NVIC_GetEnableIRQ_NS(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - return((uint32_t)(((NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); - } - else - { - return(0U); - } -} - - -/** - \brief Disable Interrupt (non-secure) - \details Disables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state. - \param [in] IRQn Device specific interrupt number. - \note IRQn must not be negative. - */ -__STATIC_INLINE void TZ_NVIC_DisableIRQ_NS(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - NVIC_NS->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); - } -} - - -/** - \brief Get Pending Interrupt (non-secure) - \details Reads the NVIC pending register in the non-secure NVIC when in secure state and returns the pending bit for the specified device specific interrupt. - \param [in] IRQn Device specific interrupt number. - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - \note IRQn must not be negative. - */ -__STATIC_INLINE uint32_t TZ_NVIC_GetPendingIRQ_NS(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - return((uint32_t)(((NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); - } - else - { - return(0U); - } -} - - -/** - \brief Set Pending Interrupt (non-secure) - \details Sets the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state. - \param [in] IRQn Device specific interrupt number. - \note IRQn must not be negative. - */ -__STATIC_INLINE void TZ_NVIC_SetPendingIRQ_NS(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); - } -} - - -/** - \brief Clear Pending Interrupt (non-secure) - \details Clears the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state. - \param [in] IRQn Device specific interrupt number. - \note IRQn must not be negative. - */ -__STATIC_INLINE void TZ_NVIC_ClearPendingIRQ_NS(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - NVIC_NS->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); - } -} - - -/** - \brief Get Active Interrupt (non-secure) - \details Reads the active register in non-secure NVIC when in secure state and returns the active bit for the device specific interrupt. - \param [in] IRQn Device specific interrupt number. - \return 0 Interrupt status is not active. - \return 1 Interrupt status is active. - \note IRQn must not be negative. - */ -__STATIC_INLINE uint32_t TZ_NVIC_GetActive_NS(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - return((uint32_t)(((NVIC_NS->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); - } - else - { - return(0U); - } -} - - -/** - \brief Set Interrupt Priority (non-secure) - \details Sets the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state. - The interrupt number can be positive to specify a device specific interrupt, - or negative to specify a processor exception. - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - \note The priority cannot be set for every non-secure processor exception. - */ -__STATIC_INLINE void TZ_NVIC_SetPriority_NS(IRQn_Type IRQn, uint32_t priority) -{ - if ((int32_t)(IRQn) >= 0) - { - NVIC_NS->IPR[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - SCB_NS->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } -} - - -/** - \brief Get Interrupt Priority (non-secure) - \details Reads the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state. - The interrupt number can be positive to specify a device specific interrupt, - or negative to specify a processor exception. - \param [in] IRQn Interrupt number. - \return Interrupt Priority. Value is aligned automatically to the implemented priority bits of the microcontroller. - */ -__STATIC_INLINE uint32_t TZ_NVIC_GetPriority_NS(IRQn_Type IRQn) -{ - - if ((int32_t)(IRQn) >= 0) - { - return(((uint32_t)NVIC_NS->IPR[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return(((uint32_t)SCB_NS->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); - } -} -#endif /* defined (__ARM_FEATURE_CMSE) &&(__ARM_FEATURE_CMSE == 3U) */ - -/*@} end of CMSIS_Core_NVICFunctions */ - -/* ########################## MPU functions #################################### */ - -#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) - -#include "mpu_armv8.h" - -#endif - -/* ########################## FPU functions #################################### */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_FpuFunctions FPU Functions - \brief Function that provides FPU type. - @{ - */ - -/** - \brief get FPU type - \details returns the FPU type - \returns - - \b 0: No FPU - - \b 1: Single precision FPU - - \b 2: Double + Single precision FPU - */ -__STATIC_INLINE uint32_t SCB_GetFPUType(void) -{ - uint32_t mvfr0; - - mvfr0 = FPU->MVFR0; - if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x220U) - { - return 2U; /* Double + Single precision FPU */ - } - else if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x020U) - { - return 1U; /* Single precision FPU */ - } - else - { - return 0U; /* No FPU */ - } -} - - -/*@} end of CMSIS_Core_FpuFunctions */ - - - -/* ########################## SAU functions #################################### */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SAUFunctions SAU Functions - \brief Functions that configure the SAU. - @{ - */ - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) - -/** - \brief Enable SAU - \details Enables the Security Attribution Unit (SAU). - */ -__STATIC_INLINE void TZ_SAU_Enable(void) -{ - SAU->CTRL |= (SAU_CTRL_ENABLE_Msk); -} - - - -/** - \brief Disable SAU - \details Disables the Security Attribution Unit (SAU). - */ -__STATIC_INLINE void TZ_SAU_Disable(void) -{ - SAU->CTRL &= ~(SAU_CTRL_ENABLE_Msk); -} - -#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ - -/*@} end of CMSIS_Core_SAUFunctions */ - - - - -/* ################################## Debug Control function ############################################ */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_DCBFunctions Debug Control Functions - \brief Functions that access the Debug Control Block. - @{ - */ - - -/** - \brief Set Debug Authentication Control Register - \details writes to Debug Authentication Control register. - \param [in] value value to be writen. - */ -__STATIC_INLINE void DCB_SetAuthCtrl(uint32_t value) -{ - __DSB(); - __ISB(); - DCB->DAUTHCTRL = value; - __DSB(); - __ISB(); -} - - -/** - \brief Get Debug Authentication Control Register - \details Reads Debug Authentication Control register. - \return Debug Authentication Control Register. - */ -__STATIC_INLINE uint32_t DCB_GetAuthCtrl(void) -{ - return (DCB->DAUTHCTRL); -} - - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) -/** - \brief Set Debug Authentication Control Register (non-secure) - \details writes to non-secure Debug Authentication Control register when in secure state. - \param [in] value value to be writen - */ -__STATIC_INLINE void TZ_DCB_SetAuthCtrl_NS(uint32_t value) -{ - __DSB(); - __ISB(); - DCB_NS->DAUTHCTRL = value; - __DSB(); - __ISB(); -} - - -/** - \brief Get Debug Authentication Control Register (non-secure) - \details Reads non-secure Debug Authentication Control register when in secure state. - \return Debug Authentication Control Register. - */ -__STATIC_INLINE uint32_t TZ_DCB_GetAuthCtrl_NS(void) -{ - return (DCB_NS->DAUTHCTRL); -} -#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ - -/*@} end of CMSIS_Core_DCBFunctions */ - - - - -/* ################################## Debug Identification function ############################################ */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_DIBFunctions Debug Identification Functions - \brief Functions that access the Debug Identification Block. - @{ - */ - - -/** - \brief Get Debug Authentication Status Register - \details Reads Debug Authentication Status register. - \return Debug Authentication Status Register. - */ -__STATIC_INLINE uint32_t DIB_GetAuthStatus(void) -{ - return (DIB->DAUTHSTATUS); -} - - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) -/** - \brief Get Debug Authentication Status Register (non-secure) - \details Reads non-secure Debug Authentication Status register when in secure state. - \return Debug Authentication Status Register. - */ -__STATIC_INLINE uint32_t TZ_DIB_GetAuthStatus_NS(void) -{ - return (DIB_NS->DAUTHSTATUS); -} -#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ - -/*@} end of CMSIS_Core_DCBFunctions */ - - - - -/* ################################## SysTick function ############################################ */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SysTickFunctions SysTick Functions - \brief Functions that configure the System. - @{ - */ - -#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) - -/** - \brief System Tick Configuration - \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. - Counter is in free running mode to generate periodic interrupts. - \param [in] ticks Number of ticks between two interrupts. - \return 0 Function succeeded. - \return 1 Function failed. - \note When the variable __Vendor_SysTickConfig is set to 1, then the - function SysTick_Config is not included. In this case, the file device.h - must contain a vendor-specific implementation of this function. - */ -__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) -{ - if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) - { - return (1UL); /* Reload value impossible */ - } - - SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ - NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ - SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ - SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | - SysTick_CTRL_TICKINT_Msk | - SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ - return (0UL); /* Function successful */ -} - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) -/** - \brief System Tick Configuration (non-secure) - \details Initializes the non-secure System Timer and its interrupt when in secure state, and starts the System Tick Timer. - Counter is in free running mode to generate periodic interrupts. - \param [in] ticks Number of ticks between two interrupts. - \return 0 Function succeeded. - \return 1 Function failed. - \note When the variable __Vendor_SysTickConfig is set to 1, then the - function TZ_SysTick_Config_NS is not included. In this case, the file device.h - must contain a vendor-specific implementation of this function. - - */ -__STATIC_INLINE uint32_t TZ_SysTick_Config_NS(uint32_t ticks) -{ - if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) - { - return (1UL); /* Reload value impossible */ - } - - SysTick_NS->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ - TZ_NVIC_SetPriority_NS (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ - SysTick_NS->VAL = 0UL; /* Load the SysTick Counter Value */ - SysTick_NS->CTRL = SysTick_CTRL_CLKSOURCE_Msk | - SysTick_CTRL_TICKINT_Msk | - SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ - return (0UL); /* Function successful */ -} -#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ - -#endif - -/*@} end of CMSIS_Core_SysTickFunctions */ - - - -/* ##################################### Debug In/Output function ########################################### */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_core_DebugFunctions ITM Functions - \brief Functions that access the ITM debug interface. - @{ - */ - -extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */ -#define ITM_RXBUFFER_EMPTY ((int32_t)0x5AA55AA5U) /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */ - - -/** - \brief ITM Send Character - \details Transmits a character via the ITM channel 0, and - \li Just returns when no debugger is connected that has booked the output. - \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted. - \param [in] ch Character to transmit. - \returns Character to transmit. - */ -__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch) -{ - if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */ - ((ITM->TER & 1UL ) != 0UL) ) /* ITM Port #0 enabled */ - { - while (ITM->PORT[0U].u32 == 0UL) - { - __NOP(); - } - ITM->PORT[0U].u8 = (uint8_t)ch; - } - return (ch); -} - - -/** - \brief ITM Receive Character - \details Inputs a character via the external variable \ref ITM_RxBuffer. - \return Received character. - \return -1 No character pending. - */ -__STATIC_INLINE int32_t ITM_ReceiveChar (void) -{ - int32_t ch = -1; /* no character available */ - - if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) - { - ch = ITM_RxBuffer; - ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */ - } - - return (ch); -} - - -/** - \brief ITM Check Character - \details Checks whether a character is pending for reading in the variable \ref ITM_RxBuffer. - \return 0 No character available. - \return 1 Character available. - */ -__STATIC_INLINE int32_t ITM_CheckChar (void) -{ - - if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) - { - return (0); /* no character available */ - } - else - { - return (1); /* character available */ - } -} - -/*@} end of CMSIS_core_DebugFunctions */ - - - - -#ifdef __cplusplus -} -#endif - -#endif /* __CORE_CM33_H_DEPENDANT */ - -#endif /* __CMSIS_GENERIC */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/CMSIS/Core/Include/mpu_armv8.h b/bsp/nxp/mcx/mcxa/Libraries/CMSIS/Core/Include/mpu_armv8.h deleted file mode 100644 index 19855b9667c..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/CMSIS/Core/Include/mpu_armv8.h +++ /dev/null @@ -1,352 +0,0 @@ -/****************************************************************************** - * @file mpu_armv8.h - * @brief CMSIS MPU API for Armv8-M and Armv8.1-M MPU - * @version V5.1.3 - * @date 03. February 2021 - ******************************************************************************/ -/* - * Copyright (c) 2017-2021 Arm Limited. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined (__clang__) - #pragma clang system_header /* treat file as system include file */ -#endif - -#ifndef ARM_MPU_ARMV8_H -#define ARM_MPU_ARMV8_H - -/** \brief Attribute for device memory (outer only) */ -#define ARM_MPU_ATTR_DEVICE ( 0U ) - -/** \brief Attribute for non-cacheable, normal memory */ -#define ARM_MPU_ATTR_NON_CACHEABLE ( 4U ) - -/** \brief Attribute for normal memory (outer and inner) -* \param NT Non-Transient: Set to 1 for non-transient data. -* \param WB Write-Back: Set to 1 to use write-back update policy. -* \param RA Read Allocation: Set to 1 to use cache allocation on read miss. -* \param WA Write Allocation: Set to 1 to use cache allocation on write miss. -*/ -#define ARM_MPU_ATTR_MEMORY_(NT, WB, RA, WA) \ - ((((NT) & 1U) << 3U) | (((WB) & 1U) << 2U) | (((RA) & 1U) << 1U) | ((WA) & 1U)) - -/** \brief Device memory type non Gathering, non Re-ordering, non Early Write Acknowledgement */ -#define ARM_MPU_ATTR_DEVICE_nGnRnE (0U) - -/** \brief Device memory type non Gathering, non Re-ordering, Early Write Acknowledgement */ -#define ARM_MPU_ATTR_DEVICE_nGnRE (1U) - -/** \brief Device memory type non Gathering, Re-ordering, Early Write Acknowledgement */ -#define ARM_MPU_ATTR_DEVICE_nGRE (2U) - -/** \brief Device memory type Gathering, Re-ordering, Early Write Acknowledgement */ -#define ARM_MPU_ATTR_DEVICE_GRE (3U) - -/** \brief Memory Attribute -* \param O Outer memory attributes -* \param I O == ARM_MPU_ATTR_DEVICE: Device memory attributes, else: Inner memory attributes -*/ -#define ARM_MPU_ATTR(O, I) ((((O) & 0xFU) << 4U) | ((((O) & 0xFU) != 0U) ? ((I) & 0xFU) : (((I) & 0x3U) << 2U))) - -/** \brief Normal memory non-shareable */ -#define ARM_MPU_SH_NON (0U) - -/** \brief Normal memory outer shareable */ -#define ARM_MPU_SH_OUTER (2U) - -/** \brief Normal memory inner shareable */ -#define ARM_MPU_SH_INNER (3U) - -/** \brief Memory access permissions -* \param RO Read-Only: Set to 1 for read-only memory. -* \param NP Non-Privileged: Set to 1 for non-privileged memory. -*/ -#define ARM_MPU_AP_(RO, NP) ((((RO) & 1U) << 1U) | ((NP) & 1U)) - -/** \brief Region Base Address Register value -* \param BASE The base address bits [31:5] of a memory region. The value is zero extended. Effective address gets 32 byte aligned. -* \param SH Defines the Shareability domain for this memory region. -* \param RO Read-Only: Set to 1 for a read-only memory region. -* \param NP Non-Privileged: Set to 1 for a non-privileged memory region. -* \oaram XN eXecute Never: Set to 1 for a non-executable memory region. -*/ -#define ARM_MPU_RBAR(BASE, SH, RO, NP, XN) \ - (((BASE) & MPU_RBAR_BASE_Msk) | \ - (((SH) << MPU_RBAR_SH_Pos) & MPU_RBAR_SH_Msk) | \ - ((ARM_MPU_AP_(RO, NP) << MPU_RBAR_AP_Pos) & MPU_RBAR_AP_Msk) | \ - (((XN) << MPU_RBAR_XN_Pos) & MPU_RBAR_XN_Msk)) - -/** \brief Region Limit Address Register value -* \param LIMIT The limit address bits [31:5] for this memory region. The value is one extended. -* \param IDX The attribute index to be associated with this memory region. -*/ -#define ARM_MPU_RLAR(LIMIT, IDX) \ - (((LIMIT) & MPU_RLAR_LIMIT_Msk) | \ - (((IDX) << MPU_RLAR_AttrIndx_Pos) & MPU_RLAR_AttrIndx_Msk) | \ - (MPU_RLAR_EN_Msk)) - -#if defined(MPU_RLAR_PXN_Pos) - -/** \brief Region Limit Address Register with PXN value -* \param LIMIT The limit address bits [31:5] for this memory region. The value is one extended. -* \param PXN Privileged execute never. Defines whether code can be executed from this privileged region. -* \param IDX The attribute index to be associated with this memory region. -*/ -#define ARM_MPU_RLAR_PXN(LIMIT, PXN, IDX) \ - (((LIMIT) & MPU_RLAR_LIMIT_Msk) | \ - (((PXN) << MPU_RLAR_PXN_Pos) & MPU_RLAR_PXN_Msk) | \ - (((IDX) << MPU_RLAR_AttrIndx_Pos) & MPU_RLAR_AttrIndx_Msk) | \ - (MPU_RLAR_EN_Msk)) - -#endif - -/** -* Struct for a single MPU Region -*/ -typedef struct { - uint32_t RBAR; /*!< Region Base Address Register value */ - uint32_t RLAR; /*!< Region Limit Address Register value */ -} ARM_MPU_Region_t; - -/** Enable the MPU. -* \param MPU_Control Default access permissions for unconfigured regions. -*/ -__STATIC_INLINE void ARM_MPU_Enable(uint32_t MPU_Control) -{ - __DMB(); - MPU->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk; -#ifdef SCB_SHCSR_MEMFAULTENA_Msk - SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk; -#endif - __DSB(); - __ISB(); -} - -/** Disable the MPU. -*/ -__STATIC_INLINE void ARM_MPU_Disable(void) -{ - __DMB(); -#ifdef SCB_SHCSR_MEMFAULTENA_Msk - SCB->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk; -#endif - MPU->CTRL &= ~MPU_CTRL_ENABLE_Msk; - __DSB(); - __ISB(); -} - -#ifdef MPU_NS -/** Enable the Non-secure MPU. -* \param MPU_Control Default access permissions for unconfigured regions. -*/ -__STATIC_INLINE void ARM_MPU_Enable_NS(uint32_t MPU_Control) -{ - __DMB(); - MPU_NS->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk; -#ifdef SCB_SHCSR_MEMFAULTENA_Msk - SCB_NS->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk; -#endif - __DSB(); - __ISB(); -} - -/** Disable the Non-secure MPU. -*/ -__STATIC_INLINE void ARM_MPU_Disable_NS(void) -{ - __DMB(); -#ifdef SCB_SHCSR_MEMFAULTENA_Msk - SCB_NS->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk; -#endif - MPU_NS->CTRL &= ~MPU_CTRL_ENABLE_Msk; - __DSB(); - __ISB(); -} -#endif - -/** Set the memory attribute encoding to the given MPU. -* \param mpu Pointer to the MPU to be configured. -* \param idx The attribute index to be set [0-7] -* \param attr The attribute value to be set. -*/ -__STATIC_INLINE void ARM_MPU_SetMemAttrEx(MPU_Type* mpu, uint8_t idx, uint8_t attr) -{ - const uint8_t reg = idx / 4U; - const uint32_t pos = ((idx % 4U) * 8U); - const uint32_t mask = 0xFFU << pos; - - if (reg >= (sizeof(mpu->MAIR) / sizeof(mpu->MAIR[0]))) { - return; // invalid index - } - - mpu->MAIR[reg] = ((mpu->MAIR[reg] & ~mask) | ((attr << pos) & mask)); -} - -/** Set the memory attribute encoding. -* \param idx The attribute index to be set [0-7] -* \param attr The attribute value to be set. -*/ -__STATIC_INLINE void ARM_MPU_SetMemAttr(uint8_t idx, uint8_t attr) -{ - ARM_MPU_SetMemAttrEx(MPU, idx, attr); -} - -#ifdef MPU_NS -/** Set the memory attribute encoding to the Non-secure MPU. -* \param idx The attribute index to be set [0-7] -* \param attr The attribute value to be set. -*/ -__STATIC_INLINE void ARM_MPU_SetMemAttr_NS(uint8_t idx, uint8_t attr) -{ - ARM_MPU_SetMemAttrEx(MPU_NS, idx, attr); -} -#endif - -/** Clear and disable the given MPU region of the given MPU. -* \param mpu Pointer to MPU to be used. -* \param rnr Region number to be cleared. -*/ -__STATIC_INLINE void ARM_MPU_ClrRegionEx(MPU_Type* mpu, uint32_t rnr) -{ - mpu->RNR = rnr; - mpu->RLAR = 0U; -} - -/** Clear and disable the given MPU region. -* \param rnr Region number to be cleared. -*/ -__STATIC_INLINE void ARM_MPU_ClrRegion(uint32_t rnr) -{ - ARM_MPU_ClrRegionEx(MPU, rnr); -} - -#ifdef MPU_NS -/** Clear and disable the given Non-secure MPU region. -* \param rnr Region number to be cleared. -*/ -__STATIC_INLINE void ARM_MPU_ClrRegion_NS(uint32_t rnr) -{ - ARM_MPU_ClrRegionEx(MPU_NS, rnr); -} -#endif - -/** Configure the given MPU region of the given MPU. -* \param mpu Pointer to MPU to be used. -* \param rnr Region number to be configured. -* \param rbar Value for RBAR register. -* \param rlar Value for RLAR register. -*/ -__STATIC_INLINE void ARM_MPU_SetRegionEx(MPU_Type* mpu, uint32_t rnr, uint32_t rbar, uint32_t rlar) -{ - mpu->RNR = rnr; - mpu->RBAR = rbar; - mpu->RLAR = rlar; -} - -/** Configure the given MPU region. -* \param rnr Region number to be configured. -* \param rbar Value for RBAR register. -* \param rlar Value for RLAR register. -*/ -__STATIC_INLINE void ARM_MPU_SetRegion(uint32_t rnr, uint32_t rbar, uint32_t rlar) -{ - ARM_MPU_SetRegionEx(MPU, rnr, rbar, rlar); -} - -#ifdef MPU_NS -/** Configure the given Non-secure MPU region. -* \param rnr Region number to be configured. -* \param rbar Value for RBAR register. -* \param rlar Value for RLAR register. -*/ -__STATIC_INLINE void ARM_MPU_SetRegion_NS(uint32_t rnr, uint32_t rbar, uint32_t rlar) -{ - ARM_MPU_SetRegionEx(MPU_NS, rnr, rbar, rlar); -} -#endif - -/** Memcpy with strictly ordered memory access, e.g. used by code in ARM_MPU_LoadEx() -* \param dst Destination data is copied to. -* \param src Source data is copied from. -* \param len Amount of data words to be copied. -*/ -__STATIC_INLINE void ARM_MPU_OrderedMemcpy(volatile uint32_t* dst, const uint32_t* __RESTRICT src, uint32_t len) -{ - uint32_t i; - for (i = 0U; i < len; ++i) - { - dst[i] = src[i]; - } -} - -/** Load the given number of MPU regions from a table to the given MPU. -* \param mpu Pointer to the MPU registers to be used. -* \param rnr First region number to be configured. -* \param table Pointer to the MPU configuration table. -* \param cnt Amount of regions to be configured. -*/ -__STATIC_INLINE void ARM_MPU_LoadEx(MPU_Type* mpu, uint32_t rnr, ARM_MPU_Region_t const* table, uint32_t cnt) -{ - const uint32_t rowWordSize = sizeof(ARM_MPU_Region_t)/4U; - if (cnt == 1U) { - mpu->RNR = rnr; - ARM_MPU_OrderedMemcpy(&(mpu->RBAR), &(table->RBAR), rowWordSize); - } else { - uint32_t rnrBase = rnr & ~(MPU_TYPE_RALIASES-1U); - uint32_t rnrOffset = rnr % MPU_TYPE_RALIASES; - - mpu->RNR = rnrBase; - while ((rnrOffset + cnt) > MPU_TYPE_RALIASES) { - uint32_t c = MPU_TYPE_RALIASES - rnrOffset; - ARM_MPU_OrderedMemcpy(&(mpu->RBAR)+(rnrOffset*2U), &(table->RBAR), c*rowWordSize); - table += c; - cnt -= c; - rnrOffset = 0U; - rnrBase += MPU_TYPE_RALIASES; - mpu->RNR = rnrBase; - } - - ARM_MPU_OrderedMemcpy(&(mpu->RBAR)+(rnrOffset*2U), &(table->RBAR), cnt*rowWordSize); - } -} - -/** Load the given number of MPU regions from a table. -* \param rnr First region number to be configured. -* \param table Pointer to the MPU configuration table. -* \param cnt Amount of regions to be configured. -*/ -__STATIC_INLINE void ARM_MPU_Load(uint32_t rnr, ARM_MPU_Region_t const* table, uint32_t cnt) -{ - ARM_MPU_LoadEx(MPU, rnr, table, cnt); -} - -#ifdef MPU_NS -/** Load the given number of MPU regions from a table to the Non-secure MPU. -* \param rnr First region number to be configured. -* \param table Pointer to the MPU configuration table. -* \param cnt Amount of regions to be configured. -*/ -__STATIC_INLINE void ARM_MPU_Load_NS(uint32_t rnr, ARM_MPU_Region_t const* table, uint32_t cnt) -{ - ARM_MPU_LoadEx(MPU_NS, rnr, table, cnt); -} -#endif - -#endif - diff --git a/bsp/nxp/mcx/mcxa/Libraries/CMSIS/Core/Include/tz_context.h b/bsp/nxp/mcx/mcxa/Libraries/CMSIS/Core/Include/tz_context.h deleted file mode 100644 index facc2c9a47e..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/CMSIS/Core/Include/tz_context.h +++ /dev/null @@ -1,70 +0,0 @@ -/****************************************************************************** - * @file tz_context.h - * @brief Context Management for Armv8-M TrustZone - * @version V1.0.1 - * @date 10. January 2018 - ******************************************************************************/ -/* - * Copyright (c) 2017-2018 Arm Limited. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined (__clang__) - #pragma clang system_header /* treat file as system include file */ -#endif - -#ifndef TZ_CONTEXT_H -#define TZ_CONTEXT_H - -#include - -#ifndef TZ_MODULEID_T -#define TZ_MODULEID_T -/// \details Data type that identifies secure software modules called by a process. -typedef uint32_t TZ_ModuleId_t; -#endif - -/// \details TZ Memory ID identifies an allocated memory slot. -typedef uint32_t TZ_MemoryId_t; - -/// Initialize secure context memory system -/// \return execution status (1: success, 0: error) -uint32_t TZ_InitContextSystem_S (void); - -/// Allocate context memory for calling secure software modules in TrustZone -/// \param[in] module identifies software modules called from non-secure mode -/// \return value != 0 id TrustZone memory slot identifier -/// \return value 0 no memory available or internal error -TZ_MemoryId_t TZ_AllocModuleContext_S (TZ_ModuleId_t module); - -/// Free context memory that was previously allocated with \ref TZ_AllocModuleContext_S -/// \param[in] id TrustZone memory slot identifier -/// \return execution status (1: success, 0: error) -uint32_t TZ_FreeModuleContext_S (TZ_MemoryId_t id); - -/// Load secure context (called on RTOS thread context switch) -/// \param[in] id TrustZone memory slot identifier -/// \return execution status (1: success, 0: error) -uint32_t TZ_LoadContext_S (TZ_MemoryId_t id); - -/// Store secure context (called on RTOS thread context switch) -/// \param[in] id TrustZone memory slot identifier -/// \return execution status (1: success, 0: error) -uint32_t TZ_StoreContext_S (TZ_MemoryId_t id); - -#endif // TZ_CONTEXT_H diff --git a/bsp/nxp/mcx/mcxa/Libraries/CMSIS/LICENSE.txt b/bsp/nxp/mcx/mcxa/Libraries/CMSIS/LICENSE.txt deleted file mode 100644 index 8dada3edaf5..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/CMSIS/LICENSE.txt +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - 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. diff --git a/bsp/nxp/mcx/mcxa/Libraries/Kconfig b/bsp/nxp/mcx/mcxa/Libraries/Kconfig index 77ee549201b..a395cc4f395 100644 --- a/bsp/nxp/mcx/mcxa/Libraries/Kconfig +++ b/bsp/nxp/mcx/mcxa/Libraries/Kconfig @@ -2,3 +2,5 @@ config SOC_MCX bool select ARCH_ARM_CORTEX_M33 select ARCH_ARM_CORTEX_FPU + select PKG_USING_NXP_MCX_CMSIS_DRIVER + select PKG_USING_NXP_MCX_SERIES_DRIVER \ No newline at end of file diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/MCXA153.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/MCXA153.h deleted file mode 100644 index 6f234e41c01..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/MCXA153.h +++ /dev/null @@ -1,31721 +0,0 @@ -/* -** ################################################################### -** Processors: MCXA153VFM -** MCXA153VFT -** MCXA153VLF -** MCXA153VLH -** -** Compilers: GNU C Compiler -** IAR ANSI C/C++ Compiler for ARM -** Keil ARM C/C++ Compiler -** MCUXpresso Compiler -** -** Reference manual: MCXA1 User manual -** Version: rev. 1.0, 2022-03-29 -** Build: b240403 -** -** Abstract: -** CMSIS Peripheral Access Layer for MCXA153 -** -** Copyright 1997-2016 Freescale Semiconductor, Inc. -** Copyright 2016-2024 NXP -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** Revisions: -** - rev. 1.0 (2022-03-29) -** Initial version based on v0.1UM -** -** ################################################################### -*/ - -/*! - * @file MCXA153.h - * @version 1.0 - * @date 2022-03-29 - * @brief CMSIS Peripheral Access Layer for MCXA153 - * - * CMSIS Peripheral Access Layer for MCXA153 - */ - -#if !defined(MCXA153_H_) -#define MCXA153_H_ /**< Symbol preventing repeated inclusion */ - -/** Memory map major version (memory maps with equal major version number are - * compatible) */ -#define MCU_MEM_MAP_VERSION 0x0100U -/** Memory map minor version */ -#define MCU_MEM_MAP_VERSION_MINOR 0x0000U - - -/* ---------------------------------------------------------------------------- - -- Interrupt vector numbers - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup Interrupt_vector_numbers Interrupt vector numbers - * @{ - */ - -/** Interrupt Number Definitions */ -#define NUMBER_OF_INT_VECTORS 96 /**< Number of interrupts in the Vector table */ - -typedef enum IRQn { - /* Auxiliary constants */ - NotAvail_IRQn = -128, /**< Not available device specific interrupt */ - - /* Core interrupts */ - NonMaskableInt_IRQn = -14, /**< Non Maskable Interrupt */ - HardFault_IRQn = -13, /**< Cortex-M33 SV Hard Fault Interrupt */ - MemoryManagement_IRQn = -12, /**< Cortex-M33 Memory Management Interrupt */ - BusFault_IRQn = -11, /**< Cortex-M33 Bus Fault Interrupt */ - UsageFault_IRQn = -10, /**< Cortex-M33 Usage Fault Interrupt */ - SecureFault_IRQn = -9, /**< Cortex-M33 Secure Fault Interrupt */ - SVCall_IRQn = -5, /**< Cortex-M33 SV Call Interrupt */ - DebugMonitor_IRQn = -4, /**< Cortex-M33 Debug Monitor Interrupt */ - PendSV_IRQn = -2, /**< Cortex-M33 Pend SV Interrupt */ - SysTick_IRQn = -1, /**< Cortex-M33 System Tick Interrupt */ - - /* Device specific interrupts */ - Reserved16_IRQn = 0, /**< OR IRQ1 to IRQ53 */ - CMC_IRQn = 1, /**< Core Mode Controller interrupt */ - DMA_CH0_IRQn = 2, /**< DMA3_0_CH0 error or transfer complete */ - DMA_CH1_IRQn = 3, /**< DMA3_0_CH1 error or transfer complete */ - DMA_CH2_IRQn = 4, /**< DMA3_0_CH2 error or transfer complete */ - DMA_CH3_IRQn = 5, /**< DMA3_0_CH3 error or transfer complete */ - Reserved22_IRQn = 6, /**< Reserved interrupt */ - Reserved23_IRQn = 7, /**< Reserved interrupt */ - Reserved24_IRQn = 8, /**< Reserved interrupt */ - Reserved25_IRQn = 9, /**< Reserved interrupt */ - ERM0_SINGLE_BIT_IRQn = 10, /**< ERM Single Bit error interrupt */ - ERM0_MULTI_BIT_IRQn = 11, /**< ERM Multi Bit error interrupt */ - FMU0_IRQn = 12, /**< Flash Management Unit interrupt */ - GLIKEY0_IRQn = 13, /**< GLIKEY Interrupt */ - MBC0_IRQn = 14, /**< MBC secure violation interrupt */ - SCG0_IRQn = 15, /**< System Clock Generator interrupt */ - SPC0_IRQn = 16, /**< System Power Controller interrupt */ - Reserved33_IRQn = 17, /**< Reserved interrupt */ - WUU0_IRQn = 18, /**< Wake Up Unit interrupt */ - Reserved35_IRQn = 19, /**< Reserved interrupt */ - Reserved36_IRQn = 20, /**< Reserved interrupt */ - Reserved37_IRQn = 21, /**< Reserved interrupt */ - Reserved38_IRQn = 22, /**< Reserved interrupt */ - Reserved39_IRQn = 23, /**< Reserved interrupt */ - I3C0_IRQn = 24, /**< Improved Inter Integrated Circuit interrupt 0 */ - Reserved41_IRQn = 25, /**< Reserved interrupt */ - LPI2C0_IRQn = 26, /**< Low-Power Inter Integrated Circuit interrupt */ - Reserved43_IRQn = 27, /**< Reserved interrupt */ - LPSPI0_IRQn = 28, /**< Low-Power Serial Peripheral Interface interrupt */ - LPSPI1_IRQn = 29, /**< Low-Power Serial Peripheral Interface interrupt */ - Reserved46_IRQn = 30, /**< Reserved interrupt */ - LPUART0_IRQn = 31, /**< Low-Power Universal Asynchronous Receive/Transmit interrupt */ - LPUART1_IRQn = 32, /**< Low-Power Universal Asynchronous Receive/Transmit interrupt */ - LPUART2_IRQn = 33, /**< Low-Power Universal Asynchronous Receive/Transmit interrupt */ - Reserved50_IRQn = 34, /**< Reserved interrupt */ - Reserved51_IRQn = 35, /**< Reserved interrupt */ - USB0_IRQn = 36, /**< Universal Serial Bus - Full Speed interrupt */ - Reserved53_IRQn = 37, /**< Reserved interrupt */ - CDOG0_IRQn = 38, /**< Code Watchdog Timer 0 interrupt */ - CTIMER0_IRQn = 39, /**< Standard counter/timer 0 interrupt */ - CTIMER1_IRQn = 40, /**< Standard counter/timer 1 interrupt */ - CTIMER2_IRQn = 41, /**< Standard counter/timer 2 interrupt */ - Reserved58_IRQn = 42, /**< Reserved interrupt */ - Reserved59_IRQn = 43, /**< Reserved interrupt */ - FLEXPWM0_RELOAD_ERROR_IRQn = 44, /**< FlexPWM0_reload_error interrupt */ - FLEXPWM0_FAULT_IRQn = 45, /**< FlexPWM0_fault interrupt */ - FLEXPWM0_SUBMODULE0_IRQn = 46, /**< FlexPWM0 Submodule 0 capture/compare/reload interrupt */ - FLEXPWM0_SUBMODULE1_IRQn = 47, /**< FlexPWM0 Submodule 1 capture/compare/reload interrupt */ - FLEXPWM0_SUBMODULE2_IRQn = 48, /**< FlexPWM0 Submodule 2 capture/compare/reload interrupt */ - Reserved65_IRQn = 49, /**< Reserved interrupt */ - QDC0_COMPARE_IRQn = 50, /**< Compare */ - QDC0_HOME_IRQn = 51, /**< Home */ - QDC0_WATCHDOG_IRQn = 52, /**< Watchdog / Simultaneous A and B Change */ - QDC0_INDEX_IRQn = 53, /**< Index / Roll Over / Roll Under */ - FREQME0_IRQn = 54, /**< Frequency Measurement interrupt */ - LPTMR0_IRQn = 55, /**< Low Power Timer 0 interrupt */ - Reserved72_IRQn = 56, /**< Reserved interrupt */ - OS_EVENT_IRQn = 57, /**< OS event timer interrupt */ - WAKETIMER0_IRQn = 58, /**< Wake Timer Interrupt */ - UTICK0_IRQn = 59, /**< Micro-Tick Timer interrupt */ - WWDT0_IRQn = 60, /**< Windowed Watchdog Timer 0 interrupt */ - Reserved77_IRQn = 61, /**< Reserved interrupt */ - ADC0_IRQn = 62, /**< Analog-to-Digital Converter interrupt */ - Reserved79_IRQn = 63, /**< Reserved interrupt */ - CMP0_IRQn = 64, /**< Comparator interrupt */ - CMP1_IRQn = 65, /**< Comparator interrupt */ - Reserved82_IRQn = 66, /**< Reserved interrupt */ - Reserved83_IRQn = 67, /**< Reserved interrupt */ - Reserved84_IRQn = 68, /**< Reserved interrupt */ - Reserved85_IRQn = 69, /**< Reserved interrupt */ - Reserved86_IRQn = 70, /**< Reserved interrupt */ - GPIO0_IRQn = 71, /**< General Purpose Input/Output interrupt 0 */ - GPIO1_IRQn = 72, /**< General Purpose Input/Output interrupt 1 */ - GPIO2_IRQn = 73, /**< General Purpose Input/Output interrupt 2 */ - GPIO3_IRQn = 74, /**< General Purpose Input/Output interrupt 3 */ - Reserved91_IRQn = 75, /**< Reserved interrupt */ - Reserved92_IRQn = 76, /**< Reserved interrupt */ - Reserved93_IRQn = 77, /**< Reserved interrupt */ - Reserved94_IRQn = 78, /**< Reserved interrupt */ - Reserved95_IRQn = 79 /**< Reserved interrupt */ -} IRQn_Type; - -/*! - * @} - */ /* end of group Interrupt_vector_numbers */ - - -/* ---------------------------------------------------------------------------- - -- Cortex M33 Core Configuration - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup Cortex_Core_Configuration Cortex M33 Core Configuration - * @{ - */ - -#define __MPU_PRESENT 0 /**< Defines if an MPU is present or not */ -#define __NVIC_PRIO_BITS 3 /**< Number of priority bits implemented in the NVIC */ -#define __Vendor_SysTickConfig 0 /**< Vendor specific implementation of SysTickConfig is defined */ -#define __FPU_PRESENT 0 /**< Defines if an FPU is present or not */ -#define __DSP_PRESENT 0 /**< Defines if Armv8-M Mainline core supports DSP instructions */ -#define __SAUREGION_PRESENT 0 /**< Defines if an SAU is present or not */ - -#include "core_cm33.h" /* Core Peripheral Access Layer */ -#include "system_MCXA153.h" /* Device specific configuration file */ - -/*! - * @} - */ /* end of group Cortex_Core_Configuration */ - - -/* ---------------------------------------------------------------------------- - -- Mapping Information - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup Mapping_Information Mapping Information - * @{ - */ - -/** Mapping Information */ -/*! - * @addtogroup dma_request - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @brief Structure for the DMA hardware request - * - * Defines the structure for the DMA hardware request collections. The user can configure the - * hardware request to trigger the DMA transfer accordingly. The index - * of the hardware request varies according to the to SoC. - */ -typedef enum _dma_request_source -{ - kDma0RequestDisabled = 0U, /**< Disabled */ - kDma0RequestWUU0 = 1U, /**< WUU Wake up event */ - kDma0RequestMuxI3c0Rx = 7U, /**< I3C0 Receive request */ - kDma0RequestMuxI3c0Tx = 8U, /**< I3C0 Transmit request */ - kDma0RequestLPI2C0Rx = 11U, /**< LPI2C0 Receive request */ - kDma0RequestLPI2C0Tx = 12U, /**< LPI2C0 Transmit request */ - kDma0RequestLPSPI0Rx = 15U, /**< LPSPI0 Receive request */ - kDma0RequestLPSPI0Tx = 16U, /**< LPSPI0 Transmit request */ - kDma0RequestLPSPI1Rx = 17U, /**< LPSPI1 Receive request */ - kDma0RequestLPSPI1Tx = 18U, /**< LPSPI1 Transmit request */ - kDma0RequestLPUART0Rx = 21U, /**< LPUART0 Receive request */ - kDma0RequestLPUART0Tx = 22U, /**< LPUART0 Transmit request */ - kDma0RequestLPUART1Rx = 23U, /**< LPUART1 Receive request */ - kDma0RequestLPUART1Tx = 24U, /**< LPUART1 Transmit request */ - kDma0RequestLPUART2Rx = 25U, /**< LPUART2 Receive request */ - kDma0RequestLPUART2Tx = 26U, /**< LPUART2 Transmit request */ - kDma0RequestMuxCtimer0M0 = 31U, /**< CTIMER0 Match channel 0 request */ - kDma0RequestMuxCtimer0M1 = 32U, /**< CTIMER0 Match channel 1 request */ - kDma0RequestMuxCtimer1M0 = 33U, /**< CTIMER1 Match channel 0 request */ - kDma0RequestMuxCtimer1M1 = 34U, /**< CTIMER1 Match channel 1 request */ - kDma0RequestMuxCtimer2M0 = 35U, /**< CTIMER2 Match channel 0 request */ - kDma0RequestMuxCtimer2M1 = 36U, /**< CTIMER2 Match channel 1 request */ - kDma0RequestMuxFlexPWM0ReqCapt0 = 41U, /**< FlexPWM0 capture0 request */ - kDma0RequestMuxFlexPWM0ReqCapt1 = 42U, /**< FlexPWM0 capture1 request */ - kDma0RequestMuxFlexPWM0ReqCapt2 = 43U, /**< FlexPWM0 capture2 request */ - kDma0RequestMuxFlexPWM0ReqVal0 = 45U, /**< FlexPWM0 value0 request */ - kDma0RequestMuxFlexPWM0ReqVal1 = 46U, /**< FlexPWM0 value1 request */ - kDma0RequestMuxFlexPWM0ReqVal2 = 47U, /**< FlexPWM0 value2 request */ - kDma0RequestMuxLptmr0 = 49U, /**< LPTMR0 Counter match event */ - kDma0RequestMuxAdc0FifoRequest = 51U, /**< ADC0 FIFO request */ - kDma0RequestMuxHsCmp0DmaRequest = 53U, /**< CMP0 DMA_request */ - kDma0RequestMuxHsCmp1DmaRequest = 54U, /**< CMP1 DMA_request */ - kDma0RequestMuxGpio0PinEventRequest0 = 60U, /**< GPIO0 Pin event request 0 */ - kDma0RequestMuxGpio1PinEventRequest0 = 61U, /**< GPIO1 Pin event request 0 */ - kDma0RequestMuxGpio2PinEventRequest0 = 62U, /**< GPIO2 Pin event request 0 */ - kDma0RequestMuxGpio3PinEventRequest0 = 63U, /**< GPIO3 Pin event request 0 */ - kDma0RequestMuxQdc0 = 65U, /**< DMA request for new buffered value */ -} dma_request_source_t; - -/* @} */ - -/*! - * @addtogroup eim_memory_channel - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @brief Structure for the eim_memory_channel - * - * Defines the structure for the EIM resource collections. - */ - -typedef enum _eim_memory_channel -{ - kEIM_MemoryChannelRAMA0 = 0U, /**< Memory RAMA0 */ -} eim_memory_channel_t; - -/* @} */ - -/*! - * @addtogroup eim_error_injection_channel_enable - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @brief Structure for the eim_error_injection_channel_enable - * - * Defines the structure for the EIM error injection resource collections. - */ - -typedef enum _eim_error_injection_channel_enable -{ - kEIM_MemoryChannelRAMAEnable = 0x80000000U, /**< Memory channel 0(RAMA0) error injection enable */ -} eim_error_injection_channel_enable_t; - -/* @} */ - -/*! - * @addtogroup erm_memory_channel - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @brief Structure for the erm_memory_channel - * - * Defines the structure for the ERM resource collections. - */ - -typedef enum _erm_memory_channel -{ - kERM_MemoryChannelRAMA0 = 0U, /**< Memory RAMA0 */ - kERM_MemoryChannelFLASH = 1U, /**< Memory FLASH */ -} erm_memory_channel_t; - -/* @} */ - - -/*! - * @} - */ /* end of group Mapping_Information */ - - -/* ---------------------------------------------------------------------------- - -- Device Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup Peripheral_access_layer Device Peripheral Access Layer - * @{ - */ - - -/* -** Start of section using anonymous unions -*/ - -#if defined(__ARMCC_VERSION) - #if (__ARMCC_VERSION >= 6010050) - #pragma clang diagnostic push - #else - #pragma push - #pragma anon_unions - #endif -#elif defined(__GNUC__) - /* anonymous unions are enabled by default */ -#elif defined(__IAR_SYSTEMS_ICC__) - #pragma language=extended -#else - #error Not supported compiler type -#endif - -/* ---------------------------------------------------------------------------- - -- ADC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ADC_Peripheral_Access_Layer ADC Peripheral Access Layer - * @{ - */ - -/** ADC - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID Register, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter Register, offset: 0x4 */ - uint8_t RESERVED_0[8]; - __IO uint32_t CTRL; /**< Control Register, offset: 0x10 */ - __IO uint32_t STAT; /**< Status Register, offset: 0x14 */ - __IO uint32_t IE; /**< Interrupt Enable Register, offset: 0x18 */ - __IO uint32_t DE; /**< DMA Enable Register, offset: 0x1C */ - __IO uint32_t CFG; /**< Configuration Register, offset: 0x20 */ - __IO uint32_t PAUSE; /**< Pause Register, offset: 0x24 */ - uint8_t RESERVED_1[12]; - __O uint32_t SWTRIG; /**< Software Trigger Register, offset: 0x34 */ - __IO uint32_t TSTAT; /**< Trigger Status Register, offset: 0x38 */ - uint8_t RESERVED_2[4]; - __IO uint32_t OFSTRIM; /**< Offset Trim Register, offset: 0x40 */ - uint8_t RESERVED_3[4]; - __IO uint32_t HSTRIM; /**< High Speed Trim Register, offset: 0x48 */ - uint8_t RESERVED_4[84]; - __IO uint32_t TCTRL[4]; /**< Trigger Control Register, array offset: 0xA0, array step: 0x4 */ - uint8_t RESERVED_5[48]; - __IO uint32_t FCTRL; /**< FIFO Control Register, offset: 0xE0 */ - uint8_t RESERVED_6[12]; - __I uint32_t GCC[1]; /**< Gain Calibration Control, array offset: 0xF0, array step: 0x4 */ - uint8_t RESERVED_7[4]; - __IO uint32_t GCR[1]; /**< Gain Calculation Result, array offset: 0xF8, array step: 0x4 */ - uint8_t RESERVED_8[4]; - struct { /* offset: 0x100, array step: 0x8 */ - __IO uint32_t CMDL; /**< Command Low Buffer Register, array offset: 0x100, array step: 0x8 */ - __IO uint32_t CMDH; /**< Command High Buffer Register, array offset: 0x104, array step: 0x8 */ - } CMD[7]; - uint8_t RESERVED_9[200]; - __IO uint32_t CV[15]; /**< Compare Value Register, array offset: 0x200, array step: 0x4 */ - uint8_t RESERVED_10[196]; - __I uint32_t RESFIFO; /**< Data Result FIFO Register, offset: 0x300 */ - uint8_t RESERVED_11[252]; - __IO uint32_t CAL_GAR0; /**< Calibration General A-Side Registers, offset: 0x400 */ - __IO uint32_t CAL_GAR1; /**< Calibration General A-Side Registers, offset: 0x404 */ - __IO uint32_t CAL_GAR2; /**< Calibration General A-Side Registers, offset: 0x408 */ - __IO uint32_t CAL_GAR3; /**< Calibration General A-Side Registers, offset: 0x40C */ - __IO uint32_t CAL_GAR4; /**< Calibration General A-Side Registers, offset: 0x410 */ - __IO uint32_t CAL_GAR5; /**< Calibration General A-Side Registers, offset: 0x414 */ - __IO uint32_t CAL_GAR6; /**< Calibration General A-Side Registers, offset: 0x418 */ - __IO uint32_t CAL_GAR7; /**< Calibration General A-Side Registers, offset: 0x41C */ - __IO uint32_t CAL_GAR8; /**< Calibration General A-Side Registers, offset: 0x420 */ - __IO uint32_t CAL_GAR9; /**< Calibration General A-Side Registers, offset: 0x424 */ - __IO uint32_t CAL_GAR10; /**< Calibration General A-Side Registers, offset: 0x428 */ - __IO uint32_t CAL_GAR11; /**< Calibration General A-Side Registers, offset: 0x42C */ - __IO uint32_t CAL_GAR12; /**< Calibration General A-Side Registers, offset: 0x430 */ - __IO uint32_t CAL_GAR13; /**< Calibration General A-Side Registers, offset: 0x434 */ - __IO uint32_t CAL_GAR14; /**< Calibration General A-Side Registers, offset: 0x438 */ - __IO uint32_t CAL_GAR15; /**< Calibration General A-Side Registers, offset: 0x43C */ - __IO uint32_t CAL_GAR16; /**< Calibration General A-Side Registers, offset: 0x440 */ - __IO uint32_t CAL_GAR17; /**< Calibration General A-Side Registers, offset: 0x444 */ - __IO uint32_t CAL_GAR18; /**< Calibration General A-Side Registers, offset: 0x448 */ - __IO uint32_t CAL_GAR19; /**< Calibration General A-Side Registers, offset: 0x44C */ - __IO uint32_t CAL_GAR20; /**< Calibration General A-Side Registers, offset: 0x450 */ - __IO uint32_t CAL_GAR21; /**< Calibration General A-Side Registers, offset: 0x454 */ - __IO uint32_t CAL_GAR22; /**< Calibration General A-Side Registers, offset: 0x458 */ - __IO uint32_t CAL_GAR23; /**< Calibration General A-Side Registers, offset: 0x45C */ - __IO uint32_t CAL_GAR24; /**< Calibration General A-Side Registers, offset: 0x460 */ - __IO uint32_t CAL_GAR25; /**< Calibration General A-Side Registers, offset: 0x464 */ - __IO uint32_t CAL_GAR26; /**< Calibration General A-Side Registers, offset: 0x468 */ - __IO uint32_t CAL_GAR27; /**< Calibration General A-Side Registers, offset: 0x46C */ - __IO uint32_t CAL_GAR28; /**< Calibration General A-Side Registers, offset: 0x470 */ - __IO uint32_t CAL_GAR29; /**< Calibration General A-Side Registers, offset: 0x474 */ - __IO uint32_t CAL_GAR30; /**< Calibration General A-Side Registers, offset: 0x478 */ - __IO uint32_t CAL_GAR31; /**< Calibration General A-Side Registers, offset: 0x47C */ - __IO uint32_t CAL_GAR32; /**< Calibration General A-Side Registers, offset: 0x480 */ - uint8_t RESERVED_12[2932]; - __IO uint32_t CFG2; /**< Configuration 2 Register, offset: 0xFF8 */ -} ADC_Type; - -/* ---------------------------------------------------------------------------- - -- ADC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ADC_Register_Masks ADC Register Masks - * @{ - */ - -/*! @name VERID - Version ID Register */ -/*! @{ */ - -#define ADC_VERID_RES_MASK (0x1U) -#define ADC_VERID_RES_SHIFT (0U) -/*! RES - Resolution - * 0b0..Up to 12-bit single ended resolution supported (and 13-bit differential resolution if VERID[DIFFEN] = 1b). - * 0b1..Up to 16-bit single ended resolution supported (and 16-bit differential resolution if VERID[DIFFEN] = 1b). - */ -#define ADC_VERID_RES(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_RES_SHIFT)) & ADC_VERID_RES_MASK) - -#define ADC_VERID_DIFFEN_MASK (0x2U) -#define ADC_VERID_DIFFEN_SHIFT (1U) -/*! DIFFEN - Differential Supported - * 0b0..Differential operation not supported. - * 0b1..Differential operation supported. - */ -#define ADC_VERID_DIFFEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_DIFFEN_SHIFT)) & ADC_VERID_DIFFEN_MASK) - -#define ADC_VERID_MVI_MASK (0x8U) -#define ADC_VERID_MVI_SHIFT (3U) -/*! MVI - Multi Vref Implemented - * 0b0..Single voltage reference high (VREFH) input supported. - * 0b1..Multiple voltage reference high (VREFH) inputs supported. - */ -#define ADC_VERID_MVI(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_MVI_SHIFT)) & ADC_VERID_MVI_MASK) - -#define ADC_VERID_CSW_MASK (0x70U) -#define ADC_VERID_CSW_SHIFT (4U) -/*! CSW - Channel Scale Width - * 0b000..Channel scaling not supported. - * 0b001..Channel scaling supported. 1-bit CSCALE control field. - * 0b110..Channel scaling supported. 6-bit CSCALE control field. - */ -#define ADC_VERID_CSW(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_CSW_SHIFT)) & ADC_VERID_CSW_MASK) - -#define ADC_VERID_VR1RNGI_MASK (0x100U) -#define ADC_VERID_VR1RNGI_SHIFT (8U) -/*! VR1RNGI - Voltage Reference 1 Range Control Bit Implemented - * 0b0..Range control not required. CFG[VREF1RNG] is not implemented. - * 0b1..Range control required. CFG[VREF1RNG] is implemented. - */ -#define ADC_VERID_VR1RNGI(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_VR1RNGI_SHIFT)) & ADC_VERID_VR1RNGI_MASK) - -#define ADC_VERID_IADCKI_MASK (0x200U) -#define ADC_VERID_IADCKI_SHIFT (9U) -/*! IADCKI - Internal ADC Clock Implemented - * 0b0..Internal clock source not implemented. - * 0b1..Internal clock source (and CFG[ADCKEN]) implemented. - */ -#define ADC_VERID_IADCKI(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_IADCKI_SHIFT)) & ADC_VERID_IADCKI_MASK) - -#define ADC_VERID_CALOFSI_MASK (0x400U) -#define ADC_VERID_CALOFSI_SHIFT (10U) -/*! CALOFSI - Calibration Function Implemented - * 0b0..Calibration Not Implemented. - * 0b1..Calibration Implemented. - */ -#define ADC_VERID_CALOFSI(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_CALOFSI_SHIFT)) & ADC_VERID_CALOFSI_MASK) - -#define ADC_VERID_NUM_SEC_MASK (0x800U) -#define ADC_VERID_NUM_SEC_SHIFT (11U) -/*! NUM_SEC - Number of Single Ended Outputs Supported - * 0b0..This design supports one single ended conversion at a time. - * 0b1..This design supports two simultaneous single ended conversions. - */ -#define ADC_VERID_NUM_SEC(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_NUM_SEC_SHIFT)) & ADC_VERID_NUM_SEC_MASK) - -#define ADC_VERID_NUM_FIFO_MASK (0x7000U) -#define ADC_VERID_NUM_FIFO_SHIFT (12U) -/*! NUM_FIFO - Number of FIFOs - * 0b000..N/A - * 0b001..This design supports one result FIFO. - * 0b010..This design supports two result FIFOs. - * 0b011..This design supports three result FIFOs. - * 0b100..This design supports four result FIFOs. - */ -#define ADC_VERID_NUM_FIFO(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_NUM_FIFO_SHIFT)) & ADC_VERID_NUM_FIFO_MASK) - -#define ADC_VERID_MINOR_MASK (0xFF0000U) -#define ADC_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define ADC_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_MINOR_SHIFT)) & ADC_VERID_MINOR_MASK) - -#define ADC_VERID_MAJOR_MASK (0xFF000000U) -#define ADC_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define ADC_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_MAJOR_SHIFT)) & ADC_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter Register */ -/*! @{ */ - -#define ADC_PARAM_TRIG_NUM_MASK (0xFFU) -#define ADC_PARAM_TRIG_NUM_SHIFT (0U) -/*! TRIG_NUM - Trigger Number */ -#define ADC_PARAM_TRIG_NUM(x) (((uint32_t)(((uint32_t)(x)) << ADC_PARAM_TRIG_NUM_SHIFT)) & ADC_PARAM_TRIG_NUM_MASK) - -#define ADC_PARAM_FIFOSIZE_MASK (0xFF00U) -#define ADC_PARAM_FIFOSIZE_SHIFT (8U) -/*! FIFOSIZE - Result FIFO Depth - * 0b00000001..Result FIFO depth = 2 dataword. - * 0b00000100..Result FIFO depth = 4 datawords. - * 0b00001000..Result FIFO depth = 8 datawords. - * 0b00010000..Result FIFO depth = 16 datawords. - * 0b00100000..Result FIFO depth = 32 datawords. - * 0b01000000..Result FIFO depth = 64 datawords. - */ -#define ADC_PARAM_FIFOSIZE(x) (((uint32_t)(((uint32_t)(x)) << ADC_PARAM_FIFOSIZE_SHIFT)) & ADC_PARAM_FIFOSIZE_MASK) - -#define ADC_PARAM_CV_NUM_MASK (0xFF0000U) -#define ADC_PARAM_CV_NUM_SHIFT (16U) -/*! CV_NUM - Compare Value Number */ -#define ADC_PARAM_CV_NUM(x) (((uint32_t)(((uint32_t)(x)) << ADC_PARAM_CV_NUM_SHIFT)) & ADC_PARAM_CV_NUM_MASK) - -#define ADC_PARAM_CMD_NUM_MASK (0xFF000000U) -#define ADC_PARAM_CMD_NUM_SHIFT (24U) -/*! CMD_NUM - Command Buffer Number */ -#define ADC_PARAM_CMD_NUM(x) (((uint32_t)(((uint32_t)(x)) << ADC_PARAM_CMD_NUM_SHIFT)) & ADC_PARAM_CMD_NUM_MASK) -/*! @} */ - -/*! @name CTRL - Control Register */ -/*! @{ */ - -#define ADC_CTRL_ADCEN_MASK (0x1U) -#define ADC_CTRL_ADCEN_SHIFT (0U) -/*! ADCEN - ADC Enable - * 0b0..ADC is disabled. - * 0b1..ADC is enabled. - */ -#define ADC_CTRL_ADCEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_ADCEN_SHIFT)) & ADC_CTRL_ADCEN_MASK) - -#define ADC_CTRL_RST_MASK (0x2U) -#define ADC_CTRL_RST_SHIFT (1U) -/*! RST - Software Reset - * 0b0..ADC logic is not reset. - * 0b1..ADC logic is reset. - */ -#define ADC_CTRL_RST(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_RST_SHIFT)) & ADC_CTRL_RST_MASK) - -#define ADC_CTRL_DOZEN_MASK (0x4U) -#define ADC_CTRL_DOZEN_SHIFT (2U) -/*! DOZEN - Doze Enable - * 0b0..ADC is enabled in low power mode. - * 0b1..ADC is disabled in low power mode. - */ -#define ADC_CTRL_DOZEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_DOZEN_SHIFT)) & ADC_CTRL_DOZEN_MASK) - -#define ADC_CTRL_CAL_REQ_MASK (0x8U) -#define ADC_CTRL_CAL_REQ_SHIFT (3U) -/*! CAL_REQ - Auto-Calibration Request - * 0b0..No request for hardware calibration has been made - * 0b1..A request for hardware calibration has been made - */ -#define ADC_CTRL_CAL_REQ(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_CAL_REQ_SHIFT)) & ADC_CTRL_CAL_REQ_MASK) - -#define ADC_CTRL_CALOFS_MASK (0x10U) -#define ADC_CTRL_CALOFS_SHIFT (4U) -/*! CALOFS - Offset Calibration Request - * 0b0..No request for offset calibration has been made - * 0b1..Request for offset calibration function - */ -#define ADC_CTRL_CALOFS(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_CALOFS_SHIFT)) & ADC_CTRL_CALOFS_MASK) - -#define ADC_CTRL_CALHS_MASK (0x40U) -#define ADC_CTRL_CALHS_SHIFT (6U) -/*! CALHS - High Speed Mode Trim Request - * 0b0..No request for high speed mode trim has been made - * 0b1..Request for high speed mode trim has been made - */ -#define ADC_CTRL_CALHS(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_CALHS_SHIFT)) & ADC_CTRL_CALHS_MASK) - -#define ADC_CTRL_RSTFIFO0_MASK (0x100U) -#define ADC_CTRL_RSTFIFO0_SHIFT (8U) -/*! RSTFIFO0 - Reset FIFO 0 - * 0b0..No effect. - * 0b1..FIFO 0 is reset. - */ -#define ADC_CTRL_RSTFIFO0(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_RSTFIFO0_SHIFT)) & ADC_CTRL_RSTFIFO0_MASK) - -#define ADC_CTRL_CAL_AVGS_MASK (0xF0000U) -#define ADC_CTRL_CAL_AVGS_SHIFT (16U) -/*! CAL_AVGS - Auto-Calibration Averages - * 0b0000..Single conversion. - * 0b0001..2 conversions averaged. - * 0b0010..4 conversions averaged. - * 0b0011..8 conversions averaged. - * 0b0100..16 conversions averaged. - * 0b0101..32 conversions averaged. - * 0b0110..64 conversions averaged. - * 0b0111..128 conversions averaged. - * 0b1000..256 conversions averaged. - * 0b1001..512 conversions averaged. - * 0b1010..1024 conversions averaged. - */ -#define ADC_CTRL_CAL_AVGS(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_CAL_AVGS_SHIFT)) & ADC_CTRL_CAL_AVGS_MASK) -/*! @} */ - -/*! @name STAT - Status Register */ -/*! @{ */ - -#define ADC_STAT_RDY0_MASK (0x1U) -#define ADC_STAT_RDY0_SHIFT (0U) -/*! RDY0 - Result FIFO 0 Ready Flag - * 0b0..Result FIFO 0 data level not above watermark level. - * 0b1..Result FIFO 0 holding data above watermark level. - */ -#define ADC_STAT_RDY0(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_RDY0_SHIFT)) & ADC_STAT_RDY0_MASK) - -#define ADC_STAT_FOF0_MASK (0x2U) -#define ADC_STAT_FOF0_SHIFT (1U) -/*! FOF0 - Result FIFO 0 Overflow Flag - * 0b0..No result FIFO 0 overflow has occurred since the last time the flag was cleared. - * 0b1..At least one result FIFO 0 overflow has occurred since the last time the flag was cleared. - */ -#define ADC_STAT_FOF0(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_FOF0_SHIFT)) & ADC_STAT_FOF0_MASK) - -#define ADC_STAT_TEXC_INT_MASK (0x100U) -#define ADC_STAT_TEXC_INT_SHIFT (8U) -/*! TEXC_INT - Interrupt Flag For High Priority Trigger Exception - * 0b0..No trigger exceptions have occurred. - * 0b1..A trigger exception has occurred and is pending acknowledgement. - */ -#define ADC_STAT_TEXC_INT(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_TEXC_INT_SHIFT)) & ADC_STAT_TEXC_INT_MASK) - -#define ADC_STAT_TCOMP_INT_MASK (0x200U) -#define ADC_STAT_TCOMP_INT_SHIFT (9U) -/*! TCOMP_INT - Interrupt Flag For Trigger Completion - * 0b0..Either IE[TCOMP_IE] is set to 0, or no trigger sequences have run to completion. - * 0b1..Trigger sequence has been completed and all data is stored in the associated FIFO. - */ -#define ADC_STAT_TCOMP_INT(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_TCOMP_INT_SHIFT)) & ADC_STAT_TCOMP_INT_MASK) - -#define ADC_STAT_CAL_RDY_MASK (0x400U) -#define ADC_STAT_CAL_RDY_SHIFT (10U) -/*! CAL_RDY - Calibration Ready - * 0b0..Calibration is incomplete or hasn't been ran. - * 0b1..The ADC is calibrated. - */ -#define ADC_STAT_CAL_RDY(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_CAL_RDY_SHIFT)) & ADC_STAT_CAL_RDY_MASK) - -#define ADC_STAT_ADC_ACTIVE_MASK (0x800U) -#define ADC_STAT_ADC_ACTIVE_SHIFT (11U) -/*! ADC_ACTIVE - ADC Active - * 0b0..The ADC is IDLE. There are no pending triggers to service and no active commands are being processed. - * 0b1..The ADC is processing a conversion, running through the power up delay, or servicing a trigger. - */ -#define ADC_STAT_ADC_ACTIVE(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_ADC_ACTIVE_SHIFT)) & ADC_STAT_ADC_ACTIVE_MASK) - -#define ADC_STAT_TRGACT_MASK (0x30000U) -#define ADC_STAT_TRGACT_SHIFT (16U) -/*! TRGACT - Trigger Active - * 0b00..Command (sequence) associated with Trigger 0 currently being executed. - * 0b01..Command (sequence) associated with Trigger 1 currently being executed. - * 0b10..Command (sequence) associated with Trigger 2 currently being executed. - * 0b11..Command (sequence) associated with Trigger 3 currently being executed. - */ -#define ADC_STAT_TRGACT(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_TRGACT_SHIFT)) & ADC_STAT_TRGACT_MASK) - -#define ADC_STAT_CMDACT_MASK (0x7000000U) -#define ADC_STAT_CMDACT_SHIFT (24U) -/*! CMDACT - Command Active - * 0b000..No command is currently in progress. - * 0b001..Command 1 currently being executed. - * 0b010..Command 2 currently being executed. - * 0b011-0b111..Associated command number is currently being executed. - */ -#define ADC_STAT_CMDACT(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_CMDACT_SHIFT)) & ADC_STAT_CMDACT_MASK) -/*! @} */ - -/*! @name IE - Interrupt Enable Register */ -/*! @{ */ - -#define ADC_IE_FWMIE0_MASK (0x1U) -#define ADC_IE_FWMIE0_SHIFT (0U) -/*! FWMIE0 - FIFO 0 Watermark Interrupt Enable - * 0b0..FIFO 0 watermark interrupts are not enabled. - * 0b1..FIFO 0 watermark interrupts are enabled. - */ -#define ADC_IE_FWMIE0(x) (((uint32_t)(((uint32_t)(x)) << ADC_IE_FWMIE0_SHIFT)) & ADC_IE_FWMIE0_MASK) - -#define ADC_IE_FOFIE0_MASK (0x2U) -#define ADC_IE_FOFIE0_SHIFT (1U) -/*! FOFIE0 - Result FIFO 0 Overflow Interrupt Enable - * 0b0..FIFO 0 overflow interrupts are not enabled. - * 0b1..FIFO 0 overflow interrupts are enabled. - */ -#define ADC_IE_FOFIE0(x) (((uint32_t)(((uint32_t)(x)) << ADC_IE_FOFIE0_SHIFT)) & ADC_IE_FOFIE0_MASK) - -#define ADC_IE_TEXC_IE_MASK (0x100U) -#define ADC_IE_TEXC_IE_SHIFT (8U) -/*! TEXC_IE - Trigger Exception Interrupt Enable - * 0b0..Trigger exception interrupts are disabled. - * 0b1..Trigger exception interrupts are enabled. - */ -#define ADC_IE_TEXC_IE(x) (((uint32_t)(((uint32_t)(x)) << ADC_IE_TEXC_IE_SHIFT)) & ADC_IE_TEXC_IE_MASK) - -#define ADC_IE_TCOMP_IE_MASK (0xF0000U) -#define ADC_IE_TCOMP_IE_SHIFT (16U) -/*! TCOMP_IE - Trigger Completion Interrupt Enable - * 0b0000..Trigger completion interrupts are disabled. - * 0b0001..Trigger completion interrupts are enabled for trigger source 0 only. - * 0b0010..Trigger completion interrupts are enabled for trigger source 1 only. - * 0b0011-0b1110..Associated trigger completion interrupts are enabled. - * 0b1111..Trigger completion interrupts are enabled for every trigger source. - */ -#define ADC_IE_TCOMP_IE(x) (((uint32_t)(((uint32_t)(x)) << ADC_IE_TCOMP_IE_SHIFT)) & ADC_IE_TCOMP_IE_MASK) -/*! @} */ - -/*! @name DE - DMA Enable Register */ -/*! @{ */ - -#define ADC_DE_FWMDE0_MASK (0x1U) -#define ADC_DE_FWMDE0_SHIFT (0U) -/*! FWMDE0 - FIFO 0 Watermark DMA Enable - * 0b0..DMA request disabled. - * 0b1..DMA request enabled. - */ -#define ADC_DE_FWMDE0(x) (((uint32_t)(((uint32_t)(x)) << ADC_DE_FWMDE0_SHIFT)) & ADC_DE_FWMDE0_MASK) -/*! @} */ - -/*! @name CFG - Configuration Register */ -/*! @{ */ - -#define ADC_CFG_TPRICTRL_MASK (0x3U) -#define ADC_CFG_TPRICTRL_SHIFT (0U) -/*! TPRICTRL - ADC Trigger Priority Control - * 0b00..If a higher priority trigger is detected during command processing, the current conversion is aborted - * and the new command specified by the trigger is started. - * 0b01..If a higher priority trigger is received during command processing, the current command is stopped after - * completing the current conversion. If averaging is enabled, the averaging loop will be completed. - * However, CMDHa[LOOP] will be ignored and the higher priority trigger will be serviced. - * 0b10..If a higher priority trigger is received during command processing, the current command will be - * completed (averaging, looping, compare) before servicing the higher priority trigger. - * 0b11.. - */ -#define ADC_CFG_TPRICTRL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_TPRICTRL_SHIFT)) & ADC_CFG_TPRICTRL_MASK) - -#define ADC_CFG_PWRSEL_MASK (0x20U) -#define ADC_CFG_PWRSEL_SHIFT (5U) -/*! PWRSEL - Power Configuration Select - * 0b0..Low power - * 0b1..High power - */ -#define ADC_CFG_PWRSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_PWRSEL_SHIFT)) & ADC_CFG_PWRSEL_MASK) - -#define ADC_CFG_REFSEL_MASK (0xC0U) -#define ADC_CFG_REFSEL_SHIFT (6U) -/*! REFSEL - Voltage Reference Selection - * 0b00..(Default) Option 1 setting. - * 0b01..Option 2 setting. - * 0b10..Option 3 setting. - * 0b11..Reserved - */ -#define ADC_CFG_REFSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_REFSEL_SHIFT)) & ADC_CFG_REFSEL_MASK) - -#define ADC_CFG_TRES_MASK (0x100U) -#define ADC_CFG_TRES_SHIFT (8U) -/*! TRES - Trigger Resume Enable - * 0b0..Trigger sequences interrupted by a high priority trigger exception are not automatically resumed or restarted. - * 0b1..Trigger sequences interrupted by a high priority trigger exception are automatically resumed or restarted. - */ -#define ADC_CFG_TRES(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_TRES_SHIFT)) & ADC_CFG_TRES_MASK) - -#define ADC_CFG_TCMDRES_MASK (0x200U) -#define ADC_CFG_TCMDRES_SHIFT (9U) -/*! TCMDRES - Trigger Command Resume - * 0b0..Trigger sequences interrupted by a high priority trigger exception is automatically restarted. - * 0b1..Trigger sequences interrupted by a high priority trigger exception is resumed from the command executing before the exception. - */ -#define ADC_CFG_TCMDRES(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_TCMDRES_SHIFT)) & ADC_CFG_TCMDRES_MASK) - -#define ADC_CFG_HPT_EXDI_MASK (0x400U) -#define ADC_CFG_HPT_EXDI_SHIFT (10U) -/*! HPT_EXDI - High Priority Trigger Exception Disable - * 0b0..High priority trigger exceptions are enabled. - * 0b1..High priority trigger exceptions are disabled. - */ -#define ADC_CFG_HPT_EXDI(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_HPT_EXDI_SHIFT)) & ADC_CFG_HPT_EXDI_MASK) - -#define ADC_CFG_PUDLY_MASK (0xFF0000U) -#define ADC_CFG_PUDLY_SHIFT (16U) -/*! PUDLY - Power Up Delay */ -#define ADC_CFG_PUDLY(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_PUDLY_SHIFT)) & ADC_CFG_PUDLY_MASK) - -#define ADC_CFG_PWREN_MASK (0x10000000U) -#define ADC_CFG_PWREN_SHIFT (28U) -/*! PWREN - ADC Analog Pre-Enable - * 0b0..ADC analog circuits are only enabled while conversions are active. Performance is affected due to analog startup delays. - * 0b1..ADC analog circuits are pre-enabled and ready to execute conversions without startup delays (at the cost - * of higher DC current consumption). Note that a single power up delay (CFG[PUDLY]) is executed immediately - * once PWREN is set, and any detected trigger does not begin ADC operation until the power up delay time has - * passed. After this initial delay expires the analog remains pre-enabled and no additional delays are - * executed. - */ -#define ADC_CFG_PWREN(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_PWREN_SHIFT)) & ADC_CFG_PWREN_MASK) -/*! @} */ - -/*! @name PAUSE - Pause Register */ -/*! @{ */ - -#define ADC_PAUSE_PAUSEDLY_MASK (0x1FFU) -#define ADC_PAUSE_PAUSEDLY_SHIFT (0U) -/*! PAUSEDLY - Pause Delay */ -#define ADC_PAUSE_PAUSEDLY(x) (((uint32_t)(((uint32_t)(x)) << ADC_PAUSE_PAUSEDLY_SHIFT)) & ADC_PAUSE_PAUSEDLY_MASK) - -#define ADC_PAUSE_PAUSEEN_MASK (0x80000000U) -#define ADC_PAUSE_PAUSEEN_SHIFT (31U) -/*! PAUSEEN - PAUSE Option Enable - * 0b0..Pause operation disabled - * 0b1..Pause operation enabled - */ -#define ADC_PAUSE_PAUSEEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_PAUSE_PAUSEEN_SHIFT)) & ADC_PAUSE_PAUSEEN_MASK) -/*! @} */ - -/*! @name SWTRIG - Software Trigger Register */ -/*! @{ */ - -#define ADC_SWTRIG_SWT0_MASK (0x1U) -#define ADC_SWTRIG_SWT0_SHIFT (0U) -/*! SWT0 - Software Trigger 0 Event - * 0b0..No trigger 0 event generated. - * 0b1..Trigger 0 event generated. - */ -#define ADC_SWTRIG_SWT0(x) (((uint32_t)(((uint32_t)(x)) << ADC_SWTRIG_SWT0_SHIFT)) & ADC_SWTRIG_SWT0_MASK) - -#define ADC_SWTRIG_SWT1_MASK (0x2U) -#define ADC_SWTRIG_SWT1_SHIFT (1U) -/*! SWT1 - Software Trigger 1 Event - * 0b0..No trigger 1 event generated. - * 0b1..Trigger 1 event generated. - */ -#define ADC_SWTRIG_SWT1(x) (((uint32_t)(((uint32_t)(x)) << ADC_SWTRIG_SWT1_SHIFT)) & ADC_SWTRIG_SWT1_MASK) - -#define ADC_SWTRIG_SWT2_MASK (0x4U) -#define ADC_SWTRIG_SWT2_SHIFT (2U) -/*! SWT2 - Software Trigger 2 Event - * 0b0..No trigger 2 event generated. - * 0b1..Trigger 2 event generated. - */ -#define ADC_SWTRIG_SWT2(x) (((uint32_t)(((uint32_t)(x)) << ADC_SWTRIG_SWT2_SHIFT)) & ADC_SWTRIG_SWT2_MASK) - -#define ADC_SWTRIG_SWT3_MASK (0x8U) -#define ADC_SWTRIG_SWT3_SHIFT (3U) -/*! SWT3 - Software Trigger 3 Event - * 0b0..No trigger 3 event generated. - * 0b1..Trigger 3 event generated. - */ -#define ADC_SWTRIG_SWT3(x) (((uint32_t)(((uint32_t)(x)) << ADC_SWTRIG_SWT3_SHIFT)) & ADC_SWTRIG_SWT3_MASK) -/*! @} */ - -/*! @name TSTAT - Trigger Status Register */ -/*! @{ */ - -#define ADC_TSTAT_TEXC_NUM_MASK (0xFU) -#define ADC_TSTAT_TEXC_NUM_SHIFT (0U) -/*! TEXC_NUM - Trigger Exception Number - * 0b0000..No triggers have been interrupted by a high priority exception. Or CFG[TRES] = 1. - * 0b0001..Trigger 0 has been interrupted by a high priority exception. - * 0b0010..Trigger 1 has been interrupted by a high priority exception. - * 0b0011-0b1110..Associated trigger sequence has interrupted by a high priority exception. - * 0b1111..Every trigger sequence has been interrupted by a high priority exception. - */ -#define ADC_TSTAT_TEXC_NUM(x) (((uint32_t)(((uint32_t)(x)) << ADC_TSTAT_TEXC_NUM_SHIFT)) & ADC_TSTAT_TEXC_NUM_MASK) - -#define ADC_TSTAT_TCOMP_FLAG_MASK (0xF0000U) -#define ADC_TSTAT_TCOMP_FLAG_SHIFT (16U) -/*! TCOMP_FLAG - Trigger Completion Flag - * 0b0000..No triggers have been completed. Trigger completion interrupts are disabled. - * 0b0001..Trigger 0 has been completed and trigger 0 has enabled completion interrupts. - * 0b0010..Trigger 1 has been completed and trigger 1 has enabled completion interrupts. - * 0b0011-0b1110..Associated trigger sequence has completed and has enabled completion interrupts. - * 0b1111..Every trigger sequence has been completed and every trigger has enabled completion interrupts. - */ -#define ADC_TSTAT_TCOMP_FLAG(x) (((uint32_t)(((uint32_t)(x)) << ADC_TSTAT_TCOMP_FLAG_SHIFT)) & ADC_TSTAT_TCOMP_FLAG_MASK) -/*! @} */ - -/*! @name OFSTRIM - Offset Trim Register */ -/*! @{ */ - -#define ADC_OFSTRIM_OFSTRIM_MASK (0x3FFU) -#define ADC_OFSTRIM_OFSTRIM_SHIFT (0U) -/*! OFSTRIM - Trim for Offset */ -#define ADC_OFSTRIM_OFSTRIM(x) (((uint32_t)(((uint32_t)(x)) << ADC_OFSTRIM_OFSTRIM_SHIFT)) & ADC_OFSTRIM_OFSTRIM_MASK) -/*! @} */ - -/*! @name HSTRIM - High Speed Trim Register */ -/*! @{ */ - -#define ADC_HSTRIM_HSTRIM_MASK (0x1FU) -#define ADC_HSTRIM_HSTRIM_SHIFT (0U) -/*! HSTRIM - Trim for High Speed Conversions */ -#define ADC_HSTRIM_HSTRIM(x) (((uint32_t)(((uint32_t)(x)) << ADC_HSTRIM_HSTRIM_SHIFT)) & ADC_HSTRIM_HSTRIM_MASK) -/*! @} */ - -/*! @name TCTRL - Trigger Control Register */ -/*! @{ */ - -#define ADC_TCTRL_HTEN_MASK (0x1U) -#define ADC_TCTRL_HTEN_SHIFT (0U) -/*! HTEN - Trigger Enable - * 0b0..Hardware trigger source disabled - * 0b1..Hardware trigger source enabled - */ -#define ADC_TCTRL_HTEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_HTEN_SHIFT)) & ADC_TCTRL_HTEN_MASK) - -#define ADC_TCTRL_TPRI_MASK (0x300U) -#define ADC_TCTRL_TPRI_SHIFT (8U) -/*! TPRI - Trigger Priority Setting - * 0b00..Set to highest priority, Level 1 - * 0b01-0b10..Set to corresponding priority level - * 0b11..Set to lowest priority, Level 4 - */ -#define ADC_TCTRL_TPRI(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_TPRI_SHIFT)) & ADC_TCTRL_TPRI_MASK) - -#define ADC_TCTRL_RSYNC_MASK (0x8000U) -#define ADC_TCTRL_RSYNC_SHIFT (15U) -/*! RSYNC - Trigger Resync */ -#define ADC_TCTRL_RSYNC(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_RSYNC_SHIFT)) & ADC_TCTRL_RSYNC_MASK) - -#define ADC_TCTRL_TDLY_MASK (0xF0000U) -#define ADC_TCTRL_TDLY_SHIFT (16U) -/*! TDLY - Trigger Delay Select */ -#define ADC_TCTRL_TDLY(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_TDLY_SHIFT)) & ADC_TCTRL_TDLY_MASK) - -#define ADC_TCTRL_TSYNC_MASK (0x800000U) -#define ADC_TCTRL_TSYNC_SHIFT (23U) -/*! TSYNC - Trigger Synchronous Select */ -#define ADC_TCTRL_TSYNC(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_TSYNC_SHIFT)) & ADC_TCTRL_TSYNC_MASK) - -#define ADC_TCTRL_TCMD_MASK (0x7000000U) -#define ADC_TCTRL_TCMD_SHIFT (24U) -/*! TCMD - Trigger Command Select - * 0b000..Not a valid selection from the command buffer. Trigger event is ignored. - * 0b001..CMD1 is executed - * 0b010-0b110..Corresponding CMD is executed - * 0b111..CMD7 is executed - */ -#define ADC_TCTRL_TCMD(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_TCMD_SHIFT)) & ADC_TCTRL_TCMD_MASK) -/*! @} */ - -/* The count of ADC_TCTRL */ -#define ADC_TCTRL_COUNT (4U) - -/*! @name FCTRL - FIFO Control Register */ -/*! @{ */ - -#define ADC_FCTRL_FCOUNT_MASK (0xFU) -#define ADC_FCTRL_FCOUNT_SHIFT (0U) -/*! FCOUNT - Result FIFO Counter */ -#define ADC_FCTRL_FCOUNT(x) (((uint32_t)(((uint32_t)(x)) << ADC_FCTRL_FCOUNT_SHIFT)) & ADC_FCTRL_FCOUNT_MASK) - -#define ADC_FCTRL_FWMARK_MASK (0x70000U) -#define ADC_FCTRL_FWMARK_SHIFT (16U) -/*! FWMARK - Watermark Level Selection */ -#define ADC_FCTRL_FWMARK(x) (((uint32_t)(((uint32_t)(x)) << ADC_FCTRL_FWMARK_SHIFT)) & ADC_FCTRL_FWMARK_MASK) -/*! @} */ - -/*! @name GCC - Gain Calibration Control */ -/*! @{ */ - -#define ADC_GCC_GAIN_CAL_MASK (0xFFFFU) -#define ADC_GCC_GAIN_CAL_SHIFT (0U) -/*! GAIN_CAL - Gain Calibration Value */ -#define ADC_GCC_GAIN_CAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_GCC_GAIN_CAL_SHIFT)) & ADC_GCC_GAIN_CAL_MASK) - -#define ADC_GCC_RDY_MASK (0x1000000U) -#define ADC_GCC_RDY_SHIFT (24U) -/*! RDY - Gain Calibration Value Valid - * 0b0..The GAIN_CAL value is invalid. Run the hardware calibration routine for this value to be set. - * 0b1..The GAIN_CAL value is valid. GAIN_CAL should be used by software to derive GCRa[GCALR]. - */ -#define ADC_GCC_RDY(x) (((uint32_t)(((uint32_t)(x)) << ADC_GCC_RDY_SHIFT)) & ADC_GCC_RDY_MASK) -/*! @} */ - -/* The count of ADC_GCC */ -#define ADC_GCC_COUNT (1U) - -/*! @name GCR - Gain Calculation Result */ -/*! @{ */ - -#define ADC_GCR_GCALR_MASK (0x1FFFFU) -#define ADC_GCR_GCALR_SHIFT (0U) -/*! GCALR - Gain Calculation Result */ -#define ADC_GCR_GCALR(x) (((uint32_t)(((uint32_t)(x)) << ADC_GCR_GCALR_SHIFT)) & ADC_GCR_GCALR_MASK) - -#define ADC_GCR_RDY_MASK (0x1000000U) -#define ADC_GCR_RDY_SHIFT (24U) -/*! RDY - Gain Calculation Ready - * 0b0..The GCALR value is invalid. - * 0b1..The GCALR value is valid. - */ -#define ADC_GCR_RDY(x) (((uint32_t)(((uint32_t)(x)) << ADC_GCR_RDY_SHIFT)) & ADC_GCR_RDY_MASK) -/*! @} */ - -/* The count of ADC_GCR */ -#define ADC_GCR_COUNT (1U) - -/*! @name CMDL - Command Low Buffer Register */ -/*! @{ */ - -#define ADC_CMDL_ADCH_MASK (0x1FU) -#define ADC_CMDL_ADCH_SHIFT (0U) -/*! ADCH - Input Channel Select - * 0b00000..Select CH0A. - * 0b00001..Select CH1A. - * 0b00010..Select CH2A. - * 0b00011..Select CH3A. - * 0b00100-0b11101..Select corresponding channel CHnA. - * 0b11110..Select CH30A. - * 0b11111..Select CH31A. - */ -#define ADC_CMDL_ADCH(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDL_ADCH_SHIFT)) & ADC_CMDL_ADCH_MASK) - -#define ADC_CMDL_CTYPE_MASK (0x60U) -#define ADC_CMDL_CTYPE_SHIFT (5U) -/*! CTYPE - Conversion Type - * 0b00..Single-Ended Mode. Only A side channel is converted. - * 0b01-0b11..Reserved. - */ -#define ADC_CMDL_CTYPE(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDL_CTYPE_SHIFT)) & ADC_CMDL_CTYPE_MASK) - -#define ADC_CMDL_MODE_MASK (0x80U) -#define ADC_CMDL_MODE_SHIFT (7U) -/*! MODE - Select Resolution of Conversions - * 0b0..Standard resolution. Single-ended 12-bit conversion. - * 0b1..High resolution. Single-ended 16-bit conversion. - */ -#define ADC_CMDL_MODE(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDL_MODE_SHIFT)) & ADC_CMDL_MODE_MASK) -/*! @} */ - -/* The count of ADC_CMDL */ -#define ADC_CMDL_COUNT (7U) - -/*! @name CMDH - Command High Buffer Register */ -/*! @{ */ - -#define ADC_CMDH_CMPEN_MASK (0x3U) -#define ADC_CMDH_CMPEN_SHIFT (0U) -/*! CMPEN - Compare Function Enable - * 0b00..Compare disabled. - * 0b01..Reserved - * 0b10..Compare enabled. Store on true. - * 0b11..Compare enabled. Repeat channel acquisition (sample/convert/compare) until true. - */ -#define ADC_CMDH_CMPEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_CMPEN_SHIFT)) & ADC_CMDH_CMPEN_MASK) - -#define ADC_CMDH_WAIT_TRIG_MASK (0x4U) -#define ADC_CMDH_WAIT_TRIG_SHIFT (2U) -/*! WAIT_TRIG - Wait for Trigger Assertion before Execution. - * 0b0..This command will be automatically executed. - * 0b1..The active trigger must be asserted again before executing this command. - */ -#define ADC_CMDH_WAIT_TRIG(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_WAIT_TRIG_SHIFT)) & ADC_CMDH_WAIT_TRIG_MASK) - -#define ADC_CMDH_LWI_MASK (0x80U) -#define ADC_CMDH_LWI_SHIFT (7U) -/*! LWI - Loop with Increment - * 0b0..Auto channel increment disabled - * 0b1..Auto channel increment enabled - */ -#define ADC_CMDH_LWI(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_LWI_SHIFT)) & ADC_CMDH_LWI_MASK) - -#define ADC_CMDH_STS_MASK (0x700U) -#define ADC_CMDH_STS_SHIFT (8U) -/*! STS - Sample Time Select - * 0b000..Minimum sample time of 3.5 ADCK cycles. - * 0b001..3.5 + 21 ADCK cycles; 5.5 ADCK cycles total sample time. - * 0b010..3.5 + 22 ADCK cycles; 7.5 ADCK cycles total sample time. - * 0b011..3.5 + 23 ADCK cycles; 11.5 ADCK cycles total sample time. - * 0b100..3.5 + 24 ADCK cycles; 19.5 ADCK cycles total sample time. - * 0b101..3.5 + 25 ADCK cycles; 35.5 ADCK cycles total sample time. - * 0b110..3.5 + 26 ADCK cycles; 67.5 ADCK cycles total sample time. - * 0b111..3.5 + 27 ADCK cycles; 131.5 ADCK cycles total sample time. - */ -#define ADC_CMDH_STS(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_STS_SHIFT)) & ADC_CMDH_STS_MASK) - -#define ADC_CMDH_AVGS_MASK (0xF000U) -#define ADC_CMDH_AVGS_SHIFT (12U) -/*! AVGS - Hardware Average Select - * 0b0000..Single conversion. - * 0b0001..2 conversions averaged. - * 0b0010..4 conversions averaged. - * 0b0011..8 conversions averaged. - * 0b0100..16 conversions averaged. - * 0b0101..32 conversions averaged. - * 0b0110..64 conversions averaged. - * 0b0111..128 conversions averaged. - * 0b1000..256 conversions averaged. - * 0b1001..512 conversions averaged. - * 0b1010..1024 conversions averaged. - */ -#define ADC_CMDH_AVGS(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_AVGS_SHIFT)) & ADC_CMDH_AVGS_MASK) - -#define ADC_CMDH_LOOP_MASK (0xF0000U) -#define ADC_CMDH_LOOP_SHIFT (16U) -/*! LOOP - Loop Count Select - * 0b0000..Looping not enabled. Command executes 1 time. - * 0b0001..Loop 1 time. Command executes 2 times. - * 0b0010..Loop 2 times. Command executes 3 times. - * 0b0011-0b1110..Loop corresponding number of times. Command executes LOOP+1 times. - * 0b1111..Loop 15 times. Command executes 16 times. - */ -#define ADC_CMDH_LOOP(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_LOOP_SHIFT)) & ADC_CMDH_LOOP_MASK) - -#define ADC_CMDH_NEXT_MASK (0x7000000U) -#define ADC_CMDH_NEXT_SHIFT (24U) -/*! NEXT - Next Command Select - * 0b000..No next command defined. Terminate conversions at completion of current command. If lower priority - * trigger pending, begin command associated with lower priority trigger. - * 0b001..Select CMD1 command buffer register as next command. - * 0b010-0b110..Select corresponding CMD command buffer register as next command - * 0b111..Select CMD7 command buffer register as next command. - */ -#define ADC_CMDH_NEXT(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_NEXT_SHIFT)) & ADC_CMDH_NEXT_MASK) -/*! @} */ - -/* The count of ADC_CMDH */ -#define ADC_CMDH_COUNT (7U) - -/*! @name CV - Compare Value Register */ -/*! @{ */ - -#define ADC_CV_CVL_MASK (0xFFFFU) -#define ADC_CV_CVL_SHIFT (0U) -/*! CVL - Compare Value Low */ -#define ADC_CV_CVL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CV_CVL_SHIFT)) & ADC_CV_CVL_MASK) - -#define ADC_CV_CVH_MASK (0xFFFF0000U) -#define ADC_CV_CVH_SHIFT (16U) -/*! CVH - Compare Value High */ -#define ADC_CV_CVH(x) (((uint32_t)(((uint32_t)(x)) << ADC_CV_CVH_SHIFT)) & ADC_CV_CVH_MASK) -/*! @} */ - -/* The count of ADC_CV */ -#define ADC_CV_COUNT (15U) - -/*! @name RESFIFO - Data Result FIFO Register */ -/*! @{ */ - -#define ADC_RESFIFO_D_MASK (0xFFFFU) -#define ADC_RESFIFO_D_SHIFT (0U) -/*! D - Data Result */ -#define ADC_RESFIFO_D(x) (((uint32_t)(((uint32_t)(x)) << ADC_RESFIFO_D_SHIFT)) & ADC_RESFIFO_D_MASK) - -#define ADC_RESFIFO_TSRC_MASK (0x30000U) -#define ADC_RESFIFO_TSRC_SHIFT (16U) -/*! TSRC - Trigger Source - * 0b00..Trigger source 0 initiated this conversion. - * 0b01..Trigger source 1 initiated this conversion. - * 0b10-0b10..Corresponding trigger source initiated this conversion. - * 0b11..Trigger source 3 initiated this conversion. - */ -#define ADC_RESFIFO_TSRC(x) (((uint32_t)(((uint32_t)(x)) << ADC_RESFIFO_TSRC_SHIFT)) & ADC_RESFIFO_TSRC_MASK) - -#define ADC_RESFIFO_LOOPCNT_MASK (0xF00000U) -#define ADC_RESFIFO_LOOPCNT_SHIFT (20U) -/*! LOOPCNT - Loop Count Value - * 0b0000..Result is from initial conversion in command. - * 0b0001..Result is from second conversion in command. - * 0b0010-0b1110..Result is from LOOPCNT+1 conversion in command. - * 0b1111..Result is from 16th conversion in command. - */ -#define ADC_RESFIFO_LOOPCNT(x) (((uint32_t)(((uint32_t)(x)) << ADC_RESFIFO_LOOPCNT_SHIFT)) & ADC_RESFIFO_LOOPCNT_MASK) - -#define ADC_RESFIFO_CMDSRC_MASK (0x7000000U) -#define ADC_RESFIFO_CMDSRC_SHIFT (24U) -/*! CMDSRC - Command Buffer Source - * 0b000..Not a valid value CMDSRC value for a dataword in RESFIFO. 0x0 is only found in initial FIFO state prior - * to an ADC conversion result dataword being stored to a RESFIFO buffer. - * 0b001..CMD1 buffer used as control settings for this conversion. - * 0b010-0b110..Corresponding command buffer used as control settings for this conversion. - * 0b111..CMD7 buffer used as control settings for this conversion. - */ -#define ADC_RESFIFO_CMDSRC(x) (((uint32_t)(((uint32_t)(x)) << ADC_RESFIFO_CMDSRC_SHIFT)) & ADC_RESFIFO_CMDSRC_MASK) - -#define ADC_RESFIFO_VALID_MASK (0x80000000U) -#define ADC_RESFIFO_VALID_SHIFT (31U) -/*! VALID - FIFO Entry is Valid - * 0b0..FIFO is empty. Discard any read from RESFIFO. - * 0b1..FIFO record read from RESFIFO is valid. - */ -#define ADC_RESFIFO_VALID(x) (((uint32_t)(((uint32_t)(x)) << ADC_RESFIFO_VALID_SHIFT)) & ADC_RESFIFO_VALID_MASK) -/*! @} */ - -/*! @name CAL_GAR0 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR0_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR0_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR0_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR0_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR0_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR1 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR1_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR1_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR1_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR1_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR1_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR2 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR2_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR2_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR2_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR2_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR2_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR3 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR3_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR3_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR3_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR3_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR3_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR4 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR4_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR4_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR4_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR4_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR4_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR5 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR5_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR5_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR5_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR5_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR5_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR6 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR6_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR6_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR6_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR6_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR6_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR7 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR7_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR7_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR7_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR7_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR7_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR8 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR8_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR8_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR8_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR8_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR8_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR9 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR9_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR9_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR9_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR9_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR9_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR10 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR10_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR10_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR10_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR10_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR10_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR11 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR11_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR11_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR11_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR11_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR11_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR12 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR12_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR12_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR12_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR12_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR12_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR13 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR13_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR13_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR13_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR13_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR13_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR14 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR14_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR14_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR14_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR14_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR14_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR15 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR15_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR15_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR15_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR15_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR15_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR16 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR16_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR16_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR16_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR16_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR16_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR17 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR17_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR17_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR17_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR17_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR17_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR18 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR18_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR18_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR18_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR18_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR18_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR19 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR19_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR19_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR19_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR19_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR19_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR20 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR20_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR20_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR20_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR20_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR20_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR21 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR21_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR21_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR21_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR21_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR21_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR22 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR22_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR22_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR22_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR22_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR22_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR23 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR23_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR23_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR23_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR23_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR23_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR24 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR24_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR24_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR24_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR24_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR24_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR25 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR25_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR25_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR25_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR25_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR25_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR26 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR26_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR26_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR26_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR26_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR26_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR27 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR27_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR27_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR27_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR27_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR27_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR28 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR28_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR28_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR28_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR28_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR28_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR29 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR29_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR29_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR29_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR29_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR29_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR30 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR30_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR30_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR30_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR30_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR30_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR31 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR31_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR31_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR31_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR31_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR31_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR32 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR32_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR32_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR32_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR32_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR32_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CFG2 - Configuration 2 Register */ -/*! @{ */ - -#define ADC_CFG2_JLEFT_MASK (0x100U) -#define ADC_CFG2_JLEFT_SHIFT (8U) -/*! JLEFT - Justified Left Enable register */ -#define ADC_CFG2_JLEFT(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG2_JLEFT_SHIFT)) & ADC_CFG2_JLEFT_MASK) - -#define ADC_CFG2_HS_MASK (0x200U) -#define ADC_CFG2_HS_SHIFT (9U) -/*! HS - High Speed Enable register - * 0b0..High speed conversion mode disabled - * 0b1..High speed conversion mode enabled - */ -#define ADC_CFG2_HS(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG2_HS_SHIFT)) & ADC_CFG2_HS_MASK) - -#define ADC_CFG2_HSEXTRA_MASK (0x400U) -#define ADC_CFG2_HSEXTRA_SHIFT (10U) -/*! HSEXTRA - High Speed Extra register - * 0b0..No extra cycle added - * 0b1..Extra cycle added - */ -#define ADC_CFG2_HSEXTRA(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG2_HSEXTRA_SHIFT)) & ADC_CFG2_HSEXTRA_MASK) - -#define ADC_CFG2_TUNE_MASK (0x3000U) -#define ADC_CFG2_TUNE_SHIFT (12U) -/*! TUNE - Tune Mode register */ -#define ADC_CFG2_TUNE(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG2_TUNE_SHIFT)) & ADC_CFG2_TUNE_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group ADC_Register_Masks */ - - -/* ADC - Peripheral instance base addresses */ -/** Peripheral ADC0 base address */ -#define ADC0_BASE (0x400AF000u) -/** Peripheral ADC0 base pointer */ -#define ADC0 ((ADC_Type *)ADC0_BASE) -/** Array initializer of ADC peripheral base addresses */ -#define ADC_BASE_ADDRS { ADC0_BASE } -/** Array initializer of ADC peripheral base pointers */ -#define ADC_BASE_PTRS { ADC0 } -/** Interrupt vectors for the ADC peripheral type */ -#define ADC_IRQS { ADC0_IRQn } -/* Backward compatibility */ -#define ADC_CTRL_RSTFIFO_MASK ADC_CTRL_RSTFIFO0_MASK -#define ADC_CTRL_RSTFIFO_SHIFT ADC_CTRL_RSTFIFO0_SHIFT -#define ADC_CTRL_RSTFIFO(x) ADC_CTRL_RSTFIFO0(x) -#define ADC_STAT_RDY_MASK ADC_STAT_RDY0_MASK -#define ADC_STAT_RDY_SHIFT ADC_STAT_RDY0_SHIFT -#define ADC_STAT_RDY(x) ADC_STAT_RDY0(x) -#define ADC_STAT_FOF_MASK ADC_STAT_FOF0_MASK -#define ADC_STAT_FOF_SHIFT ADC_STAT_FOF0_SHIFT -#define ADC_STAT_FOF(x) ADC_STAT_FOF0(x) -#define ADC_IE_FWMIE_MASK ADC_IE_FWMIE0_MASK -#define ADC_IE_FWMIE_SHIFT ADC_IE_FWMIE0_SHIFT -#define ADC_IE_FWMIE(x) ADC_IE_FWMIE0(x) -#define ADC_IE_FOFIE_MASK ADC_IE_FOFIE0_MASK -#define ADC_IE_FOFIE_SHIFT ADC_IE_FOFIE0_SHIFT -#define ADC_IE_FOFIE(x) ADC_IE_FOFIE0(x) -#define ADC_DE_FWMDE_MASK ADC_DE_FWMDE0_MASK -#define ADC_DE_FWMDE_SHIFT ADC_DE_FWMDE0_SHIFT -#define ADC_DE_FWMDE(x) ADC_DE_FWMDE0(x) - - -/*! - * @} - */ /* end of group ADC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- AOI Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup AOI_Peripheral_Access_Layer AOI Peripheral Access Layer - * @{ - */ - -/** AOI - Register Layout Typedef */ -typedef struct { - struct { /* offset: 0x0, array step: 0x4 */ - __IO uint16_t BFCRT01; /**< Boolean Function Term 0 and 1 Configuration for EVENT0..Boolean Function Term 0 and 1 Configuration for EVENT3, array offset: 0x0, array step: 0x4 */ - __IO uint16_t BFCRT23; /**< Boolean Function Term 2 and 3 Configuration for EVENT0..Boolean Function Term 2 and 3 Configuration for EVENT3, array offset: 0x2, array step: 0x4 */ - } BFCRT[4]; -} AOI_Type; - -/* ---------------------------------------------------------------------------- - -- AOI Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup AOI_Register_Masks AOI Register Masks - * @{ - */ - -/*! @name BFCRT01 - Boolean Function Term 0 and 1 Configuration for EVENT0..Boolean Function Term 0 and 1 Configuration for EVENT3 */ -/*! @{ */ - -#define AOI_BFCRT01_PT1_DC_MASK (0x3U) -#define AOI_BFCRT01_PT1_DC_SHIFT (0U) -/*! PT1_DC - Product Term 1, Input D Configuration - * 0b00..Force input D to become 0 - * 0b01..Pass input D - * 0b10..Complement input D - * 0b11..Force input D to become 1 - */ -#define AOI_BFCRT01_PT1_DC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT01_PT1_DC_SHIFT)) & AOI_BFCRT01_PT1_DC_MASK) - -#define AOI_BFCRT01_PT1_CC_MASK (0xCU) -#define AOI_BFCRT01_PT1_CC_SHIFT (2U) -/*! PT1_CC - Product Term 1, Input C Configuration - * 0b00..Force input C to become 0 - * 0b01..Pass input C - * 0b10..Complement input C - * 0b11..Force input C to become 1 - */ -#define AOI_BFCRT01_PT1_CC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT01_PT1_CC_SHIFT)) & AOI_BFCRT01_PT1_CC_MASK) - -#define AOI_BFCRT01_PT1_BC_MASK (0x30U) -#define AOI_BFCRT01_PT1_BC_SHIFT (4U) -/*! PT1_BC - Product Term 1, Input B Configuration - * 0b00..Force input B to become 0 - * 0b01..Pass input B - * 0b10..Complement input B - * 0b11..Force input B to become 1 - */ -#define AOI_BFCRT01_PT1_BC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT01_PT1_BC_SHIFT)) & AOI_BFCRT01_PT1_BC_MASK) - -#define AOI_BFCRT01_PT1_AC_MASK (0xC0U) -#define AOI_BFCRT01_PT1_AC_SHIFT (6U) -/*! PT1_AC - Product Term 1, Input A Configuration - * 0b00..Force input A to become 0 - * 0b01..Pass input A - * 0b10..Complement input A - * 0b11..Force input A to become 1 - */ -#define AOI_BFCRT01_PT1_AC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT01_PT1_AC_SHIFT)) & AOI_BFCRT01_PT1_AC_MASK) - -#define AOI_BFCRT01_PT0_DC_MASK (0x300U) -#define AOI_BFCRT01_PT0_DC_SHIFT (8U) -/*! PT0_DC - Product Term 0, Input D Configuration - * 0b00..Force input D to become 0 - * 0b01..Pass input D - * 0b10..Complement input D - * 0b11..Force input D to become 1 - */ -#define AOI_BFCRT01_PT0_DC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT01_PT0_DC_SHIFT)) & AOI_BFCRT01_PT0_DC_MASK) - -#define AOI_BFCRT01_PT0_CC_MASK (0xC00U) -#define AOI_BFCRT01_PT0_CC_SHIFT (10U) -/*! PT0_CC - Product Term 0, Input C Configuration - * 0b00..Force input C to become 0 - * 0b01..Pass input C - * 0b10..Complement input C - * 0b11..Force input C to become 1 - */ -#define AOI_BFCRT01_PT0_CC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT01_PT0_CC_SHIFT)) & AOI_BFCRT01_PT0_CC_MASK) - -#define AOI_BFCRT01_PT0_BC_MASK (0x3000U) -#define AOI_BFCRT01_PT0_BC_SHIFT (12U) -/*! PT0_BC - Product Term 0, Input B Configuration - * 0b00..Force input B to become 0 - * 0b01..Pass input B - * 0b10..Complement input B - * 0b11..Force input B to become 1 - */ -#define AOI_BFCRT01_PT0_BC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT01_PT0_BC_SHIFT)) & AOI_BFCRT01_PT0_BC_MASK) - -#define AOI_BFCRT01_PT0_AC_MASK (0xC000U) -#define AOI_BFCRT01_PT0_AC_SHIFT (14U) -/*! PT0_AC - Product Term 0, Input A Configuration - * 0b00..Force input A to become 0 - * 0b01..Pass input A - * 0b10..Complement input A - * 0b11..Force input A to become 1 - */ -#define AOI_BFCRT01_PT0_AC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT01_PT0_AC_SHIFT)) & AOI_BFCRT01_PT0_AC_MASK) -/*! @} */ - -/* The count of AOI_BFCRT01 */ -#define AOI_BFCRT01_COUNT (4U) - -/*! @name BFCRT23 - Boolean Function Term 2 and 3 Configuration for EVENT0..Boolean Function Term 2 and 3 Configuration for EVENT3 */ -/*! @{ */ - -#define AOI_BFCRT23_PT3_DC_MASK (0x3U) -#define AOI_BFCRT23_PT3_DC_SHIFT (0U) -/*! PT3_DC - Product Term 3, Input D Configuration - * 0b00..Force input D to become 0 - * 0b01..Pass input D - * 0b10..Complement input D - * 0b11..Force input D to become 1 - */ -#define AOI_BFCRT23_PT3_DC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT23_PT3_DC_SHIFT)) & AOI_BFCRT23_PT3_DC_MASK) - -#define AOI_BFCRT23_PT3_CC_MASK (0xCU) -#define AOI_BFCRT23_PT3_CC_SHIFT (2U) -/*! PT3_CC - Product Term 3, Input C Configuration - * 0b00..Force input C to become 0 - * 0b01..Pass input C - * 0b10..Complement input C - * 0b11..Force input C to become 1 - */ -#define AOI_BFCRT23_PT3_CC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT23_PT3_CC_SHIFT)) & AOI_BFCRT23_PT3_CC_MASK) - -#define AOI_BFCRT23_PT3_BC_MASK (0x30U) -#define AOI_BFCRT23_PT3_BC_SHIFT (4U) -/*! PT3_BC - Product Term 3, Input B Configuration - * 0b00..Force input B to become 0 - * 0b01..Pass input B - * 0b10..Complement input B - * 0b11..Force input B to become 1 - */ -#define AOI_BFCRT23_PT3_BC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT23_PT3_BC_SHIFT)) & AOI_BFCRT23_PT3_BC_MASK) - -#define AOI_BFCRT23_PT3_AC_MASK (0xC0U) -#define AOI_BFCRT23_PT3_AC_SHIFT (6U) -/*! PT3_AC - Product Term 3, Input A Configuration - * 0b00..Force input A to become 0 - * 0b01..Pass input A - * 0b10..Complement input A - * 0b11..Force input to become 1 - */ -#define AOI_BFCRT23_PT3_AC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT23_PT3_AC_SHIFT)) & AOI_BFCRT23_PT3_AC_MASK) - -#define AOI_BFCRT23_PT2_DC_MASK (0x300U) -#define AOI_BFCRT23_PT2_DC_SHIFT (8U) -/*! PT2_DC - Product Term 2, Input D Configuration - * 0b00..Force input D to become 0 - * 0b01..Pass input D - * 0b10..Complement input D - * 0b11..Force input D to become 1 - */ -#define AOI_BFCRT23_PT2_DC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT23_PT2_DC_SHIFT)) & AOI_BFCRT23_PT2_DC_MASK) - -#define AOI_BFCRT23_PT2_CC_MASK (0xC00U) -#define AOI_BFCRT23_PT2_CC_SHIFT (10U) -/*! PT2_CC - Product Term 2, Input C Configuration - * 0b00..Force input C to become 0 - * 0b01..Pass input C - * 0b10..Complement input C - * 0b11..Force input C to become 1 - */ -#define AOI_BFCRT23_PT2_CC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT23_PT2_CC_SHIFT)) & AOI_BFCRT23_PT2_CC_MASK) - -#define AOI_BFCRT23_PT2_BC_MASK (0x3000U) -#define AOI_BFCRT23_PT2_BC_SHIFT (12U) -/*! PT2_BC - Product Term 2, Input B Configuration - * 0b00..Force input B to become 0 - * 0b01..Pass input B - * 0b10..Complement input B - * 0b11..Force input B to become 1 - */ -#define AOI_BFCRT23_PT2_BC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT23_PT2_BC_SHIFT)) & AOI_BFCRT23_PT2_BC_MASK) - -#define AOI_BFCRT23_PT2_AC_MASK (0xC000U) -#define AOI_BFCRT23_PT2_AC_SHIFT (14U) -/*! PT2_AC - Product Term 2, Input A Configuration - * 0b00..Force input A to become 0 - * 0b01..Pass input A - * 0b10..Complement input A - * 0b11..Force input A to become 1 - */ -#define AOI_BFCRT23_PT2_AC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT23_PT2_AC_SHIFT)) & AOI_BFCRT23_PT2_AC_MASK) -/*! @} */ - -/* The count of AOI_BFCRT23 */ -#define AOI_BFCRT23_COUNT (4U) - - -/*! - * @} - */ /* end of group AOI_Register_Masks */ - - -/* AOI - Peripheral instance base addresses */ -/** Peripheral AOI0 base address */ -#define AOI0_BASE (0x40089000u) -/** Peripheral AOI0 base pointer */ -#define AOI0 ((AOI_Type *)AOI0_BASE) -/** Array initializer of AOI peripheral base addresses */ -#define AOI_BASE_ADDRS { AOI0_BASE } -/** Array initializer of AOI peripheral base pointers */ -#define AOI_BASE_PTRS { AOI0 } - -/*! - * @} - */ /* end of group AOI_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- CDOG Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CDOG_Peripheral_Access_Layer CDOG Peripheral Access Layer - * @{ - */ - -/** CDOG - Register Layout Typedef */ -typedef struct { - __IO uint32_t CONTROL; /**< Control Register, offset: 0x0 */ - __IO uint32_t RELOAD; /**< Instruction Timer Reload Register, offset: 0x4 */ - __I uint32_t INSTRUCTION_TIMER; /**< Instruction Timer Register, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __I uint32_t STATUS; /**< Status 1 Register, offset: 0x10 */ - __I uint32_t STATUS2; /**< Status 2 Register, offset: 0x14 */ - __IO uint32_t FLAGS; /**< Flags Register, offset: 0x18 */ - __IO uint32_t PERSISTENT; /**< Persistent Data Storage Register, offset: 0x1C */ - __O uint32_t START; /**< START Command Register, offset: 0x20 */ - __O uint32_t STOP; /**< STOP Command Register, offset: 0x24 */ - __O uint32_t RESTART; /**< RESTART Command Register, offset: 0x28 */ - __O uint32_t ADD; /**< ADD Command Register, offset: 0x2C */ - __O uint32_t ADD1; /**< ADD1 Command Register, offset: 0x30 */ - __O uint32_t ADD16; /**< ADD16 Command Register, offset: 0x34 */ - __O uint32_t ADD256; /**< ADD256 Command Register, offset: 0x38 */ - __O uint32_t SUB; /**< SUB Command Register, offset: 0x3C */ - __O uint32_t SUB1; /**< SUB1 Command Register, offset: 0x40 */ - __O uint32_t SUB16; /**< SUB16 Command Register, offset: 0x44 */ - __O uint32_t SUB256; /**< SUB256 Command Register, offset: 0x48 */ - __O uint32_t ASSERT16; /**< ASSERT16 Command Register, offset: 0x4C */ -} CDOG_Type; - -/* ---------------------------------------------------------------------------- - -- CDOG Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CDOG_Register_Masks CDOG Register Masks - * @{ - */ - -/*! @name CONTROL - Control Register */ -/*! @{ */ - -#define CDOG_CONTROL_LOCK_CTRL_MASK (0x3U) -#define CDOG_CONTROL_LOCK_CTRL_SHIFT (0U) -/*! LOCK_CTRL - Lock control - * 0b01..Locked - * 0b10..Unlocked - */ -#define CDOG_CONTROL_LOCK_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_LOCK_CTRL_SHIFT)) & CDOG_CONTROL_LOCK_CTRL_MASK) - -#define CDOG_CONTROL_TIMEOUT_CTRL_MASK (0x1CU) -#define CDOG_CONTROL_TIMEOUT_CTRL_SHIFT (2U) -/*! TIMEOUT_CTRL - TIMEOUT fault control - * 0b100..Disable both reset and interrupt - * 0b001..Enable reset - * 0b010..Enable interrupt - */ -#define CDOG_CONTROL_TIMEOUT_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_TIMEOUT_CTRL_SHIFT)) & CDOG_CONTROL_TIMEOUT_CTRL_MASK) - -#define CDOG_CONTROL_MISCOMPARE_CTRL_MASK (0xE0U) -#define CDOG_CONTROL_MISCOMPARE_CTRL_SHIFT (5U) -/*! MISCOMPARE_CTRL - MISCOMPARE fault control - * 0b100..Disable both reset and interrupt - * 0b001..Enable reset - * 0b010..Enable interrupt - */ -#define CDOG_CONTROL_MISCOMPARE_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_MISCOMPARE_CTRL_SHIFT)) & CDOG_CONTROL_MISCOMPARE_CTRL_MASK) - -#define CDOG_CONTROL_SEQUENCE_CTRL_MASK (0x700U) -#define CDOG_CONTROL_SEQUENCE_CTRL_SHIFT (8U) -/*! SEQUENCE_CTRL - SEQUENCE fault control - * 0b001..Enable reset - * 0b010..Enable interrupt - * 0b100..Disable both reset and interrupt - */ -#define CDOG_CONTROL_SEQUENCE_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_SEQUENCE_CTRL_SHIFT)) & CDOG_CONTROL_SEQUENCE_CTRL_MASK) - -#define CDOG_CONTROL_STATE_CTRL_MASK (0x1C000U) -#define CDOG_CONTROL_STATE_CTRL_SHIFT (14U) -/*! STATE_CTRL - STATE fault control - * 0b001..Enable reset - * 0b010..Enable interrupt - * 0b100..Disable both reset and interrupt - */ -#define CDOG_CONTROL_STATE_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_STATE_CTRL_SHIFT)) & CDOG_CONTROL_STATE_CTRL_MASK) - -#define CDOG_CONTROL_ADDRESS_CTRL_MASK (0xE0000U) -#define CDOG_CONTROL_ADDRESS_CTRL_SHIFT (17U) -/*! ADDRESS_CTRL - ADDRESS fault control - * 0b001..Enable reset - * 0b010..Enable interrupt - * 0b100..Disable both reset and interrupt - */ -#define CDOG_CONTROL_ADDRESS_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_ADDRESS_CTRL_SHIFT)) & CDOG_CONTROL_ADDRESS_CTRL_MASK) - -#define CDOG_CONTROL_IRQ_PAUSE_MASK (0x30000000U) -#define CDOG_CONTROL_IRQ_PAUSE_SHIFT (28U) -/*! IRQ_PAUSE - IRQ pause control - * 0b01..Keep the timer running - * 0b10..Stop the timer - */ -#define CDOG_CONTROL_IRQ_PAUSE(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_IRQ_PAUSE_SHIFT)) & CDOG_CONTROL_IRQ_PAUSE_MASK) - -#define CDOG_CONTROL_DEBUG_HALT_CTRL_MASK (0xC0000000U) -#define CDOG_CONTROL_DEBUG_HALT_CTRL_SHIFT (30U) -/*! DEBUG_HALT_CTRL - DEBUG_HALT control - * 0b01..Keep the timer running - * 0b10..Stop the timer - */ -#define CDOG_CONTROL_DEBUG_HALT_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_DEBUG_HALT_CTRL_SHIFT)) & CDOG_CONTROL_DEBUG_HALT_CTRL_MASK) -/*! @} */ - -/*! @name RELOAD - Instruction Timer Reload Register */ -/*! @{ */ - -#define CDOG_RELOAD_RLOAD_MASK (0xFFFFFFFFU) -#define CDOG_RELOAD_RLOAD_SHIFT (0U) -/*! RLOAD - Instruction Timer reload value */ -#define CDOG_RELOAD_RLOAD(x) (((uint32_t)(((uint32_t)(x)) << CDOG_RELOAD_RLOAD_SHIFT)) & CDOG_RELOAD_RLOAD_MASK) -/*! @} */ - -/*! @name INSTRUCTION_TIMER - Instruction Timer Register */ -/*! @{ */ - -#define CDOG_INSTRUCTION_TIMER_INSTIM_MASK (0xFFFFFFFFU) -#define CDOG_INSTRUCTION_TIMER_INSTIM_SHIFT (0U) -/*! INSTIM - Current value of the Instruction Timer */ -#define CDOG_INSTRUCTION_TIMER_INSTIM(x) (((uint32_t)(((uint32_t)(x)) << CDOG_INSTRUCTION_TIMER_INSTIM_SHIFT)) & CDOG_INSTRUCTION_TIMER_INSTIM_MASK) -/*! @} */ - -/*! @name STATUS - Status 1 Register */ -/*! @{ */ - -#define CDOG_STATUS_NUMTOF_MASK (0xFFU) -#define CDOG_STATUS_NUMTOF_SHIFT (0U) -/*! NUMTOF - Number of TIMEOUT faults since the last POR */ -#define CDOG_STATUS_NUMTOF(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS_NUMTOF_SHIFT)) & CDOG_STATUS_NUMTOF_MASK) - -#define CDOG_STATUS_NUMMISCOMPF_MASK (0xFF00U) -#define CDOG_STATUS_NUMMISCOMPF_SHIFT (8U) -/*! NUMMISCOMPF - Number of MISCOMPARE faults since the last POR */ -#define CDOG_STATUS_NUMMISCOMPF(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS_NUMMISCOMPF_SHIFT)) & CDOG_STATUS_NUMMISCOMPF_MASK) - -#define CDOG_STATUS_NUMILSEQF_MASK (0xFF0000U) -#define CDOG_STATUS_NUMILSEQF_SHIFT (16U) -/*! NUMILSEQF - Number of SEQUENCE faults since the last POR */ -#define CDOG_STATUS_NUMILSEQF(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS_NUMILSEQF_SHIFT)) & CDOG_STATUS_NUMILSEQF_MASK) - -#define CDOG_STATUS_CURST_MASK (0xF0000000U) -#define CDOG_STATUS_CURST_SHIFT (28U) -/*! CURST - Current State */ -#define CDOG_STATUS_CURST(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS_CURST_SHIFT)) & CDOG_STATUS_CURST_MASK) -/*! @} */ - -/*! @name STATUS2 - Status 2 Register */ -/*! @{ */ - -#define CDOG_STATUS2_NUMCNTF_MASK (0xFFU) -#define CDOG_STATUS2_NUMCNTF_SHIFT (0U) -/*! NUMCNTF - Number of CONTROL faults since the last POR */ -#define CDOG_STATUS2_NUMCNTF(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS2_NUMCNTF_SHIFT)) & CDOG_STATUS2_NUMCNTF_MASK) - -#define CDOG_STATUS2_NUMILLSTF_MASK (0xFF00U) -#define CDOG_STATUS2_NUMILLSTF_SHIFT (8U) -/*! NUMILLSTF - Number of STATE faults since the last POR */ -#define CDOG_STATUS2_NUMILLSTF(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS2_NUMILLSTF_SHIFT)) & CDOG_STATUS2_NUMILLSTF_MASK) - -#define CDOG_STATUS2_NUMILLA_MASK (0xFF0000U) -#define CDOG_STATUS2_NUMILLA_SHIFT (16U) -/*! NUMILLA - Number of ADDRESS faults since the last POR */ -#define CDOG_STATUS2_NUMILLA(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS2_NUMILLA_SHIFT)) & CDOG_STATUS2_NUMILLA_MASK) -/*! @} */ - -/*! @name FLAGS - Flags Register */ -/*! @{ */ - -#define CDOG_FLAGS_TO_FLAG_MASK (0x1U) -#define CDOG_FLAGS_TO_FLAG_SHIFT (0U) -/*! TO_FLAG - TIMEOUT fault flag - * 0b0..A TIMEOUT fault has not occurred - * 0b1..A TIMEOUT fault has occurred - */ -#define CDOG_FLAGS_TO_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_TO_FLAG_SHIFT)) & CDOG_FLAGS_TO_FLAG_MASK) - -#define CDOG_FLAGS_MISCOM_FLAG_MASK (0x2U) -#define CDOG_FLAGS_MISCOM_FLAG_SHIFT (1U) -/*! MISCOM_FLAG - MISCOMPARE fault flag - * 0b0..A MISCOMPARE fault has not occurred - * 0b1..A MISCOMPARE fault has occurred - */ -#define CDOG_FLAGS_MISCOM_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_MISCOM_FLAG_SHIFT)) & CDOG_FLAGS_MISCOM_FLAG_MASK) - -#define CDOG_FLAGS_SEQ_FLAG_MASK (0x4U) -#define CDOG_FLAGS_SEQ_FLAG_SHIFT (2U) -/*! SEQ_FLAG - SEQUENCE fault flag - * 0b0..A SEQUENCE fault has not occurred - * 0b1..A SEQUENCE fault has occurred - */ -#define CDOG_FLAGS_SEQ_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_SEQ_FLAG_SHIFT)) & CDOG_FLAGS_SEQ_FLAG_MASK) - -#define CDOG_FLAGS_CNT_FLAG_MASK (0x8U) -#define CDOG_FLAGS_CNT_FLAG_SHIFT (3U) -/*! CNT_FLAG - CONTROL fault flag - * 0b0..A CONTROL fault has not occurred - * 0b1..A CONTROL fault has occurred - */ -#define CDOG_FLAGS_CNT_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_CNT_FLAG_SHIFT)) & CDOG_FLAGS_CNT_FLAG_MASK) - -#define CDOG_FLAGS_STATE_FLAG_MASK (0x10U) -#define CDOG_FLAGS_STATE_FLAG_SHIFT (4U) -/*! STATE_FLAG - STATE fault flag - * 0b0..A STATE fault has not occurred - * 0b1..A STATE fault has occurred - */ -#define CDOG_FLAGS_STATE_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_STATE_FLAG_SHIFT)) & CDOG_FLAGS_STATE_FLAG_MASK) - -#define CDOG_FLAGS_ADDR_FLAG_MASK (0x20U) -#define CDOG_FLAGS_ADDR_FLAG_SHIFT (5U) -/*! ADDR_FLAG - ADDRESS fault flag - * 0b0..An ADDRESS fault has not occurred - * 0b1..An ADDRESS fault has occurred - */ -#define CDOG_FLAGS_ADDR_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_ADDR_FLAG_SHIFT)) & CDOG_FLAGS_ADDR_FLAG_MASK) - -#define CDOG_FLAGS_POR_FLAG_MASK (0x10000U) -#define CDOG_FLAGS_POR_FLAG_SHIFT (16U) -/*! POR_FLAG - Power-on reset flag - * 0b0..A Power-on reset event has not occurred - * 0b1..A Power-on reset event has occurred - */ -#define CDOG_FLAGS_POR_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_POR_FLAG_SHIFT)) & CDOG_FLAGS_POR_FLAG_MASK) -/*! @} */ - -/*! @name PERSISTENT - Persistent Data Storage Register */ -/*! @{ */ - -#define CDOG_PERSISTENT_PERSIS_MASK (0xFFFFFFFFU) -#define CDOG_PERSISTENT_PERSIS_SHIFT (0U) -/*! PERSIS - Persistent Storage */ -#define CDOG_PERSISTENT_PERSIS(x) (((uint32_t)(((uint32_t)(x)) << CDOG_PERSISTENT_PERSIS_SHIFT)) & CDOG_PERSISTENT_PERSIS_MASK) -/*! @} */ - -/*! @name START - START Command Register */ -/*! @{ */ - -#define CDOG_START_STRT_MASK (0xFFFFFFFFU) -#define CDOG_START_STRT_SHIFT (0U) -/*! STRT - Start command */ -#define CDOG_START_STRT(x) (((uint32_t)(((uint32_t)(x)) << CDOG_START_STRT_SHIFT)) & CDOG_START_STRT_MASK) -/*! @} */ - -/*! @name STOP - STOP Command Register */ -/*! @{ */ - -#define CDOG_STOP_STP_MASK (0xFFFFFFFFU) -#define CDOG_STOP_STP_SHIFT (0U) -/*! STP - Stop command */ -#define CDOG_STOP_STP(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STOP_STP_SHIFT)) & CDOG_STOP_STP_MASK) -/*! @} */ - -/*! @name RESTART - RESTART Command Register */ -/*! @{ */ - -#define CDOG_RESTART_RSTRT_MASK (0xFFFFFFFFU) -#define CDOG_RESTART_RSTRT_SHIFT (0U) -/*! RSTRT - Restart command */ -#define CDOG_RESTART_RSTRT(x) (((uint32_t)(((uint32_t)(x)) << CDOG_RESTART_RSTRT_SHIFT)) & CDOG_RESTART_RSTRT_MASK) -/*! @} */ - -/*! @name ADD - ADD Command Register */ -/*! @{ */ - -#define CDOG_ADD_AD_MASK (0xFFFFFFFFU) -#define CDOG_ADD_AD_SHIFT (0U) -/*! AD - ADD Write Value */ -#define CDOG_ADD_AD(x) (((uint32_t)(((uint32_t)(x)) << CDOG_ADD_AD_SHIFT)) & CDOG_ADD_AD_MASK) -/*! @} */ - -/*! @name ADD1 - ADD1 Command Register */ -/*! @{ */ - -#define CDOG_ADD1_AD1_MASK (0xFFFFFFFFU) -#define CDOG_ADD1_AD1_SHIFT (0U) -/*! AD1 - ADD 1 */ -#define CDOG_ADD1_AD1(x) (((uint32_t)(((uint32_t)(x)) << CDOG_ADD1_AD1_SHIFT)) & CDOG_ADD1_AD1_MASK) -/*! @} */ - -/*! @name ADD16 - ADD16 Command Register */ -/*! @{ */ - -#define CDOG_ADD16_AD16_MASK (0xFFFFFFFFU) -#define CDOG_ADD16_AD16_SHIFT (0U) -/*! AD16 - ADD 16 */ -#define CDOG_ADD16_AD16(x) (((uint32_t)(((uint32_t)(x)) << CDOG_ADD16_AD16_SHIFT)) & CDOG_ADD16_AD16_MASK) -/*! @} */ - -/*! @name ADD256 - ADD256 Command Register */ -/*! @{ */ - -#define CDOG_ADD256_AD256_MASK (0xFFFFFFFFU) -#define CDOG_ADD256_AD256_SHIFT (0U) -/*! AD256 - ADD 256 */ -#define CDOG_ADD256_AD256(x) (((uint32_t)(((uint32_t)(x)) << CDOG_ADD256_AD256_SHIFT)) & CDOG_ADD256_AD256_MASK) -/*! @} */ - -/*! @name SUB - SUB Command Register */ -/*! @{ */ - -#define CDOG_SUB_SB_MASK (0xFFFFFFFFU) -#define CDOG_SUB_SB_SHIFT (0U) -/*! SB - Subtract Write Value */ -#define CDOG_SUB_SB(x) (((uint32_t)(((uint32_t)(x)) << CDOG_SUB_SB_SHIFT)) & CDOG_SUB_SB_MASK) -/*! @} */ - -/*! @name SUB1 - SUB1 Command Register */ -/*! @{ */ - -#define CDOG_SUB1_SB1_MASK (0xFFFFFFFFU) -#define CDOG_SUB1_SB1_SHIFT (0U) -/*! SB1 - Subtract 1 */ -#define CDOG_SUB1_SB1(x) (((uint32_t)(((uint32_t)(x)) << CDOG_SUB1_SB1_SHIFT)) & CDOG_SUB1_SB1_MASK) -/*! @} */ - -/*! @name SUB16 - SUB16 Command Register */ -/*! @{ */ - -#define CDOG_SUB16_SB16_MASK (0xFFFFFFFFU) -#define CDOG_SUB16_SB16_SHIFT (0U) -/*! SB16 - Subtract 16 */ -#define CDOG_SUB16_SB16(x) (((uint32_t)(((uint32_t)(x)) << CDOG_SUB16_SB16_SHIFT)) & CDOG_SUB16_SB16_MASK) -/*! @} */ - -/*! @name SUB256 - SUB256 Command Register */ -/*! @{ */ - -#define CDOG_SUB256_SB256_MASK (0xFFFFFFFFU) -#define CDOG_SUB256_SB256_SHIFT (0U) -/*! SB256 - Subtract 256 */ -#define CDOG_SUB256_SB256(x) (((uint32_t)(((uint32_t)(x)) << CDOG_SUB256_SB256_SHIFT)) & CDOG_SUB256_SB256_MASK) -/*! @} */ - -/*! @name ASSERT16 - ASSERT16 Command Register */ -/*! @{ */ - -#define CDOG_ASSERT16_AST16_MASK (0xFFFFFFFFU) -#define CDOG_ASSERT16_AST16_SHIFT (0U) -/*! AST16 - ASSERT16 Command */ -#define CDOG_ASSERT16_AST16(x) (((uint32_t)(((uint32_t)(x)) << CDOG_ASSERT16_AST16_SHIFT)) & CDOG_ASSERT16_AST16_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group CDOG_Register_Masks */ - - -/* CDOG - Peripheral instance base addresses */ -/** Peripheral CDOG base address */ -#define CDOG_BASE (0x40100000u) -/** Peripheral CDOG base pointer */ -#define CDOG ((CDOG_Type *)CDOG_BASE) -/** Array initializer of CDOG peripheral base addresses */ -#define CDOG_BASE_ADDRS { CDOG_BASE } -/** Array initializer of CDOG peripheral base pointers */ -#define CDOG_BASE_PTRS { CDOG } -/** Interrupt vectors for the CDOG peripheral type */ -#define CDOG_IRQS { CDOG0_IRQn } - -/*! - * @} - */ /* end of group CDOG_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- CMC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CMC_Peripheral_Access_Layer CMC Peripheral Access Layer - * @{ - */ - -/** CMC - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - uint8_t RESERVED_0[12]; - __IO uint32_t CKCTRL; /**< Clock Control, offset: 0x10 */ - __IO uint32_t CKSTAT; /**< Clock Status, offset: 0x14 */ - __IO uint32_t PMPROT; /**< Power Mode Protection, offset: 0x18 */ - __O uint32_t GPMCTRL; /**< Global Power Mode Control, offset: 0x1C */ - __IO uint32_t PMCTRL[1]; /**< Power Mode Control, array offset: 0x20, array step: 0x4 */ - uint8_t RESERVED_1[92]; - __I uint32_t SRS; /**< System Reset Status, offset: 0x80 */ - __IO uint32_t RPC; /**< Reset Pin Control, offset: 0x84 */ - __IO uint32_t SSRS; /**< Sticky System Reset Status, offset: 0x88 */ - __IO uint32_t SRIE; /**< System Reset Interrupt Enable, offset: 0x8C */ - __IO uint32_t SRIF; /**< System Reset Interrupt Flag, offset: 0x90 */ - uint8_t RESERVED_2[8]; - __I uint32_t RSTCNT; /**< Reset Count Register, offset: 0x9C */ - __IO uint32_t MR[1]; /**< Mode, array offset: 0xA0, array step: 0x4 */ - uint8_t RESERVED_3[12]; - __IO uint32_t FM[1]; /**< Force Mode, array offset: 0xB0, array step: 0x4 */ - uint8_t RESERVED_4[44]; - __IO uint32_t FLASHCR; /**< Flash Control, offset: 0xE0 */ - uint8_t RESERVED_5[44]; - __IO uint32_t CORECTL; /**< Core Control, offset: 0x110 */ - uint8_t RESERVED_6[12]; - __IO uint32_t DBGCTL; /**< Debug Control, offset: 0x120 */ -} CMC_Type; - -/* ---------------------------------------------------------------------------- - -- CMC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CMC_Register_Masks CMC Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define CMC_VERID_FEATURE_MASK (0xFFFFU) -#define CMC_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number */ -#define CMC_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << CMC_VERID_FEATURE_SHIFT)) & CMC_VERID_FEATURE_MASK) - -#define CMC_VERID_MINOR_MASK (0xFF0000U) -#define CMC_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define CMC_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << CMC_VERID_MINOR_SHIFT)) & CMC_VERID_MINOR_MASK) - -#define CMC_VERID_MAJOR_MASK (0xFF000000U) -#define CMC_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define CMC_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << CMC_VERID_MAJOR_SHIFT)) & CMC_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name CKCTRL - Clock Control */ -/*! @{ */ - -#define CMC_CKCTRL_CKMODE_MASK (0xFU) -#define CMC_CKCTRL_CKMODE_SHIFT (0U) -/*! CKMODE - Clocking Mode - * 0b0000..No clock gating - * 0b1111..Core, platform, and peripheral clocks are gated, and core enters Low-Power mode. - */ -#define CMC_CKCTRL_CKMODE(x) (((uint32_t)(((uint32_t)(x)) << CMC_CKCTRL_CKMODE_SHIFT)) & CMC_CKCTRL_CKMODE_MASK) - -#define CMC_CKCTRL_LOCK_MASK (0x80000000U) -#define CMC_CKCTRL_LOCK_SHIFT (31U) -/*! LOCK - Lock - * 0b0..Allowed - * 0b1..Blocked - */ -#define CMC_CKCTRL_LOCK(x) (((uint32_t)(((uint32_t)(x)) << CMC_CKCTRL_LOCK_SHIFT)) & CMC_CKCTRL_LOCK_MASK) -/*! @} */ - -/*! @name CKSTAT - Clock Status */ -/*! @{ */ - -#define CMC_CKSTAT_CKMODE_MASK (0xFU) -#define CMC_CKSTAT_CKMODE_SHIFT (0U) -/*! CKMODE - Low Power Status - * 0b0000..Core clock not gated - * 0b1111..Core, platform, and peripheral clocks were gated, and power domain entered Low-Power mode - * *.. - */ -#define CMC_CKSTAT_CKMODE(x) (((uint32_t)(((uint32_t)(x)) << CMC_CKSTAT_CKMODE_SHIFT)) & CMC_CKSTAT_CKMODE_MASK) - -#define CMC_CKSTAT_WAKEUP_MASK (0xFF00U) -#define CMC_CKSTAT_WAKEUP_SHIFT (8U) -/*! WAKEUP - Wake-up Source */ -#define CMC_CKSTAT_WAKEUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_CKSTAT_WAKEUP_SHIFT)) & CMC_CKSTAT_WAKEUP_MASK) - -#define CMC_CKSTAT_VALID_MASK (0x80000000U) -#define CMC_CKSTAT_VALID_SHIFT (31U) -/*! VALID - Clock Status Valid - * 0b0..Core clock not gated - * 0b1..Core clock was gated due to Low-Power mode entry - */ -#define CMC_CKSTAT_VALID(x) (((uint32_t)(((uint32_t)(x)) << CMC_CKSTAT_VALID_SHIFT)) & CMC_CKSTAT_VALID_MASK) -/*! @} */ - -/*! @name PMPROT - Power Mode Protection */ -/*! @{ */ - -#define CMC_PMPROT_LPMODE_MASK (0xFU) -#define CMC_PMPROT_LPMODE_SHIFT (0U) -/*! LPMODE - Low-Power Mode - * 0b0000..Not allowed - * 0b0001..Allowed - * 0b0010..Allowed - * 0b0011..Allowed - * 0b0100..Allowed - * 0b0101..Allowed - * 0b0110..Allowed - * 0b0111..Allowed - * 0b1000..Allowed - * 0b1001..Allowed - * 0b1010..Allowed - * 0b1011..Allowed - * 0b1100..Allowed - * 0b1101..Allowed - * 0b1110..Allowed - * 0b1111..Allowed - */ -#define CMC_PMPROT_LPMODE(x) (((uint32_t)(((uint32_t)(x)) << CMC_PMPROT_LPMODE_SHIFT)) & CMC_PMPROT_LPMODE_MASK) - -#define CMC_PMPROT_LOCK_MASK (0x80000000U) -#define CMC_PMPROT_LOCK_SHIFT (31U) -/*! LOCK - Lock Register - * 0b0..Allowed - * 0b1..Blocked - */ -#define CMC_PMPROT_LOCK(x) (((uint32_t)(((uint32_t)(x)) << CMC_PMPROT_LOCK_SHIFT)) & CMC_PMPROT_LOCK_MASK) -/*! @} */ - -/*! @name GPMCTRL - Global Power Mode Control */ -/*! @{ */ - -#define CMC_GPMCTRL_LPMODE_MASK (0xFU) -#define CMC_GPMCTRL_LPMODE_SHIFT (0U) -/*! LPMODE - Low-Power Mode */ -#define CMC_GPMCTRL_LPMODE(x) (((uint32_t)(((uint32_t)(x)) << CMC_GPMCTRL_LPMODE_SHIFT)) & CMC_GPMCTRL_LPMODE_MASK) -/*! @} */ - -/*! @name PMCTRL - Power Mode Control */ -/*! @{ */ - -#define CMC_PMCTRL_LPMODE_MASK (0xFU) -#define CMC_PMCTRL_LPMODE_SHIFT (0U) -/*! LPMODE - Low-Power Mode - * 0b0000..Active/Sleep - * 0b0001..Deep Sleep - * 0b0011..Power Down - * 0b0111..Reserved - * 0b1111..Deep-Power Down - */ -#define CMC_PMCTRL_LPMODE(x) (((uint32_t)(((uint32_t)(x)) << CMC_PMCTRL_LPMODE_SHIFT)) & CMC_PMCTRL_LPMODE_MASK) -/*! @} */ - -/* The count of CMC_PMCTRL */ -#define CMC_PMCTRL_COUNT (1U) - -/*! @name SRS - System Reset Status */ -/*! @{ */ - -#define CMC_SRS_WAKEUP_MASK (0x1U) -#define CMC_SRS_WAKEUP_SHIFT (0U) -/*! WAKEUP - Wake-up Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_WAKEUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_WAKEUP_SHIFT)) & CMC_SRS_WAKEUP_MASK) - -#define CMC_SRS_POR_MASK (0x2U) -#define CMC_SRS_POR_SHIFT (1U) -/*! POR - Power-on Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_POR(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_POR_SHIFT)) & CMC_SRS_POR_MASK) - -#define CMC_SRS_VD_MASK (0x4U) -#define CMC_SRS_VD_SHIFT (2U) -/*! VD - Voltage Detect Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_VD(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_VD_SHIFT)) & CMC_SRS_VD_MASK) - -#define CMC_SRS_WARM_MASK (0x10U) -#define CMC_SRS_WARM_SHIFT (4U) -/*! WARM - Warm Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_WARM(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_WARM_SHIFT)) & CMC_SRS_WARM_MASK) - -#define CMC_SRS_FATAL_MASK (0x20U) -#define CMC_SRS_FATAL_SHIFT (5U) -/*! FATAL - Fatal Reset - * 0b0..Reset was not generated - * 0b1..Reset was generated - */ -#define CMC_SRS_FATAL(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_FATAL_SHIFT)) & CMC_SRS_FATAL_MASK) - -#define CMC_SRS_PIN_MASK (0x100U) -#define CMC_SRS_PIN_SHIFT (8U) -/*! PIN - Pin Reset - * 0b0..Reset was not generated - * 0b1..Reset was generated - */ -#define CMC_SRS_PIN(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_PIN_SHIFT)) & CMC_SRS_PIN_MASK) - -#define CMC_SRS_DAP_MASK (0x200U) -#define CMC_SRS_DAP_SHIFT (9U) -/*! DAP - Debug Access Port Reset - * 0b0..Reset was not generated - * 0b1..Reset was generated - */ -#define CMC_SRS_DAP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_DAP_SHIFT)) & CMC_SRS_DAP_MASK) - -#define CMC_SRS_RSTACK_MASK (0x400U) -#define CMC_SRS_RSTACK_SHIFT (10U) -/*! RSTACK - Reset Timeout - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_RSTACK(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_RSTACK_SHIFT)) & CMC_SRS_RSTACK_MASK) - -#define CMC_SRS_LPACK_MASK (0x800U) -#define CMC_SRS_LPACK_SHIFT (11U) -/*! LPACK - Low Power Acknowledge Timeout Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_LPACK(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_LPACK_SHIFT)) & CMC_SRS_LPACK_MASK) - -#define CMC_SRS_SCG_MASK (0x1000U) -#define CMC_SRS_SCG_SHIFT (12U) -/*! SCG - System Clock Generation Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SRS_SCG(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_SCG_SHIFT)) & CMC_SRS_SCG_MASK) - -#define CMC_SRS_WWDT0_MASK (0x2000U) -#define CMC_SRS_WWDT0_SHIFT (13U) -/*! WWDT0 - Windowed Watchdog 0 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SRS_WWDT0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_WWDT0_SHIFT)) & CMC_SRS_WWDT0_MASK) - -#define CMC_SRS_SW_MASK (0x4000U) -#define CMC_SRS_SW_SHIFT (14U) -/*! SW - Software Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_SW(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_SW_SHIFT)) & CMC_SRS_SW_MASK) - -#define CMC_SRS_LOCKUP_MASK (0x8000U) -#define CMC_SRS_LOCKUP_SHIFT (15U) -/*! LOCKUP - Lockup Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_LOCKUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_LOCKUP_SHIFT)) & CMC_SRS_LOCKUP_MASK) - -#define CMC_SRS_CDOG0_MASK (0x4000000U) -#define CMC_SRS_CDOG0_SHIFT (26U) -/*! CDOG0 - Code Watchdog 0 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SRS_CDOG0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_CDOG0_SHIFT)) & CMC_SRS_CDOG0_MASK) - -#define CMC_SRS_JTAG_MASK (0x10000000U) -#define CMC_SRS_JTAG_SHIFT (28U) -/*! JTAG - JTAG System Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_JTAG(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_JTAG_SHIFT)) & CMC_SRS_JTAG_MASK) -/*! @} */ - -/*! @name RPC - Reset Pin Control */ -/*! @{ */ - -#define CMC_RPC_FILTCFG_MASK (0x1FU) -#define CMC_RPC_FILTCFG_SHIFT (0U) -/*! FILTCFG - Reset Filter Configuration */ -#define CMC_RPC_FILTCFG(x) (((uint32_t)(((uint32_t)(x)) << CMC_RPC_FILTCFG_SHIFT)) & CMC_RPC_FILTCFG_MASK) - -#define CMC_RPC_FILTEN_MASK (0x100U) -#define CMC_RPC_FILTEN_SHIFT (8U) -/*! FILTEN - Filter Enable - * 0b0..Disables - * 0b1..Enables - */ -#define CMC_RPC_FILTEN(x) (((uint32_t)(((uint32_t)(x)) << CMC_RPC_FILTEN_SHIFT)) & CMC_RPC_FILTEN_MASK) - -#define CMC_RPC_LPFEN_MASK (0x200U) -#define CMC_RPC_LPFEN_SHIFT (9U) -/*! LPFEN - Low-Power Filter Enable - * 0b0..Disables - * 0b1..Enables - */ -#define CMC_RPC_LPFEN(x) (((uint32_t)(((uint32_t)(x)) << CMC_RPC_LPFEN_SHIFT)) & CMC_RPC_LPFEN_MASK) -/*! @} */ - -/*! @name SSRS - Sticky System Reset Status */ -/*! @{ */ - -#define CMC_SSRS_WAKEUP_MASK (0x1U) -#define CMC_SSRS_WAKEUP_SHIFT (0U) -/*! WAKEUP - Wake-up Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_WAKEUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_WAKEUP_SHIFT)) & CMC_SSRS_WAKEUP_MASK) - -#define CMC_SSRS_POR_MASK (0x2U) -#define CMC_SSRS_POR_SHIFT (1U) -/*! POR - Power-on Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_POR(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_POR_SHIFT)) & CMC_SSRS_POR_MASK) - -#define CMC_SSRS_VD_MASK (0x4U) -#define CMC_SSRS_VD_SHIFT (2U) -/*! VD - Voltage Detect Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_VD(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_VD_SHIFT)) & CMC_SSRS_VD_MASK) - -#define CMC_SSRS_WARM_MASK (0x10U) -#define CMC_SSRS_WARM_SHIFT (4U) -/*! WARM - Warm Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_WARM(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_WARM_SHIFT)) & CMC_SSRS_WARM_MASK) - -#define CMC_SSRS_FATAL_MASK (0x20U) -#define CMC_SSRS_FATAL_SHIFT (5U) -/*! FATAL - Fatal Reset - * 0b0..Reset was not generated - * 0b1..Reset was generated - */ -#define CMC_SSRS_FATAL(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_FATAL_SHIFT)) & CMC_SSRS_FATAL_MASK) - -#define CMC_SSRS_PIN_MASK (0x100U) -#define CMC_SSRS_PIN_SHIFT (8U) -/*! PIN - Pin Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_PIN(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_PIN_SHIFT)) & CMC_SSRS_PIN_MASK) - -#define CMC_SSRS_DAP_MASK (0x200U) -#define CMC_SSRS_DAP_SHIFT (9U) -/*! DAP - DAP Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_DAP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_DAP_SHIFT)) & CMC_SSRS_DAP_MASK) - -#define CMC_SSRS_RSTACK_MASK (0x400U) -#define CMC_SSRS_RSTACK_SHIFT (10U) -/*! RSTACK - Reset Timeout - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_RSTACK(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_RSTACK_SHIFT)) & CMC_SSRS_RSTACK_MASK) - -#define CMC_SSRS_LPACK_MASK (0x800U) -#define CMC_SSRS_LPACK_SHIFT (11U) -/*! LPACK - Low Power Acknowledge Timeout Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_LPACK(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_LPACK_SHIFT)) & CMC_SSRS_LPACK_MASK) - -#define CMC_SSRS_SCG_MASK (0x1000U) -#define CMC_SSRS_SCG_SHIFT (12U) -/*! SCG - System Clock Generation Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SSRS_SCG(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_SCG_SHIFT)) & CMC_SSRS_SCG_MASK) - -#define CMC_SSRS_WWDT0_MASK (0x2000U) -#define CMC_SSRS_WWDT0_SHIFT (13U) -/*! WWDT0 - Windowed Watchdog 0 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SSRS_WWDT0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_WWDT0_SHIFT)) & CMC_SSRS_WWDT0_MASK) - -#define CMC_SSRS_SW_MASK (0x4000U) -#define CMC_SSRS_SW_SHIFT (14U) -/*! SW - Software Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_SW(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_SW_SHIFT)) & CMC_SSRS_SW_MASK) - -#define CMC_SSRS_LOCKUP_MASK (0x8000U) -#define CMC_SSRS_LOCKUP_SHIFT (15U) -/*! LOCKUP - Lockup Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_LOCKUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_LOCKUP_SHIFT)) & CMC_SSRS_LOCKUP_MASK) - -#define CMC_SSRS_CDOG0_MASK (0x4000000U) -#define CMC_SSRS_CDOG0_SHIFT (26U) -/*! CDOG0 - Code Watchdog 0 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SSRS_CDOG0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_CDOG0_SHIFT)) & CMC_SSRS_CDOG0_MASK) - -#define CMC_SSRS_JTAG_MASK (0x10000000U) -#define CMC_SSRS_JTAG_SHIFT (28U) -/*! JTAG - JTAG System Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_JTAG(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_JTAG_SHIFT)) & CMC_SSRS_JTAG_MASK) -/*! @} */ - -/*! @name SRIE - System Reset Interrupt Enable */ -/*! @{ */ - -#define CMC_SRIE_PIN_MASK (0x100U) -#define CMC_SRIE_PIN_SHIFT (8U) -/*! PIN - Pin Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_PIN(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_PIN_SHIFT)) & CMC_SRIE_PIN_MASK) - -#define CMC_SRIE_DAP_MASK (0x200U) -#define CMC_SRIE_DAP_SHIFT (9U) -/*! DAP - DAP Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_DAP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_DAP_SHIFT)) & CMC_SRIE_DAP_MASK) - -#define CMC_SRIE_LPACK_MASK (0x800U) -#define CMC_SRIE_LPACK_SHIFT (11U) -/*! LPACK - Low Power Acknowledge Timeout Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_LPACK(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_LPACK_SHIFT)) & CMC_SRIE_LPACK_MASK) - -#define CMC_SRIE_SCG_MASK (0x1000U) -#define CMC_SRIE_SCG_SHIFT (12U) -/*! SCG - System Clock Generation Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_SCG(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_SCG_SHIFT)) & CMC_SRIE_SCG_MASK) - -#define CMC_SRIE_WWDT0_MASK (0x2000U) -#define CMC_SRIE_WWDT0_SHIFT (13U) -/*! WWDT0 - Windowed Watchdog 0 Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_WWDT0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_WWDT0_SHIFT)) & CMC_SRIE_WWDT0_MASK) - -#define CMC_SRIE_SW_MASK (0x4000U) -#define CMC_SRIE_SW_SHIFT (14U) -/*! SW - Software Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_SW(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_SW_SHIFT)) & CMC_SRIE_SW_MASK) - -#define CMC_SRIE_LOCKUP_MASK (0x8000U) -#define CMC_SRIE_LOCKUP_SHIFT (15U) -/*! LOCKUP - Lockup Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_LOCKUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_LOCKUP_SHIFT)) & CMC_SRIE_LOCKUP_MASK) - -#define CMC_SRIE_CDOG0_MASK (0x4000000U) -#define CMC_SRIE_CDOG0_SHIFT (26U) -/*! CDOG0 - Code Watchdog 0 Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_CDOG0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_CDOG0_SHIFT)) & CMC_SRIE_CDOG0_MASK) -/*! @} */ - -/*! @name SRIF - System Reset Interrupt Flag */ -/*! @{ */ - -#define CMC_SRIF_PIN_MASK (0x100U) -#define CMC_SRIF_PIN_SHIFT (8U) -/*! PIN - Pin Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_PIN(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_PIN_SHIFT)) & CMC_SRIF_PIN_MASK) - -#define CMC_SRIF_DAP_MASK (0x200U) -#define CMC_SRIF_DAP_SHIFT (9U) -/*! DAP - DAP Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_DAP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_DAP_SHIFT)) & CMC_SRIF_DAP_MASK) - -#define CMC_SRIF_LPACK_MASK (0x800U) -#define CMC_SRIF_LPACK_SHIFT (11U) -/*! LPACK - Low Power Acknowledge Timeout Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_LPACK(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_LPACK_SHIFT)) & CMC_SRIF_LPACK_MASK) - -#define CMC_SRIF_WWDT0_MASK (0x2000U) -#define CMC_SRIF_WWDT0_SHIFT (13U) -/*! WWDT0 - Windowed Watchdog 0 Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_WWDT0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_WWDT0_SHIFT)) & CMC_SRIF_WWDT0_MASK) - -#define CMC_SRIF_SW_MASK (0x4000U) -#define CMC_SRIF_SW_SHIFT (14U) -/*! SW - Software Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_SW(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_SW_SHIFT)) & CMC_SRIF_SW_MASK) - -#define CMC_SRIF_LOCKUP_MASK (0x8000U) -#define CMC_SRIF_LOCKUP_SHIFT (15U) -/*! LOCKUP - Lockup Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_LOCKUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_LOCKUP_SHIFT)) & CMC_SRIF_LOCKUP_MASK) - -#define CMC_SRIF_CDOG0_MASK (0x4000000U) -#define CMC_SRIF_CDOG0_SHIFT (26U) -/*! CDOG0 - Code Watchdog 0 Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_CDOG0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_CDOG0_SHIFT)) & CMC_SRIF_CDOG0_MASK) -/*! @} */ - -/*! @name RSTCNT - Reset Count Register */ -/*! @{ */ - -#define CMC_RSTCNT_COUNT_MASK (0xFFU) -#define CMC_RSTCNT_COUNT_SHIFT (0U) -/*! COUNT - Count */ -#define CMC_RSTCNT_COUNT(x) (((uint32_t)(((uint32_t)(x)) << CMC_RSTCNT_COUNT_SHIFT)) & CMC_RSTCNT_COUNT_MASK) -/*! @} */ - -/*! @name MR - Mode */ -/*! @{ */ - -#define CMC_MR_ISPMODE_n_MASK (0x1U) -#define CMC_MR_ISPMODE_n_SHIFT (0U) -/*! ISPMODE_n - In System Programming Mode */ -#define CMC_MR_ISPMODE_n(x) (((uint32_t)(((uint32_t)(x)) << CMC_MR_ISPMODE_n_SHIFT)) & CMC_MR_ISPMODE_n_MASK) -/*! @} */ - -/* The count of CMC_MR */ -#define CMC_MR_COUNT (1U) - -/*! @name FM - Force Mode */ -/*! @{ */ - -#define CMC_FM_FORCECFG_MASK (0x1U) -#define CMC_FM_FORCECFG_SHIFT (0U) -/*! FORCECFG - Boot Configuration - * 0b0..No effect - * 0b1..Asserts - */ -#define CMC_FM_FORCECFG(x) (((uint32_t)(((uint32_t)(x)) << CMC_FM_FORCECFG_SHIFT)) & CMC_FM_FORCECFG_MASK) -/*! @} */ - -/* The count of CMC_FM */ -#define CMC_FM_COUNT (1U) - -/*! @name FLASHCR - Flash Control */ -/*! @{ */ - -#define CMC_FLASHCR_FLASHDIS_MASK (0x1U) -#define CMC_FLASHCR_FLASHDIS_SHIFT (0U) -/*! FLASHDIS - Flash Disable - * 0b0..No effect - * 0b1..Flash memory is disabled - */ -#define CMC_FLASHCR_FLASHDIS(x) (((uint32_t)(((uint32_t)(x)) << CMC_FLASHCR_FLASHDIS_SHIFT)) & CMC_FLASHCR_FLASHDIS_MASK) - -#define CMC_FLASHCR_FLASHDOZE_MASK (0x2U) -#define CMC_FLASHCR_FLASHDOZE_SHIFT (1U) -/*! FLASHDOZE - Flash Doze - * 0b0..No effect - * 0b1..Flash memory is disabled when core is sleeping (CKMODE > 0) - */ -#define CMC_FLASHCR_FLASHDOZE(x) (((uint32_t)(((uint32_t)(x)) << CMC_FLASHCR_FLASHDOZE_SHIFT)) & CMC_FLASHCR_FLASHDOZE_MASK) - -#define CMC_FLASHCR_FLASHWAKE_MASK (0x4U) -#define CMC_FLASHCR_FLASHWAKE_SHIFT (2U) -/*! FLASHWAKE - Flash Wake - * 0b0..No effect - * 0b1..Flash memory is not disabled during flash memory accesses - */ -#define CMC_FLASHCR_FLASHWAKE(x) (((uint32_t)(((uint32_t)(x)) << CMC_FLASHCR_FLASHWAKE_SHIFT)) & CMC_FLASHCR_FLASHWAKE_MASK) -/*! @} */ - -/*! @name CORECTL - Core Control */ -/*! @{ */ - -#define CMC_CORECTL_NPIE_MASK (0x1U) -#define CMC_CORECTL_NPIE_SHIFT (0U) -/*! NPIE - Non-maskable Pin Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define CMC_CORECTL_NPIE(x) (((uint32_t)(((uint32_t)(x)) << CMC_CORECTL_NPIE_SHIFT)) & CMC_CORECTL_NPIE_MASK) -/*! @} */ - -/*! @name DBGCTL - Debug Control */ -/*! @{ */ - -#define CMC_DBGCTL_SOD_MASK (0x1U) -#define CMC_DBGCTL_SOD_SHIFT (0U) -/*! SOD - Sleep Or Debug - * 0b0..Remains enabled - * 0b1..Disabled - */ -#define CMC_DBGCTL_SOD(x) (((uint32_t)(((uint32_t)(x)) << CMC_DBGCTL_SOD_SHIFT)) & CMC_DBGCTL_SOD_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group CMC_Register_Masks */ - - -/* CMC - Peripheral instance base addresses */ -/** Peripheral CMC base address */ -#define CMC_BASE (0x4008B000u) -/** Peripheral CMC base pointer */ -#define CMC ((CMC_Type *)CMC_BASE) -/** Array initializer of CMC peripheral base addresses */ -#define CMC_BASE_ADDRS { CMC_BASE } -/** Array initializer of CMC peripheral base pointers */ -#define CMC_BASE_PTRS { CMC } - -/*! - * @} - */ /* end of group CMC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- CRC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CRC_Peripheral_Access_Layer CRC Peripheral Access Layer - * @{ - */ - -/** CRC - Register Layout Typedef */ -typedef struct { - union { /* offset: 0x0 */ - struct { /* offset: 0x0 */ - __IO uint8_t DATALL; /**< CRC_DATALL register, offset: 0x0 */ - __IO uint8_t DATALU; /**< CRC_DATALU register, offset: 0x1 */ - __IO uint8_t DATAHL; /**< CRC_DATAHL register, offset: 0x2 */ - __IO uint8_t DATAHU; /**< CRC_DATAHU register, offset: 0x3 */ - } ACCESS8BIT; - struct { /* offset: 0x0 */ - __IO uint16_t DATAL; /**< CRC_DATAL register, offset: 0x0 */ - __IO uint16_t DATAH; /**< CRC_DATAH register, offset: 0x2 */ - } ACCESS16BIT; - __IO uint32_t DATA; /**< CRC Data, offset: 0x0 */ - }; - union { /* offset: 0x4 */ - struct { /* offset: 0x4 */ - __IO uint8_t GPOLYLL; /**< CRC_GPOLYLL register, offset: 0x4 */ - __IO uint8_t GPOLYLU; /**< CRC_GPOLYLU register, offset: 0x5 */ - __IO uint8_t GPOLYHL; /**< CRC_GPOLYHL register, offset: 0x6 */ - __IO uint8_t GPOLYHU; /**< CRC_GPOLYHU register, offset: 0x7 */ - } GPOLY_ACCESS8BIT; - struct { /* offset: 0x4 */ - __IO uint16_t GPOLYL; /**< CRC_GPOLYL register, offset: 0x4 */ - __IO uint16_t GPOLYH; /**< CRC_GPOLYH register, offset: 0x6 */ - } GPOLY_ACCESS16BIT; - __IO uint32_t GPOLY; /**< CRC Polynomial, offset: 0x4 */ - }; - union { /* offset: 0x8 */ - struct { /* offset: 0x8 */ - uint8_t RESERVED_0[3]; - __IO uint8_t CTRLHU; /**< CRC_CTRLHU register, offset: 0xB */ - } CTRL_ACCESS8BIT; - __IO uint32_t CTRL; /**< CRC Control, offset: 0x8 */ - }; -} CRC_Type; - -/* ---------------------------------------------------------------------------- - -- CRC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CRC_Register_Masks CRC Register Masks - * @{ - */ - -/*! @name DATALL - CRC_DATALL register */ -/*! @{ */ - -#define CRC_DATALL_DATALL_MASK (0xFFU) -#define CRC_DATALL_DATALL_SHIFT (0U) -#define CRC_DATALL_DATALL(x) (((uint8_t)(((uint8_t)(x)) << CRC_DATALL_DATALL_SHIFT)) & CRC_DATALL_DATALL_MASK) -/*! @} */ - -/*! @name DATALU - CRC_DATALU register */ -/*! @{ */ - -#define CRC_DATALU_DATALU_MASK (0xFFU) -#define CRC_DATALU_DATALU_SHIFT (0U) -#define CRC_DATALU_DATALU(x) (((uint8_t)(((uint8_t)(x)) << CRC_DATALU_DATALU_SHIFT)) & CRC_DATALU_DATALU_MASK) -/*! @} */ - -/*! @name DATAHL - CRC_DATAHL register */ -/*! @{ */ - -#define CRC_DATAHL_DATAHL_MASK (0xFFU) -#define CRC_DATAHL_DATAHL_SHIFT (0U) -#define CRC_DATAHL_DATAHL(x) (((uint8_t)(((uint8_t)(x)) << CRC_DATAHL_DATAHL_SHIFT)) & CRC_DATAHL_DATAHL_MASK) -/*! @} */ - -/*! @name DATAHU - CRC_DATAHU register */ -/*! @{ */ - -#define CRC_DATAHU_DATAHU_MASK (0xFFU) -#define CRC_DATAHU_DATAHU_SHIFT (0U) -#define CRC_DATAHU_DATAHU(x) (((uint8_t)(((uint8_t)(x)) << CRC_DATAHU_DATAHU_SHIFT)) & CRC_DATAHU_DATAHU_MASK) -/*! @} */ - -/*! @name DATAL - CRC_DATAL register */ -/*! @{ */ - -#define CRC_DATAL_DATAL_MASK (0xFFFFU) -#define CRC_DATAL_DATAL_SHIFT (0U) -#define CRC_DATAL_DATAL(x) (((uint16_t)(((uint16_t)(x)) << CRC_DATAL_DATAL_SHIFT)) & CRC_DATAL_DATAL_MASK) -/*! @} */ - -/*! @name DATAH - CRC_DATAH register */ -/*! @{ */ - -#define CRC_DATAH_DATAH_MASK (0xFFFFU) -#define CRC_DATAH_DATAH_SHIFT (0U) -#define CRC_DATAH_DATAH(x) (((uint16_t)(((uint16_t)(x)) << CRC_DATAH_DATAH_SHIFT)) & CRC_DATAH_DATAH_MASK) -/*! @} */ - -/*! @name DATA - CRC Data */ -/*! @{ */ - -#define CRC_DATA_LL_MASK (0xFFU) -#define CRC_DATA_LL_SHIFT (0U) -/*! LL - CRC Low Lower Byte */ -#define CRC_DATA_LL(x) (((uint32_t)(((uint32_t)(x)) << CRC_DATA_LL_SHIFT)) & CRC_DATA_LL_MASK) - -#define CRC_DATA_LU_MASK (0xFF00U) -#define CRC_DATA_LU_SHIFT (8U) -/*! LU - CRC Low Upper Byte */ -#define CRC_DATA_LU(x) (((uint32_t)(((uint32_t)(x)) << CRC_DATA_LU_SHIFT)) & CRC_DATA_LU_MASK) - -#define CRC_DATA_HL_MASK (0xFF0000U) -#define CRC_DATA_HL_SHIFT (16U) -/*! HL - CRC High Lower Byte */ -#define CRC_DATA_HL(x) (((uint32_t)(((uint32_t)(x)) << CRC_DATA_HL_SHIFT)) & CRC_DATA_HL_MASK) - -#define CRC_DATA_HU_MASK (0xFF000000U) -#define CRC_DATA_HU_SHIFT (24U) -/*! HU - CRC High Upper Byte */ -#define CRC_DATA_HU(x) (((uint32_t)(((uint32_t)(x)) << CRC_DATA_HU_SHIFT)) & CRC_DATA_HU_MASK) -/*! @} */ - -/*! @name GPOLYLL - CRC_GPOLYLL register */ -/*! @{ */ - -#define CRC_GPOLYLL_GPOLYLL_MASK (0xFFU) -#define CRC_GPOLYLL_GPOLYLL_SHIFT (0U) -#define CRC_GPOLYLL_GPOLYLL(x) (((uint8_t)(((uint8_t)(x)) << CRC_GPOLYLL_GPOLYLL_SHIFT)) & CRC_GPOLYLL_GPOLYLL_MASK) -/*! @} */ - -/*! @name GPOLYLU - CRC_GPOLYLU register */ -/*! @{ */ - -#define CRC_GPOLYLU_GPOLYLU_MASK (0xFFU) -#define CRC_GPOLYLU_GPOLYLU_SHIFT (0U) -#define CRC_GPOLYLU_GPOLYLU(x) (((uint8_t)(((uint8_t)(x)) << CRC_GPOLYLU_GPOLYLU_SHIFT)) & CRC_GPOLYLU_GPOLYLU_MASK) -/*! @} */ - -/*! @name GPOLYHL - CRC_GPOLYHL register */ -/*! @{ */ - -#define CRC_GPOLYHL_GPOLYHL_MASK (0xFFU) -#define CRC_GPOLYHL_GPOLYHL_SHIFT (0U) -#define CRC_GPOLYHL_GPOLYHL(x) (((uint8_t)(((uint8_t)(x)) << CRC_GPOLYHL_GPOLYHL_SHIFT)) & CRC_GPOLYHL_GPOLYHL_MASK) -/*! @} */ - -/*! @name GPOLYHU - CRC_GPOLYHU register */ -/*! @{ */ - -#define CRC_GPOLYHU_GPOLYHU_MASK (0xFFU) -#define CRC_GPOLYHU_GPOLYHU_SHIFT (0U) -#define CRC_GPOLYHU_GPOLYHU(x) (((uint8_t)(((uint8_t)(x)) << CRC_GPOLYHU_GPOLYHU_SHIFT)) & CRC_GPOLYHU_GPOLYHU_MASK) -/*! @} */ - -/*! @name GPOLYL - CRC_GPOLYL register */ -/*! @{ */ - -#define CRC_GPOLYL_GPOLYL_MASK (0xFFFFU) -#define CRC_GPOLYL_GPOLYL_SHIFT (0U) -#define CRC_GPOLYL_GPOLYL(x) (((uint16_t)(((uint16_t)(x)) << CRC_GPOLYL_GPOLYL_SHIFT)) & CRC_GPOLYL_GPOLYL_MASK) -/*! @} */ - -/*! @name GPOLYH - CRC_GPOLYH register */ -/*! @{ */ - -#define CRC_GPOLYH_GPOLYH_MASK (0xFFFFU) -#define CRC_GPOLYH_GPOLYH_SHIFT (0U) -#define CRC_GPOLYH_GPOLYH(x) (((uint16_t)(((uint16_t)(x)) << CRC_GPOLYH_GPOLYH_SHIFT)) & CRC_GPOLYH_GPOLYH_MASK) -/*! @} */ - -/*! @name GPOLY - CRC Polynomial */ -/*! @{ */ - -#define CRC_GPOLY_LOW_MASK (0xFFFFU) -#define CRC_GPOLY_LOW_SHIFT (0U) -/*! LOW - Low Polynomial Half-Word */ -#define CRC_GPOLY_LOW(x) (((uint32_t)(((uint32_t)(x)) << CRC_GPOLY_LOW_SHIFT)) & CRC_GPOLY_LOW_MASK) - -#define CRC_GPOLY_HIGH_MASK (0xFFFF0000U) -#define CRC_GPOLY_HIGH_SHIFT (16U) -/*! HIGH - High Polynomial Half-Word */ -#define CRC_GPOLY_HIGH(x) (((uint32_t)(((uint32_t)(x)) << CRC_GPOLY_HIGH_SHIFT)) & CRC_GPOLY_HIGH_MASK) -/*! @} */ - -/*! @name CTRLHU - CRC_CTRLHU register */ -/*! @{ */ - -#define CRC_CTRLHU_TCRC_MASK (0x1U) -#define CRC_CTRLHU_TCRC_SHIFT (0U) -/*! TCRC - TCRC - * 0b0..16-bit - * 0b1..32-bit - */ -#define CRC_CTRLHU_TCRC(x) (((uint8_t)(((uint8_t)(x)) << CRC_CTRLHU_TCRC_SHIFT)) & CRC_CTRLHU_TCRC_MASK) - -#define CRC_CTRLHU_WAS_MASK (0x2U) -#define CRC_CTRLHU_WAS_SHIFT (1U) -/*! WAS - Write as Seed - * 0b0..Data values - * 0b1..Seed values - */ -#define CRC_CTRLHU_WAS(x) (((uint8_t)(((uint8_t)(x)) << CRC_CTRLHU_WAS_SHIFT)) & CRC_CTRLHU_WAS_MASK) - -#define CRC_CTRLHU_FXOR_MASK (0x4U) -#define CRC_CTRLHU_FXOR_SHIFT (2U) -/*! FXOR - Complement Read of CRC Data Register - * 0b0..No XOR on reading - * 0b1..Inverts or complements the read value of the CRC Data - */ -#define CRC_CTRLHU_FXOR(x) (((uint8_t)(((uint8_t)(x)) << CRC_CTRLHU_FXOR_SHIFT)) & CRC_CTRLHU_FXOR_MASK) - -#define CRC_CTRLHU_TOTR_MASK (0x30U) -#define CRC_CTRLHU_TOTR_SHIFT (4U) -/*! TOTR - Transpose Type for Read - * 0b00..No transposition - * 0b01..Bits in bytes are transposed; bytes are not transposed - * 0b10..Both bits in bytes and bytes are transposed - * 0b11..Only bytes are transposed; no bits in a byte are transposed - */ -#define CRC_CTRLHU_TOTR(x) (((uint8_t)(((uint8_t)(x)) << CRC_CTRLHU_TOTR_SHIFT)) & CRC_CTRLHU_TOTR_MASK) - -#define CRC_CTRLHU_TOT_MASK (0xC0U) -#define CRC_CTRLHU_TOT_SHIFT (6U) -/*! TOT - Transpose Type for Writes - * 0b00..No transposition - * 0b01..Bits in bytes are transposed; bytes are not transposed - * 0b10..Both bits in bytes and bytes are transposed - * 0b11..Only bytes are transposed; no bits in a byte are transposed - */ -#define CRC_CTRLHU_TOT(x) (((uint8_t)(((uint8_t)(x)) << CRC_CTRLHU_TOT_SHIFT)) & CRC_CTRLHU_TOT_MASK) -/*! @} */ - -/*! @name CTRL - CRC Control */ -/*! @{ */ - -#define CRC_CTRL_TCRC_MASK (0x1000000U) -#define CRC_CTRL_TCRC_SHIFT (24U) -/*! TCRC - TCRC - * 0b0..16-bit - * 0b1..32-bit - */ -#define CRC_CTRL_TCRC(x) (((uint32_t)(((uint32_t)(x)) << CRC_CTRL_TCRC_SHIFT)) & CRC_CTRL_TCRC_MASK) - -#define CRC_CTRL_WAS_MASK (0x2000000U) -#define CRC_CTRL_WAS_SHIFT (25U) -/*! WAS - Write as Seed - * 0b0..Data values - * 0b1..Seed values - */ -#define CRC_CTRL_WAS(x) (((uint32_t)(((uint32_t)(x)) << CRC_CTRL_WAS_SHIFT)) & CRC_CTRL_WAS_MASK) - -#define CRC_CTRL_FXOR_MASK (0x4000000U) -#define CRC_CTRL_FXOR_SHIFT (26U) -/*! FXOR - Complement Read of CRC Data Register - * 0b0..No XOR on reading - * 0b1..Inverts or complements the read value of the CRC Data - */ -#define CRC_CTRL_FXOR(x) (((uint32_t)(((uint32_t)(x)) << CRC_CTRL_FXOR_SHIFT)) & CRC_CTRL_FXOR_MASK) - -#define CRC_CTRL_TOTR_MASK (0x30000000U) -#define CRC_CTRL_TOTR_SHIFT (28U) -/*! TOTR - Transpose Type for Read - * 0b00..No transposition - * 0b01..Bits in bytes are transposed; bytes are not transposed - * 0b10..Both bits in bytes and bytes are transposed - * 0b11..Only bytes are transposed; no bits in a byte are transposed - */ -#define CRC_CTRL_TOTR(x) (((uint32_t)(((uint32_t)(x)) << CRC_CTRL_TOTR_SHIFT)) & CRC_CTRL_TOTR_MASK) - -#define CRC_CTRL_TOT_MASK (0xC0000000U) -#define CRC_CTRL_TOT_SHIFT (30U) -/*! TOT - Transpose Type for Writes - * 0b00..No transposition - * 0b01..Bits in bytes are transposed; bytes are not transposed - * 0b10..Both bits in bytes and bytes are transposed - * 0b11..Only bytes are transposed; no bits in a byte are transposed - */ -#define CRC_CTRL_TOT(x) (((uint32_t)(((uint32_t)(x)) << CRC_CTRL_TOT_SHIFT)) & CRC_CTRL_TOT_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group CRC_Register_Masks */ - - -/* CRC - Peripheral instance base addresses */ -/** Peripheral CRC0 base address */ -#define CRC0_BASE (0x4008A000u) -/** Peripheral CRC0 base pointer */ -#define CRC0 ((CRC_Type *)CRC0_BASE) -/** Array initializer of CRC peripheral base addresses */ -#define CRC_BASE_ADDRS { CRC0_BASE } -/** Array initializer of CRC peripheral base pointers */ -#define CRC_BASE_PTRS { CRC0 } - -/*! - * @} - */ /* end of group CRC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- CTIMER Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CTIMER_Peripheral_Access_Layer CTIMER Peripheral Access Layer - * @{ - */ - -/** CTIMER - Register Layout Typedef */ -typedef struct { - __IO uint32_t IR; /**< Interrupt, offset: 0x0 */ - __IO uint32_t TCR; /**< Timer Control, offset: 0x4 */ - __IO uint32_t TC; /**< Timer Counter, offset: 0x8 */ - __IO uint32_t PR; /**< Prescale, offset: 0xC */ - __IO uint32_t PC; /**< Prescale Counter, offset: 0x10 */ - __IO uint32_t MCR; /**< Match Control, offset: 0x14 */ - __IO uint32_t MR[4]; /**< Match, array offset: 0x18, array step: 0x4 */ - __IO uint32_t CCR; /**< Capture Control, offset: 0x28 */ - __I uint32_t CR[4]; /**< Capture, array offset: 0x2C, array step: 0x4 */ - __IO uint32_t EMR; /**< External Match, offset: 0x3C */ - uint8_t RESERVED_0[48]; - __IO uint32_t CTCR; /**< Count Control, offset: 0x70 */ - __IO uint32_t PWMC; /**< PWM Control, offset: 0x74 */ - __IO uint32_t MSR[4]; /**< Match Shadow, array offset: 0x78, array step: 0x4 */ -} CTIMER_Type; - -/* ---------------------------------------------------------------------------- - -- CTIMER Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CTIMER_Register_Masks CTIMER Register Masks - * @{ - */ - -/*! @name IR - Interrupt */ -/*! @{ */ - -#define CTIMER_IR_MR0INT_MASK (0x1U) -#define CTIMER_IR_MR0INT_SHIFT (0U) -/*! MR0INT - Interrupt Flag for Match Channel 0 Event */ -#define CTIMER_IR_MR0INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_MR0INT_SHIFT)) & CTIMER_IR_MR0INT_MASK) - -#define CTIMER_IR_MR1INT_MASK (0x2U) -#define CTIMER_IR_MR1INT_SHIFT (1U) -/*! MR1INT - Interrupt Flag for Match Channel 1 Event */ -#define CTIMER_IR_MR1INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_MR1INT_SHIFT)) & CTIMER_IR_MR1INT_MASK) - -#define CTIMER_IR_MR2INT_MASK (0x4U) -#define CTIMER_IR_MR2INT_SHIFT (2U) -/*! MR2INT - Interrupt Flag for Match Channel 2 Event */ -#define CTIMER_IR_MR2INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_MR2INT_SHIFT)) & CTIMER_IR_MR2INT_MASK) - -#define CTIMER_IR_MR3INT_MASK (0x8U) -#define CTIMER_IR_MR3INT_SHIFT (3U) -/*! MR3INT - Interrupt Flag for Match Channel 3 Event */ -#define CTIMER_IR_MR3INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_MR3INT_SHIFT)) & CTIMER_IR_MR3INT_MASK) - -#define CTIMER_IR_CR0INT_MASK (0x10U) -#define CTIMER_IR_CR0INT_SHIFT (4U) -/*! CR0INT - Interrupt Flag for Capture Channel 0 Event */ -#define CTIMER_IR_CR0INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_CR0INT_SHIFT)) & CTIMER_IR_CR0INT_MASK) - -#define CTIMER_IR_CR1INT_MASK (0x20U) -#define CTIMER_IR_CR1INT_SHIFT (5U) -/*! CR1INT - Interrupt Flag for Capture Channel 1 Event */ -#define CTIMER_IR_CR1INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_CR1INT_SHIFT)) & CTIMER_IR_CR1INT_MASK) - -#define CTIMER_IR_CR2INT_MASK (0x40U) -#define CTIMER_IR_CR2INT_SHIFT (6U) -/*! CR2INT - Interrupt Flag for Capture Channel 2 Event */ -#define CTIMER_IR_CR2INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_CR2INT_SHIFT)) & CTIMER_IR_CR2INT_MASK) - -#define CTIMER_IR_CR3INT_MASK (0x80U) -#define CTIMER_IR_CR3INT_SHIFT (7U) -/*! CR3INT - Interrupt Flag for Capture Channel 3 Event */ -#define CTIMER_IR_CR3INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_CR3INT_SHIFT)) & CTIMER_IR_CR3INT_MASK) -/*! @} */ - -/*! @name TCR - Timer Control */ -/*! @{ */ - -#define CTIMER_TCR_CEN_MASK (0x1U) -#define CTIMER_TCR_CEN_SHIFT (0U) -/*! CEN - Counter Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_TCR_CEN(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TCR_CEN_SHIFT)) & CTIMER_TCR_CEN_MASK) - -#define CTIMER_TCR_CRST_MASK (0x2U) -#define CTIMER_TCR_CRST_SHIFT (1U) -/*! CRST - Counter Reset Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_TCR_CRST(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TCR_CRST_SHIFT)) & CTIMER_TCR_CRST_MASK) - -#define CTIMER_TCR_AGCEN_MASK (0x10U) -#define CTIMER_TCR_AGCEN_SHIFT (4U) -/*! AGCEN - Allow Global Count Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_TCR_AGCEN(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TCR_AGCEN_SHIFT)) & CTIMER_TCR_AGCEN_MASK) - -#define CTIMER_TCR_ATCEN_MASK (0x20U) -#define CTIMER_TCR_ATCEN_SHIFT (5U) -/*! ATCEN - Allow Trigger Count Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_TCR_ATCEN(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TCR_ATCEN_SHIFT)) & CTIMER_TCR_ATCEN_MASK) -/*! @} */ - -/*! @name TC - Timer Counter */ -/*! @{ */ - -#define CTIMER_TC_TCVAL_MASK (0xFFFFFFFFU) -#define CTIMER_TC_TCVAL_SHIFT (0U) -/*! TCVAL - Timer Counter Value */ -#define CTIMER_TC_TCVAL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TC_TCVAL_SHIFT)) & CTIMER_TC_TCVAL_MASK) -/*! @} */ - -/*! @name PR - Prescale */ -/*! @{ */ - -#define CTIMER_PR_PRVAL_MASK (0xFFFFFFFFU) -#define CTIMER_PR_PRVAL_SHIFT (0U) -/*! PRVAL - Prescale Reload Value */ -#define CTIMER_PR_PRVAL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PR_PRVAL_SHIFT)) & CTIMER_PR_PRVAL_MASK) -/*! @} */ - -/*! @name PC - Prescale Counter */ -/*! @{ */ - -#define CTIMER_PC_PCVAL_MASK (0xFFFFFFFFU) -#define CTIMER_PC_PCVAL_SHIFT (0U) -/*! PCVAL - Prescale Counter Value */ -#define CTIMER_PC_PCVAL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PC_PCVAL_SHIFT)) & CTIMER_PC_PCVAL_MASK) -/*! @} */ - -/*! @name MCR - Match Control */ -/*! @{ */ - -#define CTIMER_MCR_MR0I_MASK (0x1U) -#define CTIMER_MCR_MR0I_SHIFT (0U) -/*! MR0I - Interrupt on MR0 - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_MCR_MR0I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR0I_SHIFT)) & CTIMER_MCR_MR0I_MASK) - -#define CTIMER_MCR_MR0R_MASK (0x2U) -#define CTIMER_MCR_MR0R_SHIFT (1U) -/*! MR0R - Reset on MR0 - * 0b0..Does not reset - * 0b1..Resets - */ -#define CTIMER_MCR_MR0R(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR0R_SHIFT)) & CTIMER_MCR_MR0R_MASK) - -#define CTIMER_MCR_MR0S_MASK (0x4U) -#define CTIMER_MCR_MR0S_SHIFT (2U) -/*! MR0S - Stop on MR0 - * 0b0..Does not stop - * 0b1..Stops - */ -#define CTIMER_MCR_MR0S(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR0S_SHIFT)) & CTIMER_MCR_MR0S_MASK) - -#define CTIMER_MCR_MR1I_MASK (0x8U) -#define CTIMER_MCR_MR1I_SHIFT (3U) -/*! MR1I - Interrupt on MR1 - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_MCR_MR1I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR1I_SHIFT)) & CTIMER_MCR_MR1I_MASK) - -#define CTIMER_MCR_MR1R_MASK (0x10U) -#define CTIMER_MCR_MR1R_SHIFT (4U) -/*! MR1R - Reset on MR1 - * 0b0..Does not reset - * 0b1..Resets - */ -#define CTIMER_MCR_MR1R(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR1R_SHIFT)) & CTIMER_MCR_MR1R_MASK) - -#define CTIMER_MCR_MR1S_MASK (0x20U) -#define CTIMER_MCR_MR1S_SHIFT (5U) -/*! MR1S - Stop on MR1 - * 0b0..Does not stop - * 0b1..Stops - */ -#define CTIMER_MCR_MR1S(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR1S_SHIFT)) & CTIMER_MCR_MR1S_MASK) - -#define CTIMER_MCR_MR2I_MASK (0x40U) -#define CTIMER_MCR_MR2I_SHIFT (6U) -/*! MR2I - Interrupt on MR2 - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_MCR_MR2I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR2I_SHIFT)) & CTIMER_MCR_MR2I_MASK) - -#define CTIMER_MCR_MR2R_MASK (0x80U) -#define CTIMER_MCR_MR2R_SHIFT (7U) -/*! MR2R - Reset on MR2 - * 0b0..Does not reset - * 0b1..Resets - */ -#define CTIMER_MCR_MR2R(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR2R_SHIFT)) & CTIMER_MCR_MR2R_MASK) - -#define CTIMER_MCR_MR2S_MASK (0x100U) -#define CTIMER_MCR_MR2S_SHIFT (8U) -/*! MR2S - Stop on MR2 - * 0b0..Does not stop - * 0b1..Stops - */ -#define CTIMER_MCR_MR2S(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR2S_SHIFT)) & CTIMER_MCR_MR2S_MASK) - -#define CTIMER_MCR_MR3I_MASK (0x200U) -#define CTIMER_MCR_MR3I_SHIFT (9U) -/*! MR3I - Interrupt on MR3 - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_MCR_MR3I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR3I_SHIFT)) & CTIMER_MCR_MR3I_MASK) - -#define CTIMER_MCR_MR3R_MASK (0x400U) -#define CTIMER_MCR_MR3R_SHIFT (10U) -/*! MR3R - Reset on MR3 - * 0b0..Does not reset - * 0b1..Resets - */ -#define CTIMER_MCR_MR3R(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR3R_SHIFT)) & CTIMER_MCR_MR3R_MASK) - -#define CTIMER_MCR_MR3S_MASK (0x800U) -#define CTIMER_MCR_MR3S_SHIFT (11U) -/*! MR3S - Stop on MR3 - * 0b0..Does not stop - * 0b1..Stops - */ -#define CTIMER_MCR_MR3S(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR3S_SHIFT)) & CTIMER_MCR_MR3S_MASK) - -#define CTIMER_MCR_MR0RL_MASK (0x1000000U) -#define CTIMER_MCR_MR0RL_SHIFT (24U) -/*! MR0RL - Reload MR - * 0b0..Does not reload - * 0b1..Reloads - */ -#define CTIMER_MCR_MR0RL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR0RL_SHIFT)) & CTIMER_MCR_MR0RL_MASK) - -#define CTIMER_MCR_MR1RL_MASK (0x2000000U) -#define CTIMER_MCR_MR1RL_SHIFT (25U) -/*! MR1RL - Reload MR - * 0b0..Does not reload - * 0b1..Reloads - */ -#define CTIMER_MCR_MR1RL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR1RL_SHIFT)) & CTIMER_MCR_MR1RL_MASK) - -#define CTIMER_MCR_MR2RL_MASK (0x4000000U) -#define CTIMER_MCR_MR2RL_SHIFT (26U) -/*! MR2RL - Reload MR - * 0b0..Does not reload - * 0b1..Reloads - */ -#define CTIMER_MCR_MR2RL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR2RL_SHIFT)) & CTIMER_MCR_MR2RL_MASK) - -#define CTIMER_MCR_MR3RL_MASK (0x8000000U) -#define CTIMER_MCR_MR3RL_SHIFT (27U) -/*! MR3RL - Reload MR - * 0b0..Does not reload - * 0b1..Reloads - */ -#define CTIMER_MCR_MR3RL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR3RL_SHIFT)) & CTIMER_MCR_MR3RL_MASK) -/*! @} */ - -/*! @name MR - Match */ -/*! @{ */ - -#define CTIMER_MR_MATCH_MASK (0xFFFFFFFFU) -#define CTIMER_MR_MATCH_SHIFT (0U) -/*! MATCH - Timer Counter Match Value */ -#define CTIMER_MR_MATCH(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MR_MATCH_SHIFT)) & CTIMER_MR_MATCH_MASK) -/*! @} */ - -/* The count of CTIMER_MR */ -#define CTIMER_MR_COUNT (4U) - -/*! @name CCR - Capture Control */ -/*! @{ */ - -#define CTIMER_CCR_CAP0RE_MASK (0x1U) -#define CTIMER_CCR_CAP0RE_SHIFT (0U) -/*! CAP0RE - Rising Edge of Capture Channel 0 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP0RE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP0RE_SHIFT)) & CTIMER_CCR_CAP0RE_MASK) - -#define CTIMER_CCR_CAP0FE_MASK (0x2U) -#define CTIMER_CCR_CAP0FE_SHIFT (1U) -/*! CAP0FE - Falling Edge of Capture Channel 0 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP0FE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP0FE_SHIFT)) & CTIMER_CCR_CAP0FE_MASK) - -#define CTIMER_CCR_CAP0I_MASK (0x4U) -#define CTIMER_CCR_CAP0I_SHIFT (2U) -/*! CAP0I - Generate Interrupt on Channel 0 Capture Event - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_CCR_CAP0I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP0I_SHIFT)) & CTIMER_CCR_CAP0I_MASK) - -#define CTIMER_CCR_CAP1RE_MASK (0x8U) -#define CTIMER_CCR_CAP1RE_SHIFT (3U) -/*! CAP1RE - Rising Edge of Capture Channel 1 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP1RE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP1RE_SHIFT)) & CTIMER_CCR_CAP1RE_MASK) - -#define CTIMER_CCR_CAP1FE_MASK (0x10U) -#define CTIMER_CCR_CAP1FE_SHIFT (4U) -/*! CAP1FE - Falling Edge of Capture Channel 1 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP1FE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP1FE_SHIFT)) & CTIMER_CCR_CAP1FE_MASK) - -#define CTIMER_CCR_CAP1I_MASK (0x20U) -#define CTIMER_CCR_CAP1I_SHIFT (5U) -/*! CAP1I - Generate Interrupt on Channel 1 Capture Event - * 0b0..Does not generates - * 0b1..Generates - */ -#define CTIMER_CCR_CAP1I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP1I_SHIFT)) & CTIMER_CCR_CAP1I_MASK) - -#define CTIMER_CCR_CAP2RE_MASK (0x40U) -#define CTIMER_CCR_CAP2RE_SHIFT (6U) -/*! CAP2RE - Rising Edge of Capture Channel 2 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP2RE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP2RE_SHIFT)) & CTIMER_CCR_CAP2RE_MASK) - -#define CTIMER_CCR_CAP2FE_MASK (0x80U) -#define CTIMER_CCR_CAP2FE_SHIFT (7U) -/*! CAP2FE - Falling Edge of Capture Channel 2 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP2FE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP2FE_SHIFT)) & CTIMER_CCR_CAP2FE_MASK) - -#define CTIMER_CCR_CAP2I_MASK (0x100U) -#define CTIMER_CCR_CAP2I_SHIFT (8U) -/*! CAP2I - Generate Interrupt on Channel 2 Capture Event - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_CCR_CAP2I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP2I_SHIFT)) & CTIMER_CCR_CAP2I_MASK) - -#define CTIMER_CCR_CAP3RE_MASK (0x200U) -#define CTIMER_CCR_CAP3RE_SHIFT (9U) -/*! CAP3RE - Rising Edge of Capture Channel 3 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP3RE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP3RE_SHIFT)) & CTIMER_CCR_CAP3RE_MASK) - -#define CTIMER_CCR_CAP3FE_MASK (0x400U) -#define CTIMER_CCR_CAP3FE_SHIFT (10U) -/*! CAP3FE - Falling Edge of Capture Channel 3 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP3FE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP3FE_SHIFT)) & CTIMER_CCR_CAP3FE_MASK) - -#define CTIMER_CCR_CAP3I_MASK (0x800U) -#define CTIMER_CCR_CAP3I_SHIFT (11U) -/*! CAP3I - Generate Interrupt on Channel 3 Capture Event - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_CCR_CAP3I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP3I_SHIFT)) & CTIMER_CCR_CAP3I_MASK) -/*! @} */ - -/*! @name CR - Capture */ -/*! @{ */ - -#define CTIMER_CR_CAP_MASK (0xFFFFFFFFU) -#define CTIMER_CR_CAP_SHIFT (0U) -/*! CAP - Timer Counter Capture Value */ -#define CTIMER_CR_CAP(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CR_CAP_SHIFT)) & CTIMER_CR_CAP_MASK) -/*! @} */ - -/* The count of CTIMER_CR */ -#define CTIMER_CR_COUNT (4U) - -/*! @name EMR - External Match */ -/*! @{ */ - -#define CTIMER_EMR_EM0_MASK (0x1U) -#define CTIMER_EMR_EM0_SHIFT (0U) -/*! EM0 - External Match 0 - * 0b0..Low - * 0b1..High - */ -#define CTIMER_EMR_EM0(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EM0_SHIFT)) & CTIMER_EMR_EM0_MASK) - -#define CTIMER_EMR_EM1_MASK (0x2U) -#define CTIMER_EMR_EM1_SHIFT (1U) -/*! EM1 - External Match 1 - * 0b0..Low - * 0b1..High - */ -#define CTIMER_EMR_EM1(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EM1_SHIFT)) & CTIMER_EMR_EM1_MASK) - -#define CTIMER_EMR_EM2_MASK (0x4U) -#define CTIMER_EMR_EM2_SHIFT (2U) -/*! EM2 - External Match 2 - * 0b0..Low - * 0b1..High - */ -#define CTIMER_EMR_EM2(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EM2_SHIFT)) & CTIMER_EMR_EM2_MASK) - -#define CTIMER_EMR_EM3_MASK (0x8U) -#define CTIMER_EMR_EM3_SHIFT (3U) -/*! EM3 - External Match 3 - * 0b0..Low - * 0b1..High - */ -#define CTIMER_EMR_EM3(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EM3_SHIFT)) & CTIMER_EMR_EM3_MASK) - -#define CTIMER_EMR_EMC0_MASK (0x30U) -#define CTIMER_EMR_EMC0_SHIFT (4U) -/*! EMC0 - External Match Control 0 - * 0b00..Does nothing - * 0b01..Goes low - * 0b10..Goes high - * 0b11..Toggles - */ -#define CTIMER_EMR_EMC0(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EMC0_SHIFT)) & CTIMER_EMR_EMC0_MASK) - -#define CTIMER_EMR_EMC1_MASK (0xC0U) -#define CTIMER_EMR_EMC1_SHIFT (6U) -/*! EMC1 - External Match Control 1 - * 0b00..Does nothing - * 0b01..Goes low - * 0b10..Goes high - * 0b11..Toggles - */ -#define CTIMER_EMR_EMC1(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EMC1_SHIFT)) & CTIMER_EMR_EMC1_MASK) - -#define CTIMER_EMR_EMC2_MASK (0x300U) -#define CTIMER_EMR_EMC2_SHIFT (8U) -/*! EMC2 - External Match Control 2 - * 0b00..Does nothing - * 0b01..Goes low - * 0b10..Goes high - * 0b11..Toggles - */ -#define CTIMER_EMR_EMC2(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EMC2_SHIFT)) & CTIMER_EMR_EMC2_MASK) - -#define CTIMER_EMR_EMC3_MASK (0xC00U) -#define CTIMER_EMR_EMC3_SHIFT (10U) -/*! EMC3 - External Match Control 3 - * 0b00..Does nothing - * 0b01..Goes low - * 0b10..Goes high - * 0b11..Toggles - */ -#define CTIMER_EMR_EMC3(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EMC3_SHIFT)) & CTIMER_EMR_EMC3_MASK) -/*! @} */ - -/*! @name CTCR - Count Control */ -/*! @{ */ - -#define CTIMER_CTCR_CTMODE_MASK (0x3U) -#define CTIMER_CTCR_CTMODE_SHIFT (0U) -/*! CTMODE - Counter Timer Mode - * 0b00..Timer mode - * 0b01..Counter mode rising edge - * 0b10..Counter mode falling edge - * 0b11..Counter mode dual edge - */ -#define CTIMER_CTCR_CTMODE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CTCR_CTMODE_SHIFT)) & CTIMER_CTCR_CTMODE_MASK) - -#define CTIMER_CTCR_CINSEL_MASK (0xCU) -#define CTIMER_CTCR_CINSEL_SHIFT (2U) -/*! CINSEL - Count Input Select - * 0b00..Channel 0, CAPn[0] for CTIMERn - * 0b01..Channel 1, CAPn[1] for CTIMERn - * 0b10..Channel 2, CAPn[2] for CTIMERn - * 0b11..Channel 3, CAPn[3] for CTIMERn - */ -#define CTIMER_CTCR_CINSEL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CTCR_CINSEL_SHIFT)) & CTIMER_CTCR_CINSEL_MASK) - -#define CTIMER_CTCR_ENCC_MASK (0x10U) -#define CTIMER_CTCR_ENCC_SHIFT (4U) -/*! ENCC - Capture Channel Enable */ -#define CTIMER_CTCR_ENCC(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CTCR_ENCC_SHIFT)) & CTIMER_CTCR_ENCC_MASK) - -#define CTIMER_CTCR_SELCC_MASK (0xE0U) -#define CTIMER_CTCR_SELCC_SHIFT (5U) -/*! SELCC - Edge Select - * 0b000..Capture channel 0 rising edge - * 0b001..Capture channel 0 falling edge - * 0b010..Capture channel 1 rising edge - * 0b011..Capture channel 1 falling edge - * 0b100..Capture channel 2 rising edge - * 0b101..Capture channel 2 falling edge - */ -#define CTIMER_CTCR_SELCC(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CTCR_SELCC_SHIFT)) & CTIMER_CTCR_SELCC_MASK) -/*! @} */ - -/*! @name PWMC - PWM Control */ -/*! @{ */ - -#define CTIMER_PWMC_PWMEN0_MASK (0x1U) -#define CTIMER_PWMC_PWMEN0_SHIFT (0U) -/*! PWMEN0 - PWM Mode Enable for Channel 0 - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_PWMC_PWMEN0(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PWMC_PWMEN0_SHIFT)) & CTIMER_PWMC_PWMEN0_MASK) - -#define CTIMER_PWMC_PWMEN1_MASK (0x2U) -#define CTIMER_PWMC_PWMEN1_SHIFT (1U) -/*! PWMEN1 - PWM Mode Enable for Channel 1 - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_PWMC_PWMEN1(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PWMC_PWMEN1_SHIFT)) & CTIMER_PWMC_PWMEN1_MASK) - -#define CTIMER_PWMC_PWMEN2_MASK (0x4U) -#define CTIMER_PWMC_PWMEN2_SHIFT (2U) -/*! PWMEN2 - PWM Mode Enable for Channel 2 - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_PWMC_PWMEN2(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PWMC_PWMEN2_SHIFT)) & CTIMER_PWMC_PWMEN2_MASK) - -#define CTIMER_PWMC_PWMEN3_MASK (0x8U) -#define CTIMER_PWMC_PWMEN3_SHIFT (3U) -/*! PWMEN3 - PWM Mode Enable for Channel 3 - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_PWMC_PWMEN3(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PWMC_PWMEN3_SHIFT)) & CTIMER_PWMC_PWMEN3_MASK) -/*! @} */ - -/*! @name MSR - Match Shadow */ -/*! @{ */ - -#define CTIMER_MSR_MATCH_SHADOW_MASK (0xFFFFFFFFU) -#define CTIMER_MSR_MATCH_SHADOW_SHIFT (0U) -/*! MATCH_SHADOW - Timer Counter Match Shadow Value */ -#define CTIMER_MSR_MATCH_SHADOW(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MSR_MATCH_SHADOW_SHIFT)) & CTIMER_MSR_MATCH_SHADOW_MASK) -/*! @} */ - -/* The count of CTIMER_MSR */ -#define CTIMER_MSR_COUNT (4U) - - -/*! - * @} - */ /* end of group CTIMER_Register_Masks */ - - -/* CTIMER - Peripheral instance base addresses */ -/** Peripheral CTIMER0 base address */ -#define CTIMER0_BASE (0x40004000u) -/** Peripheral CTIMER0 base pointer */ -#define CTIMER0 ((CTIMER_Type *)CTIMER0_BASE) -/** Peripheral CTIMER1 base address */ -#define CTIMER1_BASE (0x40005000u) -/** Peripheral CTIMER1 base pointer */ -#define CTIMER1 ((CTIMER_Type *)CTIMER1_BASE) -/** Peripheral CTIMER2 base address */ -#define CTIMER2_BASE (0x40006000u) -/** Peripheral CTIMER2 base pointer */ -#define CTIMER2 ((CTIMER_Type *)CTIMER2_BASE) -/** Array initializer of CTIMER peripheral base addresses */ -#define CTIMER_BASE_ADDRS { CTIMER0_BASE, CTIMER1_BASE, CTIMER2_BASE } -/** Array initializer of CTIMER peripheral base pointers */ -#define CTIMER_BASE_PTRS { CTIMER0, CTIMER1, CTIMER2 } -/** Interrupt vectors for the CTIMER peripheral type */ -#define CTIMER_IRQS { CTIMER0_IRQn, CTIMER1_IRQn, CTIMER2_IRQn } - -/*! - * @} - */ /* end of group CTIMER_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- DEBUGMAILBOX Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DEBUGMAILBOX_Peripheral_Access_Layer DEBUGMAILBOX Peripheral Access Layer - * @{ - */ - -/** DEBUGMAILBOX - Register Layout Typedef */ -typedef struct { - __IO uint32_t CSW; /**< Command and Status Word, offset: 0x0 */ - __IO uint32_t REQUEST; /**< Request Value, offset: 0x4 */ - __IO uint32_t RETURN; /**< Return Value, offset: 0x8 */ - uint8_t RESERVED_0[240]; - __I uint32_t ID; /**< Identification, offset: 0xFC */ -} DEBUGMAILBOX_Type; - -/* ---------------------------------------------------------------------------- - -- DEBUGMAILBOX Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DEBUGMAILBOX_Register_Masks DEBUGMAILBOX Register Masks - * @{ - */ - -/*! @name CSW - Command and Status Word */ -/*! @{ */ - -#define DEBUGMAILBOX_CSW_RESYNCH_REQ_MASK (0x1U) -#define DEBUGMAILBOX_CSW_RESYNCH_REQ_SHIFT (0U) -/*! RESYNCH_REQ - Resynchronization Request - * 0b0..No request - * 0b1..Request for resynchronization - */ -#define DEBUGMAILBOX_CSW_RESYNCH_REQ(x) (((uint32_t)(((uint32_t)(x)) << DEBUGMAILBOX_CSW_RESYNCH_REQ_SHIFT)) & DEBUGMAILBOX_CSW_RESYNCH_REQ_MASK) - -#define DEBUGMAILBOX_CSW_REQ_PENDING_MASK (0x2U) -#define DEBUGMAILBOX_CSW_REQ_PENDING_SHIFT (1U) -/*! REQ_PENDING - Request Pending - * 0b0..No request pending - * 0b1..Request for resynchronization pending - */ -#define DEBUGMAILBOX_CSW_REQ_PENDING(x) (((uint32_t)(((uint32_t)(x)) << DEBUGMAILBOX_CSW_REQ_PENDING_SHIFT)) & DEBUGMAILBOX_CSW_REQ_PENDING_MASK) - -#define DEBUGMAILBOX_CSW_DBG_OR_ERR_MASK (0x4U) -#define DEBUGMAILBOX_CSW_DBG_OR_ERR_SHIFT (2U) -/*! DBG_OR_ERR - DBGMB Overrun Error - * 0b0..No DBGMB Overrun error - * 0b1..DBGMB overrun error. A DBGMB overrun occurred. - */ -#define DEBUGMAILBOX_CSW_DBG_OR_ERR(x) (((uint32_t)(((uint32_t)(x)) << DEBUGMAILBOX_CSW_DBG_OR_ERR_SHIFT)) & DEBUGMAILBOX_CSW_DBG_OR_ERR_MASK) - -#define DEBUGMAILBOX_CSW_AHB_OR_ERR_MASK (0x8U) -#define DEBUGMAILBOX_CSW_AHB_OR_ERR_SHIFT (3U) -/*! AHB_OR_ERR - AHB Overrun Error - * 0b0..No AHB Overrun Error - * 0b1..AHB Overrun Error. An AHB overrun occurred. - */ -#define DEBUGMAILBOX_CSW_AHB_OR_ERR(x) (((uint32_t)(((uint32_t)(x)) << DEBUGMAILBOX_CSW_AHB_OR_ERR_SHIFT)) & DEBUGMAILBOX_CSW_AHB_OR_ERR_MASK) - -#define DEBUGMAILBOX_CSW_SOFT_RESET_MASK (0x10U) -#define DEBUGMAILBOX_CSW_SOFT_RESET_SHIFT (4U) -/*! SOFT_RESET - Soft Reset */ -#define DEBUGMAILBOX_CSW_SOFT_RESET(x) (((uint32_t)(((uint32_t)(x)) << DEBUGMAILBOX_CSW_SOFT_RESET_SHIFT)) & DEBUGMAILBOX_CSW_SOFT_RESET_MASK) - -#define DEBUGMAILBOX_CSW_CHIP_RESET_REQ_MASK (0x20U) -#define DEBUGMAILBOX_CSW_CHIP_RESET_REQ_SHIFT (5U) -/*! CHIP_RESET_REQ - Chip Reset Request */ -#define DEBUGMAILBOX_CSW_CHIP_RESET_REQ(x) (((uint32_t)(((uint32_t)(x)) << DEBUGMAILBOX_CSW_CHIP_RESET_REQ_SHIFT)) & DEBUGMAILBOX_CSW_CHIP_RESET_REQ_MASK) -/*! @} */ - -/*! @name REQUEST - Request Value */ -/*! @{ */ - -#define DEBUGMAILBOX_REQUEST_REQUEST_MASK (0xFFFFFFFFU) -#define DEBUGMAILBOX_REQUEST_REQUEST_SHIFT (0U) -/*! REQUEST - Request Value */ -#define DEBUGMAILBOX_REQUEST_REQUEST(x) (((uint32_t)(((uint32_t)(x)) << DEBUGMAILBOX_REQUEST_REQUEST_SHIFT)) & DEBUGMAILBOX_REQUEST_REQUEST_MASK) -/*! @} */ - -/*! @name RETURN - Return Value */ -/*! @{ */ - -#define DEBUGMAILBOX_RETURN_RET_MASK (0xFFFFFFFFU) -#define DEBUGMAILBOX_RETURN_RET_SHIFT (0U) -/*! RET - Return Value */ -#define DEBUGMAILBOX_RETURN_RET(x) (((uint32_t)(((uint32_t)(x)) << DEBUGMAILBOX_RETURN_RET_SHIFT)) & DEBUGMAILBOX_RETURN_RET_MASK) -/*! @} */ - -/*! @name ID - Identification */ -/*! @{ */ - -#define DEBUGMAILBOX_ID_ID_MASK (0xFFFFFFFFU) -#define DEBUGMAILBOX_ID_ID_SHIFT (0U) -/*! ID - Identification Value */ -#define DEBUGMAILBOX_ID_ID(x) (((uint32_t)(((uint32_t)(x)) << DEBUGMAILBOX_ID_ID_SHIFT)) & DEBUGMAILBOX_ID_ID_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group DEBUGMAILBOX_Register_Masks */ - - -/* DEBUGMAILBOX - Peripheral instance base addresses */ -/** Peripheral DBGMAILBOX base address */ -#define DBGMAILBOX_BASE (0x40101000u) -/** Peripheral DBGMAILBOX base pointer */ -#define DBGMAILBOX ((DEBUGMAILBOX_Type *)DBGMAILBOX_BASE) -/** Array initializer of DEBUGMAILBOX peripheral base addresses */ -#define DEBUGMAILBOX_BASE_ADDRS { DBGMAILBOX_BASE } -/** Array initializer of DEBUGMAILBOX peripheral base pointers */ -#define DEBUGMAILBOX_BASE_PTRS { DBGMAILBOX } - -/*! - * @} - */ /* end of group DEBUGMAILBOX_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- DMA Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DMA_Peripheral_Access_Layer DMA Peripheral Access Layer - * @{ - */ - -/** DMA - Register Layout Typedef */ -typedef struct { - __IO uint32_t MP_CSR; /**< Management Page Control, offset: 0x0 */ - __I uint32_t MP_ES; /**< Management Page Error Status, offset: 0x4 */ - __I uint32_t MP_INT; /**< Management Page Interrupt Request Status, offset: 0x8 */ - __I uint32_t MP_HRS; /**< Management Page Hardware Request Status, offset: 0xC */ - uint8_t RESERVED_0[240]; - __IO uint32_t CH_GRPRI[4]; /**< Channel Arbitration Group, array offset: 0x100, array step: 0x4 */ - uint8_t RESERVED_1[3824]; - struct { /* offset: 0x1000, array step: 0x1000 */ - __IO uint32_t CH_CSR; /**< Channel Control and Status, array offset: 0x1000, array step: 0x1000 */ - __IO uint32_t CH_ES; /**< Channel Error Status, array offset: 0x1004, array step: 0x1000 */ - __IO uint32_t CH_INT; /**< Channel Interrupt Status, array offset: 0x1008, array step: 0x1000 */ - __IO uint32_t CH_SBR; /**< Channel System Bus, array offset: 0x100C, array step: 0x1000 */ - __IO uint32_t CH_PRI; /**< Channel Priority, array offset: 0x1010, array step: 0x1000 */ - __IO uint32_t CH_MUX; /**< Channel Multiplexor Configuration, array offset: 0x1014, array step: 0x1000 */ - uint8_t RESERVED_0[8]; - __IO uint32_t TCD_SADDR; /**< TCD Source Address, array offset: 0x1020, array step: 0x1000 */ - __IO uint16_t TCD_SOFF; /**< TCD Signed Source Address Offset, array offset: 0x1024, array step: 0x1000 */ - __IO uint16_t TCD_ATTR; /**< TCD Transfer Attributes, array offset: 0x1026, array step: 0x1000 */ - union { /* offset: 0x1028, array step: 0x1000 */ - __IO uint32_t TCD_NBYTES_MLOFFNO; /**< TCD Transfer Size Without Minor Loop Offsets, array offset: 0x1028, array step: 0x1000 */ - __IO uint32_t TCD_NBYTES_MLOFFYES; /**< TCD Transfer Size with Minor Loop Offsets, array offset: 0x1028, array step: 0x1000 */ - }; - __IO uint32_t TCD_SLAST_SDA; /**< TCD Last Source Address Adjustment / Store DADDR Address, array offset: 0x102C, array step: 0x1000 */ - __IO uint32_t TCD_DADDR; /**< TCD Destination Address, array offset: 0x1030, array step: 0x1000 */ - __IO uint16_t TCD_DOFF; /**< TCD Signed Destination Address Offset, array offset: 0x1034, array step: 0x1000 */ - union { /* offset: 0x1036, array step: 0x1000 */ - __IO uint16_t TCD_CITER_ELINKNO; /**< TCD Current Major Loop Count (Minor Loop Channel Linking Disabled), array offset: 0x1036, array step: 0x1000 */ - __IO uint16_t TCD_CITER_ELINKYES; /**< TCD Current Major Loop Count (Minor Loop Channel Linking Enabled), array offset: 0x1036, array step: 0x1000 */ - }; - __IO uint32_t TCD_DLAST_SGA; /**< TCD Last Destination Address Adjustment / Scatter Gather Address, array offset: 0x1038, array step: 0x1000 */ - __IO uint16_t TCD_CSR; /**< TCD Control and Status, array offset: 0x103C, array step: 0x1000 */ - union { /* offset: 0x103E, array step: 0x1000 */ - __IO uint16_t TCD_BITER_ELINKNO; /**< TCD Beginning Major Loop Count (Minor Loop Channel Linking Disabled), array offset: 0x103E, array step: 0x1000 */ - __IO uint16_t TCD_BITER_ELINKYES; /**< TCD Beginning Major Loop Count (Minor Loop Channel Linking Enabled), array offset: 0x103E, array step: 0x1000 */ - }; - uint8_t RESERVED_1[4032]; - } CH[4]; -} DMA_Type; - -/* ---------------------------------------------------------------------------- - -- DMA Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DMA_Register_Masks DMA Register Masks - * @{ - */ - -/*! @name MP_CSR - Management Page Control */ -/*! @{ */ - -#define DMA_MP_CSR_EDBG_MASK (0x2U) -#define DMA_MP_CSR_EDBG_SHIFT (1U) -/*! EDBG - Enable Debug - * 0b0..Debug mode disabled - * 0b1..Debug mode is enabled. - */ -#define DMA_MP_CSR_EDBG(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_EDBG_SHIFT)) & DMA_MP_CSR_EDBG_MASK) - -#define DMA_MP_CSR_ERCA_MASK (0x4U) -#define DMA_MP_CSR_ERCA_SHIFT (2U) -/*! ERCA - Enable Round Robin Channel Arbitration - * 0b0..Round-robin channel arbitration disabled - * 0b1..Round-robin channel arbitration enabled - */ -#define DMA_MP_CSR_ERCA(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_ERCA_SHIFT)) & DMA_MP_CSR_ERCA_MASK) - -#define DMA_MP_CSR_HAE_MASK (0x10U) -#define DMA_MP_CSR_HAE_SHIFT (4U) -/*! HAE - Halt After Error - * 0b0..Normal operation - * 0b1..Any error causes the HALT field to be set to 1 - */ -#define DMA_MP_CSR_HAE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_HAE_SHIFT)) & DMA_MP_CSR_HAE_MASK) - -#define DMA_MP_CSR_HALT_MASK (0x20U) -#define DMA_MP_CSR_HALT_SHIFT (5U) -/*! HALT - Halt DMA Operations - * 0b0..Normal operation - * 0b1..Stall the start of any new channels - */ -#define DMA_MP_CSR_HALT(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_HALT_SHIFT)) & DMA_MP_CSR_HALT_MASK) - -#define DMA_MP_CSR_GCLC_MASK (0x40U) -#define DMA_MP_CSR_GCLC_SHIFT (6U) -/*! GCLC - Global Channel Linking Control - * 0b0..Channel linking disabled for all channels - * 0b1..Channel linking available and controlled by each channel's link settings - */ -#define DMA_MP_CSR_GCLC(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_GCLC_SHIFT)) & DMA_MP_CSR_GCLC_MASK) - -#define DMA_MP_CSR_GMRC_MASK (0x80U) -#define DMA_MP_CSR_GMRC_SHIFT (7U) -/*! GMRC - Global Master ID Replication Control - * 0b0..Master ID replication disabled for all channels - * 0b1..Master ID replication available and controlled by each channel's CHn_SBR[EMI] setting - */ -#define DMA_MP_CSR_GMRC(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_GMRC_SHIFT)) & DMA_MP_CSR_GMRC_MASK) - -#define DMA_MP_CSR_ECX_MASK (0x100U) -#define DMA_MP_CSR_ECX_SHIFT (8U) -/*! ECX - Cancel Transfer With Error - * 0b0..Normal operation - * 0b1..Cancel the remaining data transfer - */ -#define DMA_MP_CSR_ECX(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_ECX_SHIFT)) & DMA_MP_CSR_ECX_MASK) - -#define DMA_MP_CSR_CX_MASK (0x200U) -#define DMA_MP_CSR_CX_SHIFT (9U) -/*! CX - Cancel Transfer - * 0b0..Normal operation - * 0b1..Cancel the remaining data transfer - */ -#define DMA_MP_CSR_CX(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_CX_SHIFT)) & DMA_MP_CSR_CX_MASK) - -#define DMA_MP_CSR_ACTIVE_ID_MASK (0x3000000U) -#define DMA_MP_CSR_ACTIVE_ID_SHIFT (24U) -/*! ACTIVE_ID - Active Channel ID */ -#define DMA_MP_CSR_ACTIVE_ID(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_ACTIVE_ID_SHIFT)) & DMA_MP_CSR_ACTIVE_ID_MASK) - -#define DMA_MP_CSR_ACTIVE_MASK (0x80000000U) -#define DMA_MP_CSR_ACTIVE_SHIFT (31U) -/*! ACTIVE - DMA Active Status - * 0b0..eDMA is idle - * 0b1..eDMA is executing a channel - */ -#define DMA_MP_CSR_ACTIVE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_ACTIVE_SHIFT)) & DMA_MP_CSR_ACTIVE_MASK) -/*! @} */ - -/*! @name MP_ES - Management Page Error Status */ -/*! @{ */ - -#define DMA_MP_ES_DBE_MASK (0x1U) -#define DMA_MP_ES_DBE_SHIFT (0U) -/*! DBE - Destination Bus Error - * 0b0..No destination bus error - * 0b1..Last recorded error was a bus error on a destination write - */ -#define DMA_MP_ES_DBE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_DBE_SHIFT)) & DMA_MP_ES_DBE_MASK) - -#define DMA_MP_ES_SBE_MASK (0x2U) -#define DMA_MP_ES_SBE_SHIFT (1U) -/*! SBE - Source Bus Error - * 0b0..No source bus error - * 0b1..Last recorded error was a bus error on a source read - */ -#define DMA_MP_ES_SBE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_SBE_SHIFT)) & DMA_MP_ES_SBE_MASK) - -#define DMA_MP_ES_SGE_MASK (0x4U) -#define DMA_MP_ES_SGE_SHIFT (2U) -/*! SGE - Scatter/Gather Configuration Error - * 0b0..No scatter/gather configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_DLAST_SGA field - */ -#define DMA_MP_ES_SGE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_SGE_SHIFT)) & DMA_MP_ES_SGE_MASK) - -#define DMA_MP_ES_NCE_MASK (0x8U) -#define DMA_MP_ES_NCE_SHIFT (3U) -/*! NCE - NBYTES/CITER Configuration Error - * 0b0..No NBYTES/CITER configuration error - * 0b1..The last recorded error was NBYTES equal to zero or a CITER not equal to BITER error - */ -#define DMA_MP_ES_NCE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_NCE_SHIFT)) & DMA_MP_ES_NCE_MASK) - -#define DMA_MP_ES_DOE_MASK (0x10U) -#define DMA_MP_ES_DOE_SHIFT (4U) -/*! DOE - Destination Offset Error - * 0b0..No destination offset configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_DOFF field - */ -#define DMA_MP_ES_DOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_DOE_SHIFT)) & DMA_MP_ES_DOE_MASK) - -#define DMA_MP_ES_DAE_MASK (0x20U) -#define DMA_MP_ES_DAE_SHIFT (5U) -/*! DAE - Destination Address Error - * 0b0..No destination address configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_DADDR field - */ -#define DMA_MP_ES_DAE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_DAE_SHIFT)) & DMA_MP_ES_DAE_MASK) - -#define DMA_MP_ES_SOE_MASK (0x40U) -#define DMA_MP_ES_SOE_SHIFT (6U) -/*! SOE - Source Offset Error - * 0b0..No source offset configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_SOFF field - */ -#define DMA_MP_ES_SOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_SOE_SHIFT)) & DMA_MP_ES_SOE_MASK) - -#define DMA_MP_ES_SAE_MASK (0x80U) -#define DMA_MP_ES_SAE_SHIFT (7U) -/*! SAE - Source Address Error - * 0b0..No source address configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_SADDR field - */ -#define DMA_MP_ES_SAE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_SAE_SHIFT)) & DMA_MP_ES_SAE_MASK) - -#define DMA_MP_ES_ECX_MASK (0x100U) -#define DMA_MP_ES_ECX_SHIFT (8U) -/*! ECX - Transfer Canceled - * 0b0..No canceled transfers - * 0b1..Last recorded entry was a canceled transfer by the error cancel transfer input - */ -#define DMA_MP_ES_ECX(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_ECX_SHIFT)) & DMA_MP_ES_ECX_MASK) - -#define DMA_MP_ES_ERRCHN_MASK (0x3000000U) -#define DMA_MP_ES_ERRCHN_SHIFT (24U) -/*! ERRCHN - Error Channel Number or Canceled Channel Number */ -#define DMA_MP_ES_ERRCHN(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_ERRCHN_SHIFT)) & DMA_MP_ES_ERRCHN_MASK) - -#define DMA_MP_ES_VLD_MASK (0x80000000U) -#define DMA_MP_ES_VLD_SHIFT (31U) -/*! VLD - Valid - * 0b0..No CHn_ES[ERR] fields are set to 1 - * 0b1..At least one CHn_ES[ERR] field is set to 1, indicating a valid error exists that software has not cleared - */ -#define DMA_MP_ES_VLD(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_VLD_SHIFT)) & DMA_MP_ES_VLD_MASK) -/*! @} */ - -/*! @name MP_INT - Management Page Interrupt Request Status */ -/*! @{ */ - -#define DMA_MP_INT_INT_MASK (0xFU) -#define DMA_MP_INT_INT_SHIFT (0U) -/*! INT - Interrupt Request Status */ -#define DMA_MP_INT_INT(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_INT_INT_SHIFT)) & DMA_MP_INT_INT_MASK) -/*! @} */ - -/*! @name MP_HRS - Management Page Hardware Request Status */ -/*! @{ */ - -#define DMA_MP_HRS_HRS_MASK (0xFFFFFFFFU) -#define DMA_MP_HRS_HRS_SHIFT (0U) -/*! HRS - Hardware Request Status */ -#define DMA_MP_HRS_HRS(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_HRS_HRS_SHIFT)) & DMA_MP_HRS_HRS_MASK) -/*! @} */ - -/*! @name CH_GRPRI - Channel Arbitration Group */ -/*! @{ */ - -#define DMA_CH_GRPRI_GRPRI_MASK (0x1FU) -#define DMA_CH_GRPRI_GRPRI_SHIFT (0U) -/*! GRPRI - Arbitration Group For Channel n */ -#define DMA_CH_GRPRI_GRPRI(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_GRPRI_GRPRI_SHIFT)) & DMA_CH_GRPRI_GRPRI_MASK) -/*! @} */ - -/* The count of DMA_CH_GRPRI */ -#define DMA_CH_GRPRI_COUNT (4U) - -/*! @name CH_CSR - Channel Control and Status */ -/*! @{ */ - -#define DMA_CH_CSR_ERQ_MASK (0x1U) -#define DMA_CH_CSR_ERQ_SHIFT (0U) -/*! ERQ - Enable DMA Request - * 0b0..DMA hardware request signal for corresponding channel disabled - * 0b1..DMA hardware request signal for corresponding channel enabled - */ -#define DMA_CH_CSR_ERQ(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_CSR_ERQ_SHIFT)) & DMA_CH_CSR_ERQ_MASK) - -#define DMA_CH_CSR_EARQ_MASK (0x2U) -#define DMA_CH_CSR_EARQ_SHIFT (1U) -/*! EARQ - Enable Asynchronous DMA Request - * 0b0..Disable asynchronous DMA request for the channel - * 0b1..Enable asynchronous DMA request for the channel - */ -#define DMA_CH_CSR_EARQ(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_CSR_EARQ_SHIFT)) & DMA_CH_CSR_EARQ_MASK) - -#define DMA_CH_CSR_EEI_MASK (0x4U) -#define DMA_CH_CSR_EEI_SHIFT (2U) -/*! EEI - Enable Error Interrupt - * 0b0..Error signal for corresponding channel does not generate error interrupt - * 0b1..Assertion of error signal for corresponding channel generates error interrupt request - */ -#define DMA_CH_CSR_EEI(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_CSR_EEI_SHIFT)) & DMA_CH_CSR_EEI_MASK) - -#define DMA_CH_CSR_EBW_MASK (0x8U) -#define DMA_CH_CSR_EBW_SHIFT (3U) -/*! EBW - Enable Buffered Writes - * 0b0..Buffered writes on system bus disabled - * 0b1..Buffered writes on system bus enabled - */ -#define DMA_CH_CSR_EBW(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_CSR_EBW_SHIFT)) & DMA_CH_CSR_EBW_MASK) - -#define DMA_CH_CSR_DONE_MASK (0x40000000U) -#define DMA_CH_CSR_DONE_SHIFT (30U) -/*! DONE - Channel Done */ -#define DMA_CH_CSR_DONE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_CSR_DONE_SHIFT)) & DMA_CH_CSR_DONE_MASK) - -#define DMA_CH_CSR_ACTIVE_MASK (0x80000000U) -#define DMA_CH_CSR_ACTIVE_SHIFT (31U) -/*! ACTIVE - Channel Active */ -#define DMA_CH_CSR_ACTIVE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_CSR_ACTIVE_SHIFT)) & DMA_CH_CSR_ACTIVE_MASK) -/*! @} */ - -/* The count of DMA_CH_CSR */ -#define DMA_CH_CSR_COUNT (4U) - -/*! @name CH_ES - Channel Error Status */ -/*! @{ */ - -#define DMA_CH_ES_DBE_MASK (0x1U) -#define DMA_CH_ES_DBE_SHIFT (0U) -/*! DBE - Destination Bus Error - * 0b0..No destination bus error - * 0b1..Last recorded error was bus error on destination write - */ -#define DMA_CH_ES_DBE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_DBE_SHIFT)) & DMA_CH_ES_DBE_MASK) - -#define DMA_CH_ES_SBE_MASK (0x2U) -#define DMA_CH_ES_SBE_SHIFT (1U) -/*! SBE - Source Bus Error - * 0b0..No source bus error - * 0b1..Last recorded error was bus error on source read - */ -#define DMA_CH_ES_SBE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_SBE_SHIFT)) & DMA_CH_ES_SBE_MASK) - -#define DMA_CH_ES_SGE_MASK (0x4U) -#define DMA_CH_ES_SGE_SHIFT (2U) -/*! SGE - Scatter/Gather Configuration Error - * 0b0..No scatter/gather configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_DLAST_SGA field - */ -#define DMA_CH_ES_SGE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_SGE_SHIFT)) & DMA_CH_ES_SGE_MASK) - -#define DMA_CH_ES_NCE_MASK (0x8U) -#define DMA_CH_ES_NCE_SHIFT (3U) -/*! NCE - NBYTES/CITER Configuration Error - * 0b0..No NBYTES/CITER configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_NBYTES or TCDn_CITER fields - */ -#define DMA_CH_ES_NCE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_NCE_SHIFT)) & DMA_CH_ES_NCE_MASK) - -#define DMA_CH_ES_DOE_MASK (0x10U) -#define DMA_CH_ES_DOE_SHIFT (4U) -/*! DOE - Destination Offset Error - * 0b0..No destination offset configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_DOFF field - */ -#define DMA_CH_ES_DOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_DOE_SHIFT)) & DMA_CH_ES_DOE_MASK) - -#define DMA_CH_ES_DAE_MASK (0x20U) -#define DMA_CH_ES_DAE_SHIFT (5U) -/*! DAE - Destination Address Error - * 0b0..No destination address configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_DADDR field - */ -#define DMA_CH_ES_DAE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_DAE_SHIFT)) & DMA_CH_ES_DAE_MASK) - -#define DMA_CH_ES_SOE_MASK (0x40U) -#define DMA_CH_ES_SOE_SHIFT (6U) -/*! SOE - Source Offset Error - * 0b0..No source offset configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_SOFF field - */ -#define DMA_CH_ES_SOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_SOE_SHIFT)) & DMA_CH_ES_SOE_MASK) - -#define DMA_CH_ES_SAE_MASK (0x80U) -#define DMA_CH_ES_SAE_SHIFT (7U) -/*! SAE - Source Address Error - * 0b0..No source address configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_SADDR field - */ -#define DMA_CH_ES_SAE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_SAE_SHIFT)) & DMA_CH_ES_SAE_MASK) - -#define DMA_CH_ES_ERR_MASK (0x80000000U) -#define DMA_CH_ES_ERR_SHIFT (31U) -/*! ERR - Error In Channel - * 0b0..An error in this channel has not occurred - * 0b1..An error in this channel has occurred - */ -#define DMA_CH_ES_ERR(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_ERR_SHIFT)) & DMA_CH_ES_ERR_MASK) -/*! @} */ - -/* The count of DMA_CH_ES */ -#define DMA_CH_ES_COUNT (4U) - -/*! @name CH_INT - Channel Interrupt Status */ -/*! @{ */ - -#define DMA_CH_INT_INT_MASK (0x1U) -#define DMA_CH_INT_INT_SHIFT (0U) -/*! INT - Interrupt Request - * 0b0..Interrupt request for corresponding channel cleared - * 0b1..Interrupt request for corresponding channel active - */ -#define DMA_CH_INT_INT(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_INT_INT_SHIFT)) & DMA_CH_INT_INT_MASK) -/*! @} */ - -/* The count of DMA_CH_INT */ -#define DMA_CH_INT_COUNT (4U) - -/*! @name CH_SBR - Channel System Bus */ -/*! @{ */ - -#define DMA_CH_SBR_MID_MASK (0xFU) -#define DMA_CH_SBR_MID_SHIFT (0U) -/*! MID - Master ID */ -#define DMA_CH_SBR_MID(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_SBR_MID_SHIFT)) & DMA_CH_SBR_MID_MASK) - -#define DMA_CH_SBR_PAL_MASK (0x8000U) -#define DMA_CH_SBR_PAL_SHIFT (15U) -/*! PAL - Privileged Access Level - * 0b0..User protection level for DMA transfers - * 0b1..Privileged protection level for DMA transfers - */ -#define DMA_CH_SBR_PAL(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_SBR_PAL_SHIFT)) & DMA_CH_SBR_PAL_MASK) - -#define DMA_CH_SBR_EMI_MASK (0x10000U) -#define DMA_CH_SBR_EMI_SHIFT (16U) -/*! EMI - Enable Master ID Replication - * 0b0..Master ID replication is disabled - * 0b1..Master ID replication is enabled - */ -#define DMA_CH_SBR_EMI(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_SBR_EMI_SHIFT)) & DMA_CH_SBR_EMI_MASK) -/*! @} */ - -/* The count of DMA_CH_SBR */ -#define DMA_CH_SBR_COUNT (4U) - -/*! @name CH_PRI - Channel Priority */ -/*! @{ */ - -#define DMA_CH_PRI_APL_MASK (0x7U) -#define DMA_CH_PRI_APL_SHIFT (0U) -/*! APL - Arbitration Priority Level */ -#define DMA_CH_PRI_APL(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_PRI_APL_SHIFT)) & DMA_CH_PRI_APL_MASK) - -#define DMA_CH_PRI_DPA_MASK (0x40000000U) -#define DMA_CH_PRI_DPA_SHIFT (30U) -/*! DPA - Disable Preempt Ability - * 0b0..Channel can suspend a lower-priority channel - * 0b1..Channel cannot suspend any other channel, regardless of channel priority - */ -#define DMA_CH_PRI_DPA(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_PRI_DPA_SHIFT)) & DMA_CH_PRI_DPA_MASK) - -#define DMA_CH_PRI_ECP_MASK (0x80000000U) -#define DMA_CH_PRI_ECP_SHIFT (31U) -/*! ECP - Enable Channel Preemption - * 0b0..Channel cannot be suspended by a higher-priority channel's service request - * 0b1..Channel can be temporarily suspended by a higher-priority channel's service request - */ -#define DMA_CH_PRI_ECP(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_PRI_ECP_SHIFT)) & DMA_CH_PRI_ECP_MASK) -/*! @} */ - -/* The count of DMA_CH_PRI */ -#define DMA_CH_PRI_COUNT (4U) - -/*! @name CH_MUX - Channel Multiplexor Configuration */ -/*! @{ */ - -#define DMA_CH_MUX_SRC_MASK (0x7FU) -#define DMA_CH_MUX_SRC_SHIFT (0U) -/*! SRC - Service Request Source */ -#define DMA_CH_MUX_SRC(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_MUX_SRC_SHIFT)) & DMA_CH_MUX_SRC_MASK) -/*! @} */ - -/* The count of DMA_CH_MUX */ -#define DMA_CH_MUX_COUNT (4U) - -/*! @name TCD_SADDR - TCD Source Address */ -/*! @{ */ - -#define DMA_TCD_SADDR_SADDR_MASK (0xFFFFFFFFU) -#define DMA_TCD_SADDR_SADDR_SHIFT (0U) -/*! SADDR - Source Address */ -#define DMA_TCD_SADDR_SADDR(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_SADDR_SADDR_SHIFT)) & DMA_TCD_SADDR_SADDR_MASK) -/*! @} */ - -/* The count of DMA_TCD_SADDR */ -#define DMA_TCD_SADDR_COUNT (4U) - -/*! @name TCD_SOFF - TCD Signed Source Address Offset */ -/*! @{ */ - -#define DMA_TCD_SOFF_SOFF_MASK (0xFFFFU) -#define DMA_TCD_SOFF_SOFF_SHIFT (0U) -/*! SOFF - Source Address Signed Offset */ -#define DMA_TCD_SOFF_SOFF(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_SOFF_SOFF_SHIFT)) & DMA_TCD_SOFF_SOFF_MASK) -/*! @} */ - -/* The count of DMA_TCD_SOFF */ -#define DMA_TCD_SOFF_COUNT (4U) - -/*! @name TCD_ATTR - TCD Transfer Attributes */ -/*! @{ */ - -#define DMA_TCD_ATTR_DSIZE_MASK (0x7U) -#define DMA_TCD_ATTR_DSIZE_SHIFT (0U) -/*! DSIZE - Destination Data Transfer Size */ -#define DMA_TCD_ATTR_DSIZE(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_ATTR_DSIZE_SHIFT)) & DMA_TCD_ATTR_DSIZE_MASK) - -#define DMA_TCD_ATTR_DMOD_MASK (0xF8U) -#define DMA_TCD_ATTR_DMOD_SHIFT (3U) -/*! DMOD - Destination Address Modulo */ -#define DMA_TCD_ATTR_DMOD(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_ATTR_DMOD_SHIFT)) & DMA_TCD_ATTR_DMOD_MASK) - -#define DMA_TCD_ATTR_SSIZE_MASK (0x700U) -#define DMA_TCD_ATTR_SSIZE_SHIFT (8U) -/*! SSIZE - Source Data Transfer Size - * 0b000..8-bit - * 0b001..16-bit - * 0b010..32-bit - * 0b011..64-bit - * 0b100..16-byte - * 0b101..32-byte - * 0b110.. - * 0b111.. - */ -#define DMA_TCD_ATTR_SSIZE(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_ATTR_SSIZE_SHIFT)) & DMA_TCD_ATTR_SSIZE_MASK) - -#define DMA_TCD_ATTR_SMOD_MASK (0xF800U) -#define DMA_TCD_ATTR_SMOD_SHIFT (11U) -/*! SMOD - Source Address Modulo - * 0b00000..Source address modulo feature disabled - * 0b00001..Source address modulo feature enabled for any non-zero value [1-31] - */ -#define DMA_TCD_ATTR_SMOD(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_ATTR_SMOD_SHIFT)) & DMA_TCD_ATTR_SMOD_MASK) -/*! @} */ - -/* The count of DMA_TCD_ATTR */ -#define DMA_TCD_ATTR_COUNT (4U) - -/*! @name TCD_NBYTES_MLOFFNO - TCD Transfer Size Without Minor Loop Offsets */ -/*! @{ */ - -#define DMA_TCD_NBYTES_MLOFFNO_NBYTES_MASK (0x3FFFFFFFU) -#define DMA_TCD_NBYTES_MLOFFNO_NBYTES_SHIFT (0U) -/*! NBYTES - Number of Bytes To Transfer Per Service Request */ -#define DMA_TCD_NBYTES_MLOFFNO_NBYTES(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFNO_NBYTES_SHIFT)) & DMA_TCD_NBYTES_MLOFFNO_NBYTES_MASK) - -#define DMA_TCD_NBYTES_MLOFFNO_DMLOE_MASK (0x40000000U) -#define DMA_TCD_NBYTES_MLOFFNO_DMLOE_SHIFT (30U) -/*! DMLOE - Destination Minor Loop Offset Enable - * 0b0..Minor loop offset not applied to DADDR - * 0b1..Minor loop offset applied to DADDR - */ -#define DMA_TCD_NBYTES_MLOFFNO_DMLOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFNO_DMLOE_SHIFT)) & DMA_TCD_NBYTES_MLOFFNO_DMLOE_MASK) - -#define DMA_TCD_NBYTES_MLOFFNO_SMLOE_MASK (0x80000000U) -#define DMA_TCD_NBYTES_MLOFFNO_SMLOE_SHIFT (31U) -/*! SMLOE - Source Minor Loop Offset Enable - * 0b0..Minor loop offset not applied to SADDR - * 0b1..Minor loop offset applied to SADDR - */ -#define DMA_TCD_NBYTES_MLOFFNO_SMLOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFNO_SMLOE_SHIFT)) & DMA_TCD_NBYTES_MLOFFNO_SMLOE_MASK) -/*! @} */ - -/* The count of DMA_TCD_NBYTES_MLOFFNO */ -#define DMA_TCD_NBYTES_MLOFFNO_COUNT (4U) - -/*! @name TCD_NBYTES_MLOFFYES - TCD Transfer Size with Minor Loop Offsets */ -/*! @{ */ - -#define DMA_TCD_NBYTES_MLOFFYES_NBYTES_MASK (0x3FFU) -#define DMA_TCD_NBYTES_MLOFFYES_NBYTES_SHIFT (0U) -/*! NBYTES - Number of Bytes To Transfer Per Service Request */ -#define DMA_TCD_NBYTES_MLOFFYES_NBYTES(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFYES_NBYTES_SHIFT)) & DMA_TCD_NBYTES_MLOFFYES_NBYTES_MASK) - -#define DMA_TCD_NBYTES_MLOFFYES_MLOFF_MASK (0x3FFFFC00U) -#define DMA_TCD_NBYTES_MLOFFYES_MLOFF_SHIFT (10U) -/*! MLOFF - Minor Loop Offset */ -#define DMA_TCD_NBYTES_MLOFFYES_MLOFF(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFYES_MLOFF_SHIFT)) & DMA_TCD_NBYTES_MLOFFYES_MLOFF_MASK) - -#define DMA_TCD_NBYTES_MLOFFYES_DMLOE_MASK (0x40000000U) -#define DMA_TCD_NBYTES_MLOFFYES_DMLOE_SHIFT (30U) -/*! DMLOE - Destination Minor Loop Offset Enable - * 0b0..Minor loop offset not applied to DADDR - * 0b1..Minor loop offset applied to DADDR - */ -#define DMA_TCD_NBYTES_MLOFFYES_DMLOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFYES_DMLOE_SHIFT)) & DMA_TCD_NBYTES_MLOFFYES_DMLOE_MASK) - -#define DMA_TCD_NBYTES_MLOFFYES_SMLOE_MASK (0x80000000U) -#define DMA_TCD_NBYTES_MLOFFYES_SMLOE_SHIFT (31U) -/*! SMLOE - Source Minor Loop Offset Enable - * 0b0..Minor loop offset not applied to SADDR - * 0b1..Minor loop offset applied to SADDR - */ -#define DMA_TCD_NBYTES_MLOFFYES_SMLOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFYES_SMLOE_SHIFT)) & DMA_TCD_NBYTES_MLOFFYES_SMLOE_MASK) -/*! @} */ - -/* The count of DMA_TCD_NBYTES_MLOFFYES */ -#define DMA_TCD_NBYTES_MLOFFYES_COUNT (4U) - -/*! @name TCD_SLAST_SDA - TCD Last Source Address Adjustment / Store DADDR Address */ -/*! @{ */ - -#define DMA_TCD_SLAST_SDA_SLAST_SDA_MASK (0xFFFFFFFFU) -#define DMA_TCD_SLAST_SDA_SLAST_SDA_SHIFT (0U) -/*! SLAST_SDA - Last Source Address Adjustment / Store DADDR Address */ -#define DMA_TCD_SLAST_SDA_SLAST_SDA(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_SLAST_SDA_SLAST_SDA_SHIFT)) & DMA_TCD_SLAST_SDA_SLAST_SDA_MASK) -/*! @} */ - -/* The count of DMA_TCD_SLAST_SDA */ -#define DMA_TCD_SLAST_SDA_COUNT (4U) - -/*! @name TCD_DADDR - TCD Destination Address */ -/*! @{ */ - -#define DMA_TCD_DADDR_DADDR_MASK (0xFFFFFFFFU) -#define DMA_TCD_DADDR_DADDR_SHIFT (0U) -/*! DADDR - Destination Address */ -#define DMA_TCD_DADDR_DADDR(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_DADDR_DADDR_SHIFT)) & DMA_TCD_DADDR_DADDR_MASK) -/*! @} */ - -/* The count of DMA_TCD_DADDR */ -#define DMA_TCD_DADDR_COUNT (4U) - -/*! @name TCD_DOFF - TCD Signed Destination Address Offset */ -/*! @{ */ - -#define DMA_TCD_DOFF_DOFF_MASK (0xFFFFU) -#define DMA_TCD_DOFF_DOFF_SHIFT (0U) -/*! DOFF - Destination Address Signed Offset */ -#define DMA_TCD_DOFF_DOFF(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_DOFF_DOFF_SHIFT)) & DMA_TCD_DOFF_DOFF_MASK) -/*! @} */ - -/* The count of DMA_TCD_DOFF */ -#define DMA_TCD_DOFF_COUNT (4U) - -/*! @name TCD_CITER_ELINKNO - TCD Current Major Loop Count (Minor Loop Channel Linking Disabled) */ -/*! @{ */ - -#define DMA_TCD_CITER_ELINKNO_CITER_MASK (0x7FFFU) -#define DMA_TCD_CITER_ELINKNO_CITER_SHIFT (0U) -/*! CITER - Current Major Iteration Count */ -#define DMA_TCD_CITER_ELINKNO_CITER(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CITER_ELINKNO_CITER_SHIFT)) & DMA_TCD_CITER_ELINKNO_CITER_MASK) - -#define DMA_TCD_CITER_ELINKNO_ELINK_MASK (0x8000U) -#define DMA_TCD_CITER_ELINKNO_ELINK_SHIFT (15U) -/*! ELINK - Enable Link - * 0b0..Channel-to-channel linking disabled - * 0b1..Channel-to-channel linking enabled - */ -#define DMA_TCD_CITER_ELINKNO_ELINK(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CITER_ELINKNO_ELINK_SHIFT)) & DMA_TCD_CITER_ELINKNO_ELINK_MASK) -/*! @} */ - -/* The count of DMA_TCD_CITER_ELINKNO */ -#define DMA_TCD_CITER_ELINKNO_COUNT (4U) - -/*! @name TCD_CITER_ELINKYES - TCD Current Major Loop Count (Minor Loop Channel Linking Enabled) */ -/*! @{ */ - -#define DMA_TCD_CITER_ELINKYES_CITER_MASK (0x1FFU) -#define DMA_TCD_CITER_ELINKYES_CITER_SHIFT (0U) -/*! CITER - Current Major Iteration Count */ -#define DMA_TCD_CITER_ELINKYES_CITER(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CITER_ELINKYES_CITER_SHIFT)) & DMA_TCD_CITER_ELINKYES_CITER_MASK) - -#define DMA_TCD_CITER_ELINKYES_LINKCH_MASK (0x600U) -#define DMA_TCD_CITER_ELINKYES_LINKCH_SHIFT (9U) -/*! LINKCH - Minor Loop Link Channel Number */ -#define DMA_TCD_CITER_ELINKYES_LINKCH(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CITER_ELINKYES_LINKCH_SHIFT)) & DMA_TCD_CITER_ELINKYES_LINKCH_MASK) - -#define DMA_TCD_CITER_ELINKYES_ELINK_MASK (0x8000U) -#define DMA_TCD_CITER_ELINKYES_ELINK_SHIFT (15U) -/*! ELINK - Enable Link - * 0b0..Channel-to-channel linking disabled - * 0b1..Channel-to-channel linking enabled - */ -#define DMA_TCD_CITER_ELINKYES_ELINK(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CITER_ELINKYES_ELINK_SHIFT)) & DMA_TCD_CITER_ELINKYES_ELINK_MASK) -/*! @} */ - -/* The count of DMA_TCD_CITER_ELINKYES */ -#define DMA_TCD_CITER_ELINKYES_COUNT (4U) - -/*! @name TCD_DLAST_SGA - TCD Last Destination Address Adjustment / Scatter Gather Address */ -/*! @{ */ - -#define DMA_TCD_DLAST_SGA_DLAST_SGA_MASK (0xFFFFFFFFU) -#define DMA_TCD_DLAST_SGA_DLAST_SGA_SHIFT (0U) -/*! DLAST_SGA - Last Destination Address Adjustment / Scatter Gather Address */ -#define DMA_TCD_DLAST_SGA_DLAST_SGA(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_DLAST_SGA_DLAST_SGA_SHIFT)) & DMA_TCD_DLAST_SGA_DLAST_SGA_MASK) -/*! @} */ - -/* The count of DMA_TCD_DLAST_SGA */ -#define DMA_TCD_DLAST_SGA_COUNT (4U) - -/*! @name TCD_CSR - TCD Control and Status */ -/*! @{ */ - -#define DMA_TCD_CSR_START_MASK (0x1U) -#define DMA_TCD_CSR_START_SHIFT (0U) -/*! START - Channel Start - * 0b0..Channel not explicitly started - * 0b1..Channel explicitly started via a software-initiated service request - */ -#define DMA_TCD_CSR_START(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_START_SHIFT)) & DMA_TCD_CSR_START_MASK) - -#define DMA_TCD_CSR_INTMAJOR_MASK (0x2U) -#define DMA_TCD_CSR_INTMAJOR_SHIFT (1U) -/*! INTMAJOR - Enable Interrupt If Major count complete - * 0b0..End-of-major loop interrupt disabled - * 0b1..End-of-major loop interrupt enabled - */ -#define DMA_TCD_CSR_INTMAJOR(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_INTMAJOR_SHIFT)) & DMA_TCD_CSR_INTMAJOR_MASK) - -#define DMA_TCD_CSR_INTHALF_MASK (0x4U) -#define DMA_TCD_CSR_INTHALF_SHIFT (2U) -/*! INTHALF - Enable Interrupt If Major Counter Half-complete - * 0b0..Halfway point interrupt disabled - * 0b1..Halfway point interrupt enabled - */ -#define DMA_TCD_CSR_INTHALF(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_INTHALF_SHIFT)) & DMA_TCD_CSR_INTHALF_MASK) - -#define DMA_TCD_CSR_DREQ_MASK (0x8U) -#define DMA_TCD_CSR_DREQ_SHIFT (3U) -/*! DREQ - Disable Request - * 0b0..No operation - * 0b1..Clear the ERQ field to 0 upon major loop completion, thus disabling hardware service requests - */ -#define DMA_TCD_CSR_DREQ(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_DREQ_SHIFT)) & DMA_TCD_CSR_DREQ_MASK) - -#define DMA_TCD_CSR_ESG_MASK (0x10U) -#define DMA_TCD_CSR_ESG_SHIFT (4U) -/*! ESG - Enable Scatter/Gather Processing - * 0b0..Current channel's TCD is normal format - * 0b1..Current channel's TCD specifies scatter/gather format. - */ -#define DMA_TCD_CSR_ESG(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_ESG_SHIFT)) & DMA_TCD_CSR_ESG_MASK) - -#define DMA_TCD_CSR_MAJORELINK_MASK (0x20U) -#define DMA_TCD_CSR_MAJORELINK_SHIFT (5U) -/*! MAJORELINK - Enable Link When Major Loop Complete - * 0b0..Channel-to-channel linking disabled - * 0b1..Channel-to-channel linking enabled - */ -#define DMA_TCD_CSR_MAJORELINK(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_MAJORELINK_SHIFT)) & DMA_TCD_CSR_MAJORELINK_MASK) - -#define DMA_TCD_CSR_EEOP_MASK (0x40U) -#define DMA_TCD_CSR_EEOP_SHIFT (6U) -/*! EEOP - Enable End-Of-Packet Processing - * 0b0..End-of-packet operation disabled - * 0b1..End-of-packet hardware input signal enabled - */ -#define DMA_TCD_CSR_EEOP(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_EEOP_SHIFT)) & DMA_TCD_CSR_EEOP_MASK) - -#define DMA_TCD_CSR_ESDA_MASK (0x80U) -#define DMA_TCD_CSR_ESDA_SHIFT (7U) -/*! ESDA - Enable Store Destination Address - * 0b0..Ability to store destination address to system memory disabled - * 0b1..Ability to store destination address to system memory enabled - */ -#define DMA_TCD_CSR_ESDA(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_ESDA_SHIFT)) & DMA_TCD_CSR_ESDA_MASK) - -#define DMA_TCD_CSR_MAJORLINKCH_MASK (0x300U) -#define DMA_TCD_CSR_MAJORLINKCH_SHIFT (8U) -/*! MAJORLINKCH - Major Loop Link Channel Number */ -#define DMA_TCD_CSR_MAJORLINKCH(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_MAJORLINKCH_SHIFT)) & DMA_TCD_CSR_MAJORLINKCH_MASK) - -#define DMA_TCD_CSR_BWC_MASK (0xC000U) -#define DMA_TCD_CSR_BWC_SHIFT (14U) -/*! BWC - Bandwidth Control - * 0b00..No eDMA engine stalls - * 0b01.. - * 0b10..eDMA engine stalls for 4 cycles after each R/W - * 0b11..eDMA engine stalls for 8 cycles after each R/W - */ -#define DMA_TCD_CSR_BWC(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_BWC_SHIFT)) & DMA_TCD_CSR_BWC_MASK) -/*! @} */ - -/* The count of DMA_TCD_CSR */ -#define DMA_TCD_CSR_COUNT (4U) - -/*! @name TCD_BITER_ELINKNO - TCD Beginning Major Loop Count (Minor Loop Channel Linking Disabled) */ -/*! @{ */ - -#define DMA_TCD_BITER_ELINKNO_BITER_MASK (0x7FFFU) -#define DMA_TCD_BITER_ELINKNO_BITER_SHIFT (0U) -/*! BITER - Starting Major Iteration Count */ -#define DMA_TCD_BITER_ELINKNO_BITER(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_BITER_ELINKNO_BITER_SHIFT)) & DMA_TCD_BITER_ELINKNO_BITER_MASK) - -#define DMA_TCD_BITER_ELINKNO_ELINK_MASK (0x8000U) -#define DMA_TCD_BITER_ELINKNO_ELINK_SHIFT (15U) -/*! ELINK - Enables Link - * 0b0..Channel-to-channel linking disabled - * 0b1..Channel-to-channel linking enabled - */ -#define DMA_TCD_BITER_ELINKNO_ELINK(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_BITER_ELINKNO_ELINK_SHIFT)) & DMA_TCD_BITER_ELINKNO_ELINK_MASK) -/*! @} */ - -/* The count of DMA_TCD_BITER_ELINKNO */ -#define DMA_TCD_BITER_ELINKNO_COUNT (4U) - -/*! @name TCD_BITER_ELINKYES - TCD Beginning Major Loop Count (Minor Loop Channel Linking Enabled) */ -/*! @{ */ - -#define DMA_TCD_BITER_ELINKYES_BITER_MASK (0x1FFU) -#define DMA_TCD_BITER_ELINKYES_BITER_SHIFT (0U) -/*! BITER - Starting Major Iteration Count */ -#define DMA_TCD_BITER_ELINKYES_BITER(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_BITER_ELINKYES_BITER_SHIFT)) & DMA_TCD_BITER_ELINKYES_BITER_MASK) - -#define DMA_TCD_BITER_ELINKYES_LINKCH_MASK (0x600U) -#define DMA_TCD_BITER_ELINKYES_LINKCH_SHIFT (9U) -/*! LINKCH - Link Channel Number */ -#define DMA_TCD_BITER_ELINKYES_LINKCH(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_BITER_ELINKYES_LINKCH_SHIFT)) & DMA_TCD_BITER_ELINKYES_LINKCH_MASK) - -#define DMA_TCD_BITER_ELINKYES_ELINK_MASK (0x8000U) -#define DMA_TCD_BITER_ELINKYES_ELINK_SHIFT (15U) -/*! ELINK - Enable Link - * 0b0..Channel-to-channel linking disabled - * 0b1..Channel-to-channel linking enabled - */ -#define DMA_TCD_BITER_ELINKYES_ELINK(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_BITER_ELINKYES_ELINK_SHIFT)) & DMA_TCD_BITER_ELINKYES_ELINK_MASK) -/*! @} */ - -/* The count of DMA_TCD_BITER_ELINKYES */ -#define DMA_TCD_BITER_ELINKYES_COUNT (4U) - - -/*! - * @} - */ /* end of group DMA_Register_Masks */ - - -/* DMA - Peripheral instance base addresses */ -/** Peripheral DMA0 base address */ -#define DMA0_BASE (0x40080000u) -/** Peripheral DMA0 base pointer */ -#define DMA0 ((DMA_Type *)DMA0_BASE) -/** Array initializer of DMA peripheral base addresses */ -#define DMA_BASE_ADDRS { DMA0_BASE } -/** Array initializer of DMA peripheral base pointers */ -#define DMA_BASE_PTRS { DMA0 } - -/*! - * @} - */ /* end of group DMA_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- EIM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup EIM_Peripheral_Access_Layer EIM Peripheral Access Layer - * @{ - */ - -/** EIM - Register Layout Typedef */ -typedef struct { - __IO uint32_t EIMCR; /**< Error Injection Module Configuration Register, offset: 0x0 */ - __IO uint32_t EICHEN; /**< Error Injection Channel Enable register, offset: 0x4 */ - uint8_t RESERVED_0[248]; - __IO uint32_t EICHD0_WORD0; /**< Error Injection Channel Descriptor 0, Word0, offset: 0x100 */ - __IO uint32_t EICHD0_WORD1; /**< Error Injection Channel Descriptor 0, Word1, offset: 0x104 */ -} EIM_Type; - -/* ---------------------------------------------------------------------------- - -- EIM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup EIM_Register_Masks EIM Register Masks - * @{ - */ - -/*! @name EIMCR - Error Injection Module Configuration Register */ -/*! @{ */ - -#define EIM_EIMCR_GEIEN_MASK (0x1U) -#define EIM_EIMCR_GEIEN_SHIFT (0U) -/*! GEIEN - Global Error Injection Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EIM_EIMCR_GEIEN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EIMCR_GEIEN_SHIFT)) & EIM_EIMCR_GEIEN_MASK) -/*! @} */ - -/*! @name EICHEN - Error Injection Channel Enable register */ -/*! @{ */ - -#define EIM_EICHEN_EICH0EN_MASK (0x80000000U) -#define EIM_EICHEN_EICH0EN_SHIFT (31U) -/*! EICH0EN - Error Injection Channel 0 Enable - * 0b0..Error injection is disabled on Error Injection Channel 0 - * 0b1..Error injection is enabled on Error Injection Channel 0 - */ -#define EIM_EICHEN_EICH0EN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHEN_EICH0EN_SHIFT)) & EIM_EICHEN_EICH0EN_MASK) -/*! @} */ - -/*! @name EICHD0_WORD0 - Error Injection Channel Descriptor 0, Word0 */ -/*! @{ */ - -#define EIM_EICHD0_WORD0_CHKBIT_MASK_MASK (0xFE000000U) -#define EIM_EICHD0_WORD0_CHKBIT_MASK_SHIFT (25U) -/*! CHKBIT_MASK - Checkbit Mask */ -#define EIM_EICHD0_WORD0_CHKBIT_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD0_WORD0_CHKBIT_MASK_SHIFT)) & EIM_EICHD0_WORD0_CHKBIT_MASK_MASK) -/*! @} */ - -/*! @name EICHD0_WORD1 - Error Injection Channel Descriptor 0, Word1 */ -/*! @{ */ - -#define EIM_EICHD0_WORD1_B0_3DATA_MASK_MASK (0xFFFFFFFFU) -#define EIM_EICHD0_WORD1_B0_3DATA_MASK_SHIFT (0U) -/*! B0_3DATA_MASK - Data Mask Bytes 0-3 */ -#define EIM_EICHD0_WORD1_B0_3DATA_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD0_WORD1_B0_3DATA_MASK_SHIFT)) & EIM_EICHD0_WORD1_B0_3DATA_MASK_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group EIM_Register_Masks */ - - -/* EIM - Peripheral instance base addresses */ -/** Peripheral EIM0 base address */ -#define EIM0_BASE (0x4008C000u) -/** Peripheral EIM0 base pointer */ -#define EIM0 ((EIM_Type *)EIM0_BASE) -/** Array initializer of EIM peripheral base addresses */ -#define EIM_BASE_ADDRS { EIM0_BASE } -/** Array initializer of EIM peripheral base pointers */ -#define EIM_BASE_PTRS { EIM0 } - -/*! - * @} - */ /* end of group EIM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- EQDC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup EQDC_Peripheral_Access_Layer EQDC Peripheral Access Layer - * @{ - */ - -/** EQDC - Register Layout Typedef */ -typedef struct { - __IO uint16_t CTRL; /**< Control Register, offset: 0x0 */ - __IO uint16_t CTRL2; /**< Control 2 Register, offset: 0x2 */ - __IO uint16_t FILT; /**< Input Filter Register, offset: 0x4 */ - __I uint16_t LASTEDGE; /**< Last Edge Time Register, offset: 0x6 */ - __I uint16_t POSDPER; /**< Position Difference Period Counter Register, offset: 0x8 */ - __I uint16_t POSDPERBFR; /**< Position Difference Period Buffer Register, offset: 0xA */ - __IO uint16_t UPOS; /**< Upper Position Counter Register, offset: 0xC */ - __IO uint16_t LPOS; /**< Lower Position Counter Register, offset: 0xE */ - __IO uint16_t POSD; /**< Position Difference Counter Register, offset: 0x10 */ - __I uint16_t POSDH; /**< Position Difference Hold Register, offset: 0x12 */ - __I uint16_t UPOSH; /**< Upper Position Hold Register, offset: 0x14 */ - __I uint16_t LPOSH; /**< Lower Position Hold Register, offset: 0x16 */ - __I uint16_t LASTEDGEH; /**< Last Edge Time Hold Register, offset: 0x18 */ - __I uint16_t POSDPERH; /**< Position Difference Period Hold Register, offset: 0x1A */ - __I uint16_t REVH; /**< Revolution Hold Register, offset: 0x1C */ - __IO uint16_t REV; /**< Revolution Counter Register, offset: 0x1E */ - __IO uint16_t UINIT; /**< Upper Initialization Register, offset: 0x20 */ - __IO uint16_t LINIT; /**< Lower Initialization Register, offset: 0x22 */ - __IO uint16_t UMOD; /**< Upper Modulus Register, offset: 0x24 */ - __IO uint16_t LMOD; /**< Lower Modulus Register, offset: 0x26 */ - __IO uint16_t UCOMP0; /**< Upper Position Compare Register 0, offset: 0x28 */ - __IO uint16_t LCOMP0; /**< Lower Position Compare Register 0, offset: 0x2A */ - union { /* offset: 0x2C */ - __O uint16_t UCOMP1; /**< Upper Position Compare 1, offset: 0x2C */ - __I uint16_t UPOSH1; /**< Upper Position Holder Register 1, offset: 0x2C */ - }; - union { /* offset: 0x2E */ - __O uint16_t LCOMP1; /**< Lower Position Compare 1, offset: 0x2E */ - __I uint16_t LPOSH1; /**< Lower Position Holder Register 1, offset: 0x2E */ - }; - union { /* offset: 0x30 */ - __O uint16_t UCOMP2; /**< Upper Position Compare 2, offset: 0x30 */ - __I uint16_t UPOSH2; /**< Upper Position Holder Register 3, offset: 0x30 */ - }; - union { /* offset: 0x32 */ - __O uint16_t LCOMP2; /**< Lower Position Compare 2, offset: 0x32 */ - __I uint16_t LPOSH2; /**< Lower Position Holder Register 2, offset: 0x32 */ - }; - union { /* offset: 0x34 */ - __O uint16_t UCOMP3; /**< Upper Position Compare 3, offset: 0x34 */ - __I uint16_t UPOSH3; /**< Upper Position Holder Register 3, offset: 0x34 */ - }; - union { /* offset: 0x36 */ - __O uint16_t LCOMP3; /**< Lower Position Compare 3, offset: 0x36 */ - __I uint16_t LPOSH3; /**< Lower Position Holder Register 3, offset: 0x36 */ - }; - __IO uint16_t INTCTRL; /**< Interrupt Control Register, offset: 0x38 */ - __IO uint16_t WTR; /**< Watchdog Timeout Register, offset: 0x3A */ - __IO uint16_t IMR; /**< Input Monitor Register, offset: 0x3C */ - __IO uint16_t TST; /**< Test Register, offset: 0x3E */ - uint8_t RESERVED_0[16]; - __I uint16_t UVERID; /**< Upper VERID, offset: 0x50 */ - __I uint16_t LVERID; /**< Lower VERID, offset: 0x52 */ -} EQDC_Type; - -/* ---------------------------------------------------------------------------- - -- EQDC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup EQDC_Register_Masks EQDC Register Masks - * @{ - */ - -/*! @name CTRL - Control Register */ -/*! @{ */ - -#define EQDC_CTRL_LDOK_MASK (0x1U) -#define EQDC_CTRL_LDOK_SHIFT (0U) -/*! LDOK - Load Okay - * 0b0..No loading action taken. Users can write new values to buffered registers (writing into outer-set of these buffered registers) - * 0b1..Outer-set values are ready to be loaded into inner-set and take effect. The loading time point depends on CTRL2[LDMOD]. - */ -#define EQDC_CTRL_LDOK(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_LDOK_SHIFT)) & EQDC_CTRL_LDOK_MASK) - -#define EQDC_CTRL_DMAEN_MASK (0x2U) -#define EQDC_CTRL_DMAEN_SHIFT (1U) -/*! DMAEN - DMA Enable - * 0b0..DMA is disabled - * 0b1..DMA is enabled. DMA request asserts automatically when the values in the outer-set of buffered compare - * registers (UCOMP0/LCOMP0;UCOMP1/LCOMP1;UCOMP2/LCOMP2;UCOMP3/LCOMP3), initial registers(UINIT/LINIT) and - * modulus registers (UMOD/LMOD) are loaded into the inner-set of buffer and then LDOK is cleared automatically. - * After the completion of this DMA transfer, LDOK is set automatically, it ensures outer-set values can be - * loaded into inner-set which in turn triggers DMA again. - */ -#define EQDC_CTRL_DMAEN(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_DMAEN_SHIFT)) & EQDC_CTRL_DMAEN_MASK) - -#define EQDC_CTRL_WDE_MASK (0x4U) -#define EQDC_CTRL_WDE_SHIFT (2U) -/*! WDE - Watchdog Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EQDC_CTRL_WDE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_WDE_SHIFT)) & EQDC_CTRL_WDE_MASK) - -#define EQDC_CTRL_WDIE_MASK (0x8U) -#define EQDC_CTRL_WDIE_SHIFT (3U) -/*! WDIE - Watchdog Timeout Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EQDC_CTRL_WDIE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_WDIE_SHIFT)) & EQDC_CTRL_WDIE_MASK) - -#define EQDC_CTRL_WDIRQ_MASK (0x10U) -#define EQDC_CTRL_WDIRQ_SHIFT (4U) -/*! WDIRQ - Watchdog Timeout Interrupt Request - * 0b0..No Watchdog timeout interrupt has occurred - * 0b1..Watchdog timeout interrupt has occurred - */ -#define EQDC_CTRL_WDIRQ(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_WDIRQ_SHIFT)) & EQDC_CTRL_WDIRQ_MASK) - -#define EQDC_CTRL_XNE_MASK (0x20U) -#define EQDC_CTRL_XNE_SHIFT (5U) -/*! XNE - Select Positive/Negative Edge of INDEX/PRESET Pulse - * 0b0..Use positive edge of INDEX/PRESET pulse - * 0b1..Use negative edge of INDEX/PRESET pulse - */ -#define EQDC_CTRL_XNE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_XNE_SHIFT)) & EQDC_CTRL_XNE_MASK) - -#define EQDC_CTRL_XIP_MASK (0x40U) -#define EQDC_CTRL_XIP_SHIFT (6U) -/*! XIP - INDEX Triggered Initialization of Position Counters UPOS and LPOS - * 0b0..INDEX pulse does not initialize the position counter - * 0b1..INDEX pulse initializes the position counter - */ -#define EQDC_CTRL_XIP(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_XIP_SHIFT)) & EQDC_CTRL_XIP_MASK) - -#define EQDC_CTRL_XIE_MASK (0x80U) -#define EQDC_CTRL_XIE_SHIFT (7U) -/*! XIE - INDEX/PRESET Pulse Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EQDC_CTRL_XIE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_XIE_SHIFT)) & EQDC_CTRL_XIE_MASK) - -#define EQDC_CTRL_XIRQ_MASK (0x100U) -#define EQDC_CTRL_XIRQ_SHIFT (8U) -/*! XIRQ - INDEX/PRESET Pulse Interrupt Request - * 0b0..INDEX/PRESET pulse has not occurred - * 0b1..INDEX/PRESET pulse has occurred - */ -#define EQDC_CTRL_XIRQ(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_XIRQ_SHIFT)) & EQDC_CTRL_XIRQ_MASK) - -#define EQDC_CTRL_PH1_MASK (0x200U) -#define EQDC_CTRL_PH1_SHIFT (9U) -/*! PH1 - Enable Single Phase Mode - * 0b0..Standard quadrature decoder, where PHASEA and PHASEB represent a two-phase quadrature signal. - * 0b1..Single phase mode, bypass the quadrature decoder, refer to CTRL2[CMODE] description - */ -#define EQDC_CTRL_PH1(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_PH1_SHIFT)) & EQDC_CTRL_PH1_MASK) - -#define EQDC_CTRL_REV_MASK (0x400U) -#define EQDC_CTRL_REV_SHIFT (10U) -/*! REV - Enable Reverse Direction Counting - * 0b0..Count normally and the position counter initialization uses upper/lower initialization register UINIT/LINIT - * 0b1..Count in the reverse direction and the position counter initialization uses upper/lower modulus register UMOD/LMOD - */ -#define EQDC_CTRL_REV(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_REV_SHIFT)) & EQDC_CTRL_REV_MASK) - -#define EQDC_CTRL_SWIP_MASK (0x800U) -#define EQDC_CTRL_SWIP_SHIFT (11U) -/*! SWIP - Software-Triggered Initialization of Position Counters UPOS and LPOS - * 0b0..No action - * 0b1..Initialize position counter - */ -#define EQDC_CTRL_SWIP(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_SWIP_SHIFT)) & EQDC_CTRL_SWIP_MASK) - -#define EQDC_CTRL_HNE_MASK (0x1000U) -#define EQDC_CTRL_HNE_SHIFT (12U) -/*! HNE - Use Negative Edge of HOME/ENABLE Input - * 0b0..When CTRL[OPMODE] = 0,use HOME positive edge to trigger initialization of position counters. When - * CTRL[OPMODE] = 1,use ENABLE high level to enable POS/POSD/WDG/REV counters - * 0b1..When CTRL[OPMODE] = 0,use HOME negative edge to trigger initialization of position counters. When - * CTRL[OPMODE] = 1,use ENABLE low level to enable POS/POSD/WDG/REV counters - */ -#define EQDC_CTRL_HNE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_HNE_SHIFT)) & EQDC_CTRL_HNE_MASK) - -#define EQDC_CTRL_HIP_MASK (0x2000U) -#define EQDC_CTRL_HIP_SHIFT (13U) -/*! HIP - Enable HOME to Initialize Position Counter UPOS/LPOS - * 0b0..No action - * 0b1..HOME signal initializes the position counter - */ -#define EQDC_CTRL_HIP(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_HIP_SHIFT)) & EQDC_CTRL_HIP_MASK) - -#define EQDC_CTRL_HIE_MASK (0x4000U) -#define EQDC_CTRL_HIE_SHIFT (14U) -/*! HIE - HOME/ENABLE Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EQDC_CTRL_HIE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_HIE_SHIFT)) & EQDC_CTRL_HIE_MASK) - -#define EQDC_CTRL_HIRQ_MASK (0x8000U) -#define EQDC_CTRL_HIRQ_SHIFT (15U) -/*! HIRQ - HOME/ENABLE Signal Transition Interrupt Request - * 0b0..No transition on the HOME/ENABLE signal has occurred - * 0b1..A transition on the HOME/ENABLE signal has occurred - */ -#define EQDC_CTRL_HIRQ(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_HIRQ_SHIFT)) & EQDC_CTRL_HIRQ_MASK) -/*! @} */ - -/*! @name CTRL2 - Control 2 Register */ -/*! @{ */ - -#define EQDC_CTRL2_UPDHLD_MASK (0x1U) -#define EQDC_CTRL2_UPDHLD_SHIFT (0U) -/*! UPDHLD - Update Hold Registers */ -#define EQDC_CTRL2_UPDHLD(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL2_UPDHLD_SHIFT)) & EQDC_CTRL2_UPDHLD_MASK) - -#define EQDC_CTRL2_UPDPOS_MASK (0x2U) -#define EQDC_CTRL2_UPDPOS_SHIFT (1U) -/*! UPDPOS - Update Position Registers */ -#define EQDC_CTRL2_UPDPOS(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL2_UPDPOS_SHIFT)) & EQDC_CTRL2_UPDPOS_MASK) - -#define EQDC_CTRL2_OPMODE_MASK (0x4U) -#define EQDC_CTRL2_OPMODE_SHIFT (2U) -/*! OPMODE - Operation Mode Select - * 0b0..Decode Mode: Input nodes INDEX/PRESET and HOME/ENABLE are assigned to function of INDEX and HOME. - * 0b1..Count Mode: Input nodes INDEX/PRESET and HOME/ENABLE are assigned to functions of PRESET and ENABLE. In - * this mode: (1)only when ENABLE=1, all counters (position/position difference/revolution/watchdog) can run, - * when ENABLE=0, all counters (position/position difference/revolution/watchdog) can't run. (2) the rising - * edge of PRESET input can initialize position/revolution/watchdog counters (position counter initialization - * also need referring to bit CTRL[REV]). - */ -#define EQDC_CTRL2_OPMODE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL2_OPMODE_SHIFT)) & EQDC_CTRL2_OPMODE_MASK) - -#define EQDC_CTRL2_LDMOD_MASK (0x8U) -#define EQDC_CTRL2_LDMOD_SHIFT (3U) -/*! LDMOD - Buffered Register Load (Update) Mode Select - * 0b0..Buffered registers are loaded and take effect immediately upon CTRL[LDOK] is set. - * 0b1..Buffered registers are loaded and take effect at the next roll-over or roll-under if CTRL[LDOK] is set. - */ -#define EQDC_CTRL2_LDMOD(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL2_LDMOD_SHIFT)) & EQDC_CTRL2_LDMOD_MASK) - -#define EQDC_CTRL2_REVMOD_MASK (0x100U) -#define EQDC_CTRL2_REVMOD_SHIFT (8U) -/*! REVMOD - Revolution Counter Modulus Enable - * 0b0..Use INDEX pulse to increment/decrement revolution counter (REV) - * 0b1..Use modulus counting roll-over/under to increment/decrement revolution counter (REV) - */ -#define EQDC_CTRL2_REVMOD(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL2_REVMOD_SHIFT)) & EQDC_CTRL2_REVMOD_MASK) - -#define EQDC_CTRL2_OUTCTL_MASK (0x200U) -#define EQDC_CTRL2_OUTCTL_SHIFT (9U) -/*! OUTCTL - Output Control - * 0b0..POS_MATCH[x](x range is 0-3) is asserted when the Position Counter is equal to according compare value - * (UCOMPx/LCOMPx)(x range is 0-3), and de-asserted when the Position Counter not equal to the compare value - * (UCOMPx/LCOMPx)(x range is 0-3) - * 0b1..All POS_MATCH[x](x range is 0-3) are asserted a pulse, when the UPOS, LPOS, REV, or POSD registers are read - */ -#define EQDC_CTRL2_OUTCTL(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL2_OUTCTL_SHIFT)) & EQDC_CTRL2_OUTCTL_MASK) - -#define EQDC_CTRL2_PMEN_MASK (0x400U) -#define EQDC_CTRL2_PMEN_SHIFT (10U) -/*! PMEN - Period measurement function enable - * 0b0..Period measurement functions are not used. POSD is loaded to POSDH and then cleared whenever POSD, UPOS, LPOS or REV is read. - * 0b1..Period measurement functions are used. POSD is loaded into POSDH and then cleared only when POSD is read. - */ -#define EQDC_CTRL2_PMEN(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL2_PMEN_SHIFT)) & EQDC_CTRL2_PMEN_MASK) - -#define EQDC_CTRL2_EMIP_MASK (0x800U) -#define EQDC_CTRL2_EMIP_SHIFT (11U) -/*! EMIP - Enables/disables the position counter to be initialized by Index Event Edge Mark - * 0b0..disables the position counter to be initialized by Index Event Edge Mark - * 0b1..enables the position counter to be initialized by Index Event Edge Mark. - */ -#define EQDC_CTRL2_EMIP(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL2_EMIP_SHIFT)) & EQDC_CTRL2_EMIP_MASK) - -#define EQDC_CTRL2_INITPOS_MASK (0x1000U) -#define EQDC_CTRL2_INITPOS_SHIFT (12U) -/*! INITPOS - Initial Position Register - * 0b0..Don't initialize position counter on rising edge of TRIGGER - * 0b1..Initialize position counter on rising edge of TRIGGER - */ -#define EQDC_CTRL2_INITPOS(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL2_INITPOS_SHIFT)) & EQDC_CTRL2_INITPOS_MASK) - -#define EQDC_CTRL2_ONCE_MASK (0x2000U) -#define EQDC_CTRL2_ONCE_SHIFT (13U) -/*! ONCE - Count Once - * 0b0..Position counter counts repeatedly - * 0b1..Position counter counts until roll-over or roll-under, then stop. - */ -#define EQDC_CTRL2_ONCE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL2_ONCE_SHIFT)) & EQDC_CTRL2_ONCE_MASK) - -#define EQDC_CTRL2_CMODE_MASK (0xC000U) -#define EQDC_CTRL2_CMODE_SHIFT (14U) -/*! CMODE - Counting Mode */ -#define EQDC_CTRL2_CMODE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL2_CMODE_SHIFT)) & EQDC_CTRL2_CMODE_MASK) -/*! @} */ - -/*! @name FILT - Input Filter Register */ -/*! @{ */ - -#define EQDC_FILT_FILT_PER_MASK (0xFFU) -#define EQDC_FILT_FILT_PER_SHIFT (0U) -/*! FILT_PER - Input Filter Sample Period */ -#define EQDC_FILT_FILT_PER(x) (((uint16_t)(((uint16_t)(x)) << EQDC_FILT_FILT_PER_SHIFT)) & EQDC_FILT_FILT_PER_MASK) - -#define EQDC_FILT_FILT_CNT_MASK (0x700U) -#define EQDC_FILT_FILT_CNT_SHIFT (8U) -/*! FILT_CNT - Input Filter Sample Count */ -#define EQDC_FILT_FILT_CNT(x) (((uint16_t)(((uint16_t)(x)) << EQDC_FILT_FILT_CNT_SHIFT)) & EQDC_FILT_FILT_CNT_MASK) - -#define EQDC_FILT_FILT_CS_MASK (0x800U) -#define EQDC_FILT_FILT_CS_SHIFT (11U) -/*! FILT_CS - Filter Clock Source selection - * 0b0..Peripheral Clock - * 0b1..Prescaled peripheral clock by PRSC - */ -#define EQDC_FILT_FILT_CS(x) (((uint16_t)(((uint16_t)(x)) << EQDC_FILT_FILT_CS_SHIFT)) & EQDC_FILT_FILT_CS_MASK) - -#define EQDC_FILT_PRSC_MASK (0xF000U) -#define EQDC_FILT_PRSC_SHIFT (12U) -/*! PRSC - Prescaler */ -#define EQDC_FILT_PRSC(x) (((uint16_t)(((uint16_t)(x)) << EQDC_FILT_PRSC_SHIFT)) & EQDC_FILT_PRSC_MASK) -/*! @} */ - -/*! @name LASTEDGE - Last Edge Time Register */ -/*! @{ */ - -#define EQDC_LASTEDGE_LASTEDGE_MASK (0xFFFFU) -#define EQDC_LASTEDGE_LASTEDGE_SHIFT (0U) -/*! LASTEDGE - Last Edge Time Counter */ -#define EQDC_LASTEDGE_LASTEDGE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_LASTEDGE_LASTEDGE_SHIFT)) & EQDC_LASTEDGE_LASTEDGE_MASK) -/*! @} */ - -/*! @name POSDPER - Position Difference Period Counter Register */ -/*! @{ */ - -#define EQDC_POSDPER_POSDPER_MASK (0xFFFFU) -#define EQDC_POSDPER_POSDPER_SHIFT (0U) -/*! POSDPER - Position difference period */ -#define EQDC_POSDPER_POSDPER(x) (((uint16_t)(((uint16_t)(x)) << EQDC_POSDPER_POSDPER_SHIFT)) & EQDC_POSDPER_POSDPER_MASK) -/*! @} */ - -/*! @name POSDPERBFR - Position Difference Period Buffer Register */ -/*! @{ */ - -#define EQDC_POSDPERBFR_POSDPERBFR_MASK (0xFFFFU) -#define EQDC_POSDPERBFR_POSDPERBFR_SHIFT (0U) -/*! POSDPERBFR - Position difference period buffer */ -#define EQDC_POSDPERBFR_POSDPERBFR(x) (((uint16_t)(((uint16_t)(x)) << EQDC_POSDPERBFR_POSDPERBFR_SHIFT)) & EQDC_POSDPERBFR_POSDPERBFR_MASK) -/*! @} */ - -/*! @name UPOS - Upper Position Counter Register */ -/*! @{ */ - -#define EQDC_UPOS_POS_MASK (0xFFFFU) -#define EQDC_UPOS_POS_SHIFT (0U) -/*! POS - POS */ -#define EQDC_UPOS_POS(x) (((uint16_t)(((uint16_t)(x)) << EQDC_UPOS_POS_SHIFT)) & EQDC_UPOS_POS_MASK) -/*! @} */ - -/*! @name LPOS - Lower Position Counter Register */ -/*! @{ */ - -#define EQDC_LPOS_POS_MASK (0xFFFFU) -#define EQDC_LPOS_POS_SHIFT (0U) -/*! POS - POS */ -#define EQDC_LPOS_POS(x) (((uint16_t)(((uint16_t)(x)) << EQDC_LPOS_POS_SHIFT)) & EQDC_LPOS_POS_MASK) -/*! @} */ - -/*! @name POSD - Position Difference Counter Register */ -/*! @{ */ - -#define EQDC_POSD_POSD_MASK (0xFFFFU) -#define EQDC_POSD_POSD_SHIFT (0U) -/*! POSD - POSD */ -#define EQDC_POSD_POSD(x) (((uint16_t)(((uint16_t)(x)) << EQDC_POSD_POSD_SHIFT)) & EQDC_POSD_POSD_MASK) -/*! @} */ - -/*! @name POSDH - Position Difference Hold Register */ -/*! @{ */ - -#define EQDC_POSDH_POSDH_MASK (0xFFFFU) -#define EQDC_POSDH_POSDH_SHIFT (0U) -/*! POSDH - POSDH */ -#define EQDC_POSDH_POSDH(x) (((uint16_t)(((uint16_t)(x)) << EQDC_POSDH_POSDH_SHIFT)) & EQDC_POSDH_POSDH_MASK) -/*! @} */ - -/*! @name UPOSH - Upper Position Hold Register */ -/*! @{ */ - -#define EQDC_UPOSH_POSH_MASK (0xFFFFU) -#define EQDC_UPOSH_POSH_SHIFT (0U) -/*! POSH - POSH */ -#define EQDC_UPOSH_POSH(x) (((uint16_t)(((uint16_t)(x)) << EQDC_UPOSH_POSH_SHIFT)) & EQDC_UPOSH_POSH_MASK) -/*! @} */ - -/*! @name LPOSH - Lower Position Hold Register */ -/*! @{ */ - -#define EQDC_LPOSH_LPOSH_MASK (0xFFFFU) -#define EQDC_LPOSH_LPOSH_SHIFT (0U) -/*! LPOSH - POSH */ -#define EQDC_LPOSH_LPOSH(x) (((uint16_t)(((uint16_t)(x)) << EQDC_LPOSH_LPOSH_SHIFT)) & EQDC_LPOSH_LPOSH_MASK) -/*! @} */ - -/*! @name LASTEDGEH - Last Edge Time Hold Register */ -/*! @{ */ - -#define EQDC_LASTEDGEH_LASTEDGEH_MASK (0xFFFFU) -#define EQDC_LASTEDGEH_LASTEDGEH_SHIFT (0U) -/*! LASTEDGEH - Last Edge Time Hold */ -#define EQDC_LASTEDGEH_LASTEDGEH(x) (((uint16_t)(((uint16_t)(x)) << EQDC_LASTEDGEH_LASTEDGEH_SHIFT)) & EQDC_LASTEDGEH_LASTEDGEH_MASK) -/*! @} */ - -/*! @name POSDPERH - Position Difference Period Hold Register */ -/*! @{ */ - -#define EQDC_POSDPERH_POSDPERH_MASK (0xFFFFU) -#define EQDC_POSDPERH_POSDPERH_SHIFT (0U) -/*! POSDPERH - Position difference period hold */ -#define EQDC_POSDPERH_POSDPERH(x) (((uint16_t)(((uint16_t)(x)) << EQDC_POSDPERH_POSDPERH_SHIFT)) & EQDC_POSDPERH_POSDPERH_MASK) -/*! @} */ - -/*! @name REVH - Revolution Hold Register */ -/*! @{ */ - -#define EQDC_REVH_REVH_MASK (0xFFFFU) -#define EQDC_REVH_REVH_SHIFT (0U) -/*! REVH - REVH */ -#define EQDC_REVH_REVH(x) (((uint16_t)(((uint16_t)(x)) << EQDC_REVH_REVH_SHIFT)) & EQDC_REVH_REVH_MASK) -/*! @} */ - -/*! @name REV - Revolution Counter Register */ -/*! @{ */ - -#define EQDC_REV_REV_MASK (0xFFFFU) -#define EQDC_REV_REV_SHIFT (0U) -/*! REV - REV */ -#define EQDC_REV_REV(x) (((uint16_t)(((uint16_t)(x)) << EQDC_REV_REV_SHIFT)) & EQDC_REV_REV_MASK) -/*! @} */ - -/*! @name UINIT - Upper Initialization Register */ -/*! @{ */ - -#define EQDC_UINIT_INIT_MASK (0xFFFFU) -#define EQDC_UINIT_INIT_SHIFT (0U) -/*! INIT - INIT */ -#define EQDC_UINIT_INIT(x) (((uint16_t)(((uint16_t)(x)) << EQDC_UINIT_INIT_SHIFT)) & EQDC_UINIT_INIT_MASK) -/*! @} */ - -/*! @name LINIT - Lower Initialization Register */ -/*! @{ */ - -#define EQDC_LINIT_INIT_MASK (0xFFFFU) -#define EQDC_LINIT_INIT_SHIFT (0U) -/*! INIT - INIT */ -#define EQDC_LINIT_INIT(x) (((uint16_t)(((uint16_t)(x)) << EQDC_LINIT_INIT_SHIFT)) & EQDC_LINIT_INIT_MASK) -/*! @} */ - -/*! @name UMOD - Upper Modulus Register */ -/*! @{ */ - -#define EQDC_UMOD_MOD_MASK (0xFFFFU) -#define EQDC_UMOD_MOD_SHIFT (0U) -/*! MOD - MOD */ -#define EQDC_UMOD_MOD(x) (((uint16_t)(((uint16_t)(x)) << EQDC_UMOD_MOD_SHIFT)) & EQDC_UMOD_MOD_MASK) -/*! @} */ - -/*! @name LMOD - Lower Modulus Register */ -/*! @{ */ - -#define EQDC_LMOD_MOD_MASK (0xFFFFU) -#define EQDC_LMOD_MOD_SHIFT (0U) -/*! MOD - MOD */ -#define EQDC_LMOD_MOD(x) (((uint16_t)(((uint16_t)(x)) << EQDC_LMOD_MOD_SHIFT)) & EQDC_LMOD_MOD_MASK) -/*! @} */ - -/*! @name UCOMP0 - Upper Position Compare Register 0 */ -/*! @{ */ - -#define EQDC_UCOMP0_UCOMP0_MASK (0xFFFFU) -#define EQDC_UCOMP0_UCOMP0_SHIFT (0U) -/*! UCOMP0 - UCOMP0 */ -#define EQDC_UCOMP0_UCOMP0(x) (((uint16_t)(((uint16_t)(x)) << EQDC_UCOMP0_UCOMP0_SHIFT)) & EQDC_UCOMP0_UCOMP0_MASK) -/*! @} */ - -/*! @name LCOMP0 - Lower Position Compare Register 0 */ -/*! @{ */ - -#define EQDC_LCOMP0_LCOMP0_MASK (0xFFFFU) -#define EQDC_LCOMP0_LCOMP0_SHIFT (0U) -/*! LCOMP0 - LCOMP0 */ -#define EQDC_LCOMP0_LCOMP0(x) (((uint16_t)(((uint16_t)(x)) << EQDC_LCOMP0_LCOMP0_SHIFT)) & EQDC_LCOMP0_LCOMP0_MASK) -/*! @} */ - -/*! @name UCOMP1 - Upper Position Compare 1 */ -/*! @{ */ - -#define EQDC_UCOMP1_UCOMP1_MASK (0xFFFFU) -#define EQDC_UCOMP1_UCOMP1_SHIFT (0U) -/*! UCOMP1 - UCOMP1 */ -#define EQDC_UCOMP1_UCOMP1(x) (((uint16_t)(((uint16_t)(x)) << EQDC_UCOMP1_UCOMP1_SHIFT)) & EQDC_UCOMP1_UCOMP1_MASK) -/*! @} */ - -/*! @name UPOSH1 - Upper Position Holder Register 1 */ -/*! @{ */ - -#define EQDC_UPOSH1_UPOSH1_MASK (0xFFFFU) -#define EQDC_UPOSH1_UPOSH1_SHIFT (0U) -/*! UPOSH1 - UPOSH1 */ -#define EQDC_UPOSH1_UPOSH1(x) (((uint16_t)(((uint16_t)(x)) << EQDC_UPOSH1_UPOSH1_SHIFT)) & EQDC_UPOSH1_UPOSH1_MASK) -/*! @} */ - -/*! @name LCOMP1 - Lower Position Compare 1 */ -/*! @{ */ - -#define EQDC_LCOMP1_LCOMP1_MASK (0xFFFFU) -#define EQDC_LCOMP1_LCOMP1_SHIFT (0U) -/*! LCOMP1 - LCOMP1 */ -#define EQDC_LCOMP1_LCOMP1(x) (((uint16_t)(((uint16_t)(x)) << EQDC_LCOMP1_LCOMP1_SHIFT)) & EQDC_LCOMP1_LCOMP1_MASK) -/*! @} */ - -/*! @name LPOSH1 - Lower Position Holder Register 1 */ -/*! @{ */ - -#define EQDC_LPOSH1_LPOSH1_MASK (0xFFFFU) -#define EQDC_LPOSH1_LPOSH1_SHIFT (0U) -/*! LPOSH1 - LPOSH1 */ -#define EQDC_LPOSH1_LPOSH1(x) (((uint16_t)(((uint16_t)(x)) << EQDC_LPOSH1_LPOSH1_SHIFT)) & EQDC_LPOSH1_LPOSH1_MASK) -/*! @} */ - -/*! @name UCOMP2 - Upper Position Compare 2 */ -/*! @{ */ - -#define EQDC_UCOMP2_UCOMP2_MASK (0xFFFFU) -#define EQDC_UCOMP2_UCOMP2_SHIFT (0U) -/*! UCOMP2 - UCOMP2 */ -#define EQDC_UCOMP2_UCOMP2(x) (((uint16_t)(((uint16_t)(x)) << EQDC_UCOMP2_UCOMP2_SHIFT)) & EQDC_UCOMP2_UCOMP2_MASK) -/*! @} */ - -/*! @name UPOSH2 - Upper Position Holder Register 3 */ -/*! @{ */ - -#define EQDC_UPOSH2_UPOSH2_MASK (0xFFFFU) -#define EQDC_UPOSH2_UPOSH2_SHIFT (0U) -/*! UPOSH2 - UPOSH2 */ -#define EQDC_UPOSH2_UPOSH2(x) (((uint16_t)(((uint16_t)(x)) << EQDC_UPOSH2_UPOSH2_SHIFT)) & EQDC_UPOSH2_UPOSH2_MASK) -/*! @} */ - -/*! @name LCOMP2 - Lower Position Compare 2 */ -/*! @{ */ - -#define EQDC_LCOMP2_LCOMP2_MASK (0xFFFFU) -#define EQDC_LCOMP2_LCOMP2_SHIFT (0U) -/*! LCOMP2 - LCOMP2 */ -#define EQDC_LCOMP2_LCOMP2(x) (((uint16_t)(((uint16_t)(x)) << EQDC_LCOMP2_LCOMP2_SHIFT)) & EQDC_LCOMP2_LCOMP2_MASK) -/*! @} */ - -/*! @name LPOSH2 - Lower Position Holder Register 2 */ -/*! @{ */ - -#define EQDC_LPOSH2_LPOSH2_MASK (0xFFFFU) -#define EQDC_LPOSH2_LPOSH2_SHIFT (0U) -/*! LPOSH2 - LPOSH2 */ -#define EQDC_LPOSH2_LPOSH2(x) (((uint16_t)(((uint16_t)(x)) << EQDC_LPOSH2_LPOSH2_SHIFT)) & EQDC_LPOSH2_LPOSH2_MASK) -/*! @} */ - -/*! @name UCOMP3 - Upper Position Compare 3 */ -/*! @{ */ - -#define EQDC_UCOMP3_UCOMP3_MASK (0xFFFFU) -#define EQDC_UCOMP3_UCOMP3_SHIFT (0U) -/*! UCOMP3 - UCOMP3 */ -#define EQDC_UCOMP3_UCOMP3(x) (((uint16_t)(((uint16_t)(x)) << EQDC_UCOMP3_UCOMP3_SHIFT)) & EQDC_UCOMP3_UCOMP3_MASK) -/*! @} */ - -/*! @name UPOSH3 - Upper Position Holder Register 3 */ -/*! @{ */ - -#define EQDC_UPOSH3_UPOSH3_MASK (0xFFFFU) -#define EQDC_UPOSH3_UPOSH3_SHIFT (0U) -/*! UPOSH3 - UPOSH3 */ -#define EQDC_UPOSH3_UPOSH3(x) (((uint16_t)(((uint16_t)(x)) << EQDC_UPOSH3_UPOSH3_SHIFT)) & EQDC_UPOSH3_UPOSH3_MASK) -/*! @} */ - -/*! @name LCOMP3 - Lower Position Compare 3 */ -/*! @{ */ - -#define EQDC_LCOMP3_LCOMP3_MASK (0xFFFFU) -#define EQDC_LCOMP3_LCOMP3_SHIFT (0U) -/*! LCOMP3 - LCOMP3 */ -#define EQDC_LCOMP3_LCOMP3(x) (((uint16_t)(((uint16_t)(x)) << EQDC_LCOMP3_LCOMP3_SHIFT)) & EQDC_LCOMP3_LCOMP3_MASK) -/*! @} */ - -/*! @name LPOSH3 - Lower Position Holder Register 3 */ -/*! @{ */ - -#define EQDC_LPOSH3_LPOSH3_MASK (0xFFFFU) -#define EQDC_LPOSH3_LPOSH3_SHIFT (0U) -/*! LPOSH3 - LPOSH3 */ -#define EQDC_LPOSH3_LPOSH3(x) (((uint16_t)(((uint16_t)(x)) << EQDC_LPOSH3_LPOSH3_SHIFT)) & EQDC_LPOSH3_LPOSH3_MASK) -/*! @} */ - -/*! @name INTCTRL - Interrupt Control Register */ -/*! @{ */ - -#define EQDC_INTCTRL_SABIE_MASK (0x1U) -#define EQDC_INTCTRL_SABIE_SHIFT (0U) -/*! SABIE - Simultaneous PHASEA and PHASEB Change Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EQDC_INTCTRL_SABIE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_SABIE_SHIFT)) & EQDC_INTCTRL_SABIE_MASK) - -#define EQDC_INTCTRL_SABIRQ_MASK (0x2U) -#define EQDC_INTCTRL_SABIRQ_SHIFT (1U) -/*! SABIRQ - Simultaneous PHASEA and PHASEB Change Interrupt Request - * 0b0..No simultaneous change of PHASEA and PHASEB has occurred - * 0b1..A simultaneous change of PHASEA and PHASEB has occurred - */ -#define EQDC_INTCTRL_SABIRQ(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_SABIRQ_SHIFT)) & EQDC_INTCTRL_SABIRQ_MASK) - -#define EQDC_INTCTRL_DIRIE_MASK (0x4U) -#define EQDC_INTCTRL_DIRIE_SHIFT (2U) -/*! DIRIE - Count direction change interrupt enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EQDC_INTCTRL_DIRIE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_DIRIE_SHIFT)) & EQDC_INTCTRL_DIRIE_MASK) - -#define EQDC_INTCTRL_DIRIRQ_MASK (0x8U) -#define EQDC_INTCTRL_DIRIRQ_SHIFT (3U) -/*! DIRIRQ - Count direction change interrupt - * 0b0..Count direction unchanged - * 0b1..Count direction changed - */ -#define EQDC_INTCTRL_DIRIRQ(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_DIRIRQ_SHIFT)) & EQDC_INTCTRL_DIRIRQ_MASK) - -#define EQDC_INTCTRL_RUIE_MASK (0x10U) -#define EQDC_INTCTRL_RUIE_SHIFT (4U) -/*! RUIE - Roll-under Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EQDC_INTCTRL_RUIE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_RUIE_SHIFT)) & EQDC_INTCTRL_RUIE_MASK) - -#define EQDC_INTCTRL_RUIRQ_MASK (0x20U) -#define EQDC_INTCTRL_RUIRQ_SHIFT (5U) -/*! RUIRQ - Roll-under Interrupt Request - * 0b0..No roll-under has occurred - * 0b1..Roll-under has occurred - */ -#define EQDC_INTCTRL_RUIRQ(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_RUIRQ_SHIFT)) & EQDC_INTCTRL_RUIRQ_MASK) - -#define EQDC_INTCTRL_ROIE_MASK (0x40U) -#define EQDC_INTCTRL_ROIE_SHIFT (6U) -/*! ROIE - Roll-over Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EQDC_INTCTRL_ROIE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_ROIE_SHIFT)) & EQDC_INTCTRL_ROIE_MASK) - -#define EQDC_INTCTRL_ROIRQ_MASK (0x80U) -#define EQDC_INTCTRL_ROIRQ_SHIFT (7U) -/*! ROIRQ - Roll-over Interrupt Request - * 0b0..No roll-over has occurred - * 0b1..Roll-over has occurred - */ -#define EQDC_INTCTRL_ROIRQ(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_ROIRQ_SHIFT)) & EQDC_INTCTRL_ROIRQ_MASK) - -#define EQDC_INTCTRL_CMP0IE_MASK (0x100U) -#define EQDC_INTCTRL_CMP0IE_SHIFT (8U) -/*! CMP0IE - Compare 0 Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EQDC_INTCTRL_CMP0IE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_CMP0IE_SHIFT)) & EQDC_INTCTRL_CMP0IE_MASK) - -#define EQDC_INTCTRL_CMP0IRQ_MASK (0x200U) -#define EQDC_INTCTRL_CMP0IRQ_SHIFT (9U) -/*! CMP0IRQ - Compare 0 Interrupt Request - * 0b0..No match has occurred (the position counter does not match the COMP0 value) - * 0b1..COMP match has occurred (the position counter matches the COMP0 value) - */ -#define EQDC_INTCTRL_CMP0IRQ(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_CMP0IRQ_SHIFT)) & EQDC_INTCTRL_CMP0IRQ_MASK) - -#define EQDC_INTCTRL_CMP1IE_MASK (0x400U) -#define EQDC_INTCTRL_CMP1IE_SHIFT (10U) -/*! CMP1IE - Compare1 Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EQDC_INTCTRL_CMP1IE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_CMP1IE_SHIFT)) & EQDC_INTCTRL_CMP1IE_MASK) - -#define EQDC_INTCTRL_CMP1IRQ_MASK (0x800U) -#define EQDC_INTCTRL_CMP1IRQ_SHIFT (11U) -/*! CMP1IRQ - Compare1 Interrupt Request - * 0b0..No match has occurred (the position counter does not match the COMP1 value) - * 0b1..COMP1 match has occurred (the position counter matches the COMP1 value) - */ -#define EQDC_INTCTRL_CMP1IRQ(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_CMP1IRQ_SHIFT)) & EQDC_INTCTRL_CMP1IRQ_MASK) - -#define EQDC_INTCTRL_CMP2IE_MASK (0x1000U) -#define EQDC_INTCTRL_CMP2IE_SHIFT (12U) -/*! CMP2IE - Compare2 Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EQDC_INTCTRL_CMP2IE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_CMP2IE_SHIFT)) & EQDC_INTCTRL_CMP2IE_MASK) - -#define EQDC_INTCTRL_CMP2IRQ_MASK (0x2000U) -#define EQDC_INTCTRL_CMP2IRQ_SHIFT (13U) -/*! CMP2IRQ - Compare2 Interrupt Request - * 0b0..No match has occurred (the position counter does not match the COMP2 value) - * 0b1..COMP2 match has occurred (the position counter matches the COMP2 value) - */ -#define EQDC_INTCTRL_CMP2IRQ(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_CMP2IRQ_SHIFT)) & EQDC_INTCTRL_CMP2IRQ_MASK) - -#define EQDC_INTCTRL_CMP3IE_MASK (0x4000U) -#define EQDC_INTCTRL_CMP3IE_SHIFT (14U) -/*! CMP3IE - Compare3 Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EQDC_INTCTRL_CMP3IE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_CMP3IE_SHIFT)) & EQDC_INTCTRL_CMP3IE_MASK) - -#define EQDC_INTCTRL_CMP3IRQ_MASK (0x8000U) -#define EQDC_INTCTRL_CMP3IRQ_SHIFT (15U) -/*! CMP3IRQ - Compare3 Interrupt Request - * 0b0..No match has occurred (the position counter does not match the COMP3 value) - * 0b1..COMP3 match has occurred (the position counter matches the COMP3 value) - */ -#define EQDC_INTCTRL_CMP3IRQ(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_CMP3IRQ_SHIFT)) & EQDC_INTCTRL_CMP3IRQ_MASK) -/*! @} */ - -/*! @name WTR - Watchdog Timeout Register */ -/*! @{ */ - -#define EQDC_WTR_WDOG_MASK (0xFFFFU) -#define EQDC_WTR_WDOG_SHIFT (0U) -/*! WDOG - WDOG */ -#define EQDC_WTR_WDOG(x) (((uint16_t)(((uint16_t)(x)) << EQDC_WTR_WDOG_SHIFT)) & EQDC_WTR_WDOG_MASK) -/*! @} */ - -/*! @name IMR - Input Monitor Register */ -/*! @{ */ - -#define EQDC_IMR_HOME_ENABLE_MASK (0x1U) -#define EQDC_IMR_HOME_ENABLE_SHIFT (0U) -/*! HOME_ENABLE - HOME_ENABLE */ -#define EQDC_IMR_HOME_ENABLE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_IMR_HOME_ENABLE_SHIFT)) & EQDC_IMR_HOME_ENABLE_MASK) - -#define EQDC_IMR_INDEX_PRESET_MASK (0x2U) -#define EQDC_IMR_INDEX_PRESET_SHIFT (1U) -/*! INDEX_PRESET - INDEX_PRESET */ -#define EQDC_IMR_INDEX_PRESET(x) (((uint16_t)(((uint16_t)(x)) << EQDC_IMR_INDEX_PRESET_SHIFT)) & EQDC_IMR_INDEX_PRESET_MASK) - -#define EQDC_IMR_PHB_MASK (0x4U) -#define EQDC_IMR_PHB_SHIFT (2U) -/*! PHB - PHB */ -#define EQDC_IMR_PHB(x) (((uint16_t)(((uint16_t)(x)) << EQDC_IMR_PHB_SHIFT)) & EQDC_IMR_PHB_MASK) - -#define EQDC_IMR_PHA_MASK (0x8U) -#define EQDC_IMR_PHA_SHIFT (3U) -/*! PHA - PHA */ -#define EQDC_IMR_PHA(x) (((uint16_t)(((uint16_t)(x)) << EQDC_IMR_PHA_SHIFT)) & EQDC_IMR_PHA_MASK) - -#define EQDC_IMR_FHOM_ENA_MASK (0x10U) -#define EQDC_IMR_FHOM_ENA_SHIFT (4U) -/*! FHOM_ENA - filter operation on HOME/ENABLE input */ -#define EQDC_IMR_FHOM_ENA(x) (((uint16_t)(((uint16_t)(x)) << EQDC_IMR_FHOM_ENA_SHIFT)) & EQDC_IMR_FHOM_ENA_MASK) - -#define EQDC_IMR_FIND_PRE_MASK (0x20U) -#define EQDC_IMR_FIND_PRE_SHIFT (5U) -/*! FIND_PRE - filter operation on INDEX/PRESET input */ -#define EQDC_IMR_FIND_PRE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_IMR_FIND_PRE_SHIFT)) & EQDC_IMR_FIND_PRE_MASK) - -#define EQDC_IMR_FPHB_MASK (0x40U) -#define EQDC_IMR_FPHB_SHIFT (6U) -/*! FPHB - filter operation on PHASEB input */ -#define EQDC_IMR_FPHB(x) (((uint16_t)(((uint16_t)(x)) << EQDC_IMR_FPHB_SHIFT)) & EQDC_IMR_FPHB_MASK) - -#define EQDC_IMR_FPHA_MASK (0x80U) -#define EQDC_IMR_FPHA_SHIFT (7U) -/*! FPHA - filter operation on PHASEA input */ -#define EQDC_IMR_FPHA(x) (((uint16_t)(((uint16_t)(x)) << EQDC_IMR_FPHA_SHIFT)) & EQDC_IMR_FPHA_MASK) - -#define EQDC_IMR_CMPF0_MASK (0x100U) -#define EQDC_IMR_CMPF0_SHIFT (8U) -/*! CMPF0 - Position Compare 0 Flag Output - * 0b0..When the position counter is less than value of COMP0 register - * 0b1..When the position counter is greater or equal than value of COMP0 register - */ -#define EQDC_IMR_CMPF0(x) (((uint16_t)(((uint16_t)(x)) << EQDC_IMR_CMPF0_SHIFT)) & EQDC_IMR_CMPF0_MASK) - -#define EQDC_IMR_CMP1F_MASK (0x200U) -#define EQDC_IMR_CMP1F_SHIFT (9U) -/*! CMP1F - Position Compare1 Flag Output - * 0b0..When the position counter is less than value of COMP1 register - * 0b1..When the position counter is greater or equal than value of COMP1 register - */ -#define EQDC_IMR_CMP1F(x) (((uint16_t)(((uint16_t)(x)) << EQDC_IMR_CMP1F_SHIFT)) & EQDC_IMR_CMP1F_MASK) - -#define EQDC_IMR_CMP2F_MASK (0x400U) -#define EQDC_IMR_CMP2F_SHIFT (10U) -/*! CMP2F - Position Compare2 Flag Output - * 0b0..When the position counter is less than value of COMP2 register - * 0b1..When the position counter is greater or equal than value of COMP2 register - */ -#define EQDC_IMR_CMP2F(x) (((uint16_t)(((uint16_t)(x)) << EQDC_IMR_CMP2F_SHIFT)) & EQDC_IMR_CMP2F_MASK) - -#define EQDC_IMR_CMP3F_MASK (0x800U) -#define EQDC_IMR_CMP3F_SHIFT (11U) -/*! CMP3F - Position Compare3 Flag Output - * 0b0..When the position counter value is less than value of COMP3 register - * 0b1..When the position counter is greater or equal than value of COMP3 register - */ -#define EQDC_IMR_CMP3F(x) (((uint16_t)(((uint16_t)(x)) << EQDC_IMR_CMP3F_SHIFT)) & EQDC_IMR_CMP3F_MASK) - -#define EQDC_IMR_DIRH_MASK (0x4000U) -#define EQDC_IMR_DIRH_SHIFT (14U) -/*! DIRH - Count Direction Flag Hold */ -#define EQDC_IMR_DIRH(x) (((uint16_t)(((uint16_t)(x)) << EQDC_IMR_DIRH_SHIFT)) & EQDC_IMR_DIRH_MASK) - -#define EQDC_IMR_DIR_MASK (0x8000U) -#define EQDC_IMR_DIR_SHIFT (15U) -/*! DIR - Count Direction Flag Output - * 0b0..Current count was in the down direction - * 0b1..Current count was in the up direction - */ -#define EQDC_IMR_DIR(x) (((uint16_t)(((uint16_t)(x)) << EQDC_IMR_DIR_SHIFT)) & EQDC_IMR_DIR_MASK) -/*! @} */ - -/*! @name TST - Test Register */ -/*! @{ */ - -#define EQDC_TST_TEST_COUNT_MASK (0xFFU) -#define EQDC_TST_TEST_COUNT_SHIFT (0U) -/*! TEST_COUNT - TEST_COUNT */ -#define EQDC_TST_TEST_COUNT(x) (((uint16_t)(((uint16_t)(x)) << EQDC_TST_TEST_COUNT_SHIFT)) & EQDC_TST_TEST_COUNT_MASK) - -#define EQDC_TST_TEST_PERIOD_MASK (0x1F00U) -#define EQDC_TST_TEST_PERIOD_SHIFT (8U) -/*! TEST_PERIOD - TEST_PERIOD */ -#define EQDC_TST_TEST_PERIOD(x) (((uint16_t)(((uint16_t)(x)) << EQDC_TST_TEST_PERIOD_SHIFT)) & EQDC_TST_TEST_PERIOD_MASK) - -#define EQDC_TST_QDN_MASK (0x2000U) -#define EQDC_TST_QDN_SHIFT (13U) -/*! QDN - Quadrature Decoder Negative Signal - * 0b0..Generates a positive quadrature decoder signal - * 0b1..Generates a negative quadrature decoder signal - */ -#define EQDC_TST_QDN(x) (((uint16_t)(((uint16_t)(x)) << EQDC_TST_QDN_SHIFT)) & EQDC_TST_QDN_MASK) - -#define EQDC_TST_TCE_MASK (0x4000U) -#define EQDC_TST_TCE_SHIFT (14U) -/*! TCE - Test Counter Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EQDC_TST_TCE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_TST_TCE_SHIFT)) & EQDC_TST_TCE_MASK) - -#define EQDC_TST_TEN_MASK (0x8000U) -#define EQDC_TST_TEN_SHIFT (15U) -/*! TEN - Test Mode Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EQDC_TST_TEN(x) (((uint16_t)(((uint16_t)(x)) << EQDC_TST_TEN_SHIFT)) & EQDC_TST_TEN_MASK) -/*! @} */ - -/*! @name UVERID - Upper VERID */ -/*! @{ */ - -#define EQDC_UVERID_UVERID_MASK (0xFFFFU) -#define EQDC_UVERID_UVERID_SHIFT (0U) -/*! UVERID - UVERID */ -#define EQDC_UVERID_UVERID(x) (((uint16_t)(((uint16_t)(x)) << EQDC_UVERID_UVERID_SHIFT)) & EQDC_UVERID_UVERID_MASK) -/*! @} */ - -/*! @name LVERID - Lower VERID */ -/*! @{ */ - -#define EQDC_LVERID_LVERID_MASK (0xFFFFU) -#define EQDC_LVERID_LVERID_SHIFT (0U) -/*! LVERID - LVERID */ -#define EQDC_LVERID_LVERID(x) (((uint16_t)(((uint16_t)(x)) << EQDC_LVERID_LVERID_SHIFT)) & EQDC_LVERID_LVERID_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group EQDC_Register_Masks */ - - -/* EQDC - Peripheral instance base addresses */ -/** Peripheral QDC0 base address */ -#define QDC0_BASE (0x400A7000u) -/** Peripheral QDC0 base pointer */ -#define QDC0 ((EQDC_Type *)QDC0_BASE) -/** Array initializer of EQDC peripheral base addresses */ -#define EQDC_BASE_ADDRS { QDC0_BASE } -/** Array initializer of EQDC peripheral base pointers */ -#define EQDC_BASE_PTRS { QDC0 } -/** Interrupt vectors for the EQDC peripheral type */ -#define EQDC_COMPARE_IRQS { QDC0_COMPARE_IRQn } -#define EQDC_HOME_IRQS { QDC0_HOME_IRQn } -#define EQDC_WDOG_IRQS { QDC0_WATCHDOG_IRQn } -#define EQDC_INDEX_IRQS { QDC0_INDEX_IRQn } -#define EQDC_INPUT_SWITCH_IRQS { QDC0_WATCHDOG_IRQn } - -/*! - * @} - */ /* end of group EQDC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- ERM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ERM_Peripheral_Access_Layer ERM Peripheral Access Layer - * @{ - */ - -/** ERM - Register Layout Typedef */ -typedef struct { - __IO uint32_t CR0; /**< ERM Configuration Register 0, offset: 0x0 */ - uint8_t RESERVED_0[12]; - __IO uint32_t SR0; /**< ERM Status Register 0, offset: 0x10 */ - uint8_t RESERVED_1[236]; - __I uint32_t EAR0; /**< ERM Memory 0 Error Address Register, offset: 0x100 */ - __I uint32_t SYN0; /**< ERM Memory 0 Syndrome Register, offset: 0x104 */ - __IO uint32_t CORR_ERR_CNT0; /**< ERM Memory 0 Correctable Error Count Register, offset: 0x108 */ - uint8_t RESERVED_2[12]; - __IO uint32_t CORR_ERR_CNT1; /**< ERM Memory 1 Correctable Error Count Register, offset: 0x118 */ -} ERM_Type; - -/* ---------------------------------------------------------------------------- - -- ERM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ERM_Register_Masks ERM Register Masks - * @{ - */ - -/*! @name CR0 - ERM Configuration Register 0 */ -/*! @{ */ - -#define ERM_CR0_ENCIE1_MASK (0x4000000U) -#define ERM_CR0_ENCIE1_SHIFT (26U) -/*! ENCIE1 - ENCIE1 - * 0b0..Interrupt notification of Memory 1 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 1 non-correctable error events is enabled. - */ -#define ERM_CR0_ENCIE1(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ENCIE1_SHIFT)) & ERM_CR0_ENCIE1_MASK) - -#define ERM_CR0_ESCIE1_MASK (0x8000000U) -#define ERM_CR0_ESCIE1_SHIFT (27U) -/*! ESCIE1 - ESCIE1 - * 0b0..Interrupt notification of Memory 1 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 1 single-bit correction events is enabled. - */ -#define ERM_CR0_ESCIE1(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ESCIE1_SHIFT)) & ERM_CR0_ESCIE1_MASK) - -#define ERM_CR0_ENCIE0_MASK (0x40000000U) -#define ERM_CR0_ENCIE0_SHIFT (30U) -/*! ENCIE0 - ENCIE0 - * 0b0..Interrupt notification of Memory 0 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 0 non-correctable error events is enabled. - */ -#define ERM_CR0_ENCIE0(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ENCIE0_SHIFT)) & ERM_CR0_ENCIE0_MASK) - -#define ERM_CR0_ESCIE0_MASK (0x80000000U) -#define ERM_CR0_ESCIE0_SHIFT (31U) -/*! ESCIE0 - ESCIE0 - * 0b0..Interrupt notification of Memory 0 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 0 single-bit correction events is enabled. - */ -#define ERM_CR0_ESCIE0(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ESCIE0_SHIFT)) & ERM_CR0_ESCIE0_MASK) -/*! @} */ - -/*! @name SR0 - ERM Status Register 0 */ -/*! @{ */ - -#define ERM_SR0_NCE1_MASK (0x4000000U) -#define ERM_SR0_NCE1_SHIFT (26U) -/*! NCE1 - NCE1 - * 0b0..No non-correctable error event on Memory 1 detected. - * 0b1..Non-correctable error event on Memory 1 detected. - */ -#define ERM_SR0_NCE1(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_NCE1_SHIFT)) & ERM_SR0_NCE1_MASK) - -#define ERM_SR0_SBC1_MASK (0x8000000U) -#define ERM_SR0_SBC1_SHIFT (27U) -/*! SBC1 - SBC1 - * 0b0..No single-bit correction event on Memory 1 detected. - * 0b1..Single-bit correction event on Memory 1 detected. - */ -#define ERM_SR0_SBC1(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_SBC1_SHIFT)) & ERM_SR0_SBC1_MASK) - -#define ERM_SR0_NCE0_MASK (0x40000000U) -#define ERM_SR0_NCE0_SHIFT (30U) -/*! NCE0 - NCE0 - * 0b0..No non-correctable error event on Memory 0 detected. - * 0b1..Non-correctable error event on Memory 0 detected. - */ -#define ERM_SR0_NCE0(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_NCE0_SHIFT)) & ERM_SR0_NCE0_MASK) - -#define ERM_SR0_SBC0_MASK (0x80000000U) -#define ERM_SR0_SBC0_SHIFT (31U) -/*! SBC0 - SBC0 - * 0b0..No single-bit correction event on Memory 0 detected. - * 0b1..Single-bit correction event on Memory 0 detected. - */ -#define ERM_SR0_SBC0(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_SBC0_SHIFT)) & ERM_SR0_SBC0_MASK) -/*! @} */ - -/*! @name EAR0 - ERM Memory 0 Error Address Register */ -/*! @{ */ - -#define ERM_EAR0_EAR_MASK (0xFFFFFFFFU) -#define ERM_EAR0_EAR_SHIFT (0U) -/*! EAR - EAR */ -#define ERM_EAR0_EAR(x) (((uint32_t)(((uint32_t)(x)) << ERM_EAR0_EAR_SHIFT)) & ERM_EAR0_EAR_MASK) -/*! @} */ - -/*! @name SYN0 - ERM Memory 0 Syndrome Register */ -/*! @{ */ - -#define ERM_SYN0_SYNDROME_MASK (0xFF000000U) -#define ERM_SYN0_SYNDROME_SHIFT (24U) -/*! SYNDROME - SYNDROME */ -#define ERM_SYN0_SYNDROME(x) (((uint32_t)(((uint32_t)(x)) << ERM_SYN0_SYNDROME_SHIFT)) & ERM_SYN0_SYNDROME_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT0 - ERM Memory 0 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT0_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT0_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT0_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT0_COUNT_SHIFT)) & ERM_CORR_ERR_CNT0_COUNT_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT1 - ERM Memory 1 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT1_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT1_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT1_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT1_COUNT_SHIFT)) & ERM_CORR_ERR_CNT1_COUNT_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group ERM_Register_Masks */ - - -/* ERM - Peripheral instance base addresses */ -/** Peripheral ERM0 base address */ -#define ERM0_BASE (0x4008D000u) -/** Peripheral ERM0 base pointer */ -#define ERM0 ((ERM_Type *)ERM0_BASE) -/** Array initializer of ERM peripheral base addresses */ -#define ERM_BASE_ADDRS { ERM0_BASE } -/** Array initializer of ERM peripheral base pointers */ -#define ERM_BASE_PTRS { ERM0 } - -/*! - * @} - */ /* end of group ERM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- FMC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FMC_Peripheral_Access_Layer FMC Peripheral Access Layer - * @{ - */ - -/** FMC - Register Layout Typedef */ -typedef struct { - uint8_t RESERVED_0[32]; - __IO uint32_t REMAP; /**< Data Remap, offset: 0x20 */ -} FMC_Type; - -/* ---------------------------------------------------------------------------- - -- FMC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FMC_Register_Masks FMC Register Masks - * @{ - */ - -/*! @name REMAP - Data Remap */ -/*! @{ */ - -#define FMC_REMAP_REMAPLK_MASK (0x1U) -#define FMC_REMAP_REMAPLK_SHIFT (0U) -/*! REMAPLK - Remap Lock Enable - * 0b1..Lock enabled: cannot write to REMAP - * 0b0..Lock disabled: can write to REMAP - */ -#define FMC_REMAP_REMAPLK(x) (((uint32_t)(((uint32_t)(x)) << FMC_REMAP_REMAPLK_SHIFT)) & FMC_REMAP_REMAPLK_MASK) - -#define FMC_REMAP_LIM_MASK (0x1F0000U) -#define FMC_REMAP_LIM_SHIFT (16U) -/*! LIM - LIM Remapping Address */ -#define FMC_REMAP_LIM(x) (((uint32_t)(((uint32_t)(x)) << FMC_REMAP_LIM_SHIFT)) & FMC_REMAP_LIM_MASK) - -#define FMC_REMAP_LIMDP_MASK (0x1F000000U) -#define FMC_REMAP_LIMDP_SHIFT (24U) -/*! LIMDP - LIMDP Remapping Address */ -#define FMC_REMAP_LIMDP(x) (((uint32_t)(((uint32_t)(x)) << FMC_REMAP_LIMDP_SHIFT)) & FMC_REMAP_LIMDP_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group FMC_Register_Masks */ - - -/* FMC - Peripheral instance base addresses */ -/** Peripheral FMC0 base address */ -#define FMC0_BASE (0x40094000u) -/** Peripheral FMC0 base pointer */ -#define FMC0 ((FMC_Type *)FMC0_BASE) -/** Array initializer of FMC peripheral base addresses */ -#define FMC_BASE_ADDRS { FMC0_BASE } -/** Array initializer of FMC peripheral base pointers */ -#define FMC_BASE_PTRS { FMC0 } - -/*! - * @} - */ /* end of group FMC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- FMU Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FMU_Peripheral_Access_Layer FMU Peripheral Access Layer - * @{ - */ - -/** FMU - Register Layout Typedef */ -typedef struct { - __IO uint32_t FSTAT; /**< Flash Status Register, offset: 0x0 */ - __IO uint32_t FCNFG; /**< Flash Configuration Register, offset: 0x4 */ - __IO uint32_t FCTRL; /**< Flash Control Register, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __IO uint32_t FCCOB[8]; /**< Flash Common Command Object Registers, array offset: 0x10, array step: 0x4 */ -} FMU_Type; - -/* ---------------------------------------------------------------------------- - -- FMU Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FMU_Register_Masks FMU Register Masks - * @{ - */ - -/*! @name FSTAT - Flash Status Register */ -/*! @{ */ - -#define FMU_FSTAT_FAIL_MASK (0x1U) -#define FMU_FSTAT_FAIL_SHIFT (0U) -/*! FAIL - Command Fail Flag - * 0b0..Error not detected - * 0b1..Error detected - */ -#define FMU_FSTAT_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_FAIL_SHIFT)) & FMU_FSTAT_FAIL_MASK) - -#define FMU_FSTAT_CMDABT_MASK (0x4U) -#define FMU_FSTAT_CMDABT_SHIFT (2U) -/*! CMDABT - Command Abort Flag - * 0b0..No command abort detected - * 0b1..Command abort detected - */ -#define FMU_FSTAT_CMDABT(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_CMDABT_SHIFT)) & FMU_FSTAT_CMDABT_MASK) - -#define FMU_FSTAT_PVIOL_MASK (0x10U) -#define FMU_FSTAT_PVIOL_SHIFT (4U) -/*! PVIOL - Command Protection Violation Flag - * 0b0..No protection violation detected - * 0b1..Protection violation detected - */ -#define FMU_FSTAT_PVIOL(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_PVIOL_SHIFT)) & FMU_FSTAT_PVIOL_MASK) - -#define FMU_FSTAT_ACCERR_MASK (0x20U) -#define FMU_FSTAT_ACCERR_SHIFT (5U) -/*! ACCERR - Command Access Error Flag - * 0b0..No access error detected - * 0b1..Access error detected - */ -#define FMU_FSTAT_ACCERR(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_ACCERR_SHIFT)) & FMU_FSTAT_ACCERR_MASK) - -#define FMU_FSTAT_CWSABT_MASK (0x40U) -#define FMU_FSTAT_CWSABT_SHIFT (6U) -/*! CWSABT - Command Write Sequence Abort Flag - * 0b0..Command write sequence not aborted - * 0b1..Command write sequence aborted - */ -#define FMU_FSTAT_CWSABT(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_CWSABT_SHIFT)) & FMU_FSTAT_CWSABT_MASK) - -#define FMU_FSTAT_CCIF_MASK (0x80U) -#define FMU_FSTAT_CCIF_SHIFT (7U) -/*! CCIF - Command Complete Interrupt Flag - * 0b0..Flash command, initialization, or power mode recovery in progress - * 0b1..Flash command, initialization, or power mode recovery has completed - */ -#define FMU_FSTAT_CCIF(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_CCIF_SHIFT)) & FMU_FSTAT_CCIF_MASK) - -#define FMU_FSTAT_CMDPRT_MASK (0x300U) -#define FMU_FSTAT_CMDPRT_SHIFT (8U) -/*! CMDPRT - Command protection level - * 0b00..Secure, normal access - * 0b01..Secure, privileged access - * 0b10..Nonsecure, normal access - * 0b11..Nonsecure, privileged access - */ -#define FMU_FSTAT_CMDPRT(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_CMDPRT_SHIFT)) & FMU_FSTAT_CMDPRT_MASK) - -#define FMU_FSTAT_CMDP_MASK (0x800U) -#define FMU_FSTAT_CMDP_SHIFT (11U) -/*! CMDP - Command protection status flag - * 0b0..Command protection level and domain ID are stale - * 0b1..Command protection level (CMDPRT) and domain ID (CMDDID) are set - */ -#define FMU_FSTAT_CMDP(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_CMDP_SHIFT)) & FMU_FSTAT_CMDP_MASK) - -#define FMU_FSTAT_CMDDID_MASK (0xF000U) -#define FMU_FSTAT_CMDDID_SHIFT (12U) -/*! CMDDID - Command domain ID */ -#define FMU_FSTAT_CMDDID(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_CMDDID_SHIFT)) & FMU_FSTAT_CMDDID_MASK) - -#define FMU_FSTAT_DFDIF_MASK (0x10000U) -#define FMU_FSTAT_DFDIF_SHIFT (16U) -/*! DFDIF - Double Bit Fault Detect Interrupt Flag - * 0b0..Double bit fault not detected during a valid flash read access - * 0b1..Double bit fault detected (or FCTRL[FDFD] is set) during a valid flash read access - */ -#define FMU_FSTAT_DFDIF(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_DFDIF_SHIFT)) & FMU_FSTAT_DFDIF_MASK) - -#define FMU_FSTAT_SALV_USED_MASK (0x20000U) -#define FMU_FSTAT_SALV_USED_SHIFT (17U) -/*! SALV_USED - Salvage Used for Erase operation - * 0b0..Salvage not used during last operation - * 0b1..Salvage used during the last erase operation - */ -#define FMU_FSTAT_SALV_USED(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_SALV_USED_SHIFT)) & FMU_FSTAT_SALV_USED_MASK) - -#define FMU_FSTAT_PEWEN_MASK (0x3000000U) -#define FMU_FSTAT_PEWEN_SHIFT (24U) -/*! PEWEN - Program-Erase Write Enable Control - * 0b00..Writes are not enabled - * 0b01..Writes are enabled for one flash or IFR phrase (phrase programming, sector erase) - * 0b10..Writes are enabled for one flash or IFR page (page programming) - * 0b11..Reserved - */ -#define FMU_FSTAT_PEWEN(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_PEWEN_SHIFT)) & FMU_FSTAT_PEWEN_MASK) - -#define FMU_FSTAT_PERDY_MASK (0x80000000U) -#define FMU_FSTAT_PERDY_SHIFT (31U) -/*! PERDY - Program-Erase Ready Control/Status Flag - * 0b0..Program or sector erase command operation not stalled - * 0b1..Program or sector erase command operation ready to execute - */ -#define FMU_FSTAT_PERDY(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_PERDY_SHIFT)) & FMU_FSTAT_PERDY_MASK) -/*! @} */ - -/*! @name FCNFG - Flash Configuration Register */ -/*! @{ */ - -#define FMU_FCNFG_CCIE_MASK (0x80U) -#define FMU_FCNFG_CCIE_SHIFT (7U) -/*! CCIE - Command Complete Interrupt Enable - * 0b0..Command complete interrupt disabled - * 0b1..Command complete interrupt enabled - */ -#define FMU_FCNFG_CCIE(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCNFG_CCIE_SHIFT)) & FMU_FCNFG_CCIE_MASK) - -#define FMU_FCNFG_ERSREQ_MASK (0x100U) -#define FMU_FCNFG_ERSREQ_SHIFT (8U) -/*! ERSREQ - Mass Erase Request - * 0b0..No request or request complete - * 0b1..Request to run the Mass Erase operation - */ -#define FMU_FCNFG_ERSREQ(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCNFG_ERSREQ_SHIFT)) & FMU_FCNFG_ERSREQ_MASK) - -#define FMU_FCNFG_DFDIE_MASK (0x10000U) -#define FMU_FCNFG_DFDIE_SHIFT (16U) -/*! DFDIE - Double Bit Fault Detect Interrupt Enable - * 0b0..Double bit fault detect interrupt disabled - * 0b1..Double bit fault detect interrupt enabled - */ -#define FMU_FCNFG_DFDIE(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCNFG_DFDIE_SHIFT)) & FMU_FCNFG_DFDIE_MASK) - -#define FMU_FCNFG_ERSIEN0_MASK (0xF000000U) -#define FMU_FCNFG_ERSIEN0_SHIFT (24U) -/*! ERSIEN0 - Erase IFR Sector Enable - Block 0 - * 0b0000..Block 0 IFR Sector X is protected from erase by ERSSCR command - * 0b0001..Block 0 IFR Sector X is not protected from erase by ERSSCR command - */ -#define FMU_FCNFG_ERSIEN0(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCNFG_ERSIEN0_SHIFT)) & FMU_FCNFG_ERSIEN0_MASK) - -#define FMU_FCNFG_ERSIEN1_MASK (0xF0000000U) -#define FMU_FCNFG_ERSIEN1_SHIFT (28U) -/*! ERSIEN1 - Erase IFR Sector Enable - Block 1 (for dual block configs) - * 0b0000..Block 1 IFR Sector X is protected from erase by ERSSCR command - * 0b0001..Block 1 IFR Sector X is not protected from erase by ERSSCR command - */ -#define FMU_FCNFG_ERSIEN1(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCNFG_ERSIEN1_SHIFT)) & FMU_FCNFG_ERSIEN1_MASK) -/*! @} */ - -/*! @name FCTRL - Flash Control Register */ -/*! @{ */ - -#define FMU_FCTRL_RWSC_MASK (0xFU) -#define FMU_FCTRL_RWSC_SHIFT (0U) -/*! RWSC - Read Wait-State Control */ -#define FMU_FCTRL_RWSC(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCTRL_RWSC_SHIFT)) & FMU_FCTRL_RWSC_MASK) - -#define FMU_FCTRL_LSACTIVE_MASK (0x100U) -#define FMU_FCTRL_LSACTIVE_SHIFT (8U) -/*! LSACTIVE - Low speed active mode - * 0b0..Full speed active mode requested - * 0b1..Low speed active mode requested - */ -#define FMU_FCTRL_LSACTIVE(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCTRL_LSACTIVE_SHIFT)) & FMU_FCTRL_LSACTIVE_MASK) - -#define FMU_FCTRL_FDFD_MASK (0x10000U) -#define FMU_FCTRL_FDFD_SHIFT (16U) -/*! FDFD - Force Double Bit Fault Detect - * 0b0..FSTAT[DFDIF] sets only if a double bit fault is detected during a valid flash read access from the platform flash controller - * 0b1..FSTAT[DFDIF] sets during any valid flash read access from the platform flash controller. An interrupt - * request is generated if the DFDIE bit is set. - */ -#define FMU_FCTRL_FDFD(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCTRL_FDFD_SHIFT)) & FMU_FCTRL_FDFD_MASK) - -#define FMU_FCTRL_ABTREQ_MASK (0x1000000U) -#define FMU_FCTRL_ABTREQ_SHIFT (24U) -/*! ABTREQ - Abort Request - * 0b0..No request to abort a command write sequence - * 0b1..Request to abort a command write sequence - */ -#define FMU_FCTRL_ABTREQ(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCTRL_ABTREQ_SHIFT)) & FMU_FCTRL_ABTREQ_MASK) -/*! @} */ - -/*! @name FCCOB - Flash Common Command Object Registers */ -/*! @{ */ - -#define FMU_FCCOB_CCOBn_MASK (0xFFFFFFFFU) -#define FMU_FCCOB_CCOBn_SHIFT (0U) -/*! CCOBn - CCOBn */ -#define FMU_FCCOB_CCOBn(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCCOB_CCOBn_SHIFT)) & FMU_FCCOB_CCOBn_MASK) -/*! @} */ - -/* The count of FMU_FCCOB */ -#define FMU_FCCOB_COUNT (8U) - - -/*! - * @} - */ /* end of group FMU_Register_Masks */ - - -/* FMU - Peripheral instance base addresses */ -/** Peripheral FMU0 base address */ -#define FMU0_BASE (0x40095000u) -/** Peripheral FMU0 base pointer */ -#define FMU0 ((FMU_Type *)FMU0_BASE) -/** Array initializer of FMU peripheral base addresses */ -#define FMU_BASE_ADDRS { FMU0_BASE } -/** Array initializer of FMU peripheral base pointers */ -#define FMU_BASE_PTRS { FMU0 } - -/*! - * @} - */ /* end of group FMU_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- FMUTEST Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FMUTEST_Peripheral_Access_Layer FMUTEST Peripheral Access Layer - * @{ - */ - -/** FMUTEST - Register Layout Typedef */ -typedef struct { - __IO uint32_t FSTAT; /**< Flash Status Register, offset: 0x0 */ - __IO uint32_t FCNFG; /**< Flash Configuration Register, offset: 0x4 */ - __IO uint32_t FCTRL; /**< Flash Control Register, offset: 0x8 */ - __I uint32_t FTEST; /**< Flash Test Register, offset: 0xC */ - __IO uint32_t FCCOB0; /**< Flash Command Control 0 Register, offset: 0x10 */ - __IO uint32_t FCCOB1; /**< Flash Command Control 1 Register, offset: 0x14 */ - __IO uint32_t FCCOB2; /**< Flash Command Control 2 Register, offset: 0x18 */ - __IO uint32_t FCCOB3; /**< Flash Command Control 3 Register, offset: 0x1C */ - __IO uint32_t FCCOB4; /**< Flash Command Control 4 Register, offset: 0x20 */ - __IO uint32_t FCCOB5; /**< Flash Command Control 5 Register, offset: 0x24 */ - __IO uint32_t FCCOB6; /**< Flash Command Control 6 Register, offset: 0x28 */ - __IO uint32_t FCCOB7; /**< Flash Command Control 7 Register, offset: 0x2C */ - uint8_t RESERVED_0[208]; - __IO uint32_t RESET_STATUS; /**< FMU Initialization Tracking Register, offset: 0x100 */ - __IO uint32_t MCTL; /**< FMU Control Register, offset: 0x104 */ - __I uint32_t BSEL_GEN; /**< FMU Block Select Generation Register, offset: 0x108 */ - __IO uint32_t PWR_OPT; /**< Power Mode Options Register, offset: 0x10C */ - __I uint32_t CMD_CHECK; /**< FMU Command Check Register, offset: 0x110 */ - uint8_t RESERVED_1[12]; - __IO uint32_t BSEL; /**< FMU Block Select Register, offset: 0x120 */ - __IO uint32_t MSIZE; /**< FMU Memory Size Register, offset: 0x124 */ - __IO uint32_t FLASH_RD_ADD; /**< Flash Read Address Register, offset: 0x128 */ - uint8_t RESERVED_2[4]; - __IO uint32_t FLASH_STOP_ADD; /**< Flash Stop Address Register, offset: 0x130 */ - __IO uint32_t FLASH_RD_CTRL; /**< Flash Read Control Register, offset: 0x134 */ - __IO uint32_t MM_ADDR; /**< Memory Map Address Register, offset: 0x138 */ - uint8_t RESERVED_3[4]; - __IO uint32_t MM_WDATA; /**< Memory Map Write Data Register, offset: 0x140 */ - __IO uint32_t MM_CTL; /**< Memory Map Control Register, offset: 0x144 */ - __IO uint32_t UINT_CTL; /**< User Interface Control Register, offset: 0x148 */ - __IO uint32_t RD_DATA0; /**< Read Data 0 Register, offset: 0x14C */ - __IO uint32_t RD_DATA1; /**< Read Data 1 Register, offset: 0x150 */ - __IO uint32_t RD_DATA2; /**< Read Data 2 Register, offset: 0x154 */ - __IO uint32_t RD_DATA3; /**< Read Data 3 Register, offset: 0x158 */ - __IO uint32_t PARITY; /**< Parity Register, offset: 0x15C */ - __IO uint32_t RD_PATH_CTRL_STATUS; /**< Read Path Control and Status Register, offset: 0x160 */ - __IO uint32_t SMW_DIN0; /**< SMW DIN 0 Register, offset: 0x164 */ - __IO uint32_t SMW_DIN1; /**< SMW DIN 1 Register, offset: 0x168 */ - __IO uint32_t SMW_DIN2; /**< SMW DIN 2 Register, offset: 0x16C */ - __IO uint32_t SMW_DIN3; /**< SMW DIN 3 Register, offset: 0x170 */ - __IO uint32_t SMW_ADDR; /**< SMW Address Register, offset: 0x174 */ - __IO uint32_t SMW_CMD_WAIT; /**< SMW Command and Wait Register, offset: 0x178 */ - __I uint32_t SMW_STATUS; /**< SMW Status Register, offset: 0x17C */ - __IO uint32_t SOCTRIM0_0; /**< SoC Trim Phrase 0 Word 0 Register, offset: 0x180 */ - __IO uint32_t SOCTRIM0_1; /**< SoC Trim Phrase 0 Word 1 Register, offset: 0x184 */ - __IO uint32_t SOCTRIM0_2; /**< SoC Trim Phrase 0 Word 2 Register, offset: 0x188 */ - __IO uint32_t SOCTRIM0_3; /**< SoC Trim Phrase 0 Word 3 Register, offset: 0x18C */ - __IO uint32_t SOCTRIM1_0; /**< SoC Trim Phrase 1 Word 0 Register, offset: 0x190 */ - __IO uint32_t SOCTRIM1_1; /**< SoC Trim Phrase 1 Word 1 Register, offset: 0x194 */ - __IO uint32_t SOCTRIM1_2; /**< SoC Trim Phrase 1 Word 2 Register, offset: 0x198 */ - __IO uint32_t SOCTRIM1_3; /**< SoC Trim Phrase 1 Word 3 Register, offset: 0x19C */ - __IO uint32_t SOCTRIM2_0; /**< SoC Trim Phrase 2 Word 0 Register, offset: 0x1A0 */ - __IO uint32_t SOCTRIM2_1; /**< SoC Trim Phrase 2 Word 1 Register, offset: 0x1A4 */ - __IO uint32_t SOCTRIM2_2; /**< SoC Trim Phrase 2 Word 2 Register, offset: 0x1A8 */ - __IO uint32_t SOCTRIM2_3; /**< SoC Trim Phrase 2 Word 3 Register, offset: 0x1AC */ - __IO uint32_t SOCTRIM3_0; /**< SoC Trim Phrase 3 Word 0 Register, offset: 0x1B0 */ - __IO uint32_t SOCTRIM3_1; /**< SoC Trim Phrase 3 Word 1 Register, offset: 0x1B4 */ - __IO uint32_t SOCTRIM3_2; /**< SoC Trim Phrase 3 Word 2 Register, offset: 0x1B8 */ - __IO uint32_t SOCTRIM3_3; /**< SoC Trim Phrase 3 Word 3 Register, offset: 0x1BC */ - __IO uint32_t SOCTRIM4_0; /**< SoC Trim Phrase 4 Word 0 Register, offset: 0x1C0 */ - __IO uint32_t SOCTRIM4_1; /**< SoC Trim Phrase 4 Word 1 Register, offset: 0x1C4 */ - __IO uint32_t SOCTRIM4_2; /**< SoC Trim Phrase 4 Word 2 Register, offset: 0x1C8 */ - __IO uint32_t SOCTRIM4_3; /**< SoC Trim Phrase 4 Word 3 Register, offset: 0x1CC */ - __IO uint32_t SOCTRIM5_0; /**< SoC Trim Phrase 5 Word 0 Register, offset: 0x1D0 */ - __IO uint32_t SOCTRIM5_1; /**< SoC Trim Phrase 5 Word 1 Register, offset: 0x1D4 */ - __IO uint32_t SOCTRIM5_2; /**< SoC Trim Phrase 5 Word 2 Register, offset: 0x1D8 */ - __IO uint32_t SOCTRIM5_3; /**< SoC Trim Phrase 5 Word 3 Register, offset: 0x1DC */ - __IO uint32_t SOCTRIM6_0; /**< SoC Trim Phrase 6 Word 0 Register, offset: 0x1E0 */ - __IO uint32_t SOCTRIM6_1; /**< SoC Trim Phrase 6 Word 1 Register, offset: 0x1E4 */ - __IO uint32_t SOCTRIM6_2; /**< SoC Trim Phrase 6 Word 2 Register, offset: 0x1E8 */ - __IO uint32_t SOCTRIM6_3; /**< SoC Trim Phrase 6 Word 3 Register, offset: 0x1EC */ - __IO uint32_t SOCTRIM7_0; /**< SoC Trim Phrase 7 Word 0 Register, offset: 0x1F0 */ - __IO uint32_t SOCTRIM7_1; /**< SoC Trim Phrase 7 Word 1 Register, offset: 0x1F4 */ - __IO uint32_t SOCTRIM7_2; /**< SoC Trim Phrase 7 Word 2 Register, offset: 0x1F8 */ - __IO uint32_t SOCTRIM7_3; /**< SoC Trim Phrase 7 Word 3 Register, offset: 0x1FC */ - uint8_t RESERVED_4[4]; - __IO uint32_t R_IP_CONFIG; /**< BIST Configuration Register, offset: 0x204 */ - __IO uint32_t R_TESTCODE; /**< BIST Test Code Register, offset: 0x208 */ - __IO uint32_t R_DFT_CTRL; /**< BIST DFT Control Register, offset: 0x20C */ - __IO uint32_t R_ADR_CTRL; /**< BIST Address Control Register, offset: 0x210 */ - __IO uint32_t R_DATA_CTRL0; /**< BIST Data Control 0 Register, offset: 0x214 */ - __IO uint32_t R_PIN_CTRL; /**< BIST Pin Control Register, offset: 0x218 */ - __IO uint32_t R_CNT_LOOP_CTRL; /**< BIST Loop Count Control Register, offset: 0x21C */ - __IO uint32_t R_TIMER_CTRL; /**< BIST Timer Control Register, offset: 0x220 */ - __IO uint32_t R_TEST_CTRL; /**< BIST Test Control Register, offset: 0x224 */ - __O uint32_t R_ABORT_LOOP; /**< BIST Abort Loop Register, offset: 0x228 */ - __I uint32_t R_ADR_QUERY; /**< BIST Address Query Register, offset: 0x22C */ - __I uint32_t R_DOUT_QUERY0; /**< BIST DOUT Query 0 Register, offset: 0x230 */ - uint8_t RESERVED_5[8]; - __I uint32_t R_SMW_QUERY; /**< BIST SMW Query Register, offset: 0x23C */ - __IO uint32_t R_SMW_SETTING0; /**< BIST SMW Setting 0 Register, offset: 0x240 */ - __IO uint32_t R_SMW_SETTING1; /**< BIST SMW Setting 1 Register, offset: 0x244 */ - __IO uint32_t R_SMP_WHV0; /**< BIST SMP WHV Setting 0 Register, offset: 0x248 */ - __IO uint32_t R_SMP_WHV1; /**< BIST SMP WHV Setting 1 Register, offset: 0x24C */ - __IO uint32_t R_SME_WHV0; /**< BIST SME WHV Setting 0 Register, offset: 0x250 */ - __IO uint32_t R_SME_WHV1; /**< BIST SME WHV Setting 1 Register, offset: 0x254 */ - __IO uint32_t R_SMW_SETTING2; /**< BIST SMW Setting 2 Register, offset: 0x258 */ - __I uint32_t R_D_MISR0; /**< BIST DIN MISR 0 Register, offset: 0x25C */ - __I uint32_t R_A_MISR0; /**< BIST Address MISR 0 Register, offset: 0x260 */ - __I uint32_t R_C_MISR0; /**< BIST Control MISR 0 Register, offset: 0x264 */ - __IO uint32_t R_SMW_SETTING3; /**< BIST SMW Setting 3 Register, offset: 0x268 */ - __IO uint32_t R_DATA_CTRL1; /**< BIST Data Control 1 Register, offset: 0x26C */ - __IO uint32_t R_DATA_CTRL2; /**< BIST Data Control 2 Register, offset: 0x270 */ - __IO uint32_t R_DATA_CTRL3; /**< BIST Data Control 3 Register, offset: 0x274 */ - uint8_t RESERVED_6[8]; - __I uint32_t R_REPAIR0_0; /**< BIST Repair 0 for Block 0 Register, offset: 0x280 */ - __I uint32_t R_REPAIR0_1; /**< BIST Repair 1 Block 0 Register, offset: 0x284 */ - __I uint32_t R_REPAIR1_0; /**< BIST Repair 0 Block 1 Register, offset: 0x288 */ - __I uint32_t R_REPAIR1_1; /**< BIST Repair 1 Block 1 Register, offset: 0x28C */ - uint8_t RESERVED_7[132]; - __IO uint32_t R_DATA_CTRL0_EX; /**< BIST Data Control 0 Extension Register, offset: 0x314 */ - uint8_t RESERVED_8[8]; - __IO uint32_t R_TIMER_CTRL_EX; /**< BIST Timer Control Extension Register, offset: 0x320 */ - uint8_t RESERVED_9[12]; - __I uint32_t R_DOUT_QUERY1; /**< BIST DOUT Query 1 Register, offset: 0x330 */ - uint8_t RESERVED_10[40]; - __I uint32_t R_D_MISR1; /**< BIST DIN MISR 1 Register, offset: 0x35C */ - __I uint32_t R_A_MISR1; /**< BIST Address MISR 1 Register, offset: 0x360 */ - __I uint32_t R_C_MISR1; /**< BIST Control MISR 1 Register, offset: 0x364 */ - uint8_t RESERVED_11[4]; - __IO uint32_t R_DATA_CTRL1_EX; /**< BIST Data Control 1 Extension Register, offset: 0x36C */ - __IO uint32_t R_DATA_CTRL2_EX; /**< BIST Data Control 2 Extension Register, offset: 0x370 */ - __IO uint32_t R_DATA_CTRL3_EX; /**< BIST Data Control 3 Extension Register, offset: 0x374 */ - uint8_t RESERVED_12[136]; - __IO uint32_t SMW_TIMER_OPTION; /**< SMW Timer Option Register, offset: 0x400 */ - __IO uint32_t SMW_SETTING_OPTION0; /**< SMW Setting Option 0 Register, offset: 0x404 */ - __IO uint32_t SMW_SETTING_OPTION2; /**< SMW Setting Option 2 Register, offset: 0x408 */ - __IO uint32_t SMW_SETTING_OPTION3; /**< SMW Setting Option 3 Register, offset: 0x40C */ - __IO uint32_t SMW_SMP_WHV_OPTION0; /**< SMW SMP WHV Option 0 Register, offset: 0x410 */ - __IO uint32_t SMW_SME_WHV_OPTION0; /**< SMW SME WHV Option 0 Register, offset: 0x414 */ - __IO uint32_t SMW_SETTING_OPTION1; /**< SMW Setting Option 1 Register, offset: 0x418 */ - __IO uint32_t SMW_SMP_WHV_OPTION1; /**< SMW SMP WHV Option 1 Register, offset: 0x41C */ - __IO uint32_t SMW_SME_WHV_OPTION1; /**< SMW SME WHV Option 1 Register, offset: 0x420 */ - uint8_t RESERVED_13[220]; - __IO uint32_t REPAIR0_0; /**< FMU Repair 0 Block 0 Register, offset: 0x500 */ - __IO uint32_t REPAIR0_1; /**< FMU Repair 1 Block 0 Register, offset: 0x504 */ - __IO uint32_t REPAIR1_0; /**< FMU Repair 0 Block 1 Register, offset: 0x508 */ - __IO uint32_t REPAIR1_1; /**< FMU Repair 1 Block 1 Register, offset: 0x50C */ - uint8_t RESERVED_14[240]; - __IO uint32_t SMW_HB_SIGNALS; /**< SMW HB Signals Register, offset: 0x600 */ - __IO uint32_t BIST_DUMP_CTRL; /**< BIST Datadump Control Register, offset: 0x604 */ - uint8_t RESERVED_15[4]; - __IO uint32_t ATX_PIN_CTRL; /**< ATX Pin Control Register, offset: 0x60C */ - __IO uint32_t FAILCNT; /**< Fail Count Register, offset: 0x610 */ - __IO uint32_t PGM_PULSE_CNT0; /**< Block 0 Program Pulse Count Register, offset: 0x614 */ - __IO uint32_t PGM_PULSE_CNT1; /**< Block 1 Program Pulse Count Register, offset: 0x618 */ - __IO uint32_t ERS_PULSE_CNT; /**< Erase Pulse Count Register, offset: 0x61C */ - __IO uint32_t MAX_PULSE_CNT; /**< Maximum Pulse Count Register, offset: 0x620 */ - __IO uint32_t PORT_CTRL; /**< Port Control Register, offset: 0x624 */ -} FMUTEST_Type; - -/* ---------------------------------------------------------------------------- - -- FMUTEST Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FMUTEST_Register_Masks FMUTEST Register Masks - * @{ - */ - -/*! @name FSTAT - Flash Status Register */ -/*! @{ */ - -#define FMUTEST_FSTAT_FAIL_MASK (0x1U) -#define FMUTEST_FSTAT_FAIL_SHIFT (0U) -/*! FAIL - Command Fail Flag - * 0b0..Error not detected - * 0b1..Error detected - */ -#define FMUTEST_FSTAT_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_FAIL_SHIFT)) & FMUTEST_FSTAT_FAIL_MASK) - -#define FMUTEST_FSTAT_CMDABT_MASK (0x4U) -#define FMUTEST_FSTAT_CMDABT_SHIFT (2U) -/*! CMDABT - Command Abort Flag - * 0b0..No command abort detected - * 0b1..Command abort detected - */ -#define FMUTEST_FSTAT_CMDABT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_CMDABT_SHIFT)) & FMUTEST_FSTAT_CMDABT_MASK) - -#define FMUTEST_FSTAT_PVIOL_MASK (0x10U) -#define FMUTEST_FSTAT_PVIOL_SHIFT (4U) -/*! PVIOL - Command Protection Violation Flag - * 0b0..No protection violation detected - * 0b1..Protection violation detected - */ -#define FMUTEST_FSTAT_PVIOL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_PVIOL_SHIFT)) & FMUTEST_FSTAT_PVIOL_MASK) - -#define FMUTEST_FSTAT_ACCERR_MASK (0x20U) -#define FMUTEST_FSTAT_ACCERR_SHIFT (5U) -/*! ACCERR - Command Access Error Flag - * 0b0..No access error detected - * 0b1..Access error detected - */ -#define FMUTEST_FSTAT_ACCERR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_ACCERR_SHIFT)) & FMUTEST_FSTAT_ACCERR_MASK) - -#define FMUTEST_FSTAT_CWSABT_MASK (0x40U) -#define FMUTEST_FSTAT_CWSABT_SHIFT (6U) -/*! CWSABT - Command Write Sequence Abort Flag - * 0b0..Command write sequence not aborted - * 0b1..Command write sequence aborted - */ -#define FMUTEST_FSTAT_CWSABT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_CWSABT_SHIFT)) & FMUTEST_FSTAT_CWSABT_MASK) - -#define FMUTEST_FSTAT_CCIF_MASK (0x80U) -#define FMUTEST_FSTAT_CCIF_SHIFT (7U) -/*! CCIF - Command Complete Interrupt Flag - * 0b0..Flash command or initialization in progress - * 0b1..Flash command or initialization has completed - */ -#define FMUTEST_FSTAT_CCIF(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_CCIF_SHIFT)) & FMUTEST_FSTAT_CCIF_MASK) - -#define FMUTEST_FSTAT_CMDPRT_MASK (0x300U) -#define FMUTEST_FSTAT_CMDPRT_SHIFT (8U) -/*! CMDPRT - Command Protection Level - * 0b00..Secure, normal access - * 0b01..Secure, privileged access - * 0b10..Nonsecure, normal access - * 0b11..Nonsecure, privileged access - */ -#define FMUTEST_FSTAT_CMDPRT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_CMDPRT_SHIFT)) & FMUTEST_FSTAT_CMDPRT_MASK) - -#define FMUTEST_FSTAT_CMDP_MASK (0x800U) -#define FMUTEST_FSTAT_CMDP_SHIFT (11U) -/*! CMDP - Command Protection Status Flag - * 0b0..Command protection level and domain ID are stale - * 0b1..Command protection level (CMDPRT) and domain ID (CMDDID) are set - */ -#define FMUTEST_FSTAT_CMDP(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_CMDP_SHIFT)) & FMUTEST_FSTAT_CMDP_MASK) - -#define FMUTEST_FSTAT_CMDDID_MASK (0xF000U) -#define FMUTEST_FSTAT_CMDDID_SHIFT (12U) -/*! CMDDID - Command Domain ID */ -#define FMUTEST_FSTAT_CMDDID(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_CMDDID_SHIFT)) & FMUTEST_FSTAT_CMDDID_MASK) - -#define FMUTEST_FSTAT_DFDIF_MASK (0x10000U) -#define FMUTEST_FSTAT_DFDIF_SHIFT (16U) -/*! DFDIF - Double Bit Fault Detect Interrupt Flag - * 0b0..Double bit fault not detected during a valid flash read access from the FMC - * 0b1..Double bit fault detected (or FCTRL[FDFD] is set) during a valid flash read access from the FMC - */ -#define FMUTEST_FSTAT_DFDIF(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_DFDIF_SHIFT)) & FMUTEST_FSTAT_DFDIF_MASK) - -#define FMUTEST_FSTAT_SALV_USED_MASK (0x20000U) -#define FMUTEST_FSTAT_SALV_USED_SHIFT (17U) -/*! SALV_USED - Salvage Used for Erase operation - * 0b0..Salvage not used during the last operation - * 0b1..Salvage used during the last erase operation - */ -#define FMUTEST_FSTAT_SALV_USED(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_SALV_USED_SHIFT)) & FMUTEST_FSTAT_SALV_USED_MASK) - -#define FMUTEST_FSTAT_PEWEN_MASK (0x3000000U) -#define FMUTEST_FSTAT_PEWEN_SHIFT (24U) -/*! PEWEN - Program-Erase Write Enable Control - * 0b00..Writes are not enabled - * 0b01..Writes are enabled for one flash or IFR phrase (phrase programming, sector erase) - * 0b10..Writes are enabled for one flash or IFR page (page programming) - * 0b11..Reserved - */ -#define FMUTEST_FSTAT_PEWEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_PEWEN_SHIFT)) & FMUTEST_FSTAT_PEWEN_MASK) - -#define FMUTEST_FSTAT_PERDY_MASK (0x80000000U) -#define FMUTEST_FSTAT_PERDY_SHIFT (31U) -/*! PERDY - Program/Erase Ready Control/Status Flag - * 0b0..Program or sector erase command operation is not stalled - * 0b1..Program or sector erase command operation is stalled - */ -#define FMUTEST_FSTAT_PERDY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_PERDY_SHIFT)) & FMUTEST_FSTAT_PERDY_MASK) -/*! @} */ - -/*! @name FCNFG - Flash Configuration Register */ -/*! @{ */ - -#define FMUTEST_FCNFG_CCIE_MASK (0x80U) -#define FMUTEST_FCNFG_CCIE_SHIFT (7U) -/*! CCIE - Command Complete Interrupt Enable - * 0b0..Command complete interrupt disabled - * 0b1..Command complete interrupt enabled. An interrupt request is generated whenever the FSTAT[CCIF] flag is set. - */ -#define FMUTEST_FCNFG_CCIE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCNFG_CCIE_SHIFT)) & FMUTEST_FCNFG_CCIE_MASK) - -#define FMUTEST_FCNFG_ERSREQ_MASK (0x100U) -#define FMUTEST_FCNFG_ERSREQ_SHIFT (8U) -/*! ERSREQ - Mass Erase (Erase All) Request - * 0b0..No request or request complete - * 0b1..Request to run the Mass Erase operation - */ -#define FMUTEST_FCNFG_ERSREQ(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCNFG_ERSREQ_SHIFT)) & FMUTEST_FCNFG_ERSREQ_MASK) - -#define FMUTEST_FCNFG_DFDIE_MASK (0x10000U) -#define FMUTEST_FCNFG_DFDIE_SHIFT (16U) -/*! DFDIE - Double Bit Fault Detect Interrupt Enable - * 0b0..Double bit fault detect interrupt disabled - * 0b1..Double bit fault detect interrupt enabled; an interrupt request is generated whenever the FSTAT[DFDIF] flag is set - */ -#define FMUTEST_FCNFG_DFDIE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCNFG_DFDIE_SHIFT)) & FMUTEST_FCNFG_DFDIE_MASK) - -#define FMUTEST_FCNFG_ERSIEN0_MASK (0xF000000U) -#define FMUTEST_FCNFG_ERSIEN0_SHIFT (24U) -/*! ERSIEN0 - Erase IFR Sector Enable - Block 0 - * 0b0000..Block 0 IFR Sector X is protected from erase by ERSSCR command - * 0b0001..Block 0 IFR Sector X is not protected from erase by ERSSCR command - */ -#define FMUTEST_FCNFG_ERSIEN0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCNFG_ERSIEN0_SHIFT)) & FMUTEST_FCNFG_ERSIEN0_MASK) - -#define FMUTEST_FCNFG_ERSIEN1_MASK (0xF0000000U) -#define FMUTEST_FCNFG_ERSIEN1_SHIFT (28U) -/*! ERSIEN1 - Erase IFR Sector Enable - Block 1 (for dual block configs) - * 0b0000..Block 1 IFR Sector X is protected from erase by ERSSCR command - * 0b0001..Block 1 IFR Sector X is not protected from erase by ERSSCR command - */ -#define FMUTEST_FCNFG_ERSIEN1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCNFG_ERSIEN1_SHIFT)) & FMUTEST_FCNFG_ERSIEN1_MASK) -/*! @} */ - -/*! @name FCTRL - Flash Control Register */ -/*! @{ */ - -#define FMUTEST_FCTRL_RWSC_MASK (0xFU) -#define FMUTEST_FCTRL_RWSC_SHIFT (0U) -/*! RWSC - Read Wait-State Control - * 0b0000..no additional wait-states are added (single cycle access) - * 0b0001..1 additional wait-state is added - * 0b0010..2 additional wait-states are added - * 0b0011..3 additional wait-states are added - * 0b0100..4 additional wait-states are added - * 0b0101..5 additional wait-states are added - * 0b0110..6 additional wait-states are added - * 0b0111..7 additional wait-states are added - * 0b1000..8 additional wait-states are added - * 0b1001..9 additional wait-states are added - * 0b1010..10 additional wait-states are added - * 0b1011..11 additional wait-states are added - * 0b1100..12 additional wait-states are added - * 0b1101..13 additional wait-states are added - * 0b1110..14 additional wait-states are added - * 0b1111..15 additional wait-states are added - */ -#define FMUTEST_FCTRL_RWSC(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCTRL_RWSC_SHIFT)) & FMUTEST_FCTRL_RWSC_MASK) - -#define FMUTEST_FCTRL_LSACTIVE_MASK (0x100U) -#define FMUTEST_FCTRL_LSACTIVE_SHIFT (8U) -/*! LSACTIVE - Low Speed Active Mode - * 0b0..Full speed active mode requested - * 0b1..Low speed active mode requested - */ -#define FMUTEST_FCTRL_LSACTIVE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCTRL_LSACTIVE_SHIFT)) & FMUTEST_FCTRL_LSACTIVE_MASK) - -#define FMUTEST_FCTRL_FDFD_MASK (0x10000U) -#define FMUTEST_FCTRL_FDFD_SHIFT (16U) -/*! FDFD - Force Double Bit Fault Detect - * 0b0..FSTAT[DFDIF] sets only if a double bit fault is detected during a valid flash read access from the FMC - * 0b1..FSTAT[DFDIF] sets during any valid flash read access from the FMC; an interrupt request is generated if the DFDIE bit is set - */ -#define FMUTEST_FCTRL_FDFD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCTRL_FDFD_SHIFT)) & FMUTEST_FCTRL_FDFD_MASK) - -#define FMUTEST_FCTRL_ABTREQ_MASK (0x1000000U) -#define FMUTEST_FCTRL_ABTREQ_SHIFT (24U) -/*! ABTREQ - Abort Request - * 0b0..No request to abort a command write sequence - * 0b1..Request to abort a command write sequence - */ -#define FMUTEST_FCTRL_ABTREQ(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCTRL_ABTREQ_SHIFT)) & FMUTEST_FCTRL_ABTREQ_MASK) -/*! @} */ - -/*! @name FTEST - Flash Test Register */ -/*! @{ */ - -#define FMUTEST_FTEST_TMECTL_MASK (0x1U) -#define FMUTEST_FTEST_TMECTL_SHIFT (0U) -/*! TMECTL - Test Mode Entry Control - * 0b0..FTEST register always reads 0 and writes to FTEST are ignored - * 0b1..FTEST register is readable and can be written to enable writability of TME - */ -#define FMUTEST_FTEST_TMECTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FTEST_TMECTL_SHIFT)) & FMUTEST_FTEST_TMECTL_MASK) - -#define FMUTEST_FTEST_TMEWR_MASK (0x2U) -#define FMUTEST_FTEST_TMEWR_SHIFT (1U) -/*! TMEWR - Test Mode Entry Writable - * 0b0..TME bit is not writable - * 0b1..TME bit is writable - */ -#define FMUTEST_FTEST_TMEWR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FTEST_TMEWR_SHIFT)) & FMUTEST_FTEST_TMEWR_MASK) - -#define FMUTEST_FTEST_TME_MASK (0x4U) -#define FMUTEST_FTEST_TME_SHIFT (2U) -/*! TME - Test Mode Entry - * 0b0..Test mode entry not requested - * 0b1..Test mode entry requested - */ -#define FMUTEST_FTEST_TME(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FTEST_TME_SHIFT)) & FMUTEST_FTEST_TME_MASK) - -#define FMUTEST_FTEST_TMODE_MASK (0x8U) -#define FMUTEST_FTEST_TMODE_SHIFT (3U) -/*! TMODE - Test Mode Status - * 0b0..Test mode not active - * 0b1..Test mode active - */ -#define FMUTEST_FTEST_TMODE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FTEST_TMODE_SHIFT)) & FMUTEST_FTEST_TMODE_MASK) - -#define FMUTEST_FTEST_TMELOCK_MASK (0x10U) -#define FMUTEST_FTEST_TMELOCK_SHIFT (4U) -/*! TMELOCK - Test Mode Entry Lock - * 0b0..FTEST register not locked from accepting writes - * 0b1..FTEST register locked from accepting writes - */ -#define FMUTEST_FTEST_TMELOCK(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FTEST_TMELOCK_SHIFT)) & FMUTEST_FTEST_TMELOCK_MASK) -/*! @} */ - -/*! @name FCCOB0 - Flash Command Control 0 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB0_CMDCODE_MASK (0xFFU) -#define FMUTEST_FCCOB0_CMDCODE_SHIFT (0U) -/*! CMDCODE - Command code */ -#define FMUTEST_FCCOB0_CMDCODE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB0_CMDCODE_SHIFT)) & FMUTEST_FCCOB0_CMDCODE_MASK) -/*! @} */ - -/*! @name FCCOB1 - Flash Command Control 1 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB1_CMDOPT_MASK (0xFFU) -#define FMUTEST_FCCOB1_CMDOPT_SHIFT (0U) -/*! CMDOPT - Command options */ -#define FMUTEST_FCCOB1_CMDOPT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB1_CMDOPT_SHIFT)) & FMUTEST_FCCOB1_CMDOPT_MASK) -/*! @} */ - -/*! @name FCCOB2 - Flash Command Control 2 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB2_CMDADDR_MASK (0xFFFFFFFFU) -#define FMUTEST_FCCOB2_CMDADDR_SHIFT (0U) -/*! CMDADDR - Command starting address */ -#define FMUTEST_FCCOB2_CMDADDR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB2_CMDADDR_SHIFT)) & FMUTEST_FCCOB2_CMDADDR_MASK) -/*! @} */ - -/*! @name FCCOB3 - Flash Command Control 3 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB3_CMDADDRE_MASK (0xFFFFFFFFU) -#define FMUTEST_FCCOB3_CMDADDRE_SHIFT (0U) -/*! CMDADDRE - Command ending address */ -#define FMUTEST_FCCOB3_CMDADDRE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB3_CMDADDRE_SHIFT)) & FMUTEST_FCCOB3_CMDADDRE_MASK) -/*! @} */ - -/*! @name FCCOB4 - Flash Command Control 4 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB4_CMDDATA0_MASK (0xFFFFFFFFU) -#define FMUTEST_FCCOB4_CMDDATA0_SHIFT (0U) -/*! CMDDATA0 - Command data word 0 */ -#define FMUTEST_FCCOB4_CMDDATA0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB4_CMDDATA0_SHIFT)) & FMUTEST_FCCOB4_CMDDATA0_MASK) -/*! @} */ - -/*! @name FCCOB5 - Flash Command Control 5 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB5_CMDDATA1_MASK (0xFFFFFFFFU) -#define FMUTEST_FCCOB5_CMDDATA1_SHIFT (0U) -/*! CMDDATA1 - Command data word 1 */ -#define FMUTEST_FCCOB5_CMDDATA1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB5_CMDDATA1_SHIFT)) & FMUTEST_FCCOB5_CMDDATA1_MASK) -/*! @} */ - -/*! @name FCCOB6 - Flash Command Control 6 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB6_CMDDATA2_MASK (0xFFFFFFFFU) -#define FMUTEST_FCCOB6_CMDDATA2_SHIFT (0U) -/*! CMDDATA2 - Command data word 2 */ -#define FMUTEST_FCCOB6_CMDDATA2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB6_CMDDATA2_SHIFT)) & FMUTEST_FCCOB6_CMDDATA2_MASK) -/*! @} */ - -/*! @name FCCOB7 - Flash Command Control 7 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB7_CMDDATA3_MASK (0xFFFFFFFFU) -#define FMUTEST_FCCOB7_CMDDATA3_SHIFT (0U) -/*! CMDDATA3 - Command data word 3 */ -#define FMUTEST_FCCOB7_CMDDATA3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB7_CMDDATA3_SHIFT)) & FMUTEST_FCCOB7_CMDDATA3_MASK) -/*! @} */ - -/*! @name RESET_STATUS - FMU Initialization Tracking Register */ -/*! @{ */ - -#define FMUTEST_RESET_STATUS_ARY_TRIM_DONE_MASK (0x1U) -#define FMUTEST_RESET_STATUS_ARY_TRIM_DONE_SHIFT (0U) -/*! ARY_TRIM_DONE - Array Trim Complete - * 0b0..Recall register load operation has not been completed - * 0b1..Recall register load operation has completed - */ -#define FMUTEST_RESET_STATUS_ARY_TRIM_DONE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_ARY_TRIM_DONE_SHIFT)) & FMUTEST_RESET_STATUS_ARY_TRIM_DONE_MASK) - -#define FMUTEST_RESET_STATUS_FMU_PARM_EN_MASK (0x2U) -#define FMUTEST_RESET_STATUS_FMU_PARM_EN_SHIFT (1U) -/*! FMU_PARM_EN - Status of the C0DE_C0DEh check to enable loading of the FMU parameters - * 0b0..C0DE_C0DEh check not attempted - * 0b1..C0DE_C0DEh check completed - */ -#define FMUTEST_RESET_STATUS_FMU_PARM_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_FMU_PARM_EN_SHIFT)) & FMUTEST_RESET_STATUS_FMU_PARM_EN_MASK) - -#define FMUTEST_RESET_STATUS_FMU_PARM_DONE_MASK (0x4U) -#define FMUTEST_RESET_STATUS_FMU_PARM_DONE_SHIFT (2U) -/*! FMU_PARM_DONE - FMU Register Load Complete - * 0b0..FMU registers have not been loaded - * 0b1..FMU registers have been loaded - */ -#define FMUTEST_RESET_STATUS_FMU_PARM_DONE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_FMU_PARM_DONE_SHIFT)) & FMUTEST_RESET_STATUS_FMU_PARM_DONE_MASK) - -#define FMUTEST_RESET_STATUS_SOC_TRIM_EN_MASK (0x8U) -#define FMUTEST_RESET_STATUS_SOC_TRIM_EN_SHIFT (3U) -/*! SOC_TRIM_EN - Status of the C0DE_C0DEh check to enable loading of the SoC trim settings - * 0b0..C0DE_C0DEh check not attempted - * 0b1..C0DE_C0DEh check completed - */ -#define FMUTEST_RESET_STATUS_SOC_TRIM_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_SOC_TRIM_EN_SHIFT)) & FMUTEST_RESET_STATUS_SOC_TRIM_EN_MASK) - -#define FMUTEST_RESET_STATUS_SOC_TRIM_ECC_MASK (0x10U) -#define FMUTEST_RESET_STATUS_SOC_TRIM_ECC_SHIFT (4U) -/*! SOC_TRIM_ECC - Status of the C0DE_C0DEh check for enabling ECC decoder during reads of SoC trim settings - * 0b0..C0DE_C0DEh check failed - * 0b1..C0DE_C0DEh check passed - */ -#define FMUTEST_RESET_STATUS_SOC_TRIM_ECC(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_SOC_TRIM_ECC_SHIFT)) & FMUTEST_RESET_STATUS_SOC_TRIM_ECC_MASK) - -#define FMUTEST_RESET_STATUS_SOC_TRIM_DONE_MASK (0x20U) -#define FMUTEST_RESET_STATUS_SOC_TRIM_DONE_SHIFT (5U) -/*! SOC_TRIM_DONE - SoC Trim Complete - * 0b0..SoC Trim registers have not been updated - * 0b1..All SoC Trim registers have been updated - */ -#define FMUTEST_RESET_STATUS_SOC_TRIM_DONE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_SOC_TRIM_DONE_SHIFT)) & FMUTEST_RESET_STATUS_SOC_TRIM_DONE_MASK) - -#define FMUTEST_RESET_STATUS_RPR_DONE_MASK (0x40U) -#define FMUTEST_RESET_STATUS_RPR_DONE_SHIFT (6U) -/*! RPR_DONE - Array Repair Complete - * 0b0..Repair registers have not been loaded - * 0b1..Repair registers have been loaded - */ -#define FMUTEST_RESET_STATUS_RPR_DONE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_RPR_DONE_SHIFT)) & FMUTEST_RESET_STATUS_RPR_DONE_MASK) - -#define FMUTEST_RESET_STATUS_INIT_DONE_MASK (0x80U) -#define FMUTEST_RESET_STATUS_INIT_DONE_SHIFT (7U) -/*! INIT_DONE - Initialization Done - * 0b0..All initialization steps did not complete - * 0b1..All initialization steps completed - */ -#define FMUTEST_RESET_STATUS_INIT_DONE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_INIT_DONE_SHIFT)) & FMUTEST_RESET_STATUS_INIT_DONE_MASK) - -#define FMUTEST_RESET_STATUS_RST_SF_ERR_MASK (0x100U) -#define FMUTEST_RESET_STATUS_RST_SF_ERR_SHIFT (8U) -/*! RST_SF_ERR - ECC Single Fault during Reset Recovery - * 0b0..No single-bit faults detected during initialization - * 0b1..At least one single ECC fault was detected during initialization - */ -#define FMUTEST_RESET_STATUS_RST_SF_ERR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_RST_SF_ERR_SHIFT)) & FMUTEST_RESET_STATUS_RST_SF_ERR_MASK) - -#define FMUTEST_RESET_STATUS_RST_DF_ERR_MASK (0x200U) -#define FMUTEST_RESET_STATUS_RST_DF_ERR_SHIFT (9U) -/*! RST_DF_ERR - ECC Double Fault during Reset Recovery - * 0b0..No double-bit faults detected during initialization - * 0b1..Double-bit ECC fault was detected during initialization - */ -#define FMUTEST_RESET_STATUS_RST_DF_ERR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_RST_DF_ERR_SHIFT)) & FMUTEST_RESET_STATUS_RST_DF_ERR_MASK) - -#define FMUTEST_RESET_STATUS_SOC_TRIM_DF_ERR_MASK (0x3FC00U) -#define FMUTEST_RESET_STATUS_SOC_TRIM_DF_ERR_SHIFT (10U) -/*! SOC_TRIM_DF_ERR - ECC Double Fault during load of SoC Trim phrases */ -#define FMUTEST_RESET_STATUS_SOC_TRIM_DF_ERR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_SOC_TRIM_DF_ERR_SHIFT)) & FMUTEST_RESET_STATUS_SOC_TRIM_DF_ERR_MASK) - -#define FMUTEST_RESET_STATUS_RST_PATCH_LD_MASK (0x40000U) -#define FMUTEST_RESET_STATUS_RST_PATCH_LD_SHIFT (18U) -/*! RST_PATCH_LD - Reset Patch Required - * 0b0..No patch required to be loaded during reset - * 0b1..Patch loaded during reset - */ -#define FMUTEST_RESET_STATUS_RST_PATCH_LD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_RST_PATCH_LD_SHIFT)) & FMUTEST_RESET_STATUS_RST_PATCH_LD_MASK) - -#define FMUTEST_RESET_STATUS_RECALL_DATA_MISMATCH_MASK (0x80000U) -#define FMUTEST_RESET_STATUS_RECALL_DATA_MISMATCH_SHIFT (19U) -/*! RECALL_DATA_MISMATCH - Recall Data Mismatch - * 0b0..Data read towards end of reset matched data read for Recall - * 0b1..Data read towards end of reset did not match data read for recall - */ -#define FMUTEST_RESET_STATUS_RECALL_DATA_MISMATCH(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_RECALL_DATA_MISMATCH_SHIFT)) & FMUTEST_RESET_STATUS_RECALL_DATA_MISMATCH_MASK) -/*! @} */ - -/*! @name MCTL - FMU Control Register */ -/*! @{ */ - -#define FMUTEST_MCTL_COREHLD_MASK (0x1U) -#define FMUTEST_MCTL_COREHLD_SHIFT (0U) -/*! COREHLD - Core Hold - * 0b0..CPU access is allowed - * 0b1..CPU access must be blocked - */ -#define FMUTEST_MCTL_COREHLD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_COREHLD_SHIFT)) & FMUTEST_MCTL_COREHLD_MASK) - -#define FMUTEST_MCTL_LSACT_EN_MASK (0x4U) -#define FMUTEST_MCTL_LSACT_EN_SHIFT (2U) -/*! LSACT_EN - LSACTIVE Feature Enable - * 0b0..LSACTIVE feature disabled completely: FCTRL[LSACTIVE] is forced low and no longer writable, LVE cannot assert at the TSMC array interface. - * 0b1..LSACTIVE feature fully enabled and controllable by SoC and internal UINT SM. - */ -#define FMUTEST_MCTL_LSACT_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_LSACT_EN_SHIFT)) & FMUTEST_MCTL_LSACT_EN_MASK) - -#define FMUTEST_MCTL_LSACTWREN_MASK (0x8U) -#define FMUTEST_MCTL_LSACTWREN_SHIFT (3U) -/*! LSACTWREN - LSACTIVE Write Enable - * 0b0..Unrestricted write access allowed - * 0b1..Write access while CMP set must match CMDDID and CMDPRT - */ -#define FMUTEST_MCTL_LSACTWREN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_LSACTWREN_SHIFT)) & FMUTEST_MCTL_LSACTWREN_MASK) - -#define FMUTEST_MCTL_MASTER_REPAIR_EN_MASK (0x10U) -#define FMUTEST_MCTL_MASTER_REPAIR_EN_SHIFT (4U) -/*! MASTER_REPAIR_EN - Master Repair Enable - * 0b0..Repair disabled - * 0b1..Repair enable determined by bit 0 of each REPAIR register - */ -#define FMUTEST_MCTL_MASTER_REPAIR_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_MASTER_REPAIR_EN_SHIFT)) & FMUTEST_MCTL_MASTER_REPAIR_EN_MASK) - -#define FMUTEST_MCTL_RFCMDEN_MASK (0x20U) -#define FMUTEST_MCTL_RFCMDEN_SHIFT (5U) -/*! RFCMDEN - RF Active Command Enable Control - * 0b0..Flash commands blocked (CCIF not writable) - * 0b1..Flash commands allowed - */ -#define FMUTEST_MCTL_RFCMDEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_RFCMDEN_SHIFT)) & FMUTEST_MCTL_RFCMDEN_MASK) - -#define FMUTEST_MCTL_CWSABTEN_MASK (0x40U) -#define FMUTEST_MCTL_CWSABTEN_SHIFT (6U) -/*! CWSABTEN - Command Write Sequence Abort Enable - * 0b0..CWS abort feature is disabled - * 0b1..CWS abort feature is enabled - */ -#define FMUTEST_MCTL_CWSABTEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_CWSABTEN_SHIFT)) & FMUTEST_MCTL_CWSABTEN_MASK) - -#define FMUTEST_MCTL_MRGRDDIS_MASK (0x80U) -#define FMUTEST_MCTL_MRGRDDIS_SHIFT (7U) -/*! MRGRDDIS - Margin Read Disable - * 0b0..Margin Read Settings are enabled - * 0b1..Margin Read Settings are disabled - */ -#define FMUTEST_MCTL_MRGRDDIS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_MRGRDDIS_SHIFT)) & FMUTEST_MCTL_MRGRDDIS_MASK) - -#define FMUTEST_MCTL_MRGRD0_MASK (0xF00U) -#define FMUTEST_MCTL_MRGRD0_SHIFT (8U) -/*! MRGRD0 - Margin Read Setting for Program */ -#define FMUTEST_MCTL_MRGRD0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_MRGRD0_SHIFT)) & FMUTEST_MCTL_MRGRD0_MASK) - -#define FMUTEST_MCTL_MRGRD1_MASK (0xF000U) -#define FMUTEST_MCTL_MRGRD1_SHIFT (12U) -/*! MRGRD1 - Margin Read Setting for Erase */ -#define FMUTEST_MCTL_MRGRD1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_MRGRD1_SHIFT)) & FMUTEST_MCTL_MRGRD1_MASK) - -#define FMUTEST_MCTL_ERSAACK_MASK (0x10000U) -#define FMUTEST_MCTL_ERSAACK_SHIFT (16U) -/*! ERSAACK - Mass Erase (Erase All) Acknowledge - * 0b0..Mass Erase operation is not active (operation has completed or has not started) - * 0b1..Mass Erase operation is active (controller acknowledges that the soc_ersall_req input is asserted and will continue with the operation) - */ -#define FMUTEST_MCTL_ERSAACK(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_ERSAACK_SHIFT)) & FMUTEST_MCTL_ERSAACK_MASK) - -#define FMUTEST_MCTL_SCAN_OBS_MASK (0x80000U) -#define FMUTEST_MCTL_SCAN_OBS_SHIFT (19U) -/*! SCAN_OBS - Scan Observability Control - * 0b0..Normal functional behavior - * 0b1..Enables observation of signals that may otherwise be ATPG untestable - */ -#define FMUTEST_MCTL_SCAN_OBS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_SCAN_OBS_SHIFT)) & FMUTEST_MCTL_SCAN_OBS_MASK) - -#define FMUTEST_MCTL_BIST_CTL_MASK (0x100000U) -#define FMUTEST_MCTL_BIST_CTL_SHIFT (20U) -/*! BIST_CTL - BIST IP Control - * 0b0..BIST IP disabled - * 0b1..BIST IP enabled - */ -#define FMUTEST_MCTL_BIST_CTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_BIST_CTL_SHIFT)) & FMUTEST_MCTL_BIST_CTL_MASK) - -#define FMUTEST_MCTL_SMWR_CTL_MASK (0x200000U) -#define FMUTEST_MCTL_SMWR_CTL_SHIFT (21U) -/*! SMWR_CTL - SMWR IP Control - * 0b0..SMWR IP disabled - * 0b1..SMWR IP enabled - */ -#define FMUTEST_MCTL_SMWR_CTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_SMWR_CTL_SHIFT)) & FMUTEST_MCTL_SMWR_CTL_MASK) - -#define FMUTEST_MCTL_SALV_DIS_MASK (0x1000000U) -#define FMUTEST_MCTL_SALV_DIS_SHIFT (24U) -/*! SALV_DIS - Salvage Disable - * 0b0..Salvage enabled (ECC used during erase verify) - * 0b1..Salvage disabled (ECC not used during erase verify) - */ -#define FMUTEST_MCTL_SALV_DIS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_SALV_DIS_SHIFT)) & FMUTEST_MCTL_SALV_DIS_MASK) - -#define FMUTEST_MCTL_SOC_ECC_CTL_MASK (0x2000000U) -#define FMUTEST_MCTL_SOC_ECC_CTL_SHIFT (25U) -/*! SOC_ECC_CTL - SOC ECC Control - * 0b0..ECC is enabled for SOC read access - * 0b1..ECC is disabled for SOC read access - */ -#define FMUTEST_MCTL_SOC_ECC_CTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_SOC_ECC_CTL_SHIFT)) & FMUTEST_MCTL_SOC_ECC_CTL_MASK) - -#define FMUTEST_MCTL_FMU_ECC_CTL_MASK (0x4000000U) -#define FMUTEST_MCTL_FMU_ECC_CTL_SHIFT (26U) -/*! FMU_ECC_CTL - FMU ECC Control - * 0b0..ECC is enabled for FMU program operations - * 0b1..ECC is disabled for FMU program operations - */ -#define FMUTEST_MCTL_FMU_ECC_CTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_FMU_ECC_CTL_SHIFT)) & FMUTEST_MCTL_FMU_ECC_CTL_MASK) - -#define FMUTEST_MCTL_BIST_PWR_DIS_MASK (0x20000000U) -#define FMUTEST_MCTL_BIST_PWR_DIS_SHIFT (29U) -/*! BIST_PWR_DIS - BIST Power Mode Disable - * 0b0..BIST DFT logic has full control of SLM and LVE when BIST is enabled (including during commands) - * 0b1..BIST DFT logic has no control of SLM and LVE; power mode RTL is in complete control of SLM and LVE values - */ -#define FMUTEST_MCTL_BIST_PWR_DIS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_BIST_PWR_DIS_SHIFT)) & FMUTEST_MCTL_BIST_PWR_DIS_MASK) - -#define FMUTEST_MCTL_OSC_H_MASK (0x80000000U) -#define FMUTEST_MCTL_OSC_H_SHIFT (31U) -/*! OSC_H - Oscillator control - * 0b0..Use APB clock - * 0b1..Use a known fixed-frequency clock, e.g. 12 MHz - */ -#define FMUTEST_MCTL_OSC_H(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_OSC_H_SHIFT)) & FMUTEST_MCTL_OSC_H_MASK) -/*! @} */ - -/*! @name BSEL_GEN - FMU Block Select Generation Register */ -/*! @{ */ - -#define FMUTEST_BSEL_GEN_SBSEL_GEN_MASK (0x3U) -#define FMUTEST_BSEL_GEN_SBSEL_GEN_SHIFT (0U) -/*! SBSEL_GEN - Generated SBSEL */ -#define FMUTEST_BSEL_GEN_SBSEL_GEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BSEL_GEN_SBSEL_GEN_SHIFT)) & FMUTEST_BSEL_GEN_SBSEL_GEN_MASK) - -#define FMUTEST_BSEL_GEN_MBSEL_GEN_MASK (0x300U) -#define FMUTEST_BSEL_GEN_MBSEL_GEN_SHIFT (8U) -/*! MBSEL_GEN - Generated MBSEL */ -#define FMUTEST_BSEL_GEN_MBSEL_GEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BSEL_GEN_MBSEL_GEN_SHIFT)) & FMUTEST_BSEL_GEN_MBSEL_GEN_MASK) -/*! @} */ - -/*! @name PWR_OPT - Power Mode Options Register */ -/*! @{ */ - -#define FMUTEST_PWR_OPT_PD_CDIV_MASK (0xFFU) -#define FMUTEST_PWR_OPT_PD_CDIV_SHIFT (0U) -/*! PD_CDIV - Power Down Clock Divider Setting */ -#define FMUTEST_PWR_OPT_PD_CDIV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PWR_OPT_PD_CDIV_SHIFT)) & FMUTEST_PWR_OPT_PD_CDIV_MASK) - -#define FMUTEST_PWR_OPT_SLM_COUNT_MASK (0x3FF0000U) -#define FMUTEST_PWR_OPT_SLM_COUNT_SHIFT (16U) -/*! SLM_COUNT - Sleep Recovery Timer Count */ -#define FMUTEST_PWR_OPT_SLM_COUNT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PWR_OPT_SLM_COUNT_SHIFT)) & FMUTEST_PWR_OPT_SLM_COUNT_MASK) - -#define FMUTEST_PWR_OPT_PD_TIMER_EN_MASK (0x80000000U) -#define FMUTEST_PWR_OPT_PD_TIMER_EN_SHIFT (31U) -/*! PD_TIMER_EN - Power Down BIST Timer Enable - * 0b0..BIST timer is not triggered during Power Down recovery - * 0b1..BIST timer is triggered during Power Down recovery (default behavior) - */ -#define FMUTEST_PWR_OPT_PD_TIMER_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PWR_OPT_PD_TIMER_EN_SHIFT)) & FMUTEST_PWR_OPT_PD_TIMER_EN_MASK) -/*! @} */ - -/*! @name CMD_CHECK - FMU Command Check Register */ -/*! @{ */ - -#define FMUTEST_CMD_CHECK_ALIGNFAIL_PHR_MASK (0x1U) -#define FMUTEST_CMD_CHECK_ALIGNFAIL_PHR_SHIFT (0U) -/*! ALIGNFAIL_PHR - Phrase Alignment Fail - * 0b0..The address is phrase-aligned - * 0b1..The address is not phrase-aligned - */ -#define FMUTEST_CMD_CHECK_ALIGNFAIL_PHR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ALIGNFAIL_PHR_SHIFT)) & FMUTEST_CMD_CHECK_ALIGNFAIL_PHR_MASK) - -#define FMUTEST_CMD_CHECK_ALIGNFAIL_PG_MASK (0x2U) -#define FMUTEST_CMD_CHECK_ALIGNFAIL_PG_SHIFT (1U) -/*! ALIGNFAIL_PG - Page Alignment Fail - * 0b0..The address is page-aligned - * 0b1..The address is not page-aligned - */ -#define FMUTEST_CMD_CHECK_ALIGNFAIL_PG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ALIGNFAIL_PG_SHIFT)) & FMUTEST_CMD_CHECK_ALIGNFAIL_PG_MASK) - -#define FMUTEST_CMD_CHECK_ALIGNFAIL_SCR_MASK (0x4U) -#define FMUTEST_CMD_CHECK_ALIGNFAIL_SCR_SHIFT (2U) -/*! ALIGNFAIL_SCR - Sector Alignment Fail - * 0b0..The address is sector-aligned - * 0b1..The address is not sector-aligned - */ -#define FMUTEST_CMD_CHECK_ALIGNFAIL_SCR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ALIGNFAIL_SCR_SHIFT)) & FMUTEST_CMD_CHECK_ALIGNFAIL_SCR_MASK) - -#define FMUTEST_CMD_CHECK_ALIGNFAIL_BLK_MASK (0x8U) -#define FMUTEST_CMD_CHECK_ALIGNFAIL_BLK_SHIFT (3U) -/*! ALIGNFAIL_BLK - Block Alignment Fail - * 0b0..The address is block-aligned - * 0b1..The address is not block-aligned - */ -#define FMUTEST_CMD_CHECK_ALIGNFAIL_BLK(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ALIGNFAIL_BLK_SHIFT)) & FMUTEST_CMD_CHECK_ALIGNFAIL_BLK_MASK) - -#define FMUTEST_CMD_CHECK_ADDR_FAIL_MASK (0x10U) -#define FMUTEST_CMD_CHECK_ADDR_FAIL_SHIFT (4U) -/*! ADDR_FAIL - Address Fail - * 0b0..The address is within the flash or IFR address space - * 0b1..The address is outside the flash or IFR address space - */ -#define FMUTEST_CMD_CHECK_ADDR_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ADDR_FAIL_SHIFT)) & FMUTEST_CMD_CHECK_ADDR_FAIL_MASK) - -#define FMUTEST_CMD_CHECK_IFR_CMD_MASK (0x20U) -#define FMUTEST_CMD_CHECK_IFR_CMD_SHIFT (5U) -/*! IFR_CMD - IFR Command - * 0b0..The command operates on a main flash address - * 0b1..The command operates on an IFR address - */ -#define FMUTEST_CMD_CHECK_IFR_CMD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_IFR_CMD_SHIFT)) & FMUTEST_CMD_CHECK_IFR_CMD_MASK) - -#define FMUTEST_CMD_CHECK_ALL_CMD_MASK (0x40U) -#define FMUTEST_CMD_CHECK_ALL_CMD_SHIFT (6U) -/*! ALL_CMD - All Blocks Command - * 0b0..The command operates on a single flash block - * 0b1..The command operates on all flash blocks - */ -#define FMUTEST_CMD_CHECK_ALL_CMD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ALL_CMD_SHIFT)) & FMUTEST_CMD_CHECK_ALL_CMD_MASK) - -#define FMUTEST_CMD_CHECK_RANGE_FAIL_MASK (0x80U) -#define FMUTEST_CMD_CHECK_RANGE_FAIL_SHIFT (7U) -/*! RANGE_FAIL - Address Range Fail - * 0b0..The address range is valid - * 0b1..The address range is invalid - */ -#define FMUTEST_CMD_CHECK_RANGE_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_RANGE_FAIL_SHIFT)) & FMUTEST_CMD_CHECK_RANGE_FAIL_MASK) - -#define FMUTEST_CMD_CHECK_SCR_ALIGN_CHK_MASK (0x100U) -#define FMUTEST_CMD_CHECK_SCR_ALIGN_CHK_SHIFT (8U) -/*! SCR_ALIGN_CHK - Sector Alignment Check - * 0b0..No sector alignment check - * 0b1..Sector alignment check - */ -#define FMUTEST_CMD_CHECK_SCR_ALIGN_CHK(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_SCR_ALIGN_CHK_SHIFT)) & FMUTEST_CMD_CHECK_SCR_ALIGN_CHK_MASK) - -#define FMUTEST_CMD_CHECK_OPTION_FAIL_MASK (0x200U) -#define FMUTEST_CMD_CHECK_OPTION_FAIL_SHIFT (9U) -/*! OPTION_FAIL - Option Check Fail - * 0b0..Option check passes for read command or command is not a read command - * 0b1..Option check fails for read command - */ -#define FMUTEST_CMD_CHECK_OPTION_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_OPTION_FAIL_SHIFT)) & FMUTEST_CMD_CHECK_OPTION_FAIL_MASK) - -#define FMUTEST_CMD_CHECK_ILLEGAL_CMD_MASK (0x400U) -#define FMUTEST_CMD_CHECK_ILLEGAL_CMD_SHIFT (10U) -/*! ILLEGAL_CMD - Illegal Command - * 0b0..Command is legal - * 0b1..Command is illegal - */ -#define FMUTEST_CMD_CHECK_ILLEGAL_CMD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ILLEGAL_CMD_SHIFT)) & FMUTEST_CMD_CHECK_ILLEGAL_CMD_MASK) -/*! @} */ - -/*! @name BSEL - FMU Block Select Register */ -/*! @{ */ - -#define FMUTEST_BSEL_SBSEL_MASK (0x3U) -#define FMUTEST_BSEL_SBSEL_SHIFT (0U) -/*! SBSEL - Slave Block Select */ -#define FMUTEST_BSEL_SBSEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BSEL_SBSEL_SHIFT)) & FMUTEST_BSEL_SBSEL_MASK) - -#define FMUTEST_BSEL_MBSEL_MASK (0x300U) -#define FMUTEST_BSEL_MBSEL_SHIFT (8U) -/*! MBSEL - Master Block Select */ -#define FMUTEST_BSEL_MBSEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BSEL_MBSEL_SHIFT)) & FMUTEST_BSEL_MBSEL_MASK) -/*! @} */ - -/*! @name MSIZE - FMU Memory Size Register */ -/*! @{ */ - -#define FMUTEST_MSIZE_MAXADDR0_MASK (0xFFU) -#define FMUTEST_MSIZE_MAXADDR0_SHIFT (0U) -/*! MAXADDR0 - Size of Flash Block 0 */ -#define FMUTEST_MSIZE_MAXADDR0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MSIZE_MAXADDR0_SHIFT)) & FMUTEST_MSIZE_MAXADDR0_MASK) -/*! @} */ - -/*! @name FLASH_RD_ADD - Flash Read Address Register */ -/*! @{ */ - -#define FMUTEST_FLASH_RD_ADD_FLASH_RD_ADD_MASK (0xFFFFFFFFU) -#define FMUTEST_FLASH_RD_ADD_FLASH_RD_ADD_SHIFT (0U) -/*! FLASH_RD_ADD - Flash Read Address */ -#define FMUTEST_FLASH_RD_ADD_FLASH_RD_ADD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FLASH_RD_ADD_FLASH_RD_ADD_SHIFT)) & FMUTEST_FLASH_RD_ADD_FLASH_RD_ADD_MASK) -/*! @} */ - -/*! @name FLASH_STOP_ADD - Flash Stop Address Register */ -/*! @{ */ - -#define FMUTEST_FLASH_STOP_ADD_FLASH_STOP_ADD_MASK (0xFFFFFFFFU) -#define FMUTEST_FLASH_STOP_ADD_FLASH_STOP_ADD_SHIFT (0U) -/*! FLASH_STOP_ADD - Flash Stop Address */ -#define FMUTEST_FLASH_STOP_ADD_FLASH_STOP_ADD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FLASH_STOP_ADD_FLASH_STOP_ADD_SHIFT)) & FMUTEST_FLASH_STOP_ADD_FLASH_STOP_ADD_MASK) -/*! @} */ - -/*! @name FLASH_RD_CTRL - Flash Read Control Register */ -/*! @{ */ - -#define FMUTEST_FLASH_RD_CTRL_FLASH_RD_MASK (0x1U) -#define FMUTEST_FLASH_RD_CTRL_FLASH_RD_SHIFT (0U) -/*! FLASH_RD - Flash Read Enable - * 0b0..Manual flash read not enabled.(default) - * 0b1..Manual flash read enabled - */ -#define FMUTEST_FLASH_RD_CTRL_FLASH_RD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FLASH_RD_CTRL_FLASH_RD_SHIFT)) & FMUTEST_FLASH_RD_CTRL_FLASH_RD_MASK) - -#define FMUTEST_FLASH_RD_CTRL_WIDE_LOAD_MASK (0x2U) -#define FMUTEST_FLASH_RD_CTRL_WIDE_LOAD_SHIFT (1U) -/*! WIDE_LOAD - Wide Load Enable - * 0b0..Wide load mode disabled (default) - * 0b1..Wide load mode enabled - */ -#define FMUTEST_FLASH_RD_CTRL_WIDE_LOAD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FLASH_RD_CTRL_WIDE_LOAD_SHIFT)) & FMUTEST_FLASH_RD_CTRL_WIDE_LOAD_MASK) - -#define FMUTEST_FLASH_RD_CTRL_SINGLE_RD_MASK (0x4U) -#define FMUTEST_FLASH_RD_CTRL_SINGLE_RD_SHIFT (2U) -/*! SINGLE_RD - Single Flash Read - * 0b0..Normal UINT operation - * 0b1..UINT configured for single cycle reads - */ -#define FMUTEST_FLASH_RD_CTRL_SINGLE_RD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FLASH_RD_CTRL_SINGLE_RD_SHIFT)) & FMUTEST_FLASH_RD_CTRL_SINGLE_RD_MASK) -/*! @} */ - -/*! @name MM_ADDR - Memory Map Address Register */ -/*! @{ */ - -#define FMUTEST_MM_ADDR_MM_ADDR_MASK (0xFFFFFFFFU) -#define FMUTEST_MM_ADDR_MM_ADDR_SHIFT (0U) -/*! MM_ADDR - Memory Map Address */ -#define FMUTEST_MM_ADDR_MM_ADDR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MM_ADDR_MM_ADDR_SHIFT)) & FMUTEST_MM_ADDR_MM_ADDR_MASK) -/*! @} */ - -/*! @name MM_WDATA - Memory Map Write Data Register */ -/*! @{ */ - -#define FMUTEST_MM_WDATA_MM_WDATA_MASK (0xFFFFFFFFU) -#define FMUTEST_MM_WDATA_MM_WDATA_SHIFT (0U) -/*! MM_WDATA - Memory Map Write Data */ -#define FMUTEST_MM_WDATA_MM_WDATA(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MM_WDATA_MM_WDATA_SHIFT)) & FMUTEST_MM_WDATA_MM_WDATA_MASK) -/*! @} */ - -/*! @name MM_CTL - Memory Map Control Register */ -/*! @{ */ - -#define FMUTEST_MM_CTL_MM_SEL_MASK (0x1U) -#define FMUTEST_MM_CTL_MM_SEL_SHIFT (0U) -/*! MM_SEL - Register Access Enable */ -#define FMUTEST_MM_CTL_MM_SEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MM_CTL_MM_SEL_SHIFT)) & FMUTEST_MM_CTL_MM_SEL_MASK) - -#define FMUTEST_MM_CTL_MM_RD_MASK (0x2U) -#define FMUTEST_MM_CTL_MM_RD_SHIFT (1U) -/*! MM_RD - Register R/W Control - * 0b0..Write to register - * 0b1..Read register - */ -#define FMUTEST_MM_CTL_MM_RD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MM_CTL_MM_RD_SHIFT)) & FMUTEST_MM_CTL_MM_RD_MASK) - -#define FMUTEST_MM_CTL_BIST_ON_MASK (0x4U) -#define FMUTEST_MM_CTL_BIST_ON_SHIFT (2U) -/*! BIST_ON - BIST on - * 0b0..BIST enable not forced by user interface - * 0b1..BIST enable control by user interface - */ -#define FMUTEST_MM_CTL_BIST_ON(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MM_CTL_BIST_ON_SHIFT)) & FMUTEST_MM_CTL_BIST_ON_MASK) - -#define FMUTEST_MM_CTL_FORCE_SW_CLK_MASK (0x8U) -#define FMUTEST_MM_CTL_FORCE_SW_CLK_SHIFT (3U) -/*! FORCE_SW_CLK - Force Switch Clock - * 0b0..Switch clock not forced on (gated normally) - * 0b1..Switch clock forced on - */ -#define FMUTEST_MM_CTL_FORCE_SW_CLK(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MM_CTL_FORCE_SW_CLK_SHIFT)) & FMUTEST_MM_CTL_FORCE_SW_CLK_MASK) -/*! @} */ - -/*! @name UINT_CTL - User Interface Control Register */ -/*! @{ */ - -#define FMUTEST_UINT_CTL_SET_FAIL_MASK (0x1U) -#define FMUTEST_UINT_CTL_SET_FAIL_SHIFT (0U) -/*! SET_FAIL - Set Fail On Exit - * 0b0..FAIL flag should not be set on command exit (no failure detected) - * 0b1..FAIL flag should be set on command exit - */ -#define FMUTEST_UINT_CTL_SET_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_UINT_CTL_SET_FAIL_SHIFT)) & FMUTEST_UINT_CTL_SET_FAIL_MASK) - -#define FMUTEST_UINT_CTL_DBERR_MASK (0x2U) -#define FMUTEST_UINT_CTL_DBERR_SHIFT (1U) -/*! DBERR - Double-Bit ECC Fault Detect - * 0b0..No double-bit fault detected during UINT-driven read sequence - * 0b1..Double-bit fault detected during UINT-driven read sequence - */ -#define FMUTEST_UINT_CTL_DBERR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_UINT_CTL_DBERR_SHIFT)) & FMUTEST_UINT_CTL_DBERR_MASK) -/*! @} */ - -/*! @name RD_DATA0 - Read Data 0 Register */ -/*! @{ */ - -#define FMUTEST_RD_DATA0_RD_DATA0_MASK (0xFFFFFFFFU) -#define FMUTEST_RD_DATA0_RD_DATA0_SHIFT (0U) -/*! RD_DATA0 - Read Data 0 */ -#define FMUTEST_RD_DATA0_RD_DATA0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_DATA0_RD_DATA0_SHIFT)) & FMUTEST_RD_DATA0_RD_DATA0_MASK) -/*! @} */ - -/*! @name RD_DATA1 - Read Data 1 Register */ -/*! @{ */ - -#define FMUTEST_RD_DATA1_RD_DATA1_MASK (0xFFFFFFFFU) -#define FMUTEST_RD_DATA1_RD_DATA1_SHIFT (0U) -/*! RD_DATA1 - Read Data 1 */ -#define FMUTEST_RD_DATA1_RD_DATA1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_DATA1_RD_DATA1_SHIFT)) & FMUTEST_RD_DATA1_RD_DATA1_MASK) -/*! @} */ - -/*! @name RD_DATA2 - Read Data 2 Register */ -/*! @{ */ - -#define FMUTEST_RD_DATA2_RD_DATA2_MASK (0xFFFFFFFFU) -#define FMUTEST_RD_DATA2_RD_DATA2_SHIFT (0U) -/*! RD_DATA2 - Read Data 2 */ -#define FMUTEST_RD_DATA2_RD_DATA2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_DATA2_RD_DATA2_SHIFT)) & FMUTEST_RD_DATA2_RD_DATA2_MASK) -/*! @} */ - -/*! @name RD_DATA3 - Read Data 3 Register */ -/*! @{ */ - -#define FMUTEST_RD_DATA3_RD_DATA3_MASK (0xFFFFFFFFU) -#define FMUTEST_RD_DATA3_RD_DATA3_SHIFT (0U) -/*! RD_DATA3 - Read Data 3 */ -#define FMUTEST_RD_DATA3_RD_DATA3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_DATA3_RD_DATA3_SHIFT)) & FMUTEST_RD_DATA3_RD_DATA3_MASK) -/*! @} */ - -/*! @name PARITY - Parity Register */ -/*! @{ */ - -#define FMUTEST_PARITY_PARITY_MASK (0x1FFU) -#define FMUTEST_PARITY_PARITY_SHIFT (0U) -/*! PARITY - Read data [136:128] */ -#define FMUTEST_PARITY_PARITY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PARITY_PARITY_SHIFT)) & FMUTEST_PARITY_PARITY_MASK) -/*! @} */ - -/*! @name RD_PATH_CTRL_STATUS - Read Path Control and Status Register */ -/*! @{ */ - -#define FMUTEST_RD_PATH_CTRL_STATUS_RD_CAPT_MASK (0xFFU) -#define FMUTEST_RD_PATH_CTRL_STATUS_RD_CAPT_SHIFT (0U) -/*! RD_CAPT - Read Capture Clock Periods */ -#define FMUTEST_RD_PATH_CTRL_STATUS_RD_CAPT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_RD_CAPT_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_RD_CAPT_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_SE_SIZE_MASK (0xFF00U) -#define FMUTEST_RD_PATH_CTRL_STATUS_SE_SIZE_SHIFT (8U) -/*! SE_SIZE - SE Clock Periods */ -#define FMUTEST_RD_PATH_CTRL_STATUS_SE_SIZE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_SE_SIZE_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_SE_SIZE_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_ECC_ENABLEB_MASK (0x10000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_ECC_ENABLEB_SHIFT (16U) -/*! ECC_ENABLEB - ECC Decoder Control - * 0b0..ECC decoder enabled (default) - * 0b1..ECC decoder disabled - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_ECC_ENABLEB(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_ECC_ENABLEB_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_ECC_ENABLEB_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_MISR_EN_MASK (0x20000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_MISR_EN_SHIFT (17U) -/*! MISR_EN - MISR Enable - * 0b0..MISR option disabled (default) - * 0b1..MISR option enabled - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_MISR_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_MISR_EN_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_MISR_EN_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_CPY_PAR_EN_MASK (0x40000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_CPY_PAR_EN_SHIFT (18U) -/*! CPY_PAR_EN - Copy Parity Enable - * 0b0..Copy parity disabled - * 0b1..Copy parity enabled - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_CPY_PAR_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_CPY_PAR_EN_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_CPY_PAR_EN_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_BIST_MUX_TO_SMW_MASK (0x80000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_BIST_MUX_TO_SMW_SHIFT (19U) -/*! BIST_MUX_TO_SMW - BIST Mux to SMW - * 0b0..BIST drives fields - * 0b1..SMW registers drive fields - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_BIST_MUX_TO_SMW(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_BIST_MUX_TO_SMW_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_BIST_MUX_TO_SMW_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_AD_SET_MASK (0xF00000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_AD_SET_SHIFT (20U) -/*! AD_SET - Multi-Cycle Address Setup Time */ -#define FMUTEST_RD_PATH_CTRL_STATUS_AD_SET(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_AD_SET_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_AD_SET_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_EN_MASK (0x1000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_EN_SHIFT (24U) -/*! WR_PATH_EN - Write Path Enable - * 0b0..Writes to BIST setting registers driven by MM_WDATA - * 0b1..Writes to BIST setting registers driven by SMW_DIN - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_EN_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_EN_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_ECC_EN_MASK (0x2000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_ECC_EN_SHIFT (25U) -/*! WR_PATH_ECC_EN - Write Path ECC Enable - * 0b0..ECC encoding disabled - * 0b1..ECC encoding enabled - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_ECC_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_ECC_EN_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_ECC_EN_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_DBERR_REG_MASK (0x4000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_DBERR_REG_SHIFT (26U) -/*! DBERR_REG - Double-Bit Error - * 0b0..Double-bit fault not detected - * 0b1..Double-bit fault detected on previous UINT flash read - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_DBERR_REG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_DBERR_REG_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_DBERR_REG_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_SBERR_REG_MASK (0x8000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_SBERR_REG_SHIFT (27U) -/*! SBERR_REG - Single-Bit Error - * 0b0..Single-bit fault not detected - * 0b1..Single-bit fault detected on previous UINT flash read - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_SBERR_REG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_SBERR_REG_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_SBERR_REG_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_CPY_PHRASE_EN_MASK (0x10000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_CPY_PHRASE_EN_SHIFT (28U) -/*! CPY_PHRASE_EN - Copy Phrase Enable - * 0b0..Copy Flash read data disabled - * 0b1..Copy Flash read data enabled - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_CPY_PHRASE_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_CPY_PHRASE_EN_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_CPY_PHRASE_EN_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_SMW_ARRAY1_SMW0_SEL_MASK (0x20000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_SMW_ARRAY1_SMW0_SEL_SHIFT (29U) -/*! SMW_ARRAY1_SMW0_SEL - SMW_ARRAY1_SMW0_SEL - * 0b0..Select block 0 - * 0b1..Select block 1 - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_SMW_ARRAY1_SMW0_SEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_SMW_ARRAY1_SMW0_SEL_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_SMW_ARRAY1_SMW0_SEL_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_BIST_ECC_EN_MASK (0x40000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_BIST_ECC_EN_SHIFT (30U) -/*! BIST_ECC_EN - BIST ECC Enable - * 0b0..ECC correction disabled - * 0b1..ECC correction enabled - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_BIST_ECC_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_BIST_ECC_EN_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_BIST_ECC_EN_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_LAST_READ_MASK (0x80000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_LAST_READ_SHIFT (31U) -/*! LAST_READ - Last Read - * 0b0..Latest read not last in multi-address operation - * 0b1..Latest read last in multi-address operation - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_LAST_READ(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_LAST_READ_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_LAST_READ_MASK) -/*! @} */ - -/*! @name SMW_DIN0 - SMW DIN 0 Register */ -/*! @{ */ - -#define FMUTEST_SMW_DIN0_SMW_DIN0_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_DIN0_SMW_DIN0_SHIFT (0U) -/*! SMW_DIN0 - SMW DIN 0 */ -#define FMUTEST_SMW_DIN0_SMW_DIN0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_DIN0_SMW_DIN0_SHIFT)) & FMUTEST_SMW_DIN0_SMW_DIN0_MASK) -/*! @} */ - -/*! @name SMW_DIN1 - SMW DIN 1 Register */ -/*! @{ */ - -#define FMUTEST_SMW_DIN1_SMW_DIN1_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_DIN1_SMW_DIN1_SHIFT (0U) -/*! SMW_DIN1 - SMW DIN 1 */ -#define FMUTEST_SMW_DIN1_SMW_DIN1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_DIN1_SMW_DIN1_SHIFT)) & FMUTEST_SMW_DIN1_SMW_DIN1_MASK) -/*! @} */ - -/*! @name SMW_DIN2 - SMW DIN 2 Register */ -/*! @{ */ - -#define FMUTEST_SMW_DIN2_SMW_DIN2_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_DIN2_SMW_DIN2_SHIFT (0U) -/*! SMW_DIN2 - SMW DIN 2 */ -#define FMUTEST_SMW_DIN2_SMW_DIN2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_DIN2_SMW_DIN2_SHIFT)) & FMUTEST_SMW_DIN2_SMW_DIN2_MASK) -/*! @} */ - -/*! @name SMW_DIN3 - SMW DIN 3 Register */ -/*! @{ */ - -#define FMUTEST_SMW_DIN3_SMW_DIN3_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_DIN3_SMW_DIN3_SHIFT (0U) -/*! SMW_DIN3 - SMW DIN 3 */ -#define FMUTEST_SMW_DIN3_SMW_DIN3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_DIN3_SMW_DIN3_SHIFT)) & FMUTEST_SMW_DIN3_SMW_DIN3_MASK) -/*! @} */ - -/*! @name SMW_ADDR - SMW Address Register */ -/*! @{ */ - -#define FMUTEST_SMW_ADDR_SMW_ADDR_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_ADDR_SMW_ADDR_SHIFT (0U) -/*! SMW_ADDR - SMW Address */ -#define FMUTEST_SMW_ADDR_SMW_ADDR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_ADDR_SMW_ADDR_SHIFT)) & FMUTEST_SMW_ADDR_SMW_ADDR_MASK) -/*! @} */ - -/*! @name SMW_CMD_WAIT - SMW Command and Wait Register */ -/*! @{ */ - -#define FMUTEST_SMW_CMD_WAIT_CMD_MASK (0x7U) -#define FMUTEST_SMW_CMD_WAIT_CMD_SHIFT (0U) -/*! CMD - SMW Command - * 0b000..IDLE - * 0b001..ABORT - * 0b010..SME2 to one-shot mass erase - * 0b011..SME3 to sector erase on selected array - * 0b100..SMP1 to program phrase or page on selected array with shot disabled on previously programmed bit - * 0b101..Reserved for SME4 (multi-sector erase) - * 0b110..SMP2 to program phrase or page on selected array to repair cells of weak program after power loss - * 0b111..Reserved - */ -#define FMUTEST_SMW_CMD_WAIT_CMD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_CMD_WAIT_CMD_SHIFT)) & FMUTEST_SMW_CMD_WAIT_CMD_MASK) - -#define FMUTEST_SMW_CMD_WAIT_WAIT_EN_MASK (0x8U) -#define FMUTEST_SMW_CMD_WAIT_WAIT_EN_SHIFT (3U) -/*! WAIT_EN - SMW Wait Enable - * 0b0..Wait feature disabled - * 0b1..Wait feature enabled - */ -#define FMUTEST_SMW_CMD_WAIT_WAIT_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_CMD_WAIT_WAIT_EN_SHIFT)) & FMUTEST_SMW_CMD_WAIT_WAIT_EN_MASK) - -#define FMUTEST_SMW_CMD_WAIT_WAIT_AUTO_SET_MASK (0x10U) -#define FMUTEST_SMW_CMD_WAIT_WAIT_AUTO_SET_SHIFT (4U) -/*! WAIT_AUTO_SET - SMW Wait Auto Set */ -#define FMUTEST_SMW_CMD_WAIT_WAIT_AUTO_SET(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_CMD_WAIT_WAIT_AUTO_SET_SHIFT)) & FMUTEST_SMW_CMD_WAIT_WAIT_AUTO_SET_MASK) -/*! @} */ - -/*! @name SMW_STATUS - SMW Status Register */ -/*! @{ */ - -#define FMUTEST_SMW_STATUS_SMW_ERR_MASK (0x1U) -#define FMUTEST_SMW_STATUS_SMW_ERR_SHIFT (0U) -/*! SMW_ERR - SMW Error - * 0b0..Error not detected - * 0b1..Error detected - */ -#define FMUTEST_SMW_STATUS_SMW_ERR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_STATUS_SMW_ERR_SHIFT)) & FMUTEST_SMW_STATUS_SMW_ERR_MASK) - -#define FMUTEST_SMW_STATUS_SMW_BUSY_MASK (0x2U) -#define FMUTEST_SMW_STATUS_SMW_BUSY_SHIFT (1U) -/*! SMW_BUSY - SMW Busy - * 0b0..SMW command not active - * 0b1..SMW command is active - */ -#define FMUTEST_SMW_STATUS_SMW_BUSY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_STATUS_SMW_BUSY_SHIFT)) & FMUTEST_SMW_STATUS_SMW_BUSY_MASK) - -#define FMUTEST_SMW_STATUS_BIST_BUSY_MASK (0x4U) -#define FMUTEST_SMW_STATUS_BIST_BUSY_SHIFT (2U) -/*! BIST_BUSY - BIST Busy - * 0b0..BIST Command not active - * 0b1..BIST Command is active - */ -#define FMUTEST_SMW_STATUS_BIST_BUSY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_STATUS_BIST_BUSY_SHIFT)) & FMUTEST_SMW_STATUS_BIST_BUSY_MASK) -/*! @} */ - -/*! @name SOCTRIM0_0 - SoC Trim Phrase 0 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM0_0_TRIM0_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM0_0_TRIM0_0_SHIFT (0U) -/*! TRIM0_0 - TRIM0_0 */ -#define FMUTEST_SOCTRIM0_0_TRIM0_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM0_0_TRIM0_0_SHIFT)) & FMUTEST_SOCTRIM0_0_TRIM0_0_MASK) -/*! @} */ - -/*! @name SOCTRIM0_1 - SoC Trim Phrase 0 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM0_1_TRIM0_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM0_1_TRIM0_1_SHIFT (0U) -/*! TRIM0_1 - TRIM0_1 */ -#define FMUTEST_SOCTRIM0_1_TRIM0_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM0_1_TRIM0_1_SHIFT)) & FMUTEST_SOCTRIM0_1_TRIM0_1_MASK) -/*! @} */ - -/*! @name SOCTRIM0_2 - SoC Trim Phrase 0 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM0_2_TRIM0_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM0_2_TRIM0_2_SHIFT (0U) -/*! TRIM0_2 - TRIM0_2 */ -#define FMUTEST_SOCTRIM0_2_TRIM0_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM0_2_TRIM0_2_SHIFT)) & FMUTEST_SOCTRIM0_2_TRIM0_2_MASK) -/*! @} */ - -/*! @name SOCTRIM0_3 - SoC Trim Phrase 0 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM0_3_TRIM0_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM0_3_TRIM0_3_SHIFT (0U) -/*! TRIM0_3 - TRIM0_3 */ -#define FMUTEST_SOCTRIM0_3_TRIM0_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM0_3_TRIM0_3_SHIFT)) & FMUTEST_SOCTRIM0_3_TRIM0_3_MASK) -/*! @} */ - -/*! @name SOCTRIM1_0 - SoC Trim Phrase 1 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM1_0_TRIM1_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM1_0_TRIM1_0_SHIFT (0U) -/*! TRIM1_0 - TRIM1_0 */ -#define FMUTEST_SOCTRIM1_0_TRIM1_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM1_0_TRIM1_0_SHIFT)) & FMUTEST_SOCTRIM1_0_TRIM1_0_MASK) -/*! @} */ - -/*! @name SOCTRIM1_1 - SoC Trim Phrase 1 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM1_1_TRIM1_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM1_1_TRIM1_1_SHIFT (0U) -/*! TRIM1_1 - TRIM1_1 */ -#define FMUTEST_SOCTRIM1_1_TRIM1_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM1_1_TRIM1_1_SHIFT)) & FMUTEST_SOCTRIM1_1_TRIM1_1_MASK) -/*! @} */ - -/*! @name SOCTRIM1_2 - SoC Trim Phrase 1 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM1_2_TRIM1_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM1_2_TRIM1_2_SHIFT (0U) -/*! TRIM1_2 - TRIM1_2 */ -#define FMUTEST_SOCTRIM1_2_TRIM1_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM1_2_TRIM1_2_SHIFT)) & FMUTEST_SOCTRIM1_2_TRIM1_2_MASK) -/*! @} */ - -/*! @name SOCTRIM1_3 - SoC Trim Phrase 1 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM1_3_TRIM1_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM1_3_TRIM1_3_SHIFT (0U) -/*! TRIM1_3 - TRIM1_3 */ -#define FMUTEST_SOCTRIM1_3_TRIM1_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM1_3_TRIM1_3_SHIFT)) & FMUTEST_SOCTRIM1_3_TRIM1_3_MASK) -/*! @} */ - -/*! @name SOCTRIM2_0 - SoC Trim Phrase 2 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM2_0_TRIM2_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM2_0_TRIM2_0_SHIFT (0U) -/*! TRIM2_0 - TRIM2_0 */ -#define FMUTEST_SOCTRIM2_0_TRIM2_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM2_0_TRIM2_0_SHIFT)) & FMUTEST_SOCTRIM2_0_TRIM2_0_MASK) -/*! @} */ - -/*! @name SOCTRIM2_1 - SoC Trim Phrase 2 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM2_1_TRIM2_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM2_1_TRIM2_1_SHIFT (0U) -/*! TRIM2_1 - TRIM2_1 */ -#define FMUTEST_SOCTRIM2_1_TRIM2_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM2_1_TRIM2_1_SHIFT)) & FMUTEST_SOCTRIM2_1_TRIM2_1_MASK) -/*! @} */ - -/*! @name SOCTRIM2_2 - SoC Trim Phrase 2 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM2_2_TRIM2_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM2_2_TRIM2_2_SHIFT (0U) -/*! TRIM2_2 - TRIM2_2 */ -#define FMUTEST_SOCTRIM2_2_TRIM2_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM2_2_TRIM2_2_SHIFT)) & FMUTEST_SOCTRIM2_2_TRIM2_2_MASK) -/*! @} */ - -/*! @name SOCTRIM2_3 - SoC Trim Phrase 2 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM2_3_TRIM2_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM2_3_TRIM2_3_SHIFT (0U) -/*! TRIM2_3 - TRIM2_3 */ -#define FMUTEST_SOCTRIM2_3_TRIM2_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM2_3_TRIM2_3_SHIFT)) & FMUTEST_SOCTRIM2_3_TRIM2_3_MASK) -/*! @} */ - -/*! @name SOCTRIM3_0 - SoC Trim Phrase 3 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM3_0_TRIM3_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM3_0_TRIM3_0_SHIFT (0U) -/*! TRIM3_0 - TRIM3_0 */ -#define FMUTEST_SOCTRIM3_0_TRIM3_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM3_0_TRIM3_0_SHIFT)) & FMUTEST_SOCTRIM3_0_TRIM3_0_MASK) -/*! @} */ - -/*! @name SOCTRIM3_1 - SoC Trim Phrase 3 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM3_1_TRIM3_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM3_1_TRIM3_1_SHIFT (0U) -/*! TRIM3_1 - TRIM3_1 */ -#define FMUTEST_SOCTRIM3_1_TRIM3_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM3_1_TRIM3_1_SHIFT)) & FMUTEST_SOCTRIM3_1_TRIM3_1_MASK) -/*! @} */ - -/*! @name SOCTRIM3_2 - SoC Trim Phrase 3 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM3_2_TRIM3_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM3_2_TRIM3_2_SHIFT (0U) -/*! TRIM3_2 - TRIM3_2 */ -#define FMUTEST_SOCTRIM3_2_TRIM3_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM3_2_TRIM3_2_SHIFT)) & FMUTEST_SOCTRIM3_2_TRIM3_2_MASK) -/*! @} */ - -/*! @name SOCTRIM3_3 - SoC Trim Phrase 3 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM3_3_TRIM3_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM3_3_TRIM3_3_SHIFT (0U) -/*! TRIM3_3 - TRIM3_3 */ -#define FMUTEST_SOCTRIM3_3_TRIM3_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM3_3_TRIM3_3_SHIFT)) & FMUTEST_SOCTRIM3_3_TRIM3_3_MASK) -/*! @} */ - -/*! @name SOCTRIM4_0 - SoC Trim Phrase 4 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM4_0_TRIM4_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM4_0_TRIM4_0_SHIFT (0U) -/*! TRIM4_0 - TRIM4_0 */ -#define FMUTEST_SOCTRIM4_0_TRIM4_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM4_0_TRIM4_0_SHIFT)) & FMUTEST_SOCTRIM4_0_TRIM4_0_MASK) -/*! @} */ - -/*! @name SOCTRIM4_1 - SoC Trim Phrase 4 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM4_1_TRIM4_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM4_1_TRIM4_1_SHIFT (0U) -/*! TRIM4_1 - TRIM4_1 */ -#define FMUTEST_SOCTRIM4_1_TRIM4_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM4_1_TRIM4_1_SHIFT)) & FMUTEST_SOCTRIM4_1_TRIM4_1_MASK) -/*! @} */ - -/*! @name SOCTRIM4_2 - SoC Trim Phrase 4 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM4_2_TRIM4_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM4_2_TRIM4_2_SHIFT (0U) -/*! TRIM4_2 - TRIM4_2 */ -#define FMUTEST_SOCTRIM4_2_TRIM4_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM4_2_TRIM4_2_SHIFT)) & FMUTEST_SOCTRIM4_2_TRIM4_2_MASK) -/*! @} */ - -/*! @name SOCTRIM4_3 - SoC Trim Phrase 4 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM4_3_TRIM4_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM4_3_TRIM4_3_SHIFT (0U) -/*! TRIM4_3 - TRIM4_3 */ -#define FMUTEST_SOCTRIM4_3_TRIM4_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM4_3_TRIM4_3_SHIFT)) & FMUTEST_SOCTRIM4_3_TRIM4_3_MASK) -/*! @} */ - -/*! @name SOCTRIM5_0 - SoC Trim Phrase 5 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM5_0_TRIM5_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM5_0_TRIM5_0_SHIFT (0U) -/*! TRIM5_0 - TRIM5_0 */ -#define FMUTEST_SOCTRIM5_0_TRIM5_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM5_0_TRIM5_0_SHIFT)) & FMUTEST_SOCTRIM5_0_TRIM5_0_MASK) -/*! @} */ - -/*! @name SOCTRIM5_1 - SoC Trim Phrase 5 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM5_1_TRIM5_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM5_1_TRIM5_1_SHIFT (0U) -/*! TRIM5_1 - TRIM5_1 */ -#define FMUTEST_SOCTRIM5_1_TRIM5_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM5_1_TRIM5_1_SHIFT)) & FMUTEST_SOCTRIM5_1_TRIM5_1_MASK) -/*! @} */ - -/*! @name SOCTRIM5_2 - SoC Trim Phrase 5 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM5_2_TRIM5_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM5_2_TRIM5_2_SHIFT (0U) -/*! TRIM5_2 - TRIM5_2 */ -#define FMUTEST_SOCTRIM5_2_TRIM5_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM5_2_TRIM5_2_SHIFT)) & FMUTEST_SOCTRIM5_2_TRIM5_2_MASK) -/*! @} */ - -/*! @name SOCTRIM5_3 - SoC Trim Phrase 5 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM5_3_TRIM5_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM5_3_TRIM5_3_SHIFT (0U) -/*! TRIM5_3 - TRIM5_3 */ -#define FMUTEST_SOCTRIM5_3_TRIM5_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM5_3_TRIM5_3_SHIFT)) & FMUTEST_SOCTRIM5_3_TRIM5_3_MASK) -/*! @} */ - -/*! @name SOCTRIM6_0 - SoC Trim Phrase 6 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM6_0_TRIM6_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM6_0_TRIM6_0_SHIFT (0U) -/*! TRIM6_0 - TRIM6_0 */ -#define FMUTEST_SOCTRIM6_0_TRIM6_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM6_0_TRIM6_0_SHIFT)) & FMUTEST_SOCTRIM6_0_TRIM6_0_MASK) -/*! @} */ - -/*! @name SOCTRIM6_1 - SoC Trim Phrase 6 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM6_1_TRIM6_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM6_1_TRIM6_1_SHIFT (0U) -/*! TRIM6_1 - TRIM6_1 */ -#define FMUTEST_SOCTRIM6_1_TRIM6_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM6_1_TRIM6_1_SHIFT)) & FMUTEST_SOCTRIM6_1_TRIM6_1_MASK) -/*! @} */ - -/*! @name SOCTRIM6_2 - SoC Trim Phrase 6 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM6_2_TRIM6_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM6_2_TRIM6_2_SHIFT (0U) -/*! TRIM6_2 - TRIM6_2 */ -#define FMUTEST_SOCTRIM6_2_TRIM6_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM6_2_TRIM6_2_SHIFT)) & FMUTEST_SOCTRIM6_2_TRIM6_2_MASK) -/*! @} */ - -/*! @name SOCTRIM6_3 - SoC Trim Phrase 6 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM6_3_TRIM6_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM6_3_TRIM6_3_SHIFT (0U) -/*! TRIM6_3 - TRIM6_3 */ -#define FMUTEST_SOCTRIM6_3_TRIM6_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM6_3_TRIM6_3_SHIFT)) & FMUTEST_SOCTRIM6_3_TRIM6_3_MASK) -/*! @} */ - -/*! @name SOCTRIM7_0 - SoC Trim Phrase 7 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM7_0_TRIM7_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM7_0_TRIM7_0_SHIFT (0U) -/*! TRIM7_0 - TRIM7_0 */ -#define FMUTEST_SOCTRIM7_0_TRIM7_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM7_0_TRIM7_0_SHIFT)) & FMUTEST_SOCTRIM7_0_TRIM7_0_MASK) -/*! @} */ - -/*! @name SOCTRIM7_1 - SoC Trim Phrase 7 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM7_1_TRIM7_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM7_1_TRIM7_1_SHIFT (0U) -/*! TRIM7_1 - TRIM7_1 */ -#define FMUTEST_SOCTRIM7_1_TRIM7_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM7_1_TRIM7_1_SHIFT)) & FMUTEST_SOCTRIM7_1_TRIM7_1_MASK) -/*! @} */ - -/*! @name SOCTRIM7_2 - SoC Trim Phrase 7 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM7_2_TRIM7_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM7_2_TRIM7_2_SHIFT (0U) -/*! TRIM7_2 - TRIM7_2 */ -#define FMUTEST_SOCTRIM7_2_TRIM7_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM7_2_TRIM7_2_SHIFT)) & FMUTEST_SOCTRIM7_2_TRIM7_2_MASK) -/*! @} */ - -/*! @name SOCTRIM7_3 - SoC Trim Phrase 7 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM7_3_TRIM7_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM7_3_TRIM7_3_SHIFT (0U) -/*! TRIM7_3 - TRIM7_3 */ -#define FMUTEST_SOCTRIM7_3_TRIM7_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM7_3_TRIM7_3_SHIFT)) & FMUTEST_SOCTRIM7_3_TRIM7_3_MASK) -/*! @} */ - -/*! @name R_IP_CONFIG - BIST Configuration Register */ -/*! @{ */ - -#define FMUTEST_R_IP_CONFIG_IPSEL0_MASK (0x3U) -#define FMUTEST_R_IP_CONFIG_IPSEL0_SHIFT (0U) -/*! IPSEL0 - Block 0 Select Control - * 0b00..Unselect block 0 - * 0b01..not used, reserved - * 0b10..Enable block 0 test, repair off (default) - * 0b11..Enable block 0 test, repair on - */ -#define FMUTEST_R_IP_CONFIG_IPSEL0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_IPSEL0_SHIFT)) & FMUTEST_R_IP_CONFIG_IPSEL0_MASK) - -#define FMUTEST_R_IP_CONFIG_IPSEL1_MASK (0xCU) -#define FMUTEST_R_IP_CONFIG_IPSEL1_SHIFT (2U) -/*! IPSEL1 - Block 1 Select Control - * 0b00..Unselect block 1 - * 0b01..not used, reserved - * 0b10..Enable block 1 test, repair off (default) - * 0b11..Enable block 1 test, repair on - */ -#define FMUTEST_R_IP_CONFIG_IPSEL1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_IPSEL1_SHIFT)) & FMUTEST_R_IP_CONFIG_IPSEL1_MASK) - -#define FMUTEST_R_IP_CONFIG_BIST_CDIVL_MASK (0xFF0U) -#define FMUTEST_R_IP_CONFIG_BIST_CDIVL_SHIFT (4U) -/*! BIST_CDIVL - Clock Divide Scalar for Long Pulse */ -#define FMUTEST_R_IP_CONFIG_BIST_CDIVL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_BIST_CDIVL_SHIFT)) & FMUTEST_R_IP_CONFIG_BIST_CDIVL_MASK) - -#define FMUTEST_R_IP_CONFIG_CDIVS_MASK (0x7000U) -#define FMUTEST_R_IP_CONFIG_CDIVS_SHIFT (12U) -/*! CDIVS - Number of clock cycles to generate short pulse */ -#define FMUTEST_R_IP_CONFIG_CDIVS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_CDIVS_SHIFT)) & FMUTEST_R_IP_CONFIG_CDIVS_MASK) - -#define FMUTEST_R_IP_CONFIG_BIST_TVFY_MASK (0xF8000U) -#define FMUTEST_R_IP_CONFIG_BIST_TVFY_SHIFT (15U) -/*! BIST_TVFY - Timer adjust for verify */ -#define FMUTEST_R_IP_CONFIG_BIST_TVFY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_BIST_TVFY_SHIFT)) & FMUTEST_R_IP_CONFIG_BIST_TVFY_MASK) - -#define FMUTEST_R_IP_CONFIG_TSTCTL_MASK (0x300000U) -#define FMUTEST_R_IP_CONFIG_TSTCTL_SHIFT (20U) -/*! TSTCTL - BIST self-test control - * 0b00..Default, disable both BIST self-test and MISR - * 0b01..Enable BIST self-test mode DOUT from macro will be forced to '0', and disable MISR. - * 0b10..Enable MISR - * 0b11..Enable both BIST self-test mode and MISR - */ -#define FMUTEST_R_IP_CONFIG_TSTCTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_TSTCTL_SHIFT)) & FMUTEST_R_IP_CONFIG_TSTCTL_MASK) - -#define FMUTEST_R_IP_CONFIG_DBGCTL_MASK (0x400000U) -#define FMUTEST_R_IP_CONFIG_DBGCTL_SHIFT (22U) -/*! DBGCTL - Debug feature control - * 0b0..Default - * 0b1..Enable debug feature to collect failure address and data. - */ -#define FMUTEST_R_IP_CONFIG_DBGCTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_DBGCTL_SHIFT)) & FMUTEST_R_IP_CONFIG_DBGCTL_MASK) - -#define FMUTEST_R_IP_CONFIG_BIST_CLK_SEL_MASK (0x800000U) -#define FMUTEST_R_IP_CONFIG_BIST_CLK_SEL_SHIFT (23U) -/*! BIST_CLK_SEL - BIST Clock Select */ -#define FMUTEST_R_IP_CONFIG_BIST_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_BIST_CLK_SEL_SHIFT)) & FMUTEST_R_IP_CONFIG_BIST_CLK_SEL_MASK) - -#define FMUTEST_R_IP_CONFIG_SMWTST_MASK (0x3000000U) -#define FMUTEST_R_IP_CONFIG_SMWTST_SHIFT (24U) -/*! SMWTST - SMWR DOUT Function Control - * 0b00..Default - * 0b01..Enable SMWR self-test mode, DOUT from macro will be forced to all 0 - * 0b10..Enable SMWR self-test mode, DOUT from macro will be forced to all 1 - * 0b11..Reserved (unused) - */ -#define FMUTEST_R_IP_CONFIG_SMWTST(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_SMWTST_SHIFT)) & FMUTEST_R_IP_CONFIG_SMWTST_MASK) - -#define FMUTEST_R_IP_CONFIG_ECCEN_MASK (0x4000000U) -#define FMUTEST_R_IP_CONFIG_ECCEN_SHIFT (26U) -/*! ECCEN - BIST ECC Control - * 0b0..Default mode (no ECC encode or decode) - * 0b1..Enable ECC encode/decode - */ -#define FMUTEST_R_IP_CONFIG_ECCEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_ECCEN_SHIFT)) & FMUTEST_R_IP_CONFIG_ECCEN_MASK) -/*! @} */ - -/*! @name R_TESTCODE - BIST Test Code Register */ -/*! @{ */ - -#define FMUTEST_R_TESTCODE_TESTCODE_MASK (0x3FU) -#define FMUTEST_R_TESTCODE_TESTCODE_SHIFT (0U) -/*! TESTCODE - Used to store test code information before running TMR-RST/TMRSET BIST command */ -#define FMUTEST_R_TESTCODE_TESTCODE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TESTCODE_TESTCODE_SHIFT)) & FMUTEST_R_TESTCODE_TESTCODE_MASK) -/*! @} */ - -/*! @name R_DFT_CTRL - BIST DFT Control Register */ -/*! @{ */ - -#define FMUTEST_R_DFT_CTRL_DFT_XADR_MASK (0xFU) -#define FMUTEST_R_DFT_CTRL_DFT_XADR_SHIFT (0U) -/*! DFT_XADR - DFT XADR Pattern - * 0b0000..XADR fixed, no change at all - * 0b0001..XADR increased by 1 after row. For READ operation, XADR increases by 1 after reading the last word of - * row. For PROG operation, XADR increases by 1 after NVSTR falls. - * 0b0010..XADR increased for diagonal. For PROG-DIAGONAL operation, XADR is increased to create diagonal pattern. - * 0b0011..XADR increased by sector. During ERASE operation, XADR increased by number of rows in a sector when NVSTR falls. - * 0b0100..XADR inversed. XADR is inversed after reading one word or after programming one row when NVSTR falls. - * 0b0101..XADR increased by 2 after row. For READ operation, XADR is increased by 2 after reading the last word - * of a row. For PROG operation, XADR is increased by 2 when NVSTR falls. - * 0b0110..XADR[0] inversed. XADR[0] is inversed after reading one word or after programming one row when NVSTR falls. - * 0b0111..XADR increased by 1. For READ operations only, XADR increased by 1 after each read cycle. - * 0b1000..XADR decreased by 1 after row. For READ operations only, XADR is decreased by 1 after YADR decreases to 0. - * 0b1001..XADR decreased by 1. For READ operations only, XADR is decreased by 1 after each read cycle. - */ -#define FMUTEST_R_DFT_CTRL_DFT_XADR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DFT_CTRL_DFT_XADR_SHIFT)) & FMUTEST_R_DFT_CTRL_DFT_XADR_MASK) - -#define FMUTEST_R_DFT_CTRL_DFT_YADR_MASK (0xF0U) -#define FMUTEST_R_DFT_CTRL_DFT_YADR_SHIFT (4U) -/*! DFT_YADR - DFT YADR Pattern - * 0b0000..YADR fixed, no change at all - * 0b0001..YADR for ICKBD. For PROG and READ operations, YADR changed to generate inverse checkerboard pattern. - * 0b0010..YADR for CKBD. For PROG and READ operations, YADR changed to generate checkerboard pattern. - * 0b0011..YADR increased by 1. For READ operations, YADR increased by 1 after each read cycle. For PROG - * operations, YADR increased by 1 after YE falls. - * 0b0100..YADR increased for diagonal. For PROG-DIAGONAL operation, YADR is increased to create diagonal pattern. - * 0b0101..YADR inversed. YADR is inversed after reading one word or after programming one word when YE falls. - * 0b0110..YADR[0] inversed. YADR[0] is inversed after reading one word or after programming one word when YE falls. - * 0b0111..YADR increased by 1 after last row. For READ operations only, YADR is increased by 1 after XADR reaches last row. - * 0b1000..YADR decreased by 1. For READ operations only, YADR is decreased by 1 after each read cycle. - * 0b1001..YADR decreased by 1 after first row. For READ operations only, YADR is decreased by 1 after XADR decreases to 0. - */ -#define FMUTEST_R_DFT_CTRL_DFT_YADR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DFT_CTRL_DFT_YADR_SHIFT)) & FMUTEST_R_DFT_CTRL_DFT_YADR_MASK) - -#define FMUTEST_R_DFT_CTRL_DFT_DATA_MASK (0xF00U) -#define FMUTEST_R_DFT_CTRL_DFT_DATA_SHIFT (8U) -/*! DFT_DATA - DFT Data Pattern - * 0b0000..CKBD pattern. For READ operations only, compare DOUT with checkerboard data pattern for each read cycle. - * 0b0001..ICKBD pattern. For READ operations only, compare DOUT with inverse checkerboard data pattern for each read cycle. - * 0b0010..Diagonal pattern. Used for READ operations only, compare DOUT to diagonal pattern. - * 0b0011..Fixed data pattern. For READ operations, comparison to DOUT for selected groups; refer to - * R_ADR_CTRL[GRPSEL] for modules with multiple groups. - * 0b0100..Random data pattern which will be generated based on the initial seed set in R_DATA; for READ - * operations, used for DOUT comparison of selected groups. For PROG operations, used to control DIN of selected - * groups. - * 0b0101..DOUT based pattern. For READ operations only, DOUT of selected group will be latched in R_DATA. If - * more than one group is selected in R_ADR_CTRL[GRPSEL], the group with the lower index will be latched. - * 0b0110..R_DATA based pattern. For READ operations, expected DOUT value of selected groups equals to R_DATA - * when XADR[0]==YADR[0] or ~R_DATA when XADR[0]!=YADR[0]. For PROG operations, DIN of selected groups equals - * R_DATA when XADR[0]==YADR[0] or ~R_DATA when XADR[0]!=YADR[0]. - * 0b0111..SCAN-IO pattern. For READ operations, control expected DOUT value of selected groups to SCAN-IO data - * pattern. For PROG operations, control DIN of selected groups to SCAN-IO data pattern. - * 0b1000..REPAIR set. For PROG operation to IFR1(7,1) and IFR1(7,2), R_REPAIR0_0 and R_REPAIR0_1 or R_REPAIR1_0 - * and R_REPAIR1_1 will control DIN. For READ operation on IFR1(7,1) and IFR1(7,2), DOUT will be compared - * against R_REPAIR0_0 and R_REPAIR0_1 or R_REPAIR1_0 andR_REPAIR1_1. When this option is selected, only - * one flash block can be selected. - * 0b1001..REPAIR load. For READ operation only, DOUT from IFR1(7,1) and IFR1(7,2) is loaded to R_REPAIR0 and R_REPAIR1. - */ -#define FMUTEST_R_DFT_CTRL_DFT_DATA(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DFT_CTRL_DFT_DATA_SHIFT)) & FMUTEST_R_DFT_CTRL_DFT_DATA_MASK) - -#define FMUTEST_R_DFT_CTRL_CMP_MASK_MASK (0x3000U) -#define FMUTEST_R_DFT_CTRL_CMP_MASK_SHIFT (12U) -/*! CMP_MASK - Data Compare Mask - * 0b00..Expected data is compared to DOUT - * 0b01..Expected data (only 0s are considered) are compared to DOUT - * 0b10..Expected data (only 1s are considered) are compared to DOUT - */ -#define FMUTEST_R_DFT_CTRL_CMP_MASK(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DFT_CTRL_CMP_MASK_SHIFT)) & FMUTEST_R_DFT_CTRL_CMP_MASK_MASK) - -#define FMUTEST_R_DFT_CTRL_DFT_DATA_SRC_MASK (0x4000U) -#define FMUTEST_R_DFT_CTRL_DFT_DATA_SRC_SHIFT (14U) -/*! DFT_DATA_SRC - DFT Data Source - * 0b0..{R_DATA_CTRL0,R_DATA_CTRL_EX[2:0],R_DATA_CTRL0,R_DATA_CTRL_EX[2:0],R_DATA_CTRL0,R_DATA_CTRL_EX[2:0],R_DATA_CTRL0} is used - * 0b1..{R_DATA_CTRL3,R_DATA_CTRL2_EX[2:0],R_DATA_CTRL2,R_DATA_CTRL1_EX[2:0],R_DATA_CTRL1,R_DATA_CTRL_EX[2:0],R_DATA_CTRL0} is used - */ -#define FMUTEST_R_DFT_CTRL_DFT_DATA_SRC(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DFT_CTRL_DFT_DATA_SRC_SHIFT)) & FMUTEST_R_DFT_CTRL_DFT_DATA_SRC_MASK) -/*! @} */ - -/*! @name R_ADR_CTRL - BIST Address Control Register */ -/*! @{ */ - -#define FMUTEST_R_ADR_CTRL_GRPSEL_MASK (0xFU) -#define FMUTEST_R_ADR_CTRL_GRPSEL_SHIFT (0U) -/*! GRPSEL - Data Group Select - * 0b0000..Select no data - * 0b0001..Select data slice [34:0] - * 0b0010..Select data slice [69:35] - * 0b0100..Select data slice [104:70] - * 0b1000..Select data slice [136:105] - * 0b1111..Select data [136:0] - */ -#define FMUTEST_R_ADR_CTRL_GRPSEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ADR_CTRL_GRPSEL_SHIFT)) & FMUTEST_R_ADR_CTRL_GRPSEL_MASK) - -#define FMUTEST_R_ADR_CTRL_XADR_MASK (0xFFF0U) -#define FMUTEST_R_ADR_CTRL_XADR_SHIFT (4U) -/*! XADR - BIST XADR */ -#define FMUTEST_R_ADR_CTRL_XADR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ADR_CTRL_XADR_SHIFT)) & FMUTEST_R_ADR_CTRL_XADR_MASK) - -#define FMUTEST_R_ADR_CTRL_YADR_MASK (0x1F0000U) -#define FMUTEST_R_ADR_CTRL_YADR_SHIFT (16U) -/*! YADR - BIST YADR */ -#define FMUTEST_R_ADR_CTRL_YADR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ADR_CTRL_YADR_SHIFT)) & FMUTEST_R_ADR_CTRL_YADR_MASK) - -#define FMUTEST_R_ADR_CTRL_PROG_ATTR_MASK (0xE00000U) -#define FMUTEST_R_ADR_CTRL_PROG_ATTR_SHIFT (21U) -/*! PROG_ATTR - Program Attribute - * 0b000..One YE pulse will program one data slice group - * 0b001..One YE pulse will program two data slice groups - * 0b010..One YE pulse will program three data slice groups (reserved) - * 0b011..One YE pulse will program four data slice groups - * 0b100..One YE pulse will program five data slice groups (reserved) - * 0b101..One YE pulse will program six data slice groups (reserved) - * 0b110..One YE pulse will program seven data slice groups (reserved) - * 0b111..One YE pulse will program eight data slice groups (reserved) - */ -#define FMUTEST_R_ADR_CTRL_PROG_ATTR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ADR_CTRL_PROG_ATTR_SHIFT)) & FMUTEST_R_ADR_CTRL_PROG_ATTR_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL0 - BIST Data Control 0 Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL0_DATA0_MASK (0xFFFFFFFFU) -#define FMUTEST_R_DATA_CTRL0_DATA0_SHIFT (0U) -/*! DATA0 - BIST Data 0 Low */ -#define FMUTEST_R_DATA_CTRL0_DATA0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL0_DATA0_SHIFT)) & FMUTEST_R_DATA_CTRL0_DATA0_MASK) -/*! @} */ - -/*! @name R_PIN_CTRL - BIST Pin Control Register */ -/*! @{ */ - -#define FMUTEST_R_PIN_CTRL_MAS1_MASK (0x1U) -#define FMUTEST_R_PIN_CTRL_MAS1_SHIFT (0U) -/*! MAS1 - Mass Erase */ -#define FMUTEST_R_PIN_CTRL_MAS1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_MAS1_SHIFT)) & FMUTEST_R_PIN_CTRL_MAS1_MASK) - -#define FMUTEST_R_PIN_CTRL_IFREN_MASK (0x2U) -#define FMUTEST_R_PIN_CTRL_IFREN_SHIFT (1U) -/*! IFREN - IFR Enable */ -#define FMUTEST_R_PIN_CTRL_IFREN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_IFREN_SHIFT)) & FMUTEST_R_PIN_CTRL_IFREN_MASK) - -#define FMUTEST_R_PIN_CTRL_IFREN1_MASK (0x4U) -#define FMUTEST_R_PIN_CTRL_IFREN1_SHIFT (2U) -/*! IFREN1 - IFR1 Enable */ -#define FMUTEST_R_PIN_CTRL_IFREN1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_IFREN1_SHIFT)) & FMUTEST_R_PIN_CTRL_IFREN1_MASK) - -#define FMUTEST_R_PIN_CTRL_REDEN_MASK (0x8U) -#define FMUTEST_R_PIN_CTRL_REDEN_SHIFT (3U) -/*! REDEN - Redundancy Block Enable */ -#define FMUTEST_R_PIN_CTRL_REDEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_REDEN_SHIFT)) & FMUTEST_R_PIN_CTRL_REDEN_MASK) - -#define FMUTEST_R_PIN_CTRL_LVE_MASK (0x10U) -#define FMUTEST_R_PIN_CTRL_LVE_SHIFT (4U) -/*! LVE - Low Voltage Enable */ -#define FMUTEST_R_PIN_CTRL_LVE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_LVE_SHIFT)) & FMUTEST_R_PIN_CTRL_LVE_MASK) - -#define FMUTEST_R_PIN_CTRL_PV_MASK (0x20U) -#define FMUTEST_R_PIN_CTRL_PV_SHIFT (5U) -/*! PV - Program Verify Enable */ -#define FMUTEST_R_PIN_CTRL_PV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_PV_SHIFT)) & FMUTEST_R_PIN_CTRL_PV_MASK) - -#define FMUTEST_R_PIN_CTRL_EV_MASK (0x40U) -#define FMUTEST_R_PIN_CTRL_EV_SHIFT (6U) -/*! EV - Erase Verify Enable */ -#define FMUTEST_R_PIN_CTRL_EV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_EV_SHIFT)) & FMUTEST_R_PIN_CTRL_EV_MASK) - -#define FMUTEST_R_PIN_CTRL_WIPGM_MASK (0x180U) -#define FMUTEST_R_PIN_CTRL_WIPGM_SHIFT (7U) -/*! WIPGM - Program Current */ -#define FMUTEST_R_PIN_CTRL_WIPGM(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_WIPGM_SHIFT)) & FMUTEST_R_PIN_CTRL_WIPGM_MASK) - -#define FMUTEST_R_PIN_CTRL_WHV_MASK (0x1E00U) -#define FMUTEST_R_PIN_CTRL_WHV_SHIFT (9U) -/*! WHV - High Voltage Level */ -#define FMUTEST_R_PIN_CTRL_WHV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_WHV_SHIFT)) & FMUTEST_R_PIN_CTRL_WHV_MASK) - -#define FMUTEST_R_PIN_CTRL_WMV_MASK (0xE000U) -#define FMUTEST_R_PIN_CTRL_WMV_SHIFT (13U) -/*! WMV - Medium Voltage Level */ -#define FMUTEST_R_PIN_CTRL_WMV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_WMV_SHIFT)) & FMUTEST_R_PIN_CTRL_WMV_MASK) - -#define FMUTEST_R_PIN_CTRL_XE_MASK (0x10000U) -#define FMUTEST_R_PIN_CTRL_XE_SHIFT (16U) -/*! XE - X Address Enable */ -#define FMUTEST_R_PIN_CTRL_XE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_XE_SHIFT)) & FMUTEST_R_PIN_CTRL_XE_MASK) - -#define FMUTEST_R_PIN_CTRL_YE_MASK (0x20000U) -#define FMUTEST_R_PIN_CTRL_YE_SHIFT (17U) -/*! YE - Y Address Enable */ -#define FMUTEST_R_PIN_CTRL_YE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_YE_SHIFT)) & FMUTEST_R_PIN_CTRL_YE_MASK) - -#define FMUTEST_R_PIN_CTRL_SE_MASK (0x40000U) -#define FMUTEST_R_PIN_CTRL_SE_SHIFT (18U) -/*! SE - Sense Amp Enable */ -#define FMUTEST_R_PIN_CTRL_SE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_SE_SHIFT)) & FMUTEST_R_PIN_CTRL_SE_MASK) - -#define FMUTEST_R_PIN_CTRL_ERASE_MASK (0x80000U) -#define FMUTEST_R_PIN_CTRL_ERASE_SHIFT (19U) -/*! ERASE - Erase Mode */ -#define FMUTEST_R_PIN_CTRL_ERASE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_ERASE_SHIFT)) & FMUTEST_R_PIN_CTRL_ERASE_MASK) - -#define FMUTEST_R_PIN_CTRL_PROG_MASK (0x100000U) -#define FMUTEST_R_PIN_CTRL_PROG_SHIFT (20U) -/*! PROG - Program Mode */ -#define FMUTEST_R_PIN_CTRL_PROG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_PROG_SHIFT)) & FMUTEST_R_PIN_CTRL_PROG_MASK) - -#define FMUTEST_R_PIN_CTRL_NVSTR_MASK (0x200000U) -#define FMUTEST_R_PIN_CTRL_NVSTR_SHIFT (21U) -/*! NVSTR - NVM Store */ -#define FMUTEST_R_PIN_CTRL_NVSTR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_NVSTR_SHIFT)) & FMUTEST_R_PIN_CTRL_NVSTR_MASK) - -#define FMUTEST_R_PIN_CTRL_SLM_MASK (0x400000U) -#define FMUTEST_R_PIN_CTRL_SLM_SHIFT (22U) -/*! SLM - Sleep Mode Enable */ -#define FMUTEST_R_PIN_CTRL_SLM(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_SLM_SHIFT)) & FMUTEST_R_PIN_CTRL_SLM_MASK) - -#define FMUTEST_R_PIN_CTRL_RECALL_MASK (0x800000U) -#define FMUTEST_R_PIN_CTRL_RECALL_SHIFT (23U) -/*! RECALL - Recall Trim Code */ -#define FMUTEST_R_PIN_CTRL_RECALL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_RECALL_SHIFT)) & FMUTEST_R_PIN_CTRL_RECALL_MASK) - -#define FMUTEST_R_PIN_CTRL_HEM_MASK (0x1000000U) -#define FMUTEST_R_PIN_CTRL_HEM_SHIFT (24U) -/*! HEM - HEM Control */ -#define FMUTEST_R_PIN_CTRL_HEM(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_HEM_SHIFT)) & FMUTEST_R_PIN_CTRL_HEM_MASK) -/*! @} */ - -/*! @name R_CNT_LOOP_CTRL - BIST Loop Count Control Register */ -/*! @{ */ - -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPCNT_MASK (0xFFFU) -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPCNT_SHIFT (0U) -/*! LOOPCNT - Loop Count Control */ -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPCNT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_CNT_LOOP_CTRL_LOOPCNT_SHIFT)) & FMUTEST_R_CNT_LOOP_CTRL_LOOPCNT_MASK) - -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPOPT_MASK (0x7000U) -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPOPT_SHIFT (12U) -/*! LOOPOPT - Loop Option - * 0b000..Loop is disabled; selected BIST operation is run once - * 0b001..Loop is enabled; XADR increments by 1 XADR increments by 1 for each new loop. Stops when total loop count meets LOOPCNT+1. - * 0b010..Loop is enabled; YADR increments by 1 YADR increments by 1 for each new loop. Stops when total loop count meets LOOPCNT+1. - * 0b011..Loop is enabled; XADR increments by 2 XADR increments by 2 for each new loop. Stops when total loop count meets LOOPCNT+1. - * 0b100..Loop is enabled; XADR increments by sector XADR increments by 16 for each new loop. Stops when total loop count meets LOOPCNT+1. - */ -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPOPT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_CNT_LOOP_CTRL_LOOPOPT_SHIFT)) & FMUTEST_R_CNT_LOOP_CTRL_LOOPOPT_MASK) - -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPUNIT_MASK (0x38000U) -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPUNIT_SHIFT (15U) -/*! LOOPUNIT - Loop Time Unit - * 0b000..Clock cycles - * 0b001..0.5 usec - * 0b010..1 usec - * 0b011..10 usec - * 0b100..100 usec - * 0b101..1 msec - * 0b110..10 msec - * 0b111..100 msec - */ -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPUNIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_CNT_LOOP_CTRL_LOOPUNIT_SHIFT)) & FMUTEST_R_CNT_LOOP_CTRL_LOOPUNIT_MASK) - -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPDLY_MASK (0x1FC0000U) -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPDLY_SHIFT (18U) -/*! LOOPDLY - Loop Time Delay Scalar */ -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPDLY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_CNT_LOOP_CTRL_LOOPDLY_SHIFT)) & FMUTEST_R_CNT_LOOP_CTRL_LOOPDLY_MASK) -/*! @} */ - -/*! @name R_TIMER_CTRL - BIST Timer Control Register */ -/*! @{ */ - -#define FMUTEST_R_TIMER_CTRL_TNVSUNIT_MASK (0x7U) -#define FMUTEST_R_TIMER_CTRL_TNVSUNIT_SHIFT (0U) -/*! TNVSUNIT - Tnvs Time Unit - * 0b000..Clock cycles - * 0b001..0.5 usec - * 0b010..1 usec - * 0b011..10 usec - * 0b100..100 usec - * 0b101..1 msec - * 0b110..10 msec - * 0b111..100 msec - */ -#define FMUTEST_R_TIMER_CTRL_TNVSUNIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TNVSUNIT_SHIFT)) & FMUTEST_R_TIMER_CTRL_TNVSUNIT_MASK) - -#define FMUTEST_R_TIMER_CTRL_TNVSDLY_MASK (0x78U) -#define FMUTEST_R_TIMER_CTRL_TNVSDLY_SHIFT (3U) -/*! TNVSDLY - Tnvs Time Delay Scalar */ -#define FMUTEST_R_TIMER_CTRL_TNVSDLY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TNVSDLY_SHIFT)) & FMUTEST_R_TIMER_CTRL_TNVSDLY_MASK) - -#define FMUTEST_R_TIMER_CTRL_TNVHUNIT_MASK (0x380U) -#define FMUTEST_R_TIMER_CTRL_TNVHUNIT_SHIFT (7U) -/*! TNVHUNIT - Tnvh Time Unit - * 0b000..Clock cycles - * 0b001..0.5 usec - * 0b010..1 usec - * 0b011..10 usec - * 0b100..100 usec - * 0b101..1 msec - * 0b110..10 msec - * 0b111..100 msec - */ -#define FMUTEST_R_TIMER_CTRL_TNVHUNIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TNVHUNIT_SHIFT)) & FMUTEST_R_TIMER_CTRL_TNVHUNIT_MASK) - -#define FMUTEST_R_TIMER_CTRL_TNVHDLY_MASK (0x3C00U) -#define FMUTEST_R_TIMER_CTRL_TNVHDLY_SHIFT (10U) -/*! TNVHDLY - Tnvh Time Delay Scalar */ -#define FMUTEST_R_TIMER_CTRL_TNVHDLY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TNVHDLY_SHIFT)) & FMUTEST_R_TIMER_CTRL_TNVHDLY_MASK) - -#define FMUTEST_R_TIMER_CTRL_TPGSUNIT_MASK (0x1C000U) -#define FMUTEST_R_TIMER_CTRL_TPGSUNIT_SHIFT (14U) -/*! TPGSUNIT - Tpgs Time Unit - * 0b000..Clock cycles - * 0b001..0.5 usec - * 0b010..1 usec - * 0b011..10 usec - * 0b100..100 usec - * 0b101..1 msec - * 0b110..10 msec - * 0b111..100 msec - */ -#define FMUTEST_R_TIMER_CTRL_TPGSUNIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TPGSUNIT_SHIFT)) & FMUTEST_R_TIMER_CTRL_TPGSUNIT_MASK) - -#define FMUTEST_R_TIMER_CTRL_TPGSDLY_MASK (0x1E0000U) -#define FMUTEST_R_TIMER_CTRL_TPGSDLY_SHIFT (17U) -/*! TPGSDLY - Tpgs Time Delay Scalar */ -#define FMUTEST_R_TIMER_CTRL_TPGSDLY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TPGSDLY_SHIFT)) & FMUTEST_R_TIMER_CTRL_TPGSDLY_MASK) - -#define FMUTEST_R_TIMER_CTRL_TRCVUNIT_MASK (0xE00000U) -#define FMUTEST_R_TIMER_CTRL_TRCVUNIT_SHIFT (21U) -/*! TRCVUNIT - Trcv Time Unit - * 0b000..Clock cycles - * 0b001..0.5 usec - * 0b010..1 usec - * 0b011..10 usec - * 0b100..100 usec - * 0b101..1 msec - * 0b110..10 msec - * 0b111..100 msec - */ -#define FMUTEST_R_TIMER_CTRL_TRCVUNIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TRCVUNIT_SHIFT)) & FMUTEST_R_TIMER_CTRL_TRCVUNIT_MASK) - -#define FMUTEST_R_TIMER_CTRL_TRCVDLY_MASK (0xF000000U) -#define FMUTEST_R_TIMER_CTRL_TRCVDLY_SHIFT (24U) -/*! TRCVDLY - Trcv Time Delay Scalar */ -#define FMUTEST_R_TIMER_CTRL_TRCVDLY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TRCVDLY_SHIFT)) & FMUTEST_R_TIMER_CTRL_TRCVDLY_MASK) - -#define FMUTEST_R_TIMER_CTRL_TLVSUNIT_MASK (0x70000000U) -#define FMUTEST_R_TIMER_CTRL_TLVSUNIT_SHIFT (28U) -/*! TLVSUNIT - Tlvs Time Unit - * 0b000..Clock cycles - * 0b001..0.5 usec - * 0b010..1 usec - * 0b011..10 usec - * 0b100..100 usec - * 0b101..1 msec - * 0b110..10 msec - * 0b111..100 msec - */ -#define FMUTEST_R_TIMER_CTRL_TLVSUNIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TLVSUNIT_SHIFT)) & FMUTEST_R_TIMER_CTRL_TLVSUNIT_MASK) - -#define FMUTEST_R_TIMER_CTRL_TLVSDLY_L_MASK (0x80000000U) -#define FMUTEST_R_TIMER_CTRL_TLVSDLY_L_SHIFT (31U) -/*! TLVSDLY_L - Tlvs Time Delay Scalar Low */ -#define FMUTEST_R_TIMER_CTRL_TLVSDLY_L(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TLVSDLY_L_SHIFT)) & FMUTEST_R_TIMER_CTRL_TLVSDLY_L_MASK) -/*! @} */ - -/*! @name R_TEST_CTRL - BIST Test Control Register */ -/*! @{ */ - -#define FMUTEST_R_TEST_CTRL_BUSY_MASK (0x1U) -#define FMUTEST_R_TEST_CTRL_BUSY_SHIFT (0U) -/*! BUSY - BIST Busy Status - * 0b0..BIST is idle - * 0b1..BIST is busy - */ -#define FMUTEST_R_TEST_CTRL_BUSY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_BUSY_SHIFT)) & FMUTEST_R_TEST_CTRL_BUSY_MASK) - -#define FMUTEST_R_TEST_CTRL_DEBUG_MASK (0x2U) -#define FMUTEST_R_TEST_CTRL_DEBUG_SHIFT (1U) -/*! DEBUG - BIST Debug Status */ -#define FMUTEST_R_TEST_CTRL_DEBUG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_DEBUG_SHIFT)) & FMUTEST_R_TEST_CTRL_DEBUG_MASK) - -#define FMUTEST_R_TEST_CTRL_STATUS0_MASK (0x4U) -#define FMUTEST_R_TEST_CTRL_STATUS0_SHIFT (2U) -/*! STATUS0 - BIST Status 0 - * 0b0..BIST test passed on flash block 0 - * 0b1..BIST test failed on flash block 0 - */ -#define FMUTEST_R_TEST_CTRL_STATUS0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_STATUS0_SHIFT)) & FMUTEST_R_TEST_CTRL_STATUS0_MASK) - -#define FMUTEST_R_TEST_CTRL_STATUS1_MASK (0x8U) -#define FMUTEST_R_TEST_CTRL_STATUS1_SHIFT (3U) -/*! STATUS1 - BIST status 1 - * 0b0..BIST test passed on flash block 1 - * 0b1..BIST test failed on flash block 1 - */ -#define FMUTEST_R_TEST_CTRL_STATUS1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_STATUS1_SHIFT)) & FMUTEST_R_TEST_CTRL_STATUS1_MASK) - -#define FMUTEST_R_TEST_CTRL_DEBUGRUN_MASK (0x10U) -#define FMUTEST_R_TEST_CTRL_DEBUGRUN_SHIFT (4U) -/*! DEBUGRUN - BIST Continue Debug Run */ -#define FMUTEST_R_TEST_CTRL_DEBUGRUN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_DEBUGRUN_SHIFT)) & FMUTEST_R_TEST_CTRL_DEBUGRUN_MASK) - -#define FMUTEST_R_TEST_CTRL_STARTRUN_MASK (0x20U) -#define FMUTEST_R_TEST_CTRL_STARTRUN_SHIFT (5U) -/*! STARTRUN - Run New BIST Operation */ -#define FMUTEST_R_TEST_CTRL_STARTRUN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_STARTRUN_SHIFT)) & FMUTEST_R_TEST_CTRL_STARTRUN_MASK) - -#define FMUTEST_R_TEST_CTRL_CMDINDEX_MASK (0xFFC0U) -#define FMUTEST_R_TEST_CTRL_CMDINDEX_SHIFT (6U) -/*! CMDINDEX - BIST Command Index (code) */ -#define FMUTEST_R_TEST_CTRL_CMDINDEX(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_CMDINDEX_SHIFT)) & FMUTEST_R_TEST_CTRL_CMDINDEX_MASK) - -#define FMUTEST_R_TEST_CTRL_DISABLE_IP1_MASK (0x10000U) -#define FMUTEST_R_TEST_CTRL_DISABLE_IP1_SHIFT (16U) -/*! DISABLE_IP1 - BIST Disable IP1 */ -#define FMUTEST_R_TEST_CTRL_DISABLE_IP1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_DISABLE_IP1_SHIFT)) & FMUTEST_R_TEST_CTRL_DISABLE_IP1_MASK) -/*! @} */ - -/*! @name R_ABORT_LOOP - BIST Abort Loop Register */ -/*! @{ */ - -#define FMUTEST_R_ABORT_LOOP_ABORT_LOOP_MASK (0x1U) -#define FMUTEST_R_ABORT_LOOP_ABORT_LOOP_SHIFT (0U) -/*! ABORT_LOOP - Abort Loop - * 0b0..No effect - * 0b1..Abort BIST loop commands and force the loop counter to return to 0x0 - */ -#define FMUTEST_R_ABORT_LOOP_ABORT_LOOP(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ABORT_LOOP_ABORT_LOOP_SHIFT)) & FMUTEST_R_ABORT_LOOP_ABORT_LOOP_MASK) -/*! @} */ - -/*! @name R_ADR_QUERY - BIST Address Query Register */ -/*! @{ */ - -#define FMUTEST_R_ADR_QUERY_YADRFAIL_MASK (0x1FU) -#define FMUTEST_R_ADR_QUERY_YADRFAIL_SHIFT (0U) -/*! YADRFAIL - Failing YADR */ -#define FMUTEST_R_ADR_QUERY_YADRFAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ADR_QUERY_YADRFAIL_SHIFT)) & FMUTEST_R_ADR_QUERY_YADRFAIL_MASK) - -#define FMUTEST_R_ADR_QUERY_XADRFAIL_MASK (0x1FFE0U) -#define FMUTEST_R_ADR_QUERY_XADRFAIL_SHIFT (5U) -/*! XADRFAIL - Failing XADR */ -#define FMUTEST_R_ADR_QUERY_XADRFAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ADR_QUERY_XADRFAIL_SHIFT)) & FMUTEST_R_ADR_QUERY_XADRFAIL_MASK) -/*! @} */ - -/*! @name R_DOUT_QUERY0 - BIST DOUT Query 0 Register */ -/*! @{ */ - -#define FMUTEST_R_DOUT_QUERY0_DOUTFAIL_MASK (0xFFFFFFFFU) -#define FMUTEST_R_DOUT_QUERY0_DOUTFAIL_SHIFT (0U) -/*! DOUTFAIL - Failing DOUT Low */ -#define FMUTEST_R_DOUT_QUERY0_DOUTFAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DOUT_QUERY0_DOUTFAIL_SHIFT)) & FMUTEST_R_DOUT_QUERY0_DOUTFAIL_MASK) -/*! @} */ - -/*! @name R_SMW_QUERY - BIST SMW Query Register */ -/*! @{ */ - -#define FMUTEST_R_SMW_QUERY_SMWLOOP_MASK (0x3FFU) -#define FMUTEST_R_SMW_QUERY_SMWLOOP_SHIFT (0U) -/*! SMWLOOP - SMW Total Loop Count */ -#define FMUTEST_R_SMW_QUERY_SMWLOOP(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMW_QUERY_SMWLOOP_SHIFT)) & FMUTEST_R_SMW_QUERY_SMWLOOP_MASK) - -#define FMUTEST_R_SMW_QUERY_SMWLAST_MASK (0x7FC00U) -#define FMUTEST_R_SMW_QUERY_SMWLAST_SHIFT (10U) -/*! SMWLAST - SMW Last Voltage Setting */ -#define FMUTEST_R_SMW_QUERY_SMWLAST(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMW_QUERY_SMWLAST_SHIFT)) & FMUTEST_R_SMW_QUERY_SMWLAST_MASK) -/*! @} */ - -/*! @name R_SMW_SETTING0 - BIST SMW Setting 0 Register */ -/*! @{ */ - -#define FMUTEST_R_SMW_SETTING0_SMWPARM0_MASK (0x7FFFFFFFU) -#define FMUTEST_R_SMW_SETTING0_SMWPARM0_SHIFT (0U) -/*! SMWPARM0 - SMW Parameter Set 0 */ -#define FMUTEST_R_SMW_SETTING0_SMWPARM0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMW_SETTING0_SMWPARM0_SHIFT)) & FMUTEST_R_SMW_SETTING0_SMWPARM0_MASK) -/*! @} */ - -/*! @name R_SMW_SETTING1 - BIST SMW Setting 1 Register */ -/*! @{ */ - -#define FMUTEST_R_SMW_SETTING1_SMWPARM1_MASK (0xFFFFFFFU) -#define FMUTEST_R_SMW_SETTING1_SMWPARM1_SHIFT (0U) -/*! SMWPARM1 - SMW Parameter Set 1 */ -#define FMUTEST_R_SMW_SETTING1_SMWPARM1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMW_SETTING1_SMWPARM1_SHIFT)) & FMUTEST_R_SMW_SETTING1_SMWPARM1_MASK) -/*! @} */ - -/*! @name R_SMP_WHV0 - BIST SMP WHV Setting 0 Register */ -/*! @{ */ - -#define FMUTEST_R_SMP_WHV0_SMPWHV0_MASK (0xFFFFFFFFU) -#define FMUTEST_R_SMP_WHV0_SMPWHV0_SHIFT (0U) -/*! SMPWHV0 - SMP WHV Parameter Set 0 */ -#define FMUTEST_R_SMP_WHV0_SMPWHV0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMP_WHV0_SMPWHV0_SHIFT)) & FMUTEST_R_SMP_WHV0_SMPWHV0_MASK) -/*! @} */ - -/*! @name R_SMP_WHV1 - BIST SMP WHV Setting 1 Register */ -/*! @{ */ - -#define FMUTEST_R_SMP_WHV1_SMPWHV1_MASK (0xFFFFFFFFU) -#define FMUTEST_R_SMP_WHV1_SMPWHV1_SHIFT (0U) -/*! SMPWHV1 - SMP WHV Parameter Set 1 */ -#define FMUTEST_R_SMP_WHV1_SMPWHV1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMP_WHV1_SMPWHV1_SHIFT)) & FMUTEST_R_SMP_WHV1_SMPWHV1_MASK) -/*! @} */ - -/*! @name R_SME_WHV0 - BIST SME WHV Setting 0 Register */ -/*! @{ */ - -#define FMUTEST_R_SME_WHV0_SMEWHV0_MASK (0xFFFFFFFFU) -#define FMUTEST_R_SME_WHV0_SMEWHV0_SHIFT (0U) -/*! SMEWHV0 - SME WHV Parameter Set 0 */ -#define FMUTEST_R_SME_WHV0_SMEWHV0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SME_WHV0_SMEWHV0_SHIFT)) & FMUTEST_R_SME_WHV0_SMEWHV0_MASK) -/*! @} */ - -/*! @name R_SME_WHV1 - BIST SME WHV Setting 1 Register */ -/*! @{ */ - -#define FMUTEST_R_SME_WHV1_SMEWHV1_MASK (0xFFFFFFFFU) -#define FMUTEST_R_SME_WHV1_SMEWHV1_SHIFT (0U) -/*! SMEWHV1 - SME WHV Parameter Set 1 */ -#define FMUTEST_R_SME_WHV1_SMEWHV1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SME_WHV1_SMEWHV1_SHIFT)) & FMUTEST_R_SME_WHV1_SMEWHV1_MASK) -/*! @} */ - -/*! @name R_SMW_SETTING2 - BIST SMW Setting 2 Register */ -/*! @{ */ - -#define FMUTEST_R_SMW_SETTING2_SMWPARM2_MASK (0x1FFFFFFFU) -#define FMUTEST_R_SMW_SETTING2_SMWPARM2_SHIFT (0U) -/*! SMWPARM2 - SMW Parameter Set 2 */ -#define FMUTEST_R_SMW_SETTING2_SMWPARM2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMW_SETTING2_SMWPARM2_SHIFT)) & FMUTEST_R_SMW_SETTING2_SMWPARM2_MASK) -/*! @} */ - -/*! @name R_D_MISR0 - BIST DIN MISR 0 Register */ -/*! @{ */ - -#define FMUTEST_R_D_MISR0_DATASIG0_MASK (0xFFFFFFFFU) -#define FMUTEST_R_D_MISR0_DATASIG0_SHIFT (0U) -/*! DATASIG0 - Data Signature */ -#define FMUTEST_R_D_MISR0_DATASIG0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_D_MISR0_DATASIG0_SHIFT)) & FMUTEST_R_D_MISR0_DATASIG0_MASK) -/*! @} */ - -/*! @name R_A_MISR0 - BIST Address MISR 0 Register */ -/*! @{ */ - -#define FMUTEST_R_A_MISR0_ADRSIG0_MASK (0xFFFFFFFFU) -#define FMUTEST_R_A_MISR0_ADRSIG0_SHIFT (0U) -/*! ADRSIG0 - Address Signature */ -#define FMUTEST_R_A_MISR0_ADRSIG0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_A_MISR0_ADRSIG0_SHIFT)) & FMUTEST_R_A_MISR0_ADRSIG0_MASK) -/*! @} */ - -/*! @name R_C_MISR0 - BIST Control MISR 0 Register */ -/*! @{ */ - -#define FMUTEST_R_C_MISR0_CTRLSIG0_MASK (0xFFFFFFFFU) -#define FMUTEST_R_C_MISR0_CTRLSIG0_SHIFT (0U) -/*! CTRLSIG0 - Control Signature */ -#define FMUTEST_R_C_MISR0_CTRLSIG0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_C_MISR0_CTRLSIG0_SHIFT)) & FMUTEST_R_C_MISR0_CTRLSIG0_MASK) -/*! @} */ - -/*! @name R_SMW_SETTING3 - BIST SMW Setting 3 Register */ -/*! @{ */ - -#define FMUTEST_R_SMW_SETTING3_SMWPARM3_MASK (0x1FFFFU) -#define FMUTEST_R_SMW_SETTING3_SMWPARM3_SHIFT (0U) -/*! SMWPARM3 - SMW Parameter Set 3 */ -#define FMUTEST_R_SMW_SETTING3_SMWPARM3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMW_SETTING3_SMWPARM3_SHIFT)) & FMUTEST_R_SMW_SETTING3_SMWPARM3_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL1 - BIST Data Control 1 Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL1_DATA1_MASK (0xFFFFFFFFU) -#define FMUTEST_R_DATA_CTRL1_DATA1_SHIFT (0U) -/*! DATA1 - BIST Data 1 Low */ -#define FMUTEST_R_DATA_CTRL1_DATA1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL1_DATA1_SHIFT)) & FMUTEST_R_DATA_CTRL1_DATA1_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL2 - BIST Data Control 2 Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL2_DATA2_MASK (0xFFFFFFFFU) -#define FMUTEST_R_DATA_CTRL2_DATA2_SHIFT (0U) -/*! DATA2 - BIST Data 2 Low */ -#define FMUTEST_R_DATA_CTRL2_DATA2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL2_DATA2_SHIFT)) & FMUTEST_R_DATA_CTRL2_DATA2_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL3 - BIST Data Control 3 Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL3_DATA3_MASK (0xFFFFFFFFU) -#define FMUTEST_R_DATA_CTRL3_DATA3_SHIFT (0U) -/*! DATA3 - BIST Data 3 Low */ -#define FMUTEST_R_DATA_CTRL3_DATA3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL3_DATA3_SHIFT)) & FMUTEST_R_DATA_CTRL3_DATA3_MASK) -/*! @} */ - -/*! @name R_REPAIR0_0 - BIST Repair 0 for Block 0 Register */ -/*! @{ */ - -#define FMUTEST_R_REPAIR0_0_RDIS0_0_MASK (0x1U) -#define FMUTEST_R_REPAIR0_0_RDIS0_0_SHIFT (0U) -/*! RDIS0_0 - Control Repair 0 in Block 0. - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_R_REPAIR0_0_RDIS0_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR0_0_RDIS0_0_SHIFT)) & FMUTEST_R_REPAIR0_0_RDIS0_0_MASK) - -#define FMUTEST_R_REPAIR0_0_RADR0_0_MASK (0x1FEU) -#define FMUTEST_R_REPAIR0_0_RADR0_0_SHIFT (1U) -/*! RADR0_0 - XADR for Repair 0 in Block 0 */ -#define FMUTEST_R_REPAIR0_0_RADR0_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR0_0_RADR0_0_SHIFT)) & FMUTEST_R_REPAIR0_0_RADR0_0_MASK) -/*! @} */ - -/*! @name R_REPAIR0_1 - BIST Repair 1 Block 0 Register */ -/*! @{ */ - -#define FMUTEST_R_REPAIR0_1_RDIS0_1_MASK (0x1U) -#define FMUTEST_R_REPAIR0_1_RDIS0_1_SHIFT (0U) -/*! RDIS0_1 - Control Repair 1 in Block 0. - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_R_REPAIR0_1_RDIS0_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR0_1_RDIS0_1_SHIFT)) & FMUTEST_R_REPAIR0_1_RDIS0_1_MASK) - -#define FMUTEST_R_REPAIR0_1_RADR0_1_MASK (0x1FEU) -#define FMUTEST_R_REPAIR0_1_RADR0_1_SHIFT (1U) -/*! RADR0_1 - XADR for Repair 1 in Block 0. */ -#define FMUTEST_R_REPAIR0_1_RADR0_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR0_1_RADR0_1_SHIFT)) & FMUTEST_R_REPAIR0_1_RADR0_1_MASK) -/*! @} */ - -/*! @name R_REPAIR1_0 - BIST Repair 0 Block 1 Register */ -/*! @{ */ - -#define FMUTEST_R_REPAIR1_0_RDIS1_0_MASK (0x1U) -#define FMUTEST_R_REPAIR1_0_RDIS1_0_SHIFT (0U) -/*! RDIS1_0 - Control Repair 0 in Block 1. - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_R_REPAIR1_0_RDIS1_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR1_0_RDIS1_0_SHIFT)) & FMUTEST_R_REPAIR1_0_RDIS1_0_MASK) - -#define FMUTEST_R_REPAIR1_0_RADR1_0_MASK (0x1FEU) -#define FMUTEST_R_REPAIR1_0_RADR1_0_SHIFT (1U) -/*! RADR1_0 - XADR for Repair 0 in Block 1. */ -#define FMUTEST_R_REPAIR1_0_RADR1_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR1_0_RADR1_0_SHIFT)) & FMUTEST_R_REPAIR1_0_RADR1_0_MASK) -/*! @} */ - -/*! @name R_REPAIR1_1 - BIST Repair 1 Block 1 Register */ -/*! @{ */ - -#define FMUTEST_R_REPAIR1_1_RDIS1_1_MASK (0x1U) -#define FMUTEST_R_REPAIR1_1_RDIS1_1_SHIFT (0U) -/*! RDIS1_1 - Control Repair 1 in Block 1. - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_R_REPAIR1_1_RDIS1_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR1_1_RDIS1_1_SHIFT)) & FMUTEST_R_REPAIR1_1_RDIS1_1_MASK) - -#define FMUTEST_R_REPAIR1_1_RADR1_1_MASK (0x1FEU) -#define FMUTEST_R_REPAIR1_1_RADR1_1_SHIFT (1U) -/*! RADR1_1 - XADR for Repair 1 in Block 1. */ -#define FMUTEST_R_REPAIR1_1_RADR1_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR1_1_RADR1_1_SHIFT)) & FMUTEST_R_REPAIR1_1_RADR1_1_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL0_EX - BIST Data Control 0 Extension Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL0_EX_DATA0X_MASK (0x7U) -#define FMUTEST_R_DATA_CTRL0_EX_DATA0X_SHIFT (0U) -/*! DATA0X - BIST Data 0 High */ -#define FMUTEST_R_DATA_CTRL0_EX_DATA0X(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL0_EX_DATA0X_SHIFT)) & FMUTEST_R_DATA_CTRL0_EX_DATA0X_MASK) -/*! @} */ - -/*! @name R_TIMER_CTRL_EX - BIST Timer Control Extension Register */ -/*! @{ */ - -#define FMUTEST_R_TIMER_CTRL_EX_TLVSDLY_H_MASK (0x7U) -#define FMUTEST_R_TIMER_CTRL_EX_TLVSDLY_H_SHIFT (0U) -/*! TLVSDLY_H - Tlvs Time Delay Scalar High */ -#define FMUTEST_R_TIMER_CTRL_EX_TLVSDLY_H(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_EX_TLVSDLY_H_SHIFT)) & FMUTEST_R_TIMER_CTRL_EX_TLVSDLY_H_MASK) -/*! @} */ - -/*! @name R_DOUT_QUERY1 - BIST DOUT Query 1 Register */ -/*! @{ */ - -#define FMUTEST_R_DOUT_QUERY1_DOUT_MASK (0x7U) -#define FMUTEST_R_DOUT_QUERY1_DOUT_SHIFT (0U) -/*! DOUT - Failing DOUT High */ -#define FMUTEST_R_DOUT_QUERY1_DOUT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DOUT_QUERY1_DOUT_SHIFT)) & FMUTEST_R_DOUT_QUERY1_DOUT_MASK) -/*! @} */ - -/*! @name R_D_MISR1 - BIST DIN MISR 1 Register */ -/*! @{ */ - -#define FMUTEST_R_D_MISR1_DATASIG1_MASK (0xFFU) -#define FMUTEST_R_D_MISR1_DATASIG1_SHIFT (0U) -/*! DATASIG1 - MISR Data Signature High */ -#define FMUTEST_R_D_MISR1_DATASIG1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_D_MISR1_DATASIG1_SHIFT)) & FMUTEST_R_D_MISR1_DATASIG1_MASK) -/*! @} */ - -/*! @name R_A_MISR1 - BIST Address MISR 1 Register */ -/*! @{ */ - -#define FMUTEST_R_A_MISR1_ADRSIG1_MASK (0xFFU) -#define FMUTEST_R_A_MISR1_ADRSIG1_SHIFT (0U) -/*! ADRSIG1 - MISR Address Signature High */ -#define FMUTEST_R_A_MISR1_ADRSIG1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_A_MISR1_ADRSIG1_SHIFT)) & FMUTEST_R_A_MISR1_ADRSIG1_MASK) -/*! @} */ - -/*! @name R_C_MISR1 - BIST Control MISR 1 Register */ -/*! @{ */ - -#define FMUTEST_R_C_MISR1_CTRLSIG1_MASK (0xFFU) -#define FMUTEST_R_C_MISR1_CTRLSIG1_SHIFT (0U) -/*! CTRLSIG1 - MISR Control Signature High */ -#define FMUTEST_R_C_MISR1_CTRLSIG1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_C_MISR1_CTRLSIG1_SHIFT)) & FMUTEST_R_C_MISR1_CTRLSIG1_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL1_EX - BIST Data Control 1 Extension Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL1_EX_DATA1X_MASK (0x7U) -#define FMUTEST_R_DATA_CTRL1_EX_DATA1X_SHIFT (0U) -/*! DATA1X - BIST Data 1 High */ -#define FMUTEST_R_DATA_CTRL1_EX_DATA1X(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL1_EX_DATA1X_SHIFT)) & FMUTEST_R_DATA_CTRL1_EX_DATA1X_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL2_EX - BIST Data Control 2 Extension Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL2_EX_DATA2X_MASK (0x7U) -#define FMUTEST_R_DATA_CTRL2_EX_DATA2X_SHIFT (0U) -/*! DATA2X - BIST Data 2 High */ -#define FMUTEST_R_DATA_CTRL2_EX_DATA2X(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL2_EX_DATA2X_SHIFT)) & FMUTEST_R_DATA_CTRL2_EX_DATA2X_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL3_EX - BIST Data Control 3 Extension Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL3_EX_DATA3X_MASK (0x7U) -#define FMUTEST_R_DATA_CTRL3_EX_DATA3X_SHIFT (0U) -/*! DATA3X - BIST Data 3 High */ -#define FMUTEST_R_DATA_CTRL3_EX_DATA3X(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL3_EX_DATA3X_SHIFT)) & FMUTEST_R_DATA_CTRL3_EX_DATA3X_MASK) -/*! @} */ - -/*! @name SMW_TIMER_OPTION - SMW Timer Option Register */ -/*! @{ */ - -#define FMUTEST_SMW_TIMER_OPTION_SMW_CDIVL_MASK (0xFFU) -#define FMUTEST_SMW_TIMER_OPTION_SMW_CDIVL_SHIFT (0U) -/*! SMW_CDIVL - Clock Divide Scalar for Long Pulse */ -#define FMUTEST_SMW_TIMER_OPTION_SMW_CDIVL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_TIMER_OPTION_SMW_CDIVL_SHIFT)) & FMUTEST_SMW_TIMER_OPTION_SMW_CDIVL_MASK) - -#define FMUTEST_SMW_TIMER_OPTION_SMW_TVFY_MASK (0x1F00U) -#define FMUTEST_SMW_TIMER_OPTION_SMW_TVFY_SHIFT (8U) -/*! SMW_TVFY - Timer Adjust for Verify */ -#define FMUTEST_SMW_TIMER_OPTION_SMW_TVFY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_TIMER_OPTION_SMW_TVFY_SHIFT)) & FMUTEST_SMW_TIMER_OPTION_SMW_TVFY_MASK) -/*! @} */ - -/*! @name SMW_SETTING_OPTION0 - SMW Setting Option 0 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SETTING_OPTION0_MV_INIT_MASK (0x1C000U) -#define FMUTEST_SMW_SETTING_OPTION0_MV_INIT_SHIFT (14U) -/*! MV_INIT - Medium Voltage Level Select Initial */ -#define FMUTEST_SMW_SETTING_OPTION0_MV_INIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION0_MV_INIT_SHIFT)) & FMUTEST_SMW_SETTING_OPTION0_MV_INIT_MASK) - -#define FMUTEST_SMW_SETTING_OPTION0_MV_END_MASK (0xE0000U) -#define FMUTEST_SMW_SETTING_OPTION0_MV_END_SHIFT (17U) -/*! MV_END - Medium Voltage Level Select Final */ -#define FMUTEST_SMW_SETTING_OPTION0_MV_END(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION0_MV_END_SHIFT)) & FMUTEST_SMW_SETTING_OPTION0_MV_END_MASK) - -#define FMUTEST_SMW_SETTING_OPTION0_MV_MISC_MASK (0xF00000U) -#define FMUTEST_SMW_SETTING_OPTION0_MV_MISC_SHIFT (20U) -/*! MV_MISC - Medium Voltage Control Misc */ -#define FMUTEST_SMW_SETTING_OPTION0_MV_MISC(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION0_MV_MISC_SHIFT)) & FMUTEST_SMW_SETTING_OPTION0_MV_MISC_MASK) - -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_INIT_MASK (0x3000000U) -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_INIT_SHIFT (24U) -/*! IPGM_INIT - Program Current Control Initial */ -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_INIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION0_IPGM_INIT_SHIFT)) & FMUTEST_SMW_SETTING_OPTION0_IPGM_INIT_MASK) - -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_END_MASK (0xC000000U) -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_END_SHIFT (26U) -/*! IPGM_END - Program Current Control Final */ -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_END(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION0_IPGM_END_SHIFT)) & FMUTEST_SMW_SETTING_OPTION0_IPGM_END_MASK) - -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_MISC_MASK (0x70000000U) -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_MISC_SHIFT (28U) -/*! IPGM_MISC - Program Current Control Misc */ -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_MISC(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION0_IPGM_MISC_SHIFT)) & FMUTEST_SMW_SETTING_OPTION0_IPGM_MISC_MASK) -/*! @} */ - -/*! @name SMW_SETTING_OPTION2 - SMW Setting Option 2 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SETTING_OPTION2_THVS_CTRL_MASK (0x7U) -#define FMUTEST_SMW_SETTING_OPTION2_THVS_CTRL_SHIFT (0U) -/*! THVS_CTRL - Thvs control */ -#define FMUTEST_SMW_SETTING_OPTION2_THVS_CTRL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_THVS_CTRL_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_THVS_CTRL_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_TRCV_CTRL_MASK (0x38U) -#define FMUTEST_SMW_SETTING_OPTION2_TRCV_CTRL_SHIFT (3U) -/*! TRCV_CTRL - Trcv Control */ -#define FMUTEST_SMW_SETTING_OPTION2_TRCV_CTRL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_TRCV_CTRL_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_TRCV_CTRL_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_XTRA_ERS_MASK (0xC0U) -#define FMUTEST_SMW_SETTING_OPTION2_XTRA_ERS_SHIFT (6U) -/*! XTRA_ERS - Number of Post Shots for SME */ -#define FMUTEST_SMW_SETTING_OPTION2_XTRA_ERS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_XTRA_ERS_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_XTRA_ERS_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_XTRA_PGM_MASK (0x300U) -#define FMUTEST_SMW_SETTING_OPTION2_XTRA_PGM_SHIFT (8U) -/*! XTRA_PGM - Number of Post Shots for SMP */ -#define FMUTEST_SMW_SETTING_OPTION2_XTRA_PGM(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_XTRA_PGM_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_XTRA_PGM_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_WHV_CNTR_MASK (0x3FC00U) -#define FMUTEST_SMW_SETTING_OPTION2_WHV_CNTR_SHIFT (10U) -/*! WHV_CNTR - WHV Counter */ -#define FMUTEST_SMW_SETTING_OPTION2_WHV_CNTR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_WHV_CNTR_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_WHV_CNTR_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_POST_TERS_MASK (0x1C0000U) -#define FMUTEST_SMW_SETTING_OPTION2_POST_TERS_SHIFT (18U) -/*! POST_TERS - Post Ters Time - * 0b000..50 usec - * 0b001..100 usec - * 0b010..200 usec - * 0b011..300 usec - * 0b100..500 usec - * 0b101..1 msec - * 0b110..1.5 msec - * 0b111..2 msec - */ -#define FMUTEST_SMW_SETTING_OPTION2_POST_TERS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_POST_TERS_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_POST_TERS_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_POST_TPGM_MASK (0x600000U) -#define FMUTEST_SMW_SETTING_OPTION2_POST_TPGM_SHIFT (21U) -/*! POST_TPGM - Post Tpgm Time - * 0b00..1 usec - * 0b01..2 usec - * 0b10..4 usec - * 0b11..8 usec - */ -#define FMUTEST_SMW_SETTING_OPTION2_POST_TPGM(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_POST_TPGM_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_POST_TPGM_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_VFY_OPT_MASK (0x1800000U) -#define FMUTEST_SMW_SETTING_OPTION2_VFY_OPT_SHIFT (23U) -/*! VFY_OPT - Verify Option - * 0b00..Skip verify for post shot only, verify for all other shots - * 0b01..Skip verify for the 1st and post shots - * 0b10..Skip the 1st, 2nd, and post shots - * 0b11..Skip verify for all shots - */ -#define FMUTEST_SMW_SETTING_OPTION2_VFY_OPT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_VFY_OPT_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_VFY_OPT_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_TPGM_OPT_MASK (0x6000000U) -#define FMUTEST_SMW_SETTING_OPTION2_TPGM_OPT_SHIFT (25U) -/*! TPGM_OPT - Tpgm Option - * 0b00..Fixed Tpgm for all shots, except post shot - * 0b01..Increase Tpgm option by 1 for each loop until Tpgm reaches 4 usec - * 0b10..Increase Tpgm option by 1 for each loop until Tpgm reaches 8 usec - * 0b11..Unused - */ -#define FMUTEST_SMW_SETTING_OPTION2_TPGM_OPT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_TPGM_OPT_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_TPGM_OPT_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_MASK0_OPT_MASK (0x8000000U) -#define FMUTEST_SMW_SETTING_OPTION2_MASK0_OPT_SHIFT (27U) -/*! MASK0_OPT - MASK0_OPT - * 0b0..Mask programmed bits passing PV until extra shot - * 0b1..Always program bits even if they pass PV - */ -#define FMUTEST_SMW_SETTING_OPTION2_MASK0_OPT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_MASK0_OPT_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_MASK0_OPT_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_DIS_PRER_MASK (0x10000000U) -#define FMUTEST_SMW_SETTING_OPTION2_DIS_PRER_SHIFT (28U) -/*! DIS_PRER - Disable pre-PV Read before First Program Shot - * 0b0..Enable pre-PV read before first program shot - * 0b1..Disable pre-PV read before first program shot - */ -#define FMUTEST_SMW_SETTING_OPTION2_DIS_PRER(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_DIS_PRER_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_DIS_PRER_MASK) -/*! @} */ - -/*! @name SMW_SETTING_OPTION3 - SMW Setting Option 3 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SETTING_OPTION3_HEM_WHV_CNTR_MASK (0xFFU) -#define FMUTEST_SMW_SETTING_OPTION3_HEM_WHV_CNTR_SHIFT (0U) -/*! HEM_WHV_CNTR - WHV_COUNTER for HEM-erase Cycle */ -#define FMUTEST_SMW_SETTING_OPTION3_HEM_WHV_CNTR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION3_HEM_WHV_CNTR_SHIFT)) & FMUTEST_SMW_SETTING_OPTION3_HEM_WHV_CNTR_MASK) - -#define FMUTEST_SMW_SETTING_OPTION3_HEM_MAX_ERS_MASK (0x1FF00U) -#define FMUTEST_SMW_SETTING_OPTION3_HEM_MAX_ERS_SHIFT (8U) -/*! HEM_MAX_ERS - HEM Max Erase Shot Count */ -#define FMUTEST_SMW_SETTING_OPTION3_HEM_MAX_ERS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION3_HEM_MAX_ERS_SHIFT)) & FMUTEST_SMW_SETTING_OPTION3_HEM_MAX_ERS_MASK) -/*! @} */ - -/*! @name SMW_SMP_WHV_OPTION0 - SMW SMP WHV Option 0 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SMP_WHV_OPTION0_SMP_WHV_OPT0_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_SMP_WHV_OPTION0_SMP_WHV_OPT0_SHIFT (0U) -/*! SMP_WHV_OPT0 - Smart Program WHV Option Low */ -#define FMUTEST_SMW_SMP_WHV_OPTION0_SMP_WHV_OPT0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SMP_WHV_OPTION0_SMP_WHV_OPT0_SHIFT)) & FMUTEST_SMW_SMP_WHV_OPTION0_SMP_WHV_OPT0_MASK) -/*! @} */ - -/*! @name SMW_SME_WHV_OPTION0 - SMW SME WHV Option 0 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SME_WHV_OPTION0_SME_WHV_OPT0_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_SME_WHV_OPTION0_SME_WHV_OPT0_SHIFT (0U) -/*! SME_WHV_OPT0 - Smart Erase WHV Option Low */ -#define FMUTEST_SMW_SME_WHV_OPTION0_SME_WHV_OPT0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SME_WHV_OPTION0_SME_WHV_OPT0_SHIFT)) & FMUTEST_SMW_SME_WHV_OPTION0_SME_WHV_OPT0_MASK) -/*! @} */ - -/*! @name SMW_SETTING_OPTION1 - SMW Setting Option 1 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SETTING_OPTION1_TERS_CTRL0_MASK (0x7U) -#define FMUTEST_SMW_SETTING_OPTION1_TERS_CTRL0_SHIFT (0U) -/*! TERS_CTRL0 - Ters Control - * 0b000..50 usec - * 0b001..100 usec - * 0b010..200 usec - * 0b011..300 usec - * 0b100..500 usec - * 0b101..1 msec - * 0b110..1.5 msec - * 0b111..2 msec - */ -#define FMUTEST_SMW_SETTING_OPTION1_TERS_CTRL0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_TERS_CTRL0_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_TERS_CTRL0_MASK) - -#define FMUTEST_SMW_SETTING_OPTION1_TPGM_CTRL_MASK (0x18U) -#define FMUTEST_SMW_SETTING_OPTION1_TPGM_CTRL_SHIFT (3U) -/*! TPGM_CTRL - Tpgm Control - * 0b00..1 usec - * 0b01..2 usec - * 0b10..4 usec - * 0b11..8 usec - */ -#define FMUTEST_SMW_SETTING_OPTION1_TPGM_CTRL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_TPGM_CTRL_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_TPGM_CTRL_MASK) - -#define FMUTEST_SMW_SETTING_OPTION1_TNVS_CTRL_MASK (0xE0U) -#define FMUTEST_SMW_SETTING_OPTION1_TNVS_CTRL_SHIFT (5U) -/*! TNVS_CTRL - Tnvs Control - * 0b000..5 usec - * 0b001..8 usec - * 0b010..11 usec - * 0b011..14 usec - * 0b100..17 usec - * 0b101..20 usec - * 0b110..23 usec - * 0b111..26 usec - */ -#define FMUTEST_SMW_SETTING_OPTION1_TNVS_CTRL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_TNVS_CTRL_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_TNVS_CTRL_MASK) - -#define FMUTEST_SMW_SETTING_OPTION1_TNVH_CTRL_MASK (0x700U) -#define FMUTEST_SMW_SETTING_OPTION1_TNVH_CTRL_SHIFT (8U) -/*! TNVH_CTRL - Tnvh Control - * 0b000..2 usec - * 0b001..2.5 usec - * 0b010..3 usec - * 0b011..3.5 usec - * 0b100..4 usec - * 0b101..4.5 usec - * 0b110..5 usec - * 0b111..5.5 usec - */ -#define FMUTEST_SMW_SETTING_OPTION1_TNVH_CTRL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_TNVH_CTRL_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_TNVH_CTRL_MASK) - -#define FMUTEST_SMW_SETTING_OPTION1_TPGS_CTRL_MASK (0x3800U) -#define FMUTEST_SMW_SETTING_OPTION1_TPGS_CTRL_SHIFT (11U) -/*! TPGS_CTRL - Tpgs Control - * 0b000..1 usec - * 0b001..2 usec - * 0b010..3 usec - * 0b011..4 usec - * 0b100..5 usec - * 0b101..6 usec - * 0b110..7 usec - * 0b111..8 usec - */ -#define FMUTEST_SMW_SETTING_OPTION1_TPGS_CTRL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_TPGS_CTRL_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_TPGS_CTRL_MASK) - -#define FMUTEST_SMW_SETTING_OPTION1_MAX_ERASE_MASK (0x7FC000U) -#define FMUTEST_SMW_SETTING_OPTION1_MAX_ERASE_SHIFT (14U) -/*! MAX_ERASE - Number of Erase Shots */ -#define FMUTEST_SMW_SETTING_OPTION1_MAX_ERASE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_MAX_ERASE_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_MAX_ERASE_MASK) - -#define FMUTEST_SMW_SETTING_OPTION1_MAX_PROG_MASK (0xF800000U) -#define FMUTEST_SMW_SETTING_OPTION1_MAX_PROG_SHIFT (23U) -/*! MAX_PROG - Number of Program Shots */ -#define FMUTEST_SMW_SETTING_OPTION1_MAX_PROG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_MAX_PROG_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_MAX_PROG_MASK) -/*! @} */ - -/*! @name SMW_SMP_WHV_OPTION1 - SMW SMP WHV Option 1 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SMP_WHV_OPTION1_SMP_WHV_OPT1_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_SMP_WHV_OPTION1_SMP_WHV_OPT1_SHIFT (0U) -/*! SMP_WHV_OPT1 - Smart Program WHV Option High */ -#define FMUTEST_SMW_SMP_WHV_OPTION1_SMP_WHV_OPT1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SMP_WHV_OPTION1_SMP_WHV_OPT1_SHIFT)) & FMUTEST_SMW_SMP_WHV_OPTION1_SMP_WHV_OPT1_MASK) -/*! @} */ - -/*! @name SMW_SME_WHV_OPTION1 - SMW SME WHV Option 1 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SME_WHV_OPTION1_SME_WHV_OPT1_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_SME_WHV_OPTION1_SME_WHV_OPT1_SHIFT (0U) -/*! SME_WHV_OPT1 - Smart Erase WHV Option High */ -#define FMUTEST_SMW_SME_WHV_OPTION1_SME_WHV_OPT1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SME_WHV_OPTION1_SME_WHV_OPT1_SHIFT)) & FMUTEST_SMW_SME_WHV_OPTION1_SME_WHV_OPT1_MASK) -/*! @} */ - -/*! @name REPAIR0_0 - FMU Repair 0 Block 0 Register */ -/*! @{ */ - -#define FMUTEST_REPAIR0_0_RDIS0_0_MASK (0x1U) -#define FMUTEST_REPAIR0_0_RDIS0_0_SHIFT (0U) -/*! RDIS0_0 - RDIS0_0 - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_REPAIR0_0_RDIS0_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR0_0_RDIS0_0_SHIFT)) & FMUTEST_REPAIR0_0_RDIS0_0_MASK) - -#define FMUTEST_REPAIR0_0_RADR0_0_MASK (0x1FEU) -#define FMUTEST_REPAIR0_0_RADR0_0_SHIFT (1U) -/*! RADR0_0 - RADR0_0 */ -#define FMUTEST_REPAIR0_0_RADR0_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR0_0_RADR0_0_SHIFT)) & FMUTEST_REPAIR0_0_RADR0_0_MASK) -/*! @} */ - -/*! @name REPAIR0_1 - FMU Repair 1 Block 0 Register */ -/*! @{ */ - -#define FMUTEST_REPAIR0_1_RDIS0_1_MASK (0x1U) -#define FMUTEST_REPAIR0_1_RDIS0_1_SHIFT (0U) -/*! RDIS0_1 - RDIS0_1 - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_REPAIR0_1_RDIS0_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR0_1_RDIS0_1_SHIFT)) & FMUTEST_REPAIR0_1_RDIS0_1_MASK) - -#define FMUTEST_REPAIR0_1_RADR0_1_MASK (0x1FEU) -#define FMUTEST_REPAIR0_1_RADR0_1_SHIFT (1U) -/*! RADR0_1 - RADR0_1 */ -#define FMUTEST_REPAIR0_1_RADR0_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR0_1_RADR0_1_SHIFT)) & FMUTEST_REPAIR0_1_RADR0_1_MASK) -/*! @} */ - -/*! @name REPAIR1_0 - FMU Repair 0 Block 1 Register */ -/*! @{ */ - -#define FMUTEST_REPAIR1_0_RDIS1_0_MASK (0x1U) -#define FMUTEST_REPAIR1_0_RDIS1_0_SHIFT (0U) -/*! RDIS1_0 - RDIS1_0 - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_REPAIR1_0_RDIS1_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR1_0_RDIS1_0_SHIFT)) & FMUTEST_REPAIR1_0_RDIS1_0_MASK) - -#define FMUTEST_REPAIR1_0_RADR1_0_MASK (0x1FEU) -#define FMUTEST_REPAIR1_0_RADR1_0_SHIFT (1U) -/*! RADR1_0 - RADR1_0 */ -#define FMUTEST_REPAIR1_0_RADR1_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR1_0_RADR1_0_SHIFT)) & FMUTEST_REPAIR1_0_RADR1_0_MASK) -/*! @} */ - -/*! @name REPAIR1_1 - FMU Repair 1 Block 1 Register */ -/*! @{ */ - -#define FMUTEST_REPAIR1_1_RDIS1_1_MASK (0x1U) -#define FMUTEST_REPAIR1_1_RDIS1_1_SHIFT (0U) -/*! RDIS1_1 - RDIS1_1 - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_REPAIR1_1_RDIS1_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR1_1_RDIS1_1_SHIFT)) & FMUTEST_REPAIR1_1_RDIS1_1_MASK) - -#define FMUTEST_REPAIR1_1_RADR1_1_MASK (0x1FEU) -#define FMUTEST_REPAIR1_1_RADR1_1_SHIFT (1U) -/*! RADR1_1 - RADR1_1 */ -#define FMUTEST_REPAIR1_1_RADR1_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR1_1_RADR1_1_SHIFT)) & FMUTEST_REPAIR1_1_RADR1_1_MASK) -/*! @} */ - -/*! @name SMW_HB_SIGNALS - SMW HB Signals Register */ -/*! @{ */ - -#define FMUTEST_SMW_HB_SIGNALS_SMW_ARRAY_MASK (0x7U) -#define FMUTEST_SMW_HB_SIGNALS_SMW_ARRAY_SHIFT (0U) -/*! SMW_ARRAY - SMW Region Select - * 0b000..Main array - * 0b001..IFR space only or main (and REDEN space) with IFR space for mass erase - * 0b010..IFR1 space - * 0b100..REDEN space - */ -#define FMUTEST_SMW_HB_SIGNALS_SMW_ARRAY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_SMW_ARRAY_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_SMW_ARRAY_MASK) - -#define FMUTEST_SMW_HB_SIGNALS_USER_IFREN1_MASK (0x8U) -#define FMUTEST_SMW_HB_SIGNALS_USER_IFREN1_SHIFT (3U) -/*! USER_IFREN1 - IFR1 Enable - * 0b0..IFREN1 input to the flash array is driven LOW - * 0b1..IFREN1 input to the flash array is driven HIGH - */ -#define FMUTEST_SMW_HB_SIGNALS_USER_IFREN1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_USER_IFREN1_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_USER_IFREN1_MASK) - -#define FMUTEST_SMW_HB_SIGNALS_USER_PV_MASK (0x10U) -#define FMUTEST_SMW_HB_SIGNALS_USER_PV_SHIFT (4U) -/*! USER_PV - Program Verify - * 0b0..PV input to the flash array is driven LOW - * 0b1..PV input to the flash array is driven HIGH - */ -#define FMUTEST_SMW_HB_SIGNALS_USER_PV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_USER_PV_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_USER_PV_MASK) - -#define FMUTEST_SMW_HB_SIGNALS_USER_EV_MASK (0x20U) -#define FMUTEST_SMW_HB_SIGNALS_USER_EV_SHIFT (5U) -/*! USER_EV - Erase Verify - * 0b0..EV input to the flash array is driven LOW - * 0b1..EV input to the flash array is driven HIGH - */ -#define FMUTEST_SMW_HB_SIGNALS_USER_EV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_USER_EV_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_USER_EV_MASK) - -#define FMUTEST_SMW_HB_SIGNALS_USER_IFREN_MASK (0x40U) -#define FMUTEST_SMW_HB_SIGNALS_USER_IFREN_SHIFT (6U) -/*! USER_IFREN - IFR Enable - * 0b0..IFREN input to the flash array is driven LOW - * 0b1..IFREN input to the flash array is driven HIGH - */ -#define FMUTEST_SMW_HB_SIGNALS_USER_IFREN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_USER_IFREN_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_USER_IFREN_MASK) - -#define FMUTEST_SMW_HB_SIGNALS_USER_REDEN_MASK (0x80U) -#define FMUTEST_SMW_HB_SIGNALS_USER_REDEN_SHIFT (7U) -/*! USER_REDEN - Repair Read Enable - * 0b0..REDEN input to the flash array is driven LOW - * 0b1..REDEN input to the flash array is driven HIGH - */ -#define FMUTEST_SMW_HB_SIGNALS_USER_REDEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_USER_REDEN_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_USER_REDEN_MASK) - -#define FMUTEST_SMW_HB_SIGNALS_USER_HEM_MASK (0x100U) -#define FMUTEST_SMW_HB_SIGNALS_USER_HEM_SHIFT (8U) -/*! USER_HEM - High Endurance Enable - * 0b0..HEM input to SMW / BIST PIN_CTRL[24] is driven LOW - * 0b1..HEM input to SMW / BIST PIN_CTRL[24] is driven HIGH - */ -#define FMUTEST_SMW_HB_SIGNALS_USER_HEM(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_USER_HEM_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_USER_HEM_MASK) -/*! @} */ - -/*! @name BIST_DUMP_CTRL - BIST Datadump Control Register */ -/*! @{ */ - -#define FMUTEST_BIST_DUMP_CTRL_BIST_DONE_MASK (0x10000U) -#define FMUTEST_BIST_DUMP_CTRL_BIST_DONE_SHIFT (16U) -/*! BIST_DONE - BIST Done - * 0b0..The BIST (or data dump) is running - * 0b1..The BIST (or data dump) has completed - */ -#define FMUTEST_BIST_DUMP_CTRL_BIST_DONE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_BIST_DONE_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_BIST_DONE_MASK) - -#define FMUTEST_BIST_DUMP_CTRL_BIST_FAIL_MASK (0x20000U) -#define FMUTEST_BIST_DUMP_CTRL_BIST_FAIL_SHIFT (17U) -/*! BIST_FAIL - BIST Fail - * 0b0..The last BIST operation completed successfully (or could not fail) - * 0b1..The last BIST operation failed - */ -#define FMUTEST_BIST_DUMP_CTRL_BIST_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_BIST_FAIL_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_BIST_FAIL_MASK) - -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MASK (0x40000U) -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_SHIFT (18U) -/*! DATADUMP - Data Dump Enable */ -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_DATADUMP_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_DATADUMP_MASK) - -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_TRIG_MASK (0x80000U) -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_TRIG_SHIFT (19U) -/*! DATADUMP_TRIG - Data Dump Trigger */ -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_TRIG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_DATADUMP_TRIG_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_DATADUMP_TRIG_MASK) - -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_PATT_MASK (0x300000U) -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_PATT_SHIFT (20U) -/*! DATADUMP_PATT - Data Dump Pattern Select - * 0b00..All ones - * 0b01..All zeroes - * 0b10..Checkerboard - * 0b11..Inverse checkerboard - */ -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_PATT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_DATADUMP_PATT_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_DATADUMP_PATT_MASK) - -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGEN_MASK (0x400000U) -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGEN_SHIFT (22U) -/*! DATADUMP_MRGEN - Data Dump Margin Enable - * 0b0..Normal read pulse shape - * 0b1..Margin read pulse shape - */ -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGEN_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGEN_MASK) - -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGTYPE_MASK (0x800000U) -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGTYPE_SHIFT (23U) -/*! DATADUMP_MRGTYPE - Data Dump Margin Type - * 0b0..DIN method used - * 0b1..TM method used - */ -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGTYPE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGTYPE_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGTYPE_MASK) -/*! @} */ - -/*! @name ATX_PIN_CTRL - ATX Pin Control Register */ -/*! @{ */ - -#define FMUTEST_ATX_PIN_CTRL_TM_TO_ATX_MASK (0xFFU) -#define FMUTEST_ATX_PIN_CTRL_TM_TO_ATX_SHIFT (0U) -/*! TM_TO_ATX - TM to ATX - * 0b00000001..TM[0] to ATX0 - * 0b00000010..TM[1] to ATX0 - * 0b00000100..TM[2] to ATX0 - * 0b00001000..TM[3] to ATX0 - * 0b00010000..TM[0] to ATX1 - * 0b00100000..TM[1] to ATX1 - * 0b01000000..TM[2] to ATX1 - * 0b10000000..TM[3] to ATX1 - */ -#define FMUTEST_ATX_PIN_CTRL_TM_TO_ATX(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_ATX_PIN_CTRL_TM_TO_ATX_SHIFT)) & FMUTEST_ATX_PIN_CTRL_TM_TO_ATX_MASK) -/*! @} */ - -/*! @name FAILCNT - Fail Count Register */ -/*! @{ */ - -#define FMUTEST_FAILCNT_FAILCNT_MASK (0xFFFFFFFFU) -#define FMUTEST_FAILCNT_FAILCNT_SHIFT (0U) -/*! FAILCNT - Fail Count */ -#define FMUTEST_FAILCNT_FAILCNT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FAILCNT_FAILCNT_SHIFT)) & FMUTEST_FAILCNT_FAILCNT_MASK) -/*! @} */ - -/*! @name PGM_PULSE_CNT0 - Block 0 Program Pulse Count Register */ -/*! @{ */ - -#define FMUTEST_PGM_PULSE_CNT0_PGM_CNT0_MASK (0xFFFFFFFFU) -#define FMUTEST_PGM_PULSE_CNT0_PGM_CNT0_SHIFT (0U) -/*! PGM_CNT0 - Program Pulse Count */ -#define FMUTEST_PGM_PULSE_CNT0_PGM_CNT0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PGM_PULSE_CNT0_PGM_CNT0_SHIFT)) & FMUTEST_PGM_PULSE_CNT0_PGM_CNT0_MASK) -/*! @} */ - -/*! @name PGM_PULSE_CNT1 - Block 1 Program Pulse Count Register */ -/*! @{ */ - -#define FMUTEST_PGM_PULSE_CNT1_PGM_CNT1_MASK (0xFFFFFFFFU) -#define FMUTEST_PGM_PULSE_CNT1_PGM_CNT1_SHIFT (0U) -/*! PGM_CNT1 - Program Pulse Count */ -#define FMUTEST_PGM_PULSE_CNT1_PGM_CNT1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PGM_PULSE_CNT1_PGM_CNT1_SHIFT)) & FMUTEST_PGM_PULSE_CNT1_PGM_CNT1_MASK) -/*! @} */ - -/*! @name ERS_PULSE_CNT - Erase Pulse Count Register */ -/*! @{ */ - -#define FMUTEST_ERS_PULSE_CNT_ERS_CNT0_MASK (0xFFFFU) -#define FMUTEST_ERS_PULSE_CNT_ERS_CNT0_SHIFT (0U) -/*! ERS_CNT0 - Block 0 Erase Pulse Count */ -#define FMUTEST_ERS_PULSE_CNT_ERS_CNT0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_ERS_PULSE_CNT_ERS_CNT0_SHIFT)) & FMUTEST_ERS_PULSE_CNT_ERS_CNT0_MASK) - -#define FMUTEST_ERS_PULSE_CNT_ERS_CNT1_MASK (0xFFFF0000U) -#define FMUTEST_ERS_PULSE_CNT_ERS_CNT1_SHIFT (16U) -/*! ERS_CNT1 - Block 1 Erase Pulse Count */ -#define FMUTEST_ERS_PULSE_CNT_ERS_CNT1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_ERS_PULSE_CNT_ERS_CNT1_SHIFT)) & FMUTEST_ERS_PULSE_CNT_ERS_CNT1_MASK) -/*! @} */ - -/*! @name MAX_PULSE_CNT - Maximum Pulse Count Register */ -/*! @{ */ - -#define FMUTEST_MAX_PULSE_CNT_LAST_PCNT_MASK (0x1FFU) -#define FMUTEST_MAX_PULSE_CNT_LAST_PCNT_SHIFT (0U) -/*! LAST_PCNT - Last SMW Operation's Pulse Count */ -#define FMUTEST_MAX_PULSE_CNT_LAST_PCNT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MAX_PULSE_CNT_LAST_PCNT_SHIFT)) & FMUTEST_MAX_PULSE_CNT_LAST_PCNT_MASK) - -#define FMUTEST_MAX_PULSE_CNT_MAX_ERS_CNT_MASK (0x1FF0000U) -#define FMUTEST_MAX_PULSE_CNT_MAX_ERS_CNT_SHIFT (16U) -/*! MAX_ERS_CNT - Maximum Erase Pulse Count */ -#define FMUTEST_MAX_PULSE_CNT_MAX_ERS_CNT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MAX_PULSE_CNT_MAX_ERS_CNT_SHIFT)) & FMUTEST_MAX_PULSE_CNT_MAX_ERS_CNT_MASK) - -#define FMUTEST_MAX_PULSE_CNT_MAX_PGM_CNT_MASK (0xF8000000U) -#define FMUTEST_MAX_PULSE_CNT_MAX_PGM_CNT_SHIFT (27U) -/*! MAX_PGM_CNT - Maximum Program Pulse Count */ -#define FMUTEST_MAX_PULSE_CNT_MAX_PGM_CNT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MAX_PULSE_CNT_MAX_PGM_CNT_SHIFT)) & FMUTEST_MAX_PULSE_CNT_MAX_PGM_CNT_MASK) -/*! @} */ - -/*! @name PORT_CTRL - Port Control Register */ -/*! @{ */ - -#define FMUTEST_PORT_CTRL_BDONE_SEL_MASK (0x3U) -#define FMUTEST_PORT_CTRL_BDONE_SEL_SHIFT (0U) -/*! BDONE_SEL - BIST Done Select - * 0b00..Select internal bist_done signal from current module instantiation - * 0b01..Select ipt_bist_fail signal from current module instantiation - * 0b10..Select ipt_bist_done signal from other module instantiation - * 0b11..Select AND of internal bist_done signal from current module instantiation with ipt_bist_done signal from other module instantiation - */ -#define FMUTEST_PORT_CTRL_BDONE_SEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PORT_CTRL_BDONE_SEL_SHIFT)) & FMUTEST_PORT_CTRL_BDONE_SEL_MASK) - -#define FMUTEST_PORT_CTRL_BSDO_SEL_MASK (0xCU) -#define FMUTEST_PORT_CTRL_BSDO_SEL_SHIFT (2U) -/*! BSDO_SEL - BIST Serial Data Output Select - * 0b00..Select internal bist_sdo signal from current module instantiation - * 0b01..Select ipt_bist_done signal from current module instantiation - * 0b10..Select ipt_bist_sdo signal from other module instantiation - * 0b11..Select ipt_bist_done signal from other module instantiation - */ -#define FMUTEST_PORT_CTRL_BSDO_SEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PORT_CTRL_BSDO_SEL_SHIFT)) & FMUTEST_PORT_CTRL_BSDO_SEL_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group FMUTEST_Register_Masks */ - - -/* FMUTEST - Peripheral instance base addresses */ -/** Peripheral FMU0TEST base address */ -#define FMU0TEST_BASE (0x40096000u) -/** Peripheral FMU0TEST base pointer */ -#define FMU0TEST ((FMUTEST_Type *)FMU0TEST_BASE) -/** Array initializer of FMUTEST peripheral base addresses */ -#define FMUTEST_BASE_ADDRS { FMU0TEST_BASE } -/** Array initializer of FMUTEST peripheral base pointers */ -#define FMUTEST_BASE_PTRS { FMU0TEST } - -/*! - * @} - */ /* end of group FMUTEST_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- FREQME Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FREQME_Peripheral_Access_Layer FREQME Peripheral Access Layer - * @{ - */ - -/** FREQME - Register Layout Typedef */ -typedef struct { - union { /* offset: 0x0 */ - __I uint32_t CTRL_R; /**< Control (in Read mode), offset: 0x0 */ - __O uint32_t CTRL_W; /**< Control (in Write mode), offset: 0x0 */ - }; - __IO uint32_t CTRLSTAT; /**< Control Status, offset: 0x4 */ - __IO uint32_t MIN; /**< Minimum, offset: 0x8 */ - __IO uint32_t MAX; /**< Maximum, offset: 0xC */ -} FREQME_Type; - -/* ---------------------------------------------------------------------------- - -- FREQME Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FREQME_Register_Masks FREQME Register Masks - * @{ - */ - -/*! @name CTRL_R - Control (in Read mode) */ -/*! @{ */ - -#define FREQME_CTRL_R_RESULT_MASK (0x7FFFFFFFU) -#define FREQME_CTRL_R_RESULT_SHIFT (0U) -#define FREQME_CTRL_R_RESULT(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_R_RESULT_SHIFT)) & FREQME_CTRL_R_RESULT_MASK) - -#define FREQME_CTRL_R_MEASURE_IN_PROGRESS_MASK (0x80000000U) -#define FREQME_CTRL_R_MEASURE_IN_PROGRESS_SHIFT (31U) -/*! MEASURE_IN_PROGRESS - Measurement In Progress - * 0b0..Complete - * 0b1..In progress - */ -#define FREQME_CTRL_R_MEASURE_IN_PROGRESS(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_R_MEASURE_IN_PROGRESS_SHIFT)) & FREQME_CTRL_R_MEASURE_IN_PROGRESS_MASK) -/*! @} */ - -/*! @name CTRL_W - Control (in Write mode) */ -/*! @{ */ - -#define FREQME_CTRL_W_REF_SCALE_MASK (0x1FU) -#define FREQME_CTRL_W_REF_SCALE_SHIFT (0U) -/*! REF_SCALE - Reference Clock Scaling Factor */ -#define FREQME_CTRL_W_REF_SCALE(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_REF_SCALE_SHIFT)) & FREQME_CTRL_W_REF_SCALE_MASK) - -#define FREQME_CTRL_W_PULSE_MODE_MASK (0x100U) -#define FREQME_CTRL_W_PULSE_MODE_SHIFT (8U) -/*! PULSE_MODE - Pulse Width Measurement Mode Select - * 0b0..Frequency Measurement mode - * 0b1..Pulse Width Measurement mode - */ -#define FREQME_CTRL_W_PULSE_MODE(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_PULSE_MODE_SHIFT)) & FREQME_CTRL_W_PULSE_MODE_MASK) - -#define FREQME_CTRL_W_PULSE_POL_MASK (0x200U) -#define FREQME_CTRL_W_PULSE_POL_SHIFT (9U) -/*! PULSE_POL - Pulse Polarity - * 0b0..High period - * 0b1..Low period - */ -#define FREQME_CTRL_W_PULSE_POL(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_PULSE_POL_SHIFT)) & FREQME_CTRL_W_PULSE_POL_MASK) - -#define FREQME_CTRL_W_LT_MIN_INT_EN_MASK (0x1000U) -#define FREQME_CTRL_W_LT_MIN_INT_EN_SHIFT (12U) -/*! LT_MIN_INT_EN - Less Than Minimum Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FREQME_CTRL_W_LT_MIN_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_LT_MIN_INT_EN_SHIFT)) & FREQME_CTRL_W_LT_MIN_INT_EN_MASK) - -#define FREQME_CTRL_W_GT_MAX_INT_EN_MASK (0x2000U) -#define FREQME_CTRL_W_GT_MAX_INT_EN_SHIFT (13U) -/*! GT_MAX_INT_EN - Greater Than Maximum Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FREQME_CTRL_W_GT_MAX_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_GT_MAX_INT_EN_SHIFT)) & FREQME_CTRL_W_GT_MAX_INT_EN_MASK) - -#define FREQME_CTRL_W_RESULT_READY_INT_EN_MASK (0x4000U) -#define FREQME_CTRL_W_RESULT_READY_INT_EN_SHIFT (14U) -/*! RESULT_READY_INT_EN - Result Ready Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FREQME_CTRL_W_RESULT_READY_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_RESULT_READY_INT_EN_SHIFT)) & FREQME_CTRL_W_RESULT_READY_INT_EN_MASK) - -#define FREQME_CTRL_W_CONTINUOUS_MODE_EN_MASK (0x40000000U) -#define FREQME_CTRL_W_CONTINUOUS_MODE_EN_SHIFT (30U) -/*! CONTINUOUS_MODE_EN - Continuous Mode Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FREQME_CTRL_W_CONTINUOUS_MODE_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_CONTINUOUS_MODE_EN_SHIFT)) & FREQME_CTRL_W_CONTINUOUS_MODE_EN_MASK) - -#define FREQME_CTRL_W_MEASURE_IN_PROGRESS_MASK (0x80000000U) -#define FREQME_CTRL_W_MEASURE_IN_PROGRESS_SHIFT (31U) -/*! MEASURE_IN_PROGRESS - Measurement In Progress - * 0b0..Terminates measurement - * 0b1..Initiates measurement - */ -#define FREQME_CTRL_W_MEASURE_IN_PROGRESS(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_MEASURE_IN_PROGRESS_SHIFT)) & FREQME_CTRL_W_MEASURE_IN_PROGRESS_MASK) -/*! @} */ - -/*! @name CTRLSTAT - Control Status */ -/*! @{ */ - -#define FREQME_CTRLSTAT_REF_SCALE_MASK (0x1FU) -#define FREQME_CTRLSTAT_REF_SCALE_SHIFT (0U) -/*! REF_SCALE - Reference Scale */ -#define FREQME_CTRLSTAT_REF_SCALE(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_REF_SCALE_SHIFT)) & FREQME_CTRLSTAT_REF_SCALE_MASK) - -#define FREQME_CTRLSTAT_PULSE_MODE_MASK (0x100U) -#define FREQME_CTRLSTAT_PULSE_MODE_SHIFT (8U) -/*! PULSE_MODE - Pulse Mode - * 0b0..Frequency Measurement mode - * 0b1..Pulse Width Measurement mode - */ -#define FREQME_CTRLSTAT_PULSE_MODE(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_PULSE_MODE_SHIFT)) & FREQME_CTRLSTAT_PULSE_MODE_MASK) - -#define FREQME_CTRLSTAT_PULSE_POL_MASK (0x200U) -#define FREQME_CTRLSTAT_PULSE_POL_SHIFT (9U) -/*! PULSE_POL - Pulse Polarity - * 0b0..High period - * 0b1..Low period - */ -#define FREQME_CTRLSTAT_PULSE_POL(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_PULSE_POL_SHIFT)) & FREQME_CTRLSTAT_PULSE_POL_MASK) - -#define FREQME_CTRLSTAT_LT_MIN_INT_EN_MASK (0x1000U) -#define FREQME_CTRLSTAT_LT_MIN_INT_EN_SHIFT (12U) -/*! LT_MIN_INT_EN - Less Than Minimum Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define FREQME_CTRLSTAT_LT_MIN_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_LT_MIN_INT_EN_SHIFT)) & FREQME_CTRLSTAT_LT_MIN_INT_EN_MASK) - -#define FREQME_CTRLSTAT_GT_MAX_INT_EN_MASK (0x2000U) -#define FREQME_CTRLSTAT_GT_MAX_INT_EN_SHIFT (13U) -/*! GT_MAX_INT_EN - Greater Than Maximum Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define FREQME_CTRLSTAT_GT_MAX_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_GT_MAX_INT_EN_SHIFT)) & FREQME_CTRLSTAT_GT_MAX_INT_EN_MASK) - -#define FREQME_CTRLSTAT_RESULT_READY_INT_EN_MASK (0x4000U) -#define FREQME_CTRLSTAT_RESULT_READY_INT_EN_SHIFT (14U) -/*! RESULT_READY_INT_EN - Result Ready Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define FREQME_CTRLSTAT_RESULT_READY_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_RESULT_READY_INT_EN_SHIFT)) & FREQME_CTRLSTAT_RESULT_READY_INT_EN_MASK) - -#define FREQME_CTRLSTAT_LT_MIN_STAT_MASK (0x1000000U) -#define FREQME_CTRLSTAT_LT_MIN_STAT_SHIFT (24U) -/*! LT_MIN_STAT - Less Than Minimum Results Status - * 0b0..Greater than MIN[MIN_VALUE] - * 0b1..Less than MIN[MIN_VALUE] - */ -#define FREQME_CTRLSTAT_LT_MIN_STAT(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_LT_MIN_STAT_SHIFT)) & FREQME_CTRLSTAT_LT_MIN_STAT_MASK) - -#define FREQME_CTRLSTAT_GT_MAX_STAT_MASK (0x2000000U) -#define FREQME_CTRLSTAT_GT_MAX_STAT_SHIFT (25U) -/*! GT_MAX_STAT - Greater Than Maximum Result Status - * 0b0..Less than MAX[MAX_VALUE] - * 0b1..Greater than MAX[MAX_VALUE] - */ -#define FREQME_CTRLSTAT_GT_MAX_STAT(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_GT_MAX_STAT_SHIFT)) & FREQME_CTRLSTAT_GT_MAX_STAT_MASK) - -#define FREQME_CTRLSTAT_RESULT_READY_STAT_MASK (0x4000000U) -#define FREQME_CTRLSTAT_RESULT_READY_STAT_SHIFT (26U) -/*! RESULT_READY_STAT - Result Ready Status - * 0b0..Not complete - * 0b1..Complete - */ -#define FREQME_CTRLSTAT_RESULT_READY_STAT(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_RESULT_READY_STAT_SHIFT)) & FREQME_CTRLSTAT_RESULT_READY_STAT_MASK) - -#define FREQME_CTRLSTAT_CONTINUOUS_MODE_EN_MASK (0x40000000U) -#define FREQME_CTRLSTAT_CONTINUOUS_MODE_EN_SHIFT (30U) -/*! CONTINUOUS_MODE_EN - Continuous Mode Enable Status - * 0b0..Disabled - * 0b1..Enabled - */ -#define FREQME_CTRLSTAT_CONTINUOUS_MODE_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_CONTINUOUS_MODE_EN_SHIFT)) & FREQME_CTRLSTAT_CONTINUOUS_MODE_EN_MASK) - -#define FREQME_CTRLSTAT_MEASURE_IN_PROGRESS_MASK (0x80000000U) -#define FREQME_CTRLSTAT_MEASURE_IN_PROGRESS_SHIFT (31U) -/*! MEASURE_IN_PROGRESS - Measurement in Progress Status - * 0b0..Not in progress - * 0b1..In progress - */ -#define FREQME_CTRLSTAT_MEASURE_IN_PROGRESS(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_MEASURE_IN_PROGRESS_SHIFT)) & FREQME_CTRLSTAT_MEASURE_IN_PROGRESS_MASK) -/*! @} */ - -/*! @name MIN - Minimum */ -/*! @{ */ - -#define FREQME_MIN_MIN_VALUE_MASK (0x7FFFFFFFU) -#define FREQME_MIN_MIN_VALUE_SHIFT (0U) -/*! MIN_VALUE - Minimum Value */ -#define FREQME_MIN_MIN_VALUE(x) (((uint32_t)(((uint32_t)(x)) << FREQME_MIN_MIN_VALUE_SHIFT)) & FREQME_MIN_MIN_VALUE_MASK) -/*! @} */ - -/*! @name MAX - Maximum */ -/*! @{ */ - -#define FREQME_MAX_MAX_VALUE_MASK (0x7FFFFFFFU) -#define FREQME_MAX_MAX_VALUE_SHIFT (0U) -/*! MAX_VALUE - Maximum Value */ -#define FREQME_MAX_MAX_VALUE(x) (((uint32_t)(((uint32_t)(x)) << FREQME_MAX_MAX_VALUE_SHIFT)) & FREQME_MAX_MAX_VALUE_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group FREQME_Register_Masks */ - - -/* FREQME - Peripheral instance base addresses */ -/** Peripheral FREQME0 base address */ -#define FREQME0_BASE (0x40009000u) -/** Peripheral FREQME0 base pointer */ -#define FREQME0 ((FREQME_Type *)FREQME0_BASE) -/** Array initializer of FREQME peripheral base addresses */ -#define FREQME_BASE_ADDRS { FREQME0_BASE } -/** Array initializer of FREQME peripheral base pointers */ -#define FREQME_BASE_PTRS { FREQME0 } - -/*! - * @} - */ /* end of group FREQME_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- GLIKEY Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup GLIKEY_Peripheral_Access_Layer GLIKEY Peripheral Access Layer - * @{ - */ - -/** GLIKEY - Register Layout Typedef */ -typedef struct { - __IO uint32_t CTRL_0; /**< Control Register 0 SFR, offset: 0x0 */ - __IO uint32_t CTRL_1; /**< Control Regsiter 1 SFR, offset: 0x4 */ - __IO uint32_t INTR_CTRL; /**< Interrupt Control, offset: 0x8 */ - __I uint32_t STATUS; /**< Status, offset: 0xC */ - uint8_t RESERVED_0[236]; - __I uint32_t VERSION; /**< IP Version, offset: 0xFC */ -} GLIKEY_Type; - -/* ---------------------------------------------------------------------------- - -- GLIKEY Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup GLIKEY_Register_Masks GLIKEY Register Masks - * @{ - */ - -/*! @name CTRL_0 - Control Register 0 SFR */ -/*! @{ */ - -#define GLIKEY_CTRL_0_WRITE_INDEX_MASK (0xFFU) -#define GLIKEY_CTRL_0_WRITE_INDEX_SHIFT (0U) -/*! WRITE_INDEX - Write Index */ -#define GLIKEY_CTRL_0_WRITE_INDEX(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_CTRL_0_WRITE_INDEX_SHIFT)) & GLIKEY_CTRL_0_WRITE_INDEX_MASK) - -#define GLIKEY_CTRL_0_RESERVED15_MASK (0xFF00U) -#define GLIKEY_CTRL_0_RESERVED15_SHIFT (8U) -/*! RESERVED15 - Reserved for Future Use */ -#define GLIKEY_CTRL_0_RESERVED15(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_CTRL_0_RESERVED15_SHIFT)) & GLIKEY_CTRL_0_RESERVED15_MASK) - -#define GLIKEY_CTRL_0_WR_EN_0_MASK (0x30000U) -#define GLIKEY_CTRL_0_WR_EN_0_SHIFT (16U) -/*! WR_EN_0 - Write Enable 0 */ -#define GLIKEY_CTRL_0_WR_EN_0(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_CTRL_0_WR_EN_0_SHIFT)) & GLIKEY_CTRL_0_WR_EN_0_MASK) - -#define GLIKEY_CTRL_0_SFT_RST_MASK (0x40000U) -#define GLIKEY_CTRL_0_SFT_RST_SHIFT (18U) -/*! SFT_RST - Soft reset for the core reset (SFR configuration will be preseved).This register reads as 0 - * 0b0..No effect - * 0b1..Triggers the soft reset - */ -#define GLIKEY_CTRL_0_SFT_RST(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_CTRL_0_SFT_RST_SHIFT)) & GLIKEY_CTRL_0_SFT_RST_MASK) - -#define GLIKEY_CTRL_0_RESERVED31_MASK (0xFFF80000U) -#define GLIKEY_CTRL_0_RESERVED31_SHIFT (19U) -/*! RESERVED31 - Reserved for Future Use */ -#define GLIKEY_CTRL_0_RESERVED31(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_CTRL_0_RESERVED31_SHIFT)) & GLIKEY_CTRL_0_RESERVED31_MASK) -/*! @} */ - -/*! @name CTRL_1 - Control Regsiter 1 SFR */ -/*! @{ */ - -#define GLIKEY_CTRL_1_READ_INDEX_MASK (0xFFU) -#define GLIKEY_CTRL_1_READ_INDEX_SHIFT (0U) -/*! READ_INDEX - Index status, Writing an index value to this register will request the block to return the lock status of this index. */ -#define GLIKEY_CTRL_1_READ_INDEX(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_CTRL_1_READ_INDEX_SHIFT)) & GLIKEY_CTRL_1_READ_INDEX_MASK) - -#define GLIKEY_CTRL_1_RESERVED15_MASK (0xFF00U) -#define GLIKEY_CTRL_1_RESERVED15_SHIFT (8U) -/*! RESERVED15 - Reserved for Future Use */ -#define GLIKEY_CTRL_1_RESERVED15(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_CTRL_1_RESERVED15_SHIFT)) & GLIKEY_CTRL_1_RESERVED15_MASK) - -#define GLIKEY_CTRL_1_WR_EN_1_MASK (0x30000U) -#define GLIKEY_CTRL_1_WR_EN_1_SHIFT (16U) -/*! WR_EN_1 - Write Enable One */ -#define GLIKEY_CTRL_1_WR_EN_1(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_CTRL_1_WR_EN_1_SHIFT)) & GLIKEY_CTRL_1_WR_EN_1_MASK) - -#define GLIKEY_CTRL_1_SFR_LOCK_MASK (0x3C0000U) -#define GLIKEY_CTRL_1_SFR_LOCK_SHIFT (18U) -/*! SFR_LOCK - LOCK register for GLIKEY */ -#define GLIKEY_CTRL_1_SFR_LOCK(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_CTRL_1_SFR_LOCK_SHIFT)) & GLIKEY_CTRL_1_SFR_LOCK_MASK) - -#define GLIKEY_CTRL_1_RESERVED31_MASK (0xFFC00000U) -#define GLIKEY_CTRL_1_RESERVED31_SHIFT (22U) -/*! RESERVED31 - Reserved for Future Use */ -#define GLIKEY_CTRL_1_RESERVED31(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_CTRL_1_RESERVED31_SHIFT)) & GLIKEY_CTRL_1_RESERVED31_MASK) -/*! @} */ - -/*! @name INTR_CTRL - Interrupt Control */ -/*! @{ */ - -#define GLIKEY_INTR_CTRL_INT_EN_MASK (0x1U) -#define GLIKEY_INTR_CTRL_INT_EN_SHIFT (0U) -/*! INT_EN - Interrupt Enable. Writing a 1, Interrupt asserts on Interrupt output port */ -#define GLIKEY_INTR_CTRL_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_INTR_CTRL_INT_EN_SHIFT)) & GLIKEY_INTR_CTRL_INT_EN_MASK) - -#define GLIKEY_INTR_CTRL_INT_CLR_MASK (0x2U) -#define GLIKEY_INTR_CTRL_INT_CLR_SHIFT (1U) -/*! INT_CLR - Interrupt Clear. Writing a 1 to this register creates a single interrupt clear pulse. This register reads as 0 */ -#define GLIKEY_INTR_CTRL_INT_CLR(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_INTR_CTRL_INT_CLR_SHIFT)) & GLIKEY_INTR_CTRL_INT_CLR_MASK) - -#define GLIKEY_INTR_CTRL_INT_SET_MASK (0x4U) -#define GLIKEY_INTR_CTRL_INT_SET_SHIFT (2U) -/*! INT_SET - Interrupt Set. Writing a 1 to this register asserts the interrupt. This register reads as 0 - * 0b0..No effect - * 0b1..Triggers interrupt - */ -#define GLIKEY_INTR_CTRL_INT_SET(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_INTR_CTRL_INT_SET_SHIFT)) & GLIKEY_INTR_CTRL_INT_SET_MASK) - -#define GLIKEY_INTR_CTRL_RESERVED31_MASK (0xFFFFFFF8U) -#define GLIKEY_INTR_CTRL_RESERVED31_SHIFT (3U) -/*! RESERVED31 - Reserved for Future Use */ -#define GLIKEY_INTR_CTRL_RESERVED31(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_INTR_CTRL_RESERVED31_SHIFT)) & GLIKEY_INTR_CTRL_RESERVED31_MASK) -/*! @} */ - -/*! @name STATUS - Status */ -/*! @{ */ - -#define GLIKEY_STATUS_INT_STATUS_MASK (0x1U) -#define GLIKEY_STATUS_INT_STATUS_SHIFT (0U) -/*! INT_STATUS - Interrupt Status. - * 0b0..No effect - * 0b1..Triggers interrupt - */ -#define GLIKEY_STATUS_INT_STATUS(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_STATUS_INT_STATUS_SHIFT)) & GLIKEY_STATUS_INT_STATUS_MASK) - -#define GLIKEY_STATUS_LOCK_STATUS_MASK (0x2U) -#define GLIKEY_STATUS_LOCK_STATUS_SHIFT (1U) -/*! LOCK_STATUS - Provides the current lock status of indexes. - * 0b0..Current read index is not locked - * 0b1..Current read index is locked - */ -#define GLIKEY_STATUS_LOCK_STATUS(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_STATUS_LOCK_STATUS_SHIFT)) & GLIKEY_STATUS_LOCK_STATUS_MASK) - -#define GLIKEY_STATUS_ERROR_STATUS_MASK (0x1CU) -#define GLIKEY_STATUS_ERROR_STATUS_SHIFT (2U) -/*! ERROR_STATUS - Status of the Error - * 0b000..No error - * 0b001..FSM error has occurred - * 0b010..Write index out of the bound (OOB) error - * 0b011..Write index OOB and FSM error - * 0b100..Read index OOB error - * 0b110..Write index and read index OOB error - * 0b111..Read index OOB, write index OOB, and FSM error - */ -#define GLIKEY_STATUS_ERROR_STATUS(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_STATUS_ERROR_STATUS_SHIFT)) & GLIKEY_STATUS_ERROR_STATUS_MASK) - -#define GLIKEY_STATUS_RESERVED18_MASK (0x7FFE0U) -#define GLIKEY_STATUS_RESERVED18_SHIFT (5U) -/*! RESERVED18 - Reserved for Future Use */ -#define GLIKEY_STATUS_RESERVED18(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_STATUS_RESERVED18_SHIFT)) & GLIKEY_STATUS_RESERVED18_MASK) - -#define GLIKEY_STATUS_FSM_STATE_MASK (0xFFF80000U) -#define GLIKEY_STATUS_FSM_STATE_SHIFT (19U) -/*! FSM_STATE - Status of FSM */ -#define GLIKEY_STATUS_FSM_STATE(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_STATUS_FSM_STATE_SHIFT)) & GLIKEY_STATUS_FSM_STATE_MASK) -/*! @} */ - -/*! @name VERSION - IP Version */ -/*! @{ */ - -#define GLIKEY_VERSION_RESERVED3_MASK (0xFU) -#define GLIKEY_VERSION_RESERVED3_SHIFT (0U) -/*! Reserved3 - Reserved */ -#define GLIKEY_VERSION_RESERVED3(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_VERSION_RESERVED3_SHIFT)) & GLIKEY_VERSION_RESERVED3_MASK) - -#define GLIKEY_VERSION_RESERVED7_MASK (0xF0U) -#define GLIKEY_VERSION_RESERVED7_SHIFT (4U) -/*! Reserved7 - Reserved */ -#define GLIKEY_VERSION_RESERVED7(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_VERSION_RESERVED7_SHIFT)) & GLIKEY_VERSION_RESERVED7_MASK) - -#define GLIKEY_VERSION_RESERVED11_MASK (0xF00U) -#define GLIKEY_VERSION_RESERVED11_SHIFT (8U) -/*! Reserved11 - Reserved */ -#define GLIKEY_VERSION_RESERVED11(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_VERSION_RESERVED11_SHIFT)) & GLIKEY_VERSION_RESERVED11_MASK) - -#define GLIKEY_VERSION_RESERVED15_MASK (0xF000U) -#define GLIKEY_VERSION_RESERVED15_SHIFT (12U) -/*! Reserved15 - Reserved */ -#define GLIKEY_VERSION_RESERVED15(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_VERSION_RESERVED15_SHIFT)) & GLIKEY_VERSION_RESERVED15_MASK) - -#define GLIKEY_VERSION_RESERVED16_MASK (0x30000U) -#define GLIKEY_VERSION_RESERVED16_SHIFT (16U) -/*! Reserved16 - Reserved */ -#define GLIKEY_VERSION_RESERVED16(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_VERSION_RESERVED16_SHIFT)) & GLIKEY_VERSION_RESERVED16_MASK) - -#define GLIKEY_VERSION_FSM_CONFIG_MASK (0x40000U) -#define GLIKEY_VERSION_FSM_CONFIG_SHIFT (18U) -/*! FSM_CONFIG - 0:4 step, 1:8 step */ -#define GLIKEY_VERSION_FSM_CONFIG(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_VERSION_FSM_CONFIG_SHIFT)) & GLIKEY_VERSION_FSM_CONFIG_MASK) - -#define GLIKEY_VERSION_INDEX_CONFIG_MASK (0x7F80000U) -#define GLIKEY_VERSION_INDEX_CONFIG_SHIFT (19U) -/*! INDEX_CONFIG - Configured number of addressable indexes */ -#define GLIKEY_VERSION_INDEX_CONFIG(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_VERSION_INDEX_CONFIG_SHIFT)) & GLIKEY_VERSION_INDEX_CONFIG_MASK) - -#define GLIKEY_VERSION_RESERVED31_MASK (0xF8000000U) -#define GLIKEY_VERSION_RESERVED31_SHIFT (27U) -/*! Reserved31 - Reserved for Future Use */ -#define GLIKEY_VERSION_RESERVED31(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_VERSION_RESERVED31_SHIFT)) & GLIKEY_VERSION_RESERVED31_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group GLIKEY_Register_Masks */ - - -/* GLIKEY - Peripheral instance base addresses */ -/** Peripheral GLIKEY0 base address */ -#define GLIKEY0_BASE (0x40091D00u) -/** Peripheral GLIKEY0 base pointer */ -#define GLIKEY0 ((GLIKEY_Type *)GLIKEY0_BASE) -/** Array initializer of GLIKEY peripheral base addresses */ -#define GLIKEY_BASE_ADDRS { GLIKEY0_BASE } -/** Array initializer of GLIKEY peripheral base pointers */ -#define GLIKEY_BASE_PTRS { GLIKEY0 } - -/*! - * @} - */ /* end of group GLIKEY_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- GPIO Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup GPIO_Peripheral_Access_Layer GPIO Peripheral Access Layer - * @{ - */ - -/** GPIO - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - uint8_t RESERVED_0[56]; - __IO uint32_t PDOR; /**< Port Data Output, offset: 0x40 */ - __O uint32_t PSOR; /**< Port Set Output, offset: 0x44 */ - __O uint32_t PCOR; /**< Port Clear Output, offset: 0x48 */ - __O uint32_t PTOR; /**< Port Toggle Output, offset: 0x4C */ - __I uint32_t PDIR; /**< Port Data Input, offset: 0x50 */ - __IO uint32_t PDDR; /**< Port Data Direction, offset: 0x54 */ - __IO uint32_t PIDR; /**< Port Input Disable, offset: 0x58 */ - uint8_t RESERVED_1[4]; - __IO uint8_t PDR[32]; /**< Pin Data, array offset: 0x60, array step: 0x1 */ - __IO uint32_t ICR[32]; /**< Interrupt Control 0..Interrupt Control 31, array offset: 0x80, array step: 0x4 */ - __O uint32_t GICLR; /**< Global Interrupt Control Low, offset: 0x100 */ - __O uint32_t GICHR; /**< Global Interrupt Control High, offset: 0x104 */ - uint8_t RESERVED_2[24]; - __IO uint32_t ISFR[1]; /**< Interrupt Status Flag, array offset: 0x120, array step: 0x4 */ -} GPIO_Type; - -/* ---------------------------------------------------------------------------- - -- GPIO Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup GPIO_Register_Masks GPIO Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define GPIO_VERID_FEATURE_MASK (0xFFFFU) -#define GPIO_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Basic implementation - * 0b0000000000000001..Protection registers implemented - */ -#define GPIO_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << GPIO_VERID_FEATURE_SHIFT)) & GPIO_VERID_FEATURE_MASK) - -#define GPIO_VERID_MINOR_MASK (0xFF0000U) -#define GPIO_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define GPIO_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << GPIO_VERID_MINOR_SHIFT)) & GPIO_VERID_MINOR_MASK) - -#define GPIO_VERID_MAJOR_MASK (0xFF000000U) -#define GPIO_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define GPIO_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << GPIO_VERID_MAJOR_SHIFT)) & GPIO_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define GPIO_PARAM_IRQNUM_MASK (0xFU) -#define GPIO_PARAM_IRQNUM_SHIFT (0U) -/*! IRQNUM - Interrupt Number */ -#define GPIO_PARAM_IRQNUM(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PARAM_IRQNUM_SHIFT)) & GPIO_PARAM_IRQNUM_MASK) -/*! @} */ - -/*! @name PDOR - Port Data Output */ -/*! @{ */ - -#define GPIO_PDOR_PDO0_MASK (0x1U) -#define GPIO_PDOR_PDO0_SHIFT (0U) -/*! PDO0 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO0_SHIFT)) & GPIO_PDOR_PDO0_MASK) - -#define GPIO_PDOR_PDO1_MASK (0x2U) -#define GPIO_PDOR_PDO1_SHIFT (1U) -/*! PDO1 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO1_SHIFT)) & GPIO_PDOR_PDO1_MASK) - -#define GPIO_PDOR_PDO2_MASK (0x4U) -#define GPIO_PDOR_PDO2_SHIFT (2U) -/*! PDO2 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO2_SHIFT)) & GPIO_PDOR_PDO2_MASK) - -#define GPIO_PDOR_PDO3_MASK (0x8U) -#define GPIO_PDOR_PDO3_SHIFT (3U) -/*! PDO3 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO3_SHIFT)) & GPIO_PDOR_PDO3_MASK) - -#define GPIO_PDOR_PDO4_MASK (0x10U) -#define GPIO_PDOR_PDO4_SHIFT (4U) -/*! PDO4 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO4_SHIFT)) & GPIO_PDOR_PDO4_MASK) - -#define GPIO_PDOR_PDO5_MASK (0x20U) -#define GPIO_PDOR_PDO5_SHIFT (5U) -/*! PDO5 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO5_SHIFT)) & GPIO_PDOR_PDO5_MASK) - -#define GPIO_PDOR_PDO6_MASK (0x40U) -#define GPIO_PDOR_PDO6_SHIFT (6U) -/*! PDO6 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO6_SHIFT)) & GPIO_PDOR_PDO6_MASK) - -#define GPIO_PDOR_PDO7_MASK (0x80U) -#define GPIO_PDOR_PDO7_SHIFT (7U) -/*! PDO7 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO7_SHIFT)) & GPIO_PDOR_PDO7_MASK) - -#define GPIO_PDOR_PDO8_MASK (0x100U) -#define GPIO_PDOR_PDO8_SHIFT (8U) -/*! PDO8 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO8_SHIFT)) & GPIO_PDOR_PDO8_MASK) - -#define GPIO_PDOR_PDO9_MASK (0x200U) -#define GPIO_PDOR_PDO9_SHIFT (9U) -/*! PDO9 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO9_SHIFT)) & GPIO_PDOR_PDO9_MASK) - -#define GPIO_PDOR_PDO10_MASK (0x400U) -#define GPIO_PDOR_PDO10_SHIFT (10U) -/*! PDO10 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO10_SHIFT)) & GPIO_PDOR_PDO10_MASK) - -#define GPIO_PDOR_PDO11_MASK (0x800U) -#define GPIO_PDOR_PDO11_SHIFT (11U) -/*! PDO11 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO11_SHIFT)) & GPIO_PDOR_PDO11_MASK) - -#define GPIO_PDOR_PDO12_MASK (0x1000U) -#define GPIO_PDOR_PDO12_SHIFT (12U) -/*! PDO12 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO12_SHIFT)) & GPIO_PDOR_PDO12_MASK) - -#define GPIO_PDOR_PDO13_MASK (0x2000U) -#define GPIO_PDOR_PDO13_SHIFT (13U) -/*! PDO13 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO13_SHIFT)) & GPIO_PDOR_PDO13_MASK) - -#define GPIO_PDOR_PDO14_MASK (0x4000U) -#define GPIO_PDOR_PDO14_SHIFT (14U) -/*! PDO14 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO14_SHIFT)) & GPIO_PDOR_PDO14_MASK) - -#define GPIO_PDOR_PDO15_MASK (0x8000U) -#define GPIO_PDOR_PDO15_SHIFT (15U) -/*! PDO15 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO15_SHIFT)) & GPIO_PDOR_PDO15_MASK) - -#define GPIO_PDOR_PDO16_MASK (0x10000U) -#define GPIO_PDOR_PDO16_SHIFT (16U) -/*! PDO16 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO16_SHIFT)) & GPIO_PDOR_PDO16_MASK) - -#define GPIO_PDOR_PDO17_MASK (0x20000U) -#define GPIO_PDOR_PDO17_SHIFT (17U) -/*! PDO17 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO17_SHIFT)) & GPIO_PDOR_PDO17_MASK) - -#define GPIO_PDOR_PDO18_MASK (0x40000U) -#define GPIO_PDOR_PDO18_SHIFT (18U) -/*! PDO18 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO18_SHIFT)) & GPIO_PDOR_PDO18_MASK) - -#define GPIO_PDOR_PDO19_MASK (0x80000U) -#define GPIO_PDOR_PDO19_SHIFT (19U) -/*! PDO19 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO19_SHIFT)) & GPIO_PDOR_PDO19_MASK) - -#define GPIO_PDOR_PDO20_MASK (0x100000U) -#define GPIO_PDOR_PDO20_SHIFT (20U) -/*! PDO20 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO20_SHIFT)) & GPIO_PDOR_PDO20_MASK) - -#define GPIO_PDOR_PDO21_MASK (0x200000U) -#define GPIO_PDOR_PDO21_SHIFT (21U) -/*! PDO21 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO21_SHIFT)) & GPIO_PDOR_PDO21_MASK) - -#define GPIO_PDOR_PDO22_MASK (0x400000U) -#define GPIO_PDOR_PDO22_SHIFT (22U) -/*! PDO22 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO22_SHIFT)) & GPIO_PDOR_PDO22_MASK) - -#define GPIO_PDOR_PDO23_MASK (0x800000U) -#define GPIO_PDOR_PDO23_SHIFT (23U) -/*! PDO23 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO23_SHIFT)) & GPIO_PDOR_PDO23_MASK) - -#define GPIO_PDOR_PDO24_MASK (0x1000000U) -#define GPIO_PDOR_PDO24_SHIFT (24U) -/*! PDO24 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO24_SHIFT)) & GPIO_PDOR_PDO24_MASK) - -#define GPIO_PDOR_PDO25_MASK (0x2000000U) -#define GPIO_PDOR_PDO25_SHIFT (25U) -/*! PDO25 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO25_SHIFT)) & GPIO_PDOR_PDO25_MASK) - -#define GPIO_PDOR_PDO26_MASK (0x4000000U) -#define GPIO_PDOR_PDO26_SHIFT (26U) -/*! PDO26 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO26_SHIFT)) & GPIO_PDOR_PDO26_MASK) - -#define GPIO_PDOR_PDO27_MASK (0x8000000U) -#define GPIO_PDOR_PDO27_SHIFT (27U) -/*! PDO27 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO27_SHIFT)) & GPIO_PDOR_PDO27_MASK) - -#define GPIO_PDOR_PDO28_MASK (0x10000000U) -#define GPIO_PDOR_PDO28_SHIFT (28U) -/*! PDO28 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO28_SHIFT)) & GPIO_PDOR_PDO28_MASK) - -#define GPIO_PDOR_PDO29_MASK (0x20000000U) -#define GPIO_PDOR_PDO29_SHIFT (29U) -/*! PDO29 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO29_SHIFT)) & GPIO_PDOR_PDO29_MASK) - -#define GPIO_PDOR_PDO30_MASK (0x40000000U) -#define GPIO_PDOR_PDO30_SHIFT (30U) -/*! PDO30 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO30_SHIFT)) & GPIO_PDOR_PDO30_MASK) - -#define GPIO_PDOR_PDO31_MASK (0x80000000U) -#define GPIO_PDOR_PDO31_SHIFT (31U) -/*! PDO31 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO31_SHIFT)) & GPIO_PDOR_PDO31_MASK) -/*! @} */ - -/*! @name PSOR - Port Set Output */ -/*! @{ */ - -#define GPIO_PSOR_PTSO0_MASK (0x1U) -#define GPIO_PSOR_PTSO0_SHIFT (0U) -/*! PTSO0 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO0_SHIFT)) & GPIO_PSOR_PTSO0_MASK) - -#define GPIO_PSOR_PTSO1_MASK (0x2U) -#define GPIO_PSOR_PTSO1_SHIFT (1U) -/*! PTSO1 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO1_SHIFT)) & GPIO_PSOR_PTSO1_MASK) - -#define GPIO_PSOR_PTSO2_MASK (0x4U) -#define GPIO_PSOR_PTSO2_SHIFT (2U) -/*! PTSO2 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO2_SHIFT)) & GPIO_PSOR_PTSO2_MASK) - -#define GPIO_PSOR_PTSO3_MASK (0x8U) -#define GPIO_PSOR_PTSO3_SHIFT (3U) -/*! PTSO3 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO3_SHIFT)) & GPIO_PSOR_PTSO3_MASK) - -#define GPIO_PSOR_PTSO4_MASK (0x10U) -#define GPIO_PSOR_PTSO4_SHIFT (4U) -/*! PTSO4 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO4_SHIFT)) & GPIO_PSOR_PTSO4_MASK) - -#define GPIO_PSOR_PTSO5_MASK (0x20U) -#define GPIO_PSOR_PTSO5_SHIFT (5U) -/*! PTSO5 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO5_SHIFT)) & GPIO_PSOR_PTSO5_MASK) - -#define GPIO_PSOR_PTSO6_MASK (0x40U) -#define GPIO_PSOR_PTSO6_SHIFT (6U) -/*! PTSO6 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO6_SHIFT)) & GPIO_PSOR_PTSO6_MASK) - -#define GPIO_PSOR_PTSO7_MASK (0x80U) -#define GPIO_PSOR_PTSO7_SHIFT (7U) -/*! PTSO7 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO7_SHIFT)) & GPIO_PSOR_PTSO7_MASK) - -#define GPIO_PSOR_PTSO8_MASK (0x100U) -#define GPIO_PSOR_PTSO8_SHIFT (8U) -/*! PTSO8 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO8_SHIFT)) & GPIO_PSOR_PTSO8_MASK) - -#define GPIO_PSOR_PTSO9_MASK (0x200U) -#define GPIO_PSOR_PTSO9_SHIFT (9U) -/*! PTSO9 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO9_SHIFT)) & GPIO_PSOR_PTSO9_MASK) - -#define GPIO_PSOR_PTSO10_MASK (0x400U) -#define GPIO_PSOR_PTSO10_SHIFT (10U) -/*! PTSO10 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO10_SHIFT)) & GPIO_PSOR_PTSO10_MASK) - -#define GPIO_PSOR_PTSO11_MASK (0x800U) -#define GPIO_PSOR_PTSO11_SHIFT (11U) -/*! PTSO11 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO11_SHIFT)) & GPIO_PSOR_PTSO11_MASK) - -#define GPIO_PSOR_PTSO12_MASK (0x1000U) -#define GPIO_PSOR_PTSO12_SHIFT (12U) -/*! PTSO12 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO12_SHIFT)) & GPIO_PSOR_PTSO12_MASK) - -#define GPIO_PSOR_PTSO13_MASK (0x2000U) -#define GPIO_PSOR_PTSO13_SHIFT (13U) -/*! PTSO13 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO13_SHIFT)) & GPIO_PSOR_PTSO13_MASK) - -#define GPIO_PSOR_PTSO14_MASK (0x4000U) -#define GPIO_PSOR_PTSO14_SHIFT (14U) -/*! PTSO14 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO14_SHIFT)) & GPIO_PSOR_PTSO14_MASK) - -#define GPIO_PSOR_PTSO15_MASK (0x8000U) -#define GPIO_PSOR_PTSO15_SHIFT (15U) -/*! PTSO15 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO15_SHIFT)) & GPIO_PSOR_PTSO15_MASK) - -#define GPIO_PSOR_PTSO16_MASK (0x10000U) -#define GPIO_PSOR_PTSO16_SHIFT (16U) -/*! PTSO16 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO16_SHIFT)) & GPIO_PSOR_PTSO16_MASK) - -#define GPIO_PSOR_PTSO17_MASK (0x20000U) -#define GPIO_PSOR_PTSO17_SHIFT (17U) -/*! PTSO17 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO17_SHIFT)) & GPIO_PSOR_PTSO17_MASK) - -#define GPIO_PSOR_PTSO18_MASK (0x40000U) -#define GPIO_PSOR_PTSO18_SHIFT (18U) -/*! PTSO18 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO18_SHIFT)) & GPIO_PSOR_PTSO18_MASK) - -#define GPIO_PSOR_PTSO19_MASK (0x80000U) -#define GPIO_PSOR_PTSO19_SHIFT (19U) -/*! PTSO19 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO19_SHIFT)) & GPIO_PSOR_PTSO19_MASK) - -#define GPIO_PSOR_PTSO20_MASK (0x100000U) -#define GPIO_PSOR_PTSO20_SHIFT (20U) -/*! PTSO20 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO20_SHIFT)) & GPIO_PSOR_PTSO20_MASK) - -#define GPIO_PSOR_PTSO21_MASK (0x200000U) -#define GPIO_PSOR_PTSO21_SHIFT (21U) -/*! PTSO21 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO21_SHIFT)) & GPIO_PSOR_PTSO21_MASK) - -#define GPIO_PSOR_PTSO22_MASK (0x400000U) -#define GPIO_PSOR_PTSO22_SHIFT (22U) -/*! PTSO22 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO22_SHIFT)) & GPIO_PSOR_PTSO22_MASK) - -#define GPIO_PSOR_PTSO23_MASK (0x800000U) -#define GPIO_PSOR_PTSO23_SHIFT (23U) -/*! PTSO23 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO23_SHIFT)) & GPIO_PSOR_PTSO23_MASK) - -#define GPIO_PSOR_PTSO24_MASK (0x1000000U) -#define GPIO_PSOR_PTSO24_SHIFT (24U) -/*! PTSO24 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO24_SHIFT)) & GPIO_PSOR_PTSO24_MASK) - -#define GPIO_PSOR_PTSO25_MASK (0x2000000U) -#define GPIO_PSOR_PTSO25_SHIFT (25U) -/*! PTSO25 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO25_SHIFT)) & GPIO_PSOR_PTSO25_MASK) - -#define GPIO_PSOR_PTSO26_MASK (0x4000000U) -#define GPIO_PSOR_PTSO26_SHIFT (26U) -/*! PTSO26 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO26_SHIFT)) & GPIO_PSOR_PTSO26_MASK) - -#define GPIO_PSOR_PTSO27_MASK (0x8000000U) -#define GPIO_PSOR_PTSO27_SHIFT (27U) -/*! PTSO27 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO27_SHIFT)) & GPIO_PSOR_PTSO27_MASK) - -#define GPIO_PSOR_PTSO28_MASK (0x10000000U) -#define GPIO_PSOR_PTSO28_SHIFT (28U) -/*! PTSO28 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO28_SHIFT)) & GPIO_PSOR_PTSO28_MASK) - -#define GPIO_PSOR_PTSO29_MASK (0x20000000U) -#define GPIO_PSOR_PTSO29_SHIFT (29U) -/*! PTSO29 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO29_SHIFT)) & GPIO_PSOR_PTSO29_MASK) - -#define GPIO_PSOR_PTSO30_MASK (0x40000000U) -#define GPIO_PSOR_PTSO30_SHIFT (30U) -/*! PTSO30 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO30_SHIFT)) & GPIO_PSOR_PTSO30_MASK) - -#define GPIO_PSOR_PTSO31_MASK (0x80000000U) -#define GPIO_PSOR_PTSO31_SHIFT (31U) -/*! PTSO31 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO31_SHIFT)) & GPIO_PSOR_PTSO31_MASK) -/*! @} */ - -/*! @name PCOR - Port Clear Output */ -/*! @{ */ - -#define GPIO_PCOR_PTCO0_MASK (0x1U) -#define GPIO_PCOR_PTCO0_SHIFT (0U) -/*! PTCO0 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO0_SHIFT)) & GPIO_PCOR_PTCO0_MASK) - -#define GPIO_PCOR_PTCO1_MASK (0x2U) -#define GPIO_PCOR_PTCO1_SHIFT (1U) -/*! PTCO1 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO1_SHIFT)) & GPIO_PCOR_PTCO1_MASK) - -#define GPIO_PCOR_PTCO2_MASK (0x4U) -#define GPIO_PCOR_PTCO2_SHIFT (2U) -/*! PTCO2 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO2_SHIFT)) & GPIO_PCOR_PTCO2_MASK) - -#define GPIO_PCOR_PTCO3_MASK (0x8U) -#define GPIO_PCOR_PTCO3_SHIFT (3U) -/*! PTCO3 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO3_SHIFT)) & GPIO_PCOR_PTCO3_MASK) - -#define GPIO_PCOR_PTCO4_MASK (0x10U) -#define GPIO_PCOR_PTCO4_SHIFT (4U) -/*! PTCO4 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO4_SHIFT)) & GPIO_PCOR_PTCO4_MASK) - -#define GPIO_PCOR_PTCO5_MASK (0x20U) -#define GPIO_PCOR_PTCO5_SHIFT (5U) -/*! PTCO5 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO5_SHIFT)) & GPIO_PCOR_PTCO5_MASK) - -#define GPIO_PCOR_PTCO6_MASK (0x40U) -#define GPIO_PCOR_PTCO6_SHIFT (6U) -/*! PTCO6 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO6_SHIFT)) & GPIO_PCOR_PTCO6_MASK) - -#define GPIO_PCOR_PTCO7_MASK (0x80U) -#define GPIO_PCOR_PTCO7_SHIFT (7U) -/*! PTCO7 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO7_SHIFT)) & GPIO_PCOR_PTCO7_MASK) - -#define GPIO_PCOR_PTCO8_MASK (0x100U) -#define GPIO_PCOR_PTCO8_SHIFT (8U) -/*! PTCO8 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO8_SHIFT)) & GPIO_PCOR_PTCO8_MASK) - -#define GPIO_PCOR_PTCO9_MASK (0x200U) -#define GPIO_PCOR_PTCO9_SHIFT (9U) -/*! PTCO9 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO9_SHIFT)) & GPIO_PCOR_PTCO9_MASK) - -#define GPIO_PCOR_PTCO10_MASK (0x400U) -#define GPIO_PCOR_PTCO10_SHIFT (10U) -/*! PTCO10 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO10_SHIFT)) & GPIO_PCOR_PTCO10_MASK) - -#define GPIO_PCOR_PTCO11_MASK (0x800U) -#define GPIO_PCOR_PTCO11_SHIFT (11U) -/*! PTCO11 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO11_SHIFT)) & GPIO_PCOR_PTCO11_MASK) - -#define GPIO_PCOR_PTCO12_MASK (0x1000U) -#define GPIO_PCOR_PTCO12_SHIFT (12U) -/*! PTCO12 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO12_SHIFT)) & GPIO_PCOR_PTCO12_MASK) - -#define GPIO_PCOR_PTCO13_MASK (0x2000U) -#define GPIO_PCOR_PTCO13_SHIFT (13U) -/*! PTCO13 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO13_SHIFT)) & GPIO_PCOR_PTCO13_MASK) - -#define GPIO_PCOR_PTCO14_MASK (0x4000U) -#define GPIO_PCOR_PTCO14_SHIFT (14U) -/*! PTCO14 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO14_SHIFT)) & GPIO_PCOR_PTCO14_MASK) - -#define GPIO_PCOR_PTCO15_MASK (0x8000U) -#define GPIO_PCOR_PTCO15_SHIFT (15U) -/*! PTCO15 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO15_SHIFT)) & GPIO_PCOR_PTCO15_MASK) - -#define GPIO_PCOR_PTCO16_MASK (0x10000U) -#define GPIO_PCOR_PTCO16_SHIFT (16U) -/*! PTCO16 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO16_SHIFT)) & GPIO_PCOR_PTCO16_MASK) - -#define GPIO_PCOR_PTCO17_MASK (0x20000U) -#define GPIO_PCOR_PTCO17_SHIFT (17U) -/*! PTCO17 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO17_SHIFT)) & GPIO_PCOR_PTCO17_MASK) - -#define GPIO_PCOR_PTCO18_MASK (0x40000U) -#define GPIO_PCOR_PTCO18_SHIFT (18U) -/*! PTCO18 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO18_SHIFT)) & GPIO_PCOR_PTCO18_MASK) - -#define GPIO_PCOR_PTCO19_MASK (0x80000U) -#define GPIO_PCOR_PTCO19_SHIFT (19U) -/*! PTCO19 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO19_SHIFT)) & GPIO_PCOR_PTCO19_MASK) - -#define GPIO_PCOR_PTCO20_MASK (0x100000U) -#define GPIO_PCOR_PTCO20_SHIFT (20U) -/*! PTCO20 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO20_SHIFT)) & GPIO_PCOR_PTCO20_MASK) - -#define GPIO_PCOR_PTCO21_MASK (0x200000U) -#define GPIO_PCOR_PTCO21_SHIFT (21U) -/*! PTCO21 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO21_SHIFT)) & GPIO_PCOR_PTCO21_MASK) - -#define GPIO_PCOR_PTCO22_MASK (0x400000U) -#define GPIO_PCOR_PTCO22_SHIFT (22U) -/*! PTCO22 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO22_SHIFT)) & GPIO_PCOR_PTCO22_MASK) - -#define GPIO_PCOR_PTCO23_MASK (0x800000U) -#define GPIO_PCOR_PTCO23_SHIFT (23U) -/*! PTCO23 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO23_SHIFT)) & GPIO_PCOR_PTCO23_MASK) - -#define GPIO_PCOR_PTCO24_MASK (0x1000000U) -#define GPIO_PCOR_PTCO24_SHIFT (24U) -/*! PTCO24 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO24_SHIFT)) & GPIO_PCOR_PTCO24_MASK) - -#define GPIO_PCOR_PTCO25_MASK (0x2000000U) -#define GPIO_PCOR_PTCO25_SHIFT (25U) -/*! PTCO25 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO25_SHIFT)) & GPIO_PCOR_PTCO25_MASK) - -#define GPIO_PCOR_PTCO26_MASK (0x4000000U) -#define GPIO_PCOR_PTCO26_SHIFT (26U) -/*! PTCO26 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO26_SHIFT)) & GPIO_PCOR_PTCO26_MASK) - -#define GPIO_PCOR_PTCO27_MASK (0x8000000U) -#define GPIO_PCOR_PTCO27_SHIFT (27U) -/*! PTCO27 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO27_SHIFT)) & GPIO_PCOR_PTCO27_MASK) - -#define GPIO_PCOR_PTCO28_MASK (0x10000000U) -#define GPIO_PCOR_PTCO28_SHIFT (28U) -/*! PTCO28 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO28_SHIFT)) & GPIO_PCOR_PTCO28_MASK) - -#define GPIO_PCOR_PTCO29_MASK (0x20000000U) -#define GPIO_PCOR_PTCO29_SHIFT (29U) -/*! PTCO29 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO29_SHIFT)) & GPIO_PCOR_PTCO29_MASK) - -#define GPIO_PCOR_PTCO30_MASK (0x40000000U) -#define GPIO_PCOR_PTCO30_SHIFT (30U) -/*! PTCO30 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO30_SHIFT)) & GPIO_PCOR_PTCO30_MASK) - -#define GPIO_PCOR_PTCO31_MASK (0x80000000U) -#define GPIO_PCOR_PTCO31_SHIFT (31U) -/*! PTCO31 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO31_SHIFT)) & GPIO_PCOR_PTCO31_MASK) -/*! @} */ - -/*! @name PTOR - Port Toggle Output */ -/*! @{ */ - -#define GPIO_PTOR_PTTO0_MASK (0x1U) -#define GPIO_PTOR_PTTO0_SHIFT (0U) -/*! PTTO0 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO0_SHIFT)) & GPIO_PTOR_PTTO0_MASK) - -#define GPIO_PTOR_PTTO1_MASK (0x2U) -#define GPIO_PTOR_PTTO1_SHIFT (1U) -/*! PTTO1 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO1_SHIFT)) & GPIO_PTOR_PTTO1_MASK) - -#define GPIO_PTOR_PTTO2_MASK (0x4U) -#define GPIO_PTOR_PTTO2_SHIFT (2U) -/*! PTTO2 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO2_SHIFT)) & GPIO_PTOR_PTTO2_MASK) - -#define GPIO_PTOR_PTTO3_MASK (0x8U) -#define GPIO_PTOR_PTTO3_SHIFT (3U) -/*! PTTO3 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO3_SHIFT)) & GPIO_PTOR_PTTO3_MASK) - -#define GPIO_PTOR_PTTO4_MASK (0x10U) -#define GPIO_PTOR_PTTO4_SHIFT (4U) -/*! PTTO4 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO4_SHIFT)) & GPIO_PTOR_PTTO4_MASK) - -#define GPIO_PTOR_PTTO5_MASK (0x20U) -#define GPIO_PTOR_PTTO5_SHIFT (5U) -/*! PTTO5 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO5_SHIFT)) & GPIO_PTOR_PTTO5_MASK) - -#define GPIO_PTOR_PTTO6_MASK (0x40U) -#define GPIO_PTOR_PTTO6_SHIFT (6U) -/*! PTTO6 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO6_SHIFT)) & GPIO_PTOR_PTTO6_MASK) - -#define GPIO_PTOR_PTTO7_MASK (0x80U) -#define GPIO_PTOR_PTTO7_SHIFT (7U) -/*! PTTO7 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO7_SHIFT)) & GPIO_PTOR_PTTO7_MASK) - -#define GPIO_PTOR_PTTO8_MASK (0x100U) -#define GPIO_PTOR_PTTO8_SHIFT (8U) -/*! PTTO8 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO8_SHIFT)) & GPIO_PTOR_PTTO8_MASK) - -#define GPIO_PTOR_PTTO9_MASK (0x200U) -#define GPIO_PTOR_PTTO9_SHIFT (9U) -/*! PTTO9 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO9_SHIFT)) & GPIO_PTOR_PTTO9_MASK) - -#define GPIO_PTOR_PTTO10_MASK (0x400U) -#define GPIO_PTOR_PTTO10_SHIFT (10U) -/*! PTTO10 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO10_SHIFT)) & GPIO_PTOR_PTTO10_MASK) - -#define GPIO_PTOR_PTTO11_MASK (0x800U) -#define GPIO_PTOR_PTTO11_SHIFT (11U) -/*! PTTO11 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO11_SHIFT)) & GPIO_PTOR_PTTO11_MASK) - -#define GPIO_PTOR_PTTO12_MASK (0x1000U) -#define GPIO_PTOR_PTTO12_SHIFT (12U) -/*! PTTO12 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO12_SHIFT)) & GPIO_PTOR_PTTO12_MASK) - -#define GPIO_PTOR_PTTO13_MASK (0x2000U) -#define GPIO_PTOR_PTTO13_SHIFT (13U) -/*! PTTO13 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO13_SHIFT)) & GPIO_PTOR_PTTO13_MASK) - -#define GPIO_PTOR_PTTO14_MASK (0x4000U) -#define GPIO_PTOR_PTTO14_SHIFT (14U) -/*! PTTO14 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO14_SHIFT)) & GPIO_PTOR_PTTO14_MASK) - -#define GPIO_PTOR_PTTO15_MASK (0x8000U) -#define GPIO_PTOR_PTTO15_SHIFT (15U) -/*! PTTO15 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO15_SHIFT)) & GPIO_PTOR_PTTO15_MASK) - -#define GPIO_PTOR_PTTO16_MASK (0x10000U) -#define GPIO_PTOR_PTTO16_SHIFT (16U) -/*! PTTO16 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO16_SHIFT)) & GPIO_PTOR_PTTO16_MASK) - -#define GPIO_PTOR_PTTO17_MASK (0x20000U) -#define GPIO_PTOR_PTTO17_SHIFT (17U) -/*! PTTO17 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO17_SHIFT)) & GPIO_PTOR_PTTO17_MASK) - -#define GPIO_PTOR_PTTO18_MASK (0x40000U) -#define GPIO_PTOR_PTTO18_SHIFT (18U) -/*! PTTO18 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO18_SHIFT)) & GPIO_PTOR_PTTO18_MASK) - -#define GPIO_PTOR_PTTO19_MASK (0x80000U) -#define GPIO_PTOR_PTTO19_SHIFT (19U) -/*! PTTO19 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO19_SHIFT)) & GPIO_PTOR_PTTO19_MASK) - -#define GPIO_PTOR_PTTO20_MASK (0x100000U) -#define GPIO_PTOR_PTTO20_SHIFT (20U) -/*! PTTO20 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO20_SHIFT)) & GPIO_PTOR_PTTO20_MASK) - -#define GPIO_PTOR_PTTO21_MASK (0x200000U) -#define GPIO_PTOR_PTTO21_SHIFT (21U) -/*! PTTO21 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO21_SHIFT)) & GPIO_PTOR_PTTO21_MASK) - -#define GPIO_PTOR_PTTO22_MASK (0x400000U) -#define GPIO_PTOR_PTTO22_SHIFT (22U) -/*! PTTO22 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO22_SHIFT)) & GPIO_PTOR_PTTO22_MASK) - -#define GPIO_PTOR_PTTO23_MASK (0x800000U) -#define GPIO_PTOR_PTTO23_SHIFT (23U) -/*! PTTO23 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO23_SHIFT)) & GPIO_PTOR_PTTO23_MASK) - -#define GPIO_PTOR_PTTO24_MASK (0x1000000U) -#define GPIO_PTOR_PTTO24_SHIFT (24U) -/*! PTTO24 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO24_SHIFT)) & GPIO_PTOR_PTTO24_MASK) - -#define GPIO_PTOR_PTTO25_MASK (0x2000000U) -#define GPIO_PTOR_PTTO25_SHIFT (25U) -/*! PTTO25 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO25_SHIFT)) & GPIO_PTOR_PTTO25_MASK) - -#define GPIO_PTOR_PTTO26_MASK (0x4000000U) -#define GPIO_PTOR_PTTO26_SHIFT (26U) -/*! PTTO26 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO26_SHIFT)) & GPIO_PTOR_PTTO26_MASK) - -#define GPIO_PTOR_PTTO27_MASK (0x8000000U) -#define GPIO_PTOR_PTTO27_SHIFT (27U) -/*! PTTO27 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO27_SHIFT)) & GPIO_PTOR_PTTO27_MASK) - -#define GPIO_PTOR_PTTO28_MASK (0x10000000U) -#define GPIO_PTOR_PTTO28_SHIFT (28U) -/*! PTTO28 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO28_SHIFT)) & GPIO_PTOR_PTTO28_MASK) - -#define GPIO_PTOR_PTTO29_MASK (0x20000000U) -#define GPIO_PTOR_PTTO29_SHIFT (29U) -/*! PTTO29 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO29_SHIFT)) & GPIO_PTOR_PTTO29_MASK) - -#define GPIO_PTOR_PTTO30_MASK (0x40000000U) -#define GPIO_PTOR_PTTO30_SHIFT (30U) -/*! PTTO30 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO30_SHIFT)) & GPIO_PTOR_PTTO30_MASK) - -#define GPIO_PTOR_PTTO31_MASK (0x80000000U) -#define GPIO_PTOR_PTTO31_SHIFT (31U) -/*! PTTO31 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO31_SHIFT)) & GPIO_PTOR_PTTO31_MASK) -/*! @} */ - -/*! @name PDIR - Port Data Input */ -/*! @{ */ - -#define GPIO_PDIR_PDI0_MASK (0x1U) -#define GPIO_PDIR_PDI0_SHIFT (0U) -/*! PDI0 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI0_SHIFT)) & GPIO_PDIR_PDI0_MASK) - -#define GPIO_PDIR_PDI1_MASK (0x2U) -#define GPIO_PDIR_PDI1_SHIFT (1U) -/*! PDI1 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI1_SHIFT)) & GPIO_PDIR_PDI1_MASK) - -#define GPIO_PDIR_PDI2_MASK (0x4U) -#define GPIO_PDIR_PDI2_SHIFT (2U) -/*! PDI2 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI2_SHIFT)) & GPIO_PDIR_PDI2_MASK) - -#define GPIO_PDIR_PDI3_MASK (0x8U) -#define GPIO_PDIR_PDI3_SHIFT (3U) -/*! PDI3 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI3_SHIFT)) & GPIO_PDIR_PDI3_MASK) - -#define GPIO_PDIR_PDI4_MASK (0x10U) -#define GPIO_PDIR_PDI4_SHIFT (4U) -/*! PDI4 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI4_SHIFT)) & GPIO_PDIR_PDI4_MASK) - -#define GPIO_PDIR_PDI5_MASK (0x20U) -#define GPIO_PDIR_PDI5_SHIFT (5U) -/*! PDI5 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI5_SHIFT)) & GPIO_PDIR_PDI5_MASK) - -#define GPIO_PDIR_PDI6_MASK (0x40U) -#define GPIO_PDIR_PDI6_SHIFT (6U) -/*! PDI6 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI6_SHIFT)) & GPIO_PDIR_PDI6_MASK) - -#define GPIO_PDIR_PDI7_MASK (0x80U) -#define GPIO_PDIR_PDI7_SHIFT (7U) -/*! PDI7 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI7_SHIFT)) & GPIO_PDIR_PDI7_MASK) - -#define GPIO_PDIR_PDI8_MASK (0x100U) -#define GPIO_PDIR_PDI8_SHIFT (8U) -/*! PDI8 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI8_SHIFT)) & GPIO_PDIR_PDI8_MASK) - -#define GPIO_PDIR_PDI9_MASK (0x200U) -#define GPIO_PDIR_PDI9_SHIFT (9U) -/*! PDI9 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI9_SHIFT)) & GPIO_PDIR_PDI9_MASK) - -#define GPIO_PDIR_PDI10_MASK (0x400U) -#define GPIO_PDIR_PDI10_SHIFT (10U) -/*! PDI10 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI10_SHIFT)) & GPIO_PDIR_PDI10_MASK) - -#define GPIO_PDIR_PDI11_MASK (0x800U) -#define GPIO_PDIR_PDI11_SHIFT (11U) -/*! PDI11 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI11_SHIFT)) & GPIO_PDIR_PDI11_MASK) - -#define GPIO_PDIR_PDI12_MASK (0x1000U) -#define GPIO_PDIR_PDI12_SHIFT (12U) -/*! PDI12 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI12_SHIFT)) & GPIO_PDIR_PDI12_MASK) - -#define GPIO_PDIR_PDI13_MASK (0x2000U) -#define GPIO_PDIR_PDI13_SHIFT (13U) -/*! PDI13 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI13_SHIFT)) & GPIO_PDIR_PDI13_MASK) - -#define GPIO_PDIR_PDI14_MASK (0x4000U) -#define GPIO_PDIR_PDI14_SHIFT (14U) -/*! PDI14 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI14_SHIFT)) & GPIO_PDIR_PDI14_MASK) - -#define GPIO_PDIR_PDI15_MASK (0x8000U) -#define GPIO_PDIR_PDI15_SHIFT (15U) -/*! PDI15 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI15_SHIFT)) & GPIO_PDIR_PDI15_MASK) - -#define GPIO_PDIR_PDI16_MASK (0x10000U) -#define GPIO_PDIR_PDI16_SHIFT (16U) -/*! PDI16 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI16_SHIFT)) & GPIO_PDIR_PDI16_MASK) - -#define GPIO_PDIR_PDI17_MASK (0x20000U) -#define GPIO_PDIR_PDI17_SHIFT (17U) -/*! PDI17 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI17_SHIFT)) & GPIO_PDIR_PDI17_MASK) - -#define GPIO_PDIR_PDI18_MASK (0x40000U) -#define GPIO_PDIR_PDI18_SHIFT (18U) -/*! PDI18 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI18_SHIFT)) & GPIO_PDIR_PDI18_MASK) - -#define GPIO_PDIR_PDI19_MASK (0x80000U) -#define GPIO_PDIR_PDI19_SHIFT (19U) -/*! PDI19 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI19_SHIFT)) & GPIO_PDIR_PDI19_MASK) - -#define GPIO_PDIR_PDI20_MASK (0x100000U) -#define GPIO_PDIR_PDI20_SHIFT (20U) -/*! PDI20 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI20_SHIFT)) & GPIO_PDIR_PDI20_MASK) - -#define GPIO_PDIR_PDI21_MASK (0x200000U) -#define GPIO_PDIR_PDI21_SHIFT (21U) -/*! PDI21 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI21_SHIFT)) & GPIO_PDIR_PDI21_MASK) - -#define GPIO_PDIR_PDI22_MASK (0x400000U) -#define GPIO_PDIR_PDI22_SHIFT (22U) -/*! PDI22 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI22_SHIFT)) & GPIO_PDIR_PDI22_MASK) - -#define GPIO_PDIR_PDI23_MASK (0x800000U) -#define GPIO_PDIR_PDI23_SHIFT (23U) -/*! PDI23 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI23_SHIFT)) & GPIO_PDIR_PDI23_MASK) - -#define GPIO_PDIR_PDI24_MASK (0x1000000U) -#define GPIO_PDIR_PDI24_SHIFT (24U) -/*! PDI24 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI24_SHIFT)) & GPIO_PDIR_PDI24_MASK) - -#define GPIO_PDIR_PDI25_MASK (0x2000000U) -#define GPIO_PDIR_PDI25_SHIFT (25U) -/*! PDI25 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI25_SHIFT)) & GPIO_PDIR_PDI25_MASK) - -#define GPIO_PDIR_PDI26_MASK (0x4000000U) -#define GPIO_PDIR_PDI26_SHIFT (26U) -/*! PDI26 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI26_SHIFT)) & GPIO_PDIR_PDI26_MASK) - -#define GPIO_PDIR_PDI27_MASK (0x8000000U) -#define GPIO_PDIR_PDI27_SHIFT (27U) -/*! PDI27 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI27_SHIFT)) & GPIO_PDIR_PDI27_MASK) - -#define GPIO_PDIR_PDI28_MASK (0x10000000U) -#define GPIO_PDIR_PDI28_SHIFT (28U) -/*! PDI28 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI28_SHIFT)) & GPIO_PDIR_PDI28_MASK) - -#define GPIO_PDIR_PDI29_MASK (0x20000000U) -#define GPIO_PDIR_PDI29_SHIFT (29U) -/*! PDI29 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI29_SHIFT)) & GPIO_PDIR_PDI29_MASK) - -#define GPIO_PDIR_PDI30_MASK (0x40000000U) -#define GPIO_PDIR_PDI30_SHIFT (30U) -/*! PDI30 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI30_SHIFT)) & GPIO_PDIR_PDI30_MASK) - -#define GPIO_PDIR_PDI31_MASK (0x80000000U) -#define GPIO_PDIR_PDI31_SHIFT (31U) -/*! PDI31 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI31_SHIFT)) & GPIO_PDIR_PDI31_MASK) -/*! @} */ - -/*! @name PDDR - Port Data Direction */ -/*! @{ */ - -#define GPIO_PDDR_PDD0_MASK (0x1U) -#define GPIO_PDDR_PDD0_SHIFT (0U) -/*! PDD0 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD0_SHIFT)) & GPIO_PDDR_PDD0_MASK) - -#define GPIO_PDDR_PDD1_MASK (0x2U) -#define GPIO_PDDR_PDD1_SHIFT (1U) -/*! PDD1 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD1_SHIFT)) & GPIO_PDDR_PDD1_MASK) - -#define GPIO_PDDR_PDD2_MASK (0x4U) -#define GPIO_PDDR_PDD2_SHIFT (2U) -/*! PDD2 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD2_SHIFT)) & GPIO_PDDR_PDD2_MASK) - -#define GPIO_PDDR_PDD3_MASK (0x8U) -#define GPIO_PDDR_PDD3_SHIFT (3U) -/*! PDD3 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD3_SHIFT)) & GPIO_PDDR_PDD3_MASK) - -#define GPIO_PDDR_PDD4_MASK (0x10U) -#define GPIO_PDDR_PDD4_SHIFT (4U) -/*! PDD4 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD4_SHIFT)) & GPIO_PDDR_PDD4_MASK) - -#define GPIO_PDDR_PDD5_MASK (0x20U) -#define GPIO_PDDR_PDD5_SHIFT (5U) -/*! PDD5 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD5_SHIFT)) & GPIO_PDDR_PDD5_MASK) - -#define GPIO_PDDR_PDD6_MASK (0x40U) -#define GPIO_PDDR_PDD6_SHIFT (6U) -/*! PDD6 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD6_SHIFT)) & GPIO_PDDR_PDD6_MASK) - -#define GPIO_PDDR_PDD7_MASK (0x80U) -#define GPIO_PDDR_PDD7_SHIFT (7U) -/*! PDD7 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD7_SHIFT)) & GPIO_PDDR_PDD7_MASK) - -#define GPIO_PDDR_PDD8_MASK (0x100U) -#define GPIO_PDDR_PDD8_SHIFT (8U) -/*! PDD8 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD8_SHIFT)) & GPIO_PDDR_PDD8_MASK) - -#define GPIO_PDDR_PDD9_MASK (0x200U) -#define GPIO_PDDR_PDD9_SHIFT (9U) -/*! PDD9 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD9_SHIFT)) & GPIO_PDDR_PDD9_MASK) - -#define GPIO_PDDR_PDD10_MASK (0x400U) -#define GPIO_PDDR_PDD10_SHIFT (10U) -/*! PDD10 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD10_SHIFT)) & GPIO_PDDR_PDD10_MASK) - -#define GPIO_PDDR_PDD11_MASK (0x800U) -#define GPIO_PDDR_PDD11_SHIFT (11U) -/*! PDD11 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD11_SHIFT)) & GPIO_PDDR_PDD11_MASK) - -#define GPIO_PDDR_PDD12_MASK (0x1000U) -#define GPIO_PDDR_PDD12_SHIFT (12U) -/*! PDD12 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD12_SHIFT)) & GPIO_PDDR_PDD12_MASK) - -#define GPIO_PDDR_PDD13_MASK (0x2000U) -#define GPIO_PDDR_PDD13_SHIFT (13U) -/*! PDD13 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD13_SHIFT)) & GPIO_PDDR_PDD13_MASK) - -#define GPIO_PDDR_PDD14_MASK (0x4000U) -#define GPIO_PDDR_PDD14_SHIFT (14U) -/*! PDD14 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD14_SHIFT)) & GPIO_PDDR_PDD14_MASK) - -#define GPIO_PDDR_PDD15_MASK (0x8000U) -#define GPIO_PDDR_PDD15_SHIFT (15U) -/*! PDD15 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD15_SHIFT)) & GPIO_PDDR_PDD15_MASK) - -#define GPIO_PDDR_PDD16_MASK (0x10000U) -#define GPIO_PDDR_PDD16_SHIFT (16U) -/*! PDD16 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD16_SHIFT)) & GPIO_PDDR_PDD16_MASK) - -#define GPIO_PDDR_PDD17_MASK (0x20000U) -#define GPIO_PDDR_PDD17_SHIFT (17U) -/*! PDD17 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD17_SHIFT)) & GPIO_PDDR_PDD17_MASK) - -#define GPIO_PDDR_PDD18_MASK (0x40000U) -#define GPIO_PDDR_PDD18_SHIFT (18U) -/*! PDD18 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD18_SHIFT)) & GPIO_PDDR_PDD18_MASK) - -#define GPIO_PDDR_PDD19_MASK (0x80000U) -#define GPIO_PDDR_PDD19_SHIFT (19U) -/*! PDD19 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD19_SHIFT)) & GPIO_PDDR_PDD19_MASK) - -#define GPIO_PDDR_PDD20_MASK (0x100000U) -#define GPIO_PDDR_PDD20_SHIFT (20U) -/*! PDD20 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD20_SHIFT)) & GPIO_PDDR_PDD20_MASK) - -#define GPIO_PDDR_PDD21_MASK (0x200000U) -#define GPIO_PDDR_PDD21_SHIFT (21U) -/*! PDD21 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD21_SHIFT)) & GPIO_PDDR_PDD21_MASK) - -#define GPIO_PDDR_PDD22_MASK (0x400000U) -#define GPIO_PDDR_PDD22_SHIFT (22U) -/*! PDD22 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD22_SHIFT)) & GPIO_PDDR_PDD22_MASK) - -#define GPIO_PDDR_PDD23_MASK (0x800000U) -#define GPIO_PDDR_PDD23_SHIFT (23U) -/*! PDD23 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD23_SHIFT)) & GPIO_PDDR_PDD23_MASK) - -#define GPIO_PDDR_PDD24_MASK (0x1000000U) -#define GPIO_PDDR_PDD24_SHIFT (24U) -/*! PDD24 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD24_SHIFT)) & GPIO_PDDR_PDD24_MASK) - -#define GPIO_PDDR_PDD25_MASK (0x2000000U) -#define GPIO_PDDR_PDD25_SHIFT (25U) -/*! PDD25 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD25_SHIFT)) & GPIO_PDDR_PDD25_MASK) - -#define GPIO_PDDR_PDD26_MASK (0x4000000U) -#define GPIO_PDDR_PDD26_SHIFT (26U) -/*! PDD26 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD26_SHIFT)) & GPIO_PDDR_PDD26_MASK) - -#define GPIO_PDDR_PDD27_MASK (0x8000000U) -#define GPIO_PDDR_PDD27_SHIFT (27U) -/*! PDD27 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD27_SHIFT)) & GPIO_PDDR_PDD27_MASK) - -#define GPIO_PDDR_PDD28_MASK (0x10000000U) -#define GPIO_PDDR_PDD28_SHIFT (28U) -/*! PDD28 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD28_SHIFT)) & GPIO_PDDR_PDD28_MASK) - -#define GPIO_PDDR_PDD29_MASK (0x20000000U) -#define GPIO_PDDR_PDD29_SHIFT (29U) -/*! PDD29 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD29_SHIFT)) & GPIO_PDDR_PDD29_MASK) - -#define GPIO_PDDR_PDD30_MASK (0x40000000U) -#define GPIO_PDDR_PDD30_SHIFT (30U) -/*! PDD30 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD30_SHIFT)) & GPIO_PDDR_PDD30_MASK) - -#define GPIO_PDDR_PDD31_MASK (0x80000000U) -#define GPIO_PDDR_PDD31_SHIFT (31U) -/*! PDD31 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD31_SHIFT)) & GPIO_PDDR_PDD31_MASK) -/*! @} */ - -/*! @name PIDR - Port Input Disable */ -/*! @{ */ - -#define GPIO_PIDR_PID0_MASK (0x1U) -#define GPIO_PIDR_PID0_SHIFT (0U) -/*! PID0 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID0_SHIFT)) & GPIO_PIDR_PID0_MASK) - -#define GPIO_PIDR_PID1_MASK (0x2U) -#define GPIO_PIDR_PID1_SHIFT (1U) -/*! PID1 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID1_SHIFT)) & GPIO_PIDR_PID1_MASK) - -#define GPIO_PIDR_PID2_MASK (0x4U) -#define GPIO_PIDR_PID2_SHIFT (2U) -/*! PID2 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID2_SHIFT)) & GPIO_PIDR_PID2_MASK) - -#define GPIO_PIDR_PID3_MASK (0x8U) -#define GPIO_PIDR_PID3_SHIFT (3U) -/*! PID3 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID3_SHIFT)) & GPIO_PIDR_PID3_MASK) - -#define GPIO_PIDR_PID4_MASK (0x10U) -#define GPIO_PIDR_PID4_SHIFT (4U) -/*! PID4 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID4_SHIFT)) & GPIO_PIDR_PID4_MASK) - -#define GPIO_PIDR_PID5_MASK (0x20U) -#define GPIO_PIDR_PID5_SHIFT (5U) -/*! PID5 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID5_SHIFT)) & GPIO_PIDR_PID5_MASK) - -#define GPIO_PIDR_PID6_MASK (0x40U) -#define GPIO_PIDR_PID6_SHIFT (6U) -/*! PID6 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID6_SHIFT)) & GPIO_PIDR_PID6_MASK) - -#define GPIO_PIDR_PID7_MASK (0x80U) -#define GPIO_PIDR_PID7_SHIFT (7U) -/*! PID7 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID7_SHIFT)) & GPIO_PIDR_PID7_MASK) - -#define GPIO_PIDR_PID8_MASK (0x100U) -#define GPIO_PIDR_PID8_SHIFT (8U) -/*! PID8 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID8_SHIFT)) & GPIO_PIDR_PID8_MASK) - -#define GPIO_PIDR_PID9_MASK (0x200U) -#define GPIO_PIDR_PID9_SHIFT (9U) -/*! PID9 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID9_SHIFT)) & GPIO_PIDR_PID9_MASK) - -#define GPIO_PIDR_PID10_MASK (0x400U) -#define GPIO_PIDR_PID10_SHIFT (10U) -/*! PID10 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID10_SHIFT)) & GPIO_PIDR_PID10_MASK) - -#define GPIO_PIDR_PID11_MASK (0x800U) -#define GPIO_PIDR_PID11_SHIFT (11U) -/*! PID11 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID11_SHIFT)) & GPIO_PIDR_PID11_MASK) - -#define GPIO_PIDR_PID12_MASK (0x1000U) -#define GPIO_PIDR_PID12_SHIFT (12U) -/*! PID12 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID12_SHIFT)) & GPIO_PIDR_PID12_MASK) - -#define GPIO_PIDR_PID13_MASK (0x2000U) -#define GPIO_PIDR_PID13_SHIFT (13U) -/*! PID13 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID13_SHIFT)) & GPIO_PIDR_PID13_MASK) - -#define GPIO_PIDR_PID14_MASK (0x4000U) -#define GPIO_PIDR_PID14_SHIFT (14U) -/*! PID14 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID14_SHIFT)) & GPIO_PIDR_PID14_MASK) - -#define GPIO_PIDR_PID15_MASK (0x8000U) -#define GPIO_PIDR_PID15_SHIFT (15U) -/*! PID15 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID15_SHIFT)) & GPIO_PIDR_PID15_MASK) - -#define GPIO_PIDR_PID16_MASK (0x10000U) -#define GPIO_PIDR_PID16_SHIFT (16U) -/*! PID16 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID16_SHIFT)) & GPIO_PIDR_PID16_MASK) - -#define GPIO_PIDR_PID17_MASK (0x20000U) -#define GPIO_PIDR_PID17_SHIFT (17U) -/*! PID17 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID17_SHIFT)) & GPIO_PIDR_PID17_MASK) - -#define GPIO_PIDR_PID18_MASK (0x40000U) -#define GPIO_PIDR_PID18_SHIFT (18U) -/*! PID18 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID18_SHIFT)) & GPIO_PIDR_PID18_MASK) - -#define GPIO_PIDR_PID19_MASK (0x80000U) -#define GPIO_PIDR_PID19_SHIFT (19U) -/*! PID19 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID19_SHIFT)) & GPIO_PIDR_PID19_MASK) - -#define GPIO_PIDR_PID20_MASK (0x100000U) -#define GPIO_PIDR_PID20_SHIFT (20U) -/*! PID20 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID20_SHIFT)) & GPIO_PIDR_PID20_MASK) - -#define GPIO_PIDR_PID21_MASK (0x200000U) -#define GPIO_PIDR_PID21_SHIFT (21U) -/*! PID21 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID21_SHIFT)) & GPIO_PIDR_PID21_MASK) - -#define GPIO_PIDR_PID22_MASK (0x400000U) -#define GPIO_PIDR_PID22_SHIFT (22U) -/*! PID22 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID22_SHIFT)) & GPIO_PIDR_PID22_MASK) - -#define GPIO_PIDR_PID23_MASK (0x800000U) -#define GPIO_PIDR_PID23_SHIFT (23U) -/*! PID23 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID23_SHIFT)) & GPIO_PIDR_PID23_MASK) - -#define GPIO_PIDR_PID24_MASK (0x1000000U) -#define GPIO_PIDR_PID24_SHIFT (24U) -/*! PID24 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID24_SHIFT)) & GPIO_PIDR_PID24_MASK) - -#define GPIO_PIDR_PID25_MASK (0x2000000U) -#define GPIO_PIDR_PID25_SHIFT (25U) -/*! PID25 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID25_SHIFT)) & GPIO_PIDR_PID25_MASK) - -#define GPIO_PIDR_PID26_MASK (0x4000000U) -#define GPIO_PIDR_PID26_SHIFT (26U) -/*! PID26 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID26_SHIFT)) & GPIO_PIDR_PID26_MASK) - -#define GPIO_PIDR_PID27_MASK (0x8000000U) -#define GPIO_PIDR_PID27_SHIFT (27U) -/*! PID27 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID27_SHIFT)) & GPIO_PIDR_PID27_MASK) - -#define GPIO_PIDR_PID28_MASK (0x10000000U) -#define GPIO_PIDR_PID28_SHIFT (28U) -/*! PID28 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID28_SHIFT)) & GPIO_PIDR_PID28_MASK) - -#define GPIO_PIDR_PID29_MASK (0x20000000U) -#define GPIO_PIDR_PID29_SHIFT (29U) -/*! PID29 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID29_SHIFT)) & GPIO_PIDR_PID29_MASK) - -#define GPIO_PIDR_PID30_MASK (0x40000000U) -#define GPIO_PIDR_PID30_SHIFT (30U) -/*! PID30 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID30_SHIFT)) & GPIO_PIDR_PID30_MASK) - -#define GPIO_PIDR_PID31_MASK (0x80000000U) -#define GPIO_PIDR_PID31_SHIFT (31U) -/*! PID31 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID31_SHIFT)) & GPIO_PIDR_PID31_MASK) -/*! @} */ - -/*! @name PDR - Pin Data */ -/*! @{ */ - -#define GPIO_PDR_PD_MASK (0x1U) -#define GPIO_PDR_PD_SHIFT (0U) -/*! PD - Pin Data (I/O) - * 0b0..Logic zero - * 0b1..Logic one - */ -#define GPIO_PDR_PD(x) (((uint8_t)(((uint8_t)(x)) << GPIO_PDR_PD_SHIFT)) & GPIO_PDR_PD_MASK) -/*! @} */ - -/* The count of GPIO_PDR */ -#define GPIO_PDR_COUNT (32U) - -/*! @name ICR - Interrupt Control 0..Interrupt Control 31 */ -/*! @{ */ - -#define GPIO_ICR_IRQC_MASK (0xF0000U) -#define GPIO_ICR_IRQC_SHIFT (16U) -/*! IRQC - Interrupt Configuration - * 0b0000..ISF is disabled - * 0b0001..ISF and DMA request on rising edge - * 0b0010..ISF and DMA request on falling edge - * 0b0011..ISF and DMA request on either edge - * 0b0100..Reserved - * 0b0101..ISF sets on rising edge - * 0b0110..ISF sets on falling edge - * 0b0111..ISF sets on either edge - * 0b1000..ISF and interrupt when logic 0 - * 0b1001..ISF and interrupt on rising edge - * 0b1010..ISF and interrupt on falling edge - * 0b1011..ISF and Interrupt on either edge - * 0b1100..ISF and interrupt when logic 1 - * 0b1101..Enable active-high trigger output; ISF on rising edge (pin state is ORed with other enabled triggers - * to generate the output trigger for use by other peripherals) - * 0b1110..Enable active-low trigger output; ISF on falling edge (pin state is inverted and ORed with other - * enabled triggers to generate the output trigger for use by other peripherals) - * 0b1111..Reserved - */ -#define GPIO_ICR_IRQC(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ICR_IRQC_SHIFT)) & GPIO_ICR_IRQC_MASK) - -#define GPIO_ICR_ISF_MASK (0x1000000U) -#define GPIO_ICR_ISF_SHIFT (24U) -/*! ISF - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ICR_ISF(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ICR_ISF_SHIFT)) & GPIO_ICR_ISF_MASK) -/*! @} */ - -/* The count of GPIO_ICR */ -#define GPIO_ICR_COUNT (32U) - -/*! @name GICLR - Global Interrupt Control Low */ -/*! @{ */ - -#define GPIO_GICLR_GIWE0_MASK (0x1U) -#define GPIO_GICLR_GIWE0_SHIFT (0U) -/*! GIWE0 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE0_SHIFT)) & GPIO_GICLR_GIWE0_MASK) - -#define GPIO_GICLR_GIWE1_MASK (0x2U) -#define GPIO_GICLR_GIWE1_SHIFT (1U) -/*! GIWE1 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE1_SHIFT)) & GPIO_GICLR_GIWE1_MASK) - -#define GPIO_GICLR_GIWE2_MASK (0x4U) -#define GPIO_GICLR_GIWE2_SHIFT (2U) -/*! GIWE2 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE2_SHIFT)) & GPIO_GICLR_GIWE2_MASK) - -#define GPIO_GICLR_GIWE3_MASK (0x8U) -#define GPIO_GICLR_GIWE3_SHIFT (3U) -/*! GIWE3 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE3_SHIFT)) & GPIO_GICLR_GIWE3_MASK) - -#define GPIO_GICLR_GIWE4_MASK (0x10U) -#define GPIO_GICLR_GIWE4_SHIFT (4U) -/*! GIWE4 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE4_SHIFT)) & GPIO_GICLR_GIWE4_MASK) - -#define GPIO_GICLR_GIWE5_MASK (0x20U) -#define GPIO_GICLR_GIWE5_SHIFT (5U) -/*! GIWE5 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE5_SHIFT)) & GPIO_GICLR_GIWE5_MASK) - -#define GPIO_GICLR_GIWE6_MASK (0x40U) -#define GPIO_GICLR_GIWE6_SHIFT (6U) -/*! GIWE6 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE6_SHIFT)) & GPIO_GICLR_GIWE6_MASK) - -#define GPIO_GICLR_GIWE7_MASK (0x80U) -#define GPIO_GICLR_GIWE7_SHIFT (7U) -/*! GIWE7 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE7_SHIFT)) & GPIO_GICLR_GIWE7_MASK) - -#define GPIO_GICLR_GIWE8_MASK (0x100U) -#define GPIO_GICLR_GIWE8_SHIFT (8U) -/*! GIWE8 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE8_SHIFT)) & GPIO_GICLR_GIWE8_MASK) - -#define GPIO_GICLR_GIWE9_MASK (0x200U) -#define GPIO_GICLR_GIWE9_SHIFT (9U) -/*! GIWE9 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE9_SHIFT)) & GPIO_GICLR_GIWE9_MASK) - -#define GPIO_GICLR_GIWE10_MASK (0x400U) -#define GPIO_GICLR_GIWE10_SHIFT (10U) -/*! GIWE10 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE10_SHIFT)) & GPIO_GICLR_GIWE10_MASK) - -#define GPIO_GICLR_GIWE11_MASK (0x800U) -#define GPIO_GICLR_GIWE11_SHIFT (11U) -/*! GIWE11 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE11_SHIFT)) & GPIO_GICLR_GIWE11_MASK) - -#define GPIO_GICLR_GIWE12_MASK (0x1000U) -#define GPIO_GICLR_GIWE12_SHIFT (12U) -/*! GIWE12 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE12_SHIFT)) & GPIO_GICLR_GIWE12_MASK) - -#define GPIO_GICLR_GIWE13_MASK (0x2000U) -#define GPIO_GICLR_GIWE13_SHIFT (13U) -/*! GIWE13 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE13_SHIFT)) & GPIO_GICLR_GIWE13_MASK) - -#define GPIO_GICLR_GIWE14_MASK (0x4000U) -#define GPIO_GICLR_GIWE14_SHIFT (14U) -/*! GIWE14 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE14_SHIFT)) & GPIO_GICLR_GIWE14_MASK) - -#define GPIO_GICLR_GIWE15_MASK (0x8000U) -#define GPIO_GICLR_GIWE15_SHIFT (15U) -/*! GIWE15 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE15_SHIFT)) & GPIO_GICLR_GIWE15_MASK) - -#define GPIO_GICLR_GIWD_MASK (0xFFFF0000U) -#define GPIO_GICLR_GIWD_SHIFT (16U) -/*! GIWD - Global Interrupt Write Data */ -#define GPIO_GICLR_GIWD(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWD_SHIFT)) & GPIO_GICLR_GIWD_MASK) -/*! @} */ - -/*! @name GICHR - Global Interrupt Control High */ -/*! @{ */ - -#define GPIO_GICHR_GIWE16_MASK (0x1U) -#define GPIO_GICHR_GIWE16_SHIFT (0U) -/*! GIWE16 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE16_SHIFT)) & GPIO_GICHR_GIWE16_MASK) - -#define GPIO_GICHR_GIWE17_MASK (0x2U) -#define GPIO_GICHR_GIWE17_SHIFT (1U) -/*! GIWE17 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE17_SHIFT)) & GPIO_GICHR_GIWE17_MASK) - -#define GPIO_GICHR_GIWE18_MASK (0x4U) -#define GPIO_GICHR_GIWE18_SHIFT (2U) -/*! GIWE18 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE18_SHIFT)) & GPIO_GICHR_GIWE18_MASK) - -#define GPIO_GICHR_GIWE19_MASK (0x8U) -#define GPIO_GICHR_GIWE19_SHIFT (3U) -/*! GIWE19 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE19_SHIFT)) & GPIO_GICHR_GIWE19_MASK) - -#define GPIO_GICHR_GIWE20_MASK (0x10U) -#define GPIO_GICHR_GIWE20_SHIFT (4U) -/*! GIWE20 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE20_SHIFT)) & GPIO_GICHR_GIWE20_MASK) - -#define GPIO_GICHR_GIWE21_MASK (0x20U) -#define GPIO_GICHR_GIWE21_SHIFT (5U) -/*! GIWE21 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE21_SHIFT)) & GPIO_GICHR_GIWE21_MASK) - -#define GPIO_GICHR_GIWE22_MASK (0x40U) -#define GPIO_GICHR_GIWE22_SHIFT (6U) -/*! GIWE22 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE22_SHIFT)) & GPIO_GICHR_GIWE22_MASK) - -#define GPIO_GICHR_GIWE23_MASK (0x80U) -#define GPIO_GICHR_GIWE23_SHIFT (7U) -/*! GIWE23 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE23_SHIFT)) & GPIO_GICHR_GIWE23_MASK) - -#define GPIO_GICHR_GIWE24_MASK (0x100U) -#define GPIO_GICHR_GIWE24_SHIFT (8U) -/*! GIWE24 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE24_SHIFT)) & GPIO_GICHR_GIWE24_MASK) - -#define GPIO_GICHR_GIWE25_MASK (0x200U) -#define GPIO_GICHR_GIWE25_SHIFT (9U) -/*! GIWE25 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE25_SHIFT)) & GPIO_GICHR_GIWE25_MASK) - -#define GPIO_GICHR_GIWE26_MASK (0x400U) -#define GPIO_GICHR_GIWE26_SHIFT (10U) -/*! GIWE26 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE26_SHIFT)) & GPIO_GICHR_GIWE26_MASK) - -#define GPIO_GICHR_GIWE27_MASK (0x800U) -#define GPIO_GICHR_GIWE27_SHIFT (11U) -/*! GIWE27 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE27_SHIFT)) & GPIO_GICHR_GIWE27_MASK) - -#define GPIO_GICHR_GIWE28_MASK (0x1000U) -#define GPIO_GICHR_GIWE28_SHIFT (12U) -/*! GIWE28 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE28_SHIFT)) & GPIO_GICHR_GIWE28_MASK) - -#define GPIO_GICHR_GIWE29_MASK (0x2000U) -#define GPIO_GICHR_GIWE29_SHIFT (13U) -/*! GIWE29 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE29_SHIFT)) & GPIO_GICHR_GIWE29_MASK) - -#define GPIO_GICHR_GIWE30_MASK (0x4000U) -#define GPIO_GICHR_GIWE30_SHIFT (14U) -/*! GIWE30 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE30_SHIFT)) & GPIO_GICHR_GIWE30_MASK) - -#define GPIO_GICHR_GIWE31_MASK (0x8000U) -#define GPIO_GICHR_GIWE31_SHIFT (15U) -/*! GIWE31 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE31_SHIFT)) & GPIO_GICHR_GIWE31_MASK) - -#define GPIO_GICHR_GIWD_MASK (0xFFFF0000U) -#define GPIO_GICHR_GIWD_SHIFT (16U) -/*! GIWD - Global Interrupt Write Data */ -#define GPIO_GICHR_GIWD(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWD_SHIFT)) & GPIO_GICHR_GIWD_MASK) -/*! @} */ - -/*! @name ISFR - Interrupt Status Flag */ -/*! @{ */ - -#define GPIO_ISFR_ISF0_MASK (0x1U) -#define GPIO_ISFR_ISF0_SHIFT (0U) -/*! ISF0 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF0_SHIFT)) & GPIO_ISFR_ISF0_MASK) - -#define GPIO_ISFR_ISF1_MASK (0x2U) -#define GPIO_ISFR_ISF1_SHIFT (1U) -/*! ISF1 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF1_SHIFT)) & GPIO_ISFR_ISF1_MASK) - -#define GPIO_ISFR_ISF2_MASK (0x4U) -#define GPIO_ISFR_ISF2_SHIFT (2U) -/*! ISF2 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF2_SHIFT)) & GPIO_ISFR_ISF2_MASK) - -#define GPIO_ISFR_ISF3_MASK (0x8U) -#define GPIO_ISFR_ISF3_SHIFT (3U) -/*! ISF3 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF3_SHIFT)) & GPIO_ISFR_ISF3_MASK) - -#define GPIO_ISFR_ISF4_MASK (0x10U) -#define GPIO_ISFR_ISF4_SHIFT (4U) -/*! ISF4 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF4_SHIFT)) & GPIO_ISFR_ISF4_MASK) - -#define GPIO_ISFR_ISF5_MASK (0x20U) -#define GPIO_ISFR_ISF5_SHIFT (5U) -/*! ISF5 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF5_SHIFT)) & GPIO_ISFR_ISF5_MASK) - -#define GPIO_ISFR_ISF6_MASK (0x40U) -#define GPIO_ISFR_ISF6_SHIFT (6U) -/*! ISF6 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF6_SHIFT)) & GPIO_ISFR_ISF6_MASK) - -#define GPIO_ISFR_ISF7_MASK (0x80U) -#define GPIO_ISFR_ISF7_SHIFT (7U) -/*! ISF7 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF7_SHIFT)) & GPIO_ISFR_ISF7_MASK) - -#define GPIO_ISFR_ISF8_MASK (0x100U) -#define GPIO_ISFR_ISF8_SHIFT (8U) -/*! ISF8 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF8_SHIFT)) & GPIO_ISFR_ISF8_MASK) - -#define GPIO_ISFR_ISF9_MASK (0x200U) -#define GPIO_ISFR_ISF9_SHIFT (9U) -/*! ISF9 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF9_SHIFT)) & GPIO_ISFR_ISF9_MASK) - -#define GPIO_ISFR_ISF10_MASK (0x400U) -#define GPIO_ISFR_ISF10_SHIFT (10U) -/*! ISF10 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF10_SHIFT)) & GPIO_ISFR_ISF10_MASK) - -#define GPIO_ISFR_ISF11_MASK (0x800U) -#define GPIO_ISFR_ISF11_SHIFT (11U) -/*! ISF11 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF11_SHIFT)) & GPIO_ISFR_ISF11_MASK) - -#define GPIO_ISFR_ISF12_MASK (0x1000U) -#define GPIO_ISFR_ISF12_SHIFT (12U) -/*! ISF12 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF12_SHIFT)) & GPIO_ISFR_ISF12_MASK) - -#define GPIO_ISFR_ISF13_MASK (0x2000U) -#define GPIO_ISFR_ISF13_SHIFT (13U) -/*! ISF13 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF13_SHIFT)) & GPIO_ISFR_ISF13_MASK) - -#define GPIO_ISFR_ISF14_MASK (0x4000U) -#define GPIO_ISFR_ISF14_SHIFT (14U) -/*! ISF14 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF14_SHIFT)) & GPIO_ISFR_ISF14_MASK) - -#define GPIO_ISFR_ISF15_MASK (0x8000U) -#define GPIO_ISFR_ISF15_SHIFT (15U) -/*! ISF15 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF15_SHIFT)) & GPIO_ISFR_ISF15_MASK) - -#define GPIO_ISFR_ISF16_MASK (0x10000U) -#define GPIO_ISFR_ISF16_SHIFT (16U) -/*! ISF16 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF16_SHIFT)) & GPIO_ISFR_ISF16_MASK) - -#define GPIO_ISFR_ISF17_MASK (0x20000U) -#define GPIO_ISFR_ISF17_SHIFT (17U) -/*! ISF17 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF17_SHIFT)) & GPIO_ISFR_ISF17_MASK) - -#define GPIO_ISFR_ISF18_MASK (0x40000U) -#define GPIO_ISFR_ISF18_SHIFT (18U) -/*! ISF18 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF18_SHIFT)) & GPIO_ISFR_ISF18_MASK) - -#define GPIO_ISFR_ISF19_MASK (0x80000U) -#define GPIO_ISFR_ISF19_SHIFT (19U) -/*! ISF19 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF19_SHIFT)) & GPIO_ISFR_ISF19_MASK) - -#define GPIO_ISFR_ISF20_MASK (0x100000U) -#define GPIO_ISFR_ISF20_SHIFT (20U) -/*! ISF20 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF20_SHIFT)) & GPIO_ISFR_ISF20_MASK) - -#define GPIO_ISFR_ISF21_MASK (0x200000U) -#define GPIO_ISFR_ISF21_SHIFT (21U) -/*! ISF21 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF21_SHIFT)) & GPIO_ISFR_ISF21_MASK) - -#define GPIO_ISFR_ISF22_MASK (0x400000U) -#define GPIO_ISFR_ISF22_SHIFT (22U) -/*! ISF22 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF22_SHIFT)) & GPIO_ISFR_ISF22_MASK) - -#define GPIO_ISFR_ISF23_MASK (0x800000U) -#define GPIO_ISFR_ISF23_SHIFT (23U) -/*! ISF23 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF23_SHIFT)) & GPIO_ISFR_ISF23_MASK) - -#define GPIO_ISFR_ISF24_MASK (0x1000000U) -#define GPIO_ISFR_ISF24_SHIFT (24U) -/*! ISF24 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF24_SHIFT)) & GPIO_ISFR_ISF24_MASK) - -#define GPIO_ISFR_ISF25_MASK (0x2000000U) -#define GPIO_ISFR_ISF25_SHIFT (25U) -/*! ISF25 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF25_SHIFT)) & GPIO_ISFR_ISF25_MASK) - -#define GPIO_ISFR_ISF26_MASK (0x4000000U) -#define GPIO_ISFR_ISF26_SHIFT (26U) -/*! ISF26 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF26_SHIFT)) & GPIO_ISFR_ISF26_MASK) - -#define GPIO_ISFR_ISF27_MASK (0x8000000U) -#define GPIO_ISFR_ISF27_SHIFT (27U) -/*! ISF27 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF27_SHIFT)) & GPIO_ISFR_ISF27_MASK) - -#define GPIO_ISFR_ISF28_MASK (0x10000000U) -#define GPIO_ISFR_ISF28_SHIFT (28U) -/*! ISF28 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF28_SHIFT)) & GPIO_ISFR_ISF28_MASK) - -#define GPIO_ISFR_ISF29_MASK (0x20000000U) -#define GPIO_ISFR_ISF29_SHIFT (29U) -/*! ISF29 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF29_SHIFT)) & GPIO_ISFR_ISF29_MASK) - -#define GPIO_ISFR_ISF30_MASK (0x40000000U) -#define GPIO_ISFR_ISF30_SHIFT (30U) -/*! ISF30 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF30_SHIFT)) & GPIO_ISFR_ISF30_MASK) - -#define GPIO_ISFR_ISF31_MASK (0x80000000U) -#define GPIO_ISFR_ISF31_SHIFT (31U) -/*! ISF31 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF31_SHIFT)) & GPIO_ISFR_ISF31_MASK) -/*! @} */ - -/* The count of GPIO_ISFR */ -#define GPIO_ISFR_COUNT (1U) - - -/*! - * @} - */ /* end of group GPIO_Register_Masks */ - - -/* GPIO - Peripheral instance base addresses */ -/** Peripheral GPIO0 base address */ -#define GPIO0_BASE (0x40102000u) -/** Peripheral GPIO0 base pointer */ -#define GPIO0 ((GPIO_Type *)GPIO0_BASE) -/** Peripheral GPIO1 base address */ -#define GPIO1_BASE (0x40103000u) -/** Peripheral GPIO1 base pointer */ -#define GPIO1 ((GPIO_Type *)GPIO1_BASE) -/** Peripheral GPIO2 base address */ -#define GPIO2_BASE (0x40104000u) -/** Peripheral GPIO2 base pointer */ -#define GPIO2 ((GPIO_Type *)GPIO2_BASE) -/** Peripheral GPIO3 base address */ -#define GPIO3_BASE (0x40105000u) -/** Peripheral GPIO3 base pointer */ -#define GPIO3 ((GPIO_Type *)GPIO3_BASE) -/** Array initializer of GPIO peripheral base addresses */ -#define GPIO_BASE_ADDRS { GPIO0_BASE, GPIO1_BASE, GPIO2_BASE, GPIO3_BASE } -/** Array initializer of GPIO peripheral base pointers */ -#define GPIO_BASE_PTRS { GPIO0, GPIO1, GPIO2, GPIO3 } -/** Interrupt vectors for the GPIO peripheral type */ -#define GPIO_IRQS { GPIO0_IRQn, GPIO1_IRQn, GPIO2_IRQn, GPIO3_IRQn } - -/*! - * @} - */ /* end of group GPIO_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- I3C Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup I3C_Peripheral_Access_Layer I3C Peripheral Access Layer - * @{ - */ - -/** I3C - Register Layout Typedef */ -typedef struct { - __IO uint32_t MCONFIG; /**< Controller Configuration, offset: 0x0 */ - __IO uint32_t SCONFIG; /**< Target Configuration, offset: 0x4 */ - __IO uint32_t SSTATUS; /**< Target Status, offset: 0x8 */ - __IO uint32_t SCTRL; /**< Target Control, offset: 0xC */ - __IO uint32_t SINTSET; /**< Target Interrupt Set, offset: 0x10 */ - __IO uint32_t SINTCLR; /**< Target Interrupt Clear, offset: 0x14 */ - __I uint32_t SINTMASKED; /**< Target Interrupt Mask, offset: 0x18 */ - __IO uint32_t SERRWARN; /**< Target Errors and Warnings, offset: 0x1C */ - __IO uint32_t SDMACTRL; /**< Target DMA Control, offset: 0x20 */ - uint8_t RESERVED_0[8]; - __IO uint32_t SDATACTRL; /**< Target Data Control, offset: 0x2C */ - __O uint32_t SWDATAB; /**< Target Write Data Byte, offset: 0x30 */ - __O uint32_t SWDATABE; /**< Target Write Data Byte End, offset: 0x34 */ - __O uint32_t SWDATAH; /**< Target Write Data Half-word, offset: 0x38 */ - __O uint32_t SWDATAHE; /**< Target Write Data Half-word End, offset: 0x3C */ - __I uint32_t SRDATAB; /**< Target Read Data Byte, offset: 0x40 */ - uint8_t RESERVED_1[4]; - __I uint32_t SRDATAH; /**< Target Read Data Halfword, offset: 0x48 */ - uint8_t RESERVED_2[8]; - union { /* offset: 0x54 */ - __O uint32_t SWDATAB1; /**< Target Write Data Byte, offset: 0x54 */ - __O uint32_t SWDATAH1; /**< Target Write Data Halfword, offset: 0x54 */ - }; - uint8_t RESERVED_3[4]; - __I uint32_t SCAPABILITIES2; /**< Target Capabilities 2, offset: 0x5C */ - __I uint32_t SCAPABILITIES; /**< Target Capabilities, offset: 0x60 */ - __IO uint32_t SDYNADDR; /**< Target Dynamic Address, offset: 0x64 */ - __IO uint32_t SMAXLIMITS; /**< Target Maximum Limits, offset: 0x68 */ - __IO uint32_t SIDPARTNO; /**< Target ID Part Number, offset: 0x6C */ - __IO uint32_t SIDEXT; /**< Target ID Extension, offset: 0x70 */ - __IO uint32_t SVENDORID; /**< Target Vendor ID, offset: 0x74 */ - __IO uint32_t STCCLOCK; /**< Target Time Control Clock, offset: 0x78 */ - __I uint32_t SMSGMAPADDR; /**< Target Message Map Address, offset: 0x7C */ - __IO uint32_t MCONFIG_EXT; /**< Controller Extended Configuration, offset: 0x80 */ - __IO uint32_t MCTRL; /**< Controller Control, offset: 0x84 */ - __IO uint32_t MSTATUS; /**< Controller Status, offset: 0x88 */ - __IO uint32_t MIBIRULES; /**< Controller In-band Interrupt Registry and Rules, offset: 0x8C */ - __IO uint32_t MINTSET; /**< Controller Interrupt Set, offset: 0x90 */ - __IO uint32_t MINTCLR; /**< Controller Interrupt Clear, offset: 0x94 */ - __I uint32_t MINTMASKED; /**< Controller Interrupt Mask, offset: 0x98 */ - __IO uint32_t MERRWARN; /**< Controller Errors and Warnings, offset: 0x9C */ - __IO uint32_t MDMACTRL; /**< Controller DMA Control, offset: 0xA0 */ - uint8_t RESERVED_4[8]; - __IO uint32_t MDATACTRL; /**< Controller Data Control, offset: 0xAC */ - __O uint32_t MWDATAB; /**< Controller Write Data Byte, offset: 0xB0 */ - __O uint32_t MWDATABE; /**< Controller Write Data Byte End, offset: 0xB4 */ - __O uint32_t MWDATAH; /**< Controller Write Data Halfword, offset: 0xB8 */ - __O uint32_t MWDATAHE; /**< Controller Write Data Halfword End, offset: 0xBC */ - __I uint32_t MRDATAB; /**< Controller Read Data Byte, offset: 0xC0 */ - uint8_t RESERVED_5[4]; - __I uint32_t MRDATAH; /**< Controller Read Data Halfword, offset: 0xC8 */ - union { /* offset: 0xCC */ - __O uint32_t MWDATAB1; /**< Controller Write Byte Data 1(to bus), offset: 0xCC */ - __O uint32_t MWDATAH1; /**< Controller Write Halfword Data (to bus), offset: 0xCC */ - }; - union { /* offset: 0xD0 */ - __O uint32_t MWMSG_SDR_CONTROL; /**< Controller Write Message Control in SDR mode, offset: 0xD0 */ - __O uint32_t MWMSG_SDR_DATA; /**< Controller Write Message Data in SDR mode, offset: 0xD0 */ - }; - __I uint32_t MRMSG_SDR; /**< Controller Read Message in SDR mode, offset: 0xD4 */ - union { /* offset: 0xD8 */ - __O uint32_t MWMSG_DDR_CONTROL; /**< Controller Write Message in DDR mode: First Control Word, offset: 0xD8 */ - __O uint32_t MWMSG_DDR_CONTROL2; /**< Controller Write Message in DDR mode Control 2, offset: 0xD8 */ - __O uint32_t MWMSG_DDR_DATA; /**< Controller Write Message Data in DDR mode, offset: 0xD8 */ - }; - __I uint32_t MRMSG_DDR; /**< Controller Read Message in DDR mode, offset: 0xDC */ - uint8_t RESERVED_6[4]; - __IO uint32_t MDYNADDR; /**< Controller Dynamic Address, offset: 0xE4 */ - uint8_t RESERVED_7[52]; - __I uint32_t SMAPCTRL0; /**< Map Feature Control 0, offset: 0x11C */ - uint8_t RESERVED_8[32]; - __IO uint32_t IBIEXT1; /**< Extended IBI Data 1, offset: 0x140 */ - __IO uint32_t IBIEXT2; /**< Extended IBI Data 2, offset: 0x144 */ - uint8_t RESERVED_9[3764]; - __I uint32_t SID; /**< Target Module ID, offset: 0xFFC */ -} I3C_Type; - -/* ---------------------------------------------------------------------------- - -- I3C Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup I3C_Register_Masks I3C Register Masks - * @{ - */ - -/*! @name MCONFIG - Controller Configuration */ -/*! @{ */ - -#define I3C_MCONFIG_MSTENA_MASK (0x3U) -#define I3C_MCONFIG_MSTENA_SHIFT (0U) -/*! MSTENA - Controller Enable - * 0b00..CONTROLLER_OFF - * 0b01..CONTROLLER_ON - * 0b10..CONTROLLER_CAPABLE - * 0b11..I2C_CONTROLLER_MODE - */ -#define I3C_MCONFIG_MSTENA(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_MSTENA_SHIFT)) & I3C_MCONFIG_MSTENA_MASK) - -#define I3C_MCONFIG_DISTO_MASK (0x8U) -#define I3C_MCONFIG_DISTO_SHIFT (3U) -/*! DISTO - Disable Timeout - * 0b1..Timeout disabled, if timeout is configured - * 0b0..Timeout enabled - */ -#define I3C_MCONFIG_DISTO(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_DISTO_SHIFT)) & I3C_MCONFIG_DISTO_MASK) - -#define I3C_MCONFIG_HKEEP_MASK (0x30U) -#define I3C_MCONFIG_HKEEP_SHIFT (4U) -/*! HKEEP - High-Keeper - * 0b00..NONE - * 0b01..WIRED_IN - * 0b10..PASSIVE_SDA - * 0b11..PASSIVE_ON_SDA_SCL - */ -#define I3C_MCONFIG_HKEEP(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_HKEEP_SHIFT)) & I3C_MCONFIG_HKEEP_MASK) - -#define I3C_MCONFIG_ODSTOP_MASK (0x40U) -#define I3C_MCONFIG_ODSTOP_SHIFT (6U) -/*! ODSTOP - Open Drain Stop - * 0b1..Enable open-drain stop. STOP is emitted at open-drain speeds even for I3C messages. In legacy devices, - * this feature can ensure that the legacy devices see the STOP. - * 0b0..Disable open-drain stop. ODSTOP must be disabled when sending an HDR exit pattern. - */ -#define I3C_MCONFIG_ODSTOP(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_ODSTOP_SHIFT)) & I3C_MCONFIG_ODSTOP_MASK) - -#define I3C_MCONFIG_PPBAUD_MASK (0xF00U) -#define I3C_MCONFIG_PPBAUD_SHIFT (8U) -/*! PPBAUD - Push-Pull Baud Rate */ -#define I3C_MCONFIG_PPBAUD(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_PPBAUD_SHIFT)) & I3C_MCONFIG_PPBAUD_MASK) - -#define I3C_MCONFIG_PPLOW_MASK (0xF000U) -#define I3C_MCONFIG_PPLOW_SHIFT (12U) -/*! PPLOW - Push-Pull Low */ -#define I3C_MCONFIG_PPLOW(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_PPLOW_SHIFT)) & I3C_MCONFIG_PPLOW_MASK) - -#define I3C_MCONFIG_ODBAUD_MASK (0xFF0000U) -#define I3C_MCONFIG_ODBAUD_SHIFT (16U) -/*! ODBAUD - Open Drain Baud Rate */ -#define I3C_MCONFIG_ODBAUD(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_ODBAUD_SHIFT)) & I3C_MCONFIG_ODBAUD_MASK) - -#define I3C_MCONFIG_ODHPP_MASK (0x1000000U) -#define I3C_MCONFIG_ODHPP_SHIFT (24U) -/*! ODHPP - Open Drain High Push-Pull - * 0b1..ODHPP enabled. Open-Drain High SCL half-lock period is one PPBAUD count for I3C messages. This setting is - * faster (and works for I3C devices). Any legacy I2C devices on the bus will not see the SCL High at all - * (less than the spike filter period). - * 0b0..ODHPP disabled. Open-Drain SCL High half-clock period is the same as the Open-Drain Low SCL half-period. - */ -#define I3C_MCONFIG_ODHPP(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_ODHPP_SHIFT)) & I3C_MCONFIG_ODHPP_MASK) - -#define I3C_MCONFIG_SKEW_MASK (0xE000000U) -#define I3C_MCONFIG_SKEW_SHIFT (25U) -/*! SKEW - Skew */ -#define I3C_MCONFIG_SKEW(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_SKEW_SHIFT)) & I3C_MCONFIG_SKEW_MASK) - -#define I3C_MCONFIG_I2CBAUD_MASK (0xF0000000U) -#define I3C_MCONFIG_I2CBAUD_SHIFT (28U) -/*! I2CBAUD - I2C Baud Rate */ -#define I3C_MCONFIG_I2CBAUD(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_I2CBAUD_SHIFT)) & I3C_MCONFIG_I2CBAUD_MASK) -/*! @} */ - -/*! @name SCONFIG - Target Configuration */ -/*! @{ */ - -#define I3C_SCONFIG_SLVENA_MASK (0x1U) -#define I3C_SCONFIG_SLVENA_SHIFT (0U) -/*! SLVENA - Target Enable - * 0b1..Target can operate on the I2C or I3C bus - * 0b0..Target ignores the I2C or I3C bus - */ -#define I3C_SCONFIG_SLVENA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_SLVENA_SHIFT)) & I3C_SCONFIG_SLVENA_MASK) - -#define I3C_SCONFIG_NACK_MASK (0x2U) -#define I3C_SCONFIG_NACK_SHIFT (1U) -/*! NACK - Not Acknowledge - * 0b1..Always NACK enable. The target rejects all requests to it, except for a Common Command Code (CCC) - * broadcast. NACK = 1 should be used with caution, because the controller may decide that the target is missing, if - * NACK is overused. - * 0b0..Always NACK disable - */ -#define I3C_SCONFIG_NACK(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_NACK_SHIFT)) & I3C_SCONFIG_NACK_MASK) - -#define I3C_SCONFIG_MATCHSS_MASK (0x4U) -#define I3C_SCONFIG_MATCHSS_SHIFT (2U) -/*! MATCHSS - Match START or STOP - * 0b1..Match START or STOP enable. START and STOP sticky SSTATUS bits only become 1 when SSTATUS[MATCHED] is 1. - * This setting allows START and STOP to be used to detect the end of a message to/from this target. - * 0b0..Match START or STOP disable - */ -#define I3C_SCONFIG_MATCHSS(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_MATCHSS_SHIFT)) & I3C_SCONFIG_MATCHSS_MASK) - -#define I3C_SCONFIG_S0IGNORE_MASK (0x8U) -#define I3C_SCONFIG_S0IGNORE_SHIFT (3U) -/*! S0IGNORE - Ignore TE0/TE1 Errors - * 0b1..Ignore TE0/TE1 errors. Target does not detect TE0 or TE1 errors, so it does not lock up waiting on an - * Exit Pattern. This setting should only be used when the bus does not use HDR mode. - * 0b0..Do not ignore TE0/TE1 errors - */ -#define I3C_SCONFIG_S0IGNORE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_S0IGNORE_SHIFT)) & I3C_SCONFIG_S0IGNORE_MASK) - -#define I3C_SCONFIG_HDROK_MASK (0x10U) -#define I3C_SCONFIG_HDROK_SHIFT (4U) -/*! HDROK - HDR OK - * 0b1..Enable HDR OK. Allow HDR-DDR and/or HDR-BT messaging if available by setting the corresponding - * SIDEXT[BCR] bit to say HDR is available, and the corresponding GETCAPS bit for DDR and/or BT bit permitting use. - * 0b0..Disable HDR OK. - */ -#define I3C_SCONFIG_HDROK(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_HDROK_SHIFT)) & I3C_SCONFIG_HDROK_MASK) - -#define I3C_SCONFIG_OFFLINE_MASK (0x200U) -#define I3C_SCONFIG_OFFLINE_SHIFT (9U) -/*! OFFLINE - Offline - * 0b1..Enables wait to ensure the bus is not in HDR mode. - * 0b0..Disable - */ -#define I3C_SCONFIG_OFFLINE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_OFFLINE_SHIFT)) & I3C_SCONFIG_OFFLINE_MASK) - -#define I3C_SCONFIG_BAMATCH_MASK (0xFF0000U) -#define I3C_SCONFIG_BAMATCH_SHIFT (16U) -/*! BAMATCH - Bus Available Match */ -#define I3C_SCONFIG_BAMATCH(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_BAMATCH_SHIFT)) & I3C_SCONFIG_BAMATCH_MASK) - -#define I3C_SCONFIG_SADDR_MASK (0xFE000000U) -#define I3C_SCONFIG_SADDR_SHIFT (25U) -/*! SADDR - Static Address */ -#define I3C_SCONFIG_SADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_SADDR_SHIFT)) & I3C_SCONFIG_SADDR_MASK) -/*! @} */ - -/*! @name SSTATUS - Target Status */ -/*! @{ */ - -#define I3C_SSTATUS_STNOTSTOP_MASK (0x1U) -#define I3C_SSTATUS_STNOTSTOP_SHIFT (0U) -/*! STNOTSTOP - Status Not Stop - * 0b1..The bus is busy (has activity). - * 0b0..I3C module is in a STOP condition. - */ -#define I3C_SSTATUS_STNOTSTOP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STNOTSTOP_SHIFT)) & I3C_SSTATUS_STNOTSTOP_MASK) - -#define I3C_SSTATUS_STMSG_MASK (0x2U) -#define I3C_SSTATUS_STMSG_SHIFT (1U) -/*! STMSG - Status message - * 0b1..This bus target is listening to the bus traffic or responding. - * 0b0..Bus target not listening or responding. - */ -#define I3C_SSTATUS_STMSG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STMSG_SHIFT)) & I3C_SSTATUS_STMSG_MASK) - -#define I3C_SSTATUS_STCCCH_MASK (0x4U) -#define I3C_SSTATUS_STCCCH_SHIFT (2U) -/*! STCCCH - Status Common Command Code Handler - * 0b1..A CCC message is being handled automatically. - * 0b0..No CCC message is being handled. - */ -#define I3C_SSTATUS_STCCCH(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STCCCH_SHIFT)) & I3C_SSTATUS_STCCCH_MASK) - -#define I3C_SSTATUS_STREQRD_MASK (0x8U) -#define I3C_SSTATUS_STREQRD_SHIFT (3U) -/*! STREQRD - Status Request Read - * 0b1..The REQ in process is an SDR read from this target, or an In-Band Interrupt (IBI) is being pushed out. - * 0b0..REQ in process is not an SDR read from this target. - */ -#define I3C_SSTATUS_STREQRD(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STREQRD_SHIFT)) & I3C_SSTATUS_STREQRD_MASK) - -#define I3C_SSTATUS_STREQWR_MASK (0x10U) -#define I3C_SSTATUS_STREQWR_SHIFT (4U) -/*! STREQWR - Status Request Write - * 0b1..REQ in process is SDR write data from the controller to this bus target (or all targets), but not in ENTDAA mode. - * 0b0..REQ in process is not SDR write data from the controller. - */ -#define I3C_SSTATUS_STREQWR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STREQWR_SHIFT)) & I3C_SSTATUS_STREQWR_MASK) - -#define I3C_SSTATUS_STDAA_MASK (0x20U) -#define I3C_SSTATUS_STDAA_SHIFT (5U) -/*! STDAA - Status Dynamic Address Assignment - * 0b1..I3C bus is in Enter Dynamic Address Assignment (ENTDAA) mode, regardless of whether this bus target has a Dynamic Address or not. - * 0b0..Not in ENTDAA mode. - */ -#define I3C_SSTATUS_STDAA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STDAA_SHIFT)) & I3C_SSTATUS_STDAA_MASK) - -#define I3C_SSTATUS_STHDR_MASK (0x40U) -#define I3C_SSTATUS_STHDR_SHIFT (6U) -/*! STHDR - Status High Data Rate - * 0b1..The I3C bus is in HDR-DDR mode, regardless of whether HDR mode is supported by this module or not, and - * regardless of whether the message is to this module or to some other module. - * 0b0..I3C bus not in HDR-DDR mode - */ -#define I3C_SSTATUS_STHDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STHDR_SHIFT)) & I3C_SSTATUS_STHDR_MASK) - -#define I3C_SSTATUS_START_MASK (0x100U) -#define I3C_SSTATUS_START_SHIFT (8U) -/*! START - Start - * 0b1..A START or repeated START was seen after the START bit was last cleared. - * 0b0..No START seen. - */ -#define I3C_SSTATUS_START(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_START_SHIFT)) & I3C_SSTATUS_START_MASK) - -#define I3C_SSTATUS_MATCHED_MASK (0x200U) -#define I3C_SSTATUS_MATCHED_SHIFT (9U) -/*! MATCHED - Matched - * 0b1..An incoming header matched the I3C Dynamic or I2C Static address of this device (if any) since the bus was last cleared. - * 0b0..No header matched. - */ -#define I3C_SSTATUS_MATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_MATCHED_SHIFT)) & I3C_SSTATUS_MATCHED_MASK) - -#define I3C_SSTATUS_STOP_MASK (0x400U) -#define I3C_SSTATUS_STOP_SHIFT (10U) -/*! STOP - Stop - * 0b1..Stopped state detected. A STOP state was present on the bus since the bus was last cleared. - * 0b0..No STOP detected. - */ -#define I3C_SSTATUS_STOP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STOP_SHIFT)) & I3C_SSTATUS_STOP_MASK) - -#define I3C_SSTATUS_RX_PEND_MASK (0x800U) -#define I3C_SSTATUS_RX_PEND_SHIFT (11U) -/*! RX_PEND - Received Message Pending - * 0b1..Received message is pending. - * 0b0..No received message is pending. - */ -#define I3C_SSTATUS_RX_PEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_RX_PEND_SHIFT)) & I3C_SSTATUS_RX_PEND_MASK) - -#define I3C_SSTATUS_TXNOTFULL_MASK (0x1000U) -#define I3C_SSTATUS_TXNOTFULL_SHIFT (12U) -/*! TXNOTFULL - Transmit Buffer Is Not Full - * 0b1..Transmit buffer not full - * 0b0..Transmit buffer full - */ -#define I3C_SSTATUS_TXNOTFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_TXNOTFULL_SHIFT)) & I3C_SSTATUS_TXNOTFULL_MASK) - -#define I3C_SSTATUS_DACHG_MASK (0x2000U) -#define I3C_SSTATUS_DACHG_SHIFT (13U) -/*! DACHG - Dynamic Address Change - * 0b1..DA change detected. The target DA has been assigned, re-assigned, or reset (lost) and is now in the state of being valid or none. - * 0b0..No DA change detected. - */ -#define I3C_SSTATUS_DACHG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_DACHG_SHIFT)) & I3C_SSTATUS_DACHG_MASK) - -#define I3C_SSTATUS_CCC_MASK (0x4000U) -#define I3C_SSTATUS_CCC_SHIFT (14U) -/*! CCC - Common Command Code - * 0b1..CCC received. - * 0b0..No CCC received. - */ -#define I3C_SSTATUS_CCC(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_CCC_SHIFT)) & I3C_SSTATUS_CCC_MASK) - -#define I3C_SSTATUS_ERRWARN_MASK (0x8000U) -#define I3C_SSTATUS_ERRWARN_SHIFT (15U) -/*! ERRWARN - Error Warning */ -#define I3C_SSTATUS_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_ERRWARN_SHIFT)) & I3C_SSTATUS_ERRWARN_MASK) - -#define I3C_SSTATUS_HDRMATCH_MASK (0x10000U) -#define I3C_SSTATUS_HDRMATCH_SHIFT (16U) -/*! HDRMATCH - High Data Rate Command Match - * 0b1..HDR command matched the I3C Dynamic Address of this device. - * 0b0..HDR command did not match. - */ -#define I3C_SSTATUS_HDRMATCH(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_HDRMATCH_SHIFT)) & I3C_SSTATUS_HDRMATCH_MASK) - -#define I3C_SSTATUS_CHANDLED_MASK (0x20000U) -#define I3C_SSTATUS_CHANDLED_SHIFT (17U) -/*! CHANDLED - Common Command Code Handled - * 0b1..CCC handling in progress. - * 0b0..CCC handling not in progress. - */ -#define I3C_SSTATUS_CHANDLED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_CHANDLED_SHIFT)) & I3C_SSTATUS_CHANDLED_MASK) - -#define I3C_SSTATUS_EVENT_MASK (0x40000U) -#define I3C_SSTATUS_EVENT_SHIFT (18U) -/*! EVENT - Event - * 0b1..An IBI, CR, or HJ has occurred. - * 0b0..No event has occurred. - */ -#define I3C_SSTATUS_EVENT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_EVENT_SHIFT)) & I3C_SSTATUS_EVENT_MASK) - -#define I3C_SSTATUS_EVDET_MASK (0x300000U) -#define I3C_SSTATUS_EVDET_SHIFT (20U) -/*! EVDET - Event Details - * 0b00..NONE - * 0b01..NO_REQUEST - * 0b10..NACKED - * 0b11..ACKED - */ -#define I3C_SSTATUS_EVDET(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_EVDET_SHIFT)) & I3C_SSTATUS_EVDET_MASK) - -#define I3C_SSTATUS_IBIDIS_MASK (0x1000000U) -#define I3C_SSTATUS_IBIDIS_SHIFT (24U) -/*! IBIDIS - In-Band Interrupts Are Disabled - * 0b1..In-Band Interrupts disabled - * 0b0..In-Band Interrupts not disabled - */ -#define I3C_SSTATUS_IBIDIS(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_IBIDIS_SHIFT)) & I3C_SSTATUS_IBIDIS_MASK) - -#define I3C_SSTATUS_MRDIS_MASK (0x2000000U) -#define I3C_SSTATUS_MRDIS_SHIFT (25U) -/*! MRDIS - Controller Requests Are Disabled - * 0b1..Controller Requests disabled - * 0b0..Controller Requests not disabled - */ -#define I3C_SSTATUS_MRDIS(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_MRDIS_SHIFT)) & I3C_SSTATUS_MRDIS_MASK) - -#define I3C_SSTATUS_HJDIS_MASK (0x8000000U) -#define I3C_SSTATUS_HJDIS_SHIFT (27U) -/*! HJDIS - Hot-Join Disabled - * 0b1..Hot-Join disabled - * 0b0..Hot-Join not disabled - */ -#define I3C_SSTATUS_HJDIS(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_HJDIS_SHIFT)) & I3C_SSTATUS_HJDIS_MASK) - -#define I3C_SSTATUS_ACTSTATE_MASK (0x30000000U) -#define I3C_SSTATUS_ACTSTATE_SHIFT (28U) -/*! ACTSTATE - Activity State from Common Command Codes (CCC) - * 0b00..NO_LATENCY - * 0b01..LATENCY_1MS - * 0b10..LATENCY_100MS - * 0b11..LATENCY_10S - */ -#define I3C_SSTATUS_ACTSTATE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_ACTSTATE_SHIFT)) & I3C_SSTATUS_ACTSTATE_MASK) - -#define I3C_SSTATUS_TIMECTRL_MASK (0xC0000000U) -#define I3C_SSTATUS_TIMECTRL_SHIFT (30U) -/*! TIMECTRL - Time Control - * 0b00..NO_TIME_CONTROL - * 0b01..SYNC_MODE - * 0b10..ASYNC_MODE - * 0b11..BOTHSYNCASYNC - */ -#define I3C_SSTATUS_TIMECTRL(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_TIMECTRL_SHIFT)) & I3C_SSTATUS_TIMECTRL_MASK) -/*! @} */ - -/*! @name SCTRL - Target Control */ -/*! @{ */ - -#define I3C_SCTRL_EVENT_MASK (0x3U) -#define I3C_SCTRL_EVENT_SHIFT (0U) -/*! EVENT - Event - * 0b00..NORMAL_MODE - * 0b01..IBI - * 0b10..CONTROLLER_REQUEST - * 0b11..HOT_JOIN_REQUEST - */ -#define I3C_SCTRL_EVENT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCTRL_EVENT_SHIFT)) & I3C_SCTRL_EVENT_MASK) - -#define I3C_SCTRL_EXTDATA_MASK (0x8U) -#define I3C_SCTRL_EXTDATA_SHIFT (3U) -/*! EXTDATA - Extended Data - * 0b1..Extended data enabled. After IBIDATA is emitted, extended data is taken from IBIEXT1 and IBIEXT2 if configured. - * 0b0..Extended data disabled. - */ -#define I3C_SCTRL_EXTDATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCTRL_EXTDATA_SHIFT)) & I3C_SCTRL_EXTDATA_MASK) - -#define I3C_SCTRL_IBIDATA_MASK (0xFF00U) -#define I3C_SCTRL_IBIDATA_SHIFT (8U) -/*! IBIDATA - In-Band Interrupt Data */ -#define I3C_SCTRL_IBIDATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCTRL_IBIDATA_SHIFT)) & I3C_SCTRL_IBIDATA_MASK) - -#define I3C_SCTRL_PENDINT_MASK (0xF0000U) -#define I3C_SCTRL_PENDINT_SHIFT (16U) -/*! PENDINT - Pending Interrupt */ -#define I3C_SCTRL_PENDINT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCTRL_PENDINT_SHIFT)) & I3C_SCTRL_PENDINT_MASK) - -#define I3C_SCTRL_ACTSTATE_MASK (0x300000U) -#define I3C_SCTRL_ACTSTATE_SHIFT (20U) -/*! ACTSTATE - Activity State of Target */ -#define I3C_SCTRL_ACTSTATE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCTRL_ACTSTATE_SHIFT)) & I3C_SCTRL_ACTSTATE_MASK) - -#define I3C_SCTRL_VENDINFO_MASK (0xFF000000U) -#define I3C_SCTRL_VENDINFO_SHIFT (24U) -/*! VENDINFO - Vendor Information */ -#define I3C_SCTRL_VENDINFO(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCTRL_VENDINFO_SHIFT)) & I3C_SCTRL_VENDINFO_MASK) -/*! @} */ - -/*! @name SINTSET - Target Interrupt Set */ -/*! @{ */ - -#define I3C_SINTSET_START_MASK (0x100U) -#define I3C_SINTSET_START_SHIFT (8U) -/*! START - Start Interrupt Enable - * 0b1..Enable START interrupt - * 0b0..Disable START interrupt - */ -#define I3C_SINTSET_START(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_START_SHIFT)) & I3C_SINTSET_START_MASK) - -#define I3C_SINTSET_MATCHED_MASK (0x200U) -#define I3C_SINTSET_MATCHED_SHIFT (9U) -/*! MATCHED - Match Interrupt Enable - * 0b1..Enable match interrupt - * 0b0..Disable match interrupt - */ -#define I3C_SINTSET_MATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_MATCHED_SHIFT)) & I3C_SINTSET_MATCHED_MASK) - -#define I3C_SINTSET_STOP_MASK (0x400U) -#define I3C_SINTSET_STOP_SHIFT (10U) -/*! STOP - Stop Interrupt Enable - * 0b1..Enable STOP interrupt - * 0b0..Disable STOP interrupt - */ -#define I3C_SINTSET_STOP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_STOP_SHIFT)) & I3C_SINTSET_STOP_MASK) - -#define I3C_SINTSET_RXPEND_MASK (0x800U) -#define I3C_SINTSET_RXPEND_SHIFT (11U) -/*! RXPEND - Receive Interrupt Enable - * 0b1..Enable Receive interrupt - * 0b0..Disable Receive interrupt - */ -#define I3C_SINTSET_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_RXPEND_SHIFT)) & I3C_SINTSET_RXPEND_MASK) - -#define I3C_SINTSET_TXSEND_MASK (0x1000U) -#define I3C_SINTSET_TXSEND_SHIFT (12U) -/*! TXSEND - Transmit Interrupt Enable - * 0b1..Enable Transmit interrupt - * 0b0..Disable Transmit interrupt - */ -#define I3C_SINTSET_TXSEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_TXSEND_SHIFT)) & I3C_SINTSET_TXSEND_MASK) - -#define I3C_SINTSET_DACHG_MASK (0x2000U) -#define I3C_SINTSET_DACHG_SHIFT (13U) -/*! DACHG - Dynamic Address Change Interrupt Enable - * 0b1..Enable DA Change interrupt - * 0b0..Disable DA Change interrupt - */ -#define I3C_SINTSET_DACHG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_DACHG_SHIFT)) & I3C_SINTSET_DACHG_MASK) - -#define I3C_SINTSET_CCC_MASK (0x4000U) -#define I3C_SINTSET_CCC_SHIFT (14U) -/*! CCC - Common Command Code (CCC) Interrupt Enable - * 0b1..Enable CCC interrupt - * 0b0..Disable CCC interrupt - */ -#define I3C_SINTSET_CCC(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_CCC_SHIFT)) & I3C_SINTSET_CCC_MASK) - -#define I3C_SINTSET_ERRWARN_MASK (0x8000U) -#define I3C_SINTSET_ERRWARN_SHIFT (15U) -/*! ERRWARN - Error or Warning Interrupt Enable - * 0b1..Enable error or warning interrupt - * 0b0..Disable error or warning interrupt - */ -#define I3C_SINTSET_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_ERRWARN_SHIFT)) & I3C_SINTSET_ERRWARN_MASK) - -#define I3C_SINTSET_DDRMATCHED_MASK (0x10000U) -#define I3C_SINTSET_DDRMATCHED_SHIFT (16U) -/*! DDRMATCHED - Double Data Rate Interrupt Enable - * 0b1..Enable DDR interrupt - * 0b0..Disable DDR interrupt - */ -#define I3C_SINTSET_DDRMATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_DDRMATCHED_SHIFT)) & I3C_SINTSET_DDRMATCHED_MASK) - -#define I3C_SINTSET_CHANDLED_MASK (0x20000U) -#define I3C_SINTSET_CHANDLED_SHIFT (17U) -/*! CHANDLED - Common Command Code (CCC) Interrupt Enable - * 0b1..Enable CCC Handled interrupt - * 0b0..Disable CCC Handled interrupt - */ -#define I3C_SINTSET_CHANDLED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_CHANDLED_SHIFT)) & I3C_SINTSET_CHANDLED_MASK) - -#define I3C_SINTSET_EVENT_MASK (0x40000U) -#define I3C_SINTSET_EVENT_SHIFT (18U) -/*! EVENT - Event Interrupt Enable - * 0b1..Enable Event interrupt - * 0b0..Disable Event interrupt - */ -#define I3C_SINTSET_EVENT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_EVENT_SHIFT)) & I3C_SINTSET_EVENT_MASK) -/*! @} */ - -/*! @name SINTCLR - Target Interrupt Clear */ -/*! @{ */ - -#define I3C_SINTCLR_START_MASK (0x100U) -#define I3C_SINTCLR_START_SHIFT (8U) -/*! START - START Interrupt Enable Clear */ -#define I3C_SINTCLR_START(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_START_SHIFT)) & I3C_SINTCLR_START_MASK) - -#define I3C_SINTCLR_MATCHED_MASK (0x200U) -#define I3C_SINTCLR_MATCHED_SHIFT (9U) -/*! MATCHED - MATCHED Interrupt Enable Clear */ -#define I3C_SINTCLR_MATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_MATCHED_SHIFT)) & I3C_SINTCLR_MATCHED_MASK) - -#define I3C_SINTCLR_STOP_MASK (0x400U) -#define I3C_SINTCLR_STOP_SHIFT (10U) -/*! STOP - STOP Interrupt Enable Clear */ -#define I3C_SINTCLR_STOP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_STOP_SHIFT)) & I3C_SINTCLR_STOP_MASK) - -#define I3C_SINTCLR_RXPEND_MASK (0x800U) -#define I3C_SINTCLR_RXPEND_SHIFT (11U) -/*! RXPEND - RXPEND Interrupt Enable Clear */ -#define I3C_SINTCLR_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_RXPEND_SHIFT)) & I3C_SINTCLR_RXPEND_MASK) - -#define I3C_SINTCLR_TXSEND_MASK (0x1000U) -#define I3C_SINTCLR_TXSEND_SHIFT (12U) -/*! TXSEND - TXSEND Interrupt Enable Clear */ -#define I3C_SINTCLR_TXSEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_TXSEND_SHIFT)) & I3C_SINTCLR_TXSEND_MASK) - -#define I3C_SINTCLR_DACHG_MASK (0x2000U) -#define I3C_SINTCLR_DACHG_SHIFT (13U) -/*! DACHG - DACHG Interrupt Enable Clear */ -#define I3C_SINTCLR_DACHG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_DACHG_SHIFT)) & I3C_SINTCLR_DACHG_MASK) - -#define I3C_SINTCLR_CCC_MASK (0x4000U) -#define I3C_SINTCLR_CCC_SHIFT (14U) -/*! CCC - CCC Interrupt Enable Clear */ -#define I3C_SINTCLR_CCC(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_CCC_SHIFT)) & I3C_SINTCLR_CCC_MASK) - -#define I3C_SINTCLR_ERRWARN_MASK (0x8000U) -#define I3C_SINTCLR_ERRWARN_SHIFT (15U) -/*! ERRWARN - ERRWARN Interrupt Enable Clear */ -#define I3C_SINTCLR_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_ERRWARN_SHIFT)) & I3C_SINTCLR_ERRWARN_MASK) - -#define I3C_SINTCLR_DDRMATCHED_MASK (0x10000U) -#define I3C_SINTCLR_DDRMATCHED_SHIFT (16U) -/*! DDRMATCHED - DDRMATCHED Interrupt Enable Clear */ -#define I3C_SINTCLR_DDRMATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_DDRMATCHED_SHIFT)) & I3C_SINTCLR_DDRMATCHED_MASK) - -#define I3C_SINTCLR_CHANDLED_MASK (0x20000U) -#define I3C_SINTCLR_CHANDLED_SHIFT (17U) -/*! CHANDLED - CHANDLED Interrupt Enable Clear */ -#define I3C_SINTCLR_CHANDLED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_CHANDLED_SHIFT)) & I3C_SINTCLR_CHANDLED_MASK) - -#define I3C_SINTCLR_EVENT_MASK (0x40000U) -#define I3C_SINTCLR_EVENT_SHIFT (18U) -/*! EVENT - EVENT Interrupt Enable Clear */ -#define I3C_SINTCLR_EVENT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_EVENT_SHIFT)) & I3C_SINTCLR_EVENT_MASK) -/*! @} */ - -/*! @name SINTMASKED - Target Interrupt Mask */ -/*! @{ */ - -#define I3C_SINTMASKED_START_MASK (0x100U) -#define I3C_SINTMASKED_START_SHIFT (8U) -/*! START - START interrupt mask */ -#define I3C_SINTMASKED_START(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_START_SHIFT)) & I3C_SINTMASKED_START_MASK) - -#define I3C_SINTMASKED_MATCHED_MASK (0x200U) -#define I3C_SINTMASKED_MATCHED_SHIFT (9U) -/*! MATCHED - MATCHED Interrupt Mask */ -#define I3C_SINTMASKED_MATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_MATCHED_SHIFT)) & I3C_SINTMASKED_MATCHED_MASK) - -#define I3C_SINTMASKED_STOP_MASK (0x400U) -#define I3C_SINTMASKED_STOP_SHIFT (10U) -/*! STOP - STOP Interrupt Mask */ -#define I3C_SINTMASKED_STOP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_STOP_SHIFT)) & I3C_SINTMASKED_STOP_MASK) - -#define I3C_SINTMASKED_RXPEND_MASK (0x800U) -#define I3C_SINTMASKED_RXPEND_SHIFT (11U) -/*! RXPEND - RXPEND Interrupt Mask */ -#define I3C_SINTMASKED_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_RXPEND_SHIFT)) & I3C_SINTMASKED_RXPEND_MASK) - -#define I3C_SINTMASKED_TXSEND_MASK (0x1000U) -#define I3C_SINTMASKED_TXSEND_SHIFT (12U) -/*! TXSEND - TXSEND Interrupt Mask */ -#define I3C_SINTMASKED_TXSEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_TXSEND_SHIFT)) & I3C_SINTMASKED_TXSEND_MASK) - -#define I3C_SINTMASKED_DACHG_MASK (0x2000U) -#define I3C_SINTMASKED_DACHG_SHIFT (13U) -/*! DACHG - DACHG Interrupt Mask */ -#define I3C_SINTMASKED_DACHG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_DACHG_SHIFT)) & I3C_SINTMASKED_DACHG_MASK) - -#define I3C_SINTMASKED_CCC_MASK (0x4000U) -#define I3C_SINTMASKED_CCC_SHIFT (14U) -/*! CCC - CCC Interrupt Mask */ -#define I3C_SINTMASKED_CCC(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_CCC_SHIFT)) & I3C_SINTMASKED_CCC_MASK) - -#define I3C_SINTMASKED_ERRWARN_MASK (0x8000U) -#define I3C_SINTMASKED_ERRWARN_SHIFT (15U) -/*! ERRWARN - ERRWARN Interrupt Mask */ -#define I3C_SINTMASKED_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_ERRWARN_SHIFT)) & I3C_SINTMASKED_ERRWARN_MASK) - -#define I3C_SINTMASKED_DDRMATCHED_MASK (0x10000U) -#define I3C_SINTMASKED_DDRMATCHED_SHIFT (16U) -/*! DDRMATCHED - DDRMATCHED Interrupt Mask */ -#define I3C_SINTMASKED_DDRMATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_DDRMATCHED_SHIFT)) & I3C_SINTMASKED_DDRMATCHED_MASK) - -#define I3C_SINTMASKED_CHANDLED_MASK (0x20000U) -#define I3C_SINTMASKED_CHANDLED_SHIFT (17U) -/*! CHANDLED - CHANDLED Interrupt Mask */ -#define I3C_SINTMASKED_CHANDLED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_CHANDLED_SHIFT)) & I3C_SINTMASKED_CHANDLED_MASK) - -#define I3C_SINTMASKED_EVENT_MASK (0x40000U) -#define I3C_SINTMASKED_EVENT_SHIFT (18U) -/*! EVENT - EVENT Interrupt Mask */ -#define I3C_SINTMASKED_EVENT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_EVENT_SHIFT)) & I3C_SINTMASKED_EVENT_MASK) -/*! @} */ - -/*! @name SERRWARN - Target Errors and Warnings */ -/*! @{ */ - -#define I3C_SERRWARN_ORUN_MASK (0x1U) -#define I3C_SERRWARN_ORUN_SHIFT (0U) -/*! ORUN - Overrun Error - * 0b1..Overrun error - * 0b0..No overrun error - */ -#define I3C_SERRWARN_ORUN(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_ORUN_SHIFT)) & I3C_SERRWARN_ORUN_MASK) - -#define I3C_SERRWARN_URUN_MASK (0x2U) -#define I3C_SERRWARN_URUN_SHIFT (1U) -/*! URUN - Underrun Error - * 0b1..Underrun error - * 0b0..No underrun error - */ -#define I3C_SERRWARN_URUN(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_URUN_SHIFT)) & I3C_SERRWARN_URUN_MASK) - -#define I3C_SERRWARN_URUNNACK_MASK (0x4U) -#define I3C_SERRWARN_URUNNACK_SHIFT (2U) -/*! URUNNACK - Underrun and Not Acknowledged (NACKED) Error - * 0b1..Underrun and not acknowledged error - * 0b0..No underrun and not acknowledged error - */ -#define I3C_SERRWARN_URUNNACK(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_URUNNACK_SHIFT)) & I3C_SERRWARN_URUNNACK_MASK) - -#define I3C_SERRWARN_TERM_MASK (0x8U) -#define I3C_SERRWARN_TERM_SHIFT (3U) -/*! TERM - Terminated Error - * 0b1..Terminated error - * 0b0..No terminated error - */ -#define I3C_SERRWARN_TERM(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_TERM_SHIFT)) & I3C_SERRWARN_TERM_MASK) - -#define I3C_SERRWARN_INVSTART_MASK (0x10U) -#define I3C_SERRWARN_INVSTART_SHIFT (4U) -/*! INVSTART - Invalid Start Error - * 0b1..Invalid start error - * 0b0..No invalid start error - */ -#define I3C_SERRWARN_INVSTART(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_INVSTART_SHIFT)) & I3C_SERRWARN_INVSTART_MASK) - -#define I3C_SERRWARN_SPAR_MASK (0x100U) -#define I3C_SERRWARN_SPAR_SHIFT (8U) -/*! SPAR - SDR Parity Error - * 0b1..SDR Parity error - * 0b0..No SDR Parity error - */ -#define I3C_SERRWARN_SPAR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_SPAR_SHIFT)) & I3C_SERRWARN_SPAR_MASK) - -#define I3C_SERRWARN_HPAR_MASK (0x200U) -#define I3C_SERRWARN_HPAR_SHIFT (9U) -/*! HPAR - HDR Parity Error - * 0b1..HDR Parity error - * 0b0..No HDR Parity error - */ -#define I3C_SERRWARN_HPAR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_HPAR_SHIFT)) & I3C_SERRWARN_HPAR_MASK) - -#define I3C_SERRWARN_HCRC_MASK (0x400U) -#define I3C_SERRWARN_HCRC_SHIFT (10U) -/*! HCRC - HDR-DDR CRC Error - * 0b1..HDR-DDR CRC error - * 0b0..No HDR-DDR CRC error - */ -#define I3C_SERRWARN_HCRC(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_HCRC_SHIFT)) & I3C_SERRWARN_HCRC_MASK) - -#define I3C_SERRWARN_S0S1_MASK (0x800U) -#define I3C_SERRWARN_S0S1_SHIFT (11U) -/*! S0S1 - TE0 or TE1 Error - * 0b1..TE0 or TE1 error - * 0b0..No TE0 or TE1 error - */ -#define I3C_SERRWARN_S0S1(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_S0S1_SHIFT)) & I3C_SERRWARN_S0S1_MASK) - -#define I3C_SERRWARN_OREAD_MASK (0x10000U) -#define I3C_SERRWARN_OREAD_SHIFT (16U) -/*! OREAD - Over-read Error - * 0b1..Over-read error - * 0b0..No Over-read error - */ -#define I3C_SERRWARN_OREAD(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_OREAD_SHIFT)) & I3C_SERRWARN_OREAD_MASK) - -#define I3C_SERRWARN_OWRITE_MASK (0x20000U) -#define I3C_SERRWARN_OWRITE_SHIFT (17U) -/*! OWRITE - Over-write Error - * 0b1..Overwrite error - * 0b0..No Overwrite error - */ -#define I3C_SERRWARN_OWRITE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_OWRITE_SHIFT)) & I3C_SERRWARN_OWRITE_MASK) -/*! @} */ - -/*! @name SDMACTRL - Target DMA Control */ -/*! @{ */ - -#define I3C_SDMACTRL_DMAFB_MASK (0x3U) -#define I3C_SDMACTRL_DMAFB_SHIFT (0U) -/*! DMAFB - DMA Read (From-bus) Trigger - * 0b00..DMA not used - * 0b01..DMA is enabled for one frame - * 0b10..DMA enabled until turned off - * 0b11.. - */ -#define I3C_SDMACTRL_DMAFB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDMACTRL_DMAFB_SHIFT)) & I3C_SDMACTRL_DMAFB_MASK) - -#define I3C_SDMACTRL_DMATB_MASK (0xCU) -#define I3C_SDMACTRL_DMATB_SHIFT (2U) -/*! DMATB - DMA Write (To-bus) Trigger - * 0b00..DMA not used - * 0b01..DMA enabled for one frame (ended by DMA or terminated) - * 0b10..DMA enabled until turned off - * 0b11.. - */ -#define I3C_SDMACTRL_DMATB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDMACTRL_DMATB_SHIFT)) & I3C_SDMACTRL_DMATB_MASK) - -#define I3C_SDMACTRL_DMAWIDTH_MASK (0x30U) -#define I3C_SDMACTRL_DMAWIDTH_SHIFT (4U) -/*! DMAWIDTH - Width of DMA Operations - * 0b00, 0b01..Byte - * 0b10..Half word (16 bits) - * 0b11.. - */ -#define I3C_SDMACTRL_DMAWIDTH(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDMACTRL_DMAWIDTH_SHIFT)) & I3C_SDMACTRL_DMAWIDTH_MASK) -/*! @} */ - -/*! @name SDATACTRL - Target Data Control */ -/*! @{ */ - -#define I3C_SDATACTRL_FLUSHTB_MASK (0x1U) -#define I3C_SDATACTRL_FLUSHTB_SHIFT (0U) -/*! FLUSHTB - Flush the To-bus Buffer or FIFO */ -#define I3C_SDATACTRL_FLUSHTB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_FLUSHTB_SHIFT)) & I3C_SDATACTRL_FLUSHTB_MASK) - -#define I3C_SDATACTRL_FLUSHFB_MASK (0x2U) -#define I3C_SDATACTRL_FLUSHFB_SHIFT (1U) -/*! FLUSHFB - Flush the From-bus Buffer or FIFO */ -#define I3C_SDATACTRL_FLUSHFB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_FLUSHFB_SHIFT)) & I3C_SDATACTRL_FLUSHFB_MASK) - -#define I3C_SDATACTRL_UNLOCK_MASK (0x8U) -#define I3C_SDATACTRL_UNLOCK_SHIFT (3U) -/*! UNLOCK - Unlock - * 0b0..RXTRIG and TXTRIG fields cannot be changed on a write. - * 0b1..RXTRIG and TXTRIG fields can be changed on a write. - */ -#define I3C_SDATACTRL_UNLOCK(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_UNLOCK_SHIFT)) & I3C_SDATACTRL_UNLOCK_MASK) - -#define I3C_SDATACTRL_TXTRIG_MASK (0x30U) -#define I3C_SDATACTRL_TXTRIG_SHIFT (4U) -/*! TXTRIG - Transmit Trigger Level - * 0b00..Trigger when empty - * 0b01..Trigger when 1/4 full or less - * 0b10..Trigger when 1/2 full or less - * 0b11..Default. Trigger when 1 less than full or less - */ -#define I3C_SDATACTRL_TXTRIG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_TXTRIG_SHIFT)) & I3C_SDATACTRL_TXTRIG_MASK) - -#define I3C_SDATACTRL_RXTRIG_MASK (0xC0U) -#define I3C_SDATACTRL_RXTRIG_SHIFT (6U) -/*! RXTRIG - Receive Trigger Level - * 0b00..Trigger when not empty - * 0b01..Trigger when 1/4 or more full - * 0b10..Trigger when 1/2 or more full - * 0b11..Trigger when 3/4 or more full - */ -#define I3C_SDATACTRL_RXTRIG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_RXTRIG_SHIFT)) & I3C_SDATACTRL_RXTRIG_MASK) - -#define I3C_SDATACTRL_TXCOUNT_MASK (0x1F0000U) -#define I3C_SDATACTRL_TXCOUNT_SHIFT (16U) -/*! TXCOUNT - Count of Bytes in Transmit */ -#define I3C_SDATACTRL_TXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_TXCOUNT_SHIFT)) & I3C_SDATACTRL_TXCOUNT_MASK) - -#define I3C_SDATACTRL_RXCOUNT_MASK (0x1F000000U) -#define I3C_SDATACTRL_RXCOUNT_SHIFT (24U) -/*! RXCOUNT - Count of Bytes in Receive */ -#define I3C_SDATACTRL_RXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_RXCOUNT_SHIFT)) & I3C_SDATACTRL_RXCOUNT_MASK) - -#define I3C_SDATACTRL_TXFULL_MASK (0x40000000U) -#define I3C_SDATACTRL_TXFULL_SHIFT (30U) -/*! TXFULL - Transmit Is Full - * 0b1..Full - * 0b0..Not full - */ -#define I3C_SDATACTRL_TXFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_TXFULL_SHIFT)) & I3C_SDATACTRL_TXFULL_MASK) - -#define I3C_SDATACTRL_RXEMPTY_MASK (0x80000000U) -#define I3C_SDATACTRL_RXEMPTY_SHIFT (31U) -/*! RXEMPTY - Receive Is Empty - * 0b1..Empty - * 0b0..Not empty - */ -#define I3C_SDATACTRL_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_RXEMPTY_SHIFT)) & I3C_SDATACTRL_RXEMPTY_MASK) -/*! @} */ - -/*! @name SWDATAB - Target Write Data Byte */ -/*! @{ */ - -#define I3C_SWDATAB_DATA_MASK (0xFFU) -#define I3C_SWDATAB_DATA_SHIFT (0U) -/*! DATA - Data */ -#define I3C_SWDATAB_DATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAB_DATA_SHIFT)) & I3C_SWDATAB_DATA_MASK) - -#define I3C_SWDATAB_END_MASK (0x100U) -#define I3C_SWDATAB_END_SHIFT (8U) -/*! END - End - * 0b1..End. This bit marks the last byte of the message. - * 0b0..Not the end. There are more bytes in the message. - */ -#define I3C_SWDATAB_END(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAB_END_SHIFT)) & I3C_SWDATAB_END_MASK) - -#define I3C_SWDATAB_END_ALSO_MASK (0x10000U) -#define I3C_SWDATAB_END_ALSO_SHIFT (16U) -/*! END_ALSO - End Also - * 0b1..End. This bit marks the last byte of the message. - * 0b0..Not the end. There are more bytes in the message. - */ -#define I3C_SWDATAB_END_ALSO(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAB_END_ALSO_SHIFT)) & I3C_SWDATAB_END_ALSO_MASK) -/*! @} */ - -/*! @name SWDATABE - Target Write Data Byte End */ -/*! @{ */ - -#define I3C_SWDATABE_DATA_MASK (0xFFU) -#define I3C_SWDATABE_DATA_SHIFT (0U) -/*! DATA - Data */ -#define I3C_SWDATABE_DATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATABE_DATA_SHIFT)) & I3C_SWDATABE_DATA_MASK) -/*! @} */ - -/*! @name SWDATAH - Target Write Data Half-word */ -/*! @{ */ - -#define I3C_SWDATAH_DATA0_MASK (0xFFU) -#define I3C_SWDATAH_DATA0_SHIFT (0U) -/*! DATA0 - Data 0 */ -#define I3C_SWDATAH_DATA0(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAH_DATA0_SHIFT)) & I3C_SWDATAH_DATA0_MASK) - -#define I3C_SWDATAH_DATA1_MASK (0xFF00U) -#define I3C_SWDATAH_DATA1_SHIFT (8U) -/*! DATA1 - Data 1 */ -#define I3C_SWDATAH_DATA1(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAH_DATA1_SHIFT)) & I3C_SWDATAH_DATA1_MASK) - -#define I3C_SWDATAH_END_MASK (0x10000U) -#define I3C_SWDATAH_END_SHIFT (16U) -/*! END - End of message - * 0b1..End. This bit marks the last byte of the message. - * 0b0..Not the end. There are more bytes in the message. - */ -#define I3C_SWDATAH_END(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAH_END_SHIFT)) & I3C_SWDATAH_END_MASK) -/*! @} */ - -/*! @name SWDATAHE - Target Write Data Half-word End */ -/*! @{ */ - -#define I3C_SWDATAHE_DATA0_MASK (0xFFU) -#define I3C_SWDATAHE_DATA0_SHIFT (0U) -/*! DATA0 - Data 0 */ -#define I3C_SWDATAHE_DATA0(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAHE_DATA0_SHIFT)) & I3C_SWDATAHE_DATA0_MASK) - -#define I3C_SWDATAHE_DATA1_MASK (0xFF00U) -#define I3C_SWDATAHE_DATA1_SHIFT (8U) -/*! DATA1 - Data 1 */ -#define I3C_SWDATAHE_DATA1(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAHE_DATA1_SHIFT)) & I3C_SWDATAHE_DATA1_MASK) -/*! @} */ - -/*! @name SRDATAB - Target Read Data Byte */ -/*! @{ */ - -#define I3C_SRDATAB_DATA0_MASK (0xFFU) -#define I3C_SRDATAB_DATA0_SHIFT (0U) -/*! DATA0 - Data 0 */ -#define I3C_SRDATAB_DATA0(x) (((uint32_t)(((uint32_t)(x)) << I3C_SRDATAB_DATA0_SHIFT)) & I3C_SRDATAB_DATA0_MASK) -/*! @} */ - -/*! @name SRDATAH - Target Read Data Halfword */ -/*! @{ */ - -#define I3C_SRDATAH_LSB_MASK (0xFFU) -#define I3C_SRDATAH_LSB_SHIFT (0U) -/*! LSB - The first byte read from the target */ -#define I3C_SRDATAH_LSB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SRDATAH_LSB_SHIFT)) & I3C_SRDATAH_LSB_MASK) - -#define I3C_SRDATAH_MSB_MASK (0xFF00U) -#define I3C_SRDATAH_MSB_SHIFT (8U) -/*! MSB - The second byte read from the target */ -#define I3C_SRDATAH_MSB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SRDATAH_MSB_SHIFT)) & I3C_SRDATAH_MSB_MASK) -/*! @} */ - -/*! @name SWDATAB1 - Target Write Data Byte */ -/*! @{ */ - -#define I3C_SWDATAB1_DATA_MASK (0xFFU) -#define I3C_SWDATAB1_DATA_SHIFT (0U) -/*! DATA - Data */ -#define I3C_SWDATAB1_DATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAB1_DATA_SHIFT)) & I3C_SWDATAB1_DATA_MASK) -/*! @} */ - -/*! @name SWDATAH1 - Target Write Data Halfword */ -/*! @{ */ - -#define I3C_SWDATAH1_DATA_MASK (0xFFFFU) -#define I3C_SWDATAH1_DATA_SHIFT (0U) -/*! DATA - Data */ -#define I3C_SWDATAH1_DATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAH1_DATA_SHIFT)) & I3C_SWDATAH1_DATA_MASK) -/*! @} */ - -/*! @name SCAPABILITIES2 - Target Capabilities 2 */ -/*! @{ */ - -#define I3C_SCAPABILITIES2_MAPCNT_MASK (0xFU) -#define I3C_SCAPABILITIES2_MAPCNT_SHIFT (0U) -/*! MAPCNT - Map Count */ -#define I3C_SCAPABILITIES2_MAPCNT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_MAPCNT_SHIFT)) & I3C_SCAPABILITIES2_MAPCNT_MASK) - -#define I3C_SCAPABILITIES2_I2C10B_MASK (0x10U) -#define I3C_SCAPABILITIES2_I2C10B_SHIFT (4U) -/*! I2C10B - I2C 10-bit Address - * 0b0..Does not support 10-bit I2C address - * 0b1..Supports 10-bit I2C address - */ -#define I3C_SCAPABILITIES2_I2C10B(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_I2C10B_SHIFT)) & I3C_SCAPABILITIES2_I2C10B_MASK) - -#define I3C_SCAPABILITIES2_I2CRST_MASK (0x20U) -#define I3C_SCAPABILITIES2_I2CRST_SHIFT (5U) -/*! I2CRST - I2C Software Reset - * 0b0..Does not support I2C software reset - * 0b1..Supports I2C software reset - */ -#define I3C_SCAPABILITIES2_I2CRST(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_I2CRST_SHIFT)) & I3C_SCAPABILITIES2_I2CRST_MASK) - -#define I3C_SCAPABILITIES2_I2CDEVID_MASK (0x40U) -#define I3C_SCAPABILITIES2_I2CDEVID_SHIFT (6U) -/*! I2CDEVID - I2C Device ID - * 0b0..Does not support I2C device ID - * 0b1..Supports I2C device ID - */ -#define I3C_SCAPABILITIES2_I2CDEVID(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_I2CDEVID_SHIFT)) & I3C_SCAPABILITIES2_I2CDEVID_MASK) - -#define I3C_SCAPABILITIES2_IBIEXT_MASK (0x100U) -#define I3C_SCAPABILITIES2_IBIEXT_SHIFT (8U) -/*! IBIEXT - In-Band Interrupt EXTDATA - * 0b0..Does not support IBIEXT - * 0b1..Supports IBIEXT - */ -#define I3C_SCAPABILITIES2_IBIEXT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_IBIEXT_SHIFT)) & I3C_SCAPABILITIES2_IBIEXT_MASK) - -#define I3C_SCAPABILITIES2_IBIXREG_MASK (0x200U) -#define I3C_SCAPABILITIES2_IBIXREG_SHIFT (9U) -/*! IBIXREG - In-Band Interrupt Extended Register - * 0b0..Does not support extended registers for IBIs - * 0b1..Supports extended registers for IBIs - */ -#define I3C_SCAPABILITIES2_IBIXREG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_IBIXREG_SHIFT)) & I3C_SCAPABILITIES2_IBIXREG_MASK) - -#define I3C_SCAPABILITIES2_SLVRST_MASK (0x20000U) -#define I3C_SCAPABILITIES2_SLVRST_SHIFT (17U) -/*! SLVRST - Target Reset - * 0b0..Does not support Target Reset - * 0b1..Supports Target Reset - */ -#define I3C_SCAPABILITIES2_SLVRST(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_SLVRST_SHIFT)) & I3C_SCAPABILITIES2_SLVRST_MASK) - -#define I3C_SCAPABILITIES2_GROUP_MASK (0xC0000U) -#define I3C_SCAPABILITIES2_GROUP_SHIFT (18U) -/*! GROUP - Group - * 0b00..Does not supports v1.1 Group addressing - * 0b01..Supports one group - * 0b10..Supports two groups - * 0b11..Supports three groups - */ -#define I3C_SCAPABILITIES2_GROUP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_GROUP_SHIFT)) & I3C_SCAPABILITIES2_GROUP_MASK) - -#define I3C_SCAPABILITIES2_AASA_MASK (0x200000U) -#define I3C_SCAPABILITIES2_AASA_SHIFT (21U) -/*! AASA - Supports SETAASA - * 0b1..Supports SETAASA - * 0b0..Does not support SETAASA - */ -#define I3C_SCAPABILITIES2_AASA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_AASA_SHIFT)) & I3C_SCAPABILITIES2_AASA_MASK) - -#define I3C_SCAPABILITIES2_SSTSUB_MASK (0x400000U) -#define I3C_SCAPABILITIES2_SSTSUB_SHIFT (22U) -/*! SSTSUB - Target-Target(s)-Tunnel Subscriber Capable - * 0b1..Subscriber capable - * 0b0..Not subscriber capable - */ -#define I3C_SCAPABILITIES2_SSTSUB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_SSTSUB_SHIFT)) & I3C_SCAPABILITIES2_SSTSUB_MASK) - -#define I3C_SCAPABILITIES2_SSTWR_MASK (0x800000U) -#define I3C_SCAPABILITIES2_SSTWR_SHIFT (23U) -/*! SSTWR - Target-Target(s)-Tunnel Write Capable - * 0b1..Write capable - * 0b0..Not write capable - */ -#define I3C_SCAPABILITIES2_SSTWR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_SSTWR_SHIFT)) & I3C_SCAPABILITIES2_SSTWR_MASK) -/*! @} */ - -/*! @name SCAPABILITIES - Target Capabilities */ -/*! @{ */ - -#define I3C_SCAPABILITIES_IDENA_MASK (0x3U) -#define I3C_SCAPABILITIES_IDENA_SHIFT (0U) -/*! IDENA - ID 48b Handler - * 0b00..Application - * 0b01..Hardware - * 0b10..Hardware, but the I3C module instance handles ID 48b - * 0b11..A part number register (PARTNO) - */ -#define I3C_SCAPABILITIES_IDENA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_IDENA_SHIFT)) & I3C_SCAPABILITIES_IDENA_MASK) - -#define I3C_SCAPABILITIES_IDREG_MASK (0x3CU) -#define I3C_SCAPABILITIES_IDREG_SHIFT (2U) -/*! IDREG - ID Register - * 0b0000..All ID register features below are disabled. - * 0bxxx1..ID Instance is a register, and is used if there is no PARTNO register. - * 0bxx1x..An ID Random field is available. - * 0bx1xx..A Device Characteristic Register (DCR) is available. - * 0b1xxx..A Bus Characteristics Register (BCR) is available. - */ -#define I3C_SCAPABILITIES_IDREG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_IDREG_SHIFT)) & I3C_SCAPABILITIES_IDREG_MASK) - -#define I3C_SCAPABILITIES_HDRSUPP_MASK (0xC0U) -#define I3C_SCAPABILITIES_HDRSUPP_SHIFT (6U) -/*! HDRSUPP - High Data Rate Support - * 0b00..No HDR modes supported - * 0b01..Double Data Rate mode supported - * *.. - */ -#define I3C_SCAPABILITIES_HDRSUPP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_HDRSUPP_SHIFT)) & I3C_SCAPABILITIES_HDRSUPP_MASK) - -#define I3C_SCAPABILITIES_MASTER_MASK (0x200U) -#define I3C_SCAPABILITIES_MASTER_SHIFT (9U) -/*! MASTER - Controller - * 0b0..Not supported - * 0b1..Supported - */ -#define I3C_SCAPABILITIES_MASTER(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_MASTER_SHIFT)) & I3C_SCAPABILITIES_MASTER_MASK) - -#define I3C_SCAPABILITIES_SADDR_MASK (0xC00U) -#define I3C_SCAPABILITIES_SADDR_SHIFT (10U) -/*! SADDR - Static Address - * 0b00..No static address - * 0b01..Static address is fixed in hardware - * 0b10..Hardware controls the static address dynamically (for example, from the pin strap) - * 0b11..SCONFIG register supplies the static address - */ -#define I3C_SCAPABILITIES_SADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_SADDR_SHIFT)) & I3C_SCAPABILITIES_SADDR_MASK) - -#define I3C_SCAPABILITIES_CCCHANDLE_MASK (0xF000U) -#define I3C_SCAPABILITIES_CCCHANDLE_SHIFT (12U) -/*! CCCHANDLE - Common Command Codes Handling - * 0b0000..All handling features below are disabled. - * 0bxxx1..The block (I3C module) manages events, activities, status, HDR, and if enabled for it, ID and static-address-related items. - * 0bxx1x..The block manages maximum read and write lengths, and max data speed. - * 0bx1xx..GETSTATUS CCC returns SCTRL[PENDINT] and SCTRL[ACTSTATE] values. - * 0b1xxx..GETSTATUS CCC returns SCTRL[VENDINFO] value. - */ -#define I3C_SCAPABILITIES_CCCHANDLE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_CCCHANDLE_SHIFT)) & I3C_SCAPABILITIES_CCCHANDLE_MASK) - -#define I3C_SCAPABILITIES_IBI_MR_HJ_MASK (0x1F0000U) -#define I3C_SCAPABILITIES_IBI_MR_HJ_SHIFT (16U) -/*! IBI_MR_HJ - In-Band Interrupts, Controller Requests, Hot-Join Events - * 0b00000..Application cannot generate IBI, CR, or HJ. - * 0bxxxx1..Application can generate an IBI. - * 0bxxx1x..When bit 0 = 1, the IBI has data from the SCTRL register. - * 0bxx1xx..Application can generate a Controller Request for a secondary controller. - * 0bx1xxx..Application can generate a Hot-Join event. - * 0b1xxxx..Application can use SCONFIG[BAMATCH] for bus-available timing. - */ -#define I3C_SCAPABILITIES_IBI_MR_HJ(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_IBI_MR_HJ_SHIFT)) & I3C_SCAPABILITIES_IBI_MR_HJ_MASK) - -#define I3C_SCAPABILITIES_TIMECTRL_MASK (0x200000U) -#define I3C_SCAPABILITIES_TIMECTRL_SHIFT (21U) -/*! TIMECTRL - Time Control - * 0b0..No time control enabled - * 0b1..At least one time-control type supported - */ -#define I3C_SCAPABILITIES_TIMECTRL(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_TIMECTRL_SHIFT)) & I3C_SCAPABILITIES_TIMECTRL_MASK) - -#define I3C_SCAPABILITIES_EXTFIFO_MASK (0x3800000U) -#define I3C_SCAPABILITIES_EXTFIFO_SHIFT (23U) -/*! EXTFIFO - External FIFO - * 0b000..No external FIFO is available - * 0b001..Standard available or free external FIFO - * 0b010..Request track external FIFO - * *.. - */ -#define I3C_SCAPABILITIES_EXTFIFO(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_EXTFIFO_SHIFT)) & I3C_SCAPABILITIES_EXTFIFO_MASK) - -#define I3C_SCAPABILITIES_FIFOTX_MASK (0xC000000U) -#define I3C_SCAPABILITIES_FIFOTX_SHIFT (26U) -/*! FIFOTX - FIFO Transmit - * 0b00..Two - * 0b01..Four - * 0b10..Eight - * 0b11..16 or larger - */ -#define I3C_SCAPABILITIES_FIFOTX(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_FIFOTX_SHIFT)) & I3C_SCAPABILITIES_FIFOTX_MASK) - -#define I3C_SCAPABILITIES_FIFORX_MASK (0x30000000U) -#define I3C_SCAPABILITIES_FIFORX_SHIFT (28U) -/*! FIFORX - FIFO Receive - * 0b00..Two or three - * 0b01..Four - * 0b10..Eight - * 0b11..16 or larger - */ -#define I3C_SCAPABILITIES_FIFORX(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_FIFORX_SHIFT)) & I3C_SCAPABILITIES_FIFORX_MASK) - -#define I3C_SCAPABILITIES_INT_MASK (0x40000000U) -#define I3C_SCAPABILITIES_INT_SHIFT (30U) -/*! INT - Interrupts - * 0b1..Supported - * 0b0..Not supported - */ -#define I3C_SCAPABILITIES_INT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_INT_SHIFT)) & I3C_SCAPABILITIES_INT_MASK) - -#define I3C_SCAPABILITIES_DMA_MASK (0x80000000U) -#define I3C_SCAPABILITIES_DMA_SHIFT (31U) -/*! DMA - Direct Memory Access - * 0b1..Supported - * 0b0..Not supported - */ -#define I3C_SCAPABILITIES_DMA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_DMA_SHIFT)) & I3C_SCAPABILITIES_DMA_MASK) -/*! @} */ - -/*! @name SDYNADDR - Target Dynamic Address */ -/*! @{ */ - -#define I3C_SDYNADDR_DAVALID_MASK (0x1U) -#define I3C_SDYNADDR_DAVALID_SHIFT (0U) -/*! DAVALID - Dynamic Address Valid - * 0b0..DANOTASSIGNED: a Dynamic Address is not assigned - * 0b1..DAASSIGNED: a Dynamic Address is assigned - */ -#define I3C_SDYNADDR_DAVALID(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDYNADDR_DAVALID_SHIFT)) & I3C_SDYNADDR_DAVALID_MASK) - -#define I3C_SDYNADDR_DADDR_MASK (0xFEU) -#define I3C_SDYNADDR_DADDR_SHIFT (1U) -/*! DADDR - Dynamic Address */ -#define I3C_SDYNADDR_DADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDYNADDR_DADDR_SHIFT)) & I3C_SDYNADDR_DADDR_MASK) - -#define I3C_SDYNADDR_MAPSA_MASK (0x1000U) -#define I3C_SDYNADDR_MAPSA_SHIFT (12U) -/*! MAPSA - Map a Static Address */ -#define I3C_SDYNADDR_MAPSA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDYNADDR_MAPSA_SHIFT)) & I3C_SDYNADDR_MAPSA_MASK) - -#define I3C_SDYNADDR_SA10B_MASK (0xE000U) -#define I3C_SDYNADDR_SA10B_SHIFT (13U) -/*! SA10B - 10bit Static Address */ -#define I3C_SDYNADDR_SA10B(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDYNADDR_SA10B_SHIFT)) & I3C_SDYNADDR_SA10B_MASK) - -#define I3C_SDYNADDR_KEY_MASK (0xFFFF0000U) -#define I3C_SDYNADDR_KEY_SHIFT (16U) -/*! KEY - Key */ -#define I3C_SDYNADDR_KEY(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDYNADDR_KEY_SHIFT)) & I3C_SDYNADDR_KEY_MASK) -/*! @} */ - -/*! @name SMAXLIMITS - Target Maximum Limits */ -/*! @{ */ - -#define I3C_SMAXLIMITS_MAXRD_MASK (0xFFFU) -#define I3C_SMAXLIMITS_MAXRD_SHIFT (0U) -/*! MAXRD - Maximum Read Length */ -#define I3C_SMAXLIMITS_MAXRD(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMAXLIMITS_MAXRD_SHIFT)) & I3C_SMAXLIMITS_MAXRD_MASK) - -#define I3C_SMAXLIMITS_MAXWR_MASK (0xFFF0000U) -#define I3C_SMAXLIMITS_MAXWR_SHIFT (16U) -/*! MAXWR - Maximum Write Length */ -#define I3C_SMAXLIMITS_MAXWR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMAXLIMITS_MAXWR_SHIFT)) & I3C_SMAXLIMITS_MAXWR_MASK) -/*! @} */ - -/*! @name SIDPARTNO - Target ID Part Number */ -/*! @{ */ - -#define I3C_SIDPARTNO_PARTNO_MASK (0xFFFFFFFFU) -#define I3C_SIDPARTNO_PARTNO_SHIFT (0U) -/*! PARTNO - Part number */ -#define I3C_SIDPARTNO_PARTNO(x) (((uint32_t)(((uint32_t)(x)) << I3C_SIDPARTNO_PARTNO_SHIFT)) & I3C_SIDPARTNO_PARTNO_MASK) -/*! @} */ - -/*! @name SIDEXT - Target ID Extension */ -/*! @{ */ - -#define I3C_SIDEXT_DCR_MASK (0xFF00U) -#define I3C_SIDEXT_DCR_SHIFT (8U) -/*! DCR - Device Characteristic Register */ -#define I3C_SIDEXT_DCR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SIDEXT_DCR_SHIFT)) & I3C_SIDEXT_DCR_MASK) - -#define I3C_SIDEXT_BCR_MASK (0xFF0000U) -#define I3C_SIDEXT_BCR_SHIFT (16U) -/*! BCR - Bus Characteristics Register */ -#define I3C_SIDEXT_BCR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SIDEXT_BCR_SHIFT)) & I3C_SIDEXT_BCR_MASK) -/*! @} */ - -/*! @name SVENDORID - Target Vendor ID */ -/*! @{ */ - -#define I3C_SVENDORID_VID_MASK (0x7FFFU) -#define I3C_SVENDORID_VID_SHIFT (0U) -/*! VID - Vendor ID */ -#define I3C_SVENDORID_VID(x) (((uint32_t)(((uint32_t)(x)) << I3C_SVENDORID_VID_SHIFT)) & I3C_SVENDORID_VID_MASK) -/*! @} */ - -/*! @name STCCLOCK - Target Time Control Clock */ -/*! @{ */ - -#define I3C_STCCLOCK_ACCURACY_MASK (0xFFU) -#define I3C_STCCLOCK_ACCURACY_SHIFT (0U) -/*! ACCURACY - Clock Accuracy */ -#define I3C_STCCLOCK_ACCURACY(x) (((uint32_t)(((uint32_t)(x)) << I3C_STCCLOCK_ACCURACY_SHIFT)) & I3C_STCCLOCK_ACCURACY_MASK) - -#define I3C_STCCLOCK_FREQ_MASK (0xFF00U) -#define I3C_STCCLOCK_FREQ_SHIFT (8U) -/*! FREQ - Clock Frequency */ -#define I3C_STCCLOCK_FREQ(x) (((uint32_t)(((uint32_t)(x)) << I3C_STCCLOCK_FREQ_SHIFT)) & I3C_STCCLOCK_FREQ_MASK) -/*! @} */ - -/*! @name SMSGMAPADDR - Target Message Map Address */ -/*! @{ */ - -#define I3C_SMSGMAPADDR_MAPLAST_MASK (0xFU) -#define I3C_SMSGMAPADDR_MAPLAST_SHIFT (0U) -/*! MAPLAST - Matched Address Index */ -#define I3C_SMSGMAPADDR_MAPLAST(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMSGMAPADDR_MAPLAST_SHIFT)) & I3C_SMSGMAPADDR_MAPLAST_MASK) - -#define I3C_SMSGMAPADDR_LASTSTATIC_MASK (0x10U) -#define I3C_SMSGMAPADDR_LASTSTATIC_SHIFT (4U) -/*! LASTSTATIC - Last Static Address Matched - * 0b1..I2C static address - * 0b0..I3C dynamic address - */ -#define I3C_SMSGMAPADDR_LASTSTATIC(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMSGMAPADDR_LASTSTATIC_SHIFT)) & I3C_SMSGMAPADDR_LASTSTATIC_MASK) - -#define I3C_SMSGMAPADDR_MAPLASTM1_MASK (0xF00U) -#define I3C_SMSGMAPADDR_MAPLASTM1_SHIFT (8U) -/*! MAPLASTM1 - Matched Previous Address Index 1 */ -#define I3C_SMSGMAPADDR_MAPLASTM1(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMSGMAPADDR_MAPLASTM1_SHIFT)) & I3C_SMSGMAPADDR_MAPLASTM1_MASK) - -#define I3C_SMSGMAPADDR_MAPLASTM2_MASK (0xF0000U) -#define I3C_SMSGMAPADDR_MAPLASTM2_SHIFT (16U) -/*! MAPLASTM2 - Matched Previous Index 2 */ -#define I3C_SMSGMAPADDR_MAPLASTM2(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMSGMAPADDR_MAPLASTM2_SHIFT)) & I3C_SMSGMAPADDR_MAPLASTM2_MASK) -/*! @} */ - -/*! @name MCONFIG_EXT - Controller Extended Configuration */ -/*! @{ */ - -#define I3C_MCONFIG_EXT_I3C_CAS_DEL_MASK (0x30000U) -#define I3C_MCONFIG_EXT_I3C_CAS_DEL_SHIFT (16U) -/*! I3C_CAS_DEL - I3C CAS Delay after START - * 0b00..No Delay - * 0b01..Increases SCL clock period by 1/2. - * 0b10..Increases SCL clock period by 1. - * 0b11..Increases SCL clock period by 1 1/2. - */ -#define I3C_MCONFIG_EXT_I3C_CAS_DEL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_EXT_I3C_CAS_DEL_SHIFT)) & I3C_MCONFIG_EXT_I3C_CAS_DEL_MASK) - -#define I3C_MCONFIG_EXT_I3C_CASR_DEL_MASK (0xC0000U) -#define I3C_MCONFIG_EXT_I3C_CASR_DEL_SHIFT (18U) -/*! I3C_CASR_DEL - I3C CAS Delay After Repeated START - * 0b00..No Delay - * 0b01..Increases SCL clock period by 1/2. - * 0b10..Increases SCL clock period by 1. - * 0b11..Increases SCL clock period by 1 1/2. - */ -#define I3C_MCONFIG_EXT_I3C_CASR_DEL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_EXT_I3C_CASR_DEL_SHIFT)) & I3C_MCONFIG_EXT_I3C_CASR_DEL_MASK) -/*! @} */ - -/*! @name MCTRL - Controller Control */ -/*! @{ */ - -#define I3C_MCTRL_REQUEST_MASK (0x7U) -#define I3C_MCTRL_REQUEST_SHIFT (0U) -/*! REQUEST - Request - * 0b000..NONE - * 0b001..EMITSTARTADDR - * 0b010..EMITSTOP - * 0b011..IBIACKNACK - * 0b100..PROCESSDAA - * 0b101.. - * 0b110..Force Exit and Target Reset - * 0b111..AUTOIBI - */ -#define I3C_MCTRL_REQUEST(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCTRL_REQUEST_SHIFT)) & I3C_MCTRL_REQUEST_MASK) - -#define I3C_MCTRL_TYPE_MASK (0x30U) -#define I3C_MCTRL_TYPE_SHIFT (4U) -/*! TYPE - Bus Type with EmitStartAddr - * 0b00..I3C - * 0b01..I2C - * 0b10..DDR - * 0b11.. - */ -#define I3C_MCTRL_TYPE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCTRL_TYPE_SHIFT)) & I3C_MCTRL_TYPE_MASK) - -#define I3C_MCTRL_IBIRESP_MASK (0xC0U) -#define I3C_MCTRL_IBIRESP_SHIFT (6U) -/*! IBIRESP - In-Band Interrupt Response - * 0b00..ACK (acknowledge) - * 0b01..NACK (reject) - * 0b10..Acknowledge with mandatory byte - * 0b11..Manual - */ -#define I3C_MCTRL_IBIRESP(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCTRL_IBIRESP_SHIFT)) & I3C_MCTRL_IBIRESP_MASK) - -#define I3C_MCTRL_DIR_MASK (0x100U) -#define I3C_MCTRL_DIR_SHIFT (8U) -/*! DIR - Direction - * 0b0..Write - * 0b1..Read - */ -#define I3C_MCTRL_DIR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCTRL_DIR_SHIFT)) & I3C_MCTRL_DIR_MASK) - -#define I3C_MCTRL_ADDR_MASK (0xFE00U) -#define I3C_MCTRL_ADDR_SHIFT (9U) -/*! ADDR - Address */ -#define I3C_MCTRL_ADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCTRL_ADDR_SHIFT)) & I3C_MCTRL_ADDR_MASK) - -#define I3C_MCTRL_RDTERM_MASK (0xFF0000U) -#define I3C_MCTRL_RDTERM_SHIFT (16U) -/*! RDTERM - Read Terminate Counter */ -#define I3C_MCTRL_RDTERM(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCTRL_RDTERM_SHIFT)) & I3C_MCTRL_RDTERM_MASK) -/*! @} */ - -/*! @name MSTATUS - Controller Status */ -/*! @{ */ - -#define I3C_MSTATUS_STATE_MASK (0x7U) -#define I3C_MSTATUS_STATE_SHIFT (0U) -/*! STATE - State Of The Controller - * 0b000..IDLE - * 0b001..SLVREQ - * 0b010..MSGSDR - * 0b011..NORMACT - * 0b100..MSGDDR - * 0b101..DAA - * 0b110..IBIACK - * 0b111..IBIRCV - */ -#define I3C_MSTATUS_STATE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_STATE_SHIFT)) & I3C_MSTATUS_STATE_MASK) - -#define I3C_MSTATUS_BETWEEN_MASK (0x10U) -#define I3C_MSTATUS_BETWEEN_SHIFT (4U) -/*! BETWEEN - Between - * 0b0..Inactive - * 0b1..Active - */ -#define I3C_MSTATUS_BETWEEN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_BETWEEN_SHIFT)) & I3C_MSTATUS_BETWEEN_MASK) - -#define I3C_MSTATUS_NACKED_MASK (0x20U) -#define I3C_MSTATUS_NACKED_SHIFT (5U) -/*! NACKED - Not Acknowledged - * 0b1..NACKed (not acknowledged) - * 0b0..Not NACKed - */ -#define I3C_MSTATUS_NACKED(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_NACKED_SHIFT)) & I3C_MSTATUS_NACKED_MASK) - -#define I3C_MSTATUS_IBITYPE_MASK (0xC0U) -#define I3C_MSTATUS_IBITYPE_SHIFT (6U) -/*! IBITYPE - In-Band Interrupt (IBI) Type - * 0b00..NONE - * 0b01..In-Band Interrupt - * 0b10..Controller Request - * 0b11..Hot-Join - */ -#define I3C_MSTATUS_IBITYPE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_IBITYPE_SHIFT)) & I3C_MSTATUS_IBITYPE_MASK) - -#define I3C_MSTATUS_SLVSTART_MASK (0x100U) -#define I3C_MSTATUS_SLVSTART_SHIFT (8U) -/*! SLVSTART - Target Start - * 0b1..Target requesting START - * 0b0..Target not requesting START - */ -#define I3C_MSTATUS_SLVSTART(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_SLVSTART_SHIFT)) & I3C_MSTATUS_SLVSTART_MASK) - -#define I3C_MSTATUS_MCTRLDONE_MASK (0x200U) -#define I3C_MSTATUS_MCTRLDONE_SHIFT (9U) -/*! MCTRLDONE - Controller Control Done - * 0b1..Done - * 0b0..Not done - */ -#define I3C_MSTATUS_MCTRLDONE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_MCTRLDONE_SHIFT)) & I3C_MSTATUS_MCTRLDONE_MASK) - -#define I3C_MSTATUS_COMPLETE_MASK (0x400U) -#define I3C_MSTATUS_COMPLETE_SHIFT (10U) -/*! COMPLETE - Complete - * 0b1..Complete - * 0b0..Not complete - */ -#define I3C_MSTATUS_COMPLETE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_COMPLETE_SHIFT)) & I3C_MSTATUS_COMPLETE_MASK) - -#define I3C_MSTATUS_RXPEND_MASK (0x800U) -#define I3C_MSTATUS_RXPEND_SHIFT (11U) -/*! RXPEND - RXPEND - * 0b1..Receive message pending - * 0b0..No receive message pending - */ -#define I3C_MSTATUS_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_RXPEND_SHIFT)) & I3C_MSTATUS_RXPEND_MASK) - -#define I3C_MSTATUS_TXNOTFULL_MASK (0x1000U) -#define I3C_MSTATUS_TXNOTFULL_SHIFT (12U) -/*! TXNOTFULL - TX Buffer or FIFO Not Full - * 0b1..Receive buffer or FIFO not full - * 0b0..Receive buffer or FIFO full - */ -#define I3C_MSTATUS_TXNOTFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_TXNOTFULL_SHIFT)) & I3C_MSTATUS_TXNOTFULL_MASK) - -#define I3C_MSTATUS_IBIWON_MASK (0x2000U) -#define I3C_MSTATUS_IBIWON_SHIFT (13U) -/*! IBIWON - In-Band Interrupt (IBI) Won - * 0b1..IBI arbitration won - * 0b0..No IBI arbitration won - */ -#define I3C_MSTATUS_IBIWON(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_IBIWON_SHIFT)) & I3C_MSTATUS_IBIWON_MASK) - -#define I3C_MSTATUS_ERRWARN_MASK (0x8000U) -#define I3C_MSTATUS_ERRWARN_SHIFT (15U) -/*! ERRWARN - Error Or Warning - * 0b1..Error or warning - * 0b0..No error or warning - */ -#define I3C_MSTATUS_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_ERRWARN_SHIFT)) & I3C_MSTATUS_ERRWARN_MASK) - -#define I3C_MSTATUS_NOWMASTER_MASK (0x80000U) -#define I3C_MSTATUS_NOWMASTER_SHIFT (19U) -/*! NOWMASTER - Module Is Now Controller - * 0b1..Module has become controller - * 0b0..Module has not become controller - */ -#define I3C_MSTATUS_NOWMASTER(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_NOWMASTER_SHIFT)) & I3C_MSTATUS_NOWMASTER_MASK) - -#define I3C_MSTATUS_IBIADDR_MASK (0x7F000000U) -#define I3C_MSTATUS_IBIADDR_SHIFT (24U) -/*! IBIADDR - IBI Address */ -#define I3C_MSTATUS_IBIADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_IBIADDR_SHIFT)) & I3C_MSTATUS_IBIADDR_MASK) -/*! @} */ - -/*! @name MIBIRULES - Controller In-band Interrupt Registry and Rules */ -/*! @{ */ - -#define I3C_MIBIRULES_ADDR0_MASK (0x3FU) -#define I3C_MIBIRULES_ADDR0_SHIFT (0U) -/*! ADDR0 - ADDR0 */ -#define I3C_MIBIRULES_ADDR0(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_ADDR0_SHIFT)) & I3C_MIBIRULES_ADDR0_MASK) - -#define I3C_MIBIRULES_ADDR1_MASK (0xFC0U) -#define I3C_MIBIRULES_ADDR1_SHIFT (6U) -/*! ADDR1 - ADDR1 */ -#define I3C_MIBIRULES_ADDR1(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_ADDR1_SHIFT)) & I3C_MIBIRULES_ADDR1_MASK) - -#define I3C_MIBIRULES_ADDR2_MASK (0x3F000U) -#define I3C_MIBIRULES_ADDR2_SHIFT (12U) -/*! ADDR2 - ADDR2 */ -#define I3C_MIBIRULES_ADDR2(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_ADDR2_SHIFT)) & I3C_MIBIRULES_ADDR2_MASK) - -#define I3C_MIBIRULES_ADDR3_MASK (0xFC0000U) -#define I3C_MIBIRULES_ADDR3_SHIFT (18U) -/*! ADDR3 - ADDR3 */ -#define I3C_MIBIRULES_ADDR3(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_ADDR3_SHIFT)) & I3C_MIBIRULES_ADDR3_MASK) - -#define I3C_MIBIRULES_ADDR4_MASK (0x3F000000U) -#define I3C_MIBIRULES_ADDR4_SHIFT (24U) -/*! ADDR4 - ADDR4 */ -#define I3C_MIBIRULES_ADDR4(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_ADDR4_SHIFT)) & I3C_MIBIRULES_ADDR4_MASK) - -#define I3C_MIBIRULES_MSB0_MASK (0x40000000U) -#define I3C_MIBIRULES_MSB0_SHIFT (30U) -/*! MSB0 - Most Significant Address Bit Is 0 - * 0b1..For all I3C dynamic addresses, MSB is 0. - * 0b0..MSB is not 0. - */ -#define I3C_MIBIRULES_MSB0(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_MSB0_SHIFT)) & I3C_MIBIRULES_MSB0_MASK) - -#define I3C_MIBIRULES_NOBYTE_MASK (0x80000000U) -#define I3C_MIBIRULES_NOBYTE_SHIFT (31U) -/*! NOBYTE - No IBI byte - * 0b1..Without mandatory IBI byte - * 0b0..With mandatory IBI byte - */ -#define I3C_MIBIRULES_NOBYTE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_NOBYTE_SHIFT)) & I3C_MIBIRULES_NOBYTE_MASK) -/*! @} */ - -/*! @name MINTSET - Controller Interrupt Set */ -/*! @{ */ - -#define I3C_MINTSET_SLVSTART_MASK (0x100U) -#define I3C_MINTSET_SLVSTART_SHIFT (8U) -/*! SLVSTART - Target Start Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_SLVSTART(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_SLVSTART_SHIFT)) & I3C_MINTSET_SLVSTART_MASK) - -#define I3C_MINTSET_MCTRLDONE_MASK (0x200U) -#define I3C_MINTSET_MCTRLDONE_SHIFT (9U) -/*! MCTRLDONE - Controller Control Done Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_MCTRLDONE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_MCTRLDONE_SHIFT)) & I3C_MINTSET_MCTRLDONE_MASK) - -#define I3C_MINTSET_COMPLETE_MASK (0x400U) -#define I3C_MINTSET_COMPLETE_SHIFT (10U) -/*! COMPLETE - Completed Message Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_COMPLETE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_COMPLETE_SHIFT)) & I3C_MINTSET_COMPLETE_MASK) - -#define I3C_MINTSET_RXPEND_MASK (0x800U) -#define I3C_MINTSET_RXPEND_SHIFT (11U) -/*! RXPEND - Receive Pending Interrupt Enable */ -#define I3C_MINTSET_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_RXPEND_SHIFT)) & I3C_MINTSET_RXPEND_MASK) - -#define I3C_MINTSET_TXNOTFULL_MASK (0x1000U) -#define I3C_MINTSET_TXNOTFULL_SHIFT (12U) -/*! TXNOTFULL - Transmit Buffer/FIFO is not full interrupt enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_TXNOTFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_TXNOTFULL_SHIFT)) & I3C_MINTSET_TXNOTFULL_MASK) - -#define I3C_MINTSET_IBIWON_MASK (0x2000U) -#define I3C_MINTSET_IBIWON_SHIFT (13U) -/*! IBIWON - In-Band Interrupt (IBI) Won Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_IBIWON(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_IBIWON_SHIFT)) & I3C_MINTSET_IBIWON_MASK) - -#define I3C_MINTSET_ERRWARN_MASK (0x8000U) -#define I3C_MINTSET_ERRWARN_SHIFT (15U) -/*! ERRWARN - Error or Warning (ERRWARN) Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_ERRWARN_SHIFT)) & I3C_MINTSET_ERRWARN_MASK) - -#define I3C_MINTSET_NOWMASTER_MASK (0x80000U) -#define I3C_MINTSET_NOWMASTER_SHIFT (19U) -/*! NOWMASTER - Now Controller (now this I3C module is a controller) Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_NOWMASTER(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_NOWMASTER_SHIFT)) & I3C_MINTSET_NOWMASTER_MASK) -/*! @} */ - -/*! @name MINTCLR - Controller Interrupt Clear */ -/*! @{ */ - -#define I3C_MINTCLR_SLVSTART_MASK (0x100U) -#define I3C_MINTCLR_SLVSTART_SHIFT (8U) -/*! SLVSTART - SLVSTART Interrupt Enable Clear - * 0b1..Corresponding interrupt enable becomes 0 - * 0b0..No effect - */ -#define I3C_MINTCLR_SLVSTART(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_SLVSTART_SHIFT)) & I3C_MINTCLR_SLVSTART_MASK) - -#define I3C_MINTCLR_MCTRLDONE_MASK (0x200U) -#define I3C_MINTCLR_MCTRLDONE_SHIFT (9U) -/*! MCTRLDONE - MCTRLDONE Interrupt Enable Clear - * 0b1..Corresponding interrupt enable becomes 0 - * 0b0..No effect - */ -#define I3C_MINTCLR_MCTRLDONE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_MCTRLDONE_SHIFT)) & I3C_MINTCLR_MCTRLDONE_MASK) - -#define I3C_MINTCLR_COMPLETE_MASK (0x400U) -#define I3C_MINTCLR_COMPLETE_SHIFT (10U) -/*! COMPLETE - COMPLETE Interrupt Enable Clear - * 0b1..Corresponding interrupt enable becomes 0 - * 0b0..No effect - */ -#define I3C_MINTCLR_COMPLETE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_COMPLETE_SHIFT)) & I3C_MINTCLR_COMPLETE_MASK) - -#define I3C_MINTCLR_RXPEND_MASK (0x800U) -#define I3C_MINTCLR_RXPEND_SHIFT (11U) -/*! RXPEND - RXPEND Interrupt Enable Clear - * 0b1..Corresponding interrupt enable becomes 0 - * 0b0..No effect - */ -#define I3C_MINTCLR_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_RXPEND_SHIFT)) & I3C_MINTCLR_RXPEND_MASK) - -#define I3C_MINTCLR_TXNOTFULL_MASK (0x1000U) -#define I3C_MINTCLR_TXNOTFULL_SHIFT (12U) -/*! TXNOTFULL - TXNOTFULL Interrupt Enable Clear - * 0b1..Corresponding interrupt enable becomes 0 - * 0b0..No effect - */ -#define I3C_MINTCLR_TXNOTFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_TXNOTFULL_SHIFT)) & I3C_MINTCLR_TXNOTFULL_MASK) - -#define I3C_MINTCLR_IBIWON_MASK (0x2000U) -#define I3C_MINTCLR_IBIWON_SHIFT (13U) -/*! IBIWON - IBIWON Interrupt Enable Clear - * 0b1..Corresponding interrupt enable becomes 0 - * 0b0..No effect - */ -#define I3C_MINTCLR_IBIWON(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_IBIWON_SHIFT)) & I3C_MINTCLR_IBIWON_MASK) - -#define I3C_MINTCLR_ERRWARN_MASK (0x8000U) -#define I3C_MINTCLR_ERRWARN_SHIFT (15U) -/*! ERRWARN - ERRWARN Interrupt Enable Clear - * 0b1..Corresponding interrupt enable becomes 0 - * 0b0..No effect - */ -#define I3C_MINTCLR_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_ERRWARN_SHIFT)) & I3C_MINTCLR_ERRWARN_MASK) - -#define I3C_MINTCLR_NOWMASTER_MASK (0x80000U) -#define I3C_MINTCLR_NOWMASTER_SHIFT (19U) -/*! NOWMASTER - NOWCONTROLLER Interrupt Enable Clear - * 0b1..Corresponding interrupt enable becomes 0 - * 0b0..No effect - */ -#define I3C_MINTCLR_NOWMASTER(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_NOWMASTER_SHIFT)) & I3C_MINTCLR_NOWMASTER_MASK) -/*! @} */ - -/*! @name MINTMASKED - Controller Interrupt Mask */ -/*! @{ */ - -#define I3C_MINTMASKED_SLVSTART_MASK (0x100U) -#define I3C_MINTMASKED_SLVSTART_SHIFT (8U) -/*! SLVSTART - SLVSTART Interrupt Mask - * 0b1..Interrupt enabled and active - * 0b0..Interrupt not enabled and/or not active - */ -#define I3C_MINTMASKED_SLVSTART(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_SLVSTART_SHIFT)) & I3C_MINTMASKED_SLVSTART_MASK) - -#define I3C_MINTMASKED_MCTRLDONE_MASK (0x200U) -#define I3C_MINTMASKED_MCTRLDONE_SHIFT (9U) -/*! MCTRLDONE - MCTRLDONE Interrupt Mask - * 0b1..Interrupt enabled and active - * 0b0..Interrupt not enabled and/or not active - */ -#define I3C_MINTMASKED_MCTRLDONE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_MCTRLDONE_SHIFT)) & I3C_MINTMASKED_MCTRLDONE_MASK) - -#define I3C_MINTMASKED_COMPLETE_MASK (0x400U) -#define I3C_MINTMASKED_COMPLETE_SHIFT (10U) -/*! COMPLETE - COMPLETE Interrupt Mask - * 0b1..Interrupt enabled and active - * 0b0..Interrupt not enabled and/or not active - */ -#define I3C_MINTMASKED_COMPLETE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_COMPLETE_SHIFT)) & I3C_MINTMASKED_COMPLETE_MASK) - -#define I3C_MINTMASKED_RXPEND_MASK (0x800U) -#define I3C_MINTMASKED_RXPEND_SHIFT (11U) -/*! RXPEND - RXPEND Interrupt Mask */ -#define I3C_MINTMASKED_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_RXPEND_SHIFT)) & I3C_MINTMASKED_RXPEND_MASK) - -#define I3C_MINTMASKED_TXNOTFULL_MASK (0x1000U) -#define I3C_MINTMASKED_TXNOTFULL_SHIFT (12U) -/*! TXNOTFULL - TXNOTFULL Interrupt Mask - * 0b1..Interrupt enabled and active - * 0b0..Interrupt not enabled and/or not active - */ -#define I3C_MINTMASKED_TXNOTFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_TXNOTFULL_SHIFT)) & I3C_MINTMASKED_TXNOTFULL_MASK) - -#define I3C_MINTMASKED_IBIWON_MASK (0x2000U) -#define I3C_MINTMASKED_IBIWON_SHIFT (13U) -/*! IBIWON - IBIWON Interrupt Mask - * 0b1..Interrupt enabled and active - * 0b0..Interrupt not enabled and/or not active - */ -#define I3C_MINTMASKED_IBIWON(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_IBIWON_SHIFT)) & I3C_MINTMASKED_IBIWON_MASK) - -#define I3C_MINTMASKED_ERRWARN_MASK (0x8000U) -#define I3C_MINTMASKED_ERRWARN_SHIFT (15U) -/*! ERRWARN - ERRWARN Interrupt Mask - * 0b1..Interrupt enabled and active - * 0b0..Interrupt not enabled and/or not active - */ -#define I3C_MINTMASKED_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_ERRWARN_SHIFT)) & I3C_MINTMASKED_ERRWARN_MASK) - -#define I3C_MINTMASKED_NOWMASTER_MASK (0x80000U) -#define I3C_MINTMASKED_NOWMASTER_SHIFT (19U) -/*! NOWMASTER - NOWCONTROLLER Interrupt Mask - * 0b1..Interrupt enabled and active - * 0b0..Interrupt not enabled and/or not active - */ -#define I3C_MINTMASKED_NOWMASTER(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_NOWMASTER_SHIFT)) & I3C_MINTMASKED_NOWMASTER_MASK) -/*! @} */ - -/*! @name MERRWARN - Controller Errors and Warnings */ -/*! @{ */ - -#define I3C_MERRWARN_URUN_MASK (0x2U) -#define I3C_MERRWARN_URUN_SHIFT (1U) -/*! URUN - Underrun error - * 0b1..Error - * 0b0..No error - */ -#define I3C_MERRWARN_URUN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_URUN_SHIFT)) & I3C_MERRWARN_URUN_MASK) - -#define I3C_MERRWARN_NACK_MASK (0x4U) -#define I3C_MERRWARN_NACK_SHIFT (2U) -/*! NACK - Not Acknowledge Error - * 0b1..Error - * 0b0..No error - */ -#define I3C_MERRWARN_NACK(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_NACK_SHIFT)) & I3C_MERRWARN_NACK_MASK) - -#define I3C_MERRWARN_WRABT_MASK (0x8U) -#define I3C_MERRWARN_WRABT_SHIFT (3U) -/*! WRABT - Write Abort Error - * 0b1..Error - * 0b0..No error - */ -#define I3C_MERRWARN_WRABT(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_WRABT_SHIFT)) & I3C_MERRWARN_WRABT_MASK) - -#define I3C_MERRWARN_TERM_MASK (0x10U) -#define I3C_MERRWARN_TERM_SHIFT (4U) -/*! TERM - Terminate Error - * 0b1..Error - * 0b0..No error - */ -#define I3C_MERRWARN_TERM(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_TERM_SHIFT)) & I3C_MERRWARN_TERM_MASK) - -#define I3C_MERRWARN_HPAR_MASK (0x200U) -#define I3C_MERRWARN_HPAR_SHIFT (9U) -/*! HPAR - High Data Rate Parity - * 0b1..Error - * 0b0..No error - */ -#define I3C_MERRWARN_HPAR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_HPAR_SHIFT)) & I3C_MERRWARN_HPAR_MASK) - -#define I3C_MERRWARN_HCRC_MASK (0x400U) -#define I3C_MERRWARN_HCRC_SHIFT (10U) -/*! HCRC - High Data Rate CRC Error - * 0b1..Error - * 0b0..No error - */ -#define I3C_MERRWARN_HCRC(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_HCRC_SHIFT)) & I3C_MERRWARN_HCRC_MASK) - -#define I3C_MERRWARN_OREAD_MASK (0x10000U) -#define I3C_MERRWARN_OREAD_SHIFT (16U) -/*! OREAD - Over-read Error - * 0b1..Error - * 0b0..No error - */ -#define I3C_MERRWARN_OREAD(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_OREAD_SHIFT)) & I3C_MERRWARN_OREAD_MASK) - -#define I3C_MERRWARN_OWRITE_MASK (0x20000U) -#define I3C_MERRWARN_OWRITE_SHIFT (17U) -/*! OWRITE - Over-write Error - * 0b1..Error - * 0b0..No error - */ -#define I3C_MERRWARN_OWRITE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_OWRITE_SHIFT)) & I3C_MERRWARN_OWRITE_MASK) - -#define I3C_MERRWARN_MSGERR_MASK (0x40000U) -#define I3C_MERRWARN_MSGERR_SHIFT (18U) -/*! MSGERR - Message Error - * 0b1..Error - * 0b0..No error - */ -#define I3C_MERRWARN_MSGERR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_MSGERR_SHIFT)) & I3C_MERRWARN_MSGERR_MASK) - -#define I3C_MERRWARN_INVREQ_MASK (0x80000U) -#define I3C_MERRWARN_INVREQ_SHIFT (19U) -/*! INVREQ - Invalid Request Error - * 0b1..Error - * 0b0..No error - */ -#define I3C_MERRWARN_INVREQ(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_INVREQ_SHIFT)) & I3C_MERRWARN_INVREQ_MASK) - -#define I3C_MERRWARN_TIMEOUT_MASK (0x100000U) -#define I3C_MERRWARN_TIMEOUT_SHIFT (20U) -/*! TIMEOUT - Timeout Error - * 0b1..Error - * 0b0..No error - */ -#define I3C_MERRWARN_TIMEOUT(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_TIMEOUT_SHIFT)) & I3C_MERRWARN_TIMEOUT_MASK) -/*! @} */ - -/*! @name MDMACTRL - Controller DMA Control */ -/*! @{ */ - -#define I3C_MDMACTRL_DMAFB_MASK (0x3U) -#define I3C_MDMACTRL_DMAFB_SHIFT (0U) -/*! DMAFB - DMA From Bus - * 0b00..DMA is not used - * 0b01..Enable DMA for one frame - * 0b10..Enable DMA until DMA is turned off - * 0b11.. - */ -#define I3C_MDMACTRL_DMAFB(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDMACTRL_DMAFB_SHIFT)) & I3C_MDMACTRL_DMAFB_MASK) - -#define I3C_MDMACTRL_DMATB_MASK (0xCU) -#define I3C_MDMACTRL_DMATB_SHIFT (2U) -/*! DMATB - DMA To Bus - * 0b00..DMA is not used - * 0b01..Enable DMA for one frame (ended by DMA or Terminated) - * 0b10..Enable DMA until DMA is turned off - * 0b11.. - */ -#define I3C_MDMACTRL_DMATB(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDMACTRL_DMATB_SHIFT)) & I3C_MDMACTRL_DMATB_MASK) - -#define I3C_MDMACTRL_DMAWIDTH_MASK (0x30U) -#define I3C_MDMACTRL_DMAWIDTH_SHIFT (4U) -/*! DMAWIDTH - DMA Width - * 0b00, 0b01..Byte - * 0b10..Halfword (16 bits) - * 0b11.. - */ -#define I3C_MDMACTRL_DMAWIDTH(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDMACTRL_DMAWIDTH_SHIFT)) & I3C_MDMACTRL_DMAWIDTH_MASK) -/*! @} */ - -/*! @name MDATACTRL - Controller Data Control */ -/*! @{ */ - -#define I3C_MDATACTRL_FLUSHTB_MASK (0x1U) -#define I3C_MDATACTRL_FLUSHTB_SHIFT (0U) -/*! FLUSHTB - Flush To-bus Buffer or FIFO - * 0b1..Flush the buffer - * 0b0..No action - */ -#define I3C_MDATACTRL_FLUSHTB(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_FLUSHTB_SHIFT)) & I3C_MDATACTRL_FLUSHTB_MASK) - -#define I3C_MDATACTRL_FLUSHFB_MASK (0x2U) -#define I3C_MDATACTRL_FLUSHFB_SHIFT (1U) -/*! FLUSHFB - Flush From-bus Buffer or FIFO - * 0b1..Flush the buffer - * 0b0..No action - */ -#define I3C_MDATACTRL_FLUSHFB(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_FLUSHFB_SHIFT)) & I3C_MDATACTRL_FLUSHFB_MASK) - -#define I3C_MDATACTRL_UNLOCK_MASK (0x8U) -#define I3C_MDATACTRL_UNLOCK_SHIFT (3U) -/*! UNLOCK - Unlock - * 0b0..Locked. RXTRIG and TXTRIG fields cannot be changed on a write. - * 0b1..Unlocked. RXTRIG and TXTRIG fields can be changed on a write. - */ -#define I3C_MDATACTRL_UNLOCK(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_UNLOCK_SHIFT)) & I3C_MDATACTRL_UNLOCK_MASK) - -#define I3C_MDATACTRL_TXTRIG_MASK (0x30U) -#define I3C_MDATACTRL_TXTRIG_SHIFT (4U) -/*! TXTRIG - Transmit Trigger Level - * 0b00..Trigger when empty - * 0b01..Trigger when 1/4 full or less - * 0b10..Trigger when 1/2 full or less - * 0b11..Default. Trigger when 1 less than full or less - */ -#define I3C_MDATACTRL_TXTRIG(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_TXTRIG_SHIFT)) & I3C_MDATACTRL_TXTRIG_MASK) - -#define I3C_MDATACTRL_RXTRIG_MASK (0xC0U) -#define I3C_MDATACTRL_RXTRIG_SHIFT (6U) -/*! RXTRIG - Receive Trigger Level - * 0b00..Trigger when not empty - * 0b01..Trigger when 1/4 full or more - * 0b10..Trigger when 1/2 full or more - * 0b11..Trigger when 3/4 full or more - */ -#define I3C_MDATACTRL_RXTRIG(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_RXTRIG_SHIFT)) & I3C_MDATACTRL_RXTRIG_MASK) - -#define I3C_MDATACTRL_TXCOUNT_MASK (0x1F0000U) -#define I3C_MDATACTRL_TXCOUNT_SHIFT (16U) -/*! TXCOUNT - Transmit Byte Count */ -#define I3C_MDATACTRL_TXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_TXCOUNT_SHIFT)) & I3C_MDATACTRL_TXCOUNT_MASK) - -#define I3C_MDATACTRL_RXCOUNT_MASK (0x1F000000U) -#define I3C_MDATACTRL_RXCOUNT_SHIFT (24U) -/*! RXCOUNT - Receive Byte Count */ -#define I3C_MDATACTRL_RXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_RXCOUNT_SHIFT)) & I3C_MDATACTRL_RXCOUNT_MASK) - -#define I3C_MDATACTRL_TXFULL_MASK (0x40000000U) -#define I3C_MDATACTRL_TXFULL_SHIFT (30U) -/*! TXFULL - Transmit Is Full - * 0b0..Transmit FIFO or buffer is not yet full. - * 0b1..Transmit FIFO or buffer is full. - */ -#define I3C_MDATACTRL_TXFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_TXFULL_SHIFT)) & I3C_MDATACTRL_TXFULL_MASK) - -#define I3C_MDATACTRL_RXEMPTY_MASK (0x80000000U) -#define I3C_MDATACTRL_RXEMPTY_SHIFT (31U) -/*! RXEMPTY - Receive Is Empty - * 0b0..Receive FIFO or buffer is not yet empty. - * 0b1..Receive FIFO or buffer is empty. - */ -#define I3C_MDATACTRL_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_RXEMPTY_SHIFT)) & I3C_MDATACTRL_RXEMPTY_MASK) -/*! @} */ - -/*! @name MWDATAB - Controller Write Data Byte */ -/*! @{ */ - -#define I3C_MWDATAB_VALUE_MASK (0xFFU) -#define I3C_MWDATAB_VALUE_SHIFT (0U) -/*! VALUE - Data Byte */ -#define I3C_MWDATAB_VALUE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAB_VALUE_SHIFT)) & I3C_MWDATAB_VALUE_MASK) - -#define I3C_MWDATAB_END_MASK (0x100U) -#define I3C_MWDATAB_END_SHIFT (8U) -/*! END - End of Message - * 0b0..Not the end. More bytes are assumed to be in the message. - * 0b1..End. The END bit marks the last byte of the message. - */ -#define I3C_MWDATAB_END(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAB_END_SHIFT)) & I3C_MWDATAB_END_MASK) - -#define I3C_MWDATAB_END_ALSO_MASK (0x10000U) -#define I3C_MWDATAB_END_ALSO_SHIFT (16U) -/*! END_ALSO - End of Message Also - * 0b0..Not the end. More bytes are assumed to be in the message. - * 0b1..End. The END bit marks the last byte of the message. - */ -#define I3C_MWDATAB_END_ALSO(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAB_END_ALSO_SHIFT)) & I3C_MWDATAB_END_ALSO_MASK) -/*! @} */ - -/*! @name MWDATABE - Controller Write Data Byte End */ -/*! @{ */ - -#define I3C_MWDATABE_VALUE_MASK (0xFFU) -#define I3C_MWDATABE_VALUE_SHIFT (0U) -/*! VALUE - Data */ -#define I3C_MWDATABE_VALUE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATABE_VALUE_SHIFT)) & I3C_MWDATABE_VALUE_MASK) -/*! @} */ - -/*! @name MWDATAH - Controller Write Data Halfword */ -/*! @{ */ - -#define I3C_MWDATAH_DATA0_MASK (0xFFU) -#define I3C_MWDATAH_DATA0_SHIFT (0U) -/*! DATA0 - Data Byte 0 */ -#define I3C_MWDATAH_DATA0(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAH_DATA0_SHIFT)) & I3C_MWDATAH_DATA0_MASK) - -#define I3C_MWDATAH_DATA1_MASK (0xFF00U) -#define I3C_MWDATAH_DATA1_SHIFT (8U) -/*! DATA1 - Data Byte 1 */ -#define I3C_MWDATAH_DATA1(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAH_DATA1_SHIFT)) & I3C_MWDATAH_DATA1_MASK) - -#define I3C_MWDATAH_END_MASK (0x10000U) -#define I3C_MWDATAH_END_SHIFT (16U) -/*! END - End of message - * 0b0..Not the end. More bytes are assumed to be in the message. - * 0b1..End. The END bit marks the last byte of the message. - */ -#define I3C_MWDATAH_END(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAH_END_SHIFT)) & I3C_MWDATAH_END_MASK) -/*! @} */ - -/*! @name MWDATAHE - Controller Write Data Halfword End */ -/*! @{ */ - -#define I3C_MWDATAHE_DATA0_MASK (0xFFU) -#define I3C_MWDATAHE_DATA0_SHIFT (0U) -/*! DATA0 - Data Byte 0 */ -#define I3C_MWDATAHE_DATA0(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAHE_DATA0_SHIFT)) & I3C_MWDATAHE_DATA0_MASK) - -#define I3C_MWDATAHE_DATA1_MASK (0xFF00U) -#define I3C_MWDATAHE_DATA1_SHIFT (8U) -/*! DATA1 - Data Byte 1 */ -#define I3C_MWDATAHE_DATA1(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAHE_DATA1_SHIFT)) & I3C_MWDATAHE_DATA1_MASK) -/*! @} */ - -/*! @name MRDATAB - Controller Read Data Byte */ -/*! @{ */ - -#define I3C_MRDATAB_VALUE_MASK (0xFFU) -#define I3C_MRDATAB_VALUE_SHIFT (0U) -/*! VALUE - Value */ -#define I3C_MRDATAB_VALUE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MRDATAB_VALUE_SHIFT)) & I3C_MRDATAB_VALUE_MASK) -/*! @} */ - -/*! @name MRDATAH - Controller Read Data Halfword */ -/*! @{ */ - -#define I3C_MRDATAH_LSB_MASK (0xFFU) -#define I3C_MRDATAH_LSB_SHIFT (0U) -/*! LSB - LSB */ -#define I3C_MRDATAH_LSB(x) (((uint32_t)(((uint32_t)(x)) << I3C_MRDATAH_LSB_SHIFT)) & I3C_MRDATAH_LSB_MASK) - -#define I3C_MRDATAH_MSB_MASK (0xFF00U) -#define I3C_MRDATAH_MSB_SHIFT (8U) -/*! MSB - MSB */ -#define I3C_MRDATAH_MSB(x) (((uint32_t)(((uint32_t)(x)) << I3C_MRDATAH_MSB_SHIFT)) & I3C_MRDATAH_MSB_MASK) -/*! @} */ - -/*! @name MWDATAB1 - Controller Write Byte Data 1(to bus) */ -/*! @{ */ - -#define I3C_MWDATAB1_VALUE_MASK (0xFFU) -#define I3C_MWDATAB1_VALUE_SHIFT (0U) -/*! VALUE - Value */ -#define I3C_MWDATAB1_VALUE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAB1_VALUE_SHIFT)) & I3C_MWDATAB1_VALUE_MASK) -/*! @} */ - -/*! @name MWDATAH1 - Controller Write Halfword Data (to bus) */ -/*! @{ */ - -#define I3C_MWDATAH1_VALUE_MASK (0xFFFFU) -#define I3C_MWDATAH1_VALUE_SHIFT (0U) -/*! VALUE - Value */ -#define I3C_MWDATAH1_VALUE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAH1_VALUE_SHIFT)) & I3C_MWDATAH1_VALUE_MASK) -/*! @} */ - -/*! @name MWMSG_SDR_CONTROL - Controller Write Message Control in SDR mode */ -/*! @{ */ - -#define I3C_MWMSG_SDR_CONTROL_DIR_MASK (0x1U) -#define I3C_MWMSG_SDR_CONTROL_DIR_SHIFT (0U) -/*! DIR - Direction - * 0b0..Write - * 0b1..Read - */ -#define I3C_MWMSG_SDR_CONTROL_DIR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_SDR_CONTROL_DIR_SHIFT)) & I3C_MWMSG_SDR_CONTROL_DIR_MASK) - -#define I3C_MWMSG_SDR_CONTROL_ADDR_MASK (0xFEU) -#define I3C_MWMSG_SDR_CONTROL_ADDR_SHIFT (1U) -/*! ADDR - Address */ -#define I3C_MWMSG_SDR_CONTROL_ADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_SDR_CONTROL_ADDR_SHIFT)) & I3C_MWMSG_SDR_CONTROL_ADDR_MASK) - -#define I3C_MWMSG_SDR_CONTROL_END_MASK (0x100U) -#define I3C_MWMSG_SDR_CONTROL_END_SHIFT (8U) -/*! END - End of SDR Message - * 0b0..Not the end. SDR message ends waiting for a new SDR message (issues a repeated START for a new message). - * 0b1..End. SDR message ends at the STOP. - */ -#define I3C_MWMSG_SDR_CONTROL_END(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_SDR_CONTROL_END_SHIFT)) & I3C_MWMSG_SDR_CONTROL_END_MASK) - -#define I3C_MWMSG_SDR_CONTROL_I2C_MASK (0x400U) -#define I3C_MWMSG_SDR_CONTROL_I2C_SHIFT (10U) -/*! I2C - I2C - * 0b0..I3C message - * 0b1..I2C message - */ -#define I3C_MWMSG_SDR_CONTROL_I2C(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_SDR_CONTROL_I2C_SHIFT)) & I3C_MWMSG_SDR_CONTROL_I2C_MASK) - -#define I3C_MWMSG_SDR_CONTROL_LEN_MASK (0xF800U) -#define I3C_MWMSG_SDR_CONTROL_LEN_SHIFT (11U) -/*! LEN - Length */ -#define I3C_MWMSG_SDR_CONTROL_LEN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_SDR_CONTROL_LEN_SHIFT)) & I3C_MWMSG_SDR_CONTROL_LEN_MASK) -/*! @} */ - -/*! @name MWMSG_SDR_DATA - Controller Write Message Data in SDR mode */ -/*! @{ */ - -#define I3C_MWMSG_SDR_DATA_DATA16B_MASK (0xFFFFU) -#define I3C_MWMSG_SDR_DATA_DATA16B_SHIFT (0U) -/*! DATA16B - Data */ -#define I3C_MWMSG_SDR_DATA_DATA16B(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_SDR_DATA_DATA16B_SHIFT)) & I3C_MWMSG_SDR_DATA_DATA16B_MASK) -/*! @} */ - -/*! @name MRMSG_SDR - Controller Read Message in SDR mode */ -/*! @{ */ - -#define I3C_MRMSG_SDR_DATA_MASK (0xFFFFU) -#define I3C_MRMSG_SDR_DATA_SHIFT (0U) -/*! DATA - Data */ -#define I3C_MRMSG_SDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_MRMSG_SDR_DATA_SHIFT)) & I3C_MRMSG_SDR_DATA_MASK) -/*! @} */ - -/*! @name MWMSG_DDR_CONTROL - Controller Write Message in DDR mode: First Control Word */ -/*! @{ */ - -#define I3C_MWMSG_DDR_CONTROL_ADDRCMD_MASK (0xFFFFU) -#define I3C_MWMSG_DDR_CONTROL_ADDRCMD_SHIFT (0U) -/*! ADDRCMD - Address Command */ -#define I3C_MWMSG_DDR_CONTROL_ADDRCMD(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_DDR_CONTROL_ADDRCMD_SHIFT)) & I3C_MWMSG_DDR_CONTROL_ADDRCMD_MASK) -/*! @} */ - -/*! @name MWMSG_DDR_CONTROL2 - Controller Write Message in DDR mode Control 2 */ -/*! @{ */ - -#define I3C_MWMSG_DDR_CONTROL2_LEN_MASK (0x3FFU) -#define I3C_MWMSG_DDR_CONTROL2_LEN_SHIFT (0U) -/*! LEN - Length of Message */ -#define I3C_MWMSG_DDR_CONTROL2_LEN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_DDR_CONTROL2_LEN_SHIFT)) & I3C_MWMSG_DDR_CONTROL2_LEN_MASK) - -#define I3C_MWMSG_DDR_CONTROL2_END_MASK (0x4000U) -#define I3C_MWMSG_DDR_CONTROL2_END_SHIFT (14U) -/*! END - End of message - * 0b1..End. DDR message ends on HDR Exit. - * 0b0..Not the end. DDR message ends waiting for a new DDR message (will issue a HDR Restart for the new message). - */ -#define I3C_MWMSG_DDR_CONTROL2_END(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_DDR_CONTROL2_END_SHIFT)) & I3C_MWMSG_DDR_CONTROL2_END_MASK) -/*! @} */ - -/*! @name MWMSG_DDR_DATA - Controller Write Message Data in DDR mode */ -/*! @{ */ - -#define I3C_MWMSG_DDR_DATA_DATA16B_MASK (0xFFFFU) -#define I3C_MWMSG_DDR_DATA_DATA16B_SHIFT (0U) -/*! DATA16B - Data */ -#define I3C_MWMSG_DDR_DATA_DATA16B(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_DDR_DATA_DATA16B_SHIFT)) & I3C_MWMSG_DDR_DATA_DATA16B_MASK) -/*! @} */ - -/*! @name MRMSG_DDR - Controller Read Message in DDR mode */ -/*! @{ */ - -#define I3C_MRMSG_DDR_DATA_MASK (0xFFFFU) -#define I3C_MRMSG_DDR_DATA_SHIFT (0U) -/*! DATA - Data */ -#define I3C_MRMSG_DDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_MRMSG_DDR_DATA_SHIFT)) & I3C_MRMSG_DDR_DATA_MASK) -/*! @} */ - -/*! @name MDYNADDR - Controller Dynamic Address */ -/*! @{ */ - -#define I3C_MDYNADDR_DAVALID_MASK (0x1U) -#define I3C_MDYNADDR_DAVALID_SHIFT (0U) -/*! DAVALID - Dynamic address valid - * 0b1..Valid DA assigned - * 0b0..No valid DA assigned - */ -#define I3C_MDYNADDR_DAVALID(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDYNADDR_DAVALID_SHIFT)) & I3C_MDYNADDR_DAVALID_MASK) - -#define I3C_MDYNADDR_DADDR_MASK (0xFEU) -#define I3C_MDYNADDR_DADDR_SHIFT (1U) -/*! DADDR - Dynamic address */ -#define I3C_MDYNADDR_DADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDYNADDR_DADDR_SHIFT)) & I3C_MDYNADDR_DADDR_MASK) -/*! @} */ - -/*! @name SMAPCTRL0 - Map Feature Control 0 */ -/*! @{ */ - -#define I3C_SMAPCTRL0_ENA_MASK (0x1U) -#define I3C_SMAPCTRL0_ENA_SHIFT (0U) -/*! ENA - Enable Primary Dynamic Address - * 0b0..Disable - * 0b1..Enable - */ -#define I3C_SMAPCTRL0_ENA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMAPCTRL0_ENA_SHIFT)) & I3C_SMAPCTRL0_ENA_MASK) - -#define I3C_SMAPCTRL0_DA_MASK (0xFEU) -#define I3C_SMAPCTRL0_DA_SHIFT (1U) -/*! DA - Dynamic Address */ -#define I3C_SMAPCTRL0_DA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMAPCTRL0_DA_SHIFT)) & I3C_SMAPCTRL0_DA_MASK) - -#define I3C_SMAPCTRL0_CAUSE_MASK (0x700U) -#define I3C_SMAPCTRL0_CAUSE_SHIFT (8U) -/*! CAUSE - Cause - * 0b000..No information. This value occurs when not configured to write DA. - * 0b001..Set using ENTDAA - * 0b010..Set using SETDASA, SETAASA, or SETNEWDA - * 0b011..Cleared using RSTDAA - * 0b100..Auto MAP change happened last. The change may have changed this DA as well (for example, ENTDAA, and - * SETAASA), but at least one MAP entry automatically changed after. - * *.. - */ -#define I3C_SMAPCTRL0_CAUSE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMAPCTRL0_CAUSE_SHIFT)) & I3C_SMAPCTRL0_CAUSE_MASK) -/*! @} */ - -/*! @name IBIEXT1 - Extended IBI Data 1 */ -/*! @{ */ - -#define I3C_IBIEXT1_CNT_MASK (0x7U) -#define I3C_IBIEXT1_CNT_SHIFT (0U) -/*! CNT - Count */ -#define I3C_IBIEXT1_CNT(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT1_CNT_SHIFT)) & I3C_IBIEXT1_CNT_MASK) - -#define I3C_IBIEXT1_MAX_MASK (0x70U) -#define I3C_IBIEXT1_MAX_SHIFT (4U) -/*! MAX - Maximum */ -#define I3C_IBIEXT1_MAX(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT1_MAX_SHIFT)) & I3C_IBIEXT1_MAX_MASK) - -#define I3C_IBIEXT1_EXT1_MASK (0xFF00U) -#define I3C_IBIEXT1_EXT1_SHIFT (8U) -/*! EXT1 - Extra byte 1 */ -#define I3C_IBIEXT1_EXT1(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT1_EXT1_SHIFT)) & I3C_IBIEXT1_EXT1_MASK) - -#define I3C_IBIEXT1_EXT2_MASK (0xFF0000U) -#define I3C_IBIEXT1_EXT2_SHIFT (16U) -/*! EXT2 - Extra byte 2 */ -#define I3C_IBIEXT1_EXT2(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT1_EXT2_SHIFT)) & I3C_IBIEXT1_EXT2_MASK) - -#define I3C_IBIEXT1_EXT3_MASK (0xFF000000U) -#define I3C_IBIEXT1_EXT3_SHIFT (24U) -/*! EXT3 - Extra byte 3 */ -#define I3C_IBIEXT1_EXT3(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT1_EXT3_SHIFT)) & I3C_IBIEXT1_EXT3_MASK) -/*! @} */ - -/*! @name IBIEXT2 - Extended IBI Data 2 */ -/*! @{ */ - -#define I3C_IBIEXT2_EXT4_MASK (0xFFU) -#define I3C_IBIEXT2_EXT4_SHIFT (0U) -/*! EXT4 - Extra byte 4 */ -#define I3C_IBIEXT2_EXT4(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT2_EXT4_SHIFT)) & I3C_IBIEXT2_EXT4_MASK) - -#define I3C_IBIEXT2_EXT5_MASK (0xFF00U) -#define I3C_IBIEXT2_EXT5_SHIFT (8U) -/*! EXT5 - Extra byte 5 */ -#define I3C_IBIEXT2_EXT5(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT2_EXT5_SHIFT)) & I3C_IBIEXT2_EXT5_MASK) - -#define I3C_IBIEXT2_EXT6_MASK (0xFF0000U) -#define I3C_IBIEXT2_EXT6_SHIFT (16U) -/*! EXT6 - Extra byte 6 */ -#define I3C_IBIEXT2_EXT6(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT2_EXT6_SHIFT)) & I3C_IBIEXT2_EXT6_MASK) - -#define I3C_IBIEXT2_EXT7_MASK (0xFF000000U) -#define I3C_IBIEXT2_EXT7_SHIFT (24U) -/*! EXT7 - Extra byte 7 */ -#define I3C_IBIEXT2_EXT7(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT2_EXT7_SHIFT)) & I3C_IBIEXT2_EXT7_MASK) -/*! @} */ - -/*! @name SID - Target Module ID */ -/*! @{ */ - -#define I3C_SID_ID_MASK (0xFFFFFFFFU) -#define I3C_SID_ID_SHIFT (0U) -/*! ID - ID */ -#define I3C_SID_ID(x) (((uint32_t)(((uint32_t)(x)) << I3C_SID_ID_SHIFT)) & I3C_SID_ID_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group I3C_Register_Masks */ - - -/* I3C - Peripheral instance base addresses */ -/** Peripheral I3C0 base address */ -#define I3C0_BASE (0x40002000u) -/** Peripheral I3C0 base pointer */ -#define I3C0 ((I3C_Type *)I3C0_BASE) -/** Array initializer of I3C peripheral base addresses */ -#define I3C_BASE_ADDRS { I3C0_BASE } -/** Array initializer of I3C peripheral base pointers */ -#define I3C_BASE_PTRS { I3C0 } -/** Interrupt vectors for the I3C peripheral type */ -#define I3C_IRQS { I3C0_IRQn } - -/*! - * @} - */ /* end of group I3C_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- INPUTMUX Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup INPUTMUX_Peripheral_Access_Layer INPUTMUX Peripheral Access Layer - * @{ - */ - -/** INPUTMUX - Register Layout Typedef */ -typedef struct { - uint8_t RESERVED_0[32]; - __IO uint32_t CTIMER0CAP[4]; /**< Capture select register for CTIMER inputs, array offset: 0x20, array step: 0x4 */ - __IO uint32_t TIMER0TRIG; /**< Trigger register for TIMER0, offset: 0x30 */ - uint8_t RESERVED_1[12]; - __IO uint32_t CTIMER1CAP[4]; /**< Capture select register for CTIMER inputs, array offset: 0x40, array step: 0x4 */ - __IO uint32_t TIMER1TRIG; /**< Trigger register for TIMER1, offset: 0x50 */ - uint8_t RESERVED_2[12]; - __IO uint32_t CTIMER2CAP[4]; /**< Capture select register for CTIMER inputs, array offset: 0x60, array step: 0x4 */ - __IO uint32_t TIMER2TRIG; /**< Trigger register for TIMER2 inputs, offset: 0x70 */ - uint8_t RESERVED_3[268]; - __IO uint32_t FREQMEAS_REF; /**< Selection for frequency measurement reference clock, offset: 0x180 */ - __IO uint32_t FREQMEAS_TAR; /**< Selection for frequency measurement reference clock, offset: 0x184 */ - uint8_t RESERVED_4[216]; - __IO uint32_t CMP0_TRIG; /**< CMP0 input connections, offset: 0x260 */ - uint8_t RESERVED_5[28]; - __IO uint32_t ADC0_TRIG[4]; /**< ADC Trigger input connections, array offset: 0x280, array step: 0x4 */ - uint8_t RESERVED_6[208]; - __IO uint32_t QDC0_TRIG; /**< QDC0 Trigger Input Connections, offset: 0x360 */ - __IO uint32_t QDC0_HOME; /**< QDC0 Trigger Input Connections, offset: 0x364 */ - __IO uint32_t QDC0_INDEX; /**< QDC0 Trigger Input Connections, offset: 0x368 */ - __IO uint32_t QDC0_PHASEB; /**< QDC0 Trigger Input Connections, offset: 0x36C */ - __IO uint32_t QDC0_PHASEA; /**< QDC0 Trigger Input Connections, offset: 0x370 */ - __IO uint32_t QDC0_ICAP1; /**< QDC0 Trigger Input Connections, offset: 0x374 */ - __IO uint32_t QDC0_ICAP2; /**< QDC0 Trigger Input Connections, offset: 0x378 */ - __IO uint32_t QDC0_ICAP3; /**< QDC0 Trigger Input Connections, offset: 0x37C */ - uint8_t RESERVED_7[32]; - __IO uint32_t FLEXPWM0_SM0_EXTA0; /**< PWM0 input trigger connections, offset: 0x3A0 */ - __IO uint32_t FLEXPWM0_SM0_EXTSYNC0; /**< PWM0 input trigger connections, offset: 0x3A4 */ - __IO uint32_t FLEXPWM0_SM1_EXTA1; /**< PWM0 input trigger connections, offset: 0x3A8 */ - __IO uint32_t FLEXPWM0_SM1_EXTSYNC1; /**< PWM0 input trigger connections, offset: 0x3AC */ - __IO uint32_t FLEXPWM0_SM2_EXTA2; /**< PWM0 input trigger connections, offset: 0x3B0 */ - __IO uint32_t FLEXPWM0_SM2_EXTSYNC2; /**< PWM0 input trigger connections, offset: 0x3B4 */ - uint8_t RESERVED_8[8]; - __IO uint32_t FLEXPWM0_FAULT0; /**< PWM0 input trigger connections, offset: 0x3C0 */ - __IO uint32_t FLEXPWM0_FAULT1; /**< PWM0 input trigger connections, offset: 0x3C4 */ - __IO uint32_t FLEXPWM0_FAULT2; /**< PWM0 input trigger connections, offset: 0x3C8 */ - __IO uint32_t FLEXPWM0_FAULT3; /**< PWM0 input trigger connections, offset: 0x3CC */ - __IO uint32_t FLEXPWM0_FORCE; /**< PWM0 input trigger connections, offset: 0x3D0 */ - uint8_t RESERVED_9[76]; - __IO uint32_t PWM0_EXT_CLK; /**< PWM0 external clock trigger, offset: 0x420 */ - uint8_t RESERVED_10[28]; - __IO uint32_t AOI0_MUX[16]; /**< AOI0 trigger input connections 0-15, array offset: 0x440, array step: 0x4 */ - __IO uint32_t USBFS_TRIG; /**< USB-FS trigger input connections, offset: 0x480 */ - uint8_t RESERVED_11[60]; - __IO uint32_t EXT_TRIG[5]; /**< EXT trigger connections 0-4, array offset: 0x4C0, array step: 0x4 */ - uint8_t RESERVED_12[4]; - __IO uint32_t EXT_TRIG6[2]; /**< EXT trigger connections 6-7, array offset: 0x4D8, array step: 0x4 */ - __IO uint32_t CMP1_TRIG; /**< CMP1 input connections, offset: 0x4E0 */ - uint8_t RESERVED_13[188]; - __IO uint32_t LPI2C0_TRIG; /**< LPI2C0 trigger input connections, offset: 0x5A0 */ - uint8_t RESERVED_14[60]; - __IO uint32_t LPSPI0_TRIG; /**< LPSPI0 trigger input connections, offset: 0x5E0 */ - uint8_t RESERVED_15[28]; - __IO uint32_t LPSPI1_TRIG; /**< LPSPI1 trigger input connections, offset: 0x600 */ - uint8_t RESERVED_16[28]; - __IO uint32_t LPUART0r; /**< LPUART0 trigger input connections, offset: 0x620, 'r' suffix has been added to avoid a clash with peripheral base pointer macro 'LPUART0' */ - uint8_t RESERVED_17[28]; - __IO uint32_t LPUART1r; /**< LPUART1 trigger input connections, offset: 0x640, 'r' suffix has been added to avoid a clash with peripheral base pointer macro 'LPUART1' */ - uint8_t RESERVED_18[28]; - __IO uint32_t LPUART2r; /**< LPUART2 trigger input connections, offset: 0x660, 'r' suffix has been added to avoid a clash with peripheral base pointer macro 'LPUART2' */ -} INPUTMUX_Type; - -/* ---------------------------------------------------------------------------- - -- INPUTMUX Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup INPUTMUX_Register_Masks INPUTMUX Register Masks - * @{ - */ - -/*! @name CTIMERA_CTIMER0CAP - Capture select register for CTIMER inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMERA_CTIMER0CAP_INP_MASK (0x7FU) -#define INPUTMUX_CTIMERA_CTIMER0CAP_INP_SHIFT (0U) -/*! INP - Input number for CTIMER0 - * 0b0000000..Reserved - * 0b0000001..CT_INP0 input is selected - * 0b0000010..CT_INP1 input is selected - * 0b0000011..CT_INP2 input is selected - * 0b0000100..CT_INP3 input is selected - * 0b0000101..CT_INP4 input is selected - * 0b0000110..CT_INP5 input is selected - * 0b0000111..CT_INP6 input is selected - * 0b0001000..CT_INP7 input is selected - * 0b0001001..CT_INP8 input is selected - * 0b0001010..CT_INP9 input is selected - * 0b0001011..Reserved - * 0b0001100..Reserved - * 0b0001101..CT_INP12 input is selected - * 0b0001110..CT_INP13 input is selected - * 0b0001111..CT_INP14 input is selected - * 0b0010000..CT_INP15 input is selected - * 0b0010001..CT_INP16 input is selected - * 0b0010010..CT_INP17 input is selected - * 0b0010011..CT_INP18 input is selected - * 0b0010100..CT_INP19 input is selected - * 0b0010101..USB0 usb0 start of frame input is selected - * 0b0010110..AOI0_OUT0 input is selected - * 0b0010111..AOI0_OUT1 input is selected - * 0b0011000..AOI0_OUT2 input is selected - * 0b0011001..AOI0_OUT3 input is selected - * 0b0011010..ADC0_tcomp[0] input is selected - * 0b0011011..ADC0_tcomp[1] input is selected - * 0b0011100..ADC0_tcomp[2] input is selected - * 0b0011101..ADC0_tcomp[3] input is selected - * 0b0011110..CMP0_OUT input is selected selected - * 0b0011111..CMP1_OUT input is selected selected - * 0b0100000..Reserved - * 0b0100001..CTimer1_MAT1 input is selected - * 0b0100010..CTimer1_MAT2 input is selected - * 0b0100011..CTimer1_MAT3 input is selected - * 0b0100100..CTimer2_MAT1 input is selected - * 0b0100101..CTimer2_MAT2 input is selected - * 0b0100110..CTimer2_MAT3 input is selected - * 0b0100111..QDC0_CMP_FLAG0 input input is selected - * 0b0101000..QDC0_CMP_FLAG1 input is selected - * 0b0101001..QDC0_CMP_FLAG2 input is selected - * 0b0101010..QDC0_CMP_FLAG3 input is selected - * 0b0101011..QDC0_POS_MATCH0 input is selected - * 0b0101100..PWM0_SM0_OUT_TRIG0 input is selected - * 0b0101101..PWM0_SM1_OUT_TRIG0 input is selected - * 0b0101110..PWM0_SM2_OUT_TRIG0 input is selected - * 0b0101111..Reserved - * 0b0110000..LPI2C0 Master End of Packet input is selected - * 0b0110001..LPI2C0 Slave End of Packet input is selected - * 0b0110010..Reserved - * 0b0110011..Reserved - * 0b0110100..LPSPI0 End of Frame input is selected - * 0b0110101..LPSPI0 Received Data Word input is selected - * 0b0110110..LPSPI1 End of Frame input is selected - * 0b0110111..LPSPI1 Received Data Word input is selected - * 0b0111000..LPUART0 Received Data Word input is selected - * 0b0111001..LPUART0 Transmitted Data Word input is selected - * 0b0111010..LPUART0 Receive Line Idle input is selected - * 0b0111011..LPUART1 Received Data Word input is selected - * 0b0111100..LPUART1 Transmitted Data Word input is selected - * 0b0111101..LPUART1 Receive Line Idle input is selected - * 0b0111110..LPUART2 Received Data Word input is selected - * 0b0111111..LPUART2 Transmitted Data Word input is selected - * 0b1000000..LPUART2 Receive Line Idle input is selected - * *.. - */ -#define INPUTMUX_CTIMERA_CTIMER0CAP_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMERA_CTIMER0CAP_INP_SHIFT)) & INPUTMUX_CTIMERA_CTIMER0CAP_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_CTIMERA_CTIMER0CAP */ -#define INPUTMUX_CTIMERA_CTIMER0CAP_COUNT (4U) - -/*! @name TIMER0TRIG - Trigger register for TIMER0 */ -/*! @{ */ - -#define INPUTMUX_TIMER0TRIG_INP_MASK (0x7FU) -#define INPUTMUX_TIMER0TRIG_INP_SHIFT (0U) -/*! INP - Input number for CTIMER0 - * 0b0000000..Reserved - * 0b0000001..CT_INP0 input is selected - * 0b0000010..CT_INP1 input is selected - * 0b0000011..CT_INP2 input is selected - * 0b0000100..CT_INP3 input is selected - * 0b0000101..CT_INP4 input is selected - * 0b0000110..CT_INP5 input is selected - * 0b0000111..CT_INP6 input is selected - * 0b0001000..CT_INP7 input is selected - * 0b0001001..CT_INP8 input is selected - * 0b0001010..CT_INP9 input is selected - * 0b0001011..Reserved - * 0b0001100..Reserved - * 0b0001101..CT_INP12 input is selected - * 0b0001110..CT_INP13 input is selected - * 0b0001111..CT_INP14 input is selected - * 0b0010000..CT_INP15 input is selected - * 0b0010001..CT_INP16 input is selected - * 0b0010010..CT_INP17 input is selected - * 0b0010011..CT_INP18 input is selected - * 0b0010100..CT_INP19 input is selected - * 0b0010101..USB0 usb0 start of frame input is selected - * 0b0010110..AOI0_OUT0 input is selected - * 0b0010111..AOI0_OUT1 input is selected - * 0b0011000..AOI0_OUT2 input is selected - * 0b0011001..AOI0_OUT3 input is selected - * 0b0011010..ADC0_tcomp[0] input is selected - * 0b0011011..ADC0_tcomp[1] input is selected - * 0b0011100..ADC0_tcomp[2] input is selected - * 0b0011101..ADC0_tcomp[3] input is selected - * 0b0011110..CMP0_OUT input is selected selected - * 0b0011111..CMP1_OUT input is selected selected - * 0b0100000..Reserved - * 0b0100001..CTimer1_MAT1 input is selected - * 0b0100010..CTimer1_MAT2 input is selected - * 0b0100011..CTimer1_MAT3 input is selected - * 0b0100100..CTimer2_MAT1 input is selected - * 0b0100101..CTimer2_MAT2 input is selected - * 0b0100110..CTimer2_MAT3 input is selected - * 0b0100111..QDC0_CMP_FLAG0 input is selected - * 0b0101000..QDC0_CMP_FLAG1 input is selected - * 0b0101001..QDC0_CMP_FLAG2 input is selected - * 0b0101010..QDC0_CMP_FLAG3 input is selected - * 0b0101011..QDC0_POS_MATCH0 input is selected - * 0b0101100..PWM0_SM0_OUT_TRIG0 input is selected - * 0b0101101..PWM0_SM1_OUT_TRIG0 input is selected - * 0b0101110..PWM0_SM2_OUT_TRIG0 input is selected - * 0b0101111..Reserved - * 0b0110000..LPI2C0 Master End of Packet input is selected - * 0b0110001..LPI2C0 Slave End of Packet input is selected - * 0b0110010..Reserved - * 0b0110011..Reserved - * 0b0110100..LPSPI0 End of Frame input is selected - * 0b0110101..LPSPI0 Received Data Word input is selected - * 0b0110110..LPSPI1 End of Frame input is selected - * 0b0110111..LPSPI1 Received Data Word input is selected - * 0b0111000..LPUART0 Received Data Word input is selected - * 0b0111001..LPUART0 Transmitted Data Word input is selected - * 0b0111010..LPUART0 Receive Line Idle input is selected - * 0b0111011..LPUART1 Received Data Word input is selected - * 0b0111100..LPUART1 Transmitted Data Word input is selected - * 0b0111101..LPUART1 Receive Line Idle input is selected - * 0b0111110..LPUART2 Received Data Word input is selected - * 0b0111111..LPUART2 Transmitted Data Word input is selected - * 0b1000000..LPUART2 Receive Line Idle input is selected - * *.. - */ -#define INPUTMUX_TIMER0TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_TIMER0TRIG_INP_SHIFT)) & INPUTMUX_TIMER0TRIG_INP_MASK) -/*! @} */ - -/*! @name CTIMERB_CTIMER1CAP - Capture select register for CTIMER inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMERB_CTIMER1CAP_INP_MASK (0x7FU) -#define INPUTMUX_CTIMERB_CTIMER1CAP_INP_SHIFT (0U) -/*! INP - Input number for CTIMER0 - * 0b0000000..Reserved - * 0b0000001..CT_INP0 input is selected - * 0b0000010..CT_INP1 input is selected - * 0b0000011..CT_INP2 input is selected - * 0b0000100..CT_INP3 input is selected - * 0b0000101..CT_INP4 input is selected - * 0b0000110..CT_INP5 input is selected - * 0b0000111..CT_INP6 input is selected - * 0b0001000..CT_INP7 input is selected - * 0b0001001..CT_INP8 input is selected - * 0b0001010..CT_INP9 input is selected - * 0b0001011..Reserved - * 0b0001100..Reserved - * 0b0001101..CT_INP12 input is selected - * 0b0001110..CT_INP13 input is selected - * 0b0001111..CT_INP14 input is selected - * 0b0010000..CT_INP15 input is selected - * 0b0010001..CT_INP16 input is selected - * 0b0010010..CT_INP17 input is selected - * 0b0010011..CT_INP18 input is selected - * 0b0010100..CT_INP19 input is selected - * 0b0010101..USB0 usb0 start of frame input is selected - * 0b0010110..AOI0_OUT0 input is selected - * 0b0010111..AOI0_OUT1 input is selected - * 0b0011000..AOI0_OUT2 input is selected - * 0b0011001..AOI0_OUT3 input is selected - * 0b0011010..ADC0_tcomp[0] input is selected - * 0b0011011..ADC0_tcomp[1] input is selected - * 0b0011100..ADC0_tcomp[2] input is selected - * 0b0011101..ADC0_tcomp[3] input is selected - * 0b0011110..CMP0_OUT input is selected - * 0b0011111..CMP1_OUT input is selected - * 0b0100000..Reserved - * 0b0100001..CTimer0_MAT1 input is selected - * 0b0100010..CTimer0_MAT2 input is selected - * 0b0100011..CTimer0_MAT3 input is selected - * 0b0100100..CTimer2_MAT1 input is selected - * 0b0100101..CTimer2_MAT2 input is selected - * 0b0100110..CTimer2_MAT3 input is selected - * 0b0100111..QDC0_CMP_FLAG0 input is selected - * 0b0101000..QDC0_CMP_FLAG1 input is selected - * 0b0101001..QDC0_CMP_FLAG2 input is selected - * 0b0101010..QDC0_CMP_FLAG3 input is selected - * 0b0101011..QDC0_POS_MATCH0 input is selected - * 0b0101100..PWM0_SM0_OUT_TRIG0 input is selected - * 0b0101101..PWM0_SM1_OUT_TRIG0 input is selected - * 0b0101110..PWM0_SM2_OUT_TRIG0 input is selected - * 0b0101111..Reserved - * 0b0110000..LPI2C0 Master End of Packet input is selected - * 0b0110001..LPI2C0 Slave End of Packet input is selected - * 0b0110010..Reserved - * 0b0110011..Reserved - * 0b0110100..LPSPI0 End of Frame input is selected - * 0b0110101..LPSPI0 Received Data Word input is selected - * 0b0110110..LPSPI1 End of Frame input is selected - * 0b0110111..LPSPI1 Received Data Word input is selected - * 0b0111000..LPUART0 Received Data Word input is selected - * 0b0111001..LPUART0 Transmitted Data Word input is selected - * 0b0111010..LPUART0 Receive Line Idle input is selected - * 0b0111011..LPUART1 Received Data Word input is selected - * 0b0111100..LPUART1 Transmitted Data Word input is selected - * 0b0111101..LPUART1 Receive Line Idle input is selected - * 0b0111110..LPUART2 Received Data Word input is selected - * 0b0111111..LPUART2 Transmitted Data Word input is selected - * 0b1000000..LPUART2 Receive Line Idle input is selected - * *.. - */ -#define INPUTMUX_CTIMERB_CTIMER1CAP_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMERB_CTIMER1CAP_INP_SHIFT)) & INPUTMUX_CTIMERB_CTIMER1CAP_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_CTIMERB_CTIMER1CAP */ -#define INPUTMUX_CTIMERB_CTIMER1CAP_COUNT (4U) - -/*! @name TIMER1TRIG - Trigger register for TIMER1 */ -/*! @{ */ - -#define INPUTMUX_TIMER1TRIG_INP_MASK (0x7FU) -#define INPUTMUX_TIMER1TRIG_INP_SHIFT (0U) -/*! INP - Input number for CTIMER0 - * 0b0000000..Reserved - * 0b0000001..CT_INP0 input is selected - * 0b0000010..CT_INP1 input is selected - * 0b0000011..CT_INP2 input is selected - * 0b0000100..CT_INP3 input is selected - * 0b0000101..CT_INP4 input is selected - * 0b0000110..CT_INP5 input is selected - * 0b0000111..CT_INP6 input is selected - * 0b0001000..CT_INP7 input is selected - * 0b0001001..CT_INP8 input is selected - * 0b0001010..CT_INP9 input is selected - * 0b0001011..Reserved - * 0b0001100..Reserved - * 0b0001101..CT_INP12 input is selected - * 0b0001110..CT_INP13 input is selected - * 0b0001111..CT_INP14 input is selected - * 0b0010000..CT_INP15 input is selected - * 0b0010001..CT_INP16 input is selected - * 0b0010010..CT_INP17 input is selected - * 0b0010011..CT_INP18 input is selected - * 0b0010100..CT_INP19 input is selected - * 0b0010101..USB0 usb0 start of frame input is selected - * 0b0010110..AOI0_OUT0 input is selected - * 0b0010111..AOI0_OUT1 input is selected - * 0b0011000..AOI0_OUT2 input is selected - * 0b0011001..AOI0_OUT3 input is selected - * 0b0011010..ADC0_tcomp[0] input is selected - * 0b0011011..ADC0_tcomp[1] input is selected - * 0b0011100..ADC0_tcomp[2] input is selected - * 0b0011101..ADC0_tcomp[3] input is selected - * 0b0011110..CMP0_OUT input is selected - * 0b0011111..CMP1_OUT input is selected - * 0b0100000..Reserved - * 0b0100001..CTimer0_MAT1 input is selected - * 0b0100010..CTimer0_MAT2 input is selected - * 0b0100011..CTimer0_MAT3 input is selected - * 0b0100100..CTimer2_MAT1 input is selected - * 0b0100101..CTimer2_MAT2 input is selected - * 0b0100110..CTimer2_MAT3 input is selected - * 0b0100111..QDC0_CMP_FLAG0 input is selected - * 0b0101000..QDC0_CMP_FLAG1 input is selected - * 0b0101001..QDC0_CMP_FLAG2 input is selected - * 0b0101010..QDC0_CMP_FLAG3 input is selected - * 0b0101011..QDC0_POS_MATCH0 input is selected - * 0b0101100..PWM0_SM0_OUT_TRIG0 input is selected - * 0b0101101..PWM0_SM1_OUT_TRIG0 input is selected - * 0b0101110..PWM0_SM2_OUT_TRIG0 input is selected - * 0b0101111..Reserved - * 0b0110000..LPI2C0 Master End of Packet input is selected - * 0b0110001..LPI2C0 Slave End of Packet input is selected - * 0b0110010..Reserved - * 0b0110011..Reserved - * 0b0110100..LPSPI0 End of Frame input is selected - * 0b0110101..LPSPI0 Received Data Word input is selected - * 0b0110110..LPSPI1 End of Frame input is selected - * 0b0110111..LPSPI1 Received Data Word input is selected - * 0b0111000..LPUART0 Received Data Word input is selected - * 0b0111001..LPUART0 Transmitted Data Word input is selected - * 0b0111010..LPUART0 Receive Line Idle input is selected - * 0b0111011..LPUART1 Received Data Word input is selected - * 0b0111100..LPUART1 Transmitted Data Word input is selected - * 0b0111101..LPUART1 Receive Line Idle input is selected - * 0b0111110..LPUART2 Received Data Word input is selected - * 0b0111111..LPUART2 Transmitted Data Word input is selected - * 0b1000000..LPUART2 Receive Line Idle input is selected - * *.. - */ -#define INPUTMUX_TIMER1TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_TIMER1TRIG_INP_SHIFT)) & INPUTMUX_TIMER1TRIG_INP_MASK) -/*! @} */ - -/*! @name CTIMERC_CTIMER2CAP - Capture select register for CTIMER inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMERC_CTIMER2CAP_INP_MASK (0x7FU) -#define INPUTMUX_CTIMERC_CTIMER2CAP_INP_SHIFT (0U) -/*! INP - Input number for CTIMER0 - * 0b0000000..Reserved - * 0b0000001..CT_INP0 input is selected - * 0b0000010..CT_INP1 input is selected - * 0b0000011..CT_INP2 input is selected - * 0b0000100..CT_INP3 input is selected - * 0b0000101..CT_INP4 input is selected - * 0b0000110..CT_INP5 input is selected - * 0b0000111..CT_INP6 input is selected - * 0b0001000..CT_INP7 input is selected - * 0b0001001..CT_INP8 input is selected - * 0b0001010..CT_INP9 input is selected - * 0b0001011..Reserved - * 0b0001100..Reserved - * 0b0001101..CT_INP12 input is selected - * 0b0001110..CT_INP13 input is selected - * 0b0001111..CT_INP14 input is selected - * 0b0010000..CT_INP15 input is selected - * 0b0010001..CT_INP16 input is selected - * 0b0010010..CT_INP17 input is selected - * 0b0010011..CT_INP18 input is selected - * 0b0010100..CT_INP19 input is selected - * 0b0010101..USB0 usb0 start of frame input is selected - * 0b0010110..AOI0_OUT0 input is selected - * 0b0010111..AOI0_OUT1 input is selected - * 0b0011000..AOI0_OUT2 input is selected - * 0b0011001..AOI0_OUT3 input is selected - * 0b0011010..ADC0_tcomp[0] input is selected - * 0b0011011..ADC0_tcomp[1] input is selected - * 0b0011100..ADC0_tcomp[2] input is selected - * 0b0011101..ADC0_tcomp[3] input is selected - * 0b0011110..CMP0_OUT input is selected - * 0b0011111..CMP1_OUT input is selected - * 0b0100000..Reserved - * 0b0100001..CTimer0_MAT1 input is selected - * 0b0100010..CTimer0_MAT2 input is selected - * 0b0100011..CTimer0_MAT3 input is selected - * 0b0100100..CTimer1_MAT1 input is selected - * 0b0100101..CTimer1_MAT2 input is selected - * 0b0100110..CTimer1_MAT3 input is selected - * 0b0100111..QDC0_CMP_FLAG0 input is selected - * 0b0101000..QDC0_CMP_FLAG1 input is selected - * 0b0101001..QDC0_CMP_FLAG2 input is selected - * 0b0101010..QDC0_CMP_FLAG3 input is selected - * 0b0101011..QDC0_POS_MATCH0 input is selected - * 0b0101100..PWM0_SM0_OUT_TRIG0 input is selected - * 0b0101101..PWM0_SM1_OUT_TRIG0 input is selected - * 0b0101110..PWM0_SM2_OUT_TRIG0 input is selected - * 0b0101111..Reserved - * 0b0110000..LPI2C0 Master End of Packet input is selected - * 0b0110001..LPI2C0 Slave End of Packet input is selected - * 0b0110010..Reserved - * 0b0110011..Reserved - * 0b0110100..LPSPI0 End of Frame input is selected - * 0b0110101..LPSPI0 Received Data Word input is selected - * 0b0110110..LPSPI1 End of Frame input is selected - * 0b0110111..LPSPI1 Received Data Word input is selected - * 0b0111000..LPUART0 Received Data Word input is selected - * 0b0111001..LPUART0 Transmitted Data Word input is selected - * 0b0111010..LPUART0 Receive Line Idle input is selected - * 0b0111011..LPUART1 Received Data Word input is selected - * 0b0111100..LPUART1 Transmitted Data Word input is selected - * 0b0111101..LPUART1 Receive Line Idle input is selected - * 0b0111110..LPUART2 Received Data Word input is selected - * 0b0111111..LPUART2 Transmitted Data Word input is selected - * 0b1000000..LPUART2 Receive Line Idle input is selected - * *.. - */ -#define INPUTMUX_CTIMERC_CTIMER2CAP_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMERC_CTIMER2CAP_INP_SHIFT)) & INPUTMUX_CTIMERC_CTIMER2CAP_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_CTIMERC_CTIMER2CAP */ -#define INPUTMUX_CTIMERC_CTIMER2CAP_COUNT (4U) - -/*! @name TIMER2TRIG - Trigger register for TIMER2 inputs */ -/*! @{ */ - -#define INPUTMUX_TIMER2TRIG_INP_MASK (0x7FU) -#define INPUTMUX_TIMER2TRIG_INP_SHIFT (0U) -/*! INP - Input number for CTIMER0 - * 0b0000000..Reserved - * 0b0000001..CT_INP0 input is selected - * 0b0000010..CT_INP1 input is selected - * 0b0000011..CT_INP2 input is selected - * 0b0000100..CT_INP3 input is selected - * 0b0000101..CT_INP4 input is selected - * 0b0000110..CT_INP5 input is selected - * 0b0000111..CT_INP6 input is selected - * 0b0001000..CT_INP7 input is selected - * 0b0001001..CT_INP8 input is selected - * 0b0001010..CT_INP9 input is selected - * 0b0001011..Reserved - * 0b0001100..Reserved - * 0b0001101..CT_INP12 input is selected - * 0b0001110..CT_INP13 input is selected - * 0b0001111..CT_INP14 input is selected - * 0b0010000..CT_INP15 input is selected - * 0b0010001..CT_INP16 input is selected - * 0b0010010..CT_INP17 input is selected - * 0b0010011..CT_INP18 input is selected - * 0b0010100..CT_INP19 input is selected - * 0b0010101..USB0 usb0 start of frame input is selected - * 0b0010110..AOI0_OUT0 input is selected - * 0b0010111..AOI0_OUT1 input is selected - * 0b0011000..AOI0_OUT2 input is selected - * 0b0011001..AOI0_OUT3 input is selected - * 0b0011010..ADC0_tcomp[0] input is selected - * 0b0011011..ADC0_tcomp[1] input is selected - * 0b0011100..ADC0_tcomp[2] input is selected - * 0b0011101..ADC0_tcomp[3] input is selected - * 0b0011110..CMP0_OUT input is selected selected - * 0b0011111..CMP1_OUT input is selected selected - * 0b0100000..Reserved - * 0b0100001..CTimer0_MAT1 input is selected - * 0b0100010..CTimer0_MAT2 input is selected - * 0b0100011..CTimer0_MAT3 input is selected - * 0b0100100..CTimer1_MAT1 input is selected - * 0b0100101..CTimer1_MAT2 input is selected - * 0b0100110..CTimer1_MAT3 input is selected - * 0b0100111..QDC0_CMP_FLAG0 input is selected - * 0b0101000..QDC0_CMP_FLAG1 input is selected - * 0b0101001..QDC0_CMP_FLAG2 input is selected - * 0b0101010..QDC0_CMP_FLAG3 input is selected - * 0b0101011..QDC0_POS_MATCH0 input is selected - * 0b0101100..PWM0_SM0_OUT_TRIG0 input is selected - * 0b0101101..PWM0_SM1_OUT_TRIG0 input is selected - * 0b0101110..PWM0_SM2_OUT_TRIG0 input is selected - * 0b0101111..Reserved - * 0b0110000..LPI2C0 Master End of Packet input is selected - * 0b0110001..LPI2C0 Slave End of Packet input is selected - * 0b0110010..Reserved - * 0b0110011..Reserved - * 0b0110100..LPSPI0 End of Frame input is selected - * 0b0110101..LPSPI0 Received Data Word input is selected - * 0b0110110..LPSPI1 End of Frame input is selected - * 0b0110111..LPSPI1 Received Data Word input is selected - * 0b0111000..LPUART0 Received Data Word input is selected - * 0b0111001..LPUART0 Transmitted Data Word input is selected - * 0b0111010..LPUART0 Receive Line Idle input is selected - * 0b0111011..LPUART1 Received Data Word input is selected - * 0b0111100..LPUART1 Transmitted Data Word input is selected - * 0b0111101..LPUART1 Receive Line Idle input is selected - * 0b0111110..LPUART2 Received Data Word input is selected - * 0b0111111..LPUART2 Transmitted Data Word input is selected - * 0b1000000..LPUART2 Receive Line Idle input is selected - * *.. - */ -#define INPUTMUX_TIMER2TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_TIMER2TRIG_INP_SHIFT)) & INPUTMUX_TIMER2TRIG_INP_MASK) -/*! @} */ - -/*! @name FREQMEAS_REF - Selection for frequency measurement reference clock */ -/*! @{ */ - -#define INPUTMUX_FREQMEAS_REF_INP_MASK (0x1FU) -#define INPUTMUX_FREQMEAS_REF_INP_SHIFT (0U) -/*! INP - Clock source number (binary value) for frequency measure function target clock. - * 0b00000..Reserved - * 0b00001..clk_in input is selected - * 0b00010..FRO_OSC_12M input is selected - * 0b00011..fro_hf_div input is selected - * 0b00100..Reserved - * 0b00101..clk_16k[1] input is selected - * 0b00110..SLOW_CLK input is selected - * 0b00111..FREQME_CLK_IN0 input is selected - * 0b01000..FREQME_CLK_IN1 input is selected - * 0b01001..AOI0_OUT0 input is selected - * 0b01010..AOI0_OUT1 input is selected - * 0b01011..PWM0_SM0_OUT_TRIG0 input is selected - * 0b01100..PWM0_SM0_OUT_TRIG1 input is selected - * 0b01101..PWM0_SM1_OUT_TRIG0 input is selected - * 0b01110..PWM0_SM1_OUT_TRIG1 input is selected - * 0b01111..PWM0_SM2_OUT_TRIG0 input is selected - * 0b10000..PWM0_SM2_OUT_TRIG1 input is selected - * *.. - */ -#define INPUTMUX_FREQMEAS_REF_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FREQMEAS_REF_INP_SHIFT)) & INPUTMUX_FREQMEAS_REF_INP_MASK) -/*! @} */ - -/*! @name FREQMEAS_TAR - Selection for frequency measurement reference clock */ -/*! @{ */ - -#define INPUTMUX_FREQMEAS_TAR_INP_MASK (0x1FU) -#define INPUTMUX_FREQMEAS_TAR_INP_SHIFT (0U) -/*! INP - Clock source number (binary value) for frequency measure function target clock. - * 0b00000..Reserved - * 0b00001..clk_in input is selected - * 0b00010..FRO_OSC_12M input is selected - * 0b00011..fro_hf_div input is selected - * 0b00100..Reserved - * 0b00101..clk_16k[1] input is selected - * 0b00110..SLOW_CLK input is selected - * 0b00111..FREQME_CLK_IN0 input is selected - * 0b01000..FREQME_CLK_IN1 input is selected - * 0b01001..AOI0_OUT0 input is selected - * 0b01010..AOI0_OUT1 input is selected - * 0b01011..PWM0_SM0_OUT_TRIG0 input is selected - * 0b01100..PWM0_SM0_OUT_TRIG1 input is selected - * 0b01101..PWM0_SM1_OUT_TRIG0 input is selected - * 0b01110..PWM0_SM1_OUT_TRIG1 input is selected - * 0b01111..PWM0_SM2_OUT_TRIG0 input is selected - * 0b10000..PWM0_SM2_OUT_TRIG1 input is selected - * *.. - */ -#define INPUTMUX_FREQMEAS_TAR_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FREQMEAS_TAR_INP_SHIFT)) & INPUTMUX_FREQMEAS_TAR_INP_MASK) -/*! @} */ - -/*! @name CMP0_TRIG - CMP0 input connections */ -/*! @{ */ - -#define INPUTMUX_CMP0_TRIG_TRIGIN_MASK (0x3FU) -#define INPUTMUX_CMP0_TRIG_TRIGIN_SHIFT (0U) -/*! TRIGIN - CMP0 input trigger - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP1_OUT input is selected - * 0b000111..Reserved - * 0b001000..CTimer0_MAT0 input is selected - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer1_MAT0 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer2_MAT0 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..LPTMR0 input is selected - * 0b001111..Reserved - * 0b010000..QDC0_POS_MATCH0 - * 0b010001..PWM0_SM0_OUT_TRIG0 input is selected - * 0b010010..PWM0_SM0_OUT_TRIG1 input is selected - * 0b010011..PWM0_SM1_OUT_TRIG0 input is selected - * 0b010100..PWM0_SM1_OUT_TRIG1 input is selected - * 0b010101..PWM0_SM2_OUT_TRIG0 input is selected - * 0b010110..PWM0_SM2_OUT_TRIG1 input is selected - * 0b010111..Reserved - * 0b011000..Reserved - * 0b011001..GPIO0 Pin Event Trig 0 input is selected - * 0b011010..GPIO1 Pin Event Trig 0 input is selected - * 0b011011..GPIO2 Pin Event Trig 0 input is selected - * 0b011100..GPIO3 Pin Event Trig 0 input is selected - * 0b011101..Reserved - * 0b011110..WUU input is selected - * *.. - */ -#define INPUTMUX_CMP0_TRIG_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CMP0_TRIG_TRIGIN_SHIFT)) & INPUTMUX_CMP0_TRIG_TRIGIN_MASK) -/*! @} */ - -/*! @name ADC0_TRIGM_ADC0_TRIG - ADC Trigger input connections */ -/*! @{ */ - -#define INPUTMUX_ADC0_TRIGM_ADC0_TRIG_TRIGIN_MASK (0x3FU) -#define INPUTMUX_ADC0_TRIGM_ADC0_TRIG_TRIGIN_SHIFT (0U) -/*! TRIGIN - ADC0 trigger inputs - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT0 input is selected - * 0b001010..CTimer0_MAT1 input is selected - * 0b001011..CTimer1_MAT0 input is selected - * 0b001100..CTimer1_MAT1 input is selected - * 0b001101..CTimer2_MAT0 input is selected - * 0b001110..CTimer2_MAT1 input is selected - * 0b001111..LPTMR0 input is selected - * 0b010000..Reserved - * 0b010001..QDC0_POS_MATCH0 input is selected - * 0b010010..PWM0_SM0_OUT_TRIG0 input is selected - * 0b010011..PWM0_SM0_OUT_TRIG1 input is selected - * 0b010100..PWM0_SM1_OUT_TRIG0 input is selected - * 0b010101..PWM0_SM1_OUT_TRIG1 input is selected - * 0b010110..PWM0_SM2_OUT_TRIG0 input is selected - * 0b010111..PWM0_SM2_OUT_TRIG1 input is selected - * 0b011000..Reserved - * 0b011001..Reserved - * 0b011010..GPIO0 Pin Event Trig 0 input is selected - * 0b011011..GPIO1 Pin Event Trig 0 input is selected - * 0b011100..GPIO2 Pin Event Trig 0 input is selected - * 0b011101..GPIO3 Pin Event Trig 0 input is selected - * 0b011110..Reserved - * 0b011111..WUU - * *.. - */ -#define INPUTMUX_ADC0_TRIGM_ADC0_TRIG_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_ADC0_TRIGM_ADC0_TRIG_TRIGIN_SHIFT)) & INPUTMUX_ADC0_TRIGM_ADC0_TRIG_TRIGIN_MASK) -/*! @} */ - -/* The count of INPUTMUX_ADC0_TRIGM_ADC0_TRIG */ -#define INPUTMUX_ADC0_TRIGM_ADC0_TRIG_COUNT (4U) - -/*! @name QDC0_TRIG - QDC0 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDC0_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_QDC0_TRIG_INP_SHIFT (0U) -/*! INP - QDC0 input connections - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_POS_MATCH0 input is selected - * 0b010000..PWM0_SM0_OUT_TRIG0 input is selected - * 0b010001..PWM0_SM0_OUT_TRIG1 input is selected - * 0b010010..PWM0_SM1_OUT_TRIG0 input is selected - * 0b010011..PWM0_SM1_OUT_TRIG1 input is selected - * 0b010100..PWM0_SM2_OUT_TRIG0 input is selected - * 0b010101..PWM0_SM2_OUT_TRIG1 input is selected - * 0b010110..Reserved - * 0b010111..Reserved - * 0b011000..TRIG_IN0 input is selected - * 0b011001..TRIG_IN1 input is selected - * 0b011010..TRIG_IN2 input is selected - * 0b011011..TRIG_IN3 input is selected - * 0b011100..TRIG_IN4 input is selected - * 0b011101..TRIG_IN5 input is selected - * 0b011110..TRIG_IN6 input is selected - * 0b011111..TRIG_IN7 input is selected - * 0b100000..TRIG_IN8 input is selected - * 0b100001..TRIG_IN9 input is selected - * 0b100010..TRIG_IN10 input is selected - * 0b100011..TRIG_IN11 input is selected - * 0b100100..GPIO0 Pin Event Trig 0 input is selected - * 0b100101..GPIO1 Pin Event Trig 0 input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO3 Pin Event Trig 0 input is selected - * *.. - */ -#define INPUTMUX_QDC0_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDC0_TRIG_INP_SHIFT)) & INPUTMUX_QDC0_TRIG_INP_MASK) -/*! @} */ - -/*! @name QDC0_HOME - QDC0 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDC0_HOME_INP_MASK (0x3FU) -#define INPUTMUX_QDC0_HOME_INP_SHIFT (0U) -/*! INP - QDC0 input connections - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_POS_MATCH0 input is selected - * 0b010000..PWM0_SM0_OUT_TRIG0 input is selected - * 0b010001..PWM0_SM0_OUT_TRIG1 input is selected - * 0b010010..PWM0_SM1_OUT_TRIG0 input is selected - * 0b010011..PWM0_SM1_OUT_TRIG1 input is selected - * 0b010100..PWM0_SM2_OUT_TRIG0 input is selected - * 0b010101..PWM0_SM2_OUT_TRIG1 input is selected - * 0b010110..Reserved - * 0b010111..Reserved - * 0b011000..TRIG_IN0 input is selected - * 0b011001..TRIG_IN1 input is selected - * 0b011010..TRIG_IN2 input is selected - * 0b011011..TRIG_IN3 input is selected - * 0b011100..TRIG_IN4 input is selected - * 0b011101..TRIG_IN5 input is selected - * 0b011110..TRIG_IN6 input is selected - * 0b011111..TRIG_IN7 input is selected - * 0b100000..TRIG_IN8 input is selected - * 0b100001..TRIG_IN9 input is selected - * 0b100010..TRIG_IN10 input is selected - * 0b100011..TRIG_IN11 input is selected - * 0b100100..GPIO0 Pin Event Trig 0 input is selected - * 0b100101..GPIO1 Pin Event Trig 0 input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO3 Pin Event Trig 0 input is selected - * *.. - */ -#define INPUTMUX_QDC0_HOME_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDC0_HOME_INP_SHIFT)) & INPUTMUX_QDC0_HOME_INP_MASK) -/*! @} */ - -/*! @name QDC0_INDEX - QDC0 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDC0_INDEX_INP_MASK (0x3FU) -#define INPUTMUX_QDC0_INDEX_INP_SHIFT (0U) -/*! INP - QDC0 input connections - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_POS_MATCH0 input is selected - * 0b010000..PWM0_SM0_OUT_TRIG0 input is selected - * 0b010001..PWM0_SM0_OUT_TRIG1 input is selected - * 0b010010..PWM0_SM1_OUT_TRIG0 input is selected - * 0b010011..PWM0_SM1_OUT_TRIG1 input is selected - * 0b010100..PWM0_SM2_OUT_TRIG0 input is selected - * 0b010101..PWM0_SM2_OUT_TRIG1 input is selected - * 0b010110..Reserved - * 0b010111..Reserved - * 0b011000..TRIG_IN0 input is selected - * 0b011001..TRIG_IN1 input is selected - * 0b011010..TRIG_IN2 input is selected - * 0b011011..TRIG_IN3 input is selected - * 0b011100..TRIG_IN4 input is selected - * 0b011101..TRIG_IN5 input is selected - * 0b011110..TRIG_IN6 input is selected - * 0b011111..TRIG_IN7 input is selected - * 0b100000..TRIG_IN8 input is selected - * 0b100001..TRIG_IN9 input is selected - * 0b100010..TRIG_IN10 input is selected - * 0b100011..TRIG_IN11 input is selected - * 0b100100..GPIO0 Pin Event Trig 0 input is selected - * 0b100101..GPIO1 Pin Event Trig 0 input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO3 Pin Event Trig 0 input is selected - * *.. - */ -#define INPUTMUX_QDC0_INDEX_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDC0_INDEX_INP_SHIFT)) & INPUTMUX_QDC0_INDEX_INP_MASK) -/*! @} */ - -/*! @name QDC0_PHASEB - QDC0 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDC0_PHASEB_INP_MASK (0x3FU) -#define INPUTMUX_QDC0_PHASEB_INP_SHIFT (0U) -/*! INP - QDC0 input connections - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_POS_MATCH0 input is selected - * 0b010000..PWM0_SM0_OUT_TRIG0 input is selected - * 0b010001..PWM0_SM0_OUT_TRIG1 input is selected - * 0b010010..PWM0_SM1_OUT_TRIG0 input is selected - * 0b010011..PWM0_SM1_OUT_TRIG1 input is selected - * 0b010100..PWM0_SM2_OUT_TRIG0 input is selected - * 0b010101..PWM0_SM2_OUT_TRIG1 input is selected - * 0b010110..Reserved - * 0b010111..Reserved - * 0b011000..TRIG_IN0 input is selected - * 0b011001..TRIG_IN1 input is selected - * 0b011010..TRIG_IN2 input is selected - * 0b011011..TRIG_IN3 input is selected - * 0b011100..TRIG_IN4 input is selected - * 0b011101..TRIG_IN5 input is selected - * 0b011110..TRIG_IN6 input is selected - * 0b011111..TRIG_IN7 input is selected - * 0b100000..TRIG_IN8 input is selected - * 0b100001..TRIG_IN9 input is selected - * 0b100010..TRIG_IN10 input is selected - * 0b100011..TRIG_IN11 input is selected - * 0b100100..GPIO0 Pin Event Trig 0 input is selected - * 0b100101..GPIO1 Pin Event Trig 0 input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO3 Pin Event Trig 0 input is selected - * *.. - */ -#define INPUTMUX_QDC0_PHASEB_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDC0_PHASEB_INP_SHIFT)) & INPUTMUX_QDC0_PHASEB_INP_MASK) -/*! @} */ - -/*! @name QDC0_PHASEA - QDC0 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDC0_PHASEA_INP_MASK (0x3FU) -#define INPUTMUX_QDC0_PHASEA_INP_SHIFT (0U) -/*! INP - QDC0 input connections - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_POS_MATCH0 input is selected - * 0b010000..PWM0_SM0_OUT_TRIG0 input is selected - * 0b010001..PWM0_SM0_OUT_TRIG1 input is selected - * 0b010010..PWM0_SM1_OUT_TRIG0 input is selected - * 0b010011..PWM0_SM1_OUT_TRIG1 input is selected - * 0b010100..PWM0_SM2_OUT_TRIG0 input is selected - * 0b010101..PWM0_SM2_OUT_TRIG1 input is selected - * 0b010110..Reserved - * 0b010111..Reserved - * 0b011000..TRIG_IN0 input is selected - * 0b011001..TRIG_IN1 input is selected - * 0b011010..TRIG_IN2 input is selected - * 0b011011..TRIG_IN3 input is selected - * 0b011100..TRIG_IN4 input is selected - * 0b011101..TRIG_IN5 input is selected - * 0b011110..TRIG_IN6 input is selected - * 0b011111..TRIG_IN7 input is selected - * 0b100000..TRIG_IN8 input is selected - * 0b100001..TRIG_IN9 input is selected - * 0b100010..TRIG_IN10 input is selected - * 0b100011..TRIG_IN11 input is selected - * 0b100100..GPIO0 Pin Event Trig 0 input is selected - * 0b100101..GPIO1 Pin Event Trig 0 input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO3 Pin Event Trig 0 input is selected - * *.. - */ -#define INPUTMUX_QDC0_PHASEA_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDC0_PHASEA_INP_SHIFT)) & INPUTMUX_QDC0_PHASEA_INP_MASK) -/*! @} */ - -/*! @name QDC0_ICAP1 - QDC0 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDC0_ICAP1_INP_MASK (0x3FU) -#define INPUTMUX_QDC0_ICAP1_INP_SHIFT (0U) -/*! INP - QDC0 input connections - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_POS_MATCH0 input is selected - * 0b010000..PWM0_SM0_OUT_TRIG0 input is selected - * 0b010001..PWM0_SM0_OUT_TRIG1 input is selected - * 0b010010..PWM0_SM1_OUT_TRIG0 input is selected - * 0b010011..PWM0_SM1_OUT_TRIG1 input is selected - * 0b010100..PWM0_SM2_OUT_TRIG0 input is selected - * 0b010101..PWM0_SM2_OUT_TRIG1 input is selected - * 0b010110..Reserved - * 0b010111..Reserved - * 0b011000..TRIG_IN0 input is selected - * 0b011001..TRIG_IN1 input is selected - * 0b011010..TRIG_IN2 input is selected - * 0b011011..TRIG_IN3 input is selected - * 0b011100..TRIG_IN4 input is selected - * 0b011101..TRIG_IN5 input is selected - * 0b011110..TRIG_IN6 input is selected - * 0b011111..TRIG_IN7 input is selected - * 0b100000..TRIG_IN8 input is selected - * 0b100001..TRIG_IN9 input is selected - * 0b100010..TRIG_IN10 input is selected - * 0b100011..TRIG_IN11 input is selected - * 0b100100..GPIO0 Pin Event Trig 0 input is selected - * 0b100101..GPIO1 Pin Event Trig 0 input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO3 Pin Event Trig 0 input is selected - * *.. - */ -#define INPUTMUX_QDC0_ICAP1_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDC0_ICAP1_INP_SHIFT)) & INPUTMUX_QDC0_ICAP1_INP_MASK) -/*! @} */ - -/*! @name QDC0_ICAP2 - QDC0 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDC0_ICAP2_INP_MASK (0x3FU) -#define INPUTMUX_QDC0_ICAP2_INP_SHIFT (0U) -/*! INP - QDC0 input connections - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_POS_MATCH0 input is selected - * 0b010000..PWM0_SM0_OUT_TRIG0 input is selected - * 0b010001..PWM0_SM0_OUT_TRIG1 input is selected - * 0b010010..PWM0_SM1_OUT_TRIG0 input is selected - * 0b010011..PWM0_SM1_OUT_TRIG1 input is selected - * 0b010100..PWM0_SM2_OUT_TRIG0 input is selected - * 0b010101..PWM0_SM2_OUT_TRIG1 input is selected - * 0b010110..Reserved - * 0b010111..Reserved - * 0b011000..TRIG_IN0 input is selected - * 0b011001..TRIG_IN1 input is selected - * 0b011010..TRIG_IN2 input is selected - * 0b011011..TRIG_IN3 input is selected - * 0b011100..TRIG_IN4 input is selected - * 0b011101..TRIG_IN5 input is selected - * 0b011110..TRIG_IN6 input is selected - * 0b011111..TRIG_IN7 input is selected - * 0b100000..TRIG_IN8 input is selected - * 0b100001..TRIG_IN9 input is selected - * 0b100010..TRIG_IN10 input is selected - * 0b100011..TRIG_IN11 input is selected - * 0b100100..GPIO0 Pin Event Trig 0 input is selected - * 0b100101..GPIO1 Pin Event Trig 0 input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO3 Pin Event Trig 0 input is selected - * *.. - */ -#define INPUTMUX_QDC0_ICAP2_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDC0_ICAP2_INP_SHIFT)) & INPUTMUX_QDC0_ICAP2_INP_MASK) -/*! @} */ - -/*! @name QDC0_ICAP3 - QDC0 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDC0_ICAP3_INP_MASK (0x3FU) -#define INPUTMUX_QDC0_ICAP3_INP_SHIFT (0U) -/*! INP - QDC0 input connections - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_POS_MATCH0 input is selected - * 0b010000..PWM0_SM0_OUT_TRIG0 input is selected - * 0b010001..PWM0_SM0_OUT_TRIG1 input is selected - * 0b010010..PWM0_SM1_OUT_TRIG0 input is selected - * 0b010011..PWM0_SM1_OUT_TRIG1 input is selected - * 0b010100..PWM0_SM2_OUT_TRIG0 input is selected - * 0b010101..PWM0_SM2_OUT_TRIG1 input is selected - * 0b010110..Reserved - * 0b010111..Reserved - * 0b011000..TRIG_IN0 input is selected - * 0b011001..TRIG_IN1 input is selected - * 0b011010..TRIG_IN2 input is selected - * 0b011011..TRIG_IN3 input is selected - * 0b011100..TRIG_IN4 input is selected - * 0b011101..TRIG_IN5 input is selected - * 0b011110..TRIG_IN6 input is selected - * 0b011111..TRIG_IN7 input is selected - * 0b100000..TRIG_IN8 input is selected - * 0b100001..TRIG_IN9 input is selected - * 0b100010..TRIG_IN10 input is selected - * 0b100011..TRIG_IN11 input is selected - * 0b100100..GPIO0 Pin Event Trig 0 input is selected - * 0b100101..GPIO1 Pin Event Trig 0 input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO3 Pin Event Trig 0 input is selected - * *.. - */ -#define INPUTMUX_QDC0_ICAP3_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDC0_ICAP3_INP_SHIFT)) & INPUTMUX_QDC0_ICAP3_INP_MASK) -/*! @} */ - -/*! @name FLEXPWM0_SM0_EXTA0 - PWM0 input trigger connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM0_SM0_EXTA0_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM0_SM0_EXTA0_TRIGIN_SHIFT (0U) -/*! TRIGIN - Trigger input connections for PWM0 - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_CMP_FLAG0 input is selected - * 0b010000..QDC0_CMP_FLAG1 input is selected - * 0b010001..QDC0_CMP_FLAG2 input is selected - * 0b010010..QDC0_CMP_FLAG3 input is selected - * 0b010011..QDC0_POS_MATCH0 input is selected - * 0b010100..TRIG_IN0 input is selected - * 0b010101..TRIG_IN1 input is selected - * 0b010110..TRIG_IN2 input is selected - * 0b010111..TRIG_IN3 input is selected - * 0b011000..TRIG_IN4 input is selected - * 0b011001..TRIG_IN5 input is selected - * 0b011010..TRIG_IN6 input is selected - * 0b011011..TRIG_IN7 input is selected - * 0b011100..TRIG_IN8 input is selected - * 0b011101..TRIG_IN9 input is selected - * 0b011110..TRIG_IN10 input is selected - * 0b011111..TRIG_IN11 input is selected - * 0b100000..GPIO0 Pin Event Trig 0 input is selected - * 0b100001..GPIO1 Pin Event Trig 0 input is selected - * 0b100010..GPIO2 Pin Event Trig 0 input is selected - * 0b100011..GPIO3 Pin Event Trig 0 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM0_SM0_EXTA0_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM0_SM0_EXTA0_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM0_SM0_EXTA0_TRIGIN_MASK) -/*! @} */ - -/*! @name FLEXPWM0_SM0_EXTSYNC0 - PWM0 input trigger connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM0_SM0_EXTSYNC0_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM0_SM0_EXTSYNC0_TRIGIN_SHIFT (0U) -/*! TRIGIN - Trigger input connections for PWM0 - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_CMP_FLAG0 input is selected - * 0b010000..QDC0_CMP_FLAG1 input is selected - * 0b010001..QDC0_CMP_FLAG2 input is selected - * 0b010010..QDC0_CMP_FLAG3 input is selected - * 0b010011..QDC0_POS_MATCH0 input is selected - * 0b010100..TRIG_IN0 input is selected - * 0b010101..TRIG_IN1 input is selected - * 0b010110..TRIG_IN2 input is selected - * 0b010111..TRIG_IN3 input is selected - * 0b011000..TRIG_IN4 input is selected - * 0b011001..TRIG_IN5 input is selected - * 0b011010..TRIG_IN6 input is selected - * 0b011011..TRIG_IN7 input is selected - * 0b011100..TRIG_IN8 input is selected - * 0b011101..TRIG_IN9 input is selected - * 0b011110..TRIG_IN10 input is selected - * 0b011111..TRIG_IN11 input is selected - * 0b100000..GPIO0 Pin Event Trig 0 input is selected - * 0b100001..GPIO1 Pin Event Trig 0 input is selected - * 0b100010..GPIO2 Pin Event Trig 0 input is selected - * 0b100011..GPIO3 Pin Event Trig 0 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM0_SM0_EXTSYNC0_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM0_SM0_EXTSYNC0_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM0_SM0_EXTSYNC0_TRIGIN_MASK) -/*! @} */ - -/*! @name FLEXPWM0_SM1_EXTA1 - PWM0 input trigger connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM0_SM1_EXTA1_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM0_SM1_EXTA1_TRIGIN_SHIFT (0U) -/*! TRIGIN - Trigger input connections for PWM0 - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_CMP_FLAG0 input is selected - * 0b010000..QDC0_CMP_FLAG1 input is selected - * 0b010001..QDC0_CMP_FLAG2 input is selected - * 0b010010..QDC0_CMP_FLAG3 input is selected - * 0b010011..QDC0_POS_MATCH0 input is selected - * 0b010100..TRIG_IN0 input is selected - * 0b010101..TRIG_IN1 input is selected - * 0b010110..TRIG_IN2 input is selected - * 0b010111..TRIG_IN3 input is selected - * 0b011000..TRIG_IN4 input is selected - * 0b011001..TRIG_IN5 input is selected - * 0b011010..TRIG_IN6 input is selected - * 0b011011..TRIG_IN7 input is selected - * 0b011100..TRIG_IN8 input is selected - * 0b011101..TRIG_IN9 input is selected - * 0b011110..TRIG_IN10 input is selected - * 0b011111..TRIG_IN11 input is selected - * 0b100000..GPIO0 Pin Event Trig 0 input is selected - * 0b100001..GPIO1 Pin Event Trig 0 input is selected - * 0b100010..GPIO2 Pin Event Trig 0 input is selected - * 0b100011..GPIO3 Pin Event Trig 0 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM0_SM1_EXTA1_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM0_SM1_EXTA1_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM0_SM1_EXTA1_TRIGIN_MASK) -/*! @} */ - -/*! @name FLEXPWM0_SM1_EXTSYNC1 - PWM0 input trigger connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM0_SM1_EXTSYNC1_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM0_SM1_EXTSYNC1_TRIGIN_SHIFT (0U) -/*! TRIGIN - Trigger input connections for PWM0 - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_CMP_FLAG0 input is selected - * 0b010000..QDC0_CMP_FLAG1 input is selected - * 0b010001..QDC0_CMP_FLAG2 input is selected - * 0b010010..QDC0_CMP_FLAG3 input is selected - * 0b010011..QDC0_POS_MATCH0 input is selected - * 0b010100..TRIG_IN0 input is selected - * 0b010101..TRIG_IN1 input is selected - * 0b010110..TRIG_IN2 input is selected - * 0b010111..TRIG_IN3 input is selected - * 0b011000..TRIG_IN4 input is selected - * 0b011001..TRIG_IN5 input is selected - * 0b011010..TRIG_IN6 input is selected - * 0b011011..TRIG_IN7 input is selected - * 0b011100..TRIG_IN8 input is selected - * 0b011101..TRIG_IN9 input is selected - * 0b011110..TRIG_IN10 input is selected - * 0b011111..TRIG_IN11 input is selected - * 0b100000..GPIO0 Pin Event Trig 0 input is selected - * 0b100001..GPIO1 Pin Event Trig 0 input is selected - * 0b100010..GPIO2 Pin Event Trig 0 input is selected - * 0b100011..GPIO3 Pin Event Trig 0 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM0_SM1_EXTSYNC1_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM0_SM1_EXTSYNC1_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM0_SM1_EXTSYNC1_TRIGIN_MASK) -/*! @} */ - -/*! @name FLEXPWM0_SM2_EXTA2 - PWM0 input trigger connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM0_SM2_EXTA2_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM0_SM2_EXTA2_TRIGIN_SHIFT (0U) -/*! TRIGIN - Trigger input connections for PWM0 - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_CMP_FLAG0 input is selected - * 0b010000..QDC0_CMP_FLAG1 input is selected - * 0b010001..QDC0_CMP_FLAG2 input is selected - * 0b010010..QDC0_CMP_FLAG3 input is selected - * 0b010011..QDC0_POS_MATCH0 input is selected - * 0b010100..TRIG_IN0 input is selected - * 0b010101..TRIG_IN1 input is selected - * 0b010110..TRIG_IN2 input is selected - * 0b010111..TRIG_IN3 input is selected - * 0b011000..TRIG_IN4 input is selected - * 0b011001..TRIG_IN5 input is selected - * 0b011010..TRIG_IN6 input is selected - * 0b011011..TRIG_IN7 input is selected - * 0b011100..TRIG_IN8 input is selected - * 0b011101..TRIG_IN9 input is selected - * 0b011110..TRIG_IN10 input is selected - * 0b011111..TRIG_IN11 input is selected - * 0b100000..GPIO0 Pin Event Trig 0 input is selected - * 0b100001..GPIO1 Pin Event Trig 0 input is selected - * 0b100010..GPIO2 Pin Event Trig 0 input is selected - * 0b100011..GPIO3 Pin Event Trig 0 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM0_SM2_EXTA2_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM0_SM2_EXTA2_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM0_SM2_EXTA2_TRIGIN_MASK) -/*! @} */ - -/*! @name FLEXPWM0_SM2_EXTSYNC2 - PWM0 input trigger connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM0_SM2_EXTSYNC2_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM0_SM2_EXTSYNC2_TRIGIN_SHIFT (0U) -/*! TRIGIN - Trigger input connections for PWM0 - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_CMP_FLAG0 input is selected - * 0b010000..QDC0_CMP_FLAG1 input is selected - * 0b010001..QDC0_CMP_FLAG2 input is selected - * 0b010010..QDC0_CMP_FLAG3 input is selected - * 0b010011..QDC0_POS_MATCH0 input is selected - * 0b010100..TRIG_IN0 input is selected - * 0b010101..TRIG_IN1 input is selected - * 0b010110..TRIG_IN2 input is selected - * 0b010111..TRIG_IN3 input is selected - * 0b011000..TRIG_IN4 input is selected - * 0b011001..TRIG_IN5 input is selected - * 0b011010..TRIG_IN6 input is selected - * 0b011011..TRIG_IN7 input is selected - * 0b011100..TRIG_IN8 input is selected - * 0b011101..TRIG_IN9 input is selected - * 0b011110..TRIG_IN10 input is selected - * 0b011111..TRIG_IN11 input is selected - * 0b100000..GPIO0 Pin Event Trig 0 input is selected - * 0b100001..GPIO1 Pin Event Trig 0 input is selected - * 0b100010..GPIO2 Pin Event Trig 0 input is selected - * 0b100011..GPIO3 Pin Event Trig 0 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM0_SM2_EXTSYNC2_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM0_SM2_EXTSYNC2_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM0_SM2_EXTSYNC2_TRIGIN_MASK) -/*! @} */ - -/*! @name FLEXPWM0_FAULT0 - PWM0 input trigger connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM0_FAULT0_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM0_FAULT0_TRIGIN_SHIFT (0U) -/*! TRIGIN - Trigger input connections for PWM0 - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_CMP_FLAG0 input is selected - * 0b010000..QDC0_CMP_FLAG1 input is selected - * 0b010001..QDC0_CMP_FLAG2 input is selected - * 0b010010..QDC0_CMP_FLAG3 input is selected - * 0b010011..QDC0_POS_MATCH0 input is selected - * 0b010100..TRIG_IN0 input is selected - * 0b010101..TRIG_IN1 input is selected - * 0b010110..TRIG_IN2 input is selected - * 0b010111..TRIG_IN3 input is selected - * 0b011000..TRIG_IN4 input is selected - * 0b011001..TRIG_IN5 input is selected - * 0b011010..TRIG_IN6 input is selected - * 0b011011..TRIG_IN7 input is selected - * 0b011100..TRIG_IN8 input is selected - * 0b011101..TRIG_IN9 input is selected - * 0b011110..TRIG_IN10 input is selected - * 0b011111..TRIG_IN11 input is selected - * 0b100000..GPIO0 Pin Event Trig 0 input is selected - * 0b100001..GPIO1 Pin Event Trig 0 input is selected - * 0b100010..GPIO2 Pin Event Trig 0 input is selected - * 0b100011..GPIO3 Pin Event Trig 0 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM0_FAULT0_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM0_FAULT0_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM0_FAULT0_TRIGIN_MASK) -/*! @} */ - -/*! @name FLEXPWM0_FAULT1 - PWM0 input trigger connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM0_FAULT1_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM0_FAULT1_TRIGIN_SHIFT (0U) -/*! TRIGIN - Trigger input connections for PWM0 - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_CMP_FLAG0 input is selected - * 0b010000..QDC0_CMP_FLAG1 input is selected - * 0b010001..QDC0_CMP_FLAG2 input is selected - * 0b010010..QDC0_CMP_FLAG3 input is selected - * 0b010011..QDC0_POS_MATCH0 input is selected - * 0b010100..TRIG_IN0 input is selected - * 0b010101..TRIG_IN1 input is selected - * 0b010110..TRIG_IN2 input is selected - * 0b010111..TRIG_IN3 input is selected - * 0b011000..TRIG_IN4 input is selected - * 0b011001..TRIG_IN5 input is selected - * 0b011010..TRIG_IN6 input is selected - * 0b011011..TRIG_IN7 input is selected - * 0b011100..TRIG_IN8 input is selected - * 0b011101..TRIG_IN9 input is selected - * 0b011110..TRIG_IN10 input is selected - * 0b011111..TRIG_IN11 input is selected - * 0b100000..GPIO0 Pin Event Trig 0 input is selected - * 0b100001..GPIO1 Pin Event Trig 0 input is selected - * 0b100010..GPIO2 Pin Event Trig 0 input is selected - * 0b100011..GPIO3 Pin Event Trig 0 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM0_FAULT1_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM0_FAULT1_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM0_FAULT1_TRIGIN_MASK) -/*! @} */ - -/*! @name FLEXPWM0_FAULT2 - PWM0 input trigger connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM0_FAULT2_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM0_FAULT2_TRIGIN_SHIFT (0U) -/*! TRIGIN - Trigger input connections for PWM0 - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_CMP_FLAG0 input is selected - * 0b010000..QDC0_CMP_FLAG1 input is selected - * 0b010001..QDC0_CMP_FLAG2 input is selected - * 0b010010..QDC0_CMP_FLAG3 input is selected - * 0b010011..QDC0_POS_MATCH0 input is selected - * 0b010100..TRIG_IN0 input is selected - * 0b010101..TRIG_IN1 input is selected - * 0b010110..TRIG_IN2 input is selected - * 0b010111..TRIG_IN3 input is selected - * 0b011000..TRIG_IN4 input is selected - * 0b011001..TRIG_IN5 input is selected - * 0b011010..TRIG_IN6 input is selected - * 0b011011..TRIG_IN7 input is selected - * 0b011100..TRIG_IN8 input is selected - * 0b011101..TRIG_IN9 input is selected - * 0b011110..TRIG_IN10 input is selected - * 0b011111..TRIG_IN11 input is selected - * 0b100000..GPIO0 Pin Event Trig 0 input is selected - * 0b100001..GPIO1 Pin Event Trig 0 input is selected - * 0b100010..GPIO2 Pin Event Trig 0 input is selected - * 0b100011..GPIO3 Pin Event Trig 0 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM0_FAULT2_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM0_FAULT2_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM0_FAULT2_TRIGIN_MASK) -/*! @} */ - -/*! @name FLEXPWM0_FAULT3 - PWM0 input trigger connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM0_FAULT3_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM0_FAULT3_TRIGIN_SHIFT (0U) -/*! TRIGIN - Trigger input connections for PWM0 - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_CMP_FLAG0 input is selected - * 0b010000..QDC0_CMP_FLAG1 input is selected - * 0b010001..QDC0_CMP_FLAG2 input is selected - * 0b010010..QDC0_CMP_FLAG3 input is selected - * 0b010011..QDC0_POS_MATCH0 input is selected - * 0b010100..TRIG_IN0 input is selected - * 0b010101..TRIG_IN1 input is selected - * 0b010110..TRIG_IN2 input is selected - * 0b010111..TRIG_IN3 input is selected - * 0b011000..TRIG_IN4 input is selected - * 0b011001..TRIG_IN5 input is selected - * 0b011010..TRIG_IN6 input is selected - * 0b011011..TRIG_IN7 input is selected - * 0b011100..TRIG_IN8 input is selected - * 0b011101..TRIG_IN9 input is selected - * 0b011110..TRIG_IN10 input is selected - * 0b011111..TRIG_IN11 input is selected - * 0b100000..GPIO0 Pin Event Trig 0 input is selected - * 0b100001..GPIO1 Pin Event Trig 0 input is selected - * 0b100010..GPIO2 Pin Event Trig 0 input is selected - * 0b100011..GPIO3 Pin Event Trig 0 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM0_FAULT3_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM0_FAULT3_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM0_FAULT3_TRIGIN_MASK) -/*! @} */ - -/*! @name FLEXPWM0_FORCE - PWM0 input trigger connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM0_FORCE_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM0_FORCE_TRIGIN_SHIFT (0U) -/*! TRIGIN - Trigger input connections for PWM0 - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_CMP_FLAG0 input is selected - * 0b010000..QDC0_CMP_FLAG1 input is selected - * 0b010001..QDC0_CMP_FLAG2 input is selected - * 0b010010..QDC0_CMP_FLAG3 input is selected - * 0b010011..QDC0_POS_MATCH0 input is selected - * 0b010100..TRIG_IN0 input is selected - * 0b010101..TRIG_IN1 input is selected - * 0b010110..TRIG_IN2 input is selected - * 0b010111..TRIG_IN3 input is selected - * 0b011000..TRIG_IN4 input is selected - * 0b011001..TRIG_IN5 input is selected - * 0b011010..TRIG_IN6 input is selected - * 0b011011..TRIG_IN7 input is selected - * 0b011100..TRIG_IN8 input is selected - * 0b011101..TRIG_IN9 input is selected - * 0b011110..TRIG_IN10 input is selected - * 0b011111..TRIG_IN11 input is selected - * 0b100000..GPIO0 Pin Event Trig 0 input is selected - * 0b100001..GPIO1 Pin Event Trig 0 input is selected - * 0b100010..GPIO2 Pin Event Trig 0 input is selected - * 0b100011..GPIO3 Pin Event Trig 0 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM0_FORCE_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM0_FORCE_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM0_FORCE_TRIGIN_MASK) -/*! @} */ - -/*! @name PWM0_EXT_CLK - PWM0 external clock trigger */ -/*! @{ */ - -#define INPUTMUX_PWM0_EXT_CLK_TRIGIN_MASK (0x7U) -#define INPUTMUX_PWM0_EXT_CLK_TRIGIN_SHIFT (0U) -/*! TRIGIN - Trigger input connections for PWM - * 0b000..Reserved - * 0b001..clk_16k[1] input is selected - * 0b010..clk_in input is selected - * 0b011..AOI0_OUT0 input is selected - * 0b100..AOI0_OUT1 input is selected - * 0b101..EXTTRIG_IN0 input is selected - * 0b110..EXTTRIG_IN7 input is selected - * *.. - */ -#define INPUTMUX_PWM0_EXT_CLK_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_PWM0_EXT_CLK_TRIGIN_SHIFT)) & INPUTMUX_PWM0_EXT_CLK_TRIGIN_MASK) -/*! @} */ - -/*! @name AOI0_MUXA_AOI0_MUX - AOI0 trigger input connections 0-15 */ -/*! @{ */ - -#define INPUTMUX_AOI0_MUXA_AOI0_MUX_INP_MASK (0x3FU) -#define INPUTMUX_AOI0_MUXA_AOI0_MUX_INP_SHIFT (0U) -/*! INP - AOI0 trigger input connections - * 0b000000..Reserved - * 0b000001..ADC0_tcomp[0] input is selected input is selected input is selected - * 0b000010..ADC0_tcomp[1] input is selected input is selected - * 0b000011..ADC0_tcomp[2] input is selected input is selected - * 0b000100..ADC0_tcomp[3] input is selected input is selected - * 0b000101..CMP0_OUT input is selected - * 0b000110..CMP1_OUT input is selected - * 0b000111..Reserved - * 0b001000..CTimer0_MAT0 input is selected - * 0b001001..CTimer0_MAT1 input is selected - * 0b001010..CTimer0_MAT2 input is selected - * 0b001011..CTimer0_MAT3 input is selected - * 0b001100..CTimer1_MAT0 input is selected - * 0b001101..CTimer1_MAT1 input is selected - * 0b001110..CTimer1_MAT2 input is selected - * 0b001111..CTimer1_MAT3 input is selected - * 0b010000..CTimer2_MAT0 input is selected - * 0b010001..CTimer2_MAT1 input is selected - * 0b010010..CTimer2_MAT2 input is selected - * 0b010011..CTimer2_MAT3 input is selected - * 0b010100..LPTMR0 input is selected - * 0b010101..Reserved - * 0b010110..QDC0_CMP_FLAG0 input input is selected - * 0b010111..QDC0_CMP_FLAG1 input is selected - * 0b011000..QDC0_CMP_FLAG2 input is selected - * 0b011001..QDC0_CMP_FLAG3 input is selected - * 0b011010..QDC0_POS_MATCH input is selected - * 0b011011..PWM0_SM0_OUT_TRIG0 0 input is selected - * 0b011100..PWM0_SM0_OUT_TRIG1 input is selected - * 0b011101..PWM0_SM1_OUT_TRIG0 input is selected - * 0b011110..PWM0_SM1_OUT_TRIG1 input is selected - * 0b011111..PWM0_SM2_OUT_TRIG0 input is selected - * 0b100000..PWM0_SM2_OUT_TRIG1 input is selected - * 0b100001..Reserved - * 0b100010..Reserved - * 0b100011..TRIG_IN0 input is selected - * 0b100100..TRIG_IN1 input is selected - * 0b100101..TRIG_IN2 input is selected - * 0b100110..TRIG_IN3 input is selected - * 0b100111..TRIG_IN4 input is selected - * 0b101000..TRIG_IN5 input is selected - * 0b101001..TRIG_IN6 input is selected - * 0b101010..TRIG_IN7 input is selected - * 0b101011..TRIG_IN8 input is selected - * 0b101100..TRIG_IN9 input is selected - * 0b101101..TRIG_IN10 input is selected - * 0b101110..TRIG_IN11 input is selected - * 0b101111..GPIO0 Pin Event Trig 0 input is selected - * 0b110000..GPIO1 Pin Event Trig 0 input is selected - * 0b110001..GPIO2 Pin Event Trig 0 input is selected - * 0b110010..GPIO3 Pin Event Trig 0 input is selected - * *.. - */ -#define INPUTMUX_AOI0_MUXA_AOI0_MUX_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_AOI0_MUXA_AOI0_MUX_INP_SHIFT)) & INPUTMUX_AOI0_MUXA_AOI0_MUX_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_AOI0_MUXA_AOI0_MUX */ -#define INPUTMUX_AOI0_MUXA_AOI0_MUX_COUNT (16U) - -/*! @name USBFS_TRIG - USB-FS trigger input connections */ -/*! @{ */ - -#define INPUTMUX_USBFS_TRIG_INP_MASK (0x7U) -#define INPUTMUX_USBFS_TRIG_INP_SHIFT (0U) -/*! INP - USB-FS trigger input connections. - * 0b000..Reserved - * 0b001..LPUART0 lpuart_trg_txdata input is selected - * 0b010..LPUART1 lpuart_trg_txdata input is selected - * 0b011..LPUART2 lpuart_trg_txdata input is selected - * *.. - */ -#define INPUTMUX_USBFS_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_USBFS_TRIG_INP_SHIFT)) & INPUTMUX_USBFS_TRIG_INP_MASK) -/*! @} */ - -/*! @name EXT_TRIGA_EXT_TRIG - EXT trigger connections 0-4 */ -/*! @{ */ - -#define INPUTMUX_EXT_TRIGA_EXT_TRIG_INP_MASK (0x1FU) -#define INPUTMUX_EXT_TRIGA_EXT_TRIG_INP_SHIFT (0U) -/*! INP - EXT trigger input connections - * 0b00000..Reserved - * 0b00001..ARM_TXEV input is selected - * 0b00010..AOI0_OUT0 input is selected - * 0b00011..AOI0_OUT1 input is selected - * 0b00100..AOI0_OUT2 input is selected - * 0b00101..AOI0_OUT3 input is selected - * 0b00110..CMP0_OUT input is selected - * 0b00111..CMP1_OUT input is selected - * 0b01000..Reserved - * 0b01001..LPUART0 input is selected - * 0b01010..LPUART1 input is selected - * 0b01011..LPUART2 input is selected - * *.. - */ -#define INPUTMUX_EXT_TRIGA_EXT_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_EXT_TRIGA_EXT_TRIG_INP_SHIFT)) & INPUTMUX_EXT_TRIGA_EXT_TRIG_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_EXT_TRIGA_EXT_TRIG */ -#define INPUTMUX_EXT_TRIGA_EXT_TRIG_COUNT (5U) - -/*! @name EXT_TRIGB_EXT_TRIG6 - EXT trigger connections 6-7 */ -/*! @{ */ - -#define INPUTMUX_EXT_TRIGB_EXT_TRIG6_INP_MASK (0x1FU) -#define INPUTMUX_EXT_TRIGB_EXT_TRIG6_INP_SHIFT (0U) -/*! INP - EXT trigger input connections - * 0b00000..Reserved - * 0b00001..ARM_TXEV input is selected - * 0b00010..AOI0_OUT0 input is selected - * 0b00011..AOI0_OUT1 input is selected - * 0b00100..AOI0_OUT2 input is selected - * 0b00101..AOI0_OUT3 input is selected - * 0b00110..CMP0_OUT input is selected - * 0b00111..CMP1_OUT input is selected - * 0b01000..Reserved - * 0b01001..LPUART0 input is selected - * 0b01010..LPUART1 input is selected - * 0b01011..LPUART2 input is selected - * *.. - */ -#define INPUTMUX_EXT_TRIGB_EXT_TRIG6_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_EXT_TRIGB_EXT_TRIG6_INP_SHIFT)) & INPUTMUX_EXT_TRIGB_EXT_TRIG6_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_EXT_TRIGB_EXT_TRIG6 */ -#define INPUTMUX_EXT_TRIGB_EXT_TRIG6_COUNT (2U) - -/*! @name CMP1_TRIG - CMP1 input connections */ -/*! @{ */ - -#define INPUTMUX_CMP1_TRIG_TRIGIN_MASK (0x3FU) -#define INPUTMUX_CMP1_TRIG_TRIGIN_SHIFT (0U) -/*! TRIGIN - CMP0 input trigger - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..Reserved - * 0b001000..CTimer0_MAT0 input is selected - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer1_MAT0 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer2_MAT0 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..LPTMR0 input is selected - * 0b001111..Reserved - * 0b010000..QDC0_CMP/POS_MATCH0 - * 0b010001..PWM0_SM0_OUT_TRIG0 input is selected - * 0b010010..PWM0_SM0_OUT_TRIG1 input is selected - * 0b010011..PWM0_SM1_OUT_TRIG0 input is selected - * 0b010100..PWM0_SM1_OUT_TRIG1 input is selected - * 0b010101..PWM0_SM2_OUT_TRIG0 input is selected - * 0b010110..PWM0_SM2_OUT_TRIG1 input is selected - * 0b010111..Reserved - * 0b011000..Reserved - * 0b011001..GPIO0 Pin Event Trig 0 input is selected - * 0b011010..GPIO1 Pin Event Trig 0 input is selected - * 0b011011..GPIO2 Pin Event Trig 0 input is selected - * 0b011100..GPIO3 Pin Event Trig 0 input is selected - * 0b011101..Reserved - * 0b011110..WUU input is selected - * *.. - */ -#define INPUTMUX_CMP1_TRIG_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CMP1_TRIG_TRIGIN_SHIFT)) & INPUTMUX_CMP1_TRIG_TRIGIN_MASK) -/*! @} */ - -/*! @name LPI2C0_TRIG - LPI2C0 trigger input connections */ -/*! @{ */ - -#define INPUTMUX_LPI2C0_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_LPI2C0_TRIG_INP_SHIFT (0U) -/*! INP - LPI2C0 trigger input connections - * 0b000000..Reserved - * 0b000001..ARM_TXEV - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT0 input is selected - * 0b001010..CTimer0_MAT1 input is selected - * 0b001011..CTimer1_MAT0 input is selected - * 0b001100..CTimer1_MAT1 input is selected - * 0b001101..CTimer2_MAT0 input is selected - * 0b001110..CTimer2_MAT1 input is selected - * 0b001111..LPTMR0 input is selected - * 0b010000..Reserved - * 0b010001..TRIG_IN0 input is selected - * 0b010010..TRIG_IN1 input is selected - * 0b010011..TRIG_IN2 input is selected - * 0b010100..TRIG_IN3 input is selected - * 0b010101..TRIG_IN4 input is selected - * 0b010110..TRIG_IN5 input is selected - * 0b010111..TRIG_IN6 input is selected - * 0b011000..TRIG_IN7 input is selected - * 0b011001..GPIO0 Pin Event Trig 0 input is selected - * 0b011010..GPIO1 Pin Event Trig 0 input is selected - * 0b011011..GPIO2 Pin Event Trig 0 input is selected - * 0b011100..GPIO3 Pin Event Trig 0 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_LPI2C0_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_LPI2C0_TRIG_INP_SHIFT)) & INPUTMUX_LPI2C0_TRIG_INP_MASK) -/*! @} */ - -/*! @name LPSPI0_TRIG - LPSPI0 trigger input connections */ -/*! @{ */ - -#define INPUTMUX_LPSPI0_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_LPSPI0_TRIG_INP_SHIFT (0U) -/*! INP - LPSPI0 trigger input connections - * 0b000000..Reserved - * 0b000001..ARM_TXEV - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT1 input is selected - * 0b001010..CTimer0_MAT2 input is selected - * 0b001011..CTimer1_MAT1 input is selected - * 0b001100..CTimer1_MAT2 input is selected - * 0b001101..CTimer2_MAT1 input is selected - * 0b001110..CTimer2_MAT2 input is selected - * 0b001111..LPTMR0 input is selected - * 0b010000..Reserved - * 0b010001..TRIG_IN0 input is selected - * 0b010010..TRIG_IN1 input is selected - * 0b010011..TRIG_IN2 input is selected - * 0b010100..TRIG_IN3 input is selected - * 0b010101..TRIG_IN4 input is selected - * 0b010110..TRIG_IN5 input is selected - * 0b010111..TRIG_IN6 input is selected - * 0b011000..TRIG_IN7 input is selected - * 0b011001..GPIO0 Pin Event Trig 0 input is selected - * 0b011010..GPIO1 Pin Event Trig 0 input is selected - * 0b011011..GPIO2 Pin Event Trig 0 input is selected - * 0b011100..GPIO3 Pin Event Trig 0 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_LPSPI0_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_LPSPI0_TRIG_INP_SHIFT)) & INPUTMUX_LPSPI0_TRIG_INP_MASK) -/*! @} */ - -/*! @name LPSPI1_TRIG - LPSPI1 trigger input connections */ -/*! @{ */ - -#define INPUTMUX_LPSPI1_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_LPSPI1_TRIG_INP_SHIFT (0U) -/*! INP - LPSPI1 trigger input connections - * 0b000000..Reserved - * 0b000001..ARM_TXEV - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT1 input is selected - * 0b001010..CTimer0_MAT2 input is selected - * 0b001011..CTimer1_MAT1 input is selected - * 0b001100..CTimer1_MAT2 input is selected - * 0b001101..CTimer2_MAT1 input is selected - * 0b001110..CTimer2_MAT2 input is selected - * 0b001111..LPTMR0 input is selected - * 0b010000..Reserved - * 0b010001..TRIG_IN0 input is selected - * 0b010010..TRIG_IN1 input is selected - * 0b010011..TRIG_IN2 input is selected - * 0b010100..TRIG_IN3 input is selected - * 0b010101..TRIG_IN4 input is selected - * 0b010110..TRIG_IN5 input is selected - * 0b010111..TRIG_IN6 input is selected - * 0b011000..TRIG_IN7 input is selected - * 0b011001..GPIO0 Pin Event Trig 0 input is selected - * 0b011010..GPIO1 Pin Event Trig 0 input is selected - * 0b011011..GPIO2 Pin Event Trig 0 input is selected - * 0b011100..GPIO3 Pin Event Trig 0 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_LPSPI1_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_LPSPI1_TRIG_INP_SHIFT)) & INPUTMUX_LPSPI1_TRIG_INP_MASK) -/*! @} */ - -/*! @name LPUART0 - LPUART0 trigger input connections */ -/*! @{ */ - -#define INPUTMUX_LPUART0_INP_MASK (0x3FU) -#define INPUTMUX_LPUART0_INP_SHIFT (0U) -/*! INP - LPUART0 trigger input connections - * 0b000000..Reserved - * 0b000001..ARM_TXEV - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..LPTMR0 input is selected - * 0b010000..Reserved - * 0b010001..TRIG_IN0 input is selected - * 0b010010..TRIG_IN1 input is selected - * 0b010011..TRIG_IN2 input is selected - * 0b010100..TRIG_IN3 input is selected - * 0b010101..TRIG_IN4 input is selected - * 0b010110..TRIG_IN5 input is selected - * 0b010111..TRIG_IN6 input is selected - * 0b011000..TRIG_IN7 input is selected - * 0b011001..TRIG_IN8 input is selected - * 0b011010..TRIG_IN9 input is selected - * 0b011011..TRIG_IN10 input is selected - * 0b011100..TRIG_IN11 input is selected - * 0b011101..GPIO0 Pin Event Trig 0 input is selected - * 0b011110..GPIO0 Pin Event Trig 0 input is selected - * 0b011111..GPIO0 Pin Event Trig 0 input is selected - * 0b100000..GPIO0 Pin Event Trig 0 input is selected - * 0b100001..Reserved - * 0b100010..WUU input is selected - * 0b100011..USB0 ipp_ind_uart_rxd_usbmux input is selected - * *.. - */ -#define INPUTMUX_LPUART0_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_LPUART0_INP_SHIFT)) & INPUTMUX_LPUART0_INP_MASK) -/*! @} */ - -/*! @name LPUART1 - LPUART1 trigger input connections */ -/*! @{ */ - -#define INPUTMUX_LPUART1_INP_MASK (0x3FU) -#define INPUTMUX_LPUART1_INP_SHIFT (0U) -/*! INP - LPUART1 trigger input connections - * 0b000000..Reserved - * 0b000001..ARM_TXEV - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..LPTMR0 input is selected - * 0b010000..Reserved - * 0b010001..TRIG_IN0 input is selected - * 0b010010..TRIG_IN1 input is selected - * 0b010011..TRIG_IN2 input is selected - * 0b010100..TRIG_IN3 input is selected - * 0b010101..TRIG_IN4 input is selected - * 0b010110..TRIG_IN5 input is selected - * 0b010111..TRIG_IN6 input is selected - * 0b011000..TRIG_IN7 input is selected - * 0b011001..TRIG_IN8 input is selected - * 0b011010..TRIG_IN9 input is selected - * 0b011011..TRIG_IN10 input is selected - * 0b011100..TRIG_IN11 input is selected - * 0b011101..GPIO0 Pin Event Trig 0 input is selected - * 0b011110..GPIO0 Pin Event Trig 0 input is selected - * 0b011111..GPIO0 Pin Event Trig 0 input is selected - * 0b100000..GPIO0 Pin Event Trig 0 input is selected - * 0b100001..Reserved - * 0b100010..WUU input is selected - * 0b100011..USB0 ipp_ind_uart_rxd_usbmux input is selected - * *.. - */ -#define INPUTMUX_LPUART1_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_LPUART1_INP_SHIFT)) & INPUTMUX_LPUART1_INP_MASK) -/*! @} */ - -/*! @name LPUART2 - LPUART2 trigger input connections */ -/*! @{ */ - -#define INPUTMUX_LPUART2_INP_MASK (0x3FU) -#define INPUTMUX_LPUART2_INP_SHIFT (0U) -/*! INP - LPUART2 trigger input connections - * 0b000000..Reserved - * 0b000001..ARM_TXEV - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..LPTMR0 input is selected - * 0b010000..Reserved - * 0b010001..TRIG_IN0 input is selected - * 0b010010..TRIG_IN1 input is selected - * 0b010011..TRIG_IN2 input is selected - * 0b010100..TRIG_IN3 input is selected - * 0b010101..TRIG_IN4 input is selected - * 0b010110..TRIG_IN5 input is selected - * 0b010111..TRIG_IN6 input is selected - * 0b011000..TRIG_IN7 input is selected - * 0b011001..TRIG_IN8 input is selected - * 0b011010..TRIG_IN9 input is selected - * 0b011011..TRIG_IN10 input is selected - * 0b011100..TRIG_IN11 input is selected - * 0b011101..GPIO0 Pin Event Trig 0 input is selected - * 0b011110..GPIO0 Pin Event Trig 0 input is selected - * 0b011111..GPIO0 Pin Event Trig 0 input is selected - * 0b100000..GPIO0 Pin Event Trig 0 input is selected - * 0b100001..Reserved - * 0b100010..WUU input is selected - * 0b100011..USB0 ipp_ind_uart_rxd_usbmux input is selected - * *.. - */ -#define INPUTMUX_LPUART2_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_LPUART2_INP_SHIFT)) & INPUTMUX_LPUART2_INP_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group INPUTMUX_Register_Masks */ - - -/* INPUTMUX - Peripheral instance base addresses */ -/** Peripheral INPUTMUX0 base address */ -#define INPUTMUX0_BASE (0x40001000u) -/** Peripheral INPUTMUX0 base pointer */ -#define INPUTMUX0 ((INPUTMUX_Type *)INPUTMUX0_BASE) -/** Array initializer of INPUTMUX peripheral base addresses */ -#define INPUTMUX_BASE_ADDRS { INPUTMUX0_BASE } -/** Array initializer of INPUTMUX peripheral base pointers */ -#define INPUTMUX_BASE_PTRS { INPUTMUX0 } - -/*! - * @} - */ /* end of group INPUTMUX_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LPCMP Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPCMP_Peripheral_Access_Layer LPCMP Peripheral Access Layer - * @{ - */ - -/** LPCMP - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - __IO uint32_t CCR0; /**< Comparator Control Register 0, offset: 0x8 */ - __IO uint32_t CCR1; /**< Comparator Control Register 1, offset: 0xC */ - __IO uint32_t CCR2; /**< Comparator Control Register 2, offset: 0x10 */ - uint8_t RESERVED_0[4]; - __IO uint32_t DCR; /**< DAC Control, offset: 0x18 */ - __IO uint32_t IER; /**< Interrupt Enable, offset: 0x1C */ - __IO uint32_t CSR; /**< Comparator Status, offset: 0x20 */ - __IO uint32_t RRCR0; /**< Round Robin Control Register 0, offset: 0x24 */ - __IO uint32_t RRCR1; /**< Round Robin Control Register 1, offset: 0x28 */ - __IO uint32_t RRCSR; /**< Round Robin Control and Status, offset: 0x2C */ - __IO uint32_t RRSR; /**< Round Robin Status, offset: 0x30 */ - uint8_t RESERVED_1[4]; - __IO uint32_t RRCR2; /**< Round Robin Control Register 2, offset: 0x38 */ -} LPCMP_Type; - -/* ---------------------------------------------------------------------------- - -- LPCMP Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPCMP_Register_Masks LPCMP Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define LPCMP_VERID_FEATURE_MASK (0xFFFFU) -#define LPCMP_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000001..Round robin feature - */ -#define LPCMP_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_VERID_FEATURE_SHIFT)) & LPCMP_VERID_FEATURE_MASK) - -#define LPCMP_VERID_MINOR_MASK (0xFF0000U) -#define LPCMP_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define LPCMP_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_VERID_MINOR_SHIFT)) & LPCMP_VERID_MINOR_MASK) - -#define LPCMP_VERID_MAJOR_MASK (0xFF000000U) -#define LPCMP_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define LPCMP_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_VERID_MAJOR_SHIFT)) & LPCMP_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define LPCMP_PARAM_DAC_RES_MASK (0xFU) -#define LPCMP_PARAM_DAC_RES_SHIFT (0U) -/*! DAC_RES - DAC Resolution - * 0b0000..4-bit DAC - * 0b0001..6-bit DAC - * 0b0010..8-bit DAC - * 0b0011..10-bit DAC - * 0b0100..12-bit DAC - * 0b0101..14-bit DAC - * 0b0110..16-bit DAC - */ -#define LPCMP_PARAM_DAC_RES(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_PARAM_DAC_RES_SHIFT)) & LPCMP_PARAM_DAC_RES_MASK) -/*! @} */ - -/*! @name CCR0 - Comparator Control Register 0 */ -/*! @{ */ - -#define LPCMP_CCR0_CMP_EN_MASK (0x1U) -#define LPCMP_CCR0_CMP_EN_SHIFT (0U) -/*! CMP_EN - Comparator Enable - * 0b0..Disables (The analog logic remains off and consumes no power.) - * 0b1..Enables - */ -#define LPCMP_CCR0_CMP_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR0_CMP_EN_SHIFT)) & LPCMP_CCR0_CMP_EN_MASK) - -#define LPCMP_CCR0_CMP_STOP_EN_MASK (0x2U) -#define LPCMP_CCR0_CMP_STOP_EN_SHIFT (1U) -/*! CMP_STOP_EN - Comparator Deep sleep Mode Enable - * 0b0..Disable the analog comparator regardless of CMP_EN. - * 0b1..Allows CMP_EN to enable the analog comparator. - */ -#define LPCMP_CCR0_CMP_STOP_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR0_CMP_STOP_EN_SHIFT)) & LPCMP_CCR0_CMP_STOP_EN_MASK) -/*! @} */ - -/*! @name CCR1 - Comparator Control Register 1 */ -/*! @{ */ - -#define LPCMP_CCR1_WINDOW_EN_MASK (0x1U) -#define LPCMP_CCR1_WINDOW_EN_SHIFT (0U) -/*! WINDOW_EN - Windowing Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPCMP_CCR1_WINDOW_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_WINDOW_EN_SHIFT)) & LPCMP_CCR1_WINDOW_EN_MASK) - -#define LPCMP_CCR1_SAMPLE_EN_MASK (0x2U) -#define LPCMP_CCR1_SAMPLE_EN_SHIFT (1U) -/*! SAMPLE_EN - Sampling Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPCMP_CCR1_SAMPLE_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_SAMPLE_EN_SHIFT)) & LPCMP_CCR1_SAMPLE_EN_MASK) - -#define LPCMP_CCR1_DMA_EN_MASK (0x4U) -#define LPCMP_CCR1_DMA_EN_SHIFT (2U) -/*! DMA_EN - DMA Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPCMP_CCR1_DMA_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_DMA_EN_SHIFT)) & LPCMP_CCR1_DMA_EN_MASK) - -#define LPCMP_CCR1_COUT_INV_MASK (0x8U) -#define LPCMP_CCR1_COUT_INV_SHIFT (3U) -/*! COUT_INV - Comparator Invert - * 0b0..Do not invert - * 0b1..Invert - */ -#define LPCMP_CCR1_COUT_INV(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_COUT_INV_SHIFT)) & LPCMP_CCR1_COUT_INV_MASK) - -#define LPCMP_CCR1_COUT_SEL_MASK (0x10U) -#define LPCMP_CCR1_COUT_SEL_SHIFT (4U) -/*! COUT_SEL - Comparator Output Select - * 0b0..Use COUT (filtered) - * 0b1..Use COUTA (unfiltered) - */ -#define LPCMP_CCR1_COUT_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_COUT_SEL_SHIFT)) & LPCMP_CCR1_COUT_SEL_MASK) - -#define LPCMP_CCR1_COUT_PEN_MASK (0x20U) -#define LPCMP_CCR1_COUT_PEN_SHIFT (5U) -/*! COUT_PEN - Comparator Output Pin Enable - * 0b0..Not available - * 0b1..Available - */ -#define LPCMP_CCR1_COUT_PEN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_COUT_PEN_SHIFT)) & LPCMP_CCR1_COUT_PEN_MASK) - -#define LPCMP_CCR1_COUTA_OWEN_MASK (0x40U) -#define LPCMP_CCR1_COUTA_OWEN_SHIFT (6U) -/*! COUTA_OWEN - COUTA_OW Enable - * 0b0..COUTA holds the last sampled value. - * 0b1..Enables the COUTA signal value to be defined by COUTA_OW. - */ -#define LPCMP_CCR1_COUTA_OWEN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_COUTA_OWEN_SHIFT)) & LPCMP_CCR1_COUTA_OWEN_MASK) - -#define LPCMP_CCR1_COUTA_OW_MASK (0x80U) -#define LPCMP_CCR1_COUTA_OW_SHIFT (7U) -/*! COUTA_OW - COUTA Output Level for Closed Window - * 0b0..COUTA is 0 - * 0b1..COUTA is 1 - */ -#define LPCMP_CCR1_COUTA_OW(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_COUTA_OW_SHIFT)) & LPCMP_CCR1_COUTA_OW_MASK) - -#define LPCMP_CCR1_WINDOW_INV_MASK (0x100U) -#define LPCMP_CCR1_WINDOW_INV_SHIFT (8U) -/*! WINDOW_INV - WINDOW/SAMPLE Signal Invert - * 0b0..Do not invert - * 0b1..Invert - */ -#define LPCMP_CCR1_WINDOW_INV(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_WINDOW_INV_SHIFT)) & LPCMP_CCR1_WINDOW_INV_MASK) - -#define LPCMP_CCR1_WINDOW_CLS_MASK (0x200U) -#define LPCMP_CCR1_WINDOW_CLS_SHIFT (9U) -/*! WINDOW_CLS - COUT Event Window Close - * 0b0..COUT event cannot close the window - * 0b1..COUT event can close the window - */ -#define LPCMP_CCR1_WINDOW_CLS(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_WINDOW_CLS_SHIFT)) & LPCMP_CCR1_WINDOW_CLS_MASK) - -#define LPCMP_CCR1_EVT_SEL_MASK (0xC00U) -#define LPCMP_CCR1_EVT_SEL_SHIFT (10U) -/*! EVT_SEL - COUT Event Select - * 0b00..Rising edge - * 0b01..Falling edge - * 0b1x..Both edges - */ -#define LPCMP_CCR1_EVT_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_EVT_SEL_SHIFT)) & LPCMP_CCR1_EVT_SEL_MASK) - -#define LPCMP_CCR1_FUNC_CLK_SEL_MASK (0x3000U) -#define LPCMP_CCR1_FUNC_CLK_SEL_SHIFT (12U) -/*! FUNC_CLK_SEL - Functional Clock Source Select - * 0b00..Select functional clock source 0 - * 0b01..Select functional clock source 1 - * 0b10..Select functional clock source 2 - * 0b11..Select functional clock source 3 - */ -#define LPCMP_CCR1_FUNC_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_FUNC_CLK_SEL_SHIFT)) & LPCMP_CCR1_FUNC_CLK_SEL_MASK) - -#define LPCMP_CCR1_FILT_CNT_MASK (0x70000U) -#define LPCMP_CCR1_FILT_CNT_SHIFT (16U) -/*! FILT_CNT - Filter Sample Count - * 0b000..Filter is bypassed: COUT = COUTA - * 0b001..1 consecutive sample (Comparator output is simply sampled.) - * 0b010..2 consecutive samples - * 0b011..3 consecutive samples - * 0b100..4 consecutive samples - * 0b101..5 consecutive samples - * 0b110..6 consecutive samples - * 0b111..7 consecutive samples - */ -#define LPCMP_CCR1_FILT_CNT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_FILT_CNT_SHIFT)) & LPCMP_CCR1_FILT_CNT_MASK) - -#define LPCMP_CCR1_FILT_PER_MASK (0xFF000000U) -#define LPCMP_CCR1_FILT_PER_SHIFT (24U) -/*! FILT_PER - Filter Sample Period */ -#define LPCMP_CCR1_FILT_PER(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_FILT_PER_SHIFT)) & LPCMP_CCR1_FILT_PER_MASK) -/*! @} */ - -/*! @name CCR2 - Comparator Control Register 2 */ -/*! @{ */ - -#define LPCMP_CCR2_CMP_HPMD_MASK (0x1U) -#define LPCMP_CCR2_CMP_HPMD_SHIFT (0U) -/*! CMP_HPMD - CMP High Power Mode Select - * 0b0..Low power (speed) comparison mode - * 0b1..High power (speed) comparison mode - */ -#define LPCMP_CCR2_CMP_HPMD(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR2_CMP_HPMD_SHIFT)) & LPCMP_CCR2_CMP_HPMD_MASK) - -#define LPCMP_CCR2_CMP_NPMD_MASK (0x2U) -#define LPCMP_CCR2_CMP_NPMD_SHIFT (1U) -/*! CMP_NPMD - CMP Nano Power Mode Select - * 0b0..Disables CMP Nano power mode. CCR2[CMP_HPMD] determines the mode for the comparator. - * 0b1..Enables CMP Nano power mode. - */ -#define LPCMP_CCR2_CMP_NPMD(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR2_CMP_NPMD_SHIFT)) & LPCMP_CCR2_CMP_NPMD_MASK) - -#define LPCMP_CCR2_HYSTCTR_MASK (0x30U) -#define LPCMP_CCR2_HYSTCTR_SHIFT (4U) -/*! HYSTCTR - Comparator Hysteresis Control - * 0b00..Level 0 - * 0b01..Level 1 - * 0b10..Level 2 - * 0b11..Level 3 - */ -#define LPCMP_CCR2_HYSTCTR(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR2_HYSTCTR_SHIFT)) & LPCMP_CCR2_HYSTCTR_MASK) - -#define LPCMP_CCR2_PSEL_MASK (0x70000U) -#define LPCMP_CCR2_PSEL_SHIFT (16U) -/*! PSEL - Plus Input MUX Select - * 0b000..Input 0p - * 0b001..Input 1p - * 0b010..Input 2p - * 0b011..Input 3p - * 0b100..Input 4p - * 0b101..Input 5p - * 0b110..Reserved - * 0b111..Internal DAC output - */ -#define LPCMP_CCR2_PSEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR2_PSEL_SHIFT)) & LPCMP_CCR2_PSEL_MASK) - -#define LPCMP_CCR2_MSEL_MASK (0x700000U) -#define LPCMP_CCR2_MSEL_SHIFT (20U) -/*! MSEL - Minus Input MUX Select - * 0b000..Input 0m - * 0b001..Input 1m - * 0b010..Input 2m - * 0b011..Input 3m - * 0b100..Input 4m - * 0b101..Input 5m - * 0b110..Reserved - * 0b111..Internal DAC output - */ -#define LPCMP_CCR2_MSEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR2_MSEL_SHIFT)) & LPCMP_CCR2_MSEL_MASK) -/*! @} */ - -/*! @name DCR - DAC Control */ -/*! @{ */ - -#define LPCMP_DCR_DAC_EN_MASK (0x1U) -#define LPCMP_DCR_DAC_EN_SHIFT (0U) -/*! DAC_EN - DAC Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPCMP_DCR_DAC_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_DCR_DAC_EN_SHIFT)) & LPCMP_DCR_DAC_EN_MASK) - -#define LPCMP_DCR_DAC_HPMD_MASK (0x2U) -#define LPCMP_DCR_DAC_HPMD_SHIFT (1U) -/*! DAC_HPMD - DAC High Power Mode Select - * 0b0..Disables - * 0b1..Enables - */ -#define LPCMP_DCR_DAC_HPMD(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_DCR_DAC_HPMD_SHIFT)) & LPCMP_DCR_DAC_HPMD_MASK) - -#define LPCMP_DCR_VRSEL_MASK (0x100U) -#define LPCMP_DCR_VRSEL_SHIFT (8U) -/*! VRSEL - DAC Reference High Voltage Source Select - * 0b0..vrefh0 - * 0b1..vrefh1 - */ -#define LPCMP_DCR_VRSEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_DCR_VRSEL_SHIFT)) & LPCMP_DCR_VRSEL_MASK) - -#define LPCMP_DCR_DAC_DATA_MASK (0xFF0000U) -#define LPCMP_DCR_DAC_DATA_SHIFT (16U) -/*! DAC_DATA - DAC Output Voltage Select */ -#define LPCMP_DCR_DAC_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_DCR_DAC_DATA_SHIFT)) & LPCMP_DCR_DAC_DATA_MASK) -/*! @} */ - -/*! @name IER - Interrupt Enable */ -/*! @{ */ - -#define LPCMP_IER_CFR_IE_MASK (0x1U) -#define LPCMP_IER_CFR_IE_SHIFT (0U) -/*! CFR_IE - Comparator Flag Rising Interrupt Enable - * 0b0..Disables the comparator flag rising interrupt. - * 0b1..Enables the comparator flag rising interrupt when CFR is set. - */ -#define LPCMP_IER_CFR_IE(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_IER_CFR_IE_SHIFT)) & LPCMP_IER_CFR_IE_MASK) - -#define LPCMP_IER_CFF_IE_MASK (0x2U) -#define LPCMP_IER_CFF_IE_SHIFT (1U) -/*! CFF_IE - Comparator Flag Falling Interrupt Enable - * 0b0..Disables the comparator flag falling interrupt. - * 0b1..Enables the comparator flag falling interrupt when CFF is set. - */ -#define LPCMP_IER_CFF_IE(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_IER_CFF_IE_SHIFT)) & LPCMP_IER_CFF_IE_MASK) - -#define LPCMP_IER_RRF_IE_MASK (0x4U) -#define LPCMP_IER_RRF_IE_SHIFT (2U) -/*! RRF_IE - Round-Robin Flag Interrupt Enable - * 0b0..Disables the round-robin flag interrupt. - * 0b1..Enables the round-robin flag interrupt when the comparison result changes for a given channel. - */ -#define LPCMP_IER_RRF_IE(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_IER_RRF_IE_SHIFT)) & LPCMP_IER_RRF_IE_MASK) -/*! @} */ - -/*! @name CSR - Comparator Status */ -/*! @{ */ - -#define LPCMP_CSR_CFR_MASK (0x1U) -#define LPCMP_CSR_CFR_SHIFT (0U) -/*! CFR - Analog Comparator Flag Rising - * 0b0..Not detected - * 0b1..Detected - */ -#define LPCMP_CSR_CFR(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CSR_CFR_SHIFT)) & LPCMP_CSR_CFR_MASK) - -#define LPCMP_CSR_CFF_MASK (0x2U) -#define LPCMP_CSR_CFF_SHIFT (1U) -/*! CFF - Analog Comparator Flag Falling - * 0b0..Not detected - * 0b1..Detected - */ -#define LPCMP_CSR_CFF(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CSR_CFF_SHIFT)) & LPCMP_CSR_CFF_MASK) - -#define LPCMP_CSR_RRF_MASK (0x4U) -#define LPCMP_CSR_RRF_SHIFT (2U) -/*! RRF - Round-Robin Flag - * 0b0..Not detected - * 0b1..Detected - */ -#define LPCMP_CSR_RRF(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CSR_RRF_SHIFT)) & LPCMP_CSR_RRF_MASK) - -#define LPCMP_CSR_COUT_MASK (0x100U) -#define LPCMP_CSR_COUT_SHIFT (8U) -/*! COUT - Analog Comparator Output */ -#define LPCMP_CSR_COUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CSR_COUT_SHIFT)) & LPCMP_CSR_COUT_MASK) -/*! @} */ - -/*! @name RRCR0 - Round Robin Control Register 0 */ -/*! @{ */ - -#define LPCMP_RRCR0_RR_EN_MASK (0x1U) -#define LPCMP_RRCR0_RR_EN_SHIFT (0U) -/*! RR_EN - Round-Robin Enable - * 0b1..Enables - * 0b0..Disables - */ -#define LPCMP_RRCR0_RR_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_EN_SHIFT)) & LPCMP_RRCR0_RR_EN_MASK) - -#define LPCMP_RRCR0_RR_TRG_SEL_MASK (0x2U) -#define LPCMP_RRCR0_RR_TRG_SEL_SHIFT (1U) -/*! RR_TRG_SEL - Round-Robin Trigger Select - * 0b0..External trigger - * 0b1..Internal trigger - */ -#define LPCMP_RRCR0_RR_TRG_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_TRG_SEL_SHIFT)) & LPCMP_RRCR0_RR_TRG_SEL_MASK) - -#define LPCMP_RRCR0_RR_EXTTRG_SEL_MASK (0x3CU) -#define LPCMP_RRCR0_RR_EXTTRG_SEL_SHIFT (2U) -/*! RR_EXTTRG_SEL - Select the External Trigger Source - * 0b0000..Select external trigger source 0 - * 0b0001..Select external trigger source 1 - * 0b0010..Select external trigger source 2 - * 0b0011..Select external trigger source 3 - * 0b0100..Select external trigger source 4 - * 0b0101..Select external trigger source 5 - * 0b0110..Select external trigger source 6 - * 0b0111..Select external trigger source 7 - * 0b1000..Select external trigger source 8 - * 0b1001..Select external trigger source 9 - * 0b1010..Select external trigger source 10 - * 0b1011..Select external trigger source 11 - * 0b1100..Select external trigger source 12 - * 0b1101..Select external trigger source 13 - * 0b1110..Select external trigger source 14 - * 0b1111..Select external trigger source 15 - */ -#define LPCMP_RRCR0_RR_EXTTRG_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_EXTTRG_SEL_SHIFT)) & LPCMP_RRCR0_RR_EXTTRG_SEL_MASK) - -#define LPCMP_RRCR0_RR_NSAM_MASK (0x300U) -#define LPCMP_RRCR0_RR_NSAM_SHIFT (8U) -/*! RR_NSAM - Number of Sample Clocks - * 0b00..0 clock - * 0b01..1 clock - * 0b10..2 clocks - * 0b11..3 clocks - */ -#define LPCMP_RRCR0_RR_NSAM(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_NSAM_SHIFT)) & LPCMP_RRCR0_RR_NSAM_MASK) - -#define LPCMP_RRCR0_RR_CLK_SEL_MASK (0x3000U) -#define LPCMP_RRCR0_RR_CLK_SEL_SHIFT (12U) -/*! RR_CLK_SEL - Round Robin Clock Source Select - * 0b00..Select Round Robin clock Source 0 - * 0b01..Select Round Robin clock Source 1 - * 0b10..Select Round Robin clock Source 2 - * 0b11..Select Round Robin clock Source 3 - */ -#define LPCMP_RRCR0_RR_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_CLK_SEL_SHIFT)) & LPCMP_RRCR0_RR_CLK_SEL_MASK) - -#define LPCMP_RRCR0_RR_INITMOD_MASK (0x3F0000U) -#define LPCMP_RRCR0_RR_INITMOD_SHIFT (16U) -/*! RR_INITMOD - Initialization Delay Modulus - * 0b000000..63 cycles (same as 111111b) - * 0b000001-0b111111..1 to 63 cycles - */ -#define LPCMP_RRCR0_RR_INITMOD(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_INITMOD_SHIFT)) & LPCMP_RRCR0_RR_INITMOD_MASK) - -#define LPCMP_RRCR0_RR_SAMPLE_CNT_MASK (0xF000000U) -#define LPCMP_RRCR0_RR_SAMPLE_CNT_SHIFT (24U) -/*! RR_SAMPLE_CNT - Number of Sample for One Channel - * 0b0000..1 samples - * 0b0001..2 samples - * 0b0010..3 samples - * 0b0011..4 samples - * 0b0100..5 samples - * 0b0101..6 samples - * 0b0110..7 samples - * 0b0111..8 samples - * 0b1000..9 samples - * 0b1001..10 samples - * 0b1010..11 samples - * 0b1011..12 samples - * 0b1100..13 samples - * 0b1101..14 samples - * 0b1110..15 samples - * 0b1111..16 samples - */ -#define LPCMP_RRCR0_RR_SAMPLE_CNT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_SAMPLE_CNT_SHIFT)) & LPCMP_RRCR0_RR_SAMPLE_CNT_MASK) - -#define LPCMP_RRCR0_RR_SAMPLE_THRESHOLD_MASK (0xF0000000U) -#define LPCMP_RRCR0_RR_SAMPLE_THRESHOLD_SHIFT (28U) -/*! RR_SAMPLE_THRESHOLD - Sample Time Threshold - * 0b0000..At least 1 sampled "1", the final result is "1" - * 0b0001..At least 2 sampled "1", the final result is "1" - * 0b0010..At least 3 sampled "1", the final result is "1" - * 0b0011..At least 4 sampled "1", the final result is "1" - * 0b0100..At least 5 sampled "1", the final result is "1" - * 0b0101..At least 6 sampled "1", the final result is "1" - * 0b0110..At least 7 sampled "1", the final result is "1" - * 0b0111..At least 8 sampled "1", the final result is "1" - * 0b1000..At least 9 sampled "1", the final result is "1" - * 0b1001..At least 10 sampled "1", the final result is "1" - * 0b1010..At least 11 sampled "1", the final result is "1" - * 0b1011..At least 12 sampled "1", the final result is "1" - * 0b1100..At least 13 sampled "1", the final result is "1" - * 0b1101..At least 14 sampled "1", the final result is "1" - * 0b1110..At least 15 sampled "1", the final result is "1" - * 0b1111..At least 16 sampled "1", the final result is "1" - */ -#define LPCMP_RRCR0_RR_SAMPLE_THRESHOLD(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_SAMPLE_THRESHOLD_SHIFT)) & LPCMP_RRCR0_RR_SAMPLE_THRESHOLD_MASK) -/*! @} */ - -/*! @name RRCR1 - Round Robin Control Register 1 */ -/*! @{ */ - -#define LPCMP_RRCR1_RR_CH0EN_MASK (0x1U) -#define LPCMP_RRCR1_RR_CH0EN_SHIFT (0U) -/*! RR_CH0EN - Channel 0 Input Enable in Trigger Mode - * 0b1..Enables - * 0b0..Disables - */ -#define LPCMP_RRCR1_RR_CH0EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH0EN_SHIFT)) & LPCMP_RRCR1_RR_CH0EN_MASK) - -#define LPCMP_RRCR1_RR_CH1EN_MASK (0x2U) -#define LPCMP_RRCR1_RR_CH1EN_SHIFT (1U) -/*! RR_CH1EN - Channel 1 Input Enable in Trigger Mode - * 0b1..Enables - * 0b0..Disables - */ -#define LPCMP_RRCR1_RR_CH1EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH1EN_SHIFT)) & LPCMP_RRCR1_RR_CH1EN_MASK) - -#define LPCMP_RRCR1_RR_CH2EN_MASK (0x4U) -#define LPCMP_RRCR1_RR_CH2EN_SHIFT (2U) -/*! RR_CH2EN - Channel 2 Input Enable in Trigger Mode - * 0b1..Enables - * 0b0..Disables - */ -#define LPCMP_RRCR1_RR_CH2EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH2EN_SHIFT)) & LPCMP_RRCR1_RR_CH2EN_MASK) - -#define LPCMP_RRCR1_RR_CH3EN_MASK (0x8U) -#define LPCMP_RRCR1_RR_CH3EN_SHIFT (3U) -/*! RR_CH3EN - Channel 3 Input Enable in Trigger Mode - * 0b1..Enables - * 0b0..Disables - */ -#define LPCMP_RRCR1_RR_CH3EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH3EN_SHIFT)) & LPCMP_RRCR1_RR_CH3EN_MASK) - -#define LPCMP_RRCR1_RR_CH4EN_MASK (0x10U) -#define LPCMP_RRCR1_RR_CH4EN_SHIFT (4U) -/*! RR_CH4EN - Channel 4 Input Enable in Trigger Mode - * 0b1..Enables - * 0b0..Disables - */ -#define LPCMP_RRCR1_RR_CH4EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH4EN_SHIFT)) & LPCMP_RRCR1_RR_CH4EN_MASK) - -#define LPCMP_RRCR1_RR_CH5EN_MASK (0x20U) -#define LPCMP_RRCR1_RR_CH5EN_SHIFT (5U) -/*! RR_CH5EN - Channel 5 Input Enable in Trigger Mode - * 0b1..Enables - * 0b0..Disables - */ -#define LPCMP_RRCR1_RR_CH5EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH5EN_SHIFT)) & LPCMP_RRCR1_RR_CH5EN_MASK) - -#define LPCMP_RRCR1_RR_CH6EN_MASK (0x40U) -#define LPCMP_RRCR1_RR_CH6EN_SHIFT (6U) -/*! RR_CH6EN - Channel 6 Input Enable in Trigger Mode - * 0b1..Enables - * 0b0..Disables - */ -#define LPCMP_RRCR1_RR_CH6EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH6EN_SHIFT)) & LPCMP_RRCR1_RR_CH6EN_MASK) - -#define LPCMP_RRCR1_RR_CH7EN_MASK (0x80U) -#define LPCMP_RRCR1_RR_CH7EN_SHIFT (7U) -/*! RR_CH7EN - Channel 7 Input Enable in Trigger Mode - * 0b1..Enables - * 0b0..Disables - */ -#define LPCMP_RRCR1_RR_CH7EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH7EN_SHIFT)) & LPCMP_RRCR1_RR_CH7EN_MASK) - -#define LPCMP_RRCR1_FIXP_MASK (0x10000U) -#define LPCMP_RRCR1_FIXP_SHIFT (16U) -/*! FIXP - Fixed Port - * 0b0..Fix the plus port. Sweep only the inputs to the minus port. - * 0b1..Fix the minus port. Sweep only the inputs to the plus port. - */ -#define LPCMP_RRCR1_FIXP(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_FIXP_SHIFT)) & LPCMP_RRCR1_FIXP_MASK) - -#define LPCMP_RRCR1_FIXCH_MASK (0x700000U) -#define LPCMP_RRCR1_FIXCH_SHIFT (20U) -/*! FIXCH - Fixed Channel Select - * 0b000..Channel 0 - * 0b001..Channel 1 - * 0b010..Channel 2 - * 0b011..Channel 3 - * 0b100..Channel 4 - * 0b101..Channel 5 - * 0b110..Channel 6 - * 0b111..Channel 7 - */ -#define LPCMP_RRCR1_FIXCH(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_FIXCH_SHIFT)) & LPCMP_RRCR1_FIXCH_MASK) -/*! @} */ - -/*! @name RRCSR - Round Robin Control and Status */ -/*! @{ */ - -#define LPCMP_RRCSR_RR_CH0OUT_MASK (0x1U) -#define LPCMP_RRCSR_RR_CH0OUT_SHIFT (0U) -/*! RR_CH0OUT - Comparison Result for Channel 0 */ -#define LPCMP_RRCSR_RR_CH0OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH0OUT_SHIFT)) & LPCMP_RRCSR_RR_CH0OUT_MASK) - -#define LPCMP_RRCSR_RR_CH1OUT_MASK (0x2U) -#define LPCMP_RRCSR_RR_CH1OUT_SHIFT (1U) -/*! RR_CH1OUT - Comparison Result for Channel 1 */ -#define LPCMP_RRCSR_RR_CH1OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH1OUT_SHIFT)) & LPCMP_RRCSR_RR_CH1OUT_MASK) - -#define LPCMP_RRCSR_RR_CH2OUT_MASK (0x4U) -#define LPCMP_RRCSR_RR_CH2OUT_SHIFT (2U) -/*! RR_CH2OUT - Comparison Result for Channel 2 */ -#define LPCMP_RRCSR_RR_CH2OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH2OUT_SHIFT)) & LPCMP_RRCSR_RR_CH2OUT_MASK) - -#define LPCMP_RRCSR_RR_CH3OUT_MASK (0x8U) -#define LPCMP_RRCSR_RR_CH3OUT_SHIFT (3U) -/*! RR_CH3OUT - Comparison Result for Channel 3 */ -#define LPCMP_RRCSR_RR_CH3OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH3OUT_SHIFT)) & LPCMP_RRCSR_RR_CH3OUT_MASK) - -#define LPCMP_RRCSR_RR_CH4OUT_MASK (0x10U) -#define LPCMP_RRCSR_RR_CH4OUT_SHIFT (4U) -/*! RR_CH4OUT - Comparison Result for Channel 4 */ -#define LPCMP_RRCSR_RR_CH4OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH4OUT_SHIFT)) & LPCMP_RRCSR_RR_CH4OUT_MASK) - -#define LPCMP_RRCSR_RR_CH5OUT_MASK (0x20U) -#define LPCMP_RRCSR_RR_CH5OUT_SHIFT (5U) -/*! RR_CH5OUT - Comparison Result for Channel 5 */ -#define LPCMP_RRCSR_RR_CH5OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH5OUT_SHIFT)) & LPCMP_RRCSR_RR_CH5OUT_MASK) - -#define LPCMP_RRCSR_RR_CH6OUT_MASK (0x40U) -#define LPCMP_RRCSR_RR_CH6OUT_SHIFT (6U) -/*! RR_CH6OUT - Comparison Result for Channel 6 */ -#define LPCMP_RRCSR_RR_CH6OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH6OUT_SHIFT)) & LPCMP_RRCSR_RR_CH6OUT_MASK) - -#define LPCMP_RRCSR_RR_CH7OUT_MASK (0x80U) -#define LPCMP_RRCSR_RR_CH7OUT_SHIFT (7U) -/*! RR_CH7OUT - Comparison Result for Channel 7 */ -#define LPCMP_RRCSR_RR_CH7OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH7OUT_SHIFT)) & LPCMP_RRCSR_RR_CH7OUT_MASK) -/*! @} */ - -/*! @name RRSR - Round Robin Status */ -/*! @{ */ - -#define LPCMP_RRSR_RR_CH0F_MASK (0x1U) -#define LPCMP_RRSR_RR_CH0F_SHIFT (0U) -/*! RR_CH0F - Channel 0 Input Changed Flag - * 0b0..Not different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH0F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH0F_SHIFT)) & LPCMP_RRSR_RR_CH0F_MASK) - -#define LPCMP_RRSR_RR_CH1F_MASK (0x2U) -#define LPCMP_RRSR_RR_CH1F_SHIFT (1U) -/*! RR_CH1F - Channel 1 Input Changed Flag - * 0b0..Not different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH1F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH1F_SHIFT)) & LPCMP_RRSR_RR_CH1F_MASK) - -#define LPCMP_RRSR_RR_CH2F_MASK (0x4U) -#define LPCMP_RRSR_RR_CH2F_SHIFT (2U) -/*! RR_CH2F - Channel 2 Input Changed Flag - * 0b0..Not different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH2F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH2F_SHIFT)) & LPCMP_RRSR_RR_CH2F_MASK) - -#define LPCMP_RRSR_RR_CH3F_MASK (0x8U) -#define LPCMP_RRSR_RR_CH3F_SHIFT (3U) -/*! RR_CH3F - Channel 3 Input Changed Flag - * 0b0..Not different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH3F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH3F_SHIFT)) & LPCMP_RRSR_RR_CH3F_MASK) - -#define LPCMP_RRSR_RR_CH4F_MASK (0x10U) -#define LPCMP_RRSR_RR_CH4F_SHIFT (4U) -/*! RR_CH4F - Channel 4 Input Changed Flag - * 0b0..Not different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH4F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH4F_SHIFT)) & LPCMP_RRSR_RR_CH4F_MASK) - -#define LPCMP_RRSR_RR_CH5F_MASK (0x20U) -#define LPCMP_RRSR_RR_CH5F_SHIFT (5U) -/*! RR_CH5F - Channel 5 Input Changed Flag - * 0b0..Not different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH5F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH5F_SHIFT)) & LPCMP_RRSR_RR_CH5F_MASK) - -#define LPCMP_RRSR_RR_CH6F_MASK (0x40U) -#define LPCMP_RRSR_RR_CH6F_SHIFT (6U) -/*! RR_CH6F - Channel 6 Input Changed Flag - * 0b0..Not different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH6F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH6F_SHIFT)) & LPCMP_RRSR_RR_CH6F_MASK) - -#define LPCMP_RRSR_RR_CH7F_MASK (0x80U) -#define LPCMP_RRSR_RR_CH7F_SHIFT (7U) -/*! RR_CH7F - Channel 7 Input Changed Flag - * 0b0..Not different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH7F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH7F_SHIFT)) & LPCMP_RRSR_RR_CH7F_MASK) -/*! @} */ - -/*! @name RRCR2 - Round Robin Control Register 2 */ -/*! @{ */ - -#define LPCMP_RRCR2_RR_TIMER_RELOAD_MASK (0xFFFFFFFU) -#define LPCMP_RRCR2_RR_TIMER_RELOAD_SHIFT (0U) -/*! RR_TIMER_RELOAD - Number of Sample Clocks */ -#define LPCMP_RRCR2_RR_TIMER_RELOAD(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR2_RR_TIMER_RELOAD_SHIFT)) & LPCMP_RRCR2_RR_TIMER_RELOAD_MASK) - -#define LPCMP_RRCR2_RR_TIMER_EN_MASK (0x80000000U) -#define LPCMP_RRCR2_RR_TIMER_EN_SHIFT (31U) -/*! RR_TIMER_EN - Round-Robin Internal Timer Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPCMP_RRCR2_RR_TIMER_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR2_RR_TIMER_EN_SHIFT)) & LPCMP_RRCR2_RR_TIMER_EN_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group LPCMP_Register_Masks */ - - -/* LPCMP - Peripheral instance base addresses */ -/** Peripheral CMP0 base address */ -#define CMP0_BASE (0x400B1000u) -/** Peripheral CMP0 base pointer */ -#define CMP0 ((LPCMP_Type *)CMP0_BASE) -/** Peripheral CMP1 base address */ -#define CMP1_BASE (0x400B2000u) -/** Peripheral CMP1 base pointer */ -#define CMP1 ((LPCMP_Type *)CMP1_BASE) -/** Array initializer of LPCMP peripheral base addresses */ -#define LPCMP_BASE_ADDRS { CMP0_BASE, CMP1_BASE } -/** Array initializer of LPCMP peripheral base pointers */ -#define LPCMP_BASE_PTRS { CMP0, CMP1 } - -/*! - * @} - */ /* end of group LPCMP_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LPI2C Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPI2C_Peripheral_Access_Layer LPI2C Peripheral Access Layer - * @{ - */ - -/** LPI2C - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - uint8_t RESERVED_0[8]; - __IO uint32_t MCR; /**< Controller Control, offset: 0x10 */ - __IO uint32_t MSR; /**< Controller Status, offset: 0x14 */ - __IO uint32_t MIER; /**< Controller Interrupt Enable, offset: 0x18 */ - __IO uint32_t MDER; /**< Controller DMA Enable, offset: 0x1C */ - __IO uint32_t MCFGR0; /**< Controller Configuration 0, offset: 0x20 */ - __IO uint32_t MCFGR1; /**< Controller Configuration 1, offset: 0x24 */ - __IO uint32_t MCFGR2; /**< Controller Configuration 2, offset: 0x28 */ - __IO uint32_t MCFGR3; /**< Controller Configuration 3, offset: 0x2C */ - uint8_t RESERVED_1[16]; - __IO uint32_t MDMR; /**< Controller Data Match, offset: 0x40 */ - uint8_t RESERVED_2[4]; - __IO uint32_t MCCR0; /**< Controller Clock Configuration 0, offset: 0x48 */ - uint8_t RESERVED_3[4]; - __IO uint32_t MCCR1; /**< Controller Clock Configuration 1, offset: 0x50 */ - uint8_t RESERVED_4[4]; - __IO uint32_t MFCR; /**< Controller FIFO Control, offset: 0x58 */ - __I uint32_t MFSR; /**< Controller FIFO Status, offset: 0x5C */ - __O uint32_t MTDR; /**< Controller Transmit Data, offset: 0x60 */ - uint8_t RESERVED_5[12]; - __I uint32_t MRDR; /**< Controller Receive Data, offset: 0x70 */ - uint8_t RESERVED_6[4]; - __I uint32_t MRDROR; /**< Controller Receive Data Read Only, offset: 0x78 */ - uint8_t RESERVED_7[148]; - __IO uint32_t SCR; /**< Target Control, offset: 0x110 */ - __IO uint32_t SSR; /**< Target Status, offset: 0x114 */ - __IO uint32_t SIER; /**< Target Interrupt Enable, offset: 0x118 */ - __IO uint32_t SDER; /**< Target DMA Enable, offset: 0x11C */ - __IO uint32_t SCFGR0; /**< Target Configuration 0, offset: 0x120 */ - __IO uint32_t SCFGR1; /**< Target Configuration 1, offset: 0x124 */ - __IO uint32_t SCFGR2; /**< Target Configuration 2, offset: 0x128 */ - uint8_t RESERVED_8[20]; - __IO uint32_t SAMR; /**< Target Address Match, offset: 0x140 */ - uint8_t RESERVED_9[12]; - __I uint32_t SASR; /**< Target Address Status, offset: 0x150 */ - __IO uint32_t STAR; /**< Target Transmit ACK, offset: 0x154 */ - uint8_t RESERVED_10[8]; - __O uint32_t STDR; /**< Target Transmit Data, offset: 0x160 */ - uint8_t RESERVED_11[12]; - __I uint32_t SRDR; /**< Target Receive Data, offset: 0x170 */ - uint8_t RESERVED_12[4]; - __I uint32_t SRDROR; /**< Target Receive Data Read Only, offset: 0x178 */ -} LPI2C_Type; - -/* ---------------------------------------------------------------------------- - -- LPI2C Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPI2C_Register_Masks LPI2C Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define LPI2C_VERID_FEATURE_MASK (0xFFFFU) -#define LPI2C_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000010..Controller only, with standard feature set - * 0b0000000000000011..Controller and target, with standard feature set - */ -#define LPI2C_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_VERID_FEATURE_SHIFT)) & LPI2C_VERID_FEATURE_MASK) - -#define LPI2C_VERID_MINOR_MASK (0xFF0000U) -#define LPI2C_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define LPI2C_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_VERID_MINOR_SHIFT)) & LPI2C_VERID_MINOR_MASK) - -#define LPI2C_VERID_MAJOR_MASK (0xFF000000U) -#define LPI2C_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define LPI2C_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_VERID_MAJOR_SHIFT)) & LPI2C_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define LPI2C_PARAM_MTXFIFO_MASK (0xFU) -#define LPI2C_PARAM_MTXFIFO_SHIFT (0U) -/*! MTXFIFO - Controller Transmit FIFO Size */ -#define LPI2C_PARAM_MTXFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_PARAM_MTXFIFO_SHIFT)) & LPI2C_PARAM_MTXFIFO_MASK) - -#define LPI2C_PARAM_MRXFIFO_MASK (0xF00U) -#define LPI2C_PARAM_MRXFIFO_SHIFT (8U) -/*! MRXFIFO - Controller Receive FIFO Size */ -#define LPI2C_PARAM_MRXFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_PARAM_MRXFIFO_SHIFT)) & LPI2C_PARAM_MRXFIFO_MASK) -/*! @} */ - -/*! @name MCR - Controller Control */ -/*! @{ */ - -#define LPI2C_MCR_MEN_MASK (0x1U) -#define LPI2C_MCR_MEN_SHIFT (0U) -/*! MEN - Controller Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MCR_MEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCR_MEN_SHIFT)) & LPI2C_MCR_MEN_MASK) - -#define LPI2C_MCR_RST_MASK (0x2U) -#define LPI2C_MCR_RST_SHIFT (1U) -/*! RST - Software Reset - * 0b0..No effect - * 0b1..Reset - */ -#define LPI2C_MCR_RST(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCR_RST_SHIFT)) & LPI2C_MCR_RST_MASK) - -#define LPI2C_MCR_DOZEN_MASK (0x4U) -#define LPI2C_MCR_DOZEN_SHIFT (2U) -/*! DOZEN - Doze Mode Enable - * 0b0..Enable - * 0b1..Disable - */ -#define LPI2C_MCR_DOZEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCR_DOZEN_SHIFT)) & LPI2C_MCR_DOZEN_MASK) - -#define LPI2C_MCR_DBGEN_MASK (0x8U) -#define LPI2C_MCR_DBGEN_SHIFT (3U) -/*! DBGEN - Debug Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MCR_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCR_DBGEN_SHIFT)) & LPI2C_MCR_DBGEN_MASK) - -#define LPI2C_MCR_RTF_MASK (0x100U) -#define LPI2C_MCR_RTF_SHIFT (8U) -/*! RTF - Reset Transmit FIFO - * 0b0..No effect - * 0b1..Reset transmit FIFO - */ -#define LPI2C_MCR_RTF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCR_RTF_SHIFT)) & LPI2C_MCR_RTF_MASK) - -#define LPI2C_MCR_RRF_MASK (0x200U) -#define LPI2C_MCR_RRF_SHIFT (9U) -/*! RRF - Reset Receive FIFO - * 0b0..No effect - * 0b1..Reset receive FIFO - */ -#define LPI2C_MCR_RRF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCR_RRF_SHIFT)) & LPI2C_MCR_RRF_MASK) -/*! @} */ - -/*! @name MSR - Controller Status */ -/*! @{ */ - -#define LPI2C_MSR_TDF_MASK (0x1U) -#define LPI2C_MSR_TDF_SHIFT (0U) -/*! TDF - Transmit Data Flag - * 0b0..Transmit data not requested - * 0b1..Transmit data requested - */ -#define LPI2C_MSR_TDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_TDF_SHIFT)) & LPI2C_MSR_TDF_MASK) - -#define LPI2C_MSR_RDF_MASK (0x2U) -#define LPI2C_MSR_RDF_SHIFT (1U) -/*! RDF - Receive Data Flag - * 0b0..Receive data not ready - * 0b1..Receive data ready - */ -#define LPI2C_MSR_RDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_RDF_SHIFT)) & LPI2C_MSR_RDF_MASK) - -#define LPI2C_MSR_EPF_MASK (0x100U) -#define LPI2C_MSR_EPF_SHIFT (8U) -/*! EPF - End Packet Flag - * 0b0..No Stop or repeated Start generated - * 0b1..Stop or repeated Start generated - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_EPF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_EPF_SHIFT)) & LPI2C_MSR_EPF_MASK) - -#define LPI2C_MSR_SDF_MASK (0x200U) -#define LPI2C_MSR_SDF_SHIFT (9U) -/*! SDF - Stop Detect Flag - * 0b0..No Stop condition generated - * 0b1..Stop condition generated - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_SDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_SDF_SHIFT)) & LPI2C_MSR_SDF_MASK) - -#define LPI2C_MSR_NDF_MASK (0x400U) -#define LPI2C_MSR_NDF_SHIFT (10U) -/*! NDF - NACK Detect Flag - * 0b0..No unexpected NACK detected - * 0b1..Unexpected NACK detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_NDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_NDF_SHIFT)) & LPI2C_MSR_NDF_MASK) - -#define LPI2C_MSR_ALF_MASK (0x800U) -#define LPI2C_MSR_ALF_SHIFT (11U) -/*! ALF - Arbitration Lost Flag - * 0b0..Controller did not lose arbitration - * 0b1..Controller lost arbitration - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_ALF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_ALF_SHIFT)) & LPI2C_MSR_ALF_MASK) - -#define LPI2C_MSR_FEF_MASK (0x1000U) -#define LPI2C_MSR_FEF_SHIFT (12U) -/*! FEF - FIFO Error Flag - * 0b0..No FIFO error - * 0b1..FIFO error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_FEF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_FEF_SHIFT)) & LPI2C_MSR_FEF_MASK) - -#define LPI2C_MSR_PLTF_MASK (0x2000U) -#define LPI2C_MSR_PLTF_SHIFT (13U) -/*! PLTF - Pin Low Timeout Flag - * 0b0..Pin low timeout did not occur - * 0b1..Pin low timeout occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_PLTF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_PLTF_SHIFT)) & LPI2C_MSR_PLTF_MASK) - -#define LPI2C_MSR_DMF_MASK (0x4000U) -#define LPI2C_MSR_DMF_SHIFT (14U) -/*! DMF - Data Match Flag - * 0b0..Matching data not received - * 0b1..Matching data received - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_DMF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_DMF_SHIFT)) & LPI2C_MSR_DMF_MASK) - -#define LPI2C_MSR_STF_MASK (0x8000U) -#define LPI2C_MSR_STF_SHIFT (15U) -/*! STF - Start Flag - * 0b0..Start condition not detected - * 0b1..Start condition detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_STF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_STF_SHIFT)) & LPI2C_MSR_STF_MASK) - -#define LPI2C_MSR_MBF_MASK (0x1000000U) -#define LPI2C_MSR_MBF_SHIFT (24U) -/*! MBF - Controller Busy Flag - * 0b0..Idle - * 0b1..Busy - */ -#define LPI2C_MSR_MBF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_MBF_SHIFT)) & LPI2C_MSR_MBF_MASK) - -#define LPI2C_MSR_BBF_MASK (0x2000000U) -#define LPI2C_MSR_BBF_SHIFT (25U) -/*! BBF - Bus Busy Flag - * 0b0..Idle - * 0b1..Busy - */ -#define LPI2C_MSR_BBF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_BBF_SHIFT)) & LPI2C_MSR_BBF_MASK) -/*! @} */ - -/*! @name MIER - Controller Interrupt Enable */ -/*! @{ */ - -#define LPI2C_MIER_TDIE_MASK (0x1U) -#define LPI2C_MIER_TDIE_SHIFT (0U) -/*! TDIE - Transmit Data Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_TDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_TDIE_SHIFT)) & LPI2C_MIER_TDIE_MASK) - -#define LPI2C_MIER_RDIE_MASK (0x2U) -#define LPI2C_MIER_RDIE_SHIFT (1U) -/*! RDIE - Receive Data Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_RDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_RDIE_SHIFT)) & LPI2C_MIER_RDIE_MASK) - -#define LPI2C_MIER_EPIE_MASK (0x100U) -#define LPI2C_MIER_EPIE_SHIFT (8U) -/*! EPIE - End Packet Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_EPIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_EPIE_SHIFT)) & LPI2C_MIER_EPIE_MASK) - -#define LPI2C_MIER_SDIE_MASK (0x200U) -#define LPI2C_MIER_SDIE_SHIFT (9U) -/*! SDIE - Stop Detect Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_SDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_SDIE_SHIFT)) & LPI2C_MIER_SDIE_MASK) - -#define LPI2C_MIER_NDIE_MASK (0x400U) -#define LPI2C_MIER_NDIE_SHIFT (10U) -/*! NDIE - NACK Detect Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_NDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_NDIE_SHIFT)) & LPI2C_MIER_NDIE_MASK) - -#define LPI2C_MIER_ALIE_MASK (0x800U) -#define LPI2C_MIER_ALIE_SHIFT (11U) -/*! ALIE - Arbitration Lost Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_ALIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_ALIE_SHIFT)) & LPI2C_MIER_ALIE_MASK) - -#define LPI2C_MIER_FEIE_MASK (0x1000U) -#define LPI2C_MIER_FEIE_SHIFT (12U) -/*! FEIE - FIFO Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_FEIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_FEIE_SHIFT)) & LPI2C_MIER_FEIE_MASK) - -#define LPI2C_MIER_PLTIE_MASK (0x2000U) -#define LPI2C_MIER_PLTIE_SHIFT (13U) -/*! PLTIE - Pin Low Timeout Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_PLTIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_PLTIE_SHIFT)) & LPI2C_MIER_PLTIE_MASK) - -#define LPI2C_MIER_DMIE_MASK (0x4000U) -#define LPI2C_MIER_DMIE_SHIFT (14U) -/*! DMIE - Data Match Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_DMIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_DMIE_SHIFT)) & LPI2C_MIER_DMIE_MASK) - -#define LPI2C_MIER_STIE_MASK (0x8000U) -#define LPI2C_MIER_STIE_SHIFT (15U) -/*! STIE - Start Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_STIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_STIE_SHIFT)) & LPI2C_MIER_STIE_MASK) -/*! @} */ - -/*! @name MDER - Controller DMA Enable */ -/*! @{ */ - -#define LPI2C_MDER_TDDE_MASK (0x1U) -#define LPI2C_MDER_TDDE_SHIFT (0U) -/*! TDDE - Transmit Data DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MDER_TDDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MDER_TDDE_SHIFT)) & LPI2C_MDER_TDDE_MASK) - -#define LPI2C_MDER_RDDE_MASK (0x2U) -#define LPI2C_MDER_RDDE_SHIFT (1U) -/*! RDDE - Receive Data DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MDER_RDDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MDER_RDDE_SHIFT)) & LPI2C_MDER_RDDE_MASK) -/*! @} */ - -/*! @name MCFGR0 - Controller Configuration 0 */ -/*! @{ */ - -#define LPI2C_MCFGR0_HREN_MASK (0x1U) -#define LPI2C_MCFGR0_HREN_SHIFT (0U) -/*! HREN - Host Request Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MCFGR0_HREN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_HREN_SHIFT)) & LPI2C_MCFGR0_HREN_MASK) - -#define LPI2C_MCFGR0_HRPOL_MASK (0x2U) -#define LPI2C_MCFGR0_HRPOL_SHIFT (1U) -/*! HRPOL - Host Request Polarity - * 0b0..Active low - * 0b1..Active high - */ -#define LPI2C_MCFGR0_HRPOL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_HRPOL_SHIFT)) & LPI2C_MCFGR0_HRPOL_MASK) - -#define LPI2C_MCFGR0_HRSEL_MASK (0x4U) -#define LPI2C_MCFGR0_HRSEL_SHIFT (2U) -/*! HRSEL - Host Request Select - * 0b0..Host request input is pin HREQ - * 0b1..Host request input is input trigger - */ -#define LPI2C_MCFGR0_HRSEL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_HRSEL_SHIFT)) & LPI2C_MCFGR0_HRSEL_MASK) - -#define LPI2C_MCFGR0_HRDIR_MASK (0x8U) -#define LPI2C_MCFGR0_HRDIR_SHIFT (3U) -/*! HRDIR - Host Request Direction - * 0b0..HREQ pin is input (for LPI2C controller) - * 0b1..HREQ pin is output (for LPI2C target) - */ -#define LPI2C_MCFGR0_HRDIR(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_HRDIR_SHIFT)) & LPI2C_MCFGR0_HRDIR_MASK) - -#define LPI2C_MCFGR0_CIRFIFO_MASK (0x100U) -#define LPI2C_MCFGR0_CIRFIFO_SHIFT (8U) -/*! CIRFIFO - Circular FIFO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MCFGR0_CIRFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_CIRFIFO_SHIFT)) & LPI2C_MCFGR0_CIRFIFO_MASK) - -#define LPI2C_MCFGR0_RDMO_MASK (0x200U) -#define LPI2C_MCFGR0_RDMO_SHIFT (9U) -/*! RDMO - Receive Data Match Only - * 0b0..Received data is stored in the receive FIFO - * 0b1..Received data is discarded unless MSR[DMF] is set - */ -#define LPI2C_MCFGR0_RDMO(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_RDMO_SHIFT)) & LPI2C_MCFGR0_RDMO_MASK) - -#define LPI2C_MCFGR0_RELAX_MASK (0x10000U) -#define LPI2C_MCFGR0_RELAX_SHIFT (16U) -/*! RELAX - Relaxed Mode - * 0b0..Normal transfer - * 0b1..Relaxed transfer - */ -#define LPI2C_MCFGR0_RELAX(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_RELAX_SHIFT)) & LPI2C_MCFGR0_RELAX_MASK) - -#define LPI2C_MCFGR0_ABORT_MASK (0x20000U) -#define LPI2C_MCFGR0_ABORT_SHIFT (17U) -/*! ABORT - Abort Transfer - * 0b0..Normal transfer - * 0b1..Abort existing transfer and do not start a new one - */ -#define LPI2C_MCFGR0_ABORT(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_ABORT_SHIFT)) & LPI2C_MCFGR0_ABORT_MASK) -/*! @} */ - -/*! @name MCFGR1 - Controller Configuration 1 */ -/*! @{ */ - -#define LPI2C_MCFGR1_PRESCALE_MASK (0x7U) -#define LPI2C_MCFGR1_PRESCALE_SHIFT (0U) -/*! PRESCALE - Prescaler - * 0b000..Divide by 1 - * 0b001..Divide by 2 - * 0b010..Divide by 4 - * 0b011..Divide by 8 - * 0b100..Divide by 16 - * 0b101..Divide by 32 - * 0b110..Divide by 64 - * 0b111..Divide by 128 - */ -#define LPI2C_MCFGR1_PRESCALE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_PRESCALE_SHIFT)) & LPI2C_MCFGR1_PRESCALE_MASK) - -#define LPI2C_MCFGR1_AUTOSTOP_MASK (0x100U) -#define LPI2C_MCFGR1_AUTOSTOP_SHIFT (8U) -/*! AUTOSTOP - Automatic Stop Generation - * 0b0..No effect - * 0b1..Stop automatically generated - */ -#define LPI2C_MCFGR1_AUTOSTOP(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_AUTOSTOP_SHIFT)) & LPI2C_MCFGR1_AUTOSTOP_MASK) - -#define LPI2C_MCFGR1_IGNACK_MASK (0x200U) -#define LPI2C_MCFGR1_IGNACK_SHIFT (9U) -/*! IGNACK - Ignore NACK - * 0b0..No effect - * 0b1..Treat a received NACK as an ACK - */ -#define LPI2C_MCFGR1_IGNACK(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_IGNACK_SHIFT)) & LPI2C_MCFGR1_IGNACK_MASK) - -#define LPI2C_MCFGR1_TIMECFG_MASK (0x400U) -#define LPI2C_MCFGR1_TIMECFG_SHIFT (10U) -/*! TIMECFG - Timeout Configuration - * 0b0..SCL - * 0b1..SCL or SDA - */ -#define LPI2C_MCFGR1_TIMECFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_TIMECFG_SHIFT)) & LPI2C_MCFGR1_TIMECFG_MASK) - -#define LPI2C_MCFGR1_STOPCFG_MASK (0x800U) -#define LPI2C_MCFGR1_STOPCFG_SHIFT (11U) -/*! STOPCFG - Stop Configuration - * 0b0..Any Stop condition - * 0b1..Last Stop condition - */ -#define LPI2C_MCFGR1_STOPCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_STOPCFG_SHIFT)) & LPI2C_MCFGR1_STOPCFG_MASK) - -#define LPI2C_MCFGR1_STARTCFG_MASK (0x1000U) -#define LPI2C_MCFGR1_STARTCFG_SHIFT (12U) -/*! STARTCFG - Start Configuration - * 0b0..Sets when both I2C bus and LPI2C controller are idle - * 0b1..Sets when I2C bus is idle - */ -#define LPI2C_MCFGR1_STARTCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_STARTCFG_SHIFT)) & LPI2C_MCFGR1_STARTCFG_MASK) - -#define LPI2C_MCFGR1_MATCFG_MASK (0x70000U) -#define LPI2C_MCFGR1_MATCFG_SHIFT (16U) -/*! MATCFG - Match Configuration - * 0b000..Match is disabled - * 0b001..Reserved - * 0b010..Match is enabled: first data word equals MDMR[MATCH0] OR MDMR[MATCH1] - * 0b011..Match is enabled: any data word equals MDMR[MATCH0] OR MDMR[MATCH1] - * 0b100..Match is enabled: (first data word equals MDMR[MATCH0]) AND (second data word equals MDMR[MATCH1) - * 0b101..Match is enabled: (any data word equals MDMR[MATCH0]) AND (next data word equals MDMR[MATCH1) - * 0b110..Match is enabled: (first data word AND MDMR[MATCH1]) equals (MDMR[MATCH0] AND MDMR[MATCH1]) - * 0b111..Match is enabled: (any data word AND MDMR[MATCH1]) equals (MDMR[MATCH0] AND MDMR[MATCH1]) - */ -#define LPI2C_MCFGR1_MATCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_MATCFG_SHIFT)) & LPI2C_MCFGR1_MATCFG_MASK) - -#define LPI2C_MCFGR1_PINCFG_MASK (0x7000000U) -#define LPI2C_MCFGR1_PINCFG_SHIFT (24U) -/*! PINCFG - Pin Configuration - * 0b000..Two-pin open drain mode - * 0b001..Two-pin output only mode (Ultra-Fast mode) - * 0b010..Two-pin push-pull mode - * 0b011..Four-pin push-pull mode - * 0b100..Two-pin open-drain mode with separate LPI2C target - * 0b101..Two-pin output only mode (Ultra-Fast mode) with separate LPI2C target - * 0b110..Two-pin push-pull mode with separate LPI2C target - * 0b111..Four-pin push-pull mode (inverted outputs) - */ -#define LPI2C_MCFGR1_PINCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_PINCFG_SHIFT)) & LPI2C_MCFGR1_PINCFG_MASK) -/*! @} */ - -/*! @name MCFGR2 - Controller Configuration 2 */ -/*! @{ */ - -#define LPI2C_MCFGR2_BUSIDLE_MASK (0xFFFU) -#define LPI2C_MCFGR2_BUSIDLE_SHIFT (0U) -/*! BUSIDLE - Bus Idle Timeout */ -#define LPI2C_MCFGR2_BUSIDLE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR2_BUSIDLE_SHIFT)) & LPI2C_MCFGR2_BUSIDLE_MASK) - -#define LPI2C_MCFGR2_FILTSCL_MASK (0xF0000U) -#define LPI2C_MCFGR2_FILTSCL_SHIFT (16U) -/*! FILTSCL - Glitch Filter SCL */ -#define LPI2C_MCFGR2_FILTSCL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR2_FILTSCL_SHIFT)) & LPI2C_MCFGR2_FILTSCL_MASK) - -#define LPI2C_MCFGR2_FILTSDA_MASK (0xF000000U) -#define LPI2C_MCFGR2_FILTSDA_SHIFT (24U) -/*! FILTSDA - Glitch Filter SDA */ -#define LPI2C_MCFGR2_FILTSDA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR2_FILTSDA_SHIFT)) & LPI2C_MCFGR2_FILTSDA_MASK) -/*! @} */ - -/*! @name MCFGR3 - Controller Configuration 3 */ -/*! @{ */ - -#define LPI2C_MCFGR3_PINLOW_MASK (0xFFF00U) -#define LPI2C_MCFGR3_PINLOW_SHIFT (8U) -/*! PINLOW - Pin Low Timeout */ -#define LPI2C_MCFGR3_PINLOW(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR3_PINLOW_SHIFT)) & LPI2C_MCFGR3_PINLOW_MASK) -/*! @} */ - -/*! @name MDMR - Controller Data Match */ -/*! @{ */ - -#define LPI2C_MDMR_MATCH0_MASK (0xFFU) -#define LPI2C_MDMR_MATCH0_SHIFT (0U) -/*! MATCH0 - Match 0 Value */ -#define LPI2C_MDMR_MATCH0(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MDMR_MATCH0_SHIFT)) & LPI2C_MDMR_MATCH0_MASK) - -#define LPI2C_MDMR_MATCH1_MASK (0xFF0000U) -#define LPI2C_MDMR_MATCH1_SHIFT (16U) -/*! MATCH1 - Match 1 Value */ -#define LPI2C_MDMR_MATCH1(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MDMR_MATCH1_SHIFT)) & LPI2C_MDMR_MATCH1_MASK) -/*! @} */ - -/*! @name MCCR0 - Controller Clock Configuration 0 */ -/*! @{ */ - -#define LPI2C_MCCR0_CLKLO_MASK (0x3FU) -#define LPI2C_MCCR0_CLKLO_SHIFT (0U) -/*! CLKLO - Clock Low Period */ -#define LPI2C_MCCR0_CLKLO(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR0_CLKLO_SHIFT)) & LPI2C_MCCR0_CLKLO_MASK) - -#define LPI2C_MCCR0_CLKHI_MASK (0x3F00U) -#define LPI2C_MCCR0_CLKHI_SHIFT (8U) -/*! CLKHI - Clock High Period */ -#define LPI2C_MCCR0_CLKHI(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR0_CLKHI_SHIFT)) & LPI2C_MCCR0_CLKHI_MASK) - -#define LPI2C_MCCR0_SETHOLD_MASK (0x3F0000U) -#define LPI2C_MCCR0_SETHOLD_SHIFT (16U) -/*! SETHOLD - Setup Hold Delay */ -#define LPI2C_MCCR0_SETHOLD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR0_SETHOLD_SHIFT)) & LPI2C_MCCR0_SETHOLD_MASK) - -#define LPI2C_MCCR0_DATAVD_MASK (0x3F000000U) -#define LPI2C_MCCR0_DATAVD_SHIFT (24U) -/*! DATAVD - Data Valid Delay */ -#define LPI2C_MCCR0_DATAVD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR0_DATAVD_SHIFT)) & LPI2C_MCCR0_DATAVD_MASK) -/*! @} */ - -/*! @name MCCR1 - Controller Clock Configuration 1 */ -/*! @{ */ - -#define LPI2C_MCCR1_CLKLO_MASK (0x3FU) -#define LPI2C_MCCR1_CLKLO_SHIFT (0U) -/*! CLKLO - Clock Low Period */ -#define LPI2C_MCCR1_CLKLO(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR1_CLKLO_SHIFT)) & LPI2C_MCCR1_CLKLO_MASK) - -#define LPI2C_MCCR1_CLKHI_MASK (0x3F00U) -#define LPI2C_MCCR1_CLKHI_SHIFT (8U) -/*! CLKHI - Clock High Period */ -#define LPI2C_MCCR1_CLKHI(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR1_CLKHI_SHIFT)) & LPI2C_MCCR1_CLKHI_MASK) - -#define LPI2C_MCCR1_SETHOLD_MASK (0x3F0000U) -#define LPI2C_MCCR1_SETHOLD_SHIFT (16U) -/*! SETHOLD - Setup Hold Delay */ -#define LPI2C_MCCR1_SETHOLD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR1_SETHOLD_SHIFT)) & LPI2C_MCCR1_SETHOLD_MASK) - -#define LPI2C_MCCR1_DATAVD_MASK (0x3F000000U) -#define LPI2C_MCCR1_DATAVD_SHIFT (24U) -/*! DATAVD - Data Valid Delay */ -#define LPI2C_MCCR1_DATAVD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR1_DATAVD_SHIFT)) & LPI2C_MCCR1_DATAVD_MASK) -/*! @} */ - -/*! @name MFCR - Controller FIFO Control */ -/*! @{ */ - -#define LPI2C_MFCR_TXWATER_MASK (0x3U) -#define LPI2C_MFCR_TXWATER_SHIFT (0U) -/*! TXWATER - Transmit FIFO Watermark */ -#define LPI2C_MFCR_TXWATER(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MFCR_TXWATER_SHIFT)) & LPI2C_MFCR_TXWATER_MASK) - -#define LPI2C_MFCR_RXWATER_MASK (0x30000U) -#define LPI2C_MFCR_RXWATER_SHIFT (16U) -/*! RXWATER - Receive FIFO Watermark */ -#define LPI2C_MFCR_RXWATER(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MFCR_RXWATER_SHIFT)) & LPI2C_MFCR_RXWATER_MASK) -/*! @} */ - -/*! @name MFSR - Controller FIFO Status */ -/*! @{ */ - -#define LPI2C_MFSR_TXCOUNT_MASK (0x7U) -#define LPI2C_MFSR_TXCOUNT_SHIFT (0U) -/*! TXCOUNT - Transmit FIFO Count */ -#define LPI2C_MFSR_TXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MFSR_TXCOUNT_SHIFT)) & LPI2C_MFSR_TXCOUNT_MASK) - -#define LPI2C_MFSR_RXCOUNT_MASK (0x70000U) -#define LPI2C_MFSR_RXCOUNT_SHIFT (16U) -/*! RXCOUNT - Receive FIFO Count */ -#define LPI2C_MFSR_RXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MFSR_RXCOUNT_SHIFT)) & LPI2C_MFSR_RXCOUNT_MASK) -/*! @} */ - -/*! @name MTDR - Controller Transmit Data */ -/*! @{ */ - -#define LPI2C_MTDR_DATA_MASK (0xFFU) -#define LPI2C_MTDR_DATA_SHIFT (0U) -/*! DATA - Transmit Data */ -#define LPI2C_MTDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MTDR_DATA_SHIFT)) & LPI2C_MTDR_DATA_MASK) - -#define LPI2C_MTDR_CMD_MASK (0x700U) -#define LPI2C_MTDR_CMD_SHIFT (8U) -/*! CMD - Command Data - * 0b000..Transmit the value in DATA[7:0] - * 0b001..Receive (DATA[7:0] + 1) bytes - * 0b010..Generate Stop condition on I2C bus - * 0b011..Receive and discard (DATA[7:0] + 1) bytes - * 0b100..Generate (repeated) Start on the I2C bus and transmit the address in DATA[7:0] - * 0b101..Generate (repeated) Start on the I2C bus and transmit the address in DATA[7:0] (this transfer expects a NACK to be returned) - * 0b110..Generate (repeated) Start on the I2C bus and transmit the address in DATA[7:0] using HS mode - * 0b111..Generate (repeated) Start on the I2C bus and transmit the address in DATA[7:0] using HS mode (this transfer expects a NACK to be returned) - */ -#define LPI2C_MTDR_CMD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MTDR_CMD_SHIFT)) & LPI2C_MTDR_CMD_MASK) -/*! @} */ - -/*! @name MRDR - Controller Receive Data */ -/*! @{ */ - -#define LPI2C_MRDR_DATA_MASK (0xFFU) -#define LPI2C_MRDR_DATA_SHIFT (0U) -/*! DATA - Receive Data */ -#define LPI2C_MRDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MRDR_DATA_SHIFT)) & LPI2C_MRDR_DATA_MASK) - -#define LPI2C_MRDR_RXEMPTY_MASK (0x4000U) -#define LPI2C_MRDR_RXEMPTY_SHIFT (14U) -/*! RXEMPTY - Receive Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPI2C_MRDR_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MRDR_RXEMPTY_SHIFT)) & LPI2C_MRDR_RXEMPTY_MASK) -/*! @} */ - -/*! @name MRDROR - Controller Receive Data Read Only */ -/*! @{ */ - -#define LPI2C_MRDROR_DATA_MASK (0xFFU) -#define LPI2C_MRDROR_DATA_SHIFT (0U) -/*! DATA - Receive Data */ -#define LPI2C_MRDROR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MRDROR_DATA_SHIFT)) & LPI2C_MRDROR_DATA_MASK) - -#define LPI2C_MRDROR_RXEMPTY_MASK (0x4000U) -#define LPI2C_MRDROR_RXEMPTY_SHIFT (14U) -/*! RXEMPTY - RX Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPI2C_MRDROR_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MRDROR_RXEMPTY_SHIFT)) & LPI2C_MRDROR_RXEMPTY_MASK) -/*! @} */ - -/*! @name SCR - Target Control */ -/*! @{ */ - -#define LPI2C_SCR_SEN_MASK (0x1U) -#define LPI2C_SCR_SEN_SHIFT (0U) -/*! SEN - Target Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCR_SEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCR_SEN_SHIFT)) & LPI2C_SCR_SEN_MASK) - -#define LPI2C_SCR_RST_MASK (0x2U) -#define LPI2C_SCR_RST_SHIFT (1U) -/*! RST - Software Reset - * 0b0..Not reset - * 0b1..Reset - */ -#define LPI2C_SCR_RST(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCR_RST_SHIFT)) & LPI2C_SCR_RST_MASK) - -#define LPI2C_SCR_FILTEN_MASK (0x10U) -#define LPI2C_SCR_FILTEN_SHIFT (4U) -/*! FILTEN - Filter Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCR_FILTEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCR_FILTEN_SHIFT)) & LPI2C_SCR_FILTEN_MASK) - -#define LPI2C_SCR_FILTDZ_MASK (0x20U) -#define LPI2C_SCR_FILTDZ_SHIFT (5U) -/*! FILTDZ - Filter Doze Enable - * 0b0..Enable - * 0b1..Disable - */ -#define LPI2C_SCR_FILTDZ(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCR_FILTDZ_SHIFT)) & LPI2C_SCR_FILTDZ_MASK) - -#define LPI2C_SCR_RTF_MASK (0x100U) -#define LPI2C_SCR_RTF_SHIFT (8U) -/*! RTF - Reset Transmit FIFO - * 0b0..No effect - * 0b1..STDR is now empty - */ -#define LPI2C_SCR_RTF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCR_RTF_SHIFT)) & LPI2C_SCR_RTF_MASK) - -#define LPI2C_SCR_RRF_MASK (0x200U) -#define LPI2C_SCR_RRF_SHIFT (9U) -/*! RRF - Reset Receive FIFO - * 0b0..No effect - * 0b1..SRDR is now empty - */ -#define LPI2C_SCR_RRF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCR_RRF_SHIFT)) & LPI2C_SCR_RRF_MASK) -/*! @} */ - -/*! @name SSR - Target Status */ -/*! @{ */ - -#define LPI2C_SSR_TDF_MASK (0x1U) -#define LPI2C_SSR_TDF_SHIFT (0U) -/*! TDF - Transmit Data Flag - * 0b0..Transmit data not requested - * 0b1..Transmit data is requested - */ -#define LPI2C_SSR_TDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_TDF_SHIFT)) & LPI2C_SSR_TDF_MASK) - -#define LPI2C_SSR_RDF_MASK (0x2U) -#define LPI2C_SSR_RDF_SHIFT (1U) -/*! RDF - Receive Data Flag - * 0b0..Not ready - * 0b1..Ready - */ -#define LPI2C_SSR_RDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_RDF_SHIFT)) & LPI2C_SSR_RDF_MASK) - -#define LPI2C_SSR_AVF_MASK (0x4U) -#define LPI2C_SSR_AVF_SHIFT (2U) -/*! AVF - Address Valid Flag - * 0b0..Not valid - * 0b1..Valid - */ -#define LPI2C_SSR_AVF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_AVF_SHIFT)) & LPI2C_SSR_AVF_MASK) - -#define LPI2C_SSR_TAF_MASK (0x8U) -#define LPI2C_SSR_TAF_SHIFT (3U) -/*! TAF - Transmit ACK Flag - * 0b0..Not required - * 0b1..Required - */ -#define LPI2C_SSR_TAF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_TAF_SHIFT)) & LPI2C_SSR_TAF_MASK) - -#define LPI2C_SSR_RSF_MASK (0x100U) -#define LPI2C_SSR_RSF_SHIFT (8U) -/*! RSF - Repeated Start Flag - * 0b0..No repeated Start detected - * 0b1..Repeated Start detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_SSR_RSF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_RSF_SHIFT)) & LPI2C_SSR_RSF_MASK) - -#define LPI2C_SSR_SDF_MASK (0x200U) -#define LPI2C_SSR_SDF_SHIFT (9U) -/*! SDF - Stop Detect Flag - * 0b0..No Stop detected - * 0b1..Stop detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_SSR_SDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_SDF_SHIFT)) & LPI2C_SSR_SDF_MASK) - -#define LPI2C_SSR_BEF_MASK (0x400U) -#define LPI2C_SSR_BEF_SHIFT (10U) -/*! BEF - Bit Error Flag - * 0b0..No bit error occurred - * 0b1..Bit error occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_SSR_BEF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_BEF_SHIFT)) & LPI2C_SSR_BEF_MASK) - -#define LPI2C_SSR_FEF_MASK (0x800U) -#define LPI2C_SSR_FEF_SHIFT (11U) -/*! FEF - FIFO Error Flag - * 0b0..No FIFO error - * 0b1..FIFO error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_SSR_FEF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_FEF_SHIFT)) & LPI2C_SSR_FEF_MASK) - -#define LPI2C_SSR_AM0F_MASK (0x1000U) -#define LPI2C_SSR_AM0F_SHIFT (12U) -/*! AM0F - Address Match 0 Flag - * 0b0..ADDR0 matching address not received - * 0b1..ADDR0 matching address received - */ -#define LPI2C_SSR_AM0F(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_AM0F_SHIFT)) & LPI2C_SSR_AM0F_MASK) - -#define LPI2C_SSR_AM1F_MASK (0x2000U) -#define LPI2C_SSR_AM1F_SHIFT (13U) -/*! AM1F - Address Match 1 Flag - * 0b0..Matching address not received - * 0b1..Matching address received - */ -#define LPI2C_SSR_AM1F(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_AM1F_SHIFT)) & LPI2C_SSR_AM1F_MASK) - -#define LPI2C_SSR_GCF_MASK (0x4000U) -#define LPI2C_SSR_GCF_SHIFT (14U) -/*! GCF - General Call Flag - * 0b0..General call address disabled or not detected - * 0b1..General call address detected - */ -#define LPI2C_SSR_GCF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_GCF_SHIFT)) & LPI2C_SSR_GCF_MASK) - -#define LPI2C_SSR_SARF_MASK (0x8000U) -#define LPI2C_SSR_SARF_SHIFT (15U) -/*! SARF - SMBus Alert Response Flag - * 0b0..Disabled or not detected - * 0b1..Enabled and detected - */ -#define LPI2C_SSR_SARF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_SARF_SHIFT)) & LPI2C_SSR_SARF_MASK) - -#define LPI2C_SSR_SBF_MASK (0x1000000U) -#define LPI2C_SSR_SBF_SHIFT (24U) -/*! SBF - Target Busy Flag - * 0b0..Idle - * 0b1..Busy - */ -#define LPI2C_SSR_SBF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_SBF_SHIFT)) & LPI2C_SSR_SBF_MASK) - -#define LPI2C_SSR_BBF_MASK (0x2000000U) -#define LPI2C_SSR_BBF_SHIFT (25U) -/*! BBF - Bus Busy Flag - * 0b0..Idle - * 0b1..Busy - */ -#define LPI2C_SSR_BBF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_BBF_SHIFT)) & LPI2C_SSR_BBF_MASK) -/*! @} */ - -/*! @name SIER - Target Interrupt Enable */ -/*! @{ */ - -#define LPI2C_SIER_TDIE_MASK (0x1U) -#define LPI2C_SIER_TDIE_SHIFT (0U) -/*! TDIE - Transmit Data Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_TDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_TDIE_SHIFT)) & LPI2C_SIER_TDIE_MASK) - -#define LPI2C_SIER_RDIE_MASK (0x2U) -#define LPI2C_SIER_RDIE_SHIFT (1U) -/*! RDIE - Receive Data Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_RDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_RDIE_SHIFT)) & LPI2C_SIER_RDIE_MASK) - -#define LPI2C_SIER_AVIE_MASK (0x4U) -#define LPI2C_SIER_AVIE_SHIFT (2U) -/*! AVIE - Address Valid Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_AVIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_AVIE_SHIFT)) & LPI2C_SIER_AVIE_MASK) - -#define LPI2C_SIER_TAIE_MASK (0x8U) -#define LPI2C_SIER_TAIE_SHIFT (3U) -/*! TAIE - Transmit ACK Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_TAIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_TAIE_SHIFT)) & LPI2C_SIER_TAIE_MASK) - -#define LPI2C_SIER_RSIE_MASK (0x100U) -#define LPI2C_SIER_RSIE_SHIFT (8U) -/*! RSIE - Repeated Start Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_RSIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_RSIE_SHIFT)) & LPI2C_SIER_RSIE_MASK) - -#define LPI2C_SIER_SDIE_MASK (0x200U) -#define LPI2C_SIER_SDIE_SHIFT (9U) -/*! SDIE - Stop Detect Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_SDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_SDIE_SHIFT)) & LPI2C_SIER_SDIE_MASK) - -#define LPI2C_SIER_BEIE_MASK (0x400U) -#define LPI2C_SIER_BEIE_SHIFT (10U) -/*! BEIE - Bit Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_BEIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_BEIE_SHIFT)) & LPI2C_SIER_BEIE_MASK) - -#define LPI2C_SIER_FEIE_MASK (0x800U) -#define LPI2C_SIER_FEIE_SHIFT (11U) -/*! FEIE - FIFO Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_FEIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_FEIE_SHIFT)) & LPI2C_SIER_FEIE_MASK) - -#define LPI2C_SIER_AM0IE_MASK (0x1000U) -#define LPI2C_SIER_AM0IE_SHIFT (12U) -/*! AM0IE - Address Match 0 Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_AM0IE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_AM0IE_SHIFT)) & LPI2C_SIER_AM0IE_MASK) - -#define LPI2C_SIER_AM1IE_MASK (0x2000U) -#define LPI2C_SIER_AM1IE_SHIFT (13U) -/*! AM1IE - Address Match 1 Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_AM1IE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_AM1IE_SHIFT)) & LPI2C_SIER_AM1IE_MASK) - -#define LPI2C_SIER_GCIE_MASK (0x4000U) -#define LPI2C_SIER_GCIE_SHIFT (14U) -/*! GCIE - General Call Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define LPI2C_SIER_GCIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_GCIE_SHIFT)) & LPI2C_SIER_GCIE_MASK) - -#define LPI2C_SIER_SARIE_MASK (0x8000U) -#define LPI2C_SIER_SARIE_SHIFT (15U) -/*! SARIE - SMBus Alert Response Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_SARIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_SARIE_SHIFT)) & LPI2C_SIER_SARIE_MASK) -/*! @} */ - -/*! @name SDER - Target DMA Enable */ -/*! @{ */ - -#define LPI2C_SDER_TDDE_MASK (0x1U) -#define LPI2C_SDER_TDDE_SHIFT (0U) -/*! TDDE - Transmit Data DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SDER_TDDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SDER_TDDE_SHIFT)) & LPI2C_SDER_TDDE_MASK) - -#define LPI2C_SDER_RDDE_MASK (0x2U) -#define LPI2C_SDER_RDDE_SHIFT (1U) -/*! RDDE - Receive Data DMA Enable - * 0b0..Disable DMA request - * 0b1..Enable DMA request - */ -#define LPI2C_SDER_RDDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SDER_RDDE_SHIFT)) & LPI2C_SDER_RDDE_MASK) - -#define LPI2C_SDER_AVDE_MASK (0x4U) -#define LPI2C_SDER_AVDE_SHIFT (2U) -/*! AVDE - Address Valid DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SDER_AVDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SDER_AVDE_SHIFT)) & LPI2C_SDER_AVDE_MASK) - -#define LPI2C_SDER_RSDE_MASK (0x100U) -#define LPI2C_SDER_RSDE_SHIFT (8U) -/*! RSDE - Repeated Start DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SDER_RSDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SDER_RSDE_SHIFT)) & LPI2C_SDER_RSDE_MASK) - -#define LPI2C_SDER_SDDE_MASK (0x200U) -#define LPI2C_SDER_SDDE_SHIFT (9U) -/*! SDDE - Stop Detect DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SDER_SDDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SDER_SDDE_SHIFT)) & LPI2C_SDER_SDDE_MASK) -/*! @} */ - -/*! @name SCFGR0 - Target Configuration 0 */ -/*! @{ */ - -#define LPI2C_SCFGR0_RDREQ_MASK (0x1U) -#define LPI2C_SCFGR0_RDREQ_SHIFT (0U) -/*! RDREQ - Read Request - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR0_RDREQ(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR0_RDREQ_SHIFT)) & LPI2C_SCFGR0_RDREQ_MASK) - -#define LPI2C_SCFGR0_RDACK_MASK (0x2U) -#define LPI2C_SCFGR0_RDACK_SHIFT (1U) -/*! RDACK - Read Acknowledge Flag - * 0b0..Read Request not acknowledged - * 0b1..Read Request acknowledged - */ -#define LPI2C_SCFGR0_RDACK(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR0_RDACK_SHIFT)) & LPI2C_SCFGR0_RDACK_MASK) -/*! @} */ - -/*! @name SCFGR1 - Target Configuration 1 */ -/*! @{ */ - -#define LPI2C_SCFGR1_ADRSTALL_MASK (0x1U) -#define LPI2C_SCFGR1_ADRSTALL_SHIFT (0U) -/*! ADRSTALL - Address SCL Stall - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_ADRSTALL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_ADRSTALL_SHIFT)) & LPI2C_SCFGR1_ADRSTALL_MASK) - -#define LPI2C_SCFGR1_RXSTALL_MASK (0x2U) -#define LPI2C_SCFGR1_RXSTALL_SHIFT (1U) -/*! RXSTALL - RX SCL Stall - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_RXSTALL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_RXSTALL_SHIFT)) & LPI2C_SCFGR1_RXSTALL_MASK) - -#define LPI2C_SCFGR1_TXDSTALL_MASK (0x4U) -#define LPI2C_SCFGR1_TXDSTALL_SHIFT (2U) -/*! TXDSTALL - Transmit Data SCL Stall - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_TXDSTALL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_TXDSTALL_SHIFT)) & LPI2C_SCFGR1_TXDSTALL_MASK) - -#define LPI2C_SCFGR1_ACKSTALL_MASK (0x8U) -#define LPI2C_SCFGR1_ACKSTALL_SHIFT (3U) -/*! ACKSTALL - ACK SCL Stall - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_ACKSTALL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_ACKSTALL_SHIFT)) & LPI2C_SCFGR1_ACKSTALL_MASK) - -#define LPI2C_SCFGR1_RXNACK_MASK (0x10U) -#define LPI2C_SCFGR1_RXNACK_SHIFT (4U) -/*! RXNACK - Receive NACK - * 0b0..ACK or NACK always determined by STAR[TXNACK] - * 0b1..NACK always generated on address overrun or receive data overrun, otherwise ACK or NACK is determined by STAR[TXNACK] - */ -#define LPI2C_SCFGR1_RXNACK(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_RXNACK_SHIFT)) & LPI2C_SCFGR1_RXNACK_MASK) - -#define LPI2C_SCFGR1_GCEN_MASK (0x100U) -#define LPI2C_SCFGR1_GCEN_SHIFT (8U) -/*! GCEN - General Call Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_GCEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_GCEN_SHIFT)) & LPI2C_SCFGR1_GCEN_MASK) - -#define LPI2C_SCFGR1_SAEN_MASK (0x200U) -#define LPI2C_SCFGR1_SAEN_SHIFT (9U) -/*! SAEN - SMBus Alert Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_SAEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_SAEN_SHIFT)) & LPI2C_SCFGR1_SAEN_MASK) - -#define LPI2C_SCFGR1_TXCFG_MASK (0x400U) -#define LPI2C_SCFGR1_TXCFG_SHIFT (10U) -/*! TXCFG - Transmit Flag Configuration - * 0b0..MSR[TDF] is set only during a target-transmit transfer when STDR is empty - * 0b1..MSR[TDF] is set whenever STDR is empty - */ -#define LPI2C_SCFGR1_TXCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_TXCFG_SHIFT)) & LPI2C_SCFGR1_TXCFG_MASK) - -#define LPI2C_SCFGR1_RXCFG_MASK (0x800U) -#define LPI2C_SCFGR1_RXCFG_SHIFT (11U) -/*! RXCFG - Receive Data Configuration - * 0b0..Return received data, clear MSR[RDF] - * 0b1..Return SASR and clear SSR[AVF] when SSR[AVF] is set, return received data and clear MSR[RDF] when SSR[AFV] is not set - */ -#define LPI2C_SCFGR1_RXCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_RXCFG_SHIFT)) & LPI2C_SCFGR1_RXCFG_MASK) - -#define LPI2C_SCFGR1_IGNACK_MASK (0x1000U) -#define LPI2C_SCFGR1_IGNACK_SHIFT (12U) -/*! IGNACK - Ignore NACK - * 0b0..End transfer on NACK - * 0b1..Do not end transfer on NACK - */ -#define LPI2C_SCFGR1_IGNACK(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_IGNACK_SHIFT)) & LPI2C_SCFGR1_IGNACK_MASK) - -#define LPI2C_SCFGR1_HSMEN_MASK (0x2000U) -#define LPI2C_SCFGR1_HSMEN_SHIFT (13U) -/*! HSMEN - HS Mode Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_HSMEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_HSMEN_SHIFT)) & LPI2C_SCFGR1_HSMEN_MASK) - -#define LPI2C_SCFGR1_ADDRCFG_MASK (0x70000U) -#define LPI2C_SCFGR1_ADDRCFG_SHIFT (16U) -/*! ADDRCFG - Address Configuration - * 0b000..Address match 0 (7-bit) - * 0b001..Address match 0 (10-bit) - * 0b010..Address match 0 (7-bit) or address match 1 (7-bit) - * 0b011..Address match 0 (10-bit) or address match 1 (10-bit) - * 0b100..Address match 0 (7-bit) or address match 1 (10-bit) - * 0b101..Address match 0 (10-bit) or address match 1 (7-bit) - * 0b110..From address match 0 (7-bit) to address match 1 (7-bit) - * 0b111..From address match 0 (10-bit) to address match 1 (10-bit) - */ -#define LPI2C_SCFGR1_ADDRCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_ADDRCFG_SHIFT)) & LPI2C_SCFGR1_ADDRCFG_MASK) - -#define LPI2C_SCFGR1_RXALL_MASK (0x1000000U) -#define LPI2C_SCFGR1_RXALL_SHIFT (24U) -/*! RXALL - Receive All - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_RXALL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_RXALL_SHIFT)) & LPI2C_SCFGR1_RXALL_MASK) - -#define LPI2C_SCFGR1_RSCFG_MASK (0x2000000U) -#define LPI2C_SCFGR1_RSCFG_SHIFT (25U) -/*! RSCFG - Repeated Start Configuration - * 0b0..Any repeated Start condition following an address match - * 0b1..Any repeated Start condition - */ -#define LPI2C_SCFGR1_RSCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_RSCFG_SHIFT)) & LPI2C_SCFGR1_RSCFG_MASK) - -#define LPI2C_SCFGR1_SDCFG_MASK (0x4000000U) -#define LPI2C_SCFGR1_SDCFG_SHIFT (26U) -/*! SDCFG - Stop Detect Configuration - * 0b0..Any Stop condition following an address match - * 0b1..Any Stop condition - */ -#define LPI2C_SCFGR1_SDCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_SDCFG_SHIFT)) & LPI2C_SCFGR1_SDCFG_MASK) -/*! @} */ - -/*! @name SCFGR2 - Target Configuration 2 */ -/*! @{ */ - -#define LPI2C_SCFGR2_CLKHOLD_MASK (0xFU) -#define LPI2C_SCFGR2_CLKHOLD_SHIFT (0U) -/*! CLKHOLD - Clock Hold Time */ -#define LPI2C_SCFGR2_CLKHOLD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR2_CLKHOLD_SHIFT)) & LPI2C_SCFGR2_CLKHOLD_MASK) - -#define LPI2C_SCFGR2_DATAVD_MASK (0x3F00U) -#define LPI2C_SCFGR2_DATAVD_SHIFT (8U) -/*! DATAVD - Data Valid Delay */ -#define LPI2C_SCFGR2_DATAVD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR2_DATAVD_SHIFT)) & LPI2C_SCFGR2_DATAVD_MASK) - -#define LPI2C_SCFGR2_FILTSCL_MASK (0xF0000U) -#define LPI2C_SCFGR2_FILTSCL_SHIFT (16U) -/*! FILTSCL - Glitch Filter SCL */ -#define LPI2C_SCFGR2_FILTSCL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR2_FILTSCL_SHIFT)) & LPI2C_SCFGR2_FILTSCL_MASK) - -#define LPI2C_SCFGR2_FILTSDA_MASK (0xF000000U) -#define LPI2C_SCFGR2_FILTSDA_SHIFT (24U) -/*! FILTSDA - Glitch Filter SDA */ -#define LPI2C_SCFGR2_FILTSDA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR2_FILTSDA_SHIFT)) & LPI2C_SCFGR2_FILTSDA_MASK) -/*! @} */ - -/*! @name SAMR - Target Address Match */ -/*! @{ */ - -#define LPI2C_SAMR_ADDR0_MASK (0x7FEU) -#define LPI2C_SAMR_ADDR0_SHIFT (1U) -/*! ADDR0 - Address 0 Value */ -#define LPI2C_SAMR_ADDR0(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SAMR_ADDR0_SHIFT)) & LPI2C_SAMR_ADDR0_MASK) - -#define LPI2C_SAMR_ADDR1_MASK (0x7FE0000U) -#define LPI2C_SAMR_ADDR1_SHIFT (17U) -/*! ADDR1 - Address 1 Value */ -#define LPI2C_SAMR_ADDR1(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SAMR_ADDR1_SHIFT)) & LPI2C_SAMR_ADDR1_MASK) -/*! @} */ - -/*! @name SASR - Target Address Status */ -/*! @{ */ - -#define LPI2C_SASR_RADDR_MASK (0x7FFU) -#define LPI2C_SASR_RADDR_SHIFT (0U) -/*! RADDR - Received Address */ -#define LPI2C_SASR_RADDR(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SASR_RADDR_SHIFT)) & LPI2C_SASR_RADDR_MASK) - -#define LPI2C_SASR_ANV_MASK (0x4000U) -#define LPI2C_SASR_ANV_SHIFT (14U) -/*! ANV - Address Not Valid - * 0b0..Valid - * 0b1..Not valid - */ -#define LPI2C_SASR_ANV(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SASR_ANV_SHIFT)) & LPI2C_SASR_ANV_MASK) -/*! @} */ - -/*! @name STAR - Target Transmit ACK */ -/*! @{ */ - -#define LPI2C_STAR_TXNACK_MASK (0x1U) -#define LPI2C_STAR_TXNACK_SHIFT (0U) -/*! TXNACK - Transmit NACK - * 0b0..Transmit ACK - * 0b1..Transmit NACK - */ -#define LPI2C_STAR_TXNACK(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_STAR_TXNACK_SHIFT)) & LPI2C_STAR_TXNACK_MASK) -/*! @} */ - -/*! @name STDR - Target Transmit Data */ -/*! @{ */ - -#define LPI2C_STDR_DATA_MASK (0xFFU) -#define LPI2C_STDR_DATA_SHIFT (0U) -/*! DATA - Transmit Data */ -#define LPI2C_STDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_STDR_DATA_SHIFT)) & LPI2C_STDR_DATA_MASK) -/*! @} */ - -/*! @name SRDR - Target Receive Data */ -/*! @{ */ - -#define LPI2C_SRDR_DATA_MASK (0xFFU) -#define LPI2C_SRDR_DATA_SHIFT (0U) -/*! DATA - Received Data */ -#define LPI2C_SRDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDR_DATA_SHIFT)) & LPI2C_SRDR_DATA_MASK) - -#define LPI2C_SRDR_RADDR_MASK (0x700U) -#define LPI2C_SRDR_RADDR_SHIFT (8U) -/*! RADDR - Received Address */ -#define LPI2C_SRDR_RADDR(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDR_RADDR_SHIFT)) & LPI2C_SRDR_RADDR_MASK) - -#define LPI2C_SRDR_RXEMPTY_MASK (0x4000U) -#define LPI2C_SRDR_RXEMPTY_SHIFT (14U) -/*! RXEMPTY - Receive Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPI2C_SRDR_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDR_RXEMPTY_SHIFT)) & LPI2C_SRDR_RXEMPTY_MASK) - -#define LPI2C_SRDR_SOF_MASK (0x8000U) -#define LPI2C_SRDR_SOF_SHIFT (15U) -/*! SOF - Start of Frame - * 0b0..Not first - * 0b1..First - */ -#define LPI2C_SRDR_SOF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDR_SOF_SHIFT)) & LPI2C_SRDR_SOF_MASK) -/*! @} */ - -/*! @name SRDROR - Target Receive Data Read Only */ -/*! @{ */ - -#define LPI2C_SRDROR_DATA_MASK (0xFFU) -#define LPI2C_SRDROR_DATA_SHIFT (0U) -/*! DATA - Receive Data */ -#define LPI2C_SRDROR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDROR_DATA_SHIFT)) & LPI2C_SRDROR_DATA_MASK) - -#define LPI2C_SRDROR_RADDR_MASK (0x700U) -#define LPI2C_SRDROR_RADDR_SHIFT (8U) -/*! RADDR - Received Address */ -#define LPI2C_SRDROR_RADDR(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDROR_RADDR_SHIFT)) & LPI2C_SRDROR_RADDR_MASK) - -#define LPI2C_SRDROR_RXEMPTY_MASK (0x4000U) -#define LPI2C_SRDROR_RXEMPTY_SHIFT (14U) -/*! RXEMPTY - Receive Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPI2C_SRDROR_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDROR_RXEMPTY_SHIFT)) & LPI2C_SRDROR_RXEMPTY_MASK) - -#define LPI2C_SRDROR_SOF_MASK (0x8000U) -#define LPI2C_SRDROR_SOF_SHIFT (15U) -/*! SOF - Start of Frame - * 0b0..Not the first - * 0b1..First - */ -#define LPI2C_SRDROR_SOF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDROR_SOF_SHIFT)) & LPI2C_SRDROR_SOF_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group LPI2C_Register_Masks */ - - -/* LPI2C - Peripheral instance base addresses */ -/** Peripheral LPI2C0 base address */ -#define LPI2C0_BASE (0x4009A000u) -/** Peripheral LPI2C0 base pointer */ -#define LPI2C0 ((LPI2C_Type *)LPI2C0_BASE) -/** Array initializer of LPI2C peripheral base addresses */ -#define LPI2C_BASE_ADDRS { LPI2C0_BASE } -/** Array initializer of LPI2C peripheral base pointers */ -#define LPI2C_BASE_PTRS { LPI2C0 } -/** Interrupt vectors for the LPI2C peripheral type */ -#define LPI2C_IRQS { LPI2C0_IRQn } - -/*! - * @} - */ /* end of group LPI2C_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LPSPI Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPSPI_Peripheral_Access_Layer LPSPI Peripheral Access Layer - * @{ - */ - -/** LPSPI - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - uint8_t RESERVED_0[8]; - __IO uint32_t CR; /**< Control, offset: 0x10 */ - __IO uint32_t SR; /**< Status, offset: 0x14 */ - __IO uint32_t IER; /**< Interrupt Enable, offset: 0x18 */ - __IO uint32_t DER; /**< DMA Enable, offset: 0x1C */ - __IO uint32_t CFGR0; /**< Configuration 0, offset: 0x20 */ - __IO uint32_t CFGR1; /**< Configuration 1, offset: 0x24 */ - uint8_t RESERVED_1[8]; - __IO uint32_t DMR0; /**< Data Match 0, offset: 0x30 */ - __IO uint32_t DMR1; /**< Data Match 1, offset: 0x34 */ - uint8_t RESERVED_2[8]; - __IO uint32_t CCR; /**< Clock Configuration, offset: 0x40 */ - __IO uint32_t CCR1; /**< Clock Configuration 1, offset: 0x44 */ - uint8_t RESERVED_3[16]; - __IO uint32_t FCR; /**< FIFO Control, offset: 0x58 */ - __I uint32_t FSR; /**< FIFO Status, offset: 0x5C */ - __IO uint32_t TCR; /**< Transmit Command, offset: 0x60 */ - __O uint32_t TDR; /**< Transmit Data, offset: 0x64 */ - uint8_t RESERVED_4[8]; - __I uint32_t RSR; /**< Receive Status, offset: 0x70 */ - __I uint32_t RDR; /**< Receive Data, offset: 0x74 */ - __I uint32_t RDROR; /**< Receive Data Read Only, offset: 0x78 */ - uint8_t RESERVED_5[896]; - __O uint32_t TCBR; /**< Transmit Command Burst, offset: 0x3FC */ - __O uint32_t TDBR[128]; /**< Transmit Data Burst, array offset: 0x400, array step: 0x4 */ - __I uint32_t RDBR[128]; /**< Receive Data Burst, array offset: 0x600, array step: 0x4 */ -} LPSPI_Type; - -/* ---------------------------------------------------------------------------- - -- LPSPI Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPSPI_Register_Masks LPSPI Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define LPSPI_VERID_FEATURE_MASK (0xFFFFU) -#define LPSPI_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Module Identification Number - * 0b0000000000000100..Standard feature set supporting a 32-bit shift register. - * *.. - */ -#define LPSPI_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_VERID_FEATURE_SHIFT)) & LPSPI_VERID_FEATURE_MASK) - -#define LPSPI_VERID_MINOR_MASK (0xFF0000U) -#define LPSPI_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define LPSPI_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_VERID_MINOR_SHIFT)) & LPSPI_VERID_MINOR_MASK) - -#define LPSPI_VERID_MAJOR_MASK (0xFF000000U) -#define LPSPI_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define LPSPI_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_VERID_MAJOR_SHIFT)) & LPSPI_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define LPSPI_PARAM_TXFIFO_MASK (0xFFU) -#define LPSPI_PARAM_TXFIFO_SHIFT (0U) -/*! TXFIFO - Transmit FIFO Size */ -#define LPSPI_PARAM_TXFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_PARAM_TXFIFO_SHIFT)) & LPSPI_PARAM_TXFIFO_MASK) - -#define LPSPI_PARAM_RXFIFO_MASK (0xFF00U) -#define LPSPI_PARAM_RXFIFO_SHIFT (8U) -/*! RXFIFO - Receive FIFO Size */ -#define LPSPI_PARAM_RXFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_PARAM_RXFIFO_SHIFT)) & LPSPI_PARAM_RXFIFO_MASK) - -#define LPSPI_PARAM_PCSNUM_MASK (0xFF0000U) -#define LPSPI_PARAM_PCSNUM_SHIFT (16U) -/*! PCSNUM - PCS Number */ -#define LPSPI_PARAM_PCSNUM(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_PARAM_PCSNUM_SHIFT)) & LPSPI_PARAM_PCSNUM_MASK) -/*! @} */ - -/*! @name CR - Control */ -/*! @{ */ - -#define LPSPI_CR_MEN_MASK (0x1U) -#define LPSPI_CR_MEN_SHIFT (0U) -/*! MEN - Module Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CR_MEN(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CR_MEN_SHIFT)) & LPSPI_CR_MEN_MASK) - -#define LPSPI_CR_RST_MASK (0x2U) -#define LPSPI_CR_RST_SHIFT (1U) -/*! RST - Software Reset - * 0b0..Not reset - * 0b1..Reset - */ -#define LPSPI_CR_RST(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CR_RST_SHIFT)) & LPSPI_CR_RST_MASK) - -#define LPSPI_CR_DBGEN_MASK (0x8U) -#define LPSPI_CR_DBGEN_SHIFT (3U) -/*! DBGEN - Debug Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CR_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CR_DBGEN_SHIFT)) & LPSPI_CR_DBGEN_MASK) - -#define LPSPI_CR_RTF_MASK (0x100U) -#define LPSPI_CR_RTF_SHIFT (8U) -/*! RTF - Reset Transmit FIFO - * 0b0..No effect - * 0b1..Reset - */ -#define LPSPI_CR_RTF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CR_RTF_SHIFT)) & LPSPI_CR_RTF_MASK) - -#define LPSPI_CR_RRF_MASK (0x200U) -#define LPSPI_CR_RRF_SHIFT (9U) -/*! RRF - Reset Receive FIFO - * 0b0..No effect - * 0b1..Reset - */ -#define LPSPI_CR_RRF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CR_RRF_SHIFT)) & LPSPI_CR_RRF_MASK) -/*! @} */ - -/*! @name SR - Status */ -/*! @{ */ - -#define LPSPI_SR_TDF_MASK (0x1U) -#define LPSPI_SR_TDF_SHIFT (0U) -/*! TDF - Transmit Data Flag - * 0b0..Transmit data not requested - * 0b1..Transmit data requested - */ -#define LPSPI_SR_TDF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_TDF_SHIFT)) & LPSPI_SR_TDF_MASK) - -#define LPSPI_SR_RDF_MASK (0x2U) -#define LPSPI_SR_RDF_SHIFT (1U) -/*! RDF - Receive Data Flag - * 0b0..Receive data not ready - * 0b1..Receive data ready - */ -#define LPSPI_SR_RDF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_RDF_SHIFT)) & LPSPI_SR_RDF_MASK) - -#define LPSPI_SR_WCF_MASK (0x100U) -#define LPSPI_SR_WCF_SHIFT (8U) -/*! WCF - Word Complete Flag - * 0b0..Not complete - * 0b1..Complete - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPSPI_SR_WCF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_WCF_SHIFT)) & LPSPI_SR_WCF_MASK) - -#define LPSPI_SR_FCF_MASK (0x200U) -#define LPSPI_SR_FCF_SHIFT (9U) -/*! FCF - Frame Complete Flag - * 0b0..Not complete - * 0b1..Complete - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPSPI_SR_FCF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_FCF_SHIFT)) & LPSPI_SR_FCF_MASK) - -#define LPSPI_SR_TCF_MASK (0x400U) -#define LPSPI_SR_TCF_SHIFT (10U) -/*! TCF - Transfer Complete Flag - * 0b0..Not complete - * 0b1..Complete - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPSPI_SR_TCF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_TCF_SHIFT)) & LPSPI_SR_TCF_MASK) - -#define LPSPI_SR_TEF_MASK (0x800U) -#define LPSPI_SR_TEF_SHIFT (11U) -/*! TEF - Transmit Error Flag - * 0b0..No underrun - * 0b1..Underrun - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPSPI_SR_TEF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_TEF_SHIFT)) & LPSPI_SR_TEF_MASK) - -#define LPSPI_SR_REF_MASK (0x1000U) -#define LPSPI_SR_REF_SHIFT (12U) -/*! REF - Receive Error Flag - * 0b0..No overflow - * 0b1..Overflow - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPSPI_SR_REF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_REF_SHIFT)) & LPSPI_SR_REF_MASK) - -#define LPSPI_SR_DMF_MASK (0x2000U) -#define LPSPI_SR_DMF_SHIFT (13U) -/*! DMF - Data Match Flag - * 0b0..No match - * 0b1..Match - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPSPI_SR_DMF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_DMF_SHIFT)) & LPSPI_SR_DMF_MASK) - -#define LPSPI_SR_MBF_MASK (0x1000000U) -#define LPSPI_SR_MBF_SHIFT (24U) -/*! MBF - Module Busy Flag - * 0b0..LPSPI is idle - * 0b1..LPSPI is busy - */ -#define LPSPI_SR_MBF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_MBF_SHIFT)) & LPSPI_SR_MBF_MASK) -/*! @} */ - -/*! @name IER - Interrupt Enable */ -/*! @{ */ - -#define LPSPI_IER_TDIE_MASK (0x1U) -#define LPSPI_IER_TDIE_SHIFT (0U) -/*! TDIE - Transmit Data Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_TDIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_TDIE_SHIFT)) & LPSPI_IER_TDIE_MASK) - -#define LPSPI_IER_RDIE_MASK (0x2U) -#define LPSPI_IER_RDIE_SHIFT (1U) -/*! RDIE - Receive Data Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_RDIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_RDIE_SHIFT)) & LPSPI_IER_RDIE_MASK) - -#define LPSPI_IER_WCIE_MASK (0x100U) -#define LPSPI_IER_WCIE_SHIFT (8U) -/*! WCIE - Word Complete Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_WCIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_WCIE_SHIFT)) & LPSPI_IER_WCIE_MASK) - -#define LPSPI_IER_FCIE_MASK (0x200U) -#define LPSPI_IER_FCIE_SHIFT (9U) -/*! FCIE - Frame Complete Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_FCIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_FCIE_SHIFT)) & LPSPI_IER_FCIE_MASK) - -#define LPSPI_IER_TCIE_MASK (0x400U) -#define LPSPI_IER_TCIE_SHIFT (10U) -/*! TCIE - Transfer Complete Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_TCIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_TCIE_SHIFT)) & LPSPI_IER_TCIE_MASK) - -#define LPSPI_IER_TEIE_MASK (0x800U) -#define LPSPI_IER_TEIE_SHIFT (11U) -/*! TEIE - Transmit Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_TEIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_TEIE_SHIFT)) & LPSPI_IER_TEIE_MASK) - -#define LPSPI_IER_REIE_MASK (0x1000U) -#define LPSPI_IER_REIE_SHIFT (12U) -/*! REIE - Receive Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_REIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_REIE_SHIFT)) & LPSPI_IER_REIE_MASK) - -#define LPSPI_IER_DMIE_MASK (0x2000U) -#define LPSPI_IER_DMIE_SHIFT (13U) -/*! DMIE - Data Match Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_DMIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_DMIE_SHIFT)) & LPSPI_IER_DMIE_MASK) -/*! @} */ - -/*! @name DER - DMA Enable */ -/*! @{ */ - -#define LPSPI_DER_TDDE_MASK (0x1U) -#define LPSPI_DER_TDDE_SHIFT (0U) -/*! TDDE - Transmit Data DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_DER_TDDE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_DER_TDDE_SHIFT)) & LPSPI_DER_TDDE_MASK) - -#define LPSPI_DER_RDDE_MASK (0x2U) -#define LPSPI_DER_RDDE_SHIFT (1U) -/*! RDDE - Receive Data DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_DER_RDDE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_DER_RDDE_SHIFT)) & LPSPI_DER_RDDE_MASK) - -#define LPSPI_DER_FCDE_MASK (0x200U) -#define LPSPI_DER_FCDE_SHIFT (9U) -/*! FCDE - Frame Complete DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_DER_FCDE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_DER_FCDE_SHIFT)) & LPSPI_DER_FCDE_MASK) -/*! @} */ - -/*! @name CFGR0 - Configuration 0 */ -/*! @{ */ - -#define LPSPI_CFGR0_HREN_MASK (0x1U) -#define LPSPI_CFGR0_HREN_SHIFT (0U) -/*! HREN - Host Request Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CFGR0_HREN(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR0_HREN_SHIFT)) & LPSPI_CFGR0_HREN_MASK) - -#define LPSPI_CFGR0_HRPOL_MASK (0x2U) -#define LPSPI_CFGR0_HRPOL_SHIFT (1U) -/*! HRPOL - Host Request Polarity - * 0b0..Active high - * 0b1..Active low - */ -#define LPSPI_CFGR0_HRPOL(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR0_HRPOL_SHIFT)) & LPSPI_CFGR0_HRPOL_MASK) - -#define LPSPI_CFGR0_HRSEL_MASK (0x4U) -#define LPSPI_CFGR0_HRSEL_SHIFT (2U) -/*! HRSEL - Host Request Select - * 0b0..HREQ pin - * 0b1..Input trigger - */ -#define LPSPI_CFGR0_HRSEL(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR0_HRSEL_SHIFT)) & LPSPI_CFGR0_HRSEL_MASK) - -#define LPSPI_CFGR0_HRDIR_MASK (0x8U) -#define LPSPI_CFGR0_HRDIR_SHIFT (3U) -/*! HRDIR - Host Request Direction - * 0b0..Input - * 0b1..Output - */ -#define LPSPI_CFGR0_HRDIR(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR0_HRDIR_SHIFT)) & LPSPI_CFGR0_HRDIR_MASK) - -#define LPSPI_CFGR0_CIRFIFO_MASK (0x100U) -#define LPSPI_CFGR0_CIRFIFO_SHIFT (8U) -/*! CIRFIFO - Circular FIFO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CFGR0_CIRFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR0_CIRFIFO_SHIFT)) & LPSPI_CFGR0_CIRFIFO_MASK) - -#define LPSPI_CFGR0_RDMO_MASK (0x200U) -#define LPSPI_CFGR0_RDMO_SHIFT (9U) -/*! RDMO - Receive Data Match Only - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CFGR0_RDMO(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR0_RDMO_SHIFT)) & LPSPI_CFGR0_RDMO_MASK) -/*! @} */ - -/*! @name CFGR1 - Configuration 1 */ -/*! @{ */ - -#define LPSPI_CFGR1_MASTER_MASK (0x1U) -#define LPSPI_CFGR1_MASTER_SHIFT (0U) -/*! MASTER - Master Mode - * 0b0..Slave mode - * 0b1..Master mode - */ -#define LPSPI_CFGR1_MASTER(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_MASTER_SHIFT)) & LPSPI_CFGR1_MASTER_MASK) - -#define LPSPI_CFGR1_SAMPLE_MASK (0x2U) -#define LPSPI_CFGR1_SAMPLE_SHIFT (1U) -/*! SAMPLE - Sample Point - * 0b0..SCK edge - * 0b1..Delayed SCK edge - */ -#define LPSPI_CFGR1_SAMPLE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_SAMPLE_SHIFT)) & LPSPI_CFGR1_SAMPLE_MASK) - -#define LPSPI_CFGR1_AUTOPCS_MASK (0x4U) -#define LPSPI_CFGR1_AUTOPCS_SHIFT (2U) -/*! AUTOPCS - Automatic PCS - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CFGR1_AUTOPCS(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_AUTOPCS_SHIFT)) & LPSPI_CFGR1_AUTOPCS_MASK) - -#define LPSPI_CFGR1_NOSTALL_MASK (0x8U) -#define LPSPI_CFGR1_NOSTALL_SHIFT (3U) -/*! NOSTALL - No Stall - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CFGR1_NOSTALL(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_NOSTALL_SHIFT)) & LPSPI_CFGR1_NOSTALL_MASK) - -#define LPSPI_CFGR1_PARTIAL_MASK (0x10U) -#define LPSPI_CFGR1_PARTIAL_SHIFT (4U) -/*! PARTIAL - Partial Enable - * 0b0..Discard - * 0b1..Store - */ -#define LPSPI_CFGR1_PARTIAL(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_PARTIAL_SHIFT)) & LPSPI_CFGR1_PARTIAL_MASK) - -#define LPSPI_CFGR1_PCSPOL_MASK (0xF00U) -#define LPSPI_CFGR1_PCSPOL_SHIFT (8U) -/*! PCSPOL - Peripheral Chip Select Polarity - * 0b0000..Active low - * 0b0001..Active high - */ -#define LPSPI_CFGR1_PCSPOL(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_PCSPOL_SHIFT)) & LPSPI_CFGR1_PCSPOL_MASK) - -#define LPSPI_CFGR1_MATCFG_MASK (0x70000U) -#define LPSPI_CFGR1_MATCFG_SHIFT (16U) -/*! MATCFG - Match Configuration - * 0b000..Match is disabled - * 0b001.. - * 0b010..Match first data word with compare word - * 0b011..Match any data word with compare word - * 0b100..Sequential match, first data word - * 0b101..Sequential match, any data word - * 0b110..Match first data word (masked) with compare word (masked) - * 0b111..Match any data word (masked) with compare word (masked) - */ -#define LPSPI_CFGR1_MATCFG(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_MATCFG_SHIFT)) & LPSPI_CFGR1_MATCFG_MASK) - -#define LPSPI_CFGR1_PINCFG_MASK (0x3000000U) -#define LPSPI_CFGR1_PINCFG_SHIFT (24U) -/*! PINCFG - Pin Configuration - * 0b00..SIN is used for input data; SOUT is used for output data - * 0b01..SIN is used for both input and output data; only half-duplex serial transfers are supported - * 0b10..SOUT is used for both input and output data; only half-duplex serial transfers are supported - * 0b11..SOUT is used for input data; SIN is used for output data - */ -#define LPSPI_CFGR1_PINCFG(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_PINCFG_SHIFT)) & LPSPI_CFGR1_PINCFG_MASK) - -#define LPSPI_CFGR1_OUTCFG_MASK (0x4000000U) -#define LPSPI_CFGR1_OUTCFG_SHIFT (26U) -/*! OUTCFG - Output Configuration - * 0b0..Retain last value - * 0b1..3-stated - */ -#define LPSPI_CFGR1_OUTCFG(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_OUTCFG_SHIFT)) & LPSPI_CFGR1_OUTCFG_MASK) - -#define LPSPI_CFGR1_PCSCFG_MASK (0x8000000U) -#define LPSPI_CFGR1_PCSCFG_SHIFT (27U) -/*! PCSCFG - Peripheral Chip Select Configuration - * 0b0..PCS[3:2] configured for chip select function - * 0b1..PCS[3:2] configured for half-duplex 4-bit transfers (PCS[3:2] = DATA[3:2]) - */ -#define LPSPI_CFGR1_PCSCFG(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_PCSCFG_SHIFT)) & LPSPI_CFGR1_PCSCFG_MASK) -/*! @} */ - -/*! @name DMR0 - Data Match 0 */ -/*! @{ */ - -#define LPSPI_DMR0_MATCH0_MASK (0xFFFFFFFFU) -#define LPSPI_DMR0_MATCH0_SHIFT (0U) -/*! MATCH0 - Match 0 Value */ -#define LPSPI_DMR0_MATCH0(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_DMR0_MATCH0_SHIFT)) & LPSPI_DMR0_MATCH0_MASK) -/*! @} */ - -/*! @name DMR1 - Data Match 1 */ -/*! @{ */ - -#define LPSPI_DMR1_MATCH1_MASK (0xFFFFFFFFU) -#define LPSPI_DMR1_MATCH1_SHIFT (0U) -/*! MATCH1 - Match 1 Value */ -#define LPSPI_DMR1_MATCH1(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_DMR1_MATCH1_SHIFT)) & LPSPI_DMR1_MATCH1_MASK) -/*! @} */ - -/*! @name CCR - Clock Configuration */ -/*! @{ */ - -#define LPSPI_CCR_SCKDIV_MASK (0xFFU) -#define LPSPI_CCR_SCKDIV_SHIFT (0U) -/*! SCKDIV - SCK Divider */ -#define LPSPI_CCR_SCKDIV(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR_SCKDIV_SHIFT)) & LPSPI_CCR_SCKDIV_MASK) - -#define LPSPI_CCR_DBT_MASK (0xFF00U) -#define LPSPI_CCR_DBT_SHIFT (8U) -/*! DBT - Delay Between Transfers */ -#define LPSPI_CCR_DBT(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR_DBT_SHIFT)) & LPSPI_CCR_DBT_MASK) - -#define LPSPI_CCR_PCSSCK_MASK (0xFF0000U) -#define LPSPI_CCR_PCSSCK_SHIFT (16U) -/*! PCSSCK - PCS-to-SCK Delay */ -#define LPSPI_CCR_PCSSCK(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR_PCSSCK_SHIFT)) & LPSPI_CCR_PCSSCK_MASK) - -#define LPSPI_CCR_SCKPCS_MASK (0xFF000000U) -#define LPSPI_CCR_SCKPCS_SHIFT (24U) -/*! SCKPCS - SCK-to-PCS Delay */ -#define LPSPI_CCR_SCKPCS(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR_SCKPCS_SHIFT)) & LPSPI_CCR_SCKPCS_MASK) -/*! @} */ - -/*! @name CCR1 - Clock Configuration 1 */ -/*! @{ */ - -#define LPSPI_CCR1_SCKSET_MASK (0xFFU) -#define LPSPI_CCR1_SCKSET_SHIFT (0U) -/*! SCKSET - SCK Setup */ -#define LPSPI_CCR1_SCKSET(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR1_SCKSET_SHIFT)) & LPSPI_CCR1_SCKSET_MASK) - -#define LPSPI_CCR1_SCKHLD_MASK (0xFF00U) -#define LPSPI_CCR1_SCKHLD_SHIFT (8U) -/*! SCKHLD - SCK Hold */ -#define LPSPI_CCR1_SCKHLD(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR1_SCKHLD_SHIFT)) & LPSPI_CCR1_SCKHLD_MASK) - -#define LPSPI_CCR1_PCSPCS_MASK (0xFF0000U) -#define LPSPI_CCR1_PCSPCS_SHIFT (16U) -/*! PCSPCS - PCS to PCS Delay */ -#define LPSPI_CCR1_PCSPCS(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR1_PCSPCS_SHIFT)) & LPSPI_CCR1_PCSPCS_MASK) - -#define LPSPI_CCR1_SCKSCK_MASK (0xFF000000U) -#define LPSPI_CCR1_SCKSCK_SHIFT (24U) -/*! SCKSCK - SCK Inter-Frame Delay */ -#define LPSPI_CCR1_SCKSCK(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR1_SCKSCK_SHIFT)) & LPSPI_CCR1_SCKSCK_MASK) -/*! @} */ - -/*! @name FCR - FIFO Control */ -/*! @{ */ - -#define LPSPI_FCR_TXWATER_MASK (0x3U) -#define LPSPI_FCR_TXWATER_SHIFT (0U) -/*! TXWATER - Transmit FIFO Watermark */ -#define LPSPI_FCR_TXWATER(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_FCR_TXWATER_SHIFT)) & LPSPI_FCR_TXWATER_MASK) - -#define LPSPI_FCR_RXWATER_MASK (0x30000U) -#define LPSPI_FCR_RXWATER_SHIFT (16U) -/*! RXWATER - Receive FIFO Watermark */ -#define LPSPI_FCR_RXWATER(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_FCR_RXWATER_SHIFT)) & LPSPI_FCR_RXWATER_MASK) -/*! @} */ - -/*! @name FSR - FIFO Status */ -/*! @{ */ - -#define LPSPI_FSR_TXCOUNT_MASK (0x7U) -#define LPSPI_FSR_TXCOUNT_SHIFT (0U) -/*! TXCOUNT - Transmit FIFO Count */ -#define LPSPI_FSR_TXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_FSR_TXCOUNT_SHIFT)) & LPSPI_FSR_TXCOUNT_MASK) - -#define LPSPI_FSR_RXCOUNT_MASK (0x70000U) -#define LPSPI_FSR_RXCOUNT_SHIFT (16U) -/*! RXCOUNT - Receive FIFO Count */ -#define LPSPI_FSR_RXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_FSR_RXCOUNT_SHIFT)) & LPSPI_FSR_RXCOUNT_MASK) -/*! @} */ - -/*! @name TCR - Transmit Command */ -/*! @{ */ - -#define LPSPI_TCR_FRAMESZ_MASK (0xFFFU) -#define LPSPI_TCR_FRAMESZ_SHIFT (0U) -/*! FRAMESZ - Frame Size */ -#define LPSPI_TCR_FRAMESZ(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_FRAMESZ_SHIFT)) & LPSPI_TCR_FRAMESZ_MASK) - -#define LPSPI_TCR_WIDTH_MASK (0x30000U) -#define LPSPI_TCR_WIDTH_SHIFT (16U) -/*! WIDTH - Transfer Width - * 0b00..1-bit transfer - * 0b01..2-bit transfer - * 0b10..4-bit transfer - * 0b11..Reserved - */ -#define LPSPI_TCR_WIDTH(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_WIDTH_SHIFT)) & LPSPI_TCR_WIDTH_MASK) - -#define LPSPI_TCR_TXMSK_MASK (0x40000U) -#define LPSPI_TCR_TXMSK_SHIFT (18U) -/*! TXMSK - Transmit Data Mask - * 0b0..Normal transfer - * 0b1..Mask transmit data - */ -#define LPSPI_TCR_TXMSK(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_TXMSK_SHIFT)) & LPSPI_TCR_TXMSK_MASK) - -#define LPSPI_TCR_RXMSK_MASK (0x80000U) -#define LPSPI_TCR_RXMSK_SHIFT (19U) -/*! RXMSK - Receive Data Mask - * 0b0..Normal transfer - * 0b1..Mask receive data - */ -#define LPSPI_TCR_RXMSK(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_RXMSK_SHIFT)) & LPSPI_TCR_RXMSK_MASK) - -#define LPSPI_TCR_CONTC_MASK (0x100000U) -#define LPSPI_TCR_CONTC_SHIFT (20U) -/*! CONTC - Continuing Command - * 0b0..Command word for start of new transfer - * 0b1..Command word for continuing transfer - */ -#define LPSPI_TCR_CONTC(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_CONTC_SHIFT)) & LPSPI_TCR_CONTC_MASK) - -#define LPSPI_TCR_CONT_MASK (0x200000U) -#define LPSPI_TCR_CONT_SHIFT (21U) -/*! CONT - Continuous Transfer - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_TCR_CONT(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_CONT_SHIFT)) & LPSPI_TCR_CONT_MASK) - -#define LPSPI_TCR_BYSW_MASK (0x400000U) -#define LPSPI_TCR_BYSW_SHIFT (22U) -/*! BYSW - Byte Swap - * 0b0..Disable byte swap - * 0b1..Enable byte swap - */ -#define LPSPI_TCR_BYSW(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_BYSW_SHIFT)) & LPSPI_TCR_BYSW_MASK) - -#define LPSPI_TCR_LSBF_MASK (0x800000U) -#define LPSPI_TCR_LSBF_SHIFT (23U) -/*! LSBF - LSB First - * 0b0..MSB first - * 0b1..LSB first - */ -#define LPSPI_TCR_LSBF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_LSBF_SHIFT)) & LPSPI_TCR_LSBF_MASK) - -#define LPSPI_TCR_PCS_MASK (0x3000000U) -#define LPSPI_TCR_PCS_SHIFT (24U) -/*! PCS - Peripheral Chip Select - * 0b00..Transfer using PCS[0] - * 0b01..Transfer using PCS[1] - * 0b10..Transfer using PCS[2] - * 0b11..Transfer using PCS[3] - */ -#define LPSPI_TCR_PCS(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_PCS_SHIFT)) & LPSPI_TCR_PCS_MASK) - -#define LPSPI_TCR_PRESCALE_MASK (0x38000000U) -#define LPSPI_TCR_PRESCALE_SHIFT (27U) -/*! PRESCALE - Prescaler Value - * 0b000..Divide by 1 - * 0b001..Divide by 2 - * 0b010..Divide by 4 - * 0b011..Divide by 8 - * 0b100..Divide by 16 - * 0b101..Divide by 32 - * 0b110..Divide by 64 - * 0b111..Divide by 128 - */ -#define LPSPI_TCR_PRESCALE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_PRESCALE_SHIFT)) & LPSPI_TCR_PRESCALE_MASK) - -#define LPSPI_TCR_CPHA_MASK (0x40000000U) -#define LPSPI_TCR_CPHA_SHIFT (30U) -/*! CPHA - Clock Phase - * 0b0..Captured - * 0b1..Changed - */ -#define LPSPI_TCR_CPHA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_CPHA_SHIFT)) & LPSPI_TCR_CPHA_MASK) - -#define LPSPI_TCR_CPOL_MASK (0x80000000U) -#define LPSPI_TCR_CPOL_SHIFT (31U) -/*! CPOL - Clock Polarity - * 0b0..Inactive low - * 0b1..Inactive high - */ -#define LPSPI_TCR_CPOL(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_CPOL_SHIFT)) & LPSPI_TCR_CPOL_MASK) -/*! @} */ - -/*! @name TDR - Transmit Data */ -/*! @{ */ - -#define LPSPI_TDR_DATA_MASK (0xFFFFFFFFU) -#define LPSPI_TDR_DATA_SHIFT (0U) -/*! DATA - Transmit Data */ -#define LPSPI_TDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TDR_DATA_SHIFT)) & LPSPI_TDR_DATA_MASK) -/*! @} */ - -/*! @name RSR - Receive Status */ -/*! @{ */ - -#define LPSPI_RSR_SOF_MASK (0x1U) -#define LPSPI_RSR_SOF_SHIFT (0U) -/*! SOF - Start of Frame - * 0b0..Subsequent data word - * 0b1..First data word - */ -#define LPSPI_RSR_SOF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_RSR_SOF_SHIFT)) & LPSPI_RSR_SOF_MASK) - -#define LPSPI_RSR_RXEMPTY_MASK (0x2U) -#define LPSPI_RSR_RXEMPTY_SHIFT (1U) -/*! RXEMPTY - RX FIFO Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPSPI_RSR_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_RSR_RXEMPTY_SHIFT)) & LPSPI_RSR_RXEMPTY_MASK) -/*! @} */ - -/*! @name RDR - Receive Data */ -/*! @{ */ - -#define LPSPI_RDR_DATA_MASK (0xFFFFFFFFU) -#define LPSPI_RDR_DATA_SHIFT (0U) -/*! DATA - Receive Data */ -#define LPSPI_RDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_RDR_DATA_SHIFT)) & LPSPI_RDR_DATA_MASK) -/*! @} */ - -/*! @name RDROR - Receive Data Read Only */ -/*! @{ */ - -#define LPSPI_RDROR_DATA_MASK (0xFFFFFFFFU) -#define LPSPI_RDROR_DATA_SHIFT (0U) -/*! DATA - Receive Data */ -#define LPSPI_RDROR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_RDROR_DATA_SHIFT)) & LPSPI_RDROR_DATA_MASK) -/*! @} */ - -/*! @name TCBR - Transmit Command Burst */ -/*! @{ */ - -#define LPSPI_TCBR_DATA_MASK (0xFFFFFFFFU) -#define LPSPI_TCBR_DATA_SHIFT (0U) -/*! DATA - Command Data */ -#define LPSPI_TCBR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCBR_DATA_SHIFT)) & LPSPI_TCBR_DATA_MASK) -/*! @} */ - -/*! @name TDBR - Transmit Data Burst */ -/*! @{ */ - -#define LPSPI_TDBR_DATA_MASK (0xFFFFFFFFU) -#define LPSPI_TDBR_DATA_SHIFT (0U) -/*! DATA - Data */ -#define LPSPI_TDBR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TDBR_DATA_SHIFT)) & LPSPI_TDBR_DATA_MASK) -/*! @} */ - -/* The count of LPSPI_TDBR */ -#define LPSPI_TDBR_COUNT (128U) - -/*! @name RDBR - Receive Data Burst */ -/*! @{ */ - -#define LPSPI_RDBR_DATA_MASK (0xFFFFFFFFU) -#define LPSPI_RDBR_DATA_SHIFT (0U) -/*! DATA - Data */ -#define LPSPI_RDBR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_RDBR_DATA_SHIFT)) & LPSPI_RDBR_DATA_MASK) -/*! @} */ - -/* The count of LPSPI_RDBR */ -#define LPSPI_RDBR_COUNT (128U) - - -/*! - * @} - */ /* end of group LPSPI_Register_Masks */ - - -/* LPSPI - Peripheral instance base addresses */ -/** Peripheral LPSPI0 base address */ -#define LPSPI0_BASE (0x4009C000u) -/** Peripheral LPSPI0 base pointer */ -#define LPSPI0 ((LPSPI_Type *)LPSPI0_BASE) -/** Peripheral LPSPI1 base address */ -#define LPSPI1_BASE (0x4009D000u) -/** Peripheral LPSPI1 base pointer */ -#define LPSPI1 ((LPSPI_Type *)LPSPI1_BASE) -/** Array initializer of LPSPI peripheral base addresses */ -#define LPSPI_BASE_ADDRS { LPSPI0_BASE, LPSPI1_BASE } -/** Array initializer of LPSPI peripheral base pointers */ -#define LPSPI_BASE_PTRS { LPSPI0, LPSPI1 } -/** Interrupt vectors for the LPSPI peripheral type */ -#define LPSPI_IRQS { LPSPI0_IRQn, LPSPI1_IRQn } - -/*! - * @} - */ /* end of group LPSPI_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LPTMR Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPTMR_Peripheral_Access_Layer LPTMR Peripheral Access Layer - * @{ - */ - -/** LPTMR - Register Layout Typedef */ -typedef struct { - __IO uint32_t CSR; /**< Control Status, offset: 0x0 */ - __IO uint32_t PSR; /**< Prescaler and Glitch Filter, offset: 0x4 */ - __IO uint32_t CMR; /**< Compare, offset: 0x8 */ - __IO uint32_t CNR; /**< Counter, offset: 0xC */ -} LPTMR_Type; - -/* ---------------------------------------------------------------------------- - -- LPTMR Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPTMR_Register_Masks LPTMR Register Masks - * @{ - */ - -/*! @name CSR - Control Status */ -/*! @{ */ - -#define LPTMR_CSR_TEN_MASK (0x1U) -#define LPTMR_CSR_TEN_SHIFT (0U) -/*! TEN - Timer Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPTMR_CSR_TEN(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TEN_SHIFT)) & LPTMR_CSR_TEN_MASK) - -#define LPTMR_CSR_TMS_MASK (0x2U) -#define LPTMR_CSR_TMS_SHIFT (1U) -/*! TMS - Timer Mode Select - * 0b0..Time Counter - * 0b1..Pulse Counter - */ -#define LPTMR_CSR_TMS(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TMS_SHIFT)) & LPTMR_CSR_TMS_MASK) - -#define LPTMR_CSR_TFC_MASK (0x4U) -#define LPTMR_CSR_TFC_SHIFT (2U) -/*! TFC - Timer Free-Running Counter - * 0b0..Reset when TCF asserts - * 0b1..Reset on overflow - */ -#define LPTMR_CSR_TFC(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TFC_SHIFT)) & LPTMR_CSR_TFC_MASK) - -#define LPTMR_CSR_TPP_MASK (0x8U) -#define LPTMR_CSR_TPP_SHIFT (3U) -/*! TPP - Timer Pin Polarity - * 0b0..Active-high - * 0b1..Active-low - */ -#define LPTMR_CSR_TPP(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TPP_SHIFT)) & LPTMR_CSR_TPP_MASK) - -#define LPTMR_CSR_TPS_MASK (0x30U) -#define LPTMR_CSR_TPS_SHIFT (4U) -/*! TPS - Timer Pin Select - * 0b00..Input 0 - * 0b01..Input 1 - * 0b10..Input 2 - * 0b11..Input 3 - */ -#define LPTMR_CSR_TPS(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TPS_SHIFT)) & LPTMR_CSR_TPS_MASK) - -#define LPTMR_CSR_TIE_MASK (0x40U) -#define LPTMR_CSR_TIE_SHIFT (6U) -/*! TIE - Timer Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPTMR_CSR_TIE(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TIE_SHIFT)) & LPTMR_CSR_TIE_MASK) - -#define LPTMR_CSR_TCF_MASK (0x80U) -#define LPTMR_CSR_TCF_SHIFT (7U) -/*! TCF - Timer Compare Flag - * 0b0..CNR != (CMR + 1) - * 0b1..CNR = (CMR + 1) - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPTMR_CSR_TCF(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TCF_SHIFT)) & LPTMR_CSR_TCF_MASK) - -#define LPTMR_CSR_TDRE_MASK (0x100U) -#define LPTMR_CSR_TDRE_SHIFT (8U) -/*! TDRE - Timer DMA Request Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPTMR_CSR_TDRE(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TDRE_SHIFT)) & LPTMR_CSR_TDRE_MASK) -/*! @} */ - -/*! @name PSR - Prescaler and Glitch Filter */ -/*! @{ */ - -#define LPTMR_PSR_PCS_MASK (0x3U) -#define LPTMR_PSR_PCS_SHIFT (0U) -/*! PCS - Prescaler and Glitch Filter Clock Select - * 0b00..Clock 0 - * 0b01..Clock 1 - * 0b10..Clock 2 - * 0b11..Clock 3 - */ -#define LPTMR_PSR_PCS(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_PSR_PCS_SHIFT)) & LPTMR_PSR_PCS_MASK) - -#define LPTMR_PSR_PBYP_MASK (0x4U) -#define LPTMR_PSR_PBYP_SHIFT (2U) -/*! PBYP - Prescaler and Glitch Filter Bypass - * 0b0..Prescaler and glitch filter enable - * 0b1..Prescaler and glitch filter bypass - */ -#define LPTMR_PSR_PBYP(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_PSR_PBYP_SHIFT)) & LPTMR_PSR_PBYP_MASK) - -#define LPTMR_PSR_PRESCALE_MASK (0x78U) -#define LPTMR_PSR_PRESCALE_SHIFT (3U) -/*! PRESCALE - Prescaler and Glitch Filter Value - * 0b0000..Prescaler divides the prescaler clock by 2; glitch filter does not support this configuration - * 0b0001..Prescaler divides the prescaler clock by 4; glitch filter recognizes change on input pin after two rising clock edges - * 0b0010..Prescaler divides the prescaler clock by 8; glitch filter recognizes change on input pin after four rising clock edges - * 0b0011..Prescaler divides the prescaler clock by 16; glitch filter recognizes change on input pin after eight rising clock edges - * 0b0100..Prescaler divides the prescaler clock by 32; glitch filter recognizes change on input pin after 16 rising clock edges - * 0b0101..Prescaler divides the prescaler clock by 64; glitch filter recognizes change on input pin after 32 rising clock edges - * 0b0110..Prescaler divides the prescaler clock by 128; glitch filter recognizes change on input pin after 64 rising clock edges - * 0b0111..Prescaler divides the prescaler clock by 256; glitch filter recognizes change on input pin after 128 rising clock edges - * 0b1000..Prescaler divides the prescaler clock by 512; glitch filter recognizes change on input pin after 256 rising clock edges - * 0b1001..Prescaler divides the prescaler clock by 1024; glitch filter recognizes change on input pin after 512 rising clock edges - * 0b1010..Prescaler divides the prescaler clock by 2048; glitch filter recognizes change on input pin after 1024 rising clock edges - * 0b1011..Prescaler divides the prescaler clock by 4096; glitch filter recognizes change on input pin after 2048 rising clock edges - * 0b1100..Prescaler divides the prescaler clock by 8192; glitch filter recognizes change on input pin after 4096 rising clock edges - * 0b1101..Prescaler divides the prescaler clock by 16,384; glitch filter recognizes change on input pin after 8192 rising clock edges - * 0b1110..Prescaler divides the prescaler clock by 32,768; glitch filter recognizes change on input pin after 16,384 rising clock edges - * 0b1111..Prescaler divides the prescaler clock by 65,536; glitch filter recognizes change on input pin after 32,768 rising clock edges - */ -#define LPTMR_PSR_PRESCALE(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_PSR_PRESCALE_SHIFT)) & LPTMR_PSR_PRESCALE_MASK) -/*! @} */ - -/*! @name CMR - Compare */ -/*! @{ */ - -#define LPTMR_CMR_COMPARE_MASK (0xFFFFFFFFU) -#define LPTMR_CMR_COMPARE_SHIFT (0U) -/*! COMPARE - Compare Value */ -#define LPTMR_CMR_COMPARE(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CMR_COMPARE_SHIFT)) & LPTMR_CMR_COMPARE_MASK) -/*! @} */ - -/*! @name CNR - Counter */ -/*! @{ */ - -#define LPTMR_CNR_COUNTER_MASK (0xFFFFFFFFU) -#define LPTMR_CNR_COUNTER_SHIFT (0U) -/*! COUNTER - Counter Value */ -#define LPTMR_CNR_COUNTER(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CNR_COUNTER_SHIFT)) & LPTMR_CNR_COUNTER_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group LPTMR_Register_Masks */ - - -/* LPTMR - Peripheral instance base addresses */ -/** Peripheral LPTMR0 base address */ -#define LPTMR0_BASE (0x400AB000u) -/** Peripheral LPTMR0 base pointer */ -#define LPTMR0 ((LPTMR_Type *)LPTMR0_BASE) -/** Array initializer of LPTMR peripheral base addresses */ -#define LPTMR_BASE_ADDRS { LPTMR0_BASE } -/** Array initializer of LPTMR peripheral base pointers */ -#define LPTMR_BASE_PTRS { LPTMR0 } -/** Interrupt vectors for the LPTMR peripheral type */ -#define LPTMR_IRQS { LPTMR0_IRQn } - -/*! - * @} - */ /* end of group LPTMR_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LPUART Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPUART_Peripheral_Access_Layer LPUART Peripheral Access Layer - * @{ - */ - -/** LPUART - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - __IO uint32_t GLOBAL; /**< Global, offset: 0x8 */ - __IO uint32_t PINCFG; /**< Pin Configuration, offset: 0xC */ - __IO uint32_t BAUD; /**< Baud Rate, offset: 0x10 */ - __IO uint32_t STAT; /**< Status, offset: 0x14 */ - __IO uint32_t CTRL; /**< Control, offset: 0x18 */ - __IO uint32_t DATA; /**< Data, offset: 0x1C */ - __IO uint32_t MATCH; /**< Match Address, offset: 0x20 */ - __IO uint32_t MODIR; /**< MODEM IrDA, offset: 0x24 */ - __IO uint32_t FIFO; /**< FIFO, offset: 0x28 */ - __IO uint32_t WATER; /**< Watermark, offset: 0x2C */ - __I uint32_t DATARO; /**< Data Read-Only, offset: 0x30 */ -} LPUART_Type; - -/* ---------------------------------------------------------------------------- - -- LPUART Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPUART_Register_Masks LPUART Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define LPUART_VERID_FEATURE_MASK (0xFFFFU) -#define LPUART_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Identification Number - * 0b0000000000000001..Standard feature set - * 0b0000000000000011..Standard feature set with MODEM and IrDA support - */ -#define LPUART_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_VERID_FEATURE_SHIFT)) & LPUART_VERID_FEATURE_MASK) - -#define LPUART_VERID_MINOR_MASK (0xFF0000U) -#define LPUART_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define LPUART_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_VERID_MINOR_SHIFT)) & LPUART_VERID_MINOR_MASK) - -#define LPUART_VERID_MAJOR_MASK (0xFF000000U) -#define LPUART_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define LPUART_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_VERID_MAJOR_SHIFT)) & LPUART_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define LPUART_PARAM_TXFIFO_MASK (0xFFU) -#define LPUART_PARAM_TXFIFO_SHIFT (0U) -/*! TXFIFO - Transmit FIFO Size */ -#define LPUART_PARAM_TXFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPUART_PARAM_TXFIFO_SHIFT)) & LPUART_PARAM_TXFIFO_MASK) - -#define LPUART_PARAM_RXFIFO_MASK (0xFF00U) -#define LPUART_PARAM_RXFIFO_SHIFT (8U) -/*! RXFIFO - Receive FIFO Size */ -#define LPUART_PARAM_RXFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPUART_PARAM_RXFIFO_SHIFT)) & LPUART_PARAM_RXFIFO_MASK) -/*! @} */ - -/*! @name GLOBAL - Global */ -/*! @{ */ - -#define LPUART_GLOBAL_RST_MASK (0x2U) -#define LPUART_GLOBAL_RST_SHIFT (1U) -/*! RST - Software Reset - * 0b0..Not reset - * 0b1..Reset - */ -#define LPUART_GLOBAL_RST(x) (((uint32_t)(((uint32_t)(x)) << LPUART_GLOBAL_RST_SHIFT)) & LPUART_GLOBAL_RST_MASK) -/*! @} */ - -/*! @name PINCFG - Pin Configuration */ -/*! @{ */ - -#define LPUART_PINCFG_TRGSEL_MASK (0x3U) -#define LPUART_PINCFG_TRGSEL_SHIFT (0U) -/*! TRGSEL - Trigger Select - * 0b00..Input trigger disabled - * 0b01..Input trigger used instead of the RXD pin input - * 0b10..Input trigger used instead of the CTS_B pin input - * 0b11..Input trigger used to modulate the TXD pin output, which (after TXINV configuration) is internally ANDed with the input trigger - */ -#define LPUART_PINCFG_TRGSEL(x) (((uint32_t)(((uint32_t)(x)) << LPUART_PINCFG_TRGSEL_SHIFT)) & LPUART_PINCFG_TRGSEL_MASK) -/*! @} */ - -/*! @name BAUD - Baud Rate */ -/*! @{ */ - -#define LPUART_BAUD_SBR_MASK (0x1FFFU) -#define LPUART_BAUD_SBR_SHIFT (0U) -/*! SBR - Baud Rate Modulo Divisor */ -#define LPUART_BAUD_SBR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_SBR_SHIFT)) & LPUART_BAUD_SBR_MASK) - -#define LPUART_BAUD_SBNS_MASK (0x2000U) -#define LPUART_BAUD_SBNS_SHIFT (13U) -/*! SBNS - Stop Bit Number Select - * 0b0..One stop bit - * 0b1..Two stop bits - */ -#define LPUART_BAUD_SBNS(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_SBNS_SHIFT)) & LPUART_BAUD_SBNS_MASK) - -#define LPUART_BAUD_RXEDGIE_MASK (0x4000U) -#define LPUART_BAUD_RXEDGIE_SHIFT (14U) -/*! RXEDGIE - RX Input Active Edge Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_RXEDGIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_RXEDGIE_SHIFT)) & LPUART_BAUD_RXEDGIE_MASK) - -#define LPUART_BAUD_LBKDIE_MASK (0x8000U) -#define LPUART_BAUD_LBKDIE_SHIFT (15U) -/*! LBKDIE - LIN Break Detect Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_LBKDIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_LBKDIE_SHIFT)) & LPUART_BAUD_LBKDIE_MASK) - -#define LPUART_BAUD_RESYNCDIS_MASK (0x10000U) -#define LPUART_BAUD_RESYNCDIS_SHIFT (16U) -/*! RESYNCDIS - Resynchronization Disable - * 0b0..Enable - * 0b1..Disable - */ -#define LPUART_BAUD_RESYNCDIS(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_RESYNCDIS_SHIFT)) & LPUART_BAUD_RESYNCDIS_MASK) - -#define LPUART_BAUD_BOTHEDGE_MASK (0x20000U) -#define LPUART_BAUD_BOTHEDGE_SHIFT (17U) -/*! BOTHEDGE - Both Edge Sampling - * 0b0..Rising edge - * 0b1..Both rising and falling edges - */ -#define LPUART_BAUD_BOTHEDGE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_BOTHEDGE_SHIFT)) & LPUART_BAUD_BOTHEDGE_MASK) - -#define LPUART_BAUD_MATCFG_MASK (0xC0000U) -#define LPUART_BAUD_MATCFG_SHIFT (18U) -/*! MATCFG - Match Configuration - * 0b00..Address match wake-up - * 0b01..Idle match wake-up - * 0b10..Match on and match off - * 0b11..Enables RWU on data match and match on or off for the transmitter CTS input - */ -#define LPUART_BAUD_MATCFG(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_MATCFG_SHIFT)) & LPUART_BAUD_MATCFG_MASK) - -#define LPUART_BAUD_RIDMAE_MASK (0x100000U) -#define LPUART_BAUD_RIDMAE_SHIFT (20U) -/*! RIDMAE - Receiver Idle DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_RIDMAE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_RIDMAE_SHIFT)) & LPUART_BAUD_RIDMAE_MASK) - -#define LPUART_BAUD_RDMAE_MASK (0x200000U) -#define LPUART_BAUD_RDMAE_SHIFT (21U) -/*! RDMAE - Receiver Full DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_RDMAE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_RDMAE_SHIFT)) & LPUART_BAUD_RDMAE_MASK) - -#define LPUART_BAUD_TDMAE_MASK (0x800000U) -#define LPUART_BAUD_TDMAE_SHIFT (23U) -/*! TDMAE - Transmitter DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_TDMAE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_TDMAE_SHIFT)) & LPUART_BAUD_TDMAE_MASK) - -#define LPUART_BAUD_OSR_MASK (0x1F000000U) -#define LPUART_BAUD_OSR_SHIFT (24U) -/*! OSR - Oversampling Ratio - * 0b00000..Results in an OSR of 16 - * 0b00001..Reserved - * 0b00010..Reserved - * 0b00011..Results in an OSR of 4 (requires BAUD[BOTHEDGE] to be 1) - * 0b00100..Results in an OSR of 5 (requires BAUD[BOTHEDGE] to be 1) - * 0b00101..Results in an OSR of 6 (requires BAUD[BOTHEDGE] to be 1) - * 0b00110..Results in an OSR of 7 (requires BAUD[BOTHEDGE] to be 1) - * 0b00111..Results in an OSR of 8 - * 0b01000..Results in an OSR of 9 - * 0b01001..Results in an OSR of 10 - * 0b01010..Results in an OSR of 11 - * 0b01011..Results in an OSR of 12 - * 0b01100..Results in an OSR of 13 - * 0b01101..Results in an OSR of 14 - * 0b01110..Results in an OSR of 15 - * 0b01111..Results in an OSR of 16 - * 0b10000..Results in an OSR of 17 - * 0b10001..Results in an OSR of 18 - * 0b10010..Results in an OSR of 19 - * 0b10011..Results in an OSR of 20 - * 0b10100..Results in an OSR of 21 - * 0b10101..Results in an OSR of 22 - * 0b10110..Results in an OSR of 23 - * 0b10111..Results in an OSR of 24 - * 0b11000..Results in an OSR of 25 - * 0b11001..Results in an OSR of 26 - * 0b11010..Results in an OSR of 27 - * 0b11011..Results in an OSR of 28 - * 0b11100..Results in an OSR of 29 - * 0b11101..Results in an OSR of 30 - * 0b11110..Results in an OSR of 31 - * 0b11111..Results in an OSR of 32 - */ -#define LPUART_BAUD_OSR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_OSR_SHIFT)) & LPUART_BAUD_OSR_MASK) - -#define LPUART_BAUD_M10_MASK (0x20000000U) -#define LPUART_BAUD_M10_SHIFT (29U) -/*! M10 - 10-Bit Mode Select - * 0b0..Receiver and transmitter use 7-bit to 9-bit data characters - * 0b1..Receiver and transmitter use 10-bit data characters - */ -#define LPUART_BAUD_M10(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_M10_SHIFT)) & LPUART_BAUD_M10_MASK) - -#define LPUART_BAUD_MAEN2_MASK (0x40000000U) -#define LPUART_BAUD_MAEN2_SHIFT (30U) -/*! MAEN2 - Match Address Mode Enable 2 - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_MAEN2(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_MAEN2_SHIFT)) & LPUART_BAUD_MAEN2_MASK) - -#define LPUART_BAUD_MAEN1_MASK (0x80000000U) -#define LPUART_BAUD_MAEN1_SHIFT (31U) -/*! MAEN1 - Match Address Mode Enable 1 - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_MAEN1(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_MAEN1_SHIFT)) & LPUART_BAUD_MAEN1_MASK) -/*! @} */ - -/*! @name STAT - Status */ -/*! @{ */ - -#define LPUART_STAT_LBKFE_MASK (0x1U) -#define LPUART_STAT_LBKFE_SHIFT (0U) -/*! LBKFE - LIN Break Flag Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_STAT_LBKFE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_LBKFE_SHIFT)) & LPUART_STAT_LBKFE_MASK) - -#define LPUART_STAT_AME_MASK (0x2U) -#define LPUART_STAT_AME_SHIFT (1U) -/*! AME - Address Mark Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_STAT_AME(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_AME_SHIFT)) & LPUART_STAT_AME_MASK) - -#define LPUART_STAT_MA2F_MASK (0x4000U) -#define LPUART_STAT_MA2F_SHIFT (14U) -/*! MA2F - Match 2 Flag - * 0b0..Not equal to MA2 - * 0b1..Equal to MA2 - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_MA2F(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_MA2F_SHIFT)) & LPUART_STAT_MA2F_MASK) - -#define LPUART_STAT_MA1F_MASK (0x8000U) -#define LPUART_STAT_MA1F_SHIFT (15U) -/*! MA1F - Match 1 Flag - * 0b0..Not equal to MA1 - * 0b1..Equal to MA1 - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_MA1F(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_MA1F_SHIFT)) & LPUART_STAT_MA1F_MASK) - -#define LPUART_STAT_PF_MASK (0x10000U) -#define LPUART_STAT_PF_SHIFT (16U) -/*! PF - Parity Error Flag - * 0b0..No parity error detected - * 0b1..Parity error detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_PF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_PF_SHIFT)) & LPUART_STAT_PF_MASK) - -#define LPUART_STAT_FE_MASK (0x20000U) -#define LPUART_STAT_FE_SHIFT (17U) -/*! FE - Framing Error Flag - * 0b0..No framing error detected (this does not guarantee that the framing is correct) - * 0b1..Framing error detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_FE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_FE_SHIFT)) & LPUART_STAT_FE_MASK) - -#define LPUART_STAT_NF_MASK (0x40000U) -#define LPUART_STAT_NF_SHIFT (18U) -/*! NF - Noise Flag - * 0b0..No noise detected - * 0b1..Noise detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_NF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_NF_SHIFT)) & LPUART_STAT_NF_MASK) - -#define LPUART_STAT_OR_MASK (0x80000U) -#define LPUART_STAT_OR_SHIFT (19U) -/*! OR - Receiver Overrun Flag - * 0b0..No overrun - * 0b1..Receive overrun (new LPUART data is lost) - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_OR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_OR_SHIFT)) & LPUART_STAT_OR_MASK) - -#define LPUART_STAT_IDLE_MASK (0x100000U) -#define LPUART_STAT_IDLE_SHIFT (20U) -/*! IDLE - Idle Line Flag - * 0b0..Idle line detected - * 0b1..Idle line not detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_IDLE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_IDLE_SHIFT)) & LPUART_STAT_IDLE_MASK) - -#define LPUART_STAT_RDRF_MASK (0x200000U) -#define LPUART_STAT_RDRF_SHIFT (21U) -/*! RDRF - Receive Data Register Full Flag - * 0b0..Equal to or less than watermark - * 0b1..Greater than watermark - */ -#define LPUART_STAT_RDRF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_RDRF_SHIFT)) & LPUART_STAT_RDRF_MASK) - -#define LPUART_STAT_TC_MASK (0x400000U) -#define LPUART_STAT_TC_SHIFT (22U) -/*! TC - Transmission Complete Flag - * 0b0..Transmitter active - * 0b1..Transmitter idle - */ -#define LPUART_STAT_TC(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_TC_SHIFT)) & LPUART_STAT_TC_MASK) - -#define LPUART_STAT_TDRE_MASK (0x800000U) -#define LPUART_STAT_TDRE_SHIFT (23U) -/*! TDRE - Transmit Data Register Empty Flag - * 0b0..Greater than watermark - * 0b1..Equal to or less than watermark - */ -#define LPUART_STAT_TDRE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_TDRE_SHIFT)) & LPUART_STAT_TDRE_MASK) - -#define LPUART_STAT_RAF_MASK (0x1000000U) -#define LPUART_STAT_RAF_SHIFT (24U) -/*! RAF - Receiver Active Flag - * 0b0..Idle, waiting for a start bit - * 0b1..Receiver active (RXD pin input not idle) - */ -#define LPUART_STAT_RAF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_RAF_SHIFT)) & LPUART_STAT_RAF_MASK) - -#define LPUART_STAT_LBKDE_MASK (0x2000000U) -#define LPUART_STAT_LBKDE_SHIFT (25U) -/*! LBKDE - LIN Break Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_STAT_LBKDE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_LBKDE_SHIFT)) & LPUART_STAT_LBKDE_MASK) - -#define LPUART_STAT_BRK13_MASK (0x4000000U) -#define LPUART_STAT_BRK13_SHIFT (26U) -/*! BRK13 - Break Character Generation Length - * 0b0..9 to 13 bit times - * 0b1..12 to 15 bit times - */ -#define LPUART_STAT_BRK13(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_BRK13_SHIFT)) & LPUART_STAT_BRK13_MASK) - -#define LPUART_STAT_RWUID_MASK (0x8000000U) -#define LPUART_STAT_RWUID_SHIFT (27U) -/*! RWUID - Receive Wake Up Idle Detect - * 0b0..STAT[IDLE] does not become 1 - * 0b1..STAT[IDLE] becomes 1 - */ -#define LPUART_STAT_RWUID(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_RWUID_SHIFT)) & LPUART_STAT_RWUID_MASK) - -#define LPUART_STAT_RXINV_MASK (0x10000000U) -#define LPUART_STAT_RXINV_SHIFT (28U) -/*! RXINV - Receive Data Inversion - * 0b0..Inverted - * 0b1..Not inverted - */ -#define LPUART_STAT_RXINV(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_RXINV_SHIFT)) & LPUART_STAT_RXINV_MASK) - -#define LPUART_STAT_MSBF_MASK (0x20000000U) -#define LPUART_STAT_MSBF_SHIFT (29U) -/*! MSBF - MSB First - * 0b0..LSB - * 0b1..MSB - */ -#define LPUART_STAT_MSBF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_MSBF_SHIFT)) & LPUART_STAT_MSBF_MASK) - -#define LPUART_STAT_RXEDGIF_MASK (0x40000000U) -#define LPUART_STAT_RXEDGIF_SHIFT (30U) -/*! RXEDGIF - RXD Pin Active Edge Interrupt Flag - * 0b0..Not occurred - * 0b1..Occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_RXEDGIF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_RXEDGIF_SHIFT)) & LPUART_STAT_RXEDGIF_MASK) - -#define LPUART_STAT_LBKDIF_MASK (0x80000000U) -#define LPUART_STAT_LBKDIF_SHIFT (31U) -/*! LBKDIF - LIN Break Detect Interrupt Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_LBKDIF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_LBKDIF_SHIFT)) & LPUART_STAT_LBKDIF_MASK) -/*! @} */ - -/*! @name CTRL - Control */ -/*! @{ */ - -#define LPUART_CTRL_PT_MASK (0x1U) -#define LPUART_CTRL_PT_SHIFT (0U) -/*! PT - Parity Type - * 0b0..Even parity - * 0b1..Odd parity - */ -#define LPUART_CTRL_PT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_PT_SHIFT)) & LPUART_CTRL_PT_MASK) - -#define LPUART_CTRL_PE_MASK (0x2U) -#define LPUART_CTRL_PE_SHIFT (1U) -/*! PE - Parity Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_PE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_PE_SHIFT)) & LPUART_CTRL_PE_MASK) - -#define LPUART_CTRL_ILT_MASK (0x4U) -#define LPUART_CTRL_ILT_SHIFT (2U) -/*! ILT - Idle Line Type Select - * 0b0..After the start bit - * 0b1..After the stop bit - */ -#define LPUART_CTRL_ILT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_ILT_SHIFT)) & LPUART_CTRL_ILT_MASK) - -#define LPUART_CTRL_WAKE_MASK (0x8U) -#define LPUART_CTRL_WAKE_SHIFT (3U) -/*! WAKE - Receiver Wake-Up Method Select - * 0b0..Idle - * 0b1..Mark - */ -#define LPUART_CTRL_WAKE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_WAKE_SHIFT)) & LPUART_CTRL_WAKE_MASK) - -#define LPUART_CTRL_M_MASK (0x10U) -#define LPUART_CTRL_M_SHIFT (4U) -/*! M - 9-Bit Or 8-Bit Mode Select - * 0b0..8-bit - * 0b1..9-bit - */ -#define LPUART_CTRL_M(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_M_SHIFT)) & LPUART_CTRL_M_MASK) - -#define LPUART_CTRL_RSRC_MASK (0x20U) -#define LPUART_CTRL_RSRC_SHIFT (5U) -/*! RSRC - Receiver Source Select - * 0b0..Internal Loopback mode - * 0b1..Single-wire mode - */ -#define LPUART_CTRL_RSRC(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_RSRC_SHIFT)) & LPUART_CTRL_RSRC_MASK) - -#define LPUART_CTRL_DOZEEN_MASK (0x40U) -#define LPUART_CTRL_DOZEEN_SHIFT (6U) -/*! DOZEEN - Doze Mode - * 0b0..Enable - * 0b1..Disable - */ -#define LPUART_CTRL_DOZEEN(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_DOZEEN_SHIFT)) & LPUART_CTRL_DOZEEN_MASK) - -#define LPUART_CTRL_LOOPS_MASK (0x80U) -#define LPUART_CTRL_LOOPS_SHIFT (7U) -/*! LOOPS - Loop Mode Select - * 0b0..Normal operation: RXD and TXD use separate pins - * 0b1..Loop mode or Single-Wire mode - */ -#define LPUART_CTRL_LOOPS(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_LOOPS_SHIFT)) & LPUART_CTRL_LOOPS_MASK) - -#define LPUART_CTRL_IDLECFG_MASK (0x700U) -#define LPUART_CTRL_IDLECFG_SHIFT (8U) -/*! IDLECFG - Idle Configuration - * 0b000..1 - * 0b001..2 - * 0b010..4 - * 0b011..8 - * 0b100..16 - * 0b101..32 - * 0b110..64 - * 0b111..128 - */ -#define LPUART_CTRL_IDLECFG(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_IDLECFG_SHIFT)) & LPUART_CTRL_IDLECFG_MASK) - -#define LPUART_CTRL_M7_MASK (0x800U) -#define LPUART_CTRL_M7_SHIFT (11U) -/*! M7 - 7-Bit Mode Select - * 0b0..8-bit to 10-bit - * 0b1..7-bit - */ -#define LPUART_CTRL_M7(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_M7_SHIFT)) & LPUART_CTRL_M7_MASK) - -#define LPUART_CTRL_MA2IE_MASK (0x4000U) -#define LPUART_CTRL_MA2IE_SHIFT (14U) -/*! MA2IE - Match 2 (MA2F) Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_MA2IE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_MA2IE_SHIFT)) & LPUART_CTRL_MA2IE_MASK) - -#define LPUART_CTRL_MA1IE_MASK (0x8000U) -#define LPUART_CTRL_MA1IE_SHIFT (15U) -/*! MA1IE - Match 1 (MA1F) Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_MA1IE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_MA1IE_SHIFT)) & LPUART_CTRL_MA1IE_MASK) - -#define LPUART_CTRL_SBK_MASK (0x10000U) -#define LPUART_CTRL_SBK_SHIFT (16U) -/*! SBK - Send Break - * 0b0..Normal transmitter operation - * 0b1..Queue break character(s) to be sent - */ -#define LPUART_CTRL_SBK(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_SBK_SHIFT)) & LPUART_CTRL_SBK_MASK) - -#define LPUART_CTRL_RWU_MASK (0x20000U) -#define LPUART_CTRL_RWU_SHIFT (17U) -/*! RWU - Receiver Wake-Up Control - * 0b0..Normal receiver operation - * 0b1..LPUART receiver in standby, waiting for a wake-up condition - */ -#define LPUART_CTRL_RWU(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_RWU_SHIFT)) & LPUART_CTRL_RWU_MASK) - -#define LPUART_CTRL_RE_MASK (0x40000U) -#define LPUART_CTRL_RE_SHIFT (18U) -/*! RE - Receiver Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_RE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_RE_SHIFT)) & LPUART_CTRL_RE_MASK) - -#define LPUART_CTRL_TE_MASK (0x80000U) -#define LPUART_CTRL_TE_SHIFT (19U) -/*! TE - Transmitter Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_TE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_TE_SHIFT)) & LPUART_CTRL_TE_MASK) - -#define LPUART_CTRL_ILIE_MASK (0x100000U) -#define LPUART_CTRL_ILIE_SHIFT (20U) -/*! ILIE - Idle Line Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_ILIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_ILIE_SHIFT)) & LPUART_CTRL_ILIE_MASK) - -#define LPUART_CTRL_RIE_MASK (0x200000U) -#define LPUART_CTRL_RIE_SHIFT (21U) -/*! RIE - Receiver Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_RIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_RIE_SHIFT)) & LPUART_CTRL_RIE_MASK) - -#define LPUART_CTRL_TCIE_MASK (0x400000U) -#define LPUART_CTRL_TCIE_SHIFT (22U) -/*! TCIE - Transmission Complete Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_TCIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_TCIE_SHIFT)) & LPUART_CTRL_TCIE_MASK) - -#define LPUART_CTRL_TIE_MASK (0x800000U) -#define LPUART_CTRL_TIE_SHIFT (23U) -/*! TIE - Transmit Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_TIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_TIE_SHIFT)) & LPUART_CTRL_TIE_MASK) - -#define LPUART_CTRL_PEIE_MASK (0x1000000U) -#define LPUART_CTRL_PEIE_SHIFT (24U) -/*! PEIE - Parity Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_PEIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_PEIE_SHIFT)) & LPUART_CTRL_PEIE_MASK) - -#define LPUART_CTRL_FEIE_MASK (0x2000000U) -#define LPUART_CTRL_FEIE_SHIFT (25U) -/*! FEIE - Framing Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_FEIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_FEIE_SHIFT)) & LPUART_CTRL_FEIE_MASK) - -#define LPUART_CTRL_NEIE_MASK (0x4000000U) -#define LPUART_CTRL_NEIE_SHIFT (26U) -/*! NEIE - Noise Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_NEIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_NEIE_SHIFT)) & LPUART_CTRL_NEIE_MASK) - -#define LPUART_CTRL_ORIE_MASK (0x8000000U) -#define LPUART_CTRL_ORIE_SHIFT (27U) -/*! ORIE - Overrun Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_ORIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_ORIE_SHIFT)) & LPUART_CTRL_ORIE_MASK) - -#define LPUART_CTRL_TXINV_MASK (0x10000000U) -#define LPUART_CTRL_TXINV_SHIFT (28U) -/*! TXINV - Transmit Data Inversion - * 0b0..Not inverted - * 0b1..Inverted - */ -#define LPUART_CTRL_TXINV(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_TXINV_SHIFT)) & LPUART_CTRL_TXINV_MASK) - -#define LPUART_CTRL_TXDIR_MASK (0x20000000U) -#define LPUART_CTRL_TXDIR_SHIFT (29U) -/*! TXDIR - TXD Pin Direction in Single-Wire Mode - * 0b0..Input - * 0b1..Output - */ -#define LPUART_CTRL_TXDIR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_TXDIR_SHIFT)) & LPUART_CTRL_TXDIR_MASK) - -#define LPUART_CTRL_R9T8_MASK (0x40000000U) -#define LPUART_CTRL_R9T8_SHIFT (30U) -/*! R9T8 - Receive Bit 9 Transmit Bit 8 */ -#define LPUART_CTRL_R9T8(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_R9T8_SHIFT)) & LPUART_CTRL_R9T8_MASK) - -#define LPUART_CTRL_R8T9_MASK (0x80000000U) -#define LPUART_CTRL_R8T9_SHIFT (31U) -/*! R8T9 - Receive Bit 8 Transmit Bit 9 */ -#define LPUART_CTRL_R8T9(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_R8T9_SHIFT)) & LPUART_CTRL_R8T9_MASK) -/*! @} */ - -/*! @name DATA - Data */ -/*! @{ */ - -#define LPUART_DATA_R0T0_MASK (0x1U) -#define LPUART_DATA_R0T0_SHIFT (0U) -/*! R0T0 - Read receive FIFO bit 0 or write transmit FIFO bit 0 */ -#define LPUART_DATA_R0T0(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R0T0_SHIFT)) & LPUART_DATA_R0T0_MASK) - -#define LPUART_DATA_R1T1_MASK (0x2U) -#define LPUART_DATA_R1T1_SHIFT (1U) -/*! R1T1 - Read receive FIFO bit 1 or write transmit FIFO bit 1 */ -#define LPUART_DATA_R1T1(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R1T1_SHIFT)) & LPUART_DATA_R1T1_MASK) - -#define LPUART_DATA_R2T2_MASK (0x4U) -#define LPUART_DATA_R2T2_SHIFT (2U) -/*! R2T2 - Read receive FIFO bit 2 or write transmit FIFO bit 2 */ -#define LPUART_DATA_R2T2(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R2T2_SHIFT)) & LPUART_DATA_R2T2_MASK) - -#define LPUART_DATA_R3T3_MASK (0x8U) -#define LPUART_DATA_R3T3_SHIFT (3U) -/*! R3T3 - Read receive FIFO bit 3 or write transmit FIFO bit 3 */ -#define LPUART_DATA_R3T3(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R3T3_SHIFT)) & LPUART_DATA_R3T3_MASK) - -#define LPUART_DATA_R4T4_MASK (0x10U) -#define LPUART_DATA_R4T4_SHIFT (4U) -/*! R4T4 - Read receive FIFO bit 4 or write transmit FIFO bit 4 */ -#define LPUART_DATA_R4T4(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R4T4_SHIFT)) & LPUART_DATA_R4T4_MASK) - -#define LPUART_DATA_R5T5_MASK (0x20U) -#define LPUART_DATA_R5T5_SHIFT (5U) -/*! R5T5 - Read receive FIFO bit 5 or write transmit FIFO bit 5 */ -#define LPUART_DATA_R5T5(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R5T5_SHIFT)) & LPUART_DATA_R5T5_MASK) - -#define LPUART_DATA_R6T6_MASK (0x40U) -#define LPUART_DATA_R6T6_SHIFT (6U) -/*! R6T6 - Read receive FIFO bit 6 or write transmit FIFO bit 6 */ -#define LPUART_DATA_R6T6(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R6T6_SHIFT)) & LPUART_DATA_R6T6_MASK) - -#define LPUART_DATA_R7T7_MASK (0x80U) -#define LPUART_DATA_R7T7_SHIFT (7U) -/*! R7T7 - Read receive FIFO bit 7 or write transmit FIFO bit 7 */ -#define LPUART_DATA_R7T7(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R7T7_SHIFT)) & LPUART_DATA_R7T7_MASK) - -#define LPUART_DATA_R8T8_MASK (0x100U) -#define LPUART_DATA_R8T8_SHIFT (8U) -/*! R8T8 - Read receive FIFO bit 8 or write transmit FIFO bit 8 */ -#define LPUART_DATA_R8T8(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R8T8_SHIFT)) & LPUART_DATA_R8T8_MASK) - -#define LPUART_DATA_R9T9_MASK (0x200U) -#define LPUART_DATA_R9T9_SHIFT (9U) -/*! R9T9 - Read receive FIFO bit 9 or write transmit FIFO bit 9 */ -#define LPUART_DATA_R9T9(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R9T9_SHIFT)) & LPUART_DATA_R9T9_MASK) - -#define LPUART_DATA_LINBRK_MASK (0x400U) -#define LPUART_DATA_LINBRK_SHIFT (10U) -/*! LINBRK - LIN Break - * 0b0..Not detected - * 0b1..Detected - */ -#define LPUART_DATA_LINBRK(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_LINBRK_SHIFT)) & LPUART_DATA_LINBRK_MASK) - -#define LPUART_DATA_IDLINE_MASK (0x800U) -#define LPUART_DATA_IDLINE_SHIFT (11U) -/*! IDLINE - Idle Line - * 0b0..Not idle - * 0b1..Idle - */ -#define LPUART_DATA_IDLINE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_IDLINE_SHIFT)) & LPUART_DATA_IDLINE_MASK) - -#define LPUART_DATA_RXEMPT_MASK (0x1000U) -#define LPUART_DATA_RXEMPT_SHIFT (12U) -/*! RXEMPT - Receive Buffer Empty - * 0b0..Valid data - * 0b1..Invalid data and empty - */ -#define LPUART_DATA_RXEMPT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_RXEMPT_SHIFT)) & LPUART_DATA_RXEMPT_MASK) - -#define LPUART_DATA_FRETSC_MASK (0x2000U) -#define LPUART_DATA_FRETSC_SHIFT (13U) -/*! FRETSC - Frame Error Transmit Special Character - * 0b0..Received without a frame error on reads or transmits a normal character on writes - * 0b1..Received with a frame error on reads or transmits an idle or break character on writes - */ -#define LPUART_DATA_FRETSC(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_FRETSC_SHIFT)) & LPUART_DATA_FRETSC_MASK) - -#define LPUART_DATA_PARITYE_MASK (0x4000U) -#define LPUART_DATA_PARITYE_SHIFT (14U) -/*! PARITYE - Parity Error - * 0b0..Received without a parity error - * 0b1..Received with a parity error - */ -#define LPUART_DATA_PARITYE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_PARITYE_SHIFT)) & LPUART_DATA_PARITYE_MASK) - -#define LPUART_DATA_NOISY_MASK (0x8000U) -#define LPUART_DATA_NOISY_SHIFT (15U) -/*! NOISY - Noisy Data Received - * 0b0..Received without noise - * 0b1..Received with noise - */ -#define LPUART_DATA_NOISY(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_NOISY_SHIFT)) & LPUART_DATA_NOISY_MASK) -/*! @} */ - -/*! @name MATCH - Match Address */ -/*! @{ */ - -#define LPUART_MATCH_MA1_MASK (0x3FFU) -#define LPUART_MATCH_MA1_SHIFT (0U) -/*! MA1 - Match Address 1 */ -#define LPUART_MATCH_MA1(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MATCH_MA1_SHIFT)) & LPUART_MATCH_MA1_MASK) - -#define LPUART_MATCH_MA2_MASK (0x3FF0000U) -#define LPUART_MATCH_MA2_SHIFT (16U) -/*! MA2 - Match Address 2 */ -#define LPUART_MATCH_MA2(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MATCH_MA2_SHIFT)) & LPUART_MATCH_MA2_MASK) -/*! @} */ - -/*! @name MODIR - MODEM IrDA */ -/*! @{ */ - -#define LPUART_MODIR_TXCTSE_MASK (0x1U) -#define LPUART_MODIR_TXCTSE_SHIFT (0U) -/*! TXCTSE - Transmitter CTS Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_MODIR_TXCTSE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_TXCTSE_SHIFT)) & LPUART_MODIR_TXCTSE_MASK) - -#define LPUART_MODIR_TXRTSE_MASK (0x2U) -#define LPUART_MODIR_TXRTSE_SHIFT (1U) -/*! TXRTSE - Transmitter RTS Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_MODIR_TXRTSE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_TXRTSE_SHIFT)) & LPUART_MODIR_TXRTSE_MASK) - -#define LPUART_MODIR_TXRTSPOL_MASK (0x4U) -#define LPUART_MODIR_TXRTSPOL_SHIFT (2U) -/*! TXRTSPOL - Transmitter RTS Polarity - * 0b0..Active low - * 0b1..Active high - */ -#define LPUART_MODIR_TXRTSPOL(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_TXRTSPOL_SHIFT)) & LPUART_MODIR_TXRTSPOL_MASK) - -#define LPUART_MODIR_RXRTSE_MASK (0x8U) -#define LPUART_MODIR_RXRTSE_SHIFT (3U) -/*! RXRTSE - Receiver RTS Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_MODIR_RXRTSE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_RXRTSE_SHIFT)) & LPUART_MODIR_RXRTSE_MASK) - -#define LPUART_MODIR_TXCTSC_MASK (0x10U) -#define LPUART_MODIR_TXCTSC_SHIFT (4U) -/*! TXCTSC - Transmit CTS Configuration - * 0b0..Sampled at the start of each character - * 0b1..Sampled when the transmitter is idle - */ -#define LPUART_MODIR_TXCTSC(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_TXCTSC_SHIFT)) & LPUART_MODIR_TXCTSC_MASK) - -#define LPUART_MODIR_TXCTSSRC_MASK (0x20U) -#define LPUART_MODIR_TXCTSSRC_SHIFT (5U) -/*! TXCTSSRC - Transmit CTS Source - * 0b0..The CTS_B pin - * 0b1..An internal connection to the receiver address match result - */ -#define LPUART_MODIR_TXCTSSRC(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_TXCTSSRC_SHIFT)) & LPUART_MODIR_TXCTSSRC_MASK) - -#define LPUART_MODIR_RTSWATER_MASK (0x300U) -#define LPUART_MODIR_RTSWATER_SHIFT (8U) -/*! RTSWATER - Receive RTS Configuration */ -#define LPUART_MODIR_RTSWATER(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_RTSWATER_SHIFT)) & LPUART_MODIR_RTSWATER_MASK) - -#define LPUART_MODIR_TNP_MASK (0x30000U) -#define LPUART_MODIR_TNP_SHIFT (16U) -/*! TNP - Transmitter Narrow Pulse - * 0b00..1 / OSR - * 0b01..2 / OSR - * 0b10..3 / OSR - * 0b11..4 / OSR - */ -#define LPUART_MODIR_TNP(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_TNP_SHIFT)) & LPUART_MODIR_TNP_MASK) - -#define LPUART_MODIR_IREN_MASK (0x40000U) -#define LPUART_MODIR_IREN_SHIFT (18U) -/*! IREN - IR Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_MODIR_IREN(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_IREN_SHIFT)) & LPUART_MODIR_IREN_MASK) -/*! @} */ - -/*! @name FIFO - FIFO */ -/*! @{ */ - -#define LPUART_FIFO_RXFIFOSIZE_MASK (0x7U) -#define LPUART_FIFO_RXFIFOSIZE_SHIFT (0U) -/*! RXFIFOSIZE - Receive FIFO Buffer Depth - * 0b000..1 - * 0b001..4 - * 0b010..8 - * 0b011..16 - * 0b100..32 - * 0b101..64 - * 0b110..128 - * 0b111..256 - */ -#define LPUART_FIFO_RXFIFOSIZE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXFIFOSIZE_SHIFT)) & LPUART_FIFO_RXFIFOSIZE_MASK) - -#define LPUART_FIFO_RXFE_MASK (0x8U) -#define LPUART_FIFO_RXFE_SHIFT (3U) -/*! RXFE - Receive FIFO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_FIFO_RXFE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXFE_SHIFT)) & LPUART_FIFO_RXFE_MASK) - -#define LPUART_FIFO_TXFIFOSIZE_MASK (0x70U) -#define LPUART_FIFO_TXFIFOSIZE_SHIFT (4U) -/*! TXFIFOSIZE - Transmit FIFO Buffer Depth - * 0b000..1 - * 0b001..4 - * 0b010..8 - * 0b011..16 - * 0b100..32 - * 0b101..64 - * 0b110..128 - * 0b111..256 - */ -#define LPUART_FIFO_TXFIFOSIZE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_TXFIFOSIZE_SHIFT)) & LPUART_FIFO_TXFIFOSIZE_MASK) - -#define LPUART_FIFO_TXFE_MASK (0x80U) -#define LPUART_FIFO_TXFE_SHIFT (7U) -/*! TXFE - Transmit FIFO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_FIFO_TXFE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_TXFE_SHIFT)) & LPUART_FIFO_TXFE_MASK) - -#define LPUART_FIFO_RXUFE_MASK (0x100U) -#define LPUART_FIFO_RXUFE_SHIFT (8U) -/*! RXUFE - Receive FIFO Underflow Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_FIFO_RXUFE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXUFE_SHIFT)) & LPUART_FIFO_RXUFE_MASK) - -#define LPUART_FIFO_TXOFE_MASK (0x200U) -#define LPUART_FIFO_TXOFE_SHIFT (9U) -/*! TXOFE - Transmit FIFO Overflow Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_FIFO_TXOFE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_TXOFE_SHIFT)) & LPUART_FIFO_TXOFE_MASK) - -#define LPUART_FIFO_RXIDEN_MASK (0x1C00U) -#define LPUART_FIFO_RXIDEN_SHIFT (10U) -/*! RXIDEN - Receiver Idle Empty Enable - * 0b000..Disable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle - * 0b001..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for one character - * 0b010..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for two characters - * 0b011..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for four characters - * 0b100..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for eight characters - * 0b101..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for 16 characters - * 0b110..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for 32 characters - * 0b111..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for 64 characters - */ -#define LPUART_FIFO_RXIDEN(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXIDEN_SHIFT)) & LPUART_FIFO_RXIDEN_MASK) - -#define LPUART_FIFO_RXFLUSH_MASK (0x4000U) -#define LPUART_FIFO_RXFLUSH_SHIFT (14U) -/*! RXFLUSH - Receive FIFO Flush - * 0b0..No effect - * 0b1..All data flushed out - */ -#define LPUART_FIFO_RXFLUSH(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXFLUSH_SHIFT)) & LPUART_FIFO_RXFLUSH_MASK) - -#define LPUART_FIFO_TXFLUSH_MASK (0x8000U) -#define LPUART_FIFO_TXFLUSH_SHIFT (15U) -/*! TXFLUSH - Transmit FIFO Flush - * 0b0..No effect - * 0b1..All data flushed out - */ -#define LPUART_FIFO_TXFLUSH(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_TXFLUSH_SHIFT)) & LPUART_FIFO_TXFLUSH_MASK) - -#define LPUART_FIFO_RXUF_MASK (0x10000U) -#define LPUART_FIFO_RXUF_SHIFT (16U) -/*! RXUF - Receiver FIFO Underflow Flag - * 0b0..No underflow - * 0b1..Underflow - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_FIFO_RXUF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXUF_SHIFT)) & LPUART_FIFO_RXUF_MASK) - -#define LPUART_FIFO_TXOF_MASK (0x20000U) -#define LPUART_FIFO_TXOF_SHIFT (17U) -/*! TXOF - Transmitter FIFO Overflow Flag - * 0b0..No overflow - * 0b1..Overflow - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_FIFO_TXOF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_TXOF_SHIFT)) & LPUART_FIFO_TXOF_MASK) - -#define LPUART_FIFO_RXEMPT_MASK (0x400000U) -#define LPUART_FIFO_RXEMPT_SHIFT (22U) -/*! RXEMPT - Receive FIFO Or Buffer Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPUART_FIFO_RXEMPT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXEMPT_SHIFT)) & LPUART_FIFO_RXEMPT_MASK) - -#define LPUART_FIFO_TXEMPT_MASK (0x800000U) -#define LPUART_FIFO_TXEMPT_SHIFT (23U) -/*! TXEMPT - Transmit FIFO Or Buffer Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPUART_FIFO_TXEMPT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_TXEMPT_SHIFT)) & LPUART_FIFO_TXEMPT_MASK) -/*! @} */ - -/*! @name WATER - Watermark */ -/*! @{ */ - -#define LPUART_WATER_TXWATER_MASK (0x3U) -#define LPUART_WATER_TXWATER_SHIFT (0U) -/*! TXWATER - Transmit Watermark */ -#define LPUART_WATER_TXWATER(x) (((uint32_t)(((uint32_t)(x)) << LPUART_WATER_TXWATER_SHIFT)) & LPUART_WATER_TXWATER_MASK) - -#define LPUART_WATER_TXCOUNT_MASK (0x700U) -#define LPUART_WATER_TXCOUNT_SHIFT (8U) -/*! TXCOUNT - Transmit Counter */ -#define LPUART_WATER_TXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_WATER_TXCOUNT_SHIFT)) & LPUART_WATER_TXCOUNT_MASK) - -#define LPUART_WATER_RXWATER_MASK (0x30000U) -#define LPUART_WATER_RXWATER_SHIFT (16U) -/*! RXWATER - Receive Watermark */ -#define LPUART_WATER_RXWATER(x) (((uint32_t)(((uint32_t)(x)) << LPUART_WATER_RXWATER_SHIFT)) & LPUART_WATER_RXWATER_MASK) - -#define LPUART_WATER_RXCOUNT_MASK (0x7000000U) -#define LPUART_WATER_RXCOUNT_SHIFT (24U) -/*! RXCOUNT - Receive Counter */ -#define LPUART_WATER_RXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_WATER_RXCOUNT_SHIFT)) & LPUART_WATER_RXCOUNT_MASK) -/*! @} */ - -/*! @name DATARO - Data Read-Only */ -/*! @{ */ - -#define LPUART_DATARO_DATA_MASK (0xFFFFU) -#define LPUART_DATARO_DATA_SHIFT (0U) -/*! DATA - Receive Data */ -#define LPUART_DATARO_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATARO_DATA_SHIFT)) & LPUART_DATARO_DATA_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group LPUART_Register_Masks */ - - -/* LPUART - Peripheral instance base addresses */ -/** Peripheral LPUART0 base address */ -#define LPUART0_BASE (0x4009F000u) -/** Peripheral LPUART0 base pointer */ -#define LPUART0 ((LPUART_Type *)LPUART0_BASE) -/** Peripheral LPUART1 base address */ -#define LPUART1_BASE (0x400A0000u) -/** Peripheral LPUART1 base pointer */ -#define LPUART1 ((LPUART_Type *)LPUART1_BASE) -/** Peripheral LPUART2 base address */ -#define LPUART2_BASE (0x400A1000u) -/** Peripheral LPUART2 base pointer */ -#define LPUART2 ((LPUART_Type *)LPUART2_BASE) -/** Array initializer of LPUART peripheral base addresses */ -#define LPUART_BASE_ADDRS { LPUART0_BASE, LPUART1_BASE, LPUART2_BASE } -/** Array initializer of LPUART peripheral base pointers */ -#define LPUART_BASE_PTRS { LPUART0, LPUART1, LPUART2 } -/** Interrupt vectors for the LPUART peripheral type */ -#define LPUART_RX_TX_IRQS { LPUART0_IRQn, LPUART1_IRQn, LPUART2_IRQn } -#define LPUART_ERR_IRQS { LPUART0_IRQn, LPUART1_IRQn, LPUART2_IRQn } - -/*! - * @} - */ /* end of group LPUART_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- MRCC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup MRCC_Peripheral_Access_Layer MRCC Peripheral Access Layer - * @{ - */ - -/** MRCC - Register Layout Typedef */ -typedef struct { - __IO uint32_t MRCC_GLB_RST0; /**< Peripheral Reset Control 0, offset: 0x0 */ - __O uint32_t MRCC_GLB_RST0_SET; /**< Peripheral Reset Control Set 0, offset: 0x4 */ - __O uint32_t MRCC_GLB_RST0_CLR; /**< Peripheral Reset Control Clear 0, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __IO uint32_t MRCC_GLB_RST1; /**< Peripheral Reset Control 1, offset: 0x10 */ - __O uint32_t MRCC_GLB_RST1_SET; /**< Peripheral Reset Control Set 1, offset: 0x14 */ - __O uint32_t MRCC_GLB_RST1_CLR; /**< Peripheral Reset Control Clear 1, offset: 0x18 */ - uint8_t RESERVED_1[36]; - __IO uint32_t MRCC_GLB_CC0; /**< AHB Clock Control 0, offset: 0x40 */ - __O uint32_t MRCC_GLB_CC0_SET; /**< AHB Clock Control Set 0, offset: 0x44 */ - __O uint32_t MRCC_GLB_CC0_CLR; /**< AHB Clock Control Clear 0, offset: 0x48 */ - uint8_t RESERVED_2[4]; - __IO uint32_t MRCC_GLB_CC1; /**< AHB Clock Control 1, offset: 0x50 */ - __O uint32_t MRCC_GLB_CC1_SET; /**< AHB Clock Control Set 1, offset: 0x54 */ - __O uint32_t MRCC_GLB_CC1_CLR; /**< AHB Clock Control Clear 1, offset: 0x58 */ - uint8_t RESERVED_3[36]; - __IO uint32_t MRCC_GLB_ACC0; /**< Control Automatic Clock Gating 0, offset: 0x80 */ - __IO uint32_t MRCC_GLB_ACC1; /**< Control Automatic Clock Gating 1, offset: 0x84 */ - uint8_t RESERVED_4[24]; - __IO uint32_t MRCC_I3C0_FCLK_CLKSEL; /**< I3C0_FCLK clock selection control, offset: 0xA0 */ - __IO uint32_t MRCC_I3C0_FCLK_CLKDIV; /**< I3C0_FCLK clock divider control, offset: 0xA4 */ - __IO uint32_t MRCC_CTIMER0_CLKSEL; /**< CTIMER0 clock selection control, offset: 0xA8 */ - __IO uint32_t MRCC_CTIMER0_CLKDIV; /**< CTIMER0 clock divider control, offset: 0xAC */ - __IO uint32_t MRCC_CTIMER1_CLKSEL; /**< CTIMER1 clock selection control, offset: 0xB0 */ - __IO uint32_t MRCC_CTIMER1_CLKDIV; /**< CTIMER1 clock divider control, offset: 0xB4 */ - __IO uint32_t MRCC_CTIMER2_CLKSEL; /**< CTIMER2 clock selection control, offset: 0xB8 */ - __IO uint32_t MRCC_CTIMER2_CLKDIV; /**< CTIMER2 clock divider control, offset: 0xBC */ - uint8_t RESERVED_5[4]; - __IO uint32_t MRCC_WWDT0_CLKDIV; /**< WWDT0 clock divider control, offset: 0xC4 */ - __IO uint32_t MRCC_LPI2C0_CLKSEL; /**< LPI2C0 clock selection control, offset: 0xC8 */ - __IO uint32_t MRCC_LPI2C0_CLKDIV; /**< LPI2C0 clock divider control, offset: 0xCC */ - __IO uint32_t MRCC_LPSPI0_CLKSEL; /**< LPSPI0 clock selection control, offset: 0xD0 */ - __IO uint32_t MRCC_LPSPI0_CLKDIV; /**< LPSPI0 clock divider control, offset: 0xD4 */ - __IO uint32_t MRCC_LPSPI1_CLKSEL; /**< LPSPI1 clock selection control, offset: 0xD8 */ - __IO uint32_t MRCC_LPSPI1_CLKDIV; /**< LPSPI1 clock divider control, offset: 0xDC */ - __IO uint32_t MRCC_LPUART0_CLKSEL; /**< LPUART0 clock selection control, offset: 0xE0 */ - __IO uint32_t MRCC_LPUART0_CLKDIV; /**< LPUART0 clock divider control, offset: 0xE4 */ - __IO uint32_t MRCC_LPUART1_CLKSEL; /**< LPUART1 clock selection control, offset: 0xE8 */ - __IO uint32_t MRCC_LPUART1_CLKDIV; /**< LPUART1 clock divider control, offset: 0xEC */ - __IO uint32_t MRCC_LPUART2_CLKSEL; /**< LPUART2 clock selection control, offset: 0xF0 */ - __IO uint32_t MRCC_LPUART2_CLKDIV; /**< LPUART2 clock divider control, offset: 0xF4 */ - __IO uint32_t MRCC_USB0_CLKSEL; /**< USB0 clock selection control, offset: 0xF8 */ - uint8_t RESERVED_6[4]; - __IO uint32_t MRCC_LPTMR0_CLKSEL; /**< LPTMR0 clock selection control, offset: 0x100 */ - __IO uint32_t MRCC_LPTMR0_CLKDIV; /**< LPTMR0 clock divider control, offset: 0x104 */ - __IO uint32_t MRCC_OSTIMER0_CLKSEL; /**< OSTIMER0 clock selection control, offset: 0x108 */ - uint8_t RESERVED_7[4]; - __IO uint32_t MRCC_ADC0_CLKSEL; /**< ADC0 clock selection control, offset: 0x110 */ - __IO uint32_t MRCC_ADC0_CLKDIV; /**< ADC0 clock divider control, offset: 0x114 */ - uint8_t RESERVED_8[4]; - __IO uint32_t MRCC_CMP0_FUNC_CLKDIV; /**< CMP0_FUNC clock divider control, offset: 0x11C */ - __IO uint32_t MRCC_CMP0_RR_CLKSEL; /**< CMP0_RR clock selection control, offset: 0x120 */ - __IO uint32_t MRCC_CMP0_RR_CLKDIV; /**< CMP0_RR clock divider control, offset: 0x124 */ - uint8_t RESERVED_9[4]; - __IO uint32_t MRCC_CMP1_FUNC_CLKDIV; /**< CMP1_FUNC clock divider control, offset: 0x12C */ - __IO uint32_t MRCC_CMP1_RR_CLKSEL; /**< CMP1_RR clock selection control, offset: 0x130 */ - __IO uint32_t MRCC_CMP1_RR_CLKDIV; /**< CMP1_RR clock divider control, offset: 0x134 */ - __IO uint32_t MRCC_DBG_TRACE_CLKSEL; /**< DBG_TRACE clock selection control, offset: 0x138 */ - __IO uint32_t MRCC_DBG_TRACE_CLKDIV; /**< DBG_TRACE clock divider control, offset: 0x13C */ - __IO uint32_t MRCC_CLKOUT_CLKSEL; /**< CLKOUT clock selection control, offset: 0x140 */ - __IO uint32_t MRCC_CLKOUT_CLKDIV; /**< CLKOUT clock divider control, offset: 0x144 */ - __IO uint32_t MRCC_SYSTICK_CLKSEL; /**< SYSTICK clock selection control, offset: 0x148 */ - __IO uint32_t MRCC_SYSTICK_CLKDIV; /**< SYSTICK clock divider control, offset: 0x14C */ - uint8_t RESERVED_10[4]; - __IO uint32_t MRCC_FRO_HF_DIV_CLKDIV; /**< FRO_HF_DIV clock divider control, offset: 0x154 */ -} MRCC_Type; - -/* ---------------------------------------------------------------------------- - -- MRCC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup MRCC_Register_Masks MRCC Register Masks - * @{ - */ - -/*! @name MRCC_GLB_RST0 - Peripheral Reset Control 0 */ -/*! @{ */ - -#define MRCC_MRCC_GLB_RST0_INPUTMUX0_MASK (0x1U) -#define MRCC_MRCC_GLB_RST0_INPUTMUX0_SHIFT (0U) -/*! INPUTMUX0 - Write to INPUTMUX0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_INPUTMUX0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_INPUTMUX0_SHIFT)) & MRCC_MRCC_GLB_RST0_INPUTMUX0_MASK) - -#define MRCC_MRCC_GLB_RST0_I3C0_MASK (0x2U) -#define MRCC_MRCC_GLB_RST0_I3C0_SHIFT (1U) -/*! I3C0 - Write to I3C0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_I3C0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_I3C0_SHIFT)) & MRCC_MRCC_GLB_RST0_I3C0_MASK) - -#define MRCC_MRCC_GLB_RST0_CTIMER0_MASK (0x4U) -#define MRCC_MRCC_GLB_RST0_CTIMER0_SHIFT (2U) -/*! CTIMER0 - Write to CTIMER0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_CTIMER0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_CTIMER0_SHIFT)) & MRCC_MRCC_GLB_RST0_CTIMER0_MASK) - -#define MRCC_MRCC_GLB_RST0_CTIMER1_MASK (0x8U) -#define MRCC_MRCC_GLB_RST0_CTIMER1_SHIFT (3U) -/*! CTIMER1 - Write to CTIMER1 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_CTIMER1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_CTIMER1_SHIFT)) & MRCC_MRCC_GLB_RST0_CTIMER1_MASK) - -#define MRCC_MRCC_GLB_RST0_CTIMER2_MASK (0x10U) -#define MRCC_MRCC_GLB_RST0_CTIMER2_SHIFT (4U) -/*! CTIMER2 - Write to CTIMER2 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_CTIMER2(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_CTIMER2_SHIFT)) & MRCC_MRCC_GLB_RST0_CTIMER2_MASK) - -#define MRCC_MRCC_GLB_RST0_FREQME_MASK (0x20U) -#define MRCC_MRCC_GLB_RST0_FREQME_SHIFT (5U) -/*! FREQME - Write to FREQME - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_FREQME(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_FREQME_SHIFT)) & MRCC_MRCC_GLB_RST0_FREQME_MASK) - -#define MRCC_MRCC_GLB_RST0_UTICK0_MASK (0x40U) -#define MRCC_MRCC_GLB_RST0_UTICK0_SHIFT (6U) -/*! UTICK0 - Write to UTICK0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_UTICK0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_UTICK0_SHIFT)) & MRCC_MRCC_GLB_RST0_UTICK0_MASK) - -#define MRCC_MRCC_GLB_RST0_DMA_MASK (0x100U) -#define MRCC_MRCC_GLB_RST0_DMA_SHIFT (8U) -/*! DMA - Write to DMA - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_DMA(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_DMA_SHIFT)) & MRCC_MRCC_GLB_RST0_DMA_MASK) - -#define MRCC_MRCC_GLB_RST0_AOI0_MASK (0x200U) -#define MRCC_MRCC_GLB_RST0_AOI0_SHIFT (9U) -/*! AOI0 - Write to AOI0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_AOI0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_AOI0_SHIFT)) & MRCC_MRCC_GLB_RST0_AOI0_MASK) - -#define MRCC_MRCC_GLB_RST0_CRC_MASK (0x400U) -#define MRCC_MRCC_GLB_RST0_CRC_SHIFT (10U) -/*! CRC - Write to CRC - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_CRC(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_CRC_SHIFT)) & MRCC_MRCC_GLB_RST0_CRC_MASK) - -#define MRCC_MRCC_GLB_RST0_EIM_MASK (0x800U) -#define MRCC_MRCC_GLB_RST0_EIM_SHIFT (11U) -/*! EIM - Write to EIM - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_EIM(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_EIM_SHIFT)) & MRCC_MRCC_GLB_RST0_EIM_MASK) - -#define MRCC_MRCC_GLB_RST0_ERM_MASK (0x1000U) -#define MRCC_MRCC_GLB_RST0_ERM_SHIFT (12U) -/*! ERM - Write to ERM - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_ERM(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_ERM_SHIFT)) & MRCC_MRCC_GLB_RST0_ERM_MASK) - -#define MRCC_MRCC_GLB_RST0_LPI2C0_MASK (0x10000U) -#define MRCC_MRCC_GLB_RST0_LPI2C0_SHIFT (16U) -/*! LPI2C0 - Write to LPI2C0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_LPI2C0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_LPI2C0_SHIFT)) & MRCC_MRCC_GLB_RST0_LPI2C0_MASK) - -#define MRCC_MRCC_GLB_RST0_LPSPI0_MASK (0x20000U) -#define MRCC_MRCC_GLB_RST0_LPSPI0_SHIFT (17U) -/*! LPSPI0 - Write to LPSPI0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_LPSPI0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_LPSPI0_SHIFT)) & MRCC_MRCC_GLB_RST0_LPSPI0_MASK) - -#define MRCC_MRCC_GLB_RST0_LPSPI1_MASK (0x40000U) -#define MRCC_MRCC_GLB_RST0_LPSPI1_SHIFT (18U) -/*! LPSPI1 - Write to LPSPI1 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_LPSPI1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_LPSPI1_SHIFT)) & MRCC_MRCC_GLB_RST0_LPSPI1_MASK) - -#define MRCC_MRCC_GLB_RST0_LPUART0_MASK (0x80000U) -#define MRCC_MRCC_GLB_RST0_LPUART0_SHIFT (19U) -/*! LPUART0 - Write to LPUART0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_LPUART0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_LPUART0_SHIFT)) & MRCC_MRCC_GLB_RST0_LPUART0_MASK) - -#define MRCC_MRCC_GLB_RST0_LPUART1_MASK (0x100000U) -#define MRCC_MRCC_GLB_RST0_LPUART1_SHIFT (20U) -/*! LPUART1 - Write to LPUART1 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_LPUART1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_LPUART1_SHIFT)) & MRCC_MRCC_GLB_RST0_LPUART1_MASK) - -#define MRCC_MRCC_GLB_RST0_LPUART2_MASK (0x200000U) -#define MRCC_MRCC_GLB_RST0_LPUART2_SHIFT (21U) -/*! LPUART2 - Write to LPUART2 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_LPUART2(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_LPUART2_SHIFT)) & MRCC_MRCC_GLB_RST0_LPUART2_MASK) - -#define MRCC_MRCC_GLB_RST0_USB0_MASK (0x400000U) -#define MRCC_MRCC_GLB_RST0_USB0_SHIFT (22U) -/*! USB0 - Write to USB0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_USB0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_USB0_SHIFT)) & MRCC_MRCC_GLB_RST0_USB0_MASK) - -#define MRCC_MRCC_GLB_RST0_QDC0_MASK (0x800000U) -#define MRCC_MRCC_GLB_RST0_QDC0_SHIFT (23U) -/*! QDC0 - Write to QDC0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_QDC0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_QDC0_SHIFT)) & MRCC_MRCC_GLB_RST0_QDC0_MASK) - -#define MRCC_MRCC_GLB_RST0_FLEXPWM0_MASK (0x1000000U) -#define MRCC_MRCC_GLB_RST0_FLEXPWM0_SHIFT (24U) -/*! FLEXPWM0 - Write to FLEXPWM0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_FLEXPWM0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_FLEXPWM0_SHIFT)) & MRCC_MRCC_GLB_RST0_FLEXPWM0_MASK) - -#define MRCC_MRCC_GLB_RST0_OSTIMER0_MASK (0x2000000U) -#define MRCC_MRCC_GLB_RST0_OSTIMER0_SHIFT (25U) -/*! OSTIMER0 - Write to OSTIMER0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_OSTIMER0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_OSTIMER0_SHIFT)) & MRCC_MRCC_GLB_RST0_OSTIMER0_MASK) - -#define MRCC_MRCC_GLB_RST0_ADC0_MASK (0x4000000U) -#define MRCC_MRCC_GLB_RST0_ADC0_SHIFT (26U) -/*! ADC0 - Write to ADC0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_ADC0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_ADC0_SHIFT)) & MRCC_MRCC_GLB_RST0_ADC0_MASK) - -#define MRCC_MRCC_GLB_RST0_CMP1_MASK (0x10000000U) -#define MRCC_MRCC_GLB_RST0_CMP1_SHIFT (28U) -/*! CMP1 - Write to CMP1 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_CMP1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_CMP1_SHIFT)) & MRCC_MRCC_GLB_RST0_CMP1_MASK) - -#define MRCC_MRCC_GLB_RST0_PORT0_MASK (0x20000000U) -#define MRCC_MRCC_GLB_RST0_PORT0_SHIFT (29U) -/*! PORT0 - Write to PORT0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_PORT0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_PORT0_SHIFT)) & MRCC_MRCC_GLB_RST0_PORT0_MASK) - -#define MRCC_MRCC_GLB_RST0_PORT1_MASK (0x40000000U) -#define MRCC_MRCC_GLB_RST0_PORT1_SHIFT (30U) -/*! PORT1 - Write to PORT1 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_PORT1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_PORT1_SHIFT)) & MRCC_MRCC_GLB_RST0_PORT1_MASK) - -#define MRCC_MRCC_GLB_RST0_PORT2_MASK (0x80000000U) -#define MRCC_MRCC_GLB_RST0_PORT2_SHIFT (31U) -/*! PORT2 - Write to PORT2 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_PORT2(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_PORT2_SHIFT)) & MRCC_MRCC_GLB_RST0_PORT2_MASK) -/*! @} */ - -/*! @name MRCC_GLB_RST0_SET - Peripheral Reset Control Set 0 */ -/*! @{ */ - -#define MRCC_MRCC_GLB_RST0_SET_DATA_MASK (0xFFFFFFFFU) -#define MRCC_MRCC_GLB_RST0_SET_DATA_SHIFT (0U) -/*! DATA - Data array value, refer to corresponding position in MRCC_GLB_RSTn. */ -#define MRCC_MRCC_GLB_RST0_SET_DATA(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_SET_DATA_SHIFT)) & MRCC_MRCC_GLB_RST0_SET_DATA_MASK) -/*! @} */ - -/*! @name MRCC_GLB_RST0_CLR - Peripheral Reset Control Clear 0 */ -/*! @{ */ - -#define MRCC_MRCC_GLB_RST0_CLR_DATA_MASK (0xFFFFFFFFU) -#define MRCC_MRCC_GLB_RST0_CLR_DATA_SHIFT (0U) -/*! DATA - Data array value, refer to corresponding position in MRCC_GLB_RSTn. */ -#define MRCC_MRCC_GLB_RST0_CLR_DATA(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_CLR_DATA_SHIFT)) & MRCC_MRCC_GLB_RST0_CLR_DATA_MASK) -/*! @} */ - -/*! @name MRCC_GLB_RST1 - Peripheral Reset Control 1 */ -/*! @{ */ - -#define MRCC_MRCC_GLB_RST1_PORT3_MASK (0x1U) -#define MRCC_MRCC_GLB_RST1_PORT3_SHIFT (0U) -/*! PORT3 - Write to PORT3 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST1_PORT3(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST1_PORT3_SHIFT)) & MRCC_MRCC_GLB_RST1_PORT3_MASK) - -#define MRCC_MRCC_GLB_RST1_GPIO0_MASK (0x20U) -#define MRCC_MRCC_GLB_RST1_GPIO0_SHIFT (5U) -/*! GPIO0 - Write to GPIO0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST1_GPIO0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST1_GPIO0_SHIFT)) & MRCC_MRCC_GLB_RST1_GPIO0_MASK) - -#define MRCC_MRCC_GLB_RST1_GPIO1_MASK (0x40U) -#define MRCC_MRCC_GLB_RST1_GPIO1_SHIFT (6U) -/*! GPIO1 - Write to GPIO1 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST1_GPIO1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST1_GPIO1_SHIFT)) & MRCC_MRCC_GLB_RST1_GPIO1_MASK) - -#define MRCC_MRCC_GLB_RST1_GPIO2_MASK (0x80U) -#define MRCC_MRCC_GLB_RST1_GPIO2_SHIFT (7U) -/*! GPIO2 - Write to GPIO2 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST1_GPIO2(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST1_GPIO2_SHIFT)) & MRCC_MRCC_GLB_RST1_GPIO2_MASK) - -#define MRCC_MRCC_GLB_RST1_GPIO3_MASK (0x100U) -#define MRCC_MRCC_GLB_RST1_GPIO3_SHIFT (8U) -/*! GPIO3 - Write to GPIO3 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST1_GPIO3(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST1_GPIO3_SHIFT)) & MRCC_MRCC_GLB_RST1_GPIO3_MASK) -/*! @} */ - -/*! @name MRCC_GLB_RST1_SET - Peripheral Reset Control Set 1 */ -/*! @{ */ - -#define MRCC_MRCC_GLB_RST1_SET_DATA_MASK (0xFFFFFFFFU) -#define MRCC_MRCC_GLB_RST1_SET_DATA_SHIFT (0U) -/*! DATA - Data array value, refer to corresponding position in MRCC_GLB_RSTn. */ -#define MRCC_MRCC_GLB_RST1_SET_DATA(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST1_SET_DATA_SHIFT)) & MRCC_MRCC_GLB_RST1_SET_DATA_MASK) -/*! @} */ - -/*! @name MRCC_GLB_RST1_CLR - Peripheral Reset Control Clear 1 */ -/*! @{ */ - -#define MRCC_MRCC_GLB_RST1_CLR_DATA_MASK (0xFFFFFFFFU) -#define MRCC_MRCC_GLB_RST1_CLR_DATA_SHIFT (0U) -/*! DATA - Data array value, refer to corresponding position in MRCC_GLB_RSTn. */ -#define MRCC_MRCC_GLB_RST1_CLR_DATA(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST1_CLR_DATA_SHIFT)) & MRCC_MRCC_GLB_RST1_CLR_DATA_MASK) -/*! @} */ - -/*! @name MRCC_GLB_CC0 - AHB Clock Control 0 */ -/*! @{ */ - -#define MRCC_MRCC_GLB_CC0_INPUTMUX0_MASK (0x1U) -#define MRCC_MRCC_GLB_CC0_INPUTMUX0_SHIFT (0U) -/*! INPUTMUX0 - write to INPUTMUX0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_INPUTMUX0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_INPUTMUX0_SHIFT)) & MRCC_MRCC_GLB_CC0_INPUTMUX0_MASK) - -#define MRCC_MRCC_GLB_CC0_I3C0_MASK (0x2U) -#define MRCC_MRCC_GLB_CC0_I3C0_SHIFT (1U) -/*! I3C0 - Write to I3C0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_I3C0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_I3C0_SHIFT)) & MRCC_MRCC_GLB_CC0_I3C0_MASK) - -#define MRCC_MRCC_GLB_CC0_CTIMER0_MASK (0x4U) -#define MRCC_MRCC_GLB_CC0_CTIMER0_SHIFT (2U) -/*! CTIMER0 - Write to CTIMER0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_CTIMER0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_CTIMER0_SHIFT)) & MRCC_MRCC_GLB_CC0_CTIMER0_MASK) - -#define MRCC_MRCC_GLB_CC0_CTIMER1_MASK (0x8U) -#define MRCC_MRCC_GLB_CC0_CTIMER1_SHIFT (3U) -/*! CTIMER1 - Write to CTIMER1 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_CTIMER1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_CTIMER1_SHIFT)) & MRCC_MRCC_GLB_CC0_CTIMER1_MASK) - -#define MRCC_MRCC_GLB_CC0_CTIMER2_MASK (0x10U) -#define MRCC_MRCC_GLB_CC0_CTIMER2_SHIFT (4U) -/*! CTIMER2 - Write to CTIMER2 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_CTIMER2(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_CTIMER2_SHIFT)) & MRCC_MRCC_GLB_CC0_CTIMER2_MASK) - -#define MRCC_MRCC_GLB_CC0_FREQME_MASK (0x20U) -#define MRCC_MRCC_GLB_CC0_FREQME_SHIFT (5U) -/*! FREQME - Write to FREQME - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_FREQME(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_FREQME_SHIFT)) & MRCC_MRCC_GLB_CC0_FREQME_MASK) - -#define MRCC_MRCC_GLB_CC0_UTICK0_MASK (0x40U) -#define MRCC_MRCC_GLB_CC0_UTICK0_SHIFT (6U) -/*! UTICK0 - Write to UTICK0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_UTICK0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_UTICK0_SHIFT)) & MRCC_MRCC_GLB_CC0_UTICK0_MASK) - -#define MRCC_MRCC_GLB_CC0_WWDT0_MASK (0x80U) -#define MRCC_MRCC_GLB_CC0_WWDT0_SHIFT (7U) -/*! WWDT0 - Write to WWDT0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_WWDT0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_WWDT0_SHIFT)) & MRCC_MRCC_GLB_CC0_WWDT0_MASK) - -#define MRCC_MRCC_GLB_CC0_DMA_MASK (0x100U) -#define MRCC_MRCC_GLB_CC0_DMA_SHIFT (8U) -/*! DMA - Write to DMA - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_DMA(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_DMA_SHIFT)) & MRCC_MRCC_GLB_CC0_DMA_MASK) - -#define MRCC_MRCC_GLB_CC0_AOI0_MASK (0x200U) -#define MRCC_MRCC_GLB_CC0_AOI0_SHIFT (9U) -/*! AOI0 - Write to AOI0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_AOI0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_AOI0_SHIFT)) & MRCC_MRCC_GLB_CC0_AOI0_MASK) - -#define MRCC_MRCC_GLB_CC0_CRC_MASK (0x400U) -#define MRCC_MRCC_GLB_CC0_CRC_SHIFT (10U) -/*! CRC - Write to CRC - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_CRC(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_CRC_SHIFT)) & MRCC_MRCC_GLB_CC0_CRC_MASK) - -#define MRCC_MRCC_GLB_CC0_EIM_MASK (0x800U) -#define MRCC_MRCC_GLB_CC0_EIM_SHIFT (11U) -/*! EIM - Write to EIM - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_EIM(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_EIM_SHIFT)) & MRCC_MRCC_GLB_CC0_EIM_MASK) - -#define MRCC_MRCC_GLB_CC0_ERM_MASK (0x1000U) -#define MRCC_MRCC_GLB_CC0_ERM_SHIFT (12U) -/*! ERM - Write to ERM - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_ERM(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_ERM_SHIFT)) & MRCC_MRCC_GLB_CC0_ERM_MASK) - -#define MRCC_MRCC_GLB_CC0_LPI2C0_MASK (0x10000U) -#define MRCC_MRCC_GLB_CC0_LPI2C0_SHIFT (16U) -/*! LPI2C0 - Write to LPI2C0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_LPI2C0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_LPI2C0_SHIFT)) & MRCC_MRCC_GLB_CC0_LPI2C0_MASK) - -#define MRCC_MRCC_GLB_CC0_LPSPI0_MASK (0x20000U) -#define MRCC_MRCC_GLB_CC0_LPSPI0_SHIFT (17U) -/*! LPSPI0 - Write to LPSPI0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_LPSPI0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_LPSPI0_SHIFT)) & MRCC_MRCC_GLB_CC0_LPSPI0_MASK) - -#define MRCC_MRCC_GLB_CC0_LPSPI1_MASK (0x40000U) -#define MRCC_MRCC_GLB_CC0_LPSPI1_SHIFT (18U) -/*! LPSPI1 - write to LPSPI1 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_LPSPI1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_LPSPI1_SHIFT)) & MRCC_MRCC_GLB_CC0_LPSPI1_MASK) - -#define MRCC_MRCC_GLB_CC0_LPUART0_MASK (0x80000U) -#define MRCC_MRCC_GLB_CC0_LPUART0_SHIFT (19U) -/*! LPUART0 - Write to LPUART0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_LPUART0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_LPUART0_SHIFT)) & MRCC_MRCC_GLB_CC0_LPUART0_MASK) - -#define MRCC_MRCC_GLB_CC0_LPUART1_MASK (0x100000U) -#define MRCC_MRCC_GLB_CC0_LPUART1_SHIFT (20U) -/*! LPUART1 - Write to LPUART1 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_LPUART1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_LPUART1_SHIFT)) & MRCC_MRCC_GLB_CC0_LPUART1_MASK) - -#define MRCC_MRCC_GLB_CC0_LPUART2_MASK (0x200000U) -#define MRCC_MRCC_GLB_CC0_LPUART2_SHIFT (21U) -/*! LPUART2 - Write to LPUART2 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_LPUART2(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_LPUART2_SHIFT)) & MRCC_MRCC_GLB_CC0_LPUART2_MASK) - -#define MRCC_MRCC_GLB_CC0_USB0_MASK (0x400000U) -#define MRCC_MRCC_GLB_CC0_USB0_SHIFT (22U) -/*! USB0 - Write to USB0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_USB0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_USB0_SHIFT)) & MRCC_MRCC_GLB_CC0_USB0_MASK) - -#define MRCC_MRCC_GLB_CC0_QDC0_MASK (0x800000U) -#define MRCC_MRCC_GLB_CC0_QDC0_SHIFT (23U) -/*! QDC0 - Write to QDC0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_QDC0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_QDC0_SHIFT)) & MRCC_MRCC_GLB_CC0_QDC0_MASK) - -#define MRCC_MRCC_GLB_CC0_FLEXPWM0_MASK (0x1000000U) -#define MRCC_MRCC_GLB_CC0_FLEXPWM0_SHIFT (24U) -/*! FLEXPWM0 - Write to FLEXPWM0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_FLEXPWM0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_FLEXPWM0_SHIFT)) & MRCC_MRCC_GLB_CC0_FLEXPWM0_MASK) - -#define MRCC_MRCC_GLB_CC0_OSTIMER0_MASK (0x2000000U) -#define MRCC_MRCC_GLB_CC0_OSTIMER0_SHIFT (25U) -/*! OSTIMER0 - Write to OSTIMER0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_OSTIMER0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_OSTIMER0_SHIFT)) & MRCC_MRCC_GLB_CC0_OSTIMER0_MASK) - -#define MRCC_MRCC_GLB_CC0_ADC0_MASK (0x4000000U) -#define MRCC_MRCC_GLB_CC0_ADC0_SHIFT (26U) -/*! ADC0 - Write to ADC0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_ADC0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_ADC0_SHIFT)) & MRCC_MRCC_GLB_CC0_ADC0_MASK) - -#define MRCC_MRCC_GLB_CC0_CMP0_MASK (0x8000000U) -#define MRCC_MRCC_GLB_CC0_CMP0_SHIFT (27U) -/*! CMP0 - Write to CMP0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_CMP0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_CMP0_SHIFT)) & MRCC_MRCC_GLB_CC0_CMP0_MASK) - -#define MRCC_MRCC_GLB_CC0_CMP1_MASK (0x10000000U) -#define MRCC_MRCC_GLB_CC0_CMP1_SHIFT (28U) -/*! CMP1 - Write to CMP1 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_CMP1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_CMP1_SHIFT)) & MRCC_MRCC_GLB_CC0_CMP1_MASK) - -#define MRCC_MRCC_GLB_CC0_PORT0_MASK (0x20000000U) -#define MRCC_MRCC_GLB_CC0_PORT0_SHIFT (29U) -/*! PORT0 - Write to PORT0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_PORT0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_PORT0_SHIFT)) & MRCC_MRCC_GLB_CC0_PORT0_MASK) - -#define MRCC_MRCC_GLB_CC0_PORT1_MASK (0x40000000U) -#define MRCC_MRCC_GLB_CC0_PORT1_SHIFT (30U) -/*! PORT1 - Write to PORT1 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_PORT1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_PORT1_SHIFT)) & MRCC_MRCC_GLB_CC0_PORT1_MASK) - -#define MRCC_MRCC_GLB_CC0_PORT2_MASK (0x80000000U) -#define MRCC_MRCC_GLB_CC0_PORT2_SHIFT (31U) -/*! PORT2 - Write to PORT2 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_PORT2(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_PORT2_SHIFT)) & MRCC_MRCC_GLB_CC0_PORT2_MASK) -/*! @} */ - -/*! @name MRCC_GLB_CC0_SET - AHB Clock Control Set 0 */ -/*! @{ */ - -#define MRCC_MRCC_GLB_CC0_SET_DATA_MASK (0xFFFFFFFFU) -#define MRCC_MRCC_GLB_CC0_SET_DATA_SHIFT (0U) -/*! DATA - Data array value, refer to corresponding position in MRCC_GLB_CCn. */ -#define MRCC_MRCC_GLB_CC0_SET_DATA(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_SET_DATA_SHIFT)) & MRCC_MRCC_GLB_CC0_SET_DATA_MASK) -/*! @} */ - -/*! @name MRCC_GLB_CC0_CLR - AHB Clock Control Clear 0 */ -/*! @{ */ - -#define MRCC_MRCC_GLB_CC0_CLR_DATA_MASK (0xFFFFFFFFU) -#define MRCC_MRCC_GLB_CC0_CLR_DATA_SHIFT (0U) -/*! DATA - Data array value, refer to corresponding position in MRCC_GLB_CCn. */ -#define MRCC_MRCC_GLB_CC0_CLR_DATA(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_CLR_DATA_SHIFT)) & MRCC_MRCC_GLB_CC0_CLR_DATA_MASK) -/*! @} */ - -/*! @name MRCC_GLB_CC1 - AHB Clock Control 1 */ -/*! @{ */ - -#define MRCC_MRCC_GLB_CC1_PORT3_MASK (0x1U) -#define MRCC_MRCC_GLB_CC1_PORT3_SHIFT (0U) -/*! PORT3 - Write to PORT3 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_PORT3(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_PORT3_SHIFT)) & MRCC_MRCC_GLB_CC1_PORT3_MASK) - -#define MRCC_MRCC_GLB_CC1_MTR_MASK (0x4U) -#define MRCC_MRCC_GLB_CC1_MTR_SHIFT (2U) -/*! MTR - Write to MTR - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_MTR(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_MTR_SHIFT)) & MRCC_MRCC_GLB_CC1_MTR_MASK) - -#define MRCC_MRCC_GLB_CC1_TCU_MASK (0x8U) -#define MRCC_MRCC_GLB_CC1_TCU_SHIFT (3U) -/*! TCU - Write to TCU - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_TCU(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_TCU_SHIFT)) & MRCC_MRCC_GLB_CC1_TCU_MASK) - -#define MRCC_MRCC_GLB_CC1_EZRAMC_RAMA_MASK (0x10U) -#define MRCC_MRCC_GLB_CC1_EZRAMC_RAMA_SHIFT (4U) -/*! EZRAMC_RAMA - Write to EZRAMC_RAMA - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_EZRAMC_RAMA(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_EZRAMC_RAMA_SHIFT)) & MRCC_MRCC_GLB_CC1_EZRAMC_RAMA_MASK) - -#define MRCC_MRCC_GLB_CC1_GPIO0_MASK (0x20U) -#define MRCC_MRCC_GLB_CC1_GPIO0_SHIFT (5U) -/*! GPIO0 - Write to GPIO0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_GPIO0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_GPIO0_SHIFT)) & MRCC_MRCC_GLB_CC1_GPIO0_MASK) - -#define MRCC_MRCC_GLB_CC1_GPIO1_MASK (0x40U) -#define MRCC_MRCC_GLB_CC1_GPIO1_SHIFT (6U) -/*! GPIO1 - Write to GPIO1 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_GPIO1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_GPIO1_SHIFT)) & MRCC_MRCC_GLB_CC1_GPIO1_MASK) - -#define MRCC_MRCC_GLB_CC1_GPIO2_MASK (0x80U) -#define MRCC_MRCC_GLB_CC1_GPIO2_SHIFT (7U) -/*! GPIO2 - Write to GPIO2 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_GPIO2(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_GPIO2_SHIFT)) & MRCC_MRCC_GLB_CC1_GPIO2_MASK) - -#define MRCC_MRCC_GLB_CC1_GPIO3_MASK (0x100U) -#define MRCC_MRCC_GLB_CC1_GPIO3_SHIFT (8U) -/*! GPIO3 - Write to GPIO3 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_GPIO3(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_GPIO3_SHIFT)) & MRCC_MRCC_GLB_CC1_GPIO3_MASK) - -#define MRCC_MRCC_GLB_CC1_ROMCP_MASK (0x200U) -#define MRCC_MRCC_GLB_CC1_ROMCP_SHIFT (9U) -/*! ROMCP - Write to ROMCP - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_ROMCP(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_ROMCP_SHIFT)) & MRCC_MRCC_GLB_CC1_ROMCP_MASK) -/*! @} */ - -/*! @name MRCC_GLB_CC1_SET - AHB Clock Control Set 1 */ -/*! @{ */ - -#define MRCC_MRCC_GLB_CC1_SET_DATA_MASK (0xFFFFFFFFU) -#define MRCC_MRCC_GLB_CC1_SET_DATA_SHIFT (0U) -/*! DATA - Data array value, refer to corresponding position in MRCC_GLB_CCn. */ -#define MRCC_MRCC_GLB_CC1_SET_DATA(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_SET_DATA_SHIFT)) & MRCC_MRCC_GLB_CC1_SET_DATA_MASK) -/*! @} */ - -/*! @name MRCC_GLB_CC1_CLR - AHB Clock Control Clear 1 */ -/*! @{ */ - -#define MRCC_MRCC_GLB_CC1_CLR_DATA_MASK (0xFFFFFFFFU) -#define MRCC_MRCC_GLB_CC1_CLR_DATA_SHIFT (0U) -/*! DATA - Data array value, refer to corresponding position in MRCC_GLB_CCn. */ -#define MRCC_MRCC_GLB_CC1_CLR_DATA(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_CLR_DATA_SHIFT)) & MRCC_MRCC_GLB_CC1_CLR_DATA_MASK) -/*! @} */ - -/*! @name MRCC_GLB_ACC0 - Control Automatic Clock Gating 0 */ -/*! @{ */ - -#define MRCC_MRCC_GLB_ACC0_INPUTMUX0_MASK (0x1U) -#define MRCC_MRCC_GLB_ACC0_INPUTMUX0_SHIFT (0U) -/*! INPUTMUX0 - Write to INPUTMUX0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_INPUTMUX0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_INPUTMUX0_SHIFT)) & MRCC_MRCC_GLB_ACC0_INPUTMUX0_MASK) - -#define MRCC_MRCC_GLB_ACC0_I3C0_MASK (0x2U) -#define MRCC_MRCC_GLB_ACC0_I3C0_SHIFT (1U) -/*! I3C0 - Write to I3C0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_I3C0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_I3C0_SHIFT)) & MRCC_MRCC_GLB_ACC0_I3C0_MASK) - -#define MRCC_MRCC_GLB_ACC0_CTIMER0_MASK (0x4U) -#define MRCC_MRCC_GLB_ACC0_CTIMER0_SHIFT (2U) -/*! CTIMER0 - Write to CTIMER0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_CTIMER0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_CTIMER0_SHIFT)) & MRCC_MRCC_GLB_ACC0_CTIMER0_MASK) - -#define MRCC_MRCC_GLB_ACC0_CTIMER1_MASK (0x8U) -#define MRCC_MRCC_GLB_ACC0_CTIMER1_SHIFT (3U) -/*! CTIMER1 - Write to CTIMER1 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_CTIMER1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_CTIMER1_SHIFT)) & MRCC_MRCC_GLB_ACC0_CTIMER1_MASK) - -#define MRCC_MRCC_GLB_ACC0_CTIMER2_MASK (0x10U) -#define MRCC_MRCC_GLB_ACC0_CTIMER2_SHIFT (4U) -/*! CTIMER2 - Write to CTIMER2 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_CTIMER2(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_CTIMER2_SHIFT)) & MRCC_MRCC_GLB_ACC0_CTIMER2_MASK) - -#define MRCC_MRCC_GLB_ACC0_FREQME_MASK (0x20U) -#define MRCC_MRCC_GLB_ACC0_FREQME_SHIFT (5U) -/*! FREQME - Write to FREQME - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_FREQME(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_FREQME_SHIFT)) & MRCC_MRCC_GLB_ACC0_FREQME_MASK) - -#define MRCC_MRCC_GLB_ACC0_UTICK0_MASK (0x40U) -#define MRCC_MRCC_GLB_ACC0_UTICK0_SHIFT (6U) -/*! UTICK0 - Write to UTICK0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_UTICK0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_UTICK0_SHIFT)) & MRCC_MRCC_GLB_ACC0_UTICK0_MASK) - -#define MRCC_MRCC_GLB_ACC0_WWDT0_MASK (0x80U) -#define MRCC_MRCC_GLB_ACC0_WWDT0_SHIFT (7U) -/*! WWDT0 - Write to WWDT0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_WWDT0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_WWDT0_SHIFT)) & MRCC_MRCC_GLB_ACC0_WWDT0_MASK) - -#define MRCC_MRCC_GLB_ACC0_DMA_MASK (0x100U) -#define MRCC_MRCC_GLB_ACC0_DMA_SHIFT (8U) -/*! DMA - Write to DMA - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_DMA(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_DMA_SHIFT)) & MRCC_MRCC_GLB_ACC0_DMA_MASK) - -#define MRCC_MRCC_GLB_ACC0_AOI0_MASK (0x200U) -#define MRCC_MRCC_GLB_ACC0_AOI0_SHIFT (9U) -/*! AOI0 - Write to AOI0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_AOI0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_AOI0_SHIFT)) & MRCC_MRCC_GLB_ACC0_AOI0_MASK) - -#define MRCC_MRCC_GLB_ACC0_CRC_MASK (0x400U) -#define MRCC_MRCC_GLB_ACC0_CRC_SHIFT (10U) -/*! CRC - Write to CRC - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_CRC(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_CRC_SHIFT)) & MRCC_MRCC_GLB_ACC0_CRC_MASK) - -#define MRCC_MRCC_GLB_ACC0_EIM_MASK (0x800U) -#define MRCC_MRCC_GLB_ACC0_EIM_SHIFT (11U) -/*! EIM - Write to EIM - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_EIM(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_EIM_SHIFT)) & MRCC_MRCC_GLB_ACC0_EIM_MASK) - -#define MRCC_MRCC_GLB_ACC0_ERM_MASK (0x1000U) -#define MRCC_MRCC_GLB_ACC0_ERM_SHIFT (12U) -/*! ERM - Write to ERM - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_ERM(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_ERM_SHIFT)) & MRCC_MRCC_GLB_ACC0_ERM_MASK) - -#define MRCC_MRCC_GLB_ACC0_LPI2C0_MASK (0x10000U) -#define MRCC_MRCC_GLB_ACC0_LPI2C0_SHIFT (16U) -/*! LPI2C0 - Write to LPI2C0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_LPI2C0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_LPI2C0_SHIFT)) & MRCC_MRCC_GLB_ACC0_LPI2C0_MASK) - -#define MRCC_MRCC_GLB_ACC0_LPSPI0_MASK (0x20000U) -#define MRCC_MRCC_GLB_ACC0_LPSPI0_SHIFT (17U) -/*! LPSPI0 - Write to LPSPI0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_LPSPI0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_LPSPI0_SHIFT)) & MRCC_MRCC_GLB_ACC0_LPSPI0_MASK) - -#define MRCC_MRCC_GLB_ACC0_LPSPI1_MASK (0x40000U) -#define MRCC_MRCC_GLB_ACC0_LPSPI1_SHIFT (18U) -/*! LPSPI1 - Write to LPSPI1 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_LPSPI1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_LPSPI1_SHIFT)) & MRCC_MRCC_GLB_ACC0_LPSPI1_MASK) - -#define MRCC_MRCC_GLB_ACC0_LPUART0_MASK (0x80000U) -#define MRCC_MRCC_GLB_ACC0_LPUART0_SHIFT (19U) -/*! LPUART0 - Write to LPUART0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_LPUART0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_LPUART0_SHIFT)) & MRCC_MRCC_GLB_ACC0_LPUART0_MASK) - -#define MRCC_MRCC_GLB_ACC0_LPUART1_MASK (0x100000U) -#define MRCC_MRCC_GLB_ACC0_LPUART1_SHIFT (20U) -/*! LPUART1 - Write to LPUART1 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_LPUART1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_LPUART1_SHIFT)) & MRCC_MRCC_GLB_ACC0_LPUART1_MASK) - -#define MRCC_MRCC_GLB_ACC0_LPUART2_MASK (0x200000U) -#define MRCC_MRCC_GLB_ACC0_LPUART2_SHIFT (21U) -/*! LPUART2 - Write to LPUART2 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_LPUART2(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_LPUART2_SHIFT)) & MRCC_MRCC_GLB_ACC0_LPUART2_MASK) - -#define MRCC_MRCC_GLB_ACC0_USB0_MASK (0x400000U) -#define MRCC_MRCC_GLB_ACC0_USB0_SHIFT (22U) -/*! USB0 - Write to USB0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_USB0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_USB0_SHIFT)) & MRCC_MRCC_GLB_ACC0_USB0_MASK) - -#define MRCC_MRCC_GLB_ACC0_QDC0_MASK (0x800000U) -#define MRCC_MRCC_GLB_ACC0_QDC0_SHIFT (23U) -/*! QDC0 - Write to QDC0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_QDC0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_QDC0_SHIFT)) & MRCC_MRCC_GLB_ACC0_QDC0_MASK) - -#define MRCC_MRCC_GLB_ACC0_FLEXPWM0_MASK (0x1000000U) -#define MRCC_MRCC_GLB_ACC0_FLEXPWM0_SHIFT (24U) -/*! FLEXPWM0 - Write to FLEXPWM0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_FLEXPWM0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_FLEXPWM0_SHIFT)) & MRCC_MRCC_GLB_ACC0_FLEXPWM0_MASK) - -#define MRCC_MRCC_GLB_ACC0_OSTIMER0_MASK (0x2000000U) -#define MRCC_MRCC_GLB_ACC0_OSTIMER0_SHIFT (25U) -/*! OSTIMER0 - Write to OSTIMER0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_OSTIMER0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_OSTIMER0_SHIFT)) & MRCC_MRCC_GLB_ACC0_OSTIMER0_MASK) - -#define MRCC_MRCC_GLB_ACC0_ADC0_MASK (0x4000000U) -#define MRCC_MRCC_GLB_ACC0_ADC0_SHIFT (26U) -/*! ADC0 - Write to ADC0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_ADC0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_ADC0_SHIFT)) & MRCC_MRCC_GLB_ACC0_ADC0_MASK) - -#define MRCC_MRCC_GLB_ACC0_CMP0_MASK (0x8000000U) -#define MRCC_MRCC_GLB_ACC0_CMP0_SHIFT (27U) -/*! CMP0 - Write to CMP0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_CMP0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_CMP0_SHIFT)) & MRCC_MRCC_GLB_ACC0_CMP0_MASK) - -#define MRCC_MRCC_GLB_ACC0_CMP1_MASK (0x10000000U) -#define MRCC_MRCC_GLB_ACC0_CMP1_SHIFT (28U) -/*! CMP1 - Write to CMP1 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_CMP1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_CMP1_SHIFT)) & MRCC_MRCC_GLB_ACC0_CMP1_MASK) - -#define MRCC_MRCC_GLB_ACC0_PORT0_MASK (0x20000000U) -#define MRCC_MRCC_GLB_ACC0_PORT0_SHIFT (29U) -/*! PORT0 - Write to PORT0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_PORT0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_PORT0_SHIFT)) & MRCC_MRCC_GLB_ACC0_PORT0_MASK) - -#define MRCC_MRCC_GLB_ACC0_PORT1_MASK (0x40000000U) -#define MRCC_MRCC_GLB_ACC0_PORT1_SHIFT (30U) -/*! PORT1 - Write to PORT1 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_PORT1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_PORT1_SHIFT)) & MRCC_MRCC_GLB_ACC0_PORT1_MASK) - -#define MRCC_MRCC_GLB_ACC0_PORT2_MASK (0x80000000U) -#define MRCC_MRCC_GLB_ACC0_PORT2_SHIFT (31U) -/*! PORT2 - Write to PORT2 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_PORT2(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_PORT2_SHIFT)) & MRCC_MRCC_GLB_ACC0_PORT2_MASK) -/*! @} */ - -/*! @name MRCC_GLB_ACC1 - Control Automatic Clock Gating 1 */ -/*! @{ */ - -#define MRCC_MRCC_GLB_ACC1_PORT3_MASK (0x1U) -#define MRCC_MRCC_GLB_ACC1_PORT3_SHIFT (0U) -/*! PORT3 - Write to PORT3 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC1_PORT3(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC1_PORT3_SHIFT)) & MRCC_MRCC_GLB_ACC1_PORT3_MASK) - -#define MRCC_MRCC_GLB_ACC1_EZRAMC_RAMA_MASK (0x10U) -#define MRCC_MRCC_GLB_ACC1_EZRAMC_RAMA_SHIFT (4U) -/*! EZRAMC_RAMA - Write to EZRAMC_RAMA - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC1_EZRAMC_RAMA(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC1_EZRAMC_RAMA_SHIFT)) & MRCC_MRCC_GLB_ACC1_EZRAMC_RAMA_MASK) - -#define MRCC_MRCC_GLB_ACC1_GPIO0_MASK (0x20U) -#define MRCC_MRCC_GLB_ACC1_GPIO0_SHIFT (5U) -/*! GPIO0 - Write to GPIO0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC1_GPIO0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC1_GPIO0_SHIFT)) & MRCC_MRCC_GLB_ACC1_GPIO0_MASK) - -#define MRCC_MRCC_GLB_ACC1_GPIO1_MASK (0x40U) -#define MRCC_MRCC_GLB_ACC1_GPIO1_SHIFT (6U) -/*! GPIO1 - Write to GPIO1 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC1_GPIO1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC1_GPIO1_SHIFT)) & MRCC_MRCC_GLB_ACC1_GPIO1_MASK) - -#define MRCC_MRCC_GLB_ACC1_GPIO2_MASK (0x80U) -#define MRCC_MRCC_GLB_ACC1_GPIO2_SHIFT (7U) -/*! GPIO2 - Write to GPIO2 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC1_GPIO2(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC1_GPIO2_SHIFT)) & MRCC_MRCC_GLB_ACC1_GPIO2_MASK) - -#define MRCC_MRCC_GLB_ACC1_GPIO3_MASK (0x100U) -#define MRCC_MRCC_GLB_ACC1_GPIO3_SHIFT (8U) -/*! GPIO3 - Write to GPIO3 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC1_GPIO3(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC1_GPIO3_SHIFT)) & MRCC_MRCC_GLB_ACC1_GPIO3_MASK) - -#define MRCC_MRCC_GLB_ACC1_ROMCP_MASK (0x200U) -#define MRCC_MRCC_GLB_ACC1_ROMCP_SHIFT (9U) -/*! ROMCP - Write to ROMCP - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC1_ROMCP(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC1_ROMCP_SHIFT)) & MRCC_MRCC_GLB_ACC1_ROMCP_MASK) -/*! @} */ - -/*! @name MRCC_I3C0_FCLK_CLKSEL - I3C0_FCLK clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_I3C0_FCLK_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_I3C0_FCLK_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b101..CLK_1M - * 0b011..CLK_IN - * 0b010..FRO_HF_DIV - * 0b000..FRO_12M - */ -#define MRCC_MRCC_I3C0_FCLK_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_I3C0_FCLK_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_I3C0_FCLK_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_I3C0_FCLK_CLKDIV - I3C0_FCLK clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_I3C0_FCLK_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_I3C0_FCLK_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_I3C0_FCLK_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_I3C0_FCLK_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_I3C0_FCLK_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_I3C0_FCLK_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_I3C0_FCLK_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_I3C0_FCLK_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_I3C0_FCLK_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_I3C0_FCLK_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_I3C0_FCLK_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_I3C0_FCLK_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_I3C0_FCLK_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_I3C0_FCLK_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_I3C0_FCLK_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_I3C0_FCLK_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_I3C0_FCLK_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_I3C0_FCLK_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_I3C0_FCLK_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_I3C0_FCLK_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_CTIMER0_CLKSEL - CTIMER0 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_CTIMER0_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_CTIMER0_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b101..CLK_1M - * 0b100..CLK_16K - * 0b011..CLK_IN - * 0b001..FRO_HF_GATED - * 0b000..FRO_12M - */ -#define MRCC_MRCC_CTIMER0_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER0_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_CTIMER0_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_CTIMER0_CLKDIV - CTIMER0 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_CTIMER0_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_CTIMER0_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_CTIMER0_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER0_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_CTIMER0_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_CTIMER0_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_CTIMER0_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_CTIMER0_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER0_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_CTIMER0_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_CTIMER0_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_CTIMER0_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_CTIMER0_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER0_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_CTIMER0_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_CTIMER0_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_CTIMER0_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_CTIMER0_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER0_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_CTIMER0_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_CTIMER1_CLKSEL - CTIMER1 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_CTIMER1_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_CTIMER1_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b101..CLK_1M - * 0b100..CLK_16K - * 0b011..CLK_IN - * 0b001..FRO_HF_GATED - * 0b000..FRO_12M - */ -#define MRCC_MRCC_CTIMER1_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER1_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_CTIMER1_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_CTIMER1_CLKDIV - CTIMER1 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_CTIMER1_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_CTIMER1_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_CTIMER1_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER1_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_CTIMER1_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_CTIMER1_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_CTIMER1_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_CTIMER1_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER1_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_CTIMER1_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_CTIMER1_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_CTIMER1_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_CTIMER1_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER1_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_CTIMER1_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_CTIMER1_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_CTIMER1_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_CTIMER1_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER1_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_CTIMER1_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_CTIMER2_CLKSEL - CTIMER2 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_CTIMER2_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_CTIMER2_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b101..CLK_1M - * 0b100..CLK_16K - * 0b011..CLK_IN - * 0b001..FRO_HF_GATED - * 0b000..FRO_12M - */ -#define MRCC_MRCC_CTIMER2_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER2_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_CTIMER2_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_CTIMER2_CLKDIV - CTIMER2 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_CTIMER2_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_CTIMER2_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_CTIMER2_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER2_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_CTIMER2_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_CTIMER2_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_CTIMER2_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_CTIMER2_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER2_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_CTIMER2_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_CTIMER2_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_CTIMER2_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_CTIMER2_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER2_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_CTIMER2_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_CTIMER2_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_CTIMER2_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_CTIMER2_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER2_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_CTIMER2_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_WWDT0_CLKDIV - WWDT0 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_WWDT0_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_WWDT0_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_WWDT0_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_WWDT0_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_WWDT0_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_WWDT0_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_WWDT0_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_WWDT0_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_WWDT0_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_WWDT0_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_WWDT0_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_WWDT0_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_WWDT0_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_WWDT0_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_WWDT0_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_WWDT0_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_WWDT0_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_WWDT0_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_WWDT0_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_WWDT0_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_LPI2C0_CLKSEL - LPI2C0 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_LPI2C0_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_LPI2C0_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b101..CLK_1M - * 0b011..CLK_IN - * 0b010..FRO_HF_DIV - * 0b000..FRO_12M - */ -#define MRCC_MRCC_LPI2C0_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPI2C0_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_LPI2C0_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_LPI2C0_CLKDIV - LPI2C0 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_LPI2C0_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_LPI2C0_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_LPI2C0_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPI2C0_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_LPI2C0_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_LPI2C0_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_LPI2C0_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_LPI2C0_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPI2C0_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_LPI2C0_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_LPI2C0_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_LPI2C0_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_LPI2C0_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPI2C0_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_LPI2C0_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_LPI2C0_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_LPI2C0_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_LPI2C0_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPI2C0_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_LPI2C0_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_LPSPI0_CLKSEL - LPSPI0 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_LPSPI0_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_LPSPI0_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b101..CLK_1M - * 0b011..CLK_IN - * 0b010..FRO_HF_DIV - * 0b000..FRO_12M - */ -#define MRCC_MRCC_LPSPI0_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPSPI0_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_LPSPI0_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_LPSPI0_CLKDIV - LPSPI0 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_LPSPI0_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_LPSPI0_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_LPSPI0_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPSPI0_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_LPSPI0_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_LPSPI0_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_LPSPI0_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_LPSPI0_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPSPI0_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_LPSPI0_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_LPSPI0_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_LPSPI0_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_LPSPI0_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPSPI0_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_LPSPI0_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_LPSPI0_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_LPSPI0_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_LPSPI0_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPSPI0_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_LPSPI0_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_LPSPI1_CLKSEL - LPSPI1 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_LPSPI1_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_LPSPI1_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b101..CLK_1M - * 0b011..CLK_IN - * 0b010..FRO_HF_DIV - * 0b000..FRO_12M - */ -#define MRCC_MRCC_LPSPI1_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPSPI1_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_LPSPI1_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_LPSPI1_CLKDIV - LPSPI1 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_LPSPI1_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_LPSPI1_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_LPSPI1_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPSPI1_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_LPSPI1_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_LPSPI1_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_LPSPI1_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_LPSPI1_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPSPI1_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_LPSPI1_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_LPSPI1_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_LPSPI1_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_LPSPI1_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPSPI1_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_LPSPI1_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_LPSPI1_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_LPSPI1_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_LPSPI1_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPSPI1_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_LPSPI1_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_LPUART0_CLKSEL - LPUART0 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_LPUART0_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_LPUART0_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b101..CLK_1M - * 0b100..CLK_16K - * 0b011..CLK_IN - * 0b010..FRO_HF_DIV - * 0b000..FRO_12M - */ -#define MRCC_MRCC_LPUART0_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART0_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_LPUART0_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_LPUART0_CLKDIV - LPUART0 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_LPUART0_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_LPUART0_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_LPUART0_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART0_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_LPUART0_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_LPUART0_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_LPUART0_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_LPUART0_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART0_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_LPUART0_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_LPUART0_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_LPUART0_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_LPUART0_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART0_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_LPUART0_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_LPUART0_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_LPUART0_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_LPUART0_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART0_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_LPUART0_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_LPUART1_CLKSEL - LPUART1 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_LPUART1_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_LPUART1_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b101..CLK_1M - * 0b100..CLK_16K - * 0b011..CLK_IN - * 0b010..FRO_HF_DIV - * 0b000..FRO_12M - */ -#define MRCC_MRCC_LPUART1_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART1_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_LPUART1_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_LPUART1_CLKDIV - LPUART1 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_LPUART1_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_LPUART1_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_LPUART1_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART1_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_LPUART1_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_LPUART1_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_LPUART1_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_LPUART1_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART1_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_LPUART1_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_LPUART1_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_LPUART1_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_LPUART1_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART1_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_LPUART1_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_LPUART1_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_LPUART1_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_LPUART1_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART1_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_LPUART1_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_LPUART2_CLKSEL - LPUART2 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_LPUART2_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_LPUART2_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b101..CLK_1M - * 0b100..CLK_16K - * 0b011..CLK_IN - * 0b010..FRO_HF_DIV - * 0b000..FRO_12M - */ -#define MRCC_MRCC_LPUART2_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART2_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_LPUART2_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_LPUART2_CLKDIV - LPUART2 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_LPUART2_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_LPUART2_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_LPUART2_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART2_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_LPUART2_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_LPUART2_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_LPUART2_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_LPUART2_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART2_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_LPUART2_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_LPUART2_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_LPUART2_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_LPUART2_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART2_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_LPUART2_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_LPUART2_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_LPUART2_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_LPUART2_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART2_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_LPUART2_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_USB0_CLKSEL - USB0 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_USB0_CLKSEL_MUX_MASK (0x3U) -#define MRCC_MRCC_USB0_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b10..clkroot_sosc - * 0b01..scg_scg_firc_48mhz_clk - */ -#define MRCC_MRCC_USB0_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_USB0_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_USB0_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_LPTMR0_CLKSEL - LPTMR0 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_LPTMR0_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_LPTMR0_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b101..CLK_1M - * 0b011..CLK_IN - * 0b010..FRO_HF_DIV - * 0b000..FRO_12M - */ -#define MRCC_MRCC_LPTMR0_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPTMR0_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_LPTMR0_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_LPTMR0_CLKDIV - LPTMR0 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_LPTMR0_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_LPTMR0_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_LPTMR0_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPTMR0_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_LPTMR0_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_LPTMR0_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_LPTMR0_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_LPTMR0_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPTMR0_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_LPTMR0_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_LPTMR0_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_LPTMR0_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_LPTMR0_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPTMR0_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_LPTMR0_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_LPTMR0_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_LPTMR0_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_LPTMR0_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPTMR0_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_LPTMR0_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_OSTIMER0_CLKSEL - OSTIMER0 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_OSTIMER0_CLKSEL_MUX_MASK (0x3U) -#define MRCC_MRCC_OSTIMER0_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b10..clkroot_1m - * 0b00..clkroot_16k - */ -#define MRCC_MRCC_OSTIMER0_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_OSTIMER0_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_OSTIMER0_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_ADC0_CLKSEL - ADC0 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_ADC0_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_ADC0_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b101..CLK_1M - * 0b011..CLK_IN - * 0b001..FRO_HF_GATED - * 0b000..FRO_12M - */ -#define MRCC_MRCC_ADC0_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_ADC0_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_ADC0_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_ADC0_CLKDIV - ADC0 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_ADC0_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_ADC0_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_ADC0_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_ADC0_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_ADC0_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_ADC0_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_ADC0_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_ADC0_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_ADC0_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_ADC0_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_ADC0_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_ADC0_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_ADC0_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_ADC0_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_ADC0_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_ADC0_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_ADC0_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_ADC0_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_ADC0_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_ADC0_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_CMP0_FUNC_CLKDIV - CMP0_FUNC clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_CMP0_FUNC_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_CMP0_FUNC_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_CMP0_FUNC_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP0_FUNC_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_CMP0_FUNC_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_CMP0_FUNC_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_CMP0_FUNC_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_CMP0_FUNC_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP0_FUNC_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_CMP0_FUNC_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_CMP0_FUNC_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_CMP0_FUNC_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_CMP0_FUNC_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP0_FUNC_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_CMP0_FUNC_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_CMP0_FUNC_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_CMP0_FUNC_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_CMP0_FUNC_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP0_FUNC_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_CMP0_FUNC_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_CMP0_RR_CLKSEL - CMP0_RR clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_CMP0_RR_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_CMP0_RR_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b101..CLK_1M - * 0b011..CLK_IN - * 0b010..FRO_HF_DIV - * 0b000..FRO_12M - */ -#define MRCC_MRCC_CMP0_RR_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP0_RR_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_CMP0_RR_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_CMP0_RR_CLKDIV - CMP0_RR clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_CMP0_RR_CLKDIV_DIV_MASK (0x3U) -#define MRCC_MRCC_CMP0_RR_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_CMP0_RR_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP0_RR_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_CMP0_RR_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_CMP0_RR_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_CMP0_RR_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_CMP0_RR_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP0_RR_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_CMP0_RR_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_CMP0_RR_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_CMP0_RR_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_CMP0_RR_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP0_RR_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_CMP0_RR_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_CMP0_RR_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_CMP0_RR_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_CMP0_RR_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP0_RR_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_CMP0_RR_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_CMP1_FUNC_CLKDIV - CMP1_FUNC clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_CMP1_FUNC_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_CMP1_FUNC_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_CMP1_FUNC_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP1_FUNC_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_CMP1_FUNC_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_CMP1_FUNC_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_CMP1_FUNC_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_CMP1_FUNC_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP1_FUNC_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_CMP1_FUNC_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_CMP1_FUNC_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_CMP1_FUNC_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_CMP1_FUNC_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP1_FUNC_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_CMP1_FUNC_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_CMP1_FUNC_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_CMP1_FUNC_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_CMP1_FUNC_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP1_FUNC_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_CMP1_FUNC_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_CMP1_RR_CLKSEL - CMP1_RR clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_CMP1_RR_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_CMP1_RR_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b101..CLK_1M - * 0b011..CLK_IN - * 0b010..FRO_HF_DIV - * 0b000..FRO_12M - */ -#define MRCC_MRCC_CMP1_RR_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP1_RR_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_CMP1_RR_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_CMP1_RR_CLKDIV - CMP1_RR clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_CMP1_RR_CLKDIV_DIV_MASK (0x3U) -#define MRCC_MRCC_CMP1_RR_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_CMP1_RR_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP1_RR_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_CMP1_RR_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_CMP1_RR_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_CMP1_RR_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_CMP1_RR_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP1_RR_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_CMP1_RR_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_CMP1_RR_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_CMP1_RR_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_CMP1_RR_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP1_RR_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_CMP1_RR_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_CMP1_RR_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_CMP1_RR_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_CMP1_RR_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP1_RR_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_CMP1_RR_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_DBG_TRACE_CLKSEL - DBG_TRACE clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_DBG_TRACE_CLKSEL_MUX_MASK (0x3U) -#define MRCC_MRCC_DBG_TRACE_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b10..clkroot_16k - * 0b01..clkroot_1m - * 0b00..clkroot_cpu - */ -#define MRCC_MRCC_DBG_TRACE_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_DBG_TRACE_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_DBG_TRACE_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_DBG_TRACE_CLKDIV - DBG_TRACE clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_DBG_TRACE_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_DBG_TRACE_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_DBG_TRACE_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_DBG_TRACE_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_DBG_TRACE_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_DBG_TRACE_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_DBG_TRACE_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_DBG_TRACE_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_DBG_TRACE_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_DBG_TRACE_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_DBG_TRACE_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_DBG_TRACE_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_DBG_TRACE_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_DBG_TRACE_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_DBG_TRACE_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_DBG_TRACE_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_DBG_TRACE_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_DBG_TRACE_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_DBG_TRACE_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_DBG_TRACE_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_CLKOUT_CLKSEL - CLKOUT clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_CLKOUT_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_CLKOUT_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b110..clkroot_slow - * 0b011..clkroot_16k - * 0b010..clkroot_sosc - * 0b001..clkroot_firc_div - * 0b000..clkroot_12m - */ -#define MRCC_MRCC_CLKOUT_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CLKOUT_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_CLKOUT_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_CLKOUT_CLKDIV - CLKOUT clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_CLKOUT_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_CLKOUT_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_CLKOUT_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CLKOUT_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_CLKOUT_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_CLKOUT_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_CLKOUT_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_CLKOUT_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CLKOUT_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_CLKOUT_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_CLKOUT_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_CLKOUT_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_CLKOUT_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CLKOUT_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_CLKOUT_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_CLKOUT_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_CLKOUT_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency is not stable - */ -#define MRCC_MRCC_CLKOUT_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CLKOUT_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_CLKOUT_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_SYSTICK_CLKSEL - SYSTICK clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_SYSTICK_CLKSEL_MUX_MASK (0x3U) -#define MRCC_MRCC_SYSTICK_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b10..clkroot_16k - * 0b01..clkroot_1m - * 0b00..clkroot_cpu - */ -#define MRCC_MRCC_SYSTICK_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_SYSTICK_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_SYSTICK_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_SYSTICK_CLKDIV - SYSTICK clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_SYSTICK_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_SYSTICK_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_SYSTICK_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_SYSTICK_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_SYSTICK_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_SYSTICK_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_SYSTICK_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_SYSTICK_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_SYSTICK_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_SYSTICK_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_SYSTICK_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_SYSTICK_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_SYSTICK_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_SYSTICK_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_SYSTICK_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_SYSTICK_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_SYSTICK_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_SYSTICK_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_SYSTICK_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_SYSTICK_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_FRO_HF_DIV_CLKDIV - FRO_HF_DIV clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_FRO_HF_DIV_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_FRO_HF_DIV_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_FRO_HF_DIV_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_FRO_HF_DIV_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_FRO_HF_DIV_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_FRO_HF_DIV_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_FRO_HF_DIV_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_FRO_HF_DIV_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_FRO_HF_DIV_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_FRO_HF_DIV_CLKDIV_UNSTAB_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group MRCC_Register_Masks */ - - -/* MRCC - Peripheral instance base addresses */ -/** Peripheral MRCC0 base address */ -#define MRCC0_BASE (0x40091000u) -/** Peripheral MRCC0 base pointer */ -#define MRCC0 ((MRCC_Type *)MRCC0_BASE) -/** Array initializer of MRCC peripheral base addresses */ -#define MRCC_BASE_ADDRS { MRCC0_BASE } -/** Array initializer of MRCC peripheral base pointers */ -#define MRCC_BASE_PTRS { MRCC0 } - -/*! - * @} - */ /* end of group MRCC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- OSTIMER Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup OSTIMER_Peripheral_Access_Layer OSTIMER Peripheral Access Layer - * @{ - */ - -/** OSTIMER - Register Layout Typedef */ -typedef struct { - __I uint32_t EVTIMERL; /**< EVTIMER Low, offset: 0x0 */ - __I uint32_t EVTIMERH; /**< EVTIMER High, offset: 0x4 */ - __I uint32_t CAPTURE_L; /**< Local Capture Low for CPU, offset: 0x8 */ - __I uint32_t CAPTURE_H; /**< Local Capture High for CPU, offset: 0xC */ - __IO uint32_t MATCH_L; /**< Local Match Low for CPU, offset: 0x10 */ - __IO uint32_t MATCH_H; /**< Local Match High for CPU, offset: 0x14 */ - uint8_t RESERVED_0[4]; - __IO uint32_t OSEVENT_CTRL; /**< OSTIMER Control for CPU, offset: 0x1C */ -} OSTIMER_Type; - -/* ---------------------------------------------------------------------------- - -- OSTIMER Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup OSTIMER_Register_Masks OSTIMER Register Masks - * @{ - */ - -/*! @name EVTIMERL - EVTIMER Low */ -/*! @{ */ - -#define OSTIMER_EVTIMERL_EVTIMER_COUNT_VALUE_MASK (0xFFFFFFFFU) -#define OSTIMER_EVTIMERL_EVTIMER_COUNT_VALUE_SHIFT (0U) -/*! EVTIMER_COUNT_VALUE - EVTimer Count Value */ -#define OSTIMER_EVTIMERL_EVTIMER_COUNT_VALUE(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_EVTIMERL_EVTIMER_COUNT_VALUE_SHIFT)) & OSTIMER_EVTIMERL_EVTIMER_COUNT_VALUE_MASK) -/*! @} */ - -/*! @name EVTIMERH - EVTIMER High */ -/*! @{ */ - -#define OSTIMER_EVTIMERH_EVTIMER_COUNT_VALUE_MASK (0x3FFU) -#define OSTIMER_EVTIMERH_EVTIMER_COUNT_VALUE_SHIFT (0U) -/*! EVTIMER_COUNT_VALUE - EVTimer Count Value */ -#define OSTIMER_EVTIMERH_EVTIMER_COUNT_VALUE(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_EVTIMERH_EVTIMER_COUNT_VALUE_SHIFT)) & OSTIMER_EVTIMERH_EVTIMER_COUNT_VALUE_MASK) -/*! @} */ - -/*! @name CAPTURE_L - Local Capture Low for CPU */ -/*! @{ */ - -#define OSTIMER_CAPTURE_L_CAPTURE_VALUE_MASK (0xFFFFFFFFU) -#define OSTIMER_CAPTURE_L_CAPTURE_VALUE_SHIFT (0U) -/*! CAPTURE_VALUE - EVTimer Capture Value */ -#define OSTIMER_CAPTURE_L_CAPTURE_VALUE(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_CAPTURE_L_CAPTURE_VALUE_SHIFT)) & OSTIMER_CAPTURE_L_CAPTURE_VALUE_MASK) -/*! @} */ - -/*! @name CAPTURE_H - Local Capture High for CPU */ -/*! @{ */ - -#define OSTIMER_CAPTURE_H_CAPTURE_VALUE_MASK (0x3FFU) -#define OSTIMER_CAPTURE_H_CAPTURE_VALUE_SHIFT (0U) -/*! CAPTURE_VALUE - EVTimer Capture Value */ -#define OSTIMER_CAPTURE_H_CAPTURE_VALUE(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_CAPTURE_H_CAPTURE_VALUE_SHIFT)) & OSTIMER_CAPTURE_H_CAPTURE_VALUE_MASK) -/*! @} */ - -/*! @name MATCH_L - Local Match Low for CPU */ -/*! @{ */ - -#define OSTIMER_MATCH_L_MATCH_VALUE_MASK (0xFFFFFFFFU) -#define OSTIMER_MATCH_L_MATCH_VALUE_SHIFT (0U) -/*! MATCH_VALUE - EVTimer Match Value */ -#define OSTIMER_MATCH_L_MATCH_VALUE(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_MATCH_L_MATCH_VALUE_SHIFT)) & OSTIMER_MATCH_L_MATCH_VALUE_MASK) -/*! @} */ - -/*! @name MATCH_H - Local Match High for CPU */ -/*! @{ */ - -#define OSTIMER_MATCH_H_MATCH_VALUE_MASK (0x3FFU) -#define OSTIMER_MATCH_H_MATCH_VALUE_SHIFT (0U) -/*! MATCH_VALUE - EVTimer Match Value */ -#define OSTIMER_MATCH_H_MATCH_VALUE(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_MATCH_H_MATCH_VALUE_SHIFT)) & OSTIMER_MATCH_H_MATCH_VALUE_MASK) -/*! @} */ - -/*! @name OSEVENT_CTRL - OSTIMER Control for CPU */ -/*! @{ */ - -#define OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG_MASK (0x1U) -#define OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG_SHIFT (0U) -/*! OSTIMER_INTRFLAG - Interrupt Flag */ -#define OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG_SHIFT)) & OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG_MASK) - -#define OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_MASK (0x2U) -#define OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_SHIFT (1U) -/*! OSTIMER_INTENA - Interrupt or Wake-Up Request - * 0b0..Interrupts blocked - * 0b1..Interrupts enabled - */ -#define OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_SHIFT)) & OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_MASK) - -#define OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK (0x4U) -#define OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_SHIFT (2U) -/*! MATCH_WR_RDY - EVTimer Match Write Ready */ -#define OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_SHIFT)) & OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK) - -#define OSTIMER_OSEVENT_CTRL_DEBUG_EN_MASK (0x8U) -#define OSTIMER_OSEVENT_CTRL_DEBUG_EN_SHIFT (3U) -/*! DEBUG_EN - Debug Enable - * 0b0..Disables - * 0b1..Enables - */ -#define OSTIMER_OSEVENT_CTRL_DEBUG_EN(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_OSEVENT_CTRL_DEBUG_EN_SHIFT)) & OSTIMER_OSEVENT_CTRL_DEBUG_EN_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group OSTIMER_Register_Masks */ - - -/* OSTIMER - Peripheral instance base addresses */ -/** Peripheral OSTIMER0 base address */ -#define OSTIMER0_BASE (0x400AD000u) -/** Peripheral OSTIMER0 base pointer */ -#define OSTIMER0 ((OSTIMER_Type *)OSTIMER0_BASE) -/** Array initializer of OSTIMER peripheral base addresses */ -#define OSTIMER_BASE_ADDRS { OSTIMER0_BASE } -/** Array initializer of OSTIMER peripheral base pointers */ -#define OSTIMER_BASE_PTRS { OSTIMER0 } -/** Interrupt vectors for the OSTIMER peripheral type */ -#define OSTIMER_IRQS { OS_EVENT_IRQn } - -/*! - * @} - */ /* end of group OSTIMER_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- PORT Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PORT_Peripheral_Access_Layer PORT Peripheral Access Layer - * @{ - */ - -/** PORT - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - uint8_t RESERVED_0[12]; - __O uint32_t GPCLR; /**< Global Pin Control Low, offset: 0x10 */ - __O uint32_t GPCHR; /**< Global Pin Control High, offset: 0x14 */ - uint8_t RESERVED_1[8]; - __IO uint32_t CONFIG; /**< Configuration, offset: 0x20 */ - uint8_t RESERVED_2[60]; - __IO uint32_t CALIB0; /**< Calibration 0, offset: 0x60, available only on: PORT1, PORT3 (missing on PORT0, PORT2) */ - __IO uint32_t CALIB1; /**< Calibration 1, offset: 0x64, available only on: PORT1, PORT3 (missing on PORT0, PORT2) */ - uint8_t RESERVED_3[24]; - __IO uint32_t PCR[32]; /**< Pin Control 0..Pin Control 31, array offset: 0x80, array step: 0x4, irregular array, not all indices are valid */ -} PORT_Type; - -/* ---------------------------------------------------------------------------- - -- PORT Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PORT_Register_Masks PORT Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define PORT_VERID_FEATURE_MASK (0xFFFFU) -#define PORT_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Basic implementation - */ -#define PORT_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << PORT_VERID_FEATURE_SHIFT)) & PORT_VERID_FEATURE_MASK) - -#define PORT_VERID_MINOR_MASK (0xFF0000U) -#define PORT_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define PORT_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << PORT_VERID_MINOR_SHIFT)) & PORT_VERID_MINOR_MASK) - -#define PORT_VERID_MAJOR_MASK (0xFF000000U) -#define PORT_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define PORT_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << PORT_VERID_MAJOR_SHIFT)) & PORT_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name GPCLR - Global Pin Control Low */ -/*! @{ */ - -#define PORT_GPCLR_GPWD_MASK (0xFFFFU) -#define PORT_GPCLR_GPWD_SHIFT (0U) -/*! GPWD - Global Pin Write Data */ -#define PORT_GPCLR_GPWD(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWD_SHIFT)) & PORT_GPCLR_GPWD_MASK) - -#define PORT_GPCLR_GPWE0_MASK (0x10000U) -#define PORT_GPCLR_GPWE0_SHIFT (16U) -/*! GPWE0 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE0(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE0_SHIFT)) & PORT_GPCLR_GPWE0_MASK) - -#define PORT_GPCLR_GPWE1_MASK (0x20000U) -#define PORT_GPCLR_GPWE1_SHIFT (17U) -/*! GPWE1 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE1(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE1_SHIFT)) & PORT_GPCLR_GPWE1_MASK) - -#define PORT_GPCLR_GPWE2_MASK (0x40000U) -#define PORT_GPCLR_GPWE2_SHIFT (18U) -/*! GPWE2 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE2(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE2_SHIFT)) & PORT_GPCLR_GPWE2_MASK) - -#define PORT_GPCLR_GPWE3_MASK (0x80000U) -#define PORT_GPCLR_GPWE3_SHIFT (19U) -/*! GPWE3 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE3(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE3_SHIFT)) & PORT_GPCLR_GPWE3_MASK) - -#define PORT_GPCLR_GPWE4_MASK (0x100000U) -#define PORT_GPCLR_GPWE4_SHIFT (20U) -/*! GPWE4 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE4(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE4_SHIFT)) & PORT_GPCLR_GPWE4_MASK) - -#define PORT_GPCLR_GPWE5_MASK (0x200000U) -#define PORT_GPCLR_GPWE5_SHIFT (21U) -/*! GPWE5 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE5(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE5_SHIFT)) & PORT_GPCLR_GPWE5_MASK) - -#define PORT_GPCLR_GPWE6_MASK (0x400000U) -#define PORT_GPCLR_GPWE6_SHIFT (22U) -/*! GPWE6 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE6(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE6_SHIFT)) & PORT_GPCLR_GPWE6_MASK) - -#define PORT_GPCLR_GPWE7_MASK (0x800000U) -#define PORT_GPCLR_GPWE7_SHIFT (23U) -/*! GPWE7 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE7(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE7_SHIFT)) & PORT_GPCLR_GPWE7_MASK) - -#define PORT_GPCLR_GPWE8_MASK (0x1000000U) -#define PORT_GPCLR_GPWE8_SHIFT (24U) -/*! GPWE8 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE8(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE8_SHIFT)) & PORT_GPCLR_GPWE8_MASK) - -#define PORT_GPCLR_GPWE9_MASK (0x2000000U) -#define PORT_GPCLR_GPWE9_SHIFT (25U) -/*! GPWE9 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE9(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE9_SHIFT)) & PORT_GPCLR_GPWE9_MASK) - -#define PORT_GPCLR_GPWE10_MASK (0x4000000U) -#define PORT_GPCLR_GPWE10_SHIFT (26U) -/*! GPWE10 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE10(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE10_SHIFT)) & PORT_GPCLR_GPWE10_MASK) - -#define PORT_GPCLR_GPWE11_MASK (0x8000000U) -#define PORT_GPCLR_GPWE11_SHIFT (27U) -/*! GPWE11 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE11(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE11_SHIFT)) & PORT_GPCLR_GPWE11_MASK) - -#define PORT_GPCLR_GPWE12_MASK (0x10000000U) -#define PORT_GPCLR_GPWE12_SHIFT (28U) -/*! GPWE12 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE12(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE12_SHIFT)) & PORT_GPCLR_GPWE12_MASK) - -#define PORT_GPCLR_GPWE13_MASK (0x20000000U) -#define PORT_GPCLR_GPWE13_SHIFT (29U) -/*! GPWE13 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE13(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE13_SHIFT)) & PORT_GPCLR_GPWE13_MASK) - -#define PORT_GPCLR_GPWE14_MASK (0x40000000U) -#define PORT_GPCLR_GPWE14_SHIFT (30U) -/*! GPWE14 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE14(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE14_SHIFT)) & PORT_GPCLR_GPWE14_MASK) - -#define PORT_GPCLR_GPWE15_MASK (0x80000000U) -#define PORT_GPCLR_GPWE15_SHIFT (31U) -/*! GPWE15 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE15(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE15_SHIFT)) & PORT_GPCLR_GPWE15_MASK) -/*! @} */ - -/*! @name GPCHR - Global Pin Control High */ -/*! @{ */ - -#define PORT_GPCHR_GPWD_MASK (0xFFFFU) -#define PORT_GPCHR_GPWD_SHIFT (0U) -/*! GPWD - Global Pin Write Data */ -#define PORT_GPCHR_GPWD(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWD_SHIFT)) & PORT_GPCHR_GPWD_MASK) - -#define PORT_GPCHR_GPWE16_MASK (0x10000U) -#define PORT_GPCHR_GPWE16_SHIFT (16U) -/*! GPWE16 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE16(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE16_SHIFT)) & PORT_GPCHR_GPWE16_MASK) - -#define PORT_GPCHR_GPWE17_MASK (0x20000U) -#define PORT_GPCHR_GPWE17_SHIFT (17U) -/*! GPWE17 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE17(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE17_SHIFT)) & PORT_GPCHR_GPWE17_MASK) - -#define PORT_GPCHR_GPWE18_MASK (0x40000U) -#define PORT_GPCHR_GPWE18_SHIFT (18U) -/*! GPWE18 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE18(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE18_SHIFT)) & PORT_GPCHR_GPWE18_MASK) - -#define PORT_GPCHR_GPWE19_MASK (0x80000U) -#define PORT_GPCHR_GPWE19_SHIFT (19U) -/*! GPWE19 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE19(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE19_SHIFT)) & PORT_GPCHR_GPWE19_MASK) - -#define PORT_GPCHR_GPWE20_MASK (0x100000U) -#define PORT_GPCHR_GPWE20_SHIFT (20U) -/*! GPWE20 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE20(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE20_SHIFT)) & PORT_GPCHR_GPWE20_MASK) - -#define PORT_GPCHR_GPWE21_MASK (0x200000U) -#define PORT_GPCHR_GPWE21_SHIFT (21U) -/*! GPWE21 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE21(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE21_SHIFT)) & PORT_GPCHR_GPWE21_MASK) - -#define PORT_GPCHR_GPWE22_MASK (0x400000U) -#define PORT_GPCHR_GPWE22_SHIFT (22U) -/*! GPWE22 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE22(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE22_SHIFT)) & PORT_GPCHR_GPWE22_MASK) - -#define PORT_GPCHR_GPWE23_MASK (0x800000U) -#define PORT_GPCHR_GPWE23_SHIFT (23U) -/*! GPWE23 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE23(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE23_SHIFT)) & PORT_GPCHR_GPWE23_MASK) - -#define PORT_GPCHR_GPWE24_MASK (0x1000000U) -#define PORT_GPCHR_GPWE24_SHIFT (24U) -/*! GPWE24 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE24(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE24_SHIFT)) & PORT_GPCHR_GPWE24_MASK) - -#define PORT_GPCHR_GPWE25_MASK (0x2000000U) -#define PORT_GPCHR_GPWE25_SHIFT (25U) -/*! GPWE25 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE25(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE25_SHIFT)) & PORT_GPCHR_GPWE25_MASK) - -#define PORT_GPCHR_GPWE26_MASK (0x4000000U) -#define PORT_GPCHR_GPWE26_SHIFT (26U) -/*! GPWE26 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE26(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE26_SHIFT)) & PORT_GPCHR_GPWE26_MASK) - -#define PORT_GPCHR_GPWE27_MASK (0x8000000U) -#define PORT_GPCHR_GPWE27_SHIFT (27U) -/*! GPWE27 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE27(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE27_SHIFT)) & PORT_GPCHR_GPWE27_MASK) - -#define PORT_GPCHR_GPWE28_MASK (0x10000000U) -#define PORT_GPCHR_GPWE28_SHIFT (28U) -/*! GPWE28 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE28(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE28_SHIFT)) & PORT_GPCHR_GPWE28_MASK) - -#define PORT_GPCHR_GPWE29_MASK (0x20000000U) -#define PORT_GPCHR_GPWE29_SHIFT (29U) -/*! GPWE29 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE29(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE29_SHIFT)) & PORT_GPCHR_GPWE29_MASK) - -#define PORT_GPCHR_GPWE30_MASK (0x40000000U) -#define PORT_GPCHR_GPWE30_SHIFT (30U) -/*! GPWE30 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE30(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE30_SHIFT)) & PORT_GPCHR_GPWE30_MASK) - -#define PORT_GPCHR_GPWE31_MASK (0x80000000U) -#define PORT_GPCHR_GPWE31_SHIFT (31U) -/*! GPWE31 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE31(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE31_SHIFT)) & PORT_GPCHR_GPWE31_MASK) -/*! @} */ - -/*! @name CONFIG - Configuration */ -/*! @{ */ - -#define PORT_CONFIG_RANGE_MASK (0x1U) -#define PORT_CONFIG_RANGE_SHIFT (0U) -/*! RANGE - Port Voltage Range - * 0b0..1.71 V-3.6 V - * 0b1..2.70 V-3.6 V - */ -#define PORT_CONFIG_RANGE(x) (((uint32_t)(((uint32_t)(x)) << PORT_CONFIG_RANGE_SHIFT)) & PORT_CONFIG_RANGE_MASK) -/*! @} */ - -/*! @name CALIB0 - Calibration 0 */ -/*! @{ */ - -#define PORT_CALIB0_NCAL_MASK (0x3FU) -#define PORT_CALIB0_NCAL_SHIFT (0U) -/*! NCAL - Calibration of NMOS Output Driver */ -#define PORT_CALIB0_NCAL(x) (((uint32_t)(((uint32_t)(x)) << PORT_CALIB0_NCAL_SHIFT)) & PORT_CALIB0_NCAL_MASK) - -#define PORT_CALIB0_PCAL_MASK (0x3F0000U) -#define PORT_CALIB0_PCAL_SHIFT (16U) -/*! PCAL - Calibration of PMOS Output Driver */ -#define PORT_CALIB0_PCAL(x) (((uint32_t)(((uint32_t)(x)) << PORT_CALIB0_PCAL_SHIFT)) & PORT_CALIB0_PCAL_MASK) -/*! @} */ - -/*! @name CALIB1 - Calibration 1 */ -/*! @{ */ - -#define PORT_CALIB1_NCAL_MASK (0x3FU) -#define PORT_CALIB1_NCAL_SHIFT (0U) -/*! NCAL - Calibration of NMOS Output Driver */ -#define PORT_CALIB1_NCAL(x) (((uint32_t)(((uint32_t)(x)) << PORT_CALIB1_NCAL_SHIFT)) & PORT_CALIB1_NCAL_MASK) - -#define PORT_CALIB1_PCAL_MASK (0x3F0000U) -#define PORT_CALIB1_PCAL_SHIFT (16U) -/*! PCAL - Calibration of PMOS Output Driver */ -#define PORT_CALIB1_PCAL(x) (((uint32_t)(((uint32_t)(x)) << PORT_CALIB1_PCAL_SHIFT)) & PORT_CALIB1_PCAL_MASK) -/*! @} */ - -/*! @name PCR - Pin Control 0..Pin Control 31 */ -/*! @{ */ - -#define PORT_PCR_PS_MASK (0x1U) -#define PORT_PCR_PS_SHIFT (0U) -/*! PS - Pull Select - * 0b0..Enables internal pulldown resistor - * 0b1..Enables internal pullup resistor - */ -#define PORT_PCR_PS(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_PS_SHIFT)) & PORT_PCR_PS_MASK) - -#define PORT_PCR_PE_MASK (0x2U) -#define PORT_PCR_PE_SHIFT (1U) -/*! PE - Pull Enable - * 0b0..Disables - * 0b1..Enables - */ -#define PORT_PCR_PE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_PE_SHIFT)) & PORT_PCR_PE_MASK) - -#define PORT_PCR_PV_MASK (0x4U) -#define PORT_PCR_PV_SHIFT (2U) -/*! PV - Pull Value - * 0b0..Low - * 0b1..High - */ -#define PORT_PCR_PV(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_PV_SHIFT)) & PORT_PCR_PV_MASK) - -#define PORT_PCR_SRE_MASK (0x8U) -#define PORT_PCR_SRE_SHIFT (3U) -/*! SRE - Slew Rate Enable - * 0b0..Fast - * 0b1..Slow - */ -#define PORT_PCR_SRE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_SRE_SHIFT)) & PORT_PCR_SRE_MASK) - -#define PORT_PCR_PFE_MASK (0x10U) -#define PORT_PCR_PFE_SHIFT (4U) -/*! PFE - Passive Filter Enable - * 0b0..Disables - * 0b1..Enables - */ -#define PORT_PCR_PFE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_PFE_SHIFT)) & PORT_PCR_PFE_MASK) - -#define PORT_PCR_ODE_MASK (0x20U) -#define PORT_PCR_ODE_SHIFT (5U) -/*! ODE - Open Drain Enable - * 0b0..Disables - * 0b1..Enables - */ -#define PORT_PCR_ODE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_ODE_SHIFT)) & PORT_PCR_ODE_MASK) - -#define PORT_PCR_DSE_MASK (0x40U) -#define PORT_PCR_DSE_SHIFT (6U) -/*! DSE - Drive Strength Enable - * 0b0..Low - * 0b1..High - */ -#define PORT_PCR_DSE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_DSE_SHIFT)) & PORT_PCR_DSE_MASK) - -#define PORT_PCR_DSE1_MASK (0x80U) -#define PORT_PCR_DSE1_SHIFT (7U) -/*! DSE1 - Drive Strength Enable - * 0b0..Normal - * 0b1..Double - */ -#define PORT_PCR_DSE1(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_DSE1_SHIFT)) & PORT_PCR_DSE1_MASK) - -#define PORT_PCR_MUX_MASK (0xF00U) /* Merged from fields with different position or width, of widths (2, 3, 4), largest definition used */ -#define PORT_PCR_MUX_SHIFT (8U) -/*! MUX - Pin Multiplex Control - * 0b0000..Alternative 0 (GPIO) - * 0b0001..Alternative 1 (chip-specific) - * 0b0010..Alternative 2 (chip-specific) - * 0b0011..Alternative 3 (chip-specific) - * 0b0100..Alternative 4 (chip-specific) - * 0b0101..Alternative 5 (chip-specific) - * 0b0110..Alternative 6 (chip-specific) - * 0b0111..Alternative 7 (chip-specific) - * 0b1000..Alternative 8 (chip-specific) - * 0b1001..Alternative 9 (chip-specific) - * 0b1010..Alternative 10 (chip-specific) - * 0b1011..Alternative 11 (chip-specific) - * 0b1100..Alternative 12 (chip-specific) - * 0b1101..Alternative 13 (chip-specific) - */ -#define PORT_PCR_MUX(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_MUX_SHIFT)) & PORT_PCR_MUX_MASK) /* Merged from fields with different position or width, of widths (2, 3, 4), largest definition used */ - -#define PORT_PCR_IBE_MASK (0x1000U) -#define PORT_PCR_IBE_SHIFT (12U) -/*! IBE - Input Buffer Enable - * 0b0..Disables - * 0b1..Enables - */ -#define PORT_PCR_IBE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_IBE_SHIFT)) & PORT_PCR_IBE_MASK) - -#define PORT_PCR_INV_MASK (0x2000U) -#define PORT_PCR_INV_SHIFT (13U) -/*! INV - Invert Input - * 0b0..Does not invert - * 0b1..Inverts - */ -#define PORT_PCR_INV(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_INV_SHIFT)) & PORT_PCR_INV_MASK) - -#define PORT_PCR_LK_MASK (0x8000U) -#define PORT_PCR_LK_SHIFT (15U) -/*! LK - Lock Register - * 0b0..Does not lock - * 0b1..Locks - */ -#define PORT_PCR_LK(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_LK_SHIFT)) & PORT_PCR_LK_MASK) -/*! @} */ - -/* The count of PORT_PCR */ -#define PORT_PCR_COUNT (32U) - - -/*! - * @} - */ /* end of group PORT_Register_Masks */ - - -/* PORT - Peripheral instance base addresses */ -/** Peripheral PORT0 base address */ -#define PORT0_BASE (0x400BC000u) -/** Peripheral PORT0 base pointer */ -#define PORT0 ((PORT_Type *)PORT0_BASE) -/** Peripheral PORT1 base address */ -#define PORT1_BASE (0x400BD000u) -/** Peripheral PORT1 base pointer */ -#define PORT1 ((PORT_Type *)PORT1_BASE) -/** Peripheral PORT2 base address */ -#define PORT2_BASE (0x400BE000u) -/** Peripheral PORT2 base pointer */ -#define PORT2 ((PORT_Type *)PORT2_BASE) -/** Peripheral PORT3 base address */ -#define PORT3_BASE (0x400BF000u) -/** Peripheral PORT3 base pointer */ -#define PORT3 ((PORT_Type *)PORT3_BASE) -/** Array initializer of PORT peripheral base addresses */ -#define PORT_BASE_ADDRS { PORT0_BASE, PORT1_BASE, PORT2_BASE, PORT3_BASE } -/** Array initializer of PORT peripheral base pointers */ -#define PORT_BASE_PTRS { PORT0, PORT1, PORT2, PORT3 } - -/*! - * @} - */ /* end of group PORT_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- PWM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PWM_Peripheral_Access_Layer PWM Peripheral Access Layer - * @{ - */ - -/** PWM - Register Layout Typedef */ -typedef struct { - struct { /* offset: 0x0, array step: 0x60 */ - __I uint16_t CNT; /**< Counter Register, array offset: 0x0, array step: 0x60 */ - __IO uint16_t INIT; /**< Initial Count Register, array offset: 0x2, array step: 0x60 */ - __IO uint16_t CTRL2; /**< Control 2 Register, array offset: 0x4, array step: 0x60 */ - __IO uint16_t CTRL; /**< Control Register, array offset: 0x6, array step: 0x60 */ - uint8_t RESERVED_0[2]; - __IO uint16_t VAL0; /**< Value Register 0, array offset: 0xA, array step: 0x60 */ - uint8_t RESERVED_1[2]; - __IO uint16_t VAL1; /**< Value Register 1, array offset: 0xE, array step: 0x60 */ - uint8_t RESERVED_2[2]; - __IO uint16_t VAL2; /**< Value Register 2, array offset: 0x12, array step: 0x60 */ - uint8_t RESERVED_3[2]; - __IO uint16_t VAL3; /**< Value Register 3, array offset: 0x16, array step: 0x60 */ - uint8_t RESERVED_4[2]; - __IO uint16_t VAL4; /**< Value Register 4, array offset: 0x1A, array step: 0x60 */ - uint8_t RESERVED_5[2]; - __IO uint16_t VAL5; /**< Value Register 5, array offset: 0x1E, array step: 0x60 */ - uint8_t RESERVED_6[2]; - __IO uint16_t OCTRL; /**< Output Control Register, array offset: 0x22, array step: 0x60 */ - __IO uint16_t STS; /**< Status Register, array offset: 0x24, array step: 0x60 */ - __IO uint16_t INTEN; /**< Interrupt Enable Register, array offset: 0x26, array step: 0x60 */ - __IO uint16_t DMAEN; /**< DMA Enable Register, array offset: 0x28, array step: 0x60 */ - __IO uint16_t TCTRL; /**< Output Trigger Control Register, array offset: 0x2A, array step: 0x60 */ - __IO uint16_t DISMAP[1]; /**< Fault Disable Mapping Register 0, array offset: 0x2C, array step: index*0x60, index2*0x2 */ - uint8_t RESERVED_7[2]; - __IO uint16_t DTCNT0; /**< Deadtime Count Register 0, array offset: 0x30, array step: 0x60 */ - __IO uint16_t DTCNT1; /**< Deadtime Count Register 1, array offset: 0x32, array step: 0x60 */ - uint8_t RESERVED_8[8]; - __IO uint16_t CAPTCTRLX; /**< Capture Control X Register, array offset: 0x3C, array step: 0x60 */ - __IO uint16_t CAPTCOMPX; /**< Capture Compare X Register, array offset: 0x3E, array step: 0x60 */ - __I uint16_t CVAL0; /**< Capture Value 0 Register, array offset: 0x40, array step: 0x60 */ - __I uint16_t CVAL0CYC; /**< Capture Value 0 Cycle Register, array offset: 0x42, array step: 0x60 */ - __I uint16_t CVAL1; /**< Capture Value 1 Register, array offset: 0x44, array step: 0x60 */ - __I uint16_t CVAL1CYC; /**< Capture Value 1 Cycle Register, array offset: 0x46, array step: 0x60 */ - uint8_t RESERVED_9[16]; - __IO uint16_t PHASEDLY; /**< Phase Delay Register, array offset: 0x58, array step: 0x60, valid indices: [1-2] */ - uint8_t RESERVED_10[4]; - __IO uint16_t CAPTFILTX; /**< Capture PWM_X Input Filter Register, array offset: 0x5E, array step: 0x60 */ - } SM[3]; - uint8_t RESERVED_0[96]; - __IO uint16_t OUTEN; /**< Output Enable Register, offset: 0x180 */ - __IO uint16_t MASK; /**< Mask Register, offset: 0x182 */ - __IO uint16_t SWCOUT; /**< Software Controlled Output Register, offset: 0x184 */ - __IO uint16_t DTSRCSEL; /**< PWM Source Select Register, offset: 0x186 */ - __IO uint16_t MCTRL; /**< Master Control Register, offset: 0x188 */ - __IO uint16_t MCTRL2; /**< Master Control 2 Register, offset: 0x18A */ - __IO uint16_t FCTRL; /**< Fault Control Register, offset: 0x18C */ - __IO uint16_t FSTS; /**< Fault Status Register, offset: 0x18E */ - __IO uint16_t FFILT; /**< Fault Filter Register, offset: 0x190 */ - __IO uint16_t FTST; /**< Fault Test Register, offset: 0x192 */ - __IO uint16_t FCTRL2; /**< Fault Control 2 Register, offset: 0x194 */ -} PWM_Type; - -/* ---------------------------------------------------------------------------- - -- PWM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PWM_Register_Masks PWM Register Masks - * @{ - */ - -/*! @name CNT - Counter Register */ -/*! @{ */ - -#define PWM_CNT_CNT_MASK (0xFFFFU) -#define PWM_CNT_CNT_SHIFT (0U) -/*! CNT - Counter Register Bits */ -#define PWM_CNT_CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CNT_CNT_SHIFT)) & PWM_CNT_CNT_MASK) -/*! @} */ - -/* The count of PWM_CNT */ -#define PWM_CNT_COUNT (3U) - -/*! @name INIT - Initial Count Register */ -/*! @{ */ - -#define PWM_INIT_INIT_MASK (0xFFFFU) -#define PWM_INIT_INIT_SHIFT (0U) -/*! INIT - Initial Count Register Bits */ -#define PWM_INIT_INIT(x) (((uint16_t)(((uint16_t)(x)) << PWM_INIT_INIT_SHIFT)) & PWM_INIT_INIT_MASK) -/*! @} */ - -/* The count of PWM_INIT */ -#define PWM_INIT_COUNT (3U) - -/*! @name CTRL2 - Control 2 Register */ -/*! @{ */ - -#define PWM_CTRL2_CLK_SEL_MASK (0x3U) -#define PWM_CTRL2_CLK_SEL_SHIFT (0U) -/*! CLK_SEL - Clock Source Select - * 0b00..The IPBus clock is used as the clock for the local prescaler and counter. - * 0b01..EXT_CLK is used as the clock for the local prescaler and counter. - * 0b10..Submodule 0's clock (AUX_CLK) is used as the source clock for the local prescaler and counter. This - * setting should not be used in submodule 0 as it forces the clock to logic 0. - * 0b11..Reserved - */ -#define PWM_CTRL2_CLK_SEL(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_CLK_SEL_SHIFT)) & PWM_CTRL2_CLK_SEL_MASK) - -#define PWM_CTRL2_RELOAD_SEL_MASK (0x4U) -#define PWM_CTRL2_RELOAD_SEL_SHIFT (2U) -/*! RELOAD_SEL - Reload Source Select - * 0b0..The local RELOAD signal is used to reload registers. - * 0b1..The master RELOAD signal (from submodule 0) is used to reload registers. This setting should not be used - * in submodule 0 as it forces the RELOAD signal to logic 0. - */ -#define PWM_CTRL2_RELOAD_SEL(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_RELOAD_SEL_SHIFT)) & PWM_CTRL2_RELOAD_SEL_MASK) - -#define PWM_CTRL2_FORCE_SEL_MASK (0x38U) -#define PWM_CTRL2_FORCE_SEL_SHIFT (3U) -/*! FORCE_SEL - Force Select - * 0b000..The local force signal, CTRL2[FORCE], from this submodule is used to force updates. - * 0b001..The master force signal from submodule 0 is used to force updates. This setting should not be used in - * submodule 0 as it holds the FORCE OUTPUT signal to logic 0. - * 0b010..The local reload signal from this submodule is used to force updates without regard to the state of LDOK. - * 0b011..The master reload signal from submodule0 is used to force updates if LDOK is set. This setting should - * not be used in submodule0 as it holds the FORCE OUTPUT signal to logic 0. - * 0b100..The local sync signal from this submodule is used to force updates. - * 0b101..The master sync signal from submodule0 is used to force updates. This setting should not be used in - * submodule0 as it holds the FORCE OUTPUT signal to logic 0. - * 0b110..The external force signal, EXT_FORCE, from outside the PWM module causes updates. - * 0b111..The external sync signal, EXT_SYNC, from outside the PWM module causes updates. - */ -#define PWM_CTRL2_FORCE_SEL(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_FORCE_SEL_SHIFT)) & PWM_CTRL2_FORCE_SEL_MASK) - -#define PWM_CTRL2_FORCE_MASK (0x40U) -#define PWM_CTRL2_FORCE_SHIFT (6U) -/*! FORCE - Force Initialization */ -#define PWM_CTRL2_FORCE(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_FORCE_SHIFT)) & PWM_CTRL2_FORCE_MASK) - -#define PWM_CTRL2_FRCEN_MASK (0x80U) -#define PWM_CTRL2_FRCEN_SHIFT (7U) -/*! FRCEN - Force Enable - * 0b0..Initialization from a FORCE_OUT is disabled. - * 0b1..Initialization from a FORCE_OUT is enabled. - */ -#define PWM_CTRL2_FRCEN(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_FRCEN_SHIFT)) & PWM_CTRL2_FRCEN_MASK) - -#define PWM_CTRL2_INIT_SEL_MASK (0x300U) -#define PWM_CTRL2_INIT_SEL_SHIFT (8U) -/*! INIT_SEL - Initialization Control Select - * 0b00..Local sync (PWM_X) causes initialization. - * 0b01..Master reload from submodule 0 causes initialization. This setting should not be used in submodule 0 as - * it forces the INIT signal to logic 0. The submodule counter will only re-initialize when a master reload - * occurs. - * 0b10..Master sync from submodule 0 causes initialization. This setting should not be used in submodule 0 as it forces the INIT signal to logic 0. - * 0b11..EXT_SYNC causes initialization. - */ -#define PWM_CTRL2_INIT_SEL(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_INIT_SEL_SHIFT)) & PWM_CTRL2_INIT_SEL_MASK) - -#define PWM_CTRL2_PWMX_INIT_MASK (0x400U) -#define PWM_CTRL2_PWMX_INIT_SHIFT (10U) -/*! PWMX_INIT - PWM_X Initial Value */ -#define PWM_CTRL2_PWMX_INIT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_PWMX_INIT_SHIFT)) & PWM_CTRL2_PWMX_INIT_MASK) - -#define PWM_CTRL2_PWM45_INIT_MASK (0x800U) -#define PWM_CTRL2_PWM45_INIT_SHIFT (11U) -/*! PWM45_INIT - PWM45 Initial Value */ -#define PWM_CTRL2_PWM45_INIT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_PWM45_INIT_SHIFT)) & PWM_CTRL2_PWM45_INIT_MASK) - -#define PWM_CTRL2_PWM23_INIT_MASK (0x1000U) -#define PWM_CTRL2_PWM23_INIT_SHIFT (12U) -/*! PWM23_INIT - PWM23 Initial Value */ -#define PWM_CTRL2_PWM23_INIT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_PWM23_INIT_SHIFT)) & PWM_CTRL2_PWM23_INIT_MASK) - -#define PWM_CTRL2_INDEP_MASK (0x2000U) -#define PWM_CTRL2_INDEP_SHIFT (13U) -/*! INDEP - Independent or Complementary Pair Operation - * 0b0..PWM_A and PWM_B form a complementary PWM pair. - * 0b1..PWM_A and PWM_B outputs are independent PWMs. - */ -#define PWM_CTRL2_INDEP(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_INDEP_SHIFT)) & PWM_CTRL2_INDEP_MASK) - -#define PWM_CTRL2_DBGEN_MASK (0x8000U) -#define PWM_CTRL2_DBGEN_SHIFT (15U) -/*! DBGEN - Debug Enable */ -#define PWM_CTRL2_DBGEN(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_DBGEN_SHIFT)) & PWM_CTRL2_DBGEN_MASK) -/*! @} */ - -/* The count of PWM_CTRL2 */ -#define PWM_CTRL2_COUNT (3U) - -/*! @name CTRL - Control Register */ -/*! @{ */ - -#define PWM_CTRL_DBLEN_MASK (0x1U) -#define PWM_CTRL_DBLEN_SHIFT (0U) -/*! DBLEN - Double Switching Enable - * 0b0..Double switching disabled. - * 0b1..Double switching enabled. - */ -#define PWM_CTRL_DBLEN(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_DBLEN_SHIFT)) & PWM_CTRL_DBLEN_MASK) - -#define PWM_CTRL_DBLX_MASK (0x2U) -#define PWM_CTRL_DBLX_SHIFT (1U) -/*! DBLX - PWM_X Double Switching Enable - * 0b0..PWM_X double pulse disabled. - * 0b1..PWM_X double pulse enabled. - */ -#define PWM_CTRL_DBLX(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_DBLX_SHIFT)) & PWM_CTRL_DBLX_MASK) - -#define PWM_CTRL_LDMOD_MASK (0x4U) -#define PWM_CTRL_LDMOD_SHIFT (2U) -/*! LDMOD - Load Mode Select - * 0b0..Buffered registers of this submodule are loaded and take effect at the next PWM reload if MCTRL[LDOK] is set. - * 0b1..Buffered registers of this submodule are loaded and take effect immediately upon MCTRL[LDOK] being set. - * In this case, it is not necessary to set CTRL[FULL] or CTRL[HALF]. - */ -#define PWM_CTRL_LDMOD(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_LDMOD_SHIFT)) & PWM_CTRL_LDMOD_MASK) - -#define PWM_CTRL_SPLIT_MASK (0x8U) -#define PWM_CTRL_SPLIT_SHIFT (3U) -/*! SPLIT - Split the DBLPWM signal to PWM_A and PWM_B - * 0b0..DBLPWM is not split. PWM_A and PWM_B each have double pulses. - * 0b1..DBLPWM is split to PWM_A and PWM_B. - */ -#define PWM_CTRL_SPLIT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_SPLIT_SHIFT)) & PWM_CTRL_SPLIT_MASK) - -#define PWM_CTRL_PRSC_MASK (0x70U) -#define PWM_CTRL_PRSC_SHIFT (4U) -/*! PRSC - Prescaler - * 0b000..Prescaler 1 - * 0b001..Prescaler 2 - * 0b010..Prescaler 4 - * 0b011..Prescaler 8 - * 0b100..Prescaler 16 - * 0b101..Prescaler 32 - * 0b110..Prescaler 64 - * 0b111..Prescaler 128 - */ -#define PWM_CTRL_PRSC(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_PRSC_SHIFT)) & PWM_CTRL_PRSC_MASK) - -#define PWM_CTRL_COMPMODE_MASK (0x80U) -#define PWM_CTRL_COMPMODE_SHIFT (7U) -/*! COMPMODE - Compare Mode - * 0b0..The VAL* registers and the PWM counter are compared using an "equal to" method. This means that PWM edges - * are only produced when the counter is equal to one of the VAL* register values. This implies that a PWM_A - * output that is high at the end of a period maintains this state until a match with VAL3 clears the output - * in the following period. - * 0b1..The VAL* registers and the PWM counter are compared using an "equal to or greater than" method. This - * means that PWM edges are produced when the counter is equal to or greater than one of the VAL* register - * values. This implies that a PWM_A output that is high at the end of a period could go low at the start of the - * next period if the starting counter value is greater than (but not necessarily equal to) the new VAL3 value. - */ -#define PWM_CTRL_COMPMODE(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_COMPMODE_SHIFT)) & PWM_CTRL_COMPMODE_MASK) - -#define PWM_CTRL_DT_MASK (0x300U) -#define PWM_CTRL_DT_SHIFT (8U) -/*! DT - Deadtime */ -#define PWM_CTRL_DT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_DT_SHIFT)) & PWM_CTRL_DT_MASK) - -#define PWM_CTRL_FULL_MASK (0x400U) -#define PWM_CTRL_FULL_SHIFT (10U) -/*! FULL - Full Cycle Reload - * 0b0..Full-cycle reloads disabled. - * 0b1..Full-cycle reloads enabled. - */ -#define PWM_CTRL_FULL(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_FULL_SHIFT)) & PWM_CTRL_FULL_MASK) - -#define PWM_CTRL_HALF_MASK (0x800U) -#define PWM_CTRL_HALF_SHIFT (11U) -/*! HALF - Half Cycle Reload - * 0b0..Half-cycle reloads disabled. - * 0b1..Half-cycle reloads enabled. - */ -#define PWM_CTRL_HALF(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_HALF_SHIFT)) & PWM_CTRL_HALF_MASK) - -#define PWM_CTRL_LDFQ_MASK (0xF000U) -#define PWM_CTRL_LDFQ_SHIFT (12U) -/*! LDFQ - Load Frequency - * 0b0000..Every PWM opportunity - * 0b0001..Every 2 PWM opportunities - * 0b0010..Every 3 PWM opportunities - * 0b0011..Every 4 PWM opportunities - * 0b0100..Every 5 PWM opportunities - * 0b0101..Every 6 PWM opportunities - * 0b0110..Every 7 PWM opportunities - * 0b0111..Every 8 PWM opportunities - * 0b1000..Every 9 PWM opportunities - * 0b1001..Every 10 PWM opportunities - * 0b1010..Every 11 PWM opportunities - * 0b1011..Every 12 PWM opportunities - * 0b1100..Every 13 PWM opportunities - * 0b1101..Every 14 PWM opportunities - * 0b1110..Every 15 PWM opportunities - * 0b1111..Every 16 PWM opportunities - */ -#define PWM_CTRL_LDFQ(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_LDFQ_SHIFT)) & PWM_CTRL_LDFQ_MASK) -/*! @} */ - -/* The count of PWM_CTRL */ -#define PWM_CTRL_COUNT (3U) - -/*! @name VAL0 - Value Register 0 */ -/*! @{ */ - -#define PWM_VAL0_VAL0_MASK (0xFFFFU) -#define PWM_VAL0_VAL0_SHIFT (0U) -/*! VAL0 - Value 0 */ -#define PWM_VAL0_VAL0(x) (((uint16_t)(((uint16_t)(x)) << PWM_VAL0_VAL0_SHIFT)) & PWM_VAL0_VAL0_MASK) -/*! @} */ - -/* The count of PWM_VAL0 */ -#define PWM_VAL0_COUNT (3U) - -/*! @name VAL1 - Value Register 1 */ -/*! @{ */ - -#define PWM_VAL1_VAL1_MASK (0xFFFFU) -#define PWM_VAL1_VAL1_SHIFT (0U) -/*! VAL1 - Value 1 */ -#define PWM_VAL1_VAL1(x) (((uint16_t)(((uint16_t)(x)) << PWM_VAL1_VAL1_SHIFT)) & PWM_VAL1_VAL1_MASK) -/*! @} */ - -/* The count of PWM_VAL1 */ -#define PWM_VAL1_COUNT (3U) - -/*! @name VAL2 - Value Register 2 */ -/*! @{ */ - -#define PWM_VAL2_VAL2_MASK (0xFFFFU) -#define PWM_VAL2_VAL2_SHIFT (0U) -/*! VAL2 - Value 2 */ -#define PWM_VAL2_VAL2(x) (((uint16_t)(((uint16_t)(x)) << PWM_VAL2_VAL2_SHIFT)) & PWM_VAL2_VAL2_MASK) -/*! @} */ - -/* The count of PWM_VAL2 */ -#define PWM_VAL2_COUNT (3U) - -/*! @name VAL3 - Value Register 3 */ -/*! @{ */ - -#define PWM_VAL3_VAL3_MASK (0xFFFFU) -#define PWM_VAL3_VAL3_SHIFT (0U) -/*! VAL3 - Value 3 */ -#define PWM_VAL3_VAL3(x) (((uint16_t)(((uint16_t)(x)) << PWM_VAL3_VAL3_SHIFT)) & PWM_VAL3_VAL3_MASK) -/*! @} */ - -/* The count of PWM_VAL3 */ -#define PWM_VAL3_COUNT (3U) - -/*! @name VAL4 - Value Register 4 */ -/*! @{ */ - -#define PWM_VAL4_VAL4_MASK (0xFFFFU) -#define PWM_VAL4_VAL4_SHIFT (0U) -/*! VAL4 - Value 4 */ -#define PWM_VAL4_VAL4(x) (((uint16_t)(((uint16_t)(x)) << PWM_VAL4_VAL4_SHIFT)) & PWM_VAL4_VAL4_MASK) -/*! @} */ - -/* The count of PWM_VAL4 */ -#define PWM_VAL4_COUNT (3U) - -/*! @name VAL5 - Value Register 5 */ -/*! @{ */ - -#define PWM_VAL5_VAL5_MASK (0xFFFFU) -#define PWM_VAL5_VAL5_SHIFT (0U) -/*! VAL5 - Value 5 */ -#define PWM_VAL5_VAL5(x) (((uint16_t)(((uint16_t)(x)) << PWM_VAL5_VAL5_SHIFT)) & PWM_VAL5_VAL5_MASK) -/*! @} */ - -/* The count of PWM_VAL5 */ -#define PWM_VAL5_COUNT (3U) - -/*! @name OCTRL - Output Control Register */ -/*! @{ */ - -#define PWM_OCTRL_PWMXFS_MASK (0x3U) -#define PWM_OCTRL_PWMXFS_SHIFT (0U) -/*! PWMXFS - PWM_X Fault State - * 0b00..Output is forced to logic 0 state prior to consideration of output polarity control. - * 0b01..Output is forced to logic 1 state prior to consideration of output polarity control. - * 0b10, 0b11..Output is put in a high-impedance state. - */ -#define PWM_OCTRL_PWMXFS(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_PWMXFS_SHIFT)) & PWM_OCTRL_PWMXFS_MASK) - -#define PWM_OCTRL_PWMBFS_MASK (0xCU) -#define PWM_OCTRL_PWMBFS_SHIFT (2U) -/*! PWMBFS - PWM_B Fault State - * 0b00..Output is forced to logic 0 state prior to consideration of output polarity control. - * 0b01..Output is forced to logic 1 state prior to consideration of output polarity control. - * 0b10, 0b11..Output is put in a high-impedance state. - */ -#define PWM_OCTRL_PWMBFS(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_PWMBFS_SHIFT)) & PWM_OCTRL_PWMBFS_MASK) - -#define PWM_OCTRL_PWMAFS_MASK (0x30U) -#define PWM_OCTRL_PWMAFS_SHIFT (4U) -/*! PWMAFS - PWM_A Fault State - * 0b00..Output is forced to logic 0 state prior to consideration of output polarity control. - * 0b01..Output is forced to logic 1 state prior to consideration of output polarity control. - * 0b10, 0b11..Output is put in a high-impedance state. - */ -#define PWM_OCTRL_PWMAFS(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_PWMAFS_SHIFT)) & PWM_OCTRL_PWMAFS_MASK) - -#define PWM_OCTRL_POLX_MASK (0x100U) -#define PWM_OCTRL_POLX_SHIFT (8U) -/*! POLX - PWM_X Output Polarity - * 0b0..PWM_X output not inverted. A high level on the PWM_X pin represents the "on" or "active" state. - * 0b1..PWM_X output inverted. A low level on the PWM_X pin represents the "on" or "active" state. - */ -#define PWM_OCTRL_POLX(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_POLX_SHIFT)) & PWM_OCTRL_POLX_MASK) - -#define PWM_OCTRL_POLB_MASK (0x200U) -#define PWM_OCTRL_POLB_SHIFT (9U) -/*! POLB - PWM_B Output Polarity - * 0b0..PWM_B output not inverted. A high level on the PWM_B pin represents the "on" or "active" state. - * 0b1..PWM_B output inverted. A low level on the PWM_B pin represents the "on" or "active" state. - */ -#define PWM_OCTRL_POLB(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_POLB_SHIFT)) & PWM_OCTRL_POLB_MASK) - -#define PWM_OCTRL_POLA_MASK (0x400U) -#define PWM_OCTRL_POLA_SHIFT (10U) -/*! POLA - PWM_A Output Polarity - * 0b0..PWM_A output not inverted. A high level on the PWM_A pin represents the "on" or "active" state. - * 0b1..PWM_A output inverted. A low level on the PWM_A pin represents the "on" or "active" state. - */ -#define PWM_OCTRL_POLA(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_POLA_SHIFT)) & PWM_OCTRL_POLA_MASK) - -#define PWM_OCTRL_PWMX_IN_MASK (0x2000U) -#define PWM_OCTRL_PWMX_IN_SHIFT (13U) -/*! PWMX_IN - PWM_X Input */ -#define PWM_OCTRL_PWMX_IN(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_PWMX_IN_SHIFT)) & PWM_OCTRL_PWMX_IN_MASK) - -#define PWM_OCTRL_PWMB_IN_MASK (0x4000U) -#define PWM_OCTRL_PWMB_IN_SHIFT (14U) -/*! PWMB_IN - PWM_B Input */ -#define PWM_OCTRL_PWMB_IN(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_PWMB_IN_SHIFT)) & PWM_OCTRL_PWMB_IN_MASK) - -#define PWM_OCTRL_PWMA_IN_MASK (0x8000U) -#define PWM_OCTRL_PWMA_IN_SHIFT (15U) -/*! PWMA_IN - PWM_A Input */ -#define PWM_OCTRL_PWMA_IN(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_PWMA_IN_SHIFT)) & PWM_OCTRL_PWMA_IN_MASK) -/*! @} */ - -/* The count of PWM_OCTRL */ -#define PWM_OCTRL_COUNT (3U) - -/*! @name STS - Status Register */ -/*! @{ */ - -#define PWM_STS_CMPF_MASK (0x3FU) -#define PWM_STS_CMPF_SHIFT (0U) -/*! CMPF - Compare Flags - * 0b000000..No compare event has occurred for a particular VALx value. - * 0b000001..A compare event has occurred for a particular VALx value. - */ -#define PWM_STS_CMPF(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_CMPF_SHIFT)) & PWM_STS_CMPF_MASK) - -#define PWM_STS_CFX0_MASK (0x40U) -#define PWM_STS_CFX0_SHIFT (6U) -/*! CFX0 - Capture Flag X0 */ -#define PWM_STS_CFX0(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_CFX0_SHIFT)) & PWM_STS_CFX0_MASK) - -#define PWM_STS_CFX1_MASK (0x80U) -#define PWM_STS_CFX1_SHIFT (7U) -/*! CFX1 - Capture Flag X1 */ -#define PWM_STS_CFX1(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_CFX1_SHIFT)) & PWM_STS_CFX1_MASK) - -#define PWM_STS_RF_MASK (0x1000U) -#define PWM_STS_RF_SHIFT (12U) -/*! RF - Reload Flag - * 0b0..No new reload cycle since last STS[RF] clearing - * 0b1..New reload cycle since last STS[RF] clearing - */ -#define PWM_STS_RF(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_RF_SHIFT)) & PWM_STS_RF_MASK) - -#define PWM_STS_REF_MASK (0x2000U) -#define PWM_STS_REF_SHIFT (13U) -/*! REF - Reload Error Flag - * 0b0..No reload error occurred. - * 0b1..Reload signal occurred with non-coherent data and MCTRL[LDOK] = 0. - */ -#define PWM_STS_REF(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_REF_SHIFT)) & PWM_STS_REF_MASK) - -#define PWM_STS_RUF_MASK (0x4000U) -#define PWM_STS_RUF_SHIFT (14U) -/*! RUF - Registers Updated Flag - * 0b0..No register update has occurred since last reload. - * 0b1..At least one of the double buffered registers has been updated since the last reload. - */ -#define PWM_STS_RUF(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_RUF_SHIFT)) & PWM_STS_RUF_MASK) -/*! @} */ - -/* The count of PWM_STS */ -#define PWM_STS_COUNT (3U) - -/*! @name INTEN - Interrupt Enable Register */ -/*! @{ */ - -#define PWM_INTEN_CMPIE_MASK (0x3FU) -#define PWM_INTEN_CMPIE_SHIFT (0U) -/*! CMPIE - Compare Interrupt Enables - * 0b000000..The corresponding STS[CMPF] bit will not cause an interrupt request. - * 0b000001..The corresponding STS[CMPF] bit will cause an interrupt request. - */ -#define PWM_INTEN_CMPIE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_CMPIE_SHIFT)) & PWM_INTEN_CMPIE_MASK) - -#define PWM_INTEN_CX0IE_MASK (0x40U) -#define PWM_INTEN_CX0IE_SHIFT (6U) -/*! CX0IE - Capture X 0 Interrupt Enable - * 0b0..Interrupt request disabled for STS[CFX0]. - * 0b1..Interrupt request enabled for STS[CFX0]. - */ -#define PWM_INTEN_CX0IE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_CX0IE_SHIFT)) & PWM_INTEN_CX0IE_MASK) - -#define PWM_INTEN_CX1IE_MASK (0x80U) -#define PWM_INTEN_CX1IE_SHIFT (7U) -/*! CX1IE - Capture X 1 Interrupt Enable - * 0b0..Interrupt request disabled for STS[CFX1]. - * 0b1..Interrupt request enabled for STS[CFX1]. - */ -#define PWM_INTEN_CX1IE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_CX1IE_SHIFT)) & PWM_INTEN_CX1IE_MASK) - -#define PWM_INTEN_RIE_MASK (0x1000U) -#define PWM_INTEN_RIE_SHIFT (12U) -/*! RIE - Reload Interrupt Enable - * 0b0..STS[RF] CPU interrupt requests disabled - * 0b1..STS[RF] CPU interrupt requests enabled - */ -#define PWM_INTEN_RIE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_RIE_SHIFT)) & PWM_INTEN_RIE_MASK) - -#define PWM_INTEN_REIE_MASK (0x2000U) -#define PWM_INTEN_REIE_SHIFT (13U) -/*! REIE - Reload Error Interrupt Enable - * 0b0..STS[REF] CPU interrupt requests disabled - * 0b1..STS[REF] CPU interrupt requests enabled - */ -#define PWM_INTEN_REIE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_REIE_SHIFT)) & PWM_INTEN_REIE_MASK) -/*! @} */ - -/* The count of PWM_INTEN */ -#define PWM_INTEN_COUNT (3U) - -/*! @name DMAEN - DMA Enable Register */ -/*! @{ */ - -#define PWM_DMAEN_CX0DE_MASK (0x1U) -#define PWM_DMAEN_CX0DE_SHIFT (0U) -/*! CX0DE - Capture X0 FIFO DMA Enable */ -#define PWM_DMAEN_CX0DE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_CX0DE_SHIFT)) & PWM_DMAEN_CX0DE_MASK) - -#define PWM_DMAEN_CX1DE_MASK (0x2U) -#define PWM_DMAEN_CX1DE_SHIFT (1U) -/*! CX1DE - Capture X1 FIFO DMA Enable */ -#define PWM_DMAEN_CX1DE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_CX1DE_SHIFT)) & PWM_DMAEN_CX1DE_MASK) - -#define PWM_DMAEN_CAPTDE_MASK (0xC0U) -#define PWM_DMAEN_CAPTDE_SHIFT (6U) -/*! CAPTDE - Capture DMA Enable Source Select - * 0b00..Read DMA requests disabled. - * 0b01..Exceeding a FIFO watermark sets the DMA read request. This requires at least one of DMAEN[CA1DE], - * DMAEN[CA0DE], DMAEN[CB1DE], DMAEN[CB0DE], DMAEN[CX1DE], or DMAEN[CX0DE] to be set to determine which - * watermark(s) the DMA request is sensitive. - * 0b10..A local synchronization (VAL1 matches counter) sets the read DMA request. - * 0b11..A local reload (STS[RF] being set) sets the read DMA request. - */ -#define PWM_DMAEN_CAPTDE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_CAPTDE_SHIFT)) & PWM_DMAEN_CAPTDE_MASK) - -#define PWM_DMAEN_FAND_MASK (0x100U) -#define PWM_DMAEN_FAND_SHIFT (8U) -/*! FAND - FIFO Watermark AND Control - * 0b0..Selected FIFO watermarks are OR'ed together. - * 0b1..Selected FIFO watermarks are AND'ed together. - */ -#define PWM_DMAEN_FAND(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_FAND_SHIFT)) & PWM_DMAEN_FAND_MASK) - -#define PWM_DMAEN_VALDE_MASK (0x200U) -#define PWM_DMAEN_VALDE_SHIFT (9U) -/*! VALDE - Value Registers DMA Enable - * 0b0..DMA write requests disabled - * 0b1..Enabled - */ -#define PWM_DMAEN_VALDE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_VALDE_SHIFT)) & PWM_DMAEN_VALDE_MASK) -/*! @} */ - -/* The count of PWM_DMAEN */ -#define PWM_DMAEN_COUNT (3U) - -/*! @name TCTRL - Output Trigger Control Register */ -/*! @{ */ - -#define PWM_TCTRL_OUT_TRIG_EN_MASK (0x3FU) -#define PWM_TCTRL_OUT_TRIG_EN_SHIFT (0U) -/*! OUT_TRIG_EN - Output Trigger Enables - * 0bxxxxx1..PWM_OUT_TRIG0 will set when the counter value matches the VAL0 value. - * 0bxxxx1x..PWM_OUT_TRIG1 will set when the counter value matches the VAL1 value. - * 0bxxx1xx..PWM_OUT_TRIG0 will set when the counter value matches the VAL2 value. - * 0bxx1xxx..PWM_OUT_TRIG1 will set when the counter value matches the VAL3 value. - * 0bx1xxxx..PWM_OUT_TRIG0 will set when the counter value matches the VAL4 value. - * 0b1xxxxx..PWM_OUT_TRIG1 will set when the counter value matches the VAL5 value. - */ -#define PWM_TCTRL_OUT_TRIG_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_TCTRL_OUT_TRIG_EN_SHIFT)) & PWM_TCTRL_OUT_TRIG_EN_MASK) - -#define PWM_TCTRL_TRGFRQ_MASK (0x1000U) -#define PWM_TCTRL_TRGFRQ_SHIFT (12U) -/*! TRGFRQ - Trigger Frequency - * 0b0..Trigger outputs are generated during every PWM period even if the PWM is not reloaded every period due to CTRL[LDFQ] being non-zero. - * 0b1..Trigger outputs are generated only during the final PWM period prior to a reload opportunity when the PWM - * is not reloaded every period due to CTRL[LDFQ] being non-zero. - */ -#define PWM_TCTRL_TRGFRQ(x) (((uint16_t)(((uint16_t)(x)) << PWM_TCTRL_TRGFRQ_SHIFT)) & PWM_TCTRL_TRGFRQ_MASK) - -#define PWM_TCTRL_PWBOT1_MASK (0x4000U) -#define PWM_TCTRL_PWBOT1_SHIFT (14U) -/*! PWBOT1 - Mux Output Trigger 1 Source Select - * 0b0..Route the PWM_OUT_TRIG1 signal to PWM_MUX_TRIG1 port. - * 0b1..Route the PWM_B output to the PWM_MUX_TRIG1 port. - */ -#define PWM_TCTRL_PWBOT1(x) (((uint16_t)(((uint16_t)(x)) << PWM_TCTRL_PWBOT1_SHIFT)) & PWM_TCTRL_PWBOT1_MASK) - -#define PWM_TCTRL_PWAOT0_MASK (0x8000U) -#define PWM_TCTRL_PWAOT0_SHIFT (15U) -/*! PWAOT0 - Mux Output Trigger 0 Source Select - * 0b0..Route the PWM_OUT_TRIG0 signal to PWM_MUX_TRIG0 port. - * 0b1..Route the PWM_A output to the PWM_MUX_TRIG0 port. - */ -#define PWM_TCTRL_PWAOT0(x) (((uint16_t)(((uint16_t)(x)) << PWM_TCTRL_PWAOT0_SHIFT)) & PWM_TCTRL_PWAOT0_MASK) -/*! @} */ - -/* The count of PWM_TCTRL */ -#define PWM_TCTRL_COUNT (3U) - -/*! @name DISMAP - Fault Disable Mapping Register 0 */ -/*! @{ */ - -#define PWM_DISMAP_DIS0A_MASK (0xFU) -#define PWM_DISMAP_DIS0A_SHIFT (0U) -/*! DIS0A - PWM_A Fault Disable Mask 0 */ -#define PWM_DISMAP_DIS0A(x) (((uint16_t)(((uint16_t)(x)) << PWM_DISMAP_DIS0A_SHIFT)) & PWM_DISMAP_DIS0A_MASK) - -#define PWM_DISMAP_DIS0B_MASK (0xF0U) -#define PWM_DISMAP_DIS0B_SHIFT (4U) -/*! DIS0B - PWM_B Fault Disable Mask 0 */ -#define PWM_DISMAP_DIS0B(x) (((uint16_t)(((uint16_t)(x)) << PWM_DISMAP_DIS0B_SHIFT)) & PWM_DISMAP_DIS0B_MASK) - -#define PWM_DISMAP_DIS0X_MASK (0xF00U) -#define PWM_DISMAP_DIS0X_SHIFT (8U) -/*! DIS0X - PWM_X Fault Disable Mask 0 */ -#define PWM_DISMAP_DIS0X(x) (((uint16_t)(((uint16_t)(x)) << PWM_DISMAP_DIS0X_SHIFT)) & PWM_DISMAP_DIS0X_MASK) -/*! @} */ - -/* The count of PWM_DISMAP */ -#define PWM_DISMAP_COUNT (3U) - -/* The count of PWM_DISMAP */ -#define PWM_DISMAP_COUNT2 (1U) - -/*! @name DTCNT0 - Deadtime Count Register 0 */ -/*! @{ */ - -#define PWM_DTCNT0_DTCNT0_MASK (0x7FFU) -#define PWM_DTCNT0_DTCNT0_SHIFT (0U) -/*! DTCNT0 - Deadtime Count Register 0 */ -#define PWM_DTCNT0_DTCNT0(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTCNT0_DTCNT0_SHIFT)) & PWM_DTCNT0_DTCNT0_MASK) -/*! @} */ - -/* The count of PWM_DTCNT0 */ -#define PWM_DTCNT0_COUNT (3U) - -/*! @name DTCNT1 - Deadtime Count Register 1 */ -/*! @{ */ - -#define PWM_DTCNT1_DTCNT1_MASK (0x7FFU) -#define PWM_DTCNT1_DTCNT1_SHIFT (0U) -/*! DTCNT1 - Deadtime Count Register 1 */ -#define PWM_DTCNT1_DTCNT1(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTCNT1_DTCNT1_SHIFT)) & PWM_DTCNT1_DTCNT1_MASK) -/*! @} */ - -/* The count of PWM_DTCNT1 */ -#define PWM_DTCNT1_COUNT (3U) - -/*! @name CAPTCTRLX - Capture Control X Register */ -/*! @{ */ - -#define PWM_CAPTCTRLX_ARMX_MASK (0x1U) -#define PWM_CAPTCTRLX_ARMX_SHIFT (0U) -/*! ARMX - Arm X - * 0b0..Input capture operation is disabled. - * 0b1..Input capture operation as specified by CAPTCTRLX[EDGXx] is enabled. - */ -#define PWM_CAPTCTRLX_ARMX(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_ARMX_SHIFT)) & PWM_CAPTCTRLX_ARMX_MASK) - -#define PWM_CAPTCTRLX_ONESHOTX_MASK (0x2U) -#define PWM_CAPTCTRLX_ONESHOTX_SHIFT (1U) -/*! ONESHOTX - One Shot Mode Aux - * 0b0..Free Running - * 0b1..One Shot - */ -#define PWM_CAPTCTRLX_ONESHOTX(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_ONESHOTX_SHIFT)) & PWM_CAPTCTRLX_ONESHOTX_MASK) - -#define PWM_CAPTCTRLX_EDGX0_MASK (0xCU) -#define PWM_CAPTCTRLX_EDGX0_SHIFT (2U) -/*! EDGX0 - Edge X 0 - * 0b00..Disabled - * 0b01..Capture falling edges - * 0b10..Capture rising edges - * 0b11..Capture any edge - */ -#define PWM_CAPTCTRLX_EDGX0(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_EDGX0_SHIFT)) & PWM_CAPTCTRLX_EDGX0_MASK) - -#define PWM_CAPTCTRLX_EDGX1_MASK (0x30U) -#define PWM_CAPTCTRLX_EDGX1_SHIFT (4U) -/*! EDGX1 - Edge X 1 - * 0b00..Disabled - * 0b01..Capture falling edges - * 0b10..Capture rising edges - * 0b11..Capture any edge - */ -#define PWM_CAPTCTRLX_EDGX1(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_EDGX1_SHIFT)) & PWM_CAPTCTRLX_EDGX1_MASK) - -#define PWM_CAPTCTRLX_INP_SELX_MASK (0x40U) -#define PWM_CAPTCTRLX_INP_SELX_SHIFT (6U) -/*! INP_SELX - Input Select X - * 0b0..Raw PWM_X input signal selected as source. - * 0b1..Edge Counter - */ -#define PWM_CAPTCTRLX_INP_SELX(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_INP_SELX_SHIFT)) & PWM_CAPTCTRLX_INP_SELX_MASK) - -#define PWM_CAPTCTRLX_EDGCNTX_EN_MASK (0x80U) -#define PWM_CAPTCTRLX_EDGCNTX_EN_SHIFT (7U) -/*! EDGCNTX_EN - Edge Counter X Enable - * 0b0..Edge counter disabled and held in reset - * 0b1..Edge counter enabled - */ -#define PWM_CAPTCTRLX_EDGCNTX_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_EDGCNTX_EN_SHIFT)) & PWM_CAPTCTRLX_EDGCNTX_EN_MASK) - -#define PWM_CAPTCTRLX_CFXWM_MASK (0x300U) -#define PWM_CAPTCTRLX_CFXWM_SHIFT (8U) -/*! CFXWM - Capture X FIFOs Water Mark */ -#define PWM_CAPTCTRLX_CFXWM(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_CFXWM_SHIFT)) & PWM_CAPTCTRLX_CFXWM_MASK) - -#define PWM_CAPTCTRLX_CX0CNT_MASK (0x1C00U) -#define PWM_CAPTCTRLX_CX0CNT_SHIFT (10U) -/*! CX0CNT - Capture X0 FIFO Word Count */ -#define PWM_CAPTCTRLX_CX0CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_CX0CNT_SHIFT)) & PWM_CAPTCTRLX_CX0CNT_MASK) - -#define PWM_CAPTCTRLX_CX1CNT_MASK (0xE000U) -#define PWM_CAPTCTRLX_CX1CNT_SHIFT (13U) -/*! CX1CNT - Capture X1 FIFO Word Count */ -#define PWM_CAPTCTRLX_CX1CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_CX1CNT_SHIFT)) & PWM_CAPTCTRLX_CX1CNT_MASK) -/*! @} */ - -/* The count of PWM_CAPTCTRLX */ -#define PWM_CAPTCTRLX_COUNT (3U) - -/*! @name CAPTCOMPX - Capture Compare X Register */ -/*! @{ */ - -#define PWM_CAPTCOMPX_EDGCMPX_MASK (0xFFU) -#define PWM_CAPTCOMPX_EDGCMPX_SHIFT (0U) -/*! EDGCMPX - Edge Compare X */ -#define PWM_CAPTCOMPX_EDGCMPX(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCOMPX_EDGCMPX_SHIFT)) & PWM_CAPTCOMPX_EDGCMPX_MASK) - -#define PWM_CAPTCOMPX_EDGCNTX_MASK (0xFF00U) -#define PWM_CAPTCOMPX_EDGCNTX_SHIFT (8U) -/*! EDGCNTX - Edge Counter X */ -#define PWM_CAPTCOMPX_EDGCNTX(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCOMPX_EDGCNTX_SHIFT)) & PWM_CAPTCOMPX_EDGCNTX_MASK) -/*! @} */ - -/* The count of PWM_CAPTCOMPX */ -#define PWM_CAPTCOMPX_COUNT (3U) - -/*! @name CVAL0 - Capture Value 0 Register */ -/*! @{ */ - -#define PWM_CVAL0_CAPTVAL0_MASK (0xFFFFU) -#define PWM_CVAL0_CAPTVAL0_SHIFT (0U) -/*! CAPTVAL0 - Capture Value 0 */ -#define PWM_CVAL0_CAPTVAL0(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL0_CAPTVAL0_SHIFT)) & PWM_CVAL0_CAPTVAL0_MASK) -/*! @} */ - -/* The count of PWM_CVAL0 */ -#define PWM_CVAL0_COUNT (3U) - -/*! @name CVAL0CYC - Capture Value 0 Cycle Register */ -/*! @{ */ - -#define PWM_CVAL0CYC_CVAL0CYC_MASK (0xFU) -#define PWM_CVAL0CYC_CVAL0CYC_SHIFT (0U) -/*! CVAL0CYC - Capture Value 0 Cycle */ -#define PWM_CVAL0CYC_CVAL0CYC(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL0CYC_CVAL0CYC_SHIFT)) & PWM_CVAL0CYC_CVAL0CYC_MASK) -/*! @} */ - -/* The count of PWM_CVAL0CYC */ -#define PWM_CVAL0CYC_COUNT (3U) - -/*! @name CVAL1 - Capture Value 1 Register */ -/*! @{ */ - -#define PWM_CVAL1_CAPTVAL1_MASK (0xFFFFU) -#define PWM_CVAL1_CAPTVAL1_SHIFT (0U) -/*! CAPTVAL1 - Capture Value 1 */ -#define PWM_CVAL1_CAPTVAL1(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL1_CAPTVAL1_SHIFT)) & PWM_CVAL1_CAPTVAL1_MASK) -/*! @} */ - -/* The count of PWM_CVAL1 */ -#define PWM_CVAL1_COUNT (3U) - -/*! @name CVAL1CYC - Capture Value 1 Cycle Register */ -/*! @{ */ - -#define PWM_CVAL1CYC_CVAL1CYC_MASK (0xFU) -#define PWM_CVAL1CYC_CVAL1CYC_SHIFT (0U) -/*! CVAL1CYC - Capture Value 1 Cycle */ -#define PWM_CVAL1CYC_CVAL1CYC(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL1CYC_CVAL1CYC_SHIFT)) & PWM_CVAL1CYC_CVAL1CYC_MASK) -/*! @} */ - -/* The count of PWM_CVAL1CYC */ -#define PWM_CVAL1CYC_COUNT (3U) - -/*! @name PHASEDLY - Phase Delay Register */ -/*! @{ */ - -#define PWM_PHASEDLY_PHASEDLY_MASK (0xFFFFU) -#define PWM_PHASEDLY_PHASEDLY_SHIFT (0U) -/*! PHASEDLY - Initial Count Register Bits */ -#define PWM_PHASEDLY_PHASEDLY(x) (((uint16_t)(((uint16_t)(x)) << PWM_PHASEDLY_PHASEDLY_SHIFT)) & PWM_PHASEDLY_PHASEDLY_MASK) -/*! @} */ - -/* The count of PWM_PHASEDLY */ -#define PWM_PHASEDLY_COUNT (3U) - -/*! @name CAPTFILTX - Capture PWM_X Input Filter Register */ -/*! @{ */ - -#define PWM_CAPTFILTX_CAPTX_FILT_PER_MASK (0xFFU) -#define PWM_CAPTFILTX_CAPTX_FILT_PER_SHIFT (0U) -/*! CAPTX_FILT_PER - Input Capture Filter Period */ -#define PWM_CAPTFILTX_CAPTX_FILT_PER(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTFILTX_CAPTX_FILT_PER_SHIFT)) & PWM_CAPTFILTX_CAPTX_FILT_PER_MASK) - -#define PWM_CAPTFILTX_CAPTX_FILT_CNT_MASK (0x700U) -#define PWM_CAPTFILTX_CAPTX_FILT_CNT_SHIFT (8U) -/*! CAPTX_FILT_CNT - Input Capture Filter Count */ -#define PWM_CAPTFILTX_CAPTX_FILT_CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTFILTX_CAPTX_FILT_CNT_SHIFT)) & PWM_CAPTFILTX_CAPTX_FILT_CNT_MASK) -/*! @} */ - -/* The count of PWM_CAPTFILTX */ -#define PWM_CAPTFILTX_COUNT (3U) - -/*! @name OUTEN - Output Enable Register */ -/*! @{ */ - -#define PWM_OUTEN_PWMX_EN_MASK (0x7U) -#define PWM_OUTEN_PWMX_EN_SHIFT (0U) -/*! PWMX_EN - PWM_X Output Enables */ -#define PWM_OUTEN_PWMX_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_OUTEN_PWMX_EN_SHIFT)) & PWM_OUTEN_PWMX_EN_MASK) - -#define PWM_OUTEN_PWMB_EN_MASK (0x70U) -#define PWM_OUTEN_PWMB_EN_SHIFT (4U) -/*! PWMB_EN - PWM_B Output Enables */ -#define PWM_OUTEN_PWMB_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_OUTEN_PWMB_EN_SHIFT)) & PWM_OUTEN_PWMB_EN_MASK) - -#define PWM_OUTEN_PWMA_EN_MASK (0x700U) -#define PWM_OUTEN_PWMA_EN_SHIFT (8U) -/*! PWMA_EN - PWM_A Output Enables */ -#define PWM_OUTEN_PWMA_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_OUTEN_PWMA_EN_SHIFT)) & PWM_OUTEN_PWMA_EN_MASK) -/*! @} */ - -/*! @name MASK - Mask Register */ -/*! @{ */ - -#define PWM_MASK_MASKX_MASK (0x7U) -#define PWM_MASK_MASKX_SHIFT (0U) -/*! MASKX - PWM_X Masks */ -#define PWM_MASK_MASKX(x) (((uint16_t)(((uint16_t)(x)) << PWM_MASK_MASKX_SHIFT)) & PWM_MASK_MASKX_MASK) - -#define PWM_MASK_MASKB_MASK (0x70U) -#define PWM_MASK_MASKB_SHIFT (4U) -/*! MASKB - PWM_B Masks */ -#define PWM_MASK_MASKB(x) (((uint16_t)(((uint16_t)(x)) << PWM_MASK_MASKB_SHIFT)) & PWM_MASK_MASKB_MASK) - -#define PWM_MASK_MASKA_MASK (0x700U) -#define PWM_MASK_MASKA_SHIFT (8U) -/*! MASKA - PWM_A Masks */ -#define PWM_MASK_MASKA(x) (((uint16_t)(((uint16_t)(x)) << PWM_MASK_MASKA_SHIFT)) & PWM_MASK_MASKA_MASK) - -#define PWM_MASK_UPDATE_MASK_MASK (0x7000U) -#define PWM_MASK_UPDATE_MASK_SHIFT (12U) -/*! UPDATE_MASK - Update Mask Bits Immediately */ -#define PWM_MASK_UPDATE_MASK(x) (((uint16_t)(((uint16_t)(x)) << PWM_MASK_UPDATE_MASK_SHIFT)) & PWM_MASK_UPDATE_MASK_MASK) -/*! @} */ - -/*! @name SWCOUT - Software Controlled Output Register */ -/*! @{ */ - -#define PWM_SWCOUT_SM0OUT45_MASK (0x1U) -#define PWM_SWCOUT_SM0OUT45_SHIFT (0U) -/*! SM0OUT45 - Submodule 0 Software Controlled Output 45 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 0 instead of PWM45. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 0 instead of PWM45. - */ -#define PWM_SWCOUT_SM0OUT45(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM0OUT45_SHIFT)) & PWM_SWCOUT_SM0OUT45_MASK) - -#define PWM_SWCOUT_SM0OUT23_MASK (0x2U) -#define PWM_SWCOUT_SM0OUT23_SHIFT (1U) -/*! SM0OUT23 - Submodule 0 Software Controlled Output 23 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 0 instead of PWM23. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 0 instead of PWM23. - */ -#define PWM_SWCOUT_SM0OUT23(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM0OUT23_SHIFT)) & PWM_SWCOUT_SM0OUT23_MASK) - -#define PWM_SWCOUT_SM1OUT45_MASK (0x4U) -#define PWM_SWCOUT_SM1OUT45_SHIFT (2U) -/*! SM1OUT45 - Submodule 1 Software Controlled Output 45 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 1 instead of PWM45. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 1 instead of PWM45. - */ -#define PWM_SWCOUT_SM1OUT45(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM1OUT45_SHIFT)) & PWM_SWCOUT_SM1OUT45_MASK) - -#define PWM_SWCOUT_SM1OUT23_MASK (0x8U) -#define PWM_SWCOUT_SM1OUT23_SHIFT (3U) -/*! SM1OUT23 - Submodule 1 Software Controlled Output 23 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 1 instead of PWM23. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 1 instead of PWM23. - */ -#define PWM_SWCOUT_SM1OUT23(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM1OUT23_SHIFT)) & PWM_SWCOUT_SM1OUT23_MASK) - -#define PWM_SWCOUT_SM2OUT45_MASK (0x10U) -#define PWM_SWCOUT_SM2OUT45_SHIFT (4U) -/*! SM2OUT45 - Submodule 2 Software Controlled Output 45 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 2 instead of PWM45. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 2 instead of PWM45. - */ -#define PWM_SWCOUT_SM2OUT45(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM2OUT45_SHIFT)) & PWM_SWCOUT_SM2OUT45_MASK) - -#define PWM_SWCOUT_SM2OUT23_MASK (0x20U) -#define PWM_SWCOUT_SM2OUT23_SHIFT (5U) -/*! SM2OUT23 - Submodule 2 Software Controlled Output 23 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 2 instead of PWM23. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 2 instead of PWM23. - */ -#define PWM_SWCOUT_SM2OUT23(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM2OUT23_SHIFT)) & PWM_SWCOUT_SM2OUT23_MASK) -/*! @} */ - -/*! @name DTSRCSEL - PWM Source Select Register */ -/*! @{ */ - -#define PWM_DTSRCSEL_SM0SEL45_MASK (0x3U) -#define PWM_DTSRCSEL_SM0SEL45_SHIFT (0U) -/*! SM0SEL45 - Submodule 0 PWM45 Control Select - * 0b00..Generated SM0PWM45 signal used by the deadtime logic. - * 0b01..Inverted generated SM0PWM45 signal used by the deadtime logic. - * 0b10..SWCOUT[SM0OUT45] used by the deadtime logic. - * 0b11..Reserved - */ -#define PWM_DTSRCSEL_SM0SEL45(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM0SEL45_SHIFT)) & PWM_DTSRCSEL_SM0SEL45_MASK) - -#define PWM_DTSRCSEL_SM0SEL23_MASK (0xCU) -#define PWM_DTSRCSEL_SM0SEL23_SHIFT (2U) -/*! SM0SEL23 - Submodule 0 PWM23 Control Select - * 0b00..Generated SM0PWM23 signal used by the deadtime logic. - * 0b01..Inverted generated SM0PWM23 signal used by the deadtime logic. - * 0b10..SWCOUT[SM0OUT23] used by the deadtime logic. - * 0b11..PWM0_EXTA signal used by the deadtime logic. - */ -#define PWM_DTSRCSEL_SM0SEL23(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM0SEL23_SHIFT)) & PWM_DTSRCSEL_SM0SEL23_MASK) - -#define PWM_DTSRCSEL_SM1SEL45_MASK (0x30U) -#define PWM_DTSRCSEL_SM1SEL45_SHIFT (4U) -/*! SM1SEL45 - Submodule 1 PWM45 Control Select - * 0b00..Generated SM1PWM45 signal used by the deadtime logic. - * 0b01..Inverted generated SM1PWM45 signal used by the deadtime logic. - * 0b10..SWCOUT[SM1OUT45] used by the deadtime logic. - * 0b11..Reserved - */ -#define PWM_DTSRCSEL_SM1SEL45(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM1SEL45_SHIFT)) & PWM_DTSRCSEL_SM1SEL45_MASK) - -#define PWM_DTSRCSEL_SM1SEL23_MASK (0xC0U) -#define PWM_DTSRCSEL_SM1SEL23_SHIFT (6U) -/*! SM1SEL23 - Submodule 1 PWM23 Control Select - * 0b00..Generated SM1PWM23 signal used by the deadtime logic. - * 0b01..Inverted generated SM1PWM23 signal used by the deadtime logic. - * 0b10..SWCOUT[SM1OUT23] used by the deadtime logic. - * 0b11..PWM1_EXTA signal used by the deadtime logic. - */ -#define PWM_DTSRCSEL_SM1SEL23(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM1SEL23_SHIFT)) & PWM_DTSRCSEL_SM1SEL23_MASK) - -#define PWM_DTSRCSEL_SM2SEL45_MASK (0x300U) -#define PWM_DTSRCSEL_SM2SEL45_SHIFT (8U) -/*! SM2SEL45 - Submodule 2 PWM45 Control Select - * 0b00..Generated SM2PWM45 signal used by the deadtime logic. - * 0b01..Inverted generated SM2PWM45 signal used by the deadtime logic. - * 0b10..SWCOUT[SM2OUT45] used by the deadtime logic. - * 0b11..Reserved - */ -#define PWM_DTSRCSEL_SM2SEL45(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM2SEL45_SHIFT)) & PWM_DTSRCSEL_SM2SEL45_MASK) - -#define PWM_DTSRCSEL_SM2SEL23_MASK (0xC00U) -#define PWM_DTSRCSEL_SM2SEL23_SHIFT (10U) -/*! SM2SEL23 - Submodule 2 PWM23 Control Select - * 0b00..Generated SM2PWM23 signal used by the deadtime logic. - * 0b01..Inverted generated SM2PWM23 signal used by the deadtime logic. - * 0b10..SWCOUT[SM2OUT23] used by the deadtime logic. - * 0b11..PWM2_EXTA signal used by the deadtime logic. - */ -#define PWM_DTSRCSEL_SM2SEL23(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM2SEL23_SHIFT)) & PWM_DTSRCSEL_SM2SEL23_MASK) -/*! @} */ - -/*! @name MCTRL - Master Control Register */ -/*! @{ */ - -#define PWM_MCTRL_LDOK_MASK (0x7U) -#define PWM_MCTRL_LDOK_SHIFT (0U) -/*! LDOK - Load Okay - * 0b000..Do not load new values. - * 0b001..Load prescaler, modulus, and PWM values of the corresponding submodule. - */ -#define PWM_MCTRL_LDOK(x) (((uint16_t)(((uint16_t)(x)) << PWM_MCTRL_LDOK_SHIFT)) & PWM_MCTRL_LDOK_MASK) - -#define PWM_MCTRL_CLDOK_MASK (0x70U) -#define PWM_MCTRL_CLDOK_SHIFT (4U) -/*! CLDOK - Clear Load Okay */ -#define PWM_MCTRL_CLDOK(x) (((uint16_t)(((uint16_t)(x)) << PWM_MCTRL_CLDOK_SHIFT)) & PWM_MCTRL_CLDOK_MASK) - -#define PWM_MCTRL_RUN_MASK (0x700U) -#define PWM_MCTRL_RUN_SHIFT (8U) -/*! RUN - Run - * 0b000..PWM counter is stopped, but PWM outputs hold the current state. - * 0b001..PWM counter is started in the corresponding submodule. - */ -#define PWM_MCTRL_RUN(x) (((uint16_t)(((uint16_t)(x)) << PWM_MCTRL_RUN_SHIFT)) & PWM_MCTRL_RUN_MASK) - -#define PWM_MCTRL_IPOL_MASK (0x7000U) -#define PWM_MCTRL_IPOL_SHIFT (12U) -/*! IPOL - Current Polarity - * 0b000..PWM23 is used to generate complementary PWM pair in the corresponding submodule. - * 0b001..PWM45 is used to generate complementary PWM pair in the corresponding submodule. - */ -#define PWM_MCTRL_IPOL(x) (((uint16_t)(((uint16_t)(x)) << PWM_MCTRL_IPOL_SHIFT)) & PWM_MCTRL_IPOL_MASK) -/*! @} */ - -/*! @name MCTRL2 - Master Control 2 Register */ -/*! @{ */ - -#define PWM_MCTRL2_WRPROT_MASK (0xCU) -#define PWM_MCTRL2_WRPROT_SHIFT (2U) -/*! WRPROT - Write protect - * 0b00..Write protection off (default). - * 0b01..Write protection on. - * 0b10..Write protection off and locked until chip reset. - * 0b11..Write protection on and locked until chip reset. - */ -#define PWM_MCTRL2_WRPROT(x) (((uint16_t)(((uint16_t)(x)) << PWM_MCTRL2_WRPROT_SHIFT)) & PWM_MCTRL2_WRPROT_MASK) - -#define PWM_MCTRL2_STRETCH_CNT_PRSC_MASK (0xC0U) -#define PWM_MCTRL2_STRETCH_CNT_PRSC_SHIFT (6U) -/*! STRETCH_CNT_PRSC - Stretch IPBus clock count prescaler for mux0_trig/mux1_trig/out0_trig/out1_trig/pwma_trig/pwmb_trig - * 0b00..Stretch count is zero, no stretch. - * 0b01..Stretch mux0_trig/mux1_trig/out0_trig/out1_trig/pwma_trig/pwmb_trig for 2 IPBus clock period. - * 0b10..Stretch mux0_trig/mux1_trig/out0_trig/out1_trig/pwma_trig/pwmb_trig for 4 IPBus clock period. - * 0b11..Stretch mux0_trig/mux1_trig/out0_trig/out1_trig/pwma_trig/pwmb_trig for 8 IPBus clock period. - */ -#define PWM_MCTRL2_STRETCH_CNT_PRSC(x) (((uint16_t)(((uint16_t)(x)) << PWM_MCTRL2_STRETCH_CNT_PRSC_SHIFT)) & PWM_MCTRL2_STRETCH_CNT_PRSC_MASK) -/*! @} */ - -/*! @name FCTRL - Fault Control Register */ -/*! @{ */ - -#define PWM_FCTRL_FIE_MASK (0xFU) -#define PWM_FCTRL_FIE_SHIFT (0U) -/*! FIE - Fault Interrupt Enables - * 0b0000..FAULTx CPU interrupt requests disabled. - * 0b0001..FAULTx CPU interrupt requests enabled. - */ -#define PWM_FCTRL_FIE(x) (((uint16_t)(((uint16_t)(x)) << PWM_FCTRL_FIE_SHIFT)) & PWM_FCTRL_FIE_MASK) - -#define PWM_FCTRL_FSAFE_MASK (0xF0U) -#define PWM_FCTRL_FSAFE_SHIFT (4U) -/*! FSAFE - Fault Safety Mode - * 0b0000..Normal mode. PWM outputs disabled by this fault are not enabled until FSTS[FFLAGx] is clear at the - * start of a half cycle or full cycle depending on the states of FSTS[FHALF] and FSTS[FFULL] without regard - * to the state of FSTS[FFPINx]. If neither FHALF nor FFULL is set, then the fault condition cannot be - * cleared. The PWM outputs disabled by this fault input will not be re-enabled until the actual FAULTx input - * signal de-asserts since the fault input will combinationally disable the PWM outputs (as programmed in - * DISMAPn). - * 0b0001..Safe mode. PWM outputs disabled by this fault are not enabled until FSTS[FFLAGx] is clear and - * FSTS[FFPINx] is clear at the start of a half cycle or full cycle depending on the states of FSTS[FHALF] and - * FSTS[FFULL]. If neither FHLAF nor FFULL is set, then the fault condition cannot be cleared. - */ -#define PWM_FCTRL_FSAFE(x) (((uint16_t)(((uint16_t)(x)) << PWM_FCTRL_FSAFE_SHIFT)) & PWM_FCTRL_FSAFE_MASK) - -#define PWM_FCTRL_FAUTO_MASK (0xF00U) -#define PWM_FCTRL_FAUTO_SHIFT (8U) -/*! FAUTO - Automatic Fault Clearing - * 0b0000..Manual fault clearing. PWM outputs disabled by this fault are not enabled until FSTS[FFLAGx] is clear - * at the start of a half cycle or full cycle depending on the states of FSTS[FHALF] and FSTS[FFULL]. If - * neither FFULL nor FHALF is set, then the fault condition cannot be cleared. This is further controlled - * by FCTRL[FSAFE]. - * 0b0001..Automatic fault clearing. PWM outputs disabled by this fault are enabled when FSTS[FFPINx] is clear at - * the start of a half cycle or full cycle depending on the states of FSTS[FHALF] and FSTS[FFULL] without - * regard to the state of FSTS[FFLAGx]. If neither FFULL nor FHALF is set, then the fault condition - * cannot be cleared. - */ -#define PWM_FCTRL_FAUTO(x) (((uint16_t)(((uint16_t)(x)) << PWM_FCTRL_FAUTO_SHIFT)) & PWM_FCTRL_FAUTO_MASK) - -#define PWM_FCTRL_FLVL_MASK (0xF000U) -#define PWM_FCTRL_FLVL_SHIFT (12U) -/*! FLVL - Fault Level - * 0b0000..A logic 0 on the fault input indicates a fault condition. - * 0b0001..A logic 1 on the fault input indicates a fault condition. - */ -#define PWM_FCTRL_FLVL(x) (((uint16_t)(((uint16_t)(x)) << PWM_FCTRL_FLVL_SHIFT)) & PWM_FCTRL_FLVL_MASK) -/*! @} */ - -/*! @name FSTS - Fault Status Register */ -/*! @{ */ - -#define PWM_FSTS_FFLAG_MASK (0xFU) -#define PWM_FSTS_FFLAG_SHIFT (0U) -/*! FFLAG - Fault Flags - * 0b0000..No fault on the FAULTx pin. - * 0b0001..Fault on the FAULTx pin. - */ -#define PWM_FSTS_FFLAG(x) (((uint16_t)(((uint16_t)(x)) << PWM_FSTS_FFLAG_SHIFT)) & PWM_FSTS_FFLAG_MASK) - -#define PWM_FSTS_FFULL_MASK (0xF0U) -#define PWM_FSTS_FFULL_SHIFT (4U) -/*! FFULL - Full Cycle - * 0b0000..PWM outputs are not re-enabled at the start of a full cycle - * 0b0001..PWM outputs are re-enabled at the start of a full cycle - */ -#define PWM_FSTS_FFULL(x) (((uint16_t)(((uint16_t)(x)) << PWM_FSTS_FFULL_SHIFT)) & PWM_FSTS_FFULL_MASK) - -#define PWM_FSTS_FFPIN_MASK (0xF00U) -#define PWM_FSTS_FFPIN_SHIFT (8U) -/*! FFPIN - Filtered Fault Pins */ -#define PWM_FSTS_FFPIN(x) (((uint16_t)(((uint16_t)(x)) << PWM_FSTS_FFPIN_SHIFT)) & PWM_FSTS_FFPIN_MASK) - -#define PWM_FSTS_FHALF_MASK (0xF000U) -#define PWM_FSTS_FHALF_SHIFT (12U) -/*! FHALF - Half Cycle Fault Recovery - * 0b0000..PWM outputs are not re-enabled at the start of a half cycle. - * 0b0001..PWM outputs are re-enabled at the start of a half cycle (as defined by VAL0). - */ -#define PWM_FSTS_FHALF(x) (((uint16_t)(((uint16_t)(x)) << PWM_FSTS_FHALF_SHIFT)) & PWM_FSTS_FHALF_MASK) -/*! @} */ - -/*! @name FFILT - Fault Filter Register */ -/*! @{ */ - -#define PWM_FFILT_FILT_PER_MASK (0xFFU) -#define PWM_FFILT_FILT_PER_SHIFT (0U) -/*! FILT_PER - Fault Filter Period */ -#define PWM_FFILT_FILT_PER(x) (((uint16_t)(((uint16_t)(x)) << PWM_FFILT_FILT_PER_SHIFT)) & PWM_FFILT_FILT_PER_MASK) - -#define PWM_FFILT_FILT_CNT_MASK (0x700U) -#define PWM_FFILT_FILT_CNT_SHIFT (8U) -/*! FILT_CNT - Fault Filter Count */ -#define PWM_FFILT_FILT_CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_FFILT_FILT_CNT_SHIFT)) & PWM_FFILT_FILT_CNT_MASK) - -#define PWM_FFILT_GSTR_MASK (0x8000U) -#define PWM_FFILT_GSTR_SHIFT (15U) -/*! GSTR - Fault Glitch Stretch Enable - * 0b0..Fault input glitch stretching is disabled. - * 0b1..Input fault signals are stretched to at least 2 IPBus clock cycles. - */ -#define PWM_FFILT_GSTR(x) (((uint16_t)(((uint16_t)(x)) << PWM_FFILT_GSTR_SHIFT)) & PWM_FFILT_GSTR_MASK) -/*! @} */ - -/*! @name FTST - Fault Test Register */ -/*! @{ */ - -#define PWM_FTST_FTEST_MASK (0x1U) -#define PWM_FTST_FTEST_SHIFT (0U) -/*! FTEST - Fault Test - * 0b0..No fault - * 0b1..Cause a simulated fault - */ -#define PWM_FTST_FTEST(x) (((uint16_t)(((uint16_t)(x)) << PWM_FTST_FTEST_SHIFT)) & PWM_FTST_FTEST_MASK) -/*! @} */ - -/*! @name FCTRL2 - Fault Control 2 Register */ -/*! @{ */ - -#define PWM_FCTRL2_NOCOMB_MASK (0xFU) -#define PWM_FCTRL2_NOCOMB_SHIFT (0U) -/*! NOCOMB - No Combinational Path From Fault Input To PWM Output - * 0b0000..There is a combinational link from the fault inputs to the PWM outputs. The fault inputs are combined - * with the filtered and latched fault signals to disable the PWM outputs. - * 0b0001..The direct combinational path from the fault inputs to the PWM outputs is disabled and the filtered - * and latched fault signals are used to disable the PWM outputs. - */ -#define PWM_FCTRL2_NOCOMB(x) (((uint16_t)(((uint16_t)(x)) << PWM_FCTRL2_NOCOMB_SHIFT)) & PWM_FCTRL2_NOCOMB_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group PWM_Register_Masks */ - - -/* PWM - Peripheral instance base addresses */ -/** Peripheral FLEXPWM0 base address */ -#define FLEXPWM0_BASE (0x400A9000u) -/** Peripheral FLEXPWM0 base pointer */ -#define FLEXPWM0 ((PWM_Type *)FLEXPWM0_BASE) -/** Array initializer of PWM peripheral base addresses */ -#define PWM_BASE_ADDRS { FLEXPWM0_BASE } -/** Array initializer of PWM peripheral base pointers */ -#define PWM_BASE_PTRS { FLEXPWM0 } -/** Interrupt vectors for the PWM peripheral type */ -#define PWM_CMP_IRQS { { FLEXPWM0_SUBMODULE0_IRQn, FLEXPWM0_SUBMODULE1_IRQn, FLEXPWM0_SUBMODULE2_IRQn } } -#define PWM_RELOAD_IRQS { { FLEXPWM0_SUBMODULE0_IRQn, FLEXPWM0_SUBMODULE1_IRQn, FLEXPWM0_SUBMODULE2_IRQn } } -#define PWM_CAPTURE_IRQS { { FLEXPWM0_SUBMODULE0_IRQn, FLEXPWM0_SUBMODULE1_IRQn, FLEXPWM0_SUBMODULE2_IRQn } } -#define PWM_FAULT_IRQS { FLEXPWM0_FAULT_IRQn } -#define PWM_RELOAD_ERROR_IRQS { FLEXPWM0_RELOAD_ERROR_IRQn } - -/*! - * @} - */ /* end of group PWM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- SCG Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SCG_Peripheral_Access_Layer SCG Peripheral Access Layer - * @{ - */ - -/** SCG - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID Register, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter Register, offset: 0x4 */ - __IO uint32_t TRIM_LOCK; /**< Trim Lock register, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __I uint32_t CSR; /**< Clock Status Register, offset: 0x10 */ - __IO uint32_t RCCR; /**< Run Clock Control Register, offset: 0x14 */ - uint8_t RESERVED_1[232]; - __IO uint32_t SOSCCSR; /**< SOSC Control Status Register, offset: 0x100 */ - uint8_t RESERVED_2[4]; - __IO uint32_t SOSCCFG; /**< SOSC Configuration Register, offset: 0x108 */ - uint8_t RESERVED_3[244]; - __IO uint32_t SIRCCSR; /**< SIRC Control Status Register, offset: 0x200 */ - uint8_t RESERVED_4[8]; - __IO uint32_t SIRCTCFG; /**< SIRC Trim Configuration Register, offset: 0x20C */ - uint8_t RESERVED_5[8]; - __IO uint32_t SIRCSTAT; /**< SIRC Auto-trimming Status Register, offset: 0x218 */ - uint8_t RESERVED_6[228]; - __IO uint32_t FIRCCSR; /**< FIRC Control Status Register, offset: 0x300 */ - uint8_t RESERVED_7[4]; - __IO uint32_t FIRCCFG; /**< FIRC Configuration Register, offset: 0x308 */ - __IO uint32_t FIRCTCFG; /**< FIRC Trim Configuration Register, offset: 0x30C */ - __IO uint32_t FIRCTRIM; /**< FIRC Trim Register, offset: 0x310 */ - uint8_t RESERVED_8[4]; - __IO uint32_t FIRCSTAT; /**< FIRC Auto-trimming Status Register, offset: 0x318 */ - uint8_t RESERVED_9[228]; - __IO uint32_t ROSCCSR; /**< ROSC Control Status Register, offset: 0x400 */ -} SCG_Type; - -/* ---------------------------------------------------------------------------- - -- SCG Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SCG_Register_Masks SCG Register Masks - * @{ - */ - -/*! @name VERID - Version ID Register */ -/*! @{ */ - -#define SCG_VERID_VERSION_MASK (0xFFFFFFFFU) -#define SCG_VERID_VERSION_SHIFT (0U) -/*! VERSION - SCG Version Number */ -#define SCG_VERID_VERSION(x) (((uint32_t)(((uint32_t)(x)) << SCG_VERID_VERSION_SHIFT)) & SCG_VERID_VERSION_MASK) -/*! @} */ - -/*! @name PARAM - Parameter Register */ -/*! @{ */ - -#define SCG_PARAM_SOSCCLKPRES_MASK (0x2U) -#define SCG_PARAM_SOSCCLKPRES_SHIFT (1U) -/*! SOSCCLKPRES - SOSC Clock Present - * 0b1..SOSC clock source is present - * 0b0..SOSC clock source is not present - */ -#define SCG_PARAM_SOSCCLKPRES(x) (((uint32_t)(((uint32_t)(x)) << SCG_PARAM_SOSCCLKPRES_SHIFT)) & SCG_PARAM_SOSCCLKPRES_MASK) - -#define SCG_PARAM_SIRCCLKPRES_MASK (0x4U) -#define SCG_PARAM_SIRCCLKPRES_SHIFT (2U) -/*! SIRCCLKPRES - SIRC Clock Present - * 0b1..SIRC clock source is present - * 0b0..SIRC clock source is not present - */ -#define SCG_PARAM_SIRCCLKPRES(x) (((uint32_t)(((uint32_t)(x)) << SCG_PARAM_SIRCCLKPRES_SHIFT)) & SCG_PARAM_SIRCCLKPRES_MASK) - -#define SCG_PARAM_FIRCCLKPRES_MASK (0x8U) -#define SCG_PARAM_FIRCCLKPRES_SHIFT (3U) -/*! FIRCCLKPRES - FIRC Clock Present - * 0b1..FIRC clock source is present - * 0b0..FIRC clock source is not present - */ -#define SCG_PARAM_FIRCCLKPRES(x) (((uint32_t)(((uint32_t)(x)) << SCG_PARAM_FIRCCLKPRES_SHIFT)) & SCG_PARAM_FIRCCLKPRES_MASK) - -#define SCG_PARAM_ROSCCLKPRES_MASK (0x10U) -#define SCG_PARAM_ROSCCLKPRES_SHIFT (4U) -/*! ROSCCLKPRES - ROSC Clock Present - * 0b1..ROSC clock source is present - * 0b0..ROSC clock source is not present - */ -#define SCG_PARAM_ROSCCLKPRES(x) (((uint32_t)(((uint32_t)(x)) << SCG_PARAM_ROSCCLKPRES_SHIFT)) & SCG_PARAM_ROSCCLKPRES_MASK) -/*! @} */ - -/*! @name TRIM_LOCK - Trim Lock register */ -/*! @{ */ - -#define SCG_TRIM_LOCK_TRIM_UNLOCK_MASK (0x1U) -#define SCG_TRIM_LOCK_TRIM_UNLOCK_SHIFT (0U) -/*! TRIM_UNLOCK - TRIM_UNLOCK - * 0b0..SCG Trim Registers locked and not writable. - * 0b1..SCG Trim registers unlocked and writable. - */ -#define SCG_TRIM_LOCK_TRIM_UNLOCK(x) (((uint32_t)(((uint32_t)(x)) << SCG_TRIM_LOCK_TRIM_UNLOCK_SHIFT)) & SCG_TRIM_LOCK_TRIM_UNLOCK_MASK) - -#define SCG_TRIM_LOCK_IFR_DISABLE_MASK (0x2U) -#define SCG_TRIM_LOCK_IFR_DISABLE_SHIFT (1U) -/*! IFR_DISABLE - IFR_DISABLE - * 0b0..IFR write access to SCG trim registers not disabled. The SCG Trim registers are reprogrammed with the IFR values after any system reset. - * 0b1..IFR write access to SCG trim registers during system reset is blocked. - */ -#define SCG_TRIM_LOCK_IFR_DISABLE(x) (((uint32_t)(((uint32_t)(x)) << SCG_TRIM_LOCK_IFR_DISABLE_SHIFT)) & SCG_TRIM_LOCK_IFR_DISABLE_MASK) - -#define SCG_TRIM_LOCK_TRIM_LOCK_KEY_MASK (0xFFFF0000U) -#define SCG_TRIM_LOCK_TRIM_LOCK_KEY_SHIFT (16U) -/*! TRIM_LOCK_KEY - TRIM_LOCK_KEY */ -#define SCG_TRIM_LOCK_TRIM_LOCK_KEY(x) (((uint32_t)(((uint32_t)(x)) << SCG_TRIM_LOCK_TRIM_LOCK_KEY_SHIFT)) & SCG_TRIM_LOCK_TRIM_LOCK_KEY_MASK) -/*! @} */ - -/*! @name CSR - Clock Status Register */ -/*! @{ */ - -#define SCG_CSR_SCS_MASK (0x7000000U) -#define SCG_CSR_SCS_SHIFT (24U) -/*! SCS - System Clock Source - * 0b000..Reserved - * 0b001..SOSC - * 0b010..SIRC - * 0b011..FIRC - * 0b100..ROSC - * 0b101-0b111..Reserved - */ -#define SCG_CSR_SCS(x) (((uint32_t)(((uint32_t)(x)) << SCG_CSR_SCS_SHIFT)) & SCG_CSR_SCS_MASK) -/*! @} */ - -/*! @name RCCR - Run Clock Control Register */ -/*! @{ */ - -#define SCG_RCCR_SCS_MASK (0x7000000U) -#define SCG_RCCR_SCS_SHIFT (24U) -/*! SCS - System Clock Source - * 0b000..Reserved - * 0b001..SOSC - * 0b010..SIRC - * 0b011..FIRC - * 0b100..ROSC - * 0b101-0b111..Reserved - */ -#define SCG_RCCR_SCS(x) (((uint32_t)(((uint32_t)(x)) << SCG_RCCR_SCS_SHIFT)) & SCG_RCCR_SCS_MASK) -/*! @} */ - -/*! @name SOSCCSR - SOSC Control Status Register */ -/*! @{ */ - -#define SCG_SOSCCSR_SOSCEN_MASK (0x1U) -#define SCG_SOSCCSR_SOSCEN_SHIFT (0U) -/*! SOSCEN - SOSC Enable - * 0b0..SOSC is disabled - * 0b1..SOSC is enabled - */ -#define SCG_SOSCCSR_SOSCEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCEN_SHIFT)) & SCG_SOSCCSR_SOSCEN_MASK) - -#define SCG_SOSCCSR_SOSCSTEN_MASK (0x2U) -#define SCG_SOSCCSR_SOSCSTEN_SHIFT (1U) -/*! SOSCSTEN - SOSC Stop Enable - * 0b0..SOSC is disabled in Deep Sleep mode - * 0b1..SOSC is enabled in Deep Sleep mode only if SOSCEN is set - */ -#define SCG_SOSCCSR_SOSCSTEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCSTEN_SHIFT)) & SCG_SOSCCSR_SOSCSTEN_MASK) - -#define SCG_SOSCCSR_SOSCCM_MASK (0x10000U) -#define SCG_SOSCCSR_SOSCCM_SHIFT (16U) -/*! SOSCCM - SOSC Clock Monitor Enable - * 0b0..SOSC Clock Monitor is disabled - * 0b1..SOSC Clock Monitor is enabled - */ -#define SCG_SOSCCSR_SOSCCM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCCM_SHIFT)) & SCG_SOSCCSR_SOSCCM_MASK) - -#define SCG_SOSCCSR_SOSCCMRE_MASK (0x20000U) -#define SCG_SOSCCSR_SOSCCMRE_SHIFT (17U) -/*! SOSCCMRE - SOSC Clock Monitor Reset Enable - * 0b0..Clock monitor generates an interrupt when an error is detected - * 0b1..Clock monitor generates a reset when an error is detected - */ -#define SCG_SOSCCSR_SOSCCMRE(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCCMRE_SHIFT)) & SCG_SOSCCSR_SOSCCMRE_MASK) - -#define SCG_SOSCCSR_LK_MASK (0x800000U) -#define SCG_SOSCCSR_LK_SHIFT (23U) -/*! LK - Lock Register - * 0b0..This Control Status Register can be written - * 0b1..This Control Status Register cannot be written - */ -#define SCG_SOSCCSR_LK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_LK_SHIFT)) & SCG_SOSCCSR_LK_MASK) - -#define SCG_SOSCCSR_SOSCVLD_MASK (0x1000000U) -#define SCG_SOSCCSR_SOSCVLD_SHIFT (24U) -/*! SOSCVLD - SOSC Valid - * 0b0..SOSC is not enabled or clock is not valid - * 0b1..SOSC is enabled and output clock is valid - */ -#define SCG_SOSCCSR_SOSCVLD(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCVLD_SHIFT)) & SCG_SOSCCSR_SOSCVLD_MASK) - -#define SCG_SOSCCSR_SOSCSEL_MASK (0x2000000U) -#define SCG_SOSCCSR_SOSCSEL_SHIFT (25U) -/*! SOSCSEL - SOSC Selected - * 0b0..SOSC is not the system clock source - * 0b1..SOSC is the system clock source - */ -#define SCG_SOSCCSR_SOSCSEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCSEL_SHIFT)) & SCG_SOSCCSR_SOSCSEL_MASK) - -#define SCG_SOSCCSR_SOSCERR_MASK (0x4000000U) -#define SCG_SOSCCSR_SOSCERR_SHIFT (26U) -/*! SOSCERR - SOSC Clock Error - * 0b0..SOSC Clock Monitor is disabled or has not detected an error - * 0b1..SOSC Clock Monitor is enabled and detected an error - */ -#define SCG_SOSCCSR_SOSCERR(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCERR_SHIFT)) & SCG_SOSCCSR_SOSCERR_MASK) - -#define SCG_SOSCCSR_SOSCVLD_IE_MASK (0x40000000U) -#define SCG_SOSCCSR_SOSCVLD_IE_SHIFT (30U) -/*! SOSCVLD_IE - SOSC Valid Interrupt Enable - * 0b0..SOSCVLD interrupt is not enabled - * 0b1..SOSCVLD interrupt is enabled - */ -#define SCG_SOSCCSR_SOSCVLD_IE(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCVLD_IE_SHIFT)) & SCG_SOSCCSR_SOSCVLD_IE_MASK) -/*! @} */ - -/*! @name SOSCCFG - SOSC Configuration Register */ -/*! @{ */ - -#define SCG_SOSCCFG_EREFS_MASK (0x4U) -#define SCG_SOSCCFG_EREFS_SHIFT (2U) -/*! EREFS - External Reference Select - * 0b0..External reference clock selected. - * 0b1..Internal crystal oscillator of OSC selected. - */ -#define SCG_SOSCCFG_EREFS(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCFG_EREFS_SHIFT)) & SCG_SOSCCFG_EREFS_MASK) - -#define SCG_SOSCCFG_RANGE_MASK (0x30U) -#define SCG_SOSCCFG_RANGE_SHIFT (4U) -/*! RANGE - SOSC Range Select - * 0b00..Frequency range select of 8-16 MHz. - * 0b01..Frequency range select of 16-25 MHz. - * 0b10..Frequency range select of 25-40 MHz. - * 0b11..Frequency range select of 40-50 MHz. - */ -#define SCG_SOSCCFG_RANGE(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCFG_RANGE_SHIFT)) & SCG_SOSCCFG_RANGE_MASK) -/*! @} */ - -/*! @name SIRCCSR - SIRC Control Status Register */ -/*! @{ */ - -#define SCG_SIRCCSR_SIRCSTEN_MASK (0x2U) -#define SCG_SIRCCSR_SIRCSTEN_SHIFT (1U) -/*! SIRCSTEN - SIRC Stop Enable - * 0b0..SIRC is disabled in Deep Sleep mode - * 0b1..SIRC is enabled in Deep Sleep mode - */ -#define SCG_SIRCCSR_SIRCSTEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCSTEN_SHIFT)) & SCG_SIRCCSR_SIRCSTEN_MASK) - -#define SCG_SIRCCSR_SIRC_CLK_PERIPH_EN_MASK (0x20U) -#define SCG_SIRCCSR_SIRC_CLK_PERIPH_EN_SHIFT (5U) -/*! SIRC_CLK_PERIPH_EN - SIRC Clock to Peripherals Enable - * 0b0..SIRC clock to peripherals is disabled - * 0b1..SIRC clock to peripherals is enabled - */ -#define SCG_SIRCCSR_SIRC_CLK_PERIPH_EN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRC_CLK_PERIPH_EN_SHIFT)) & SCG_SIRCCSR_SIRC_CLK_PERIPH_EN_MASK) - -#define SCG_SIRCCSR_SIRCTREN_MASK (0x100U) -#define SCG_SIRCCSR_SIRCTREN_SHIFT (8U) -/*! SIRCTREN - SIRC 12 MHz Trim Enable (SIRCCFG[RANGE]=1) - * 0b0..Disables trimming SIRC to an external clock source - * 0b1..Enables trimming SIRC to an external clock source - */ -#define SCG_SIRCCSR_SIRCTREN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCTREN_SHIFT)) & SCG_SIRCCSR_SIRCTREN_MASK) - -#define SCG_SIRCCSR_SIRCTRUP_MASK (0x200U) -#define SCG_SIRCCSR_SIRCTRUP_SHIFT (9U) -/*! SIRCTRUP - SIRC Trim Update - * 0b0..Disables SIRC trimming updates - * 0b1..Enables SIRC trimming updates - */ -#define SCG_SIRCCSR_SIRCTRUP(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCTRUP_SHIFT)) & SCG_SIRCCSR_SIRCTRUP_MASK) - -#define SCG_SIRCCSR_TRIM_LOCK_MASK (0x400U) -#define SCG_SIRCCSR_TRIM_LOCK_SHIFT (10U) -/*! TRIM_LOCK - SIRC TRIM LOCK - * 0b0..SIRC auto trim not locked to target frequency range - * 0b1..SIRC auto trim locked to target frequency range - */ -#define SCG_SIRCCSR_TRIM_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_TRIM_LOCK_SHIFT)) & SCG_SIRCCSR_TRIM_LOCK_MASK) - -#define SCG_SIRCCSR_COARSE_TRIM_BYPASS_MASK (0x800U) -#define SCG_SIRCCSR_COARSE_TRIM_BYPASS_SHIFT (11U) -/*! COARSE_TRIM_BYPASS - Coarse Auto Trim Bypass - * 0b0..SIRC Coarse Auto Trim NOT Bypassed - * 0b1..SIRC Coarse Auto Trim Bypassed - */ -#define SCG_SIRCCSR_COARSE_TRIM_BYPASS(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_COARSE_TRIM_BYPASS_SHIFT)) & SCG_SIRCCSR_COARSE_TRIM_BYPASS_MASK) - -#define SCG_SIRCCSR_LK_MASK (0x800000U) -#define SCG_SIRCCSR_LK_SHIFT (23U) -/*! LK - Lock Register - * 0b0..Control Status Register can be written - * 0b1..Control Status Register cannot be written - */ -#define SCG_SIRCCSR_LK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_LK_SHIFT)) & SCG_SIRCCSR_LK_MASK) - -#define SCG_SIRCCSR_SIRCVLD_MASK (0x1000000U) -#define SCG_SIRCCSR_SIRCVLD_SHIFT (24U) -/*! SIRCVLD - SIRC Valid - * 0b0..SIRC is not enabled or clock is not valid - * 0b1..SIRC is enabled and output clock is valid - */ -#define SCG_SIRCCSR_SIRCVLD(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCVLD_SHIFT)) & SCG_SIRCCSR_SIRCVLD_MASK) - -#define SCG_SIRCCSR_SIRCSEL_MASK (0x2000000U) -#define SCG_SIRCCSR_SIRCSEL_SHIFT (25U) -/*! SIRCSEL - SIRC Selected - * 0b0..SIRC is not the system clock source - * 0b1..SIRC is the system clock source - */ -#define SCG_SIRCCSR_SIRCSEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCSEL_SHIFT)) & SCG_SIRCCSR_SIRCSEL_MASK) - -#define SCG_SIRCCSR_SIRCERR_MASK (0x4000000U) -#define SCG_SIRCCSR_SIRCERR_SHIFT (26U) -/*! SIRCERR - SIRC Clock Error - * 0b0..Error not detected with the SIRC trimming - * 0b1..Error detected with the SIRC trimming - */ -#define SCG_SIRCCSR_SIRCERR(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCERR_SHIFT)) & SCG_SIRCCSR_SIRCERR_MASK) - -#define SCG_SIRCCSR_SIRCERR_IE_MASK (0x8000000U) -#define SCG_SIRCCSR_SIRCERR_IE_SHIFT (27U) -/*! SIRCERR_IE - SIRC Clock Error Interrupt Enable - * 0b0..SIRCERR interrupt is not enabled - * 0b1..SIRCERR interrupt is enabled - */ -#define SCG_SIRCCSR_SIRCERR_IE(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCERR_IE_SHIFT)) & SCG_SIRCCSR_SIRCERR_IE_MASK) -/*! @} */ - -/*! @name SIRCTCFG - SIRC Trim Configuration Register */ -/*! @{ */ - -#define SCG_SIRCTCFG_TRIMSRC_MASK (0x3U) -#define SCG_SIRCTCFG_TRIMSRC_SHIFT (0U) -/*! TRIMSRC - Trim Source - * 0b00..Reserved - * 0b01..Reserved - * 0b10..SOSC. This option requires that SOSC be divided using the TRIMDIV field to get a frequency of 1 MHz. - * 0b11..Reserved - */ -#define SCG_SIRCTCFG_TRIMSRC(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCTCFG_TRIMSRC_SHIFT)) & SCG_SIRCTCFG_TRIMSRC_MASK) - -#define SCG_SIRCTCFG_TRIMDIV_MASK (0x7F0000U) -#define SCG_SIRCTCFG_TRIMDIV_SHIFT (16U) -/*! TRIMDIV - SIRC Trim Pre-divider */ -#define SCG_SIRCTCFG_TRIMDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCTCFG_TRIMDIV_SHIFT)) & SCG_SIRCTCFG_TRIMDIV_MASK) -/*! @} */ - -/*! @name SIRCSTAT - SIRC Auto-trimming Status Register */ -/*! @{ */ - -#define SCG_SIRCSTAT_CCOTRIM_MASK (0x3FU) -#define SCG_SIRCSTAT_CCOTRIM_SHIFT (0U) -/*! CCOTRIM - CCO Trim */ -#define SCG_SIRCSTAT_CCOTRIM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCSTAT_CCOTRIM_SHIFT)) & SCG_SIRCSTAT_CCOTRIM_MASK) - -#define SCG_SIRCSTAT_CLTRIM_MASK (0x3F00U) -#define SCG_SIRCSTAT_CLTRIM_SHIFT (8U) -/*! CLTRIM - CL Trim */ -#define SCG_SIRCSTAT_CLTRIM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCSTAT_CLTRIM_SHIFT)) & SCG_SIRCSTAT_CLTRIM_MASK) -/*! @} */ - -/*! @name FIRCCSR - FIRC Control Status Register */ -/*! @{ */ - -#define SCG_FIRCCSR_FIRCEN_MASK (0x1U) -#define SCG_FIRCCSR_FIRCEN_SHIFT (0U) -/*! FIRCEN - FIRC Enable - * 0b0..FIRC is disabled - * 0b1..FIRC is enabled - */ -#define SCG_FIRCCSR_FIRCEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCEN_SHIFT)) & SCG_FIRCCSR_FIRCEN_MASK) - -#define SCG_FIRCCSR_FIRCSTEN_MASK (0x2U) -#define SCG_FIRCCSR_FIRCSTEN_SHIFT (1U) -/*! FIRCSTEN - FIRC Stop Enable - * 0b0..FIRC is disabled in Deep Sleep mode - * 0b1..FIRC is enabled in Deep Sleep mode - */ -#define SCG_FIRCCSR_FIRCSTEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCSTEN_SHIFT)) & SCG_FIRCCSR_FIRCSTEN_MASK) - -#define SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_MASK (0x10U) -#define SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_SHIFT (4U) -/*! FIRC_SCLK_PERIPH_EN - FIRC 48 MHz Clock to peripherals Enable - * 0b0..FIRC 48 MHz to peripherals is disabled - * 0b1..FIRC 48 MHz to peripherals is enabled - */ -#define SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_SHIFT)) & SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_MASK) - -#define SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN_MASK (0x20U) -#define SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN_SHIFT (5U) -/*! FIRC_FCLK_PERIPH_EN - FRO_HF Clock to peripherals Enable - * 0b0..FRO_HF to peripherals is disabled - * 0b1..FRO_HF to peripherals is enabled - */ -#define SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN_SHIFT)) & SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN_MASK) - -#define SCG_FIRCCSR_FIRCTREN_MASK (0x100U) -#define SCG_FIRCCSR_FIRCTREN_SHIFT (8U) -/*! FIRCTREN - FRO_HF Trim Enable - * 0b0..Disables trimming FRO_HF by an external clock source - * 0b1..Enables trimming FRO_HF by an external clock source - */ -#define SCG_FIRCCSR_FIRCTREN(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCTREN_SHIFT)) & SCG_FIRCCSR_FIRCTREN_MASK) - -#define SCG_FIRCCSR_FIRCTRUP_MASK (0x200U) -#define SCG_FIRCCSR_FIRCTRUP_SHIFT (9U) -/*! FIRCTRUP - FIRC Trim Update - * 0b0..Disables FIRC trimming updates - * 0b1..Enables FIRC trimming updates - */ -#define SCG_FIRCCSR_FIRCTRUP(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCTRUP_SHIFT)) & SCG_FIRCCSR_FIRCTRUP_MASK) - -#define SCG_FIRCCSR_TRIM_LOCK_MASK (0x400U) -#define SCG_FIRCCSR_TRIM_LOCK_SHIFT (10U) -/*! TRIM_LOCK - FIRC TRIM LOCK - * 0b0..FIRC auto trim not locked to target frequency range - * 0b1..FIRC auto trim locked to target frequency range - */ -#define SCG_FIRCCSR_TRIM_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_TRIM_LOCK_SHIFT)) & SCG_FIRCCSR_TRIM_LOCK_MASK) - -#define SCG_FIRCCSR_COARSE_TRIM_BYPASS_MASK (0x800U) -#define SCG_FIRCCSR_COARSE_TRIM_BYPASS_SHIFT (11U) -/*! COARSE_TRIM_BYPASS - Coarse Auto Trim Bypass - * 0b0..FIRC Coarse Auto Trim NOT Bypassed - * 0b1..FIRC Coarse Auto Trim Bypassed - */ -#define SCG_FIRCCSR_COARSE_TRIM_BYPASS(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_COARSE_TRIM_BYPASS_SHIFT)) & SCG_FIRCCSR_COARSE_TRIM_BYPASS_MASK) - -#define SCG_FIRCCSR_LK_MASK (0x800000U) -#define SCG_FIRCCSR_LK_SHIFT (23U) -/*! LK - Lock Register - * 0b0..Control Status Register can be written - * 0b1..Control Status Register cannot be written - */ -#define SCG_FIRCCSR_LK(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_LK_SHIFT)) & SCG_FIRCCSR_LK_MASK) - -#define SCG_FIRCCSR_FIRCVLD_MASK (0x1000000U) -#define SCG_FIRCCSR_FIRCVLD_SHIFT (24U) -/*! FIRCVLD - FIRC Valid status - * 0b0..FIRC is not enabled or clock is not valid. - * 0b1..FIRC is enabled and output clock is valid. The clock is valid after there is an output clock from the FIRC analog. - */ -#define SCG_FIRCCSR_FIRCVLD(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCVLD_SHIFT)) & SCG_FIRCCSR_FIRCVLD_MASK) - -#define SCG_FIRCCSR_FIRCSEL_MASK (0x2000000U) -#define SCG_FIRCCSR_FIRCSEL_SHIFT (25U) -/*! FIRCSEL - FIRC Selected - * 0b0..FIRC is not the system clock source - * 0b1..FIRC is the system clock source - */ -#define SCG_FIRCCSR_FIRCSEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCSEL_SHIFT)) & SCG_FIRCCSR_FIRCSEL_MASK) - -#define SCG_FIRCCSR_FIRCERR_MASK (0x4000000U) -#define SCG_FIRCCSR_FIRCERR_SHIFT (26U) -/*! FIRCERR - FIRC Clock Error - * 0b0..Error not detected with the FIRC trimming - * 0b1..Error detected with the FIRC trimming - */ -#define SCG_FIRCCSR_FIRCERR(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCERR_SHIFT)) & SCG_FIRCCSR_FIRCERR_MASK) - -#define SCG_FIRCCSR_FIRCERR_IE_MASK (0x8000000U) -#define SCG_FIRCCSR_FIRCERR_IE_SHIFT (27U) -/*! FIRCERR_IE - FIRC Clock Error Interrupt Enable - * 0b0..FIRCERR interrupt is not enabled - * 0b1..FIRCERR interrupt is enabled - */ -#define SCG_FIRCCSR_FIRCERR_IE(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCERR_IE_SHIFT)) & SCG_FIRCCSR_FIRCERR_IE_MASK) - -#define SCG_FIRCCSR_FIRCACC_IE_MASK (0x40000000U) -#define SCG_FIRCCSR_FIRCACC_IE_SHIFT (30U) -/*! FIRCACC_IE - FIRC Accurate Interrupt Enable - * 0b0..FIRCACC interrupt is not enabled - * 0b1..FIRCACC interrupt is enabled - */ -#define SCG_FIRCCSR_FIRCACC_IE(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCACC_IE_SHIFT)) & SCG_FIRCCSR_FIRCACC_IE_MASK) - -#define SCG_FIRCCSR_FIRCACC_MASK (0x80000000U) -#define SCG_FIRCCSR_FIRCACC_SHIFT (31U) -/*! FIRCACC - FIRC Frequency Accurate - * 0b0..FIRC is not enabled or clock is not accurate. - * 0b1..FIRC is enabled and output clock is accurate. The clock is accurate after 4096 clock cycles of FRO_HF - * clock(It also takes 4096 clock cycles when FIRCCFG_FREQ_SEL[0] changes) or 1365 clock cycles of 48 MHz from - * the FIRC analog. - */ -#define SCG_FIRCCSR_FIRCACC(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCACC_SHIFT)) & SCG_FIRCCSR_FIRCACC_MASK) -/*! @} */ - -/*! @name FIRCCFG - FIRC Configuration Register */ -/*! @{ */ - -#define SCG_FIRCCFG_FREQ_SEL_MASK (0xEU) -#define SCG_FIRCCFG_FREQ_SEL_SHIFT (1U) -/*! FREQ_SEL - Frequency select - * 0b111..192 MHz FIRC clock selected - * 0b110..144 MHz FIRC clock selected - * 0b101..96 MHz FIRC clock selected - * 0b100..72 MHz FIRC clock selected - * 0b011..64 MHz FIRC clock selected - * 0b010..48 MHz FIRC clock selected, divided from 144 MHz - * 0b001..48 MHz FIRC clock selected, divided from 192 MHz - * 0b000..36 MHz FIRC clock selected - */ -#define SCG_FIRCCFG_FREQ_SEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCFG_FREQ_SEL_SHIFT)) & SCG_FIRCCFG_FREQ_SEL_MASK) -/*! @} */ - -/*! @name FIRCTCFG - FIRC Trim Configuration Register */ -/*! @{ */ - -#define SCG_FIRCTCFG_TRIMSRC_MASK (0x3U) -#define SCG_FIRCTCFG_TRIMSRC_SHIFT (0U) -/*! TRIMSRC - Trim Source - * 0b00..USB0 Start of Frame (1 KHz). This option does not use TRIMDIV . - * 0b01..Reserved - * 0b10..SOSC. This option requires that SOSC be divided using the TRIMDIV field to get a frequency of 1 MHz. - * 0b11..Reserved - */ -#define SCG_FIRCTCFG_TRIMSRC(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTCFG_TRIMSRC_SHIFT)) & SCG_FIRCTCFG_TRIMSRC_MASK) - -#define SCG_FIRCTCFG_TRIMDIV_MASK (0x7F0000U) -#define SCG_FIRCTCFG_TRIMDIV_SHIFT (16U) -/*! TRIMDIV - FIRC Trim Pre-divider */ -#define SCG_FIRCTCFG_TRIMDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTCFG_TRIMDIV_SHIFT)) & SCG_FIRCTCFG_TRIMDIV_MASK) -/*! @} */ - -/*! @name FIRCTRIM - FIRC Trim Register */ -/*! @{ */ - -#define SCG_FIRCTRIM_TRIMFINE_MASK (0xFFU) -#define SCG_FIRCTRIM_TRIMFINE_SHIFT (0U) -/*! TRIMFINE - Trim Fine */ -#define SCG_FIRCTRIM_TRIMFINE(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTRIM_TRIMFINE_SHIFT)) & SCG_FIRCTRIM_TRIMFINE_MASK) - -#define SCG_FIRCTRIM_TRIMCOAR_MASK (0x3F00U) -#define SCG_FIRCTRIM_TRIMCOAR_SHIFT (8U) -/*! TRIMCOAR - Trim Coarse */ -#define SCG_FIRCTRIM_TRIMCOAR(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTRIM_TRIMCOAR_SHIFT)) & SCG_FIRCTRIM_TRIMCOAR_MASK) - -#define SCG_FIRCTRIM_TRIMTEMP1_MASK (0x30000U) -#define SCG_FIRCTRIM_TRIMTEMP1_SHIFT (16U) -/*! TRIMTEMP1 - Trim Temperature1 */ -#define SCG_FIRCTRIM_TRIMTEMP1(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTRIM_TRIMTEMP1_SHIFT)) & SCG_FIRCTRIM_TRIMTEMP1_MASK) - -#define SCG_FIRCTRIM_TRIMTEMP2_MASK (0xC0000U) -#define SCG_FIRCTRIM_TRIMTEMP2_SHIFT (18U) -/*! TRIMTEMP2 - Trim Temperature2 */ -#define SCG_FIRCTRIM_TRIMTEMP2(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTRIM_TRIMTEMP2_SHIFT)) & SCG_FIRCTRIM_TRIMTEMP2_MASK) - -#define SCG_FIRCTRIM_TRIMSTART_MASK (0x3F000000U) -#define SCG_FIRCTRIM_TRIMSTART_SHIFT (24U) -/*! TRIMSTART - Trim Start */ -#define SCG_FIRCTRIM_TRIMSTART(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTRIM_TRIMSTART_SHIFT)) & SCG_FIRCTRIM_TRIMSTART_MASK) -/*! @} */ - -/*! @name FIRCSTAT - FIRC Auto-trimming Status Register */ -/*! @{ */ - -#define SCG_FIRCSTAT_TRIMFINE_MASK (0xFFU) -#define SCG_FIRCSTAT_TRIMFINE_SHIFT (0U) -/*! TRIMFINE - Trim Fine */ -#define SCG_FIRCSTAT_TRIMFINE(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCSTAT_TRIMFINE_SHIFT)) & SCG_FIRCSTAT_TRIMFINE_MASK) - -#define SCG_FIRCSTAT_TRIMCOAR_MASK (0x3F00U) -#define SCG_FIRCSTAT_TRIMCOAR_SHIFT (8U) -/*! TRIMCOAR - Trim Coarse */ -#define SCG_FIRCSTAT_TRIMCOAR(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCSTAT_TRIMCOAR_SHIFT)) & SCG_FIRCSTAT_TRIMCOAR_MASK) -/*! @} */ - -/*! @name ROSCCSR - ROSC Control Status Register */ -/*! @{ */ - -#define SCG_ROSCCSR_LK_MASK (0x800000U) -#define SCG_ROSCCSR_LK_SHIFT (23U) -/*! LK - Lock Register - * 0b0..Control Status Register can be written - * 0b1..Control Status Register cannot be written - */ -#define SCG_ROSCCSR_LK(x) (((uint32_t)(((uint32_t)(x)) << SCG_ROSCCSR_LK_SHIFT)) & SCG_ROSCCSR_LK_MASK) - -#define SCG_ROSCCSR_ROSCVLD_MASK (0x1000000U) -#define SCG_ROSCCSR_ROSCVLD_SHIFT (24U) -/*! ROSCVLD - ROSC Valid - * 0b0..ROSC is not enabled or clock is not valid - * 0b1..ROSC is enabled and output clock is valid - */ -#define SCG_ROSCCSR_ROSCVLD(x) (((uint32_t)(((uint32_t)(x)) << SCG_ROSCCSR_ROSCVLD_SHIFT)) & SCG_ROSCCSR_ROSCVLD_MASK) - -#define SCG_ROSCCSR_ROSCSEL_MASK (0x2000000U) -#define SCG_ROSCCSR_ROSCSEL_SHIFT (25U) -/*! ROSCSEL - ROSC Selected - * 0b0..ROSC is not the system clock source - * 0b1..ROSC is the system clock source - */ -#define SCG_ROSCCSR_ROSCSEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_ROSCCSR_ROSCSEL_SHIFT)) & SCG_ROSCCSR_ROSCSEL_MASK) - -#define SCG_ROSCCSR_ROSCERR_MASK (0x4000000U) -#define SCG_ROSCCSR_ROSCERR_SHIFT (26U) -/*! ROSCERR - ROSC Clock Error - * 0b0..ROSC Clock has not detected an error - * 0b1..ROSC Clock has detected an error - */ -#define SCG_ROSCCSR_ROSCERR(x) (((uint32_t)(((uint32_t)(x)) << SCG_ROSCCSR_ROSCERR_SHIFT)) & SCG_ROSCCSR_ROSCERR_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group SCG_Register_Masks */ - - -/* SCG - Peripheral instance base addresses */ -/** Peripheral SCG0 base address */ -#define SCG0_BASE (0x4008F000u) -/** Peripheral SCG0 base pointer */ -#define SCG0 ((SCG_Type *)SCG0_BASE) -/** Array initializer of SCG peripheral base addresses */ -#define SCG_BASE_ADDRS { SCG0_BASE } -/** Array initializer of SCG peripheral base pointers */ -#define SCG_BASE_PTRS { SCG0 } - -/*! - * @} - */ /* end of group SCG_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- SPC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SPC_Peripheral_Access_Layer SPC Peripheral Access Layer - * @{ - */ - -/** SPC - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - uint8_t RESERVED_0[12]; - __IO uint32_t SC; /**< Status Control, offset: 0x10 */ - uint8_t RESERVED_1[8]; - __IO uint32_t LPREQ_CFG; /**< Low-Power Request Configuration, offset: 0x1C */ - __IO uint32_t CFG; /**< SPC Configuration, offset: 0x20 */ - uint8_t RESERVED_2[12]; - __IO uint32_t PD_STATUS[1]; /**< SPC Power Domain Mode Status, array offset: 0x30, array step: 0x4 */ - uint8_t RESERVED_3[12]; - __IO uint32_t SRAMCTL; /**< SRAM Control, offset: 0x40 */ - uint8_t RESERVED_4[16]; - __IO uint32_t SRAMRETLDO_REFTRIM; /**< SRAM Retention Reference Trim, offset: 0x54 */ - __IO uint32_t SRAMRETLDO_CNTRL; /**< SRAM Retention LDO Control, offset: 0x58 */ - uint8_t RESERVED_5[164]; - __IO uint32_t ACTIVE_CFG; /**< Active Power Mode Configuration, offset: 0x100 */ - __IO uint32_t ACTIVE_CFG1; /**< Active Power Mode Configuration 1, offset: 0x104 */ - __IO uint32_t LP_CFG; /**< Low-Power Mode Configuration, offset: 0x108 */ - __IO uint32_t LP_CFG1; /**< Low Power Mode Configuration 1, offset: 0x10C */ - uint8_t RESERVED_6[16]; - __IO uint32_t LPWKUP_DELAY; /**< Low Power Wake-Up Delay, offset: 0x120 */ - __IO uint32_t ACTIVE_VDELAY; /**< Active Voltage Trim Delay, offset: 0x124 */ - uint8_t RESERVED_7[8]; - __IO uint32_t VD_STAT; /**< Voltage Detect Status, offset: 0x130 */ - __IO uint32_t VD_CORE_CFG; /**< Core Voltage Detect Configuration, offset: 0x134 */ - __IO uint32_t VD_SYS_CFG; /**< System Voltage Detect Configuration, offset: 0x138 */ - uint8_t RESERVED_8[4]; - __IO uint32_t EVD_CFG; /**< External Voltage Domain Configuration, offset: 0x140 */ - uint8_t RESERVED_9[444]; - uint32_t CORELDO_CFG; /**< LDO_CORE Configuration, offset: 0x300 */ -} SPC_Type; - -/* ---------------------------------------------------------------------------- - -- SPC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SPC_Register_Masks SPC Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define SPC_VERID_FEATURE_MASK (0xFFFFU) -#define SPC_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Standard features - * *.. - */ -#define SPC_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VERID_FEATURE_SHIFT)) & SPC_VERID_FEATURE_MASK) - -#define SPC_VERID_MINOR_MASK (0xFF0000U) -#define SPC_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define SPC_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << SPC_VERID_MINOR_SHIFT)) & SPC_VERID_MINOR_MASK) - -#define SPC_VERID_MAJOR_MASK (0xFF000000U) -#define SPC_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define SPC_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << SPC_VERID_MAJOR_SHIFT)) & SPC_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name SC - Status Control */ -/*! @{ */ - -#define SPC_SC_BUSY_MASK (0x1U) -#define SPC_SC_BUSY_SHIFT (0U) -/*! BUSY - SPC Busy Status Flag - * 0b0..Not busy - * 0b1..Busy - */ -#define SPC_SC_BUSY(x) (((uint32_t)(((uint32_t)(x)) << SPC_SC_BUSY_SHIFT)) & SPC_SC_BUSY_MASK) - -#define SPC_SC_SPC_LP_REQ_MASK (0x2U) -#define SPC_SC_SPC_LP_REQ_SHIFT (1U) -/*! SPC_LP_REQ - SPC Power Mode Configuration Status Flag - * 0b0..SPC is in Active mode; the ACTIVE_CFG register has control - * 0b1..All power domains requested low-power mode; SPC entered a low-power state; power-mode configuration based on the LP_CFG register - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_SC_SPC_LP_REQ(x) (((uint32_t)(((uint32_t)(x)) << SPC_SC_SPC_LP_REQ_SHIFT)) & SPC_SC_SPC_LP_REQ_MASK) - -#define SPC_SC_SPC_LP_MODE_MASK (0xF0U) -#define SPC_SC_SPC_LP_MODE_SHIFT (4U) -/*! SPC_LP_MODE - Power Domain Low-Power Mode Request - * 0b0000..Sleep mode with system clock running - * 0b0001..DSLEEP with system clock off - * 0b0010..PDOWN with system clock off - * 0b0100.. - * 0b1000..DPDOWN with system clock off - */ -#define SPC_SC_SPC_LP_MODE(x) (((uint32_t)(((uint32_t)(x)) << SPC_SC_SPC_LP_MODE_SHIFT)) & SPC_SC_SPC_LP_MODE_MASK) - -#define SPC_SC_ISO_CLR_MASK (0x10000U) -#define SPC_SC_ISO_CLR_SHIFT (16U) -/*! ISO_CLR - Isolation Clear Flags */ -#define SPC_SC_ISO_CLR(x) (((uint32_t)(((uint32_t)(x)) << SPC_SC_ISO_CLR_SHIFT)) & SPC_SC_ISO_CLR_MASK) - -#define SPC_SC_SWITCH_STATE_MASK (0x80000000U) -#define SPC_SC_SWITCH_STATE_SHIFT (31U) -/*! SWITCH_STATE - Power Switch State - * 0b0..Off - * 0b1..On - */ -#define SPC_SC_SWITCH_STATE(x) (((uint32_t)(((uint32_t)(x)) << SPC_SC_SWITCH_STATE_SHIFT)) & SPC_SC_SWITCH_STATE_MASK) -/*! @} */ - -/*! @name LPREQ_CFG - Low-Power Request Configuration */ -/*! @{ */ - -#define SPC_LPREQ_CFG_LPREQOE_MASK (0x1U) -#define SPC_LPREQ_CFG_LPREQOE_SHIFT (0U) -/*! LPREQOE - Low-Power Request Output Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LPREQ_CFG_LPREQOE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LPREQ_CFG_LPREQOE_SHIFT)) & SPC_LPREQ_CFG_LPREQOE_MASK) - -#define SPC_LPREQ_CFG_LPREQPOL_MASK (0x2U) -#define SPC_LPREQ_CFG_LPREQPOL_SHIFT (1U) -/*! LPREQPOL - Low-Power Request Output Pin Polarity Control - * 0b0..High - * 0b1..Low - */ -#define SPC_LPREQ_CFG_LPREQPOL(x) (((uint32_t)(((uint32_t)(x)) << SPC_LPREQ_CFG_LPREQPOL_SHIFT)) & SPC_LPREQ_CFG_LPREQPOL_MASK) - -#define SPC_LPREQ_CFG_LPREQOV_MASK (0xCU) -#define SPC_LPREQ_CFG_LPREQOV_SHIFT (2U) -/*! LPREQOV - Low-Power Request Output Override - * 0b00..Not forced - * 0b01.. - * 0b10..Forced low (ignore LPREQPOL settings) - * 0b11..Forced high (ignore LPREQPOL settings) - */ -#define SPC_LPREQ_CFG_LPREQOV(x) (((uint32_t)(((uint32_t)(x)) << SPC_LPREQ_CFG_LPREQOV_SHIFT)) & SPC_LPREQ_CFG_LPREQOV_MASK) -/*! @} */ - -/*! @name CFG - SPC Configuration */ -/*! @{ */ - -#define SPC_CFG_INTG_PWSWTCH_SLEEP_EN_MASK (0x1U) -#define SPC_CFG_INTG_PWSWTCH_SLEEP_EN_SHIFT (0U) -/*! INTG_PWSWTCH_SLEEP_EN - Integrated Power Switch Sleep Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_CFG_INTG_PWSWTCH_SLEEP_EN(x) (((uint32_t)(((uint32_t)(x)) << SPC_CFG_INTG_PWSWTCH_SLEEP_EN_SHIFT)) & SPC_CFG_INTG_PWSWTCH_SLEEP_EN_MASK) - -#define SPC_CFG_INTG_PWSWTCH_WKUP_EN_MASK (0x2U) -#define SPC_CFG_INTG_PWSWTCH_WKUP_EN_SHIFT (1U) -/*! INTG_PWSWTCH_WKUP_EN - Integrated Power Switch Wake-up Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_CFG_INTG_PWSWTCH_WKUP_EN(x) (((uint32_t)(((uint32_t)(x)) << SPC_CFG_INTG_PWSWTCH_WKUP_EN_SHIFT)) & SPC_CFG_INTG_PWSWTCH_WKUP_EN_MASK) - -#define SPC_CFG_INTG_PWSWTCH_SLEEP_ACTIVE_EN_MASK (0x4U) -#define SPC_CFG_INTG_PWSWTCH_SLEEP_ACTIVE_EN_SHIFT (2U) -/*! INTG_PWSWTCH_SLEEP_ACTIVE_EN - Integrated Power Switch Active Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_CFG_INTG_PWSWTCH_SLEEP_ACTIVE_EN(x) (((uint32_t)(((uint32_t)(x)) << SPC_CFG_INTG_PWSWTCH_SLEEP_ACTIVE_EN_SHIFT)) & SPC_CFG_INTG_PWSWTCH_SLEEP_ACTIVE_EN_MASK) - -#define SPC_CFG_INTG_PWSWTCH_WKUP_ACTIVE_EN_MASK (0x8U) -#define SPC_CFG_INTG_PWSWTCH_WKUP_ACTIVE_EN_SHIFT (3U) -/*! INTG_PWSWTCH_WKUP_ACTIVE_EN - Integrated Power Switch Wake-up Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_CFG_INTG_PWSWTCH_WKUP_ACTIVE_EN(x) (((uint32_t)(((uint32_t)(x)) << SPC_CFG_INTG_PWSWTCH_WKUP_ACTIVE_EN_SHIFT)) & SPC_CFG_INTG_PWSWTCH_WKUP_ACTIVE_EN_MASK) -/*! @} */ - -/*! @name PD_STATUS - SPC Power Domain Mode Status */ -/*! @{ */ - -#define SPC_PD_STATUS_PWR_REQ_STATUS_MASK (0x1U) -#define SPC_PD_STATUS_PWR_REQ_STATUS_SHIFT (0U) -/*! PWR_REQ_STATUS - Power Request Status Flag - * 0b0..Did not request - * 0b1..Requested - */ -#define SPC_PD_STATUS_PWR_REQ_STATUS(x) (((uint32_t)(((uint32_t)(x)) << SPC_PD_STATUS_PWR_REQ_STATUS_SHIFT)) & SPC_PD_STATUS_PWR_REQ_STATUS_MASK) - -#define SPC_PD_STATUS_PD_LP_REQ_MASK (0x10U) -#define SPC_PD_STATUS_PD_LP_REQ_SHIFT (4U) -/*! PD_LP_REQ - Power Domain Low Power Request Flag - * 0b0..Did not request - * 0b1..Requested - */ -#define SPC_PD_STATUS_PD_LP_REQ(x) (((uint32_t)(((uint32_t)(x)) << SPC_PD_STATUS_PD_LP_REQ_SHIFT)) & SPC_PD_STATUS_PD_LP_REQ_MASK) - -#define SPC_PD_STATUS_LP_MODE_MASK (0xF00U) -#define SPC_PD_STATUS_LP_MODE_SHIFT (8U) -/*! LP_MODE - Power Domain Low Power Mode Request - * 0b0000..SLEEP with system clock running - * 0b0001..DSLEEP with system clock off - * 0b0010..PDOWN with system clock off - * 0b0100.. - * 0b1000..DPDOWN with system clock off - */ -#define SPC_PD_STATUS_LP_MODE(x) (((uint32_t)(((uint32_t)(x)) << SPC_PD_STATUS_LP_MODE_SHIFT)) & SPC_PD_STATUS_LP_MODE_MASK) -/*! @} */ - -/* The count of SPC_PD_STATUS */ -#define SPC_PD_STATUS_COUNT (1U) - -/*! @name SRAMCTL - SRAM Control */ -/*! @{ */ - -#define SPC_SRAMCTL_VSM_MASK (0x3U) -#define SPC_SRAMCTL_VSM_SHIFT (0U) -/*! VSM - Voltage Select Margin - * 0b00.. - * 0b01..1.0 V - * 0b10..1.1 V - * 0b11..SRAM configured for 1.2 V operation - */ -#define SPC_SRAMCTL_VSM(x) (((uint32_t)(((uint32_t)(x)) << SPC_SRAMCTL_VSM_SHIFT)) & SPC_SRAMCTL_VSM_MASK) - -#define SPC_SRAMCTL_REQ_MASK (0x40000000U) -#define SPC_SRAMCTL_REQ_SHIFT (30U) -/*! REQ - SRAM Voltage Update Request - * 0b0..Do not request - * 0b1..Request - */ -#define SPC_SRAMCTL_REQ(x) (((uint32_t)(((uint32_t)(x)) << SPC_SRAMCTL_REQ_SHIFT)) & SPC_SRAMCTL_REQ_MASK) - -#define SPC_SRAMCTL_ACK_MASK (0x80000000U) -#define SPC_SRAMCTL_ACK_SHIFT (31U) -/*! ACK - SRAM Voltage Update Request Acknowledge - * 0b0..Not acknowledged - * 0b1..Acknowledged - */ -#define SPC_SRAMCTL_ACK(x) (((uint32_t)(((uint32_t)(x)) << SPC_SRAMCTL_ACK_SHIFT)) & SPC_SRAMCTL_ACK_MASK) -/*! @} */ - -/*! @name SRAMRETLDO_REFTRIM - SRAM Retention Reference Trim */ -/*! @{ */ - -#define SPC_SRAMRETLDO_REFTRIM_REFTRIM_MASK (0x1FU) -#define SPC_SRAMRETLDO_REFTRIM_REFTRIM_SHIFT (0U) -/*! REFTRIM - Reference Trim. Voltage range is around 0.48V - 0.85V. Trim step is 12 mV. */ -#define SPC_SRAMRETLDO_REFTRIM_REFTRIM(x) (((uint32_t)(((uint32_t)(x)) << SPC_SRAMRETLDO_REFTRIM_REFTRIM_SHIFT)) & SPC_SRAMRETLDO_REFTRIM_REFTRIM_MASK) -/*! @} */ - -/*! @name SRAMRETLDO_CNTRL - SRAM Retention LDO Control */ -/*! @{ */ - -#define SPC_SRAMRETLDO_CNTRL_SRAMLDO_ON_MASK (0x1U) -#define SPC_SRAMRETLDO_CNTRL_SRAMLDO_ON_SHIFT (0U) -/*! SRAMLDO_ON - SRAM LDO Regulator Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_SRAMRETLDO_CNTRL_SRAMLDO_ON(x) (((uint32_t)(((uint32_t)(x)) << SPC_SRAMRETLDO_CNTRL_SRAMLDO_ON_SHIFT)) & SPC_SRAMRETLDO_CNTRL_SRAMLDO_ON_MASK) - -#define SPC_SRAMRETLDO_CNTRL_SRAM_RET_EN_MASK (0xF00U) -#define SPC_SRAMRETLDO_CNTRL_SRAM_RET_EN_SHIFT (8U) -/*! SRAM_RET_EN - SRAM Retention */ -#define SPC_SRAMRETLDO_CNTRL_SRAM_RET_EN(x) (((uint32_t)(((uint32_t)(x)) << SPC_SRAMRETLDO_CNTRL_SRAM_RET_EN_SHIFT)) & SPC_SRAMRETLDO_CNTRL_SRAM_RET_EN_MASK) -/*! @} */ - -/*! @name ACTIVE_CFG - Active Power Mode Configuration */ -/*! @{ */ - -#define SPC_ACTIVE_CFG_CORELDO_VDD_DS_MASK (0x1U) -#define SPC_ACTIVE_CFG_CORELDO_VDD_DS_SHIFT (0U) -/*! CORELDO_VDD_DS - LDO_CORE VDD Drive Strength - * 0b0..Low - * 0b1..Normal - */ -#define SPC_ACTIVE_CFG_CORELDO_VDD_DS(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_CORELDO_VDD_DS_SHIFT)) & SPC_ACTIVE_CFG_CORELDO_VDD_DS_MASK) - -#define SPC_ACTIVE_CFG_CORELDO_VDD_LVL_MASK (0xCU) -#define SPC_ACTIVE_CFG_CORELDO_VDD_LVL_SHIFT (2U) -/*! CORELDO_VDD_LVL - LDO_CORE VDD Regulator Voltage Level - * 0b00.. - * 0b01..Regulate to mid voltage (1.0 V) - * 0b10..Regulate to normal voltage (1.1 V) - * 0b11..Regulate to overdrive voltage (1.15 V) - */ -#define SPC_ACTIVE_CFG_CORELDO_VDD_LVL(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_CORELDO_VDD_LVL_SHIFT)) & SPC_ACTIVE_CFG_CORELDO_VDD_LVL_MASK) - -#define SPC_ACTIVE_CFG_BGMODE_MASK (0x300000U) -#define SPC_ACTIVE_CFG_BGMODE_SHIFT (20U) -/*! BGMODE - Bandgap Mode - * 0b00..Bandgap disabled - * 0b01..Bandgap enabled, buffer disabled - * 0b10..Bandgap enabled, buffer enabled - * 0b11.. - */ -#define SPC_ACTIVE_CFG_BGMODE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_BGMODE_SHIFT)) & SPC_ACTIVE_CFG_BGMODE_MASK) - -#define SPC_ACTIVE_CFG_VDD_VD_DISABLE_MASK (0x800000U) -#define SPC_ACTIVE_CFG_VDD_VD_DISABLE_SHIFT (23U) -/*! VDD_VD_DISABLE - VDD Voltage Detect Disable - * 0b0..Enable - * 0b1..Disable - */ -#define SPC_ACTIVE_CFG_VDD_VD_DISABLE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_VDD_VD_DISABLE_SHIFT)) & SPC_ACTIVE_CFG_VDD_VD_DISABLE_MASK) - -#define SPC_ACTIVE_CFG_CORE_LVDE_MASK (0x1000000U) -#define SPC_ACTIVE_CFG_CORE_LVDE_SHIFT (24U) -/*! CORE_LVDE - Core Low-Voltage Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_ACTIVE_CFG_CORE_LVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_CORE_LVDE_SHIFT)) & SPC_ACTIVE_CFG_CORE_LVDE_MASK) - -#define SPC_ACTIVE_CFG_SYS_LVDE_MASK (0x2000000U) -#define SPC_ACTIVE_CFG_SYS_LVDE_SHIFT (25U) -/*! SYS_LVDE - System Low-Voltage Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_ACTIVE_CFG_SYS_LVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_SYS_LVDE_SHIFT)) & SPC_ACTIVE_CFG_SYS_LVDE_MASK) - -#define SPC_ACTIVE_CFG_SYS_HVDE_MASK (0x10000000U) -#define SPC_ACTIVE_CFG_SYS_HVDE_SHIFT (28U) -/*! SYS_HVDE - System High-Voltage Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_ACTIVE_CFG_SYS_HVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_SYS_HVDE_SHIFT)) & SPC_ACTIVE_CFG_SYS_HVDE_MASK) -/*! @} */ - -/*! @name ACTIVE_CFG1 - Active Power Mode Configuration 1 */ -/*! @{ */ - -#define SPC_ACTIVE_CFG1_SOC_CNTRL_MASK (0xFFFFFFFFU) -#define SPC_ACTIVE_CFG1_SOC_CNTRL_SHIFT (0U) -/*! SOC_CNTRL - Active Config Chip Control */ -#define SPC_ACTIVE_CFG1_SOC_CNTRL(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG1_SOC_CNTRL_SHIFT)) & SPC_ACTIVE_CFG1_SOC_CNTRL_MASK) -/*! @} */ - -/*! @name LP_CFG - Low-Power Mode Configuration */ -/*! @{ */ - -#define SPC_LP_CFG_CORELDO_VDD_DS_MASK (0x1U) -#define SPC_LP_CFG_CORELDO_VDD_DS_SHIFT (0U) -/*! CORELDO_VDD_DS - LDO_CORE VDD Drive Strength - * 0b0..Low - * 0b1..Normal - */ -#define SPC_LP_CFG_CORELDO_VDD_DS(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_CORELDO_VDD_DS_SHIFT)) & SPC_LP_CFG_CORELDO_VDD_DS_MASK) - -#define SPC_LP_CFG_CORELDO_VDD_LVL_MASK (0xCU) -#define SPC_LP_CFG_CORELDO_VDD_LVL_SHIFT (2U) -/*! CORELDO_VDD_LVL - LDO_CORE VDD Regulator Voltage Level - * 0b00..Reserved - * 0b01..Mid voltage (1.0 V) - * 0b10..Normal voltage (1.1 V) - * 0b11..Overdrive voltage (1.15 V) - * *.. - */ -#define SPC_LP_CFG_CORELDO_VDD_LVL(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_CORELDO_VDD_LVL_SHIFT)) & SPC_LP_CFG_CORELDO_VDD_LVL_MASK) - -#define SPC_LP_CFG_SRAMLDO_DPD_ON_MASK (0x80000U) -#define SPC_LP_CFG_SRAMLDO_DPD_ON_SHIFT (19U) -/*! SRAMLDO_DPD_ON - SRAM_LDO Deep Power Low Power IREF Enable - * 0b0..Low Power IREF is disabled for power saving in Deep Power Down mode - * 0b1..Low Power IREF is enabled - */ -#define SPC_LP_CFG_SRAMLDO_DPD_ON(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_SRAMLDO_DPD_ON_SHIFT)) & SPC_LP_CFG_SRAMLDO_DPD_ON_MASK) - -#define SPC_LP_CFG_BGMODE_MASK (0x300000U) -#define SPC_LP_CFG_BGMODE_SHIFT (20U) -/*! BGMODE - Bandgap Mode - * 0b00..Bandgap disabled - * 0b01..Bandgap enabled, buffer disabled - * 0b10..Bandgap enabled, buffer enabled - * 0b11.. - */ -#define SPC_LP_CFG_BGMODE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_BGMODE_SHIFT)) & SPC_LP_CFG_BGMODE_MASK) - -#define SPC_LP_CFG_LP_IREFEN_MASK (0x800000U) -#define SPC_LP_CFG_LP_IREFEN_SHIFT (23U) -/*! LP_IREFEN - Low-Power IREF Enable - * 0b0..Disable for power saving in Deep Power Down mode - * 0b1..Enable - */ -#define SPC_LP_CFG_LP_IREFEN(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_LP_IREFEN_SHIFT)) & SPC_LP_CFG_LP_IREFEN_MASK) - -#define SPC_LP_CFG_CORE_LVDE_MASK (0x1000000U) -#define SPC_LP_CFG_CORE_LVDE_SHIFT (24U) -/*! CORE_LVDE - Core Low Voltage Detect Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LP_CFG_CORE_LVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_CORE_LVDE_SHIFT)) & SPC_LP_CFG_CORE_LVDE_MASK) - -#define SPC_LP_CFG_SYS_LVDE_MASK (0x2000000U) -#define SPC_LP_CFG_SYS_LVDE_SHIFT (25U) -/*! SYS_LVDE - System Low Voltage Detect Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LP_CFG_SYS_LVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_SYS_LVDE_SHIFT)) & SPC_LP_CFG_SYS_LVDE_MASK) - -#define SPC_LP_CFG_SYS_HVDE_MASK (0x10000000U) -#define SPC_LP_CFG_SYS_HVDE_SHIFT (28U) -/*! SYS_HVDE - System High Voltage Detect Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LP_CFG_SYS_HVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_SYS_HVDE_SHIFT)) & SPC_LP_CFG_SYS_HVDE_MASK) -/*! @} */ - -/*! @name LP_CFG1 - Low Power Mode Configuration 1 */ -/*! @{ */ - -#define SPC_LP_CFG1_SOC_CNTRL_MASK (0xFFFFFFFFU) -#define SPC_LP_CFG1_SOC_CNTRL_SHIFT (0U) -/*! SOC_CNTRL - Low-Power Configuration Chip Control */ -#define SPC_LP_CFG1_SOC_CNTRL(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG1_SOC_CNTRL_SHIFT)) & SPC_LP_CFG1_SOC_CNTRL_MASK) -/*! @} */ - -/*! @name LPWKUP_DELAY - Low Power Wake-Up Delay */ -/*! @{ */ - -#define SPC_LPWKUP_DELAY_LPWKUP_DELAY_MASK (0xFFFFU) -#define SPC_LPWKUP_DELAY_LPWKUP_DELAY_SHIFT (0U) -/*! LPWKUP_DELAY - Low-Power Wake-Up Delay */ -#define SPC_LPWKUP_DELAY_LPWKUP_DELAY(x) (((uint32_t)(((uint32_t)(x)) << SPC_LPWKUP_DELAY_LPWKUP_DELAY_SHIFT)) & SPC_LPWKUP_DELAY_LPWKUP_DELAY_MASK) -/*! @} */ - -/*! @name ACTIVE_VDELAY - Active Voltage Trim Delay */ -/*! @{ */ - -#define SPC_ACTIVE_VDELAY_ACTIVE_VDELAY_MASK (0xFFFFU) -#define SPC_ACTIVE_VDELAY_ACTIVE_VDELAY_SHIFT (0U) -/*! ACTIVE_VDELAY - Active Voltage Delay */ -#define SPC_ACTIVE_VDELAY_ACTIVE_VDELAY(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_VDELAY_ACTIVE_VDELAY_SHIFT)) & SPC_ACTIVE_VDELAY_ACTIVE_VDELAY_MASK) -/*! @} */ - -/*! @name VD_STAT - Voltage Detect Status */ -/*! @{ */ - -#define SPC_VD_STAT_COREVDD_LVDF_MASK (0x1U) -#define SPC_VD_STAT_COREVDD_LVDF_SHIFT (0U) -/*! COREVDD_LVDF - Core Low-Voltage Detect Flag - * 0b0..Event not detected - * 0b1..Event detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_VD_STAT_COREVDD_LVDF(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_STAT_COREVDD_LVDF_SHIFT)) & SPC_VD_STAT_COREVDD_LVDF_MASK) - -#define SPC_VD_STAT_SYSVDD_LVDF_MASK (0x2U) -#define SPC_VD_STAT_SYSVDD_LVDF_SHIFT (1U) -/*! SYSVDD_LVDF - System Low-Voltage Detect Flag - * 0b0..Event not detected - * 0b1..Event detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_VD_STAT_SYSVDD_LVDF(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_STAT_SYSVDD_LVDF_SHIFT)) & SPC_VD_STAT_SYSVDD_LVDF_MASK) - -#define SPC_VD_STAT_SYSVDD_HVDF_MASK (0x20U) -#define SPC_VD_STAT_SYSVDD_HVDF_SHIFT (5U) -/*! SYSVDD_HVDF - System HVD Flag - * 0b0..Event not detected - * 0b1..Event detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_VD_STAT_SYSVDD_HVDF(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_STAT_SYSVDD_HVDF_SHIFT)) & SPC_VD_STAT_SYSVDD_HVDF_MASK) -/*! @} */ - -/*! @name VD_CORE_CFG - Core Voltage Detect Configuration */ -/*! @{ */ - -#define SPC_VD_CORE_CFG_LVDRE_MASK (0x1U) -#define SPC_VD_CORE_CFG_LVDRE_SHIFT (0U) -/*! LVDRE - Core LVD Reset Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_CORE_CFG_LVDRE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_CORE_CFG_LVDRE_SHIFT)) & SPC_VD_CORE_CFG_LVDRE_MASK) - -#define SPC_VD_CORE_CFG_LVDIE_MASK (0x2U) -#define SPC_VD_CORE_CFG_LVDIE_SHIFT (1U) -/*! LVDIE - Core LVD Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_CORE_CFG_LVDIE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_CORE_CFG_LVDIE_SHIFT)) & SPC_VD_CORE_CFG_LVDIE_MASK) - -#define SPC_VD_CORE_CFG_LOCK_MASK (0x10000U) -#define SPC_VD_CORE_CFG_LOCK_SHIFT (16U) -/*! LOCK - Core Voltage Detect Reset Enable Lock - * 0b0..Allow - * 0b1..Deny - */ -#define SPC_VD_CORE_CFG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_CORE_CFG_LOCK_SHIFT)) & SPC_VD_CORE_CFG_LOCK_MASK) -/*! @} */ - -/*! @name VD_SYS_CFG - System Voltage Detect Configuration */ -/*! @{ */ - -#define SPC_VD_SYS_CFG_LVDRE_MASK (0x1U) -#define SPC_VD_SYS_CFG_LVDRE_SHIFT (0U) -/*! LVDRE - System LVD Reset Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_SYS_CFG_LVDRE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_SYS_CFG_LVDRE_SHIFT)) & SPC_VD_SYS_CFG_LVDRE_MASK) - -#define SPC_VD_SYS_CFG_LVDIE_MASK (0x2U) -#define SPC_VD_SYS_CFG_LVDIE_SHIFT (1U) -/*! LVDIE - System LVD Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_SYS_CFG_LVDIE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_SYS_CFG_LVDIE_SHIFT)) & SPC_VD_SYS_CFG_LVDIE_MASK) - -#define SPC_VD_SYS_CFG_HVDRE_MASK (0x4U) -#define SPC_VD_SYS_CFG_HVDRE_SHIFT (2U) -/*! HVDRE - System HVD Reset Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_SYS_CFG_HVDRE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_SYS_CFG_HVDRE_SHIFT)) & SPC_VD_SYS_CFG_HVDRE_MASK) - -#define SPC_VD_SYS_CFG_HVDIE_MASK (0x8U) -#define SPC_VD_SYS_CFG_HVDIE_SHIFT (3U) -/*! HVDIE - System HVD Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_SYS_CFG_HVDIE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_SYS_CFG_HVDIE_SHIFT)) & SPC_VD_SYS_CFG_HVDIE_MASK) - -#define SPC_VD_SYS_CFG_LVSEL_MASK (0x100U) -#define SPC_VD_SYS_CFG_LVSEL_SHIFT (8U) -/*! LVSEL - System Low-Voltage Level Select - * 0b0..Normal - * 0b1..Safe - */ -#define SPC_VD_SYS_CFG_LVSEL(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_SYS_CFG_LVSEL_SHIFT)) & SPC_VD_SYS_CFG_LVSEL_MASK) - -#define SPC_VD_SYS_CFG_LOCK_MASK (0x10000U) -#define SPC_VD_SYS_CFG_LOCK_SHIFT (16U) -/*! LOCK - System Voltage Detect Reset Enable Lock - * 0b0..Allow - * 0b1..Deny - */ -#define SPC_VD_SYS_CFG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_SYS_CFG_LOCK_SHIFT)) & SPC_VD_SYS_CFG_LOCK_MASK) -/*! @} */ - -/*! @name EVD_CFG - External Voltage Domain Configuration */ -/*! @{ */ - -#define SPC_EVD_CFG_EVDISO_MASK (0x7U) -#define SPC_EVD_CFG_EVDISO_SHIFT (0U) -/*! EVDISO - External Voltage Domain Isolation */ -#define SPC_EVD_CFG_EVDISO(x) (((uint32_t)(((uint32_t)(x)) << SPC_EVD_CFG_EVDISO_SHIFT)) & SPC_EVD_CFG_EVDISO_MASK) - -#define SPC_EVD_CFG_EVDLPISO_MASK (0x700U) -#define SPC_EVD_CFG_EVDLPISO_SHIFT (8U) -/*! EVDLPISO - External Voltage Domain Low-Power Isolation */ -#define SPC_EVD_CFG_EVDLPISO(x) (((uint32_t)(((uint32_t)(x)) << SPC_EVD_CFG_EVDLPISO_SHIFT)) & SPC_EVD_CFG_EVDLPISO_MASK) - -#define SPC_EVD_CFG_EVDSTAT_MASK (0x70000U) -#define SPC_EVD_CFG_EVDSTAT_SHIFT (16U) -/*! EVDSTAT - External Voltage Domain Status */ -#define SPC_EVD_CFG_EVDSTAT(x) (((uint32_t)(((uint32_t)(x)) << SPC_EVD_CFG_EVDSTAT_SHIFT)) & SPC_EVD_CFG_EVDSTAT_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group SPC_Register_Masks */ - - -/* SPC - Peripheral instance base addresses */ -/** Peripheral SPC0 base address */ -#define SPC0_BASE (0x40090000u) -/** Peripheral SPC0 base pointer */ -#define SPC0 ((SPC_Type *)SPC0_BASE) -/** Array initializer of SPC peripheral base addresses */ -#define SPC_BASE_ADDRS { SPC0_BASE } -/** Array initializer of SPC peripheral base pointers */ -#define SPC_BASE_PTRS { SPC0 } - -/*! - * @} - */ /* end of group SPC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- SYSCON Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SYSCON_Peripheral_Access_Layer SYSCON Peripheral Access Layer - * @{ - */ - -/** SYSCON - Register Layout Typedef */ -typedef struct { - uint8_t RESERVED_0[512]; - __IO uint32_t REMAP; /**< AHB Matrix Remap Control, offset: 0x200 */ - uint8_t RESERVED_1[12]; - __IO uint32_t AHBMATPRIO; /**< AHB Matrix Priority Control, offset: 0x210 */ - uint8_t RESERVED_2[40]; - __IO uint32_t CPU0NSTCKCAL; /**< Non-Secure CPU0 System Tick Calibration, offset: 0x23C */ - uint8_t RESERVED_3[8]; - __IO uint32_t NMISRC; /**< NMI Source Select, offset: 0x248 */ - uint8_t RESERVED_4[300]; - __IO uint32_t SLOWCLKDIV; /**< SLOW_CLK Clock Divider, offset: 0x378 */ - uint8_t RESERVED_5[4]; - __IO uint32_t AHBCLKDIV; /**< System Clock Divider, offset: 0x380 */ - uint8_t RESERVED_6[120]; - __IO uint32_t CLKUNLOCK; /**< Clock Configuration Unlock, offset: 0x3FC */ - __IO uint32_t NVM_CTRL; /**< NVM Control, offset: 0x400 */ - uint32_t ROMCR; /**< ROM Wait State, offset: 0x404 */ - uint8_t RESERVED_7[1028]; - __I uint32_t CPUSTAT; /**< CPU Status, offset: 0x80C */ - uint8_t RESERVED_8[20]; - __IO uint32_t LPCAC_CTRL; /**< LPCAC Control, offset: 0x824 */ - uint8_t RESERVED_9[272]; - __IO uint32_t PWM0SUBCTL; /**< PWM0 Submodule Control, offset: 0x938 */ - uint8_t RESERVED_10[4]; - __IO uint32_t CTIMERGLOBALSTARTEN; /**< CTIMER Global Start Enable, offset: 0x940 */ - __IO uint32_t RAM_CTRL; /**< RAM Control, offset: 0x944 */ - uint8_t RESERVED_11[536]; - __IO uint32_t GRAY_CODE_LSB; /**< Gray to Binary Converter Gray Code [31:0], offset: 0xB60 */ - __IO uint32_t GRAY_CODE_MSB; /**< Gray to Binary Converter Gray Code [41:32], offset: 0xB64 */ - __I uint32_t BINARY_CODE_LSB; /**< Gray to Binary Converter Binary Code [31:0], offset: 0xB68 */ - __I uint32_t BINARY_CODE_MSB; /**< Gray to Binary Converter Binary Code [41:32], offset: 0xB6C */ - uint8_t RESERVED_12[720]; - __I uint32_t OVP_PAD_STATE; /**< OVP_PAD_STATE, offset: 0xE40 */ - __I uint32_t PROBE_STATE; /**< PROBE_STATE, offset: 0xE44 */ - __I uint32_t FT_STATE_A; /**< FT_STATE_A, offset: 0xE48 */ - __I uint32_t ROP_STATE; /**< ROP State Register, offset: 0xE4C */ - uint8_t RESERVED_13[8]; - __IO uint32_t SRAM_XEN; /**< RAM XEN Control, offset: 0xE58 */ - __IO uint32_t SRAM_XEN_DP; /**< RAM XEN Control (Duplicate), offset: 0xE5C */ - uint8_t RESERVED_14[32]; - __I uint32_t ELS_OTP_LC_STATE; /**< Life Cycle State Register, offset: 0xE80 */ - __I uint32_t ELS_OTP_LC_STATE_DP; /**< Life Cycle State Register (Duplicate), offset: 0xE84 */ - uint8_t RESERVED_15[280]; - __IO uint32_t DEBUG_LOCK_EN; /**< Control Write Access to Security, offset: 0xFA0 */ - __IO uint32_t DEBUG_FEATURES; /**< Cortex Debug Features Control, offset: 0xFA4 */ - __IO uint32_t DEBUG_FEATURES_DP; /**< Cortex Debug Features Control (Duplicate), offset: 0xFA8 */ - uint8_t RESERVED_16[8]; - __IO uint32_t SWD_ACCESS_CPU0; /**< CPU0 Software Debug Access, offset: 0xFB4 */ - uint8_t RESERVED_17[8]; - __IO uint32_t DEBUG_AUTH_BEACON; /**< Debug Authentication BEACON, offset: 0xFC0 */ - uint8_t RESERVED_18[44]; - __I uint32_t JTAG_ID; /**< JTAG Chip ID, offset: 0xFF0 */ - __I uint32_t DEVICE_TYPE; /**< Device Type, offset: 0xFF4 */ - __I uint32_t DEVICE_ID0; /**< Device ID, offset: 0xFF8 */ - __I uint32_t DIEID; /**< Chip Revision ID and Number, offset: 0xFFC */ -} SYSCON_Type; - -/* ---------------------------------------------------------------------------- - -- SYSCON Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SYSCON_Register_Masks SYSCON Register Masks - * @{ - */ - -/*! @name REMAP - AHB Matrix Remap Control */ -/*! @{ */ - -#define SYSCON_REMAP_CPU0_SBUS_MASK (0x3U) -#define SYSCON_REMAP_CPU0_SBUS_SHIFT (0U) -/*! CPU0_SBUS - RAMX0 address remap for CPU System bus - * 0b00..RAMX0: 0x04000000 - 0x04001fff - * 0b01..RAMX0: 0x20006000 - 0x20007fff - */ -#define SYSCON_REMAP_CPU0_SBUS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_REMAP_CPU0_SBUS_SHIFT)) & SYSCON_REMAP_CPU0_SBUS_MASK) - -#define SYSCON_REMAP_DMA0_MASK (0xCU) -#define SYSCON_REMAP_DMA0_SHIFT (2U) -/*! DMA0 - RAMX0 address remap for DMA0 - * 0b00..RAMX0: 0x04000000 - 0x04001fff - * 0b01..RAMX0: same alias space as CPU0_SBUS - */ -#define SYSCON_REMAP_DMA0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_REMAP_DMA0_SHIFT)) & SYSCON_REMAP_DMA0_MASK) - -#define SYSCON_REMAP_USB0_MASK (0x30U) -#define SYSCON_REMAP_USB0_SHIFT (4U) -/*! USB0 - RAMX0 address remap for USB0 - * 0b00..RAMX0: 0x04000000 - 0x04001fff - * 0b01..RAMX0: same alias space as CPU0_SBUS - */ -#define SYSCON_REMAP_USB0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_REMAP_USB0_SHIFT)) & SYSCON_REMAP_USB0_MASK) - -#define SYSCON_REMAP_LOCK_MASK (0x80000000U) -#define SYSCON_REMAP_LOCK_SHIFT (31U) -/*! LOCK - This 1-bit field provides a mechanism to limit writes to the this register to protect its - * contents. Once set, this bit remains asserted until the next reset. - * 0b0..This register is not locked and can be altered. - * 0b1..This register is locked and cannot be altered. - */ -#define SYSCON_REMAP_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_REMAP_LOCK_SHIFT)) & SYSCON_REMAP_LOCK_MASK) -/*! @} */ - -/*! @name AHBMATPRIO - AHB Matrix Priority Control */ -/*! @{ */ - -#define SYSCON_AHBMATPRIO_CPU0_CBUS_MASK (0x3U) -#define SYSCON_AHBMATPRIO_CPU0_CBUS_SHIFT (0U) -/*! CPU0_CBUS - CPU0 C-AHB bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_CPU0_CBUS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_CPU0_CBUS_SHIFT)) & SYSCON_AHBMATPRIO_CPU0_CBUS_MASK) - -#define SYSCON_AHBMATPRIO_CPU0_SBUS_MASK (0xCU) -#define SYSCON_AHBMATPRIO_CPU0_SBUS_SHIFT (2U) -/*! CPU0_SBUS - CPU0 S-AHB bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_CPU0_SBUS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_CPU0_SBUS_SHIFT)) & SYSCON_AHBMATPRIO_CPU0_SBUS_MASK) - -#define SYSCON_AHBMATPRIO_DMA0_MASK (0x300U) -#define SYSCON_AHBMATPRIO_DMA0_SHIFT (8U) -/*! DMA0 - DMA0 controller bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_DMA0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_DMA0_SHIFT)) & SYSCON_AHBMATPRIO_DMA0_MASK) - -#define SYSCON_AHBMATPRIO_USB_FS_ENET_MASK (0x3000000U) -#define SYSCON_AHBMATPRIO_USB_FS_ENET_SHIFT (24U) -/*! USB_FS_ENET - USB-FS bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_USB_FS_ENET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_USB_FS_ENET_SHIFT)) & SYSCON_AHBMATPRIO_USB_FS_ENET_MASK) -/*! @} */ - -/*! @name CPU0NSTCKCAL - Non-Secure CPU0 System Tick Calibration */ -/*! @{ */ - -#define SYSCON_CPU0NSTCKCAL_TENMS_MASK (0xFFFFFFU) -#define SYSCON_CPU0NSTCKCAL_TENMS_SHIFT (0U) -/*! TENMS - Reload value for 10 ms (100 Hz) timing, subject to system clock skew errors. If the - * value reads as zero, the calibration value is not known. - */ -#define SYSCON_CPU0NSTCKCAL_TENMS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPU0NSTCKCAL_TENMS_SHIFT)) & SYSCON_CPU0NSTCKCAL_TENMS_MASK) - -#define SYSCON_CPU0NSTCKCAL_SKEW_MASK (0x1000000U) -#define SYSCON_CPU0NSTCKCAL_SKEW_SHIFT (24U) -/*! SKEW - Indicates whether the TENMS value is exact. - * 0b0..TENMS value is exact - * 0b1..TENMS value is not exact or not given - */ -#define SYSCON_CPU0NSTCKCAL_SKEW(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPU0NSTCKCAL_SKEW_SHIFT)) & SYSCON_CPU0NSTCKCAL_SKEW_MASK) - -#define SYSCON_CPU0NSTCKCAL_NOREF_MASK (0x2000000U) -#define SYSCON_CPU0NSTCKCAL_NOREF_SHIFT (25U) -/*! NOREF - Indicates whether the device provides a reference clock to the processor. - * 0b0..Reference clock is provided - * 0b1..No reference clock is provided - */ -#define SYSCON_CPU0NSTCKCAL_NOREF(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPU0NSTCKCAL_NOREF_SHIFT)) & SYSCON_CPU0NSTCKCAL_NOREF_MASK) -/*! @} */ - -/*! @name NMISRC - NMI Source Select */ -/*! @{ */ - -#define SYSCON_NMISRC_IRQCPU0_MASK (0xFFU) -#define SYSCON_NMISRC_IRQCPU0_SHIFT (0U) -/*! IRQCPU0 - The IRQ number of the interrupt that acts as the Non-Maskable Interrupt (NMI) for CPU0, if enabled by NMIENCPU0. */ -#define SYSCON_NMISRC_IRQCPU0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NMISRC_IRQCPU0_SHIFT)) & SYSCON_NMISRC_IRQCPU0_MASK) - -#define SYSCON_NMISRC_NMIENCPU0_MASK (0x80000000U) -#define SYSCON_NMISRC_NMIENCPU0_SHIFT (31U) -/*! NMIENCPU0 - Enables the Non-Maskable Interrupt (NMI) source selected by IRQCPU0. - * 0b1..Enable. - * 0b0..Disable. - */ -#define SYSCON_NMISRC_NMIENCPU0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NMISRC_NMIENCPU0_SHIFT)) & SYSCON_NMISRC_NMIENCPU0_MASK) -/*! @} */ - -/*! @name SLOWCLKDIV - SLOW_CLK Clock Divider */ -/*! @{ */ - -#define SYSCON_SLOWCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_SLOWCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_SLOWCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SLOWCLKDIV_RESET_SHIFT)) & SYSCON_SLOWCLKDIV_RESET_MASK) - -#define SYSCON_SLOWCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_SLOWCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_SLOWCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SLOWCLKDIV_HALT_SHIFT)) & SYSCON_SLOWCLKDIV_HALT_MASK) - -#define SYSCON_SLOWCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_SLOWCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_SLOWCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SLOWCLKDIV_UNSTAB_SHIFT)) & SYSCON_SLOWCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name AHBCLKDIV - System Clock Divider */ -/*! @{ */ - -#define SYSCON_AHBCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_AHBCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_AHBCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKDIV_DIV_SHIFT)) & SYSCON_AHBCLKDIV_DIV_MASK) - -#define SYSCON_AHBCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_AHBCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_AHBCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKDIV_UNSTAB_SHIFT)) & SYSCON_AHBCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name CLKUNLOCK - Clock Configuration Unlock */ -/*! @{ */ - -#define SYSCON_CLKUNLOCK_UNLOCK_MASK (0x1U) -#define SYSCON_CLKUNLOCK_UNLOCK_SHIFT (0U) -/*! UNLOCK - Controls clock configuration registers access (for example, MRCC_xxx_CLKDIV, MRCC_xxx_CLKSEL, MRCC_GLB_xxx) - * 0b1..Freezes all clock configuration registers update. - * 0b0..Updates are allowed to all clock configuration registers - */ -#define SYSCON_CLKUNLOCK_UNLOCK(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLKUNLOCK_UNLOCK_SHIFT)) & SYSCON_CLKUNLOCK_UNLOCK_MASK) -/*! @} */ - -/*! @name NVM_CTRL - NVM Control */ -/*! @{ */ - -#define SYSCON_NVM_CTRL_DIS_FLASH_SPEC_MASK (0x1U) -#define SYSCON_NVM_CTRL_DIS_FLASH_SPEC_SHIFT (0U) -/*! DIS_FLASH_SPEC - Flash speculation control - * 0b0..Enables flash speculation - * 0b1..Disables flash speculation - */ -#define SYSCON_NVM_CTRL_DIS_FLASH_SPEC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_DIS_FLASH_SPEC_SHIFT)) & SYSCON_NVM_CTRL_DIS_FLASH_SPEC_MASK) - -#define SYSCON_NVM_CTRL_DIS_DATA_SPEC_MASK (0x2U) -#define SYSCON_NVM_CTRL_DIS_DATA_SPEC_SHIFT (1U) -/*! DIS_DATA_SPEC - Flash data speculation control - * 0b0..Enables data speculation - * 0b1..Disables data speculation - */ -#define SYSCON_NVM_CTRL_DIS_DATA_SPEC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_DIS_DATA_SPEC_SHIFT)) & SYSCON_NVM_CTRL_DIS_DATA_SPEC_MASK) - -#define SYSCON_NVM_CTRL_FLASH_STALL_EN_MASK (0x400U) -#define SYSCON_NVM_CTRL_FLASH_STALL_EN_SHIFT (10U) -/*! FLASH_STALL_EN - FLASH stall on busy control - * 0b0..No stall on FLASH busy - * 0b1..Stall on FLASH busy - */ -#define SYSCON_NVM_CTRL_FLASH_STALL_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_FLASH_STALL_EN_SHIFT)) & SYSCON_NVM_CTRL_FLASH_STALL_EN_MASK) - -#define SYSCON_NVM_CTRL_DIS_MBECC_ERR_INST_MASK (0x10000U) -#define SYSCON_NVM_CTRL_DIS_MBECC_ERR_INST_SHIFT (16U) -/*! DIS_MBECC_ERR_INST - * 0b0..Enables bus error on multi-bit ECC error for instruction - * 0b1..Disables bus error on multi-bit ECC error for instruction - */ -#define SYSCON_NVM_CTRL_DIS_MBECC_ERR_INST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_DIS_MBECC_ERR_INST_SHIFT)) & SYSCON_NVM_CTRL_DIS_MBECC_ERR_INST_MASK) - -#define SYSCON_NVM_CTRL_DIS_MBECC_ERR_DATA_MASK (0x20000U) -#define SYSCON_NVM_CTRL_DIS_MBECC_ERR_DATA_SHIFT (17U) -/*! DIS_MBECC_ERR_DATA - * 0b0..Enables bus error on multi-bit ECC error for data - * 0b1..Disables bus error on multi-bit ECC error for data - */ -#define SYSCON_NVM_CTRL_DIS_MBECC_ERR_DATA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_DIS_MBECC_ERR_DATA_SHIFT)) & SYSCON_NVM_CTRL_DIS_MBECC_ERR_DATA_MASK) -/*! @} */ - -/*! @name CPUSTAT - CPU Status */ -/*! @{ */ - -#define SYSCON_CPUSTAT_CPU0SLEEPING_MASK (0x1U) -#define SYSCON_CPUSTAT_CPU0SLEEPING_SHIFT (0U) -/*! CPU0SLEEPING - CPU0 sleeping state - * 0b1..CPU is sleeping - * 0b0..CPU is not sleeping - */ -#define SYSCON_CPUSTAT_CPU0SLEEPING(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPUSTAT_CPU0SLEEPING_SHIFT)) & SYSCON_CPUSTAT_CPU0SLEEPING_MASK) - -#define SYSCON_CPUSTAT_CPU0LOCKUP_MASK (0x4U) -#define SYSCON_CPUSTAT_CPU0LOCKUP_SHIFT (2U) -/*! CPU0LOCKUP - CPU0 lockup state - * 0b1..CPU is in lockup - * 0b0..CPU is not in lockup - */ -#define SYSCON_CPUSTAT_CPU0LOCKUP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPUSTAT_CPU0LOCKUP_SHIFT)) & SYSCON_CPUSTAT_CPU0LOCKUP_MASK) -/*! @} */ - -/*! @name LPCAC_CTRL - LPCAC Control */ -/*! @{ */ - -#define SYSCON_LPCAC_CTRL_DIS_LPCAC_MASK (0x1U) -#define SYSCON_LPCAC_CTRL_DIS_LPCAC_SHIFT (0U) -/*! DIS_LPCAC - Disables/enables the cache function. - * 0b0..Enabled - * 0b1..Disabled - */ -#define SYSCON_LPCAC_CTRL_DIS_LPCAC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_DIS_LPCAC_SHIFT)) & SYSCON_LPCAC_CTRL_DIS_LPCAC_MASK) - -#define SYSCON_LPCAC_CTRL_CLR_LPCAC_MASK (0x2U) -#define SYSCON_LPCAC_CTRL_CLR_LPCAC_SHIFT (1U) -/*! CLR_LPCAC - Clears the cache function. - * 0b0..Unclears the cache - * 0b1..Clears the cache - */ -#define SYSCON_LPCAC_CTRL_CLR_LPCAC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_CLR_LPCAC_SHIFT)) & SYSCON_LPCAC_CTRL_CLR_LPCAC_MASK) - -#define SYSCON_LPCAC_CTRL_FRC_NO_ALLOC_MASK (0x4U) -#define SYSCON_LPCAC_CTRL_FRC_NO_ALLOC_SHIFT (2U) -/*! FRC_NO_ALLOC - Forces no allocation. - * 0b0..Forces allocation - * 0b1..Forces no allocation - */ -#define SYSCON_LPCAC_CTRL_FRC_NO_ALLOC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_FRC_NO_ALLOC_SHIFT)) & SYSCON_LPCAC_CTRL_FRC_NO_ALLOC_MASK) - -#define SYSCON_LPCAC_CTRL_DIS_LPCAC_WTBF_MASK (0x10U) -#define SYSCON_LPCAC_CTRL_DIS_LPCAC_WTBF_SHIFT (4U) -/*! DIS_LPCAC_WTBF - Disable LPCAC Write Through Buffer. - * 0b1..Disables write through buffer - * 0b0..Enables write through buffer - */ -#define SYSCON_LPCAC_CTRL_DIS_LPCAC_WTBF(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_DIS_LPCAC_WTBF_SHIFT)) & SYSCON_LPCAC_CTRL_DIS_LPCAC_WTBF_MASK) - -#define SYSCON_LPCAC_CTRL_LIM_LPCAC_WTBF_MASK (0x20U) -#define SYSCON_LPCAC_CTRL_LIM_LPCAC_WTBF_SHIFT (5U) -/*! LIM_LPCAC_WTBF - Limit LPCAC Write Through Buffer. - * 0b1..Write buffer enabled when transaction is cacheable and bufferable - * 0b0..Write buffer enabled when transaction is bufferable. - */ -#define SYSCON_LPCAC_CTRL_LIM_LPCAC_WTBF(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_LIM_LPCAC_WTBF_SHIFT)) & SYSCON_LPCAC_CTRL_LIM_LPCAC_WTBF_MASK) - -#define SYSCON_LPCAC_CTRL_LPCAC_XOM_MASK (0x80U) -#define SYSCON_LPCAC_CTRL_LPCAC_XOM_SHIFT (7U) -/*! LPCAC_XOM - LPCAC XOM(eXecute-Only-Memory) attribute control - * 0b1..Enabled. - * 0b0..Disabled. - */ -#define SYSCON_LPCAC_CTRL_LPCAC_XOM(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_LPCAC_XOM_SHIFT)) & SYSCON_LPCAC_CTRL_LPCAC_XOM_MASK) - -#define SYSCON_LPCAC_CTRL_LPCAC_MEM_REQ_MASK (0x100U) -#define SYSCON_LPCAC_CTRL_LPCAC_MEM_REQ_SHIFT (8U) -/*! LPCAC_MEM_REQ - Request LPCAC memories. - * 0b1..Configure shared memories RAMX1 as LPCAC memories, write one lock. - * 0b0..Configure shared memories RAMX1 as general memories. - */ -#define SYSCON_LPCAC_CTRL_LPCAC_MEM_REQ(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_LPCAC_MEM_REQ_SHIFT)) & SYSCON_LPCAC_CTRL_LPCAC_MEM_REQ_MASK) -/*! @} */ - -/*! @name PWM0SUBCTL - PWM0 Submodule Control */ -/*! @{ */ - -#define SYSCON_PWM0SUBCTL_CLK0_EN_MASK (0x1U) -#define SYSCON_PWM0SUBCTL_CLK0_EN_SHIFT (0U) -/*! CLK0_EN - Enables PWM0 SUB Clock0 - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_PWM0SUBCTL_CLK0_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_CLK0_EN_SHIFT)) & SYSCON_PWM0SUBCTL_CLK0_EN_MASK) - -#define SYSCON_PWM0SUBCTL_CLK1_EN_MASK (0x2U) -#define SYSCON_PWM0SUBCTL_CLK1_EN_SHIFT (1U) -/*! CLK1_EN - Enables PWM0 SUB Clock1 - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_PWM0SUBCTL_CLK1_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_CLK1_EN_SHIFT)) & SYSCON_PWM0SUBCTL_CLK1_EN_MASK) - -#define SYSCON_PWM0SUBCTL_CLK2_EN_MASK (0x4U) -#define SYSCON_PWM0SUBCTL_CLK2_EN_SHIFT (2U) -/*! CLK2_EN - Enables PWM0 SUB Clock2 - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_PWM0SUBCTL_CLK2_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_CLK2_EN_SHIFT)) & SYSCON_PWM0SUBCTL_CLK2_EN_MASK) - -#define SYSCON_PWM0SUBCTL_CLK3_EN_MASK (0x8U) -#define SYSCON_PWM0SUBCTL_CLK3_EN_SHIFT (3U) -/*! CLK3_EN - Enables PWM0 SUB Clock3 - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_PWM0SUBCTL_CLK3_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_CLK3_EN_SHIFT)) & SYSCON_PWM0SUBCTL_CLK3_EN_MASK) -/*! @} */ - -/*! @name CTIMERGLOBALSTARTEN - CTIMER Global Start Enable */ -/*! @{ */ - -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER0_CLK_EN_MASK (0x1U) -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER0_CLK_EN_SHIFT (0U) -/*! CTIMER0_CLK_EN - Enables the CTIMER0 function clock - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER0_CLK_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERGLOBALSTARTEN_CTIMER0_CLK_EN_SHIFT)) & SYSCON_CTIMERGLOBALSTARTEN_CTIMER0_CLK_EN_MASK) - -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER1_CLK_EN_MASK (0x2U) -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER1_CLK_EN_SHIFT (1U) -/*! CTIMER1_CLK_EN - Enables the CTIMER1 function clock - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER1_CLK_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERGLOBALSTARTEN_CTIMER1_CLK_EN_SHIFT)) & SYSCON_CTIMERGLOBALSTARTEN_CTIMER1_CLK_EN_MASK) - -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER2_CLK_EN_MASK (0x4U) -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER2_CLK_EN_SHIFT (2U) -/*! CTIMER2_CLK_EN - Enables the CTIMER2 function clock - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER2_CLK_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERGLOBALSTARTEN_CTIMER2_CLK_EN_SHIFT)) & SYSCON_CTIMERGLOBALSTARTEN_CTIMER2_CLK_EN_MASK) -/*! @} */ - -/*! @name RAM_CTRL - RAM Control */ -/*! @{ */ - -#define SYSCON_RAM_CTRL_RAMA_ECC_ENABLE_MASK (0x1U) -#define SYSCON_RAM_CTRL_RAMA_ECC_ENABLE_SHIFT (0U) -/*! RAMA_ECC_ENABLE - RAMA ECC enable - * 0b1..ECC is enabled - * 0b0..ECC is disabled - */ -#define SYSCON_RAM_CTRL_RAMA_ECC_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_RAM_CTRL_RAMA_ECC_ENABLE_SHIFT)) & SYSCON_RAM_CTRL_RAMA_ECC_ENABLE_MASK) - -#define SYSCON_RAM_CTRL_RAMA_CG_OVERRIDE_MASK (0x10000U) -#define SYSCON_RAM_CTRL_RAMA_CG_OVERRIDE_SHIFT (16U) -/*! RAMA_CG_OVERRIDE - RAMA bank clock gating control, only avaiable when RAMA_ECC_ENABLE = 0. - * 0b1..Auto clock gating feature is disabled - * 0b0..Memory bank clock is gated automatically if no access more than 16 clock cycles - */ -#define SYSCON_RAM_CTRL_RAMA_CG_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_RAM_CTRL_RAMA_CG_OVERRIDE_SHIFT)) & SYSCON_RAM_CTRL_RAMA_CG_OVERRIDE_MASK) - -#define SYSCON_RAM_CTRL_RAMX_CG_OVERRIDE_MASK (0x20000U) -#define SYSCON_RAM_CTRL_RAMX_CG_OVERRIDE_SHIFT (17U) -/*! RAMX_CG_OVERRIDE - RAMX bank clock gating control - * 0b1..Auto clock gating feature is disabled - * 0b0..Memory bank clock is gated automatically if no access more than 16 clock cycles - */ -#define SYSCON_RAM_CTRL_RAMX_CG_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_RAM_CTRL_RAMX_CG_OVERRIDE_SHIFT)) & SYSCON_RAM_CTRL_RAMX_CG_OVERRIDE_MASK) -/*! @} */ - -/*! @name GRAY_CODE_LSB - Gray to Binary Converter Gray Code [31:0] */ -/*! @{ */ - -#define SYSCON_GRAY_CODE_LSB_code_gray_31_0_MASK (0xFFFFFFFFU) -#define SYSCON_GRAY_CODE_LSB_code_gray_31_0_SHIFT (0U) -/*! code_gray_31_0 - Gray code [31:0] */ -#define SYSCON_GRAY_CODE_LSB_code_gray_31_0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GRAY_CODE_LSB_code_gray_31_0_SHIFT)) & SYSCON_GRAY_CODE_LSB_code_gray_31_0_MASK) -/*! @} */ - -/*! @name GRAY_CODE_MSB - Gray to Binary Converter Gray Code [41:32] */ -/*! @{ */ - -#define SYSCON_GRAY_CODE_MSB_code_gray_41_32_MASK (0x3FFU) -#define SYSCON_GRAY_CODE_MSB_code_gray_41_32_SHIFT (0U) -/*! code_gray_41_32 - Gray code [41:32] */ -#define SYSCON_GRAY_CODE_MSB_code_gray_41_32(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GRAY_CODE_MSB_code_gray_41_32_SHIFT)) & SYSCON_GRAY_CODE_MSB_code_gray_41_32_MASK) -/*! @} */ - -/*! @name BINARY_CODE_LSB - Gray to Binary Converter Binary Code [31:0] */ -/*! @{ */ - -#define SYSCON_BINARY_CODE_LSB_code_bin_31_0_MASK (0xFFFFFFFFU) -#define SYSCON_BINARY_CODE_LSB_code_bin_31_0_SHIFT (0U) -/*! code_bin_31_0 - Binary code [31:0] */ -#define SYSCON_BINARY_CODE_LSB_code_bin_31_0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_BINARY_CODE_LSB_code_bin_31_0_SHIFT)) & SYSCON_BINARY_CODE_LSB_code_bin_31_0_MASK) -/*! @} */ - -/*! @name BINARY_CODE_MSB - Gray to Binary Converter Binary Code [41:32] */ -/*! @{ */ - -#define SYSCON_BINARY_CODE_MSB_code_bin_41_32_MASK (0x3FFU) -#define SYSCON_BINARY_CODE_MSB_code_bin_41_32_SHIFT (0U) -/*! code_bin_41_32 - Binary code [41:32] */ -#define SYSCON_BINARY_CODE_MSB_code_bin_41_32(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_BINARY_CODE_MSB_code_bin_41_32_SHIFT)) & SYSCON_BINARY_CODE_MSB_code_bin_41_32_MASK) -/*! @} */ - -/*! @name OVP_PAD_STATE - OVP_PAD_STATE */ -/*! @{ */ - -#define SYSCON_OVP_PAD_STATE_OVP_PAD_STATE_MASK (0xFFFFFFFFU) -#define SYSCON_OVP_PAD_STATE_OVP_PAD_STATE_SHIFT (0U) -/*! OVP_PAD_STATE - OVP_PAD_STATE */ -#define SYSCON_OVP_PAD_STATE_OVP_PAD_STATE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_OVP_PAD_STATE_OVP_PAD_STATE_SHIFT)) & SYSCON_OVP_PAD_STATE_OVP_PAD_STATE_MASK) -/*! @} */ - -/*! @name PROBE_STATE - PROBE_STATE */ -/*! @{ */ - -#define SYSCON_PROBE_STATE_PROBE_STATE_MASK (0xFFFFFFFFU) -#define SYSCON_PROBE_STATE_PROBE_STATE_SHIFT (0U) -/*! PROBE_STATE - PROBE_STATE */ -#define SYSCON_PROBE_STATE_PROBE_STATE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PROBE_STATE_PROBE_STATE_SHIFT)) & SYSCON_PROBE_STATE_PROBE_STATE_MASK) -/*! @} */ - -/*! @name FT_STATE_A - FT_STATE_A */ -/*! @{ */ - -#define SYSCON_FT_STATE_A_FT_STATE_A_MASK (0xFFFFFFFFU) -#define SYSCON_FT_STATE_A_FT_STATE_A_SHIFT (0U) -/*! FT_STATE_A - FT_STATE_A */ -#define SYSCON_FT_STATE_A_FT_STATE_A(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FT_STATE_A_FT_STATE_A_SHIFT)) & SYSCON_FT_STATE_A_FT_STATE_A_MASK) -/*! @} */ - -/*! @name ROP_STATE - ROP State Register */ -/*! @{ */ - -#define SYSCON_ROP_STATE_ROP_STATE_MASK (0xFFFFFFFFU) -#define SYSCON_ROP_STATE_ROP_STATE_SHIFT (0U) -/*! ROP_STATE - ROP state */ -#define SYSCON_ROP_STATE_ROP_STATE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ROP_STATE_ROP_STATE_SHIFT)) & SYSCON_ROP_STATE_ROP_STATE_MASK) -/*! @} */ - -/*! @name SRAM_XEN - RAM XEN Control */ -/*! @{ */ - -#define SYSCON_SRAM_XEN_RAMX0_XEN_MASK (0x1U) -#define SYSCON_SRAM_XEN_RAMX0_XEN_SHIFT (0U) -/*! RAMX0_XEN - RAMX0 Execute permission control. - * 0b1..Execute permission is enabled, R/W/X are enabled. - * 0b0..Execute permission is disabled, R/W are enabled. - */ -#define SYSCON_SRAM_XEN_RAMX0_XEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SRAM_XEN_RAMX0_XEN_SHIFT)) & SYSCON_SRAM_XEN_RAMX0_XEN_MASK) - -#define SYSCON_SRAM_XEN_RAMX1_XEN_MASK (0x2U) -#define SYSCON_SRAM_XEN_RAMX1_XEN_SHIFT (1U) -/*! RAMX1_XEN - RAMX1 Execute permission control. - * 0b1..Execute permission is enabled, R/W/X are enabled. - * 0b0..Execute permission is disabled, R/W are enabled. - */ -#define SYSCON_SRAM_XEN_RAMX1_XEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SRAM_XEN_RAMX1_XEN_SHIFT)) & SYSCON_SRAM_XEN_RAMX1_XEN_MASK) - -#define SYSCON_SRAM_XEN_RAMA0_XEN_MASK (0x4U) -#define SYSCON_SRAM_XEN_RAMA0_XEN_SHIFT (2U) -/*! RAMA0_XEN - RAMA0 Execute permission control. - * 0b1..Execute permission is enabled, R/W/X are enabled. - * 0b0..Execute permission is disabled, R/W are enabled. - */ -#define SYSCON_SRAM_XEN_RAMA0_XEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SRAM_XEN_RAMA0_XEN_SHIFT)) & SYSCON_SRAM_XEN_RAMA0_XEN_MASK) - -#define SYSCON_SRAM_XEN_RAMA1_XEN_MASK (0x8U) -#define SYSCON_SRAM_XEN_RAMA1_XEN_SHIFT (3U) -/*! RAMA1_XEN - RAMAx (excepts RAMA0) Execute permission control. - * 0b1..Execute permission is enabled, R/W/X are enabled. - * 0b0..Execute permission is disabled, R/W are enabled. - */ -#define SYSCON_SRAM_XEN_RAMA1_XEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SRAM_XEN_RAMA1_XEN_SHIFT)) & SYSCON_SRAM_XEN_RAMA1_XEN_MASK) - -#define SYSCON_SRAM_XEN_LOCK_MASK (0x80000000U) -#define SYSCON_SRAM_XEN_LOCK_SHIFT (31U) -/*! LOCK - This 1-bit field provides a mechanism to limit writes to the this register (and - * SRAM_XEN_DP) to protect its contents. Once set, this bit remains asserted until the next reset. - * 0b0..This register is not locked and can be altered. - * 0b1..This register is locked and cannot be altered. - */ -#define SYSCON_SRAM_XEN_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SRAM_XEN_LOCK_SHIFT)) & SYSCON_SRAM_XEN_LOCK_MASK) -/*! @} */ - -/*! @name SRAM_XEN_DP - RAM XEN Control (Duplicate) */ -/*! @{ */ - -#define SYSCON_SRAM_XEN_DP_RAMX0_XEN_MASK (0x1U) -#define SYSCON_SRAM_XEN_DP_RAMX0_XEN_SHIFT (0U) -/*! RAMX0_XEN - Refer to SRAM_XEN for more details. */ -#define SYSCON_SRAM_XEN_DP_RAMX0_XEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SRAM_XEN_DP_RAMX0_XEN_SHIFT)) & SYSCON_SRAM_XEN_DP_RAMX0_XEN_MASK) - -#define SYSCON_SRAM_XEN_DP_RAMX1_XEN_MASK (0x2U) -#define SYSCON_SRAM_XEN_DP_RAMX1_XEN_SHIFT (1U) -/*! RAMX1_XEN - Refer to SRAM_XEN for more details. */ -#define SYSCON_SRAM_XEN_DP_RAMX1_XEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SRAM_XEN_DP_RAMX1_XEN_SHIFT)) & SYSCON_SRAM_XEN_DP_RAMX1_XEN_MASK) - -#define SYSCON_SRAM_XEN_DP_RAMA0_XEN_MASK (0x4U) -#define SYSCON_SRAM_XEN_DP_RAMA0_XEN_SHIFT (2U) -/*! RAMA0_XEN - Refer to SRAM_XEN for more details. */ -#define SYSCON_SRAM_XEN_DP_RAMA0_XEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SRAM_XEN_DP_RAMA0_XEN_SHIFT)) & SYSCON_SRAM_XEN_DP_RAMA0_XEN_MASK) - -#define SYSCON_SRAM_XEN_DP_RAMA1_XEN_MASK (0x8U) -#define SYSCON_SRAM_XEN_DP_RAMA1_XEN_SHIFT (3U) -/*! RAMA1_XEN - Refer to SRAM_XEN for more details. */ -#define SYSCON_SRAM_XEN_DP_RAMA1_XEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SRAM_XEN_DP_RAMA1_XEN_SHIFT)) & SYSCON_SRAM_XEN_DP_RAMA1_XEN_MASK) -/*! @} */ - -/*! @name ELS_OTP_LC_STATE - Life Cycle State Register */ -/*! @{ */ - -#define SYSCON_ELS_OTP_LC_STATE_OTP_LC_STATE_MASK (0xFFU) -#define SYSCON_ELS_OTP_LC_STATE_OTP_LC_STATE_SHIFT (0U) -/*! OTP_LC_STATE - OTP life cycle state */ -#define SYSCON_ELS_OTP_LC_STATE_OTP_LC_STATE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_OTP_LC_STATE_OTP_LC_STATE_SHIFT)) & SYSCON_ELS_OTP_LC_STATE_OTP_LC_STATE_MASK) -/*! @} */ - -/*! @name ELS_OTP_LC_STATE_DP - Life Cycle State Register (Duplicate) */ -/*! @{ */ - -#define SYSCON_ELS_OTP_LC_STATE_DP_OTP_LC_STATE_DP_MASK (0xFFU) -#define SYSCON_ELS_OTP_LC_STATE_DP_OTP_LC_STATE_DP_SHIFT (0U) -/*! OTP_LC_STATE_DP - OTP life cycle state */ -#define SYSCON_ELS_OTP_LC_STATE_DP_OTP_LC_STATE_DP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_OTP_LC_STATE_DP_OTP_LC_STATE_DP_SHIFT)) & SYSCON_ELS_OTP_LC_STATE_DP_OTP_LC_STATE_DP_MASK) -/*! @} */ - -/*! @name DEBUG_LOCK_EN - Control Write Access to Security */ -/*! @{ */ - -#define SYSCON_DEBUG_LOCK_EN_LOCK_ALL_MASK (0xFU) -#define SYSCON_DEBUG_LOCK_EN_LOCK_ALL_SHIFT (0U) -/*! LOCK_ALL - Controls write access to the security registers - * 0b1010..Enables write access to all registers - * 0b0000..Any other value than b1010: disables write access to all registers - */ -#define SYSCON_DEBUG_LOCK_EN_LOCK_ALL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_LOCK_EN_LOCK_ALL_SHIFT)) & SYSCON_DEBUG_LOCK_EN_LOCK_ALL_MASK) -/*! @} */ - -/*! @name DEBUG_FEATURES - Cortex Debug Features Control */ -/*! @{ */ - -#define SYSCON_DEBUG_FEATURES_CPU0_DBGEN_MASK (0x3U) -#define SYSCON_DEBUG_FEATURES_CPU0_DBGEN_SHIFT (0U) -/*! CPU0_DBGEN - CPU0 invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_CPU0_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_CPU0_DBGEN_SHIFT)) & SYSCON_DEBUG_FEATURES_CPU0_DBGEN_MASK) - -#define SYSCON_DEBUG_FEATURES_CPU0_NIDEN_MASK (0xCU) -#define SYSCON_DEBUG_FEATURES_CPU0_NIDEN_SHIFT (2U) -/*! CPU0_NIDEN - CPU0 non-invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_CPU0_NIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_CPU0_NIDEN_SHIFT)) & SYSCON_DEBUG_FEATURES_CPU0_NIDEN_MASK) -/*! @} */ - -/*! @name DEBUG_FEATURES_DP - Cortex Debug Features Control (Duplicate) */ -/*! @{ */ - -#define SYSCON_DEBUG_FEATURES_DP_CPU0_DBGEN_MASK (0x3U) -#define SYSCON_DEBUG_FEATURES_DP_CPU0_DBGEN_SHIFT (0U) -/*! CPU0_DBGEN - CPU0 invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_DP_CPU0_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_DP_CPU0_DBGEN_SHIFT)) & SYSCON_DEBUG_FEATURES_DP_CPU0_DBGEN_MASK) - -#define SYSCON_DEBUG_FEATURES_DP_CPU0_NIDEN_MASK (0xCU) -#define SYSCON_DEBUG_FEATURES_DP_CPU0_NIDEN_SHIFT (2U) -/*! CPU0_NIDEN - CPU0 non-invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_DP_CPU0_NIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_DP_CPU0_NIDEN_SHIFT)) & SYSCON_DEBUG_FEATURES_DP_CPU0_NIDEN_MASK) -/*! @} */ - -/*! @name SWD_ACCESS_CPU0 - CPU0 Software Debug Access */ -/*! @{ */ - -#define SYSCON_SWD_ACCESS_CPU0_SEC_CODE_MASK (0xFFFFFFFFU) -#define SYSCON_SWD_ACCESS_CPU0_SEC_CODE_SHIFT (0U) -/*! SEC_CODE - CPU0 SWD-AP: 0x12345678 - * 0b00010010001101000101011001111000..Value to write to enable CPU0 SWD access. Reading back register is read as 0xA. - * 0b00000000000000000000000000000000..CPU0 DAP is not allowed. Reading back register is read as 0x5. - */ -#define SYSCON_SWD_ACCESS_CPU0_SEC_CODE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SWD_ACCESS_CPU0_SEC_CODE_SHIFT)) & SYSCON_SWD_ACCESS_CPU0_SEC_CODE_MASK) -/*! @} */ - -/*! @name DEBUG_AUTH_BEACON - Debug Authentication BEACON */ -/*! @{ */ - -#define SYSCON_DEBUG_AUTH_BEACON_BEACON_MASK (0xFFFFFFFFU) -#define SYSCON_DEBUG_AUTH_BEACON_BEACON_SHIFT (0U) -/*! BEACON - Sets by the debug authentication code in ROM to pass the debug beacons (Credential - * Beacon and Authentication Beacon) to the application code. - */ -#define SYSCON_DEBUG_AUTH_BEACON_BEACON(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_AUTH_BEACON_BEACON_SHIFT)) & SYSCON_DEBUG_AUTH_BEACON_BEACON_MASK) -/*! @} */ - -/*! @name JTAG_ID - JTAG Chip ID */ -/*! @{ */ - -#define SYSCON_JTAG_ID_JTAG_ID_MASK (0xFFFFFFFFU) -#define SYSCON_JTAG_ID_JTAG_ID_SHIFT (0U) -/*! JTAG_ID - Indicates the device ID */ -#define SYSCON_JTAG_ID_JTAG_ID(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_JTAG_ID_JTAG_ID_SHIFT)) & SYSCON_JTAG_ID_JTAG_ID_MASK) -/*! @} */ - -/*! @name DEVICE_TYPE - Device Type */ -/*! @{ */ - -#define SYSCON_DEVICE_TYPE_DEVICE_TYPE_MASK (0xFFFFFFFFU) -#define SYSCON_DEVICE_TYPE_DEVICE_TYPE_SHIFT (0U) -/*! DEVICE_TYPE - Indicates DEVICE TYPE. */ -#define SYSCON_DEVICE_TYPE_DEVICE_TYPE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEVICE_TYPE_DEVICE_TYPE_SHIFT)) & SYSCON_DEVICE_TYPE_DEVICE_TYPE_MASK) -/*! @} */ - -/*! @name DEVICE_ID0 - Device ID */ -/*! @{ */ - -#define SYSCON_DEVICE_ID0_ROM_REV_MINOR_MASK (0xF00000U) -#define SYSCON_DEVICE_ID0_ROM_REV_MINOR_SHIFT (20U) -/*! ROM_REV_MINOR - ROM revision. */ -#define SYSCON_DEVICE_ID0_ROM_REV_MINOR(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEVICE_ID0_ROM_REV_MINOR_SHIFT)) & SYSCON_DEVICE_ID0_ROM_REV_MINOR_MASK) -/*! @} */ - -/*! @name DIEID - Chip Revision ID and Number */ -/*! @{ */ - -#define SYSCON_DIEID_MINOR_REVISION_MASK (0xFU) -#define SYSCON_DIEID_MINOR_REVISION_SHIFT (0U) -/*! MINOR_REVISION - Chip minor revision */ -#define SYSCON_DIEID_MINOR_REVISION(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DIEID_MINOR_REVISION_SHIFT)) & SYSCON_DIEID_MINOR_REVISION_MASK) - -#define SYSCON_DIEID_MAJOR_REVISION_MASK (0xF0U) -#define SYSCON_DIEID_MAJOR_REVISION_SHIFT (4U) -/*! MAJOR_REVISION - Chip major revision */ -#define SYSCON_DIEID_MAJOR_REVISION(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DIEID_MAJOR_REVISION_SHIFT)) & SYSCON_DIEID_MAJOR_REVISION_MASK) - -#define SYSCON_DIEID_MCO_NUM_IN_DIE_ID_MASK (0xFFFFF00U) -#define SYSCON_DIEID_MCO_NUM_IN_DIE_ID_SHIFT (8U) -/*! MCO_NUM_IN_DIE_ID - Chip number */ -#define SYSCON_DIEID_MCO_NUM_IN_DIE_ID(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DIEID_MCO_NUM_IN_DIE_ID_SHIFT)) & SYSCON_DIEID_MCO_NUM_IN_DIE_ID_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group SYSCON_Register_Masks */ - - -/* SYSCON - Peripheral instance base addresses */ -/** Peripheral SYSCON base address */ -#define SYSCON_BASE (0x40091000u) -/** Peripheral SYSCON base pointer */ -#define SYSCON ((SYSCON_Type *)SYSCON_BASE) -/** Array initializer of SYSCON peripheral base addresses */ -#define SYSCON_BASE_ADDRS { SYSCON_BASE } -/** Array initializer of SYSCON peripheral base pointers */ -#define SYSCON_BASE_PTRS { SYSCON } - -/*! - * @} - */ /* end of group SYSCON_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- TRDC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup TRDC_Peripheral_Access_Layer TRDC Peripheral Access Layer - * @{ - */ - -/** TRDC - Register Layout Typedef */ -typedef struct { - struct { /* offset: 0x0, array step: 0x1CC */ - __IO uint32_t MBC_MEM_GLBCFG[4]; /**< MBC Global Configuration Register, array offset: 0x0, array step: index*0x1CC, index2*0x4 */ - __IO uint32_t MBC_NSE_BLK_INDEX; /**< MBC NonSecure Enable Block Index, array offset: 0x10, array step: 0x1CC */ - __O uint32_t MBC_NSE_BLK_SET; /**< MBC NonSecure Enable Block Set, array offset: 0x14, array step: 0x1CC */ - __O uint32_t MBC_NSE_BLK_CLR; /**< MBC NonSecure Enable Block Clear, array offset: 0x18, array step: 0x1CC */ - __O uint32_t MBC_NSE_BLK_CLR_ALL; /**< MBC NonSecure Enable Block Clear All, array offset: 0x1C, array step: 0x1CC */ - __IO uint32_t MBC_MEMN_GLBAC[8]; /**< MBC Global Access Control, array offset: 0x20, array step: index*0x1CC, index2*0x4 */ - __IO uint32_t MBC_DOM0_MEM0_BLK_CFG_W[2]; /**< MBC Memory Block Configuration Word, array offset: 0x40, array step: index*0x1CC, index2*0x4 */ - uint8_t RESERVED_0[248]; - __IO uint32_t MBC_DOM0_MEM0_BLK_NSE_W[1]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x140, array step: index*0x1CC, index2*0x4 */ - uint8_t RESERVED_1[60]; - __IO uint32_t MBC_DOM0_MEM1_BLK_CFG_W[1]; /**< MBC Memory Block Configuration Word, array offset: 0x180, array step: index*0x1CC, index2*0x4 */ - uint8_t RESERVED_2[28]; - __IO uint32_t MBC_DOM0_MEM1_BLK_NSE_W[1]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x1A0, array step: index*0x1CC, index2*0x4 */ - uint8_t RESERVED_3[4]; - __IO uint32_t MBC_DOM0_MEM2_BLK_CFG_W[1]; /**< MBC Memory Block Configuration Word, array offset: 0x1A8, array step: index*0x1CC, index2*0x4 */ - uint8_t RESERVED_4[28]; - __IO uint32_t MBC_DOM0_MEM2_BLK_NSE_W[1]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x1C8, array step: index*0x1CC, index2*0x4 */ - } MBC_INDEX[1]; -} TRDC_Type; - -/* ---------------------------------------------------------------------------- - -- TRDC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup TRDC_Register_Masks TRDC Register Masks - * @{ - */ - -/*! @name MBC_INDEX_MBC_MEM_GLBCFG - MBC Global Configuration Register */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_NBLKS_MASK (0x3FFU) -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_NBLKS_SHIFT (0U) -/*! NBLKS - Number of blocks in this memory */ -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_NBLKS(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEM_GLBCFG_NBLKS_SHIFT)) & TRDC_MBC_INDEX_MBC_MEM_GLBCFG_NBLKS_MASK) - -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_SIZE_LOG2_MASK (0x1F0000U) -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_SIZE_LOG2_SHIFT (16U) -/*! SIZE_LOG2 - Log2 size per block */ -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_SIZE_LOG2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEM_GLBCFG_SIZE_LOG2_SHIFT)) & TRDC_MBC_INDEX_MBC_MEM_GLBCFG_SIZE_LOG2_MASK) - -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_CLRE_MASK (0xC0000000U) -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_CLRE_SHIFT (30U) -/*! CLRE - Clear Error */ -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_CLRE(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEM_GLBCFG_CLRE_SHIFT)) & TRDC_MBC_INDEX_MBC_MEM_GLBCFG_CLRE_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_MEM_GLBCFG */ -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_MEM_GLBCFG */ -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_COUNT2 (4U) - -/*! @name MBC_INDEX_MBC_NSE_BLK_INDEX - MBC NonSecure Enable Block Index */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_WNDX_MASK (0x3CU) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_WNDX_SHIFT (2U) -/*! WNDX - Word index into the block NSE bitmap. It selects the BLK_NSE_Wn register, where WNDX determines the value of n. */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_WNDX(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_WNDX_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_WNDX_MASK) - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_MEM_SEL_MASK (0xF00U) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_MEM_SEL_SHIFT (8U) -/*! MEM_SEL - Memory Select */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_MEM_SEL(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_MEM_SEL_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_MEM_SEL_MASK) - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_DID_SEL0_MASK (0x10000U) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_DID_SEL0_SHIFT (16U) -/*! DID_SEL0 - DID Select - * 0b0..No effect. - * 0b1..Selects NSE bits for this domain. - */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_DID_SEL0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_DID_SEL0_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_DID_SEL0_MASK) - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_AI_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_AI_SHIFT (31U) -/*! AI - Auto Increment - * 0b0..No effect. - * 0b1..Add 1 to the WNDX field after the register write. - */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_AI(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_AI_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_AI_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_COUNT (1U) - -/*! @name MBC_INDEX_MBC_NSE_BLK_SET - MBC NonSecure Enable Block Set */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_SET_W1SET_MASK (0xFFFFFFFFU) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_SET_W1SET_SHIFT (0U) -/*! W1SET - Write-1 Set */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_SET_W1SET(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_SET_W1SET_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_SET_W1SET_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_NSE_BLK_SET */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_SET_COUNT (1U) - -/*! @name MBC_INDEX_MBC_NSE_BLK_CLR - MBC NonSecure Enable Block Clear */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_W1CLR_MASK (0xFFFFFFFFU) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_W1CLR_SHIFT (0U) -/*! W1CLR - Write-1 Clear */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_W1CLR(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_W1CLR_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_W1CLR_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_NSE_BLK_CLR */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_COUNT (1U) - -/*! @name MBC_INDEX_MBC_NSE_BLK_CLR_ALL - MBC NonSecure Enable Block Clear All */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_MEMSEL_MASK (0xF00U) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_MEMSEL_SHIFT (8U) -/*! MEMSEL - Memory Select */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_MEMSEL(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_MEMSEL_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_MEMSEL_MASK) - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_DID_SEL0_MASK (0x10000U) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_DID_SEL0_SHIFT (16U) -/*! DID_SEL0 - DID Select - * 0b0..No effect. - * 0b1..Clear all NSE bits for this domain. - */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_DID_SEL0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_DID_SEL0_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_DID_SEL0_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_COUNT (1U) - -/*! @name MBC_INDEX_MBC_MEMN_GLBAC - MBC Global Access Control */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUX_MASK (0x1U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUX_SHIFT (0U) -/*! NUX - NonsecureUser Execute - * 0b0..Execute access is not allowed in Nonsecure User mode. - * 0b1..Execute access is allowed in Nonsecure User mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUX(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUX_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUX_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUW_MASK (0x2U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUW_SHIFT (1U) -/*! NUW - NonsecureUser Write - * 0b0..Write access is not allowed in Nonsecure User mode. - * 0b1..Write access is allowed in Nonsecure User mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUW(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUW_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUW_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUR_MASK (0x4U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUR_SHIFT (2U) -/*! NUR - NonsecureUser Read - * 0b0..Read access is not allowed in Nonsecure User mode. - * 0b1..Read access is allowed in Nonsecure User mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUR(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUR_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUR_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPX_MASK (0x10U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPX_SHIFT (4U) -/*! NPX - NonsecurePriv Execute - * 0b0..Execute access is not allowed in Nonsecure Privilege mode. - * 0b1..Execute access is allowed in Nonsecure Privilege mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPX(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPX_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPX_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPW_MASK (0x20U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPW_SHIFT (5U) -/*! NPW - NonsecurePriv Write - * 0b0..Write access is not allowed in Nonsecure Privilege mode. - * 0b1..Write access is allowed in Nonsecure Privilege mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPW(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPW_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPW_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPR_MASK (0x40U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPR_SHIFT (6U) -/*! NPR - NonsecurePriv Read - * 0b0..Read access is not allowed in Nonsecure Privilege mode. - * 0b1..Read access is allowed in Nonsecure Privilege mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPR(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPR_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPR_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUX_MASK (0x100U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUX_SHIFT (8U) -/*! SUX - SecureUser Execute - * 0b0..Execute access is not allowed in Secure User mode. - * 0b1..Execute access is allowed in Secure User mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUX(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUX_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUX_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUW_MASK (0x200U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUW_SHIFT (9U) -/*! SUW - SecureUser Write - * 0b0..Write access is not allowed in Secure User mode. - * 0b1..Write access is allowed in Secure User mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUW(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUW_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUW_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUR_MASK (0x400U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUR_SHIFT (10U) -/*! SUR - SecureUser Read - * 0b0..Read access is not allowed in Secure User mode. - * 0b1..Read access is allowed in Secure User mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUR(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUR_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUR_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPX_MASK (0x1000U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPX_SHIFT (12U) -/*! SPX - SecurePriv Execute - * 0b0..Execute access is not allowed in Secure Privilege mode. - * 0b1..Execute access is allowed in Secure Privilege mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPX(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPX_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPX_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPW_MASK (0x2000U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPW_SHIFT (13U) -/*! SPW - SecurePriv Write - * 0b0..Write access is not allowed in Secure Privilege mode. - * 0b1..Write access is allowed in Secure Privilege mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPW(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPW_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPW_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPR_MASK (0x4000U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPR_SHIFT (14U) -/*! SPR - SecurePriv Read - * 0b0..Read access is not allowed in Secure Privilege mode. - * 0b1..Read access is allowed in Secure Privilege mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPR(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPR_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPR_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_LK_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_LK_SHIFT (31U) -/*! LK - LOCK - * 0b0..This register is not locked and can be altered. - * 0b1..This register is locked and cannot be altered. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_LK(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_LK_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_LK_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_MEMN_GLBAC */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_MEMN_GLBAC */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_COUNT2 (8U) - -/*! @name MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W - MBC Memory Block Configuration Word */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL0_MASK (0x7U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL0_SHIFT (0U) -/*! MBACSEL0 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE0_MASK (0x8U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE0_SHIFT (3U) -/*! NSE0 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL1_MASK (0x70U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL1_SHIFT (4U) -/*! MBACSEL1 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE1_MASK (0x80U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE1_SHIFT (7U) -/*! NSE1 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL2_MASK (0x700U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL2_SHIFT (8U) -/*! MBACSEL2 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE2_MASK (0x800U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE2_SHIFT (11U) -/*! NSE2 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL3_MASK (0x7000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL3_SHIFT (12U) -/*! MBACSEL3 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE3_MASK (0x8000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE3_SHIFT (15U) -/*! NSE3 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL4_MASK (0x70000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL4_SHIFT (16U) -/*! MBACSEL4 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE4_MASK (0x80000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE4_SHIFT (19U) -/*! NSE4 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL5_MASK (0x700000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL5_SHIFT (20U) -/*! MBACSEL5 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE5_MASK (0x800000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE5_SHIFT (23U) -/*! NSE5 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL6_MASK (0x7000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL6_SHIFT (24U) -/*! MBACSEL6 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE6_MASK (0x8000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE6_SHIFT (27U) -/*! NSE6 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL7_MASK (0x70000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL7_SHIFT (28U) -/*! MBACSEL7 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL7_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE7_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE7_SHIFT (31U) -/*! NSE7 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE7_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_COUNT2 (2U) - -/*! @name MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W - MBC Memory Block NonSecure Enable Word */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT0_MASK (0x1U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT0_SHIFT (0U) -/*! BIT0 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT1_MASK (0x2U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT1_SHIFT (1U) -/*! BIT1 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT2_MASK (0x4U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT2_SHIFT (2U) -/*! BIT2 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT3_MASK (0x8U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT3_SHIFT (3U) -/*! BIT3 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT4_MASK (0x10U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT4_SHIFT (4U) -/*! BIT4 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT5_MASK (0x20U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT5_SHIFT (5U) -/*! BIT5 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT6_MASK (0x40U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT6_SHIFT (6U) -/*! BIT6 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT7_MASK (0x80U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT7_SHIFT (7U) -/*! BIT7 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT7_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT8_MASK (0x100U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT8_SHIFT (8U) -/*! BIT8 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT8(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT8_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT8_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT9_MASK (0x200U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT9_SHIFT (9U) -/*! BIT9 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT9(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT9_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT9_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT10_MASK (0x400U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT10_SHIFT (10U) -/*! BIT10 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT10(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT10_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT10_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT11_MASK (0x800U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT11_SHIFT (11U) -/*! BIT11 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT11(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT11_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT11_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT12_MASK (0x1000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT12_SHIFT (12U) -/*! BIT12 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT12(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT12_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT12_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT13_MASK (0x2000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT13_SHIFT (13U) -/*! BIT13 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT13(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT13_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT13_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT14_MASK (0x4000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT14_SHIFT (14U) -/*! BIT14 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT14(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT14_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT14_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT15_MASK (0x8000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT15_SHIFT (15U) -/*! BIT15 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT15(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT15_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT15_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT16_MASK (0x10000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT16_SHIFT (16U) -/*! BIT16 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT16(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT16_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT16_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT17_MASK (0x20000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT17_SHIFT (17U) -/*! BIT17 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT17(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT17_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT17_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT18_MASK (0x40000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT18_SHIFT (18U) -/*! BIT18 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT18(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT18_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT18_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT19_MASK (0x80000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT19_SHIFT (19U) -/*! BIT19 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT19(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT19_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT19_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT20_MASK (0x100000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT20_SHIFT (20U) -/*! BIT20 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT20(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT20_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT20_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT21_MASK (0x200000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT21_SHIFT (21U) -/*! BIT21 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT21(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT21_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT21_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT22_MASK (0x400000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT22_SHIFT (22U) -/*! BIT22 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT22(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT22_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT22_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT23_MASK (0x800000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT23_SHIFT (23U) -/*! BIT23 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT23(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT23_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT23_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT24_MASK (0x1000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT24_SHIFT (24U) -/*! BIT24 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT24(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT24_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT24_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT25_MASK (0x2000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT25_SHIFT (25U) -/*! BIT25 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT25(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT25_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT25_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT26_MASK (0x4000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT26_SHIFT (26U) -/*! BIT26 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT26(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT26_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT26_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT27_MASK (0x8000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT27_SHIFT (27U) -/*! BIT27 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT27(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT27_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT27_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT28_MASK (0x10000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT28_SHIFT (28U) -/*! BIT28 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT28(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT28_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT28_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT29_MASK (0x20000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT29_SHIFT (29U) -/*! BIT29 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT29(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT29_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT29_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT30_MASK (0x40000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT30_SHIFT (30U) -/*! BIT30 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT30(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT30_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT30_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT31_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT31_SHIFT (31U) -/*! BIT31 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT31(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT31_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT31_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_COUNT2 (1U) - -/*! @name MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W - MBC Memory Block Configuration Word */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL0_MASK (0x7U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL0_SHIFT (0U) -/*! MBACSEL0 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE0_MASK (0x8U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE0_SHIFT (3U) -/*! NSE0 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL1_MASK (0x70U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL1_SHIFT (4U) -/*! MBACSEL1 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE1_MASK (0x80U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE1_SHIFT (7U) -/*! NSE1 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL2_MASK (0x700U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL2_SHIFT (8U) -/*! MBACSEL2 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE2_MASK (0x800U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE2_SHIFT (11U) -/*! NSE2 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL3_MASK (0x7000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL3_SHIFT (12U) -/*! MBACSEL3 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE3_MASK (0x8000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE3_SHIFT (15U) -/*! NSE3 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL4_MASK (0x70000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL4_SHIFT (16U) -/*! MBACSEL4 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE4_MASK (0x80000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE4_SHIFT (19U) -/*! NSE4 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL5_MASK (0x700000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL5_SHIFT (20U) -/*! MBACSEL5 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE5_MASK (0x800000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE5_SHIFT (23U) -/*! NSE5 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL6_MASK (0x7000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL6_SHIFT (24U) -/*! MBACSEL6 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE6_MASK (0x8000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE6_SHIFT (27U) -/*! NSE6 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL7_MASK (0x70000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL7_SHIFT (28U) -/*! MBACSEL7 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL7_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE7_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE7_SHIFT (31U) -/*! NSE7 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE7_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_COUNT2 (1U) - -/*! @name MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W - MBC Memory Block NonSecure Enable Word */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT0_MASK (0x1U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT0_SHIFT (0U) -/*! BIT0 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT1_MASK (0x2U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT1_SHIFT (1U) -/*! BIT1 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT2_MASK (0x4U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT2_SHIFT (2U) -/*! BIT2 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT3_MASK (0x8U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT3_SHIFT (3U) -/*! BIT3 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT4_MASK (0x10U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT4_SHIFT (4U) -/*! BIT4 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT5_MASK (0x20U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT5_SHIFT (5U) -/*! BIT5 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT6_MASK (0x40U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT6_SHIFT (6U) -/*! BIT6 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT7_MASK (0x80U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT7_SHIFT (7U) -/*! BIT7 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT7_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT8_MASK (0x100U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT8_SHIFT (8U) -/*! BIT8 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT8(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT8_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT8_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT9_MASK (0x200U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT9_SHIFT (9U) -/*! BIT9 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT9(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT9_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT9_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT10_MASK (0x400U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT10_SHIFT (10U) -/*! BIT10 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT10(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT10_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT10_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT11_MASK (0x800U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT11_SHIFT (11U) -/*! BIT11 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT11(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT11_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT11_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT12_MASK (0x1000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT12_SHIFT (12U) -/*! BIT12 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT12(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT12_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT12_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT13_MASK (0x2000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT13_SHIFT (13U) -/*! BIT13 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT13(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT13_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT13_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT14_MASK (0x4000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT14_SHIFT (14U) -/*! BIT14 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT14(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT14_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT14_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT15_MASK (0x8000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT15_SHIFT (15U) -/*! BIT15 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT15(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT15_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT15_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT16_MASK (0x10000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT16_SHIFT (16U) -/*! BIT16 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT16(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT16_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT16_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT17_MASK (0x20000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT17_SHIFT (17U) -/*! BIT17 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT17(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT17_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT17_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT18_MASK (0x40000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT18_SHIFT (18U) -/*! BIT18 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT18(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT18_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT18_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT19_MASK (0x80000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT19_SHIFT (19U) -/*! BIT19 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT19(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT19_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT19_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT20_MASK (0x100000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT20_SHIFT (20U) -/*! BIT20 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT20(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT20_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT20_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT21_MASK (0x200000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT21_SHIFT (21U) -/*! BIT21 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT21(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT21_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT21_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT22_MASK (0x400000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT22_SHIFT (22U) -/*! BIT22 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT22(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT22_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT22_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT23_MASK (0x800000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT23_SHIFT (23U) -/*! BIT23 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT23(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT23_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT23_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT24_MASK (0x1000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT24_SHIFT (24U) -/*! BIT24 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT24(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT24_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT24_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT25_MASK (0x2000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT25_SHIFT (25U) -/*! BIT25 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT25(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT25_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT25_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT26_MASK (0x4000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT26_SHIFT (26U) -/*! BIT26 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT26(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT26_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT26_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT27_MASK (0x8000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT27_SHIFT (27U) -/*! BIT27 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT27(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT27_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT27_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT28_MASK (0x10000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT28_SHIFT (28U) -/*! BIT28 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT28(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT28_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT28_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT29_MASK (0x20000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT29_SHIFT (29U) -/*! BIT29 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT29(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT29_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT29_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT30_MASK (0x40000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT30_SHIFT (30U) -/*! BIT30 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT30(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT30_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT30_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT31_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT31_SHIFT (31U) -/*! BIT31 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT31(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT31_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT31_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_COUNT2 (1U) - -/*! @name MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W - MBC Memory Block Configuration Word */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL0_MASK (0x7U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL0_SHIFT (0U) -/*! MBACSEL0 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE0_MASK (0x8U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE0_SHIFT (3U) -/*! NSE0 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL1_MASK (0x70U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL1_SHIFT (4U) -/*! MBACSEL1 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE1_MASK (0x80U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE1_SHIFT (7U) -/*! NSE1 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL2_MASK (0x700U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL2_SHIFT (8U) -/*! MBACSEL2 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE2_MASK (0x800U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE2_SHIFT (11U) -/*! NSE2 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL3_MASK (0x7000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL3_SHIFT (12U) -/*! MBACSEL3 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE3_MASK (0x8000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE3_SHIFT (15U) -/*! NSE3 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL4_MASK (0x70000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL4_SHIFT (16U) -/*! MBACSEL4 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE4_MASK (0x80000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE4_SHIFT (19U) -/*! NSE4 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL5_MASK (0x700000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL5_SHIFT (20U) -/*! MBACSEL5 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE5_MASK (0x800000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE5_SHIFT (23U) -/*! NSE5 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL6_MASK (0x7000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL6_SHIFT (24U) -/*! MBACSEL6 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE6_MASK (0x8000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE6_SHIFT (27U) -/*! NSE6 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL7_MASK (0x70000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL7_SHIFT (28U) -/*! MBACSEL7 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL7_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE7_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE7_SHIFT (31U) -/*! NSE7 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE7_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_COUNT2 (1U) - -/*! @name MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W - MBC Memory Block NonSecure Enable Word */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT0_MASK (0x1U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT0_SHIFT (0U) -/*! BIT0 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT1_MASK (0x2U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT1_SHIFT (1U) -/*! BIT1 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT2_MASK (0x4U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT2_SHIFT (2U) -/*! BIT2 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT3_MASK (0x8U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT3_SHIFT (3U) -/*! BIT3 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT4_MASK (0x10U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT4_SHIFT (4U) -/*! BIT4 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT5_MASK (0x20U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT5_SHIFT (5U) -/*! BIT5 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT6_MASK (0x40U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT6_SHIFT (6U) -/*! BIT6 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT7_MASK (0x80U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT7_SHIFT (7U) -/*! BIT7 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT7_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT8_MASK (0x100U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT8_SHIFT (8U) -/*! BIT8 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT8(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT8_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT8_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT9_MASK (0x200U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT9_SHIFT (9U) -/*! BIT9 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT9(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT9_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT9_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT10_MASK (0x400U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT10_SHIFT (10U) -/*! BIT10 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT10(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT10_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT10_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT11_MASK (0x800U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT11_SHIFT (11U) -/*! BIT11 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT11(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT11_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT11_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT12_MASK (0x1000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT12_SHIFT (12U) -/*! BIT12 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT12(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT12_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT12_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT13_MASK (0x2000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT13_SHIFT (13U) -/*! BIT13 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT13(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT13_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT13_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT14_MASK (0x4000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT14_SHIFT (14U) -/*! BIT14 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT14(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT14_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT14_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT15_MASK (0x8000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT15_SHIFT (15U) -/*! BIT15 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT15(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT15_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT15_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT16_MASK (0x10000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT16_SHIFT (16U) -/*! BIT16 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT16(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT16_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT16_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT17_MASK (0x20000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT17_SHIFT (17U) -/*! BIT17 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT17(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT17_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT17_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT18_MASK (0x40000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT18_SHIFT (18U) -/*! BIT18 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT18(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT18_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT18_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT19_MASK (0x80000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT19_SHIFT (19U) -/*! BIT19 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT19(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT19_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT19_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT20_MASK (0x100000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT20_SHIFT (20U) -/*! BIT20 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT20(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT20_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT20_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT21_MASK (0x200000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT21_SHIFT (21U) -/*! BIT21 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT21(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT21_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT21_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT22_MASK (0x400000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT22_SHIFT (22U) -/*! BIT22 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT22(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT22_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT22_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT23_MASK (0x800000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT23_SHIFT (23U) -/*! BIT23 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT23(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT23_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT23_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT24_MASK (0x1000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT24_SHIFT (24U) -/*! BIT24 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT24(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT24_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT24_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT25_MASK (0x2000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT25_SHIFT (25U) -/*! BIT25 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT25(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT25_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT25_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT26_MASK (0x4000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT26_SHIFT (26U) -/*! BIT26 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT26(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT26_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT26_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT27_MASK (0x8000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT27_SHIFT (27U) -/*! BIT27 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT27(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT27_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT27_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT28_MASK (0x10000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT28_SHIFT (28U) -/*! BIT28 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT28(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT28_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT28_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT29_MASK (0x20000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT29_SHIFT (29U) -/*! BIT29 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT29(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT29_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT29_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT30_MASK (0x40000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT30_SHIFT (30U) -/*! BIT30 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT30(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT30_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT30_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT31_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT31_SHIFT (31U) -/*! BIT31 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT31(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT31_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT31_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_COUNT2 (1U) - - -/*! - * @} - */ /* end of group TRDC_Register_Masks */ - - -/* TRDC - Peripheral instance base addresses */ -/** Peripheral MBC0 base address */ -#define MBC0_BASE (0x4008E000u) -/** Peripheral MBC0 base pointer */ -#define MBC0 ((TRDC_Type *)MBC0_BASE) -/** Array initializer of TRDC peripheral base addresses */ -#define TRDC_BASE_ADDRS { MBC0_BASE } -/** Array initializer of TRDC peripheral base pointers */ -#define TRDC_BASE_PTRS { MBC0 } -#define MBC0_MEMORY_CFG_WORD_COUNT {1,2,4,1} -#define MBC1_MEMORY_CFG_WORD_COUNT {1,1,1,1} -#define MBC2_MEMORY_CFG_WORD_COUNT {9,6,1,1} -#define MBC3_MEMORY_CFG_WORD_COUNT {3,0,0,0} -#define MBC_MEMORY_CFG_WORD_COUNT {MBC0_MEMORY_CFG_WORD_COUNT , MBC1_MEMORY_CFG_WORD_COUNT, MBC2_MEMORY_CFG_WORD_COUNT, MBC3_MEMORY_CFG_WORD_COUNT} -#define MBC0_MEMORY_NSE_WORD_COUNT {1,1,1,1} -#define MBC1_MEMORY_NSE_WORD_COUNT {1,1,1,1} -#define MBC2_MEMORY_NSE_WORD_COUNT {3,2,1,1} -#define MBC3_MEMORY_NSE_WORD_COUNT {1,0,0,0} -#define MBC_MEMORY_NSE_WORD_COUNT {MBC0_MEMORY_NSE_WORD_COUNT , MBC1_MEMORY_NSE_WORD_COUNT, MBC2_MEMORY_NSE_WORD_COUNT, MBC3_MEMORY_NSE_WORD_COUNT} - - -/*! - * @} - */ /* end of group TRDC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- USB Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USB_Peripheral_Access_Layer USB Peripheral Access Layer - * @{ - */ - -/** USB - Register Layout Typedef */ -typedef struct { - __I uint8_t PERID; /**< Peripheral ID, offset: 0x0 */ - uint8_t RESERVED_0[3]; - __I uint8_t IDCOMP; /**< Peripheral ID Complement, offset: 0x4 */ - uint8_t RESERVED_1[3]; - __I uint8_t REV; /**< Peripheral Revision, offset: 0x8 */ - uint8_t RESERVED_2[19]; - __IO uint8_t OTGCTL; /**< OTG Control, offset: 0x1C */ - uint8_t RESERVED_3[99]; - __IO uint8_t ISTAT; /**< Interrupt Status, offset: 0x80 */ - uint8_t RESERVED_4[3]; - __IO uint8_t INTEN; /**< Interrupt Enable, offset: 0x84 */ - uint8_t RESERVED_5[3]; - __IO uint8_t ERRSTAT; /**< Error Interrupt Status, offset: 0x88 */ - uint8_t RESERVED_6[3]; - __IO uint8_t ERREN; /**< Error Interrupt Enable, offset: 0x8C */ - uint8_t RESERVED_7[3]; - __I uint8_t STAT; /**< Status, offset: 0x90 */ - uint8_t RESERVED_8[3]; - __IO uint8_t CTL; /**< Control, offset: 0x94 */ - uint8_t RESERVED_9[3]; - __IO uint8_t ADDR; /**< Address, offset: 0x98 */ - uint8_t RESERVED_10[3]; - __IO uint8_t BDTPAGE1; /**< BDT Page 1, offset: 0x9C */ - uint8_t RESERVED_11[3]; - __I uint8_t FRMNUML; /**< Frame Number Register Low, offset: 0xA0 */ - uint8_t RESERVED_12[3]; - __I uint8_t FRMNUMH; /**< Frame Number Register High, offset: 0xA4 */ - uint8_t RESERVED_13[11]; - __IO uint8_t BDTPAGE2; /**< BDT Page 2, offset: 0xB0 */ - uint8_t RESERVED_14[3]; - __IO uint8_t BDTPAGE3; /**< BDT Page 3, offset: 0xB4 */ - uint8_t RESERVED_15[11]; - struct { /* offset: 0xC0, array step: 0x4 */ - __IO uint8_t ENDPT; /**< Endpoint Control, array offset: 0xC0, array step: 0x4 */ - uint8_t RESERVED_0[3]; - } ENDPOINT[16]; - __IO uint8_t USBCTRL; /**< USB Control, offset: 0x100 */ - uint8_t RESERVED_16[3]; - __I uint8_t OBSERVE; /**< USB OTG Observe, offset: 0x104 */ - uint8_t RESERVED_17[3]; - __IO uint8_t CONTROL; /**< USB OTG Control, offset: 0x108 */ - uint8_t RESERVED_18[3]; - __IO uint8_t USBTRC0; /**< USB Transceiver Control 0, offset: 0x10C */ - uint8_t RESERVED_19[23]; - uint8_t KEEP_ALIVE_CTRL_RSVD; /**< Reserved, offset: 0x124 */ - uint8_t RESERVED_20[3]; - uint8_t KEEP_ALIVE_WKCTRL_RSVD; /**< Reserved, offset: 0x128 */ - uint8_t RESERVED_21[3]; - __IO uint8_t MISCCTRL; /**< Miscellaneous Control, offset: 0x12C */ - uint8_t RESERVED_22[3]; - __IO uint8_t STALL_IL_DIS; /**< Peripheral Mode Stall Disable for Endpoints 7 to 0 in IN Direction, offset: 0x130 */ - uint8_t RESERVED_23[3]; - __IO uint8_t STALL_IH_DIS; /**< Peripheral Mode Stall Disable for Endpoints 15 to 8 in IN Direction, offset: 0x134 */ - uint8_t RESERVED_24[3]; - __IO uint8_t STALL_OL_DIS; /**< Peripheral Mode Stall Disable for Endpoints 7 to 0 in OUT Direction, offset: 0x138 */ - uint8_t RESERVED_25[3]; - __IO uint8_t STALL_OH_DIS; /**< Peripheral Mode Stall Disable for Endpoints 15 to 8 in OUT Direction, offset: 0x13C */ - uint8_t RESERVED_26[3]; - __IO uint8_t CLK_RECOVER_CTRL; /**< USB Clock Recovery Control, offset: 0x140 */ - uint8_t RESERVED_27[3]; - __IO uint8_t CLK_RECOVER_IRC_EN; /**< FIRC Oscillator Enable, offset: 0x144 */ - uint8_t RESERVED_28[15]; - __IO uint8_t CLK_RECOVER_INT_EN; /**< Clock Recovery Combined Interrupt Enable, offset: 0x154 */ - uint8_t RESERVED_29[7]; - __IO uint8_t CLK_RECOVER_INT_STATUS; /**< Clock Recovery Separated Interrupt Status, offset: 0x15C */ -} USB_Type; - -/* ---------------------------------------------------------------------------- - -- USB Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USB_Register_Masks USB Register Masks - * @{ - */ - -/*! @name PERID - Peripheral ID */ -/*! @{ */ - -#define USB_PERID_ID_MASK (0x3FU) -#define USB_PERID_ID_SHIFT (0U) -/*! ID - Peripheral Identification */ -#define USB_PERID_ID(x) (((uint8_t)(((uint8_t)(x)) << USB_PERID_ID_SHIFT)) & USB_PERID_ID_MASK) -/*! @} */ - -/*! @name IDCOMP - Peripheral ID Complement */ -/*! @{ */ - -#define USB_IDCOMP_NID_MASK (0x3FU) -#define USB_IDCOMP_NID_SHIFT (0U) -/*! NID - Negative Peripheral ID */ -#define USB_IDCOMP_NID(x) (((uint8_t)(((uint8_t)(x)) << USB_IDCOMP_NID_SHIFT)) & USB_IDCOMP_NID_MASK) -/*! @} */ - -/*! @name REV - Peripheral Revision */ -/*! @{ */ - -#define USB_REV_REV_MASK (0xFFU) -#define USB_REV_REV_SHIFT (0U) -/*! REV - Revision */ -#define USB_REV_REV(x) (((uint8_t)(((uint8_t)(x)) << USB_REV_REV_SHIFT)) & USB_REV_REV_MASK) -/*! @} */ - -/*! @name OTGCTL - OTG Control */ -/*! @{ */ - -#define USB_OTGCTL_DPHIGH_MASK (0x80U) -#define USB_OTGCTL_DPHIGH_SHIFT (7U) -/*! DPHIGH - D+ Data Line Pullup Resistor Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_OTGCTL_DPHIGH(x) (((uint8_t)(((uint8_t)(x)) << USB_OTGCTL_DPHIGH_SHIFT)) & USB_OTGCTL_DPHIGH_MASK) -/*! @} */ - -/*! @name ISTAT - Interrupt Status */ -/*! @{ */ - -#define USB_ISTAT_USBRST_MASK (0x1U) -#define USB_ISTAT_USBRST_SHIFT (0U) -/*! USBRST - USB Reset Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ISTAT_USBRST(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_USBRST_SHIFT)) & USB_ISTAT_USBRST_MASK) - -#define USB_ISTAT_ERROR_MASK (0x2U) -#define USB_ISTAT_ERROR_SHIFT (1U) -/*! ERROR - Error Flag - * 0b0..Error did not occur - * 0b1..Error occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ISTAT_ERROR(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_ERROR_SHIFT)) & USB_ISTAT_ERROR_MASK) - -#define USB_ISTAT_SOFTOK_MASK (0x4U) -#define USB_ISTAT_SOFTOK_SHIFT (2U) -/*! SOFTOK - Start Of Frame (SOF) Token Flag - * 0b0..Did not receive - * 0b1..Received - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ISTAT_SOFTOK(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_SOFTOK_SHIFT)) & USB_ISTAT_SOFTOK_MASK) - -#define USB_ISTAT_TOKDNE_MASK (0x8U) -#define USB_ISTAT_TOKDNE_SHIFT (3U) -/*! TOKDNE - Current Token Processing Flag - * 0b0..Not processed - * 0b1..Processed - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ISTAT_TOKDNE(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_TOKDNE_SHIFT)) & USB_ISTAT_TOKDNE_MASK) - -#define USB_ISTAT_SLEEP_MASK (0x10U) -#define USB_ISTAT_SLEEP_SHIFT (4U) -/*! SLEEP - Sleep Flag - * 0b0..Interrupt did not occur - * 0b1..Interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ISTAT_SLEEP(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_SLEEP_SHIFT)) & USB_ISTAT_SLEEP_MASK) - -#define USB_ISTAT_RESUME_MASK (0x20U) -#define USB_ISTAT_RESUME_SHIFT (5U) -/*! RESUME - Resume Flag - * 0b0..Interrupt did not occur - * 0b1..Interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ISTAT_RESUME(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_RESUME_SHIFT)) & USB_ISTAT_RESUME_MASK) - -#define USB_ISTAT_STALL_MASK (0x80U) -#define USB_ISTAT_STALL_SHIFT (7U) -/*! STALL - Stall Interrupt Flag - * 0b0..Interrupt did not occur - * 0b1..Interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ISTAT_STALL(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_STALL_SHIFT)) & USB_ISTAT_STALL_MASK) -/*! @} */ - -/*! @name INTEN - Interrupt Enable */ -/*! @{ */ - -#define USB_INTEN_USBRSTEN_MASK (0x1U) -#define USB_INTEN_USBRSTEN_SHIFT (0U) -/*! USBRSTEN - USBRST Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_INTEN_USBRSTEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_USBRSTEN_SHIFT)) & USB_INTEN_USBRSTEN_MASK) - -#define USB_INTEN_ERROREN_MASK (0x2U) -#define USB_INTEN_ERROREN_SHIFT (1U) -/*! ERROREN - ERROR Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_INTEN_ERROREN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_ERROREN_SHIFT)) & USB_INTEN_ERROREN_MASK) - -#define USB_INTEN_SOFTOKEN_MASK (0x4U) -#define USB_INTEN_SOFTOKEN_SHIFT (2U) -/*! SOFTOKEN - SOFTOK Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_INTEN_SOFTOKEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_SOFTOKEN_SHIFT)) & USB_INTEN_SOFTOKEN_MASK) - -#define USB_INTEN_TOKDNEEN_MASK (0x8U) -#define USB_INTEN_TOKDNEEN_SHIFT (3U) -/*! TOKDNEEN - TOKDNE Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_INTEN_TOKDNEEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_TOKDNEEN_SHIFT)) & USB_INTEN_TOKDNEEN_MASK) - -#define USB_INTEN_SLEEPEN_MASK (0x10U) -#define USB_INTEN_SLEEPEN_SHIFT (4U) -/*! SLEEPEN - SLEEP Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_INTEN_SLEEPEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_SLEEPEN_SHIFT)) & USB_INTEN_SLEEPEN_MASK) - -#define USB_INTEN_RESUMEEN_MASK (0x20U) -#define USB_INTEN_RESUMEEN_SHIFT (5U) -/*! RESUMEEN - RESUME Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_INTEN_RESUMEEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_RESUMEEN_SHIFT)) & USB_INTEN_RESUMEEN_MASK) - -#define USB_INTEN_STALLEN_MASK (0x80U) -#define USB_INTEN_STALLEN_SHIFT (7U) -/*! STALLEN - STALL Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_INTEN_STALLEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_STALLEN_SHIFT)) & USB_INTEN_STALLEN_MASK) -/*! @} */ - -/*! @name ERRSTAT - Error Interrupt Status */ -/*! @{ */ - -#define USB_ERRSTAT_PIDERR_MASK (0x1U) -#define USB_ERRSTAT_PIDERR_SHIFT (0U) -/*! PIDERR - PID Error Flag - * 0b0..Did not fail - * 0b1..Failed - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_PIDERR(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_PIDERR_SHIFT)) & USB_ERRSTAT_PIDERR_MASK) - -#define USB_ERRSTAT_CRC5EOF_MASK (0x2U) -#define USB_ERRSTAT_CRC5EOF_SHIFT (1U) -/*! CRC5EOF - CRC5 Error or End of Frame Error Flag - * 0b0..Interrupt did not occur - * 0b1..Interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_CRC5EOF(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_CRC5EOF_SHIFT)) & USB_ERRSTAT_CRC5EOF_MASK) - -#define USB_ERRSTAT_CRC16_MASK (0x4U) -#define USB_ERRSTAT_CRC16_SHIFT (2U) -/*! CRC16 - CRC16 Error Flag - * 0b0..Not rejected - * 0b1..Rejected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_CRC16(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_CRC16_SHIFT)) & USB_ERRSTAT_CRC16_MASK) - -#define USB_ERRSTAT_DFN8_MASK (0x8U) -#define USB_ERRSTAT_DFN8_SHIFT (3U) -/*! DFN8 - Data Field Not 8 Bits Flag - * 0b0..Integer number of bytes - * 0b1..Not an integer number of bytes - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_DFN8(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_DFN8_SHIFT)) & USB_ERRSTAT_DFN8_MASK) - -#define USB_ERRSTAT_BTOERR_MASK (0x10U) -#define USB_ERRSTAT_BTOERR_SHIFT (4U) -/*! BTOERR - Bus Turnaround Timeout Error Flag - * 0b0..Not timed out - * 0b1..Timed out - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_BTOERR(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_BTOERR_SHIFT)) & USB_ERRSTAT_BTOERR_MASK) - -#define USB_ERRSTAT_DMAERR_MASK (0x20U) -#define USB_ERRSTAT_DMAERR_SHIFT (5U) -/*! DMAERR - DMA Access Error Flag - * 0b0..Interrupt did not occur - * 0b1..Interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_DMAERR(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_DMAERR_SHIFT)) & USB_ERRSTAT_DMAERR_MASK) - -#define USB_ERRSTAT_OWNERR_MASK (0x40U) -#define USB_ERRSTAT_OWNERR_SHIFT (6U) -/*! OWNERR - BD Unavailable Error Flag - * 0b0..Interrupt did not occur - * 0b1..Interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_OWNERR(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_OWNERR_SHIFT)) & USB_ERRSTAT_OWNERR_MASK) - -#define USB_ERRSTAT_BTSERR_MASK (0x80U) -#define USB_ERRSTAT_BTSERR_SHIFT (7U) -/*! BTSERR - Bit Stuff Error Flag - * 0b0..Packet not rejected due to the error - * 0b1..Packet rejected due to the error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_BTSERR(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_BTSERR_SHIFT)) & USB_ERRSTAT_BTSERR_MASK) -/*! @} */ - -/*! @name ERREN - Error Interrupt Enable */ -/*! @{ */ - -#define USB_ERREN_PIDERREN_MASK (0x1U) -#define USB_ERREN_PIDERREN_SHIFT (0U) -/*! PIDERREN - PIDERR Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_PIDERREN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_PIDERREN_SHIFT)) & USB_ERREN_PIDERREN_MASK) - -#define USB_ERREN_CRC5EOFEN_MASK (0x2U) -#define USB_ERREN_CRC5EOFEN_SHIFT (1U) -/*! CRC5EOFEN - CRC5/EOF Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_CRC5EOFEN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_CRC5EOFEN_SHIFT)) & USB_ERREN_CRC5EOFEN_MASK) - -#define USB_ERREN_CRC16EN_MASK (0x4U) -#define USB_ERREN_CRC16EN_SHIFT (2U) -/*! CRC16EN - CRC16 Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_CRC16EN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_CRC16EN_SHIFT)) & USB_ERREN_CRC16EN_MASK) - -#define USB_ERREN_DFN8EN_MASK (0x8U) -#define USB_ERREN_DFN8EN_SHIFT (3U) -/*! DFN8EN - DFN8 (Data Field Not Integer Number of Bytes) Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_DFN8EN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_DFN8EN_SHIFT)) & USB_ERREN_DFN8EN_MASK) - -#define USB_ERREN_BTOERREN_MASK (0x10U) -#define USB_ERREN_BTOERREN_SHIFT (4U) -/*! BTOERREN - BTOERR (Bus Timeout Error) Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_BTOERREN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_BTOERREN_SHIFT)) & USB_ERREN_BTOERREN_MASK) - -#define USB_ERREN_DMAERREN_MASK (0x20U) -#define USB_ERREN_DMAERREN_SHIFT (5U) -/*! DMAERREN - DMAERR Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_DMAERREN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_DMAERREN_SHIFT)) & USB_ERREN_DMAERREN_MASK) - -#define USB_ERREN_OWNERREN_MASK (0x40U) -#define USB_ERREN_OWNERREN_SHIFT (6U) -/*! OWNERREN - OWNERR Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_OWNERREN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_OWNERREN_SHIFT)) & USB_ERREN_OWNERREN_MASK) - -#define USB_ERREN_BTSERREN_MASK (0x80U) -#define USB_ERREN_BTSERREN_SHIFT (7U) -/*! BTSERREN - BTSERR (Bit Stuff Error) Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_BTSERREN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_BTSERREN_SHIFT)) & USB_ERREN_BTSERREN_MASK) -/*! @} */ - -/*! @name STAT - Status */ -/*! @{ */ - -#define USB_STAT_ODD_MASK (0x4U) -#define USB_STAT_ODD_SHIFT (2U) -/*! ODD - Odd Bank - * 0b0..Not in the odd bank - * 0b1..In the odd bank - */ -#define USB_STAT_ODD(x) (((uint8_t)(((uint8_t)(x)) << USB_STAT_ODD_SHIFT)) & USB_STAT_ODD_MASK) - -#define USB_STAT_TX_MASK (0x8U) -#define USB_STAT_TX_SHIFT (3U) -/*! TX - Transmit Indicator - * 0b0..Receive - * 0b1..Transmit - */ -#define USB_STAT_TX(x) (((uint8_t)(((uint8_t)(x)) << USB_STAT_TX_SHIFT)) & USB_STAT_TX_MASK) - -#define USB_STAT_ENDP_MASK (0xF0U) -#define USB_STAT_ENDP_SHIFT (4U) -/*! ENDP - Endpoint address */ -#define USB_STAT_ENDP(x) (((uint8_t)(((uint8_t)(x)) << USB_STAT_ENDP_SHIFT)) & USB_STAT_ENDP_MASK) -/*! @} */ - -/*! @name CTL - Control */ -/*! @{ */ - -#define USB_CTL_USBENSOFEN_MASK (0x1U) -#define USB_CTL_USBENSOFEN_SHIFT (0U) -/*! USBENSOFEN - USB Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_CTL_USBENSOFEN(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_USBENSOFEN_SHIFT)) & USB_CTL_USBENSOFEN_MASK) - -#define USB_CTL_ODDRST_MASK (0x2U) -#define USB_CTL_ODDRST_SHIFT (1U) -/*! ODDRST - Odd Reset */ -#define USB_CTL_ODDRST(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_ODDRST_SHIFT)) & USB_CTL_ODDRST_MASK) - -#define USB_CTL_RESUME_MASK (0x4U) -#define USB_CTL_RESUME_SHIFT (2U) -/*! RESUME - Resume */ -#define USB_CTL_RESUME(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_RESUME_SHIFT)) & USB_CTL_RESUME_MASK) - -#define USB_CTL_TXSUSPENDTOKENBUSY_MASK (0x20U) -#define USB_CTL_TXSUSPENDTOKENBUSY_SHIFT (5U) -/*! TXSUSPENDTOKENBUSY - TXD Suspend And Token Busy */ -#define USB_CTL_TXSUSPENDTOKENBUSY(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_TXSUSPENDTOKENBUSY_SHIFT)) & USB_CTL_TXSUSPENDTOKENBUSY_MASK) - -#define USB_CTL_SE0_MASK (0x40U) -#define USB_CTL_SE0_SHIFT (6U) -/*! SE0 - Live USB Single-Ended Zero signal */ -#define USB_CTL_SE0(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_SE0_SHIFT)) & USB_CTL_SE0_MASK) -/*! @} */ - -/*! @name ADDR - Address */ -/*! @{ */ - -#define USB_ADDR_ADDR_MASK (0x7FU) -#define USB_ADDR_ADDR_SHIFT (0U) -/*! ADDR - USB Address */ -#define USB_ADDR_ADDR(x) (((uint8_t)(((uint8_t)(x)) << USB_ADDR_ADDR_SHIFT)) & USB_ADDR_ADDR_MASK) -/*! @} */ - -/*! @name BDTPAGE1 - BDT Page 1 */ -/*! @{ */ - -#define USB_BDTPAGE1_BDTBA_MASK (0xFEU) -#define USB_BDTPAGE1_BDTBA_SHIFT (1U) -/*! BDTBA - BDT Base Address */ -#define USB_BDTPAGE1_BDTBA(x) (((uint8_t)(((uint8_t)(x)) << USB_BDTPAGE1_BDTBA_SHIFT)) & USB_BDTPAGE1_BDTBA_MASK) -/*! @} */ - -/*! @name FRMNUML - Frame Number Register Low */ -/*! @{ */ - -#define USB_FRMNUML_FRM_MASK (0xFFU) -#define USB_FRMNUML_FRM_SHIFT (0U) -/*! FRM - Frame Number, Bits 0-7 */ -#define USB_FRMNUML_FRM(x) (((uint8_t)(((uint8_t)(x)) << USB_FRMNUML_FRM_SHIFT)) & USB_FRMNUML_FRM_MASK) -/*! @} */ - -/*! @name FRMNUMH - Frame Number Register High */ -/*! @{ */ - -#define USB_FRMNUMH_FRM_MASK (0x7U) -#define USB_FRMNUMH_FRM_SHIFT (0U) -/*! FRM - Frame Number, Bits 8-10 */ -#define USB_FRMNUMH_FRM(x) (((uint8_t)(((uint8_t)(x)) << USB_FRMNUMH_FRM_SHIFT)) & USB_FRMNUMH_FRM_MASK) -/*! @} */ - -/*! @name BDTPAGE2 - BDT Page 2 */ -/*! @{ */ - -#define USB_BDTPAGE2_BDTBA_MASK (0xFFU) -#define USB_BDTPAGE2_BDTBA_SHIFT (0U) -/*! BDTBA - BDT Base Address */ -#define USB_BDTPAGE2_BDTBA(x) (((uint8_t)(((uint8_t)(x)) << USB_BDTPAGE2_BDTBA_SHIFT)) & USB_BDTPAGE2_BDTBA_MASK) -/*! @} */ - -/*! @name BDTPAGE3 - BDT Page 3 */ -/*! @{ */ - -#define USB_BDTPAGE3_BDTBA_MASK (0xFFU) -#define USB_BDTPAGE3_BDTBA_SHIFT (0U) -/*! BDTBA - BDT Base Address */ -#define USB_BDTPAGE3_BDTBA(x) (((uint8_t)(((uint8_t)(x)) << USB_BDTPAGE3_BDTBA_SHIFT)) & USB_BDTPAGE3_BDTBA_MASK) -/*! @} */ - -/*! @name ENDPT - Endpoint Control */ -/*! @{ */ - -#define USB_ENDPT_EPHSHK_MASK (0x1U) -#define USB_ENDPT_EPHSHK_SHIFT (0U) -/*! EPHSHK - Endpoint Handshaking Enable */ -#define USB_ENDPT_EPHSHK(x) (((uint8_t)(((uint8_t)(x)) << USB_ENDPT_EPHSHK_SHIFT)) & USB_ENDPT_EPHSHK_MASK) - -#define USB_ENDPT_EPSTALL_MASK (0x2U) -#define USB_ENDPT_EPSTALL_SHIFT (1U) -/*! EPSTALL - Endpoint Stalled */ -#define USB_ENDPT_EPSTALL(x) (((uint8_t)(((uint8_t)(x)) << USB_ENDPT_EPSTALL_SHIFT)) & USB_ENDPT_EPSTALL_MASK) - -#define USB_ENDPT_EPTXEN_MASK (0x4U) -#define USB_ENDPT_EPTXEN_SHIFT (2U) -/*! EPTXEN - Endpoint for TX transfers enable */ -#define USB_ENDPT_EPTXEN(x) (((uint8_t)(((uint8_t)(x)) << USB_ENDPT_EPTXEN_SHIFT)) & USB_ENDPT_EPTXEN_MASK) - -#define USB_ENDPT_EPRXEN_MASK (0x8U) -#define USB_ENDPT_EPRXEN_SHIFT (3U) -/*! EPRXEN - Endpoint for RX transfers enable */ -#define USB_ENDPT_EPRXEN(x) (((uint8_t)(((uint8_t)(x)) << USB_ENDPT_EPRXEN_SHIFT)) & USB_ENDPT_EPRXEN_MASK) - -#define USB_ENDPT_EPCTLDIS_MASK (0x10U) -#define USB_ENDPT_EPCTLDIS_SHIFT (4U) -/*! EPCTLDIS - Control Transfer Disable - * 0b0..Enable - * 0b1..Disable - */ -#define USB_ENDPT_EPCTLDIS(x) (((uint8_t)(((uint8_t)(x)) << USB_ENDPT_EPCTLDIS_SHIFT)) & USB_ENDPT_EPCTLDIS_MASK) -/*! @} */ - -/* The count of USB_ENDPT */ -#define USB_ENDPT_COUNT (16U) - -/*! @name USBCTRL - USB Control */ -/*! @{ */ - -#define USB_USBCTRL_DPDM_LANE_REVERSE_MASK (0x4U) -#define USB_USBCTRL_DPDM_LANE_REVERSE_SHIFT (2U) -/*! DPDM_LANE_REVERSE - DP and DM Lane Reversal Control - * 0b0..Standard USB DP and DM package pin assignment - * 0b1..Reverse roles of USB DP and DM package pins - */ -#define USB_USBCTRL_DPDM_LANE_REVERSE(x) (((uint8_t)(((uint8_t)(x)) << USB_USBCTRL_DPDM_LANE_REVERSE_SHIFT)) & USB_USBCTRL_DPDM_LANE_REVERSE_MASK) - -#define USB_USBCTRL_UARTSEL_MASK (0x10U) -#define USB_USBCTRL_UARTSEL_SHIFT (4U) -/*! UARTSEL - UART Select - * 0b0..USB DP and DM external package pins are used for USB signaling. - * 0b1..USB DP and DM external package pins are used for UART signaling. - */ -#define USB_USBCTRL_UARTSEL(x) (((uint8_t)(((uint8_t)(x)) << USB_USBCTRL_UARTSEL_SHIFT)) & USB_USBCTRL_UARTSEL_MASK) - -#define USB_USBCTRL_UARTCHLS_MASK (0x20U) -#define USB_USBCTRL_UARTCHLS_SHIFT (5U) -/*! UARTCHLS - UART Signal Channel Select - * 0b0..USB DP and DM signals are used as UART TX/RX. - * 0b1..USB DP and DM signals are used as UART RX/TX. - */ -#define USB_USBCTRL_UARTCHLS(x) (((uint8_t)(((uint8_t)(x)) << USB_USBCTRL_UARTCHLS_SHIFT)) & USB_USBCTRL_UARTCHLS_MASK) - -#define USB_USBCTRL_PDE_MASK (0x40U) -#define USB_USBCTRL_PDE_SHIFT (6U) -/*! PDE - Pulldown Enable - * 0b0..Disable on D+ and D- - * 0b1..Enable on D+ and D- - */ -#define USB_USBCTRL_PDE(x) (((uint8_t)(((uint8_t)(x)) << USB_USBCTRL_PDE_SHIFT)) & USB_USBCTRL_PDE_MASK) - -#define USB_USBCTRL_SUSP_MASK (0x80U) -#define USB_USBCTRL_SUSP_SHIFT (7U) -/*! SUSP - Suspend - * 0b0..Not in Suspend state - * 0b1..In Suspend state - */ -#define USB_USBCTRL_SUSP(x) (((uint8_t)(((uint8_t)(x)) << USB_USBCTRL_SUSP_SHIFT)) & USB_USBCTRL_SUSP_MASK) -/*! @} */ - -/*! @name OBSERVE - USB OTG Observe */ -/*! @{ */ - -#define USB_OBSERVE_DMPD_MASK (0x10U) -#define USB_OBSERVE_DMPD_SHIFT (4U) -/*! DMPD - D- Pulldown - * 0b0..Disabled - * 0b1..Enabled - */ -#define USB_OBSERVE_DMPD(x) (((uint8_t)(((uint8_t)(x)) << USB_OBSERVE_DMPD_SHIFT)) & USB_OBSERVE_DMPD_MASK) - -#define USB_OBSERVE_DPPD_MASK (0x40U) -#define USB_OBSERVE_DPPD_SHIFT (6U) -/*! DPPD - D+ Pulldown - * 0b0..Disabled - * 0b1..Enabled - */ -#define USB_OBSERVE_DPPD(x) (((uint8_t)(((uint8_t)(x)) << USB_OBSERVE_DPPD_SHIFT)) & USB_OBSERVE_DPPD_MASK) - -#define USB_OBSERVE_DPPU_MASK (0x80U) -#define USB_OBSERVE_DPPU_SHIFT (7U) -/*! DPPU - D+ Pullup - * 0b0..Disabled - * 0b1..Enabled - */ -#define USB_OBSERVE_DPPU(x) (((uint8_t)(((uint8_t)(x)) << USB_OBSERVE_DPPU_SHIFT)) & USB_OBSERVE_DPPU_MASK) -/*! @} */ - -/*! @name CONTROL - USB OTG Control */ -/*! @{ */ - -#define USB_CONTROL_VBUS_SOURCE_SEL_MASK (0x1U) -#define USB_CONTROL_VBUS_SOURCE_SEL_SHIFT (0U) -/*! VBUS_SOURCE_SEL - VBUS Monitoring Source Select - * 0b0..Reserved - * 0b1..Resistive divider attached to a GPIO pin - */ -#define USB_CONTROL_VBUS_SOURCE_SEL(x) (((uint8_t)(((uint8_t)(x)) << USB_CONTROL_VBUS_SOURCE_SEL_SHIFT)) & USB_CONTROL_VBUS_SOURCE_SEL_MASK) - -#define USB_CONTROL_SESS_VLD_MASK (0x2U) -#define USB_CONTROL_SESS_VLD_SHIFT (1U) -/*! SESS_VLD - VBUS Session Valid status - * 0b1..Above - * 0b0..Below - */ -#define USB_CONTROL_SESS_VLD(x) (((uint8_t)(((uint8_t)(x)) << USB_CONTROL_SESS_VLD_SHIFT)) & USB_CONTROL_SESS_VLD_MASK) - -#define USB_CONTROL_DPPULLUPNONOTG_MASK (0x10U) -#define USB_CONTROL_DPPULLUPNONOTG_SHIFT (4U) -/*! DPPULLUPNONOTG - DP Pullup in Non-OTG Device Mode - * 0b0..Disable - * 0b1..Enabled - */ -#define USB_CONTROL_DPPULLUPNONOTG(x) (((uint8_t)(((uint8_t)(x)) << USB_CONTROL_DPPULLUPNONOTG_SHIFT)) & USB_CONTROL_DPPULLUPNONOTG_MASK) -/*! @} */ - -/*! @name USBTRC0 - USB Transceiver Control 0 */ -/*! @{ */ - -#define USB_USBTRC0_USB_RESUME_INT_MASK (0x1U) -#define USB_USBTRC0_USB_RESUME_INT_SHIFT (0U) -/*! USB_RESUME_INT - USB Asynchronous Interrupt - * 0b0..Not generated - * 0b1..Generated because of the USB asynchronous interrupt - */ -#define USB_USBTRC0_USB_RESUME_INT(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_USB_RESUME_INT_SHIFT)) & USB_USBTRC0_USB_RESUME_INT_MASK) - -#define USB_USBTRC0_SYNC_DET_MASK (0x2U) -#define USB_USBTRC0_SYNC_DET_SHIFT (1U) -/*! SYNC_DET - Synchronous USB Interrupt Detect - * 0b0..Not detected - * 0b1..Detected - */ -#define USB_USBTRC0_SYNC_DET(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_SYNC_DET_SHIFT)) & USB_USBTRC0_SYNC_DET_MASK) - -#define USB_USBTRC0_USB_CLK_RECOVERY_INT_MASK (0x4U) -#define USB_USBTRC0_USB_CLK_RECOVERY_INT_SHIFT (2U) -/*! USB_CLK_RECOVERY_INT - Combined USB Clock Recovery interrupt status */ -#define USB_USBTRC0_USB_CLK_RECOVERY_INT(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_USB_CLK_RECOVERY_INT_SHIFT)) & USB_USBTRC0_USB_CLK_RECOVERY_INT_MASK) - -#define USB_USBTRC0_VREDG_DET_MASK (0x8U) -#define USB_USBTRC0_VREDG_DET_SHIFT (3U) -/*! VREDG_DET - VREGIN Rising Edge Interrupt Detect - * 0b0..Not detected - * 0b1..Detected - */ -#define USB_USBTRC0_VREDG_DET(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_VREDG_DET_SHIFT)) & USB_USBTRC0_VREDG_DET_MASK) - -#define USB_USBTRC0_VFEDG_DET_MASK (0x10U) -#define USB_USBTRC0_VFEDG_DET_SHIFT (4U) -/*! VFEDG_DET - VREGIN Falling Edge Interrupt Detect - * 0b0..Not detected - * 0b1..Detected - */ -#define USB_USBTRC0_VFEDG_DET(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_VFEDG_DET_SHIFT)) & USB_USBTRC0_VFEDG_DET_MASK) - -#define USB_USBTRC0_USBRESMEN_MASK (0x20U) -#define USB_USBTRC0_USBRESMEN_SHIFT (5U) -/*! USBRESMEN - Asynchronous Resume Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_USBTRC0_USBRESMEN(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_USBRESMEN_SHIFT)) & USB_USBTRC0_USBRESMEN_MASK) - -#define USB_USBTRC0_VREGIN_STS_MASK (0x40U) -#define USB_USBTRC0_VREGIN_STS_SHIFT (6U) -/*! VREGIN_STS - VREGIN Status */ -#define USB_USBTRC0_VREGIN_STS(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_VREGIN_STS_SHIFT)) & USB_USBTRC0_VREGIN_STS_MASK) - -#define USB_USBTRC0_USBRESET_MASK (0x80U) -#define USB_USBTRC0_USBRESET_SHIFT (7U) -/*! USBRESET - USB Reset - * 0b0..Normal USBFS operation - * 0b1..Returns USBFS to its reset state - */ -#define USB_USBTRC0_USBRESET(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_USBRESET_SHIFT)) & USB_USBTRC0_USBRESET_MASK) -/*! @} */ - -/*! @name MISCCTRL - Miscellaneous Control */ -/*! @{ */ - -#define USB_MISCCTRL_OWNERRISODIS_MASK (0x4U) -#define USB_MISCCTRL_OWNERRISODIS_SHIFT (2U) -/*! OWNERRISODIS - OWN Error Detect for ISO IN and ISO OUT Disable - * 0b0..Enable - * 0b1..Disable - */ -#define USB_MISCCTRL_OWNERRISODIS(x) (((uint8_t)(((uint8_t)(x)) << USB_MISCCTRL_OWNERRISODIS_SHIFT)) & USB_MISCCTRL_OWNERRISODIS_MASK) - -#define USB_MISCCTRL_VREDG_EN_MASK (0x8U) -#define USB_MISCCTRL_VREDG_EN_SHIFT (3U) -/*! VREDG_EN - VREGIN Rising Edge Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_MISCCTRL_VREDG_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_MISCCTRL_VREDG_EN_SHIFT)) & USB_MISCCTRL_VREDG_EN_MASK) - -#define USB_MISCCTRL_VFEDG_EN_MASK (0x10U) -#define USB_MISCCTRL_VFEDG_EN_SHIFT (4U) -/*! VFEDG_EN - VREGIN Falling Edge Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_MISCCTRL_VFEDG_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_MISCCTRL_VFEDG_EN_SHIFT)) & USB_MISCCTRL_VFEDG_EN_MASK) - -#define USB_MISCCTRL_STL_ADJ_EN_MASK (0x80U) -#define USB_MISCCTRL_STL_ADJ_EN_SHIFT (7U) -/*! STL_ADJ_EN - USB Peripheral Mode Stall Adjust Enable - * 0b0..If ENDPTn[END_STALL] = 1, both IN and OUT directions for the associated endpoint stalls. - * 0b1..If ENDPTn[END_STALL] = 1, the STALL_xx_DIS registers control which directions for the associated endpoint stalls. - */ -#define USB_MISCCTRL_STL_ADJ_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_MISCCTRL_STL_ADJ_EN_SHIFT)) & USB_MISCCTRL_STL_ADJ_EN_MASK) -/*! @} */ - -/*! @name STALL_IL_DIS - Peripheral Mode Stall Disable for Endpoints 7 to 0 in IN Direction */ -/*! @{ */ - -#define USB_STALL_IL_DIS_STALL_I_DIS0_MASK (0x1U) -#define USB_STALL_IL_DIS_STALL_I_DIS0_SHIFT (0U) -/*! STALL_I_DIS0 - Disable Endpoint 0 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS0(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS0_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS0_MASK) - -#define USB_STALL_IL_DIS_STALL_I_DIS1_MASK (0x2U) -#define USB_STALL_IL_DIS_STALL_I_DIS1_SHIFT (1U) -/*! STALL_I_DIS1 - Disable Endpoint 1 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS1(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS1_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS1_MASK) - -#define USB_STALL_IL_DIS_STALL_I_DIS2_MASK (0x4U) -#define USB_STALL_IL_DIS_STALL_I_DIS2_SHIFT (2U) -/*! STALL_I_DIS2 - Disable Endpoint 2 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS2(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS2_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS2_MASK) - -#define USB_STALL_IL_DIS_STALL_I_DIS3_MASK (0x8U) -#define USB_STALL_IL_DIS_STALL_I_DIS3_SHIFT (3U) -/*! STALL_I_DIS3 - Disable Endpoint 3 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS3(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS3_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS3_MASK) - -#define USB_STALL_IL_DIS_STALL_I_DIS4_MASK (0x10U) -#define USB_STALL_IL_DIS_STALL_I_DIS4_SHIFT (4U) -/*! STALL_I_DIS4 - Disable Endpoint 4 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS4(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS4_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS4_MASK) - -#define USB_STALL_IL_DIS_STALL_I_DIS5_MASK (0x20U) -#define USB_STALL_IL_DIS_STALL_I_DIS5_SHIFT (5U) -/*! STALL_I_DIS5 - Disable Endpoint 5 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS5(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS5_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS5_MASK) - -#define USB_STALL_IL_DIS_STALL_I_DIS6_MASK (0x40U) -#define USB_STALL_IL_DIS_STALL_I_DIS6_SHIFT (6U) -/*! STALL_I_DIS6 - Disable Endpoint 6 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS6(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS6_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS6_MASK) - -#define USB_STALL_IL_DIS_STALL_I_DIS7_MASK (0x80U) -#define USB_STALL_IL_DIS_STALL_I_DIS7_SHIFT (7U) -/*! STALL_I_DIS7 - Disable Endpoint 7 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS7(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS7_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS7_MASK) -/*! @} */ - -/*! @name STALL_IH_DIS - Peripheral Mode Stall Disable for Endpoints 15 to 8 in IN Direction */ -/*! @{ */ - -#define USB_STALL_IH_DIS_STALL_I_DIS8_MASK (0x1U) -#define USB_STALL_IH_DIS_STALL_I_DIS8_SHIFT (0U) -/*! STALL_I_DIS8 - Disable Endpoint 8 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS8(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS8_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS8_MASK) - -#define USB_STALL_IH_DIS_STALL_I_DIS9_MASK (0x2U) -#define USB_STALL_IH_DIS_STALL_I_DIS9_SHIFT (1U) -/*! STALL_I_DIS9 - Disable Endpoint 9 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS9(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS9_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS9_MASK) - -#define USB_STALL_IH_DIS_STALL_I_DIS10_MASK (0x4U) -#define USB_STALL_IH_DIS_STALL_I_DIS10_SHIFT (2U) -/*! STALL_I_DIS10 - Disable Endpoint 10 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS10(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS10_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS10_MASK) - -#define USB_STALL_IH_DIS_STALL_I_DIS11_MASK (0x8U) -#define USB_STALL_IH_DIS_STALL_I_DIS11_SHIFT (3U) -/*! STALL_I_DIS11 - Disable Endpoint 11 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS11(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS11_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS11_MASK) - -#define USB_STALL_IH_DIS_STALL_I_DIS12_MASK (0x10U) -#define USB_STALL_IH_DIS_STALL_I_DIS12_SHIFT (4U) -/*! STALL_I_DIS12 - Disable Endpoint 12 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS12(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS12_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS12_MASK) - -#define USB_STALL_IH_DIS_STALL_I_DIS13_MASK (0x20U) -#define USB_STALL_IH_DIS_STALL_I_DIS13_SHIFT (5U) -/*! STALL_I_DIS13 - Disable Endpoint 13 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS13(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS13_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS13_MASK) - -#define USB_STALL_IH_DIS_STALL_I_DIS14_MASK (0x40U) -#define USB_STALL_IH_DIS_STALL_I_DIS14_SHIFT (6U) -/*! STALL_I_DIS14 - Disable Endpoint 14 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS14(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS14_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS14_MASK) - -#define USB_STALL_IH_DIS_STALL_I_DIS15_MASK (0x80U) -#define USB_STALL_IH_DIS_STALL_I_DIS15_SHIFT (7U) -/*! STALL_I_DIS15 - Disable Endpoint 15 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS15(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS15_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS15_MASK) -/*! @} */ - -/*! @name STALL_OL_DIS - Peripheral Mode Stall Disable for Endpoints 7 to 0 in OUT Direction */ -/*! @{ */ - -#define USB_STALL_OL_DIS_STALL_O_DIS0_MASK (0x1U) -#define USB_STALL_OL_DIS_STALL_O_DIS0_SHIFT (0U) -/*! STALL_O_DIS0 - Disable Endpoint 0 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS0(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS0_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS0_MASK) - -#define USB_STALL_OL_DIS_STALL_O_DIS1_MASK (0x2U) -#define USB_STALL_OL_DIS_STALL_O_DIS1_SHIFT (1U) -/*! STALL_O_DIS1 - Disable Endpoint 1 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS1(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS1_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS1_MASK) - -#define USB_STALL_OL_DIS_STALL_O_DIS2_MASK (0x4U) -#define USB_STALL_OL_DIS_STALL_O_DIS2_SHIFT (2U) -/*! STALL_O_DIS2 - Disable Endpoint 2 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS2(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS2_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS2_MASK) - -#define USB_STALL_OL_DIS_STALL_O_DIS3_MASK (0x8U) -#define USB_STALL_OL_DIS_STALL_O_DIS3_SHIFT (3U) -/*! STALL_O_DIS3 - Disable Endpoint 3 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS3(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS3_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS3_MASK) - -#define USB_STALL_OL_DIS_STALL_O_DIS4_MASK (0x10U) -#define USB_STALL_OL_DIS_STALL_O_DIS4_SHIFT (4U) -/*! STALL_O_DIS4 - Disable Endpoint 4 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS4(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS4_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS4_MASK) - -#define USB_STALL_OL_DIS_STALL_O_DIS5_MASK (0x20U) -#define USB_STALL_OL_DIS_STALL_O_DIS5_SHIFT (5U) -/*! STALL_O_DIS5 - Disable Endpoint 5 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS5(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS5_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS5_MASK) - -#define USB_STALL_OL_DIS_STALL_O_DIS6_MASK (0x40U) -#define USB_STALL_OL_DIS_STALL_O_DIS6_SHIFT (6U) -/*! STALL_O_DIS6 - Disable Endpoint 6 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS6(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS6_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS6_MASK) - -#define USB_STALL_OL_DIS_STALL_O_DIS7_MASK (0x80U) -#define USB_STALL_OL_DIS_STALL_O_DIS7_SHIFT (7U) -/*! STALL_O_DIS7 - Disable Endpoint 7 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS7(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS7_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS7_MASK) -/*! @} */ - -/*! @name STALL_OH_DIS - Peripheral Mode Stall Disable for Endpoints 15 to 8 in OUT Direction */ -/*! @{ */ - -#define USB_STALL_OH_DIS_STALL_O_DIS8_MASK (0x1U) -#define USB_STALL_OH_DIS_STALL_O_DIS8_SHIFT (0U) -/*! STALL_O_DIS8 - Disable Endpoint 8 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS8(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS8_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS8_MASK) - -#define USB_STALL_OH_DIS_STALL_O_DIS9_MASK (0x2U) -#define USB_STALL_OH_DIS_STALL_O_DIS9_SHIFT (1U) -/*! STALL_O_DIS9 - Disable Endpoint 9 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS9(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS9_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS9_MASK) - -#define USB_STALL_OH_DIS_STALL_O_DIS10_MASK (0x4U) -#define USB_STALL_OH_DIS_STALL_O_DIS10_SHIFT (2U) -/*! STALL_O_DIS10 - Disable Endpoint 10 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS10(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS10_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS10_MASK) - -#define USB_STALL_OH_DIS_STALL_O_DIS11_MASK (0x8U) -#define USB_STALL_OH_DIS_STALL_O_DIS11_SHIFT (3U) -/*! STALL_O_DIS11 - Disable Endpoint 11 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS11(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS11_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS11_MASK) - -#define USB_STALL_OH_DIS_STALL_O_DIS12_MASK (0x10U) -#define USB_STALL_OH_DIS_STALL_O_DIS12_SHIFT (4U) -/*! STALL_O_DIS12 - Disable endpoint 12 OUT direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS12(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS12_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS12_MASK) - -#define USB_STALL_OH_DIS_STALL_O_DIS13_MASK (0x20U) -#define USB_STALL_OH_DIS_STALL_O_DIS13_SHIFT (5U) -/*! STALL_O_DIS13 - Disable Endpoint 13 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS13(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS13_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS13_MASK) - -#define USB_STALL_OH_DIS_STALL_O_DIS14_MASK (0x40U) -#define USB_STALL_OH_DIS_STALL_O_DIS14_SHIFT (6U) -/*! STALL_O_DIS14 - Disable Endpoint 14 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS14(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS14_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS14_MASK) - -#define USB_STALL_OH_DIS_STALL_O_DIS15_MASK (0x80U) -#define USB_STALL_OH_DIS_STALL_O_DIS15_SHIFT (7U) -/*! STALL_O_DIS15 - Disable Endpoint 15 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS15(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS15_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS15_MASK) -/*! @} */ - -/*! @name CLK_RECOVER_CTRL - USB Clock Recovery Control */ -/*! @{ */ - -#define USB_CLK_RECOVER_CTRL_TRIM_INIT_VAL_SEL_MASK (0x8U) -#define USB_CLK_RECOVER_CTRL_TRIM_INIT_VAL_SEL_SHIFT (3U) -/*! TRIM_INIT_VAL_SEL - Selects the source for the initial FIRC trim fine value used after a reset. - * 0b0..Mid-scale - * 0b1..IFR - */ -#define USB_CLK_RECOVER_CTRL_TRIM_INIT_VAL_SEL(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_CTRL_TRIM_INIT_VAL_SEL_SHIFT)) & USB_CLK_RECOVER_CTRL_TRIM_INIT_VAL_SEL_MASK) - -#define USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN_MASK (0x20U) -#define USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN_SHIFT (5U) -/*! RESTART_IFRTRIM_EN - Restart from IFR Trim Value - * 0b0..Trim fine adjustment always works based on the previous updated trim fine value. - * 0b1..Trim fine restarts from the IFR trim value whenever you detect bus_reset or bus_resume or deassert module enable. - */ -#define USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN_SHIFT)) & USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN_MASK) - -#define USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN_MASK (0x40U) -#define USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN_SHIFT (6U) -/*! RESET_RESUME_ROUGH_EN - Reset or Resume to Rough Phase Enable - * 0b0..Always works in tracking phase after the first time rough phase, to track transition. - * 0b1..Go back to rough stage whenever a bus reset or bus resume occurs. - */ -#define USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN_SHIFT)) & USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN_MASK) - -#define USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN_MASK (0x80U) -#define USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN_SHIFT (7U) -/*! CLOCK_RECOVER_EN - Crystal-Less USB Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN_SHIFT)) & USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN_MASK) -/*! @} */ - -/*! @name CLK_RECOVER_IRC_EN - FIRC Oscillator Enable */ -/*! @{ */ - -#define USB_CLK_RECOVER_IRC_EN_IRC_EN_MASK (0x2U) -#define USB_CLK_RECOVER_IRC_EN_IRC_EN_SHIFT (1U) -/*! IRC_EN - Fast IRC enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_CLK_RECOVER_IRC_EN_IRC_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_IRC_EN_IRC_EN_SHIFT)) & USB_CLK_RECOVER_IRC_EN_IRC_EN_MASK) -/*! @} */ - -/*! @name CLK_RECOVER_INT_EN - Clock Recovery Combined Interrupt Enable */ -/*! @{ */ - -#define USB_CLK_RECOVER_INT_EN_OVF_ERROR_EN_MASK (0x10U) -#define USB_CLK_RECOVER_INT_EN_OVF_ERROR_EN_SHIFT (4U) -/*! OVF_ERROR_EN - Overflow error interrupt enable - * 0b0..The interrupt is masked - * 0b1..The interrupt is enabled - */ -#define USB_CLK_RECOVER_INT_EN_OVF_ERROR_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_INT_EN_OVF_ERROR_EN_SHIFT)) & USB_CLK_RECOVER_INT_EN_OVF_ERROR_EN_MASK) -/*! @} */ - -/*! @name CLK_RECOVER_INT_STATUS - Clock Recovery Separated Interrupt Status */ -/*! @{ */ - -#define USB_CLK_RECOVER_INT_STATUS_OVF_ERROR_MASK (0x10U) -#define USB_CLK_RECOVER_INT_STATUS_OVF_ERROR_SHIFT (4U) -/*! OVF_ERROR - Overflow Error Interrupt Status Flag - * 0b0..Interrupt did not occur - * 0b1..Unmasked interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_CLK_RECOVER_INT_STATUS_OVF_ERROR(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_INT_STATUS_OVF_ERROR_SHIFT)) & USB_CLK_RECOVER_INT_STATUS_OVF_ERROR_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group USB_Register_Masks */ - - -/* USB - Peripheral instance base addresses */ -/** Peripheral USB0 base address */ -#define USB0_BASE (0x400A4000u) -/** Peripheral USB0 base pointer */ -#define USB0 ((USB_Type *)USB0_BASE) -/** Array initializer of USB peripheral base addresses */ -#define USB_BASE_ADDRS { USB0_BASE } -/** Array initializer of USB peripheral base pointers */ -#define USB_BASE_PTRS { USB0 } -/** Interrupt vectors for the USB peripheral type */ -#define USB_IRQS { USB0_IRQn } -/* Backward compatibility */ -#define USBFS_IRQS USB_IRQS -#define USBFS_IRQHandler USB0_IRQHandler - - -/*! - * @} - */ /* end of group USB_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- UTICK Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup UTICK_Peripheral_Access_Layer UTICK Peripheral Access Layer - * @{ - */ - -/** UTICK - Register Layout Typedef */ -typedef struct { - __IO uint32_t CTRL; /**< Control, offset: 0x0 */ - __IO uint32_t STAT; /**< Status, offset: 0x4 */ - __IO uint32_t CFG; /**< Capture Configuration, offset: 0x8 */ - __O uint32_t CAPCLR; /**< Capture Clear, offset: 0xC */ - __I uint32_t CAP[4]; /**< Capture, array offset: 0x10, array step: 0x4 */ -} UTICK_Type; - -/* ---------------------------------------------------------------------------- - -- UTICK Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup UTICK_Register_Masks UTICK Register Masks - * @{ - */ - -/*! @name CTRL - Control */ -/*! @{ */ - -#define UTICK_CTRL_DELAYVAL_MASK (0x7FFFFFFFU) -#define UTICK_CTRL_DELAYVAL_SHIFT (0U) -/*! DELAYVAL - Tick Interval - * 0b0000000000000000000000000000000.. - * *..Clock cycles as defined in the description - */ -#define UTICK_CTRL_DELAYVAL(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CTRL_DELAYVAL_SHIFT)) & UTICK_CTRL_DELAYVAL_MASK) - -#define UTICK_CTRL_REPEAT_MASK (0x80000000U) -#define UTICK_CTRL_REPEAT_SHIFT (31U) -/*! REPEAT - Repeat Delay - * 0b0..One-time delay - * 0b1..Delay repeats continuously - */ -#define UTICK_CTRL_REPEAT(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CTRL_REPEAT_SHIFT)) & UTICK_CTRL_REPEAT_MASK) -/*! @} */ - -/*! @name STAT - Status */ -/*! @{ */ - -#define UTICK_STAT_INTR_MASK (0x1U) -#define UTICK_STAT_INTR_SHIFT (0U) -/*! INTR - Interrupt Flag - * 0b0..Not pending - * 0b1..Pending - */ -#define UTICK_STAT_INTR(x) (((uint32_t)(((uint32_t)(x)) << UTICK_STAT_INTR_SHIFT)) & UTICK_STAT_INTR_MASK) - -#define UTICK_STAT_ACTIVE_MASK (0x2U) -#define UTICK_STAT_ACTIVE_SHIFT (1U) -/*! ACTIVE - Timer Active Flag - * 0b0..Inactive (stopped) - * 0b1..Active - */ -#define UTICK_STAT_ACTIVE(x) (((uint32_t)(((uint32_t)(x)) << UTICK_STAT_ACTIVE_SHIFT)) & UTICK_STAT_ACTIVE_MASK) -/*! @} */ - -/*! @name CFG - Capture Configuration */ -/*! @{ */ - -#define UTICK_CFG_CAPEN0_MASK (0x1U) -#define UTICK_CFG_CAPEN0_SHIFT (0U) -/*! CAPEN0 - Enable Capture 0 - * 0b0..Disable - * 0b1..Enable - */ -#define UTICK_CFG_CAPEN0(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPEN0_SHIFT)) & UTICK_CFG_CAPEN0_MASK) - -#define UTICK_CFG_CAPEN1_MASK (0x2U) -#define UTICK_CFG_CAPEN1_SHIFT (1U) -/*! CAPEN1 - Enable Capture 1 - * 0b0..Disable - * 0b1..Enable - */ -#define UTICK_CFG_CAPEN1(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPEN1_SHIFT)) & UTICK_CFG_CAPEN1_MASK) - -#define UTICK_CFG_CAPEN2_MASK (0x4U) -#define UTICK_CFG_CAPEN2_SHIFT (2U) -/*! CAPEN2 - Enable Capture 2 - * 0b0..Disable - * 0b1..Enable - */ -#define UTICK_CFG_CAPEN2(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPEN2_SHIFT)) & UTICK_CFG_CAPEN2_MASK) - -#define UTICK_CFG_CAPEN3_MASK (0x8U) -#define UTICK_CFG_CAPEN3_SHIFT (3U) -/*! CAPEN3 - Enable Capture 3 - * 0b0..Disable - * 0b1..Enable - */ -#define UTICK_CFG_CAPEN3(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPEN3_SHIFT)) & UTICK_CFG_CAPEN3_MASK) - -#define UTICK_CFG_CAPPOL0_MASK (0x100U) -#define UTICK_CFG_CAPPOL0_SHIFT (8U) -/*! CAPPOL0 - Capture Polarity 0 - * 0b0..Positive - * 0b1..Negative - */ -#define UTICK_CFG_CAPPOL0(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPPOL0_SHIFT)) & UTICK_CFG_CAPPOL0_MASK) - -#define UTICK_CFG_CAPPOL1_MASK (0x200U) -#define UTICK_CFG_CAPPOL1_SHIFT (9U) -/*! CAPPOL1 - Capture-Polarity 1 - * 0b0..Positive - * 0b1..Negative - */ -#define UTICK_CFG_CAPPOL1(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPPOL1_SHIFT)) & UTICK_CFG_CAPPOL1_MASK) - -#define UTICK_CFG_CAPPOL2_MASK (0x400U) -#define UTICK_CFG_CAPPOL2_SHIFT (10U) -/*! CAPPOL2 - Capture Polarity 2 - * 0b0..Positive - * 0b1..Negative - */ -#define UTICK_CFG_CAPPOL2(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPPOL2_SHIFT)) & UTICK_CFG_CAPPOL2_MASK) - -#define UTICK_CFG_CAPPOL3_MASK (0x800U) -#define UTICK_CFG_CAPPOL3_SHIFT (11U) -/*! CAPPOL3 - Capture Polarity 3 - * 0b0..Positive - * 0b1..Negative - */ -#define UTICK_CFG_CAPPOL3(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPPOL3_SHIFT)) & UTICK_CFG_CAPPOL3_MASK) -/*! @} */ - -/*! @name CAPCLR - Capture Clear */ -/*! @{ */ - -#define UTICK_CAPCLR_CAPCLR0_MASK (0x1U) -#define UTICK_CAPCLR_CAPCLR0_SHIFT (0U) -/*! CAPCLR0 - Clear Capture 0 - * 0b0..Does nothing - * 0b1..Clears the CAP0 register value - */ -#define UTICK_CAPCLR_CAPCLR0(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CAPCLR_CAPCLR0_SHIFT)) & UTICK_CAPCLR_CAPCLR0_MASK) - -#define UTICK_CAPCLR_CAPCLR1_MASK (0x2U) -#define UTICK_CAPCLR_CAPCLR1_SHIFT (1U) -/*! CAPCLR1 - Clear Capture 1 - * 0b0..Does nothing - * 0b1..Clears the CAP1 register value - */ -#define UTICK_CAPCLR_CAPCLR1(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CAPCLR_CAPCLR1_SHIFT)) & UTICK_CAPCLR_CAPCLR1_MASK) - -#define UTICK_CAPCLR_CAPCLR2_MASK (0x4U) -#define UTICK_CAPCLR_CAPCLR2_SHIFT (2U) -/*! CAPCLR2 - Clear Capture 2 - * 0b0..Does nothing - * 0b1..Clears the CAP2 register value - */ -#define UTICK_CAPCLR_CAPCLR2(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CAPCLR_CAPCLR2_SHIFT)) & UTICK_CAPCLR_CAPCLR2_MASK) - -#define UTICK_CAPCLR_CAPCLR3_MASK (0x8U) -#define UTICK_CAPCLR_CAPCLR3_SHIFT (3U) -/*! CAPCLR3 - Clear Capture 3 - * 0b0..Does nothing - * 0b1..Clears the CAP3 register value - */ -#define UTICK_CAPCLR_CAPCLR3(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CAPCLR_CAPCLR3_SHIFT)) & UTICK_CAPCLR_CAPCLR3_MASK) -/*! @} */ - -/*! @name CAP - Capture */ -/*! @{ */ - -#define UTICK_CAP_CAP_VALUE_MASK (0x7FFFFFFFU) -#define UTICK_CAP_CAP_VALUE_SHIFT (0U) -/*! CAP_VALUE - Captured Value for the Related Capture Event */ -#define UTICK_CAP_CAP_VALUE(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CAP_CAP_VALUE_SHIFT)) & UTICK_CAP_CAP_VALUE_MASK) - -#define UTICK_CAP_VALID_MASK (0x80000000U) -#define UTICK_CAP_VALID_SHIFT (31U) -/*! VALID - Captured Value Valid Flag - * 0b0..Valid value not captured - * 0b1..Valid value captured - */ -#define UTICK_CAP_VALID(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CAP_VALID_SHIFT)) & UTICK_CAP_VALID_MASK) -/*! @} */ - -/* The count of UTICK_CAP */ -#define UTICK_CAP_COUNT (4U) - - -/*! - * @} - */ /* end of group UTICK_Register_Masks */ - - -/* UTICK - Peripheral instance base addresses */ -/** Peripheral UTICK0 base address */ -#define UTICK0_BASE (0x4000B000u) -/** Peripheral UTICK0 base pointer */ -#define UTICK0 ((UTICK_Type *)UTICK0_BASE) -/** Array initializer of UTICK peripheral base addresses */ -#define UTICK_BASE_ADDRS { UTICK0_BASE } -/** Array initializer of UTICK peripheral base pointers */ -#define UTICK_BASE_PTRS { UTICK0 } -/** Interrupt vectors for the UTICK peripheral type */ -#define UTICK_IRQS { UTICK0_IRQn } - -/*! - * @} - */ /* end of group UTICK_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- VBAT Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup VBAT_Peripheral_Access_Layer VBAT Peripheral Access Layer - * @{ - */ - -/** VBAT - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - uint8_t RESERVED_0[508]; - __IO uint32_t FROCTLA; /**< FRO16K Control A, offset: 0x200 */ - uint8_t RESERVED_1[20]; - __IO uint32_t FROLCKA; /**< FRO16K Lock A, offset: 0x218 */ - uint8_t RESERVED_2[4]; - __IO uint32_t FROCLKE; /**< FRO16K Clock Enable, offset: 0x220 */ - uint8_t RESERVED_3[1244]; - struct { /* offset: 0x700, array step: 0x8 */ - __IO uint32_t WAKEUPA; /**< Wakeup 0 Register A, array offset: 0x700, array step: 0x8 */ - uint8_t RESERVED_0[4]; - } WAKEUP[2]; - uint8_t RESERVED_4[232]; - __IO uint32_t WAKLCKA; /**< Wakeup Lock A, offset: 0x7F8 */ -} VBAT_Type; - -/* ---------------------------------------------------------------------------- - -- VBAT Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup VBAT_Register_Masks VBAT Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define VBAT_VERID_FEATURE_MASK (0xFFFFU) -#define VBAT_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number */ -#define VBAT_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_VERID_FEATURE_SHIFT)) & VBAT_VERID_FEATURE_MASK) - -#define VBAT_VERID_MINOR_MASK (0xFF0000U) -#define VBAT_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define VBAT_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << VBAT_VERID_MINOR_SHIFT)) & VBAT_VERID_MINOR_MASK) - -#define VBAT_VERID_MAJOR_MASK (0xFF000000U) -#define VBAT_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define VBAT_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << VBAT_VERID_MAJOR_SHIFT)) & VBAT_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name FROCTLA - FRO16K Control A */ -/*! @{ */ - -#define VBAT_FROCTLA_FRO_EN_MASK (0x1U) -#define VBAT_FROCTLA_FRO_EN_SHIFT (0U) -/*! FRO_EN - FRO16K Enable - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_FROCTLA_FRO_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_FROCTLA_FRO_EN_SHIFT)) & VBAT_FROCTLA_FRO_EN_MASK) -/*! @} */ - -/*! @name FROLCKA - FRO16K Lock A */ -/*! @{ */ - -#define VBAT_FROLCKA_LOCK_MASK (0x1U) -#define VBAT_FROLCKA_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b0..Do not block - * 0b1..Block - */ -#define VBAT_FROLCKA_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_FROLCKA_LOCK_SHIFT)) & VBAT_FROLCKA_LOCK_MASK) -/*! @} */ - -/*! @name FROCLKE - FRO16K Clock Enable */ -/*! @{ */ - -#define VBAT_FROCLKE_CLKE_MASK (0x3U) -#define VBAT_FROCLKE_CLKE_SHIFT (0U) -/*! CLKE - Clock Enable */ -#define VBAT_FROCLKE_CLKE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_FROCLKE_CLKE_SHIFT)) & VBAT_FROCLKE_CLKE_MASK) -/*! @} */ - -/*! @name WAKEUP_WAKEUPA - Wakeup 0 Register A */ -/*! @{ */ - -#define VBAT_WAKEUP_WAKEUPA_REG_MASK (0xFFFFFFFFU) -#define VBAT_WAKEUP_WAKEUPA_REG_SHIFT (0U) -/*! REG - Register */ -#define VBAT_WAKEUP_WAKEUPA_REG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKEUP_WAKEUPA_REG_SHIFT)) & VBAT_WAKEUP_WAKEUPA_REG_MASK) -/*! @} */ - -/* The count of VBAT_WAKEUP_WAKEUPA */ -#define VBAT_WAKEUP_WAKEUPA_COUNT (2U) - -/*! @name WAKLCKA - Wakeup Lock A */ -/*! @{ */ - -#define VBAT_WAKLCKA_LOCK_MASK (0x1U) -#define VBAT_WAKLCKA_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b0..Lock is disabled - * 0b1..Lock is enabled - */ -#define VBAT_WAKLCKA_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKLCKA_LOCK_SHIFT)) & VBAT_WAKLCKA_LOCK_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group VBAT_Register_Masks */ - - -/* VBAT - Peripheral instance base addresses */ -/** Peripheral VBAT0 base address */ -#define VBAT0_BASE (0x40093000u) -/** Peripheral VBAT0 base pointer */ -#define VBAT0 ((VBAT_Type *)VBAT0_BASE) -/** Array initializer of VBAT peripheral base addresses */ -#define VBAT_BASE_ADDRS { VBAT0_BASE } -/** Array initializer of VBAT peripheral base pointers */ -#define VBAT_BASE_PTRS { VBAT0 } - -/*! - * @} - */ /* end of group VBAT_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- WAKETIMER Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup WAKETIMER_Peripheral_Access_Layer WAKETIMER Peripheral Access Layer - * @{ - */ - -/** WAKETIMER - Register Layout Typedef */ -typedef struct { - __IO uint32_t WAKE_TIMER_CTRL; /**< Wake Timer Control, offset: 0x0 */ - uint8_t RESERVED_0[8]; - __IO uint32_t WAKE_TIMER_CNT; /**< Wake Timer Counter, offset: 0xC */ -} WAKETIMER_Type; - -/* ---------------------------------------------------------------------------- - -- WAKETIMER Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup WAKETIMER_Register_Masks WAKETIMER Register Masks - * @{ - */ - -/*! @name WAKE_TIMER_CTRL - Wake Timer Control */ -/*! @{ */ - -#define WAKETIMER_WAKE_TIMER_CTRL_WAKE_FLAG_MASK (0x2U) -#define WAKETIMER_WAKE_TIMER_CTRL_WAKE_FLAG_SHIFT (1U) -/*! WAKE_FLAG - Wake Timer Status Flag - * 0b0..Wake timer has not timed out. - * 0b1..Wake timer has timed out. - */ -#define WAKETIMER_WAKE_TIMER_CTRL_WAKE_FLAG(x) (((uint32_t)(((uint32_t)(x)) << WAKETIMER_WAKE_TIMER_CTRL_WAKE_FLAG_SHIFT)) & WAKETIMER_WAKE_TIMER_CTRL_WAKE_FLAG_MASK) - -#define WAKETIMER_WAKE_TIMER_CTRL_CLR_WAKE_TIMER_MASK (0x4U) -#define WAKETIMER_WAKE_TIMER_CTRL_CLR_WAKE_TIMER_SHIFT (2U) -/*! CLR_WAKE_TIMER - Clear Wake Timer - * 0b0..No effect. - * 0b1..Clears the wake timer counter and halts operation until a new count value is loaded. - */ -#define WAKETIMER_WAKE_TIMER_CTRL_CLR_WAKE_TIMER(x) (((uint32_t)(((uint32_t)(x)) << WAKETIMER_WAKE_TIMER_CTRL_CLR_WAKE_TIMER_SHIFT)) & WAKETIMER_WAKE_TIMER_CTRL_CLR_WAKE_TIMER_MASK) - -#define WAKETIMER_WAKE_TIMER_CTRL_OSC_DIV_ENA_MASK (0x10U) -#define WAKETIMER_WAKE_TIMER_CTRL_OSC_DIV_ENA_SHIFT (4U) -/*! OSC_DIV_ENA - OSC Divide Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define WAKETIMER_WAKE_TIMER_CTRL_OSC_DIV_ENA(x) (((uint32_t)(((uint32_t)(x)) << WAKETIMER_WAKE_TIMER_CTRL_OSC_DIV_ENA_SHIFT)) & WAKETIMER_WAKE_TIMER_CTRL_OSC_DIV_ENA_MASK) - -#define WAKETIMER_WAKE_TIMER_CTRL_INTR_EN_MASK (0x20U) -#define WAKETIMER_WAKE_TIMER_CTRL_INTR_EN_SHIFT (5U) -/*! INTR_EN - Enable Interrupt - * 0b0..Disabled - * 0b1..Enabled - */ -#define WAKETIMER_WAKE_TIMER_CTRL_INTR_EN(x) (((uint32_t)(((uint32_t)(x)) << WAKETIMER_WAKE_TIMER_CTRL_INTR_EN_SHIFT)) & WAKETIMER_WAKE_TIMER_CTRL_INTR_EN_MASK) -/*! @} */ - -/*! @name WAKE_TIMER_CNT - Wake Timer Counter */ -/*! @{ */ - -#define WAKETIMER_WAKE_TIMER_CNT_WAKE_CNT_MASK (0xFFFFFFFFU) -#define WAKETIMER_WAKE_TIMER_CNT_WAKE_CNT_SHIFT (0U) -/*! WAKE_CNT - Wake Counter */ -#define WAKETIMER_WAKE_TIMER_CNT_WAKE_CNT(x) (((uint32_t)(((uint32_t)(x)) << WAKETIMER_WAKE_TIMER_CNT_WAKE_CNT_SHIFT)) & WAKETIMER_WAKE_TIMER_CNT_WAKE_CNT_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group WAKETIMER_Register_Masks */ - - -/* WAKETIMER - Peripheral instance base addresses */ -/** Peripheral WAKETIMER0 base address */ -#define WAKETIMER0_BASE (0x400AE000u) -/** Peripheral WAKETIMER0 base pointer */ -#define WAKETIMER0 ((WAKETIMER_Type *)WAKETIMER0_BASE) -/** Array initializer of WAKETIMER peripheral base addresses */ -#define WAKETIMER_BASE_ADDRS { WAKETIMER0_BASE } -/** Array initializer of WAKETIMER peripheral base pointers */ -#define WAKETIMER_BASE_PTRS { WAKETIMER0 } -/** Interrupt vectors for the WAKETIMER peripheral type */ -#define WAKETIMER_IRQS { WAKETIMER0_IRQn } - -/*! - * @} - */ /* end of group WAKETIMER_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- WUU Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup WUU_Peripheral_Access_Layer WUU Peripheral Access Layer - * @{ - */ - -/** WUU - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - __IO uint32_t PE1; /**< Pin Enable 1, offset: 0x8 */ - __IO uint32_t PE2; /**< Pin Enable 2, offset: 0xC */ - uint8_t RESERVED_0[8]; - __IO uint32_t ME; /**< Module Interrupt Enable, offset: 0x18 */ - __IO uint32_t DE; /**< Module DMA/Trigger Enable, offset: 0x1C */ - __IO uint32_t PF; /**< Pin Flag, offset: 0x20 */ - uint8_t RESERVED_1[12]; - __IO uint32_t FILT; /**< Pin Filter, offset: 0x30 */ - uint8_t RESERVED_2[4]; - __IO uint32_t PDC1; /**< Pin DMA/Trigger Configuration 1, offset: 0x38 */ - __IO uint32_t PDC2; /**< Pin DMA/Trigger Configuration 2, offset: 0x3C */ - uint8_t RESERVED_3[8]; - __IO uint32_t FDC; /**< Pin Filter DMA/Trigger Configuration, offset: 0x48 */ - uint8_t RESERVED_4[4]; - __IO uint32_t PMC; /**< Pin Mode Configuration, offset: 0x50 */ - uint8_t RESERVED_5[4]; - __IO uint32_t FMC; /**< Pin Filter Mode Configuration, offset: 0x58 */ -} WUU_Type; - -/* ---------------------------------------------------------------------------- - -- WUU Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup WUU_Register_Masks WUU Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define WUU_VERID_FEATURE_MASK (0xFFFFU) -#define WUU_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Standard features implemented - * 0b0000000000000001..Support for DMA/Trigger generation from wake-up pins and filters enabled. Support for - * external pin/filter detection during all power modes enabled. - * *.. - */ -#define WUU_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << WUU_VERID_FEATURE_SHIFT)) & WUU_VERID_FEATURE_MASK) - -#define WUU_VERID_MINOR_MASK (0xFF0000U) -#define WUU_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define WUU_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << WUU_VERID_MINOR_SHIFT)) & WUU_VERID_MINOR_MASK) - -#define WUU_VERID_MAJOR_MASK (0xFF000000U) -#define WUU_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define WUU_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << WUU_VERID_MAJOR_SHIFT)) & WUU_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define WUU_PARAM_FILTERS_MASK (0xFFU) -#define WUU_PARAM_FILTERS_SHIFT (0U) -/*! FILTERS - Filter Number */ -#define WUU_PARAM_FILTERS(x) (((uint32_t)(((uint32_t)(x)) << WUU_PARAM_FILTERS_SHIFT)) & WUU_PARAM_FILTERS_MASK) - -#define WUU_PARAM_DMAS_MASK (0xFF00U) -#define WUU_PARAM_DMAS_SHIFT (8U) -/*! DMAS - DMA Number */ -#define WUU_PARAM_DMAS(x) (((uint32_t)(((uint32_t)(x)) << WUU_PARAM_DMAS_SHIFT)) & WUU_PARAM_DMAS_MASK) - -#define WUU_PARAM_MODULES_MASK (0xFF0000U) -#define WUU_PARAM_MODULES_SHIFT (16U) -/*! MODULES - Module Number */ -#define WUU_PARAM_MODULES(x) (((uint32_t)(((uint32_t)(x)) << WUU_PARAM_MODULES_SHIFT)) & WUU_PARAM_MODULES_MASK) - -#define WUU_PARAM_PINS_MASK (0xFF000000U) -#define WUU_PARAM_PINS_SHIFT (24U) -/*! PINS - Pin Number */ -#define WUU_PARAM_PINS(x) (((uint32_t)(((uint32_t)(x)) << WUU_PARAM_PINS_SHIFT)) & WUU_PARAM_PINS_MASK) -/*! @} */ - -/*! @name PE1 - Pin Enable 1 */ -/*! @{ */ - -#define WUU_PE1_Reserved0_MASK (0x3U) -#define WUU_PE1_Reserved0_SHIFT (0U) -/*! Reserved0 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PE1_Reserved0(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_Reserved0_SHIFT)) & WUU_PE1_Reserved0_MASK) - -#define WUU_PE1_Reserved1_MASK (0xCU) -#define WUU_PE1_Reserved1_SHIFT (2U) -/*! Reserved1 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PE1_Reserved1(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_Reserved1_SHIFT)) & WUU_PE1_Reserved1_MASK) - -#define WUU_PE1_WUPE2_MASK (0x30U) -#define WUU_PE1_WUPE2_SHIFT (4U) -/*! WUPE2 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE2(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE2_SHIFT)) & WUU_PE1_WUPE2_MASK) - -#define WUU_PE1_Reserved3_MASK (0xC0U) -#define WUU_PE1_Reserved3_SHIFT (6U) -/*! Reserved3 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PE1_Reserved3(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_Reserved3_SHIFT)) & WUU_PE1_Reserved3_MASK) - -#define WUU_PE1_Reserved4_MASK (0x300U) -#define WUU_PE1_Reserved4_SHIFT (8U) -/*! Reserved4 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PE1_Reserved4(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_Reserved4_SHIFT)) & WUU_PE1_Reserved4_MASK) - -#define WUU_PE1_Reserved5_MASK (0xC00U) -#define WUU_PE1_Reserved5_SHIFT (10U) -/*! Reserved5 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PE1_Reserved5(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_Reserved5_SHIFT)) & WUU_PE1_Reserved5_MASK) - -#define WUU_PE1_WUPE6_MASK (0x3000U) -#define WUU_PE1_WUPE6_SHIFT (12U) -/*! WUPE6 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE6(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE6_SHIFT)) & WUU_PE1_WUPE6_MASK) - -#define WUU_PE1_WUPE7_MASK (0xC000U) -#define WUU_PE1_WUPE7_SHIFT (14U) -/*! WUPE7 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE7(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE7_SHIFT)) & WUU_PE1_WUPE7_MASK) - -#define WUU_PE1_WUPE8_MASK (0x30000U) -#define WUU_PE1_WUPE8_SHIFT (16U) -/*! WUPE8 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE8(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE8_SHIFT)) & WUU_PE1_WUPE8_MASK) - -#define WUU_PE1_WUPE9_MASK (0xC0000U) -#define WUU_PE1_WUPE9_SHIFT (18U) -/*! WUPE9 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE9(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE9_SHIFT)) & WUU_PE1_WUPE9_MASK) - -#define WUU_PE1_WUPE10_MASK (0x300000U) -#define WUU_PE1_WUPE10_SHIFT (20U) -/*! WUPE10 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE10(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE10_SHIFT)) & WUU_PE1_WUPE10_MASK) - -#define WUU_PE1_WUPE11_MASK (0xC00000U) -#define WUU_PE1_WUPE11_SHIFT (22U) -/*! WUPE11 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE11(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE11_SHIFT)) & WUU_PE1_WUPE11_MASK) - -#define WUU_PE1_WUPE12_MASK (0x3000000U) -#define WUU_PE1_WUPE12_SHIFT (24U) -/*! WUPE12 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE12(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE12_SHIFT)) & WUU_PE1_WUPE12_MASK) - -#define WUU_PE1_Reserved13_MASK (0xC000000U) -#define WUU_PE1_Reserved13_SHIFT (26U) -/*! Reserved13 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PE1_Reserved13(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_Reserved13_SHIFT)) & WUU_PE1_Reserved13_MASK) - -#define WUU_PE1_Reserved14_MASK (0x30000000U) -#define WUU_PE1_Reserved14_SHIFT (28U) -/*! Reserved14 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PE1_Reserved14(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_Reserved14_SHIFT)) & WUU_PE1_Reserved14_MASK) - -#define WUU_PE1_Reserved15_MASK (0xC0000000U) -#define WUU_PE1_Reserved15_SHIFT (30U) -/*! Reserved15 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PE1_Reserved15(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_Reserved15_SHIFT)) & WUU_PE1_Reserved15_MASK) -/*! @} */ - -/*! @name PE2 - Pin Enable 2 */ -/*! @{ */ - -#define WUU_PE2_Reserved16_MASK (0x3U) -#define WUU_PE2_Reserved16_SHIFT (0U) -/*! Reserved16 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PE2_Reserved16(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_Reserved16_SHIFT)) & WUU_PE2_Reserved16_MASK) - -#define WUU_PE2_Reserved17_MASK (0xCU) -#define WUU_PE2_Reserved17_SHIFT (2U) -/*! Reserved17 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PE2_Reserved17(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_Reserved17_SHIFT)) & WUU_PE2_Reserved17_MASK) - -#define WUU_PE2_WUPE18_MASK (0x30U) -#define WUU_PE2_WUPE18_SHIFT (4U) -/*! WUPE18 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE18(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE18_SHIFT)) & WUU_PE2_WUPE18_MASK) - -#define WUU_PE2_WUPE19_MASK (0xC0U) -#define WUU_PE2_WUPE19_SHIFT (6U) -/*! WUPE19 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE19(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE19_SHIFT)) & WUU_PE2_WUPE19_MASK) - -#define WUU_PE2_WUPE20_MASK (0x300U) -#define WUU_PE2_WUPE20_SHIFT (8U) -/*! WUPE20 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE20(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE20_SHIFT)) & WUU_PE2_WUPE20_MASK) - -#define WUU_PE2_Reserved21_MASK (0xC00U) -#define WUU_PE2_Reserved21_SHIFT (10U) -/*! Reserved21 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PE2_Reserved21(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_Reserved21_SHIFT)) & WUU_PE2_Reserved21_MASK) - -#define WUU_PE2_WUPE22_MASK (0x3000U) -#define WUU_PE2_WUPE22_SHIFT (12U) -/*! WUPE22 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE22(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE22_SHIFT)) & WUU_PE2_WUPE22_MASK) - -#define WUU_PE2_WUPE23_MASK (0xC000U) -#define WUU_PE2_WUPE23_SHIFT (14U) -/*! WUPE23 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE23(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE23_SHIFT)) & WUU_PE2_WUPE23_MASK) - -#define WUU_PE2_WUPE24_MASK (0x30000U) -#define WUU_PE2_WUPE24_SHIFT (16U) -/*! WUPE24 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE24(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE24_SHIFT)) & WUU_PE2_WUPE24_MASK) - -#define WUU_PE2_WUPE25_MASK (0xC0000U) -#define WUU_PE2_WUPE25_SHIFT (18U) -/*! WUPE25 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE25(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE25_SHIFT)) & WUU_PE2_WUPE25_MASK) - -#define WUU_PE2_WUPE26_MASK (0x300000U) -#define WUU_PE2_WUPE26_SHIFT (20U) -/*! WUPE26 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE26(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE26_SHIFT)) & WUU_PE2_WUPE26_MASK) - -#define WUU_PE2_WUPE27_MASK (0xC00000U) -#define WUU_PE2_WUPE27_SHIFT (22U) -/*! WUPE27 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE27(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE27_SHIFT)) & WUU_PE2_WUPE27_MASK) - -#define WUU_PE2_WUPE28_MASK (0x3000000U) -#define WUU_PE2_WUPE28_SHIFT (24U) -/*! WUPE28 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE28(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE28_SHIFT)) & WUU_PE2_WUPE28_MASK) - -#define WUU_PE2_WUPE29_MASK (0xC000000U) -#define WUU_PE2_WUPE29_SHIFT (26U) -/*! WUPE29 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE29(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE29_SHIFT)) & WUU_PE2_WUPE29_MASK) - -#define WUU_PE2_Reserved30_MASK (0x30000000U) -#define WUU_PE2_Reserved30_SHIFT (28U) -/*! Reserved30 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PE2_Reserved30(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_Reserved30_SHIFT)) & WUU_PE2_Reserved30_MASK) - -#define WUU_PE2_WUPE31_MASK (0xC0000000U) -#define WUU_PE2_WUPE31_SHIFT (30U) -/*! WUPE31 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE31(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE31_SHIFT)) & WUU_PE2_WUPE31_MASK) -/*! @} */ - -/*! @name ME - Module Interrupt Enable */ -/*! @{ */ - -#define WUU_ME_WUME0_MASK (0x1U) -#define WUU_ME_WUME0_SHIFT (0U) -/*! WUME0 - Module Interrupt Wake-up Enable for Module 0 */ -#define WUU_ME_WUME0(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME0_SHIFT)) & WUU_ME_WUME0_MASK) - -#define WUU_ME_WUME2_MASK (0x4U) -#define WUU_ME_WUME2_SHIFT (2U) -/*! WUME2 - Module Interrupt Wake-up Enable for Module 2 */ -#define WUU_ME_WUME2(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME2_SHIFT)) & WUU_ME_WUME2_MASK) - -#define WUU_ME_WUME6_MASK (0x40U) -#define WUU_ME_WUME6_SHIFT (6U) -/*! WUME6 - Module Interrupt Wake-up Enable for Module 6 */ -#define WUU_ME_WUME6(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME6_SHIFT)) & WUU_ME_WUME6_MASK) - -#define WUU_ME_WUME8_MASK (0x100U) -#define WUU_ME_WUME8_SHIFT (8U) -/*! WUME8 - Module Interrupt Wake-up Enable for Module 8 */ -#define WUU_ME_WUME8(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME8_SHIFT)) & WUU_ME_WUME8_MASK) -/*! @} */ - -/*! @name DE - Module DMA/Trigger Enable */ -/*! @{ */ - -#define WUU_DE_WUDE4_MASK (0x10U) -#define WUU_DE_WUDE4_SHIFT (4U) -/*! WUDE4 - DMA/Trigger Wake-up Enable for Module 4 */ -#define WUU_DE_WUDE4(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE4_SHIFT)) & WUU_DE_WUDE4_MASK) - -#define WUU_DE_WUDE6_MASK (0x40U) -#define WUU_DE_WUDE6_SHIFT (6U) -/*! WUDE6 - DMA/Trigger Wake-up Enable for Module 6 */ -#define WUU_DE_WUDE6(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE6_SHIFT)) & WUU_DE_WUDE6_MASK) - -#define WUU_DE_WUDE8_MASK (0x100U) -#define WUU_DE_WUDE8_SHIFT (8U) -/*! WUDE8 - DMA/Trigger Wake-up Enable for Module 8 */ -#define WUU_DE_WUDE8(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE8_SHIFT)) & WUU_DE_WUDE8_MASK) -/*! @} */ - -/*! @name PF - Pin Flag */ -/*! @{ */ - -#define WUU_PF_Reserved0_MASK (0x1U) -#define WUU_PF_Reserved0_SHIFT (0U) -/*! Reserved0 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PF_Reserved0(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_Reserved0_SHIFT)) & WUU_PF_Reserved0_MASK) - -#define WUU_PF_Reserved1_MASK (0x2U) -#define WUU_PF_Reserved1_SHIFT (1U) -/*! Reserved1 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PF_Reserved1(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_Reserved1_SHIFT)) & WUU_PF_Reserved1_MASK) - -#define WUU_PF_WUF2_MASK (0x4U) -#define WUU_PF_WUF2_SHIFT (2U) -/*! WUF2 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF2(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF2_SHIFT)) & WUU_PF_WUF2_MASK) - -#define WUU_PF_Reserved3_MASK (0x8U) -#define WUU_PF_Reserved3_SHIFT (3U) -/*! Reserved3 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PF_Reserved3(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_Reserved3_SHIFT)) & WUU_PF_Reserved3_MASK) - -#define WUU_PF_Reserved4_MASK (0x10U) -#define WUU_PF_Reserved4_SHIFT (4U) -/*! Reserved4 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PF_Reserved4(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_Reserved4_SHIFT)) & WUU_PF_Reserved4_MASK) - -#define WUU_PF_Reserved5_MASK (0x20U) -#define WUU_PF_Reserved5_SHIFT (5U) -/*! Reserved5 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PF_Reserved5(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_Reserved5_SHIFT)) & WUU_PF_Reserved5_MASK) - -#define WUU_PF_WUF6_MASK (0x40U) -#define WUU_PF_WUF6_SHIFT (6U) -/*! WUF6 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF6(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF6_SHIFT)) & WUU_PF_WUF6_MASK) - -#define WUU_PF_WUF7_MASK (0x80U) -#define WUU_PF_WUF7_SHIFT (7U) -/*! WUF7 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF7(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF7_SHIFT)) & WUU_PF_WUF7_MASK) - -#define WUU_PF_WUF8_MASK (0x100U) -#define WUU_PF_WUF8_SHIFT (8U) -/*! WUF8 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF8(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF8_SHIFT)) & WUU_PF_WUF8_MASK) - -#define WUU_PF_WUF9_MASK (0x200U) -#define WUU_PF_WUF9_SHIFT (9U) -/*! WUF9 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF9(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF9_SHIFT)) & WUU_PF_WUF9_MASK) - -#define WUU_PF_WUF10_MASK (0x400U) -#define WUU_PF_WUF10_SHIFT (10U) -/*! WUF10 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF10(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF10_SHIFT)) & WUU_PF_WUF10_MASK) - -#define WUU_PF_WUF11_MASK (0x800U) -#define WUU_PF_WUF11_SHIFT (11U) -/*! WUF11 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF11(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF11_SHIFT)) & WUU_PF_WUF11_MASK) - -#define WUU_PF_WUF12_MASK (0x1000U) -#define WUU_PF_WUF12_SHIFT (12U) -/*! WUF12 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF12(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF12_SHIFT)) & WUU_PF_WUF12_MASK) - -#define WUU_PF_Reserved13_MASK (0x2000U) -#define WUU_PF_Reserved13_SHIFT (13U) -/*! Reserved13 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PF_Reserved13(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_Reserved13_SHIFT)) & WUU_PF_Reserved13_MASK) - -#define WUU_PF_Reserved14_MASK (0x4000U) -#define WUU_PF_Reserved14_SHIFT (14U) -/*! Reserved14 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PF_Reserved14(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_Reserved14_SHIFT)) & WUU_PF_Reserved14_MASK) - -#define WUU_PF_Reserved15_MASK (0x8000U) -#define WUU_PF_Reserved15_SHIFT (15U) -/*! Reserved15 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PF_Reserved15(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_Reserved15_SHIFT)) & WUU_PF_Reserved15_MASK) - -#define WUU_PF_Reserved16_MASK (0x10000U) -#define WUU_PF_Reserved16_SHIFT (16U) -/*! Reserved16 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PF_Reserved16(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_Reserved16_SHIFT)) & WUU_PF_Reserved16_MASK) - -#define WUU_PF_Reserved17_MASK (0x20000U) -#define WUU_PF_Reserved17_SHIFT (17U) -/*! Reserved17 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PF_Reserved17(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_Reserved17_SHIFT)) & WUU_PF_Reserved17_MASK) - -#define WUU_PF_WUF18_MASK (0x40000U) -#define WUU_PF_WUF18_SHIFT (18U) -/*! WUF18 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF18(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF18_SHIFT)) & WUU_PF_WUF18_MASK) - -#define WUU_PF_WUF19_MASK (0x80000U) -#define WUU_PF_WUF19_SHIFT (19U) -/*! WUF19 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF19(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF19_SHIFT)) & WUU_PF_WUF19_MASK) - -#define WUU_PF_WUF20_MASK (0x100000U) -#define WUU_PF_WUF20_SHIFT (20U) -/*! WUF20 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF20(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF20_SHIFT)) & WUU_PF_WUF20_MASK) - -#define WUU_PF_Reserved21_MASK (0x200000U) -#define WUU_PF_Reserved21_SHIFT (21U) -/*! Reserved21 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PF_Reserved21(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_Reserved21_SHIFT)) & WUU_PF_Reserved21_MASK) - -#define WUU_PF_WUF22_MASK (0x400000U) -#define WUU_PF_WUF22_SHIFT (22U) -/*! WUF22 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF22(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF22_SHIFT)) & WUU_PF_WUF22_MASK) - -#define WUU_PF_WUF23_MASK (0x800000U) -#define WUU_PF_WUF23_SHIFT (23U) -/*! WUF23 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF23(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF23_SHIFT)) & WUU_PF_WUF23_MASK) - -#define WUU_PF_WUF24_MASK (0x1000000U) -#define WUU_PF_WUF24_SHIFT (24U) -/*! WUF24 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF24(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF24_SHIFT)) & WUU_PF_WUF24_MASK) - -#define WUU_PF_WUF25_MASK (0x2000000U) -#define WUU_PF_WUF25_SHIFT (25U) -/*! WUF25 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF25(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF25_SHIFT)) & WUU_PF_WUF25_MASK) - -#define WUU_PF_WUF26_MASK (0x4000000U) -#define WUU_PF_WUF26_SHIFT (26U) -/*! WUF26 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF26(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF26_SHIFT)) & WUU_PF_WUF26_MASK) - -#define WUU_PF_WUF27_MASK (0x8000000U) -#define WUU_PF_WUF27_SHIFT (27U) -/*! WUF27 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF27(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF27_SHIFT)) & WUU_PF_WUF27_MASK) - -#define WUU_PF_WUF28_MASK (0x10000000U) -#define WUU_PF_WUF28_SHIFT (28U) -/*! WUF28 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF28(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF28_SHIFT)) & WUU_PF_WUF28_MASK) - -#define WUU_PF_WUF29_MASK (0x20000000U) -#define WUU_PF_WUF29_SHIFT (29U) -/*! WUF29 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF29(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF29_SHIFT)) & WUU_PF_WUF29_MASK) - -#define WUU_PF_Reserved30_MASK (0x40000000U) -#define WUU_PF_Reserved30_SHIFT (30U) -/*! Reserved30 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PF_Reserved30(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_Reserved30_SHIFT)) & WUU_PF_Reserved30_MASK) - -#define WUU_PF_WUF31_MASK (0x80000000U) -#define WUU_PF_WUF31_SHIFT (31U) -/*! WUF31 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF31(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF31_SHIFT)) & WUU_PF_WUF31_MASK) -/*! @} */ - -/*! @name FILT - Pin Filter */ -/*! @{ */ - -#define WUU_FILT_FILTSEL1_MASK (0x1FU) -#define WUU_FILT_FILTSEL1_SHIFT (0U) -/*! FILTSEL1 - Filter 1 Pin Select */ -#define WUU_FILT_FILTSEL1(x) (((uint32_t)(((uint32_t)(x)) << WUU_FILT_FILTSEL1_SHIFT)) & WUU_FILT_FILTSEL1_MASK) - -#define WUU_FILT_FILTE1_MASK (0x60U) -#define WUU_FILT_FILTE1_SHIFT (5U) -/*! FILTE1 - Filter 1 Enable - * 0b00..Disable - * 0b01..Enable (Detect on rising edge or high level) - * 0b10..Enable (Detect on falling edge or low level) - * 0b11..Enable (Detect on any edge) - */ -#define WUU_FILT_FILTE1(x) (((uint32_t)(((uint32_t)(x)) << WUU_FILT_FILTE1_SHIFT)) & WUU_FILT_FILTE1_MASK) - -#define WUU_FILT_FILTF1_MASK (0x80U) -#define WUU_FILT_FILTF1_SHIFT (7U) -/*! FILTF1 - Filter 1 Flag - * 0b0..No - * 0b1..Yes - */ -#define WUU_FILT_FILTF1(x) (((uint32_t)(((uint32_t)(x)) << WUU_FILT_FILTF1_SHIFT)) & WUU_FILT_FILTF1_MASK) - -#define WUU_FILT_FILTSEL2_MASK (0x1F00U) -#define WUU_FILT_FILTSEL2_SHIFT (8U) -/*! FILTSEL2 - Filter 2 Pin Select */ -#define WUU_FILT_FILTSEL2(x) (((uint32_t)(((uint32_t)(x)) << WUU_FILT_FILTSEL2_SHIFT)) & WUU_FILT_FILTSEL2_MASK) - -#define WUU_FILT_FILTE2_MASK (0x6000U) -#define WUU_FILT_FILTE2_SHIFT (13U) -/*! FILTE2 - Filter 2 Enable - * 0b00..Disable - * 0b01..Enable (Detect on rising edge or high level) - * 0b10..Enable (Detect on falling edge or low level) - * 0b11..Enable (Detect on any edge) - */ -#define WUU_FILT_FILTE2(x) (((uint32_t)(((uint32_t)(x)) << WUU_FILT_FILTE2_SHIFT)) & WUU_FILT_FILTE2_MASK) - -#define WUU_FILT_FILTF2_MASK (0x8000U) -#define WUU_FILT_FILTF2_SHIFT (15U) -/*! FILTF2 - Filter 2 Flag - * 0b0..No - * 0b1..Yes - */ -#define WUU_FILT_FILTF2(x) (((uint32_t)(((uint32_t)(x)) << WUU_FILT_FILTF2_SHIFT)) & WUU_FILT_FILTF2_MASK) -/*! @} */ - -/*! @name PDC1 - Pin DMA/Trigger Configuration 1 */ -/*! @{ */ - -#define WUU_PDC1_Reserved0_MASK (0x3U) -#define WUU_PDC1_Reserved0_SHIFT (0U) -/*! Reserved0 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PDC1_Reserved0(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_Reserved0_SHIFT)) & WUU_PDC1_Reserved0_MASK) - -#define WUU_PDC1_Reserved1_MASK (0xCU) -#define WUU_PDC1_Reserved1_SHIFT (2U) -/*! Reserved1 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PDC1_Reserved1(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_Reserved1_SHIFT)) & WUU_PDC1_Reserved1_MASK) - -#define WUU_PDC1_WUPDC2_MASK (0x30U) -#define WUU_PDC1_WUPDC2_SHIFT (4U) -/*! WUPDC2 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC2(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC2_SHIFT)) & WUU_PDC1_WUPDC2_MASK) - -#define WUU_PDC1_Reserved3_MASK (0xC0U) -#define WUU_PDC1_Reserved3_SHIFT (6U) -/*! Reserved3 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PDC1_Reserved3(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_Reserved3_SHIFT)) & WUU_PDC1_Reserved3_MASK) - -#define WUU_PDC1_Reserved4_MASK (0x300U) -#define WUU_PDC1_Reserved4_SHIFT (8U) -/*! Reserved4 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PDC1_Reserved4(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_Reserved4_SHIFT)) & WUU_PDC1_Reserved4_MASK) - -#define WUU_PDC1_Reserved5_MASK (0xC00U) -#define WUU_PDC1_Reserved5_SHIFT (10U) -/*! Reserved5 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PDC1_Reserved5(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_Reserved5_SHIFT)) & WUU_PDC1_Reserved5_MASK) - -#define WUU_PDC1_WUPDC6_MASK (0x3000U) -#define WUU_PDC1_WUPDC6_SHIFT (12U) -/*! WUPDC6 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC6(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC6_SHIFT)) & WUU_PDC1_WUPDC6_MASK) - -#define WUU_PDC1_WUPDC7_MASK (0xC000U) -#define WUU_PDC1_WUPDC7_SHIFT (14U) -/*! WUPDC7 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC7(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC7_SHIFT)) & WUU_PDC1_WUPDC7_MASK) - -#define WUU_PDC1_WUPDC8_MASK (0x30000U) -#define WUU_PDC1_WUPDC8_SHIFT (16U) -/*! WUPDC8 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC8(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC8_SHIFT)) & WUU_PDC1_WUPDC8_MASK) - -#define WUU_PDC1_WUPDC9_MASK (0xC0000U) -#define WUU_PDC1_WUPDC9_SHIFT (18U) -/*! WUPDC9 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC9(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC9_SHIFT)) & WUU_PDC1_WUPDC9_MASK) - -#define WUU_PDC1_WUPDC10_MASK (0x300000U) -#define WUU_PDC1_WUPDC10_SHIFT (20U) -/*! WUPDC10 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC10(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC10_SHIFT)) & WUU_PDC1_WUPDC10_MASK) - -#define WUU_PDC1_WUPDC11_MASK (0xC00000U) -#define WUU_PDC1_WUPDC11_SHIFT (22U) -/*! WUPDC11 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC11(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC11_SHIFT)) & WUU_PDC1_WUPDC11_MASK) - -#define WUU_PDC1_WUPDC12_MASK (0x3000000U) -#define WUU_PDC1_WUPDC12_SHIFT (24U) -/*! WUPDC12 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC12(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC12_SHIFT)) & WUU_PDC1_WUPDC12_MASK) - -#define WUU_PDC1_Reserved13_MASK (0xC000000U) -#define WUU_PDC1_Reserved13_SHIFT (26U) -/*! Reserved13 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PDC1_Reserved13(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_Reserved13_SHIFT)) & WUU_PDC1_Reserved13_MASK) - -#define WUU_PDC1_Reserved14_MASK (0x30000000U) -#define WUU_PDC1_Reserved14_SHIFT (28U) -/*! Reserved14 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PDC1_Reserved14(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_Reserved14_SHIFT)) & WUU_PDC1_Reserved14_MASK) - -#define WUU_PDC1_Reserved15_MASK (0xC0000000U) -#define WUU_PDC1_Reserved15_SHIFT (30U) -/*! Reserved15 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PDC1_Reserved15(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_Reserved15_SHIFT)) & WUU_PDC1_Reserved15_MASK) -/*! @} */ - -/*! @name PDC2 - Pin DMA/Trigger Configuration 2 */ -/*! @{ */ - -#define WUU_PDC2_Reserved16_MASK (0x3U) -#define WUU_PDC2_Reserved16_SHIFT (0U) -/*! Reserved16 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PDC2_Reserved16(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_Reserved16_SHIFT)) & WUU_PDC2_Reserved16_MASK) - -#define WUU_PDC2_Reserved17_MASK (0xCU) -#define WUU_PDC2_Reserved17_SHIFT (2U) -/*! Reserved17 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PDC2_Reserved17(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_Reserved17_SHIFT)) & WUU_PDC2_Reserved17_MASK) - -#define WUU_PDC2_WUPDC18_MASK (0x30U) -#define WUU_PDC2_WUPDC18_SHIFT (4U) -/*! WUPDC18 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC18(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC18_SHIFT)) & WUU_PDC2_WUPDC18_MASK) - -#define WUU_PDC2_WUPDC19_MASK (0xC0U) -#define WUU_PDC2_WUPDC19_SHIFT (6U) -/*! WUPDC19 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC19(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC19_SHIFT)) & WUU_PDC2_WUPDC19_MASK) - -#define WUU_PDC2_WUPDC20_MASK (0x300U) -#define WUU_PDC2_WUPDC20_SHIFT (8U) -/*! WUPDC20 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC20(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC20_SHIFT)) & WUU_PDC2_WUPDC20_MASK) - -#define WUU_PDC2_Reserved21_MASK (0xC00U) -#define WUU_PDC2_Reserved21_SHIFT (10U) -/*! Reserved21 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PDC2_Reserved21(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_Reserved21_SHIFT)) & WUU_PDC2_Reserved21_MASK) - -#define WUU_PDC2_WUPDC22_MASK (0x3000U) -#define WUU_PDC2_WUPDC22_SHIFT (12U) -/*! WUPDC22 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC22(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC22_SHIFT)) & WUU_PDC2_WUPDC22_MASK) - -#define WUU_PDC2_WUPDC23_MASK (0xC000U) -#define WUU_PDC2_WUPDC23_SHIFT (14U) -/*! WUPDC23 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC23(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC23_SHIFT)) & WUU_PDC2_WUPDC23_MASK) - -#define WUU_PDC2_WUPDC24_MASK (0x30000U) -#define WUU_PDC2_WUPDC24_SHIFT (16U) -/*! WUPDC24 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC24(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC24_SHIFT)) & WUU_PDC2_WUPDC24_MASK) - -#define WUU_PDC2_WUPDC25_MASK (0xC0000U) -#define WUU_PDC2_WUPDC25_SHIFT (18U) -/*! WUPDC25 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC25(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC25_SHIFT)) & WUU_PDC2_WUPDC25_MASK) - -#define WUU_PDC2_WUPDC26_MASK (0x300000U) -#define WUU_PDC2_WUPDC26_SHIFT (20U) -/*! WUPDC26 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC26(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC26_SHIFT)) & WUU_PDC2_WUPDC26_MASK) - -#define WUU_PDC2_WUPDC27_MASK (0xC00000U) -#define WUU_PDC2_WUPDC27_SHIFT (22U) -/*! WUPDC27 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC27(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC27_SHIFT)) & WUU_PDC2_WUPDC27_MASK) - -#define WUU_PDC2_WUPDC28_MASK (0x3000000U) -#define WUU_PDC2_WUPDC28_SHIFT (24U) -/*! WUPDC28 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC28(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC28_SHIFT)) & WUU_PDC2_WUPDC28_MASK) - -#define WUU_PDC2_WUPDC29_MASK (0xC000000U) -#define WUU_PDC2_WUPDC29_SHIFT (26U) -/*! WUPDC29 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC29(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC29_SHIFT)) & WUU_PDC2_WUPDC29_MASK) - -#define WUU_PDC2_Reserved30_MASK (0x30000000U) -#define WUU_PDC2_Reserved30_SHIFT (28U) -/*! Reserved30 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PDC2_Reserved30(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_Reserved30_SHIFT)) & WUU_PDC2_Reserved30_MASK) - -#define WUU_PDC2_WUPDC31_MASK (0xC0000000U) -#define WUU_PDC2_WUPDC31_SHIFT (30U) -/*! WUPDC31 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC31(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC31_SHIFT)) & WUU_PDC2_WUPDC31_MASK) -/*! @} */ - -/*! @name FDC - Pin Filter DMA/Trigger Configuration */ -/*! @{ */ - -#define WUU_FDC_FILTC1_MASK (0x3U) -#define WUU_FDC_FILTC1_SHIFT (0U) -/*! FILTC1 - Filter Configuration for FILTn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_FDC_FILTC1(x) (((uint32_t)(((uint32_t)(x)) << WUU_FDC_FILTC1_SHIFT)) & WUU_FDC_FILTC1_MASK) - -#define WUU_FDC_FILTC2_MASK (0xCU) -#define WUU_FDC_FILTC2_SHIFT (2U) -/*! FILTC2 - Filter Configuration for FILTn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_FDC_FILTC2(x) (((uint32_t)(((uint32_t)(x)) << WUU_FDC_FILTC2_SHIFT)) & WUU_FDC_FILTC2_MASK) -/*! @} */ - -/*! @name PMC - Pin Mode Configuration */ -/*! @{ */ - -#define WUU_PMC_Reserved0_MASK (0x1U) -#define WUU_PMC_Reserved0_SHIFT (0U) -/*! Reserved0 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PMC_Reserved0(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_Reserved0_SHIFT)) & WUU_PMC_Reserved0_MASK) - -#define WUU_PMC_Reserved1_MASK (0x2U) -#define WUU_PMC_Reserved1_SHIFT (1U) -/*! Reserved1 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PMC_Reserved1(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_Reserved1_SHIFT)) & WUU_PMC_Reserved1_MASK) - -#define WUU_PMC_WUPMC2_MASK (0x4U) -#define WUU_PMC_WUPMC2_SHIFT (2U) -/*! WUPMC2 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC2(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC2_SHIFT)) & WUU_PMC_WUPMC2_MASK) - -#define WUU_PMC_Reserved3_MASK (0x8U) -#define WUU_PMC_Reserved3_SHIFT (3U) -/*! Reserved3 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PMC_Reserved3(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_Reserved3_SHIFT)) & WUU_PMC_Reserved3_MASK) - -#define WUU_PMC_Reserved4_MASK (0x10U) -#define WUU_PMC_Reserved4_SHIFT (4U) -/*! Reserved4 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PMC_Reserved4(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_Reserved4_SHIFT)) & WUU_PMC_Reserved4_MASK) - -#define WUU_PMC_Reserved5_MASK (0x20U) -#define WUU_PMC_Reserved5_SHIFT (5U) -/*! Reserved5 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PMC_Reserved5(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_Reserved5_SHIFT)) & WUU_PMC_Reserved5_MASK) - -#define WUU_PMC_WUPMC6_MASK (0x40U) -#define WUU_PMC_WUPMC6_SHIFT (6U) -/*! WUPMC6 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC6(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC6_SHIFT)) & WUU_PMC_WUPMC6_MASK) - -#define WUU_PMC_WUPMC7_MASK (0x80U) -#define WUU_PMC_WUPMC7_SHIFT (7U) -/*! WUPMC7 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC7(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC7_SHIFT)) & WUU_PMC_WUPMC7_MASK) - -#define WUU_PMC_WUPMC8_MASK (0x100U) -#define WUU_PMC_WUPMC8_SHIFT (8U) -/*! WUPMC8 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC8(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC8_SHIFT)) & WUU_PMC_WUPMC8_MASK) - -#define WUU_PMC_WUPMC9_MASK (0x200U) -#define WUU_PMC_WUPMC9_SHIFT (9U) -/*! WUPMC9 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC9(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC9_SHIFT)) & WUU_PMC_WUPMC9_MASK) - -#define WUU_PMC_WUPMC10_MASK (0x400U) -#define WUU_PMC_WUPMC10_SHIFT (10U) -/*! WUPMC10 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC10(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC10_SHIFT)) & WUU_PMC_WUPMC10_MASK) - -#define WUU_PMC_WUPMC11_MASK (0x800U) -#define WUU_PMC_WUPMC11_SHIFT (11U) -/*! WUPMC11 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC11(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC11_SHIFT)) & WUU_PMC_WUPMC11_MASK) - -#define WUU_PMC_WUPMC12_MASK (0x1000U) -#define WUU_PMC_WUPMC12_SHIFT (12U) -/*! WUPMC12 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC12(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC12_SHIFT)) & WUU_PMC_WUPMC12_MASK) - -#define WUU_PMC_Reserved13_MASK (0x2000U) -#define WUU_PMC_Reserved13_SHIFT (13U) -/*! Reserved13 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PMC_Reserved13(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_Reserved13_SHIFT)) & WUU_PMC_Reserved13_MASK) - -#define WUU_PMC_Reserved14_MASK (0x4000U) -#define WUU_PMC_Reserved14_SHIFT (14U) -/*! Reserved14 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PMC_Reserved14(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_Reserved14_SHIFT)) & WUU_PMC_Reserved14_MASK) - -#define WUU_PMC_Reserved15_MASK (0x8000U) -#define WUU_PMC_Reserved15_SHIFT (15U) -/*! Reserved15 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PMC_Reserved15(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_Reserved15_SHIFT)) & WUU_PMC_Reserved15_MASK) - -#define WUU_PMC_Reserved16_MASK (0x10000U) -#define WUU_PMC_Reserved16_SHIFT (16U) -/*! Reserved16 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PMC_Reserved16(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_Reserved16_SHIFT)) & WUU_PMC_Reserved16_MASK) - -#define WUU_PMC_Reserved17_MASK (0x20000U) -#define WUU_PMC_Reserved17_SHIFT (17U) -/*! Reserved17 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PMC_Reserved17(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_Reserved17_SHIFT)) & WUU_PMC_Reserved17_MASK) - -#define WUU_PMC_WUPMC18_MASK (0x40000U) -#define WUU_PMC_WUPMC18_SHIFT (18U) -/*! WUPMC18 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC18(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC18_SHIFT)) & WUU_PMC_WUPMC18_MASK) - -#define WUU_PMC_WUPMC19_MASK (0x80000U) -#define WUU_PMC_WUPMC19_SHIFT (19U) -/*! WUPMC19 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC19(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC19_SHIFT)) & WUU_PMC_WUPMC19_MASK) - -#define WUU_PMC_WUPMC20_MASK (0x100000U) -#define WUU_PMC_WUPMC20_SHIFT (20U) -/*! WUPMC20 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC20(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC20_SHIFT)) & WUU_PMC_WUPMC20_MASK) - -#define WUU_PMC_Reserved21_MASK (0x200000U) -#define WUU_PMC_Reserved21_SHIFT (21U) -/*! Reserved21 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PMC_Reserved21(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_Reserved21_SHIFT)) & WUU_PMC_Reserved21_MASK) - -#define WUU_PMC_WUPMC22_MASK (0x400000U) -#define WUU_PMC_WUPMC22_SHIFT (22U) -/*! WUPMC22 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC22(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC22_SHIFT)) & WUU_PMC_WUPMC22_MASK) - -#define WUU_PMC_WUPMC23_MASK (0x800000U) -#define WUU_PMC_WUPMC23_SHIFT (23U) -/*! WUPMC23 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC23(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC23_SHIFT)) & WUU_PMC_WUPMC23_MASK) - -#define WUU_PMC_WUPMC24_MASK (0x1000000U) -#define WUU_PMC_WUPMC24_SHIFT (24U) -/*! WUPMC24 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC24(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC24_SHIFT)) & WUU_PMC_WUPMC24_MASK) - -#define WUU_PMC_WUPMC25_MASK (0x2000000U) -#define WUU_PMC_WUPMC25_SHIFT (25U) -/*! WUPMC25 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC25(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC25_SHIFT)) & WUU_PMC_WUPMC25_MASK) - -#define WUU_PMC_WUPMC26_MASK (0x4000000U) -#define WUU_PMC_WUPMC26_SHIFT (26U) -/*! WUPMC26 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC26(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC26_SHIFT)) & WUU_PMC_WUPMC26_MASK) - -#define WUU_PMC_WUPMC27_MASK (0x8000000U) -#define WUU_PMC_WUPMC27_SHIFT (27U) -/*! WUPMC27 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC27(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC27_SHIFT)) & WUU_PMC_WUPMC27_MASK) - -#define WUU_PMC_WUPMC28_MASK (0x10000000U) -#define WUU_PMC_WUPMC28_SHIFT (28U) -/*! WUPMC28 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC28(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC28_SHIFT)) & WUU_PMC_WUPMC28_MASK) - -#define WUU_PMC_WUPMC29_MASK (0x20000000U) -#define WUU_PMC_WUPMC29_SHIFT (29U) -/*! WUPMC29 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC29(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC29_SHIFT)) & WUU_PMC_WUPMC29_MASK) - -#define WUU_PMC_Reserved30_MASK (0x40000000U) -#define WUU_PMC_Reserved30_SHIFT (30U) -/*! Reserved30 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PMC_Reserved30(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_Reserved30_SHIFT)) & WUU_PMC_Reserved30_MASK) - -#define WUU_PMC_WUPMC31_MASK (0x80000000U) -#define WUU_PMC_WUPMC31_SHIFT (31U) -/*! WUPMC31 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC31(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC31_SHIFT)) & WUU_PMC_WUPMC31_MASK) -/*! @} */ - -/*! @name FMC - Pin Filter Mode Configuration */ -/*! @{ */ - -#define WUU_FMC_FILTM1_MASK (0x1U) -#define WUU_FMC_FILTM1_SHIFT (0U) -/*! FILTM1 - Filter Mode for FILTn - * 0b0..Active only during Power Down/Deep Power Down mode - * 0b1..Active during all power modes - */ -#define WUU_FMC_FILTM1(x) (((uint32_t)(((uint32_t)(x)) << WUU_FMC_FILTM1_SHIFT)) & WUU_FMC_FILTM1_MASK) - -#define WUU_FMC_FILTM2_MASK (0x2U) -#define WUU_FMC_FILTM2_SHIFT (1U) -/*! FILTM2 - Filter Mode for FILTn - * 0b0..Active only during Power Down/Deep Power Down mode - * 0b1..Active during all power modes - */ -#define WUU_FMC_FILTM2(x) (((uint32_t)(((uint32_t)(x)) << WUU_FMC_FILTM2_SHIFT)) & WUU_FMC_FILTM2_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group WUU_Register_Masks */ - - -/* WUU - Peripheral instance base addresses */ -/** Peripheral WUU0 base address */ -#define WUU0_BASE (0x40092000u) -/** Peripheral WUU0 base pointer */ -#define WUU0 ((WUU_Type *)WUU0_BASE) -/** Array initializer of WUU peripheral base addresses */ -#define WUU_BASE_ADDRS { WUU0_BASE } -/** Array initializer of WUU peripheral base pointers */ -#define WUU_BASE_PTRS { WUU0 } - -/*! - * @} - */ /* end of group WUU_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- WWDT Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup WWDT_Peripheral_Access_Layer WWDT Peripheral Access Layer - * @{ - */ - -/** WWDT - Register Layout Typedef */ -typedef struct { - __IO uint32_t MOD; /**< Mode, offset: 0x0 */ - __IO uint32_t TC; /**< Timer Constant, offset: 0x4 */ - __O uint32_t FEED; /**< Feed Sequence, offset: 0x8 */ - __I uint32_t TV; /**< Timer Value, offset: 0xC */ - uint8_t RESERVED_0[4]; - __IO uint32_t WARNINT; /**< Warning Interrupt Compare Value, offset: 0x14 */ - __IO uint32_t WINDOW; /**< Window Compare Value, offset: 0x18 */ -} WWDT_Type; - -/* ---------------------------------------------------------------------------- - -- WWDT Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup WWDT_Register_Masks WWDT Register Masks - * @{ - */ - -/*! @name MOD - Mode */ -/*! @{ */ - -#define WWDT_MOD_WDEN_MASK (0x1U) -#define WWDT_MOD_WDEN_SHIFT (0U) -/*! WDEN - Watchdog Enable - * 0b0..Timer stopped - * 0b1..Timer running - */ -#define WWDT_MOD_WDEN(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_WDEN_SHIFT)) & WWDT_MOD_WDEN_MASK) - -#define WWDT_MOD_WDRESET_MASK (0x2U) -#define WWDT_MOD_WDRESET_SHIFT (1U) -/*! WDRESET - Watchdog Reset Enable - * 0b0..Interrupt - * 0b1..Reset - */ -#define WWDT_MOD_WDRESET(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_WDRESET_SHIFT)) & WWDT_MOD_WDRESET_MASK) - -#define WWDT_MOD_WDTOF_MASK (0x4U) -#define WWDT_MOD_WDTOF_SHIFT (2U) -/*! WDTOF - Watchdog Timeout Flag - * 0b0..Watchdog event has not occurred. - * 0b1..Watchdog event has occurred (causes a chip reset if WDRESET = 1). - */ -#define WWDT_MOD_WDTOF(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_WDTOF_SHIFT)) & WWDT_MOD_WDTOF_MASK) - -#define WWDT_MOD_WDINT_MASK (0x8U) -#define WWDT_MOD_WDINT_SHIFT (3U) -/*! WDINT - Warning Interrupt Flag - * 0b0..No flag - * 0b1..Flag - */ -#define WWDT_MOD_WDINT(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_WDINT_SHIFT)) & WWDT_MOD_WDINT_MASK) - -#define WWDT_MOD_WDPROTECT_MASK (0x10U) -#define WWDT_MOD_WDPROTECT_SHIFT (4U) -/*! WDPROTECT - Watchdog Update Mode - * 0b0..Flexible - * 0b1..Threshold - */ -#define WWDT_MOD_WDPROTECT(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_WDPROTECT_SHIFT)) & WWDT_MOD_WDPROTECT_MASK) - -#define WWDT_MOD_LOCK_MASK (0x20U) -#define WWDT_MOD_LOCK_SHIFT (5U) -/*! LOCK - Lock - * 0b0..No Lock - * 0b1..Lock - */ -#define WWDT_MOD_LOCK(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_LOCK_SHIFT)) & WWDT_MOD_LOCK_MASK) - -#define WWDT_MOD_DEBUG_EN_MASK (0x40U) -#define WWDT_MOD_DEBUG_EN_SHIFT (6U) -/*! DEBUG_EN - Debug Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define WWDT_MOD_DEBUG_EN(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_DEBUG_EN_SHIFT)) & WWDT_MOD_DEBUG_EN_MASK) -/*! @} */ - -/*! @name TC - Timer Constant */ -/*! @{ */ - -#define WWDT_TC_COUNT_MASK (0xFFFFFFU) -#define WWDT_TC_COUNT_SHIFT (0U) -/*! COUNT - Watchdog Timeout Value */ -#define WWDT_TC_COUNT(x) (((uint32_t)(((uint32_t)(x)) << WWDT_TC_COUNT_SHIFT)) & WWDT_TC_COUNT_MASK) -/*! @} */ - -/*! @name FEED - Feed Sequence */ -/*! @{ */ - -#define WWDT_FEED_FEED_MASK (0xFFU) -#define WWDT_FEED_FEED_SHIFT (0U) -/*! FEED - Feed Value */ -#define WWDT_FEED_FEED(x) (((uint32_t)(((uint32_t)(x)) << WWDT_FEED_FEED_SHIFT)) & WWDT_FEED_FEED_MASK) -/*! @} */ - -/*! @name TV - Timer Value */ -/*! @{ */ - -#define WWDT_TV_COUNT_MASK (0xFFFFFFU) -#define WWDT_TV_COUNT_SHIFT (0U) -/*! COUNT - Counter Timer Value */ -#define WWDT_TV_COUNT(x) (((uint32_t)(((uint32_t)(x)) << WWDT_TV_COUNT_SHIFT)) & WWDT_TV_COUNT_MASK) -/*! @} */ - -/*! @name WARNINT - Warning Interrupt Compare Value */ -/*! @{ */ - -#define WWDT_WARNINT_WARNINT_MASK (0x3FFU) -#define WWDT_WARNINT_WARNINT_SHIFT (0U) -/*! WARNINT - Watchdog Warning Interrupt Compare Value */ -#define WWDT_WARNINT_WARNINT(x) (((uint32_t)(((uint32_t)(x)) << WWDT_WARNINT_WARNINT_SHIFT)) & WWDT_WARNINT_WARNINT_MASK) -/*! @} */ - -/*! @name WINDOW - Window Compare Value */ -/*! @{ */ - -#define WWDT_WINDOW_WINDOW_MASK (0xFFFFFFU) -#define WWDT_WINDOW_WINDOW_SHIFT (0U) -/*! WINDOW - Watchdog Window Value */ -#define WWDT_WINDOW_WINDOW(x) (((uint32_t)(((uint32_t)(x)) << WWDT_WINDOW_WINDOW_SHIFT)) & WWDT_WINDOW_WINDOW_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group WWDT_Register_Masks */ - - -/* WWDT - Peripheral instance base addresses */ -/** Peripheral WWDT0 base address */ -#define WWDT0_BASE (0x4000C000u) -/** Peripheral WWDT0 base pointer */ -#define WWDT0 ((WWDT_Type *)WWDT0_BASE) -/** Array initializer of WWDT peripheral base addresses */ -#define WWDT_BASE_ADDRS { WWDT0_BASE } -/** Array initializer of WWDT peripheral base pointers */ -#define WWDT_BASE_PTRS { WWDT0 } - -/*! - * @} - */ /* end of group WWDT_Peripheral_Access_Layer */ - - -/* -** End of section using anonymous unions -*/ - -#if defined(__ARMCC_VERSION) - #if (__ARMCC_VERSION >= 6010050) - #pragma clang diagnostic pop - #else - #pragma pop - #endif -#elif defined(__GNUC__) - /* leave anonymous unions enabled */ -#elif defined(__IAR_SYSTEMS_ICC__) - #pragma language=default -#else - #error Not supported compiler type -#endif - -/*! - * @} - */ /* end of group Peripheral_access_layer */ - - -/* ---------------------------------------------------------------------------- - -- Macros for use with bit field definitions (xxx_SHIFT, xxx_MASK). - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup Bit_Field_Generic_Macros Macros for use with bit field definitions (xxx_SHIFT, xxx_MASK). - * @{ - */ - -#if defined(__ARMCC_VERSION) - #if (__ARMCC_VERSION >= 6010050) - #pragma clang system_header - #endif -#elif defined(__IAR_SYSTEMS_ICC__) - #pragma system_include -#endif - -/** - * @brief Mask and left-shift a bit field value for use in a register bit range. - * @param field Name of the register bit field. - * @param value Value of the bit field. - * @return Masked and shifted value. - */ -#define NXP_VAL2FLD(field, value) (((value) << (field ## _SHIFT)) & (field ## _MASK)) -/** - * @brief Mask and right-shift a register value to extract a bit field value. - * @param field Name of the register bit field. - * @param value Value of the register. - * @return Masked and shifted bit field value. - */ -#define NXP_FLD2VAL(field, value) (((value) & (field ## _MASK)) >> (field ## _SHIFT)) - -/*! - * @} - */ /* end of group Bit_Field_Generic_Macros */ - - -/* ---------------------------------------------------------------------------- - -- SDK Compatibility - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SDK_Compatibility_Symbols SDK Compatibility - * @{ - */ - -/** High Speed SPI (Flexcomm 8) interrupt name */ -#define LSPI_HS_IRQn FLEXCOMM8_IRQn - - -/*! - * @} - */ /* end of group SDK_Compatibility_Symbols */ - - -#endif /* MCXA153_H_ */ - diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/MCXA153_features.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/MCXA153_features.h deleted file mode 100644 index 63285c68f56..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/MCXA153_features.h +++ /dev/null @@ -1,654 +0,0 @@ -/* -** ################################################################### -** Version: rev. 1.0, 2022-03-29 -** Build: b240428 -** -** Abstract: -** Chip specific module features. -** -** Copyright 2016 Freescale Semiconductor, Inc. -** Copyright 2016-2024 NXP -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** Revisions: -** - rev. 1.0 (2022-03-29) -** Initial version based on v0.1UM -** -** ################################################################### -*/ - -#ifndef _MCXA153_FEATURES_H_ -#define _MCXA153_FEATURES_H_ - -/* SOC module features */ - -/* @brief AOI availability on the SoC. */ -#define FSL_FEATURE_SOC_AOI_COUNT (1) -/* @brief CDOG availability on the SoC. */ -#define FSL_FEATURE_SOC_CDOG_COUNT (1) -/* @brief CMC availability on the SoC. */ -#define FSL_FEATURE_SOC_CMC_COUNT (1) -/* @brief CRC availability on the SoC. */ -#define FSL_FEATURE_SOC_CRC_COUNT (1) -/* @brief CTIMER availability on the SoC. */ -#define FSL_FEATURE_SOC_CTIMER_COUNT (3) -/* @brief EDMA availability on the SoC. */ -#define FSL_FEATURE_SOC_EDMA_COUNT (1) -/* @brief EIM availability on the SoC. */ -#define FSL_FEATURE_SOC_EIM_COUNT (1) -/* @brief EQDC availability on the SoC. */ -#define FSL_FEATURE_SOC_EQDC_COUNT (1) -/* @brief FMC availability on the SoC. */ -#define FSL_FEATURE_SOC_FMC_COUNT (1) -/* @brief FREQME availability on the SoC. */ -#define FSL_FEATURE_SOC_FREQME_COUNT (1) -/* @brief GPIO availability on the SoC. */ -#define FSL_FEATURE_SOC_GPIO_COUNT (4) -/* @brief SPC availability on the SoC. */ -#define FSL_FEATURE_SOC_SPC_COUNT (1) -/* @brief I3C availability on the SoC. */ -#define FSL_FEATURE_SOC_I3C_COUNT (1) -/* @brief INPUTMUX availability on the SoC. */ -#define FSL_FEATURE_SOC_INPUTMUX_COUNT (1) -/* @brief LPADC availability on the SoC. */ -#define FSL_FEATURE_SOC_LPADC_COUNT (1) -/* @brief LPCMP availability on the SoC. */ -#define FSL_FEATURE_SOC_LPCMP_COUNT (2) -/* @brief LPI2C availability on the SoC. */ -#define FSL_FEATURE_SOC_LPI2C_COUNT (1) -/* @brief LPSPI availability on the SoC. */ -#define FSL_FEATURE_SOC_LPSPI_COUNT (2) -/* @brief LPTMR availability on the SoC. */ -#define FSL_FEATURE_SOC_LPTMR_COUNT (1) -/* @brief LPUART availability on the SoC. */ -#define FSL_FEATURE_SOC_LPUART_COUNT (3) -/* @brief OSTIMER availability on the SoC. */ -#define FSL_FEATURE_SOC_OSTIMER_COUNT (1) -/* @brief PORT availability on the SoC. */ -#define FSL_FEATURE_SOC_PORT_COUNT (4) -/* @brief PWM availability on the SoC. */ -#define FSL_FEATURE_SOC_PWM_COUNT (1) -/* @brief SCG availability on the SoC. */ -#define FSL_FEATURE_SOC_SCG_COUNT (1) -/* @brief SYSCON availability on the SoC. */ -#define FSL_FEATURE_SOC_SYSCON_COUNT (1) -/* @brief USB availability on the SoC. */ -#define FSL_FEATURE_SOC_USB_COUNT (1) -/* @brief UTICK availability on the SoC. */ -#define FSL_FEATURE_SOC_UTICK_COUNT (1) -/* @brief WAKETIMER availability on the SoC. */ -#define FSL_FEATURE_SOC_WAKETIMER_COUNT (1) -/* @brief WWDT availability on the SoC. */ -#define FSL_FEATURE_SOC_WWDT_COUNT (1) -/* @brief WUU availability on the SoC. */ -#define FSL_FEATURE_SOC_WUU_COUNT (1) - -/* LPADC module features */ - -/* @brief FIFO availability on the SoC. */ -#define FSL_FEATURE_LPADC_FIFO_COUNT (1) -/* @brief Has subsequent trigger priority (bitfield CFG[TPRICTRL]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_SUBSEQUENT_PRIORITY (1) -/* @brief Has differential mode (bitfield CMDLn[DIFF]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_DIFF (0) -/* @brief Has channel scale (bitfield CMDLn[CSCALE]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_CSCALE (0) -/* @brief Has conversion type select (bitfield CMDLn[CTYPE]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_CTYPE (1) -/* @brief Has conversion resolution select (bitfield CMDLn[MODE]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_MODE (1) -/* @brief Has compare function enable (bitfield CMDHn[CMPEN]). */ -#define FSL_FEATURE_LPADC_HAS_CMDH_CMPEN (1) -/* @brief Has Wait for trigger assertion before execution (bitfield CMDHn[WAIT_TRIG]). */ -#define FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG (1) -/* @brief Has offset calibration (bitfield CTRL[CALOFS]). */ -#define FSL_FEATURE_LPADC_HAS_CTRL_CALOFS (1) -/* @brief Has gain calibration (bitfield CTRL[CAL_REQ]). */ -#define FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ (1) -/* @brief Has calibration average (bitfield CTRL[CAL_AVGS]). */ -#define FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS (1) -/* @brief Has internal clock (bitfield CFG[ADCKEN]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_ADCKEN (0) -/* @brief Enable support for low voltage reference on option 1 reference (bitfield CFG[VREF1RNG]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG (0) -/* @brief Has calibration (bitfield CFG[CALOFS]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_CALOFS (0) -/* @brief Has offset trim (register OFSTRIM). */ -#define FSL_FEATURE_LPADC_HAS_OFSTRIM (1) -/* @brief OFSTRIM availability on the SoC. */ -#define FSL_FEATURE_LPADC_OFSTRIM_COUNT (1) -/* @brief Has Trigger status register. */ -#define FSL_FEATURE_LPADC_HAS_TSTAT (1) -/* @brief Has power select (bitfield CFG[PWRSEL]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_PWRSEL (1) -/* @brief Has alternate channel B scale (bitfield CMDLn[ALTB_CSCALE]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE (0) -/* @brief Has alternate channel B select enable (bitfield CMDLn[ALTBEN]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN (0) -/* @brief Has alternate channel input (bitfield CMDLn[ALTB_ADCH]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_ALTB_ADCH (0) -/* @brief Has offset calibration mode (bitfield CTRL[CALOFSMODE]). */ -#define FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE (0) -/* @brief Conversion averaged bitfiled width. */ -#define FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH (4) -/* @brief Has B side channels. */ -#define FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS (0) -/* @brief Indicate whether the LPADC STAT register has trigger exception interrupt function (bitfield STAT[TEXC_INT]). */ -#define FSL_FEATURE_LPADC_HAS_STAT_TEXC_INT (1) -/* @brief Indicate whether the LPADC STAT register has trigger completion interrupt function (bitfield STAT[TCOMP_INT]). */ -#define FSL_FEATURE_LPADC_HAS_STAT_TCOMP_INT (1) -/* @brief Indicate whether the LPADC STAT register has calibration ready function (bitfield STAT[CAL_RDY]). */ -#define FSL_FEATURE_LPADC_HAS_STAT_CAL_RDY (1) -/* @brief Indicate whether the LPADC STAT register has ADC active function (bitfield STAT[ADC_ACTIVE]). */ -#define FSL_FEATURE_LPADC_HAS_STAT_ADC_ACTIVE (1) -/* @brief Indicate whether the LPADC IE register has trigger exception interrupt enable function (bitfield IE[TEXC_IE]). */ -#define FSL_FEATURE_LPADC_HAS_IE_TEXC_IE (1) -/* @brief Indicate whether the LPADC IE register has trigger completion interrupt enable function (bitfield IE[TCOMP_IE]). */ -#define FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE (1) -/* @brief Indicate whether the LPADC CFG register has trigger resume/restart enable function (bitfield CFG[TRES]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_TRES (1) -/* @brief Indicate whether the LPADC CFG register has trigger command resume/restart enable function (bitfield CFG[TCMDRES]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_TCMDRES (1) -/* @brief Indicate whether the LPADC CFG register has high priority trigger exception disable function (bitfield CFG[HPT_EXDI]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI (1) -/* @brief Indicate LPADC CFG register TPRICTRL bitfield width. */ -#define FSL_FEATURE_LPADC_CFG_TPRICTRL_BITFIELD_WIDTH (2) -/* @brief Has internal temperature sensor. */ -#define FSL_FEATURE_LPADC_HAS_INTERNAL_TEMP_SENSOR (1) -/* @brief Temperature sensor parameter A (slope). */ -#define FSL_FEATURE_LPADC_TEMP_PARAMETER_A (738.0f) -/* @brief Temperature sensor parameter B (offset). */ -#define FSL_FEATURE_LPADC_TEMP_PARAMETER_B (287.5f) -/* @brief Temperature sensor parameter Alpha. */ -#define FSL_FEATURE_LPADC_TEMP_PARAMETER_ALPHA (10.06f) -/* @brief The buffer size of temperature sensor. */ -#define FSL_FEATURE_LPADC_TEMP_SENS_BUFFER_SIZE (2U) - -/* AOI module features */ - -/* @brief Maximum value of input mux. */ -#define FSL_FEATURE_AOI_MODULE_INPUTS (4) -/* @brief Number of events related to number of registers AOIx_BFCRT01n/AOIx_BFCRT23n. */ -#define FSL_FEATURE_AOI_EVENT_COUNT (4) - -/* CDOG module features */ - -/* @brief CDOG Has No Reset */ -#define FSL_FEATURE_CDOG_HAS_NO_RESET (1) - -/* CMC module features */ - -/* @brief Has SRAM_DIS register */ -#define FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG (0) -/* @brief Has BSR register */ -#define FSL_FEATURE_MCX_CMC_HAS_BSR_REG (0) -/* @brief Has RSTCNT register */ -#define FSL_FEATURE_MCX_CMC_HAS_RSTCNT_REG (1) -/* @brief Has BLR register */ -#define FSL_FEATURE_MCX_CMC_HAS_BLR_REG (0) - -/* LPCMP module features */ - -/* @brief Has CCR1 FUNC_CLK_SEL bitfield. */ -#define FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL (1) -/* @brief Has IER RRF_IE bitfield. */ -#define FSL_FEATURE_LPCMP_HAS_IER_RRF_IE (1) -/* @brief Has CSR RRF bitfield. */ -#define FSL_FEATURE_LPCMP_HAS_CSR_RRF (1) -/* @brief Has Round Robin mode (related to existence of registers RRCR0). */ -#define FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE (1) -/* @brief Has window mode (related to existence of CCR1.WINDOW_CLS). */ -#define FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL (1) -/* @brief Has no CCR0 CMP_STOP_EN bitfield. */ -#define FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN (0) - -/* CTIMER module features */ - -/* @brief CTIMER has no capture channel. */ -#define FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE (0) -/* @brief CTIMER has no capture 2 interrupt. */ -#define FSL_FEATURE_CTIMER_HAS_NO_IR_CR2INT (0) -/* @brief CTIMER capture 3 interrupt. */ -#define FSL_FEATURE_CTIMER_HAS_IR_CR3INT (1) -/* @brief Has CTIMER CCR_CAP2 (register bits CCR[CAP2RE][CAP2FE][CAP2I]. */ -#define FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2 (0) -/* @brief Has CTIMER CCR_CAP3 (register bits CCR[CAP3RE][CAP3FE][CAP3I]). */ -#define FSL_FEATURE_CTIMER_HAS_CCR_CAP3 (1) -/* @brief CTIMER Has register MSR */ -#define FSL_FEATURE_CTIMER_HAS_MSR (1) - -/* EDMA module features */ - -/* @brief Number of DMA channels (related to number of registers TCD, DCHPRI, bit fields ERQ[ERQn], EEI[EEIn], INT[INTn], ERR[ERRn], HRS[HRSn] and bit field widths ES[ERRCHN], CEEI[CEEI], SEEI[SEEI], CERQ[CERQ], SERQ[SERQ], CDNE[CDNE], SSRT[SSRT], CERR[CERR], CINT[CINT], TCDn_CITER_ELINKYES[LINKCH], TCDn_CSR[MAJORLINKCH], TCDn_BITER_ELINKYES[LINKCH]). (Valid only for eDMA modules.) */ -#define FSL_FEATURE_EDMA_MODULE_CHANNEL (4) -/* @brief If 8 bytes transfer supported. */ -#define FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER (1) -/* @brief Number of DMA channel groups (register bit fields CR[ERGA], CR[GRPnPRI], ES[GPE], DCHPRIn[GRPPRI]). (Valid only for eDMA modules.) */ -#define FSL_FEATURE_EDMA_CHANNEL_GROUP_COUNT (1) -/* @brief If 16 bytes transfer supported. */ -#define FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER (1) -/* @brief Has DMA_Error interrupt vector. */ -#define FSL_FEATURE_EDMA_HAS_ERROR_IRQ (1) -/* @brief If 64 bytes transfer supported. */ -#define FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER (1) -/* @brief whether has prot register */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_PROT_REGISTERn(x) (0) -/* @brief If 128 bytes transfer supported. */ -#define FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER (1) -/* @brief whether has MP channel mux */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_MP_CHANNEL_MUXn(x) (0) -/* @brief If 128 bytes transfer supported. */ -#define FSL_FEATURE_EDMA_INSTANCE_SUPPORT_128_BYTES_TRANSFERn(x) (1) -/* @brief If channel clock controlled independently */ -#define FSL_FEATURE_EDMA_CHANNEL_HAS_OWN_CLOCK_GATE (1) -/* @brief Has register CH_CSR. */ -#define FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG (1) -/* @brief Number of channel for each EDMA instance, (only defined for soc with different channel numbers for difference instance) */ -#define FSL_FEATURE_EDMA_INSTANCE_CHANNELn(x) (4) -/* @brief Has channel mux */ -#define FSL_FEATURE_EDMA_HAS_CHANNEL_MUX (1) -/* @brief Has no register bit fields MP_CSR[EBW]. */ -#define FSL_FEATURE_EDMA_HAS_NO_MP_CSR_EBW (1) -/* @brief Instance has channel mux */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_MUXn(x) (1) -/* @brief If dma has common clock gate */ -#define FSL_FEATURE_EDMA_HAS_COMMON_CLOCK_GATE (0) -/* @brief Has register CH_SBR. */ -#define FSL_FEATURE_EDMA_HAS_SBR (1) -/* @brief If dma channel IRQ support parameter */ -#define FSL_FEATURE_EDMA_MODULE_CHANNEL_IRQ_ENTRY_SUPPORT_PARAMETER (0) -/* @brief Has no register bit fields CH_SBR[ATTR]. */ -#define FSL_FEATURE_EDMA_HAS_NO_CH_SBR_ATTR (1) -/* @brief NBYTES must be multiple of 8 when using scatter gather. */ -#define FSL_FEATURE_EDMA_HAS_ERRATA_51327 (0) -/* @brief Has register bit field CH_CSR[SWAP]. */ -#define FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE (0) -/* @brief NBYTES must be multiple of 8 when using scatter gather. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_ERRATA_51327n(x) (0) -/* @brief Instance has register bit field CH_CSR[SWAP]. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_SWAP_SIZEn(x) (0) -/* @brief Has register bit fields MP_CSR[GMRC]. */ -#define FSL_FEATURE_EDMA_HAS_GLOBAL_MASTER_ID_REPLICATION (1) -/* @brief Has register bit field CH_SBR[INSTR]. */ -#define FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE (0) -/* @brief Instance has register bit field CH_SBR[INSTR]. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_ACCESS_TYPEn(x) (0) -/* @brief Has register bit fields CH_MATTR[WCACHE], CH_MATTR[RCACHE]. */ -#define FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE (0) -/* @brief Instance has register CH_MATTR. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_MEMORY_ATTRIBUTEn(x) (0) -/* @brief Has register bit field CH_CSR[SIGNEXT]. */ -#define FSL_FEATURE_EDMA_HAS_CHANNEL_SIGN_EXTENSION (0) -/* @brief Instance Has register bit field CH_CSR[SIGNEXT]. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_SIGN_EXTENSIONn(x) (0) -/* @brief Has register bit field TCD_CSR[BWC]. */ -#define FSL_FEATURE_EDMA_HAS_BANDWIDTH (1) -/* @brief Instance has register bit field TCD_CSR[BWC]. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_BANDWIDTHn(x) (1) -/* @brief Has register bit fields TCD_CSR[TMC]. */ -#define FSL_FEATURE_EDMA_HAS_TRANSFER_MODE (0) -/* @brief Instance has register bit fields TCD_CSR[TMC]. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_TRANSFER_MODEn(x) (0) -/* @brief Has no register bit fields CH_SBR[SEC]. */ -#define FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC (1) -/* @brief edma5 has different tcd type. */ -#define FSL_FEATURE_EDMA_TCD_TYPEn(x) (0) - -/* PWM module features */ - -/* @brief If (e)FlexPWM has module A channels (outputs). */ -#define FSL_FEATURE_PWM_HAS_CHANNELA (1) -/* @brief If (e)FlexPWM has module B channels (outputs). */ -#define FSL_FEATURE_PWM_HAS_CHANNELB (1) -/* @brief If (e)FlexPWM has module X channels (outputs). */ -#define FSL_FEATURE_PWM_HAS_CHANNELX (1) -/* @brief If (e)FlexPWM has fractional feature. */ -#define FSL_FEATURE_PWM_HAS_FRACTIONAL (0) -/* @brief If (e)FlexPWM has mux trigger source select bit field. */ -#define FSL_FEATURE_PWM_HAS_MUX_TRIGGER_SOURCE_SEL (1) -/* @brief Number of submodules in each (e)FlexPWM module. */ -#define FSL_FEATURE_PWM_SUBMODULE_COUNT (3) -/* @brief Number of fault channel in each (e)FlexPWM module. */ -#define FSL_FEATURE_PWM_FAULT_CH_COUNT (1) -/* @brief (e)FlexPWM has no WAITEN Bitfield In CTRL2 Register. */ -#define FSL_FEATURE_PWM_HAS_NO_WAITEN (1) -/* @brief If (e)FlexPWM has phase delay feature. */ -#define FSL_FEATURE_PWM_HAS_PHASE_DELAY (1) -/* @brief If (e)FlexPWM has input filter capture feature. */ -#define FSL_FEATURE_PWM_HAS_INPUT_FILTER_CAPTURE (1) -/* @brief If (e)FlexPWM has module capture functionality on A channels (inputs). */ -#define FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA (0) -/* @brief If (e)FlexPWM has module capture functionality on B channels (inputs). */ -#define FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB (0) -/* @brief If (e)FlexPWM has module capture functionality on X channels (inputs). */ -#define FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX (1) - -/* GLIKEY module features */ - -/* @brief GLIKEY has 8 step FSM configuration */ -#define FSL_FEATURE_GLIKEY_HAS_EIGHT_STEPS (1) - -/* GPIO module features */ - -/* @brief Has GPIO attribute checker register (GACR). */ -#define FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER (0) -/* @brief Has GPIO version ID register (VERID). */ -#define FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER (1) -/* @brief Has secure/non-secure access protection registers (LOCK, PCNS, PCNP, ICNS, ICNP). */ -#define FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL (0) -/* @brief Has GPIO port input disable register (PIDR). */ -#define FSL_FEATURE_GPIO_HAS_PORT_INPUT_CONTROL (1) -/* @brief Has GPIO interrupt/DMA request/trigger output selection. */ -#define FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT (0) - -/* I3C module features */ - -/* @brief Has TERM bitfile in MERRWARN register. */ -#define FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM (0) -/* @brief SOC has no reset driver. */ -#define FSL_FEATURE_I3C_HAS_NO_RESET (0) -/* @brief Use fixed BAMATCH count, do not provide editable BAMATCH. */ -#define FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH (0) -/* @brief Register SCONFIG do not have IDRAND bitfield. */ -#define FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND (1) -/* @brief Register SCONFIG has HDROK bitfield. */ -#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 IBI bytes. */ -#define FSL_FEATURE_I3C_HAS_IBI_PAYLOAD_SIZE_OPTIONAL_BYTE (1) -/* @brief Has SCL delay after START. */ -#define FSL_FEATURE_I3C_HAS_START_SCL_DELAY (1) - -/* LPI2C module features */ - -/* @brief Has separate DMA RX and TX requests. */ -#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) (4) - -/* LPSPI module features */ - -/* @brief Capacity (number of entries) of the transmit/receive FIFO (or zero if no FIFO is available). */ -#define FSL_FEATURE_LPSPI_FIFO_SIZEn(x) (4) -/* @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 */ -#define FSL_FEATURE_LPSPI_HAS_NO_PCSCFG (0) -/* @brief Has no WIDTH bits in TCR register */ -#define FSL_FEATURE_LPSPI_HAS_NO_MULTI_WIDTH (0) - -/* LPTMR module features */ - -/* @brief Has shared interrupt handler with another LPTMR module. */ -#define FSL_FEATURE_LPTMR_HAS_SHARED_IRQ_HANDLER (0) -/* @brief Whether LPTMR counter is 32 bits width. */ -#define FSL_FEATURE_LPTMR_CNR_WIDTH_IS_32B (1) -/* @brief Has timer DMA request enable (register bit CSR[TDRE]). */ -#define FSL_FEATURE_LPTMR_HAS_CSR_TDRE (1) -/* @brief Do not has prescaler clock source 0. */ -#define FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_0_SUPPORT (0) -/* @brief Do not has prescaler clock source 1. */ -#define FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT (0) -/* @brief Do not has prescaler clock source 2. */ -#define FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_2_SUPPORT (0) -/* @brief Do not has prescaler clock source 3. */ -#define FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_3_SUPPORT (0) - -/* LPUART module features */ - -/* @brief Has receive FIFO overflow detection (bit field CFIFO[RXOFE]). */ -#define FSL_FEATURE_LPUART_HAS_IRQ_EXTENDED_FUNCTIONS (0) -/* @brief Has low power features (can be enabled in wait mode via register bit C1[DOZEEN] or CTRL[DOZEEN] if the registers are 32-bit wide). */ -#define FSL_FEATURE_LPUART_HAS_LOW_POWER_UART_SUPPORT (1) -/* @brief Has extended data register ED (or extra flags in the DATA register if the registers are 32-bit wide). */ -#define FSL_FEATURE_LPUART_HAS_EXTENDED_DATA_REGISTER_FLAGS (1) -/* @brief Capacity (number of entries) of the transmit/receive FIFO (or zero if no FIFO is available). */ -#define FSL_FEATURE_LPUART_HAS_FIFO (1) -/* @brief Has 32-bit register MODIR */ -#define FSL_FEATURE_LPUART_HAS_MODIR (1) -/* @brief Hardware flow control (RTS, CTS) is supported. */ -#define FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT (1) -/* @brief Infrared (modulation) is supported. */ -#define FSL_FEATURE_LPUART_HAS_IR_SUPPORT (1) -/* @brief 2 bits long stop bit is available. */ -#define FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT (1) -/* @brief If 10-bit mode is supported. */ -#define FSL_FEATURE_LPUART_HAS_10BIT_DATA_SUPPORT (1) -/* @brief If 7-bit mode is supported. */ -#define FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT (1) -/* @brief Baud rate fine adjustment is available. */ -#define FSL_FEATURE_LPUART_HAS_BAUD_RATE_FINE_ADJUST_SUPPORT (0) -/* @brief Baud rate oversampling is available (has bit fields C4[OSR], C5[BOTHEDGE], C5[RESYNCDIS] or BAUD[OSR], BAUD[BOTHEDGE], BAUD[RESYNCDIS] if the registers are 32-bit wide). */ -#define FSL_FEATURE_LPUART_HAS_BAUD_RATE_OVER_SAMPLING_SUPPORT (1) -/* @brief Baud rate oversampling is available. */ -#define FSL_FEATURE_LPUART_HAS_RX_RESYNC_SUPPORT (1) -/* @brief Baud rate oversampling is available. */ -#define FSL_FEATURE_LPUART_HAS_BOTH_EDGE_SAMPLING_SUPPORT (1) -/* @brief Peripheral type. */ -#define FSL_FEATURE_LPUART_IS_SCI (1) -/* @brief Capacity (number of entries) of the transmit/receive FIFO (or zero if no FIFO is available). */ -#define FSL_FEATURE_LPUART_FIFO_SIZEn(x) (4) -/* @brief Supports two match addresses to filter incoming frames. */ -#define FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING (1) -/* @brief Has transmitter/receiver DMA enable bits C5[TDMAE]/C5[RDMAE] (or BAUD[TDMAE]/BAUD[RDMAE] if the registers are 32-bit wide). */ -#define FSL_FEATURE_LPUART_HAS_DMA_ENABLE (1) -/* @brief Has transmitter/receiver DMA select bits C4[TDMAS]/C4[RDMAS], resp. C5[TDMAS]/C5[RDMAS] if IS_SCI = 0. */ -#define FSL_FEATURE_LPUART_HAS_DMA_SELECT (0) -/* @brief Data character bit order selection is supported (bit field S2[MSBF] or STAT[MSBF] if the registers are 32-bit wide). */ -#define FSL_FEATURE_LPUART_HAS_BIT_ORDER_SELECT (1) -/* @brief Has smart card (ISO7816 protocol) support and no improved smart card support. */ -#define FSL_FEATURE_LPUART_HAS_SMART_CARD_SUPPORT (0) -/* @brief Has improved smart card (ISO7816 protocol) support. */ -#define FSL_FEATURE_LPUART_HAS_IMPROVED_SMART_CARD_SUPPORT (0) -/* @brief Has local operation network (CEA709.1-B protocol) support. */ -#define FSL_FEATURE_LPUART_HAS_LOCAL_OPERATION_NETWORK_SUPPORT (0) -/* @brief Has 32-bit registers (BAUD, STAT, CTRL, DATA, MATCH, MODIR) instead of 8-bit (BDH, BDL, C1, S1, D, etc.). */ -#define FSL_FEATURE_LPUART_HAS_32BIT_REGISTERS (1) -/* @brief Lin break detect available (has bit BAUD[LBKDIE]). */ -#define FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT (1) -/* @brief UART stops in Wait mode available (has bit C1[UARTSWAI]). */ -#define FSL_FEATURE_LPUART_HAS_WAIT_MODE_OPERATION (0) -/* @brief Has separate DMA RX and TX requests. */ -#define FSL_FEATURE_LPUART_HAS_SEPARATE_DMA_RX_TX_REQn(x) (1) -/* @brief Has separate RX and TX interrupts. */ -#define FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ (0) -/* @brief Has LPAURT_PARAM. */ -#define FSL_FEATURE_LPUART_HAS_PARAM (1) -/* @brief Has LPUART_VERID. */ -#define FSL_FEATURE_LPUART_HAS_VERID (1) -/* @brief Has LPUART_GLOBAL. */ -#define FSL_FEATURE_LPUART_HAS_GLOBAL (1) -/* @brief Has LPUART_PINCFG. */ -#define FSL_FEATURE_LPUART_HAS_PINCFG (1) -/* @brief Has register MODEM Control. */ -#define FSL_FEATURE_LPUART_HAS_MCR (0) -/* @brief Has register Half Duplex Control. */ -#define FSL_FEATURE_LPUART_HAS_HDCR (0) -/* @brief Has register Timeout. */ -#define FSL_FEATURE_LPUART_HAS_TIMEOUT (0) - -/* TRDC module features */ - -/* @brief Process master count. */ -#define FSL_FEATURE_TRDC_PROCESSOR_MASTER_COUNT (2) -/* @brief TRDC instance has PID configuration or not. */ -#define FSL_FEATURE_TRDC_INSTANCE_HAS_PID_CONFIGURATIONn(x) (0) -/* @brief TRDC instance has MBC. */ -#define FSL_FEATURE_TRDC_HAS_MBC (1) -/* @brief TRDC instance has MRC. */ -#define FSL_FEATURE_TRDC_HAS_MRC (0) -/* @brief TRDC instance has TRDC_CR. */ -#define FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG (0) -/* @brief TRDC instance has MDA_Wx_y_DFMT. */ -#define FSL_FEATURE_TRDC_HAS_DOMAIN_ASSIGNMENT (0) -/* @brief TRDC instance has TRDC_FDID. */ -#define FSL_FEATURE_TRDC_HAS_DOMAIN_ERROR (0) -/* @brief TRDC instance has TRDC_FLW_CTL. */ -#define FSL_FEATURE_TRDC_HAS_FLW (0) - -/* PORT module features */ - -/* @brief Has control lock (register bit PCR[LK]). */ -#define FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK (1) -/* @brief Has open drain control (register bit PCR[ODE]). */ -#define FSL_FEATURE_PORT_HAS_OPEN_DRAIN (1) -/* @brief Has digital filter (registers DFER, DFCR and DFWR). */ -#define FSL_FEATURE_PORT_HAS_DIGITAL_FILTER (0) -/* @brief Has DMA request (register bit field PCR[IRQC] or ICR[IRQC] values). */ -#define FSL_FEATURE_PORT_HAS_DMA_REQUEST (0) -/* @brief Has pull resistor selection available. */ -#define FSL_FEATURE_PORT_HAS_PULL_SELECTION (1) -/* @brief Has pull resistor enable (register bit PCR[PE]). */ -#define FSL_FEATURE_PORT_HAS_PULL_ENABLE (1) -/* @brief Has slew rate control (register bit PCR[SRE]). */ -#define FSL_FEATURE_PORT_HAS_SLEW_RATE (1) -/* @brief Has passive filter (register bit field PCR[PFE]). */ -#define FSL_FEATURE_PORT_HAS_PASSIVE_FILTER (1) -/* @brief Do not has interrupt control (register ISFR). */ -#define FSL_FEATURE_PORT_HAS_NO_INTERRUPT (1) -/* @brief Has pull value (register bit field PCR[PV]). */ -#define FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE (1) -/* @brief Has drive strength1 control (register bit PCR[DSE1]). */ -#define FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1 (1) -/* @brief Has version ID register (register VERID). */ -#define FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER (1) -/* @brief Has voltage range control (register bit CONFIG[RANGE]). */ -#define FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE (1) -/* @brief Has EFT detect (registers EDFR, EDIER and EDCR). */ -#define FSL_FEATURE_PORT_SUPPORT_EFT (0) -/* @brief Function 0 is GPIO. */ -#define FSL_FEATURE_PORT_PCR_MUX_GPIO (0) -/* @brief Has drive strength control (register bit PCR[DSE]). */ -#define FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH (1) -/* @brief Defines width of PCR[MUX] field. */ -#define FSL_FEATURE_PORT_PCR_MUX_WIDTH (4) -/* @brief Has dedicated interrupt vector. */ -#define FSL_FEATURE_PORT_HAS_INTERRUPT_VECTOR (1) -/* @brief Has independent interrupt control(register ICR). */ -#define FSL_FEATURE_PORT_HAS_INDEPENDENT_INTERRUPT_CONTROL (0) -/* @brief Has multiple pin IRQ configuration (register GICLR and GICHR). */ -#define FSL_FEATURE_PORT_HAS_MULTIPLE_IRQ_CONFIG (0) -/* @brief Has Input Buffer Enable (register bit field PCR[IBE]). */ -#define FSL_FEATURE_PORT_HAS_INPUT_BUFFER (1) -/* @brief Has Invert Input (register bit field PCR[INV]). */ -#define FSL_FEATURE_PORT_HAS_INVERT_INPUT (1) -/* @brief Defines whether PCR[IRQC] bit-field has flag states. */ -#define FSL_FEATURE_PORT_HAS_IRQC_FLAG (0) -/* @brief Defines whether PCR[IRQC] bit-field has trigger states. */ -#define FSL_FEATURE_PORT_HAS_IRQC_TRIGGER (0) - -/* EQDC module features */ - -/* @brief If EQDC CTRL2 register has EMIP bit field. */ -#define FSL_FEATURE_EQDC_CTRL2_HAS_EMIP_BIT_FIELD (1) - -/* SPC module features */ - -/* @brief Has DCDC */ -#define FSL_FEATURE_MCX_SPC_HAS_DCDC (0) -/* @brief Has SYS LDO */ -#define FSL_FEATURE_MCX_SPC_HAS_SYS_LDO (0) -/* @brief Has IOVDD_LVDF */ -#define FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD (0) -/* @brief Has COREVDD_HVDF */ -#define FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD (0) -/* @brief Has CORELDO_VDD_DS */ -#define FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS (1) -/* @brief Has LPBUFF_EN */ -#define FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT (0) -/* @brief Has COREVDD_IVS_EN */ -#define FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT (0) -/* @brief Has SWITCH_STATE */ -#define FSL_FEATURE_MCX_SPC_HAS_SWITCH_STATE_BIT (1) -/* @brief Has SRAMRETLDO */ -#define FSL_FEATURE_MCX_SPC_HAS_SRAMRETLDO_REG (1) -/* @brief Has CFG register */ -#define FSL_FEATURE_MCX_SPC_HAS_CFG_REG (1) -/* @brief Has SRAMLDO_DPD_ON */ -#define FSL_FEATURE_MCX_SPC_HAS_SRAMLDO_DPD_ON_BIT (1) -/* @brief Has CNTRL register */ -#define FSL_FEATURE_MCX_SPC_HAS_CNTRL_REG (0) -/* @brief Has DPDOWN_PULLDOWN_DISABLE */ -#define FSL_FEATURE_MCX_SPC_HAS_DPDOWN_PULLDOWN_DISABLE_BIT (0) -/* @brief Not have glitch detect */ -#define FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT (1) -/* @brief Has BLEED_EN */ -#define FSL_FEATURE_MCX_SPC_HAS_DCDC_CFG_BLEED_EN (0) - -/* SYSCON module features */ - -/* @brief Flash page size in bytes */ -#define FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES (128) -/* @brief Flash sector size in bytes */ -#define FSL_FEATURE_SYSCON_FLASH_SECTOR_SIZE_BYTES (8192) -/* @brief Flash size in bytes */ -#define FSL_FEATURE_SYSCON_FLASH_SIZE_BYTES (131072) -/* @brief Support ROMAPI */ -#define FSL_FEATURE_SYSCON_ROMAPI (1) -/* @brief Powerlib API is different with other series devices */ -#define FSL_FEATURE_POWERLIB_EXTEND (1) -/* @brief No OSTIMER register in PMC */ -#define FSL_FEATURE_PMC_HAS_NO_OSTIMER_REG (1) -/* @brief Starter register discontinuous. */ -#define FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS (1) - -/* USB module features */ - -/* @brief KHCI module instance count */ -#define FSL_FEATURE_USB_KHCI_COUNT (1) -/* @brief HOST mode enabled */ -#define FSL_FEATURE_USB_KHCI_HOST_ENABLED (0) -/* @brief OTG mode enabled */ -#define FSL_FEATURE_USB_KHCI_OTG_ENABLED (0) -/* @brief Size of the USB dedicated RAM */ -#define FSL_FEATURE_USB_KHCI_USB_RAM (0) -/* @brief Has KEEP_ALIVE_CTRL register */ -#define FSL_FEATURE_USB_KHCI_KEEP_ALIVE_ENABLED (0) -/* @brief Has the Dynamic SOF threshold compare support */ -#define FSL_FEATURE_USB_KHCI_DYNAMIC_SOF_THRESHOLD_COMPARE_ENABLED (0) -/* @brief Has the VBUS detect support */ -#define FSL_FEATURE_USB_KHCI_VBUS_DETECT_ENABLED (1) -/* @brief Has the IRC48M module clock support */ -#define FSL_FEATURE_USB_KHCI_IRC48M_MODULE_CLOCK_ENABLED (1) -/* @brief Number of endpoints supported */ -#define FSL_FEATURE_USB_ENDPT_COUNT (16) -/* @brief Has STALL_IL/OL_DIS registers */ -#define FSL_FEATURE_USB_KHCI_HAS_STALL_LOW (1) -/* @brief Has STALL_IH/OH_DIS registers */ -#define FSL_FEATURE_USB_KHCI_HAS_STALL_HIGH (1) - -/* UTICK module features */ - -/* @brief UTICK does not support PD configure. */ -#define FSL_FEATURE_UTICK_HAS_NO_PDCFG (1) - -/* VBAT module features */ - -/* @brief Has STATUS register */ -#define FSL_FEATURE_MCX_VBAT_HAS_STATUS_REG (0) -/* @brief Has TAMPER register */ -#define FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG (0) -/* @brief Has BANDGAP register */ -#define FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER (0) -/* @brief Has LDOCTL register */ -#define FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG (0) -/* @brief Has OSCCTL register */ -#define FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG (0) -/* @brief Has SWICTL register */ -#define FSL_FEATURE_MCX_VBAT_HAS_SWICTL_REG (0) -/* @brief Has CLKMON register */ -#define FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG (0) - -/* WWDT module features */ - -/* @brief Has no RESET register. */ -#define FSL_FEATURE_WWDT_HAS_NO_RESET (1) - -#endif /* _MCXA153_FEATURES_H_ */ - diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/arm/startup_MCXA153.S b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/arm/startup_MCXA153.S deleted file mode 100644 index ce32a7020ec..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/arm/startup_MCXA153.S +++ /dev/null @@ -1,1022 +0,0 @@ -/* ------------------------------------------------------------------------- */ -/* @file: startup_MCXA153.s */ -/* @purpose: CMSIS Cortex-M33 Core Device Startup File */ -/* MCXA153 */ -/* @version: 1.0 */ -/* @date: 2022-3-29 */ -/* @build: b240401 */ -/* ------------------------------------------------------------------------- */ -/* */ -/* Copyright 1997-2016 Freescale Semiconductor, Inc. */ -/* Copyright 2016-2024 NXP */ -/* SPDX-License-Identifier: BSD-3-Clause */ -/*****************************************************************************/ -/* Version: GCC for ARM Embedded Processors */ -/*****************************************************************************/ - .syntax unified - .arch armv8-m.main - .eabi_attribute Tag_ABI_align_preserved, 1 /*8-byte alignment */ - - .section .isr_vector, "a" - .align 2 - .globl __Vectors -__Vectors: - .long Image$$ARM_LIB_STACK$$ZI$$Limit /* Top of Stack */ - .long Reset_Handler /* Reset Handler */ - .long NMI_Handler /* NMI Handler*/ - .long HardFault_Handler /* Hard Fault Handler*/ - .long MemManage_Handler /* MPU Fault Handler*/ - .long BusFault_Handler /* Bus Fault Handler*/ - .long UsageFault_Handler /* Usage Fault Handler*/ - .long SecureFault_Handler /* Secure Fault Handler*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long SVC_Handler /* SVCall Handler*/ - .long DebugMon_Handler /* Debug Monitor Handler*/ - .long 0 /* Reserved*/ - .long PendSV_Handler /* PendSV Handler*/ - .long SysTick_Handler /* SysTick Handler*/ - - /* External Interrupts*/ - .long Reserved16_IRQHandler /* OR IRQ1 to IRQ53*/ - .long CMC_IRQHandler /* Core Mode Controller interrupt*/ - .long DMA_CH0_IRQHandler /* DMA3_0_CH0 error or transfer complete*/ - .long DMA_CH1_IRQHandler /* DMA3_0_CH1 error or transfer complete*/ - .long DMA_CH2_IRQHandler /* DMA3_0_CH2 error or transfer complete*/ - .long DMA_CH3_IRQHandler /* DMA3_0_CH3 error or transfer complete*/ - .long Reserved22_IRQHandler /* Reserved interrupt*/ - .long Reserved23_IRQHandler /* Reserved interrupt*/ - .long Reserved24_IRQHandler /* Reserved interrupt*/ - .long Reserved25_IRQHandler /* Reserved interrupt*/ - .long ERM0_SINGLE_BIT_IRQHandler /* ERM Single Bit error interrupt*/ - .long ERM0_MULTI_BIT_IRQHandler /* ERM Multi Bit error interrupt*/ - .long FMU0_IRQHandler /* Flash Management Unit interrupt*/ - .long GLIKEY0_IRQHandler /* GLIKEY Interrupt */ - .long MBC0_IRQHandler /* MBC secure violation interrupt*/ - .long SCG0_IRQHandler /* System Clock Generator interrupt*/ - .long SPC0_IRQHandler /* System Power Controller interrupt*/ - .long Reserved33_IRQHandler /* Reserved interrupt*/ - .long WUU0_IRQHandler /* Wake Up Unit interrupt*/ - .long Reserved35_IRQHandler /* Reserved interrupt*/ - .long Reserved36_IRQHandler /* Reserved interrupt*/ - .long Reserved37_IRQHandler /* Reserved interrupt*/ - .long Reserved38_IRQHandler /* Reserved interrupt*/ - .long Reserved39_IRQHandler /* Reserved interrupt*/ - .long I3C0_IRQHandler /* Improved Inter Integrated Circuit interrupt 0*/ - .long Reserved41_IRQHandler /* Reserved interrupt*/ - .long LPI2C0_IRQHandler /* Low-Power Inter Integrated Circuit interrupt*/ - .long Reserved43_IRQHandler /* Reserved interrupt*/ - .long LPSPI0_IRQHandler /* Low-Power Serial Peripheral Interface interrupt*/ - .long LPSPI1_IRQHandler /* Low-Power Serial Peripheral Interface interrupt*/ - .long Reserved46_IRQHandler /* Reserved interrupt*/ - .long LPUART0_IRQHandler /* Low-Power Universal Asynchronous Receive/Transmit interrupt*/ - .long LPUART1_IRQHandler /* Low-Power Universal Asynchronous Receive/Transmit interrupt*/ - .long LPUART2_IRQHandler /* Low-Power Universal Asynchronous Receive/Transmit interrupt*/ - .long Reserved50_IRQHandler /* Reserved interrupt*/ - .long Reserved51_IRQHandler /* Reserved interrupt*/ - .long USB0_IRQHandler /* Universal Serial Bus - Full Speed interrupt*/ - .long Reserved53_IRQHandler /* Reserved interrupt*/ - .long CDOG0_IRQHandler /* Code Watchdog Timer 0 interrupt*/ - .long CTIMER0_IRQHandler /* Standard counter/timer 0 interrupt*/ - .long CTIMER1_IRQHandler /* Standard counter/timer 1 interrupt*/ - .long CTIMER2_IRQHandler /* Standard counter/timer 2 interrupt*/ - .long Reserved58_IRQHandler /* Reserved interrupt*/ - .long Reserved59_IRQHandler /* Reserved interrupt*/ - .long FLEXPWM0_RELOAD_ERROR_IRQHandler /* FlexPWM0_reload_error interrupt*/ - .long FLEXPWM0_FAULT_IRQHandler /* FlexPWM0_fault interrupt*/ - .long FLEXPWM0_SUBMODULE0_IRQHandler /* FlexPWM0 Submodule 0 capture/compare/reload interrupt*/ - .long FLEXPWM0_SUBMODULE1_IRQHandler /* FlexPWM0 Submodule 1 capture/compare/reload interrupt*/ - .long FLEXPWM0_SUBMODULE2_IRQHandler /* FlexPWM0 Submodule 2 capture/compare/reload interrupt*/ - .long Reserved65_IRQHandler /* Reserved interrupt*/ - .long QDC0_COMPARE_IRQHandler /* Compare*/ - .long QDC0_HOME_IRQHandler /* Home*/ - .long QDC0_WATCHDOG_IRQHandler /* Watchdog / Simultaneous A and B Change*/ - .long QDC0_INDEX_IRQHandler /* Index / Roll Over / Roll Under*/ - .long FREQME0_IRQHandler /* Frequency Measurement interrupt*/ - .long LPTMR0_IRQHandler /* Low Power Timer 0 interrupt*/ - .long Reserved72_IRQHandler /* Reserved interrupt*/ - .long OS_EVENT_IRQHandler /* OS event timer interrupt*/ - .long WAKETIMER0_IRQHandler /* Wake Timer Interrupt*/ - .long UTICK0_IRQHandler /* Micro-Tick Timer interrupt*/ - .long WWDT0_IRQHandler /* Windowed Watchdog Timer 0 interrupt*/ - .long Reserved77_IRQHandler /* Reserved interrupt*/ - .long ADC0_IRQHandler /* Analog-to-Digital Converter interrupt*/ - .long Reserved79_IRQHandler /* Reserved interrupt*/ - .long CMP0_IRQHandler /* Comparator interrupt*/ - .long CMP1_IRQHandler /* Comparator interrupt*/ - .long Reserved82_IRQHandler /* Reserved interrupt*/ - .long Reserved83_IRQHandler /* Reserved interrupt*/ - .long Reserved84_IRQHandler /* Reserved interrupt*/ - .long Reserved85_IRQHandler /* Reserved interrupt*/ - .long Reserved86_IRQHandler /* Reserved interrupt*/ - .long GPIO0_IRQHandler /* General Purpose Input/Output interrupt 0*/ - .long GPIO1_IRQHandler /* General Purpose Input/Output interrupt 1*/ - .long GPIO2_IRQHandler /* General Purpose Input/Output interrupt 2*/ - .long GPIO3_IRQHandler /* General Purpose Input/Output interrupt 3*/ - .long Reserved91_IRQHandler /* Reserved interrupt*/ - .long Reserved92_IRQHandler /* Reserved interrupt*/ - .long Reserved93_IRQHandler /* Reserved interrupt*/ - .long Reserved94_IRQHandler /* Reserved interrupt*/ - .long Reserved95_IRQHandler /* Reserved interrupt*/ - - .size __Vectors, . - __Vectors - - .text - .thumb - -/* Reset Handler */ - - .thumb_func - .align 2 - .weak Reset_Handler - .type Reset_Handler, %function -Reset_Handler: - cpsid i /* Mask interrupts */ - .equ VTOR, 0xE000ED08 - ldr r0, =VTOR - ldr r1, =__Vectors - str r1, [r0] - ldr r2, [r1] - msr msp, r2 - ldr r0, =Image$$ARM_LIB_STACK$$ZI$$Base - msr msplim, r0 - ldr r0,=SystemInit - blx r0 - cpsie i /* Unmask interrupts */ - ldr r0,=__main - bx r0 - - .pool - .size Reset_Handler, . - Reset_Handler - - .align 1 - .thumb_func - .weak DefaultISR - .type DefaultISR, %function -DefaultISR: - b DefaultISR - .size DefaultISR, . - DefaultISR - - .align 1 - .thumb_func - .weak NMI_Handler - .type NMI_Handler, %function -NMI_Handler: - ldr r0,=NMI_Handler - bx r0 - .size NMI_Handler, . - NMI_Handler - - .align 1 - .thumb_func - .weak HardFault_Handler - .type HardFault_Handler, %function -HardFault_Handler: - ldr r0,=HardFault_Handler - bx r0 - .size HardFault_Handler, . - HardFault_Handler - - .align 1 - .thumb_func - .weak SVC_Handler - .type SVC_Handler, %function -SVC_Handler: - ldr r0,=SVC_Handler - bx r0 - .size SVC_Handler, . - SVC_Handler - - .align 1 - .thumb_func - .weak PendSV_Handler - .type PendSV_Handler, %function -PendSV_Handler: - ldr r0,=PendSV_Handler - bx r0 - .size PendSV_Handler, . - PendSV_Handler - - .align 1 - .thumb_func - .weak SysTick_Handler - .type SysTick_Handler, %function -SysTick_Handler: - ldr r0,=SysTick_Handler - bx r0 - .size SysTick_Handler, . - SysTick_Handler - - .align 1 - .thumb_func - .weak Reserved16_IRQHandler - .type Reserved16_IRQHandler, %function -Reserved16_IRQHandler: - ldr r0,=Reserved16_DriverIRQHandler - bx r0 - .size Reserved16_IRQHandler, . - Reserved16_IRQHandler - - .align 1 - .thumb_func - .weak CMC_IRQHandler - .type CMC_IRQHandler, %function -CMC_IRQHandler: - ldr r0,=CMC_DriverIRQHandler - bx r0 - .size CMC_IRQHandler, . - CMC_IRQHandler - - .align 1 - .thumb_func - .weak DMA_CH0_IRQHandler - .type DMA_CH0_IRQHandler, %function -DMA_CH0_IRQHandler: - ldr r0,=DMA_CH0_DriverIRQHandler - bx r0 - .size DMA_CH0_IRQHandler, . - DMA_CH0_IRQHandler - - .align 1 - .thumb_func - .weak DMA_CH1_IRQHandler - .type DMA_CH1_IRQHandler, %function -DMA_CH1_IRQHandler: - ldr r0,=DMA_CH1_DriverIRQHandler - bx r0 - .size DMA_CH1_IRQHandler, . - DMA_CH1_IRQHandler - - .align 1 - .thumb_func - .weak DMA_CH2_IRQHandler - .type DMA_CH2_IRQHandler, %function -DMA_CH2_IRQHandler: - ldr r0,=DMA_CH2_DriverIRQHandler - bx r0 - .size DMA_CH2_IRQHandler, . - DMA_CH2_IRQHandler - - .align 1 - .thumb_func - .weak DMA_CH3_IRQHandler - .type DMA_CH3_IRQHandler, %function -DMA_CH3_IRQHandler: - ldr r0,=DMA_CH3_DriverIRQHandler - bx r0 - .size DMA_CH3_IRQHandler, . - DMA_CH3_IRQHandler - - .align 1 - .thumb_func - .weak Reserved22_IRQHandler - .type Reserved22_IRQHandler, %function -Reserved22_IRQHandler: - ldr r0,=Reserved22_DriverIRQHandler - bx r0 - .size Reserved22_IRQHandler, . - Reserved22_IRQHandler - - .align 1 - .thumb_func - .weak Reserved23_IRQHandler - .type Reserved23_IRQHandler, %function -Reserved23_IRQHandler: - ldr r0,=Reserved23_DriverIRQHandler - bx r0 - .size Reserved23_IRQHandler, . - Reserved23_IRQHandler - - .align 1 - .thumb_func - .weak Reserved24_IRQHandler - .type Reserved24_IRQHandler, %function -Reserved24_IRQHandler: - ldr r0,=Reserved24_DriverIRQHandler - bx r0 - .size Reserved24_IRQHandler, . - Reserved24_IRQHandler - - .align 1 - .thumb_func - .weak Reserved25_IRQHandler - .type Reserved25_IRQHandler, %function -Reserved25_IRQHandler: - ldr r0,=Reserved25_DriverIRQHandler - bx r0 - .size Reserved25_IRQHandler, . - Reserved25_IRQHandler - - .align 1 - .thumb_func - .weak ERM0_SINGLE_BIT_IRQHandler - .type ERM0_SINGLE_BIT_IRQHandler, %function -ERM0_SINGLE_BIT_IRQHandler: - ldr r0,=ERM0_SINGLE_BIT_DriverIRQHandler - bx r0 - .size ERM0_SINGLE_BIT_IRQHandler, . - ERM0_SINGLE_BIT_IRQHandler - - .align 1 - .thumb_func - .weak ERM0_MULTI_BIT_IRQHandler - .type ERM0_MULTI_BIT_IRQHandler, %function -ERM0_MULTI_BIT_IRQHandler: - ldr r0,=ERM0_MULTI_BIT_DriverIRQHandler - bx r0 - .size ERM0_MULTI_BIT_IRQHandler, . - ERM0_MULTI_BIT_IRQHandler - - .align 1 - .thumb_func - .weak FMU0_IRQHandler - .type FMU0_IRQHandler, %function -FMU0_IRQHandler: - ldr r0,=FMU0_DriverIRQHandler - bx r0 - .size FMU0_IRQHandler, . - FMU0_IRQHandler - - .align 1 - .thumb_func - .weak GLIKEY0_IRQHandler - .type GLIKEY0_IRQHandler, %function -GLIKEY0_IRQHandler: - ldr r0,=GLIKEY0_DriverIRQHandler - bx r0 - .size GLIKEY0_IRQHandler, . - GLIKEY0_IRQHandler - - .align 1 - .thumb_func - .weak MBC0_IRQHandler - .type MBC0_IRQHandler, %function -MBC0_IRQHandler: - ldr r0,=MBC0_DriverIRQHandler - bx r0 - .size MBC0_IRQHandler, . - MBC0_IRQHandler - - .align 1 - .thumb_func - .weak SCG0_IRQHandler - .type SCG0_IRQHandler, %function -SCG0_IRQHandler: - ldr r0,=SCG0_DriverIRQHandler - bx r0 - .size SCG0_IRQHandler, . - SCG0_IRQHandler - - .align 1 - .thumb_func - .weak SPC0_IRQHandler - .type SPC0_IRQHandler, %function -SPC0_IRQHandler: - ldr r0,=SPC0_DriverIRQHandler - bx r0 - .size SPC0_IRQHandler, . - SPC0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved33_IRQHandler - .type Reserved33_IRQHandler, %function -Reserved33_IRQHandler: - ldr r0,=Reserved33_DriverIRQHandler - bx r0 - .size Reserved33_IRQHandler, . - Reserved33_IRQHandler - - .align 1 - .thumb_func - .weak WUU0_IRQHandler - .type WUU0_IRQHandler, %function -WUU0_IRQHandler: - ldr r0,=WUU0_DriverIRQHandler - bx r0 - .size WUU0_IRQHandler, . - WUU0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved35_IRQHandler - .type Reserved35_IRQHandler, %function -Reserved35_IRQHandler: - ldr r0,=Reserved35_DriverIRQHandler - bx r0 - .size Reserved35_IRQHandler, . - Reserved35_IRQHandler - - .align 1 - .thumb_func - .weak Reserved36_IRQHandler - .type Reserved36_IRQHandler, %function -Reserved36_IRQHandler: - ldr r0,=Reserved36_DriverIRQHandler - bx r0 - .size Reserved36_IRQHandler, . - Reserved36_IRQHandler - - .align 1 - .thumb_func - .weak Reserved37_IRQHandler - .type Reserved37_IRQHandler, %function -Reserved37_IRQHandler: - ldr r0,=Reserved37_DriverIRQHandler - bx r0 - .size Reserved37_IRQHandler, . - Reserved37_IRQHandler - - .align 1 - .thumb_func - .weak Reserved38_IRQHandler - .type Reserved38_IRQHandler, %function -Reserved38_IRQHandler: - ldr r0,=Reserved38_DriverIRQHandler - bx r0 - .size Reserved38_IRQHandler, . - Reserved38_IRQHandler - - .align 1 - .thumb_func - .weak Reserved39_IRQHandler - .type Reserved39_IRQHandler, %function -Reserved39_IRQHandler: - ldr r0,=Reserved39_DriverIRQHandler - bx r0 - .size Reserved39_IRQHandler, . - Reserved39_IRQHandler - - .align 1 - .thumb_func - .weak I3C0_IRQHandler - .type I3C0_IRQHandler, %function -I3C0_IRQHandler: - ldr r0,=I3C0_DriverIRQHandler - bx r0 - .size I3C0_IRQHandler, . - I3C0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved41_IRQHandler - .type Reserved41_IRQHandler, %function -Reserved41_IRQHandler: - ldr r0,=Reserved41_DriverIRQHandler - bx r0 - .size Reserved41_IRQHandler, . - Reserved41_IRQHandler - - .align 1 - .thumb_func - .weak LPI2C0_IRQHandler - .type LPI2C0_IRQHandler, %function -LPI2C0_IRQHandler: - ldr r0,=LPI2C0_DriverIRQHandler - bx r0 - .size LPI2C0_IRQHandler, . - LPI2C0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved43_IRQHandler - .type Reserved43_IRQHandler, %function -Reserved43_IRQHandler: - ldr r0,=Reserved43_DriverIRQHandler - bx r0 - .size Reserved43_IRQHandler, . - Reserved43_IRQHandler - - .align 1 - .thumb_func - .weak LPSPI0_IRQHandler - .type LPSPI0_IRQHandler, %function -LPSPI0_IRQHandler: - ldr r0,=LPSPI0_DriverIRQHandler - bx r0 - .size LPSPI0_IRQHandler, . - LPSPI0_IRQHandler - - .align 1 - .thumb_func - .weak LPSPI1_IRQHandler - .type LPSPI1_IRQHandler, %function -LPSPI1_IRQHandler: - ldr r0,=LPSPI1_DriverIRQHandler - bx r0 - .size LPSPI1_IRQHandler, . - LPSPI1_IRQHandler - - .align 1 - .thumb_func - .weak Reserved46_IRQHandler - .type Reserved46_IRQHandler, %function -Reserved46_IRQHandler: - ldr r0,=Reserved46_DriverIRQHandler - bx r0 - .size Reserved46_IRQHandler, . - Reserved46_IRQHandler - - .align 1 - .thumb_func - .weak LPUART0_IRQHandler - .type LPUART0_IRQHandler, %function -LPUART0_IRQHandler: - ldr r0,=LPUART0_DriverIRQHandler - bx r0 - .size LPUART0_IRQHandler, . - LPUART0_IRQHandler - - .align 1 - .thumb_func - .weak LPUART1_IRQHandler - .type LPUART1_IRQHandler, %function -LPUART1_IRQHandler: - ldr r0,=LPUART1_DriverIRQHandler - bx r0 - .size LPUART1_IRQHandler, . - LPUART1_IRQHandler - - .align 1 - .thumb_func - .weak LPUART2_IRQHandler - .type LPUART2_IRQHandler, %function -LPUART2_IRQHandler: - ldr r0,=LPUART2_DriverIRQHandler - bx r0 - .size LPUART2_IRQHandler, . - LPUART2_IRQHandler - - .align 1 - .thumb_func - .weak Reserved50_IRQHandler - .type Reserved50_IRQHandler, %function -Reserved50_IRQHandler: - ldr r0,=Reserved50_DriverIRQHandler - bx r0 - .size Reserved50_IRQHandler, . - Reserved50_IRQHandler - - .align 1 - .thumb_func - .weak Reserved51_IRQHandler - .type Reserved51_IRQHandler, %function -Reserved51_IRQHandler: - ldr r0,=Reserved51_DriverIRQHandler - bx r0 - .size Reserved51_IRQHandler, . - Reserved51_IRQHandler - - .align 1 - .thumb_func - .weak USB0_IRQHandler - .type USB0_IRQHandler, %function -USB0_IRQHandler: - ldr r0,=USB0_DriverIRQHandler - bx r0 - .size USB0_IRQHandler, . - USB0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved53_IRQHandler - .type Reserved53_IRQHandler, %function -Reserved53_IRQHandler: - ldr r0,=Reserved53_DriverIRQHandler - bx r0 - .size Reserved53_IRQHandler, . - Reserved53_IRQHandler - - .align 1 - .thumb_func - .weak CDOG0_IRQHandler - .type CDOG0_IRQHandler, %function -CDOG0_IRQHandler: - ldr r0,=CDOG0_DriverIRQHandler - bx r0 - .size CDOG0_IRQHandler, . - CDOG0_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER0_IRQHandler - .type CTIMER0_IRQHandler, %function -CTIMER0_IRQHandler: - ldr r0,=CTIMER0_DriverIRQHandler - bx r0 - .size CTIMER0_IRQHandler, . - CTIMER0_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER1_IRQHandler - .type CTIMER1_IRQHandler, %function -CTIMER1_IRQHandler: - ldr r0,=CTIMER1_DriverIRQHandler - bx r0 - .size CTIMER1_IRQHandler, . - CTIMER1_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER2_IRQHandler - .type CTIMER2_IRQHandler, %function -CTIMER2_IRQHandler: - ldr r0,=CTIMER2_DriverIRQHandler - bx r0 - .size CTIMER2_IRQHandler, . - CTIMER2_IRQHandler - - .align 1 - .thumb_func - .weak Reserved58_IRQHandler - .type Reserved58_IRQHandler, %function -Reserved58_IRQHandler: - ldr r0,=Reserved58_DriverIRQHandler - bx r0 - .size Reserved58_IRQHandler, . - Reserved58_IRQHandler - - .align 1 - .thumb_func - .weak Reserved59_IRQHandler - .type Reserved59_IRQHandler, %function -Reserved59_IRQHandler: - ldr r0,=Reserved59_DriverIRQHandler - bx r0 - .size Reserved59_IRQHandler, . - Reserved59_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_RELOAD_ERROR_IRQHandler - .type FLEXPWM0_RELOAD_ERROR_IRQHandler, %function -FLEXPWM0_RELOAD_ERROR_IRQHandler: - ldr r0,=FLEXPWM0_RELOAD_ERROR_DriverIRQHandler - bx r0 - .size FLEXPWM0_RELOAD_ERROR_IRQHandler, . - FLEXPWM0_RELOAD_ERROR_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_FAULT_IRQHandler - .type FLEXPWM0_FAULT_IRQHandler, %function -FLEXPWM0_FAULT_IRQHandler: - ldr r0,=FLEXPWM0_FAULT_DriverIRQHandler - bx r0 - .size FLEXPWM0_FAULT_IRQHandler, . - FLEXPWM0_FAULT_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE0_IRQHandler - .type FLEXPWM0_SUBMODULE0_IRQHandler, %function -FLEXPWM0_SUBMODULE0_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE0_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE0_IRQHandler, . - FLEXPWM0_SUBMODULE0_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE1_IRQHandler - .type FLEXPWM0_SUBMODULE1_IRQHandler, %function -FLEXPWM0_SUBMODULE1_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE1_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE1_IRQHandler, . - FLEXPWM0_SUBMODULE1_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE2_IRQHandler - .type FLEXPWM0_SUBMODULE2_IRQHandler, %function -FLEXPWM0_SUBMODULE2_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE2_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE2_IRQHandler, . - FLEXPWM0_SUBMODULE2_IRQHandler - - .align 1 - .thumb_func - .weak Reserved65_IRQHandler - .type Reserved65_IRQHandler, %function -Reserved65_IRQHandler: - ldr r0,=Reserved65_DriverIRQHandler - bx r0 - .size Reserved65_IRQHandler, . - Reserved65_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_COMPARE_IRQHandler - .type QDC0_COMPARE_IRQHandler, %function -QDC0_COMPARE_IRQHandler: - ldr r0,=QDC0_COMPARE_DriverIRQHandler - bx r0 - .size QDC0_COMPARE_IRQHandler, . - QDC0_COMPARE_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_HOME_IRQHandler - .type QDC0_HOME_IRQHandler, %function -QDC0_HOME_IRQHandler: - ldr r0,=QDC0_HOME_DriverIRQHandler - bx r0 - .size QDC0_HOME_IRQHandler, . - QDC0_HOME_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_WATCHDOG_IRQHandler - .type QDC0_WATCHDOG_IRQHandler, %function -QDC0_WATCHDOG_IRQHandler: - ldr r0,=QDC0_WATCHDOG_DriverIRQHandler - bx r0 - .size QDC0_WATCHDOG_IRQHandler, . - QDC0_WATCHDOG_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_INDEX_IRQHandler - .type QDC0_INDEX_IRQHandler, %function -QDC0_INDEX_IRQHandler: - ldr r0,=QDC0_INDEX_DriverIRQHandler - bx r0 - .size QDC0_INDEX_IRQHandler, . - QDC0_INDEX_IRQHandler - - .align 1 - .thumb_func - .weak FREQME0_IRQHandler - .type FREQME0_IRQHandler, %function -FREQME0_IRQHandler: - ldr r0,=FREQME0_DriverIRQHandler - bx r0 - .size FREQME0_IRQHandler, . - FREQME0_IRQHandler - - .align 1 - .thumb_func - .weak LPTMR0_IRQHandler - .type LPTMR0_IRQHandler, %function -LPTMR0_IRQHandler: - ldr r0,=LPTMR0_DriverIRQHandler - bx r0 - .size LPTMR0_IRQHandler, . - LPTMR0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved72_IRQHandler - .type Reserved72_IRQHandler, %function -Reserved72_IRQHandler: - ldr r0,=Reserved72_DriverIRQHandler - bx r0 - .size Reserved72_IRQHandler, . - Reserved72_IRQHandler - - .align 1 - .thumb_func - .weak OS_EVENT_IRQHandler - .type OS_EVENT_IRQHandler, %function -OS_EVENT_IRQHandler: - ldr r0,=OS_EVENT_DriverIRQHandler - bx r0 - .size OS_EVENT_IRQHandler, . - OS_EVENT_IRQHandler - - .align 1 - .thumb_func - .weak WAKETIMER0_IRQHandler - .type WAKETIMER0_IRQHandler, %function -WAKETIMER0_IRQHandler: - ldr r0,=WAKETIMER0_DriverIRQHandler - bx r0 - .size WAKETIMER0_IRQHandler, . - WAKETIMER0_IRQHandler - - .align 1 - .thumb_func - .weak UTICK0_IRQHandler - .type UTICK0_IRQHandler, %function -UTICK0_IRQHandler: - ldr r0,=UTICK0_DriverIRQHandler - bx r0 - .size UTICK0_IRQHandler, . - UTICK0_IRQHandler - - .align 1 - .thumb_func - .weak WWDT0_IRQHandler - .type WWDT0_IRQHandler, %function -WWDT0_IRQHandler: - ldr r0,=WWDT0_DriverIRQHandler - bx r0 - .size WWDT0_IRQHandler, . - WWDT0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved77_IRQHandler - .type Reserved77_IRQHandler, %function -Reserved77_IRQHandler: - ldr r0,=Reserved77_DriverIRQHandler - bx r0 - .size Reserved77_IRQHandler, . - Reserved77_IRQHandler - - .align 1 - .thumb_func - .weak ADC0_IRQHandler - .type ADC0_IRQHandler, %function -ADC0_IRQHandler: - ldr r0,=ADC0_DriverIRQHandler - bx r0 - .size ADC0_IRQHandler, . - ADC0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved79_IRQHandler - .type Reserved79_IRQHandler, %function -Reserved79_IRQHandler: - ldr r0,=Reserved79_DriverIRQHandler - bx r0 - .size Reserved79_IRQHandler, . - Reserved79_IRQHandler - - .align 1 - .thumb_func - .weak CMP0_IRQHandler - .type CMP0_IRQHandler, %function -CMP0_IRQHandler: - ldr r0,=CMP0_DriverIRQHandler - bx r0 - .size CMP0_IRQHandler, . - CMP0_IRQHandler - - .align 1 - .thumb_func - .weak CMP1_IRQHandler - .type CMP1_IRQHandler, %function -CMP1_IRQHandler: - ldr r0,=CMP1_DriverIRQHandler - bx r0 - .size CMP1_IRQHandler, . - CMP1_IRQHandler - - .align 1 - .thumb_func - .weak Reserved82_IRQHandler - .type Reserved82_IRQHandler, %function -Reserved82_IRQHandler: - ldr r0,=Reserved82_DriverIRQHandler - bx r0 - .size Reserved82_IRQHandler, . - Reserved82_IRQHandler - - .align 1 - .thumb_func - .weak Reserved83_IRQHandler - .type Reserved83_IRQHandler, %function -Reserved83_IRQHandler: - ldr r0,=Reserved83_DriverIRQHandler - bx r0 - .size Reserved83_IRQHandler, . - Reserved83_IRQHandler - - .align 1 - .thumb_func - .weak Reserved84_IRQHandler - .type Reserved84_IRQHandler, %function -Reserved84_IRQHandler: - ldr r0,=Reserved84_DriverIRQHandler - bx r0 - .size Reserved84_IRQHandler, . - Reserved84_IRQHandler - - .align 1 - .thumb_func - .weak Reserved85_IRQHandler - .type Reserved85_IRQHandler, %function -Reserved85_IRQHandler: - ldr r0,=Reserved85_DriverIRQHandler - bx r0 - .size Reserved85_IRQHandler, . - Reserved85_IRQHandler - - .align 1 - .thumb_func - .weak Reserved86_IRQHandler - .type Reserved86_IRQHandler, %function -Reserved86_IRQHandler: - ldr r0,=Reserved86_DriverIRQHandler - bx r0 - .size Reserved86_IRQHandler, . - Reserved86_IRQHandler - - .align 1 - .thumb_func - .weak GPIO0_IRQHandler - .type GPIO0_IRQHandler, %function -GPIO0_IRQHandler: - ldr r0,=GPIO0_DriverIRQHandler - bx r0 - .size GPIO0_IRQHandler, . - GPIO0_IRQHandler - - .align 1 - .thumb_func - .weak GPIO1_IRQHandler - .type GPIO1_IRQHandler, %function -GPIO1_IRQHandler: - ldr r0,=GPIO1_DriverIRQHandler - bx r0 - .size GPIO1_IRQHandler, . - GPIO1_IRQHandler - - .align 1 - .thumb_func - .weak GPIO2_IRQHandler - .type GPIO2_IRQHandler, %function -GPIO2_IRQHandler: - ldr r0,=GPIO2_DriverIRQHandler - bx r0 - .size GPIO2_IRQHandler, . - GPIO2_IRQHandler - - .align 1 - .thumb_func - .weak GPIO3_IRQHandler - .type GPIO3_IRQHandler, %function -GPIO3_IRQHandler: - ldr r0,=GPIO3_DriverIRQHandler - bx r0 - .size GPIO3_IRQHandler, . - GPIO3_IRQHandler - - .align 1 - .thumb_func - .weak Reserved91_IRQHandler - .type Reserved91_IRQHandler, %function -Reserved91_IRQHandler: - ldr r0,=Reserved91_DriverIRQHandler - bx r0 - .size Reserved91_IRQHandler, . - Reserved91_IRQHandler - - .align 1 - .thumb_func - .weak Reserved92_IRQHandler - .type Reserved92_IRQHandler, %function -Reserved92_IRQHandler: - ldr r0,=Reserved92_DriverIRQHandler - bx r0 - .size Reserved92_IRQHandler, . - Reserved92_IRQHandler - - .align 1 - .thumb_func - .weak Reserved93_IRQHandler - .type Reserved93_IRQHandler, %function -Reserved93_IRQHandler: - ldr r0,=Reserved93_DriverIRQHandler - bx r0 - .size Reserved93_IRQHandler, . - Reserved93_IRQHandler - - .align 1 - .thumb_func - .weak Reserved94_IRQHandler - .type Reserved94_IRQHandler, %function -Reserved94_IRQHandler: - ldr r0,=Reserved94_DriverIRQHandler - bx r0 - .size Reserved94_IRQHandler, . - Reserved94_IRQHandler - - .align 1 - .thumb_func - .weak Reserved95_IRQHandler - .type Reserved95_IRQHandler, %function -Reserved95_IRQHandler: - ldr r0,=Reserved95_DriverIRQHandler - bx r0 - .size Reserved95_IRQHandler, . - Reserved95_IRQHandler - - -/* Macro to define default handlers. Default handler - * will be weak symbol and just dead loops. They can be - * overwritten by other handlers */ - .macro def_irq_handler handler_name - .weak \handler_name - .set \handler_name, DefaultISR - .endm - -/* Exception Handlers */ - def_irq_handler MemManage_Handler - def_irq_handler BusFault_Handler - def_irq_handler UsageFault_Handler - def_irq_handler SecureFault_Handler - def_irq_handler DebugMon_Handler - def_irq_handler Reserved16_DriverIRQHandler - def_irq_handler CMC_DriverIRQHandler - def_irq_handler DMA_CH0_DriverIRQHandler - def_irq_handler DMA_CH1_DriverIRQHandler - def_irq_handler DMA_CH2_DriverIRQHandler - def_irq_handler DMA_CH3_DriverIRQHandler - def_irq_handler Reserved22_DriverIRQHandler - def_irq_handler Reserved23_DriverIRQHandler - def_irq_handler Reserved24_DriverIRQHandler - def_irq_handler Reserved25_DriverIRQHandler - def_irq_handler ERM0_SINGLE_BIT_DriverIRQHandler - def_irq_handler ERM0_MULTI_BIT_DriverIRQHandler - def_irq_handler FMU0_DriverIRQHandler - def_irq_handler GLIKEY0_DriverIRQHandler - def_irq_handler MBC0_DriverIRQHandler - def_irq_handler SCG0_DriverIRQHandler - def_irq_handler SPC0_DriverIRQHandler - def_irq_handler Reserved33_DriverIRQHandler - def_irq_handler WUU0_DriverIRQHandler - def_irq_handler Reserved35_DriverIRQHandler - def_irq_handler Reserved36_DriverIRQHandler - def_irq_handler Reserved37_DriverIRQHandler - def_irq_handler Reserved38_DriverIRQHandler - def_irq_handler Reserved39_DriverIRQHandler - def_irq_handler I3C0_DriverIRQHandler - def_irq_handler Reserved41_DriverIRQHandler - def_irq_handler LPI2C0_DriverIRQHandler - def_irq_handler Reserved43_DriverIRQHandler - def_irq_handler LPSPI0_DriverIRQHandler - def_irq_handler LPSPI1_DriverIRQHandler - def_irq_handler Reserved46_DriverIRQHandler - def_irq_handler LPUART0_DriverIRQHandler - def_irq_handler LPUART1_DriverIRQHandler - def_irq_handler LPUART2_DriverIRQHandler - def_irq_handler Reserved50_DriverIRQHandler - def_irq_handler Reserved51_DriverIRQHandler - def_irq_handler USB0_DriverIRQHandler - def_irq_handler Reserved53_DriverIRQHandler - def_irq_handler CDOG0_DriverIRQHandler - def_irq_handler CTIMER0_DriverIRQHandler - def_irq_handler CTIMER1_DriverIRQHandler - def_irq_handler CTIMER2_DriverIRQHandler - def_irq_handler Reserved58_DriverIRQHandler - def_irq_handler Reserved59_DriverIRQHandler - def_irq_handler FLEXPWM0_RELOAD_ERROR_DriverIRQHandler - def_irq_handler FLEXPWM0_FAULT_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE0_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE1_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE2_DriverIRQHandler - def_irq_handler Reserved65_DriverIRQHandler - def_irq_handler QDC0_COMPARE_DriverIRQHandler - def_irq_handler QDC0_HOME_DriverIRQHandler - def_irq_handler QDC0_WATCHDOG_DriverIRQHandler - def_irq_handler QDC0_INDEX_DriverIRQHandler - def_irq_handler FREQME0_DriverIRQHandler - def_irq_handler LPTMR0_DriverIRQHandler - def_irq_handler Reserved72_DriverIRQHandler - def_irq_handler OS_EVENT_DriverIRQHandler - def_irq_handler WAKETIMER0_DriverIRQHandler - def_irq_handler UTICK0_DriverIRQHandler - def_irq_handler WWDT0_DriverIRQHandler - def_irq_handler Reserved77_DriverIRQHandler - def_irq_handler ADC0_DriverIRQHandler - def_irq_handler Reserved79_DriverIRQHandler - def_irq_handler CMP0_DriverIRQHandler - def_irq_handler CMP1_DriverIRQHandler - def_irq_handler Reserved82_DriverIRQHandler - def_irq_handler Reserved83_DriverIRQHandler - def_irq_handler Reserved84_DriverIRQHandler - def_irq_handler Reserved85_DriverIRQHandler - def_irq_handler Reserved86_DriverIRQHandler - def_irq_handler GPIO0_DriverIRQHandler - def_irq_handler GPIO1_DriverIRQHandler - def_irq_handler GPIO2_DriverIRQHandler - def_irq_handler GPIO3_DriverIRQHandler - def_irq_handler Reserved91_DriverIRQHandler - def_irq_handler Reserved92_DriverIRQHandler - def_irq_handler Reserved93_DriverIRQHandler - def_irq_handler Reserved94_DriverIRQHandler - def_irq_handler Reserved95_DriverIRQHandler - - .end diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_aoi.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_aoi.c deleted file mode 100644 index 41a2650d264..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_aoi.c +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2019 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#include "fsl_aoi.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.aoi" -#endif - -#if defined(AOI_RSTS) -#define AOI_RESETS_ARRAY AOI_RSTS -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to aoi bases for each instance. */ -static AOI_Type *const s_aoiBases[] = AOI_BASE_PTRS; - -#if defined(AOI_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_aoiResets[] = AOI_RESETS_ARRAY; -#endif - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to aoi clocks for each instance. */ -static const clock_ip_name_t s_aoiClocks[] = AOI_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Get instance number for AOI module. - * - * @param base AOI peripheral base address - * - * @return The AOI instance - */ -static uint32_t AOI_GetInstance(AOI_Type *base); -/******************************************************************************* - * Code - ******************************************************************************/ - -static uint32_t AOI_GetInstance(AOI_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_aoiBases); instance++) - { - if (s_aoiBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_aoiBases)); - - return instance; -} - -/*! - * brief Initializes an AOI instance for operation. - * - * This function un-gates the AOI clock. - * - * param base AOI peripheral address. - */ -void AOI_Init(AOI_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock gate from clock manager. */ - CLOCK_EnableClock(s_aoiClocks[AOI_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(AOI_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_aoiResets[AOI_GetInstance(base)]); -#endif -} - -/*! - * brief Deinitializes an AOI instance for operation. - * - * This function shutdowns AOI module. - * - * param base AOI peripheral address. - */ -void AOI_Deinit(AOI_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable the clock gate from clock manager */ - CLOCK_DisableClock(s_aoiClocks[AOI_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Gets the Boolean evaluation associated. - * - * This function returns the Boolean evaluation associated. - * - * Example: - code - aoi_event_config_t demoEventLogicStruct; - - AOI_GetEventLogicConfig(AOI, kAOI_Event0, &demoEventLogicStruct); - endcode - * - * param base AOI peripheral address. - * param event Index of the event which will be set of type aoi_event_t. - * param config Selected input configuration . - */ -void AOI_GetEventLogicConfig(AOI_Type *base, aoi_event_t event, aoi_event_config_t *config) -{ - assert((uint32_t)event < (uint32_t)FSL_FEATURE_AOI_EVENT_COUNT); - assert(config != NULL); - - uint16_t value; - uint16_t temp; - /* Read BFCRT01 register at event index. */ - value = base->BFCRT[event].BFCRT01; - - temp = (value & AOI_BFCRT01_PT0_AC_MASK) >> AOI_BFCRT01_PT0_AC_SHIFT; - config->PT0AC = (aoi_input_config_t)temp; - temp = (value & AOI_BFCRT01_PT0_BC_MASK) >> AOI_BFCRT01_PT0_BC_SHIFT; - config->PT0BC = (aoi_input_config_t)temp; - temp = (value & AOI_BFCRT01_PT0_CC_MASK) >> AOI_BFCRT01_PT0_CC_SHIFT; - config->PT0CC = (aoi_input_config_t)temp; - temp = (value & AOI_BFCRT01_PT0_DC_MASK) >> AOI_BFCRT01_PT0_DC_SHIFT; - config->PT0DC = (aoi_input_config_t)temp; - - temp = (value & AOI_BFCRT01_PT1_AC_MASK) >> AOI_BFCRT01_PT1_AC_SHIFT; - config->PT1AC = (aoi_input_config_t)temp; - temp = (value & AOI_BFCRT01_PT1_BC_MASK) >> AOI_BFCRT01_PT1_BC_SHIFT; - config->PT1BC = (aoi_input_config_t)temp; - temp = (value & AOI_BFCRT01_PT1_CC_MASK) >> AOI_BFCRT01_PT1_CC_SHIFT; - config->PT1CC = (aoi_input_config_t)temp; - temp = (value & AOI_BFCRT01_PT1_DC_MASK) >> AOI_BFCRT01_PT1_DC_SHIFT; - config->PT1DC = (aoi_input_config_t)temp; - - /* Read BFCRT23 register at event index. */ - value = base->BFCRT[event].BFCRT23; - - temp = (value & AOI_BFCRT23_PT2_AC_MASK) >> AOI_BFCRT23_PT2_AC_SHIFT; - config->PT2AC = (aoi_input_config_t)temp; - temp = (value & AOI_BFCRT23_PT2_BC_MASK) >> AOI_BFCRT23_PT2_BC_SHIFT; - config->PT2BC = (aoi_input_config_t)temp; - temp = (value & AOI_BFCRT23_PT2_CC_MASK) >> AOI_BFCRT23_PT2_CC_SHIFT; - config->PT2CC = (aoi_input_config_t)temp; - temp = (value & AOI_BFCRT23_PT2_DC_MASK) >> AOI_BFCRT23_PT2_DC_SHIFT; - config->PT2DC = (aoi_input_config_t)temp; - - temp = (value & AOI_BFCRT23_PT3_AC_MASK) >> AOI_BFCRT23_PT3_AC_SHIFT; - config->PT3AC = (aoi_input_config_t)temp; - temp = (value & AOI_BFCRT23_PT3_BC_MASK) >> AOI_BFCRT23_PT3_BC_SHIFT; - config->PT3BC = (aoi_input_config_t)temp; - temp = (value & AOI_BFCRT23_PT3_CC_MASK) >> AOI_BFCRT23_PT3_CC_SHIFT; - config->PT3CC = (aoi_input_config_t)temp; - temp = (value & AOI_BFCRT23_PT3_DC_MASK) >> AOI_BFCRT23_PT3_DC_SHIFT; - config->PT3DC = (aoi_input_config_t)temp; -} - -/*! - * brief Configures an AOI event. - * - * This function configures an AOI event according - * to the aoiEventConfig structure. This function configures all inputs (A, B, C, and D) - * of all product terms (0, 1, 2, and 3) of a desired event. - * - * Example: - code - aoi_event_config_t demoEventLogicStruct; - - demoEventLogicStruct.PT0AC = kAOI_InvInputSignal; - demoEventLogicStruct.PT0BC = kAOI_InputSignal; - demoEventLogicStruct.PT0CC = kAOI_LogicOne; - demoEventLogicStruct.PT0DC = kAOI_LogicOne; - - demoEventLogicStruct.PT1AC = kAOI_LogicZero; - demoEventLogicStruct.PT1BC = kAOI_LogicOne; - demoEventLogicStruct.PT1CC = kAOI_LogicOne; - demoEventLogicStruct.PT1DC = kAOI_LogicOne; - - demoEventLogicStruct.PT2AC = kAOI_LogicZero; - demoEventLogicStruct.PT2BC = kAOI_LogicOne; - demoEventLogicStruct.PT2CC = kAOI_LogicOne; - demoEventLogicStruct.PT2DC = kAOI_LogicOne; - - demoEventLogicStruct.PT3AC = kAOI_LogicZero; - demoEventLogicStruct.PT3BC = kAOI_LogicOne; - demoEventLogicStruct.PT3CC = kAOI_LogicOne; - demoEventLogicStruct.PT3DC = kAOI_LogicOne; - - AOI_SetEventLogicConfig(AOI, kAOI_Event0, demoEventLogicStruct); - endcode - * - * param base AOI peripheral address. - * param event Event which will be configured of type aoi_event_t. - * param eventConfig Pointer to type aoi_event_config_t structure. The user is responsible for - * filling out the members of this structure and passing the pointer to this function. - */ -void AOI_SetEventLogicConfig(AOI_Type *base, aoi_event_t event, const aoi_event_config_t *eventConfig) -{ - assert(eventConfig != NULL); - assert((uint32_t)event < (uint32_t)FSL_FEATURE_AOI_EVENT_COUNT); - - uint16_t value; - /* Calculate value to configure product term 0, 1 */ - value = AOI_BFCRT01_PT0_AC(eventConfig->PT0AC) | AOI_BFCRT01_PT0_BC(eventConfig->PT0BC) | - AOI_BFCRT01_PT0_CC(eventConfig->PT0CC) | AOI_BFCRT01_PT0_DC(eventConfig->PT0DC) | - AOI_BFCRT01_PT1_AC(eventConfig->PT1AC) | AOI_BFCRT01_PT1_BC(eventConfig->PT1BC) | - AOI_BFCRT01_PT1_CC(eventConfig->PT1CC) | AOI_BFCRT01_PT1_DC(eventConfig->PT1DC); - /* Write value to register */ - base->BFCRT[event].BFCRT01 = value; - - /* Reset and calculate value to configure product term 2, 3 */ - value = AOI_BFCRT23_PT2_AC(eventConfig->PT2AC) | AOI_BFCRT23_PT2_BC(eventConfig->PT2BC) | - AOI_BFCRT23_PT2_CC(eventConfig->PT2CC) | AOI_BFCRT23_PT2_DC(eventConfig->PT2DC) | - AOI_BFCRT23_PT3_AC(eventConfig->PT3AC) | AOI_BFCRT23_PT3_BC(eventConfig->PT3BC) | - AOI_BFCRT23_PT3_CC(eventConfig->PT3CC) | AOI_BFCRT23_PT3_DC(eventConfig->PT3DC); - /* Write value to register */ - base->BFCRT[event].BFCRT23 = value; -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_aoi.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_aoi.h deleted file mode 100644 index 3b1126e623e..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_aoi.h +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2019 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_AOI_H_ -#define FSL_AOI_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup aoi - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -#ifndef AOI -#define AOI AOI0 /*!< AOI peripheral address */ -#endif - -/*! @name Driver version */ -/*! @{ */ -#define FSL_AOI_DRIVER_VERSION (MAKE_VERSION(2, 0, 2)) /*!< Version 2.0.2. */ -/*! @} */ - -/*! - * @brief AOI input configurations. - * - * The selection item represents the Boolean evaluations. - */ -typedef enum _aoi_input_config -{ - kAOI_LogicZero = 0x0U, /*!< Forces the input to logical zero. */ - kAOI_InputSignal = 0x1U, /*!< Passes the input signal. */ - kAOI_InvInputSignal = 0x2U, /*!< Inverts the input signal. */ - kAOI_LogicOne = 0x3U /*!< Forces the input to logical one. */ -} aoi_input_config_t; - -/*! - * @brief AOI event indexes, where an event is the collection of the four product - * terms (0, 1, 2, and 3) and the four signal inputs (A, B, C, and D). - */ -typedef enum _aoi_event -{ - kAOI_Event0 = 0x0U, /*!< Event 0 index */ - kAOI_Event1 = 0x1U, /*!< Event 1 index */ - kAOI_Event2 = 0x2U, /*!< Event 2 index */ - kAOI_Event3 = 0x3U /*!< Event 3 index */ -} aoi_event_t; - -/*! - * @brief AOI event configuration structure - * - * Defines structure _aoi_event_config and use the AOI_SetEventLogicConfig() function to make - * whole event configuration. - */ -typedef struct _aoi_event_config -{ - aoi_input_config_t PT0AC; /*!< Product term 0 input A */ - aoi_input_config_t PT0BC; /*!< Product term 0 input B */ - aoi_input_config_t PT0CC; /*!< Product term 0 input C */ - aoi_input_config_t PT0DC; /*!< Product term 0 input D */ - aoi_input_config_t PT1AC; /*!< Product term 1 input A */ - aoi_input_config_t PT1BC; /*!< Product term 1 input B */ - aoi_input_config_t PT1CC; /*!< Product term 1 input C */ - aoi_input_config_t PT1DC; /*!< Product term 1 input D */ - aoi_input_config_t PT2AC; /*!< Product term 2 input A */ - aoi_input_config_t PT2BC; /*!< Product term 2 input B */ - aoi_input_config_t PT2CC; /*!< Product term 2 input C */ - aoi_input_config_t PT2DC; /*!< Product term 2 input D */ - aoi_input_config_t PT3AC; /*!< Product term 3 input A */ - aoi_input_config_t PT3BC; /*!< Product term 3 input B */ - aoi_input_config_t PT3CC; /*!< Product term 3 input C */ - aoi_input_config_t PT3DC; /*!< Product term 3 input D */ -} aoi_event_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus*/ - -/*! - * @name AOI Initialization - * @{ - */ - -/*! - * @brief Initializes an AOI instance for operation. - * - * This function un-gates the AOI clock. - * - * @param base AOI peripheral address. - */ -void AOI_Init(AOI_Type *base); - -/*! - * @brief Deinitializes an AOI instance for operation. - * - * This function shutdowns AOI module. - * - * @param base AOI peripheral address. - */ -void AOI_Deinit(AOI_Type *base); - -/*! @} */ - -/*! - * @name AOI Get Set Operation - * @{ - */ - -/*! - * @brief Gets the Boolean evaluation associated. - * - * This function returns the Boolean evaluation associated. - * - * Example: - @code - aoi_event_config_t demoEventLogicStruct; - - AOI_GetEventLogicConfig(AOI, kAOI_Event0, &demoEventLogicStruct); - @endcode - * - * @param base AOI peripheral address. - * @param event Index of the event which will be set of type aoi_event_t. - * @param config Selected input configuration . - */ -void AOI_GetEventLogicConfig(AOI_Type *base, aoi_event_t event, aoi_event_config_t *config); - -/*! - * @brief Configures an AOI event. - * - * This function configures an AOI event according - * to the aoiEventConfig structure. This function configures all inputs (A, B, C, and D) - * of all product terms (0, 1, 2, and 3) of a desired event. - * - * Example: - @code - aoi_event_config_t demoEventLogicStruct; - - demoEventLogicStruct.PT0AC = kAOI_InvInputSignal; - demoEventLogicStruct.PT0BC = kAOI_InputSignal; - demoEventLogicStruct.PT0CC = kAOI_LogicOne; - demoEventLogicStruct.PT0DC = kAOI_LogicOne; - - demoEventLogicStruct.PT1AC = kAOI_LogicZero; - demoEventLogicStruct.PT1BC = kAOI_LogicOne; - demoEventLogicStruct.PT1CC = kAOI_LogicOne; - demoEventLogicStruct.PT1DC = kAOI_LogicOne; - - demoEventLogicStruct.PT2AC = kAOI_LogicZero; - demoEventLogicStruct.PT2BC = kAOI_LogicOne; - demoEventLogicStruct.PT2CC = kAOI_LogicOne; - demoEventLogicStruct.PT2DC = kAOI_LogicOne; - - demoEventLogicStruct.PT3AC = kAOI_LogicZero; - demoEventLogicStruct.PT3BC = kAOI_LogicOne; - demoEventLogicStruct.PT3CC = kAOI_LogicOne; - demoEventLogicStruct.PT3DC = kAOI_LogicOne; - - AOI_SetEventLogicConfig(AOI, kAOI_Event0, demoEventLogicStruct); - @endcode - * - * @param base AOI peripheral address. - * @param event Event which will be configured of type aoi_event_t. - * @param eventConfig Pointer to type aoi_event_config_t structure. The user is responsible for - * filling out the members of this structure and passing the pointer to this function. - */ -void AOI_SetEventLogicConfig(AOI_Type *base, aoi_event_t event, const aoi_event_config_t *eventConfig); - -#if defined(__cplusplus) -} -#endif /* __cplusplus*/ - -/*! @} */ - -/*!* @} */ - -#endif /* FSL_AOI_H_*/ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_cdog.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_cdog.c deleted file mode 100644 index cd3ed6eaa3f..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_cdog.c +++ /dev/null @@ -1,378 +0,0 @@ -/* - * Copyright 2020-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_cdog.h" - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.cdog" -#endif - -/* Reset CONTROL mask */ -#define RESERVED_CTRL_MASK 0x800u - -#if defined(CDOG_IRQS) -/* Array of IRQs */ -static const IRQn_Type s_CdogIrqs[] = CDOG_IRQS; -#endif /* CDOG_IRQS */ - -#ifdef CDOG_CLOCKS -static const clock_ip_name_t s_CdogClocks[] = CDOG_CLOCKS; -#endif /* CDOG_CLOCKS */ - -#ifdef CDOG_BASE_PTRS -static const CDOG_Type* s_cdogBases[] = CDOG_BASE_PTRS; -#endif /* CDOG_BASE_PTRS */ - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -static uint32_t CDOG_GetInstance(CDOG_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_cdogBases); instance++) - { - if (s_cdogBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_cdogBases)); - - return instance; -} - -/*! - * brief Sets the default configuration of CDOG - * - * This function initialize CDOG config structure to default values. - * - * param conf CDOG configuration structure - */ -void CDOG_GetDefaultConfig(cdog_config_t *conf) -{ - /* Default configuration after reset */ - conf->lock = (uint8_t)kCDOG_LockCtrl_Unlock; /* Lock control */ - conf->timeout = (uint8_t)kCDOG_FaultCtrl_NoAction; /* Timeout control */ - conf->miscompare = (uint8_t)kCDOG_FaultCtrl_NoAction; /* Miscompare control */ - conf->sequence = (uint8_t)kCDOG_FaultCtrl_NoAction; /* Sequence control */ - conf->state = (uint8_t)kCDOG_FaultCtrl_NoAction; /* State control */ - conf->address = (uint8_t)kCDOG_FaultCtrl_NoAction; /* Address control */ - conf->irq_pause = (uint8_t)kCDOG_IrqPauseCtrl_Run; /* IRQ pause control */ - conf->debug_halt = (uint8_t)kCDOG_DebugHaltCtrl_Run; /* Debug halt control */ - return; -} - -/*! - * brief Sets secure counter and instruction timer values - * - * This function sets value in RELOAD and START registers for instruction timer. - * - * param base CDOG peripheral base address - * param reload reload value - * param start start value - */ -void CDOG_Start(CDOG_Type *base, uint32_t reload, uint32_t start) -{ - base->RELOAD = reload; - base->START = start; -} - -/*! - * brief Stops secure counter and instruction timer - * - * This function stops instruction timer and secure counter. - * This also change state of CDOG to IDLE. - * - * param base CDOG peripheral base address - * param stop expected value which will be compared with value of secure counter - */ -void CDOG_Stop(CDOG_Type *base, uint32_t stop) -{ - base->STOP = stop; -} - -/*! - * brief Sets secure counter and instruction timer values - * - * This function sets value in STOP, RELOAD and START registers - * for instruction timer and secure counter. - * - * param base CDOG peripheral base address - * param stop expected value which will be compared with value of secure counter - * param reload reload value for instruction timer - * param start start value for secure timer - */ -void CDOG_Set(CDOG_Type *base, uint32_t stop, uint32_t reload, uint32_t start) -{ - base->STOP = stop; - base->RELOAD = reload; - base->START = start; -} - -/*! - * brief Add value to secure counter - * - * This function add specified value to secure counter. - * - * param base CDOG peripheral base address. - * param add Value to be added. - */ -void CDOG_Add(CDOG_Type *base, uint32_t add) -{ - base->ADD = (secure_counter_t)add; -} - -/*! - * brief Add 1 to secure counter - * - * This function add 1 to secure counter. - * - * param base CDOG peripheral base address. - * param add Value to be added. - */ -void CDOG_Add1(CDOG_Type *base) -{ - base->ADD1 = (secure_counter_t)0x1U; -} - -/*! - * brief Add 16 to secure counter - * - * This function add 16 to secure counter. - * - * param base CDOG peripheral base address. - * param add Value to be added. - */ -void CDOG_Add16(CDOG_Type *base) -{ - base->ADD16 = (secure_counter_t)0x1U; -} - -/*! - * brief Add 256 to secure counter - * - * This function add 256 to secure counter. - * - * param base CDOG peripheral base address. - * param add Value to be added. - */ -void CDOG_Add256(CDOG_Type *base) -{ - base->ADD256 = (secure_counter_t)0x1U; -} - -/*! - * brief Substract value to secure counter - * - * This function substract specified value to secure counter. - * - * param base CDOG peripheral base address. - * param sub Value to be substracted. - */ -void CDOG_Sub(CDOG_Type *base, uint32_t sub) -{ - base->SUB = (secure_counter_t)sub; -} - -/*! - * brief Substract 1 from secure counter - * - * This function substract specified 1 from secure counter. - * - * param base CDOG peripheral base address. - */ -void CDOG_Sub1(CDOG_Type *base) -{ - base->SUB1 = (secure_counter_t)0x1U; -} - -/*! - * brief Substract 16 from secure counter - * - * This function substract specified 16 from secure counter. - * - * param base CDOG peripheral base address. - */ -void CDOG_Sub16(CDOG_Type *base) -{ - base->SUB16 = (secure_counter_t)0x1U; -} - -/*! - * brief Substract 256 from secure counter - * - * This function substract specified 256 from secure counter. - * - * param base CDOG peripheral base address. - */ -void CDOG_Sub256(CDOG_Type *base) -{ - base->SUB256 = (secure_counter_t)0x1U; -} - -/*! - * brief Checks secure counter. - * - * This function compares stop value with secure counter value - * by writting to RELOAD refister. - * - * param base CDOG peripheral base address - * param check expected (stop) value. - */ -void CDOG_Check(CDOG_Type *base, uint32_t check) -{ -#if defined(FLS_FEATURE_CDOG_USE_RESTART) - base->RESTART = check; -#else - base->STOP = check; - base->RELOAD = base->RELOAD; - base->START= check; -#endif -} - -/*! - * brief Set the CDOG persistent word. - * - * param base CDOG peripheral base address. - * param value The value to be written. - */ -void CDOG_WritePersistent(CDOG_Type *base, uint32_t value) -{ - base->PERSISTENT = value; -} - -/*! - * brief Get the CDOG persistent word. - * - * param base CDOG peripheral base address. - * return The persistent word. - */ -uint32_t CDOG_ReadPersistent(CDOG_Type *base) -{ - return base->PERSISTENT; -} - -/*! - * brief Initialize CDOG - * - * This function initializes CDOG setting and enable all interrupts. - * - * param base CDOG peripheral base address - * param conf CDOG configuration structure - * return Status of the init operation - */ -status_t CDOG_Init(CDOG_Type *base, cdog_config_t *conf) -{ - /* Ungate clock to CDOG engine and reset it */ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#ifdef CDOG_CLOCKS - CLOCK_EnableClock(s_CdogClocks[CDOG_GetInstance(base)]); -#endif /* CDOG_CLOCKS */ -#endif /* !FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_FEATURE_CDOG_HAS_NO_RESET) && FSL_FEATURE_CDOG_HAS_NO_RESET) - RESET_PeripheralReset(kCDOG_RST_SHIFT_RSTn); -#endif /* !FSL_FEATURE_CDOG_HAS_NO_RESET */ - - if (base->CONTROL == 0x0U) - { - /* CDOG is not in IDLE mode, which may be cause after SW reset. */ - /* Writing to CONTROL register will trigger fault. */ - return kStatus_Fail; - } - - /* Clear pending errors, otherwise the device will reset */ - /* itself immediately after enable Code Watchdog */ - if ((uint32_t)kCDOG_LockCtrl_Lock == - ((base->CONTROL & CDOG_CONTROL_LOCK_CTRL_MASK) >> CDOG_CONTROL_LOCK_CTRL_SHIFT)) - - { - base->FLAGS = CDOG_FLAGS_TO_FLAG(1U) | CDOG_FLAGS_MISCOM_FLAG(1U) | CDOG_FLAGS_SEQ_FLAG(1U) | - CDOG_FLAGS_CNT_FLAG(1U) | CDOG_FLAGS_STATE_FLAG(1U) | CDOG_FLAGS_ADDR_FLAG(1U) | - CDOG_FLAGS_POR_FLAG(1U); - } - else - { -/* load default values for CDOG->CONTROL before flags clear */ -#if defined(FSL_FEATURE_CDOG_NEED_LOAD_DEFAULT_CONF) && (FSL_FEATURE_CDOG_NEED_LOAD_DEFAULT_CONF > 0) - cdog_config_t default_conf; - - /* Initialize CDOG */ - CDOG_GetDefaultConfig(&default_conf); - - /* Write default value to CDOG->CONTROL*/ - base->CONTROL = - CDOG_CONTROL_TIMEOUT_CTRL(default_conf.timeout) | /* Action if the timeout event is triggered */ - CDOG_CONTROL_MISCOMPARE_CTRL(default_conf.miscompare) | /* Action if the miscompare error event is triggered */ - CDOG_CONTROL_SEQUENCE_CTRL(default_conf.sequence) | /* Action if the sequence error event is triggered */ - CDOG_CONTROL_STATE_CTRL(default_conf.state) | /* Action if the state error event is triggered */ - CDOG_CONTROL_ADDRESS_CTRL(default_conf.address) | /* Action if the address error event is triggered */ - CDOG_CONTROL_IRQ_PAUSE(default_conf.irq_pause) | /* Pause running during interrupts setup */ - CDOG_CONTROL_DEBUG_HALT_CTRL(default_conf.debug_halt) | /* Halt CDOG timer during debug */ - CDOG_CONTROL_LOCK_CTRL(default_conf.lock) | RESERVED_CTRL_MASK; /* Lock control register, RESERVED */ -#endif /* FSL_FEATURE_CDOG_NEED_LOAD_DEFAULT_CONF */ - - base->FLAGS = CDOG_FLAGS_TO_FLAG(0U) | CDOG_FLAGS_MISCOM_FLAG(0U) | CDOG_FLAGS_SEQ_FLAG(0U) | - CDOG_FLAGS_CNT_FLAG(0U) | CDOG_FLAGS_STATE_FLAG(0U) | CDOG_FLAGS_ADDR_FLAG(0U) | - CDOG_FLAGS_POR_FLAG(0U); - } - - base->CONTROL = - CDOG_CONTROL_TIMEOUT_CTRL(conf->timeout) | /* Action if the timeout event is triggered */ - CDOG_CONTROL_MISCOMPARE_CTRL(conf->miscompare) | /* Action if the miscompare error event is triggered */ - CDOG_CONTROL_SEQUENCE_CTRL(conf->sequence) | /* Action if the sequence error event is triggered */ - CDOG_CONTROL_STATE_CTRL(conf->state) | /* Action if the state error event is triggered */ - CDOG_CONTROL_ADDRESS_CTRL(conf->address) | /* Action if the address error event is triggered */ - CDOG_CONTROL_IRQ_PAUSE(conf->irq_pause) | /* Pause running during interrupts setup */ - CDOG_CONTROL_DEBUG_HALT_CTRL(conf->debug_halt) | /* Halt CDOG timer during debug */ - CDOG_CONTROL_LOCK_CTRL(conf->lock) | RESERVED_CTRL_MASK; /* Lock control register, RESERVED */ - -#if defined(CDOG_IRQS) - /* Enable peripheral IRQ */ - NVIC_EnableIRQ(s_CdogIrqs[CDOG_GetInstance(base)]); -#endif /* CDOG_IRQS */ - - return kStatus_Success; -} - -/*! - * brief Deinitialize CDOG - * - * This function stops CDOG secure counter. - * - * param base CDOG peripheral base address - */ -void CDOG_Deinit(CDOG_Type *base) -{ -#if defined(CDOG_IRQS) - /* Disable peripheral IRQ */ - NVIC_DisableIRQ(s_CdogIrqs[CDOG_GetInstance(base)]); -#endif /* CDOG_IRQS */ - -#if !(defined(FSL_FEATURE_CDOG_HAS_NO_RESET) && FSL_FEATURE_CDOG_HAS_NO_RESET) - RESET_SetPeripheralReset(kCDOG_RST_SHIFT_RSTn); -#endif /* !FSL_FEATURE_CDOG_HAS_NO_RESET */ - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#ifdef CDOG_CLOCKS - CLOCK_DisableClock(s_CdogClocks[CDOG_GetInstance(base)]); -#endif /* CDOG_CLOCKS */ -#endif /* !FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_cdog.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_cdog.h deleted file mode 100644 index 7252eaccd8c..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_cdog.h +++ /dev/null @@ -1,329 +0,0 @@ -/* - * Copyright 2020-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_CDOG_H_ -#define FSL_CDOG_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup CDOG - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief Defines CDOG driver version 2.1.3. - * - * Change log: - * - Version 2.1.3 - * - Re-design multiple instance IRQs and Clocks - * - Add fix for RESTART command errata - * - Version 2.1.2 - * - Support multiple IRQs - * - Fix default CONTROL values - * - Version 2.1.1 - * - Remove bit CONTROL[CONTROL_CTRL] - * - Version 2.1.0 - * - Rename CWT to CDOG - * - Version 2.0.2 - * - Fix MISRA-2012 issues - * - Version 2.0.1 - * - Fix doxygen issues - * - Version 2.0.0 - * - initial version - */ -#define FSL_CDOG_DRIVER_VERSION (MAKE_VERSION(2, 1, 3)) -/*! @} */ - -typedef struct -{ - uint8_t lock : 2; - uint8_t timeout : 3; - uint8_t miscompare : 3; - uint8_t sequence : 3; - uint8_t state : 3; - uint8_t address : 3; - uint8_t reserved : 8; - uint8_t irq_pause : 2; - uint8_t debug_halt : 2; -} cdog_config_t; - -enum __cdog_debug_Action_ctrl_enum -{ - kCDOG_DebugHaltCtrl_Run = 0x1, - kCDOG_DebugHaltCtrl_Pause = 0x2, -}; - -enum __cdog_irq_pause_ctrl_enum -{ - kCDOG_IrqPauseCtrl_Run = 0x1, - kCDOG_IrqPauseCtrl_Pause = 0x2, -}; - -enum __cdog_fault_ctrl_enum -{ - kCDOG_FaultCtrl_EnableReset = 0x1U, - kCDOG_FaultCtrl_EnableInterrupt = 0x2U, - kCDOG_FaultCtrl_NoAction = 0x4U, -}; - -enum __code_lock_ctrl_enum -{ - kCDOG_LockCtrl_Lock = 0x1, - kCDOG_LockCtrl_Unlock = 0x2, -}; - -typedef uint32_t secure_counter_t; - -#define SC_ADD(add) \ - do \ - { \ - CDOG->ADD = (secure_counter_t)(add); \ - } while (0) - -#define SC_ADD1 \ - do \ - { \ - CDOG->ADD1 = (secure_counter_t)0x1U; \ - } while (0) - -#define SC_ADD16 \ - do \ - { \ - CDOG->ADD16 = (secure_counter_t)0x1U; \ - } while (0) - -#define SC_ADD256 \ - do \ - { \ - CDOG->ADD256 = (secure_counter_t)0x1U; \ - } while (0) - -#define SC_SUB(sub) \ - do \ - { \ - CDOG->SUB = (secure_counter_t)(sub); \ - } while (0) - -#define SC_SUB1 \ - do \ - { \ - CDOG->SUB1 = (secure_counter_t)0x1U; \ - } while (0) - -#define SC_SUB16 \ - do \ - { \ - CDOG->SUB16 = (secure_counter_t)0x1U; \ - } while (0) - -#define SC_SUB256 \ - do \ - { \ - CDOG->SUB256 = (secure_counter_t)0x1U; \ - } while (0) - -#define SC_CHECK(val) \ - do \ - { \ - CDOG->RESTART = (secure_counter_t)val; \ - } while (0) - -/******************************************************************************* - * API - *******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name CDOG Functional Operation - * @{ - */ - -/*! - * @brief Initialize CDOG - * - * This function initializes CDOG block and setting. - * - * @param base CDOG peripheral base address - * @param conf CDOG configuration structure - * @return Status of the init operation - */ -status_t CDOG_Init(CDOG_Type *base, cdog_config_t *conf); - -/*! - * @brief Deinitialize CDOG - * - * This function deinitializes CDOG secure counter. - * - * @param base CDOG peripheral base address - */ -void CDOG_Deinit(CDOG_Type *base); - -/*! - * @brief Sets the default configuration of CDOG - * - * This function initialize CDOG config structure to default values. - * - * @param conf CDOG configuration structure - */ -void CDOG_GetDefaultConfig(cdog_config_t *conf); - -/*! - * @brief Stops secure counter and instruction timer - * - * This function stops instruction timer and secure counter. - * This also change state od CDOG to IDLE. - * - * @param base CDOG peripheral base address - * @param stop expected value which will be compared with value of secure counter - */ -void CDOG_Stop(CDOG_Type *base, uint32_t stop); - -/*! - * @brief Sets secure counter and instruction timer values - * - * This function sets value in RELOAD and START registers - * for instruction timer and secure counter - * - * @param base CDOG peripheral base address - * @param reload reload value - * @param start start value - */ -void CDOG_Start(CDOG_Type *base, uint32_t reload, uint32_t start); - -/*! - * @brief Checks secure counter. - * - * This function compares stop value in handler with secure counter value - * by writting to RELOAD refister. - * - * @param base CDOG peripheral base address - * @param check expected (stop) value - */ -void CDOG_Check(CDOG_Type *base, uint32_t check); - -/*! - * @brief Sets secure counter and instruction timer values - * - * This function sets value in STOP, RELOAD and START registers - * for instruction timer and secure counter. - * - * @param base CDOG peripheral base address - * @param stop expected value which will be compared with value of secure counter - * @param reload reload value for instruction timer - * @param start start value for secure timer - */ -void CDOG_Set(CDOG_Type *base, uint32_t stop, uint32_t reload, uint32_t start); - -/*! - * @brief Add value to secure counter - * - * This function add specified value to secure counter. - * - * @param base CDOG peripheral base address. - * @param add Value to be added. - */ -void CDOG_Add(CDOG_Type *base, uint32_t add); - -/*! - * @brief Add 1 to secure counter - * - * This function add 1 to secure counter. - * - * @param base CDOG peripheral base address. - */ -void CDOG_Add1(CDOG_Type *base); - -/*! - * @brief Add 16 to secure counter - * - * This function add 16 to secure counter. - * - * @param base CDOG peripheral base address. - */ -void CDOG_Add16(CDOG_Type *base); - -/*! - * @brief Add 256 to secure counter - * - * This function add 256 to secure counter. - * - * @param base CDOG peripheral base address. - */ -void CDOG_Add256(CDOG_Type *base); - -/*! - * brief Substract value to secure counter - * - * This function substract specified value to secure counter. - * - * param base CDOG peripheral base address. - * param sub Value to be substracted. - */ -void CDOG_Sub(CDOG_Type *base, uint32_t sub); - -/*! - * @brief Substract 1 from secure counter - * - * This function substract specified 1 from secure counter. - * - * @param base CDOG peripheral base address. - */ -void CDOG_Sub1(CDOG_Type *base); - -/*! - * @brief Substract 16 from secure counter - * - * This function substract specified 16 from secure counter. - * - * @param base CDOG peripheral base address. - */ -void CDOG_Sub16(CDOG_Type *base); - -/*! - * @brief Substract 256 from secure counter - * - * This function substract specified 256 from secure counter. - * - * @param base CDOG peripheral base address. - */ -void CDOG_Sub256(CDOG_Type *base); - -/*! - * @brief Set the CDOG persistent word. - * - * @param base CDOG peripheral base address. - * @param value The value to be written. - */ -void CDOG_WritePersistent(CDOG_Type *base, uint32_t value); - -/*! - * @brief Get the CDOG persistent word. - * - * @param base CDOG peripheral base address. - * @return The persistent word. - */ -uint32_t CDOG_ReadPersistent(CDOG_Type *base); - -/*! @}*/ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @}*/ /* end of group cdog */ - -#endif /* FSL_CDOG_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_clock.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_clock.c deleted file mode 100644 index 179ff111099..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_clock.c +++ /dev/null @@ -1,1172 +0,0 @@ -/* - * Copyright 2023, NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_clock.h" -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.clock" -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ -/** External clock rate on the CLKIN pin in Hz. If not used, - set this to 0. Otherwise, set it to the exact rate in Hz this pin is - being driven at. */ -volatile static uint32_t s_Ext_Clk_Freq = 16000000U; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/* Get FRO 12M Clk */ -static uint32_t CLOCK_GetFro12MFreq(void); -/* Get CLK 1M Clk */ -static uint32_t CLOCK_GetClk1MFreq(void); -/* Get HF FRO Clk */ -static uint32_t CLOCK_GetFroHfFreq(void); -/* Get CLK 48M Clk */ -static uint32_t CLOCK_GetClk48MFreq(void); -/* Get CLK 16K Clk */ -static uint32_t CLOCK_GetClk16KFreq(uint8_t id); -/* Get EXT OSC Clk */ -static uint32_t CLOCK_GetExtClkFreq(void); -/* Get Main_Clk */ -uint32_t CLOCK_GetMainClk(void); -/* Get FRO_16K */ -static uint32_t CLOCK_GetFRO16KFreq(void); - -/* Check if DIV is halt */ -static inline bool CLOCK_IsDivHalt(uint32_t div_value) -{ - if (0U != (div_value & (1UL << 30U))) - { - return true; - } - else - { - return false; - } -} - -/******************************************************************************* - * Code - ******************************************************************************/ - -/* Clock Selection for IP */ -/** - * brief Configure the clock selection muxes. - * param connection : Clock to be configured. - * return Nothing - */ -void CLOCK_AttachClk(clock_attach_id_t connection) -{ - const uint32_t reg_offset = CLK_ATTACH_REG_OFFSET(connection); - const uint32_t clk_sel = CLK_ATTACH_CLK_SEL(connection); - - if (kNONE_to_NONE != connection) - { - CLOCK_SetClockSelect((clock_select_name_t)reg_offset, clk_sel); - } -} - -/* Return the actual clock attach id */ -/** - * brief Get the actual clock attach id. - * This fuction uses the offset in input attach id, then it reads the actual source value in - * the register and combine the offset to obtain an actual attach id. - * param connection : Clock attach id to get. - * return Clock source value. - */ -clock_attach_id_t CLOCK_GetClockAttachId(clock_attach_id_t connection) -{ - const uint32_t reg_offset = CLK_ATTACH_REG_OFFSET(connection); - uint32_t actual_sel = 0U; - uint32_t clock_attach_id = 0U; - - if (kNONE_to_NONE == connection) - { - return kNONE_to_NONE; - } - - actual_sel = CLOCK_GetClockSelect((clock_select_name_t)reg_offset); - clock_attach_id = CLK_ATTACH_MUX(reg_offset, actual_sel); - - return (clock_attach_id_t)clock_attach_id; -} - -/* Set the clock selection value */ -void CLOCK_SetClockSelect(clock_select_name_t sel_name, uint32_t value) -{ - volatile uint32_t *pClkCtrl = (volatile uint32_t *)(MRCC0_BASE + (uint32_t)sel_name); - assert(sel_name <= kCLOCK_SelMax); - - if (sel_name == kCLOCK_SelSCGSCS) - { - SCG0->RCCR = (SCG0->RCCR & ~(SCG_RCCR_SCS_MASK)) | SCG_RCCR_SCS(value); - while ((SCG0->CSR & SCG_CSR_SCS_MASK) != SCG_CSR_SCS(value)) - { - } - } - else - { - /* Unlock clock configuration */ - SYSCON->CLKUNLOCK &= ~SYSCON_CLKUNLOCK_UNLOCK_MASK; - - *pClkCtrl = value; - - /* Freeze clock configuration */ - SYSCON->CLKUNLOCK |= SYSCON_CLKUNLOCK_UNLOCK_MASK; - } -} - -/* Get the clock selection value */ -uint32_t CLOCK_GetClockSelect(clock_select_name_t sel_name) -{ - volatile uint32_t *pClkCtrl = (volatile uint32_t *)(MRCC0_BASE + (uint32_t)sel_name); - uint32_t actual_sel = 0U; - assert(sel_name <= kCLOCK_SelMax); - - if (sel_name == kCLOCK_SelSCGSCS) - { - actual_sel = (uint32_t)((SCG0->RCCR & SCG_RCCR_SCS_MASK) >> SCG_RCCR_SCS_SHIFT); - } - else - { - actual_sel = *pClkCtrl; - } - - return actual_sel; -} - -/* Set the clock divider value */ -void CLOCK_SetClockDiv(clock_div_name_t div_name, uint32_t value) -{ - volatile uint32_t *pDivCtrl = (volatile uint32_t *)(MRCC0_BASE + (uint32_t)div_name); - assert(div_name <= kCLOCK_DivMax); - - /* Unlock clock configuration */ - SYSCON->CLKUNLOCK &= ~SYSCON_CLKUNLOCK_UNLOCK_MASK; - - /* halt and reset clock dividers */ - *pDivCtrl = 0x3UL << 29U; - - if (value == 0U) /*!< halt */ - { - *pDivCtrl |= (1UL << 30U); - } - else - { - *pDivCtrl = (value - 1U); - } - - /* Freeze clock configuration */ - SYSCON->CLKUNLOCK |= SYSCON_CLKUNLOCK_UNLOCK_MASK; -} - -/* Get the clock divider value */ -uint32_t CLOCK_GetClockDiv(clock_div_name_t div_name) -{ - volatile uint32_t *pDivCtrl = (volatile uint32_t *)(MRCC0_BASE + (uint32_t)div_name); - assert(div_name <= kCLOCK_DivMax); - - if (((*pDivCtrl) & (1UL << 30U)) != 0U) - { - return 0; - } - else - { - return ((*pDivCtrl & 0xFFU) + 1U); - } -} - -/* Halt the clock divider value */ -void CLOCK_HaltClockDiv(clock_div_name_t div_name) -{ - volatile uint32_t *pDivCtrl = (volatile uint32_t *)(MRCC0_BASE + (uint32_t)div_name); - assert(div_name <= kCLOCK_DivMax); - - /* Unlock clock configuration */ - SYSCON->CLKUNLOCK &= ~SYSCON_CLKUNLOCK_UNLOCK_MASK; - - *pDivCtrl |= (1UL << 30U); - - /* Freeze clock configuration */ - SYSCON->CLKUNLOCK |= SYSCON_CLKUNLOCK_UNLOCK_MASK; -} - -/* Initialize the FROHF to given frequency (48,64,96,192) */ -status_t CLOCK_SetupFROHFClocking(uint32_t iFreq) -{ - uint8_t freq_select = 0x0U; - switch (iFreq) - { - case 48000000U: - freq_select = 1U; - break; - case 64000000U: - freq_select = 3U; - break; - case 96000000U: - freq_select = 5U; - break; - case 192000000U: - freq_select = 7U; - break; - default: - freq_select = 0xFU; - break; - } - - if (0xFU == freq_select) - { - return kStatus_Fail; - } - - /* Set FIRC frequency */ - SCG0->FIRCCFG = SCG_FIRCCFG_FREQ_SEL(freq_select); - - /* Unlock FIRCCSR */ - SCG0->FIRCCSR &= ~SCG_FIRCCSR_LK_MASK; - - /* Enable CLK 48 MHz clock for peripheral use */ - SCG0->FIRCCSR |= SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_MASK; - /* Enable FIRC HF clock for peripheral use */ - SCG0->FIRCCSR |= SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN_MASK; - /* Enable FIRC */ - SCG0->FIRCCSR |= SCG_FIRCCSR_FIRCEN_MASK; - - /* Lock FIRCCSR */ - SCG0->FIRCCSR |= SCG_FIRCCSR_LK_MASK; - - /* Wait for FIRC clock to be valid. */ - while ((SCG0->FIRCCSR & SCG_FIRCCSR_FIRCVLD_MASK) == 0U) - { - } - - return kStatus_Success; -} - -/* Initialize the FRO12M. */ -status_t CLOCK_SetupFRO12MClocking(void) -{ - /* Unlock SIRCCSR */ - SCG0->SIRCCSR &= ~SCG_SIRCCSR_LK_MASK; - - /* Enable FRO12M clock for peripheral use */ - SCG0->SIRCCSR |= SCG_SIRCCSR_SIRC_CLK_PERIPH_EN_MASK; - - /* Lock SIRCCSR */ - SCG0->SIRCCSR |= SCG_SIRCCSR_LK_MASK; - - /* Wait for SIRC clock to be valid. */ - while ((SCG0->SIRCCSR & SCG_SIRCCSR_SIRCVLD_MASK) == 0U) - { - } - - return kStatus_Success; -} - -/*! - * brief Initialize the FRO16K. - * This function turns on FRO16K. - * return returns success or fail status. - */ -status_t CLOCK_SetupFRO16KClocking(uint8_t clk_16k_enable_mask) -{ - VBAT0->FROCTLA |= VBAT_FROCTLA_FRO_EN_MASK; - VBAT0->FROLCKA |= VBAT_FROLCKA_LOCK_MASK; - - /* enable clk_16k output clock to corresponding modules according to the enable_mask. */ - VBAT0->FROCLKE |= VBAT_FROCLKE_CLKE(((uint32_t)clk_16k_enable_mask)); - - return kStatus_Success; -} - -/*! - * brief Initialize the external osc clock to given frequency. - * param iFreq : Desired frequency (must be equal to exact rate in Hz) - * return returns success or fail status. - */ -status_t CLOCK_SetupExtClocking(uint32_t iFreq) -{ - uint8_t range = 0U; - - if ((iFreq >= 8000000U) && (iFreq < 16000000U)) - { - range = 0U; - } - else if ((iFreq >= 16000000U) && (iFreq < 25000000U)) - { - range = 1U; - } - else if ((iFreq >= 25000000U) && (iFreq < 40000000U)) - { - range = 2U; - } - else if ((iFreq >= 40000000U) && (iFreq <= 50000000U)) - { - range = 3U; - } - else - { - return kStatus_InvalidArgument; - } - - /* If configure register is locked, return error. */ - if ((SCG0->SOSCCSR & SCG_SOSCCSR_LK_MASK) != 0U) - { - return kStatus_ReadOnly; - } - - /* De-initializes the SCG SOSC */ - SCG0->SOSCCSR = SCG_SOSCCSR_SOSCERR_MASK; - - /* Select SOSC source (internal crystal oscillator) and Configure SOSC range */ - SCG0->SOSCCFG = SCG_SOSCCFG_EREFS_MASK | SCG_SOSCCFG_RANGE(range); - - /* Unlock SOSCCSR */ - SCG0->SOSCCSR &= ~SCG_SOSCCSR_LK_MASK; - - /* Enable SOSC clock monitor and Enable SOSC */ - SCG0->SOSCCSR |= (SCG_SOSCCSR_SOSCCM_MASK | SCG_SOSCCSR_SOSCEN_MASK); - - /* Wait for SOSC clock to be valid. */ - while ((SCG0->SOSCCSR & SCG_SOSCCSR_SOSCVLD_MASK) == 0U) - { - } - - s_Ext_Clk_Freq = iFreq; - - return kStatus_Success; -} - -/*! - * @brief Initialize the external reference clock to given frequency. - * param iFreq : Desired frequency (must be equal to exact rate in Hz) - * return returns success or fail status. - */ -status_t CLOCK_SetupExtRefClocking(uint32_t iFreq) -{ - - if (iFreq > 50000000U) - { - return kStatus_InvalidArgument; - } - - /* If configure register is locked, return error. */ - if ((SCG0->SOSCCSR & SCG_SOSCCSR_LK_MASK) != 0U) - { - return kStatus_ReadOnly; - } - - /* De-initializes the SCG SOSC */ - SCG0->SOSCCSR = SCG_SOSCCSR_SOSCERR_MASK; - - /* Select SOSC source (external reference clock)*/ - SCG0->SOSCCFG &= ~SCG_SOSCCFG_EREFS_MASK; - - /* Unlock SOSCCSR */ - SCG0->SOSCCSR &= ~SCG_SOSCCSR_LK_MASK; - - /* Enable SOSC clock monitor and Enable SOSC */ - SCG0->SOSCCSR |= (SCG_SOSCCSR_SOSCCM_MASK | SCG_SOSCCSR_SOSCEN_MASK); - - /* Wait for SOSC clock to be valid. */ - while ((SCG0->SOSCCSR & SCG_SOSCCSR_SOSCVLD_MASK) == 0U) - { - } - - s_Ext_Clk_Freq = iFreq; - - return kStatus_Success; -} - -/* Get IP Clk */ -/*! brief Return Frequency of selected clock - * return Frequency of selected clock - */ -uint32_t CLOCK_GetFreq(clock_name_t clockName) -{ - uint32_t freq = 0U; - - switch (clockName) - { - case kCLOCK_MainClk: /* MAIN_CLK */ - freq = CLOCK_GetMainClk(); - break; - case kCLOCK_CoreSysClk: /* Core/system clock(CPU_CLK) */ - freq = CLOCK_GetCoreSysClkFreq(); - break; - case kCLOCK_SYSTEM_CLK: /* AHB clock */ - freq = CLOCK_GetCoreSysClkFreq(); - break; - case kCLOCK_BusClk: /* Bus clock (AHB clock) */ - freq = CLOCK_GetCoreSysClkFreq(); - break; - case kCLOCK_ExtClk: /* External Clock */ - freq = CLOCK_GetExtClkFreq(); - break; - case kCLOCK_FroHf: /* FROHF */ - freq = CLOCK_GetFroHfFreq(); - break; - case kCLOCK_FroHfDiv: /* Divided by FROHF */ - freq = CLOCK_GetFroHfFreq() / ((MRCC0->MRCC_FRO_HF_DIV_CLKDIV & 0xfU) + 1U); - break; - case kCLOCK_Clk48M: /* CLK48M */ - freq = CLOCK_GetClk48MFreq(); - break; - case kCLOCK_Fro12M: /* FRO12M */ - freq = CLOCK_GetFro12MFreq(); - break; - case kCLOCK_Clk1M: /* CLK1M */ - freq = CLOCK_GetClk1MFreq(); - break; - case kCLOCK_Fro16K: /* FRO16K */ - freq = CLOCK_GetFRO16KFreq(); - break; - case kCLOCK_Clk16K0: /* CLK16K[0] */ - freq = CLOCK_GetClk16KFreq(0); - break; - case kCLOCK_Clk16K1: /* CLK16K[1] */ - freq = CLOCK_GetClk16KFreq(1); - break; - case kCLOCK_SLOW_CLK: /* SYSTEM_CLK divided by 4 */ - freq = CLOCK_GetCoreSysClkFreq() >> 2; - break; - default: - freq = 0U; - break; - } - return freq; -} - -/* Get FRO 12M Clk */ -/*! brief Return Frequency of FRO 12MHz - * return Frequency of FRO 12MHz - */ -static uint32_t CLOCK_GetFro12MFreq(void) -{ - return ((SCG0->SIRCCSR & SCG_SIRCCSR_SIRC_CLK_PERIPH_EN_MASK) != 0U) ? 12000000U : 0U; -} - -/* Get CLK 1M Clk */ -/*! brief Return Frequency of CLK 1MHz - * return Frequency of CLK 1MHz - */ -static uint32_t CLOCK_GetClk1MFreq(void) -{ - return 1000000U; -} - -/* Get HF FRO Clk */ -/*! brief Return Frequency of High-Freq output of FRO - * return Frequency of High-Freq output of FRO - */ -static uint32_t CLOCK_GetFroHfFreq(void) -{ - uint32_t freq; - - if (((SCG0->FIRCCSR & SCG_FIRCCSR_FIRCEN_MASK) == 0U) || - ((SCG0->FIRCCSR & SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN_SHIFT) == 0U)) - { - freq = 0U; - } - - switch ((SCG0->FIRCCFG & SCG_FIRCCFG_FREQ_SEL_MASK) >> SCG_FIRCCFG_FREQ_SEL_SHIFT) - { - case 0U: - freq = 36000000U; - break; - case 1U: - freq = 48000000U; - break; - case 2U: - freq = 48000000U; - break; - case 3U: - freq = 64000000U; - break; - case 4U: - freq = 72000000U; - break; - case 5U: - freq = 96000000U; - break; - case 6U: - freq = 144000000U; - break; - case 7U: - freq = 192000000U; - break; - default: - freq = 0U; - break; - } - - return freq; -} - -/* Get CLK 48M Clk */ -/*! brief Return Frequency of CLK 48MHz - * return Frequency of CLK 48MHz - */ -static uint32_t CLOCK_GetClk48MFreq(void) -{ - return (((SCG0->FIRCCSR & SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_MASK) != 0U) || - ((SCG0->FIRCCSR & SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_SHIFT) == 0U)) ? - 48000000U : - 0U; -} - -/*! brief Return Frequency of FRO16K - * return Frequency of FRO_16K - */ -static uint32_t CLOCK_GetFRO16KFreq(void) -{ - return ((VBAT0->FROCTLA & VBAT_FROCTLA_FRO_EN_MASK) != 0U) ? 16000U : 0U; -} -/* Get CLK 16K Clk */ -/*! brief Return Frequency of CLK 16KHz - * return Frequency of CLK 16KHz - */ -static uint32_t CLOCK_GetClk16KFreq(uint8_t id) -{ - return (((VBAT0->FROCTLA & VBAT_FROCTLA_FRO_EN_MASK) != 0U) && - ((VBAT0->FROCLKE & VBAT_FROCLKE_CLKE((((uint32_t)id) << 1U))) != 0U)) ? - 16000U : - 0U; -} - -/* Get EXT OSC Clk */ -/*! brief Return Frequency of External Clock - * return Frequency of External Clock. If no external clock is used returns 0. - */ -static uint32_t CLOCK_GetExtClkFreq(void) -{ - return ((SCG0->SOSCCSR & SCG_SOSCCSR_SOSCVLD_MASK) != 0U) ? s_Ext_Clk_Freq : 0U; -} - -/* Get MAIN Clk */ -/*! brief Return Frequency of Core System - * return Frequency of Core System - */ -uint32_t CLOCK_GetMainClk(void) -{ - uint32_t freq = 0U; - - switch ((SCG0->CSR & SCG_CSR_SCS_MASK) >> SCG_CSR_SCS_SHIFT) - { - case 1U: - freq = CLOCK_GetExtClkFreq(); - break; - case 2U: - freq = CLOCK_GetFro12MFreq(); - break; - case 3U: - freq = CLOCK_GetFroHfFreq(); - break; - case 4U: - freq = CLOCK_GetClk16KFreq(1); - break; - default: - freq = 0U; - break; - } - - return freq; -} - -/*! brief Return Frequency of core - * return Frequency of the core - */ -uint32_t CLOCK_GetCoreSysClkFreq(void) -{ - return CLOCK_GetMainClk() / ((SYSCON->AHBCLKDIV & 0xFFU) + 1U); -} - -/* Get I3C Clk */ -/*! brief Return Frequency of I3C Clock - * return Frequency of I3C Clock - */ -uint32_t CLOCK_GetI3CFClkFreq(void) -{ - uint32_t freq = 0U; - uint32_t clksel = (MRCC0->MRCC_I3C0_FCLK_CLKSEL); - uint32_t clkdiv = (MRCC0->MRCC_I3C0_FCLK_CLKDIV); - - if (true == CLOCK_IsDivHalt(clkdiv)) - { - return 0; - } - - switch (clksel) - { - case 0U: - freq = CLOCK_GetFro12MFreq(); - break; - case 2U: - freq = CLOCK_GetFroHfFreq() / ((MRCC0->MRCC_FRO_HF_DIV_CLKDIV & 0xfU) + 1U); - break; - case 3U: - freq = CLOCK_GetExtClkFreq(); - break; - case 5U: - freq = CLOCK_GetClk1MFreq(); - break; - default: - freq = 0U; - break; - } - - return freq / ((clkdiv & 0xFFU) + 1U); -} - -/* Get CTimer Clk */ -/*! brief Return Frequency of CTimer functional Clock - * return Frequency of CTimer functional Clock - */ -uint32_t CLOCK_GetCTimerClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - uint32_t clksel = (0U == id) ? (MRCC0->MRCC_CTIMER0_CLKSEL) : - (((1U == id)) ? (MRCC0->MRCC_CTIMER1_CLKSEL) : (MRCC0->MRCC_CTIMER2_CLKSEL)); - uint32_t clkdiv = (0U == id) ? (MRCC0->MRCC_CTIMER0_CLKDIV) : - (((1U == id)) ? (MRCC0->MRCC_CTIMER1_CLKDIV) : (MRCC0->MRCC_CTIMER2_CLKDIV)); - - if (true == CLOCK_IsDivHalt(clkdiv)) - { - return 0; - } - - switch (clksel) - { - case 0U: - freq = CLOCK_GetFro12MFreq(); - break; - case 1U: - freq = CLOCK_GetFroHfFreq(); - break; - case 3U: - freq = CLOCK_GetExtClkFreq(); - break; - case 4U: - freq = CLOCK_GetClk16KFreq(1); - break; - case 5U: - freq = CLOCK_GetClk1MFreq(); - break; - default: - freq = 0U; - break; - } - - return freq / ((clkdiv & 0xFFU) + 1U); -} - -/* Get LPI2C Clk */ -/*! brief Return Frequency of LPI2C functional Clock - * return Frequency of LPI2C functional Clock - */ -uint32_t CLOCK_GetLpi2cClkFreq(void) -{ - uint32_t freq = 0U; - uint32_t clksel = (MRCC0->MRCC_LPI2C0_CLKSEL); - uint32_t clkdiv = (MRCC0->MRCC_LPI2C0_CLKDIV); - - if (true == CLOCK_IsDivHalt(clkdiv)) - { - return 0; - } - - switch (clksel) - { - case 0U: - freq = CLOCK_GetFro12MFreq(); - break; - case 2U: - freq = CLOCK_GetFroHfFreq() / ((MRCC0->MRCC_FRO_HF_DIV_CLKDIV & 0xfU) + 1U); - break; - case 3U: - freq = CLOCK_GetExtClkFreq(); - break; - case 5U: - freq = CLOCK_GetClk1MFreq(); - break; - default: - freq = 0U; - break; - } - - return freq / ((clkdiv & 0xFFU) + 1U); -} - -/*! brief Return Frequency of LPSPI functional Clock - * return Frequency of LPSPI functional Clock - */ -uint32_t CLOCK_GetLpspiClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - uint32_t clksel = (0U == id) ? (MRCC0->MRCC_LPSPI0_CLKSEL) : (MRCC0->MRCC_LPSPI1_CLKSEL); - uint32_t clkdiv = (0U == id) ? (MRCC0->MRCC_LPSPI0_CLKDIV) : (MRCC0->MRCC_LPSPI1_CLKDIV); - - if (true == CLOCK_IsDivHalt(clkdiv)) - { - return 0; - } - - switch (clksel) - { - case 0U: - freq = CLOCK_GetFro12MFreq(); - break; - case 2U: - freq = CLOCK_GetFroHfFreq() / ((MRCC0->MRCC_FRO_HF_DIV_CLKDIV & 0xfU) + 1U); - break; - case 3U: - freq = CLOCK_GetExtClkFreq(); - break; - case 5U: - freq = CLOCK_GetClk1MFreq(); - break; - default: - freq = 0U; - break; - } - - return freq / ((clkdiv & 0xFFU) + 1U); -} - -/*! brief Return Frequency of LPUART functional Clock - * return Frequency of LPUART functional Clock - */ -uint32_t CLOCK_GetLpuartClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - uint32_t clksel = (0U == id) ? (MRCC0->MRCC_LPUART0_CLKSEL) : - (((1U == id)) ? (MRCC0->MRCC_LPUART1_CLKSEL) : (MRCC0->MRCC_LPUART2_CLKSEL)); - uint32_t clkdiv = (0U == id) ? (MRCC0->MRCC_LPUART0_CLKDIV) : - (((1U == id)) ? (MRCC0->MRCC_LPUART1_CLKDIV) : (MRCC0->MRCC_LPUART2_CLKDIV)); - - if (true == CLOCK_IsDivHalt(clkdiv)) - { - return 0; - } - - switch (clksel) - { - case 0U: - freq = CLOCK_GetFro12MFreq(); - break; - case 2U: - freq = CLOCK_GetFroHfFreq() / ((MRCC0->MRCC_FRO_HF_DIV_CLKDIV & 0xfU) + 1U); - break; - case 3U: - freq = CLOCK_GetExtClkFreq(); - break; - case 4U: - freq = CLOCK_GetClk16KFreq(1); - break; - case 5U: - freq = CLOCK_GetClk1MFreq(); - break; - default: - freq = 0U; - break; - } - - return freq / ((clkdiv & 0xFFU) + 1U); -} - -/*! brief Return Frequency of LPTMR functional Clock - * return Frequency of LPTMR functional Clock - */ -uint32_t CLOCK_GetLptmrClkFreq(void) -{ - uint32_t freq = 0U; - uint32_t clksel = (MRCC0->MRCC_LPTMR0_CLKSEL); - uint32_t clkdiv = (MRCC0->MRCC_LPTMR0_CLKDIV); - - if (true == CLOCK_IsDivHalt(clkdiv)) - { - return 0; - } - - switch (clksel) - { - case 0U: - freq = CLOCK_GetFro12MFreq(); - break; - case 2U: - freq = CLOCK_GetFroHfFreq() / ((MRCC0->MRCC_FRO_HF_DIV_CLKDIV & 0xfU) + 1U); - break; - case 3U: - freq = CLOCK_GetExtClkFreq(); - break; - case 5U: - freq = CLOCK_GetClk1MFreq(); - break; - default: - freq = 0U; - break; - } - - return freq / ((clkdiv & 0xFFU) + 1U); -} - -/*! brief Return Frequency of OSTIMER - * return Frequency of OSTIMER Clock - */ -uint32_t CLOCK_GetOstimerClkFreq(void) -{ - uint32_t freq = 0U; - uint32_t clksel = (MRCC0->MRCC_OSTIMER0_CLKSEL); - - switch (clksel) - { - case 0U: - freq = CLOCK_GetClk16KFreq(1); - break; - case 2U: - freq = CLOCK_GetClk1MFreq(); - break; - default: - freq = 0U; - break; - } - - return freq; -} - -/*! brief Return Frequency of Adc Clock - * return Frequency of Adc. - */ -uint32_t CLOCK_GetAdcClkFreq(void) -{ - uint32_t freq = 0U; - uint32_t clksel = (MRCC0->MRCC_ADC0_CLKSEL); - uint32_t clkdiv = (MRCC0->MRCC_ADC0_CLKDIV); - - if (true == CLOCK_IsDivHalt(clkdiv)) - { - return 0; - } - - switch (clksel) - { - case 0U: - freq = CLOCK_GetFro12MFreq(); - break; - case 1U: - freq = CLOCK_GetFroHfFreq(); - break; - case 3U: - freq = CLOCK_GetExtClkFreq(); - break; - case 5U: - freq = CLOCK_GetClk1MFreq(); - break; - default: - freq = 0U; - break; - } - - return freq / ((clkdiv & 0xFFU) + 1U); -} - -/*! brief Return Frequency of CMP Function Clock - * return Frequency of CMP Function. - */ -uint32_t CLOCK_GetCmpFClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - uint32_t clksel = (0U == id) ? (MRCC0->MRCC_CMP0_RR_CLKSEL) : (MRCC0->MRCC_CMP1_RR_CLKSEL); - uint32_t clkdiv = (0U == id) ? (MRCC0->MRCC_CMP0_FUNC_CLKDIV) : (MRCC0->MRCC_CMP1_FUNC_CLKDIV); - - if (true == CLOCK_IsDivHalt(clkdiv)) - { - return 0; - } - - switch (clksel) - { - case 0U: - freq = CLOCK_GetFro12MFreq(); - break; - case 2U: - freq = CLOCK_GetFroHfFreq() / ((MRCC0->MRCC_FRO_HF_DIV_CLKDIV & 0xfU) + 1U); - break; - case 3U: - freq = CLOCK_GetExtClkFreq(); - break; - case 5U: - freq = CLOCK_GetClk1MFreq(); - break; - default: - freq = 0U; - break; - } - - return freq / ((clkdiv & 0xFFU) + 1U); -} - -/*! brief Return Frequency of CMP Round Robin Clock - * return Frequency of CMP Round Robin. - */ -uint32_t CLOCK_GetCmpRRClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - uint32_t clksel = (0U == id) ? (MRCC0->MRCC_CMP0_RR_CLKSEL) : (MRCC0->MRCC_CMP1_RR_CLKSEL); - uint32_t clkdiv = (0U == id) ? (MRCC0->MRCC_CMP0_RR_CLKDIV) : (MRCC0->MRCC_CMP1_RR_CLKDIV); - - if (true == CLOCK_IsDivHalt(clkdiv)) - { - return 0; - } - - switch (clksel) - { - case 0U: - freq = CLOCK_GetFro12MFreq(); - break; - case 2U: - freq = CLOCK_GetFroHfFreq() / ((MRCC0->MRCC_FRO_HF_DIV_CLKDIV & 0xfU) + 1U); - break; - case 3U: - freq = CLOCK_GetExtClkFreq(); - break; - case 5U: - freq = CLOCK_GetClk1MFreq(); - break; - default: - freq = 0U; - break; - } - - return freq / ((clkdiv & 0xFFU) + 1U); -} - -/*! brief Return Frequency of Trace Clock - * return Frequency of Trace. - */ -uint32_t CLOCK_GetTraceClkFreq(void) -{ - uint32_t freq = 0U; - uint32_t clksel = (MRCC0->MRCC_DBG_TRACE_CLKSEL); - uint32_t clkdiv = (MRCC0->MRCC_DBG_TRACE_CLKDIV); - - if (true == CLOCK_IsDivHalt(clkdiv)) - { - return 0; - } - - switch (clksel) - { - case 0U: - freq = CLOCK_GetCoreSysClkFreq(); - break; - case 1U: - freq = CLOCK_GetClk1MFreq(); - break; - case 2U: - freq = CLOCK_GetClk16KFreq(1); - break; - default: - freq = 0U; - break; - } - - return freq / ((clkdiv & 0xFFU) + 1U); -} - -/*! brief Return Frequency of CLKOUT Clock - * return Frequency of CLKOUT. - */ -uint32_t CLOCK_GetClkoutClkFreq(void) -{ - uint32_t freq = 0U; - uint32_t clksel = (MRCC0->MRCC_CLKOUT_CLKSEL); - uint32_t clkdiv = (MRCC0->MRCC_CLKOUT_CLKDIV); - - if (true == CLOCK_IsDivHalt(clkdiv)) - { - return 0; - } - - switch (clksel) - { - case 0U: - freq = CLOCK_GetFro12MFreq(); - break; - case 1U: - freq = CLOCK_GetFroHfFreq() / ((MRCC0->MRCC_FRO_HF_DIV_CLKDIV & 0xfU) + 1U); - break; - case 2U: - freq = CLOCK_GetExtClkFreq(); - break; - case 3U: - freq = CLOCK_GetClk16KFreq(1); - break; - case 6U: - freq = CLOCK_GetCoreSysClkFreq() >> 2; - break; - default: - freq = 0U; - break; - } - - return freq / ((clkdiv & 0xFFU) + 1U); -} - -/*! brief Return Frequency of Systick Clock - * return Frequency of Systick. - */ -uint32_t CLOCK_GetSystickClkFreq(void) -{ - uint32_t freq = 0U; - uint32_t clksel = (MRCC0->MRCC_SYSTICK_CLKSEL); - uint32_t clkdiv = (MRCC0->MRCC_SYSTICK_CLKDIV); - - if (true == CLOCK_IsDivHalt(clkdiv)) - { - return 0; - } - - switch (clksel) - { - case 0U: - freq = CLOCK_GetCoreSysClkFreq(); - break; - case 1U: - freq = CLOCK_GetClk1MFreq(); - break; - case 2U: - freq = CLOCK_GetClk16KFreq(1); - break; - default: - freq = 0U; - break; - } - - return freq / ((clkdiv & 0xFFU) + 1U); -} - -/*! brief Return Frequency of Systick Clock - * return Frequency of Systick. - */ -uint32_t CLOCK_GetWwdtClkFreq(void) -{ - uint32_t freq = 0U; - uint32_t clkdiv = (MRCC0->MRCC_WWDT0_CLKDIV); - - if (true == CLOCK_IsDivHalt(clkdiv)) - { - return 0; - } - - freq = CLOCK_GetClk1MFreq(); - - return freq / ((clkdiv & 0xFFU) + 1U); -} - -/** - * @brief Setup FROHF trim. - * @param config : FROHF trim value - * @return returns success or fail status. - */ -status_t CLOCK_FROHFTrimConfig(firc_trim_config_t config) -{ - SCG0->FIRCTCFG = SCG_FIRCTCFG_TRIMDIV(config.trimDiv) | SCG_FIRCTCFG_TRIMSRC(config.trimSrc); - - if (kSCG_FircTrimNonUpdate == config.trimMode) - { - SCG0->FIRCSTAT = SCG_FIRCSTAT_TRIMFINE(config.trimFine); - } - - /* Set trim mode. */ - SCG0->FIRCCSR = (uint32_t)config.trimMode; - - if ((SCG0->FIRCCSR & SCG_FIRCCSR_FIRCERR_MASK) == SCG_FIRCCSR_FIRCERR_MASK) - { - return (status_t)kStatus_Fail; - } - - return (status_t)kStatus_Success; -} - -/** - * @brief Setup FRO 12M trim. - * @param config : FRO 12M trim value - * @return returns success or fail status. - */ -status_t CLOCK_FRO12MTrimConfig(sirc_trim_config_t config) -{ - SCG0->SIRCTCFG = SCG_SIRCTCFG_TRIMDIV(config.trimDiv) | SCG_SIRCTCFG_TRIMSRC(config.trimSrc); - - if (kSCG_SircTrimNonUpdate == config.trimMode) - { - SCG0->SIRCSTAT = SCG_SIRCSTAT_CCOTRIM(config.cltrim); - SCG0->SIRCSTAT = SCG_SIRCSTAT_CCOTRIM(config.ccotrim); - } - - /* Set trim mode. */ - SCG0->SIRCCSR = (uint32_t)config.trimMode; - - if ((SCG0->SIRCCSR & SCG_SIRCCSR_SIRCERR_MASK) == SCG_SIRCCSR_SIRCERR_MASK) - { - return (status_t)kStatus_Fail; - } - - return (status_t)kStatus_Success; -} - -/*! - * @brief Sets the system OSC monitor mode. - * - * This function sets the system OSC monitor mode. The mode can be disabled, - * it can generate an interrupt when the error is disabled, or reset when the error is detected. - * - * @param mode Monitor mode to set. - */ -void CLOCK_SetSysOscMonitorMode(scg_sosc_monitor_mode_t mode) -{ - uint32_t reg = SCG0->SOSCCSR; - - reg &= ~(SCG_SOSCCSR_SOSCCM_MASK | SCG_SOSCCSR_SOSCCMRE_MASK); - - reg |= (uint32_t)mode; - - SCG0->SOSCCSR = reg; -} - -/*! brief Enable USB FS clock. - * Enable USB Full Speed clock. - */ -bool CLOCK_EnableUsbfsClock(void) -{ - /* Enable USB clock */ - CLOCK_EnableClock(kCLOCK_GateUSB0); - - /* Enable FROHF with 48MHZ if it is disabled */ - if (0U == (SCG0->FIRCCSR & SCG_FIRCCSR_FIRCEN_MASK)) - { - if (kStatus_Success != CLOCK_SetupFROHFClocking(48000000U)) - { - return false; - } - } - - /* Enable CLK_48 MHz clock for peripheral use */ - SCG0->FIRCCSR |= SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_MASK; - - /* Use clk_48M for USB FS */ - CLOCK_AttachClk(kCLK_48M_to_USB0); - - return true; -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_clock.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_clock.h deleted file mode 100644 index 5216cddca42..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_clock.h +++ /dev/null @@ -1,821 +0,0 @@ -/* - * Copyright 2023, NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _FSL_CLOCK_H_ -#define _FSL_CLOCK_H_ - -#include "fsl_common.h" - -/*! @addtogroup clock */ -/*! @{ */ - -/*! @file */ - -/******************************************************************************* - * Definitions - *****************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief CLOCK driver version 1.0.0. */ -#define FSL_CLOCK_DRIVER_VERSION (MAKE_VERSION(1, 0, 0)) -/*@}*/ - -/*! @brief Configure whether driver controls clock - * - * When set to 0, peripheral drivers will enable clock in initialize function - * and disable clock in de-initialize function. When set to 1, peripheral - * driver will not control the clock, application could control the clock out of - * the driver. - * - * @note All drivers share this feature switcher. If it is set to 1, application - * should handle clock enable and disable for all drivers. - */ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)) -#define FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL 0U -#endif - -/* Definition for delay API in clock driver, users can redefine it to the real application. */ -#ifndef SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY -#define SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY (96000000U) -#endif - -/*! @brief Clock gate name used for CLOCK_EnableClock/CLOCK_DisableClock. */ -/*------------------------------------------------------------------------------ - clock_ip_name_t definition: -------------------------------------------------------------------------------*/ -#define CLK_GATE_REG_OFFSET(value) (((uint32_t)(value)) >> 16U) -#define CLK_GATE_BIT_SHIFT(value) (((uint32_t)(value)) & 0x0000FFFFU) - -#define REG_PWM0SUBCTL (250U) - -/*! @brief Clock gate name used for CLOCK_EnableClock/CLOCK_DisableClock. */ -typedef enum _clock_ip_name -{ - kCLOCK_GateINPUTMUX0 = (0x00000U | (0U)), /*!< Clock gate name: INPUTMUX0 */ - kCLOCK_InputMux = (0x00000U | (0U)), /*!< Clock gate name: INPUTMUX0 */ - kCLOCK_GateI3C0 = (0x00000U | (1U)), /*!< Clock gate name: I3C0 */ - kCLOCK_GateCTIMER0 = (0x00000U | (2U)), /*!< Clock gate name: CTIMER0 */ - kCLOCK_GateCTIMER1 = (0x00000U | (3U)), /*!< Clock gate name: CTIMER1 */ - kCLOCK_GateCTIMER2 = (0x00000U | (4U)), /*!< Clock gate name: CTIMER2 */ - kCLOCK_GateFREQME = (0x00000U | (5U)), /*!< Clock gate name: FREQME */ - kCLOCK_GateUTICK0 = (0x00000U | (6U)), /*!< Clock gate name: UTICK0 */ - kCLOCK_GateWWDT0 = (0x00000U | (7U)), /*!< Clock gate name: WWDT0 */ - kCLOCK_GateDMA = (0x00000U | (8U)), /*!< Clock gate name: DMA */ - kCLOCK_GateAOI0 = (0x00000U | (9U)), /*!< Clock gate name: AOI0 */ - kCLOCK_GateCRC = (0x00000U | (10U)), /*!< Clock gate name: CRC */ - kCLOCK_Crc0 = (0x00000U | (10U)), /*!< Clock gate name: CRC */ - kCLOCK_GateEIM = (0x00000U | (11U)), /*!< Clock gate name: EIM */ - kCLOCK_GateERM = (0x00000U | (12U)), /*!< Clock gate name: ERM */ - kCLOCK_GateLPI2C0 = (0x00000U | (16U)), /*!< Clock gate name: LPI2C0 */ - kCLOCK_GateLPSPI0 = (0x00000U | (17U)), /*!< Clock gate name: LPSPI0 */ - kCLOCK_GateLPSPI1 = (0x00000U | (18U)), /*!< Clock gate name: LPSPI1 */ - kCLOCK_GateLPUART0 = (0x00000U | (19U)), /*!< Clock gate name: LPUART0 */ - kCLOCK_GateLPUART1 = (0x00000U | (20U)), /*!< Clock gate name: LPUART1 */ - kCLOCK_GateLPUART2 = (0x00000U | (21U)), /*!< Clock gate name: LPUART2 */ - kCLOCK_GateUSB0 = (0x00000U | (22U)), /*!< Clock gate name: USB0 */ - kCLOCK_GateQDC0 = (0x00000U | (23U)), /*!< Clock gate name: QDC0 */ - kCLOCK_GateFLEXPWM0 = (0x00000U | (24U)), /*!< Clock gate name: FLEXPWM0 */ - kCLOCK_GateOSTIMER0 = (0x00000U | (25U)), /*!< Clock gate name: OSTIMER0 */ - kCLOCK_GateADC0 = (0x00000U | (26U)), /*!< Clock gate name: ADC0 */ - kCLOCK_GateCMP0 = (0x00000U | (27U)), /*!< Clock gate name: CMP0 */ - kCLOCK_GateCMP1 = (0x00000U | (28U)), /*!< Clock gate name: CMP1 */ - kCLOCK_GatePORT0 = (0x00000U | (29U)), /*!< Clock gate name: PORT0 */ - kCLOCK_GatePORT1 = (0x00000U | (30U)), /*!< Clock gate name: PORT1 */ - kCLOCK_GatePORT2 = (0x00000U | (31U)), /*!< Clock gate name: PORT2 */ - kCLOCK_GatePORT3 = ((0x10U << 16U) | (0U)), /*!< Clock gate name: PORT3 */ - kCLOCK_GateATX0 = ((0x10U << 16U) | (1U)), /*!< Clock gate name: ATX0 */ - kCLOCK_GateMTR = ((0x10U << 16U) | (2U)), /*!< Clock gate name: MTR */ - kCLOCK_GateTCU = ((0x10U << 16U) | (3U)), /*!< Clock gate name: TCU */ - kCLOCK_GateEZRAMC_RAMA = ((0x10U << 16U) | (4U)), /*!< Clock gate name: EZRAMC_RAMA */ - kCLOCK_GateGPIO0 = ((0x10U << 16U) | (5U)), /*!< Clock gate name: GPIO0 */ - kCLOCK_GateGPIO1 = ((0x10U << 16U) | (6U)), /*!< Clock gate name: GPIO1 */ - kCLOCK_GateGPIO2 = ((0x10U << 16U) | (7U)), /*!< Clock gate name: GPIO2 */ - kCLOCK_GateGPIO3 = ((0x10U << 16U) | (8U)), /*!< Clock gate name: GPIO3 */ - kCLOCK_GateROMCP = ((0x10U << 16U) | (9U)), /*!< Clock gate name: ROMCP */ - kCLOCK_GatePWMSM0 = ((REG_PWM0SUBCTL << 16U) | (0U)), /*!< Clock gate name: FlexPWM SM0 */ - kCLOCK_GatePWMSM1 = ((REG_PWM0SUBCTL << 16U) | (1U)), /*!< Clock gate name: FlexPWM SM1 */ - kCLOCK_GatePWMSM2 = ((REG_PWM0SUBCTL << 16U) | (2U)), /*!< Clock gate name: FlexPWM SM2 */ - kCLOCK_GateNotAvail = (0xFFFFFFFFU), /**< Clock gate name: None */ -} clock_ip_name_t; - -/*! @brief Clock ip name array for AOI. */ -#define AOI_CLOCKS \ - { \ - kCLOCK_GateAOI0 \ - } -/*! @brief Clock ip name array for CRC. */ -#define CRC_CLOCKS \ - { \ - kCLOCK_GateCRC \ - } -/*! @brief Clock ip name array for CTIMER. */ -#define CTIMER_CLOCKS \ - { \ - kCLOCK_GateCTIMER0, kCLOCK_GateCTIMER1, kCLOCK_GateCTIMER2 \ - } -/*! @brief Clock ip name array for DMA. */ -#define DMA_CLOCKS \ - { \ - kCLOCK_GateDMA \ - } -/*! @brief Clock gate name array for EDMA. */ -#define EDMA_CLOCKS \ - { \ - kCLOCK_GateDMA \ - } -/*! @brief Clock ip name array for ERM. */ -#define ERM_CLOCKS \ - { \ - kCLOCK_GateERM \ - } -/*! @brief Clock ip name array for EIM. */ -#define EIM_CLOCKS \ - { \ - kCLOCK_GateEIM \ - } -/*! @brief Clock ip name array for FREQME. */ -#define FREQME_CLOCKS \ - { \ - kCLOCK_GateFREQME \ - } -/*! @brief Clock ip name array for GPIO. */ -#define GPIO_CLOCKS \ - { \ - kCLOCK_GateGPIO0, kCLOCK_GateGPIO1, kCLOCK_GateGPIO2, kCLOCK_GateGPIO3 \ - } -/*! @brief Clock ip name array for I3C */ -#define I3C_CLOCKS \ - { \ - kCLOCK_GateI3C0 \ - } -/*! @brief Clock ip name array for INPUTMUX. */ -#define INPUTMUX_CLOCKS \ - { \ - kCLOCK_GateINPUTMUX0 \ - } -/*! @brief Clock ip name array for GPIO. */ -#define LPCMP_CLOCKS \ - { \ - kCLOCK_GateCMP0, kCLOCK_GateCMP1 \ - } -/*! @brief Clock ip name array for LPADC. */ -#define LPADC_CLOCKS \ - { \ - kCLOCK_GateADC0 \ - } -/*! @brief Clock ip name array for LPUART. */ -#define LPUART_CLOCKS \ - { \ - kCLOCK_GateLPUART0, kCLOCK_GateLPUART1, kCLOCK_GateLPUART2 \ - } -/*! @brief Clock ip name array for LPI2C. */ -#define LPI2C_CLOCKS \ - { \ - kCLOCK_GateLPI2C0 \ - } -/*! @brief Clock ip name array for LSPI. */ -#define LPSPI_CLOCKS \ - { \ - kCLOCK_GateLPSPI0, kCLOCK_GateLPSPI1 \ - } -/*! @brief Clock ip name array for MTR. */ -#define MTR_CLOCKS \ - { \ - kCLOCK_GateMTR \ - } -/*! @brief Clock ip name array for OSTIMER. */ -#define OSTIMER_CLOCKS \ - { \ - kCLOCK_GateOSTIMER0 \ - } - -/*! @brief Clock ip name array for PWM. */ -#define PWM_CLOCKS \ - { \ - { \ - kCLOCK_GatePWMSM0, kCLOCK_GatePWMSM1, kCLOCK_GatePWMSM2 \ - } \ - } -/*! @brief Clock ip name array for QDC. */ -#define QDC_CLOCKS \ - { \ - kCLOCK_GateQDC0 \ - } -/*! @brief Clock ip name array for UTICK. */ -#define UTICK_CLOCKS \ - { \ - kCLOCK_GateUTICK0 \ - } -/*! @brief Clock ip name array for WWDT. */ -#define WWDT_CLOCKS \ - { \ - kCLOCK_GateWWDT0 \ - } - -/*! @brief Peripherals clock source definition. */ -#define BUS_CLK kCLOCK_BusClk - -/*! @brief Clock name used to get clock frequency. */ -typedef enum _clock_name -{ - kCLOCK_MainClk, /*!< MAIN_CLK */ - kCLOCK_CoreSysClk, /*!< Core/system clock(CPU_CLK) */ - kCLOCK_SYSTEM_CLK, /*!< AHB clock */ - kCLOCK_BusClk, /*!< Bus clock (AHB clock) */ - kCLOCK_ExtClk, /*!< External Clock */ - kCLOCK_FroHf, /*!< FRO192 */ - kCLOCK_FroHfDiv, /*!< Divided by FRO192 */ - kCLOCK_Clk48M, /*!< CLK48M */ - kCLOCK_Fro12M, /*!< FRO12M */ - kCLOCK_Clk1M, /*!< CLK1M */ - kCLOCK_Fro16K, /*!< FRO16K */ - kCLOCK_Clk16K0, /*!< CLK16K[0] */ - kCLOCK_Clk16K1, /*!< CLK16K[1] */ - kCLOCK_SLOW_CLK, /*!< SYSTEM_CLK divided by 4 */ -} clock_name_t; - -/*! @brief Clock Mux Switches - * The encoding is as follows each connection identified is 32bits wide while 24bits are valuable - * starting from LSB upwards - * - * [4 bits for choice, 0 means invalid choice] [8 bits mux ID]* - * - */ - -#define CLK_ATTACH_REG_OFFSET(value) (((uint32_t)(value)) >> 16U) -#define CLK_ATTACH_CLK_SEL(value) (((uint32_t)(value)) & 0x0000FFFFU) -#define CLK_ATTACH_MUX(reg, sel) ((((uint32_t)(reg)) << 16U) | (sel)) - -/*! @brief Clock name used to get clock frequency. */ -typedef enum _clock_select_name -{ - kCLOCK_SelI3C0_FCLK = (0x0A0U), /*!< I3C0_FCLK clock selection */ - kCLOCK_SelCTIMER0 = (0x0A8U), /*!< CTIMER0 clock selection */ - kCLOCK_SelCTIMER1 = (0x0B0U), /*!< CTIMER1 clock selection */ - kCLOCK_SelCTIMER2 = (0x0B8U), /*!< CTIMER2 clock selection */ - kCLOCK_SelLPI2C0 = (0x0C8U), /*!< LPI2C0 clock selection */ - kCLOCK_SelLPSPI0 = (0x0D0U), /*!< LPSPI0 clock selection */ - kCLOCK_SelLPSPI1 = (0x0D8U), /*!< LPSPI1 clock selection */ - kCLOCK_SelLPUART0 = (0x0E0U), /*!< LPUART0 clock selection */ - kCLOCK_SelLPUART1 = (0x0E8U), /*!< LPUART1 clock selection */ - kCLOCK_SelLPUART2 = (0x0F0U), /*!< LPUART2 clock selection */ - kCLOCK_SelUSB0 = (0x0F8U), /*!< USB0 clock selection */ - kCLOCK_SelLPTMR0 = (0x100U), /*!< LPTMR0 clock selection */ - kCLOCK_SelOSTIMER0 = (0x108U), /*!< OSTIMER0 clock selection */ - kCLOCK_SelADC0 = (0x110U), /*!< ADC0 clock selection */ - kCLOCK_SelCMP0_RR = (0x120U), /*!< CMP0_RR clock selection */ - kCLOCK_SelCMP1_RR = (0x130U), /*!< CMP1_RR clock selection */ - kCLOCK_SelTRACE = (0x138U), /*!< TRACE clock selection */ - kCLOCK_SelCLKOUT = (0x140U), /*!< CLKOUT clock selection */ - kCLOCK_SelSYSTICK = (0x148U), /*!< SYSTICK clock selection */ - kCLOCK_SelSCGSCS = (0x200U), /*!< SCG SCS clock selection */ - kCLOCK_SelMax = (0x200U), /*!< MAX clock selection */ -} clock_select_name_t; - -/*! - * @brief The enumerator of clock attach Id. - */ -typedef enum _clock_attach_id -{ - kCLK_IN_to_MAIN_CLK = CLK_ATTACH_MUX(kCLOCK_SelSCGSCS, 1U), /*!< Attach clk_in to MAIN_CLK. */ - kFRO12M_to_MAIN_CLK = CLK_ATTACH_MUX(kCLOCK_SelSCGSCS, 2U), /*!< Attach FRO_12M to MAIN_CLK. */ - kFRO_HF_to_MAIN_CLK = CLK_ATTACH_MUX(kCLOCK_SelSCGSCS, 3U), /*!< Attach FRO_HF to MAIN_CLK. */ - kCLK_16K_to_MAIN_CLK = CLK_ATTACH_MUX(kCLOCK_SelSCGSCS, 4U), /*!< Attach CLK_16K[1] to MAIN_CLK. */ - kNONE_to_MAIN_CLK = CLK_ATTACH_MUX(kCLOCK_SelSCGSCS, 7U), /*!< Attach NONE to MAIN_CLK. */ - - kFRO12M_to_I3C0FCLK = CLK_ATTACH_MUX(kCLOCK_SelI3C0_FCLK, 0U), /*!< Attach FRO12M to I3C0FCLK. */ - kFRO_HF_DIV_to_I3C0FCLK = CLK_ATTACH_MUX(kCLOCK_SelI3C0_FCLK, 2U), /*!< Attach FRO_HF_DIV to I3C0FCLK. */ - kCLK_IN_to_I3C0FCLK = CLK_ATTACH_MUX(kCLOCK_SelI3C0_FCLK, 3U), /*!< Attach CLK_IN to I3C0FCLK. */ - kCLK_1M_to_I3C0FCLK = CLK_ATTACH_MUX(kCLOCK_SelI3C0_FCLK, 5U), /*!< Attach CLK_1M to I3C0FCLK. */ - kNONE_to_I3C0FCLK = CLK_ATTACH_MUX(kCLOCK_SelI3C0_FCLK, 7U), /*!< Attach NONE to I3C0FCLK. */ - - kFRO12M_to_CTIMER0 = CLK_ATTACH_MUX(kCLOCK_SelCTIMER0, 0U), /*!< Attach FRO12M to CTIMER0. */ - kFRO_HF_to_CTIMER0 = CLK_ATTACH_MUX(kCLOCK_SelCTIMER0, 1U), /*!< Attach FRO_HF to CTIMER0. */ - kCLK_IN_to_CTIMER0 = CLK_ATTACH_MUX(kCLOCK_SelCTIMER0, 3U), /*!< Attach CLK_IN to CTIMER0. */ - kCLK_16K_to_CTIMER0 = CLK_ATTACH_MUX(kCLOCK_SelCTIMER0, 4U), /*!< Attach CLK_16K to CTIMER0. */ - kCLK_1M_to_CTIMER0 = CLK_ATTACH_MUX(kCLOCK_SelCTIMER0, 5U), /*!< Attach CLK_1M to CTIMER0. */ - kNONE_to_CTIMER0 = CLK_ATTACH_MUX(kCLOCK_SelCTIMER0, 7U), /*!< Attach NONE to CTIMER0. */ - - kFRO12M_to_CTIMER1 = CLK_ATTACH_MUX(kCLOCK_SelCTIMER1, 0U), /*!< Attach FRO12M to CTIMER1. */ - kFRO_HF_to_CTIMER1 = CLK_ATTACH_MUX(kCLOCK_SelCTIMER1, 1U), /*!< Attach FRO_HF to CTIMER1. */ - kCLK_IN_to_CTIMER1 = CLK_ATTACH_MUX(kCLOCK_SelCTIMER1, 3U), /*!< Attach CLK_IN to CTIMER1. */ - kCLK_16K_to_CTIMER1 = CLK_ATTACH_MUX(kCLOCK_SelCTIMER1, 4U), /*!< Attach CLK_16K to CTIMER1. */ - kCLK_1M_to_CTIMER1 = CLK_ATTACH_MUX(kCLOCK_SelCTIMER1, 5U), /*!< Attach CLK_1M to CTIMER1. */ - kNONE_to_CTIMER1 = CLK_ATTACH_MUX(kCLOCK_SelCTIMER1, 7U), /*!< Attach NONE to CTIMER1. */ - - kFRO12M_to_CTIMER2 = CLK_ATTACH_MUX(kCLOCK_SelCTIMER2, 0U), /*!< Attach FRO12M to CTIMER2. */ - kFRO_HF_to_CTIMER2 = CLK_ATTACH_MUX(kCLOCK_SelCTIMER2, 1U), /*!< Attach FRO_HF to CTIMER2. */ - kCLK_IN_to_CTIMER2 = CLK_ATTACH_MUX(kCLOCK_SelCTIMER2, 3U), /*!< Attach CLK_IN to CTIMER2. */ - kCLK_16K_to_CTIMER2 = CLK_ATTACH_MUX(kCLOCK_SelCTIMER2, 4U), /*!< Attach CLK_16K to CTIMER2. */ - kCLK_1M_to_CTIMER2 = CLK_ATTACH_MUX(kCLOCK_SelCTIMER2, 5U), /*!< Attach CLK_1M to CTIMER2. */ - kNONE_to_CTIMER2 = CLK_ATTACH_MUX(kCLOCK_SelCTIMER2, 7U), /*!< Attach NONE to CTIMER2. */ - - kFRO12M_to_LPI2C0 = CLK_ATTACH_MUX(kCLOCK_SelLPI2C0, 0U), /*!< Attach FRO12M to LPI2C0. */ - kFRO_HF_DIV_to_LPI2C0 = CLK_ATTACH_MUX(kCLOCK_SelLPI2C0, 2U), /*!< Attach FRO_HF_DIV to LPI2C0. */ - kCLK_IN_to_LPI2C0 = CLK_ATTACH_MUX(kCLOCK_SelLPI2C0, 3U), /*!< Attach CLK_IN to LPI2C0. */ - kCLK_1M_to_LPI2C0 = CLK_ATTACH_MUX(kCLOCK_SelLPI2C0, 5U), /*!< Attach CLK_1M to LPI2C0. */ - kNONE_to_LPI2C0 = CLK_ATTACH_MUX(kCLOCK_SelLPI2C0, 7U), /*!< Attach NONE to LPI2C0. */ - - kFRO12M_to_LPSPI0 = CLK_ATTACH_MUX(kCLOCK_SelLPSPI0, 0U), /*!< Attach FRO12M to LPSPI0. */ - kFRO_HF_DIV_to_LPSPI0 = CLK_ATTACH_MUX(kCLOCK_SelLPSPI0, 2U), /*!< Attach FRO_HF_DIV to LPSPI0. */ - kCLK_IN_to_LPSPI0 = CLK_ATTACH_MUX(kCLOCK_SelLPSPI0, 3U), /*!< Attach CLK_IN to LPSPI0. */ - kCLK_1M_to_LPSPI0 = CLK_ATTACH_MUX(kCLOCK_SelLPSPI0, 5U), /*!< Attach CLK_1M to LPSPI0. */ - kNONE_to_LPSPI0 = CLK_ATTACH_MUX(kCLOCK_SelLPSPI0, 7U), /*!< Attach NONE to LPSPI0. */ - - kFRO12M_to_LPSPI1 = CLK_ATTACH_MUX(kCLOCK_SelLPSPI1, 0U), /*!< Attach FRO12M to LPSPI1. */ - kFRO_HF_DIV_to_LPSPI1 = CLK_ATTACH_MUX(kCLOCK_SelLPSPI1, 2U), /*!< Attach FRO_HF_DIV to LPSPI1. */ - kCLK_IN_to_LPSPI1 = CLK_ATTACH_MUX(kCLOCK_SelLPSPI1, 3U), /*!< Attach CLK_IN to LPSPI1. */ - kCLK_1M_to_LPSPI1 = CLK_ATTACH_MUX(kCLOCK_SelLPSPI1, 5U), /*!< Attach CLK_1M to LPSPI1. */ - kNONE_to_LPSPI1 = CLK_ATTACH_MUX(kCLOCK_SelLPSPI1, 7U), /*!< Attach NONE to LPSPI1. */ - - kFRO12M_to_LPUART0 = CLK_ATTACH_MUX(kCLOCK_SelLPUART0, 0U), /*!< Attach FRO12M to LPUART0. */ - kFRO_HF_DIV_to_LPUART0 = CLK_ATTACH_MUX(kCLOCK_SelLPUART0, 2U), /*!< Attach FRO_HF_DIV to LPUART0. */ - kCLK_IN_to_LPUART0 = CLK_ATTACH_MUX(kCLOCK_SelLPUART0, 3U), /*!< Attach CLK_IN to LPUART0. */ - kCLK_16K_to_LPUART0 = CLK_ATTACH_MUX(kCLOCK_SelLPUART0, 4U), /*!< Attach CLK_16K to LPUART0. */ - kCLK_1M_to_LPUART0 = CLK_ATTACH_MUX(kCLOCK_SelLPUART0, 5U), /*!< Attach CLK_1M to LPUART0. */ - kNONE_to_LPUART0 = CLK_ATTACH_MUX(kCLOCK_SelLPUART0, 7U), /*!< Attach NONE to LPUART0. */ - - kFRO12M_to_LPUART1 = CLK_ATTACH_MUX(kCLOCK_SelLPUART1, 0U), /*!< Attach FRO12M to LPUART1. */ - kFRO_HF_DIV_to_LPUART1 = CLK_ATTACH_MUX(kCLOCK_SelLPUART1, 2U), /*!< Attach FRO_HF_DIV to LPUART1. */ - kCLK_IN_to_LPUART1 = CLK_ATTACH_MUX(kCLOCK_SelLPUART1, 3U), /*!< Attach CLK_IN to LPUART1. */ - kCLK_16K_to_LPUART1 = CLK_ATTACH_MUX(kCLOCK_SelLPUART1, 4U), /*!< Attach CLK_16K to LPUART1. */ - kCLK_1M_to_LPUART1 = CLK_ATTACH_MUX(kCLOCK_SelLPUART1, 5U), /*!< Attach CLK_1M to LPUART1. */ - kNONE_to_LPUART1 = CLK_ATTACH_MUX(kCLOCK_SelLPUART1, 7U), /*!< Attach NONE to LPUART1. */ - - kFRO12M_to_LPUART2 = CLK_ATTACH_MUX(kCLOCK_SelLPUART2, 0U), /*!< Attach FRO12M to LPUART2. */ - kFRO_HF_DIV_to_LPUART2 = CLK_ATTACH_MUX(kCLOCK_SelLPUART2, 2U), /*!< Attach FRO_HF_DIV to LPUART2. */ - kCLK_IN_to_LPUART2 = CLK_ATTACH_MUX(kCLOCK_SelLPUART2, 3U), /*!< Attach CLK_IN to LPUART2. */ - kCLK_16K_to_LPUART2 = CLK_ATTACH_MUX(kCLOCK_SelLPUART2, 4U), /*!< Attach CLK_16K to LPUART2. */ - kCLK_1M_to_LPUART2 = CLK_ATTACH_MUX(kCLOCK_SelLPUART2, 5U), /*!< Attach CLK_1M to LPUART2. */ - kNONE_to_LPUART2 = CLK_ATTACH_MUX(kCLOCK_SelLPUART2, 7U), /*!< Attach NONE to LPUART2. */ - - kCLK_48M_to_USB0 = CLK_ATTACH_MUX(kCLOCK_SelUSB0, 1U), /*!< Attach FRO12M to USB0. */ - kCLK_IN_to_USB0 = CLK_ATTACH_MUX(kCLOCK_SelUSB0, 2U), /*!< Attach CLK_IN to USB0. */ - kNONE_to_USB0 = CLK_ATTACH_MUX(kCLOCK_SelUSB0, 3U), /*!< Attach NONE to USB0. */ - - kFRO12M_to_LPTMR0 = CLK_ATTACH_MUX(kCLOCK_SelLPTMR0, 0U), /*!< Attach FRO12M to LPTMR0. */ - kFRO_HF_DIV_to_LPTMR0 = CLK_ATTACH_MUX(kCLOCK_SelLPTMR0, 2U), /*!< Attach FRO_HF_DIV to LPTMR0. */ - kCLK_IN_to_LPTMR0 = CLK_ATTACH_MUX(kCLOCK_SelLPTMR0, 3U), /*!< Attach CLK_IN to LPTMR0. */ - kCLK_1M_to_LPTMR0 = CLK_ATTACH_MUX(kCLOCK_SelLPTMR0, 5U), /*!< Attach CLK_1M to LPTMR0. */ - kNONE_to_LPTMR0 = CLK_ATTACH_MUX(kCLOCK_SelLPTMR0, 7U), /*!< Attach NONE to LPTMR0. */ - - kCLK_16K_to_OSTIMER = CLK_ATTACH_MUX(kCLOCK_SelOSTIMER0, 0U), /*!< Attach FRO16K to OSTIMER0. */ - kCLK_1M_to_OSTIMER = CLK_ATTACH_MUX(kCLOCK_SelOSTIMER0, 2U), /*!< Attach CLK_1M to OSTIMER0. */ - kNONE_to_OSTIMER = CLK_ATTACH_MUX(kCLOCK_SelOSTIMER0, 3U), /*!< Attach NONE to OSTIMER0. */ - - kFRO12M_to_ADC0 = CLK_ATTACH_MUX(kCLOCK_SelADC0, 0U), /*!< Attach FRO12M to ADC0. */ - kFRO_HF_to_ADC0 = CLK_ATTACH_MUX(kCLOCK_SelADC0, 1U), /*!< Attach FRO_HF to ADC0. */ - kCLK_IN_to_ADC0 = CLK_ATTACH_MUX(kCLOCK_SelADC0, 3U), /*!< Attach CLK_IN to ADC0. */ - kCLK_1M_to_ADC0 = CLK_ATTACH_MUX(kCLOCK_SelADC0, 5U), /*!< Attach CLK_1M to ADC0. */ - kNONE_to_ADC0 = CLK_ATTACH_MUX(kCLOCK_SelADC0, 7U), /*!< Attach NONE to ADC0. */ - - kFRO12M_to_CMP0 = CLK_ATTACH_MUX(kCLOCK_SelCMP0_RR, 0U), /*!< Attach FRO12M to CMP0. */ - kFRO_HF_DIV_to_CMP0 = CLK_ATTACH_MUX(kCLOCK_SelCMP0_RR, 2U), /*!< Attach FRO_HF_DIV to CMP0. */ - kCLK_IN_to_CMP0 = CLK_ATTACH_MUX(kCLOCK_SelCMP0_RR, 3U), /*!< Attach CLK_IN to CMP0. */ - kCLK_1M_to_CMP0 = CLK_ATTACH_MUX(kCLOCK_SelCMP0_RR, 5U), /*!< Attach CLK_1M to CMP0. */ - kNONE_to_CMP0 = CLK_ATTACH_MUX(kCLOCK_SelCMP0_RR, 7U), /*!< Attach NONE to CMP0. */ - - kFRO12M_to_CMP1 = CLK_ATTACH_MUX(kCLOCK_SelCMP1_RR, 0U), /*!< Attach FRO12M to CMP1. */ - kFRO_HF_DIV_to_CMP1 = CLK_ATTACH_MUX(kCLOCK_SelCMP1_RR, 2U), /*!< Attach FRO_HF_DIV to CMP1. */ - kCLK_IN_to_CMP1 = CLK_ATTACH_MUX(kCLOCK_SelCMP1_RR, 3U), /*!< Attach CLK_IN to CMP1. */ - kCLK_1M_to_CMP1 = CLK_ATTACH_MUX(kCLOCK_SelCMP1_RR, 5U), /*!< Attach CLK_1M to CMP1. */ - kNONE_to_CMP1 = CLK_ATTACH_MUX(kCLOCK_SelCMP1_RR, 7U), /*!< Attach NONE to CMP1. */ - - kCPU_CLK_to_TRACE = CLK_ATTACH_MUX(kCLOCK_SelTRACE, 0U), /*!< Attach CPU_CLK to TRACE. */ - kCLK_1M_to_TRACE = CLK_ATTACH_MUX(kCLOCK_SelTRACE, 1U), /*!< Attach CLK_1M to TRACE. */ - kCLK_16K_to_TRACE = CLK_ATTACH_MUX(kCLOCK_SelTRACE, 2U), /*!< Attach CLK_16K to TRACE. */ - kNONE_to_TRACE = CLK_ATTACH_MUX(kCLOCK_SelTRACE, 3U), /*!< Attach NONE to TRACE. */ - - kFRO12M_to_CLKOUT = CLK_ATTACH_MUX(kCLOCK_SelCLKOUT, 0U), /*!< Attach FRO12M to CLKOUT. */ - kFRO_HF_DIV_to_CLKOUT = CLK_ATTACH_MUX(kCLOCK_SelCLKOUT, 1U), /*!< Attach FRO_HF_DIV to CLKOUT. */ - kCLK_IN_to_CLKOUT = CLK_ATTACH_MUX(kCLOCK_SelCLKOUT, 2U), /*!< Attach CLK_IN to CLKOUT. */ - kCLK_16K_to_CLKOUT = CLK_ATTACH_MUX(kCLOCK_SelCLKOUT, 3U), /*!< Attach CLK_16K to CLKOUT. */ - kSLOW_CLK_to_CLKOUT = CLK_ATTACH_MUX(kCLOCK_SelCLKOUT, 6U), /*!< Attach SLOW_CLK to CLKOUT. */ - kNONE_to_CLKOUT = CLK_ATTACH_MUX(kCLOCK_SelCLKOUT, 7U), /*!< Attach NONE to CLKOUT. */ - - kCPU_CLK_to_SYSTICK = CLK_ATTACH_MUX(kCLOCK_SelSYSTICK, 0U), /*!< Attach CPU_CLK to SYSTICK. */ - kCLK_1M_to_SYSTICK = CLK_ATTACH_MUX(kCLOCK_SelSYSTICK, 1U), /*!< Attach CLK_1M to SYSTICK. */ - kCLK_16K_to_SYSTICK = CLK_ATTACH_MUX(kCLOCK_SelSYSTICK, 2U), /*!< Attach CLK_16K to SYSTICK. */ - kNONE_to_SYSTICK = CLK_ATTACH_MUX(kCLOCK_SelSYSTICK, 3U), /*!< Attach NONE to SYSTICK. */ - - kNONE_to_NONE = (0xFFFFFFFFU), /*!< Attach NONE to NONE. */ - -} clock_attach_id_t; - -/*! @brief Clock dividers */ -typedef enum _clock_div_name -{ - kCLOCK_DivI3C0_FCLK = (0x0A4U), /*!< I3C0_FCLK clock divider */ - kCLOCK_DivCTIMER0 = (0x0ACU), /*!< CTIMER0 clock divider */ - kCLOCK_DivCTIMER1 = (0x0B4U), /*!< CTIMER1 clock divider */ - kCLOCK_DivCTIMER2 = (0x0BCU), /*!< CTIMER2 clock divider */ - kCLOCK_DivWWDT0 = (0x0C4U), /*!< WWDT0 clock divider */ - kCLOCK_DivLPI2C0 = (0x0CCU), /*!< LPI2C0 clock divider */ - kCLOCK_DivLPSPI0 = (0x0D4U), /*!< LPSPI0 clock divider */ - kCLOCK_DivLPSPI1 = (0x0DCU), /*!< LPSPI1 clock divider */ - kCLOCK_DivLPUART0 = (0x0E4U), /*!< LPUART0 clock divider */ - kCLOCK_DivLPUART1 = (0x0ECU), /*!< LPUART1 clock divider */ - kCLOCK_DivLPUART2 = (0x0F4U), /*!< LPUART2 clock divider */ - kCLOCK_DivLPTMR0 = (0x104U), /*!< LPTMR0 clock divider */ - kCLOCK_DivADC0 = (0x114U), /*!< ADC0 clock divider */ - kCLOCK_DivCMP0_FUNC = (0x11CU), /*!< CMP0_FUNC clock divider */ - kCLOCK_DivCMP0_RR = (0x124U), /*!< CMP0_RR clock divider */ - kCLOCK_DivCMP1_FUNC = (0x12CU), /*!< CMP1_FUNC clock divider */ - kCLOCK_DivCMP1_RR = (0x134U), /*!< CMP1_RR clock divider */ - kCLOCK_DivTRACE = (0x13CU), /*!< TRACE clock divider */ - kCLOCK_DivCLKOUT = (0x144U), /*!< CLKOUT clock divider */ - kCLOCK_DivSYSTICK = (0x14CU), /*!< SYSTICK clock divider */ - kCLOCK_DivFRO_HF_DIV = (0x154U), /*!< FRO_HF_DIV clock divider */ - kCLOCK_DivSLOWCLK = (0x378U), /*!< SLOWCLK clock divider */ - kCLOCK_DivAHBCLK = (0x380U), /*!< System clock divider */ - kCLOCK_DivMax = (0x380U), /*!< MAX clock divider */ -} clock_div_name_t; - -/*! - * @brief firc trim mode. - */ -typedef enum _firc_trim_mode -{ - kSCG_FircTrimNonUpdate = SCG_FIRCCSR_FIRCTREN_MASK, - /*!< Trim enable but not enable trim value update. In this mode, the - trim value is fixed to the initialized value which is defined by - trimCoar and trimFine in configure structure \ref firc_trim_config_t.*/ - - kSCG_FircTrimUpdate = SCG_FIRCCSR_FIRCTREN_MASK | SCG_FIRCCSR_FIRCTRUP_MASK - /*!< Trim enable and trim value update enable. In this mode, the trim - value is auto update. */ - -} firc_trim_mode_t; - -/*! - * @brief firc trim source. - */ -typedef enum _firc_trim_src -{ - kSCG_FircTrimSrcUsb0 = 0U, /*!< USB0 start of frame (1kHz). */ - kSCG_FircTrimSrcSysOsc = 2U, /*!< System OSC. */ -} firc_trim_src_t; - -/*! - * @brief firc trim configuration. - */ -typedef struct _firc_trim_config -{ - firc_trim_mode_t trimMode; /*!< Trim mode. */ - firc_trim_src_t trimSrc; /*!< Trim source. */ - uint16_t trimDiv; /*!< Divider of SOSC. */ - uint8_t trimCoar; /*!< Trim coarse value; Irrelevant if trimMode is kSCG_TrimUpdate. */ - uint8_t trimFine; /*!< Trim fine value; Irrelevant if trimMode is kSCG_TrimUpdate. */ -} firc_trim_config_t; - -/*! - * @brief sirc trim mode. - */ -typedef enum _sirc_trim_mode -{ - kSCG_SircTrimNonUpdate = SCG_SIRCCSR_SIRCTREN_MASK, - /*!< Trim enable but not enable trim value update. In this mode, the - trim value is fixed to the initialized value which is defined by - trimCoar and trimFine in configure structure \ref sirc_trim_config_t.*/ - - kSCG_SircTrimUpdate = SCG_SIRCCSR_SIRCTREN_MASK | SCG_SIRCCSR_SIRCTRUP_MASK - /*!< Trim enable and trim value update enable. In this mode, the trim - value is auto update. */ - -} sirc_trim_mode_t; - -/*! - * @brief sirc trim source. - */ -typedef enum _sirc_trim_src -{ - kNoTrimSrc = 0, /*!< No external tirm source. */ - kSCG_SircTrimSrcSysOsc = 2U, /*!< System OSC. */ -} sirc_trim_src_t; - -/*! - * @brief sirc trim configuration. - */ -typedef struct _sirc_trim_config -{ - sirc_trim_mode_t trimMode; /*!< Trim mode. */ - sirc_trim_src_t trimSrc; /*!< Trim source. */ - uint16_t trimDiv; /*!< Divider of SOSC. */ - uint8_t cltrim; /*!< Trim coarse value; Irrelevant if trimMode is kSCG_TrimUpdate. */ - uint8_t ccotrim; /*!< Trim fine value; Irrelevant if trimMode is kSCG_TrimUpdate. */ -} sirc_trim_config_t; - -/*! - * @brief SCG system OSC monitor mode. - */ -typedef enum _scg_sosc_monitor_mode -{ - kSCG_SysOscMonitorDisable = 0U, /*!< Monitor disabled. */ - kSCG_SysOscMonitorInt = SCG_SOSCCSR_SOSCCM_MASK, /*!< Interrupt when the SOSC error is detected. */ - kSCG_SysOscMonitorReset = - SCG_SOSCCSR_SOSCCM_MASK | SCG_SOSCCSR_SOSCCMRE_MASK /*!< Reset when the SOSC error is detected. */ -} scg_sosc_monitor_mode_t; - -/*! - * @brief firc trim source. - */ -typedef enum _clke_16k -{ - kCLKE_16K_SYSTEM = VBAT_FROCLKE_CLKE(1U), /*!< To VSYS domain. */ - kCLKE_16K_COREMAIN = VBAT_FROCLKE_CLKE(2U) /*!< To VDD_CORE domain. */ -} clke_16k_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/** - * @brief Enable the clock for specific IP. - * @param clk : Clock to be enabled. - * @return Nothing - */ -static inline void CLOCK_EnableClock(clock_ip_name_t clk) -{ - uint32_t reg_offset = CLK_GATE_REG_OFFSET(clk); - uint32_t bit_shift = CLK_GATE_BIT_SHIFT(clk); - volatile uint32_t *pClkCtrl = (volatile uint32_t *)((uint32_t)(&(MRCC0->MRCC_GLB_CC0_SET)) + reg_offset); - - if (clk == kCLOCK_GateNotAvail) - { - return; - } - - /* Unlock clock configuration */ - SYSCON->CLKUNLOCK &= ~SYSCON_CLKUNLOCK_UNLOCK_MASK; - - if (reg_offset == REG_PWM0SUBCTL) - { - SYSCON->PWM0SUBCTL |= (1UL << bit_shift); - MRCC0->MRCC_GLB_CC0_SET = MRCC_MRCC_GLB_CC0_FLEXPWM0_MASK; - } - else - { - *pClkCtrl = (1UL << bit_shift); - } - - /* Freeze clock configuration */ - SYSCON->CLKUNLOCK |= SYSCON_CLKUNLOCK_UNLOCK_MASK; -} - -/** - * @brief Disable the clock for specific IP. - * @param clk : Clock to be Disabled. - * @return Nothing - */ -static inline void CLOCK_DisableClock(clock_ip_name_t clk) -{ - uint32_t reg_offset = CLK_GATE_REG_OFFSET(clk); - uint32_t bit_shift = CLK_GATE_BIT_SHIFT(clk); - volatile uint32_t *pClkCtrl = (volatile uint32_t *)((uint32_t)(&(MRCC0->MRCC_GLB_CC0_CLR)) + reg_offset); - - if (clk == kCLOCK_GateNotAvail) - { - return; - } - - /* Unlock clock configuration */ - SYSCON->CLKUNLOCK &= ~SYSCON_CLKUNLOCK_UNLOCK_MASK; - - if (reg_offset == REG_PWM0SUBCTL) - { - SYSCON->PWM0SUBCTL &= ~(1UL << bit_shift); - - if (0U == (SYSCON->PWM0SUBCTL & 0xFU)) - { - MRCC0->MRCC_GLB_CC0_CLR = MRCC_MRCC_GLB_CC0_FLEXPWM0_MASK; - } - } - else - { - *pClkCtrl = (1UL << bit_shift); - } - - /* Freeze clock configuration */ - SYSCON->CLKUNLOCK |= SYSCON_CLKUNLOCK_UNLOCK_MASK; -} - -/** - * @brief Configure the clock selection muxes. - * @param connection : Clock to be configured. - * @return Nothing - */ -void CLOCK_AttachClk(clock_attach_id_t connection); - -/** - * @brief Get the actual clock attach id. - * This fuction uses the offset in input attach id, then it reads the actual source value in - * the register and combine the offset to obtain an actual attach id. - * @param connection : Clock attach id to get. - * @return Clock source value. - */ -clock_attach_id_t CLOCK_GetClockAttachId(clock_attach_id_t connection); - -/** - * @brief Set the clock select value. - * This fuction set the peripheral clock select value. - * @param sel_name : Clock select. - * @param value : value to be set. - */ -void CLOCK_SetClockSelect(clock_select_name_t sel_name, uint32_t value); - -/** - * @brief Get the clock select value. - * This fuction get the peripheral clock select value. - * @param sel_name : Clock select. - * @return Clock source value. - */ -uint32_t CLOCK_GetClockSelect(clock_select_name_t sel_name); - -/** - * @brief Setup peripheral clock dividers. - * @param div_name : Clock divider name - * @param value : Value to be divided - * @return Nothing - */ -void CLOCK_SetClockDiv(clock_div_name_t div_name, uint32_t value); - -/** - * @brief Get peripheral clock dividers. - * @param div_name : Clock divider name - * @return peripheral clock dividers - */ -uint32_t CLOCK_GetClockDiv(clock_div_name_t div_name); - -/** - * @brief Halt peripheral clock dividers. - * @param div_name : Clock divider name - * @return Nothing - */ -void CLOCK_HaltClockDiv(clock_div_name_t div_name); - -/** - * @brief Initialize the FROHF to given frequency (48,64,96,192). - * This function turns on FIRC and select the given frequency as the source of fro_hf - * @param iFreq : Desired frequency. - * @return returns success or fail status. - */ -status_t CLOCK_SetupFROHFClocking(uint32_t iFreq); - -/** - * @brief Initialize the FRO12M. - * This function turns on FRO12M. - * @return returns success or fail status. - */ -status_t CLOCK_SetupFRO12MClocking(void); - -/** - * @brief Initialize the FRO16K. - * This function turns on FRO16K. - * @param clk_16k_enable_mask: 0-3 - * 0b00: disable both clk_16k0 and clk_16k1 - * 0b01: only enable clk_16k0 - * 0b10: only enable clk_16k1 - * 0b11: enable both clk_16k0 and clk_16k1 - * @return returns success or fail status. - */ -status_t CLOCK_SetupFRO16KClocking(uint8_t clk_16k_enable_mask); - -/** - * @brief Initialize the external osc clock to given frequency. - * @param iFreq : Desired frequency (must be equal to exact rate in Hz) - * @return returns success or fail status. - */ -status_t CLOCK_SetupExtClocking(uint32_t iFreq); - -/** - * @brief Initialize the external reference clock to given frequency. - * @param iFreq : Desired frequency (must be equal to exact rate in Hz) - * @return returns success or fail status. - */ -status_t CLOCK_SetupExtRefClocking(uint32_t iFreq); - -/*! @brief Return Frequency of selected clock - * @return Frequency of selected clock - */ -uint32_t CLOCK_GetFreq(clock_name_t clockName); - -/*! @brief Return Frequency of core - * @return Frequency of the core - */ -uint32_t CLOCK_GetCoreSysClkFreq(void); - -/*! @brief Return Frequency of I3C FCLK - * @return Frequency of I3C FCLK. - */ -uint32_t CLOCK_GetI3CFClkFreq(void); - -/*! @brief Return Frequency of CTimer functional Clock - * @return Frequency of CTimer functional Clock - */ -uint32_t CLOCK_GetCTimerClkFreq(uint32_t id); - -/*! @brief Return Frequency of LPI2C0 functional Clock - * @return Frequency of LPI2C0 functional Clock - */ -uint32_t CLOCK_GetLpi2cClkFreq(void); - -/*! @brief Return Frequency of LPSPI functional Clock - * @return Frequency of LPSPI functional Clock - */ -uint32_t CLOCK_GetLpspiClkFreq(uint32_t id); - -/*! @brief Return Frequency of LPUART functional Clock - * @return Frequency of LPUART functional Clock - */ -uint32_t CLOCK_GetLpuartClkFreq(uint32_t id); - -/*! @brief Return Frequency of LPTMR functional Clock - * @return Frequency of LPTMR functional Clock - */ -uint32_t CLOCK_GetLptmrClkFreq(void); - -/*! @brief Return Frequency of OSTIMER - * @return Frequency of OSTIMER Clock - */ -uint32_t CLOCK_GetOstimerClkFreq(void); - -/*! @brief Return Frequency of Adc Clock - * @return Frequency of Adc. - */ -uint32_t CLOCK_GetAdcClkFreq(void); - -/*! @brief Return Frequency of CMP Function Clock - * @return Frequency of CMP Function. - */ -uint32_t CLOCK_GetCmpFClkFreq(uint32_t id); - -/*! @brief Return Frequency of CMP Round Robin Clock - * @return Frequency of CMP Round Robin. - */ -uint32_t CLOCK_GetCmpRRClkFreq(uint32_t id); - -/*! @brief Return Frequency of Trace Clock - * @return Frequency of Trace. - */ -uint32_t CLOCK_GetTraceClkFreq(void); - -/*! @brief Return Frequency of CLKOUT Clock - * @return Frequency of CLKOUT. - */ -uint32_t CLOCK_GetClkoutClkFreq(void); - -/*! @brief Return Frequency of Systick Clock - * @return Frequency of Systick. - */ -uint32_t CLOCK_GetSystickClkFreq(void); - -/*! brief Return Frequency of Systick Clock - * return Frequency of Systick. - */ -uint32_t CLOCK_GetWwdtClkFreq(void); - -/** - * @brief Setup FROHF trim. - * @param config : FROHF trim value - * @return returns success or fail status. - */ -status_t CLOCK_FROHFTrimConfig(firc_trim_config_t config); - -/** - * @brief Setup FRO 12M trim. - * @param config : FRO 12M trim value - * @return returns success or fail status. - */ -status_t CLOCK_FRO12MTrimConfig(sirc_trim_config_t config); - -/*! - * @brief Sets the system OSC monitor mode. - * - * This function sets the system OSC monitor mode. The mode can be disabled, - * it can generate an interrupt when the error is disabled, or reset when the error is detected. - * - * @param mode Monitor mode to set. - */ -void CLOCK_SetSysOscMonitorMode(scg_sosc_monitor_mode_t mode); - -/*! brief Enable USB FS clock. - * Enable USB Full Speed clock. - */ -bool CLOCK_EnableUsbfsClock(void); - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @} */ - -#endif /* _FSL_CLOCK_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_cmc.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_cmc.c deleted file mode 100644 index 4e388d9e73a..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_cmc.c +++ /dev/null @@ -1,310 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#include "fsl_cmc.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.mcx_cmc" -#endif - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ -static uint32_t g_savedPrimask; - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Sets clock mode. - * - * This function configs the amount of clock gating when the core asserts - * Sleeping due to WFI, WFE or SLEEPONEXIT. - * - * param base CMC peripheral base address. - * param mode System clock mode. - */ -void CMC_SetClockMode(CMC_Type *base, cmc_clock_mode_t mode) -{ - uint32_t reg; - - reg = base->CKCTRL; - reg &= ~CMC_CKCTRL_CKMODE_MASK; - reg |= CMC_CKCTRL_CKMODE((mode)); - base->CKCTRL = reg; -} - -/*! - * brief Configures all power mode protection settings. - * - * This function configures the power mode protection settings for - * supported power modes. This should be done before setting the lowPower mode - * for each power doamin. - * - * The allowed lowpower modes are passed as bit map. For example, to allow - * Sleep and DeepSleep, use CMC_SetPowerModeProtection(CMC_base, kCMC_AllowSleepMode|kCMC_AllowDeepSleepMode). - * To allow all low power modes, use CMC_SetPowerModeProtection(CMC_base, kCMC_AllowAllLowPowerModes). - * - * param base CMC peripheral base address. - * param allowedModes Bitmaps of the allowed power modes. - */ -void CMC_SetPowerModeProtection(CMC_Type *base, uint32_t allowedModes) -{ - uint32_t reg; - - reg = base->PMPROT; - reg &= ~0xFUL; - reg |= allowedModes; - - base->PMPROT = reg; -} - -/*! - * brief Configure reset pin. - * - * This function configures reset pin. When enabled, the low power filter is enabled in both - * Active and Low power modes, the reset filter is only enabled in Active mode. When both filers - * are enabled, they operate in series. - * - * param base CMC peripheral base address. - * param config Pointer to the reset pin config structure. - */ -void CMC_ConfigResetPin(CMC_Type *base, const cmc_reset_pin_config_t *config) -{ - assert(config != NULL); - - uint32_t reg = base->RPC; - - if (config->lowpowerFilterEnable) - { - reg |= CMC_RPC_LPFEN_MASK; - } - else - { - reg &= ~CMC_RPC_LPFEN_MASK; - } - if (config->resetFilterEnable) - { - reg |= (CMC_RPC_FILTEN_MASK | CMC_RPC_FILTCFG(config->resetFilterWidth)); - } - else - { - reg &= ~(CMC_RPC_FILTEN_MASK | CMC_RPC_FILTCFG_MASK); - } - base->RPC = reg; -} - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG) && FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG) -/*! - * brief Power off the selected system SRAM always. - * - * This function powers off the selected system SRAM always. The SRAM arrays should - * not be accessed while they are shut down. SRAM array contents are not retained - * if they are powered off. - * - * param base CMC peripheral base address. - * param mask Bitmap of the SRAM arrays to be powered off all modes. - */ -void CMC_PowerOffSRAMAllMode(CMC_Type *base, uint32_t mask) -{ - uint32_t reg = base->SRAMDIS[0]; - uint32_t maskToSet = mask & ((uint32_t)kCMC_AllSramArrays); - - reg &= ~((uint32_t)kCMC_AllSramArrays); - reg |= CMC_SRAMDIS_DIS(maskToSet); - base->SRAMDIS[0] = reg; -} - -/*! - * brief Power off the selected system SRAm during low power mode only. - * - * This function powers off the selected system SRAM only during low power mode. - * SRAM array contents are not retained if they are power off. - * - * param base CMC peripheral base address. - * param mask Bitmap of the SRAM arrays to be power off during low power mode only. - */ -void CMC_PowerOffSRAMLowPowerOnly(CMC_Type *base, uint32_t mask) -{ - uint32_t reg = base->SRAMRET[0]; - uint32_t maskToSet = mask & ((uint32_t)kCMC_AllSramArrays); - - reg &= ~((uint32_t)kCMC_AllSramArrays); - reg |= CMC_SRAMRET_RET(maskToSet); - base->SRAMRET[0] = reg; -} -#endif /* FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG */ - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_NO_FLASHCR_WAKE) && FSL_FEATURE_MCX_CMC_HAS_NO_FLASHCR_WAKE) -/*! - * brief Configs the low power mode of the on-chip flash memory. - * - * This function configs the low power mode of the on-chip flash memory. - * - * param base CMC peripheral base address. - * param doze true: Flash is disabled while core is sleeping - * false: No effect. - * param disable true: Flash memory is placed in low power state. - * false: No effect. - */ -void CMC_ConfigFlashMode(CMC_Type *base, bool doze, bool disable) -{ - uint32_t reg = 0UL; - - reg |= (disable ? CMC_FLASHCR_FLASHDIS(1U) : CMC_FLASHCR_FLASHDIS(0U)) | - (doze ? CMC_FLASHCR_FLASHDOZE(1U) : CMC_FLASHCR_FLASHDOZE(0U)); - base->FLASHCR = reg; -} -#else -/*! - * brief Configs the low power mode of the on-chip flash memory. - * - * This function config the low power mode of the on-chip flash memory. - * - * param base CMC peripheral base address. - * param wake - * true - Flash will exit low power state during the flash memory accesses. - * false - No effect. - * param doze - * true - Flash is disabled while core is sleeping - * false - No effect. - * param disable - * true - Flash memory is placed in low power state. - * false - No effect. - */ -void CMC_ConfigFlashMode(CMC_Type *base, bool wake, bool doze, bool disable) -{ - uint32_t reg = 0UL; - - reg |= (disable ? CMC_FLASHCR_FLASHDIS(1U) : CMC_FLASHCR_FLASHDIS(0U)) | - (doze ? CMC_FLASHCR_FLASHDOZE(1U) : CMC_FLASHCR_FLASHDOZE(0U)) | - (wake ? CMC_FLASHCR_FLASHWAKE(1U) : CMC_FLASHCR_FLASHWAKE(0U)); - base->FLASHCR = reg; -} -#endif /* FSL_FEATURE_MCX_CMC_HAS_NO_FLASHCR_WAKE */ - -/*! - * brief Prepares to enter stop modes. - * - * This function should be called before entering low power modes. - * - */ -void CMC_PreEnterLowPowerMode(void) -{ - g_savedPrimask = DisableGlobalIRQ(); - __ISB(); -} - -/*! - * brief Recovers after wake up from stop modes. - * - * This function should be called after waking up from low power modes. - * This function should be used with CMC_PreEnterLowPowerMode() - * - */ -void CMC_PostExitLowPowerMode(void) -{ - EnableGlobalIRQ(g_savedPrimask); - __ISB(); -} - -/*! - * brief Configs the entry into the same low power mode for each power domains. - * - * This function provides the feature to entry into the same low power mode for each power - * domains. Before invoking this function, please ensure the selected power mode have been allowed. - * - * param base CMC peripheral base address. - * param lowPowerMode The low power mode to be entered. See @ref cmc_low_power_mode_t for the details. - * - */ -void CMC_GlobalEnterLowPowerMode(CMC_Type *base, cmc_low_power_mode_t lowPowerMode) -{ - /* Note: unlock the CKCTRL register if this API will be reinvoked later. */ - CMC_SetClockMode(base, kCMC_GateAllSystemClocksEnterLowPowerMode); - CMC_SetGlobalPowerMode(base, lowPowerMode); - /* Before executing WFI instruction read back the last register to - * ensure all registers writes have completed. */ - (void)base->GPMCTRL; - /* Set the core into DeepSleep mode. */ - SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; - __DSB(); - __WFI(); - __ISB(); -} - -/*! - * brief Configs the entry into different low power modes for each of the power domains. - * - * This function provides the feature to entry into different low power modes for - * each power domains. Before invoking this function please ensure the selected - * modes are allowed. - * - * param base CMC peripheral base address. - * param base config Pointer to the cmc_power_domain_config_t structure. - */ -void CMC_EnterLowPowerMode(CMC_Type *base, const cmc_power_domain_config_t *config) -{ - assert(config != NULL); - -#if (CMC_PMCTRL_COUNT > 1U) - /* The WAKE domain must never be configured to a lower power mode compared with main power mode. */ - assert(config->wake_domain <= config->main_domain); -#endif /* (CMC_PMCTRL_COUNT > 1U) */ - - if (config->clock_mode < kCMC_GateAllSystemClocksEnterLowPowerMode) - { - /* In This case the power domain doesn't need to be placed in low power state. */ - /* Note: unlock the register if this API will be reinvoked later. */ - CMC_SetClockMode(base, config->clock_mode); - - CMC_SetMAINPowerMode(base, kCMC_ActiveOrSleepMode); -#if (CMC_PMCTRL_COUNT > 1U) - CMC_SetWAKEPowerMode(base, kCMC_ActiveOrSleepMode); -#endif /* (CMC_PMCTRL_COUNT > 1U) */ - - /* Before executing WFI instruction read back the last register to - * ensure all registers writes have completed. */ - (void)base->CKCTRL; - SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; - __DSB(); - __WFI(); - __ISB(); - } - else - { - /* Note: unlock the register if this API will be reinvoked later. */ - CMC_SetClockMode(base, kCMC_GateAllSystemClocksEnterLowPowerMode); - CMC_SetMAINPowerMode(base, config->main_domain); -#if (CMC_PMCTRL_COUNT > 1U) - CMC_SetWAKEPowerMode(base, config->wake_domain); -#endif /* (CMC_PMCTRL_COUNT > 1U) */ - - /* Before execute WFI instruction read back the last register to - * ensure all registers writes have completed. */ -#if (CMC_PMCTRL_COUNT > 1U) - if ((CMC_GetWAKEPowerMode(base) == config->wake_domain) && (CMC_GetMAINPowerMode(base) == config->main_domain)) - { -#endif /* (CMC_PMCTRL_COUNT > 1U) */ - SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; - __DSB(); - __WFI(); - __ISB(); -#if (CMC_PMCTRL_COUNT > 1U) - } -#endif /* (CMC_PMCTRL_COUNT > 1U) */ - } -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_cmc.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_cmc.h deleted file mode 100644 index 6dbe8e974bd..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_cmc.h +++ /dev/null @@ -1,929 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_CMC_H_ -#define FSL_CMC_H_ -#include "fsl_common.h" - -/*! - * @addtogroup mcx_cmc - * @{ - */ -/******************************************************************************* - * Definitions - ******************************************************************************/ -/*! @name Driver version */ -/*@{*/ -/*! @brief CMC driver version 2.2.2. */ -#define FSL_CMC_DRIVER_VERSION (MAKE_VERSION(2, 2, 2)) -/* @} */ - -/*! - * @brief CMC power mode Protection enumeration. - */ -enum _cmc_power_mode_protection -{ - kCMC_AllowDeepSleepMode = 0x1UL, /*!< Allow Deep Sleep mode. */ - kCMC_AllowPowerDownMode = 0x2UL, /*!< Allow Power Down mode. */ - kCMC_AllowDeepPowerDownMode = 0x8UL, /*!< Allow Deep Power Down mode. */ - kCMC_AllowAllLowPowerModes = 0xFUL, /*!< Allow Deep Sleep, Power Down, Deep Power Down modes. */ -}; - -/*! - * @brief Wake up sources from the previous low power mode entry. - * - * @note #kCMC_WakeupFromUsbFs, #kCMC_WakeupFromITRC, #kCMC_WakeupFromCpu1 are not supported in MCXA family. - */ -enum _cmc_wakeup_sources -{ - kCMC_WakeupFromResetInterruptOrPowerDown = - CMC_CKSTAT_WAKEUP(1U << 0U), /*!< Wakeup source is reset interrupt, or wake up from Deep Power Down. */ - kCMC_WakeupFromDebugReuqest = CMC_CKSTAT_WAKEUP(1U << 1U), /*!< Wakeup source is debug request. */ - kCMC_WakeupFromInterrupt = CMC_CKSTAT_WAKEUP(1U << 2U), /*!< Wakeup source is interrupt. */ - kCMC_WakeupFromDMAWakeup = CMC_CKSTAT_WAKEUP(1U << 3U), /*!< Wakeup source is DMA Wakeup. */ - kCMC_WakeupFromWUURequest = CMC_CKSTAT_WAKEUP(1U << 4U), /*!< Wakeup source is WUU request. */ - kCMC_WakeupFromUsbFs = CMC_CKSTAT_WAKEUP(1U << 5U), /*!< Wakeup source is USBFS(USB0). */ - kCMC_WakeupFromITRC = CMC_CKSTAT_WAKEUP(1U << 6U), /*!< Wakeup source is ITRC. */ - kCMC_WakeupFromCpu1 = CMC_CKSTAT_WAKEUP(1U << 7U), /*!< Wakeup source is CPU1. */ -}; - -/*! - * @brief System Reset Interrupt enable enumeration. - */ -enum _cmc_system_reset_interrupt_enable -{ - kCMC_PinResetInterruptEnable = CMC_SRIE_PIN_MASK, /*!< Pin Reset interrupt enable. */ - kCMC_DAPResetInterruptEnable = CMC_SRIE_DAP_MASK, /*!< DAP Reset interrupt enable. */ - kCMC_LowPowerAcknowledgeTimeoutResetInterruptEnable = CMC_SRIE_LPACK_MASK, /*!< Low Power Acknowledge Timeout - Reset interrupt enable. */ - kCMC_WindowedWatchdog0ResetInterruptEnable = CMC_SRIE_WWDT0_MASK, /*!< Windowed Watchdog 0 reset - interrupt enable. */ - kCMC_SoftwareResetInterruptEnable = CMC_SRIE_SW_MASK, /*!< Software Reset interrupt enable. */ - kCMC_LockupResetInterruptEnable = CMC_SRIE_LOCKUP_MASK, /*!< Lockup Reset interrupt enable. */ -#if defined(CMC_SRIE_CPU1_MASK) - kCMC_Cpu1ResetInterruptEnable = CMC_SRIE_CPU1_MASK, /*!< CPU1 Reset interrupt enable. */ -#endif /* CMC_SRIE_CPU1_MASK */ -#if defined(CMC_SRIE_ADVC_MASK) - kCMC_AdvcResetInterruptEnable = CMC_SRIE_ADVC_MASK, /*!< ADVC Reset interrupt enable. */ -#endif /* CMC_SRIE_ADVC_MASK */ -#if defined(CMC_SRIE_VBAT_MASK) - kCMC_VBATResetInterruptEnable = CMC_SRIE_VBAT_MASK, /*!< VBAT reset interrupt enable. */ -#endif /* CMC_SRIE_VBAT_MASK */ -#if defined(CMC_SRIE_WWDT1_MASK) - kCMC_WindowedWatchdog1ResetInterruptEnable = CMC_SRIE_WWDT1_MASK, /*!< Windowed Watchdog 1 reset - interrupt enable. */ -#endif /* CMC_SRIE_WWDT1_MASK */ - kCMC_CodeWatchDog0ResetInterruptEnable = CMC_SRIE_CDOG0_MASK, /*!< Code watchdog 0 reset interrupt enable. */ -#if defined(CMC_SRIE_CDOG1_MASK) - kCMC_CodeWatchDog1ResetInterruptEnable = CMC_SRIE_CDOG1_MASK, /*!< Code watchdog 1 reset interrupt enable. */ -#endif /* CMC_SRIE_CDOG1_MASK */ -}; - -/*! - * @brief CMC System Reset Interrupt Status flag. - */ -enum _cmc_system_reset_interrupt_flag -{ - kCMC_PinResetInterruptFlag = CMC_SRIF_PIN_MASK, /*!< Pin Reset interrupt flag. */ - kCMC_DAPResetInterruptFlag = CMC_SRIF_DAP_MASK, /*!< DAP Reset interrupt flag. */ - kCMC_LowPowerAcknowledgeTimeoutResetFlag = CMC_SRIF_LPACK_MASK, /*!< Low Power Acknowledge - Timeout Reset interrupt flag. */ - kCMC_WindowedWatchdog0ResetInterruptFlag = CMC_SRIF_WWDT0_MASK, /*!< Windowned Watchdog 0 Reset interrupt flag. */ - kCMC_SoftwareResetInterruptFlag = CMC_SRIF_SW_MASK, /*!< Software Reset interrupt flag. */ - kCMC_LockupResetInterruptFlag = CMC_SRIF_LOCKUP_MASK, /*!< Lock up Reset interrupt flag. */ -#if defined(CMC_SRIF_CPU1_MASK) - kCMC_Cpu1ResetInterruptFlag = CMC_SRIF_CPU1_MASK, /*!< CPU1 Reset interrupt flag. */ -#endif /* CMC_SRIF_CPU1_MASK */ -#if defined(CMC_SRIF_ADVC_MASK) - kCMC_AdvcResetInterruptFlag = CMC_SRIF_ADVC_MASK, /*!< ADVC Reset interrupt flag. */ -#endif /* CMC_SRIF_ADVC_MASK */ -#if defined(CMC_SRIF_VBAT_MASK) - kCMC_VbatResetInterruptFlag = CMC_SRIF_VBAT_MASK, /*!< VBAT system reset interrupt flag. */ -#endif /* CMC_SRIF_VBAT_MASK */ -#if defined(CMC_SRIF_WWDT1_MASK) - kCMC_WindowedWatchdog1ResetInterruptFlag = CMC_SRIF_WWDT1_MASK, /*!< Windowned Watchdog 1 Reset interrupt flag. */ -#endif /* CMC_SRIF_WWDT1_MASK */ - kCMC_CodeWatchdog0ResetInterruptFlag = CMC_SRIF_CDOG0_MASK, /*!< Code watchdog0 reset interrupt flag. */ -#if defined(CMC_SRIF_CDOG1_MASK) - kCMC_CodeWatchdog1ResetInterruptFlag = CMC_SRIF_CDOG1_MASK, /*!< Code watchdog1 reset interrupt flag. */ -#endif /* CMC_SRIF_CDOG1_MASK */ -}; - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG) && FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG) -/*! - * @brief CMC System SRAM arrays low power mode enable enumeration. - */ -enum _cmc_system_sram_arrays -{ - kCMC_RAMX0 = 1UL << 0UL, /*!< Used to control RAMX0. */ - kCMC_RAMX1 = 1UL << 1UL, /*!< Used to control RAMX1. */ - kCMC_RAMX2 = 1UL << 2UL, /*!< Used to control RAMX2. */ - kCMC_RAMB = 1UL << 3UL, /*!< Used to control RAMB. */ - kCMC_RAMC0 = 1UL << 4UL, /*!< Used to control RAMC0. */ - kCMC_RAMC1 = 1UL << 5UL, /*!< Used to control RAMC1. */ - kCMC_RAMD0 = 1UL << 6UL, /*!< Used to control RAMD0. */ - kCMC_RAMD1 = 1UL << 7UL, /*!< Used to control RAMD1. */ - kCMC_RAME0 = 1UL << 8UL, /*!< Used to control RAME0. */ - kCMC_RAME1 = 1UL << 9UL, /*!< Used to control RAME1. */ - kCMC_RAMF0 = 1UL << 10UL, /*!< Used to control RAMF0. */ - kCMC_RAMF1 = 1UL << 11UL, /*!< Used to control RAMF1. */ - kCMC_RAMG0_RAMG1 = 1UL << 12UL, /*!< Used to control RAMG0 and RAMG1. */ - kCMC_RAMG2_RAMG3 = 1UL << 13UL, /*!< Used to control RAMG2 and RAMG3. */ - kCMC_RAMH0_RAMH1 = 1UL << 14UL, /*!< Used to control RAMH0 and RAMH1. */ - kCMC_LPCAC = 1UL << 24UL, /*!< Used to control LPCAC. */ - kCMC_DMA0_DMA1_PKC = 1UL << 25UL, /*!< Used to control DMA0, DMA1 and PKC. */ - kCMC_USB0 = 1UL << 26UL, /*!< Used to control USB0. */ - kCMC_PQ = 1UL << 27UL, /*!< Used to control PQ. */ - kCMC_CAN0_CAN1_ENET_USB1 = 1UL << 28UL, /*!< Used to control CAN0, CAN1, ENET, USB1. */ - kCMC_FlexSPI = 1UL << 29UL, /*!< Used to control FlexSPI. */ - - kCMC_AllSramArrays = (kCMC_RAMX0 | kCMC_RAMX1 | kCMC_RAMX2 | kCMC_RAMB | kCMC_RAMC0 | kCMC_RAMC1 | kCMC_RAMD0 | - kCMC_RAMD1 | kCMC_RAME0 | kCMC_RAME1 | kCMC_RAMF0 | kCMC_RAMF1 | kCMC_RAMG0_RAMG1 | - kCMC_RAMG2_RAMG3 | kCMC_RAMH0_RAMH1 | kCMC_LPCAC | kCMC_DMA0_DMA1_PKC | kCMC_USB0 | kCMC_PQ | - kCMC_CAN0_CAN1_ENET_USB1 | kCMC_FlexSPI), /*!< Mask of all System SRAM arrays. */ -}; -#endif /* FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG */ - -/*! - * @brief System reset sources enumeration. - */ -enum _cmc_system_reset_sources -{ - kCMC_WakeUpReset = CMC_SRS_WAKEUP_MASK, /*!< The reset caused by a wakeup from Power Down or - Deep Power Down mode. */ - kCMC_PORReset = CMC_SRS_POR_MASK, /*!< The reset caused by power on reset detection logic. */ - kCMC_VDReset = CMC_SRS_VD_MASK, /*!< The reset caused by an LVD or HVD. */ - kCMC_WarmReset = CMC_SRS_WARM_MASK, /*!< The last reset source is a warm reset source. */ - kCMC_FatalReset = CMC_SRS_FATAL_MASK, /*!< The last reset source is a fatal reset source. */ - kCMC_PinReset = CMC_SRS_PIN_MASK, /*!< The reset caused by the RESET_b pin. */ - kCMC_DAPReset = CMC_SRS_DAP_MASK, /*!< The reset caused by a reset request from the Debug Access port. */ - kCMC_ResetTimeout = CMC_SRS_RSTACK_MASK, /*!< The reset caused by a timeout or other error condition in the system - reset generation. */ - kCMC_LowPowerAcknowledgeTimeoutReset = CMC_SRS_LPACK_MASK, /*!< The reset caused by a timeout in - low power mode entry logic. */ - kCMC_SCGReset = CMC_SRS_SCG_MASK, /*!< The reset caused by a loss of clock or loss of lock event in the SCG. */ - kCMC_WindowedWatchdog0Reset = CMC_SRS_WWDT0_MASK, /*!< The reset caused by the Windowed WatchDog 0 timeout. */ - kCMC_SoftwareReset = CMC_SRS_SW_MASK, /*!< The reset caused by a software reset request. */ - kCMC_LockUoReset = CMC_SRS_LOCKUP_MASK, /*!< The reset caused by the ARM core indication of a LOCKUP event. */ -#if defined(CMC_SRS_CPU1_MASK) - kCMC_Cpu1Reset = CMC_SRS_CPU1_MASK, /*!< The reset caused by a CPU1 system reset. */ -#endif /* CMC_SRS_CPU1_MASK */ -#if defined(CMC_SRS_ADVC_MASK) - kCMC_AdvcReset = CMC_SRS_ADVC_MASK, /*!< The reset caused by ADVC critical reset. */ -#endif /* CMC_SRS_ADVC_MASK */ -#if defined(CMC_SRS_VBAT_MASK) - kCMC_VbatReset = CMC_SRS_VBAT_MASK, /*!< The reset caused by a VBAT POR. */ -#endif /* CMC_SRS_VBAT_MASK */ -#if defined(CMC_SRS_WWDT1_MASK) - kCMC_WindowedWatchdog1Reset = CMC_SRS_WWDT1_MASK, /*!< The reset caused by the Windowed WatchDog 1 timeout. */ -#endif /* CMC_SRS_WWDT1_MASK */ - kCMC_CodeWatchDog0Reset = CMC_SRS_CDOG0_MASK, /*!< The reset caused by the code watchdog0 fault. */ -#if defined(CMC_SRS_CDOG1_MASK) - kCMC_CodeWatchDog1Reset = CMC_SRS_CDOG1_MASK, /*!< The reset caused by the code watchdog1 fault. */ -#endif /* CMC_SRS_CDOG1_MASK */ - kCMC_JTAGSystemReset = CMC_SRS_JTAG_MASK, /*!< The reset caused by a JTAG system reset request. */ -#if defined(CMC_SRS_SECVIO_MASK) - kCMC_SecurityViolationReset = CMC_SRS_SECVIO_MASK, /*!< The reset caused by a Security Violation logic. */ -#endif /* CMC_SRS_SECVIO_MASK */ -#if defined(CMC_SRS_TAMPER_MASK) - kCMC_TapmerReset = CMC_SRS_TAMPER_MASK, /*!< The reset caused by the tamper detection logic. */ -#endif /* CMC_SRS_TAMPER_MASK */ -}; - -/*! - * @brief Indicate the core clock was gated. - */ -typedef enum _cmc_core_clock_gate_status -{ - kCMC_CoreClockNotGated = 0U, /*!< Core clock not gated. */ - kCMC_CoreClockGated = 1U /*!< Core clock was gated due to low power mode entry. */ -} cmc_core_clock_gate_status_t; - -/*! - * @brief CMC clock mode enumeration. - */ -typedef enum _cmc_clock_mode -{ - kCMC_GateNoneClock = 0x00U, /*!< No clock gating. */ - kCMC_GateCoreClock = 0x01U, /*!< Gate Core clock. */ - kCMC_GateCorePlatformClock = 0x03U, /*!< Gate Core clock and platform clock. */ - kCMC_GateAllSystemClocks = 0x07U, /*!< Gate all System clocks, without getting core entering into low power mode. */ - kCMC_GateAllSystemClocksEnterLowPowerMode = 0x0FU /*!< Gate all System clocks, with core - entering into low power mode. */ -} cmc_clock_mode_t; - -/*! - * @brief CMC power mode enumeration. - */ -typedef enum _cmc_low_power_mode -{ - kCMC_ActiveOrSleepMode = 0x0U, /*!< Select Active/Sleep mode. */ - kCMC_DeepSleepMode = 0x1U, /*!< Select Deep Sleep mode when a core executes WFI or WFE instruction. */ - kCMC_PowerDownMode = 0x3U, /*!< Select Power Down mode when a core executes WFI or WFE instruction. */ - kCMC_DeepPowerDown = 0xFU, /*!< Select Deep Power Down mode when a core executes WFI or WFE instruction. */ -} cmc_low_power_mode_t; - -/*! - * @brief CMC reset pin configuration. - */ -typedef struct _cmc_reset_pin_config -{ - bool lowpowerFilterEnable; /*!< Low Power Filter enable. */ - bool resetFilterEnable; /*!< Reset Filter enable. */ - uint8_t resetFilterWidth; /*!< Width of the Reset Filter. */ -} cmc_reset_pin_config_t; - -/*! - * @brief power mode configuration for each power domain. - */ -typedef struct _cmc_power_domain_config -{ - cmc_clock_mode_t clock_mode; /*!< Clock mode for each power domain. */ - cmc_low_power_mode_t main_domain; /*!< The low power mode of the MAIN power domain. */ -#if (CMC_PMCTRL_COUNT > 1U) - cmc_low_power_mode_t wake_domain; /*!< The low power mode of the WAKE power domain. */ -#endif /* (CMC_PMCTRL_COUNT > 1U) */ -} cmc_power_domain_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name CLOCK mode configuration. - * @{ - */ - -/*! - * @brief Sets clock mode. - * - * This function configs the amount of clock gating when the core asserts - * Sleeping due to WFI, WFE or SLEEPONEXIT. - * - * @param base CMC peripheral base address. - * @param mode System clock mode. - */ -void CMC_SetClockMode(CMC_Type *base, cmc_clock_mode_t mode); - -/*! - * @brief Locks the clock mode setting. - * - * After invoking this function, any clock mode setting will be blocked. - * - * @param base CMC peripheral base address. - */ -static inline void CMC_LockClockModeSetting(CMC_Type *base) -{ - base->CKCTRL |= CMC_CKCTRL_LOCK_MASK; -} - -/* @} */ - -/*! - * @name Gets/Clears the Clock Mode, the wake up source, the Reset source. - * @{ - */ - -/*! - * @brief Gets the core clock gated status. - * - * This function get the status to indicate whether the core clock is gated. - * The core clock gated status can be cleared by software. - * - * @param base CMC peripheral base address. - * @return The status to indicate whether the core clock is gated. - */ -static inline cmc_core_clock_gate_status_t CMC_GetCoreClockGatedStatus(CMC_Type *base) -{ - return (cmc_core_clock_gate_status_t)(uint32_t)((base->CKSTAT & CMC_CKSTAT_VALID_MASK) >> CMC_CKSTAT_VALID_SHIFT); -} - -/*! - * @brief Clears the core clock gated status. - * - * This function clear clock status flag by software. - * - * @param base CMC peripheral base address. - */ -static inline void CMC_ClearCoreClockGatedStatus(CMC_Type *base) -{ - base->CKSTAT |= CMC_CKSTAT_VALID_MASK; -} - -/*! - * @brief Gets the Wakeup Source. - * - * This function gets the Wakeup sources from the previous low power mode entry. - * - * @param base CMC peripheral base address. - * @return The Wakeup sources from the previous low power mode entry. See @ref _cmc_wakeup_sources for details. - */ -static inline uint8_t CMC_GetWakeupSource(CMC_Type *base) -{ - return ((uint8_t)((base->CKSTAT & CMC_CKSTAT_WAKEUP_MASK) >> CMC_CKSTAT_WAKEUP_SHIFT)); -} - -/*! - * @brief Gets the Clock mode. - * - * This function gets the clock mode of the previous low power mode entry. - * - * @param base CMC peripheral base address. - * @return The Low Power status. - */ -static inline cmc_clock_mode_t CMC_GetClockMode(CMC_Type *base) -{ - return (cmc_clock_mode_t)(uint32_t)((base->CKSTAT & CMC_CKSTAT_CKMODE_MASK) >> CMC_CKSTAT_CKMODE_SHIFT); -} - -/*! - * @brief Gets the System reset status. - * - * This function returns the system reset status. Those status - * updates on every MAIN Warm Reset to indicate the type/source - * of the most recent reset. - * - * @param base CMC peripheral base address. - * @return The most recent system reset status. See @ref _cmc_system_reset_sources for details. - */ -static inline uint32_t CMC_GetSystemResetStatus(CMC_Type *base) -{ - return base->SRS; -} - -/*! - * @brief Gets the sticky system reset status since the last WAKE Cold Reset. - * - * This function gets all source of system reset that have generated a - * system reset since the last WAKE Cold Reset, and that have not been - * cleared by software. - * - * @param base CMC peripheral base address. - * @return System reset status that have not been cleared by software. See @ref _cmc_system_reset_sources for details. - */ -static inline uint32_t CMC_GetStickySystemResetStatus(CMC_Type *base) -{ - return base->SSRS; -} - -/*! - * @brief Clears the sticky system reset status flags. - * - * @param base CMC peripheral base address. - * @param mask Bitmap of the sticky system reset status to be cleared. - */ -static inline void CMC_ClearStickySystemResetStatus(CMC_Type *base, uint32_t mask) -{ - base->SSRS = mask; -} - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_RSTCNT_REG) && FSL_FEATURE_MCX_CMC_HAS_RSTCNT_REG) -/*! - * @brief Gets the number of reset sequences completed since the last Cold Reset. - * - * @param base CMC peripheral base address. - * @return The number of reset sequences. - */ -static inline uint8_t CMC_GetResetCount(CMC_Type *base) -{ - return (uint8_t)(base->RSTCNT & CMC_RSTCNT_COUNT_MASK); -} -#endif /* FSL_FEATURE_MCX_CMC_HAS_RSTCNT_REG */ - -/* @} */ - -/*! - * @name Power mode configuration. - * @{ - */ - -/*! - * @brief Configures all power mode protection settings. - * - * This function configures the power mode protection settings for - * supported power modes. This should be done before set the lowPower mode - * for each power doamin. - * - * The allowed lowpower modes are passed as bit map. For example, to allow - * Sleep and DeepSleep, use CMC_SetPowerModeProtection(CMC_base, kCMC_AllowSleepMode|kCMC_AllowDeepSleepMode). - * To allow all low power modes, use CMC_SetPowerModeProtection(CMC_base, kCMC_AllowAllLowPowerModes). - * - * @param base CMC peripheral base address. - * @param allowedModes Bitmaps of the allowed power modes. See @ref _cmc_power_mode_protection for details. - */ -void CMC_SetPowerModeProtection(CMC_Type *base, uint32_t allowedModes); - -/*! - * @brief Locks the power mode protection. - * - * This function locks the power mode protection. After invoking this function, - * any power mode protection setting will be ignored. - * - * @param base CMC peripheral base address. - */ -static inline void CMC_LockPowerModeProtectionSetting(CMC_Type *base) -{ - base->PMPROT |= CMC_PMPROT_LOCK_MASK; -} - -/*! - * @brief Config the same lowPower mode for all power domain. - * - * This function configures the same low power mode for MAIN power domian and WAKE power domain. - * - * @param base CMC peripheral base address. - * @param lowPowerMode The desired lowPower mode. See @ref cmc_low_power_mode_t for details. - */ -static inline void CMC_SetGlobalPowerMode(CMC_Type *base, cmc_low_power_mode_t lowPowerMode) -{ - base->GPMCTRL = CMC_GPMCTRL_LPMODE((uint8_t)lowPowerMode); -} - -/*! - * @brief Configures entry into low power mode for the MAIN Power domain. - * - * This function configures the low power mode for the MAIN power domian, - * when the core executes WFI/WFE instruction. The available lowPower modes - * are defined in the @ref cmc_low_power_mode_t. - * - * @param base CMC peripheral base address. - * @param lowPowerMode The desired lowPower mode. See @ref cmc_low_power_mode_t for details. - * - */ -static inline void CMC_SetMAINPowerMode(CMC_Type *base, cmc_low_power_mode_t lowPowerMode) -{ - base->PMCTRL[0] = CMC_PMCTRL_LPMODE((uint8_t)lowPowerMode); -} - -/*! - * @brief Gets the power mode of the MAIN Power domain. - * - * @param base CMC peripheral base address. - * @return The power mode of MAIN Power domain. See @ref cmc_low_power_mode_t for details. - */ -static inline cmc_low_power_mode_t CMC_GetMAINPowerMode(CMC_Type *base) -{ - return (cmc_low_power_mode_t)(uint32_t)(base->PMCTRL[0] & CMC_PMCTRL_LPMODE_MASK); -} - -#if (CMC_PMCTRL_COUNT > 1U) -/*! - * @brief Configure entry into low power mode for the WAKE Power domain. - * - * This function configures the low power mode for the WAKE power domian, - * when the core executes WFI/WFE instruction. The available lowPower mode - * are defined in the @ref cmc_low_power_mode_t. - * - * @note The lowPower Mode for the WAKE domain must not be configured to a - * lower power mode than any other power domain. - * - * @param base CMC peripheral base address. - * @param lowPowerMode The desired lowPower mode. See @ref cmc_low_power_mode_t for details. - * - */ -static inline void CMC_SetWAKEPowerMode(CMC_Type *base, cmc_low_power_mode_t lowPowerMode) -{ - base->PMCTRL[1] = CMC_PMCTRL_LPMODE((uint8_t)lowPowerMode); -} - -/*! - * @brief Gets the power mode of the WAKE Power domain. - * - * @param base CMC peripheral base address. - * @return The power mode of WAKE Power domain. See @ref cmc_low_power_mode_t for details. - */ -static inline cmc_low_power_mode_t CMC_GetWAKEPowerMode(CMC_Type *base) -{ - return (cmc_low_power_mode_t)(uint32_t)(base->PMCTRL[1] & CMC_PMCTRL_LPMODE_MASK); -} -#endif /* CMC_PMCTRL_COUNT > 1U */ - -/* @} */ - -/*! - * @name Reset Pin configuration. - * @{ - */ - -/*! - * @brief Configure reset pin. - * - * This function configures reset pin. When enabled, the low power filter is enabled in both - * Active and Low power modes, the reset filter is only enabled in Active mode. When both filers - * are enabled, they operate in series. - * - * @param base CMC peripheral base address. - * @param config Pointer to the reset pin config structure. - */ -void CMC_ConfigResetPin(CMC_Type *base, const cmc_reset_pin_config_t *config); - -/* @} */ - -/*! - * @name System Reset Interrupts. - * @{ - */ - -/*! - * @brief Enable system reset interrupts. - * - * This function enables the system reset interrupts. The assertion of - * non-fatal warm reset can be delayed for 258 cycles of the 32K_CLK clock - * while an enabled interrupt is generated. Then Software can perform a graceful - * shutdown or abort the non-fatal warm reset provided the pending reset source is cleared - * by resetting the reset source and then clearing the pending flag. - * - * @param base CMC peripheral base address. - * @param mask System reset interrupts. See @ref _cmc_system_reset_interrupt_enable for details. - * - */ -static inline void CMC_EnableSystemResetInterrupt(CMC_Type *base, uint32_t mask) -{ - base->SRIE |= mask; -} - -/*! - * @brief Disable system reset interrupts. - * - * This function disables the system reset interrupts. - * - * @param base CMC peripheral base address. - * @param mask System reset interrupts. See @ref _cmc_system_reset_interrupt_enable for details. - */ -static inline void CMC_DisableSystemResetInterrupt(CMC_Type *base, uint32_t mask) -{ - base->SRIE &= (uint32_t)(~mask); -} - -/*! - * @brief Gets System Reset interrupt flags. - * - * This function returns the System reset interrupt flags. - * - * @param base CMC peripheral base address. - * @return System reset interrupt flags. See @ref _cmc_system_reset_interrupt_flag for details. - */ -static inline uint32_t CMC_GetSystemResetInterruptFlags(CMC_Type *base) -{ - return base->SRIF; -} - -/*! - * @brief Clears System Reset interrupt flags. - * - * This function clears system reset interrupt flags. The pending reset source - * can be cleared by resetting the source of the reset and then clearing the pending - * flags. - * - * @param base CMC peripheral base address. - * @param mask System Reset interrupt flags. See @ref _cmc_system_reset_interrupt_flag for details. - * - */ -static inline void CMC_ClearSystemResetInterruptFlags(CMC_Type *base, uint32_t mask) -{ - base->SRIF = mask; -} - -/* @} */ - -/*! - * @name Non Maskable Pin interrupt. - * @{ - */ - -/*! - * @brief Enable/Disable Non maskable Pin interrupt. - * - * @param base CMC peripheral base address. - * @param enable Enable or disable Non maskable pin interrupt. - * true - enable Non-maskable pin interrupt. - * false - disable Non-maskable pin interupt. - */ -static inline void CMC_EnableNonMaskablePinInterrupt(CMC_Type *base, bool enable) -{ - if (enable) - { - base->CORECTL |= CMC_CORECTL_NPIE_MASK; - } - else - { - base->CORECTL &= ~CMC_CORECTL_NPIE_MASK; - } -} - -/* @} */ - -/*! - * @name Boot Configuration. - * @{ - */ - -/*! - * @brief Gets the logic state of the ISPMODE_n pin. - * - * This function returns the logic state of the ISPMODE_n pin - * on the last negation of RESET_b pin. - * - * @param base CMC peripheral base address. - * @return The logic state of the ISPMODE_n pin on the last negation of RESET_b pin. - */ -static inline uint8_t CMC_GetISPMODEPinLogic(CMC_Type *base) -{ - return (uint8_t)((base->MR[0] & CMC_MR_ISPMODE_n_MASK) >> CMC_MR_ISPMODE_n_SHIFT); -} - -/*! - * @brief Clears ISPMODE_n pin state. - * - * @param base CMC peripheral base address. - */ -static inline void CMC_ClearISPMODEPinLogic(CMC_Type *base) -{ - base->MR[0] = CMC_MR_ISPMODE_n_MASK; -} - -/*! - * @brief Set the logic state of the BOOT_CONFIGn pin. - * - * This function force the logic state of the Boot_Confign pin to assert - * on next system reset. - * - * @param base CMC peripheral base address. - * @param assert Assert the corresponding pin or not. - * true - Assert corresponding pin on next system reset. - * false - No effect. - */ -static inline void CMC_ForceBootConfiguration(CMC_Type *base, bool assert) -{ - if (assert) - { - base->FM[0] |= CMC_FM_FORCECFG_MASK; - } - else - { - base->FM[0] &= ~CMC_FM_FORCECFG_MASK; - } -} - -/* @} */ - -/*! - * @name BootROM Status. - * @{ - */ - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_BSR_REG) && FSL_FEATURE_MCX_CMC_HAS_BSR_REG) -/*! - * @brief Gets the status information written by the BootROM. - * - * @param base CMC peripheral base address. - * @return The status information written by the BootROM. - */ -static inline uint32_t CMC_GetBootRomStatus(CMC_Type *base) -{ - return base->BSR; -} - -/*! - * @brief Sets the bootROM status value. - * - * @note This function is useful when result of CMC_CheckBootRomRegisterWrittable() is true. - * - * @param base CMC peripheral base address. - * @param stat The state value to set. - */ -static inline void CMC_SetBootRomStatus(CMC_Type *base, uint32_t statValue) -{ - base->BSR = CMC_BSR_STAT(statValue); -} -#endif /* FSL_FEATURE_MCX_CMC_HAS_BSR_REG */ - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_BLR_REG) && FSL_FEATURE_MCX_CMC_HAS_BLR_REG) -/*! - * @brief Check if BootROM status and lock registers is writtable. - * - * @param base CMC peripheral base address. - * @return The result of whether BootROM status and lock register is writtable. - * - \b true BootROM status and lock registers are writtable; - * - \b false BootROM status and lock registers are not writtable. - */ -static inline bool CMC_CheckBootRomRegisterWrittable(CMC_Type *base) -{ - return (base->BLR == 0x2UL); -} - -/*! - * @brief After invoking this function, BootROM status and lock registers cannot be written. - * - * @param base CMC peripheral base address. - */ -static inline void CMC_LockBootRomStatusWritten(CMC_Type *base) -{ - base->BLR = CMC_BLR_LOCK(0x5U); -} - -/*! - * @brief After invoking this function, BootROM status and lock register can be written.s - * - * @param base - */ -static inline void CMC_UnlockBootRomStatusWritten(CMC_Type *base) -{ - base->BLR = CMC_BLR_LOCK(0x2U); -} -#endif /* FSL_FEATURE_MCX_CMC_HAS_BLR_REG */ - -/* @} */ - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG) && FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG) -/*! - * @name System SRAM Configuration. - * @{ - */ - -/*! - * @brief Power off the selected system SRAM always. - * - * @note This function power off the selected system SRAM always. The SRAM arrays should - * not be accessed while they are shut down. SRAM array contents are not retained - * if they are powered off. - * - * @note Once invoked, the previous settings will be overwritten. - * - * @param base CMC peripheral base address. - * @param mask Bitmap of the SRAM arrays to be powered off all modes. - * See @ref _cmc_system_sram_arrays for details. - * Check Reference Manual for the SRAM region and mask bit relationship. - */ -void CMC_PowerOffSRAMAllMode(CMC_Type *base, uint32_t mask); - -/*! - * @brief Power on SRAM during all mode. - * - * @note Once invoked, the previous settings will be overwritten. - * - * @param base CMC peripheral base address. - * @param mask Bitmap of the SRAM arrays to be powered on all modes. - * See @ref _cmc_system_sram_arrays for details. - * Check Reference Manual for the SRAM region and mask bit relationship. - */ -static inline void CMC_PowerOnSRAMAllMode(CMC_Type *base, uint32_t mask) -{ - base->SRAMDIS[0] &= CMC_SRAMDIS_DIS((uint32_t)(~mask)); -} - -/*! - * @brief Power off the selected system SRAM during low power modes only. - * - * This function power off the selected system SRAM only during low power mode. - * SRAM array contents are not retained if they are power off. - * - * @param base CMC peripheral base address. - * @param mask Bitmap of the SRAM arrays to be power off during low power mode only. - * See @ref _cmc_system_sram_arrays for details. - * Check Reference Manual for the SRAM region and mask bit relationship. - */ -void CMC_PowerOffSRAMLowPowerOnly(CMC_Type *base, uint32_t mask); - -/*! - * @brief Power on the selected system SRAM during low power modes only. - * - * This function power on the selected system SRAM. The SRAM arrray contents are - * retained in low power modes. - * - * @param base CMC peripheral base address. - * @param mask Bitmap of the SRAM arrays to be power on during low power mode only. - * See @ref _cmc_system_sram_arrays for details. - * Check Reference Manual for the SRAM region and mask bit relationship. - */ -static inline void CMC_PowerOnSRAMLowPowerOnly(CMC_Type *base, uint32_t mask) -{ - base->SRAMRET[0] &= CMC_SRAMRET_RET((uint32_t)(~mask)); -} - -/* @} */ -#endif /* FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG */ - -/*! - * @name Flash Low Power Mode configuration. - * @{ - */ - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_NO_FLASHCR_WAKE) && FSL_FEATURE_MCX_CMC_HAS_NO_FLASHCR_WAKE) -/*! - * @brief Configs the low power mode of the on-chip flash memory. - * - * This function configs the low power mode of the on-chip flash memory. - * - * @param base CMC peripheral base address. - * @param doze true: Flash is disabled while core is sleeping - * false: No effect. - * @param disable true: Flash memory is placed in low power state. - * false: No effect. - */ -void CMC_ConfigFlashMode(CMC_Type *base, bool doze, bool disable); -#else -/*! - * @brief Configs the low power mode of the on-chip flash memory. - * - * This function configs the low power mode of the on-chip flash memory. - * - * @param base CMC peripheral base address. - * @param wake true: Flash will exit low power state during the flash memory accesses. - * false: No effect. - * @param doze true: Flash is disabled while core is sleeping - * false: No effect. - * @param disable true: Flash memory is placed in low power state. - * false: No effect. - */ -void CMC_ConfigFlashMode(CMC_Type *base, bool wake, bool doze, bool disable); -#endif /* FSL_FEATURE_MCX_CMC_HAS_NO_FLASHCR_WAKE */ -/* @} */ - -/*! - * @name Debug Configuration. - */ - -/*! - * @brief Enables/Disables debug Operation when the core sleep. - * - * This function configs what happens to debug when core sleeps. - * - * @param base CMC peripheral base address. - * @param enable Enable or disable Debug when Core is sleeping. - * true - Debug remains enabled when the core is sleeping. - * false - Debug is disabled when the core is sleeping. - */ -static inline void CMC_EnableDebugOperation(CMC_Type *base, bool enable) -{ - if (enable) - { - base->DBGCTL &= ~CMC_DBGCTL_SOD_MASK; - } - else - { - base->DBGCTL |= CMC_DBGCTL_SOD_MASK; - } -} - -/* @} */ - -/*! - * @name Low Power modes enter. - * @{ - */ -/*! - * @brief Prepares to enter low power modes. - * - * This function should be called before entering low power modes. - * - */ -void CMC_PreEnterLowPowerMode(void); - -/*! - * @brief Recovers after wake up from low power modes. - * - * This function should be called after wake up from low power modes. - * This function should be used with CMC_PreEnterLowPowerMode() - * - */ -void CMC_PostExitLowPowerMode(void); - -/*! - * @brief Configs the entry into the same low power mode for each power domains. - * - * This function provides the feature to entry into the same low power mode for each power - * domains. Before invoking this function, please ensure the selected power mode have been allowed. - * - * @param base CMC peripheral base address. - * @param lowPowerMode The low power mode to be entered. See @ref cmc_low_power_mode_t for the details. - * - */ -void CMC_GlobalEnterLowPowerMode(CMC_Type *base, cmc_low_power_mode_t lowPowerMode); - -/*! - * @brief Configs the entry into different low power modes for each power domains. - * - * This function provides the feature to entry into different low power modes for - * each power domains. Before invoking this function please ensure the selected - * modes are allowed. - * - * @param base CMC peripheral base address. - * @param config Pointer to the cmc_power_domain_config_t structure. - */ -void CMC_EnterLowPowerMode(CMC_Type *base, const cmc_power_domain_config_t *config); - -/* @} */ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @}*/ -#endif /* FSL_CMC_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_common.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_common.c deleted file mode 100644 index d3af9fdfc67..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_common.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_common.h" - -#define SDK_MEM_MAGIC_NUMBER 12345U - -typedef struct _mem_align_control_block -{ - uint16_t identifier; /*!< Identifier for the memory control block. */ - uint16_t offset; /*!< offset from aligned address to real address */ -} mem_align_cb_t; - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.common" -#endif - -#if !((defined(__DSC__) && defined(__CW__))) -void *SDK_Malloc(size_t size, size_t alignbytes) -{ - mem_align_cb_t *p_cb = NULL; - uint32_t alignedsize; - - /* Check overflow. */ - alignedsize = (uint32_t)(unsigned int)SDK_SIZEALIGN(size, alignbytes); - if (alignedsize < size) - { - return NULL; - } - - if (alignedsize > SIZE_MAX - alignbytes - sizeof(mem_align_cb_t)) - { - return NULL; - } - - alignedsize += alignbytes + (uint32_t)sizeof(mem_align_cb_t); - - union - { - void *pointer_value; - uintptr_t unsigned_value; - } p_align_addr, p_addr; - - p_addr.pointer_value = malloc((size_t)alignedsize); - - if (p_addr.pointer_value == NULL) - { - return NULL; - } - - p_align_addr.unsigned_value = SDK_SIZEALIGN(p_addr.unsigned_value + sizeof(mem_align_cb_t), alignbytes); - - p_cb = (mem_align_cb_t *)(p_align_addr.unsigned_value - 4U); - p_cb->identifier = SDK_MEM_MAGIC_NUMBER; - p_cb->offset = (uint16_t)(p_align_addr.unsigned_value - p_addr.unsigned_value); - - return p_align_addr.pointer_value; -} - -void SDK_Free(void *ptr) -{ - union - { - void *pointer_value; - uintptr_t unsigned_value; - } p_free; - p_free.pointer_value = ptr; - mem_align_cb_t *p_cb = (mem_align_cb_t *)(p_free.unsigned_value - 4U); - - if (p_cb->identifier != SDK_MEM_MAGIC_NUMBER) - { - return; - } - - p_free.unsigned_value = p_free.unsigned_value - p_cb->offset; - - free(p_free.pointer_value); -} -#endif diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_common.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_common.h deleted file mode 100644 index e6d5cce7190..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_common.h +++ /dev/null @@ -1,345 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_COMMON_H_ -#define FSL_COMMON_H_ - -#include -#include -#include -#include -#include - -#if defined(__ICCARM__) || (defined(__CC_ARM) || defined(__ARMCC_VERSION)) || defined(__GNUC__) -#include -#endif - -#include "fsl_device_registers.h" - -/*! - * @addtogroup ksdk_common - * @{ - */ - -/******************************************************************************* - * Configurations - ******************************************************************************/ - -/*! @brief Macro to use the default weak IRQ handler in drivers. */ -#ifndef FSL_DRIVER_TRANSFER_DOUBLE_WEAK_IRQ -#define FSL_DRIVER_TRANSFER_DOUBLE_WEAK_IRQ 1 -#endif - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @brief Construct a status code value from a group and code number. */ -#define MAKE_STATUS(group, code) ((((group)*100L) + (code))) - -/*! @brief Construct the version number for drivers. - * - * The driver version is a 32-bit number, for both 32-bit platforms(such as Cortex M) - * and 16-bit platforms(such as DSC). - * - * @verbatim - - | Unused || Major Version || Minor Version || Bug Fix | - 31 25 24 17 16 9 8 0 - - @endverbatim - */ -#define MAKE_VERSION(major, minor, bugfix) (((major)*65536L) + ((minor)*256L) + (bugfix)) - -/*! @name Driver version */ -/*! @{ */ -/*! @brief common driver version. */ -#define FSL_COMMON_DRIVER_VERSION (MAKE_VERSION(2, 4, 1)) -/*! @} */ - -/*! @name Debug console type definition. */ -/*! @{ */ -#define DEBUG_CONSOLE_DEVICE_TYPE_NONE 0U /*!< No debug console. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_UART 1U /*!< Debug console based on UART. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_LPUART 2U /*!< Debug console based on LPUART. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_LPSCI 3U /*!< Debug console based on LPSCI. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_USBCDC 4U /*!< Debug console based on USBCDC. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_FLEXCOMM 5U /*!< Debug console based on FLEXCOMM. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_IUART 6U /*!< Debug console based on i.MX UART. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_VUSART 7U /*!< Debug console based on LPC_VUSART. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_MINI_USART 8U /*!< Debug console based on LPC_USART. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_SWO 9U /*!< Debug console based on SWO. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_QSCI 10U /*!< Debug console based on QSCI. */ -/*! @} */ - -/*! @brief Status group numbers. */ -enum _status_groups -{ - kStatusGroup_Generic = 0, /*!< Group number for generic status codes. */ - kStatusGroup_FLASH = 1, /*!< Group number for FLASH status codes. */ - kStatusGroup_LPSPI = 4, /*!< Group number for LPSPI status codes. */ - kStatusGroup_FLEXIO_SPI = 5, /*!< Group number for FLEXIO SPI status codes. */ - kStatusGroup_DSPI = 6, /*!< Group number for DSPI status codes. */ - kStatusGroup_FLEXIO_UART = 7, /*!< Group number for FLEXIO UART status codes. */ - kStatusGroup_FLEXIO_I2C = 8, /*!< Group number for FLEXIO I2C status codes. */ - kStatusGroup_LPI2C = 9, /*!< Group number for LPI2C status codes. */ - kStatusGroup_UART = 10, /*!< Group number for UART status codes. */ - kStatusGroup_I2C = 11, /*!< Group number for UART status codes. */ - kStatusGroup_LPSCI = 12, /*!< Group number for LPSCI status codes. */ - kStatusGroup_LPUART = 13, /*!< Group number for LPUART status codes. */ - kStatusGroup_SPI = 14, /*!< Group number for SPI status code.*/ - kStatusGroup_XRDC = 15, /*!< Group number for XRDC status code.*/ - kStatusGroup_SEMA42 = 16, /*!< Group number for SEMA42 status code.*/ - kStatusGroup_SDHC = 17, /*!< Group number for SDHC status code */ - kStatusGroup_SDMMC = 18, /*!< Group number for SDMMC status code */ - kStatusGroup_SAI = 19, /*!< Group number for SAI status code */ - kStatusGroup_MCG = 20, /*!< Group number for MCG status codes. */ - kStatusGroup_SCG = 21, /*!< Group number for SCG status codes. */ - kStatusGroup_SDSPI = 22, /*!< Group number for SDSPI status codes. */ - kStatusGroup_FLEXIO_I2S = 23, /*!< Group number for FLEXIO I2S status codes */ - kStatusGroup_FLEXIO_MCULCD = 24, /*!< Group number for FLEXIO LCD status codes */ - kStatusGroup_FLASHIAP = 25, /*!< Group number for FLASHIAP status codes */ - kStatusGroup_FLEXCOMM_I2C = 26, /*!< Group number for FLEXCOMM I2C status codes */ - kStatusGroup_I2S = 27, /*!< Group number for I2S status codes */ - kStatusGroup_IUART = 28, /*!< Group number for IUART status codes */ - kStatusGroup_CSI = 29, /*!< Group number for CSI status codes */ - kStatusGroup_MIPI_DSI = 30, /*!< Group number for MIPI DSI status codes */ - kStatusGroup_SDRAMC = 35, /*!< Group number for SDRAMC status codes. */ - kStatusGroup_POWER = 39, /*!< Group number for POWER status codes. */ - kStatusGroup_ENET = 40, /*!< Group number for ENET status codes. */ - kStatusGroup_PHY = 41, /*!< Group number for PHY status codes. */ - kStatusGroup_TRGMUX = 42, /*!< Group number for TRGMUX status codes. */ - kStatusGroup_SMARTCARD = 43, /*!< Group number for SMARTCARD status codes. */ - kStatusGroup_LMEM = 44, /*!< Group number for LMEM status codes. */ - kStatusGroup_QSPI = 45, /*!< Group number for QSPI status codes. */ - kStatusGroup_DMA = 50, /*!< Group number for DMA status codes. */ - kStatusGroup_EDMA = 51, /*!< Group number for EDMA status codes. */ - kStatusGroup_DMAMGR = 52, /*!< Group number for DMAMGR status codes. */ - kStatusGroup_FLEXCAN = 53, /*!< Group number for FlexCAN status codes. */ - kStatusGroup_LTC = 54, /*!< Group number for LTC status codes. */ - kStatusGroup_FLEXIO_CAMERA = 55, /*!< Group number for FLEXIO CAMERA status codes. */ - kStatusGroup_LPC_SPI = 56, /*!< Group number for LPC_SPI status codes. */ - kStatusGroup_LPC_USART = 57, /*!< Group number for LPC_USART status codes. */ - kStatusGroup_DMIC = 58, /*!< Group number for DMIC status codes. */ - kStatusGroup_SDIF = 59, /*!< Group number for SDIF status codes.*/ - kStatusGroup_SPIFI = 60, /*!< Group number for SPIFI status codes. */ - kStatusGroup_OTP = 61, /*!< Group number for OTP status codes. */ - kStatusGroup_MCAN = 62, /*!< Group number for MCAN status codes. */ - kStatusGroup_CAAM = 63, /*!< Group number for CAAM status codes. */ - kStatusGroup_ECSPI = 64, /*!< Group number for ECSPI status codes. */ - kStatusGroup_USDHC = 65, /*!< Group number for USDHC status codes.*/ - kStatusGroup_LPC_I2C = 66, /*!< Group number for LPC_I2C status codes.*/ - kStatusGroup_DCP = 67, /*!< Group number for DCP status codes.*/ - kStatusGroup_MSCAN = 68, /*!< Group number for MSCAN status codes.*/ - kStatusGroup_ESAI = 69, /*!< Group number for ESAI status codes. */ - kStatusGroup_FLEXSPI = 70, /*!< Group number for FLEXSPI status codes. */ - kStatusGroup_MMDC = 71, /*!< Group number for MMDC status codes. */ - kStatusGroup_PDM = 72, /*!< Group number for MIC status codes. */ - kStatusGroup_SDMA = 73, /*!< Group number for SDMA status codes. */ - kStatusGroup_ICS = 74, /*!< Group number for ICS status codes. */ - kStatusGroup_SPDIF = 75, /*!< Group number for SPDIF status codes. */ - kStatusGroup_LPC_MINISPI = 76, /*!< Group number for LPC_MINISPI status codes. */ - kStatusGroup_HASHCRYPT = 77, /*!< Group number for Hashcrypt status codes */ - kStatusGroup_LPC_SPI_SSP = 78, /*!< Group number for LPC_SPI_SSP status codes. */ - kStatusGroup_I3C = 79, /*!< Group number for I3C status codes */ - kStatusGroup_LPC_I2C_1 = 97, /*!< Group number for LPC_I2C_1 status codes. */ - kStatusGroup_NOTIFIER = 98, /*!< Group number for NOTIFIER status codes. */ - kStatusGroup_DebugConsole = 99, /*!< Group number for debug console status codes. */ - kStatusGroup_SEMC = 100, /*!< Group number for SEMC status codes. */ - kStatusGroup_ApplicationRangeStart = 101, /*!< Starting number for application groups. */ - kStatusGroup_IAP = 102, /*!< Group number for IAP status codes */ - kStatusGroup_SFA = 103, /*!< Group number for SFA status codes*/ - kStatusGroup_SPC = 104, /*!< Group number for SPC status codes. */ - kStatusGroup_PUF = 105, /*!< Group number for PUF status codes. */ - kStatusGroup_TOUCH_PANEL = 106, /*!< Group number for touch panel status codes */ - kStatusGroup_VBAT = 107, /*!< Group number for VBAT status codes */ - kStatusGroup_XSPI = 108, /*!< Group number for XSPI status codes */ - kStatusGroup_PNGDEC = 109, /*!< Group number for PNGDEC status codes */ - kStatusGroup_JPEGDEC = 110, /*!< Group number for JPEGDEC status codes */ - - kStatusGroup_HAL_GPIO = 121, /*!< Group number for HAL GPIO status codes. */ - kStatusGroup_HAL_UART = 122, /*!< Group number for HAL UART status codes. */ - kStatusGroup_HAL_TIMER = 123, /*!< Group number for HAL TIMER status codes. */ - kStatusGroup_HAL_SPI = 124, /*!< Group number for HAL SPI status codes. */ - kStatusGroup_HAL_I2C = 125, /*!< Group number for HAL I2C status codes. */ - kStatusGroup_HAL_FLASH = 126, /*!< Group number for HAL FLASH status codes. */ - kStatusGroup_HAL_PWM = 127, /*!< Group number for HAL PWM status codes. */ - kStatusGroup_HAL_RNG = 128, /*!< Group number for HAL RNG status codes. */ - kStatusGroup_HAL_I2S = 129, /*!< Group number for HAL I2S status codes. */ - kStatusGroup_HAL_ADC_SENSOR = 130, /*!< Group number for HAL ADC SENSOR status codes. */ - kStatusGroup_TIMERMANAGER = 135, /*!< Group number for TiMER MANAGER status codes. */ - kStatusGroup_SERIALMANAGER = 136, /*!< Group number for SERIAL MANAGER status codes. */ - kStatusGroup_LED = 137, /*!< Group number for LED status codes. */ - kStatusGroup_BUTTON = 138, /*!< Group number for BUTTON status codes. */ - kStatusGroup_EXTERN_EEPROM = 139, /*!< Group number for EXTERN EEPROM status codes. */ - kStatusGroup_SHELL = 140, /*!< Group number for SHELL status codes. */ - kStatusGroup_MEM_MANAGER = 141, /*!< Group number for MEM MANAGER status codes. */ - kStatusGroup_LIST = 142, /*!< Group number for List status codes. */ - kStatusGroup_OSA = 143, /*!< Group number for OSA status codes. */ - kStatusGroup_COMMON_TASK = 144, /*!< Group number for Common task status codes. */ - kStatusGroup_MSG = 145, /*!< Group number for messaging status codes. */ - kStatusGroup_SDK_OCOTP = 146, /*!< Group number for OCOTP status codes. */ - kStatusGroup_SDK_FLEXSPINOR = 147, /*!< Group number for FLEXSPINOR status codes.*/ - kStatusGroup_CODEC = 148, /*!< Group number for codec status codes. */ - kStatusGroup_ASRC = 149, /*!< Group number for codec status ASRC. */ - kStatusGroup_OTFAD = 150, /*!< Group number for codec status codes. */ - kStatusGroup_SDIOSLV = 151, /*!< Group number for SDIOSLV status codes. */ - kStatusGroup_MECC = 152, /*!< Group number for MECC status codes. */ - kStatusGroup_ENET_QOS = 153, /*!< Group number for ENET_QOS status codes. */ - kStatusGroup_LOG = 154, /*!< Group number for LOG status codes. */ - kStatusGroup_I3CBUS = 155, /*!< Group number for I3CBUS status codes. */ - kStatusGroup_QSCI = 156, /*!< Group number for QSCI status codes. */ - kStatusGroup_ELEMU = 157, /*!< Group number for ELEMU status codes. */ - kStatusGroup_QUEUEDSPI = 158, /*!< Group number for QSPI status codes. */ - kStatusGroup_POWER_MANAGER = 159, /*!< Group number for POWER_MANAGER status codes. */ - kStatusGroup_IPED = 160, /*!< Group number for IPED status codes. */ - kStatusGroup_ELS_PKC = 161, /*!< Group number for ELS PKC status codes. */ - kStatusGroup_CSS_PKC = 162, /*!< Group number for CSS PKC status codes. */ - kStatusGroup_HOSTIF = 163, /*!< Group number for HOSTIF status codes. */ - kStatusGroup_CLIF = 164, /*!< Group number for CLIF status codes. */ - kStatusGroup_BMA = 165, /*!< Group number for BMA status codes. */ - kStatusGroup_NETC = 166, /*!< Group number for NETC status codes. */ - kStatusGroup_ELE = 167, /*!< Group number for ELE status codes. */ - kStatusGroup_GLIKEY = 168, /*!< Group number for GLIKEY status codes. */ -}; - -/*! \public - * @brief Generic status return codes. - */ -enum -{ - kStatus_Success = MAKE_STATUS(kStatusGroup_Generic, 0), /*!< Generic status for Success. */ - kStatus_Fail = MAKE_STATUS(kStatusGroup_Generic, 1), /*!< Generic status for Fail. */ - kStatus_ReadOnly = MAKE_STATUS(kStatusGroup_Generic, 2), /*!< Generic status for read only failure. */ - kStatus_OutOfRange = MAKE_STATUS(kStatusGroup_Generic, 3), /*!< Generic status for out of range access. */ - kStatus_InvalidArgument = MAKE_STATUS(kStatusGroup_Generic, 4), /*!< Generic status for invalid argument check. */ - kStatus_Timeout = MAKE_STATUS(kStatusGroup_Generic, 5), /*!< Generic status for timeout. */ - kStatus_NoTransferInProgress = - MAKE_STATUS(kStatusGroup_Generic, 6), /*!< Generic status for no transfer in progress. */ - kStatus_Busy = MAKE_STATUS(kStatusGroup_Generic, 7), /*!< Generic status for module is busy. */ - kStatus_NoData = - MAKE_STATUS(kStatusGroup_Generic, 8), /*!< Generic status for no data is found for the operation. */ -}; - -/*! @brief Type used for all status and error return values. */ -typedef int32_t status_t; - -#ifdef __ZEPHYR__ -#include -#else -/*! - * @name Min/max macros - * @{ - */ -#if !defined(MIN) -/*! Computes the minimum of \a a and \a b. */ -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - -#if !defined(MAX) -/*! Computes the maximum of \a a and \a b. */ -#define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif -/*! @} */ - -/*! @brief Computes the number of elements in an array. */ -#if !defined(ARRAY_SIZE) -#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) -#endif -#endif /* __ZEPHYR__ */ - -/*! @name UINT16_MAX/UINT32_MAX value */ -/*! @{ */ -#if !defined(UINT16_MAX) -/*! Max value of uint16_t type. */ -#define UINT16_MAX ((uint16_t)-1) -#endif - -#if !defined(UINT32_MAX) -/*! Max value of uint32_t type. */ -#define UINT32_MAX ((uint32_t)-1) -#endif -/*! @} */ - -/*! Macro to get upper 32 bits of a 64-bit value */ -#if !defined(UINT64_H) -#define UINT64_H(X) ((uint32_t)((((uint64_t) (X)) >> 32U) & 0x0FFFFFFFFULL)) -#endif - -/*! Macro to get lower 32 bits of a 64-bit value */ -#if !defined(UINT64_L) -#define UINT64_L(X) ((uint32_t)(((uint64_t) (X)) & 0x0FFFFFFFFULL)) -#endif - -/*! - * @def SUPPRESS_FALL_THROUGH_WARNING() - * - * For switch case code block, if case section ends without "break;" statement, there wil be - * fallthrough warning with compiler flag -Wextra or -Wimplicit-fallthrough=n when using armgcc. - * To suppress this warning, "SUPPRESS_FALL_THROUGH_WARNING();" need to be added at the end of each - * case section which misses "break;"statement. - */ -#if defined(__GNUC__) && !defined(__ARMCC_VERSION) -#define SUPPRESS_FALL_THROUGH_WARNING() __attribute__((fallthrough)) -#else -#define SUPPRESS_FALL_THROUGH_WARNING() -#endif - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -#if !((defined(__DSC__) && defined(__CW__))) -/*! - * @brief Allocate memory with given alignment and aligned size. - * - * This is provided to support the dynamically allocated memory - * used in cache-able region. - * @param size The length required to malloc. - * @param alignbytes The alignment size. - * @retval The allocated memory. - */ -void *SDK_Malloc(size_t size, size_t alignbytes); - -/*! - * @brief Free memory. - * - * @param ptr The memory to be release. - */ -void SDK_Free(void *ptr); -#endif - -/*! - * @brief Delay at least for some time. - * Please note that, this API uses while loop for delay, different run-time environments make the time not precise, - * if precise delay count was needed, please implement a new delay function with hardware timer. - * - * @param delayTime_us Delay time in unit of microsecond. - * @param coreClock_Hz Core clock frequency with Hz. - */ -void SDK_DelayAtLeastUs(uint32_t delayTime_us, uint32_t coreClock_Hz); - -#if defined(__cplusplus) -} -#endif - -/*! @} */ - -#if (defined(__DSC__) && defined(__CW__)) -#include "fsl_common_dsc.h" -#elif defined(__XTENSA__) -#include "fsl_common_dsp.h" -#else -#include "fsl_common_arm.h" -#endif - -#endif /* FSL_COMMON_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_common_arm.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_common_arm.c deleted file mode 100644 index e9f32aadf4a..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_common_arm.c +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_common.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.common_arm" -#endif - -#ifndef __GIC_PRIO_BITS -#if defined(ENABLE_RAM_VECTOR_TABLE) -uint32_t InstallIRQHandler(IRQn_Type irq, uint32_t irqHandler) -{ -#ifdef __VECTOR_TABLE -#undef __VECTOR_TABLE -#endif - -/* Addresses for VECTOR_TABLE and VECTOR_RAM come from the linker file */ -#if defined(__CC_ARM) || defined(__ARMCC_VERSION) - extern uint32_t Image$$VECTOR_ROM$$Base[]; - extern uint32_t Image$$VECTOR_RAM$$Base[]; - extern uint32_t Image$$VECTOR_RAM$$ZI$$Limit[]; - -#define __VECTOR_TABLE Image$$VECTOR_ROM$$Base -#define __VECTOR_RAM Image$$VECTOR_RAM$$Base -#define __RAM_VECTOR_TABLE_SIZE (((uint32_t)Image$$VECTOR_RAM$$ZI$$Limit - (uint32_t)Image$$VECTOR_RAM$$Base)) -#elif defined(__ICCARM__) - extern uint32_t __RAM_VECTOR_TABLE_SIZE[]; - extern uint32_t __VECTOR_TABLE[]; - extern uint32_t __VECTOR_RAM[]; -#elif defined(__GNUC__) - extern uint32_t __VECTOR_TABLE[]; - extern uint32_t __VECTOR_RAM[]; - extern uint32_t __RAM_VECTOR_TABLE_SIZE_BYTES[]; - uint32_t __RAM_VECTOR_TABLE_SIZE = (uint32_t)(__RAM_VECTOR_TABLE_SIZE_BYTES); -#endif /* defined(__CC_ARM) || defined(__ARMCC_VERSION) */ - uint32_t n; - uint32_t ret; - uint32_t irqMaskValue; - - irqMaskValue = DisableGlobalIRQ(); - if (SCB->VTOR != (uint32_t)__VECTOR_RAM) - { - /* Copy the vector table from ROM to RAM */ - for (n = 0; n < ((uint32_t)__RAM_VECTOR_TABLE_SIZE) / sizeof(uint32_t); n++) - { - __VECTOR_RAM[n] = __VECTOR_TABLE[n]; - } - /* Point the VTOR to the position of vector table */ - SCB->VTOR = (uint32_t)__VECTOR_RAM; - } - - ret = __VECTOR_RAM[(int32_t)irq + 16]; - /* make sure the __VECTOR_RAM is noncachable */ - __VECTOR_RAM[(int32_t)irq + 16] = irqHandler; - - EnableGlobalIRQ(irqMaskValue); - - return ret; -} -#endif /* ENABLE_RAM_VECTOR_TABLE. */ -#endif /* __GIC_PRIO_BITS. */ - -#if (defined(FSL_FEATURE_SOC_SYSCON_COUNT) && (FSL_FEATURE_SOC_SYSCON_COUNT > 0)) - -/* - * When FSL_FEATURE_POWERLIB_EXTEND is defined to non-zero value, - * powerlib should be used instead of these functions. - */ -#if !(defined(FSL_FEATURE_POWERLIB_EXTEND) && (FSL_FEATURE_POWERLIB_EXTEND != 0)) - -/* - * When the SYSCON STARTER registers are discontinuous, these functions are - * implemented in fsl_power.c. - */ -#if !(defined(FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS) && FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS) - -void EnableDeepSleepIRQ(IRQn_Type interrupt) -{ - uint32_t intNumber = (uint32_t)interrupt; - - uint32_t index = 0; - - while (intNumber >= 32u) - { - index++; - intNumber -= 32u; - } - - SYSCON->STARTERSET[index] = 1UL << intNumber; - (void)EnableIRQ(interrupt); /* also enable interrupt at NVIC */ -} - -void DisableDeepSleepIRQ(IRQn_Type interrupt) -{ - uint32_t intNumber = (uint32_t)interrupt; - - (void)DisableIRQ(interrupt); /* also disable interrupt at NVIC */ - uint32_t index = 0; - - while (intNumber >= 32u) - { - index++; - intNumber -= 32u; - } - - SYSCON->STARTERCLR[index] = 1UL << intNumber; -} -#endif /* FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS */ -#endif /* FSL_FEATURE_POWERLIB_EXTEND */ -#endif /* FSL_FEATURE_SOC_SYSCON_COUNT */ - -#if defined(DWT) -/* Use WDT. */ -void MSDK_EnableCpuCycleCounter(void) -{ - /* Make sure the DWT trace fucntion is enabled. */ - if (CoreDebug_DEMCR_TRCENA_Msk != (CoreDebug_DEMCR_TRCENA_Msk & CoreDebug->DEMCR)) - { - CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; - } - - /* CYCCNT not supported on this device. */ - assert(DWT_CTRL_NOCYCCNT_Msk != (DWT->CTRL & DWT_CTRL_NOCYCCNT_Msk)); - - /* Read CYCCNT directly if CYCCENT has already been enabled, otherwise enable CYCCENT first. */ - if (DWT_CTRL_CYCCNTENA_Msk != (DWT_CTRL_CYCCNTENA_Msk & DWT->CTRL)) - { - DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk; - } -} - -uint32_t MSDK_GetCpuCycleCount(void) -{ - return DWT->CYCCNT; -} -#endif /* defined(DWT) */ - -#if !(defined(SDK_DELAY_USE_DWT) && defined(DWT)) -/* Use software loop. */ -#if defined(__CC_ARM) /* This macro is arm v5 specific */ -/* clang-format off */ -__ASM static void DelayLoop(uint32_t count) -{ -loop - SUBS R0, R0, #1 - CMP R0, #0 - BNE loop - BX LR -} -#elif defined(__ARM_ARCH_8A__) /* This macro is ARMv8-A specific */ -static void DelayLoop(uint32_t count) -{ - __ASM volatile(" MOV X0, %0" : : "r"(count)); - __ASM volatile( - "loop%=: \n" - " SUB X0, X0, #1 \n" - " CMP X0, #0 \n" - - " BNE loop%= \n" - : - : - : "r0"); -} -/* clang-format on */ -#elif defined(__ARMCC_VERSION) || defined(__ICCARM__) || defined(__GNUC__) -/* Cortex-M0 has a smaller instruction set, SUBS isn't supported in thumb-16 mode reported from __GNUC__ compiler, - * use SUB and CMP here for compatibility */ -static void DelayLoop(uint32_t count) -{ - __ASM volatile(" MOV R0, %0" : : "r"(count)); - __ASM volatile( - "loop%=: \n" -#if defined(__GNUC__) && !defined(__ARMCC_VERSION) - " SUB R0, R0, #1 \n" -#else - " SUBS R0, R0, #1 \n" -#endif - " CMP R0, #0 \n" - - " BNE loop%= \n" - : - : - : "r0"); -} -#endif /* defined(__CC_ARM) */ -#endif /* defined(SDK_DELAY_USE_DWT) && defined(DWT) */ - -/*! - * @brief Delay at least for some time. - * Please note that, if not uses DWT, this API will use while loop for delay, different run-time environments have - * effect on the delay time. If precise delay is needed, please enable DWT delay. The two parmeters delayTime_us and - * coreClock_Hz have limitation. For example, in the platform with 1GHz coreClock_Hz, the delayTime_us only supports - * up to 4294967 in current code. If long time delay is needed, please implement a new delay function. - * - * @param delayTime_us Delay time in unit of microsecond. - * @param coreClock_Hz Core clock frequency with Hz. - */ -void SDK_DelayAtLeastUs(uint32_t delayTime_us, uint32_t coreClock_Hz) -{ - uint64_t count; - - if (delayTime_us > 0U) - { - count = USEC_TO_COUNT(delayTime_us, coreClock_Hz); - - assert(count <= UINT32_MAX); - -#if defined(SDK_DELAY_USE_DWT) && defined(DWT) /* Use DWT for better accuracy */ - - MSDK_EnableCpuCycleCounter(); - /* Calculate the count ticks. */ - count += MSDK_GetCpuCycleCount(); - - if (count > UINT32_MAX) - { - count -= UINT32_MAX; - /* Wait for cyccnt overflow. */ - while (count < MSDK_GetCpuCycleCount()) - { - } - } - - /* Wait for cyccnt reach count value. */ - while (count > MSDK_GetCpuCycleCount()) - { - } -#else -#if defined(__CORTEX_Axx) && ((__CORTEX_Axx == 53) || (__CORTEX_Axx == 55)) - /* - * Cortex-A53/A55 execution throughput: - * - SUB/CMP: 2 instructions per cycle - * - BNE: 1 instruction per cycle - * So, each loop takes 2 CPU cycles. - */ - count = count / 2U; -#elif (__CORTEX_M == 7) - /* Divide value may be different in various environment to ensure delay is precise. - * Every loop count includes three instructions, due to Cortex-M7 sometimes executes - * two instructions in one period, through test here set divide 1.5. Other M cores use - * divide 4. By the way, divide 1.5 or 4 could let the count lose precision, but it does - * not matter because other instructions outside while loop is enough to fill the time. - */ - count = count / 3U * 2U; -#else - count = count / 4U; -#endif - DelayLoop((uint32_t)count); -#endif /* defined(SDK_DELAY_USE_DWT) && defined(DWT) */ - } -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_common_arm.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_common_arm.h deleted file mode 100644 index 3d35d76f812..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_common_arm.h +++ /dev/null @@ -1,898 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_COMMON_ARM_H_ -#define FSL_COMMON_ARM_H_ - -/* - * For CMSIS pack RTE. - * CMSIS pack RTE generates "RTC_Components.h" which contains the statements - * of the related element for all selected software components. - */ -#ifdef _RTE_ -#include "RTE_Components.h" -#endif - -/*! - * @addtogroup ksdk_common - * @{ - */ - -/*! @name Atomic modification - * - * These macros are used for atomic access, such as read-modify-write - * to the peripheral registers. - * - * Take @ref SDK_ATOMIC_LOCAL_CLEAR_AND_SET as an example: the parameter @c addr - * means the address of the peripheral register or variable you want to modify - * atomically, the parameter @c clearBits is the bits to clear, the parameter - * @c setBits it the bits to set. - * For example, to set a 32-bit register bit1:bit0 to 0b10, use like this: - * - * @code - volatile uint32_t * reg = (volatile uint32_t *)REG_ADDR; - - SDK_ATOMIC_LOCAL_CLEAR_AND_SET(reg, 0x03, 0x02); - @endcode - * - * In this example, the register bit1:bit0 are cleared and bit1 is set, as a result, - * register bit1:bit0 = 0b10. - * - * @note For the platforms don't support exclusive load and store, these macros - * disable the global interrupt to pretect the modification. - * - * @note These macros only guarantee the local processor atomic operations. For - * the multi-processor devices, use hardware semaphore such as SEMA42 to - * guarantee exclusive access if necessary. - * - * @{ - */ - -/*! - * @def SDK_ATOMIC_LOCAL_ADD(addr, val) - * Add value \a val from the variable at address \a address. - * - * @def SDK_ATOMIC_LOCAL_SUB(addr, val) - * Subtract value \a val to the variable at address \a address. - * - * @def SDK_ATOMIC_LOCAL_SET(addr, bits) - * Set the bits specifiled by \a bits to the variable at address \a address. - * - * @def SDK_ATOMIC_LOCAL_CLEAR(addr, bits) - * Clear the bits specifiled by \a bits to the variable at address \a address. - * - * @def SDK_ATOMIC_LOCAL_TOGGLE(addr, bits) - * Toggle the bits specifiled by \a bits to the variable at address \a address. - * - * @def SDK_ATOMIC_LOCAL_CLEAR_AND_SET(addr, clearBits, setBits) - * For the variable at address \a address, clear the bits specifiled by \a clearBits - * and set the bits specifiled by \a setBits. - */ - -/* clang-format off */ -#if ((defined(__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined(__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined(__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined(__ARM_ARCH_8M_BASE__) && (__ARM_ARCH_8M_BASE__ == 1))) -/* clang-format on */ - -/* If the LDREX and STREX are supported, use them. */ -#define _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, val, ops) \ - do \ - { \ - (val) = __LDREXB(addr); \ - (ops); \ - } while (0UL != __STREXB((val), (addr))) - -#define _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, val, ops) \ - do \ - { \ - (val) = __LDREXH(addr); \ - (ops); \ - } while (0UL != __STREXH((val), (addr))) - -#define _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, val, ops) \ - do \ - { \ - (val) = __LDREXW(addr); \ - (ops); \ - } while (0UL != __STREXW((val), (addr))) - -static inline void _SDK_AtomicLocalAdd1Byte(volatile uint8_t *addr, uint8_t val) -{ - uint8_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, s_val, s_val += val); -} - -static inline void _SDK_AtomicLocalAdd2Byte(volatile uint16_t *addr, uint16_t val) -{ - uint16_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, s_val, s_val += val); -} - -static inline void _SDK_AtomicLocalAdd4Byte(volatile uint32_t *addr, uint32_t val) -{ - uint32_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, s_val, s_val += val); -} - -static inline void _SDK_AtomicLocalSub1Byte(volatile uint8_t *addr, uint8_t val) -{ - uint8_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, s_val, s_val -= val); -} - -static inline void _SDK_AtomicLocalSub2Byte(volatile uint16_t *addr, uint16_t val) -{ - uint16_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, s_val, s_val -= val); -} - -static inline void _SDK_AtomicLocalSub4Byte(volatile uint32_t *addr, uint32_t val) -{ - uint32_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, s_val, s_val -= val); -} - -static inline void _SDK_AtomicLocalSet1Byte(volatile uint8_t *addr, uint8_t bits) -{ - uint8_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, s_val, s_val |= bits); -} - -static inline void _SDK_AtomicLocalSet2Byte(volatile uint16_t *addr, uint16_t bits) -{ - uint16_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, s_val, s_val |= bits); -} - -static inline void _SDK_AtomicLocalSet4Byte(volatile uint32_t *addr, uint32_t bits) -{ - uint32_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, s_val, s_val |= bits); -} - -static inline void _SDK_AtomicLocalClear1Byte(volatile uint8_t *addr, uint8_t bits) -{ - uint8_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, s_val, s_val &= ~bits); -} - -static inline void _SDK_AtomicLocalClear2Byte(volatile uint16_t *addr, uint16_t bits) -{ - uint16_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, s_val, s_val &= ~bits); -} - -static inline void _SDK_AtomicLocalClear4Byte(volatile uint32_t *addr, uint32_t bits) -{ - uint32_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, s_val, s_val &= ~bits); -} - -static inline void _SDK_AtomicLocalToggle1Byte(volatile uint8_t *addr, uint8_t bits) -{ - uint8_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, s_val, s_val ^= bits); -} - -static inline void _SDK_AtomicLocalToggle2Byte(volatile uint16_t *addr, uint16_t bits) -{ - uint16_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, s_val, s_val ^= bits); -} - -static inline void _SDK_AtomicLocalToggle4Byte(volatile uint32_t *addr, uint32_t bits) -{ - uint32_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, s_val, s_val ^= bits); -} - -static inline void _SDK_AtomicLocalClearAndSet1Byte(volatile uint8_t *addr, uint8_t clearBits, uint8_t setBits) -{ - uint8_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, s_val, s_val = (s_val & ~clearBits) | setBits); -} - -static inline void _SDK_AtomicLocalClearAndSet2Byte(volatile uint16_t *addr, uint16_t clearBits, uint16_t setBits) -{ - uint16_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, s_val, s_val = (s_val & ~clearBits) | setBits); -} - -static inline void _SDK_AtomicLocalClearAndSet4Byte(volatile uint32_t *addr, uint32_t clearBits, uint32_t setBits) -{ - uint32_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, s_val, s_val = (s_val & ~clearBits) | setBits); -} - -#define SDK_ATOMIC_LOCAL_ADD(addr, val) \ - ((1UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalAdd1Byte((volatile uint8_t *)(volatile void *)(addr), (uint8_t)(val)) : \ - ((2UL == sizeof(*(addr))) ? _SDK_AtomicLocalAdd2Byte((volatile uint16_t *)(volatile void *)(addr), (uint16_t)(val)) : \ - _SDK_AtomicLocalAdd4Byte((volatile uint32_t *)(volatile void *)(addr), (uint32_t)(val)))) - -#define SDK_ATOMIC_LOCAL_SUB(addr, val) \ - ((1UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalSub1Byte((volatile uint8_t *)(volatile void *)(addr), (uint8_t)(val)) : \ - ((2UL == sizeof(*(addr))) ? _SDK_AtomicLocalSub2Byte((volatile uint16_t *)(volatile void *)(addr), (uint16_t)(val)) : \ - _SDK_AtomicLocalSub4Byte((volatile uint32_t *)(volatile void *)(addr), (uint32_t)(val)))) - -#define SDK_ATOMIC_LOCAL_SET(addr, bits) \ - ((1UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalSet1Byte((volatile uint8_t *)(volatile void *)(addr), (uint8_t)(bits)) : \ - ((2UL == sizeof(*(addr))) ? _SDK_AtomicLocalSet2Byte((volatile uint16_t *)(volatile void *)(addr), (uint16_t)(bits)) : \ - _SDK_AtomicLocalSet4Byte((volatile uint32_t *)(volatile void *)(addr), (uint32_t)(bits)))) - -#define SDK_ATOMIC_LOCAL_CLEAR(addr, bits) \ - ((1UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalClear1Byte((volatile uint8_t *)(volatile void *)(addr), (uint8_t)(bits)) : \ - ((2UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalClear2Byte((volatile uint16_t *)(volatile void *)(addr), (uint16_t)(bits)) : \ - _SDK_AtomicLocalClear4Byte((volatile uint32_t *)(volatile void *)(addr), (uint32_t)(bits)))) - -#define SDK_ATOMIC_LOCAL_TOGGLE(addr, bits) \ - ((1UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalToggle1Byte((volatile uint8_t *)(volatile void *)(addr), (uint8_t)(bits)) : \ - ((2UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalToggle2Byte((volatile uint16_t *)(volatile void *)(addr), (uint16_t)(bits)) : \ - _SDK_AtomicLocalToggle4Byte((volatile uint32_t *)(volatile void *)(addr), (uint32_t)(bits)))) - -#define SDK_ATOMIC_LOCAL_CLEAR_AND_SET(addr, clearBits, setBits) \ - ((1UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalClearAndSet1Byte((volatile uint8_t *)(volatile void *)(addr), (uint8_t)(clearBits), (uint8_t)(setBits)) : \ - ((2UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalClearAndSet2Byte((volatile uint16_t *)(volatile void *)(addr), (uint16_t)(clearBits), (uint16_t)(setBits)) : \ - _SDK_AtomicLocalClearAndSet4Byte((volatile uint32_t *)(volatile void *)(addr), (uint32_t)(clearBits), (uint32_t)(setBits)))) -#else - -#define SDK_ATOMIC_LOCAL_ADD(addr, val) \ - do \ - { \ - uint32_t s_atomicOldInt; \ - s_atomicOldInt = DisableGlobalIRQ(); \ - *(addr) += (val); \ - EnableGlobalIRQ(s_atomicOldInt); \ - } while (false) - -#define SDK_ATOMIC_LOCAL_SUB(addr, val) \ - do \ - { \ - uint32_t s_atomicOldInt; \ - s_atomicOldInt = DisableGlobalIRQ(); \ - *(addr) -= (val); \ - EnableGlobalIRQ(s_atomicOldInt); \ - } while (false) - -#define SDK_ATOMIC_LOCAL_SET(addr, bits) \ - do \ - { \ - uint32_t s_atomicOldInt; \ - s_atomicOldInt = DisableGlobalIRQ(); \ - *(addr) |= (bits); \ - EnableGlobalIRQ(s_atomicOldInt); \ - } while (false) - -#define SDK_ATOMIC_LOCAL_CLEAR(addr, bits) \ - do \ - { \ - uint32_t s_atomicOldInt; \ - s_atomicOldInt = DisableGlobalIRQ(); \ - *(addr) &= ~(bits); \ - EnableGlobalIRQ(s_atomicOldInt); \ - } while (false) - -#define SDK_ATOMIC_LOCAL_TOGGLE(addr, bits) \ - do \ - { \ - uint32_t s_atomicOldInt; \ - s_atomicOldInt = DisableGlobalIRQ(); \ - *(addr) ^= (bits); \ - EnableGlobalIRQ(s_atomicOldInt); \ - } while (false) - -#define SDK_ATOMIC_LOCAL_CLEAR_AND_SET(addr, clearBits, setBits) \ - do \ - { \ - uint32_t s_atomicOldInt; \ - s_atomicOldInt = DisableGlobalIRQ(); \ - *(addr) = (*(addr) & ~(clearBits)) | (setBits); \ - EnableGlobalIRQ(s_atomicOldInt); \ - } while (false) - -#endif -/*! @} */ - -/*! @name Timer utilities */ -/*! @{ */ -/*! Macro to convert a microsecond period to raw count value */ -#define USEC_TO_COUNT(us, clockFreqInHz) (uint64_t)(((uint64_t)(us) * (clockFreqInHz)) / 1000000U) -/*! Macro to convert a raw count value to microsecond */ -#define COUNT_TO_USEC(count, clockFreqInHz) (uint64_t)((uint64_t)(count)*1000000U / (clockFreqInHz)) - -/*! Macro to convert a millisecond period to raw count value */ -#define MSEC_TO_COUNT(ms, clockFreqInHz) (uint64_t)((uint64_t)(ms) * (clockFreqInHz) / 1000U) -/*! Macro to convert a raw count value to millisecond */ -#define COUNT_TO_MSEC(count, clockFreqInHz) (uint64_t)((uint64_t)(count)*1000U / (clockFreqInHz)) -/*! @} */ - -/*! @name ISR exit barrier - * @{ - * - * ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping - * exception return operation might vector to incorrect interrupt. - * For Cortex-M7, if core speed much faster than peripheral register write speed, - * the peripheral interrupt flags may be still set after exiting ISR, this results to - * the same error similar with errata 83869. - */ -#if (defined __CORTEX_M) && ((__CORTEX_M == 4U) || (__CORTEX_M == 7U)) -#define SDK_ISR_EXIT_BARRIER __DSB() -#else -#define SDK_ISR_EXIT_BARRIER -#endif - -/*! @} */ - -/*! @name Alignment variable definition macros */ -/*! @{ */ -#if (defined(__ICCARM__)) -/* - * Workaround to disable MISRA C message suppress warnings for IAR compiler. - * http:/ /supp.iar.com/Support/?note=24725 - */ -_Pragma("diag_suppress=Pm120") -#define SDK_PRAGMA(x) _Pragma(#x) - _Pragma("diag_error=Pm120") -/*! Macro to define a variable with alignbytes alignment */ -#define SDK_ALIGN(var, alignbytes) SDK_PRAGMA(data_alignment = alignbytes) var -#elif defined(__CC_ARM) || defined(__ARMCC_VERSION) -/*! Macro to define a variable with alignbytes alignment */ -#define SDK_ALIGN(var, alignbytes) __attribute__((aligned(alignbytes))) var -#elif defined(__GNUC__) || defined(DOXYGEN_OUTPUT) -/*! Macro to define a variable with alignbytes alignment */ -#define SDK_ALIGN(var, alignbytes) var __attribute__((aligned(alignbytes))) -#else -#error Toolchain not supported -#endif - -/*! Macro to define a variable with L1 d-cache line size alignment */ -#if defined(FSL_FEATURE_L1DCACHE_LINESIZE_BYTE) -#define SDK_L1DCACHE_ALIGN(var) SDK_ALIGN(var, FSL_FEATURE_L1DCACHE_LINESIZE_BYTE) -#endif -/*! Macro to define a variable with L2 cache line size alignment */ -#if defined(FSL_FEATURE_L2CACHE_LINESIZE_BYTE) -#define SDK_L2CACHE_ALIGN(var) SDK_ALIGN(var, FSL_FEATURE_L2CACHE_LINESIZE_BYTE) -#endif - -/*! Macro to change a value to a given size aligned value */ -#define SDK_SIZEALIGN(var, alignbytes) \ - ((unsigned int)((var) + ((alignbytes)-1U)) & (unsigned int)(~(unsigned int)((alignbytes)-1U))) -/*! @} */ - -/*! - * @name Non-cacheable region definition macros - * - * For initialized non-zero non-cacheable variables, please use "AT_NONCACHEABLE_SECTION_INIT(var) ={xx};" or - * "AT_NONCACHEABLE_SECTION_ALIGN_INIT(var) ={xx};" in your projects to define them. For zero-inited non-cacheable - * variables, please use "AT_NONCACHEABLE_SECTION(var);" or "AT_NONCACHEABLE_SECTION_ALIGN(var);" to define them, - * these zero-inited variables will be initialized to zero in system startup. - * - * @note For GCC, when the non-cacheable section is required, please define "__STARTUP_INITIALIZE_NONCACHEDATA" - * in your projects to make sure the non-cacheable section variables will be initialized in system startup. - * - * @{ - */ - -/*! - * @def AT_NONCACHEABLE_SECTION(var) - * Define a variable \a var, and place it in non-cacheable section. - * - * @def AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) - * Define a variable \a var, and place it in non-cacheable section, the start address - * of the variable is aligned to \a alignbytes. - * - * @def AT_NONCACHEABLE_SECTION_INIT(var) - * Define a variable \a var with initial value, and place it in non-cacheable section. - * - * @def AT_NONCACHEABLE_SECTION_ALIGN_INIT(var, alignbytes) - * Define a variable \a var with initial value, and place it in non-cacheable section, - * the start address of the variable is aligned to \a alignbytes. - */ - -#if ((!(defined(FSL_FEATURE_HAS_NO_NONCACHEABLE_SECTION) && FSL_FEATURE_HAS_NO_NONCACHEABLE_SECTION)) && \ - defined(FSL_FEATURE_L1ICACHE_LINESIZE_BYTE)) - -#if (defined(__ICCARM__)) -#define AT_NONCACHEABLE_SECTION(var) var @"NonCacheable" -#define AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) SDK_PRAGMA(data_alignment = alignbytes) var @"NonCacheable" -#define AT_NONCACHEABLE_SECTION_INIT(var) var @"NonCacheable.init" -#define AT_NONCACHEABLE_SECTION_ALIGN_INIT(var, alignbytes) \ - SDK_PRAGMA(data_alignment = alignbytes) var @"NonCacheable.init" - -#elif (defined(__CC_ARM) || defined(__ARMCC_VERSION)) -#define AT_NONCACHEABLE_SECTION_INIT(var) __attribute__((section("NonCacheable.init"))) var -#define AT_NONCACHEABLE_SECTION_ALIGN_INIT(var, alignbytes) \ - __attribute__((section("NonCacheable.init"))) __attribute__((aligned(alignbytes))) var -#if (defined(__CC_ARM)) -#define AT_NONCACHEABLE_SECTION(var) __attribute__((section("NonCacheable"), zero_init)) var -#define AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) \ - __attribute__((section("NonCacheable"), zero_init)) __attribute__((aligned(alignbytes))) var -#else -#define AT_NONCACHEABLE_SECTION(var) __attribute__((section(".bss.NonCacheable"))) var -#define AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) \ - __attribute__((section(".bss.NonCacheable"))) __attribute__((aligned(alignbytes))) var -#endif - -#elif (defined(__GNUC__)) || defined(DOXYGEN_OUTPUT) -/* For GCC, when the non-cacheable section is required, please define "__STARTUP_INITIALIZE_NONCACHEDATA" - * in your projects to make sure the non-cacheable section variables will be initialized in system startup. - */ -#define AT_NONCACHEABLE_SECTION_INIT(var) __attribute__((section("NonCacheable.init"))) var -#define AT_NONCACHEABLE_SECTION_ALIGN_INIT(var, alignbytes) \ - __attribute__((section("NonCacheable.init"))) var __attribute__((aligned(alignbytes))) -#define AT_NONCACHEABLE_SECTION(var) __attribute__((section("NonCacheable,\"aw\",%nobits @"))) var -#define AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) \ - __attribute__((section("NonCacheable,\"aw\",%nobits @"))) var __attribute__((aligned(alignbytes))) -#else -#error Toolchain not supported. -#endif - -#else - -#define AT_NONCACHEABLE_SECTION(var) var -#define AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) SDK_ALIGN(var, alignbytes) -#define AT_NONCACHEABLE_SECTION_INIT(var) var -#define AT_NONCACHEABLE_SECTION_ALIGN_INIT(var, alignbytes) SDK_ALIGN(var, alignbytes) - -#endif - -/*! @} */ - -/*! - * @name Time sensitive region - * @{ - */ - -/*! - * @def AT_QUICKACCESS_SECTION_CODE(func) - * Place function in a section which can be accessed quickly by core. - * - * @def AT_QUICKACCESS_SECTION_DATA(var) - * Place data in a section which can be accessed quickly by core. - * - * @def AT_QUICKACCESS_SECTION_DATA_ALIGN(var, alignbytes) - * Place data in a section which can be accessed quickly by core, and the variable - * address is set to align with \a alignbytes. - */ -#if (defined(__ICCARM__)) -#define AT_QUICKACCESS_SECTION_CODE(func) func @"CodeQuickAccess" -#define AT_QUICKACCESS_SECTION_DATA(var) var @"DataQuickAccess" -#define AT_QUICKACCESS_SECTION_DATA_ALIGN(var, alignbytes) \ - SDK_PRAGMA(data_alignment = alignbytes) var @"DataQuickAccess" -#elif (defined(__CC_ARM) || defined(__ARMCC_VERSION)) -#define AT_QUICKACCESS_SECTION_CODE(func) __attribute__((section("CodeQuickAccess"), __noinline__)) func -#define AT_QUICKACCESS_SECTION_DATA(var) __attribute__((section("DataQuickAccess"))) var -#define AT_QUICKACCESS_SECTION_DATA_ALIGN(var, alignbytes) \ - __attribute__((section("DataQuickAccess"))) __attribute__((aligned(alignbytes))) var -#elif (defined(__GNUC__)) || defined(DOXYGEN_OUTPUT) -#define AT_QUICKACCESS_SECTION_CODE(func) __attribute__((section("CodeQuickAccess"), __noinline__)) func -#define AT_QUICKACCESS_SECTION_DATA(var) __attribute__((section("DataQuickAccess"))) var -#define AT_QUICKACCESS_SECTION_DATA_ALIGN(var, alignbytes) \ - __attribute__((section("DataQuickAccess"))) var __attribute__((aligned(alignbytes))) -#else -#error Toolchain not supported. -#endif /* defined(__ICCARM__) */ -/*! @} */ - -/*! - * @name Ram Function - * @{ - * - * @def RAMFUNCTION_SECTION_CODE(func) - * Place function in ram. - */ -#if (defined(__ICCARM__)) -#define RAMFUNCTION_SECTION_CODE(func) func @"RamFunction" -#elif (defined(__CC_ARM) || defined(__ARMCC_VERSION)) -#define RAMFUNCTION_SECTION_CODE(func) __attribute__((section("RamFunction"))) func -#elif (defined(__GNUC__)) || defined(DOXYGEN_OUTPUT) -#define RAMFUNCTION_SECTION_CODE(func) __attribute__((section("RamFunction"))) func -#else -#error Toolchain not supported. -#endif /* defined(__ICCARM__) */ -/*! @} */ - -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - void DefaultISR(void); -#endif - -/* - * The fsl_clock.h is included here because it needs MAKE_VERSION/MAKE_STATUS/status_t - * defined in previous of this file. - */ -#include "fsl_clock.h" - -/* - * Chip level peripheral reset API, for MCUs that implement peripheral reset control external to a peripheral - */ -#if ((defined(FSL_FEATURE_SOC_SYSCON_COUNT) && (FSL_FEATURE_SOC_SYSCON_COUNT > 0)) || \ - (defined(FSL_FEATURE_SOC_ASYNC_SYSCON_COUNT) && (FSL_FEATURE_SOC_ASYNC_SYSCON_COUNT > 0))) -#include "fsl_reset.h" -#endif - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus*/ - -/*! - * @brief Enable specific interrupt. - * - * Enable LEVEL1 interrupt. For some devices, there might be multiple interrupt - * levels. For example, there are NVIC and intmux. Here the interrupts connected - * to NVIC are the LEVEL1 interrupts, because they are routed to the core directly. - * The interrupts connected to intmux are the LEVEL2 interrupts, they are routed - * to NVIC first then routed to core. - * - * This function only enables the LEVEL1 interrupts. The number of LEVEL1 interrupts - * is indicated by the feature macro FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS. - * - * @param interrupt The IRQ number. - * @retval kStatus_Success Interrupt enabled successfully - * @retval kStatus_Fail Failed to enable the interrupt - */ -static inline status_t EnableIRQ(IRQn_Type interrupt) -{ - status_t status = kStatus_Success; - - if (NotAvail_IRQn == interrupt) - { - status = kStatus_Fail; - } - -#if defined(FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) && (FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS > 0) - else if ((int32_t)interrupt >= (int32_t)FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) - { - status = kStatus_Fail; - } -#endif - - else - { -#if defined(__GIC_PRIO_BITS) - GIC_EnableIRQ(interrupt); -#else - NVIC_EnableIRQ(interrupt); -#endif - } - - return status; -} - -/*! - * @brief Disable specific interrupt. - * - * Disable LEVEL1 interrupt. For some devices, there might be multiple interrupt - * levels. For example, there are NVIC and intmux. Here the interrupts connected - * to NVIC are the LEVEL1 interrupts, because they are routed to the core directly. - * The interrupts connected to intmux are the LEVEL2 interrupts, they are routed - * to NVIC first then routed to core. - * - * This function only disables the LEVEL1 interrupts. The number of LEVEL1 interrupts - * is indicated by the feature macro FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS. - * - * @param interrupt The IRQ number. - * @retval kStatus_Success Interrupt disabled successfully - * @retval kStatus_Fail Failed to disable the interrupt - */ -static inline status_t DisableIRQ(IRQn_Type interrupt) -{ - status_t status = kStatus_Success; - - if (NotAvail_IRQn == interrupt) - { - status = kStatus_Fail; - } - -#if defined(FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) && (FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS > 0) - else if ((int32_t)interrupt >= (int32_t)FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) - { - status = kStatus_Fail; - } -#endif - - else - { -#if defined(__GIC_PRIO_BITS) - GIC_DisableIRQ(interrupt); -#else - NVIC_DisableIRQ(interrupt); -#endif - } - - return status; -} - -/*! - * @brief Enable the IRQ, and also set the interrupt priority. - * - * Only handle LEVEL1 interrupt. For some devices, there might be multiple interrupt - * levels. For example, there are NVIC and intmux. Here the interrupts connected - * to NVIC are the LEVEL1 interrupts, because they are routed to the core directly. - * The interrupts connected to intmux are the LEVEL2 interrupts, they are routed - * to NVIC first then routed to core. - * - * This function only handles the LEVEL1 interrupts. The number of LEVEL1 interrupts - * is indicated by the feature macro FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS. - * - * @param interrupt The IRQ to Enable. - * @param priNum Priority number set to interrupt controller register. - * @retval kStatus_Success Interrupt priority set successfully - * @retval kStatus_Fail Failed to set the interrupt priority. - */ -static inline status_t EnableIRQWithPriority(IRQn_Type interrupt, uint8_t priNum) -{ - status_t status = kStatus_Success; - - if (NotAvail_IRQn == interrupt) - { - status = kStatus_Fail; - } - -#if defined(FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) && (FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS > 0) - else if ((int32_t)interrupt >= (int32_t)FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) - { - status = kStatus_Fail; - } -#endif - - else - { -#if defined(__GIC_PRIO_BITS) - GIC_SetPriority(interrupt, priNum); - GIC_EnableIRQ(interrupt); -#else - NVIC_SetPriority(interrupt, priNum); - NVIC_EnableIRQ(interrupt); -#endif - } - - return status; -} - -/*! - * @brief Set the IRQ priority. - * - * Only handle LEVEL1 interrupt. For some devices, there might be multiple interrupt - * levels. For example, there are NVIC and intmux. Here the interrupts connected - * to NVIC are the LEVEL1 interrupts, because they are routed to the core directly. - * The interrupts connected to intmux are the LEVEL2 interrupts, they are routed - * to NVIC first then routed to core. - * - * This function only handles the LEVEL1 interrupts. The number of LEVEL1 interrupts - * is indicated by the feature macro FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS. - * - * @param interrupt The IRQ to set. - * @param priNum Priority number set to interrupt controller register. - * - * @retval kStatus_Success Interrupt priority set successfully - * @retval kStatus_Fail Failed to set the interrupt priority. - */ -static inline status_t IRQ_SetPriority(IRQn_Type interrupt, uint8_t priNum) -{ - status_t status = kStatus_Success; - - if (NotAvail_IRQn == interrupt) - { - status = kStatus_Fail; - } - -#if defined(FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) && (FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS > 0) - else if ((int32_t)interrupt >= (int32_t)FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) - { - status = kStatus_Fail; - } -#endif - - else - { -#if defined(__GIC_PRIO_BITS) - GIC_SetPriority(interrupt, priNum); -#else - NVIC_SetPriority(interrupt, priNum); -#endif - } - - return status; -} - -/*! - * @brief Clear the pending IRQ flag. - * - * Only handle LEVEL1 interrupt. For some devices, there might be multiple interrupt - * levels. For example, there are NVIC and intmux. Here the interrupts connected - * to NVIC are the LEVEL1 interrupts, because they are routed to the core directly. - * The interrupts connected to intmux are the LEVEL2 interrupts, they are routed - * to NVIC first then routed to core. - * - * This function only handles the LEVEL1 interrupts. The number of LEVEL1 interrupts - * is indicated by the feature macro FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS. - * - * @param interrupt The flag which IRQ to clear. - * - * @retval kStatus_Success Interrupt priority set successfully - * @retval kStatus_Fail Failed to set the interrupt priority. - */ -static inline status_t IRQ_ClearPendingIRQ(IRQn_Type interrupt) -{ - status_t status = kStatus_Success; - - if (NotAvail_IRQn == interrupt) - { - status = kStatus_Fail; - } - -#if defined(FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) && (FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS > 0) - else if ((int32_t)interrupt >= (int32_t)FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) - { - status = kStatus_Fail; - } -#endif - - else - { -#if defined(__GIC_PRIO_BITS) - GIC_ClearPendingIRQ(interrupt); -#else - NVIC_ClearPendingIRQ(interrupt); -#endif - } - - return status; -} - -/*! - * @brief Disable the global IRQ - * - * Disable the global interrupt and return the current primask register. User is required to provided the primask - * register for the EnableGlobalIRQ(). - * - * @return Current primask value. - */ -static inline uint32_t DisableGlobalIRQ(void) -{ - uint32_t mask; - -#if defined(CPSR_I_Msk) - mask = __get_CPSR() & CPSR_I_Msk; -#elif defined(DAIF_I_BIT) - mask = __get_DAIF() & DAIF_I_BIT; -#else - mask = __get_PRIMASK(); -#endif - __disable_irq(); - - return mask; -} - -/*! - * @brief Enable the global IRQ - * - * Set the primask register with the provided primask value but not just enable the primask. The idea is for the - * convenience of integration of RTOS. some RTOS get its own management mechanism of primask. User is required to - * use the EnableGlobalIRQ() and DisableGlobalIRQ() in pair. - * - * @param primask value of primask register to be restored. The primask value is supposed to be provided by the - * DisableGlobalIRQ(). - */ -static inline void EnableGlobalIRQ(uint32_t primask) -{ -#if defined(CPSR_I_Msk) - __set_CPSR((__get_CPSR() & ~CPSR_I_Msk) | primask); -#elif defined(DAIF_I_BIT) - if (0UL == primask) - { - __enable_irq(); - } -#else - __set_PRIMASK(primask); -#endif -} - -#if defined(ENABLE_RAM_VECTOR_TABLE) -/*! - * @brief install IRQ handler - * - * @param irq IRQ number - * @param irqHandler IRQ handler address - * @return The old IRQ handler address - */ -uint32_t InstallIRQHandler(IRQn_Type irq, uint32_t irqHandler); -#endif /* ENABLE_RAM_VECTOR_TABLE. */ - -#if (defined(FSL_FEATURE_SOC_SYSCON_COUNT) && (FSL_FEATURE_SOC_SYSCON_COUNT > 0)) - -/* - * When FSL_FEATURE_POWERLIB_EXTEND is defined to non-zero value, - * powerlib should be used instead of these functions. - */ -#if !(defined(FSL_FEATURE_POWERLIB_EXTEND) && (FSL_FEATURE_POWERLIB_EXTEND != 0)) -/*! - * @brief Enable specific interrupt for wake-up from deep-sleep mode. - * - * Enable the interrupt for wake-up from deep sleep mode. - * Some interrupts are typically used in sleep mode only and will not occur during - * deep-sleep mode because relevant clocks are stopped. However, it is possible to enable - * those clocks (significantly increasing power consumption in the reduced power mode), - * making these wake-ups possible. - * - * @note This function also enables the interrupt in the NVIC (EnableIRQ() is called internaly). - * - * @param interrupt The IRQ number. - */ -void EnableDeepSleepIRQ(IRQn_Type interrupt); - -/*! - * @brief Disable specific interrupt for wake-up from deep-sleep mode. - * - * Disable the interrupt for wake-up from deep sleep mode. - * Some interrupts are typically used in sleep mode only and will not occur during - * deep-sleep mode because relevant clocks are stopped. However, it is possible to enable - * those clocks (significantly increasing power consumption in the reduced power mode), - * making these wake-ups possible. - * - * @note This function also disables the interrupt in the NVIC (DisableIRQ() is called internaly). - * - * @param interrupt The IRQ number. - */ -void DisableDeepSleepIRQ(IRQn_Type interrupt); -#endif /* FSL_FEATURE_POWERLIB_EXTEND */ -#endif /* FSL_FEATURE_SOC_SYSCON_COUNT */ - -#if defined(DWT) -/*! - * @brief Enable the counter to get CPU cycles. - */ -void MSDK_EnableCpuCycleCounter(void); - -/*! - * @brief Get the current CPU cycle count. - * - * @return Current CPU cycle count. - */ -uint32_t MSDK_GetCpuCycleCount(void); -#endif - -#if defined(__cplusplus) -} -#endif /* __cplusplus*/ - -/*! @} */ - -#endif /* FSL_COMMON_ARM_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_crc.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_crc.c deleted file mode 100644 index f4e303be95e..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_crc.c +++ /dev/null @@ -1,371 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2017, 2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#include "fsl_crc.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.crc" -#endif - -/*! @internal @brief Has data register with name CRC. */ -#if defined(FSL_FEATURE_CRC_HAS_CRC_REG) && FSL_FEATURE_CRC_HAS_CRC_REG -#define DATA CRC -#define DATALL CRCLL -#endif - -#if defined(CRC_DRIVER_USE_CRC16_CCIT_FALSE_AS_DEFAULT) && CRC_DRIVER_USE_CRC16_CCIT_FALSE_AS_DEFAULT -/* @brief Default user configuration structure for CRC-16-CCITT */ -#define CRC_DRIVER_DEFAULT_POLYNOMIAL 0x1021U -/*< CRC-16-CCIT polynomial x**16 + x**12 + x**5 + x**0 */ -#define CRC_DRIVER_DEFAULT_SEED 0xFFFFU -/*< Default initial checksum */ -#define CRC_DRIVER_DEFAULT_REFLECT_IN false -/*< Default is no transpose */ -#define CRC_DRIVER_DEFAULT_REFLECT_OUT false -/*< Default is transpose bytes */ -#define CRC_DRIVER_DEFAULT_COMPLEMENT_CHECKSUM false -/*< Default is without complement of CRC data register read data */ -#define CRC_DRIVER_DEFAULT_CRC_BITS kCrcBits16 -/*< Default is 16-bit CRC protocol */ -#define CRC_DRIVER_DEFAULT_CRC_RESULT kCrcFinalChecksum -/*< Default is resutl type is final checksum */ -#endif /* CRC_DRIVER_USE_CRC16_CCIT_FALSE_AS_DEFAULT */ - -#if defined(CRC_RSTS) -#define CRC_RESETS_ARRAY CRC_RSTS -#endif - -/*! @brief CRC type of transpose of read write data */ -typedef enum _crc_transpose_type -{ - kCrcTransposeNone = 0U, /*! No transpose */ - kCrcTransposeBits = 1U, /*! Tranpose bits in bytes */ - kCrcTransposeBitsAndBytes = 2U, /*! Transpose bytes and bits in bytes */ - kCrcTransposeBytes = 3U, /*! Transpose bytes */ -} crc_transpose_type_t; - -/*! - * @brief CRC module configuration. - * - * This structure holds the configuration for the CRC module. - */ -typedef struct _crc_module_config -{ - uint32_t polynomial; /*!< CRC Polynomial, MSBit first.@n - Example polynomial: 0x1021 = 1_0000_0010_0001 = x^12+x^5+1 */ - uint32_t seed; /*!< Starting checksum value */ - crc_transpose_type_t readTranspose; /*!< Type of transpose when reading CRC result. */ - crc_transpose_type_t writeTranspose; /*!< Type of transpose when writing CRC input data. */ - bool complementChecksum; /*!< True if the result shall be complement of the actual checksum. */ - crc_bits_t crcBits; /*!< Selects 16- or 32- bit CRC protocol. */ -} crc_module_config_t; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#if defined(CRC_RESETS_ARRAY) -/*! - * @brief Get instance number for CRC module. - * - * @param base CRC peripheral base address - */ -static uint32_t CRC_GetInstance(CRC_Type *base); -#endif -/******************************************************************************* - * Variables - ******************************************************************************/ -#if defined(CRC_RESETS_ARRAY) -static CRC_Type *const s_crcBases[] = CRC_BASE_PTRS; - -/* Reset array */ -static const reset_ip_name_t s_crcResets[] = CRC_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -#if defined(CRC_RESETS_ARRAY) -static uint32_t CRC_GetInstance(CRC_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_crcBases); instance++) - { - if (s_crcBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_crcBases)); - - return instance; -} -#endif - -/*! - * @brief Returns transpose type for CRC protocol reflect in parameter. - * - * This functions helps to set writeTranspose member of crc_config_t structure. Reflect in is CRC protocol parameter. - * - * @param enable True or false for the selected CRC protocol Reflect In (refin) parameter. - */ -static inline crc_transpose_type_t CRC_GetTransposeTypeFromReflectIn(bool enable) -{ - return ((enable) ? kCrcTransposeBitsAndBytes : kCrcTransposeBytes); -} - -/*! - * @brief Returns transpose type for CRC protocol reflect out parameter. - * - * This functions helps to set readTranspose member of crc_config_t structure. Reflect out is CRC protocol parameter. - * - * @param enable True or false for the selected CRC protocol Reflect Out (refout) parameter. - */ -static inline crc_transpose_type_t CRC_GetTransposeTypeFromReflectOut(bool enable) -{ - return ((enable) ? kCrcTransposeBitsAndBytes : kCrcTransposeNone); -} - -/*! - * @brief Starts checksum computation. - * - * Configures the CRC module for the specified CRC protocol. @n - * Starts the checksum computation by writing the seed value - * - * @param base CRC peripheral address. - * @param config Pointer to protocol configuration structure. - */ -static void CRC_ConfigureAndStart(CRC_Type *base, const crc_module_config_t *config) -{ - uint32_t crcControl; - - /* pre-compute value for CRC control registger based on user configuraton without WAS field */ - crcControl = 0U | CRC_CTRL_TOT(config->writeTranspose) | CRC_CTRL_TOTR(config->readTranspose) | - CRC_CTRL_FXOR(config->complementChecksum) | CRC_CTRL_TCRC(config->crcBits); - - /* make sure the control register is clear - WAS is deasserted, and protocol is set */ - base->CTRL = crcControl; - - /* write polynomial register */ - base->GPOLY = config->polynomial; - - /* write pre-computed control register value along with WAS to start checksum computation */ - base->CTRL = crcControl | CRC_CTRL_WAS(true); - - /* write seed (initial checksum) */ - base->DATA = config->seed; - - /* deassert WAS by writing pre-computed CRC control register value */ - base->CTRL = crcControl; -} - -/*! - * @brief Starts final checksum computation. - * - * Configures the CRC module for the specified CRC protocol. @n - * Starts final checksum computation by writing the seed value. - * @note CRC_Get16bitResult() or CRC_Get32bitResult() return final checksum - * (output reflection and xor functions are applied). - * - * @param base CRC peripheral address. - * @param protocolConfig Pointer to protocol configuration structure. - */ -static void CRC_SetProtocolConfig(CRC_Type *base, const crc_config_t *protocolConfig) -{ - crc_module_config_t moduleConfig; - /* convert protocol to CRC peripheral module configuration, prepare for final checksum */ - moduleConfig.polynomial = protocolConfig->polynomial; - moduleConfig.seed = protocolConfig->seed; - moduleConfig.readTranspose = CRC_GetTransposeTypeFromReflectOut(protocolConfig->reflectOut); - moduleConfig.writeTranspose = CRC_GetTransposeTypeFromReflectIn(protocolConfig->reflectIn); - moduleConfig.complementChecksum = protocolConfig->complementChecksum; - moduleConfig.crcBits = protocolConfig->crcBits; - - CRC_ConfigureAndStart(base, &moduleConfig); -} - -/*! - * @brief Starts intermediate checksum computation. - * - * Configures the CRC module for the specified CRC protocol. @n - * Starts intermediate checksum computation by writing the seed value. - * @note CRC_Get16bitResult() or CRC_Get32bitResult() return intermediate checksum (raw data register value). - * - * @param base CRC peripheral address. - * @param protocolConfig Pointer to protocol configuration structure. - */ -static void CRC_SetRawProtocolConfig(CRC_Type *base, const crc_config_t *protocolConfig) -{ - crc_module_config_t moduleConfig; - /* convert protocol to CRC peripheral module configuration, prepare for intermediate checksum */ - moduleConfig.polynomial = protocolConfig->polynomial; - moduleConfig.seed = protocolConfig->seed; - moduleConfig.readTranspose = - kCrcTransposeNone; /* intermediate checksum does no transpose of data register read value */ - moduleConfig.writeTranspose = CRC_GetTransposeTypeFromReflectIn(protocolConfig->reflectIn); - moduleConfig.complementChecksum = false; /* intermediate checksum does no xor of data register read value */ - moduleConfig.crcBits = protocolConfig->crcBits; - - CRC_ConfigureAndStart(base, &moduleConfig); -} - -/*! - * brief Enables and configures the CRC peripheral module. - * - * This function enables the clock gate in the SIM module for the CRC peripheral. - * It also configures the CRC module and starts a checksum computation by writing the seed. - * - * param base CRC peripheral address. - * param config CRC module configuration structure. - */ -void CRC_Init(CRC_Type *base, const crc_config_t *config) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* ungate clock */ - CLOCK_EnableClock(kCLOCK_Crc0); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(CRC_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_crcResets[CRC_GetInstance(base)]); -#endif - - /* configure CRC module and write the seed */ - if (config->crcResult == kCrcFinalChecksum) - { - CRC_SetProtocolConfig(base, config); - } - else - { - CRC_SetRawProtocolConfig(base, config); - } -} - -/*! - * brief Loads default values to the CRC protocol configuration structure. - * - * Loads default values to the CRC protocol configuration structure. The default values are as follows. - * code - * config->polynomial = 0x1021; - * config->seed = 0xFFFF; - * config->reflectIn = false; - * config->reflectOut = false; - * config->complementChecksum = false; - * config->crcBits = kCrcBits16; - * config->crcResult = kCrcFinalChecksum; - * endcode - * - * param config CRC protocol configuration structure. - */ -void CRC_GetDefaultConfig(crc_config_t *config) -{ - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - static const crc_config_t crc16ccit = { - CRC_DRIVER_DEFAULT_POLYNOMIAL, CRC_DRIVER_DEFAULT_SEED, - CRC_DRIVER_DEFAULT_REFLECT_IN, CRC_DRIVER_DEFAULT_REFLECT_OUT, - CRC_DRIVER_DEFAULT_COMPLEMENT_CHECKSUM, CRC_DRIVER_DEFAULT_CRC_BITS, - CRC_DRIVER_DEFAULT_CRC_RESULT, - }; - - *config = crc16ccit; -} - -/*! - * brief Writes data to the CRC module. - * - * Writes input data buffer bytes to the CRC data register. - * The configured type of transpose is applied. - * - * param base CRC peripheral address. - * param data Input data stream, MSByte in data[0]. - * param dataSize Size in bytes of the input data buffer. - */ -void CRC_WriteData(CRC_Type *base, const uint8_t *data, size_t dataSize) -{ - const uint32_t *data32; - - /* 8-bit reads and writes till source address is aligned 4 bytes */ - while ((0U != dataSize) && (0U != ((uint32_t)data & 3U))) - { - base->ACCESS8BIT.DATALL = *data; - data++; - dataSize--; - } - - /* use 32-bit reads and writes as long as possible */ - data32 = (const uint32_t *)(uint32_t)data; - while (dataSize >= sizeof(uint32_t)) - { - base->DATA = *data32; - data32++; - dataSize -= sizeof(uint32_t); - } - - data = (const uint8_t *)data32; - - /* 8-bit reads and writes till end of data buffer */ - while (dataSize != 0U) - { - base->ACCESS8BIT.DATALL = *data; - data++; - dataSize--; - } -} - -/*! - * brief Reads the 32-bit checksum from the CRC module. - * - * Reads the CRC data register (either an intermediate or the final checksum). - * The configured type of transpose and complement is applied. - * - * param base CRC peripheral address. - * return An intermediate or the final 32-bit checksum, after configured transpose and complement operations. - */ -uint32_t CRC_Get32bitResult(CRC_Type *base) -{ - return base->DATA; -} - -/*! - * brief Reads a 16-bit checksum from the CRC module. - * - * Reads the CRC data register (either an intermediate or the final checksum). - * The configured type of transpose and complement is applied. - * - * param base CRC peripheral address. - * return An intermediate or the final 16-bit checksum, after configured transpose and complement operations. - */ -uint16_t CRC_Get16bitResult(CRC_Type *base) -{ - uint32_t retval; - uint32_t totr; /* type of transpose read bitfield */ - - retval = base->DATA; - totr = (base->CTRL & CRC_CTRL_TOTR_MASK) >> CRC_CTRL_TOTR_SHIFT; - - /* check transpose type to get 16-bit out of 32-bit register */ - if (totr >= 2U) - { - /* transpose of bytes for read is set, the result CRC is in CRC_DATA[HU:HL] */ - retval &= 0xFFFF0000U; - retval = retval >> 16U; - } - else - { - /* no transpose of bytes for read, the result CRC is in CRC_DATA[LU:LL] */ - retval &= 0x0000FFFFU; - } - return (uint16_t)retval; -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_crc.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_crc.h deleted file mode 100644 index 487e9f1095f..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_crc.h +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2017, 2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_CRC_H_ -#define FSL_CRC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup crc - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief CRC driver version. Version 2.0.4. - * - * Current version: 2.0.4 - * - * Change log: - * - * - Version 2.0.4 - * - Release peripheral from reset if necessary in init function. - * - * - Version 2.0.3 - * - Fix MISRA issues - * - * - Version 2.0.2 - * - Fix MISRA issues - * - * - Version 2.0.1 - * - move DATA and DATALL macro definition from header file to source file - */ -#define FSL_CRC_DRIVER_VERSION (MAKE_VERSION(2, 0, 4)) -/*! @} */ - -#ifndef CRC_DRIVER_CUSTOM_DEFAULTS -/*! @brief Default configuration structure filled by CRC_GetDefaultConfig(). Use CRC16-CCIT-FALSE as defeault. */ -#define CRC_DRIVER_USE_CRC16_CCIT_FALSE_AS_DEFAULT 1 -#endif - -/*! @brief CRC bit width */ -typedef enum _crc_bits -{ - kCrcBits16 = 0U, /*!< Generate 16-bit CRC code */ - kCrcBits32 = 1U /*!< Generate 32-bit CRC code */ -} crc_bits_t; - -/*! @brief CRC result type */ -typedef enum _crc_result -{ - kCrcFinalChecksum = 0U, /*!< CRC data register read value is the final checksum. - Reflect out and final xor protocol features are applied. */ - kCrcIntermediateChecksum = 1U /*!< CRC data register read value is intermediate checksum (raw value). - Reflect out and final xor protocol feature are not applied. - Intermediate checksum can be used as a seed for CRC_Init() - to continue adding data to this checksum. */ -} crc_result_t; - -/*! - * @brief CRC protocol configuration. - * - * This structure holds the configuration for the CRC protocol. - * - */ -typedef struct _crc_config -{ - uint32_t polynomial; /*!< CRC Polynomial, MSBit first. - Example polynomial: 0x1021 = 1_0000_0010_0001 = x^12+x^5+1 */ - uint32_t seed; /*!< Starting checksum value */ - bool reflectIn; /*!< Reflect bits on input. */ - bool reflectOut; /*!< Reflect bits on output. */ - bool complementChecksum; /*!< True if the result shall be complement of the actual checksum. */ - crc_bits_t crcBits; /*!< Selects 16- or 32- bit CRC protocol. */ - crc_result_t crcResult; /*!< Selects final or intermediate checksum return from CRC_Get16bitResult() or - CRC_Get32bitResult() */ -} crc_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @brief Enables and configures the CRC peripheral module. - * - * This function enables the clock gate in the SIM module for the CRC peripheral. - * It also configures the CRC module and starts a checksum computation by writing the seed. - * - * @param base CRC peripheral address. - * @param config CRC module configuration structure. - */ -void CRC_Init(CRC_Type *base, const crc_config_t *config); - -/*! - * @brief Disables the CRC peripheral module. - * - * This function disables the clock gate in the SIM module for the CRC peripheral. - * - * @param base CRC peripheral address. - */ -static inline void CRC_Deinit(CRC_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* gate clock */ - CLOCK_DisableClock(kCLOCK_Crc0); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * @brief Loads default values to the CRC protocol configuration structure. - * - * Loads default values to the CRC protocol configuration structure. The default values are as follows. - * @code - * config->polynomial = 0x1021; - * config->seed = 0xFFFF; - * config->reflectIn = false; - * config->reflectOut = false; - * config->complementChecksum = false; - * config->crcBits = kCrcBits16; - * config->crcResult = kCrcFinalChecksum; - * @endcode - * - * @param config CRC protocol configuration structure. - */ -void CRC_GetDefaultConfig(crc_config_t *config); - -/*! - * @brief Writes data to the CRC module. - * - * Writes input data buffer bytes to the CRC data register. - * The configured type of transpose is applied. - * - * @param base CRC peripheral address. - * @param data Input data stream, MSByte in data[0]. - * @param dataSize Size in bytes of the input data buffer. - */ -void CRC_WriteData(CRC_Type *base, const uint8_t *data, size_t dataSize); - -/*! - * @brief Reads the 32-bit checksum from the CRC module. - * - * Reads the CRC data register (either an intermediate or the final checksum). - * The configured type of transpose and complement is applied. - * - * @param base CRC peripheral address. - * @return An intermediate or the final 32-bit checksum, after configured transpose and complement operations. - */ -uint32_t CRC_Get32bitResult(CRC_Type *base); - -/*! - * @brief Reads a 16-bit checksum from the CRC module. - * - * Reads the CRC data register (either an intermediate or the final checksum). - * The configured type of transpose and complement is applied. - * - * @param base CRC peripheral address. - * @return An intermediate or the final 16-bit checksum, after configured transpose and complement operations. - */ -uint16_t CRC_Get16bitResult(CRC_Type *base); - -#if defined(__cplusplus) -} -#endif - -/*! - *@} - */ - -#endif /* FSL_CRC_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_ctimer.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_ctimer.c deleted file mode 100644 index 3317157fdeb..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_ctimer.c +++ /dev/null @@ -1,604 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_ctimer.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.ctimer" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Gets the instance from the base address - * - * @param base Ctimer peripheral base address - * - * @return The Timer instance - */ -static uint32_t CTIMER_GetInstance(CTIMER_Type *base); - -/*! - * @brief CTIMER generic IRQ handle function. - * - * @param index FlexCAN peripheral instance index. - */ -static void CTIMER_GenericIRQHandler(uint32_t index); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to Timer bases for each instance. */ -static CTIMER_Type *const s_ctimerBases[] = CTIMER_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to Timer clocks for each instance. */ -static const clock_ip_name_t s_ctimerClocks[] = CTIMER_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_RESET) && (FSL_FEATURE_CTIMER_HAS_NO_RESET)) -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) -#if defined(FSL_FEATURE_CTIMER_WRITE_ZERO_ASSERT_RESET) && FSL_FEATURE_CTIMER_WRITE_ZERO_ASSERT_RESET -/*! @brief Pointers to Timer resets for each instance, writing a zero asserts the reset */ -static const reset_ip_name_t s_ctimerResets[] = CTIMER_RSTS_N; -#else -/*! @brief Pointers to Timer resets for each instance, writing a one asserts the reset */ -static const reset_ip_name_t s_ctimerResets[] = CTIMER_RSTS; -#endif -#endif -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ - -/*! @brief Pointers real ISRs installed by drivers for each instance. */ -static ctimer_callback_t *s_ctimerCallback[sizeof(s_ctimerBases) / sizeof(s_ctimerBases[0])] = {0}; - -/*! @brief Callback type installed by drivers for each instance. */ -static ctimer_callback_type_t ctimerCallbackType[sizeof(s_ctimerBases) / sizeof(s_ctimerBases[0])] = { - kCTIMER_SingleCallback}; - -/*! @brief Array to map timer instance to IRQ number. */ -static const IRQn_Type s_ctimerIRQ[] = CTIMER_IRQS; - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t CTIMER_GetInstance(CTIMER_Type *base) -{ - uint32_t instance; - uint32_t ctimerArrayCount = (sizeof(s_ctimerBases) / sizeof(s_ctimerBases[0])); - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ctimerArrayCount; instance++) - { - if (s_ctimerBases[instance] == base) - { - break; - } - } - - assert(instance < ctimerArrayCount); - - return instance; -} - -/*! - * brief Ungates the clock and configures the peripheral for basic operation. - * - * note This API should be called at the beginning of the application before using the driver. - * - * param base Ctimer peripheral base address - * param config Pointer to the user configuration structure. - */ -void CTIMER_Init(CTIMER_Type *base, const ctimer_config_t *config) -{ - assert(config != NULL); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the timer clock*/ - CLOCK_EnableClock(s_ctimerClocks[CTIMER_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) -/* Reset the module. */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_RESET) && (FSL_FEATURE_CTIMER_HAS_NO_RESET)) - RESET_PeripheralReset(s_ctimerResets[CTIMER_GetInstance(base)]); -#endif -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ - -/* Setup the cimer mode and count select */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && (FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE)) - base->CTCR = CTIMER_CTCR_CTMODE(config->mode) | CTIMER_CTCR_CINSEL(config->input); -#endif - /* Setup the timer prescale value */ - base->PR = CTIMER_PR_PRVAL(config->prescale); -} - -/*! - * brief Gates the timer clock. - * - * param base Ctimer peripheral base address - */ -void CTIMER_Deinit(CTIMER_Type *base) -{ - uint32_t index = CTIMER_GetInstance(base); - /* Stop the timer */ - base->TCR &= ~CTIMER_TCR_CEN_MASK; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable the timer clock*/ - CLOCK_DisableClock(s_ctimerClocks[index]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Disable IRQ at NVIC Level */ - (void)DisableIRQ(s_ctimerIRQ[index]); -} - -/*! - * brief Fills in the timers configuration structure with the default settings. - * - * The default values are: - * code - * config->mode = kCTIMER_TimerMode; - * config->input = kCTIMER_Capture_0; - * config->prescale = 0; - * endcode - * param config Pointer to the user configuration structure. - */ -void CTIMER_GetDefaultConfig(ctimer_config_t *config) -{ - assert(config != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - /* Run as a timer */ - config->mode = kCTIMER_TimerMode; - /* This field is ignored when mode is timer */ - config->input = kCTIMER_Capture_0; - /* Timer counter is incremented on every APB bus clock */ - config->prescale = 0; -} - -/*! - * brief Configures the PWM signal parameters. - * - * Enables PWM mode on the match channel passed in and will then setup the match value - * and other match parameters to generate a PWM signal. - * This function can manually assign the specified channel to set the PWM cycle. - * - * note When setting PWM output from multiple output pins, all should use the same PWM - * frequency. Please use CTIMER_SetupPwmPeriod to set up the PWM with high resolution. - * - * param base Ctimer peripheral base address - * param pwmPeriodChannel Specify the channel to control the PWM period - * param matchChannel Match pin to be used to output the PWM signal - * param dutyCyclePercent PWM pulse width; the value should be between 0 to 100 - * param pwmFreq_Hz PWM signal frequency in Hz - * param srcClock_Hz Timer counter clock in Hz - * param enableInt Enable interrupt when the timer value reaches the match value of the PWM pulse, - * if it is 0 then no interrupt will be generated. - * - * return kStatus_Success on success - * kStatus_Fail If matchChannel is equal to pwmPeriodChannel; this channel is reserved to set the PWM cycle - */ -status_t CTIMER_SetupPwm(CTIMER_Type *base, - const ctimer_match_t pwmPeriodChannel, - ctimer_match_t matchChannel, - uint8_t dutyCyclePercent, - uint32_t pwmFreq_Hz, - uint32_t srcClock_Hz, - bool enableInt) -{ - assert(pwmFreq_Hz > 0U); - - uint32_t reg; - uint32_t period, pulsePeriod = 0; - uint32_t timerClock = srcClock_Hz / (base->PR + 1U); - uint32_t index = CTIMER_GetInstance(base); - - if (matchChannel == pwmPeriodChannel) - { - return kStatus_Fail; - } - - /* Enable PWM mode on the match channel */ - base->PWMC |= (1UL << (uint32_t)matchChannel); - - /* Clear the stop, reset and interrupt bits for this channel */ - reg = base->MCR; - reg &= - ~(((uint32_t)((uint32_t)CTIMER_MCR_MR0R_MASK | (uint32_t)CTIMER_MCR_MR0S_MASK | (uint32_t)CTIMER_MCR_MR0I_MASK)) - << ((uint32_t)matchChannel * 3U)); - - /* If call back function is valid then enable match interrupt for the channel */ - if (enableInt) - { - reg |= (((uint32_t)CTIMER_MCR_MR0I_MASK) << (CTIMER_MCR_MR0I_SHIFT + ((uint32_t)matchChannel * 3U))); - } - - /* Reset the counter when match on PWM period channel (pwmPeriodChannel) */ - reg |= ((uint32_t)((uint32_t)CTIMER_MCR_MR0R_MASK) << ((uint32_t)pwmPeriodChannel * 3U)); - - base->MCR = reg; - - /* Calculate PWM period match value */ - period = (timerClock / pwmFreq_Hz) - 1U; - - /* Calculate pulse width match value */ - if (dutyCyclePercent == 0U) - { - pulsePeriod = period + 1U; - } - else - { - pulsePeriod = (period * (100U - (uint32_t)dutyCyclePercent)) / 100U; - } - - /* Specified channel pwmPeriodChannel will define the PWM period */ - base->MR[pwmPeriodChannel] = period; - - /* This will define the PWM pulse period */ - base->MR[matchChannel] = pulsePeriod; - /* Clear status flags */ - CTIMER_ClearStatusFlags(base, ((uint32_t)CTIMER_IR_MR0INT_MASK) << (uint32_t)matchChannel); - /* If call back function is valid then enable interrupt and update the call back function */ - if (enableInt) - { - (void)EnableIRQ(s_ctimerIRQ[index]); - } - - return kStatus_Success; -} - -/*! - * brief Configures the PWM signal parameters. - * - * Enables PWM mode on the match channel passed in and will then setup the match value - * and other match parameters to generate a PWM signal. - * This function can manually assign the specified channel to set the PWM cycle. - * - * note When setting PWM output from multiple output pins, all should use the same PWM - * period - * - * param base Ctimer peripheral base address - * param pwmPeriodChannel Specify the channel to control the PWM period - * param matchChannel Match pin to be used to output the PWM signal - * param pwmPeriod PWM period match value - * param pulsePeriod Pulse width match value - * param enableInt Enable interrupt when the timer value reaches the match value of the PWM pulse, - * if it is 0 then no interrupt will be generated. - * - * return kStatus_Success on success - * kStatus_Fail If matchChannel is equal to pwmPeriodChannel; this channel is reserved to set the PWM period - */ -status_t CTIMER_SetupPwmPeriod(CTIMER_Type *base, - const ctimer_match_t pwmPeriodChannel, - ctimer_match_t matchChannel, - uint32_t pwmPeriod, - uint32_t pulsePeriod, - bool enableInt) -{ -/* Some CTimers only have 16bits , so the value is limited*/ -#if defined(FSL_FEATURE_SOC_CTIMER16B) && FSL_FEATURE_SOC_CTIMER16B - assert(!((FSL_FEATURE_CTIMER_BIT_SIZEn(base) < 32) && (pulsePeriod > 0xFFFFU))); -#endif - - uint32_t reg; - uint32_t index = CTIMER_GetInstance(base); - - if (matchChannel == pwmPeriodChannel) - { - return kStatus_Fail; - } - - /* Enable PWM mode on PWM pulse channel */ - base->PWMC |= (1UL << (uint32_t)matchChannel); - - /* Clear the stop, reset and interrupt bits for PWM pulse channel */ - reg = base->MCR; - reg &= - ~((uint32_t)((uint32_t)CTIMER_MCR_MR0R_MASK | (uint32_t)CTIMER_MCR_MR0S_MASK | (uint32_t)CTIMER_MCR_MR0I_MASK) - << ((uint32_t)matchChannel * 3U)); - - /* If call back function is valid then enable match interrupt for PWM pulse channel */ - if (enableInt) - { - reg |= (((uint32_t)CTIMER_MCR_MR0I_MASK) << (CTIMER_MCR_MR0I_SHIFT + ((uint32_t)matchChannel * 3U))); - } - - /* Reset the counter when match on PWM period channel (pwmPeriodChannel) */ - reg |= ((uint32_t)((uint32_t)CTIMER_MCR_MR0R_MASK) << ((uint32_t)pwmPeriodChannel * 3U)); - - base->MCR = reg; - - /* Specified channel pwmPeriodChannel will define the PWM period */ - base->MR[pwmPeriodChannel] = pwmPeriod; - - /* This will define the PWM pulse period */ - base->MR[matchChannel] = pulsePeriod; - /* Clear status flags */ - CTIMER_ClearStatusFlags(base, ((uint32_t)CTIMER_IR_MR0INT_MASK) << (uint32_t)matchChannel); - /* If call back function is valid then enable interrupt and update the call back function */ - if (enableInt) - { - (void)EnableIRQ(s_ctimerIRQ[index]); - } - - return kStatus_Success; -} - -/*! - * brief Updates the duty cycle of an active PWM signal. - * - * note Please use CTIMER_SetupPwmPeriod to update the PWM with high resolution. - * This function can manually assign the specified channel to set the PWM cycle. - * - * param base Ctimer peripheral base address - * param pwmPeriodChannel Specify the channel to control the PWM period - * param matchChannel Match pin to be used to output the PWM signal - * param dutyCyclePercent New PWM pulse width; the value should be between 0 to 100 - */ -void CTIMER_UpdatePwmDutycycle(CTIMER_Type *base, - const ctimer_match_t pwmPeriodChannel, - ctimer_match_t matchChannel, - uint8_t dutyCyclePercent) -{ - uint32_t pulsePeriod = 0, period; - - /* Specified channel pwmPeriodChannel defines the PWM period */ - period = base->MR[pwmPeriodChannel]; - - /* For 0% dutycyle, make pulse period greater than period so the event will never occur */ - if (dutyCyclePercent == 0U) - { - pulsePeriod = period + 1U; - } - else - { - pulsePeriod = (period * (100U - (uint32_t)dutyCyclePercent)) / 100U; - } - - /* Update dutycycle */ - base->MR[matchChannel] = pulsePeriod; -} - -/*! - * brief Setup the match register. - * - * User configuration is used to setup the match value and action to be taken when a match occurs. - * - * param base Ctimer peripheral base address - * param matchChannel Match register to configure - * param config Pointer to the match configuration structure - */ -void CTIMER_SetupMatch(CTIMER_Type *base, ctimer_match_t matchChannel, const ctimer_match_config_t *config) -{ -/* Some CTimers only have 16bits , so the value is limited*/ -#if defined(FSL_FEATURE_SOC_CTIMER16B) && FSL_FEATURE_SOC_CTIMER16B - assert(!(FSL_FEATURE_CTIMER_BIT_SIZEn(base) < 32 && config->matchValue > 0xFFFFU)); -#endif - uint32_t reg; - uint32_t index = CTIMER_GetInstance(base); - - /* Set the counter operation when a match on this channel occurs */ - reg = base->MCR; - reg &= - ~((uint32_t)((uint32_t)CTIMER_MCR_MR0R_MASK | (uint32_t)CTIMER_MCR_MR0S_MASK | (uint32_t)CTIMER_MCR_MR0I_MASK) - << ((uint32_t)matchChannel * 3U)); - reg |= ((uint32_t)(config->enableCounterReset) << (CTIMER_MCR_MR0R_SHIFT + ((uint32_t)matchChannel * 3U))); - reg |= ((uint32_t)(config->enableCounterStop) << (CTIMER_MCR_MR0S_SHIFT + ((uint32_t)matchChannel * 3U))); - reg |= ((uint32_t)(config->enableInterrupt) << (CTIMER_MCR_MR0I_SHIFT + ((uint32_t)matchChannel * 3U))); - base->MCR = reg; - - reg = base->EMR; - /* Set the match output operation when a match on this channel occurs */ - reg &= ~(((uint32_t)CTIMER_EMR_EMC0_MASK) << ((uint32_t)matchChannel * 2U)); - reg |= ((uint32_t)config->outControl) << (CTIMER_EMR_EMC0_SHIFT + ((uint32_t)matchChannel * 2U)); - - /* Set the initial state of the EM bit/output */ - reg &= ~(((uint32_t)CTIMER_EMR_EM0_MASK) << (uint32_t)matchChannel); - reg |= ((uint32_t)config->outPinInitState) << (uint32_t)matchChannel; - base->EMR = reg; - - /* Set the match value */ - base->MR[matchChannel] = config->matchValue; - /* Clear status flags */ - CTIMER_ClearStatusFlags(base, ((uint32_t)CTIMER_IR_MR0INT_MASK) << (uint32_t)matchChannel); - /* If interrupt is enabled then enable interrupt and update the call back function */ - if (config->enableInterrupt) - { - (void)EnableIRQ(s_ctimerIRQ[index]); - } -} - -/*! - * brief Get the status of output match. - * - * This function gets the status of output MAT, whether or not this output is connected to a pin. - * This status is driven to the MAT pins if the match function is selected via IOCON. 0 = LOW. 1 = HIGH. - * - * param base Ctimer peripheral base address - * param matchChannel External match channel, user can obtain the status of multiple match channels - * at the same time by using the logic of "|" - * enumeration ::ctimer_external_match_t - * return The mask of external match channel status flags. Users need to use the - * _ctimer_external_match type to decode the return variables. - */ -uint32_t CTIMER_GetOutputMatchStatus(CTIMER_Type *base, uint32_t matchChannel) -{ - return (base->EMR & matchChannel); -} - -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && (FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE)) -/*! - * brief Setup the capture. - * - * param base Ctimer peripheral base address - * param capture Capture channel to configure - * param edge Edge on the channel that will trigger a capture - * param enableInt Flag to enable channel interrupts, if enabled then the registered call back - * is called upon capture - */ -void CTIMER_SetupCapture(CTIMER_Type *base, - ctimer_capture_channel_t capture, - ctimer_capture_edge_t edge, - bool enableInt) -{ - uint32_t reg = base->CCR; - uint32_t index = CTIMER_GetInstance(base); - - /* Set the capture edge */ - reg &= ~((uint32_t)((uint32_t)CTIMER_CCR_CAP0RE_MASK | (uint32_t)CTIMER_CCR_CAP0FE_MASK | - (uint32_t)CTIMER_CCR_CAP0I_MASK) - << ((uint32_t)capture * 3U)); - reg |= ((uint32_t)edge) << (CTIMER_CCR_CAP0RE_SHIFT + ((uint32_t)capture * 3U)); - /* Clear status flags */ - CTIMER_ClearStatusFlags(base, (((uint32_t)kCTIMER_Capture0Flag) << (uint32_t)capture)); - /* If call back function is valid then enable capture interrupt for the channel and update the call back function */ - if (enableInt) - { - reg |= ((uint32_t)CTIMER_CCR_CAP0I_MASK) << ((uint32_t)capture * 3U); - (void)EnableIRQ(s_ctimerIRQ[index]); - } - base->CCR = reg; -} -#endif - -/*! - * brief Register callback. - * - * param base Ctimer peripheral base address - * param cb_func callback function - * param cb_type callback function type, singular or multiple - */ -void CTIMER_RegisterCallBack(CTIMER_Type *base, ctimer_callback_t *cb_func, ctimer_callback_type_t cb_type) -{ - uint32_t index = CTIMER_GetInstance(base); - s_ctimerCallback[index] = cb_func; - ctimerCallbackType[index] = cb_type; -} - -/*! - * brief CTIMER generic IRQ handle function. - * - * param index FlexCAN peripheral instance index. - */ -static void CTIMER_GenericIRQHandler(uint32_t index) -{ - uint32_t int_stat, i, mask; - /* Get Interrupt status flags */ - int_stat = CTIMER_GetStatusFlags(s_ctimerBases[index]); - /* Clear the status flags that were set */ - CTIMER_ClearStatusFlags(s_ctimerBases[index], int_stat); - if (ctimerCallbackType[index] == kCTIMER_SingleCallback) - { - if (s_ctimerCallback[index][0] != NULL) - { - s_ctimerCallback[index][0](int_stat); - } - } - else - { -#if defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE - for (i = 0; i <= CTIMER_IR_MR3INT_SHIFT; i++) -#else -#if defined(FSL_FEATURE_CTIMER_HAS_IR_CR3INT) && FSL_FEATURE_CTIMER_HAS_IR_CR3INT - for (i = 0; i <= CTIMER_IR_CR3INT_SHIFT; i++) -#else -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_IR_CR2INT) && FSL_FEATURE_CTIMER_HAS_NO_IR_CR2INT) - for (i = 0; i <= CTIMER_IR_CR2INT_SHIFT; i++) -#else - for (i = 0; i <= CTIMER_IR_CR1INT_SHIFT; i++) -#endif /* FSL_FEATURE_CTIMER_HAS_NO_IR_CR2INT */ -#endif /* FSL_FEATURE_CTIMER_HAS_IR_CR3INT */ -#endif - { - mask = 0x01UL << i; - /* For each status flag bit that was set call the callback function if it is valid */ - if (((int_stat & mask) != 0U) && (s_ctimerCallback[index][i] != NULL)) - { - s_ctimerCallback[index][i](int_stat); - } - } - } - SDK_ISR_EXIT_BARRIER; -} - -/* IRQ handler functions overloading weak symbols in the startup */ -#if defined(CTIMER0) -void CTIMER0_DriverIRQHandler(void); -void CTIMER0_DriverIRQHandler(void) -{ - CTIMER_GenericIRQHandler(0); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CTIMER1) -void CTIMER1_DriverIRQHandler(void); -void CTIMER1_DriverIRQHandler(void) -{ - CTIMER_GenericIRQHandler(1); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CTIMER2) -void CTIMER2_DriverIRQHandler(void); -void CTIMER2_DriverIRQHandler(void) -{ - CTIMER_GenericIRQHandler(2); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CTIMER3) -void CTIMER3_DriverIRQHandler(void); -void CTIMER3_DriverIRQHandler(void) -{ - CTIMER_GenericIRQHandler(3); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CTIMER4) -void CTIMER4_DriverIRQHandler(void); -void CTIMER4_DriverIRQHandler(void) -{ - CTIMER_GenericIRQHandler(4); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CTIMER5) -void CTIMER5_DriverIRQHandler(void); -void CTIMER5_DriverIRQHandler(void) -{ - CTIMER_GenericIRQHandler(5); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CTIMER6) -void CTIMER6_DriverIRQHandler(void); -void CTIMER6_DriverIRQHandler(void) -{ - CTIMER_GenericIRQHandler(6); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CTIMER7) -void CTIMER7_DriverIRQHandler(void); -void CTIMER7_DriverIRQHandler(void) -{ - CTIMER_GenericIRQHandler(7); - SDK_ISR_EXIT_BARRIER; -} -#endif diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_ctimer.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_ctimer.h deleted file mode 100644 index 0ec7286e6c6..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_ctimer.h +++ /dev/null @@ -1,682 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_CTIMER_H_ -#define FSL_CTIMER_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup ctimer - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -#define FSL_CTIMER_DRIVER_VERSION (MAKE_VERSION(2, 3, 1)) /*!< Version 2.3.1 */ -/*! @} */ - -/*! @brief List of Timer capture channels */ -typedef enum _ctimer_capture_channel -{ - kCTIMER_Capture_0 = 0U, /*!< Timer capture channel 0 */ - kCTIMER_Capture_1, /*!< Timer capture channel 1 */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) && FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) - kCTIMER_Capture_2, /*!< Timer capture channel 2 */ -#endif /* FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2 */ -#if defined(FSL_FEATURE_CTIMER_HAS_CCR_CAP3) && FSL_FEATURE_CTIMER_HAS_CCR_CAP3 - kCTIMER_Capture_3 /*!< Timer capture channel 3 */ -#endif /* FSL_FEATURE_CTIMER_HAS_CCR_CAP3 */ -} ctimer_capture_channel_t; - -/*! @brief List of capture edge options */ -typedef enum _ctimer_capture_edge -{ - kCTIMER_Capture_RiseEdge = 1U, /*!< Capture on rising edge */ - kCTIMER_Capture_FallEdge = 2U, /*!< Capture on falling edge */ - kCTIMER_Capture_BothEdge = 3U, /*!< Capture on rising and falling edge */ -} ctimer_capture_edge_t; - -/*! @brief List of Timer match registers */ -typedef enum _ctimer_match -{ - kCTIMER_Match_0 = 0U, /*!< Timer match register 0 */ - kCTIMER_Match_1, /*!< Timer match register 1 */ - kCTIMER_Match_2, /*!< Timer match register 2 */ - kCTIMER_Match_3 /*!< Timer match register 3 */ -} ctimer_match_t; - -/*! @brief List of external match */ -typedef enum _ctimer_external_match -{ - kCTIMER_External_Match_0 = (1UL << 0), /*!< External match 0 */ - kCTIMER_External_Match_1 = (1UL << 1), /*!< External match 1 */ - kCTIMER_External_Match_2 = (1UL << 2), /*!< External match 2 */ - kCTIMER_External_Match_3 = (1UL << 3) /*!< External match 3 */ -} ctimer_external_match_t; - -/*! @brief List of output control options */ -typedef enum _ctimer_match_output_control -{ - kCTIMER_Output_NoAction = 0U, /*!< No action is taken */ - kCTIMER_Output_Clear, /*!< Clear the EM bit/output to 0 */ - kCTIMER_Output_Set, /*!< Set the EM bit/output to 1 */ - kCTIMER_Output_Toggle /*!< Toggle the EM bit/output */ -} ctimer_match_output_control_t; - -/*! @brief List of Timer modes */ -typedef enum _ctimer_timer_mode -{ - kCTIMER_TimerMode = 0U, /* TC is incremented every rising APB bus clock edge */ - kCTIMER_IncreaseOnRiseEdge, /* TC is incremented on rising edge of input signal */ - kCTIMER_IncreaseOnFallEdge, /* TC is incremented on falling edge of input signal */ - kCTIMER_IncreaseOnBothEdge /* TC is incremented on both edges of input signal */ -} ctimer_timer_mode_t; - -/*! @brief List of Timer interrupts */ -typedef enum _ctimer_interrupt_enable -{ - kCTIMER_Match0InterruptEnable = CTIMER_MCR_MR0I_MASK, /*!< Match 0 interrupt */ - kCTIMER_Match1InterruptEnable = CTIMER_MCR_MR1I_MASK, /*!< Match 1 interrupt */ - kCTIMER_Match2InterruptEnable = CTIMER_MCR_MR2I_MASK, /*!< Match 2 interrupt */ - kCTIMER_Match3InterruptEnable = CTIMER_MCR_MR3I_MASK, /*!< Match 3 interrupt */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && (FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE)) - kCTIMER_Capture0InterruptEnable = CTIMER_CCR_CAP0I_MASK, /*!< Capture 0 interrupt */ - kCTIMER_Capture1InterruptEnable = CTIMER_CCR_CAP1I_MASK, /*!< Capture 1 interrupt */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) && FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) - kCTIMER_Capture2InterruptEnable = CTIMER_CCR_CAP2I_MASK, /*!< Capture 2 interrupt */ -#endif /* FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2 */ -#if defined(FSL_FEATURE_CTIMER_HAS_CCR_CAP3) && FSL_FEATURE_CTIMER_HAS_CCR_CAP3 - kCTIMER_Capture3InterruptEnable = CTIMER_CCR_CAP3I_MASK, /*!< Capture 3 interrupt */ -#endif /* FSL_FEATURE_CTIMER_HAS_CCR_CAP3 */ -#endif -} ctimer_interrupt_enable_t; - -/*! @brief List of Timer flags */ -typedef enum _ctimer_status_flags -{ - kCTIMER_Match0Flag = CTIMER_IR_MR0INT_MASK, /*!< Match 0 interrupt flag */ - kCTIMER_Match1Flag = CTIMER_IR_MR1INT_MASK, /*!< Match 1 interrupt flag */ - kCTIMER_Match2Flag = CTIMER_IR_MR2INT_MASK, /*!< Match 2 interrupt flag */ - kCTIMER_Match3Flag = CTIMER_IR_MR3INT_MASK, /*!< Match 3 interrupt flag */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && (FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE)) - kCTIMER_Capture0Flag = CTIMER_IR_CR0INT_MASK, /*!< Capture 0 interrupt flag */ - kCTIMER_Capture1Flag = CTIMER_IR_CR1INT_MASK, /*!< Capture 1 interrupt flag */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_IR_CR2INT) && FSL_FEATURE_CTIMER_HAS_NO_IR_CR2INT) - kCTIMER_Capture2Flag = CTIMER_IR_CR2INT_MASK, /*!< Capture 2 interrupt flag */ -#endif /* FSL_FEATURE_CTIMER_HAS_NO_IR_CR2INT */ -#if defined(FSL_FEATURE_CTIMER_HAS_IR_CR3INT) && FSL_FEATURE_CTIMER_HAS_IR_CR3INT - kCTIMER_Capture3Flag = CTIMER_IR_CR3INT_MASK, /*!< Capture 3 interrupt flag */ -#endif /* FSL_FEATURE_CTIMER_HAS_IR_CR3INT */ -#endif -} ctimer_status_flags_t; - -typedef void (*ctimer_callback_t)(uint32_t flags); - -/*! @brief Callback type when registering for a callback. When registering a callback - * an array of function pointers is passed the size could be 1 or 8, the callback - * type will tell that. - */ -typedef enum -{ - kCTIMER_SingleCallback, /*!< Single Callback type where there is only one callback for the timer. - based on the status flags different channels needs to be handled differently */ - kCTIMER_MultipleCallback /*!< Multiple Callback type where there can be 8 valid callbacks, one per channel. - for both match/capture */ -} ctimer_callback_type_t; - -/*! - * @brief Match configuration - * - * This structure holds the configuration settings for each match register. - */ -typedef struct _ctimer_match_config -{ - uint32_t matchValue; /*!< This is stored in the match register */ - bool enableCounterReset; /*!< true: Match will reset the counter - false: Match will not reser the counter */ - bool enableCounterStop; /*!< true: Match will stop the counter - false: Match will not stop the counter */ - ctimer_match_output_control_t outControl; /*!< Action to be taken on a match on the EM bit/output */ - bool outPinInitState; /*!< Initial value of the EM bit/output */ - bool enableInterrupt; /*!< true: Generate interrupt upon match - false: Do not generate interrupt on match */ - -} ctimer_match_config_t; - -/*! - * @brief Timer configuration structure - * - * This structure holds the configuration settings for the Timer peripheral. To initialize this - * structure to reasonable defaults, call the CTIMER_GetDefaultConfig() function and pass a - * pointer to the configuration structure instance. - * - * The configuration structure can be made constant so as to reside in flash. - */ -typedef struct _ctimer_config -{ - ctimer_timer_mode_t mode; /*!< Timer mode */ - ctimer_capture_channel_t input; /*!< Input channel to increment the timer, used only in timer - modes that rely on this input signal to increment TC */ - uint32_t prescale; /*!< Prescale value */ -} ctimer_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Ungates the clock and configures the peripheral for basic operation. - * - * @note This API should be called at the beginning of the application before using the driver. - * - * @param base Ctimer peripheral base address - * @param config Pointer to the user configuration structure. - */ -void CTIMER_Init(CTIMER_Type *base, const ctimer_config_t *config); - -/*! - * @brief Gates the timer clock. - * - * @param base Ctimer peripheral base address - */ -void CTIMER_Deinit(CTIMER_Type *base); - -/*! - * @brief Fills in the timers configuration structure with the default settings. - * - * The default values are: - * @code - * config->mode = kCTIMER_TimerMode; - * config->input = kCTIMER_Capture_0; - * config->prescale = 0; - * @endcode - * @param config Pointer to the user configuration structure. - */ -void CTIMER_GetDefaultConfig(ctimer_config_t *config); - -/*! @}*/ - -/*! - * @name PWM setup operations - * @{ - */ - -/*! - * @brief Configures the PWM signal parameters. - * - * Enables PWM mode on the match channel passed in and will then setup the match value - * and other match parameters to generate a PWM signal. - * This function can manually assign the specified channel to set the PWM cycle. - * - * @note When setting PWM output from multiple output pins, all should use the same PWM - * period - * - * @param base Ctimer peripheral base address - * @param pwmPeriodChannel Specify the channel to control the PWM period - * @param matchChannel Match pin to be used to output the PWM signal - * @param pwmPeriod PWM period match value - * @param pulsePeriod Pulse width match value - * @param enableInt Enable interrupt when the timer value reaches the match value of the PWM pulse, - * if it is 0 then no interrupt will be generated. - */ -status_t CTIMER_SetupPwmPeriod(CTIMER_Type *base, - const ctimer_match_t pwmPeriodChannel, - ctimer_match_t matchChannel, - uint32_t pwmPeriod, - uint32_t pulsePeriod, - bool enableInt); - -/*! - * @brief Configures the PWM signal parameters. - * - * Enables PWM mode on the match channel passed in and will then setup the match value - * and other match parameters to generate a PWM signal. - * This function can manually assign the specified channel to set the PWM cycle. - * - * @note When setting PWM output from multiple output pins, all should use the same PWM - * frequency. Please use CTIMER_SetupPwmPeriod to set up the PWM with high resolution. - * - * @param base Ctimer peripheral base address - * @param pwmPeriodChannel Specify the channel to control the PWM period - * @param matchChannel Match pin to be used to output the PWM signal - * @param dutyCyclePercent PWM pulse width; the value should be between 0 to 100 - * @param pwmFreq_Hz PWM signal frequency in Hz - * @param srcClock_Hz Timer counter clock in Hz - * @param enableInt Enable interrupt when the timer value reaches the match value of the PWM pulse, - * if it is 0 then no interrupt will be generated. - */ -status_t CTIMER_SetupPwm(CTIMER_Type *base, - const ctimer_match_t pwmPeriodChannel, - ctimer_match_t matchChannel, - uint8_t dutyCyclePercent, - uint32_t pwmFreq_Hz, - uint32_t srcClock_Hz, - bool enableInt); - -/*! - * @brief Updates the pulse period of an active PWM signal. - * - * @param base Ctimer peripheral base address - * @param matchChannel Match pin to be used to output the PWM signal - * @param pulsePeriod New PWM pulse width match value - */ -static inline void CTIMER_UpdatePwmPulsePeriod(CTIMER_Type *base, ctimer_match_t matchChannel, uint32_t pulsePeriod) -{ - /* Update PWM pulse period match value */ - base->MR[matchChannel] = pulsePeriod; -} - -/*! - * @brief Updates the duty cycle of an active PWM signal. - * - * @note Please use CTIMER_SetupPwmPeriod to update the PWM with high resolution. - * This function can manually assign the specified channel to set the PWM cycle. - * - * @param base Ctimer peripheral base address - * @param pwmPeriodChannel Specify the channel to control the PWM period - * @param matchChannel Match pin to be used to output the PWM signal - * @param dutyCyclePercent New PWM pulse width; the value should be between 0 to 100 - */ -void CTIMER_UpdatePwmDutycycle(CTIMER_Type *base, - const ctimer_match_t pwmPeriodChannel, - ctimer_match_t matchChannel, - uint8_t dutyCyclePercent); - -/*! @}*/ - -/*! - * @brief Setup the match register. - * - * User configuration is used to setup the match value and action to be taken when a match occurs. - * - * @param base Ctimer peripheral base address - * @param matchChannel Match register to configure - * @param config Pointer to the match configuration structure - */ -void CTIMER_SetupMatch(CTIMER_Type *base, ctimer_match_t matchChannel, const ctimer_match_config_t *config); - -/*! - * @brief Get the status of output match. - * - * This function gets the status of output MAT, whether or not this output is connected to a pin. - * This status is driven to the MAT pins if the match function is selected via IOCON. 0 = LOW. 1 = HIGH. - * - * @param base Ctimer peripheral base address - * @param matchChannel External match channel, user can obtain the status of multiple match channels - * at the same time by using the logic of "|" - * enumeration ::ctimer_external_match_t - * @return The mask of external match channel status flags. Users need to use the - * _ctimer_external_match type to decode the return variables. - */ -uint32_t CTIMER_GetOutputMatchStatus(CTIMER_Type *base, uint32_t matchChannel); - -/*! - * @brief Setup the capture. - * - * @param base Ctimer peripheral base address - * @param capture Capture channel to configure - * @param edge Edge on the channel that will trigger a capture - * @param enableInt Flag to enable channel interrupts, if enabled then the registered call back - * is called upon capture - */ -void CTIMER_SetupCapture(CTIMER_Type *base, - ctimer_capture_channel_t capture, - ctimer_capture_edge_t edge, - bool enableInt); - -/*! - * @brief Get the timer count value from TC register. - * - * @param base Ctimer peripheral base address. - * @return return the timer count value. - */ -static inline uint32_t CTIMER_GetTimerCountValue(CTIMER_Type *base) -{ - return (base->TC); -} - -/*! - * @brief Register callback. - * - * @param base Ctimer peripheral base address - * @param cb_func callback function - * @param cb_type callback function type, singular or multiple - */ -void CTIMER_RegisterCallBack(CTIMER_Type *base, ctimer_callback_t *cb_func, ctimer_callback_type_t cb_type); - -/*! - * @name Interrupt Interface - * @{ - */ - -/*! - * @brief Enables the selected Timer interrupts. - * - * @param base Ctimer peripheral base address - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::ctimer_interrupt_enable_t - */ -static inline void CTIMER_EnableInterrupts(CTIMER_Type *base, uint32_t mask) -{ - /* Enable match interrupts */ - base->MCR |= mask & (CTIMER_MCR_MR0I_MASK | CTIMER_MCR_MR1I_MASK | CTIMER_MCR_MR2I_MASK | CTIMER_MCR_MR3I_MASK); - -/* Enable capture interrupts */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && (FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE)) - base->CCR |= mask & (CTIMER_CCR_CAP0I_MASK | CTIMER_CCR_CAP1I_MASK -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) && FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) - | CTIMER_CCR_CAP2I_MASK -#endif /* FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2 */ -#if defined(FSL_FEATURE_CTIMER_HAS_CCR_CAP3) && FSL_FEATURE_CTIMER_HAS_CCR_CAP3 - | CTIMER_CCR_CAP3I_MASK -#endif /* FSL_FEATURE_CTIMER_HAS_CCR_CAP3 */ - ); -#endif -} - -/*! - * @brief Disables the selected Timer interrupts. - * - * @param base Ctimer peripheral base address - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::ctimer_interrupt_enable_t - */ -static inline void CTIMER_DisableInterrupts(CTIMER_Type *base, uint32_t mask) -{ - /* Disable match interrupts */ - base->MCR &= ~(mask & (CTIMER_MCR_MR0I_MASK | CTIMER_MCR_MR1I_MASK | CTIMER_MCR_MR2I_MASK | CTIMER_MCR_MR3I_MASK)); - -/* Disable capture interrupts */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && (FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE)) - base->CCR &= ~(mask & (CTIMER_CCR_CAP0I_MASK | CTIMER_CCR_CAP1I_MASK -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) && FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) - | CTIMER_CCR_CAP2I_MASK -#endif /* FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2 */ -#if defined(FSL_FEATURE_CTIMER_HAS_CCR_CAP3) && FSL_FEATURE_CTIMER_HAS_CCR_CAP3 - | CTIMER_CCR_CAP3I_MASK -#endif /* FSL_FEATURE_CTIMER_HAS_CCR_CAP3 */ - )); -#endif -} - -/*! - * @brief Gets the enabled Timer interrupts. - * - * @param base Ctimer peripheral base address - * - * @return The enabled interrupts. This is the logical OR of members of the - * enumeration ::ctimer_interrupt_enable_t - */ -static inline uint32_t CTIMER_GetEnabledInterrupts(CTIMER_Type *base) -{ - uint32_t enabledIntrs = 0; - - /* Get all the match interrupts enabled */ - enabledIntrs = - base->MCR & (CTIMER_MCR_MR0I_MASK | CTIMER_MCR_MR1I_MASK | CTIMER_MCR_MR2I_MASK | CTIMER_MCR_MR3I_MASK); - -/* Get all the capture interrupts enabled */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && (FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE)) - enabledIntrs |= base->CCR & (CTIMER_CCR_CAP0I_MASK | CTIMER_CCR_CAP1I_MASK -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) && FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) - | CTIMER_CCR_CAP2I_MASK -#endif /* FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2 */ -#if defined(FSL_FEATURE_CTIMER_HAS_CCR_CAP3) && FSL_FEATURE_CTIMER_HAS_CCR_CAP3 - | CTIMER_CCR_CAP3I_MASK -#endif /* FSL_FEATURE_CTIMER_HAS_CCR_CAP3 */ - ); -#endif - - return enabledIntrs; -} - -/*! @}*/ - -/*! - * @name Status Interface - * @{ - */ - -/*! - * @brief Gets the Timer status flags. - * - * @param base Ctimer peripheral base address - * - * @return The status flags. This is the logical OR of members of the - * enumeration ::ctimer_status_flags_t - */ -static inline uint32_t CTIMER_GetStatusFlags(CTIMER_Type *base) -{ - return base->IR; -} - -/*! - * @brief Clears the Timer status flags. - * - * @param base Ctimer peripheral base address - * @param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::ctimer_status_flags_t - */ -static inline void CTIMER_ClearStatusFlags(CTIMER_Type *base, uint32_t mask) -{ - base->IR = mask; -} - -/*! @}*/ - -/*! - * @name Counter Start and Stop - * @{ - */ - -/*! - * @brief Starts the Timer counter. - * - * @param base Ctimer peripheral base address - */ -static inline void CTIMER_StartTimer(CTIMER_Type *base) -{ - base->TCR |= CTIMER_TCR_CEN_MASK; -} - -/*! - * @brief Stops the Timer counter. - * - * @param base Ctimer peripheral base address - */ -static inline void CTIMER_StopTimer(CTIMER_Type *base) -{ - base->TCR &= ~CTIMER_TCR_CEN_MASK; -} - -/*! @}*/ - -/*! - * @brief Reset the counter. - * - * The timer counter and prescale counter are reset on the next positive edge of the APB clock. - * - * @param base Ctimer peripheral base address - */ -static inline void CTIMER_Reset(CTIMER_Type *base) -{ - base->TCR |= CTIMER_TCR_CRST_MASK; - base->TCR &= ~CTIMER_TCR_CRST_MASK; -} - -/*! - * @brief Setup the timer prescale value. - * - * Specifies the maximum value for the Prescale Counter. - * - * @param base Ctimer peripheral base address - * @param prescale Prescale value - */ -static inline void CTIMER_SetPrescale(CTIMER_Type *base, uint32_t prescale) -{ - base->PR = CTIMER_PR_PRVAL(prescale); -} - -/*! - * @brief Get capture channel value. - * - * Get the counter/timer value on the corresponding capture channel. - * - * @param base Ctimer peripheral base address - * @param capture Select capture channel - * - * @return The timer count capture value. - */ -static inline uint32_t CTIMER_GetCaptureValue(CTIMER_Type *base, ctimer_capture_channel_t capture) -{ - return base->CR[capture]; -} - -/*! - * @brief Enable reset match channel. - * - * Set the specified match channel reset operation. - * - * @param base Ctimer peripheral base address - * @param match match channel used - * @param enable Enable match channel reset operation. - */ -static inline void CTIMER_EnableResetMatchChannel(CTIMER_Type *base, ctimer_match_t match, bool enable) -{ - if (enable) - { - base->MCR |= (1UL << (CTIMER_MCR_MR0R_SHIFT + ((uint32_t)match * 3U))); - } - else - { - base->MCR &= ~(1UL << (CTIMER_MCR_MR0R_SHIFT + ((uint32_t)match * 3U))); - } -} - -/*! - * @brief Enable stop match channel. - * - * Set the specified match channel stop operation. - * - * @param base Ctimer peripheral base address. - * @param match match channel used. - * @param enable Enable match channel stop operation. - */ -static inline void CTIMER_EnableStopMatchChannel(CTIMER_Type *base, ctimer_match_t match, bool enable) -{ - if (enable) - { - base->MCR |= (1UL << (CTIMER_MCR_MR0S_SHIFT + ((uint32_t)match * 3U))); - } - else - { - base->MCR &= ~(1UL << (CTIMER_MCR_MR0S_SHIFT + ((uint32_t)match * 3U))); - } -} - -#if (defined(FSL_FEATURE_CTIMER_HAS_MSR) && (FSL_FEATURE_CTIMER_HAS_MSR)) -/*! - * @brief Enable reload channel falling edge. - * - * Enable the specified match channel reload match shadow value. - * - * @param base Ctimer peripheral base address. - * @param match match channel used. - * @param enable Enable . - */ -static inline void CTIMER_EnableMatchChannelReload(CTIMER_Type *base, ctimer_match_t match, bool enable) -{ - if (enable) - { - base->MCR |= (1UL << (CTIMER_MCR_MR0RL_SHIFT + (uint32_t)match)); - } - else - { - base->MCR &= ~(1UL << (CTIMER_MCR_MR0RL_SHIFT + (uint32_t)match)); - } -} -#endif /* FSL_FEATURE_CTIMER_HAS_MSR */ - -/*! - * @brief Enable capture channel rising edge. - * - * Sets the specified capture channel for rising edge capture. - * - * @param base Ctimer peripheral base address. - * @param capture capture channel used. - * @param enable Enable rising edge capture. - */ -static inline void CTIMER_EnableRisingEdgeCapture(CTIMER_Type *base, ctimer_capture_channel_t capture, bool enable) -{ - if (enable) - { - base->CCR |= (1UL << (CTIMER_CCR_CAP0RE_SHIFT + ((uint32_t)capture * 3U))); - } - else - { - base->CCR &= ~(1UL << (CTIMER_CCR_CAP0RE_SHIFT + ((uint32_t)capture * 3U))); - } -} - -/*! - * @brief Enable capture channel falling edge. - * - * Sets the specified capture channel for falling edge capture. - * - * @param base Ctimer peripheral base address. - * @param capture capture channel used. - * @param enable Enable falling edge capture. - */ -static inline void CTIMER_EnableFallingEdgeCapture(CTIMER_Type *base, ctimer_capture_channel_t capture, bool enable) -{ - if (enable) - { - base->CCR |= (1UL << (CTIMER_CCR_CAP0FE_SHIFT + ((uint32_t)capture * 3U))); - } - else - { - base->CCR &= ~(1UL << (CTIMER_CCR_CAP0FE_SHIFT + ((uint32_t)capture * 3U))); - } -} - -#if (defined(FSL_FEATURE_CTIMER_HAS_MSR) && (FSL_FEATURE_CTIMER_HAS_MSR)) -/*! - * @brief Set the specified match shadow channel. - * - * @param base Ctimer peripheral base address. - * @param match match channel used. - * @param matchvalue Reload the value of the corresponding match register. - */ -static inline void CTIMER_SetShadowValue(CTIMER_Type *base, ctimer_match_t match, uint32_t matchvalue) -{ - base->MSR[match] = matchvalue; -} -#endif /* FSL_FEATURE_CTIMER_HAS_MSR */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_CTIMER_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_edma.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_edma.c deleted file mode 100644 index b444faac9be..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_edma.c +++ /dev/null @@ -1,2654 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_edma.h" -#if defined FSL_FEATURE_MEMORY_HAS_ADDRESS_OFFSET && FSL_FEATURE_MEMORY_HAS_ADDRESS_OFFSET -#include "fsl_memory.h" -#endif - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.edma4" -#endif -#if defined FSL_FEATURE_MEMORY_HAS_ADDRESS_OFFSET && FSL_FEATURE_MEMORY_HAS_ADDRESS_OFFSET -#define CONVERT_TO_DMA_ADDRESS(addr) (MEMORY_ConvertMemoryMapAddress((uint32_t)(addr), kMEMORY_Local2DMA)) -#else -#define CONVERT_TO_DMA_ADDRESS(addr) ((uint32_t)(addr)) -#endif -#if defined(DMA_RSTS_N) -#define EDMA_RESETS_ARRAY DMA_RSTS_N -#endif -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Map transfer width. - * - * @param width transfer width. - */ -static edma_transfer_size_t EDMA_TransferWidthMapping(uint32_t width); - -/*! - * @brief validate edma errata. - * - * @param base edma base address. - * @param tcd edma transfer content descriptor. - */ -#if defined FSL_FEATURE_EDMA_HAS_ERRATA_51327 -static inline status_t EDMA_CheckErrata(EDMA_Type *base, edma_tcd_t *tcd); -#endif -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Array to map EDMA instance number to base pointer. */ -static EDMA_Type *const s_edmaBases[] = EDMA_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Array to map EDMA instance number to clock name. */ -static const clock_ip_name_t s_edmaClockName[] = EDMA_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(EDMA_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_edmaResets[] = EDMA_RESETS_ARRAY; -#endif - -/*! @brief Array to map EDMA instance number to IRQ number. */ -static const IRQn_Type s_edmaIRQNumber[][FSL_FEATURE_EDMA_MODULE_CHANNEL] = EDMA_CHN_IRQS; - -/*! @brief Pointers to transfer handle for each EDMA channel. */ -static edma_handle_t *s_EDMAHandle[FSL_FEATURE_SOC_EDMA_COUNT][FSL_FEATURE_EDMA_MODULE_CHANNEL]; -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t EDMA_GetInstance(EDMA_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_edmaBases); instance++) - { - if (s_edmaBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_edmaBases)); - - return instance; -} - -#if defined FSL_FEATURE_EDMA_HAS_ERRATA_51327 -static inline status_t EDMA_CheckErrata(EDMA_Type *base, edma_tcd_t *tcd) -{ - status_t status = kStatus_Success; - /* errata 51327: to use scatter gather feature, NBYTES must be multiple of 8 */ - if ((uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_ERRATA_51327n(base) == 1U) - { - if ((EDMA_TCD_NBYTES(tcd, EDMA_TCD_TYPE(base)) % 8U) != 0U) - { - assert(false); - status = kStatus_InvalidArgument; - } - } - - return status; -} -#endif - -/*! - * brief Push content of TCD structure into hardware TCD register. - * - * param base EDMA peripheral base address. - * param channel EDMA channel number. - * param tcd Point to TCD structure. - */ -void EDMA_InstallTCD(EDMA_Type *base, uint32_t channel, edma_tcd_t *tcd) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - assert(tcd != NULL); - - edma_tcd_t *tcdRegs = EDMA_TCD_BASE(base, channel); - -#if defined FSL_FEATURE_EDMA_HAS_ERRATA_51327 - if ((EDMA_TCD_DLAST_SGA(tcd, EDMA_TCD_TYPE(base)) != 0U) && - ((EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) & (uint16_t)DMA_CSR_ESG_MASK) != 0U) && - (EDMA_CheckErrata(base, tcd) != kStatus_Success)) - { - assert(false); - } -#endif - - /* Clear DONE bit first, otherwise ESG cannot be set */ - DMA_CLEAR_DONE_STATUS(base, channel); - /* Push tcd into hardware TCD register */ - EDMA_TCD_SADDR(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_SADDR(tcd, EDMA_TCD_TYPE(base)); - EDMA_TCD_SOFF(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_SOFF(tcd, EDMA_TCD_TYPE(base)); - EDMA_TCD_ATTR(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_ATTR(tcd, EDMA_TCD_TYPE(base)); - EDMA_TCD_NBYTES(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_NBYTES(tcd, EDMA_TCD_TYPE(base)); - EDMA_TCD_SLAST(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_SLAST(tcd, EDMA_TCD_TYPE(base)); - EDMA_TCD_DADDR(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_DADDR(tcd, EDMA_TCD_TYPE(base)); - EDMA_TCD_DOFF(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_DOFF(tcd, EDMA_TCD_TYPE(base)); - EDMA_TCD_CITER(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)); - EDMA_TCD_DLAST_SGA(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_DLAST_SGA(tcd, EDMA_TCD_TYPE(base)); - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)); - EDMA_TCD_BITER(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)); -} - -/*! - * brief Initializes the eDMA peripheral. - * - * This function ungates the eDMA clock and configures the eDMA peripheral according - * to the configuration structure. - * - * param base eDMA peripheral base address. - * param config A pointer to the configuration structure, see "edma_config_t". - * note This function enables the minor loop map feature. - */ -void EDMA_Init(EDMA_Type *base, const edma_config_t *config) -{ - assert(config != NULL); - assert(FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base) != -1); - - uint32_t tmpreg, i = 0U; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate EDMA peripheral clock */ - CLOCK_EnableClock(s_edmaClockName[EDMA_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(EDMA_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_edmaResets[EDMA_GetInstance(base)]); -#endif - -#if defined(FSL_EDMA_SOC_IP_EDMA) && FSL_EDMA_SOC_IP_EDMA - /* clear all the enabled request, status to make sure EDMA status is in normal condition */ - EDMA_BASE(base)->ERQ = 0U; - EDMA_BASE(base)->INT = 0xFFFFFFFFU; - EDMA_BASE(base)->ERR = 0xFFFFFFFFU; - /* Configure EDMA peripheral according to the configuration structure. */ - tmpreg = EDMA_BASE(base)->CR; - tmpreg &= ~(DMA_CR_ERCA_MASK | DMA_CR_HOE_MASK | DMA_CR_CLM_MASK | DMA_CR_EDBG_MASK); - tmpreg |= (DMA_CR_ERCA(config->enableRoundRobinArbitration) | DMA_CR_HOE(config->enableHaltOnError) | - DMA_CR_CLM(config->enableContinuousLinkMode) | DMA_CR_EDBG(config->enableDebugMode) | DMA_CR_EMLM(1U)); - EDMA_BASE(base)->CR = tmpreg; -#else - tmpreg = EDMA_MP_BASE(base)->MP_CSR; -#if defined FSL_FEATURE_EDMA_HAS_GLOBAL_MASTER_ID_REPLICATION && FSL_FEATURE_EDMA_HAS_GLOBAL_MASTER_ID_REPLICATION - tmpreg = (tmpreg & ~(DMA_MP_CSR_HAE_MASK | DMA_MP_CSR_ERCA_MASK | DMA_MP_CSR_EDBG_MASK | DMA_MP_CSR_GCLC_MASK | - DMA_MP_CSR_GMRC_MASK | DMA_MP_CSR_HALT_MASK)) | - DMA_MP_CSR_GMRC(config->enableMasterIdReplication) | DMA_MP_CSR_HAE(config->enableHaltOnError) | - DMA_MP_CSR_ERCA(config->enableRoundRobinArbitration) | DMA_MP_CSR_EDBG(config->enableDebugMode) | - DMA_MP_CSR_GCLC(config->enableGlobalChannelLink); -#else - tmpreg = (tmpreg & ~(DMA_MP_CSR_HAE_MASK | DMA_MP_CSR_ERCA_MASK | DMA_MP_CSR_EDBG_MASK | DMA_MP_CSR_GCLC_MASK | - DMA_MP_CSR_HALT_MASK)) | - DMA_MP_CSR_HAE(config->enableHaltOnError) | DMA_MP_CSR_ERCA(config->enableRoundRobinArbitration) | - DMA_MP_CSR_EDBG(config->enableDebugMode) | DMA_MP_CSR_GCLC(config->enableGlobalChannelLink); -#endif - EDMA_MP_BASE(base)->MP_CSR = tmpreg; - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG && FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG - /* channel transfer configuration */ - for (i = 0U; i < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base); i++) - { - if (config->channelConfig[i] != NULL) - { - EDMA_InitChannel(base, i, config->channelConfig[i]); - } - } -#endif -#endif -} - -/*! - * brief Deinitializes the eDMA peripheral. - * - * This function gates the eDMA clock. - * - * param base eDMA peripheral base address. - */ -void EDMA_Deinit(EDMA_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate EDMA peripheral clock */ - CLOCK_DisableClock(s_edmaClockName[EDMA_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG && FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG -/*! - * brief EDMA Channel initialization - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param channelConfig pointer to user's eDMA channel config structure, see edma_channel_config_t for detail. - */ -void EDMA_InitChannel(EDMA_Type *base, uint32_t channel, edma_channel_config_t *channelConfig) -{ - assert(channelConfig != NULL); - - EDMA_SetChannelPreemptionConfig(base, channel, &channelConfig->channelPreemptionConfig); - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE && FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE - EDMA_SetChannelSwapSize(base, channel, channelConfig->channelSwapSize); -#endif - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE && FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE - EDMA_SetChannelMemoryAttribute(base, channel, channelConfig->channelWriteMemoryAttribute, - channelConfig->channelReadMemoryAttribute); -#endif -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_SIGN_EXTENSION && FSL_FEATURE_EDMA_HAS_CHANNEL_SIGN_EXTENSION - EDMA_SetChannelSignExtension(base, channel, channelConfig->channelDataSignExtensionBitPosition); -#endif -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE && FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE - EDMA_SetChannelAccessType(base, channel, channelConfig->channelAccessType); -#endif - -#if (defined FSL_FEATURE_EDMA_HAS_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_CHANNEL_MUX) || \ - (defined FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX) - if (0U != (uint32_t)channelConfig->channelRequestSource) - { - /* dma request source */ - EDMA_SetChannelMux(base, channel, (int32_t)channelConfig->channelRequestSource); - } -#endif - - /* master ID replication */ - EDMA_EnableChannelMasterIDReplication(base, channel, channelConfig->enableMasterIDReplication); -#if !(defined(FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) && FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) - /* dma transfer security level */ - EDMA_SetChannelSecurityLevel(base, channel, channelConfig->securityLevel); -#endif - /* dma transfer protection level */ - EDMA_SetChannelProtectionLevel(base, channel, channelConfig->protectionLevel); -} -#endif - -/*! - * brief Gets the eDMA default configuration structure. - * - * This function sets the configuration structure to default values. - * The default configuration is set to the following values. - * code - * config.enableContinuousLinkMode = false; - * config.enableHaltOnError = true; - * config.enableRoundRobinArbitration = false; - * config.enableDebugMode = false; - * endcode - * - * param config A pointer to the eDMA configuration structure. - */ -void EDMA_GetDefaultConfig(edma_config_t *config) -{ - assert(config != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->enableRoundRobinArbitration = false; - - config->enableHaltOnError = true; - -#if defined FSL_FEATURE_EDMA_HAS_CONTINUOUS_LINK_MODE && FSL_FEATURE_EDMA_HAS_CONTINUOUS_LINK_MODE - config->enableContinuousLinkMode = false; -#endif - -#if defined FSL_FEATURE_EDMA_HAS_GLOBAL_MASTER_ID_REPLICATION && FSL_FEATURE_EDMA_HAS_GLOBAL_MASTER_ID_REPLICATION - config->enableMasterIdReplication = false; -#endif - - config->enableDebugMode = false; - - config->enableGlobalChannelLink = true; -} - -/*! - * brief Sets all TCD registers to default values. - * - * This function sets TCD registers for this channel to default values. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * note This function must not be called while the channel transfer is ongoing - * or it causes unpredictable results. - * note This function enables the auto stop request feature. - */ -void EDMA_ResetChannel(EDMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - /* reset channel CSR */ - EDMA_ClearChannelStatusFlags(base, channel, (uint32_t)kEDMA_DoneFlag | (uint32_t)kEDMA_ErrorFlag); - /* reset channel TCD */ - EDMA_TcdResetExt(base, EDMA_TCD_BASE(base, channel)); -} - -/*! - * brief Configures the eDMA transfer attribute. - * - * This function configures the transfer attribute, including source address, destination address, - * transfer size, address offset, and so on. It also configures the scatter gather feature if the - * user supplies the TCD address. - * Example: - * code - * edma_transfer_t config; - * edma_tcd_t tcd; - * config.srcAddr = ..; - * config.destAddr = ..; - * ... - * EDMA_SetTransferConfig(DMA0, channel, &config, &stcd); - * endcode - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param config Pointer to eDMA transfer configuration structure. - * param nextTcd Point to TCD structure. It can be NULL if users - * do not want to enable scatter/gather feature. - * note If nextTcd is not NULL, it means scatter gather feature is enabled - * and DREQ bit is cleared in the previous transfer configuration, which - * is set in the eDMA_ResetChannel. - */ -void EDMA_SetTransferConfig(EDMA_Type *base, - uint32_t channel, - const edma_transfer_config_t *config, - edma_tcd_t *nextTcd) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - assert(config != NULL); - - EDMA_TcdSetTransferConfigExt(base, EDMA_TCD_BASE(base, channel), config, - (edma_tcd_t *)CONVERT_TO_DMA_ADDRESS(nextTcd)); -} - -/*! - * brief Configures the eDMA minor offset feature. - * - * The minor offset means that the signed-extended value is added to the source address or destination - * address after each minor loop. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param config A pointer to the minor offset configuration structure. - */ -void EDMA_SetMinorOffsetConfig(EDMA_Type *base, uint32_t channel, const edma_minor_offset_config_t *config) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - assert(config != NULL); - - uint32_t tmpreg; - - tmpreg = EDMA_TCD_NBYTES(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)); - tmpreg &= ~(DMA_NBYTES_MLOFFYES_SMLOE_MASK | DMA_NBYTES_MLOFFYES_DMLOE_MASK | DMA_NBYTES_MLOFFYES_MLOFF_MASK); - tmpreg |= - (DMA_NBYTES_MLOFFYES_SMLOE(config->enableSrcMinorOffset) | - DMA_NBYTES_MLOFFYES_DMLOE(config->enableDestMinorOffset) | DMA_NBYTES_MLOFFYES_MLOFF(config->minorOffset)); - EDMA_TCD_NBYTES(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) = tmpreg; -} - -/*! - * brief Configures the eDMA channel TCD major offset feature. - * - * Adjustment value added to the source address at the completion of the major iteration count - * - * param base eDMA peripheral base address. - * param channel edma channel number. - * param sourceOffset source address offset. - * param destOffset destination address offset. - */ -void EDMA_SetMajorOffsetConfig(EDMA_Type *base, uint32_t channel, int32_t sourceOffset, int32_t destOffset) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - EDMA_TCD_SLAST(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) = (uint32_t)sourceOffset; - EDMA_TCD_DLAST_SGA(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) = (uint32_t)destOffset; -} - -/*! - * brief Configures the eDMA channel preemption feature. - * - * This function configures the channel preemption attribute and the priority of the channel. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number - * param config A pointer to the channel preemption configuration structure. - */ -void EDMA_SetChannelPreemptionConfig(EDMA_Type *base, uint32_t channel, const edma_channel_Preemption_config_t *config) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - assert(config != NULL); - - bool tmpEnablePreemptAbility = config->enablePreemptAbility; - bool tmpEnablchannelPreemption = config->enableChannelPreemption; - uint8_t tmpChannelPriority = config->channelPriority; - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - - volatile uint8_t *tmpReg = &EDMA_BASE(base)->DCHPRI3; - - ((volatile uint8_t *)tmpReg)[DMA_DCHPRI_INDEX(channel)] = - (DMA_DCHPRI0_DPA((true == tmpEnablePreemptAbility ? 0U : 1U)) | - DMA_DCHPRI0_ECP((true == tmpEnablchannelPreemption ? 1U : 0U)) | DMA_DCHPRI0_CHPRI(tmpChannelPriority)); -#else - EDMA_CHANNEL_BASE(base, channel)->CH_PRI = DMA_CH_PRI_ECP(tmpEnablchannelPreemption) | - DMA_CH_PRI_DPA(tmpEnablePreemptAbility) | - DMA_CH_PRI_APL(tmpChannelPriority); -#endif -} - -/*! - * brief Sets the channel link for the eDMA transfer. - * - * This function configures either the minor link or the major link mode. The minor link means that the channel link is - * triggered every time CITER decreases by 1. The major link means that the channel link is triggered when the CITER is - * exhausted. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param type A channel link type, which can be one of the following: - * arg kEDMA_LinkNone - * arg kEDMA_MinorLink - * arg kEDMA_MajorLink - * param linkedChannel The linked channel number. - * note Users should ensure that DONE flag is cleared before calling this interface, or the configuration is invalid. - */ -void EDMA_SetChannelLink(EDMA_Type *base, uint32_t channel, edma_channel_link_type_t type, uint32_t linkedChannel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - assert(linkedChannel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - EDMA_TcdSetChannelLinkExt(base, EDMA_TCD_BASE(base, channel), type, linkedChannel); -} - -#if defined FSL_FEATURE_EDMA_HAS_BANDWIDTH && FSL_FEATURE_EDMA_HAS_BANDWIDTH -/*! - * brief Sets the bandwidth for the eDMA transfer. - * - * Because the eDMA processes the minor loop, it continuously generates read/write sequences - * until the minor count is exhausted. The bandwidth forces the eDMA to stall after the completion of - * each read/write access to control the bus request bandwidth seen by the crossbar switch. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param bandWidth A bandwidth setting, which can be one of the following: - * arg kEDMABandwidthStallNone - * arg kEDMABandwidthStall4Cycle - * arg kEDMABandwidthStall8Cycle - */ -void EDMA_SetBandWidth(EDMA_Type *base, uint32_t channel, edma_bandwidth_t bandWidth) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - EDMA_TCD_CSR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) = - (uint16_t)((EDMA_TCD_CSR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) & (~DMA_CSR_BWC_MASK)) | - DMA_CSR_BWC(bandWidth)); -} -#endif - -/*! - * brief Sets the source modulo and the destination modulo for the eDMA transfer. - * - * This function defines a specific address range specified to be the value after (SADDR + SOFF)/(DADDR + DOFF) - * calculation is performed or the original register value. It provides the ability to implement a circular data - * queue easily. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param srcModulo A source modulo value. - * param destModulo A destination modulo value. - */ -void EDMA_SetModulo(EDMA_Type *base, uint32_t channel, edma_modulo_t srcModulo, edma_modulo_t destModulo) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - uint16_t tmpreg = EDMA_TCD_ATTR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) & - (~(uint16_t)(DMA_ATTR_SMOD_MASK | DMA_ATTR_DMOD_MASK)); - EDMA_TCD_ATTR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) = - tmpreg | DMA_ATTR_DMOD(destModulo) | DMA_ATTR_SMOD(srcModulo); -} - -/*! - * brief Sets all fields to default values for the TCD structure. - * - * This function sets all fields for this TCD structure to default value. - * - * param base eDMA peripheral base address. - * param tcd Pointer to the TCD structure. - * note This function enables the auto stop request feature. - */ -void EDMA_TcdResetExt(EDMA_Type *base, edma_tcd_t *tcd) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - - /* Reset channel TCD */ - EDMA_TCD_SADDR(tcd, EDMA_TCD_TYPE(base)) = 0U; - EDMA_TCD_SOFF(tcd, EDMA_TCD_TYPE(base)) = 0U; - EDMA_TCD_ATTR(tcd, EDMA_TCD_TYPE(base)) = 0U; - EDMA_TCD_NBYTES(tcd, EDMA_TCD_TYPE(base)) = 0U; - EDMA_TCD_SLAST(tcd, EDMA_TCD_TYPE(base)) = 0U; - EDMA_TCD_DADDR(tcd, EDMA_TCD_TYPE(base)) = 0U; - EDMA_TCD_DOFF(tcd, EDMA_TCD_TYPE(base)) = 0U; - EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)) = 0U; - EDMA_TCD_DLAST_SGA(tcd, EDMA_TCD_TYPE(base)) = 0U; - /* Enable auto disable request feature */ - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) = DMA_CSR_DREQ(1U); - EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)) = 0U; -} - -/*! - * brief Configures the eDMA TCD transfer attribute. - * - * The TCD is a transfer control descriptor. The content of the TCD is the same as the hardware TCD registers. - * The TCD is used in the scatter-gather mode. - * This function configures the TCD transfer attribute, including source address, destination address, - * transfer size, address offset, and so on. It also configures the scatter gather feature if the - * user supplies the next TCD address. - * Example: - * code - * edma_transfer_t config = { - * ... - * } - * edma_tcd_t tcd __aligned(32); - * edma_tcd_t nextTcd __aligned(32); - * EDMA_TcdSetTransferConfig(&tcd, &config, &nextTcd); - * endcode - * - * param base eDMA peripheral base address. - * param tcd Pointer to the TCD structure. - * param config Pointer to eDMA transfer configuration structure. - * param nextTcd Pointer to the next TCD structure. It can be NULL if users - * do not want to enable scatter/gather feature. - * note TCD address should be 32 bytes aligned or it causes an eDMA error. - * note If the nextTcd is not NULL, the scatter gather feature is enabled - * and DREQ bit is cleared in the previous transfer configuration, which - * is set in the EDMA_TcdReset. - */ -void EDMA_TcdSetTransferConfigExt(EDMA_Type *base, - edma_tcd_t *tcd, - const edma_transfer_config_t *config, - edma_tcd_t *nextTcd) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - assert(config != NULL); - - EDMA_ConfigChannelSoftwareTCDExt(base, tcd, config); - - if (nextTcd != NULL) - { - EDMA_TCD_DLAST_SGA(tcd, EDMA_TCD_TYPE(base)) = CONVERT_TO_DMA_ADDRESS(nextTcd); - /* - Before call EDMA_TcdSetTransferConfig or EDMA_SetTransferConfig, - user must call EDMA_TcdReset or EDMA_ResetChannel which will set - DREQ, so must use "|" or "&" rather than "=". - - Clear the DREQ bit because scatter gather has been enabled, so the - previous transfer is not the last transfer, and channel request should - be enabled at the next transfer(the next TCD). - */ - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) = - (EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) | (uint16_t)DMA_CSR_ESG_MASK) & ~(uint16_t)DMA_CSR_DREQ_MASK; - } -} - -/*! - * brief Sets TCD fields according to the user's channel transfer configuration structure, see - * edma_transfer_config_t. - * - * Application should be careful about the TCD pool buffer storage class, - * - For the platform has cache, the software TCD should be put in non cache section - * - The TCD pool buffer should have a consistent storage class. - * - * param base eDMA peripheral base address. - * param tcd Pointer to the TCD structure. - * param transfer channel transfer configuration pointer. - * - */ -void EDMA_ConfigChannelSoftwareTCDExt(EDMA_Type *base, edma_tcd_t *tcd, const edma_transfer_config_t *transfer) -{ - assert(transfer != NULL); - assert((transfer->minorLoopBytes % (1UL << ((uint32_t)transfer->srcTransferSize))) == 0U); - assert((transfer->minorLoopBytes % (1UL << ((uint32_t)transfer->destTransferSize))) == 0U); - assert(((uint32_t)transfer->srcOffset % (1UL << ((uint32_t)transfer->srcTransferSize))) == 0U); - assert(((uint32_t)transfer->destOffset % (1UL << ((uint32_t)transfer->destTransferSize))) == 0U); - assert((transfer->srcAddr % (1UL << ((uint32_t)transfer->srcTransferSize))) == 0U); - assert((transfer->destAddr % (1UL << ((uint32_t)transfer->destTransferSize))) == 0U); - assert((transfer->srcAddr % (1UL << ((uint32_t)transfer->srcAddrModulo))) == 0U); - assert((transfer->destAddr % (1UL << ((uint32_t)transfer->dstAddrModulo))) == 0U); - - uint16_t tmpreg; - - EDMA_TCD_SADDR(tcd, EDMA_TCD_TYPE(base)) = CONVERT_TO_DMA_ADDRESS(transfer->srcAddr); - /* destination address */ - EDMA_TCD_DADDR(tcd, EDMA_TCD_TYPE(base)) = CONVERT_TO_DMA_ADDRESS(transfer->destAddr); - /* Source data and destination data transfer size */ - EDMA_TCD_ATTR(tcd, EDMA_TCD_TYPE(base)) = - DMA_ATTR_SSIZE(transfer->srcTransferSize) | DMA_ATTR_DSIZE(transfer->destTransferSize); - - /* Source address signed offset */ - EDMA_TCD_SOFF(tcd, EDMA_TCD_TYPE(base)) = (uint16_t)(transfer->srcOffset); - /* Destination address signed offset */ - EDMA_TCD_DOFF(tcd, EDMA_TCD_TYPE(base)) = (uint16_t)(transfer->destOffset); - - if (((transfer->enableSrcMinorLoopOffset) || (transfer->enableDstMinorLoopOffset))) - { - EDMA_TCD_NBYTES(tcd, EDMA_TCD_TYPE(base)) = DMA_NBYTES_MLOFFYES_NBYTES(transfer->minorLoopBytes) | - DMA_NBYTES_MLOFFYES_MLOFF(transfer->minorLoopOffset) | - DMA_NBYTES_MLOFFYES_DMLOE(transfer->enableDstMinorLoopOffset) | - DMA_NBYTES_MLOFFYES_SMLOE(transfer->enableSrcMinorLoopOffset); - } - else - { - EDMA_TCD_NBYTES(tcd, EDMA_TCD_TYPE(base)) = DMA_NBYTES_MLOFFNO_NBYTES(transfer->minorLoopBytes); - } - - /* Current major iteration count */ - EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)) = (uint16_t)(transfer->majorLoopCounts); - /* Starting major iteration count */ - EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)) = (uint16_t)(transfer->majorLoopCounts); - /* reset CSR firstly */ - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) = DMA_CSR_DREQ(1U); - /* Enable scatter/gather processing */ - if (transfer->linkTCD != NULL) - { - EDMA_TCD_DLAST_SGA(tcd, EDMA_TCD_TYPE(base)) = CONVERT_TO_DMA_ADDRESS((uint32_t)((uint8_t *)transfer->linkTCD)); - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) = - (EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) | (uint16_t)DMA_CSR_ESG_MASK) & ~(uint16_t)DMA_CSR_DREQ_MASK; - } - else - { - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_CSR_ESG_MASK; - EDMA_TCD_DLAST_SGA(tcd, EDMA_TCD_TYPE(base)) = (uint32_t)transfer->dstMajorLoopOffset; - } - - /* configure interrupt/auto disable channel request */ - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) |= (transfer->enabledInterruptMask & (~(uint16_t)kEDMA_ErrorInterruptEnable)); - - /* Minor link config */ - if (transfer->enableChannelMinorLoopLink) - { - /* Enable minor link */ - EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)) |= DMA_CITER_ELINKYES_ELINK_MASK; - EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)) |= DMA_BITER_ELINKYES_ELINK_MASK; - /* Set linked channel */ - tmpreg = EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)) & (~(uint16_t)DMA_CITER_ELINKYES_LINKCH_MASK); - tmpreg |= DMA_CITER_ELINKYES_LINKCH(transfer->minorLoopLinkChannel); - EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)) = tmpreg; - tmpreg = EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)) & (~(uint16_t)DMA_BITER_ELINKYES_LINKCH_MASK); - tmpreg |= DMA_BITER_ELINKYES_LINKCH(transfer->minorLoopLinkChannel); - EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)) = tmpreg; - } - /* Major link config */ - if (transfer->enableChannelMajorLoopLink) - { - /* Enable major link */ - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) |= DMA_CSR_MAJORELINK_MASK; - /* Set major linked channel */ - tmpreg = EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) & (~(uint16_t)DMA_CSR_MAJORLINKCH_MASK); - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) = tmpreg | DMA_CSR_MAJORLINKCH(transfer->majorLoopLinkChannel); - } - - /* clear link relate field if no channel link enabled */ - if ((!transfer->enableChannelMajorLoopLink) && (!transfer->enableChannelMinorLoopLink)) - { - EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_CITER_ELINKYES_ELINK_MASK; - EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_BITER_ELINKYES_ELINK_MASK; - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_CSR_MAJORELINK_MASK; - } - - /* major loop offset */ - EDMA_TCD_SLAST(tcd, EDMA_TCD_TYPE(base)) = (uint32_t)transfer->srcMajorLoopOffset; - /* modulo feature */ - tmpreg = EDMA_TCD_ATTR(tcd, EDMA_TCD_TYPE(base)) & (~(uint16_t)(DMA_ATTR_SMOD_MASK | DMA_ATTR_DMOD_MASK)); - EDMA_TCD_ATTR(tcd, EDMA_TCD_TYPE(base)) = - tmpreg | DMA_ATTR_DMOD(transfer->dstAddrModulo) | DMA_ATTR_SMOD(transfer->srcAddrModulo); -} - -/*! - * brief Configures the eDMA TCD minor offset feature. - * - * A minor offset is a signed-extended value added to the source address or a destination - * address after each minor loop. - * - * param base eDMA peripheral base address. - * param tcd A point to the TCD structure. - * param config A pointer to the minor offset configuration structure. - */ -void EDMA_TcdSetMinorOffsetConfigExt(EDMA_Type *base, edma_tcd_t *tcd, const edma_minor_offset_config_t *config) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - - uint32_t tmpreg; - - tmpreg = EDMA_TCD_NBYTES(tcd, EDMA_TCD_TYPE(base)) & - ~(DMA_NBYTES_MLOFFYES_SMLOE_MASK | DMA_NBYTES_MLOFFYES_DMLOE_MASK | DMA_NBYTES_MLOFFYES_MLOFF_MASK); - tmpreg |= - (DMA_NBYTES_MLOFFYES_SMLOE(config->enableSrcMinorOffset) | - DMA_NBYTES_MLOFFYES_DMLOE(config->enableDestMinorOffset) | DMA_NBYTES_MLOFFYES_MLOFF(config->minorOffset)); - EDMA_TCD_NBYTES(tcd, EDMA_TCD_TYPE(base)) = tmpreg; -} - -/*! - * brief Configures the eDMA TCD major offset feature. - * - * Adjustment value added to the source address at the completion of the major iteration count - * - * param base eDMA peripheral base address. - * param tcd A point to the TCD structure. - * param sourceOffset source address offset. - * param destOffset destination address offset. - */ -void EDMA_TcdSetMajorOffsetConfigExt(EDMA_Type *base, edma_tcd_t *tcd, int32_t sourceOffset, int32_t destOffset) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - - EDMA_TCD_SLAST(tcd, EDMA_TCD_TYPE(base)) = (uint32_t)sourceOffset; - EDMA_TCD_DLAST_SGA(tcd, EDMA_TCD_TYPE(base)) = (uint32_t)destOffset; -} - -/*! - * brief Sets the channel link for the eDMA TCD. - * - * This function configures either a minor link or a major link. The minor link means the channel link is - * triggered every time CITER decreases by 1. The major link means that the channel link is triggered when the CITER is - * exhausted. - * - * note Users should ensure that DONE flag is cleared before calling this interface, or the configuration is invalid. - * param base eDMA peripheral base address. - * param tcd Point to the TCD structure. - * param type Channel link type, it can be one of: - * arg kEDMA_LinkNone - * arg kEDMA_MinorLink - * arg kEDMA_MajorLink - * param linkedChannel The linked channel number. - */ -void EDMA_TcdSetChannelLinkExt(EDMA_Type *base, edma_tcd_t *tcd, edma_channel_link_type_t type, uint32_t linkedChannel) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - assert(linkedChannel < (uint32_t)FSL_FEATURE_EDMA_MODULE_CHANNEL); - - if (type == kEDMA_MinorLink) /* Minor link config */ - { - uint16_t tmpreg; - - /* Enable minor link */ - EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)) |= DMA_CITER_ELINKYES_ELINK_MASK; - EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)) |= DMA_BITER_ELINKYES_ELINK_MASK; - /* Set linked channel */ - tmpreg = EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)) & (~(uint16_t)DMA_CITER_ELINKYES_LINKCH_MASK); - tmpreg |= DMA_CITER_ELINKYES_LINKCH(linkedChannel); - EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)) = tmpreg; - tmpreg = EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)) & (~(uint16_t)DMA_BITER_ELINKYES_LINKCH_MASK); - tmpreg |= DMA_BITER_ELINKYES_LINKCH(linkedChannel); - EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)) = tmpreg; - } - else if (type == kEDMA_MajorLink) /* Major link config */ - { - uint16_t tmpreg; - - /* Enable major link */ - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) |= DMA_CSR_MAJORELINK_MASK; - /* Set major linked channel */ - tmpreg = EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) & (~(uint16_t)DMA_CSR_MAJORLINKCH_MASK); - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) = tmpreg | DMA_CSR_MAJORLINKCH(linkedChannel); - } - else /* Link none */ - { - EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_CITER_ELINKYES_ELINK_MASK; - EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_BITER_ELINKYES_ELINK_MASK; - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_CSR_MAJORELINK_MASK; - } -} - -/*! - * brief Sets the source modulo and the destination modulo for the eDMA TCD. - * - * This function defines a specific address range specified to be the value after (SADDR + SOFF)/(DADDR + DOFF) - * calculation is performed or the original register value. It provides the ability to implement a circular data - * queue easily. - * - * param base eDMA peripheral base address. - * param tcd A pointer to the TCD structure. - * param srcModulo A source modulo value. - * param destModulo A destination modulo value. - */ -void EDMA_TcdSetModuloExt(EDMA_Type *base, edma_tcd_t *tcd, edma_modulo_t srcModulo, edma_modulo_t destModulo) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - - uint16_t tmpreg; - - tmpreg = EDMA_TCD_ATTR(tcd, EDMA_TCD_TYPE(base)) & (~(uint16_t)(DMA_ATTR_SMOD_MASK | DMA_ATTR_DMOD_MASK)); - EDMA_TCD_ATTR(tcd, EDMA_TCD_TYPE(base)) = tmpreg | DMA_ATTR_DMOD(destModulo) | DMA_ATTR_SMOD(srcModulo); -} - -/*! - * brief Enables the interrupt source for the eDMA TCD. - * - * param base eDMA peripheral base address. - * param tcd Point to the TCD structure. - * param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_TcdEnableInterruptsExt(EDMA_Type *base, edma_tcd_t *tcd, uint32_t mask) -{ - assert(tcd != NULL); - - /* Enable Major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_MajorInterruptEnable)) - { - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) |= DMA_CSR_INTMAJOR_MASK; - } - - /* Enable Half major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_HalfInterruptEnable)) - { - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) |= DMA_CSR_INTHALF_MASK; - } -} - -/*! - * brief Disables the interrupt source for the eDMA TCD. - * - * param base eDMA peripheral base address. - * param tcd Point to the TCD structure. - * param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_TcdDisableInterruptsExt(EDMA_Type *base, edma_tcd_t *tcd, uint32_t mask) -{ - assert(tcd != NULL); - - /* Disable Major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_MajorInterruptEnable)) - { - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_CSR_INTMAJOR_MASK; - } - - /* Disable Half major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_HalfInterruptEnable)) - { - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_CSR_INTHALF_MASK; - } -} - -/*! - * brief Sets all fields to default values for the TCD structure. - * - * Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API ref - * EDMA_TcdResetExt - * - * This function sets all fields for this TCD structure to default value. - * - * param tcd Pointer to the TCD structure. - * note This function enables the auto stop request feature. - */ -void EDMA_TcdReset(edma_tcd_t *tcd) -{ - assert(tcd != NULL); - - /* Reset channel TCD */ - EDMA_TCD_SADDR(tcd, kEDMA_EDMA4Flag) = 0U; - EDMA_TCD_SOFF(tcd, kEDMA_EDMA4Flag) = 0U; - EDMA_TCD_ATTR(tcd, kEDMA_EDMA4Flag) = 0U; - EDMA_TCD_NBYTES(tcd, kEDMA_EDMA4Flag) = 0U; - EDMA_TCD_SLAST(tcd, kEDMA_EDMA4Flag) = 0U; - EDMA_TCD_DADDR(tcd, kEDMA_EDMA4Flag) = 0U; - EDMA_TCD_DOFF(tcd, kEDMA_EDMA4Flag) = 0U; - EDMA_TCD_CITER(tcd, kEDMA_EDMA4Flag) = 0U; - EDMA_TCD_DLAST_SGA(tcd, kEDMA_EDMA4Flag) = 0U; - /* Enable auto disable request feature */ - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) = DMA_CSR_DREQ(1U); - EDMA_TCD_BITER(tcd, kEDMA_EDMA4Flag) = 0U; -} - -/*! - * brief Configures the eDMA TCD transfer attribute. - * - * Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API ref - * EDMA_TcdSetTransferConfigExt - * - * The TCD is a transfer control descriptor. The content of the TCD is the same as the hardware TCD registers. - * The TCD is used in the scatter-gather mode. - * This function configures the TCD transfer attribute, including source address, destination address, - * transfer size, address offset, and so on. It also configures the scatter gather feature if the - * user supplies the next TCD address. - * Example: - * code - * edma_transfer_t config = { - * ... - * } - * edma_tcd_t tcd __aligned(32); - * edma_tcd_t nextTcd __aligned(32); - * EDMA_TcdSetTransferConfig(&tcd, &config, &nextTcd); - * endcode - * - * param tcd Pointer to the TCD structure. - * param config Pointer to eDMA transfer configuration structure. - * param nextTcd Pointer to the next TCD structure. It can be NULL if users - * do not want to enable scatter/gather feature. - * note TCD address should be 32 bytes aligned or it causes an eDMA error. - * note If the nextTcd is not NULL, the scatter gather feature is enabled - * and DREQ bit is cleared in the previous transfer configuration, which - * is set in the EDMA_TcdReset. - */ -void EDMA_TcdSetTransferConfig(edma_tcd_t *tcd, const edma_transfer_config_t *config, edma_tcd_t *nextTcd) -{ - assert(tcd != NULL); - assert(config != NULL); - - EDMA_ConfigChannelSoftwareTCD(tcd, config); - - if (nextTcd != NULL) - { - EDMA_TCD_DLAST_SGA(tcd, kEDMA_EDMA4Flag) = CONVERT_TO_DMA_ADDRESS(nextTcd); - /* - Before call EDMA_TcdSetTransferConfig or EDMA_SetTransferConfig, - user must call EDMA_TcdReset or EDMA_ResetChannel which will set - DREQ, so must use "|" or "&" rather than "=". - - Clear the DREQ bit because scatter gather has been enabled, so the - previous transfer is not the last transfer, and channel request should - be enabled at the next transfer(the next TCD). - */ - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) = - (EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) | (uint16_t)DMA_CSR_ESG_MASK) & ~(uint16_t)DMA_CSR_DREQ_MASK; - } -} - -/*! - * brief Sets TCD fields according to the user's channel transfer configuration structure, see - * edma_transfer_config_t. - * - * Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API ref - * EDMA_ConfigChannelSoftwareTCDExt - * - * Application should be careful about the TCD pool buffer storage class, - * - For the platform has cache, the software TCD should be put in non cache section - * - The TCD pool buffer should have a consistent storage class. - * - * param tcd Pointer to the TCD structure. - * param transfer channel transfer configuration pointer. - * - */ -void EDMA_ConfigChannelSoftwareTCD(edma_tcd_t *tcd, const edma_transfer_config_t *transfer) -{ - assert(transfer != NULL); - assert((transfer->minorLoopBytes % (1UL << ((uint32_t)transfer->srcTransferSize))) == 0U); - assert((transfer->minorLoopBytes % (1UL << ((uint32_t)transfer->destTransferSize))) == 0U); - assert(((uint32_t)transfer->srcOffset % (1UL << ((uint32_t)transfer->srcTransferSize))) == 0U); - assert(((uint32_t)transfer->destOffset % (1UL << ((uint32_t)transfer->destTransferSize))) == 0U); - assert((transfer->srcAddr % (1UL << ((uint32_t)transfer->srcTransferSize))) == 0U); - assert((transfer->destAddr % (1UL << ((uint32_t)transfer->destTransferSize))) == 0U); - assert((transfer->srcAddr % (1UL << ((uint32_t)transfer->srcAddrModulo))) == 0U); - assert((transfer->destAddr % (1UL << ((uint32_t)transfer->dstAddrModulo))) == 0U); - - uint16_t tmpreg; - - EDMA_TCD_SADDR(tcd, kEDMA_EDMA4Flag) = CONVERT_TO_DMA_ADDRESS(transfer->srcAddr); - /* destination address */ - EDMA_TCD_DADDR(tcd, kEDMA_EDMA4Flag) = CONVERT_TO_DMA_ADDRESS(transfer->destAddr); - /* Source data and destination data transfer size */ - EDMA_TCD_ATTR(tcd, kEDMA_EDMA4Flag) = - DMA_ATTR_SSIZE(transfer->srcTransferSize) | DMA_ATTR_DSIZE(transfer->destTransferSize); - - /* Source address signed offset */ - EDMA_TCD_SOFF(tcd, kEDMA_EDMA4Flag) = (uint16_t)(transfer->srcOffset); - /* Destination address signed offset */ - EDMA_TCD_DOFF(tcd, kEDMA_EDMA4Flag) = (uint16_t)(transfer->destOffset); - - if (((transfer->enableSrcMinorLoopOffset) || (transfer->enableDstMinorLoopOffset))) - { - EDMA_TCD_NBYTES(tcd, kEDMA_EDMA4Flag) = DMA_NBYTES_MLOFFYES_NBYTES(transfer->minorLoopBytes) | - DMA_NBYTES_MLOFFYES_MLOFF(transfer->minorLoopOffset) | - DMA_NBYTES_MLOFFYES_DMLOE(transfer->enableDstMinorLoopOffset) | - DMA_NBYTES_MLOFFYES_SMLOE(transfer->enableSrcMinorLoopOffset); - } - else - { - EDMA_TCD_NBYTES(tcd, kEDMA_EDMA4Flag) = DMA_NBYTES_MLOFFNO_NBYTES(transfer->minorLoopBytes); - } - - /* Current major iteration count */ - EDMA_TCD_CITER(tcd, kEDMA_EDMA4Flag) = (uint16_t)(transfer->majorLoopCounts); - /* Starting major iteration count */ - EDMA_TCD_BITER(tcd, kEDMA_EDMA4Flag) = (uint16_t)(transfer->majorLoopCounts); - /* reset CSR firstly */ - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) = DMA_CSR_DREQ(1U); - /* Enable scatter/gather processing */ - if (transfer->linkTCD != NULL) - { - EDMA_TCD_DLAST_SGA(tcd, kEDMA_EDMA4Flag) = CONVERT_TO_DMA_ADDRESS((uint32_t)((uint8_t *)transfer->linkTCD)); - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) = - (EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) | (uint16_t)DMA_CSR_ESG_MASK) & ~(uint16_t)DMA_CSR_DREQ_MASK; - } - else - { - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) &= ~(uint16_t)DMA_CSR_ESG_MASK; - EDMA_TCD_DLAST_SGA(tcd, kEDMA_EDMA4Flag) = (uint32_t)transfer->dstMajorLoopOffset; - } - - /* configure interrupt/auto disable channel request */ - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) |= (transfer->enabledInterruptMask & (~(uint16_t)kEDMA_ErrorInterruptEnable)); - - /* Minor link config */ - if (transfer->enableChannelMinorLoopLink) - { - /* Enable minor link */ - EDMA_TCD_CITER(tcd, kEDMA_EDMA4Flag) |= DMA_CITER_ELINKYES_ELINK_MASK; - EDMA_TCD_BITER(tcd, kEDMA_EDMA4Flag) |= DMA_BITER_ELINKYES_ELINK_MASK; - /* Set linked channel */ - tmpreg = EDMA_TCD_CITER(tcd, kEDMA_EDMA4Flag) & (~(uint16_t)DMA_CITER_ELINKYES_LINKCH_MASK); - tmpreg |= DMA_CITER_ELINKYES_LINKCH(transfer->minorLoopLinkChannel); - EDMA_TCD_CITER(tcd, kEDMA_EDMA4Flag) = tmpreg; - tmpreg = EDMA_TCD_BITER(tcd, kEDMA_EDMA4Flag) & (~(uint16_t)DMA_BITER_ELINKYES_LINKCH_MASK); - tmpreg |= DMA_BITER_ELINKYES_LINKCH(transfer->minorLoopLinkChannel); - EDMA_TCD_BITER(tcd, kEDMA_EDMA4Flag) = tmpreg; - } - /* Major link config */ - if (transfer->enableChannelMajorLoopLink) - { - /* Enable major link */ - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) |= DMA_CSR_MAJORELINK_MASK; - /* Set major linked channel */ - tmpreg = EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) & (~(uint16_t)DMA_CSR_MAJORLINKCH_MASK); - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) = tmpreg | DMA_CSR_MAJORLINKCH(transfer->majorLoopLinkChannel); - } - - /* clear link relate field if no channel link enabled */ - if ((!transfer->enableChannelMajorLoopLink) && (!transfer->enableChannelMinorLoopLink)) - { - EDMA_TCD_CITER(tcd, kEDMA_EDMA4Flag) &= ~(uint16_t)DMA_CITER_ELINKYES_ELINK_MASK; - EDMA_TCD_BITER(tcd, kEDMA_EDMA4Flag) &= ~(uint16_t)DMA_BITER_ELINKYES_ELINK_MASK; - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) &= ~(uint16_t)DMA_CSR_MAJORELINK_MASK; - } - - /* major loop offset */ - EDMA_TCD_SLAST(tcd, kEDMA_EDMA4Flag) = (uint32_t)transfer->srcMajorLoopOffset; - /* modulo feature */ - tmpreg = EDMA_TCD_ATTR(tcd, kEDMA_EDMA4Flag) & (~(uint16_t)(DMA_ATTR_SMOD_MASK | DMA_ATTR_DMOD_MASK)); - EDMA_TCD_ATTR(tcd, kEDMA_EDMA4Flag) = - tmpreg | DMA_ATTR_DMOD(transfer->dstAddrModulo) | DMA_ATTR_SMOD(transfer->srcAddrModulo); -} - -/*! - * brief Configures the eDMA TCD minor offset feature. - * - * Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API ref - * EDMA_TcdSetMinorOffsetConfigExt - * - * A minor offset is a signed-extended value added to the source address or a destination - * address after each minor loop. - * - * param tcd A point to the TCD structure. - * param config A pointer to the minor offset configuration structure. - */ -void EDMA_TcdSetMinorOffsetConfig(edma_tcd_t *tcd, const edma_minor_offset_config_t *config) -{ - assert(tcd != NULL); - - uint32_t tmpreg; - - tmpreg = EDMA_TCD_NBYTES(tcd, kEDMA_EDMA4Flag) & - ~(DMA_NBYTES_MLOFFYES_SMLOE_MASK | DMA_NBYTES_MLOFFYES_DMLOE_MASK | DMA_NBYTES_MLOFFYES_MLOFF_MASK); - tmpreg |= - (DMA_NBYTES_MLOFFYES_SMLOE(config->enableSrcMinorOffset) | - DMA_NBYTES_MLOFFYES_DMLOE(config->enableDestMinorOffset) | DMA_NBYTES_MLOFFYES_MLOFF(config->minorOffset)); - EDMA_TCD_NBYTES(tcd, kEDMA_EDMA4Flag) = tmpreg; -} - -/*! - * brief Configures the eDMA TCD major offset feature. - * - * Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API ref - * EDMA_TcdSetMajorOffsetConfigExt - * - * Adjustment value added to the source address at the completion of the major iteration count - * - * param tcd A point to the TCD structure. - * param sourceOffset source address offset. - * param destOffset destination address offset. - */ -void EDMA_TcdSetMajorOffsetConfig(edma_tcd_t *tcd, int32_t sourceOffset, int32_t destOffset) -{ - assert(tcd != NULL); - - EDMA_TCD_SLAST(tcd, kEDMA_EDMA4Flag) = (uint32_t)sourceOffset; - EDMA_TCD_DLAST_SGA(tcd, kEDMA_EDMA4Flag) = (uint32_t)destOffset; -} - -/*! - * brief Sets the channel link for the eDMA TCD. - * - * Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API ref - * EDMA_TcdSetChannelLinkExt - * - * This function configures either a minor link or a major link. The minor link means the channel link is - * triggered every time CITER decreases by 1. The major link means that the channel link is triggered when the CITER is - * exhausted. - * - * note Users should ensure that DONE flag is cleared before calling this interface, or the configuration is invalid. - * param tcd Point to the TCD structure. - * param type Channel link type, it can be one of: - * arg kEDMA_LinkNone - * arg kEDMA_MinorLink - * arg kEDMA_MajorLink - * param linkedChannel The linked channel number. - */ -void EDMA_TcdSetChannelLink(edma_tcd_t *tcd, edma_channel_link_type_t type, uint32_t linkedChannel) -{ - assert(tcd != NULL); - assert(linkedChannel < (uint32_t)FSL_FEATURE_EDMA_MODULE_CHANNEL); - - if (type == kEDMA_MinorLink) /* Minor link config */ - { - uint16_t tmpreg; - - /* Enable minor link */ - EDMA_TCD_CITER(tcd, kEDMA_EDMA4Flag) |= DMA_CITER_ELINKYES_ELINK_MASK; - EDMA_TCD_BITER(tcd, kEDMA_EDMA4Flag) |= DMA_BITER_ELINKYES_ELINK_MASK; - /* Set linked channel */ - tmpreg = EDMA_TCD_CITER(tcd, kEDMA_EDMA4Flag) & (~(uint16_t)DMA_CITER_ELINKYES_LINKCH_MASK); - tmpreg |= DMA_CITER_ELINKYES_LINKCH(linkedChannel); - EDMA_TCD_CITER(tcd, kEDMA_EDMA4Flag) = tmpreg; - tmpreg = EDMA_TCD_BITER(tcd, kEDMA_EDMA4Flag) & (~(uint16_t)DMA_BITER_ELINKYES_LINKCH_MASK); - tmpreg |= DMA_BITER_ELINKYES_LINKCH(linkedChannel); - EDMA_TCD_BITER(tcd, kEDMA_EDMA4Flag) = tmpreg; - } - else if (type == kEDMA_MajorLink) /* Major link config */ - { - uint16_t tmpreg; - - /* Enable major link */ - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) |= DMA_CSR_MAJORELINK_MASK; - /* Set major linked channel */ - tmpreg = EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) & (~(uint16_t)DMA_CSR_MAJORLINKCH_MASK); - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) = tmpreg | DMA_CSR_MAJORLINKCH(linkedChannel); - } - else /* Link none */ - { - EDMA_TCD_CITER(tcd, kEDMA_EDMA4Flag) &= ~(uint16_t)DMA_CITER_ELINKYES_ELINK_MASK; - EDMA_TCD_BITER(tcd, kEDMA_EDMA4Flag) &= ~(uint16_t)DMA_BITER_ELINKYES_ELINK_MASK; - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) &= ~(uint16_t)DMA_CSR_MAJORELINK_MASK; - } -} - -/*! - * brief Sets the source modulo and the destination modulo for the eDMA TCD. - * - * Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API ref - * EDMA_TcdSetModuloExt - * - * This function defines a specific address range specified to be the value after (SADDR + SOFF)/(DADDR + DOFF) - * calculation is performed or the original register value. It provides the ability to implement a circular data - * queue easily. - * - * param tcd A pointer to the TCD structure. - * param srcModulo A source modulo value. - * param destModulo A destination modulo value. - */ -void EDMA_TcdSetModulo(edma_tcd_t *tcd, edma_modulo_t srcModulo, edma_modulo_t destModulo) -{ - assert(tcd != NULL); - - uint16_t tmpreg; - - tmpreg = EDMA_TCD_ATTR(tcd, kEDMA_EDMA4Flag) & (~(uint16_t)(DMA_ATTR_SMOD_MASK | DMA_ATTR_DMOD_MASK)); - EDMA_TCD_ATTR(tcd, kEDMA_EDMA4Flag) = tmpreg | DMA_ATTR_DMOD(destModulo) | DMA_ATTR_SMOD(srcModulo); -} - -/*! - * brief Enables the interrupt source for the eDMA TCD. - * - * Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API ref - * EDMA_TcdEnableInterruptsExt - * - * param tcd Point to the TCD structure. - * param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_TcdEnableInterrupts(edma_tcd_t *tcd, uint32_t mask) -{ - assert(tcd != NULL); - - /* Enable Major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_MajorInterruptEnable)) - { - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) |= DMA_CSR_INTMAJOR_MASK; - } - - /* Enable Half major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_HalfInterruptEnable)) - { - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) |= DMA_CSR_INTHALF_MASK; - } -} - -/*! - * brief Disables the interrupt source for the eDMA TCD. - * - * Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API ref - * EDMA_TcdDisableInterruptsExt - * - * param tcd Point to the TCD structure. - * param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_TcdDisableInterrupts(edma_tcd_t *tcd, uint32_t mask) -{ - assert(tcd != NULL); - - /* Disable Major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_MajorInterruptEnable)) - { - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) &= ~(uint16_t)DMA_CSR_INTMAJOR_MASK; - } - - /* Disable Half major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_HalfInterruptEnable)) - { - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) &= ~(uint16_t)DMA_CSR_INTHALF_MASK; - } -} - -/*! - * brief Gets the remaining major loop count from the eDMA current channel TCD. - * - * This function checks the TCD (Task Control Descriptor) status for a specified - * eDMA channel and returns the number of major loop count that has not finished. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * return Major loop count which has not been transferred yet for the current TCD. - * note 1. This function can only be used to get unfinished major loop count of transfer without - * the next TCD, or it might be inaccuracy. - * 2. The unfinished/remaining transfer bytes cannot be obtained directly from registers while - * the channel is running. - * Because to calculate the remaining bytes, the initial NBYTES configured in DMA_TCDn_NBYTES_MLNO - * register is needed while the eDMA IP does not support getting it while a channel is active. - * In another word, the NBYTES value reading is always the actual (decrementing) NBYTES value the dma_engine - * is working with while a channel is running. - * Consequently, to get the remaining transfer bytes, a software-saved initial value of NBYTES (for example - * copied before enabling the channel) is needed. The formula to calculate it is shown below: - * RemainingBytes = RemainingMajorLoopCount * NBYTES(initially configured) - */ -uint32_t EDMA_GetRemainingMajorLoopCount(EDMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - uint32_t remainingCount = 0; - - if (0U != DMA_GET_DONE_STATUS(base, channel)) - { - remainingCount = 0; - } - else - { - /* Calculate the unfinished bytes */ - if (0U != (EDMA_TCD_CITER(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) & DMA_CITER_ELINKNO_ELINK_MASK)) - { - remainingCount = (((uint32_t)EDMA_TCD_CITER(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) & - DMA_CITER_ELINKYES_CITER_MASK) >> - DMA_CITER_ELINKYES_CITER_SHIFT); - } - else - { - remainingCount = (((uint32_t)EDMA_TCD_CITER(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) & - DMA_CITER_ELINKNO_CITER_MASK) >> - DMA_CITER_ELINKNO_CITER_SHIFT); - } - } - - return remainingCount; -} - -/*! - * brief Enables the interrupt source for the eDMA transfer. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_EnableChannelInterrupts(EDMA_Type *base, uint32_t channel, uint32_t mask) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - /* Enable error interrupt */ - if (0U != (mask & (uint32_t)kEDMA_ErrorInterruptEnable)) - { - DMA_ENABLE_ERROR_INT(base, channel); - } - - /* Enable Major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_MajorInterruptEnable)) - { - DMA_ENABLE_MAJOR_INT(base, channel); - } - - /* Enable Half major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_HalfInterruptEnable)) - { - DMA_ENABLE_HALF_INT(base, channel); - } -} - -/*! - * brief Disables the interrupt source for the eDMA transfer. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param mask The mask of the interrupt source to be set. Use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_DisableChannelInterrupts(EDMA_Type *base, uint32_t channel, uint32_t mask) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - /* Disable error interrupt */ - if (0U != (mask & (uint32_t)kEDMA_ErrorInterruptEnable)) - { - DMA_DISABLE_ERROR_INT(base, channel); - } - - /* Disable Major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_MajorInterruptEnable)) - { - DMA_DISABLE_MAJOR_INT(base, channel); - } - - /* Disable Half major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_HalfInterruptEnable)) - { - DMA_DISABLE_HALF_INT(base, channel); - } -} - -/*! - * brief Gets the eDMA channel status flags. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * return The mask of channel status flags. Users need to use the - * _edma_channel_status_flags type to decode the return variables. - */ -uint32_t EDMA_GetChannelStatusFlags(EDMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - uint32_t retval = 0; - - /* Get DONE bit flag */ - retval |= DMA_GET_DONE_STATUS(base, channel); - /* Get ERROR bit flag */ - retval |= (DMA_GET_ERROR_STATUS(base, channel) << 1U); - /* Get INT bit flag */ - retval |= (DMA_GET_INT_STATUS(base, channel) << 2U); - - return retval; -} - -/*! - * brief Clears the eDMA channel status flags. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param mask The mask of channel status to be cleared. Users need to use - * the defined _edma_channel_status_flags type. - */ -void EDMA_ClearChannelStatusFlags(EDMA_Type *base, uint32_t channel, uint32_t mask) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - /* Clear DONE bit flag */ - if (0U != (mask & (uint32_t)kEDMA_DoneFlag)) - { - DMA_CLEAR_DONE_STATUS(base, channel); - } - /* Clear ERROR bit flag */ - if (0U != (mask & (uint32_t)kEDMA_ErrorFlag)) - { - DMA_CLEAR_ERROR_STATUS(base, channel); - } - /* Clear INT bit flag */ - if (0U != (mask & (uint32_t)kEDMA_InterruptFlag)) - { - DMA_CLEAR_INT_STATUS(base, channel); - } -} - -/*! - * brief Creates the eDMA handle. - * - * This function is called if using the transactional API for eDMA. This function - * initializes the internal state of the eDMA handle. - * - * param handle eDMA handle pointer. The eDMA handle stores callback function and - * parameters. - * param base eDMA peripheral base address. - * param channel eDMA channel number. - */ -void EDMA_CreateHandle(edma_handle_t *handle, EDMA_Type *base, uint32_t channel) -{ - assert(handle != NULL); - assert(FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base) != -1); - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - uint32_t edmaInstance; - edma_tcd_t *tcdRegs; - - /* Zero the handle */ - (void)memset(handle, 0, sizeof(*handle)); - - handle->channel = channel; - - /* Get the DMA instance number */ - edmaInstance = EDMA_GetInstance(base); - s_EDMAHandle[edmaInstance][channel] = handle; - /* Enable NVIC interrupt */ - (void)EnableIRQ(s_edmaIRQNumber[edmaInstance][channel]); - - handle->tcdBase = EDMA_TCD_BASE(base, channel); - handle->channelBase = EDMA_CHANNEL_BASE(base, channel); - handle->base = base; - /* - Reset TCD registers to zero. Unlike the EDMA_TcdReset(DREQ will be set), - CSR will be 0. Because in order to suit EDMA busy check mechanism in - EDMA_SubmitTransfer, CSR must be set 0. - */ - tcdRegs = handle->tcdBase; - EDMA_TCD_SADDR(tcdRegs, EDMA_TCD_TYPE(base)) = 0; - EDMA_TCD_SOFF(tcdRegs, EDMA_TCD_TYPE(base)) = 0; - EDMA_TCD_ATTR(tcdRegs, EDMA_TCD_TYPE(base)) = 0; - EDMA_TCD_NBYTES(tcdRegs, EDMA_TCD_TYPE(base)) = 0; - EDMA_TCD_SLAST(tcdRegs, EDMA_TCD_TYPE(base)) = 0; - EDMA_TCD_DADDR(tcdRegs, EDMA_TCD_TYPE(base)) = 0; - EDMA_TCD_DOFF(tcdRegs, EDMA_TCD_TYPE(base)) = 0; - EDMA_TCD_CITER(tcdRegs, EDMA_TCD_TYPE(base)) = 0; - EDMA_TCD_DLAST_SGA(tcdRegs, EDMA_TCD_TYPE(base)) = 0; - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(base)) = 0; - EDMA_TCD_BITER(tcdRegs, EDMA_TCD_TYPE(base)) = 0; -} - -/*! - * brief Installs the TCDs memory pool into the eDMA handle. - * - * This function is called after the EDMA_CreateHandle to use scatter/gather feature. This function shall only be used - * while users need to use scatter gather mode. Scatter gather mode enables EDMA to load a new transfer control block - * (tcd) in hardware, and automatically reconfigure that DMA channel for a new transfer. - * Users need to prepare tcd memory and also configure tcds using interface EDMA_SubmitTransfer. - * - * param handle eDMA handle pointer. - * param tcdPool A memory pool to store TCDs. It must be 32 bytes aligned. - * param tcdSize The number of TCD slots. - */ -void EDMA_InstallTCDMemory(edma_handle_t *handle, edma_tcd_t *tcdPool, uint32_t tcdSize) -{ - assert(handle != NULL); - assert(((uint32_t)tcdPool & 0x1FU) == 0U); - - /* Initialize tcd queue attribute. */ - /* header should initial as 1, since that it is used to point to the next TCD to be loaded into TCD memory, - * In EDMA driver IRQ handler, header will be used to calculate how many tcd has done, for example, - * If application submit 4 transfer request, A->B->C->D, - * when A finshed, the header is 0, C is the next TCD to be load, since B is already loaded, - * according to EDMA driver IRQ handler, tcdDone = C - A - header = 2 - header = 2, but actually only 1 TCD done, - * so the issue will be the wrong TCD done count will pass to application in first TCD interrupt. - * During first submit, the header should be assigned to 1, since 0 is current one and 1 is next TCD to be loaded, - * but software cannot know which submission is the first one, so assign 1 to header here. - */ - handle->header = 1; - handle->tcdUsed = 0; - handle->tcdSize = (int8_t)tcdSize; - handle->tcdPool = tcdPool; -} - -/*! - * brief Installs a callback function for the eDMA transfer. - * - * This callback is called in the eDMA IRQ handler. Use the callback to do something after - * the current major loop transfer completes. This function will be called every time one tcd finished transfer. - * - * param handle eDMA handle pointer. - * param callback eDMA callback function pointer. - * param userData A parameter for the callback function. - */ -void EDMA_SetCallback(edma_handle_t *handle, edma_callback callback, void *userData) -{ - assert(handle != NULL); - - handle->callback = callback; - handle->userData = userData; -} - -static edma_transfer_size_t EDMA_TransferWidthMapping(uint32_t width) -{ - edma_transfer_size_t transferSize = kEDMA_TransferSize1Bytes; - - /* map width to register value */ - switch (width) - { - /* width 8bit */ - case 1U: - transferSize = kEDMA_TransferSize1Bytes; - break; - /* width 16bit */ - case 2U: - transferSize = kEDMA_TransferSize2Bytes; - break; - /* width 32bit */ - case 4U: - transferSize = kEDMA_TransferSize4Bytes; - break; -#if (defined(FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) - /* width 64bit */ - case 8U: - transferSize = kEDMA_TransferSize8Bytes; - break; -#endif -#if (defined(FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) - /* width 128bit */ - case 16U: - transferSize = kEDMA_TransferSize16Bytes; - break; -#endif - /* width 256bit */ - case 32U: - transferSize = kEDMA_TransferSize32Bytes; - break; -#if (defined(FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) - /* width 512bit */ - case 64U: - transferSize = kEDMA_TransferSize64Bytes; - break; -#endif -#if (defined(FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) - /* width 1024bit */ - case 128U: - transferSize = kEDMA_TransferSize128Bytes; - break; -#endif - default: - /* All the cases have been listed above, the default clause should not be reached. */ - assert(false); - break; - } - - return transferSize; -} - -/*! - * brief Prepares the eDMA transfer structure configurations. - * - * This function prepares the transfer configuration structure according to the user input. - * - * param config The user configuration structure of type edma_transfer_t. - * param srcAddr eDMA transfer source address. - * param srcWidth eDMA transfer source address width(bytes). - * param srcOffset source address offset. - * param destAddr eDMA transfer destination address. - * param destWidth eDMA transfer destination address width(bytes). - * param destOffset destination address offset. - * param bytesEachRequest eDMA transfer bytes per channel request. - * param transferBytes eDMA transfer bytes to be transferred. - * note The data address and the data width must be consistent. For example, if the SRC - * is 4 bytes, the source address must be 4 bytes aligned, or it results in - * source address error (SAE). - * User can check if 128 bytes support is available for specific instance by - * FSL_FEATURE_EDMA_INSTANCE_SUPPORT_128_BYTES_TRANSFERn. - */ -void EDMA_PrepareTransferConfig(edma_transfer_config_t *config, - void *srcAddr, - uint32_t srcWidth, - int16_t srcOffset, - void *destAddr, - uint32_t destWidth, - int16_t destOffset, - uint32_t bytesEachRequest, - uint32_t transferBytes) -{ - assert(config != NULL); - assert(srcAddr != NULL); - assert(destAddr != NULL); -#if (defined(FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) - assert((srcWidth != 0U) && (srcWidth <= 128U) && ((srcWidth & (srcWidth - 1U)) == 0U)); - assert((destWidth != 0U) && (destWidth <= 128U) && ((destWidth & (destWidth - 1U)) == 0U)); -#elif (defined(FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) - assert((srcWidth != 0U) && (srcWidth <= 64U) && ((srcWidth & (srcWidth - 1U)) == 0U)); - assert((destWidth != 0U) && (destWidth <= 64U) && ((destWidth & (destWidth - 1U)) == 0U)); -#else - assert((srcWidth != 0U) && (srcWidth <= 32U) && ((srcWidth & (srcWidth - 1U)) == 0U)); - assert((destWidth != 0U) && (destWidth <= 32U) && ((destWidth & (destWidth - 1U)) == 0U)); -#endif -#if (!defined(FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) || !FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) - assert(srcWidth != 8U); - assert(srcWidth != 8U); -#endif -#if (!defined(FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) || !FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) - assert(srcWidth != 16U); - assert(srcWidth != 16U); -#endif -#if (!defined(FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) || !FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) - assert(srcWidth != 64U); - assert(srcWidth != 64U); -#endif - assert((transferBytes % bytesEachRequest) == 0U); - assert((((uint32_t)(uint8_t *)srcAddr) % srcWidth) == 0U); - assert((((uint32_t)(uint8_t *)destAddr) % destWidth) == 0U); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->destAddr = CONVERT_TO_DMA_ADDRESS((uint32_t)(uint32_t *)destAddr); - config->srcAddr = CONVERT_TO_DMA_ADDRESS((uint32_t)(uint32_t *)srcAddr); - config->minorLoopBytes = bytesEachRequest; - config->majorLoopCounts = transferBytes / bytesEachRequest; - config->srcTransferSize = EDMA_TransferWidthMapping(srcWidth); - config->destTransferSize = EDMA_TransferWidthMapping(destWidth); - config->destOffset = destOffset; - config->srcOffset = srcOffset; - /* enable major interrupt by default */ - config->enabledInterruptMask = (uint16_t)kEDMA_MajorInterruptEnable; -} - -/*! - * brief Prepares the eDMA transfer structure. - * - * This function prepares the transfer configuration structure according to the user input. - * - * param config The user configuration structure of type edma_transfer_t. - * param srcAddr eDMA transfer source address. - * param srcWidth eDMA transfer source address width(bytes). - * param destAddr eDMA transfer destination address. - * param destWidth eDMA transfer destination address width(bytes). - * param bytesEachRequest eDMA transfer bytes per channel request. - * param transferBytes eDMA transfer bytes to be transferred. - * param type eDMA transfer type. - * note The data address and the data width must be consistent. For example, if the SRC - * is 4 bytes, the source address must be 4 bytes aligned, or it results in - * source address error (SAE). - */ -void EDMA_PrepareTransfer(edma_transfer_config_t *config, - void *srcAddr, - uint32_t srcWidth, - void *destAddr, - uint32_t destWidth, - uint32_t bytesEachRequest, - uint32_t transferBytes, - edma_transfer_type_t type) -{ - assert(config != NULL); - - int16_t srcOffset = 0, destOffset = 0; - - switch (type) - { - case kEDMA_MemoryToMemory: - destOffset = (int16_t)destWidth; - srcOffset = (int16_t)srcWidth; - break; - case kEDMA_MemoryToPeripheral: - destOffset = 0; - srcOffset = (int16_t)srcWidth; - break; - case kEDMA_PeripheralToMemory: - destOffset = (int16_t)destWidth; - srcOffset = 0; - break; - case kEDMA_PeripheralToPeripheral: - destOffset = 0; - srcOffset = 0; - break; - default: - /* All the cases have been listed above, the default clause should not be reached. */ - assert(false); - break; - } - - EDMA_PrepareTransferConfig(config, srcAddr, srcWidth, srcOffset, destAddr, destWidth, destOffset, bytesEachRequest, - transferBytes); -} - -/*! - * brief Prepares the eDMA transfer content descriptor. - * - * This function prepares the transfer content descriptor structure according to the user input. - * - * param handle eDMA handle pointer. - * param tcd Pointer to eDMA transfer content descriptor structure. - * param srcAddr eDMA transfer source address. - * param srcWidth eDMA transfer source address width(bytes). - * param srcOffset source address offset. - * param destAddr eDMA transfer destination address. - * param destWidth eDMA transfer destination address width(bytes). - * param destOffset destination address offset. - * param bytesEachRequest eDMA transfer bytes per channel request. - * param transferBytes eDMA transfer bytes to be transferred. - * param nextTcd eDMA transfer linked TCD address. - * - * note The data address and the data width must be consistent. For example, if the SRC - * is 4 bytes, the source address must be 4 bytes aligned, or it results in - * source address error (SAE). - */ -void EDMA_PrepareTransferTCD(edma_handle_t *handle, - edma_tcd_t *tcd, - void *srcAddr, - uint32_t srcWidth, - int16_t srcOffset, - void *destAddr, - uint32_t destWidth, - int16_t destOffset, - uint32_t bytesEachRequest, - uint32_t transferBytes, - edma_tcd_t *nextTcd) -{ - assert(tcd != NULL); - assert(srcAddr != NULL); - assert(destAddr != NULL); -#if (defined(FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) - assert((srcWidth != 0U) && (srcWidth <= 128U) && ((srcWidth & (srcWidth - 1U)) == 0U) && - (FSL_FEATURE_EDMA_INSTANCE_SUPPORT_128_BYTES_TRANSFERn(handle->base) == 1)); - assert((destWidth != 0U) && (destWidth <= 128U) && ((destWidth & (destWidth - 1U)) == 0U) && - (FSL_FEATURE_EDMA_INSTANCE_SUPPORT_128_BYTES_TRANSFERn(handle->base) == 1)); -#elif (defined(FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) - assert((srcWidth != 0U) && (srcWidth <= 64U) && ((srcWidth & (srcWidth - 1U)) == 0U)); - assert((destWidth != 0U) && (destWidth <= 64U) && ((destWidth & (destWidth - 1U)) == 0U)); -#else - assert((srcWidth != 0U) && (srcWidth <= 32U) && ((srcWidth & (srcWidth - 1U)) == 0U)); - assert((destWidth != 0U) && (destWidth <= 32U) && ((destWidth & (destWidth - 1U)) == 0U)); -#endif -#if (!defined(FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) || !FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) - assert(srcWidth != 8U); - assert(srcWidth != 8U); -#endif -#if (!defined(FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) || !FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) - assert(srcWidth != 16U); - assert(srcWidth != 16U); -#endif -#if (!defined(FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) || !FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) - assert(srcWidth != 64U); - assert(srcWidth != 64U); -#endif - assert((transferBytes % bytesEachRequest) == 0U); - assert((((uint32_t)(uint32_t *)srcAddr) % srcWidth) == 0U); - assert((((uint32_t)(uint32_t *)destAddr) % destWidth) == 0U); - - edma_transfer_size_t srcTransferSize = EDMA_TransferWidthMapping(srcWidth), - destTransferSize = EDMA_TransferWidthMapping(srcWidth); - - /* Initializes the configure structure to zero. */ - EDMA_TcdResetExt(handle->base, tcd); - assert((bytesEachRequest % (1UL << ((uint32_t)srcTransferSize))) == 0U); - assert((bytesEachRequest % (1UL << ((uint32_t)destTransferSize))) == 0U); - assert(((uint32_t)srcOffset % (1UL << ((uint32_t)srcTransferSize))) == 0U); - assert(((uint32_t)destOffset % (1UL << ((uint32_t)destTransferSize))) == 0U); - assert(((uint32_t)(uint32_t *)srcAddr % (1UL << ((uint32_t)srcTransferSize))) == 0U); - assert(((uint32_t)(uint32_t *)destAddr % (1UL << ((uint32_t)destTransferSize))) == 0U); - - EDMA_TCD_SADDR(tcd, EDMA_TCD_TYPE(handle->base)) = CONVERT_TO_DMA_ADDRESS((uint32_t *)srcAddr); - /* destination address */ - EDMA_TCD_DADDR(tcd, EDMA_TCD_TYPE(handle->base)) = CONVERT_TO_DMA_ADDRESS((uint32_t *)destAddr); - /* Source data and destination data transfer size */ - EDMA_TCD_ATTR(tcd, EDMA_TCD_TYPE(handle->base)) = DMA_ATTR_SSIZE(srcTransferSize) | DMA_ATTR_DSIZE(destTransferSize); - - /* Source address signed offset */ - EDMA_TCD_SOFF(tcd, EDMA_TCD_TYPE(handle->base)) = (uint16_t)(srcOffset); - /* Destination address signed offset */ - EDMA_TCD_DOFF(tcd, EDMA_TCD_TYPE(handle->base)) = (uint16_t)(destOffset); - - EDMA_TCD_NBYTES(tcd, EDMA_TCD_TYPE(handle->base)) = DMA_NBYTES_MLOFFNO_NBYTES(bytesEachRequest); - - /* Current major iteration count */ - EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(handle->base)) = (uint16_t)(transferBytes / bytesEachRequest); - /* Starting major iteration count */ - EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(handle->base)) = (uint16_t)(transferBytes / bytesEachRequest); - /* reset CSR firstly */ - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(handle->base)) = DMA_CSR_DREQ(1U); - /* Enable scatter/gather processing */ - if (nextTcd != NULL) - { - EDMA_TCD_DLAST_SGA(tcd, EDMA_TCD_TYPE(handle->base)) = CONVERT_TO_DMA_ADDRESS(nextTcd); - /* - Before call EDMA_TcdSetTransferConfig or EDMA_SetTransferConfig, - user must call EDMA_TcdReset or EDMA_ResetChannel which will set - DREQ, so must use "|" or "&" rather than "=". - - Clear the DREQ bit because scatter gather has been enabled, so the - previous transfer is not the last transfer, and channel request should - be enabled at the next transfer(the next TCD). - */ - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(handle->base)) = - (EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(handle->base)) | (uint16_t)DMA_CSR_ESG_MASK) & ~(uint16_t)DMA_CSR_DREQ_MASK; - } - - /* configure interrupt/auto disable channel request, enable major interrupt by default */ - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(handle->base)) |= - (EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(handle->base)) & (~(uint16_t)kEDMA_ErrorInterruptEnable)) | - (uint16_t)kEDMA_MajorInterruptEnable; -} - -/*! - * brief Submits the eDMA transfer content descriptor. - * - * This function submits the eDMA transfer request according to the transfer content descriptor. - * In scatter gather mode, call this function will add a configured tcd to the circular list of tcd pool. - * The tcd pools is setup by call function EDMA_InstallTCDMemory before. - * - * Typical user case: - * 1. submit single transfer - * code - * edma_tcd_t tcd; - * EDMA_PrepareTransferTCD(handle, tcd, ....) - * EDMA_SubmitTransferTCD(handle, tcd) - * EDMA_StartTransfer(handle) - * endcode - * - * 2. submit static link transfer, - * code - * edma_tcd_t tcd[2]; - * EDMA_PrepareTransferTCD(handle, &tcd[0], ....) - * EDMA_PrepareTransferTCD(handle, &tcd[1], ....) - * EDMA_SubmitTransferTCD(handle, &tcd[0]) - * EDMA_StartTransfer(handle) - * endcode - * - * 3. submit dynamic link transfer - * code - * edma_tcd_t tcdpool[2]; - * EDMA_InstallTCDMemory(&g_DMA_Handle, tcdpool, 2); - * edma_tcd_t tcd; - * EDMA_PrepareTransferTCD(handle, tcd, ....) - * EDMA_SubmitTransferTCD(handle, tcd) - * EDMA_PrepareTransferTCD(handle, tcd, ....) - * EDMA_SubmitTransferTCD(handle, tcd) - * EDMA_StartTransfer(handle) - * endcode - * - * 4. submit loop transfer - * code - * edma_tcd_t tcd[2]; - * EDMA_PrepareTransferTCD(handle, &tcd[0], ...,&tcd[1]) - * EDMA_PrepareTransferTCD(handle, &tcd[1], ..., &tcd[0]) - * EDMA_SubmitTransferTCD(handle, &tcd[0]) - * EDMA_StartTransfer(handle) - * endcode - * - * param handle eDMA handle pointer. - * param tcd Pointer to eDMA transfer content descriptor structure. - * - * retval kStatus_EDMA_Success It means submit transfer request succeed. - * retval kStatus_EDMA_QueueFull It means TCD queue is full. Submit transfer request is not allowed. - * retval kStatus_EDMA_Busy It means the given channel is busy, need to submit request later. - */ -status_t EDMA_SubmitTransferTCD(edma_handle_t *handle, edma_tcd_t *tcd) -{ - assert(handle != NULL); - assert(handle->tcdBase != NULL); - - edma_tcd_t *tcdRegs = handle->tcdBase; - - if (handle->tcdPool == NULL) - { - /* - * Check if EDMA channel is busy: - * 1. if channel active bit is set, it implies that minor loop is executing, then channel is busy - * 2. if channel active bit is not set and BITER not equal to CITER, it implies that major loop is executing, - * then channel is busy - * - * There is one case can not be covered in below condition: - * When transfer request is submitted, but no request from peripheral, that is to say channel sevice doesn't - * begin, if application would like to submit another transfer , then the TCD will be overwritten, since the - * ACTIVE is 0 and BITER = CITER, for such case, it is a scatter gather(link TCD) case actually, so - * application should enabled TCD pool for dynamic scatter gather mode by calling EDMA_InstallTCDMemory. - */ -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - if (((tcdRegs->CSR & DMA_CSR_ACTIVE_MASK) != 0U) || -#else - if (((handle->channelBase->CH_CSR & DMA_CH_CSR_ACTIVE_MASK) != 0U) || -#endif - (((EDMA_TCD_CITER(tcdRegs, EDMA_TCD_TYPE(handle->base)) & DMA_CITER_ELINKNO_CITER_MASK) != - (EDMA_TCD_BITER(tcdRegs, EDMA_TCD_TYPE(handle->base)) & DMA_BITER_ELINKNO_BITER_MASK)))) - { - return kStatus_EDMA_Busy; - } - else - { - EDMA_InstallTCD(handle->base, handle->channel, tcd); - /* Enable auto disable request feature */ - EDMA_EnableAutoStopRequest(handle->base, handle->channel, true); - /* Enable major interrupt */ - EDMA_EnableChannelInterrupts(handle->base, handle->channel, kEDMA_MajorInterruptEnable); - - return kStatus_Success; - } - } - else /* Use the TCD queue. */ - { - uint32_t primask; - uint16_t csr; - int8_t currentTcd; - int8_t previousTcd; - int8_t nextTcd; - int8_t tmpTcdUsed; - int8_t tmpTcdSize; - - /* Check if tcd pool is full. */ - primask = DisableGlobalIRQ(); - tmpTcdUsed = handle->tcdUsed; - tmpTcdSize = handle->tcdSize; - if (tmpTcdUsed >= tmpTcdSize) - { - EnableGlobalIRQ(primask); - - return kStatus_EDMA_QueueFull; - } - currentTcd = handle->tail; - handle->tcdUsed++; - /* Calculate index of next TCD */ - nextTcd = currentTcd + 1; - if (nextTcd == handle->tcdSize) - { - nextTcd = 0; - } - /* Advance queue tail index */ - handle->tail = nextTcd; - EnableGlobalIRQ(primask); - /* Calculate index of previous TCD */ - previousTcd = currentTcd != 0 ? currentTcd - 1 : (handle->tcdSize - 1); - - /* Configure current TCD block. */ - EDMA_TcdResetExt(handle->base, &handle->tcdPool[currentTcd]); - (void)memcpy(&handle->tcdPool[currentTcd], tcd, sizeof(edma_tcd_t)); - - /* Enable major interrupt */ - EDMA_TCD_CSR((&handle->tcdPool[currentTcd]), EDMA_TCD_TYPE(handle->base)) |= DMA_CSR_INTMAJOR_MASK; - - if ((EDMA_TCD_DLAST_SGA(tcd, EDMA_TCD_TYPE(handle->base)) == 0U) || - ((EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(handle->base)) & DMA_CSR_ESG_MASK) == 0U)) - { - /* Link current TCD with next TCD for identification of current TCD */ - EDMA_TCD_DLAST_SGA((&handle->tcdPool[currentTcd]), EDMA_TCD_TYPE(handle->base)) = - CONVERT_TO_DMA_ADDRESS((uint32_t)&handle->tcdPool[nextTcd]); - } - - /* Chain from previous descriptor unless tcd pool size is 1(this descriptor is its own predecessor). */ - if (currentTcd != previousTcd) - { -#if defined FSL_FEATURE_EDMA_HAS_ERRATA_51327 - if (EDMA_CheckErrata(handle->base, &handle->tcdPool[previousTcd]) != kStatus_Success) - { - return kStatus_InvalidArgument; - } -#endif - /* Enable scatter/gather feature in the previous TCD block. */ - csr = EDMA_TCD_CSR((&handle->tcdPool[previousTcd]), EDMA_TCD_TYPE(handle->base)) | - ((uint16_t)DMA_CSR_ESG_MASK); - csr &= ~((uint16_t)DMA_CSR_DREQ_MASK); - EDMA_TCD_CSR((&handle->tcdPool[previousTcd]), EDMA_TCD_TYPE(handle->base)) = csr; - /* - Check if the TCD block in the registers is the previous one (points to current TCD block). It - is used to check if the previous TCD linked has been loaded in TCD register. If so, it need to - link the TCD register in case link the current TCD with the dead chain when TCD loading occurs - before link the previous TCD block. - */ - if (EDMA_TCD_DLAST_SGA(tcdRegs, EDMA_TCD_TYPE(handle->base)) == - CONVERT_TO_DMA_ADDRESS((uint32_t)&handle->tcdPool[currentTcd])) - { - /* Clear the DREQ bits for the dynamic scatter gather */ - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) |= DMA_CSR_DREQ_MASK; - /* Enable scatter/gather also in the TCD registers. */ - csr = EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) | DMA_CSR_ESG_MASK; - /* Must write the CSR register one-time, because the transfer maybe finished anytime. */ - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) = csr; - /* - It is very important to check the ESG bit! - Because this hardware design: if DONE bit is set, the ESG bit can not be set. So it can - be used to check if the dynamic TCD link operation is successful. If ESG bit is not set - and the DLAST_SGA is not the next TCD address(it means the dynamic TCD link succeed and - the current TCD block has been loaded into TCD registers), it means transfer finished - and TCD link operation fail, so must install TCD content into TCD registers and enable - transfer again. And if ESG is set, it means transfer has not finished, so TCD dynamic - link succeed. - */ - if (0U != (EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) & DMA_CSR_ESG_MASK)) - { - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) &= ~(uint16_t)DMA_CSR_DREQ_MASK; - return kStatus_Success; - } - /* - Check whether the current TCD block is already loaded in the TCD registers. It is another - condition when ESG bit is not set: it means the dynamic TCD link succeed and the current - TCD block has been loaded into TCD registers. - */ - if (EDMA_TCD_DLAST_SGA(tcdRegs, EDMA_TCD_TYPE(handle->base)) == - CONVERT_TO_DMA_ADDRESS((uint32_t)&handle->tcdPool[nextTcd])) - { - return kStatus_Success; - } - /* - If go to this, means the previous transfer finished, and the DONE bit is set. - So shall configure TCD registers. - */ - } - else if (EDMA_TCD_DLAST_SGA(tcdRegs, EDMA_TCD_TYPE(handle->base)) != 0UL) - { - /* The current TCD block has been linked successfully. */ - return kStatus_Success; - } - else - { - /* - DLAST_SGA is 0 and it means the first submit transfer, so shall configure - TCD registers. - */ - } - } - /* There is no live chain, TCD block need to be installed in TCD registers. */ - EDMA_InstallTCD(handle->base, handle->channel, &handle->tcdPool[currentTcd]); - - return kStatus_Success; - } -} - -/*! - * brief Submits the eDMA transfer request. - * - * This function submits the eDMA transfer request according to the transfer configuration structure. - * In scatter gather mode, call this function will add a configured tcd to the circular list of tcd pool. - * The tcd pools is setup by call function EDMA_InstallTCDMemory before. - * - * param handle eDMA handle pointer. - * param config Pointer to eDMA transfer configuration structure. - * retval kStatus_EDMA_Success It means submit transfer request succeed. - * retval kStatus_EDMA_QueueFull It means TCD queue is full. Submit transfer request is not allowed. - * retval kStatus_EDMA_Busy It means the given channel is busy, need to submit request later. - */ -status_t EDMA_SubmitTransfer(edma_handle_t *handle, const edma_transfer_config_t *config) -{ - assert(handle != NULL); - assert(config != NULL); - assert(handle->tcdBase != NULL); -#if (defined(FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) - assert(((config->srcTransferSize != kEDMA_TransferSize128Bytes) && - (config->destTransferSize != kEDMA_TransferSize128Bytes)) || - (FSL_FEATURE_EDMA_INSTANCE_SUPPORT_128_BYTES_TRANSFERn(handle->base) == 1)); -#endif - edma_tcd_t *tcdRegs = handle->tcdBase; - - if (handle->tcdPool == NULL) - { - /* - * Check if EDMA channel is busy: - * 1. if channel active bit is set, it implies that minor loop is executing, then channel is busy - * 2. if channel active bit is not set and BITER not equal to CITER, it implies that major loop is executing, - * then channel is busy - * - * There is one case can not be covered in below condition: - * When transfer request is submitted, but no request from peripheral, that is to say channel sevice doesn't - * begin, if application would like to submit another transfer , then the TCD will be overwritten, since the - * ACTIVE is 0 and BITER = CITER, for such case, it is a scatter gather(link TCD) case actually, so - * application should enabled TCD pool for dynamic scatter gather mode by calling EDMA_InstallTCDMemory. - */ -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - if (((tcdRegs->CSR & DMA_CSR_ACTIVE_MASK) != 0U) || -#else - if (((handle->channelBase->CH_CSR & DMA_CH_CSR_ACTIVE_MASK) != 0U) || -#endif - (((EDMA_TCD_CITER(tcdRegs, EDMA_TCD_TYPE(handle->base)) & DMA_CITER_ELINKNO_CITER_MASK) != - (EDMA_TCD_BITER(tcdRegs, EDMA_TCD_TYPE(handle->base)) & DMA_BITER_ELINKNO_BITER_MASK)))) - { - return kStatus_EDMA_Busy; - } - else - { - EDMA_TcdSetTransferConfigExt(handle->base, tcdRegs, config, NULL); - /* Enable auto disable request feature */ - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) |= DMA_CSR_DREQ_MASK; - /* Enable major interrupt */ - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) |= DMA_CSR_INTMAJOR_MASK; - - return kStatus_Success; - } - } - else /* Use the TCD queue. */ - { - uint32_t primask; - uint16_t csr; - int8_t currentTcd; - int8_t previousTcd; - int8_t nextTcd; - int8_t tmpTcdUsed; - int8_t tmpTcdSize; - - /* Check if tcd pool is full. */ - primask = DisableGlobalIRQ(); - tmpTcdUsed = handle->tcdUsed; - tmpTcdSize = handle->tcdSize; - if (tmpTcdUsed >= tmpTcdSize) - { - EnableGlobalIRQ(primask); - - return kStatus_EDMA_QueueFull; - } - currentTcd = handle->tail; - handle->tcdUsed++; - /* Calculate index of next TCD */ - nextTcd = currentTcd + 1; - if (nextTcd == handle->tcdSize) - { - nextTcd = 0; - } - /* Advance queue tail index */ - handle->tail = nextTcd; - EnableGlobalIRQ(primask); - /* Calculate index of previous TCD */ - previousTcd = currentTcd != 0 ? currentTcd - 1 : (handle->tcdSize - 1); - /* Configure current TCD block. */ - EDMA_TcdResetExt(handle->base, &handle->tcdPool[currentTcd]); - EDMA_TcdSetTransferConfigExt(handle->base, &handle->tcdPool[currentTcd], config, NULL); - /* Enable major interrupt */ - EDMA_TCD_CSR((&handle->tcdPool[currentTcd]), EDMA_TCD_TYPE(handle->base)) |= DMA_CSR_INTMAJOR_MASK; - /* Link current TCD with next TCD for identification of current TCD */ - EDMA_TCD_DLAST_SGA((&handle->tcdPool[currentTcd]), EDMA_TCD_TYPE(handle->base)) = - CONVERT_TO_DMA_ADDRESS((uint32_t)&handle->tcdPool[nextTcd]); - /* Chain from previous descriptor unless tcd pool size is 1(this descriptor is its own predecessor). */ - if (currentTcd != previousTcd) - { -#if defined FSL_FEATURE_EDMA_HAS_ERRATA_51327 - if (EDMA_CheckErrata(handle->base, &handle->tcdPool[previousTcd]) != kStatus_Success) - { - return kStatus_InvalidArgument; - } -#endif - /* Enable scatter/gather feature in the previous TCD block. */ - csr = EDMA_TCD_CSR((&handle->tcdPool[previousTcd]), EDMA_TCD_TYPE(handle->base)) | - ((uint16_t)DMA_CSR_ESG_MASK); - csr &= ~((uint16_t)DMA_CSR_DREQ_MASK); - EDMA_TCD_CSR((&handle->tcdPool[previousTcd]), EDMA_TCD_TYPE(handle->base)) = csr; - /* - Check if the TCD block in the registers is the previous one (points to current TCD block). It - is used to check if the previous TCD linked has been loaded in TCD register. If so, it need to - link the TCD register in case link the current TCD with the dead chain when TCD loading occurs - before link the previous TCD block. - */ - if (EDMA_TCD_DLAST_SGA(handle->tcdBase, EDMA_TCD_TYPE(handle->base)) == - CONVERT_TO_DMA_ADDRESS((uint32_t)&handle->tcdPool[currentTcd])) - { - /* Clear the DREQ bits for the dynamic scatter gather */ - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) |= DMA_CSR_DREQ_MASK; - /* Enable scatter/gather also in the TCD registers. */ - csr = EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) | DMA_CSR_ESG_MASK; - /* Must write the CSR register one-time, because the transfer maybe finished anytime. */ - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) = csr; - /* - It is very important to check the ESG bit! - Because this hardware design: if DONE bit is set, the ESG bit can not be set. So it can - be used to check if the dynamic TCD link operation is successful. If ESG bit is not set - and the DLAST_SGA is not the next TCD address(it means the dynamic TCD link succeed and - the current TCD block has been loaded into TCD registers), it means transfer finished - and TCD link operation fail, so must install TCD content into TCD registers and enable - transfer again. And if ESG is set, it means transfer has not finished, so TCD dynamic - link succeed. - */ - if (0U != (EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) & DMA_CSR_ESG_MASK)) - { - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) &= ~(uint16_t)DMA_CSR_DREQ_MASK; - return kStatus_Success; - } - /* - Check whether the current TCD block is already loaded in the TCD registers. It is another - condition when ESG bit is not set: it means the dynamic TCD link succeed and the current - TCD block has been loaded into TCD registers. - */ - if (EDMA_TCD_DLAST_SGA(handle->tcdBase, EDMA_TCD_TYPE(handle->base)) == - CONVERT_TO_DMA_ADDRESS((uint32_t)&handle->tcdPool[nextTcd])) - { - return kStatus_Success; - } - /* - If go to this, means the previous transfer finished, and the DONE bit is set. - So shall configure TCD registers. - */ - } - else if (EDMA_TCD_DLAST_SGA(handle->tcdBase, EDMA_TCD_TYPE(handle->base)) != 0UL) - { - /* The current TCD block has been linked successfully. */ - return kStatus_Success; - } - else - { - /* - DLAST_SGA is 0 and it means the first submit transfer, so shall configure - TCD registers. - */ - } - } - /* There is no live chain, TCD block need to be installed in TCD registers. */ - EDMA_InstallTCD(handle->base, handle->channel, &handle->tcdPool[currentTcd]); - - return kStatus_Success; - } -} - -/*! - * brief Submits the eDMA scatter gather transfer configurations. - * - * The function is target for submit loop transfer request, - * the ring transfer request means that the transfer request TAIL is link to HEAD, such as, - * A->B->C->D->A, or A->A - * - * To use the ring transfer feature, the application should allocate several transfer object, such as - * @code - * edma_channel_transfer_config_t transfer[2]; - * EDMA_TransferSubmitLoopTransfer(handle, &transfer, 2U); - * @endcode - * Then eDMA driver will link transfer[0] and transfer[1] to each other - * - * note Application should check the return value of this function to avoid transfer request - * submit failed - * - * param handle eDMA handle pointer - * param transfer pointer to user's eDMA channel configure structure, see edma_channel_transfer_config_t for detail - * param transferLoopCount the count of the transfer ring, if loop count is 1, that means that the one will link to - * itself. - * - * retval #kStatus_Success It means submit transfer request succeed - * retval #kStatus_EDMA_Busy channel is in busy status - * retval #kStatus_InvalidArgument Invalid Argument - */ -status_t EDMA_SubmitLoopTransfer(edma_handle_t *handle, edma_transfer_config_t *transfer, uint32_t transferLoopCount) -{ - assert(transfer != NULL); - assert(handle != NULL); - assert(handle->tcdPool != NULL); - - uint32_t i = 0U; - - if (handle->tcdSize < (int8_t)transferLoopCount) - { - return kStatus_InvalidArgument; - } - - /* - * Check if EDMA channel is busy: - * 1. if channel active bit is set, it implies that minor loop is executing, then channel is busy - * 2. if channel active bit is not set and BITER not equal to CITER, it implies that major loop is executing, - * then channel is busy - * - * There is one case can not be covered in below condition: - * When transfer request is submitted, but no request from peripheral, that is to say channel service doesn't - * begin, if application would like to submit another transfer , then the TCD will be overwritten, since the - * ACTIVE is 0 and BITER = CITER, for such case, it is a scatter gather(link TCD) case actually, so - * application should enabled TCD pool for dynamic scatter gather mode by calling EDMA_InstallTCDMemory. - */ -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - if (((handle->tcdBase->CSR & DMA_CSR_ACTIVE_MASK) != 0U) || -#else - if (((handle->channelBase->CH_CSR & DMA_CH_CSR_ACTIVE_MASK) != 0U) || -#endif - (((EDMA_TCD_CITER(handle->tcdBase, EDMA_TCD_TYPE(handle->base)) & DMA_CITER_ELINKNO_CITER_MASK) != - (EDMA_TCD_BITER(handle->tcdBase, EDMA_TCD_TYPE(handle->base)) & DMA_BITER_ELINKNO_BITER_MASK)))) - { - return kStatus_EDMA_Busy; - } - - (void)memset(handle->tcdPool, 0, (uint32_t)handle->tcdSize * sizeof(edma_tcd_t)); - for (i = 0U; i < transferLoopCount - 1UL; i++) - { - transfer[i].linkTCD = &handle->tcdPool[i + 1UL]; - EDMA_ConfigChannelSoftwareTCDExt(handle->base, &(handle->tcdPool[i]), &transfer[i]); -#if defined FSL_FEATURE_EDMA_HAS_ERRATA_51327 - if (EDMA_CheckErrata(handle->base, &(handle->tcdPool[i])) != kStatus_Success) - { - return kStatus_InvalidArgument; - } -#endif - } - - /* prepare last one in the ring and link it to the HEAD of the ring */ - transfer[i].linkTCD = &handle->tcdPool[0]; - EDMA_ConfigChannelSoftwareTCDExt(handle->base, &(handle->tcdPool[i]), &transfer[i]); - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - if (((transfer->enableSrcMinorLoopOffset) || (transfer->enableDstMinorLoopOffset))) - { - EDMA_EnableMinorLoopMapping(handle->psBase, true); - } -#endif - /* There is no live chain, TCD block need to be installed in TCD registers. */ - EDMA_InstallTCD(handle->base, handle->channel, &handle->tcdPool[0U]); - - /* enable interrupt */ - EDMA_EnableChannelInterrupts(handle->base, handle->channel, - ((uint32_t)transfer->enabledInterruptMask & ~((uint32_t)kEDMA_ErrorInterruptEnable))); - - return kStatus_Success; -} - -/*! - * brief eDMA starts transfer. - * - * This function enables the channel request. Users can call this function after submitting the transfer request - * or before submitting the transfer request. - * - * param handle eDMA handle pointer. - */ -void EDMA_StartTransfer(edma_handle_t *handle) -{ - assert(handle != NULL); - - edma_tcd_t *tcdRegs = handle->tcdBase; - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - if (handle->tcdPool == NULL) - { - handle->base->SERQ = DMA_SERQ_SERQ(handle->channel); - } - else /* Use the TCD queue. */ - { - uint32_t primask; - - /* Check if there was at least one descriptor submitted since reset (TCD in registers is valid) */ - if (tcdRegs->DLAST_SGA != 0U) - { - primask = DisableGlobalIRQ(); - /* Check if channel request is actually disable. */ - if ((handle->base->ERQ & ((uint32_t)1U << handle->channel)) == 0U) - { - /* Check if transfer is paused. */ - tmpCSR = tcdRegs->CSR; - if ((0U == (tmpCSR & DMA_CSR_DONE_MASK)) || (0U != (tmpCSR & DMA_CSR_ESG_MASK))) - { - /* - Re-enable channel request must be as soon as possible, so must put it into - critical section to avoid task switching or interrupt service routine. - */ - handle->base->SERQ = DMA_SERQ_SERQ(handle->channel); - } - } - EnableGlobalIRQ(primask); - } - } -#else -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_CHANNEL_MUX -#if defined FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX - if (((uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_MUXn(handle->base) == 1U) && - (EDMA_MP_BASE(handle->base)->MP_REGS.EDMA5_REG.CH_MUX[handle->channel] == 0U) && - (FSL_FEATURE_EDMA_INSTANCE_HAS_MP_CHANNEL_MUXn(handle->base) == 1U)) - { - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) |= DMA_CSR_START_MASK; - } - else if (((uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_MUXn(handle->base) == 1U) && - handle->channelBase->CH_REGS.EDMA4_REG.CH_MUX == 0U && - !(FSL_FEATURE_EDMA_INSTANCE_HAS_MP_CHANNEL_MUXn(handle->base) == 1U)) - { - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) |= DMA_CSR_START_MASK; - } - else -#else - if (((uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_MUXn(handle->base) == 1U) && - handle->channelBase->CH_REGS.EDMA4_REG.CH_MUX == 0U) - { - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) |= DMA_CSR_START_MASK; - } - else -#endif -#endif - if (handle->tcdPool == NULL) - { - handle->channelBase->CH_CSR |= DMA_CH_CSR_ERQ_MASK; - } - else - { - /* Check if channel request is actually disable. */ - if ((handle->channelBase->CH_CSR & DMA_CH_CSR_ERQ_MASK) == 0U) - { - /* Check if transfer is paused. */ - if ((!((handle->channelBase->CH_CSR & DMA_CH_CSR_DONE_MASK) != 0U)) || - ((EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) & DMA_CSR_ESG_MASK) != 0U)) - { - /* - Re-enable channel request must be as soon as possible, so must put it into - critical section to avoid task switching or interrupt service routine. - */ - handle->channelBase->CH_CSR |= DMA_CH_CSR_ERQ_MASK; - } - } - } -#endif -} - -/*! - * brief eDMA stops transfer. - * - * This function disables the channel request to pause the transfer. Users can call EDMA_StartTransfer() - * again to resume the transfer. - * - * param handle eDMA handle pointer. - */ -void EDMA_StopTransfer(edma_handle_t *handle) -{ - assert(handle != NULL); -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - handle->base->CERQ = DMA_CERQ_CERQ(handle->channel); -#else - handle->channelBase->CH_CSR = handle->channelBase->CH_CSR & (~(DMA_CH_CSR_DONE_MASK | DMA_CH_CSR_ERQ_MASK)); -#endif -} - -/*! - * brief eDMA aborts transfer. - * - * This function disables the channel request and clear transfer status bits. - * Users can submit another transfer after calling this API. - * - * param handle DMA handle pointer. - */ -void EDMA_AbortTransfer(edma_handle_t *handle) -{ - EDMA_StopTransfer(handle); - /* - Clear CSR to release channel. Because if the given channel started transfer, - CSR will be not zero. Because if it is the last transfer, DREQ will be set. - If not, ESG will be set. - */ - EDMA_TcdResetExt(handle->base, handle->tcdBase); - - /* Handle the tcd */ - if (handle->tcdPool != NULL) - { - handle->header = 1; - handle->tail = 0; - handle->tcdUsed = 0; - } -} - -/*! - * brief eDMA IRQ handler for the current major loop transfer completion. - * - * This function clears the channel major interrupt flag and calls - * the callback function if it is not NULL. - * - * Note: - * For the case using TCD queue, when the major iteration count is exhausted, additional operations are performed. - * These include the final address adjustments and reloading of the BITER field into the CITER. - * Assertion of an optional interrupt request also occurs at this time, as does a possible fetch of a new TCD from - * memory using the scatter/gather address pointer included in the descriptor (if scatter/gather is enabled). - * - * For instance, when the time interrupt of TCD[0] happens, the TCD[1] has already been loaded into the eDMA engine. - * As sga and sga_index are calculated based on the DLAST_SGA bitfield lies in the TCD_CSR register, the sga_index - * in this case should be 2 (DLAST_SGA of TCD[1] stores the address of TCD[2]). Thus, the "tcdUsed" updated should be - * (tcdUsed - 2U) which indicates the number of TCDs can be loaded in the memory pool (because TCD[0] and TCD[1] have - * been loaded into the eDMA engine at this point already.). - * - * For the last two continuous ISRs in a scatter/gather process, they both load the last TCD (The last ISR does not - * load a new TCD) from the memory pool to the eDMA engine when major loop completes. - * Therefore, ensure that the header and tcdUsed updated are identical for them. - * tcdUsed are both 0 in this case as no TCD to be loaded. - * - * See the "eDMA basic data flow" in the eDMA Functional description section of the Reference Manual for - * further details. - * - * param handle eDMA handle pointer. - */ -void EDMA_HandleIRQ(edma_handle_t *handle) -{ - assert(handle != NULL); - - bool transfer_done; - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - /* Check if transfer is already finished. */ - transfer_done = ((handle->tcdBase->CSR & DMA_CSR_DONE_MASK) != 0U); -#else - transfer_done = (bool)(handle->channelBase->CH_CSR & DMA_CH_CSR_DONE_MASK); -#endif - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - if ((handle->base->INT >> channel) != 0U) - { - handle->base->CINT = channel; - } -#else - if ((handle->channelBase->CH_INT & DMA_CH_INT_INT_MASK) != 0U) - { - handle->channelBase->CH_INT |= DMA_CH_INT_INT_MASK; - } -#endif - - if (handle->tcdPool == NULL) - { - if (handle->callback != NULL) - { - (handle->callback)(handle, handle->userData, transfer_done, 0); - } - } - else /* Use the TCD queue. Please refer to the API descriptions in the eDMA header file for detailed information. */ - { - uint32_t sga = (uint32_t)EDMA_TCD_DLAST_SGA(handle->tcdBase, EDMA_TCD_TYPE(handle->base)); - uint32_t sga_index; - int32_t tcds_done; - uint8_t new_header; - bool esg = ((EDMA_TCD_CSR(handle->tcdBase, EDMA_TCD_TYPE(handle->base)) & DMA_CSR_ESG_MASK) != 0U); - - /* Get the offset of the next transfer TCD blocks to be loaded into the eDMA engine. */ - sga -= CONVERT_TO_DMA_ADDRESS((uint32_t)handle->tcdPool); - /* Get the index of the next transfer TCD blocks to be loaded into the eDMA engine. */ - sga_index = sga / sizeof(edma_tcd_t); - /* Adjust header positions. */ - if (transfer_done) - { - /* New header shall point to the next TCD to be loaded (current one is already finished) */ - new_header = (uint8_t)sga_index; - } - else - { - /* New header shall point to this descriptor currently loaded (not finished yet) */ - new_header = sga_index != 0U ? (uint8_t)sga_index - 1U : (uint8_t)handle->tcdSize - 1U; - } - /* Calculate the number of finished TCDs */ - if (new_header == (uint8_t)handle->header) - { - int8_t tmpTcdUsed = handle->tcdUsed; - int8_t tmpTcdSize = handle->tcdSize; - - /* check esg here for the case that application submit only one request, once the request complete: - * new_header(1) = handle->header(1) - * tcdUsed(1) != tcdSize(>1) - * As the application submit only once, so scatter gather must not enabled, then tcds_done should be 1 - */ - if ((tmpTcdUsed == tmpTcdSize) || (!esg)) - { - tcds_done = handle->tcdUsed; - } - else - { - /* No TCD in the memory are going to be loaded or internal error occurs. */ - tcds_done = 0; - } - } - else - { - tcds_done = (int32_t)new_header - (int32_t)handle->header; - if (tcds_done < 0) - { - tcds_done += handle->tcdSize; - } - /* - * While code run to here, it means a TCD transfer Done and a new TCD has loaded to the hardware - * so clear DONE here to allow submit scatter gather transfer request in the callback to avoid TCD - * overwritten. - */ - if (transfer_done) - { -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - handle->base->CDNE = handle->channel; -#else - handle->channelBase->CH_CSR |= DMA_CH_CSR_DONE_MASK; -#endif - } - } - /* Advance header which points to the TCD to be loaded into the eDMA engine from memory. */ - handle->header = (int8_t)new_header; - /* Release TCD blocks. tcdUsed is the TCD number which can be used/loaded in the memory pool. */ - handle->tcdUsed -= (int8_t)tcds_done; - /* Invoke callback function. */ - if (NULL != handle->callback) - { - (handle->callback)(handle, handle->userData, transfer_done, tcds_done); - } - - /* - * 1.clear the DONE bit here is meaningful for below cases: - * A new TCD has been loaded to EDMA already: - * need to clear the DONE bit in the IRQ handler to avoid TCD in EDMA been overwritten - * if peripheral request isn't coming before next transfer request. - * 2. Don't clear DONE bit for below case, - * for the case that transfer request submitted in the privious edma callback, this is a case that doesn't - * need scatter gather, so keep DONE bit during the next transfer request submission will re-install the TCD and - * the DONE bit will be cleared together with TCD re-installation. - */ - if (transfer_done) - { - if ((EDMA_TCD_CSR(handle->tcdBase, EDMA_TCD_TYPE(handle->base)) & DMA_CSR_ESG_MASK) != 0U) - { -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - handle->base->CDNE = handle->channel; -#else - handle->channelBase->CH_CSR |= DMA_CH_CSR_DONE_MASK; -#endif - } - } - } -} - -void EDMA_DriverIRQHandler(uint32_t instance, uint32_t channel); -void EDMA_DriverIRQHandler(uint32_t instance, uint32_t channel) -{ -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - if ((s_edmaBases[instance]->INT >> channel) != 0U) - { - EDMA_HandleIRQ(s_EDMAHandle[instance][channel]); - } -#else - if ((EDMA_CHANNEL_BASE(s_edmaBases[instance], channel)->CH_INT & DMA_CH_INT_INT_MASK) != 0U) - { - EDMA_HandleIRQ(s_EDMAHandle[instance][channel]); - } -#endif - SDK_ISR_EXIT_BARRIER; -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_edma.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_edma.h deleted file mode 100644 index aafd8603ee1..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_edma.h +++ /dev/null @@ -1,1893 +0,0 @@ -/* - * Copyright 2022-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_EDMA_H_ -#define FSL_EDMA_H_ - -#include "fsl_common.h" -#include "fsl_edma_core.h" -/*! - * @addtogroup edma - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief eDMA driver version */ -#define FSL_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 10, 0)) /*!< Version 2.10.0. */ -/*! @} */ - -/*! @brief eDMA driver name */ -#ifndef FSL_EDMA_DRIVER_EDMA4 -#define FSL_EDMA_DRIVER_EDMA4 (1) -#endif - -/*!@brief Macro used for allocate edma TCD */ -#define EDMA_ALLOCATE_TCD(name, number) AT_NONCACHEABLE_SECTION_ALIGN(edma_tcd_t name[number], EDMA_TCD_ALIGN_SIZE) - -/*! @brief _edma_transfer_status eDMA transfer status */ -enum -{ - kStatus_EDMA_QueueFull = MAKE_STATUS(kStatusGroup_EDMA, 0), /*!< TCD queue is full. */ - kStatus_EDMA_Busy = MAKE_STATUS(kStatusGroup_EDMA, 1), /*!< Channel is busy and can't handle the - transfer request. */ -}; - -/*! @brief Compute the offset unit from DCHPRI3 */ -#define DMA_DCHPRI_INDEX(channel) (((channel) & ~0x03U) | (3U - ((channel)&0x03U))) - -/*! @brief eDMA transfer configuration */ -typedef enum _edma_transfer_size -{ - kEDMA_TransferSize1Bytes = 0x0U, /*!< Source/Destination data transfer size is 1 byte every time */ - kEDMA_TransferSize2Bytes = 0x1U, /*!< Source/Destination data transfer size is 2 bytes every time */ - kEDMA_TransferSize4Bytes = 0x2U, /*!< Source/Destination data transfer size is 4 bytes every time */ -#if (defined(FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) - kEDMA_TransferSize8Bytes = 0x3U, /*!< Source/Destination data transfer size is 8 bytes every time */ -#endif -#if (defined(FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) - kEDMA_TransferSize16Bytes = 0x4U, /*!< Source/Destination data transfer size is 16 bytes every time */ -#endif - kEDMA_TransferSize32Bytes = 0x5U, /*!< Source/Destination data transfer size is 32 bytes every time */ -#if (defined(FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) - kEDMA_TransferSize64Bytes = 0x6U, /*!< Source/Destination data transfer size is 64 bytes every time */ -#endif -#if (defined(FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) - kEDMA_TransferSize128Bytes = 0x7U, /*!< Source/Destination data transfer size is 128 bytes every time */ -#endif -} edma_transfer_size_t; - -/*! @brief eDMA modulo configuration */ -typedef enum _edma_modulo -{ - kEDMA_ModuloDisable = 0x0U, /*!< Disable modulo */ - kEDMA_Modulo2bytes, /*!< Circular buffer size is 2 bytes. */ - kEDMA_Modulo4bytes, /*!< Circular buffer size is 4 bytes. */ - kEDMA_Modulo8bytes, /*!< Circular buffer size is 8 bytes. */ - kEDMA_Modulo16bytes, /*!< Circular buffer size is 16 bytes. */ - kEDMA_Modulo32bytes, /*!< Circular buffer size is 32 bytes. */ - kEDMA_Modulo64bytes, /*!< Circular buffer size is 64 bytes. */ - kEDMA_Modulo128bytes, /*!< Circular buffer size is 128 bytes. */ - kEDMA_Modulo256bytes, /*!< Circular buffer size is 256 bytes. */ - kEDMA_Modulo512bytes, /*!< Circular buffer size is 512 bytes. */ - kEDMA_Modulo1Kbytes, /*!< Circular buffer size is 1 K bytes. */ - kEDMA_Modulo2Kbytes, /*!< Circular buffer size is 2 K bytes. */ - kEDMA_Modulo4Kbytes, /*!< Circular buffer size is 4 K bytes. */ - kEDMA_Modulo8Kbytes, /*!< Circular buffer size is 8 K bytes. */ - kEDMA_Modulo16Kbytes, /*!< Circular buffer size is 16 K bytes. */ - kEDMA_Modulo32Kbytes, /*!< Circular buffer size is 32 K bytes. */ - kEDMA_Modulo64Kbytes, /*!< Circular buffer size is 64 K bytes. */ - kEDMA_Modulo128Kbytes, /*!< Circular buffer size is 128 K bytes. */ - kEDMA_Modulo256Kbytes, /*!< Circular buffer size is 256 K bytes. */ - kEDMA_Modulo512Kbytes, /*!< Circular buffer size is 512 K bytes. */ - kEDMA_Modulo1Mbytes, /*!< Circular buffer size is 1 M bytes. */ - kEDMA_Modulo2Mbytes, /*!< Circular buffer size is 2 M bytes. */ - kEDMA_Modulo4Mbytes, /*!< Circular buffer size is 4 M bytes. */ - kEDMA_Modulo8Mbytes, /*!< Circular buffer size is 8 M bytes. */ - kEDMA_Modulo16Mbytes, /*!< Circular buffer size is 16 M bytes. */ - kEDMA_Modulo32Mbytes, /*!< Circular buffer size is 32 M bytes. */ - kEDMA_Modulo64Mbytes, /*!< Circular buffer size is 64 M bytes. */ - kEDMA_Modulo128Mbytes, /*!< Circular buffer size is 128 M bytes. */ - kEDMA_Modulo256Mbytes, /*!< Circular buffer size is 256 M bytes. */ - kEDMA_Modulo512Mbytes, /*!< Circular buffer size is 512 M bytes. */ - kEDMA_Modulo1Gbytes, /*!< Circular buffer size is 1 G bytes. */ - kEDMA_Modulo2Gbytes, /*!< Circular buffer size is 2 G bytes. */ -} edma_modulo_t; - -#if defined FSL_FEATURE_EDMA_HAS_BANDWIDTH && FSL_FEATURE_EDMA_HAS_BANDWIDTH -/*! @brief Bandwidth control */ -typedef enum _edma_bandwidth -{ - kEDMA_BandwidthStallNone = 0x0U, /*!< No eDMA engine stalls. */ - kEDMA_BandwidthStall4Cycle = 0x2U, /*!< eDMA engine stalls for 4 cycles after each read/write. */ - kEDMA_BandwidthStall8Cycle = 0x3U, /*!< eDMA engine stalls for 8 cycles after each read/write. */ -} edma_bandwidth_t; -#endif - -/*! @brief Channel link type */ -typedef enum _edma_channel_link_type -{ - kEDMA_LinkNone = 0x0U, /*!< No channel link */ - kEDMA_MinorLink, /*!< Channel link after each minor loop */ - kEDMA_MajorLink, /*!< Channel link while major loop count exhausted */ -} edma_channel_link_type_t; - -/*!@brief _edma_channel_status_flags eDMA channel status flags. */ -enum -{ - kEDMA_DoneFlag = 0x1U, /*!< DONE flag, set while transfer finished, CITER value exhausted*/ - kEDMA_ErrorFlag = 0x2U, /*!< eDMA error flag, an error occurred in a transfer */ - kEDMA_InterruptFlag = 0x4U, /*!< eDMA interrupt flag, set while an interrupt occurred of this channel */ -}; - -/*! @brief _edma_error_status_flags eDMA channel error status flags. */ -enum -{ - kEDMA_DestinationBusErrorFlag = DMA_ERR_DBE_FLAG, /*!< Bus error on destination address */ - kEDMA_SourceBusErrorFlag = DMA_ERR_SBE_FLAG, /*!< Bus error on the source address */ - kEDMA_ScatterGatherErrorFlag = DMA_ERR_SGE_FLAG, /*!< Error on the Scatter/Gather address, not 32byte aligned. */ - kEDMA_NbytesErrorFlag = DMA_ERR_NCE_FLAG, /*!< NBYTES/CITER configuration error */ - kEDMA_DestinationOffsetErrorFlag = DMA_ERR_DOE_FLAG, /*!< Destination offset not aligned with destination size */ - kEDMA_DestinationAddressErrorFlag = DMA_ERR_DAE_FLAG, /*!< Destination address not aligned with destination size */ - kEDMA_SourceOffsetErrorFlag = DMA_ERR_SOE_FLAG, /*!< Source offset not aligned with source size */ - kEDMA_SourceAddressErrorFlag = DMA_ERR_SAE_FLAG, /*!< Source address not aligned with source size*/ - kEDMA_ErrorChannelFlag = DMA_ERR_ERRCHAN_FLAG, /*!< Error channel number of the cancelled channel number */ -#if defined(FSL_FEATURE_EDMA_HAS_PRIORITY_ERROR) && (FSL_FEATURE_EDMA_HAS_PRIORITY_ERROR > 1) - kEDMA_ChannelPriorityErrorFlag = DMA_ERR_CPE_FLAG, /*!< Channel priority is not unique. */ -#endif - kEDMA_TransferCanceledFlag = DMA_ERR_ECX_FLAG, /*!< Transfer cancelled */ -#if defined(FSL_FEATURE_EDMA_CHANNEL_GROUP_COUNT) && (FSL_FEATURE_EDMA_CHANNEL_GROUP_COUNT > 1) - kEDMA_GroupPriorityErrorFlag = DMA_ERR_GPE_FLAG, /*!< Group priority is not unique. */ -#endif - kEDMA_ValidFlag = (int)DMA_ERR_FLAG, /*!< No error occurred, this bit is 0. Otherwise, it is 1. */ -}; - -/*! @brief _edma_interrupt_enable eDMA interrupt source */ -enum -{ - kEDMA_ErrorInterruptEnable = 0x1U, /*!< Enable interrupt while channel error occurs. */ - kEDMA_MajorInterruptEnable = DMA_CSR_INTMAJOR_MASK, /*!< Enable interrupt while major count exhausted. */ - kEDMA_HalfInterruptEnable = DMA_CSR_INTHALF_MASK, /*!< Enable interrupt while major count to half value. */ -}; - -/*! @brief eDMA transfer type */ -typedef enum _edma_transfer_type -{ - kEDMA_MemoryToMemory = 0x0U, /*!< Transfer from memory to memory */ - kEDMA_PeripheralToMemory, /*!< Transfer from peripheral to memory */ - kEDMA_MemoryToPeripheral, /*!< Transfer from memory to peripheral */ - kEDMA_PeripheralToPeripheral, /*!< Transfer from Peripheral to peripheral */ -} edma_transfer_type_t; - -/*! @brief eDMA channel priority configuration */ -typedef struct _edma_channel_Preemption_config -{ - bool enableChannelPreemption; /*!< If true: a channel can be suspended by other channel with higher priority */ - bool enablePreemptAbility; /*!< If true: a channel can suspend other channel with low priority */ - uint8_t channelPriority; /*!< Channel priority */ -} edma_channel_Preemption_config_t; - -/*! @brief eDMA minor offset configuration */ -typedef struct _edma_minor_offset_config -{ - bool enableSrcMinorOffset; /*!< Enable(true) or Disable(false) source minor loop offset. */ - bool enableDestMinorOffset; /*!< Enable(true) or Disable(false) destination minor loop offset. */ - uint32_t minorOffset; /*!< Offset for a minor loop mapping. */ -} edma_minor_offset_config_t; - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG && FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE && FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE -/*! @brief eDMA channel memory attribute */ -typedef enum edma_channel_memory_attribute -{ - kEDMA_ChannelNoWriteNoReadNoCacheNoBuffer = - 0x0U, /*!< No write allocate, no read allocate, non-cacheable, non-bufferable. */ - kEDMA_ChannelNoWriteNoReadNoCacheBufferable, /*!< No write allocate, no read allocate, non-cacheable, bufferable. - */ - kEDMA_ChannelNoWriteNoReadCacheableNoBuffer, /*!< No write allocate, no read allocate, cacheable, non-bufferable. - */ - kEDMA_ChannelNoWriteNoReadCacheableBufferable, /*!< No write allocate, no read allocate, cacheable, bufferable. */ - kEDMA_ChannelNoWriteReadNoCacheNoBuffer, /*!< No write allocate, read allocate, non-cacheable, non-bufferable. */ - kEDMA_ChannelNoWriteReadNoCacheBufferable, /*!< No write allocate, read allocate, non-cacheable, bufferable. */ - kEDMA_ChannelNoWriteReadCacheableNoBuffer, /*!< No write allocate, read allocate, cacheable, non-bufferable. */ - kEDMA_ChannelNoWriteReadCacheableBufferable, /*!< No write allocate, read allocate, cacheable, bufferable. */ - kEDMA_ChannelWriteNoReadNoCacheNoBuffer, /*!< write allocate, no read allocate, non-cacheable, non-bufferable. */ - kEDMA_ChannelWriteNoReadNoCacheBufferable, /*!< write allocate, no read allocate, non-cacheable, bufferable. */ - kEDMA_ChannelWriteNoReadCacheableNoBuffer, /*!< write allocate, no read allocate, cacheable, non-bufferable. */ - kEDMA_ChannelWriteNoReadCacheableBufferable, /*!< write allocate, no read allocate, cacheable, bufferable. */ - kEDMA_ChannelWriteReadNoCacheNoBuffer, /*!< write allocate, read allocate, non-cacheable, non-bufferable. */ - kEDMA_ChannelWriteReadNoCacheBufferable, /*!< write allocate, read allocate, non-cacheable, bufferable. */ - kEDMA_ChannelWriteReadCacheableNoBuffer, /*!< write allocate, read allocate, cacheable, non-bufferable. */ - kEDMA_ChannelWriteReadCacheableBufferable, /*!< write allocate, read allocate, cacheable, bufferable. */ -} edma_channel_memory_attribute_t; -#endif - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE && FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE -/*! @brief eDMA4 channel swap size */ -typedef enum _edma_channel_swap_size -{ - kEDMA_ChannelSwapDisabled = 0x0U, /*!< Swap is disabled. */ - kEDMA_ChannelReadWith8bitSwap = 0x1U, /*!< Swap occurs with respect to the read 8bit. */ - kEDMA_ChannelReadWith16bitSwap = 0x2U, /*!< Swap occurs with respect to the read 16bit. */ - kEDMA_ChannelReadWith32bitSwap = 0x3U, /*!< Swap occurs with respect to the read 32bit. */ - kEDMA_ChannelWriteWith8bitSwap = 0x9U, /*!< Swap occurs with respect to the write 8bit. */ - kEDMA_ChannelWriteWith16bitSwap = 0x10U, /*!< Swap occurs with respect to the write 16bit. */ - kEDMA_ChannelWriteWith32bitSwap = 0x11U, /*!< Swap occurs with respect to the write 32bit. */ -} edma_channel_swap_size_t; -#endif - -/*! @brief eDMA channel system bus information, _edma_channel_sys_bus_info*/ -enum -{ -#if !(defined(FSL_FEATURE_EDMA_HAS_NO_CH_SBR_ATTR) && FSL_FEATURE_EDMA_HAS_NO_CH_SBR_ATTR) - kEDMA_AttributeOutput = DMA_CH_SBR_ATTR_MASK, /*!< DMA's AHB system bus attribute output value. */ -#endif - - kEDMA_PrivilegedAccessLevel = DMA_CH_SBR_PAL_MASK, /*!< Privileged Access Level for DMA transfers. 0b - User - protection level; 1b - Privileged protection level. */ - kEDMA_MasterId = - DMA_CH_SBR_MID_MASK, /*!< DMA's master ID when channel is active and master ID replication is enabled. */ -}; - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE && FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE -/*! @brief eDMA4 channel access type */ -typedef enum _edma_channel_access_type -{ - kEDMA_ChannelDataAccess = 0x0U, /*!< Data access for eDMA4 transfers. */ - kEDMA_ChannelInstructionAccess = 0x1U, /*!< Instruction access for eDMA4 transfers. */ -} edma_channel_access_type_t; -#endif - -/*! @brief eDMA4 channel protection level */ -typedef enum _edma_channel_protection_level -{ - kEDMA_ChannelProtectionLevelUser = 0x0U, /*!< user protection level for eDMA transfers. */ - kEDMA_ChannelProtectionLevelPrivileged = 0x1U, /*!< Privileged protection level eDMA transfers. */ -} edma_channel_protection_level_t; - -#if !(defined(FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) && FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) - -/*! @brief eDMA4 channel security level */ -typedef enum _edma_channel_security_level -{ - kEDMA_ChannelSecurityLevelNonSecure = 0x0U, /*!< non secure level for eDMA transfers. */ - kEDMA_ChannelSecurityLevelSecure = 0x1U, /*!< secure level for eDMA transfers. */ -} edma_channel_security_level_t; -#endif - -/*! @brief eDMA4 channel configuration*/ -typedef struct _edma_channel_config -{ - edma_channel_Preemption_config_t channelPreemptionConfig; /*!< channel preemption configuration */ - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE && FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE - edma_channel_memory_attribute_t channelReadMemoryAttribute; /*!< channel memory read attribute configuration */ - edma_channel_memory_attribute_t channelWriteMemoryAttribute; /*!< channel memory write attribute configuration */ -#endif - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE && FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE - edma_channel_swap_size_t channelSwapSize; /*!< channel swap size configuration */ -#endif - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE && FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE - edma_channel_access_type_t channelAccessType; /*!< channel access type configuration */ -#endif - - uint8_t channelDataSignExtensionBitPosition; /*!< channel data sign extension bit psition configuration */ - -#if (defined FSL_FEATURE_EDMA_HAS_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_CHANNEL_MUX) || (defined FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX) - int channelRequestSource; /*!< hardware service request source for the channel */ -#endif - - bool enableMasterIDReplication; /*!< enable master ID replication */ -#if !(defined(FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) && FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) - edma_channel_security_level_t securityLevel; /*!< security level */ -#endif - edma_channel_protection_level_t protectionLevel; /*!< protection level */ - -} edma_channel_config_t; -#endif - -/*! - * @brief eDMA TCD. - * - * This structure is same as TCD register which is described in reference manual, - * and is used to configure the scatter/gather feature as a next hardware TCD. - */ -typedef edma_core_tcd_t edma_tcd_t; - -/*! @brief edma4 channel transfer configuration - * - * The transfer configuration structure support full feature configuration of the transfer control descriptor. - * - * @note User should pay attention to the transfer size alignment limitation - * 1. the bytesEachRequest should align with the srcWidthOfEachTransfer and the dstWidthOfEachTransfer - * that is to say bytesEachRequest % srcWidthOfEachTransfer should be 0 - * 2. the srcOffsetOfEachTransfer and dstOffsetOfEachTransfer must be aligne with transfer width - * 3. the totalBytes should align with the bytesEachRequest - * 4. the srcAddr should align with the srcWidthOfEachTransfer - * 5. the dstAddr should align with the dstWidthOfEachTransfer - * 6. the srcAddr should align with srcAddrModulo if modulo feature is enabled - * 7. the dstAddr should align with dstAddrModulo if modulo feature is enabled - * If anyone of above condition can not be satisfied, the edma4 interfaces will generate assert error. - * - * 1.To perform a simple transfer, below members should be initialized at least - * .srcAddr - source address - * .dstAddr - destination address - * .srcWidthOfEachTransfer - data width of source address - * .dstWidthOfEachTransfer - data width of destination address, normally it should be as same as - * srcWidthOfEachTransfer .bytesEachRequest - bytes to be transferred in each DMA request .totalBytes - total - * bytes to be transferred .srcOffsetOfEachTransfer - offset value in bytes unit to be applied to source address as - * each source read is completed .dstOffsetOfEachTransfer - offset value in bytes unit to be applied to destination - * address as each destination write is completed enablchannelRequest - channel request can be enabled together with - * transfer configure submission - * - * 2.The transfer configuration structure also support advance feature: - * Programmable source/destination address range(MODULO) - * Programmable minor loop offset - * Programmable major loop offset - * Programmable channel chain feature - * Programmable channel transfer control descriptor link feature - * - */ -typedef struct _edma_transfer_config -{ - uint32_t srcAddr; /*!< Source data address. */ - uint32_t destAddr; /*!< Destination data address. */ - edma_transfer_size_t srcTransferSize; /*!< Source data transfer size. */ - edma_transfer_size_t destTransferSize; /*!< Destination data transfer size. */ - int16_t srcOffset; /*!< Sign-extended offset value in byte unit applied to the current source - address to form the next-state value as each source read is completed */ - int16_t destOffset; /*!< Sign-extended offset value in byte unit applied to the current destination - address to form the next-state value as each destination write is completed. */ - uint32_t minorLoopBytes; /*!< bytes in each minor loop or each request - * range: 1 - (2^30 -1) when minor loop mapping is enabled - * range: 1 - (2^10 - 1) when minor loop mapping is enabled and source or dest minor - * loop offset is enabled - * range: 1 - (2^32 - 1) when minor loop mapping is disabled - */ - uint32_t majorLoopCounts; /*!< minor loop counts in each major loop, should be 1 at least for each - * transfer range: (0 - (2^15 - 1)) when minor loop channel link is - * disabled range: (0 - (2^9 - 1)) when minor loop channel link is enabled - * total bytes in a transfer = minorLoopCountsEachMajorLoop * - * bytesEachMinorLoop - */ - - uint16_t enabledInterruptMask; /*!< channel interrupt to enable, can be OR'ed value of _edma_interrupt_enable */ - - edma_modulo_t srcAddrModulo; /*!< source circular data queue range */ - int32_t srcMajorLoopOffset; /*!< source major loop offset */ - - edma_modulo_t dstAddrModulo; /*!< destination circular data queue range */ - int32_t dstMajorLoopOffset; /*!< destination major loop offset */ - - bool enableSrcMinorLoopOffset; /*!< enable source minor loop offset */ - bool enableDstMinorLoopOffset; /*!< enable dest minor loop offset */ - int32_t minorLoopOffset; /*!< burst offset, the offset will be applied after minor loop update */ - - bool enableChannelMajorLoopLink; /*!< channel link when major loop complete */ - uint32_t majorLoopLinkChannel; /*!< major loop link channel number */ - - bool enableChannelMinorLoopLink; /*!< channel link when minor loop complete */ - uint32_t minorLoopLinkChannel; /*!< minor loop link channel number */ - - edma_tcd_t *linkTCD; /*!< pointer to the link transfer control descriptor */ -} edma_transfer_config_t; - -/*! @brief eDMA global configuration structure.*/ -typedef struct _edma_config -{ -#if defined FSL_FEATURE_EDMA_HAS_CONTINUOUS_LINK_MODE && FSL_FEATURE_EDMA_HAS_CONTINUOUS_LINK_MODE - bool enableContinuousLinkMode; /*!< Enable (true) continuous link mode. Upon minor loop completion, the channel - activates again if that channel has a minor loop channel link enabled and - the link channel is itself. */ -#endif - -#if defined FSL_FEATURE_EDMA_HAS_GLOBAL_MASTER_ID_REPLICATION && FSL_FEATURE_EDMA_HAS_GLOBAL_MASTER_ID_REPLICATION - bool enableMasterIdReplication; /*!< Enable (true) master ID replication. If Master ID replication is disabled, the - privileged protection level (supervisor mode) for eDMA4 transfers is used. */ -#endif - - bool enableGlobalChannelLink; /*!< Enable(true) channel linking is available and controlled by each channel's link - settings. */ - - bool enableHaltOnError; /*!< Enable (true) transfer halt on error. Any error causes the HALT bit to set. - Subsequently, all service requests are ignored until the HALT bit is cleared.*/ - - bool enableDebugMode; /*!< Enable(true) eDMA4 debug mode. When in debug mode, the eDMA4 stalls the start of - a new channel. Executing channels are allowed to complete. */ - - bool enableRoundRobinArbitration; /*!< Enable(true) channel linking is available and controlled by each channel's - link settings. */ -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG && FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG - edma_channel_config_t *channelConfig[FSL_FEATURE_EDMA_MODULE_CHANNEL]; /*!< channel preemption configuration */ -#endif -} edma_config_t; - -/*! @brief Callback for eDMA */ -struct _edma_handle; - -/*! @brief Define callback function for eDMA. - * - * This callback function is called in the EDMA interrupt handle. - * In normal mode, run into callback function means the transfer users need is done. - * In scatter gather mode, run into callback function means a transfer control block (tcd) is finished. Not - * all transfer finished, users can get the finished tcd numbers using interface EDMA_GetUnusedTCDNumber. - * - * @param handle EDMA handle pointer, users shall not touch the values inside. - * @param userData The callback user parameter pointer. Users can use this parameter to involve things users need to - * change in EDMA callback function. - * @param transferDone If the current loaded transfer done. In normal mode it means if all transfer done. In scatter - * gather mode, this parameter shows is the current transfer block in EDMA register is done. As the - * load of core is different, it will be different if the new tcd loaded into EDMA registers while - * this callback called. If true, it always means new tcd still not loaded into registers, while - * false means new tcd already loaded into registers. - * @param tcds How many tcds are done from the last callback. This parameter only used in scatter gather mode. It - * tells user how many tcds are finished between the last callback and this. - */ -typedef void (*edma_callback)(struct _edma_handle *handle, void *userData, bool transferDone, uint32_t tcds); - -/*! @brief eDMA transfer handle structure */ -typedef struct _edma_handle -{ - edma_callback callback; /*!< Callback function for major count exhausted. */ - void *userData; /*!< Callback function parameter. */ - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG && FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG - EDMA_ChannelType *channelBase; /*!< eDMA peripheral channel base address. */ -#endif - EDMA_Type *base; /*!< eDMA peripheral base address*/ - EDMA_TCDType *tcdBase; /*!< eDMA peripheral tcd base address. */ - - edma_tcd_t *tcdPool; /*!< Pointer to memory stored TCDs. */ - uint32_t channel; /*!< eDMA channel number. */ - - volatile int8_t header; /*!< The first TCD index. Should point to the next TCD to be loaded into the eDMA engine. */ - volatile int8_t tail; /*!< The last TCD index. Should point to the next TCD to be stored into the memory pool. */ - volatile int8_t tcdUsed; /*!< The number of used TCD slots. Should reflect the number of TCDs can be used/loaded in - the memory. */ - volatile int8_t tcdSize; /*!< The total number of TCD slots in the queue. */ -} edma_handle_t; -/******************************************************************************* - * APIs - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name eDMA initialization and de-initialization - * @{ - */ - -/*! - * @brief Initializes the eDMA peripheral. - * - * This function ungates the eDMA clock and configures the eDMA peripheral according - * to the configuration structure. - * - * @param base eDMA peripheral base address. - * @param config A pointer to the configuration structure, see "edma_config_t". - * @note This function enables the minor loop map feature. - */ -void EDMA_Init(EDMA_Type *base, const edma_config_t *config); - -/*! - * @brief Deinitializes the eDMA peripheral. - * - * This function gates the eDMA clock. - * - * @param base eDMA peripheral base address. - */ -void EDMA_Deinit(EDMA_Type *base); - -/*! - * @brief Push content of TCD structure into hardware TCD register. - * - * @param base EDMA peripheral base address. - * @param channel EDMA channel number. - * @param tcd Point to TCD structure. - */ -void EDMA_InstallTCD(EDMA_Type *base, uint32_t channel, edma_tcd_t *tcd); - -/*! - * @brief Gets the eDMA default configuration structure. - * - * This function sets the configuration structure to default values. - * The default configuration is set to the following values. - * @code - * config.enableContinuousLinkMode = false; - * config.enableHaltOnError = true; - * config.enableRoundRobinArbitration = false; - * config.enableDebugMode = false; - * @endcode - * - * @param config A pointer to the eDMA configuration structure. - */ -void EDMA_GetDefaultConfig(edma_config_t *config); - -#if defined(FSL_FEATURE_DMA_HAS_CONTINUOUS_CHANNEL_LINK) && FSL_FEATURE_DMA_HAS_CONTINUOUS_CHANNEL_LINK -/*! - * @brief Enable/Disable continuous channel link mode. - * - * @note Do not use continuous link mode with a channel linking to itself if there is only one minor loop - * iteration per service request, for example, if the channel's NBYTES value is the same as either - * the source or destination size. The same data transfer profile can be achieved by simply - * increasing the NBYTES value, which provides more efficient, faster processing. - * - * @param base EDMA peripheral base address. - * @param enable true is enable, false is disable. - */ -static inline void EDMA_EnableContinuousChannelLinkMode(EDMA_Type *base, bool enable) -{ - if (enable) - { - EDMA_BASE(base)->CR |= DMA_CR_CLM_MASK; - } - else - { - EDMA_BASE(base)->CR &= ~DMA_CR_CLM_MASK; - } -} -#endif - -#if defined(FSL_FEATURE_DMA_HAS_MINOR_LOOP_MAPPING) && FSL_FEATURE_DMA_HAS_MINOR_LOOP_MAPPING -/*! - * @brief Enable/Disable minor loop mapping. - * - * The TCDn.word2 is redefined to include individual enable fields, an offset field, and the - * NBYTES field. - * - * @param base EDMA peripheral base address. - * @param enable true is enable, false is disable. - */ -static inline void EDMA_EnableMinorLoopMapping(EDMA_Type *base, bool enable) -{ - if (enable) - { - EDMA_BASE(base)->CR |= DMA_CR_EMLM_MASK; - } - else - { - EDMA_BASE(base)->CR &= ~DMA_CR_EMLM_MASK; - } -} -#endif - -/*! @} */ -/*! - * @name eDMA Channel Operation - * @{ - */ - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG && FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG -/*! - * @brief EDMA Channel initialization - * - * @param base eDMA4 peripheral base address. - * @param channel eDMA4 channel number. - * @param channelConfig pointer to user's eDMA4 channel config structure, see edma_channel_config_t for detail. - */ -void EDMA_InitChannel(EDMA_Type *base, uint32_t channel, edma_channel_config_t *channelConfig); - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE && FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE -/*! - * @brief Set channel memory attribute. - * - * @param base eDMA4 peripheral base address. - * @param channel eDMA4 channel number. - * @param writeAttribute Attributes associated with a write transaction. - * @param readAttribute Attributes associated with a read transaction. - */ -static inline void EDMA_SetChannelMemoryAttribute(EDMA_Type *base, - uint32_t channel, - edma_channel_memory_attribute_t writeAttribute, - edma_channel_memory_attribute_t readAttribute) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - if (0U != (uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_MEMORY_ATTRIBUTEn(base)) - { -#if defined FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX - if ((uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_MP_CHANNEL_MUXn(base) == 1U) - { - EDMA_CHANNEL_BASE(base, channel)->CH_REGS.EDMA5_REG.CH_MATTR = - DMA_CH_MATTR_WCACHE(writeAttribute) | DMA_CH_MATTR_RCACHE(readAttribute); - } - else -#endif - { - EDMA_CHANNEL_BASE(base, channel)->CH_REGS.EDMA4_REG.CH_MATTR = - DMA_CH_MATTR_WCACHE(writeAttribute) | DMA_CH_MATTR_RCACHE(readAttribute); - } - } -} -#endif - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_SIGN_EXTENSION && FSL_FEATURE_EDMA_HAS_CHANNEL_SIGN_EXTENSION -/*! - * @brief Set channel sign extension. - * - * @param base eDMA4 peripheral base address. - * @param channel eDMA4 channel number. - * @param position A non-zero value specifing the sign extend bit position. - * If 0, sign extension is disabled. - */ -static inline void EDMA_SetChannelSignExtension(EDMA_Type *base, uint32_t channel, uint8_t position) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - if (0U != (uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_SIGN_EXTENSIONn(base)) - { - EDMA_CHANNEL_BASE(base, channel)->CH_CSR = - (EDMA_CHANNEL_BASE(base, channel)->CH_CSR & (~DMA_CH_CSR_SIGNEXT_MASK)) | - ((uint32_t)position << DMA_CH_CSR_SIGNEXT_SHIFT); - } -} -#endif - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE && FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE -/*! - * @brief Set channel swap size. - * - * @param base eDMA4 peripheral base address. - * @param channel eDMA4 channel number. - * @param swapSize Swap occurs with respect to the specified transfer size. - * If 0, swap is disabled. - */ -static inline void EDMA_SetChannelSwapSize(EDMA_Type *base, uint32_t channel, edma_channel_swap_size_t swapSize) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - if (0U != (uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_SWAP_SIZEn(base)) - { - EDMA_CHANNEL_BASE(base, channel)->CH_CSR = - (EDMA_CHANNEL_BASE(base, channel)->CH_CSR & (~DMA_CH_CSR_SWAP_MASK)) | - ((uint32_t)swapSize << DMA_CH_CSR_SWAP_SHIFT); - } -} -#endif - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE && FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE -/*! - * @brief Set channel access type. - * - * @param base eDMA4 peripheral base address. - * @param channel eDMA4 channel number. - * @param channelAccessType eDMA4's transactions type on the system bus when the channel is active. - */ -static inline void EDMA_SetChannelAccessType(EDMA_Type *base, - uint32_t channel, - edma_channel_access_type_t channelAccessType) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - if (0U != (uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_ACCESS_TYPEn(base)) - { -#if defined FSL_FEATURE_EDMA_HAS_PROT_REGISTER && FSL_FEATURE_EDMA_HAS_PROT_REGISTER - if (FSL_FEATURE_EDMA_INSTANCE_HAS_PROT_REGISTERn(base) == 1) - { - EDMA_MP_BASE(base)->MP_REGS.EDMA5_REG.CH_PROT[channel] = - (EDMA_MP_BASE(base)->MP_REGS.EDMA5_REG.CH_PROT[channel] & (~DMA_CH_SBR_INSTR_MASK)) | - ((uint32_t)channelAccessType << DMA_CH_SBR_INSTR_SHIFT); - } - else -#endif - { - EDMA_CHANNEL_BASE(base, channel)->CH_SBR = - (EDMA_CHANNEL_BASE(base, channel)->CH_SBR & (~DMA_CH_SBR_INSTR_MASK)) | - ((uint32_t)channelAccessType << DMA_CH_SBR_INSTR_SHIFT); - } - } -} -#endif - -#if (defined FSL_FEATURE_EDMA_HAS_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_CHANNEL_MUX) || \ - (defined FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX) -/*! - * @brief Set channel request source. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param channelRequestSource eDMA hardware service request source for the channel. User need to use - * the dma_request_source_t type as the input parameter. Note that devices - * may use other enum type to express dma request source and User can fined it in - * SOC header or fsl_edma_soc.h. - */ -static inline void EDMA_SetChannelMux(EDMA_Type *base, uint32_t channel, int32_t channelRequestSource) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - if ((uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_MUXn(base) == 1U) - { - /* Reset channel mux */ -#if defined FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX - if ((uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_MP_CHANNEL_MUXn(base) == 1U) - { - EDMA_MP_BASE(base)->MP_REGS.EDMA5_REG.CH_MUX[channel] = DMA_CH_MUX_SOURCE(0); - EDMA_MP_BASE(base)->MP_REGS.EDMA5_REG.CH_MUX[channel] = DMA_CH_MUX_SOURCE(channelRequestSource); - } - else -#endif - { -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_CHANNEL_MUX - EDMA_CHANNEL_BASE(base, channel)->CH_REGS.EDMA4_REG.CH_MUX = DMA_CH_MUX_SOURCE(0); - EDMA_CHANNEL_BASE(base, channel)->CH_REGS.EDMA4_REG.CH_MUX = DMA_CH_MUX_SOURCE(channelRequestSource); -#endif - } - } -} -#endif - -/*! - * @brief Gets the channel identification and attribute information on the system bus interface. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @return The mask of the channel system bus information. Users need to use the - * _edma_channel_sys_bus_info type to decode the return variables. - */ -static inline uint32_t EDMA_GetChannelSystemBusInformation(EDMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - return EDMA_CHANNEL_BASE(base, channel)->CH_SBR; -} - -/*! - * @brief Set channel master ID replication. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param enable true is enable, false is disable. - */ -static inline void EDMA_EnableChannelMasterIDReplication(EDMA_Type *base, uint32_t channel, bool enable) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - -#if defined FSL_FEATURE_EDMA_HAS_PROT_REGISTER && FSL_FEATURE_EDMA_HAS_PROT_REGISTER - if (FSL_FEATURE_EDMA_INSTANCE_HAS_PROT_REGISTERn(base) == 1) - { - if (enable) - { - EDMA_MP_BASE(base)->MP_REGS.EDMA5_REG.CH_PROT[channel] |= DMA_CH_SBR_EMI_MASK; - } - else - { - EDMA_MP_BASE(base)->MP_REGS.EDMA5_REG.CH_PROT[channel] &= ~DMA_CH_SBR_EMI_MASK; - } - } - else -#endif - { - if (enable) - { - EDMA_CHANNEL_BASE(base, channel)->CH_SBR |= DMA_CH_SBR_EMI_MASK; - } - else - { - EDMA_CHANNEL_BASE(base, channel)->CH_SBR &= ~DMA_CH_SBR_EMI_MASK; - } - } -} - -#if !(defined(FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) && FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) -/*! - * @brief Set channel security level. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param level security level. - */ -static inline void EDMA_SetChannelSecurityLevel(EDMA_Type *base, uint32_t channel, edma_channel_security_level_t level) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - -#if defined FSL_FEATURE_EDMA_HAS_PROT_REGISTER && FSL_FEATURE_EDMA_HAS_PROT_REGISTER - if (FSL_FEATURE_EDMA_INSTANCE_HAS_PROT_REGISTERn(base) == 1) - { - if (level == kEDMA_ChannelSecurityLevelSecure) - { - EDMA_MP_BASE(base)->MP_REGS.EDMA5_REG.CH_PROT[channel] |= DMA_CH_SBR_SEC_MASK; - } - else - { - EDMA_MP_BASE(base)->MP_REGS.EDMA5_REG.CH_PROT[channel] &= ~DMA_CH_SBR_SEC_MASK; - } - } - else -#endif - { - if (level == kEDMA_ChannelSecurityLevelSecure) - { - EDMA_CHANNEL_BASE(base, channel)->CH_SBR |= DMA_CH_SBR_SEC_MASK; - } - else - { - EDMA_CHANNEL_BASE(base, channel)->CH_SBR &= ~DMA_CH_SBR_SEC_MASK; - } - } -} -#endif - -/*! - * @brief Set channel security level. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param level security level. - */ -static inline void EDMA_SetChannelProtectionLevel(EDMA_Type *base, - uint32_t channel, - edma_channel_protection_level_t level) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - -#if defined FSL_FEATURE_EDMA_HAS_PROT_REGISTER && FSL_FEATURE_EDMA_HAS_PROT_REGISTER - if (FSL_FEATURE_EDMA_INSTANCE_HAS_PROT_REGISTERn(base) == 1) - { - if (level == kEDMA_ChannelProtectionLevelPrivileged) - { - EDMA_MP_BASE(base)->MP_REGS.EDMA5_REG.CH_PROT[channel] |= DMA_CH_SBR_PAL_MASK; - } - else - { - EDMA_MP_BASE(base)->MP_REGS.EDMA5_REG.CH_PROT[channel] &= ~DMA_CH_SBR_PAL_MASK; - } - } - else -#endif - { - if (level == kEDMA_ChannelProtectionLevelPrivileged) - { - EDMA_CHANNEL_BASE(base, channel)->CH_SBR |= DMA_CH_SBR_PAL_MASK; - } - else - { - EDMA_CHANNEL_BASE(base, channel)->CH_SBR &= ~DMA_CH_SBR_PAL_MASK; - } - } -} - -#endif -/*! - * @brief Sets all TCD registers to default values. - * - * This function sets TCD registers for this channel to default values. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @note This function must not be called while the channel transfer is ongoing - * or it causes unpredictable results. - * @note This function enables the auto stop request feature. - */ -void EDMA_ResetChannel(EDMA_Type *base, uint32_t channel); - -/*! - * @brief Configures the eDMA transfer attribute. - * - * This function configures the transfer attribute, including source address, destination address, - * transfer size, address offset, and so on. It also configures the scatter gather feature if the - * user supplies the TCD address. - * Example: - * @code - * edma_transfer_t config; - * edma_tcd_t tcd; - * config.srcAddr = ..; - * config.destAddr = ..; - * ... - * EDMA_SetTransferConfig(DMA0, channel, &config, &stcd); - * @endcode - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param config Pointer to eDMA transfer configuration structure. - * @param nextTcd Point to TCD structure. It can be NULL if users - * do not want to enable scatter/gather feature. - * @note If nextTcd is not NULL, it means scatter gather feature is enabled - * and DREQ bit is cleared in the previous transfer configuration, which - * is set in the eDMA_ResetChannel. - */ -void EDMA_SetTransferConfig(EDMA_Type *base, - uint32_t channel, - const edma_transfer_config_t *config, - edma_tcd_t *nextTcd); - -/*! - * @brief Configures the eDMA minor offset feature. - * - * The minor offset means that the signed-extended value is added to the source address or destination - * address after each minor loop. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param config A pointer to the minor offset configuration structure. - */ -void EDMA_SetMinorOffsetConfig(EDMA_Type *base, uint32_t channel, const edma_minor_offset_config_t *config); - -/*! - * @brief Configures the eDMA channel preemption feature. - * - * This function configures the channel preemption attribute and the priority of the channel. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number - * @param config A pointer to the channel preemption configuration structure. - */ -void EDMA_SetChannelPreemptionConfig(EDMA_Type *base, uint32_t channel, const edma_channel_Preemption_config_t *config); - -/*! - * @brief Sets the channel link for the eDMA transfer. - * - * This function configures either the minor link or the major link mode. The minor link means that the channel link is - * triggered every time CITER decreases by 1. The major link means that the channel link is triggered when the CITER is - * exhausted. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param type A channel link type, which can be one of the following: - * @arg kEDMA_LinkNone - * @arg kEDMA_MinorLink - * @arg kEDMA_MajorLink - * @param linkedChannel The linked channel number. - * @note Users should ensure that DONE flag is cleared before calling this interface, or the configuration is invalid. - */ -void EDMA_SetChannelLink(EDMA_Type *base, uint32_t channel, edma_channel_link_type_t type, uint32_t linkedChannel); - -#if defined FSL_FEATURE_EDMA_HAS_BANDWIDTH && FSL_FEATURE_EDMA_HAS_BANDWIDTH -/*! - * @brief Sets the bandwidth for the eDMA transfer. - * - * Because the eDMA processes the minor loop, it continuously generates read/write sequences - * until the minor count is exhausted. The bandwidth forces the eDMA to stall after the completion of - * each read/write access to control the bus request bandwidth seen by the crossbar switch. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param bandWidth A bandwidth setting, which can be one of the following: - * @arg kEDMABandwidthStallNone - * @arg kEDMABandwidthStall4Cycle - * @arg kEDMABandwidthStall8Cycle - */ -void EDMA_SetBandWidth(EDMA_Type *base, uint32_t channel, edma_bandwidth_t bandWidth); -#endif - -/*! - * @brief Sets the source modulo and the destination modulo for the eDMA transfer. - * - * This function defines a specific address range specified to be the value after (SADDR + SOFF)/(DADDR + DOFF) - * calculation is performed or the original register value. It provides the ability to implement a circular data - * queue easily. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param srcModulo A source modulo value. - * @param destModulo A destination modulo value. - */ -void EDMA_SetModulo(EDMA_Type *base, uint32_t channel, edma_modulo_t srcModulo, edma_modulo_t destModulo); - -#if defined(FSL_FEATURE_EDMA_ASYNCHRO_REQUEST_CHANNEL_COUNT) && FSL_FEATURE_EDMA_ASYNCHRO_REQUEST_CHANNEL_COUNT -/*! - * @brief Enables an async request for the eDMA transfer. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param enable The command to enable (true) or disable (false). - */ -static inline void EDMA_EnableAsyncRequest(EDMA_Type *base, uint32_t channel, bool enable) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - EDMA_BASE(base)->EARS &= ~((uint32_t)1U << channel); - EDMA_BASE(base)->EARS |= ((uint32_t)(true == enable ? 1U : 0U) << channel); -#else - if (enable) - { - EDMA_CHANNEL_BASE(base, channel)->CH_CSR |= DMA_CH_CSR_EARQ_MASK; - } - else - { - EDMA_CHANNEL_BASE(base, channel)->CH_CSR &= ~DMA_CH_CSR_EARQ_MASK; - } -#endif -} -#endif - -/*! - * @brief Enables an auto stop request for the eDMA transfer. - * - * If enabling the auto stop request, the eDMA hardware automatically disables the hardware channel request. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param enable The command to enable (true) or disable (false). - */ -static inline void EDMA_EnableAutoStopRequest(EDMA_Type *base, uint32_t channel, bool enable) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - if (enable) - { - EDMA_TCD_CSR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) |= DMA_CSR_DREQ_MASK; - } - else - { - EDMA_TCD_CSR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_CSR_DREQ_MASK; - } -} - -/*! - * @brief Enables the interrupt source for the eDMA transfer. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_EnableChannelInterrupts(EDMA_Type *base, uint32_t channel, uint32_t mask); - -/*! - * @brief Disables the interrupt source for the eDMA transfer. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param mask The mask of the interrupt source to be set. Use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_DisableChannelInterrupts(EDMA_Type *base, uint32_t channel, uint32_t mask); - -/*! - * @brief Configures the eDMA channel TCD major offset feature. - * - * Adjustment value added to the source address at the completion of the major iteration count - * - * @param base eDMA peripheral base address. - * @param channel edma channel number. - * @param sourceOffset source address offset will be applied to source address after major loop done. - * @param destOffset destination address offset will be applied to source address after major loop done. - */ -void EDMA_SetMajorOffsetConfig(EDMA_Type *base, uint32_t channel, int32_t sourceOffset, int32_t destOffset); - -/*! @} */ -/*! - * @name eDMA TCD Operation - * @{ - */ -/*! - * @brief Sets TCD fields according to the user's channel transfer configuration structure, @ref - * edma_transfer_config_t. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_ConfigChannelSoftwareTCDExt - * - * Application should be careful about the TCD pool buffer storage class, - * - For the platform has cache, the software TCD should be put in non cache section - * - The TCD pool buffer should have a consistent storage class. - * - * @param tcd Pointer to the TCD structure. - * @param transfer channel transfer configuration pointer. - * - * @note This function enables the auto stop request feature. - */ -void EDMA_ConfigChannelSoftwareTCD(edma_tcd_t *tcd, const edma_transfer_config_t *transfer); - -/*! - * @brief Sets all fields to default values for the TCD structure. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_TcdResetExt - * - * This function sets all fields for this TCD structure to default value. - * - * @param tcd Pointer to the TCD structure. - * @note This function enables the auto stop request feature. - */ -void EDMA_TcdReset(edma_tcd_t *tcd); - -/*! - * @brief Configures the eDMA TCD transfer attribute. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_TcdSetTransferConfigExt - * - * The TCD is a transfer control descriptor. The content of the TCD is the same as the hardware TCD registers. - * The TCD is used in the scatter-gather mode. - * This function configures the TCD transfer attribute, including source address, destination address, - * transfer size, address offset, and so on. It also configures the scatter gather feature if the - * user supplies the next TCD address. - * Example: - * @code - * edma_transfer_t config = { - * ... - * } - * edma_tcd_t tcd __aligned(32); - * edma_tcd_t nextTcd __aligned(32); - * EDMA_TcdSetTransferConfig(&tcd, &config, &nextTcd); - * @endcode - * - * @param tcd Pointer to the TCD structure. - * @param config Pointer to eDMA transfer configuration structure. - * @param nextTcd Pointer to the next TCD structure. It can be NULL if users - * do not want to enable scatter/gather feature. - * @note TCD address should be 32 bytes aligned or it causes an eDMA error. - * @note If the nextTcd is not NULL, the scatter gather feature is enabled - * and DREQ bit is cleared in the previous transfer configuration, which - * is set in the EDMA_TcdReset. - */ -void EDMA_TcdSetTransferConfig(edma_tcd_t *tcd, const edma_transfer_config_t *config, edma_tcd_t *nextTcd); - -/*! - * @brief Configures the eDMA TCD minor offset feature. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_TcdSetMinorOffsetConfigExt - * - * A minor offset is a signed-extended value added to the source address or a destination - * address after each minor loop. - * - * @param tcd A point to the TCD structure. - * @param config A pointer to the minor offset configuration structure. - */ -void EDMA_TcdSetMinorOffsetConfig(edma_tcd_t *tcd, const edma_minor_offset_config_t *config); - -/*! - * @brief Sets the channel link for the eDMA TCD. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_TcdSetChannelLinkExt - * - * This function configures either a minor link or a major link. The minor link means the channel link is - * triggered every time CITER decreases by 1. The major link means that the channel link is triggered when the CITER is - * exhausted. - * - * @note Users should ensure that DONE flag is cleared before calling this interface, or the configuration is invalid. - * @param tcd Point to the TCD structure. - * @param type Channel link type, it can be one of: - * @arg kEDMA_LinkNone - * @arg kEDMA_MinorLink - * @arg kEDMA_MajorLink - * @param linkedChannel The linked channel number. - */ -void EDMA_TcdSetChannelLink(edma_tcd_t *tcd, edma_channel_link_type_t type, uint32_t linkedChannel); - -#if defined FSL_FEATURE_EDMA_HAS_BANDWIDTH && FSL_FEATURE_EDMA_HAS_BANDWIDTH -/*! - * @brief Sets the bandwidth for the eDMA TCD. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_TcdSetBandWidthExt - * - * Because the eDMA processes the minor loop, it continuously generates read/write sequences - * until the minor count is exhausted. The bandwidth forces the eDMA to stall after the completion of - * each read/write access to control the bus request bandwidth seen by the crossbar switch. - * @param tcd A pointer to the TCD structure. - * @param bandWidth A bandwidth setting, which can be one of the following: - * @arg kEDMABandwidthStallNone - * @arg kEDMABandwidthStall4Cycle - * @arg kEDMABandwidthStall8Cycle - */ -static inline void EDMA_TcdSetBandWidth(edma_tcd_t *tcd, edma_bandwidth_t bandWidth) -{ - assert(tcd != NULL); - - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) = - (uint16_t)((EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) & (~DMA_CSR_BWC_MASK)) | DMA_CSR_BWC(bandWidth)); -} -#endif - -/*! - * @brief Sets the source modulo and the destination modulo for the eDMA TCD. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_TcdSetModuloExt - * - * This function defines a specific address range specified to be the value after (SADDR + SOFF)/(DADDR + DOFF) - * calculation is performed or the original register value. It provides the ability to implement a circular data - * queue easily. - * - * @param tcd A pointer to the TCD structure. - * @param srcModulo A source modulo value. - * @param destModulo A destination modulo value. - */ -void EDMA_TcdSetModulo(edma_tcd_t *tcd, edma_modulo_t srcModulo, edma_modulo_t destModulo); - -/*! - * @brief Sets the auto stop request for the eDMA TCD. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_TcdEnableAutoStopRequestExt - * - * If enabling the auto stop request, the eDMA hardware automatically disables the hardware channel request. - * - * @param tcd A pointer to the TCD structure. - * @param enable The command to enable (true) or disable (false). - */ -static inline void EDMA_TcdEnableAutoStopRequest(edma_tcd_t *tcd, bool enable) -{ - assert(tcd != NULL); - - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) = (uint16_t)((EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) & (~DMA_CSR_DREQ_MASK)) | - DMA_CSR_DREQ((true == enable ? 1U : 0U))); -} - -/*! - * @brief Enables the interrupt source for the eDMA TCD. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_TcdEnableInterruptsExt - * - * @param tcd Point to the TCD structure. - * @param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_TcdEnableInterrupts(edma_tcd_t *tcd, uint32_t mask); - -/*! - * @brief Disables the interrupt source for the eDMA TCD. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_TcdDisableInterruptsExt - * - * @param tcd Point to the TCD structure. - * @param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_TcdDisableInterrupts(edma_tcd_t *tcd, uint32_t mask); - -/*! - * @brief Configures the eDMA TCD major offset feature. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_TcdSetMajorOffsetConfigExt - * - * Adjustment value added to the source address at the completion of the major iteration count - * - * @param tcd A point to the TCD structure. - * @param sourceOffset source address offset wiil be applied to source address after major loop done. - * @param destOffset destination address offset will be applied to source address after major loop done. - */ -void EDMA_TcdSetMajorOffsetConfig(edma_tcd_t *tcd, int32_t sourceOffset, int32_t destOffset); - -/*! - * @brief Sets TCD fields according to the user's channel transfer configuration structure, @ref - * edma_transfer_config_t. - * - * Application should be careful about the TCD pool buffer storage class, - * - For the platform has cache, the software TCD should be put in non cache section - * - The TCD pool buffer should have a consistent storage class. - * - * @param base eDMA peripheral base address. - * @param tcd Pointer to the TCD structure. - * @param transfer channel transfer configuration pointer. - * - * @note This function enables the auto stop request feature. - */ -void EDMA_ConfigChannelSoftwareTCDExt(EDMA_Type *base, edma_tcd_t *tcd, const edma_transfer_config_t *transfer); - -/*! - * @brief Sets all fields to default values for the TCD structure. - * - * This function sets all fields for this TCD structure to default value. - * - * @param base eDMA peripheral base address. - * @param tcd Pointer to the TCD structure. - * @note This function enables the auto stop request feature. - */ -void EDMA_TcdResetExt(EDMA_Type *base, edma_tcd_t *tcd); - -/*! - * @brief Configures the eDMA TCD transfer attribute. - * - * The TCD is a transfer control descriptor. The content of the TCD is the same as the hardware TCD registers. - * The TCD is used in the scatter-gather mode. - * This function configures the TCD transfer attribute, including source address, destination address, - * transfer size, address offset, and so on. It also configures the scatter gather feature if the - * user supplies the next TCD address. - * Example: - * @code - * edma_transfer_t config = { - * ... - * } - * edma_tcd_t tcd __aligned(32); - * edma_tcd_t nextTcd __aligned(32); - * EDMA_TcdSetTransferConfig(&tcd, &config, &nextTcd); - * @endcode - * - * @param base eDMA peripheral base address. - * @param tcd Pointer to the TCD structure. - * @param config Pointer to eDMA transfer configuration structure. - * @param nextTcd Pointer to the next TCD structure. It can be NULL if users - * do not want to enable scatter/gather feature. - * @note TCD address should be 32 bytes aligned or it causes an eDMA error. - * @note If the nextTcd is not NULL, the scatter gather feature is enabled - * and DREQ bit is cleared in the previous transfer configuration, which - * is set in the EDMA_TcdReset. - */ -void EDMA_TcdSetTransferConfigExt(EDMA_Type *base, - edma_tcd_t *tcd, - const edma_transfer_config_t *config, - edma_tcd_t *nextTcd); - -/*! - * @brief Configures the eDMA TCD minor offset feature. - * - * A minor offset is a signed-extended value added to the source address or a destination - * address after each minor loop. - * - * @param base eDMA peripheral base address. - * @param tcd A point to the TCD structure. - * @param config A pointer to the minor offset configuration structure. - */ -void EDMA_TcdSetMinorOffsetConfigExt(EDMA_Type *base, edma_tcd_t *tcd, const edma_minor_offset_config_t *config); - -/*! - * @brief Sets the channel link for the eDMA TCD. - * - * This function configures either a minor link or a major link. The minor link means the channel link is - * triggered every time CITER decreases by 1. The major link means that the channel link is triggered when the CITER is - * exhausted. - * - * @note Users should ensure that DONE flag is cleared before calling this interface, or the configuration is invalid. - * @param base eDMA peripheral base address. - * @param tcd Point to the TCD structure. - * @param type Channel link type, it can be one of: - * @arg kEDMA_LinkNone - * @arg kEDMA_MinorLink - * @arg kEDMA_MajorLink - * @param linkedChannel The linked channel number. - */ -void EDMA_TcdSetChannelLinkExt(EDMA_Type *base, edma_tcd_t *tcd, edma_channel_link_type_t type, uint32_t linkedChannel); - -#if defined FSL_FEATURE_EDMA_HAS_BANDWIDTH && FSL_FEATURE_EDMA_HAS_BANDWIDTH -/*! - * @brief Sets the bandwidth for the eDMA TCD. - * - * Because the eDMA processes the minor loop, it continuously generates read/write sequences - * until the minor count is exhausted. The bandwidth forces the eDMA to stall after the completion of - * each read/write access to control the bus request bandwidth seen by the crossbar switch. - * @param base eDMA peripheral base address. - * @param tcd A pointer to the TCD structure. - * @param bandWidth A bandwidth setting, which can be one of the following: - * @arg kEDMABandwidthStallNone - * @arg kEDMABandwidthStall4Cycle - * @arg kEDMABandwidthStall8Cycle - */ -static inline void EDMA_TcdSetBandWidthExt(EDMA_Type *base, edma_tcd_t *tcd, edma_bandwidth_t bandWidth) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) = - (uint16_t)((EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) & (~DMA_CSR_BWC_MASK)) | DMA_CSR_BWC(bandWidth)); -} -#endif - -/*! - * @brief Sets the source modulo and the destination modulo for the eDMA TCD. - * - * This function defines a specific address range specified to be the value after (SADDR + SOFF)/(DADDR + DOFF) - * calculation is performed or the original register value. It provides the ability to implement a circular data - * queue easily. - * - * @param base eDMA peripheral base address. - * @param tcd A pointer to the TCD structure. - * @param srcModulo A source modulo value. - * @param destModulo A destination modulo value. - */ -void EDMA_TcdSetModuloExt(EDMA_Type *base, edma_tcd_t *tcd, edma_modulo_t srcModulo, edma_modulo_t destModulo); - -/*! - * @brief Sets the auto stop request for the eDMA TCD. - * - * If enabling the auto stop request, the eDMA hardware automatically disables the hardware channel request. - * - * @param base eDMA peripheral base address. - * @param tcd A pointer to the TCD structure. - * @param enable The command to enable (true) or disable (false). - */ -static inline void EDMA_TcdEnableAutoStopRequestExt(EDMA_Type *base, edma_tcd_t *tcd, bool enable) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) = (uint16_t)((EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) & (~DMA_CSR_DREQ_MASK)) | - DMA_CSR_DREQ((true == enable ? 1U : 0U))); -} - -/*! - * @brief Enables the interrupt source for the eDMA TCD. - * - * @param base eDMA peripheral base address. - * @param tcd Point to the TCD structure. - * @param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_TcdEnableInterruptsExt(EDMA_Type *base, edma_tcd_t *tcd, uint32_t mask); - -/*! - * @brief Disables the interrupt source for the eDMA TCD. - * - * @param base eDMA peripheral base address. - * @param tcd Point to the TCD structure. - * @param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_TcdDisableInterruptsExt(EDMA_Type *base, edma_tcd_t *tcd, uint32_t mask); - -/*! - * @brief Configures the eDMA TCD major offset feature. - * - * Adjustment value added to the source address at the completion of the major iteration count - * - * @param base eDMA peripheral base address. - * @param tcd A point to the TCD structure. - * @param sourceOffset source address offset wiil be applied to source address after major loop done. - * @param destOffset destination address offset will be applied to source address after major loop done. - */ -void EDMA_TcdSetMajorOffsetConfigExt(EDMA_Type *base, edma_tcd_t *tcd, int32_t sourceOffset, int32_t destOffset); - -/*! @} */ -/*! - * @name eDMA Channel Transfer Operation - * @{ - */ - -/*! - * @brief Enables the eDMA hardware channel request. - * - * This function enables the hardware channel request. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - */ -static inline void EDMA_EnableChannelRequest(EDMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - EDMA_BASE(base)->SERQ = DMA_SERQ_SERQ(channel); -#else - EDMA_CHANNEL_BASE(base, channel)->CH_CSR |= DMA_CH_CSR_ERQ_MASK; -#endif -} - -/*! - * @brief Disables the eDMA hardware channel request. - * - * This function disables the hardware channel request. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - */ -static inline void EDMA_DisableChannelRequest(EDMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - EDMA_BASE(base)->CERQ = DMA_CERQ_CERQ(channel); -#else - EDMA_CHANNEL_BASE(base, channel)->CH_CSR &= ~DMA_CH_CSR_ERQ_MASK; -#endif -} - -/*! - * @brief Starts the eDMA transfer by using the software trigger. - * - * This function starts a minor loop transfer. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - */ -static inline void EDMA_TriggerChannelStart(EDMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - EDMA_BASE(base)->SSRT = DMA_SSRT_SSRT(channel); -#else - EDMA_TCD_CSR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) |= DMA_CSR_START_MASK; -#endif -} - -/*! @} */ -/*! - * @name eDMA Channel Status Operation - * @{ - */ - -/*! - * @brief Gets the remaining major loop count from the eDMA current channel TCD. - * - * This function checks the TCD (Task Control Descriptor) status for a specified - * eDMA channel and returns the number of major loop count that has not finished. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @return Major loop count which has not been transferred yet for the current TCD. - * @note 1. This function can only be used to get unfinished major loop count of transfer without - * the next TCD, or it might be inaccuracy. - * 2. The unfinished/remaining transfer bytes cannot be obtained directly from registers while - * the channel is running. - * Because to calculate the remaining bytes, the initial NBYTES configured in DMA_TCDn_NBYTES_MLNO - * register is needed while the eDMA IP does not support getting it while a channel is active. - * In another word, the NBYTES value reading is always the actual (decrementing) NBYTES value the dma_engine - * is working with while a channel is running. - * Consequently, to get the remaining transfer bytes, a software-saved initial value of NBYTES (for example - * copied before enabling the channel) is needed. The formula to calculate it is shown below: - * RemainingBytes = RemainingMajorLoopCount * NBYTES(initially configured) - */ -uint32_t EDMA_GetRemainingMajorLoopCount(EDMA_Type *base, uint32_t channel); - -/*! - * @brief Gets the eDMA channel error status flags. - * - * @param base eDMA peripheral base address. - * @return The mask of error status flags. Users need to use the - * _edma_error_status_flags type to decode the return variables. - */ -static inline uint32_t EDMA_GetErrorStatusFlags(EDMA_Type *base) -{ -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - return EDMA_BASE(base)->ES; -#else - return EDMA_MP_BASE(base)->MP_ES; -#endif -} - -/*! - * @brief Gets the eDMA channel status flags. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @return The mask of channel status flags. Users need to use the - * _edma_channel_status_flags type to decode the return variables. - */ -uint32_t EDMA_GetChannelStatusFlags(EDMA_Type *base, uint32_t channel); - -/*! - * @brief Clears the eDMA channel status flags. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param mask The mask of channel status to be cleared. Users need to use - * the defined _edma_channel_status_flags type. - */ -void EDMA_ClearChannelStatusFlags(EDMA_Type *base, uint32_t channel, uint32_t mask); - -/*! @} */ -/*! - * @name eDMA Transactional Operation - */ - -/*! - * @brief Creates the eDMA handle. - * - * This function is called if using the transactional API for eDMA. This function - * initializes the internal state of the eDMA handle. - * - * @param handle eDMA handle pointer. The eDMA handle stores callback function and - * parameters. - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - */ -void EDMA_CreateHandle(edma_handle_t *handle, EDMA_Type *base, uint32_t channel); - -/*! - * @brief Installs the TCDs memory pool into the eDMA handle. - * - * This function is called after the EDMA_CreateHandle to use scatter/gather feature. This function shall only be used - * while users need to use scatter gather mode. Scatter gather mode enables EDMA to load a new transfer control block - * (tcd) in hardware, and automatically reconfigure that DMA channel for a new transfer. - * Users need to prepare tcd memory and also configure tcds using interface EDMA_SubmitTransfer. - * - * @param handle eDMA handle pointer. - * @param tcdPool A memory pool to store TCDs. It must be 32 bytes aligned. - * @param tcdSize The number of TCD slots. - */ -void EDMA_InstallTCDMemory(edma_handle_t *handle, edma_tcd_t *tcdPool, uint32_t tcdSize); - -/*! - * @brief Installs a callback function for the eDMA transfer. - * - * This callback is called in the eDMA IRQ handler. Use the callback to do something after - * the current major loop transfer completes. This function will be called every time one tcd finished transfer. - * - * @param handle eDMA handle pointer. - * @param callback eDMA callback function pointer. - * @param userData A parameter for the callback function. - */ -void EDMA_SetCallback(edma_handle_t *handle, edma_callback callback, void *userData); - -/*! - * @brief Prepares the eDMA transfer structure configurations. - * - * This function prepares the transfer configuration structure according to the user input. - * - * @param config The user configuration structure of type edma_transfer_t. - * @param srcAddr eDMA transfer source address. - * @param srcWidth eDMA transfer source address width(bytes). - * @param srcOffset source address offset. - * @param destAddr eDMA transfer destination address. - * @param destWidth eDMA transfer destination address width(bytes). - * @param destOffset destination address offset. - * @param bytesEachRequest eDMA transfer bytes per channel request. - * @param transferBytes eDMA transfer bytes to be transferred. - * @note The data address and the data width must be consistent. For example, if the SRC - * is 4 bytes, the source address must be 4 bytes aligned, or it results in - * source address error (SAE). - * User can check if 128 bytes support is available for specific instance by - * FSL_FEATURE_EDMA_INSTANCE_SUPPORT_128_BYTES_TRANSFERn. - */ -void EDMA_PrepareTransferConfig(edma_transfer_config_t *config, - void *srcAddr, - uint32_t srcWidth, - int16_t srcOffset, - void *destAddr, - uint32_t destWidth, - int16_t destOffset, - uint32_t bytesEachRequest, - uint32_t transferBytes); - -/*! - * @brief Prepares the eDMA transfer structure. - * - * This function prepares the transfer configuration structure according to the user input. - * - * @param config The user configuration structure of type edma_transfer_t. - * @param srcAddr eDMA transfer source address. - * @param srcWidth eDMA transfer source address width(bytes). - * @param destAddr eDMA transfer destination address. - * @param destWidth eDMA transfer destination address width(bytes). - * @param bytesEachRequest eDMA transfer bytes per channel request. - * @param transferBytes eDMA transfer bytes to be transferred. - * @param type eDMA transfer type. - * @note The data address and the data width must be consistent. For example, if the SRC - * is 4 bytes, the source address must be 4 bytes aligned, or it results in - * source address error (SAE). - */ -void EDMA_PrepareTransfer(edma_transfer_config_t *config, - void *srcAddr, - uint32_t srcWidth, - void *destAddr, - uint32_t destWidth, - uint32_t bytesEachRequest, - uint32_t transferBytes, - edma_transfer_type_t type); - -/*! - * @brief Prepares the eDMA transfer content descriptor. - * - * This function prepares the transfer content descriptor structure according to the user input. - * - * @param handle eDMA handle pointer. - * @param tcd Pointer to eDMA transfer content descriptor structure. - * @param srcAddr eDMA transfer source address. - * @param srcWidth eDMA transfer source address width(bytes). - * @param srcOffset source address offset. - * @param destAddr eDMA transfer destination address. - * @param destWidth eDMA transfer destination address width(bytes). - * @param destOffset destination address offset. - * @param bytesEachRequest eDMA transfer bytes per channel request. - * @param transferBytes eDMA transfer bytes to be transferred. - * @param nextTcd eDMA transfer linked TCD address. - * - * @note The data address and the data width must be consistent. For example, if the SRC - * is 4 bytes, the source address must be 4 bytes aligned, or it results in - * source address error (SAE). - */ -void EDMA_PrepareTransferTCD(edma_handle_t *handle, - edma_tcd_t *tcd, - void *srcAddr, - uint32_t srcWidth, - int16_t srcOffset, - void *destAddr, - uint32_t destWidth, - int16_t destOffset, - uint32_t bytesEachRequest, - uint32_t transferBytes, - edma_tcd_t *nextTcd); - -/*! - * @brief Submits the eDMA transfer content descriptor. - * - * This function submits the eDMA transfer request according to the transfer content descriptor. - * In scatter gather mode, call this function will add a configured tcd to the circular list of tcd pool. - * The tcd pools is setup by call function EDMA_InstallTCDMemory before. - * - * Typical user case: - * 1. submit single transfer - * @code - * edma_tcd_t tcd; - * EDMA_PrepareTransferTCD(handle, tcd, ....) - * EDMA_SubmitTransferTCD(handle, tcd) - * EDMA_StartTransfer(handle) - * @endcode - * - * 2. submit static link transfer, - * @code - * edma_tcd_t tcd[2]; - * EDMA_PrepareTransferTCD(handle, &tcd[0], ....) - * EDMA_PrepareTransferTCD(handle, &tcd[1], ....) - * EDMA_SubmitTransferTCD(handle, &tcd[0]) - * EDMA_StartTransfer(handle) - * @endcode - * - * 3. submit dynamic link transfer - * @code - * edma_tcd_t tcdpool[2]; - * EDMA_InstallTCDMemory(&g_DMA_Handle, tcdpool, 2); - * edma_tcd_t tcd; - * EDMA_PrepareTransferTCD(handle, tcd, ....) - * EDMA_SubmitTransferTCD(handle, tcd) - * EDMA_PrepareTransferTCD(handle, tcd, ....) - * EDMA_SubmitTransferTCD(handle, tcd) - * EDMA_StartTransfer(handle) - * @endcode - * - * 4. submit loop transfer - * @code - * edma_tcd_t tcd[2]; - * EDMA_PrepareTransferTCD(handle, &tcd[0], ...,&tcd[1]) - * EDMA_PrepareTransferTCD(handle, &tcd[1], ..., &tcd[0]) - * EDMA_SubmitTransferTCD(handle, &tcd[0]) - * EDMA_StartTransfer(handle) - * @endcode - * - * @param handle eDMA handle pointer. - * @param tcd Pointer to eDMA transfer content descriptor structure. - * - * @retval kStatus_EDMA_Success It means submit transfer request succeed. - * @retval kStatus_EDMA_QueueFull It means TCD queue is full. Submit transfer request is not allowed. - * @retval kStatus_EDMA_Busy It means the given channel is busy, need to submit request later. - */ -status_t EDMA_SubmitTransferTCD(edma_handle_t *handle, edma_tcd_t *tcd); - -/*! - * @brief Submits the eDMA transfer request. - * - * This function submits the eDMA transfer request according to the transfer configuration structure. - * In scatter gather mode, call this function will add a configured tcd to the circular list of tcd pool. - * The tcd pools is setup by call function EDMA_InstallTCDMemory before. - * - * @param handle eDMA handle pointer. - * @param config Pointer to eDMA transfer configuration structure. - * @retval kStatus_EDMA_Success It means submit transfer request succeed. - * @retval kStatus_EDMA_QueueFull It means TCD queue is full. Submit transfer request is not allowed. - * @retval kStatus_EDMA_Busy It means the given channel is busy, need to submit request later. - */ -status_t EDMA_SubmitTransfer(edma_handle_t *handle, const edma_transfer_config_t *config); - -/*! - * @brief Submits the eDMA scatter gather transfer configurations. - * - * The function is target for submit loop transfer request, - * the ring transfer request means that the transfer request TAIL is link to HEAD, such as, - * A->B->C->D->A, or A->A - * - * To use the ring transfer feature, the application should allocate several transfer object, such as - * @code - * edma_channel_transfer_config_t transfer[2]; - * EDMA_TransferSubmitLoopTransfer(psHandle, &transfer, 2U); - * @endcode - * Then eDMA driver will link transfer[0] and transfer[1] to each other - * - * @note Application should check the return value of this function to avoid transfer request - * submit failed - * - * @param handle eDMA handle pointer - * @param transfer pointer to user's eDMA channel configure structure, see edma_channel_transfer_config_t for detail - * @param transferLoopCount the count of the transfer ring, if loop count is 1, that means that the one will link to - * itself. - * - * @retval #kStatus_Success It means submit transfer request succeed - * @retval #kStatus_EDMA_Busy channel is in busy status - * @retval #kStatus_InvalidArgument Invalid Argument - */ -status_t EDMA_SubmitLoopTransfer(edma_handle_t *handle, edma_transfer_config_t *transfer, uint32_t transferLoopCount); - -/*! - * @brief eDMA starts transfer. - * - * This function enables the channel request. Users can call this function after submitting the transfer request - * or before submitting the transfer request. - * - * @param handle eDMA handle pointer. - */ -void EDMA_StartTransfer(edma_handle_t *handle); - -/*! - * @brief eDMA stops transfer. - * - * This function disables the channel request to pause the transfer. Users can call EDMA_StartTransfer() - * again to resume the transfer. - * - * @param handle eDMA handle pointer. - */ -void EDMA_StopTransfer(edma_handle_t *handle); - -/*! - * @brief eDMA aborts transfer. - * - * This function disables the channel request and clear transfer status bits. - * Users can submit another transfer after calling this API. - * - * @param handle DMA handle pointer. - */ -void EDMA_AbortTransfer(edma_handle_t *handle); - -/*! - * @brief Get unused TCD slot number. - * - * This function gets current tcd index which is run. If the TCD pool pointer is NULL, it will return 0. - * - * @param handle DMA handle pointer. - * @return The unused tcd slot number. - */ -static inline uint32_t EDMA_GetUnusedTCDNumber(edma_handle_t *handle) -{ - int8_t tmpTcdSize = handle->tcdSize; - int8_t tmpTcdUsed = handle->tcdUsed; - return ((uint32_t)tmpTcdSize - (uint32_t)tmpTcdUsed); -} - -/*! - * @brief Get the next tcd address. - * - * This function gets the next tcd address. If this is last TCD, return 0. - * - * @param handle DMA handle pointer. - * @return The next TCD address. - */ -static inline uint32_t EDMA_GetNextTCDAddress(edma_handle_t *handle) -{ - return (uint32_t)(EDMA_TCD_DLAST_SGA(handle->tcdBase, EDMA_TCD_TYPE(handle->base))); -} - -/*! - * @brief eDMA IRQ handler for the current major loop transfer completion. - * - * This function clears the channel major interrupt flag and calls - * the callback function if it is not NULL. - * - * Note: - * For the case using TCD queue, when the major iteration count is exhausted, additional operations are performed. - * These include the final address adjustments and reloading of the BITER field into the CITER. - * Assertion of an optional interrupt request also occurs at this time, as does a possible fetch of a new TCD from - * memory using the scatter/gather address pointer included in the descriptor (if scatter/gather is enabled). - * - * For instance, when the time interrupt of TCD[0] happens, the TCD[1] has already been loaded into the eDMA engine. - * As sga and sga_index are calculated based on the DLAST_SGA bitfield lies in the TCD_CSR register, the sga_index - * in this case should be 2 (DLAST_SGA of TCD[1] stores the address of TCD[2]). Thus, the "tcdUsed" updated should be - * (tcdUsed - 2U) which indicates the number of TCDs can be loaded in the memory pool (because TCD[0] and TCD[1] have - * been loaded into the eDMA engine at this point already.). - * - * For the last two continuous ISRs in a scatter/gather process, they both load the last TCD (The last ISR does not - * load a new TCD) from the memory pool to the eDMA engine when major loop completes. - * Therefore, ensure that the header and tcdUsed updated are identical for them. - * tcdUsed are both 0 in this case as no TCD to be loaded. - * - * See the "eDMA basic data flow" in the eDMA Functional description section of the Reference Manual for - * further details. - * - * @param handle eDMA handle pointer. - */ -void EDMA_HandleIRQ(edma_handle_t *handle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @} */ - -#endif /*FSL_EDMA_H_*/ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_edma_core.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_edma_core.h deleted file mode 100644 index 482f4e19883..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_edma_core.h +++ /dev/null @@ -1,357 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_EDMA_CORE_H_ -#define FSL_EDMA_CORE_H_ - -#include "fsl_edma_soc.h" - -/*! - * @addtogroup edma_core - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -#define DMA_CSR_INTMAJOR_MASK (0x2U) -#define DMA_CSR_INTHALF_MASK (0x4U) -#define DMA_CSR_DREQ_MASK (0x8U) -#define DMA_CSR_ESG_MASK (0x10U) -#define DMA_CSR_BWC_MASK (0xC000U) -#define DMA_CSR_BWC(x) (((uint16_t)(((uint16_t)(x)) << (14U))) & (0xC000U)) -#define DMA_CSR_START_MASK (0x1U) -#define DMA_CITER_ELINKNO_CITER_MASK (0x7FFFU) -#define DMA_BITER_ELINKNO_BITER_MASK (0x7FFFU) -#define DMA_CITER_ELINKNO_CITER_SHIFT (0U) -#define DMA_CITER_ELINKYES_CITER_MASK (0x1FFU) -#define DMA_CITER_ELINKYES_CITER_SHIFT (0U) -#define DMA_ATTR_SMOD_MASK (0xF800U) -#define DMA_ATTR_DMOD_MASK (0xF8U) -#define DMA_CITER_ELINKNO_ELINK_MASK (0x8000U) -#define DMA_CSR_MAJORELINK_MASK (0x20U) -#define DMA_BITER_ELINKYES_ELINK_MASK (0x8000U) -#define DMA_CITER_ELINKYES_ELINK_MASK (0x8000U) -#define DMA_CSR_MAJORLINKCH_MASK (0x1F00U) -#define DMA_BITER_ELINKYES_LINKCH_MASK (0x3E00U) -#define DMA_CITER_ELINKYES_LINKCH_MASK (0x3E00U) -#define DMA_NBYTES_MLOFFYES_MLOFF_MASK (0x3FFFFC00U) -#define DMA_NBYTES_MLOFFYES_DMLOE_MASK (0x40000000U) -#define DMA_NBYTES_MLOFFYES_SMLOE_MASK (0x80000000U) -#define DMA_NBYTES_MLOFFNO_NBYTES_MASK (0x3FFFFFFFU) -#define DMA_ATTR_DMOD(x) (((uint16_t)(((uint16_t)(x)) << (3U))) & (0xF8U)) -#define DMA_ATTR_SMOD(x) (((uint16_t)(((uint16_t)(x)) << (11U))) & (0xF800U)) -#define DMA_BITER_ELINKYES_LINKCH(x) (((uint16_t)(((uint16_t)(x)) << (9U))) & (0x3E00U)) -#define DMA_CITER_ELINKYES_LINKCH(x) (((uint16_t)(((uint16_t)(x)) << (9U))) & (0x3E00U)) -#define DMA_NBYTES_MLOFFYES_MLOFF(x) (((uint32_t)(((uint32_t)(x)) << (10U))) & (0x3FFFFC00U)) -#define DMA_NBYTES_MLOFFYES_DMLOE(x) (((uint32_t)(((uint32_t)(x)) << (30U))) & (0x40000000U)) -#define DMA_NBYTES_MLOFFYES_SMLOE(x) (((uint32_t)(((uint32_t)(x)) << (31U))) & (0x80000000U)) -#define DMA_NBYTES_MLOFFNO_NBYTES(x) (((uint32_t)(((uint32_t)(x)) << (0U))) & (0x3FFFFFFFU)) -#define DMA_NBYTES_MLOFFYES_NBYTES(x) (((uint32_t)(((uint32_t)(x)) << (0U))) & (0x3FFU)) -#define DMA_ATTR_DSIZE(x) (((uint16_t)(((uint16_t)(x)) << (0U))) & (0x7U)) -#define DMA_ATTR_SSIZE(x) (((uint16_t)(((uint16_t)(x)) << (8U))) & (0x700U)) -#define DMA_CSR_DREQ(x) (((uint16_t)(((uint16_t)(x)) << (3U))) & (0x8U)) -#define DMA_CSR_MAJORLINKCH(x) (((uint16_t)(((uint16_t)(x)) << (8U))) & (0x1F00U)) -#define DMA_CH_MATTR_WCACHE(x) (((uint16_t)(((uint16_t)(x)) << (4U))) & (0xF0U)) -#define DMA_CH_MATTR_RCACHE(x) (((uint16_t)(((uint16_t)(x)) << (0U))) & (0xFU)) -#define DMA_CH_CSR_SIGNEXT_MASK (0x3F0000U) -#define DMA_CH_CSR_SIGNEXT_SHIFT (16U) -#define DMA_CH_CSR_SWAP_MASK (0xF000U) -#define DMA_CH_CSR_SWAP_SHIFT (12U) -#define DMA_CH_SBR_INSTR_MASK (0x2000U) -#define DMA_CH_SBR_INSTR_SHIFT (13U) -#define DMA_CH_MUX_SOURCE(x) (((uint32_t)(((uint32_t)(x)) << (0U))) & (0xFFU)) - -/*! @brief DMA error flag */ -#if defined(FSL_EDMA_SOC_IP_EDMA) && FSL_EDMA_SOC_IP_EDMA -#define DMA_ERR_DBE_FLAG DMA_ES_DBE_MASK -#define DMA_ERR_SBE_FLAG DMA_ES_SBE_MASK -#define DMA_ERR_SGE_FLAG DMA_ES_SGE_MASK -#define DMA_ERR_NCE_FLAG DMA_ES_NCE_MASK -#define DMA_ERR_DOE_FLAG DMA_ES_DOE_MASK -#define DMA_ERR_DAE_FLAG DMA_ES_DAE_MASK -#define DMA_ERR_SOE_FLAG DMA_ES_SOE_MASK -#define DMA_ERR_SAE_FLAG DMA_ES_SAE_MASK -#define DMA_ERR_ERRCHAN_FLAG DMA_ES_ERRCHN_MASK -#define DMA_ERR_CPE_FLAG DMA_ES_CPE_MASK -#define DMA_ERR_ECX_FLAG DMA_ES_ECX_MASK -#if defined(FSL_FEATURE_EDMA_CHANNEL_GROUP_COUNT) && (FSL_FEATURE_EDMA_CHANNEL_GROUP_COUNT > 1) -#define DMA_ERR_GPE_FLAG DMA_ES_GPE_MASK -#endif -#define DMA_ERR_FLAG DMA_ES_VLD_MASK - -/*! @brief get/clear DONE status*/ -#define DMA_CLEAR_DONE_STATUS(base, channel) (EDMA_BASE(base)->CDNE = (uint8_t)channel) -#define DMA_GET_DONE_STATUS(base, channel) \ - ((EDMA_TCD_BASE(base, channel)->CSR & DMA_CSR_DONE_MASK) >> DMA_CSR_DONE_SHIFT) -/*! @brief enable/disable error interrupt*/ -#define DMA_ENABLE_ERROR_INT(base, channel) (base->EEI |= ((uint32_t)0x1U << channel)) -#define DMA_DISABLE_ERROR_INT(base, channel) (base->EEI &= (~((uint32_t)0x1U << channel))) -/*! @brief get/clear error status*/ -#define DMA_GET_ERROR_STATUS(base, channel) (((uint32_t)EDMA_BASE(base)->ERR >> channel) & 0x1U) -#define DMA_CLEAR_ERROR_STATUS(base, channel) ((uint32_t)EDMA_BASE(base)->CERR = (uint8_t)channel) -/*! @brief get/clear int status*/ -#define DMA_GET_INT_STATUS(base, channel) ((((uint32_t)EDMA_BASE(base)->INT >> channel) & 0x1U)) -#define DMA_CLEAR_INT_STATUS(base, channel) ((uint32_t)EDMA_BASE(base)->CINT = (uint8_t)channel) - -#else - -#define DMA_ERR_DBE_FLAG DMA_MP_ES_DBE_MASK -#define DMA_ERR_SBE_FLAG DMA_MP_ES_SBE_MASK -#define DMA_ERR_SGE_FLAG DMA_MP_ES_SGE_MASK -#define DMA_ERR_NCE_FLAG DMA_MP_ES_NCE_MASK -#define DMA_ERR_DOE_FLAG DMA_MP_ES_DOE_MASK -#define DMA_ERR_DAE_FLAG DMA_MP_ES_DAE_MASK -#define DMA_ERR_SOE_FLAG DMA_MP_ES_SOE_MASK -#define DMA_ERR_SAE_FLAG DMA_MP_ES_SAE_MASK -#define DMA_ERR_ERRCHAN_FLAG DMA_MP_ES_ERRCHN_MASK -#define DMA_ERR_ECX_FLAG DMA_MP_ES_ECX_MASK -#define DMA_ERR_FLAG DMA_MP_ES_VLD_MASK - -/*! @brief get/clear DONE bit*/ -#define DMA_CLEAR_DONE_STATUS(base, channel) (EDMA_CHANNEL_BASE(base, channel)->CH_CSR |= DMA_CH_CSR_DONE_MASK) -#define DMA_GET_DONE_STATUS(base, channel) \ - ((EDMA_CHANNEL_BASE(base, channel)->CH_CSR & DMA_CH_CSR_DONE_MASK) >> DMA_CH_CSR_DONE_SHIFT) -/*! @brief enable/disable error interupt*/ -#define DMA_ENABLE_ERROR_INT(base, channel) (EDMA_CHANNEL_BASE(base, channel)->CH_CSR |= DMA_CH_CSR_EEI_MASK) -#define DMA_DISABLE_ERROR_INT(base, channel) (EDMA_CHANNEL_BASE(base, channel)->CH_CSR &= ~DMA_CH_CSR_EEI_MASK) -/*! @brief get/clear error status*/ -#define DMA_CLEAR_ERROR_STATUS(base, channel) (EDMA_CHANNEL_BASE(base, channel)->CH_ES |= DMA_CH_ES_ERR_MASK) -#define DMA_GET_ERROR_STATUS(base, channel) \ - (((uint32_t)EDMA_CHANNEL_BASE(base, channel)->CH_ES >> DMA_CH_ES_ERR_SHIFT) & 0x1U) -/*! @brief get/clear INT status*/ -#define DMA_CLEAR_INT_STATUS(base, channel) (EDMA_CHANNEL_BASE(base, channel)->CH_INT = DMA_CH_INT_INT_MASK) -#define DMA_GET_INT_STATUS(base, channel) ((((uint32_t)EDMA_CHANNEL_BASE(base, channel)->CH_INT) & 0x1U)) -#endif /*FSL_EDMA_SOC_IP_EDMA*/ - -/*! @brief enable/dsiable MAJOR/HALF INT*/ -#define DMA_ENABLE_MAJOR_INT(base, channel) \ - (EDMA_TCD_CSR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) |= DMA_CSR_INTMAJOR_MASK) -#define DMA_ENABLE_HALF_INT(base, channel) \ - (EDMA_TCD_CSR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) |= DMA_CSR_INTHALF_MASK) -#define DMA_DISABLE_MAJOR_INT(base, channel) \ - (EDMA_TCD_CSR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_CSR_INTMAJOR_MASK) -#define DMA_DISABLE_HALF_INT(base, channel) \ - (EDMA_TCD_CSR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_CSR_INTHALF_MASK) - -/*!@brief EDMA tcd align size */ -#define EDMA_TCD_ALIGN_SIZE (32U) - -/*!@brief edma core channel struture definition */ -typedef struct _edma_core_mp -{ - __IO uint32_t MP_CSR; /**< Channel Control and Status, array offset: 0x10000, array step: 0x10000 */ - __IO uint32_t MP_ES; /**< Channel Error Status, array offset: 0x10004, array step: 0x10000 */ - union - { - struct - { - __IO uint32_t MP_INT_LOW; /**< Channel Control and Status, array offset: 0x10008, array step: 0x10000 */ - __I uint32_t MP_INT_HIGH; /**< Channel Control and Status, array offset: 0x1000C, array step: 0x10000 */ - __I uint32_t MP_HRS_LOW; /**< Channel Control and Status, array offset: 0x10010, array step: 0x10000 */ - __I uint32_t MP_HRS_HIGH; /**< Channel Control and Status, array offset: 0x10014, array step: 0x10000 */ - uint8_t RESERVED_0[8]; - __IO uint32_t MP_STOPCH; /**< Channel Control and Status, array offset: 0x10020, array step: 0x10000 */ - uint8_t RESERVED_1[12]; - __I uint32_t MP_SSR_LOW; /**< Channel Control and Status, array offset: 0x10030, array step: 0x10000 */ - __I uint32_t MP_SSR_HIGH; /**< Channel Control and Status, array offset: 0x10034, array step: 0x10000 */ - uint8_t RESERVED_2[200]; - __IO uint32_t CH_GRPRI[64]; /**< Channel Control and Status, array offset: 0x10100, array step: 0x10000 */ - __IO uint32_t CH_MUX[64]; /**< Channel Control and Status, array offset: 0x10200, array step: 0x10000 */ - uint8_t RESERVED_3[256]; - __IO uint32_t CH_PROT[64]; /**< Channel Control and Status, array offset: 0x10400, array step: 0x10000 */ - } EDMA5_REG; - } MP_REGS; -} edma_core_mp_t; - -/*!@brief edma core channel struture definition */ -typedef struct _edma_core_channel -{ - __IO uint32_t CH_CSR; /**< Channel Control and Status, array offset: 0x10000, array step: 0x10000 */ - __IO uint32_t CH_ES; /**< Channel Error Status, array offset: 0x10004, array step: 0x10000 */ - __IO uint32_t CH_INT; /**< Channel Interrupt Status, array offset: 0x10008, array step: 0x10000 */ - __IO uint32_t CH_SBR; /**< Channel System Bus, array offset: 0x1000C, array step: 0x10000 */ - __IO uint32_t CH_PRI; /**< Channel Priority, array offset: 0x10010, array step: 0x10000 */ - union - { - struct - { - __IO uint8_t RESERVED_1[4]; - __IO uint32_t CH_MATTR; /**< Memory Attributes Register, array offset: 0x10018, array step: 0x8000 */ - } EDMA5_REG; - struct - { - __IO uint32_t CH_MUX; /**< Channel Multiplexor Configuration, array offset: 0x10014, array step: 0x10000 */ - __IO uint16_t CH_MATTR; /**< Memory Attributes Register, array offset: 0x10018, array step: 0x8000 */ - } EDMA4_REG; - } CH_REGS; -} edma_core_channel_t; - -/*! @brief eDMA tcd flag type */ -typedef enum _edma_tcd_type -{ - kEDMA_EDMA4Flag = 0x0U, /*!< Data access for eDMA4 transfers. */ - kEDMA_EDMA5Flag = 0x1U, /*!< Instruction access for eDMA4 transfers. */ -} edma_tcd_type_t; - -/*!@brief edma5 core TCD struture definition */ -typedef struct _edma5_core_tcd -{ - __IO uint32_t SADDR; /*!< SADDR register, used to save source address */ - __IO uint32_t SADDR_HIGH; /*!< SADDR HIGH register, used to save source address */ - __IO uint16_t SOFF; /*!< SOFF register, save offset bytes every transfer */ - __IO uint16_t ATTR; /*!< ATTR register, source/destination transfer size and modulo */ - __IO uint32_t NBYTES; /*!< Nbytes register, minor loop length in bytes */ - __IO uint32_t SLAST; /*!< SLAST register */ - __IO uint32_t SLAST_SDA_HIGH; /*!< SLAST SDA HIGH register */ - __IO uint32_t DADDR; /*!< DADDR register, used for destination address */ - __IO uint32_t DADDR_HIGH; /*!< DADDR HIGH register, used for destination address */ - __IO uint32_t DLAST_SGA; /*!< DLASTSGA register, next tcd address used in scatter-gather mode */ - __IO uint32_t DLAST_SGA_HIGH; /*!< DLASTSGA HIGH register, next tcd address used in scatter-gather mode */ - __IO uint16_t DOFF; /*!< DOFF register, used for destination offset */ - __IO uint16_t CITER; /*!< CITER register, current minor loop numbers, for unfinished minor loop.*/ - __IO uint16_t CSR; /*!< CSR register, for TCD control status */ - __IO uint16_t BITER; /*!< BITER register, begin minor loop count. */ - uint8_t RESERVED[16]; /*!< Aligned 64 bytes */ -} edma5_core_tcd_t; - -/*!@brief edma4 core TCD struture definition */ -typedef struct _edma4_core_tcd -{ - __IO uint32_t SADDR; /*!< SADDR register, used to save source address */ - __IO uint16_t SOFF; /*!< SOFF register, save offset bytes every transfer */ - __IO uint16_t ATTR; /*!< ATTR register, source/destination transfer size and modulo */ - __IO uint32_t NBYTES; /*!< Nbytes register, minor loop length in bytes */ - __IO uint32_t SLAST; /*!< SLAST register */ - __IO uint32_t DADDR; /*!< DADDR register, used for destination address */ - __IO uint16_t DOFF; /*!< DOFF register, used for destination offset */ - __IO uint16_t CITER; /*!< CITER register, current minor loop numbers, for unfinished minor loop.*/ - __IO uint32_t DLAST_SGA; /*!< DLASTSGA register, next tcd address used in scatter-gather mode */ - __IO uint16_t CSR; /*!< CSR register, for TCD control status */ - __IO uint16_t BITER; /*!< BITER register, begin minor loop count. */ -} edma4_core_tcd_t; - -/*!@brief edma core TCD struture definition */ -typedef struct _edma_core_tcd -{ - union - { - edma4_core_tcd_t edma4_tcd; -#if defined FSL_EDMA_SOC_IP_DMA5 && FSL_EDMA_SOC_IP_DMA5 - edma5_core_tcd_t edma5_tcd; -#endif /* FSL_EDMA_SOC_IP_DMA5 */ - } TCD_REGS; -} edma_core_tcd_t; - -/*!@brief EDMA typedef */ -typedef edma_core_channel_t EDMA_ChannelType; -typedef edma_core_tcd_t EDMA_TCDType; -typedef void EDMA_Type; - -/*!@brief EDMA base address convert macro */ -#define EDMA_BASE(base) -#define EDMA_CHANNEL_BASE(base, channel) \ - ((edma_core_channel_t *)((uint32_t)(uint32_t *)(base) + EDMA_CHANNEL_OFFSET + \ - (channel)*EDMA_CHANNEL_ARRAY_STEP(base))) -#define EDMA_TCD_BASE(base, channel) \ - ((edma_core_tcd_t *)((uint32_t)(uint32_t *)(base) + EDMA_CHANNEL_OFFSET + \ - (channel)*EDMA_CHANNEL_ARRAY_STEP(base) + 0x20U)) -#define EDMA_MP_BASE(base) ((edma_core_mp_t *)((uint32_t)(uint32_t *)(base))) - -/*!@brief EDMA TCD type macro */ -#if defined FSL_FEATURE_EDMA_TCD_TYPEn -#define EDMA_TCD_TYPE(x) FSL_FEATURE_EDMA_TCD_TYPEn(x) -#else -#define EDMA_TCD_TYPE(x) (0) -#endif - -#if defined FSL_EDMA_SOC_IP_DMA5 && FSL_EDMA_SOC_IP_DMA5 -/*!@brief EDMA TCD address convert macro */ -#define EDMA_TCD_SADDR(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->SADDR)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->SADDR)))) - -#define EDMA_TCD_SOFF(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->SOFF)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->SOFF)))) - -#define EDMA_TCD_ATTR(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->ATTR)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->ATTR)))) - -#define EDMA_TCD_NBYTES(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->NBYTES)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->NBYTES)))) - -#define EDMA_TCD_SLAST(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->SLAST)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->SLAST)))) - -#define EDMA_TCD_DADDR(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->DADDR)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->DADDR)))) - -#define EDMA_TCD_DOFF(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->DOFF)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->DOFF)))) - -#define EDMA_TCD_CITER(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->CITER)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->CITER)))) - -#define EDMA_TCD_DLAST_SGA(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? \ - (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->DLAST_SGA)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->DLAST_SGA)))) - -#define EDMA_TCD_CSR(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->CSR)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->CSR)))) - -#define EDMA_TCD_BITER(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->BITER)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->BITER)))) -#else -/*!@brief EDMA TCD address convert macro */ -#define EDMA_TCD_SADDR(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->SADDR) - -#define EDMA_TCD_SOFF(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->SOFF) - -#define EDMA_TCD_ATTR(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->ATTR) - -#define EDMA_TCD_NBYTES(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->NBYTES) - -#define EDMA_TCD_SLAST(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->SLAST) - -#define EDMA_TCD_DADDR(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->DADDR) - -#define EDMA_TCD_DOFF(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->DOFF) - -#define EDMA_TCD_CITER(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->CITER) - -#define EDMA_TCD_DLAST_SGA(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->DLAST_SGA) - -#define EDMA_TCD_CSR(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->CSR) - -#define EDMA_TCD_BITER(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->BITER) -#endif /* FSL_EDMA_SOC_IP_DMA5 */ -/******************************************************************************* - * API - ******************************************************************************/ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif - -/*! - * @} - */ - -#endif /* FSL_EDMA_CORE_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_edma_soc.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_edma_soc.c deleted file mode 100644 index fb771616684..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_edma_soc.c +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_edma_soc.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.edma_soc" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -extern void DMA_CH0_DriverIRQHandler(void); -extern void DMA_CH1_DriverIRQHandler(void); -extern void DMA_CH2_DriverIRQHandler(void); -extern void DMA_CH3_DriverIRQHandler(void); -extern void EDMA_DriverIRQHandler(uint32_t instance, uint32_t channel); -/******************************************************************************* - * Code - ******************************************************************************/ -/*! - * brief DMA instance 0, channel 0 IRQ handler. - * - */ -void DMA_CH0_DriverIRQHandler(void) -{ - /* Instance 0 channel 0 */ - EDMA_DriverIRQHandler(0U, 0U); -} - -/*! - * brief DMA instance 0, channel 1 IRQ handler. - * - */ -void DMA_CH1_DriverIRQHandler(void) -{ - /* Instance 0 channel 1 */ - EDMA_DriverIRQHandler(0U, 1U); -} - -/*! - * brief DMA instance 0, channel 2 IRQ handler. - * - */ -void DMA_CH2_DriverIRQHandler(void) -{ - /* Instance 0 channel 2 */ - EDMA_DriverIRQHandler(0U, 2U); -} - -/*! - * brief DMA instance 0, channel 3 IRQ handler. - * - */ -void DMA_CH3_DriverIRQHandler(void) -{ - /* Instance 0 channel 3 */ - EDMA_DriverIRQHandler(0U, 3U); -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_edma_soc.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_edma_soc.h deleted file mode 100644 index acaaa24fd4e..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_edma_soc.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef _FSL_EDMA_SOC_H_ -#define _FSL_EDMA_SOC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup edma_soc - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/*! @name Driver version */ -/*@{*/ -/*! @brief Driver version 2.0.0. */ -#define FSL_EDMA_SOC_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) -/*@}*/ - -/*!@brief DMA IP version */ -#define FSL_EDMA_SOC_IP_DMA3 (1) -#define FSL_EDMA_SOC_IP_DMA4 (0) - -/*!@brief DMA base table */ -#define EDMA_BASE_PTRS \ - { \ - DMA0 \ - } - -#define EDMA_CHN_IRQS \ - { \ - { \ - DMA_CH0_IRQn, DMA_CH1_IRQn, DMA_CH2_IRQn, DMA_CH3_IRQn \ - } \ - } - -/*!@brief EDMA base address convert macro */ -#define EDMA_CHANNEL_OFFSET 0x1000U -#define EDMA_CHANNEL_ARRAY_STEP(base) (0x1000U) - -/******************************************************************************* - * API - ******************************************************************************/ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif - -/*! - * @} - */ - -#endif /* _FSL_EDMA_SOC_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_eim.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_eim.c deleted file mode 100644 index bae11683f40..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_eim.c +++ /dev/null @@ -1,312 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_eim.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.eim" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to EIM bases for each instance. */ -static EIM_Type *const s_eimBases[] = EIM_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to EIM clocks for each instance. */ -static const clock_ip_name_t s_eimClocks[] = EIM_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t EIM_GetInstance(EIM_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_eimBases); instance++) - { - if (s_eimBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_eimBases)); - - return instance; -} - -/*! - * brief EIM module initialization function. - * - * param base EIM base address. - */ -void EIM_Init(EIM_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate EIM clock. */ - CLOCK_EnableClock(s_eimClocks[EIM_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - base->EIMCR = 0x00U; - base->EICHEN = 0x00U; -} - -/*! - * brief Deinitializes the EIM. - * - */ -void EIM_Deinit(EIM_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate EIM clock. */ - CLOCK_DisableClock(s_eimClocks[EIM_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -void EIM_InjectCheckBitError(EIM_Type *base, eim_memory_channel_t channel, uint8_t mask) -{ - switch ((uint8_t)channel) - { - case 0U: - base->EICHD0_WORD0 = EIM_EICHD0_WORD0_CHKBIT_MASK(mask); - break; -#ifdef EIM_EICHEN_EICH1EN_MASK - case 1U: - base->EICHD1_WORD0 = EIM_EICHD1_WORD0_CHKBIT_MASK(mask); - break; -#endif - -#ifdef EIM_EICHEN_EICH2EN_MASK - case 2U: - base->EICHD2_WORD0 = EIM_EICHD2_WORD0_CHKBIT_MASK(mask); - break; -#endif -#ifdef EIM_EICHEN_EICH3EN_MASK - case 3U: - base->EICHD3_WORD0 = EIM_EICHD3_WORD0_CHKBIT_MASK(mask); - break; -#endif -#ifdef EIM_EICHEN_EICH4EN_MASK - case 4U: - base->EICHD4_WORD0 = EIM_EICHD4_WORD0_CHKBIT_MASK(mask); - break; -#endif -#ifdef EIM_EICHEN_EICH5EN_MASK - case 5U: - base->EICHD5_WORD0 = EIM_EICHD5_WORD0_CHKBIT_MASK(mask); - break; -#endif -#ifdef EIM_EICHEN_EICH6EN_MASK - case 6U: - base->EICHD6_WORD0 = EIM_EICHD6_WORD0_CHKBIT_MASK(mask); - break; -#endif -#ifdef EIM_EICHEN_EICH7EN_MASK - case 7U: - base->EICHD7_WORD0 = EIM_EICHD7_WORD0_CHKBIT_MASK(mask); - break; -#endif -#ifdef EIM_EICHEN_EICH8EN_MASK - case 8U: - base->EICHD8_WORD0 = EIM_EICHD8_WORD0_CHKBIT_MASK(mask); - break; -#endif - default: - assert(NULL); - break; - } -} - -uint8_t EIM_GetCheckBitMask(EIM_Type *base, eim_memory_channel_t channel) -{ - uint8_t mask = 0x00U; - - switch ((uint8_t)channel) - { - case 0U: - mask = (uint8_t)((base->EICHD0_WORD0 & EIM_EICHD0_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD0_WORD0_CHKBIT_MASK_SHIFT); - break; -#ifdef EIM_EICHEN_EICH1EN_MASK - case 1U: - mask = (uint8_t)((base->EICHD1_WORD0 & EIM_EICHD1_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD1_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif -#ifdef EIM_EICHEN_EICH2EN_MASK - case 2U: - mask = (uint8_t)((base->EICHD2_WORD0 & EIM_EICHD2_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD2_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif -#ifdef EIM_EICHEN_EICH3EN_MASK - case 3U: - mask = (uint8_t)((base->EICHD3_WORD0 & EIM_EICHD3_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD3_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif -#ifdef EIM_EICHEN_EICH4EN_MASK - case 4U: - mask = (uint8_t)((base->EICHD4_WORD0 & EIM_EICHD4_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD4_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif -#ifdef EIM_EICHEN_EICH5EN_MASK - case 5U: - mask = (uint8_t)((base->EICHD5_WORD0 & EIM_EICHD5_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD5_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif -#ifdef EIM_EICHEN_EICH6EN_MASK - case 6U: - mask = (uint8_t)((base->EICHD6_WORD0 & EIM_EICHD6_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD6_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif -#ifdef EIM_EICHEN_EICH7EN_MASK - case 7U: - mask = (uint8_t)((base->EICHD7_WORD0 & EIM_EICHD7_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD7_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif -#ifdef EIM_EICHEN_EICH8EN_MASK - case 8U: - mask = (uint8_t)((base->EICHD8_WORD0 & EIM_EICHD8_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD8_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif - default: - assert(NULL); - break; - } - - return mask; -} - -void EIM_InjectDataBitError(EIM_Type *base, eim_memory_channel_t channel, uint8_t mask) -{ - switch ((uint8_t)channel) - { - case 0U: - base->EICHD0_WORD1 = mask; - break; -#ifdef EIM_EICHEN_EICH1EN_MASK - case 1U: - base->EICHD1_WORD1 = mask; - break; -#endif -#ifdef EIM_EICHEN_EICH2EN_MASK - case 2U: - base->EICHD2_WORD1 = mask; - break; -#endif -#ifdef EIM_EICHEN_EICH3EN_MASK - case kEIM_MemoryChannelRAMC: - base->EICHD3_WORD1 = mask; - break; -#endif -#ifdef EIM_EICHEN_EICH4EN_MASK - case kEIM_MemoryChannelRAMD: - base->EICHD4_WORD1 = mask; - break; -#endif -#ifdef EIM_EICHEN_EICH5EN_MASK - case kEIM_MemoryChannelRAME: - base->EICHD5_WORD1 = mask; - break; -#endif -#ifdef EIM_EICHEN_EICH6EN_MASK - case kEIM_MemoryChannelRAMF: - base->EICHD6_WORD1 = mask; - break; -#endif -#ifdef EIM_EICHEN_EICH7EN_MASK - case kEIM_MemoryChannelLPCACRAM: - base->EICHD7_WORD1 = mask; - break; -#endif -#ifdef EIM_EICHEN_EICH8EN_MASK - case kEIM_MemoryChannelPKCRAM: - base->EICHD8_WORD1 = mask; - break; -#endif - default: - assert(NULL); - break; - } -} - -uint32_t EIM_GetDataBitMask(EIM_Type *base, eim_memory_channel_t channel) -{ - uint32_t mask = 0x00U; - - switch ((uint8_t)channel) - { - case 0U: - mask = (base->EICHD0_WORD0 & EIM_EICHD0_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD0_WORD1_B0_3DATA_MASK_SHIFT; - break; - -#ifdef EIM_EICHEN_EICH1EN_MASK - case 1U: - mask = (base->EICHD1_WORD0 & EIM_EICHD1_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD1_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif -#ifdef EIM_EICHEN_EICH2EN_MASK - case 2U: - mask = (base->EICHD2_WORD0 & EIM_EICHD2_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD2_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif -#ifdef EIM_EICHEN_EICH3EN_MASK - case 3U: - mask = (base->EICHD3_WORD0 & EIM_EICHD3_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD3_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif -#ifdef EIM_EICHEN_EICH4EN_MASK - case 4U: - mask = (base->EICHD4_WORD0 & EIM_EICHD4_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD4_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif -#ifdef EIM_EICHEN_EICH5EN_MASK - case 5U: - mask = (base->EICHD5_WORD0 & EIM_EICHD5_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD5_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif -#ifdef EIM_EICHEN_EICH6EN_MASK - case 6U: - mask = (base->EICHD6_WORD0 & EIM_EICHD6_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD6_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif -#ifdef EIM_EICHEN_EICH7EN_MASK - case 7U: - mask = (base->EICHD7_WORD0 & EIM_EICHD7_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD7_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif -#ifdef EIM_EICHEN_EICH8EN_MASK - case 8U: - mask = (base->EICHD8_WORD1 & EIM_EICHD8_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD8_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif - default: - assert(NULL); - break; - } - - return mask; -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_eim.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_eim.h deleted file mode 100644 index 799ff3f20a5..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_eim.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_EIM_H_ -#define FSL_EIM_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup eim - * @{ - */ - -/****************************************************************************** - * Definitions. - *****************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief Driver version. */ -#define FSL_ERM_DRIVER_VERSION (MAKE_VERSION(2U, 0U, 1U)) -/*! @} */ - -/******************************************************************************* - * APIs - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @brief EIM module initialization function. - * - * @param base EIM base address. - */ -void EIM_Init(EIM_Type *base); - -/*! - * @brief De-initializes the EIM. - * - */ -void EIM_Deinit(EIM_Type *base); - -/*! @} */ - -/*! - * @name functional - * @{ - */ - -/*! - * @brief EIM module enable global error injection. - * - * @param base EIM base address. - * @param mask The interrupts to enable. - */ -static inline void EIM_EnableGlobalErrorInjection(EIM_Type *base, bool enable) -{ - if (enable) - { - base->EIMCR = EIM_EIMCR_GEIEN_MASK; - } - else - { - base->EIMCR = ~EIM_EIMCR_GEIEN_MASK; - } -} - -/*! - * @brief EIM module enable error injection for memory channel n, this function enables the corresponding error - * injection channel. The Global Error Injection Enable function must also be called to enable error injection. - * - * @param base EIM base address. - * @param mask The interrupts to enable. Refer to "_eim_error_injection_channel_enable" enumeration. - */ -static inline void EIM_EnableErrorInjectionChannels(EIM_Type *base, uint32_t mask) -{ - base->EICHEN |= mask; -} - -/*! - * @brief EIM module disable error injection for memory channel n. - * - * @param base EIM base address. - * @param mask The interrupts to enable. Refer to "_eim_error_injection_channel_enable" enumeration. - */ -static inline void EIM_DisableErrorInjectionChannels(EIM_Type *base, uint32_t mask) -{ - base->EICHEN &= ~mask; -} - -/*! - * @brief EIM module inject checkbit error for memory channel n, an attempt to invert more than 2 bits in one operation - * might result in undefined behavior. - * - * @param base EIM base address. - * @param channel memory channel. - * @param mask The interrupts to enable. - */ -void EIM_InjectCheckBitError(EIM_Type *base, eim_memory_channel_t channel, uint8_t mask); - -/*! - * @brief EIM module get checkbit mask for memory channel n. - * - * @param base EIM base address. - * @param channel memory channel. - * @retval return checkbit mask. - */ -uint8_t EIM_GetCheckBitMask(EIM_Type *base, eim_memory_channel_t channel); - -/*! - * @brief EIM module inject databit error for memory channel n, an attempt to invert more than 2 bits in one operation - * might result in undefined behavior. - * - * @param base EIM base address. - * @param channel memory channel. - * @param mask The interrupts to enable. - */ -void EIM_InjectDataBitError(EIM_Type *base, eim_memory_channel_t channel, uint8_t mask); - -/*! - * @brief EIM module get databit mask for memory channel n. - * - * @param base EIM base address. - * @param channel memory channel. - * @retval return checkbit mask. - */ -uint32_t EIM_GetDataBitMask(EIM_Type *base, eim_memory_channel_t channel); - -/*! @}*/ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_eqdc.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_eqdc.c deleted file mode 100644 index 00f5fd8859b..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_eqdc.c +++ /dev/null @@ -1,301 +0,0 @@ -/* - * Copyright 2022, 2023 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_eqdc.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.eqdc" -#endif - -#if defined(EQDC_RSTS) -#define EQDC_RESETS_ARRAY EQDC_RSTS -#endif -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Get instance number for EQDC module. - * - * @param base EQDC peripheral base address - */ -static uint32_t EQDC_GetInstance(EQDC_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to EQDC bases for each instance. */ -static EQDC_Type *const s_eqdcBases[] = EQDC_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to EQDC clocks for each instance. */ -#if defined(QDC_CLOCKS) -static const clock_ip_name_t s_eqdcClocks[] = QDC_CLOCKS; -#elif defined(ENC_CLOCKS) -static const clock_ip_name_t s_eqdcClocks[] = ENC_CLOCKS; -#endif -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(EQDC_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_eqdcResets[] = EQDC_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t EQDC_GetInstance(EQDC_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_eqdcBases); instance++) - { - if (s_eqdcBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_eqdcBases)); - - return instance; -} - -/* - * Initializes the EQDC module. - * - * This function initializes the EQDC by enabling the IP bus clock (optional). - * - * param base EQDC peripheral base address. - * param psConfig Pointer to configuration structure. - */ -void EQDC_Init(EQDC_Type *base, const eqdc_config_t *psConfig) -{ - assert(NULL != psConfig); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock. */ - CLOCK_EnableClock(s_eqdcClocks[EQDC_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(EQDC_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_eqdcResets[EQDC_GetInstance(base)]); -#endif - - /* Initialize Double-set registers */ - EQDC_ClearBufferedRegisterLoadUpdateMode(base); - EQDC_ClearEqdcLdok(base); - - /* Counter value. */ - EQDC_SetPositionCounterValue(base, psConfig->positionCounterValue); - - /* Initial value. */ - EQDC_SetInitialPositionValue(base, psConfig->positionInitialValue); - - /* Modulus value. */ - EQDC_SetPositionModulusValue(base, psConfig->positionModulusValue); - - /* Compare value. */ - EQDC_SetPositionCompare0Value(base, psConfig->positionCompareValue[0]); - EQDC_SetPositionCompare1Value(base, psConfig->positionCompareValue[1]); - EQDC_SetPositionCompare2Value(base, psConfig->positionCompareValue[2]); - EQDC_SetPositionCompare3Value(base, psConfig->positionCompareValue[3]); - - EQDC_SetEqdcLdok(base); - while (EQDC_GetEqdcLdok(base) != 0U) - { - } - - /* Watchdog. */ - EQDC_SetWatchdogTimeout(base, psConfig->watchdogTimeoutValue); - - /* Clear EQDC_REV */ - base->REV = 0U; - - /* EQDC_IMR. */ - base->IMR = EQDC_IMR_FPHA(psConfig->filterPhaseA) | EQDC_IMR_FPHB(psConfig->filterPhaseB) | - EQDC_IMR_FIND_PRE(psConfig->filterIndPre) | EQDC_IMR_FHOM_ENA(psConfig->filterHomEna); - - /* EQDC_FILT. */ - base->FILT = EQDC_FILT_PRSC(psConfig->prescaler) | /* Prescaler used by LASTEDGE and POSDPER. */ - EQDC_FILT_FILT_CS(psConfig->filterClockSourceselection) | - EQDC_FILT_FILT_CNT(psConfig->filterSampleCount) | EQDC_FILT_FILT_PER(psConfig->filterSamplePeriod); - - /* EQDC_CTRL. */ - base->CTRL = EQDC_CTRL_W1C_FLAGS | /* W1C flags. */ - (uint16_t)psConfig->homeEnableInitPosCounterMode | /* HOME Enable trigger. */ - (uint16_t)psConfig->indexPresetInitPosCounterMode | /* INDEX Preset trigger. */ - EQDC_CTRL_REV(psConfig->enableReverseDirection) | /* Reverse direction. */ - EQDC_CTRL_WDE(psConfig->enableWatchdog) | /* Enable watchdog. */ - EQDC_CTRL_DMAEN(psConfig->enableDma); /* Enable Dma. */ - - /* Set mode of count. */ - EQDC_SetCountMode(base, psConfig->countMode); /* eqdcoder count mode. */ - - /* EQDC_CTRL2. */ - base->CTRL2 = - EQDC_CTRL2_ONCE(psConfig->countOnce) | - EQDC_CTRL2_INITPOS(psConfig->enableTriggerInitPositionCounter) | /* TRIGGER initializes position counter. */ -#if (defined(FSL_FEATURE_EQDC_CTRL2_HAS_EMIP_BIT_FIELD) && FSL_FEATURE_EQDC_CTRL2_HAS_EMIP_BIT_FIELD) - EQDC_CTRL2_EMIP(psConfig->enableIndexInitPositionCounter)| /* Index Event Edge Mark initializes position counter */ -#endif /* FSL_FEATURE_EQDC_CTRL2_HAS_EMIP_BIT_FIELD */ - EQDC_CTRL2_PMEN(psConfig->enablePeriodMeasurement) | /* Enable period measurement. */ - EQDC_CTRL2_OUTCTL(psConfig->outputPulseMode) | /* Output pulse. */ - EQDC_CTRL2_REVMOD(psConfig->revolutionCountCondition) | /* Revolution count condition. */ - EQDC_CTRL2_LDMOD(psConfig->bufferedRegisterLoadMode) | /* Buffered register load (Update) mode select. */ - EQDC_CTRL2_UPDPOS(psConfig->enableTriggerClearPositionRegisters) | /* TRIGGER clears position register. */ - EQDC_CTRL2_UPDHLD(psConfig->enableTriggerHoldPositionRegisters); /* TRIGGER loads position registers. */ - - /* Set mode of operation. */ - EQDC_SetOperateMode(base, psConfig->operateMode); /* eqdcoder work mode. */ - - /* Enable interrupts. */ - EQDC_EnableInterrupts(base, psConfig->enabledInterruptsMask); -} - -/* - * De-initializes the EQDC module. - * - * This function deinitializes the EQDC by: - * 1. Disables the IP bus clock (optional). - * - * param base EQDC peripheral base address. - */ -void EQDC_Deinit(EQDC_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable the clock. */ - CLOCK_DisableClock(s_eqdcClocks[EQDC_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * Gets an available pre-defined configuration. - * - * The default value are: - * psConfig->enableReverseDirection = false; - * psConfig->countOnce = false; - * psConfig->operateMode = kEQDC_QuadratureDecodeOperationMode; - * psConfig->countMode = kEQDC_QuadratureX4; - * psConfig->homeEnableInitPosCounterMode = kEQDC_HomeInitPosCounterDisabled; - * psConfig->indexPresetInitPosCounterMode = kEQDC_IndexInitPosCounterDisabled; - * psConfig->enableIndexInitPositionCounter = false; - * psConfig->enableDma = false; - * psConfig->bufferedRegisterLoadMode = false; - * psConfig->enableTriggerInitPositionCounter = false; - * psConfig->enableTriggerClearPositionRegisters = false; - * psConfig->enableTriggerHoldPositionRegisters = false; - * psConfig->enableWatchdog = false; - * psConfig->watchdogTimeoutValue = 0xFFFFU; - * psConfig->filterPhaseA = 0U; - * psConfig->filterPhaseB = 0U; - * psConfig->filterIndPre = 0U; - * psConfig->filterHomEna = 0U; - * psConfig->filterClockSourceselection = false; - * psConfig->filterSampleCount = kEQDC_Filter3Samples; - * psConfig->filterSamplePeriod = 0U; - * psConfig->outputPulseMode = kEQDC_OutputPulseOnCounterEqualCompare; - * psConfig->positionCompareValue[0] = 0xFFFFFFFFU; - * psConfig->positionCompareValue[1] = 0xFFFFFFFFU; - * psConfig->positionCompareValue[2] = 0xFFFFFFFFU; - * psConfig->positionCompareValue[3] = 0xFFFFFFFFU; - * psConfig->revolutionCountCondition = kEQDC_RevolutionCountOnIndexPulse; - * psConfig->positionModulusValue = 0U; - * psConfig->positionInitialValue = 0U; - * psConfig->positionCounterValue = 0U; - * psConfig->enablePeriodMeasurement = false; - * psConfig->prescaler = kEQDC_Prescaler1; - * psConfig->enabledInterruptsMask = 0U; - * - * param psConfig Pointer to configuration structure. - */ -void EQDC_GetDefaultConfig(eqdc_config_t *psConfig) -{ - assert(NULL != psConfig); - - psConfig->enableReverseDirection = false; - psConfig->countOnce = false; - psConfig->operateMode = kEQDC_QuadratureDecodeOperationMode; /*!< Decode Mode. */ - psConfig->countMode = kEQDC_QuadratureX4; - psConfig->homeEnableInitPosCounterMode = kEQDC_HomeInitPosCounterDisabled; - psConfig->indexPresetInitPosCounterMode = kEQDC_IndexInitPosCounterDisabled; -#if (defined(FSL_FEATURE_EQDC_CTRL2_HAS_EMIP_BIT_FIELD) && FSL_FEATURE_EQDC_CTRL2_HAS_EMIP_BIT_FIELD) - psConfig->enableIndexInitPositionCounter = false; -#endif /* FSL_FEATURE_EQDC_CTRL2_HAS_EMIP_BIT_FIELD */ - psConfig->enableDma = false; - psConfig->bufferedRegisterLoadMode = false; - psConfig->enableTriggerInitPositionCounter = false; - psConfig->enableTriggerClearPositionRegisters = false; - psConfig->enableTriggerHoldPositionRegisters = false; - psConfig->enableWatchdog = false; - psConfig->watchdogTimeoutValue = 0xFFFFU; - psConfig->filterPhaseA = 0U; - psConfig->filterPhaseB = 0U; - psConfig->filterIndPre = 0U; - psConfig->filterHomEna = 0U; - psConfig->filterClockSourceselection = false; - psConfig->filterSampleCount = kEQDC_Filter3Samples; - psConfig->filterSamplePeriod = 0U; - psConfig->outputPulseMode = kEQDC_OutputPulseOnCounterEqualCompare; - psConfig->positionCompareValue[0] = 0xFFFFFFFFU; - psConfig->positionCompareValue[1] = 0xFFFFFFFFU; - psConfig->positionCompareValue[2] = 0xFFFFFFFFU; - psConfig->positionCompareValue[3] = 0xFFFFFFFFU; - psConfig->revolutionCountCondition = kEQDC_RevolutionCountOnIndexPulse; - psConfig->positionModulusValue = 0U; - psConfig->positionInitialValue = 0U; - psConfig->positionCounterValue = 0U; - psConfig->enablePeriodMeasurement = false; - psConfig->prescaler = kEQDC_Prescaler1; - psConfig->enabledInterruptsMask = 0U; -} - -/* - * Initializes the mode of operation. - * - * The Quadrature Decoder operates in following 4 operation modes: - * 1.Quadrature Decode(QDC) Operation Mode (CTRL[PH1] = 0,CTRL2[OPMODE] = 0) - * 2.Quadrature Count(QCT) Operation Mode (CTRL[PH1] = 0,CTRL2[OPMODE] = 1) - * 3.Single Phase Decode(PH1DC) Operation Mode (CTRL[PH1] = 1,CTRL2[OPMODE] = 0) - * 4.Single Phase Count(PH1CT) Operation Mode (CTRL[PH1] = 1,CTRL2[OPMODE] = 1) - * - * param base EQDC peripheral base address. - * param psConfig Pointer to configuration structure. - */ -void EQDC_SetOperateMode(EQDC_Type *base, eqdc_operate_mode_t operateMode) -{ - switch (operateMode) - { - case kEQDC_QuadratureDecodeOperationMode: - base->CTRL &= ~EQDC_CTRL_PH1_MASK; - base->CTRL2 &= ~EQDC_CTRL2_OPMODE_MASK; - break; - - case kEQDC_QuadratureCountOperationMode: - base->CTRL &= ~EQDC_CTRL_PH1_MASK; - base->CTRL2 |= EQDC_CTRL2_OPMODE_MASK; - break; - - case kEQDC_SinglePhaseDecodeOperationMode: - base->CTRL |= EQDC_CTRL_PH1_MASK; - base->CTRL2 &= ~EQDC_CTRL2_OPMODE_MASK; - break; - - case kEQDC_SinglePhaseCountOperationMode: - base->CTRL |= EQDC_CTRL_PH1_MASK; - base->CTRL2 |= EQDC_CTRL2_OPMODE_MASK; - break; - - default: - assert(false); - break; - } -} \ No newline at end of file diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_eqdc.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_eqdc.h deleted file mode 100644 index 3f3ef5baf54..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_eqdc.h +++ /dev/null @@ -1,1211 +0,0 @@ -/* - * Copyright 2022, 2023 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_EQDC_H_ -#define FSL_EQDC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup eqdc - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -#define FSL_EQDC_DRIVER_VERSION (MAKE_VERSION(2, 3, 0)) - -/*! @brief W1C bits in EQDC CTRL registers. */ -#define EQDC_CTRL_W1C_FLAGS (EQDC_CTRL_HIRQ_MASK | EQDC_CTRL_XIRQ_MASK | EQDC_CTRL_WDIRQ_MASK) - -/*! @brief W1C bits in EQDC INTCTRL registers. */ -#define EQDC_INTCTRL_W1C_FLAGS \ - (EQDC_INTCTRL_SABIRQ_MASK | EQDC_INTCTRL_DIRIRQ_MASK | EQDC_INTCTRL_RUIRQ_MASK | EQDC_INTCTRL_ROIRQ_MASK | \ - EQDC_INTCTRL_CMP0IRQ_MASK | EQDC_INTCTRL_CMP1IRQ_MASK | EQDC_INTCTRL_CMP2IRQ_MASK | EQDC_INTCTRL_CMP3IRQ_MASK) - -/*! @brief Interrupt enable bits in EQDC CTRL registers. */ -#define EQDC_CTRL_INT_EN (EQDC_CTRL_HIE_MASK | EQDC_CTRL_XIE_MASK | EQDC_CTRL_WDIE_MASK) - -/*! @brief Interrupt enable bits in EQDC INTCTRL registers. */ -#if (defined(FSL_FEATURE_EQDC_HAS_NO_COMPARE_INTERRUPT) && FSL_FEATURE_EQDC_HAS_NO_COMPARE_INTERRUPT) -#define EQDC_INTCTRL_INT_EN \ - (EQDC_INTCTRL_SABIE_MASK | EQDC_INTCTRL_DIRIE_MASK | EQDC_INTCTRL_RUIE_MASK | EQDC_INTCTRL_ROIE_MASK) -#else -#define EQDC_INTCTRL_INT_EN \ - (EQDC_INTCTRL_SABIE_MASK | EQDC_INTCTRL_DIRIE_MASK | EQDC_INTCTRL_RUIE_MASK | EQDC_INTCTRL_ROIE_MASK | \ - EQDC_INTCTRL_CMP0IE_MASK | EQDC_INTCTRL_CMP1IE_MASK | EQDC_INTCTRL_CMP2IE_MASK | EQDC_INTCTRL_CMP3IE_MASK) -#endif - -/*! @brief Interrupt flag bits in EQDC CTRL registers. */ -#define EQDC_CTRL_INT_FLAGS (EQDC_CTRL_HIRQ_MASK | EQDC_CTRL_XIRQ_MASK | EQDC_CTRL_WDIRQ_MASK) - -/*! @brief Interrupt flag bits in EQDC INTCTRL registers. */ -#define EQDC_INTCTRL_INT_FLAGS \ - (EQDC_INTCTRL_SABIRQ_MASK | EQDC_INTCTRL_DIRIRQ_MASK | EQDC_INTCTRL_RUIRQ_MASK | EQDC_INTCTRL_ROIRQ_MASK | \ - EQDC_INTCTRL_CMP0IRQ_MASK | EQDC_INTCTRL_CMP1IRQ_MASK | EQDC_INTCTRL_CMP2IRQ_MASK | EQDC_INTCTRL_CMP3IRQ_MASK) - -#if !(defined(FSL_FEATURE_EQDC_HAS_NO_COMPARE_INTERRUPT) && FSL_FEATURE_EQDC_HAS_NO_COMPARE_INTERRUPT) -#define kEQDC_PositionCompare0InerruptEnable kEQDC_PositionCompare0InterruptEnable -#define kEQDC_PositionCompare1InerruptEnable kEQDC_PositionCompare1InterruptEnable -#define kEQDC_PositionCompare2InerruptEnable kEQDC_PositionCompare2InterruptEnable -#define kEQDC_PositionCompare3InerruptEnable kEQDC_PositionCompare3InterruptEnable -#endif - -/*! - * @brief EQDC status flags, these flags indicate the counter's events. - * @anchor _eqdc_status_flags - */ -enum _eqdc_status_flags -{ - kEQDC_HomeEnableTransitionFlag = EQDC_CTRL_HIRQ_MASK, /*!< HOME/ENABLE signal transition occured. */ - kEQDC_IndexPresetPulseFlag = EQDC_CTRL_XIRQ_MASK, /*!< INDEX/PRESET pulse occured. */ - kEQDC_WatchdogTimeoutFlag = EQDC_CTRL_WDIRQ_MASK, /*!< Watchdog timeout occured. */ - - kEQDC_SimultPhaseChangeFlag = (uint32_t)EQDC_INTCTRL_SABIRQ_MASK - << 16U, /*!< Simultaneous change of PHASEA and PHASEB occured. */ - kEQDC_CountDirectionChangeFlag = (uint32_t)EQDC_INTCTRL_DIRIRQ_MASK - << 16U, /*!< Count direction change interrupt enable. */ - kEQDC_PositionRollOverFlag = (uint32_t)EQDC_INTCTRL_ROIRQ_MASK - << 16U, /*!< Position counter rolls over from 0xFFFFFFFF to 0, or - from MOD value to INIT value. */ - kEQDC_PositionRollUnderFlag = (uint32_t)EQDC_INTCTRL_RUIRQ_MASK - << 16U, /*!< Position register roll under from 0 to 0xFFFFFFFF, or - from INIT value to MOD value. */ - - kEQDC_PositionCompare0Flag = (uint32_t)EQDC_INTCTRL_CMP0IRQ_MASK - << 16U, /*!< Position counter match the COMP0 value. */ - kEQDC_PositionCompare1Flag = (uint32_t)EQDC_INTCTRL_CMP1IRQ_MASK - << 16U, /*!< Position counter match the COMP1 value. */ - kEQDC_PositionCompare2Flag = (uint32_t)EQDC_INTCTRL_CMP2IRQ_MASK - << 16U, /*!< Position counter match the COMP2 value. */ - kEQDC_PositionCompare3Flag = (uint32_t)EQDC_INTCTRL_CMP3IRQ_MASK - << 16U, /*!< Position counter match the COMP3 value. */ - - kEQDC_StatusAllFlags = kEQDC_HomeEnableTransitionFlag | kEQDC_IndexPresetPulseFlag | kEQDC_WatchdogTimeoutFlag | - kEQDC_SimultPhaseChangeFlag | kEQDC_PositionRollOverFlag | kEQDC_PositionRollUnderFlag | - kEQDC_PositionCompare0Flag | kEQDC_PositionCompare1Flag | kEQDC_PositionCompare2Flag | - kEQDC_PositionCompare3Flag -}; - -/*! - * @brief Signal status, these flags indicate the raw and filtered input signal status. - * @anchor _eqdc_signal_status - */ -enum _eqdc_signal_status -{ - kEQDC_SignalStatusRawHomeEnable = EQDC_IMR_HOME_ENABLE_MASK, /*!< Raw HOME/ENABLE input. */ - kEQDC_SignalStatusRawIndexPreset = EQDC_IMR_INDEX_PRESET_MASK, /*!< Raw INDEX/PRESET input. */ - kEQDC_SignalStatusRawPhaseB = EQDC_IMR_PHB_MASK, /*!< Raw PHASEB input. */ - kEQDC_SignalStatusRawPhaseA = EQDC_IMR_PHA_MASK, /*!< Raw PHASEA input. */ - kEQDC_SignalStatusFilteredHomeEnable = EQDC_IMR_FHOM_ENA_MASK, /*!< The filtered HOME/ENABLE input. */ - kEQDC_SignalStatusFilteredIndexPreset = EQDC_IMR_FIND_PRE_MASK, /*!< The filtered INDEX/PRESET input. */ - kEQDC_SignalStatusFilteredPhaseB = EQDC_IMR_FPHB_MASK, /*!< The filtered PHASEB input. */ - kEQDC_SignalStatusFilteredPhaseA = EQDC_IMR_FPHA_MASK, /*!< The filtered PHASEA input. */ - - kEQDC_SignalStatusPositionCompare0Flag = EQDC_IMR_CMPF0_MASK, /*!< Position Compare 0 Flag Output. */ - kEQDC_SignalStatusPositionCompare1Flag = EQDC_IMR_CMP1F_MASK, /*!< Position Compare 1 Flag Output. */ - kEQDC_SignalStatusPositionCompare2Flag = EQDC_IMR_CMP2F_MASK, /*!< Position Compare 2 Flag Output. */ - kEQDC_SignalStatusPositionCompare3Flag = EQDC_IMR_CMP3F_MASK, /*!< Position Compare 3 Flag Output. */ - kEQDC_SignalStatusCountDirectionFlagHold = EQDC_IMR_DIRH_MASK, /*!< Count Direction Flag Hold. */ - kEQDC_SignalStatusCountDirectionFlag = EQDC_IMR_DIR_MASK, /*!< Count Direction Flag Output. */ - - kEQDC_SignalStatusAllFlags = kEQDC_SignalStatusRawHomeEnable | kEQDC_SignalStatusRawIndexPreset | - kEQDC_SignalStatusRawPhaseB | kEQDC_SignalStatusRawPhaseA | - kEQDC_SignalStatusFilteredHomeEnable | kEQDC_SignalStatusFilteredIndexPreset | - kEQDC_SignalStatusFilteredPhaseB | kEQDC_SignalStatusFilteredPhaseA | - kEQDC_SignalStatusPositionCompare0Flag | kEQDC_SignalStatusPositionCompare1Flag | - kEQDC_SignalStatusPositionCompare2Flag | kEQDC_SignalStatusPositionCompare3Flag | - kEQDC_SignalStatusCountDirectionFlagHold | kEQDC_SignalStatusCountDirectionFlag -}; - -/*! - * @brief Interrupt enable/disable mask. - * @anchor _eqdc_interrupt_enable - */ -enum _eqdc_interrupt_enable -{ - kEQDC_HomeEnableTransitionInterruptEnable = - EQDC_CTRL_HIE_MASK, /*!< HOME/ENABLE signal transition interrupt enable. */ - kEQDC_IndexPresetPulseInterruptEnable = EQDC_CTRL_XIE_MASK, /*!< INDEX/PRESET pulse interrupt enable. */ - kEQDC_WatchdogTimeoutInterruptEnable = EQDC_CTRL_WDIE_MASK, /*!< Watchdog timeout interrupt enable. */ - - kEQDC_SimultPhaseChangeInterruptEnable = (uint32_t)EQDC_INTCTRL_SABIE_MASK - << 16U, /*!< Simultaneous PHASEA and PHASEB change interrupt enable. */ - kEQDC_CountDirectionChangeInterruptEnable = (uint32_t)EQDC_INTCTRL_DIRIE_MASK - << 16U, /*!< Count direction change interrupt enable. */ - kEQDC_PositionRollOverInterruptEnable = (uint32_t)EQDC_INTCTRL_ROIE_MASK << 16U, /*!< Roll-over interrupt enable. */ - kEQDC_PositionRollUnderInterruptEnable = (uint32_t)EQDC_INTCTRL_RUIE_MASK - << 16U, /*!< Roll-under interrupt enable. */ - -#if !(defined(FSL_FEATURE_EQDC_HAS_NO_COMPARE_INTERRUPT) && FSL_FEATURE_EQDC_HAS_NO_COMPARE_INTERRUPT) - kEQDC_PositionCompare0InterruptEnable = (uint32_t)EQDC_INTCTRL_CMP0IE_MASK - << 16U, /*!< Position compare 0 interrupt enable. */ - kEQDC_PositionCompare1InterruptEnable = (uint32_t)EQDC_INTCTRL_CMP1IE_MASK - << 16U, /*!< Position compare 1 interrupt enable. */ - kEQDC_PositionCompare2InterruptEnable = (uint32_t)EQDC_INTCTRL_CMP2IE_MASK - << 16U, /*!< Position compare 2 interrupt enable. */ - kEQDC_PositionCompare3InterruptEnable = (uint32_t)EQDC_INTCTRL_CMP3IE_MASK - << 16U, /*!< Position compare 3 interrupt enable. */ -#endif - -#if (defined(FSL_FEATURE_EQDC_HAS_NO_COMPARE_INTERRUPT) && FSL_FEATURE_EQDC_HAS_NO_COMPARE_INTERRUPT) - kEQDC_AllInterruptEnable = kEQDC_HomeEnableTransitionInterruptEnable | kEQDC_IndexPresetPulseInterruptEnable | - kEQDC_WatchdogTimeoutInterruptEnable | kEQDC_SimultPhaseChangeInterruptEnable | - kEQDC_CountDirectionChangeInterruptEnable | kEQDC_PositionRollOverInterruptEnable | - kEQDC_PositionRollUnderInterruptEnable -#else - kEQDC_AllInterruptEnable = kEQDC_HomeEnableTransitionInterruptEnable | kEQDC_IndexPresetPulseInterruptEnable | - kEQDC_WatchdogTimeoutInterruptEnable | kEQDC_SimultPhaseChangeInterruptEnable | - kEQDC_CountDirectionChangeInterruptEnable | kEQDC_PositionRollOverInterruptEnable | - kEQDC_PositionRollUnderInterruptEnable | kEQDC_PositionCompare0InterruptEnable | - kEQDC_PositionCompare1InterruptEnable | kEQDC_PositionCompare2InterruptEnable | - kEQDC_PositionCompare3InterruptEnable -#endif -}; - -/*! - * @brief Define HOME/ENABLE signal's trigger mode. - */ -typedef enum _eqdc_home_enable_init_pos_counter_mode -{ - /*! Don't use HOME/ENABLE signal to initialize the position counter. */ - kEQDC_HomeInitPosCounterDisabled = 0U, - - /*! Use positive going edge to trigger initialization of position counters. */ - kEQDC_HomeInitPosCounterOnRisingEdge = EQDC_CTRL_HIP_MASK, - - /*! Use negative going edge to trigger initialization of position counters. */ - kEQDC_HomeInitPosCounterOnFallingEdge = EQDC_CTRL_HIP_MASK | EQDC_CTRL_HNE_MASK, -} eqdc_home_enable_init_pos_counter_mode_t; - -/*! - * @brief Define INDEX/PRESET signal's trigger mode. - */ -typedef enum _eqdc_index_preset_init_pos_counter_mode -{ - /*! INDEX/PRESET pulse does not initialize the position counter. */ - kEQDC_IndexInitPosCounterDisabled = 0U, - - /*! Use INDEX/PRESET pulse rising edge to initialize position counter. */ - kEQDC_IndexInitPosCounterOnRisingEdge = EQDC_CTRL_XIP_MASK, - - /*! Use INDEX/PRESET pulse falling edge to initialize position counter. */ - kEQDC_IndexInitPosCounterOnFallingEdge = EQDC_CTRL_XIP_MASK | EQDC_CTRL_XNE_MASK, -} eqdc_index_preset_init_pos_counter_mode_t; - -/*! - * @brief Define type for decoder opertion mode. - * - * The Quadrature Decoder operates in following 4 operation modes: - * 1.Quadrature Decode(QDC) Operation Mode (CTRL[PH1] = 0,CTRL2[OPMODE] = 0) - * In QDC operation mode, Module uses PHASEA, PHASEB, INDEX, HOME, TRIGGER - * and ICAP[3:1] to decode the PHASEA and PHASEB signals from Speed/Position sensor. - * 2.Quadrature Count(QCT) Operation Mode (CTRL[PH1] = 0,CTRL2[OPMODE] = 1) - * In QCT operation mode, Module uses PHASEA, PHASEB, PRESET, ENABLE, - * TRIGGER and ICAP[3:1] to count the PHASEA and PHASEB signals from Speed/Position sensor. - * 3.Single Phase Decode(PH1DC) Operation Mode (CTRL[PH1] = 1,CTRL2[OPMODE] = 0) - * In PH1DC operation mode, the module uses PHASEA, PHASEB, INDEX, HOME, - * TRIGGER and ICAP[3:1] to decode the PHASEA and PHASEB signals from Speed/Position sensor. - * 4.Single Phase Count(PH1CT) Operation Mode (CTRL[PH1] = 1,CTRL2[OPMODE] = 1) - * In PH1CT operation mode, the module uses PHASEA, PHASEB, PRESET, ENABLE, - * TRIGGER and ICAP[3:1] to count the PHASEA and PHASEB signals from Speed/Position sensor. - */ -typedef enum _eqdc_operate_mode -{ - kEQDC_QuadratureDecodeOperationMode = 0U, /*!< Use standard quadrature decoder with PHASEA/PHASEB, INDEX/HOME. */ - kEQDC_QuadratureCountOperationMode, /*!< Use quadrature count operation mode with PHASEA/PHASEB, PRESET/ENABLE. */ - kEQDC_SinglePhaseDecodeOperationMode, /*!< Use single phase quadrature decoder with PHASEA/PHASEB, INDEX/HOME. */ - kEQDC_SinglePhaseCountOperationMode, /*!< Use single phase count decoder with PHASEA/PHASEB, PRESET/ENABLE. */ -} eqdc_operate_mode_t; - -/*! - * @brief Define type for decoder count mode. - * - * In decode mode, it uses the standard quadrature decoder with PHASEA and PHASEB, - * PHASEA = 0 and PHASEB = 0 mean reverse direction. - * - If PHASEA leads PHASEB, then motion is in the positive direction. - * - If PHASEA trails PHASEB,then motion is in the negative direction. - * In single phase mode, there are three count modes: - * - In Signed Count mode (Single Edge). Both position counter (POS) and position difference counter (POSD) count - * on the input PHASEA rising edge while the input PHASEB provides the selected position counter direction - * (up/down). If CTRL[REV] is 1, then the position counter will count in the opposite direction. - * - In Signed Count mode (double edge), both position counter (POS) and - * position difference counter (POSD) count the input PHASEA on both rising edge and falling edge while the input - * PHASEB provides the selected position counter direction (up/down). - * - In UP/DOWN Pulse Count mode. Both position counter (POS) and position difference counter (POSD) count in the - * up direction when input PHASEA rising edge occurs. Both counters count in the down direction when input PHASEB rising - * edge occurs. If CTRL[REV] is 1, then the position counter will count in the opposite direction. - */ -typedef enum _eqdc_count_mode -{ - kEQDC_QuadratureX4 = 0U, /*!< Active on kEQDC_QuadratureDecodeOperationMode/kEQDC_QuadratureCountOperationMode. */ - kEQDC_QuadratureX2 = 1U, /*!< Active on kEQDC_QuadratureDecodeOperationMode/kEQDC_QuadratureCountOperationMode. */ - kEQDC_QuadratureX1 = 2U, /*!< Active on kEQDC_QuadratureDecodeOperationMode/kEQDC_QuadratureCountOperationMode. */ - kEQDC_UpDownPulseCount = - 0U, /*!< Active on kEQDC_SinglePhaseDecodeOperationMode/kEQDC_SinglePhaseCountOperationMode. */ - kEQDC_SignedCountDoubleEdge = - 1U, /*!< Active on kEQDC_SinglePhaseDecodeOperationMode/kEQDC_SinglePhaseCountOperationMode. */ - kEQDC_SignedCountSingleEdge = - 2U, /*!< Active on kEQDC_SinglePhaseDecodeOperationMode/kEQDC_SinglePhaseCountOperationMode. */ -} eqdc_count_mode_t; - -/*! - * @brief Define type for the condition of POSMATCH pulses. - */ -typedef enum _eqdc_output_pulse_mode -{ - kEQDC_OutputPulseOnCounterEqualCompare = 0U, /*!< POSMATCH pulses when a match occurs between the position counters - (POS) and the compare value (UCOMPx/LCOMPx)(x range is 0-3). */ - kEQDC_OutputPulseOnReadingPositionCounter, /*!< POSMATCH pulses when reading position counter(POS and LPOS), - revolution counter(REV), position difference counter(POSD). */ -} eqdc_output_pulse_mode_t; - -/*! - * @brief Define type for determining how the revolution counter (REV) is incremented/decremented. - */ -typedef enum _eqdc_revolution_count_condition -{ - kEQDC_RevolutionCountOnIndexPulse = 0U, /*!< Use INDEX pulse to increment/decrement revolution counter. */ - kEQDC_RevolutionCountOnRollOverModulus, /*!< Use modulus counting roll-over/under to increment/decrement revolution - counter. */ -} eqdc_revolution_count_condition_t; - -/*! - * @brief Input Filter Sample Count - * - * The Input Filter Sample Count represents the number of consecutive samples - * that must agree, before the input filter accepts an input transition - */ -typedef enum _eqdc_filter_sample_count -{ - kEQDC_Filter3Samples = 0U, /*!< 3 samples. */ - kEQDC_Filter4Samples = 1U, /*!< 4 samples. */ - kEQDC_Filter5Samples = 2U, /*!< 5 samples. */ - kEQDC_Filter6Samples = 3U, /*!< 6 samples. */ - kEQDC_Filter7Samples = 4U, /*!< 7 samples. */ - kEQDC_Filter8Samples = 5U, /*!< 8 samples. */ - kEQDC_Filter9Samples = 6U, /*!< 9 samples. */ - kEQDC_Filter10Samples = 7U, /*!< 10 samples. */ -} eqdc_filter_sample_count_t; - -/*! - * @brief Count direction. - */ -typedef enum _eqdc_count_direction_flag -{ - kEQDC_CountDirectionDown = 0U, /*!< Last count was in down direction. */ - kEQDC_CountDirectionUp, /*!< Last count was in up direction. */ -} eqdc_count_direction_flag_t; - -/*! - * @brief Prescaler used by Last Edge Time (LASTEDGE) and - * Position Difference Period Counter (POSDPER). - */ -typedef enum _eqdc_prescaler -{ - kEQDC_Prescaler1 = 0U, /*!< Prescaler value 1. */ - kEQDC_Prescaler2 = 1U, /*!< Prescaler value 2. */ - kEQDC_Prescaler4 = 2U, /*!< Prescaler value 4. */ - kEQDC_Prescaler8 = 3U, /*!< Prescaler value 8. */ - kEQDC_Prescaler16 = 4U, /*!< Prescaler value 16. */ - kEQDC_Prescaler32 = 5U, /*!< Prescaler value 32. */ - kEQDC_Prescaler64 = 6U, /*!< Prescaler value 64. */ - kEQDC_Prescaler128 = 7U, /*!< Prescaler value 128. */ - kEQDC_Prescaler256 = 8U, /*!< Prescaler value 256. */ - kEQDC_Prescaler512 = 9U, /*!< Prescaler value 512. */ - kEQDC_Prescaler1024 = 10U, /*!< Prescaler value 1024. */ - kEQDC_Prescaler2048 = 11U, /*!< Prescaler value 2048. */ - kEQDC_Prescaler4096 = 12U, /*!< Prescaler value 4096. */ - kEQDC_Prescaler8192 = 13U, /*!< Prescaler value 8192. */ - kEQDC_Prescaler16384 = 14U, /*!< Prescaler value 16384. */ - kEQDC_Prescaler32768 = 15U, /*!< Prescaler value 32768. */ -} eqdc_prescaler_t; - -/*! - * @brief Define user configuration structure for EQDC module. - */ -typedef struct _eqdc_config -{ - /* Basic counter. */ - bool enableReverseDirection; /*!< Enable reverse direction counting. */ - bool countOnce; /*!< Selects modulo loop or one shot counting mode. */ - - bool enableDma; /*!< Enable DMA for new written buffer values of COMPx/INIT/MOD(x range is 0-3) */ - bool bufferedRegisterLoadMode; /*!enableReverseDirection = false; - psConfig->countOnce = false; - psConfig->operateMode = kEQDC_QuadratureDecodeOperationMode; - psConfig->countMode = kEQDC_QuadratureX4; - psConfig->homeEnableInitPosCounterMode = kEQDC_HomeInitPosCounterDisabled; - psConfig->indexPresetInitPosCounterMode = kEQDC_IndexInitPosCounterDisabled; - psConfig->enableIndexInitPositionCounter = false; - psConfig->enableDma = false; - psConfig->bufferedRegisterLoadMode = false; - psConfig->enableTriggerInitPositionCounter = false; - psConfig->enableTriggerClearPositionRegisters = false; - psConfig->enableTriggerHoldPositionRegisters = false; - psConfig->enableWatchdog = false; - psConfig->watchdogTimeoutValue = 0xFFFFU; - psConfig->filterPhaseA = 0U; - psConfig->filterPhaseB = 0U; - psConfig->filterIndPre = 0U; - psConfig->filterHomEna = 0U; - psConfig->filterClockSourceselection = false; - psConfig->filterSampleCount = kEQDC_Filter3Samples; - psConfig->filterSamplePeriod = 0U; - psConfig->outputPulseMode = kEQDC_OutputPulseOnCounterEqualCompare; - psConfig->positionCompareValue[0] = 0xFFFFFFFFU; - psConfig->positionCompareValue[1] = 0xFFFFFFFFU; - psConfig->positionCompareValue[2] = 0xFFFFFFFFU; - psConfig->positionCompareValue[3] = 0xFFFFFFFFU; - psConfig->revolutionCountCondition = kEQDC_RevolutionCountOnIndexPulse; - psConfig->positionModulusValue = 0U; - psConfig->positionInitialValue = 0U; - psConfig->positionCounterValue = 0U; - psConfig->enablePeriodMeasurement = false; - psConfig->prescaler = kEQDC_Prescaler1; - psConfig->enabledInterruptsMask = 0U; - @endcode - * - * @param psConfig Pointer to configuration structure. - */ -void EQDC_GetDefaultConfig(eqdc_config_t *psConfig); - -/*! - * @brief De-initializes the EQDC module. - * - * This function deinitializes the EQDC by disabling the IP bus clock (optional). - * - * @param base EQDC peripheral base address. - */ -void EQDC_Deinit(EQDC_Type *base); - -/*! - * @brief Initializes the mode of operation. - * - * This function initializes mode of operation by enabling the IP bus clock (optional). - * - * @param base EQDC peripheral base address. - * @param operateMode Select operation mode. - */ -void EQDC_SetOperateMode(EQDC_Type *base, eqdc_operate_mode_t operateMode); - -/*! - * @brief Initializes the mode of count. - * - * These bits control the basic counting and behavior of Position Counter and Position Difference Counter. - * Setting CTRL[REV] to 1 can reverse the counting direction. - * 1.In quadrature Mode (CTRL[PH1] = 0): - * 00b - CM0: Normal/Reverse Quadrature X4 - * 01b - CM1: Normal/Reverse Quadrature X2 - * 10b - CM2: Normal/Reverse Quadrature X1 - * 11b - CM3: Reserved - * 2.In Single Phase Mode (CTRL[PH1] = 1): - * 00b - CM0: UP/DOWN Pulse Count Mode - * 01b - CM1: Signed Mode, count PHASEA rising/falling edge, position counter counts up when PHASEB - * is low and counts down when PHASEB is high - * 10b - CM2: Signed Count Mode,count PHASEA rising edge only, position counter counts up when - * PHASEB is low and counts down when PHASEB is high - * 11b - CM3: Reserved - * - * @param base EQDC peripheral base address. - * @param countMode Select count mode. - */ -static inline void EQDC_SetCountMode(EQDC_Type *base, eqdc_count_mode_t countMode) -{ - base->CTRL2 = (base->CTRL2 & (uint16_t)(~EQDC_CTRL2_CMODE_MASK)) | EQDC_CTRL2_CMODE(countMode); -} - -/*! @} */ - -/*! - * @name Watchdog - * @{ - */ - -/*! - * @brief Enable watchdog for EQDC module. - * - * @param base EQDC peripheral base address - * @param bEnable Enables or disables the watchdog - */ -static inline void EQDC_EnableWatchdog(EQDC_Type *base, bool bEnable) -{ - if (bEnable) - { - base->CTRL = (base->CTRL & (~EQDC_CTRL_W1C_FLAGS)) | EQDC_CTRL_WDE_MASK; - } - else - { - base->CTRL = (base->CTRL & (~(EQDC_CTRL_W1C_FLAGS | EQDC_CTRL_WDE_MASK))); - } -} - -/*! - * @brief Set watchdog timeout value. - * - * @param base EQDC peripheral base address - * @param u16Timeout Number of clock cycles, plus one clock cycle that the - * watchdog timer counts before timing out - */ -static inline void EQDC_SetWatchdogTimeout(EQDC_Type *base, uint16_t u16Timeout) -{ - base->WTR = u16Timeout; -} - -/*! @} */ - -/*! - * @name DMA - * @{ - */ - -/*! - * @brief Enable DMA for EQDC module. - * - * @param base EQDC peripheral base address - * @param bEnable Enables or disables the DMA - */ -static inline void EQDC_EnableDMA(EQDC_Type *base, bool bEnable) -{ - if (bEnable) - { - base->CTRL |= EQDC_CTRL_DMAEN_MASK; - } - else - { -#if (defined(FSL_FEATURE_EQDC_HAS_ERRATA_051383) && FSL_FEATURE_EQDC_HAS_ERRATA_051383) - /* Quadrature decoder CTRL[DMAEN] bit can not be cleared except do EQDC reset*/ - assert(false); -#else - base->CTRL &= ~EQDC_CTRL_DMAEN_MASK; -#endif - } -} - -/*! @} */ - -/*! - * @name Double-set Registers Loading Operation - * @{ - */ - -/*! - * @brief Set Buffered Register Load (Update) Mode. - * - * This bit selects the loading time point of the buffered compare registers UCOMPx/LCOMPx, x=0~3, - * initial register (UINIT/LINIT), and modulus register (UMOD/LMOD). - * Buffered registers are loaded and take effect at the next roll-over or roll-under if CTRL[LDOK] is set. - * - * @param base EQDC peripheral base address - */ -static inline void EQDC_SetBufferedRegisterLoadUpdateMode(EQDC_Type *base) -{ - base->CTRL2 |= EQDC_CTRL2_LDMOD_MASK; -} - -/*! - * @brief Clear Buffered Register Load (Update) Mode. - * - * Buffered Register Load (Update) Mode bit selects the loading time point of the buffered compare registers - * UCOMPx/LCOMPx, x=0~3, initial register (UINIT/LINIT), and modulus register (UMOD/LMOD). Buffered registers are loaded - * and take effect immediately upon CTRL[LDOK] is set. - * - * @param base EQDC peripheral base address - */ -static inline void EQDC_ClearBufferedRegisterLoadUpdateMode(EQDC_Type *base) -{ - base->CTRL2 &= ~EQDC_CTRL2_LDMOD_MASK; -} - -/*! - * @brief Set load okay. - * - * Load okay enables that the outer-set values of buffered compare registers (UCOMPx/LCOMPx, x=0~3), - * initial register(UINIT/LINIT) and modulus register(UMOD/LMOD) can be loaded into their inner-sets and - * take effect. - * When LDOK is set, this loading action occurs at the next position counter roll-over or roll-under if - * CTRL2[LDMOD] is set, or it occurs immediately if CTRL2[LDMOD] is cleared. LDOK is automatically - * cleared after the values in outer-set is loaded into the inner-set. - * - * @param base EQDC peripheral base address. - */ -static inline void EQDC_SetEqdcLdok(EQDC_Type *base) -{ - base->CTRL |= EQDC_CTRL_LDOK_MASK; -} - -/*! - * @brief Get load okay. - * - * @param base EQDC peripheral base address. - */ -static inline uint8_t EQDC_GetEqdcLdok(EQDC_Type *base) -{ - return base->CTRL & EQDC_CTRL_LDOK_MASK; -} - -/*! - * @brief Clear load okay. - * - * @param base EQDC peripheral base address. - */ -static inline void EQDC_ClearEqdcLdok(EQDC_Type *base) -{ - base->CTRL &= ~EQDC_CTRL_LDOK_MASK; -} - -/*! @} */ - -/*! - * @name Status - * @{ - */ -/*! - * @brief Get the status flags. - * - * @param base EQDC peripheral base address. - * - * @return Logical OR'ed value of the status flags, @ref _eqdc_status_flags. - */ -static inline uint32_t EQDC_GetStatusFlags(EQDC_Type *base) -{ - uint32_t u32Flags = 0U; - - u32Flags = (uint32_t)(base->CTRL) & EQDC_CTRL_INT_FLAGS; - - u32Flags |= ((uint32_t)(base->INTCTRL) & EQDC_INTCTRL_INT_FLAGS) << 16; - return u32Flags; -} - -/*! - * @brief Clear the status flags. - * - * @param base EQDC peripheral base address. - * @param u32Flags Logical OR'ed value of the flags to clear, @ref _eqdc_status_flags. - */ -static inline void EQDC_ClearStatusFlags(EQDC_Type *base, uint32_t u32Flags) -{ - if (0U != (u32Flags & EQDC_CTRL_INT_FLAGS)) - { - base->CTRL = (base->CTRL & (~EQDC_CTRL_W1C_FLAGS)) | (u32Flags & EQDC_CTRL_INT_FLAGS); - } - - if (0U != ((u32Flags >> 16) & EQDC_INTCTRL_INT_FLAGS)) - { - base->INTCTRL = (base->INTCTRL & (~EQDC_INTCTRL_W1C_FLAGS)) | ((u32Flags >> 16) & EQDC_INTCTRL_INT_FLAGS); - } -} - -/*! - * @brief Get the signals' real-time status. - * - * @param base EQDC peripheral base address. - * @return Logical OR'ed value of the real-time signal status, @ref _eqdc_signal_status. - */ -static inline uint16_t EQDC_GetSignalStatusFlags(EQDC_Type *base) -{ - return base->IMR; -} - -/*! - * @brief Get the direction of the last count. - * - * @param base EQDC peripheral base address. - * @return Direction of the last count. - */ -static inline eqdc_count_direction_flag_t EQDC_GetLastCountDirection(EQDC_Type *base) -{ - return ((0U != (base->IMR & EQDC_IMR_DIR_MASK)) ? kEQDC_CountDirectionUp : kEQDC_CountDirectionDown); -} -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enable the interrupts. - * - * @param base EQDC peripheral base address. - * @param u32Interrupts Logical OR'ed value of the interrupts, @ref _eqdc_interrupt_enable. - */ -static inline void EQDC_EnableInterrupts(EQDC_Type *base, uint32_t u32Interrupts) -{ - if (0U != (u32Interrupts & EQDC_CTRL_INT_EN)) - { - base->CTRL = (base->CTRL & (~EQDC_CTRL_W1C_FLAGS)) | (u32Interrupts & EQDC_CTRL_INT_EN); - } - - if (0U != ((u32Interrupts >> 16) & EQDC_INTCTRL_INT_EN)) - { - base->INTCTRL = (base->INTCTRL & (~EQDC_INTCTRL_W1C_FLAGS)) | ((u32Interrupts >> 16) & EQDC_INTCTRL_INT_EN); - } -} - -/*! - * @brief Disable the interrupts. - * - * @param base EQDC peripheral base address. - * @param u32Interrupts Logical OR'ed value of the interrupts, @ref _eqdc_interrupt_enable. - */ -static inline void EQDC_DisableInterrupts(EQDC_Type *base, uint32_t u32Interrupts) -{ - if (0U != (u32Interrupts & EQDC_CTRL_INT_EN)) - { - base->CTRL = (base->CTRL & (~EQDC_CTRL_W1C_FLAGS)) & (~(u32Interrupts & EQDC_CTRL_INT_EN)); - } - - if (0U != ((u32Interrupts >> 16) & EQDC_INTCTRL_INT_EN)) - { - base->INTCTRL = (base->INTCTRL & (~EQDC_INTCTRL_W1C_FLAGS)) & (~((u32Interrupts >> 16) & EQDC_INTCTRL_INT_EN)); - } -} - -/*! @} */ - -/*! - * @name Counter Operation - * @{ - */ - -/*! - * @brief Load the initial position value to position counter. - * - * Software trigger to load the initial position value (UINIT and LINIT) contents - * to position counter (UPOS and LPOS), so that to provide the consistent - * operation the position counter registers. - * - * @param base EQDC peripheral base address. - */ -static inline void EQDC_DoSoftwareLoadInitialPositionValue(EQDC_Type *base) -{ - base->CTRL = (base->CTRL & (~EQDC_CTRL_W1C_FLAGS)) | EQDC_CTRL_SWIP_MASK; -} - -/*! - * @brief Set initial position value for EQDC module. - * - * Set the position counter initial value (UINIT, LINIT). - * After writing values to the UINIT and LINIT registers, the values are "buffered" into outer-set - * registers temporarily. Values will be loaded into inner-set registers and take effect using - * the following two methods: - * 1. If CTRL2[LDMODE] is 1, "buffered" values are loaded into inner-set and take effect - * at the next roll-over or roll-under if CTRL[LDOK] is set. - * 2. If CTRL2[LDMODE] is 0, "buffered" values are loaded into inner-set and take effect - * immediately when CTRL[LDOK] is set. - * - * @param base EQDC peripheral base address - * @param u32PositionInitValue Position initial value - */ -static inline void EQDC_SetInitialPositionValue(EQDC_Type *base, uint32_t u32PositionInitValue) -{ - base->UINIT = (uint16_t)(u32PositionInitValue >> 16U); - base->LINIT = (uint16_t)(u32PositionInitValue); -} - -/*! - * @brief Set position counter value. - * - * Set the position counter value (POS or UPOS, LPOS). - * - * @param base EQDC peripheral base address - * @param positionCounterValue Position counter value - */ -static inline void EQDC_SetPositionCounterValue(EQDC_Type *base, uint32_t positionCounterValue) -{ - base->UPOS = (uint16_t)(positionCounterValue >> 16U); - base->LPOS = (uint16_t)(positionCounterValue); -} - -/*! - * @brief Set position counter modulus value. - * - * Set the position counter modulus value (UMOD, LMOD). - * After writing values to the UMOD and LMOD registers, the values are "buffered" into outer-set - * registers temporarily. Values will be loaded into inner-set registers and take effect using - * the following two methods: - * 1. If CTRL2[LDMODE] is 1, "buffered" values are loaded into inner-set and take effect - * at the next roll-over or roll-under if CTRL[LDOK] is set. - * 2. If CTRL2[LDMODE] is 0, "buffered" values are loaded into inner-set and take effect - * immediately when CTRL[LDOK] is set. - * - * @param base EQDC peripheral base address - * @param positionModulusValue Position modulus value - */ -static inline void EQDC_SetPositionModulusValue(EQDC_Type *base, uint32_t positionModulusValue) -{ - base->UMOD = (uint16_t)(positionModulusValue >> 16U); - base->LMOD = (uint16_t)(positionModulusValue); -} - -/*! - * @brief Set position counter compare 0 value. - * - * Set the position counter compare 0 value (UCOMP0, LCOMP0). - * After writing values to the UCOMP0 and LCOMP0 registers, the values are "buffered" into outer-set - * registers temporarily. Values will be loaded into inner-set registers and take effect using - * the following two methods: - * 1. If CTRL2[LDMODE] is 1, "buffered" values are loaded into inner-set and take effect - * at the next roll-over or roll-under if CTRL[LDOK] is set. - * 2. If CTRL2[LDMODE] is 0, "buffered" values are loaded into inner-set and take effect - * immediately when CTRL[LDOK] is set. - * - * @param base EQDC peripheral base address - * @param u32PositionComp0Value Position modulus value - */ -static inline void EQDC_SetPositionCompare0Value(EQDC_Type *base, uint32_t u32PositionComp0Value) -{ - base->UCOMP0 = (uint16_t)(u32PositionComp0Value >> 16U); - base->LCOMP0 = (uint16_t)(u32PositionComp0Value); -} - -/*! - * @brief Set position counter compare 1 value. - * - * Set the position counter compare 1 value (UCOMP1, LCOMP1). - * After writing values to the UCOMP1 and LCOMP1 registers, the values are "buffered" into outer-set - * registers temporarily. Values will be loaded into inner-set registers and take effect using - * the following two methods: - * 1. If CTRL2[LDMODE] is 1, "buffered" values are loaded into inner-set and take effect - * at the next roll-over or roll-under if CTRL[LDOK] is set. - * 2. If CTRL2[LDMODE] is 0, "buffered" values are loaded into inner-set and take effect - * immediately when CTRL[LDOK] is set. - * - * @param base EQDC peripheral base address - * @param u32PositionComp1Value Position modulus value - */ -static inline void EQDC_SetPositionCompare1Value(EQDC_Type *base, uint32_t u32PositionComp1Value) -{ - base->UCOMP1 = (uint16_t)(u32PositionComp1Value >> 16U); - base->LCOMP1 = (uint16_t)(u32PositionComp1Value); -} - -/*! - * @brief Set position counter compare 2 value. - * - * Set the position counter compare 2 value (UCOMP2, LCOMP2). - * After writing values to the UCOMP2 and LCOMP2 registers, the values are "buffered" into outer-set - * registers temporarily. Values will be loaded into inner-set registers and take effect using - * the following two methods: - * 1. If CTRL2[LDMODE] is 1, "buffered" values are loaded into inner-set and take effect - * at the next roll-over or roll-under if CTRL[LDOK] is set. - * 2. If CTRL2[LDMODE] is 0, "buffered" values are loaded into inner-set and take effect - * immediately when CTRL[LDOK] is set. - * - * @param base EQDC peripheral base address - * @param u32PositionComp2Value Position modulus value - */ -static inline void EQDC_SetPositionCompare2Value(EQDC_Type *base, uint32_t u32PositionComp2Value) -{ - base->UCOMP2 = (uint16_t)(u32PositionComp2Value >> 16U); - base->LCOMP2 = (uint16_t)(u32PositionComp2Value); -} - -/*! - * @brief Set position counter compare 3 value. - * - * Set the position counter compare 3 value (UCOMP3, LCOMP3). - * After writing values to the UCOMP3 and LCOMP3 registers, the values are "buffered" into outer-set - * registers temporarily. Values will be loaded into inner-set registers and take effect using - * the following two methods: - * 1. If CTRL2[LDMODE] is 1, "buffered" values are loaded into inner-set and take effect - * at the next roll-over or roll-under if CTRL[LDOK] is set. - * 2. If CTRL2[LDMODE] is 0, "buffered" values are loaded into inner-set and take effect - * immediately when CTRL[LDOK] is set. - * - * @param base EQDC peripheral base address - * @param u32PositionComp3Value Position modulus value - */ -static inline void EQDC_SetPositionCompare3Value(EQDC_Type *base, uint32_t u32PositionComp3Value) -{ - base->UCOMP3 = (uint16_t)(u32PositionComp3Value >> 16U); - base->LCOMP3 = (uint16_t)(u32PositionComp3Value); -} - -/*! - * @brief Get the current position counter's value. - * - * @param base EQDC peripheral base address. - * - * @return Current position counter's value. - */ -static inline uint32_t EQDC_GetPosition(EQDC_Type *base) -{ - uint32_t u32Pos; - - u32Pos = base->UPOS; /* Get upper 16 bits and make a snapshot. */ - u32Pos <<= 16U; - u32Pos |= base->LPOSH; /* Get lower 16 bits from hold register. */ - - return u32Pos; -} - -/*! - * @brief Get the hold position counter's value. - * - * The position counter (POS or UPOS, LPOS) value is loaded to hold position (POSH or UPOSH, LPOSH) - * when: - * 1. Position register (POS or UPOS, LPOS), or position difference register (POSD), - * or revolution register (REV) is read. - * 2. TRIGGER happens and TRIGGER is enabled to update the hold registers. - * - * @param base EQDC peripheral base address. - * @return Hold position counter's value. - */ -static inline uint32_t EQDC_GetHoldPosition(EQDC_Type *base) -{ - uint32_t u32Pos; - - u32Pos = base->UPOSH; /* Get upper 16 bits from hold register. */ - u32Pos <<= 16U; - u32Pos |= base->LPOSH; /* Get lower 16 bits from hold register. */ - - return u32Pos; -} - -/*! - * @brief Get the hold position counter1's value. - * - * The Upper Position Counter Hold Register 1(UPOSH1) shares the same address with UCOMP1. - * When read, this register means the value of UPOSH1, which is the upper 16 bits of POSH1. - * The Lower Position Counter Hold Register 1(LPOSH1) shares the same address with LCOMP1. - * When read, this register means the value of LPOSH1, which is the lower 16 bits of POSH1. - * Position counter is captured into POSH1 on the rising edge of ICAP[1]. - * - * @param base EQDC peripheral base address. - * @return Hold position counter1's value. - */ -static inline uint32_t EQDC_GetHoldPosition1(EQDC_Type *base) -{ - uint32_t u32Pos; - - u32Pos = base->UPOSH1; /* Get upper 16 bits from hold register. */ - u32Pos <<= 16U; - u32Pos |= base->LPOSH1; /* Get lower 16 bits from hold register. */ - - return u32Pos; -} - -/*! - * @brief Get the hold position counter2's value. - * - * The Upper Position Counter Hold Register 2(UPOSH2) shares the same address with UCOMP2. - * When read,this register means the value of UPOSH2, which is the upper 16 bits of POSH2. - * The Lower Position Counter Hold Register 2(LPOSH2) shares the same address with LCOMP2. - * When read, this register means the value of LPOSH2, which is the lower 16 bits of POSH2. - * Position counter is captured into POSH2 on the rising edge of ICAP[2]. - * - * @param base EQDC peripheral base address. - * @return Hold position counter2's value. - */ -static inline uint32_t EQDC_GetHoldPosition2(EQDC_Type *base) -{ - uint32_t u32Pos; - - u32Pos = base->UPOSH2; /* Get upper 16 bits from hold register. */ - u32Pos <<= 16U; - u32Pos |= base->LPOSH2; /* Get lower 16 bits from hold register. */ - - return u32Pos; -} - -/*! - * @brief Get the hold position counter3's value. - * - * The Upper Position Counter Hold Register 3(UPOSH3) shares the same address with UCOMP3. - * When read,this register means the value of UPOSH3, which is the upper 16 bits of POSH3. - * The Lower Position Counter Hold Register 3(LPOSH3) shares the same address with LCOMP3. - * When read, this register means the value of LPOSH3, which is the lower 16 bits of POSH3. - * Position counter is captured into POSH3 on the rising edge of ICAP[3]. - * - * @param base EQDC peripheral base address. - * @return Hold position counter3's value. - */ -static inline uint32_t EQDC_GetHoldPosition3(EQDC_Type *base) -{ - uint32_t u32Pos; - - u32Pos = base->UPOSH3; /* Get upper 16 bits from hold register. */ - u32Pos <<= 16U; - u32Pos |= base->LPOSH3; /* Get lower 16 bits from hold register. */ - - return u32Pos; -} - -/*! - * @brief Get the position difference counter's value. - * - * @param base EQDC peripheral base address. - * @return The position difference counter's value. - */ -static inline uint16_t EQDC_GetPositionDifference(EQDC_Type *base) -{ - return base->POSD; -} - -/*! - * @brief Get the hold position difference counter's value. - * - * The position difference (POSD) value is loaded to hold position difference (POSDH) - * when: - * 1. Position register (POS or UPOS, LPOS), or position difference register (POSD), - * or revolution register (REV) is read. When Period Measurement is enabled (CTRL3[PMEN] = 1), - * POSDH will only be udpated when reading POSD. - * 2. TRIGGER happens and TRIGGER is enabled to update the hold registers. - * - * @param base EQDC peripheral base address. - * @return Hold position difference counter's value. - */ -static inline uint16_t EQDC_GetHoldPositionDifference(EQDC_Type *base) -{ - return base->POSDH; -} - -/*! - * @brief Get the revolution counter's value. - * - * Get the revolution counter (REV) value. - * - * @param base EQDC peripheral base address. - * @return The revolution counter's value. - */ -static inline uint16_t EQDC_GetRevolution(EQDC_Type *base) -{ - return base->REV; -} - -/*! - * @brief Get the hold revolution counter's value. - * - * The revolution counter (REV) value is loaded to hold revolution (REVH) - * when: - * 1. Position register (POS or UPOS, LPOS), or position difference register (POSD), - * or revolution register (REV) is read. - * 2. TRIGGER happens and TRIGGER is enabled to update the hold registers. - * - * @param base EQDC peripheral base address. - * @return Hold position revolution counter's value. - */ -static inline uint16_t EQDC_GetHoldRevolution(EQDC_Type *base) -{ - return base->REVH; -} - -/*! - * @brief Get the last edge time. - * - * Last edge time (LASTEDGE) is the time since the last edge occurred on PHASEA or PHASEB. - * The last edge time register counts up using the peripheral clock after prescaler. - * Any edge on PHASEA or PHASEB will reset this register to 0 and start counting. - * If the last edge timer count reaches 0xffff, the counting will stop in order to - * prevent an overflow.Counting will continue when an edge occurs on - * PHASEA or PHASEB. - * - * @param base EQDC peripheral base address. - * - * @return The last edge time. - */ -static inline uint16_t EQDC_GetLastEdgeTime(EQDC_Type *base) -{ - return base->LASTEDGE; -} - -/*! - * @brief Get the hold last edge time. - * - * The hold of last edge time(LASTEDGEH) is update to last edge time(LASTEDGE) - * when the position difference register register (POSD) is read. - * - * @param base EQDC peripheral base address. - * @return Hold of last edge time. - */ -static inline uint16_t EQDC_GetHoldLastEdgeTime(EQDC_Type *base) -{ - return base->LASTEDGEH; -} - -/*! - * @brief Get the Position Difference Period counter value - * - * The Position Difference Period counter (POSDPER) counts up using the - * prescaled peripheral clock. When reading the position difference register(POSD), - * the last edge time (LASTEDGE) will be loaded to position difference period counter(POSDPER). - * If the POSDPER count reaches 0xffff, the counting will stop in order to prevent an - * overflow. Counting will continue when an edge occurs on PHASEA or PHASEB. - * - * @param base EQDC peripheral base address. - * @return The position difference period counter value. - */ -static inline uint16_t EQDC_GetPositionDifferencePeriod(EQDC_Type *base) -{ - return base->POSDPER; -} - -/*! - * @brief Get buffered Position Difference Period counter value - * - * The Bufferd Position Difference Period (POSDPERBFR) value is updated with - * the position difference period counter(POSDPER) when any edge occurs - * on PHASEA or PHASEB. - * - * @param base EQDC peripheral base address. - * @return The buffered position difference period counter value. - */ -static inline uint16_t EQDC_GetBufferedPositionDifferencePeriod(EQDC_Type *base) -{ - return base->POSDPERBFR; -} - -/*! - * @brief Get Hold Position Difference Period counter value - * - * The hold position difference period(POSDPERH) is updated with the value of - * buffered position difference period(POSDPERBFR) when the - * position difference(POSD) register is read. - * - * @param base EQDC peripheral base address. - * @return The hold position difference period counter value. - */ -static inline uint16_t EQDC_GetHoldPositionDifferencePeriod(EQDC_Type *base) -{ - return base->POSDPERH; -} - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ -#endif /* FSL_EQDC_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_erm.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_erm.c deleted file mode 100644 index cdd35b56b09..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_erm.c +++ /dev/null @@ -1,317 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_erm.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.erm" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to ERM bases for each instance. */ -static ERM_Type *const s_ermBases[] = ERM_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to ERM clocks for each instance. */ -static const clock_ip_name_t s_ermClocks[] = ERM_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t ERM_GetInstance(ERM_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_ermBases); instance++) - { - if (s_ermBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_ermBases)); - - return instance; -} - -/*! - * brief ERM module initialization function. - * - * param base ERM base address. - */ -void ERM_Init(ERM_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate ERM clock. */ - CLOCK_EnableClock(s_ermClocks[ERM_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - base->CR0 = 0x00U; -#ifdef ERM_CR1_ENCIE8_MASK - base->CR1 = 0x00U; -#endif - base->SR0 = 0xFFFFFFFFU; -#ifdef ERM_SR1_SBC8_MASK - base->SR1 = 0xFFFFFFFFU; -#endif -} - -/*! - * brief Deinitializes the ERM. - * - */ -void ERM_Deinit(ERM_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate ERM clock. */ - CLOCK_DisableClock(s_ermClocks[ERM_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -uint32_t ERM_GetMemoryErrorAddr(ERM_Type *base, erm_memory_channel_t channel) -{ - uint32_t absoluteErrorAddress = 0x00U; - - switch ((uint8_t)channel) - { - case 0U: - absoluteErrorAddress = base->EAR0; - break; -#ifdef ERM_EAR1_EAR_MASK - case 1U: - absoluteErrorAddress = base->EAR1; - break; -#endif -#ifdef ERM_EAR2_EAR_MASK - case 2U: - absoluteErrorAddress = base->EAR2; - break; -#endif -#ifdef ERM_EAR3_EAR_MASK - case 3U: - absoluteErrorAddress = base->EAR3; - break; -#endif -#ifdef ERM_EAR4_EAR_MASK - case 4U: - absoluteErrorAddress = base->EAR4; - break; -#endif -#ifdef ERM_EAR5_EAR_MASK - case 5U: - absoluteErrorAddress = base->EAR5; - break; -#endif -#ifdef ERM_EAR6_EAR_MASK - case 6U: - absoluteErrorAddress = base->EAR6; - break; -#endif - default: - assert(NULL); - break; - } - - return absoluteErrorAddress; -} - -uint32_t ERM_GetSyndrome(ERM_Type *base, erm_memory_channel_t channel) -{ - uint32_t syndrome = 0x00U; - - switch ((uint8_t)channel) - { - case 0U: - syndrome = (base->SYN0 & ERM_SYN0_SYNDROME_MASK) >> ERM_SYN0_SYNDROME_SHIFT; - break; -#ifdef ERM_SYN1_SYNDROME_MASK - case 1U: - syndrome = (base->SYN1 & ERM_SYN1_SYNDROME_MASK) >> ERM_SYN1_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN2_SYNDROME_MASK - case 2U: - syndrome = (base->SYN2 & ERM_SYN2_SYNDROME_MASK) >> ERM_SYN2_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN3_SYNDROME_MASK - case 3U: - syndrome = (base->SYN3 & ERM_SYN3_SYNDROME_MASK) >> ERM_SYN3_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN4_SYNDROME_MASK - case 4U: - syndrome = (base->SYN4 & ERM_SYN4_SYNDROME_MASK) >> ERM_SYN4_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN5_SYNDROME_MASK - case 5U: - syndrome = (base->SYN5 & ERM_SYN5_SYNDROME_MASK) >> ERM_SYN5_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN6_SYNDROME_MASK - case 6U: - syndrome = (base->SYN6 & ERM_SYN6_SYNDROME_MASK) >> ERM_SYN6_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN7_SYNDROME_MASK - case 7U: - syndrome = (base->SYN7 & ERM_SYN6_SYNDROME_MASK) >> ERM_SYN7_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN8_SYNDROME_MASK - case 8U: - syndrome = (base->SYN8 & ERM_SYN8_SYNDROME_MASK) >> ERM_SYN8_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN9_SYNDROME_MASK - case 8U: - syndrome = (base->SYN9 & ERM_SYN9_SYNDROME_MASK) >> ERM_SYN9_SYNDROME_SHIFT; - break; -#endif - default: - assert(NULL); - break; - } - - return syndrome; -} - -uint32_t ERM_GetErrorCount(ERM_Type *base, erm_memory_channel_t channel) -{ - uint32_t count = 0x00U; - - switch ((uint8_t)channel) - { - case 0U: - count = (base->CORR_ERR_CNT0 & ERM_CORR_ERR_CNT0_COUNT_MASK) >> ERM_CORR_ERR_CNT0_COUNT_SHIFT; - break; -#ifdef ERM_CORR_ERR_CNT1_COUNT_MASK - case 1U: - count = (base->CORR_ERR_CNT1 & ERM_CORR_ERR_CNT1_COUNT_MASK) >> ERM_CORR_ERR_CNT1_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT2_COUNT_MASK - case 2U: - count = (base->CORR_ERR_CNT2 & ERM_CORR_ERR_CNT2_COUNT_MASK) >> ERM_CORR_ERR_CNT2_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT3_COUNT_MASK - case 3U: - count = (base->CORR_ERR_CNT3 & ERM_CORR_ERR_CNT3_COUNT_MASK) >> ERM_CORR_ERR_CNT3_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT4_COUNT_MASK - case 4U: - count = (base->CORR_ERR_CNT4 & ERM_CORR_ERR_CNT4_COUNT_MASK) >> ERM_CORR_ERR_CNT4_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT5_COUNT_MASK - case 5U: - count = (base->CORR_ERR_CNT5 & ERM_CORR_ERR_CNT5_COUNT_MASK) >> ERM_CORR_ERR_CNT5_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT6_COUNT_MASK - case 6U: - count = (base->CORR_ERR_CNT6 & ERM_CORR_ERR_CNT6_COUNT_MASK) >> ERM_CORR_ERR_CNT6_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT7_COUNT_MASK - case 7U: - count = (base->CORR_ERR_CNT7 & ERM_CORR_ERR_CNT7_COUNT_MASK) >> ERM_CORR_ERR_CNT7_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT8_COUNT_MASK - case 8U: - count = (base->CORR_ERR_CNT8 & ERM_CORR_ERR_CNT8_COUNT_MASK) >> ERM_CORR_ERR_CNT8_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT9_COUNT_MASK - case 9U: - count = (base->CORR_ERR_CNT9 & ERM_CORR_ERR_CNT9_COUNT_MASK) >> ERM_CORR_ERR_CNT9_COUNT_SHIFT; - break; -#endif - default: - assert(NULL); - break; - } - - return count; -} - -void ERM_ResetErrorCount(ERM_Type *base, erm_memory_channel_t channel) -{ - switch ((uint8_t)channel) - { - case 0U: - base->CORR_ERR_CNT0 = 0x00U; - break; - -#ifdef ERM_CORR_ERR_CNT1_COUNT_MASK - case 1U: - base->CORR_ERR_CNT1 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT2_COUNT_MASK - case 2U: - base->CORR_ERR_CNT2 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT3_COUNT_MASK - case 3U: - base->CORR_ERR_CNT3 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT4_COUNT_MASK - case 4U: - base->CORR_ERR_CNT4 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT5_COUNT_MASK - case 5U: - base->CORR_ERR_CNT5 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT6_COUNT_MASK - case 6U: - base->CORR_ERR_CNT6 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT6_COUNT_MASK - case 7U: - base->CORR_ERR_CNT7 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT8_COUNT_MASK - case 8U: - base->CORR_ERR_CNT8 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT9_COUNT_MASK - case 9U: - base->CORR_ERR_CNT9 = 0x00U; - break; -#endif - default: - assert(NULL); - break; - } -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_erm.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_erm.h deleted file mode 100644 index 45303523e76..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_erm.h +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_ERM_H_ -#define FSL_ERM_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup erm - * @{ - */ - -/****************************************************************************** - * Definitions. - *****************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief Driver version. */ -#define FSL_ERM_DRIVER_VERSION (MAKE_VERSION(2U, 0U, 1U)) -/*! @} */ - -/*! - * @brief ERM interrupt configuration structure, default settings all disabled, _erm_interrupt_enable. - * - * This structure contains the settings for all of the ERM interrupt configurations. - */ -enum -{ - kERM_SingleCorrectionIntEnable = 0x08U, /*!< Single Correction Interrupt Notification enable.*/ - kERM_NonCorrectableIntEnable = 0x04U, /*!< Non-Correction Interrupt Notification enable.*/ - - kERM_AllInterruptsEnable = 0xFFFFFFFFUL, /*!< All Interrupts enable */ -}; - -/*! - * @brief ERM interrupt status, _erm_interrupt_flag. - * - * This provides constants for the ERM event status for use in the ERM functions. - */ -enum -{ - kERM_SingleBitCorrectionIntFlag = 0x08U, /*!< Single-Bit Correction Event.*/ - kERM_NonCorrectableErrorIntFlag = 0x04U, /*!< Non-Correctable Error Event.*/ - - kERM_AllIntsFlag = 0xFFFFFFFFUL, /*!< All Events. */ -}; - -/******************************************************************************* - * APIs - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and de-initialization - * @{ - */ - -/*! - * @brief ERM module initialization function. - * - * @param base ERM base address. - */ -void ERM_Init(ERM_Type *base); - -/*! - * @brief De-initializes the ERM. - * - */ -void ERM_Deinit(ERM_Type *base); - -/*! @} */ - -/*! - * @name Interrupt - * @{ - */ -/*! - * @brief ERM enable interrupts. - * - * @param base ERM peripheral base address. - * @param channel memory channel. - * @param mask single correction interrupt or non-correction interrupt enable to disable for one specific memory region. - * Refer to "_erm_interrupt_enable" enumeration. - */ -static inline void ERM_EnableInterrupts(ERM_Type *base, erm_memory_channel_t channel, uint32_t mask) -{ - uint32_t temp = 0x00U; - if ((uint32_t)channel <= 0x07U) - { - temp = base->CR0; - base->CR0 = - (temp & ~(0x0CUL << ((0x07U - (uint32_t)channel) * 4U))) | (mask << ((0x07U - (uint32_t)channel) * 4U)); - } -#ifdef ERM_CR1_ESCIE8_MASK - else - { - temp = base->CR1; - base->CR1 = (temp & ~(0x0CUL << ((0x07U + 0x08U - (uint32_t)channel) * 4U))) | - (mask << ((0x07U + 0x08U - (uint32_t)channel) * 4U)); - } -#endif -} - -/*! - * @brief ERM module disable interrupts. - * - * @param base ERM base address. - * @param channel memory channel. - * @param mask single correction interrupt or non-correction interrupt enable to disable for one specific memory region. - * Refer to "_erm_interrupt_enable" enumeration. - */ -static inline void ERM_DisableInterrupts(ERM_Type *base, erm_memory_channel_t channel, uint32_t mask) -{ - if ((uint32_t)channel <= 0x07U) - { - base->CR0 &= ~(mask << ((0x07U - (uint32_t)channel) * 4U)); - } -#ifdef ERM_CR1_ESCIE8_MASK - else - { - base->CR1 &= ~(mask << ((0x07U + 0x08U - (uint32_t)channel) * 4U)); - } -#endif -} - -/*! - * @brief Gets ERM interrupt flags. - * - * @param base ERM peripheral base address. - * @return ERM event flags. - */ -static inline uint32_t ERM_GetInterruptStatus(ERM_Type *base, erm_memory_channel_t channel) -{ - if ((uint32_t)channel <= 0x07U) - { - return ((base->SR0 & (uint32_t)kERM_AllIntsFlag) >> (0x07U - (uint32_t)channel) * 4U); - } -#ifdef ERM_SR1_SBC8_MASK - else - { - return ((base->SR1 & (uint32_t)kERM_AllIntsFlag) >> ((0x07U + 0x08U - (uint32_t)channel) * 4U)); - } -#else - { - return 0; - } -#endif -} - -/*! - * @brief ERM module clear interrupt status flag. - * - * @param base ERM base address. - * @param mask event flag to clear. Refer to "_erm_interrupt_flag" enumeration. - */ -static inline void ERM_ClearInterruptStatus(ERM_Type *base, erm_memory_channel_t channel, uint32_t mask) -{ - if ((uint32_t)channel <= 0x07U) - { - base->SR0 = mask << ((0x07U - (uint32_t)channel) * 4U); - } -#ifdef ERM_SR1_SBC8_MASK - else - { - base->SR1 = mask << ((0x07U + 0x08U - (uint32_t)channel) * 4U); - } -#endif -} - -/*! @} */ - -/*! - * @name functional - * @{ - */ - -/*! - * @brief ERM get memory error absolute address, which capturing the address of the last ECC event in Memory n. - * - * @param base ERM base address. - * @param channel memory channel. - * @retval memory error absolute address. - */ - -uint32_t ERM_GetMemoryErrorAddr(ERM_Type *base, erm_memory_channel_t channel); - -/*! - * @brief ERM get syndrome, which identifies the pertinent bit position on a correctable, single-bit data inversion or a - * non-correctable, single-bit address inversion. The syndrome value does not provide any additional diagnostic - * information on non-correctable, multi-bit inversions. - * - * @param base ERM base address. - * @param channel memory channel. - * @retval syndrome value. - */ -uint32_t ERM_GetSyndrome(ERM_Type *base, erm_memory_channel_t channel); - -/*! - * @brief ERM get error count, which records the count value of the number of correctable ECC error events for Memory - * n. Non-correctable errors are considered a serious fault, so the ERM does not provide any mechanism to count - * non-correctable errors. Only correctable errors are counted. - * - * @param base ERM base address. - * @param channel memory channel. - * @retval error count. - */ -uint32_t ERM_GetErrorCount(ERM_Type *base, erm_memory_channel_t channel); - -/*! - * @brief ERM reset error count. - * - * @param base ERM base address. - * @param channel memory channel. - */ -void ERM_ResetErrorCount(ERM_Type *base, erm_memory_channel_t channel); - -/*! @}*/ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_freqme.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_freqme.c deleted file mode 100644 index 459bbb6f3a0..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_freqme.c +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright 2021-2022 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_freqme.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpc_freqme" -#endif - -#if defined(FREQME_RSTS_N) -#define FREQME_RESETS_ARRAY FREQME_RSTS_N -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -static uint32_t FREQME_GetInstance(FREQME_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Array to map freqme instance number to base address. */ -static FREQME_Type *const s_freqmeBases[] = FREQME_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to FREQME clocks for each instance. */ -static const clock_ip_name_t s_freqmeClocks[] = FREQME_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(FREQME_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_freqmeResets[] = FREQME_RESETS_ARRAY; -#endif -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t FREQME_GetInstance(FREQME_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0U; instance < ARRAY_SIZE(s_freqmeBases); instance++) - { - if (s_freqmeBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_freqmeBases)); - - return instance; -} - -/*! - * brief Initialize freqme module, set operate mode, operate mode attribute and initialize measurement cycle. - * - * param base FREQME peripheral base address. - * param config The pointer to module basic configuration, please refer to freq_measure_config_t. - */ -void FREQME_Init(FREQME_Type *base, const freq_measure_config_t *config) -{ - assert(config); - - uint32_t tmp32 = 0UL; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable FREQME clock. */ - CLOCK_EnableClock(s_freqmeClocks[FREQME_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(FREQME_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_freqmeResets[FREQME_GetInstance(base)]); -#endif - - if (config->startMeasurement) - { - tmp32 |= FREQME_CTRL_W_MEASURE_IN_PROGRESS_MASK; - } - tmp32 |= FREQME_CTRL_W_CONTINUOUS_MODE_EN(config->enableContinuousMode) | - FREQME_CTRL_W_PULSE_MODE(config->operateMode); - if (config->operateMode == kFREQME_FreqMeasurementMode) - { - tmp32 |= FREQME_CTRL_W_REF_SCALE(config->operateModeAttribute.refClkScaleFactor); - } - else - { - tmp32 |= FREQME_CTRL_W_PULSE_POL(config->operateModeAttribute.pulsePolarity); - } - - base->CTRL_W = tmp32; -} - -/*! - * brief Get default configuration. - * - * code - * config->operateMode = kFREQME_FreqMeasurementMode; - * config->operateModeAttribute.refClkScaleFactor = 0U; - * config->enableContinuousMode = false; - * config->startMeasurement = false; - * endcode - * - * param config The pointer to module basic configuration, please refer to freq_measure_config_t. - */ -void FREQME_GetDefaultConfig(freq_measure_config_t *config) -{ - assert(config); - - (void)memset(config, 0, sizeof(*config)); - - config->operateMode = kFREQME_FreqMeasurementMode; - config->operateModeAttribute.refClkScaleFactor = 0U; - config->enableContinuousMode = false; - config->startMeasurement = false; -} - -/*! - * brief Calculate the frequency of selected target clock. - * - * note The formula: Ftarget = (RESULT - 2) * Freference / 2 ^ REF_SCALE. - * - * note This function only useful when the operate mode is selected as frequency measurement mode. - * - * param base FREQME peripheral base address. - * param refClkFrequency The frequency of reference clock. - * return The frequency of target clock, if the output result is 0, please check the module's operate mode. - */ -uint32_t FREQME_CalculateTargetClkFreq(FREQME_Type *base, uint32_t refClkFrequency) -{ - uint32_t measureResult = 0UL; - uint32_t targetFreq = 0UL; - uint64_t tmp64 = 0ULL; - - while ((base->CTRL_R & FREQME_CTRL_R_MEASURE_IN_PROGRESS_MASK) != 0UL) - { - } - - if (!FREQME_CheckOperateMode(base)) - { - measureResult = base->CTRL_R & FREQME_CTRL_R_RESULT_MASK; - tmp64 = ((uint64_t)measureResult - 2ULL) * (uint64_t)refClkFrequency; - targetFreq = (uint32_t)(tmp64 / (1ULL << (uint64_t)FREQME_GetReferenceClkScaleValue(base))); - } - - return targetFreq; -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_freqme.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_freqme.h deleted file mode 100644 index dd1ee29d668..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_freqme.h +++ /dev/null @@ -1,441 +0,0 @@ -/* - * Copyright 2021-2022 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_FREQME_H_ -#define FSL_FREQME_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup lpc_freqme - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief FREQME driver version 2.1.2. */ -#define FSL_FREQME_DRIVER_VERSION (MAKE_VERSION(2, 1, 2)) -/*! @} */ - -/*! - * @brief The enumeration of interrupt status flags. - * @anchor _freqme_interrupt_status_flags - */ -enum _freqme_interrupt_status_flags -{ - kFREQME_UnderflowInterruptStatusFlag = FREQME_CTRLSTAT_LT_MIN_STAT_MASK, /*!< Indicate the measurement is - just done and the result is less - than minimun value. */ - kFREQME_OverflowInterruptStatusFlag = FREQME_CTRLSTAT_GT_MAX_STAT_MASK, /*!< Indicate the measurement is - just done and the result is greater - than maximum value. */ - kFREQME_ReadyInterruptStatusFlag = FREQME_CTRLSTAT_RESULT_READY_STAT_MASK, /*!< Indicate the measurement is - just done and the result is ready to - read. */ - kFREQME_AllInterruptStatusFlags = FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_GT_MAX_STAT_MASK | - FREQME_CTRLSTAT_RESULT_READY_STAT_MASK, /*!< All interrupt - status flags. */ -}; - -/*! - * @brief The enumeration of interrupts, including underflow interrupt, overflow interrupt, - * and result ready interrupt. - * @anchor _freqme_interrupt_enable - */ -enum _freqme_interrupt_enable -{ - kFREQME_UnderflowInterruptEnable = FREQME_CTRL_W_LT_MIN_INT_EN_MASK, /*!< Enable interrupt when the result is - less than minimum value. */ - kFREQME_OverflowInterruptEnable = FREQME_CTRL_W_GT_MAX_INT_EN_MASK, /*!< Enable interrupt when the result is - greater than maximum value. */ - kFREQME_ReadyInterruptEnable = FREQME_CTRL_W_RESULT_READY_INT_EN_MASK, /*!< Enable interrupt when a - measurement completes and the result - is ready. */ -}; - -/*! - * @brief FREQME module operate mode enumeration, including frequency measurement mode - * and pulse width measurement mode. - */ -typedef enum _freqme_operate_mode -{ - kFREQME_FreqMeasurementMode = 0U, /*!< The module works in the frequency measurement mode. */ - kFREOME_PulseWidthMeasurementMode, /*!< The module works in the pulse width measurement mode. */ -} freqme_operate_mode_t; - -/*! - * @brief The enumeration of pulse polarity. - */ -typedef enum _freqme_pulse_polarity -{ - kFREQME_PulseHighPeriod = 0U, /*!< Select high period of the reference clock. */ - kFREQME_PulseLowPeriod, /*!< Select low period of the reference clock. */ -} freqme_pulse_polarity_t; - -/*! - * @brief The union of operate mode attribute. - * @note If the operate mode is selected as frequency measurement mode the member \b refClkScaleFactor should be used, - * if the operate mode is selected as pulse width measurement mode the member \b pulsePolarity should be used. - */ -typedef union _freqme_mode_attribute -{ - uint8_t refClkScaleFactor; /*!< Only useful in frequency measurement operate mode, - used to set the reference clock counter scaling factor. */ - freqme_pulse_polarity_t pulsePolarity; /*!< Only Useful in pulse width measurement operate mode, - used to set period polarity. */ -} freqme_mode_attribute_t; - -/*! - * @brief The structure of freqme module basic configuration, - * including operate mode, operate mode attribute and so on. - */ -typedef struct _freq_measure_config -{ - freqme_operate_mode_t operateMode; /*!< Select operate mode, please refer to @ref freqme_operate_mode_t. */ - freqme_mode_attribute_t operateModeAttribute; /*!< Used to set the attribute of the selected operate mode, if - the operate mode is selected as @ref kFREQME_FreqMeasurementMode - set freqme_mode_attribute_t::refClkScaleFactor, if operate mode is - selected as @ref kFREOME_PulseWidthMeasurementMode, please set - freqme_mode_attribute_t::pulsePolarity. */ - - bool enableContinuousMode; /*!< Enable/disable continuous mode, if continuous mode is enable, - the measurement is performed continuously and the result for the - last completed measurement is available in the result register. */ - bool startMeasurement; -} freq_measure_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Basic Control APIs - * @{ - */ -/*! - * @brief Initialize freqme module, set operate mode, operate mode attribute and initialize measurement cycle. - * - * @param base FREQME peripheral base address. - * @param config The pointer to module basic configuration, please refer to @ref freq_measure_config_t. - */ -void FREQME_Init(FREQME_Type *base, const freq_measure_config_t *config); - -/*! - * @brief Get default configuration. - * - * @code - * config->operateMode = kFREQME_FreqMeasurementMode; - * config->operateModeAttribute.refClkScaleFactor = 0U; - * config->enableContinuousMode = false; - * config->startMeasurement = false; - * @endcode - * - * @param config The pointer to module basic configuration, please refer to @ref freq_measure_config_t. - */ -void FREQME_GetDefaultConfig(freq_measure_config_t *config); - -/*! - * @brief Start frequency or pulse width measurement process. - * - * @param base FREQME peripheral base address. - */ -static inline void FREQME_StartMeasurementCycle(FREQME_Type *base) -{ - uint32_t tmp32; - - tmp32 = base->CTRLSTAT; - tmp32 &= ~(FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_MEASURE_IN_PROGRESS_MASK | - FREQME_CTRLSTAT_GT_MAX_STAT_MASK | FREQME_CTRLSTAT_RESULT_READY_STAT_MASK); - tmp32 |= FREQME_CTRL_W_MEASURE_IN_PROGRESS_MASK; - base->CTRL_W = tmp32; -} - -/*! - * @brief Force the termination of any measurement cycle currently in progress and resets RESULT or just reset - * RESULT if the module in idle state. - * - * @param base FREQME peripheral base address. - */ -static inline void FREQME_TerminateMeasurementCycle(FREQME_Type *base) -{ - uint32_t tmp32; - - tmp32 = base->CTRLSTAT; - tmp32 &= ~(FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_MEASURE_IN_PROGRESS_MASK | - FREQME_CTRLSTAT_GT_MAX_STAT_MASK | FREQME_CTRLSTAT_RESULT_READY_STAT_MASK); - base->CTRL_W = tmp32; -} - -/*! - * @brief Enable/disable Continuous mode. - * - * @param base FREQME peripheral base address. - * @param enable Used to enable/disable continuous mode, - * - \b true Enable Continuous mode. - * - \b false Disable Continuous mode. - */ -static inline void FREQME_EnableContinuousMode(FREQME_Type *base, bool enable) -{ - uint32_t tmp32; - - tmp32 = base->CTRLSTAT; - tmp32 &= ~(FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_CONTINUOUS_MODE_EN_MASK | - FREQME_CTRLSTAT_GT_MAX_STAT_MASK | FREQME_CTRLSTAT_RESULT_READY_STAT_MASK); - if (enable) - { - tmp32 |= FREQME_CTRL_W_CONTINUOUS_MODE_EN_MASK; - } - - base->CTRL_W = tmp32; -} - -/*! - * @brief Check whether continuous mode is enabled. - * - * @param base FREQME peripheral base address. - * @retval True Continuous mode is enabled, the measurement is performed continuously. - * @retval False Continuous mode is disabled. - */ -static inline bool FREQME_CheckContinuousMode(FREQME_Type *base) -{ - return (bool)((base->CTRLSTAT & FREQME_CTRLSTAT_CONTINUOUS_MODE_EN_MASK) != 0UL); -} - -/*! - * @brief Set operate mode of freqme module. - * - * @param base FREQME peripheral base address. - * @param operateMode The operate mode to be set, please refer to @ref freqme_operate_mode_t. - */ -static inline void FREQME_SetOperateMode(FREQME_Type *base, freqme_operate_mode_t operateMode) -{ - uint32_t tmp32; - - tmp32 = base->CTRLSTAT; - tmp32 &= ~(FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_PULSE_MODE_MASK | - FREQME_CTRLSTAT_GT_MAX_STAT_MASK | FREQME_CTRLSTAT_RESULT_READY_STAT_MASK); - if (operateMode == kFREOME_PulseWidthMeasurementMode) - { - tmp32 |= FREQME_CTRL_W_PULSE_MODE_MASK; - } - - base->CTRL_W = tmp32; -} - -/*! - * @brief Check module's operate mode. - * - * @param base FREQME peripheral base address. - * @retval True Pulse width measurement mode. - * @retval False Frequency measurement mode. - */ -static inline bool FREQME_CheckOperateMode(FREQME_Type *base) -{ - return (bool)((base->CTRLSTAT & FREQME_CTRLSTAT_PULSE_MODE_MASK) != 0UL); - -} - -/*! - * @brief Set the minimum expected value for the measurement result. - * - * @param base FREQME peripheral base address. - * @param minValue The minimum value to set, please note that this value is 31 bits width. - */ -static inline void FREQME_SetMinExpectedValue(FREQME_Type *base, uint32_t minValue) -{ - base->MIN = minValue; -} - -/*! - * @brief Set the maximum expected value for the measurement result. - * - * @param base FREQME peripheral base address. - * @param maxValue The maximum value to set, please note that this value is 31 bits width. - */ -static inline void FREQME_SetMaxExpectedValue(FREQME_Type *base, uint32_t maxValue) -{ - base->MAX = maxValue; -} - -/*! @} */ - -/*! - * @name Frequency Measurement Mode Control APIs - * @{ - */ - -/*! - * @brief Calculate the frequency of selected target clock。 - * - * @note The formula: Ftarget = (RESULT - 2) * Freference / 2 ^ REF_SCALE. - * - * @note This function only useful when the operate mode is selected as frequency measurement mode. - * - * @param base FREQME peripheral base address. - * @param refClkFrequency The frequency of reference clock. - * @return The frequency of target clock the unit is Hz, if the output result is 0, please check the module's - * operate mode. - */ -uint32_t FREQME_CalculateTargetClkFreq(FREQME_Type *base, uint32_t refClkFrequency); - -/*! - * @brief Get reference clock scaling factor. - * - * @param base FREQME peripheral base address. - * @return Reference clock scaling factor, the reference count cycle is 2 ^ ref_scale. - */ -static inline uint8_t FREQME_GetReferenceClkScaleValue(FREQME_Type *base) -{ - return (uint8_t)(base->CTRLSTAT & FREQME_CTRLSTAT_REF_SCALE_MASK); -} - -/*! @} */ - -/*! - * @name Pulse Width Measurement Mode Control APIs - * @{ - */ - -/*! - * @brief Set pulse polarity when operate mode is selected as Pulse Width Measurement mode. - * - * @param base FREQME peripheral base address. - * @param pulsePolarity The pulse polarity to be set, please refer to @ref freqme_pulse_polarity_t. - */ -static inline void FREQME_SetPulsePolarity(FREQME_Type *base, freqme_pulse_polarity_t pulsePolarity) -{ - uint32_t tmp32; - - tmp32 = base->CTRLSTAT; - tmp32 &= ~(FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_PULSE_POL_MASK | - FREQME_CTRLSTAT_GT_MAX_STAT_MASK | FREQME_CTRLSTAT_RESULT_READY_STAT_MASK); - - if (pulsePolarity != kFREQME_PulseHighPeriod) - { - tmp32 |= FREQME_CTRL_W_PULSE_POL_MASK; - } - - base->CTRL_W = tmp32; -} - -/*! - * @brief Check pulse polarity when the operate mode is selected as pulse width measurement mode. - * - * @param base FREQME peripheral base address. - * @retval True Low period. - * @retval False High period. - */ -static inline bool FREQME_CheckPulsePolarity(FREQME_Type *base) -{ - return (bool)((base->CTRLSTAT & FREQME_CTRLSTAT_PULSE_POL_MASK) != 0UL); -} - -/*! - * @brief Get measurement result, if operate mode is selected as pulse width measurement mode this function can - * be used to calculate pulse width. - * - * @note Pulse width = counter result / Frequency of target clock. - * - * @param base FREQME peripheral base address. - * @return Measurement result. - */ -static inline uint32_t FREQME_GetMeasurementResult(FREQME_Type *base) -{ - return base->CTRL_R & FREQME_CTRL_R_RESULT_MASK; -} - -/*! @} */ - -/*! - * @name Status Control APIs - * @{ - */ - -/*! - * @brief Get interrupt status flags, such as overflow interrupt status flag, - * underflow interrupt status flag, and so on. - * - * @param base FREQME peripheral base address. - * @return Current interrupt status flags, should be the OR'ed value of @ref _freqme_interrupt_status_flags. - */ -static inline uint32_t FREQME_GetInterruptStatusFlags(FREQME_Type *base) -{ - return (base->CTRLSTAT & (uint32_t)kFREQME_AllInterruptStatusFlags); -} - -/*! - * @brief Clear interrupt status flags. - * - * @param base FREQME peripheral base address. - * @param statusFlags The combination of interrupt status flags to clear, - * should be the OR'ed value of @ref _freqme_interrupt_status_flags. - */ -static inline void FREQME_ClearInterruptStatusFlags(FREQME_Type *base, uint32_t statusFlags) -{ - base->CTRLSTAT |= statusFlags; -} - -/*! @} */ - -/*! - * @name Interrupt Control APIs - * @{ - */ - -/*! - * @brief Enable interrupts, such as result ready interrupt, overflow interrupt and so on. - * - * @param base FREQME peripheral base address. - * @param masks The mask of interrupts to enable, should be the OR'ed value of @ref _freqme_interrupt_enable. - */ -static inline void FREQME_EnableInterrupts(FREQME_Type *base, uint32_t masks) -{ - uint32_t tmp32; - - tmp32 = base->CTRLSTAT; - tmp32 &= ~(FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_LT_MIN_INT_EN_MASK | - FREQME_CTRLSTAT_GT_MAX_STAT_MASK | FREQME_CTRLSTAT_GT_MAX_INT_EN_MASK | - FREQME_CTRLSTAT_RESULT_READY_INT_EN_MASK | FREQME_CTRLSTAT_RESULT_READY_STAT_MASK); - - tmp32 |= masks; - base->CTRL_W = tmp32; -} - -/*! - * @brief Disable interrupts, such as result ready interrupt, overflow interrupt and so on. - * - * @param base FREQME peripheral base address. - * @param masks The mask of interrupts to disable, should be the OR'ed value of @ref _freqme_interrupt_enable. - */ -static inline void FREQME_DisableInterrupts(FREQME_Type *base, uint32_t masks) -{ - uint32_t tmp32; - - tmp32 = base->CTRLSTAT; - tmp32 &= ~(FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_GT_MAX_STAT_MASK | - FREQME_CTRLSTAT_RESULT_READY_STAT_MASK | masks); - - base->CTRL_W = tmp32; -} - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ -#endif /* FSL_FREQME_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_glikey.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_glikey.c deleted file mode 100644 index ee585b8077d..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_glikey.c +++ /dev/null @@ -1,403 +0,0 @@ -/* - * Copyright 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_common.h" -#include "fsl_glikey.h" - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.glikey" -#endif - -#define GLIKEY_SFR_LOCK 0x05u -#define GLIKEY_SFR_UNLOCK 0x0Au - -/* Define to select between write to CTRL0_WR_0 or CTRL1_WR_1 */ -#define WR_EN0 (0x0Fu) -#define WR_EN1 (0xF0u) - -#define WR_EN0_VALUE_SHIFT (0u) -#define WR_EN1_VALUE_SHIFT (16u) - -#define CTRL_SEL_CODEWORD_SHIFT (24u) - -#define WR_0_INIT (0x2u) -#define WR_1_INIT (0x0u) - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -static inline void Glikey_Internal_Set_WR_0(GLIKEY_Type *base, uint32_t value); -static inline void Glikey_Internal_Set_WR_1(GLIKEY_Type *base, uint32_t value); -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * Weak implementation of GLIKEY IRQ, should be re-defined by user when using GLIKEY IRQ - -__WEAK void GLIKEY0_DriverIRQHandler(void) -{ - GLIKEY generates IRQ until corresponding bit in STATUS is cleared by calling - GLIKEY_ClearStatusFlags(); -} -*/ - -static inline void Glikey_Internal_Set_WR_0(GLIKEY_Type *base, uint32_t value) -{ - uint32_t ctrl0 = ((GLIKEY_Type *)base)->CTRL_0; - - /* Clear WR_0 */ - ctrl0 = ctrl0 & (~GLIKEY_CTRL_0_WR_EN_0_MASK); - - /* Assign value */ - ((GLIKEY_Type *)base)->CTRL_0 = ctrl0 | GLIKEY_CTRL_0_WR_EN_0(value); -} - -static inline void Glikey_Internal_Set_WR_1(GLIKEY_Type *base, uint32_t value) -{ - uint32_t ctrl1 = ((GLIKEY_Type *)base)->CTRL_1; - - /* Clear WR_1 */ - ctrl1 = ctrl1 & (~GLIKEY_CTRL_1_WR_EN_1_MASK); - - /* Assign value */ - ((GLIKEY_Type *)base)->CTRL_1 = ctrl1 | GLIKEY_CTRL_1_WR_EN_1(value); -} - -uint32_t GLIKEY_GetStatus(GLIKEY_Type *base) -{ - return ((GLIKEY_Type *)base)->STATUS; -} - -status_t GLIKEY_IsLocked(GLIKEY_Type *base) -{ - status_t retCode = GLIKEY_CheckLock(base); - if (kStatus_GLIKEY_NotLocked == retCode) - { - return kStatus_GLIKEY_NotLocked; - } - else - { - return kStatus_GLIKEY_Locked; - } -} - -status_t GLIKEY_CheckLock(GLIKEY_Type *base) -{ - uint32_t sfrLock = (((GLIKEY_Type *)base)->CTRL_1 & GLIKEY_CTRL_1_SFR_LOCK_MASK) >> GLIKEY_CTRL_1_SFR_LOCK_SHIFT; - - if (GLIKEY_SFR_UNLOCK != sfrLock) /* Locked */ - { - return kStatus_GLIKEY_LockedError; - } - - return kStatus_GLIKEY_NotLocked; -} - -#if defined(GLIKEY_VERSION_FSM_CONFIG) -status_t GLIKEY_GetVersion(GLIKEY_Type *base, uint32_t *result) -{ - *result = ((GLIKEY_Type *)base)->VERSION; - - return kStatus_Success; -} -#endif - -status_t GLIKEY_SyncReset(GLIKEY_Type *base) -{ - status_t retCode = GLIKEY_CheckLock(base); - if (kStatus_GLIKEY_NotLocked != retCode) - { - return retCode; - } - - /* Set CTRL_0.SFT_RST = 1 */ - ((GLIKEY_Type *)base)->CTRL_0 |= GLIKEY_CTRL_0_SFT_RST_MASK; - - return kStatus_Success; -} - -status_t GLIKEY_SetIntEnable(GLIKEY_Type *base, uint32_t value) -{ - status_t retCode = GLIKEY_CheckLock(base); - if (kStatus_GLIKEY_NotLocked != retCode) - { - return retCode; - } - - ((GLIKEY_Type *)base)->INTR_CTRL = GLIKEY_INTR_CTRL_INT_EN(value); - - return kStatus_Success; -} - -status_t GLIKEY_GetIntEnable(GLIKEY_Type *base, uint32_t *value) -{ - *value = ((GLIKEY_Type *)base)->INTR_CTRL & GLIKEY_INTR_CTRL_INT_EN_MASK; - - return kStatus_Success; -} - -status_t GLIKEY_ClearIntStatus(GLIKEY_Type *base) -{ - status_t retCode = GLIKEY_CheckLock(base); - if (kStatus_GLIKEY_NotLocked != retCode) - { - return retCode; - } - - ((GLIKEY_Type *)base)->INTR_CTRL |= GLIKEY_INTR_CTRL_INT_CLR_MASK; - - return kStatus_Success; -} - -status_t GLIKEY_SetIntStatus(GLIKEY_Type *base) -{ - status_t retCode = GLIKEY_CheckLock(base); - if (kStatus_GLIKEY_NotLocked != retCode) - { - return retCode; - } - - ((GLIKEY_Type *)base)->INTR_CTRL |= GLIKEY_INTR_CTRL_INT_SET_MASK; - - return kStatus_Success; -} - -status_t GLIKEY_Lock(GLIKEY_Type *base) -{ - /* Check if SFR_LOCK is locked */ - status_t retCode = GLIKEY_CheckLock(base); - if (kStatus_GLIKEY_NotLocked != retCode) /* Glikey is not locked -> lock */ - { - uint32_t ctrl1 = ((GLIKEY_Type *)base)->CTRL_1; - /* Clear SFR_LOCK */ - ctrl1 = ctrl1 & (~GLIKEY_CTRL_1_SFR_LOCK_MASK); - /* Lock Gliekey */ - ((GLIKEY_Type *)base)->CTRL_1 = ctrl1 | GLIKEY_CTRL_1_SFR_LOCK(GLIKEY_SFR_LOCK); - } - - return kStatus_Success; -} - -status_t GLIKEY_IsIndexLocked(GLIKEY_Type *base, uint32_t index) -{ - /* Set CTRL_1.READ_INDEX = index */ - uint32_t ctr1Val = ((GLIKEY_Type *)base)->CTRL_1; - /* Clear READ_INDEX */ - ctr1Val = ctr1Val & (~GLIKEY_CTRL_1_READ_INDEX_MASK); - /* Set index value */ - ((GLIKEY_Type *)base)->CTRL_1 = ctr1Val | GLIKEY_CTRL_1_READ_INDEX(index); - - /* Check ERROR_STATUS */ - if (0u != (GLIKEY_GetStatus(base) & GLIKEY_STATUS_ERROR_STATUS_MASK)) - { - return kStatus_Fail; - } - - /* Check if STATUS.LOCK_STATUS is 0 */ - if (0u == (GLIKEY_GetStatus(base) & GLIKEY_STATUS_LOCK_STATUS_MASK)) - { - return kStatus_GLIKEY_NotLocked; - } - else - { - return kStatus_GLIKEY_Locked; - } -} - -status_t GLIKEY_LockIndex(GLIKEY_Type *base) -{ - /* Check if Glikey SFR locked */ - status_t retCode = GLIKEY_CheckLock(base); - if (kStatus_GLIKEY_NotLocked != retCode) - { - return retCode; - } - - /* Check if FSM is in WR_EN state */ - uint32_t state = (GLIKEY_GetStatus(base) & GLIKEY_STATUS_FSM_STATE_MASK) >> GLIKEY_STATUS_FSM_STATE_SHIFT; - if (GLIKEY_FSM_WR_EN == state) - { - /* Set WR_EN0 = b11 */ - ((GLIKEY_Type *)base)->CTRL_0 |= GLIKEY_CTRL_0_WR_EN_0(0x3u); - return kStatus_GLIKEY_Locked; - } - else - { - return kStatus_GLIKEY_DisabledError; - } -} - -status_t GLIKEY_StartEnable(GLIKEY_Type *base, uint32_t index) -{ - /* Check if Glikey SFR locked */ - status_t retCode = GLIKEY_CheckLock(base); - if (kStatus_GLIKEY_NotLocked != retCode) - { - return retCode; - } - - /* Check if index is locked */ - retCode = GLIKEY_IsIndexLocked(base, index); - if (kStatus_GLIKEY_NotLocked != retCode) - { - return retCode; - } - - /* CTRL0 */ - uint32_t ctrl0 = ((GLIKEY_Type *)base)->CTRL_0; - /* Clear old index */ - ctrl0 = ctrl0 & (~GLIKEY_CTRL_0_WRITE_INDEX_MASK); - /* Clear old CTRL0.WR_EN_0 */ - ctrl0 = ctrl0 & (~GLIKEY_CTRL_0_WR_EN_0_MASK); - /* Set new index */ - ctrl0 |= GLIKEY_CTRL_0_WRITE_INDEX(index); - - /* Start the enable process by writting 0x01 to CTRL0.WR_EN_0 */ - ctrl0 = ctrl0 | ((uint32_t)0x01u << GLIKEY_CTRL_0_WR_EN_0_SHIFT); - - /* Write to CTRL0 (new index and WR_EN_0 = 0x01) */ - ((GLIKEY_Type *)base)->CTRL_0 = ctrl0; - - /* CTRL1 */ - uint32_t ctrl1 = ((GLIKEY_Type *)base)->CTRL_1; - /* Clear CTRL1.WR_EN_1 */ - ctrl1 &= ~GLIKEY_CTRL_1_WR_EN_1_MASK; - ((GLIKEY_Type*)base)->CTRL_1 = ctrl1; - - return kStatus_Success; -} - -status_t GLIKEY_ContinueEnable(GLIKEY_Type *base, uint32_t codeword) -{ - /* Check if Glikey SFR locked */ - status_t retCode = GLIKEY_CheckLock(base); - if (kStatus_GLIKEY_NotLocked != retCode) - { - return retCode; - } - - /* Set correctly we_en0 and wr_en1 according to codeword */ - /* Select between CTRL0/CTRL1 */ - if (WR_EN1 == (codeword >> CTRL_SEL_CODEWORD_SHIFT)) - { - Glikey_Internal_Set_WR_1(base, codeword >> WR_EN1_VALUE_SHIFT); - } - else if (WR_EN0 == (codeword >> CTRL_SEL_CODEWORD_SHIFT)) - { - Glikey_Internal_Set_WR_0(base, codeword >> WR_EN0_VALUE_SHIFT); - } - else - { - return kStatus_Fail; - } - - if (0u != (GLIKEY_GetStatus(base) & GLIKEY_STATUS_ERROR_STATUS_MASK)) - { - return kStatus_GLIKEY_DisabledError; - } - - /* Validate codeword - check if XXYZ^UUVW == 0xFFFF */ - if (0xFFFFu != (((codeword) ^ (codeword >> 16u)) & 0xFFFFu)) - { - return kStatus_Fail; - } - - return kStatus_Success; -} - -status_t GLIKEY_EndOperation(GLIKEY_Type *base) -{ - /* Check if Glikey SFR locked */ - status_t retCode = GLIKEY_CheckLock(base); - if (kStatus_GLIKEY_NotLocked != retCode) - { - return retCode; - } - - // check state - uint32_t state = (GLIKEY_GetStatus(base) & GLIKEY_STATUS_FSM_STATE_MASK) >> GLIKEY_STATUS_FSM_STATE_SHIFT; - - switch (state) - { - case GLIKEY_FSM_LOCKED: - { - /* If locked -> try to go to init with wr_en0 = WR_0_INIT (0x02); wr_en1 = WR_1_INIT (0x00) */ - Glikey_Internal_Set_WR_0(base, WR_0_INIT); - Glikey_Internal_Set_WR_1(base, WR_1_INIT); - - /* if still locked return locked - need to change index */ - if (GLIKEY_FSM_LOCKED == - (GLIKEY_GetStatus(base) & GLIKEY_STATUS_FSM_STATE_MASK) >> GLIKEY_STATUS_FSM_STATE_SHIFT) - { - return kStatus_GLIKEY_Locked; - } - - retCode = kStatus_Success; - break; - } - - case GLIKEY_FSM_SSR_RESET: - case GLIKEY_FSM_WR_EN: - { - /* If FSM in RESET -> wr_en0 = WR_0_INIT; wr_en1 = WR_1_INIT */ - /* If FSM in WR_EN -> wr_en0 = WR_0_INIT; wr_en1 = WR_1_INIT */ - Glikey_Internal_Set_WR_0(base, WR_0_INIT); - Glikey_Internal_Set_WR_1(base, WR_1_INIT); - - retCode = kStatus_Success; - break; - } - - default: - /* Disabled error */ - retCode = kStatus_GLIKEY_DisabledError; - break; - } - - return retCode; -} - -status_t GLIKEY_ResetIndex(GLIKEY_Type *base, uint32_t index) -{ - /* Check if Glikey SFR locked */ - status_t retCode = GLIKEY_CheckLock(base); - if (kStatus_GLIKEY_NotLocked != retCode) - { - return retCode; - } - - /* Check if index is locked */ - retCode = GLIKEY_IsIndexLocked(base, index); - if (kStatus_GLIKEY_NotLocked != retCode) - { - return retCode; - } - - /* Check if FSM is in INIT state */ - uint32_t state = (GLIKEY_GetStatus(base) & GLIKEY_STATUS_FSM_STATE_MASK) >> GLIKEY_STATUS_FSM_STATE_SHIFT; - if (GLIKEY_FSM_INIT == state) - { - /* CTRL0.WRITE_INDEX = index */ - uint32_t ctrl0 = ((GLIKEY_Type *)base)->CTRL_0; - /* Clear index */ - ctrl0 = ctrl0 & (~GLIKEY_CTRL_0_WRITE_INDEX_MASK); - /* Write new value */ - ((GLIKEY_Type *)base)->CTRL_0 = ctrl0 | GLIKEY_CTRL_0_WRITE_INDEX(index); - - return kStatus_Success; - } - else - { - return kStatus_GLIKEY_DisabledError; - } -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_glikey.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_glikey.h deleted file mode 100644 index 795d6d56ce9..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_glikey.h +++ /dev/null @@ -1,311 +0,0 @@ -/* - * Copyright 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef _FSL_GLIKEY_H_ -#define _FSL_GLIKEY_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup GLIKEY - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief Defines GLIKEY driver version 2.0.0. - * - * Change log: - * - Version 2.0.0 - * - Initial version - */ -#define FSL_GLIKEY_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) - -enum -{ - kStatus_GLIKEY_LockedError = - MAKE_STATUS(kStatusGroup_GLIKEY, 0x1u), /*!< GLIKEY status for locked SFR registers (unexpected) . */ - kStatus_GLIKEY_NotLocked = MAKE_STATUS(kStatusGroup_GLIKEY, 0x2u), /*!< GLIKEY status for unlocked SFR registers. */ - kStatus_GLIKEY_Locked = MAKE_STATUS(kStatusGroup_GLIKEY, 0x3u), /*!< GLIKEY status for locked SFR registers. */ - kStatus_GLIKEY_DisabledError = MAKE_STATUS(kStatusGroup_GLIKEY, 0x4u), /*!< GLIKEY status for disabled error. */ -}; - -/* [Design] - Value: XX YZ UU VW - - XX: F0: write to WR_EN1, 0F: do not write to WR_EN1 - - UU: F0: write to WR_EN0, 0F: do not write to WR_EN0 - - Y: equal to ^ W - - Z: value to write to WR_EN1 or equal to ~W - - V: equal to ^ Z - - W: value to write to WR_EN0 or equal to ~Z - Invariant: XXYZ ^ UUVW == 0xFFFF -*/ -#define GLIKEY_CODEWORD_STEP1 ((uint32_t)0xF0C10F3EU) /*< Codeword for transition from STEP1 --> STEP2 */ -#define GLIKEY_CODEWORD_STEP2 ((uint32_t)0x0F1DF0E2U) /*< Codeword for transition from STEP2 --> STEP3 */ -#define GLIKEY_CODEWORD_STEP3 ((uint32_t)0xF0B00F4FU) /*< Codeword for transition from STEP3 --> STEP4 */ -#define GLIKEY_CODEWORD_STEP4 ((uint32_t)0x0F4EF0B1U) /*< Codeword for transition from STEP4 --> STEP5 */ -#define GLIKEY_CODEWORD_STEP5 ((uint32_t)0xF0810F7EU) /*< Codeword for transition from STEP5 --> STEP6 */ -#define GLIKEY_CODEWORD_STEP6 ((uint32_t)0x0F5DF0A2U) /*< Codeword for transition from STEP6 --> STEP7 */ -#define GLIKEY_CODEWORD_STEP7 ((uint32_t)0xF0700F8FU) /*< Codeword for transition from STEP7 --> STEP8 */ -#define GLIKEY_CODEWORD_STEP_EN ((uint32_t)0x0FFFF000U) /*< Codeword for transition from STEP 4/8 --> WR_EN */ - -#define GLIKEY_FSM_WR_DIS 0x0Bu -#define GLIKEY_FSM_INIT 0x16u -#define GLIKEY_FSM_STEP1 0x2Cu -#define GLIKEY_FSM_STEP2 0x58u -#define GLIKEY_FSM_STEP3 0xB0u -#define GLIKEY_FSM_STEP4 0x160u -#define GLIKEY_FSM_LOCKED 0xC01u -#define GLIKEY_FSM_WR_EN 0x1802u -#define GLIKEY_FSM_SSR_RESET 0x1005u - -/*@}*/ - -/******************************************************************************* - * API - *******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name GLIKEY Functional Operation - * @{ - */ - -/*! - * @brief Retreives the current status of Glikey. - * - * @param[in] base The base address of the Glikey instance - * - * @return Glikey status information - */ -uint32_t GLIKEY_GetStatus(GLIKEY_Type *base); - -/*! - * @brief Get if Glikey is locked - * - * This operation returns the locking status of Glikey. - * - * @return Status - * @retval kStatus_GLIKEY_Locked if locked - * @retval kStatus_GLIKEY_NotLocked if unlocked - */ -status_t GLIKEY_IsLocked(GLIKEY_Type *base); - -/*! - * @brief Check if Glikey is locked - * - * This operation returns the locking status of Glikey. - * - * @return Status kStatus_Success if success - * @retval kStatus_GLIKEY_LockedError if locked - * @retval kStatus_GLIKEY_NotLocked if unlocked - */ -status_t GLIKEY_CheckLock(GLIKEY_Type *base); - -/*! - * @brief Retreives the version and configuration of Glikey. - * - * - * @param[in] base The base address of the Glikey instance - * @param[out] result Pointer which will be filled with the Glikey hardware version - * - * @return Status kStatus_Success if success - */ -status_t GLIKEY_GetVersion(GLIKEY_Type *base, uint32_t *result); - -/*! - * @brief Perform a synchronous reset of Glikey. - * - * This function performs a synchrounous reset of the Glikey. This results in: - * - Glikey will return to the INIT state, unless it is in the LOCK state - * - * @param[in] base The base address of the Glikey instance - * - * @return Status kStatus_Success if success - * Possible errors: kStatus_GLIKEY_LockedError - */ -status_t GLIKEY_SyncReset(GLIKEY_Type *base); - -/*! - * @brief Set interrupt enable flag of Glikey. - * - * @param[in] base The base address of the Glikey instance - * @param[in] value Value to set the interrupt enable flag to, see #[TODO: add reference to constants] - * - * @return Status kStatus_Success if success - * Possible errors: kStatus_GLIKEY_LockedError - */ -status_t GLIKEY_SetIntEnable(GLIKEY_Type *base, uint32_t value); - -/*! - * @brief Get interrupt enable flag of Glikey. - * - * @param[in] base The base address of the Glikey instance - * @param[out] value Pointer which will be filled with the interrupt enable status, see #[TODO: add reference to - * constants] - * - * @return Status kStatus_Success if success - */ -status_t GLIKEY_GetIntEnable(GLIKEY_Type *base, uint32_t *value); - -/*! - * @brief Clear the interrupt status flag of Glikey. - * - * @param[in] base The base address of the Glikey instance - * - * @return Status kStatus_Success if success - * Possible errors: kStatus_GLIKEY_LockedError - */ -status_t GLIKEY_ClearIntStatus(GLIKEY_Type *base); - -/*! - * @brief Set the interrupt status flag of Glikey. - * - * @param[in] base The base address of the Glikey instance - * - * @return Status kStatus_Success if success - * Possible errors: kStatus_GLIKEY_LockedError - */ -status_t GLIKEY_SetIntStatus(GLIKEY_Type *base); - -/*! - * @brief Lock Glikey SFR (Special Function Registers) interface - * - * This operation locks the Glikey SFR interface if it is not locked yet. - * - * @param[in] base The base address of the Glikey instance - * - * @return Status kStatus_Success if success - */ -status_t GLIKEY_Lock(GLIKEY_Type *base); - -/*! - * @brief Lock Glikey index - * - * This operation is used to lock a Glikey index. It can only be executed from the WR_EN state, - * executing it from any other state will result in Glikey entering WR_DIS state. When this happens - * Glikey requires a reset (synchrous or asynchronous) to go back to INIT state. - * If the Glikey SFR lock is active this operation will return an error. - * - * @param[in] base The base address of the Glikey instance - * - * @return Status kStatus_Success if success - * Possible errors: kStatus_GLIKEY_LockedError, kStatus_GLIKEY_DisabledError - */ -status_t GLIKEY_LockIndex(GLIKEY_Type *base); - -/*! - * @brief Check if Glikey index is locked - * - * This operation returns the locking status of Glikey index. - * - * @param[in] base The base address of the Glikey instance - * @param[in] index The index of the Glikey instance - * - * @return kStatus_GLIKEY_Locked if locked, kStatus_GLIKEY_NotLocked if unlocked - * Possible errors: kStatus_Fail - */ -status_t GLIKEY_IsIndexLocked(GLIKEY_Type *base, uint32_t index); - -/** - * @brief Start Glikey enable - * - * This operation is used to set a new index and start a the sequence to enable it. It needs to be - * started from the INIT state. If the new index is already locked Glikey will go to LOCKED state, - * otherwise it will go to STEP1 state. - * If this operation is used when Glikey is in any state other than INIT Glikey will go to WR_DIS - * state. It can only recover from this state through a reset (synchrounous or asyncrhonous). - * If the Glikey SFR lock is active this operation will return an error. - * - * @param[in] base The base address of the Glikey instance - * @param[in] index The index of the Glikey instance - * - * @return Status kStatus_Success if success - * Possible errors: kStatus_GLIKEY_LockedError, kStatus_Fail - */ -status_t GLIKEY_StartEnable(GLIKEY_Type *base, uint32_t index); - -/** - * @brief Continue Glikey enable - * - * This operation is used to progress through the different states of the state machine, starting - * from STEP1 until the state WR_EN is reached. Each next state of the state machine can only be - * reached by providing the right codeword to this function. If anything goes wrong the state machine - * will go to WR_DIS state and can only recover from it through a reset (synchrous or asynchronous). - * If the Glikey SFR lock is active this operation will return an error. - * - * @param[in] base The base address of the Glikey instance - * @param[in] codeword Encoded word for progressing to next FSM state (see GLIKEY_CODEWORD_STEPx/EN) - * - * @return Status kStatus_Success if success - * Possible errors: kStatus_GLIKEY_LockedError, kStatus_Fail, kStatus_GLIKEY_DisabledError - */ -/* [Design] - - Check if Glikey is locked - if ( GLIKEY_LOCKED == GLIKEY_GET_SFR_LOCK(base) ) return NXPCLGLIKEY_STATUS_LOCKED_ERROR - - Decode the codeword and write to Glikey CTRL[] - Write GLIKEY_CTRL(base, EnableSelect, EnableValue) - - Check if an error occured - - the only possible error here is FSM error which results in a transition to WR_DIS state - - alternatively this can be confirmed by checking FSM state value - - Only now we will check if the codeword itself is valid - - this is done in this order to assure that the state machine reaches WR_DIS state when needed - - check if XXYZ^UUVW == 0xFFFF and return kStatus_Fail when it fails - - Return kStatus_Success -*/ -status_t GLIKEY_ContinueEnable(GLIKEY_Type *base, uint32_t codeword); - -/** - * @brief End Glikey operation - * - * This operation is used to end a Glikey operation. It can only be executed from the WR_EN, LOCKED - * and RESET states. Executing it from any other state will result in Glikey entering WR_DIS state. - * When this happens Glikey requires a reset (synchrous or asynchronous) to go back to INIT state. - * After this operation Glikey will go to INIT state or stay in LOCKED state when the index was locked. - * If the Glikey SFR lock is active this operation will return an error. - * - * @return A code-flow protected error code (see @ref nxpCsslFlowProtection) - * - * @param[in] base The base address of the Glikey instance - * - * @return Status kStatus_Success if success, kStatus_GLIKEY_Locked if index is still locked - * Possible errors: kStatus_GLIKEY_LockedError, kStatus_GLIKEY_DisabledError - */ -status_t GLIKEY_EndOperation(GLIKEY_Type *base); - -/** - * @brief Reset Glikey index - * - * This operation is used to reset a Glikey index. It can only be executed from the INIT state, - * executing it from any other state will result in Glikey entering WR_DIS state. When this happens - * Glikey requires a reset (synchrous or asynchronous) to go back to INIT state. - * If the Glikey SFR lock is active or the index is locked this operation will return an error. - * - * @return A code-flow protected error code (see @ref nxpCsslFlowProtection) - * - * @return Status kStatus_Success if success, kStatus_GLIKEY_Locked if index is still locked - * Possible errors: kStatus_GLIKEY_LockedError, kStatus_GLIKEY_DisabledError - */ -status_t GLIKEY_ResetIndex(GLIKEY_Type *base, uint32_t index); - -/*! @}*/ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @}*/ /* end of group glikey */ - -#endif /* _FSL_GLIKEY_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_gpio.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_gpio.c deleted file mode 100644 index 3e32730d1cd..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_gpio.c +++ /dev/null @@ -1,444 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2019, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_gpio.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.gpio" -#endif - -#if defined(GPIO_RSTS) -#define GPIO_RESETS_ARRAY GPIO_RSTS -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ - -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -static PORT_Type *const s_portBases[] = PORT_BASE_PTRS; -static GPIO_Type *const s_gpioBases[] = GPIO_BASE_PTRS; -#else -#if defined(GPIO_RESETS_ARRAY) -static GPIO_Type *const s_gpioBases[] = GPIO_BASE_PTRS; -#endif -#endif - -#if defined(FSL_FEATURE_SOC_FGPIO_COUNT) && FSL_FEATURE_SOC_FGPIO_COUNT - -#if defined(FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL) && FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Array to map FGPIO instance number to clock name. */ -static const clock_ip_name_t s_fgpioClockName[] = FGPIO_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#endif /* FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL */ - -#endif /* FSL_FEATURE_SOC_FGPIO_COUNT */ - -#if defined(GPIO_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_gpioResets[] = GPIO_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -/*! - * @brief Gets the GPIO instance according to the GPIO base - * - * @param base GPIO peripheral base pointer(PTA, PTB, PTC, etc.) - * @retval GPIO instance - */ -static uint32_t GPIO_GetInstance(GPIO_Type *base); -#endif -/******************************************************************************* - * Code - ******************************************************************************/ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) || defined(GPIO_RESETS_ARRAY) -static uint32_t GPIO_GetInstance(GPIO_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_gpioBases); instance++) - { - if (s_gpioBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_gpioBases)); - - return instance; -} -#endif -/*! - * brief Initializes a GPIO pin used by the board. - * - * To initialize the GPIO, define a pin configuration, as either input or output, in the user file. - * Then, call the GPIO_PinInit() function. - * - * This is an example to define an input pin or an output pin configuration. - * code - * Define a digital input pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalInput, - * 0, - * } - * Define a digital output pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalOutput, - * 0, - * } - * endcode - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * param pin GPIO port pin number - * param config GPIO pin configuration pointer - */ -void GPIO_PinInit(GPIO_Type *base, uint32_t pin, const gpio_pin_config_t *config) -{ - assert(NULL != config); - -#if defined(GPIO_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_gpioResets[GPIO_GetInstance(base)]); -#endif - - if (config->pinDirection == kGPIO_DigitalInput) - { - base->PDDR &= GPIO_FIT_REG(~(1UL << pin)); - } - else - { - GPIO_PinWrite(base, pin, config->outputLogic); - base->PDDR |= GPIO_FIT_REG((1UL << pin)); - } -} - -#if defined(FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER) && FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER -void GPIO_GetVersionInfo(GPIO_Type *base, gpio_version_info_t *info) -{ - info->feature = (uint16_t)base->VERID; - info->minor = (uint8_t)(base->VERID >> GPIO_VERID_MINOR_SHIFT); - info->major = (uint8_t)(base->VERID >> GPIO_VERID_MAJOR_SHIFT); -} -#endif /* FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER */ - -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -/*! - * brief Reads the GPIO port interrupt status flag. - * - * If a pin is configured to generate the DMA request, the corresponding flag - * is cleared automatically at the completion of the requested DMA transfer. - * Otherwise, the flag remains set until a logic one is written to that flag. - * If configured for a level sensitive interrupt that remains asserted, the flag - * is set again immediately. - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * retval The current GPIO port interrupt status flag, for example, 0x00010001 means the - * pin 0 and 17 have the interrupt. - */ -uint32_t GPIO_PortGetInterruptFlags(GPIO_Type *base) -{ - uint8_t instance; - PORT_Type *portBase; - instance = (uint8_t)GPIO_GetInstance(base); - portBase = s_portBases[instance]; - return portBase->ISFR; -} -#else -/*! - * brief Read the GPIO interrupt status flags. - * - * param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on.) - * return The current GPIO's interrupt status flag. - * '1' means the related pin's flag is set, '0' means the related pin's flag not set. - * For example, the return value 0x00010001 means the pin 0 and 17 have the interrupt pending. - */ -uint32_t GPIO_GpioGetInterruptFlags(GPIO_Type *base) -{ - return base->ISFR[0]; -} -#if (defined(FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) && FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) -/*! - * brief Read the GPIO interrupt status flags based on selected interrupt channel(IRQS). - * param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on.) - * param channel '0' means selete interrupt channel 0, '1' means selete interrupt channel 1. - * - * return The current GPIO's interrupt status flag based on the selected interrupt channel. - * '1' means the related pin's flag is set, '0' means the related pin's flag not set. - * For example, the return value 0x00010001 means the pin 0 and 17 have the interrupt pending. - */ -uint32_t GPIO_GpioGetInterruptChannelFlags(GPIO_Type *base, uint32_t channel) -{ - assert(channel < 2U); - return base->ISFR[channel]; -} -#endif /* FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT */ -/*! - * brief Read individual pin's interrupt status flag. - * - * param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on) - * param pin GPIO specific pin number. - * return The current selected pin's interrupt status flag. - */ -uint8_t GPIO_PinGetInterruptFlag(GPIO_Type *base, uint32_t pin) -{ - return (uint8_t)((base->ICR[pin] & GPIO_ICR_ISF_MASK) >> GPIO_ICR_ISF_SHIFT); -} -#endif /* FSL_FEATURE_PORT_HAS_NO_INTERRUPT */ - -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -/*! - * brief Clears multiple GPIO pin interrupt status flags. - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * param mask GPIO pin number macro - */ -void GPIO_PortClearInterruptFlags(GPIO_Type *base, uint32_t mask) -{ - uint8_t instance; - PORT_Type *portBase; - instance = (uint8_t)GPIO_GetInstance(base); - portBase = s_portBases[instance]; - portBase->ISFR = mask; -} -#else -/*! - * brief Clears GPIO pin interrupt status flags. - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * param mask GPIO pin number macro - */ -void GPIO_GpioClearInterruptFlags(GPIO_Type *base, uint32_t mask) -{ - base->ISFR[0] = GPIO_FIT_REG(mask); -} -#if (defined(FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) && FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) -/*! - * brief Clears GPIO pin interrupt status flags based on selected interrupt channel(IRQS). - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * param mask GPIO pin number macro - * param channel '0' means selete interrupt channel 0, '1' means selete interrupt channel 1. - */ -void GPIO_GpioClearInterruptChannelFlags(GPIO_Type *base, uint32_t mask, uint32_t channel) -{ - assert(channel < 2U); - base->ISFR[channel] = GPIO_FIT_REG(mask); -} -#endif /* FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT */ -/*! - * brief Clear GPIO individual pin's interrupt status flag. - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on). - * param pin GPIO specific pin number. - */ -void GPIO_PinClearInterruptFlag(GPIO_Type *base, uint32_t pin) -{ - base->ICR[pin] |= GPIO_FIT_REG(GPIO_ICR_ISF(1U)); -} -#endif /* FSL_FEATURE_PORT_HAS_NO_INTERRUPT */ - -#if defined(FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER) && FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER -/*! - * brief The GPIO module supports a device-specific number of data ports, organized as 32-bit - * words/8-bit Bytes. Each 32-bit/8-bit data port includes a GACR register, which defines the byte-level - * attributes required for a successful access to the GPIO programming model. If the GPIO module's GACR register - * organized as 32-bit words, the attribute controls for the 4 data bytes in the GACR follow a standard little - * endian data convention. - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * param attribute GPIO checker attribute - */ -void GPIO_CheckAttributeBytes(GPIO_Type *base, gpio_checker_attribute_t attribute) -{ -#if defined(FSL_FEATURE_GPIO_REGISTERS_WIDTH) && (FSL_FEATURE_GPIO_REGISTERS_WIDTH == 8U) - base->GACR = ((uint8_t)attribute << GPIO_GACR_ACB_SHIFT); -#else - base->GACR = ((uint32_t)attribute << GPIO_GACR_ACB0_SHIFT) | ((uint32_t)attribute << GPIO_GACR_ACB1_SHIFT) | - ((uint32_t)attribute << GPIO_GACR_ACB2_SHIFT) | ((uint32_t)attribute << GPIO_GACR_ACB3_SHIFT); -#endif /* FSL_FEATURE_GPIO_REGISTERS_WIDTH */ -} -#endif - -#if defined(FSL_FEATURE_SOC_FGPIO_COUNT) && FSL_FEATURE_SOC_FGPIO_COUNT - -/******************************************************************************* - * Variables - ******************************************************************************/ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -static FGPIO_Type *const s_fgpioBases[] = FGPIO_BASE_PTRS; -#endif -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -/*! - * @brief Gets the FGPIO instance according to the GPIO base - * - * @param base FGPIO peripheral base pointer(PTA, PTB, PTC, etc.) - * @retval FGPIO instance - */ -static uint32_t FGPIO_GetInstance(FGPIO_Type *base); -#endif -/******************************************************************************* - * Code - ******************************************************************************/ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -static uint32_t FGPIO_GetInstance(FGPIO_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_fgpioBases); instance++) - { - if (s_fgpioBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_fgpioBases)); - - return instance; -} -#endif -#if defined(FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL) && FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL -/*! - * brief Initializes the FGPIO peripheral. - * - * This function ungates the FGPIO clock. - * - * param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - */ -void FGPIO_PortInit(FGPIO_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate FGPIO periphral clock */ - CLOCK_EnableClock(s_fgpioClockName[FGPIO_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} -#endif /* FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL */ - -/*! - * brief Initializes a FGPIO pin used by the board. - * - * To initialize the FGPIO driver, define a pin configuration, as either input or output, in the user file. - * Then, call the FGPIO_PinInit() function. - * - * This is an example to define an input pin or an output pin configuration: - * code - * Define a digital input pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalInput, - * 0, - * } - * Define a digital output pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalOutput, - * 0, - * } - * endcode - * - * param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * param pin FGPIO port pin number - * param config FGPIO pin configuration pointer - */ -void FGPIO_PinInit(FGPIO_Type *base, uint32_t pin, const gpio_pin_config_t *config) -{ - assert(NULL != config); - - if (config->pinDirection == kGPIO_DigitalInput) - { - base->PDDR &= ~(1UL << pin); - } - else - { - FGPIO_PinWrite(base, pin, config->outputLogic); - base->PDDR |= (1UL << pin); - } -} -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -/*! - * brief Reads the FGPIO port interrupt status flag. - * - * If a pin is configured to generate the DMA request, the corresponding flag - * is cleared automatically at the completion of the requested DMA transfer. - * Otherwise, the flag remains set until a logic one is written to that flag. - * If configured for a level-sensitive interrupt that remains asserted, the flag - * is set again immediately. - * - * param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * retval The current FGPIO port interrupt status flags, for example, 0x00010001 means the - * pin 0 and 17 have the interrupt. - */ -uint32_t FGPIO_PortGetInterruptFlags(FGPIO_Type *base) -{ - uint8_t instance; - instance = (uint8_t)FGPIO_GetInstance(base); - PORT_Type *portBase; - portBase = s_portBases[instance]; - return portBase->ISFR; -} - -/*! - * brief Clears the multiple FGPIO pin interrupt status flag. - * - * param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * param mask FGPIO pin number macro - */ -void FGPIO_PortClearInterruptFlags(FGPIO_Type *base, uint32_t mask) -{ - uint8_t instance; - instance = (uint8_t)FGPIO_GetInstance(base); - PORT_Type *portBase; - portBase = s_portBases[instance]; - portBase->ISFR = mask; -} -#endif -#if defined(FSL_FEATURE_FGPIO_HAS_ATTRIBUTE_CHECKER) && FSL_FEATURE_FGPIO_HAS_ATTRIBUTE_CHECKER -/*! - * brief The FGPIO module supports a device-specific number of data ports, organized as 32-bit - * words. Each 32-bit data port includes a GACR register, which defines the byte-level - * attributes required for a successful access to the GPIO programming model. The attribute controls for the 4 data - * bytes in the GACR follow a standard little endian - * data convention. - * - * param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * param attribute FGPIO checker attribute - */ -void FGPIO_CheckAttributeBytes(FGPIO_Type *base, gpio_checker_attribute_t attribute) -{ - base->GACR = ((uint32_t)attribute << FGPIO_GACR_ACB0_SHIFT) | ((uint32_t)attribute << FGPIO_GACR_ACB1_SHIFT) | - ((uint32_t)attribute << FGPIO_GACR_ACB2_SHIFT) | ((uint32_t)attribute << FGPIO_GACR_ACB3_SHIFT); -} -#endif - -#endif /* FSL_FEATURE_SOC_FGPIO_COUNT */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_gpio.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_gpio.h deleted file mode 100644 index a91fa403efd..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_gpio.h +++ /dev/null @@ -1,799 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_GPIO_H_ -#define FSL_GPIO_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup gpio - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief GPIO driver version. */ -#define FSL_GPIO_DRIVER_VERSION (MAKE_VERSION(2, 7, 3)) -/*! @} */ - -#if defined(FSL_FEATURE_GPIO_REGISTERS_WIDTH) && (FSL_FEATURE_GPIO_REGISTERS_WIDTH == 8U) -#define GPIO_FIT_REG(value) \ - ((uint8_t)(value)) /*!< For some platforms with 8-bit register width, cast the type to uint8_t */ -#else -#define GPIO_FIT_REG(value) ((uint32_t)(value)) -#endif /*FSL_FEATURE_GPIO_REGISTERS_WIDTH*/ - -/*! @brief GPIO direction definition */ -typedef enum _gpio_pin_direction -{ - kGPIO_DigitalInput = 0U, /*!< Set current pin as digital input*/ - kGPIO_DigitalOutput = 1U, /*!< Set current pin as digital output*/ -} gpio_pin_direction_t; - -#if defined(FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER) && FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER -/*! @brief GPIO checker attribute */ -typedef enum _gpio_checker_attribute -{ - kGPIO_UsernonsecureRWUsersecureRWPrivilegedsecureRW = - 0x00U, /*!< User nonsecure:Read+Write; User Secure:Read+Write; Privileged Secure:Read+Write */ - kGPIO_UsernonsecureRUsersecureRWPrivilegedsecureRW = - 0x01U, /*!< User nonsecure:Read; User Secure:Read+Write; Privileged Secure:Read+Write */ - kGPIO_UsernonsecureNUsersecureRWPrivilegedsecureRW = - 0x02U, /*!< User nonsecure:None; User Secure:Read+Write; Privileged Secure:Read+Write */ - kGPIO_UsernonsecureRUsersecureRPrivilegedsecureRW = - 0x03U, /*!< User nonsecure:Read; User Secure:Read; Privileged Secure:Read+Write */ - kGPIO_UsernonsecureNUsersecureRPrivilegedsecureRW = - 0x04U, /*!< User nonsecure:None; User Secure:Read; Privileged Secure:Read+Write */ - kGPIO_UsernonsecureNUsersecureNPrivilegedsecureRW = - 0x05U, /*!< User nonsecure:None; User Secure:None; Privileged Secure:Read+Write */ - kGPIO_UsernonsecureNUsersecureNPrivilegedsecureR = - 0x06U, /*!< User nonsecure:None; User Secure:None; Privileged Secure:Read */ - kGPIO_UsernonsecureNUsersecureNPrivilegedsecureN = - 0x07U, /*!< User nonsecure:None; User Secure:None; Privileged Secure:None */ - kGPIO_IgnoreAttributeCheck = 0x80U, /*!< Ignores the attribute check */ -} gpio_checker_attribute_t; -#endif - -/*! - * @brief The GPIO pin configuration structure. - * - * Each pin can only be configured as either an output pin or an input pin at a time. - * If configured as an input pin, leave the outputConfig unused. - * Note that in some use cases, the corresponding port property should be configured in advance - * with the PORT_SetPinConfig(). - */ -typedef struct _gpio_pin_config -{ - gpio_pin_direction_t pinDirection; /*!< GPIO direction, input or output */ - /* Output configurations; ignore if configured as an input pin */ - uint8_t outputLogic; /*!< Set a default output logic, which has no use in input */ -} gpio_pin_config_t; - -#if (defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) || \ - !(defined(FSL_FEATURE_SOC_PORT_COUNT)) -/*! @brief Configures the interrupt generation condition. */ -typedef enum _gpio_interrupt_config -{ - kGPIO_InterruptStatusFlagDisabled = 0x0U, /*!< Interrupt status flag is disabled. */ - kGPIO_DMARisingEdge = 0x1U, /*!< ISF flag and DMA request on rising edge. */ - kGPIO_DMAFallingEdge = 0x2U, /*!< ISF flag and DMA request on falling edge. */ - kGPIO_DMAEitherEdge = 0x3U, /*!< ISF flag and DMA request on either edge. */ - kGPIO_FlagRisingEdge = 0x05U, /*!< Flag sets on rising edge. */ - kGPIO_FlagFallingEdge = 0x06U, /*!< Flag sets on falling edge. */ - kGPIO_FlagEitherEdge = 0x07U, /*!< Flag sets on either edge. */ - kGPIO_InterruptLogicZero = 0x8U, /*!< Interrupt when logic zero. */ - kGPIO_InterruptRisingEdge = 0x9U, /*!< Interrupt on rising edge. */ - kGPIO_InterruptFallingEdge = 0xAU, /*!< Interrupt on falling edge. */ - kGPIO_InterruptEitherEdge = 0xBU, /*!< Interrupt on either edge. */ - kGPIO_InterruptLogicOne = 0xCU, /*!< Interrupt when logic one. */ - kGPIO_ActiveHighTriggerOutputEnable = 0xDU, /*!< Enable active high-trigger output. */ - kGPIO_ActiveLowTriggerOutputEnable = 0xEU, /*!< Enable active low-trigger output. */ -} gpio_interrupt_config_t; -#endif - -#if (defined(FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) && FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) -/*! @brief Configures the selection of interrupt/DMA request/trigger output. */ -typedef enum _gpio_interrupt_selection -{ - kGPIO_InterruptOutput0 = 0x0U, /*!< Interrupt/DMA request/trigger output 0. */ - kGPIO_InterruptOutput1 = 0x1U, /*!< Interrupt/DMA request/trigger output 1. */ -} gpio_interrupt_selection_t; -#endif /* FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT */ - -#if defined(FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER) && FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER -/*! @brief GPIO version information. */ -typedef struct _gpio_version_info -{ - uint16_t feature; /*!< Feature Specification Number. */ - uint8_t minor; /*!< Minor Version Number. */ - uint8_t major; /*!< Major Version Number. */ -} gpio_version_info_t; -#endif /* FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER */ - -#if defined(FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL) && FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL -/*! @brief GPIO pin and interrupt control. */ -typedef enum -{ - kGPIO_PinControlNonSecure = 0x01U, /*!< Pin Control Non-Secure. */ - kGPIO_InterruptControlNonSecure = 0x02U, /*!< Interrupt Control Non-Secure. */ - kGPIO_PinControlNonPrivilege = 0x04U, /*!< Pin Control Non-Privilege. */ - kGPIO_InterruptControlNonPrivilege = 0x08U, /*!< Interrupt Control Non-Privilege. */ -} gpio_pin_interrupt_control_t; -#endif /* FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL */ - -/*! @} */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @addtogroup gpio_driver - * @{ - */ - -/*! @name GPIO Configuration */ -/*! @{ */ - -/*! - * @brief Initializes a GPIO pin used by the board. - * - * To initialize the GPIO, define a pin configuration, as either input or output, in the user file. - * Then, call the GPIO_PinInit() function. - * - * This is an example to define an input pin or an output pin configuration. - * @code - * Define a digital input pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalInput, - * 0, - * } - * Define a digital output pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalOutput, - * 0, - * } - * @endcode - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param pin GPIO port pin number - * @param config GPIO pin configuration pointer - */ -void GPIO_PinInit(GPIO_Type *base, uint32_t pin, const gpio_pin_config_t *config); - -#if defined(FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER) && FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER -/*! - * @brief Get GPIO version information. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param info GPIO version information - */ -void GPIO_GetVersionInfo(GPIO_Type *base, gpio_version_info_t *info); -#endif /* FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER */ - -#if defined(FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL) && FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL -/*! - * @brief lock or unlock secure privilege. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask pin or interrupt macro - */ -static inline void GPIO_SecurePrivilegeLock(GPIO_Type *base, gpio_pin_interrupt_control_t mask) -{ - base->LOCK |= GPIO_FIT_REG(mask); -} - -/*! - * @brief Enable Pin Control Non-Secure. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_EnablePinControlNonSecure(GPIO_Type *base, uint32_t mask) -{ - base->PCNS |= GPIO_FIT_REG(mask); -} - -/*! - * @brief Disable Pin Control Non-Secure. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_DisablePinControlNonSecure(GPIO_Type *base, uint32_t mask) -{ - base->PCNS &= GPIO_FIT_REG(~mask); -} - -/*! - * @brief Enable Pin Control Non-Privilege. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_EnablePinControlNonPrivilege(GPIO_Type *base, uint32_t mask) -{ - base->PCNP |= GPIO_FIT_REG(mask); -} - -/*! - * @brief Disable Pin Control Non-Privilege. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_DisablePinControlNonPrivilege(GPIO_Type *base, uint32_t mask) -{ - base->PCNP &= GPIO_FIT_REG(~mask); -} - -/*! - * @brief Enable Interrupt Control Non-Secure. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_EnableInterruptControlNonSecure(GPIO_Type *base, uint32_t mask) -{ - base->ICNS |= GPIO_FIT_REG(mask); -} - -/*! - * @brief Disable Interrupt Control Non-Secure. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_DisableInterruptControlNonSecure(GPIO_Type *base, uint32_t mask) -{ - base->ICNS &= GPIO_FIT_REG(~mask); -} - -/*! - * @brief Enable Interrupt Control Non-Privilege. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_EnableInterruptControlNonPrivilege(GPIO_Type *base, uint32_t mask) -{ - base->ICNP |= GPIO_FIT_REG(mask); -} - -/*! - * @brief Disable Interrupt Control Non-Privilege. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_DisableInterruptControlNonPrivilege(GPIO_Type *base, uint32_t mask) -{ - base->ICNP &= GPIO_FIT_REG(~mask); -} -#endif /* FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL */ - -#if defined(FSL_FEATURE_GPIO_HAS_PORT_INPUT_CONTROL) && FSL_FEATURE_GPIO_HAS_PORT_INPUT_CONTROL -/*! - * @brief Enable port input. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_PortInputEnable(GPIO_Type *base, uint32_t mask) -{ - base->PIDR &= GPIO_FIT_REG(~mask); -} - -/*! - * @brief Disable port input. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_PortInputDisable(GPIO_Type *base, uint32_t mask) -{ - base->PIDR |= GPIO_FIT_REG(mask); -} -#endif /* FSL_FEATURE_GPIO_HAS_PORT_INPUT_CONTROL */ - -/*! @} */ - -/*! @name GPIO Output Operations */ -/*! @{ */ - -/*! - * @brief Sets the output level of the multiple GPIO pins to the logic 1 or 0. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param pin GPIO pin number - * @param output GPIO pin output logic level. - * - 0: corresponding pin output low-logic level. - * - 1: corresponding pin output high-logic level. - */ -static inline void GPIO_PinWrite(GPIO_Type *base, uint32_t pin, uint8_t output) -{ -#if !(defined(FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) && FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) - if (output == 0U) - { - base->PCOR = GPIO_FIT_REG(1UL << pin); - } - else - { - base->PSOR = GPIO_FIT_REG(1UL << pin); - } -#else - if (output == 0U) - { - base->PDOR |= GPIO_FIT_REG(1UL << pin); - } - else - { - base->PDOR &= ~GPIO_FIT_REG(1UL << pin); - } -#endif -} - -/*! - * @brief Sets the output level of the multiple GPIO pins to the logic 1. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_PortSet(GPIO_Type *base, uint32_t mask) -{ -#if !(defined(FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) && FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) - base->PSOR = GPIO_FIT_REG(mask); -#else - base->PDOR |= GPIO_FIT_REG(mask); -#endif -} - -/*! - * @brief Sets the output level of the multiple GPIO pins to the logic 0. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_PortClear(GPIO_Type *base, uint32_t mask) -{ -#if !(defined(FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) && FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) - base->PCOR = GPIO_FIT_REG(mask); -#else - base->PDOR &= ~GPIO_FIT_REG(mask); -#endif -} - -/*! - * @brief Reverses the current output logic of the multiple GPIO pins. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_PortToggle(GPIO_Type *base, uint32_t mask) -{ -#if !(defined(FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) && FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) - base->PTOR = GPIO_FIT_REG(mask); -#else - base->PDOR ^= GPIO_FIT_REG(mask); -#endif -} - -/*! @} */ - -/*! @name GPIO Input Operations */ -/*! @{ */ - -/*! - * @brief Reads the current input value of the GPIO port. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param pin GPIO pin number - * @retval GPIO port input value - * - 0: corresponding pin input low-logic level. - * - 1: corresponding pin input high-logic level. - */ -static inline uint32_t GPIO_PinRead(GPIO_Type *base, uint32_t pin) -{ - return (((uint32_t)(base->PDIR) >> pin) & 0x01UL); -} - -/*! @} */ - -/*! @name GPIO Interrupt */ -/*! @{ */ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -/*! - * @brief Reads the GPIO port interrupt status flag. - * - * If a pin is configured to generate the DMA request, the corresponding flag - * is cleared automatically at the completion of the requested DMA transfer. - * Otherwise, the flag remains set until a logic one is written to that flag. - * If configured for a level sensitive interrupt that remains asserted, the flag - * is set again immediately. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @retval The current GPIO port interrupt status flag, for example, 0x00010001 means the - * pin 0 and 17 have the interrupt. - */ -uint32_t GPIO_PortGetInterruptFlags(GPIO_Type *base); - -/*! - * @brief Clears multiple GPIO pin interrupt status flags. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -void GPIO_PortClearInterruptFlags(GPIO_Type *base, uint32_t mask); -#else -/*! - * @brief Configures the gpio pin interrupt/DMA request. - * - * @param base GPIO peripheral base pointer. - * @param pin GPIO pin number. - * @param config GPIO pin interrupt configuration. - * - #kGPIO_InterruptStatusFlagDisabled: Interrupt/DMA request disabled. - * - #kGPIO_DMARisingEdge : DMA request on rising edge(if the DMA requests exit). - * - #kGPIO_DMAFallingEdge: DMA request on falling edge(if the DMA requests exit). - * - #kGPIO_DMAEitherEdge : DMA request on either edge(if the DMA requests exit). - * - #kGPIO_FlagRisingEdge : Flag sets on rising edge(if the Flag states exit). - * - #kGPIO_FlagFallingEdge : Flag sets on falling edge(if the Flag states exit). - * - #kGPIO_FlagEitherEdge : Flag sets on either edge(if the Flag states exit). - * - #kGPIO_InterruptLogicZero : Interrupt when logic zero. - * - #kGPIO_InterruptRisingEdge : Interrupt on rising edge. - * - #kGPIO_InterruptFallingEdge: Interrupt on falling edge. - * - #kGPIO_InterruptEitherEdge : Interrupt on either edge. - * - #kGPIO_InterruptLogicOne : Interrupt when logic one. - * - #kGPIO_ActiveHighTriggerOutputEnable : Enable active high-trigger output (if the trigger states exit). - * - #kGPIO_ActiveLowTriggerOutputEnable : Enable active low-trigger output (if the trigger states exit). - */ -static inline void GPIO_SetPinInterruptConfig(GPIO_Type *base, uint32_t pin, gpio_interrupt_config_t config) -{ - assert(base); - - base->ICR[pin] = GPIO_FIT_REG((base->ICR[pin] & ~GPIO_ICR_IRQC_MASK) | GPIO_ICR_IRQC(config)); -} - -#if (defined(FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) && FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) -/*! - * @brief Configures the gpio pin interrupt/DMA request/trigger output channel selection. - * - * @param base GPIO peripheral base pointer. - * @param pin GPIO pin number. - * @param selection GPIO pin interrupt output selection. - * - #kGPIO_InterruptOutput0: Interrupt/DMA request/trigger output 0. - * - #kGPIO_InterruptOutput1 : Interrupt/DMA request/trigger output 1. - */ -static inline void GPIO_SetPinInterruptChannel(GPIO_Type *base, uint32_t pin, gpio_interrupt_selection_t selection) -{ - assert(base); - - base->ICR[pin] = GPIO_FIT_REG((base->ICR[pin] & ~GPIO_ICR_IRQS_MASK) | GPIO_ICR_IRQS(selection)); -} -#endif -/*! - * @brief Read the GPIO interrupt status flags. - * - * @param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on.) - * @return The current GPIO's interrupt status flag. - * '1' means the related pin's flag is set, '0' means the related pin's flag not set. - * For example, the return value 0x00010001 means the pin 0 and 17 have the interrupt pending. - */ -uint32_t GPIO_GpioGetInterruptFlags(GPIO_Type *base); -#if (defined(FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) && FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) -/*! - * @brief Read the GPIO interrupt status flags based on selected interrupt channel(IRQS). - * - * @param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on.) - * @param channel '0' means selete interrupt channel 0, '1' means selete interrupt channel 1. - * @return The current GPIO's interrupt status flag based on the selected interrupt channel. - * '1' means the related pin's flag is set, '0' means the related pin's flag not set. - * For example, the return value 0x00010001 means the pin 0 and 17 have the interrupt pending. - */ -uint32_t GPIO_GpioGetInterruptChannelFlags(GPIO_Type *base, uint32_t channel); -#endif -/*! - * @brief Read individual pin's interrupt status flag. - * - * @param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on) - * @param pin GPIO specific pin number. - * @return The current selected pin's interrupt status flag. - */ -uint8_t GPIO_PinGetInterruptFlag(GPIO_Type *base, uint32_t pin); - -/*! - * @brief Clears GPIO pin interrupt status flags. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -void GPIO_GpioClearInterruptFlags(GPIO_Type *base, uint32_t mask); -#if (defined(FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) && FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) -/*! - * @brief Clears GPIO pin interrupt status flags based on selected interrupt channel(IRQS). - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - * @param channel '0' means selete interrupt channel 0, '1' means selete interrupt channel 1. - */ -void GPIO_GpioClearInterruptChannelFlags(GPIO_Type *base, uint32_t mask, uint32_t channel); -#endif -/*! - * @brief Clear GPIO individual pin's interrupt status flag. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on). - * @param pin GPIO specific pin number. - */ -void GPIO_PinClearInterruptFlag(GPIO_Type *base, uint32_t pin); - -/*! - * @brief Reads the GPIO DMA request flags. - * The corresponding flag will be cleared automatically at the completion of the requested - * DMA transfer - */ -static inline uint32_t GPIO_GetPinsDMARequestFlags(GPIO_Type *base) -{ - assert(base); - return (base->ISFR[1]); -} - -/*! - * @brief Sets the GPIO interrupt configuration in PCR register for multiple pins. - * - * @param base GPIO peripheral base pointer. - * @param mask GPIO pin number macro. - * @param config GPIO pin interrupt configuration. - * - #kGPIO_InterruptStatusFlagDisabled: Interrupt disabled. - * - #kGPIO_DMARisingEdge : DMA request on rising edge(if the DMA requests exit). - * - #kGPIO_DMAFallingEdge: DMA request on falling edge(if the DMA requests exit). - * - #kGPIO_DMAEitherEdge : DMA request on either edge(if the DMA requests exit). - * - #kGPIO_FlagRisingEdge : Flag sets on rising edge(if the Flag states exit). - * - #kGPIO_FlagFallingEdge : Flag sets on falling edge(if the Flag states exit). - * - #kGPIO_FlagEitherEdge : Flag sets on either edge(if the Flag states exit). - * - #kGPIO_InterruptLogicZero : Interrupt when logic zero. - * - #kGPIO_InterruptRisingEdge : Interrupt on rising edge. - * - #kGPIO_InterruptFallingEdge: Interrupt on falling edge. - * - #kGPIO_InterruptEitherEdge : Interrupt on either edge. - * - #kGPIO_InterruptLogicOne : Interrupt when logic one. - * - #kGPIO_ActiveHighTriggerOutputEnable : Enable active high-trigger output (if the trigger states exit). - * - #kGPIO_ActiveLowTriggerOutputEnable : Enable active low-trigger output (if the trigger states exit).. - */ -static inline void GPIO_SetMultipleInterruptPinsConfig(GPIO_Type *base, uint32_t mask, gpio_interrupt_config_t config) -{ - assert(base); - - if (0UL != (mask & 0xffffUL)) - { - base->GICLR = GPIO_FIT_REG((GPIO_ICR_IRQC(config)) | (mask & 0xffffU)); - } - mask = mask >> 16U; - if (mask != 0UL) - { - base->GICHR = GPIO_FIT_REG((GPIO_ICR_IRQC(config)) | (mask & 0xffffU)); - } -} -#endif - -#if defined(FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER) && FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER -/*! - * brief The GPIO module supports a device-specific number of data ports, organized as 32-bit - * words/8-bit Bytes. Each 32-bit/8-bit data port includes a GACR register, which defines the byte-level - * attributes required for a successful access to the GPIO programming model. If the GPIO module's GACR register - * organized as 32-bit words, the attribute controls for the 4 data bytes in the GACR follow a standard little - * endian data convention. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param attribute GPIO checker attribute - */ -void GPIO_CheckAttributeBytes(GPIO_Type *base, gpio_checker_attribute_t attribute); -#endif - -/*! @} */ -/*! @} */ - -/*! - * @addtogroup fgpio_driver - * @{ - */ - -/* - * Introduces the FGPIO feature. - * - * The FGPIO features are only support on some Kinetis MCUs. The FGPIO registers are aliased to the IOPORT - * interface. Accesses via the IOPORT interface occur in parallel with any instruction fetches and - * complete in a single cycle. This aliased Fast GPIO memory map is called FGPIO. - */ - -#if defined(FSL_FEATURE_SOC_FGPIO_COUNT) && FSL_FEATURE_SOC_FGPIO_COUNT - -/*! @name FGPIO Configuration */ -/*! @{ */ - -#if defined(FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL) && FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL -/*! - * @brief Initializes the FGPIO peripheral. - * - * This function ungates the FGPIO clock. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - */ -void FGPIO_PortInit(FGPIO_Type *base); -#endif /* FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL */ - -/*! - * @brief Initializes a FGPIO pin used by the board. - * - * To initialize the FGPIO driver, define a pin configuration, as either input or output, in the user file. - * Then, call the FGPIO_PinInit() function. - * - * This is an example to define an input pin or an output pin configuration: - * @code - * Define a digital input pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalInput, - * 0, - * } - * Define a digital output pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalOutput, - * 0, - * } - * @endcode - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param pin FGPIO port pin number - * @param config FGPIO pin configuration pointer - */ -void FGPIO_PinInit(FGPIO_Type *base, uint32_t pin, const gpio_pin_config_t *config); - -/*! @} */ - -/*! @name FGPIO Output Operations */ -/*! @{ */ - -/*! - * @brief Sets the output level of the multiple FGPIO pins to the logic 1 or 0. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param pin FGPIO pin number - * @param output FGPIOpin output logic level. - * - 0: corresponding pin output low-logic level. - * - 1: corresponding pin output high-logic level. - */ -static inline void FGPIO_PinWrite(FGPIO_Type *base, uint32_t pin, uint8_t output) -{ - if (output == 0U) - { - base->PCOR = 1UL << pin; - } - else - { - base->PSOR = 1UL << pin; - } -} - -/*! - * @brief Sets the output level of the multiple FGPIO pins to the logic 1. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param mask FGPIO pin number macro - */ -static inline void FGPIO_PortSet(FGPIO_Type *base, uint32_t mask) -{ - base->PSOR = mask; -} - -/*! - * @brief Sets the output level of the multiple FGPIO pins to the logic 0. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param mask FGPIO pin number macro - */ -static inline void FGPIO_PortClear(FGPIO_Type *base, uint32_t mask) -{ - base->PCOR = mask; -} - -/*! - * @brief Reverses the current output logic of the multiple FGPIO pins. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param mask FGPIO pin number macro - */ -static inline void FGPIO_PortToggle(FGPIO_Type *base, uint32_t mask) -{ - base->PTOR = mask; -} -/*! @} */ - -/*! @name FGPIO Input Operations */ -/*! @{ */ - -/*! - * @brief Reads the current input value of the FGPIO port. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param pin FGPIO pin number - * @retval FGPIO port input value - * - 0: corresponding pin input low-logic level. - * - 1: corresponding pin input high-logic level. - */ -static inline uint32_t FGPIO_PinRead(FGPIO_Type *base, uint32_t pin) -{ - return (((base->PDIR) >> pin) & 0x01U); -} -/*! @} */ - -/*! @name FGPIO Interrupt */ -/*! @{ */ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) - -/*! - * @brief Reads the FGPIO port interrupt status flag. - * - * If a pin is configured to generate the DMA request, the corresponding flag - * is cleared automatically at the completion of the requested DMA transfer. - * Otherwise, the flag remains set until a logic one is written to that flag. - * If configured for a level-sensitive interrupt that remains asserted, the flag - * is set again immediately. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @retval The current FGPIO port interrupt status flags, for example, 0x00010001 means the - * pin 0 and 17 have the interrupt. - */ -uint32_t FGPIO_PortGetInterruptFlags(FGPIO_Type *base); - -/*! - * @brief Clears the multiple FGPIO pin interrupt status flag. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param mask FGPIO pin number macro - */ -void FGPIO_PortClearInterruptFlags(FGPIO_Type *base, uint32_t mask); -#endif -#if defined(FSL_FEATURE_FGPIO_HAS_ATTRIBUTE_CHECKER) && FSL_FEATURE_FGPIO_HAS_ATTRIBUTE_CHECKER -/*! - * @brief The FGPIO module supports a device-specific number of data ports, organized as 32-bit - * words. Each 32-bit data port includes a GACR register, which defines the byte-level - * attributes required for a successful access to the GPIO programming model. The attribute controls for the 4 data - * bytes in the GACR follow a standard little endian - * data convention. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param attribute FGPIO checker attribute - */ -void FGPIO_CheckAttributeBytes(FGPIO_Type *base, gpio_checker_attribute_t attribute); -#endif /* FSL_FEATURE_FGPIO_HAS_ATTRIBUTE_CHECKER */ - -/*! @} */ - -#endif /* FSL_FEATURE_SOC_FGPIO_COUNT */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ - -#endif /* FSL_GPIO_H_*/ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_i3c.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_i3c.c deleted file mode 100644 index dc10970b5af..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_i3c.c +++ /dev/null @@ -1,3572 +0,0 @@ -/* - * Copyright 2018-2024 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_i3c.h" -#if !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) -#include "fsl_reset.h" -#endif -#include -#include - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.i3c" -#endif - -#define I3C_BROADCASE_ADDR (0x7EU) - -#define NSEC_PER_SEC (1000000000UL) -#define FSL_I3C_ERROR_RATE_MAX (10U) -#define FSL_I3C_PPBAUD_DIV_MAX ((I3C_MCONFIG_PPBAUD_MASK >> I3C_MCONFIG_PPBAUD_SHIFT) + 1U) -#define FSL_I3C_ODBAUD_DIV_MAX ((I3C_MCONFIG_ODBAUD_MASK >> I3C_MCONFIG_ODBAUD_SHIFT) + 1U) -#define FSL_I3C_I2CBAUD_DIV_MAX (((I3C_MCONFIG_I2CBAUD_MASK >> I3C_MCONFIG_I2CBAUD_SHIFT) + 1U) / 2U) - -/*! @brief Common sets of flags used by the driver. */ -enum _i3c_flag_constants -{ - /*! All flags which are cleared by the driver upon starting a transfer. */ - kMasterClearFlags = kI3C_MasterSlaveStartFlag | kI3C_MasterControlDoneFlag | kI3C_MasterCompleteFlag | - kI3C_MasterArbitrationWonFlag | kI3C_MasterSlave2MasterFlag | kI3C_MasterErrorFlag, - - /*! IRQ sources enabled by the non-blocking transactional API. */ - kMasterIrqFlags = kI3C_MasterSlaveStartFlag | kI3C_MasterControlDoneFlag | kI3C_MasterCompleteFlag | - kI3C_MasterRxReadyFlag /* | kI3C_MasterTxReadyFlag */ | kI3C_MasterArbitrationWonFlag | - kI3C_MasterErrorFlag | kI3C_MasterSlave2MasterFlag, - - /*! Errors to check for. */ - kMasterErrorFlags = kI3C_MasterErrorNackFlag | kI3C_MasterErrorWriteAbortFlag | -#if !defined(FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) || (!FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) - kI3C_MasterErrorTermFlag | -#endif - kI3C_MasterErrorParityFlag | kI3C_MasterErrorCrcFlag | kI3C_MasterErrorReadFlag | - kI3C_MasterErrorWriteFlag | kI3C_MasterErrorMsgFlag | kI3C_MasterErrorInvalidReqFlag | - kI3C_MasterErrorTimeoutFlag, - /*! All flags which are cleared by the driver upon starting a transfer. */ - kSlaveClearFlags = kI3C_SlaveBusStartFlag | kI3C_SlaveMatchedFlag | kI3C_SlaveBusStopFlag, - - /*! IRQ sources enabled by the non-blocking transactional API. */ - kSlaveIrqFlags = kI3C_SlaveBusStartFlag | kI3C_SlaveMatchedFlag | kI3C_SlaveBusStopFlag | kI3C_SlaveRxReadyFlag | - kI3C_SlaveDynamicAddrChangedFlag | kI3C_SlaveReceivedCCCFlag | kI3C_SlaveErrorFlag | - kI3C_SlaveHDRCommandMatchFlag | kI3C_SlaveCCCHandledFlag | kI3C_SlaveEventSentFlag, - - /*! Errors to check for. */ - kSlaveErrorFlags = kI3C_SlaveErrorOverrunFlag | kI3C_SlaveErrorUnderrunFlag | kI3C_SlaveErrorUnderrunNakFlag | - kI3C_SlaveErrorTermFlag | kI3C_SlaveErrorInvalidStartFlag | kI3C_SlaveErrorSdrParityFlag | - kI3C_SlaveErrorHdrParityFlag | kI3C_SlaveErrorHdrCRCFlag | kI3C_SlaveErrorS0S1Flag | - kI3C_SlaveErrorOverreadFlag | kI3C_SlaveErrorOverwriteFlag, -}; - -/*! @brief States for the state machine used by transactional APIs. */ -enum _i3c_transfer_states -{ - kIdleState = 0, - kIBIWonState, - kSlaveStartState, - kSendCommandState, - kWaitRepeatedStartCompleteState, - kTransferDataState, - kStopState, - kWaitForCompletionState, -}; - -/*! - * @brief Used for conversion between `uint8_t*` and `uint32_t`. - */ -typedef union i3c_puint8_to_u32 -{ - uint8_t *puint8; - uint32_t u32; - const uint8_t *cpuint8; -} i3c_puint8_to_u32_t; - -/* - * MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - } - - return result; -} - -status_t I3C_MasterWaitForCtrlDone(I3C_Type *base, bool waitIdle) -{ - status_t result = kStatus_Success; - uint32_t status, errStatus; -#if I3C_RETRY_TIMES - uint32_t waitTimes = I3C_RETRY_TIMES; -#endif - -#if I3C_RETRY_TIMES - while ((result == kStatus_Success) && (--waitTimes)) -#else - while (result == kStatus_Success) -#endif - { - status = I3C_MasterGetStatusFlags(base); - errStatus = I3C_MasterGetErrorStatusFlags(base); - /* Check for error flags. */ - result = I3C_MasterCheckAndClearError(base, errStatus); - /* Check if the control finishes. */ - if (0UL != (status & (uint32_t)kI3C_MasterControlDoneFlag)) - { - I3C_MasterClearStatusFlags(base, (uint32_t)kI3C_MasterControlDoneFlag); - if (!waitIdle) - { - break; - } - } - /* kI3C_MasterControlDoneFlag only indicates ACK got, need to wait for SDA high. */ - if (waitIdle && I3C_MasterGetState(base) == kI3C_MasterStateIdle) - { - break; - } - } - -#if I3C_RETRY_TIMES - if (waitTimes == 0) - { - return kStatus_I3C_Timeout; - } -#endif - - return result; -} - -static status_t I3C_MasterWaitForTxReady(I3C_Type *base, uint8_t byteCounts) -{ - uint32_t errStatus; - status_t result; - size_t txCount; - size_t txFifoSize = - 2UL << ((base->SCAPABILITIES & I3C_SCAPABILITIES_FIFOTX_MASK) >> I3C_SCAPABILITIES_FIFOTX_SHIFT); - -#if I3C_RETRY_TIMES - uint32_t waitTimes = I3C_RETRY_TIMES; -#endif - do - { - /* Get the number of words in the tx fifo and compute empty slots. */ - I3C_MasterGetFifoCounts(base, NULL, &txCount); - txCount = txFifoSize - txCount; - - /* Check for error flags. */ - errStatus = I3C_MasterGetErrorStatusFlags(base); - result = I3C_MasterCheckAndClearError(base, errStatus); - if (kStatus_Success != result) - { - return result; - } -#if I3C_RETRY_TIMES - } while ((txCount < byteCounts) && (--waitTimes)); - - if (waitTimes == 0) - { - return kStatus_I3C_Timeout; - } -#else - } while (txCount < byteCounts); -#endif - - return kStatus_Success; -} - -static status_t I3C_MasterWaitForComplete(I3C_Type *base, bool waitIdle) -{ - uint32_t status, errStatus; - status_t result = kStatus_Success; -#if I3C_RETRY_TIMES - uint32_t waitTimes = I3C_RETRY_TIMES; -#endif - do - { - status = I3C_MasterGetStatusFlags(base); - errStatus = I3C_MasterGetErrorStatusFlags(base); - result = I3C_MasterCheckAndClearError(base, errStatus); -#if I3C_RETRY_TIMES - } while (((status & (uint32_t)kI3C_MasterCompleteFlag) != (uint32_t)kI3C_MasterCompleteFlag) && - (result == kStatus_Success) && --waitTimes); -#else - } while (((status & (uint32_t)kI3C_MasterCompleteFlag) != (uint32_t)kI3C_MasterCompleteFlag) && - (result == kStatus_Success)); -#endif - - I3C_MasterClearStatusFlags(base, (uint32_t)kI3C_MasterCompleteFlag); - -#if I3C_RETRY_TIMES - if (waitTimes == 0UL) - { - return kStatus_I3C_Timeout; - } -#endif - - if (waitIdle) - { -#if I3C_RETRY_TIMES - while ((I3C_MasterGetState(base) != kI3C_MasterStateIdle) && --waitTimes) -#else - while (I3C_MasterGetState(base) != kI3C_MasterStateIdle) -#endif - { - } - } - - return result; -} - -/*! - * @brief Convert provided flags to status code, and clear any errors if present. - * @param base The I3C peripheral base address. - * @param status Current status flags value that will be checked. - * @retval #kStatus_Success - * @retval #kStatus_I3C_OverrunError - * @retval #kStatus_I3C_UnderrunError - * @retval #kStatus_I3C_UnderrunNak - * @retval #kStatus_I3C_Term - * @retval #kStatus_I3C_InvalidStart - * @retval #kStatus_I3C_SdrParityError - * @retval #kStatus_I3C_HdrParityError - * @retval #kStatus_I3C_CrcError - * @retval #kStatus_I3C_S0S1Error - * @retval #kStatus_I3C_ReadFifoError - * @retval #kStatus_I3C_WriteFifoError - */ -status_t I3C_SlaveCheckAndClearError(I3C_Type *base, uint32_t status) -{ - status_t result = kStatus_Success; - - /* Check for error. These errors cause a stop to automatically be sent. We must */ - /* clear the errors before a new transfer can start. */ - status &= (uint32_t)kSlaveErrorFlags; - -#if defined(I3C_DMA_IGNORE_FIFO_ERROR) - status &= ~((uint32_t)kI3C_SlaveErrorUnderrunFlag | (uint32_t)kI3C_SlaveErrorOverwriteFlag); - I3C_SlaveClearErrorStatusFlags(base, - ((uint32_t)kI3C_SlaveErrorUnderrunFlag | (uint32_t)kI3C_SlaveErrorOverwriteFlag)); -#endif - - if (0UL != status) - { - /* Select the correct error code. Ordered by severity, with bus issues first. */ - if (0UL != (status & (uint32_t)kI3C_SlaveErrorOverrunFlag)) - { - result = kStatus_I3C_OverrunError; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorUnderrunFlag)) - { - result = kStatus_I3C_UnderrunError; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorUnderrunNakFlag)) - { - result = kStatus_I3C_UnderrunNak; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorTermFlag)) - { - result = kStatus_I3C_Term; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorInvalidStartFlag)) - { - result = kStatus_I3C_InvalidStart; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorSdrParityFlag)) - { - result = kStatus_I3C_SdrParityError; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorHdrParityFlag)) - { - result = kStatus_I3C_HdrParityError; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorHdrCRCFlag)) - { - result = kStatus_I3C_CrcError; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorS0S1Flag)) - { - result = kStatus_I3C_S0S1Error; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorOverreadFlag)) - { - result = kStatus_I3C_ReadFifoError; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorOverwriteFlag)) - { - result = kStatus_I3C_WriteFifoError; - } - else - { - assert(false); - } - - /* Clear the flags. */ - I3C_SlaveClearErrorStatusFlags(base, status); - - /* Reset fifos. These flags clear automatically. */ - base->SDATACTRL |= I3C_SDATACTRL_FLUSHTB_MASK | I3C_SDATACTRL_FLUSHFB_MASK; - } - - return result; -} - -static status_t I3C_SlaveWaitForTxReady(I3C_Type *base) -{ - uint32_t errStatus; - status_t result; - size_t txCount; - size_t txFifoSize = - 2UL << ((base->SCAPABILITIES & I3C_SCAPABILITIES_FIFOTX_MASK) >> I3C_SCAPABILITIES_FIFOTX_SHIFT); - -#if I3C_RETRY_TIMES - uint32_t waitTimes = I3C_RETRY_TIMES; -#endif - do - { - /* Get the number of words in the tx fifo and compute empty slots. */ - I3C_SlaveGetFifoCounts(base, NULL, &txCount); - txCount = txFifoSize - txCount; - - /* Check for error flags. */ - errStatus = I3C_SlaveGetErrorStatusFlags(base); - result = I3C_SlaveCheckAndClearError(base, errStatus); - if (kStatus_Success != result) - { - return result; - } -#if I3C_RETRY_TIMES - } while ((txCount == 0UL) && (--waitTimes)); - - if (waitTimes == 0) - { - return kStatus_I3C_Timeout; - } -#else - } while (txCount == 0UL); -#endif - - return kStatus_Success; -} - -static status_t I3C_MasterEmitStop(I3C_Type *base, bool waitIdle) -{ - status_t result = kStatus_Success; - - /* Return an error if the bus is not in transaction. */ - if (I3C_MasterGetState(base) != kI3C_MasterStateNormAct) - { - return kStatus_I3C_InvalidReq; - } - - /* Send the STOP signal */ - base->MCTRL = (base->MCTRL & ~(I3C_MCTRL_REQUEST_MASK | I3C_MCTRL_DIR_MASK | I3C_MCTRL_RDTERM_MASK)) | - I3C_MCTRL_REQUEST(kI3C_RequestEmitStop); - - /* Wait for the stop operation finishes. */ - /* Also check for errors while waiting. */ - result = I3C_MasterWaitForCtrlDone(base, waitIdle); - - return result; -} - -/*! - * brief I3C master get IBI Type. - * - * param base The I3C peripheral base address. - * param i3c_ibi_type_t Type of #i3c_ibi_type_t. - */ -i3c_ibi_type_t I3C_GetIBIType(I3C_Type *base) -{ - uint32_t ibiValue = (base->MSTATUS & I3C_MSTATUS_IBITYPE_MASK) >> I3C_MSTATUS_IBITYPE_SHIFT; - i3c_ibi_type_t ibiType = kI3C_IbiNormal; - - switch (ibiValue) - { - case 3L: - ibiType = kI3C_IbiHotJoin; - break; - case 2L: - ibiType = kI3C_IbiMasterRequest; - break; - default: - ibiType = kI3C_IbiNormal; - break; - } - - return ibiType; -} - -/*! - * @brief Make sure the bus isn't already busy. - * - * A busy bus is allowed if we are the one driving it. - * - * @param base The I3C peripheral base address. - * @retval #kStatus_Success - * @retval #kStatus_I3C_Busy - */ -/* Not static so it can be used from fsl_i3c_edma.c. */ -status_t I3C_CheckForBusyBus(I3C_Type *base) -{ - return (I3C_MasterGetBusIdleState(base) == true) ? kStatus_Success : kStatus_I3C_Busy; -} - -/* brief Provides a default configuration for the I3C peripheral. - * - */ -void I3C_GetDefaultConfig(i3c_config_t *config) -{ - assert(NULL != config); - - (void)memset(config, 0, sizeof(*config)); - - config->enableMaster = kI3C_MasterCapable; - config->disableTimeout = false; - config->hKeep = kI3C_MasterHighKeeperNone; - config->enableOpenDrainStop = true; - config->enableOpenDrainHigh = true; - config->baudRate_Hz.i2cBaud = 400000U; - config->baudRate_Hz.i3cPushPullBaud = 12500000U; - config->baudRate_Hz.i3cOpenDrainBaud = 2500000U; - config->masterDynamicAddress = 0x0AU; /* Default master dynamic address. */ -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - config->slowClock_Hz = 0; /* Not update the Soc default setting. */ -#endif - config->enableSlave = true; - config->vendorID = 0x11BU; -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) - config->enableRandomPart = false; -#endif - config->partNumber = 0; - config->dcr = 0; /* Generic device. */ - config->bcr = 0; /* BCR[7:6]: device role, I3C slave(2b'00), BCR[5]: SDR Only / SDR and HDR Capable, SDR and HDR - Capable(1b'1), BCR[4]: Bridge Identifier, Not a bridge device(1b'0), BCR[3]: Offline Capable, - device is offline capable(1b'1), BCR[2]: IBI Payload, No data byte following(1b'0), BCR[1]: IBI - Request Capable, capable(1b'1), BCR[0]: Max Data Speed Limitation, has limitation(1b'1). */ - config->hdrMode = (uint8_t)kI3C_HDRModeDDR; - config->nakAllRequest = false; - config->ignoreS0S1Error = false; - config->offline = false; - config->matchSlaveStartStop = false; - config->maxWriteLength = 256U; - config->maxReadLength = 256U; -} - -/*! - * @brief Initializes the I3C peripheral. - * - */ -void I3C_Init(I3C_Type *base, const i3c_config_t *config, uint32_t sourceClock_Hz) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) || \ - !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) - uint32_t instance = I3C_GetInstance(base); -#endif - uint32_t configValue; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate the clock. */ - CLOCK_EnableClock(kI3cClocks[instance]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) - /* Reset the I3C module */ - RESET_PeripheralReset(kI3cResets[instance]); -#endif - - if ((config->masterDynamicAddress != 0U) && (config->enableMaster == kI3C_MasterOn)) - { - base->MDYNADDR &= ~I3C_MDYNADDR_DADDR_MASK; - base->MDYNADDR |= I3C_MDYNADDR_DADDR(config->masterDynamicAddress) | I3C_MDYNADDR_DAVALID_MASK; - } - - base->MCONFIG = I3C_MCONFIG_MSTENA(config->enableMaster) | I3C_MCONFIG_DISTO(config->disableTimeout) | - I3C_MCONFIG_HKEEP(config->hKeep) | I3C_MCONFIG_ODSTOP(config->enableOpenDrainStop) | - I3C_MCONFIG_ODHPP(config->enableOpenDrainHigh); - -#if defined(FSL_FEATURE_I3C_HAS_START_SCL_DELAY) && FSL_FEATURE_I3C_HAS_START_SCL_DELAY - base->MCONFIG_EXT = I3C_MCONFIG_EXT_I3C_CAS_DEL(config->startSclDelay) | I3C_MCONFIG_EXT_I3C_CASR_DEL(config->restartSclDelay); -#endif - - I3C_MasterSetWatermarks(base, kI3C_TxTriggerUntilOneLessThanFull, kI3C_RxTriggerOnNotEmpty, true, true); - - I3C_MasterSetBaudRate(base, &config->baudRate_Hz, sourceClock_Hz); - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - assert((config->slowClock_Hz >= 1000000U) || (config->slowClock_Hz == 0U)); - - uint8_t matchCount; - /* Set as (slowClk(MHz) - 1) to generate 1us clock cycle. Controller uses it to count 100us timeout. Target uses it as IBI request to drive SDA low. - Note: Use BAMATCH = 1 to generate 1us clock cycle if slow clock is 1MHz. The value of 0 would not give a correct match indication. */ - if (config->slowClock_Hz != 0U) - { - matchCount = (uint8_t)(config->slowClock_Hz / 1000000UL) - 1U; - matchCount = (matchCount == 0U) ? 1U : matchCount; - } - else - { - /* BAMATCH has default value based on Soc default slow clock after reset, using this default value when slowClock_Hz is 0. */ - matchCount = (uint8_t)((base->SCONFIG & I3C_SCONFIG_BAMATCH_MASK) >> I3C_SCONFIG_BAMATCH_SHIFT); - } -#endif - - configValue = base->SCONFIG; - - configValue &= - ~(I3C_SCONFIG_SADDR_MASK | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - I3C_SCONFIG_BAMATCH_MASK | -#endif - I3C_SCONFIG_OFFLINE_MASK | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) - I3C_SCONFIG_IDRAND_MASK | -#endif -#if defined(FSL_FEATURE_I3C_HAS_HDROK) && FSL_FEATURE_I3C_HAS_HDROK - I3C_SCONFIG_HDROK_MASK | -#else - I3C_SCONFIG_DDROK_MASK | -#endif - I3C_SCONFIG_S0IGNORE_MASK | I3C_SCONFIG_MATCHSS_MASK | I3C_SCONFIG_NACK_MASK | I3C_SCONFIG_SLVENA_MASK); - - configValue |= I3C_SCONFIG_SADDR(config->staticAddr) | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - I3C_SCONFIG_BAMATCH(matchCount) | -#endif - I3C_SCONFIG_OFFLINE(config->offline) | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) - I3C_SCONFIG_IDRAND(config->enableRandomPart) | -#endif -#if defined(FSL_FEATURE_I3C_HAS_HDROK) && FSL_FEATURE_I3C_HAS_HDROK - I3C_SCONFIG_HDROK((0U != (config->hdrMode & (uint8_t)kI3C_HDRModeDDR)) ? 1U : 0U) | -#else - I3C_SCONFIG_DDROK((0U != (config->hdrMode & (uint8_t)kI3C_HDRModeDDR)) ? 1U : 0U) | -#endif - I3C_SCONFIG_S0IGNORE(config->ignoreS0S1Error) | I3C_SCONFIG_MATCHSS(config->matchSlaveStartStop) | - I3C_SCONFIG_NACK(config->nakAllRequest) | I3C_SCONFIG_SLVENA(config->enableSlave); - - base->SVENDORID &= ~I3C_SVENDORID_VID_MASK; - base->SVENDORID |= I3C_SVENDORID_VID(config->vendorID); - -#if defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND - base->SIDPARTNO = config->partNumber; -#else - if (!config->enableRandomPart) - { - base->SIDPARTNO = config->partNumber; - } -#endif - - base->SIDEXT &= ~(I3C_SIDEXT_BCR_MASK | I3C_SIDEXT_DCR_MASK); - base->SIDEXT |= I3C_SIDEXT_BCR(config->bcr) | I3C_SIDEXT_DCR(config->dcr); - - base->SMAXLIMITS &= ~(I3C_SMAXLIMITS_MAXRD_MASK | I3C_SMAXLIMITS_MAXWR_MASK); - base->SMAXLIMITS |= (I3C_SMAXLIMITS_MAXRD(config->maxReadLength) | I3C_SMAXLIMITS_MAXWR(config->maxWriteLength)); - - base->SCONFIG = configValue; -} - -/*! - * brief Provides a default configuration for the I3C master peripheral. - * - * This function provides the following default configuration for the I3C master peripheral: - * code - * masterConfig->enableMaster = kI3C_MasterOn; - * masterConfig->disableTimeout = false; - * masterConfig->hKeep = kI3C_MasterHighKeeperNone; - * masterConfig->enableOpenDrainStop = true; - * masterConfig->enableOpenDrainHigh = true; - * masterConfig->baudRate_Hz = 100000U; - * masterConfig->busType = kI3C_TypeI2C; - * endcode - * - * After calling this function, you can override any settings in order to customize the configuration, - * prior to initializing the master driver with I3C_MasterInit(). - * - * param[out] masterConfig User provided configuration structure for default values. Refer to #i3c_master_config_t. - */ -void I3C_MasterGetDefaultConfig(i3c_master_config_t *masterConfig) -{ - (void)memset(masterConfig, 0, sizeof(*masterConfig)); - - masterConfig->enableMaster = kI3C_MasterOn; - masterConfig->disableTimeout = false; - masterConfig->hKeep = kI3C_MasterHighKeeperNone; - masterConfig->enableOpenDrainStop = true; - masterConfig->enableOpenDrainHigh = true; - masterConfig->baudRate_Hz.i2cBaud = 400000U; - masterConfig->baudRate_Hz.i3cPushPullBaud = 12500000U; - masterConfig->baudRate_Hz.i3cOpenDrainBaud = 2500000U; -} - -/*! - * brief Initializes the I3C master peripheral. - * - * This function enables the peripheral clock and initializes the I3C master peripheral as described by the user - * provided configuration. A software reset is performed prior to configuration. - * - * param base The I3C peripheral base address. - * param masterConfig User provided peripheral configuration. Use I3C_MasterGetDefaultConfig() to get a set of - * defaults that you can override. - * param sourceClock_Hz Frequency in Hertz of the I3C functional clock. Used to calculate the baud rate divisors, - * filter widths, and timeout periods. - */ -void I3C_MasterInit(I3C_Type *base, const i3c_master_config_t *masterConfig, uint32_t sourceClock_Hz) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) || \ - !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) - uint32_t instance = I3C_GetInstance(base); -#endif - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate the clock. */ - CLOCK_EnableClock(kI3cClocks[instance]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) - /* Reset the I3C module */ - RESET_PeripheralReset(kI3cResets[instance]); -#endif - base->MCONFIG = I3C_MCONFIG_MSTENA(masterConfig->enableMaster) | I3C_MCONFIG_DISTO(masterConfig->disableTimeout) | - I3C_MCONFIG_HKEEP(masterConfig->hKeep) | I3C_MCONFIG_ODSTOP(masterConfig->enableOpenDrainStop) | - I3C_MCONFIG_ODHPP(masterConfig->enableOpenDrainHigh); - -#if defined(FSL_FEATURE_I3C_HAS_START_SCL_DELAY) && FSL_FEATURE_I3C_HAS_START_SCL_DELAY - base->MCONFIG_EXT = I3C_MCONFIG_EXT_I3C_CAS_DEL(masterConfig->startSclDelay) | I3C_MCONFIG_EXT_I3C_CASR_DEL(masterConfig->restartSclDelay); -#endif - - I3C_MasterSetWatermarks(base, kI3C_TxTriggerUntilOneLessThanFull, kI3C_RxTriggerOnNotEmpty, true, true); - - I3C_MasterSetBaudRate(base, &masterConfig->baudRate_Hz, sourceClock_Hz); - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - assert((masterConfig->slowClock_Hz >= 1000000U) || (masterConfig->slowClock_Hz == 0U)); - - uint32_t configValue; - uint8_t matchCount; - - /* BAMATCH has default value based on Soc default slow clock after reset, using this default value when slowClock_Hz is 0. */ - if (masterConfig->slowClock_Hz != 0U) - { - /* Set as (slowClk(MHz) - 1) to generate 1us clock cycle for 100us timeout. Note: Use BAMATCH = 1 to generate 1us clock cycle - if slow clock is 1MHz. The value of 0 would not give a correct match indication. */ - matchCount = (uint8_t)(masterConfig->slowClock_Hz / 1000000UL) - 1U; - matchCount = (matchCount == 0U) ? 1U : matchCount; - - configValue = base->SCONFIG & I3C_SCONFIG_BAMATCH_MASK; - configValue |= I3C_SCONFIG_BAMATCH(matchCount); - base->SCONFIG = configValue; - } -#endif -} - -/*! - * @brief Gets the I3C master state. - * - * @param base The I3C peripheral base address. - * @return I3C master state. - */ -i3c_master_state_t I3C_MasterGetState(I3C_Type *base) -{ - uint32_t masterState = (base->MSTATUS & I3C_MSTATUS_STATE_MASK) >> I3C_MSTATUS_STATE_SHIFT; - i3c_master_state_t returnCode; - - switch (masterState) - { - case (uint32_t)kI3C_MasterStateIdle: - returnCode = kI3C_MasterStateIdle; - break; - case (uint32_t)kI3C_MasterStateSlvReq: - returnCode = kI3C_MasterStateSlvReq; - break; - case (uint32_t)kI3C_MasterStateMsgSdr: - returnCode = kI3C_MasterStateMsgSdr; - break; - case (uint32_t)kI3C_MasterStateNormAct: - returnCode = kI3C_MasterStateNormAct; - break; - case (uint32_t)kI3C_MasterStateDdr: - returnCode = kI3C_MasterStateDdr; - break; - case (uint32_t)kI3C_MasterStateDaa: - returnCode = kI3C_MasterStateDaa; - break; - case (uint32_t)kI3C_MasterStateIbiAck: - returnCode = kI3C_MasterStateIbiAck; - break; - case (uint32_t)kI3C_MasterStateIbiRcv: - returnCode = kI3C_MasterStateIbiRcv; - break; - default: - returnCode = kI3C_MasterStateIdle; - break; - } - - return returnCode; -} - -/*! - * brief Deinitializes the I3C master peripheral. - * - * This function disables the I3C master peripheral and gates the clock. It also performs a software - * reset to restore the peripheral to reset conditions. - * - * param base The I3C peripheral base address. - */ -void I3C_MasterDeinit(I3C_Type *base) -{ - uint32_t idx = I3C_GetInstance(base); - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) - /* Reset the I3C module */ - RESET_PeripheralReset(kI3cResets[idx]); -#endif - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate clock. */ - CLOCK_DisableClock(kI3cClocks[idx]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Reset handle pointer. */ - s_i3cMasterHandle[idx] = NULL; -} - -static uint32_t I3C_CalcErrorRatio(uint32_t curFreq, uint32_t desiredFreq) -{ - if (curFreq > desiredFreq) - { - return (curFreq - desiredFreq) * 100UL / desiredFreq; - } - else - { - return (desiredFreq - curFreq) * 100UL / desiredFreq; - } -} - -/*! - * brief Sets the I3C bus frequency for master transactions. - * - * The I3C master is automatically disabled and re-enabled as necessary to configure the baud - * rate. Do not call this function during a transfer, or the transfer is aborted. - * - * param base The I3C peripheral base address. - * param baudRate_Hz Pointer to structure of requested bus frequency in Hertz. - * param sourceClock_Hz I3C functional clock frequency in Hertz. - */ -void I3C_MasterSetBaudRate(I3C_Type *base, const i3c_baudrate_hz_t *baudRate_Hz, uint32_t sourceClock_Hz) -{ - uint32_t div, freq; - uint32_t divEven, divOdd; - uint32_t ppBaud, odBaud, i2cBaud; - uint32_t errRate0, errRate1; - uint32_t i3cPPBaud_HZ = baudRate_Hz->i3cPushPullBaud; - uint32_t i3cPPBaudMax_HZ = i3cPPBaud_HZ / 10U + i3cPPBaud_HZ; /* max is 1.1*i3cPPBaud_HZ */ - uint32_t i3cODBaud_HZ = baudRate_Hz->i3cOpenDrainBaud; - uint32_t i3cODBaudMax_HZ = i3cODBaud_HZ / 10U + i3cODBaud_HZ; /* max is 1.1*i3cODBaud_HZ */ - uint32_t i2cBaud_HZ = baudRate_Hz->i2cBaud; - uint32_t i3cPPLow_Ns, i3cOdLow_Ns; - bool isODHigh = (0U != (base->MCONFIG & I3C_MCONFIG_ODHPP_MASK)) ? true : false; - - /* Find out the div to generate target freq */ - freq = sourceClock_Hz / 2UL; - /* ppFreq = FCLK / 2 / (PPBAUD + 1)), 0 <= PPBAUD <= 15 */ - /* We need PPBAUD generate 12.5MHz or so. */ - div = freq / i3cPPBaud_HZ; - div = (div == 0UL) ? 1UL : div; - if (freq / div > i3cPPBaudMax_HZ) - { - div++; - } - assert(div <= FSL_I3C_PPBAUD_DIV_MAX); - ppBaud = div - 1UL; - freq /= div; - - i3cPPLow_Ns = (uint32_t)(NSEC_PER_SEC / (2UL * freq)); - - /* We need ODBAUD generate 2.5MHz or so. */ - if (isODHigh) - { - /* odFreq = (2*freq) / (ODBAUD + 2), 1 <= ODBAUD <= 255 */ - div = (2UL * freq) / i3cODBaud_HZ; - div = div < 2UL ? 2UL : div; - if ((2UL * freq / div) > i3cODBaudMax_HZ) - { - div++; - } - odBaud = div - 2UL; - freq = (2UL * freq) / div; - } - else - { - /* odFreq = ppFreq / (ODBAUD + 1), 1 <= ODBAUD <= 255 */ - div = freq / i3cODBaud_HZ; - div = div < 1UL ? 1UL : div; - if (freq / div > i3cODBaudMax_HZ) - { - div++; - } - odBaud = div - 1UL; - freq /= div; - } - - i3cOdLow_Ns = (odBaud + 1UL) * i3cPPLow_Ns; - - /* i2cFreq = odFreq / (I2CBAUD + 1), 0 <= I2CBAUD <= 7 (I2CBAUD need << 1 in register) */ - /* i2cFreq = NSEC_PER_SEC / (I2CBAUD + 1)*i3cOdLow_Ns */ - divEven = (sourceClock_Hz / i2cBaud_HZ) / (2UL * (ppBaud + 1UL) * (odBaud + 1UL)); - divEven = divEven == 0UL ? 1UL : divEven; - errRate0 = I3C_CalcErrorRatio((uint32_t)(NSEC_PER_SEC / (2UL * divEven * i3cOdLow_Ns)), i2cBaud_HZ); - - divOdd = ((sourceClock_Hz / i2cBaud_HZ) / ((ppBaud + 1UL) * (odBaud + 1UL) - 1UL)) / 2UL; - divOdd = divOdd == 0UL ? 1UL : divOdd; - errRate1 = I3C_CalcErrorRatio((uint32_t)(NSEC_PER_SEC / ((2UL * divOdd + 1UL) * i3cOdLow_Ns)), i2cBaud_HZ); - - if (errRate0 < FSL_I3C_ERROR_RATE_MAX || errRate1 < FSL_I3C_ERROR_RATE_MAX) - { - /* Use this div */ - i2cBaud = errRate0 < errRate1 ? (divEven - 1UL) * 2UL : (divOdd - 1UL) * 2UL + 1UL; - } - else - { - /* Use div + 1, unless current freq is already lower than desired. */ - i2cBaud = freq / divEven < i2cBaud_HZ ? (divEven - 1UL) * 2UL : divEven * 2UL; - } - - base->MCONFIG = (base->MCONFIG & ~(I3C_MCONFIG_PPBAUD_MASK | I3C_MCONFIG_PPLOW_MASK | I3C_MCONFIG_ODBAUD_MASK | - I3C_MCONFIG_I2CBAUD_MASK)) | - I3C_MCONFIG_PPBAUD(ppBaud) | I3C_MCONFIG_ODBAUD(odBaud) | I3C_MCONFIG_I2CBAUD(i2cBaud); -} - -/*! - * brief Sends a START signal and slave address on the I2C/I3C bus, receive size is also specified - * in the call. - * This function is used to initiate a new master mode transfer. First, the bus state is checked to ensure - * that another master is not occupying the bus. Then a START signal is transmitted, followed by the - * 7-bit address specified in the a address parameter. Note that this function does not actually wait - * until the START and address are successfully sent on the bus before returning. - * - * param base The I3C peripheral base address. - * param type The bus type to use in this transaction. - * param address 7-bit slave device address, in bits [6:0]. - * param dir Master transfer direction, either #kI3C_Read or #kI3C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * param rxSize Read terminate size for the followed read transfer, limit to 255 bytes. - * retval #kStatus_Success START signal and address were successfully enqueued in the transmit FIFO. - * retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - */ -status_t I3C_MasterStartWithRxSize( - I3C_Type *base, i3c_bus_type_t type, uint8_t address, i3c_direction_t dir, uint8_t rxSize) -{ - i3c_master_state_t masterState = I3C_MasterGetState(base); - bool checkDdrState = (type == kI3C_TypeI3CDdr) ? (masterState != kI3C_MasterStateDdr) : true; - if ((masterState != kI3C_MasterStateIdle) && (masterState != kI3C_MasterStateNormAct) && checkDdrState) - { - return kStatus_I3C_Busy; - } - - return I3C_MasterRepeatedStartWithRxSize(base, type, address, dir, rxSize); -} - -/*! - * brief Sends a START signal and slave address on the I2C/I3C bus. - * - * This function is used to initiate a new master mode transfer. First, the bus state is checked to ensure - * that another master is not occupying the bus. Then a START signal is transmitted, followed by the - * 7-bit address specified in the a address parameter. Note that this function does not actually wait - * until the START and address are successfully sent on the bus before returning. - * - * param base The I3C peripheral base address. - * param type The bus type to use in this transaction. - * param address 7-bit slave device address, in bits [6:0]. - * param dir Master transfer direction, either #kI3C_Read or #kI3C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * retval #kStatus_Success START signal and address were successfully enqueued in the transmit FIFO. - * retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - */ -status_t I3C_MasterStart(I3C_Type *base, i3c_bus_type_t type, uint8_t address, i3c_direction_t dir) -{ - i3c_master_state_t masterState = I3C_MasterGetState(base); - bool checkDdrState = (type == kI3C_TypeI3CDdr) ? (masterState != kI3C_MasterStateDdr) : true; - if ((masterState != kI3C_MasterStateIdle) && (masterState != kI3C_MasterStateNormAct) && checkDdrState) - { - return kStatus_I3C_Busy; - } - - return I3C_MasterStartWithRxSize(base, type, address, dir, 0); -} - -/*! - * brief Sends a repeated START signal and slave address on the I2C/I3C bus, receive size is also specified - * in the call. - * - * This function is used to send a Repeated START signal when a transfer is already in progress. Like - * I3C_MasterStart(), it also sends the specified 7-bit address. Call this API also configures the read - * terminate size for the following read transfer. For example, set the rxSize = 2, the following read transfer - * will be terminated after two bytes of data received. Write transfer will not be affected by the rxSize - * configuration. - * - * note This function exists primarily to maintain compatible APIs between I3C and I2C drivers, - * as well as to better document the intent of code that uses these APIs. - * - * param base The I3C peripheral base address. - * param type The bus type to use in this transaction. - * param address 7-bit slave device address, in bits [6:0]. - * param dir Master transfer direction, either #kI3C_Read or #kI3C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * param rxSize Read terminate size for the followed read transfer, limit to 255 bytes. - * retval #kStatus_Success Repeated START signal and address were successfully enqueued in the transmit FIFO. - */ -status_t I3C_MasterRepeatedStartWithRxSize( - I3C_Type *base, i3c_bus_type_t type, uint8_t address, i3c_direction_t dir, uint8_t rxSize) -{ - uint32_t mctrlVal; - - /* Clear all flags. */ - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - -#if defined(FSL_FEATURE_I3C_HAS_ERRATA_051617) && (FSL_FEATURE_I3C_HAS_ERRATA_051617) - /* ERRATA051617: When used as I2C controller generates repeated START randomly before the STOP under PVT condition. - This issue is caused by a glitch at the output of an internal clock MUX. The glitch when generates acts as a clock - pulse which causes the SDA line to fall early during SCL high period and creates the unintended Repeated START before - actual STOP. */ - if (type == kI3C_TypeI2C) - { - base->MCONFIG |= I3C_MCONFIG_SKEW(1); - } - else - { - base->MCONFIG &= ~I3C_MCONFIG_SKEW_MASK; - } -#endif - - /* Issue start command. */ - mctrlVal = base->MCTRL; - mctrlVal &= ~(I3C_MCTRL_TYPE_MASK | I3C_MCTRL_REQUEST_MASK | I3C_MCTRL_DIR_MASK | I3C_MCTRL_ADDR_MASK | - I3C_MCTRL_RDTERM_MASK); - mctrlVal |= I3C_MCTRL_TYPE(type) | I3C_MCTRL_REQUEST(kI3C_RequestEmitStartAddr) | I3C_MCTRL_DIR(dir) | - I3C_MCTRL_ADDR(address) | I3C_MCTRL_RDTERM(rxSize); - - base->MCTRL = mctrlVal; - - return kStatus_Success; -} -/*! - * brief Sends a STOP signal on the I2C/I3C bus. - * - * This function does not return until the STOP signal is seen on the bus, or an error occurs. - * - * param base The I3C peripheral base address. - * retval #kStatus_Success The STOP signal was successfully sent on the bus and the transaction terminated. - * retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * retval #kStatus_I3C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_I3C_FifoError FIFO under run or overrun. - * retval #kStatus_I3C_ArbitrationLost Arbitration lost error. - * retval #kStatus_I3C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t I3C_MasterStop(I3C_Type *base) -{ - return I3C_MasterEmitStop(base, true); -} - -/*! - * brief I3C master emit request. - * - * param base The I3C peripheral base address. - * param masterReq I3C master request of type #i3c_bus_request_t - */ -void I3C_MasterEmitRequest(I3C_Type *base, i3c_bus_request_t masterReq) -{ - uint32_t mctrlReg = base->MCTRL; - - mctrlReg &= ~I3C_MCTRL_REQUEST_MASK; - - if (masterReq == kI3C_RequestProcessDAA) - { - mctrlReg &= ~I3C_MCTRL_TYPE_MASK; - } - - mctrlReg |= I3C_MCTRL_REQUEST(masterReq); - - base->MCTRL = mctrlReg; -} - -/*! - * brief I3C master register IBI rule. - * - * param base The I3C peripheral base address. - * param ibiRule Pointer to ibi rule description of type #i3c_register_ibi_addr_t - */ -void I3C_MasterRegisterIBI(I3C_Type *base, i3c_register_ibi_addr_t *ibiRule) -{ - assert(NULL != ibiRule); - uint32_t ruleValue = I3C_MIBIRULES_MSB0_MASK; - - for (uint32_t count = 0; count < ARRAY_SIZE(ibiRule->address); count++) - { - ruleValue |= ((uint32_t)ibiRule->address[count]) << (count * I3C_MIBIRULES_ADDR1_SHIFT); - } - - ruleValue &= ~I3C_MIBIRULES_NOBYTE_MASK; - - if (!ibiRule->ibiHasPayload) - { - ruleValue |= I3C_MIBIRULES_NOBYTE_MASK; - } - - base->MIBIRULES = ruleValue; -} - -/*! - * brief I3C master get IBI rule. - * - * param base The I3C peripheral base address. - * param ibiRule Pointer to store the read out ibi rule description. - */ -void I3C_MasterGetIBIRules(I3C_Type *base, i3c_register_ibi_addr_t *ibiRule) -{ - assert(NULL != ibiRule); - - uint32_t ruleValue = base->MIBIRULES; - - for (uint32_t count = 0; count < ARRAY_SIZE(ibiRule->address); count++) - { - ibiRule->address[count] = - (uint8_t)(ruleValue >> (count * I3C_MIBIRULES_ADDR1_SHIFT)) & I3C_MIBIRULES_ADDR0_MASK; - } - - ibiRule->ibiHasPayload = (0U == (ruleValue & I3C_MIBIRULES_NOBYTE_MASK)); -} - -/*! - * brief Performs a polling receive transfer on the I2C/I3C bus. - * - * param base The I3C peripheral base address. - * param rxBuff The pointer to the data to be transferred. - * param rxSize The length in bytes of the data to be transferred. - * param flags Bit mask of options for the transfer. See enumeration #_i3c_master_transfer_flags for available options. - * retval #kStatus_Success Data was received successfully. - * retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * retval #kStatus_I3C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_I3C_FifoError FIFO under run or overrun. - * retval #kStatus_I3C_ArbitrationLost Arbitration lost error. - * retval #kStatus_I3C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t I3C_MasterReceive(I3C_Type *base, void *rxBuff, size_t rxSize, uint32_t flags) -{ - status_t result = kStatus_Success; - bool isRxAutoTerm = ((flags & (uint32_t)kI3C_TransferRxAutoTermFlag) != 0UL); - bool completed = false; - uint32_t status; - uint8_t *buf; - - assert(NULL != rxBuff); - - /* Handle empty read. */ - if (rxSize == 0UL) - { - return kStatus_Success; - } - -#if I3C_RETRY_TIMES - uint32_t waitTimes = I3C_RETRY_TIMES; -#endif - - /* Receive data */ - buf = (uint8_t *)rxBuff; - - while ((rxSize != 0UL) || !completed) - { -#if I3C_RETRY_TIMES - if (--waitTimes == 0) - { - return kStatus_I3C_Timeout; - } -#endif - /* Check for errors. */ - result = I3C_MasterCheckAndClearError(base, I3C_MasterGetErrorStatusFlags(base)); - if (kStatus_Success != result) - { - return result; - } - - /* Check complete flag */ - if (!completed) - { - status = I3C_MasterGetStatusFlags(base) & (uint32_t)kI3C_MasterCompleteFlag; - if (0UL != status) - { - completed = true; - /* Clear complete flag */ - I3C_MasterClearStatusFlags(base, (uint32_t)kI3C_MasterCompleteFlag); - /* Send stop if needed */ - if ((flags & (uint32_t)kI3C_TransferNoStopFlag) == 0UL) - { - if (I3C_MasterGetState(base) == kI3C_MasterStateDdr) - { - I3C_MasterEmitRequest(base, kI3C_RequestForceExit); - result = I3C_MasterWaitForCtrlDone(base, false); - } - else - { - result = I3C_MasterEmitStop(base, false); - } - if (kStatus_Success != result) - { - return result; - } - } - } - } - - /* Check RX data */ - if ((0UL != rxSize) && (0UL != (base->MDATACTRL & I3C_MDATACTRL_RXCOUNT_MASK))) - { - *buf++ = (uint8_t)(base->MRDATAB & I3C_MRDATAB_VALUE_MASK); - rxSize--; - if ((flags & (uint32_t)kI3C_TransferDisableRxTermFlag) == 0UL) - { - if ((!isRxAutoTerm) && (rxSize == 1U)) - { - base->MCTRL |= I3C_MCTRL_RDTERM(1U); - } - } - } - } - - /* Wait idle if stop is sent. */ - if ((flags & (uint32_t)kI3C_TransferNoStopFlag) == 0UL) - { -#if I3C_RETRY_TIMES - while ((I3C_MasterGetState(base) != kI3C_MasterStateIdle) && --waitTimes) -#else - while (I3C_MasterGetState(base) != kI3C_MasterStateIdle) -#endif - { - } - } - return result; -} - -/*! - * brief Performs a polling send transfer on the I2C/I3C bus. - * - * Sends up to a txSize number of bytes to the previously addressed slave device. The slave may - * reply with a NAK to any byte in order to terminate the transfer early. If this happens, this - * function returns #kStatus_I3C_Nak. - * - * param base The I3C peripheral base address. - * param txBuff The pointer to the data to be transferred. - * param txSize The length in bytes of the data to be transferred. - * param flags Bit mask of options for the transfer. See enumeration #_i3c_master_transfer_flags for available options. - * retval #kStatus_Success Data was sent successfully. - * retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * retval #kStatus_I3C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_I3C_FifoError FIFO under run or over run. - * retval #kStatus_I3C_ArbitrationLost Arbitration lost error. - * retval #kStatus_I3C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t I3C_MasterSend(I3C_Type *base, const void *txBuff, size_t txSize, uint32_t flags) -{ - i3c_puint8_to_u32_t buf; - buf.cpuint8 = (const uint8_t *)((const void *)txBuff); - status_t result = kStatus_Success; - bool enableWord = ((flags & (uint32_t)kI3C_TransferWordsFlag) == (uint32_t)kI3C_TransferWordsFlag) ? true : false; - uint8_t byteCounts = enableWord ? 2U : 1U; - - assert(NULL != txBuff); - if (enableWord) - { - assert(txSize % 2UL == 0UL); - } - - /* Send data buffer */ - while (0UL != txSize) - { - /* Wait until there is room in the fifo. This also checks for errors. */ - result = I3C_MasterWaitForTxReady(base, byteCounts); - if (kStatus_Success != result) - { - return result; - } - - /* Write byte into I3C master data register. */ - if (txSize > byteCounts) - { - if (enableWord) - { - base->MWDATAH = (uint32_t)buf.cpuint8[1] << 8UL | (uint32_t)buf.cpuint8[0]; - } - else - { - base->MWDATAB = *buf.cpuint8; - } - } - else - { - if (enableWord) - { - base->MWDATAHE = (uint32_t)buf.cpuint8[1] << 8UL | (uint32_t)buf.cpuint8[0]; - } - else - { - base->MWDATABE = *buf.cpuint8; - } - } - - buf.u32 = buf.u32 + byteCounts; - txSize = txSize - byteCounts; - } - - result = I3C_MasterWaitForComplete(base, false); - if ((result == kStatus_Success) && ((flags & (uint32_t)kI3C_TransferNoStopFlag) == 0UL)) - { - if (I3C_MasterGetState(base) == kI3C_MasterStateDdr) - { - I3C_MasterEmitRequest(base, kI3C_RequestForceExit); - result = I3C_MasterWaitForCtrlDone(base, false); - } - else - { - result = I3C_MasterEmitStop(base, true); - } - } - - return result; -} - -/*! - * brief Performs a DAA in the i3c bus with specified temporary baud rate. - * - * param base The I3C peripheral base address. - * param addressList The pointer for address list which is used to do DAA. - * param count The address count in the address list. - * param daaBaudRate The temporary baud rate in DAA process, NULL for using initial setting. - * The initial setting is set back between the completion of the DAA and the return of this function. - * retval #kStatus_Success The transaction was started successfully. - * retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - * retval #kStatus_I3C_SlaveCountExceed The I3C slave count has exceed the definition in I3C_MAX_DEVCNT. - */ -status_t I3C_MasterProcessDAASpecifiedBaudrate(I3C_Type *base, - uint8_t *addressList, - uint32_t count, - i3c_master_daa_baudrate_t *daaBaudRate) -{ - assert(addressList != NULL); - assert(count != 0U); - - status_t result = kStatus_Success; - uint8_t rxBuffer[8] = {0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU}; - uint32_t masterConfig = 0; - uint32_t devCount = 0; - uint8_t rxSize = 0; - bool mctrlDone = false; - i3c_baudrate_hz_t baudRate_Hz; - uint32_t errStatus; - uint32_t status; - size_t rxCount; - - /* Return an error if the bus is already in use not by us. */ - result = I3C_CheckForBusyBus(base); - if (kStatus_Success != result) - { - return result; - } - - /* Clear all flags. */ - I3C_MasterClearErrorStatusFlags(base, (uint32_t)kMasterErrorFlags); - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - - /* Disable I3C IRQ sources while we configure stuff. */ - uint32_t enabledInts = I3C_MasterGetEnabledInterrupts(base); - I3C_MasterDisableInterrupts(base, enabledInts); - - /* Temporarily adjust baud rate before DAA. */ - if (daaBaudRate != NULL) - { - masterConfig = base->MCONFIG; - /* Set non-zero value for I2C baud rate which is useless here. */ - baudRate_Hz.i2cBaud = 1; - baudRate_Hz.i3cOpenDrainBaud = daaBaudRate->i3cOpenDrainBaud; - baudRate_Hz.i3cPushPullBaud = daaBaudRate->i3cPushPullBaud; - I3C_MasterSetBaudRate(base, &baudRate_Hz, daaBaudRate->sourceClock_Hz); - } - - /* Emit process DAA */ - I3C_MasterEmitRequest(base, kI3C_RequestProcessDAA); - - do - { - status = I3C_MasterGetStatusFlags(base); - - /* Check for error flags. */ - errStatus = I3C_MasterGetErrorStatusFlags(base); - result = I3C_MasterCheckAndClearError(base, errStatus); - if (kStatus_Success != result) - { - break; - } - - if ((!mctrlDone) || (rxSize < 8U)) - { - I3C_MasterGetFifoCounts(base, &rxCount, NULL); - - if (rxCount != 0U) - { - rxBuffer[rxSize++] = (uint8_t)(base->MRDATAB & I3C_MRDATAB_VALUE_MASK); - } - - if ((status & (uint32_t)kI3C_MasterControlDoneFlag) != 0U) - { - I3C_MasterClearStatusFlags(base, (uint32_t)kI3C_MasterControlDoneFlag); - mctrlDone = true; - } - } - else if ((I3C_MasterGetState(base) == kI3C_MasterStateDaa) && - (0UL != (I3C_MasterGetStatusFlags(base) & (uint32_t)kI3C_MasterBetweenFlag))) - { - if (((devCount + 1UL) > count) || ((devCount + 1UL) > I3C_MAX_DEVCNT)) - { - result = kStatus_I3C_SlaveCountExceed; - break; - } - - /* Assign the dynamic address from address list. */ - devList[devCount].dynamicAddr = *addressList++; - base->MWDATAB = devList[devCount].dynamicAddr; - - /* Emit process DAA again. */ - I3C_MasterEmitRequest(base, kI3C_RequestProcessDAA); - - devList[devCount].vendorID = (((uint16_t)rxBuffer[0] << 8U | (uint16_t)rxBuffer[1]) & 0xFFFEU) >> 1U; - devList[devCount].partNumber = ((uint32_t)rxBuffer[2] << 24U | (uint32_t)rxBuffer[3] << 16U | - (uint32_t)rxBuffer[4] << 8U | (uint32_t)rxBuffer[5]); - devList[devCount].bcr = rxBuffer[6]; - devList[devCount].dcr = rxBuffer[7]; - devCount++; - usedDevCount++; - - /* Ready to handle next device. */ - mctrlDone = false; - rxSize = 0; - } - else - { - /* Intentional empty */ - } - } while ((status & (uint32_t)kI3C_MasterCompleteFlag) != (uint32_t)kI3C_MasterCompleteFlag); - - /* Master stops DAA if slave device number exceeds the prepared address number. */ - if (result == kStatus_I3C_SlaveCountExceed) - { - /* Send the STOP signal */ - base->MCTRL = (base->MCTRL & ~(I3C_MCTRL_REQUEST_MASK | I3C_MCTRL_DIR_MASK | I3C_MCTRL_RDTERM_MASK)) | - I3C_MCTRL_REQUEST(kI3C_RequestEmitStop); - } - - /* Set back initial baud rate after DAA is over. */ - if (daaBaudRate != NULL) - { - base->MCONFIG = masterConfig; - } - - /* Clear all flags. */ - I3C_MasterClearErrorStatusFlags(base, (uint32_t)kMasterErrorFlags); - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - - /* Enable I3C IRQ sources while we configure stuff. */ - I3C_MasterEnableInterrupts(base, enabledInts); - - return result; -} - -/*! - * brief Get device information list after DAA process is done. - * - * param base The I3C peripheral base address. - * param[out] count The pointer to store the available device count. - * return Pointer to the i3c_device_info_t array. - */ -i3c_device_info_t *I3C_MasterGetDeviceListAfterDAA(I3C_Type *base, uint8_t *count) -{ - assert(NULL != count); - - *count = usedDevCount; - - return devList; -} - -/*! - * @brief introduce function I3C_MasterClearFlagsAndEnableIRQ. - * - * This function was used of Clear all flags and Enable I3C IRQ sources for @param *base. - * - * @param base The I3C peripheral base address. - */ -static void I3C_MasterClearFlagsAndEnableIRQ(I3C_Type *base) -{ - /* Clear all flags. */ - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - /* Enable I3C IRQ sources. */ - I3C_MasterEnableInterrupts(base, (uint32_t)kMasterIrqFlags); -} - -/*! - * @brief introduce function I3C_MasterTransferNoStartFlag. - * - * This function was used of Check if device request wins arbitration. - * - * @param base The I3C peripheral base address. - * @param transfer Pointer to the transfer structure. - * @retval #true if the device wins arbitration. - * @retval #false if the device not wins arbitration. - */ -static bool I3C_MasterTransferNoStartFlag(I3C_Type *base, i3c_master_transfer_t *transfer) -{ - /* Wait tx fifo empty. */ - size_t txCount = 0xFFUL; - - while (txCount != 0U) - { - I3C_MasterGetFifoCounts(base, NULL, &txCount); - } - - /* Check if device request wins arbitration. */ - if (0UL != (I3C_MasterGetStatusFlags(base) & (uint32_t)kI3C_MasterArbitrationWonFlag)) - { - I3C_MasterClearFlagsAndEnableIRQ(base); - return true; - } - return false; -} - -/*! - * brief Performs a master polling transfer on the I2C/I3C bus. - * - * note The API does not return until the transfer succeeds or fails due - * to error happens during transfer. - * - * param base The I3C peripheral base address. - * param transfer Pointer to the transfer structure. - * retval #kStatus_Success Data was received successfully. - * retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * retval #kStatus_I3C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_I3C_FifoError FIFO under run or overrun. - * retval #kStatus_I3C_ArbitrationLost Arbitration lost error. - * retval #kStatus_I3C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t I3C_MasterTransferBlocking(I3C_Type *base, i3c_master_transfer_t *transfer) -{ - assert(NULL != transfer); - assert(transfer->subaddressSize <= sizeof(transfer->subaddress)); - - status_t result = kStatus_Success; - i3c_direction_t direction = transfer->direction; - i3c_master_state_t masterState = I3C_MasterGetState(base); - bool checkDdrState = false; - i3c_rx_term_ops_t rxTermOps; - - /* Return an error if the bus is already in use not by us. */ - checkDdrState = (transfer->busType == kI3C_TypeI3CDdr) ? (masterState != kI3C_MasterStateDdr) : true; - - if ((masterState != kI3C_MasterStateIdle) && (masterState != kI3C_MasterStateNormAct) && checkDdrState) - { - return kStatus_I3C_Busy; - } - - /* Clear all flags. */ - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - /* Reset fifos. These flags clear automatically. */ - base->MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - - /* Disable I3C IRQ sources while we configure stuff. */ - I3C_MasterDisableInterrupts(base, (uint32_t)kMasterIrqFlags); - - if (transfer->busType != kI3C_TypeI3CDdr) - { - direction = (0UL != transfer->subaddressSize) ? kI3C_Write : transfer->direction; - } - - /* True: Set Rx termination bytes at start point, False: Set Rx termination one bytes in advance. */ - if ((transfer->flags & (uint32_t)kI3C_TransferDisableRxTermFlag) != 0U) - { - rxTermOps = kI3C_RxTermDisable; - } - else if (transfer->dataSize <= 255U) - { - rxTermOps = kI3C_RxAutoTerm; - } - else - { - rxTermOps = kI3C_RxTermLastByte; - } - - if (0UL != (transfer->flags & (uint32_t)kI3C_TransferStartWithBroadcastAddr)) - { - if (0UL != (transfer->flags & (uint32_t)kI3C_TransferNoStartFlag)) - { - return kStatus_InvalidArgument; - } - - if (0UL != (transfer->flags & (uint32_t)kI3C_TransferRepeatedStartFlag)) - { - return kStatus_InvalidArgument; - } - - /* Issue 0x7E as start. */ - result = I3C_MasterStart(base, transfer->busType, 0x7E, kI3C_Write); - if (result != kStatus_Success) - { - return result; - } - - result = I3C_MasterWaitForCtrlDone(base, false); - if (result != kStatus_Success) - { - return result; - } - } - - if (0UL == (transfer->flags & (uint32_t)kI3C_TransferNoStartFlag)) - { - if ((direction == kI3C_Read) && (rxTermOps == kI3C_RxAutoTerm)) - { - result = I3C_MasterStartWithRxSize(base, transfer->busType, transfer->slaveAddress, direction, - (uint8_t)transfer->dataSize); - } - else - { - result = I3C_MasterStart(base, transfer->busType, transfer->slaveAddress, direction); - } - if (result != kStatus_Success) - { - return result; - } - - result = I3C_MasterWaitForCtrlDone(base, false); - if (result != kStatus_Success) - { - return result; - } - - if (true == I3C_MasterTransferNoStartFlag(base, transfer)) - { - return kStatus_I3C_IBIWon; - } - } - else - { - if ((direction == kI3C_Read) && (rxTermOps != kI3C_RxTermDisable)) - { - /* Can't set Rx termination more than one bytes in advance without START. */ - rxTermOps = kI3C_RxTermLastByte; - } - } - - /* Subaddress, MSB first. */ - if (0U != transfer->subaddressSize) - { - uint32_t subaddressRemaining = transfer->subaddressSize; - while (0UL != subaddressRemaining--) - { - uint8_t subaddressByte = (uint8_t)((transfer->subaddress >> (8UL * subaddressRemaining)) & 0xFFUL); - - result = I3C_MasterWaitForTxReady(base, 1U); - - if ((0UL == subaddressRemaining) && ((transfer->direction == kI3C_Read) || (0UL == transfer->dataSize)) && - (transfer->busType != kI3C_TypeI3CDdr)) - { - base->MWDATABE = subaddressByte; - result = I3C_MasterWaitForComplete(base, false); - if (kStatus_Success != result) - { - if (result == kStatus_I3C_Nak) - { - (void)I3C_MasterEmitStop(base, true); - } - I3C_MasterClearFlagsAndEnableIRQ(base); - return result; - } - } - else - { - base->MWDATAB = subaddressByte; - } - } - /* Need to send repeated start if switching directions to read. */ - if ((transfer->busType != kI3C_TypeI3CDdr) && (0UL != transfer->dataSize) && (transfer->direction == kI3C_Read)) - { - if (rxTermOps == kI3C_RxAutoTerm) - { - result = I3C_MasterRepeatedStartWithRxSize(base, transfer->busType, transfer->slaveAddress, kI3C_Read, - (uint8_t)transfer->dataSize); - } - else - { - result = I3C_MasterRepeatedStart(base, transfer->busType, transfer->slaveAddress, kI3C_Read); - } - - if (kStatus_Success != result) - { - I3C_MasterClearFlagsAndEnableIRQ(base); - return result; - } - - result = I3C_MasterWaitForCtrlDone(base, false); - if (result != kStatus_Success) - { - return result; - } - } - } - - if (rxTermOps == kI3C_RxAutoTerm) - { - transfer->flags |= (uint32_t)kI3C_TransferRxAutoTermFlag; - } - else - { - transfer->flags &= ~(uint32_t)kI3C_TransferRxAutoTermFlag; - } - - /* Transmit data. */ - if ((transfer->direction == kI3C_Write) && (transfer->dataSize > 0UL)) - { - /* Send Data. */ - result = I3C_MasterSend(base, transfer->data, transfer->dataSize, transfer->flags); - } - /* Receive Data. */ - else if ((transfer->direction == kI3C_Read) && (transfer->dataSize > 0UL)) - { - result = I3C_MasterReceive(base, transfer->data, transfer->dataSize, transfer->flags); - } - else - { - if ((transfer->flags & (uint32_t)kI3C_TransferNoStopFlag) == 0UL) - { - result = I3C_MasterEmitStop(base, true); - } - } - - if (result == kStatus_I3C_Nak) - { - (void)I3C_MasterEmitStop(base, true); - } - - I3C_MasterClearFlagsAndEnableIRQ(base); - - return result; -} - -/*! - * brief Creates a new handle for the I3C master non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the I3C_MasterTransferAbort() API shall be called. - * - * - * note The function also enables the NVIC IRQ for the input I3C. Need to notice - * that on some SoCs the I3C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - * - * param base The I3C peripheral base address. - * param[out] handle Pointer to the I3C master driver handle. - * param callback User provided pointer to the asynchronous callback function. - * param userData User provided pointer to the application callback data. - */ -void I3C_MasterTransferCreateHandle(I3C_Type *base, - i3c_master_handle_t *handle, - const i3c_master_transfer_callback_t *callback, - void *userData) -{ - uint32_t instance; - - assert(NULL != handle); - - /* Clear out the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Look up instance number */ - instance = I3C_GetInstance(base); - - /* Save base and instance. */ - handle->callback = *callback; - handle->userData = userData; - - /* Save this handle for IRQ use. */ - s_i3cMasterHandle[instance] = handle; - - /* Set irq handler. */ - s_i3cMasterIsr = I3C_MasterTransferHandleIRQ; - - /* Clear all flags. */ - I3C_MasterClearErrorStatusFlags(base, (uint32_t)kMasterErrorFlags); - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - /* Reset fifos. These flags clear automatically. */ - base->MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - - /* Enable NVIC IRQ, this only enables the IRQ directly connected to the NVIC. - In some cases the I3C IRQ is configured through INTMUX, user needs to enable - INTMUX IRQ in application code. */ - (void)EnableIRQ(kI3cIrqs[instance]); - - /* Clear internal IRQ enables and enable NVIC IRQ. */ - I3C_MasterEnableInterrupts(base, (uint32_t)kMasterIrqFlags); -} - -static void I3C_TransferStateMachineIBIWonState(I3C_Type *base, - i3c_master_handle_t *handle, - i3c_master_state_machine_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - if (stateParams->masterState == kI3C_MasterStateIbiAck) - { - handle->ibiType = I3C_GetIBIType(base); - if (handle->callback.ibiCallback != NULL) - { - handle->callback.ibiCallback(base, handle, handle->ibiType, kI3C_IbiAckNackPending); - } - else - { - I3C_MasterEmitIBIResponse(base, kI3C_IbiRespNack); - } - } - - /* Make sure there is data in the rx fifo. */ - if (0UL != stateParams->rxCount) - { - if ((handle->ibiBuff == NULL) && (handle->callback.ibiCallback != NULL)) - { - handle->callback.ibiCallback(base, handle, kI3C_IbiNormal, kI3C_IbiDataBuffNeed); - } - uint8_t tempData = (uint8_t)base->MRDATAB; - if (handle->ibiBuff != NULL) - { - handle->ibiBuff[handle->ibiPayloadSize++] = tempData; - } - (stateParams->rxCount)--; - return; - } - else if (0UL != (stateParams->status & (uint32_t)kI3C_MasterCompleteFlag)) - { - handle->ibiType = I3C_GetIBIType(base); - handle->ibiAddress = I3C_GetIBIAddress(base); - stateParams->state_complete = true; - stateParams->result = kStatus_I3C_IBIWon; - } - else - { - stateParams->state_complete = true; - } -} - -static void I3C_TransferStateMachineSendCommandState(I3C_Type *base, - i3c_master_handle_t *handle, - i3c_master_state_machine_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - I3C_MasterEnableInterrupts(base, (uint32_t)kI3C_MasterTxReadyFlag); - /* Make sure there is room in the tx fifo for the next command. */ - if (0UL == (stateParams->txCount)--) - { - stateParams->state_complete = true; - return; - } - if (handle->transfer.subaddressSize > 1U) - { - handle->transfer.subaddressSize--; - base->MWDATAB = (uint8_t)((handle->transfer.subaddress) >> (8U * handle->transfer.subaddressSize)); - } - else if (handle->transfer.subaddressSize == 1U) - { - handle->transfer.subaddressSize--; - - if ((handle->transfer.direction == kI3C_Read) || (0UL == handle->transfer.dataSize)) - { - base->MWDATABE = (uint8_t)((handle->transfer.subaddress) >> (8U * handle->transfer.subaddressSize)); - - if (handle->transfer.busType != kI3C_TypeI3CDdr) - { - if (0UL == handle->transfer.dataSize) - { - handle->state = (uint8_t)kWaitForCompletionState; - } - else - { - /* xfer->dataSize != 0U, xfer->direction = kI3C_Read */ - handle->state = (uint8_t)kWaitRepeatedStartCompleteState; - } - } - else - { - handle->state = (uint8_t)kTransferDataState; - } - } - else - { - /* Next state, transfer data. */ - handle->state = (uint8_t)kTransferDataState; - base->MWDATAB = (uint8_t)((handle->transfer.subaddress) >> (8U * handle->transfer.subaddressSize)); - } - } - else - { - /* Eliminate misra 15.7*/ - } -} - -static void I3C_TransferStateMachineWaitRepeatedStartCompleteState(I3C_Type *base, - i3c_master_handle_t *handle, - i3c_master_state_machine_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - /* We stay in this state until the master complete. */ - if (0UL != (stateParams->status & (uint32_t)kI3C_MasterCompleteFlag)) - { - handle->state = (uint8_t)kTransferDataState; - I3C_MasterDisableInterrupts(base, (uint32_t)kI3C_MasterTxReadyFlag); - - if (handle->remainingBytes < 256U) - { - handle->rxTermOps = (handle->rxTermOps == kI3C_RxTermDisable) ? handle->rxTermOps : kI3C_RxAutoTerm; - stateParams->result = - I3C_MasterRepeatedStartWithRxSize(base, handle->transfer.busType, handle->transfer.slaveAddress, - kI3C_Read, (uint8_t)handle->remainingBytes); - } - else - { - stateParams->result = - I3C_MasterRepeatedStart(base, handle->transfer.busType, handle->transfer.slaveAddress, kI3C_Read); - } - } - - stateParams->state_complete = true; -} - -static void I3C_TransferStateMachineTransferDataState(I3C_Type *base, - i3c_master_handle_t *handle, - i3c_master_state_machine_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - - i3c_puint8_to_u32_t dataBuff; - if (handle->transfer.direction == kI3C_Write) - { - /* Make sure there is room in the tx fifo. */ - if (0UL == (stateParams->txCount)--) - { - stateParams->state_complete = true; - return; - } - - /* Put byte to send in fifo. */ - dataBuff.puint8 = (uint8_t *)handle->transfer.data; - if (handle->transfer.dataSize > 1U) - { - base->MWDATAB = *dataBuff.puint8; - } - else - { - base->MWDATABE = *dataBuff.puint8; - } - dataBuff.u32 = dataBuff.u32 + 1U; - (handle->transfer.dataSize)--; - handle->transfer.data = (void *)(dataBuff.puint8); - - /* Move to stop when the transfer is done. */ - if (--handle->remainingBytes == 0UL) - { - handle->state = (uint8_t)kWaitForCompletionState; - } - } - else - { - /* Make sure there is data in the rx fifo. */ - if (0UL == (stateParams->rxCount)--) - { - stateParams->state_complete = true; - return; - } - - /* Read byte from fifo. */ - dataBuff.puint8 = (uint8_t *)handle->transfer.data; - *dataBuff.puint8 = (uint8_t)base->MRDATAB; - dataBuff.u32 = dataBuff.u32 + 1U; - handle->transfer.data = (void *)(dataBuff.puint8); - - /* Move to stop when the transfer is done. */ - if (--handle->remainingBytes == 0UL) - { - handle->state = (uint8_t)kWaitForCompletionState; - } - - if ((handle->rxTermOps == kI3C_RxTermLastByte) && (handle->remainingBytes == 1UL)) - { - base->MCTRL |= I3C_MCTRL_RDTERM(1UL); - } - } -} - -static void I3C_TransferStateMachineWaitForCompletionState(i3c_master_handle_t *handle, - i3c_master_state_machine_param_t *stateParams) -{ - /* We stay in this state until the maste complete. */ - if (0UL != (stateParams->status & (uint32_t)kI3C_MasterCompleteFlag)) - { - handle->state = (uint8_t)kStopState; - } - else - { - stateParams->state_complete = true; - } -} - -static void I3C_TransferStateMachineStopState(I3C_Type *base, - i3c_master_handle_t *handle, - i3c_master_state_machine_param_t *stateParams) -{ - /* Only issue a stop transition if the caller requested it. */ - if (0UL == (handle->transfer.flags & (uint32_t)kI3C_TransferNoStopFlag)) - { - /* Make sure there is room in the tx fifo for the stop command. */ - if (0UL == (stateParams->txCount)--) - { - stateParams->state_complete = true; - return; - } - if (handle->transfer.busType == kI3C_TypeI3CDdr) - { - I3C_MasterEmitRequest(base, kI3C_RequestForceExit); - } - else - { - (void)I3C_MasterEmitStop(base, false); - } - } - stateParams->state_complete = true; -} - -static status_t I3C_RunTransferStateMachine(I3C_Type *base, i3c_master_handle_t *handle, bool *isDone) -{ - i3c_master_state_machine_param_t stateParams; - (void)memset(&stateParams, 0, sizeof(stateParams)); - - stateParams.result = kStatus_Success; - stateParams.state_complete = false; - - /* Set default isDone return value. */ - *isDone = false; - - uint32_t errStatus; - size_t txFifoSize = - 2UL << ((base->SCAPABILITIES & I3C_SCAPABILITIES_FIFOTX_MASK) >> I3C_SCAPABILITIES_FIFOTX_SHIFT); - - /* Check for errors. */ - stateParams.status = (uint32_t)I3C_MasterGetPendingInterrupts(base); - I3C_MasterClearStatusFlags(base, stateParams.status); - - stateParams.masterState = I3C_MasterGetState(base); - errStatus = I3C_MasterGetErrorStatusFlags(base); - stateParams.result = I3C_MasterCheckAndClearError(base, errStatus); - if (kStatus_Success != stateParams.result) - { - return stateParams.result; - } - - if (0UL != (stateParams.status & (uint32_t)kI3C_MasterSlave2MasterFlag)) - { - if (handle->callback.slave2Master != NULL) - { - handle->callback.slave2Master(base, handle->userData); - } - } - - if ((0UL != (stateParams.status & (uint32_t)kI3C_MasterSlaveStartFlag)) && - (handle->transfer.busType != kI3C_TypeI2C)) - { - handle->state = (uint8_t)kSlaveStartState; - } - - if ((stateParams.masterState == kI3C_MasterStateIbiRcv) || (stateParams.masterState == kI3C_MasterStateIbiAck)) - { - handle->state = (uint8_t)kIBIWonState; - } - - if (handle->state == (uint8_t)kIdleState) - { - return stateParams.result; - } - - /* Get fifo counts and compute room in tx fifo. */ - I3C_MasterGetFifoCounts(base, &stateParams.rxCount, &stateParams.txCount); - stateParams.txCount = txFifoSize - stateParams.txCount; - - while (!stateParams.state_complete) - { - /* Execute the state. */ - switch (handle->state) - { - case (uint8_t)kSlaveStartState: - /* Emit start + 0x7E */ - I3C_MasterEmitRequest(base, kI3C_RequestAutoIbi); - handle->state = (uint8_t)kIBIWonState; - stateParams.state_complete = true; - break; - - case (uint8_t)kIBIWonState: - I3C_TransferStateMachineIBIWonState(base, handle, &stateParams); - break; - - case (uint8_t)kSendCommandState: - I3C_TransferStateMachineSendCommandState(base, handle, &stateParams); - break; - - case (uint8_t)kWaitRepeatedStartCompleteState: - I3C_TransferStateMachineWaitRepeatedStartCompleteState(base, handle, &stateParams); - break; - - case (uint8_t)kTransferDataState: - I3C_TransferStateMachineTransferDataState(base, handle, &stateParams); - break; - - case (uint8_t)kWaitForCompletionState: - I3C_TransferStateMachineWaitForCompletionState(handle, &stateParams); - break; - - case (uint8_t)kStopState: - I3C_TransferStateMachineStopState(base, handle, &stateParams); - *isDone = true; - break; - - default: - assert(false); - break; - } - } - return stateParams.result; -} - -static status_t I3C_InitTransferStateMachine(I3C_Type *base, i3c_master_handle_t *handle) -{ - i3c_master_transfer_t *xfer = &handle->transfer; - status_t result = kStatus_Success; - i3c_direction_t direction = xfer->direction; - - if (xfer->busType != kI3C_TypeI3CDdr) - { - direction = (0UL != xfer->subaddressSize) ? kI3C_Write : xfer->direction; - } - - if (0UL != (xfer->flags & (uint32_t)kI3C_TransferStartWithBroadcastAddr)) - { - if (0UL != (xfer->flags & (uint32_t)kI3C_TransferNoStartFlag)) - { - return kStatus_InvalidArgument; - } - - if (0UL != (xfer->flags & (uint32_t)kI3C_TransferRepeatedStartFlag)) - { - return kStatus_InvalidArgument; - } - - /* Issue 0x7E as start. */ - result = I3C_MasterStart(base, xfer->busType, 0x7E, kI3C_Write); - if (result != kStatus_Success) - { - return result; - } - - result = I3C_MasterWaitForCtrlDone(base, false); - if (result != kStatus_Success) - { - return result; - } - } - - /* Handle no start option. */ - if (0U != (xfer->flags & (uint32_t)kI3C_TransferNoStartFlag)) - { - /* No need to send start flag, directly go to send command or data */ - if (xfer->subaddressSize > 0UL) - { - handle->state = (uint8_t)kSendCommandState; - } - else - { - if (direction == kI3C_Write) - { - /* Next state, send data. */ - handle->state = (uint8_t)kTransferDataState; - } - else - { - /* Only support write with no stop signal. */ - return kStatus_InvalidArgument; - } - } - I3C_MasterTransferHandleIRQ(base, handle); - return result; - } - /* If repeated start is requested, send repeated start. */ - else if (0U != (xfer->flags & (uint32_t)kI3C_TransferRepeatedStartFlag)) - { - result = I3C_MasterRepeatedStart(base, xfer->busType, xfer->slaveAddress, direction); - } - else /* For normal transfer, send start. */ - { - result = I3C_MasterStart(base, xfer->busType, xfer->slaveAddress, direction); - } - - if (xfer->subaddressSize > 0U) - { - handle->state = (uint8_t)kSendCommandState; - } - else if (xfer->dataSize != 0U) - { - handle->state = (uint8_t)kTransferDataState; - } - else - { - handle->state = (uint8_t)kStopState; - } - - if ((handle->remainingBytes < 256U) && (direction == kI3C_Read)) - { - handle->rxTermOps = (handle->rxTermOps == kI3C_RxTermDisable) ? handle->rxTermOps : kI3C_RxAutoTerm; - base->MCTRL |= I3C_MCTRL_RDTERM(handle->remainingBytes); - } - - return result; -} - -/*! - * brief Performs a non-blocking transaction on the I2C/I3C bus. - * - * param base The I3C peripheral base address. - * param handle Pointer to the I3C master driver handle. - * param transfer The pointer to the transfer descriptor. - * retval #kStatus_Success The transaction was started successfully. - * retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - */ -status_t I3C_MasterTransferNonBlocking(I3C_Type *base, i3c_master_handle_t *handle, i3c_master_transfer_t *transfer) -{ - assert(NULL != handle); - assert(NULL != transfer); - assert(transfer->subaddressSize <= sizeof(transfer->subaddress)); - i3c_master_state_t masterState = I3C_MasterGetState(base); - bool checkDdrState = false; - - /* Return busy if another transaction is in progress. */ - if (handle->state != (uint8_t)kIdleState) - { - return kStatus_I3C_Busy; - } - - /* Return an error if the bus is already in use not by us. */ - checkDdrState = (transfer->busType == kI3C_TypeI3CDdr) ? (masterState != kI3C_MasterStateDdr) : true; - if ((masterState != kI3C_MasterStateIdle) && (masterState != kI3C_MasterStateNormAct) && checkDdrState) - { - return kStatus_I3C_Busy; - } - - /* Disable I3C IRQ sources while we configure stuff. */ - I3C_MasterDisableInterrupts(base, (uint32_t)kMasterIrqFlags); - - /* Save transfer into handle. */ - handle->transfer = *transfer; - handle->remainingBytes = transfer->dataSize; - - /* Configure IBI response type. */ - base->MCTRL &= ~I3C_MCTRL_IBIRESP_MASK; - base->MCTRL |= I3C_MCTRL_IBIRESP(transfer->ibiResponse); - - /* Clear all flags. */ - I3C_MasterClearErrorStatusFlags(base, (uint32_t)kMasterErrorFlags); - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - /* Reset fifos. These flags clear automatically. */ - base->MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - - if ((transfer->flags & (uint32_t)kI3C_TransferDisableRxTermFlag) != 0U) - { - handle->rxTermOps = kI3C_RxTermDisable; - } - else if (transfer->dataSize <= 255U) - { - handle->rxTermOps = kI3C_RxAutoTerm; - } - else - { - handle->rxTermOps = kI3C_RxTermLastByte; - } - - /* Generate commands to send. */ - (void)I3C_InitTransferStateMachine(base, handle); - - /* Enable I3C internal IRQ sources. NVIC IRQ was enabled in CreateHandle() */ - I3C_MasterEnableInterrupts(base, (uint32_t)kMasterIrqFlags); - - if (transfer->direction == kI3C_Write) - { - I3C_MasterEnableInterrupts(base, (uint32_t)kI3C_MasterTxReadyFlag); - } - - return kStatus_Success; -} - -/*! - * brief Returns number of bytes transferred so far. - * param base The I3C peripheral base address. - * param handle Pointer to the I3C master driver handle. - * param[out] count Number of bytes transferred so far by the non-blocking transaction. - * retval #kStatus_Success - * retval #kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t I3C_MasterTransferGetCount(I3C_Type *base, i3c_master_handle_t *handle, size_t *count) -{ - assert(NULL != handle); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (handle->state == (uint8_t)kIdleState) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - uint8_t state; - uint32_t remainingBytes; - uint32_t dataSize; - - /* Cache some fields with IRQs disabled. This ensures all field values */ - /* are synchronized with each other during an ongoing transfer. */ - uint32_t irqs = I3C_MasterGetEnabledInterrupts(base); - I3C_MasterDisableInterrupts(base, irqs); - state = handle->state; - remainingBytes = handle->remainingBytes; - dataSize = handle->transfer.dataSize; - I3C_MasterEnableInterrupts(base, irqs); - - /* Get transfer count based on current transfer state. */ - switch (state) - { - case (uint8_t)kIdleState: - case (uint8_t)kSendCommandState: - *count = 0; - break; - - case (uint8_t)kTransferDataState: - *count = dataSize - remainingBytes; - break; - - case (uint8_t)kStopState: - case (uint8_t)kWaitForCompletionState: - default: - *count = dataSize; - break; - } - - return kStatus_Success; -} - -/*! - * brief Terminates a non-blocking I3C master transmission early. - * - * note It is not safe to call this function from an IRQ handler that has a higher priority than the - * I3C peripheral's IRQ priority. - * - * param base The I3C peripheral base address. - * param handle Pointer to the I3C master driver handle. - * retval #kStatus_Success A transaction was successfully aborted. - * retval #kStatus_I3C_Idle There is not a non-blocking transaction currently in progress. - */ -void I3C_MasterTransferAbort(I3C_Type *base, i3c_master_handle_t *handle) -{ - if (handle->state != (uint8_t)kIdleState) - { - /* Disable internal IRQ enables. */ - I3C_MasterDisableInterrupts(base, (uint32_t)kMasterIrqFlags); - - /* Reset fifos. These flags clear automatically. */ - base->MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - - /* Send a stop command to finalize the transfer. */ - (void)I3C_MasterStop(base); - - /* Reset handle. */ - handle->state = (uint8_t)kIdleState; - } -} - -/*! - * brief Reusable routine to handle master interrupts. - * note This function does not need to be called unless you are reimplementing the - * nonblocking API's interrupt handler routines to add special functionality. - * param base The I3C peripheral base address. - * param intHandle Pointer to the I3C master driver handle. - */ -void I3C_MasterTransferHandleIRQ(I3C_Type *base, void *intHandle) -{ - i3c_master_handle_t *handle = (i3c_master_handle_t *)intHandle; - status_t result; - bool isDone; - - /* Don't do anything if we don't have a valid handle. */ - if (NULL == handle) - { - return; - } - - result = I3C_RunTransferStateMachine(base, handle, &isDone); - - if (handle->state == (uint8_t)kIdleState) - { - I3C_MasterDisableInterrupts(base, (uint32_t)kI3C_MasterTxReadyFlag); - return; - } - - if (isDone || (result != kStatus_Success)) - { - /* XXX need to handle data that may be in rx fifo below watermark level? */ - - /* XXX handle error, terminate xfer */ - if ((result == kStatus_I3C_Nak) || (result == kStatus_I3C_IBIWon)) - { - (void)I3C_MasterEmitStop(base, false); - } - - /* Disable internal IRQ enables. */ - I3C_MasterDisableInterrupts(base, (uint32_t)kI3C_MasterTxReadyFlag); - - /* Set handle to idle state. */ - handle->state = (uint8_t)kIdleState; - - /* Invoke IBI user callback. */ - if ((result == kStatus_I3C_IBIWon) && (handle->callback.ibiCallback != NULL)) - { - handle->callback.ibiCallback(base, handle, handle->ibiType, kI3C_IbiReady); - handle->ibiPayloadSize = 0; - } - - /* Invoke callback. */ - if (NULL != handle->callback.transferComplete) - { - handle->callback.transferComplete(base, handle, result, handle->userData); - } - } -} - -/*! - * brief Provides a default configuration for the I3C slave peripheral. - * - * This function provides the following default configuration for the I3C slave peripheral: - * code - * slaveConfig->enableslave = true; - * endcode - * - * After calling this function, you can override any settings in order to customize the configuration, - * prior to initializing the slave driver with I3C_SlaveInit(). - * - * param[out] slaveConfig User provided configuration structure for default values. Refer to #i3c_slave_config_t. - */ -void I3C_SlaveGetDefaultConfig(i3c_slave_config_t *slaveConfig) -{ - assert(NULL != slaveConfig); - - (void)memset(slaveConfig, 0, sizeof(*slaveConfig)); - - slaveConfig->enableSlave = true; -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) && FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) - slaveConfig->isHotJoin = false; -#endif - slaveConfig->vendorID = 0x11BU; -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) - slaveConfig->enableRandomPart = false; -#endif - slaveConfig->partNumber = 0; - slaveConfig->dcr = 0; /* Generic device. */ - slaveConfig->bcr = - 0; /* BCR[7:6]: device role, I3C slave(2b'00), BCR[5]: SDR Only / SDR and HDR Capable, SDR and HDR - Capable(1b'1), BCR[4]: Bridge Identifier, Not a bridge device(1b'0), BCR[3]: Offline Capable, device is - offline capable(1b'1), BCR[2]: IBI Payload, No data byte following(1b'0), BCR[1]: IBI Request Capable, - capable(1b'1), BCR[0]: Max Data Speed Limitation, has limitation(1b'1). */ - slaveConfig->hdrMode = (uint8_t)kI3C_HDRModeDDR; - slaveConfig->nakAllRequest = false; - slaveConfig->ignoreS0S1Error = true; - slaveConfig->offline = false; - slaveConfig->matchSlaveStartStop = false; - slaveConfig->maxWriteLength = 256U; - slaveConfig->maxReadLength = 256U; -} - -/*! - * brief Initializes the I3C slave peripheral. - * - * This function enables the peripheral clock and initializes the I3C slave peripheral as described by the user - * provided configuration. - * - * param base The I3C peripheral base address. - * param slaveConfig User provided peripheral configuration. Use I3C_SlaveGetDefaultConfig() to get a set of - * defaults that you can override. - * param slowClock_Hz Frequency in Hertz of the I3C slow clock. Used to calculate the bus match condition values. - * If FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH defines as 1, this parameter is useless. - */ -void I3C_SlaveInit(I3C_Type *base, const i3c_slave_config_t *slaveConfig, uint32_t slowClock_Hz) -{ - assert(NULL != slaveConfig); - assert((slowClock_Hz >= 1000000U) || (slowClock_Hz == 0U)); - - uint32_t configValue; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) || \ - !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) - uint32_t instance = I3C_GetInstance(base); -#endif - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate the clock. */ - CLOCK_EnableClock(kI3cClocks[instance]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) - /* Reset the I3C module */ - RESET_PeripheralReset(kI3cResets[instance]); -#endif - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - uint8_t matchCount; - /* Set as (slowClk(MHz) - 1) to generate 1us clock cycle for IBI request to drive SDA low. Note: Use BAMATCH = 1 to - generate 1us clock cycle if slow clock is 1MHz. The value of 0 would not give a correct match indication. */ - if (slowClock_Hz != 0U) - { - matchCount = (uint8_t)(slowClock_Hz / 1000000UL) - 1U; - matchCount = (matchCount == 0U) ? 1U : matchCount; - } - else - { - /* BAMATCH has default value based on Soc default slow clock after reset, using this default value when slowClock_Hz is 0. */ - matchCount = (uint8_t)((base->SCONFIG & I3C_SCONFIG_BAMATCH_MASK) >> I3C_SCONFIG_BAMATCH_SHIFT); - } -#endif - - configValue = base->SCONFIG; - configValue &= - ~(I3C_SCONFIG_SADDR_MASK | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - I3C_SCONFIG_BAMATCH_MASK | -#endif - I3C_SCONFIG_OFFLINE_MASK | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) - I3C_SCONFIG_IDRAND_MASK | -#endif -#if defined(FSL_FEATURE_I3C_HAS_HDROK) && FSL_FEATURE_I3C_HAS_HDROK - I3C_SCONFIG_HDROK_MASK | -#else - I3C_SCONFIG_DDROK_MASK | -#endif - I3C_SCONFIG_S0IGNORE_MASK | I3C_SCONFIG_MATCHSS_MASK | I3C_SCONFIG_NACK_MASK | I3C_SCONFIG_SLVENA_MASK); - configValue |= I3C_SCONFIG_SADDR(slaveConfig->staticAddr) | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - I3C_SCONFIG_BAMATCH(matchCount) | -#endif - I3C_SCONFIG_OFFLINE(slaveConfig->offline) | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) - I3C_SCONFIG_IDRAND(slaveConfig->enableRandomPart) | -#endif -#if defined(FSL_FEATURE_I3C_HAS_HDROK) && FSL_FEATURE_I3C_HAS_HDROK - I3C_SCONFIG_HDROK((0U != (slaveConfig->hdrMode & (uint8_t)kI3C_HDRModeDDR)) ? 1U : 0U) | -#else - I3C_SCONFIG_DDROK((0U != (slaveConfig->hdrMode & (uint8_t)kI3C_HDRModeDDR)) ? 1U : 0U) | -#endif - I3C_SCONFIG_S0IGNORE(slaveConfig->ignoreS0S1Error) | - I3C_SCONFIG_MATCHSS(slaveConfig->matchSlaveStartStop) | - I3C_SCONFIG_NACK(slaveConfig->nakAllRequest) | I3C_SCONFIG_SLVENA(slaveConfig->enableSlave); - - base->SVENDORID &= ~I3C_SVENDORID_VID_MASK; - base->SVENDORID |= I3C_SVENDORID_VID(slaveConfig->vendorID); - -#if defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND - base->SIDPARTNO = slaveConfig->partNumber; -#else - if (!slaveConfig->enableRandomPart) - { - base->SIDPARTNO = slaveConfig->partNumber; - } -#endif - - base->SIDEXT &= ~(I3C_SIDEXT_BCR_MASK | I3C_SIDEXT_DCR_MASK); - base->SIDEXT |= I3C_SIDEXT_BCR(slaveConfig->bcr) | I3C_SIDEXT_DCR(slaveConfig->dcr); - - base->SMAXLIMITS &= ~(I3C_SMAXLIMITS_MAXRD_MASK | I3C_SMAXLIMITS_MAXWR_MASK); - base->SMAXLIMITS |= - (I3C_SMAXLIMITS_MAXRD(slaveConfig->maxReadLength) | I3C_SMAXLIMITS_MAXWR(slaveConfig->maxWriteLength)); - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) && FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) - if (slaveConfig->isHotJoin) - { - I3C_SlaveRequestEvent(base, kI3C_SlaveEventHotJoinReq); - } -#endif - base->SCONFIG = configValue; -} - -/*! - * brief Deinitializes the I3C master peripheral. - * - * This function disables the I3C master peripheral and gates the clock. It also performs a software - * reset to restore the peripheral to reset conditions. - * - * param base The I3C peripheral base address. - */ -void I3C_SlaveDeinit(I3C_Type *base) -{ - uint32_t idx = I3C_GetInstance(base); - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) - /* Reset the I3C module */ - RESET_PeripheralReset(kI3cResets[idx]); -#endif - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate clock. */ - CLOCK_DisableClock(kI3cClocks[idx]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Reset handle pointer */ - s_i3cSlaveHandle[idx] = NULL; -} - -/*! - * @brief Gets the I3C slave state. - * - * @param base The I3C peripheral base address. - * @return I3C slave activity state, refer #i3c_slave_activity_state_t. - */ -i3c_slave_activity_state_t I3C_SlaveGetActivityState(I3C_Type *base) -{ - uint8_t activeState = (uint8_t)((base->SSTATUS & I3C_SSTATUS_ACTSTATE_MASK) >> I3C_SSTATUS_ACTSTATE_SHIFT); - i3c_slave_activity_state_t returnCode; - switch (activeState) - { - case (uint8_t)kI3C_SlaveNoLatency: - returnCode = kI3C_SlaveNoLatency; - break; - case (uint8_t)kI3C_SlaveLatency1Ms: - returnCode = kI3C_SlaveLatency1Ms; - break; - case (uint8_t)kI3C_SlaveLatency100Ms: - returnCode = kI3C_SlaveLatency100Ms; - break; - case (uint8_t)kI3C_SlaveLatency10S: - returnCode = kI3C_SlaveLatency10S; - break; - default: - returnCode = kI3C_SlaveNoLatency; - break; - } - - return returnCode; -} - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) && FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) -/*! - * brief I3C slave request event. - * - * param base The I3C peripheral base address. - * param event I3C slave event of type #i3c_slave_event_t - * param data IBI data if In-band interrupt has data, only applicable for event type #kI3C_SlaveEventIBI - */ -void I3C_SlaveRequestEvent(I3C_Type *base, i3c_slave_event_t event) -{ - uint32_t ctrlValue = base->SCTRL; - - ctrlValue &= ~I3C_SCTRL_EVENT_MASK; - ctrlValue |= I3C_SCTRL_EVENT(event); - - base->SCTRL = ctrlValue; -} - -/*! - * brief I3C slave request event. - * deprecated Do not use this function. It has been superseded by @ref I3C_SlaveRequestIBIWithData. - * - * param base The I3C peripheral base address. - * param data IBI data - * param dataSize IBI data size. - */ -void I3C_SlaveRequestIBIWithSingleData(I3C_Type *base, uint8_t data, size_t dataSize) -{ - uint32_t ctrlValue = base->SCTRL; - - ctrlValue &= ~(I3C_SCTRL_EVENT_MASK | I3C_SCTRL_IBIDATA_MASK); - ctrlValue |= I3C_SCTRL_EVENT(1U) | I3C_SCTRL_IBIDATA(data); - - base->SCTRL = ctrlValue; -} - -/*! - * brief I3C slave request IBI event with data payload(mandatory and extended). - * - * param base The I3C peripheral base address. - * param data Pointer to IBI data to be sent in the request. - * param dataSize IBI data size. - */ -void I3C_SlaveRequestIBIWithData(I3C_Type *base, uint8_t *data, size_t dataSize) -{ - assert((dataSize > 0U) && (dataSize <= 8U)); - - uint32_t ctrlValue; - -#if (defined(I3C_IBIEXT1_MAX_MASK) && I3C_IBIEXT1_MAX_MASK) - if (dataSize > 1U) - { - ctrlValue = I3C_IBIEXT1_EXT1(data[1]); - if (dataSize > 2U) - { - ctrlValue |= I3C_IBIEXT1_EXT2(data[2]); - } - if (dataSize > 3U) - { - ctrlValue |= I3C_IBIEXT1_EXT3(data[3]); - } - ctrlValue |= I3C_IBIEXT1_CNT(dataSize - 1U); - base->IBIEXT1 = ctrlValue; - } - - if (dataSize > 4U) - { - ctrlValue = I3C_IBIEXT2_EXT4(data[4]); - if (dataSize > 5U) - { - ctrlValue |= I3C_IBIEXT2_EXT5(data[5]); - } - if (dataSize > 6U) - { - ctrlValue |= I3C_IBIEXT2_EXT6(data[6]); - } - if (dataSize > 7U) - { - ctrlValue |= I3C_IBIEXT2_EXT7(data[7]); - } - base->IBIEXT2 = ctrlValue; - } -#endif - - ctrlValue = base->SCTRL; -#if (defined(I3C_IBIEXT1_MAX_MASK) && I3C_IBIEXT1_MAX_MASK) - ctrlValue &= ~(I3C_SCTRL_EVENT_MASK | I3C_SCTRL_IBIDATA_MASK | I3C_SCTRL_EXTDATA_MASK); - ctrlValue |= I3C_SCTRL_EVENT(1U) | I3C_SCTRL_IBIDATA(data[0]) | I3C_SCTRL_EXTDATA(dataSize > 1U); -#else - ctrlValue &= ~(I3C_SCTRL_EVENT_MASK | I3C_SCTRL_IBIDATA_MASK); - ctrlValue |= I3C_SCTRL_EVENT(1U) | I3C_SCTRL_IBIDATA(data[0]); -#endif - base->SCTRL = ctrlValue; -} -#endif /* !(defined(FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) && FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) */ - -/*! - * brief Performs a polling send transfer on the I3C bus. - * - * param base The I3C peripheral base address. - * param txBuff The pointer to the data to be transferred. - * param txSize The length in bytes of the data to be transferred. - * return Error or success status returned by API. - */ -status_t I3C_SlaveSend(I3C_Type *base, const void *txBuff, size_t txSize) -{ - const uint8_t *buf = (const uint8_t *)((const void *)txBuff); - status_t result = kStatus_Success; - - assert(NULL != txBuff); - - /* Send data buffer */ - while (0UL != txSize--) - { - /* Wait until there is room in the fifo. This also checks for errors. */ - result = I3C_SlaveWaitForTxReady(base); - if (kStatus_Success != result) - { - return result; - } - - /* Write byte into I3C slave data register. */ - if (0UL != txSize) - { - base->SWDATAB = *buf++; - } - else - { - base->SWDATABE = *buf++; - } - } - - return result; -} - -/*! - * brief Performs a polling receive transfer on the I3C bus. - * - * param base The I3C peripheral base address. - * param rxBuff The pointer to the data to be transferred. - * param rxSize The length in bytes of the data to be transferred. - * return Error or success status returned by API. - */ -status_t I3C_SlaveReceive(I3C_Type *base, void *rxBuff, size_t rxSize) -{ - status_t result = kStatus_Success; - uint8_t *buf; - - assert(NULL != rxBuff); - - /* Handle empty read. */ - if (0UL == rxSize) - { - return kStatus_Success; - } - -#if I3C_RETRY_TIMES - uint32_t waitTimes = I3C_RETRY_TIMES; -#endif - - /* Receive data */ - buf = (uint8_t *)rxBuff; - while (0UL != rxSize) - { -#if I3C_RETRY_TIMES - if (--waitTimes == 0) - { - return kStatus_I3C_Timeout; - } -#endif - /* Check for errors. */ - result = I3C_SlaveCheckAndClearError(base, I3C_SlaveGetErrorStatusFlags(base)); - if (kStatus_Success != result) - { - return result; - } - - /* Check RX data */ - if (0UL != (base->SDATACTRL & I3C_SDATACTRL_RXCOUNT_MASK)) - { - *buf++ = (uint8_t)(base->SRDATAB & I3C_SRDATAB_DATA0_MASK); - rxSize--; - } - } - - return result; -} - -/*! - * brief Creates a new handle for the I3C slave non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the I3C_SlaveTransferAbort() API shall be called. - * - * note The function also enables the NVIC IRQ for the input I3C. Need to notice - * that on some SoCs the I3C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - - * param base The I3C peripheral base address. - * param[out] handle Pointer to the I3C slave driver handle. - * param callback User provided pointer to the asynchronous callback function. - * param userData User provided pointer to the application callback data. - */ -void I3C_SlaveTransferCreateHandle(I3C_Type *base, - i3c_slave_handle_t *handle, - i3c_slave_transfer_callback_t callback, - void *userData) -{ - uint32_t instance; - - assert(NULL != handle); - - /* Clear out the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Look up instance number */ - instance = I3C_GetInstance(base); - - /* Save base and instance. */ - handle->callback = callback; - handle->userData = userData; - - /* Save Tx FIFO Size. */ - handle->txFifoSize = - 2U << ((base->SCAPABILITIES & I3C_SCAPABILITIES_FIFOTX_MASK) >> I3C_SCAPABILITIES_FIFOTX_SHIFT); - - /* Save this handle for IRQ use. */ - s_i3cSlaveHandle[instance] = handle; - - /* Set irq handler. */ - s_i3cSlaveIsr = I3C_SlaveTransferHandleIRQ; - - /* Clear internal IRQ enables and enable NVIC IRQ. */ - I3C_SlaveDisableInterrupts(base, (uint32_t)kSlaveIrqFlags); - (void)EnableIRQ(kI3cIrqs[instance]); -} - -/*! - * brief Starts accepting slave transfers. - * - * Call this API after calling I2C_SlaveInit() and I3C_SlaveTransferCreateHandle() to start processing - * transactions driven by an I2C master. The slave monitors the I2C bus and pass events to the - * callback that was passed into the call to I3C_SlaveTransferCreateHandle(). The callback is always invoked - * from the interrupt context. - * - * The set of events received by the callback is customizable. To do so, set the a eventMask parameter to - * the OR'd combination of #i3c_slave_transfer_event_t enumerators for the events you wish to receive. - * The #kI3C_SlaveTransmitEvent and #kI3C_SlaveReceiveEvent events are always enabled and do not need - * to be included in the mask. Alternatively, you can pass 0 to get a default set of only the transmit and - * receive events that are always enabled. In addition, the #kI3C_SlaveAllEvents constant is provided as - * a convenient way to enable all events. - * - * param base The I3C peripheral base address. - * param handle Pointer to #i3c_slave_handle_t structure which stores the transfer state. - * param eventMask Bit mask formed by OR'ing together #i3c_slave_transfer_event_t enumerators to specify - * which events to send to the callback. Other accepted values are 0 to get a default set of - * only the transmit and receive events, and #kI3C_SlaveAllEvents to enable all events. - * - * retval #kStatus_Success Slave transfers were successfully started. - * retval #kStatus_I3C_Busy Slave transfers have already been started on this handle. - */ -status_t I3C_SlaveTransferNonBlocking(I3C_Type *base, i3c_slave_handle_t *handle, uint32_t eventMask) -{ - assert(NULL != handle); - - /* Return busy if another transaction is in progress. */ - if (handle->isBusy) - { - return kStatus_I3C_Busy; - } - - /* Disable I3C IRQ sources while we configure stuff. */ - I3C_SlaveDisableInterrupts(base, (uint32_t)kSlaveIrqFlags); - - /* Clear transfer in handle. */ - (void)memset(&handle->transfer, 0, sizeof(handle->transfer)); - - /* Set up event mask. tx and rx are always enabled. */ - handle->eventMask = eventMask | (uint32_t)kI3C_SlaveTransmitEvent | (uint32_t)kI3C_SlaveReceiveEvent; - - /* Clear all flags. */ - I3C_SlaveClearStatusFlags(base, (uint32_t)kSlaveClearFlags); - - /* Enable I3C internal IRQ sources. NVIC IRQ was enabled in CreateHandle() */ - I3C_SlaveEnableInterrupts(base, (uint32_t)kSlaveIrqFlags); - - return kStatus_Success; -} - -/*! - * brief Gets the slave transfer status during a non-blocking transfer. - * param base The I3C peripheral base address. - * param handle Pointer to i2c_slave_handle_t structure. - * param[out] count Pointer to a value to hold the number of bytes transferred. May be NULL if the count is not - * required. - * retval #kStatus_Success - * retval #kStatus_NoTransferInProgress - */ -status_t I3C_SlaveTransferGetCount(I3C_Type *base, i3c_slave_handle_t *handle, size_t *count) -{ - assert(NULL != handle); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (!handle->isBusy) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - /* For an active transfer, just return the count from the handle. */ - *count = handle->transferredCount; - - return kStatus_Success; -} - -/*! - * brief Aborts the slave non-blocking transfers. - * note This API could be called at any time to stop slave for handling the bus events. - * param base The I3C peripheral base address. - * param handle Pointer to #i3c_slave_handle_t structure which stores the transfer state. - * retval #kStatus_Success - * retval #kStatus_I3C_Idle - */ -void I3C_SlaveTransferAbort(I3C_Type *base, i3c_slave_handle_t *handle) -{ - assert(NULL != handle); - - /* Return idle if no transaction is in progress. */ - if (handle->isBusy) - { - /* Disable I3C IRQ sources. */ - I3C_SlaveDisableInterrupts(base, (uint32_t)kSlaveIrqFlags); - - /* Reset transfer info. */ - (void)memset(&handle->transfer, 0, sizeof(handle->transfer)); - - /* We're no longer busy. */ - handle->isBusy = false; - } -} - -static bool I3C_SlaveTransferHandleGetStatusFlags(I3C_Type *base, - i3c_slave_handle_t *handle, - i3c_slave_handleIrq_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - /* Check for a valid handle in case of a spurious interrupt. */ - uint32_t errFlags; - stateParams->flags = I3C_SlaveGetStatusFlags(base); - errFlags = I3C_SlaveGetErrorStatusFlags(base); - - stateParams->pendingInts = I3C_SlaveGetPendingInterrupts(base); - stateParams->enabledInts = I3C_SlaveGetEnabledInterrupts(base); - - if (0UL != (errFlags & (uint32_t)kSlaveErrorFlags)) - { - handle->transfer.event = (uint32_t)kI3C_SlaveCompletionEvent; - handle->transfer.completionStatus = I3C_SlaveCheckAndClearError(base, errFlags); - - if ((0UL != (handle->eventMask & (uint32_t)kI3C_SlaveCompletionEvent)) && (NULL != handle->callback)) - { - handle->callback(base, &handle->transfer, handle->userData); - } - return false; - } - return true; -} - -static void I3C_SlaveTransferHandleBusStart(I3C_Type *base, i3c_slave_transfer_t *xfer, uint32_t *pendingInts) -{ - base->SDATACTRL |= I3C_SDATACTRL_FLUSHTB_MASK; - xfer->txDataSize = 0; - I3C_SlaveEnableInterrupts(base, (uint32_t)kI3C_SlaveTxReadyFlag); - (*pendingInts) |= (uint32_t)kI3C_SlaveTxReadyFlag; -} - -static void I3C_SlaveTransferHandleEventSent(I3C_Type *base, i3c_slave_handle_t *handle, i3c_slave_transfer_t *xfer) -{ - xfer->event = (uint32_t)kI3C_SlaveRequestSentEvent; - if ((0UL != (handle->eventMask & xfer->event)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } -} - -static void I3C_SlaveTransferHandleReceivedCCC(I3C_Type *base, i3c_slave_handle_t *handle, i3c_slave_transfer_t *xfer) -{ - handle->isBusy = true; - xfer->event = (uint32_t)kI3C_SlaveReceivedCCCEvent; - if ((0UL != (handle->eventMask & xfer->event)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } -} - -static void I3C_SlaveTransferHandleBusStop(I3C_Type *base, - i3c_slave_handle_t *handle, - i3c_slave_handleIrq_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - I3C_SlaveDisableInterrupts(base, (uint32_t)kI3C_SlaveTxReadyFlag); - stateParams->pendingInts &= ~(uint32_t)kI3C_SlaveTxReadyFlag; - base->SDATACTRL |= I3C_SDATACTRL_FLUSHTB_MASK | I3C_SDATACTRL_FLUSHFB_MASK; - if (handle->isBusy) - { - handle->transfer.event = (uint32_t)kI3C_SlaveCompletionEvent; - handle->transfer.completionStatus = kStatus_Success; - handle->transfer.transferredCount = handle->transferredCount; - handle->isBusy = false; - - if (handle->wasTransmit) - { - /* Subtract one from the transmit count to offset the fact that I3C asserts the */ - /* tx flag before it sees the nack from the master-receiver, thus causing one more */ - /* count that the master actually receives. */ - --handle->transfer.transferredCount; - handle->wasTransmit = false; - } - - if ((0UL != (handle->eventMask & handle->transfer.event)) && (NULL != handle->callback)) - { - handle->callback(base, &handle->transfer, handle->userData); - } - - /* Clean up transfer info on completion, after the callback has been invoked. */ - (void)memset(&handle->transfer, 0, sizeof(handle->transfer)); - } -} - -static void I3C_SlaveTransferHandleMatched(I3C_Type *base, i3c_slave_handle_t *handle, i3c_slave_transfer_t *xfer) -{ - assert(NULL != base && NULL != handle && NULL != xfer); - xfer->event = (uint32_t)kI3C_SlaveAddressMatchEvent; - handle->isBusy = true; - if ((0UL != (handle->eventMask & (uint32_t)kI3C_SlaveAddressMatchEvent)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } -} - -static void I3C_SlaveTransferHandleTxReady(I3C_Type *base, - i3c_slave_handle_t *handle, - i3c_slave_handleIrq_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - handle->wasTransmit = true; - - /* If we're out of data, invoke callback to get more. */ - if ((NULL == handle->transfer.txData) || (0UL == handle->transfer.txDataSize)) - { - handle->transfer.event = (uint32_t)kI3C_SlaveTransmitEvent; - if (0UL != (stateParams->flags & (uint32_t)kI3C_SlaveBusHDRModeFlag)) - { - handle->transfer.event |= (uint32_t)kI3C_SlaveHDRCommandMatchEvent; - handle->isBusy = true; - } - if (NULL != handle->callback) - { - handle->callback(base, &handle->transfer, handle->userData); - } - - /* Clear the transferred count now that we have a new buffer. */ - handle->transferredCount = 0; - } - - if ((NULL == handle->transfer.txData) || (0UL == handle->transfer.txDataSize)) - { - I3C_SlaveDisableInterrupts(base, (uint32_t)kI3C_SlaveTxReadyFlag); - (stateParams->pendingInts) &= ~(uint32_t)kI3C_SlaveTxReadyFlag; - } - - /* Transmit a byte. */ - while ((handle->transfer.txDataSize != 0UL) && ((stateParams->txCount) != 0U)) - { - if (handle->transfer.txDataSize > 1UL) - { - base->SWDATAB = *handle->transfer.txData++; - } - else - { - base->SWDATABE = *handle->transfer.txData++; - I3C_SlaveDisableInterrupts(base, (uint32_t)kI3C_SlaveTxReadyFlag); - } - --(handle->transfer.txDataSize); - ++(handle->transferredCount); - (stateParams->txCount)--; - } -} - -static void I3C_SlaveTransferHandleRxReady(I3C_Type *base, - i3c_slave_handle_t *handle, - i3c_slave_handleIrq_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - /* If we're out of room in the buffer, invoke callback to get another. */ - if ((NULL == handle->transfer.rxData) || (0UL == handle->transfer.rxDataSize)) - { - handle->transfer.event = (uint32_t)kI3C_SlaveReceiveEvent; - if (0UL != (stateParams->flags & (uint32_t)kI3C_SlaveBusHDRModeFlag)) - { - handle->transfer.event |= (uint32_t)kI3C_SlaveHDRCommandMatchEvent; - handle->isBusy = true; - } - if (NULL != handle->callback) - { - handle->callback(base, &handle->transfer, handle->userData); - } - handle->transferredCount = 0; - } - /* Receive a byte. */ - while ((stateParams->rxCount != 0U) && ((handle->transfer.rxData != NULL) && (handle->transfer.rxDataSize != 0UL))) - { - *(handle->transfer.rxData++) = (uint8_t)base->SRDATAB; - --(handle->transfer.rxDataSize); - ++(handle->transferredCount); - (stateParams->rxCount)--; - } -} - -/*! - * brief Reusable routine to handle slave interrupts. - * note This function does not need to be called unless you are reimplementing the - * non blocking API's interrupt handler routines to add special functionality. - * param base The I3C peripheral base address. - * param intHandle Pointer to #i3c_slave_handle_t structure which stores the transfer state. - */ -void I3C_SlaveTransferHandleIRQ(I3C_Type *base, void *intHandle) -{ - i3c_slave_handleIrq_param_t stateParams; - - (void)memset(&stateParams, 0, sizeof(stateParams)); - i3c_slave_handle_t *handle = (i3c_slave_handle_t *)intHandle; - - /* Check for a valid handle in case of a spurious interrupt. */ - if (NULL == handle) - { - return; - } - - /* Get status flags. */ - if (false == I3C_SlaveTransferHandleGetStatusFlags(base, handle, &stateParams)) - { - return; - } - - /* Clear status flags. */ - I3C_SlaveClearStatusFlags(base, stateParams.flags); - - if (0UL != (stateParams.flags & (uint32_t)kI3C_SlaveBusStartFlag)) - { - I3C_SlaveTransferHandleBusStart(base, &handle->transfer, &stateParams.pendingInts); - } - - if (0UL != (stateParams.flags & (uint32_t)kI3C_SlaveEventSentFlag)) - { - I3C_SlaveTransferHandleEventSent(base, handle, &handle->transfer); - } - - if (0UL != (stateParams.flags & (uint32_t)kI3C_SlaveReceivedCCCFlag)) - { - I3C_SlaveTransferHandleReceivedCCC(base, handle, &handle->transfer); - } - - if (0UL != (stateParams.flags & (uint32_t)kI3C_SlaveMatchedFlag)) - { - I3C_SlaveTransferHandleMatched(base, handle, &handle->transfer); - } - - /* Get fifo counts and compute room in tx fifo. */ - I3C_SlaveGetFifoCounts(base, &stateParams.rxCount, &stateParams.txCount); - stateParams.txCount = handle->txFifoSize - stateParams.txCount; - - /* Handle transmit and receive. */ - if ((0UL != (stateParams.flags & (uint32_t)kI3C_SlaveTxReadyFlag)) && - (0UL != (stateParams.pendingInts & (uint32_t)kI3C_SlaveTxReadyFlag))) - { - I3C_SlaveTransferHandleTxReady(base, handle, &stateParams); - } - - if ((0UL != (stateParams.flags & (uint32_t)kI3C_SlaveRxReadyFlag)) && - (0UL != (stateParams.enabledInts & (uint32_t)kI3C_SlaveRxReadyFlag))) - { - I3C_SlaveTransferHandleRxReady(base, handle, &stateParams); - } - - /* Handle stop event. */ - if (0UL != (stateParams.flags & (uint32_t)kI3C_SlaveBusStopFlag)) - { - I3C_SlaveTransferHandleBusStop(base, handle, &stateParams); - } -} - -static void I3C_CommonIRQHandler(I3C_Type *base, uint32_t instance) -{ - /* Check for master IRQ. */ - if (((uint32_t)kI3C_MasterOn == (base->MCONFIG & I3C_MCONFIG_MSTENA_MASK)) && (NULL != s_i3cMasterIsr)) - { - /* Master mode. */ - s_i3cMasterIsr(base, s_i3cMasterHandle[instance]); - } - - /* Check for slave IRQ. */ - if ((I3C_SCONFIG_SLVENA_MASK == (base->SCONFIG & I3C_SCONFIG_SLVENA_MASK)) && (NULL != s_i3cSlaveIsr)) - { - /* Slave mode. */ - s_i3cSlaveIsr(base, s_i3cSlaveHandle[instance]); - } - SDK_ISR_EXIT_BARRIER; -} - -#if defined(I3C) -/* Implementation of I3C handler named in startup code. */ -void I3C0_DriverIRQHandler(void); -void I3C0_DriverIRQHandler(void) -{ - I3C_CommonIRQHandler(I3C, 0); -} -#endif - -#if defined(I3C0) -/* Implementation of I3C0 handler named in startup code. */ -void I3C0_DriverIRQHandler(void); -void I3C0_DriverIRQHandler(void) -{ - I3C_CommonIRQHandler(I3C0, 0); -} -#endif - -#if defined(I3C1) -/* Implementation of I3C1 handler named in startup code. */ -void I3C1_DriverIRQHandler(void); -void I3C1_DriverIRQHandler(void) -{ - I3C_CommonIRQHandler(I3C1, 1); -} -#endif - -#if defined(I3C2) -/* Implementation of I3C2 handler named in startup code. */ -void I3C2_DriverIRQHandler(void); -void I3C2_DriverIRQHandler(void) -{ - I3C_CommonIRQHandler(I3C2, 2); -} -#endif - -#if defined(I3C3) -/* Implementation of I3C3 handler named in startup code. */ -void I3C3_DriverIRQHandler(void); -void I3C3_DriverIRQHandler(void) -{ - I3C_CommonIRQHandler(I3C3, 3); -} -#endif diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_i3c.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_i3c.h deleted file mode 100644 index 2a3b5dae82f..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_i3c.h +++ /dev/null @@ -1,1899 +0,0 @@ -/* - * Copyright 2018-2024 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_I3C_H_ -#define FSL_I3C_H_ - -#include "fsl_common.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @addtogroup i3c - * @{ - */ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief I3C driver version */ -#define FSL_I3C_DRIVER_VERSION (MAKE_VERSION(2, 12, 0)) -/*! @} */ - -/*! @brief Timeout times for waiting flag. */ -#ifndef I3C_RETRY_TIMES -#define I3C_RETRY_TIMES 0U /* Define to zero means keep waiting until the flag is assert/deassert. */ -#endif - -#define I3C_MAX_DEVCNT 10U - -#ifndef I3C_IBI_BUFF_SIZE -#define I3C_IBI_BUFF_SIZE 10U -#endif - -/*! @brief I3C status return codes. */ -enum -{ - kStatus_I3C_Busy = MAKE_STATUS(kStatusGroup_I3C, 0), /*!< The master is already performing a transfer. */ - kStatus_I3C_Idle = MAKE_STATUS(kStatusGroup_I3C, 1), /*!< The slave driver is idle. */ - kStatus_I3C_Nak = MAKE_STATUS(kStatusGroup_I3C, 2), /*!< The slave device sent a NAK in response to an address. */ - kStatus_I3C_WriteAbort = - MAKE_STATUS(kStatusGroup_I3C, 3), /*!< The slave device sent a NAK in response to a write. */ - kStatus_I3C_Term = MAKE_STATUS(kStatusGroup_I3C, 4), /*!< The master terminates slave read. */ - kStatus_I3C_HdrParityError = MAKE_STATUS(kStatusGroup_I3C, 5), /*!< Parity error from DDR read. */ - kStatus_I3C_CrcError = MAKE_STATUS(kStatusGroup_I3C, 6), /*!< CRC error from DDR read. */ - kStatus_I3C_ReadFifoError = MAKE_STATUS(kStatusGroup_I3C, 7), /*!< Read from M/SRDATAB register when FIFO empty. */ - kStatus_I3C_WriteFifoError = MAKE_STATUS(kStatusGroup_I3C, 8), /*!< Write to M/SWDATAB register when FIFO full. */ - kStatus_I3C_MsgError = - MAKE_STATUS(kStatusGroup_I3C, 9), /*!< Message SDR/DDR mismatch or read/write message in wrong state */ - kStatus_I3C_InvalidReq = MAKE_STATUS(kStatusGroup_I3C, 10), /*!< Invalid use of request. */ - kStatus_I3C_Timeout = MAKE_STATUS(kStatusGroup_I3C, 11), /*!< The module has stalled too long in a frame. */ - kStatus_I3C_SlaveCountExceed = - MAKE_STATUS(kStatusGroup_I3C, 12), /*!< The I3C slave count has exceed the definition in I3C_MAX_DEVCNT. */ - kStatus_I3C_IBIWon = MAKE_STATUS( - kStatusGroup_I3C, 13), /*!< The I3C slave event IBI or MR or HJ won the arbitration on a header address. */ - kStatus_I3C_OverrunError = MAKE_STATUS(kStatusGroup_I3C, 14), /*!< Slave internal from-bus buffer/FIFO overrun. */ - kStatus_I3C_UnderrunError = MAKE_STATUS(kStatusGroup_I3C, 15), /*!< Slave internal to-bus buffer/FIFO underrun */ - kStatus_I3C_UnderrunNak = - MAKE_STATUS(kStatusGroup_I3C, 16), /*!< Slave internal from-bus buffer/FIFO underrun and NACK error */ - kStatus_I3C_InvalidStart = MAKE_STATUS(kStatusGroup_I3C, 17), /*!< Slave invalid start flag */ - kStatus_I3C_SdrParityError = MAKE_STATUS(kStatusGroup_I3C, 18), /*!< SDR parity error */ - kStatus_I3C_S0S1Error = MAKE_STATUS(kStatusGroup_I3C, 19), /*!< S0 or S1 error */ -}; - -/*! @brief I3C HDR modes. */ -typedef enum _i3c_hdr_mode -{ - kI3C_HDRModeNone = 0x00U, /* Do not support HDR mode. */ - kI3C_HDRModeDDR = 0x01U, /* HDR-DDR Mode. */ - kI3C_HDRModeTSP = 0x02U, /* HDR-TSP Mode. */ - kI3C_HDRModeTSL = 0x04U, /* HDR-TSL Mode. */ -} i3c_hdr_mode_t; - -/*! @brief I3C device information. */ -typedef struct _i3c_device_info -{ - uint8_t dynamicAddr; /*!< Device dynamic address. */ - uint8_t staticAddr; /*!< Static address. */ - uint8_t dcr; /*!< Device characteristics register information. */ - uint8_t bcr; /*!< Bus characteristics register information. */ - uint16_t vendorID; /*!< Device vendor ID(manufacture ID). */ - uint32_t partNumber; /*!< Device part number info */ - uint16_t maxReadLength; /*!< Maximum read length. */ - uint16_t maxWriteLength; /*!< Maximum write length. */ - uint8_t hdrMode; /*!< Support hdr mode, could be OR logic in i3c_hdr_mode. */ -} i3c_device_info_t; - -/*! @} */ - -/*! - * @addtogroup i3c_master_driver - * @{ - */ - -/*! - * @brief I3C master peripheral flags. - * - * The following status register flags can be cleared: - * - #kI3C_MasterSlaveStartFlag - * - #kI3C_MasterControlDoneFlag - * - #kI3C_MasterCompleteFlag - * - #kI3C_MasterArbitrationWonFlag - * - #kI3C_MasterSlave2MasterFlag - * - * All flags except #kI3C_MasterBetweenFlag and #kI3C_MasterNackDetectFlag can be enabled as - * interrupts. - * - * @note These enums are meant to be OR'd together to form a bit mask. - */ -enum _i3c_master_flags -{ - kI3C_MasterBetweenFlag = I3C_MSTATUS_BETWEEN_MASK, /*!< Between messages/DAAs flag */ - kI3C_MasterNackDetectFlag = I3C_MSTATUS_NACKED_MASK, /*!< NACK detected flag */ - kI3C_MasterSlaveStartFlag = I3C_MSTATUS_SLVSTART_MASK, /*!< Slave request start flag */ - kI3C_MasterControlDoneFlag = I3C_MSTATUS_MCTRLDONE_MASK, /*!< Master request complete flag */ - kI3C_MasterCompleteFlag = I3C_MSTATUS_COMPLETE_MASK, /*!< Transfer complete flag */ - kI3C_MasterRxReadyFlag = I3C_MSTATUS_RXPEND_MASK, /*!< Rx data ready in Rx buffer flag */ - kI3C_MasterTxReadyFlag = I3C_MSTATUS_TXNOTFULL_MASK, /*!< Tx buffer ready for Tx data flag */ - kI3C_MasterArbitrationWonFlag = I3C_MSTATUS_IBIWON_MASK, /*!< Header address won arbitration flag */ - kI3C_MasterErrorFlag = I3C_MSTATUS_ERRWARN_MASK, /*!< Error occurred flag */ - kI3C_MasterSlave2MasterFlag = I3C_MSTATUS_NOWMASTER_MASK, /*!< Switch from slave to master flag */ - kI3C_MasterClearFlags = kI3C_MasterSlaveStartFlag | kI3C_MasterControlDoneFlag | kI3C_MasterCompleteFlag | - kI3C_MasterArbitrationWonFlag | kI3C_MasterSlave2MasterFlag | kI3C_MasterErrorFlag, -}; - -/*! - * @brief I3C master error flags to indicate the causes. - * - * @note These enums are meant to be OR'd together to form a bit mask. - */ -enum _i3c_master_error_flags -{ - kI3C_MasterErrorNackFlag = I3C_MERRWARN_NACK_MASK, /*!< Slave NACKed the last address */ - kI3C_MasterErrorWriteAbortFlag = I3C_MERRWARN_WRABT_MASK, /*!< Slave NACKed the write data */ -#if !defined(FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) || (!FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) - kI3C_MasterErrorTermFlag = I3C_MERRWARN_TERM_MASK, /*!< Master terminates slave read */ -#endif - kI3C_MasterErrorParityFlag = I3C_MERRWARN_HPAR_MASK, /*!< Parity error from DDR read */ - kI3C_MasterErrorCrcFlag = I3C_MERRWARN_HCRC_MASK, /*!< CRC error from DDR read */ - kI3C_MasterErrorReadFlag = I3C_MERRWARN_OREAD_MASK, /*!< Read from MRDATAB register when FIFO empty */ - kI3C_MasterErrorWriteFlag = I3C_MERRWARN_OWRITE_MASK, /*!< Write to MWDATAB register when FIFO full */ - kI3C_MasterErrorMsgFlag = I3C_MERRWARN_MSGERR_MASK, /*!< Message SDR/DDR mismatch or - read/write message in wrong state */ - kI3C_MasterErrorInvalidReqFlag = I3C_MERRWARN_INVREQ_MASK, /*!< Invalid use of request */ - kI3C_MasterErrorTimeoutFlag = I3C_MERRWARN_TIMEOUT_MASK, /*!< The module has stalled too long in a frame */ - kI3C_MasterAllErrorFlags = kI3C_MasterErrorNackFlag | kI3C_MasterErrorWriteAbortFlag | -#if !defined(FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) || (!FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) - kI3C_MasterErrorTermFlag | -#endif - kI3C_MasterErrorParityFlag | kI3C_MasterErrorCrcFlag | kI3C_MasterErrorReadFlag | - kI3C_MasterErrorWriteFlag | kI3C_MasterErrorMsgFlag | kI3C_MasterErrorInvalidReqFlag | - kI3C_MasterErrorTimeoutFlag, /*!< All error flags */ -}; - -/*! @brief I3C working master state. */ -typedef enum _i3c_master_state -{ - kI3C_MasterStateIdle = 0U, /*!< Bus stopped. */ - kI3C_MasterStateSlvReq = 1U, /*!< Bus stopped but slave holding SDA low. */ - kI3C_MasterStateMsgSdr = 2U, /*!< In SDR Message mode from using MWMSG_SDR. */ - kI3C_MasterStateNormAct = 3U, /*!< In normal active SDR mode. */ - kI3C_MasterStateDdr = 4U, /*!< In DDR Message mode. */ - kI3C_MasterStateDaa = 5U, /*!< In ENTDAA mode. */ - kI3C_MasterStateIbiAck = 6U, /*!< Waiting on IBI ACK/NACK decision. */ - kI3C_MasterStateIbiRcv = 7U, /*!< receiving IBI. */ -} i3c_master_state_t; - -/*! @brief I3C master enable configuration. */ -typedef enum _i3c_master_enable -{ - kI3C_MasterOff = 0U, /*!< Master off. */ - kI3C_MasterOn = 1U, /*!< Master on. */ - kI3C_MasterCapable = 2U /*!< Master capable. */ -} i3c_master_enable_t; - -/*! @brief I3C high keeper configuration. */ -typedef enum _i3c_master_hkeep -{ - kI3C_MasterHighKeeperNone = 0U, /*!< Use PUR to hold SCL high. */ - kI3C_MasterHighKeeperWiredIn = 1U, /*!< Use pin_HK controls. */ - kI3C_MasterPassiveSDA = 2U, /*!< Hi-Z for Bus Free and hold SDA. */ - kI3C_MasterPassiveSDASCL = 3U /*!< Hi-Z both for Bus Free, and can Hi-Z SDA for hold. */ -} i3c_master_hkeep_t; - -/*! @brief Emits the requested operation when doing in pieces vs. by message. */ -typedef enum _i3c_bus_request -{ - kI3C_RequestNone = 0U, /*!< No request. */ - kI3C_RequestEmitStartAddr = 1U, /*!< Request to emit start and address on bus. */ - kI3C_RequestEmitStop = 2U, /*!< Request to emit stop on bus. */ - kI3C_RequestIbiAckNack = 3U, /*!< Manual IBI ACK or NACK. */ - kI3C_RequestProcessDAA = 4U, /*!< Process DAA. */ - kI3C_RequestForceExit = 6U, /*!< Request to force exit. */ - kI3C_RequestAutoIbi = 7U, /*!< Hold in stopped state, but Auto-emit START,7E. */ -} i3c_bus_request_t; - -/*! @brief Bus type with EmitStartAddr. */ -typedef enum _i3c_bus_type -{ - kI3C_TypeI3CSdr = 0U, /*!< SDR mode of I3C. */ - kI3C_TypeI2C = 1U, /*!< Standard i2c protocol. */ - kI3C_TypeI3CDdr = 2U, /*!< HDR-DDR mode of I3C. */ -} i3c_bus_type_t; - -/*! @brief IBI response. */ -typedef enum _i3c_ibi_response -{ - kI3C_IbiRespAck = 0U, /*!< ACK with no mandatory byte. */ - kI3C_IbiRespNack = 1U, /*!< NACK. */ - kI3C_IbiRespAckMandatory = 2U, /*!< ACK with mandatory byte. */ - kI3C_IbiRespManual = 3U, /*!< Reserved. */ -} i3c_ibi_response_t; - -/*! @brief IBI type. */ -typedef enum _i3c_ibi_type -{ - kI3C_IbiNormal = 0U, /*!< In-band interrupt. */ - kI3C_IbiHotJoin = 1U, /*!< slave hot join. */ - kI3C_IbiMasterRequest = 2U, /*!< slave master ship request. */ -} i3c_ibi_type_t; - -/*! @brief IBI state. */ -typedef enum _i3c_ibi_state -{ - kI3C_IbiReady = 0U, /*!< In-band interrupt ready state, ready for user to handle. */ - kI3C_IbiDataBuffNeed = 1U, /*!< In-band interrupt need data buffer for data receive. */ - kI3C_IbiAckNackPending = 2U, /*!< In-band interrupt Ack/Nack pending for decision. */ -} i3c_ibi_state_t; - -/*! @brief Direction of master and slave transfers. */ -typedef enum _i3c_direction -{ - kI3C_Write = 0U, /*!< Master transmit. */ - kI3C_Read = 1U /*!< Master receive. */ -} i3c_direction_t; - -/*! @brief Watermark of TX int/dma trigger level. */ -typedef enum _i3c_tx_trigger_level -{ - kI3C_TxTriggerOnEmpty = 0U, /*!< Trigger on empty. */ - kI3C_TxTriggerUntilOneQuarterOrLess = 1U, /*!< Trigger on 1/4 full or less. */ - kI3C_TxTriggerUntilOneHalfOrLess = 2U, /*!< Trigger on 1/2 full or less. */ - kI3C_TxTriggerUntilOneLessThanFull = 3U, /*!< Trigger on 1 less than full or less. */ -} i3c_tx_trigger_level_t; - -/*! @brief Watermark of RX int/dma trigger level. */ -typedef enum _i3c_rx_trigger_level -{ - kI3C_RxTriggerOnNotEmpty = 0U, /*!< Trigger on not empty. */ - kI3C_RxTriggerUntilOneQuarterOrMore = 1U, /*!< Trigger on 1/4 full or more. */ - kI3C_RxTriggerUntilOneHalfOrMore = 2U, /*!< Trigger on 1/2 full or more. */ - kI3C_RxTriggerUntilThreeQuarterOrMore = 3U, /*!< Trigger on 3/4 full or more. */ -} i3c_rx_trigger_level_t; - -/*! @brief I3C master read termination operations. */ -typedef enum _i3c_rx_term_ops -{ - kI3C_RxTermDisable = 0U, /*!< Master doesn't terminate read, used for CCC transfer. */ - kI3C_RxAutoTerm = 1U, /*!< Master auto terminate read after receiving specified bytes(<=255). */ - kI3C_RxTermLastByte = 2U, /*!< Master terminates read at any time after START, no length limitation. */ -} i3c_rx_term_ops_t; - -/*! @brief I3C start SCL delay options. */ -typedef enum _i3c_start_scl_delay -{ - kI3C_NoDelay = 0U, /*!< No delay. */ - kI3C_IncreaseSclHalfPeriod = 1U, /*!< Increases SCL clock period by 1/2. */ - kI3C_IncreaseSclOnePeriod = 2U, /*!< Increases SCL clock period by 1. */ - kI3C_IncreaseSclOneAndHalfPeriod = 3U, /*!< Increases SCL clock period by 1 1/2 */ -} i3c_start_scl_delay_t; - -/*! @brief Structure with setting master IBI rules and slave registry. */ -typedef struct _i3c_register_ibi_addr -{ - uint8_t address[5]; /*!< Address array for registry. */ - bool ibiHasPayload; /*!< Whether the address array has mandatory IBI byte. */ -} i3c_register_ibi_addr_t; - -/*! @brief Structure with I3C baudrate settings. */ -typedef struct _i3c_baudrate -{ - uint32_t i2cBaud; /*!< Desired I2C baud rate in Hertz. */ - uint32_t i3cPushPullBaud; /*!< Desired I3C push-pull baud rate in Hertz. */ - uint32_t i3cOpenDrainBaud; /*!< Desired I3C open-drain baud rate in Hertz. */ -} i3c_baudrate_hz_t; - -/*! @brief I3C DAA baud rate configuration. */ -typedef struct _i3c_master_daa_baudrate -{ - uint32_t sourceClock_Hz; /*!< FCLK, function clock in Hertz. */ - uint32_t i3cPushPullBaud; /*!< Desired I3C push-pull baud rate in Hertz. */ - uint32_t i3cOpenDrainBaud; /*!< Desired I3C open-drain baud rate in Hertz. */ -} i3c_master_daa_baudrate_t; - -/*! - * @brief Structure with settings to initialize the I3C master module. - * - * This structure holds configuration settings for the I3C peripheral. To initialize this - * structure to reasonable defaults, call the I3C_MasterGetDefaultConfig() function and - * pass a pointer to your configuration structure instance. - * - * The configuration structure can be made constant so it resides in flash. - */ -typedef struct _i3c_master_config -{ - i3c_master_enable_t enableMaster; /*!< Enable master mode. */ - bool disableTimeout; /*!< Whether to disable timeout to prevent the ERRWARN. */ - i3c_master_hkeep_t hKeep; /*!< High keeper mode setting. */ - bool enableOpenDrainStop; /*!< Whether to emit open-drain speed STOP. */ - bool enableOpenDrainHigh; /*!< Enable Open-Drain High to be 1 PPBAUD count for i3c messages, or 1 ODBAUD. */ - i3c_baudrate_hz_t baudRate_Hz; /*!< Desired baud rate settings. */ -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - uint32_t slowClock_Hz; /*!< Slow clock frequency. */ -#endif -#if defined(FSL_FEATURE_I3C_HAS_START_SCL_DELAY) && FSL_FEATURE_I3C_HAS_START_SCL_DELAY - i3c_start_scl_delay_t startSclDelay; /*!< I3C SCL delay after START. */ - i3c_start_scl_delay_t restartSclDelay; /*!< I3C SCL delay after Repeated START. */ -#endif -} i3c_master_config_t; - -/* Forward declaration of the transfer descriptor and handle typedefs. */ -typedef struct _i3c_master_transfer i3c_master_transfer_t; -typedef struct _i3c_master_handle i3c_master_handle_t; - -/*! @brief i3c master callback functions. */ -typedef struct _i3c_master_transfer_callback -{ - void (*slave2Master)(I3C_Type *base, void *userData); /*!< Transfer complete callback */ - void (*ibiCallback)(I3C_Type *base, - i3c_master_handle_t *handle, - i3c_ibi_type_t ibiType, - i3c_ibi_state_t ibiState); /*!< IBI event callback */ - void (*transferComplete)(I3C_Type *base, - i3c_master_handle_t *handle, - status_t completionStatus, - void *userData); /*!< Transfer complete callback */ -} i3c_master_transfer_callback_t; -/*! - * @brief Transfer option flags. - * - * @note These enumerations are intended to be OR'd together to form a bit mask of options for - * the #_i3c_master_transfer::flags field. - */ -enum _i3c_master_transfer_flags -{ - kI3C_TransferDefaultFlag = 0x00U, /*!< Transfer starts with a start signal, stops with a stop signal. */ - kI3C_TransferNoStartFlag = 0x01U, /*!< Don't send a start condition, address, and sub address */ - kI3C_TransferRepeatedStartFlag = 0x02U, /*!< Send a repeated start condition */ - kI3C_TransferNoStopFlag = 0x04U, /*!< Don't send a stop condition. */ - kI3C_TransferWordsFlag = 0x08U, /*!< Transfer in words, else transfer in bytes. */ - kI3C_TransferDisableRxTermFlag = 0x10U, /*!< Disable Rx termination. Note: It's for I3C CCC transfer. */ - kI3C_TransferRxAutoTermFlag = - 0x20U, /*!< Set Rx auto-termination. Note: It's adaptive based on Rx size(<=255 bytes) except in I3C_MasterReceive. */ - kI3C_TransferStartWithBroadcastAddr = 0x40U, /*!< Start transfer with 0x7E, then read/write data with device address. */ -}; - -/*! - * @brief Non-blocking transfer descriptor structure. - * - * This structure is used to pass transaction parameters to the I3C_MasterTransferNonBlocking() API. - */ -struct _i3c_master_transfer -{ - uint32_t flags; /*!< Bit mask of options for the transfer. See enumeration #_i3c_master_transfer_flags for available - options. Set to 0 or #kI3C_TransferDefaultFlag for normal transfers. */ - uint8_t slaveAddress; /*!< The 7-bit slave address. */ - i3c_direction_t direction; /*!< Either #kI3C_Read or #kI3C_Write. */ - uint32_t subaddress; /*!< Sub address. Transferred MSB first. */ - size_t subaddressSize; /*!< Length of sub address to send in bytes. Maximum size is 4 bytes. */ - void *data; /*!< Pointer to data to transfer. */ - size_t dataSize; /*!< Number of bytes to transfer. */ - i3c_bus_type_t busType; /*!< bus type. */ - i3c_ibi_response_t ibiResponse; /*!< ibi response during transfer. */ -}; - -/*! - * @brief Driver handle for master non-blocking APIs. - * @note The contents of this structure are private and subject to change. - */ -struct _i3c_master_handle -{ - uint8_t state; /*!< Transfer state machine current state. */ - uint32_t remainingBytes; /*!< Remaining byte count in current state. */ - i3c_rx_term_ops_t rxTermOps; /*!< Read termination operation. */ - i3c_master_transfer_t transfer; /*!< Copy of the current transfer info. */ - uint8_t ibiAddress; /*!< Slave address which request IBI. */ - uint8_t *ibiBuff; /*!< Pointer to IBI buffer to keep ibi bytes. */ - size_t ibiPayloadSize; /*!< IBI payload size. */ - i3c_ibi_type_t ibiType; /*!< IBI type. */ - i3c_master_transfer_callback_t callback; /*!< Callback functions pointer. */ - void *userData; /*!< Application data passed to callback. */ -}; - -/*! @brief Typedef for master interrupt handler. */ -typedef void (*i3c_master_isr_t)(I3C_Type *base, void *handle); - -/*! @} */ - -/*! - * @addtogroup i3c_slave_driver - * @{ - */ - -/*! - * @brief I3C slave peripheral flags. - * - * The following status register flags can be cleared: - * - #kI3C_SlaveBusStartFlag - * - #kI3C_SlaveMatchedFlag - * - #kI3C_SlaveBusStopFlag - * - * Only below flags can be enabled as interrupts. - * - #kI3C_SlaveBusStartFlag - * - #kI3C_SlaveMatchedFlag - * - #kI3C_SlaveBusStopFlag - * - #kI3C_SlaveRxReadyFlag - * - #kI3C_SlaveTxReadyFlag - * - #kI3C_SlaveDynamicAddrChangedFlag - * - #kI3C_SlaveReceivedCCCFlag - * - #kI3C_SlaveErrorFlag - * - #kI3C_SlaveHDRCommandMatchFlag - * - #kI3C_SlaveCCCHandledFlag - * - #kI3C_SlaveEventSentFlag - - * @note These enums are meant to be OR'd together to form a bit mask. - */ -enum _i3c_slave_flags -{ - kI3C_SlaveNotStopFlag = I3C_SSTATUS_STNOTSTOP_MASK, /*!< Slave status not stop flag */ - kI3C_SlaveMessageFlag = I3C_SSTATUS_STMSG_MASK, /*!< Slave status message, indicating slave is - listening to the bus traffic or responding */ - kI3C_SlaveRequiredReadFlag = I3C_SSTATUS_STREQRD_MASK, /*!< Slave status required, either is master doing SDR - read from slave, or is IBI pushing out. */ - kI3C_SlaveRequiredWriteFlag = I3C_SSTATUS_STREQWR_MASK, /*!< Slave status request write, master is doing SDR - write to slave, except slave in ENTDAA mode */ - kI3C_SlaveBusDAAFlag = I3C_SSTATUS_STDAA_MASK, /*!< I3C bus is in ENTDAA mode */ - kI3C_SlaveBusHDRModeFlag = I3C_SSTATUS_STHDR_MASK, /*!< I3C bus is in HDR mode */ - kI3C_SlaveBusStartFlag = I3C_SSTATUS_START_MASK, /*!< Start/Re-start event is seen since the bus was last cleared */ - kI3C_SlaveMatchedFlag = I3C_SSTATUS_MATCHED_MASK, /*!< Slave address(dynamic/static) matched since last cleared */ - kI3C_SlaveBusStopFlag = I3C_SSTATUS_STOP_MASK, /*!enableMaster = kI3C_MasterCapable; - * config->disableTimeout = false; - * config->hKeep = kI3C_MasterHighKeeperNone; - * config->enableOpenDrainStop = true; - * config->enableOpenDrainHigh = true; - * config->baudRate_Hz.i2cBaud = 400000U; - * config->baudRate_Hz.i3cPushPullBaud = 12500000U; - * config->baudRate_Hz.i3cOpenDrainBaud = 2500000U; - * config->masterDynamicAddress = 0x0AU; - * config->slowClock_Hz = 1000000U; - * config->enableSlave = true; - * config->vendorID = 0x11BU; - * config->enableRandomPart = false; - * config->partNumber = 0; - * config->dcr = 0; - * config->bcr = 0; - * config->hdrMode = (uint8_t)kI3C_HDRModeDDR; - * config->nakAllRequest = false; - * config->ignoreS0S1Error = false; - * config->offline = false; - * config->matchSlaveStartStop = false; - * @endcode - * - * After calling this function, you can override any settings in order to customize the configuration, - * prior to initializing the common I3C driver with I3C_Init(). - * - * @param[out] config User provided configuration structure for default values. Refer to #i3c_config_t. - */ -void I3C_GetDefaultConfig(i3c_config_t *config); - -/*! - * @brief Initializes the I3C peripheral. - * This function enables the peripheral clock and initializes the I3C peripheral as described by the user - * provided configuration. This will initialize both the master peripheral and slave peripheral so that I3C - * module could work as pure master, pure slave or secondary master, etc. - * A software reset is performed prior to configuration. - * - * @param base The I3C peripheral base address. - * @param config User provided peripheral configuration. Use I3C_GetDefaultConfig() to get a set of - * defaults that you can override. - * @param sourceClock_Hz Frequency in Hertz of the I3C functional clock. Used to calculate the baud rate divisors, - * filter widths, and timeout periods. - */ -void I3C_Init(I3C_Type *base, const i3c_config_t *config, uint32_t sourceClock_Hz); - -/*! @} */ - -/*! - * @addtogroup i3c_master_driver - * @{ - */ - -/*! @name Initialization and deinitialization */ -/*! @{ */ - -/*! - * @brief Provides a default configuration for the I3C master peripheral. - * - * This function provides the following default configuration for the I3C master peripheral: - * @code - * masterConfig->enableMaster = kI3C_MasterOn; - * masterConfig->disableTimeout = false; - * masterConfig->hKeep = kI3C_MasterHighKeeperNone; - * masterConfig->enableOpenDrainStop = true; - * masterConfig->enableOpenDrainHigh = true; - * masterConfig->baudRate_Hz = 100000U; - * masterConfig->busType = kI3C_TypeI2C; - * @endcode - * - * After calling this function, you can override any settings in order to customize the configuration, - * prior to initializing the master driver with I3C_MasterInit(). - * - * @param[out] masterConfig User provided configuration structure for default values. Refer to #i3c_master_config_t. - */ -void I3C_MasterGetDefaultConfig(i3c_master_config_t *masterConfig); - -/*! - * @brief Initializes the I3C master peripheral. - * - * This function enables the peripheral clock and initializes the I3C master peripheral as described by the user - * provided configuration. A software reset is performed prior to configuration. - * - * @param base The I3C peripheral base address. - * @param masterConfig User provided peripheral configuration. Use I3C_MasterGetDefaultConfig() to get a set of - * defaults that you can override. - * @param sourceClock_Hz Frequency in Hertz of the I3C functional clock. Used to calculate the baud rate divisors, - * filter widths, and timeout periods. - */ -void I3C_MasterInit(I3C_Type *base, const i3c_master_config_t *masterConfig, uint32_t sourceClock_Hz); - -/*! - * @brief Deinitializes the I3C master peripheral. - * - * This function disables the I3C master peripheral and gates the clock. It also performs a software - * reset to restore the peripheral to reset conditions. - * - * @param base The I3C peripheral base address. - */ -void I3C_MasterDeinit(I3C_Type *base); - -/* Not static so it can be used from fsl_i3c_dma.c. */ -status_t I3C_MasterCheckAndClearError(I3C_Type *base, uint32_t status); - -/* Not static so it can be used from fsl_i3c_dma.c. */ -status_t I3C_MasterWaitForCtrlDone(I3C_Type *base, bool waitIdle); - -/* Not static so it can be used from fsl_i3c_dma.c. */ -status_t I3C_CheckForBusyBus(I3C_Type *base); - -/*! - * @brief Set I3C module master mode. - * - * @param base The I3C peripheral base address. - * @param enable Enable master mode. - */ -static inline void I3C_MasterEnable(I3C_Type *base, i3c_master_enable_t enable) -{ - base->MCONFIG = (base->MCONFIG & ~I3C_MCONFIG_MSTENA_MASK) | I3C_MCONFIG_MSTENA(enable); -} - -/*! @} */ - -/*! @name Status */ -/*! @{ */ - -/*! - * @brief Gets the I3C master status flags. - * - * A bit mask with the state of all I3C master status flags is returned. For each flag, the corresponding bit - * in the return value is set if the flag is asserted. - * - * @param base The I3C peripheral base address. - * @return State of the status flags: - * - 1: related status flag is set. - * - 0: related status flag is not set. - * @see _i3c_master_flags - */ -static inline uint32_t I3C_MasterGetStatusFlags(I3C_Type *base) -{ - return base->MSTATUS & ~(I3C_MSTATUS_STATE_MASK | I3C_MSTATUS_IBITYPE_MASK); -} - -/*! - * @brief Clears the I3C master status flag state. - * - * The following status register flags can be cleared: - * - #kI3C_MasterSlaveStartFlag - * - #kI3C_MasterControlDoneFlag - * - #kI3C_MasterCompleteFlag - * - #kI3C_MasterArbitrationWonFlag - * - #kI3C_MasterSlave2MasterFlag - * - * Attempts to clear other flags has no effect. - * - * @param base The I3C peripheral base address. - * @param statusMask A bitmask of status flags that are to be cleared. The mask is composed of - * #_i3c_master_flags enumerators OR'd together. You may pass the result of a previous call to - * I3C_MasterGetStatusFlags(). - * @see _i3c_master_flags. - */ -static inline void I3C_MasterClearStatusFlags(I3C_Type *base, uint32_t statusMask) -{ - base->MSTATUS = statusMask; -} - -/*! - * @brief Gets the I3C master error status flags. - * - * A bit mask with the state of all I3C master error status flags is returned. For each flag, the corresponding bit - * in the return value is set if the flag is asserted. - * - * @param base The I3C peripheral base address. - * @return State of the error status flags: - * - 1: related status flag is set. - * - 0: related status flag is not set. - * @see _i3c_master_error_flags - */ -static inline uint32_t I3C_MasterGetErrorStatusFlags(I3C_Type *base) -{ - return base->MERRWARN; -} - -/*! - * @brief Clears the I3C master error status flag state. - * - * @param base The I3C peripheral base address. - * @param statusMask A bitmask of error status flags that are to be cleared. The mask is composed of - * #_i3c_master_error_flags enumerators OR'd together. You may pass the result of a previous call to - * I3C_MasterGetStatusFlags(). - * @see _i3c_master_error_flags. - */ -static inline void I3C_MasterClearErrorStatusFlags(I3C_Type *base, uint32_t statusMask) -{ - while ((base->MERRWARN & statusMask) != 0U) - { - base->MERRWARN = statusMask; - } -} - -/*! - * @brief Gets the I3C master state. - * - * @param base The I3C peripheral base address. - * @return I3C master state. - */ -i3c_master_state_t I3C_MasterGetState(I3C_Type *base); - -/*! @} */ - -/*! @name Interrupts */ -/*! @{ */ - -/*! - * @brief Enables the I3C master interrupt requests. - * - * All flags except #kI3C_MasterBetweenFlag and #kI3C_MasterNackDetectFlag can be enabled as - * interrupts. - * - * @param base The I3C peripheral base address. - * @param interruptMask Bit mask of interrupts to enable. See #_i3c_master_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void I3C_MasterEnableInterrupts(I3C_Type *base, uint32_t interruptMask) -{ - base->MINTSET |= interruptMask; -} - -/*! - * @brief Disables the I3C master interrupt requests. - * - * All flags except #kI3C_MasterBetweenFlag and #kI3C_MasterNackDetectFlag can be enabled as - * interrupts. - * - * @param base The I3C peripheral base address. - * @param interruptMask Bit mask of interrupts to disable. See #_i3c_master_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void I3C_MasterDisableInterrupts(I3C_Type *base, uint32_t interruptMask) -{ - base->MINTCLR = interruptMask; -} - -/*! - * @brief Returns the set of currently enabled I3C master interrupt requests. - * - * @param base The I3C peripheral base address. - * @return A bitmask composed of #_i3c_master_flags enumerators OR'd together to indicate the - * set of enabled interrupts. - */ -static inline uint32_t I3C_MasterGetEnabledInterrupts(I3C_Type *base) -{ - return base->MINTSET; -} - -/*! - * @brief Returns the set of pending I3C master interrupt requests. - * - * @param base The I3C peripheral base address. - * @return A bitmask composed of #_i3c_master_flags enumerators OR'd together to indicate the - * set of pending interrupts. - */ -static inline uint32_t I3C_MasterGetPendingInterrupts(I3C_Type *base) -{ - return base->MINTMASKED; -} - -/*! @} */ - -/*! @name DMA control */ -/*! @{ */ - -/*! - * @brief Enables or disables I3C master DMA requests. - * - * @param base The I3C peripheral base address. - * @param enableTx Enable flag for transmit DMA request. Pass true for enable, false for disable. - * @param enableRx Enable flag for receive DMA request. Pass true for enable, false for disable. - * @param width DMA read/write unit in bytes. - */ -static inline void I3C_MasterEnableDMA(I3C_Type *base, bool enableTx, bool enableRx, uint32_t width) -{ - assert(width <= 2U); - base->MDMACTRL = - I3C_MDMACTRL_DMAFB(enableRx ? 2U : 0U) | I3C_MDMACTRL_DMATB(enableTx ? 2U : 0U) | I3C_MDMACTRL_DMAWIDTH(width); -} - -/*! - * @brief Gets I3C master transmit data register address for DMA transfer. - * - * @param base The I3C peripheral base address. - * @param width DMA read/write unit in bytes. - * @return The I3C Master Transmit Data Register address. - */ -static inline uint32_t I3C_MasterGetTxFifoAddress(I3C_Type *base, uint32_t width) -{ - assert(width <= 2U); - return (uint32_t)((width == 2U) ? &base->MWDATAH : &base->MWDATAB); -} - -/*! - * @brief Gets I3C master receive data register address for DMA transfer. - * - * @param base The I3C peripheral base address. - * @param width DMA read/write unit in bytes. - * @return The I3C Master Receive Data Register address. - */ -static inline uint32_t I3C_MasterGetRxFifoAddress(I3C_Type *base, uint32_t width) -{ - assert(width <= 2U); - return (uint32_t)((width == 2U) ? &base->MRDATAH : &base->MRDATAB); -} - -/*! @} */ - -/*! @name FIFO control */ -/*! @{ */ - -/*! - * @brief Sets the watermarks for I3C master FIFOs. - * - * @param base The I3C peripheral base address. - * @param txLvl Transmit FIFO watermark level. The #kI3C_MasterTxReadyFlag flag is set whenever - * the number of words in the transmit FIFO reaches @a txLvl. - * @param rxLvl Receive FIFO watermark level. The #kI3C_MasterRxReadyFlag flag is set whenever - * the number of words in the receive FIFO reaches @a rxLvl. - * @param flushTx true if TX FIFO is to be cleared, otherwise TX FIFO remains unchanged. - * @param flushRx true if RX FIFO is to be cleared, otherwise RX FIFO remains unchanged. - */ -static inline void I3C_MasterSetWatermarks( - I3C_Type *base, i3c_tx_trigger_level_t txLvl, i3c_rx_trigger_level_t rxLvl, bool flushTx, bool flushRx) -{ - base->MDATACTRL = I3C_MDATACTRL_UNLOCK_MASK | I3C_MDATACTRL_TXTRIG(txLvl) | I3C_MDATACTRL_RXTRIG(rxLvl) | - (flushTx ? I3C_MDATACTRL_FLUSHTB_MASK : 0U) | (flushRx ? I3C_MDATACTRL_FLUSHFB_MASK : 0U); -} - -/*! - * @brief Gets the current number of bytes in the I3C master FIFOs. - * - * @param base The I3C peripheral base address. - * @param[out] txCount Pointer through which the current number of bytes in the transmit FIFO is returned. - * Pass NULL if this value is not required. - * @param[out] rxCount Pointer through which the current number of bytes in the receive FIFO is returned. - * Pass NULL if this value is not required. - */ -static inline void I3C_MasterGetFifoCounts(I3C_Type *base, size_t *rxCount, size_t *txCount) -{ - if (NULL != txCount) - { - *txCount = (base->MDATACTRL & I3C_MDATACTRL_TXCOUNT_MASK) >> I3C_MDATACTRL_TXCOUNT_SHIFT; - } - if (NULL != rxCount) - { - *rxCount = (base->MDATACTRL & I3C_MDATACTRL_RXCOUNT_MASK) >> I3C_MDATACTRL_RXCOUNT_SHIFT; - } -} - -/*! @} */ - -/*! @name Bus operations */ -/*! @{ */ - -/*! - * @brief Sets the I3C bus frequency for master transactions. - * - * The I3C master is automatically disabled and re-enabled as necessary to configure the baud - * rate. Do not call this function during a transfer, or the transfer is aborted. - * - * @param base The I3C peripheral base address. - * @param baudRate_Hz Pointer to structure of requested bus frequency in Hertz. - * @param sourceClock_Hz I3C functional clock frequency in Hertz. - */ -void I3C_MasterSetBaudRate(I3C_Type *base, const i3c_baudrate_hz_t *baudRate_Hz, uint32_t sourceClock_Hz); - -/*! - * @brief Returns whether the bus is idle. - * - * Requires the master mode to be enabled. - * - * @param base The I3C peripheral base address. - * @retval true Bus is busy. - * @retval false Bus is idle. - */ -static inline bool I3C_MasterGetBusIdleState(I3C_Type *base) -{ - return ((base->MSTATUS & I3C_MSTATUS_STATE_MASK) == (uint32_t)kI3C_MasterStateIdle ? true : false); -} - -/*! - * @brief Sends a START signal and slave address on the I2C/I3C bus, receive size is also specified - * in the call. - * - * This function is used to initiate a new master mode transfer. First, the bus state is checked to ensure - * that another master is not occupying the bus. Then a START signal is transmitted, followed by the - * 7-bit address specified in the a address parameter. Note that this function does not actually wait - * until the START and address are successfully sent on the bus before returning. - * - * @param base The I3C peripheral base address. - * @param type The bus type to use in this transaction. - * @param address 7-bit slave device address, in bits [6:0]. - * @param dir Master transfer direction, either #kI3C_Read or #kI3C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * @param rxSize Read terminate size for the followed read transfer, limit to 255 bytes. - * @retval #kStatus_Success START signal and address were successfully enqueued in the transmit FIFO. - * @retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - */ -status_t I3C_MasterStartWithRxSize( - I3C_Type *base, i3c_bus_type_t type, uint8_t address, i3c_direction_t dir, uint8_t rxSize); - -/*! - * @brief Sends a START signal and slave address on the I2C/I3C bus. - * - * This function is used to initiate a new master mode transfer. First, the bus state is checked to ensure - * that another master is not occupying the bus. Then a START signal is transmitted, followed by the - * 7-bit address specified in the @a address parameter. Note that this function does not actually wait - * until the START and address are successfully sent on the bus before returning. - * - * @param base The I3C peripheral base address. - * @param type The bus type to use in this transaction. - * @param address 7-bit slave device address, in bits [6:0]. - * @param dir Master transfer direction, either #kI3C_Read or #kI3C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * @retval #kStatus_Success START signal and address were successfully enqueued in the transmit FIFO. - * @retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - */ -status_t I3C_MasterStart(I3C_Type *base, i3c_bus_type_t type, uint8_t address, i3c_direction_t dir); - -/*! - * @brief Sends a repeated START signal and slave address on the I2C/I3C bus, receive size is also specified - * in the call. - * - * This function is used to send a Repeated START signal when a transfer is already in progress. Like - * I3C_MasterStart(), it also sends the specified 7-bit address. Call this API also configures the read - * terminate size for the following read transfer. For example, set the rxSize = 2, the following read transfer - * will be terminated after two bytes of data received. Write transfer will not be affected by the rxSize - * configuration. - * - * @note This function exists primarily to maintain compatible APIs between I3C and I2C drivers, - * as well as to better document the intent of code that uses these APIs. - * - * @param base The I3C peripheral base address. - * @param type The bus type to use in this transaction. - * @param address 7-bit slave device address, in bits [6:0]. - * @param dir Master transfer direction, either #kI3C_Read or #kI3C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * @param rxSize Read terminate size for the followed read transfer, limit to 255 bytes. - * @retval #kStatus_Success Repeated START signal and address were successfully enqueued in the transmit FIFO. - */ -status_t I3C_MasterRepeatedStartWithRxSize( - I3C_Type *base, i3c_bus_type_t type, uint8_t address, i3c_direction_t dir, uint8_t rxSize); - -/*! - * @brief Sends a repeated START signal and slave address on the I2C/I3C bus. - * - * This function is used to send a Repeated START signal when a transfer is already in progress. Like - * I3C_MasterStart(), it also sends the specified 7-bit address. - * - * @note This function exists primarily to maintain compatible APIs between I3C and I2C drivers, - * as well as to better document the intent of code that uses these APIs. - * - * @param base The I3C peripheral base address. - * @param type The bus type to use in this transaction. - * @param address 7-bit slave device address, in bits [6:0]. - * @param dir Master transfer direction, either #kI3C_Read or #kI3C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * @retval #kStatus_Success Repeated START signal and address were successfully enqueued in the transmit FIFO. - */ -static inline status_t I3C_MasterRepeatedStart(I3C_Type *base, - i3c_bus_type_t type, - uint8_t address, - i3c_direction_t dir) -{ - return I3C_MasterRepeatedStartWithRxSize(base, type, address, dir, 0); -} - -/*! - * @brief Performs a polling send transfer on the I2C/I3C bus. - * - * Sends up to @a txSize number of bytes to the previously addressed slave device. The slave may - * reply with a NAK to any byte in order to terminate the transfer early. If this happens, this - * function returns #kStatus_I3C_Nak. - * - * @param base The I3C peripheral base address. - * @param txBuff The pointer to the data to be transferred. - * @param txSize The length in bytes of the data to be transferred. - * @param flags Bit mask of options for the transfer. See enumeration #_i3c_master_transfer_flags for available options. - * @retval #kStatus_Success Data was sent successfully. - * @retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_I3C_Timeout The module has stalled too long in a frame. - * @retval #kStatus_I3C_Nak The slave device sent a NAK in response to an address. - * @retval #kStatus_I3C_WriteAbort The slave device sent a NAK in response to a write. - * @retval #kStatus_I3C_MsgError Message SDR/DDR mismatch or read/write message in wrong state. - * @retval #kStatus_I3C_WriteFifoError Write to M/SWDATAB register when FIFO full. - * @retval #kStatus_I3C_InvalidReq Invalid use of request. - */ -status_t I3C_MasterSend(I3C_Type *base, const void *txBuff, size_t txSize, uint32_t flags); - -/*! - * @brief Performs a polling receive transfer on the I2C/I3C bus. - * - * @param base The I3C peripheral base address. - * @param rxBuff The pointer to the data to be transferred. - * @param rxSize The length in bytes of the data to be transferred. - * @param flags Bit mask of options for the transfer. See enumeration #_i3c_master_transfer_flags for available options. - * @retval #kStatus_Success Data was received successfully. - * @retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_I3C_Timeout The module has stalled too long in a frame. - * @retval #kStatus_I3C_Term The master terminates slave read. - * @retval #kStatus_I3C_HdrParityError Parity error from DDR read. - * @retval #kStatus_I3C_CrcError CRC error from DDR read. - * @retval #kStatus_I3C_MsgError Message SDR/DDR mismatch or read/write message in wrong state. - * @retval #kStatus_I3C_ReadFifoError Read from M/SRDATAB register when FIFO empty. - * @retval #kStatus_I3C_InvalidReq Invalid use of request. - */ -status_t I3C_MasterReceive(I3C_Type *base, void *rxBuff, size_t rxSize, uint32_t flags); - -/*! - * @brief Sends a STOP signal on the I2C/I3C bus. - * - * This function does not return until the STOP signal is seen on the bus, or an error occurs. - * - * @param base The I3C peripheral base address. - * @retval #kStatus_Success The STOP signal was successfully sent on the bus and the transaction terminated. - * @retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_I3C_Timeout The module has stalled too long in a frame. - * @retval #kStatus_I3C_InvalidReq Invalid use of request. - */ -status_t I3C_MasterStop(I3C_Type *base); - -/*! - * @brief I3C master emit request. - * - * @param base The I3C peripheral base address. - * @param masterReq I3C master request of type #i3c_bus_request_t - */ -void I3C_MasterEmitRequest(I3C_Type *base, i3c_bus_request_t masterReq); - -/*! - * @brief I3C master emit request. - * - * @param base The I3C peripheral base address. - * @param ibiResponse I3C master emit IBI response of type #i3c_ibi_response_t - */ -static inline void I3C_MasterEmitIBIResponse(I3C_Type *base, i3c_ibi_response_t ibiResponse) -{ - uint32_t ctrlVal = base->MCTRL; - ctrlVal &= ~(I3C_MCTRL_IBIRESP_MASK | I3C_MCTRL_REQUEST_MASK); - ctrlVal |= I3C_MCTRL_IBIRESP((uint32_t)ibiResponse) | I3C_MCTRL_REQUEST(kI3C_RequestIbiAckNack); - base->MCTRL = ctrlVal; -} - -/*! - * @brief I3C master register IBI rule. - * - * @param base The I3C peripheral base address. - * @param ibiRule Pointer to ibi rule description of type #i3c_register_ibi_addr_t - */ -void I3C_MasterRegisterIBI(I3C_Type *base, i3c_register_ibi_addr_t *ibiRule); - -/*! - * @brief I3C master get IBI rule. - * - * @param base The I3C peripheral base address. - * @param ibiRule Pointer to store the read out ibi rule description. - */ -void I3C_MasterGetIBIRules(I3C_Type *base, i3c_register_ibi_addr_t *ibiRule); - -/*! - * @brief I3C master get IBI Type. - * - * @param base The I3C peripheral base address. - * @retval i3c_ibi_type_t Type of #i3c_ibi_type_t. - */ -i3c_ibi_type_t I3C_GetIBIType(I3C_Type *base); - -/*! - * @brief I3C master get IBI Address. - * - * @param base The I3C peripheral base address. - * @retval The 8-bit IBI address. - */ -static inline uint8_t I3C_GetIBIAddress(I3C_Type *base) -{ - return (uint8_t)((base->MSTATUS & I3C_MSTATUS_IBIADDR_MASK) >> I3C_MSTATUS_IBIADDR_SHIFT); -} - -/*! - * @brief Performs a DAA in the i3c bus with specified temporary baud rate. - * - * @param base The I3C peripheral base address. - * @param addressList The pointer for address list which is used to do DAA. - * @param count The address count in the address list. - * @param daaBaudRate The temporary baud rate in DAA process, NULL for using initial setting. - * The initial setting is set back between the completion of the DAA and the return of this function. - * @retval #kStatus_Success The transaction was started successfully. - * @retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - * @retval #kStatus_I3C_SlaveCountExceed The I3C slave count has exceed the definition in I3C_MAX_DEVCNT. - */ -status_t I3C_MasterProcessDAASpecifiedBaudrate(I3C_Type *base, - uint8_t *addressList, - uint32_t count, - i3c_master_daa_baudrate_t *daaBaudRate); - -/*! - * @brief Performs a DAA in the i3c bus. - * - * @param base The I3C peripheral base address. - * @param addressList The pointer for address list which is used to do DAA. - * @param count The address count in the address list. - * The initial setting is set back between the completion of the DAA and the return of this function. - * @retval #kStatus_Success The transaction was started successfully. - * @retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - * @retval #kStatus_I3C_SlaveCountExceed The I3C slave count has exceed the definition in I3C_MAX_DEVCNT. - */ -static inline status_t I3C_MasterProcessDAA(I3C_Type *base, uint8_t *addressList, uint32_t count) -{ - return I3C_MasterProcessDAASpecifiedBaudrate(base, addressList, count, NULL); -} - -/*! - * @brief Get device information list after DAA process is done. - * - * @param base The I3C peripheral base address. - * @param[out] count The pointer to store the available device count. - * @return Pointer to the i3c_device_info_t array. - */ -i3c_device_info_t *I3C_MasterGetDeviceListAfterDAA(I3C_Type *base, uint8_t *count); -/*! - * @brief Performs a master polling transfer on the I2C/I3C bus. - * - * @note The API does not return until the transfer succeeds or fails due - * to error happens during transfer. - * - * @param base The I3C peripheral base address. - * @param transfer Pointer to the transfer structure. - * @retval #kStatus_Success Data was received successfully. - * @retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_I3C_IBIWon The I3C slave event IBI or MR or HJ won the arbitration on a header address. - * @retval #kStatus_I3C_Timeout The module has stalled too long in a frame. - * @retval #kStatus_I3C_Nak The slave device sent a NAK in response to an address. - * @retval #kStatus_I3C_WriteAbort The slave device sent a NAK in response to a write. - * @retval #kStatus_I3C_Term The master terminates slave read. - * @retval #kStatus_I3C_HdrParityError Parity error from DDR read. - * @retval #kStatus_I3C_CrcError CRC error from DDR read. - * @retval #kStatus_I3C_MsgError Message SDR/DDR mismatch or read/write message in wrong state. - * @retval #kStatus_I3C_ReadFifoError Read from M/SRDATAB register when FIFO empty. - * @retval #kStatus_I3C_WriteFifoError Write to M/SWDATAB register when FIFO full. - * @retval #kStatus_I3C_InvalidReq Invalid use of request. - */ -status_t I3C_MasterTransferBlocking(I3C_Type *base, i3c_master_transfer_t *transfer); - -/*! @} */ - -/*! @name Non-blocking */ -/*! @{ */ - -/*! - * @brief Creates a new handle for the I3C master non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the I3C_MasterTransferAbort() API shall be called. - * - * - * @note The function also enables the NVIC IRQ for the input I3C. Need to notice - * that on some SoCs the I3C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - * - * @param base The I3C peripheral base address. - * @param[out] handle Pointer to the I3C master driver handle. - * @param callback User provided pointer to the asynchronous callback function. - * @param userData User provided pointer to the application callback data. - */ -void I3C_MasterTransferCreateHandle(I3C_Type *base, - i3c_master_handle_t *handle, - const i3c_master_transfer_callback_t *callback, - void *userData); - -/*! - * @brief Performs a non-blocking transaction on the I2C/I3C bus. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C master driver handle. - * @param transfer The pointer to the transfer descriptor. - * @retval #kStatus_Success The transaction was started successfully. - * @retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - */ -status_t I3C_MasterTransferNonBlocking(I3C_Type *base, i3c_master_handle_t *handle, i3c_master_transfer_t *transfer); - -/*! - * @brief Returns number of bytes transferred so far. - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C master driver handle. - * @param[out] count Number of bytes transferred so far by the non-blocking transaction. - * @retval #kStatus_Success - * @retval #kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t I3C_MasterTransferGetCount(I3C_Type *base, i3c_master_handle_t *handle, size_t *count); - -/*! - * @brief Terminates a non-blocking I3C master transmission early. - * - * @note It is not safe to call this function from an IRQ handler that has a higher priority than the - * I3C peripheral's IRQ priority. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C master driver handle. - * @retval #kStatus_Success A transaction was successfully aborted. - * @retval #kStatus_I3C_Idle There is not a non-blocking transaction currently in progress. - */ -void I3C_MasterTransferAbort(I3C_Type *base, i3c_master_handle_t *handle); - -/*! @} */ - -/*! @name IRQ handler */ -/*! @{ */ - -/*! - * @brief Reusable routine to handle master interrupts. - * @note This function does not need to be called unless you are reimplementing the - * nonblocking API's interrupt handler routines to add special functionality. - * @param base The I3C peripheral base address. - * @param intHandle Pointer to the I3C master driver handle. - */ -void I3C_MasterTransferHandleIRQ(I3C_Type *base, void *intHandle); - -/*! @} */ - -/*! @} */ - -/*! - * @addtogroup i3c_slave_driver - * @{ - */ - -/*! @name Initialization and deinitialization */ -/*! @{ */ - -/*! - * @brief Provides a default configuration for the I3C slave peripheral. - * - * This function provides the following default configuration for the I3C slave peripheral: - * @code - * slaveConfig->enableslave = true; - * @endcode - * - * After calling this function, you can override any settings in order to customize the configuration, - * prior to initializing the slave driver with I3C_SlaveInit(). - * - * @param[out] slaveConfig User provided configuration structure for default values. Refer to #i3c_slave_config_t. - */ -void I3C_SlaveGetDefaultConfig(i3c_slave_config_t *slaveConfig); - -/*! - * @brief Initializes the I3C slave peripheral. - * - * This function enables the peripheral clock and initializes the I3C slave peripheral as described by the user - * provided configuration. - * - * @param base The I3C peripheral base address. - * @param slaveConfig User provided peripheral configuration. Use I3C_SlaveGetDefaultConfig() to get a set of - * defaults that you can override. - * @param slowClock_Hz Frequency in Hertz of the I3C slow clock. Used to calculate the bus match condition values. - * If FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH defines as 1, this parameter is useless. - */ -void I3C_SlaveInit(I3C_Type *base, const i3c_slave_config_t *slaveConfig, uint32_t slowClock_Hz); - -/*! - * @brief Deinitializes the I3C slave peripheral. - * - * This function disables the I3C slave peripheral and gates the clock. - * - * @param base The I3C peripheral base address. - */ -void I3C_SlaveDeinit(I3C_Type *base); - -/*! - * @brief Enable/Disable Slave. - * - * @param base The I3C peripheral base address. - * @param isEnable Enable or disable. - */ -static inline void I3C_SlaveEnable(I3C_Type *base, bool isEnable) -{ - base->SCONFIG = (base->SCONFIG & ~I3C_SCONFIG_SLVENA_MASK) | I3C_SCONFIG_SLVENA(isEnable); -} - -/*! @} */ - -/*! @name Status */ -/*! @{ */ - -/*! - * @brief Gets the I3C slave status flags. - * - * A bit mask with the state of all I3C slave status flags is returned. For each flag, the corresponding bit - * in the return value is set if the flag is asserted. - * - * @param base The I3C peripheral base address. - * @return State of the status flags: - * - 1: related status flag is set. - * - 0: related status flag is not set. - * @see _i3c_slave_flags - */ -static inline uint32_t I3C_SlaveGetStatusFlags(I3C_Type *base) -{ - return base->SSTATUS & ~(I3C_SSTATUS_EVDET_MASK | I3C_SSTATUS_ACTSTATE_MASK | I3C_SSTATUS_TIMECTRL_MASK); -} - -/*! - * @brief Clears the I3C slave status flag state. - * - * The following status register flags can be cleared: - * - #kI3C_SlaveBusStartFlag - * - #kI3C_SlaveMatchedFlag - * - #kI3C_SlaveBusStopFlag - * - * Attempts to clear other flags has no effect. - * - * @param base The I3C peripheral base address. - * @param statusMask A bitmask of status flags that are to be cleared. The mask is composed of - * #_i3c_slave_flags enumerators OR'd together. You may pass the result of a previous call to - * I3C_SlaveGetStatusFlags(). - * @see _i3c_slave_flags. - */ -static inline void I3C_SlaveClearStatusFlags(I3C_Type *base, uint32_t statusMask) -{ - base->SSTATUS = statusMask; -} - -/*! - * @brief Gets the I3C slave error status flags. - * - * A bit mask with the state of all I3C slave error status flags is returned. For each flag, the corresponding bit - * in the return value is set if the flag is asserted. - * - * @param base The I3C peripheral base address. - * @return State of the error status flags: - * - 1: related status flag is set. - * - 0: related status flag is not set. - * @see _i3c_slave_error_flags - */ -static inline uint32_t I3C_SlaveGetErrorStatusFlags(I3C_Type *base) -{ - return base->SERRWARN; -} - -/*! - * @brief Clears the I3C slave error status flag state. - * - * @param base The I3C peripheral base address. - * @param statusMask A bitmask of error status flags that are to be cleared. The mask is composed of - * #_i3c_slave_error_flags enumerators OR'd together. You may pass the result of a previous call to - * I3C_SlaveGetErrorStatusFlags(). - * @see _i3c_slave_error_flags. - */ -static inline void I3C_SlaveClearErrorStatusFlags(I3C_Type *base, uint32_t statusMask) -{ - base->SERRWARN = statusMask; -} - -/*! - * @brief Gets the I3C slave state. - * - * @param base The I3C peripheral base address. - * @return I3C slave activity state, refer #i3c_slave_activity_state_t. - */ -i3c_slave_activity_state_t I3C_SlaveGetActivityState(I3C_Type *base); - -/* Not static so it can be used from fsl_i3c_dma.c. */ -status_t I3C_SlaveCheckAndClearError(I3C_Type *base, uint32_t status); -/*! @} */ - -/*! @name Interrupts */ -/*! @{ */ - -/*! - * @brief Enables the I3C slave interrupt requests. - * - * Only below flags can be enabled as interrupts. - * - #kI3C_SlaveBusStartFlag - * - #kI3C_SlaveMatchedFlag - * - #kI3C_SlaveBusStopFlag - * - #kI3C_SlaveRxReadyFlag - * - #kI3C_SlaveTxReadyFlag - * - #kI3C_SlaveDynamicAddrChangedFlag - * - #kI3C_SlaveReceivedCCCFlag - * - #kI3C_SlaveErrorFlag - * - #kI3C_SlaveHDRCommandMatchFlag - * - #kI3C_SlaveCCCHandledFlag - * - #kI3C_SlaveEventSentFlag - * - * @param base The I3C peripheral base address. - * @param interruptMask Bit mask of interrupts to enable. See #_i3c_slave_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void I3C_SlaveEnableInterrupts(I3C_Type *base, uint32_t interruptMask) -{ - base->SINTSET |= interruptMask; -} - -/*! - * @brief Disables the I3C slave interrupt requests. - * - * Only below flags can be disabled as interrupts. - * - #kI3C_SlaveBusStartFlag - * - #kI3C_SlaveMatchedFlag - * - #kI3C_SlaveBusStopFlag - * - #kI3C_SlaveRxReadyFlag - * - #kI3C_SlaveTxReadyFlag - * - #kI3C_SlaveDynamicAddrChangedFlag - * - #kI3C_SlaveReceivedCCCFlag - * - #kI3C_SlaveErrorFlag - * - #kI3C_SlaveHDRCommandMatchFlag - * - #kI3C_SlaveCCCHandledFlag - * - #kI3C_SlaveEventSentFlag - * - * @param base The I3C peripheral base address. - * @param interruptMask Bit mask of interrupts to disable. See #_i3c_slave_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void I3C_SlaveDisableInterrupts(I3C_Type *base, uint32_t interruptMask) -{ - base->SINTCLR = interruptMask; -} - -/*! - * @brief Returns the set of currently enabled I3C slave interrupt requests. - * - * @param base The I3C peripheral base address. - * @return A bitmask composed of #_i3c_slave_flags enumerators OR'd together to indicate the - * set of enabled interrupts. - */ -static inline uint32_t I3C_SlaveGetEnabledInterrupts(I3C_Type *base) -{ - return base->SINTSET; -} - -/*! - * @brief Returns the set of pending I3C slave interrupt requests. - * - * @param base The I3C peripheral base address. - * @return A bitmask composed of #_i3c_slave_flags enumerators OR'd together to indicate the - * set of pending interrupts. - */ -static inline uint32_t I3C_SlaveGetPendingInterrupts(I3C_Type *base) -{ - return base->SINTMASKED; -} - -/*! @} */ - -/*! @name DMA control */ -/*! @{ */ - -/*! - * @brief Enables or disables I3C slave DMA requests. - * - * @param base The I3C peripheral base address. - * @param enableTx Enable flag for transmit DMA request. Pass true for enable, false for disable. - * @param enableRx Enable flag for receive DMA request. Pass true for enable, false for disable. - * @param width DMA read/write unit in bytes. - */ -static inline void I3C_SlaveEnableDMA(I3C_Type *base, bool enableTx, bool enableRx, uint32_t width) -{ - assert(width <= 2U); - base->SDMACTRL = - I3C_SDMACTRL_DMAFB(enableRx ? 2U : 0U) | I3C_SDMACTRL_DMATB(enableTx ? 2U : 0U) | I3C_SDMACTRL_DMAWIDTH(width); -} - -/*! - * @brief Gets I3C slave transmit data register address for DMA transfer. - * - * @param base The I3C peripheral base address. - * @param width DMA read/write unit in bytes. - * @return The I3C Slave Transmit Data Register address. - */ -static inline uint32_t I3C_SlaveGetTxFifoAddress(I3C_Type *base, uint32_t width) -{ - assert(width <= 2U); - return (uint32_t)((width == 2U) ? &base->SWDATAH : &base->SWDATAB); -} - -/*! - * @brief Gets I3C slave receive data register address for DMA transfer. - * - * @param base The I3C peripheral base address. - * @param width DMA read/write unit in bytes. - * @return The I3C Slave Receive Data Register address. - */ -static inline uint32_t I3C_SlaveGetRxFifoAddress(I3C_Type *base, uint32_t width) -{ - assert(width <= 2U); - return (uint32_t)((width == 2U) ? &base->SRDATAH : &base->SRDATAB); -} - -/*! @} */ - -/*! @name FIFO control */ -/*! @{ */ - -/*! - * @brief Sets the watermarks for I3C slave FIFOs. - * - * @param base The I3C peripheral base address. - * @param txLvl Transmit FIFO watermark level. The #kI3C_SlaveTxReadyFlag flag is set whenever - * the number of words in the transmit FIFO reaches @a txLvl. - * @param rxLvl Receive FIFO watermark level. The #kI3C_SlaveRxReadyFlag flag is set whenever - * the number of words in the receive FIFO reaches @a rxLvl. - * @param flushTx true if TX FIFO is to be cleared, otherwise TX FIFO remains unchanged. - * @param flushRx true if RX FIFO is to be cleared, otherwise RX FIFO remains unchanged. - */ -static inline void I3C_SlaveSetWatermarks( - I3C_Type *base, i3c_tx_trigger_level_t txLvl, i3c_rx_trigger_level_t rxLvl, bool flushTx, bool flushRx) -{ - base->SDATACTRL = I3C_SDATACTRL_UNLOCK_MASK | I3C_SDATACTRL_TXTRIG(txLvl) | I3C_SDATACTRL_RXTRIG(rxLvl) | - (flushTx ? I3C_SDATACTRL_FLUSHTB_MASK : 0U) | (flushRx ? I3C_SDATACTRL_FLUSHFB_MASK : 0U); -} - -/*! - * @brief Gets the current number of bytes in the I3C slave FIFOs. - * - * @param base The I3C peripheral base address. - * @param[out] txCount Pointer through which the current number of bytes in the transmit FIFO is returned. - * Pass NULL if this value is not required. - * @param[out] rxCount Pointer through which the current number of bytes in the receive FIFO is returned. - * Pass NULL if this value is not required. - */ -static inline void I3C_SlaveGetFifoCounts(I3C_Type *base, size_t *rxCount, size_t *txCount) -{ - if (NULL != txCount) - { - *txCount = (base->SDATACTRL & I3C_SDATACTRL_TXCOUNT_MASK) >> I3C_SDATACTRL_TXCOUNT_SHIFT; - } - if (NULL != rxCount) - { - *rxCount = (base->SDATACTRL & I3C_SDATACTRL_RXCOUNT_MASK) >> I3C_SDATACTRL_RXCOUNT_SHIFT; - } -} - -/*! @} */ - -/*! @name Bus operations */ -/*! @{ */ - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) && FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) -/*! - * @brief I3C slave request event. - * - * @param base The I3C peripheral base address. - * @param event I3C slave event of type #i3c_slave_event_t - */ -void I3C_SlaveRequestEvent(I3C_Type *base, i3c_slave_event_t event); -#endif - -/*! - * @brief Performs a polling send transfer on the I3C bus. - * - * @param base The I3C peripheral base address. - * @param txBuff The pointer to the data to be transferred. - * @param txSize The length in bytes of the data to be transferred. - * @return Error or success status returned by API. - */ -status_t I3C_SlaveSend(I3C_Type *base, const void *txBuff, size_t txSize); - -/*! - * @brief Performs a polling receive transfer on the I3C bus. - * - * @param base The I3C peripheral base address. - * @param rxBuff The pointer to the data to be transferred. - * @param rxSize The length in bytes of the data to be transferred. - * @return Error or success status returned by API. - */ -status_t I3C_SlaveReceive(I3C_Type *base, void *rxBuff, size_t rxSize); - -/*! @} */ - -/*! @name Slave non-blocking */ -/*! @{ */ - -/*! - * @brief Creates a new handle for the I3C slave non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the I3C_SlaveTransferAbort() API shall be called. - * - * @note The function also enables the NVIC IRQ for the input I3C. Need to notice - * that on some SoCs the I3C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - - * @param base The I3C peripheral base address. - * @param[out] handle Pointer to the I3C slave driver handle. - * @param callback User provided pointer to the asynchronous callback function. - * @param userData User provided pointer to the application callback data. - */ -void I3C_SlaveTransferCreateHandle(I3C_Type *base, - i3c_slave_handle_t *handle, - i3c_slave_transfer_callback_t callback, - void *userData); - -/*! - * @brief Starts accepting slave transfers. - * - * Call this API after calling I2C_SlaveInit() and I3C_SlaveTransferCreateHandle() to start processing - * transactions driven by an I2C master. The slave monitors the I2C bus and pass events to the - * callback that was passed into the call to I3C_SlaveTransferCreateHandle(). The callback is always invoked - * from the interrupt context. - * - * The set of events received by the callback is customizable. To do so, set the @a eventMask parameter to - * the OR'd combination of #i3c_slave_transfer_event_t enumerators for the events you wish to receive. - * The #kI3C_SlaveTransmitEvent and #kI3C_SlaveReceiveEvent events are always enabled and do not need - * to be included in the mask. Alternatively, you can pass 0 to get a default set of only the transmit and - * receive events that are always enabled. In addition, the #kI3C_SlaveAllEvents constant is provided as - * a convenient way to enable all events. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to struct: _i3c_slave_handle structure which stores the transfer state. - * @param eventMask Bit mask formed by OR'ing together #i3c_slave_transfer_event_t enumerators to specify - * which events to send to the callback. Other accepted values are 0 to get a default set of - * only the transmit and receive events, and #kI3C_SlaveAllEvents to enable all events. - * - * @retval #kStatus_Success Slave transfers were successfully started. - * @retval #kStatus_I3C_Busy Slave transfers have already been started on this handle. - */ -status_t I3C_SlaveTransferNonBlocking(I3C_Type *base, i3c_slave_handle_t *handle, uint32_t eventMask); - -/*! - * @brief Gets the slave transfer status during a non-blocking transfer. - * @param base The I3C peripheral base address. - * @param handle Pointer to i2c_slave_handle_t structure. - * @param[out] count Pointer to a value to hold the number of bytes transferred. May be NULL if the count is not - * required. - * @retval #kStatus_Success - * @retval #kStatus_NoTransferInProgress - */ -status_t I3C_SlaveTransferGetCount(I3C_Type *base, i3c_slave_handle_t *handle, size_t *count); - -/*! - * @brief Aborts the slave non-blocking transfers. - * @note This API could be called at any time to stop slave for handling the bus events. - * @param base The I3C peripheral base address. - * @param handle Pointer to struct: _i3c_slave_handle structure which stores the transfer state. - * @retval #kStatus_Success - * @retval #kStatus_I3C_Idle - */ -void I3C_SlaveTransferAbort(I3C_Type *base, i3c_slave_handle_t *handle); - -/*! @} */ - -/*! @name Slave IRQ handler */ -/*! @{ */ - -/*! - * @brief Reusable routine to handle slave interrupts. - * @note This function does not need to be called unless you are reimplementing the - * non blocking API's interrupt handler routines to add special functionality. - * @param base The I3C peripheral base address. - * @param intHandle Pointer to struct: _i3c_slave_handle structure which stores the transfer state. - */ -void I3C_SlaveTransferHandleIRQ(I3C_Type *base, void *intHandle); - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) && FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) -/*! - * @brief I3C slave request IBI event with data payload(mandatory and extended). - * - * @param base The I3C peripheral base address. - * @param data Pointer to IBI data to be sent in the request. - * @param dataSize IBI data size. - */ -void I3C_SlaveRequestIBIWithData(I3C_Type *base, uint8_t *data, size_t dataSize); - -/*! - * @brief I3C slave request IBI event with single data. - * @deprecated Do not use this function. It has been superseded by @ref I3C_SlaveRequestIBIWithData. - * - * @param base The I3C peripheral base address. - * @param data IBI data to be sent in the request. - * @param dataSize IBI data size. - */ -void I3C_SlaveRequestIBIWithSingleData(I3C_Type *base, uint8_t data, size_t dataSize); -#endif /* !(defined(FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) && FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) */ - -/*! @} */ -/*! @} */ -#if defined(__cplusplus) -} -#endif - -#endif /* FSL_I3C_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_i3c_edma.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_i3c_edma.c deleted file mode 100644 index 7ff5e8a6d04..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_i3c_edma.c +++ /dev/null @@ -1,1057 +0,0 @@ -/* - * Copyright 2022-2023 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_i3c_edma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.i3c_edma" -#endif - -/*! @brief States for the state machine used by transactional APIs. */ -enum _i3c_edma_transfer_states -{ - kIdleState = 0, - kIBIWonState, - kSlaveStartState, - kSendCommandState, - kWaitRepeatedStartCompleteState, - kTransmitDataState, - kReceiveDataState, - kStopState, - kWaitForCompletionState, - kAddressMatchState, -}; - -/*! @brief Common sets of flags used by the driver. */ -enum _i3c_edma_flag_constants -{ - /*! All flags which are cleared by the driver upon starting a transfer. */ - kMasterClearFlags = kI3C_MasterSlaveStartFlag | kI3C_MasterControlDoneFlag | kI3C_MasterCompleteFlag | - kI3C_MasterArbitrationWonFlag | kI3C_MasterSlave2MasterFlag | kI3C_MasterErrorFlag, - - /*! IRQ sources enabled by the non-blocking transactional API. */ - kMasterDMAIrqFlags = kI3C_MasterSlaveStartFlag | kI3C_MasterControlDoneFlag | kI3C_MasterCompleteFlag | - kI3C_MasterArbitrationWonFlag | kI3C_MasterErrorFlag | kI3C_MasterSlave2MasterFlag, - - /*! Errors to check for. */ - kMasterErrorFlags = kI3C_MasterErrorNackFlag | kI3C_MasterErrorWriteAbortFlag | -#if !defined(FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) || (!FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) - kI3C_MasterErrorTermFlag | -#endif - kI3C_MasterErrorParityFlag | kI3C_MasterErrorCrcFlag | kI3C_MasterErrorReadFlag | - kI3C_MasterErrorWriteFlag | kI3C_MasterErrorMsgFlag | kI3C_MasterErrorInvalidReqFlag | - kI3C_MasterErrorTimeoutFlag, - /*! All flags which are cleared by the driver upon starting a transfer. */ - kSlaveClearFlags = kI3C_SlaveBusStartFlag | kI3C_SlaveMatchedFlag | kI3C_SlaveBusStopFlag, - - /*! IRQ sources enabled by the non-blocking transactional API. */ - kSlaveDMAIrqFlags = kI3C_SlaveBusStartFlag | kI3C_SlaveMatchedFlag | - kI3C_SlaveBusStopFlag | /*kI3C_SlaveRxReadyFlag |*/ - kI3C_SlaveDynamicAddrChangedFlag | kI3C_SlaveReceivedCCCFlag | kI3C_SlaveErrorFlag | - kI3C_SlaveHDRCommandMatchFlag | kI3C_SlaveCCCHandledFlag | kI3C_SlaveEventSentFlag, - - /*! Errors to check for. */ - kSlaveErrorFlags = kI3C_SlaveErrorOverrunFlag | kI3C_SlaveErrorUnderrunFlag | kI3C_SlaveErrorUnderrunNakFlag | - kI3C_SlaveErrorTermFlag | kI3C_SlaveErrorInvalidStartFlag | kI3C_SlaveErrorSdrParityFlag | - kI3C_SlaveErrorHdrParityFlag | kI3C_SlaveErrorHdrCRCFlag | kI3C_SlaveErrorS0S1Flag | - kI3C_SlaveErrorOverreadFlag | kI3C_SlaveErrorOverwriteFlag, -}; -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Array to map I3C instance number to base pointer. */ -static I3C_Type *const kI3cBases[] = I3C_BASE_PTRS; - -/*! @brief Array to store the END byte of I3C teransfer. */ -static uint8_t i3cEndByte[ARRAY_SIZE(kI3cBases)] = {0}; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -static void I3C_MasterRunEDMATransfer( - I3C_Type *base, i3c_master_edma_handle_t *handle, void *data, size_t dataSize, i3c_direction_t direction); - -/******************************************************************************* - * Code - ******************************************************************************/ -static void I3C_MasterTransferEDMACallbackRx(edma_handle_t *dmaHandle, void *param, bool transferDone, uint32_t tcds) -{ - i3c_master_edma_handle_t *i3cHandle = (i3c_master_edma_handle_t *)param; - - if (transferDone) - { - /* Terminate following data if present. */ - i3cHandle->base->MCTRL |= I3C_MCTRL_RDTERM(1U); - -#if defined(FSL_FEATURE_I3C_HAS_ERRATA_052086) && (FSL_FEATURE_I3C_HAS_ERRATA_052086) - if (i3cHandle->transfer.dataSize > 1U) - { - size_t rxCount; - /* Read out the last byte data. */ - do - { - I3C_MasterGetFifoCounts(i3cHandle->base, &rxCount, NULL); - } while (rxCount == 0U); - *(uint8_t *)((uint32_t)(uint32_t *)i3cHandle->transfer.data + i3cHandle->transfer.dataSize - 1U) = - (uint8_t)i3cHandle->base->MRDATAB; - } -#endif - - /* Disable I3C Rx DMA. */ - i3cHandle->base->MDATACTRL &= ~I3C_MDMACTRL_DMAFB_MASK; - } -} - -static void I3C_MasterTransferEDMACallbackTx(edma_handle_t *dmaHandle, void *param, bool transferDone, uint32_t tcds) -{ - i3c_master_edma_handle_t *i3cHandle = (i3c_master_edma_handle_t *)param; - uint32_t instance; - - if (transferDone) - { - /* Disable I3C Tx DMA. */ - i3cHandle->base->MDATACTRL &= ~I3C_MDMACTRL_DMATB_MASK; - - if (i3cHandle->transferCount != 1U) - { - instance = I3C_GetInstance(i3cHandle->base); - /* Ensure there's space in the Tx FIFO. */ - while ((i3cHandle->base->MDATACTRL & I3C_MDATACTRL_TXFULL_MASK) != 0U) - { - } - i3cHandle->base->MWDATABE = i3cEndByte[instance]; - } - } -} -/*! - * brief Prepares the transfer state machine and fills in the command buffer. - * param handle Master nonblocking driver handle. - */ -static status_t I3C_MasterInitTransferStateMachineEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle) -{ - i3c_master_transfer_t *xfer = &handle->transfer; - status_t result = kStatus_Success; - i3c_direction_t direction = xfer->direction; - - /* Calculate command count and put into command buffer. */ - handle->subaddressCount = 0U; - if (xfer->subaddressSize != 0U) - { - for (uint32_t i = xfer->subaddressSize; i > 0U; i--) - { - handle->subaddressBuffer[handle->subaddressCount++] = (uint8_t)((xfer->subaddress) >> (8U * (i - 1U))); - } - } - - /* Start condition shall be ommited, switch directly to next phase */ - if (xfer->dataSize == 0U) - { - handle->state = (uint8_t)kStopState; - } - - if (0UL != (xfer->flags & (uint32_t)kI3C_TransferStartWithBroadcastAddr)) - { - if (0UL != (xfer->flags & (uint32_t)kI3C_TransferNoStartFlag)) - { - return kStatus_InvalidArgument; - } - - if (0UL != (xfer->flags & (uint32_t)kI3C_TransferRepeatedStartFlag)) - { - return kStatus_InvalidArgument; - } - - /* Issue 0x7E as start. */ - result = I3C_MasterStart(base, xfer->busType, 0x7E, kI3C_Write); - if (result != kStatus_Success) - { - return result; - } - - result = I3C_MasterWaitForCtrlDone(base, false); - if (result != kStatus_Success) - { - return result; - } - } - - /* Handle no start option. */ - if (0U != (xfer->flags & (uint32_t)kI3C_TransferNoStartFlag)) - { - /* No need to send start flag, directly go to send command or data */ - if (xfer->subaddressSize > 0UL) - { - handle->state = (uint8_t)kSendCommandState; - } - else - { - if (direction == kI3C_Write) - { - /* Next state, send data. */ - handle->state = (uint8_t)kTransmitDataState; - } - else - { - /* Only support write with no stop signal. */ - return kStatus_InvalidArgument; - } - } - } - else - { - if (xfer->subaddressSize != 0U) - { - handle->state = (uint8_t)kSendCommandState; - } - else - { - if (handle->transfer.direction == kI3C_Write) - { - handle->state = (uint8_t)kTransmitDataState; - } - else if (handle->transfer.direction == kI3C_Read) - { - handle->state = (uint8_t)kReceiveDataState; - } - else - { - return kStatus_InvalidArgument; - } - } - - if (handle->transfer.direction == kI3C_Read) - { - I3C_MasterRunEDMATransfer(base, handle, xfer->data, xfer->dataSize, kI3C_Read); - } - - if (handle->state != (uint8_t)kStopState) - { - /* If repeated start is requested, send repeated start. */ - if (0U != (xfer->flags & (uint32_t)kI3C_TransferRepeatedStartFlag)) - { - result = I3C_MasterRepeatedStart(base, xfer->busType, xfer->slaveAddress, direction); - } - else /* For normal transfer, send start. */ - { - result = I3C_MasterStart(base, xfer->busType, xfer->slaveAddress, direction); - } - } - } - - I3C_MasterTransferEDMAHandleIRQ(base, handle); - return result; -} - -static void I3C_MasterRunEDMATransfer( - I3C_Type *base, i3c_master_edma_handle_t *handle, void *data, size_t dataSize, i3c_direction_t direction) -{ - bool isEnableTxDMA = false; - bool isEnableRxDMA = false; - edma_transfer_config_t xferConfig; - uint32_t instance; - uint32_t address; - uint32_t width; - - handle->transferCount = dataSize; - - switch (direction) - { - case kI3C_Write: - if (dataSize != 1U) - { - address = (uint32_t)&base->MWDATAB1; - /* Cause controller sends command and data with same interface, need special buffer to store the END byte. */ - instance = I3C_GetInstance(base); - i3cEndByte[instance] = *(uint8_t *)((uint32_t)(uint32_t *)data + dataSize - 1U); - dataSize--; - } - else - { - address = (uint32_t)&base->MWDATABE; - } - EDMA_PrepareTransfer(&xferConfig, data, sizeof(uint8_t), (uint32_t *)address, sizeof(uint8_t), 1, dataSize, - kEDMA_MemoryToPeripheral); - (void)EDMA_SubmitTransfer(handle->txDmaHandle, &xferConfig); - EDMA_StartTransfer(handle->txDmaHandle); - isEnableTxDMA = true; - width = 1U; - break; - - case kI3C_Read: -#if defined(FSL_FEATURE_I3C_HAS_ERRATA_052086) && (FSL_FEATURE_I3C_HAS_ERRATA_052086) - /* ERRATA052086: Soc integration issue results in target misses the last DMA request to copy the - last one byte from controler when transmission data size is > 1 byte. Resolution: Triggering DMA - interrupt one byte in advance, then receive the last one byte data after DMA transmission finishes. */ - if (dataSize > 1U) - { - dataSize--; - } -#endif - address = (uint32_t)&base->MRDATAB; - EDMA_PrepareTransfer(&xferConfig, (uint32_t *)address, sizeof(uint8_t), data, sizeof(uint8_t), 1, dataSize, - kEDMA_PeripheralToMemory); - (void)EDMA_SubmitTransfer(handle->rxDmaHandle, &xferConfig); - EDMA_StartTransfer(handle->rxDmaHandle); - isEnableRxDMA = true; - width = 1U; - break; - - default: - /* This should never happen */ - assert(false); - break; - } - - I3C_MasterEnableDMA(base, isEnableTxDMA, isEnableRxDMA, width); -} - -static status_t I3C_MasterRunTransferStateMachineEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle, bool *isDone) -{ - uint32_t status; - uint32_t errStatus; - status_t result = kStatus_Success; - i3c_master_transfer_t *xfer; - size_t rxCount = 0; - bool state_complete = false; - - /* Set default isDone return value. */ - *isDone = false; - - /* Check for errors. */ - status = (uint32_t)I3C_MasterGetPendingInterrupts(base); - I3C_MasterClearStatusFlags(base, status); - - i3c_master_state_t masterState = I3C_MasterGetState(base); - errStatus = I3C_MasterGetErrorStatusFlags(base); - result = I3C_MasterCheckAndClearError(base, errStatus); - if (kStatus_Success != result) - { - return result; - } - - if (0UL != (status & (uint32_t)kI3C_MasterSlave2MasterFlag)) - { - if (handle->callback.slave2Master != NULL) - { - handle->callback.slave2Master(base, handle->userData); - } - } - - if ((0UL != (status & (uint32_t)kI3C_MasterSlaveStartFlag)) && (handle->transfer.busType != kI3C_TypeI2C)) - { - handle->state = (uint8_t)kSlaveStartState; - } - - if ((masterState == kI3C_MasterStateIbiRcv) || (masterState == kI3C_MasterStateIbiAck)) - { - handle->state = (uint8_t)kIBIWonState; - } - - if (handle->state == (uint8_t)kIdleState) - { - return result; - } - - if (handle->state == (uint8_t)kIBIWonState) - { - /* Get fifo counts and compute room in tx fifo. */ - rxCount = (base->MDATACTRL & I3C_MDATACTRL_RXCOUNT_MASK) >> I3C_MDATACTRL_RXCOUNT_SHIFT; - } - - /* Get pointer to private data. */ - xfer = &handle->transfer; - - while (!state_complete) - { - /* Execute the state. */ - switch (handle->state) - { - case (uint8_t)kSlaveStartState: - /* Emit start + 0x7E */ - I3C_MasterEmitRequest(base, kI3C_RequestAutoIbi); - handle->state = (uint8_t)kIBIWonState; - state_complete = true; - break; - - case (uint8_t)kIBIWonState: - if (masterState == kI3C_MasterStateIbiAck) - { - handle->ibiType = I3C_GetIBIType(base); - if (handle->callback.ibiCallback != NULL) - { - handle->callback.ibiCallback(base, handle, handle->ibiType, kI3C_IbiAckNackPending); - } - else - { - I3C_MasterEmitIBIResponse(base, kI3C_IbiRespNack); - } - } - - /* Make sure there is data in the rx fifo. */ - if (0UL != rxCount) - { - if ((handle->ibiBuff == NULL) && (handle->callback.ibiCallback != NULL)) - { - handle->callback.ibiCallback(base, handle, kI3C_IbiNormal, kI3C_IbiDataBuffNeed); - } - uint8_t tempData = (uint8_t)base->MRDATAB; - if (handle->ibiBuff != NULL) - { - handle->ibiBuff[handle->ibiPayloadSize++] = tempData; - } - rxCount--; - break; - } - else if (0UL != (status & (uint32_t)kI3C_MasterCompleteFlag)) - { - handle->ibiType = I3C_GetIBIType(base); - handle->ibiAddress = I3C_GetIBIAddress(base); - state_complete = true; - result = kStatus_I3C_IBIWon; - } - else - { - state_complete = true; - } - break; - - case (uint8_t)kSendCommandState: - I3C_MasterRunEDMATransfer(base, handle, handle->subaddressBuffer, handle->subaddressCount, kI3C_Write); - - if ((xfer->direction == kI3C_Read) || (0UL == xfer->dataSize)) - { - if (0UL == xfer->dataSize) - { - handle->state = (uint8_t)kWaitForCompletionState; - } - else - { - /* xfer->dataSize != 0U, xfer->direction = kI3C_Read */ - handle->state = (uint8_t)kWaitRepeatedStartCompleteState; - } - } - else - { - /* Next state, transfer data. */ - handle->state = (uint8_t)kTransmitDataState; - } - - state_complete = true; - break; - - case (uint8_t)kWaitRepeatedStartCompleteState: - /* We stay in this state until the maste complete. */ - if (0UL != (status & (uint32_t)kI3C_MasterCompleteFlag)) - { - handle->state = (uint8_t)kReceiveDataState; - /* Send repeated start and slave address. */ - result = I3C_MasterRepeatedStart(base, xfer->busType, xfer->slaveAddress, kI3C_Read); - } - - state_complete = true; - break; - - case (uint8_t)kTransmitDataState: - I3C_MasterRunEDMATransfer(base, handle, xfer->data, xfer->dataSize, kI3C_Write); - handle->state = (uint8_t)kWaitForCompletionState; - - state_complete = true; - break; - - case (uint8_t)kReceiveDataState: - /* Do DMA read. */ - handle->state = (uint8_t)kWaitForCompletionState; - - state_complete = true; - break; - - case (uint8_t)kWaitForCompletionState: - /* We stay in this state until the maste complete. */ - if (0UL != (status & (uint32_t)kI3C_MasterCompleteFlag)) - { - handle->state = (uint8_t)kStopState; - } - else - { - state_complete = true; - } - break; - - case (uint8_t)kStopState: - /* Only issue a stop transition if the caller requested it. */ - if (0UL == (xfer->flags & (uint32_t)kI3C_TransferNoStopFlag)) - { - if (xfer->busType == kI3C_TypeI3CDdr) - { - I3C_MasterEmitRequest(base, kI3C_RequestForceExit); - } - else - { - I3C_MasterEmitRequest(base, kI3C_RequestEmitStop); - result = I3C_MasterWaitForCtrlDone(base, false); - } - } - *isDone = true; - state_complete = true; - break; - - default: - assert(false); - break; - } - } - return result; -} - -void I3C_MasterTransferCreateHandleEDMA(I3C_Type *base, - i3c_master_edma_handle_t *handle, - const i3c_master_edma_callback_t *callback, - void *userData, - edma_handle_t *rxDmaHandle, - edma_handle_t *txDmaHandle) -{ - uint32_t instance; - - assert(NULL != handle); - - /* Clear out the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Look up instance number */ - instance = I3C_GetInstance(base); - - handle->base = base; - handle->txDmaHandle = txDmaHandle; - handle->rxDmaHandle = rxDmaHandle; - handle->callback = *callback; - handle->userData = userData; - - /* Save this handle for IRQ use. */ - s_i3cMasterHandle[instance] = handle; - - /* Set irq handler. */ - s_i3cMasterIsr = I3C_MasterTransferEDMAHandleIRQ; - - EDMA_SetCallback(handle->rxDmaHandle, I3C_MasterTransferEDMACallbackRx, handle); - EDMA_SetCallback(handle->txDmaHandle, I3C_MasterTransferEDMACallbackTx, handle); - - /* Clear all flags. */ - I3C_MasterClearErrorStatusFlags(base, (uint32_t)kMasterErrorFlags); - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - /* Reset fifos. These flags clear automatically. */ - base->MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - - /* Enable NVIC IRQ, this only enables the IRQ directly connected to the NVIC. - In some cases the I3C IRQ is configured through INTMUX, user needs to enable - INTMUX IRQ in application code. */ - (void)EnableIRQ(kI3cIrqs[instance]); - - /* Clear internal IRQ enables and enable NVIC IRQ. */ - I3C_MasterEnableInterrupts(base, (uint32_t)kMasterDMAIrqFlags); -} - -/*! - * brief Performs a non-blocking DMA transaction on the I2C/I3C bus. - * - * param base The I3C peripheral base address. - * param handle Pointer to the I3C master driver handle. - * param transfer The pointer to the transfer descriptor. - * retval #kStatus_Success The transaction was started successfully. - * retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - */ -status_t I3C_MasterTransferEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle, i3c_master_transfer_t *transfer) -{ - assert(NULL != handle); - assert(NULL != transfer); - assert(transfer->subaddressSize <= sizeof(transfer->subaddress)); - i3c_master_state_t masterState = I3C_MasterGetState(base); - bool checkDdrState = false; - - /* Return busy if another transaction is in progress. */ - if (handle->state != (uint8_t)kIdleState) - { - return kStatus_I3C_Busy; - } - - /* Return an error if the bus is already in use not by us. */ - checkDdrState = (transfer->busType == kI3C_TypeI3CDdr) ? (masterState != kI3C_MasterStateDdr) : true; - if ((masterState != kI3C_MasterStateIdle) && (masterState != kI3C_MasterStateNormAct) && checkDdrState) - { - return kStatus_I3C_Busy; - } - - /* Disable I3C IRQ sources while we configure stuff. */ - I3C_MasterDisableInterrupts( - base, ((uint32_t)kMasterDMAIrqFlags | (uint32_t)kI3C_MasterRxReadyFlag | (uint32_t)kI3C_MasterTxReadyFlag)); - - /* Save transfer into handle. */ - handle->transfer = *transfer; - - /* Configure IBI response type. */ - base->MCTRL &= ~I3C_MCTRL_IBIRESP_MASK; - base->MCTRL |= I3C_MCTRL_IBIRESP(transfer->ibiResponse); - - /* Clear all flags. */ - I3C_MasterClearErrorStatusFlags(base, (uint32_t)kMasterErrorFlags); - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - /* Reset fifos. These flags clear automatically. */ - base->MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - - /* Generate commands to send. */ - (void)I3C_MasterInitTransferStateMachineEDMA(base, handle); - - /* Enable I3C internal IRQ sources. NVIC IRQ was enabled in CreateHandle() */ - I3C_MasterEnableInterrupts(base, (uint32_t)(kMasterDMAIrqFlags)); - - if (transfer->busType == kI3C_TypeI2C) - { - I3C_MasterDisableInterrupts(base, (uint32_t)kI3C_MasterSlaveStartFlag); - } - - return kStatus_Success; -} - -void I3C_MasterTransferEDMAHandleIRQ(I3C_Type *base, void *i3cHandle) -{ - i3c_master_edma_handle_t *handle = (i3c_master_edma_handle_t *)i3cHandle; - - bool isDone; - status_t result; - - /* Don't do anything if we don't have a valid handle. */ - if (NULL == handle) - { - return; - } - - result = I3C_MasterRunTransferStateMachineEDMA(base, handle, &isDone); - - if (handle->state == (uint8_t)kIdleState) - { - return; - } - - if (isDone || (result != kStatus_Success)) - { - /* XXX need to handle data that may be in rx fifo below watermark level? */ - - /* XXX handle error, terminate xfer */ - if ((result == kStatus_I3C_Nak) || (result == kStatus_I3C_IBIWon)) - { - I3C_MasterEmitRequest(base, kI3C_RequestEmitStop); - (void)I3C_MasterWaitForCtrlDone(base, false); - } - - /* Set handle to idle state. */ - handle->state = (uint8_t)kIdleState; - - /* Invoke IBI user callback. */ - if ((result == kStatus_I3C_IBIWon) && (handle->callback.ibiCallback != NULL)) - { - handle->callback.ibiCallback(base, handle, handle->ibiType, kI3C_IbiReady); - handle->ibiPayloadSize = 0; - } - - /* Invoke callback. */ - if (NULL != handle->callback.transferComplete) - { - handle->callback.transferComplete(base, handle, result, handle->userData); - } - } -} - -/*! - * brief Get master transfer status during a dma non-blocking transfer - * - * param base I3C peripheral base address - * param handle pointer to i2c_master_edma_handle_t structure - * param count Number of bytes transferred so far by the non-blocking transaction. - */ -status_t I3C_MasterTransferGetCountEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (handle->state == (uint8_t)kIdleState) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - /* There is no necessity to disable interrupts as we read a single integer value */ - i3c_direction_t dir = handle->transfer.direction; - - if (dir == kI3C_Read) - { - *count = handle->transferCount - - 1U * EDMA_GetRemainingMajorLoopCount(handle->rxDmaHandle->base, handle->rxDmaHandle->channel); - } - else - { - *count = handle->transferCount - - 1U * EDMA_GetRemainingMajorLoopCount(handle->txDmaHandle->base, handle->txDmaHandle->channel); - } - - return kStatus_Success; -} - -/*! - * brief Abort a master edma non-blocking transfer in a early time - * - * param base I3C peripheral base address - * param handle pointer to i2c_master_edma_handle_t structure - */ -void I3C_MasterTransferAbortEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle) -{ - if (handle->state != (uint8_t)kIdleState) - { - EDMA_AbortTransfer(handle->txDmaHandle); - EDMA_AbortTransfer(handle->rxDmaHandle); - - I3C_MasterEnableDMA(base, false, false, 0); - - /* Reset fifos. These flags clear automatically. */ - base->MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - - /* Send a stop command to finalize the transfer. */ - (void)I3C_MasterStop(base); - - /* Reset handle. */ - handle->state = (uint8_t)kIdleState; - } -} - -static void I3C_SlaveTransferEDMACallback(edma_handle_t *dmaHandle, void *param, bool transferDone, uint32_t tcds) -{ - i3c_slave_edma_handle_t *i3cHandle = (i3c_slave_edma_handle_t *)param; - - if (transferDone) - { - /* Simply disable dma enablement */ - if (i3cHandle->txDmaHandle == dmaHandle) - { - i3cHandle->base->SDMACTRL &= ~I3C_SDMACTRL_DMATB_MASK; - - if (i3cHandle->transfer.txDataSize > 1U) - { - /* Ensure there's space in the Tx FIFO. */ - while ((i3cHandle->base->SDATACTRL & I3C_SDATACTRL_TXFULL_MASK) != 0U) - { - } - /* Send the last byte. */ - i3cHandle->base->SWDATABE = *(uint8_t *)((uintptr_t)i3cHandle->transfer.txData + i3cHandle->transfer.txDataSize - 1U); - } - } - else - { -#if defined(FSL_FEATURE_I3C_HAS_ERRATA_052086) && (FSL_FEATURE_I3C_HAS_ERRATA_052086) - if (i3cHandle->transfer.rxDataSize > 1U) - { - size_t rxCount; - /* Read out the last byte data. */ - do - { - I3C_SlaveGetFifoCounts(i3cHandle->base, &rxCount, NULL); - } while (rxCount == 0U); - *(uint8_t *)((uintptr_t)i3cHandle->transfer.rxData + i3cHandle->transfer.rxDataSize - 1U) = - (uint8_t)i3cHandle->base->SRDATAB; - } -#endif - i3cHandle->base->SDMACTRL &= ~I3C_SDMACTRL_DMAFB_MASK; - } - } -} - -/*! - * brief Create a new handle for the I3C slave DMA APIs. - * - * The creation of a handle is for use with the DMA APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the I3C_SlaveTransferAbortDMA() API shall be called. - * - * For devices where the I3C send and receive DMA requests are OR'd together, the @a txDmaHandle - * parameter is ignored and may be set to NULL. - * - * param base The I3C peripheral base address. - * param handle Pointer to the I3C slave driver handle. - * param callback User provided pointer to the asynchronous callback function. - * param userData User provided pointer to the application callback data. - * param rxDmaHandle Handle for the DMA receive channel. Created by the user prior to calling this function. - * param txDmaHandle Handle for the DMA transmit channel. Created by the user prior to calling this function. - */ -void I3C_SlaveTransferCreateHandleEDMA(I3C_Type *base, - i3c_slave_edma_handle_t *handle, - i3c_slave_edma_callback_t callback, - void *userData, - edma_handle_t *rxDmaHandle, - edma_handle_t *txDmaHandle) -{ - uint32_t instance; - - assert(NULL != handle); - - /* Clear out the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Look up instance number */ - instance = I3C_GetInstance(base); - - handle->base = base; - handle->txDmaHandle = txDmaHandle; - handle->rxDmaHandle = rxDmaHandle; - handle->callback = callback; - handle->userData = userData; - - /* Save this handle for IRQ use. */ - s_i3cSlaveHandle[instance] = handle; - - /* Set irq handler. */ - s_i3cSlaveIsr = I3C_SlaveTransferEDMAHandleIRQ; - - EDMA_SetCallback(handle->rxDmaHandle, I3C_SlaveTransferEDMACallback, handle); - EDMA_SetCallback(handle->txDmaHandle, I3C_SlaveTransferEDMACallback, handle); - - /* Clear internal IRQ enables and enable NVIC IRQ. */ - I3C_SlaveDisableInterrupts(base, (uint32_t)kSlaveDMAIrqFlags); - - /* Enable NVIC IRQ, this only enables the IRQ directly connected to the NVIC. - In some cases the I3C IRQ is configured through INTMUX, user needs to enable - INTMUX IRQ in application code. */ - (void)EnableIRQ(kI3cIrqs[instance]); - - /* Enable IRQ. */ - I3C_SlaveEnableInterrupts(base, (uint32_t)kSlaveDMAIrqFlags); -} - -static void I3C_SlavePrepareTxEDMA(I3C_Type *base, i3c_slave_edma_handle_t *handle) -{ - edma_transfer_config_t txConfig; - uint32_t *txFifoBase; - i3c_slave_edma_transfer_t *xfer = &handle->transfer; - - if (xfer->txDataSize == 1U) - { - txFifoBase = (uint32_t *)(uintptr_t)&base->SWDATABE; - EDMA_PrepareTransfer(&txConfig, xfer->txData, 1, (void *)txFifoBase, 1, 1, xfer->txDataSize, - kEDMA_MemoryToPeripheral); - } - else - { - txFifoBase = (uint32_t *)(uintptr_t)&base->SWDATAB1; - EDMA_PrepareTransfer(&txConfig, xfer->txData, 1, (void *)txFifoBase, 1, 1, xfer->txDataSize - 1U, - kEDMA_MemoryToPeripheral); - } - - (void)EDMA_SubmitTransfer(handle->txDmaHandle, &txConfig); - EDMA_StartTransfer(handle->txDmaHandle); -} - -static void I3C_SlavePrepareRxEDMA(I3C_Type *base, i3c_slave_edma_handle_t *handle) -{ - uint32_t *rxFifoBase = (uint32_t *)(uintptr_t)&base->SRDATAB; - i3c_slave_edma_transfer_t *xfer = &handle->transfer; - size_t dataSize = xfer->rxDataSize; - edma_transfer_config_t rxConfig; - -#if defined(FSL_FEATURE_I3C_HAS_ERRATA_052086) && (FSL_FEATURE_I3C_HAS_ERRATA_052086) - /* ERRATA052086: Soc integration issue results in target misses the last DMA request to copy the - last one byte from controler when transmission data size is > 1 byte. Resolution: Triggering DMA - interrupt one byte in advance, then receive the last one byte data after DMA transmission finishes. */ - if (dataSize > 1U) - { - dataSize--; - } -#endif - - EDMA_PrepareTransfer(&rxConfig, (void *)rxFifoBase, 1, xfer->rxData, 1, 1, dataSize, - kEDMA_PeripheralToMemory); - (void)EDMA_SubmitTransfer(handle->rxDmaHandle, &rxConfig); - EDMA_StartTransfer(handle->rxDmaHandle); -} - -/*! - * brief Prepares for a non-blocking DMA-based transaction on the I3C bus. - * - * The API will do DMA configuration according to the input transfer descriptor, and the data will be transferred when - * there's bus master requesting transfer from/to this slave. So the timing of call to this API need be aligned - * with master application to ensure the transfer is executed as expected. - * Callback specified when the @a handle was created is invoked when the transaction has completed. - * - * param base The I3C peripheral base address. - * param handle Pointer to the I3C slave driver handle. - * param transfer The pointer to the transfer descriptor. - * param eventMask Bit mask formed by OR'ing together #i3c_slave_transfer_event_t enumerators to specify - * which events to send to the callback. The transmit and receive events is not allowed to be enabled. - * retval kStatus_Success The transaction was started successfully. - * retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or another DMA - * transaction is already in progress. - * retval #kStatus_Fail The transaction can't be set. - */ -status_t I3C_SlaveTransferEDMA(I3C_Type *base, - i3c_slave_edma_handle_t *handle, - i3c_slave_edma_transfer_t *transfer, - uint32_t eventMask) -{ - assert(NULL != handle); - assert(NULL != transfer); - - bool txDmaEn = false, rxDmaEn = false; - uint32_t width; - - if (handle->isBusy) - { - return kStatus_I3C_Busy; - } - /* Clear all flags. */ - I3C_SlaveClearErrorStatusFlags(base, (uint32_t)kSlaveErrorFlags); - I3C_SlaveClearStatusFlags(base, (uint32_t)kSlaveClearFlags); - /* Reset fifos. These flags clear automatically. */ - base->SDATACTRL |= I3C_SDATACTRL_FLUSHTB_MASK | I3C_SDATACTRL_FLUSHFB_MASK; - - handle->transfer = *transfer; - - /* Set up event mask. */ - handle->eventMask = eventMask; - - if ((transfer->txData != NULL) && (transfer->txDataSize != 0U)) - { - I3C_SlavePrepareTxEDMA(base, handle); - txDmaEn = true; - width = 1U; - } - - if ((transfer->rxData != NULL) && (transfer->rxDataSize != 0U)) - { - I3C_SlavePrepareRxEDMA(base, handle); - rxDmaEn = true; - width = 1U; - } - - if (txDmaEn || rxDmaEn) - { - I3C_SlaveEnableDMA(base, txDmaEn, rxDmaEn, width); - return kStatus_Success; - } - else - { - return kStatus_Fail; - } -} - -void I3C_SlaveTransferEDMAHandleIRQ(I3C_Type *base, void *i3cHandle) -{ - uint32_t flags; - uint32_t errFlags; - i3c_slave_edma_transfer_t *xfer; - - i3c_slave_edma_handle_t *handle = (i3c_slave_edma_handle_t *)i3cHandle; - /* Check for a valid handle in case of a spurious interrupt. */ - if (NULL == handle) - { - return; - } - - xfer = &handle->transfer; - - /* Get status flags. */ - flags = I3C_SlaveGetStatusFlags(base); - errFlags = I3C_SlaveGetErrorStatusFlags(base); - - /* Clear status flags. */ - I3C_SlaveClearStatusFlags(base, flags); - - if (0UL != (errFlags & (uint32_t)kSlaveErrorFlags)) - { - xfer->event = (uint32_t)kI3C_SlaveCompletionEvent; - xfer->completionStatus = I3C_SlaveCheckAndClearError(base, errFlags); - - if ((0UL != (handle->eventMask & (uint32_t)kI3C_SlaveCompletionEvent)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - return; - } - - if (0UL != (flags & (uint32_t)kI3C_SlaveEventSentFlag)) - { - xfer->event = (uint32_t)kI3C_SlaveRequestSentEvent; - if ((0UL != (handle->eventMask & xfer->event)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - } - - if (0UL != (flags & (uint32_t)kI3C_SlaveReceivedCCCFlag)) - { - handle->isBusy = true; - xfer->event = (uint32_t)kI3C_SlaveReceivedCCCEvent; - if ((0UL != (handle->eventMask & xfer->event)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - } - - if (0UL != (flags & (uint32_t)kI3C_SlaveBusStopFlag)) - { - if (handle->isBusy == true) - { - xfer->event = (uint32_t)kI3C_SlaveCompletionEvent; - xfer->completionStatus = kStatus_Success; - handle->isBusy = false; - - if ((0UL != (handle->eventMask & xfer->event)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - I3C_SlaveTransferAbortEDMA(base, handle); - } - else - { - return; - } - } - - if (0UL != (flags & (uint32_t)kI3C_SlaveMatchedFlag)) - { - xfer->event = (uint32_t)kI3C_SlaveAddressMatchEvent; - handle->isBusy = true; - if ((0UL != (handle->eventMask & (uint32_t)kI3C_SlaveAddressMatchEvent)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - } -} - -/*! - * brief Abort a slave dma non-blocking transfer in a early time - * - * param base I3C peripheral base address - * param handle pointer to i3c_slave_edma_handle_t structure - */ -void I3C_SlaveTransferAbortEDMA(I3C_Type *base, i3c_slave_edma_handle_t *handle) -{ - if (handle->isBusy != false) - { - EDMA_AbortTransfer(handle->txDmaHandle); - EDMA_AbortTransfer(handle->rxDmaHandle); - - I3C_SlaveEnableDMA(base, false, false, 0); - - /* Reset fifos. These flags clear automatically. */ - base->SDATACTRL |= I3C_SDATACTRL_FLUSHTB_MASK | I3C_SDATACTRL_FLUSHFB_MASK; - } -} \ No newline at end of file diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_i3c_edma.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_i3c_edma.h deleted file mode 100644 index 8396e350d35..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_i3c_edma.h +++ /dev/null @@ -1,279 +0,0 @@ -/* - * Copyright 2022-2023 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_I3C_EDMA_H_ -#define FSL_I3C_EDMA_H_ - -#include "fsl_i3c.h" -#include "fsl_edma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief I3C EDMA driver version. */ -#define FSL_I3C_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 2, 9)) -/*! @} */ - -/*! - * @addtogroup i3c_master_edma_driver - * @{ - */ - -/* Forward declaration of the transfer descriptor and handle typedefs. */ -typedef struct _i3c_master_edma_handle i3c_master_edma_handle_t; - -/*! @brief i3c master callback functions. */ -typedef struct _i3c_master_edma_callback -{ - void (*slave2Master)(I3C_Type *base, void *userData); /*!< Transfer complete callback */ - void (*ibiCallback)(I3C_Type *base, - i3c_master_edma_handle_t *handle, - i3c_ibi_type_t ibiType, - i3c_ibi_state_t ibiState); /*!< IBI event callback */ - void (*transferComplete)(I3C_Type *base, - i3c_master_edma_handle_t *handle, - status_t status, - void *userData); /*!< Transfer complete callback */ -} i3c_master_edma_callback_t; -/*! - * @brief Driver handle for master EDMA APIs. - * @note The contents of this structure are private and subject to change. - */ -struct _i3c_master_edma_handle -{ - I3C_Type *base; /*!< I3C base pointer. */ - uint8_t state; /*!< Transfer state machine current state. */ - uint32_t transferCount; /*!< Indicates progress of the transfer */ - uint8_t subaddressBuffer[4]; /*!< Saving subaddress command. */ - uint8_t subaddressCount; /*!< Saving command count. */ - i3c_master_transfer_t transfer; /*!< Copy of the current transfer info. */ - i3c_master_edma_callback_t callback; /*!< Callback function pointer. */ - void *userData; /*!< Application data passed to callback. */ - edma_handle_t *rxDmaHandle; /*!< Handle for receive DMA channel. */ - edma_handle_t *txDmaHandle; /*!< Handle for transmit DMA channel. */ - uint8_t ibiAddress; /*!< Slave address which request IBI. */ - uint8_t *ibiBuff; /*!< Pointer to IBI buffer to keep ibi bytes. */ - size_t ibiPayloadSize; /*!< IBI payload size. */ - i3c_ibi_type_t ibiType; /*!< IBI type. */ -}; - -/*! @} */ - -/*! - * @addtogroup i3c_slave_edma_driver - * @{ - */ -/* Forward declaration of the transfer descriptor and handle typedefs. */ -typedef struct _i3c_slave_edma_handle i3c_slave_edma_handle_t; - -/*! @brief I3C slave transfer structure */ -typedef struct _i3c_slave_edma_transfer -{ - uint32_t event; /*!< Reason the callback is being invoked. */ - uint8_t *txData; /*!< Transfer buffer */ - size_t txDataSize; /*!< Transfer size */ - uint8_t *rxData; /*!< Transfer buffer */ - size_t rxDataSize; /*!< Transfer size */ - status_t completionStatus; /*!< Success or error code describing how the transfer completed. Only applies for - #kI3C_SlaveCompletionEvent. */ -} i3c_slave_edma_transfer_t; - -/*! - * @brief Slave event callback function pointer type. - * - * This callback is used only for the slave DMA transfer API. - * - * @param base Base address for the I3C instance on which the event occurred. - * @param handle Pointer to slave DMA transfer handle. - * @param transfer Pointer to transfer descriptor containing values passed to and/or from the callback. - * @param userData Arbitrary pointer-sized value passed from the application. - */ -typedef void (*i3c_slave_edma_callback_t)(I3C_Type *base, i3c_slave_edma_transfer_t *transfer, void *userData); -/*! - * @brief I3C slave edma handle structure. - * @note The contents of this structure are private and subject to change. - */ -struct _i3c_slave_edma_handle -{ - I3C_Type *base; /*!< I3C base pointer. */ - i3c_slave_edma_transfer_t transfer; /*!< I3C slave transfer copy. */ - bool isBusy; /*!< Whether transfer is busy. */ - bool wasTransmit; /*!< Whether the last transfer was a transmit. */ - uint32_t eventMask; /*!< Mask of enabled events. */ - i3c_slave_edma_callback_t callback; /*!< Callback function called at transfer event. */ - edma_handle_t *rxDmaHandle; /*!< Handle for receive DMA channel. */ - edma_handle_t *txDmaHandle; /*!< Handle for transmit DMA channel. */ - void *userData; /*!< Callback parameter passed to callback. */ -}; -/*! @} */ -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @addtogroup i3c_master_edma_driver - * @{ - */ - -/*! @name Master DMA */ -/*! @{ */ - -/*! - * @brief Create a new handle for the I3C master DMA APIs. - * - * The creation of a handle is for use with the DMA APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the I3C_MasterTransferAbortDMA() API shall be called. - * - * For devices where the I3C send and receive DMA requests are OR'd together, the @a txDmaHandle - * parameter is ignored and may be set to NULL. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C master driver handle. - * @param callback User provided pointer to the asynchronous callback function. - * @param userData User provided pointer to the application callback data. - * @param rxDmaHandle Handle for the DMA receive channel. Created by the user prior to calling this function. - * @param txDmaHandle Handle for the DMA transmit channel. Created by the user prior to calling this function. - */ -void I3C_MasterTransferCreateHandleEDMA(I3C_Type *base, - i3c_master_edma_handle_t *handle, - const i3c_master_edma_callback_t *callback, - void *userData, - edma_handle_t *rxDmaHandle, - edma_handle_t *txDmaHandle); - -/*! - * @brief Performs a non-blocking DMA-based transaction on the I3C bus. - * - * The callback specified when the @a handle was created is invoked when the transaction has - * completed. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C master driver handle. - * @param transfer The pointer to the transfer descriptor. - * @retval kStatus_Success The transaction was started successfully. - * @retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or another DMA - * transaction is already in progress. - */ -status_t I3C_MasterTransferEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle, i3c_master_transfer_t *transfer); - -/*! - * @brief Returns number of bytes transferred so far. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C master driver handle. - * @param[out] count Number of bytes transferred so far by the non-blocking transaction. - * @retval kStatus_Success - * @retval kStatus_NoTransferInProgress There is not a DMA transaction currently in progress. - */ -status_t I3C_MasterTransferGetCountEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle, size_t *count); - -/*! - * @brief Terminates a non-blocking I3C master transmission early. - * - * @note It is not safe to call this function from an IRQ handler that has a higher priority than the - * DMA peripheral's IRQ priority. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C master driver handle. - */ -void I3C_MasterTransferAbortEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle); - -/*! - * @brief Reusable routine to handle master interrupts. - * @note This function does not need to be called unless you are reimplementing the - * nonblocking API's interrupt handler routines to add special functionality. - * @param base The I3C peripheral base address. - * @param i3cHandle Pointer to the I3C master DMA driver handle. - */ -void I3C_MasterTransferEDMAHandleIRQ(I3C_Type *base, void *i3cHandle); -/*! @} */ - -/*! @} */ - -/*! - * @addtogroup i3c_slave_edma_driver - * @{ - */ - -/*! @name Slave DMA */ -/*! @{ */ -/*! - * @brief Create a new handle for the I3C slave DMA APIs. - * - * The creation of a handle is for use with the DMA APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the I3C_SlaveTransferAbortDMA() API shall be called. - * - * For devices where the I3C send and receive DMA requests are OR'd together, the @a txDmaHandle - * parameter is ignored and may be set to NULL. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C slave driver handle. - * @param callback User provided pointer to the asynchronous callback function. - * @param userData User provided pointer to the application callback data. - * @param rxDmaHandle Handle for the DMA receive channel. Created by the user prior to calling this function. - * @param txDmaHandle Handle for the DMA transmit channel. Created by the user prior to calling this function. - */ -void I3C_SlaveTransferCreateHandleEDMA(I3C_Type *base, - i3c_slave_edma_handle_t *handle, - i3c_slave_edma_callback_t callback, - void *userData, - edma_handle_t *rxDmaHandle, - edma_handle_t *txDmaHandle); - -/*! - * @brief Prepares for a non-blocking DMA-based transaction on the I3C bus. - * - * The API will do DMA configuration according to the input transfer descriptor, and the data will be transferred when - * there's bus master requesting transfer from/to this slave. So the timing of call to this API need be aligned - * with master application to ensure the transfer is executed as expected. - * Callback specified when the @a handle was created is invoked when the transaction has completed. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C slave driver handle. - * @param transfer The pointer to the transfer descriptor. - * @param eventMask Bit mask formed by OR'ing together #i3c_slave_transfer_event_t enumerators to specify - * which events to send to the callback. The transmit and receive events is not allowed to be enabled. - * @retval kStatus_Success The transaction was started successfully. - * @retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or another DMA - * transaction is already in progress. - * @retval #kStatus_Fail The transaction can't be set. - */ -status_t I3C_SlaveTransferEDMA(I3C_Type *base, - i3c_slave_edma_handle_t *handle, - i3c_slave_edma_transfer_t *transfer, - uint32_t eventMask); -/*! - * @brief Abort a slave edma non-blocking transfer in a early time - * - * @param base I3C peripheral base address - * @param handle pointer to i3c_slave_edma_handle_t structure - */ -void I3C_SlaveTransferAbortEDMA(I3C_Type *base, i3c_slave_edma_handle_t *handle); - -/*! - * @brief Reusable routine to handle slave interrupts. - * @note This function does not need to be called unless you are reimplementing the - * nonblocking API's interrupt handler routines to add special functionality. - * @param base The I3C peripheral base address. - * @param i3cHandle Pointer to the I3C slave DMA driver handle. - */ -void I3C_SlaveTransferEDMAHandleIRQ(I3C_Type *base, void *i3cHandle); -/*! @} */ - -/*! @} */ -#if defined(__cplusplus) -} -#endif - -#endif /* FSL_I3C_EDMA_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_inputmux.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_inputmux.c deleted file mode 100644 index 1f2ce0bcd26..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_inputmux.c +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_inputmux.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.inputmux" -#endif - -#if defined(INPUTMUX_RSTS) -#define INPUTMUX_RESETS_ARRAY INPUTMUX_RSTS -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#if defined(INPUTMUX_RESETS_ARRAY) -/*! - * @brief Get instance number for INPUTMUX module. - * - * @param base INPUTMUX peripheral base address - */ -static uint32_t INPUTMUX_GetInstance(INPUTMUX_Type *base); -#endif -/******************************************************************************* - * Variables - ******************************************************************************/ -#if defined(INPUTMUX_RESETS_ARRAY) -/*! @brief Pointers to INPUTMUX bases for each instance. */ -static INPUTMUX_Type *const s_inputmuxBases[] = INPUTMUX_BASE_PTRS; - -/* Reset array */ -static const reset_ip_name_t s_inputmuxResets[] = INPUTMUX_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -#if defined(INPUTMUX_RESETS_ARRAY) -static uint32_t INPUTMUX_GetInstance(INPUTMUX_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_inputmuxBases); instance++) - { - if (s_inputmuxBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_inputmuxBases)); - - return instance; -} -#endif - -/*! - * brief Initialize INPUTMUX peripheral. - - * This function enables the INPUTMUX clock. - * - * param base Base address of the INPUTMUX peripheral. - * - * retval None. - */ -void INPUTMUX_Init(INPUTMUX_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#if defined(FSL_FEATURE_INPUTMUX_HAS_NO_INPUTMUX_CLOCK_SOURCE) && FSL_FEATURE_INPUTMUX_HAS_NO_INPUTMUX_CLOCK_SOURCE -#if (defined(FSL_FEATURE_SOC_SCT_COUNT) && (FSL_FEATURE_SOC_SCT_COUNT > 0)) - CLOCK_EnableClock(kCLOCK_Sct); -#endif /* FSL_FEATURE_SOC_SCT_COUNT */ - CLOCK_EnableClock(kCLOCK_Dma); -#else - CLOCK_EnableClock(kCLOCK_InputMux); -#endif /* FSL_FEATURE_INPUTMUX_HAS_NO_INPUTMUX_CLOCK_SOURCE */ -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(INPUTMUX_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_inputmuxResets[INPUTMUX_GetInstance(base)]); -#endif -} - -/*! - * brief Attaches a signal - * - * This function attaches multiplexed signals from INPUTMUX to target signals. - * For example, to attach GPIO PORT0 Pin 5 to PINT peripheral, do the following: - * code - * INPUTMUX_AttachSignal(INPUTMUX, 2, kINPUTMUX_GpioPort0Pin5ToPintsel); - * endcode - * In this example, INTMUX has 8 registers for PINT, PINT_SEL0~PINT_SEL7. - * With parameter p index specified as 2, this function configures register PINT_SEL2. - * - * param base Base address of the INPUTMUX peripheral. - * param index The serial number of destination register in the group of INPUTMUX registers with same name. - * param connection Applies signal from source signals collection to target signal. - * - * retval None. - */ -void INPUTMUX_AttachSignal(INPUTMUX_Type *base, uint32_t index, inputmux_connection_t connection) -{ - uint32_t pmux_id; - uint32_t output_id; - - /* extract pmux to be used */ - pmux_id = ((uint32_t)(connection)) >> PMUX_SHIFT; - /* extract function number */ - output_id = ((uint32_t)(connection)) & ((1UL << PMUX_SHIFT) - 1U); - /* programm signal */ - *(volatile uint32_t *)(((uint32_t)base) + pmux_id + (index * 4U)) = output_id; -} - -#if defined(FSL_FEATURE_INPUTMUX_HAS_SIGNAL_ENA) -/*! - * brief Enable/disable a signal - * - * This function gates the INPUTPMUX clock. - * - * param base Base address of the INPUTMUX peripheral. - * param signal Enable signal register id and bit offset. - * param enable Selects enable or disable. - * - * retval None. - */ -void INPUTMUX_EnableSignal(INPUTMUX_Type *base, inputmux_signal_t signal, bool enable) -{ - uint32_t ena_id; - uint32_t ena_id_mask = (1UL << (32U - ENA_SHIFT)) - 1U; - uint32_t bit_offset; - -#if defined(FSL_FEATURE_INPUTMUX_HAS_CHANNEL_MUX) && FSL_FEATURE_INPUTMUX_HAS_CHANNEL_MUX - uint32_t chmux_offset; - uint32_t chmux_value; - - /* Only enable need to update channel mux */ - if (enable && ((((uint32_t)signal) & (1UL << CHMUX_AVL_SHIFT)) != 0U)) - { - chmux_offset = (((uint32_t)signal) >> CHMUX_OFF_SHIFT) & ((1UL << (CHMUX_AVL_SHIFT - CHMUX_OFF_SHIFT)) - 1UL); - chmux_value = (((uint32_t)signal) >> CHMUX_VAL_SHIFT) & ((1UL << (CHMUX_OFF_SHIFT - CHMUX_VAL_SHIFT)) - 1UL); - *(volatile uint32_t *)(((uint32_t)base) + chmux_offset) = chmux_value; - } - ena_id_mask = (1UL << (CHMUX_VAL_SHIFT - ENA_SHIFT)) - 1U; -#endif - /* extract enable register to be used */ - ena_id = (((uint32_t)signal) >> ENA_SHIFT) & ena_id_mask; - /* extract enable bit offset */ - bit_offset = ((uint32_t)signal) & ((1UL << ENA_SHIFT) - 1U); - /* set signal */ - if (enable) - { - *(volatile uint32_t *)(((uint32_t)base) + ena_id) |= (1UL << bit_offset); - } - else - { - *(volatile uint32_t *)(((uint32_t)base) + ena_id) &= ~(1UL << bit_offset); - } -} -#endif - -/*! - * brief Deinitialize INPUTMUX peripheral. - - * This function disables the INPUTMUX clock. - * - * param base Base address of the INPUTMUX peripheral. - * - * retval None. - */ -void INPUTMUX_Deinit(INPUTMUX_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#if defined(FSL_FEATURE_INPUTMUX_HAS_NO_INPUTMUX_CLOCK_SOURCE) && FSL_FEATURE_INPUTMUX_HAS_NO_INPUTMUX_CLOCK_SOURCE -#if (defined(FSL_FEATURE_SOC_SCT_COUNT) && (FSL_FEATURE_SOC_SCT_COUNT > 0)) - CLOCK_DisableClock(kCLOCK_Sct); -#endif /* FSL_FEATURE_SOC_SCT_COUNT */ - CLOCK_DisableClock(kCLOCK_Dma); -#else - CLOCK_DisableClock(kCLOCK_InputMux); -#endif /* FSL_FEATURE_INPUTMUX_HAS_NO_INPUTMUX_CLOCK_SOURCE */ -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_inputmux.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_inputmux.h deleted file mode 100644 index a8d5db82ec7..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_inputmux.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_INPUTMUX_H_ -#define FSL_INPUTMUX_H_ - -#include "fsl_inputmux_connections.h" -#include "fsl_common.h" - -/*! - * @addtogroup inputmux_driver - * @{ - */ - -/*! @file */ -/*! @file fsl_inputmux_connections.h */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief Group interrupt driver version for SDK */ -#define FSL_INPUTMUX_DRIVER_VERSION (MAKE_VERSION(2, 0, 7)) -/*! @} */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#ifdef __cplusplus -extern "C" { -#endif - -/*! - * @brief Initialize INPUTMUX peripheral. - - * This function enables the INPUTMUX clock. - * - * @param base Base address of the INPUTMUX peripheral. - * - * @retval None. - */ -void INPUTMUX_Init(INPUTMUX_Type *base); - -/*! - * @brief Attaches a signal - * - * This function attaches multiplexed signals from INPUTMUX to target signals. - * For example, to attach GPIO PORT0 Pin 5 to PINT peripheral, do the following: - * @code - * INPUTMUX_AttachSignal(INPUTMUX, 2, kINPUTMUX_GpioPort0Pin5ToPintsel); - * @endcode - * In this example, INTMUX has 8 registers for PINT, PINT_SEL0~PINT_SEL7. - * With parameter @p index specified as 2, this function configures register PINT_SEL2. - * - * @param base Base address of the INPUTMUX peripheral. - * @param index The serial number of destination register in the group of INPUTMUX registers with same name. - * @param connection Applies signal from source signals collection to target signal. - * - * @retval None. - */ -void INPUTMUX_AttachSignal(INPUTMUX_Type *base, uint32_t index, inputmux_connection_t connection); - -#if defined(FSL_FEATURE_INPUTMUX_HAS_SIGNAL_ENA) -/*! - * @brief Enable/disable a signal - * - * This function gates the INPUTPMUX clock. - * - * @param base Base address of the INPUTMUX peripheral. - * @param signal Enable signal register id and bit offset. - * @param enable Selects enable or disable. - * - * @retval None. - */ -void INPUTMUX_EnableSignal(INPUTMUX_Type *base, inputmux_signal_t signal, bool enable); -#endif - -/*! - * @brief Deinitialize INPUTMUX peripheral. - - * This function disables the INPUTMUX clock. - * - * @param base Base address of the INPUTMUX peripheral. - * - * @retval None. - */ -void INPUTMUX_Deinit(INPUTMUX_Type *base); - -#ifdef __cplusplus -} -#endif - -/*! @} */ - -#endif /* FSL_INPUTMUX_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_inputmux_connections.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_inputmux_connections.h deleted file mode 100644 index 592dc7bf990..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_inputmux_connections.h +++ /dev/null @@ -1,1379 +0,0 @@ -/* - * Copyright 2023 , NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _FSL_INPUTMUX_CONNECTIONS_ -#define _FSL_INPUTMUX_CONNECTIONS_ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.inputmux_connections" -#endif - -#define INPUTMUX_GpioPortPinToPintsel(port, pin) ((pin) + (PINTSEL_PMUX_ID << PMUX_SHIFT)) - -/*! - * @addtogroup inputmux_driver - * @{ - */ - -/*! - * @name Input multiplexing connections - * @{ - */ - -/*! @brief Periphinmux IDs */ -#define TIMER0CAPTSEL0 0x20U -#define TIMER0TRIGIN 0x30U -#define TIMER1CAPTSEL0 0x40U -#define TIMER1TRIGIN 0x50U -#define TIMER2CAPTSEL0 0x60U -#define TIMER2TRIGIN 0x70U -#define FREQMEAS_REF_REG 0x180U -#define FREQMEAS_TAR_REG 0x184U -#define CMP0_TRIG_REG 0x260U -#define ADC0_TRIG0_REG 0x280U -#define QDC0_TRIG_REG 0x360U -#define QDC0_HOME_REG 0x364U -#define QDC0_INDEX_REG 0x368U -#define QDC0_PHASEB_REG 0x36CU -#define QDC0_PHASEA_REG 0x370U -#define QDC0_ICAP1_REG 0x374U -#define FlexPWM0_SM0_EXTA0_REG 0x3A0U -#define FlexPWM0_SM0_EXTSYNC0_REG 0x3A4U -#define FlexPWM0_SM1_EXTA1_REG 0x3A8U -#define FlexPWM0_SM1_EXTSYNC1_REG 0x3ACU -#define FlexPWM0_SM2_EXTA2_REG 0x3B0U -#define FlexPWM0_SM2_EXTSYNC2_REG 0x3B4U -#define FlexPWM0_FAULT_REG 0x3C0U -#define FlexPWM0_FORCE_REG 0x3D0U -#define PWM0_EXT_CLK_REG 0x420U -#define AOI0_MUX_REG 0x440U -#define USBFS_TRIG_REG 0x480U -#define EXT_TRIG0_REG 0x4C0U -#define CMP1_TRIG_REG 0x4E0U -#define LPI2C0_TRIG_REG 0x5A0U -#define LPSPI0_TRIG_REG 0x5E0U -#define LPSPI1_TRIG_REG 0x600U -#define LPUART0_TRIG_REG 0x620U -#define LPUART1_TRIG_REG 0x640U -#define LPUART2_TRIG_REG 0x660U - -#define PMUX_SHIFT 20U - -typedef enum _inputmux_index_t -{ - kINPUTMUX_INDEX_CTIMER0CAPTSEL0 = 0U, - kINPUTMUX_INDEX_CTIMER0CAPTSEL1 = 1U, - kINPUTMUX_INDEX_CTIMER0CAPTSEL2 = 2U, - kINPUTMUX_INDEX_CTIMER0CAPTSEL3 = 3U, - kINPUTMUX_INDEX_CTIMER1CAPTSEL0 = 0U, - kINPUTMUX_INDEX_CTIMER1CAPTSEL1 = 1U, - kINPUTMUX_INDEX_CTIMER1CAPTSEL2 = 2U, - kINPUTMUX_INDEX_CTIMER1CAPTSEL3 = 3U, - kINPUTMUX_INDEX_CTIMER2CAPTSEL0 = 0U, - kINPUTMUX_INDEX_CTIMER2CAPTSEL1 = 1U, - kINPUTMUX_INDEX_CTIMER2CAPTSEL2 = 2U, - kINPUTMUX_INDEX_CTIMER2CAPTSEL3 = 3U, - kINPUTMUX_INDEX_ADC0_TRIGSEL0 = 0U, - kINPUTMUX_INDEX_ADC0_TRIGSEL1 = 1U, - kINPUTMUX_INDEX_ADC0_TRIGSEL2 = 2U, - kINPUTMUX_INDEX_ADC0_TRIGSEL3 = 3U, - kINPUTMUX_INDEX_QDC0_ICAPSEL0 = 0U, - kINPUTMUX_INDEX_QDC0_ICAPSEL1 = 1U, - kINPUTMUX_INDEX_QDC0_ICAPSEL2 = 2U, - kINPUTMUX_INDEX_FLEXPWM0_FAULTSEL0 = 0U, - kINPUTMUX_INDEX_FLEXPWM0_FAULTSEL1 = 1U, - kINPUTMUX_INDEX_FLEXPWM0_FAULTSEL2 = 2U, - kINPUTMUX_INDEX_FLEXPWM0_FAULTSEL3 = 3U, - kINPUTMUX_INDEX_AOI0_TRIGSEL0 = 0U, - kINPUTMUX_INDEX_AOI0_TRIGSEL1 = 1U, - kINPUTMUX_INDEX_AOI0_TRIGSEL2 = 2U, - kINPUTMUX_INDEX_AOI0_TRIGSEL3 = 3U, - kINPUTMUX_INDEX_AOI0_TRIGSEL4 = 4U, - kINPUTMUX_INDEX_AOI0_TRIGSEL5 = 5U, - kINPUTMUX_INDEX_AOI0_TRIGSEL6 = 6U, - kINPUTMUX_INDEX_AOI0_TRIGSEL7 = 7U, - kINPUTMUX_INDEX_AOI0_TRIGSEL8 = 8U, - kINPUTMUX_INDEX_AOI0_TRIGSEL9 = 9U, - kINPUTMUX_INDEX_AOI0_TRIGSEL10 = 10U, - kINPUTMUX_INDEX_AOI0_TRIGSEL11 = 11U, - kINPUTMUX_INDEX_AOI0_TRIGSEL12 = 12U, - kINPUTMUX_INDEX_AOI0_TRIGSEL13 = 13U, - kINPUTMUX_INDEX_AOI0_TRIGSEL14 = 14U, - kINPUTMUX_INDEX_AOI0_TRIGSEL15 = 15U, - kINPUTMUX_INDEX_EXT_TRIGSEL0 = 0U, - kINPUTMUX_INDEX_EXT_TRIGSEL1 = 1U, - kINPUTMUX_INDEX_EXT_TRIGSEL2 = 2U, - kINPUTMUX_INDEX_EXT_TRIGSEL3 = 3U, - kINPUTMUX_INDEX_EXT_TRIGSEL4 = 4U, - kINPUTMUX_INDEX_EXT_TRIGSEL6 = 6U, - kINPUTMUX_INDEX_EXT_TRIGSEL7 = 7U -} inputmux_index_t; - -/*! @brief INPUTMUX connections type */ -typedef enum _inputmux_connection_t -{ - /*!< TIMER0 CAPTSEL. */ - kINPUTMUX_CtimerInp0ToTimer0Captsel = 1U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer0Captsel = 2U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer0Captsel = 3U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer0Captsel = 4U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer0Captsel = 5U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer0Captsel = 6U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer0Captsel = 7U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer0Captsel = 8U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer0Captsel = 9U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer0Captsel = 10U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer0Captsel = 13U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer0Captsel = 14U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer0Captsel = 15U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer0Captsel = 16U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer0Captsel = 17U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer0Captsel = 18U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer0Captsel = 19U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer0Captsel = 20U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer0Captsel = 21U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToTimer0Captsel = 22U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToTimer0Captsel = 23U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToTimer0Captsel = 24U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToTimer0Captsel = 25U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToTimer0Captsel = 26U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToTimer0Captsel = 27U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToTimer0Captsel = 28U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToTimer0Captsel = 29U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer0Captsel = 30U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer0Captsel = 31U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToTimer0Captsel = 33U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToTimer0Captsel = 34U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToTimer0Captsel = 35U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToTimer0Captsel = 36U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToTimer0Captsel = 37U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToTimer0Captsel = 38U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToTimer0Captsel = 39U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToTimer0Captsel = 40U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToTimer0Captsel = 41U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToTimer0Captsel = 42U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToTimer0Captsel = 43U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToTimer0Captsel = 44U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToTimer0Captsel = 45U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToTimer0Captsel = 46U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c0MasterEndOfPacketToTimer0Captsel = 48U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c0SlaveEndOfPacketToTimer0Captsel = 49U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi0EndOfFrameToTimer0Captsel = 52U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi0ReceivedDataWordToTimer0Captsel = 53U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi1EndOfFrameToTimer0Captsel = 54U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi1ReceivedDataWordToTimer0Captsel = 55U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceivedDataWordToTimer0Captsel = 56U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart0TransmittedDataWordToTimer0Captsel = 57U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceiveLineIdleToTimer0Captsel = 58U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceivedDataWordToTimer0Captsel = 59U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart1TransmittedDataWordToTimer0Captsel = 60U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceiveLineIdleToTimer0Captsel = 61U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceivedDataWordToTimer0Captsel = 62U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart2TransmittedDataWordToTimer0Captsel = 63U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceiveLineIdleToTimer0Captsel = 64U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - - /*!< Timer1 CAPTSEL. */ - kINPUTMUX_CtimerInp0ToTimer1Captsel = 1U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer1Captsel = 2U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer1Captsel = 3U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer1Captsel = 4U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer1Captsel = 5U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer1Captsel = 6U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer1Captsel = 7U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer1Captsel = 8U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer1Captsel = 9U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer1Captsel = 10U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer1Captsel = 13U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer1Captsel = 14U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer1Captsel = 15U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer1Captsel = 16U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer1Captsel = 17U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer1Captsel = 18U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer1Captsel = 19U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer1Captsel = 20U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer1Captsel = 21U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToTimer1Captsel = 22U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToTimer1Captsel = 23U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToTimer1Captsel = 24U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToTimer1Captsel = 25U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToTimer1Captsel = 26U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToTimer1Captsel = 27U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToTimer1Captsel = 28U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToTimer1Captsel = 29U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer1Captsel = 30U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer1Captsel = 31U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToTimer1Captsel = 33U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToTimer1Captsel = 34U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToTimer1Captsel = 35U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToTimer1Captsel = 36U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToTimer1Captsel = 37U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToTimer1Captsel = 38U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToTimer1Captsel = 39U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToTimer1Captsel = 40U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToTimer1Captsel = 41U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToTimer1Captsel = 42U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToTimer1Captsel = 43U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToTimer1Captsel = 44U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToTimer1Captsel = 45U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToTimer1Captsel = 46U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c0MasterEndOfPacketToTimer1Captsel = 48U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c0SlaveEndOfPacketToTimer1Captsel = 49U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi0EndOfFrameToTimer1Captsel = 52U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi0ReceivedDataWordToTimer1Captsel = 53U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi1EndOfFrameToTimer1Captsel = 54U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi1ReceivedDataWordToTimer1Captsel = 55U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceivedDataWordToTimer1Captsel = 56U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart0TransmittedDataWordToTimer1Captsel = 57U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceiveLineIdleToTimer1Captsel = 58U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceivedDataWordToTimer1Captsel = 59U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart1TransmittedDataWordToTimer1Captsel = 60U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceiveLineIdleToTimer1Captsel = 61U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceivedDataWordToTimer1Captsel = 62U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart2TransmittedDataWordToTimer1Captsel = 63U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceiveLineIdleToTimer1Captsel = 64U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - - /*!< Timer2 CAPTSEL. */ - kINPUTMUX_CtimerInp0ToTimer2Captsel = 1U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer2Captsel = 2U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer2Captsel = 3U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer2Captsel = 4U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer2Captsel = 5U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer2Captsel = 6U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer2Captsel = 7U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer2Captsel = 8U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer2Captsel = 9U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer2Captsel = 10U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer2Captsel = 13U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer2Captsel = 14U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer2Captsel = 15U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer2Captsel = 16U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer2Captsel = 17U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer2Captsel = 18U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer2Captsel = 19U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer2Captsel = 20U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer2Captsel = 21U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToTimer2Captsel = 22U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToTimer2Captsel = 23U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToTimer2Captsel = 24U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToTimer2Captsel = 25U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToTimer2Captsel = 26U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToTimer2Captsel = 27U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToTimer2Captsel = 28U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToTimer2Captsel = 29U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer2Captsel = 30U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer2Captsel = 31U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToTimer2Captsel = 33U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToTimer2Captsel = 34U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToTimer2Captsel = 35U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToTimer2Captsel = 36U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToTimer2Captsel = 37U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToTimer2Captsel = 38U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToTimer2Captsel = 39U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToTimer2Captsel = 40U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToTimer2Captsel = 41U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToTimer2Captsel = 42U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToTimer2Captsel = 43U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToTimer2Captsel = 44U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToTimer2Captsel = 45U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToTimer2Captsel = 46U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c0MasterEndOfPacketToTimer2Captsel = 48U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c0SlaveEndOfPacketToTimer2Captsel = 49U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi0EndOfFrameToTimer2Captsel = 52U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi0ReceivedDataWordToTimer2Captsel = 53U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi1EndOfFrameToTimer2Captsel = 54U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi1ReceivedDataWordToTimer2Captsel = 55U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceivedDataWordToTimer2Captsel = 56U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart0TransmittedDataWordToTimer2Captsel = 57U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceiveLineIdleToTimer2Captsel = 58U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceivedDataWordToTimer2Captsel = 59U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart1TransmittedDataWordToTimer2Captsel = 60U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceiveLineIdleToTimer2Captsel = 61U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceivedDataWordToTimer2Captsel = 62U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart2TransmittedDataWordToTimer2Captsel = 63U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceiveLineIdleToTimer2Captsel = 64U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - - /*!< TIMER0 Trigger. */ - kINPUTMUX_CtimerInp0ToTimer0Trigger = 1U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer0Trigger = 2U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer0Trigger = 3U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer0Trigger = 4U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer0Trigger = 5U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer0Trigger = 6U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer0Trigger = 7U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer0Trigger = 8U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer0Trigger = 9U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer0Trigger = 10U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer0Trigger = 13U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer0Trigger = 14U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer0Trigger = 15U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer0Trigger = 16U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer0Trigger = 17U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer0Trigger = 18U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer0Trigger = 19U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer0Trigger = 20U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer0Trigger = 21U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToTimer0Trigger = 22U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToTimer0Trigger = 23U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToTimer0Trigger = 24U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToTimer0Trigger = 25U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToTimer0Trigger = 26U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToTimer0Trigger = 27U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToTimer0Trigger = 28U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToTimer0Trigger = 29U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer0Trigger = 30U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer0Trigger = 31U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToTimer0Trigger = 33U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToTimer0Trigger = 34U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToTimer0Trigger = 35U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToTimer0Trigger = 36U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToTimer0Trigger = 37U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToTimer0Trigger = 38U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToTimer0Trigger = 39U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToTimer0Trigger = 40U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToTimer0Trigger = 41U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToTimer0Trigger = 42U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToTimer0Trigger = 43U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToTimer0Trigger = 44U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToTimer0Trigger = 45U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToTimer0Trigger = 46U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c0MasterEndOfPacketToTimer0Trigger = 48U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c0SlaveEndOfPacketToTimer0Trigger = 49U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi0EndOfFrameToTimer0Trigger = 52U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi0ReceivedDataWordToTimer0Trigger = 53U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi1EndOfFrameToTimer0Trigger = 54U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi1ReceivedDataWordToTimer0Trigger = 55U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceivedDataWordToTimer0Trigger = 56U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart0TransmittedDataWordToTimer0Trigger = 57U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceiveLineIdleToTimer0Trigger = 58U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceivedDataWordToTimer0Trigger = 59U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart1TransmittedDataWordToTimer0Trigger = 60U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceiveLineIdleToTimer0Trigger = 61U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceivedDataWordToTimer0Trigger = 62U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart2TransmittedDataWordToTimer0Trigger = 63U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceiveLineIdleToTimer0Trigger = 64U + (TIMER0TRIGIN << PMUX_SHIFT), - - /*!< Timer1 Trigger. */ - kINPUTMUX_CtimerInp0ToTimer1Trigger = 1U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer1Trigger = 2U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer1Trigger = 3U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer1Trigger = 4U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer1Trigger = 5U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer1Trigger = 6U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer1Trigger = 7U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer1Trigger = 8U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer1Trigger = 9U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer1Trigger = 10U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer1Trigger = 13U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer1Trigger = 14U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer1Trigger = 15U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer1Trigger = 16U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer1Trigger = 17U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer1Trigger = 18U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer1Trigger = 19U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer1Trigger = 20U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer1Trigger = 21U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToTimer1Trigger = 22U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToTimer1Trigger = 23U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToTimer1Trigger = 24U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToTimer1Trigger = 25U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToTimer1Trigger = 26U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToTimer1Trigger = 27U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToTimer1Trigger = 28U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToTimer1Trigger = 29U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer1Trigger = 30U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer1Trigger = 31U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToTimer1Trigger = 33U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToTimer1Trigger = 34U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToTimer1Trigger = 35U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToTimer1Trigger = 36U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToTimer1Trigger = 37U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToTimer1Trigger = 38U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToTimer1Trigger = 39U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToTimer1Trigger = 40U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToTimer1Trigger = 41U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToTimer1Trigger = 42U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToTimer1Trigger = 43U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToTimer1Trigger = 44U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToTimer1Trigger = 45U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToTimer1Trigger = 46U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c0MasterEndOfPacketToTimer1Trigger = 48U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c0SlaveEndOfPacketToTimer1Trigger = 49U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi0EndOfFrameToTimer1Trigger = 52U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi0ReceivedDataWordToTimer1Trigger = 53U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi1EndOfFrameToTimer1Trigger = 54U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi1ReceivedDataWordToTimer1Trigger = 55U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceivedDataWordToTimer1Trigger = 56U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart0TransmittedDataWordToTimer1Trigger = 57U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceiveLineIdleToTimer1Trigger = 58U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceivedDataWordToTimer1Trigger = 59U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart1TransmittedDataWordToTimer1Trigger = 60U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceiveLineIdleToTimer1Trigger = 61U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceivedDataWordToTimer1Trigger = 62U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart2TransmittedDataWordToTimer1Trigger = 63U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceiveLineIdleToTimer1Trigger = 64U + (TIMER1TRIGIN << PMUX_SHIFT), - - /*!< Timer2 Trigger. */ - kINPUTMUX_CtimerInp0ToTimer2Trigger = 1U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer2Trigger = 2U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer2Trigger = 3U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer2Trigger = 4U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer2Trigger = 5U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer2Trigger = 6U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer2Trigger = 7U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer2Trigger = 8U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer2Trigger = 9U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer2Trigger = 10U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer2Trigger = 13U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer2Trigger = 14U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer2Trigger = 15U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer2Trigger = 16U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer2Trigger = 17U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer2Trigger = 18U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer2Trigger = 19U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer2Trigger = 20U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer2Trigger = 21U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToTimer2Trigger = 22U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToTimer2Trigger = 23U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToTimer2Trigger = 24U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToTimer2Trigger = 25U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToTimer2Trigger = 26U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToTimer2Trigger = 27U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToTimer2Trigger = 28U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToTimer2Trigger = 29U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer2Trigger = 30U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer2Trigger = 31U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToTimer2Trigger = 33U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToTimer2Trigger = 34U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToTimer2Trigger = 35U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToTimer2Trigger = 36U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToTimer2Trigger = 37U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToTimer2Trigger = 38U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToTimer2Trigger = 39U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToTimer2Trigger = 40U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToTimer2Trigger = 41U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToTimer2Trigger = 42U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToTimer2Trigger = 43U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToTimer2Trigger = 44U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToTimer2Trigger = 45U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToTimer2Trigger = 46U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c0MasterEndOfPacketToTimer2Trigger = 48U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c0SlaveEndOfPacketToTimer2Trigger = 49U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi0EndOfFrameToTimer2Trigger = 52U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi0ReceivedDataWordToTimer2Trigger = 53U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi1EndOfFrameToTimer2Trigger = 54U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi1ReceivedDataWordToTimer2Trigger = 55U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceivedDataWordToTimer2Trigger = 56U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart0TransmittedDataWordToTimer2Trigger = 57U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceiveLineIdleToTimer2Trigger = 58U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceivedDataWordToTimer2Trigger = 59U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart1TransmittedDataWordToTimer2Trigger = 60U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceiveLineIdleToTimer2Trigger = 61U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceivedDataWordToTimer2Trigger = 62U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart2TransmittedDataWordToTimer2Trigger = 63U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceiveLineIdleToTimer2Trigger = 64U + (TIMER2TRIGIN << PMUX_SHIFT), - - /*!< Selection for frequency measurement reference clock. */ - kINPUTMUX_ClkInToFreqmeasRef = 1U + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_FroOsc12MToFreqmeasRef = 2u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_FroHfDivToFreqmeasRef = 3u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_Clk16K1ToFreqmeasRef = 5u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_SlowClkToFreqmeasRef = 6u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_FreqmeClkIn0ToFreqmeasRef = 7u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_FreqmeClkIn1ToFreqmeasRef = 8u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToFreqmeasRef = 9u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToFreqmeasRef = 10u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToFreqmeasRef = 11u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToFreqmeasRef = 12u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToFreqmeasRef = 13u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToFreqmeasRef = 14u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToFreqmeasRef = 15u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToFreqmeasRef = 16u + (FREQMEAS_REF_REG << PMUX_SHIFT), - - /*!< Selection for frequency measurement target clock. */ - kINPUTMUX_ClkInToFreqmeasTar = 1U + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_FroOsc12MToFreqmeasTar = 2u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_FroHfDivToFreqmeasTar = 3u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_Clk16K1ToFreqmeasTar = 5u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_SlowClkToFreqmeasTar = 6u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_FreqmeClkIn0ToFreqmeasTar = 7u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_FreqmeClkIn1ToFreqmeasTar = 8u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToFreqmeasTar = 9u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToFreqmeasTar = 10u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToFreqmeasTar = 11u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToFreqmeasTar = 12u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToFreqmeasTar = 13u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToFreqmeasTar = 14u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToFreqmeasTar = 15u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToFreqmeasTar = 16u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - - /*!< Cmp0 Trigger. */ - kINPUTMUX_ArmTxevToCmp0Trigger = 1U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToCmp0Trigger = 2U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToCmp0Trigger = 3U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToCmp0Trigger = 4U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToCmp0Trigger = 5U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToCmp0Trigger = 6U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M0ToCmp0Trigger = 8U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToCmp0Trigger = 9U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToCmp0Trigger = 10U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToCmp0Trigger = 11U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToCmp0Trigger = 12U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToCmp0Trigger = 13U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToCmp0Trigger = 14U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToCmp0Trigger = 16U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToCmp0Trigger = 17U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToCmp0Trigger = 18U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToCmp0Trigger = 19U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToCmp0Trigger = 20U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToCmp0Trigger = 21U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToCmp0Trigger = 22U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToCmp0Trigger = 25U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToCmp0Trigger = 26U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToCmp0Trigger = 27U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToCmp0Trigger = 28U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToCmp0Trigger = 30U + (CMP0_TRIG_REG << PMUX_SHIFT), - - /*!< Cmp1 Trigger. */ - kINPUTMUX_ArmTxevToCmp1Trigger = 1U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToCmp1Trigger = 2U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToCmp1Trigger = 3U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToCmp1Trigger = 4U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToCmp1Trigger = 5U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToCmp1Trigger = 6U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M0ToCmp1Trigger = 8U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToCmp1Trigger = 9U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToCmp1Trigger = 10U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToCmp1Trigger = 11U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToCmp1Trigger = 12U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToCmp1Trigger = 13U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToCmp1Trigger = 14U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToCmp1Trigger = 16U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToCmp1Trigger = 17U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToCmp1Trigger = 18U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToCmp1Trigger = 19U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToCmp1Trigger = 20U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToCmp1Trigger = 21U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToCmp1Trigger = 22U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToCmp1Trigger = 25U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToCmp1Trigger = 26U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToCmp1Trigger = 27U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToCmp1Trigger = 28U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToCmp1Trigger = 30U + (CMP1_TRIG_REG << PMUX_SHIFT), - - /*!< Adc0 Trigger. */ - kINPUTMUX_ArmTxevToAdc0Trigger = 1U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToAdc0Trigger = 2U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToAdc0Trigger = 3U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToAdc0Trigger = 4U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToAdc0Trigger = 5U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToAdc0Trigger = 6U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToAdc0Trigger = 7U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M0ToAdc0Trigger = 9U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToAdc0Trigger = 10U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToAdc0Trigger = 11U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToAdc0Trigger = 12U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToAdc0Trigger = 13U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToAdc0Trigger = 14U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToAdc0Trigger = 15U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToAdc0Trigger = 17U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToAdc0Trigger = 18U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToAdc0Trigger = 19U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToAdc0Trigger = 20U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToAdc0Trigger = 21U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToAdc0Trigger = 22U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToAdc0Trigger = 23U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToAdc0Trigger = 26U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToAdc0Trigger = 27U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToAdc0Trigger = 28U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToAdc0Trigger = 29U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_WuuToAdc0Trigger = 31U + (ADC0_TRIG0_REG << PMUX_SHIFT), - - /*!< Qdc0 Trigger. */ - kINPUTMUX_ArmTxevToQdc0Trigger = 1U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToQdc0Trigger = 2U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToQdc0Trigger = 3U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToQdc0Trigger = 4U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToQdc0Trigger = 5U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc0Trigger = 6U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc0Trigger = 7U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToQdc0Trigger = 9U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc0Trigger = 10U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToQdc0Trigger = 11U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc0Trigger = 12U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToQdc0Trigger = 13U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc0Trigger = 14U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToQdc0Trigger = 15U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToQdc0Trigger = 16U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToQdc0Trigger = 17U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToQdc0Trigger = 18U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToQdc0Trigger = 19U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToQdc0Trigger = 20U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToQdc0Trigger = 21U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc0Trigger = 24U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc0Trigger = 25U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc0Trigger = 26U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc0Trigger = 27U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc0Trigger = 28U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc0Trigger = 29U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc0Trigger = 30U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc0Trigger = 31U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc0Trigger = 32U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc0Trigger = 33U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToQdc0Trigger = 34U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToQdc0Trigger = 35U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToQdc0Trigger = 36U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToQdc0Trigger = 37U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToQdc0Trigger = 38U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToQdc0Trigger = 39U + (QDC0_TRIG_REG << PMUX_SHIFT), - - /*!< Qdc0 Home. */ - kINPUTMUX_ArmTxevToQdc0Home = 1U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToQdc0Home = 2U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToQdc0Home = 3U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToQdc0Home = 4U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToQdc0Home = 5U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc0Home = 6U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc0Home = 7U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToQdc0Home = 9U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc0Home = 10U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToQdc0Home = 11U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc0Home = 12U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToQdc0Home = 13U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc0Home = 14U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToQdc0Home = 15U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToQdc0Home = 16U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToQdc0Home = 17U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToQdc0Home = 18U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToQdc0Home = 19U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToQdc0Home = 20U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToQdc0Home = 21U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc0Home = 24U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc0Home = 25U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc0Home = 26U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc0Home = 27U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc0Home = 28U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc0Home = 29U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc0Home = 30U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc0Home = 31U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc0Home = 32U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc0Home = 33U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToQdc0Home = 34U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToQdc0Home = 35U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToQdc0Home = 36U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToQdc0Home = 37U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToQdc0Home = 38U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToQdc0Home = 39U + (QDC0_HOME_REG << PMUX_SHIFT), - - /*!< Qdc0 Index. */ - kINPUTMUX_ArmTxevToQdc0Index = 1U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToQdc0Index = 2U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToQdc0Index = 3U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToQdc0Index = 4U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToQdc0Index = 5U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc0Index = 6U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc0Index = 7U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToQdc0Index = 9U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc0Index = 10U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToQdc0Index = 11U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc0Index = 12U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToQdc0Index = 13U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc0Index = 14U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToQdc0Index = 15U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToQdc0Index = 16U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToQdc0Index = 17U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToQdc0Index = 18U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToQdc0Index = 19U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToQdc0Index = 20U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToQdc0Index = 21U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc0Index = 24U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc0Index = 25U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc0Index = 26U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc0Index = 27U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc0Index = 28U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc0Index = 29U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc0Index = 30U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc0Index = 31U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc0Index = 32U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc0Index = 33U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToQdc0Index = 34U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToQdc0Index = 35U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToQdc0Index = 36U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToQdc0Index = 37U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToQdc0Index = 38U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToQdc0Index = 39U + (QDC0_INDEX_REG << PMUX_SHIFT), - - /*!< Qdc0 Phaseb. */ - kINPUTMUX_ArmTxevToQdc0Phaseb = 1U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToQdc0Phaseb = 2U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToQdc0Phaseb = 3U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToQdc0Phaseb = 4U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToQdc0Phaseb = 5U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc0Phaseb = 6U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc0Phaseb = 7U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToQdc0Phaseb = 9U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc0Phaseb = 10U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToQdc0Phaseb = 11U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc0Phaseb = 12U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToQdc0Phaseb = 13U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc0Phaseb = 14U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToQdc0Phaseb = 15U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToQdc0Phaseb = 16U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToQdc0Phaseb = 17U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToQdc0Phaseb = 18U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToQdc0Phaseb = 19U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToQdc0Phaseb = 20U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToQdc0Phaseb = 21U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc0Phaseb = 24U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc0Phaseb = 25U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc0Phaseb = 26U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc0Phaseb = 27U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc0Phaseb = 28U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc0Phaseb = 29U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc0Phaseb = 30U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc0Phaseb = 31U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc0Phaseb = 32U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc0Phaseb = 33U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToQdc0Phaseb = 34U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToQdc0Phaseb = 35U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToQdc0Phaseb = 36U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToQdc0Phaseb = 37U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToQdc0Phaseb = 38U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToQdc0Phaseb = 39U + (QDC0_PHASEB_REG << PMUX_SHIFT), - - /*!< Qdc0 Phasea. */ - kINPUTMUX_ArmTxevToQdc0Phasea = 1U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToQdc0Phasea = 2U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToQdc0Phasea = 3U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToQdc0Phasea = 4U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToQdc0Phasea = 5U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc0Phasea = 6U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc0Phasea = 7U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToQdc0Phasea = 9U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc0Phasea = 10U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToQdc0Phasea = 11U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc0Phasea = 12U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToQdc0Phasea = 13U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc0Phasea = 14U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToQdc0Phasea = 15U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToQdc0Phasea = 16U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToQdc0Phasea = 17U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToQdc0Phasea = 18U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToQdc0Phasea = 19U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToQdc0Phasea = 20U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToQdc0Phasea = 21U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc0Phasea = 24U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc0Phasea = 25U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc0Phasea = 26U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc0Phasea = 27U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc0Phasea = 28U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc0Phasea = 29U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc0Phasea = 30U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc0Phasea = 31U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc0Phasea = 32U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc0Phasea = 33U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToQdc0Phasea = 34U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToQdc0Phasea = 35U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToQdc0Phasea = 36U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToQdc0Phasea = 37U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToQdc0Phasea = 38U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToQdc0Phasea = 39U + (QDC0_PHASEA_REG << PMUX_SHIFT), - - /*!< Qdc0 Icap1. */ - kINPUTMUX_ArmTxevToQdc0Icap1 = 1U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToQdc0Icap1 = 2U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToQdc0Icap1 = 3U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToQdc0Icap1 = 4U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToQdc0Icap1 = 5U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc0Icap1 = 6U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc0Icap1 = 7U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToQdc0Icap1 = 9U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc0Icap1 = 10U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToQdc0Icap1 = 11U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc0Icap1 = 12U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToQdc0Icap1 = 13U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc0Icap1 = 14U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToQdc0Icap1 = 15U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToQdc0Icap1 = 16U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToQdc0Icap1 = 17U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToQdc0Icap1 = 18U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToQdc0Icap1 = 19U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToQdc0Icap1 = 20U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToQdc0Icap1 = 21U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc0Icap1 = 24U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc0Icap1 = 25U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc0Icap1 = 26U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc0Icap1 = 27U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc0Icap1 = 28U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc0Icap1 = 29U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc0Icap1 = 30U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc0Icap1 = 31U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc0Icap1 = 32U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc0Icap1 = 33U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToQdc0Icap1 = 34U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToQdc0Icap1 = 35U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToQdc0Icap1 = 36U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToQdc0Icap1 = 37U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToQdc0Icap1 = 38U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToQdc0Icap1 = 39U + (QDC0_ICAP1_REG << PMUX_SHIFT), - - /*!< FlexPWM0_SM0_EXTA0 input trigger connections. */ - kINPUTMUX_ArmTxevToFlexPwm0Sm0Exta0 = 1U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToFlexPwm0Sm0Exta0 = 2U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToFlexPwm0Sm0Exta0 = 3U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToFlexPwm0Sm0Exta0 = 4U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToFlexPwm0Sm0Exta0 = 5U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Sm0Exta0 = 6U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Sm0Exta0 = 7U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToFlexPwm0Sm0Exta0 = 9U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Sm0Exta0 = 10U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToFlexPwm0Sm0Exta0 = 11U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Sm0Exta0 = 12U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToFlexPwm0Sm0Exta0 = 13U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Sm0Exta0 = 14U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToFlexPwm0Sm0Exta0 = 15U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToFlexPwm0Sm0Exta0 = 16U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToFlexPwm0Sm0Exta0 = 17U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToFlexPwm0Sm0Exta0 = 18U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToFlexPwm0Sm0Exta0 = 19U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Sm0Exta0 = 20U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Sm0Exta0 = 21U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Sm0Exta0 = 22U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Sm0Exta0 = 23U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Sm0Exta0 = 24U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Sm0Exta0 = 25U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Sm0Exta0 = 26U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Sm0Exta0 = 27U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Sm0Exta0 = 28U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Sm0Exta0 = 29U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexPwm0Sm0Exta0 = 30U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexPwm0Sm0Exta0 = 31U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToFlexPwm0Sm0Exta0 = 32U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToFlexPwm0Sm0Exta0 = 33U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Sm0Exta0 = 34U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Sm0Exta0 = 35U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - - /*!< FlexPWM0_SM1_EXTA1 input trigger connections. */ - kINPUTMUX_ArmTxevToFlexPwm0Sm1Exta1 = 1U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToFlexPwm0Sm1Exta1 = 2U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToFlexPwm0Sm1Exta1 = 3U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToFlexPwm0Sm1Exta1 = 4U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToFlexPwm0Sm1Exta1 = 5U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Sm1Exta1 = 6U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Sm1Exta1 = 7U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToFlexPwm0Sm1Exta1 = 9U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Sm1Exta1 = 10U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToFlexPwm0Sm1Exta1 = 11U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Sm1Exta1 = 12U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToFlexPwm0Sm1Exta1 = 13U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Sm1Exta1 = 14U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToFlexPwm0Sm1Exta1 = 15U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToFlexPwm0Sm1Exta1 = 16U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToFlexPwm0Sm1Exta1 = 17U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToFlexPwm0Sm1Exta1 = 18U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToFlexPwm0Sm1Exta1 = 19U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Sm1Exta1 = 20U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Sm1Exta1 = 21U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Sm1Exta1 = 22U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Sm1Exta1 = 23U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Sm1Exta1 = 24U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Sm1Exta1 = 25U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Sm1Exta1 = 26U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Sm1Exta1 = 27U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Sm1Exta1 = 28U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Sm1Exta1 = 29U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexPwm0Sm1Exta1 = 30U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexPwm0Sm1Exta1 = 31U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToFlexPwm0Sm1Exta1 = 32U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToFlexPwm0Sm1Exta1 = 33U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Sm1Exta1 = 34U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Sm1Exta1 = 35U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - - /*!< FlexPWM0_SM2_EXTA2 input trigger connections. */ - kINPUTMUX_ArmTxevToFlexPwm0Sm2Exta2 = 1U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToFlexPwm0Sm2Exta2 = 2U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToFlexPwm0Sm2Exta2 = 3U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToFlexPwm0Sm2Exta2 = 4U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToFlexPwm0Sm2Exta2 = 5U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Sm2Exta2 = 6U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Sm2Exta2 = 7U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToFlexPwm0Sm2Exta2 = 9U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Sm2Exta2 = 10U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToFlexPwm0Sm2Exta2 = 11U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Sm2Exta2 = 12U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToFlexPwm0Sm2Exta2 = 13U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Sm2Exta2 = 14U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToFlexPwm0Sm2Exta2 = 15U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToFlexPwm0Sm2Exta2 = 16U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToFlexPwm0Sm2Exta2 = 17U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToFlexPwm0Sm2Exta2 = 18U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToFlexPwm0Sm2Exta2 = 19U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Sm2Exta2 = 20U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Sm2Exta2 = 21U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Sm2Exta2 = 22U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Sm2Exta2 = 23U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Sm2Exta2 = 24U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Sm2Exta2 = 25U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Sm2Exta2 = 26U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Sm2Exta2 = 27U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Sm2Exta2 = 28U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Sm2Exta2 = 29U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexPwm0Sm2Exta2 = 30U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexPwm0Sm2Exta2 = 31U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToFlexPwm0Sm2Exta2 = 32U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToFlexPwm0Sm2Exta2 = 33U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Sm2Exta2 = 34U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Sm2Exta2 = 35U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - - /*!< FlexPWM0_SM0_EXTSYNC0 input trigger connections. */ - kINPUTMUX_ArmTxevToFlexPwm0Sm0Extsync0 = 1U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToFlexPwm0Sm0Extsync0 = 2U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToFlexPwm0Sm0Extsync0 = 3U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToFlexPwm0Sm0Extsync0 = 4U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToFlexPwm0Sm0Extsync0 = 5U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Sm0Extsync0 = 6U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Sm0Extsync0 = 7U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToFlexPwm0Sm0Extsync0 = 9U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Sm0Extsync0 = 10U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToFlexPwm0Sm0Extsync0 = 11U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Sm0Extsync0 = 12U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToFlexPwm0Sm0Extsync0 = 13U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Sm0Extsync0 = 14U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToFlexPwm0Sm0Extsync0 = 15U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToFlexPwm0Sm0Extsync0 = 16U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToFlexPwm0Sm0Extsync0 = 17U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToFlexPwm0Sm0Extsync0 = 18U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToFlexPwm0Sm0Extsync0 = 19U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Sm0Extsync0 = 20U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Sm0Extsync0 = 21U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Sm0Extsync0 = 22U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Sm0Extsync0 = 23U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Sm0Extsync0 = 24U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Sm0Extsync0 = 25U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Sm0Extsync0 = 26U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Sm0Extsync0 = 27U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Sm0Extsync0 = 28U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Sm0Extsync0 = 29U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexPwm0Sm0Extsync0 = 30U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexPwm0Sm0Extsync0 = 31U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToFlexPwm0Sm0Extsync0 = 32U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToFlexPwm0Sm0Extsync0 = 33U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Sm0Extsync0 = 34U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Sm0Extsync0 = 35U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - - /*!< FlexPWM0_SM1_EXTSYNC1 input trigger connections. */ - kINPUTMUX_ArmTxevToFlexPwm0Sm1Extsync1 = 1U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToFlexPwm0Sm1Extsync1 = 2U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToFlexPwm0Sm1Extsync1 = 3U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToFlexPwm0Sm1Extsync1 = 4U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToFlexPwm0Sm1Extsync1 = 5U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Sm1Extsync1 = 6U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Sm1Extsync1 = 7U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToFlexPwm0Sm1Extsync1 = 9U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Sm1Extsync1 = 10U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToFlexPwm0Sm1Extsync1 = 11U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Sm1Extsync1 = 12U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToFlexPwm0Sm1Extsync1 = 13U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Sm1Extsync1 = 14U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToFlexPwm0Sm1Extsync1 = 15U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToFlexPwm0Sm1Extsync1 = 16U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToFlexPwm0Sm1Extsync1 = 17U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToFlexPwm0Sm1Extsync1 = 18U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToFlexPwm0Sm1Extsync1 = 19U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Sm1Extsync1 = 20U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Sm1Extsync1 = 21U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Sm1Extsync1 = 22U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Sm1Extsync1 = 23U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Sm1Extsync1 = 24U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Sm1Extsync1 = 25U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Sm1Extsync1 = 26U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Sm1Extsync1 = 27U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Sm1Extsync1 = 28U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Sm1Extsync1 = 29U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexPwm0Sm1Extsync1 = 30U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexPwm0Sm1Extsync1 = 31U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToFlexPwm0Sm1Extsync1 = 32U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToFlexPwm0Sm1Extsync1 = 33U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Sm1Extsync1 = 34U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Sm1Extsync1 = 35U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - - /*!< FlexPWM0_SM2_EXTSYNC2 input trigger connections. */ - kINPUTMUX_ArmTxevToFlexPwm0Sm2Extsync2 = 1U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToFlexPwm0Sm2Extsync2 = 2U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToFlexPwm0Sm2Extsync2 = 3U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToFlexPwm0Sm2Extsync2 = 4U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToFlexPwm0Sm2Extsync2 = 5U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Sm2Extsync2 = 6U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Sm2Extsync2 = 7U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToFlexPwm0Sm2Extsync2 = 9U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Sm2Extsync2 = 10U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToFlexPwm0Sm2Extsync2 = 11U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Sm2Extsync2 = 12U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToFlexPwm0Sm2Extsync2 = 13U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Sm2Extsync2 = 14U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToFlexPwm0Sm2Extsync2 = 15U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToFlexPwm0Sm2Extsync2 = 16U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToFlexPwm0Sm2Extsync2 = 17U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToFlexPwm0Sm2Extsync2 = 18U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToFlexPwm0Sm2Extsync2 = 19U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Sm2Extsync2 = 20U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Sm2Extsync2 = 21U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Sm2Extsync2 = 22U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Sm2Extsync2 = 23U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Sm2Extsync2 = 24U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Sm2Extsync2 = 25U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Sm2Extsync2 = 26U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Sm2Extsync2 = 27U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Sm2Extsync2 = 28U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Sm2Extsync2 = 29U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexPwm0Sm2Extsync2 = 30U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexPwm0Sm2Extsync2 = 31U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToFlexPwm0Sm2Extsync2 = 32U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToFlexPwm0Sm2Extsync2 = 33U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Sm2Extsync2 = 34U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Sm2Extsync2 = 35U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - - /*!< FlexPWM0_FAULT input trigger connections. */ - kINPUTMUX_ArmTxevToFlexPwm0Fault = 1U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToFlexPwm0Fault = 2U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToFlexPwm0Fault = 3U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToFlexPwm0Fault = 4U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToFlexPwm0Fault = 5U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Fault = 6U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Fault = 7U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToFlexPwm0Fault = 9U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Fault = 10U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToFlexPwm0Fault = 11U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Fault = 12U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToFlexPwm0Fault = 13U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Fault = 14U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToFlexPwm0Fault = 15U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToFlexPwm0Fault = 16U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToFlexPwm0Fault = 17U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToFlexPwm0Fault = 18U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToFlexPwm0Fault = 19U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Fault = 20U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Fault = 21U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Fault = 22U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Fault = 23U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Fault = 24U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Fault = 25U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Fault = 26U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Fault = 27U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Fault = 28U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Fault = 29U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexPwm0Fault = 30U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexPwm0Fault = 31U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToFlexPwm0Fault = 32U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToFlexPwm0Fault = 33U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Fault = 34U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Fault = 35U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - - /*!< FlexPWM0_FORCE input trigger connections. */ - kINPUTMUX_ArmTxevToFlexPwm0Force = 1U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToFlexPwm0Force = 2U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToFlexPwm0Force = 3U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToFlexPwm0Force = 4U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToFlexPwm0Force = 5U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Force = 6U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Force = 7U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToFlexPwm0Force = 9U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Force = 10U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToFlexPwm0Force = 11U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Force = 12U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToFlexPwm0Force = 13U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Force = 14U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToFlexPwm0Force = 15U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToFlexPwm0Force = 16U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToFlexPwm0Force = 17U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToFlexPwm0Force = 18U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToFlexPwm0Force = 19U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Force = 20U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Force = 21U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Force = 22U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Force = 23U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Force = 24U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Force = 25U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Force = 26U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Force = 27U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Force = 28U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Force = 29U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexPwm0Force = 30U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexPwm0Force = 31U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToFlexPwm0Force = 32U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToFlexPwm0Force = 33U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Force = 34U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Force = 35U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - - /*!< PWM0 external clock trigger. */ - kINPUTMUX_Clk16K1ToPwm0ExtClk = 1U + (PWM0_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_ClkInToPwm0ExtClk = 2U + (PWM0_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToPwm0ExtClk = 3U + (PWM0_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToPwm0ExtClk = 4U + (PWM0_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_ExttrigIn0ToPwm0ExtClk = 5U + (PWM0_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_ExttrigIn7ToPwm0ExtClk = 6U + (PWM0_EXT_CLK_REG << PMUX_SHIFT), - - /*!< AOI0 trigger input connections. */ - kINPUTMUX_Adc0Tcomp0ToAoi0Mux = 1U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToAoi0Mux = 2U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToAoi0Mux = 3U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToAoi0Mux = 4U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToAoi0Mux = 5U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToAoi0Mux = 6U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M0ToAoi0Mux = 8U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToAoi0Mux = 9U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToAoi0Mux = 10U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToAoi0Mux = 11U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToAoi0Mux = 12U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToAoi0Mux = 13U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToAoi0Mux = 14U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToAoi0Mux = 15U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToAoi0Mux = 16U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToAoi0Mux = 17U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToAoi0Mux = 18U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToAoi0Mux = 19U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToAoi0Mux = 20U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToAoi0Mux = 22U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToAoi0Mux = 23U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToAoi0Mux = 24U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToAoi0Mux = 25U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatchToAoi0Mux = 26U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToAoi0Mux = 27U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToAoi0Mux = 28U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToAoi0Mux = 29U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToAoi0Mux = 30U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToAoi0Mux = 31U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToAoi0Mux = 32U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToAoi0Mux = 35U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToAoi0Mux = 36U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToAoi0Mux = 37U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToAoi0Mux = 38U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToAoi0Mux = 39U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToAoi0Mux = 40U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToAoi0Mux = 41U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToAoi0Mux = 42U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToAoi0Mux = 43U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToAoi0Mux = 44U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToAoi0Mux = 45U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToAoi0Mux = 46U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToAoi0Mux = 47U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToAoi0Mux = 48U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToAoi0Mux = 49U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToAoi0Mux = 50U + (AOI0_MUX_REG << PMUX_SHIFT), - - /*!< USB-FS trigger input connections. */ - kINPUTMUX_Lpuart0TrgTxdataToUsbfsTrigger = 1U + (USBFS_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lpuart1TrgTxdataToUsbfsTrigger = 2U + (USBFS_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lpuart2TrgTxdataToUsbfsTrigger = 3U + (USBFS_TRIG_REG << PMUX_SHIFT), - - /*!< EXT trigger connections. */ - kINPUTMUX_ArmTxevToExtTrigger = 1U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToExtTrigger = 2U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToExtTrigger = 3U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToExtTrigger = 4U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToExtTrigger = 5U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToExtTrigger = 6U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToExtTrigger = 7U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpuart0ToExtTrigger = 9U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpuart1ToExtTrigger = 10U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpuart2ToExtTrigger = 11U + (EXT_TRIG0_REG << PMUX_SHIFT), - - /*!< LPI2C0 trigger input connections. */ - kINPUTMUX_ArmTxevToLpi2c0Trigger = 1U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToLpi2c0Trigger = 2U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToLpi2c0Trigger = 3U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToLpi2c0Trigger = 4U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToLpi2c0Trigger = 5U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToLpi2c0Trigger = 6U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToLpi2c0Trigger = 7U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M0ToLpi2c0Trigger = 9U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToLpi2c0Trigger = 10U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToLpi2c0Trigger = 11U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToLpi2c0Trigger = 12U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToLpi2c0Trigger = 13U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToLpi2c0Trigger = 14U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToLpi2c0Trigger = 15U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToLpi2c0Trigger = 17U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToLpi2c0Trigger = 18U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToLpi2c0Trigger = 19U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToLpi2c0Trigger = 20U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToLpi2c0Trigger = 21U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToLpi2c0Trigger = 22U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToLpi2c0Trigger = 23U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToLpi2c0Trigger = 24U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToLpi2c0Trigger = 25U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToLpi2c0Trigger = 26U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToLpi2c0Trigger = 27U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToLpi2c0Trigger = 28U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - - /*!< LPSPI0 trigger input connections. */ - kINPUTMUX_ArmTxevToLpspi0Trigger = 1U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToLpspi0Trigger = 2U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToLpspi0Trigger = 3U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToLpspi0Trigger = 4U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToLpspi0Trigger = 5U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToLpspi0Trigger = 6U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToLpspi0Trigger = 7U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M0ToLpspi0Trigger = 9U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToLpspi0Trigger = 10U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToLpspi0Trigger = 11U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToLpspi0Trigger = 12U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToLpspi0Trigger = 13U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToLpspi0Trigger = 14U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToLpspi0Trigger = 15U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToLpspi0Trigger = 17U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToLpspi0Trigger = 18U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToLpspi0Trigger = 19U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToLpspi0Trigger = 20U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToLpspi0Trigger = 21U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToLpspi0Trigger = 22U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToLpspi0Trigger = 23U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToLpspi0Trigger = 24U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToLpspi0Trigger = 25U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToLpspi0Trigger = 26U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToLpspi0Trigger = 27U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToLpspi0Trigger = 28U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - - /*!< LPSPI1 trigger input connections. */ - kINPUTMUX_ArmTxevToLpspi1Trigger = 1U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToLpspi1Trigger = 2U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToLpspi1Trigger = 3U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToLpspi1Trigger = 4U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToLpspi1Trigger = 5U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToLpspi1Trigger = 6U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToLpspi1Trigger = 7U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M0ToLpspi1Trigger = 9U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToLpspi1Trigger = 10U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToLpspi1Trigger = 11U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToLpspi1Trigger = 12U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToLpspi1Trigger = 13U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToLpspi1Trigger = 14U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToLpspi1Trigger = 15U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToLpspi1Trigger = 17U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToLpspi1Trigger = 18U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToLpspi1Trigger = 19U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToLpspi1Trigger = 20U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToLpspi1Trigger = 21U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToLpspi1Trigger = 22U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToLpspi1Trigger = 23U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToLpspi1Trigger = 24U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToLpspi1Trigger = 25U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToLpspi1Trigger = 26U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToLpspi1Trigger = 27U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToLpspi1Trigger = 28U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - - /*!< LPUART0 trigger input connections. */ - kINPUTMUX_ArmTxevToLpuart0Trigger = 1U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToLpuart0Trigger = 2U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToLpuart0Trigger = 3U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToLpuart0Trigger = 4U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToLpuart0Trigger = 5U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToLpuart0Trigger = 6U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToLpuart0Trigger = 7U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToLpuart0Trigger = 9U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToLpuart0Trigger = 10U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToLpuart0Trigger = 11U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToLpuart0Trigger = 12U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToLpuart0Trigger = 13U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToLpuart0Trigger = 14U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToLpuart0Trigger = 15U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToLpuart0Trigger = 17U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToLpuart0Trigger = 18U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToLpuart0Trigger = 19U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToLpuart0Trigger = 20U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToLpuart0Trigger = 21U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToLpuart0Trigger = 22U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToLpuart0Trigger = 23U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToLpuart0Trigger = 24U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToLpuart0Trigger = 25U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToLpuart0Trigger = 26U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToLpuart0Trigger = 27U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToLpuart0Trigger = 28U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToLpuart0Trigger = 29U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToLpuart0Trigger = 30U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToLpuart0Trigger = 31U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToLpuart0Trigger = 32U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToLpuart0Trigger = 34U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Usb0IppIndUartRxdUsbmuxToLpuart0Trigger = 35U + (LPUART0_TRIG_REG << PMUX_SHIFT), - - /*!< LPUART1 trigger input connections. */ - kINPUTMUX_ArmTxevToLpuart1Trigger = 1U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToLpuart1Trigger = 2U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToLpuart1Trigger = 3U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToLpuart1Trigger = 4U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToLpuart1Trigger = 5U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToLpuart1Trigger = 6U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToLpuart1Trigger = 7U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToLpuart1Trigger = 9U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToLpuart1Trigger = 10U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToLpuart1Trigger = 11U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToLpuart1Trigger = 12U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToLpuart1Trigger = 13U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToLpuart1Trigger = 14U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToLpuart1Trigger = 15U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToLpuart1Trigger = 17U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToLpuart1Trigger = 18U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToLpuart1Trigger = 19U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToLpuart1Trigger = 20U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToLpuart1Trigger = 21U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToLpuart1Trigger = 22U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToLpuart1Trigger = 23U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToLpuart1Trigger = 24U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToLpuart1Trigger = 25U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToLpuart1Trigger = 26U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToLpuart1Trigger = 27U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToLpuart1Trigger = 28U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToLpuart1Trigger = 29U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToLpuart1Trigger = 30U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToLpuart1Trigger = 31U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToLpuart1Trigger = 32U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToLpuart1Trigger = 34U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Usb0IppIndUartRxdUsbmuxToLpuart1Trigger = 35U + (LPUART1_TRIG_REG << PMUX_SHIFT), - - /*!< LPUART2 trigger input connections. */ - kINPUTMUX_ArmTxevToLpuart2Trigger = 1U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToLpuart2Trigger = 2U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToLpuart2Trigger = 3U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToLpuart2Trigger = 4U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToLpuart2Trigger = 5U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToLpuart2Trigger = 6U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToLpuart2Trigger = 7U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToLpuart2Trigger = 9U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToLpuart2Trigger = 10U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToLpuart2Trigger = 11U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToLpuart2Trigger = 12U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToLpuart2Trigger = 13U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToLpuart2Trigger = 14U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToLpuart2Trigger = 15U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToLpuart2Trigger = 17U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToLpuart2Trigger = 18U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToLpuart2Trigger = 19U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToLpuart2Trigger = 20U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToLpuart2Trigger = 21U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToLpuart2Trigger = 22U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToLpuart2Trigger = 23U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToLpuart2Trigger = 24U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToLpuart2Trigger = 25U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToLpuart2Trigger = 26U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToLpuart2Trigger = 27U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToLpuart2Trigger = 28U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToLpuart2Trigger = 29U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToLpuart2Trigger = 30U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToLpuart2Trigger = 31U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToLpuart2Trigger = 32U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToLpuart2Trigger = 34U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Usb0IppIndUartRxdUsbmuxToLpuart2Trigger = 35U + (LPUART2_TRIG_REG << PMUX_SHIFT), -} inputmux_connection_t; - -/*@}*/ - -/*@}*/ - -#endif /* _FSL_INPUTMUX_CONNECTIONS_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpadc.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpadc.c deleted file mode 100644 index c22741c4f58..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpadc.c +++ /dev/null @@ -1,977 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpadc.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpadc" -#endif - -#ifndef ADC_VERID_DIFFEN_MASK -#define ADC_VERID_DIFFEN_MASK (0x2U) -#endif /* ADC_VERID_DIFFEN_MASK */ - -#ifndef ADC_VERID_NUM_SEC_MASK -#define ADC_VERID_NUM_SEC_MASK (0x800U) -#endif /* ADC_VERID_NUM_SEC_MASK */ - -#define ADC_CMDL_CHANNEL_MODE_MASK (0x60U) -#define ADC_CMDL_CHANNEL_MODE_SHIFT (5U) -#define ADC_CMDL_CHANNEL_MODE(x) \ - (((uint32_t)(((uint32_t)(x)) << ADC_CMDL_CHANNEL_MODE_SHIFT)) & ADC_CMDL_CHANNEL_MODE_MASK) - -#define GET_ADC_CFG_TPRICTRL_VALUE(val) (((uint32_t)val) & 0x3U) - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES -#define GET_ADC_CFG_TRES_VALUE(val) ((((uint32_t)val) & 0x4U) >> 2U) -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES */ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES -#define GET_ADC_CFG_TCMDRES_VALUE(val) ((((uint32_t)val) & 0x8U) >> 3U) -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES */ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI) && FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI -#define GET_ADC_CFG_HPT_EXDI_VALUE(val) ((((uint32_t)val) & 0x10U) >> 4U) -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI) && FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI */ - -#if defined(LPADC_RSTS) -#define LPADC_RESETS_ARRAY LPADC_RSTS -#elif defined(ADC_RSTS) -#define LPADC_RESETS_ARRAY ADC_RSTS -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Get instance number for LPADC module. - * - * @param base LPADC peripheral base address - */ -static uint32_t LPADC_GetInstance(ADC_Type *base); - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ -/*! - * @brief Get gain conversion result . - * - * @param gainAdjustment gain adjustment value. - */ -static uint32_t LPADC_GetGainConvResult(float gainAdjustment); -#endif /* defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ */ - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to LPADC bases for each instance. */ -static ADC_Type *const s_lpadcBases[] = ADC_BASE_PTRS; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to LPADC clocks for each instance. */ -static const clock_ip_name_t s_lpadcClocks[] = LPADC_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#if defined(LPADC_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_lpadcResets[] = LPADC_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t LPADC_GetInstance(ADC_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - /* - * $Branch Coverage Justification$ - * (instance >= ARRAY_SIZE(s_lpadcBases)) not covered. The peripheral base - * address is always valid and checked by assert. - */ - for (instance = 0; instance < ARRAY_SIZE(s_lpadcBases); instance++) - { - /* - * $Branch Coverage Justification$ - * (s_lpadcBases[instance] != base) not covered. The peripheral base - * address is always valid and checked by assert. - */ - if (s_lpadcBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_lpadcBases)); - - return instance; -} - -#if (defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) -/*! - * brief Get gain conversion Result . - * - * param gainAdjustment gain adjustment value. - */ -static uint32_t LPADC_GetGainConvResult(float gainAdjustment) -{ - uint16_t i = 0U; - uint32_t tmp32 = 0U; - uint32_t GCRa[17] = {0}; - uint32_t GCALR = 0U; - - for (i = 0x11U; i > 0U; i--) - { - tmp32 = (uint32_t)((gainAdjustment) / ((float)(1.0 / (double)(1U << (0x10U - (i - 1U)))))); - GCRa[i - 1U] = tmp32; - gainAdjustment = gainAdjustment - ((float)tmp32) * ((float)(1.0 / (double)(1U << (0x10U - (i - 1U))))); - } - /* Get GCALR value calculated */ - for (i = 0x11U; i > 0U; i--) - { - GCALR += GCRa[i - 1U] * ((uint32_t)(1UL << (uint32_t)(i - 1UL))); - } - - /* to return GCALR value calculated */ - return GCALR; -} -#endif /* defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ */ - -/*! - * brief Initializes the LPADC module. - * - * param base LPADC peripheral base address. - * param config Pointer to configuration structure. See "lpadc_config_t". - */ -void LPADC_Init(ADC_Type *base, const lpadc_config_t *config) -{ - /* Check if the pointer is available. */ - assert(config != NULL); - - uint32_t tmp32 = 0U; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock for LPADC instance. */ - (void)CLOCK_EnableClock(s_lpadcClocks[LPADC_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(LPADC_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_lpadcResets[LPADC_GetInstance(base)]); -#endif - - /* Reset the module. */ - LPADC_DoResetConfig(base); -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - LPADC_DoResetFIFO0(base); - LPADC_DoResetFIFO1(base); -#else - LPADC_DoResetFIFO(base); -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ - - /* Disable the module before setting configuration. */ - LPADC_Enable(base, false); - - /* Configure the module generally. */ - if (config->enableInDozeMode) - { - base->CTRL &= ~ADC_CTRL_DOZEN_MASK; - } - else - { - base->CTRL |= ADC_CTRL_DOZEN_MASK; - } - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS - /* Set calibration average mode. */ - base->CTRL |= ADC_CTRL_CAL_AVGS(config->conversionAverageMode); -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS */ - -/* ADCx_CFG. */ -#if defined(FSL_FEATURE_LPADC_HAS_CFG_ADCKEN) && FSL_FEATURE_LPADC_HAS_CFG_ADCKEN - if (config->enableInternalClock) - { - tmp32 |= ADC_CFG_ADCKEN_MASK; - } -#endif /* FSL_FEATURE_LPADC_HAS_CFG_ADCKEN */ -#if defined(FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG) && FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG - if (config->enableVref1LowVoltage) - { - tmp32 |= ADC_CFG_VREF1RNG_MASK; - } -#endif /* FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG */ - if (config->enableAnalogPreliminary) - { - tmp32 |= ADC_CFG_PWREN_MASK; - } - tmp32 |= (ADC_CFG_PUDLY(config->powerUpDelay) /* Power up delay. */ - | ADC_CFG_REFSEL(config->referenceVoltageSource) /* Reference voltage. */ -#if defined(FSL_FEATURE_LPADC_HAS_CFG_PWRSEL) && (FSL_FEATURE_LPADC_HAS_CFG_PWRSEL == 1U) - | ADC_CFG_PWRSEL(config->powerLevelMode) /* Power configuration. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_PWRSEL) && (FSL_FEATURE_LPADC_HAS_CFG_PWRSEL == 1U) */ - ); - - tmp32 |= ADC_CFG_TPRICTRL(GET_ADC_CFG_TPRICTRL_VALUE(config->triggerPriorityPolicy)); - -#if (defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES) - tmp32 |= ADC_CFG_TRES(GET_ADC_CFG_TRES_VALUE(config->triggerPriorityPolicy)); -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES */ - -#if (defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) - tmp32 |= ADC_CFG_TCMDRES(GET_ADC_CFG_TCMDRES_VALUE(config->triggerPriorityPolicy)); -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES */ - -#if (defined(FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI) && FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI) - tmp32 |= ADC_CFG_HPT_EXDI(GET_ADC_CFG_HPT_EXDI_VALUE(config->triggerPriorityPolicy)); -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI) && FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI */ - - base->CFG = tmp32; - - /* ADCx_PAUSE. */ - if (config->enableConvPause) - { - base->PAUSE = ADC_PAUSE_PAUSEEN_MASK | ADC_PAUSE_PAUSEDLY(config->convPauseDelay); - } - else - { - base->PAUSE = 0U; - } - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - /* ADCx_FCTRL0. */ - base->FCTRL[0] = ADC_FCTRL_FWMARK(config->FIFO0Watermark); - /* ADCx_FCTRL1. */ - base->FCTRL[1] = ADC_FCTRL_FWMARK(config->FIFO1Watermark); -#else - /* ADCx_FCTRL. */ - base->FCTRL = ADC_FCTRL_FWMARK(config->FIFOWatermark); -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ - - /* Enable the module after setting configuration. */ - LPADC_Enable(base, true); -} - -/*! - * brief Gets an available pre-defined settings for initial configuration. - * - * This function initializes the converter configuration structure with an available settings. The default values are: - * code - * config->enableInDozeMode = true; - * config->conversionAverageMode = kLPADC_ConversionAverage1; - * config->enableAnalogPreliminary = false; - * config->powerUpDelay = 0x80; - * config->referenceVoltageSource = kLPADC_ReferenceVoltageAlt1; - * config->powerLevelMode = kLPADC_PowerLevelAlt1; - * config->triggerPriorityPolicy = kLPADC_TriggerPriorityPreemptImmediately; - * config->enableConvPause = false; - * config->convPauseDelay = 0U; - * config->FIFO0Watermark = 0U; - * config->FIFO1Watermark = 0U; - * config->FIFOWatermark = 0U; - * endcode - * param config Pointer to configuration structure. - */ -void LPADC_GetDefaultConfig(lpadc_config_t *config) -{ - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_ADCKEN) && FSL_FEATURE_LPADC_HAS_CFG_ADCKEN - config->enableInternalClock = false; -#endif /* FSL_FEATURE_LPADC_HAS_CFG_ADCKEN */ -#if defined(FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG) && FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG - config->enableVref1LowVoltage = false; -#endif /* FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG */ - config->enableInDozeMode = true; -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS - /* Set calibration average mode. */ - config->conversionAverageMode = kLPADC_ConversionAverage1; -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS */ - config->enableAnalogPreliminary = false; - config->powerUpDelay = 0x80; - config->referenceVoltageSource = kLPADC_ReferenceVoltageAlt1; -#if defined(FSL_FEATURE_LPADC_HAS_CFG_PWRSEL) && (FSL_FEATURE_LPADC_HAS_CFG_PWRSEL == 1U) - config->powerLevelMode = kLPADC_PowerLevelAlt1; -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_PWRSEL) && (FSL_FEATURE_LPADC_HAS_CFG_PWRSEL == 1U) */ - config->triggerPriorityPolicy = kLPADC_TriggerPriorityPreemptImmediately; - config->enableConvPause = false; - config->convPauseDelay = 0U; -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - config->FIFO0Watermark = 0U; - config->FIFO1Watermark = 0U; -#else - config->FIFOWatermark = 0U; -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ -} - -/*! - * brief De-initializes the LPADC module. - * - * param base LPADC peripheral base address. - */ -void LPADC_Deinit(ADC_Type *base) -{ - /* Disable the module. */ - LPADC_Enable(base, false); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate the clock. */ - (void)CLOCK_DisableClock(s_lpadcClocks[LPADC_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) -/*! - * brief Get the result in conversion FIFOn. - * - * param base LPADC peripheral base address. - * param result Pointer to structure variable that keeps the conversion result in conversion FIFOn. - * param index Result FIFO index. - * - * return Status whether FIFOn entry is valid. - */ -bool LPADC_GetConvResult(ADC_Type *base, lpadc_conv_result_t *result, uint8_t index) -{ - assert(result != NULL); /* Check if the input pointer is available. */ - - uint32_t tmp32 = 0U; - - tmp32 = base->RESFIFO[index]; - - if (ADC_RESFIFO_VALID_MASK != (tmp32 & ADC_RESFIFO_VALID_MASK)) - { - return false; /* FIFO is empty. Discard any read from RESFIFO. */ - } - - result->commandIdSource = (tmp32 & ADC_RESFIFO_CMDSRC_MASK) >> ADC_RESFIFO_CMDSRC_SHIFT; - result->loopCountIndex = (tmp32 & ADC_RESFIFO_LOOPCNT_MASK) >> ADC_RESFIFO_LOOPCNT_SHIFT; - result->triggerIdSource = (tmp32 & ADC_RESFIFO_TSRC_MASK) >> ADC_RESFIFO_TSRC_SHIFT; - result->convValue = (uint16_t)(tmp32 & ADC_RESFIFO_D_MASK); - - return true; -} -/*! - * brief Get the result in conversion FIFOn using blocking method. - * - * param base LPADC peripheral base address. - * param result Pointer to structure variable that keeps the conversion result in conversion FIFOn. - * param index Result FIFO index. - */ -void LPADC_GetConvResultBlocking(ADC_Type *base, lpadc_conv_result_t *result, uint8_t index) -{ - assert(result != NULL); /* Check if the input pointer is available. */ - - uint32_t tmp32 = 0U; - - tmp32 = base->RESFIFO[index]; - - while (ADC_RESFIFO_VALID_MASK != (tmp32 & ADC_RESFIFO_VALID_MASK)) - { - tmp32 = base->RESFIFO[index]; - } - - result->commandIdSource = (tmp32 & ADC_RESFIFO_CMDSRC_MASK) >> ADC_RESFIFO_CMDSRC_SHIFT; - result->loopCountIndex = (tmp32 & ADC_RESFIFO_LOOPCNT_MASK) >> ADC_RESFIFO_LOOPCNT_SHIFT; - result->triggerIdSource = (tmp32 & ADC_RESFIFO_TSRC_MASK) >> ADC_RESFIFO_TSRC_SHIFT; - result->convValue = (uint16_t)(tmp32 & ADC_RESFIFO_D_MASK); -} -#else -/*! - * brief Get the result in conversion FIFO. - * - * param base LPADC peripheral base address. - * param result Pointer to structure variable that keeps the conversion result in conversion FIFO. - * - * return Status whether FIFO entry is valid. - */ -bool LPADC_GetConvResult(ADC_Type *base, lpadc_conv_result_t *result) -{ - assert(result != NULL); /* Check if the input pointer is available. */ - - uint32_t tmp32 = 0U; - - tmp32 = base->RESFIFO; - - if (ADC_RESFIFO_VALID_MASK != (tmp32 & ADC_RESFIFO_VALID_MASK)) - { - return false; /* FIFO is empty. Discard any read from RESFIFO. */ - } - - result->commandIdSource = (tmp32 & ADC_RESFIFO_CMDSRC_MASK) >> ADC_RESFIFO_CMDSRC_SHIFT; - result->loopCountIndex = (tmp32 & ADC_RESFIFO_LOOPCNT_MASK) >> ADC_RESFIFO_LOOPCNT_SHIFT; - result->triggerIdSource = (tmp32 & ADC_RESFIFO_TSRC_MASK) >> ADC_RESFIFO_TSRC_SHIFT; - result->convValue = (uint16_t)(tmp32 & ADC_RESFIFO_D_MASK); - - return true; -} -/*! - * @brief Get the result in conversion FIFO using blocking method. - * - * @param base LPADC peripheral base address. - * @param result Pointer to structure variable that keeps the conversion result in conversion FIFO. - */ -void LPADC_GetConvResultBlocking(ADC_Type *base, lpadc_conv_result_t *result) -{ - assert(result != NULL); /* Check if the input pointer is available. */ - - uint32_t tmp32 = 0U; - - tmp32 = base->RESFIFO; - - while (ADC_RESFIFO_VALID_MASK != (tmp32 & ADC_RESFIFO_VALID_MASK)) - { - tmp32 = base->RESFIFO; - } - - result->commandIdSource = (tmp32 & ADC_RESFIFO_CMDSRC_MASK) >> ADC_RESFIFO_CMDSRC_SHIFT; - result->loopCountIndex = (tmp32 & ADC_RESFIFO_LOOPCNT_MASK) >> ADC_RESFIFO_LOOPCNT_SHIFT; - result->triggerIdSource = (tmp32 & ADC_RESFIFO_TSRC_MASK) >> ADC_RESFIFO_TSRC_SHIFT; - result->convValue = (uint16_t)(tmp32 & ADC_RESFIFO_D_MASK); -} -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ - -/*! - * brief Configure the conversion trigger source. - * - * Each programmable trigger can launch the conversion command in command buffer. - * - * param base LPADC peripheral base address. - * param triggerId ID for each trigger. Typically, the available value range is from 0 to 3. - * param config Pointer to configuration structure. See to #lpadc_conv_trigger_config_t. - */ -void LPADC_SetConvTriggerConfig(ADC_Type *base, uint32_t triggerId, const lpadc_conv_trigger_config_t *config) -{ - assert(triggerId < ADC_TCTRL_COUNT); /* Check if the triggerId is available in this device. */ - assert(config != NULL); /* Check if the input pointer is available. */ - - uint32_t tmp32; - - tmp32 = ADC_TCTRL_TCMD(config->targetCommandId) /* Trigger command select. */ - | ADC_TCTRL_TDLY(config->delayPower) /* Trigger delay select. */ - | ADC_TCTRL_TPRI(config->priority) /* Trigger priority setting. */ -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - | ADC_TCTRL_FIFO_SEL_A(config->channelAFIFOSelect) -#if !(defined(FSL_FEATURE_LPADC_HAS_NO_TCTRL_FIFO_SEL_B) && FSL_FEATURE_LPADC_HAS_NO_TCTRL_FIFO_SEL_B) - | ADC_TCTRL_FIFO_SEL_B(config->channelBFIFOSelect) -#endif /* FSL_FEATURE_LPADC_HAS_NO_TCTRL_FIFO_SEL_B */ -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ - ; - if (config->enableHardwareTrigger) - { - tmp32 |= ADC_TCTRL_HTEN_MASK; - } - - base->TCTRL[triggerId] = tmp32; -} - -/*! - * brief Gets an available pre-defined settings for trigger's configuration. - * - * This function initializes the trigger's configuration structure with an available settings. The default values are: - * code - * config->targetCommandId = 0U; - * config->delayPower = 0U; - * config->priority = 0U; - * config->channelAFIFOSelect = 0U; - * config->channelBFIFOSelect = 0U; - * config->enableHardwareTrigger = false; - * endcode - * param config Pointer to configuration structure. - */ -void LPADC_GetDefaultConvTriggerConfig(lpadc_conv_trigger_config_t *config) -{ - assert(config != NULL); /* Check if the input pointer is available. */ - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->targetCommandId = 0U; - config->delayPower = 0U; - config->priority = 0U; -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - config->channelAFIFOSelect = 0U; - config->channelBFIFOSelect = 0U; -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ - config->enableHardwareTrigger = false; -} - -/*! - * brief Configure conversion command. - * - * note The number of compare value register on different chips is different, that is mean in some chips, some - * command buffers do not have the compare functionality. - * - * param base LPADC peripheral base address. - * param commandId ID for command in command buffer. Typically, the available value range is 1 - 15. - * param config Pointer to configuration structure. See to #lpadc_conv_command_config_t. - */ -void LPADC_SetConvCommandConfig(ADC_Type *base, uint32_t commandId, const lpadc_conv_command_config_t *config) -{ - assert(commandId < (ADC_CMDL_COUNT + 1U)); /* Check if the commandId is available on this device. */ - assert(config != NULL); /* Check if the input pointer is available. */ - - uint32_t tmp32 = 0; - - commandId--; /* The available command number are 1-15, while the index of register group are 0-14. */ - - /* ADCx_CMDL. */ - tmp32 = ADC_CMDL_ADCH(config->channelNumber); /* Channel number. */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTB_ADCH) && FSL_FEATURE_LPADC_HAS_CMDL_ALTB_ADCH - tmp32 |= ADC_CMDL_ALTB_ADCH(config->channelBNumber); /* Alternate channel B number. */ -#endif -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_CSCALE) && FSL_FEATURE_LPADC_HAS_CMDL_CSCALE - tmp32 |= ADC_CMDL_CSCALE(config->sampleScaleMode); /* Full/Part scale input voltage. */ -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_CSCALE */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE) && FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE - tmp32 |= ADC_CMDL_ALTB_CSCALE(config->channelBScaleMode); /* Alternate channel B full/Part scale input voltage. */ -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE */ - -#if !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_DIFF) && FSL_FEATURE_LPADC_HAS_CMDL_DIFF - assert(((config->sampleChannelMode >= kLPADC_SampleChannelDiffBothSideAB) && - (((base->VERID) & ADC_VERID_DIFFEN_MASK) != 0U)) || - (config->sampleChannelMode < kLPADC_SampleChannelDiffBothSideAB)); -#endif /* defined(FSL_FEATURE_LPADC_HAS_CMDL_DIFF) && FSL_FEATURE_LPADC_HAS_CMDL_DIFF */ - -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_CTYPE) && FSL_FEATURE_LPADC_HAS_CMDL_CTYPE - assert(((config->sampleChannelMode == kLPADC_SampleChannelDiffBothSide) && - (((base->VERID) & ADC_VERID_DIFFEN_MASK) != 0U)) || - ((config->sampleChannelMode == kLPADC_SampleChannelDualSingleEndBothSide) && - (((base->VERID) & ADC_VERID_NUM_SEC_MASK) != 0U)) || - (config->sampleChannelMode < kLPADC_SampleChannelDualSingleEndBothSide)); -#endif /* defined(FSL_FEATURE_LPADC_HAS_CMDL_CTYPE) && FSL_FEATURE_LPADC_HAS_CMDL_CTYPE */ -#endif /* !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) */ - - tmp32 |= ADC_CMDL_CHANNEL_MODE(config->sampleChannelMode); - -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_MODE) && FSL_FEATURE_LPADC_HAS_CMDL_MODE - tmp32 |= ADC_CMDL_MODE(config->conversionResolutionMode); -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_MODE */ - -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN) && FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN - /* Enable alternate channel B.*/ - if (config->enableChannelB) - { - tmp32 |= ADC_CMDL_ALTBEN_MASK; - } -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN */ - - base->CMD[commandId].CMDL = tmp32; - - /* ADCx_CMDH. */ - tmp32 = ADC_CMDH_NEXT(config->chainedNextCommandNumber) /* Next Command Select. */ - | ADC_CMDH_LOOP(config->loopCount) /* Loop Count Select. */ - | ADC_CMDH_AVGS(config->hardwareAverageMode) /* Hardware Average Select. */ - | ADC_CMDH_STS(config->sampleTimeMode) /* Sample Time Select. */ - | ADC_CMDH_CMPEN(config->hardwareCompareMode); /* Hardware compare enable. */ -#if (defined(FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG) && FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG) - if (config->enableWaitTrigger) - { - tmp32 |= ADC_CMDH_WAIT_TRIG_MASK; /* Wait trigger enable. */ - } -#endif /* FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG */ - - if (config->enableAutoChannelIncrement) - { - tmp32 |= ADC_CMDH_LWI_MASK; - } - base->CMD[commandId].CMDH = tmp32; - - /* Hardware compare settings. - * Not all Command Buffers have an associated Compare Value register. The compare function is only available on - * Command Buffers that have a corresponding Compare Value register. Therefore, assertion judgment needs to be - * made before setting the CV register. - */ - - if ((kLPADC_HardwareCompareDisabled != config->hardwareCompareMode) && (commandId < ADC_CV_COUNT)) - { - /* Set CV register. */ - base->CV[commandId] = (ADC_CV_CVH(config->hardwareCompareValueHigh) /* Compare value high. */ - | ADC_CV_CVL(config->hardwareCompareValueLow)); /* Compare value low. */ - } -} - -/*! - * brief Gets an available pre-defined settings for conversion command's configuration. - * - * This function initializes the conversion command's configuration structure with an available settings. The default - * values are: - * code - * config->sampleScaleMode = kLPADC_SampleFullScale; - * config->channelBScaleMode = kLPADC_SampleFullScale; - * config->sampleChannelMode = kLPADC_SampleChannelSingleEndSideA; - * config->channelNumber = 0U; - * config->channelBNumber = 0U; - * config->chainedNextCommandNumber = 0U; - * config->enableAutoChannelIncrement = false; - * config->loopCount = 0U; - * config->hardwareAverageMode = kLPADC_HardwareAverageCount1; - * config->sampleTimeMode = kLPADC_SampleTimeADCK3; - * config->hardwareCompareMode = kLPADC_HardwareCompareDisabled; - * config->hardwareCompareValueHigh = 0U; - * config->hardwareCompareValueLow = 0U; - * config->conversionResolutionMode = kLPADC_ConversionResolutionStandard; - * config->enableWaitTrigger = false; - * config->enableChannelB = false; - * endcode - * param config Pointer to configuration structure. - */ -void LPADC_GetDefaultConvCommandConfig(lpadc_conv_command_config_t *config) -{ - assert(config != NULL); /* Check if the input pointer is available. */ - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_CSCALE) && FSL_FEATURE_LPADC_HAS_CMDL_CSCALE - config->sampleScaleMode = kLPADC_SampleFullScale; -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_CSCALE */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE) && FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE - config->channelBScaleMode = kLPADC_SampleFullScale; -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE */ - config->sampleChannelMode = kLPADC_SampleChannelSingleEndSideA; - config->channelNumber = 0U; -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTB_ADCH) && FSL_FEATURE_LPADC_HAS_CMDL_ALTB_ADCH - config->channelBNumber = 0U; -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE */ - config->chainedNextCommandNumber = 0U; /* No next command defined. */ - config->enableAutoChannelIncrement = false; - config->loopCount = 0U; - config->hardwareAverageMode = kLPADC_HardwareAverageCount1; - config->sampleTimeMode = kLPADC_SampleTimeADCK3; - config->hardwareCompareMode = kLPADC_HardwareCompareDisabled; - config->hardwareCompareValueHigh = 0U; /* No used. */ - config->hardwareCompareValueLow = 0U; /* No used. */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_MODE) && FSL_FEATURE_LPADC_HAS_CMDL_MODE - config->conversionResolutionMode = kLPADC_ConversionResolutionStandard; -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_MODE */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG) && FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG - config->enableWaitTrigger = false; -#endif /* FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN) && FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN - config->enableChannelB = false; /* Enable alternate channel B.*/ -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN */ -} - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_CALOFS) && FSL_FEATURE_LPADC_HAS_CFG_CALOFS -/*! - * brief Enable the calibration function. - * - * When CALOFS is set, the ADC is configured to perform a calibration function anytime the ADC executes - * a conversion. Any channel selected is ignored and the value returned in the RESFIFO is a signed value - * between -31 and 31. -32 is not a valid and is never a returned value. Software should copy the lower 6- - * bits of the conversion result stored in the RESFIFO after a completed calibration conversion to the - * OFSTRIM field. The OFSTRIM field is used in normal operation for offset correction. - * - * param base LPADC peripheral base address. - * param enable switcher to the calibration function. - */ -void LPADC_EnableCalibration(ADC_Type *base, bool enable) -{ - LPADC_Enable(base, false); - if (enable) - { - base->CFG |= ADC_CFG_CALOFS_MASK; - } - else - { - base->CFG &= ~ADC_CFG_CALOFS_MASK; - } - LPADC_Enable(base, true); -} - -#if defined(FSL_FEATURE_LPADC_HAS_OFSTRIM) && FSL_FEATURE_LPADC_HAS_OFSTRIM -/*! - * brief Do auto calibration. - * - * Calibration function should be executed before using converter in application. It used the software trigger and a - * dummy conversion, get the offset and write them into the OFSTRIM register. It called some of functional API - * including: -LPADC_EnableCalibration(...) -LPADC_LPADC_SetOffsetValue(...) -LPADC_SetConvCommandConfig(...) - * -LPADC_SetConvTriggerConfig(...) - * - * param base LPADC peripheral base address. - */ -void LPADC_DoAutoCalibration(ADC_Type *base) -{ - assert(0u == LPADC_GetConvResultCount(base)); - - uint32_t mLpadcCMDL; - uint32_t mLpadcCMDH; - uint32_t mLpadcTrigger; - lpadc_conv_trigger_config_t mLpadcTriggerConfigStruct; - lpadc_conv_command_config_t mLpadcCommandConfigStruct; - lpadc_conv_result_t mLpadcResultConfigStruct; - - /* Enable the calibration function. */ - LPADC_EnableCalibration(base, true); - - /* Keep the CMD and TRG state here and restore it later if the calibration completes.*/ - mLpadcCMDL = base->CMD[0].CMDL; /* CMD1L. */ - mLpadcCMDH = base->CMD[0].CMDH; /* CMD1H. */ - mLpadcTrigger = base->TCTRL[0]; /* Trigger0. */ - - /* Set trigger0 configuration - for software trigger. */ - LPADC_GetDefaultConvTriggerConfig(&mLpadcTriggerConfigStruct); - mLpadcTriggerConfigStruct.targetCommandId = 1U; /* CMD1 is executed. */ - LPADC_SetConvTriggerConfig(base, 0U, &mLpadcTriggerConfigStruct); /* Configurate the trigger0. */ - - /* Set conversion CMD configuration. */ - LPADC_GetDefaultConvCommandConfig(&mLpadcCommandConfigStruct); - mLpadcCommandConfigStruct.hardwareAverageMode = kLPADC_HardwareAverageCount128; - LPADC_SetConvCommandConfig(base, 1U, &mLpadcCommandConfigStruct); /* Set CMD1 configuration. */ - - /* Do calibration. */ - LPADC_DoSoftwareTrigger(base, 1U); /* 1U is trigger0 mask. */ - while (!LPADC_GetConvResult(base, &mLpadcResultConfigStruct)) - { - } - /* The valid bits of data are bits 14:3 in the RESFIFO register. */ - LPADC_SetOffsetValue(base, (uint32_t)(mLpadcResultConfigStruct.convValue) >> 3UL); - /* Disable the calibration function. */ - LPADC_EnableCalibration(base, false); - - /* restore CMD and TRG registers. */ - base->CMD[0].CMDL = mLpadcCMDL; /* CMD1L. */ - base->CMD[0].CMDH = mLpadcCMDH; /* CMD1H. */ - base->TCTRL[0] = mLpadcTrigger; /* Trigger0. */ -} -#endif /* FSL_FEATURE_LPADC_HAS_OFSTRIM */ -#endif /* FSL_FEATURE_LPADC_HAS_CFG_CALOFS */ - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFS) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFS -/*! - * brief Do offset calibration. - * - * param base LPADC peripheral base address. - */ -void LPADC_DoOffsetCalibration(ADC_Type *base) -{ - LPADC_EnableOffsetCalibration(base, true); - while (ADC_STAT_CAL_RDY_MASK != (base->STAT & ADC_STAT_CAL_RDY_MASK)) - { - } -} - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ -/*! - * brief Do auto calibration. - * - * param base LPADC peripheral base address. - */ -void LPADC_DoAutoCalibration(ADC_Type *base) -{ - LPADC_PrepareAutoCalibration(base); - LPADC_FinishAutoCalibration(base); -} - -/*! - * brief Prepare auto calibration, LPADC_FinishAutoCalibration has to be called before using the LPADC. - * LPADC_DoAutoCalibration has been split in two API to avoid to be stuck too long in the function. - * - * param base LPADC peripheral base address. - */ -void LPADC_PrepareAutoCalibration(ADC_Type *base) -{ -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - assert((0U == LPADC_GetConvResultCount(base, 0)) && (0U == LPADC_GetConvResultCount(base, 1))); -#else /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 1)) */ - assert(LPADC_GetConvResultCount(base) == 0U); -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) */ - - /* Request gain calibration. */ - base->CTRL |= ADC_CTRL_CAL_REQ_MASK; -} - -/*! - * brief Finish auto calibration start with LPADC_PrepareAutoCalibration. - * - * param base LPADC peripheral base address. - */ -void LPADC_FinishAutoCalibration(ADC_Type *base) -{ -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE - int32_t GCCa; - int32_t GCCb; - float GCRa; - float GCRb; -#else - uint32_t GCCa; - float GCRa; -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - uint32_t GCCb; - float GCRb; -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE */ - - while ((ADC_GCC_RDY_MASK != (base->GCC[0] & ADC_GCC_RDY_MASK)) -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - || (ADC_GCC_RDY_MASK != (base->GCC[1] & ADC_GCC_RDY_MASK)) -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ - ) - { - } - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE - GCCa = (int32_t)(base->GCC[0] & ADC_GCC_GAIN_CAL_MASK); - GCCb = (int32_t)(base->GCC[1] & ADC_GCC_GAIN_CAL_MASK); - if (0U != ((base->GCC[0]) & 0x8000U)) - { - GCCa = GCCa - 0x10000; - GCRa = (float)((131072.0) / - (131072.0 - (double)GCCa)); /* Gain_CalA = (131072.0 / (131072-(ADC_GCC_GAIN_CAL(ADC->GCC[0]))*/ - base->GCR[0] = LPADC_GetGainConvResult(GCRa); /* write A side GCALR. */ - } - - if (0U != ((base->GCC[1]) & 0x8000U)) - { - GCCb = GCCb - 0x10000; - GCRb = (float)((131072.0) / - (131072.0 - (double)GCCb)); /* Gain_CalB = (131072.0 / (131072-(ADC_GCC_GAIN_CAL(ADC->GCC[1]))*/ - base->GCR[1] = LPADC_GetGainConvResult(GCRb); /* write B side GCALR. */ - } -#else - /* Calculate gain offset. */ - GCCa = (base->GCC[0] & ADC_GCC_GAIN_CAL_MASK); - GCRa = (float)((131072.0) / - (131072.0 - (double)GCCa)); /* Gain_CalA = (131072.0 / (131072-(ADC_GCC_GAIN_CAL(ADC->GCC[0]))*/ - base->GCR[0] = LPADC_GetGainConvResult(GCRa); /* write A side GCALR. */ - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - GCCb = (base->GCC[1] & ADC_GCC_GAIN_CAL_MASK); - GCRb = (float)((131072.0) / - (131072.0 - (double)GCCb)); /* Gain_CalB = (131072.0 / (131072-(ADC_GCC_GAIN_CAL(ADC->GCC[1]))*/ - base->GCR[1] = LPADC_GetGainConvResult(GCRb); /* write B side GCALR. */ -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE */ - /* Indicate the values are valid. */ - base->GCR[0] |= ADC_GCR_RDY_MASK; -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - base->GCR[1] |= ADC_GCR_RDY_MASK; -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ - - while (ADC_STAT_CAL_RDY_MASK != (base->STAT & ADC_STAT_CAL_RDY_MASK)) - { - } -} -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ */ - -/*! - * brief Get calibration value into the memory which is defined by invoker. - * - * note Please note the ADC will be disabled temporary. - * note This function should be used after finish calibration. - * - * param base LPADC peripheral base address. - * param ptrCalibrationValue Pointer to lpadc_calibration_value_t structure, this memory block should be always powered - * on even in low power modes. - */ -void LPADC_GetCalibrationValue(ADC_Type *base, lpadc_calibration_value_t *ptrCalibrationValue) -{ - assert(ptrCalibrationValue != NULL); - - bool adcEnabled = false; - - /* Check if ADC is enabled. */ - if ((base->CTRL & ADC_CTRL_ADCEN_MASK) != 0UL) - { - LPADC_Enable(base, false); - adcEnabled = true; - } - -#if (defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) - uint32_t i; - for (i = 0UL; i < 33UL; i++) - { -#if defined(ADC_CAL_GAR0_CAL_GAR_VAL_MASK) - ptrCalibrationValue->generalCalibrationValueA[i] = - (uint16_t)((*(((volatile uint32_t *)(&(base->CAL_GAR0))) + i)) & 0xFFFFU); -#if !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) - ptrCalibrationValue->generalCalibrationValueB[i] = - (uint16_t)((*(((volatile uint32_t *)(&(base->CAL_GBR0))) + i)) & 0xFFFFU); -#endif /* (defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) */ -#else - ptrCalibrationValue->generalCalibrationValueA[i] = - (uint16_t)((*(((volatile uint32_t *)(&(base->CAL_GAR[0]))) + i)) & 0xFFFFU); -#if !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) - ptrCalibrationValue->generalCalibrationValueB[i] = - (uint16_t)((*(((volatile uint32_t *)(&(base->CAL_GBR[0]))) + i)) & 0xFFFFU); -#endif /* (defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) */ - -#endif /* defined(ADC_CAL_GAR0_CAL_GAR_VAL_MASK) */ - } -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ */ - - ptrCalibrationValue->gainCalibrationResultA = (uint16_t)(base->GCR[0] & ADC_GCR_GCALR_MASK); -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - ptrCalibrationValue->gainCalibrationResultB = (uint16_t)(base->GCR[1] & ADC_GCR_GCALR_MASK); -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ - - if (adcEnabled) - { - LPADC_Enable(base, true); - } -} - -/*! - * brief Set calibration value into ADC calibration registers. - * - * note Please note the ADC will be disabled temporary. - * - * param base LPADC peripheral base address. - * param ptrCalibrationValue Pointer to lpadc_calibration_value_t structure which contains ADC's calibration value. - */ -void LPADC_SetCalibrationValue(ADC_Type *base, const lpadc_calibration_value_t *ptrCalibrationValue) -{ - assert(ptrCalibrationValue != NULL); - - bool adcEnabled = false; - - /* Check if ADC is enabled. */ - if ((base->CTRL & ADC_CTRL_ADCEN_MASK) != 0UL) - { - LPADC_Enable(base, false); - adcEnabled = true; - } - -#if (defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) - for (uint32_t i = 0UL; i < 33UL; i++) - { -#if defined(ADC_CAL_GAR0_CAL_GAR_VAL_MASK) - *(((volatile uint32_t *)(&(base->CAL_GAR0))) + i) = ptrCalibrationValue->generalCalibrationValueA[i]; -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - *(((volatile uint32_t *)(&(base->CAL_GBR0))) + i) = ptrCalibrationValue->generalCalibrationValueB[i]; -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ -#else - *(((volatile uint32_t *)(&(base->CAL_GAR[0]))) + i) = ptrCalibrationValue->generalCalibrationValueA[i]; -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - *(((volatile uint32_t *)(&(base->CAL_GBR[0]))) + i) = ptrCalibrationValue->generalCalibrationValueB[i]; -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ -#endif /* defined(ADC_CAL_GAR0_CAL_GAR_VAL_MASK) */ - } -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ */ - - base->GCR[0] = ADC_GCR_GCALR(ptrCalibrationValue->gainCalibrationResultA) | ADC_GCR_RDY_MASK; -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - base->GCR[1] = ADC_GCR_GCALR(ptrCalibrationValue->gainCalibrationResultB) | ADC_GCR_RDY_MASK; -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ - /* - * $Branch Coverage Justification$ - * while ((base->STAT & ADC_STAT_CAL_RDY_MASK) == ADC_STAT_CAL_RDY_MASK) not covered. Test unfeasible, - * the calibration ready state is too short not to catch. - */ - while (ADC_STAT_CAL_RDY_MASK != (base->STAT & ADC_STAT_CAL_RDY_MASK)) - { - } - - if (adcEnabled) - { - LPADC_Enable(base, true); - } -} - -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CALOFS */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpadc.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpadc.h deleted file mode 100644 index e0d2f4b6ee4..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpadc.h +++ /dev/null @@ -1,1529 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LPADC_H_ -#define FSL_LPADC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup lpadc - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief LPADC driver version 2.8.4. */ -#define FSL_LPADC_DRIVER_VERSION (MAKE_VERSION(2, 8, 4)) -/*! @} */ - -#if (defined(FSL_FEATURE_LPADC_OFSTRIM_COUNT) && (FSL_FEATURE_LPADC_OFSTRIM_COUNT == 1)) -#define ADC_OFSTRIM_OFSTRIM_MAX (ADC_OFSTRIM_OFSTRIM_MASK >> ADC_OFSTRIM_OFSTRIM_SHIFT) -#define ADC_OFSTRIM_OFSTRIM_SIGN ((ADC_OFSTRIM_OFSTRIM_MAX + 1U) >> 1U) - -#elif (defined(FSL_FEATURE_LPADC_OFSTRIM_COUNT) && (FSL_FEATURE_LPADC_OFSTRIM_COUNT == 2)) -#define ADC_OFSTRIM_OFSTRIM_A_MAX (ADC_OFSTRIM_OFSTRIM_A_MASK >> ADC_OFSTRIM_OFSTRIM_A_SHIFT) -#define ADC_OFSTRIM_OFSTRIM_B_MAX (ADC_OFSTRIM_OFSTRIM_B_MASK >> ADC_OFSTRIM_OFSTRIM_B_SHIFT) -#define ADC_OFSTRIM_OFSTRIM_A_SIGN ((ADC_OFSTRIM_OFSTRIM_A_MAX + 1U) >> 1U) -#define ADC_OFSTRIM_OFSTRIM_B_SIGN ((ADC_OFSTRIM_OFSTRIM_B_MAX + 1U) >> 1U) -#endif /* defined(FSL_FEATURE_LPADC_OFSTRIM_COUNT) */ - -/*! - * @brief Define the MACRO function to get command status from status value. - * - * The statusVal is the return value from LPADC_GetStatusFlags(). - */ -#define LPADC_GET_ACTIVE_COMMAND_STATUS(statusVal) ((statusVal & ADC_STAT_CMDACT_MASK) >> ADC_STAT_CMDACT_SHIFT) - -/*! - * @brief Define the MACRO function to get trigger status from status value. - * - * The statusVal is the return value from LPADC_GetStatusFlags(). - */ -#define LPADC_GET_ACTIVE_TRIGGER_STATUE(statusVal) ((statusVal & ADC_STAT_TRGACT_MASK) >> ADC_STAT_TRGACT_SHIFT) - -/* Map macros to the unified name. */ -#if !defined(ADC_STAT_FOF0_MASK) -#ifdef ADC_STAT_FOF_MASK -#define ADC_STAT_FOF0_MASK ADC_STAT_FOF_MASK -#else -#error "ADC_STAT_FOF0_MASK not defined" -#endif /* ifdef(ADC_STAT_FOF_MASK) */ -#endif /* !defined(ADC_STAT_FOF0_MASK) */ - -#if !defined(ADC_STAT_RDY0_MASK) -#ifdef ADC_STAT_RDY_MASK -#define ADC_STAT_RDY0_MASK ADC_STAT_RDY_MASK -#else -#error "ADC_STAT_RDY0_MASK not defined" -#endif /* ifdef ADC_STAT_RDY_MASK */ -#endif /* !defined(ADC_STAT_RDY0_MASK) */ - -#if !defined(ADC_IE_FOFIE0_MASK) -#ifdef ADC_IE_FOFIE_MASK -#define ADC_IE_FOFIE0_MASK ADC_IE_FOFIE_MASK -#else -#error "ADC_IE_FOFIE0_MASK not defined" -#endif /* ifdef ADC_IE_FOFIE_MASK */ -#endif /* !defined(ADC_IE_FOFIE0_MASK) */ - -#if !defined(ADC_IE_FWMIE0_MASK) -#ifdef ADC_IE_FWMIE_MASK -#define ADC_IE_FWMIE0_MASK ADC_IE_FWMIE_MASK -#else -#error "ADC_IE_FWMIE0_MASK not defined" -#endif /* ifdef ADC_IE_FWMIE_MASK */ -#endif /* !defined(ADC_IE_FWMIE0_MASK) */ - -/*! - * @brief Define hardware flags of the module. - */ -enum _lpadc_status_flags -{ - kLPADC_ResultFIFO0OverflowFlag = ADC_STAT_FOF0_MASK, /*!< Indicates that more data has been written to the Result - FIFO 0 than it can hold. */ - kLPADC_ResultFIFO0ReadyFlag = ADC_STAT_RDY0_MASK, /*!< Indicates when the number of valid datawords in the result - FIFO 0 is greater than the setting watermark level. */ - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - kLPADC_ResultFIFO1OverflowFlag = ADC_STAT_FOF1_MASK, /*!< Indicates that more data has been written to the Result - FIFO 1 than it can hold. */ - kLPADC_ResultFIFO1ReadyFlag = ADC_STAT_RDY1_MASK, /*!< Indicates when the number of valid datawords in the result - FIFO 1 is greater than the setting watermark level. */ -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ - -#if (defined(FSL_FEATURE_LPADC_HAS_STAT_TEXC_INT) && (FSL_FEATURE_LPADC_HAS_STAT_TEXC_INT == 1U)) - kLPADC_TriggerExceptionFlag = ADC_STAT_TEXC_INT_MASK, /*!< Indicates that a trigger exception event has occurred. */ -#endif /* (defined(FSL_FEATURE_LPADC_HAS_STAT_TEXC_INT) && (FSL_FEATURE_LPADC_HAS_STAT_TEXC_INT == 1U)) */ - -#if (defined(FSL_FEATURE_LPADC_HAS_STAT_TCOMP_INT) && (FSL_FEATURE_LPADC_HAS_STAT_TCOMP_INT == 1U)) - kLPADC_TriggerCompletionFlag = ADC_STAT_TCOMP_INT_MASK, /*!< Indicates that a trigger completion event has occurred. - */ -#endif /* (defined(FSL_FEATURE_LPADC_HAS_STAT_TCOMP_INT) && (FSL_FEATURE_LPADC_HAS_STAT_TCOMP_INT == 1U)) */ - -#if (defined(FSL_FEATURE_LPADC_HAS_STAT_CAL_RDY) && (FSL_FEATURE_LPADC_HAS_STAT_CAL_RDY == 1U)) - kLPADC_CalibrationReadyFlag = ADC_STAT_CAL_RDY_MASK, /*!< Indicates that the calibration process is done. */ -#endif /* (defined(FSL_FEATURE_LPADC_HAS_STAT_CAL_RDY) && (FSL_FEATURE_LPADC_HAS_STAT_CAL_RDY == 1U)) */ - -#if (defined(FSL_FEATURE_LPADC_HAS_STAT_ADC_ACTIVE) && (FSL_FEATURE_LPADC_HAS_STAT_ADC_ACTIVE == 1U)) - kLPADC_ActiveFlag = ADC_STAT_ADC_ACTIVE_MASK, /*!< Indicates that the ADC is in active state. */ -#endif /* (defined(FSL_FEATURE_LPADC_HAS_STAT_ADC_ACTIVE) && (FSL_FEATURE_LPADC_HAS_STAT_ADC_ACTIVE == 1U)) */ - - kLPADC_ResultFIFOOverflowFlag = kLPADC_ResultFIFO0OverflowFlag, /*!< To compilitable with old version, do not - recommend using this, please use @ref - kLPADC_ResultFIFO0OverflowFlag as instead. */ - - kLPADC_ResultFIFOReadyFlag = kLPADC_ResultFIFO0ReadyFlag, /*!< To compilitable with old version, do not - recommend using this, please use @ref - kLPADC_ResultFIFO0ReadyFlag as instead. */ -}; - -/*! - * @brief Define interrupt switchers of the module. - * - * Note: LPADC of different chips supports different number of trigger sources, - * please check the Reference Manual for details. - */ -enum _lpadc_interrupt_enable -{ - kLPADC_ResultFIFO0OverflowInterruptEnable = ADC_IE_FOFIE0_MASK, /*!< Configures ADC to generate overflow interrupt - requests when FOF0 flag is asserted. */ - kLPADC_FIFO0WatermarkInterruptEnable = ADC_IE_FWMIE0_MASK, /*!< Configures ADC to generate watermark interrupt - requests when RDY0 flag is asserted. */ - kLPADC_ResultFIFOOverflowInterruptEnable = kLPADC_ResultFIFO0OverflowInterruptEnable, /*!< To compilitable with old - version, do not recommend using this, - please use - #kLPADC_ResultFIFO0OverflowInterruptEnable - as instead. */ - kLPADC_FIFOWatermarkInterruptEnable = kLPADC_FIFO0WatermarkInterruptEnable, /*!< To compilitable with old version, - do not recommend using this, please - use - #kLPADC_FIFO0WatermarkInterruptEnable - as instead. */ - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - kLPADC_ResultFIFO1OverflowInterruptEnable = ADC_IE_FOFIE1_MASK, /*!< Configures ADC to generate overflow interrupt - requests when FOF1 flag is asserted. */ - kLPADC_FIFO1WatermarkInterruptEnable = ADC_IE_FWMIE1_MASK, /*!< Configures ADC to generate watermark interrupt - requests when RDY1 flag is asserted. */ -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ - -#if (defined(FSL_FEATURE_LPADC_HAS_IE_TEXC_IE) && (FSL_FEATURE_LPADC_HAS_IE_TEXC_IE == 1U)) - kLPADC_TriggerExceptionInterruptEnable = ADC_IE_TEXC_IE_MASK, /*!< Configures ADC to generate trigger exception - interrupt. */ -#endif /* (defined(FSL_FEATURE_LPADC_HAS_IE_TEXC_IE) && (FSL_FEATURE_LPADC_HAS_IE_TEXC_IE == 1U)) */ - -#if (defined(FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE) && (FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE == 1U)) - kLPADC_Trigger0CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 0UL), /*!< Configures ADC to generate interrupt - when trigger 0 completion. */ - kLPADC_Trigger1CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 1UL), /*!< Configures ADC to generate interrupt - when trigger 1 completion. */ - kLPADC_Trigger2CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 2UL), /*!< Configures ADC to generate interrupt - when trigger 2 completion. */ - kLPADC_Trigger3CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 3UL), /*!< Configures ADC to generate interrupt - when trigger 3 completion. */ - kLPADC_Trigger4CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 4UL), /*!< Configures ADC to generate interrupt - when trigger 4 completion. */ - kLPADC_Trigger5CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 5UL), /*!< Configures ADC to generate interrupt - when trigger 5 completion. */ - kLPADC_Trigger6CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 6UL), /*!< Configures ADC to generate interrupt - when trigger 6 completion. */ - kLPADC_Trigger7CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 7UL), /*!< Configures ADC to generate interrupt - when trigger 7 completion. */ - kLPADC_Trigger8CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 8UL), /*!< Configures ADC to generate interrupt - when trigger 8 completion. */ - kLPADC_Trigger9CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 9UL), /*!< Configures ADC to generate interrupt - when trigger 9 completion. */ - kLPADC_Trigger10CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 10UL), /*!< Configures ADC to generate interrupt - when trigger 10 completion. */ - kLPADC_Trigger11CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 11UL), /*!< Configures ADC to generate interrupt - when trigger 11 completion. */ - kLPADC_Trigger12CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 12UL), /*!< Configures ADC to generate interrupt - when trigger 12 completion. */ - kLPADC_Trigger13CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 13UL), /*!< Configures ADC to generate interrupt - when trigger 13 completion. */ - kLPADC_Trigger14CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 14UL), /*!< Configures ADC to generate interrupt - when trigger 14 completion. */ - kLPADC_Trigger15CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 15UL), /*!< Configures ADC to generate interrupt - when trigger 15 completion. */ -#endif /* #if (defined(FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE) && (FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE == 1U)) */ -}; - -#if (defined(FSL_FEATURE_LPADC_HAS_TSTAT) && (FSL_FEATURE_LPADC_HAS_TSTAT)) -/*! - * @brief The enumerator of lpadc trigger status flags, including interrupted flags and completed flags. - * - * Note: LPADC of different chips supports different number of trigger sources, - * please check the Reference Manual for details. - */ -enum _lpadc_trigger_status_flags -{ - kLPADC_Trigger0InterruptedFlag = 1UL << 0UL, /*!< Trigger 0 is interrupted by a high priority exception. */ - kLPADC_Trigger1InterruptedFlag = 1UL << 1UL, /*!< Trigger 1 is interrupted by a high priority exception. */ - kLPADC_Trigger2InterruptedFlag = 1UL << 2UL, /*!< Trigger 2 is interrupted by a high priority exception. */ - kLPADC_Trigger3InterruptedFlag = 1UL << 3UL, /*!< Trigger 3 is interrupted by a high priority exception. */ - kLPADC_Trigger4InterruptedFlag = 1UL << 4UL, /*!< Trigger 4 is interrupted by a high priority exception. */ - kLPADC_Trigger5InterruptedFlag = 1UL << 5UL, /*!< Trigger 5 is interrupted by a high priority exception. */ - kLPADC_Trigger6InterruptedFlag = 1UL << 6UL, /*!< Trigger 6 is interrupted by a high priority exception. */ - kLPADC_Trigger7InterruptedFlag = 1UL << 7UL, /*!< Trigger 7 is interrupted by a high priority exception. */ - kLPADC_Trigger8InterruptedFlag = 1UL << 8UL, /*!< Trigger 8 is interrupted by a high priority exception. */ - kLPADC_Trigger9InterruptedFlag = 1UL << 9UL, /*!< Trigger 9 is interrupted by a high priority exception. */ - kLPADC_Trigger10InterruptedFlag = 1UL << 10UL, /*!< Trigger 10 is interrupted by a high priority exception. */ - kLPADC_Trigger11InterruptedFlag = 1UL << 11UL, /*!< Trigger 11 is interrupted by a high priority exception. */ - kLPADC_Trigger12InterruptedFlag = 1UL << 12UL, /*!< Trigger 12 is interrupted by a high priority exception. */ - kLPADC_Trigger13InterruptedFlag = 1UL << 13UL, /*!< Trigger 13 is interrupted by a high priority exception. */ - kLPADC_Trigger14InterruptedFlag = 1UL << 14UL, /*!< Trigger 14 is interrupted by a high priority exception. */ - kLPADC_Trigger15InterruptedFlag = 1UL << 15UL, /*!< Trigger 15 is interrupted by a high priority exception. */ - - kLPADC_Trigger0CompletedFlag = 1UL << 16UL, /*!< Trigger 0 is completed and - trigger 0 has enabled completion interrupts. */ - kLPADC_Trigger1CompletedFlag = 1UL << 17UL, /*!< Trigger 1 is completed and - trigger 1 has enabled completion interrupts. */ - kLPADC_Trigger2CompletedFlag = 1UL << 18UL, /*!< Trigger 2 is completed and - trigger 2 has enabled completion interrupts. */ - kLPADC_Trigger3CompletedFlag = 1UL << 19UL, /*!< Trigger 3 is completed and - trigger 3 has enabled completion interrupts. */ - kLPADC_Trigger4CompletedFlag = 1UL << 20UL, /*!< Trigger 4 is completed and - trigger 4 has enabled completion interrupts. */ - kLPADC_Trigger5CompletedFlag = 1UL << 21UL, /*!< Trigger 5 is completed and - trigger 5 has enabled completion interrupts. */ - kLPADC_Trigger6CompletedFlag = 1UL << 22UL, /*!< Trigger 6 is completed and - trigger 6 has enabled completion interrupts. */ - kLPADC_Trigger7CompletedFlag = 1UL << 23UL, /*!< Trigger 7 is completed and - trigger 7 has enabled completion interrupts. */ - kLPADC_Trigger8CompletedFlag = 1UL << 24UL, /*!< Trigger 8 is completed and - trigger 8 has enabled completion interrupts. */ - kLPADC_Trigger9CompletedFlag = 1UL << 25UL, /*!< Trigger 9 is completed and - trigger 9 has enabled completion interrupts. */ - kLPADC_Trigger10CompletedFlag = 1UL << 26UL, /*!< Trigger 10 is completed and - trigger 10 has enabled completion interrupts. */ - kLPADC_Trigger11CompletedFlag = 1UL << 27UL, /*!< Trigger 11 is completed and - trigger 11 has enabled completion interrupts. */ - kLPADC_Trigger12CompletedFlag = 1UL << 28UL, /*!< Trigger 12 is completed and - trigger 12 has enabled completion interrupts. */ - kLPADC_Trigger13CompletedFlag = 1UL << 29UL, /*!< Trigger 13 is completed and - trigger 13 has enabled completion interrupts. */ - kLPADC_Trigger14CompletedFlag = 1UL << 30UL, /*!< Trigger 14 is completed and - trigger 14 has enabled completion interrupts. */ - kLPADC_Trigger15CompletedFlag = 1UL << 31UL, /*!< Trigger 15 is completed and - trigger 15 has enabled completion interrupts. */ -}; -#endif /* (defined(FSL_FEATURE_LPADC_HAS_TSTAT) && (FSL_FEATURE_LPADC_HAS_TSTAT)) */ - -/*! - * @brief Define enumeration of sample scale mode. - * - * The sample scale mode is used to reduce the selected ADC analog channel input voltage level by a factor. The maximum - * possible voltage on the ADC channel input should be considered when selecting a scale mode to ensure that the - * reducing factor always results voltage level at or below the VREFH reference. This reducing capability allows - * conversion of analog inputs higher than VREFH. A-side and B-side channel inputs are both scaled using the scale mode. - */ -typedef enum _lpadc_sample_scale_mode -{ - kLPADC_SamplePartScale = 0U, /*!< Use divided input voltage signal. - (For scale select,please refer to the reference manual). */ - kLPADC_SampleFullScale = 1U, /*!< Full scale (Factor of 1). */ -} lpadc_sample_scale_mode_t; - -/*! - * @brief Define enumeration of channel sample mode. - * - * The channel sample mode configures the channel with single-end/differential/dual-single-end, side A/B. - */ -typedef enum _lpadc_sample_channel_mode -{ - kLPADC_SampleChannelSingleEndSideA = 0x0U, /*!< Single-end mode, only A-side channel is converted. */ -#if !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) - kLPADC_SampleChannelSingleEndSideB = 0x1U, /*!< Single-end mode, only B-side channel is converted. */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_DIFF) && FSL_FEATURE_LPADC_HAS_CMDL_DIFF - kLPADC_SampleChannelDiffBothSideAB = 0x2U, /*!< Differential mode, the ADC result is (CHnA-CHnB). */ - kLPADC_SampleChannelDiffBothSideBA = 0x3U, /*!< Differential mode, the ADC result is (CHnB-CHnA). */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CMDL_DIFF) && FSL_FEATURE_LPADC_HAS_CMDL_DIFF */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_CTYPE) && FSL_FEATURE_LPADC_HAS_CMDL_CTYPE - kLPADC_SampleChannelDiffBothSide = 0x02U, /*!< Differential mode, the ADC result is (CHnA-CHnB). */ - kLPADC_SampleChannelDualSingleEndBothSide = 0x03U, /*!< Dual-Single-Ended Mode. Both A side and B side - channels are converted independently. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CMDL_CTYPE) && FSL_FEATURE_LPADC_HAS_CMDL_CTYPE */ -#endif /* !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) */ -} lpadc_sample_channel_mode_t; - -/*! - * @brief Define enumeration of hardware average selection. - * - * It Selects how many ADC conversions are averaged to create the ADC result. An internal storage buffer is used to - * capture temporary results while the averaging iterations are executed. - * - * @note Some enumerator values are not available on some devices, mainly depends on the size of AVGS field in CMDH - * register. - */ -typedef enum _lpadc_hardware_average_mode -{ - kLPADC_HardwareAverageCount1 = 0U, /*!< Single conversion. */ - kLPADC_HardwareAverageCount2 = 1U, /*!< 2 conversions averaged. */ - kLPADC_HardwareAverageCount4 = 2U, /*!< 4 conversions averaged. */ - kLPADC_HardwareAverageCount8 = 3U, /*!< 8 conversions averaged. */ - kLPADC_HardwareAverageCount16 = 4U, /*!< 16 conversions averaged. */ - kLPADC_HardwareAverageCount32 = 5U, /*!< 32 conversions averaged. */ - kLPADC_HardwareAverageCount64 = 6U, /*!< 64 conversions averaged. */ - kLPADC_HardwareAverageCount128 = 7U, /*!< 128 conversions averaged. */ -#if (defined(FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH) && \ - (FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH == 4U)) - kLPADC_HardwareAverageCount256 = 8U, /*!< 256 conversions averaged. */ - kLPADC_HardwareAverageCount512 = 9U, /*!< 512 conversions averaged. */ - kLPADC_HardwareAverageCount1024 = 10U, /*!< 1024 conversions averaged. */ -#endif /* (defined(FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH) && \ - (FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH == 4U))*/ -} lpadc_hardware_average_mode_t; - -/*! - * @brief Define enumeration of sample time selection. - * - * The shortest sample time maximizes conversion speed for lower impedance inputs. Extending sample time allows higher - * impedance inputs to be accurately sampled. Longer sample times can also be used to lower overall power consumption - * when command looping and sequencing is configured and high conversion rates are not required. - */ -typedef enum _lpadc_sample_time_mode -{ - kLPADC_SampleTimeADCK3 = 0U, /*!< 3 ADCK cycles total sample time. */ - kLPADC_SampleTimeADCK5 = 1U, /*!< 5 ADCK cycles total sample time. */ - kLPADC_SampleTimeADCK7 = 2U, /*!< 7 ADCK cycles total sample time. */ - kLPADC_SampleTimeADCK11 = 3U, /*!< 11 ADCK cycles total sample time. */ - kLPADC_SampleTimeADCK19 = 4U, /*!< 19 ADCK cycles total sample time. */ - kLPADC_SampleTimeADCK35 = 5U, /*!< 35 ADCK cycles total sample time. */ - kLPADC_SampleTimeADCK67 = 6U, /*!< 69 ADCK cycles total sample time. */ - kLPADC_SampleTimeADCK131 = 7U, /*!< 131 ADCK cycles total sample time. */ -} lpadc_sample_time_mode_t; - -/*! - * @brief Define enumeration of hardware compare mode. - * - * After an ADC channel input is sampled and converted and any averaging iterations are performed, this mode setting - * guides operation of the automatic compare function to optionally only store when the compare operation is true. - * When compare is enabled, the conversion result is compared to the compare values. - */ -typedef enum _lpadc_hardware_compare_mode -{ - kLPADC_HardwareCompareDisabled = 0U, /*!< Compare disabled. */ - kLPADC_HardwareCompareStoreOnTrue = 2U, /*!< Compare enabled. Store on true. */ - kLPADC_HardwareCompareRepeatUntilTrue = 3U, /*!< Compare enabled. Repeat channel acquisition until true. */ -} lpadc_hardware_compare_mode_t; - -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_MODE) && FSL_FEATURE_LPADC_HAS_CMDL_MODE -/*! - * @brief Define enumeration of conversion resolution mode. - * - * Configure the resolution bit in specific conversion type. For detailed resolution accuracy, see to - * #lpadc_sample_channel_mode_t - */ -typedef enum _lpadc_conversion_resolution_mode -{ - kLPADC_ConversionResolutionStandard = 0U, /*!< Standard resolution. Single-ended 12-bit conversion, Differential - 13-bit conversion with 2's complement output. */ - kLPADC_ConversionResolutionHigh = 1U, /*!< High resolution. Single-ended 16-bit conversion; Differential 16-bit - conversion with 2's complement output. */ -} lpadc_conversion_resolution_mode_t; -#endif /* defined(FSL_FEATURE_LPADC_HAS_CMDL_MODE) && FSL_FEATURE_LPADC_HAS_CMDL_MODE */ - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS -/*! - * @brief Define enumeration of conversion averages mode. - * - * Configure the converion average number for auto-calibration. - * @note Some enumerator values are not available on some devices, mainly depends on the size of CAL_AVGS field in CTRL - * register. - */ -typedef enum _lpadc_conversion_average_mode -{ - kLPADC_ConversionAverage1 = 0U, /*!< Single conversion. */ - kLPADC_ConversionAverage2 = 1U, /*!< 2 conversions averaged. */ - kLPADC_ConversionAverage4 = 2U, /*!< 4 conversions averaged. */ - kLPADC_ConversionAverage8 = 3U, /*!< 8 conversions averaged. */ - kLPADC_ConversionAverage16 = 4U, /*!< 16 conversions averaged. */ - kLPADC_ConversionAverage32 = 5U, /*!< 32 conversions averaged. */ - kLPADC_ConversionAverage64 = 6U, /*!< 64 conversions averaged. */ - kLPADC_ConversionAverage128 = 7U, /*!< 128 conversions averaged. */ -#if (defined(FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH) && \ - (FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH == 4U)) - kLPADC_ConversionAverage256 = 8U, /*!< 256 conversions averaged. */ - kLPADC_ConversionAverage512 = 9U, /*!< 512 conversions averaged. */ - kLPADC_ConversionAverage1024 = 10U, /*!< 1024 conversions averaged. */ -#endif /* (defined(FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH) && \ - (FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH == 4U))*/ -} lpadc_conversion_average_mode_t; -#endif /* defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS */ - -/*! - * @brief Define enumeration of reference voltage source. - * - * For detail information, need to check the SoC's specification. - */ -typedef enum _lpadc_reference_voltage_mode -{ - kLPADC_ReferenceVoltageAlt1 = 0U, /*!< Option 1 setting. */ - kLPADC_ReferenceVoltageAlt2 = 1U, /*!< Option 2 setting. */ - kLPADC_ReferenceVoltageAlt3 = 2U, /*!< Option 3 setting. */ -} lpadc_reference_voltage_source_t; - -/*! - * @brief Define enumeration of power configuration. - * - * Configures the ADC for power and performance. In the highest power setting the highest conversion rates will be - * possible. Refer to the device data sheet for power and performance capabilities for each setting. - */ -typedef enum _lpadc_power_level_mode -{ - kLPADC_PowerLevelAlt1 = 0U, /*!< Lowest power setting. */ - kLPADC_PowerLevelAlt2 = 1U, /*!< Next lowest power setting. */ - kLPADC_PowerLevelAlt3 = 2U, /*!< ... */ - kLPADC_PowerLevelAlt4 = 3U, /*!< Highest power setting. */ -} lpadc_power_level_mode_t; - -#if (defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE) -/*! - * @brief Define enumeration of offset calibration mode. - * - */ -typedef enum _lpadc_offset_calibration_mode -{ - kLPADC_OffsetCalibration12bitMode = 0U, /*!< 12 bit offset calibration mode. */ - kLPADC_OffsetCalibration16bitMode = 1U, /*!< 16 bit offset calibration mode. */ -} lpadc_offset_calibration_mode_t; -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE */ - -/*! - * @brief Define enumeration of trigger priority policy. - * - * This selection controls how higher priority triggers are handled. - * @note \b kLPADC_TriggerPriorityPreemptSubsequently is not available on some devices, mainly depends on the size of - * TPRICTRL field in CFG register. - */ -typedef enum _lpadc_trigger_priority_policy -{ - kLPADC_ConvPreemptImmediatelyNotAutoResumed = 0x0U, /*!< If a higher priority trigger is detected during command - processing, the current conversion is aborted and the new - command specified by the trigger is started, when higher - priority conversion finishes, the preempted conversion is not - automatically resumed or restarted. */ - kLPADC_ConvPreemptSoftlyNotAutoResumed = 0x1U, /*!< If a higher priority trigger is received during command - processing, the current conversion is completed (including averaging - iterations and compare function if enabled) and stored to the result - FIFO before the higher priority trigger/command is initiated, when - higher priority conversion finishes, the preempted conversion is not - resumed or restarted. */ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES - kLPADC_ConvPreemptImmediatelyAutoRestarted = 0x4U, /*!< If a higher priority trigger is detected during command - processing, the current conversion is aborted and the new - command specified by the trigger is started, when higher - priority conversion finishes, the preempted conversion will - automatically be restarted. */ - kLPADC_ConvPreemptSoftlyAutoRestarted = 0x5U, /*!< If a higher priority trigger is received during command - processing, the current conversion is completed (including averaging - iterations and compare function if enabled) and stored to the result - FIFO before the higher priority trigger/command is initiated, when - higher priority conversion finishes, the preempted conversion will - automatically be restarted. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES */ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES - kLPADC_ConvPreemptImmediatelyAutoResumed = 0xCU, /*!< If a higher priority trigger is detected during command - processing, the current conversion is aborted and the new - command specified by the trigger is started, when higher - priority conversion finishes, the preempted conversion will - automatically be resumed. */ - kLPADC_ConvPreemptSoftlyAutoResumed = 0xDU, /*!< If a higher priority trigger is received during command - processing, the current conversion is completed (including averaging - iterations and compare function if enabled) and stored to the result - FIFO before the higher priority trigger/command is initiated, when - higher priority conversion finishes, the preempted conversion will - be automatically be resumed. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES */ - - kLPADC_TriggerPriorityPreemptImmediately = - kLPADC_ConvPreemptImmediatelyNotAutoResumed, /*!< Legacy support is not recommended as it only ensures - compatibility with older versions. */ - kLPADC_TriggerPriorityPreemptSoftly = - kLPADC_ConvPreemptSoftlyNotAutoResumed, /*!< Legacy support is not recommended as it only ensures compatibility - with older versions. */ - -#if (defined(FSL_FEATURE_LPADC_CFG_TPRICTRL_BITFIELD_WIDTH) && (FSL_FEATURE_LPADC_CFG_TPRICTRL_BITFIELD_WIDTH == 2U)) - kLPADC_ConvPreemptSubsequentlyNotAutoResumed = 0x2U, /*!< If a higher priority trigger is received during command - processing, the current command will be completed (averaging, - looping, compare) before servicing the higher priority trigger, when - higher priority conversion finishes, the preempted conversion will - not automatically be restarted or resumed. */ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES - kLPADC_ConvPreemptSubsequentlyAutoRestarted = 0x6U, /*!< If a higher priority trigger is received during command - processing, the current command will be completed (averaging, - looping, compare) before servicing the higher priority trigger, when - higher priority conversion finishes, the preempted conversion will - be automatically restarted. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES */ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES - kLPADC_ConvPreemptSubsequentlyAutoResumed = 0xEU, /*!< If a higher priority trigger is received during command - processing, the current command will be completed (averaging, - looping, compare) before servicing the higher priority trigger, when - higher priority conversion finishes, the preempted conversion will - be automatically resumed. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES */ - - kLPADC_TriggerPriorityPreemptSubsequently = - kLPADC_ConvPreemptSubsequentlyNotAutoResumed, /*!< Legacy support is not recommended as it only ensures - compatibility with older versions. */ -#endif /* #if (defined(FSL_FEATURE_LPADC_CFG_TPRICTRL_BITFIELD_WIDTH) && \ - (FSL_FEATURE_LPADC_CFG_TPRICTRL_BITFIELD_WIDTH == 2U)) */ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI) && FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI - kLPADC_TriggerPriorityExceptionDisabled = 0x10U, /*!< High priority trigger exception disabled. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI) && FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI */ -} lpadc_trigger_priority_policy_t; - -#if ((defined(FSL_FEATURE_LPADC_HAS_CTRL_CALHS)) && FSL_FEATURE_LPADC_HAS_CTRL_CALHS) -/*! - * @brief Define enumeration of tune value. - */ -typedef enum _lpadc_tune_value -{ - kLPADC_TuneValue0 = 0U, /*!< Tune value 0. */ - kLPADC_TuneValue1 = 1U, /*!< Tune value 1. */ - kLPADC_TuneValue2 = 2U, /*!< Tune value 2. */ - kLPADC_TuneValue3 = 3U, /*!< Tune value 3. */ -} lpadc_tune_value_t; -#endif /* ((defined(FSL_FEATURE_LPADC_HAS_CTRL_CALHS)) && FSL_FEATURE_LPADC_HAS_CTRL_CALHS) */ - -/*! - * @brief LPADC global configuration. - * - * This structure would used to keep the settings for initialization. - */ -typedef struct -{ -#if defined(FSL_FEATURE_LPADC_HAS_CFG_ADCKEN) && FSL_FEATURE_LPADC_HAS_CFG_ADCKEN - bool enableInternalClock; /*!< Enables the internally generated clock source. The clock source is used in clock - selection logic at the chip level and is optionally used for the ADC clock source. */ -#endif /* FSL_FEATURE_LPADC_HAS_CFG_ADCKEN */ -#if defined(FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG) && FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG - bool enableVref1LowVoltage; /*!< If voltage reference option1 input is below 1.8V, it should be "true". - If voltage reference option1 input is above 1.8V, it should be "false". */ -#endif /* FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG */ - bool enableInDozeMode; /*!< Control system transition to Stop and Wait power modes while ADC is converting. When - enabled in Doze mode, immediate entries to Wait or Stop are allowed. When disabled, the - ADC will wait for the current averaging iteration/FIFO storage to complete before - acknowledging stop or wait mode entry. */ -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS - lpadc_conversion_average_mode_t conversionAverageMode; /*!< Auto-Calibration Averages. */ -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS */ - bool enableAnalogPreliminary; /*!< ADC analog circuits are pre-enabled and ready to execute conversions without - startup delays(at the cost of higher DC current consumption). */ - uint32_t powerUpDelay; /*!< When the analog circuits are not pre-enabled, the ADC analog circuits are only powered - while the ADC is active and there is a counted delay defined by this field after an - initial trigger transitions the ADC from its Idle state to allow time for the analog - circuits to stabilize. The startup delay count of (powerUpDelay * 4) ADCK cycles must - result in a longer delay than the analog startup time. */ - lpadc_reference_voltage_source_t referenceVoltageSource; /*!< Selects the voltage reference high used for - conversions.*/ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_PWRSEL) && (FSL_FEATURE_LPADC_HAS_CFG_PWRSEL == 1U) - lpadc_power_level_mode_t powerLevelMode; /*!< Power Configuration Selection. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_PWRSEL) && (FSL_FEATURE_LPADC_HAS_CFG_PWRSEL == 1U) */ - lpadc_trigger_priority_policy_t triggerPriorityPolicy; /*!< Control how higher priority triggers are handled, see to - lpadc_trigger_priority_policy_t. */ - bool enableConvPause; /*!< Enables the ADC pausing function. When enabled, a programmable delay is inserted during - command execution sequencing between LOOP iterations, between commands in a sequence, and - between conversions when command is executing in "Compare Until True" configuration. */ - uint32_t convPauseDelay; /*!< Controls the duration of pausing during command execution sequencing. The pause delay - is a count of (convPauseDelay*4) ADCK cycles. Only available when ADC pausing - function is enabled. The available value range is in 9-bit. */ -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - /* for FIFO0. */ - uint32_t FIFO0Watermark; /*!< FIFO0Watermark is a programmable threshold setting. When the number of datawords - stored in the ADC Result FIFO0 is greater than the value in this field, the ready flag - would be asserted to indicate stored data has reached the programmable threshold. */ - /* for FIFO1. */ - uint32_t FIFO1Watermark; /*!< FIFO1Watermark is a programmable threshold setting. When the number of datawords - stored in the ADC Result FIFO1 is greater than the value in this field, the ready flag - would be asserted to indicate stored data has reached the programmable threshold. */ -#else - /* for FIFO. */ - uint32_t FIFOWatermark; /*!< FIFOWatermark is a programmable threshold setting. When the number of datawords stored - in the ADC Result FIFO is greater than the value in this field, the ready flag would be - asserted to indicate stored data has reached the programmable threshold. */ -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ -#if (defined(FSL_FEATURE_LPADC_HAS_TSTAT) && (FSL_FEATURE_LPADC_HAS_TSTAT)) - -#endif /* FSL_FEATURE_LPADC_HAS_TSTAT */ -} lpadc_config_t; - -/*! - * @brief Define structure to keep the configuration for conversion command. - */ -typedef struct -{ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_CSCALE) && FSL_FEATURE_LPADC_HAS_CMDL_CSCALE - lpadc_sample_scale_mode_t sampleScaleMode; /*!< Sample scale mode. */ -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_CSCALE */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE) && FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE - lpadc_sample_scale_mode_t channelBScaleMode; /*!< Alternate channe B Scale mode. */ -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE */ - lpadc_sample_channel_mode_t sampleChannelMode; /*!< Channel sample mode. */ - uint32_t channelNumber; /*!< Channel number, select the channel or channel pair. */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTB_ADCH) && FSL_FEATURE_LPADC_HAS_CMDL_ALTB_ADCH - uint32_t channelBNumber; /*!< Alternate Channel B number, select the channel. */ -#endif - uint32_t chainedNextCommandNumber; /*!< Selects the next command to be executed after this command completes. - 1-15 is available, 0 is to terminate the chain after this command. */ - bool enableAutoChannelIncrement; /*!< Loop with increment: when disabled, the "loopCount" field selects the number - of times the selected channel is converted consecutively; when enabled, the - "loopCount" field defines how many consecutive channels are converted as part - of the command execution. */ - uint32_t loopCount; /*!< Selects how many times this command executes before finish and transition to the next - command or Idle state. Command executes LOOP+1 times. 0-15 is available. */ - lpadc_hardware_average_mode_t hardwareAverageMode; /*!< Hardware average selection. */ - lpadc_sample_time_mode_t sampleTimeMode; /*!< Sample time selection. */ - - lpadc_hardware_compare_mode_t hardwareCompareMode; /*!< Hardware compare selection. */ - uint32_t hardwareCompareValueHigh; /*!< Compare Value High. The available value range is in 16-bit. */ - uint32_t hardwareCompareValueLow; /*!< Compare Value Low. The available value range is in 16-bit. */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_MODE) && FSL_FEATURE_LPADC_HAS_CMDL_MODE - lpadc_conversion_resolution_mode_t conversionResolutionMode; /*!< Conversion resolution mode. */ -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_MODE */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG) && FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG - bool enableWaitTrigger; /*!< Wait for trigger assertion before execution: when disabled, this command will be - automatically executed; when enabled, the active trigger must be asserted again before - executing this command. */ -#endif /* FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN) && FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN - bool enableChannelB; /*! Enable alternate Channel B */ -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN */ -} lpadc_conv_command_config_t; - -/*! - * @brief Define structure to keep the configuration for conversion trigger. - */ -typedef struct -{ - uint32_t targetCommandId; /*!< Select the command from command buffer to execute upon detect of the associated - trigger event. */ - uint32_t delayPower; /*!< Select the trigger delay duration to wait at the start of servicing a trigger event. - When this field is clear, then no delay is incurred. When this field is set to a non-zero - value, the duration for the delay is 2^delayPower ADCK cycles. The available value range - is 4-bit. */ - uint32_t priority; /*!< Sets the priority of the associated trigger source. If two or more triggers have the same - priority level setting, the lower order trigger event has the higher priority. The lower - value for this field is for the higher priority, the available value range is 1-bit. */ -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - uint8_t channelAFIFOSelect; /* SAR Result Destination For Channel A. */ - uint8_t channelBFIFOSelect; /* SAR Result Destination For Channel B. */ -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ - bool enableHardwareTrigger; /*!< Enable hardware trigger source to initiate conversion on the rising edge of the - input trigger source or not. THe software trigger is always available. */ -} lpadc_conv_trigger_config_t; - -/*! - * @brief Define the structure to keep the conversion result. - */ -typedef struct -{ - uint32_t commandIdSource; /*!< Indicate the command buffer being executed that generated this result. */ - uint32_t loopCountIndex; /*!< Indicate the loop count value during command execution that generated this result. */ - uint32_t triggerIdSource; /*!< Indicate the trigger source that initiated a conversion and generated this result. */ - uint16_t convValue; /*!< Data result. */ -} lpadc_conv_result_t; - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFS) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFS -/*! - * @brief A structure of calibration value. - */ -typedef struct _lpadc_calibration_value -{ - /* gain calibration result. */ - uint16_t gainCalibrationResultA; -#if !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) - uint16_t gainCalibrationResultB; -#endif /* !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) */ -#if (defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) - /* general calibration value. */ - uint16_t generalCalibrationValueA[33U]; -#if !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) - uint16_t generalCalibrationValueB[33U]; -#endif /* !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) */ -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ */ -} lpadc_calibration_value_t; -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CALOFS */ - -#if defined(__cplusplus) -extern "C" { -#endif - -/******************************************************************************* - * API - ******************************************************************************/ -/*! - * @name Initialization & de-initialization. - * @{ - */ - -/*! - * @brief Initializes the LPADC module. - * - * @param base LPADC peripheral base address. - * @param config Pointer to configuration structure. See "lpadc_config_t". - */ -void LPADC_Init(ADC_Type *base, const lpadc_config_t *config); - -/*! - * @brief Gets an available pre-defined settings for initial configuration. - * - * This function initializes the converter configuration structure with an available settings. The default values are: - * @code - * config->enableInDozeMode = true; - * config->enableAnalogPreliminary = false; - * config->powerUpDelay = 0x80; - * config->referenceVoltageSource = kLPADC_ReferenceVoltageAlt1; - * config->powerLevelMode = kLPADC_PowerLevelAlt1; - * config->triggerPriorityPolicy = kLPADC_TriggerPriorityPreemptImmediately; - * config->enableConvPause = false; - * config->convPauseDelay = 0U; - * config->FIFOWatermark = 0U; - * @endcode - * @param config Pointer to configuration structure. - */ -void LPADC_GetDefaultConfig(lpadc_config_t *config); - -/*! - * @brief De-initializes the LPADC module. - * - * @param base LPADC peripheral base address. - */ -void LPADC_Deinit(ADC_Type *base); - -/*! - * @brief Switch on/off the LPADC module. - * - * @param base LPADC peripheral base address. - * @param enable switcher to the module. - */ -static inline void LPADC_Enable(ADC_Type *base, bool enable) -{ - if (enable) - { - base->CTRL |= ADC_CTRL_ADCEN_MASK; - } - else - { - base->CTRL &= ~ADC_CTRL_ADCEN_MASK; - } -} - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) -/*! - * @brief Do reset the conversion FIFO0. - * - * @param base LPADC peripheral base address. - */ -static inline void LPADC_DoResetFIFO0(ADC_Type *base) -{ - base->CTRL |= ADC_CTRL_RSTFIFO0_MASK; -} - -/*! - * @brief Do reset the conversion FIFO1. - * - * @param base LPADC peripheral base address. - */ -static inline void LPADC_DoResetFIFO1(ADC_Type *base) -{ - base->CTRL |= ADC_CTRL_RSTFIFO1_MASK; -} -#else - -#if defined(ADC_CTRL_RSTFIFO0_MASK) -#define ADC_CTRL_RSTFIFO_MASK ADC_CTRL_RSTFIFO0_MASK -#endif /* defined(ADC_CTRL_RSTFIFO0_MASK) */ -/*! - * @brief Do reset the conversion FIFO. - * - * @param base LPADC peripheral base address. - */ -static inline void LPADC_DoResetFIFO(ADC_Type *base) -{ - base->CTRL |= ADC_CTRL_RSTFIFO_MASK; -} -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ - -/*! - * @brief Do reset the module's configuration. - * - * Reset all ADC internal logic and registers, except the Control Register (ADCx_CTRL). - * - * @param base LPADC peripheral base address. - */ -static inline void LPADC_DoResetConfig(ADC_Type *base) -{ - base->CTRL |= ADC_CTRL_RST_MASK; - base->CTRL &= ~ADC_CTRL_RST_MASK; -} - -/*! @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Get status flags. - * - * @param base LPADC peripheral base address. - * @return status flags' mask. See to #_lpadc_status_flags. - */ -static inline uint32_t LPADC_GetStatusFlags(ADC_Type *base) -{ - return base->STAT; -} - -/*! - * @brief Clear status flags. - * - * Only the flags can be cleared by writing ADCx_STATUS register would be cleared by this API. - * - * @param base LPADC peripheral base address. - * @param mask Mask value for flags to be cleared. See to #_lpadc_status_flags. - */ -static inline void LPADC_ClearStatusFlags(ADC_Type *base, uint32_t mask) -{ - base->STAT = mask; -} - -#if (defined(FSL_FEATURE_LPADC_HAS_TSTAT) && FSL_FEATURE_LPADC_HAS_TSTAT) -/*! - * @brief Get trigger status flags to indicate which trigger sequences have been completed or interrupted by a high - * priority trigger exception. - * - * @param base LPADC peripheral base address. - * @return The OR'ed value of @ref _lpadc_trigger_status_flags. - */ -static inline uint32_t LPADC_GetTriggerStatusFlags(ADC_Type *base) -{ - return base->TSTAT; -} - -/*! - * @brief Clear trigger status flags. - * - * @param base LPADC peripheral base address. - * @param mask The mask of trigger status flags to be cleared, should be the - * OR'ed value of @ref _lpadc_trigger_status_flags. - */ -static inline void LPADC_ClearTriggerStatusFlags(ADC_Type *base, uint32_t mask) -{ - /* This assert used to avoid user use doesn't supported trigger sources. */ - assert(((mask & 0xFFFFU) == (mask & ADC_TSTAT_TEXC_NUM_MASK)) && - ((mask & 0xFFFF0000U) == (mask & ADC_TSTAT_TCOMP_FLAG_MASK))); - base->TSTAT = mask; -} -#endif /* (defined(FSL_FEATURE_LPADC_HAS_TSTAT) && FSL_FEATURE_LPADC_HAS_TSTAT) */ - -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enable interrupts. - * - * @param base LPADC peripheral base address. - * @param mask Mask value for interrupt events. See to #_lpadc_interrupt_enable. - */ -static inline void LPADC_EnableInterrupts(ADC_Type *base, uint32_t mask) -{ -#if (defined(FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE) && (FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE == 1U)) - /* This assert used to avoid user use doesn't supported trigger sources. */ - assert((mask <= 0xFFFFU) || ((mask & 0xFFFF0000U) == (mask & ADC_IE_TCOMP_IE_MASK))); -#endif /* #if (defined(FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE) && (FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE == 1U)) */ - base->IE |= mask; -} - -/*! - * @brief Disable interrupts. - * - * @param base LPADC peripheral base address. - * @param mask Mask value for interrupt events. See to #_lpadc_interrupt_enable. - */ -static inline void LPADC_DisableInterrupts(ADC_Type *base, uint32_t mask) -{ -#if (defined(FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE) && (FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE == 1U)) - /* This assert used to avoid user use doesn't supported trigger sources. */ - assert((mask <= 0xFFFFU) || ((mask & 0xFFFF0000U) == (mask & ADC_IE_TCOMP_IE_MASK))); -#endif /* #if (defined(FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE) && (FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE == 1U)) */ - base->IE &= ~mask; -} - -/*! - * @name DMA Control - * @{ - */ - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) -/*! - * @brief Switch on/off the DMA trigger for FIFO0 watermark event. - * - * @param base LPADC peripheral base address. - * @param enable Switcher to the event. - */ -static inline void LPADC_EnableFIFO0WatermarkDMA(ADC_Type *base, bool enable) -{ - if (enable) - { - base->DE |= ADC_DE_FWMDE0_MASK; - } - else - { - base->DE &= ~ADC_DE_FWMDE0_MASK; - } -} - -/*! - * @brief Switch on/off the DMA trigger for FIFO1 watermark event. - * - * @param base LPADC peripheral base address. - * @param enable Switcher to the event. - */ -static inline void LPADC_EnableFIFO1WatermarkDMA(ADC_Type *base, bool enable) -{ - if (enable) - { - base->DE |= ADC_DE_FWMDE1_MASK; - } - else - { - base->DE &= ~ADC_DE_FWMDE1_MASK; - } -} -#else -#if defined(ADC_DE_FWMDE0_MASK) -#define ADC_DE_FWMDE_MASK ADC_DE_FWMDE0_MASK -#endif /* defined(ADC_DE_FWMDE0_MASK) */ -/*! - * @brief Switch on/off the DMA trigger for FIFO watermark event. - * - * @param base LPADC peripheral base address. - * @param enable Switcher to the event. - */ -static inline void LPADC_EnableFIFOWatermarkDMA(ADC_Type *base, bool enable) -{ - if (enable) - { - base->DE |= ADC_DE_FWMDE_MASK; - } - else - { - base->DE &= ~ADC_DE_FWMDE_MASK; - } -} -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) */ -/*! @} */ - -/*! - * @name Trigger and conversion with FIFO. - * @{ - */ - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) -/*! - * @brief Get the count of result kept in conversion FIFOn. - * - * @param base LPADC peripheral base address. - * @param index Result FIFO index. - * @return The count of result kept in conversion FIFOn. - */ -static inline uint32_t LPADC_GetConvResultCount(ADC_Type *base, uint8_t index) -{ - return (ADC_FCTRL_FCOUNT_MASK & base->FCTRL[index]) >> ADC_FCTRL_FCOUNT_SHIFT; -} - -/*! - * @brief Get the result in conversion FIFOn. - * - * @param base LPADC peripheral base address. - * @param result Pointer to structure variable that keeps the conversion result in conversion FIFOn. - * @param index Result FIFO index. - * - * @return Status whether FIFOn entry is valid. - */ -bool LPADC_GetConvResult(ADC_Type *base, lpadc_conv_result_t *result, uint8_t index); - -/*! - * @brief Get the result in conversion FIFOn using blocking method. - * - * @param base LPADC peripheral base address. - * @param result Pointer to structure variable that keeps the conversion result in conversion FIFOn. - * @param index Result FIFO index. - */ -void LPADC_GetConvResultBlocking(ADC_Type *base, lpadc_conv_result_t *result, uint8_t index); -#else /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 1)) */ -/*! - * @brief Get the count of result kept in conversion FIFO. - * - * @param base LPADC peripheral base address. - * @return The count of result kept in conversion FIFO. - */ -static inline uint32_t LPADC_GetConvResultCount(ADC_Type *base) -{ - return (ADC_FCTRL_FCOUNT_MASK & base->FCTRL) >> ADC_FCTRL_FCOUNT_SHIFT; -} - -/*! - * @brief Get the result in conversion FIFO. - * - * @param base LPADC peripheral base address. - * @param result Pointer to structure variable that keeps the conversion result in conversion FIFO. - * - * @return Status whether FIFO entry is valid. - */ -bool LPADC_GetConvResult(ADC_Type *base, lpadc_conv_result_t *result); - -/*! - * @brief Get the result in conversion FIFO using blocking method. - * - * @param base LPADC peripheral base address. - * @param result Pointer to structure variable that keeps the conversion result in conversion FIFO. - */ -void LPADC_GetConvResultBlocking(ADC_Type *base, lpadc_conv_result_t *result); -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) */ - -/*! - * @brief Configure the conversion trigger source. - * - * Each programmable trigger can launch the conversion command in command buffer. - * - * @param base LPADC peripheral base address. - * @param triggerId ID for each trigger. Typically, the available value range is from 0. - * @param config Pointer to configuration structure. See to #lpadc_conv_trigger_config_t. - */ -void LPADC_SetConvTriggerConfig(ADC_Type *base, uint32_t triggerId, const lpadc_conv_trigger_config_t *config); - -/*! - * @brief Gets an available pre-defined settings for trigger's configuration. - * - * This function initializes the trigger's configuration structure with an available settings. The default values are: - * @code - * config->targetCommandId = 0U; - * config->delayPower = 0U; - * config->priority = 0U; - * config->channelAFIFOSelect = 0U; - * config->channelBFIFOSelect = 0U; - * config->enableHardwareTrigger = false; - * @endcode - * @param config Pointer to configuration structure. - */ -void LPADC_GetDefaultConvTriggerConfig(lpadc_conv_trigger_config_t *config); - -/*! - * @brief Do software trigger to conversion command. - * - * @param base LPADC peripheral base address. - * @param triggerIdMask Mask value for software trigger indexes, which count from zero. - */ -static inline void LPADC_DoSoftwareTrigger(ADC_Type *base, uint32_t triggerIdMask) -{ - /* Writes to ADCx_SWTRIG register are ignored while ADCx_CTRL[ADCEN] is clear. */ - base->SWTRIG = triggerIdMask; -} - -#if defined(FSL_FEATURE_LPADC_HAS_TCTRL_CMD_SEL) && FSL_FEATURE_LPADC_HAS_TCTRL_CMD_SEL -/*! - * @brief Enable hardware trigger command selection. - * - * This function will use the hardware trigger command from ADC_ETC.The trigger command is then defined - * by ADC hardware trigger command selection field in ADC_ETC- >TRIGx_CHAINy_z_n[CSEL]. - * - * @param base LPADC peripheral base address. - * @param triggerId ID for each trigger. Typically, the available value range is from 0. - * @param enable True to enable or flase to disable. - */ -static inline void LPADC_EnableHardwareTriggerCommandSelection(ADC_Type *base, uint32_t triggerId, bool enable) -{ - if (enable) - { - base->TCTRL[triggerId] |= ADC_TCTRL_CMD_SEL_MASK; - } - else - { - base->TCTRL[triggerId] &= ~ADC_TCTRL_CMD_SEL_MASK; - } -} -#endif /* defined(FSL_FEATURE_LPADC_HAS_TCTRL_CMD_SEL) && FSL_FEATURE_LPADC_HAS_TCTRL_CMD_SEL*/ - -/*! - * @brief Configure conversion command. - - * @note The number of compare value register on different chips is different, that is mean in some chips, some - * command buffers do not have the compare functionality. - * - * @param base LPADC peripheral base address. - * @param commandId ID for command in command buffer. Typically, the available value range is 1 - 15. - * @param config Pointer to configuration structure. See to #lpadc_conv_command_config_t. - */ -void LPADC_SetConvCommandConfig(ADC_Type *base, uint32_t commandId, const lpadc_conv_command_config_t *config); - -/*! - * @brief Gets an available pre-defined settings for conversion command's configuration. - * - * This function initializes the conversion command's configuration structure with an available settings. The default - * values are: - * @code - * config->sampleScaleMode = kLPADC_SampleFullScale; - * config->channelBScaleMode = kLPADC_SampleFullScale; - * config->sampleChannelMode = kLPADC_SampleChannelSingleEndSideA; - * config->channelNumber = 0U; - * config->channelBNumber = 0U; - * config->chainedNextCommandNumber = 0U; - * config->enableAutoChannelIncrement = false; - * config->loopCount = 0U; - * config->hardwareAverageMode = kLPADC_HardwareAverageCount1; - * config->sampleTimeMode = kLPADC_SampleTimeADCK3; - * config->hardwareCompareMode = kLPADC_HardwareCompareDisabled; - * config->hardwareCompareValueHigh = 0U; - * config->hardwareCompareValueLow = 0U; - * config->conversionResolutionMode = kLPADC_ConversionResolutionStandard; - * config->enableWaitTrigger = false; - * config->enableChannelB = false; - * @endcode - * @param config Pointer to configuration structure. - */ -void LPADC_GetDefaultConvCommandConfig(lpadc_conv_command_config_t *config); - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_CALOFS) && FSL_FEATURE_LPADC_HAS_CFG_CALOFS -/*! - * @brief Enable the calibration function. - * - * When CALOFS is set, the ADC is configured to perform a calibration function anytime the ADC executes - * a conversion. Any channel selected is ignored and the value returned in the RESFIFO is a signed value - * between -31 and 31. -32 is not a valid and is never a returned value. Software should copy the lower 6- - * bits of the conversion result stored in the RESFIFO after a completed calibration conversion to the - * OFSTRIM field. The OFSTRIM field is used in normal operation for offset correction. - * - * @param base LPADC peripheral base address. - * @param enable switcher to the calibration function. - */ -void LPADC_EnableCalibration(ADC_Type *base, bool enable); -#if defined(FSL_FEATURE_LPADC_HAS_OFSTRIM) && FSL_FEATURE_LPADC_HAS_OFSTRIM -/*! - * @brief Set proper offset value to trim ADC. - * - * To minimize the offset during normal operation, software should read the conversion result from - * the RESFIFO calibration operation and write the lower 6 bits to the OFSTRIM register. - * - * @param base LPADC peripheral base address. - * @param value Setting offset value. - */ -static inline void LPADC_SetOffsetValue(ADC_Type *base, uint32_t value) -{ - base->OFSTRIM = (value & ADC_OFSTRIM_OFSTRIM_MASK) >> ADC_OFSTRIM_OFSTRIM_SHIFT; -} - -/*! - * @brief Do auto calibration. - * - * Calibration function should be executed before using converter in application. It used the software trigger and a - * dummy conversion, get the offset and write them into the OFSTRIM register. It called some of functional API - * including: -LPADC_EnableCalibration(...) -LPADC_LPADC_SetOffsetValue(...) -LPADC_SetConvCommandConfig(...) - * -LPADC_SetConvTriggerConfig(...) - * - * @param base LPADC peripheral base address. - */ -void LPADC_DoAutoCalibration(ADC_Type *base); -#endif /* defined(FSL_FEATURE_LPADC_HAS_OFSTRIM) && FSL_FEATURE_LPADC_HAS_OFSTRIM */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_CALOFS) && FSL_FEATURE_LPADC_HAS_CFG_CALOFS */ - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFS) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFS -#if defined(FSL_FEATURE_LPADC_HAS_OFSTRIM) && FSL_FEATURE_LPADC_HAS_OFSTRIM -#if defined(FSL_FEATURE_LPADC_OFSTRIM_COUNT) && (FSL_FEATURE_LPADC_OFSTRIM_COUNT == 1U) -/*! - * @brief Set trim value for offset. - * - * @note For 16-bit conversions, each increment is 1/2 LSB resulting in a programmable offset range of -256 LSB to 255.5 - * LSB; For 12-bit conversions, each increment is 1/32 LSB resulting in a programmable offset range of -16 LSB to - * 15.96875 LSB. - * - * @param base LPADC peripheral base address. - * @param value Offset trim value, is a 10-bit signed value between -512 and 511. - */ -static inline void LPADC_SetOffsetValue(ADC_Type *base, int16_t value) -{ - base->OFSTRIM = ADC_OFSTRIM_OFSTRIM(value); -} - -/*! - * @brief Get trim value of offset. - * - * @param base LPADC peripheral base address. - * @param pValue Pointer to the variable in type of int16_t to store offset value. - */ -static inline void LPADC_GetOffsetValue(ADC_Type *base, int16_t *pValue) -{ - assert(pValue != NULL); - - uint16_t ofstrim = (uint16_t)((base->OFSTRIM & (ADC_OFSTRIM_OFSTRIM_MASK)) >> ADC_OFSTRIM_OFSTRIM_SHIFT); - - if ((ofstrim & ADC_OFSTRIM_OFSTRIM_SIGN) != 0U) - { - /* If the sign bit is set, then set the other MSB. */ - ofstrim |= (uint16_t)(~ADC_OFSTRIM_OFSTRIM_MAX); - } - - *pValue = (int16_t)ofstrim; -} -#elif (defined(FSL_FEATURE_LPADC_OFSTRIM_COUNT) && (FSL_FEATURE_LPADC_OFSTRIM_COUNT == 2U)) -/*! - * @brief Set proper offset value to trim ADC. - * - * Set the offset trim value for offset calibration manually. - * - * @param base LPADC peripheral base address. - * @param valueA Setting offset value A. - * @param valueB Setting offset value B. - * @note In normal adc sequence, the values are automatically calculated by LPADC_EnableOffsetCalibration. - */ -static inline void LPADC_SetOffsetValue(ADC_Type *base, int32_t valueA, int32_t valueB) -{ - base->OFSTRIM = ADC_OFSTRIM_OFSTRIM_A(valueA) | ADC_OFSTRIM_OFSTRIM_B(valueB); -} - -/*! - * @brief Get trim value of offset. - * - * @param base LPADC peripheral base address. - * @param pValueA Pointer to the variable in type of int32_t to store offset A value. - * @param pValueB Pointer to the variable in type of int32_t to store offset B value. - */ -static inline void LPADC_GetOffsetValue(ADC_Type *base, int32_t *pValueA, int32_t *pValueB) -{ - assert(pValueA != NULL); - assert(pValueB != NULL); - - uint32_t ofstrimA = (base->OFSTRIM & (ADC_OFSTRIM_OFSTRIM_A_MASK)) >> ADC_OFSTRIM_OFSTRIM_A_SHIFT; - uint32_t ofstrimB = (base->OFSTRIM & (ADC_OFSTRIM_OFSTRIM_B_MASK)) >> ADC_OFSTRIM_OFSTRIM_B_SHIFT; - - if ((ofstrimA & ADC_OFSTRIM_OFSTRIM_A_SIGN) != 0U) - { - /* If the sign bit is set, then set the other MSB. */ - ofstrimA |= (~ADC_OFSTRIM_OFSTRIM_A_MAX); - } - if ((ofstrimB & ADC_OFSTRIM_OFSTRIM_B_SIGN) != 0U) - { - /* If the sign bit is set, then set the other MSB. */ - ofstrimB |= (~ADC_OFSTRIM_OFSTRIM_B_MAX); - } - - *pValueA = (int32_t)ofstrimA; - *pValueB = (int32_t)ofstrimB; -} -#endif /* defined(FSL_FEATURE_LPADC_OFSTRIM_COUNT) */ -#else /* !(defined(FSL_FEATURE_LPADC_HAS_OFSTRIM) && FSL_FEATURE_LPADC_HAS_OFSTRIM) */ -/*! - * @brief Set proper offset value to trim 12 bit ADC conversion. - * - * Set the offset trim value for offset calibration manually. - * - * @param base LPADC peripheral base address. - * @param valueA Setting offset value A. - * @param valueB Setting offset value B. - * @note In normal adc sequence, the values are automatically calculated by LPADC_EnableOffsetCalibration. - */ -static inline void LPADC_SetOffset12BitValue(ADC_Type *base, uint32_t valueA, uint32_t valueB) -{ - base->OFSTRIM12 = ADC_OFSTRIM12_OFSTRIM_A(valueA) | ADC_OFSTRIM12_OFSTRIM_A(valueB); -} - -/*! - * @brief Set proper offset value to trim 16 bit ADC conversion. - * - * Set the offset trim value for offset calibration manually. - * - * @param base LPADC peripheral base address. - * @param valueA Setting offset value A. - * @param valueB Setting offset value B. - * @note In normal adc sequence, the values are automatically calculated by LPADC_EnableOffsetCalibration. - */ -static inline void LPADC_SetOffset16BitValue(ADC_Type *base, uint32_t valueA, uint32_t valueB) -{ - base->OFSTRIM16 = ADC_OFSTRIM16_OFSTRIM_A(valueA) | ADC_OFSTRIM16_OFSTRIM_B(valueB); -} -#endif /* FSL_FEATURE_LPADC_HAS_OFSTRIM */ - -/*! - * @brief Enable the offset calibration function. - * - * @param base LPADC peripheral base address. - * @param enable switcher to the calibration function. - */ -static inline void LPADC_EnableOffsetCalibration(ADC_Type *base, bool enable) -{ - if (enable) - { - base->CTRL |= ADC_CTRL_CALOFS_MASK; - } - else - { - base->CTRL &= ~ADC_CTRL_CALOFS_MASK; - } -} -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE -/*! - * @brief Set offset calibration mode. - * - * @param base LPADC peripheral base address. - * @param mode set offset calibration mode.see to #lpadc_offset_calibration_mode_t . - */ -static inline void LPADC_SetOffsetCalibrationMode(ADC_Type *base, lpadc_offset_calibration_mode_t mode) -{ - base->CTRL = (base->CTRL & ~ADC_CTRL_CALOFSMODE_MASK) | ADC_CTRL_CALOFSMODE(mode); -} - -#endif /* defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE */ - -/*! - * @brief Do offset calibration. - * - * @param base LPADC peripheral base address. - */ -void LPADC_DoOffsetCalibration(ADC_Type *base); - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ -/*! - * @brief Do auto calibration. - * - * @param base LPADC peripheral base address. - */ -void LPADC_DoAutoCalibration(ADC_Type *base); - -/*! - * @brief Prepare auto calibration, LPADC_FinishAutoCalibration has to be called before using the LPADC. - * LPADC_DoAutoCalibration has been split in two API to avoid to be stuck too long in the function. - * - * @param base LPADC peripheral base address. - */ -void LPADC_PrepareAutoCalibration(ADC_Type *base); - -/*! - * @brief Finish auto calibration start with LPADC_PrepareAutoCalibration. - * - * @param base LPADC peripheral base address. - */ -void LPADC_FinishAutoCalibration(ADC_Type *base); - -#endif /* defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ */ - -/*! - * @brief Get calibration value into the memory which is defined by invoker. - * - * @note Please note the ADC will be disabled temporary. - * @note This function should be used after finish calibration. - * - * @param base LPADC peripheral base address. - * @param ptrCalibrationValue Pointer to @ref lpadc_calibration_value_t structure, this memory block should be always - * powered on even in low power modes. - */ -void LPADC_GetCalibrationValue(ADC_Type *base, lpadc_calibration_value_t *ptrCalibrationValue); - -/*! - * @brief Set calibration value into ADC calibration registers. - * - * @note Please note the ADC will be disabled temporary. - * - * @param base LPADC peripheral base address. - * @param ptrCalibrationValue Pointer to @ref lpadc_calibration_value_t structure which contains ADC's calibration - * value. - */ -void LPADC_SetCalibrationValue(ADC_Type *base, const lpadc_calibration_value_t *ptrCalibrationValue); - -#endif /* defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFS) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFS */ - -#if ((defined(FSL_FEATURE_LPADC_HAS_CTRL_CALHS)) && FSL_FEATURE_LPADC_HAS_CTRL_CALHS) -/*! - * @brief Request high speed mode trim calculation. - * - * @param base LPADC peripheral base address. - */ -static inline void LPADC_RequestHighSpeedModeTrim(ADC_Type *base) -{ - base->CTRL |= ADC_CTRL_CALHS_MASK; -} - -/*! - * @brief Get high speed mode trim value, the result is a 5-bit signed value between -16 and 15. - * - * @note The high speed mode trim value is used to minimize offset for high speed conversion. - * - * @param base LPADC peripheral base address. - * @return The calculated high speed mode trim value. - */ -static inline int8_t LPADC_GetHighSpeedTrimValue(ADC_Type *base) -{ - return (int8_t)(base->HSTRIM); -} - -/*! - * @brief Set high speed mode trim value. - * - * @note If is possible to set the trim value manually, but it is recommended to use the LPADC_RequestHighSpeedModeTrim. - * - * @param base LPADC peripheral base address. - * @param trimValue The trim value to be set. - */ -static inline void LPADC_SetHighSpeedTrimValue(ADC_Type *base, int8_t trimValue) -{ - base->HSTRIM = ADC_HSTRIM_HSTRIM(trimValue); -} - -/*! - * @brief Enable/disable high speed conversion mode, if enabled conversions complete 2 or 3 ADCK cycles sooner compared - * to conversion cycle counts when high speed mode is disabled. - * - * @param base LPADC peripheral base address. - * @param enable Used to enable/disable high speed conversion mode: - * - \b true Enable high speed conversion mode; - * - \b false Disable high speed conversion mode. - */ -static inline void LPADC_EnableHighSpeedConversionMode(ADC_Type *base, bool enable) -{ - if (enable) - { - base->CFG2 |= ADC_CFG2_HS_MASK; - } - else - { - base->CFG2 &= ~ADC_CFG2_HS_MASK; - } -} - -/*! - * @brief Enable/disable an additional ADCK cycle to conversion. - * - * @param base LPADC peripheral base address. - * @param enable Used to enable/disable an additional ADCK cycle to conversion: - * - \b true Enable an additional ADCK cycle to conversion; - * - \b false Disable an additional ADCK cycle to conversion. - */ -static inline void LPADC_EnableExtraCycle(ADC_Type *base, bool enable) -{ - if (enable) - { - base->CFG2 |= ADC_CFG2_HSEXTRA_MASK; - } - else - { - base->CFG2 &= ~ADC_CFG2_HSEXTRA_MASK; - } -} - -/*! - * @brief Set tune value which provides some variability in how many cycles are needed to complete a conversion. - * - * @param base LPADC peripheral base address. - * @param tuneValue The tune value to be set, please refer to @ref lpadc_tune_value_t. - */ -static inline void LPADC_SetTuneValue(ADC_Type *base, lpadc_tune_value_t tuneValue) -{ - base->CFG2 = (base->CFG2 & ~ADC_CFG2_TUNE_MASK) | ADC_CFG2_TUNE(tuneValue); -} - -/*! - * @brief Get tune value which provides some variability in how many cycles are needed to complete a conversion. - * - * @param base LPADC peripheral base address. - * @return The tune value, please refer to @ref lpadc_tune_value_t. - */ -static inline lpadc_tune_value_t LPADC_GetTuneValue(ADC_Type *base) -{ - return (lpadc_tune_value_t)((base->CFG2 & ADC_CFG2_TUNE_MASK) >> ADC_CFG2_TUNE_SHIFT); -} -#endif /* ((defined(FSL_FEATURE_LPADC_HAS_CTRL_CALHS)) && FSL_FEATURE_LPADC_HAS_CTRL_CALHS) */ - -#if (defined(FSL_FEATURE_LPADC_HAS_CFG2_JLEFT) && FSL_FEATURE_LPADC_HAS_CFG2_JLEFT) -/*! - * @brief Enable/disable left-justify format in 12-bit single-end mode. - * - * @param base LPADC peripheral base address. - * @param enable Used to enable/disable left-justify format in 12-bit single-end mode: - * - \b true Enable left-justify format in 12-bit single-end mode; - * - \b false Disable left-justify format in 12-bit single-end mode. - */ -static inline void LPADC_EnableJustifiedLeft(ADC_Type *base, bool enable) -{ - if (enable) - { - base->CFG2 |= ADC_CFG2_JLEFT_MASK; - } - else - { - base->CFG2 &= ~ADC_CFG2_JLEFT_MASK; - } -} -#endif /* (defined(FSL_FEATURE_LPADC_HAS_CFG2_JLEFT) && FSL_FEATURE_LPADC_HAS_CFG2_JLEFT) */ - -/*! @} */ - -#if defined(__cplusplus) -} -#endif -/*! - * @} - */ -#endif /* FSL_LPADC_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpcmp.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpcmp.c deleted file mode 100644 index 4ed2d921db9..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpcmp.c +++ /dev/null @@ -1,372 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2019, 2023 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpcmp.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpcmp" -#endif - -#if defined(LPCMP_RSTS) -#define LPCMP_RESETS_ARRAY LPCMP_RSTS -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#if defined(LPCMP_CLOCKS) -/*! - * @brief Get instance number for LPCMP module. - * - * @param base LPCMP peripheral base address - */ -static uint32_t LPCMP_GetInstance(LPCMP_Type *base); -#endif /* LPCMP_CLOCKS */ - -/******************************************************************************* - * Variables - ******************************************************************************/ -#if defined(LPCMP_CLOCKS) -/*! @brief Pointers to LPCMP bases for each instance. */ -static LPCMP_Type *const s_lpcmpBases[] = LPCMP_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to LPCMP clocks for each instance. */ -static const clock_ip_name_t s_lpcmpClocks[] = LPCMP_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* LPCMP_CLOCKS */ - -#if defined(LPCMP_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_lpcmpResets[] = LPCMP_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Codes - ******************************************************************************/ -#if defined(LPCMP_CLOCKS) -static uint32_t LPCMP_GetInstance(LPCMP_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - /* - * $Branch Coverage Justification$ - * (instance >= ARRAY_SIZE(s_lpcmpBases)) not covered. The peripheral base - * address is always valid and checked by assert. - */ - for (instance = 0; instance < ARRAY_SIZE(s_lpcmpBases); instance++) - { - /* - * $Branch Coverage Justification$ - * (s_lpcmpBases[instance] != base) not covered. The peripheral base - * address is always valid and checked by assert. - */ - if (s_lpcmpBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_lpcmpBases)); - - return instance; -} -#endif /* LPCMP_CLOCKS */ - -/*! - * brief Initialize the LPCMP - * - * This function initializes the LPCMP module. The operations included are: - * - Enabling the clock for LPCMP module. - * - Configuring the comparator. - * - Enabling the LPCMP module. - * Note: For some devices, multiple LPCMP instance share the same clock gate. In this case, to enable the clock for - * any instance enables all the LPCMPs. Check the chip reference manual for the clock assignment of the LPCMP. - * - * param base LPCMP peripheral base address. - * param config Pointer to "lpcmp_config_t" structure. - */ -void LPCMP_Init(LPCMP_Type *base, const lpcmp_config_t *config) -{ - assert(config != NULL); - - uint32_t tmp32; - -#if defined(LPCMP_CLOCKS) -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock. */ - CLOCK_EnableClock(s_lpcmpClocks[LPCMP_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* LPCMP_CLOCKS */ - -#if defined(LPCMP_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_lpcmpResets[LPCMP_GetInstance(base)]); -#endif - - /* Configure. */ - LPCMP_Enable(base, false); - -#if !(defined(FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) && FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) - /* CCR0 register. */ -#if defined(FSL_FEATURE_LPCMP_INSTANCE_SUPPORT_CCR0_CMP_STOP_ENn) - if (1U == FSL_FEATURE_LPCMP_INSTANCE_SUPPORT_CCR0_CMP_STOP_ENn(base)) -#endif /* FSL_FEATURE_LPCMP_INSTANCE_SUPPORT_CCR0_CMP_STOP_ENn */ - { - if (config->enableStopMode) - { - base->CCR0 |= LPCMP_CCR0_CMP_STOP_EN_MASK; - } - else - { - base->CCR0 &= ~LPCMP_CCR0_CMP_STOP_EN_MASK; - } - } -#endif /* !(defined(FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) && FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) */ - - /* CCR1 register. */ - tmp32 = (base->CCR1 & (~(LPCMP_CCR1_COUT_PEN_MASK | LPCMP_CCR1_COUT_SEL_MASK | LPCMP_CCR1_COUT_INV_MASK -#if defined(FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL) && FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL - | LPCMP_CCR1_FUNC_CLK_SEL_MASK -#endif /* FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL */ - ))); - - if (config->enableOutputPin) - { - tmp32 |= LPCMP_CCR1_COUT_PEN_MASK; - } - if (config->useUnfilteredOutput) - { - tmp32 |= LPCMP_CCR1_COUT_SEL_MASK; - } - if (config->enableInvertOutput) - { - tmp32 |= LPCMP_CCR1_COUT_INV_MASK; - } -#if defined(FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL) && FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL - tmp32 |= LPCMP_CCR1_FUNC_CLK_SEL(config->functionalSourceClock); -#endif /* FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL */ - base->CCR1 = tmp32; - /* CCR2 register. */ - tmp32 = base->CCR2 & ~(LPCMP_CCR2_HYSTCTR_MASK | LPCMP_CCR2_CMP_NPMD_MASK | LPCMP_CCR2_CMP_HPMD_MASK); - tmp32 |= LPCMP_CCR2_HYSTCTR(config->hysteresisMode); - tmp32 |= ((uint32_t)(config->powerMode) << LPCMP_CCR2_CMP_HPMD_SHIFT); - base->CCR2 = tmp32; - - LPCMP_Enable(base, true); /* Enable the LPCMP module. */ -} - -/*! - * brief De-initializes the LPCMP module. - * - * This function de-initializes the LPCMP module. The operations included are: - * - Disabling the LPCMP module. - * - Disabling the clock for LPCMP module. - * - * This function disables the clock for the LPCMP. - * Note: For some devices, multiple LPCMP instance shares the same clock gate. In this case, before disabling the - * clock for the LPCMP, ensure that all the LPCMP instances are not used. - * - * param base LPCMP peripheral base address. - */ -void LPCMP_Deinit(LPCMP_Type *base) -{ - /* Disable the LPCMP module. */ - LPCMP_Enable(base, false); -#if defined(LPCMP_CLOCKS) -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable the clock. */ - CLOCK_DisableClock(s_lpcmpClocks[LPCMP_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* LPCMP_CLOCKS */ -} - -/*! - * brief Gets an available pre-defined settings for the comparator's configuration. - * - * This function initializes the comparator configuration structure to these default values: - * code - * config->enableStopMode = false; - * config->enableOutputPin = false; - * config->useUnfilteredOutput = false; - * config->enableInvertOutput = false; - * config->hysteresisMode = kLPCMP_HysteresisLevel0; - * config->powerMode = kLPCMP_LowSpeedPowerMode; - * config->functionalSourceClock = kLPCMP_FunctionalClockSource0; - * endcode - * param config Pointer to "lpcmp_config_t" structure. - */ -void LPCMP_GetDefaultConfig(lpcmp_config_t *config) -{ - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); -#if !(defined(FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) && FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) - config->enableStopMode = false; -#endif /* !(defined(FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) && FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) */ - config->enableOutputPin = false; - config->useUnfilteredOutput = false; - config->enableInvertOutput = false; - config->hysteresisMode = kLPCMP_HysteresisLevel0; - config->powerMode = kLPCMP_LowSpeedPowerMode; -#if defined(FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL) && FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL - config->functionalSourceClock = kLPCMP_FunctionalClockSource0; -#endif /* FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL */ -} - -/*! - * brief Select the input channels for LPCMP. This function determines which input - * is selected for the negative and positive mux. - * - * param base LPCMP peripheral base address. - * param positiveChannel Positive side input channel number. - * param negativeChannel Negative side input channel number. - */ -void LPCMP_SetInputChannels(LPCMP_Type *base, uint32_t positiveChannel, uint32_t negativeChannel) -{ - uint32_t tmp32; - - tmp32 = base->CCR2 & ~(LPCMP_CCR2_PSEL_MASK | LPCMP_CCR2_MSEL_MASK); - tmp32 |= LPCMP_CCR2_PSEL(positiveChannel) | LPCMP_CCR2_MSEL(negativeChannel); - base->CCR2 = tmp32; -} - -/*! - * brief Configures the filter. - * - * param base LPCMP peripheral base address. - * param config Pointer to "lpcmp_filter_config_t" structure. - */ -void LPCMP_SetFilterConfig(LPCMP_Type *base, const lpcmp_filter_config_t *config) -{ - assert(config != NULL); - - uint32_t tmp32; - - tmp32 = base->CCR1 & ~(LPCMP_CCR1_FILT_PER_MASK | LPCMP_CCR1_FILT_CNT_MASK | LPCMP_CCR1_SAMPLE_EN_MASK); - if (config->enableSample) - { - tmp32 |= LPCMP_CCR1_SAMPLE_EN_MASK; - } - tmp32 |= LPCMP_CCR1_FILT_PER(config->filterSamplePeriod) | LPCMP_CCR1_FILT_CNT(config->filterSampleCount); - base->CCR1 = tmp32; -} - -/*! - * brief Configure the internal DAC module. - * - * param base LPCMP peripheral base address. - * param config Pointer to "lpcmp_dac_config_t" structure. If config is "NULL", disable internal DAC. - */ -void LPCMP_SetDACConfig(LPCMP_Type *base, const lpcmp_dac_config_t *config) -{ - uint32_t tmp32; - if (config == NULL) - { - tmp32 = 0U; /* Disable internal DAC. */ - } - else - { - tmp32 = LPCMP_DCR_VRSEL(config->referenceVoltageSource) | LPCMP_DCR_DAC_DATA(config->DACValue); - if (config->enableLowPowerMode) - { - tmp32 |= LPCMP_DCR_DAC_HPMD_MASK; - } - tmp32 |= LPCMP_DCR_DAC_EN_MASK; - } - base->DCR = tmp32; -} - -#if defined(FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL) && FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL -/*! - * @brief Configure the window control, users can use this API to implement operations on the window, - * such as inverting the window signal, setting the window closing event(only valid in windowing mode), - * and setting the COUTA signal after the window is closed(only valid in windowing mode). - * - * @param base LPCMP peripheral base address. - * @param config Pointer "lpcmp_window_control_config_t" structure. - */ -void LPCMP_SetWindowControl(LPCMP_Type *base, const lpcmp_window_control_config_t *config) -{ - assert(config != NULL); - - uint32_t tmp32 = 0UL; - - tmp32 = (base->CCR1 & (~(LPCMP_CCR1_COUTA_CFG_MASK | LPCMP_CCR1_EVT_SEL_CFG_MASK | LPCMP_CCR1_WINDOW_INV_MASK))); - - if (config->enableInvertWindowSignal) - { - tmp32 |= LPCMP_CCR1_WINDOW_INV_MASK; - } - - /* Set COUT event, which can close the active window in window mode. */ - tmp32 |= LPCMP_CCR1_EVT_SEL_CFG(config->closeWindowEvent); - - /* Set the COUTA signal value when the window is closed. */ - tmp32 |= LPCMP_CCR1_COUTA_CFG(config->COUTASignal); - - base->CCR1 = tmp32; -} -#endif /* FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL */ - -#if defined(FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE) && FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE -/*! - * @brief Configure the roundrobin mode. - * - * @param base LPCMP peripheral base address. - * @param config Pointer "lpcmp_roundrobin_config_t" structure. - */ -void LPCMP_SetRoundRobinConfig(LPCMP_Type *base, const lpcmp_roundrobin_config_t *config) -{ - assert(config != NULL); - - uint32_t tmp32 = 0UL; - - /* LPCMPx_RRCR0 register, Configuration options for the round-robin operation. */ - tmp32 = (base->RRCR0 & - (~(LPCMP_RRCR0_RR_TRG_SEL_MASK | LPCMP_RRCR0_RR_NSAM_MASK | LPCMP_RRCR0_RR_CLK_SEL_MASK | - LPCMP_RRCR0_RR_INITMOD_MASK | LPCMP_RRCR0_RR_SAMPLE_CNT_MASK | LPCMP_RRCR0_RR_SAMPLE_THRESHOLD_MASK))); - - tmp32 |= - (LPCMP_RRCR0_RR_TRG_SEL(config->roundrobinTriggerSource) | LPCMP_RRCR0_RR_NSAM(config->sampleClockNumbers) | - LPCMP_RRCR0_RR_CLK_SEL(config->roundrobinClockSource) | LPCMP_RRCR0_RR_INITMOD(config->initDelayModules) | - LPCMP_RRCR0_RR_SAMPLE_CNT(config->channelSampleNumbers) | - LPCMP_RRCR0_RR_SAMPLE_THRESHOLD(config->sampleTimeThreshhold)); - - base->RRCR0 = tmp32; - - /* LPCMPx_RRCR1 register, Configure the fix port, fix channel and checker channel. */ - tmp32 = - (base->RRCR1 & (~(LPCMP_RRCR1_FIXP_MASK | LPCMP_RRCR1_FIXCH_MASK | (0xFFUL << LPCMP_RRCR1_RR_CH0EN_SHIFT)))); - tmp32 |= (LPCMP_RRCR1_FIXP(config->fixedMuxPort) | LPCMP_RRCR1_FIXCH(config->fixedChannel) | - ((uint32_t)(config->checkerChannelMask) << LPCMP_RRCR1_RR_CH0EN_SHIFT)); - - base->RRCR1 = tmp32; -} - -/*! - * brief Configure the roundrobin internal timer reload value. - * - * param base LPCMP peripheral base address. - * param value RoundRobin internal timer reload value, allowed range:0x0UL-0xFFFFFFFUL. - */ -void LPCMP_SetRoundRobinInternalTimer(LPCMP_Type *base, uint32_t value) -{ - uint32_t tmp32 = 0UL; - - tmp32 = (base->RRCR2 & (~LPCMP_RRCR2_RR_TIMER_RELOAD_MASK)); - tmp32 |= LPCMP_RRCR2_RR_TIMER_RELOAD(value); - - base->RRCR2 = tmp32; -} - -#endif /* FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpcmp.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpcmp.h deleted file mode 100644 index 5105c98fcc1..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpcmp.h +++ /dev/null @@ -1,585 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2020, 2023-2024 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_LPCMP_H_ -#define FSL_LPCMP_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup lpcmp - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/*! @name Driver version */ -/*! @{ */ -/*! @brief LPCMP driver version 2.1.3. */ -#define FSL_LPCMP_DRIVER_VERSION (MAKE_VERSION(2, 1, 3)) -/*! @} */ - -#define LPCMP_CCR1_COUTA_CFG_MASK (LPCMP_CCR1_COUTA_OWEN_MASK | LPCMP_CCR1_COUTA_OW_MASK) -#define LPCMP_CCR1_COUTA_CFG_SHIFT LPCMP_CCR1_COUTA_OWEN_SHIFT -#define LPCMP_CCR1_COUTA_CFG(x) \ - (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_COUTA_CFG_SHIFT)) & LPCMP_CCR1_COUTA_CFG_MASK) - -#define LPCMP_CCR1_EVT_SEL_CFG_MASK (LPCMP_CCR1_EVT_SEL_MASK | LPCMP_CCR1_WINDOW_CLS_MASK) -#define LPCMP_CCR1_EVT_SEL_CFG_SHIFT LPCMP_CCR1_WINDOW_CLS_SHIFT -#define LPCMP_CCR1_EVT_SEL_CFG(x) \ - (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_EVT_SEL_CFG_SHIFT)) & LPCMP_CCR1_EVT_SEL_CFG_MASK) - -/*! - * @brief LPCMP status falgs mask. - */ -enum _lpcmp_status_flags -{ - kLPCMP_OutputRisingEventFlag = LPCMP_CSR_CFR_MASK, /*!< Rising-edge on the comparison output has occurred. */ - kLPCMP_OutputFallingEventFlag = LPCMP_CSR_CFF_MASK, /*!< Falling-edge on the comparison output has occurred. */ -#if defined(FSL_FEATURE_LPCMP_HAS_CSR_RRF) && FSL_FEATURE_LPCMP_HAS_CSR_RRF - kLPCMP_OutputRoundRobinEventFlag = LPCMP_CSR_RRF_MASK, /*!< Detects when any channel's last comparison result is - different from the pre-set value in trigger mode. */ -#endif /* FSL_FEATURE_LPCMP_HAS_CSR_RRF */ - kLPCMP_OutputAssertEventFlag = LPCMP_CSR_COUT_MASK, /*!< Return the current value of the analog comparator output. - The flag does not support W1C. */ -}; - -/*! - * @brief LPCMP interrupt enable/disable mask. - */ -enum _lpcmp_interrupt_enable -{ - kLPCMP_OutputRisingInterruptEnable = LPCMP_IER_CFR_IE_MASK, /*!< Comparator interrupt enable rising. */ - kLPCMP_OutputFallingInterruptEnable = LPCMP_IER_CFF_IE_MASK, /*!< Comparator interrupt enable falling. */ -#if defined(FSL_FEATURE_LPCMP_HAS_IER_RRF_IE) && FSL_FEATURE_LPCMP_HAS_IER_RRF_IE - kLPCMP_RoundRobinInterruptEnable = LPCMP_IER_RRF_IE_MASK, /*!< Comparator round robin mode interrupt - occurred when the comparison result changes for a given channel. */ -#endif /* FSL_FEATURE_LPCMP_HAS_IER_RRF_IE */ -}; - -/*! - * @brief LPCMP hysteresis mode. See chip data sheet to get the actual hystersis - * value with each level - */ -typedef enum _lpcmp_hysteresis_mode -{ - kLPCMP_HysteresisLevel0 = 0U, /*!< The hard block output has level 0 hysteresis internally. */ - kLPCMP_HysteresisLevel1 = 1U, /*!< The hard block output has level 1 hysteresis internally. */ - kLPCMP_HysteresisLevel2 = 2U, /*!< The hard block output has level 2 hysteresis internally. */ - kLPCMP_HysteresisLevel3 = 3U, /*!< The hard block output has level 3 hysteresis internally. */ -} lpcmp_hysteresis_mode_t; - -/*! - * @brief LPCMP nano mode. - */ -typedef enum _lpcmp_power_mode -{ - kLPCMP_LowSpeedPowerMode = 0U, /*!< Low speed comparison mode is selected. */ - kLPCMP_HighSpeedPowerMode = 1U, /*!< High speed comparison mode is selected. */ - kLPCMP_NanoPowerMode = 2U, /*!< Nano power comparator is enabled. */ -} lpcmp_power_mode_t; - -/*! - * @brief Internal DAC reference voltage source. - */ -typedef enum _lpcmp_dac_reference_voltage_source -{ - kLPCMP_VrefSourceVin1 = 0U, /*!< vrefh_int is selected as resistor ladder network supply reference Vin. */ - kLPCMP_VrefSourceVin2 = 1U, /*!< vrefh_ext is selected as resistor ladder network supply reference Vin. */ -} lpcmp_dac_reference_voltage_source_t; - -#if defined(FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL) && FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL -/*! - * @brief LPCMP functional mode clock source selection. - * - * Note: In different devices, the functional mode clock source selection is different, - * please refer to specific device Reference Manual for details. - */ -typedef enum _lpcmp_functional_source_clock -{ - kLPCMP_FunctionalClockSource0 = 0U, /*!< Select functional mode clock source0. */ - kLPCMP_FunctionalClockSource1 = 1U, /*!< Select functional mode clock source1. */ - kLPCMP_FunctionalClockSource2 = 2U, /*!< Select functional mode clock source2. */ - kLPCMP_FunctionalClockSource3 = 3U, /*!< Select functional mode clock source3. */ -} lpcmp_functional_source_clock_t; -#endif /* FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL */ - -#if defined(FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL) && FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL -/*! - * @brief Set the COUTA signal value when the window is closed. - */ -typedef enum _lpcmp_couta_signal -{ - kLPCMP_COUTASignalNoSet = 0U, /*!< NO set the COUTA signal value when the window is closed. */ - kLPCMP_COUTASignalLow = 1U, /*!< Set COUTA signal low(0) when the window is closed. */ - kLPCMP_COUTASignalHigh = 3U, /*!< Set COUTA signal high(1) when the window is closed. */ -} lpcmp_couta_signal_t; - -/*! - * @brief Set COUT event, which can close the active window in window mode. - */ -typedef enum _lpcmp_close_window_event -{ - kLPCMP_CLoseWindowEventNoSet = 0U, /*!< No Set COUT event, which can close the active window in window mode. */ - kLPCMP_CloseWindowEventRisingEdge = 1U, /*!< Set rising edge COUT signal as COUT event. */ - kLPCMP_CloseWindowEventFallingEdge = 3U, /*!< Set falling edge COUT signal as COUT event. */ - kLPCMP_CLoseWindowEventBothEdge = 5U, /*!< Set both rising and falling edge COUT signal as COUT event. */ -} lpcmp_close_window_event_t; -#endif /* FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL */ - -#if defined(FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE) && FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE -/*! - * @brief LPCMP round robin mode fixed mux port. - */ -typedef enum _lpcmp_roundrobin_fixedmuxport -{ - kLPCMP_FixedPlusMuxPort = 0U, /*!< Fixed plus mux port. */ - kLPCMP_FixedMinusMuxPort = 1U, /*!< Fixed minus mux port. */ -} lpcmp_roundrobin_fixedmuxport_t; - -/*! - * @brief LPCMP round robin mode clock source selection. - * - * Note: In different devices,the round robin mode clock source selection is different, - * please refer to the specific device Reference Manual for details. - */ -typedef enum _lpcmp_roundrobin_clock_source -{ - kLPCMP_RoundRobinClockSource0 = 0U, /*!< Select roundrobin mode clock source0. */ - kLPCMP_RoundRobinClockSource1 = 1U, /*!< Select roundrobin mode clock source1. */ - kLPCMP_RoundRobinClockSource2 = 2U, /*!< Select roundrobin mode clock source2. */ - kLPCMP_RoundRobinClockSource3 = 3U, /*!< Select roundrobin mode clock source3. */ -} lpcmp_roundrobin_clock_source_t; - -/*! - * @brief LPCMP round robin mode trigger source. - */ -typedef enum _lpcmp_roundrobin_trigger_source -{ - kLPCMP_TriggerSourceExternally = 0U, /*!< Select external trigger source. */ - kLPCMP_TriggerSourceInternally = 1U, /*!< Select internal trigger source. */ -} lpcmp_roundrobin_trigger_source_t; -#endif /* FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE */ - -/*! - * @brief Configure the filter. - */ -typedef struct _lpcmp_filter_config -{ - bool enableSample; /*!< Decide whether to use the external SAMPLE as a sampling clock input. */ - uint8_t filterSampleCount; /*!< Filter Sample Count. Available range is 1-7; 0 disables the filter. */ - uint8_t filterSamplePeriod; /*!< Filter Sample Period. The divider to the bus clock. Available range is 0-255. The - sampling clock must be at least 4 times slower than the system clock to the comparator. - So if enableSample is "false", filterSamplePeriod should be set greater than 4.*/ -} lpcmp_filter_config_t; - -/*! - * @brief configure the internal DAC. - */ -typedef struct _lpcmp_dac_config -{ - bool enableLowPowerMode; /*!< Decide whether to enable DAC low power mode. */ - lpcmp_dac_reference_voltage_source_t referenceVoltageSource; /*!< Internal DAC supply voltage reference source. */ - uint8_t DACValue; /*!< Value for the DAC Output Voltage. Different devices has different available range, - for specific values, please refer to the reference manual.*/ -} lpcmp_dac_config_t; - -/*! - * @brief Configures the comparator. - */ -typedef struct _lpcmp_config -{ -#if !(defined(FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) && FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) - bool enableStopMode; /*!< Decide whether to enable the comparator when in STOP modes. */ -#endif /* !(defined(FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) && FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) */ - - bool enableOutputPin; /*!< Decide whether to enable the comparator is available in selected pin. */ - bool useUnfilteredOutput; /*!< Decide whether to use unfiltered output. */ - bool enableInvertOutput; /*!< Decide whether to inverts the comparator output. */ - lpcmp_hysteresis_mode_t hysteresisMode; /*!< LPCMP hysteresis mode. */ - lpcmp_power_mode_t powerMode; /*!< LPCMP power mode. */ -#if defined(FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL) && FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL - lpcmp_functional_source_clock_t functionalSourceClock; /*!< Select LPCMP functional mode clock source. */ -#endif /* FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL */ -} lpcmp_config_t; - -#if defined(FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL) && FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL -/*! - * @brief Configure the window mode control. - */ -typedef struct _lpcmp_window_control_config -{ - bool enableInvertWindowSignal; /*!< True: enable invert window signal, False: disable invert window signal. */ - lpcmp_couta_signal_t COUTASignal; /*!< Decide whether to define the COUTA signal value when the window is closed. */ - lpcmp_close_window_event_t closeWindowEvent; /*!< Decide whether to select COUT event signal edge defines - a COUT event to close window. */ -} lpcmp_window_control_config_t; -#endif /* FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL */ - -#if defined(FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE) && FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE -/*! - * @brief Configure the round robin mode. - */ -typedef struct _lpcmp_roundrobin_config -{ - uint8_t initDelayModules; /*!< Comparator and DAC initialization delay modulus, See Reference Manual and DataSheet - for specific value. */ - uint8_t sampleClockNumbers; /*!< Specify the number of the round robin clock cycles(0~3) to wait after scanning the - active channel before sampling the channel's comparison result. */ - uint8_t channelSampleNumbers; /*!< Specify the number of samples for one channel, note that channelSampleNumbers - must not smaller than sampleTimeThreshhold. */ - uint8_t sampleTimeThreshhold; /*!< Specify that for one channel, when (sampleTimeThreshhold + 1) sample results are - "1",the final result is "1", otherwise the final result is "0", note that the - sampleTimeThreshhold must not be larger than channelSampleNumbers. */ - lpcmp_roundrobin_clock_source_t roundrobinClockSource; /*!< Decide which clock source to - choose in round robin mode. */ - lpcmp_roundrobin_trigger_source_t roundrobinTriggerSource; /*!< Decide which trigger source to - choose in round robin mode. */ - lpcmp_roundrobin_fixedmuxport_t fixedMuxPort; /*!< Decide which mux port to choose as - fixed channel in round robin mode. */ - uint8_t fixedChannel; /*!< Indicate which channel of the fixed mux port is used in round robin mode. */ - uint8_t checkerChannelMask; /*!< Indicate which channel of the non-fixed mux port to check its voltage value in - round robin mode, for example, if checkerChannelMask set to 0x11U means select - channel 0 and channel 4 as checker channel.*/ -} lpcmp_roundrobin_config_t; -#endif /* FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and configuration - * @{ - */ - -/*! - * @brief Initialize the LPCMP - * - * This function initializes the LPCMP module. The operations included are: - * - Enabling the clock for LPCMP module. - * - Configuring the comparator. - * - Enabling the LPCMP module. - * Note: For some devices, multiple LPCMP instance share the same clock gate. In this case, to enable the clock for - * any instance enables all the LPCMPs. Check the chip reference manual for the clock assignment of the LPCMP. - * - * @param base LPCMP peripheral base address. - * @param config Pointer to "lpcmp_config_t" structure. - */ -void LPCMP_Init(LPCMP_Type *base, const lpcmp_config_t *config); - -/*! - * @brief De-initializes the LPCMP module. - * - * This function de-initializes the LPCMP module. The operations included are: - * - Disabling the LPCMP module. - * - Disabling the clock for LPCMP module. - * - * This function disables the clock for the LPCMP. - * Note: For some devices, multiple LPCMP instance shares the same clock gate. In this case, before disabling the - * clock for the LPCMP, ensure that all the LPCMP instances are not used. - * - * @param base LPCMP peripheral base address. - */ -void LPCMP_Deinit(LPCMP_Type *base); - -/*! - * @brief Gets an available pre-defined settings for the comparator's configuration. - * - * This function initializes the comparator configuration structure to these default values: - * @code - * config->enableStopMode = false; - * config->enableOutputPin = false; - * config->useUnfilteredOutput = false; - * config->enableInvertOutput = false; - * config->hysteresisMode = kLPCMP_HysteresisLevel0; - * config->powerMode = kLPCMP_LowSpeedPowerMode; - * config->functionalSourceClock = kLPCMP_FunctionalClockSource0; - * @endcode - * @param config Pointer to "lpcmp_config_t" structure. - */ -void LPCMP_GetDefaultConfig(lpcmp_config_t *config); - -/*! - * @brief Enable/Disable LPCMP module. - * - * @param base LPCMP peripheral base address. - * @param enable "true" means enable the module, and "false" means disable the module. - */ -static inline void LPCMP_Enable(LPCMP_Type *base, bool enable) -{ - if (enable) - { - base->CCR0 |= LPCMP_CCR0_CMP_EN_MASK; - } - else - { - base->CCR0 &= ~LPCMP_CCR0_CMP_EN_MASK; - } -} - -/*! - * @brief Select the input channels for LPCMP. This function determines which input - * is selected for the negative and positive mux. - * - * @param base LPCMP peripheral base address. - * @param positiveChannel Positive side input channel number. Available range is 0-7. - * @param negativeChannel Negative side input channel number. Available range is 0-7. - */ -void LPCMP_SetInputChannels(LPCMP_Type *base, uint32_t positiveChannel, uint32_t negativeChannel); - -/*! - * @brief Enables/disables the DMA request for rising/falling events. - * Normally, the LPCMP generates a CPU interrupt if there is a rising/falling event. When - * DMA support is enabled and the rising/falling interrupt is enabled , the rising/falling - * event forces a DMA transfer request rather than a CPU interrupt instead. - * - * @param base LPCMP peripheral base address. - * @param enable "true" means enable DMA support, and "false" means disable DMA support. - */ -static inline void LPCMP_EnableDMA(LPCMP_Type *base, bool enable) -{ - if (enable) - { - base->CCR1 |= LPCMP_CCR1_DMA_EN_MASK; - } - else - { - base->CCR1 &= ~LPCMP_CCR1_DMA_EN_MASK; - } -} - -/*! - * @brief Configures the filter. - * - * @param base LPCMP peripheral base address. - * @param config Pointer to "lpcmp_filter_config_t" structure. - */ -void LPCMP_SetFilterConfig(LPCMP_Type *base, const lpcmp_filter_config_t *config); - -/*! - * @brief Configure the internal DAC module. - * - * @param base LPCMP peripheral base address. - * @param config Pointer to "lpcmp_dac_config_t" structure. If config is "NULL", disable internal DAC. - */ -void LPCMP_SetDACConfig(LPCMP_Type *base, const lpcmp_dac_config_t *config); - -/*! - * @brief Enable the interrupts. - * - * @param base LPCMP peripheral base address. - * @param mask Mask value for interrupts. See "_lpcmp_interrupt_enable". - */ -static inline void LPCMP_EnableInterrupts(LPCMP_Type *base, uint32_t mask) -{ - base->IER |= mask; -} - -/*! - * @brief Disable the interrupts. - * - * @param base LPCMP peripheral base address. - * @param mask Mask value for interrupts. See "_lpcmp_interrupt_enable". - */ -static inline void LPCMP_DisableInterrupts(LPCMP_Type *base, uint32_t mask) -{ - base->IER &= ~mask; -} - -/*! - * @brief Get the LPCMP status flags. - * - * @param base LPCMP peripheral base address. - * - * @return Mask value for the asserted flags. See "_lpcmp_status_flags". - */ -static inline uint32_t LPCMP_GetStatusFlags(LPCMP_Type *base) -{ - return base->CSR; -} - -/*! - * @brief Clear the LPCMP status flags - * - * @param base LPCMP peripheral base address. - * @param mask Mask value for the flags. See "_lpcmp_status_flags". - */ -static inline void LPCMP_ClearStatusFlags(LPCMP_Type *base, uint32_t mask) -{ - base->CSR = mask; -} - -/*! @} */ - -/*! - * @name Window mode - * @{ - */ - -/*! - * @brief Enable/Disable window mode.When any windowed mode is active, COUTA is clocked by - * the bus clock whenever WINDOW = 1. The last latched value is held when WINDOW = 0. - * The optionally inverted comparator output COUT_RAW is sampled on every bus clock - * when WINDOW=1 to generate COUTA. - * - * @param base LPCMP peripheral base address. - * @param enable "true" means enable window mode, and "false" means disable window mode. - */ -static inline void LPCMP_EnableWindowMode(LPCMP_Type *base, bool enable) -{ - if (enable) - { - base->CCR1 |= LPCMP_CCR1_WINDOW_EN_MASK; - } - else - { - base->CCR1 &= ~LPCMP_CCR1_WINDOW_EN_MASK; - } -} - -#if defined(FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL) && FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL -/*! - * @brief Configure the window control, users can use this API to implement operations on the window, - * such as inverting the window signal, setting the window closing event(only valid in windowing mode), - * and setting the COUTA signal after the window is closed(only valid in windowing mode). - * - * @param base LPCMP peripheral base address. - * @param config Pointer "lpcmp_window_control_config_t" structure. - */ -void LPCMP_SetWindowControl(LPCMP_Type *base, const lpcmp_window_control_config_t *config); -#endif /* FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL */ - -/*! @} */ - -#if defined(FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE) && FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE -/*! - * @name RoundRobin mode - * @{ - */ - -/*! - * @brief Configure the roundrobin mode. - * - * @param base LPCMP peripheral base address. - * @param config Pointer "lpcmp_roundrobin_config_t" structure. - */ -void LPCMP_SetRoundRobinConfig(LPCMP_Type *base, const lpcmp_roundrobin_config_t *config); - -/*! - * brief Configure the roundrobin internal timer reload value. - * - * param base LPCMP peripheral base address. - * param value RoundRobin internal timer reload value, allowed range:0x0UL-0xFFFFFFFUL. - */ -void LPCMP_SetRoundRobinInternalTimer(LPCMP_Type *base, uint32_t value); - -/*! - * @brief Enable/Disable roundrobin mode. - * - * @param base LPCMP peripheral base address. - * @param enable "true" means enable roundrobin mode, and "false" means disable roundrobin mode. - */ -static inline void LPCMP_EnableRoundRobinMode(LPCMP_Type *base, bool enable) -{ - if (enable) - { - base->RRCR0 |= LPCMP_RRCR0_RR_EN_MASK; - } - else - { - base->RRCR0 &= ~LPCMP_RRCR0_RR_EN_MASK; - } -} - -/*! - * @brief Enable/Disable roundrobin internal timer, note that this function is only valid - * when using the internal trigger source. - * - * @param base LPCMP peripheral base address. - * @param enable "true" means enable roundrobin internal timer, and "false" means disable roundrobin internal timer. - */ -static inline void LPCMP_EnableRoundRobinInternalTimer(LPCMP_Type *base, bool enable) -{ - if (enable) - { - base->RRCR2 |= LPCMP_RRCR2_RR_TIMER_EN_MASK; - } - else - { - base->RRCR2 &= ~LPCMP_RRCR2_RR_TIMER_EN_MASK; - } -} - -/*! - * @brief Set preset value for all channels, users can set all channels' preset vaule through this API, - * for example, if the mask set to 0x03U means channel0 and channel2's preset value set to 1U and other - * channels' preset value set to 0U. - * - * @param base LPCMP peripheral base address. - * @param mask Mask of channel index. - */ -static inline void LPCMP_SetPreSetValue(LPCMP_Type *base, uint8_t mask) -{ - base->RRCSR = (uint32_t)mask; -} - -/*! - * @brief Get comparison results for all channels, users can get all channels' comparison - * results through this API. - * - * @param base LPCMP peripheral base address. - * @return return All channels' comparison result. - */ -static inline uint8_t LPCMP_GetComparisonResult(LPCMP_Type *base) -{ - return (uint8_t)base->RRCSR; -} - -/*! - * @brief Clear input changed flags for single channel or multiple channels, users can clear - * input changed flag of a single channel or multiple channels through this API, for example, - * if the mask set to 0x03U means clear channel0 and channel2's input changed flags. - * - * @param base LPCMP peripheral base address. - * @param mask Mask of channel index. - */ -static inline void LPCMP_ClearInputChangedFlags(LPCMP_Type *base, uint8_t mask) -{ - base->RRSR = (uint32_t)mask; -} - -/*! - * @brief Get input changed flags for all channels, Users can get all channels' input changed - * flags through this API. - * - * @param base LPCMP peripheral base address. - * @return return All channels' changed flag. - */ -static inline uint8_t LPCMP_GetInputChangedFlags(LPCMP_Type *base) -{ - return (uint8_t)base->RRSR; -} - -/*! @} */ - -#endif /* FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE */ - -#if defined(__cplusplus) -} -#endif - -/*! @} */ - -#endif /* FSL_LPCMP_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpi2c.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpi2c.c deleted file mode 100644 index 1c49f2e4a2d..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpi2c.c +++ /dev/null @@ -1,2715 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpi2c.h" -#include -#include - -/* - * $Coverage Justification Reference$ - * - * $Justification fsl_lpi2c_c_ref_1$ - * The default branch cannot be executed in any circumstances, it is only added to avoid MISRA violation. - * - * $Justification fsl_lpi2c_c_ref_2$ - * Two instances failed to simulate #kStatus_LPI2C_Busy. - * - * $Justification fsl_lpi2c_c_ref_3$ - * When the transmission is completed (remaining == 0), the SDF and RSF will be set, and the flags are get before - * that(get before set), it will be over when the next cycle occurs, the first condition cannot be verified, and the - * remaining will not be verified.(will improve) - * - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpi2c" -#endif - -#if defined(LPI2C_RSTS) -#define LPI2C_RESETS_ARRAY LPI2C_RSTS -#endif - -/*! @brief LPI2C master fifo commands. */ -enum -{ - kTxDataCmd = LPI2C_MTDR_CMD(0x0U), /*!< Transmit DATA[7:0] */ - kRxDataCmd = LPI2C_MTDR_CMD(0X1U), /*!< Receive (DATA[7:0] + 1) bytes */ - kStopCmd = LPI2C_MTDR_CMD(0x2U), /*!< Generate STOP condition */ - kStartCmd = LPI2C_MTDR_CMD(0x4U), /*!< Generate(repeated) START and transmit address in DATA[[7:0] */ -}; - -/*! - * @brief Default watermark values. - * - * The default watermarks are set to zero. - */ -enum -{ - kDefaultTxWatermark = 0, - kDefaultRxWatermark = 0, -}; - -/*! @brief States for the state machine used by transactional APIs. */ -enum -{ - kIdleState = 0, - kSendCommandState, - kIssueReadCommandState, - kTransferDataState, - kStopState, - kWaitForCompletionState, -}; - -/*! - * @brief Structure definition for variables that passed as parameters in LPI2C_RunTransferStateMachine. - * The structure is private. - */ -typedef struct _lpi2c_state_machine_param -{ - bool state_complete; /*!< status of complete */ - size_t rxCount; /*!< rx count */ - size_t txCount; /*!< tx count */ - uint32_t status; /*!< machine status */ -} lpi2c_state_machine_param_t; - -/*! @brief Typedef for slave interrupt handler. */ -typedef void (*lpi2c_slave_isr_t)(LPI2C_Type *base, lpi2c_slave_handle_t *handle); - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -static uint32_t LPI2C_GetCyclesForWidth( - uint32_t sourceClock_Hz, uint32_t width_ns, uint32_t minCycles, uint32_t maxCycles, uint32_t prescaler); - -static status_t LPI2C_MasterWaitForTxReady(LPI2C_Type *base); - -static status_t LPI2C_RunTransferStateMachine(LPI2C_Type *base, lpi2c_master_handle_t *handle, bool *isDone); - -static void LPI2C_InitTransferStateMachine(lpi2c_master_handle_t *handle); - -static status_t LPI2C_SlaveCheckAndClearError(LPI2C_Type *base, uint32_t flags); - -static void LPI2C_CommonIRQHandler(LPI2C_Type *base, uint32_t instance); - -/*! - * @brief introduce function LPI2C_TransferStateMachineSendCommandState. - * This function was deal with Send Command State. - * - * @param base The I2C peripheral base address. - * @param handle Master nonblocking driver handle. - * @param variable_set Pass the address of the parent function variable. - */ -static void LPI2C_TransferStateMachineSendCommand(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_state_machine_param_t *stateParams); - -/*! - * @brief introduce function LPI2C_TransferStateMachineIssueReadCommandState. - * This function was deal with Issue Read Command State. - * - * @param base The I2C peripheral base address. - * @param handle Master nonblocking driver handle. - * @param stateParams Pass the address of the parent function variable. - */ -static void LPI2C_TransferStateMachineReadCommand(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_state_machine_param_t *stateParams); - -/*! - * @brief introduce function LPI2C_TransferStateMachineTransferDataState. - * This function was deal with init Transfer Data State. - * - * @param base The I2C peripheral base address. - * @param handle Master nonblocking driver handle. - * @param stateParams Pass the address of the parent function variable. - */ -static void LPI2C_TransferStateMachineTransferData(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_state_machine_param_t *stateParams); - -/*! - * @brief introduce function LPI2C_TransferStateMachineStopState. - * This function was deal with Stop State. - * - * @param base The I2C peripheral base address. - * @param handle Master nonblocking driver handle. - * @param stateParams Pass the address of the parent function variable. - * @param[out] isDone Set to true if the transfer has completed. - */ -static void LPI2C_TransferStateMachineStopState(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_state_machine_param_t *stateParams, - bool *isDone); - -/*! - * @brief introduce function LPI2C_TransferStateMachineWaitState. - * This function was deal with Wait For Completion State. - * - * @param base The I2C peripheral base address. - * @param handle Master nonblocking driver handle. - * @param stateParams Pass the address of the parent function variable. - * @param[out] isDone Set to true if the transfer has completed. - */ -static void LPI2C_TransferStateMachineWaitState(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_state_machine_param_t *stateParams, - bool *isDone); - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/*! @brief Array to map LPI2C instance number to base pointer. */ -static LPI2C_Type *const kLpi2cBases[] = LPI2C_BASE_PTRS; - -/*! @brief Array to map LPI2C instance number to IRQ number, used internally for LPI2C master interrupt and EDMA -transactional APIs. */ -IRQn_Type const kLpi2cIrqs[] = LPI2C_IRQS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Array to map LPI2C instance number to clock gate enum. */ -static clock_ip_name_t const kLpi2cClocks[] = LPI2C_CLOCKS; - -#if defined(LPI2C_PERIPH_CLOCKS) -/*! @brief Array to map LPI2C instance number to pheripheral clock gate enum. */ -static const clock_ip_name_t kLpi2cPeriphClocks[] = LPI2C_PERIPH_CLOCKS; -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/*! @brief Pointer to master IRQ handler for each instance, used internally for LPI2C master interrupt and EDMA -transactional APIs. */ -lpi2c_master_isr_t s_lpi2cMasterIsr; - -/*! @brief Pointers to master handles for each instance, used internally for LPI2C master interrupt and EDMA -transactional APIs. */ -void *s_lpi2cMasterHandle[ARRAY_SIZE(kLpi2cBases)]; - -/*! @brief Pointer to slave IRQ handler for each instance. */ -static lpi2c_slave_isr_t s_lpi2cSlaveIsr; - -/*! @brief Pointers to slave handles for each instance. */ -static lpi2c_slave_handle_t *s_lpi2cSlaveHandle[ARRAY_SIZE(kLpi2cBases)]; - -#if defined(LPI2C_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_lpi2cResets[] = LPI2C_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Returns an instance number given a base address. - * - * If an invalid base address is passed, debug builds will assert. Release builds will just return - * instance number 0. - * - * param base The LPI2C peripheral base address. - * return LPI2C instance number starting from 0. - */ -uint32_t LPI2C_GetInstance(LPI2C_Type *base) -{ - uint32_t instance; - for (instance = 0U; instance < ARRAY_SIZE(kLpi2cBases); ++instance) - { - if (kLpi2cBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(kLpi2cBases)); - return instance; -} - -/*! - * @brief Computes a cycle count for a given time in nanoseconds. - * @param sourceClock_Hz LPI2C functional clock frequency in Hertz. - * @param width_ns Desired with in nanoseconds. - * @param minCycles Minimum cycle count. - * @param maxCycles Maximum cycle count. - * @param prescaler LPI2C prescaler setting. If the cycle period is not affected by the prescaler value, set it to 0. - */ -static uint32_t LPI2C_GetCyclesForWidth( - uint32_t sourceClock_Hz, uint32_t width_ns, uint32_t minCycles, uint32_t maxCycles, uint32_t prescaler) -{ - assert(sourceClock_Hz > 0U); - - uint32_t divider = 1U; - - while (prescaler != 0U) - { - divider *= 2U; - prescaler--; - } - - uint32_t busCycle_ns = 1000000U / (sourceClock_Hz / divider / 1000U); - /* Calculate the cycle count, round up the calculated value. */ - uint32_t cycles = (width_ns * 10U / busCycle_ns + 5U) / 10U; - - /* If the calculated value is smaller than the minimum value, use the minimum value */ - if (cycles < minCycles) - { - cycles = minCycles; - } - /* If the calculated value is larger than the maximum value, use the maxmum value */ - if (cycles > maxCycles) - { - cycles = maxCycles; - } - - return cycles; -} - -/*! - * brief Convert provided flags to status code, and clear any errors if present. - * param base The LPI2C peripheral base address. - * param status Current status flags value that will be checked. - * retval #kStatus_Success - * retval #kStatus_LPI2C_PinLowTimeout - * retval #kStatus_LPI2C_ArbitrationLost - * retval #kStatus_LPI2C_Nak - * retval #kStatus_LPI2C_FifoError - */ -status_t LPI2C_MasterCheckAndClearError(LPI2C_Type *base, uint32_t status) -{ - status_t result = kStatus_Success; - - /* Check for error. These errors cause a stop to automatically be sent. We must */ - /* clear the errors before a new transfer can start. */ - status &= (uint32_t)kLPI2C_MasterErrorFlags; - if (0U != status) - { - /* Select the correct error code. Ordered by severity, with bus issues first. */ - if (0U != (status & (uint32_t)kLPI2C_MasterPinLowTimeoutFlag)) - { - result = kStatus_LPI2C_PinLowTimeout; - } - else if (0U != (status & (uint32_t)kLPI2C_MasterArbitrationLostFlag)) - { - result = kStatus_LPI2C_ArbitrationLost; - } - else if (0U != (status & (uint32_t)kLPI2C_MasterNackDetectFlag)) - { - result = kStatus_LPI2C_Nak; - } - /* - * $Branch Coverage Justification$ - * Before that, the state was stripped of other attributes, and it only contained the four brother flags.(will - * improve) - */ - else if (0U != (status & (uint32_t)kLPI2C_MasterFifoErrFlag)) - { - result = kStatus_LPI2C_FifoError; - } - else - { - ; /* Intentional empty */ - } - - /* Clear the flags. */ - LPI2C_MasterClearStatusFlags(base, status); - - if (((base->MCFGR1 & LPI2C_MCFGR1_IGNACK_MASK) != 0x00U) && (result == kStatus_LPI2C_Nak)) - { - /* ERR051119: If IGNACK was set and nak detect , we will ignore the Nak status */ - result = kStatus_Success; - } - else - { - /* Reset fifos. These flags clear automatically.*/ - base->MCR |= LPI2C_MCR_RRF_MASK | LPI2C_MCR_RTF_MASK; - } - } - else - { - ; /* Intentional empty */ - } - - return result; -} - -/*! - * @brief Wait until there is room in the tx fifo. - * @param base The LPI2C peripheral base address. - * @retval #kStatus_Success - * @retval #kStatus_LPI2C_PinLowTimeout - * @retval #kStatus_LPI2C_ArbitrationLost - * @retval #kStatus_LPI2C_Nak - * @retval #kStatus_LPI2C_FifoError - */ -static status_t LPI2C_MasterWaitForTxReady(LPI2C_Type *base) -{ - status_t result = kStatus_Success; - uint32_t status; - size_t txCount; - size_t txFifoSize = (size_t)FSL_FEATURE_LPI2C_FIFO_SIZEn(base); - -#if I2C_RETRY_TIMES != 0U - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - do - { - /* Get the number of words in the tx fifo and compute empty slots. */ - LPI2C_MasterGetFifoCounts(base, NULL, &txCount); - txCount = txFifoSize - txCount; - - /* Check for error flags. */ - status = LPI2C_MasterGetStatusFlags(base); - result = LPI2C_MasterCheckAndClearError(base, status); - if (kStatus_Success != result) - { - break; - } -#if I2C_RETRY_TIMES != 0U - waitTimes--; - } while ((0U == txCount) && (0U != waitTimes)); - - if (0U == waitTimes) - { - result = kStatus_LPI2C_Timeout; - } -#else - } while (0U == txCount); -#endif - - return result; -} - -/*! - * brief Make sure the bus isn't already busy. - * - * A busy bus is allowed if we are the one driving it. - * - * param base The LPI2C peripheral base address. - * retval #kStatus_Success - * retval #kStatus_LPI2C_Busy - */ -/* Not static so it can be used from fsl_lpi2c_edma.c. */ -status_t LPI2C_CheckForBusyBus(LPI2C_Type *base) -{ - status_t ret = kStatus_Success; - - uint32_t status = LPI2C_MasterGetStatusFlags(base); - /* - * $Branch Coverage Justification$ - * $ref fsl_lpi2c_c_ref_2$ - */ - if ((0U != (status & (uint32_t)kLPI2C_MasterBusBusyFlag)) && (0U == (status & (uint32_t)kLPI2C_MasterBusyFlag))) - { - ret = kStatus_LPI2C_Busy; - } - - return ret; -} - -/*! - * brief Provides a default configuration for the LPI2C master peripheral. - * - * This function provides the following default configuration for the LPI2C master peripheral: - * code - * masterConfig->enableMaster = true; - * masterConfig->debugEnable = false; - * masterConfig->ignoreAck = false; - * masterConfig->pinConfig = kLPI2C_2PinOpenDrain; - * masterConfig->baudRate_Hz = 100000U; - * masterConfig->busIdleTimeout_ns = 0U; - * masterConfig->pinLowTimeout_ns = 0U; - * masterConfig->sdaGlitchFilterWidth_ns = 0U; - * masterConfig->sclGlitchFilterWidth_ns = 0U; - * masterConfig->hostRequest.enable = false; - * masterConfig->hostRequest.source = kLPI2C_HostRequestExternalPin; - * masterConfig->hostRequest.polarity = kLPI2C_HostRequestPinActiveHigh; - * endcode - * - * After calling this function, you can override any settings in order to customize the configuration, - * prior to initializing the master driver with LPI2C_MasterInit(). - * - * param[out] masterConfig User provided configuration structure for default values. Refer to #lpi2c_master_config_t. - */ -void LPI2C_MasterGetDefaultConfig(lpi2c_master_config_t *masterConfig) -{ - /* Initializes the configure structure to zero. */ - (void)memset(masterConfig, 0, sizeof(*masterConfig)); - - masterConfig->enableMaster = true; - masterConfig->debugEnable = false; - masterConfig->enableDoze = true; - masterConfig->ignoreAck = false; - masterConfig->pinConfig = kLPI2C_2PinOpenDrain; - masterConfig->baudRate_Hz = 100000U; - masterConfig->busIdleTimeout_ns = 0U; /* Set to 0 to disable the function */ - masterConfig->pinLowTimeout_ns = 0U; /* Set to 0 to disable the function */ - masterConfig->sdaGlitchFilterWidth_ns = 0U; /* Set to 0 to disable the function */ - masterConfig->sclGlitchFilterWidth_ns = 0U; /* Set to 0 to disable the function */ - masterConfig->hostRequest.enable = false; - masterConfig->hostRequest.source = kLPI2C_HostRequestExternalPin; - masterConfig->hostRequest.polarity = kLPI2C_HostRequestPinActiveHigh; -} - -/*! - * brief Initializes the LPI2C master peripheral. - * - * This function enables the peripheral clock and initializes the LPI2C master peripheral as described by the user - * provided configuration. A software reset is performed prior to configuration. - * - * param base The LPI2C peripheral base address. - * param masterConfig User provided peripheral configuration. Use LPI2C_MasterGetDefaultConfig() to get a set of - * defaults - * that you can override. - * param sourceClock_Hz Frequency in Hertz of the LPI2C functional clock. Used to calculate the baud rate divisors, - * filter widths, and timeout periods. - */ -void LPI2C_MasterInit(LPI2C_Type *base, const lpi2c_master_config_t *masterConfig, uint32_t sourceClock_Hz) -{ - uint32_t prescaler; - uint32_t cycles; - uint32_t cfgr2; - uint32_t value; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - - uint32_t instance = LPI2C_GetInstance(base); - - /* Ungate the clock. */ - (void)CLOCK_EnableClock(kLpi2cClocks[instance]); -#if defined(LPI2C_PERIPH_CLOCKS) - /* Ungate the functional clock in initialize function. */ - CLOCK_EnableClock(kLpi2cPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(LPI2C_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_lpi2cResets[LPI2C_GetInstance(base)]); -#endif - - /* Reset peripheral before configuring it. */ - LPI2C_MasterReset(base); - - /* Doze bit: 0 is enable, 1 is disable */ - base->MCR = LPI2C_MCR_DBGEN(masterConfig->debugEnable) | LPI2C_MCR_DOZEN(!(masterConfig->enableDoze)); - - /* host request */ - value = base->MCFGR0; - value &= (~(LPI2C_MCFGR0_HREN_MASK | LPI2C_MCFGR0_HRPOL_MASK | LPI2C_MCFGR0_HRSEL_MASK)); - value |= LPI2C_MCFGR0_HREN(masterConfig->hostRequest.enable) | - LPI2C_MCFGR0_HRPOL(masterConfig->hostRequest.polarity) | - LPI2C_MCFGR0_HRSEL(masterConfig->hostRequest.source); - base->MCFGR0 = value; - - /* pin config and ignore ack */ - value = base->MCFGR1; - value &= ~(LPI2C_MCFGR1_PINCFG_MASK | LPI2C_MCFGR1_IGNACK_MASK); - value |= LPI2C_MCFGR1_PINCFG(masterConfig->pinConfig); - value |= LPI2C_MCFGR1_IGNACK(masterConfig->ignoreAck); - base->MCFGR1 = value; - - LPI2C_MasterSetWatermarks(base, (size_t)kDefaultTxWatermark, (size_t)kDefaultRxWatermark); - - /* Configure glitch filters. */ - cfgr2 = base->MCFGR2; - if (0U != (masterConfig->sdaGlitchFilterWidth_ns)) - { - /* Calculate SDA filter width. The width is equal to FILTSDA cycles of functional clock. - And set FILTSDA to 0 disables the fileter, so the min value is 1. */ - cycles = LPI2C_GetCyclesForWidth(sourceClock_Hz, masterConfig->sdaGlitchFilterWidth_ns, 1U, - (LPI2C_MCFGR2_FILTSDA_MASK >> LPI2C_MCFGR2_FILTSDA_SHIFT), 0U); - cfgr2 &= ~LPI2C_MCFGR2_FILTSDA_MASK; - cfgr2 |= LPI2C_MCFGR2_FILTSDA(cycles); - } - if (0U != masterConfig->sclGlitchFilterWidth_ns) - { - /* Calculate SDL filter width. The width is equal to FILTSCL cycles of functional clock. - And set FILTSCL to 0 disables the fileter, so the min value is 1. */ - cycles = LPI2C_GetCyclesForWidth(sourceClock_Hz, masterConfig->sclGlitchFilterWidth_ns, 1U, - (LPI2C_MCFGR2_FILTSCL_MASK >> LPI2C_MCFGR2_FILTSCL_SHIFT), 0U); - cfgr2 &= ~LPI2C_MCFGR2_FILTSCL_MASK; - cfgr2 |= LPI2C_MCFGR2_FILTSCL(cycles); - } - base->MCFGR2 = cfgr2; - - /* Configure baudrate after the SDA/SCL glitch filter setting, - since the baudrate calculation needs them as parameter. */ - LPI2C_MasterSetBaudRate(base, sourceClock_Hz, masterConfig->baudRate_Hz); - - /* Configure bus idle and pin low timeouts after baudrate setting, - since the timeout calculation needs prescaler as parameter. */ - prescaler = (base->MCFGR1 & LPI2C_MCFGR1_PRESCALE_MASK) >> LPI2C_MCFGR1_PRESCALE_SHIFT; - - if (0U != (masterConfig->busIdleTimeout_ns)) - { - /* Calculate bus idle timeout value. The value is equal to BUSIDLE cycles of functional clock divided by - prescaler. And set BUSIDLE to 0 disables the fileter, so the min value is 1. */ - cycles = LPI2C_GetCyclesForWidth(sourceClock_Hz, masterConfig->busIdleTimeout_ns, 1U, - (LPI2C_MCFGR2_BUSIDLE_MASK >> LPI2C_MCFGR2_BUSIDLE_SHIFT), prescaler); - base->MCFGR2 = (base->MCFGR2 & (~LPI2C_MCFGR2_BUSIDLE_MASK)) | LPI2C_MCFGR2_BUSIDLE(cycles); - } - if (0U != masterConfig->pinLowTimeout_ns) - { - /* Calculate bus pin low timeout value. The value is equal to PINLOW cycles of functional clock divided by - prescaler. And set PINLOW to 0 disables the fileter, so the min value is 1. */ - cycles = LPI2C_GetCyclesForWidth(sourceClock_Hz, masterConfig->pinLowTimeout_ns / 256U, 1U, - (LPI2C_MCFGR2_BUSIDLE_MASK >> LPI2C_MCFGR2_BUSIDLE_SHIFT), prescaler); - base->MCFGR3 = (base->MCFGR3 & ~LPI2C_MCFGR3_PINLOW_MASK) | LPI2C_MCFGR3_PINLOW(cycles); - } - - LPI2C_MasterEnable(base, masterConfig->enableMaster); -} - -/*! - * brief Deinitializes the LPI2C master peripheral. - * - * This function disables the LPI2C master peripheral and gates the clock. It also performs a software - * reset to restore the peripheral to reset conditions. - * - * param base The LPI2C peripheral base address. - */ -void LPI2C_MasterDeinit(LPI2C_Type *base) -{ - /* Restore to reset state. */ - LPI2C_MasterReset(base); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - - uint32_t instance = LPI2C_GetInstance(base); - - /* Gate clock. */ - (void)CLOCK_DisableClock(kLpi2cClocks[instance]); -#if defined(LPI2C_PERIPH_CLOCKS) - /* Gate the functional clock. */ - CLOCK_DisableClock(kLpi2cPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Configures LPI2C master data match feature. - * - * param base The LPI2C peripheral base address. - * param matchConfig Settings for the data match feature. - */ -void LPI2C_MasterConfigureDataMatch(LPI2C_Type *base, const lpi2c_data_match_config_t *matchConfig) -{ - /* Disable master mode. */ - bool wasEnabled = (0U != ((base->MCR & LPI2C_MCR_MEN_MASK) >> LPI2C_MCR_MEN_SHIFT)); - LPI2C_MasterEnable(base, false); - - base->MCFGR1 = (base->MCFGR1 & ~LPI2C_MCFGR1_MATCFG_MASK) | LPI2C_MCFGR1_MATCFG(matchConfig->matchMode); - base->MCFGR0 = (base->MCFGR0 & ~LPI2C_MCFGR0_RDMO_MASK) | LPI2C_MCFGR0_RDMO(matchConfig->rxDataMatchOnly); - base->MDMR = LPI2C_MDMR_MATCH0(matchConfig->match0) | LPI2C_MDMR_MATCH1(matchConfig->match1); - - /* Restore master mode. */ - if (wasEnabled) - { - LPI2C_MasterEnable(base, true); - } -} - -/*! - * brief Sets the I2C bus frequency for master transactions. - * - * The LPI2C master is automatically disabled and re-enabled as necessary to configure the baud - * rate. Do not call this function during a transfer, or the transfer is aborted. - * - * note Please note that the second parameter is the clock frequency of LPI2C module, the third - * parameter means user configured bus baudrate, this implementation is different from other I2C drivers - * which use baudrate configuration as second parameter and source clock frequency as third parameter. - * - * param base The LPI2C peripheral base address. - * param sourceClock_Hz LPI2C functional clock frequency in Hertz. - * param baudRate_Hz Requested bus frequency in Hertz. - */ -void LPI2C_MasterSetBaudRate(LPI2C_Type *base, uint32_t sourceClock_Hz, uint32_t baudRate_Hz) -{ - bool wasEnabled; - uint8_t filtScl = (uint8_t)((base->MCFGR2 & LPI2C_MCFGR2_FILTSCL_MASK) >> LPI2C_MCFGR2_FILTSCL_SHIFT); - - uint8_t divider = 1U; - uint8_t bestDivider = 1U; - uint8_t prescale = 0U; - uint8_t bestPre = 0U; - - uint8_t clkCycle; - uint8_t bestclkCycle = 0U; - - uint32_t absError = 0U; - uint32_t bestError = 0xffffffffu; - uint32_t computedRate; - - uint32_t tmpReg = 0U; - - /* Disable master mode. */ - wasEnabled = (0U != ((base->MCR & LPI2C_MCR_MEN_MASK) >> LPI2C_MCR_MEN_SHIFT)); - LPI2C_MasterEnable(base, false); - - /* Baud rate = (sourceClock_Hz / 2 ^ prescale) / (CLKLO + 1 + CLKHI + 1 + SCL_LATENCY) - * SCL_LATENCY = ROUNDDOWN((2 + FILTSCL) / (2 ^ prescale)) - */ - for (prescale = 0U; prescale <= 7U; prescale++) - { - /* Calculate the clkCycle, clkCycle = CLKLO + CLKHI, divider = 2 ^ prescale */ - clkCycle = (uint8_t)((10U * sourceClock_Hz / divider / baudRate_Hz + 5U) / 10U - (2U + filtScl) / divider - 2U); - /* According to register description, The max value for CLKLO and CLKHI is 63. - however to meet the I2C specification of tBUF, CLKHI should be less than - clkCycle - 0.52 x sourceClock_Hz / baudRate_Hz / divider + 1U. Refer to the comment of the tmpHigh's - calculation for details. So we have: - CLKHI < clkCycle - 0.52 x sourceClock_Hz / baudRate_Hz / divider + 1U, - clkCycle = CLKHI + CLKLO and - sourceClock_Hz / baudRate_Hz / divider = clkCycle + 2 + ROUNDDOWN((2 + FILTSCL) / divider), - we can come up with: CLKHI < 0.92 x CLKLO - ROUNDDOWN(2 + FILTSCL) / divider - so the max boundary of CLKHI should be 0.92 x 63 - ROUNDDOWN(2 + FILTSCL) / divider, - and the max boundary of clkCycle is 1.92 x 63 - ROUNDDOWN(2 + FILTSCL) / divider. */ - if (clkCycle > (120U - (2U + filtScl) / divider)) - { - divider *= 2U; - continue; - } - /* Calculate the computed baudrate and compare it with the desired baudrate */ - computedRate = (sourceClock_Hz / (uint32_t)divider) / - ((uint32_t)clkCycle + 2U + (2U + (uint32_t)filtScl) / (uint32_t)divider); - absError = baudRate_Hz > computedRate ? baudRate_Hz - computedRate : computedRate - baudRate_Hz; - if (absError < bestError) - { - bestPre = prescale; - bestDivider = divider; - bestclkCycle = clkCycle; - bestError = absError; - - /* If the error is 0, then we can stop searching because we won't find a better match. */ - if (absError == 0U) - { - break; - } - } - divider *= 2U; - } - - /* SCL low time tLO should be larger than or equal to SCL high time tHI: - tLO = ((CLKLO + 1) x (2 ^ PRESCALE)) >= tHI = ((CLKHI + 1 + SCL_LATENCY) x (2 ^ PRESCALE)), - which is CLKLO >= CLKHI + (2U + filtScl) / bestDivider. - Also since bestclkCycle = CLKLO + CLKHI, bestDivider = 2 ^ PRESCALE - which makes CLKHI <= (bestclkCycle - (2U + filtScl) / bestDivider) / 2U. - - The max tBUF should be at least 0.52 times of the SCL clock cycle: - tBUF = ((CLKLO + 1) x (2 ^ PRESCALE) / sourceClock_Hz) > (0.52 / baudRate_Hz), - plus bestDivider = 2 ^ PRESCALE, bestclkCycle = CLKLO + CLKHI we can come up with - CLKHI <= (bestclkCycle - 0.52 x sourceClock_Hz / baudRate_Hz / bestDivider + 1U). - In this case to get a safe CLKHI calculation, we can assume: - */ - uint8_t tmpHigh = (bestclkCycle - (2U + filtScl) / bestDivider) / 2U; - while (tmpHigh > (bestclkCycle - 52U * sourceClock_Hz / baudRate_Hz / bestDivider / 100U + 1U)) - { - tmpHigh = tmpHigh - 1U; - } - - /* Calculate DATAVD and SETHOLD. - To meet the timing requirement of I2C spec for standard mode, fast mode and fast mode plus: */ - /* The min tHD:STA/tSU:STA/tSU:STO should be at least 0.4 times of the SCL clock cycle, use 0.5 to be safe: - tHD:STA = ((SETHOLD + 1) x (2 ^ PRESCALE) / sourceClock_Hz) > (0.5 / baudRate_Hz), bestDivider = 2 ^ PRESCALE */ - uint8_t tmpHold = (uint8_t)(sourceClock_Hz / baudRate_Hz / bestDivider / 2U) - 1U; - - /* The max tVD:DAT/tVD:ACK/tHD:DAT should be at most 0.345 times of the SCL clock cycle, use 0.25 to be safe: - tVD:DAT = ((DATAVD + 1) x (2 ^ PRESCALE) / sourceClock_Hz) < (0.25 / baudRate_Hz), bestDivider = 2 ^ PRESCALE */ - uint8_t tmpDataVd = (uint8_t)(sourceClock_Hz / baudRate_Hz / bestDivider / 4U) - 1U; - - /* The min tSU:DAT should be at least 0.05 times of the SCL clock cycle: - tSU:DAT = ((2 + FILTSDA + 2 ^ PRESCALE) / sourceClock_Hz) >= (0.05 / baud), - plus bestDivider = 2 ^ PRESCALE, we can come up with: - FILTSDA >= (0.05 x sourceClock_Hz / baudRate_Hz - bestDivider - 2) */ - if ((sourceClock_Hz / baudRate_Hz / 20U) > (bestDivider + 2U)) - { - /* Read out the FILTSDA configuration, if it is smaller than expected, change the setting. */ - uint8_t filtSda = (uint8_t)((base->MCFGR2 & LPI2C_MCFGR2_FILTSDA_MASK) >> LPI2C_MCFGR2_FILTSDA_SHIFT); - if (filtSda < (sourceClock_Hz / baudRate_Hz / 20U - bestDivider - 2U)) - { - filtSda = (uint8_t)(sourceClock_Hz / baudRate_Hz / 20U) - bestDivider - 2U; - } - base->MCFGR2 = (base->MCFGR2 & ~LPI2C_MCFGR2_FILTSDA_MASK) | LPI2C_MCFGR2_FILTSDA(filtSda); - } - - /* Set CLKHI, CLKLO, SETHOLD, DATAVD value. */ - tmpReg = LPI2C_MCCR0_CLKHI((uint32_t)tmpHigh) | - LPI2C_MCCR0_CLKLO((uint32_t)((uint32_t)bestclkCycle - (uint32_t)tmpHigh)) | - LPI2C_MCCR0_SETHOLD((uint32_t)tmpHold) | LPI2C_MCCR0_DATAVD((uint32_t)tmpDataVd); - base->MCCR0 = tmpReg; - - /* Set PRESCALE value. */ - base->MCFGR1 = (base->MCFGR1 & ~LPI2C_MCFGR1_PRESCALE_MASK) | LPI2C_MCFGR1_PRESCALE(bestPre); - - /* Restore master mode. */ - if (wasEnabled) - { - LPI2C_MasterEnable(base, true); - } -} - -/*! - * brief Sends a START signal and slave address on the I2C bus. - * - * This function is used to initiate a new master mode transfer. First, the bus state is checked to ensure - * that another master is not occupying the bus. Then a START signal is transmitted, followed by the - * 7-bit address specified in the a address parameter. Note that this function does not actually wait - * until the START and address are successfully sent on the bus before returning. - * - * param base The LPI2C peripheral base address. - * param address 7-bit slave device address, in bits [6:0]. - * param dir Master transfer direction, either #kLPI2C_Read or #kLPI2C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * retval #kStatus_Success START signal and address were successfully enqueued in the transmit FIFO. - * retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - */ -status_t LPI2C_MasterStart(LPI2C_Type *base, uint8_t address, lpi2c_direction_t dir) -{ - /* Return an error if the bus is already in use not by us. */ - status_t result = LPI2C_CheckForBusyBus(base); - /* - * $Branch Coverage Justification$ - * $ref fsl_lpi2c_c_ref_2$ - */ - if (kStatus_Success == result) - { - /* Clear all flags. */ - LPI2C_MasterClearStatusFlags(base, (uint32_t)kLPI2C_MasterClearFlags); - - /* Turn off auto-stop option. */ - base->MCFGR1 &= ~LPI2C_MCFGR1_AUTOSTOP_MASK; - - /* Wait until there is room in the fifo. */ - result = LPI2C_MasterWaitForTxReady(base); - if (kStatus_Success == result) - { - /* Issue start command. */ - base->MTDR = (uint32_t)kStartCmd | (((uint32_t)address << 1U) | (uint32_t)dir); - } - } - - return result; -} - -/*! - * brief Sends a STOP signal on the I2C bus. - * - * This function does not return until the STOP signal is seen on the bus, or an error occurs. - * - * param base The LPI2C peripheral base address. - * retval #kStatus_Success The STOP signal was successfully sent on the bus and the transaction terminated. - * retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_LPI2C_FifoError FIFO under run or overrun. - * retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterStop(LPI2C_Type *base) -{ - /* Wait until there is room in the fifo. */ - status_t result = LPI2C_MasterWaitForTxReady(base); - if (kStatus_Success == result) - { - /* Send the STOP signal */ - base->MTDR = (uint32_t)kStopCmd; - - /* Wait for the stop detected flag to set, indicating the transfer has completed on the bus. */ - /* Also check for errors while waiting. */ -#if I2C_RETRY_TIMES != 0U - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - -#if I2C_RETRY_TIMES != 0U - while ((result == kStatus_Success) && (0U != waitTimes)) - { - waitTimes--; -#else - while (result == kStatus_Success) - { -#endif - uint32_t status = LPI2C_MasterGetStatusFlags(base); - - /* Check for error flags. */ - result = LPI2C_MasterCheckAndClearError(base, status); - - /* Check if the stop was sent successfully. */ - if ((0U != (status & (uint32_t)kLPI2C_MasterStopDetectFlag)) && - (0U != (status & (uint32_t)kLPI2C_MasterTxReadyFlag))) - { - LPI2C_MasterClearStatusFlags(base, (uint32_t)kLPI2C_MasterStopDetectFlag); - break; - } - } - -#if I2C_RETRY_TIMES != 0U - if (0U == waitTimes) - { - result = kStatus_LPI2C_Timeout; - } -#endif - } - - return result; -} - -/*! - * brief Performs a polling receive transfer on the I2C bus. - * - * param base The LPI2C peripheral base address. - * param rxBuff The pointer to the data to be transferred. - * param rxSize The length in bytes of the data to be transferred. - * retval #kStatus_Success Data was received successfully. - * retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_LPI2C_FifoError FIFO under run or overrun. - * retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterReceive(LPI2C_Type *base, void *rxBuff, size_t rxSize) -{ - assert(NULL != rxBuff); - - status_t result = kStatus_Success; - uint8_t *buf; - size_t tmpRxSize = rxSize; -#if I2C_RETRY_TIMES != 0U - uint32_t waitTimes; -#endif - - /* Check transfer data size. */ - if (rxSize > ((size_t)256 * (size_t)FSL_FEATURE_LPI2C_FIFO_SIZEn(base))) - { - return kStatus_InvalidArgument; - } - - /* Handle empty read. */ - if (rxSize != 0U) - { - /* Wait until there is room in the command fifo. */ - result = LPI2C_MasterWaitForTxReady(base); - if (kStatus_Success == result) - { - /* Issue command to receive data. A single write to MTDR can issue read operation of 0xFFU + 1 byte of data - at most, so when the rxSize is larger than 0x100U, push multiple read commands to MTDR until rxSize is - reached. */ - while (tmpRxSize != 0U) - { - if (tmpRxSize > 256U) - { - base->MTDR = (uint32_t)(kRxDataCmd) | (uint32_t)LPI2C_MTDR_DATA(0xFFU); - tmpRxSize -= 256U; - } - else - { - base->MTDR = (uint32_t)(kRxDataCmd) | (uint32_t)LPI2C_MTDR_DATA(tmpRxSize - 1U); - tmpRxSize = 0U; - } - } - - /* Receive data */ - buf = (uint8_t *)rxBuff; - while (0U != (rxSize--)) - { -#if I2C_RETRY_TIMES != 0U - waitTimes = I2C_RETRY_TIMES; -#endif - /* Read LPI2C receive fifo register. The register includes a flag to indicate whether */ - /* the FIFO is empty, so we can both get the data and check if we need to keep reading */ - /* using a single register read. */ - uint32_t value = 0U; - do - { - /* Check for errors. */ - result = LPI2C_MasterCheckAndClearError(base, LPI2C_MasterGetStatusFlags(base)); - if (kStatus_Success != result) - { - break; - } - - value = base->MRDR; -#if I2C_RETRY_TIMES != 0U - waitTimes--; - } while ((0U != (value & LPI2C_MRDR_RXEMPTY_MASK)) && (0U != waitTimes)); - if (0U == waitTimes) - { - result = kStatus_LPI2C_Timeout; - } -#else - } while (0U != (value & LPI2C_MRDR_RXEMPTY_MASK)); -#endif - if ((status_t)kStatus_Success != result) - { - break; - } - - *buf++ = (uint8_t)(value & LPI2C_MRDR_DATA_MASK); - } - } - } - - return result; -} - -/*! - * brief Performs a polling send transfer on the I2C bus. - * - * Sends up to a txSize number of bytes to the previously addressed slave device. The slave may - * reply with a NAK to any byte in order to terminate the transfer early. If this happens, this - * function returns #kStatus_LPI2C_Nak. - * - * param base The LPI2C peripheral base address. - * param txBuff The pointer to the data to be transferred. - * param txSize The length in bytes of the data to be transferred. - * retval #kStatus_Success Data was sent successfully. - * retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_LPI2C_FifoError FIFO under run or over run. - * retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterSend(LPI2C_Type *base, void *txBuff, size_t txSize) -{ - status_t result = kStatus_Success; - uint8_t *buf = (uint8_t *)txBuff; - - assert(NULL != txBuff); - - /* Send data buffer */ - while (0U != (txSize--)) - { - /* Wait until there is room in the fifo. This also checks for errors. */ - result = LPI2C_MasterWaitForTxReady(base); - if (kStatus_Success != result) - { - break; - } - - /* Write byte into LPI2C master data register. */ - base->MTDR = *buf++; - } - - return result; -} - -/*! - * brief Performs a master polling transfer on the I2C bus. - * - * note The API does not return until the transfer succeeds or fails due - * to error happens during transfer. - * - * param base The LPI2C peripheral base address. - * param transfer Pointer to the transfer structure. - * retval #kStatus_Success Data was received successfully. - * retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_LPI2C_FifoError FIFO under run or overrun. - * retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterTransferBlocking(LPI2C_Type *base, lpi2c_master_transfer_t *transfer) -{ - assert(NULL != transfer); - assert(transfer->subaddressSize <= sizeof(transfer->subaddress)); - - status_t result = kStatus_Success; - uint16_t commandBuffer[7]; - uint32_t cmdCount = 0U; - - /* Check transfer data size in read operation. */ - if ((transfer->direction == kLPI2C_Read) && - (transfer->dataSize > ((size_t)256 * (size_t)FSL_FEATURE_LPI2C_FIFO_SIZEn(base)))) - { - return kStatus_InvalidArgument; - } - - /* Enable the master function and disable the slave function. */ - LPI2C_MasterEnable(base, true); - LPI2C_SlaveEnable(base, false); - - /* Return an error if the bus is already in use not by us. */ - result = LPI2C_CheckForBusyBus(base); - /* - * $Branch Coverage Justification$ - * $ref fsl_lpi2c_c_ref_2$ - */ - if (kStatus_Success == result) - { - /* Clear all flags. */ - LPI2C_MasterClearStatusFlags(base, (uint32_t)kLPI2C_MasterClearFlags); - - /* Turn off auto-stop option. */ - base->MCFGR1 &= ~LPI2C_MCFGR1_AUTOSTOP_MASK; - - lpi2c_direction_t direction = (0U != transfer->subaddressSize) ? kLPI2C_Write : transfer->direction; - if (0U == (transfer->flags & (uint32_t)kLPI2C_TransferNoStartFlag)) - { - commandBuffer[cmdCount++] = - (uint16_t)kStartCmd | - (uint16_t)((uint16_t)((uint16_t)transfer->slaveAddress << 1U) | (uint16_t)direction); - } - - /* Subaddress, MSB first. */ - if (0U != transfer->subaddressSize) - { - uint32_t subaddressRemaining = transfer->subaddressSize; - while (0U != subaddressRemaining--) - { - uint8_t subaddressByte = (uint8_t)((transfer->subaddress >> (8U * subaddressRemaining)) & 0xffU); - commandBuffer[cmdCount++] = subaddressByte; - } - } - - /* Reads need special handling. */ - if ((0U != transfer->dataSize) && (transfer->direction == kLPI2C_Read)) - { - /* Need to send repeated start if switching directions to read. */ - if (direction == kLPI2C_Write) - { - commandBuffer[cmdCount++] = - (uint16_t)kStartCmd | - (uint16_t)((uint16_t)((uint16_t)transfer->slaveAddress << 1U) | (uint16_t)kLPI2C_Read); - } - } - - /* Send command buffer */ - uint32_t index = 0U; - while (0U != cmdCount--) - { - /* Wait until there is room in the fifo. This also checks for errors. */ - result = LPI2C_MasterWaitForTxReady(base); - if (kStatus_Success != result) - { - break; - } - - /* Write byte into LPI2C master data register. */ - base->MTDR = commandBuffer[index]; - index++; - } - - if (kStatus_Success == result) - { - /* Transmit data. */ - if ((transfer->direction == kLPI2C_Write) && (transfer->dataSize > 0U)) - { - /* Send Data. */ - result = LPI2C_MasterSend(base, transfer->data, transfer->dataSize); - } - - /* Receive Data. */ - if ((transfer->direction == kLPI2C_Read) && (transfer->dataSize > 0U)) - { - result = LPI2C_MasterReceive(base, transfer->data, transfer->dataSize); - } - /* - * $Branch Coverage Justification$ - * Errors cannot be simulated by software during transmission.(will improve) - */ - if (kStatus_Success == result) - { - if ((transfer->flags & (uint32_t)kLPI2C_TransferNoStopFlag) == 0U) - { - result = LPI2C_MasterStop(base); - } - } - } - - /* Transmit fail */ - if (kStatus_Success != result) - { - if ((transfer->flags & (uint32_t)kLPI2C_TransferNoStopFlag) == 0U) - { - (void)LPI2C_MasterStop(base); - } - } - } - - return result; -} - -/*! - * brief Creates a new handle for the LPI2C master non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the LPI2C_MasterTransferAbort() API shall be called. - * - * - * note The function also enables the NVIC IRQ for the input LPI2C. Need to notice - * that on some SoCs the LPI2C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - * - * param base The LPI2C peripheral base address. - * param[out] handle Pointer to the LPI2C master driver handle. - * param callback User provided pointer to the asynchronous callback function. - * param userData User provided pointer to the application callback data. - */ -void LPI2C_MasterTransferCreateHandle(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_master_transfer_callback_t callback, - void *userData) -{ - uint32_t instance; - - assert(NULL != handle); - - /* Clear out the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Look up instance number */ - instance = LPI2C_GetInstance(base); - - /* Save base and instance. */ - handle->completionCallback = callback; - handle->userData = userData; - - /* Save this handle for IRQ use. */ - s_lpi2cMasterHandle[instance] = handle; - - /* Set irq handler. */ - s_lpi2cMasterIsr = LPI2C_MasterTransferHandleIRQ; - - /* Clear internal IRQ enables and enable NVIC IRQ. */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - - /* Enable NVIC IRQ, this only enables the IRQ directly connected to the NVIC. - In some cases the LPI2C IRQ is configured through INTMUX, user needs to enable - INTMUX IRQ in application code. */ - (void)EnableIRQ(kLpi2cIrqs[instance]); -} - -static void LPI2C_TransferStateMachineSendCommand(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_state_machine_param_t *stateParams) -{ - assert(stateParams != NULL); - uint16_t sendval; - - /* Make sure there is room in the tx fifo for the next command. */ - if (0U == (stateParams->txCount)--) - { - stateParams->state_complete = true; - return; - } - - /* Issue command. buf is a uint8_t* pointing at the uint16 command array. */ - sendval = ((uint16_t)handle->buf[0]) | (((uint16_t)handle->buf[1]) << 8U); - base->MTDR = sendval; - handle->buf++; - handle->buf++; - - /* Count down until all commands are sent. */ - if (--handle->remainingBytes == 0U) - { - /* Choose next state and set up buffer pointer and count. */ - if (0U != handle->transfer.dataSize) - { - /* Either a send or receive transfer is next. */ - handle->state = (uint8_t)kTransferDataState; - handle->buf = (uint8_t *)handle->transfer.data; - handle->remainingBytes = (uint16_t)handle->transfer.dataSize; - if (handle->transfer.direction == kLPI2C_Read) - { - /* Disable TX interrupt */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterTxReadyFlag); - /* Issue command to receive data. A single write to MTDR can issue read operation of - 0xFFU + 1 byte of data at most, so when the dataSize is larger than 0x100U, push - multiple read commands to MTDR until dataSize is reached. */ - size_t tmpRxSize = handle->transfer.dataSize; - while (tmpRxSize != 0U) - { - LPI2C_MasterGetFifoCounts(base, NULL, &stateParams->txCount); - /* - * $Branch Coverage Justification$ - * The transmission commands will not exceed FIFO SIZE.(will improve) - */ - while ((size_t)FSL_FEATURE_LPI2C_FIFO_SIZEn(base) == stateParams->txCount) - { - LPI2C_MasterGetFifoCounts(base, NULL, &stateParams->txCount); - } - - if (tmpRxSize > 256U) - { - base->MTDR = (uint32_t)(kRxDataCmd) | (uint32_t)LPI2C_MTDR_DATA(0xFFU); - tmpRxSize -= 256U; - } - else - { - base->MTDR = (uint32_t)(kRxDataCmd) | (uint32_t)LPI2C_MTDR_DATA(tmpRxSize - 1U); - tmpRxSize = 0U; - } - } - } - } - else - { - /* No transfer, so move to stop state. */ - handle->state = (uint8_t)kStopState; - } - } -} - -static void LPI2C_TransferStateMachineReadCommand(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_state_machine_param_t *stateParams) -{ - assert(stateParams != NULL); - - /* Make sure there is room in the tx fifo for the read command. */ - if (0U == (stateParams->txCount)--) - { - stateParams->state_complete = true; - return; - } - - base->MTDR = (uint32_t)kRxDataCmd | LPI2C_MTDR_DATA(handle->transfer.dataSize - 1U); - - /* Move to transfer state. */ - handle->state = (uint8_t)kTransferDataState; - if (handle->transfer.direction == kLPI2C_Read) - { - /* Disable TX interrupt */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterTxReadyFlag); - } -} - -static void LPI2C_TransferStateMachineTransferData(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_state_machine_param_t *stateParams) -{ - assert(stateParams != NULL); - - if (handle->transfer.direction == kLPI2C_Write) - { - /* Make sure there is room in the tx fifo. */ - if (0U == stateParams->txCount--) - { - stateParams->state_complete = true; - return; - } - - /* Put byte to send in fifo. */ - base->MTDR = *(handle->buf)++; - } - else - { - /* XXX handle receive sizes > 256, use kIssueReadCommandState */ - /* Make sure there is data in the rx fifo. */ - if (0U == stateParams->rxCount--) - { - stateParams->state_complete = true; - return; - } - - /* Read byte from fifo. */ - *(handle->buf)++ = (uint8_t)(base->MRDR & LPI2C_MRDR_DATA_MASK); - } - - /* Move to stop when the transfer is done. */ - if (--handle->remainingBytes == 0U) - { - if (handle->transfer.direction == kLPI2C_Write) - { - stateParams->state_complete = true; - } - handle->state = (uint8_t)kStopState; - } -} - -static void LPI2C_TransferStateMachineStopState(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_state_machine_param_t *stateParams, - bool *isDone) -{ - assert(stateParams != NULL); - - /* Only issue a stop transition if the caller requested it. */ - if ((handle->transfer.flags & (uint32_t)kLPI2C_TransferNoStopFlag) == 0U) - { - /* Make sure there is room in the tx fifo for the stop command. */ - if (0U == (stateParams->txCount)--) - { - stateParams->state_complete = true; - return; - } - - base->MTDR = (uint32_t)kStopCmd; - } - else - { - /* If all data is read and no stop flag is required to send, we are done. */ - if (handle->transfer.direction == kLPI2C_Read) - { - *isDone = true; - } - stateParams->state_complete = true; - } - handle->state = (uint8_t)kWaitForCompletionState; -} - -static void LPI2C_TransferStateMachineWaitState(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_state_machine_param_t *stateParams, - bool *isDone) -{ - assert(stateParams != NULL); - - if ((handle->transfer.flags & (uint32_t)kLPI2C_TransferNoStopFlag) == 0U) - { - /* We stay in this state until the stop state is detected. */ - if (0U != ((stateParams->status) & (uint32_t)kLPI2C_MasterStopDetectFlag)) - { - *isDone = true; - } - } - else - { - /* If all data is pushed to FIFO and no stop flag is required to send, we need to make sure they - are all send out to bus. */ - if ((handle->transfer.direction == kLPI2C_Write) && ((base->MFSR & LPI2C_MFSR_TXCOUNT_MASK) == 0U)) - { - /* We stay in this state until the data is sent out to bus. */ - *isDone = true; - } - } - stateParams->state_complete = true; -} - -/*! - * @brief Execute states until FIFOs are exhausted. - * @param handle Master nonblocking driver handle. - * @param[out] isDone Set to true if the transfer has completed. - * @retval #kStatus_Success - * @retval #kStatus_LPI2C_PinLowTimeout - * @retval #kStatus_LPI2C_ArbitrationLost - * @retval #kStatus_LPI2C_Nak - * @retval #kStatus_LPI2C_FifoError - */ -static status_t LPI2C_RunTransferStateMachine(LPI2C_Type *base, lpi2c_master_handle_t *handle, bool *isDone) -{ - assert(NULL != base && NULL != handle && NULL != isDone); - - status_t result = kStatus_Success; - lpi2c_state_machine_param_t stateParams; - (void)memset(&stateParams, 0, sizeof(stateParams)); - - stateParams.state_complete = false; - - /* Set default isDone return value. */ - *isDone = false; - - /* Check for errors. */ - stateParams.status = LPI2C_MasterGetStatusFlags(base); - - /* Get fifo counts. */ - LPI2C_MasterGetFifoCounts(base, &stateParams.rxCount, &stateParams.txCount); - - /* For the last byte, nack flag is expected. - Do not check and clear kLPI2C_MasterNackDetectFlag for the last byte, - in case FIFO is emptied when stop command has not been sent. */ - if (handle->remainingBytes == 0U) - { - /* When data size is not zero which means it is not only one byte of address is sent, and */ - /* when the txfifo is empty, or have one byte which is the stop command, then the nack status can be ignored. */ - if (((handle->transfer).dataSize != 0U) && - ((stateParams.txCount == 0U) || - (((stateParams.txCount) == 1U) && (handle->state == (uint8_t)kWaitForCompletionState) && - (((handle->transfer).flags & (uint32_t)kLPI2C_TransferNoStopFlag) == 0U)))) - { - (stateParams.status) &= ~(uint32_t)kLPI2C_MasterNackDetectFlag; - } - } - - result = LPI2C_MasterCheckAndClearError(base, stateParams.status); - - if (kStatus_Success == result) - { - /* Compute room in tx fifo */ - stateParams.txCount = (size_t)FSL_FEATURE_LPI2C_FIFO_SIZEn(base) - stateParams.txCount; - - while (!stateParams.state_complete) - { - /* Execute the state. */ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpi2c_c_ref_1$ - */ - switch (handle->state) - { - case (uint8_t)kSendCommandState: - LPI2C_TransferStateMachineSendCommand(base, handle, &stateParams); - break; - - case (uint8_t)kIssueReadCommandState: - LPI2C_TransferStateMachineReadCommand(base, handle, &stateParams); - break; - - case (uint8_t)kTransferDataState: - LPI2C_TransferStateMachineTransferData(base, handle, &stateParams); - break; - - case (uint8_t)kStopState: - LPI2C_TransferStateMachineStopState(base, handle, &stateParams, isDone); - break; - - case (uint8_t)kWaitForCompletionState: - LPI2C_TransferStateMachineWaitState(base, handle, &stateParams, isDone); - break; - default: - assert(false); - break; - } - } - } - return result; -} - -/*! - * @brief Prepares the transfer state machine and fills in the command buffer. - * @param handle Master nonblocking driver handle. - */ -static void LPI2C_InitTransferStateMachine(lpi2c_master_handle_t *handle) -{ - lpi2c_master_transfer_t *xfer = &handle->transfer; - - /* Handle no start option. */ - if (0U != (xfer->flags & (uint32_t)kLPI2C_TransferNoStartFlag)) - { - if (xfer->direction == kLPI2C_Read) - { - /* Need to issue read command first. */ - handle->state = (uint8_t)kIssueReadCommandState; - } - else - { - /* Start immediately in the data transfer state. */ - handle->state = (uint8_t)kTransferDataState; - } - - handle->buf = (uint8_t *)xfer->data; - handle->remainingBytes = (uint16_t)xfer->dataSize; - } - else - { - uint16_t *cmd = (uint16_t *)&handle->commandBuffer; - uint32_t cmdCount = 0U; - - /* Initial direction depends on whether a subaddress was provided, and of course the actual */ - /* data transfer direction. */ - lpi2c_direction_t direction = (0U != xfer->subaddressSize) ? kLPI2C_Write : xfer->direction; - - /* Start command. */ - cmd[cmdCount++] = - (uint16_t)kStartCmd | (uint16_t)((uint16_t)((uint16_t)xfer->slaveAddress << 1U) | (uint16_t)direction); - - /* Subaddress, MSB first. */ - if (0U != xfer->subaddressSize) - { - uint32_t subaddressRemaining = xfer->subaddressSize; - while (0U != (subaddressRemaining--)) - { - uint8_t subaddressByte = (uint8_t)((xfer->subaddress >> (8U * subaddressRemaining)) & 0xffU); - cmd[cmdCount++] = subaddressByte; - } - } - - /* Reads need special handling. */ - if ((0U != xfer->dataSize) && (xfer->direction == kLPI2C_Read)) - { - /* Need to send repeated start if switching directions to read. */ - if (direction == kLPI2C_Write) - { - cmd[cmdCount++] = (uint16_t)kStartCmd | - (uint16_t)((uint16_t)((uint16_t)xfer->slaveAddress << 1U) | (uint16_t)kLPI2C_Read); - } - } - - /* Set up state machine for transferring the commands. */ - handle->state = (uint8_t)kSendCommandState; - handle->remainingBytes = (uint16_t)cmdCount; - handle->buf = (uint8_t *)&handle->commandBuffer; - } -} - -/*! - * brief Performs a non-blocking transaction on the I2C bus. - * - * param base The LPI2C peripheral base address. - * param handle Pointer to the LPI2C master driver handle. - * param transfer The pointer to the transfer descriptor. - * retval #kStatus_Success The transaction was started successfully. - * retval #kStatus_LPI2C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - */ -status_t LPI2C_MasterTransferNonBlocking(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_master_transfer_t *transfer) -{ - assert(NULL != handle); - assert(NULL != transfer); - assert(transfer->subaddressSize <= sizeof(transfer->subaddress)); - - status_t result; - - /* Check transfer data size in read operation. */ - if ((transfer->direction == kLPI2C_Read) && - (transfer->dataSize > (256U * (uint32_t)FSL_FEATURE_LPI2C_FIFO_SIZEn(base)))) - { - return kStatus_InvalidArgument; - } - - /* Return busy if another transaction is in progress. */ - if (handle->state != (uint8_t)kIdleState) - { - result = kStatus_LPI2C_Busy; - } - else - { - result = LPI2C_CheckForBusyBus(base); - } - - if ((status_t)kStatus_Success == result) - { - /* Enable the master function and disable the slave function. */ - LPI2C_MasterEnable(base, true); - LPI2C_SlaveEnable(base, false); - - /* Disable LPI2C IRQ sources while we configure stuff. */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - - /* Reset FIFO in case there are data. */ - base->MCR |= LPI2C_MCR_RRF_MASK | LPI2C_MCR_RTF_MASK; - - /* Save transfer into handle. */ - handle->transfer = *transfer; - - /* Generate commands to send. */ - LPI2C_InitTransferStateMachine(handle); - - /* Clear all flags. */ - LPI2C_MasterClearStatusFlags(base, (uint32_t)kLPI2C_MasterClearFlags); - - /* Turn off auto-stop option. */ - base->MCFGR1 &= ~LPI2C_MCFGR1_AUTOSTOP_MASK; - - /* Enable LPI2C internal IRQ sources. NVIC IRQ was enabled in CreateHandle() */ - LPI2C_MasterEnableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - } - - return result; -} - -/*! - * brief Returns number of bytes transferred so far. - * param base The LPI2C peripheral base address. - * param handle Pointer to the LPI2C master driver handle. - * param[out] count Number of bytes transferred so far by the non-blocking transaction. - * retval #kStatus_Success - * retval #kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t LPI2C_MasterTransferGetCount(LPI2C_Type *base, lpi2c_master_handle_t *handle, size_t *count) -{ - status_t result = kStatus_Success; - - assert(NULL != handle); - - if (NULL == count) - { - result = kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - else if (handle->state == (uint8_t)kIdleState) - { - *count = 0; - result = kStatus_NoTransferInProgress; - } - else - { - uint8_t state; - uint16_t remainingBytes; - uint32_t dataSize; - - /* Cache some fields with IRQs disabled. This ensures all field values */ - /* are synchronized with each other during an ongoing transfer. */ - uint32_t irqs = LPI2C_MasterGetEnabledInterrupts(base); - LPI2C_MasterDisableInterrupts(base, irqs); - state = handle->state; - remainingBytes = handle->remainingBytes; - dataSize = handle->transfer.dataSize; - LPI2C_MasterEnableInterrupts(base, irqs); - - /* Get transfer count based on current transfer state. */ - switch (state) - { - case (uint8_t)kIdleState: - case (uint8_t)kSendCommandState: - case (uint8_t) - kIssueReadCommandState: /* XXX return correct value for this state when >256 reads are supported */ - *count = 0; - break; - - case (uint8_t)kTransferDataState: - *count = dataSize - remainingBytes; - break; - - case (uint8_t)kStopState: - case (uint8_t)kWaitForCompletionState: - default: - *count = dataSize; - break; - } - } - - return result; -} - -/*! - * brief Terminates a non-blocking LPI2C master transmission early. - * - * note It is not safe to call this function from an IRQ handler that has a higher priority than the - * LPI2C peripheral's IRQ priority. - * - * param base The LPI2C peripheral base address. - * param handle Pointer to the LPI2C master driver handle. - */ -void LPI2C_MasterTransferAbort(LPI2C_Type *base, lpi2c_master_handle_t *handle) -{ - if (handle->state != (uint8_t)kIdleState) - { - /* Disable internal IRQ enables. */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - - /* Reset fifos. */ - base->MCR |= LPI2C_MCR_RRF_MASK | LPI2C_MCR_RTF_MASK; - - /* If master is still busy and has not send out stop signal yet. */ - if ((LPI2C_MasterGetStatusFlags(base) & ((uint32_t)kLPI2C_MasterStopDetectFlag | - (uint32_t)kLPI2C_MasterBusyFlag)) == (uint32_t)kLPI2C_MasterBusyFlag) - { - /* Send a stop command to finalize the transfer. */ - base->MTDR = (uint32_t)kStopCmd; - } - - /* Reset handle. */ - handle->state = (uint8_t)kIdleState; - } -} - -/*! - * brief Reusable routine to handle master interrupts. - * note This function does not need to be called unless you are reimplementing the - * nonblocking API's interrupt handler routines to add special functionality. - * param base The LPI2C peripheral base address. - * param lpi2cMasterHandle Pointer to the LPI2C master driver handle. - */ -void LPI2C_MasterTransferHandleIRQ(LPI2C_Type *base, void *lpi2cMasterHandle) -{ - assert(lpi2cMasterHandle != NULL); - - lpi2c_master_handle_t *handle = (lpi2c_master_handle_t *)lpi2cMasterHandle; - bool isDone = false; - status_t result; - - /* Don't do anything if we don't have a valid handle. */ - if (NULL != handle) - { - if (handle->state != (uint8_t)kIdleState) - { - result = LPI2C_RunTransferStateMachine(base, handle, &isDone); - - if ((result != kStatus_Success) || isDone) - { - /* Handle error, terminate xfer */ - if (result != kStatus_Success) - { - LPI2C_MasterTransferAbort(base, handle); - } - - /* Disable internal IRQ enables. */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - - /* Set handle to idle state. */ - handle->state = (uint8_t)kIdleState; - - /* Invoke callback. */ - if (NULL != handle->completionCallback) - { - handle->completionCallback(base, handle, result, handle->userData); - } - } - } - } -} - -/*! - * brief Provides a default configuration for the LPI2C slave peripheral. - * - * This function provides the following default configuration for the LPI2C slave peripheral: - * code - * slaveConfig->enableSlave = true; - * slaveConfig->address0 = 0U; - * slaveConfig->address1 = 0U; - * slaveConfig->addressMatchMode = kLPI2C_MatchAddress0; - * slaveConfig->filterDozeEnable = true; - * slaveConfig->filterEnable = true; - * slaveConfig->enableGeneralCall = false; - * slaveConfig->sclStall.enableAck = false; - * slaveConfig->sclStall.enableTx = true; - * slaveConfig->sclStall.enableRx = true; - * slaveConfig->sclStall.enableAddress = true; - * slaveConfig->ignoreAck = false; - * slaveConfig->enableReceivedAddressRead = false; - * slaveConfig->sdaGlitchFilterWidth_ns = 0; - * slaveConfig->sclGlitchFilterWidth_ns = 0; - * slaveConfig->dataValidDelay_ns = 0; - * slaveConfig->clockHoldTime_ns = 0; - * endcode - * - * After calling this function, override any settings to customize the configuration, - * prior to initializing the master driver with LPI2C_SlaveInit(). Be sure to override at least the a - * address0 member of the configuration structure with the desired slave address. - * - * param[out] slaveConfig User provided configuration structure that is set to default values. Refer to - * #lpi2c_slave_config_t. - */ -void LPI2C_SlaveGetDefaultConfig(lpi2c_slave_config_t *slaveConfig) -{ - /* Initializes the configure structure to zero. */ - (void)memset(slaveConfig, 0, sizeof(*slaveConfig)); - - slaveConfig->enableSlave = true; - slaveConfig->address0 = 0U; - slaveConfig->address1 = 0U; - slaveConfig->addressMatchMode = kLPI2C_MatchAddress0; - slaveConfig->filterDozeEnable = true; - slaveConfig->filterEnable = true; - slaveConfig->enableGeneralCall = false; - slaveConfig->sclStall.enableAck = false; - slaveConfig->sclStall.enableTx = true; - slaveConfig->sclStall.enableRx = true; - slaveConfig->sclStall.enableAddress = false; - slaveConfig->ignoreAck = false; - slaveConfig->enableReceivedAddressRead = false; - slaveConfig->sdaGlitchFilterWidth_ns = 0U; /* Set to 0 to disable the function */ - slaveConfig->sclGlitchFilterWidth_ns = 0U; /* Set to 0 to disable the function */ - slaveConfig->dataValidDelay_ns = 0U; - /* When enabling the slave tx SCL stall, set the default clock hold time to 250ns according - to I2C spec for standard mode baudrate(100k). User can manually change it to 100ns or 50ns - for fast-mode(400k) or fast-mode+(1m). */ - slaveConfig->clockHoldTime_ns = 250U; -} - -/*! - * brief Initializes the LPI2C slave peripheral. - * - * This function enables the peripheral clock and initializes the LPI2C slave peripheral as described by the user - * provided configuration. - * - * param base The LPI2C peripheral base address. - * param slaveConfig User provided peripheral configuration. Use LPI2C_SlaveGetDefaultConfig() to get a set of defaults - * that you can override. - * param sourceClock_Hz Frequency in Hertz of the LPI2C functional clock. Used to calculate the filter widths, - * data valid delay, and clock hold time. - */ -void LPI2C_SlaveInit(LPI2C_Type *base, const lpi2c_slave_config_t *slaveConfig, uint32_t sourceClock_Hz) -{ - uint32_t tmpReg; - uint32_t tmpCycle; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - - uint32_t instance = LPI2C_GetInstance(base); - - /* Ungate the clock. */ - (void)CLOCK_EnableClock(kLpi2cClocks[instance]); -#if defined(LPI2C_PERIPH_CLOCKS) - /* Ungate the functional clock in initialize function. */ - CLOCK_EnableClock(kLpi2cPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(LPI2C_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_lpi2cResets[LPI2C_GetInstance(base)]); -#endif - - /* Restore to reset conditions. */ - LPI2C_SlaveReset(base); - - /* Configure peripheral. */ - base->SAMR = LPI2C_SAMR_ADDR0(slaveConfig->address0) | LPI2C_SAMR_ADDR1(slaveConfig->address1); - - base->SCFGR1 = - LPI2C_SCFGR1_ADDRCFG(slaveConfig->addressMatchMode) | LPI2C_SCFGR1_IGNACK(slaveConfig->ignoreAck) | - LPI2C_SCFGR1_RXCFG(slaveConfig->enableReceivedAddressRead) | LPI2C_SCFGR1_GCEN(slaveConfig->enableGeneralCall) | - LPI2C_SCFGR1_ACKSTALL(slaveConfig->sclStall.enableAck) | LPI2C_SCFGR1_TXDSTALL(slaveConfig->sclStall.enableTx) | - LPI2C_SCFGR1_RXSTALL(slaveConfig->sclStall.enableRx) | - LPI2C_SCFGR1_ADRSTALL(slaveConfig->sclStall.enableAddress); - - /* Calculate SDA filter width. The width is equal to FILTSDA+3 cycles of functional clock. - And set FILTSDA to 0 disables the fileter, so the min value is 4. */ - tmpReg = LPI2C_SCFGR2_FILTSDA( - LPI2C_GetCyclesForWidth(sourceClock_Hz, slaveConfig->sdaGlitchFilterWidth_ns, 4U, - (LPI2C_SCFGR2_FILTSDA_MASK >> LPI2C_SCFGR2_FILTSDA_SHIFT) + 3U, 0U) - - 3U); - - /* Calculate SDL filter width. The width is equal to FILTSCL+3 cycles of functional clock. - And set FILTSCL to 0 disables the fileter, so the min value is 4. */ - tmpCycle = LPI2C_GetCyclesForWidth(sourceClock_Hz, slaveConfig->sclGlitchFilterWidth_ns, 4U, - (LPI2C_SCFGR2_FILTSCL_MASK >> LPI2C_SCFGR2_FILTSCL_SHIFT) + 3U, 0U); - tmpReg |= LPI2C_SCFGR2_FILTSCL(tmpCycle - 3U); - - /* Calculate data valid time. The time is equal to FILTSCL+DATAVD+3 cycles of functional clock. - So the min value is FILTSCL+3. */ - tmpReg |= LPI2C_SCFGR2_DATAVD( - LPI2C_GetCyclesForWidth(sourceClock_Hz, slaveConfig->dataValidDelay_ns, tmpCycle, - tmpCycle + (LPI2C_SCFGR2_DATAVD_MASK >> LPI2C_SCFGR2_DATAVD_SHIFT), 0U) - - tmpCycle); - - /* Calculate clock hold time. The time is equal to CLKHOLD+3 cycles of functional clock. - So the min value is 3. */ - base->SCFGR2 = - tmpReg | LPI2C_SCFGR2_CLKHOLD( - LPI2C_GetCyclesForWidth(sourceClock_Hz, slaveConfig->clockHoldTime_ns, 3U, - (LPI2C_SCFGR2_CLKHOLD_MASK >> LPI2C_SCFGR2_CLKHOLD_SHIFT) + 3U, 0U) - - 3U); - - /* Save SCR to last so we don't enable slave until it is configured */ - base->SCR = LPI2C_SCR_FILTDZ(!slaveConfig->filterDozeEnable) | LPI2C_SCR_FILTEN(slaveConfig->filterEnable) | - LPI2C_SCR_SEN(slaveConfig->enableSlave); -} - -/*! - * brief Deinitializes the LPI2C slave peripheral. - * - * This function disables the LPI2C slave peripheral and gates the clock. It also performs a software - * reset to restore the peripheral to reset conditions. - * - * param base The LPI2C peripheral base address. - */ -void LPI2C_SlaveDeinit(LPI2C_Type *base) -{ - LPI2C_SlaveReset(base); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - - uint32_t instance = LPI2C_GetInstance(base); - - /* Gate the clock. */ - (void)CLOCK_DisableClock(kLpi2cClocks[instance]); - -#if defined(LPI2C_PERIPH_CLOCKS) - /* Gate the functional clock. */ - CLOCK_DisableClock(kLpi2cPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * @brief Convert provided flags to status code, and clear any errors if present. - * @param base The LPI2C peripheral base address. - * @param status Current status flags value that will be checked. - * @retval #kStatus_Success - * @retval #kStatus_LPI2C_BitError - * @retval #kStatus_LPI2C_FifoError - */ -static status_t LPI2C_SlaveCheckAndClearError(LPI2C_Type *base, uint32_t flags) -{ - status_t result = kStatus_Success; - - flags &= (uint32_t)kLPI2C_SlaveErrorFlags; - if (0U != flags) - { - /* - * $Branch Coverage Justification$ - * It is hard to simulate bitError in automation test environment, need interference on bus.(will improve) - */ - if (0U != (flags & (uint32_t)kLPI2C_SlaveBitErrFlag)) - { - result = kStatus_LPI2C_BitError; - } - else if (0U != (flags & (uint32_t)kLPI2C_SlaveFifoErrFlag)) - { - result = kStatus_LPI2C_FifoError; - } - else - { - ; /* Intentional empty */ - } - - /* Clear the errors. */ - LPI2C_SlaveClearStatusFlags(base, flags); - } - else - { - ; /* Intentional empty */ - } - - return result; -} - -/*! - * brief Performs a polling send transfer on the I2C bus. - * - * param base The LPI2C peripheral base address. - * param txBuff The pointer to the data to be transferred. - * param txSize The length in bytes of the data to be transferred. - * param[out] actualTxSize - * return Error or success status returned by API. - */ -status_t LPI2C_SlaveSend(LPI2C_Type *base, void *txBuff, size_t txSize, size_t *actualTxSize) -{ - status_t result = kStatus_Success; - uint8_t *buf = (uint8_t *)txBuff; - size_t remaining = txSize; - - assert(NULL != txBuff); - -#if I2C_RETRY_TIMES != 0U - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - - /* Clear stop flag. */ - LPI2C_SlaveClearStatusFlags(base, - (uint32_t)kLPI2C_SlaveStopDetectFlag | (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag); - - while (0U != remaining) - { - uint32_t flags; - - /* Wait until we can transmit. */ - do - { - /* Check for errors */ - flags = LPI2C_SlaveGetStatusFlags(base); - result = LPI2C_SlaveCheckAndClearError(base, flags); - if (kStatus_Success != result) - { - if (NULL != actualTxSize) - { - *actualTxSize = txSize - remaining; - } - break; - } -#if I2C_RETRY_TIMES != 0U - waitTimes--; - } while ((0U == (flags & ((uint32_t)kLPI2C_SlaveTxReadyFlag | (uint32_t)kLPI2C_SlaveStopDetectFlag | - (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag))) && - (0U != waitTimes)); - if (0U == waitTimes) - { - result = kStatus_LPI2C_Timeout; - } -#else - } while (0U == (flags & ((uint32_t)kLPI2C_SlaveTxReadyFlag | (uint32_t)kLPI2C_SlaveStopDetectFlag | - (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag))); -#endif - - if (kStatus_Success != result) - { - break; - } - - /* Send a byte. */ - if (0U != (flags & (uint32_t)kLPI2C_SlaveTxReadyFlag)) - { - base->STDR = *buf++; - --remaining; - } - - /* Exit loop if we see a stop or restart in transfer*/ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpi2c_c_ref_3$ - */ - if ((0U != (flags & ((uint32_t)kLPI2C_SlaveStopDetectFlag | (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag))) && - (remaining != 0U)) - { - LPI2C_SlaveClearStatusFlags( - base, (uint32_t)kLPI2C_SlaveStopDetectFlag | (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag); - break; - } - } - - if (NULL != actualTxSize) - { - *actualTxSize = txSize - remaining; - } - - return result; -} - -/*! - * brief Performs a polling receive transfer on the I2C bus. - * - * param base The LPI2C peripheral base address. - * param rxBuff The pointer to the data to be transferred. - * param rxSize The length in bytes of the data to be transferred. - * param[out] actualRxSize - * return Error or success status returned by API. - */ -status_t LPI2C_SlaveReceive(LPI2C_Type *base, void *rxBuff, size_t rxSize, size_t *actualRxSize) -{ - status_t result = kStatus_Success; - uint8_t *buf = (uint8_t *)rxBuff; - size_t remaining = rxSize; - - assert(NULL != rxBuff); - -#if I2C_RETRY_TIMES != 0U - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - - /* Clear stop flag. */ - LPI2C_SlaveClearStatusFlags(base, - (uint32_t)kLPI2C_SlaveStopDetectFlag | (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag); - - while (0U != remaining) - { - uint32_t flags; - - /* Wait until we can receive. */ - do - { - /* Check for errors */ - flags = LPI2C_SlaveGetStatusFlags(base); - result = LPI2C_SlaveCheckAndClearError(base, flags); - if (kStatus_Success != result) - { - if (NULL != actualRxSize) - { - *actualRxSize = rxSize - remaining; - } - break; - } -#if I2C_RETRY_TIMES != 0U - waitTimes--; - } while ((0U == (flags & ((uint32_t)kLPI2C_SlaveRxReadyFlag | (uint32_t)kLPI2C_SlaveStopDetectFlag | - (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag))) && - (0U != waitTimes)); - if (0U == waitTimes) - { - result = kStatus_LPI2C_Timeout; - } -#else - } while (0U == (flags & ((uint32_t)kLPI2C_SlaveRxReadyFlag | (uint32_t)kLPI2C_SlaveStopDetectFlag | - (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag))); -#endif - - if ((status_t)kStatus_Success != result) - { - break; - } - - /* Receive a byte. */ - if (0U != (flags & (uint32_t)kLPI2C_SlaveRxReadyFlag)) - { - *buf++ = (uint8_t)(base->SRDR & LPI2C_SRDR_DATA_MASK); - --remaining; - } - - /* Exit loop if we see a stop or restart */ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpi2c_c_ref_3$ - */ - if ((0U != (flags & ((uint32_t)kLPI2C_SlaveStopDetectFlag | (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag))) && - (remaining != 0U)) - { - LPI2C_SlaveClearStatusFlags( - base, (uint32_t)kLPI2C_SlaveStopDetectFlag | (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag); - break; - } - } - - if (NULL != actualRxSize) - { - *actualRxSize = rxSize - remaining; - } - - return result; -} - -/*! - * brief Creates a new handle for the LPI2C slave non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the LPI2C_SlaveTransferAbort() API shall be called. - * - * note The function also enables the NVIC IRQ for the input LPI2C. Need to notice - * that on some SoCs the LPI2C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - - * param base The LPI2C peripheral base address. - * param[out] handle Pointer to the LPI2C slave driver handle. - * param callback User provided pointer to the asynchronous callback function. - * param userData User provided pointer to the application callback data. - */ -void LPI2C_SlaveTransferCreateHandle(LPI2C_Type *base, - lpi2c_slave_handle_t *handle, - lpi2c_slave_transfer_callback_t callback, - void *userData) -{ - uint32_t instance; - - assert(NULL != handle); - - /* Clear out the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Look up instance number */ - instance = LPI2C_GetInstance(base); - - /* Save base and instance. */ - handle->callback = callback; - handle->userData = userData; - - /* Save this handle for IRQ use. */ - s_lpi2cSlaveHandle[instance] = handle; - - /* Set irq handler. */ - s_lpi2cSlaveIsr = LPI2C_SlaveTransferHandleIRQ; - - /* Clear internal IRQ enables and enable NVIC IRQ. */ - LPI2C_SlaveDisableInterrupts(base, (uint32_t)kLPI2C_SlaveIrqFlags); - (void)EnableIRQ(kLpi2cIrqs[instance]); - - /* Nack by default. */ - base->STAR = LPI2C_STAR_TXNACK_MASK; -} - -/*! - * brief Starts accepting slave transfers. - * - * Call this API after calling I2C_SlaveInit() and LPI2C_SlaveTransferCreateHandle() to start processing - * transactions driven by an I2C master. The slave monitors the I2C bus and pass events to the - * callback that was passed into the call to LPI2C_SlaveTransferCreateHandle(). The callback is always invoked - * from the interrupt context. - * - * The set of events received by the callback is customizable. To do so, set the a eventMask parameter to - * the OR'd combination of #lpi2c_slave_transfer_event_t enumerators for the events you wish to receive. - * The #kLPI2C_SlaveTransmitEvent and #kLPI2C_SlaveReceiveEvent events are always enabled and do not need - * to be included in the mask. Alternatively, you can pass 0 to get a default set of only the transmit and - * receive events that are always enabled. In addition, the #kLPI2C_SlaveAllEvents constant is provided as - * a convenient way to enable all events. - * - * param base The LPI2C peripheral base address. - * param handle Pointer to #lpi2c_slave_handle_t structure which stores the transfer state. - * param eventMask Bit mask formed by OR'ing together #lpi2c_slave_transfer_event_t enumerators to specify - * which events to send to the callback. Other accepted values are 0 to get a default set of - * only the transmit and receive events, and #kLPI2C_SlaveAllEvents to enable all events. - * - * retval #kStatus_Success Slave transfers were successfully started. - * retval #kStatus_LPI2C_Busy Slave transfers have already been started on this handle. - */ -status_t LPI2C_SlaveTransferNonBlocking(LPI2C_Type *base, lpi2c_slave_handle_t *handle, uint32_t eventMask) -{ - status_t result = kStatus_Success; - - assert(NULL != handle); - - /* Return busy if another transaction is in progress. */ - if (handle->isBusy) - { - result = kStatus_LPI2C_Busy; - } - else - { - /* Enable the slave function and disable the master function. */ - LPI2C_MasterEnable(base, false); - LPI2C_SlaveEnable(base, true); - /* Return an error if the bus is already in use not by us. */ - uint32_t status = LPI2C_SlaveGetStatusFlags(base); - /* - * $Branch Coverage Justification$ - * $ref fsl_lpi2c_c_ref_2$ - */ - if ((0U != (status & (uint32_t)kLPI2C_SlaveBusBusyFlag)) && (0U == (status & (uint32_t)kLPI2C_SlaveBusyFlag))) - { - result = kStatus_LPI2C_Busy; - } - } - - if ((status_t)kStatus_Success == result) - { - /* Disable LPI2C IRQ sources while we configure stuff. */ - LPI2C_SlaveDisableInterrupts(base, (uint32_t)kLPI2C_SlaveIrqFlags); - - /* Clear transfer in handle. */ - (void)memset(&handle->transfer, 0, sizeof(handle->transfer)); - - /* Record that we're busy. */ - handle->isBusy = true; - - /* Set up event mask. tx and rx are always enabled. */ - handle->eventMask = eventMask | (uint32_t)kLPI2C_SlaveTransmitEvent | (uint32_t)kLPI2C_SlaveReceiveEvent; - - /* Ack by default. */ - base->STAR = 0U; - - /* Clear all flags. */ - LPI2C_SlaveClearStatusFlags(base, (uint32_t)kLPI2C_SlaveClearFlags); - - /* Enable LPI2C internal IRQ sources. NVIC IRQ was enabled in CreateHandle() */ - LPI2C_SlaveEnableInterrupts(base, (uint32_t)kLPI2C_SlaveIrqFlags); - } - - return result; -} - -/*! - * brief Gets the slave transfer status during a non-blocking transfer. - * param base The LPI2C peripheral base address. - * param handle Pointer to i2c_slave_handle_t structure. - * param[out] count Pointer to a value to hold the number of bytes transferred. May be NULL if the count is not - * required. - * retval #kStatus_Success - * retval #kStatus_NoTransferInProgress - */ -status_t LPI2C_SlaveTransferGetCount(LPI2C_Type *base, lpi2c_slave_handle_t *handle, size_t *count) -{ - status_t status = kStatus_Success; - - assert(NULL != handle); - - if (count == NULL) - { - status = kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - else if (!handle->isBusy) - { - *count = 0; - status = kStatus_NoTransferInProgress; - } - - /* For an active transfer, just return the count from the handle. */ - else - { - *count = handle->transferredCount; - } - - return status; -} - -/*! - * brief Aborts the slave non-blocking transfers. - * note This API could be called at any time to stop slave for handling the bus events. - * param base The LPI2C peripheral base address. - * param handle Pointer to #lpi2c_slave_handle_t structure which stores the transfer state. - */ -void LPI2C_SlaveTransferAbort(LPI2C_Type *base, lpi2c_slave_handle_t *handle) -{ - assert(NULL != handle); - - /* Return idle if no transaction is in progress. */ - if (handle->isBusy) - { - /* Disable LPI2C IRQ sources. */ - LPI2C_SlaveDisableInterrupts(base, (uint32_t)kLPI2C_SlaveIrqFlags); - - /* Nack by default. */ - base->STAR = LPI2C_STAR_TXNACK_MASK; - - /* Reset transfer info. */ - (void)memset(&handle->transfer, 0, sizeof(handle->transfer)); - - /* We're no longer busy. */ - handle->isBusy = false; - } -} - -/*! - * brief Reusable routine to handle slave interrupts. - * note This function does not need to be called unless you are reimplementing the - * non blocking API's interrupt handler routines to add special functionality. - * param base The LPI2C peripheral base address. - * param handle Pointer to #lpi2c_slave_handle_t structure which stores the transfer state. - */ -void LPI2C_SlaveTransferHandleIRQ(LPI2C_Type *base, lpi2c_slave_handle_t *handle) -{ - uint32_t flags; - lpi2c_slave_transfer_t *xfer; - - /* Check for a valid handle in case of a spurious interrupt. */ - if (NULL != handle) - { - xfer = &handle->transfer; - - /* Get status flags. */ - flags = LPI2C_SlaveGetStatusFlags(base); - - if (0U != (flags & ((uint32_t)kLPI2C_SlaveBitErrFlag | (uint32_t)kLPI2C_SlaveFifoErrFlag))) - { - xfer->event = kLPI2C_SlaveCompletionEvent; - xfer->completionStatus = LPI2C_SlaveCheckAndClearError(base, flags); - - if ((0U != (handle->eventMask & (uint32_t)kLPI2C_SlaveCompletionEvent)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - } - else - { - if (0U != - (flags & (((uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag) | ((uint32_t)kLPI2C_SlaveStopDetectFlag)))) - { - xfer->event = (0U != (flags & (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag)) ? - kLPI2C_SlaveRepeatedStartEvent : - kLPI2C_SlaveCompletionEvent; - xfer->receivedAddress = 0U; - xfer->completionStatus = kStatus_Success; - xfer->transferredCount = handle->transferredCount; - - if (xfer->event == kLPI2C_SlaveCompletionEvent) - { - handle->isBusy = false; - } - - if (handle->wasTransmit) - { - /* Subtract one from the transmit count to offset the fact that LPI2C asserts the */ - /* tx flag before it sees the nack from the master-receiver, thus causing one more */ - /* count that the master actually receives. */ - --xfer->transferredCount; - handle->wasTransmit = false; - } - - /* Clear the flag. */ - LPI2C_SlaveClearStatusFlags(base, flags & ((uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag | - (uint32_t)kLPI2C_SlaveStopDetectFlag)); - - /* Revert to sending an Ack by default, in case we sent a Nack for receive. */ - base->STAR = 0U; - - if ((0U != (handle->eventMask & (uint32_t)xfer->event)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - - if (0U != (flags & (uint32_t)kLPI2C_SlaveStopDetectFlag)) - { - /* Clean up transfer info on completion, after the callback has been invoked. */ - (void)memset(&handle->transfer, 0, sizeof(handle->transfer)); - } - } - if (0U != (flags & (uint32_t)kLPI2C_SlaveAddressValidFlag)) - { - xfer->event = kLPI2C_SlaveAddressMatchEvent; - xfer->receivedAddress = (uint8_t)(base->SASR & LPI2C_SASR_RADDR_MASK); - - /* Update handle status to busy because slave is addressed. */ - handle->isBusy = true; - if ((0U != (handle->eventMask & (uint32_t)kLPI2C_SlaveAddressMatchEvent)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - } - if (0U != (flags & (uint32_t)kLPI2C_SlaveTransmitAckFlag)) - { - xfer->event = kLPI2C_SlaveTransmitAckEvent; - - if ((0U != (handle->eventMask & (uint32_t)kLPI2C_SlaveTransmitAckEvent)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - } - - /* Handle transmit and receive. */ - if (0U != (flags & (uint32_t)kLPI2C_SlaveTxReadyFlag)) - { - handle->wasTransmit = true; - - /* If we're out of data, invoke callback to get more. */ - if ((NULL == xfer->data) || (0U == xfer->dataSize)) - { - xfer->event = kLPI2C_SlaveTransmitEvent; - if (NULL != handle->callback) - { - handle->callback(base, xfer, handle->userData); - } - - /* Clear the transferred count now that we have a new buffer. */ - handle->transferredCount = 0U; - } - - /* Transmit a byte. */ - if ((NULL != xfer->data) && (0U != xfer->dataSize)) - { - base->STDR = *xfer->data++; - --xfer->dataSize; - ++handle->transferredCount; - } - } - if (0U != (flags & (uint32_t)kLPI2C_SlaveRxReadyFlag)) - { - /* If we're out of room in the buffer, invoke callback to get another. */ - if ((NULL == xfer->data) || (0U == xfer->dataSize)) - { - xfer->event = kLPI2C_SlaveReceiveEvent; - if (NULL != handle->callback) - { - handle->callback(base, xfer, handle->userData); - } - - /* Clear the transferred count now that we have a new buffer. */ - handle->transferredCount = 0U; - } - - /* Receive a byte. */ - if ((NULL != xfer->data) && (0U != xfer->dataSize)) - { - *xfer->data++ = (uint8_t)base->SRDR; - --xfer->dataSize; - ++handle->transferredCount; - } - else - { - /* We don't have any room to receive more data, so send a nack. */ - base->STAR = LPI2C_STAR_TXNACK_MASK; - } - } - } - } -} - -#if !(defined(FSL_FEATURE_I2C_HAS_NO_IRQ) && FSL_FEATURE_I2C_HAS_NO_IRQ) -/*! - * @brief Shared IRQ handler that can call both master and slave ISRs. - * - * The master and slave ISRs are called through function pointers in order to decouple - * this code from the ISR functions. Without this, the linker would always pull in both - * ISRs and every function they call, even if only the functional API was used. - * - * @param base The LPI2C peripheral base address. - * @param instance The LPI2C peripheral instance number. - */ -static void LPI2C_CommonIRQHandler(LPI2C_Type *base, uint32_t instance) -{ - /* Check for master IRQ. */ - if ((0U != (base->MCR & LPI2C_MCR_MEN_MASK)) && (NULL != s_lpi2cMasterIsr)) - { - /* Master mode. */ - s_lpi2cMasterIsr(base, s_lpi2cMasterHandle[instance]); - } - - /* Check for slave IRQ. */ - if ((0U != (base->SCR & LPI2C_SCR_SEN_MASK)) && (NULL != s_lpi2cSlaveIsr)) - { - /* Slave mode. */ - s_lpi2cSlaveIsr(base, s_lpi2cSlaveHandle[instance]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(LPI2C0) -/* Implementation of LPI2C0 handler named in startup code. */ -void LPI2C0_DriverIRQHandler(void); -void LPI2C0_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(LPI2C0, 0U); -} -#endif - -#if defined(LPI2C1) -/* Implementation of LPI2C1 handler named in startup code. */ -void LPI2C1_DriverIRQHandler(void); -void LPI2C1_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(LPI2C1, 1U); -} -#endif - -#if defined(LPI2C2) -/* Implementation of LPI2C2 handler named in startup code. */ -void LPI2C2_DriverIRQHandler(void); -void LPI2C2_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(LPI2C2, 2U); -} -#endif - -#if defined(LPI2C3) -/* Implementation of LPI2C3 handler named in startup code. */ -void LPI2C3_DriverIRQHandler(void); -void LPI2C3_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(LPI2C3, 3U); -} -#endif - -#if defined(LPI2C4) -/* Implementation of LPI2C4 handler named in startup code. */ -void LPI2C4_DriverIRQHandler(void); -void LPI2C4_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(LPI2C4, 4U); -} -#endif - -#if defined(LPI2C5) -/* Implementation of LPI2C5 handler named in startup code. */ -void LPI2C5_DriverIRQHandler(void); -void LPI2C5_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(LPI2C5, 5U); -} -#endif - -#if defined(LPI2C6) -/* Implementation of LPI2C6 handler named in startup code. */ -void LPI2C6_DriverIRQHandler(void); -void LPI2C6_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(LPI2C6, 6U); -} -#endif - -#if defined(LPI2C7) -/* Implementation of LPI2C7 handler named in startup code. */ -void LPI2C7_DriverIRQHandler(void); -void LPI2C7_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(LPI2C7, 7U); -} -#endif - -#if defined(LPI2C8) -/* Implementation of LPI2C8 handler named in startup code. */ -void LPI2C8_DriverIRQHandler(void); -void LPI2C8_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(LPI2C8, 8U); -} -#endif - -#if defined(CM4_0__LPI2C) -/* Implementation of CM4_0__LPI2C handler named in startup code. */ -void M4_0_LPI2C_DriverIRQHandler(void); -void M4_0_LPI2C_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(CM4_0__LPI2C, LPI2C_GetInstance(CM4_0__LPI2C)); -} -#endif - -#if defined(CM4__LPI2C) -/* Implementation of CM4__LPI2C handler named in startup code. */ -void M4_LPI2C_DriverIRQHandler(void); -void M4_LPI2C_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(CM4__LPI2C, LPI2C_GetInstance(CM4__LPI2C)); -} -#endif - -#if defined(CM4_1__LPI2C) -/* Implementation of CM4_1__LPI2C handler named in startup code. */ -void M4_1_LPI2C_DriverIRQHandler(void); -void M4_1_LPI2C_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(CM4_1__LPI2C, LPI2C_GetInstance(CM4_1__LPI2C)); -} -#endif - -#if defined(DMA__LPI2C0) -/* Implementation of DMA__LPI2C0 handler named in startup code. */ -void DMA_I2C0_INT_DriverIRQHandler(void); -void DMA_I2C0_INT_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(DMA__LPI2C0, LPI2C_GetInstance(DMA__LPI2C0)); -} -#endif - -#if defined(DMA__LPI2C1) -/* Implementation of DMA__LPI2C1 handler named in startup code. */ -void DMA_I2C1_INT_DriverIRQHandler(void); -void DMA_I2C1_INT_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(DMA__LPI2C1, LPI2C_GetInstance(DMA__LPI2C1)); -} -#endif - -#if defined(DMA__LPI2C2) -/* Implementation of DMA__LPI2C2 handler named in startup code. */ -void DMA_I2C2_INT_DriverIRQHandler(void); -void DMA_I2C2_INT_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(DMA__LPI2C2, LPI2C_GetInstance(DMA__LPI2C2)); -} -#endif - -#if defined(DMA__LPI2C3) -/* Implementation of DMA__LPI2C3 handler named in startup code. */ -void DMA_I2C3_INT_DriverIRQHandler(void); -void DMA_I2C3_INT_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(DMA__LPI2C3, LPI2C_GetInstance(DMA__LPI2C3)); -} -#endif - -#if defined(DMA__LPI2C4) -/* Implementation of DMA__LPI2C3 handler named in startup code. */ -void DMA_I2C4_INT_DriverIRQHandler(void); -void DMA_I2C4_INT_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(DMA__LPI2C4, LPI2C_GetInstance(DMA__LPI2C4)); -} -#endif - -#if defined(ADMA__LPI2C0) -/* Implementation of DMA__LPI2C0 handler named in startup code. */ -void ADMA_I2C0_INT_DriverIRQHandler(void); -void ADMA_I2C0_INT_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(ADMA__LPI2C0, LPI2C_GetInstance(ADMA__LPI2C0)); -} -#endif - -#if defined(ADMA__LPI2C1) -/* Implementation of DMA__LPI2C1 handler named in startup code. */ -void ADMA_I2C1_INT_DriverIRQHandler(void); -void ADMA_I2C1_INT_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(ADMA__LPI2C1, LPI2C_GetInstance(ADMA__LPI2C1)); -} -#endif - -#if defined(ADMA__LPI2C2) -/* Implementation of DMA__LPI2C2 handler named in startup code. */ -void ADMA_I2C2_INT_DriverIRQHandler(void); -void ADMA_I2C2_INT_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(ADMA__LPI2C2, LPI2C_GetInstance(ADMA__LPI2C2)); -} -#endif - -#if defined(ADMA__LPI2C3) -/* Implementation of DMA__LPI2C3 handler named in startup code. */ -void ADMA_I2C3_INT_DriverIRQHandler(void); -void ADMA_I2C3_INT_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(ADMA__LPI2C3, LPI2C_GetInstance(ADMA__LPI2C3)); -} -#endif - -#if defined(ADMA__LPI2C4) -/* Implementation of DMA__LPI2C3 handler named in startup code. */ -void ADMA_I2C4_INT_DriverIRQHandler(void); -void ADMA_I2C4_INT_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(ADMA__LPI2C4, LPI2C_GetInstance(ADMA__LPI2C4)); -} -#endif diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpi2c.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpi2c.h deleted file mode 100644 index 390bcc5a743..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpi2c.h +++ /dev/null @@ -1,1389 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LPI2C_H_ -#define FSL_LPI2C_H_ - -#include -#include "fsl_device_registers.h" -#include "fsl_common.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @addtogroup lpi2c - * @{ - */ - -/*! - * @name Driver version - * @{ - */ -/*! @brief LPI2C driver version. */ -#define FSL_LPI2C_DRIVER_VERSION (MAKE_VERSION(2, 5, 4)) -/*! @} */ - -/*! @brief Retry times for waiting flag. */ -#ifndef I2C_RETRY_TIMES -#define I2C_RETRY_TIMES 0U /* Define to zero means keep waiting until the flag is assert/deassert. */ -#endif - -/*! @brief LPI2C status return codes. */ -enum -{ - kStatus_LPI2C_Busy = MAKE_STATUS(kStatusGroup_LPI2C, 0), /*!< The master is already performing a transfer. */ - kStatus_LPI2C_Idle = MAKE_STATUS(kStatusGroup_LPI2C, 1), /*!< The slave driver is idle. */ - kStatus_LPI2C_Nak = MAKE_STATUS(kStatusGroup_LPI2C, 2), /*!< The slave device sent a NAK in response to a byte. */ - kStatus_LPI2C_FifoError = MAKE_STATUS(kStatusGroup_LPI2C, 3), /*!< FIFO under run or overrun. */ - kStatus_LPI2C_BitError = MAKE_STATUS(kStatusGroup_LPI2C, 4), /*!< Transferred bit was not seen on the bus. */ - kStatus_LPI2C_ArbitrationLost = MAKE_STATUS(kStatusGroup_LPI2C, 5), /*!< Arbitration lost error. */ - kStatus_LPI2C_PinLowTimeout = - MAKE_STATUS(kStatusGroup_LPI2C, 6), /*!< SCL or SDA were held low longer than the timeout. */ - kStatus_LPI2C_NoTransferInProgress = - MAKE_STATUS(kStatusGroup_LPI2C, 7), /*!< Attempt to abort a transfer when one is not in progress. */ - kStatus_LPI2C_DmaRequestFail = MAKE_STATUS(kStatusGroup_LPI2C, 8), /*!< DMA request failed. */ - kStatus_LPI2C_Timeout = MAKE_STATUS(kStatusGroup_LPI2C, 9), /*!< Timeout polling status flags. */ -}; - -/*! - * @addtogroup lpi2c_master_driver - * @{ - */ - -/*! - * @brief LPI2C master peripheral flags. - * - * The following status register flags can be cleared: - * - #kLPI2C_MasterEndOfPacketFlag - * - #kLPI2C_MasterStopDetectFlag - * - #kLPI2C_MasterNackDetectFlag - * - #kLPI2C_MasterArbitrationLostFlag - * - #kLPI2C_MasterFifoErrFlag - * - #kLPI2C_MasterPinLowTimeoutFlag - * - #kLPI2C_MasterDataMatchFlag - * - * All flags except #kLPI2C_MasterBusyFlag and #kLPI2C_MasterBusBusyFlag can be enabled as - * interrupts. - * - * @note These enums are meant to be OR'd together to form a bit mask. - */ -enum _lpi2c_master_flags -{ - kLPI2C_MasterTxReadyFlag = LPI2C_MSR_TDF_MASK, /*!< Transmit data flag */ - kLPI2C_MasterRxReadyFlag = LPI2C_MSR_RDF_MASK, /*!< Receive data flag */ - kLPI2C_MasterEndOfPacketFlag = LPI2C_MSR_EPF_MASK, /*!< End Packet flag */ - kLPI2C_MasterStopDetectFlag = LPI2C_MSR_SDF_MASK, /*!< Stop detect flag */ - kLPI2C_MasterNackDetectFlag = LPI2C_MSR_NDF_MASK, /*!< NACK detect flag */ - kLPI2C_MasterArbitrationLostFlag = LPI2C_MSR_ALF_MASK, /*!< Arbitration lost flag */ - kLPI2C_MasterFifoErrFlag = LPI2C_MSR_FEF_MASK, /*!< FIFO error flag */ - kLPI2C_MasterPinLowTimeoutFlag = LPI2C_MSR_PLTF_MASK, /*!< Pin low timeout flag */ - kLPI2C_MasterDataMatchFlag = LPI2C_MSR_DMF_MASK, /*!< Data match flag */ - kLPI2C_MasterBusyFlag = LPI2C_MSR_MBF_MASK, /*!< Master busy flag */ - kLPI2C_MasterBusBusyFlag = LPI2C_MSR_BBF_MASK, /*!< Bus busy flag */ - - /*! All flags which are cleared by the driver upon starting a transfer. */ - kLPI2C_MasterClearFlags = kLPI2C_MasterEndOfPacketFlag | kLPI2C_MasterStopDetectFlag | kLPI2C_MasterNackDetectFlag | - kLPI2C_MasterArbitrationLostFlag | kLPI2C_MasterFifoErrFlag | - kLPI2C_MasterPinLowTimeoutFlag | kLPI2C_MasterDataMatchFlag, - /*! IRQ sources enabled by the non-blocking transactional API. */ - kLPI2C_MasterIrqFlags = kLPI2C_MasterArbitrationLostFlag | kLPI2C_MasterTxReadyFlag | kLPI2C_MasterRxReadyFlag | - kLPI2C_MasterStopDetectFlag | kLPI2C_MasterNackDetectFlag | kLPI2C_MasterPinLowTimeoutFlag | - kLPI2C_MasterFifoErrFlag, - /*! Errors to check for. */ - kLPI2C_MasterErrorFlags = kLPI2C_MasterNackDetectFlag | kLPI2C_MasterArbitrationLostFlag | - kLPI2C_MasterFifoErrFlag | kLPI2C_MasterPinLowTimeoutFlag -}; - -/*! @brief Direction of master and slave transfers. */ -typedef enum _lpi2c_direction -{ - kLPI2C_Write = 0U, /*!< Master transmit. */ - kLPI2C_Read = 1U /*!< Master receive. */ -} lpi2c_direction_t; - -/*! @brief LPI2C pin configuration. */ -typedef enum _lpi2c_master_pin_config -{ - kLPI2C_2PinOpenDrain = 0x0U, /*!< LPI2C Configured for 2-pin open drain mode */ - kLPI2C_2PinOutputOnly = 0x1U, /*!< LPI2C Configured for 2-pin output only mode (ultra-fast mode) */ - kLPI2C_2PinPushPull = 0x2U, /*!< LPI2C Configured for 2-pin push-pull mode */ - kLPI2C_4PinPushPull = 0x3U, /*!< LPI2C Configured for 4-pin push-pull mode */ - kLPI2C_2PinOpenDrainWithSeparateSlave = - 0x4U, /*!< LPI2C Configured for 2-pin open drain mode with separate LPI2C slave */ - kLPI2C_2PinOutputOnlyWithSeparateSlave = - 0x5U, /*!< LPI2C Configured for 2-pin output only mode(ultra-fast mode) with separate LPI2C slave */ - kLPI2C_2PinPushPullWithSeparateSlave = - 0x6U, /*!< LPI2C Configured for 2-pin push-pull mode with separate LPI2C slave */ - kLPI2C_4PinPushPullWithInvertedOutput = 0x7U /*!< LPI2C Configured for 4-pin push-pull mode(inverted outputs) */ -} lpi2c_master_pin_config_t; - -/*! @brief LPI2C master host request selection. */ -typedef enum _lpi2c_host_request_source -{ - kLPI2C_HostRequestExternalPin = 0x0U, /*!< Select the LPI2C_HREQ pin as the host request input */ - kLPI2C_HostRequestInputTrigger = 0x1U, /*!< Select the input trigger as the host request input */ -} lpi2c_host_request_source_t; - -/*! @brief LPI2C master host request pin polarity configuration. */ -typedef enum _lpi2c_host_request_polarity -{ - kLPI2C_HostRequestPinActiveLow = 0x0U, /*!< Configure the LPI2C_HREQ pin active low */ - kLPI2C_HostRequestPinActiveHigh = 0x1U /*!< Configure the LPI2C_HREQ pin active high */ -} lpi2c_host_request_polarity_t; - -/*! - * @brief Structure with settings to initialize the LPI2C master module. - * - * This structure holds configuration settings for the LPI2C peripheral. To initialize this - * structure to reasonable defaults, call the LPI2C_MasterGetDefaultConfig() function and - * pass a pointer to your configuration structure instance. - * - * The configuration structure can be made constant so it resides in flash. - */ -typedef struct _lpi2c_master_config -{ - bool enableMaster; /*!< Whether to enable master mode. */ - bool enableDoze; /*!< Whether master is enabled in doze mode. */ - bool debugEnable; /*!< Enable transfers to continue when halted in debug mode. */ - bool ignoreAck; /*!< Whether to ignore ACK/NACK. */ - lpi2c_master_pin_config_t pinConfig; /*!< The pin configuration option. */ - uint32_t baudRate_Hz; /*!< Desired baud rate in Hertz. */ - uint32_t busIdleTimeout_ns; /*!< Bus idle timeout in nanoseconds. Set to 0 to disable. */ - uint32_t pinLowTimeout_ns; /*!< Pin low timeout in nanoseconds. Set to 0 to disable. */ - uint8_t sdaGlitchFilterWidth_ns; /*!< Width in nanoseconds of glitch filter on SDA pin. Set to 0 to disable. */ - uint8_t sclGlitchFilterWidth_ns; /*!< Width in nanoseconds of glitch filter on SCL pin. Set to 0 to disable. */ - struct - { - bool enable; /*!< Enable host request. */ - lpi2c_host_request_source_t source; /*!< Host request source. */ - lpi2c_host_request_polarity_t polarity; /*!< Host request pin polarity. */ - } hostRequest; /*!< Host request options. */ -} lpi2c_master_config_t; - -/*! @brief LPI2C master data match configuration modes. */ -typedef enum _lpi2c_data_match_config_mode -{ - kLPI2C_MatchDisabled = 0x0U, /*!< LPI2C Match Disabled */ - kLPI2C_1stWordEqualsM0OrM1 = 0x2U, /*!< LPI2C Match Enabled and 1st data word equals MATCH0 OR MATCH1 */ - kLPI2C_AnyWordEqualsM0OrM1 = 0x3U, /*!< LPI2C Match Enabled and any data word equals MATCH0 OR MATCH1 */ - kLPI2C_1stWordEqualsM0And2ndWordEqualsM1 = - 0x4U, /*!< LPI2C Match Enabled and 1st data word equals MATCH0, 2nd data equals MATCH1 */ - kLPI2C_AnyWordEqualsM0AndNextWordEqualsM1 = - 0x5U, /*!< LPI2C Match Enabled and any data word equals MATCH0, next data equals MATCH1 */ - kLPI2C_1stWordAndM1EqualsM0AndM1 = - 0x6U, /*!< LPI2C Match Enabled and 1st data word and MATCH0 equals MATCH0 and MATCH1 */ - kLPI2C_AnyWordAndM1EqualsM0AndM1 = - 0x7U /*!< LPI2C Match Enabled and any data word and MATCH0 equals MATCH0 and MATCH1 */ -} lpi2c_data_match_config_mode_t; - -/*! @brief LPI2C master data match configuration structure. */ -typedef struct _lpi2c_match_config -{ - lpi2c_data_match_config_mode_t matchMode; /*!< Data match configuration setting. */ - bool rxDataMatchOnly; /*!< When set to true, received data is ignored until a successful match. */ - uint32_t match0; /*!< Match value 0. */ - uint32_t match1; /*!< Match value 1. */ -} lpi2c_data_match_config_t; - -/* Forward declaration of the transfer descriptor and handle typedefs. */ -/*! @brief LPI2C master descriptor of the transfer. */ -typedef struct _lpi2c_master_transfer lpi2c_master_transfer_t; -/*! @brief LPI2C master handle of the transfer. */ -typedef struct _lpi2c_master_handle lpi2c_master_handle_t; - -/*! - * @brief Master completion callback function pointer type. - * - * This callback is used only for the non-blocking master transfer API. Specify the callback you wish to use - * in the call to LPI2C_MasterTransferCreateHandle(). - * - * @param base The LPI2C peripheral base address. - * @param handle Pointer to the LPI2C master driver handle. - * @param completionStatus Either kStatus_Success or an error code describing how the transfer completed. - * @param userData Arbitrary pointer-sized value passed from the application. - */ -typedef void (*lpi2c_master_transfer_callback_t)(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - status_t completionStatus, - void *userData); - -/*! - * @brief Transfer option flags. - * - * @note These enumerations are intended to be OR'd together to form a bit mask of options for - * the #_lpi2c_master_transfer::flags field. - */ -enum _lpi2c_master_transfer_flags -{ - kLPI2C_TransferDefaultFlag = 0x00U, /*!< Transfer starts with a start signal, stops with a stop signal. */ - kLPI2C_TransferNoStartFlag = 0x01U, /*!< Don't send a start condition, address, and sub address */ - kLPI2C_TransferRepeatedStartFlag = 0x02U, /*!< Send a repeated start condition */ - kLPI2C_TransferNoStopFlag = 0x04U, /*!< Don't send a stop condition. */ -}; - -/*! - * @brief Non-blocking transfer descriptor structure. - * - * This structure is used to pass transaction parameters to the LPI2C_MasterTransferNonBlocking() API. - */ -struct _lpi2c_master_transfer -{ - uint32_t flags; /*!< Bit mask of options for the transfer. See enumeration #_lpi2c_master_transfer_flags for - available options. Set to 0 or #kLPI2C_TransferDefaultFlag for normal transfers. */ - uint16_t slaveAddress; /*!< The 7-bit slave address. */ - lpi2c_direction_t direction; /*!< Either #kLPI2C_Read or #kLPI2C_Write. */ - uint32_t subaddress; /*!< Sub address. Transferred MSB first. */ - size_t subaddressSize; /*!< Length of sub address to send in bytes. Maximum size is 4 bytes. */ - void *data; /*!< Pointer to data to transfer. */ - size_t dataSize; /*!< Number of bytes to transfer. */ -}; - -/*! - * @brief Driver handle for master non-blocking APIs. - * @note The contents of this structure are private and subject to change. - */ -struct _lpi2c_master_handle -{ - uint8_t state; /*!< Transfer state machine current state. */ - uint16_t remainingBytes; /*!< Remaining byte count in current state. */ - uint8_t *buf; /*!< Buffer pointer for current state. */ - uint16_t commandBuffer[6]; /*!< LPI2C command sequence. When all 6 command words are used: - Start&addr&write[1 word] + subaddr[4 words] + restart&addr&read[1 word] */ - lpi2c_master_transfer_t transfer; /*!< Copy of the current transfer info. */ - lpi2c_master_transfer_callback_t completionCallback; /*!< Callback function pointer. */ - void *userData; /*!< Application data passed to callback. */ -}; - -/*! @brief Typedef for master interrupt handler, used internally for LPI2C master interrupt and EDMA transactional APIs. - */ -typedef void (*lpi2c_master_isr_t)(LPI2C_Type *base, void *handle); - -/*! @} */ - -/*! - * @addtogroup lpi2c_slave_driver - * @{ - */ - -/*! - * @brief LPI2C slave peripheral flags. - * - * The following status register flags can be cleared: - * - #kLPI2C_SlaveRepeatedStartDetectFlag - * - #kLPI2C_SlaveStopDetectFlag - * - #kLPI2C_SlaveBitErrFlag - * - #kLPI2C_SlaveFifoErrFlag - * - * All flags except #kLPI2C_SlaveBusyFlag and #kLPI2C_SlaveBusBusyFlag can be enabled as - * interrupts. - * - * @note These enumerations are meant to be OR'd together to form a bit mask. - */ -enum _lpi2c_slave_flags -{ - kLPI2C_SlaveTxReadyFlag = LPI2C_SSR_TDF_MASK, /*!< Transmit data flag */ - kLPI2C_SlaveRxReadyFlag = LPI2C_SSR_RDF_MASK, /*!< Receive data flag */ - kLPI2C_SlaveAddressValidFlag = LPI2C_SSR_AVF_MASK, /*!< Address valid flag */ - kLPI2C_SlaveTransmitAckFlag = LPI2C_SSR_TAF_MASK, /*!< Transmit ACK flag */ - kLPI2C_SlaveRepeatedStartDetectFlag = LPI2C_SSR_RSF_MASK, /*!< Repeated start detect flag */ - kLPI2C_SlaveStopDetectFlag = LPI2C_SSR_SDF_MASK, /*!< Stop detect flag */ - kLPI2C_SlaveBitErrFlag = LPI2C_SSR_BEF_MASK, /*!< Bit error flag */ - kLPI2C_SlaveFifoErrFlag = LPI2C_SSR_FEF_MASK, /*!< FIFO error flag */ - kLPI2C_SlaveAddressMatch0Flag = LPI2C_SSR_AM0F_MASK, /*!< Address match 0 flag */ - kLPI2C_SlaveAddressMatch1Flag = LPI2C_SSR_AM1F_MASK, /*!< Address match 1 flag */ - kLPI2C_SlaveGeneralCallFlag = LPI2C_SSR_GCF_MASK, /*!< General call flag */ - kLPI2C_SlaveBusyFlag = LPI2C_SSR_SBF_MASK, /*!< Master busy flag */ - kLPI2C_SlaveBusBusyFlag = LPI2C_SSR_BBF_MASK, /*!< Bus busy flag */ - /*! All flags which are cleared by the driver upon starting a transfer. */ - kLPI2C_SlaveClearFlags = kLPI2C_SlaveRepeatedStartDetectFlag | kLPI2C_SlaveStopDetectFlag | kLPI2C_SlaveBitErrFlag | - kLPI2C_SlaveFifoErrFlag, - /*! IRQ sources enabled by the non-blocking transactional API. */ - kLPI2C_SlaveIrqFlags = kLPI2C_SlaveTxReadyFlag | kLPI2C_SlaveRxReadyFlag | kLPI2C_SlaveStopDetectFlag | - kLPI2C_SlaveRepeatedStartDetectFlag | kLPI2C_SlaveFifoErrFlag | kLPI2C_SlaveBitErrFlag | - kLPI2C_SlaveTransmitAckFlag | kLPI2C_SlaveAddressValidFlag, - /*! Errors to check for. */ - kLPI2C_SlaveErrorFlags = kLPI2C_SlaveFifoErrFlag | kLPI2C_SlaveBitErrFlag -}; - -/*! @brief LPI2C slave address match options. */ -typedef enum _lpi2c_slave_address_match -{ - kLPI2C_MatchAddress0 = 0U, /*!< Match only address 0. */ - kLPI2C_MatchAddress0OrAddress1 = 2U, /*!< Match either address 0 or address 1. */ - kLPI2C_MatchAddress0ThroughAddress1 = 6U, /*!< Match a range of slave addresses from address 0 through address 1. */ -} lpi2c_slave_address_match_t; - -/*! - * @brief Structure with settings to initialize the LPI2C slave module. - * - * This structure holds configuration settings for the LPI2C slave peripheral. To initialize this - * structure to reasonable defaults, call the LPI2C_SlaveGetDefaultConfig() function and - * pass a pointer to your configuration structure instance. - * - * The configuration structure can be made constant so it resides in flash. - */ -typedef struct _lpi2c_slave_config -{ - bool enableSlave; /*!< Enable slave mode. */ - uint8_t address0; /*!< Slave's 7-bit address. */ - uint8_t address1; /*!< Alternate slave 7-bit address. */ - lpi2c_slave_address_match_t addressMatchMode; /*!< Address matching options. */ - bool filterDozeEnable; /*!< Enable digital glitch filter in doze mode. */ - bool filterEnable; /*!< Enable digital glitch filter. */ - bool enableGeneralCall; /*!< Enable general call address matching. */ - struct - { - bool enableAck; /*!< Enables SCL clock stretching during slave-transmit address byte(s) - and slave-receiver address and data byte(s) to allow software to - write the Transmit ACK Register before the ACK or NACK is transmitted. - Clock stretching occurs when transmitting the 9th bit. When - enableAckSCLStall is enabled, there is no need to set either - enableRxDataSCLStall or enableAddressSCLStall. */ - bool enableTx; /*!< Enables SCL clock stretching when the transmit data flag is set - during a slave-transmit transfer. */ - bool enableRx; /*!< Enables SCL clock stretching when receive data flag is set during - a slave-receive transfer. */ - bool enableAddress; /*!< Enables SCL clock stretching when the address valid flag is asserted. */ - } sclStall; /*!< SCL stall enable options. */ - bool ignoreAck; /*!< Continue transfers after a NACK is detected. */ - bool enableReceivedAddressRead; /*!< Enable reading the address received address as the first byte of data. */ - uint32_t sdaGlitchFilterWidth_ns; /*!< Width in nanoseconds of the digital filter on the SDA signal. Set to 0 to - disable. */ - uint32_t sclGlitchFilterWidth_ns; /*!< Width in nanoseconds of the digital filter on the SCL signal. Set to 0 to - disable. */ - uint32_t dataValidDelay_ns; /*!< Width in nanoseconds of the data valid delay. */ - uint32_t clockHoldTime_ns; /*!< Width in nanoseconds of the clock hold time. */ -} lpi2c_slave_config_t; - -/*! - * @brief Set of events sent to the callback for non blocking slave transfers. - * - * These event enumerations are used for two related purposes. First, a bit mask created by OR'ing together - * events is passed to LPI2C_SlaveTransferNonBlocking() in order to specify which events to enable. - * Then, when the slave callback is invoked, it is passed the current event through its @a transfer - * parameter. - * - * @note These enumerations are meant to be OR'd together to form a bit mask of events. - */ -typedef enum _lpi2c_slave_transfer_event -{ - kLPI2C_SlaveAddressMatchEvent = 0x01U, /*!< Received the slave address after a start or repeated start. */ - kLPI2C_SlaveTransmitEvent = 0x02U, /*!< Callback is requested to provide data to transmit - (slave-transmitter role). */ - kLPI2C_SlaveReceiveEvent = 0x04U, /*!< Callback is requested to provide a buffer in which to place received - data (slave-receiver role). */ - kLPI2C_SlaveTransmitAckEvent = 0x08U, /*!< Callback needs to either transmit an ACK or NACK. */ - kLPI2C_SlaveRepeatedStartEvent = 0x10U, /*!< A repeated start was detected. */ - kLPI2C_SlaveCompletionEvent = 0x20U, /*!< A stop was detected, completing the transfer. */ - - /*! Bit mask of all available events. */ - kLPI2C_SlaveAllEvents = kLPI2C_SlaveAddressMatchEvent | kLPI2C_SlaveTransmitEvent | kLPI2C_SlaveReceiveEvent | - kLPI2C_SlaveTransmitAckEvent | kLPI2C_SlaveRepeatedStartEvent | kLPI2C_SlaveCompletionEvent, -} lpi2c_slave_transfer_event_t; - -/*! @brief LPI2C slave transfer structure */ -typedef struct _lpi2c_slave_transfer -{ - lpi2c_slave_transfer_event_t event; /*!< Reason the callback is being invoked. */ - uint8_t receivedAddress; /*!< Matching address send by master. */ - uint8_t *data; /*!< Transfer buffer */ - size_t dataSize; /*!< Transfer size */ - status_t completionStatus; /*!< Success or error code describing how the transfer completed. Only applies for - #kLPI2C_SlaveCompletionEvent. */ - size_t transferredCount; /*!< Number of bytes actually transferred since start or last repeated start. */ -} lpi2c_slave_transfer_t; - -/* Forward declaration. */ -/*! @brief LPI2C slave handle structure. */ -typedef struct _lpi2c_slave_handle lpi2c_slave_handle_t; - -/*! - * @brief Slave event callback function pointer type. - * - * This callback is used only for the slave non-blocking transfer API. To install a callback, - * use the LPI2C_SlaveSetCallback() function after you have created a handle. - * - * @param base Base address for the LPI2C instance on which the event occurred. - * @param transfer Pointer to transfer descriptor containing values passed to and/or from the callback. - * @param userData Arbitrary pointer-sized value passed from the application. - */ -typedef void (*lpi2c_slave_transfer_callback_t)(LPI2C_Type *base, lpi2c_slave_transfer_t *transfer, void *userData); - -/*! - * @brief LPI2C slave handle structure. - * @note The contents of this structure are private and subject to change. - */ -struct _lpi2c_slave_handle -{ - lpi2c_slave_transfer_t transfer; /*!< LPI2C slave transfer copy. */ - bool isBusy; /*!< Whether transfer is busy. */ - bool wasTransmit; /*!< Whether the last transfer was a transmit. */ - uint32_t eventMask; /*!< Mask of enabled events. */ - uint32_t transferredCount; /*!< Count of bytes transferred. */ - lpi2c_slave_transfer_callback_t callback; /*!< Callback function called at transfer event. */ - void *userData; /*!< Callback parameter passed to callback. */ -}; - -/*! @} */ - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! Array to map LPI2C instance number to IRQ number, used internally for LPI2C master interrupt and EDMA transactional -APIs. */ -extern IRQn_Type const kLpi2cIrqs[]; - -/*! Pointer to master IRQ handler for each instance, used internally for LPI2C master interrupt and EDMA transactional -APIs. */ -extern lpi2c_master_isr_t s_lpi2cMasterIsr; - -/*! Pointers to master handles for each instance, used internally for LPI2C master interrupt and EDMA transactional -APIs. */ -extern void *s_lpi2cMasterHandle[]; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @brief Returns an instance number given a base address. - * - * If an invalid base address is passed, debug builds will assert. Release builds will just return - * instance number 0. - * - * @param base The LPI2C peripheral base address. - * @return LPI2C instance number starting from 0. - */ -uint32_t LPI2C_GetInstance(LPI2C_Type *base); - -/*! - * @addtogroup lpi2c_master_driver - * @{ - */ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Provides a default configuration for the LPI2C master peripheral. - * - * This function provides the following default configuration for the LPI2C master peripheral: - * @code - * masterConfig->enableMaster = true; - * masterConfig->debugEnable = false; - * masterConfig->ignoreAck = false; - * masterConfig->pinConfig = kLPI2C_2PinOpenDrain; - * masterConfig->baudRate_Hz = 100000U; - * masterConfig->busIdleTimeout_ns = 0; - * masterConfig->pinLowTimeout_ns = 0; - * masterConfig->sdaGlitchFilterWidth_ns = 0; - * masterConfig->sclGlitchFilterWidth_ns = 0; - * masterConfig->hostRequest.enable = false; - * masterConfig->hostRequest.source = kLPI2C_HostRequestExternalPin; - * masterConfig->hostRequest.polarity = kLPI2C_HostRequestPinActiveHigh; - * @endcode - * - * After calling this function, you can override any settings in order to customize the configuration, - * prior to initializing the master driver with LPI2C_MasterInit(). - * - * @param[out] masterConfig User provided configuration structure for default values. Refer to #lpi2c_master_config_t. - */ -void LPI2C_MasterGetDefaultConfig(lpi2c_master_config_t *masterConfig); - -/*! - * @brief Initializes the LPI2C master peripheral. - * - * This function enables the peripheral clock and initializes the LPI2C master peripheral as described by the user - * provided configuration. A software reset is performed prior to configuration. - * - * @param base The LPI2C peripheral base address. - * @param masterConfig User provided peripheral configuration. Use LPI2C_MasterGetDefaultConfig() to get a set of - * defaults - * that you can override. - * @param sourceClock_Hz Frequency in Hertz of the LPI2C functional clock. Used to calculate the baud rate divisors, - * filter widths, and timeout periods. - */ -void LPI2C_MasterInit(LPI2C_Type *base, const lpi2c_master_config_t *masterConfig, uint32_t sourceClock_Hz); - -/*! - * @brief Deinitializes the LPI2C master peripheral. - * - * This function disables the LPI2C master peripheral and gates the clock. It also performs a software - * reset to restore the peripheral to reset conditions. - * - * @param base The LPI2C peripheral base address. - */ -void LPI2C_MasterDeinit(LPI2C_Type *base); - -/*! - * @brief Configures LPI2C master data match feature. - * - * @param base The LPI2C peripheral base address. - * @param matchConfig Settings for the data match feature. - */ -void LPI2C_MasterConfigureDataMatch(LPI2C_Type *base, const lpi2c_data_match_config_t *matchConfig); - -/*! - * @brief Convert provided flags to status code, and clear any errors if present. - * @param base The LPI2C peripheral base address. - * @param status Current status flags value that will be checked. - * @retval #kStatus_Success - * @retval #kStatus_LPI2C_PinLowTimeout - * @retval #kStatus_LPI2C_ArbitrationLost - * @retval #kStatus_LPI2C_Nak - * @retval #kStatus_LPI2C_FifoError - */ -/* Not static so it can be used from fsl_lpi2c_edma.c. */ -status_t LPI2C_MasterCheckAndClearError(LPI2C_Type *base, uint32_t status); - -/*! - * @brief Make sure the bus isn't already busy. - * - * A busy bus is allowed if we are the one driving it. - * - * @param base The LPI2C peripheral base address. - * @retval #kStatus_Success - * @retval #kStatus_LPI2C_Busy - */ -/* Not static so it can be used from fsl_lpi2c_edma.c. */ -status_t LPI2C_CheckForBusyBus(LPI2C_Type *base); - -/*! - * @brief Performs a software reset. - * - * Restores the LPI2C master peripheral to reset conditions. - * - * @param base The LPI2C peripheral base address. - */ -static inline void LPI2C_MasterReset(LPI2C_Type *base) -{ - base->MCR = LPI2C_MCR_RST_MASK; - base->MCR = 0; -} - -/*! - * @brief Enables or disables the LPI2C module as master. - * - * @param base The LPI2C peripheral base address. - * @param enable Pass true to enable or false to disable the specified LPI2C as master. - */ -static inline void LPI2C_MasterEnable(LPI2C_Type *base, bool enable) -{ - base->MCR = (base->MCR & ~LPI2C_MCR_MEN_MASK) | LPI2C_MCR_MEN(enable); -} - -/*! @}*/ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets the LPI2C master status flags. - * - * A bit mask with the state of all LPI2C master status flags is returned. For each flag, the corresponding bit - * in the return value is set if the flag is asserted. - * - * @param base The LPI2C peripheral base address. - * @return State of the status flags: - * - 1: related status flag is set. - * - 0: related status flag is not set. - * @see _lpi2c_master_flags - */ -static inline uint32_t LPI2C_MasterGetStatusFlags(LPI2C_Type *base) -{ - return base->MSR; -} - -/*! - * @brief Clears the LPI2C master status flag state. - * - * The following status register flags can be cleared: - * - #kLPI2C_MasterEndOfPacketFlag - * - #kLPI2C_MasterStopDetectFlag - * - #kLPI2C_MasterNackDetectFlag - * - #kLPI2C_MasterArbitrationLostFlag - * - #kLPI2C_MasterFifoErrFlag - * - #kLPI2C_MasterPinLowTimeoutFlag - * - #kLPI2C_MasterDataMatchFlag - * - * Attempts to clear other flags has no effect. - * - * @param base The LPI2C peripheral base address. - * @param statusMask A bitmask of status flags that are to be cleared. The mask is composed of - * _lpi2c_master_flags enumerators OR'd together. You may pass the result of a previous call to - * LPI2C_MasterGetStatusFlags(). - * @see _lpi2c_master_flags. - */ -static inline void LPI2C_MasterClearStatusFlags(LPI2C_Type *base, uint32_t statusMask) -{ - base->MSR = statusMask; -} - -/*! @}*/ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables the LPI2C master interrupt requests. - * - * All flags except #kLPI2C_MasterBusyFlag and #kLPI2C_MasterBusBusyFlag can be enabled as - * interrupts. - * - * @param base The LPI2C peripheral base address. - * @param interruptMask Bit mask of interrupts to enable. See _lpi2c_master_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void LPI2C_MasterEnableInterrupts(LPI2C_Type *base, uint32_t interruptMask) -{ - base->MIER |= interruptMask; -} - -/*! - * @brief Disables the LPI2C master interrupt requests. - * - * All flags except #kLPI2C_MasterBusyFlag and #kLPI2C_MasterBusBusyFlag can be enabled as - * interrupts. - * - * @param base The LPI2C peripheral base address. - * @param interruptMask Bit mask of interrupts to disable. See _lpi2c_master_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void LPI2C_MasterDisableInterrupts(LPI2C_Type *base, uint32_t interruptMask) -{ - base->MIER &= ~interruptMask; -} - -/*! - * @brief Returns the set of currently enabled LPI2C master interrupt requests. - * - * @param base The LPI2C peripheral base address. - * @return A bitmask composed of _lpi2c_master_flags enumerators OR'd together to indicate the - * set of enabled interrupts. - */ -static inline uint32_t LPI2C_MasterGetEnabledInterrupts(LPI2C_Type *base) -{ - return base->MIER; -} - -/*! @}*/ - -/*! - * @name DMA control - * @{ - */ - -/*! - * @brief Enables or disables LPI2C master DMA requests. - * - * @param base The LPI2C peripheral base address. - * @param enableTx Enable flag for transmit DMA request. Pass true for enable, false for disable. - * @param enableRx Enable flag for receive DMA request. Pass true for enable, false for disable. - */ -static inline void LPI2C_MasterEnableDMA(LPI2C_Type *base, bool enableTx, bool enableRx) -{ - base->MDER = LPI2C_MDER_TDDE(enableTx) | LPI2C_MDER_RDDE(enableRx); -} - -/*! - * @brief Gets LPI2C master transmit data register address for DMA transfer. - * - * @param base The LPI2C peripheral base address. - * @return The LPI2C Master Transmit Data Register address. - */ -static inline uint32_t LPI2C_MasterGetTxFifoAddress(LPI2C_Type *base) -{ - return (uint32_t)(uintptr_t)&base->MTDR; -} - -/*! - * @brief Gets LPI2C master receive data register address for DMA transfer. - * - * @param base The LPI2C peripheral base address. - * @return The LPI2C Master Receive Data Register address. - */ -static inline uint32_t LPI2C_MasterGetRxFifoAddress(LPI2C_Type *base) -{ - return (uint32_t)(uintptr_t)&base->MRDR; -} - -/*! @}*/ - -/*! - * @name FIFO control - * @{ - */ - -/*! - * @brief Sets the watermarks for LPI2C master FIFOs. - * - * @param base The LPI2C peripheral base address. - * @param txWords Transmit FIFO watermark value in words. The #kLPI2C_MasterTxReadyFlag flag is set whenever - * the number of words in the transmit FIFO is equal or less than @a txWords. Writing a value equal or - * greater than the FIFO size is truncated. - * @param rxWords Receive FIFO watermark value in words. The #kLPI2C_MasterRxReadyFlag flag is set whenever - * the number of words in the receive FIFO is greater than @a rxWords. Writing a value equal or greater - * than the FIFO size is truncated. - */ -static inline void LPI2C_MasterSetWatermarks(LPI2C_Type *base, size_t txWords, size_t rxWords) -{ - base->MFCR = LPI2C_MFCR_TXWATER(txWords) | LPI2C_MFCR_RXWATER(rxWords); -} - -/*! - * @brief Gets the current number of words in the LPI2C master FIFOs. - * - * @param base The LPI2C peripheral base address. - * @param[out] txCount Pointer through which the current number of words in the transmit FIFO is returned. - * Pass NULL if this value is not required. - * @param[out] rxCount Pointer through which the current number of words in the receive FIFO is returned. - * Pass NULL if this value is not required. - */ -static inline void LPI2C_MasterGetFifoCounts(LPI2C_Type *base, size_t *rxCount, size_t *txCount) -{ - if (NULL != txCount) - { - *txCount = (base->MFSR & LPI2C_MFSR_TXCOUNT_MASK) >> LPI2C_MFSR_TXCOUNT_SHIFT; - } - if (NULL != rxCount) - { - *rxCount = (base->MFSR & LPI2C_MFSR_RXCOUNT_MASK) >> LPI2C_MFSR_RXCOUNT_SHIFT; - } -} - -/*! @}*/ - -/*! - * @name Bus operations - * @{ - */ - -/*! - * @brief Sets the I2C bus frequency for master transactions. - * - * The LPI2C master is automatically disabled and re-enabled as necessary to configure the baud - * rate. Do not call this function during a transfer, or the transfer is aborted. - * - * @note Please note that the second parameter is the clock frequency of LPI2C module, the third - * parameter means user configured bus baudrate, this implementation is different from other I2C drivers - * which use baudrate configuration as second parameter and source clock frequency as third parameter. - * - * @param base The LPI2C peripheral base address. - * @param sourceClock_Hz LPI2C functional clock frequency in Hertz. - * @param baudRate_Hz Requested bus frequency in Hertz. - */ -void LPI2C_MasterSetBaudRate(LPI2C_Type *base, uint32_t sourceClock_Hz, uint32_t baudRate_Hz); - -/*! - * @brief Returns whether the bus is idle. - * - * Requires the master mode to be enabled. - * - * @param base The LPI2C peripheral base address. - * @retval true Bus is busy. - * @retval false Bus is idle. - */ -static inline bool LPI2C_MasterGetBusIdleState(LPI2C_Type *base) -{ - return ((base->MSR & LPI2C_MSR_BBF_MASK) >> LPI2C_MSR_BBF_SHIFT) == 1U ? true : false; -} - -/*! - * @brief Sends a START signal and slave address on the I2C bus. - * - * This function is used to initiate a new master mode transfer. First, the bus state is checked to ensure - * that another master is not occupying the bus. Then a START signal is transmitted, followed by the - * 7-bit address specified in the @a address parameter. Note that this function does not actually wait - * until the START and address are successfully sent on the bus before returning. - * - * @param base The LPI2C peripheral base address. - * @param address 7-bit slave device address, in bits [6:0]. - * @param dir Master transfer direction, either #kLPI2C_Read or #kLPI2C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * @retval kStatus_Success START signal and address were successfully enqueued in the transmit FIFO. - * @retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - */ -status_t LPI2C_MasterStart(LPI2C_Type *base, uint8_t address, lpi2c_direction_t dir); - -/*! - * @brief Sends a repeated START signal and slave address on the I2C bus. - * - * This function is used to send a Repeated START signal when a transfer is already in progress. Like - * LPI2C_MasterStart(), it also sends the specified 7-bit address. - * - * @note This function exists primarily to maintain compatible APIs between LPI2C and I2C drivers, - * as well as to better document the intent of code that uses these APIs. - * - * @param base The LPI2C peripheral base address. - * @param address 7-bit slave device address, in bits [6:0]. - * @param dir Master transfer direction, either #kLPI2C_Read or #kLPI2C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * @retval kStatus_Success Repeated START signal and address were successfully enqueued in the transmit FIFO. - * @retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - */ -static inline status_t LPI2C_MasterRepeatedStart(LPI2C_Type *base, uint8_t address, lpi2c_direction_t dir) -{ - return LPI2C_MasterStart(base, address, dir); -} - -/*! - * @brief Performs a polling send transfer on the I2C bus. - * - * Sends up to @a txSize number of bytes to the previously addressed slave device. The slave may - * reply with a NAK to any byte in order to terminate the transfer early. If this happens, this - * function returns #kStatus_LPI2C_Nak. - * - * @param base The LPI2C peripheral base address. - * @param txBuff The pointer to the data to be transferred. - * @param txSize The length in bytes of the data to be transferred. - * @retval kStatus_Success Data was sent successfully. - * @retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * @retval #kStatus_LPI2C_FifoError FIFO under run or over run. - * @retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * @retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterSend(LPI2C_Type *base, void *txBuff, size_t txSize); - -/*! - * @brief Performs a polling receive transfer on the I2C bus. - * - * @param base The LPI2C peripheral base address. - * @param rxBuff The pointer to the data to be transferred. - * @param rxSize The length in bytes of the data to be transferred. - * @retval kStatus_Success Data was received successfully. - * @retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * @retval #kStatus_LPI2C_FifoError FIFO under run or overrun. - * @retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * @retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterReceive(LPI2C_Type *base, void *rxBuff, size_t rxSize); - -/*! - * @brief Sends a STOP signal on the I2C bus. - * - * This function does not return until the STOP signal is seen on the bus, or an error occurs. - * - * @param base The LPI2C peripheral base address. - * @retval kStatus_Success The STOP signal was successfully sent on the bus and the transaction terminated. - * @retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * @retval #kStatus_LPI2C_FifoError FIFO under run or overrun. - * @retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * @retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterStop(LPI2C_Type *base); - -/*! - * @brief Performs a master polling transfer on the I2C bus. - * - * @note The API does not return until the transfer succeeds or fails due - * to error happens during transfer. - * - * @param base The LPI2C peripheral base address. - * @param transfer Pointer to the transfer structure. - * @retval kStatus_Success Data was received successfully. - * @retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * @retval #kStatus_LPI2C_FifoError FIFO under run or overrun. - * @retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * @retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterTransferBlocking(LPI2C_Type *base, lpi2c_master_transfer_t *transfer); - -/*! @}*/ - -/*! - * @name Non-blocking - * @{ - */ - -/*! - * @brief Creates a new handle for the LPI2C master non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the LPI2C_MasterTransferAbort() API shall be called. - * - * - * @note The function also enables the NVIC IRQ for the input LPI2C. Need to notice - * that on some SoCs the LPI2C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - * - * @param base The LPI2C peripheral base address. - * @param[out] handle Pointer to the LPI2C master driver handle. - * @param callback User provided pointer to the asynchronous callback function. - * @param userData User provided pointer to the application callback data. - */ -void LPI2C_MasterTransferCreateHandle(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_master_transfer_callback_t callback, - void *userData); - -/*! - * @brief Performs a non-blocking transaction on the I2C bus. - * - * @param base The LPI2C peripheral base address. - * @param handle Pointer to the LPI2C master driver handle. - * @param transfer The pointer to the transfer descriptor. - * @retval kStatus_Success The transaction was started successfully. - * @retval #kStatus_LPI2C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - */ -status_t LPI2C_MasterTransferNonBlocking(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_master_transfer_t *transfer); - -/*! - * @brief Returns number of bytes transferred so far. - * @param base The LPI2C peripheral base address. - * @param handle Pointer to the LPI2C master driver handle. - * @param[out] count Number of bytes transferred so far by the non-blocking transaction. - * @retval kStatus_Success - * @retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t LPI2C_MasterTransferGetCount(LPI2C_Type *base, lpi2c_master_handle_t *handle, size_t *count); - -/*! - * @brief Terminates a non-blocking LPI2C master transmission early. - * - * @note It is not safe to call this function from an IRQ handler that has a higher priority than the - * LPI2C peripheral's IRQ priority. - * - * @param base The LPI2C peripheral base address. - * @param handle Pointer to the LPI2C master driver handle. - */ -void LPI2C_MasterTransferAbort(LPI2C_Type *base, lpi2c_master_handle_t *handle); - -/*! @}*/ - -/*! - * @name IRQ handler - * @{ - */ - -/*! - * @brief Reusable routine to handle master interrupts. - * @note This function does not need to be called unless you are reimplementing the - * nonblocking API's interrupt handler routines to add special functionality. - * @param base The LPI2C peripheral base address. - * @param lpi2cMasterHandle Pointer to the LPI2C master driver handle. - */ -void LPI2C_MasterTransferHandleIRQ(LPI2C_Type *base, void *lpi2cMasterHandle); - -/*! @}*/ - -/*! @} */ - -/*! - * @addtogroup lpi2c_slave_driver - * @{ - */ - -/*! - * @name Slave initialization and deinitialization - * @{ - */ - -/*! - * @brief Provides a default configuration for the LPI2C slave peripheral. - * - * This function provides the following default configuration for the LPI2C slave peripheral: - * @code - * slaveConfig->enableSlave = true; - * slaveConfig->address0 = 0U; - * slaveConfig->address1 = 0U; - * slaveConfig->addressMatchMode = kLPI2C_MatchAddress0; - * slaveConfig->filterDozeEnable = true; - * slaveConfig->filterEnable = true; - * slaveConfig->enableGeneralCall = false; - * slaveConfig->sclStall.enableAck = false; - * slaveConfig->sclStall.enableTx = true; - * slaveConfig->sclStall.enableRx = true; - * slaveConfig->sclStall.enableAddress = true; - * slaveConfig->ignoreAck = false; - * slaveConfig->enableReceivedAddressRead = false; - * slaveConfig->sdaGlitchFilterWidth_ns = 0; - * slaveConfig->sclGlitchFilterWidth_ns = 0; - * slaveConfig->dataValidDelay_ns = 0; - * slaveConfig->clockHoldTime_ns = 0; - * @endcode - * - * After calling this function, override any settings to customize the configuration, - * prior to initializing the master driver with LPI2C_SlaveInit(). Be sure to override at least the @a - * address0 member of the configuration structure with the desired slave address. - * - * @param[out] slaveConfig User provided configuration structure that is set to default values. Refer to - * #lpi2c_slave_config_t. - */ -void LPI2C_SlaveGetDefaultConfig(lpi2c_slave_config_t *slaveConfig); - -/*! - * @brief Initializes the LPI2C slave peripheral. - * - * This function enables the peripheral clock and initializes the LPI2C slave peripheral as described by the user - * provided configuration. - * - * @param base The LPI2C peripheral base address. - * @param slaveConfig User provided peripheral configuration. Use LPI2C_SlaveGetDefaultConfig() to get a set of defaults - * that you can override. - * @param sourceClock_Hz Frequency in Hertz of the LPI2C functional clock. Used to calculate the filter widths, - * data valid delay, and clock hold time. - */ -void LPI2C_SlaveInit(LPI2C_Type *base, const lpi2c_slave_config_t *slaveConfig, uint32_t sourceClock_Hz); - -/*! - * @brief Deinitializes the LPI2C slave peripheral. - * - * This function disables the LPI2C slave peripheral and gates the clock. It also performs a software - * reset to restore the peripheral to reset conditions. - * - * @param base The LPI2C peripheral base address. - */ -void LPI2C_SlaveDeinit(LPI2C_Type *base); - -/*! - * @brief Performs a software reset of the LPI2C slave peripheral. - * - * @param base The LPI2C peripheral base address. - */ -static inline void LPI2C_SlaveReset(LPI2C_Type *base) -{ - base->SCR = LPI2C_SCR_RST_MASK; - base->SCR = 0; -} - -/*! - * @brief Enables or disables the LPI2C module as slave. - * - * @param base The LPI2C peripheral base address. - * @param enable Pass true to enable or false to disable the specified LPI2C as slave. - */ -static inline void LPI2C_SlaveEnable(LPI2C_Type *base, bool enable) -{ - base->SCR = (base->SCR & ~LPI2C_SCR_SEN_MASK) | LPI2C_SCR_SEN(enable); -} - -/*! @}*/ - -/*! - * @name Slave status - * @{ - */ - -/*! - * @brief Gets the LPI2C slave status flags. - * - * A bit mask with the state of all LPI2C slave status flags is returned. For each flag, the corresponding bit - * in the return value is set if the flag is asserted. - * - * @param base The LPI2C peripheral base address. - * @return State of the status flags: - * - 1: related status flag is set. - * - 0: related status flag is not set. - * @see _lpi2c_slave_flags - */ -static inline uint32_t LPI2C_SlaveGetStatusFlags(LPI2C_Type *base) -{ - return base->SSR; -} - -/*! - * @brief Clears the LPI2C status flag state. - * - * The following status register flags can be cleared: - * - #kLPI2C_SlaveRepeatedStartDetectFlag - * - #kLPI2C_SlaveStopDetectFlag - * - #kLPI2C_SlaveBitErrFlag - * - #kLPI2C_SlaveFifoErrFlag - * - * Attempts to clear other flags has no effect. - * - * @param base The LPI2C peripheral base address. - * @param statusMask A bitmask of status flags that are to be cleared. The mask is composed of - * #_lpi2c_slave_flags enumerators OR'd together. You may pass the result of a previous call to - * LPI2C_SlaveGetStatusFlags(). - * @see _lpi2c_slave_flags. - */ -static inline void LPI2C_SlaveClearStatusFlags(LPI2C_Type *base, uint32_t statusMask) -{ - base->SSR = statusMask; -} -/*! @}*/ - -/*! - * @name Slave interrupts - * @{ - */ - -/*! - * @brief Enables the LPI2C slave interrupt requests. - * - * All flags except #kLPI2C_SlaveBusyFlag and #kLPI2C_SlaveBusBusyFlag can be enabled as - * interrupts. - * - * @param base The LPI2C peripheral base address. - * @param interruptMask Bit mask of interrupts to enable. See #_lpi2c_slave_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void LPI2C_SlaveEnableInterrupts(LPI2C_Type *base, uint32_t interruptMask) -{ - base->SIER |= interruptMask; -} - -/*! - * @brief Disables the LPI2C slave interrupt requests. - * - * All flags except #kLPI2C_SlaveBusyFlag and #kLPI2C_SlaveBusBusyFlag can be enabled as - * interrupts. - * - * @param base The LPI2C peripheral base address. - * @param interruptMask Bit mask of interrupts to disable. See #_lpi2c_slave_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void LPI2C_SlaveDisableInterrupts(LPI2C_Type *base, uint32_t interruptMask) -{ - base->SIER &= ~interruptMask; -} - -/*! - * @brief Returns the set of currently enabled LPI2C slave interrupt requests. - * @param base The LPI2C peripheral base address. - * @return A bitmask composed of #_lpi2c_slave_flags enumerators OR'd together to indicate the - * set of enabled interrupts. - */ -static inline uint32_t LPI2C_SlaveGetEnabledInterrupts(LPI2C_Type *base) -{ - return base->SIER; -} - -/*! @}*/ - -/*! - * @name Slave DMA control - * @{ - */ - -/*! - * @brief Enables or disables the LPI2C slave peripheral DMA requests. - * - * @param base The LPI2C peripheral base address. - * @param enableAddressValid Enable flag for the address valid DMA request. Pass true for enable, false for disable. - * The address valid DMA request is shared with the receive data DMA request. - * @param enableRx Enable flag for the receive data DMA request. Pass true for enable, false for disable. - * @param enableTx Enable flag for the transmit data DMA request. Pass true for enable, false for disable. - */ -static inline void LPI2C_SlaveEnableDMA(LPI2C_Type *base, bool enableAddressValid, bool enableRx, bool enableTx) -{ - base->SDER = (base->SDER & ~(LPI2C_SDER_AVDE_MASK | LPI2C_SDER_RDDE_MASK | LPI2C_SDER_TDDE_MASK)) | - LPI2C_SDER_AVDE(enableAddressValid) | LPI2C_SDER_RDDE(enableRx) | LPI2C_SDER_TDDE(enableTx); -} - -/*! @}*/ - -/*! - * @name Slave bus operations - * @{ - */ - -/*! - * @brief Returns whether the bus is idle. - * - * Requires the slave mode to be enabled. - * - * @param base The LPI2C peripheral base address. - * @retval true Bus is busy. - * @retval false Bus is idle. - */ -static inline bool LPI2C_SlaveGetBusIdleState(LPI2C_Type *base) -{ - return ((base->SSR & LPI2C_SSR_BBF_MASK) >> LPI2C_SSR_BBF_SHIFT) == 1U ? true : false; -} - -/*! - * @brief Transmits either an ACK or NAK on the I2C bus in response to a byte from the master. - * - * Use this function to send an ACK or NAK when the #kLPI2C_SlaveTransmitAckFlag is asserted. This - * only happens if you enable the sclStall.enableAck field of the ::lpi2c_slave_config_t configuration - * structure used to initialize the slave peripheral. - * - * @param base The LPI2C peripheral base address. - * @param ackOrNack Pass true for an ACK or false for a NAK. - */ -static inline void LPI2C_SlaveTransmitAck(LPI2C_Type *base, bool ackOrNack) -{ - base->STAR = LPI2C_STAR_TXNACK(!ackOrNack); -} - -/*! - * @brief Enables or disables ACKSTALL. - * - * When enables ACKSTALL, software can transmit either an ACK or NAK on the I2C bus in response to - * a byte from the master. - * - * @param base The LPI2C peripheral base address. - * @param enable True will enable ACKSTALL,false will disable ACKSTALL. - */ -static inline void LPI2C_SlaveEnableAckStall(LPI2C_Type *base, bool enable) -{ - if (enable) - { - base->SCFGR1 |= LPI2C_SCFGR1_ACKSTALL_MASK; - } - else - { - base->SCFGR1 &= ~LPI2C_SCFGR1_ACKSTALL_MASK; - } -} - -/*! - * @brief Returns the slave address sent by the I2C master. - * - * This function should only be called if the #kLPI2C_SlaveAddressValidFlag is asserted. - * - * @param base The LPI2C peripheral base address. - * @return The 8-bit address matched by the LPI2C slave. Bit 0 contains the R/w direction bit, and - * the 7-bit slave address is in the upper 7 bits. - */ -static inline uint32_t LPI2C_SlaveGetReceivedAddress(LPI2C_Type *base) -{ - return base->SASR & LPI2C_SASR_RADDR_MASK; -} - -/*! - * @brief Performs a polling send transfer on the I2C bus. - * - * @param base The LPI2C peripheral base address. - * @param txBuff The pointer to the data to be transferred. - * @param txSize The length in bytes of the data to be transferred. - * @param[out] actualTxSize - * @return Error or success status returned by API. - */ -status_t LPI2C_SlaveSend(LPI2C_Type *base, void *txBuff, size_t txSize, size_t *actualTxSize); - -/*! - * @brief Performs a polling receive transfer on the I2C bus. - * - * @param base The LPI2C peripheral base address. - * @param rxBuff The pointer to the data to be transferred. - * @param rxSize The length in bytes of the data to be transferred. - * @param[out] actualRxSize - * @return Error or success status returned by API. - */ -status_t LPI2C_SlaveReceive(LPI2C_Type *base, void *rxBuff, size_t rxSize, size_t *actualRxSize); - -/*! @}*/ - -/*! - * @name Slave non-blocking - * @{ - */ - -/*! - * @brief Creates a new handle for the LPI2C slave non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the LPI2C_SlaveTransferAbort() API shall be called. - * - * @note The function also enables the NVIC IRQ for the input LPI2C. Need to notice - * that on some SoCs the LPI2C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - - * @param base The LPI2C peripheral base address. - * @param[out] handle Pointer to the LPI2C slave driver handle. - * @param callback User provided pointer to the asynchronous callback function. - * @param userData User provided pointer to the application callback data. - */ -void LPI2C_SlaveTransferCreateHandle(LPI2C_Type *base, - lpi2c_slave_handle_t *handle, - lpi2c_slave_transfer_callback_t callback, - void *userData); - -/*! - * @brief Starts accepting slave transfers. - * - * Call this API after calling I2C_SlaveInit() and LPI2C_SlaveTransferCreateHandle() to start processing - * transactions driven by an I2C master. The slave monitors the I2C bus and pass events to the - * callback that was passed into the call to LPI2C_SlaveTransferCreateHandle(). The callback is always invoked - * from the interrupt context. - * - * The set of events received by the callback is customizable. To do so, set the @a eventMask parameter to - * the OR'd combination of #lpi2c_slave_transfer_event_t enumerators for the events you wish to receive. - * The #kLPI2C_SlaveTransmitEvent and #kLPI2C_SlaveReceiveEvent events are always enabled and do not need - * to be included in the mask. Alternatively, you can pass 0 to get a default set of only the transmit and - * receive events that are always enabled. In addition, the #kLPI2C_SlaveAllEvents constant is provided as - * a convenient way to enable all events. - * - * @param base The LPI2C peripheral base address. - * @param handle Pointer to lpi2c_slave_handle_t structure which stores the transfer state. - * @param eventMask Bit mask formed by OR'ing together #lpi2c_slave_transfer_event_t enumerators to specify - * which events to send to the callback. Other accepted values are 0 to get a default set of - * only the transmit and receive events, and #kLPI2C_SlaveAllEvents to enable all events. - * - * @retval kStatus_Success Slave transfers were successfully started. - * @retval #kStatus_LPI2C_Busy Slave transfers have already been started on this handle. - */ -status_t LPI2C_SlaveTransferNonBlocking(LPI2C_Type *base, lpi2c_slave_handle_t *handle, uint32_t eventMask); - -/*! - * @brief Gets the slave transfer status during a non-blocking transfer. - * @param base The LPI2C peripheral base address. - * @param handle Pointer to i2c_slave_handle_t structure. - * @param[out] count Pointer to a value to hold the number of bytes transferred. May be NULL if the count is not - * required. - * @retval kStatus_Success - * @retval kStatus_NoTransferInProgress - */ -status_t LPI2C_SlaveTransferGetCount(LPI2C_Type *base, lpi2c_slave_handle_t *handle, size_t *count); - -/*! - * @brief Aborts the slave non-blocking transfers. - * @note This API could be called at any time to stop slave for handling the bus events. - * @param base The LPI2C peripheral base address. - * @param handle Pointer to lpi2c_slave_handle_t structure which stores the transfer state. - */ -void LPI2C_SlaveTransferAbort(LPI2C_Type *base, lpi2c_slave_handle_t *handle); - -/*! @}*/ - -/*! - * @name Slave IRQ handler - * @{ - */ - -/*! - * @brief Reusable routine to handle slave interrupts. - * @note This function does not need to be called unless you are reimplementing the - * non blocking API's interrupt handler routines to add special functionality. - * @param base The LPI2C peripheral base address. - * @param handle Pointer to lpi2c_slave_handle_t structure which stores the transfer state. - */ -void LPI2C_SlaveTransferHandleIRQ(LPI2C_Type *base, lpi2c_slave_handle_t *handle); - -/*! @}*/ - -/*! @} */ - -#if defined(__cplusplus) -} -#endif -/*! @} */ -#endif /* FSL_LPI2C_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpi2c_edma.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpi2c_edma.c deleted file mode 100644 index 9c57f55006b..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpi2c_edma.c +++ /dev/null @@ -1,659 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpi2c_edma.h" -#include -#include - -/* - * $Coverage Justification Reference$ - * - * $Justification fsl_lpi2c_edma_c_ref_1$ - * Need multiple master and slave modules on bus to simulate the true branch - * - * $Justification fsl_lpi2c_edma_c_ref_2$ - * FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(X) is a constant. - * - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpi2c_edma" -#endif - -/* @brief Mask to align an address to edma_tcd_t size. */ -#define ALIGN_TCD_SIZE_MASK (sizeof(edma_tcd_t) - 1U) - -/* ! @brief LPI2C master fifo commands. */ -enum _lpi2c_master_fifo_cmd -{ - kTxDataCmd = LPI2C_MTDR_CMD(0x0U), /*!< Transmit DATA[7:0] */ - kRxDataCmd = LPI2C_MTDR_CMD(0X1U), /*!< Receive (DATA[7:0] + 1) bytes */ - kStopCmd = LPI2C_MTDR_CMD(0x2U), /*!< Generate STOP condition */ - kStartCmd = LPI2C_MTDR_CMD(0x4U), /*!< Generate(repeated) START and transmit address in DATA[[7:0] */ -}; - -/*! @brief States for the state machine used by transactional APIs. */ -enum _lpi2c_transfer_states -{ - kIdleState = 0, - kSendCommandState, - kIssueReadCommandState, - kTransferDataState, - kStopState, - kWaitForCompletionState, -}; - -/*! @brief Typedef for interrupt handler. */ -typedef void (*lpi2c_isr_t)(LPI2C_Type *base, void *handle); - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Prepares the command buffer with the sequence of commands needed to send the requested transaction. - * @param handle Master DMA driver handle. - * @return Number of command words. - */ -static uint32_t LPI2C_GenerateCommands(lpi2c_master_edma_handle_t *handle); - -/*! - * @brief DMA completion callback. - * @param dmaHandle DMA channel handle for the channel that completed. - * @param userData User data associated with the channel handle. For this callback, the user data is the - * LPI2C DMA driver handle. - * @param isTransferDone Whether the DMA transfer has completed. - * @param tcds Number of TCDs that completed. - */ -static void LPI2C_MasterEDMACallback(edma_handle_t *dmaHandle, void *userData, bool isTransferDone, uint32_t tcds); - -/*! - * @brief LPI2C master edma transfer IRQ handle routine. - * - * This API handles the LPI2C bus error status and invoke callback if needed. - * - * @param base The LPI2C peripheral base address. - * @param lpi2cMasterEdmaHandle Pointer to the LPI2C master edma handle. - */ -static void LPI2C_MasterTransferEdmaHandleIRQ(LPI2C_Type *base, void *lpi2cMasterEdmaHandle); -/******************************************************************************* - * Variables - ******************************************************************************/ - -static uint32_t lpi2c_edma_RecSetting = 0x02; - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Create a new handle for the LPI2C master DMA APIs. - * - * The creation of a handle is for use with the DMA APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the LPI2C_MasterTransferAbortEDMA() API shall be called. - * - * For devices where the LPI2C send and receive DMA requests are OR'd together, the a txDmaHandle - * parameter is ignored and may be set to NULL. - * - * param base The LPI2C peripheral base address. - * param[out] handle Pointer to the LPI2C master driver handle. - * param rxDmaHandle Handle for the eDMA receive channel. Created by the user prior to calling this function. - * param txDmaHandle Handle for the eDMA transmit channel. Created by the user prior to calling this function. - * param callback User provided pointer to the asynchronous callback function. - * param userData User provided pointer to the application callback data. - */ -void LPI2C_MasterCreateEDMAHandle(LPI2C_Type *base, - lpi2c_master_edma_handle_t *handle, - edma_handle_t *rxDmaHandle, - edma_handle_t *txDmaHandle, - lpi2c_master_edma_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - assert(rxDmaHandle != NULL); - assert(txDmaHandle != NULL); - - /* Look up instance number */ - uint32_t instance = LPI2C_GetInstance(base); - - /* Clear out the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Set up the handle. For combined rx/tx DMA requests, the tx channel handle is set to the rx handle */ - /* in order to make the transfer API code simpler. */ - handle->base = base; - handle->completionCallback = callback; - handle->userData = userData; - handle->rx = rxDmaHandle; - handle->tx = (FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base) > 0) ? txDmaHandle : rxDmaHandle; - - /* Save the handle in global variables to support the double weak mechanism. */ - s_lpi2cMasterHandle[instance] = handle; - - /* Set LPI2C_MasterTransferEdmaHandleIRQ as LPI2C DMA IRQ handler */ - s_lpi2cMasterIsr = LPI2C_MasterTransferEdmaHandleIRQ; - - /* Enable interrupt in NVIC. */ - (void)EnableIRQ(kLpi2cIrqs[instance]); - - /* Set DMA channel completion callbacks. */ - EDMA_SetCallback(handle->rx, LPI2C_MasterEDMACallback, handle); - if (FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base) != 0) - { - EDMA_SetCallback(handle->tx, LPI2C_MasterEDMACallback, handle); - } -} - -static uint32_t LPI2C_GenerateCommands(lpi2c_master_edma_handle_t *handle) -{ - lpi2c_master_transfer_t *xfer = &handle->transfer; - uint16_t *cmd = (uint16_t *)&handle->commandBuffer; - uint32_t cmdCount = 0; - - /* Handle no start option. */ - if ((xfer->flags & (uint32_t)kLPI2C_TransferNoStartFlag) != 0U) - { - if (xfer->direction == kLPI2C_Read) - { - /* Need to issue read command first. */ - cmd[cmdCount++] = (uint16_t)kRxDataCmd | (uint16_t)LPI2C_MTDR_DATA(xfer->dataSize - 1U); - } - } - else - { - /* - * Initial direction depends on whether a subaddress was provided, and of course the actual - * data transfer direction. - */ - lpi2c_direction_t direction = (xfer->subaddressSize != 0U) ? kLPI2C_Write : xfer->direction; - - /* Start command. */ - cmd[cmdCount++] = - (uint16_t)kStartCmd | (uint16_t)((uint16_t)((uint16_t)xfer->slaveAddress << 1U) | (uint16_t)direction); - - /* Subaddress, MSB first. */ - if (xfer->subaddressSize != 0U) - { - uint32_t subaddressRemaining = xfer->subaddressSize; - while (0U != subaddressRemaining--) - { - uint8_t subaddressByte = (uint8_t)(xfer->subaddress >> (8U * subaddressRemaining)) & 0xffU; - cmd[cmdCount++] = subaddressByte; - } - } - - /* Reads need special handling because we have to issue a read command and maybe a repeated start. */ - if ((xfer->dataSize != 0U) && (xfer->direction == kLPI2C_Read)) - { - /* Need to send repeated start if switching directions to read. */ - if (direction == kLPI2C_Write) - { - cmd[cmdCount++] = (uint16_t)kStartCmd | - (uint16_t)((uint16_t)((uint16_t)xfer->slaveAddress << 1U) | (uint16_t)kLPI2C_Read); - } - - /* Read command. A single write to MTDR can issue read operation of 0xFFU + 1 byte of data at most, so when - the dataSize is larger than 0x100U, push multiple read commands to MTDR until dataSize is reached. */ - size_t tmpRxSize = xfer->dataSize; - while (tmpRxSize != 0U) - { - if (tmpRxSize > 256U) - { - cmd[cmdCount++] = (uint16_t)kRxDataCmd | (uint16_t)LPI2C_MTDR_DATA(0xFFU); - tmpRxSize -= 256U; - } - else - { - cmd[cmdCount++] = (uint16_t)kRxDataCmd | (uint16_t)LPI2C_MTDR_DATA(tmpRxSize - 1U); - tmpRxSize = 0U; - } - } - } - } - - return cmdCount; -} - -/*! - * brief Performs a non-blocking DMA-based transaction on the I2C bus. - * - * The callback specified when the a handle was created is invoked when the transaction has - * completed. - * - * param base The LPI2C peripheral base address. - * param handle Pointer to the LPI2C master driver handle. - * param transfer The pointer to the transfer descriptor. - * retval #kStatus_Success The transaction was started successfully. - * retval #kStatus_LPI2C_Busy Either another master is currently utilizing the bus, or another DMA - * transaction is already in progress. - */ -status_t LPI2C_MasterTransferEDMA(LPI2C_Type *base, - lpi2c_master_edma_handle_t *handle, - lpi2c_master_transfer_t *transfer) -{ - status_t result; - - assert(handle != NULL); - assert(transfer != NULL); - assert(transfer->subaddressSize <= sizeof(transfer->subaddress)); - - /* Check transfer data size in read operation. */ - /* A single write to MTDR can issue read operation of 0xFFU + 1 byte of data at most, so when the dataSize is larger - than 0x100U, push multiple read commands to MTDR until dataSize is reached. LPI2C edma transfer uses linked - descriptor to transfer command and data, the command buffer is stored in handle. Allocate 4 command words to - carry read command which can cover nearly all use cases. */ - if ((transfer->direction == kLPI2C_Read) && (transfer->dataSize > (256U * 4U))) - { - return kStatus_InvalidArgument; - } - - /* Return busy if another transaction is in progress. */ - if (handle->isBusy) - { - return kStatus_LPI2C_Busy; - } - - /* Enable the master function and disable the slave function. */ - LPI2C_MasterEnable(base, true); - LPI2C_SlaveEnable(base, false); - - /* Return an error if the bus is already in use not by us. */ - result = LPI2C_CheckForBusyBus(base); - /* - * $Branch Coverage Justification$ - * $ref fsl_lpi2c_edma_c_ref_1$ - */ - if (result != kStatus_Success) - { - return result; - } - - /* We're now busy. */ - handle->isBusy = true; - - /* Disable LPI2C IRQ and DMA sources while we configure stuff. */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - LPI2C_MasterEnableDMA(base, false, false); - - /* Clear all flags. */ - LPI2C_MasterClearStatusFlags(base, (uint32_t)kLPI2C_MasterClearFlags); - - /* Save transfer into handle. */ - handle->transfer = *transfer; - - /* Generate commands to send. */ - uint32_t commandCount = LPI2C_GenerateCommands(handle); - - /* If the user is transmitting no data with no start or stop, then just go ahead and invoke the callback. */ - if ((0U == commandCount) && (transfer->dataSize == 0U)) - { - if (handle->completionCallback != NULL) - { - handle->completionCallback(base, handle, kStatus_Success, handle->userData); - } - return kStatus_Success; - } - - /* Reset DMA channels. */ - EDMA_ResetChannel(handle->rx->base, handle->rx->channel); - if (FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base) != 0) - { - EDMA_ResetChannel(handle->tx->base, handle->tx->channel); - } - - /* Get a 32-byte aligned TCD pointer. */ - edma_tcd_t *tcd = (edma_tcd_t *)((uint32_t)(&handle->tcds[1]) & (~ALIGN_TCD_SIZE_MASK)); - - bool hasSendData = (transfer->direction == kLPI2C_Write) && (transfer->dataSize != 0U); - bool hasReceiveData = (transfer->direction == kLPI2C_Read) && (transfer->dataSize != 0U); - - edma_transfer_config_t transferConfig = {0}; - edma_tcd_t *linkTcd = NULL; - - /* Set up data transmit. */ - if (hasSendData) - { - uint32_t *srcAddr = (uint32_t *)transfer->data; - transferConfig.srcAddr = (uint32_t)srcAddr; - transferConfig.destAddr = (uint32_t)LPI2C_MasterGetTxFifoAddress(base); - transferConfig.srcTransferSize = kEDMA_TransferSize1Bytes; - transferConfig.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfig.srcOffset = (int16_t)sizeof(uint8_t); - transferConfig.destOffset = 0; - transferConfig.minorLoopBytes = sizeof(uint8_t); /* TODO optimize to fill fifo */ - transferConfig.majorLoopCounts = transfer->dataSize; - - /* Store the initially configured eDMA minor byte transfer count into the LPI2C handle */ - handle->nbytes = (uint8_t)transferConfig.minorLoopBytes; - - if (commandCount != 0U) - { -#if defined FSL_EDMA_DRIVER_EDMA4 && FSL_EDMA_DRIVER_EDMA4 - /* Create a software TCD, which will be chained after the commands. */ - EDMA_TcdResetExt(handle->tx->base, tcd); - EDMA_TcdSetTransferConfigExt(handle->tx->base, tcd, &transferConfig, NULL); - EDMA_TcdEnableInterruptsExt(handle->tx->base, tcd, (uint32_t)kEDMA_MajorInterruptEnable); -#else - /* Create a software TCD, which will be chained after the commands. */ - EDMA_TcdReset(tcd); - EDMA_TcdSetTransferConfig(tcd, &transferConfig, NULL); - EDMA_TcdEnableInterrupts(tcd, (uint32_t)kEDMA_MajorInterruptEnable); -#endif - linkTcd = tcd; - } - else - { - /* User is only transmitting data with no required commands, so this transfer can stand alone. */ - EDMA_SetTransferConfig(handle->tx->base, handle->tx->channel, &transferConfig, NULL); - EDMA_EnableChannelInterrupts(handle->tx->base, handle->tx->channel, (uint32_t)kEDMA_MajorInterruptEnable); - } - } - else if (hasReceiveData) - { - uint32_t *srcAddr = (uint32_t *)transfer->data; - /* Set up data receive. */ - transferConfig.srcAddr = (uint32_t)LPI2C_MasterGetRxFifoAddress(base); - transferConfig.destAddr = (uint32_t)srcAddr; - transferConfig.srcTransferSize = kEDMA_TransferSize1Bytes; - transferConfig.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfig.srcOffset = 0; - transferConfig.destOffset = (int16_t)sizeof(uint8_t); - transferConfig.minorLoopBytes = sizeof(uint8_t); /* TODO optimize to empty fifo */ - transferConfig.majorLoopCounts = transfer->dataSize; - - /* Store the initially configured eDMA minor byte transfer count into the LPI2C handle */ - handle->nbytes = (uint8_t)transferConfig.minorLoopBytes; - - if ((FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base) != 0) || (0U == commandCount)) - { - /* We can put this receive transfer on its own DMA channel. */ - EDMA_SetTransferConfig(handle->rx->base, handle->rx->channel, &transferConfig, NULL); - EDMA_EnableChannelInterrupts(handle->rx->base, handle->rx->channel, (uint32_t)kEDMA_MajorInterruptEnable); - } - else - { - /* For shared rx/tx DMA requests, when there are commands, create a software TCD of - enabling rx dma and disabling tx dma, which will be chained onto the commands transfer, - and create another software TCD of transfering data and chain it onto the last TCD. - Notice that in this situation assume tx/rx uses same channel */ -#if defined FSL_EDMA_DRIVER_EDMA4 && FSL_EDMA_DRIVER_EDMA4 - EDMA_TcdResetExt(handle->rx->base, tcd); - EDMA_TcdSetTransferConfigExt(handle->rx->base, tcd, &transferConfig, NULL); - EDMA_TcdEnableInterruptsExt(handle->rx->base, tcd, (uint32_t)kEDMA_MajorInterruptEnable); -#else - EDMA_TcdReset(tcd); - EDMA_TcdSetTransferConfig(tcd, &transferConfig, NULL); - EDMA_TcdEnableInterrupts(tcd, (uint32_t)kEDMA_MajorInterruptEnable); -#endif - - transferConfig.srcAddr = (uint32_t)&lpi2c_edma_RecSetting; - transferConfig.destAddr = (uint32_t) & (base->MDER); - transferConfig.srcTransferSize = kEDMA_TransferSize1Bytes; - transferConfig.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfig.srcOffset = 0; - transferConfig.destOffset = (int16_t)sizeof(uint8_t); - transferConfig.minorLoopBytes = sizeof(uint8_t); - transferConfig.majorLoopCounts = 1; - - edma_tcd_t *tcdSetRxClearTxDMA = (edma_tcd_t *)((uint32_t)(&handle->tcds[2]) & (~ALIGN_TCD_SIZE_MASK)); -#if defined FSL_EDMA_DRIVER_EDMA4 && FSL_EDMA_DRIVER_EDMA4 - EDMA_TcdResetExt(handle->rx->base, tcdSetRxClearTxDMA); - EDMA_TcdSetTransferConfigExt(handle->rx->base, tcdSetRxClearTxDMA, &transferConfig, tcd); -#else - EDMA_TcdReset(tcdSetRxClearTxDMA); - EDMA_TcdSetTransferConfig(tcdSetRxClearTxDMA, &transferConfig, tcd); -#endif - linkTcd = tcdSetRxClearTxDMA; - } - } - else - { - /* No data to send */ - } - - /* Set up commands transfer. */ - if (commandCount != 0U) - { - transferConfig.srcAddr = (uint32_t)handle->commandBuffer; - transferConfig.destAddr = (uint32_t)LPI2C_MasterGetTxFifoAddress(base); - transferConfig.srcTransferSize = kEDMA_TransferSize2Bytes; - transferConfig.destTransferSize = kEDMA_TransferSize2Bytes; - transferConfig.srcOffset = (int16_t)sizeof(uint16_t); - transferConfig.destOffset = 0; - transferConfig.minorLoopBytes = sizeof(uint16_t); /* TODO optimize to fill fifo */ - transferConfig.majorLoopCounts = commandCount; - - EDMA_SetTransferConfig(handle->tx->base, handle->tx->channel, &transferConfig, linkTcd); - } - - /* Start DMA transfer. */ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpi2c_edma_c_ref_2$ - */ - if (hasReceiveData || (0 == FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base))) - { - EDMA_StartTransfer(handle->rx); - } - /* - * $Branch Coverage Justification$ - * $ref fsl_lpi2c_edma_c_ref_2$ - */ - if ((hasSendData || (commandCount != 0U)) && (FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base) != 0)) - { - EDMA_StartTransfer(handle->tx); - } - - /* Enable DMA in both directions. This actually kicks of the transfer. */ - LPI2C_MasterEnableDMA(base, true, true); - - /* Enable all LPI2C master interrupts */ - LPI2C_MasterEnableInterrupts(base, - (uint32_t)kLPI2C_MasterArbitrationLostFlag | (uint32_t)kLPI2C_MasterNackDetectFlag | - (uint32_t)kLPI2C_MasterPinLowTimeoutFlag | (uint32_t)kLPI2C_MasterFifoErrFlag); - - return result; -} - -/*! - * brief Returns number of bytes transferred so far. - * - * param base The LPI2C peripheral base address. - * param handle Pointer to the LPI2C master driver handle. - * param[out] count Number of bytes transferred so far by the non-blocking transaction. - * retval #kStatus_Success - * retval #kStatus_NoTransferInProgress There is not a DMA transaction currently in progress. - */ -status_t LPI2C_MasterTransferGetCountEDMA(LPI2C_Type *base, lpi2c_master_edma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (!handle->isBusy) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - uint32_t remaining = handle->transfer.dataSize; - - /* If the DMA is still on a commands transfer that chains to the actual data transfer, */ - /* we do nothing and return the number of transferred bytes as zero. */ - if (EDMA_GetNextTCDAddress(handle->tx) == 0U) - { - if (handle->transfer.direction == kLPI2C_Write) - { - remaining = - (uint32_t)handle->nbytes * EDMA_GetRemainingMajorLoopCount(handle->tx->base, handle->tx->channel); - } - else - { - remaining = - (uint32_t)handle->nbytes * EDMA_GetRemainingMajorLoopCount(handle->rx->base, handle->rx->channel); - } - } - - *count = handle->transfer.dataSize - remaining; - - return kStatus_Success; -} - -/*! - * brief Terminates a non-blocking LPI2C master transmission early. - * - * note It is not safe to call this function from an IRQ handler that has a higher priority than the - * eDMA peripheral's IRQ priority. - * - * param base The LPI2C peripheral base address. - * param handle Pointer to the LPI2C master driver handle. - * retval #kStatus_Success A transaction was successfully aborted. - * retval #kStatus_LPI2C_Idle There is not a DMA transaction currently in progress. - */ -status_t LPI2C_MasterTransferAbortEDMA(LPI2C_Type *base, lpi2c_master_edma_handle_t *handle) -{ - /* Catch when there is not an active transfer. */ - if (!handle->isBusy) - { - return kStatus_LPI2C_Idle; - } - - /* Terminate DMA transfers. */ - EDMA_AbortTransfer(handle->rx); - if (FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base) != 0) - { - EDMA_AbortTransfer(handle->tx); - } - - /* Reset fifos. */ - base->MCR |= LPI2C_MCR_RRF_MASK | LPI2C_MCR_RTF_MASK; - - /* Disable LPI2C interrupts. */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - - /* If master is still busy and has not send out stop signal yet. */ - if ((LPI2C_MasterGetStatusFlags(base) & - ((uint32_t)kLPI2C_MasterStopDetectFlag | (uint32_t)kLPI2C_MasterBusyFlag)) == (uint32_t)kLPI2C_MasterBusyFlag) - { - /* Send a stop command to finalize the transfer. */ - base->MTDR = (uint32_t)kStopCmd; - } - - /* Reset handle. */ - handle->isBusy = false; - - return kStatus_Success; -} - -static void LPI2C_MasterEDMACallback(edma_handle_t *dmaHandle, void *userData, bool isTransferDone, uint32_t tcds) -{ - lpi2c_master_edma_handle_t *handle = (lpi2c_master_edma_handle_t *)userData; - - if (NULL == handle) - { - return; - } - - /* Check for errors. */ - status_t result = LPI2C_MasterCheckAndClearError(handle->base, LPI2C_MasterGetStatusFlags(handle->base)); - - /* Done with this transaction. */ - handle->isBusy = false; - - if (0U == (handle->transfer.flags & (uint32_t)kLPI2C_TransferNoStopFlag)) - { - /* Send a stop command to finalize the transfer. */ - handle->base->MTDR = (uint32_t)kStopCmd; - } - - /* Invoke callback. */ - if (handle->completionCallback != NULL) - { - handle->completionCallback(handle->base, handle, result, handle->userData); - } -} - -static void LPI2C_MasterTransferEdmaHandleIRQ(LPI2C_Type *base, void *lpi2cMasterEdmaHandle) -{ - assert(lpi2cMasterEdmaHandle != NULL); - - lpi2c_master_edma_handle_t *handle = (lpi2c_master_edma_handle_t *)lpi2cMasterEdmaHandle; - uint32_t status = LPI2C_MasterGetStatusFlags(base); - status_t result = kStatus_Success; - - /* Terminate DMA transfers. */ - EDMA_AbortTransfer(handle->rx); - if (FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base) != 0) - { - EDMA_AbortTransfer(handle->tx); - } - - /* Done with this transaction. */ - handle->isBusy = false; - - /* Disable LPI2C interrupts. */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - - /* Check error status */ - if (0U != (status & (uint32_t)kLPI2C_MasterPinLowTimeoutFlag)) - { - result = kStatus_LPI2C_PinLowTimeout; - } - /* - * $Branch Coverage Justification$ - * $ref fsl_lpi2c_edma_c_ref_1$ - */ - else if (0U != (status & (uint32_t)kLPI2C_MasterArbitrationLostFlag)) - { - result = kStatus_LPI2C_ArbitrationLost; - } - else if (0U != (status & (uint32_t)kLPI2C_MasterNackDetectFlag)) - { - result = kStatus_LPI2C_Nak; - } - else if (0U != (status & (uint32_t)kLPI2C_MasterFifoErrFlag)) - { - result = kStatus_LPI2C_FifoError; - } - else - { - ; /* Intentional empty */ - } - - /* Clear error status. */ - (void)LPI2C_MasterCheckAndClearError(base, status); - - /* Send stop flag if needed */ - if (0U == (handle->transfer.flags & (uint32_t)kLPI2C_TransferNoStopFlag)) - { - status = LPI2C_MasterGetStatusFlags(base); - /* If bus is still busy and the master has not generate stop flag */ - if ((status & ((uint32_t)kLPI2C_MasterBusBusyFlag | (uint32_t)kLPI2C_MasterStopDetectFlag)) == - (uint32_t)kLPI2C_MasterBusBusyFlag) - { - /* Send a stop command to finalize the transfer. */ - handle->base->MTDR = (uint32_t)kStopCmd; - } - } - - /* Invoke callback. */ - if (handle->completionCallback != NULL) - { - handle->completionCallback(base, handle, result, handle->userData); - } -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpi2c_edma.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpi2c_edma.h deleted file mode 100644 index 66da36b866d..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpi2c_edma.h +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LPI2C_EDMA_H_ -#define FSL_LPI2C_EDMA_H_ - -#include "fsl_lpi2c.h" -#include "fsl_edma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @name Driver version - * @{ - */ -/*! @brief LPI2C EDMA driver version. */ -#define FSL_LPI2C_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 4, 2)) -/*! @} */ - -/*! - * @addtogroup lpi2c_master_edma_driver - * @{ - */ - -/* Forward declaration of the transfer descriptor and handle typedefs. */ -/*! @brief LPI2C master EDMA handle of the transfer. */ -typedef struct _lpi2c_master_edma_handle lpi2c_master_edma_handle_t; - -/*! - * @brief Master DMA completion callback function pointer type. - * - * This callback is used only for the non-blocking master transfer API. Specify the callback you wish to use - * in the call to LPI2C_MasterCreateEDMAHandle(). - * - * @param base The LPI2C peripheral base address. - * @param handle Handle associated with the completed transfer. - * @param completionStatus Either kStatus_Success or an error code describing how the transfer completed. - * @param userData Arbitrary pointer-sized value passed from the application. - */ -typedef void (*lpi2c_master_edma_transfer_callback_t)(LPI2C_Type *base, - lpi2c_master_edma_handle_t *handle, - status_t completionStatus, - void *userData); - -/*! - * @brief Driver handle for master DMA APIs. - * @note The contents of this structure are private and subject to change. - */ -struct _lpi2c_master_edma_handle -{ - LPI2C_Type *base; /*!< LPI2C base pointer. */ - bool isBusy; /*!< Transfer state machine current state. */ - uint8_t nbytes; /*!< eDMA minor byte transfer count initially configured. */ - uint16_t commandBuffer[10]; /*!< LPI2C command sequence. When all 10 command words are used: - Start&addr&write[1 word] + subaddr[4 words] + restart&addr&read[1 word] + receive&Size[4 words] */ - lpi2c_master_transfer_t transfer; /*!< Copy of the current transfer info. */ - lpi2c_master_edma_transfer_callback_t completionCallback; /*!< Callback function pointer. */ - void *userData; /*!< Application data passed to callback. */ - edma_handle_t *rx; /*!< Handle for receive DMA channel. */ - edma_handle_t *tx; /*!< Handle for transmit DMA channel. */ - edma_tcd_t tcds[3]; /*!< Software TCD. Three are allocated to provide enough room to align to 32-bytes. */ -}; - -/*! @} */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @addtogroup lpi2c_master_edma_driver - * @{ - */ - -/*! - * @name Master DMA - * @{ - */ - -/*! - * @brief Create a new handle for the LPI2C master DMA APIs. - * - * The creation of a handle is for use with the DMA APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the LPI2C_MasterTransferAbortEDMA() API shall be called. - * - * For devices where the LPI2C send and receive DMA requests are OR'd together, the @a txDmaHandle - * parameter is ignored and may be set to NULL. - * - * @param base The LPI2C peripheral base address. - * @param[out] handle Pointer to the LPI2C master driver handle. - * @param rxDmaHandle Handle for the eDMA receive channel. Created by the user prior to calling this function. - * @param txDmaHandle Handle for the eDMA transmit channel. Created by the user prior to calling this function. - * @param callback User provided pointer to the asynchronous callback function. - * @param userData User provided pointer to the application callback data. - */ -void LPI2C_MasterCreateEDMAHandle(LPI2C_Type *base, - lpi2c_master_edma_handle_t *handle, - edma_handle_t *rxDmaHandle, - edma_handle_t *txDmaHandle, - lpi2c_master_edma_transfer_callback_t callback, - void *userData); - -/*! - * @brief Performs a non-blocking DMA-based transaction on the I2C bus. - * - * The callback specified when the @a handle was created is invoked when the transaction has - * completed. - * - * @param base The LPI2C peripheral base address. - * @param handle Pointer to the LPI2C master driver handle. - * @param transfer The pointer to the transfer descriptor. - * @retval kStatus_Success The transaction was started successfully. - * @retval #kStatus_LPI2C_Busy Either another master is currently utilizing the bus, or another DMA - * transaction is already in progress. - */ -status_t LPI2C_MasterTransferEDMA(LPI2C_Type *base, - lpi2c_master_edma_handle_t *handle, - lpi2c_master_transfer_t *transfer); - -/*! - * @brief Returns number of bytes transferred so far. - * - * @param base The LPI2C peripheral base address. - * @param handle Pointer to the LPI2C master driver handle. - * @param[out] count Number of bytes transferred so far by the non-blocking transaction. - * @retval kStatus_Success - * @retval kStatus_NoTransferInProgress There is not a DMA transaction currently in progress. - */ -status_t LPI2C_MasterTransferGetCountEDMA(LPI2C_Type *base, lpi2c_master_edma_handle_t *handle, size_t *count); - -/*! - * @brief Terminates a non-blocking LPI2C master transmission early. - * - * @note It is not safe to call this function from an IRQ handler that has a higher priority than the - * eDMA peripheral's IRQ priority. - * - * @param base The LPI2C peripheral base address. - * @param handle Pointer to the LPI2C master driver handle. - * @retval kStatus_Success A transaction was successfully aborted. - * @retval #kStatus_LPI2C_Idle There is not a DMA transaction currently in progress. - */ -status_t LPI2C_MasterTransferAbortEDMA(LPI2C_Type *base, lpi2c_master_edma_handle_t *handle); - -/*! @} */ - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -#endif /* FSL_LPI2C_EDMA_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpspi.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpspi.c deleted file mode 100644 index edf955ea255..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpspi.c +++ /dev/null @@ -1,2604 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022, 2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpspi.h" -/* - * $Coverage Justification Reference$ - * - * $Justification fsl_lpspi_c_ref_1$ - * The default branch cannot be executed in any circumstances, it is only added to avoid MISRA violation. - * - * $Justification fsl_lpspi_c_ref_2$ - * The FIFO was emptied before the check and there was no writing after the FIFO was emptied, so the obtained FIFO count - * is 0, and the #kStatus_LPSPI_Timeout cannot be obtained.(will improve) - * - * $Justification fsl_lpspi_c_ref_3$ - * The fifosize is determined by the hardware. - * - * $Justification fsl_lpspi_c_ref_4$ - * If an interrupt is generated by this error, the corresponding interrupt bit must be set.(will improve) - * - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpspi" -#endif - -#if defined(LPSPI_RSTS) -#define LPSPI_RESETS_ARRAY LPSPI_RSTS -#endif - -/*! - * @brief Default watermark values. - * - * The default watermarks are set to zero. - */ -enum _lpspi_default_watermarks -{ - kLpspiDefaultTxWatermark = 0, - kLpspiDefaultRxWatermark = 0, -}; - -/* - * CR |= LPSPI_CR_RRF_MASK | LPSPI_CR_RTF_MASK; - base->IER = 0U; - base->CR = 0U; - - /* Disable LPSPI first */ - LPSPI_Enable(base, false); - - /* Set LPSPI to master */ - LPSPI_SetMasterSlaveMode(base, kLPSPI_Master); - - /* Set specific PCS to active high or low */ - LPSPI_SetOnePcsPolarity(base, masterConfig->whichPcs, masterConfig->pcsActiveHighOrLow); - - /* Set Configuration Register 1 related setting.*/ - base->CFGR1 = (base->CFGR1 & ~(LPSPI_CFGR1_OUTCFG_MASK | LPSPI_CFGR1_PINCFG_MASK | LPSPI_CFGR1_NOSTALL_MASK | - LPSPI_CFGR1_SAMPLE_MASK)) | - LPSPI_CFGR1_OUTCFG(masterConfig->dataOutConfig) | LPSPI_CFGR1_PINCFG(masterConfig->pinCfg) | -#if !(defined(FSL_FEATURE_LPSPI_HAS_NO_PCSCFG) && FSL_FEATURE_LPSPI_HAS_NO_PCSCFG) - LPSPI_CFGR1_PCSCFG(masterConfig->pcsFunc) | -#endif - LPSPI_CFGR1_NOSTALL(0) | LPSPI_CFGR1_SAMPLE((uint32_t)masterConfig->enableInputDelay); - - if ((masterConfig->pinCfg == kLPSPI_SdiInSdiOut) || (masterConfig->pinCfg == kLPSPI_SdoInSdoOut)) - { - base->CFGR1 |= LPSPI_CFGR1_OUTCFG_MASK; - } - /* Set baudrate and delay times*/ - (void)LPSPI_MasterSetBaudRate(base, masterConfig->baudRate, srcClock_Hz, &tcrPrescaleValue); - - /* Set default watermarks */ - LPSPI_SetFifoWatermarks(base, (uint32_t)kLpspiDefaultTxWatermark, (uint32_t)kLpspiDefaultRxWatermark); - - /* Set Transmit Command Register*/ - base->TCR = LPSPI_TCR_CPOL(masterConfig->cpol) | LPSPI_TCR_CPHA(masterConfig->cpha) | - LPSPI_TCR_LSBF(masterConfig->direction) | LPSPI_TCR_FRAMESZ(masterConfig->bitsPerFrame - 1U) | - LPSPI_TCR_PRESCALE(tcrPrescaleValue) | LPSPI_TCR_PCS(masterConfig->whichPcs); - - LPSPI_Enable(base, true); - - (void)LPSPI_MasterSetDelayTimes(base, masterConfig->pcsToSckDelayInNanoSec, kLPSPI_PcsToSck, srcClock_Hz); - (void)LPSPI_MasterSetDelayTimes(base, masterConfig->lastSckToPcsDelayInNanoSec, kLPSPI_LastSckToPcs, srcClock_Hz); - (void)LPSPI_MasterSetDelayTimes(base, masterConfig->betweenTransferDelayInNanoSec, kLPSPI_BetweenTransfer, - srcClock_Hz); - - LPSPI_SetDummyData(base, LPSPI_DUMMY_DATA); -} - -/*! - * brief Sets the lpspi_master_config_t structure to default values. - * - * This API initializes the configuration structure for LPSPI_MasterInit(). - * The initialized structure can remain unchanged in LPSPI_MasterInit(), or can be modified - * before calling the LPSPI_MasterInit(). - * Example: - * code - * lpspi_master_config_t masterConfig; - * LPSPI_MasterGetDefaultConfig(&masterConfig); - * endcode - * param masterConfig pointer to lpspi_master_config_t structure - */ -void LPSPI_MasterGetDefaultConfig(lpspi_master_config_t *masterConfig) -{ - assert(masterConfig != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(masterConfig, 0, sizeof(*masterConfig)); - - masterConfig->baudRate = 500000; - masterConfig->bitsPerFrame = 8; - masterConfig->cpol = kLPSPI_ClockPolarityActiveHigh; - masterConfig->cpha = kLPSPI_ClockPhaseFirstEdge; - masterConfig->direction = kLPSPI_MsbFirst; -#if !(defined(FSL_FEATURE_LPSPI_HAS_NO_PCSCFG) && FSL_FEATURE_LPSPI_HAS_NO_PCSCFG) - masterConfig->pcsFunc = kLPSPI_PcsAsCs; -#endif - - masterConfig->pcsToSckDelayInNanoSec = (1000000000U / masterConfig->baudRate) / 2U; - masterConfig->lastSckToPcsDelayInNanoSec = (1000000000U / masterConfig->baudRate) / 2U; - masterConfig->betweenTransferDelayInNanoSec = (1000000000U / masterConfig->baudRate) / 2U; - - masterConfig->whichPcs = kLPSPI_Pcs0; - masterConfig->pcsActiveHighOrLow = kLPSPI_PcsActiveLow; - - masterConfig->pinCfg = kLPSPI_SdiInSdoOut; - masterConfig->dataOutConfig = kLpspiDataOutRetained; - - masterConfig->enableInputDelay = false; -} - -/*! - * brief LPSPI slave configuration. - * - * param base LPSPI peripheral address. - * param slaveConfig Pointer to a structure lpspi_slave_config_t. - */ -void LPSPI_SlaveInit(LPSPI_Type *base, const lpspi_slave_config_t *slaveConfig) -{ - assert(slaveConfig != NULL); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - - uint32_t instance = LPSPI_GetInstance(base); - /* Enable LPSPI clock */ - (void)CLOCK_EnableClock(s_lpspiClocks[instance]); - -#if defined(LPSPI_PERIPH_CLOCKS) - (void)CLOCK_EnableClock(s_LpspiPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(LPSPI_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_lpspiResets[LPSPI_GetInstance(base)]); -#endif - - LPSPI_SetMasterSlaveMode(base, kLPSPI_Slave); - - LPSPI_SetOnePcsPolarity(base, slaveConfig->whichPcs, slaveConfig->pcsActiveHighOrLow); - - base->CFGR1 = (base->CFGR1 & ~(LPSPI_CFGR1_OUTCFG_MASK | LPSPI_CFGR1_PINCFG_MASK)) | - LPSPI_CFGR1_OUTCFG(slaveConfig->dataOutConfig) | LPSPI_CFGR1_PINCFG(slaveConfig->pinCfg); - - if ((slaveConfig->pinCfg == kLPSPI_SdiInSdiOut) || (slaveConfig->pinCfg == kLPSPI_SdoInSdoOut)) - { - base->CFGR1 |= LPSPI_CFGR1_OUTCFG_MASK; - } - - LPSPI_SetFifoWatermarks(base, (uint32_t)kLpspiDefaultTxWatermark, (uint32_t)kLpspiDefaultRxWatermark); - - base->TCR = LPSPI_TCR_CPOL(slaveConfig->cpol) | LPSPI_TCR_CPHA(slaveConfig->cpha) | - LPSPI_TCR_LSBF(slaveConfig->direction) | LPSPI_TCR_FRAMESZ(slaveConfig->bitsPerFrame - 1U); - - /* This operation will set the dummy data for edma transfer, no effect in interrupt way. */ - LPSPI_SetDummyData(base, LPSPI_DUMMY_DATA); - - LPSPI_Enable(base, true); -} - -/*! - * brief Sets the lpspi_slave_config_t structure to default values. - * - * This API initializes the configuration structure for LPSPI_SlaveInit(). - * The initialized structure can remain unchanged in LPSPI_SlaveInit() or can be modified - * before calling the LPSPI_SlaveInit(). - * Example: - * code - * lpspi_slave_config_t slaveConfig; - * LPSPI_SlaveGetDefaultConfig(&slaveConfig); - * endcode - * param slaveConfig pointer to lpspi_slave_config_t structure. - */ -void LPSPI_SlaveGetDefaultConfig(lpspi_slave_config_t *slaveConfig) -{ - assert(slaveConfig != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(slaveConfig, 0, sizeof(*slaveConfig)); - - slaveConfig->bitsPerFrame = 8; /*!< Bits per frame, minimum 8, maximum 4096.*/ - slaveConfig->cpol = kLPSPI_ClockPolarityActiveHigh; /*!< Clock polarity. */ - slaveConfig->cpha = kLPSPI_ClockPhaseFirstEdge; /*!< Clock phase. */ - slaveConfig->direction = kLPSPI_MsbFirst; /*!< MSB or LSB data shift direction. */ - - slaveConfig->whichPcs = kLPSPI_Pcs0; /*!< Desired Peripheral Chip Select (pcs) */ - slaveConfig->pcsActiveHighOrLow = kLPSPI_PcsActiveLow; /*!< Desired PCS active high or low */ - - slaveConfig->pinCfg = kLPSPI_SdiInSdoOut; - slaveConfig->dataOutConfig = kLpspiDataOutRetained; -} - -/*! - * brief Restores the LPSPI peripheral to reset state. Note that this function - * sets all registers to reset state. As a result, the LPSPI module can't work after calling - * this API. - * param base LPSPI peripheral address. - */ -void LPSPI_Reset(LPSPI_Type *base) -{ - /* Reset all internal logic and registers, except the Control Register. Remains set until cleared by software.*/ - base->CR |= LPSPI_CR_RST_MASK; - - /* Software reset doesn't reset the CR, so manual reset the FIFOs */ - base->CR |= LPSPI_CR_RRF_MASK | LPSPI_CR_RTF_MASK; - - /* Master logic is not reset and module is disabled.*/ - base->CR = 0x00U; -} - -/*! - * brief De-initializes the LPSPI peripheral. Call this API to disable the LPSPI clock. - * param base LPSPI peripheral address. - */ -void LPSPI_Deinit(LPSPI_Type *base) -{ - /* Reset to default value */ - LPSPI_Reset(base); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - - uint32_t instance = LPSPI_GetInstance(base); - /* Enable LPSPI clock */ - (void)CLOCK_DisableClock(s_lpspiClocks[instance]); - -#if defined(LPSPI_PERIPH_CLOCKS) - (void)CLOCK_DisableClock(s_LpspiPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -static void LPSPI_SetOnePcsPolarity(LPSPI_Type *base, - lpspi_which_pcs_t pcs, - lpspi_pcs_polarity_config_t activeLowOrHigh) -{ - uint32_t cfgr1Value = 0; - /* Clear the PCS polarity bit */ - cfgr1Value = base->CFGR1 & ~(1UL << (LPSPI_CFGR1_PCSPOL_SHIFT + (uint32_t)pcs)); - - /* Configure the PCS polarity bit according to the activeLowOrHigh setting */ - base->CFGR1 = cfgr1Value | ((uint32_t)activeLowOrHigh << (LPSPI_CFGR1_PCSPOL_SHIFT + (uint32_t)pcs)); -} - -/*! - * brief Sets the LPSPI baud rate in bits per second. - * - * This function takes in the desired bitsPerSec (baud rate) and calculates the nearest - * possible baud rate without exceeding the desired baud rate and returns the - * calculated baud rate in bits-per-second. It requires the caller to provide - * the frequency of the module source clock (in Hertz). Note that the baud rate - * does not go into effect until the Transmit Control Register (TCR) is programmed - * with the prescale value. Hence, this function returns the prescale tcrPrescaleValue - * parameter for later programming in the TCR. The higher level - * peripheral driver should alert the user of an out of range baud rate input. - * - * Note that the LPSPI module must first be disabled before configuring this. - * Note that the LPSPI module must be configured for master mode before configuring this. - * - * param base LPSPI peripheral address. - * param baudRate_Bps The desired baud rate in bits per second. - * param srcClock_Hz Module source input clock in Hertz. - * param tcrPrescaleValue The TCR prescale value needed to program the TCR. - * return The actual calculated baud rate. This function may also return a "0" if the - * LPSPI is not configured for master mode or if the LPSPI module is not disabled. - */ - -uint32_t LPSPI_MasterSetBaudRate(LPSPI_Type *base, - uint32_t baudRate_Bps, - uint32_t srcClock_Hz, - uint32_t *tcrPrescaleValue) -{ - assert(tcrPrescaleValue != NULL); - - /* For master mode configuration only, if slave mode detected, return 0. - * Also, the LPSPI module needs to be disabled first, if enabled, return 0 - */ - if ((!LPSPI_IsMaster(base)) || ((base->CR & LPSPI_CR_MEN_MASK) != 0U)) - { - return 0U; - } - - uint32_t prescaler, bestPrescaler; - uint32_t scaler, bestScaler; - uint32_t realBaudrate, bestBaudrate; - uint32_t diff, min_diff; - uint32_t desiredBaudrate = baudRate_Bps; - - /* find combination of prescaler and scaler resulting in baudrate closest to the - * requested value - */ - min_diff = 0xFFFFFFFFU; - - /* Set to maximum divisor value bit settings so that if baud rate passed in is less - * than the minimum possible baud rate, then the SPI will be configured to the lowest - * possible baud rate - */ - bestPrescaler = 7; - bestScaler = 255; - - bestBaudrate = 0; /* required to avoid compilation warning */ - - /* In all for loops, if min_diff = 0, the exit for loop*/ - for (prescaler = 0U; prescaler < 8U; prescaler++) - { - if (min_diff == 0U) - { - break; - } - for (scaler = 0U; scaler < 256U; scaler++) - { - if (min_diff == 0U) - { - break; - } - realBaudrate = (srcClock_Hz / (s_baudratePrescaler[prescaler] * (scaler + 2U))); - - /* calculate the baud rate difference based on the conditional statement - * that states that the calculated baud rate must not exceed the desired baud rate - */ - if (desiredBaudrate >= realBaudrate) - { - diff = desiredBaudrate - realBaudrate; - if (min_diff > diff) - { - /* a better match found */ - min_diff = diff; - bestPrescaler = prescaler; - bestScaler = scaler; - bestBaudrate = realBaudrate; - } - } - } - } - - /* Write the best baud rate scalar to the CCR. - * Note, no need to check for error since we've already checked to make sure the module is - * disabled and in master mode. Also, there is a limit on the maximum divider so we will not - * exceed this. - */ -#if defined(FSL_FEATURE_LPSPI_HAS_CCR1) && FSL_FEATURE_LPSPI_HAS_CCR1 - /* When CCR1 is present, the CCR[DBT] and CCR[SCKDIV] is write only, all read will return 0 - The real DBT and SCKDIV can be obtained in CCR1, CCR[DBT]=CCR1[SCKSCK] and CCR[SCKDIV]=CCR1[SCKHLD]+CCR1[SCKSET] - So when changing either CCR[DBT] or CCR[SCKDIV] make sure the other value is not overwritten by 0 */ - base->CCR = base->CCR | LPSPI_CCR_DBT((base->CCR1 & LPSPI_CCR1_SCKSCK_MASK) >> LPSPI_CCR1_SCKSCK_SHIFT) | - LPSPI_CCR_SCKDIV(bestScaler); -#else - base->CCR = (base->CCR & ~LPSPI_CCR_SCKDIV_MASK) | LPSPI_CCR_SCKDIV(bestScaler); -#endif /* FSL_FEATURE_LPSPI_HAS_CCR1 */ - - /* return the best prescaler value for user to use later */ - *tcrPrescaleValue = bestPrescaler; - - /* return the actual calculated baud rate */ - return bestBaudrate; -} - -/*! - * brief Manually configures a specific LPSPI delay parameter (module must be disabled to - * change the delay values). - * - * This function configures the following: - * SCK to PCS delay, or - * PCS to SCK delay, or - * The configurations must occur between the transfer delay. - * - * The delay names are available in type lpspi_delay_type_t. - * - * The user passes the desired delay along with the delay value. - * This allows the user to directly set the delay values if they have - * pre-calculated them or if they simply wish to manually increment the value. - * - * Note that the LPSPI module must first be disabled before configuring this. - * Note that the LPSPI module must be configured for master mode before configuring this. - * - * param base LPSPI peripheral address. - * param scaler The 8-bit delay value 0x00 to 0xFF (255). - * param whichDelay The desired delay to configure, must be of type lpspi_delay_type_t. - */ -void LPSPI_MasterSetDelayScaler(LPSPI_Type *base, uint32_t scaler, lpspi_delay_type_t whichDelay) -{ - /*These settings are only relevant in master mode */ -#if defined(FSL_FEATURE_LPSPI_HAS_CCR1) && FSL_FEATURE_LPSPI_HAS_CCR1 - /* When CCR1 is present, the CCR[DBT] and CCR[SCKDIV] is write only, all read will return 0 - The real DBT and SCKDIV can be obtained in CCR1, CCR[DBT]=CCR1[SCKSCK] and CCR[SCKDIV]=CCR1[SCKHLD]+CCR1[SCKSET] - So when changing either CCR[DBT] or CCR[SCKDIV] make sure the other value is not overwritten by 0 */ - uint32_t dbt = (base->CCR1 & LPSPI_CCR1_SCKSCK_MASK) >> LPSPI_CCR1_SCKSCK_SHIFT; - uint32_t sckdiv = (base->CCR1 & LPSPI_CCR1_SCKHLD_MASK) >> LPSPI_CCR1_SCKHLD_SHIFT; - sckdiv += (base->CCR1 & LPSPI_CCR1_SCKSET_MASK) >> LPSPI_CCR1_SCKSET_SHIFT; - switch (whichDelay) - { - case kLPSPI_PcsToSck: - base->CCR = (base->CCR & (~LPSPI_CCR_PCSSCK_MASK)) | LPSPI_CCR_PCSSCK(scaler) | LPSPI_CCR_DBT(dbt) | - LPSPI_CCR_SCKDIV(sckdiv); - - break; - case kLPSPI_LastSckToPcs: - base->CCR = (base->CCR & (~LPSPI_CCR_SCKPCS_MASK)) | LPSPI_CCR_SCKPCS(scaler) | LPSPI_CCR_DBT(dbt) | - LPSPI_CCR_SCKDIV(sckdiv); - - break; - case kLPSPI_BetweenTransfer: - base->CCR = base->CCR | LPSPI_CCR_DBT(scaler) | LPSPI_CCR_SCKDIV(sckdiv); -#else - switch (whichDelay) - { - case kLPSPI_PcsToSck: - base->CCR = (base->CCR & (~LPSPI_CCR_PCSSCK_MASK)) | LPSPI_CCR_PCSSCK(scaler); - - break; - case kLPSPI_LastSckToPcs: - base->CCR = (base->CCR & (~LPSPI_CCR_SCKPCS_MASK)) | LPSPI_CCR_SCKPCS(scaler); - - break; - case kLPSPI_BetweenTransfer: - base->CCR = (base->CCR & (~LPSPI_CCR_DBT_MASK)) | LPSPI_CCR_DBT(scaler); -#endif /* FSL_FEATURE_LPSPI_HAS_CCR1 */ - break; - default: - assert(false); - break; - } -} - -/*! - * brief Calculates the delay based on the desired delay input in nanoseconds (module must be - * disabled to change the delay values). - * - * This function calculates the values for the following: - * SCK to PCS delay, or - * PCS to SCK delay, or - * The configurations must occur between the transfer delay. - * - * The delay names are available in type lpspi_delay_type_t. - * - * The user passes the desired delay and the desired delay value in - * nano-seconds. The function calculates the value needed for the desired delay parameter - * and returns the actual calculated delay because an exact delay match may not be possible. In this - * case, the closest match is calculated without going below the desired delay value input. - * It is possible to input a very large delay value that exceeds the capability of the part, in - * which case the maximum supported delay is returned. It is up to the higher level - * peripheral driver to alert the user of an out of range delay input. - * - * Note that the LPSPI module must be configured for master mode before configuring this. And note that - * the delayTime = LPSPI_clockSource / (PRESCALE * Delay_scaler). - * - * param base LPSPI peripheral address. - * param delayTimeInNanoSec The desired delay value in nano-seconds. - * param whichDelay The desired delay to configuration, which must be of type lpspi_delay_type_t. - * param srcClock_Hz Module source input clock in Hertz. - * return actual Calculated delay value in nano-seconds. - */ -uint32_t LPSPI_MasterSetDelayTimes(LPSPI_Type *base, - uint32_t delayTimeInNanoSec, - lpspi_delay_type_t whichDelay, - uint32_t srcClock_Hz) -{ - uint64_t realDelay, bestDelay; - uint32_t scaler, bestScaler; - uint32_t diff, min_diff; - uint64_t initialDelayNanoSec; - uint32_t clockDividedPrescaler; - - /* For delay between transfer, an additional scaler value is needed */ - uint32_t additionalScaler = 0; - - /*As the RM note, the LPSPI baud rate clock is itself divided by the PRESCALE setting, which can vary between - * transfers.*/ - clockDividedPrescaler = - srcClock_Hz / s_baudratePrescaler[(base->TCR & LPSPI_TCR_PRESCALE_MASK) >> LPSPI_TCR_PRESCALE_SHIFT]; - - /* Find combination of prescaler and scaler resulting in the delay closest to the requested value.*/ - min_diff = 0xFFFFFFFFU; - - /* Initialize scaler to max value to generate the max delay */ - bestScaler = 0xFFU; - - /* Calculate the initial (min) delay and maximum possible delay based on the specific delay as - * the delay divisors are slightly different based on which delay we are configuring. - */ - if (whichDelay == kLPSPI_BetweenTransfer) - { - /* First calculate the initial, default delay, note min delay is 2 clock cycles. Due to large size of - calculated values (uint64_t), we need to break up the calculation into several steps to ensure - accurate calculated results - */ - initialDelayNanoSec = 1000000000U; - initialDelayNanoSec *= 2U; - initialDelayNanoSec /= clockDividedPrescaler; - - /* Calculate the maximum delay */ - bestDelay = 1000000000U; - bestDelay *= 257U; /* based on DBT+2, or 255 + 2 */ - bestDelay /= clockDividedPrescaler; - - additionalScaler = 1U; - } - else - { - /* First calculate the initial, default delay, min delay is 1 clock cycle. Due to large size of calculated - values (uint64_t), we need to break up the calculation into several steps to ensure accurate calculated - results. - */ - initialDelayNanoSec = 1000000000U; - initialDelayNanoSec /= clockDividedPrescaler; - - /* Calculate the maximum delay */ - bestDelay = 1000000000U; - bestDelay *= 256U; /* based on SCKPCS+1 or PCSSCK+1, or 255 + 1 */ - bestDelay /= clockDividedPrescaler; - - additionalScaler = 0U; - } - - /* If the initial, default delay is already greater than the desired delay, then - * set the delay to their initial value (0) and return the delay. In other words, - * there is no way to decrease the delay value further. - */ - if (initialDelayNanoSec >= delayTimeInNanoSec) - { - LPSPI_MasterSetDelayScaler(base, 0, whichDelay); - return (uint32_t)initialDelayNanoSec; - } - - /* If min_diff = 0, the exit for loop */ - for (scaler = 0U; scaler < 256U; scaler++) - { - if (min_diff == 0U) - { - break; - } - /* Calculate the real delay value as we cycle through the scaler values. - Due to large size of calculated values (uint64_t), we need to break up the - calculation into several steps to ensure accurate calculated results - */ - realDelay = 1000000000U; - realDelay *= ((uint64_t)scaler + 1UL + (uint64_t)additionalScaler); - realDelay /= clockDividedPrescaler; - - /* calculate the delay difference based on the conditional statement - * that states that the calculated delay must not be less then the desired delay - */ - if (realDelay >= delayTimeInNanoSec) - { - diff = (uint32_t)(realDelay - (uint64_t)delayTimeInNanoSec); - if (min_diff > diff) - { - /* a better match found */ - min_diff = diff; - bestScaler = scaler; - bestDelay = realDelay; - } - } - } - - /* write the best scaler value for the delay */ - LPSPI_MasterSetDelayScaler(base, bestScaler, whichDelay); - - /* return the actual calculated delay value (in ns) */ - return (uint32_t)bestDelay; -} - -/*Transactional APIs -- Master*/ - -/*! - * brief Initializes the LPSPI master handle. - * - * This function initializes the LPSPI handle, which can be used for other LPSPI transactional APIs. Usually, for a - * specified LPSPI instance, call this API once to get the initialized handle. - - * param base LPSPI peripheral address. - * param handle LPSPI handle pointer to lpspi_master_handle_t. - * param callback DSPI callback. - * param userData callback function parameter. - */ -void LPSPI_MasterTransferCreateHandle(LPSPI_Type *base, - lpspi_master_handle_t *handle, - lpspi_master_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - s_lpspiHandle[LPSPI_GetInstance(base)] = handle; - - /* Set irq handler. */ - s_lpspiMasterIsr = LPSPI_MasterTransferHandleIRQ; - - handle->callback = callback; - handle->userData = userData; -} - -/*! - * brief Check the argument for transfer . - * - * param base LPSPI peripheral address. - * param transfer the transfer struct to be used. - * param isEdma True to check for EDMA transfer, false to check interrupt non-blocking transfer - * return Return true for right and false for wrong. - */ -bool LPSPI_CheckTransferArgument(LPSPI_Type *base, lpspi_transfer_t *transfer, bool isEdma) -{ - assert(transfer != NULL); - uint32_t bitsPerFrame = ((base->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT) + 1U; - uint32_t bytesPerFrame = (bitsPerFrame + 7U) / 8U; - uint32_t temp = (base->CFGR1 & LPSPI_CFGR1_PINCFG_MASK); - /* If the transfer count is zero, then return immediately.*/ - if (transfer->dataSize == 0U) - { - return false; - } - - /* If both send buffer and receive buffer is null */ - if ((NULL == (transfer->txData)) && (NULL == (transfer->rxData))) - { - return false; - } - - /*The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4 . - *For bytesPerFrame greater than 4 situation: - *the transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not integer multiples of 4 , - *otherwise , the transfer data size can be integer multiples of bytesPerFrame. - */ - if (bytesPerFrame <= 4U) - { - if ((transfer->dataSize % bytesPerFrame) != 0U) - { - return false; - } - } - else - { - if ((bytesPerFrame % 4U) != 0U) - { - if (transfer->dataSize != bytesPerFrame) - { - return false; - } - } - else - { - if ((transfer->dataSize % bytesPerFrame) != 0U) - { - return false; - } - } - } - - /* Check if using 3-wire mode and the txData is NULL, set the output pin to tristated. */ - if ((temp == LPSPI_CFGR1_PINCFG(kLPSPI_SdiInSdiOut)) || (temp == LPSPI_CFGR1_PINCFG(kLPSPI_SdoInSdoOut))) - { - /* The 3-wire mode can't send and receive data at the same time. */ - if ((transfer->txData != NULL) && (transfer->rxData != NULL)) - { - return false; - } - } - - if (isEdma && ((bytesPerFrame % 4U) == 3U)) - { - return false; - } - - return true; -} - -static bool LPSPI_MasterTransferWriteAllTxData(LPSPI_Type *base, - lpspi_transfer_t *transfer, - lpspi_transfer_blocking_param_t *stateParams) -{ - uint8_t dummyData = g_lpspiDummyData[LPSPI_GetInstance(base)]; - uint32_t bytesPerFrame = ((base->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT) / 8U + 1U; - uint32_t txRemainingByteCount = transfer->dataSize; - bool isByteSwap = ((transfer->configFlags & (uint32_t)kLPSPI_MasterByteSwap) != 0U); - uint32_t wordToSend = - ((uint32_t)dummyData) | ((uint32_t)dummyData << 8) | ((uint32_t)dummyData << 16) | ((uint32_t)dummyData << 24); - uint32_t rxFifoMaxBytes = MIN(bytesPerFrame, 4U) * LPSPI_GetRxFifoSize(base); - uint32_t readData; - uint8_t fifo_size = LPSPI_GetRxFifoSize(base); - /*Write the TX data until txRemainingByteCount is equal to 0 */ - while (txRemainingByteCount > 0U) - { - if (txRemainingByteCount < (stateParams->bytesEachWrite)) - { - (stateParams->bytesEachWrite) = (uint8_t)txRemainingByteCount; - } - - /*Wait until TX FIFO is not full*/ -#if SPI_RETRY_TIMES - uint32_t waitTimes = SPI_RETRY_TIMES; - while ((LPSPI_GetTxFifoCount(base) == fifo_size) && ((--waitTimes) != 0U)) -#else - while (LPSPI_GetTxFifoCount(base) == fifo_size) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return false; - } -#endif - - /* To prevent rxfifo overflow, ensure transmitting and receiving are executed in parallel */ - if (((NULL == (stateParams->rxData)) || - ((stateParams->rxRemainingByteCount) - txRemainingByteCount) < rxFifoMaxBytes)) - { - if (stateParams->isTxMask) - { - /* When TCR[TXMSK]=1, transfer is initiate by writting a new command word to TCR. TCR[TXMSK] is cleared - by hardware every time when TCR[FRAMESZ] bit of data is transfered. - In this case TCR[TXMSK] should be set to initiate each transfer. */ - base->TCR |= LPSPI_TCR_TXMSK_MASK; - if (stateParams->isPcsContinuous && (txRemainingByteCount == bytesPerFrame)) - { - /* For the last piece of frame size of data, if is PCS continous mode(TCR[CONT]), TCR[CONTC] should - * be cleared to de-assert the PCS. Be sure to clear the TXMSK as well otherwise another FRAMESZ - * of data will be received. */ - base->TCR &= ~(LPSPI_TCR_CONTC_MASK | LPSPI_TCR_CONT_MASK | LPSPI_TCR_TXMSK_MASK); - } - else - { - if (!LPSPI_WaitTxFifoEmpty(base)) - { - return false; - } - } - txRemainingByteCount -= bytesPerFrame; - } - else - { - if ((stateParams->txData) != NULL) - { - if (stateParams->bytesEachWrite != 1U) - { - wordToSend = - LPSPI_CombineWriteData((stateParams->txData), (stateParams->bytesEachWrite), isByteSwap); - (stateParams->txData) += (stateParams->bytesEachWrite); - } - else - { - wordToSend = *(stateParams->txData); - (stateParams->txData) += 1U; - } - } - /* Otherwise push data to tx FIFO to initiate transfer */ - LPSPI_WriteData(base, wordToSend); - txRemainingByteCount -= (stateParams->bytesEachWrite); - } - } - - /* Check whether there is RX data in RX FIFO . Read out the RX data so that the RX FIFO would not overrun. */ - /* - * $Branch Coverage Justification$ - * Data will be transferred in the inner loop until complete, after which the interrupt will end.(will improve) - */ - if (((stateParams->rxData) != NULL) && ((stateParams->rxRemainingByteCount) != 0U)) - { - /* To ensure parallel execution in 3-wire mode, after writting 1 to TXMSK to generate clock of - bytesPerFrame's data wait until bytesPerFrame's data is received. */ - while ((stateParams->isTxMask) && (LPSPI_GetRxFifoCount(base) == 0U)) - { - } -#if SPI_RETRY_TIMES - uint32_t waitTimes = SPI_RETRY_TIMES; - while ((LPSPI_GetRxFifoCount(base) != 0U) && (--waitTimes != 0U)) -#else - while (LPSPI_GetRxFifoCount(base) != 0U) -#endif - { - readData = LPSPI_ReadData(base); - /* - * $Branch Coverage Justification$ - * rxRemainingByteCount must be an integer multiple of bytesEachRead, otherwise it cannot pass the check - * of #LPSPI_CheckTransferArgument,so it doesn't happen here.(will improve) - */ - if ((stateParams->rxRemainingByteCount) < (stateParams->bytesEachRead)) - { - (stateParams->bytesEachRead) = (uint8_t)(stateParams->rxRemainingByteCount); - } - - LPSPI_SeparateReadData((stateParams->rxData), readData, (stateParams->bytesEachRead), isByteSwap); - (stateParams->rxData) += (stateParams->bytesEachRead); - - (stateParams->rxRemainingByteCount) -= (stateParams->bytesEachRead); - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return false; - } -#endif - } - } - return true; -} - -static bool LPSPI_MasterTransferClearTCR(LPSPI_Type *base, lpspi_transfer_blocking_param_t *stateParams) -{ -#if SPI_RETRY_TIMES - uint32_t waitTimes = SPI_RETRY_TIMES; - while ((LPSPI_GetTxFifoCount(base) == LPSPI_GetRxFifoSize(base)) && (--waitTimes != 0U)) -#else - while (LPSPI_GetTxFifoCount(base) == LPSPI_GetRxFifoSize(base)) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return false; - } -#endif - base->TCR = (base->TCR & ~(LPSPI_TCR_CONTC_MASK | LPSPI_TCR_CONT_MASK)); - - return true; -} - -static bool LPSPI_MasterTransferReadDataInFifo(LPSPI_Type *base, - lpspi_transfer_t *transfer, - lpspi_transfer_blocking_param_t *stateParams) -{ - uint32_t readData; - bool isByteSwap = ((transfer->configFlags & (uint32_t)kLPSPI_MasterByteSwap) != 0U); - while ((stateParams->rxRemainingByteCount) > 0U) - { -#if SPI_RETRY_TIMES - uint32_t waitTimes = SPI_RETRY_TIMES; - while ((LPSPI_GetRxFifoCount(base) != 0U) && (--waitTimes != 0U)) -#else - while (LPSPI_GetRxFifoCount(base) != 0U) -#endif - { - readData = LPSPI_ReadData(base); - - if ((stateParams->rxRemainingByteCount) < (stateParams->bytesEachRead)) - { - (stateParams->bytesEachRead) = (uint8_t)(stateParams->rxRemainingByteCount); - } - - LPSPI_SeparateReadData((stateParams->rxData), readData, (stateParams->bytesEachRead), isByteSwap); - (stateParams->rxData) += (stateParams->bytesEachRead); - - (stateParams->rxRemainingByteCount) -= (stateParams->bytesEachRead); - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return false; - } -#endif - } - - return true; -} - -static bool LPSPI_MasterTransferReadDataInFifoNoBuf(LPSPI_Type *base, lpspi_transfer_blocking_param_t *stateParams) -{ -#if SPI_RETRY_TIMES - uint32_t waitTimes = SPI_RETRY_TIMES; - while (((LPSPI_GetStatusFlags(base) & (uint32_t)kLPSPI_TransferCompleteFlag) == 0U) && (--waitTimes != 0U)) -#else - while ((LPSPI_GetStatusFlags(base) & (uint32_t)kLPSPI_TransferCompleteFlag) == 0U) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return false; - } -#endif - return true; -} - -/*! - * brief LPSPI master transfer data using a polling method. - * - * This function transfers data using a polling method. This is a blocking function, which does not return until all - * transfers have been completed. - * - * Note: - * The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not integer multiples of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * param base LPSPI peripheral address. - * param transfer pointer to lpspi_transfer_t structure. - * return status of status_t. - */ -status_t LPSPI_MasterTransferBlocking(LPSPI_Type *base, lpspi_transfer_t *transfer) -{ - assert(transfer != NULL); - - /* Check that LPSPI is not busy.*/ - /* - * $Branch Coverage Justification$ - * MBF state setting and clearing is done by hardware, the state is too fast to be overwritten.(will improve) - */ - if ((LPSPI_GetStatusFlags(base) & (uint32_t)kLPSPI_ModuleBusyFlag) != 0U) - { - return kStatus_LPSPI_Busy; - } - LPSPI_Enable(base, false); - /* Check arguements */ - if (!LPSPI_CheckTransferArgument(base, transfer, false)) - { - return kStatus_InvalidArgument; - } - - LPSPI_FlushFifo(base, true, true); - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_AllStatusFlag); - - /* Variables */ - uint32_t whichPcs = (transfer->configFlags & LPSPI_MASTER_PCS_MASK) >> LPSPI_MASTER_PCS_SHIFT; -#if !(defined(FSL_FEATURE_LPSPI_HAS_NO_MULTI_WIDTH) && FSL_FEATURE_LPSPI_HAS_NO_MULTI_WIDTH) - uint32_t width = (transfer->configFlags & LPSPI_MASTER_WIDTH_MASK) >> LPSPI_MASTER_WIDTH_SHIFT; -#endif - uint32_t temp = (base->CFGR1 & LPSPI_CFGR1_PINCFG_MASK); - lpspi_transfer_blocking_param_t stateParams; - (void)memset(&stateParams, 0, sizeof(stateParams)); - - stateParams.txData = transfer->txData; - stateParams.rxData = transfer->rxData; - stateParams.isTxMask = false; - stateParams.rxRemainingByteCount = transfer->dataSize; - /*The TX and RX FIFO sizes are always the same*/ - uint32_t bytesPerFrame = ((base->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT) / 8U + 1U; - /* No need to configure PCS continous if the transfer byte count is smaller than frame size */ - stateParams.isPcsContinuous = (((transfer->configFlags & (uint32_t)kLPSPI_MasterPcsContinuous) != 0U) && - (bytesPerFrame < transfer->dataSize)); - - /* Mask tx data in half duplex mode */ - if (((temp == LPSPI_CFGR1_PINCFG(kLPSPI_SdiInSdiOut)) || (temp == LPSPI_CFGR1_PINCFG(kLPSPI_SdoInSdoOut))) && - (stateParams.txData == NULL)) - { - stateParams.isTxMask = true; - } - - base->CFGR1 &= (~LPSPI_CFGR1_NOSTALL_MASK); - LPSPI_Enable(base, true); - - /* Configure transfer control register. */ - base->TCR = (base->TCR & ~(LPSPI_TCR_CONT_MASK | LPSPI_TCR_CONTC_MASK | LPSPI_TCR_RXMSK_MASK | - LPSPI_TCR_TXMSK_MASK | LPSPI_TCR_PCS_MASK)) | -#if !(defined(FSL_FEATURE_LPSPI_HAS_NO_MULTI_WIDTH) && FSL_FEATURE_LPSPI_HAS_NO_MULTI_WIDTH) - LPSPI_TCR_WIDTH(width) | -#endif - LPSPI_TCR_PCS(whichPcs); - /*TCR is also shared the FIFO, so wait for TCR written.*/ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_c_ref_2$ - */ - if (!LPSPI_WaitTxFifoEmpty(base)) - { - return kStatus_LPSPI_Timeout; - } - - /* PCS should be configured separately from the other bits, otherwise it will not take effect. */ - base->TCR |= LPSPI_TCR_CONT(stateParams.isPcsContinuous) | LPSPI_TCR_CONTC(stateParams.isPcsContinuous) | - LPSPI_TCR_RXMSK(NULL == stateParams.rxData); - - /*TCR is also shared the FIFO, so wait for TCR written.*/ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_c_ref_2$ - */ - if (!LPSPI_WaitTxFifoEmpty(base)) - { - return kStatus_LPSPI_Timeout; - } - - if (bytesPerFrame <= 4U) - { - stateParams.bytesEachWrite = (uint8_t)bytesPerFrame; - stateParams.bytesEachRead = (uint8_t)bytesPerFrame; - } - else - { - stateParams.bytesEachWrite = 4U; - stateParams.bytesEachRead = 4U; - } - - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_c_ref_2$ - */ - if (false == LPSPI_MasterTransferWriteAllTxData(base, transfer, &stateParams)) - { - return kStatus_LPSPI_Timeout; - } - - if (stateParams.isPcsContinuous && !stateParams.isTxMask) - { - /* In PCS continous mode(TCR[CONT]), after write all the data in TX FIFO, TCR[CONTC] and TCR[CONT] should be - cleared to de-assert the PCS. Note that TCR register also use the TX FIFO. Also CONTC should be cleared when - tx is not masked, otherwise written to TCR register with TXMSK bit set will initiate a new transfer. */ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_c_ref_2$ - */ - if (false == LPSPI_MasterTransferClearTCR(base, &stateParams)) - { - return kStatus_LPSPI_Timeout; - } - } - - /*Read out the RX data in FIFO*/ - if (stateParams.rxData != NULL) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_c_ref_2$ - */ - if (false == LPSPI_MasterTransferReadDataInFifo(base, transfer, &stateParams)) - { - return kStatus_LPSPI_Timeout; - } - } - else - { - /* If no RX buffer, then transfer is not complete until transfer complete flag sets */ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_c_ref_2$ - */ - if (false == LPSPI_MasterTransferReadDataInFifoNoBuf(base, &stateParams)) - { - return kStatus_LPSPI_Timeout; - } - } - - return kStatus_Success; -} - -/*! - * brief LPSPI master transfer data using an interrupt method. - * - * This function transfers data using an interrupt method. This is a non-blocking function, which returns right away. - * When all data is transferred, the callback function is called. - * - * Note: - * The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not integer multiples of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * param base LPSPI peripheral address. - * param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - * param transfer pointer to lpspi_transfer_t structure. - * return status of status_t. - */ -status_t LPSPI_MasterTransferNonBlocking(LPSPI_Type *base, lpspi_master_handle_t *handle, lpspi_transfer_t *transfer) -{ - assert(handle != NULL); - assert(transfer != NULL); - - /* Check that we're not busy.*/ - if (handle->state == (uint8_t)kLPSPI_Busy) - { - return kStatus_LPSPI_Busy; - } - - LPSPI_Enable(base, false); - /* Check arguements */ - if (!LPSPI_CheckTransferArgument(base, transfer, false)) - { - return kStatus_InvalidArgument; - } - - /* Flush FIFO, clear status, disable all the interrupts. */ - LPSPI_FlushFifo(base, true, true); - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_AllStatusFlag); - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_AllInterruptEnable); - - /* Variables */ - bool isRxMask = false; - handle->isTxMask = false; - uint8_t txWatermark; - uint8_t dummyData = g_lpspiDummyData[LPSPI_GetInstance(base)]; - uint32_t tmpTimes; - uint32_t whichPcs = (transfer->configFlags & LPSPI_MASTER_PCS_MASK) >> LPSPI_MASTER_PCS_SHIFT; - uint32_t temp = (base->CFGR1 & LPSPI_CFGR1_PINCFG_MASK); - - /* Assign the original value for members of transfer handle. */ - handle->state = (uint8_t)kLPSPI_Busy; - handle->txData = transfer->txData; - handle->rxData = transfer->rxData; - handle->txRemainingByteCount = transfer->dataSize; - handle->rxRemainingByteCount = transfer->dataSize; - handle->totalByteCount = transfer->dataSize; - handle->writeTcrInIsr = false; - handle->bytesPerFrame = (uint16_t)((base->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT) / 8U + 1U; - /* No need to configure PCS continous if the transfer byte count is smaller than frame size */ - bool isPcsContinuous = (((transfer->configFlags & (uint32_t)kLPSPI_MasterPcsContinuous) != 0U) && - (transfer->dataSize > handle->bytesPerFrame)); - handle->writeRegRemainingTimes = - (transfer->dataSize / (uint32_t)handle->bytesPerFrame) * (((uint32_t)handle->bytesPerFrame + 3U) / 4U); - handle->readRegRemainingTimes = handle->writeRegRemainingTimes; - handle->txBuffIfNull = - ((uint32_t)dummyData) | ((uint32_t)dummyData << 8) | ((uint32_t)dummyData << 16) | ((uint32_t)dummyData << 24); - /*The TX and RX FIFO sizes are always the same*/ - handle->fifoSize = LPSPI_GetRxFifoSize(base); - handle->isPcsContinuous = isPcsContinuous; - handle->isByteSwap = ((transfer->configFlags & (uint32_t)kLPSPI_MasterByteSwap) != 0U); - /*Calculate the bytes for write/read the TX/RX register each time*/ - if (handle->bytesPerFrame <= 4U) - { - handle->bytesEachWrite = (uint8_t)handle->bytesPerFrame; - handle->bytesEachRead = (uint8_t)handle->bytesPerFrame; - } - else - { - handle->bytesEachWrite = 4U; - handle->bytesEachRead = 4U; - } - - /*Set the RX and TX watermarks to reduce the ISR times.*/ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_c_ref_3$ - */ - if (handle->fifoSize > 1U) - { - txWatermark = 1U; - handle->rxWatermark = handle->fifoSize - 2U; - } - else - { - txWatermark = 0U; - handle->rxWatermark = 0U; - } - LPSPI_SetFifoWatermarks(base, txWatermark, handle->rxWatermark); - - /* If there is no rxData, mask the receive data so that receive data is not stored in receive FIFO. */ - if (handle->rxData == NULL) - { - isRxMask = true; - handle->rxRemainingByteCount = 0; - } - - /* Mask tx data in half duplex mode since the tx/rx share the same pin, so that the data received from slave is not - * interfered. */ - if (((temp == LPSPI_CFGR1_PINCFG(kLPSPI_SdiInSdiOut)) || (temp == LPSPI_CFGR1_PINCFG(kLPSPI_SdoInSdoOut))) && - (handle->txData == NULL)) - { - handle->isTxMask = true; - } - - /*Transfers will stall when transmit FIFO is empty or receive FIFO is full. */ - base->CFGR1 &= (~LPSPI_CFGR1_NOSTALL_MASK); - - /* Enable module for following configuration of TCR to take effect. */ - LPSPI_Enable(base, true); - - /* Configure transfer control register. */ - base->TCR = (base->TCR & ~(LPSPI_TCR_CONT_MASK | LPSPI_TCR_CONTC_MASK | LPSPI_TCR_RXMSK_MASK | - LPSPI_TCR_TXMSK_MASK | LPSPI_TCR_PCS_MASK)) | - LPSPI_TCR_PCS(whichPcs); - - /*TCR is also shared the FIFO , so wait for TCR written.*/ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_c_ref_2$ - */ - if (!LPSPI_WaitTxFifoEmpty(base)) - { - return kStatus_LPSPI_Timeout; - } - - /* PCS should be configured separately from the other bits, otherwise it will not take effect. */ - base->TCR |= LPSPI_TCR_CONT(isPcsContinuous) | LPSPI_TCR_CONTC(isPcsContinuous) | LPSPI_TCR_RXMSK(isRxMask); - - /* Enable the NVIC for LPSPI peripheral. Note that below code is useless if the LPSPI interrupt is in INTMUX , - * and you should also enable the INTMUX interupt in your application. - */ - (void)EnableIRQ(s_lpspiIRQ[LPSPI_GetInstance(base)]); - - /*TCR is also shared the FIFO , so wait for TCR written.*/ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_c_ref_2$ - */ - if (!LPSPI_WaitTxFifoEmpty(base)) - { - return kStatus_LPSPI_Timeout; - } - - if (handle->isTxMask) - { - /* When TCR[TXMSK]=1, transfer is initiate by writting a new command word to TCR. TCR[TXMSK] is cleared by - hardware every time when TCR[FRAMESZ] bit of data is transfered. In this case TCR[TXMSK] should be set to - initiate each transfer. */ - - base->TCR |= LPSPI_TCR_TXMSK_MASK; - handle->txRemainingByteCount -= (uint32_t)handle->bytesPerFrame; - if (!LPSPI_WaitTxFifoEmpty(base)) - { - return kStatus_LPSPI_Timeout; - } - } - else - { - /* Fill up the TX data in FIFO to initiate transfer */ - LPSPI_MasterTransferFillUpTxFifo(base, handle); - } - - /* Since SPI is a synchronous interface, we only need to enable the RX interrupt if there is RX data. - * The IRQ handler will get the status of RX and TX interrupt flags. - */ - if (handle->rxData != NULL) - { - if (handle->isTxMask) - { - /* if tx data is masked, transfer is initiated by writing 1 to TCR[TXMSK] and TCR[FRMESZ] bits of data is - read. If rx water mark is set larger than TCR[FRMESZ], rx interrupt will not be generated. Lower the rx - water mark setting */ - if ((handle->bytesPerFrame / 4U) < (uint16_t)handle->rxWatermark) - { - handle->rxWatermark = - (uint8_t)(handle->bytesPerFrame / 4U) > 0U ? (uint8_t)(handle->bytesPerFrame / 4U - 1U) : 0U; - base->FCR = (base->FCR & (~LPSPI_FCR_RXWATER_MASK)) | LPSPI_FCR_RXWATER(handle->rxWatermark); - } - } - else - { - /*Set rxWatermark to (readRegRemainingTimes-1) if readRegRemainingTimes less than rxWatermark. Otherwise - *there is not RX interrupt for the last datas because the RX count is not greater than rxWatermark. - */ - tmpTimes = handle->readRegRemainingTimes; - if (tmpTimes <= handle->rxWatermark) - { - base->FCR = (base->FCR & (~LPSPI_FCR_RXWATER_MASK)) | LPSPI_FCR_RXWATER(tmpTimes - 1U); - } - } - - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_RxInterruptEnable); - } - else - { - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_TxInterruptEnable); - } - - return kStatus_Success; -} - -static void LPSPI_MasterTransferFillUpTxFifo(LPSPI_Type *base, lpspi_master_handle_t *handle) -{ - assert(handle != NULL); - - uint32_t wordToSend = 0; - uint8_t fifoSize = handle->fifoSize; - uint32_t writeRegRemainingTimes = handle->writeRegRemainingTimes; - uint32_t readRegRemainingTimes = handle->readRegRemainingTimes; - size_t txRemainingByteCount = handle->txRemainingByteCount; - uint8_t bytesEachWrite = handle->bytesEachWrite; - bool isByteSwap = handle->isByteSwap; - - /* Make sure the difference in remaining TX and RX byte counts does not exceed FIFO depth - * and that the number of TX FIFO entries does not exceed the FIFO depth. - * But no need to make the protection if there is no rxData. - */ - while ((LPSPI_GetTxFifoCount(base) < fifoSize) && - (((readRegRemainingTimes - writeRegRemainingTimes) < (uint32_t)fifoSize) || (handle->rxData == NULL))) - { - if (txRemainingByteCount < (size_t)bytesEachWrite) - { - handle->bytesEachWrite = (uint8_t)txRemainingByteCount; - bytesEachWrite = handle->bytesEachWrite; - } - - if (handle->txData != NULL) - { - wordToSend = LPSPI_CombineWriteData(handle->txData, bytesEachWrite, isByteSwap); - handle->txData += bytesEachWrite; - } - else - { - wordToSend = handle->txBuffIfNull; - } - - /*Write the word to TX register*/ - LPSPI_WriteData(base, wordToSend); - - /*Decrease the write TX register times.*/ - --handle->writeRegRemainingTimes; - writeRegRemainingTimes = handle->writeRegRemainingTimes; - - /*Decrease the remaining TX byte count.*/ - handle->txRemainingByteCount -= (size_t)bytesEachWrite; - txRemainingByteCount = handle->txRemainingByteCount; - - if (handle->txRemainingByteCount == 0U) - { - /* If PCS is continuous, update TCR to de-assert PCS */ - if (handle->isPcsContinuous) - { - /* Only write to the TCR if the FIFO has room */ - if (LPSPI_GetTxFifoCount(base) < fifoSize) - { - base->TCR = (base->TCR & ~(LPSPI_TCR_CONTC_MASK)); - handle->writeTcrInIsr = false; - } - /* Else, set a global flag to tell the ISR to do write to the TCR */ - else - { - handle->writeTcrInIsr = true; - } - } - break; - } - } -} - -static void LPSPI_MasterTransferComplete(LPSPI_Type *base, lpspi_master_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable interrupt requests*/ - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_AllInterruptEnable); - - handle->state = (uint8_t)kLPSPI_Idle; - - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_Success, handle->userData); - } -} - -/*! - * brief Gets the master transfer remaining bytes. - * - * This function gets the master transfer remaining bytes. - * - * param base LPSPI peripheral address. - * param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - * param count Number of bytes transferred so far by the non-blocking transaction. - * return status of status_t. - */ -status_t LPSPI_MasterTransferGetCount(LPSPI_Type *base, lpspi_master_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (handle->state != (uint8_t)kLPSPI_Busy) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - size_t remainingByte; - - if (handle->rxData != NULL) - { - remainingByte = handle->rxRemainingByteCount; - } - else - { - remainingByte = handle->txRemainingByteCount; - } - - *count = handle->totalByteCount - remainingByte; - - return kStatus_Success; -} - -/*! - * brief LPSPI master abort transfer which uses an interrupt method. - * - * This function aborts a transfer which uses an interrupt method. - * - * param base LPSPI peripheral address. - * param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - */ -void LPSPI_MasterTransferAbort(LPSPI_Type *base, lpspi_master_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable interrupt requests*/ - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_AllInterruptEnable); - - LPSPI_Reset(base); - - handle->state = (uint8_t)kLPSPI_Idle; - handle->txRemainingByteCount = 0; - handle->rxRemainingByteCount = 0; -} - -/*! - * brief LPSPI Master IRQ handler function. - * - * This function processes the LPSPI transmit and receive IRQ. - * - * param base LPSPI peripheral address. - * param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - */ -void LPSPI_MasterTransferHandleIRQ(LPSPI_Type *base, lpspi_master_handle_t *handle) -{ - assert(handle != NULL); - - uint32_t readData; - uint8_t bytesEachRead = handle->bytesEachRead; - bool isByteSwap = handle->isByteSwap; - uint32_t readRegRemainingTimes = handle->readRegRemainingTimes; - - if (handle->rxData != NULL) - { - if (handle->rxRemainingByteCount != 0U) - { - /* First, disable the interrupts to avoid potentially triggering another interrupt - * while reading out the RX FIFO as more data may be coming into the RX FIFO. We'll - * re-enable the interrupts based on the LPSPI state after reading out the FIFO. - */ - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_RxInterruptEnable); - - /* - * $Branch Coverage Justification$ - * If the remaining number is 0, the FIFO must be 0, and the condition after will not be judged.(will - * improve) - */ - while ((LPSPI_GetRxFifoCount(base) != 0U) && (handle->rxRemainingByteCount != 0U)) - { - /*Read out the data*/ - readData = LPSPI_ReadData(base); - - /*Decrease the read RX register times.*/ - --handle->readRegRemainingTimes; - readRegRemainingTimes = handle->readRegRemainingTimes; - - if (handle->rxRemainingByteCount < (size_t)bytesEachRead) - { - handle->bytesEachRead = (uint8_t)(handle->rxRemainingByteCount); - bytesEachRead = handle->bytesEachRead; - } - - LPSPI_SeparateReadData(handle->rxData, readData, bytesEachRead, isByteSwap); - handle->rxData += bytesEachRead; - - /*Decrease the remaining RX byte count.*/ - handle->rxRemainingByteCount -= (size_t)bytesEachRead; - } - - /* Re-enable the interrupts only if rxCount indicates there is more data to receive, - * else we may get a spurious interrupt. - * */ - if (handle->rxRemainingByteCount != 0U) - { - /* Set the TDF and RDF interrupt enables simultaneously to avoid race conditions */ - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_RxInterruptEnable); - } - } - - /*Set rxWatermark to (readRegRemainingTimes-1) if readRegRemainingTimes less than rxWatermark. Otherwise there - *is not RX interrupt for the last datas because the RX count is not greater than rxWatermark. - */ - if (readRegRemainingTimes <= (uint32_t)handle->rxWatermark) - { - base->FCR = (base->FCR & (~LPSPI_FCR_RXWATER_MASK)) | - LPSPI_FCR_RXWATER((readRegRemainingTimes > 1U) ? (readRegRemainingTimes - 1U) : (0U)); - } - } - - if (handle->txRemainingByteCount != 0U) - { - if (handle->isTxMask) - { - /* When TCR[TXMSK]=1, transfer is initiate by writting a new command word to TCR. TCR[TXMSK] is cleared by - hardware every time when TCR[FRAMESZ] bit of data is transfered. - In this case TCR[TXMSK] should be set to initiate each transfer. */ - base->TCR |= LPSPI_TCR_TXMSK_MASK; - if ((handle->txRemainingByteCount == (uint32_t)handle->bytesPerFrame) && (handle->isPcsContinuous)) - { - /* For the last piece of frame size of data, if is PCS continous mode(TCR[CONT]), TCR[CONTC] should - * be cleared to de-assert the PCS. Be sure to clear the TXMSK as well otherwise another FRAMESZ - * of data will be received. */ - base->TCR &= ~(LPSPI_TCR_CONTC_MASK | LPSPI_TCR_CONT_MASK | LPSPI_TCR_TXMSK_MASK); - } - else - { - if (!LPSPI_WaitTxFifoEmpty(base)) - { - return; - } - } - handle->txRemainingByteCount -= (uint32_t)handle->bytesPerFrame; - } - else - { - LPSPI_MasterTransferFillUpTxFifo(base, handle); - } - } - else - { - if ((LPSPI_GetTxFifoCount(base) < (handle->fifoSize))) - { - if ((handle->isPcsContinuous) && (handle->writeTcrInIsr) && (!handle->isTxMask)) - { - base->TCR = (base->TCR & ~(LPSPI_TCR_CONTC_MASK)); - handle->writeTcrInIsr = false; - } - } - } - - if ((handle->txRemainingByteCount == 0U) && (handle->rxRemainingByteCount == 0U) && (!handle->writeTcrInIsr)) - { - /* If no RX buffer, then transfer is not complete until transfer complete flag sets */ - if (handle->rxData == NULL) - { - if ((LPSPI_GetStatusFlags(base) & (uint32_t)kLPSPI_TransferCompleteFlag) != 0U) - { - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_TransferCompleteFlag); - /* Complete the transfer and disable the interrupts */ - LPSPI_MasterTransferComplete(base, handle); - } - else - { - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_TransferCompleteInterruptEnable); - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_TxInterruptEnable | (uint32_t)kLPSPI_RxInterruptEnable); - } - } - else - { - /* Complete the transfer and disable the interrupts */ - LPSPI_MasterTransferComplete(base, handle); - } - } -} - -/*Transactional APIs -- Slave*/ -/*! - * brief Initializes the LPSPI slave handle. - * - * This function initializes the LPSPI handle, which can be used for other LPSPI transactional APIs. Usually, for a - * specified LPSPI instance, call this API once to get the initialized handle. - * - * param base LPSPI peripheral address. - * param handle LPSPI handle pointer to lpspi_slave_handle_t. - * param callback DSPI callback. - * param userData callback function parameter. - */ -void LPSPI_SlaveTransferCreateHandle(LPSPI_Type *base, - lpspi_slave_handle_t *handle, - lpspi_slave_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - s_lpspiHandle[LPSPI_GetInstance(base)] = handle; - - /* Set irq handler. */ - s_lpspiSlaveIsr = LPSPI_SlaveTransferHandleIRQ; - - handle->callback = callback; - handle->userData = userData; -} - -/*! - * brief LPSPI slave transfer data using an interrupt method. - * - * This function transfer data using an interrupt method. This is a non-blocking function, which returns right away. - * When all data is transferred, the callback function is called. - * - * Note: - * The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not an integer multiple of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * param base LPSPI peripheral address. - * param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - * param transfer pointer to lpspi_transfer_t structure. - * return status of status_t. - */ -status_t LPSPI_SlaveTransferNonBlocking(LPSPI_Type *base, lpspi_slave_handle_t *handle, lpspi_transfer_t *transfer) -{ - assert(handle != NULL); - assert(transfer != NULL); - - /* Check that we're not busy.*/ - if (handle->state == (uint8_t)kLPSPI_Busy) - { - return kStatus_LPSPI_Busy; - } - LPSPI_Enable(base, false); - /* Check arguements */ - if (!LPSPI_CheckTransferArgument(base, transfer, false)) - { - return kStatus_InvalidArgument; - } - - /* Flush FIFO, clear status, disable all the inerrupts. */ - LPSPI_FlushFifo(base, true, true); - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_AllStatusFlag); - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_AllInterruptEnable); - - /* Variables */ - bool isRxMask = false; - bool isTxMask = false; - uint8_t txWatermark; - uint32_t readRegRemainingTimes; - uint32_t whichPcs = (transfer->configFlags & LPSPI_SLAVE_PCS_MASK) >> LPSPI_SLAVE_PCS_SHIFT; - uint32_t bytesPerFrame = ((base->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT) / 8U + 1U; - - /* Assign the original value for members of transfer handle. */ - handle->state = (uint8_t)kLPSPI_Busy; - handle->txData = transfer->txData; - handle->rxData = transfer->rxData; - handle->txRemainingByteCount = transfer->dataSize; - handle->rxRemainingByteCount = transfer->dataSize; - handle->totalByteCount = transfer->dataSize; - handle->writeRegRemainingTimes = (transfer->dataSize / bytesPerFrame) * ((bytesPerFrame + 3U) / 4U); - handle->readRegRemainingTimes = handle->writeRegRemainingTimes; - /*The TX and RX FIFO sizes are always the same*/ - handle->fifoSize = LPSPI_GetRxFifoSize(base); - handle->isByteSwap = ((transfer->configFlags & (uint32_t)kLPSPI_SlaveByteSwap) != 0U); - /*Calculate the bytes for write/read the TX/RX register each time*/ - if (bytesPerFrame <= 4U) - { - handle->bytesEachWrite = (uint8_t)bytesPerFrame; - handle->bytesEachRead = (uint8_t)bytesPerFrame; - } - else - { - handle->bytesEachWrite = 4U; - handle->bytesEachRead = 4U; - } - /* Set proper RX and TX watermarks to reduce the ISR response times. */ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_c_ref_3$ - */ - if (handle->fifoSize > 1U) - { - txWatermark = 1U; - handle->rxWatermark = handle->fifoSize / 2U; - } - else - { - txWatermark = 0U; - handle->rxWatermark = 0U; - } - LPSPI_SetFifoWatermarks(base, txWatermark, handle->rxWatermark); - - /* If there is no rxData, mask the receive data so that receive data is not stored in receive FIFO. */ - if (handle->rxData == NULL) - { - isRxMask = true; - handle->rxRemainingByteCount = 0U; - } - /* If there is no txData, mask the transmit data so that no data is loaded from transmit FIFO and output pin - * is tristated. */ - if (handle->txData == NULL) - { - isTxMask = true; - handle->txRemainingByteCount = 0U; - } - - /* Enable module for following configuration of TCR to take effect. */ - LPSPI_Enable(base, true); - - base->TCR = (base->TCR & ~(LPSPI_TCR_CONT_MASK | LPSPI_TCR_CONTC_MASK | LPSPI_TCR_RXMSK_MASK | - LPSPI_TCR_TXMSK_MASK | LPSPI_TCR_PCS_MASK)) | - LPSPI_TCR_RXMSK(isRxMask) | LPSPI_TCR_TXMSK(isTxMask) | LPSPI_TCR_PCS(whichPcs); - - /* Enable the NVIC for LPSPI peripheral. Note that below code is useless if the LPSPI interrupt is in INTMUX , - * and you should also enable the INTMUX interupt in your application. - */ - (void)EnableIRQ(s_lpspiIRQ[LPSPI_GetInstance(base)]); - - /*TCR is also shared the FIFO, so wait for TCR written.*/ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_c_ref_3$ - */ - if (!LPSPI_WaitTxFifoEmpty(base)) - { - return kStatus_LPSPI_Timeout; - } - - /* Fill up the TX data in FIFO */ - if (handle->txData != NULL) - { - LPSPI_SlaveTransferFillUpTxFifo(base, handle); - } - - /* Since SPI is a synchronous interface, we only need to enable the RX interrupt if there is RX data. - * The IRQ handler will get the status of RX and TX interrupt flags. - */ - if (handle->rxData != NULL) - { - /*Set rxWatermark to (readRegRemainingTimes-1) if readRegRemainingTimes less than rxWatermark. Otherwise there - *is not RX interrupt for the last datas because the RX count is not greater than rxWatermark. - */ - readRegRemainingTimes = handle->readRegRemainingTimes; - if (readRegRemainingTimes <= (uint32_t)handle->rxWatermark) - { - base->FCR = (base->FCR & (~LPSPI_FCR_RXWATER_MASK)) | LPSPI_FCR_RXWATER(readRegRemainingTimes - 1U); - } - - /* RX request and FIFO overflow request enable */ - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_RxInterruptEnable | (uint32_t)kLPSPI_ReceiveErrorInterruptEnable); - } - else - { - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_TxInterruptEnable); - } - - if (handle->txData != NULL) - { - /* TX FIFO underflow request enable */ - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_TransmitErrorInterruptEnable); - } - - return kStatus_Success; -} - -static void LPSPI_SlaveTransferFillUpTxFifo(LPSPI_Type *base, lpspi_slave_handle_t *handle) -{ - assert(handle != NULL); - - uint32_t wordToSend = 0U; - uint8_t bytesEachWrite = handle->bytesEachWrite; - bool isByteSwap = handle->isByteSwap; - - while (LPSPI_GetTxFifoCount(base) < (handle->fifoSize)) - { - if (handle->txRemainingByteCount < (size_t)bytesEachWrite) - { - handle->bytesEachWrite = (uint8_t)handle->txRemainingByteCount; - bytesEachWrite = handle->bytesEachWrite; - } - - wordToSend = LPSPI_CombineWriteData(handle->txData, bytesEachWrite, isByteSwap); - handle->txData += bytesEachWrite; - - /*Decrease the remaining TX byte count.*/ - handle->txRemainingByteCount -= (size_t)bytesEachWrite; - - /*Write the word to TX register*/ - LPSPI_WriteData(base, wordToSend); - - if (handle->txRemainingByteCount == 0U) - { - break; - } - } -} - -static void LPSPI_SlaveTransferComplete(LPSPI_Type *base, lpspi_slave_handle_t *handle) -{ - assert(handle != NULL); - - status_t status = kStatus_Success; - - /* Disable interrupt requests*/ - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_AllInterruptEnable); - - if (handle->state == (uint8_t)kLPSPI_Error) - { - status = kStatus_LPSPI_Error; - } - else - { - status = kStatus_Success; - } - - handle->state = (uint8_t)kLPSPI_Idle; - - if (handle->callback != NULL) - { - handle->callback(base, handle, status, handle->userData); - } -} - -/*! - * brief Gets the slave transfer remaining bytes. - * - * This function gets the slave transfer remaining bytes. - * - * param base LPSPI peripheral address. - * param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - * param count Number of bytes transferred so far by the non-blocking transaction. - * return status of status_t. - */ -status_t LPSPI_SlaveTransferGetCount(LPSPI_Type *base, lpspi_slave_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (handle->state != (uint8_t)kLPSPI_Busy) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - size_t remainingByte; - - if (handle->rxData != NULL) - { - remainingByte = handle->rxRemainingByteCount; - } - else - { - remainingByte = handle->txRemainingByteCount; - } - - *count = handle->totalByteCount - remainingByte; - - return kStatus_Success; -} - -/*! - * brief LPSPI slave aborts a transfer which uses an interrupt method. - * - * This function aborts a transfer which uses an interrupt method. - * - * param base LPSPI peripheral address. - * param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - */ -void LPSPI_SlaveTransferAbort(LPSPI_Type *base, lpspi_slave_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable interrupt requests*/ - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_TxInterruptEnable | (uint32_t)kLPSPI_RxInterruptEnable); - - LPSPI_Reset(base); - - handle->state = (uint8_t)kLPSPI_Idle; - handle->txRemainingByteCount = 0U; - handle->rxRemainingByteCount = 0U; -} - -/*! - * brief LPSPI Slave IRQ handler function. - * - * This function processes the LPSPI transmit and receives an IRQ. - * - * param base LPSPI peripheral address. - * param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - */ -void LPSPI_SlaveTransferHandleIRQ(LPSPI_Type *base, lpspi_slave_handle_t *handle) -{ - assert(handle != NULL); - - uint32_t readData; /* variable to store word read from RX FIFO */ - uint8_t bytesEachRead = handle->bytesEachRead; - bool isByteSwap = handle->isByteSwap; - uint32_t readRegRemainingTimes; - - if (handle->rxData != NULL) - { - if (handle->rxRemainingByteCount > 0U) - { - while (LPSPI_GetRxFifoCount(base) != 0U) - { - /*Read out the data*/ - readData = LPSPI_ReadData(base); - - /*Decrease the read RX register times.*/ - --handle->readRegRemainingTimes; - - if (handle->rxRemainingByteCount < (size_t)bytesEachRead) - { - handle->bytesEachRead = (uint8_t)handle->rxRemainingByteCount; - bytesEachRead = handle->bytesEachRead; - } - - LPSPI_SeparateReadData(handle->rxData, readData, bytesEachRead, isByteSwap); - handle->rxData += bytesEachRead; - - /*Decrease the remaining RX byte count.*/ - handle->rxRemainingByteCount -= (size_t)bytesEachRead; - - if ((handle->txRemainingByteCount > 0U) && (handle->txData != NULL)) - { - LPSPI_SlaveTransferFillUpTxFifo(base, handle); - } - - if (handle->rxRemainingByteCount == 0U) - { - break; - } - } - } - - /*Set rxWatermark to (readRegRemainingTimes-1) if readRegRemainingTimes less than rxWatermark. Otherwise there - *is not RX interrupt for the last datas because the RX count is not greater than rxWatermark. - */ - readRegRemainingTimes = handle->readRegRemainingTimes; - if (readRegRemainingTimes <= (uint32_t)handle->rxWatermark) - { - base->FCR = (base->FCR & (~LPSPI_FCR_RXWATER_MASK)) | - LPSPI_FCR_RXWATER((readRegRemainingTimes > 1U) ? (readRegRemainingTimes - 1U) : (0U)); - } - } - if ((handle->rxData == NULL) && (handle->txRemainingByteCount != 0U) && (handle->txData != NULL)) - { - LPSPI_SlaveTransferFillUpTxFifo(base, handle); - } - - if ((handle->txRemainingByteCount == 0U) && (handle->rxRemainingByteCount == 0U)) - { - /* If no RX buffer, then transfer is not complete until transfer complete flag sets and the TX FIFO empty*/ - if (handle->rxData == NULL) - { - if (((LPSPI_GetStatusFlags(base) & (uint32_t)kLPSPI_FrameCompleteFlag) != 0U) && - (LPSPI_GetTxFifoCount(base) == 0U)) - { - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_FrameCompleteFlag); - /* Complete the transfer and disable the interrupts */ - LPSPI_SlaveTransferComplete(base, handle); - } - else - { - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_FrameCompleteFlag); - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_FrameCompleteInterruptEnable); - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_TxInterruptEnable | (uint32_t)kLPSPI_RxInterruptEnable); - } - } - else - { - /* Complete the transfer and disable the interrupts */ - LPSPI_SlaveTransferComplete(base, handle); - } - } - - /* Catch tx fifo underflow conditions, service only if tx under flow interrupt enabled */ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_c_ref_4$ - */ - if (((LPSPI_GetStatusFlags(base) & (uint32_t)kLPSPI_TransmitErrorFlag) != 0U) && - ((base->IER & LPSPI_IER_TEIE_MASK) != 0U)) - { - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_TransmitErrorFlag); - /* Change state to error and clear flag */ - if (handle->txData != NULL) - { - handle->state = (uint8_t)kLPSPI_Error; - } - handle->errorCount++; - /* ERR051588: Clear FIFO after underrun occurs */ - LPSPI_FlushFifo(base, true, false); - } - /* Catch rx fifo overflow conditions, service only if rx over flow interrupt enabled */ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_c_ref_4$ - */ - if (((LPSPI_GetStatusFlags(base) & (uint32_t)kLPSPI_ReceiveErrorFlag) != 0U) && - ((base->IER & LPSPI_IER_REIE_MASK) != 0U)) - { - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_ReceiveErrorFlag); - /* Change state to error and clear flag */ - /* - * $Branch Coverage Justification$ - * This error happens on receive, so rxData won't be empty.(will improve) - */ - if (handle->rxData != NULL) - { - handle->state = (uint8_t)kLPSPI_Error; - } - handle->errorCount++; - } -} - -static uint32_t LPSPI_CombineWriteData(const uint8_t *txData, uint8_t bytesEachWrite, bool isByteSwap) -{ - assert(txData != NULL); - - uint32_t wordToSend = 0U; - - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_c_ref_1$ - */ - switch (bytesEachWrite) - { - case 1: - wordToSend = *txData; - ++txData; - break; - - case 2: - if (!isByteSwap) - { - wordToSend = *txData; - ++txData; - wordToSend |= (unsigned)(*txData) << 8U; - ++txData; - } - else - { - wordToSend = (unsigned)(*txData) << 8U; - ++txData; - wordToSend |= *txData; - ++txData; - } - - break; - - case 3: - if (!isByteSwap) - { - wordToSend = *txData; - ++txData; - wordToSend |= (unsigned)(*txData) << 8U; - ++txData; - wordToSend |= (unsigned)(*txData) << 16U; - ++txData; - } - else - { - wordToSend = (unsigned)(*txData) << 16U; - ++txData; - wordToSend |= (unsigned)(*txData) << 8U; - ++txData; - wordToSend |= *txData; - ++txData; - } - break; - - case 4: - if (!isByteSwap) - { - wordToSend = *txData; - ++txData; - wordToSend |= (unsigned)(*txData) << 8U; - ++txData; - wordToSend |= (unsigned)(*txData) << 16U; - ++txData; - wordToSend |= (unsigned)(*txData) << 24U; - ++txData; - } - else - { - wordToSend = (unsigned)(*txData) << 24U; - ++txData; - wordToSend |= (unsigned)(*txData) << 16U; - ++txData; - wordToSend |= (unsigned)(*txData) << 8U; - ++txData; - wordToSend |= *txData; - ++txData; - } - break; - - default: - assert(false); - break; - } - return wordToSend; -} - -static void LPSPI_SeparateReadData(uint8_t *rxData, uint32_t readData, uint8_t bytesEachRead, bool isByteSwap) -{ - assert(rxData != NULL); - - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_c_ref_1$ - */ - switch (bytesEachRead) - { - case 1: - *rxData = (uint8_t)readData; - ++rxData; - break; - - case 2: - if (!isByteSwap) - { - *rxData = (uint8_t)readData; - ++rxData; - *rxData = (uint8_t)(readData >> 8); - ++rxData; - } - else - { - *rxData = (uint8_t)(readData >> 8); - ++rxData; - *rxData = (uint8_t)readData; - ++rxData; - } - break; - - case 3: - if (!isByteSwap) - { - *rxData = (uint8_t)readData; - ++rxData; - *rxData = (uint8_t)(readData >> 8); - ++rxData; - *rxData = (uint8_t)(readData >> 16); - ++rxData; - } - else - { - *rxData = (uint8_t)(readData >> 16); - ++rxData; - *rxData = (uint8_t)(readData >> 8); - ++rxData; - *rxData = (uint8_t)readData; - ++rxData; - } - break; - - case 4: - if (!isByteSwap) - { - *rxData = (uint8_t)readData; - ++rxData; - *rxData = (uint8_t)(readData >> 8); - ++rxData; - *rxData = (uint8_t)(readData >> 16); - ++rxData; - *rxData = (uint8_t)(readData >> 24); - ++rxData; - } - else - { - *rxData = (uint8_t)(readData >> 24); - ++rxData; - *rxData = (uint8_t)(readData >> 16); - ++rxData; - *rxData = (uint8_t)(readData >> 8); - ++rxData; - *rxData = (uint8_t)readData; - ++rxData; - } - break; - - default: - assert(false); - break; - } -} - -/*! - * brief Wait for tx FIFO to be empty. - * Wait the tx fifo empty when set TCR register - * param base LPSPI peripheral address. - * return true for the tx FIFO is ready, false is not. - */ -bool LPSPI_WaitTxFifoEmpty(LPSPI_Type *base) -{ -#if SPI_RETRY_TIMES - uint32_t waitTimes = SPI_RETRY_TIMES; - while (((uint8_t)LPSPI_GetTxFifoCount(base) != 0U) && (--waitTimes != 0U)) -#else - while ((uint8_t)LPSPI_GetTxFifoCount(base) != 0U) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return false; - } -#endif - return true; -} - -static void LPSPI_CommonIRQHandler(LPSPI_Type *base, void *param) -{ - if (LPSPI_IsMaster(base)) - { - s_lpspiMasterIsr(base, (lpspi_master_handle_t *)param); - } - else - { - s_lpspiSlaveIsr(base, (lpspi_slave_handle_t *)param); - } - SDK_ISR_EXIT_BARRIER; -} - -#if defined(LPSPI0) -void LPSPI0_DriverIRQHandler(void); -void LPSPI0_DriverIRQHandler(void) -{ - assert(s_lpspiHandle[0] != NULL); - LPSPI_CommonIRQHandler(LPSPI0, s_lpspiHandle[0]); -} -#endif - -#if defined(LPSPI1) -void LPSPI1_DriverIRQHandler(void); -void LPSPI1_DriverIRQHandler(void) -{ - assert(s_lpspiHandle[1] != NULL); - LPSPI_CommonIRQHandler(LPSPI1, s_lpspiHandle[1]); -} -#endif - -#if defined(LPSPI2) -void LPSPI2_DriverIRQHandler(void); -void LPSPI2_DriverIRQHandler(void) -{ - assert(s_lpspiHandle[2] != NULL); - LPSPI_CommonIRQHandler(LPSPI2, s_lpspiHandle[2]); -} -#endif - -#if defined(LPSPI3) -void LPSPI3_DriverIRQHandler(void); -void LPSPI3_DriverIRQHandler(void) -{ - assert(s_lpspiHandle[3] != NULL); - LPSPI_CommonIRQHandler(LPSPI3, s_lpspiHandle[3]); -} -#endif - -#if defined(LPSPI4) -void LPSPI4_DriverIRQHandler(void); -void LPSPI4_DriverIRQHandler(void) -{ - assert(s_lpspiHandle[4] != NULL); - LPSPI_CommonIRQHandler(LPSPI4, s_lpspiHandle[4]); -} -#endif - -#if defined(LPSPI5) -void LPSPI5_DriverIRQHandler(void); -void LPSPI5_DriverIRQHandler(void) -{ - assert(s_lpspiHandle[5] != NULL); - LPSPI_CommonIRQHandler(LPSPI5, s_lpspiHandle[5]); -} -#endif - -#if defined(LPSPI6) -void LPSPI6_DriverIRQHandler(void); -void LPSPI6_DriverIRQHandler(void) -{ - assert(s_lpspiHandle[6] != NULL); - LPSPI_CommonIRQHandler(LPSPI6, s_lpspiHandle[6]); -} -#endif - -#if defined(DMA__LPSPI0) -void DMA_SPI0_INT_DriverIRQHandler(void); -void DMA_SPI0_INT_DriverIRQHandler(void) -{ - assert(s_lpspiHandle[LPSPI_GetInstance(DMA__LPSPI0)] != NULL); - LPSPI_CommonIRQHandler(DMA__LPSPI0, s_lpspiHandle[LPSPI_GetInstance(DMA__LPSPI0)]); -} -#endif - -#if defined(DMA__LPSPI1) -void DMA_SPI1_INT_DriverIRQHandler(void); -void DMA_SPI1_INT_DriverIRQHandler(void) -{ - assert(s_lpspiHandle[LPSPI_GetInstance(DMA__LPSPI1)] != NULL); - LPSPI_CommonIRQHandler(DMA__LPSPI1, s_lpspiHandle[LPSPI_GetInstance(DMA__LPSPI1)]); -} -#endif -#if defined(DMA__LPSPI2) -void DMA_SPI2_INT_DriverIRQHandler(void); -void DMA_SPI2_INT_DriverIRQHandler(void) -{ - assert(s_lpspiHandle[LPSPI_GetInstance(DMA__LPSPI2)] != NULL); - LPSPI_CommonIRQHandler(DMA__LPSPI2, s_lpspiHandle[LPSPI_GetInstance(DMA__LPSPI2)]); -} -#endif - -#if defined(DMA__LPSPI3) -void DMA_SPI3_INT_DriverIRQHandler(void); -void DMA_SPI3_INT_DriverIRQHandler(void) -{ - assert(s_lpspiHandle[LPSPI_GetInstance(DMA__LPSPI3)] != NULL); - LPSPI_CommonIRQHandler(DMA__LPSPI3, s_lpspiHandle[LPSPI_GetInstance(DMA__LPSPI3)]); -} -#endif - -#if defined(ADMA__LPSPI0) -void ADMA_SPI0_INT_DriverIRQHandler(void); -void ADMA_SPI0_INT_DriverIRQHandler(void) -{ - assert(s_lpspiHandle[LPSPI_GetInstance(ADMA__LPSPI0)] != NULL); - LPSPI_CommonIRQHandler(ADMA__LPSPI0, s_lpspiHandle[LPSPI_GetInstance(ADMA__LPSPI0)]); -} -#endif - -#if defined(ADMA__LPSPI1) -void ADMA_SPI1_INT_DriverIRQHandler(void); -void ADMA_SPI1_INT_DriverIRQHandler(void) -{ - assert(s_lpspiHandle[LPSPI_GetInstance(ADMA__LPSPI1)] != NULL); - LPSPI_CommonIRQHandler(ADMA__LPSPI1, s_lpspiHandle[LPSPI_GetInstance(ADMA__LPSPI1)]); -} -#endif -#if defined(ADMA__LPSPI2) -void ADMA_SPI2_INT_DriverIRQHandler(void); -void ADMA_SPI2_INT_DriverIRQHandler(void) -{ - assert(s_lpspiHandle[LPSPI_GetInstance(ADMA__LPSPI2)] != NULL); - LPSPI_CommonIRQHandler(ADMA__LPSPI2, s_lpspiHandle[LPSPI_GetInstance(ADMA__LPSPI2)]); -} -#endif - -#if defined(ADMA__LPSPI3) -void ADMA_SPI3_INT_DriverIRQHandler(void); -void ADMA_SPI3_INT_DriverIRQHandler(void) -{ - assert(s_lpspiHandle[LPSPI_GetInstance(ADMA__LPSPI3)] != NULL); - LPSPI_CommonIRQHandler(ADMA__LPSPI3, s_lpspiHandle[LPSPI_GetInstance(ADMA__LPSPI3)]); -} -#endif diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpspi.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpspi.h deleted file mode 100644 index 517179054aa..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpspi.h +++ /dev/null @@ -1,1231 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2023, 2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LPSPI_H_ -#define FSL_LPSPI_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup lpspi_driver - * @{ - */ - -/********************************************************************************************************************** - * Definitions - *********************************************************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief LPSPI driver version. */ -#define FSL_LPSPI_DRIVER_VERSION (MAKE_VERSION(2, 6, 8)) -/*! @} */ - -#ifndef LPSPI_DUMMY_DATA -/*! @brief LPSPI dummy data if no Tx data.*/ -#define LPSPI_DUMMY_DATA (0x00U) /*!< Dummy data used for tx if there is not txData. */ -#endif - -/*! @brief Retry times for waiting flag. */ -#ifndef SPI_RETRY_TIMES -#define SPI_RETRY_TIMES 0U /* Define to zero means keep waiting until the flag is assert/deassert. */ -#endif - -/*! @brief Global variable for dummy data value setting. */ -extern volatile uint8_t g_lpspiDummyData[]; - -/*! @brief Status for the LPSPI driver.*/ -enum -{ - kStatus_LPSPI_Busy = MAKE_STATUS(kStatusGroup_LPSPI, 0), /*!< LPSPI transfer is busy.*/ - kStatus_LPSPI_Error = MAKE_STATUS(kStatusGroup_LPSPI, 1), /*!< LPSPI driver error. */ - kStatus_LPSPI_Idle = MAKE_STATUS(kStatusGroup_LPSPI, 2), /*!< LPSPI is idle.*/ - kStatus_LPSPI_OutOfRange = MAKE_STATUS(kStatusGroup_LPSPI, 3), /*!< LPSPI transfer out Of range. */ - kStatus_LPSPI_Timeout = MAKE_STATUS(kStatusGroup_LPSPI, 4) /*!< LPSPI timeout polling status flags. */ -}; - -/*! @brief LPSPI status flags in SPIx_SR register.*/ -enum _lpspi_flags -{ - kLPSPI_TxDataRequestFlag = LPSPI_SR_TDF_MASK, /*!< Transmit data flag */ - kLPSPI_RxDataReadyFlag = LPSPI_SR_RDF_MASK, /*!< Receive data flag */ - kLPSPI_WordCompleteFlag = LPSPI_SR_WCF_MASK, /*!< Word Complete flag */ - kLPSPI_FrameCompleteFlag = LPSPI_SR_FCF_MASK, /*!< Frame Complete flag */ - kLPSPI_TransferCompleteFlag = LPSPI_SR_TCF_MASK, /*!< Transfer Complete flag */ - kLPSPI_TransmitErrorFlag = LPSPI_SR_TEF_MASK, /*!< Transmit Error flag (FIFO underrun) */ - kLPSPI_ReceiveErrorFlag = LPSPI_SR_REF_MASK, /*!< Receive Error flag (FIFO overrun) */ - kLPSPI_DataMatchFlag = LPSPI_SR_DMF_MASK, /*!< Data Match flag */ - kLPSPI_ModuleBusyFlag = LPSPI_SR_MBF_MASK, /*!< Module Busy flag */ - kLPSPI_AllStatusFlag = (LPSPI_SR_TDF_MASK | LPSPI_SR_RDF_MASK | LPSPI_SR_WCF_MASK | LPSPI_SR_FCF_MASK | - LPSPI_SR_TCF_MASK | LPSPI_SR_TEF_MASK | LPSPI_SR_REF_MASK | LPSPI_SR_DMF_MASK | - LPSPI_SR_MBF_MASK) /*!< Used for clearing all w1c status flags */ -}; - -/*! @brief LPSPI interrupt source.*/ -enum _lpspi_interrupt_enable -{ - kLPSPI_TxInterruptEnable = LPSPI_IER_TDIE_MASK, /*!< Transmit data interrupt enable */ - kLPSPI_RxInterruptEnable = LPSPI_IER_RDIE_MASK, /*!< Receive data interrupt enable */ - kLPSPI_WordCompleteInterruptEnable = LPSPI_IER_WCIE_MASK, /*!< Word complete interrupt enable */ - kLPSPI_FrameCompleteInterruptEnable = LPSPI_IER_FCIE_MASK, /*!< Frame complete interrupt enable */ - kLPSPI_TransferCompleteInterruptEnable = LPSPI_IER_TCIE_MASK, /*!< Transfer complete interrupt enable */ - kLPSPI_TransmitErrorInterruptEnable = LPSPI_IER_TEIE_MASK, /*!< Transmit error interrupt enable(FIFO underrun)*/ - kLPSPI_ReceiveErrorInterruptEnable = LPSPI_IER_REIE_MASK, /*!< Receive Error interrupt enable (FIFO overrun) */ - kLPSPI_DataMatchInterruptEnable = LPSPI_IER_DMIE_MASK, /*!< Data Match interrupt enable */ - kLPSPI_AllInterruptEnable = - (LPSPI_IER_TDIE_MASK | LPSPI_IER_RDIE_MASK | LPSPI_IER_WCIE_MASK | LPSPI_IER_FCIE_MASK | LPSPI_IER_TCIE_MASK | - LPSPI_IER_TEIE_MASK | LPSPI_IER_REIE_MASK | LPSPI_IER_DMIE_MASK) /*!< All above interrupts enable.*/ -}; - -/*! @brief LPSPI DMA source.*/ -enum _lpspi_dma_enable -{ - kLPSPI_TxDmaEnable = LPSPI_DER_TDDE_MASK, /*!< Transmit data DMA enable */ - kLPSPI_RxDmaEnable = LPSPI_DER_RDDE_MASK /*!< Receive data DMA enable */ -}; - -/*! @brief LPSPI master or slave mode configuration.*/ -typedef enum _lpspi_master_slave_mode -{ - kLPSPI_Master = 1U, /*!< LPSPI peripheral operates in master mode.*/ - kLPSPI_Slave = 0U /*!< LPSPI peripheral operates in slave mode.*/ -} lpspi_master_slave_mode_t; - -/*! @brief LPSPI Peripheral Chip Select (PCS) configuration (which PCS to configure).*/ -typedef enum _lpspi_which_pcs_config -{ - kLPSPI_Pcs0 = 0U, /*!< PCS[0] */ - kLPSPI_Pcs1 = 1U, /*!< PCS[1] */ - kLPSPI_Pcs2 = 2U, /*!< PCS[2] */ - kLPSPI_Pcs3 = 3U /*!< PCS[3] */ -} lpspi_which_pcs_t; - -/*! @brief LPSPI Peripheral Chip Select (PCS) Polarity configuration.*/ -typedef enum _lpspi_pcs_polarity_config -{ - kLPSPI_PcsActiveHigh = 1U, /*!< PCS Active High (idles low) */ - kLPSPI_PcsActiveLow = 0U /*!< PCS Active Low (idles high) */ -} lpspi_pcs_polarity_config_t; - -/*! @brief LPSPI Peripheral Chip Select (PCS) Polarity.*/ -enum _lpspi_pcs_polarity -{ - kLPSPI_Pcs0ActiveLow = 1U << 0, /*!< Pcs0 Active Low (idles high). */ - kLPSPI_Pcs1ActiveLow = 1U << 1, /*!< Pcs1 Active Low (idles high). */ - kLPSPI_Pcs2ActiveLow = 1U << 2, /*!< Pcs2 Active Low (idles high). */ - kLPSPI_Pcs3ActiveLow = 1U << 3, /*!< Pcs3 Active Low (idles high). */ - kLPSPI_PcsAllActiveLow = 0xFU /*!< Pcs0 to Pcs5 Active Low (idles high). */ -}; - -/*! @brief LPSPI clock polarity configuration.*/ -typedef enum _lpspi_clock_polarity -{ - kLPSPI_ClockPolarityActiveHigh = 0U, /*!< CPOL=0. Active-high LPSPI clock (idles low)*/ - kLPSPI_ClockPolarityActiveLow = 1U /*!< CPOL=1. Active-low LPSPI clock (idles high)*/ -} lpspi_clock_polarity_t; - -/*! @brief LPSPI clock phase configuration.*/ -typedef enum _lpspi_clock_phase -{ - kLPSPI_ClockPhaseFirstEdge = 0U, /*!< CPHA=0. Data is captured on the leading edge of the SCK and changed on the - following edge.*/ - kLPSPI_ClockPhaseSecondEdge = 1U /*!< CPHA=1. Data is changed on the leading edge of the SCK and captured on the - following edge.*/ -} lpspi_clock_phase_t; - -/*! @brief LPSPI data shifter direction options.*/ -typedef enum _lpspi_shift_direction -{ - kLPSPI_MsbFirst = 0U, /*!< Data transfers start with most significant bit.*/ - kLPSPI_LsbFirst = 1U /*!< Data transfers start with least significant bit.*/ -} lpspi_shift_direction_t; - -/*! @brief LPSPI Host Request select configuration. */ -typedef enum _lpspi_host_request_select -{ - kLPSPI_HostReqExtPin = 0U, /*!< Host Request is an ext pin. */ - kLPSPI_HostReqInternalTrigger = 1U /*!< Host Request is an internal trigger. */ -} lpspi_host_request_select_t; - -/*! @brief LPSPI Match configuration options. */ -typedef enum _lpspi_match_config -{ - kLPSI_MatchDisabled = 0x0U, /*!< LPSPI Match Disabled. */ - kLPSI_1stWordEqualsM0orM1 = 0x2U, /*!< LPSPI Match Enabled. */ - kLPSI_AnyWordEqualsM0orM1 = 0x3U, /*!< LPSPI Match Enabled. */ - kLPSI_1stWordEqualsM0and2ndWordEqualsM1 = 0x4U, /*!< LPSPI Match Enabled. */ - kLPSI_AnyWordEqualsM0andNxtWordEqualsM1 = 0x5U, /*!< LPSPI Match Enabled. */ - kLPSI_1stWordAndM1EqualsM0andM1 = 0x6U, /*!< LPSPI Match Enabled. */ - kLPSI_AnyWordAndM1EqualsM0andM1 = 0x7U, /*!< LPSPI Match Enabled. */ -} lpspi_match_config_t; - -/*! @brief LPSPI pin (SDO and SDI) configuration. */ -typedef enum _lpspi_pin_config -{ - kLPSPI_SdiInSdoOut = 0U, /*!< LPSPI SDI input, SDO output. */ - kLPSPI_SdiInSdiOut = 1U, /*!< LPSPI SDI input, SDI output. */ - kLPSPI_SdoInSdoOut = 2U, /*!< LPSPI SDO input, SDO output. */ - kLPSPI_SdoInSdiOut = 3U /*!< LPSPI SDO input, SDI output. */ -} lpspi_pin_config_t; - -/*! @brief LPSPI data output configuration. */ -typedef enum _lpspi_data_out_config -{ - kLpspiDataOutRetained = 0U, /*!< Data out retains last value when chip select is de-asserted */ - kLpspiDataOutTristate = 1U /*!< Data out is tristated when chip select is de-asserted */ -} lpspi_data_out_config_t; - -#if !(defined(FSL_FEATURE_LPSPI_HAS_NO_PCSCFG) && FSL_FEATURE_LPSPI_HAS_NO_PCSCFG) -/*! @brief LPSPI cs function configuration. */ -typedef enum _lpspi_pcs_function_config -{ - kLPSPI_PcsAsCs = 0U, /*!< PCS pin select as cs function */ - kLPSPI_PcsAsData = 1U, /*!< PCS pin select as date function */ -} lpspi_pcs_function_config_t; -#endif - -/*! @brief LPSPI transfer width configuration. */ -typedef enum _lpspi_transfer_width -{ - kLPSPI_SingleBitXfer = 0U, /*!< 1-bit shift at a time, data out on SDO, in on SDI (normal mode) */ - kLPSPI_TwoBitXfer = 1U, /*!< 2-bits shift out on SDO/SDI and in on SDO/SDI */ - kLPSPI_FourBitXfer = 2U /*!< 4-bits shift out on SDO/SDI/PCS[3:2] and in on SDO/SDI/PCS[3:2] */ -} lpspi_transfer_width_t; - -/*! @brief LPSPI delay type selection.*/ -typedef enum _lpspi_delay_type -{ - kLPSPI_PcsToSck = 1U, /*!< PCS-to-SCK delay. */ - kLPSPI_LastSckToPcs, /*!< Last SCK edge to PCS delay. */ - kLPSPI_BetweenTransfer /*!< Delay between transfers. */ -} lpspi_delay_type_t; - -#define LPSPI_MASTER_PCS_SHIFT (4U) /*!< LPSPI master PCS shift macro , internal used. */ -#define LPSPI_MASTER_PCS_MASK (0xF0U) /*!< LPSPI master PCS shift macro , internal used. */ -#if !(defined(FSL_FEATURE_LPSPI_HAS_NO_MULTI_WIDTH) && FSL_FEATURE_LPSPI_HAS_NO_MULTI_WIDTH) -#define LPSPI_MASTER_WIDTH_SHIFT (16U) /*!< LPSPI master width shift macro, internal used */ -#define LPSPI_MASTER_WIDTH_MASK (0x30000U) /*!< LPSPI master width shift mask, internal used */ -#endif - -/*! @brief Use this enumeration for LPSPI master transfer configFlags. */ -enum _lpspi_transfer_config_flag_for_master -{ - kLPSPI_MasterPcs0 = 0U << LPSPI_MASTER_PCS_SHIFT, /*!< LPSPI master transfer use PCS0 signal */ - kLPSPI_MasterPcs1 = 1U << LPSPI_MASTER_PCS_SHIFT, /*!< LPSPI master transfer use PCS1 signal */ - kLPSPI_MasterPcs2 = 2U << LPSPI_MASTER_PCS_SHIFT, /*!< LPSPI master transfer use PCS2 signal */ - kLPSPI_MasterPcs3 = 3U << LPSPI_MASTER_PCS_SHIFT, /*!< LPSPI master transfer use PCS3 signal */ -#if !(defined(FSL_FEATURE_LPSPI_HAS_NO_MULTI_WIDTH) && FSL_FEATURE_LPSPI_HAS_NO_MULTI_WIDTH) - kLPSPI_MasterWidth1 = 0U << LPSPI_MASTER_WIDTH_SHIFT, /*!< LPSPI master transfer 1bit */ - kLPSPI_MasterWidth2 = 1U << LPSPI_MASTER_WIDTH_SHIFT, /*!< LPSPI master transfer 2bit */ - kLPSPI_MasterWidth4 = 2U << LPSPI_MASTER_WIDTH_SHIFT, /*!< LPSPI master transfer 4bit */ -#endif - - kLPSPI_MasterPcsContinuous = 1U << 20, /*!< Is PCS signal continuous */ - - kLPSPI_MasterByteSwap = - 1U << 22 /*!< Is master swap the byte. - * For example, when want to send data 1 2 3 4 5 6 7 8 (suppose you set - * lpspi_shift_direction_t to MSB). - * 1. If you set bitPerFrame = 8 , no matter the kLPSPI_MasterByteSwapyou flag is used - * or not, the waveform is 1 2 3 4 5 6 7 8. - * 2. If you set bitPerFrame = 16 : - * (1) the waveform is 2 1 4 3 6 5 8 7 if you do not use the kLPSPI_MasterByteSwap flag. - * (2) the waveform is 1 2 3 4 5 6 7 8 if you use the kLPSPI_MasterByteSwap flag. - * 3. If you set bitPerFrame = 32 : - * (1) the waveform is 4 3 2 1 8 7 6 5 if you do not use the kLPSPI_MasterByteSwap flag. - * (2) the waveform is 1 2 3 4 5 6 7 8 if you use the kLPSPI_MasterByteSwap flag. - */ -}; - -#define LPSPI_SLAVE_PCS_SHIFT (4U) /*!< LPSPI slave PCS shift macro , internal used. */ -#define LPSPI_SLAVE_PCS_MASK (0xF0U) /*!< LPSPI slave PCS shift macro , internal used. */ - -/*! @brief Use this enumeration for LPSPI slave transfer configFlags. */ -enum _lpspi_transfer_config_flag_for_slave -{ - kLPSPI_SlavePcs0 = 0U << LPSPI_SLAVE_PCS_SHIFT, /*!< LPSPI slave transfer use PCS0 signal */ - kLPSPI_SlavePcs1 = 1U << LPSPI_SLAVE_PCS_SHIFT, /*!< LPSPI slave transfer use PCS1 signal */ - kLPSPI_SlavePcs2 = 2U << LPSPI_SLAVE_PCS_SHIFT, /*!< LPSPI slave transfer use PCS2 signal */ - kLPSPI_SlavePcs3 = 3U << LPSPI_SLAVE_PCS_SHIFT, /*!< LPSPI slave transfer use PCS3 signal */ - - kLPSPI_SlaveByteSwap = - 1U << 22 /*!< Is slave swap the byte. - * For example, when want to send data 1 2 3 4 5 6 7 8 (suppose you set - * lpspi_shift_direction_t to MSB). - * 1. If you set bitPerFrame = 8 , no matter the kLPSPI_SlaveByteSwap flag is used - * or not, the waveform is 1 2 3 4 5 6 7 8. - * 2. If you set bitPerFrame = 16 : - * (1) the waveform is 2 1 4 3 6 5 8 7 if you do not use the kLPSPI_SlaveByteSwap flag. - * (2) the waveform is 1 2 3 4 5 6 7 8 if you use the kLPSPI_SlaveByteSwap flag. - * 3. If you set bitPerFrame = 32 : - * (1) the waveform is 4 3 2 1 8 7 6 5 if you do not use the kLPSPI_SlaveByteSwap flag. - * (2) the waveform is 1 2 3 4 5 6 7 8 if you use the kLPSPI_SlaveByteSwap flag. - */ -}; - -/*! @brief LPSPI transfer state, which is used for LPSPI transactional API state machine. */ -enum _lpspi_transfer_state -{ - kLPSPI_Idle = 0x0U, /*!< Nothing in the transmitter/receiver. */ - kLPSPI_Busy, /*!< Transfer queue is not finished. */ - kLPSPI_Error /*!< Transfer error. */ -}; - -/*! @brief LPSPI master configuration structure.*/ -typedef struct _lpspi_master_config -{ - uint32_t baudRate; /*!< Baud Rate for LPSPI. */ - uint32_t bitsPerFrame; /*!< Bits per frame, minimum 8, maximum 4096.*/ - lpspi_clock_polarity_t cpol; /*!< Clock polarity. */ - lpspi_clock_phase_t cpha; /*!< Clock phase. */ - lpspi_shift_direction_t direction; /*!< MSB or LSB data shift direction. */ - - uint32_t pcsToSckDelayInNanoSec; /*!< PCS to SCK delay time in nanoseconds, setting to 0 sets the minimum delay. - It sets the boundary value if out of range.*/ - uint32_t lastSckToPcsDelayInNanoSec; /*!< Last SCK to PCS delay time in nanoseconds, setting to 0 sets the minimum - delay. It sets the boundary value if out of range.*/ - uint32_t betweenTransferDelayInNanoSec; /*!< After the SCK delay time with nanoseconds, setting to 0 sets the - minimum delay. It sets the boundary value if out of range.*/ - - lpspi_which_pcs_t whichPcs; /*!< Desired Peripheral Chip Select (PCS). */ - lpspi_pcs_polarity_config_t pcsActiveHighOrLow; /*!< Desired PCS active high or low */ - - lpspi_pin_config_t pinCfg; /*!< Configures which pins are used for input and output data - *during single bit transfers.*/ - -#if !(defined(FSL_FEATURE_LPSPI_HAS_NO_PCSCFG) && FSL_FEATURE_LPSPI_HAS_NO_PCSCFG) - lpspi_pcs_function_config_t pcsFunc; /*!< Configures cs pins function.*/ -#endif - lpspi_data_out_config_t dataOutConfig; /*!< Configures if the output data is tristated - * between accesses (LPSPI_PCS is negated). */ - bool enableInputDelay; /*!< Enable master to sample the input data on a delayed SCK. This can help improve slave - setup time. Refer to device data sheet for specific time length. */ -} lpspi_master_config_t; - -/*! @brief LPSPI slave configuration structure.*/ -typedef struct _lpspi_slave_config -{ - uint32_t bitsPerFrame; /*!< Bits per frame, minimum 8, maximum 4096.*/ - lpspi_clock_polarity_t cpol; /*!< Clock polarity. */ - lpspi_clock_phase_t cpha; /*!< Clock phase. */ - lpspi_shift_direction_t direction; /*!< MSB or LSB data shift direction. */ - - lpspi_which_pcs_t whichPcs; /*!< Desired Peripheral Chip Select (pcs) */ - lpspi_pcs_polarity_config_t pcsActiveHighOrLow; /*!< Desired PCS active high or low */ - - lpspi_pin_config_t pinCfg; /*!< Configures which pins are used for input and output data - *during single bit transfers.*/ - - lpspi_data_out_config_t dataOutConfig; /*!< Configures if the output data is tristated - * between accesses (LPSPI_PCS is negated). */ -} lpspi_slave_config_t; - -/*! - * @brief Forward declaration of the _lpspi_master_handle typedefs. - */ -typedef struct _lpspi_master_handle lpspi_master_handle_t; - -/*! - * @brief Forward declaration of the _lpspi_slave_handle typedefs. - */ -typedef struct _lpspi_slave_handle lpspi_slave_handle_t; - -/*! - * @brief Master completion callback function pointer type. - * - * @param base LPSPI peripheral address. - * @param handle Pointer to the handle for the LPSPI master. - * @param status Success or error code describing whether the transfer is completed. - * @param userData Arbitrary pointer-dataSized value passed from the application. - */ -typedef void (*lpspi_master_transfer_callback_t)(LPSPI_Type *base, - lpspi_master_handle_t *handle, - status_t status, - void *userData); - -/*! - * @brief Slave completion callback function pointer type. - * - * @param base LPSPI peripheral address. - * @param handle Pointer to the handle for the LPSPI slave. - * @param status Success or error code describing whether the transfer is completed. - * @param userData Arbitrary pointer-dataSized value passed from the application. - */ -typedef void (*lpspi_slave_transfer_callback_t)(LPSPI_Type *base, - lpspi_slave_handle_t *handle, - status_t status, - void *userData); - -/*! @brief LPSPI master/slave transfer structure.*/ -typedef struct _lpspi_transfer -{ - const uint8_t *txData; /*!< Send buffer. */ - uint8_t *rxData; /*!< Receive buffer. */ - volatile size_t dataSize; /*!< Transfer bytes. */ - - uint32_t configFlags; /*!< Transfer transfer configuration flags. Set from _lpspi_transfer_config_flag_for_master if - the transfer is used for master or _lpspi_transfer_config_flag_for_slave enumeration if the - transfer is used for slave.*/ -} lpspi_transfer_t; - -/*! @brief LPSPI master transfer handle structure used for transactional API. */ -struct _lpspi_master_handle -{ - volatile bool isPcsContinuous; /*!< Is PCS continuous in transfer. */ - volatile bool writeTcrInIsr; /*!< A flag that whether should write TCR in ISR. */ - - volatile bool isByteSwap; /*!< A flag that whether should byte swap. */ - volatile bool isTxMask; /*!< A flag that whether TCR[TXMSK] is set. */ - volatile uint16_t bytesPerFrame; /*!< Number of bytes in each frame */ - - volatile uint8_t fifoSize; /*!< FIFO dataSize. */ - - volatile uint8_t rxWatermark; /*!< Rx watermark. */ - - volatile uint8_t bytesEachWrite; /*!< Bytes for each write TDR. */ - volatile uint8_t bytesEachRead; /*!< Bytes for each read RDR. */ - - const uint8_t *volatile txData; /*!< Send buffer. */ - uint8_t *volatile rxData; /*!< Receive buffer. */ - volatile size_t txRemainingByteCount; /*!< Number of bytes remaining to send.*/ - volatile size_t rxRemainingByteCount; /*!< Number of bytes remaining to receive.*/ - - volatile uint32_t writeRegRemainingTimes; /*!< Write TDR register remaining times. */ - volatile uint32_t readRegRemainingTimes; /*!< Read RDR register remaining times. */ - - uint32_t totalByteCount; /*!< Number of transfer bytes*/ - - uint32_t txBuffIfNull; /*!< Used if the txData is NULL. */ - - volatile uint8_t state; /*!< LPSPI transfer state , _lpspi_transfer_state.*/ - - lpspi_master_transfer_callback_t callback; /*!< Completion callback. */ - void *userData; /*!< Callback user data. */ -}; - -/*! @brief LPSPI slave transfer handle structure used for transactional API. */ -struct _lpspi_slave_handle -{ - volatile bool isByteSwap; /*!< A flag that whether should byte swap. */ - - volatile uint8_t fifoSize; /*!< FIFO dataSize. */ - - volatile uint8_t rxWatermark; /*!< Rx watermark. */ - - volatile uint8_t bytesEachWrite; /*!< Bytes for each write TDR. */ - volatile uint8_t bytesEachRead; /*!< Bytes for each read RDR. */ - - const uint8_t *volatile txData; /*!< Send buffer. */ - uint8_t *volatile rxData; /*!< Receive buffer. */ - - volatile size_t txRemainingByteCount; /*!< Number of bytes remaining to send.*/ - volatile size_t rxRemainingByteCount; /*!< Number of bytes remaining to receive.*/ - - volatile uint32_t writeRegRemainingTimes; /*!< Write TDR register remaining times. */ - volatile uint32_t readRegRemainingTimes; /*!< Read RDR register remaining times. */ - - uint32_t totalByteCount; /*!< Number of transfer bytes*/ - - volatile uint8_t state; /*!< LPSPI transfer state , _lpspi_transfer_state.*/ - - volatile uint32_t errorCount; /*!< Error count for slave transfer.*/ - - lpspi_slave_transfer_callback_t callback; /*!< Completion callback. */ - void *userData; /*!< Callback user data. */ -}; - -/********************************************************************************************************************** - * API - *********************************************************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus*/ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Initializes the LPSPI master. - * - * @param base LPSPI peripheral address. - * @param masterConfig Pointer to structure lpspi_master_config_t. - * @param srcClock_Hz Module source input clock in Hertz - */ -void LPSPI_MasterInit(LPSPI_Type *base, const lpspi_master_config_t *masterConfig, uint32_t srcClock_Hz); - -/*! - * @brief Sets the lpspi_master_config_t structure to default values. - * - * This API initializes the configuration structure for LPSPI_MasterInit(). - * The initialized structure can remain unchanged in LPSPI_MasterInit(), or can be modified - * before calling the LPSPI_MasterInit(). - * Example: - * @code - * lpspi_master_config_t masterConfig; - * LPSPI_MasterGetDefaultConfig(&masterConfig); - * @endcode - * @param masterConfig pointer to lpspi_master_config_t structure - */ -void LPSPI_MasterGetDefaultConfig(lpspi_master_config_t *masterConfig); - -/*! - * @brief LPSPI slave configuration. - * - * @param base LPSPI peripheral address. - * @param slaveConfig Pointer to a structure lpspi_slave_config_t. - */ -void LPSPI_SlaveInit(LPSPI_Type *base, const lpspi_slave_config_t *slaveConfig); - -/*! - * @brief Sets the lpspi_slave_config_t structure to default values. - * - * This API initializes the configuration structure for LPSPI_SlaveInit(). - * The initialized structure can remain unchanged in LPSPI_SlaveInit() or can be modified - * before calling the LPSPI_SlaveInit(). - * Example: - * @code - * lpspi_slave_config_t slaveConfig; - * LPSPI_SlaveGetDefaultConfig(&slaveConfig); - * @endcode - * @param slaveConfig pointer to lpspi_slave_config_t structure. - */ -void LPSPI_SlaveGetDefaultConfig(lpspi_slave_config_t *slaveConfig); - -/*! - * @brief De-initializes the LPSPI peripheral. Call this API to disable the LPSPI clock. - * @param base LPSPI peripheral address. - */ -void LPSPI_Deinit(LPSPI_Type *base); - -/*! - * @brief Restores the LPSPI peripheral to reset state. Note that this function - * sets all registers to reset state. As a result, the LPSPI module can't work after calling - * this API. - * @param base LPSPI peripheral address. - */ -void LPSPI_Reset(LPSPI_Type *base); - -/*! - * @brief Get the LPSPI instance from peripheral base address. - * - * @param base LPSPI peripheral base address. - * @return LPSPI instance. - */ -uint32_t LPSPI_GetInstance(LPSPI_Type *base); - -/*! - * @brief Enables the LPSPI peripheral and sets the MCR MDIS to 0. - * - * @param base LPSPI peripheral address. - * @param enable Pass true to enable module, false to disable module. - */ -static inline void LPSPI_Enable(LPSPI_Type *base, bool enable) -{ - if (enable) - { - base->CR |= LPSPI_CR_MEN_MASK; - } - else - { - base->CR &= ~LPSPI_CR_MEN_MASK; - } -#if defined(FSL_FEATURE_LPSPI_HAS_ERRATA_051472) && FSL_FEATURE_LPSPI_HAS_ERRATA_051472 - /* ERRATA051472: The SR[REF] would assert if software disables the LPSPI module - after receiving some data and then enabled the LPSPI again without performing a software reset. - Clear SR[REF] flag after LPSPI module enabled*/ - if ((base->SR & (uint32_t)kLPSPI_ReceiveErrorFlag) != 0U) - { - base->SR = (uint32_t)kLPSPI_ReceiveErrorFlag; - } -#endif -} - -/*! - *@} - */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets the LPSPI status flag state. - * @param base LPSPI peripheral address. - * @return The LPSPI status(in SR register). - */ -static inline uint32_t LPSPI_GetStatusFlags(LPSPI_Type *base) -{ - return (base->SR); -} - -/*! - * @brief Gets the LPSPI Tx FIFO size. - * @param base LPSPI peripheral address. - * @return The LPSPI Tx FIFO size. - */ -static inline uint8_t LPSPI_GetTxFifoSize(LPSPI_Type *base) -{ - return (1U << ((base->PARAM & LPSPI_PARAM_TXFIFO_MASK) >> LPSPI_PARAM_TXFIFO_SHIFT)); -} - -/*! - * @brief Gets the LPSPI Rx FIFO size. - * @param base LPSPI peripheral address. - * @return The LPSPI Rx FIFO size. - */ -static inline uint8_t LPSPI_GetRxFifoSize(LPSPI_Type *base) -{ - return (1U << ((base->PARAM & LPSPI_PARAM_RXFIFO_MASK) >> LPSPI_PARAM_RXFIFO_SHIFT)); -} - -/*! - * @brief Gets the LPSPI Tx FIFO count. - * @param base LPSPI peripheral address. - * @return The number of words in the transmit FIFO. - */ -static inline uint32_t LPSPI_GetTxFifoCount(LPSPI_Type *base) -{ - return ((base->FSR & LPSPI_FSR_TXCOUNT_MASK) >> LPSPI_FSR_TXCOUNT_SHIFT); -} - -/*! - * @brief Gets the LPSPI Rx FIFO count. - * @param base LPSPI peripheral address. - * @return The number of words in the receive FIFO. - */ -static inline uint32_t LPSPI_GetRxFifoCount(LPSPI_Type *base) -{ - return ((base->FSR & LPSPI_FSR_RXCOUNT_MASK) >> LPSPI_FSR_RXCOUNT_SHIFT); -} - -/*! - * @brief Clears the LPSPI status flag. - * - * This function clears the desired status bit by using a write-1-to-clear. The user passes in the base and the - * desired status flag bit to clear. The list of status flags is defined in the _lpspi_flags. - * Example usage: - * @code - * LPSPI_ClearStatusFlags(base, kLPSPI_TxDataRequestFlag|kLPSPI_RxDataReadyFlag); - * @endcode - * - * @param base LPSPI peripheral address. - * @param statusFlags The status flag used from type _lpspi_flags. - */ -static inline void LPSPI_ClearStatusFlags(LPSPI_Type *base, uint32_t statusFlags) -{ - base->SR = statusFlags; /*!< The status flags are cleared by writing 1 (w1c).*/ -} - -/*! - *@} - */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables the LPSPI interrupts. - * - * This function configures the various interrupt masks of the LPSPI. The parameters are base and an interrupt mask. - * Note that, for Tx fill and Rx FIFO drain requests, enabling the interrupt request disables the DMA request. - * - * @code - * LPSPI_EnableInterrupts(base, kLPSPI_TxInterruptEnable | kLPSPI_RxInterruptEnable ); - * @endcode - * - * @param base LPSPI peripheral address. - * @param mask The interrupt mask; Use the enum _lpspi_interrupt_enable. - */ -static inline void LPSPI_EnableInterrupts(LPSPI_Type *base, uint32_t mask) -{ - base->IER |= mask; -} - -/*! - * @brief Disables the LPSPI interrupts. - * - * @code - * LPSPI_DisableInterrupts(base, kLPSPI_TxInterruptEnable | kLPSPI_RxInterruptEnable ); - * @endcode - * - * @param base LPSPI peripheral address. - * @param mask The interrupt mask; Use the enum _lpspi_interrupt_enable. - */ -static inline void LPSPI_DisableInterrupts(LPSPI_Type *base, uint32_t mask) -{ - base->IER &= ~mask; -} - -/*! - *@} - */ - -/*! - * @name DMA Control - * @{ - */ - -/*! - * @brief Enables the LPSPI DMA request. - * - * This function configures the Rx and Tx DMA mask of the LPSPI. The parameters are base and a DMA mask. - * @code - * LPSPI_EnableDMA(base, kLPSPI_TxDmaEnable | kLPSPI_RxDmaEnable); - * @endcode - * - * @param base LPSPI peripheral address. - * @param mask The interrupt mask; Use the enum _lpspi_dma_enable. - */ -static inline void LPSPI_EnableDMA(LPSPI_Type *base, uint32_t mask) -{ - base->DER |= mask; -} - -/*! - * @brief Disables the LPSPI DMA request. - * - * This function configures the Rx and Tx DMA mask of the LPSPI. The parameters are base and a DMA mask. - * @code - * SPI_DisableDMA(base, kLPSPI_TxDmaEnable | kLPSPI_RxDmaEnable); - * @endcode - * - * @param base LPSPI peripheral address. - * @param mask The interrupt mask; Use the enum _lpspi_dma_enable. - */ -static inline void LPSPI_DisableDMA(LPSPI_Type *base, uint32_t mask) -{ - base->DER &= ~mask; -} - -/*! - * @brief Gets the LPSPI Transmit Data Register address for a DMA operation. - * - * This function gets the LPSPI Transmit Data Register address because this value is needed - * for the DMA operation. - * This function can be used for either master or slave mode. - * - * @param base LPSPI peripheral address. - * @return The LPSPI Transmit Data Register address. - */ -static inline uint32_t LPSPI_GetTxRegisterAddress(LPSPI_Type *base) -{ - return (uint32_t) & (base->TDR); -} - -/*! - * @brief Gets the LPSPI Receive Data Register address for a DMA operation. - * - * This function gets the LPSPI Receive Data Register address because this value is needed - * for the DMA operation. - * This function can be used for either master or slave mode. - * - * @param base LPSPI peripheral address. - * @return The LPSPI Receive Data Register address. - */ -static inline uint32_t LPSPI_GetRxRegisterAddress(LPSPI_Type *base) -{ - return (uint32_t) & (base->RDR); -} - -/*! - *@} - */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Check the argument for transfer . - * - * @param base LPSPI peripheral address. - * @param transfer the transfer struct to be used. - * @param isEdma True to check for EDMA transfer, false to check interrupt non-blocking transfer - * @return Return true for right and false for wrong. - */ -bool LPSPI_CheckTransferArgument(LPSPI_Type *base, lpspi_transfer_t *transfer, bool isEdma); - -/*! - * @brief Configures the LPSPI for either master or slave. - * - * Note that the CFGR1 should only be written when the LPSPI is disabled (LPSPIx_CR_MEN = 0). - * - * @param base LPSPI peripheral address. - * @param mode Mode setting (master or slave) of type lpspi_master_slave_mode_t. - */ -static inline void LPSPI_SetMasterSlaveMode(LPSPI_Type *base, lpspi_master_slave_mode_t mode) -{ - base->CFGR1 = (base->CFGR1 & (~LPSPI_CFGR1_MASTER_MASK)) | LPSPI_CFGR1_MASTER(mode); -} - -/*! - * @brief Configures the peripheral chip select used for the transfer. - * - * @param base LPSPI peripheral address. - * @param select LPSPI Peripheral Chip Select (PCS) configuration. - */ -static inline void LPSPI_SelectTransferPCS(LPSPI_Type *base, lpspi_which_pcs_t select) -{ - base->TCR = (base->TCR & (~LPSPI_TCR_PCS_MASK)) | LPSPI_TCR_PCS((uint8_t)select); -} - -/*! - * @brief Set the PCS signal to continuous or uncontinuous mode. - * - * @note In master mode, continuous transfer will keep the PCS asserted at the end of the frame size, until a command - * word is received that starts a new frame. So PCS must be set back to uncontinuous when transfer finishes. - * In slave mode, when continuous transfer is enabled, the LPSPI will only transmit the first frame size bits, after - * that the LPSPI will transmit received data back (assuming a 32-bit shift register). - * - * @param base LPSPI peripheral address. - * @param IsContinous True to set the transfer PCS to continuous mode, false to set to uncontinuous mode. - */ -static inline void LPSPI_SetPCSContinous(LPSPI_Type *base, bool IsContinous) -{ - if (IsContinous) - { - base->TCR |= LPSPI_TCR_CONT_MASK; - } - else - { - base->TCR &= ~LPSPI_TCR_CONT_MASK; - } -} - -/*! - * @brief Returns whether the LPSPI module is in master mode. - * - * @param base LPSPI peripheral address. - * @return Returns true if the module is in master mode or false if the module is in slave mode. - */ -static inline bool LPSPI_IsMaster(LPSPI_Type *base) -{ - return (bool)((base->CFGR1) & LPSPI_CFGR1_MASTER_MASK); -} - -/*! - * @brief Flushes the LPSPI FIFOs. - * - * @param base LPSPI peripheral address. - * @param flushTxFifo Flushes (true) the Tx FIFO, else do not flush (false) the Tx FIFO. - * @param flushRxFifo Flushes (true) the Rx FIFO, else do not flush (false) the Rx FIFO. - */ -static inline void LPSPI_FlushFifo(LPSPI_Type *base, bool flushTxFifo, bool flushRxFifo) -{ -#if defined(FSL_FEATURE_LPSPI_HAS_ERRATA_050456) && FSL_FEATURE_LPSPI_HAS_ERRATA_050456 - /* - * Resetting the FIFO using CR[RTF] and CR[RRF] does not clear the FIFO pointers completely. - * Workaround by reseting the entire module using CR[RST] bit. - */ - - (void)flushTxFifo; - (void)flushRxFifo; - - /* Save current state before resetting */ - bool enabled = base->CR & LPSPI_CR_MEN_MASK; - uint32_t cfgr1 = base->CFGR1; - uint32_t ccr = base->CCR; - uint32_t ccr1 = base->CCR1; - - /* To read the current state of the existing command word, LPSPI must be enabled */ - LPSPI_Enable(base, true); - uint32_t tcr = base->TCR; - - /* Reset all internal logic and registers. Bit remains set until cleared by software */ - LPSPI_Enable(base, false); - base->CR |= LPSPI_CR_RST_MASK; - base->CR &= ~LPSPI_CR_RST_MASK; - - /* Restore saved registers */ - base->CFGR1 = cfgr1; - base->CCR = ccr; - base->CCR1 = ccr1; - base->TCR = tcr; - - LPSPI_Enable(base, enabled); -#else - base->CR |= ((uint32_t)flushTxFifo << LPSPI_CR_RTF_SHIFT) | ((uint32_t)flushRxFifo << LPSPI_CR_RRF_SHIFT); -#endif -} - -/*! - * @brief Sets the transmit and receive FIFO watermark values. - * - * This function allows the user to set the receive and transmit FIFO watermarks. The function - * does not compare the watermark settings to the FIFO size. The FIFO watermark should not be - * equal to or greater than the FIFO size. It is up to the higher level driver to make this check. - * - * @param base LPSPI peripheral address. - * @param txWater The TX FIFO watermark value. Writing a value equal or greater than the FIFO size is truncated. - * @param rxWater The RX FIFO watermark value. Writing a value equal or greater than the FIFO size is truncated. - */ -static inline void LPSPI_SetFifoWatermarks(LPSPI_Type *base, uint32_t txWater, uint32_t rxWater) -{ - base->FCR = LPSPI_FCR_TXWATER(txWater) | LPSPI_FCR_RXWATER(rxWater); -} - -/*! - * @brief Configures all LPSPI peripheral chip select polarities simultaneously. - * - * Note that the CFGR1 should only be written when the LPSPI is disabled (LPSPIx_CR_MEN = 0). - * - * This is an example: PCS0 and PCS1 set to active low and other PCSs set to active high. Note that the number of - * PCS is device-specific. - * @code - * LPSPI_SetAllPcsPolarity(base, kLPSPI_Pcs0ActiveLow | kLPSPI_Pcs1ActiveLow); - * @endcode - * - * @param base LPSPI peripheral address. - * @param mask The PCS polarity mask; Use the enum _lpspi_pcs_polarity. - */ -static inline void LPSPI_SetAllPcsPolarity(LPSPI_Type *base, uint32_t mask) -{ - base->CFGR1 = (base->CFGR1 & ~LPSPI_CFGR1_PCSPOL_MASK) | LPSPI_CFGR1_PCSPOL(~mask); -} - -/*! - * @brief Configures the frame size. - * - * The minimum frame size is 8-bits and the maximum frame size is 4096-bits. If the frame size is less than or equal - * to 32-bits, the word size and frame size are identical. If the frame size is greater than 32-bits, the word - * size is 32-bits for each word except the last (the last word contains the remainder bits if the frame size is not - * divisible by 32). The minimum word size is 2-bits. A frame size of 33-bits (or similar) is not supported. - * - * Note 1: The transmit command register should be initialized before enabling the LPSPI in slave mode, although - * the command register does not update until after the LPSPI is enabled. After it is enabled, the transmit command - * register - * should only be changed if the LPSPI is idle. - * - * Note 2: The transmit and command FIFO is a combined FIFO that includes both transmit data and command words. That - * means the TCR register should be written to when the Tx FIFO is not full. - * - * @param base LPSPI peripheral address. - * @param frameSize The frame size in number of bits. - */ -static inline void LPSPI_SetFrameSize(LPSPI_Type *base, uint32_t frameSize) -{ - base->TCR = (base->TCR & ~LPSPI_TCR_FRAMESZ_MASK) | LPSPI_TCR_FRAMESZ(frameSize - 1U); -} - -/*! - * @brief Sets the LPSPI baud rate in bits per second. - * - * This function takes in the desired bitsPerSec (baud rate) and calculates the nearest - * possible baud rate without exceeding the desired baud rate and returns the - * calculated baud rate in bits-per-second. It requires the caller to provide - * the frequency of the module source clock (in Hertz). Note that the baud rate - * does not go into effect until the Transmit Control Register (TCR) is programmed - * with the prescale value. Hence, this function returns the prescale tcrPrescaleValue - * parameter for later programming in the TCR. The higher level - * peripheral driver should alert the user of an out of range baud rate input. - * - * Note that the LPSPI module must first be disabled before configuring this. - * Note that the LPSPI module must be configured for master mode before configuring this. - * - * @param base LPSPI peripheral address. - * @param baudRate_Bps The desired baud rate in bits per second. - * @param srcClock_Hz Module source input clock in Hertz. - * @param tcrPrescaleValue The TCR prescale value needed to program the TCR. - * @return The actual calculated baud rate. This function may also return a "0" if the - * LPSPI is not configured for master mode or if the LPSPI module is not disabled. - */ - -uint32_t LPSPI_MasterSetBaudRate(LPSPI_Type *base, - uint32_t baudRate_Bps, - uint32_t srcClock_Hz, - uint32_t *tcrPrescaleValue); - -/*! - * @brief Manually configures a specific LPSPI delay parameter (module must be disabled to - * change the delay values). - * - * This function configures the following: - * SCK to PCS delay, or - * PCS to SCK delay, or - * The configurations must occur between the transfer delay. - * - * The delay names are available in type lpspi_delay_type_t. - * - * The user passes the desired delay along with the delay value. - * This allows the user to directly set the delay values if they have - * pre-calculated them or if they simply wish to manually increment the value. - * - * Note that the LPSPI module must first be disabled before configuring this. - * Note that the LPSPI module must be configured for master mode before configuring this. - * - * @param base LPSPI peripheral address. - * @param scaler The 8-bit delay value 0x00 to 0xFF (255). - * @param whichDelay The desired delay to configure, must be of type lpspi_delay_type_t. - */ -void LPSPI_MasterSetDelayScaler(LPSPI_Type *base, uint32_t scaler, lpspi_delay_type_t whichDelay); - -/*! - * @brief Calculates the delay based on the desired delay input in nanoseconds (module must be - * disabled to change the delay values). - * - * This function calculates the values for the following: - * SCK to PCS delay, or - * PCS to SCK delay, or - * The configurations must occur between the transfer delay. - * - * The delay names are available in type lpspi_delay_type_t. - * - * The user passes the desired delay and the desired delay value in - * nano-seconds. The function calculates the value needed for the desired delay parameter - * and returns the actual calculated delay because an exact delay match may not be possible. In this - * case, the closest match is calculated without going below the desired delay value input. - * It is possible to input a very large delay value that exceeds the capability of the part, in - * which case the maximum supported delay is returned. It is up to the higher level - * peripheral driver to alert the user of an out of range delay input. - * - * Note that the LPSPI module must be configured for master mode before configuring this. And note that - * the delayTime = LPSPI_clockSource / (PRESCALE * Delay_scaler). - * - * @param base LPSPI peripheral address. - * @param delayTimeInNanoSec The desired delay value in nano-seconds. - * @param whichDelay The desired delay to configuration, which must be of type lpspi_delay_type_t. - * @param srcClock_Hz Module source input clock in Hertz. - * @return actual Calculated delay value in nano-seconds. - */ -uint32_t LPSPI_MasterSetDelayTimes(LPSPI_Type *base, - uint32_t delayTimeInNanoSec, - lpspi_delay_type_t whichDelay, - uint32_t srcClock_Hz); - -/*! - * @brief Writes data into the transmit data buffer. - * - * This function writes data passed in by the user to the Transmit Data Register (TDR). - * The user can pass up to 32-bits of data to load into the TDR. If the frame size exceeds 32-bits, - * the user has to manage sending the data one 32-bit word at a time. - * Any writes to the TDR result in an immediate push to the transmit FIFO. - * This function can be used for either master or slave modes. - * - * @param base LPSPI peripheral address. - * @param data The data word to be sent. - */ -static inline void LPSPI_WriteData(LPSPI_Type *base, uint32_t data) -{ - base->TDR = data; -} - -/*! - * @brief Reads data from the data buffer. - * - * This function reads the data from the Receive Data Register (RDR). - * This function can be used for either master or slave mode. - * - * @param base LPSPI peripheral address. - * @return The data read from the data buffer. - */ -static inline uint32_t LPSPI_ReadData(LPSPI_Type *base) -{ - return (base->RDR); -} - -/*! - * @brief Set up the dummy data. - * - * @param base LPSPI peripheral address. - * @param dummyData Data to be transferred when tx buffer is NULL. - * Note: - * This API has no effect when LPSPI in slave interrupt mode, because driver - * will set the TXMSK bit to 1 if txData is NULL, no data is loaded from transmit - * FIFO and output pin is tristated. - */ -void LPSPI_SetDummyData(LPSPI_Type *base, uint8_t dummyData); - -/*! - *@} - */ - -/*! - * @name Transactional - * @{ - */ -/*Transactional APIs*/ - -/*! - * @brief Initializes the LPSPI master handle. - * - * This function initializes the LPSPI handle, which can be used for other LPSPI transactional APIs. Usually, for a - * specified LPSPI instance, call this API once to get the initialized handle. - - * @param base LPSPI peripheral address. - * @param handle LPSPI handle pointer to lpspi_master_handle_t. - * @param callback DSPI callback. - * @param userData callback function parameter. - */ -void LPSPI_MasterTransferCreateHandle(LPSPI_Type *base, - lpspi_master_handle_t *handle, - lpspi_master_transfer_callback_t callback, - void *userData); - -/*! - * @brief LPSPI master transfer data using a polling method. - * - * This function transfers data using a polling method. This is a blocking function, which does not return until all - * transfers have been - * completed. - * - * Note: - * The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not integer multiples of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * @param base LPSPI peripheral address. - * @param transfer pointer to lpspi_transfer_t structure. - * @return status of status_t. - */ -status_t LPSPI_MasterTransferBlocking(LPSPI_Type *base, lpspi_transfer_t *transfer); - -/*! - * @brief LPSPI master transfer data using an interrupt method. - * - * This function transfers data using an interrupt method. This is a non-blocking function, which returns right away. - * When all data is transferred, the callback function is called. - * - * Note: - * The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not integer multiples of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * @param base LPSPI peripheral address. - * @param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - * @param transfer pointer to lpspi_transfer_t structure. - * @return status of status_t. - */ -status_t LPSPI_MasterTransferNonBlocking(LPSPI_Type *base, lpspi_master_handle_t *handle, lpspi_transfer_t *transfer); - -/*! - * @brief Gets the master transfer remaining bytes. - * - * This function gets the master transfer remaining bytes. - * - * @param base LPSPI peripheral address. - * @param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - * @param count Number of bytes transferred so far by the non-blocking transaction. - * @return status of status_t. - */ -status_t LPSPI_MasterTransferGetCount(LPSPI_Type *base, lpspi_master_handle_t *handle, size_t *count); - -/*! - * @brief LPSPI master abort transfer which uses an interrupt method. - * - * This function aborts a transfer which uses an interrupt method. - * - * @param base LPSPI peripheral address. - * @param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - */ -void LPSPI_MasterTransferAbort(LPSPI_Type *base, lpspi_master_handle_t *handle); - -/*! - * @brief LPSPI Master IRQ handler function. - * - * This function processes the LPSPI transmit and receive IRQ. - * - * @param base LPSPI peripheral address. - * @param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - */ -void LPSPI_MasterTransferHandleIRQ(LPSPI_Type *base, lpspi_master_handle_t *handle); - -/*! - * @brief Initializes the LPSPI slave handle. - * - * This function initializes the LPSPI handle, which can be used for other LPSPI transactional APIs. Usually, for a - * specified LPSPI instance, call this API once to get the initialized handle. - * - * @param base LPSPI peripheral address. - * @param handle LPSPI handle pointer to lpspi_slave_handle_t. - * @param callback DSPI callback. - * @param userData callback function parameter. - */ -void LPSPI_SlaveTransferCreateHandle(LPSPI_Type *base, - lpspi_slave_handle_t *handle, - lpspi_slave_transfer_callback_t callback, - void *userData); - -/*! - * @brief LPSPI slave transfer data using an interrupt method. - * - * This function transfer data using an interrupt method. This is a non-blocking function, which returns right away. - * When all data is transferred, the callback function is called. - * - * Note: - * The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not an integer multiple of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * @param base LPSPI peripheral address. - * @param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - * @param transfer pointer to lpspi_transfer_t structure. - * @return status of status_t. - */ -status_t LPSPI_SlaveTransferNonBlocking(LPSPI_Type *base, lpspi_slave_handle_t *handle, lpspi_transfer_t *transfer); - -/*! - * @brief Gets the slave transfer remaining bytes. - * - * This function gets the slave transfer remaining bytes. - * - * @param base LPSPI peripheral address. - * @param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - * @param count Number of bytes transferred so far by the non-blocking transaction. - * @return status of status_t. - */ -status_t LPSPI_SlaveTransferGetCount(LPSPI_Type *base, lpspi_slave_handle_t *handle, size_t *count); - -/*! - * @brief LPSPI slave aborts a transfer which uses an interrupt method. - * - * This function aborts a transfer which uses an interrupt method. - * - * @param base LPSPI peripheral address. - * @param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - */ -void LPSPI_SlaveTransferAbort(LPSPI_Type *base, lpspi_slave_handle_t *handle); - -/*! - * @brief LPSPI Slave IRQ handler function. - * - * This function processes the LPSPI transmit and receives an IRQ. - * - * @param base LPSPI peripheral address. - * @param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - */ -void LPSPI_SlaveTransferHandleIRQ(LPSPI_Type *base, lpspi_slave_handle_t *handle); - -/*! - * @brief Wait for tx FIFO to be empty. - * - * This function wait the tx fifo empty - * - * @param base LPSPI peripheral address. - * @return true for the tx FIFO is ready, false is not. - */ -bool LPSPI_WaitTxFifoEmpty(LPSPI_Type *base); - -/*! - *@} - */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /*FSL_LPSPI_H_*/ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpspi_edma.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpspi_edma.c deleted file mode 100644 index 1b2af7d90f8..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpspi_edma.c +++ /dev/null @@ -1,1324 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpspi_edma.h" - -/* - * $Coverage Justification Reference$ - * - * $Justification fsl_lpspi_edma_c_ref_1$ - * The default branch cannot be executed in any circumstances, it is only added to avoid MISRA violation. - * - */ -/*********************************************************************************************************************** - * Definitions - ***********************************************************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpspi_edma" -#endif - -/*! - * @brief Structure definition for dspi_master_edma_private_handle_t. The structure is private. - */ -typedef struct _lpspi_master_edma_private_handle -{ - LPSPI_Type *base; /*!< LPSPI peripheral base address. */ - lpspi_master_edma_handle_t *handle; /*!< lpspi_master_edma_handle_t handle */ -} lpspi_master_edma_private_handle_t; - -/*! - * @brief Structure definition for dspi_slave_edma_private_handle_t. The structure is private. - */ -typedef struct _lpspi_slave_edma_private_handle -{ - LPSPI_Type *base; /*!< LPSPI peripheral base address. */ - lpspi_slave_edma_handle_t *handle; /*!< lpspi_slave_edma_handle_t handle */ -} lpspi_slave_edma_private_handle_t; - -/*********************************************************************************************************************** - * Prototypes - ***********************************************************************************************************************/ - -/*! - * @brief EDMA_LpspiMasterCallback after the LPSPI master transfer completed by using EDMA. - * This is not a public API. - */ -static void EDMA_LpspiMasterCallback(edma_handle_t *edmaHandle, - void *g_lpspiEdmaPrivateHandle, - bool transferDone, - uint32_t tcds); - -/*! - * @brief EDMA_LpspiSlaveCallback after the LPSPI slave transfer completed by using EDMA. - * This is not a public API. - */ -static void EDMA_LpspiSlaveCallback(edma_handle_t *edmaHandle, - void *g_lpspiEdmaPrivateHandle, - bool transferDone, - uint32_t tcds); - -static void LPSPI_SeparateEdmaReadData(uint8_t *rxData, uint32_t readData, uint32_t bytesEachRead, bool isByteSwap); - -/*********************************************************************************************************************** - * Variables - ***********************************************************************************************************************/ -/*! @brief Pointers to lpspi bases for each instance. */ -static LPSPI_Type *const s_lpspiBases[] = LPSPI_BASE_PTRS; - -/*! @brief Pointers to lpspi edma handles for each instance. */ -static lpspi_master_edma_private_handle_t s_lpspiMasterEdmaPrivateHandle[ARRAY_SIZE(s_lpspiBases)]; -static lpspi_slave_edma_private_handle_t s_lpspiSlaveEdmaPrivateHandle[ARRAY_SIZE(s_lpspiBases)]; - -/*********************************************************************************************************************** - * Code - ***********************************************************************************************************************/ -static void LPSPI_SeparateEdmaReadData(uint8_t *rxData, uint32_t readData, uint32_t bytesEachRead, bool isByteSwap) -{ - assert(rxData != NULL); - - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_edma_c_ref_1$ - */ - switch (bytesEachRead) - { - case 1: - if (!isByteSwap) - { - *rxData = (uint8_t)readData; - ++rxData; - } - else - { - *rxData = (uint8_t)(readData >> 24); - ++rxData; - } - break; - - case 2: - if (!isByteSwap) - { - *rxData = (uint8_t)readData; - ++rxData; - *rxData = (uint8_t)(readData >> 8); - ++rxData; - } - else - { - *rxData = (uint8_t)(readData >> 16); - ++rxData; - *rxData = (uint8_t)(readData >> 24); - ++rxData; - } - break; - - case 4: - - *rxData = (uint8_t)readData; - ++rxData; - *rxData = (uint8_t)(readData >> 8); - ++rxData; - *rxData = (uint8_t)(readData >> 16); - ++rxData; - *rxData = (uint8_t)(readData >> 24); - ++rxData; - - break; - - default: - assert(false); - break; - } -} - -/*! - * brief Initializes the LPSPI master eDMA handle. - * - * This function initializes the LPSPI eDMA handle which can be used for other LPSPI transactional APIs. Usually, for a - * specified LPSPI instance, call this API once to get the initialized handle. - * - * Note that the LPSPI eDMA has a separated (Rx and Rx as two sources) or shared (Rx and Tx are the same source) DMA - * request source. - * (1) For a separated DMA request source, enable and set the Rx DMAMUX source for edmaRxRegToRxDataHandle and - * Tx DMAMUX source for edmaIntermediaryToTxRegHandle. - * (2) For a shared DMA request source, enable and set the Rx/Rx DMAMUX source for edmaRxRegToRxDataHandle. - * - * param base LPSPI peripheral base address. - * param handle LPSPI handle pointer to lpspi_master_edma_handle_t. - * param callback LPSPI callback. - * param userData callback function parameter. - * param edmaRxRegToRxDataHandle edmaRxRegToRxDataHandle pointer to edma_handle_t. - * param edmaTxDataToTxRegHandle edmaTxDataToTxRegHandle pointer to edma_handle_t. - */ -void LPSPI_MasterTransferCreateHandleEDMA(LPSPI_Type *base, - lpspi_master_edma_handle_t *handle, - lpspi_master_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *edmaRxRegToRxDataHandle, - edma_handle_t *edmaTxDataToTxRegHandle) -{ - assert(handle != NULL); - assert(edmaRxRegToRxDataHandle != NULL); - assert(edmaTxDataToTxRegHandle != NULL); - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - uint32_t instance = LPSPI_GetInstance(base); - - s_lpspiMasterEdmaPrivateHandle[instance].base = base; - s_lpspiMasterEdmaPrivateHandle[instance].handle = handle; - - handle->callback = callback; - handle->userData = userData; - handle->dataBytesEveryTime = DMA_MAX_TRANSFER_COUNT; - - handle->edmaRxRegToRxDataHandle = edmaRxRegToRxDataHandle; - handle->edmaTxDataToTxRegHandle = edmaTxDataToTxRegHandle; -} - -static void LPSPI_PrepareTransferEDMA(LPSPI_Type *base) -{ - /* Flush FIFO, clear status, disable all the inerrupts and DMA requests. */ - LPSPI_FlushFifo(base, true, true); - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_AllStatusFlag); - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_AllInterruptEnable); - LPSPI_DisableDMA(base, (uint32_t)kLPSPI_RxDmaEnable | (uint32_t)kLPSPI_TxDmaEnable); -} - -/*! - * brief LPSPI master config transfer parameter using eDMA. - * - * This function is preparing to transfer data using eDMA. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_master_edma_handle_t structure which stores the transfer state. - * param configFlags transfer configuration flags. ref _lpspi_transfer_config_flag_for_master. - * return Indicates whether LPSPI master transfer was successful or not. - * retval kStatus_Success Execution successfully. - * retval kStatus_LPSPI_Busy The LPSPI device is busy. - */ -status_t LPSPI_MasterTransferPrepareEDMALite(LPSPI_Type *base, lpspi_master_edma_handle_t *handle, uint32_t configFlags) -{ - assert(handle != NULL); - - /* Check that we're not busy.*/ - if (handle->state == (uint8_t)kLPSPI_Busy) - { - return kStatus_LPSPI_Busy; - } - - /* Disable module before configuration */ - LPSPI_Enable(base, false); - - LPSPI_PrepareTransferEDMA(base); - - bool isByteSwap = ((configFlags & (uint32_t)kLPSPI_MasterByteSwap) != 0U); - bool isPcsContinuous = ((configFlags & (uint32_t)kLPSPI_MasterPcsContinuous) != 0U); - uint32_t instance = LPSPI_GetInstance(base); - uint8_t dummyData = g_lpspiDummyData[instance]; - /*Used for byte swap*/ - uint32_t whichPcs = (configFlags & LPSPI_MASTER_PCS_MASK) >> LPSPI_MASTER_PCS_SHIFT; - uint32_t bytesPerFrame = ((base->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT) / 8U + 1U; - - handle->txBuffIfNull = - ((uint32_t)dummyData) | ((uint32_t)dummyData << 8) | ((uint32_t)dummyData << 16) | ((uint32_t)dummyData << 24); - /*The TX and RX FIFO sizes are always the same*/ - handle->fifoSize = LPSPI_GetRxFifoSize(base); - handle->isPcsContinuous = isPcsContinuous; - handle->isByteSwap = isByteSwap; - handle->isThereExtraRxBytes = false; - - /*Because DMA is fast enough , so set the RX and TX watermarks to 0 .*/ - LPSPI_SetFifoWatermarks(base, 0U, 0U); - - /* Transfers will stall when transmit FIFO is empty or receive FIFO is full. */ - base->CFGR1 &= (~LPSPI_CFGR1_NOSTALL_MASK); - - /* Enable module for following configuration of TCR to take effect. */ - LPSPI_Enable(base, true); - - /* For DMA transfer , we'd better not masked the transmit data and receive data in TCR since the transfer flow is - * hard to controlled by software. */ - base->TCR = (base->TCR & ~(LPSPI_TCR_CONT_MASK | LPSPI_TCR_CONTC_MASK | LPSPI_TCR_BYSW_MASK | LPSPI_TCR_PCS_MASK)) | - LPSPI_TCR_CONT(isPcsContinuous) | LPSPI_TCR_BYSW(isByteSwap) | LPSPI_TCR_PCS(whichPcs); - /*Calculate the bytes for write/read the TX/RX register each time*/ - if (bytesPerFrame <= 4U) - { - handle->bytesEachWrite = (uint8_t)bytesPerFrame; - handle->bytesEachRead = (uint8_t)bytesPerFrame; - handle->bytesLastRead = (uint8_t)bytesPerFrame; - } - else - { - handle->bytesEachWrite = 4U; - handle->bytesEachRead = 4U; - - handle->bytesLastRead = 4U; - } - return kStatus_Success; -} - -/*! - * brief LPSPI master transfer data using eDMA without configs. - * - * This function transfers data using eDMA. This is a non-blocking function, which returns right away. When all data - * is transferred, the callback function is called. - * - * Note: - * This API is only for transfer through DMA without configuration. - * Before calling this API, you must call LPSPI_MasterTransferPrepareEDMALite to configure it once. - * The transfer data size should be an integer multiple of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not an integer multiple of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_master_edma_handle_t structure which stores the transfer state. - * param transfer pointer to lpspi_transfer_t structure, config field is not working. - * return Indicates whether LPSPI master transfer was successful or not. - * retval kStatus_Success Execution successfully. - * retval kStatus_LPSPI_Busy The LPSPI device is busy. - * retval kStatus_InvalidArgument The transfer structure is invalid. - */ -status_t LPSPI_MasterTransferEDMALite(LPSPI_Type *base, lpspi_master_edma_handle_t *handle, lpspi_transfer_t *transfer) -{ - assert(handle != NULL); - assert(transfer != NULL); - - /* Check that we're not busy.*/ - if (handle->state == (uint8_t)kLPSPI_Busy) - { - return kStatus_LPSPI_Busy; - } - - /* Check arguements */ - if (!LPSPI_CheckTransferArgument(base, transfer, true)) - { - return kStatus_InvalidArgument; - } - - /* Variables */ - uint32_t firstTimeDataSize = 0; - bool isThereExtraTxBytes = false; - uint8_t bytesLastWrite = 0; - uint32_t instance = LPSPI_GetInstance(base); - /*Used for byte swap*/ - uint32_t addrOffset = 0; - uint32_t rxAddr = LPSPI_GetRxRegisterAddress(base); - uint32_t txAddr = LPSPI_GetTxRegisterAddress(base); - uint32_t bytesPerFrame = ((base->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT) / 8U + 1U; - edma_transfer_config_t transferConfigRx = {0}; - edma_transfer_config_t transferConfigTx = {0}; - edma_tcd_t *softwareTCD_pcsContinuous = (edma_tcd_t *)((uint32_t)(&handle->lpspiSoftwareTCD[2]) & (~0x1FU)); - edma_tcd_t *softwareTCD_extraBytes = (edma_tcd_t *)((uint32_t)(&handle->lpspiSoftwareTCD[1]) & (~0x1FU)); - - if (transfer->dataSize <= bytesPerFrame) - { - /* Once dma transfer*/ - firstTimeDataSize = transfer->dataSize; - handle->isMultiDMATransmit = false; - } - else if (transfer->dataSize > handle->dataBytesEveryTime) - { - /* More dma transfer*/ - firstTimeDataSize = handle->dataBytesEveryTime; - handle->isMultiDMATransmit = true; - if (transfer->dataSize % handle->dataBytesEveryTime != 0U) - { - handle->lastTimeDataBytes = transfer->dataSize % handle->dataBytesEveryTime; - } - else - { - handle->lastTimeDataBytes = handle->dataBytesEveryTime; - } - - handle->dmaTransmitTime = - (uint8_t)((transfer->dataSize + handle->dataBytesEveryTime - 1U) / handle->dataBytesEveryTime); - } - else - { - /* Once dma transfer*/ - firstTimeDataSize = transfer->dataSize; - handle->isMultiDMATransmit = false; - } - handle->state = (uint8_t)kLPSPI_Busy; - handle->txData = transfer->txData; - handle->rxData = transfer->rxData; - handle->txRemainingByteCount = firstTimeDataSize; - handle->rxRemainingByteCount = firstTimeDataSize; - handle->totalByteCount = firstTimeDataSize; - handle->writeRegRemainingTimes = (firstTimeDataSize / bytesPerFrame) * ((bytesPerFrame + 3U) / 4U); - handle->readRegRemainingTimes = handle->writeRegRemainingTimes; - - handle->isThereExtraRxBytes = false; - - /*Calculate the bytes for write/read the TX/RX register each time*/ - if (bytesPerFrame > 4U) - { - if ((transfer->dataSize % 4U) != 0U) - { - bytesLastWrite = (uint8_t)(transfer->dataSize % 4U); - handle->bytesLastRead = bytesLastWrite; - - isThereExtraTxBytes = true; - - --handle->writeRegRemainingTimes; - - --handle->readRegRemainingTimes; - handle->isThereExtraRxBytes = true; - } - } - - EDMA_SetCallback(handle->edmaRxRegToRxDataHandle, EDMA_LpspiMasterCallback, - &s_lpspiMasterEdmaPrivateHandle[instance]); - - /* Configure rx EDMA transfer */ - EDMA_ResetChannel(handle->edmaRxRegToRxDataHandle->base, handle->edmaRxRegToRxDataHandle->channel); - - if (handle->rxData != NULL) - { - transferConfigRx.destAddr = (uint32_t) & (handle->rxData[0]); - transferConfigRx.destOffset = 1; - } - else - { - transferConfigRx.destAddr = (uint32_t) & (handle->rxBuffIfNull); - transferConfigRx.destOffset = 0; - } - transferConfigRx.destTransferSize = kEDMA_TransferSize1Bytes; - - addrOffset = 0; - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_edma_c_ref_1$ - */ - switch (handle->bytesEachRead) - { - case (1U): - transferConfigRx.srcTransferSize = kEDMA_TransferSize1Bytes; - transferConfigRx.minorLoopBytes = 1; - if (handle->isByteSwap) - { - addrOffset = 3; - } - break; - - case (2U): - transferConfigRx.srcTransferSize = kEDMA_TransferSize2Bytes; - transferConfigRx.minorLoopBytes = 2; - if (handle->isByteSwap) - { - addrOffset = 2; - } - break; - - case (4U): - transferConfigRx.srcTransferSize = kEDMA_TransferSize4Bytes; - transferConfigRx.minorLoopBytes = 4; - break; - - default: - transferConfigRx.srcTransferSize = kEDMA_TransferSize1Bytes; - transferConfigRx.minorLoopBytes = 1; - assert(false); - break; - } - - transferConfigRx.srcAddr = (uint32_t)rxAddr + addrOffset; - transferConfigRx.srcOffset = 0; - - transferConfigRx.majorLoopCounts = handle->readRegRemainingTimes; - - /* Store the initially configured eDMA minor byte transfer count into the LPSPI handle */ - handle->nbytes = (uint8_t)transferConfigRx.minorLoopBytes; - - EDMA_SetTransferConfig(handle->edmaRxRegToRxDataHandle->base, handle->edmaRxRegToRxDataHandle->channel, - &transferConfigRx, NULL); - EDMA_EnableChannelInterrupts(handle->edmaRxRegToRxDataHandle->base, handle->edmaRxRegToRxDataHandle->channel, - (uint32_t)kEDMA_MajorInterruptEnable); - - /* Configure tx EDMA transfer */ - EDMA_ResetChannel(handle->edmaTxDataToTxRegHandle->base, handle->edmaTxDataToTxRegHandle->channel); - - if (isThereExtraTxBytes) - { - if (handle->txData != NULL) - { - transferConfigTx.srcAddr = (uint32_t) & (transfer->txData[transfer->dataSize - bytesLastWrite]); - transferConfigTx.srcOffset = 1; - } - else - { - transferConfigTx.srcAddr = (uint32_t)(&handle->txBuffIfNull); - transferConfigTx.srcOffset = 0; - } - - transferConfigTx.destOffset = 0; - - transferConfigTx.srcTransferSize = kEDMA_TransferSize1Bytes; - - addrOffset = 0; - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_edma_c_ref_1$ - */ - switch (bytesLastWrite) - { - case (1U): - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - if (handle->isByteSwap) - { - addrOffset = 3; - } - break; - - case (2U): - transferConfigTx.destTransferSize = kEDMA_TransferSize2Bytes; - transferConfigTx.minorLoopBytes = 2; - if (handle->isByteSwap) - { - addrOffset = 2; - } - break; - - default: - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - assert(false); - break; - } - - transferConfigTx.destAddr = (uint32_t)txAddr + addrOffset; - transferConfigTx.majorLoopCounts = 1; - -#if defined FSL_EDMA_DRIVER_EDMA4 && FSL_EDMA_DRIVER_EDMA4 - EDMA_TcdResetExt(handle->edmaRxRegToRxDataHandle->base, softwareTCD_extraBytes); - if (handle->isPcsContinuous) - { - EDMA_TcdSetTransferConfigExt(handle->edmaRxRegToRxDataHandle->base, softwareTCD_extraBytes, - &transferConfigTx, softwareTCD_pcsContinuous); - } - else - { - EDMA_TcdSetTransferConfigExt(handle->edmaRxRegToRxDataHandle->base, softwareTCD_extraBytes, - &transferConfigTx, NULL); - } -#else - EDMA_TcdReset(softwareTCD_extraBytes); - if (handle->isPcsContinuous) - { - EDMA_TcdSetTransferConfig(softwareTCD_extraBytes, &transferConfigTx, softwareTCD_pcsContinuous); - } - else - { - EDMA_TcdSetTransferConfig(softwareTCD_extraBytes, &transferConfigTx, NULL); - } -#endif - } - - if (handle->isPcsContinuous) - { - /* Set continue incase of twice call transfer. */ - LPSPI_SetPCSContinous(base, true); - handle->transmitCommand = base->TCR & ~(LPSPI_TCR_CONTC_MASK | LPSPI_TCR_CONT_MASK); - transferConfigTx.srcAddr = (uint32_t) & (handle->transmitCommand); - transferConfigTx.srcOffset = 0; - - transferConfigTx.destAddr = (uint32_t) & (base->TCR); - transferConfigTx.destOffset = 0; - - transferConfigTx.srcTransferSize = kEDMA_TransferSize4Bytes; - transferConfigTx.destTransferSize = kEDMA_TransferSize4Bytes; - transferConfigTx.minorLoopBytes = 4; - transferConfigTx.majorLoopCounts = 1; - -#if defined FSL_EDMA_DRIVER_EDMA4 && FSL_EDMA_DRIVER_EDMA4 - EDMA_TcdResetExt(handle->edmaRxRegToRxDataHandle->base, softwareTCD_pcsContinuous); - EDMA_TcdSetTransferConfigExt(handle->edmaRxRegToRxDataHandle->base, softwareTCD_pcsContinuous, - &transferConfigTx, NULL); -#else - EDMA_TcdReset(softwareTCD_pcsContinuous); - EDMA_TcdSetTransferConfig(softwareTCD_pcsContinuous, &transferConfigTx, NULL); -#endif - } - - if (handle->txData != NULL) - { - transferConfigTx.srcAddr = (uint32_t)(handle->txData); - transferConfigTx.srcOffset = 1; - } - else - { - transferConfigTx.srcAddr = (uint32_t)(&handle->txBuffIfNull); - transferConfigTx.srcOffset = 0; - } - - transferConfigTx.destOffset = 0; - - transferConfigTx.srcTransferSize = kEDMA_TransferSize1Bytes; - - addrOffset = 0U; - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_edma_c_ref_1$ - */ - switch (handle->bytesEachRead) - { - case (1U): - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - if (handle->isByteSwap) - { - addrOffset = 3; - } - break; - - case (2U): - transferConfigTx.destTransferSize = kEDMA_TransferSize2Bytes; - transferConfigTx.minorLoopBytes = 2; - - if (handle->isByteSwap) - { - addrOffset = 2; - } - break; - - case (4U): - transferConfigTx.destTransferSize = kEDMA_TransferSize4Bytes; - transferConfigTx.minorLoopBytes = 4; - break; - - default: - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - assert(false); - break; - } - - transferConfigTx.destAddr = (uint32_t)txAddr + addrOffset; - - transferConfigTx.majorLoopCounts = handle->writeRegRemainingTimes; - - if (isThereExtraTxBytes) - { - handle->lastTimeTCD = softwareTCD_extraBytes; - } - else if (handle->isPcsContinuous) - { - handle->lastTimeTCD = softwareTCD_pcsContinuous; - } - else - { - handle->lastTimeTCD = NULL; - } - - if (handle->isMultiDMATransmit) - { - transferConfigTx.majorLoopCounts = handle->dataBytesEveryTime; - if (handle->isPcsContinuous) - { - /* Pcs-continue mode is not supported in Multi DMA. - Please use no-continue mode and use GPIO control CS pin*/ - LPSPI_SetPCSContinous(base, false); - assert(false); - } - - EDMA_SetTransferConfig(handle->edmaTxDataToTxRegHandle->base, handle->edmaTxDataToTxRegHandle->channel, - &transferConfigTx, NULL); - (void)memcpy(&handle->transferConfigTx, &transferConfigTx, sizeof(edma_transfer_config_t)); - (void)memcpy(&handle->transferConfigRx, &transferConfigRx, sizeof(edma_transfer_config_t)); - } - else - { - transferConfigTx.majorLoopCounts = handle->writeRegRemainingTimes; - EDMA_SetTransferConfig(handle->edmaTxDataToTxRegHandle->base, handle->edmaTxDataToTxRegHandle->channel, - &transferConfigTx, handle->lastTimeTCD); - } - EDMA_StartTransfer(handle->edmaTxDataToTxRegHandle); - EDMA_StartTransfer(handle->edmaRxRegToRxDataHandle); - LPSPI_EnableDMA(base, (uint32_t)kLPSPI_RxDmaEnable | (uint32_t)kLPSPI_TxDmaEnable); - - return kStatus_Success; -} - -/*! - * brief LPSPI master transfer data using eDMA. - * - * This function transfers data using eDMA. This is a non-blocking function, which returns right away. When all data - * is transferred, the callback function is called. - * - * Note: - * The transfer data size should be an integer multiple of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not an integer multiple of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_master_edma_handle_t structure which stores the transfer state. - * param transfer pointer to lpspi_transfer_t structure. - * return status of status_t. - */ -status_t LPSPI_MasterTransferEDMA(LPSPI_Type *base, lpspi_master_edma_handle_t *handle, lpspi_transfer_t *transfer) -{ - status_t status = kStatus_Fail; - status = LPSPI_MasterTransferPrepareEDMALite(base, handle, transfer->configFlags); - if (kStatus_Success != status) - { - return status; - } - return LPSPI_MasterTransferEDMALite(base, handle, transfer); -} - -static void EDMA_LpspiMasterCallback(edma_handle_t *edmaHandle, - void *g_lpspiEdmaPrivateHandle, - bool transferDone, - uint32_t tcds) -{ - assert(edmaHandle != NULL); - assert(g_lpspiEdmaPrivateHandle != NULL); - - uint32_t readData; - status_t callbackStatus = kStatus_Success; - lpspi_master_edma_private_handle_t *lpspiEdmaPrivateHandle; - lpspi_master_edma_handle_t *lpspiEdmaHandle; - lpspiEdmaPrivateHandle = (lpspi_master_edma_private_handle_t *)g_lpspiEdmaPrivateHandle; - - lpspiEdmaHandle = lpspiEdmaPrivateHandle->handle; - size_t rxRemainingByteCount = lpspiEdmaHandle->rxRemainingByteCount; - uint8_t bytesLastRead = lpspiEdmaHandle->bytesLastRead; - bool isByteSwap = lpspiEdmaHandle->isByteSwap; - - bool lpspitxDmaUpdate = false; - bool lpspirxDmaUpdate = false; - - LPSPI_DisableDMA(lpspiEdmaPrivateHandle->base, (uint32_t)kLPSPI_TxDmaEnable | (uint32_t)kLPSPI_RxDmaEnable); - - if (!transferDone) - { - callbackStatus = kStatus_LPSPI_Error; - } - else - { - if (lpspiEdmaHandle->isMultiDMATransmit) - { - /* multi DMA transmit */ - lpspiEdmaHandle->dmaTransmitTime--; - if (lpspiEdmaHandle->dmaTransmitTime >= 1U) - { - if (lpspiEdmaHandle->txData != NULL) - { - lpspitxDmaUpdate = true; - lpspiEdmaHandle->transferConfigTx.srcAddr += lpspiEdmaHandle->dataBytesEveryTime; - } - if (lpspiEdmaHandle->rxData != NULL) - { - lpspirxDmaUpdate = true; - lpspiEdmaHandle->transferConfigRx.destAddr += lpspiEdmaHandle->dataBytesEveryTime; - } - /* The last time - 1 time, need check the lastTime data bytes */ - if (lpspiEdmaHandle->dmaTransmitTime == 1U) - { - if (lpspiEdmaHandle->lastTimeDataBytes != lpspiEdmaHandle->dataBytesEveryTime) - { - /* Need update count if last time count is not dataBytesEveryTime*/ - lpspiEdmaHandle->transferConfigTx.majorLoopCounts = lpspiEdmaHandle->lastTimeDataBytes; - lpspiEdmaHandle->transferConfigRx.majorLoopCounts = lpspiEdmaHandle->lastTimeDataBytes; - lpspitxDmaUpdate = true; - lpspirxDmaUpdate = true; - } - } - /* Update RX channel first */ - if (lpspirxDmaUpdate) - { - EDMA_SetTransferConfig(lpspiEdmaHandle->edmaRxRegToRxDataHandle->base, - lpspiEdmaHandle->edmaRxRegToRxDataHandle->channel, - &lpspiEdmaHandle->transferConfigRx, NULL); - } - EDMA_StartTransfer(lpspiEdmaHandle->edmaRxRegToRxDataHandle); - /* Update TX channel */ - if (lpspitxDmaUpdate) - { - EDMA_SetTransferConfig(lpspiEdmaHandle->edmaTxDataToTxRegHandle->base, - lpspiEdmaHandle->edmaTxDataToTxRegHandle->channel, - &lpspiEdmaHandle->transferConfigTx, NULL); - } - EDMA_StartTransfer(lpspiEdmaHandle->edmaTxDataToTxRegHandle); - - LPSPI_EnableDMA(lpspiEdmaPrivateHandle->base, - (uint32_t)kLPSPI_TxDmaEnable | (uint32_t)kLPSPI_RxDmaEnable); - /* Continue DMA transmit*/ - return; - } - else - { - /* Transmit complete */ - } - } - else - { - /* Once DMA transfer */ - if (lpspiEdmaPrivateHandle->handle->isThereExtraRxBytes) - { - while (LPSPI_GetRxFifoCount(lpspiEdmaPrivateHandle->base) == 0U) - { - } - readData = LPSPI_ReadData(lpspiEdmaPrivateHandle->base); - if (lpspiEdmaPrivateHandle->handle->rxData != NULL) - { - LPSPI_SeparateEdmaReadData( - &(lpspiEdmaPrivateHandle->handle->rxData[rxRemainingByteCount - bytesLastRead]), readData, - bytesLastRead, isByteSwap); - } - } - /* Transmit complete */ - } - } - - lpspiEdmaPrivateHandle->handle->state = (uint8_t)kLPSPI_Idle; - - if (lpspiEdmaPrivateHandle->handle->callback != NULL) - { - lpspiEdmaPrivateHandle->handle->callback(lpspiEdmaPrivateHandle->base, lpspiEdmaPrivateHandle->handle, - callbackStatus, lpspiEdmaPrivateHandle->handle->userData); - } -} - -/*! - * brief LPSPI master aborts a transfer which is using eDMA. - * - * This function aborts a transfer which is using eDMA. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_master_edma_handle_t structure which stores the transfer state. - */ -void LPSPI_MasterTransferAbortEDMA(LPSPI_Type *base, lpspi_master_edma_handle_t *handle) -{ - assert(handle != NULL); - - LPSPI_DisableDMA(base, (uint32_t)kLPSPI_RxDmaEnable | (uint32_t)kLPSPI_TxDmaEnable); - - EDMA_AbortTransfer(handle->edmaRxRegToRxDataHandle); - EDMA_AbortTransfer(handle->edmaTxDataToTxRegHandle); - - handle->state = (uint8_t)kLPSPI_Idle; -} - -/*! - * brief Gets the master eDMA transfer remaining bytes. - * - * This function gets the master eDMA transfer remaining bytes. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_master_edma_handle_t structure which stores the transfer state. - * param count Number of bytes transferred so far by the EDMA transaction. - * return status of status_t. - */ -status_t LPSPI_MasterTransferGetCountEDMA(LPSPI_Type *base, lpspi_master_edma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (handle->state != (uint8_t)kLPSPI_Busy) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - size_t remainingByte; - - remainingByte = - (uint32_t)handle->nbytes * EDMA_GetRemainingMajorLoopCount(handle->edmaRxRegToRxDataHandle->base, - handle->edmaRxRegToRxDataHandle->channel); - - *count = handle->totalByteCount - remainingByte; - - return kStatus_Success; -} - -/*! - * brief Initializes the LPSPI slave eDMA handle. - * - * This function initializes the LPSPI eDMA handle which can be used for other LPSPI transactional APIs. Usually, for a - * specified LPSPI instance, call this API once to get the initialized handle. - * - * Note that LPSPI eDMA has a separated (Rx and Tx as two sources) or shared (Rx and Tx as the same source) DMA request - * source. - * - * (1) For a separated DMA request source, enable and set the Rx DMAMUX source for edmaRxRegToRxDataHandle and - * Tx DMAMUX source for edmaTxDataToTxRegHandle. - * (2) For a shared DMA request source, enable and set the Rx/Rx DMAMUX source for edmaRxRegToRxDataHandle . - * - * param base LPSPI peripheral base address. - * param handle LPSPI handle pointer to lpspi_slave_edma_handle_t. - * param callback LPSPI callback. - * param userData callback function parameter. - * param edmaRxRegToRxDataHandle edmaRxRegToRxDataHandle pointer to edma_handle_t. - * param edmaTxDataToTxRegHandle edmaTxDataToTxRegHandle pointer to edma_handle_t. - */ -void LPSPI_SlaveTransferCreateHandleEDMA(LPSPI_Type *base, - lpspi_slave_edma_handle_t *handle, - lpspi_slave_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *edmaRxRegToRxDataHandle, - edma_handle_t *edmaTxDataToTxRegHandle) -{ - assert(handle != NULL); - assert(edmaRxRegToRxDataHandle != NULL); - assert(edmaTxDataToTxRegHandle != NULL); - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - uint32_t instance = LPSPI_GetInstance(base); - - s_lpspiSlaveEdmaPrivateHandle[instance].base = base; - s_lpspiSlaveEdmaPrivateHandle[instance].handle = handle; - - handle->callback = callback; - handle->userData = userData; - - handle->edmaRxRegToRxDataHandle = edmaRxRegToRxDataHandle; - handle->edmaTxDataToTxRegHandle = edmaTxDataToTxRegHandle; -} - -/*! - * brief LPSPI slave transfers data using eDMA. - * - * This function transfers data using eDMA. This is a non-blocking function, which return right away. When all data - * is transferred, the callback function is called. - * - * Note: - * The transfer data size should be an integer multiple of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not an integer multiple of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_slave_edma_handle_t structure which stores the transfer state. - * param transfer pointer to lpspi_transfer_t structure. - * return status of status_t. - */ -status_t LPSPI_SlaveTransferEDMA(LPSPI_Type *base, lpspi_slave_edma_handle_t *handle, lpspi_transfer_t *transfer) -{ - assert(handle != NULL); - assert(transfer != NULL); - - /* Check that we're not busy.*/ - if (handle->state == (uint8_t)kLPSPI_Busy) - { - return kStatus_LPSPI_Busy; - } - /* Disable module before configuration. */ - LPSPI_Enable(base, false); - /* Check arguements, also dma transfer can not support 3 bytes */ - if (!LPSPI_CheckTransferArgument(base, transfer, true)) - { - return kStatus_InvalidArgument; - } - - LPSPI_PrepareTransferEDMA(base); - - /* Variables */ - bool isThereExtraTxBytes = false; - bool isByteSwap = ((transfer->configFlags & (uint32_t)kLPSPI_MasterByteSwap) != 0U); - uint8_t bytesLastWrite = 0; - uint8_t dummyData = g_lpspiDummyData[LPSPI_GetInstance(base)]; - uint32_t mask = (uint32_t)kLPSPI_RxDmaEnable; - - /* Used for byte swap */ - uint32_t addrOffset = 0; - uint32_t instance = LPSPI_GetInstance(base); - uint32_t rxAddr = LPSPI_GetRxRegisterAddress(base); - uint32_t txAddr = LPSPI_GetTxRegisterAddress(base); - uint32_t whichPcs = (transfer->configFlags & LPSPI_MASTER_PCS_MASK) >> LPSPI_MASTER_PCS_SHIFT; - uint32_t bytesPerFrame = ((base->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT) / 8U + 1U; - edma_transfer_config_t transferConfigRx = {0}; - edma_transfer_config_t transferConfigTx = {0}; - edma_tcd_t *softwareTCD_extraBytes = (edma_tcd_t *)((uint32_t)(&handle->lpspiSoftwareTCD[1]) & (~0x1FU)); - - /* Assign the original value for members of transfer handle. */ - handle->state = (uint8_t)kLPSPI_Busy; - handle->txData = transfer->txData; - handle->rxData = transfer->rxData; - handle->txRemainingByteCount = transfer->dataSize; - handle->rxRemainingByteCount = transfer->dataSize; - handle->totalByteCount = transfer->dataSize; - handle->writeRegRemainingTimes = (transfer->dataSize / bytesPerFrame) * ((bytesPerFrame + 3U) / 4U); - handle->readRegRemainingTimes = handle->writeRegRemainingTimes; - handle->txBuffIfNull = - ((uint32_t)dummyData) | ((uint32_t)dummyData << 8) | ((uint32_t)dummyData << 16) | ((uint32_t)dummyData << 24); - /*The TX and RX FIFO sizes are always the same*/ - handle->fifoSize = LPSPI_GetRxFifoSize(base); - handle->isByteSwap = isByteSwap; - handle->isThereExtraRxBytes = false; - - /* Because DMA is fast enough, set the RX and TX watermarks to 0. */ - LPSPI_SetFifoWatermarks(base, 0U, 0U); - - /* Transfers will stall when transmit FIFO is empty or receive FIFO is full. */ - base->CFGR1 &= (~LPSPI_CFGR1_NOSTALL_MASK); - - /* Enable module for following configuration of TCR to take effect. */ - LPSPI_Enable(base, true); - - /* For DMA transfer, mask the transmit data if the tx data is null, for rx the receive data should not be masked at - any time since we use rx dma transfer finish cllback to indicate transfer finish. */ - base->TCR = - (base->TCR & ~(LPSPI_TCR_CONT_MASK | LPSPI_TCR_CONTC_MASK | LPSPI_TCR_BYSW_MASK | LPSPI_TCR_TXMSK_MASK)) | - LPSPI_TCR_TXMSK(transfer->txData == NULL) | LPSPI_TCR_BYSW(isByteSwap) | LPSPI_TCR_PCS(whichPcs); - - if (transfer->txData == NULL) - { - if (!LPSPI_WaitTxFifoEmpty(base)) - { - return kStatus_LPSPI_Error; - } - } - - /*Calculate the bytes for write/read the TX/RX register each time*/ - if (bytesPerFrame <= 4U) - { - handle->bytesEachWrite = (uint8_t)bytesPerFrame; - handle->bytesEachRead = (uint8_t)bytesPerFrame; - - handle->bytesLastRead = (uint8_t)bytesPerFrame; - } - else - { - handle->bytesEachWrite = 4U; - handle->bytesEachRead = 4U; - - handle->bytesLastRead = 4U; - - if ((transfer->dataSize % 4U) != 0U) - { - bytesLastWrite = (uint8_t)(transfer->dataSize % 4U); - handle->bytesLastRead = bytesLastWrite; - - isThereExtraTxBytes = true; - --handle->writeRegRemainingTimes; - - handle->isThereExtraRxBytes = true; - --handle->readRegRemainingTimes; - } - } - - EDMA_SetCallback(handle->edmaRxRegToRxDataHandle, EDMA_LpspiSlaveCallback, - &s_lpspiSlaveEdmaPrivateHandle[instance]); - - /*Rx*/ - /* - * $Branch Coverage Justification$ - * LPSPI_CheckTransferArgument will check parameters, here readRegRemainingTimes cannot be 0. - */ - if (handle->readRegRemainingTimes > 0U) - { - EDMA_ResetChannel(handle->edmaRxRegToRxDataHandle->base, handle->edmaRxRegToRxDataHandle->channel); - - if (handle->rxData != NULL) - { - transferConfigRx.destAddr = (uint32_t) & (handle->rxData[0]); - transferConfigRx.destOffset = 1; - } - else - { - transferConfigRx.destAddr = (uint32_t) & (handle->rxBuffIfNull); - transferConfigRx.destOffset = 0; - } - transferConfigRx.destTransferSize = kEDMA_TransferSize1Bytes; - - addrOffset = 0; - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_edma_c_ref_1$ - */ - switch (handle->bytesEachRead) - { - case (1U): - transferConfigRx.srcTransferSize = kEDMA_TransferSize1Bytes; - transferConfigRx.minorLoopBytes = 1; - if (handle->isByteSwap) - { - addrOffset = 3; - } - break; - - case (2U): - transferConfigRx.srcTransferSize = kEDMA_TransferSize2Bytes; - transferConfigRx.minorLoopBytes = 2; - if (handle->isByteSwap) - { - addrOffset = 2; - } - break; - - case (4U): - transferConfigRx.srcTransferSize = kEDMA_TransferSize4Bytes; - transferConfigRx.minorLoopBytes = 4; - break; - - default: - transferConfigRx.srcTransferSize = kEDMA_TransferSize1Bytes; - transferConfigRx.minorLoopBytes = 1; - assert(false); - break; - } - - transferConfigRx.srcAddr = (uint32_t)rxAddr + addrOffset; - transferConfigRx.srcOffset = 0; - - transferConfigRx.majorLoopCounts = handle->readRegRemainingTimes; - - /* Store the initially configured eDMA minor byte transfer count into the DSPI handle */ - handle->nbytes = (uint8_t)transferConfigRx.minorLoopBytes; - - EDMA_SetTransferConfig(handle->edmaRxRegToRxDataHandle->base, handle->edmaRxRegToRxDataHandle->channel, - &transferConfigRx, NULL); - EDMA_EnableChannelInterrupts(handle->edmaRxRegToRxDataHandle->base, handle->edmaRxRegToRxDataHandle->channel, - (uint32_t)kEDMA_MajorInterruptEnable); - EDMA_StartTransfer(handle->edmaRxRegToRxDataHandle); - } - - /*Tx*/ - if (handle->txData != NULL) - { - EDMA_ResetChannel(handle->edmaTxDataToTxRegHandle->base, handle->edmaTxDataToTxRegHandle->channel); - if (isThereExtraTxBytes) - { - transferConfigTx.srcAddr = (uint32_t) & (transfer->txData[transfer->dataSize - bytesLastWrite]); - transferConfigTx.srcOffset = 1; - transferConfigTx.destOffset = 0; - transferConfigTx.srcTransferSize = kEDMA_TransferSize1Bytes; - addrOffset = 0; - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_edma_c_ref_1$ - */ - switch (bytesLastWrite) - { - case (1U): - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - if (handle->isByteSwap) - { - addrOffset = 3; - } - break; - - case (2U): - transferConfigTx.destTransferSize = kEDMA_TransferSize2Bytes; - transferConfigTx.minorLoopBytes = 2; - if (handle->isByteSwap) - { - addrOffset = 2; - } - break; - - default: - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - assert(false); - break; - } - - transferConfigTx.destAddr = (uint32_t)txAddr + addrOffset; - transferConfigTx.majorLoopCounts = 1; - -#if defined FSL_EDMA_DRIVER_EDMA4 && FSL_EDMA_DRIVER_EDMA4 - EDMA_TcdResetExt(handle->edmaRxRegToRxDataHandle->base, softwareTCD_extraBytes); - EDMA_TcdSetTransferConfigExt(handle->edmaRxRegToRxDataHandle->base, softwareTCD_extraBytes, - &transferConfigTx, NULL); -#else - EDMA_TcdReset(softwareTCD_extraBytes); - EDMA_TcdSetTransferConfig(softwareTCD_extraBytes, &transferConfigTx, NULL); -#endif - } - - transferConfigTx.srcAddr = (uint32_t)(handle->txData); - transferConfigTx.srcOffset = 1; - transferConfigTx.destOffset = 0; - transferConfigTx.srcTransferSize = kEDMA_TransferSize1Bytes; - addrOffset = 0; - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_edma_c_ref_1$ - */ - switch (handle->bytesEachRead) - { - case (1U): - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - if (handle->isByteSwap) - { - addrOffset = 3; - } - break; - - case (2U): - transferConfigTx.destTransferSize = kEDMA_TransferSize2Bytes; - transferConfigTx.minorLoopBytes = 2; - - if (handle->isByteSwap) - { - addrOffset = 2; - } - break; - - case (4U): - transferConfigTx.destTransferSize = kEDMA_TransferSize4Bytes; - transferConfigTx.minorLoopBytes = 4; - break; - - default: - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - assert(false); - break; - } - - transferConfigTx.destAddr = (uint32_t)txAddr + addrOffset; - transferConfigTx.majorLoopCounts = handle->writeRegRemainingTimes; - - if (isThereExtraTxBytes) - { - EDMA_SetTransferConfig(handle->edmaTxDataToTxRegHandle->base, handle->edmaTxDataToTxRegHandle->channel, - &transferConfigTx, softwareTCD_extraBytes); - } - else - { - EDMA_SetTransferConfig(handle->edmaTxDataToTxRegHandle->base, handle->edmaTxDataToTxRegHandle->channel, - &transferConfigTx, NULL); - } - EDMA_StartTransfer(handle->edmaTxDataToTxRegHandle); - mask |= (uint32_t)kLPSPI_TxDmaEnable; - } - - LPSPI_EnableDMA(base, mask); - - return kStatus_Success; -} - -static void EDMA_LpspiSlaveCallback(edma_handle_t *edmaHandle, - void *g_lpspiEdmaPrivateHandle, - bool transferDone, - uint32_t tcds) -{ - assert(edmaHandle != NULL); - assert(g_lpspiEdmaPrivateHandle != NULL); - - uint32_t readData; - status_t callbackStatus = kStatus_Success; - - lpspi_slave_edma_private_handle_t *lpspiEdmaPrivateHandle; - - lpspiEdmaPrivateHandle = (lpspi_slave_edma_private_handle_t *)g_lpspiEdmaPrivateHandle; - - size_t rxRemainingByteCount = lpspiEdmaPrivateHandle->handle->rxRemainingByteCount; - uint8_t bytesLastRead = lpspiEdmaPrivateHandle->handle->bytesLastRead; - bool isByteSwap = lpspiEdmaPrivateHandle->handle->isByteSwap; - - LPSPI_DisableDMA(lpspiEdmaPrivateHandle->base, (uint32_t)kLPSPI_TxDmaEnable | (uint32_t)kLPSPI_RxDmaEnable); - - if (!transferDone) - { - callbackStatus = kStatus_LPSPI_Error; - } - - /* - * $Branch Coverage Justification$ - * When there are extra bytes, the slave will not receive the extra bytes,The while here will not stop.(will - * improve) - */ - if (lpspiEdmaPrivateHandle->handle->isThereExtraRxBytes) - { - while (LPSPI_GetRxFifoCount(lpspiEdmaPrivateHandle->base) == 0U) - { - } - readData = LPSPI_ReadData(lpspiEdmaPrivateHandle->base); - - if (lpspiEdmaPrivateHandle->handle->rxData != NULL) - { - LPSPI_SeparateEdmaReadData(&(lpspiEdmaPrivateHandle->handle->rxData[rxRemainingByteCount - bytesLastRead]), - readData, bytesLastRead, isByteSwap); - } - } - - lpspiEdmaPrivateHandle->handle->state = (uint8_t)kLPSPI_Idle; - - if (lpspiEdmaPrivateHandle->handle->callback != NULL) - { - lpspiEdmaPrivateHandle->handle->callback(lpspiEdmaPrivateHandle->base, lpspiEdmaPrivateHandle->handle, - callbackStatus, lpspiEdmaPrivateHandle->handle->userData); - } -} - -/*! - * brief LPSPI slave aborts a transfer which is using eDMA. - * - * This function aborts a transfer which is using eDMA. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_slave_edma_handle_t structure which stores the transfer state. - */ -void LPSPI_SlaveTransferAbortEDMA(LPSPI_Type *base, lpspi_slave_edma_handle_t *handle) -{ - assert(handle != NULL); - - LPSPI_DisableDMA(base, (uint32_t)kLPSPI_RxDmaEnable | (uint32_t)kLPSPI_TxDmaEnable); - - EDMA_AbortTransfer(handle->edmaRxRegToRxDataHandle); - EDMA_AbortTransfer(handle->edmaTxDataToTxRegHandle); - - handle->state = (uint8_t)kLPSPI_Idle; -} - -/*! - * brief Gets the slave eDMA transfer remaining bytes. - * - * This function gets the slave eDMA transfer remaining bytes. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_slave_edma_handle_t structure which stores the transfer state. - * param count Number of bytes transferred so far by the eDMA transaction. - * return status of status_t. - */ -status_t LPSPI_SlaveTransferGetCountEDMA(LPSPI_Type *base, lpspi_slave_edma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (handle->state != (uint8_t)kLPSPI_Busy) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - size_t remainingByte; - - remainingByte = - (uint32_t)handle->nbytes * EDMA_GetRemainingMajorLoopCount(handle->edmaRxRegToRxDataHandle->base, - handle->edmaRxRegToRxDataHandle->channel); - - *count = handle->totalByteCount - remainingByte; - - return kStatus_Success; -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpspi_edma.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpspi_edma.h deleted file mode 100644 index 9e193393d67..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpspi_edma.h +++ /dev/null @@ -1,353 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LPSPI_EDMA_H_ -#define FSL_LPSPI_EDMA_H_ - -#include "fsl_lpspi.h" -#include "fsl_edma.h" - -/*! - * @addtogroup lpspi_edma_driver - * @{ - */ - -/*********************************************************************************************************************** - * Definitions - **********************************************************************************************************************/ -/*! @name Driver version */ -/*! @{ */ -/*! @brief LPSPI EDMA driver version. */ -#define FSL_LPSPI_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 4, 4)) - -/*! @brief DMA max transfer size */ -#define DMA_MAX_TRANSFER_COUNT 0x7FFFU -/*! @} */ - -/*! - * @brief Forward declaration of the _lpspi_master_edma_handle typedefs. - */ -typedef struct _lpspi_master_edma_handle lpspi_master_edma_handle_t; - -/*! - * @brief Forward declaration of the _lpspi_slave_edma_handle typedefs. - */ -typedef struct _lpspi_slave_edma_handle lpspi_slave_edma_handle_t; - -/*! - * @brief Completion callback function pointer type. - * - * @param base LPSPI peripheral base address. - * @param handle Pointer to the handle for the LPSPI master. - * @param status Success or error code describing whether the transfer completed. - * @param userData Arbitrary pointer-dataSized value passed from the application. - */ -typedef void (*lpspi_master_edma_transfer_callback_t)(LPSPI_Type *base, - lpspi_master_edma_handle_t *handle, - status_t status, - void *userData); -/*! - * @brief Completion callback function pointer type. - * - * @param base LPSPI peripheral base address. - * @param handle Pointer to the handle for the LPSPI slave. - * @param status Success or error code describing whether the transfer completed. - * @param userData Arbitrary pointer-dataSized value passed from the application. - */ -typedef void (*lpspi_slave_edma_transfer_callback_t)(LPSPI_Type *base, - lpspi_slave_edma_handle_t *handle, - status_t status, - void *userData); - -/*! @brief LPSPI master eDMA transfer handle structure used for transactional API. */ -struct _lpspi_master_edma_handle -{ - volatile bool isPcsContinuous; /*!< Is PCS continuous in transfer. */ - - volatile bool isByteSwap; /*!< A flag that whether should byte swap. */ - - volatile uint8_t fifoSize; /*!< FIFO dataSize. */ - - volatile uint8_t rxWatermark; /*!< Rx watermark. */ - - volatile uint8_t bytesEachWrite; /*!< Bytes for each write TDR. */ - volatile uint8_t bytesEachRead; /*!< Bytes for each read RDR. */ - - volatile uint8_t bytesLastRead; /*!< Bytes for last read RDR. */ - volatile bool isThereExtraRxBytes; /*!< Is there extra RX byte. */ - - const uint8_t *volatile txData; /*!< Send buffer. */ - uint8_t *volatile rxData; /*!< Receive buffer. */ - volatile size_t txRemainingByteCount; /*!< Number of bytes remaining to send.*/ - volatile size_t rxRemainingByteCount; /*!< Number of bytes remaining to receive.*/ - - volatile uint32_t writeRegRemainingTimes; /*!< Write TDR register remaining times. */ - volatile uint32_t readRegRemainingTimes; /*!< Read RDR register remaining times. */ - - uint32_t totalByteCount; /*!< Number of transfer bytes*/ - - edma_tcd_t *lastTimeTCD; /*!< Pointer to the lastTime TCD*/ - bool isMultiDMATransmit; /*!< Is there multi DMA transmit*/ - volatile uint8_t dmaTransmitTime; /*!< DMA Transfer times. */ - uint32_t lastTimeDataBytes; /*!< DMA transmit last Time data Bytes */ - - uint32_t dataBytesEveryTime; /*!< Bytes in a time for DMA transfer, default is DMA_MAX_TRANSFER_COUNT */ - - edma_transfer_config_t transferConfigRx; /*!< Config of DMA rx channel.*/ - edma_transfer_config_t transferConfigTx; /*!< Config of DMA tx channel.*/ - uint32_t txBuffIfNull; /*!< Used if there is not txData for DMA purpose.*/ - uint32_t rxBuffIfNull; /*!< Used if there is not rxData for DMA purpose.*/ - - uint32_t transmitCommand; /*!< Used to write TCR for DMA purpose.*/ - - volatile uint8_t state; /*!< LPSPI transfer state , _lpspi_transfer_state.*/ - - uint8_t nbytes; /*!< eDMA minor byte transfer count initially configured. */ - - lpspi_master_edma_transfer_callback_t callback; /*!< Completion callback. */ - void *userData; /*!< Callback user data. */ - - edma_handle_t *edmaRxRegToRxDataHandle; /*!CSR = (LPTMR_CSR_TMS(config->timerMode) | LPTMR_CSR_TFC(config->enableFreeRunning) | - LPTMR_CSR_TPP(config->pinPolarity) | LPTMR_CSR_TPS(config->pinSelect)); - - /* Configure the prescale value and clock source */ - base->PSR = (LPTMR_PSR_PRESCALE(config->value) | LPTMR_PSR_PBYP(config->bypassPrescaler) | - LPTMR_PSR_PCS(config->prescalerClockSource)); -} - -/*! - * brief Gates the LPTMR clock. - * - * param base LPTMR peripheral base address - */ -void LPTMR_Deinit(LPTMR_Type *base) -{ - /* Disable the LPTMR and reset the internal logic */ - base->CSR &= ~LPTMR_CSR_TEN_MASK; - -#if defined(LPTMR_CLOCKS) -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - - uint32_t instance = LPTMR_GetInstance(base); - - /* Gate the LPTMR clock*/ - CLOCK_DisableClock(s_lptmrClocks[instance]); -#if defined(LPTMR_PERIPH_CLOCKS) - CLOCK_DisableClock(s_lptmrPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* LPTMR_CLOCKS */ -} - -/*! - * brief Fills in the LPTMR configuration structure with default settings. - * - * The default values are as follows. - * code - * config->timerMode = kLPTMR_TimerModeTimeCounter; - * config->pinSelect = kLPTMR_PinSelectInput_0; - * config->pinPolarity = kLPTMR_PinPolarityActiveHigh; - * config->enableFreeRunning = false; - * config->bypassPrescaler = true; - * config->prescalerClockSource = kLPTMR_PrescalerClock_1; - * config->value = kLPTMR_Prescale_Glitch_0; - * endcode - * param config A pointer to the LPTMR configuration structure. - */ -void LPTMR_GetDefaultConfig(lptmr_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - /* Use time counter mode */ - config->timerMode = kLPTMR_TimerModeTimeCounter; - /* Use input 0 as source in pulse counter mode */ - config->pinSelect = kLPTMR_PinSelectInput_0; - /* Pulse input pin polarity is active-high */ - config->pinPolarity = kLPTMR_PinPolarityActiveHigh; - /* Counter resets whenever TCF flag is set */ - config->enableFreeRunning = false; - /* Bypass the prescaler */ - config->bypassPrescaler = true; - /* LPTMR clock source */ -#if !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT) - config->prescalerClockSource = kLPTMR_PrescalerClock_1; -#elif !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_0_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_0_SUPPORT) - config->prescalerClockSource = kLPTMR_PrescalerClock_0; -#elif !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_2_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_2_SUPPORT) - config->prescalerClockSource = kLPTMR_PrescalerClock_2; -#elif !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_3_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_3_SUPPORT) - config->prescalerClockSource = kLPTMR_PrescalerClock_3; -#else -#error No valid source -#endif - - /* Divide the prescaler clock by 2 */ - config->value = kLPTMR_Prescale_Glitch_0; -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lptmr.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lptmr.h deleted file mode 100644 index b8e473120c5..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lptmr.h +++ /dev/null @@ -1,384 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2017, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LPTMR_H_ -#define FSL_LPTMR_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup lptmr - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! Driver Version */ -#define FSL_LPTMR_DRIVER_VERSION (MAKE_VERSION(2, 2, 0)) -/*! @} */ - -/*! @brief LPTMR pin selection used in pulse counter mode.*/ -typedef enum _lptmr_pin_select -{ - kLPTMR_PinSelectInput_0 = 0x0U, /*!< Pulse counter input 0 is selected */ - kLPTMR_PinSelectInput_1 = 0x1U, /*!< Pulse counter input 1 is selected */ - kLPTMR_PinSelectInput_2 = 0x2U, /*!< Pulse counter input 2 is selected */ - kLPTMR_PinSelectInput_3 = 0x3U /*!< Pulse counter input 3 is selected */ -} lptmr_pin_select_t; - -/*! @brief LPTMR pin polarity used in pulse counter mode.*/ -typedef enum _lptmr_pin_polarity -{ - kLPTMR_PinPolarityActiveHigh = 0x0U, /*!< Pulse Counter input source is active-high */ - kLPTMR_PinPolarityActiveLow = 0x1U /*!< Pulse Counter input source is active-low */ -} lptmr_pin_polarity_t; - -/*! @brief LPTMR timer mode selection.*/ -typedef enum _lptmr_timer_mode -{ - kLPTMR_TimerModeTimeCounter = 0x0U, /*!< Time Counter mode */ - kLPTMR_TimerModePulseCounter = 0x1U /*!< Pulse Counter mode */ -} lptmr_timer_mode_t; - -/*! @brief LPTMR prescaler/glitch filter values*/ -typedef enum _lptmr_prescaler_glitch_value -{ - kLPTMR_Prescale_Glitch_0 = 0x0U, /*!< Prescaler divide 2, glitch filter does not support this setting */ - kLPTMR_Prescale_Glitch_1 = 0x1U, /*!< Prescaler divide 4, glitch filter 2 */ - kLPTMR_Prescale_Glitch_2 = 0x2U, /*!< Prescaler divide 8, glitch filter 4 */ - kLPTMR_Prescale_Glitch_3 = 0x3U, /*!< Prescaler divide 16, glitch filter 8 */ - kLPTMR_Prescale_Glitch_4 = 0x4U, /*!< Prescaler divide 32, glitch filter 16 */ - kLPTMR_Prescale_Glitch_5 = 0x5U, /*!< Prescaler divide 64, glitch filter 32 */ - kLPTMR_Prescale_Glitch_6 = 0x6U, /*!< Prescaler divide 128, glitch filter 64 */ - kLPTMR_Prescale_Glitch_7 = 0x7U, /*!< Prescaler divide 256, glitch filter 128 */ - kLPTMR_Prescale_Glitch_8 = 0x8U, /*!< Prescaler divide 512, glitch filter 256 */ - kLPTMR_Prescale_Glitch_9 = 0x9U, /*!< Prescaler divide 1024, glitch filter 512*/ - kLPTMR_Prescale_Glitch_10 = 0xAU, /*!< Prescaler divide 2048 glitch filter 1024 */ - kLPTMR_Prescale_Glitch_11 = 0xBU, /*!< Prescaler divide 4096, glitch filter 2048 */ - kLPTMR_Prescale_Glitch_12 = 0xCU, /*!< Prescaler divide 8192, glitch filter 4096 */ - kLPTMR_Prescale_Glitch_13 = 0xDU, /*!< Prescaler divide 16384, glitch filter 8192 */ - kLPTMR_Prescale_Glitch_14 = 0xEU, /*!< Prescaler divide 32768, glitch filter 16384 */ - kLPTMR_Prescale_Glitch_15 = 0xFU /*!< Prescaler divide 65536, glitch filter 32768 */ -} lptmr_prescaler_glitch_value_t; - -/*! - * @brief LPTMR prescaler/glitch filter clock select. - * @note Clock connections are SoC-specific - */ -typedef enum _lptmr_prescaler_clock_select -{ -#if !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_0_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_0_SUPPORT) - kLPTMR_PrescalerClock_0 = 0x0U, /*!< Prescaler/glitch filter clock 0 selected. */ -#endif - -#if !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT) - kLPTMR_PrescalerClock_1 = 0x1U, /*!< Prescaler/glitch filter clock 1 selected. */ -#endif /* FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT */ - -#if !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_2_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_2_SUPPORT) - kLPTMR_PrescalerClock_2 = 0x2U, /*!< Prescaler/glitch filter clock 2 selected. */ -#endif - -#if !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_3_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_3_SUPPORT) - kLPTMR_PrescalerClock_3 = 0x3U, /*!< Prescaler/glitch filter clock 3 selected. */ -#endif /* FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_3_SUPPORT */ -} lptmr_prescaler_clock_select_t; - -/*! @brief List of the LPTMR interrupts */ -typedef enum _lptmr_interrupt_enable -{ - kLPTMR_TimerInterruptEnable = LPTMR_CSR_TIE_MASK, /*!< Timer interrupt enable */ -} lptmr_interrupt_enable_t; - -/*! @brief List of the LPTMR status flags */ -typedef enum _lptmr_status_flags -{ - kLPTMR_TimerCompareFlag = LPTMR_CSR_TCF_MASK, /*!< Timer compare flag */ -} lptmr_status_flags_t; - -/*! - * @brief LPTMR config structure - * - * This structure holds the configuration settings for the LPTMR peripheral. To initialize this - * structure to reasonable defaults, call the LPTMR_GetDefaultConfig() function and pass a - * pointer to your configuration structure instance. - * - * The configuration struct can be made constant so it resides in flash. - */ -typedef struct _lptmr_config -{ - lptmr_timer_mode_t timerMode; /*!< Time counter mode or pulse counter mode */ - lptmr_pin_select_t pinSelect; /*!< LPTMR pulse input pin select; used only in pulse counter mode */ - lptmr_pin_polarity_t pinPolarity; /*!< LPTMR pulse input pin polarity; used only in pulse counter mode */ - bool enableFreeRunning; /*!< True: enable free running, counter is reset on overflow - False: counter is reset when the compare flag is set */ - bool bypassPrescaler; /*!< True: bypass prescaler; false: use clock from prescaler */ - lptmr_prescaler_clock_select_t prescalerClockSource; /*!< LPTMR clock source */ - lptmr_prescaler_glitch_value_t value; /*!< Prescaler or glitch filter value */ -} lptmr_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Ungates the LPTMR clock and configures the peripheral for a basic operation. - * - * @note This API should be called at the beginning of the application using the LPTMR driver. - * - * @param base LPTMR peripheral base address - * @param config A pointer to the LPTMR configuration structure. - */ -void LPTMR_Init(LPTMR_Type *base, const lptmr_config_t *config); - -/*! - * @brief Gates the LPTMR clock. - * - * @param base LPTMR peripheral base address - */ -void LPTMR_Deinit(LPTMR_Type *base); - -/*! - * @brief Fills in the LPTMR configuration structure with default settings. - * - * The default values are as follows. - * @code - * config->timerMode = kLPTMR_TimerModeTimeCounter; - * config->pinSelect = kLPTMR_PinSelectInput_0; - * config->pinPolarity = kLPTMR_PinPolarityActiveHigh; - * config->enableFreeRunning = false; - * config->bypassPrescaler = true; - * config->prescalerClockSource = kLPTMR_PrescalerClock_1; - * config->value = kLPTMR_Prescale_Glitch_0; - * @endcode - * @param config A pointer to the LPTMR configuration structure. - */ -void LPTMR_GetDefaultConfig(lptmr_config_t *config); - -/*! @}*/ - -/*! - * @name Interrupt Interface - * @{ - */ - -/*! - * @brief Enables the selected LPTMR interrupts. - * - * @param base LPTMR peripheral base address - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::lptmr_interrupt_enable_t - */ -static inline void LPTMR_EnableInterrupts(LPTMR_Type *base, uint32_t mask) -{ - uint32_t reg = base->CSR; - - /* Clear the TCF bit so that we don't clear this w1c bit when writing back */ - reg &= ~(LPTMR_CSR_TCF_MASK); - reg |= mask; - base->CSR = reg; -} - -/*! - * @brief Disables the selected LPTMR interrupts. - * - * @param base LPTMR peripheral base address - * @param mask The interrupts to disable. This is a logical OR of members of the - * enumeration ::lptmr_interrupt_enable_t. - */ -static inline void LPTMR_DisableInterrupts(LPTMR_Type *base, uint32_t mask) -{ - uint32_t reg = base->CSR; - - /* Clear the TCF bit so that we don't clear this w1c bit when writing back */ - reg &= ~(LPTMR_CSR_TCF_MASK); - reg &= ~mask; - base->CSR = reg; -} - -/*! - * @brief Gets the enabled LPTMR interrupts. - * - * @param base LPTMR peripheral base address - * - * @return The enabled interrupts. This is the logical OR of members of the - * enumeration ::lptmr_interrupt_enable_t - */ -static inline uint32_t LPTMR_GetEnabledInterrupts(LPTMR_Type *base) -{ - return (base->CSR & LPTMR_CSR_TIE_MASK); -} - -/*! @}*/ - -#if defined(FSL_FEATURE_LPTMR_HAS_CSR_TDRE) && (FSL_FEATURE_LPTMR_HAS_CSR_TDRE) -/*! - * @brief Enable or disable timer DMA request - * - * @param base base LPTMR peripheral base address - * @param enable Switcher of timer DMA feature. "true" means to enable, "false" means to disable. - */ -static inline void LPTMR_EnableTimerDMA(LPTMR_Type *base, bool enable) -{ - if (enable) - { - base->CSR |= LPTMR_CSR_TDRE_MASK; - } - else - { - base->CSR &= ~(LPTMR_CSR_TDRE_MASK); - } -} -#endif /* FSL_FEATURE_LPTMR_HAS_CSR_TDRE */ - -/*! - * @name Status Interface - * @{ - */ - -/*! - * @brief Gets the LPTMR status flags. - * - * @param base LPTMR peripheral base address - * - * @return The status flags. This is the logical OR of members of the - * enumeration ::lptmr_status_flags_t - */ -static inline uint32_t LPTMR_GetStatusFlags(LPTMR_Type *base) -{ - return (base->CSR & LPTMR_CSR_TCF_MASK); -} - -/*! - * @brief Clears the LPTMR status flags. - * - * @param base LPTMR peripheral base address - * @param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::lptmr_status_flags_t. - */ -static inline void LPTMR_ClearStatusFlags(LPTMR_Type *base, uint32_t mask) -{ - base->CSR |= mask; -} - -/*! @}*/ - -/*! - * @name Read and write the timer period - * @{ - */ - -/*! - * @brief Sets the timer period in units of count. - * - * Timers counts from 0 until it equals the count value set here. The count value is written to - * the CMR register. - * - * @note - * 1. The TCF flag is set with the CNR equals the count provided here and then increments. - * 2. Call the utility macros provided in the fsl_common.h to convert to ticks. - * - * @param base LPTMR peripheral base address - * @param ticks A timer period in units of ticks, which should be equal or greater than 1. - */ -static inline void LPTMR_SetTimerPeriod(LPTMR_Type *base, uint32_t ticks) -{ - assert(ticks > 0U); - base->CMR = LPTMR_CMR_COMPARE(ticks - 1U); -} - -/*! - * @brief Reads the current timer counting value. - * - * This function returns the real-time timer counting value in a range from 0 to a - * timer period. - * - * @note Call the utility macros provided in the fsl_common.h to convert ticks to usec or msec. - * - * @param base LPTMR peripheral base address - * - * @return The current counter value in ticks - */ -static inline uint32_t LPTMR_GetCurrentTimerCount(LPTMR_Type *base) -{ - /* Must first write any value to the CNR. This synchronizes and registers the current value - * of the CNR into a temporary register which can then be read - */ - base->CNR = 0U; - return (uint32_t)((base->CNR & LPTMR_CNR_COUNTER_MASK) >> LPTMR_CNR_COUNTER_SHIFT); -} - -/*! @}*/ - -/*! - * @name Timer Start and Stop - * @{ - */ - -/*! - * @brief Starts the timer. - * - * After calling this function, the timer counts up to the CMR register value. - * Each time the timer reaches the CMR value and then increments, it generates a - * trigger pulse and sets the timeout interrupt flag. An interrupt is also - * triggered if the timer interrupt is enabled. - * - * @param base LPTMR peripheral base address - */ -static inline void LPTMR_StartTimer(LPTMR_Type *base) -{ - uint32_t reg = base->CSR; - - /* Clear the TCF bit to avoid clearing the w1c bit when writing back. */ - reg &= ~(LPTMR_CSR_TCF_MASK); - reg |= LPTMR_CSR_TEN_MASK; - base->CSR = reg; -} - -/*! - * @brief Stops the timer. - * - * This function stops the timer and resets the timer's counter register. - * - * @param base LPTMR peripheral base address - */ -static inline void LPTMR_StopTimer(LPTMR_Type *base) -{ - uint32_t reg = base->CSR; - - /* Clear the TCF bit to avoid clearing the w1c bit when writing back. */ - reg &= ~(LPTMR_CSR_TCF_MASK); - reg &= ~LPTMR_CSR_TEN_MASK; - base->CSR = reg; -} - -/*! @}*/ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_LPTMR_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpuart.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpuart.c deleted file mode 100644 index 5e8de5a894b..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpuart.c +++ /dev/null @@ -1,2742 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpuart.h" - -/* - * $Coverage Justification Reference$ - * - * $Justification fsl_lpuart_c_ref_1$ - * (osr > 3) (false) can't be not covered, because osr(osrTemp) is increased from 4U. - * - * $Justification fsl_lpuart_c_ref_2$ - * The flag is cleared successfully during test. - */ -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpuart" -#endif - -/* LPUART transfer state. */ -enum -{ - kLPUART_TxIdle, /*!< TX idle. */ - kLPUART_TxBusy, /*!< TX busy. */ - kLPUART_RxIdle, /*!< RX idle. */ - kLPUART_RxBusy /*!< RX busy. */ -}; - -#if defined(LPUART_RSTS) -#define LPUART_RESETS_ARRAY LPUART_RSTS -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Check whether the RX ring buffer is full. - * - * @userData handle LPUART handle pointer. - * @retval true RX ring buffer is full. - * @retval false RX ring buffer is not full. - */ -static bool LPUART_TransferIsRxRingBufferFull(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief Write to TX register using non-blocking method. - * - * This function writes data to the TX register directly, upper layer must make - * sure the TX register is empty or TX FIFO has empty room before calling this function. - * - * @note This function does not check whether all the data has been sent out to bus, - * so before disable TX, check kLPUART_TransmissionCompleteFlag to ensure the TX is - * finished. - * - * @param base LPUART peripheral base address. - * @param data Start address of the data to write. - * @param length Size of the buffer to be sent. - */ -static void LPUART_WriteNonBlocking(LPUART_Type *base, const uint8_t *data, size_t length); -/*! - * @brief Write to TX register using non-blocking method in 9bit or 10bit mode. - * - * The 10bit of data will be writen to TX register DATA. - * Please make sure data 10bit is valid and other bit is 0. - * - * @note This function only support 9bit or 10bit transfer. - * - * @param base LPUART peripheral base address. - * @param data Start address of the data to write. - * @param length Size of the buffer to be sent. - */ -static void LPUART_WriteNonBlocking16bit(LPUART_Type *base, const uint16_t *data, size_t length); - -/*! - * @brief Read RX register using non-blocking method. - * - * This function reads data from the TX register directly, upper layer must make - * sure the RX register is full or TX FIFO has data before calling this function. - * - * @param base LPUART peripheral base address. - * @param data Start address of the buffer to store the received data. - * @param length Size of the buffer. - */ -static void LPUART_ReadNonBlocking(LPUART_Type *base, uint8_t *data, size_t length); -/*! - * @brief Read RX register using non-blocking method in 9bit or 10bit mode. - * - * This function reads 10bit data from the RX register directly and stores to 16bit data. - * - * @note This function only support 9bit or 10bit transfer. - * - * @param base LPUART peripheral base address. - * @param data Start address of the buffer to store the received data. - * @param length Size of the buffer. - */ -static void LPUART_ReadNonBlocking16bit(LPUART_Type *base, uint16_t *data, size_t length); -/*! - * @brief LPUART_TransferHandleIDLEIsReady handle function. - * This function handles when IDLE is ready. - * - * @param base LPUART peripheral base address. - * @param irqHandle LPUART handle pointer. - */ -static void LPUART_TransferHandleIDLEReady(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief LPUART_TransferHandleReceiveDataIsFull handle function. - * This function handles when receive data is full. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - */ -static void LPUART_TransferHandleReceiveDataFull(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief LPUART_TransferHandleSendDataIsEmpty handle function. - * This function handles when send data is empty. - * - * @param base LPUART peripheral base address. - * @param irqHandle LPUART handle pointer. - */ -static void LPUART_TransferHandleSendDataEmpty(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief LPUART_TransferHandleTransmissionIsComplete handle function. - * This function handles Transmission complete and the interrupt is enabled. - * - * @param base LPUART peripheral base address. - * @param irqHandle LPUART handle pointer. - */ -static void LPUART_TransferHandleTransmissionComplete(LPUART_Type *base, lpuart_handle_t *handle); - -/******************************************************************************* - * Variables - ******************************************************************************/ -#if defined(LPUART_BASE_PTRS_NS) -static LPUART_Type *const s_lpuartBases_ns[] = LPUART_BASE_PTRS_NS; -#endif -/* Array of LPUART peripheral base address. */ -static LPUART_Type *const s_lpuartBases[] = LPUART_BASE_PTRS; -/* Array of LPUART handle. */ -void *s_lpuartHandle[ARRAY_SIZE(s_lpuartBases)]; -/* Array of LPUART IRQ number. */ -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -static const IRQn_Type s_lpuartRxIRQ[] = LPUART_RX_IRQS; -const IRQn_Type s_lpuartTxIRQ[] = LPUART_TX_IRQS; -#else -const IRQn_Type s_lpuartIRQ[] = LPUART_RX_TX_IRQS; -#endif -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/* Array of LPUART clock name. */ -static const clock_ip_name_t s_lpuartClock[] = LPUART_CLOCKS; - -#if defined(LPUART_PERIPH_CLOCKS) -/* Array of LPUART functional clock name. */ -static const clock_ip_name_t s_lpuartPeriphClocks[] = LPUART_PERIPH_CLOCKS; -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/* LPUART ISR for transactional APIs. */ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -lpuart_isr_t s_lpuartIsr[ARRAY_SIZE(s_lpuartBases)] = {[0 ...(ARRAY_SIZE(s_lpuartBases) - 1)] = - (lpuart_isr_t)DefaultISR}; -#else -lpuart_isr_t s_lpuartIsr[ARRAY_SIZE(s_lpuartBases)]; -#endif - -#if defined(LPUART_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_lpuartResets[] = LPUART_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -/*! - * brief Get the LPUART instance from peripheral base address. - * - * param base LPUART peripheral base address. - * return LPUART instance. - */ -uint32_t LPUART_GetInstance(LPUART_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0U; instance < ARRAY_SIZE(s_lpuartBases); instance++) - { - if (s_lpuartBases[instance] == base) - { - return instance; - } - } -#if defined(LPUART_BASE_PTRS_NS) - /* Find the instance index from base address mappings. */ - for (instance = 0U; instance < ARRAY_SIZE(s_lpuartBases_ns); instance++) - { - if (s_lpuartBases_ns[instance] == base) - { - return instance; - } - } - assert(instance < ARRAY_SIZE(s_lpuartBases_ns)); -#else - assert(instance < ARRAY_SIZE(s_lpuartBases)); -#endif - - return instance; -} - -/*! - * brief Get the length of received data in RX ring buffer. - * - * userData handle LPUART handle pointer. - * return Length of received data in RX ring buffer. - */ -size_t LPUART_TransferGetRxRingBufferLength(LPUART_Type *base, lpuart_handle_t *handle) -{ - assert(NULL != handle); - - size_t size; - size_t tmpRxRingBufferSize = handle->rxRingBufferSize; - uint16_t tmpRxRingBufferTail = handle->rxRingBufferTail; - uint16_t tmpRxRingBufferHead = handle->rxRingBufferHead; - - if (tmpRxRingBufferTail > tmpRxRingBufferHead) - { - size = ((size_t)tmpRxRingBufferHead + tmpRxRingBufferSize - (size_t)tmpRxRingBufferTail); - } - else - { - size = ((size_t)tmpRxRingBufferHead - (size_t)tmpRxRingBufferTail); - } - - return size; -} - -static bool LPUART_TransferIsRxRingBufferFull(LPUART_Type *base, lpuart_handle_t *handle) -{ - assert(NULL != handle); - - bool full; - - if (LPUART_TransferGetRxRingBufferLength(base, handle) == (handle->rxRingBufferSize - 1U)) - { - full = true; - } - else - { - full = false; - } - return full; -} - -static void LPUART_WriteNonBlocking(LPUART_Type *base, const uint8_t *data, size_t length) -{ - assert(NULL != data); - - size_t i; - - /* The Non Blocking write data API assume user have ensured there is enough space in - peripheral to write. */ - for (i = 0; i < length; i++) - { - base->DATA = data[i]; - } -} -static void LPUART_WriteNonBlocking16bit(LPUART_Type *base, const uint16_t *data, size_t length) -{ - assert(NULL != data); - - size_t i; - - /* The Non Blocking write data API assume user have ensured there is enough space in - peripheral to write. */ - for (i = 0; i < length; i++) - { - base->DATA = data[i]; - } -} - -static void LPUART_ReadNonBlocking(LPUART_Type *base, uint8_t *data, size_t length) -{ - assert(NULL != data); - - size_t i; -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - uint32_t ctrl = base->CTRL; - bool isSevenDataBits = (((ctrl & LPUART_CTRL_M7_MASK) != 0U) || - (((ctrl & LPUART_CTRL_M_MASK) == 0U) && ((ctrl & LPUART_CTRL_PE_MASK) != 0U))); -#endif - - /* The Non Blocking read data API assume user have ensured there is enough space in - peripheral to write. */ - for (i = 0; i < length; i++) - { -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - if (isSevenDataBits) - { - data[i] = (uint8_t)(base->DATA & 0x7FU); - } - else - { - data[i] = (uint8_t)base->DATA; - } -#else - data[i] = (uint8_t)(base->DATA); -#endif - } -} - -static void LPUART_ReadNonBlocking16bit(LPUART_Type *base, uint16_t *data, size_t length) -{ - assert(NULL != data); - - size_t i; - /* The Non Blocking read data API assume user have ensured there is enough space in - peripheral to write. */ - for (i = 0; i < length; i++) - { - data[i] = (uint16_t)(base->DATA & 0x03FFU); - } -} - -/*! - * brief Initializes an LPUART instance with the user configuration structure and the peripheral clock. - * - * This function configures the LPUART module with user-defined settings. Call the LPUART_GetDefaultConfig() function - * to configure the configuration structure and get the default configuration. - * The example below shows how to use this API to configure the LPUART. - * code - * lpuart_config_t lpuartConfig; - * lpuartConfig.baudRate_Bps = 115200U; - * lpuartConfig.parityMode = kLPUART_ParityDisabled; - * lpuartConfig.dataBitsCount = kLPUART_EightDataBits; - * lpuartConfig.isMsb = false; - * lpuartConfig.stopBitCount = kLPUART_OneStopBit; - * lpuartConfig.txFifoWatermark = 0; - * lpuartConfig.rxFifoWatermark = 1; - * LPUART_Init(LPUART1, &lpuartConfig, 20000000U); - * endcode - * - * param base LPUART peripheral base address. - * param config Pointer to a user-defined configuration structure. - * param srcClock_Hz LPUART clock source frequency in HZ. - * retval kStatus_LPUART_BaudrateNotSupport Baudrate is not support in current clock source. - * retval kStatus_Success LPUART initialize succeed - */ -status_t LPUART_Init(LPUART_Type *base, const lpuart_config_t *config, uint32_t srcClock_Hz) -{ - assert(NULL != config); - assert(0U < config->baudRate_Bps); -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - assert((uint8_t)FSL_FEATURE_LPUART_FIFO_SIZEn(base) > config->txFifoWatermark); - assert((uint8_t)FSL_FEATURE_LPUART_FIFO_SIZEn(base) > config->rxFifoWatermark); -#endif - - status_t status = kStatus_Success; - uint32_t temp; - uint16_t sbr, sbrTemp; - uint8_t osr, osrTemp; - uint32_t tempDiff, calculatedBaud, baudDiff; - - /* This LPUART instantiation uses a slightly different baud rate calculation - * The idea is to use the best OSR (over-sampling rate) possible - * Note, OSR is typically hard-set to 16 in other LPUART instantiations - * loop to find the best OSR value possible, one that generates minimum baudDiff - * iterate through the rest of the supported values of OSR */ - - baudDiff = config->baudRate_Bps; - osr = 0U; - sbr = 0U; - for (osrTemp = 4U; osrTemp <= 32U; osrTemp++) - { - /* calculate the temporary sbr value */ - sbrTemp = (uint16_t)((srcClock_Hz * 2U / (config->baudRate_Bps * (uint32_t)osrTemp) + 1U) / 2U); - /*set sbrTemp to 1 if the sourceClockInHz can not satisfy the desired baud rate*/ - if (sbrTemp == 0U) - { - sbrTemp = 1U; - } - else if (sbrTemp > LPUART_BAUD_SBR_MASK) - { - sbrTemp = LPUART_BAUD_SBR_MASK; - } - else - { - /* Avoid MISRA 15.7 */ - } - /* Calculate the baud rate based on the temporary OSR and SBR values */ - calculatedBaud = (srcClock_Hz / ((uint32_t)osrTemp * (uint32_t)sbrTemp)); - tempDiff = calculatedBaud > config->baudRate_Bps ? (calculatedBaud - config->baudRate_Bps) : - (config->baudRate_Bps - calculatedBaud); - - if (tempDiff <= baudDiff) - { - baudDiff = tempDiff; - osr = osrTemp; /* update and store the best OSR value calculated */ - sbr = sbrTemp; /* update store the best SBR value calculated */ - } - } - - /* Check to see if actual baud rate is within 3% of desired baud rate - * based on the best calculate OSR value */ - if (baudDiff > ((config->baudRate_Bps / 100U) * 3U)) - { - /* Unacceptable baud rate difference of more than 3%*/ - status = kStatus_LPUART_BaudrateNotSupport; - } - else - { -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - - uint32_t instance = LPUART_GetInstance(base); - - /* Enable lpuart clock */ - (void)CLOCK_EnableClock(s_lpuartClock[instance]); -#if defined(LPUART_PERIPH_CLOCKS) - (void)CLOCK_EnableClock(s_lpuartPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(LPUART_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_lpuartResets[LPUART_GetInstance(base)]); -#endif - -#if defined(FSL_FEATURE_LPUART_HAS_GLOBAL) && FSL_FEATURE_LPUART_HAS_GLOBAL - /*Reset all internal logic and registers, except the Global Register */ - LPUART_SoftwareReset(base); -#else - /* Disable LPUART TX RX before setting. */ - base->CTRL &= ~(LPUART_CTRL_TE_MASK | LPUART_CTRL_RE_MASK); -#endif - - temp = base->BAUD; - - /* Acceptable baud rate, check if OSR is between 4x and 7x oversampling. - * If so, then "BOTHEDGE" sampling must be turned on */ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_1$ - */ - if ((osr > 3U) && (osr < 8U)) - { - temp |= LPUART_BAUD_BOTHEDGE_MASK; - } - - /* program the osr value (bit value is one less than actual value) */ - temp &= ~LPUART_BAUD_OSR_MASK; - temp |= LPUART_BAUD_OSR((uint32_t)osr - 1UL); - - /* write the sbr value to the BAUD registers */ - temp &= ~LPUART_BAUD_SBR_MASK; - base->BAUD = temp | LPUART_BAUD_SBR(sbr); - - /* Set bit count and parity mode. */ - base->BAUD &= ~LPUART_BAUD_M10_MASK; - - temp = base->CTRL & ~(LPUART_CTRL_PE_MASK | LPUART_CTRL_PT_MASK | LPUART_CTRL_M_MASK | LPUART_CTRL_ILT_MASK | - LPUART_CTRL_IDLECFG_MASK); - - temp |= (uint8_t)config->parityMode | LPUART_CTRL_IDLECFG(config->rxIdleConfig) | - LPUART_CTRL_ILT(config->rxIdleType); - -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - if (kLPUART_SevenDataBits == config->dataBitsCount) - { - if (kLPUART_ParityDisabled != config->parityMode) - { - temp &= ~LPUART_CTRL_M7_MASK; /* Seven data bits and one parity bit */ - } - else - { - temp |= LPUART_CTRL_M7_MASK; - } - } - else -#endif - { - if (kLPUART_ParityDisabled != config->parityMode) - { - temp |= LPUART_CTRL_M_MASK; /* Eight data bits and one parity bit */ - } - } - - base->CTRL = temp; - -#if defined(FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT) && FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT - /* set stop bit per char */ - temp = base->BAUD & ~LPUART_BAUD_SBNS_MASK; - base->BAUD = temp | LPUART_BAUD_SBNS((uint8_t)config->stopBitCount); -#endif - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Set tx/rx WATER watermark - Note: - Take care of the RX FIFO, RX interrupt request only assert when received bytes - equal or more than RX water mark, there is potential issue if RX water - mark larger than 1. - For example, if RX FIFO water mark is 2, upper layer needs 5 bytes and - 5 bytes are received. the last byte will be saved in FIFO but not trigger - RX interrupt because the water mark is 2. - */ - base->WATER = (((uint32_t)(config->rxFifoWatermark) << 16U) | config->txFifoWatermark); - - /* Enable tx/rx FIFO */ - base->FIFO |= (LPUART_FIFO_TXFE_MASK | LPUART_FIFO_RXFE_MASK); - - /* Flush FIFO */ - base->FIFO |= (LPUART_FIFO_TXFLUSH_MASK | LPUART_FIFO_RXFLUSH_MASK); -#endif - - /* Clear all status flags */ - temp = (LPUART_STAT_RXEDGIF_MASK | LPUART_STAT_IDLE_MASK | LPUART_STAT_OR_MASK | LPUART_STAT_NF_MASK | - LPUART_STAT_FE_MASK | LPUART_STAT_PF_MASK); - -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - temp |= LPUART_STAT_LBKDIF_MASK; -#endif - -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - temp |= (LPUART_STAT_MA1F_MASK | LPUART_STAT_MA2F_MASK); -#endif - -#if defined(FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT) && FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT - /* Set the CTS configuration/TX CTS source. */ - base->MODIR |= LPUART_MODIR_TXCTSC(config->txCtsConfig) | LPUART_MODIR_TXCTSSRC(config->txCtsSource); - if (true == config->enableRxRTS) - { - /* Enable the receiver RTS(request-to-send) function. */ - base->MODIR |= LPUART_MODIR_RXRTSE_MASK; - } - if (true == config->enableTxCTS) - { - /* Enable the CTS(clear-to-send) function. */ - base->MODIR |= LPUART_MODIR_TXCTSE_MASK; - } -#endif - - /* Set data bits order. */ - if (true == config->isMsb) - { - temp |= LPUART_STAT_MSBF_MASK; - } - else - { - temp &= ~LPUART_STAT_MSBF_MASK; - } - - base->STAT |= temp; - - /* Enable TX/RX base on configure structure. */ - temp = base->CTRL; - if (true == config->enableTx) - { - temp |= LPUART_CTRL_TE_MASK; - } - - if (true == config->enableRx) - { - temp |= LPUART_CTRL_RE_MASK; - } - - base->CTRL = temp; - } - - return status; -} -/*! - * brief Deinitializes a LPUART instance. - * - * This function waits for transmit to complete, disables TX and RX, and disables the LPUART clock. - * - * param base LPUART peripheral base address. - */ -void LPUART_Deinit(LPUART_Type *base) -{ - uint32_t temp; - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Wait tx FIFO send out*/ - while (0U != ((base->WATER & LPUART_WATER_TXCOUNT_MASK) >> LPUART_WATER_TXWATER_SHIFT)) - { - } -#endif - /* Wait last char shift out */ - while (0U == (base->STAT & LPUART_STAT_TC_MASK)) - { - } - - /* Clear all status flags */ - temp = (LPUART_STAT_RXEDGIF_MASK | LPUART_STAT_IDLE_MASK | LPUART_STAT_OR_MASK | LPUART_STAT_NF_MASK | - LPUART_STAT_FE_MASK | LPUART_STAT_PF_MASK); - -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - temp |= LPUART_STAT_LBKDIF_MASK; -#endif - -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - temp |= (LPUART_STAT_MA1F_MASK | LPUART_STAT_MA2F_MASK); -#endif - - base->STAT |= temp; - - /* Disable the module. */ - base->CTRL = 0U; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - uint32_t instance = LPUART_GetInstance(base); - - /* Disable lpuart clock */ - (void)CLOCK_DisableClock(s_lpuartClock[instance]); - -#if defined(LPUART_PERIPH_CLOCKS) - (void)CLOCK_DisableClock(s_lpuartPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Gets the default configuration structure. - * - * This function initializes the LPUART configuration structure to a default value. The default - * values are: - * lpuartConfig->baudRate_Bps = 115200U; - * lpuartConfig->parityMode = kLPUART_ParityDisabled; - * lpuartConfig->dataBitsCount = kLPUART_EightDataBits; - * lpuartConfig->isMsb = false; - * lpuartConfig->stopBitCount = kLPUART_OneStopBit; - * lpuartConfig->txFifoWatermark = 0; - * lpuartConfig->rxFifoWatermark = 1; - * lpuartConfig->rxIdleType = kLPUART_IdleTypeStartBit; - * lpuartConfig->rxIdleConfig = kLPUART_IdleCharacter1; - * lpuartConfig->enableTx = false; - * lpuartConfig->enableRx = false; - * - * param config Pointer to a configuration structure. - */ -void LPUART_GetDefaultConfig(lpuart_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->baudRate_Bps = 115200U; - config->parityMode = kLPUART_ParityDisabled; - config->dataBitsCount = kLPUART_EightDataBits; - config->isMsb = false; -#if defined(FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT) && FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT - config->stopBitCount = kLPUART_OneStopBit; -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - config->txFifoWatermark = 0U; - config->rxFifoWatermark = 0U; -#endif -#if defined(FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT) && FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT - config->enableRxRTS = false; - config->enableTxCTS = false; - config->txCtsConfig = kLPUART_CtsSampleAtStart; - config->txCtsSource = kLPUART_CtsSourcePin; -#endif - config->rxIdleType = kLPUART_IdleTypeStartBit; - config->rxIdleConfig = kLPUART_IdleCharacter1; - config->enableTx = false; - config->enableRx = false; -} - -/*! - * brief Sets the LPUART instance baudrate. - * - * This function configures the LPUART module baudrate. This function is used to update - * the LPUART module baudrate after the LPUART module is initialized by the LPUART_Init. - * code - * LPUART_SetBaudRate(LPUART1, 115200U, 20000000U); - * endcode - * - * param base LPUART peripheral base address. - * param baudRate_Bps LPUART baudrate to be set. - * param srcClock_Hz LPUART clock source frequency in HZ. - * retval kStatus_LPUART_BaudrateNotSupport Baudrate is not supported in the current clock source. - * retval kStatus_Success Set baudrate succeeded. - */ -status_t LPUART_SetBaudRate(LPUART_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz) -{ - assert(0U < baudRate_Bps); - - status_t status = kStatus_Success; - uint32_t temp, oldCtrl; - uint16_t sbr, sbrTemp; - uint8_t osr, osrTemp; - uint32_t tempDiff, calculatedBaud, baudDiff; - - /* This LPUART instantiation uses a slightly different baud rate calculation - * The idea is to use the best OSR (over-sampling rate) possible - * Note, OSR is typically hard-set to 16 in other LPUART instantiations - * loop to find the best OSR value possible, one that generates minimum baudDiff - * iterate through the rest of the supported values of OSR */ - - baudDiff = baudRate_Bps; - osr = 0U; - sbr = 0U; - for (osrTemp = 4U; osrTemp <= 32U; osrTemp++) - { - /* calculate the temporary sbr value */ - sbrTemp = (uint16_t)((srcClock_Hz * 2U / (baudRate_Bps * (uint32_t)osrTemp) + 1U) / 2U); - /*set sbrTemp to 1 if the sourceClockInHz can not satisfy the desired baud rate*/ - if (sbrTemp == 0U) - { - sbrTemp = 1U; - } - else if (sbrTemp > LPUART_BAUD_SBR_MASK) - { - sbrTemp = LPUART_BAUD_SBR_MASK; - } - else - { - /* Avoid MISRA 15.7 */ - } - /* Calculate the baud rate based on the temporary OSR and SBR values */ - calculatedBaud = srcClock_Hz / ((uint32_t)osrTemp * (uint32_t)sbrTemp); - - tempDiff = calculatedBaud > baudRate_Bps ? (calculatedBaud - baudRate_Bps) : (baudRate_Bps - calculatedBaud); - - if (tempDiff <= baudDiff) - { - baudDiff = tempDiff; - osr = osrTemp; /* update and store the best OSR value calculated */ - sbr = sbrTemp; /* update store the best SBR value calculated */ - } - } - - /* Check to see if actual baud rate is within 3% of desired baud rate - * based on the best calculate OSR value */ - if (baudDiff < (uint32_t)((baudRate_Bps / 100U) * 3U)) - { - /* Store CTRL before disable Tx and Rx */ - oldCtrl = base->CTRL; - - /* Disable LPUART TX RX before setting. */ - base->CTRL &= ~(LPUART_CTRL_TE_MASK | LPUART_CTRL_RE_MASK); - - temp = base->BAUD; - - /* Acceptable baud rate, check if OSR is between 4x and 7x oversampling. - * If so, then "BOTHEDGE" sampling must be turned on */ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_1$ - */ - if ((osr > 3U) && (osr < 8U)) - { - temp |= LPUART_BAUD_BOTHEDGE_MASK; - } - - /* program the osr value (bit value is one less than actual value) */ - temp &= ~LPUART_BAUD_OSR_MASK; - temp |= LPUART_BAUD_OSR((uint32_t)osr - 1UL); - - /* write the sbr value to the BAUD registers */ - temp &= ~LPUART_BAUD_SBR_MASK; - base->BAUD = temp | LPUART_BAUD_SBR(sbr); - - /* Restore CTRL. */ - base->CTRL = oldCtrl; - } - else - { - /* Unacceptable baud rate difference of more than 3%*/ - status = kStatus_LPUART_BaudrateNotSupport; - } - - return status; -} - -/*! - * brief Enable 9-bit data mode for LPUART. - * - * This function set the 9-bit mode for LPUART module. The 9th bit is not used for parity thus can be modified by user. - * - * param base LPUART peripheral base address. - * param enable true to enable, flase to disable. - */ -void LPUART_Enable9bitMode(LPUART_Type *base, bool enable) -{ - assert(base != NULL); - - uint32_t temp = 0U; - - if (enable) - { - /* Set LPUART_CTRL_M for 9-bit mode, clear LPUART_CTRL_PE to disable parity. */ - temp = base->CTRL & ~((uint32_t)LPUART_CTRL_PE_MASK | (uint32_t)LPUART_CTRL_M_MASK); - temp |= (uint32_t)LPUART_CTRL_M_MASK; - base->CTRL = temp; - } - else - { - /* Clear LPUART_CTRL_M. */ - base->CTRL &= ~(uint32_t)LPUART_CTRL_M_MASK; - } -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - /* Clear LPUART_CTRL_M7 to disable 7-bit mode. */ - base->CTRL &= ~(uint32_t)LPUART_CTRL_M7_MASK; -#endif -#if defined(FSL_FEATURE_LPUART_HAS_10BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_10BIT_DATA_SUPPORT - /* Clear LPUART_BAUD_M10 to disable 10-bit mode. */ - base->BAUD &= ~(uint32_t)LPUART_BAUD_M10_MASK; -#endif -} - -/*! - * brief Transmit an address frame in 9-bit data mode. - * - * param base LPUART peripheral base address. - * param address LPUART slave address. - */ -void LPUART_SendAddress(LPUART_Type *base, uint8_t address) -{ - assert(base != NULL); - - uint32_t temp = base->DATA & 0xFFFFFC00UL; - temp |= ((uint32_t)address | (1UL << LPUART_DATA_R8T8_SHIFT)); - base->DATA = temp; -} - -/*! - * brief Enables LPUART interrupts according to a provided mask. - * - * This function enables the LPUART interrupts according to a provided mask. The mask - * is a logical OR of enumeration members. See the ref _lpuart_interrupt_enable. - * This examples shows how to enable TX empty interrupt and RX full interrupt: - * code - * LPUART_EnableInterrupts(LPUART1,kLPUART_TxDataRegEmptyInterruptEnable | kLPUART_RxDataRegFullInterruptEnable); - * endcode - * - * param base LPUART peripheral base address. - * param mask The interrupts to enable. Logical OR of ref _lpuart_interrupt_enable. - */ -void LPUART_EnableInterrupts(LPUART_Type *base, uint32_t mask) -{ - uint32_t s_atomicOldInt; - /* Only consider the real interrupt enable bits. */ - mask &= (uint32_t)kLPUART_AllInterruptEnable; - - /* Check int enable bits in base->BAUD */ - uint32_t baudRegMask = 0UL; -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - baudRegMask |= ((mask << 8U) & LPUART_BAUD_LBKDIE_MASK); - /* Clear bit 7 from mask */ - mask &= ~(uint32_t)kLPUART_LinBreakInterruptEnable; -#endif - baudRegMask |= ((mask << 8U) & LPUART_BAUD_RXEDGIE_MASK); - /* Clear bit 6 from mask */ - mask &= ~(uint32_t)kLPUART_RxActiveEdgeInterruptEnable; - - s_atomicOldInt = DisableGlobalIRQ(); - base->BAUD |= baudRegMask; - EnableGlobalIRQ(s_atomicOldInt); - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Check int enable bits in base->FIFO */ - - s_atomicOldInt = DisableGlobalIRQ(); - base->FIFO = (base->FIFO & ~(LPUART_FIFO_TXOF_MASK | LPUART_FIFO_RXUF_MASK)) | - (mask & (LPUART_FIFO_TXOFE_MASK | LPUART_FIFO_RXUFE_MASK)); - EnableGlobalIRQ(s_atomicOldInt); - - /* Clear bit 9 and bit 8 from mask */ - mask &= ~((uint32_t)kLPUART_TxFifoOverflowInterruptEnable | (uint32_t)kLPUART_RxFifoUnderflowInterruptEnable); -#endif - - /* Set int enable bits in base->CTRL */ - s_atomicOldInt = DisableGlobalIRQ(); - base->CTRL |= mask; - EnableGlobalIRQ(s_atomicOldInt); -} - -/*! - * brief Disables LPUART interrupts according to a provided mask. - * - * This function disables the LPUART interrupts according to a provided mask. The mask - * is a logical OR of enumeration members. See ref _lpuart_interrupt_enable. - * This example shows how to disable the TX empty interrupt and RX full interrupt: - * code - * LPUART_DisableInterrupts(LPUART1,kLPUART_TxDataRegEmptyInterruptEnable | kLPUART_RxDataRegFullInterruptEnable); - * endcode - * - * param base LPUART peripheral base address. - * param mask The interrupts to disable. Logical OR of ref _lpuart_interrupt_enable. - */ -void LPUART_DisableInterrupts(LPUART_Type *base, uint32_t mask) -{ - uint32_t s_atomicOldInt; - /* Only consider the real interrupt enable bits. */ - mask &= (uint32_t)kLPUART_AllInterruptEnable; - - /* Clear int enable bits in base->BAUD */ - uint32_t baudRegMask = 0UL; -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - baudRegMask |= ((mask << 8U) & LPUART_BAUD_LBKDIE_MASK); - /* Clear bit 7 from mask */ - mask &= ~(uint32_t)kLPUART_LinBreakInterruptEnable; -#endif - baudRegMask |= ((mask << 8U) & LPUART_BAUD_RXEDGIE_MASK); - /* Clear bit 6 from mask */ - mask &= ~(uint32_t)kLPUART_RxActiveEdgeInterruptEnable; - - s_atomicOldInt = DisableGlobalIRQ(); - base->BAUD &= ~baudRegMask; - EnableGlobalIRQ(s_atomicOldInt); - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Clear int enable bits in base->FIFO */ - - s_atomicOldInt = DisableGlobalIRQ(); - base->FIFO = (base->FIFO & ~(LPUART_FIFO_TXOF_MASK | LPUART_FIFO_RXUF_MASK)) & - ~(mask & (LPUART_FIFO_TXOFE_MASK | LPUART_FIFO_RXUFE_MASK)); - EnableGlobalIRQ(s_atomicOldInt); - /* Clear bit 9 and bit 8 from mask */ - mask &= ~((uint32_t)kLPUART_TxFifoOverflowInterruptEnable | (uint32_t)kLPUART_RxFifoUnderflowInterruptEnable); -#endif - - /* Clear int enable bits in base->CTRL */ - s_atomicOldInt = DisableGlobalIRQ(); - base->CTRL &= ~mask; - EnableGlobalIRQ(s_atomicOldInt); -} - -/*! - * brief Gets enabled LPUART interrupts. - * - * This function gets the enabled LPUART interrupts. The enabled interrupts are returned - * as the logical OR value of the enumerators ref _lpuart_interrupt_enable. To check - * a specific interrupt enable status, compare the return value with enumerators - * in ref _lpuart_interrupt_enable. - * For example, to check whether the TX empty interrupt is enabled: - * code - * uint32_t enabledInterrupts = LPUART_GetEnabledInterrupts(LPUART1); - * - * if (kLPUART_TxDataRegEmptyInterruptEnable & enabledInterrupts) - * { - * ... - * } - * endcode - * - * param base LPUART peripheral base address. - * return LPUART interrupt flags which are logical OR of the enumerators in ref _lpuart_interrupt_enable. - */ -uint32_t LPUART_GetEnabledInterrupts(LPUART_Type *base) -{ - /* Check int enable bits in base->CTRL */ - uint32_t temp = (uint32_t)(base->CTRL & (uint32_t)kLPUART_AllInterruptEnable); - - /* Check int enable bits in base->BAUD */ - temp = (temp & ~(uint32_t)kLPUART_RxActiveEdgeInterruptEnable) | ((base->BAUD & LPUART_BAUD_RXEDGIE_MASK) >> 8U); -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - temp = (temp & ~(uint32_t)kLPUART_LinBreakInterruptEnable) | ((base->BAUD & LPUART_BAUD_LBKDIE_MASK) >> 8U); -#endif - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Check int enable bits in base->FIFO */ - temp = - (temp & ~((uint32_t)kLPUART_TxFifoOverflowInterruptEnable | (uint32_t)kLPUART_RxFifoUnderflowInterruptEnable)) | - (base->FIFO & (LPUART_FIFO_TXOFE_MASK | LPUART_FIFO_RXUFE_MASK)); -#endif - - return temp; -} - -/*! - * brief Gets LPUART status flags. - * - * This function gets all LPUART status flags. The flags are returned as the logical - * OR value of the enumerators ref _lpuart_flags. To check for a specific status, - * compare the return value with enumerators in the ref _lpuart_flags. - * For example, to check whether the TX is empty: - * code - * if (kLPUART_TxDataRegEmptyFlag & LPUART_GetStatusFlags(LPUART1)) - * { - * ... - * } - * endcode - * - * param base LPUART peripheral base address. - * return LPUART status flags which are ORed by the enumerators in the _lpuart_flags. - */ -uint32_t LPUART_GetStatusFlags(LPUART_Type *base) -{ - uint32_t temp; - temp = base->STAT; -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - temp |= (base->FIFO & - (LPUART_FIFO_TXEMPT_MASK | LPUART_FIFO_RXEMPT_MASK | LPUART_FIFO_TXOF_MASK | LPUART_FIFO_RXUF_MASK)) >> - 16U; -#endif - /* Only keeps the status bits */ - temp &= (uint32_t)kLPUART_AllFlags; - return temp; -} - -/*! - * brief Clears status flags with a provided mask. - * - * This function clears LPUART status flags with a provided mask. Automatically cleared flags - * can't be cleared by this function. - * Flags that can only cleared or set by hardware are: - * kLPUART_TxDataRegEmptyFlag, kLPUART_TransmissionCompleteFlag, kLPUART_RxDataRegFullFlag, - * kLPUART_RxActiveFlag, kLPUART_NoiseErrorFlag, kLPUART_ParityErrorFlag, - * kLPUART_TxFifoEmptyFlag,kLPUART_RxFifoEmptyFlag - * Note: This API should be called when the Tx/Rx is idle, otherwise it takes no effects. - * - * param base LPUART peripheral base address. - * param mask the status flags to be cleared. The user can use the enumerators in the - * _lpuart_status_flag_t to do the OR operation and get the mask. - * return 0 succeed, others failed. - * retval kStatus_LPUART_FlagCannotClearManually The flag can't be cleared by this function but - * it is cleared automatically by hardware. - * retval kStatus_Success Status in the mask are cleared. - */ -status_t LPUART_ClearStatusFlags(LPUART_Type *base, uint32_t mask) -{ - uint32_t temp; - status_t status; - - /* Only deal with the clearable flags */ - mask &= (uint32_t)kLPUART_AllClearFlags; -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Status bits in FIFO register */ - if ((mask & ((uint32_t)kLPUART_TxFifoOverflowFlag | (uint32_t)kLPUART_RxFifoUnderflowFlag)) != 0U) - { - /* Get the FIFO register value and mask the rx/tx FIFO flush bits and the status bits that can be W1C in case - they are written 1 accidentally. */ - temp = (uint32_t)base->FIFO; - temp &= (uint32_t)(~(LPUART_FIFO_TXFLUSH_MASK | LPUART_FIFO_RXFLUSH_MASK | LPUART_FIFO_TXOF_MASK | - LPUART_FIFO_RXUF_MASK)); - temp |= (mask << 16U) & (LPUART_FIFO_TXOF_MASK | LPUART_FIFO_RXUF_MASK); - base->FIFO = temp; - } -#endif - /* Status bits in STAT register */ - /* First get the STAT register value and mask all the bits that not represent status, then OR with the status bit - * that is to be W1C */ - temp = (base->STAT & 0x3E000000UL) | mask; - base->STAT = temp; - /* If some flags still pending. */ - if (0U != (mask & LPUART_GetStatusFlags(base))) - { - status = kStatus_LPUART_FlagCannotClearManually; - } - else - { - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Writes to the transmitter register using a blocking method. - * - * This function polls the transmitter register, first waits for the register to be empty or TX FIFO to have room, - * and writes data to the transmitter buffer, then waits for the data to be sent out to bus. - * - * param base LPUART peripheral base address. - * param data Start address of the data to write. - * param length Size of the data to write. - * retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * retval kStatus_Success Successfully wrote all data. - */ -status_t LPUART_WriteBlocking(LPUART_Type *base, const uint8_t *data, size_t length) -{ - assert(NULL != data); - - const uint8_t *dataAddress = data; - size_t transferSize = length; - -#if UART_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != transferSize) - { -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; - while ((0U == (base->STAT & LPUART_STAT_TDRE_MASK)) && (0U != --waitTimes)) -#else - while (0U == (base->STAT & LPUART_STAT_TDRE_MASK)) -#endif - { - } -#if UART_RETRY_TIMES - if (0U == waitTimes) - { - return kStatus_LPUART_Timeout; - } -#endif - base->DATA = *(dataAddress); - dataAddress++; - transferSize--; - } - /* Ensure all the data in the transmit buffer are sent out to bus. */ -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; - while ((0U == (base->STAT & LPUART_STAT_TC_MASK)) && (0U != --waitTimes)) -#else - while (0U == (base->STAT & LPUART_STAT_TC_MASK)) -#endif - { - } -#if UART_RETRY_TIMES - if (0U == waitTimes) - { - return kStatus_LPUART_Timeout; - } -#endif - return kStatus_Success; -} -/*! - * brief Writes to the transmitter register using a blocking method in 9bit or 10bit mode. - * - * note This function only support 9bit or 10bit transfer. - * Please make sure only 10bit of data is valid and other bits are 0. - * - * param base LPUART peripheral base address. - * param data Start address of the data to write. - * param length Size of the data to write. - * retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * retval kStatus_Success Successfully wrote all data. - */ -status_t LPUART_WriteBlocking16bit(LPUART_Type *base, const uint16_t *data, size_t length) -{ - assert(NULL != data); - - const uint16_t *dataAddress = data; - size_t transferSize = length; - -#if UART_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != transferSize) - { -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; - while ((0U == (base->STAT & LPUART_STAT_TDRE_MASK)) && (0U != --waitTimes)) -#else - while (0U == (base->STAT & LPUART_STAT_TDRE_MASK)) -#endif - { - } -#if UART_RETRY_TIMES - if (0U == waitTimes) - { - return kStatus_LPUART_Timeout; - } -#endif - base->DATA = *(dataAddress); - dataAddress++; - transferSize--; - } - /* Ensure all the data in the transmit buffer are sent out to bus. */ -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; - while ((0U == (base->STAT & LPUART_STAT_TC_MASK)) && (0U != --waitTimes)) -#else - while (0U == (base->STAT & LPUART_STAT_TC_MASK)) -#endif - { - } -#if UART_RETRY_TIMES - if (0U == waitTimes) - { - return kStatus_LPUART_Timeout; - } -#endif - return kStatus_Success; -} - -/*! - * brief Reads the receiver data register using a blocking method. - * - * This function polls the receiver register, waits for the receiver register full or receiver FIFO - * has data, and reads data from the TX register. - * - * param base LPUART peripheral base address. - * param data Start address of the buffer to store the received data. - * param length Size of the buffer. - * retval kStatus_LPUART_RxHardwareOverrun Receiver overrun happened while receiving data. - * retval kStatus_LPUART_NoiseError Noise error happened while receiving data. - * retval kStatus_LPUART_FramingError Framing error happened while receiving data. - * retval kStatus_LPUART_ParityError Parity error happened while receiving data. - * retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * retval kStatus_Success Successfully received all data. - */ -status_t LPUART_ReadBlocking(LPUART_Type *base, uint8_t *data, size_t length) -{ - assert(NULL != data); - - status_t status = kStatus_Success; - uint32_t statusFlag; - uint8_t *dataAddress = data; - -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - uint32_t ctrl = base->CTRL; - bool isSevenDataBits = (((ctrl & LPUART_CTRL_M7_MASK) != 0U) || - (((ctrl & LPUART_CTRL_M_MASK) == 0U) && ((ctrl & LPUART_CTRL_PE_MASK) != 0U))); -#endif - -#if UART_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != (length--)) - { -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - while (0U == ((base->WATER & LPUART_WATER_RXCOUNT_MASK) >> LPUART_WATER_RXCOUNT_SHIFT)) -#else - while (0U == (base->STAT & LPUART_STAT_RDRF_MASK)) -#endif - { -#if UART_RETRY_TIMES - if (0U == --waitTimes) - { - status = kStatus_LPUART_Timeout; - break; - } -#endif - statusFlag = LPUART_GetStatusFlags(base); - - if (0U != (statusFlag & (uint32_t)kLPUART_RxOverrunFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_RxOverrunFlag)) ? - (kStatus_LPUART_RxHardwareOverrun) : - (kStatus_LPUART_FlagCannotClearManually)); - /* Other error flags(FE, NF, and PF) are prevented from setting once OR is set, no need to check other - * error flags*/ - break; - } - - if (0U != (statusFlag & (uint32_t)kLPUART_ParityErrorFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_ParityErrorFlag)) ? - (kStatus_LPUART_ParityError) : - (kStatus_LPUART_FlagCannotClearManually)); - } - - if (0U != (statusFlag & (uint32_t)kLPUART_FramingErrorFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_FramingErrorFlag)) ? - (kStatus_LPUART_FramingError) : - (kStatus_LPUART_FlagCannotClearManually)); - } - - if (0U != (statusFlag & (uint32_t)kLPUART_NoiseErrorFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_NoiseErrorFlag)) ? - (kStatus_LPUART_NoiseError) : - (kStatus_LPUART_FlagCannotClearManually)); - } - if (kStatus_Success != status) - { - break; - } - } - - if (kStatus_Success == status) - { -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - if (isSevenDataBits) - { - *(dataAddress) = (uint8_t)(base->DATA & 0x7FU); - dataAddress++; - } - else - { - *(dataAddress) = (uint8_t)base->DATA; - dataAddress++; - } -#else - *(dataAddress) = (uint8_t)base->DATA; - dataAddress++; -#endif - } - else - { - break; - } - } - - return status; -} -/*! - * brief Reads the receiver data register in 9bit or 10bit mode. - * - * note This function only support 9bit or 10bit transfer. - * - * param base LPUART peripheral base address. - * param data Start address of the buffer to store the received data by 16bit, only 10bit is valid. - * param length Size of the buffer. - * retval kStatus_LPUART_RxHardwareOverrun Receiver overrun happened while receiving data. - * retval kStatus_LPUART_NoiseError Noise error happened while receiving data. - * retval kStatus_LPUART_FramingError Framing error happened while receiving data. - * retval kStatus_LPUART_ParityError Parity error happened while receiving data. - * retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * retval kStatus_Success Successfully received all data. - */ -status_t LPUART_ReadBlocking16bit(LPUART_Type *base, uint16_t *data, size_t length) -{ - assert(NULL != data); - - status_t status = kStatus_Success; - uint32_t statusFlag; - uint16_t *dataAddress = data; - -#if UART_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != (length--)) - { -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - while (0U == ((base->WATER & LPUART_WATER_RXCOUNT_MASK) >> LPUART_WATER_RXCOUNT_SHIFT)) -#else - while (0U == (base->STAT & LPUART_STAT_RDRF_MASK)) -#endif - { -#if UART_RETRY_TIMES - if (0U == --waitTimes) - { - status = kStatus_LPUART_Timeout; - break; - } -#endif - statusFlag = LPUART_GetStatusFlags(base); - - if (0U != (statusFlag & (uint32_t)kLPUART_RxOverrunFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_RxOverrunFlag)) ? - (kStatus_LPUART_RxHardwareOverrun) : - (kStatus_LPUART_FlagCannotClearManually)); - /* Other error flags(FE, NF, and PF) are prevented from setting once OR is set, no need to check other - * error flags*/ - break; - } - - if (0U != (statusFlag & (uint32_t)kLPUART_ParityErrorFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_ParityErrorFlag)) ? - (kStatus_LPUART_ParityError) : - (kStatus_LPUART_FlagCannotClearManually)); - } - - if (0U != (statusFlag & (uint32_t)kLPUART_FramingErrorFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_FramingErrorFlag)) ? - (kStatus_LPUART_FramingError) : - (kStatus_LPUART_FlagCannotClearManually)); - } - - if (0U != (statusFlag & (uint32_t)kLPUART_NoiseErrorFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_NoiseErrorFlag)) ? - (kStatus_LPUART_NoiseError) : - (kStatus_LPUART_FlagCannotClearManually)); - } - if (kStatus_Success != status) - { - break; - } - } - if (kStatus_Success == status) - { - *(dataAddress) = (uint16_t)(base->DATA & 0x03FFU); - dataAddress++; - } - else - { - break; - } - } - - return status; -} - -/*! - * brief Initializes the LPUART handle. - * - * This function initializes the LPUART handle, which can be used for other LPUART - * transactional APIs. Usually, for a specified LPUART instance, - * call this API once to get the initialized handle. - * - * The LPUART driver supports the "background" receiving, which means that user can set up - * an RX ring buffer optionally. Data received is stored into the ring buffer even when the - * user doesn't call the LPUART_TransferReceiveNonBlocking() API. If there is already data received - * in the ring buffer, the user can get the received data from the ring buffer directly. - * The ring buffer is disabled if passing NULL as p ringBuffer. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param callback Callback function. - * param userData User data. - */ -void LPUART_TransferCreateHandle(LPUART_Type *base, - lpuart_handle_t *handle, - lpuart_transfer_callback_t callback, - void *userData) -{ - assert(NULL != handle); - - uint32_t instance; - -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - uint32_t ctrl = base->CTRL; - bool isSevenDataBits = (((ctrl & LPUART_CTRL_M7_MASK) != 0U) || - (((ctrl & LPUART_CTRL_M_MASK) == 0U) && ((ctrl & LPUART_CTRL_PE_MASK) != 0U))); -#endif - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(lpuart_handle_t)); - - /* Set the TX/RX state. */ - handle->rxState = (uint8_t)kLPUART_RxIdle; - handle->txState = (uint8_t)kLPUART_TxIdle; - - /* Set the callback and user data. */ - handle->callback = callback; - handle->userData = userData; - -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - /* Initial seven data bits flag */ - handle->isSevenDataBits = isSevenDataBits; -#endif - handle->is16bitData = false; - - /* Get instance from peripheral base address. */ - instance = LPUART_GetInstance(base); - - /* Save the handle in global variables to support the double weak mechanism. */ - s_lpuartHandle[instance] = handle; - - s_lpuartIsr[instance] = LPUART_TransferHandleIRQ; - -/* Enable interrupt in NVIC. */ -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ - (void)EnableIRQ(s_lpuartRxIRQ[instance]); - (void)EnableIRQ(s_lpuartTxIRQ[instance]); -#else - (void)EnableIRQ(s_lpuartIRQ[instance]); -#endif -} - -/*! - * brief Sets up the RX ring buffer. - * - * This function sets up the RX ring buffer to a specific UART handle. - * - * When the RX ring buffer is used, data received is stored into the ring buffer even when - * the user doesn't call the UART_TransferReceiveNonBlocking() API. If there is already data received - * in the ring buffer, the user can get the received data from the ring buffer directly. - * - * note When using RX ring buffer, one byte is reserved for internal use. In other - * words, if p ringBufferSize is 32, then only 31 bytes are used for saving data. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param ringBuffer Start address of ring buffer for background receiving. Pass NULL to disable the ring buffer. - * param ringBufferSize size of the ring buffer. - */ -void LPUART_TransferStartRingBuffer(LPUART_Type *base, - lpuart_handle_t *handle, - uint8_t *ringBuffer, - size_t ringBufferSize) -{ - assert(NULL != handle); - assert(NULL != ringBuffer); - - /* Setup the ring buffer address */ - handle->rxRingBuffer = ringBuffer; - if (!handle->is16bitData) - { - handle->rxRingBufferSize = ringBufferSize; - } - else - { - handle->rxRingBufferSize = ringBufferSize / 2U; - } - handle->rxRingBufferHead = 0U; - handle->rxRingBufferTail = 0U; - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. */ - uint32_t irqMask = DisableGlobalIRQ(); - /* Enable the interrupt to accept the data when user need the ring buffer. */ - base->CTRL |= (uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); -} - -/*! - * brief Aborts the background transfer and uninstalls the ring buffer. - * - * This function aborts the background transfer and uninstalls the ring buffer. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - */ -void LPUART_TransferStopRingBuffer(LPUART_Type *base, lpuart_handle_t *handle) -{ - assert(NULL != handle); - - if (handle->rxState == (uint8_t)kLPUART_RxIdle) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. - */ - uint32_t irqMask = DisableGlobalIRQ(); - base->CTRL &= ~(uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); - } - - handle->rxRingBuffer = NULL; - handle->rxRingBufferSize = 0U; - handle->rxRingBufferHead = 0U; - handle->rxRingBufferTail = 0U; -} - -/*! - * brief Transmits a buffer of data using the interrupt method. - * - * This function send data using an interrupt method. This is a non-blocking function, which - * returns directly without waiting for all data written to the transmitter register. When - * all data is written to the TX register in the ISR, the LPUART driver calls the callback - * function and passes the ref kStatus_LPUART_TxIdle as status parameter. - * - * note The kStatus_LPUART_TxIdle is passed to the upper layer when all data are written - * to the TX register. However, there is no check to ensure that all the data sent out. Before disabling the TX, - * check the kLPUART_TransmissionCompleteFlag to ensure that the transmit is finished. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param xfer LPUART transfer structure, see #lpuart_transfer_t. - * retval kStatus_Success Successfully start the data transmission. - * retval kStatus_LPUART_TxBusy Previous transmission still not finished, data not all written to the TX register. - * retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_TransferSendNonBlocking(LPUART_Type *base, lpuart_handle_t *handle, lpuart_transfer_t *xfer) -{ - assert(NULL != handle); - assert(NULL != xfer); - assert(NULL != xfer->txData); - assert(0U != xfer->dataSize); - - status_t status; - - /* Return error if current TX busy. */ - if ((uint8_t)kLPUART_TxBusy == handle->txState) - { - status = kStatus_LPUART_TxBusy; - } - else - { - if (!handle->is16bitData) - { - handle->txData = xfer->txData; - } - else - { - handle->txData16 = xfer->txData16; - } - handle->txDataSize = xfer->dataSize; - handle->txDataSizeAll = xfer->dataSize; - handle->txState = (uint8_t)kLPUART_TxBusy; - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. - */ - uint32_t irqMask = DisableGlobalIRQ(); - /* Enable transmitter interrupt. */ - base->CTRL |= (uint32_t)LPUART_CTRL_TIE_MASK; - EnableGlobalIRQ(irqMask); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Aborts the interrupt-driven data transmit. - * - * This function aborts the interrupt driven data sending. The user can get the remainBtyes to find out - * how many bytes are not sent out. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - */ -void LPUART_TransferAbortSend(LPUART_Type *base, lpuart_handle_t *handle) -{ - assert(NULL != handle); - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. */ - uint32_t irqMask = DisableGlobalIRQ(); - base->CTRL &= ~(uint32_t)(LPUART_CTRL_TIE_MASK | LPUART_CTRL_TCIE_MASK); - EnableGlobalIRQ(irqMask); - - handle->txDataSize = 0; - handle->txState = (uint8_t)kLPUART_TxIdle; -} - -/*! - * brief Gets the number of bytes that have been sent out to bus. - * - * This function gets the number of bytes that have been sent out to bus by an interrupt method. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param count Send bytes count. - * retval kStatus_NoTransferInProgress No send in progress. - * retval kStatus_InvalidArgument Parameter is invalid. - * retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetSendCount(LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count) -{ - assert(NULL != handle); - assert(NULL != count); - - status_t status = kStatus_Success; - size_t tmptxDataSize = handle->txDataSize; - - if ((uint8_t)kLPUART_TxIdle == handle->txState) - { - status = kStatus_NoTransferInProgress; - } - else - { -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - *count = handle->txDataSizeAll - tmptxDataSize - - ((base->WATER & LPUART_WATER_TXCOUNT_MASK) >> LPUART_WATER_TXCOUNT_SHIFT); -#else - if ((base->STAT & (uint32_t)kLPUART_TxDataRegEmptyFlag) != 0U) - { - *count = handle->txDataSizeAll - tmptxDataSize; - } - else - { - *count = handle->txDataSizeAll - tmptxDataSize - 1U; - } -#endif - } - - return status; -} - -/*! - * brief Receives a buffer of data using the interrupt method. - * - * This function receives data using an interrupt method. This is a non-blocking function - * which returns without waiting to ensure that all data are received. - * If the RX ring buffer is used and not empty, the data in the ring buffer is copied and - * the parameter p receivedBytes shows how many bytes are copied from the ring buffer. - * After copying, if the data in the ring buffer is not enough for read, the receive - * request is saved by the LPUART driver. When the new data arrives, the receive request - * is serviced first. When all data is received, the LPUART driver notifies the upper layer - * through a callback function and passes a status parameter ref kStatus_UART_RxIdle. - * For example, the upper layer needs 10 bytes but there are only 5 bytes in ring buffer. - * The 5 bytes are copied to xfer->data, which returns with the - * parameter p receivedBytes set to 5. For the remaining 5 bytes, the newly arrived data is - * saved from xfer->data[5]. When 5 bytes are received, the LPUART driver notifies the upper layer. - * If the RX ring buffer is not enabled, this function enables the RX and RX interrupt - * to receive data to xfer->data. When all data is received, the upper layer is notified. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param xfer LPUART transfer structure, see #uart_transfer_t. - * param receivedBytes Bytes received from the ring buffer directly. - * retval kStatus_Success Successfully queue the transfer into the transmit queue. - * retval kStatus_LPUART_RxBusy Previous receive request is not finished. - * retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_TransferReceiveNonBlocking(LPUART_Type *base, - lpuart_handle_t *handle, - lpuart_transfer_t *xfer, - size_t *receivedBytes) -{ - assert(NULL != handle); - assert(NULL != xfer); - assert(NULL != xfer->rxData); - assert(0U != xfer->dataSize); - - uint32_t i; - status_t status; - uint32_t irqMask; - /* How many bytes to copy from ring buffer to user memory. */ - size_t bytesToCopy = 0U; - /* How many bytes to receive. */ - size_t bytesToReceive; - /* How many bytes currently have received. */ - size_t bytesCurrentReceived; - - /* How to get data: - 1. If RX ring buffer is not enabled, then save xfer->data and xfer->dataSize - to lpuart handle, enable interrupt to store received data to xfer->data. When - all data received, trigger callback. - 2. If RX ring buffer is enabled and not empty, get data from ring buffer first. - If there are enough data in ring buffer, copy them to xfer->data and return. - If there are not enough data in ring buffer, copy all of them to xfer->data, - save the xfer->data remained empty space to lpuart handle, receive data - to this empty space and trigger callback when finished. */ - - if ((uint8_t)kLPUART_RxBusy == handle->rxState) - { - status = kStatus_LPUART_RxBusy; - } - else - { - bytesToReceive = xfer->dataSize; - bytesCurrentReceived = 0; - - /* If RX ring buffer is used. */ - if (NULL != handle->rxRingBuffer) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - /* Disable LPUART RX IRQ, protect ring buffer. */ - base->CTRL &= ~(uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); - - /* How many bytes in RX ring buffer currently. */ - bytesToCopy = LPUART_TransferGetRxRingBufferLength(base, handle); - - if (0U != bytesToCopy) - { - bytesToCopy = MIN(bytesToReceive, bytesToCopy); - - bytesToReceive -= bytesToCopy; - - /* Copy data from ring buffer to user memory. */ - for (i = 0U; i < bytesToCopy; i++) - { - if (!handle->is16bitData) - { - xfer->rxData[bytesCurrentReceived] = handle->rxRingBuffer[handle->rxRingBufferTail]; - } - else - { - xfer->rxData16[bytesCurrentReceived] = handle->rxRingBuffer16[handle->rxRingBufferTail]; - } - bytesCurrentReceived++; - - /* Wrap to 0. Not use modulo (%) because it might be large and slow. */ - if (((uint32_t)handle->rxRingBufferTail + 1U) == handle->rxRingBufferSize) - { - handle->rxRingBufferTail = 0U; - } - else - { - handle->rxRingBufferTail++; - } - } - } - - /* If ring buffer does not have enough data, still need to read more data. */ - if (0U != bytesToReceive) - { - /* No data in ring buffer, save the request to LPUART handle. */ - - if (!handle->is16bitData) - { - handle->rxData = &xfer->rxData[bytesCurrentReceived]; - } - else - { - handle->rxData16 = &xfer->rxData16[bytesCurrentReceived]; - } - handle->rxDataSize = bytesToReceive; - handle->rxDataSizeAll = xfer->dataSize; - handle->rxState = (uint8_t)kLPUART_RxBusy; - } - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - /* Re-enable LPUART RX IRQ. */ - base->CTRL |= (uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); - - /* Call user callback since all data are received. */ - if (0U == bytesToReceive) - { - if (NULL != handle->callback) - { - handle->callback(base, handle, kStatus_LPUART_RxIdle, handle->userData); - } - } - } - /* Ring buffer not used. */ - else - { - if (!handle->is16bitData) - { - handle->rxData = &xfer->rxData[bytesCurrentReceived]; - } - else - { - handle->rxData16 = &xfer->rxData16[bytesCurrentReceived]; - } - handle->rxDataSize = bytesToReceive; - handle->rxDataSizeAll = bytesToReceive; - handle->rxState = (uint8_t)kLPUART_RxBusy; - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - /* Enable RX interrupt. */ - base->CTRL |= (uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ILIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); - } - - /* Return the how many bytes have read. */ - if (NULL != receivedBytes) - { - *receivedBytes = bytesCurrentReceived; - } - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Aborts the interrupt-driven data receiving. - * - * This function aborts the interrupt-driven data receiving. The user can get the remainBytes to find out - * how many bytes not received yet. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - */ -void LPUART_TransferAbortReceive(LPUART_Type *base, lpuart_handle_t *handle) -{ - assert(NULL != handle); - - /* Only abort the receive to handle->rxData, the RX ring buffer is still working. */ - if (NULL == handle->rxRingBuffer) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. - */ - uint32_t irqMask = DisableGlobalIRQ(); - /* Disable RX interrupt. */ - base->CTRL &= ~(uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ILIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); - } - - handle->rxDataSize = 0U; - handle->rxState = (uint8_t)kLPUART_RxIdle; -} - -/*! - * brief Gets the number of bytes that have been received. - * - * This function gets the number of bytes that have been received. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param count Receive bytes count. - * retval kStatus_NoTransferInProgress No receive in progress. - * retval kStatus_InvalidArgument Parameter is invalid. - * retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetReceiveCount(LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count) -{ - assert(NULL != handle); - assert(NULL != count); - - status_t status = kStatus_Success; - size_t tmprxDataSize = handle->rxDataSize; - - if ((uint8_t)kLPUART_RxIdle == handle->rxState) - { - status = kStatus_NoTransferInProgress; - } - else - { - *count = handle->rxDataSizeAll - tmprxDataSize; - } - - return status; -} - -static void LPUART_TransferHandleIDLEReady(LPUART_Type *base, lpuart_handle_t *handle) -{ - uint32_t irqMask; -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - uint8_t count; - uint8_t tempCount; - count = ((uint8_t)((base->WATER & LPUART_WATER_RXCOUNT_MASK) >> LPUART_WATER_RXCOUNT_SHIFT)); - - while ((0U != handle->rxDataSize) && (0U != count)) - { - tempCount = (uint8_t)MIN(handle->rxDataSize, count); - /* Using non block API to read the data from the registers. */ - if (!handle->is16bitData) - { - LPUART_ReadNonBlocking(base, handle->rxData, tempCount); - handle->rxData = &handle->rxData[tempCount]; - } - else - { - LPUART_ReadNonBlocking16bit(base, handle->rxData16, tempCount); - handle->rxData16 = &handle->rxData16[tempCount]; - } - handle->rxDataSize -= tempCount; - count -= tempCount; - - /* If rxDataSize is 0, invoke rx idle callback.*/ - if (0U == (handle->rxDataSize)) - { - handle->rxState = (uint8_t)kLPUART_RxIdle; - - if (NULL != handle->callback) - { - handle->callback(base, handle, kStatus_LPUART_RxIdle, handle->userData); - } - } - } -#endif - /* Clear IDLE flag.*/ - base->STAT = ((base->STAT & 0x3FE00000U) | LPUART_STAT_IDLE_MASK); - - /* If rxDataSize is 0, disable rx ready, overrun and idle line interrupt.*/ - if (0U == handle->rxDataSize) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - base->CTRL &= ~(uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ILIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); - } - /* Invoke callback if callback is not NULL and rxDataSize is not 0. */ - else if (NULL != handle->callback) - { - handle->callback(base, handle, kStatus_LPUART_IdleLineDetected, handle->userData); - } - else - { - /* Avoid MISRA 15.7 */ - } -} - -static void LPUART_TransferHandleReceiveDataFull(LPUART_Type *base, lpuart_handle_t *handle) -{ - uint8_t count; - uint8_t tempCount; - uint16_t tpmRxRingBufferHead; - uint32_t tpmData; - uint32_t irqMask; - - /* Get the size that can be stored into buffer for this interrupt. */ -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - count = ((uint8_t)((base->WATER & LPUART_WATER_RXCOUNT_MASK) >> LPUART_WATER_RXCOUNT_SHIFT)); -#else - count = 1; -#endif - - /* If handle->rxDataSize is not 0, first save data to handle->rxData. */ - while ((0U != handle->rxDataSize) && (0U != count)) - { -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - tempCount = (uint8_t)MIN(handle->rxDataSize, count); -#else - tempCount = 1; -#endif - - /* Using non block API to read the data from the registers. */ - if (!handle->is16bitData) - { - LPUART_ReadNonBlocking(base, handle->rxData, tempCount); - handle->rxData = &handle->rxData[tempCount]; - } - else - { - LPUART_ReadNonBlocking16bit(base, handle->rxData16, tempCount); - handle->rxData16 = &handle->rxData16[tempCount]; - } - handle->rxDataSize -= tempCount; - count -= tempCount; - - /* If all the data required for upper layer is ready, trigger callback. */ - if (0U == handle->rxDataSize) - { - handle->rxState = (uint8_t)kLPUART_RxIdle; - - if (NULL != handle->callback) - { - handle->callback(base, handle, kStatus_LPUART_RxIdle, handle->userData); - } - } - } - - /* If use RX ring buffer, receive data to ring buffer. */ - if (NULL != handle->rxRingBuffer) - { - while (0U != count--) - { - /* If RX ring buffer is full, trigger callback to notify over run. */ - if (LPUART_TransferIsRxRingBufferFull(base, handle)) - { - if (NULL != handle->callback) - { - handle->callback(base, handle, kStatus_LPUART_RxRingBufferOverrun, handle->userData); - } - } - - /* If ring buffer is still full after callback function, the oldest data is overridden. */ - if (LPUART_TransferIsRxRingBufferFull(base, handle)) - { - /* Increase handle->rxRingBufferTail to make room for new data. */ - if (((uint32_t)handle->rxRingBufferTail + 1U) == handle->rxRingBufferSize) - { - handle->rxRingBufferTail = 0U; - } - else - { - handle->rxRingBufferTail++; - } - } - - /* Read data. */ - tpmRxRingBufferHead = handle->rxRingBufferHead; - tpmData = base->DATA; -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - if (handle->isSevenDataBits) - { - handle->rxRingBuffer[tpmRxRingBufferHead] = (uint8_t)(tpmData & 0x7FU); - } - else - { - if (!handle->is16bitData) - { - handle->rxRingBuffer[tpmRxRingBufferHead] = (uint8_t)tpmData; - } - else - { - handle->rxRingBuffer16[tpmRxRingBufferHead] = (uint16_t)(tpmData & 0x3FFU); - } - } -#else - if (!handle->is16bitData) - { - handle->rxRingBuffer[tpmRxRingBufferHead] = (uint8_t)tpmData; - } - else - { - handle->rxRingBuffer16[tpmRxRingBufferHead] = (uint16_t)(tpmData & 0x3FFU); - } -#endif - - /* Increase handle->rxRingBufferHead. */ - if (((uint32_t)handle->rxRingBufferHead + 1U) == handle->rxRingBufferSize) - { - handle->rxRingBufferHead = 0U; - } - else - { - handle->rxRingBufferHead++; - } - } - } - /* If no receive requst pending, stop RX interrupt. */ - else if (0U == handle->rxDataSize) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - base->CTRL &= ~(uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ORIE_MASK | LPUART_CTRL_ILIE_MASK); - EnableGlobalIRQ(irqMask); - } - else - { - /* Avoid MISRA C-2012 15.7 voiation */ - return; - } -} - -static void LPUART_TransferHandleSendDataEmpty(LPUART_Type *base, lpuart_handle_t *handle) -{ - uint8_t count; - uint8_t tempCount; - uint32_t irqMask; -/* Get the bytes that available at this moment. */ -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - count = (uint8_t)FSL_FEATURE_LPUART_FIFO_SIZEn(base) - - (uint8_t)((base->WATER & LPUART_WATER_TXCOUNT_MASK) >> LPUART_WATER_TXCOUNT_SHIFT); -#else - count = 1; -#endif - - while ((0U != handle->txDataSize) && (0U != count)) - { -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - tempCount = (uint8_t)MIN(handle->txDataSize, count); -#else - tempCount = 1; -#endif - - /* Using non block API to write the data to the registers. */ - if (!handle->is16bitData) - { - LPUART_WriteNonBlocking(base, handle->txData, tempCount); - handle->txData = &handle->txData[tempCount]; - } - else - { - LPUART_WriteNonBlocking16bit(base, handle->txData16, tempCount); - handle->txData16 = &handle->txData16[tempCount]; - } - handle->txDataSize -= tempCount; - count -= tempCount; - - /* If all the data are written to data register, notify user with the callback, then TX finished. */ - if (0U == handle->txDataSize) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - /* Disable TX register empty interrupt and enable transmission completion interrupt. */ - base->CTRL = (base->CTRL & ~LPUART_CTRL_TIE_MASK) | LPUART_CTRL_TCIE_MASK; - EnableGlobalIRQ(irqMask); - } - } -} - -static void LPUART_TransferHandleTransmissionComplete(LPUART_Type *base, lpuart_handle_t *handle) -{ - uint32_t irqMask; - /* Set txState to idle only when all data has been sent out to bus. */ - handle->txState = (uint8_t)kLPUART_TxIdle; - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. - */ - irqMask = DisableGlobalIRQ(); - /* Disable transmission complete interrupt. */ - base->CTRL &= ~(uint32_t)LPUART_CTRL_TCIE_MASK; - EnableGlobalIRQ(irqMask); - - /* Trigger callback. */ - if (NULL != handle->callback) - { - handle->callback(base, handle, kStatus_LPUART_TxIdle, handle->userData); - } -} - -/*! - * brief LPUART IRQ handle function. - * - * This function handles the LPUART transmit and receive IRQ request. - * - * param base LPUART peripheral base address. - * param irqHandle LPUART handle pointer. - */ -void LPUART_TransferHandleIRQ(LPUART_Type *base, void *irqHandle) -{ - assert(NULL != irqHandle); - - uint32_t status = LPUART_GetStatusFlags(base); - uint32_t enabledInterrupts = LPUART_GetEnabledInterrupts(base); - - lpuart_handle_t *handle = (lpuart_handle_t *)irqHandle; - - /* If RX overrun. */ - if ((uint32_t)kLPUART_RxOverrunFlag == ((uint32_t)kLPUART_RxOverrunFlag & status)) - { - /* Clear overrun flag, otherwise the RX does not work. */ - base->STAT = ((base->STAT & 0x3FE00000U) | LPUART_STAT_OR_MASK); - - /* Trigger callback. */ - if (NULL != (handle->callback)) - { - handle->callback(base, handle, kStatus_LPUART_RxHardwareOverrun, handle->userData); - } - } - - /* If IDLE flag is set and the IDLE interrupt is enabled. */ - if ((0U != ((uint32_t)kLPUART_IdleLineFlag & status)) && - (0U != ((uint32_t)kLPUART_IdleLineInterruptEnable & enabledInterrupts))) - { - LPUART_TransferHandleIDLEReady(base, handle); - } - /* Receive data register full */ - if ((0U != ((uint32_t)kLPUART_RxDataRegFullFlag & status)) && - (0U != ((uint32_t)kLPUART_RxDataRegFullInterruptEnable & enabledInterrupts))) - { - LPUART_TransferHandleReceiveDataFull(base, handle); - } - - /* Send data register empty and the interrupt is enabled. */ - if ((0U != ((uint32_t)kLPUART_TxDataRegEmptyFlag & status)) && - (0U != ((uint32_t)kLPUART_TxDataRegEmptyInterruptEnable & enabledInterrupts))) - { - LPUART_TransferHandleSendDataEmpty(base, handle); - } - - /* Transmission complete and the interrupt is enabled. */ - if ((0U != ((uint32_t)kLPUART_TransmissionCompleteFlag & status)) && - (0U != ((uint32_t)kLPUART_TransmissionCompleteInterruptEnable & enabledInterrupts))) - { - LPUART_TransferHandleTransmissionComplete(base, handle); - } -} - -/*! - * brief LPUART Error IRQ handle function. - * - * This function handles the LPUART error IRQ request. - * - * param base LPUART peripheral base address. - * param irqHandle LPUART handle pointer. - */ -void LPUART_TransferHandleErrorIRQ(LPUART_Type *base, void *irqHandle) -{ - /* To be implemented by User. */ -} -#if defined(FSL_FEATURE_LPUART_HAS_SHARED_IRQ0_IRQ1) && FSL_FEATURE_LPUART_HAS_SHARED_IRQ0_IRQ1 -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART0_LPUART1_RX_DriverIRQHandler(void); -void LPUART0_LPUART1_RX_DriverIRQHandler(void) -{ - /* If handle is registered, treat the transfer function is enabled. */ - if (NULL != s_lpuartHandle[0]) - { - s_lpuartIsr[0](LPUART0, s_lpuartHandle[0]); - } - if (NULL != s_lpuartHandle[1]) - { - s_lpuartIsr[1](LPUART1, s_lpuartHandle[1]); - } - SDK_ISR_EXIT_BARRIER; -} -void LPUART0_LPUART1_TX_DriverIRQHandler(void); -void LPUART0_LPUART1_TX_DriverIRQHandler(void) -{ - /* If handle is registered, treat the transfer function is enabled. */ - if (NULL != s_lpuartHandle[0]) - { - s_lpuartIsr[0](LPUART0, s_lpuartHandle[0]); - } - if (NULL != s_lpuartHandle[1]) - { - s_lpuartIsr[1](LPUART1, s_lpuartHandle[1]); - } - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART0_LPUART1_DriverIRQHandler(void); -void LPUART0_LPUART1_DriverIRQHandler(void) -{ - /* If handle is registered, treat the transfer function is enabled. */ - if (NULL != s_lpuartHandle[0]) - { - s_lpuartIsr[0](LPUART0, s_lpuartHandle[0]); - } - if (NULL != s_lpuartHandle[1]) - { - s_lpuartIsr[1](LPUART1, s_lpuartHandle[1]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART0) -#if !(defined(FSL_FEATURE_LPUART_HAS_SHARED_IRQ0_IRQ1) && FSL_FEATURE_LPUART_HAS_SHARED_IRQ0_IRQ1) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART0_TX_DriverIRQHandler(void); -void LPUART0_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[0](LPUART0, s_lpuartHandle[0]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART0_RX_DriverIRQHandler(void); -void LPUART0_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[0](LPUART0, s_lpuartHandle[0]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART0_DriverIRQHandler(void); -void LPUART0_DriverIRQHandler(void) -{ - s_lpuartIsr[0](LPUART0, s_lpuartHandle[0]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif -#endif - -#if defined(LPUART1) -#if !(defined(FSL_FEATURE_LPUART_HAS_SHARED_IRQ0_IRQ1) && FSL_FEATURE_LPUART_HAS_SHARED_IRQ0_IRQ1) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART1_TX_DriverIRQHandler(void); -void LPUART1_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[1](LPUART1, s_lpuartHandle[1]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART1_RX_DriverIRQHandler(void); -void LPUART1_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[1](LPUART1, s_lpuartHandle[1]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART1_DriverIRQHandler(void); -void LPUART1_DriverIRQHandler(void) -{ - s_lpuartIsr[1](LPUART1, s_lpuartHandle[1]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif -#endif - -#if defined(LPUART2) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART2_TX_DriverIRQHandler(void); -void LPUART2_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[2](LPUART2, s_lpuartHandle[2]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART2_RX_DriverIRQHandler(void); -void LPUART2_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[2](LPUART2, s_lpuartHandle[2]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART2_DriverIRQHandler(void); -void LPUART2_DriverIRQHandler(void) -{ - s_lpuartIsr[2](LPUART2, s_lpuartHandle[2]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART3) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART3_TX_DriverIRQHandler(void); -void LPUART3_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[3](LPUART3, s_lpuartHandle[3]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART3_RX_DriverIRQHandler(void); -void LPUART3_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[3](LPUART3, s_lpuartHandle[3]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART3_DriverIRQHandler(void); -void LPUART3_DriverIRQHandler(void) -{ - s_lpuartIsr[3](LPUART3, s_lpuartHandle[3]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART4) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART4_TX_DriverIRQHandler(void); -void LPUART4_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[4](LPUART4, s_lpuartHandle[4]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART4_RX_DriverIRQHandler(void); -void LPUART4_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[4](LPUART4, s_lpuartHandle[4]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART4_DriverIRQHandler(void); -void LPUART4_DriverIRQHandler(void) -{ - s_lpuartIsr[4](LPUART4, s_lpuartHandle[4]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART5) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART5_TX_DriverIRQHandler(void); -void LPUART5_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[5](LPUART5, s_lpuartHandle[5]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART5_RX_DriverIRQHandler(void); -void LPUART5_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[5](LPUART5, s_lpuartHandle[5]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART5_DriverIRQHandler(void); -void LPUART5_DriverIRQHandler(void) -{ - s_lpuartIsr[5](LPUART5, s_lpuartHandle[5]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART6) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART6_TX_DriverIRQHandler(void); -void LPUART6_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[6](LPUART6, s_lpuartHandle[6]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART6_RX_DriverIRQHandler(void); -void LPUART6_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[6](LPUART6, s_lpuartHandle[6]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART6_DriverIRQHandler(void); -void LPUART6_DriverIRQHandler(void) -{ - s_lpuartIsr[6](LPUART6, s_lpuartHandle[6]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART7) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART7_TX_DriverIRQHandler(void); -void LPUART7_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[7](LPUART7, s_lpuartHandle[7]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART7_RX_DriverIRQHandler(void); -void LPUART7_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[7](LPUART7, s_lpuartHandle[7]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART7_DriverIRQHandler(void); -void LPUART7_DriverIRQHandler(void) -{ - s_lpuartIsr[7](LPUART7, s_lpuartHandle[7]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART8) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART8_TX_DriverIRQHandler(void); -void LPUART8_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[8](LPUART8, s_lpuartHandle[8]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART8_RX_DriverIRQHandler(void); -void LPUART8_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[8](LPUART8, s_lpuartHandle[8]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART8_DriverIRQHandler(void); -void LPUART8_DriverIRQHandler(void) -{ - s_lpuartIsr[8](LPUART8, s_lpuartHandle[8]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART9) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART9_TX_DriverIRQHandler(void); -void LPUART9_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[9](LPUART9, s_lpuartHandle[9]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART9_RX_DriverIRQHandler(void); -void LPUART9_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[9](LPUART9, s_lpuartHandle[9]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART9_DriverIRQHandler(void); -void LPUART9_DriverIRQHandler(void) -{ - s_lpuartIsr[9](LPUART9, s_lpuartHandle[9]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART10) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART10_TX_DriverIRQHandler(void); -void LPUART10_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[10](LPUART10, s_lpuartHandle[10]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART10_RX_DriverIRQHandler(void); -void LPUART10_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[10](LPUART10, s_lpuartHandle[10]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART10_DriverIRQHandler(void); -void LPUART10_DriverIRQHandler(void) -{ - s_lpuartIsr[10](LPUART10, s_lpuartHandle[10]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART11) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART11_TX_DriverIRQHandler(void); -void LPUART11_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[11](LPUART11, s_lpuartHandle[11]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART11_RX_DriverIRQHandler(void); -void LPUART11_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[11](LPUART11, s_lpuartHandle[11]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART11_DriverIRQHandler(void); -void LPUART11_DriverIRQHandler(void) -{ - s_lpuartIsr[11](LPUART11, s_lpuartHandle[11]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART12) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART12_TX_DriverIRQHandler(void); -void LPUART12_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[12](LPUART12, s_lpuartHandle[12]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART12_RX_DriverIRQHandler(void); -void LPUART12_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[12](LPUART12, s_lpuartHandle[12]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART12_DriverIRQHandler(void); -void LPUART12_DriverIRQHandler(void) -{ - s_lpuartIsr[12](LPUART12, s_lpuartHandle[12]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(CM4_0__LPUART) -void M4_0_LPUART_DriverIRQHandler(void); -void M4_0_LPUART_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(CM4_0__LPUART)](CM4_0__LPUART, s_lpuartHandle[LPUART_GetInstance(CM4_0__LPUART)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CM4_1__LPUART) -void M4_1_LPUART_DriverIRQHandler(void); -void M4_1_LPUART_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(CM4_1__LPUART)](CM4_1__LPUART, s_lpuartHandle[LPUART_GetInstance(CM4_1__LPUART)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CM4__LPUART) -void M4_LPUART_DriverIRQHandler(void); -void M4_LPUART_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(CM4__LPUART)](CM4__LPUART, s_lpuartHandle[LPUART_GetInstance(CM4__LPUART)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(DMA__LPUART0) -void DMA_UART0_INT_DriverIRQHandler(void); -void DMA_UART0_INT_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(DMA__LPUART0)](DMA__LPUART0, s_lpuartHandle[LPUART_GetInstance(DMA__LPUART0)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(DMA__LPUART1) -void DMA_UART1_INT_DriverIRQHandler(void); -void DMA_UART1_INT_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(DMA__LPUART1)](DMA__LPUART1, s_lpuartHandle[LPUART_GetInstance(DMA__LPUART1)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(DMA__LPUART2) -void DMA_UART2_INT_DriverIRQHandler(void); -void DMA_UART2_INT_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(DMA__LPUART2)](DMA__LPUART2, s_lpuartHandle[LPUART_GetInstance(DMA__LPUART2)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(DMA__LPUART3) -void DMA_UART3_INT_DriverIRQHandler(void); -void DMA_UART3_INT_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(DMA__LPUART3)](DMA__LPUART3, s_lpuartHandle[LPUART_GetInstance(DMA__LPUART3)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(DMA__LPUART4) -void DMA_UART4_INT_DriverIRQHandler(void); -void DMA_UART4_INT_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(DMA__LPUART4)](DMA__LPUART4, s_lpuartHandle[LPUART_GetInstance(DMA__LPUART4)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(ADMA__LPUART0) -void ADMA_UART0_INT_DriverIRQHandler(void); -void ADMA_UART0_INT_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(ADMA__LPUART0)](ADMA__LPUART0, s_lpuartHandle[LPUART_GetInstance(ADMA__LPUART0)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(ADMA__LPUART1) -void ADMA_UART1_INT_DriverIRQHandler(void); -void ADMA_UART1_INT_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(ADMA__LPUART1)](ADMA__LPUART1, s_lpuartHandle[LPUART_GetInstance(ADMA__LPUART1)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(ADMA__LPUART2) -void ADMA_UART2_INT_DriverIRQHandler(void); -void ADMA_UART2_INT_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(ADMA__LPUART2)](ADMA__LPUART2, s_lpuartHandle[LPUART_GetInstance(ADMA__LPUART2)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(ADMA__LPUART3) -void ADMA_UART3_INT_DriverIRQHandler(void); -void ADMA_UART3_INT_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(ADMA__LPUART3)](ADMA__LPUART3, s_lpuartHandle[LPUART_GetInstance(ADMA__LPUART3)]); - SDK_ISR_EXIT_BARRIER; -} -#endif diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpuart.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpuart.h deleted file mode 100644 index 13ea2365f63..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpuart.h +++ /dev/null @@ -1,1128 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LPUART_H_ -#define FSL_LPUART_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup lpuart_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief LPUART driver version. */ -#define FSL_LPUART_DRIVER_VERSION (MAKE_VERSION(2, 8, 2)) -/*! @} */ - -/*! @brief Retry times for waiting flag. */ -#ifndef UART_RETRY_TIMES -#define UART_RETRY_TIMES 0U /* Defining to zero means to keep waiting for the flag until it is assert/deassert. */ -#endif - -/*! @brief Error codes for the LPUART driver. */ -enum -{ - kStatus_LPUART_TxBusy = MAKE_STATUS(kStatusGroup_LPUART, 0), /*!< TX busy */ - kStatus_LPUART_RxBusy = MAKE_STATUS(kStatusGroup_LPUART, 1), /*!< RX busy */ - kStatus_LPUART_TxIdle = MAKE_STATUS(kStatusGroup_LPUART, 2), /*!< LPUART transmitter is idle. */ - kStatus_LPUART_RxIdle = MAKE_STATUS(kStatusGroup_LPUART, 3), /*!< LPUART receiver is idle. */ - kStatus_LPUART_TxWatermarkTooLarge = MAKE_STATUS(kStatusGroup_LPUART, 4), /*!< TX FIFO watermark too large */ - kStatus_LPUART_RxWatermarkTooLarge = MAKE_STATUS(kStatusGroup_LPUART, 5), /*!< RX FIFO watermark too large */ - kStatus_LPUART_FlagCannotClearManually = MAKE_STATUS(kStatusGroup_LPUART, 6), /*!< Some flag can't manually clear */ - kStatus_LPUART_Error = MAKE_STATUS(kStatusGroup_LPUART, 7), /*!< Error happens on LPUART. */ - kStatus_LPUART_RxRingBufferOverrun = - MAKE_STATUS(kStatusGroup_LPUART, 8), /*!< LPUART RX software ring buffer overrun. */ - kStatus_LPUART_RxHardwareOverrun = MAKE_STATUS(kStatusGroup_LPUART, 9), /*!< LPUART RX receiver overrun. */ - kStatus_LPUART_NoiseError = MAKE_STATUS(kStatusGroup_LPUART, 10), /*!< LPUART noise error. */ - kStatus_LPUART_FramingError = MAKE_STATUS(kStatusGroup_LPUART, 11), /*!< LPUART framing error. */ - kStatus_LPUART_ParityError = MAKE_STATUS(kStatusGroup_LPUART, 12), /*!< LPUART parity error. */ - kStatus_LPUART_BaudrateNotSupport = - MAKE_STATUS(kStatusGroup_LPUART, 13), /*!< Baudrate is not support in current clock source */ - kStatus_LPUART_IdleLineDetected = MAKE_STATUS(kStatusGroup_LPUART, 14), /*!< IDLE flag. */ - kStatus_LPUART_Timeout = MAKE_STATUS(kStatusGroup_LPUART, 15), /*!< LPUART times out. */ -}; - -/*! @brief LPUART parity mode. */ -typedef enum _lpuart_parity_mode -{ - kLPUART_ParityDisabled = 0x0U, /*!< Parity disabled */ - kLPUART_ParityEven = 0x2U, /*!< Parity enabled, type even, bit setting: PE|PT = 10 */ - kLPUART_ParityOdd = 0x3U, /*!< Parity enabled, type odd, bit setting: PE|PT = 11 */ -} lpuart_parity_mode_t; - -/*! @brief LPUART data bits count. */ -typedef enum _lpuart_data_bits -{ - kLPUART_EightDataBits = 0x0U, /*!< Eight data bit */ -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - kLPUART_SevenDataBits = 0x1U, /*!< Seven data bit */ -#endif -} lpuart_data_bits_t; - -/*! @brief LPUART stop bit count. */ -typedef enum _lpuart_stop_bit_count -{ - kLPUART_OneStopBit = 0U, /*!< One stop bit */ - kLPUART_TwoStopBit = 1U, /*!< Two stop bits */ -} lpuart_stop_bit_count_t; - -#if defined(FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT) && FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT -/*! @brief LPUART transmit CTS source. */ -typedef enum _lpuart_transmit_cts_source -{ - kLPUART_CtsSourcePin = 0U, /*!< CTS resource is the LPUART_CTS pin. */ - kLPUART_CtsSourceMatchResult = 1U, /*!< CTS resource is the match result. */ -} lpuart_transmit_cts_source_t; - -/*! @brief LPUART transmit CTS configure. */ -typedef enum _lpuart_transmit_cts_config -{ - kLPUART_CtsSampleAtStart = 0U, /*!< CTS input is sampled at the start of each character. */ - kLPUART_CtsSampleAtIdle = 1U, /*!< CTS input is sampled when the transmitter is idle */ -} lpuart_transmit_cts_config_t; -#endif - -/*! @brief LPUART idle flag type defines when the receiver starts counting. */ -typedef enum _lpuart_idle_type_select -{ - kLPUART_IdleTypeStartBit = 0U, /*!< Start counting after a valid start bit. */ - kLPUART_IdleTypeStopBit = 1U, /*!< Start counting after a stop bit. */ -} lpuart_idle_type_select_t; - -/*! @brief LPUART idle detected configuration. - * This structure defines the number of idle characters that must be received before - * the IDLE flag is set. - */ -typedef enum _lpuart_idle_config -{ - kLPUART_IdleCharacter1 = 0U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter2 = 1U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter4 = 2U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter8 = 3U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter16 = 4U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter32 = 5U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter64 = 6U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter128 = 7U, /*!< the number of idle characters. */ -} lpuart_idle_config_t; - -/*! - * @brief LPUART interrupt configuration structure, default settings all disabled. - * - * This structure contains the settings for all LPUART interrupt configurations. - */ -enum _lpuart_interrupt_enable -{ -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - kLPUART_LinBreakInterruptEnable = (LPUART_BAUD_LBKDIE_MASK >> 8U), /*!< LIN break detect. bit 7 */ -#endif - kLPUART_RxActiveEdgeInterruptEnable = (LPUART_BAUD_RXEDGIE_MASK >> 8U), /*!< Receive Active Edge. bit 6 */ - kLPUART_TxDataRegEmptyInterruptEnable = (LPUART_CTRL_TIE_MASK), /*!< Transmit data register empty. bit 23 */ - kLPUART_TransmissionCompleteInterruptEnable = (LPUART_CTRL_TCIE_MASK), /*!< Transmission complete. bit 22 */ - kLPUART_RxDataRegFullInterruptEnable = (LPUART_CTRL_RIE_MASK), /*!< Receiver data register full. bit 21 */ - kLPUART_IdleLineInterruptEnable = (LPUART_CTRL_ILIE_MASK), /*!< Idle line. bit 20 */ - kLPUART_RxOverrunInterruptEnable = (LPUART_CTRL_ORIE_MASK), /*!< Receiver Overrun. bit 27 */ - kLPUART_NoiseErrorInterruptEnable = (LPUART_CTRL_NEIE_MASK), /*!< Noise error flag. bit 26 */ - kLPUART_FramingErrorInterruptEnable = (LPUART_CTRL_FEIE_MASK), /*!< Framing error flag. bit 25 */ - kLPUART_ParityErrorInterruptEnable = (LPUART_CTRL_PEIE_MASK), /*!< Parity error flag. bit 24 */ -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - kLPUART_Match1InterruptEnable = (LPUART_CTRL_MA1IE_MASK), /*!< Parity error flag. bit 15 */ - kLPUART_Match2InterruptEnable = (LPUART_CTRL_MA2IE_MASK), /*!< Parity error flag. bit 14 */ -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - kLPUART_TxFifoOverflowInterruptEnable = (LPUART_FIFO_TXOFE_MASK), /*!< Transmit FIFO Overflow. bit 9 */ - kLPUART_RxFifoUnderflowInterruptEnable = (LPUART_FIFO_RXUFE_MASK), /*!< Receive FIFO Underflow. bit 8 */ -#endif - - kLPUART_AllInterruptEnable = kLPUART_RxActiveEdgeInterruptEnable | kLPUART_TxDataRegEmptyInterruptEnable | - kLPUART_TransmissionCompleteInterruptEnable | kLPUART_RxDataRegFullInterruptEnable | - kLPUART_IdleLineInterruptEnable | kLPUART_RxOverrunInterruptEnable | - kLPUART_NoiseErrorInterruptEnable | kLPUART_FramingErrorInterruptEnable | - kLPUART_ParityErrorInterruptEnable -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - | kLPUART_LinBreakInterruptEnable -#endif -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - | kLPUART_Match1InterruptEnable | kLPUART_Match2InterruptEnable -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - | kLPUART_TxFifoOverflowInterruptEnable | kLPUART_RxFifoUnderflowInterruptEnable -#endif - , -}; - -/*! - * @brief LPUART status flags. - * - * This provides constants for the LPUART status flags for use in the LPUART functions. - */ -enum _lpuart_flags -{ - kLPUART_TxDataRegEmptyFlag = - (LPUART_STAT_TDRE_MASK), /*!< Transmit data register empty flag, sets when transmit buffer is empty. bit 23 */ - kLPUART_TransmissionCompleteFlag = - (LPUART_STAT_TC_MASK), /*!< Transmission complete flag, sets when transmission activity complete. bit 22 */ - kLPUART_RxDataRegFullFlag = (LPUART_STAT_RDRF_MASK), /*!< Receive data register full flag, sets when the receive - data buffer is full. bit 21 */ - kLPUART_IdleLineFlag = (LPUART_STAT_IDLE_MASK), /*!< Idle line detect flag, sets when idle line detected. bit 20 */ - kLPUART_RxOverrunFlag = (LPUART_STAT_OR_MASK), /*!< Receive Overrun, sets when new data is received before data is - read from receive register. bit 19 */ - kLPUART_NoiseErrorFlag = (LPUART_STAT_NF_MASK), /*!< Receive takes 3 samples of each received bit. If any of these - samples differ, noise flag sets. bit 18 */ - kLPUART_FramingErrorFlag = - (LPUART_STAT_FE_MASK), /*!< Frame error flag, sets if logic 0 was detected where stop bit expected. bit 17 */ - kLPUART_ParityErrorFlag = (LPUART_STAT_PF_MASK), /*!< If parity enabled, sets upon parity error detection. bit 16 */ -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - kLPUART_LinBreakFlag = (LPUART_STAT_LBKDIF_MASK), /*!< LIN break detect interrupt flag, sets when LIN break - char detected and LIN circuit enabled. bit 31 */ -#endif - kLPUART_RxActiveEdgeFlag = (LPUART_STAT_RXEDGIF_MASK), /*!< Receive pin active edge interrupt flag, sets when active - edge detected. bit 30 */ - kLPUART_RxActiveFlag = - (LPUART_STAT_RAF_MASK), /*!< Receiver Active Flag (RAF), sets at beginning of valid start. bit 24 */ -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - kLPUART_DataMatch1Flag = - LPUART_STAT_MA1F_MASK, /*!< The next character to be read from LPUART_DATA matches MA1. bit 15 */ - kLPUART_DataMatch2Flag = - LPUART_STAT_MA2F_MASK, /*!< The next character to be read from LPUART_DATA matches MA2. bit 14 */ -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - kLPUART_TxFifoEmptyFlag = - (LPUART_FIFO_TXEMPT_MASK >> 16), /*!< TXEMPT bit, sets if transmit buffer is empty. bit 7 */ - kLPUART_RxFifoEmptyFlag = - (LPUART_FIFO_RXEMPT_MASK >> 16), /*!< RXEMPT bit, sets if receive buffer is empty. bit 6 */ - kLPUART_TxFifoOverflowFlag = - (LPUART_FIFO_TXOF_MASK >> 16), /*!< TXOF bit, sets if transmit buffer overflow occurred. bit 1 */ - kLPUART_RxFifoUnderflowFlag = - (LPUART_FIFO_RXUF_MASK >> 16), /*!< RXUF bit, sets if receive buffer underflow occurred. bit 0 */ -#endif - - kLPUART_AllClearFlags = kLPUART_RxActiveEdgeFlag | kLPUART_IdleLineFlag | kLPUART_RxOverrunFlag | - kLPUART_NoiseErrorFlag | kLPUART_FramingErrorFlag | kLPUART_ParityErrorFlag -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - | kLPUART_DataMatch1Flag | kLPUART_DataMatch2Flag -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - | kLPUART_TxFifoOverflowFlag | kLPUART_RxFifoUnderflowFlag -#endif -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - | kLPUART_LinBreakFlag -#endif - , - - kLPUART_AllFlags = - kLPUART_RxActiveEdgeFlag | kLPUART_IdleLineFlag | kLPUART_RxOverrunFlag | kLPUART_TxDataRegEmptyFlag | - kLPUART_TransmissionCompleteFlag | kLPUART_RxDataRegFullFlag | kLPUART_RxActiveFlag | kLPUART_NoiseErrorFlag | - kLPUART_FramingErrorFlag | kLPUART_ParityErrorFlag -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - | kLPUART_DataMatch1Flag | kLPUART_DataMatch2Flag -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - | kLPUART_TxFifoOverflowFlag | kLPUART_RxFifoUnderflowFlag | kLPUART_TxFifoEmptyFlag | kLPUART_RxFifoEmptyFlag -#endif -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - | kLPUART_LinBreakFlag -#endif - , -}; - -/*! @brief LPUART configuration structure. */ -typedef struct _lpuart_config -{ - uint32_t baudRate_Bps; /*!< LPUART baud rate */ - lpuart_parity_mode_t parityMode; /*!< Parity mode, disabled (default), even, odd */ - lpuart_data_bits_t dataBitsCount; /*!< Data bits count, eight (default), seven */ - bool isMsb; /*!< Data bits order, LSB (default), MSB */ -#if defined(FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT) && FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT - lpuart_stop_bit_count_t stopBitCount; /*!< Number of stop bits, 1 stop bit (default) or 2 stop bits */ -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - uint8_t txFifoWatermark; /*!< TX FIFO watermark */ - uint8_t rxFifoWatermark; /*!< RX FIFO watermark */ -#endif -#if defined(FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT) && FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT - bool enableRxRTS; /*!< RX RTS enable */ - bool enableTxCTS; /*!< TX CTS enable */ - lpuart_transmit_cts_source_t txCtsSource; /*!< TX CTS source */ - lpuart_transmit_cts_config_t txCtsConfig; /*!< TX CTS configure */ -#endif - lpuart_idle_type_select_t rxIdleType; /*!< RX IDLE type. */ - lpuart_idle_config_t rxIdleConfig; /*!< RX IDLE configuration. */ - bool enableTx; /*!< Enable TX */ - bool enableRx; /*!< Enable RX */ -} lpuart_config_t; - -/*! @brief LPUART transfer structure. */ -typedef struct _lpuart_transfer -{ - /* - * Use separate TX and RX data pointer, because TX data is const data. - * The member data is kept for backward compatibility. - */ - union - { - uint8_t *data; /*!< The buffer of data to be transfer.*/ - uint8_t *rxData; /*!< The buffer to receive data. */ - uint16_t *rxData16; /*!< The buffer to receive data. */ - const uint8_t *txData; /*!< The buffer of data to be sent. */ - const uint16_t *txData16; /*!< The buffer of data to be sent. */ - }; - size_t dataSize; /*!< The byte count to be transfer. */ -} lpuart_transfer_t; - -/* Forward declaration of the handle typedef. */ -typedef struct _lpuart_handle lpuart_handle_t; - -/*! @brief LPUART transfer callback function. */ -typedef void (*lpuart_transfer_callback_t)(LPUART_Type *base, lpuart_handle_t *handle, status_t status, void *userData); - -/*! @brief LPUART handle structure. */ -struct _lpuart_handle -{ - union - { - const uint8_t *volatile txData; /*!< Address of remaining data to send. */ - const uint16_t *volatile txData16; /*!< Address of remaining data to send. */ - }; - volatile size_t txDataSize; /*!< Size of the remaining data to send. */ - size_t txDataSizeAll; /*!< Size of the data to send out. */ - union - { - uint8_t *volatile rxData; /*!< Address of remaining data to receive. */ - uint16_t *volatile rxData16; /*!< Address of remaining data to receive. */ - }; - volatile size_t rxDataSize; /*!< Size of the remaining data to receive. */ - size_t rxDataSizeAll; /*!< Size of the data to receive. */ - - union - { - uint8_t *rxRingBuffer; /*!< Start address of the receiver ring buffer. */ - uint16_t *rxRingBuffer16; /*!< Start address of the receiver ring buffer. */ - }; - size_t rxRingBufferSize; /*!< Size of the ring buffer. */ - volatile uint16_t rxRingBufferHead; /*!< Index for the driver to store received data into ring buffer. */ - volatile uint16_t rxRingBufferTail; /*!< Index for the user to get data from the ring buffer. */ - - lpuart_transfer_callback_t callback; /*!< Callback function. */ - void *userData; /*!< LPUART callback function parameter.*/ - - volatile uint8_t txState; /*!< TX transfer state. */ - volatile uint8_t rxState; /*!< RX transfer state. */ - -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - bool isSevenDataBits; /*!< Seven data bits flag. */ -#endif - bool is16bitData; /*!< 16bit data bits flag, only used for 9bit or 10bit data */ -}; - -/* Typedef for interrupt handler. */ -typedef void (*lpuart_isr_t)(LPUART_Type *base, void *handle); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/* Array of LPUART handle. */ -extern void *s_lpuartHandle[]; - -/* Array of LPUART IRQ number. */ -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -extern const IRQn_Type s_lpuartTxIRQ[]; -#else -extern const IRQn_Type s_lpuartIRQ[]; -#endif - -/* LPUART ISR for transactional APIs. */ -extern lpuart_isr_t s_lpuartIsr[]; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* _cplusplus */ - -#if defined(FSL_FEATURE_LPUART_HAS_GLOBAL) && FSL_FEATURE_LPUART_HAS_GLOBAL - -/*! - * @name Software Reset - * @{ - */ - -/*! - * @brief Resets the LPUART using software. - * - * This function resets all internal logic and registers except the Global Register. - * Remains set until cleared by software. - * - * @param base LPUART peripheral base address. - */ -static inline void LPUART_SoftwareReset(LPUART_Type *base) -{ - base->GLOBAL |= LPUART_GLOBAL_RST_MASK; - base->GLOBAL &= ~LPUART_GLOBAL_RST_MASK; -} -/*! @} */ -#endif /*FSL_FEATURE_LPUART_HAS_GLOBAL*/ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Initializes an LPUART instance with the user configuration structure and the peripheral clock. - * - * This function configures the LPUART module with user-defined settings. Call the LPUART_GetDefaultConfig() function - * to configure the configuration structure and get the default configuration. - * The example below shows how to use this API to configure the LPUART. - * @code - * lpuart_config_t lpuartConfig; - * lpuartConfig.baudRate_Bps = 115200U; - * lpuartConfig.parityMode = kLPUART_ParityDisabled; - * lpuartConfig.dataBitsCount = kLPUART_EightDataBits; - * lpuartConfig.isMsb = false; - * lpuartConfig.stopBitCount = kLPUART_OneStopBit; - * lpuartConfig.txFifoWatermark = 0; - * lpuartConfig.rxFifoWatermark = 1; - * LPUART_Init(LPUART1, &lpuartConfig, 20000000U); - * @endcode - * - * @param base LPUART peripheral base address. - * @param config Pointer to a user-defined configuration structure. - * @param srcClock_Hz LPUART clock source frequency in HZ. - * @retval kStatus_LPUART_BaudrateNotSupport Baudrate is not support in current clock source. - * @retval kStatus_Success LPUART initialize succeed - */ -status_t LPUART_Init(LPUART_Type *base, const lpuart_config_t *config, uint32_t srcClock_Hz); - -/*! - * @brief Deinitializes a LPUART instance. - * - * This function waits for transmit to complete, disables TX and RX, and disables the LPUART clock. - * - * @param base LPUART peripheral base address. - */ -void LPUART_Deinit(LPUART_Type *base); - -/*! - * @brief Gets the default configuration structure. - * - * This function initializes the LPUART configuration structure to a default value. The default - * values are: - * lpuartConfig->baudRate_Bps = 115200U; - * lpuartConfig->parityMode = kLPUART_ParityDisabled; - * lpuartConfig->dataBitsCount = kLPUART_EightDataBits; - * lpuartConfig->isMsb = false; - * lpuartConfig->stopBitCount = kLPUART_OneStopBit; - * lpuartConfig->txFifoWatermark = 0; - * lpuartConfig->rxFifoWatermark = 1; - * lpuartConfig->rxIdleType = kLPUART_IdleTypeStartBit; - * lpuartConfig->rxIdleConfig = kLPUART_IdleCharacter1; - * lpuartConfig->enableTx = false; - * lpuartConfig->enableRx = false; - * - * @param config Pointer to a configuration structure. - */ -void LPUART_GetDefaultConfig(lpuart_config_t *config); -/*! @} */ - -/*! - * @name Module configuration - * @{ - */ -/*! - * @brief Sets the LPUART instance baudrate. - * - * This function configures the LPUART module baudrate. This function is used to update - * the LPUART module baudrate after the LPUART module is initialized by the LPUART_Init. - * @code - * LPUART_SetBaudRate(LPUART1, 115200U, 20000000U); - * @endcode - * - * @param base LPUART peripheral base address. - * @param baudRate_Bps LPUART baudrate to be set. - * @param srcClock_Hz LPUART clock source frequency in HZ. - * @retval kStatus_LPUART_BaudrateNotSupport Baudrate is not supported in the current clock source. - * @retval kStatus_Success Set baudrate succeeded. - */ -status_t LPUART_SetBaudRate(LPUART_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz); - -/*! - * @brief Enable 9-bit data mode for LPUART. - * - * This function set the 9-bit mode for LPUART module. The 9th bit is not used for parity thus can be modified by user. - * - * @param base LPUART peripheral base address. - * @param enable true to enable, flase to disable. - */ -void LPUART_Enable9bitMode(LPUART_Type *base, bool enable); - -/*! - * @brief Set the LPUART address. - * - * This function configures the address for LPUART module that works as slave in 9-bit data mode. One or two address - * fields can be configured. When the address field's match enable bit is set, the frame it receices with MSB being - * 1 is considered as an address frame, otherwise it is considered as data frame. Once the address frame matches one - * of slave's own addresses, this slave is addressed. This address frame and its following data frames are stored in - * the receive buffer, otherwise the frames will be discarded. To un-address a slave, just send an address frame with - * unmatched address. - * - * @note Any LPUART instance joined in the multi-slave system can work as slave. The position of the address mark is the - * same as the parity bit when parity is enabled for 8 bit and 9 bit data formats. - * - * @param base LPUART peripheral base address. - * @param address1 LPUART slave address1. - * @param address2 LPUART slave address2. - */ -static inline void LPUART_SetMatchAddress(LPUART_Type *base, uint16_t address1, uint16_t address2) -{ - /* Configure match address. */ - uint32_t address = ((uint32_t)address2 << 16U) | (uint32_t)address1 | 0x1000100UL; - base->MATCH = address; -} - -/*! - * @brief Enable the LPUART match address feature. - * - * @param base LPUART peripheral base address. - * @param match1 true to enable match address1, false to disable. - * @param match2 true to enable match address2, false to disable. - */ -static inline void LPUART_EnableMatchAddress(LPUART_Type *base, bool match1, bool match2) -{ - /* Configure match address1 enable bit. */ - if (match1) - { - base->BAUD |= (uint32_t)LPUART_BAUD_MAEN1_MASK; - } - else - { - base->BAUD &= ~(uint32_t)LPUART_BAUD_MAEN1_MASK; - } - /* Configure match address2 enable bit. */ - if (match2) - { - base->BAUD |= (uint32_t)LPUART_BAUD_MAEN2_MASK; - } - else - { - base->BAUD &= ~(uint32_t)LPUART_BAUD_MAEN2_MASK; - } -} - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO -/*! - * @brief Sets the rx FIFO watermark. - * - * @param base LPUART peripheral base address. - * @param water Rx FIFO watermark. - */ -static inline void LPUART_SetRxFifoWatermark(LPUART_Type *base, uint8_t water) -{ - assert((uint8_t)FSL_FEATURE_LPUART_FIFO_SIZEn(base) > water); - base->WATER = (base->WATER & ~LPUART_WATER_RXWATER_MASK) | LPUART_WATER_RXWATER(water); -} - -/*! - * @brief Sets the tx FIFO watermark. - * - * @param base LPUART peripheral base address. - * @param water Tx FIFO watermark. - */ -static inline void LPUART_SetTxFifoWatermark(LPUART_Type *base, uint8_t water) -{ - assert((uint8_t)FSL_FEATURE_LPUART_FIFO_SIZEn(base) > water); - base->WATER = (base->WATER & ~LPUART_WATER_TXWATER_MASK) | LPUART_WATER_TXWATER(water); -} -#endif - -/*! - * @brief Sets the LPUART using 16bit transmit, only for 9bit or 10bit mode. - * - * This function Enable 16bit Data transmit in lpuart_handle_t. - * - * @param handle LPUART handle pointer. - * @param enable true to enable, false to disable. - */ -static inline void LPUART_TransferEnable16Bit(lpuart_handle_t *handle, bool enable) -{ - handle->is16bitData = enable; -} -/*! @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets LPUART status flags. - * - * This function gets all LPUART status flags. The flags are returned as the logical - * OR value of the enumerators @ref _lpuart_flags. To check for a specific status, - * compare the return value with enumerators in the @ref _lpuart_flags. - * For example, to check whether the TX is empty: - * @code - * if (kLPUART_TxDataRegEmptyFlag & LPUART_GetStatusFlags(LPUART1)) - * { - * ... - * } - * @endcode - * - * @param base LPUART peripheral base address. - * @return LPUART status flags which are ORed by the enumerators in the _lpuart_flags. - */ -uint32_t LPUART_GetStatusFlags(LPUART_Type *base); - -/*! - * @brief Clears status flags with a provided mask. - * - * This function clears LPUART status flags with a provided mask. Automatically cleared flags - * can't be cleared by this function. - * Flags that can only cleared or set by hardware are: - * kLPUART_TxDataRegEmptyFlag, kLPUART_TransmissionCompleteFlag, kLPUART_RxDataRegFullFlag, - * kLPUART_RxActiveFlag, kLPUART_NoiseErrorFlag, kLPUART_ParityErrorFlag, - * kLPUART_TxFifoEmptyFlag,kLPUART_RxFifoEmptyFlag - * Note: This API should be called when the Tx/Rx is idle, otherwise it takes no effects. - * - * @param base LPUART peripheral base address. - * @param mask the status flags to be cleared. The user can use the enumerators in the - * _lpuart_status_flag_t to do the OR operation and get the mask. - * @return 0 succeed, others failed. - * @retval kStatus_LPUART_FlagCannotClearManually The flag can't be cleared by this function but - * it is cleared automatically by hardware. - * @retval kStatus_Success Status in the mask are cleared. - */ -status_t LPUART_ClearStatusFlags(LPUART_Type *base, uint32_t mask); -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables LPUART interrupts according to a provided mask. - * - * This function enables the LPUART interrupts according to a provided mask. The mask - * is a logical OR of enumeration members. See the @ref _lpuart_interrupt_enable. - * This examples shows how to enable TX empty interrupt and RX full interrupt: - * @code - * LPUART_EnableInterrupts(LPUART1,kLPUART_TxDataRegEmptyInterruptEnable | kLPUART_RxDataRegFullInterruptEnable); - * @endcode - * - * @param base LPUART peripheral base address. - * @param mask The interrupts to enable. Logical OR of @ref _lpuart_interrupt_enable. - */ -void LPUART_EnableInterrupts(LPUART_Type *base, uint32_t mask); - -/*! - * @brief Disables LPUART interrupts according to a provided mask. - * - * This function disables the LPUART interrupts according to a provided mask. The mask - * is a logical OR of enumeration members. See @ref _lpuart_interrupt_enable. - * This example shows how to disable the TX empty interrupt and RX full interrupt: - * @code - * LPUART_DisableInterrupts(LPUART1,kLPUART_TxDataRegEmptyInterruptEnable | kLPUART_RxDataRegFullInterruptEnable); - * @endcode - * - * @param base LPUART peripheral base address. - * @param mask The interrupts to disable. Logical OR of @ref _lpuart_interrupt_enable. - */ -void LPUART_DisableInterrupts(LPUART_Type *base, uint32_t mask); - -/*! - * @brief Gets enabled LPUART interrupts. - * - * This function gets the enabled LPUART interrupts. The enabled interrupts are returned - * as the logical OR value of the enumerators @ref _lpuart_interrupt_enable. To check - * a specific interrupt enable status, compare the return value with enumerators - * in @ref _lpuart_interrupt_enable. - * For example, to check whether the TX empty interrupt is enabled: - * @code - * uint32_t enabledInterrupts = LPUART_GetEnabledInterrupts(LPUART1); - * - * if (kLPUART_TxDataRegEmptyInterruptEnable & enabledInterrupts) - * { - * ... - * } - * @endcode - * - * @param base LPUART peripheral base address. - * @return LPUART interrupt flags which are logical OR of the enumerators in @ref _lpuart_interrupt_enable. - */ -uint32_t LPUART_GetEnabledInterrupts(LPUART_Type *base); -/*! @} */ - -#if defined(FSL_FEATURE_LPUART_HAS_DMA_ENABLE) && FSL_FEATURE_LPUART_HAS_DMA_ENABLE -/*! - * @name DMA Configuration - * @{ - */ -/*! - * @brief Gets the LPUART data register address. - * - * This function returns the LPUART data register address, which is mainly used by the DMA/eDMA. - * - * @param base LPUART peripheral base address. - * @return LPUART data register addresses which are used both by the transmitter and receiver. - */ -static inline uintptr_t LPUART_GetDataRegisterAddress(LPUART_Type *base) -{ - return (uintptr_t) & (base->DATA); -} - -/*! - * @brief Enables or disables the LPUART transmitter DMA request. - * - * This function enables or disables the transmit data register empty flag, STAT[TDRE], to generate DMA requests. - * - * @param base LPUART peripheral base address. - * @param enable True to enable, false to disable. - */ -static inline void LPUART_EnableTxDMA(LPUART_Type *base, bool enable) -{ - if (enable) - { - base->BAUD |= LPUART_BAUD_TDMAE_MASK; - } - else - { - base->BAUD &= ~LPUART_BAUD_TDMAE_MASK; - } -} - -/*! - * @brief Enables or disables the LPUART receiver DMA. - * - * This function enables or disables the receiver data register full flag, STAT[RDRF], to generate DMA requests. - * - * @param base LPUART peripheral base address. - * @param enable True to enable, false to disable. - */ -static inline void LPUART_EnableRxDMA(LPUART_Type *base, bool enable) -{ - if (enable) - { - base->BAUD |= LPUART_BAUD_RDMAE_MASK; - } - else - { - base->BAUD &= ~LPUART_BAUD_RDMAE_MASK; - } -} -/*! @} */ -#endif /* FSL_FEATURE_LPUART_HAS_DMA_ENABLE */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Get the LPUART instance from peripheral base address. - * - * @param base LPUART peripheral base address. - * @return LPUART instance. - */ -uint32_t LPUART_GetInstance(LPUART_Type *base); - -/*! - * @brief Enables or disables the LPUART transmitter. - * - * This function enables or disables the LPUART transmitter. - * - * @param base LPUART peripheral base address. - * @param enable True to enable, false to disable. - */ -static inline void LPUART_EnableTx(LPUART_Type *base, bool enable) -{ - if (enable) - { - base->CTRL |= LPUART_CTRL_TE_MASK; - } - else - { - base->CTRL &= ~LPUART_CTRL_TE_MASK; - } -} - -/*! - * @brief Enables or disables the LPUART receiver. - * - * This function enables or disables the LPUART receiver. - * - * @param base LPUART peripheral base address. - * @param enable True to enable, false to disable. - */ -static inline void LPUART_EnableRx(LPUART_Type *base, bool enable) -{ - if (enable) - { - base->CTRL |= LPUART_CTRL_RE_MASK; - } - else - { - base->CTRL &= ~LPUART_CTRL_RE_MASK; - } -} - -/*! - * @brief Writes to the transmitter register. - * - * This function writes data to the transmitter register directly. The upper layer must - * ensure that the TX register is empty or that the TX FIFO has room before calling this function. - * - * @param base LPUART peripheral base address. - * @param data Data write to the TX register. - */ -static inline void LPUART_WriteByte(LPUART_Type *base, uint8_t data) -{ - base->DATA = data; -} - -/*! - * @brief Reads the receiver register. - * - * This function reads data from the receiver register directly. The upper layer must - * ensure that the receiver register is full or that the RX FIFO has data before calling this function. - * - * @param base LPUART peripheral base address. - * @return Data read from data register. - */ -static inline uint8_t LPUART_ReadByte(LPUART_Type *base) -{ -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - uint32_t ctrl = base->CTRL; - uint8_t result; - /* - * $Branch Coverage Justification$ - * (ctrl & LPUART_CTRL_M7_MASK) == 0U) false is not covered. - * If ctrl & LPUART_CTRL_M7_MASK is 0, it can't be !0 in next judge. - */ - bool isSevenDataBits = (((ctrl & LPUART_CTRL_M7_MASK) != 0U) || - (((ctrl & LPUART_CTRL_M7_MASK) == 0U) && ((ctrl & LPUART_CTRL_M_MASK) == 0U) && - ((ctrl & LPUART_CTRL_PE_MASK) != 0U))); - - if (isSevenDataBits) - { - result = (uint8_t)(base->DATA & 0x7FU); - } - else - { - result = (uint8_t)base->DATA; - } - - return result; -#else - return (uint8_t)(base->DATA); -#endif -} - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO -/*! - * @brief Gets the rx FIFO data count. - * - * @param base LPUART peripheral base address. - * @return rx FIFO data count. - */ -static inline uint8_t LPUART_GetRxFifoCount(LPUART_Type *base) -{ - return (uint8_t)((base->WATER & LPUART_WATER_RXCOUNT_MASK) >> LPUART_WATER_RXCOUNT_SHIFT); -} - -/*! - * @brief Gets the tx FIFO data count. - * - * @param base LPUART peripheral base address. - * @return tx FIFO data count. - */ -static inline uint8_t LPUART_GetTxFifoCount(LPUART_Type *base) -{ - return (uint8_t)((base->WATER & LPUART_WATER_TXCOUNT_MASK) >> LPUART_WATER_TXCOUNT_SHIFT); -} -#endif - -/*! - * @brief Transmit an address frame in 9-bit data mode. - * - * @param base LPUART peripheral base address. - * @param address LPUART slave address. - */ -void LPUART_SendAddress(LPUART_Type *base, uint8_t address); - -/*! - * @brief Writes to the transmitter register using a blocking method. - * - * This function polls the transmitter register, first waits for the register to be empty or TX FIFO to have room, - * and writes data to the transmitter buffer, then waits for the dat to be sent out to the bus. - * - * @param base LPUART peripheral base address. - * @param data Start address of the data to write. - * @param length Size of the data to write. - * @retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * @retval kStatus_Success Successfully wrote all data. - */ -status_t LPUART_WriteBlocking(LPUART_Type *base, const uint8_t *data, size_t length); - -/*! - * @brief Writes to the transmitter register using a blocking method in 9bit or 10bit mode. - * - * @note This function only support 9bit or 10bit transfer. - * Please make sure only 10bit of data is valid and other bits are 0. - * - * @param base LPUART peripheral base address. - * @param data Start address of the data to write. - * @param length Size of the data to write. - * @retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * @retval kStatus_Success Successfully wrote all data. - */ -status_t LPUART_WriteBlocking16bit(LPUART_Type *base, const uint16_t *data, size_t length); - -/*! - * @brief Reads the receiver data register using a blocking method. - * - * This function polls the receiver register, waits for the receiver register full or receiver FIFO - * has data, and reads data from the TX register. - * - * @param base LPUART peripheral base address. - * @param data Start address of the buffer to store the received data. - * @param length Size of the buffer. - * @retval kStatus_LPUART_RxHardwareOverrun Receiver overrun happened while receiving data. - * @retval kStatus_LPUART_NoiseError Noise error happened while receiving data. - * @retval kStatus_LPUART_FramingError Framing error happened while receiving data. - * @retval kStatus_LPUART_ParityError Parity error happened while receiving data. - * @retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * @retval kStatus_Success Successfully received all data. - */ -status_t LPUART_ReadBlocking(LPUART_Type *base, uint8_t *data, size_t length); - -/*! - * @brief Reads the receiver data register in 9bit or 10bit mode. - * - * @note This function only support 9bit or 10bit transfer. - * - * @param base LPUART peripheral base address. - * @param data Start address of the buffer to store the received data by 16bit, only 10bit is valid. - * @param length Size of the buffer. - * @retval kStatus_LPUART_RxHardwareOverrun Receiver overrun happened while receiving data. - * @retval kStatus_LPUART_NoiseError Noise error happened while receiving data. - * @retval kStatus_LPUART_FramingError Framing error happened while receiving data. - * @retval kStatus_LPUART_ParityError Parity error happened while receiving data. - * @retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * @retval kStatus_Success Successfully received all data. - */ -status_t LPUART_ReadBlocking16bit(LPUART_Type *base, uint16_t *data, size_t length); - -/*! @} */ - -/*! - * @name Transactional - * @{ - */ - -/*! - * @brief Initializes the LPUART handle. - * - * This function initializes the LPUART handle, which can be used for other LPUART - * transactional APIs. Usually, for a specified LPUART instance, - * call this API once to get the initialized handle. - * - * The LPUART driver supports the "background" receiving, which means that user can set up - * an RX ring buffer optionally. Data received is stored into the ring buffer even when the - * user doesn't call the LPUART_TransferReceiveNonBlocking() API. If there is already data received - * in the ring buffer, the user can get the received data from the ring buffer directly. - * The ring buffer is disabled if passing NULL as @p ringBuffer. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param callback Callback function. - * @param userData User data. - */ -void LPUART_TransferCreateHandle(LPUART_Type *base, - lpuart_handle_t *handle, - lpuart_transfer_callback_t callback, - void *userData); -/*! - * @brief Transmits a buffer of data using the interrupt method. - * - * This function send data using an interrupt method. This is a non-blocking function, which - * returns directly without waiting for all data written to the transmitter register. When - * all data is written to the TX register in the ISR, the LPUART driver calls the callback - * function and passes the @ref kStatus_LPUART_TxIdle as status parameter. - * - * @note The kStatus_LPUART_TxIdle is passed to the upper layer when all data are written - * to the TX register. However, there is no check to ensure that all the data sent out. Before disabling the TX, - * check the kLPUART_TransmissionCompleteFlag to ensure that the transmit is finished. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param xfer LPUART transfer structure, see #lpuart_transfer_t. - * @retval kStatus_Success Successfully start the data transmission. - * @retval kStatus_LPUART_TxBusy Previous transmission still not finished, data not all written to the TX register. - * @retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_TransferSendNonBlocking(LPUART_Type *base, lpuart_handle_t *handle, lpuart_transfer_t *xfer); - -/*! - * @brief Sets up the RX ring buffer. - * - * This function sets up the RX ring buffer to a specific UART handle. - * - * When the RX ring buffer is used, data received is stored into the ring buffer even when - * the user doesn't call the UART_TransferReceiveNonBlocking() API. If there is already data received - * in the ring buffer, the user can get the received data from the ring buffer directly. - * - * @note When using RX ring buffer, one byte is reserved for internal use. In other - * words, if @p ringBufferSize is 32, then only 31 bytes are used for saving data. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param ringBuffer Start address of ring buffer for background receiving. Pass NULL to disable the ring buffer. - * @param ringBufferSize size of the ring buffer. - */ -void LPUART_TransferStartRingBuffer(LPUART_Type *base, - lpuart_handle_t *handle, - uint8_t *ringBuffer, - size_t ringBufferSize); - -/*! - * @brief Aborts the background transfer and uninstalls the ring buffer. - * - * This function aborts the background transfer and uninstalls the ring buffer. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - */ -void LPUART_TransferStopRingBuffer(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief Get the length of received data in RX ring buffer. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @return Length of received data in RX ring buffer. - */ -size_t LPUART_TransferGetRxRingBufferLength(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief Aborts the interrupt-driven data transmit. - * - * This function aborts the interrupt driven data sending. The user can get the remainBtyes to find out - * how many bytes are not sent out. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - */ -void LPUART_TransferAbortSend(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief Gets the number of bytes that have been sent out to bus. - * - * This function gets the number of bytes that have been sent out to bus by an interrupt method. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param count Send bytes count. - * @retval kStatus_NoTransferInProgress No send in progress. - * @retval kStatus_InvalidArgument Parameter is invalid. - * @retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetSendCount(LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count); - -/*! - * @brief Receives a buffer of data using the interrupt method. - * - * This function receives data using an interrupt method. This is a non-blocking function - * which returns without waiting to ensure that all data are received. - * If the RX ring buffer is used and not empty, the data in the ring buffer is copied and - * the parameter @p receivedBytes shows how many bytes are copied from the ring buffer. - * After copying, if the data in the ring buffer is not enough for read, the receive - * request is saved by the LPUART driver. When the new data arrives, the receive request - * is serviced first. When all data is received, the LPUART driver notifies the upper layer - * through a callback function and passes a status parameter kStatus_UART_RxIdle. - * For example, the upper layer needs 10 bytes but there are only 5 bytes in ring buffer. - * The 5 bytes are copied to xfer->data, which returns with the - * parameter @p receivedBytes set to 5. For the remaining 5 bytes, the newly arrived data is - * saved from xfer->data[5]. When 5 bytes are received, the LPUART driver notifies the upper layer. - * If the RX ring buffer is not enabled, this function enables the RX and RX interrupt - * to receive data to xfer->data. When all data is received, the upper layer is notified. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param xfer LPUART transfer structure, see uart_transfer_t. - * @param receivedBytes Bytes received from the ring buffer directly. - * @retval kStatus_Success Successfully queue the transfer into the transmit queue. - * @retval kStatus_LPUART_RxBusy Previous receive request is not finished. - * @retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_TransferReceiveNonBlocking(LPUART_Type *base, - lpuart_handle_t *handle, - lpuart_transfer_t *xfer, - size_t *receivedBytes); - -/*! - * @brief Aborts the interrupt-driven data receiving. - * - * This function aborts the interrupt-driven data receiving. The user can get the remainBytes to find out - * how many bytes not received yet. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - */ -void LPUART_TransferAbortReceive(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief Gets the number of bytes that have been received. - * - * This function gets the number of bytes that have been received. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param count Receive bytes count. - * @retval kStatus_NoTransferInProgress No receive in progress. - * @retval kStatus_InvalidArgument Parameter is invalid. - * @retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetReceiveCount(LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count); - -/*! - * @brief LPUART IRQ handle function. - * - * This function handles the LPUART transmit and receive IRQ request. - * - * @param base LPUART peripheral base address. - * @param irqHandle LPUART handle pointer. - */ -void LPUART_TransferHandleIRQ(LPUART_Type *base, void *irqHandle); - -/*! - * @brief LPUART Error IRQ handle function. - * - * This function handles the LPUART error IRQ request. - * - * @param base LPUART peripheral base address. - * @param irqHandle LPUART handle pointer. - */ -void LPUART_TransferHandleErrorIRQ(LPUART_Type *base, void *irqHandle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_LPUART_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpuart_edma.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpuart_edma.c deleted file mode 100644 index 79196d9c653..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpuart_edma.c +++ /dev/null @@ -1,522 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpuart_edma.h" -/* - * $Coverage Justification Reference$ - * - * $Justification fsl_lpuart_edma_c_ref_1$ - * The EDMA handle is only used by the LPUART EDMA driver, with the LPUART EDMA driver workflow, - * the callback is only called when EDMA transfer done. - * - * $Justification fsl_lpuart_edma_c_ref_2$ - * This function only handles the kLPUART_TransmissionCompleteFlag event. - * - */ -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpuart_edma" -#endif - -/*base, false); - - /* Stop transfer. */ - EDMA_AbortTransfer(handle); - - /* Enable tx complete interrupt */ - LPUART_EnableInterrupts(lpuartPrivateHandle->base, (uint32_t)kLPUART_TransmissionCompleteInterruptEnable); - } -} - -static void LPUART_ReceiveEDMACallback(edma_handle_t *handle, void *param, bool transferDone, uint32_t tcds) -{ - assert(NULL != param); - - lpuart_edma_private_handle_t *lpuartPrivateHandle = (lpuart_edma_private_handle_t *)param; - - /* Avoid warning for unused parameters. */ - handle = handle; - tcds = tcds; - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_edma_c_ref_1$ - */ - if (transferDone) - { - /* Disable transfer. */ - LPUART_TransferAbortReceiveEDMA(lpuartPrivateHandle->base, lpuartPrivateHandle->handle); - - if (NULL != lpuartPrivateHandle->handle->callback) - { - lpuartPrivateHandle->handle->callback(lpuartPrivateHandle->base, lpuartPrivateHandle->handle, - kStatus_LPUART_RxIdle, lpuartPrivateHandle->handle->userData); - } - } -} - -/*! - * brief Initializes the LPUART handle which is used in transactional functions. - * - * note This function disables all LPUART interrupts. - * - * param base LPUART peripheral base address. - * param handle Pointer to lpuart_edma_handle_t structure. - * param callback Callback function. - * param userData User data. - * param txEdmaHandle User requested DMA handle for TX DMA transfer. - * param rxEdmaHandle User requested DMA handle for RX DMA transfer. - */ -void LPUART_TransferCreateHandleEDMA(LPUART_Type *base, - lpuart_edma_handle_t *handle, - lpuart_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *txEdmaHandle, - edma_handle_t *rxEdmaHandle) -{ - assert(NULL != handle); - - uint32_t instance = LPUART_GetInstance(base); - - s_lpuartEdmaPrivateHandle[instance].base = base; - s_lpuartEdmaPrivateHandle[instance].handle = handle; - - (void)memset(handle, 0, sizeof(*handle)); - - handle->rxState = (uint8_t)kLPUART_RxIdle; - handle->txState = (uint8_t)kLPUART_TxIdle; - - handle->rxEdmaHandle = rxEdmaHandle; - handle->txEdmaHandle = txEdmaHandle; - - handle->callback = callback; - handle->userData = userData; - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Note: - Take care of the RX FIFO, EDMA request only assert when received bytes - equal or more than RX water mark, there is potential issue if RX water - mark larger than 1. - For example, if RX FIFO water mark is 2, upper layer needs 5 bytes and - 5 bytes are received. the last byte will be saved in FIFO but not trigger - EDMA transfer because the water mark is 2. - */ - if (NULL != rxEdmaHandle) - { - base->WATER &= (~LPUART_WATER_RXWATER_MASK); - } -#endif - - /* Save the handle in global variables to support the double weak mechanism. */ - s_lpuartHandle[instance] = handle; - /* Set LPUART_TransferEdmaHandleIRQ as DMA IRQ handler */ - s_lpuartIsr[instance] = LPUART_TransferEdmaHandleIRQ; - /* Disable all LPUART internal interrupts */ - LPUART_DisableInterrupts(base, (uint32_t)kLPUART_AllInterruptEnable); - /* Enable interrupt in NVIC. */ -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ - (void)EnableIRQ(s_lpuartTxIRQ[instance]); -#else - (void)EnableIRQ(s_lpuartIRQ[instance]); -#endif - - /* Configure TX. */ - if (NULL != txEdmaHandle) - { - EDMA_SetCallback(handle->txEdmaHandle, LPUART_SendEDMACallback, &s_lpuartEdmaPrivateHandle[instance]); - } - - /* Configure RX. */ - if (NULL != rxEdmaHandle) - { - EDMA_SetCallback(handle->rxEdmaHandle, LPUART_ReceiveEDMACallback, &s_lpuartEdmaPrivateHandle[instance]); - } -} - -/*! - * brief Sends data using eDMA. - * - * This function sends data using eDMA. This is a non-blocking function, which returns - * right away. When all data is sent, the send callback function is called. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param xfer LPUART eDMA transfer structure. See #lpuart_transfer_t. - * retval kStatus_Success if succeed, others failed. - * retval kStatus_LPUART_TxBusy Previous transfer on going. - * retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_SendEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, lpuart_transfer_t *xfer) -{ - assert(NULL != handle); - assert(NULL != handle->txEdmaHandle); - assert(NULL != xfer); - assert(NULL != xfer->data); - assert(0U != xfer->dataSize); - - edma_transfer_config_t xferConfig; - status_t status; - - /* If previous TX not finished. */ - if ((uint8_t)kLPUART_TxBusy == handle->txState) - { - status = kStatus_LPUART_TxBusy; - } - else - { - handle->txState = (uint8_t)kLPUART_TxBusy; - handle->txDataSizeAll = xfer->dataSize; - - /* Prepare transfer. */ - EDMA_PrepareTransfer(&xferConfig, xfer->data, sizeof(uint8_t), - (void *)(uint32_t *)LPUART_GetDataRegisterAddress(base), sizeof(uint8_t), sizeof(uint8_t), - xfer->dataSize, kEDMA_MemoryToPeripheral); - - /* Store the initially configured eDMA minor byte transfer count into the LPUART handle */ - handle->nbytes = (uint8_t)sizeof(uint8_t); - - /* Submit transfer. */ - if (kStatus_Success != - EDMA_SubmitTransfer(handle->txEdmaHandle, (const edma_transfer_config_t *)(uint32_t)&xferConfig)) - { - return kStatus_Fail; - } - EDMA_StartTransfer(handle->txEdmaHandle); - - /* Enable LPUART TX EDMA. */ - LPUART_EnableTxDMA(base, true); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Receives data using eDMA. - * - * This function receives data using eDMA. This is non-blocking function, which returns - * right away. When all data is received, the receive callback function is called. - * - * param base LPUART peripheral base address. - * param handle Pointer to lpuart_edma_handle_t structure. - * param xfer LPUART eDMA transfer structure, see #lpuart_transfer_t. - * retval kStatus_Success if succeed, others fail. - * retval kStatus_LPUART_RxBusy Previous transfer ongoing. - * retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_ReceiveEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, lpuart_transfer_t *xfer) -{ - assert(NULL != handle); - assert(NULL != handle->rxEdmaHandle); - assert(NULL != xfer); - assert(NULL != xfer->data); - assert(0U != xfer->dataSize); - - edma_transfer_config_t xferConfig; - status_t status; - - /* If previous RX not finished. */ - if ((uint8_t)kLPUART_RxBusy == handle->rxState) - { - status = kStatus_LPUART_RxBusy; - } - else - { - handle->rxState = (uint8_t)kLPUART_RxBusy; - handle->rxDataSizeAll = xfer->dataSize; - - /* Prepare transfer. */ - EDMA_PrepareTransfer(&xferConfig, (void *)(uint32_t *)LPUART_GetDataRegisterAddress(base), sizeof(uint8_t), - xfer->data, sizeof(uint8_t), sizeof(uint8_t), xfer->dataSize, kEDMA_PeripheralToMemory); - - /* Store the initially configured eDMA minor byte transfer count into the LPUART handle */ - handle->nbytes = (uint8_t)sizeof(uint8_t); - - /* Submit transfer. */ - if (kStatus_Success != - EDMA_SubmitTransfer(handle->rxEdmaHandle, (const edma_transfer_config_t *)(uint32_t)&xferConfig)) - { - return kStatus_Fail; - } - EDMA_StartTransfer(handle->rxEdmaHandle); - - /* Enable LPUART RX EDMA. */ - LPUART_EnableRxDMA(base, true); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Aborts the sent data using eDMA. - * - * This function aborts the sent data using eDMA. - * - * param base LPUART peripheral base address. - * param handle Pointer to lpuart_edma_handle_t structure. - */ -void LPUART_TransferAbortSendEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle) -{ - assert(NULL != handle); - assert(NULL != handle->txEdmaHandle); - - /* Disable LPUART TX EDMA. */ - LPUART_EnableTxDMA(base, false); - - /* Stop transfer. */ - EDMA_AbortTransfer(handle->txEdmaHandle); - - handle->txState = (uint8_t)kLPUART_TxIdle; -} - -/*! - * brief Aborts the received data using eDMA. - * - * This function aborts the received data using eDMA. - * - * param base LPUART peripheral base address. - * param handle Pointer to lpuart_edma_handle_t structure. - */ -void LPUART_TransferAbortReceiveEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle) -{ - assert(NULL != handle); - assert(NULL != handle->rxEdmaHandle); - - /* Disable LPUART RX EDMA. */ - LPUART_EnableRxDMA(base, false); - - /* Stop transfer. */ - EDMA_AbortTransfer(handle->rxEdmaHandle); - - handle->rxState = (uint8_t)kLPUART_RxIdle; -} - -/*! - * brief Gets the number of received bytes. - * - * This function gets the number of received bytes. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param count Receive bytes count. - * retval kStatus_NoTransferInProgress No receive in progress. - * retval kStatus_InvalidArgument Parameter is invalid. - * retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetReceiveCountEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, uint32_t *count) -{ - assert(NULL != handle); - assert(NULL != handle->rxEdmaHandle); - assert(NULL != count); - - if ((uint8_t)kLPUART_RxIdle == handle->rxState) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->rxDataSizeAll - - ((uint32_t)handle->nbytes * - EDMA_GetRemainingMajorLoopCount(handle->rxEdmaHandle->base, handle->rxEdmaHandle->channel)); - - return kStatus_Success; -} - -/*! - * brief Gets the number of bytes written to the LPUART TX register. - * - * This function gets the number of bytes written to the LPUART TX - * register by DMA. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param count Send bytes count. - * retval kStatus_NoTransferInProgress No send in progress. - * retval kStatus_InvalidArgument Parameter is invalid. - * retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetSendCountEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, uint32_t *count) -{ - assert(NULL != handle); - assert(NULL != handle->txEdmaHandle); - assert(NULL != count); - - if ((uint8_t)kLPUART_TxIdle == handle->txState) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->txDataSizeAll - - ((uint32_t)handle->nbytes * - EDMA_GetRemainingMajorLoopCount(handle->txEdmaHandle->base, handle->txEdmaHandle->channel)); - - return kStatus_Success; -} - -/*! - * brief LPUART eDMA IRQ handle function. - * - * This function handles the LPUART tx complete IRQ request and invoke user callback. - * It is not set to static so that it can be used in user application. - * note This function is used as default IRQ handler by double weak mechanism. - * If user's specific IRQ handler is implemented, make sure this function is invoked in the handler. - * - * param base LPUART peripheral base address. - * param lpuartEdmaHandle LPUART handle pointer. - */ -void LPUART_TransferEdmaHandleIRQ(LPUART_Type *base, void *lpuartEdmaHandle) -{ - assert(lpuartEdmaHandle != NULL); - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_edma_c_ref_2$ - */ - if (((uint32_t)kLPUART_TransmissionCompleteFlag & LPUART_GetStatusFlags(base)) != 0U) - { - lpuart_edma_handle_t *handle = (lpuart_edma_handle_t *)lpuartEdmaHandle; - - /* Disable tx complete interrupt */ - LPUART_DisableInterrupts(base, (uint32_t)kLPUART_TransmissionCompleteInterruptEnable); - - handle->txState = (uint8_t)kLPUART_TxIdle; - - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_LPUART_TxIdle, handle->userData); - } - } -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpuart_edma.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpuart_edma.h deleted file mode 100644 index 1190ed36e86..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_lpuart_edma.h +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LPUART_EDMA_H_ -#define FSL_LPUART_EDMA_H_ - -#include "fsl_lpuart.h" -#include "fsl_edma.h" - -/*! - * @addtogroup lpuart_edma_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief LPUART EDMA driver version. */ -#define FSL_LPUART_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 6, 0)) -/*! @} */ - -/* Forward declaration of the handle typedef. */ -typedef struct _lpuart_edma_handle lpuart_edma_handle_t; - -/*! @brief LPUART transfer callback function. */ -typedef void (*lpuart_edma_transfer_callback_t)(LPUART_Type *base, - lpuart_edma_handle_t *handle, - status_t status, - void *userData); - -/*! - * @brief LPUART eDMA handle - */ -struct _lpuart_edma_handle -{ - lpuart_edma_transfer_callback_t callback; /*!< Callback function. */ - void *userData; /*!< LPUART callback function parameter.*/ - size_t rxDataSizeAll; /*!< Size of the data to receive. */ - size_t txDataSizeAll; /*!< Size of the data to send out. */ - - edma_handle_t *txEdmaHandle; /*!< The eDMA TX channel used. */ - edma_handle_t *rxEdmaHandle; /*!< The eDMA RX channel used. */ - - uint8_t nbytes; /*!< eDMA minor byte transfer count initially configured. */ - - volatile uint8_t txState; /*!< TX transfer state. */ - volatile uint8_t rxState; /*!< RX transfer state */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name eDMA transactional - * @{ - */ - -/*! - * @brief Initializes the LPUART handle which is used in transactional functions. - * - * @note This function disables all LPUART interrupts. - * - * @param base LPUART peripheral base address. - * @param handle Pointer to lpuart_edma_handle_t structure. - * @param callback Callback function. - * @param userData User data. - * @param txEdmaHandle User requested DMA handle for TX DMA transfer. - * @param rxEdmaHandle User requested DMA handle for RX DMA transfer. - */ -void LPUART_TransferCreateHandleEDMA(LPUART_Type *base, - lpuart_edma_handle_t *handle, - lpuart_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *txEdmaHandle, - edma_handle_t *rxEdmaHandle); - -/*! - * @brief Sends data using eDMA. - * - * This function sends data using eDMA. This is a non-blocking function, which returns - * right away. When all data is sent, the send callback function is called. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param xfer LPUART eDMA transfer structure. See #lpuart_transfer_t. - * @retval kStatus_Success if succeed, others failed. - * @retval kStatus_LPUART_TxBusy Previous transfer on going. - * @retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_SendEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, lpuart_transfer_t *xfer); - -/*! - * @brief Receives data using eDMA. - * - * This function receives data using eDMA. This is non-blocking function, which returns - * right away. When all data is received, the receive callback function is called. - * - * @param base LPUART peripheral base address. - * @param handle Pointer to lpuart_edma_handle_t structure. - * @param xfer LPUART eDMA transfer structure, see #lpuart_transfer_t. - * @retval kStatus_Success if succeed, others fail. - * @retval kStatus_LPUART_RxBusy Previous transfer ongoing. - * @retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_ReceiveEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, lpuart_transfer_t *xfer); - -/*! - * @brief Aborts the sent data using eDMA. - * - * This function aborts the sent data using eDMA. - * - * @param base LPUART peripheral base address. - * @param handle Pointer to lpuart_edma_handle_t structure. - */ -void LPUART_TransferAbortSendEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle); - -/*! - * @brief Aborts the received data using eDMA. - * - * This function aborts the received data using eDMA. - * - * @param base LPUART peripheral base address. - * @param handle Pointer to lpuart_edma_handle_t structure. - */ -void LPUART_TransferAbortReceiveEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle); - -/*! - * @brief Gets the number of bytes written to the LPUART TX register. - * - * This function gets the number of bytes written to the LPUART TX - * register by DMA. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param count Send bytes count. - * @retval kStatus_NoTransferInProgress No send in progress. - * @retval kStatus_InvalidArgument Parameter is invalid. - * @retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetSendCountEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, uint32_t *count); - -/*! - * @brief Gets the number of received bytes. - * - * This function gets the number of received bytes. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param count Receive bytes count. - * @retval kStatus_NoTransferInProgress No receive in progress. - * @retval kStatus_InvalidArgument Parameter is invalid. - * @retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetReceiveCountEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, uint32_t *count); - -/*! - * @brief LPUART eDMA IRQ handle function. - * - * This function handles the LPUART tx complete IRQ request and invoke user callback. - * It is not set to static so that it can be used in user application. - * @note This function is used as default IRQ handler by double weak mechanism. - * If user's specific IRQ handler is implemented, make sure this function is invoked in the handler. - * - * @param base LPUART peripheral base address. - * @param lpuartEdmaHandle LPUART handle pointer. - */ -void LPUART_TransferEdmaHandleIRQ(LPUART_Type *base, void *lpuartEdmaHandle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_LPUART_EDMA_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_ostimer.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_ostimer.c deleted file mode 100644 index d978556afbc..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_ostimer.c +++ /dev/null @@ -1,384 +0,0 @@ -/* - * Copyright 2018-2021, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_ostimer.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.ostimer" -#endif - -#if defined(OSTIMER_RSTS) -#define OSTIMER_RESETS_ARRAY OSTIMER_RSTS -#endif - -/* Typedef for interrupt handler. */ -typedef void (*ostimer_isr_t)(OSTIMER_Type *base, ostimer_callback_t cb); - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Gets the instance from the base address - * - * @param base OSTIMER peripheral base address - * - * @return The OSTIMER instance - */ -static uint32_t OSTIMER_GetInstance(OSTIMER_Type *base); - -#if (defined(FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) && FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) -/* @brief Translate the value from gray-code to decimal by the Code Gray in SYSCTL. - * - * @param gray The gray value input. - * - * @return the decimal value. - */ -static uint64_t OSTIMER_GrayToDecimalbyCodeGray(uint64_t gray); -#endif /* FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY. */ - -/******************************************************************************* - * Variables - ******************************************************************************/ -/* Array of OSTIMER handle. */ -static ostimer_callback_t s_ostimerHandle[FSL_FEATURE_SOC_OSTIMER_COUNT]; -/* Array of OSTIMER peripheral base address. */ -static OSTIMER_Type *const s_ostimerBases[] = OSTIMER_BASE_PTRS; -/* Array of OSTIMER IRQ number. */ -static const IRQn_Type s_ostimerIRQ[] = OSTIMER_IRQS; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/* Array of OSTIMER clock name. */ -static const clock_ip_name_t s_ostimerClock[] = OSTIMER_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/* OSTIMER ISR for transactional APIs. */ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -static ostimer_isr_t s_ostimerIsr = (ostimer_isr_t)DefaultISR; -#else -static ostimer_isr_t s_ostimerIsr; -#endif - -#if defined(OSTIMER_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_ostimerResets[] = OSTIMER_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ - -/* @brief Function for getting the instance number of OS timer. */ -static uint32_t OSTIMER_GetInstance(OSTIMER_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_ostimerBases); instance++) - { - if (s_ostimerBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_ostimerBases)); - - return instance; -} - -#if (defined(FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) && FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) -/* @brief Translate the value from gray-code to decimal by the Code Gray in SYSCTL. - * - * @param gray The gray value input. - * - * @return the decimal value. - */ -static uint64_t OSTIMER_GrayToDecimalbyCodeGray(uint64_t gray) -{ - uint64_t decOut; - - SYSCTL->CODE_GRAY_LSB = (uint32_t)(gray & 0xFFFFFFFFU); - SYSCTL->CODE_GRAY_MSB = (uint32_t)((gray >> 32U) & 0x3FFU); // limit to 42bits as OSevent timer - __NOP(); - decOut = ((uint64_t)(SYSCTL->CODE_BIN_MSB) & 0x3FFU) << 32U; - decOut |= (uint64_t)(SYSCTL->CODE_BIN_LSB); - - return decOut; -} -#endif /* FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY. */ - -/* @brief Translate the value from gray-code to decimal. */ -/* - * @param gray The gray value input. - * - * @return the decimal value. - */ -uint64_t OSTIMER_GrayToDecimal(uint64_t gray) -{ -#if (defined(FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) && FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) - return OSTIMER_GrayToDecimalbyCodeGray(gray); -#else - uint64_t temp = gray; - while (temp != 0U) - { - temp >>= 1U; - gray ^= temp; - } - - return gray; -#endif /* FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY. */ -} - -/* @brief Enable the OSTIMER interrupt. - * - * After calling this function, the OSTIMER driver will enable/disable the IRQ and module interrupt enablement. - * - * @param base OSTIMER peripheral base address. - * @param enable enable/disable the IRQ and module interrupt enablement. - * - true: Disable the IRQ and module interrupt enablement. - * - false: Disable the IRQ and module interrupt enablement. - * @return none - */ -static void OSTIMER_EnableInterrupt(OSTIMER_Type *base, bool enable) -{ - assert(NULL != base); - - if (enable) - { - /* Enable the IRQ and module interrupt enablement. */ - (void)EnableIRQ(s_ostimerIRQ[OSTIMER_GetInstance(base)]); - base->OSEVENT_CTRL |= OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_MASK; - } - else - { - /* Clear interrupt flag, disable the IRQ and module interrupt enablement. */ - (void)DisableIRQ(s_ostimerIRQ[OSTIMER_GetInstance(base)]); - base->OSEVENT_CTRL &= ~OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_MASK; /* Clear interrupt flag by writing 1. */ - } -} - -/*! - * @brief Initializes an OSTIMER by turning it's clock on. - * - */ -void OSTIMER_Init(OSTIMER_Type *base) -{ - assert(NULL != base); - - uint32_t instance = OSTIMER_GetInstance(base); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#if !(defined(FSL_FEATURE_PMC_HAS_NO_OSTIMER_REG) && FSL_FEATURE_PMC_HAS_NO_OSTIMER_REG) - /* Enable the OSTIMER 32k clock in PMC module. */ - CLOCK_EnableOstimer32kClock(); -#endif - /* Enable clock for OSTIMER. */ - CLOCK_EnableClock(s_ostimerClock[instance]); -#if (defined(FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) && FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) - CLOCK_EnableClock(kCLOCK_Sysctl); -#endif /* FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY. */ -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(OSTIMER_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_ostimerResets[OSTIMER_GetInstance(base)]); -#endif -} - -/*! - * @brief Deinitializes a OSTIMER instance. - * - * This function shuts down OSTIMER clock - * - * @param base OSTIMER peripheral base address. - */ -void OSTIMER_Deinit(OSTIMER_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable clock for OSTIMER. */ - CLOCK_DisableClock(s_ostimerClock[OSTIMER_GetInstance(base)]); -#if (defined(FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) && FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) - CLOCK_DisableClock(kCLOCK_Sysctl); -#endif /* FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY. */ -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * @brief Get OSTIMER status Flags. - * - * This returns the status flag. - * Currently, only match interrupt flag can be got. - * - * @param base OSTIMER peripheral base address. - * @return status register value - */ -uint32_t OSTIMER_GetStatusFlags(OSTIMER_Type *base) -{ - return base->OSEVENT_CTRL & OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG_MASK; -} - -/*! - * @brief Clear Status Interrupt Flags. - * - * This clears intr status flag. - * Currently, only match interrupt flag can be cleared. - * - * @param base OSTIMER peripheral base address. - * @param mask Clear bit mask. - * @return none - */ -void OSTIMER_ClearStatusFlags(OSTIMER_Type *base, uint32_t mask) -{ - base->OSEVENT_CTRL |= mask; -} - -/*! - * @brief Set the match raw value for OSTIMER. - * - * This function will set a match value for OSTIMER with an optional callback. And this callback - * will be called while the data in dedicated pair match register is equals to the value of central EVTIMER. - * Please note that, the data format is gray-code, if decimal data was desired, please using OSTIMER_SetMatchValue(). - * - * @param base OSTIMER peripheral base address. - * @param count OSTIMER timer match value.(Value is gray-code format) - * - * @param cb OSTIMER callback (can be left as NULL if none, otherwise should be a void func(void)). - * @retval kStatus_Success - Set match raw value and enable interrupt Successfully. - * @retval kStatus_Fail - Set match raw value fail. - */ -status_t OSTIMER_SetMatchRawValue(OSTIMER_Type *base, uint64_t count, ostimer_callback_t cb) -{ -#ifdef OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK - uint64_t decValueTimer; -#endif - status_t status; - uint64_t tmp = count; - uint32_t instance = OSTIMER_GetInstance(base); - - /* Clear interrupt flag, disable the IRQ and module interrupt enablement. */ - OSTIMER_EnableInterrupt(base, false); - - s_ostimerIsr = OSTIMER_HandleIRQ; - s_ostimerHandle[instance] = cb; - - /* Set the match value. */ - base->MATCH_L = (uint32_t)tmp; - base->MATCH_H = (uint32_t)(tmp >> 32U); - -#ifdef OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK - /* Workaround-2019-12-30: - * Since OSTimer's counter register is Gray-encoded, it would cost more time to write register. When EVTimer Match - * Write Ready bit is low, which means the previous match value has been updated successfully by that time, it is - * safe to reload (write) the Match Registers. Even if there is the RM comment that "In typical applications, it - * should not be necessary to test this bit", but we found the interruption would not be reported when the delta - * timer user added is smaller(IE: RT595 11us in 1MHz typical application) in release version." To prevent such - * issue from happening, we'd better wait for the match value to update successfully before enabling IRQ. - */ - while (0U != (base->OSEVENT_CTRL & OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK)) - { - } - - /* After the WR_RDY bit became low, we need to check whether current time goes ahead of the match value we set. - * (1) If current timer value has gone ahead of the match value, the interrupt will not be reported before 64-bit - * timer value over flow. We need to check whether the interrupt flag has been set or not: if yes, we will enable - * interrupt and return success; if not, we will return fail directly. - * (2) If current timer value has not gone ahead of match value, we will enable interrupt and return success. - */ - decValueTimer = OSTIMER_GetCurrentTimerValue(base); - if ((decValueTimer >= OSTIMER_GrayToDecimal(tmp)) && - (0U == (base->OSEVENT_CTRL & (uint32_t)kOSTIMER_MatchInterruptFlag))) - { - status = kStatus_Fail; - } - else -#endif /* #ifdef OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK */ - { - /* Enable the module interrupt enablement. */ - OSTIMER_EnableInterrupt(base, true); - status = kStatus_Success; - } - - return status; -} - -/*! - * @brief Set the match value for OSTIMER. - * - * This function will set a match value for OSTIMER with an optional callback. And this callback - * will be called while the data in dedicated pair match register is equals to the value of central EVTIMER. - * - * @param base OSTIMER peripheral base address. - * @param count OSTIMER timer match value.(Value is decimal format, and this value will be translate to Gray code in - * API. ) - * @param cb OSTIMER callback (can be left as NULL if none, otherwise should be a void func(void)). - * @retval kStatus_Success - Set match value and enable interrupt Successfully. - * @retval kStatus_Fail - Set match value fail. - */ -status_t OSTIMER_SetMatchValue(OSTIMER_Type *base, uint64_t count, ostimer_callback_t cb) -{ - uint64_t tmp = OSTIMER_DecimalToGray(count); - - return OSTIMER_SetMatchRawValue(base, tmp, cb); -} - -/*! - * @brief Get current timer count value from OSTIMER. - * - * This function will get a decimal timer count value. - * The RAW value of timer count is gray code format, will be translated to decimal data internally. - * - * @param base OSTIMER peripheral base address. - * @return Value of OSTIMER which will formated to decimal value. - */ -uint64_t OSTIMER_GetCurrentTimerValue(OSTIMER_Type *base) -{ - uint64_t tmp = 0U; - - tmp = OSTIMER_GetCurrentTimerRawValue(base); - - return OSTIMER_GrayToDecimal(tmp); -} - -/*! - * @brief Get the capture value from OSTIMER. - * - * This function will get a capture decimal-value from OSTIMER. - * The RAW value of timer capture is gray code format, will be translated to decimal data internally. - * - * @param base OSTIMER peripheral base address. - * @return Value of capture register, data format is decimal. - */ -uint64_t OSTIMER_GetCaptureValue(OSTIMER_Type *base) -{ - uint64_t tmp = 0U; - - tmp = OSTIMER_GetCaptureRawValue(base); - - return OSTIMER_GrayToDecimal(tmp); -} - -void OSTIMER_HandleIRQ(OSTIMER_Type *base, ostimer_callback_t cb) -{ - /* Clear interrupt flag, disable the IRQ and module interrupt enablement. */ - OSTIMER_EnableInterrupt(base, false); - - if (cb != NULL) - { - cb(); - } -} - -void OS_EVENT_DriverIRQHandler(void); -void OS_EVENT_DriverIRQHandler(void) -{ - s_ostimerIsr(s_ostimerBases[0], s_ostimerHandle[0]); - SDK_ISR_EXIT_BARRIER; -} - diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_ostimer.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_ostimer.h deleted file mode 100644 index 51b1f45503f..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_ostimer.h +++ /dev/null @@ -1,273 +0,0 @@ -/* - * Copyright 2018-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_OSTIMER_H_ -#define FSL_OSTIMER_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup ostimer - * @{ - */ - -/*! @file*/ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief OSTIMER driver version. */ -#define FSL_OSTIMER_DRIVER_VERSION (MAKE_VERSION(2, 2, 2)) -/*! @} */ - -/*! - * @brief OSTIMER status flags. - */ -enum _ostimer_flags -{ - kOSTIMER_MatchInterruptFlag = (OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG_MASK), /*!< Match interrupt flag bit, sets if - the match value was reached. */ -}; - -/*! @brief ostimer callback function. */ -typedef void (*ostimer_callback_t)(void); - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* _cplusplus */ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Initializes an OSTIMER by turning its bus clock on - * - */ -void OSTIMER_Init(OSTIMER_Type *base); - -/*! - * @brief Deinitializes a OSTIMER instance. - * - * This function shuts down OSTIMER bus clock - * - * @param base OSTIMER peripheral base address. - */ -void OSTIMER_Deinit(OSTIMER_Type *base); - -/*! - * @brief Translate the value from gray-code to decimal. - * - * @param gray The gray value input. - * @return The decimal value. - */ -uint64_t OSTIMER_GrayToDecimal(uint64_t gray); - -/*! - * @brief Translate the value from decimal to gray-code. - * - * @param dec The decimal value. - * @return The gray code of the input value. - */ -static inline uint64_t OSTIMER_DecimalToGray(uint64_t dec) -{ - return (dec ^ (dec >> 1U)); -} - -/*! - * @brief Get OSTIMER status Flags. - * - * This returns the status flag. - * Currently, only match interrupt flag can be got. - * - * @param base OSTIMER peripheral base address. - * @return status register value - */ -uint32_t OSTIMER_GetStatusFlags(OSTIMER_Type *base); - -/*! - * @brief Clear Status Interrupt Flags. - * - * This clears intrrupt status flag. - * Currently, only match interrupt flag can be cleared. - * - * @param base OSTIMER peripheral base address. - * @param mask Clear bit mask. - * @return none - */ -void OSTIMER_ClearStatusFlags(OSTIMER_Type *base, uint32_t mask); - -/*! - * @brief Set the match raw value for OSTIMER. - * - * This function will set a match value for OSTIMER with an optional callback. And this callback - * will be called while the data in dedicated pair match register is equals to the value of central EVTIMER. - * Please note that, the data format is gray-code, if decimal data was desired, please using OSTIMER_SetMatchValue(). - * - * @param base OSTIMER peripheral base address. - * @param count OSTIMER timer match value.(Value is gray-code format) - * - * @param cb OSTIMER callback (can be left as NULL if none, otherwise should be a void func(void)). - * @retval kStatus_Success - Set match raw value and enable interrupt Successfully. - * @retval kStatus_Fail - Set match raw value fail. - */ -status_t OSTIMER_SetMatchRawValue(OSTIMER_Type *base, uint64_t count, ostimer_callback_t cb); - -/*! - * @brief Set the match value for OSTIMER. - * - * This function will set a match value for OSTIMER with an optional callback. And this callback - * will be called while the data in dedicated pair match register is equals to the value of central OS TIMER. - * - * @param base OSTIMER peripheral base address. - * @param count OSTIMER timer match value.(Value is decimal format, and this value will be translate to Gray code - * internally.) - * - * @param cb OSTIMER callback (can be left as NULL if none, otherwise should be a void func(void)). - * @retval kStatus_Success - Set match value and enable interrupt Successfully. - * @retval kStatus_Fail - Set match value fail. - */ -status_t OSTIMER_SetMatchValue(OSTIMER_Type *base, uint64_t count, ostimer_callback_t cb); - -/*! - * @brief Set value to OSTIMER MATCH register directly. - * - * This function writes the input value to OSTIMER MATCH register directly, - * it does not touch any other registers. Note that, the data format is - * gray-code. The function @ref OSTIMER_DecimalToGray could convert decimal - * value to gray code. - * - * @param base OSTIMER peripheral base address. - * @param value OSTIMER timer match value (Value is gray-code format). - */ -static inline void OSTIMER_SetMatchRegister(OSTIMER_Type *base, uint64_t value) -{ -#ifdef OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK - /* Wait for MATCH register ready for write. */ - while (0U != (base->OSEVENT_CTRL & OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK)) - { - } -#endif - - base->MATCH_L = (uint32_t)value; - base->MATCH_H = (uint32_t)(value >> 32U); -} - -/*! - * @brief Enable the OSTIMER counter match interrupt. - * - * Enable the timer counter match interrupt. The interrupt happens when OSTIMER - * counter matches the value in MATCH registers. - * - * @param base OSTIMER peripheral base address. - */ -static inline void OSTIMER_EnableMatchInterrupt(OSTIMER_Type *base) -{ - base->OSEVENT_CTRL |= OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_MASK; -} - -/*! - * @brief Disable the OSTIMER counter match interrupt. - * - * Disable the timer counter match interrupt. The interrupt happens when OSTIMER - * counter matches the value in MATCH registers. - * - * @param base OSTIMER peripheral base address. - */ -static inline void OSTIMER_DisableMatchInterrupt(OSTIMER_Type *base) -{ - base->OSEVENT_CTRL &= ~OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_MASK; -} - -/*! - * @brief Get current timer raw count value from OSTIMER. - * - * This function will get a gray code type timer count value from OS timer register. - * The raw value of timer count is gray code format. - * - * @param base OSTIMER peripheral base address. - * @return Raw value of OSTIMER, gray code format. - */ -static inline uint64_t OSTIMER_GetCurrentTimerRawValue(OSTIMER_Type *base) -{ - uint64_t tmp = 0U; - - tmp = base->EVTIMERL; - tmp |= (uint64_t)(base->EVTIMERH) << 32U; - - return tmp; -} - -/*! - * @brief Get current timer count value from OSTIMER. - * - * This function will get a decimal timer count value. - * The RAW value of timer count is gray code format, will be translated to decimal data internally. - * - * @param base OSTIMER peripheral base address. - * @return Value of OSTIMER which will be formated to decimal value. - */ -uint64_t OSTIMER_GetCurrentTimerValue(OSTIMER_Type *base); - -/*! - * @brief Get the capture value from OSTIMER. - * - * This function will get a captured gray-code value from OSTIMER. - * The Raw value of timer capture is gray code format. - * - * @param base OSTIMER peripheral base address. - * @return Raw value of capture register, data format is gray code. - */ -static inline uint64_t OSTIMER_GetCaptureRawValue(OSTIMER_Type *base) -{ - uint64_t tmp = 0U; - - tmp = base->CAPTURE_L; - tmp |= (uint64_t)(base->CAPTURE_H) << 32U; - - return tmp; -} - -/*! - * @brief Get the capture value from OSTIMER. - * - * This function will get a capture decimal-value from OSTIMER. - * The RAW value of timer capture is gray code format, will be translated to decimal data internally. - * - * @param base OSTIMER peripheral base address. - * @return Value of capture register, data format is decimal. - */ -uint64_t OSTIMER_GetCaptureValue(OSTIMER_Type *base); - -/*! - * @brief OS timer interrupt Service Handler. - * - * This function handles the interrupt and refers to the callback array in the driver to callback user (as per request - * in OSTIMER_SetMatchValue()). - * if no user callback is scheduled, the interrupt will simply be cleared. - * - * @param base OS timer peripheral base address. - * @param cb callback scheduled for this instance of OS timer - * @return none - */ -void OSTIMER_HandleIRQ(OSTIMER_Type *base, ostimer_callback_t cb); -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_OSTIMER_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_port.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_port.h deleted file mode 100644 index 8eb512969d8..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_port.h +++ /dev/null @@ -1,684 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022, 2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_PORT_H_ -#define FSL_PORT_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup port - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.port" -#endif - -/*! @name Driver version */ -/*! @{ */ -/*! @brief PORT driver version. */ -#define FSL_PORT_DRIVER_VERSION (MAKE_VERSION(2, 5, 0)) -/*! @} */ - -#if defined(FSL_FEATURE_PORT_HAS_PULL_ENABLE) && FSL_FEATURE_PORT_HAS_PULL_ENABLE -/*! @brief Internal resistor pull feature selection */ -enum _port_pull -{ - kPORT_PullDisable = 0U, /*!< Internal pull-up/down resistor is disabled. */ - kPORT_PullDown = 2U, /*!< Internal pull-down resistor is enabled. */ - kPORT_PullUp = 3U, /*!< Internal pull-up resistor is enabled. */ -}; -#endif /* FSL_FEATURE_PORT_HAS_PULL_ENABLE */ - -#if defined(FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE) && FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE -/*! @brief Internal resistor pull value selection */ -enum _port_pull_value -{ - kPORT_LowPullResistor = 0U, /*!< Low internal pull resistor value is selected. */ - kPORT_HighPullResistor = 1U, /*!< High internal pull resistor value is selected. */ -}; -#endif /* FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE */ - -#if defined(FSL_FEATURE_PORT_HAS_SLEW_RATE) && FSL_FEATURE_PORT_HAS_SLEW_RATE -/*! @brief Slew rate selection */ -enum _port_slew_rate -{ - kPORT_FastSlewRate = 0U, /*!< Fast slew rate is configured. */ - kPORT_SlowSlewRate = 1U, /*!< Slow slew rate is configured. */ -}; -#endif /* FSL_FEATURE_PORT_HAS_SLEW_RATE */ - -#if defined(FSL_FEATURE_PORT_HAS_OPEN_DRAIN) && FSL_FEATURE_PORT_HAS_OPEN_DRAIN -/*! @brief Open Drain feature enable/disable */ -enum _port_open_drain_enable -{ - kPORT_OpenDrainDisable = 0U, /*!< Open drain output is disabled. */ - kPORT_OpenDrainEnable = 1U, /*!< Open drain output is enabled. */ -}; -#endif /* FSL_FEATURE_PORT_HAS_OPEN_DRAIN */ - -#if defined(FSL_FEATURE_PORT_HAS_PASSIVE_FILTER) && FSL_FEATURE_PORT_HAS_PASSIVE_FILTER -/*! @brief Passive filter feature enable/disable */ -enum _port_passive_filter_enable -{ - kPORT_PassiveFilterDisable = 0U, /*!< Passive input filter is disabled. */ - kPORT_PassiveFilterEnable = 1U, /*!< Passive input filter is enabled. */ -}; -#endif - -#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH -/*! @brief Configures the drive strength. */ -enum _port_drive_strength -{ - kPORT_LowDriveStrength = 0U, /*!< Low-drive strength is configured. */ - kPORT_HighDriveStrength = 1U, /*!< High-drive strength is configured. */ -}; -#endif /* FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH */ - -#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1 -/*! @brief Configures the drive strength1. */ -enum _port_drive_strength1 -{ - kPORT_NormalDriveStrength = 0U, /*!< Normal drive strength */ - kPORT_DoubleDriveStrength = 1U, /*!< Double drive strength */ -}; -#endif /* FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1 */ - -#if defined(FSL_FEATURE_PORT_HAS_INPUT_BUFFER) && FSL_FEATURE_PORT_HAS_INPUT_BUFFER -/*! @brief input buffer disable/enable. */ -enum _port_input_buffer -{ - kPORT_InputBufferDisable = 0U, /*!< Digital input is disabled */ - kPORT_InputBufferEnable = 1U, /*!< Digital input is enabled */ -}; -#endif /* FSL_FEATURE_PORT_HAS_INPUT_BUFFER */ - -#if defined(FSL_FEATURE_PORT_HAS_INVERT_INPUT) && FSL_FEATURE_PORT_HAS_INVERT_INPUT -/*! @brief Digital input is not inverted or it is inverted. */ -enum _port_invet_input -{ - kPORT_InputNormal = 0U, /*!< Digital input is not inverted */ - kPORT_InputInvert = 1U, /*!< Digital input is inverted */ -}; -#endif /* FSL_FEATURE_PORT_HAS_INVERT_INPUT */ - -#if defined(FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK) && FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK -/*! @brief Unlock/lock the pin control register field[15:0] */ -enum _port_lock_register -{ - kPORT_UnlockRegister = 0U, /*!< Pin Control Register fields [15:0] are not locked. */ - kPORT_LockRegister = 1U, /*!< Pin Control Register fields [15:0] are locked. */ -}; -#endif /* FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK */ - -#if defined(FSL_FEATURE_PORT_PCR_MUX_WIDTH) && FSL_FEATURE_PORT_PCR_MUX_WIDTH -/*! @brief Pin mux selection */ -typedef enum _port_mux -{ -#if defined(FSL_FEATURE_PORT_PCR_MUX_GPIO) && (FSL_FEATURE_PORT_PCR_MUX_GPIO == 0) - kPORT_MuxAsGpio = 0U, /*!< Corresponding pin is configured as GPIO. */ -#else - kPORT_PinDisabledOrAnalog = 0U, /*!< Corresponding pin is disabled, but is used as an analog pin. */ - kPORT_MuxAsGpio = 1U, /*!< Corresponding pin is configured as GPIO. */ -#endif - kPORT_MuxAlt0 = 0U, /*!< Chip-specific */ - kPORT_MuxAlt1 = 1U, /*!< Chip-specific */ - kPORT_MuxAlt2 = 2U, /*!< Chip-specific */ - kPORT_MuxAlt3 = 3U, /*!< Chip-specific */ - kPORT_MuxAlt4 = 4U, /*!< Chip-specific */ - kPORT_MuxAlt5 = 5U, /*!< Chip-specific */ - kPORT_MuxAlt6 = 6U, /*!< Chip-specific */ - kPORT_MuxAlt7 = 7U, /*!< Chip-specific */ - kPORT_MuxAlt8 = 8U, /*!< Chip-specific */ - kPORT_MuxAlt9 = 9U, /*!< Chip-specific */ - kPORT_MuxAlt10 = 10U, /*!< Chip-specific */ - kPORT_MuxAlt11 = 11U, /*!< Chip-specific */ - kPORT_MuxAlt12 = 12U, /*!< Chip-specific */ - kPORT_MuxAlt13 = 13U, /*!< Chip-specific */ - kPORT_MuxAlt14 = 14U, /*!< Chip-specific */ - kPORT_MuxAlt15 = 15U, /*!< Chip-specific */ -} port_mux_t; -#endif /* FSL_FEATURE_PORT_PCR_MUX_WIDTH */ - -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) -/*! @brief Configures the interrupt generation condition. */ -typedef enum _port_interrupt -{ - kPORT_InterruptOrDMADisabled = 0x0U, /*!< Interrupt/DMA request is disabled. */ -#if defined(FSL_FEATURE_PORT_HAS_DMA_REQUEST) && FSL_FEATURE_PORT_HAS_DMA_REQUEST || defined(DOXYGEN_OUTPUT) - kPORT_DMARisingEdge = 0x1U, /*!< DMA request on rising edge. */ - kPORT_DMAFallingEdge = 0x2U, /*!< DMA request on falling edge. */ - kPORT_DMAEitherEdge = 0x3U, /*!< DMA request on either edge. */ -#endif -#if defined(FSL_FEATURE_PORT_HAS_IRQC_FLAG) && FSL_FEATURE_PORT_HAS_IRQC_FLAG || defined(DOXYGEN_OUTPUT) - kPORT_FlagRisingEdge = 0x05U, /*!< Flag sets on rising edge. */ - kPORT_FlagFallingEdge = 0x06U, /*!< Flag sets on falling edge. */ - kPORT_FlagEitherEdge = 0x07U, /*!< Flag sets on either edge. */ -#endif - kPORT_InterruptLogicZero = 0x8U, /*!< Interrupt when logic zero. */ - kPORT_InterruptRisingEdge = 0x9U, /*!< Interrupt on rising edge. */ - kPORT_InterruptFallingEdge = 0xAU, /*!< Interrupt on falling edge. */ - kPORT_InterruptEitherEdge = 0xBU, /*!< Interrupt on either edge. */ - kPORT_InterruptLogicOne = 0xCU, /*!< Interrupt when logic one. */ -#if defined(FSL_FEATURE_PORT_HAS_IRQC_TRIGGER) && FSL_FEATURE_PORT_HAS_IRQC_TRIGGER || defined(DOXYGEN_OUTPUT) - kPORT_ActiveHighTriggerOutputEnable = 0xDU, /*!< Enable active high-trigger output. */ - kPORT_ActiveLowTriggerOutputEnable = 0xEU, /*!< Enable active low-trigger output. */ -#endif -} port_interrupt_t; -#endif - -#if defined(FSL_FEATURE_PORT_HAS_DIGITAL_FILTER) && FSL_FEATURE_PORT_HAS_DIGITAL_FILTER -/*! @brief Digital filter clock source selection */ -typedef enum _port_digital_filter_clock_source -{ - kPORT_BusClock = 0U, /*!< Digital filters are clocked by the bus clock. */ - kPORT_LpoClock = 1U, /*!< Digital filters are clocked by the 1 kHz LPO clock. */ -} port_digital_filter_clock_source_t; - -/*! @brief PORT digital filter feature configuration definition */ -typedef struct _port_digital_filter_config -{ - uint32_t digitalFilterWidth; /*!< Set digital filter width */ - port_digital_filter_clock_source_t clockSource; /*!< Set digital filter clockSource */ -} port_digital_filter_config_t; -#endif /* FSL_FEATURE_PORT_HAS_DIGITAL_FILTER */ - -#if defined(FSL_FEATURE_PORT_PCR_MUX_WIDTH) && FSL_FEATURE_PORT_PCR_MUX_WIDTH -/*! @brief PORT pin configuration structure */ -typedef struct _port_pin_config -{ -#if defined(FSL_FEATURE_PORT_HAS_PULL_ENABLE) && FSL_FEATURE_PORT_HAS_PULL_ENABLE - uint16_t pullSelect : 2; /*!< No-pull/pull-down/pull-up select */ -#else - uint16_t : 2; -#endif /* FSL_FEATURE_PORT_HAS_PULL_ENABLE */ - -#if defined(FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE) && FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE - uint16_t pullValueSelect : 1; /*!< Pull value select */ -#endif /* FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE */ - -#if defined(FSL_FEATURE_PORT_HAS_SLEW_RATE) && FSL_FEATURE_PORT_HAS_SLEW_RATE - uint16_t slewRate : 1; /*!< Fast/slow slew rate Configure */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_SLEW_RATE */ - -#if !(defined(FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE) && FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE) - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE */ - -#if defined(FSL_FEATURE_PORT_HAS_PASSIVE_FILTER) && FSL_FEATURE_PORT_HAS_PASSIVE_FILTER - uint16_t passiveFilterEnable : 1; /*!< Passive filter enable/disable */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_PASSIVE_FILTER */ - -#if defined(FSL_FEATURE_PORT_HAS_OPEN_DRAIN) && FSL_FEATURE_PORT_HAS_OPEN_DRAIN - uint16_t openDrainEnable : 1; /*!< Open drain enable/disable */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_OPEN_DRAIN */ - -#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH - uint16_t driveStrength : 1; /*!< Fast/slow drive strength configure */ -#else - uint16_t : 1; -#endif - -#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1 - uint16_t driveStrength1 : 1; /*!< Normal/Double drive strength enable/disable */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1 */ - -#if defined(FSL_FEATURE_PORT_PCR_MUX_WIDTH) && (FSL_FEATURE_PORT_PCR_MUX_WIDTH == 3) - uint16_t mux : 3; /*!< Pin mux Configure */ - uint16_t : 1; -#elif defined(FSL_FEATURE_PORT_PCR_MUX_WIDTH) && (FSL_FEATURE_PORT_PCR_MUX_WIDTH == 4) - uint16_t mux : 4; /*!< Pin mux Configure */ -#else - uint16_t : 4; -#endif - -#if defined(FSL_FEATURE_PORT_HAS_INPUT_BUFFER) && FSL_FEATURE_PORT_HAS_INPUT_BUFFER - uint16_t inputBuffer : 1; /*!< Input Buffer Configure */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_INPUT_BUFFER */ - -#if defined(FSL_FEATURE_PORT_HAS_INVERT_INPUT) && FSL_FEATURE_PORT_HAS_INVERT_INPUT - uint16_t invertInput : 1; /*!< Invert Input Configure */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_INVERT_INPUT */ - - uint16_t : 1; - -#if defined(FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK) && FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK - uint16_t lockRegister : 1; /*!< Lock/unlock the PCR field[15:0] */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK */ -} port_pin_config_t; -#endif /* FSL_FEATURE_PORT_PCR_MUX_WIDTH */ - -#if defined(FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER) && FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER -/*! @brief PORT version information. */ -typedef struct _port_version_info -{ - uint16_t feature; /*!< Feature Specification Number. */ - uint8_t minor; /*!< Minor Version Number. */ - uint8_t major; /*!< Major Version Number. */ -} port_version_info_t; -#endif /* FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER */ - -#if defined(FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE) && FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE -/*! @brief PORT voltage range. */ -typedef enum _port_voltage_range -{ - kPORT_VoltageRange1Dot71V_3Dot6V = 0x0U, /*!< Port voltage range is 1.71 V - 3.6 V. */ - kPORT_VoltageRange2Dot70V_3Dot6V = 0x1U, /*!< Port voltage range is 2.70 V - 3.6 V. */ -} port_voltage_range_t; -#endif /* FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! @name Configuration */ -/*! @{ */ - -#if defined(FSL_FEATURE_PORT_PCR_MUX_WIDTH) && FSL_FEATURE_PORT_PCR_MUX_WIDTH - -#if defined(FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER) && FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER -/*! - * @brief Get PORT version information. - * - * @param base PORT peripheral base pointer - * @param info PORT version information - */ -static inline void PORT_GetVersionInfo(PORT_Type *base, port_version_info_t *info) -{ - uint32_t verid = base->VERID; - info->feature = (uint16_t)verid; - info->minor = (uint8_t)(verid >> PORT_VERID_MINOR_SHIFT); - info->major = (uint8_t)(verid >> PORT_VERID_MAJOR_SHIFT); -} -#endif /* FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER */ - -#if defined(FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE) && FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE -/*! - * @brief Get PORT version information. - * - * @note : PORTA_CONFIG[RANGE] controls the voltage ranges of Port A, B, and C. Read or write PORTB_CONFIG[RANGE] and - * PORTC_CONFIG[RANGE] does not take effect. - * - * @param base PORT peripheral base pointer - * @param range port voltage range - */ -static inline void PORT_SecletPortVoltageRange(PORT_Type *base, port_voltage_range_t range) -{ - base->CONFIG = (uint32_t)range; -} -#endif /* FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE */ - -/*! - * @brief Sets the port PCR register. - * - * This is an example to define an input pin or output pin PCR configuration. - * @code - * // Define a digital input pin PCR configuration - * port_pin_config_t config = { - * kPORT_PullUp, - * kPORT_FastSlewRate, - * kPORT_PassiveFilterDisable, - * kPORT_OpenDrainDisable, - * kPORT_LowDriveStrength, - * kPORT_MuxAsGpio, - * kPORT_UnLockRegister, - * }; - * @endcode - * - * @param base PORT peripheral base pointer. - * @param pin PORT pin number. - * @param config PORT PCR register configuration structure. - */ -static inline void PORT_SetPinConfig(PORT_Type *base, uint32_t pin, const port_pin_config_t *config) -{ - assert(config); - uint32_t addr = (uint32_t)&base->PCR[pin]; - *(volatile uint16_t *)(addr) = *((const uint16_t *)(const void *)config); -} - -/*! - * @brief Sets the port PCR register for multiple pins. - * - * This is an example to define input pins or output pins PCR configuration. - * @code - * Define a digital input pin PCR configuration - * port_pin_config_t config = { - * kPORT_PullUp , - * kPORT_PullEnable, - * kPORT_FastSlewRate, - * kPORT_PassiveFilterDisable, - * kPORT_OpenDrainDisable, - * kPORT_LowDriveStrength, - * kPORT_MuxAsGpio, - * kPORT_UnlockRegister, - * }; - * @endcode - * - * @param base PORT peripheral base pointer. - * @param mask PORT pin number macro. - * @param config PORT PCR register configuration structure. - */ -static inline void PORT_SetMultiplePinsConfig(PORT_Type *base, uint32_t mask, const port_pin_config_t *config) -{ - assert(config); - - uint16_t pcrl = *((const uint16_t *)(const void *)config); - - if (0U != (mask & 0xffffU)) - { - base->GPCLR = ((mask & 0xffffU) << 16) | pcrl; - } - if (0U != (mask >> 16)) - { - base->GPCHR = (mask & 0xffff0000U) | pcrl; - } -} - -#if defined(FSL_FEATURE_PORT_HAS_MULTIPLE_IRQ_CONFIG) && FSL_FEATURE_PORT_HAS_MULTIPLE_IRQ_CONFIG -/*! - * @brief Sets the port interrupt configuration in PCR register for multiple pins. - * - * @param base PORT peripheral base pointer. - * @param mask PORT pin number macro. - * @param config PORT pin interrupt configuration. - * - #kPORT_InterruptOrDMADisabled: Interrupt/DMA request disabled. - * - #kPORT_DMARisingEdge : DMA request on rising edge(if the DMA requests exit). - * - #kPORT_DMAFallingEdge: DMA request on falling edge(if the DMA requests exit). - * - #kPORT_DMAEitherEdge : DMA request on either edge(if the DMA requests exit). - * - #kPORT_FlagRisingEdge : Flag sets on rising edge(if the Flag states exit). - * - #kPORT_FlagFallingEdge : Flag sets on falling edge(if the Flag states exit). - * - #kPORT_FlagEitherEdge : Flag sets on either edge(if the Flag states exit). - * - #kPORT_InterruptLogicZero : Interrupt when logic zero. - * - #kPORT_InterruptRisingEdge : Interrupt on rising edge. - * - #kPORT_InterruptFallingEdge: Interrupt on falling edge. - * - #kPORT_InterruptEitherEdge : Interrupt on either edge. - * - #kPORT_InterruptLogicOne : Interrupt when logic one. - * - #kPORT_ActiveHighTriggerOutputEnable : Enable active high-trigger output (if the trigger states exit). - * - #kPORT_ActiveLowTriggerOutputEnable : Enable active low-trigger output (if the trigger states exit).. - */ -static inline void PORT_SetMultipleInterruptPinsConfig(PORT_Type *base, uint32_t mask, port_interrupt_t config) -{ - assert(config); - - if (0U != ((uint32_t)mask & 0xffffU)) - { - base->GICLR = ((uint32_t)config << 16U) | ((uint32_t)mask & 0xffffU); - } - mask = mask >> 16; - if (0U != mask) - { - base->GICHR = ((uint32_t)config << 16U) | ((uint32_t)mask & 0xffffU); - } -} -#endif - -/*! - * @brief Configures the pin muxing. - * - * @param base PORT peripheral base pointer. - * @param pin PORT pin number. - * @param mux pin muxing slot selection. - * - #kPORT_PinDisabledOrAnalog: Pin disabled or work in analog function. - * - #kPORT_MuxAsGpio : Set as GPIO. - * - #kPORT_MuxAlt2 : chip-specific. - * - #kPORT_MuxAlt3 : chip-specific. - * - #kPORT_MuxAlt4 : chip-specific. - * - #kPORT_MuxAlt5 : chip-specific. - * - #kPORT_MuxAlt6 : chip-specific. - * - #kPORT_MuxAlt7 : chip-specific. - * @note : This function is NOT recommended to use together with the PORT_SetPinsConfig, because - * the PORT_SetPinsConfig need to configure the pin mux anyway (Otherwise the pin mux is - * reset to zero : kPORT_PinDisabledOrAnalog). - * This function is recommended to use to reset the pin mux - * - */ -static inline void PORT_SetPinMux(PORT_Type *base, uint32_t pin, port_mux_t mux) -{ - base->PCR[pin] = (base->PCR[pin] & ~PORT_PCR_MUX_MASK) | PORT_PCR_MUX(mux); -} -#endif /* FSL_FEATURE_PORT_PCR_MUX_WIDTH */ - -#if defined(FSL_FEATURE_PORT_HAS_DIGITAL_FILTER) && FSL_FEATURE_PORT_HAS_DIGITAL_FILTER - -/*! - * @brief Enables the digital filter in one port, each bit of the 32-bit register represents one pin. - * - * @param base PORT peripheral base pointer. - * @param mask PORT pin number macro. - * @param enable PORT digital filter configuration. - */ -static inline void PORT_EnablePinsDigitalFilter(PORT_Type *base, uint32_t mask, bool enable) -{ - if (enable == true) - { - base->DFER |= mask; - } - else - { - base->DFER &= ~mask; - } -} - -/*! - * @brief Sets the digital filter in one port, each bit of the 32-bit register represents one pin. - * - * @param base PORT peripheral base pointer. - * @param config PORT digital filter configuration structure. - */ -static inline void PORT_SetDigitalFilterConfig(PORT_Type *base, const port_digital_filter_config_t *config) -{ - assert(config); - - base->DFCR = PORT_DFCR_CS(config->clockSource); - base->DFWR = PORT_DFWR_FILT(config->digitalFilterWidth); -} - -#endif /* FSL_FEATURE_PORT_HAS_DIGITAL_FILTER */ -/*! @} */ - -/*! @name Interrupt */ -/*! @{ */ - -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) -/*! - * @brief Configures the port pin interrupt/DMA request. - * - * @param base PORT peripheral base pointer. - * @param pin PORT pin number. - * @param config PORT pin interrupt configuration. - * - #kPORT_InterruptOrDMADisabled: Interrupt/DMA request disabled. - * - #kPORT_DMARisingEdge : DMA request on rising edge(if the DMA requests exit). - * - #kPORT_DMAFallingEdge: DMA request on falling edge(if the DMA requests exit). - * - #kPORT_DMAEitherEdge : DMA request on either edge(if the DMA requests exit). - * - #kPORT_FlagRisingEdge : Flag sets on rising edge(if the Flag states exit). - * - #kPORT_FlagFallingEdge : Flag sets on falling edge(if the Flag states exit). - * - #kPORT_FlagEitherEdge : Flag sets on either edge(if the Flag states exit). - * - #kPORT_InterruptLogicZero : Interrupt when logic zero. - * - #kPORT_InterruptRisingEdge : Interrupt on rising edge. - * - #kPORT_InterruptFallingEdge: Interrupt on falling edge. - * - #kPORT_InterruptEitherEdge : Interrupt on either edge. - * - #kPORT_InterruptLogicOne : Interrupt when logic one. - * - #kPORT_ActiveHighTriggerOutputEnable : Enable active high-trigger output (if the trigger states exit). - * - #kPORT_ActiveLowTriggerOutputEnable : Enable active low-trigger output (if the trigger states exit). - */ -static inline void PORT_SetPinInterruptConfig(PORT_Type *base, uint32_t pin, port_interrupt_t config) -{ - base->PCR[pin] = (base->PCR[pin] & ~PORT_PCR_IRQC_MASK) | PORT_PCR_IRQC(config); -} -#endif - -#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH -/*! - * @brief Configures the port pin drive strength. - * - * @param base PORT peripheral base pointer. - * @param pin PORT pin number. - * @param strength PORT pin drive strength - * - #kPORT_LowDriveStrength = 0U - Low-drive strength is configured. - * - #kPORT_HighDriveStrength = 1U - High-drive strength is configured. - */ -static inline void PORT_SetPinDriveStrength(PORT_Type *base, uint32_t pin, uint8_t strength) -{ - base->PCR[pin] = (base->PCR[pin] & ~PORT_PCR_DSE_MASK) | PORT_PCR_DSE(strength); -} -#endif - -#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1 -/*! - * @brief Enables the port pin double drive strength. - * - * @param base PORT peripheral base pointer. - * @param pin PORT pin number. - * @param enable PORT pin drive strength configuration. - */ -static inline void PORT_EnablePinDoubleDriveStrength(PORT_Type *base, uint32_t pin, bool enable) -{ - base->PCR[pin] = (base->PCR[pin] & ~PORT_PCR_DSE1_MASK) | PORT_PCR_DSE1(enable); -} -#endif - -#if defined(FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE) && FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE -/*! - * @brief Configures the port pin pull value. - * - * @param base PORT peripheral base pointer. - * @param pin PORT pin number. - * @param value PORT pin pull value - * - #kPORT_LowPullResistor = 0U - Low internal pull resistor value is selected. - * - #kPORT_HighPullResistor = 1U - High internal pull resistor value is selected. - */ -static inline void PORT_SetPinPullValue(PORT_Type *base, uint32_t pin, uint8_t value) -{ - base->PCR[pin] = (base->PCR[pin] & ~PORT_PCR_PV_MASK) | PORT_PCR_PV(value); -} -#endif /* FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE */ - -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) -/*! - * @brief Reads the whole port status flag. - * - * If a pin is configured to generate the DMA request, the corresponding flag - * is cleared automatically at the completion of the requested DMA transfer. - * Otherwise, the flag remains set until a logic one is written to that flag. - * If configured for a level sensitive interrupt that remains asserted, the flag - * is set again immediately. - * - * @param base PORT peripheral base pointer. - * @return Current port interrupt status flags, for example, 0x00010001 means the - * pin 0 and 16 have the interrupt. - */ -static inline uint32_t PORT_GetPinsInterruptFlags(PORT_Type *base) -{ - return base->ISFR; -} - -/*! - * @brief Clears the multiple pin interrupt status flag. - * - * @param base PORT peripheral base pointer. - * @param mask PORT pin number macro. - */ -static inline void PORT_ClearPinsInterruptFlags(PORT_Type *base, uint32_t mask) -{ - base->ISFR = mask; -} -#endif - -#if defined(FSL_FEATURE_PORT_SUPPORT_EFT) && FSL_FEATURE_PORT_SUPPORT_EFT -/*! - * @brief Get EFT detect flags. - * - * @param base PORT peripheral base pointer - * @return EFT detect flags - */ -static inline uint32_t PORT_GetEFTDetectFlags(PORT_Type *base) -{ - return base->EDFR; -} - -/*! - * @brief Enable EFT detect interrupts. - * - * @param base PORT peripheral base pointer - * @param interrupt EFT detect interrupt - */ -static inline void PORT_EnableEFTDetectInterrupts(PORT_Type *base, uint32_t interrupt) -{ - base->EDIER |= interrupt; -} - -/*! - * @brief Disable EFT detect interrupts. - * - * @param base PORT peripheral base pointer - * @param interrupt EFT detect interrupt - */ -static inline void PORT_DisableEFTDetectInterrupts(PORT_Type *base, uint32_t interrupt) -{ - base->EDIER &= ~interrupt; -} - -/*! - * @brief Clear all low EFT detector. - * - * @note : Port B and Port C pins share the same EFT detector clear control from PORTC_EDCR register. Any write to the - * PORTB_EDCR does not take effect. - * @param base PORT peripheral base pointer - * @param interrupt EFT detect interrupt - */ -static inline void PORT_ClearAllLowEFTDetectors(PORT_Type *base) -{ - base->EDCR |= PORT_EDCR_EDLC_MASK; - base->EDCR &= ~PORT_EDCR_EDLC_MASK; -} - -/*! - * @brief Clear all high EFT detector. - * - * @param base PORT peripheral base pointer - * @param interrupt EFT detect interrupt - */ -static inline void PORT_ClearAllHighEFTDetectors(PORT_Type *base) -{ - base->EDCR |= PORT_EDCR_EDHC_MASK; - base->EDCR &= ~PORT_EDCR_EDHC_MASK; -} -#endif /* FSL_FEATURE_PORT_SUPPORT_EFT */ - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_PORT_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_pwm.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_pwm.c deleted file mode 100644 index 7fe51bcc779..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_pwm.c +++ /dev/null @@ -1,1491 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_pwm.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.pwm" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Get the instance from the base address - * - * @param base PWM peripheral base address - * - * @return The PWM module instance - */ -static uint32_t PWM_GetInstance(PWM_Type *base); - -#if defined(PWM_RSTS) -#define PWM_RESETS_ARRAY PWM_RSTS -#elif defined(FLEXPWM_RSTS) -#define PWM_RESETS_ARRAY FLEXPWM_RSTS -#elif defined(FLEXPWM_RSTS_N) -#define PWM_RESETS_ARRAY FLEXPWM_RSTS_N -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to PWM bases for each instance. */ -static PWM_Type *const s_pwmBases[] = PWM_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to PWM clocks for each PWM submodule. */ -static const clock_ip_name_t s_pwmClocks[][FSL_FEATURE_PWM_SUBMODULE_COUNT] = PWM_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(PWM_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_pwmResets[] = PWM_RESETS_ARRAY; -#endif - -/*! @brief Temporary PWM duty cycle. */ -static uint8_t s_pwmGetPwmDutyCycle[FSL_FEATURE_PWM_SUBMODULE_COUNT][PWM_SUBMODULE_CHANNEL] = {{0}}; - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Complement the variable of type uint16_t as needed - * - * This function can complement the variable of type uint16_t as needed.For example, - * need to ask for the opposite of a positive integer. - * - * param value Parameters of type uint16_t - */ -static inline uint16_t PWM_GetComplementU16(uint16_t value) -{ - return (~value + 1U); -} - -static inline uint16_t dutyCycleToReloadValue(uint8_t dutyCyclePercent) -{ - /* Rounding calculations to improve the accuracy of reloadValue */ - return ((65535U * dutyCyclePercent) + 50U) / 100U; -} - -static uint32_t PWM_GetInstance(PWM_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_pwmBases); instance++) - { - if (s_pwmBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_pwmBases)); - - return instance; -} - -/*! - * brief Set register about period on one PWM submodule. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param mode PWM operation mode, options available in enumeration ::pwm_mode_t - * param pulseCnt PWM period, value should be between 0 to 65535 - */ -static void PWM_SetPeriodRegister(PWM_Type *base, pwm_submodule_t subModule, pwm_mode_t mode, uint16_t pulseCnt) -{ - uint16_t modulo = 0; - - switch (mode) - { - case kPWM_SignedCenterAligned: - /* Setup the PWM period for a signed center aligned signal */ - modulo = (pulseCnt >> 1U); - /* Indicates the start of the PWM period */ - base->SM[subModule].INIT = PWM_GetComplementU16(modulo); - /* Indicates the center value */ - base->SM[subModule].VAL0 = 0; - /* Indicates the end of the PWM period */ - /* The change during the end to start of the PWM period requires a count time */ - base->SM[subModule].VAL1 = modulo - 1U; - break; - case kPWM_CenterAligned: - /* Setup the PWM period for an unsigned center aligned signal */ - /* Indicates the start of the PWM period */ - base->SM[subModule].INIT = 0; - /* Indicates the center value */ - base->SM[subModule].VAL0 = (pulseCnt / 2U); - /* Indicates the end of the PWM period */ - /* The change during the end to start of the PWM period requires a count time */ - base->SM[subModule].VAL1 = pulseCnt - 1U; - break; - case kPWM_SignedEdgeAligned: - /* Setup the PWM period for a signed edge aligned signal */ - modulo = (pulseCnt >> 1U); - /* Indicates the start of the PWM period */ - base->SM[subModule].INIT = PWM_GetComplementU16(modulo); - /* Indicates the center value */ - base->SM[subModule].VAL0 = 0; - /* Indicates the end of the PWM period */ - /* The change during the end to start of the PWM period requires a count time */ - base->SM[subModule].VAL1 = modulo - 1U; - break; - case kPWM_EdgeAligned: - /* Setup the PWM period for a unsigned edge aligned signal */ - /* Indicates the start of the PWM period */ - base->SM[subModule].INIT = 0; - /* Indicates the center value */ - base->SM[subModule].VAL0 = (pulseCnt / 2U); - /* Indicates the end of the PWM period */ - /* The change during the end to start of the PWM period requires a count time */ - base->SM[subModule].VAL1 = pulseCnt - 1U; - break; - default: - assert(false); - break; - } -} - -/*! - * brief Set register about dutycycle on one PWM submodule. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmSignal Signal (PWM A or PWM B) to update - * param mode PWM operation mode, options available in enumeration ::pwm_mode_t - * param pulseCnt PWM period, value should be between 0 to 65535 - * param dutyCycle New PWM pulse width, value should be between 0 to 65535 - */ -static void PWM_SetDutycycleRegister(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmSignal, - pwm_mode_t mode, - uint16_t pulseCnt, - uint16_t pwmHighPulse) -{ - uint16_t modulo = 0; - - switch (mode) - { - case kPWM_SignedCenterAligned: - /* Setup the PWM dutycycle for a signed center aligned signal */ - if (pwmSignal == kPWM_PwmA) - { - base->SM[subModule].VAL2 = PWM_GetComplementU16(pwmHighPulse / 2U); - base->SM[subModule].VAL3 = (pwmHighPulse / 2U); - } - else if (pwmSignal == kPWM_PwmB) - { - base->SM[subModule].VAL4 = PWM_GetComplementU16(pwmHighPulse / 2U); - base->SM[subModule].VAL5 = (pwmHighPulse / 2U); - } - else - { - ; /* Intentional empty */ - } - break; - case kPWM_CenterAligned: - /* Setup the PWM dutycycle for an unsigned center aligned signal */ - if (pwmSignal == kPWM_PwmA) - { - base->SM[subModule].VAL2 = ((pulseCnt - pwmHighPulse) / 2U); - base->SM[subModule].VAL3 = ((pulseCnt + pwmHighPulse) / 2U); - } - else if (pwmSignal == kPWM_PwmB) - { - base->SM[subModule].VAL4 = ((pulseCnt - pwmHighPulse) / 2U); - base->SM[subModule].VAL5 = ((pulseCnt + pwmHighPulse) / 2U); - } - else - { - ; /* Intentional empty */ - } - break; - case kPWM_SignedEdgeAligned: - modulo = (pulseCnt >> 1U); - - /* Setup the PWM dutycycle for a signed edge aligned signal */ - if (pwmSignal == kPWM_PwmA) - { - base->SM[subModule].VAL2 = PWM_GetComplementU16(modulo); - base->SM[subModule].VAL3 = PWM_GetComplementU16(modulo) + pwmHighPulse; - } - else if (pwmSignal == kPWM_PwmB) - { - base->SM[subModule].VAL4 = PWM_GetComplementU16(modulo); - base->SM[subModule].VAL5 = PWM_GetComplementU16(modulo) + pwmHighPulse; - } - else - { - ; /* Intentional empty */ - } - break; - case kPWM_EdgeAligned: - /* Setup the PWM dutycycle for a unsigned edge aligned signal */ - if (pwmSignal == kPWM_PwmA) - { - base->SM[subModule].VAL2 = 0; - base->SM[subModule].VAL3 = pwmHighPulse; - } - else if (pwmSignal == kPWM_PwmB) - { - base->SM[subModule].VAL4 = 0; - base->SM[subModule].VAL5 = pwmHighPulse; - } - else - { - ; /* Intentional empty */ - } - break; - default: - assert(false); - break; - } -} - -/*! - * brief Ungates the PWM submodule clock and configures the peripheral for basic operation. - * - * note This API should be called at the beginning of the application using the PWM driver. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param config Pointer to user's PWM config structure. - * - * return kStatus_Success means success; else failed. - */ -status_t PWM_Init(PWM_Type *base, pwm_submodule_t subModule, const pwm_config_t *config) -{ - assert(config); - - uint16_t reg; - - /* Source clock for submodule 0 cannot be itself */ - if ((config->clockSource == kPWM_Submodule0Clock) && (subModule == kPWM_Module_0)) - { - return kStatus_Fail; - } - - /* Reload source select clock for submodule 0 cannot be master reload */ - if ((config->reloadSelect == kPWM_MasterReload) && (subModule == kPWM_Module_0)) - { - return kStatus_Fail; - } - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate the PWM submodule clock*/ - CLOCK_EnableClock(s_pwmClocks[PWM_GetInstance(base)][subModule]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(PWM_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_pwmResets[PWM_GetInstance(base)]); -#endif - - /* Clear the fault status flags */ - base->FSTS |= PWM_FSTS_FFLAG_MASK; - - reg = base->SM[subModule].CTRL2; - - /* Setup the submodule clock-source, control source of the INIT signal, - * source of the force output signal, operation in debug & wait modes and reload source select - */ - reg &= - ~(uint16_t)(PWM_CTRL2_CLK_SEL_MASK | PWM_CTRL2_FORCE_SEL_MASK | PWM_CTRL2_INIT_SEL_MASK | PWM_CTRL2_INDEP_MASK | -#if !defined(FSL_FEATURE_PWM_HAS_NO_WAITEN) || (!FSL_FEATURE_PWM_HAS_NO_WAITEN) - PWM_CTRL2_WAITEN_MASK | -#endif /* FSL_FEATURE_PWM_HAS_NO_WAITEN */ - PWM_CTRL2_DBGEN_MASK | PWM_CTRL2_RELOAD_SEL_MASK); - reg |= (PWM_CTRL2_CLK_SEL(config->clockSource) | PWM_CTRL2_FORCE_SEL(config->forceTrigger) | - PWM_CTRL2_INIT_SEL(config->initializationControl) | PWM_CTRL2_DBGEN(config->enableDebugMode) | -#if !defined(FSL_FEATURE_PWM_HAS_NO_WAITEN) || (!FSL_FEATURE_PWM_HAS_NO_WAITEN) - PWM_CTRL2_WAITEN(config->enableWait) | -#endif /* FSL_FEATURE_PWM_HAS_NO_WAITEN */ - PWM_CTRL2_RELOAD_SEL(config->reloadSelect)); - - /* Setup PWM A & B to be independent or a complementary-pair */ - switch (config->pairOperation) - { - case kPWM_Independent: - reg |= PWM_CTRL2_INDEP_MASK; - break; - case kPWM_ComplementaryPwmA: - base->MCTRL &= ~((uint16_t)1U << (PWM_MCTRL_IPOL_SHIFT + (uint16_t)subModule)); - break; - case kPWM_ComplementaryPwmB: - base->MCTRL |= ((uint16_t)1U << (PWM_MCTRL_IPOL_SHIFT + (uint16_t)subModule)); - break; - default: - assert(false); - break; - } - base->SM[subModule].CTRL2 = reg; - - reg = base->SM[subModule].CTRL; - - /* Setup the clock prescale, load mode and frequency */ - reg &= ~(uint16_t)(PWM_CTRL_PRSC_MASK | PWM_CTRL_LDFQ_MASK | PWM_CTRL_LDMOD_MASK); - reg |= (PWM_CTRL_PRSC(config->prescale) | PWM_CTRL_LDFQ(config->reloadFrequency)); - - /* Setup register reload logic */ - switch (config->reloadLogic) - { - case kPWM_ReloadImmediate: - reg |= PWM_CTRL_LDMOD_MASK; - break; - case kPWM_ReloadPwmHalfCycle: - reg |= PWM_CTRL_HALF_MASK; - reg &= (uint16_t)(~PWM_CTRL_FULL_MASK); - break; - case kPWM_ReloadPwmFullCycle: - reg &= (uint16_t)(~PWM_CTRL_HALF_MASK); - reg |= PWM_CTRL_FULL_MASK; - break; - case kPWM_ReloadPwmHalfAndFullCycle: - reg |= PWM_CTRL_HALF_MASK; - reg |= PWM_CTRL_FULL_MASK; - break; - default: - assert(false); - break; - } - base->SM[subModule].CTRL = reg; - - /* Set PWM output normal */ -#if defined(PWM_MASK_UPDATE_MASK) - base->MASK &= (uint16_t)(~(uint16_t)(PWM_MASK_MASKX_MASK | PWM_MASK_MASKA_MASK | PWM_MASK_MASKB_MASK | - PWM_MASK_UPDATE_MASK_MASK)); -#else - base->MASK &= ~(uint16_t)(PWM_MASK_MASKX_MASK | PWM_MASK_MASKA_MASK | PWM_MASK_MASKB_MASK); -#endif - - base->DTSRCSEL = 0U; - - /* Issue a Force trigger event when configured to trigger locally */ - if (config->forceTrigger == kPWM_Force_Local) - { - base->SM[subModule].CTRL2 |= PWM_CTRL2_FORCE(1U); - } - - return kStatus_Success; -} - -/*! - * brief Gate the PWM submodule clock - * - * param base PWM peripheral base address - * param subModule PWM submodule to deinitialize - */ -void PWM_Deinit(PWM_Type *base, pwm_submodule_t subModule) -{ - /* Stop the submodule */ - base->MCTRL &= ~((uint16_t)1U << (PWM_MCTRL_RUN_SHIFT + (uint16_t)subModule)); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate the PWM submodule clock*/ - CLOCK_DisableClock(s_pwmClocks[PWM_GetInstance(base)][subModule]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Fill in the PWM config struct with the default settings - * - * The default values are: - * code - * config->enableDebugMode = false; - * config->enableWait = false; - * config->reloadSelect = kPWM_LocalReload; - * config->clockSource = kPWM_BusClock; - * config->prescale = kPWM_Prescale_Divide_1; - * config->initializationControl = kPWM_Initialize_LocalSync; - * config->forceTrigger = kPWM_Force_Local; - * config->reloadFrequency = kPWM_LoadEveryOportunity; - * config->reloadLogic = kPWM_ReloadImmediate; - * config->pairOperation = kPWM_Independent; - * endcode - * param config Pointer to user's PWM config structure. - */ -void PWM_GetDefaultConfig(pwm_config_t *config) -{ - assert(config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - /* PWM is paused in debug mode */ - config->enableDebugMode = false; - /* PWM is paused in wait mode */ -#if !defined(FSL_FEATURE_PWM_HAS_NO_WAITEN) || (!FSL_FEATURE_PWM_HAS_NO_WAITEN) - config->enableWait = false; -#endif /* FSL_FEATURE_PWM_HAS_NO_WAITEN */ - /* PWM module uses the local reload signal to reload registers */ - config->reloadSelect = kPWM_LocalReload; - /* Use the IP Bus clock as source clock for the PWM submodule */ - config->clockSource = kPWM_BusClock; - /* Clock source prescale is set to divide by 1*/ - config->prescale = kPWM_Prescale_Divide_1; - /* Local sync causes initialization */ - config->initializationControl = kPWM_Initialize_LocalSync; - /* The local force signal, CTRL2[FORCE], from the submodule is used to force updates */ - config->forceTrigger = kPWM_Force_Local; - /* PWM reload frequency, reload opportunity is PWM half cycle or full cycle. - * This field is not used in Immediate reload mode - */ - config->reloadFrequency = kPWM_LoadEveryOportunity; - /* Buffered-registers get loaded with new values as soon as LDOK bit is set */ - config->reloadLogic = kPWM_ReloadImmediate; - /* PWM A & PWM B operate as 2 independent channels */ - config->pairOperation = kPWM_Independent; -} - -/*! - * brief Sets up the PWM signals for a PWM submodule. - * - * The function initializes the submodule according to the parameters passed in by the user. The function - * also sets up the value compare registers to match the PWM signal requirements. - * If the dead time insertion logic is enabled, the pulse period is reduced by the - * dead time period specified by the user. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param chnlParams Array of PWM channel parameters to configure the channel(s), PWMX submodule is not supported. - * param numOfChnls Number of channels to configure, this should be the size of the array passed in. - * Array size should not be more than 2 as each submodule has 2 pins to output PWM - * param mode PWM operation mode, options available in enumeration ::pwm_mode_t - * param pwmFreq_Hz PWM signal frequency in Hz - * param srcClock_Hz PWM source clock of correspond submodule in Hz. If source clock of submodule1,2,3 is from - * submodule0 AUX_CLK, its source clock is submodule0 source clock divided with submodule0 - * prescaler value instead of submodule0 source clock. - * - * return Returns kStatusFail if there was error setting up the signal; kStatusSuccess otherwise - */ -status_t PWM_SetupPwm(PWM_Type *base, - pwm_submodule_t subModule, - const pwm_signal_param_t *chnlParams, - uint8_t numOfChnls, - pwm_mode_t mode, - uint32_t pwmFreq_Hz, - uint32_t srcClock_Hz) -{ - assert(chnlParams); - assert(pwmFreq_Hz); - assert(numOfChnls); - assert(srcClock_Hz); - - uint32_t pwmClock; - uint16_t pulseCnt = 0, pwmHighPulse = 0; - uint8_t i, polarityShift = 0, outputEnableShift = 0; - - for (i = 0; i < numOfChnls; i++) - { - if (chnlParams[i].pwmChannel == kPWM_PwmX) - { - /* PWMX configuration is not supported yet */ - return kStatus_Fail; - } - } - - /* Divide the clock by the prescale value */ - pwmClock = (srcClock_Hz / (1UL << ((base->SM[subModule].CTRL & PWM_CTRL_PRSC_MASK) >> PWM_CTRL_PRSC_SHIFT))); - pulseCnt = (uint16_t)(pwmClock / pwmFreq_Hz); - - /* Setup each PWM channel */ - for (i = 0; i < numOfChnls; i++) - { - /* Calculate pulse width */ - pwmHighPulse = (pulseCnt * chnlParams->dutyCyclePercent) / 100U; - - /* Setup the different match registers to generate the PWM signal */ - if (i == 0U) - { - /* Update register about period */ - PWM_SetPeriodRegister(base, subModule, mode, pulseCnt); - } - - /* Update register about dutycycle */ - PWM_SetDutycycleRegister(base, subModule, chnlParams->pwmChannel, mode, pulseCnt, pwmHighPulse); - - /* Setup register shift values based on the channel being configured. - * Also setup the deadtime value - */ - if (chnlParams->pwmChannel == kPWM_PwmA) - { - polarityShift = PWM_OCTRL_POLA_SHIFT; - outputEnableShift = PWM_OUTEN_PWMA_EN_SHIFT; - base->SM[subModule].DTCNT0 = PWM_DTCNT0_DTCNT0(chnlParams->deadtimeValue); - } - else - { - polarityShift = PWM_OCTRL_POLB_SHIFT; - outputEnableShift = PWM_OUTEN_PWMB_EN_SHIFT; - base->SM[subModule].DTCNT1 = PWM_DTCNT1_DTCNT1(chnlParams->deadtimeValue); - } - - /* Set PWM output fault status */ - switch (chnlParams->pwmChannel) - { - case kPWM_PwmA: - base->SM[subModule].OCTRL &= ~((uint16_t)PWM_OCTRL_PWMAFS_MASK); - base->SM[subModule].OCTRL |= (((uint16_t)(chnlParams->faultState) << (uint16_t)PWM_OCTRL_PWMAFS_SHIFT) & - (uint16_t)PWM_OCTRL_PWMAFS_MASK); - break; - case kPWM_PwmB: - base->SM[subModule].OCTRL &= ~((uint16_t)PWM_OCTRL_PWMBFS_MASK); - base->SM[subModule].OCTRL |= (((uint16_t)(chnlParams->faultState) << (uint16_t)PWM_OCTRL_PWMBFS_SHIFT) & - (uint16_t)PWM_OCTRL_PWMBFS_MASK); - break; - default: - assert(false); - break; - } - - /* Setup signal active level */ - if ((bool)chnlParams->level == kPWM_HighTrue) - { - base->SM[subModule].OCTRL &= ~((uint16_t)1U << (uint16_t)polarityShift); - } - else - { - base->SM[subModule].OCTRL |= ((uint16_t)1U << (uint16_t)polarityShift); - } - if (chnlParams->pwmchannelenable) - { - /* Enable PWM output */ - base->OUTEN |= ((uint16_t)1U << ((uint16_t)outputEnableShift + (uint16_t)subModule)); - } - - /* Get the pwm duty cycle */ - s_pwmGetPwmDutyCycle[subModule][chnlParams->pwmChannel] = chnlParams->dutyCyclePercent; - - /* Get the next channel parameters */ - chnlParams++; - } - - return kStatus_Success; -} - -/*! - * brief Set PWM phase shift for PWM channel running on channel PWM_A, PWM_B which with 50% duty cycle. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmChannel PWM channel to configure - * param pwmFreq_Hz PWM signal frequency in Hz - * param srcClock_Hz PWM main counter clock in Hz. - * param shiftvalue Phase shift value, range in 0 ~ 50 - * param doSync true: Set LDOK bit for the submodule list; - * false: LDOK bit don't set, need to call PWM_SetPwmLdok to sync update. - * - * return Returns kStatus_Fail if there was error setting up the signal; kStatus_Success otherwise - */ -status_t PWM_SetupPwmPhaseShift(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - uint32_t pwmFreq_Hz, - uint32_t srcClock_Hz, - uint8_t shiftvalue, - bool doSync) -{ - assert(pwmFreq_Hz != 0U); - assert(srcClock_Hz != 0U); - assert(shiftvalue <= 50U); - - uint32_t pwmClock; - uint16_t pulseCnt = 0, pwmHighPulse = 0; - uint16_t modulo = 0; - uint16_t shift = 0; - - if (pwmChannel != kPWM_PwmX) - { - /* Divide the clock by the prescale value */ - pwmClock = (srcClock_Hz / (1UL << ((base->SM[subModule].CTRL & PWM_CTRL_PRSC_MASK) >> PWM_CTRL_PRSC_SHIFT))); - pulseCnt = (uint16_t)(pwmClock / pwmFreq_Hz); - - /* Clear LDOK bit if it is set */ - if (0U != (base->MCTRL & PWM_MCTRL_LDOK(1UL << (uint8_t)subModule))) - { - base->MCTRL |= PWM_MCTRL_CLDOK(1UL << (uint8_t)subModule); - } - - modulo = (pulseCnt >> 1U); - /* Indicates the start of the PWM period */ - base->SM[subModule].INIT = PWM_GetComplementU16(modulo); - /* Indicates the center value */ - base->SM[subModule].VAL0 = 0; - /* Indicates the end of the PWM period */ - /* The change during the end to start of the PWM period requires a count time */ - base->SM[subModule].VAL1 = modulo - 1U; - - /* Immediately upon when MCTRL[LDOK] being set */ - base->SM[subModule].CTRL |= PWM_CTRL_LDMOD_MASK; - - /* phase shift value */ - shift = (pulseCnt * shiftvalue) / 100U; - - /* duty cycle 50% */ - pwmHighPulse = pulseCnt / 2U; - - if (pwmChannel == kPWM_PwmA) - { - base->SM[subModule].VAL2 = PWM_GetComplementU16(modulo) + shift; - base->SM[subModule].VAL3 = PWM_GetComplementU16(modulo) + pwmHighPulse + shift - 1U; - } - else if (pwmChannel == kPWM_PwmB) - { - base->SM[subModule].VAL4 = PWM_GetComplementU16(modulo) + shift; - base->SM[subModule].VAL5 = PWM_GetComplementU16(modulo) + pwmHighPulse + shift - 1U; - } - else - { - return kStatus_Fail; - } - - if (doSync) - { - /* Set LDOK bit to load VALx bit */ - base->MCTRL |= PWM_MCTRL_LDOK(1UL << (uint8_t)subModule); - } - } - else - { - return kStatus_Fail; - } - - return kStatus_Success; -} - -/*! - * brief Updates the PWM signal's dutycycle. - * - * The function updates the PWM dutycyle to the new value that is passed in. - * If the dead time insertion logic is enabled then the pulse period is reduced by the - * dead time period specified by the user. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmSignal Signal (PWM A or PWM B) to update - * param currPwmMode The current PWM mode set during PWM setup - * param dutyCyclePercent New PWM pulse width, value should be between 0 to 100 - * 0=inactive signal(0% duty cycle)... - * 100=active signal (100% duty cycle) - */ -void PWM_UpdatePwmDutycycle(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmSignal, - pwm_mode_t currPwmMode, - uint8_t dutyCyclePercent) -{ - assert(dutyCyclePercent <= 100U); - assert(pwmSignal != kPWM_PwmX); - uint16_t reloadValue = dutyCycleToReloadValue(dutyCyclePercent); - - PWM_UpdatePwmDutycycleHighAccuracy(base, subModule, pwmSignal, currPwmMode, reloadValue); -} - -/*! - * brief Updates the PWM signal's dutycycle with 16-bit accuracy. - * - * The function updates the PWM dutycyle to the new value that is passed in. - * If the dead time insertion logic is enabled then the pulse period is reduced by the - * dead time period specified by the user. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmSignal Signal (PWM A or PWM B) to update - * param currPwmMode The current PWM mode set during PWM setup - * param dutyCycle New PWM pulse width, value should be between 0 to 65535 - * 0=inactive signal(0% duty cycle)... - * 65535=active signal (100% duty cycle) - */ -void PWM_UpdatePwmDutycycleHighAccuracy( - PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmSignal, pwm_mode_t currPwmMode, uint16_t dutyCycle) -{ - assert(pwmSignal != kPWM_PwmX); - uint16_t pulseCnt = 0, pwmHighPulse = 0; - uint16_t modulo = 0; - - switch (currPwmMode) - { - case kPWM_SignedCenterAligned: - modulo = base->SM[subModule].VAL1 + 1U; - pulseCnt = modulo * 2U; - /* Calculate pulse width */ - pwmHighPulse = (pulseCnt * dutyCycle) / 65535U; - break; - case kPWM_CenterAligned: - pulseCnt = base->SM[subModule].VAL1 + 1U; - /* Calculate pulse width */ - pwmHighPulse = (pulseCnt * dutyCycle) / 65535U; - break; - case kPWM_SignedEdgeAligned: - modulo = base->SM[subModule].VAL1 + 1U; - pulseCnt = modulo * 2U; - /* Calculate pulse width */ - pwmHighPulse = (pulseCnt * dutyCycle) / 65535U; - break; - case kPWM_EdgeAligned: - pulseCnt = base->SM[subModule].VAL1 + 1U; - /* Calculate pulse width */ - pwmHighPulse = (pulseCnt * dutyCycle) / 65535U; - break; - default: - assert(false); - break; - } - - /* Update register about dutycycle */ - if (kPWM_PwmA == pwmSignal) - { - PWM_SetDutycycleRegister(base, subModule, kPWM_PwmA, currPwmMode, pulseCnt, pwmHighPulse); - } - else if (kPWM_PwmB == pwmSignal) - { - PWM_SetDutycycleRegister(base, subModule, kPWM_PwmB, currPwmMode, pulseCnt, pwmHighPulse); - } - else - { - ; /* Intentional empty */ - } - - if (kPWM_PwmX != pwmSignal) - { - /* Get the pwm duty cycle */ - s_pwmGetPwmDutyCycle[subModule][pwmSignal] = (uint8_t)(dutyCycle * 100U / 65535U); - } -} - -/*! - * brief Update the PWM signal's period and dutycycle for a PWM submodule. - * - * The function updates PWM signal period generated by a specific submodule according to the parameters - * passed in by the user. This function can also set dutycycle weather you want to keep original dutycycle - * or update new dutycycle. Call this function in local sync control mode because PWM period is depended by - * INIT and VAL1 register of each submodule. In master sync initialization control mode, call this function - * to update INIT and VAL1 register of all submodule because PWM period is depended by INIT and VAL1 register - * in submodule0. If the dead time insertion logic is enabled, the pulse period is reduced by the dead time - * period specified by the user. PWM signal will not be generated if its period is less than dead time duration. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmSignal Signal (PWM A or PWM B) to update - * param currPwmMode The current PWM mode set during PWM setup, options available in enumeration ::pwm_mode_t - * param pulseCnt New PWM period, value should be between 0 to 65535 - * 0=minimum PWM period... - * 65535=maximum PWM period - * param dutyCycle New PWM pulse width of channel, value should be between 0 to 65535 - * 0=inactive signal(0% duty cycle)... - * 65535=active signal (100% duty cycle) - * You can keep original dutycycle or update new dutycycle - */ -void PWM_UpdatePwmPeriodAndDutycycle(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmSignal, - pwm_mode_t currPwmMode, - uint16_t pulseCnt, - uint16_t dutyCycle) -{ - uint16_t pwmHighPulse = 0; - - assert(pwmSignal != kPWM_PwmX); - - /* Calculate pulse width */ - pwmHighPulse = (pulseCnt * dutyCycle) / 65535U; - - /* Update register about period */ - PWM_SetPeriodRegister(base, subModule, currPwmMode, pulseCnt); - - /* Update register about dutycycle */ - PWM_SetDutycycleRegister(base, subModule, pwmSignal, currPwmMode, pulseCnt, pwmHighPulse); - - /* Get the pwm duty cycle */ - s_pwmGetPwmDutyCycle[subModule][pwmSignal] = (uint8_t)((dutyCycle * 100U) / 65535U); -} - -/*! - * brief Sets up the PWM input capture - * - * Each PWM submodule has 3 pins that can be configured for use as input capture pins. This function - * sets up the capture parameters for each pin and enables the pin for input capture operation. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmChannel Channel in the submodule to setup - * param inputCaptureParams Parameters passed in to set up the input pin - */ -void PWM_SetupInputCapture(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - const pwm_input_capture_param_t *inputCaptureParams) -{ - uint16_t reg = 0; - switch (pwmChannel) - { -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA - case kPWM_PwmA: - /* Setup the capture paramters for PWM A pin */ - reg = (PWM_CAPTCTRLA_INP_SELA(inputCaptureParams->captureInputSel) | - PWM_CAPTCTRLA_EDGA0(inputCaptureParams->edge0) | PWM_CAPTCTRLA_EDGA1(inputCaptureParams->edge1) | - PWM_CAPTCTRLA_ONESHOTA(inputCaptureParams->enableOneShotCapture) | - PWM_CAPTCTRLA_CFAWM(inputCaptureParams->fifoWatermark)); - /* Enable the edge counter if using the output edge counter */ - if (inputCaptureParams->captureInputSel) - { - reg |= PWM_CAPTCTRLA_EDGCNTA_EN_MASK; - } - /* Enable input capture operation */ - reg |= PWM_CAPTCTRLA_ARMA_MASK; - - base->SM[subModule].CAPTCTRLA = reg; - - /* Setup the compare value when using the edge counter as source */ - base->SM[subModule].CAPTCOMPA = PWM_CAPTCOMPA_EDGCMPA(inputCaptureParams->edgeCompareValue); - /* Setup PWM A pin for input capture */ - base->OUTEN &= ~((uint16_t)1U << (PWM_OUTEN_PWMA_EN_SHIFT + (uint16_t)subModule)); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB - case kPWM_PwmB: - /* Setup the capture paramters for PWM B pin */ - reg = (PWM_CAPTCTRLB_INP_SELB(inputCaptureParams->captureInputSel) | - PWM_CAPTCTRLB_EDGB0(inputCaptureParams->edge0) | PWM_CAPTCTRLB_EDGB1(inputCaptureParams->edge1) | - PWM_CAPTCTRLB_ONESHOTB(inputCaptureParams->enableOneShotCapture) | - PWM_CAPTCTRLB_CFBWM(inputCaptureParams->fifoWatermark)); - /* Enable the edge counter if using the output edge counter */ - if (inputCaptureParams->captureInputSel) - { - reg |= PWM_CAPTCTRLB_EDGCNTB_EN_MASK; - } - /* Enable input capture operation */ - reg |= PWM_CAPTCTRLB_ARMB_MASK; - - base->SM[subModule].CAPTCTRLB = reg; - - /* Setup the compare value when using the edge counter as source */ - base->SM[subModule].CAPTCOMPB = PWM_CAPTCOMPB_EDGCMPB(inputCaptureParams->edgeCompareValue); - /* Setup PWM B pin for input capture */ - base->OUTEN &= ~((uint16_t)1U << (PWM_OUTEN_PWMB_EN_SHIFT + (uint16_t)subModule)); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX - case kPWM_PwmX: - reg = (PWM_CAPTCTRLX_INP_SELX(inputCaptureParams->captureInputSel) | - PWM_CAPTCTRLX_EDGX0(inputCaptureParams->edge0) | PWM_CAPTCTRLX_EDGX1(inputCaptureParams->edge1) | - PWM_CAPTCTRLX_ONESHOTX(inputCaptureParams->enableOneShotCapture) | - PWM_CAPTCTRLX_CFXWM(inputCaptureParams->fifoWatermark)); - /* Enable the edge counter if using the output edge counter */ - if (inputCaptureParams->captureInputSel) - { - reg |= PWM_CAPTCTRLX_EDGCNTX_EN_MASK; - } - /* Enable input capture operation */ - reg |= PWM_CAPTCTRLX_ARMX_MASK; - - base->SM[subModule].CAPTCTRLX = reg; - - /* Setup the compare value when using the edge counter as source */ - base->SM[subModule].CAPTCOMPX = PWM_CAPTCOMPX_EDGCMPX(inputCaptureParams->edgeCompareValue); - /* Setup PWM X pin for input capture */ - base->OUTEN &= ~((uint16_t)1U << (PWM_OUTEN_PWMX_EN_SHIFT + (uint16_t)subModule)); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX */ - default: - assert(false); - break; - } -} - -/*! - * @brief Sets up the PWM fault input filter. - * - * @param base PWM peripheral base address - * @param faultInputFilterParams Parameters passed in to set up the fault input filter. - */ -void PWM_SetupFaultInputFilter(PWM_Type *base, const pwm_fault_input_filter_param_t *faultInputFilterParams) -{ - assert(NULL != faultInputFilterParams); - - /* When changing values for fault period from a non-zero value, first write a value of 0 to clear the filter. */ - if (0U != (base->FFILT & PWM_FFILT_FILT_PER_MASK)) - { - base->FFILT &= ~(uint16_t)(PWM_FFILT_FILT_PER_MASK); - } - - base->FFILT = (uint16_t)(PWM_FFILT_FILT_PER(faultInputFilterParams->faultFilterPeriod) | - PWM_FFILT_FILT_CNT(faultInputFilterParams->faultFilterCount) | - PWM_FFILT_GSTR(faultInputFilterParams->faultGlitchStretch ? 1U : 0U)); -} - -/*! - * brief Sets up the PWM fault protection. - * - * PWM has 4 fault inputs. - * - * param base PWM peripheral base address - * param faultNum PWM fault to configure. - * param faultParams Pointer to the PWM fault config structure - */ -void PWM_SetupFaults(PWM_Type *base, pwm_fault_input_t faultNum, const pwm_fault_param_t *faultParams) -{ - assert(faultParams); - uint16_t reg; - - reg = base->FCTRL; - /* Set the faults level-settting */ - if (faultParams->faultLevel) - { - reg |= ((uint16_t)1U << (PWM_FCTRL_FLVL_SHIFT + (uint16_t)faultNum)); - } - else - { - reg &= ~((uint16_t)1U << (PWM_FCTRL_FLVL_SHIFT + (uint16_t)faultNum)); - } - /* Set the fault clearing mode */ - if ((uint16_t)faultParams->faultClearingMode != 0U) - { - /* Use manual fault clearing */ - reg &= ~((uint16_t)1U << (PWM_FCTRL_FAUTO_SHIFT + (uint16_t)faultNum)); - if (faultParams->faultClearingMode == kPWM_ManualSafety) - { - /* Use manual fault clearing with safety mode enabled */ - reg |= ((uint16_t)1U << (PWM_FCTRL_FSAFE_SHIFT + (uint16_t)faultNum)); - } - else - { - /* Use manual fault clearing with safety mode disabled */ - reg &= ~((uint16_t)1U << (PWM_FCTRL_FSAFE_SHIFT + (uint16_t)faultNum)); - } - } - else - { - /* Use automatic fault clearing */ - reg |= ((uint16_t)1U << (PWM_FCTRL_FAUTO_SHIFT + (uint16_t)faultNum)); - } - base->FCTRL = reg; - - /* Set the combinational path option */ - if (faultParams->enableCombinationalPath) - { - /* Combinational path from the fault input to the PWM output is available */ - base->FCTRL2 &= ~((uint16_t)1U << (uint16_t)faultNum); - } - else - { - /* No combinational path available, only fault filter & latch signal can disable PWM output */ - base->FCTRL2 |= ((uint16_t)1U << (uint16_t)faultNum); - } - - /* Initially clear both recovery modes */ - reg = base->FSTS; - reg &= ~(((uint16_t)1U << (PWM_FSTS_FFULL_SHIFT + (uint16_t)faultNum)) | - ((uint16_t)1U << (PWM_FSTS_FHALF_SHIFT + (uint16_t)faultNum))); - /* Setup fault recovery */ - switch (faultParams->recoverMode) - { - case kPWM_NoRecovery: - break; - case kPWM_RecoverHalfCycle: - reg |= ((uint16_t)1U << (PWM_FSTS_FHALF_SHIFT + (uint16_t)faultNum)); - break; - case kPWM_RecoverFullCycle: - reg |= ((uint16_t)1U << (PWM_FSTS_FFULL_SHIFT + (uint16_t)faultNum)); - break; - case kPWM_RecoverHalfAndFullCycle: - reg |= ((uint16_t)1U << (PWM_FSTS_FHALF_SHIFT + (uint16_t)faultNum)); - reg |= ((uint16_t)1U << (PWM_FSTS_FFULL_SHIFT + (uint16_t)faultNum)); - break; - default: - assert(false); - break; - } - base->FSTS = reg; -} - -/*! - * brief Fill in the PWM fault config struct with the default settings - * - * The default values are: - * code - * config->faultClearingMode = kPWM_Automatic; - * config->faultLevel = false; - * config->enableCombinationalPath = true; - * config->recoverMode = kPWM_NoRecovery; - * endcode - * param config Pointer to user's PWM fault config structure. - */ -void PWM_FaultDefaultConfig(pwm_fault_param_t *config) -{ - assert(config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - /* PWM uses automatic fault clear mode */ - config->faultClearingMode = kPWM_Automatic; - /* PWM fault level is set to logic 0 */ - config->faultLevel = false; - /* Combinational Path from fault input is enabled */ - config->enableCombinationalPath = true; - /* PWM output will stay inactive when recovering from a fault */ - config->recoverMode = kPWM_NoRecovery; -} - -/*! - * brief Selects the signal to output on a PWM pin when a FORCE_OUT signal is asserted. - * - * The user specifies which channel to configure by supplying the submodule number and whether - * to modify PWM A or PWM B within that submodule. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmChannel Channel to configure - * param mode Signal to output when a FORCE_OUT is triggered - */ -void PWM_SetupForceSignal(PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmChannel, pwm_force_signal_t mode) - -{ - uint16_t shift; - uint16_t reg; - - /* DTSRCSEL register has 4 bits per submodule; 2 bits for PWM A and 2 bits for PWM B */ - shift = ((uint16_t)subModule * 4U) + ((uint16_t)pwmChannel * 2U); - - /* Setup the signal to be passed upon occurrence of a FORCE_OUT signal */ - reg = base->DTSRCSEL; - reg &= ~((uint16_t)0x3U << shift); - reg |= (uint16_t)((uint16_t)mode << shift); - base->DTSRCSEL = reg; -} - -/*! - * brief Enables the selected PWM interrupts - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::pwm_interrupt_enable_t - */ -void PWM_EnableInterrupts(PWM_Type *base, pwm_submodule_t subModule, uint32_t mask) -{ - /* Upper 16 bits are for related to the submodule */ - base->SM[subModule].INTEN |= ((uint16_t)mask & 0xFFFFU); - /* Fault related interrupts */ - base->FCTRL |= ((uint16_t)(mask >> 16U) & PWM_FCTRL_FIE_MASK); -} - -/*! - * brief Disables the selected PWM interrupts - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::pwm_interrupt_enable_t - */ -void PWM_DisableInterrupts(PWM_Type *base, pwm_submodule_t subModule, uint32_t mask) -{ - base->SM[subModule].INTEN &= ~((uint16_t)mask & 0xFFFFU); - base->FCTRL &= ~((uint16_t)(mask >> 16U) & PWM_FCTRL_FIE_MASK); -} - -/*! - * brief Gets the enabled PWM interrupts - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * - * return The enabled interrupts. This is the logical OR of members of the - * enumeration ::pwm_interrupt_enable_t - */ -uint32_t PWM_GetEnabledInterrupts(PWM_Type *base, pwm_submodule_t subModule) -{ - uint32_t enabledInterrupts; - - enabledInterrupts = base->SM[subModule].INTEN; - enabledInterrupts |= (((uint32_t)base->FCTRL & PWM_FCTRL_FIE_MASK) << 16UL); - return enabledInterrupts; -} - -/*! - * brief Gets the PWM status flags - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * - * return The status flags. This is the logical OR of members of the - * enumeration ::pwm_status_flags_t - */ -uint32_t PWM_GetStatusFlags(PWM_Type *base, pwm_submodule_t subModule) -{ - uint32_t statusFlags; - - statusFlags = base->SM[subModule].STS; - statusFlags |= (((uint32_t)base->FSTS & PWM_FSTS_FFLAG_MASK) << 16UL); - - return statusFlags; -} - -/*! - * brief Clears the PWM status flags - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::pwm_status_flags_t - */ -void PWM_ClearStatusFlags(PWM_Type *base, pwm_submodule_t subModule, uint32_t mask) -{ - uint16_t reg; - - base->SM[subModule].STS = ((uint16_t)mask & 0xFFFFU); - reg = base->FSTS; - /* Clear the fault flags and set only the ones we wish to clear as the fault flags are cleared - * by writing a login one - */ - reg &= ~(uint16_t)(PWM_FSTS_FFLAG_MASK); - reg |= (uint16_t)((mask >> 16U) & PWM_FSTS_FFLAG_MASK); - base->FSTS = reg; -} - -/*! - * brief Set PWM output in idle status (high or low). - * - * note This API should call after PWM_SetupPwm() APIs, and PWMX submodule is not supported. - * - * param base PWM peripheral base address - * param pwmChannel PWM channel to configure - * param subModule PWM submodule to configure - * param idleStatus True: PWM output is high in idle status; false: PWM output is low in idle status. - * - * return kStatus_Fail if there was error setting up the signal; kStatus_Success if set output idle success - */ -status_t PWM_SetOutputToIdle(PWM_Type *base, pwm_channels_t pwmChannel, pwm_submodule_t subModule, bool idleStatus) -{ - uint16_t valOn = 0, valOff = 0; - uint16_t ldmod; - - /* Clear LDOK bit if it is set */ - if (0U != (base->MCTRL & PWM_MCTRL_LDOK(1UL << (uint8_t)subModule))) - { - base->MCTRL |= PWM_MCTRL_CLDOK(1UL << (uint8_t)subModule); - } - - valOff = base->SM[subModule].INIT; - valOn = base->SM[subModule].VAL1 + 0x1U; - - if ((valOff + 1U) == valOn) - { - return kStatus_Fail; - } - - /* Should not PWM_X channel */ - if (kPWM_PwmA == pwmChannel) - { - if (0U != (base->SM[subModule].OCTRL & PWM_OCTRL_POLA_MASK)) - { - if (!idleStatus) - { - valOn = base->SM[subModule].INIT; - valOff = base->SM[subModule].VAL1 + 0x1U; - } - } - else - { - if (idleStatus) - { - valOn = base->SM[subModule].INIT; - valOff = base->SM[subModule].VAL1 + 0x1U; - } - } - base->SM[subModule].VAL2 = valOn; - base->SM[subModule].VAL3 = valOff; - } - else if (kPWM_PwmB == pwmChannel) - { - if (0U != (base->SM[subModule].OCTRL & PWM_OCTRL_POLB_MASK)) - { - if (!idleStatus) - { - valOn = base->SM[subModule].INIT; - valOff = base->SM[subModule].VAL1 + 0x1U; - } - } - else - { - if (idleStatus) - { - valOn = base->SM[subModule].INIT; - valOff = base->SM[subModule].VAL1 + 0x1U; - } - } - base->SM[subModule].VAL4 = valOn; - base->SM[subModule].VAL5 = valOff; - } - else - { - return kStatus_Fail; - } - - /* Record Load mode */ - ldmod = base->SM[subModule].CTRL; - /* Set Load mode to make Buffered registers take effect immediately when LDOK bit set */ - base->SM[subModule].CTRL |= PWM_CTRL_LDMOD_MASK; - /* Set LDOK bit to load buffer registers */ - base->MCTRL |= PWM_MCTRL_LDOK(1UL << (uint8_t)subModule); - /* Restore Load mode */ - base->SM[subModule].CTRL = ldmod; - - /* Get pwm duty cycle */ - s_pwmGetPwmDutyCycle[subModule][pwmChannel] = 0x0U; - - return kStatus_Success; -} - -/*! - * brief Get the dutycycle value. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmChannel PWM channel to configure - * - * return Current channel dutycycle value. - */ -uint8_t PWM_GetPwmChannelState(PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmChannel) -{ - return s_pwmGetPwmDutyCycle[subModule][pwmChannel]; -} - -/*! - * brief Set the pwm submodule prescaler. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param prescaler Set prescaler value - */ -void PWM_SetClockMode(PWM_Type *base, pwm_submodule_t subModule, pwm_clock_prescale_t prescaler) -{ - uint16_t reg = base->SM[subModule].CTRL; - - /* Clear LDOK bit if it is set */ - if (0U != (base->MCTRL & PWM_MCTRL_LDOK(1UL << (uint8_t)subModule))) - { - base->MCTRL |= PWM_MCTRL_CLDOK(1UL << (uint8_t)subModule); - } - /* Set submodule prescaler. */ - reg &= ~(uint16_t)PWM_CTRL_PRSC_MASK; - reg |= PWM_CTRL_PRSC(prescaler); - base->SM[subModule].CTRL = reg; - /* Set Load mode to make Buffered registers take effect immediately when LDOK bit set */ - base->SM[subModule].CTRL |= PWM_CTRL_LDMOD_MASK; - /* Set LDOK bit to load buffer registers */ - base->MCTRL |= PWM_MCTRL_LDOK(1UL << (uint8_t)subModule); - /* Restore Load mode */ - base->SM[subModule].CTRL = reg; -} - -/*! - * brief This function enables-disables the forcing of the output of a given eFlexPwm channel to logic 0. - * - * param base PWM peripheral base address - * param pwmChannel PWM channel to configure - * param subModule PWM submodule to configure - * param forcetozero True: Enable the pwm force output to zero; False: Disable the pwm output resumes normal - * function. - */ -void PWM_SetPwmForceOutputToZero(PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmChannel, bool forcetozero) -{ -#if !defined(PWM_MASK_UPDATE_MASK) - uint16_t reg = base->SM[subModule].CTRL2; -#endif - uint16_t mask; - - if (kPWM_PwmA == pwmChannel) - { - mask = PWM_MASK_MASKA(0x01UL << (uint8_t)subModule); - } - else if (kPWM_PwmB == pwmChannel) - { - mask = PWM_MASK_MASKB(0x01UL << (uint8_t)subModule); - } - else - { - mask = PWM_MASK_MASKX(0x01UL << (uint8_t)subModule); - } - - if (forcetozero) - { - /* Disables the channel output, forcing output level to 0 */ - base->MASK |= mask; - } - else - { - /* Enables the channel output */ - base->MASK &= ~mask; - } - -#if defined(PWM_MASK_UPDATE_MASK) - /* Update output mask bits immediately with UPDATE_MASK bit */ - base->MASK |= PWM_MASK_UPDATE_MASK(0x01UL << (uint8_t)subModule); -#else - /* Select local force signal */ - base->SM[subModule].CTRL2 &= ~(uint16_t)PWM_CTRL2_FORCE_SEL_MASK; - /* Issue a local Force trigger event */ - base->SM[subModule].CTRL2 |= PWM_CTRL2_FORCE_MASK; - /* Restore the source of FORCE OUTPUT signal */ - base->SM[subModule].CTRL2 = reg; -#endif -} - -/*! - * brief This function set the output state of the PWM pin as requested for the current cycle. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmChannel PWM channel to configure - * param outputstate Set pwm output state, see @ref pwm_output_state_t. - */ -void PWM_SetChannelOutput(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - pwm_output_state_t outputstate) -{ - uint16_t mask, swcout, sourceShift; - uint16_t reg = base->SM[subModule].CTRL2; - - if (kPWM_PwmA == pwmChannel) - { - mask = PWM_MASK_MASKA(0x01UL << (uint8_t)subModule); - swcout = (uint16_t)PWM_SWCOUT_SM0OUT23_MASK << ((uint8_t)subModule * 2U); - sourceShift = PWM_DTSRCSEL_SM0SEL23_SHIFT + ((uint16_t)subModule * 4U); - } - else if (kPWM_PwmB == pwmChannel) - { - mask = PWM_MASK_MASKB(0x01UL << (uint8_t)subModule); - swcout = (uint16_t)PWM_SWCOUT_SM0OUT45_MASK << ((uint8_t)subModule * 2U); - sourceShift = PWM_DTSRCSEL_SM0SEL45_SHIFT + ((uint16_t)subModule * 4U); - } - else - { - mask = PWM_MASK_MASKX(0x01UL << (uint8_t)subModule); - swcout = 0U; - sourceShift = 0U; - } - - if (kPWM_MaskState == outputstate) - { - /* Disables the channel output, forcing output level to 0 */ - base->MASK |= mask; - } - else - { - /* Enables the channel output first */ - base->MASK &= ~mask; - /* PwmX only support MASK mode */ - if (kPWM_PwmX != pwmChannel) - { - if (kPWM_HighState == outputstate) - { - base->SWCOUT |= swcout; - base->DTSRCSEL = - (base->DTSRCSEL & ~(uint16_t)(0x3UL << sourceShift)) | (uint16_t)(0x2UL << sourceShift); - } - else if (kPWM_LowState == outputstate) - { - base->SWCOUT &= ~swcout; - base->DTSRCSEL = - (base->DTSRCSEL & ~(uint16_t)(0x3UL << sourceShift)) | (uint16_t)(0x2UL << sourceShift); - } - else if (kPWM_NormalState == outputstate) - { - base->DTSRCSEL &= ~(uint16_t)(0x3UL << sourceShift); - } - else - { - base->DTSRCSEL = - (base->DTSRCSEL & ~(uint16_t)(0x3UL << sourceShift)) | (uint16_t)(0x1UL << sourceShift); - } - } - } - - /* Select local force signal */ - base->SM[subModule].CTRL2 &= ~(uint16_t)PWM_CTRL2_FORCE_SEL_MASK; - /* Issue a local Force trigger event */ - base->SM[subModule].CTRL2 |= PWM_CTRL2_FORCE_MASK; - /* Restore the source of FORCE OUTPUT signal */ - base->SM[subModule].CTRL2 = reg; -} - -#if defined(FSL_FEATURE_PWM_HAS_PHASE_DELAY) && FSL_FEATURE_PWM_HAS_PHASE_DELAY -/*! - * brief This function set the phase delay from the master sync signal of submodule 0. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmChannel PWM channel to configure - * param delayCycles Number of cycles delayed from submodule 0. - * - * return kStatus_Fail if the number of delay cycles is set larger than the period defined in submodule 0; - * kStatus_Success if set phase delay success - */ -status_t PWM_SetPhaseDelay(PWM_Type *base, pwm_channels_t pwmChannel, pwm_submodule_t subModule, uint16_t delayCycles) -{ - assert(subModule != kPWM_Module_0); - uint16_t reg = base->SM[subModule].CTRL2; - - /* Clear LDOK bit if it is set */ - if (0U != (base->MCTRL & PWM_MCTRL_LDOK(1UL << (uint8_t)subModule))) - { - base->MCTRL |= PWM_MCTRL_CLDOK(1UL << (uint8_t)subModule); - } - - if (base->SM[kPWM_Module_0].VAL1 < delayCycles) - { - return kStatus_Fail; - } - else - { - /* - * ERR051989: When the value of the phase delay register SMxPHASEDLY is reduced from a - * non-zero value to 0 and submodule x reload source is from submodule0, the submodule - * x may output an unexpected wide PWM pulse. The workaround is set SMxPHASEDLY=1, - * SMxINIT=SM0INIT-1, SMxVALy=SM0VALy-1 (x=1,2,3, y=0,1,2,3,4,5). - */ -#if defined(FSL_FEATURE_PWM_HAS_ERRATA_51989) && FSL_FEATURE_PWM_HAS_ERRATA_51989 - if (delayCycles == 0 && - ((base->SM[subModule].CTRL2 & PWM_CTRL2_RELOAD_SEL_MASK) >> PWM_CTRL2_RELOAD_SEL_SHIFT) == 1U) - { - base->SM[subModule].PHASEDLY = 1U; - base->SM[subModule].INIT = base->SM[0].INIT - 1U; - base->SM[subModule].VAL0 = base->SM[0].VAL0 - 1U; - base->SM[subModule].VAL1 = base->SM[0].VAL1 - 1U; - base->SM[subModule].VAL2 = base->SM[0].VAL2 - 1U; - base->SM[subModule].VAL3 = base->SM[0].VAL3 - 1U; - base->SM[subModule].VAL4 = base->SM[0].VAL4 - 1U; - base->SM[subModule].VAL5 = base->SM[0].VAL5 - 1U; - } - else - { - base->SM[subModule].PHASEDLY = delayCycles; - } -#else - base->SM[subModule].PHASEDLY = delayCycles; -#endif - } - - /* Select the master sync signal as the source for initialization */ - reg = (reg & ~(uint16_t)PWM_CTRL2_INIT_SEL_MASK) | PWM_CTRL2_INIT_SEL(2); - /* Set Load mode to make Buffered registers take effect immediately when LDOK bit set */ - base->SM[subModule].CTRL |= PWM_CTRL_LDMOD_MASK; - /* Set LDOK bit to load buffer registers */ - base->MCTRL |= PWM_MCTRL_LDOK(1UL << (uint8_t)subModule); - /* Restore the source of phase delay register intialization */ - base->SM[subModule].CTRL2 = reg; - return kStatus_Success; -} -#endif /* FSL_FEATURE_PWM_HAS_PHASE_DELAY */ \ No newline at end of file diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_pwm.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_pwm.h deleted file mode 100644 index 9e0b12ba654..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_pwm.h +++ /dev/null @@ -1,1372 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_PWM_H_ -#define FSL_PWM_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup pwm_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/*! @name Driver version */ -/*! @{ */ -#define FSL_PWM_DRIVER_VERSION (MAKE_VERSION(2, 8, 4)) /*!< Version 2.8.4 */ -/*! @} */ - -/*! Number of bits per submodule for software output control */ -#define PWM_SUBMODULE_SWCONTROL_WIDTH 2 -/*! Because setting the pwm duty cycle doesn't support PWMX, getting the pwm duty cycle also doesn't support PWMX. */ -#define PWM_SUBMODULE_CHANNEL 2 - -/*! @brief List of PWM submodules */ -typedef enum _pwm_submodule -{ - kPWM_Module_0 = 0U, /*!< Submodule 0 */ - kPWM_Module_1, /*!< Submodule 1 */ - kPWM_Module_2, /*!< Submodule 2 */ -#if defined(FSL_FEATURE_PWM_SUBMODULE_COUNT) && (FSL_FEATURE_PWM_SUBMODULE_COUNT > 3U) - kPWM_Module_3 /*!< Submodule 3 */ -#endif /* FSL_FEATURE_PWM_SUBMODULE_COUNT */ -} pwm_submodule_t; - -/*! @brief List of PWM channels in each module */ -typedef enum _pwm_channels -{ - kPWM_PwmB = 0U, - kPWM_PwmA, - kPWM_PwmX -} pwm_channels_t; - -/*! @brief List of PWM value registers */ -typedef enum _pwm_value_register -{ - kPWM_ValueRegister_0 = 0U, /*!< PWM Value0 register */ - kPWM_ValueRegister_1, /*!< PWM Value1 register */ - kPWM_ValueRegister_2, /*!< PWM Value2 register */ - kPWM_ValueRegister_3, /*!< PWM Value3 register */ - kPWM_ValueRegister_4, /*!< PWM Value4 register */ - kPWM_ValueRegister_5 /*!< PWM Value5 register */ -} pwm_value_register_t; - -/*! @brief List of PWM value registers mask */ -enum _pwm_value_register_mask -{ - kPWM_ValueRegisterMask_0 = (1U << 0), /*!< PWM Value0 register mask */ - kPWM_ValueRegisterMask_1 = (1U << 1), /*!< PWM Value1 register mask */ - kPWM_ValueRegisterMask_2 = (1U << 2), /*!< PWM Value2 register mask */ - kPWM_ValueRegisterMask_3 = (1U << 3), /*!< PWM Value3 register mask */ - kPWM_ValueRegisterMask_4 = (1U << 4), /*!< PWM Value4 register mask */ - kPWM_ValueRegisterMask_5 = (1U << 5) /*!< PWM Value5 register mask */ -}; - -/*! @brief PWM clock source selection.*/ -typedef enum _pwm_clock_source -{ - kPWM_BusClock = 0U, /*!< The IPBus clock is used as the clock */ - kPWM_ExternalClock, /*!< EXT_CLK is used as the clock */ - kPWM_Submodule0Clock /*!< Clock of the submodule 0 (AUX_CLK) is used as the source clock */ -} pwm_clock_source_t; - -/*! @brief PWM prescaler factor selection for clock source*/ -typedef enum _pwm_clock_prescale -{ - kPWM_Prescale_Divide_1 = 0U, /*!< PWM clock frequency = fclk/1 */ - kPWM_Prescale_Divide_2, /*!< PWM clock frequency = fclk/2 */ - kPWM_Prescale_Divide_4, /*!< PWM clock frequency = fclk/4 */ - kPWM_Prescale_Divide_8, /*!< PWM clock frequency = fclk/8 */ - kPWM_Prescale_Divide_16, /*!< PWM clock frequency = fclk/16 */ - kPWM_Prescale_Divide_32, /*!< PWM clock frequency = fclk/32 */ - kPWM_Prescale_Divide_64, /*!< PWM clock frequency = fclk/64 */ - kPWM_Prescale_Divide_128 /*!< PWM clock frequency = fclk/128 */ -} pwm_clock_prescale_t; - -/*! @brief Options that can trigger a PWM FORCE_OUT */ -typedef enum _pwm_force_output_trigger -{ - kPWM_Force_Local = 0U, /*!< The local force signal, CTRL2[FORCE], from the submodule is used to force updates */ - kPWM_Force_Master, /*!< The master force signal from submodule 0 is used to force updates */ - kPWM_Force_LocalReload, /*!< The local reload signal from this submodule is used to force updates without regard to - the state of LDOK */ - kPWM_Force_MasterReload, /*!< The master reload signal from submodule 0 is used to force updates if LDOK is set */ - kPWM_Force_LocalSync, /*!< The local sync signal from this submodule is used to force updates */ - kPWM_Force_MasterSync, /*!< The master sync signal from submodule0 is used to force updates */ - kPWM_Force_External, /*!< The external force signal, EXT_FORCE, from outside the PWM module causes updates */ - kPWM_Force_ExternalSync /*!< The external sync signal, EXT_SYNC, from outside the PWM module causes updates */ -} pwm_force_output_trigger_t; - -/*! @brief PWM channel output status */ -typedef enum _pwm_output_state -{ - kPWM_HighState = 0, /*!< The output state of PWM channel is high */ - kPWM_LowState, /*!< The output state of PWM channel is low */ - kPWM_NormalState, /*!< The output state of PWM channel is normal */ - kPWM_InvertState, /*!< The output state of PWM channel is invert */ - kPWM_MaskState /*!< The output state of PWM channel is mask */ -} pwm_output_state_t; - -/*! @brief PWM counter initialization options */ -typedef enum _pwm_init_source -{ - kPWM_Initialize_LocalSync = 0U, /*!< Local sync causes initialization */ - kPWM_Initialize_MasterReload, /*!< Master reload from submodule 0 causes initialization */ - kPWM_Initialize_MasterSync, /*!< Master sync from submodule 0 causes initialization */ - kPWM_Initialize_ExtSync /*!< EXT_SYNC causes initialization */ -} pwm_init_source_t; - -/*! @brief PWM load frequency selection */ -typedef enum _pwm_load_frequency -{ - kPWM_LoadEveryOportunity = 0U, /*!< Every PWM opportunity */ - kPWM_LoadEvery2Oportunity, /*!< Every 2 PWM opportunities */ - kPWM_LoadEvery3Oportunity, /*!< Every 3 PWM opportunities */ - kPWM_LoadEvery4Oportunity, /*!< Every 4 PWM opportunities */ - kPWM_LoadEvery5Oportunity, /*!< Every 5 PWM opportunities */ - kPWM_LoadEvery6Oportunity, /*!< Every 6 PWM opportunities */ - kPWM_LoadEvery7Oportunity, /*!< Every 7 PWM opportunities */ - kPWM_LoadEvery8Oportunity, /*!< Every 8 PWM opportunities */ - kPWM_LoadEvery9Oportunity, /*!< Every 9 PWM opportunities */ - kPWM_LoadEvery10Oportunity, /*!< Every 10 PWM opportunities */ - kPWM_LoadEvery11Oportunity, /*!< Every 11 PWM opportunities */ - kPWM_LoadEvery12Oportunity, /*!< Every 12 PWM opportunities */ - kPWM_LoadEvery13Oportunity, /*!< Every 13 PWM opportunities */ - kPWM_LoadEvery14Oportunity, /*!< Every 14 PWM opportunities */ - kPWM_LoadEvery15Oportunity, /*!< Every 15 PWM opportunities */ - kPWM_LoadEvery16Oportunity /*!< Every 16 PWM opportunities */ -} pwm_load_frequency_t; - -/*! @brief List of PWM fault selections */ -typedef enum _pwm_fault_input -{ - kPWM_Fault_0 = 0U, /*!< Fault 0 input pin */ - kPWM_Fault_1, /*!< Fault 1 input pin */ - kPWM_Fault_2, /*!< Fault 2 input pin */ - kPWM_Fault_3 /*!< Fault 3 input pin */ -} pwm_fault_input_t; - -/*! @brief List of PWM fault disable mapping selections */ -typedef enum _pwm_fault_disable -{ - kPWM_FaultDisable_0 = (1U << 0), /*!< Fault 0 disable mapping */ - kPWM_FaultDisable_1 = (1U << 1), /*!< Fault 1 disable mapping */ - kPWM_FaultDisable_2 = (1U << 2), /*!< Fault 2 disable mapping */ - kPWM_FaultDisable_3 = (1U << 3) /*!< Fault 3 disable mapping */ -} pwm_fault_disable_t; - -/*! @brief List of PWM fault channels */ -typedef enum _pwm_fault_channels -{ - kPWM_faultchannel_0 = 0U, - kPWM_faultchannel_1 -} pwm_fault_channels_t; - -/*! @brief PWM capture edge select */ -typedef enum _pwm_input_capture_edge -{ - kPWM_Disable = 0U, /*!< Disabled */ - kPWM_FallingEdge, /*!< Capture on falling edge only */ - kPWM_RisingEdge, /*!< Capture on rising edge only */ - kPWM_RiseAndFallEdge /*!< Capture on rising or falling edge */ -} pwm_input_capture_edge_t; - -/*! @brief PWM output options when a FORCE_OUT signal is asserted */ -typedef enum _pwm_force_signal -{ - kPWM_UsePwm = 0U, /*!< Generated PWM signal is used by the deadtime logic.*/ - kPWM_InvertedPwm, /*!< Inverted PWM signal is used by the deadtime logic.*/ - kPWM_SoftwareControl, /*!< Software controlled value is used by the deadtime logic. */ - kPWM_UseExternal /*!< PWM_EXTA signal is used by the deadtime logic. */ -} pwm_force_signal_t; - -/*! @brief Options available for the PWM A & B pair operation */ -typedef enum _pwm_chnl_pair_operation -{ - kPWM_Independent = 0U, /*!< PWM A & PWM B operate as 2 independent channels */ - kPWM_ComplementaryPwmA, /*!< PWM A & PWM B are complementary channels, PWM A generates the signal */ - kPWM_ComplementaryPwmB /*!< PWM A & PWM B are complementary channels, PWM B generates the signal */ -} pwm_chnl_pair_operation_t; - -/*! @brief Options available on how to load the buffered-registers with new values */ -typedef enum _pwm_register_reload -{ - kPWM_ReloadImmediate = 0U, /*!< Buffered-registers get loaded with new values as soon as LDOK bit is set */ - kPWM_ReloadPwmHalfCycle, /*!< Registers loaded on a PWM half cycle */ - kPWM_ReloadPwmFullCycle, /*!< Registers loaded on a PWM full cycle */ - kPWM_ReloadPwmHalfAndFullCycle /*!< Registers loaded on a PWM half & full cycle */ -} pwm_register_reload_t; - -/*! @brief Options available on how to re-enable the PWM output when recovering from a fault */ -typedef enum _pwm_fault_recovery_mode -{ - kPWM_NoRecovery = 0U, /*!< PWM output will stay inactive */ - kPWM_RecoverHalfCycle, /*!< PWM output re-enabled at the first half cycle */ - kPWM_RecoverFullCycle, /*!< PWM output re-enabled at the first full cycle */ - kPWM_RecoverHalfAndFullCycle /*!< PWM output re-enabled at the first half or full cycle */ -} pwm_fault_recovery_mode_t; - -/*! @brief List of PWM interrupt options */ -typedef enum _pwm_interrupt_enable -{ - kPWM_CompareVal0InterruptEnable = (1U << 0), /*!< PWM VAL0 compare interrupt */ - kPWM_CompareVal1InterruptEnable = (1U << 1), /*!< PWM VAL1 compare interrupt */ - kPWM_CompareVal2InterruptEnable = (1U << 2), /*!< PWM VAL2 compare interrupt */ - kPWM_CompareVal3InterruptEnable = (1U << 3), /*!< PWM VAL3 compare interrupt */ - kPWM_CompareVal4InterruptEnable = (1U << 4), /*!< PWM VAL4 compare interrupt */ - kPWM_CompareVal5InterruptEnable = (1U << 5), /*!< PWM VAL5 compare interrupt */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX - kPWM_CaptureX0InterruptEnable = (1U << 6), /*!< PWM capture X0 interrupt */ - kPWM_CaptureX1InterruptEnable = (1U << 7), /*!< PWM capture X1 interrupt */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB - kPWM_CaptureB0InterruptEnable = (1U << 8), /*!< PWM capture B0 interrupt */ - kPWM_CaptureB1InterruptEnable = (1U << 9), /*!< PWM capture B1 interrupt */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA - kPWM_CaptureA0InterruptEnable = (1U << 10), /*!< PWM capture A0 interrupt */ - kPWM_CaptureA1InterruptEnable = (1U << 11), /*!< PWM capture A1 interrupt */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA */ - kPWM_ReloadInterruptEnable = (1U << 12), /*!< PWM reload interrupt */ - kPWM_ReloadErrorInterruptEnable = (1U << 13), /*!< PWM reload error interrupt */ - kPWM_Fault0InterruptEnable = (1U << 16), /*!< PWM fault 0 interrupt */ - kPWM_Fault1InterruptEnable = (1U << 17), /*!< PWM fault 1 interrupt */ - kPWM_Fault2InterruptEnable = (1U << 18), /*!< PWM fault 2 interrupt */ - kPWM_Fault3InterruptEnable = (1U << 19) /*!< PWM fault 3 interrupt */ -} pwm_interrupt_enable_t; - -/*! @brief List of PWM status flags */ -typedef enum _pwm_status_flags -{ - kPWM_CompareVal0Flag = (1U << 0), /*!< PWM VAL0 compare flag */ - kPWM_CompareVal1Flag = (1U << 1), /*!< PWM VAL1 compare flag */ - kPWM_CompareVal2Flag = (1U << 2), /*!< PWM VAL2 compare flag */ - kPWM_CompareVal3Flag = (1U << 3), /*!< PWM VAL3 compare flag */ - kPWM_CompareVal4Flag = (1U << 4), /*!< PWM VAL4 compare flag */ - kPWM_CompareVal5Flag = (1U << 5), /*!< PWM VAL5 compare flag */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX - kPWM_CaptureX0Flag = (1U << 6), /*!< PWM capture X0 flag */ - kPWM_CaptureX1Flag = (1U << 7), /*!< PWM capture X1 flag */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB - kPWM_CaptureB0Flag = (1U << 8), /*!< PWM capture B0 flag */ - kPWM_CaptureB1Flag = (1U << 9), /*!< PWM capture B1 flag */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA - kPWM_CaptureA0Flag = (1U << 10), /*!< PWM capture A0 flag */ - kPWM_CaptureA1Flag = (1U << 11), /*!< PWM capture A1 flag */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA */ - kPWM_ReloadFlag = (1U << 12), /*!< PWM reload flag */ - kPWM_ReloadErrorFlag = (1U << 13), /*!< PWM reload error flag */ - kPWM_RegUpdatedFlag = (1U << 14), /*!< PWM registers updated flag */ - kPWM_Fault0Flag = (1U << 16), /*!< PWM fault 0 flag */ - kPWM_Fault1Flag = (1U << 17), /*!< PWM fault 1 flag */ - kPWM_Fault2Flag = (1U << 18), /*!< PWM fault 2 flag */ - kPWM_Fault3Flag = (1U << 19) /*!< PWM fault 3 flag */ -} pwm_status_flags_t; - -/*! @brief List of PWM DMA options */ -typedef enum _pwm_dma_enable -{ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX - kPWM_CaptureX0DMAEnable = (1U << 0), /*!< PWM capture X0 DMA */ - kPWM_CaptureX1DMAEnable = (1U << 1), /*!< PWM capture X1 DMA */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB - kPWM_CaptureB0DMAEnable = (1U << 2), /*!< PWM capture B0 DMA */ - kPWM_CaptureB1DMAEnable = (1U << 3), /*!< PWM capture B1 DMA */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA - kPWM_CaptureA0DMAEnable = (1U << 4), /*!< PWM capture A0 DMA */ - kPWM_CaptureA1DMAEnable = (1U << 5) /*!< PWM capture A1 DMA */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA */ -} pwm_dma_enable_t; - -/*! @brief List of PWM capture DMA enable source select */ -typedef enum _pwm_dma_source_select -{ - kPWM_DMARequestDisable = 0U, /*!< Read DMA requests disabled */ - kPWM_DMAWatermarksEnable, /*!< Exceeding a FIFO watermark sets the DMA read request */ - kPWM_DMALocalSync, /*!< A local sync (VAL1 matches counter) sets the read DMA request */ - kPWM_DMALocalReload /*!< A local reload (STS[RF] being set) sets the read DMA request */ -} pwm_dma_source_select_t; - -/*! @brief PWM FIFO Watermark AND Control */ -typedef enum _pwm_watermark_control -{ - kPWM_FIFOWatermarksOR = 0U, /*!< Selected FIFO watermarks are OR'ed together */ - kPWM_FIFOWatermarksAND /*!< Selected FIFO watermarks are AND'ed together */ -} pwm_watermark_control_t; - -/*! @brief PWM operation mode */ -typedef enum _pwm_mode -{ - kPWM_SignedCenterAligned = 0U, /*!< Signed center-aligned */ - kPWM_CenterAligned, /*!< Unsigned cente-aligned */ - kPWM_SignedEdgeAligned, /*!< Signed edge-aligned */ - kPWM_EdgeAligned /*!< Unsigned edge-aligned */ -} pwm_mode_t; - -/*! @brief PWM output pulse mode, high-true or low-true */ -typedef enum _pwm_level_select -{ - kPWM_HighTrue = 0U, /*!< High level represents "on" or "active" state */ - kPWM_LowTrue /*!< Low level represents "on" or "active" state */ -} pwm_level_select_t; - -/*! @brief PWM output fault status */ -typedef enum _pwm_fault_state -{ - kPWM_PwmFaultState0 = - 0U, /*!< Output is forced to logic 0 state prior to consideration of output polarity control. */ - kPWM_PwmFaultState1, /*!< Output is forced to logic 1 state prior to consideration of output polarity control. */ - kPWM_PwmFaultState2, /*!< Output is tristated. */ - kPWM_PwmFaultState3 /*!< Output is tristated. */ -} pwm_fault_state_t; - -/*! @brief PWM reload source select */ -typedef enum _pwm_reload_source_select -{ - kPWM_LocalReload = 0U, /*!< The local reload signal is used to reload registers */ - kPWM_MasterReload /*!< The master reload signal (from submodule 0) is used to reload */ -} pwm_reload_source_select_t; - -/*! @brief PWM fault clearing options */ -typedef enum _pwm_fault_clear -{ - kPWM_Automatic = 0U, /*!< Automatic fault clearing */ - kPWM_ManualNormal, /*!< Manual fault clearing with no fault safety mode */ - kPWM_ManualSafety /*!< Manual fault clearing with fault safety mode */ -} pwm_fault_clear_t; - -/*! @brief Options for submodule master control operation */ -typedef enum _pwm_module_control -{ - kPWM_Control_Module_0 = (1U << 0), /*!< Control submodule 0's start/stop,buffer reload operation */ - kPWM_Control_Module_1 = (1U << 1), /*!< Control submodule 1's start/stop,buffer reload operation */ - kPWM_Control_Module_2 = (1U << 2), /*!< Control submodule 2's start/stop,buffer reload operation */ - kPWM_Control_Module_3 = (1U << 3) /*!< Control submodule 3's start/stop,buffer reload operation */ -} pwm_module_control_t; - -/*! @brief Structure for the user to define the PWM signal characteristics */ -typedef struct _pwm_signal_param -{ - pwm_channels_t pwmChannel; /*!< PWM channel being configured; PWM A or PWM B */ - uint8_t dutyCyclePercent; /*!< PWM pulse width, value should be between 0 to 100 - 0=inactive signal(0% duty cycle)... - 100=always active signal (100% duty cycle)*/ - pwm_level_select_t level; /*!< PWM output active level select */ - uint16_t deadtimeValue; /*!< The deadtime value; only used if channel pair is operating in complementary mode */ - pwm_fault_state_t faultState; /*!< PWM output fault status */ - bool pwmchannelenable; /*!< Enable PWM output */ -} pwm_signal_param_t; - -/*! - * @brief PWM config structure - * - * This structure holds the configuration settings for the PWM peripheral. To initialize this - * structure to reasonable defaults, call the PWM_GetDefaultConfig() function and pass a - * pointer to your config structure instance. - * - * The config struct can be made const so it resides in flash - */ -typedef struct _pwm_config -{ - bool enableDebugMode; /*!< true: PWM continues to run in debug mode; - false: PWM is paused in debug mode */ -#if !defined(FSL_FEATURE_PWM_HAS_NO_WAITEN) || (!FSL_FEATURE_PWM_HAS_NO_WAITEN) - bool enableWait; /*!< true: PWM continues to run in WAIT mode; - false: PWM is paused in WAIT mode */ -#endif /* FSL_FEATURE_PWM_HAS_NO_WAITEN */ - pwm_init_source_t initializationControl; /*!< Option to initialize the counter */ - pwm_clock_source_t clockSource; /*!< Clock source for the counter */ - pwm_clock_prescale_t prescale; /*!< Pre-scaler to divide down the clock */ - pwm_chnl_pair_operation_t pairOperation; /*!< Channel pair in indepedent or complementary mode */ - pwm_register_reload_t reloadLogic; /*!< PWM Reload logic setup */ - pwm_reload_source_select_t reloadSelect; /*!< Reload source select */ - pwm_load_frequency_t reloadFrequency; /*!< Specifies when to reload, used when user's choice - is not immediate reload */ - pwm_force_output_trigger_t forceTrigger; /*!< Specify which signal will trigger a FORCE_OUT */ -} pwm_config_t; - -/*! @brief Structure for the user to configure the fault input filter. */ -typedef struct _pwm_fault_input_filter_param -{ - uint8_t faultFilterCount; /*!< Fault filter count */ - uint8_t faultFilterPeriod; /*!< Fault filter period;value of 0 will bypass the filter */ - bool faultGlitchStretch; /*!< Fault Glitch Stretch Enable: A logic 1 means that input - fault signals will be stretched to at least 2 IPBus clock cycles */ -} pwm_fault_input_filter_param_t; - -/*! @brief Structure is used to hold the parameters to configure a PWM fault */ -typedef struct _pwm_fault_param -{ - pwm_fault_clear_t faultClearingMode; /*!< Fault clearing mode to use */ - bool faultLevel; /*!< true: Logic 1 indicates fault; - false: Logic 0 indicates fault */ - bool enableCombinationalPath; /*!< true: Combinational Path from fault input is enabled; - false: No combination path is available */ - pwm_fault_recovery_mode_t recoverMode; /*!< Specify when to re-enable the PWM output */ -} pwm_fault_param_t; - -/*! - * @brief Structure is used to hold parameters to configure the capture capability of a signal pin - */ -typedef struct _pwm_input_capture_param -{ - bool captureInputSel; /*!< true: Use the edge counter signal as source - false: Use the raw input signal from the pin as source */ - uint8_t edgeCompareValue; /*!< Compare value, used only if edge counter is used as source */ - pwm_input_capture_edge_t edge0; /*!< Specify which edge causes a capture for input circuitry 0 */ - pwm_input_capture_edge_t edge1; /*!< Specify which edge causes a capture for input circuitry 1 */ - bool enableOneShotCapture; /*!< true: Use one-shot capture mode; - false: Use free-running capture mode */ - uint8_t fifoWatermark; /*!< Watermark level for capture FIFO. The capture flags in - the status register will set if the word count in the FIFO - is greater than this watermark level */ -} pwm_input_capture_param_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Ungates the PWM submodule clock and configures the peripheral for basic operation. - * - * @note This API should be called at the beginning of the application using the PWM driver. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param config Pointer to user's PWM config structure. - * - * @return kStatus_Success means success; else failed. - */ -status_t PWM_Init(PWM_Type *base, pwm_submodule_t subModule, const pwm_config_t *config); - -/*! - * @brief Gate the PWM submodule clock - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to deinitialize - */ -void PWM_Deinit(PWM_Type *base, pwm_submodule_t subModule); - -/*! - * @brief Fill in the PWM config struct with the default settings - * - * The default values are: - * @code - * config->enableDebugMode = false; - * config->enableWait = false; - * config->reloadSelect = kPWM_LocalReload; - * config->clockSource = kPWM_BusClock; - * config->prescale = kPWM_Prescale_Divide_1; - * config->initializationControl = kPWM_Initialize_LocalSync; - * config->forceTrigger = kPWM_Force_Local; - * config->reloadFrequency = kPWM_LoadEveryOportunity; - * config->reloadLogic = kPWM_ReloadImmediate; - * config->pairOperation = kPWM_Independent; - * @endcode - * @param config Pointer to user's PWM config structure. - */ -void PWM_GetDefaultConfig(pwm_config_t *config); - -/*! @}*/ - -/*! - * @name Module PWM output - * @{ - */ -/*! - * @brief Sets up the PWM signals for a PWM submodule. - * - * The function initializes the submodule according to the parameters passed in by the user. The function - * also sets up the value compare registers to match the PWM signal requirements. - * If the dead time insertion logic is enabled, the pulse period is reduced by the - * dead time period specified by the user. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param chnlParams Array of PWM channel parameters to configure the channel(s), PWMX submodule is not supported. - * @param numOfChnls Number of channels to configure, this should be the size of the array passed in. - * Array size should not be more than 2 as each submodule has 2 pins to output PWM - * @param mode PWM operation mode, options available in enumeration ::pwm_mode_t - * @param pwmFreq_Hz PWM signal frequency in Hz - * @param srcClock_Hz PWM source clock of correspond submodule in Hz. If source clock of submodule1,2,3 is from - * submodule0 AUX_CLK, its source clock is submodule0 source clock divided with submodule0 - * prescaler value instead of submodule0 source clock. - * - * @return Returns kStatus_Fail if there was error setting up the signal; kStatus_Success otherwise - */ -status_t PWM_SetupPwm(PWM_Type *base, - pwm_submodule_t subModule, - const pwm_signal_param_t *chnlParams, - uint8_t numOfChnls, - pwm_mode_t mode, - uint32_t pwmFreq_Hz, - uint32_t srcClock_Hz); - -/*! - * @brief Set PWM phase shift for PWM channel running on channel PWM_A, PWM_B which with 50% duty cycle. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel PWM channel to configure - * @param pwmFreq_Hz PWM signal frequency in Hz - * @param srcClock_Hz PWM main counter clock in Hz. - * @param shiftvalue Phase shift value, range in 0 ~ 50 - * @param doSync true: Set LDOK bit for the submodule list; - * false: LDOK bit don't set, need to call PWM_SetPwmLdok to sync update. - * - * @return Returns kStatus_Fail if there was error setting up the signal; kStatus_Success otherwise - */ -status_t PWM_SetupPwmPhaseShift(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - uint32_t pwmFreq_Hz, - uint32_t srcClock_Hz, - uint8_t shiftvalue, - bool doSync); - -/*! - * @brief Updates the PWM signal's dutycycle. - * - * The function updates the PWM dutycyle to the new value that is passed in. - * If the dead time insertion logic is enabled then the pulse period is reduced by the - * dead time period specified by the user. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmSignal Signal (PWM A or PWM B) to update - * @param currPwmMode The current PWM mode set during PWM setup - * @param dutyCyclePercent New PWM pulse width, value should be between 0 to 100 - * 0=inactive signal(0% duty cycle)... - * 100=active signal (100% duty cycle) - */ -void PWM_UpdatePwmDutycycle(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmSignal, - pwm_mode_t currPwmMode, - uint8_t dutyCyclePercent); - -/*! - * @brief Updates the PWM signal's dutycycle with 16-bit accuracy. - * - * The function updates the PWM dutycyle to the new value that is passed in. - * If the dead time insertion logic is enabled then the pulse period is reduced by the - * dead time period specified by the user. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmSignal Signal (PWM A or PWM B) to update - * @param currPwmMode The current PWM mode set during PWM setup - * @param dutyCycle New PWM pulse width, value should be between 0 to 65535 - * 0=inactive signal(0% duty cycle)... - * 65535=active signal (100% duty cycle) - */ -void PWM_UpdatePwmDutycycleHighAccuracy( - PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmSignal, pwm_mode_t currPwmMode, uint16_t dutyCycle); - -/*! - * @brief Update the PWM signal's period and dutycycle for a PWM submodule. - * - * The function updates PWM signal period generated by a specific submodule according to the parameters - * passed in by the user. This function can also set dutycycle weather you want to keep original dutycycle - * or update new dutycycle. Call this function in local sync control mode because PWM period is depended by - * INIT and VAL1 register of each submodule. In master sync initialization control mode, call this function - * to update INIT and VAL1 register of all submodule because PWM period is depended by INIT and VAL1 register - * in submodule0. If the dead time insertion logic is enabled, the pulse period is reduced by the dead time - * period specified by the user. PWM signal will not be generated if its period is less than dead time duration. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmSignal Signal (PWM A or PWM B) to update - * @param currPwmMode The current PWM mode set during PWM setup, options available in enumeration ::pwm_mode_t - * @param pulseCnt New PWM period, value should be between 0 to 65535 - * 0=minimum PWM period... - * 65535=maximum PWM period - * @param dutyCycle New PWM pulse width of channel, value should be between 0 to 65535 - * 0=inactive signal(0% duty cycle)... - * 65535=active signal (100% duty cycle) - * You can keep original duty cycle or update new duty cycle - */ -void PWM_UpdatePwmPeriodAndDutycycle(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmSignal, - pwm_mode_t currPwmMode, - uint16_t pulseCnt, - uint16_t dutyCycle); - -/*! @}*/ - -/*! - * @brief Sets up the PWM input capture - * - * Each PWM submodule has 3 pins that can be configured for use as input capture pins. This function - * sets up the capture parameters for each pin and enables the pin for input capture operation. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel Channel in the submodule to setup - * @param inputCaptureParams Parameters passed in to set up the input pin - */ -void PWM_SetupInputCapture(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - const pwm_input_capture_param_t *inputCaptureParams); - -/*! - * @brief Sets up the PWM fault input filter. - * - * @param base PWM peripheral base address - * @param faultInputFilterParams Parameters passed in to set up the fault input filter. - */ -void PWM_SetupFaultInputFilter(PWM_Type *base, const pwm_fault_input_filter_param_t *faultInputFilterParams); - -/*! - * @brief Sets up the PWM fault protection. - * - * PWM has 4 fault inputs. - * - * @param base PWM peripheral base address - * @param faultNum PWM fault to configure. - * @param faultParams Pointer to the PWM fault config structure - */ -void PWM_SetupFaults(PWM_Type *base, pwm_fault_input_t faultNum, const pwm_fault_param_t *faultParams); - -/*! - * @brief Fill in the PWM fault config struct with the default settings - * - * The default values are: - * @code - * config->faultClearingMode = kPWM_Automatic; - * config->faultLevel = false; - * config->enableCombinationalPath = true; - * config->recoverMode = kPWM_NoRecovery; - * @endcode - * @param config Pointer to user's PWM fault config structure. - */ -void PWM_FaultDefaultConfig(pwm_fault_param_t *config); - -/*! - * @brief Selects the signal to output on a PWM pin when a FORCE_OUT signal is asserted. - * - * The user specifies which channel to configure by supplying the submodule number and whether - * to modify PWM A or PWM B within that submodule. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel Channel to configure - * @param mode Signal to output when a FORCE_OUT is triggered - */ -void PWM_SetupForceSignal(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - pwm_force_signal_t mode); - -/*! - * @name Interrupts Interface - * @{ - */ - -/*! - * @brief Enables the selected PWM interrupts - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::pwm_interrupt_enable_t - */ -void PWM_EnableInterrupts(PWM_Type *base, pwm_submodule_t subModule, uint32_t mask); - -/*! - * @brief Disables the selected PWM interrupts - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::pwm_interrupt_enable_t - */ -void PWM_DisableInterrupts(PWM_Type *base, pwm_submodule_t subModule, uint32_t mask); - -/*! - * @brief Gets the enabled PWM interrupts - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * - * @return The enabled interrupts. This is the logical OR of members of the - * enumeration ::pwm_interrupt_enable_t - */ -uint32_t PWM_GetEnabledInterrupts(PWM_Type *base, pwm_submodule_t subModule); - -/*! @}*/ - -/*! - * @name DMA Interface - * @{ - */ - -/*! - * @brief Capture DMA Enable Source Select. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwm_watermark_control PWM FIFO watermark and control - */ -static inline void PWM_DMAFIFOWatermarkControl(PWM_Type *base, - pwm_submodule_t subModule, - pwm_watermark_control_t pwm_watermark_control) -{ - uint16_t reg = base->SM[subModule].DMAEN; - if (pwm_watermark_control == kPWM_FIFOWatermarksOR) - { - reg &= ~((uint16_t)PWM_DMAEN_FAND_MASK); - } - else - { - reg |= ((uint16_t)PWM_DMAEN_FAND_MASK); - } - base->SM[subModule].DMAEN = reg; -} - -/*! - * @brief Capture DMA Enable Source Select. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwm_dma_source_select PWM capture DMA enable source select - */ -static inline void PWM_DMACaptureSourceSelect(PWM_Type *base, - pwm_submodule_t subModule, - pwm_dma_source_select_t pwm_dma_source_select) -{ - uint16_t reg = base->SM[subModule].DMAEN; - - reg &= ~((uint16_t)PWM_DMAEN_CAPTDE_MASK); - reg |= (((uint16_t)pwm_dma_source_select << (uint16_t)PWM_DMAEN_CAPTDE_SHIFT) & (uint16_t)PWM_DMAEN_CAPTDE_MASK); - - base->SM[subModule].DMAEN = reg; -} - -/*! - * @brief Enables or disables the selected PWM DMA Capture read request. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param mask The DMA to enable or disable. This is a logical OR of members of the - * enumeration ::pwm_dma_enable_t - * @param activate true: Enable DMA read request; false: Disable DMA read request - */ -static inline void PWM_EnableDMACapture(PWM_Type *base, pwm_submodule_t subModule, uint16_t mask, bool activate) -{ - uint16_t reg = base->SM[subModule].DMAEN; - if (activate) - { - reg |= (uint16_t)(mask); - } - else - { - reg &= ~((uint16_t)(mask)); - } - base->SM[subModule].DMAEN = reg; -} - -/*! - * @brief Enables or disables the PWM DMA write request. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param activate true: Enable DMA write request; false: Disable DMA write request - */ -static inline void PWM_EnableDMAWrite(PWM_Type *base, pwm_submodule_t subModule, bool activate) -{ - uint16_t reg = base->SM[subModule].DMAEN; - if (activate) - { - reg |= ((uint16_t)PWM_DMAEN_VALDE_MASK); - } - else - { - reg &= ~((uint16_t)PWM_DMAEN_VALDE_MASK); - } - base->SM[subModule].DMAEN = reg; -} - -/*! @}*/ - -/*! - * @name Status Interface - * @{ - */ - -/*! - * @brief Gets the PWM status flags - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * - * @return The status flags. This is the logical OR of members of the - * enumeration ::pwm_status_flags_t - */ -uint32_t PWM_GetStatusFlags(PWM_Type *base, pwm_submodule_t subModule); - -/*! - * @brief Clears the PWM status flags - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::pwm_status_flags_t - */ -void PWM_ClearStatusFlags(PWM_Type *base, pwm_submodule_t subModule, uint32_t mask); - -/*! @}*/ - -/*! - * @name Timer Start and Stop - * @{ - */ - -/*! - * @brief Starts the PWM counter for a single or multiple submodules. - * - * Sets the Run bit which enables the clocks to the PWM submodule. This function can start multiple - * submodules at the same time. - * - * @param base PWM peripheral base address - * @param subModulesToStart PWM submodules to start. This is a logical OR of members of the - * enumeration ::pwm_module_control_t - */ -static inline void PWM_StartTimer(PWM_Type *base, uint8_t subModulesToStart) -{ - base->MCTRL |= PWM_MCTRL_RUN(subModulesToStart); -} - -/*! - * @brief Stops the PWM counter for a single or multiple submodules. - * - * Clears the Run bit which resets the submodule's counter. This function can stop multiple - * submodules at the same time. - * - * @param base PWM peripheral base address - * @param subModulesToStop PWM submodules to stop. This is a logical OR of members of the - * enumeration ::pwm_module_control_t - */ -static inline void PWM_StopTimer(PWM_Type *base, uint8_t subModulesToStop) -{ - base->MCTRL &= ~(PWM_MCTRL_RUN(subModulesToStop)); -} - -/*! @}*/ - -/*! - * @brief Set the PWM VALx registers. - * - * This function allows the user to write value into VAL registers directly. And it will destroying the PWM clock period - * set by the PWM_SetupPwm()/PWM_SetupPwmPhaseShift() functions. - * Due to VALx registers are bufferd, the new value will not active uless call PWM_SetPwmLdok() and the reload point is - * reached. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param valueRegister VALx register that will be writen new value - * @param value Value that will been write into VALx register - */ -static inline void PWM_SetVALxValue(PWM_Type *base, - pwm_submodule_t subModule, - pwm_value_register_t valueRegister, - uint16_t value) -{ - switch (valueRegister) - { - case kPWM_ValueRegister_0: - base->SM[subModule].VAL0 = value; - break; - case kPWM_ValueRegister_1: - base->SM[subModule].VAL1 = value; - break; - case kPWM_ValueRegister_2: - base->SM[subModule].VAL2 = value; - break; - case kPWM_ValueRegister_3: - base->SM[subModule].VAL3 = value; - break; - case kPWM_ValueRegister_4: - base->SM[subModule].VAL4 = value; - break; - case kPWM_ValueRegister_5: - base->SM[subModule].VAL5 = value; - break; - default: - assert(false); - break; - } -} - -/*! - * @brief Get the PWM VALx registers. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param valueRegister VALx register that will be read value - * @return The VALx register value - */ -static inline uint16_t PWM_GetVALxValue(PWM_Type *base, pwm_submodule_t subModule, pwm_value_register_t valueRegister) -{ - uint16_t temp = 0U; - - switch (valueRegister) - { - case kPWM_ValueRegister_0: - temp = base->SM[subModule].VAL0; - break; - case kPWM_ValueRegister_1: - temp = base->SM[subModule].VAL1; - break; - case kPWM_ValueRegister_2: - temp = base->SM[subModule].VAL2; - break; - case kPWM_ValueRegister_3: - temp = base->SM[subModule].VAL3; - break; - case kPWM_ValueRegister_4: - temp = base->SM[subModule].VAL4; - break; - case kPWM_ValueRegister_5: - temp = base->SM[subModule].VAL5; - break; - default: - assert(false); - break; - } - - return temp; -} - -/*! - * @brief Enables or disables the PWM output trigger. - * - * This function allows the user to enable or disable the PWM trigger. The PWM has 2 triggers. Trigger 0 - * is activated when the counter matches VAL 0, VAL 2, or VAL 4 register. Trigger 1 is activated - * when the counter matches VAL 1, VAL 3, or VAL 5 register. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param valueRegister Value register that will activate the trigger - * @param activate true: Enable the trigger; false: Disable the trigger - */ -static inline void PWM_OutputTriggerEnable(PWM_Type *base, - pwm_submodule_t subModule, - pwm_value_register_t valueRegister, - bool activate) -{ - if (activate) - { - base->SM[subModule].TCTRL |= ((uint16_t)1U << (uint16_t)valueRegister); - } - else - { - base->SM[subModule].TCTRL &= ~((uint16_t)1U << (uint16_t)valueRegister); - } -} - -/*! - * @brief Enables the PWM output trigger. - * - * This function allows the user to enable one or more (VAL0-5) PWM trigger. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param valueRegisterMask Value register mask that will activate one or more (VAL0-5) trigger - * enumeration ::_pwm_value_register_mask - */ -static inline void PWM_ActivateOutputTrigger(PWM_Type *base, pwm_submodule_t subModule, uint16_t valueRegisterMask) -{ - base->SM[subModule].TCTRL |= (PWM_TCTRL_OUT_TRIG_EN_MASK & (valueRegisterMask)); -} - -/*! - * @brief Disables the PWM output trigger. - * - * This function allows the user to disables one or more (VAL0-5) PWM trigger. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param valueRegisterMask Value register mask that will Deactivate one or more (VAL0-5) trigger - * enumeration ::_pwm_value_register_mask - */ -static inline void PWM_DeactivateOutputTrigger(PWM_Type *base, pwm_submodule_t subModule, uint16_t valueRegisterMask) -{ - base->SM[subModule].TCTRL &= ~(PWM_TCTRL_OUT_TRIG_EN_MASK & (valueRegisterMask)); -} - -/*! - * @brief Sets the software control output for a pin to high or low. - * - * The user specifies which channel to modify by supplying the submodule number and whether - * to modify PWM A or PWM B within that submodule. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel Channel to configure - * @param value true: Supply a logic 1, false: Supply a logic 0. - */ -static inline void PWM_SetupSwCtrlOut(PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmChannel, bool value) -{ - if (value) - { - base->SWCOUT |= - ((uint16_t)1U << (((uint16_t)subModule * (uint16_t)PWM_SUBMODULE_SWCONTROL_WIDTH) + (uint16_t)pwmChannel)); - } - else - { - base->SWCOUT &= - ~((uint16_t)1U << (((uint16_t)subModule * (uint16_t)PWM_SUBMODULE_SWCONTROL_WIDTH) + (uint16_t)pwmChannel)); - } -} - -/*! - * @brief Sets or clears the PWM LDOK bit on a single or multiple submodules - * - * Set LDOK bit to load buffered values into CTRL[PRSC] and the INIT, FRACVAL and VAL registers. The - * values are loaded immediately if kPWM_ReloadImmediate option was choosen during config. Else the - * values are loaded at the next PWM reload point. - * This function can issue the load command to multiple submodules at the same time. - * - * @param base PWM peripheral base address - * @param subModulesToUpdate PWM submodules to update with buffered values. This is a logical OR of - * members of the enumeration ::pwm_module_control_t - * @param value true: Set LDOK bit for the submodule list; false: Clear LDOK bit - */ -static inline void PWM_SetPwmLdok(PWM_Type *base, uint8_t subModulesToUpdate, bool value) -{ - if (value) - { - base->MCTRL |= PWM_MCTRL_LDOK(subModulesToUpdate); - } - else - { - base->MCTRL |= PWM_MCTRL_CLDOK(subModulesToUpdate); - } -} - -/*! - * @brief Set PWM output fault status - * - * These bits determine the fault state for the PWM_A output in fault conditions - * and STOP mode. It may also define the output state in WAIT and DEBUG modes - * depending on the settings of CTRL2[WAITEN] and CTRL2[DBGEN]. - * This function can update PWM output fault status. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel Channel to configure - * @param faultState PWM output fault status - */ -static inline void PWM_SetPwmFaultState(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - pwm_fault_state_t faultState) -{ - uint16_t reg = base->SM[subModule].OCTRL; - switch (pwmChannel) - { - case kPWM_PwmA: - reg &= ~((uint16_t)PWM_OCTRL_PWMAFS_MASK); - reg |= (((uint16_t)faultState << (uint16_t)PWM_OCTRL_PWMAFS_SHIFT) & (uint16_t)PWM_OCTRL_PWMAFS_MASK); - break; - case kPWM_PwmB: - reg &= ~((uint16_t)PWM_OCTRL_PWMBFS_MASK); - reg |= (((uint16_t)faultState << (uint16_t)PWM_OCTRL_PWMBFS_SHIFT) & (uint16_t)PWM_OCTRL_PWMBFS_MASK); - break; - case kPWM_PwmX: - reg &= ~((uint16_t)PWM_OCTRL_PWMXFS_MASK); - reg |= (((uint16_t)faultState << (uint16_t)PWM_OCTRL_PWMXFS_SHIFT) & (uint16_t)PWM_OCTRL_PWMXFS_MASK); - break; - default: - assert(false); - break; - } - base->SM[subModule].OCTRL = reg; -} - -/*! - * @brief Set PWM fault disable mapping - * - * Each of the four bits of this read/write field is one-to-one associated - * with the four FAULTx inputs of fault channel 0/1. The PWM output will be turned - * off if there is a logic 1 on an FAULTx input and a 1 in the corresponding - * bit of this field. A reset sets all bits in this field. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel PWM channel to configure - * @param pwm_fault_channels PWM fault channel to configure - * @param value Fault disable mapping mask value - * enumeration ::pwm_fault_disable_t - */ -static inline void PWM_SetupFaultDisableMap(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - pwm_fault_channels_t pwm_fault_channels, - uint16_t value) -{ - uint16_t reg = base->SM[subModule].DISMAP[pwm_fault_channels]; - switch (pwmChannel) - { - case kPWM_PwmA: - reg &= ~((uint16_t)PWM_DISMAP_DIS0A_MASK); - reg |= (((uint16_t)(value) << (uint16_t)PWM_DISMAP_DIS0A_SHIFT) & (uint16_t)PWM_DISMAP_DIS0A_MASK); - break; - case kPWM_PwmB: - reg &= ~((uint16_t)PWM_DISMAP_DIS0B_MASK); - reg |= (((uint16_t)(value) << (uint16_t)PWM_DISMAP_DIS0B_SHIFT) & (uint16_t)PWM_DISMAP_DIS0B_MASK); - break; - case kPWM_PwmX: - reg &= ~((uint16_t)PWM_DISMAP_DIS0X_MASK); - reg |= (((uint16_t)(value) << (uint16_t)PWM_DISMAP_DIS0X_SHIFT) & (uint16_t)PWM_DISMAP_DIS0X_MASK); - break; - default: - assert(false); - break; - } - base->SM[subModule].DISMAP[pwm_fault_channels] = reg; -} - -/*! - * @brief Set PWM output enable - * - * This feature allows the user to enable the PWM Output. - * - * @param base PWM peripheral base address - * @param pwmChannel PWM channel to configure - * @param subModule PWM submodule to configure - */ -static inline void PWM_OutputEnable(PWM_Type *base, pwm_channels_t pwmChannel, pwm_submodule_t subModule) -{ - /* Set PWM output */ - switch (pwmChannel) - { - case kPWM_PwmA: - base->OUTEN |= ((uint16_t)1U << ((uint16_t)PWM_OUTEN_PWMA_EN_SHIFT + (uint16_t)subModule)); - break; - case kPWM_PwmB: - base->OUTEN |= ((uint16_t)1U << ((uint16_t)PWM_OUTEN_PWMB_EN_SHIFT + (uint16_t)subModule)); - break; - case kPWM_PwmX: - base->OUTEN |= ((uint16_t)1U << ((uint16_t)PWM_OUTEN_PWMX_EN_SHIFT + (uint16_t)subModule)); - break; - default: - assert(false); - break; - } -} - -/*! - * @brief Set PWM output disable - * - *This feature allows the user to disable the PWM output. - * - * @param base PWM peripheral base address - * @param pwmChannel PWM channel to configure - * @param subModule PWM submodule to configure - */ -static inline void PWM_OutputDisable(PWM_Type *base, pwm_channels_t pwmChannel, pwm_submodule_t subModule) -{ - switch (pwmChannel) - { - case kPWM_PwmA: - base->OUTEN &= ~((uint16_t)1U << ((uint16_t)PWM_OUTEN_PWMA_EN_SHIFT + (uint16_t)subModule)); - break; - case kPWM_PwmB: - base->OUTEN &= ~((uint16_t)1U << ((uint16_t)PWM_OUTEN_PWMB_EN_SHIFT + (uint16_t)subModule)); - break; - case kPWM_PwmX: - base->OUTEN &= ~((uint16_t)1U << ((uint16_t)PWM_OUTEN_PWMX_EN_SHIFT + (uint16_t)subModule)); - break; - default: - assert(false); - break; - } -} - -/*! - * @brief Get the dutycycle value. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel PWM channel to configure - * - * @return Current channel dutycycle value. - */ -uint8_t PWM_GetPwmChannelState(PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmChannel); - -/*! - * @brief Set PWM output in idle status (high or low). - * - * @note This API should call after PWM_SetupPwm() APIs, and PWMX submodule is not supported. - * - * @param base PWM peripheral base address - * @param pwmChannel PWM channel to configure - * @param subModule PWM submodule to configure - * @param idleStatus True: PWM output is high in idle status; false: PWM output is low in idle status. - * - * @return kStatus_Fail if there was error setting up the signal; kStatus_Success if set output idle success - */ -status_t PWM_SetOutputToIdle(PWM_Type *base, pwm_channels_t pwmChannel, pwm_submodule_t subModule, bool idleStatus); - -/*! - * @brief Set the pwm submodule prescaler. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param prescaler Set prescaler value - */ -void PWM_SetClockMode(PWM_Type *base, pwm_submodule_t subModule, pwm_clock_prescale_t prescaler); - -/*! - * @brief This function enables-disables the forcing of the output of a given eFlexPwm channel to logic 0. - * - * @param base PWM peripheral base address - * @param pwmChannel PWM channel to configure - * @param subModule PWM submodule to configure - * @param forcetozero True: Enable the pwm force output to zero; False: Disable the pwm output resumes normal - * function. - */ -void PWM_SetPwmForceOutputToZero(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - bool forcetozero); - -/*! - * @brief This function set the output state of the PWM pin as requested for the current cycle. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel PWM channel to configure - * @param outputstate Set pwm output state, see @ref pwm_output_state_t. - */ -void PWM_SetChannelOutput(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - pwm_output_state_t outputstate); - -#if defined(FSL_FEATURE_PWM_HAS_PHASE_DELAY) && FSL_FEATURE_PWM_HAS_PHASE_DELAY -/*! - * @brief This function set the phase delay from the master sync signal of submodule 0. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel PWM channel to configure - * @param delayCycles Number of cycles delayed from submodule 0. - * - * @return kStatus_Fail if the number of delay cycles is set larger than the period defined in submodule 0; - * kStatus_Success if set phase delay success - */ -status_t PWM_SetPhaseDelay(PWM_Type *base, pwm_channels_t pwmChannel, pwm_submodule_t subModule, uint16_t delayCycles); -#endif - -#if defined(FSL_FEATURE_PWM_HAS_INPUT_FILTER_CAPTURE) && FSL_FEATURE_PWM_HAS_INPUT_FILTER_CAPTURE -/*! - * @brief This function set the number of consecutive samples that must agree prior to the input filter. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel PWM channel to configure - * @param filterSampleCount Number of consecutive samples. - */ -static inline void PWM_SetFilterSampleCount(PWM_Type *base, - pwm_channels_t pwmChannel, - pwm_submodule_t subModule, - uint8_t filterSampleCount) -{ - switch(pwmChannel) - { -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA - case kPWM_PwmA: - base->SM[subModule].CAPTFILTA &= ~((uint16_t)PWM_CAPTFILTA_CAPTA_FILT_CNT_MASK); - base->SM[subModule].CAPTFILTA |= PWM_CAPTFILTA_CAPTA_FILT_CNT(filterSampleCount); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB - case kPWM_PwmB: - base->SM[subModule].CAPTFILTB &= ~((uint16_t)PWM_CAPTFILTB_CAPTB_FILT_CNT_MASK); - base->SM[subModule].CAPTFILTB |= PWM_CAPTFILTB_CAPTB_FILT_CNT(filterSampleCount); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX - case kPWM_PwmX: - base->SM[subModule].CAPTFILTX &= ~((uint16_t)PWM_CAPTFILTX_CAPTX_FILT_CNT_MASK); - base->SM[subModule].CAPTFILTX |= PWM_CAPTFILTX_CAPTX_FILT_CNT(filterSampleCount); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX */ - default: - assert(false); - break; - } -} - -/*! - * @brief This function set the sampling period of the fault pin input filter. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel PWM channel to configure - * @param filterSamplePeriod Sampling period of input filter. - */ -static inline void PWM_SetFilterSamplePeriod(PWM_Type *base, - pwm_channels_t pwmChannel, - pwm_submodule_t subModule, - uint8_t filterSamplePeriod) -{ - switch(pwmChannel) - { -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA - case kPWM_PwmA: - base->SM[subModule].CAPTFILTA &= ~((uint16_t)PWM_CAPTFILTA_CAPTA_FILT_PER_MASK); - base->SM[subModule].CAPTFILTA |= PWM_CAPTFILTA_CAPTA_FILT_PER(filterSamplePeriod); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB - case kPWM_PwmB: - base->SM[subModule].CAPTFILTB &= ~((uint16_t)PWM_CAPTFILTB_CAPTB_FILT_PER_MASK); - base->SM[subModule].CAPTFILTB |= PWM_CAPTFILTB_CAPTB_FILT_PER(filterSamplePeriod); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX - case kPWM_PwmX: - base->SM[subModule].CAPTFILTX &= ~((uint16_t)PWM_CAPTFILTX_CAPTX_FILT_PER_MASK); - base->SM[subModule].CAPTFILTX |= PWM_CAPTFILTX_CAPTX_FILT_PER(filterSamplePeriod); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX */ - default: - assert(false); - break; - } -} -#endif - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_PWM_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_reset.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_reset.c deleted file mode 100644 index 79475ac0d07..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_reset.c +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright 2023, NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_common.h" -#include "fsl_reset.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.reset" -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#define GET_REG_INDEX(x) ((uint32_t)(((uint32_t)(x)&0xFF00U) >> 8)) -#define GET_BIT_INDEX(x) ((uint32_t)((uint32_t)(x)&0x00FFU)) - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Assert reset to peripheral. - * - * Asserts reset signal to specified peripheral module. - * - * param peripheral Assert reset to this peripheral. The enum argument contains encoding of reset register - * and reset bit position in the reset register. - */ -void RESET_SetPeripheralReset(reset_ip_name_t peripheral) -{ - uint32_t regIndex = GET_REG_INDEX(peripheral); - uint32_t bitPos = GET_BIT_INDEX(peripheral); - uint32_t bitMask = 1UL << bitPos; - volatile uint32_t *pResetCtrl = &(MRCC0->MRCC_GLB_RST0); - - if (peripheral == NotAvail_RSTn) - { - return; - } - - assert(bitPos < 32u); - assert(regIndex < 2u); - - /* Unlock clock configuration */ - SYSCON->CLKUNLOCK &= ~SYSCON_CLKUNLOCK_UNLOCK_MASK; - - /* reset register is in MRCC */ - /* set bit */ - if (regIndex == 0U) - { - MRCC0->MRCC_GLB_RST0_SET = bitMask; - pResetCtrl = &(MRCC0->MRCC_GLB_RST0); - } - else if (regIndex == 1U) - { - MRCC0->MRCC_GLB_RST1_SET = bitMask; - pResetCtrl = &(MRCC0->MRCC_GLB_RST1); - } - else - { - /* Added comments to prevent the violation of MISRA C-2012 rule 15.7 */ - } - /* wait until it reads 0b1 */ - while (0u == ((*pResetCtrl) & bitMask)) - { - } - - /* Freeze clock configuration */ - SYSCON->CLKUNLOCK |= SYSCON_CLKUNLOCK_UNLOCK_MASK; -} - -/*! - * brief Clear reset to peripheral. - * - * Clears reset signal to specified peripheral module, allows it to operate. - * - * param peripheral Clear reset to this peripheral. The enum argument contains encoding of reset register - * and reset bit position in the reset register. - */ -void RESET_ClearPeripheralReset(reset_ip_name_t peripheral) -{ - uint32_t regIndex = GET_REG_INDEX(peripheral); - uint32_t bitPos = GET_BIT_INDEX(peripheral); - uint32_t bitMask = 1UL << bitPos; - volatile uint32_t *pResetCtrl = &(MRCC0->MRCC_GLB_RST0); - - assert(bitPos < 32u); - - /* Unlock clock configuration */ - SYSCON->CLKUNLOCK &= ~SYSCON_CLKUNLOCK_UNLOCK_MASK; - - /* reset register is in MRCC */ - /* clear bit */ - if (regIndex == 0U) - { - MRCC0->MRCC_GLB_RST0_CLR = bitMask; - pResetCtrl = &(MRCC0->MRCC_GLB_RST0); - } - else if (regIndex == 1U) - { - MRCC0->MRCC_GLB_RST1_CLR = bitMask; - pResetCtrl = &(MRCC0->MRCC_GLB_RST1); - } - else - { - /* Added comments to prevent the violation of MISRA C-2012 rule 15.7 */ - } - /* wait until it reads 0b0 */ - while (bitMask == ((*pResetCtrl) & bitMask)) - { - } - - /* Freeze clock configuration */ - SYSCON->CLKUNLOCK |= SYSCON_CLKUNLOCK_UNLOCK_MASK; -} - -/*! - * brief Reset peripheral module. - * - * Reset peripheral module. - * - * param peripheral Peripheral to reset. The enum argument contains encoding of reset register - * and reset bit position in the reset register. - */ -void RESET_PeripheralReset(reset_ip_name_t peripheral) -{ - RESET_ClearPeripheralReset(peripheral); - RESET_SetPeripheralReset(peripheral); -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_reset.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_reset.h deleted file mode 100644 index f14eb186f34..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_reset.h +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright 2023, NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _FSL_RESET_H_ -#define _FSL_RESET_H_ - -#include -#include -#include -#include -#include "fsl_device_registers.h" - -/*! - * @addtogroup reset - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief reset driver version 2.4.0 */ -#define FSL_RESET_DRIVER_VERSION (MAKE_VERSION(2, 4, 0)) -/*@}*/ - -/*! - * @brief Enumeration for peripheral reset control bits - * - * Defines the enumeration for peripheral reset control bits in PRESETCTRL/ASYNCPRESETCTRL registers - */ -typedef enum _SYSCON_RSTn -{ - kINPUTMUX0_RST_SHIFT_RSTn = (0U | (0U)), /*!< INPUTMUX0 reset control */ - kI3C0_RST_SHIFT_RSTn = (0U | (1U)), /*!< I3C0 reset control */ - kCTIMER0_RST_SHIFT_RSTn = (0U | (2U)), /*!< CTIMER0 reset control */ - kCTIMER1_RST_SHIFT_RSTn = (0U | (3U)), /*!< CTIMER1 reset control */ - kCTIMER2_RST_SHIFT_RSTn = (0U | (4U)), /*!< CTIMER2 reset control */ - kFREQME_RST_SHIFT_RSTn = (0U | (5U)), /*!< FREQME reset control */ - kUTICK0_RST_SHIFT_RSTn = (0U | (6U)), /*!< UTICK0 reset control */ - kDMA_RST_SHIFT_RSTn = (0U | (8U)), /*!< DMA reset control */ - kAOI0_RST_SHIFT_RSTn = (0U | (9U)), /*!< AOI0 reset control */ - kCRC_RST_SHIFT_RSTn = (0U | (10U)), /*!< CRC reset control */ - kEIM_RST_SHIFT_RSTn = (0U | (11U)), /*!< EIM reset control */ - kERM_RST_SHIFT_RSTn = (0U | (12U)), /*!< ERM reset control */ - kLPI2C0_RST_SHIFT_RSTn = (0U | (16U)), /*!< LPI2C0 reset control */ - kLPSPI0_RST_SHIFT_RSTn = (0U | (17U)), /*!< LPSPI0 reset control */ - kLPSPI1_RST_SHIFT_RSTn = (0U | (18U)), /*!< LPSPI1 reset control */ - kLPUART0_RST_SHIFT_RSTn = (0U | (19U)), /*!< LPUART0 reset control */ - kLPUART1_RST_SHIFT_RSTn = (0U | (20U)), /*!< LPUART1 reset control */ - kLPUART2_RST_SHIFT_RSTn = (0U | (21U)), /*!< LPUART2 reset control */ - kUSB0_RST_SHIFT_RSTn = (0U | (22U)), /*!< USB0 reset control */ - kQDC0_RST_SHIFT_RSTn = (0U | (23U)), /*!< QDC0 reset control */ - kFLEXPWM0_RST_SHIFT_RSTn = (0U | (24U)), /*!< FLEXPWM0 reset control */ - kOSTIMER0_RST_SHIFT_RSTn = (0U | (25U)), /*!< OSTIMER0 reset control */ - kADC0_RST_SHIFT_RSTn = (0U | (26U)), /*!< ADC0 reset control */ - kCMP1_RST_SHIFT_RSTn = (0U | (28U)), /*!< CMP1 reset control */ - kPORT0_RST_SHIFT_RSTn = (0U | (29U)), /*!< PORT0 reset control */ - kPORT1_RST_SHIFT_RSTn = (0U | (30U)), /*!< PORT1 reset control */ - kPORT2_RST_SHIFT_RSTn = (0U | (31U)), /*!< PORT2 reset control */ - kPORT3_RST_SHIFT_RSTn = ((1U << 8U) | (0U)), /*!< PORT3 reset control */ - kATX0_RST_SHIFT_RSTn = ((1U << 8U) | (1U)), /*!< ATX0 reset control */ - kGPIO0_RST_SHIFT_RSTn = ((1U << 8U) | (5U)), /*!< GPIO0 reset control */ - kGPIO1_RST_SHIFT_RSTn = ((1U << 8U) | (6U)), /*!< GPIO1 reset control */ - kGPIO2_RST_SHIFT_RSTn = ((1U << 8U) | (7U)), /*!< GPIO2 reset control */ - kGPIO3_RST_SHIFT_RSTn = ((1U << 8U) | (8U)), /*!< GPIO3 reset control */ - NotAvail_RSTn = (0xFFFFU), /*!< No reset control */ -} SYSCON_RSTn_t; - -/** Array initializers with peripheral reset bits **/ -#define AOI_RSTS \ - { \ - kAOI0_RST_SHIFT_RSTn \ - } /* Reset bits for ADC peripheral */ -#define ADC_RSTS \ - { \ - kADC0_RST_SHIFT_RSTn \ - } /* Reset bits for ADC peripheral */ -#define CRC_RSTS \ - { \ - kCRC_RST_SHIFT_RSTn \ - } /* Reset bits for CRC peripheral */ -#define CTIMER_RSTS \ - { \ - kCTIMER0_RST_SHIFT_RSTn, kCTIMER1_RST_SHIFT_RSTn, kCTIMER2_RST_SHIFT_RSTn \ - } /* Reset bits for CTIMER peripheral */ -#define DMA_RSTS_N \ - { \ - kDMA_RST_SHIFT_RSTn \ - } /* Reset bits for DMA peripheral */ -#define FLEXPWM_RSTS_N \ - { \ - kFLEXPWM0_RST_SHIFT_RSTn \ - } /* Reset bits for FLEXPWM peripheral */ -#define FREQME_RSTS_N \ - { \ - kFREQME_RST_SHIFT_RSTn \ - } /* Reset bits for FREQME peripheral */ -#define GPIO_RSTS_N \ - { \ - kGPIO0_RST_SHIFT_RSTn, kGPIO1_RST_SHIFT_RSTn, kGPIO2_RST_SHIFT_RSTn, kGPIO3_RST_SHIFT_RSTn \ - } /* Reset bits for GPIO peripheral */ -#define I3C_RSTS \ - { \ - kI3C0_RST_SHIFT_RSTn \ - } /* Reset bits for I3C peripheral */ -#define INPUTMUX_RSTS \ - { \ - kINPUTMUX0_RST_SHIFT_RSTn \ - } /* Reset bits for INPUTMUX peripheral */ -#define LPUART_RSTS \ - { \ - kLPUART0_RST_SHIFT_RSTn, kLPUART1_RST_SHIFT_RSTn, kLPUART2_RST_SHIFT_RSTn \ - } /* Reset bits for LPUART peripheral */ -#define LPSPI_RSTS \ - { \ - kLPSPI0_RST_SHIFT_RSTn, kLPSPI1_RST_SHIFT_RSTn \ - } /* Reset bits for LPSPI peripheral */ -#define LPI2C_RSTS \ - { \ - kLPI2C0_RST_SHIFT_RSTn \ - } /* Reset bits for LPI2C peripheral */ -#define LPCMP_RSTS \ - { \ - NotAvail_RSTn, kCMP1_RST_SHIFT_RSTn \ - } /* Reset bits for LPCMP peripheral */ -#define OSTIMER_RSTS \ - { \ - kOSTIMER0_RST_SHIFT_RSTn \ - } /* Reset bits for OSTIMER peripheral */ -#define PORT_RSTS_N \ - { \ - kPORT0_RST_SHIFT_RSTn, kPORT1_RST_SHIFT_RSTn, kPORT2_RST_SHIFT_RSTn, kPORT3_RST_SHIFT_RSTn \ - } /* Reset bits for PORT peripheral */ -#define EQDC_RSTS \ - { \ - kQDC0_RST_SHIFT_RSTn \ - } /* Reset bits for EQDC peripheral */ -#define UTICK_RSTS \ - { \ - kUTICK0_RST_SHIFT_RSTn \ - } /* Reset bits for UTICK peripheral */ - -typedef SYSCON_RSTn_t reset_ip_name_t; - -/******************************************************************************* - * API - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @brief Assert reset to peripheral. - * - * Asserts reset signal to specified peripheral module. - * - * @param peripheral Assert reset to this peripheral. The enum argument contains encoding of reset register - * and reset bit position in the reset register. - */ -void RESET_SetPeripheralReset(reset_ip_name_t peripheral); - -/*! - * @brief Clear reset to peripheral. - * - * Clears reset signal to specified peripheral module, allows it to operate. - * - * @param peripheral Clear reset to this peripheral. The enum argument contains encoding of reset register - * and reset bit position in the reset register. - */ -void RESET_ClearPeripheralReset(reset_ip_name_t peripheral); - -/*! - * @brief Reset peripheral module. - * - * Reset peripheral module. - * - * @param peripheral Peripheral to reset. The enum argument contains encoding of reset register - * and reset bit position in the reset register. - */ -void RESET_PeripheralReset(reset_ip_name_t peripheral); - -/*! - * @brief Release peripheral module. - * - * Release peripheral module. - * - * @param peripheral Peripheral to release. The enum argument contains encoding of reset register - * and reset bit position in the reset register. - */ -static inline void RESET_ReleasePeripheralReset(reset_ip_name_t peripheral) -{ - RESET_SetPeripheralReset(peripheral); -} - -#if defined(__cplusplus) -} -#endif - -/*! @} */ - -#endif /* _FSL_RESET_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_romapi.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_romapi.h deleted file mode 100644 index 91f4bfb1452..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_romapi.h +++ /dev/null @@ -1,507 +0,0 @@ -/* - * Copyright 2023, NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _FSL_ROMAPI_H_ -#define _FSL_ROMAPI_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup romapi - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.romapi" -#endif - -/*! @name Driver version */ -/*@{*/ - -/*! @brief romapi driver version 2.0.0. */ -#define FSL_ROMAPI_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) -/*@}*/ - -/*! - * @name Flash status - * @{ - */ -/*! @brief Flash driver status group. */ -#if defined(kStatusGroup_FlashDriver) -#define kStatusGroupGeneric kStatusGroup_Generic -#define kStatusGroupFlashDriver kStatusGroup_FlashDriver -#elif defined(kStatusGroup_FLASHIAP) -#define kStatusGroupGeneric kStatusGroup_Generic -#define kStatusGroupFlashDriver kStatusGroup_FLASH -#else -#define kStatusGroupGeneric 0 -#define kStatusGroupFlashDriver 1 -#endif - -/*! @brief Constructs a status code value from a group and a code number. */ -#if !defined(MAKE_STATUS) -#define MAKE_STATUS(group, code) ((((group) * 100) + (code))) -#endif - -/*! - * @brief Flash driver status codes. - */ -enum -{ - kStatus_FLASH_Success = MAKE_STATUS(kStatusGroupGeneric, 0), /*!< API is executed successfully*/ - kStatus_FLASH_InvalidArgument = MAKE_STATUS(kStatusGroupGeneric, 4), /*!< Invalid argument*/ - kStatus_FLASH_SizeError = MAKE_STATUS(kStatusGroupFlashDriver, 0), /*!< Error size*/ - kStatus_FLASH_AlignmentError = - MAKE_STATUS(kStatusGroupFlashDriver, 1), /*!< Parameter is not aligned with the specified baseline*/ - kStatus_FLASH_AddressError = MAKE_STATUS(kStatusGroupFlashDriver, 2), /*!< Address is out of range */ - kStatus_FLASH_AccessError = - MAKE_STATUS(kStatusGroupFlashDriver, 3), /*!< Invalid instruction codes and out-of bound addresses */ - kStatus_FLASH_ProtectionViolation = MAKE_STATUS( - kStatusGroupFlashDriver, 4), /*!< The program/erase operation is requested to execute on protected areas */ - kStatus_FLASH_CommandFailure = - MAKE_STATUS(kStatusGroupFlashDriver, 5), /*!< Run-time error during command execution. */ - kStatus_FLASH_UnknownProperty = MAKE_STATUS(kStatusGroupFlashDriver, 6), /*!< Unknown property.*/ - kStatus_FLASH_EraseKeyError = MAKE_STATUS(kStatusGroupFlashDriver, 7) /*!< API erase key is invalid.*/ -}; -/*@}*/ - -/*! - * @brief Enumeration for various flash properties. - */ -typedef enum _flash_property_tag -{ - kFLASH_PropertyPflashSectorSize = 0x00U, /*!< Pflash sector size property.*/ - kFLASH_PropertyPflashTotalSize = 0x01U, /*!< Pflash total size property.*/ - kFLASH_PropertyPflashBlockSize = 0x02U, /*!< Pflash block size property.*/ - kFLASH_PropertyPflashBlockCount = 0x03U, /*!< Pflash block count property.*/ - kFLASH_PropertyPflashBlockBaseAddr = 0x04U, /*!< Pflash block base address property.*/ - kFLASH_PropertyPflashPageSize = 0x30U, /*!< Pflash page size property.*/ - kFLASH_PropertyPflashSystemFreq = 0x31U, /*!< System Frequency property.*/ - kFLASH_PropertyFfrSectorSize = 0x40U, /*!< FFR sector size property.*/ - kFLASH_PropertyFfrTotalSize = 0x41U, /*!< FFR total size property.*/ - kFLASH_PropertyFfrBlockBaseAddr = 0x42U, /*!< FFR block base address property.*/ - kFLASH_PropertyFfrPageSize = 0x43U, /*!< FFR page size property.*/ -} flash_property_tag_t; - -/*! @brief Flash controller paramter config. */ -typedef struct _flash_ffr_config -{ - uint32_t ffrBlockBase; - uint32_t ffrTotalSize; - uint32_t ffrPageSize; - uint32_t sectorSize; - uint32_t cfpaPageVersion; - uint32_t cfpaPageOffset; -} flash_ffr_config_t; - -/*! @brief Flash driver state information. - * - * An instance of this structure is allocated by the user of the flash driver and - * passed into each of the driver APIs. - */ -typedef struct _flash_config -{ - uint32_t PFlashBlockBase; /*!< A base address of the first PFlash block */ - uint32_t PFlashTotalSize; /*!< The size of the combined PFlash block. */ - uint32_t PFlashBlockCount; /*!< A number of PFlash blocks. */ - uint32_t PFlashPageSize; /*!< The size in bytes of a page of PFlash. */ - uint32_t PFlashSectorSize; /*!< The size in bytes of a sector of PFlash. */ - flash_ffr_config_t ffrConfig; -} flash_config_t; - -/*! @brief Interface for the flash driver. */ -typedef struct _flash_driver_interface -{ - /* Flash driver */ - status_t (*flash_init)(flash_config_t *config); - status_t (*flash_erase_sector)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes, uint32_t key); - status_t (*flash_program_phrase)(flash_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes); - status_t (*flash_program_page)(flash_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes); - status_t (*flash_verify_program)(flash_config_t *config, - uint32_t start, - uint32_t lengthInBytes, - const uint8_t *expectedData, - uint32_t *failedAddress, - uint32_t *failedData); - status_t (*flash_verify_erase_phrase)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes); - status_t (*flash_verify_erase_page)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes); - status_t (*flash_verify_erase_sector)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes); - status_t (*flash_get_property)(flash_config_t *config, flash_property_tag_t whichProperty, uint32_t *value); - /* IFR driver */ - status_t (*ifr_verify_erase_phrase)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes); - status_t (*ifr_verify_erase_page)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes); - status_t (*ifr_verify_erase_sector)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes); - status_t (*flash_read)(flash_config_t *config, uint32_t start, uint8_t *dest, uint32_t lengthInBytes); - /* version */ - uint32_t version; -} flash_driver_interface_t; - -/*! @brief Constructs the four character code for the Flash driver API key. */ -#if !defined(FOUR_CHAR_CODE) -#define FOUR_CHAR_CODE(a, b, c, d) (((d) << 24) | ((c) << 16) | ((b) << 8) | ((a))) -#endif - -/*! - * @brief Enumeration for Flash driver API keys. - * - * @note The resulting value is built with a byte order such that the string - * being readable in expected order when viewed in a hex editor, if the value - * is treated as a 32-bit little endian value. - */ -enum _flash_driver_api_keys -{ - kFLASH_ApiEraseKey = FOUR_CHAR_CODE('l', 'f', 'e', 'k') /*!< Key value used to validate all flash erase APIs.*/ -}; - -/* API prototype fields definition. -| 31 : 24 | 23 : 20 | 19 : 16 | 15 : 12 | 11 : 8 | 7 : 0 | -| Tag | Boot mode | bootloader periphal| Instance | Image Index| Reserved | -| | | | Used For Boot mode 0| | | -| | 0: Passive mode | 0 - Auto detection | | | | -| | 1: ISP mode | 1 - USB-HID | | | | -| | | 2 - UART | | | | -| | | 3 - SPI | | | | -| | | 4 - I2C | | | | -| | | 5 - CAN | | | | -*/ -typedef struct -{ - union - { - struct - { - uint32_t reserved : 8; - uint32_t boot_image_index : 4; - uint32_t instance : 4; - uint32_t boot_interface : 4; - uint32_t mode : 4; - uint32_t tag : 8; - } B; - uint32_t U; - } option; -} user_app_boot_invoke_option_t; - -/*! @brief Root of the bootloader API tree. - * - * An instance of this struct resides in read-only memory in the bootloader. It - * provides a user application access to APIs exported by the bootloader. - * - */ -typedef struct _bootloader_tree -{ - void (*run_bootloader)(void *arg); /*!< Function to start the bootloader executing. */ - const flash_driver_interface_t *flash_driver; /*!< Internal Flash driver API. */ - void (*jump)(void *arg); -} bootloader_tree_t; - -/** ROM API base address */ -#define ROM_API_BASE (0x03003fe0u) -/** ROM API base pointer */ -#define ROM_API ((bootloader_tree_t *)ROM_API_BASE) -/** FLASH API base pointer */ -#define FLASH_API (ROM_API->flash_driver) - -/*! - * @name Flash API - * @{ - */ - -/*! - * @brief Initializes the global flash properties structure members - * - * This function checks and initializes the Flash module for the other Flash APIs. - * - * @param config Pointer to the storage for the driver runtime state. - * - */ -static inline status_t FLASH_Init(flash_config_t *config) -{ - return FLASH_API->flash_init(config); -} - -/*! - * @brief Erases the flash sectors encompassed by parameters passed into function - * - * This function erases the appropriate number of flash sectors based on the - * desired start address and length. - * - * @param config The pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be erased. - * NOTE: The start address need to be 4 Bytes-aligned. - * - * @param lengthInBytes The length, given in bytes need be 4 Bytes-aligned. - * - * @param key The value used to validate all flash erase APIs. - * - */ -static inline status_t FLASH_EraseSector(flash_config_t *config, uint32_t start, uint32_t lengthInBytes, uint32_t key) -{ - return FLASH_API->flash_erase_sector(config, start, lengthInBytes, key); -} - -/*! - * @brief Programs flash phrases with data at locations passed in through parameters - * - * This function programs the flash memory with the desired data for a given - * flash area as determined by the start address and the length. - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be programmed. Must be - * word-aligned. - * @param src A pointer to the source buffer of data that is to be programmed - * into the flash. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be programmed. Must be word-aligned. - * - */ -static inline status_t FLASH_ProgramPhrase(flash_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes) -{ - return FLASH_API->flash_program_phrase(config, start, src, lengthInBytes); -} - -/*! - * @brief Programs flash page with data at locations passed in through parameters - * - * This function programs the flash memory with the desired data for a given - * flash area as determined by the start address and the length. - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be programmed. Must be - * word-aligned. - * @param src A pointer to the source buffer of data that is to be programmed - * into the flash. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be programmed. Must be word-aligned. - * - */ -static inline status_t FLASH_ProgramPage(flash_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes) -{ - return FLASH_API->flash_program_page(config, start, src, lengthInBytes); -} - -/*! - * @brief Verifies programming of the desired flash area - * - * This function verifies the data programed in the flash memory using the - * Flash Program Check Command and compares it to the expected data for a given - * flash area as determined by the start address and length. - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be verified. Must be word-aligned. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be verified. Must be word-aligned. - * @param expectedData A pointer to the expected data that is to be - * verified against. - * @param failedAddress A pointer to the returned failing address. - * @param failedData A pointer to the returned failing data. Some derivatives do - * not include failed data as part of the FCCOBx registers. In this - * case, zeros are returned upon failure. - * - */ -static inline status_t FLASH_VerifyProgram(flash_config_t *config, - uint32_t start, - uint32_t lengthInBytes, - const uint8_t *expectedData, - uint32_t *failedAddress, - uint32_t *failedData) -{ - return FLASH_API->flash_verify_program(config, start, lengthInBytes, expectedData, failedAddress, failedData); -} - -/*! - * @brief Verify that the flash phrases are erased - * - * This function checks the appropriate number of flash sectors based on - * the desired start address and length to check whether the flash is erased - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be verified. - * The start address does not need to be sector-aligned but must be word-aligned. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be verified. Must be word-aligned. - * - */ -static inline status_t FLASH_VerifyErasePhrase(flash_config_t *config, uint32_t start, uint32_t lengthInBytes) -{ - return FLASH_API->flash_verify_erase_phrase(config, start, lengthInBytes); -} - -/*! - * @brief Verify that the flash pages are erased - * - * This function checks the appropriate number of flash sectors based on - * the desired start address and length to check whether the flash is erased - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be verified. - * The start address does not need to be sector-aligned but must be word-aligned. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be verified. Must be word-aligned. - * - */ -static inline status_t FLASH_VerifyErasePage(flash_config_t *config, uint32_t start, uint32_t lengthInBytes) -{ - return FLASH_API->flash_verify_erase_page(config, start, lengthInBytes); -} - -/*! - * @brief Verify that the flash sectors are erased - * - * This function checks the appropriate number of flash sectors based on - * the desired start address and length to check whether the flash is erased - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be verified. - * The start address does not need to be sector-aligned but must be word-aligned. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be verified. Must be word-aligned. - * - */ -static inline status_t FLASH_VerifyEraseSector(flash_config_t *config, uint32_t start, uint32_t lengthInBytes) -{ - return FLASH_API->flash_verify_erase_sector(config, start, lengthInBytes); -} - -/*! - * @brief Returns the desired flash property - * - * @param config A pointer to the storage for the driver runtime state. - * @param whichProperty The desired property from the list of properties in - * enum flash_property_tag_t - * @param value A pointer to the value returned for the desired flash property. - * - */ -static inline status_t FLASH_GetProperty(flash_config_t *config, flash_property_tag_t whichProperty, uint32_t *value) -{ - return FLASH_API->flash_get_property(config, whichProperty, value); -} - -/*! - * @brief Verify that the IFR0 phrases are erased - * - * This function checks the appropriate number of flash sectors based on - * the desired start address and length to check whether the flash is erased - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be verified. - * The start address does not need to be sector-aligned but must be word-aligned. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be verified. Must be word-aligned. - * - */ -static inline status_t IFR_VerifyErasePhrase(flash_config_t *config, uint32_t start, uint32_t lengthInBytes) -{ - return FLASH_API->ifr_verify_erase_phrase(config, start, lengthInBytes); -} - -/*! - * @brief Verify that the IFR0 pages are erased - * - * This function checks the appropriate number of flash sectors based on - * the desired start address and length to check whether the flash is erased - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be verified. - * The start address does not need to be sector-aligned but must be word-aligned. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be verified. Must be word-aligned. - * - */ -static inline status_t IFR_VerifyErasePage(flash_config_t *config, uint32_t start, uint32_t lengthInBytes) -{ - return FLASH_API->ifr_verify_erase_page(config, start, lengthInBytes); -} - -/*! - * @brief Verify that the IFR0 sectors are erased - * - * This function checks the appropriate number of flash sectors based on - * the desired start address and length to check whether the flash is erased - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be verified. - * The start address does not need to be sector-aligned but must be word-aligned. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be verified. Must be word-aligned. - * - */ -static inline status_t IFR_VerifyEraseSector(flash_config_t *config, uint32_t start, uint32_t lengthInBytes) -{ - return FLASH_API->ifr_verify_erase_sector(config, start, lengthInBytes); -} - -/*! - * @brief Reads flash at locations passed in through parameters - * - * This function read the flash memory from a given flash area as determined - * by the start address and the length. - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be read. - * @param dest A pointer to the dest buffer of data that is to be read - * from the flash. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be read. - * - */ -static inline status_t FLASH_Read(flash_config_t *config, uint32_t start, uint8_t *dest, uint32_t lengthInBytes) -{ - return FLASH_API->flash_read(config, start, dest, lengthInBytes); -} - -/*! - * @brief Get ROM API version. - * - * This function read the ROM API version. - * - */ -static inline uint32_t ROMAPI_GetVersion(void) -{ - return FLASH_API->version; -} - -/*! - * @brief Run the Bootloader API to force into the ISP mode base on the user arg - * - * @param arg Indicates API prototype fields definition. - * Refer to the above #user_app_boot_invoke_option_t structure - */ -static inline void ROMAPI_RunBootloader(void *arg) -{ - ROM_API->run_bootloader(arg); -} - -/*! - * @brief Get the UUID - * - * @param uuid UUID data array - * - */ -static inline void ROMAPI_GetUUID(uint8_t *uuid) -{ -#define MCXA_UUID_ADDR (0x01100800U) -#define MCXA_UUID_SIZE (16U) - - uint8_t *p = (uint8_t *)MCXA_UUID_ADDR; - for (uint8_t i = 0; i < MCXA_UUID_SIZE; i++) - { - *uuid = *p; - uuid++; - p++; - } -} - -/* @} */ - -/*! @} */ - -#endif /* _FSL_RESET_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_spc.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_spc.c deleted file mode 100644 index c6a9b293262..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_spc.c +++ /dev/null @@ -1,1680 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_spc.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.mcx_spc" -#endif - -/* - * $Coverage Justification Reference$ - * - * $Justification spc_c_ref_1$ - * The SPC busy status flag is too short to get coverage data. - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Gets selected power domain's requested low power mode. - * - * param base SPC peripheral base address. - * param powerDomainId Power Domain Id, please refer to spc_power_domain_id_t. - * - * return The selected power domain's requested low power mode, please refer to spc_power_domain_low_power_mode_t. - */ -spc_power_domain_low_power_mode_t SPC_GetPowerDomainLowPowerMode(SPC_Type *base, spc_power_domain_id_t powerDomainId) -{ - assert((uint8_t)powerDomainId < SPC_PD_STATUS_COUNT); - - uint32_t val; - - val = ((base->PD_STATUS[(uint8_t)powerDomainId] & SPC_PD_STATUS_LP_MODE_MASK) >> SPC_PD_STATUS_LP_MODE_SHIFT); - return (spc_power_domain_low_power_mode_t)val; -} - -/*! - * brief Gets Isolation status for each power domains. - * - * This function gets the status which indicates whether certain - * peripheral and the IO pads are in a latched state as a result - * of having been in POWERDOWN mode. - * - * param base SPC peripheral base address. - * return Current isolation status for each power domains. - */ -uint8_t SPC_GetPeriphIOIsolationStatus(SPC_Type *base) -{ - uint32_t reg; - - reg = base->SC; - return (uint8_t)((reg & SPC_SC_ISO_CLR_MASK) >> SPC_SC_ISO_CLR_SHIFT); -} - -/*! - * brief Configs Low power request output pin. - * - * This function configs the low power request output pin - * - * param base SPC peripheral base address. - * param config Pointer the spc_LowPower_Request_config_t structure. - */ -void SPC_SetLowPowerRequestConfig(SPC_Type *base, const spc_lowpower_request_config_t *config) -{ - assert(config != NULL); - - uint32_t reg; - - reg = base->LPREQ_CFG; - reg &= ~(SPC_LPREQ_CFG_LPREQOE_MASK | SPC_LPREQ_CFG_LPREQPOL_MASK | SPC_LPREQ_CFG_LPREQOV_MASK); - - if (config->enable) - { - reg |= SPC_LPREQ_CFG_LPREQOE_MASK | SPC_LPREQ_CFG_LPREQPOL((uint8_t)(config->polarity)) | - SPC_LPREQ_CFG_LPREQOV((uint8_t)(config->override)); - } - else - { - reg &= ~SPC_LPREQ_CFG_LPREQOE_MASK; - } - - base->LPREQ_CFG = reg; -} - -#if !(defined(FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) && FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) -/*! - * brief Configures VDD Core Glitch detector, including ripple counter selection, timeout value and so on. - * - * param base SPC peripheral base address. - * param config Pointer to the structure in type of spc_vdd_core_glitch_detector_config_t. - */ -void SPC_ConfigVddCoreGlitchDetector(SPC_Type *base, const spc_vdd_core_glitch_detector_config_t *config) -{ - assert(config != NULL); - - uint32_t reg; - - reg = (base->VDD_CORE_GLITCH_DETECT_SC) & - ~(SPC_VDD_CORE_GLITCH_DETECT_SC_CNT_SELECT_MASK | SPC_VDD_CORE_GLITCH_DETECT_SC_TIMEOUT_MASK | - SPC_VDD_CORE_GLITCH_DETECT_SC_RE_MASK | SPC_VDD_CORE_GLITCH_DETECT_SC_IE_MASK); - - reg |= SPC_VDD_CORE_GLITCH_DETECT_SC_CNT_SELECT(config->rippleCounterSelect) | - SPC_VDD_CORE_GLITCH_DETECT_SC_TIMEOUT(config->resetTimeoutValue) | - SPC_VDD_CORE_GLITCH_DETECT_SC_RE(config->enableReset) | - SPC_VDD_CORE_GLITCH_DETECT_SC_IE(config->enableInterrupt); - - base->VDD_CORE_GLITCH_DETECT_SC = reg; -} -#endif - -/*! - * brief Set SRAM operate voltage. - * - * param base SPC peripheral base address. - * param config The pointer to spc_sram_voltage_config_t, specifies the configuration of sram voltage. - */ -void SPC_SetSRAMOperateVoltage(SPC_Type *base, const spc_sram_voltage_config_t *config) -{ - assert(config != NULL); - - uint32_t reg = 0UL; - - reg |= SPC_SRAMCTL_VSM(config->operateVoltage); - - base->SRAMCTL = reg; - - if (config->requestVoltageUpdate) - { - base->SRAMCTL |= SPC_SRAMCTL_REQ_MASK; - while ((base->SRAMCTL & SPC_SRAMCTL_ACK_MASK) == 0UL) - { - /* Wait until acknowledged */ - ; - } - base->SRAMCTL &= ~SPC_SRAMCTL_REQ_MASK; - } -} - -/*! - * brief Configs Bandgap mode in Active mode. - * - * @note To disable bandgap in Active mode: - * 1. Disable all LVD's and HVD's in active mode; - * 2. Disable Glitch detect; - * 3. Configrue LDO's and DCDC to low drive strength in active mode; - * 4. Invoke this function to disable bandgap in active mode; - * otherwise the error status will be reported. - * - * @note Some other system resources(such as PLL, CMP) require bandgap to be enabled, to disable bandgap please - * take care of other system resources. - * - * param base SPC peripheral base address. - * param mode The Bandgap mode be selected. - * - * retval kStatus_SPC_BandgapModeWrong The Bandgap can not be disabled in active mode. - * retval kStatus_Success Config Bandgap mode in Active power mode successful. - */ -status_t SPC_SetActiveModeBandgapModeConfig(SPC_Type *base, spc_bandgap_mode_t mode) -{ - uint32_t reg; - uint32_t state; - - reg = base->ACTIVE_CFG; - - if (mode == kSPC_BandgapDisabled) - { - state = SPC_GetActiveModeVoltageDetectStatus(base); - - /* If any of the LVD/HVDs are kept enabled, bandgap mode must be enabled with buffer disabled. */ - if (state != 0UL) - { - return kStatus_SPC_BandgapModeWrong; - } - - /* The bandgap mode must be enabled if any regulators' drive strength set as Normal. */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - if ((base->ACTIVE_CFG & SPC_ACTIVE_CFG_SYSLDO_VDD_DS_MASK) == - SPC_ACTIVE_CFG_SYSLDO_VDD_DS(kSPC_SysLDO_NormalDriveStrength)) - { - return kStatus_SPC_BandgapModeWrong; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - if ((base->ACTIVE_CFG & SPC_ACTIVE_CFG_DCDC_VDD_DS_MASK) == SPC_ACTIVE_CFG_DCDC_VDD_DS(kSPC_DCDC_NormalVoltage)) - { - return kStatus_SPC_BandgapModeWrong; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -#if !(defined(FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) && FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) - /* state of GLITCH_DETECT_DISABLE will be ignored if bandgap is disabled. */ - if ((base->ACTIVE_CFG & SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE_MASK) == 0UL) - { - return kStatus_SPC_BandgapModeWrong; - } -#endif -#if defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS - if ((base->ACTIVE_CFG & SPC_ACTIVE_CFG_CORELDO_VDD_DS_MASK) == - SPC_ACTIVE_CFG_CORELDO_VDD_DS(kSPC_CoreLDO_NormalDriveStrength)) - { - return kStatus_SPC_BandgapModeWrong; - } -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - } - - reg &= ~SPC_ACTIVE_CFG_BGMODE_MASK; - reg |= SPC_ACTIVE_CFG_BGMODE(mode); - - base->ACTIVE_CFG = reg; - - return kStatus_Success; -} - -/*! - * brief Configs Bandgap mode in Low Power mode. - * - * @note To disable Bandgap in Low-power mode: - * 1. Disable all LVD's ad HVD's in low power mode; - * 2. Disable Glitch detect in low power mode; - * 3. Configure LDO's and DCDC to low drive strength in low power mode; - * 4. Disable bandgap in low power mode; - * Otherwise, the error status will be reported. - * - * @note Some other system resources(such as PLL, CMP) require bandgap to be enabled, to disable bandgap please - * take care of other system resources. - * - * param base SPC peripheral base address. - * param mode The Bandgap mode be selected. - * - * retval kStatus_SPC_BandgapModeWrong The bandgap mode setting in Low Power mode is wrong. - * retval kStatus_Success Config Bandgap mode in Low Power power mode successful. - */ -status_t SPC_SetLowPowerModeBandgapmodeConfig(SPC_Type *base, spc_bandgap_mode_t mode) -{ - uint32_t reg; - uint32_t state; - - reg = base->LP_CFG; - - if (mode == kSPC_BandgapDisabled) - { - state = (uint32_t)SPC_GetLowPowerModeVoltageDetectStatus(base); - - /* If any of the LVD/HVDs are kept enabled, bandgap mode must be enabled with buffer disabled. */ - if (state != 0UL) - { - return kStatus_SPC_BandgapModeWrong; - } - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - if ((base->LP_CFG & SPC_LP_CFG_DCDC_VDD_DS_MASK) == SPC_LP_CFG_DCDC_VDD_DS(kSPC_DCDC_NormalDriveStrength)) - { - return kStatus_SPC_BandgapModeWrong; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - if ((base->LP_CFG & SPC_LP_CFG_SYSLDO_VDD_DS_MASK) == SPC_LP_CFG_SYSLDO_VDD_DS(kSPC_SysLDO_NormalDriveStrength)) - { - return kStatus_SPC_BandgapModeWrong; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - - if ((base->LP_CFG & SPC_LP_CFG_CORELDO_VDD_DS_MASK) == - SPC_LP_CFG_CORELDO_VDD_DS(kSPC_CoreLDO_NormalDriveStrength)) - { - return kStatus_SPC_BandgapModeWrong; - } - -#if !(defined(FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) && FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) - /* state of GLITCH_DETECT_DISABLE will be ignored if bandgap is disabled. */ - if ((base->LP_CFG & SPC_LP_CFG_GLITCH_DETECT_DISABLE_MASK) == 0UL) - { - return kStatus_SPC_BandgapModeWrong; - } -#endif - } - - reg &= ~SPC_LP_CFG_BGMODE_MASK; - reg |= SPC_LP_CFG_BGMODE(mode); - base->LP_CFG = reg; - - return kStatus_Success; -} - -/*! - * brief Configs CORE voltage detect options. - * - * This function configs CORE voltage detect options. - * Note: Setting both the voltage detect interrupt and reset - * enable will cause interrupt to be generated on exit from reset. - * If those conditioned is not desired, interrupt/reset only one is enabled. - * - * param base SPC peripheral base address. - * param config Pointer to spc_core_voltage_detect_config_t structure. - */ -void SPC_SetCoreVoltageDetectConfig(SPC_Type *base, const spc_core_voltage_detect_config_t *config) -{ - assert(config != NULL); - - uint32_t reg = 0UL; - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) - reg |= (config->option.HVDInterruptEnable) ? SPC_VD_CORE_CFG_HVDIE(1U) : SPC_VD_CORE_CFG_HVDIE(0U); - reg |= (config->option.HVDResetEnable) ? SPC_VD_CORE_CFG_HVDRE(1U) : SPC_VD_CORE_CFG_HVDRE(0U); -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD */ - reg |= (config->option.LVDInterruptEnable) ? SPC_VD_CORE_CFG_LVDIE(1U) : SPC_VD_CORE_CFG_LVDIE(0U); - reg |= (config->option.LVDResetEnable) ? SPC_VD_CORE_CFG_LVDRE(1U) : SPC_VD_CORE_CFG_LVDRE(0U); - - base->VD_CORE_CFG = reg; -} - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) -/*! - * brief Enables the Core High Voltage Detector in Active mode. - * - * note If the CORE_LDO high voltage detect is enabled in Active mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low. - * - * param base SPC peripheral base address. - * param enable Enable/Disable Core HVD. - * true - Enable Core High voltage detector in active mode. - * false - Disable Core High voltage detector in active mode. - * - * retval kStatus_Success Enable Core High Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeCoreHighVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_CORE_HVDE_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_CORE_HVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the Core High Voltage Detector in Low Power mode. - * - * note If the CORE_LDO high voltage detect is enabled in Low Power mode, - * please note that the bandgap must be enabled and the drive strength of each regulator - * must not set to low in low power mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable Core HVD. - * true - Enable Core High voltage detector in low power mode. - * false - Disable Core High voltage detector in low power mode. - * - * retval kStatus_Success Enable Core High Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeCoreHighVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_CORE_HVDE_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_CORE_HVDE_MASK; - } - - return status; -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD */ - -/*! - * brief Enables the Core VDD Low Voltage Detector in Active mode. - * - * note If the Core VDD high voltage detect is enabled in Active mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low. - * - * param base SPC peripheral base address. - * param enable Enable/Disable Core LVD. - * true - Enable Core Low voltage detector in active mode. - * false - Disable Core Low voltage detector in active mode. - * - * retval kStatus_Success Enable Core Low Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeCoreLowVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_CORE_LVDE_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_CORE_LVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the Core Low Voltage Detector in Low Power mode. - * - * note If the Core VDD low voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Low Power mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable Core HVD. - * true - Enable Core Low voltage detector in low power mode. - * false - Disable Core Low voltage detector in low power mode. - * - * retval kStatus_Success Enable Core Low Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeCoreLowVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_CORE_LVDE_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_CORE_LVDE_MASK; - } - - return status; -} - -/*! - * brief Set system VDD Low-voltage level selection. - * - * This function selects the system VDD low-voltage level. Changing system VDD low-voltage level - * must be done after disabling the System VDD low voltage reset and interrupt. - * - * @deprecated In latest RM, reserved for all devices, will removed in next release. - * - * param base SPC peripheral base address. - * param level System VDD Low-Voltage level selection. See @ref spc_low_voltage_level_select_t for details. - */ -void SPC_SetSystemVDDLowVoltageLevel(SPC_Type *base, spc_low_voltage_level_select_t level) -{ - (void)level; - (void)base; - - /* - uint32_t reg; - - reg = base->VD_SYS_CFG; - - base->VD_SYS_CFG &= ~(SPC_VD_SYS_CFG_LVDRE_MASK | SPC_VD_SYS_CFG_LVDIE_MASK); - reg |= SPC_VD_SYS_CFG_LVSEL(level); - - base->VD_SYS_CFG = reg; */ -} - -/*! - * brief Configs SYS VDD voltage detect options. - * - * This function config SYS voltage detect options. - * Note: Setting both the voltage detect interrupt and reset - * enable will cause interrupt to be generated on exit from reset. - * If those conditioned is not desired, interrupt/reset only one is enabled. - * - * param base SPC peripheral base address. - * param config Pointer to spc_system_voltage_detect_config_t structure. - */ -void SPC_SetSystemVoltageDetectConfig(SPC_Type *base, const spc_system_voltage_detect_config_t *config) -{ - assert(config != NULL); - - uint32_t reg = 0UL; - - reg |= (config->option.HVDInterruptEnable) ? SPC_VD_SYS_CFG_HVDIE(1U) : SPC_VD_SYS_CFG_HVDIE(0U); - reg |= (config->option.LVDInterruptEnable) ? SPC_VD_SYS_CFG_LVDIE(1U) : SPC_VD_SYS_CFG_LVDIE(0U); - reg |= (config->option.HVDResetEnable) ? SPC_VD_SYS_CFG_HVDRE(1U) : SPC_VD_SYS_CFG_HVDRE(0U); - reg |= (config->option.LVDResetEnable) ? SPC_VD_SYS_CFG_LVDRE(1U) : SPC_VD_SYS_CFG_LVDRE(0U); - - base->VD_SYS_CFG = reg; - - (void)(config->level); - /* SPC_SetSystemVDDLowVoltageLevel(base, config->level); */ -} - -/*! - * brief Enables the System VDD High Voltage Detector in Active mode. - * - * note If the System_LDO high voltage detect is enabled in Active mode, - * please note that the bandgap must be enabled and the drive strength of - * each regulator must not set to low in Active mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable System HVD. - * true - Enable System High voltage detector in active mode. - * false - Disable System High voltage detector in active mode. - * - * retval kStatus_Success Enable System High Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeSystemHighVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_SYS_HVDE_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_SYS_HVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the System VDD Low Voltage Detector in Active mode. - * - * note If the System_LDO low voltage detect is enabled in Active mode, - * please note that the bandgap must be enabled and the drive strength of each - * regulator must not set to low in Active mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable System LVD. - * true - Enable System Low voltage detector in active mode. - * false - Disable System Low voltage detector in active mode. - * - * retval kStatus_Success Enable the System Low Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeSystemLowVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_SYS_LVDE_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_SYS_LVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the System VDD High Voltage Detector in Low Power mode. - * - * note If the System_LDO high voltage detect is enabled in low power mode, - * please note that the bandgap must be enabled and the drive strength of each - * regulator must not set to low in low power mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable System HVD. - * true - Enable System High voltage detector in low power mode. - * false - Disable System High voltage detector in low power mode. - * - * retval kStatus_Success Enable System High Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeSystemHighVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_SYS_HVDE_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_SYS_HVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the System VDD Low Voltage Detector in Low Power mode. - * - * note If the System_LDO low voltage detect is enabled in Low Power mode, - * please note that the bandgap must be enabled and the drive strength of each - * regulator must not set to low in Low Power mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable System HVD. - * true - Enable System Low voltage detector in low power mode. - * false - Disable System Low voltage detector in low power mode. - * - * retval kStatus_Success Enable System Low Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeSystemLowVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_SYS_LVDE_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_SYS_LVDE_MASK; - } - - return status; -} - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) && FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) -/*! - * brief Set IO VDD Low-Voltage level selection. - * - * This function selects the IO VDD Low-voltage level. Changing IO VDD low-voltage level - * must be done after disabling the IO VDD low voltage reset and interrupt. - * - * param base SPC peripheral base address. - * param level IO VDD Low-voltage level selection. - */ -void SPC_SetIOVDDLowVoltageLevel(SPC_Type *base, spc_low_voltage_level_select_t level) -{ - uint32_t reg; - - reg = base->VD_IO_CFG; - - base->VD_IO_CFG &= ~(SPC_VD_IO_CFG_LVDRE_MASK | SPC_VD_IO_CFG_LVDIE_MASK | SPC_VD_IO_CFG_LVSEL_MASK); - reg |= SPC_VD_IO_CFG_LVSEL(level); - - base->VD_IO_CFG = reg; -} - -/*! - * brief Configs IO VDD voltage detect options. - * - * This function config IO voltage detect options. - * Note: Setting both the voltage detect interrupt and reset - * enable will cause interrupt to be generated on exit from reset. - * If those conditioned is not desired, interrupt/reset so only one is enabled. - * - * param base SPC peripheral base address. - * param config Pointer to spc_IO_voltage_detect_config_t structure. - */ -void SPC_SetIOVoltageDetectConfig(SPC_Type *base, const spc_io_voltage_detect_config_t *config) -{ - assert(config != NULL); - - uint32_t reg = 0UL; - - /* Set trip voltage level. */ - SPC_SetIOVDDLowVoltageLevel(base, config->level); - - reg = base->VD_IO_CFG; - reg &= ~(SPC_VD_IO_CFG_LVDRE_MASK | SPC_VD_IO_CFG_LVDIE_MASK | SPC_VD_IO_CFG_HVDRE_MASK | SPC_VD_IO_CFG_HVDIE_MASK); - - reg |= (config->option.HVDInterruptEnable) ? SPC_VD_IO_CFG_HVDIE(1U) : SPC_VD_IO_CFG_HVDIE(0U); - reg |= (config->option.LVDInterruptEnable) ? SPC_VD_IO_CFG_LVDIE(1U) : SPC_VD_IO_CFG_LVDIE(0U); - reg |= (config->option.HVDResetEnable) ? SPC_VD_IO_CFG_HVDRE(1U) : SPC_VD_IO_CFG_HVDRE(0U); - reg |= (config->option.LVDResetEnable) ? SPC_VD_IO_CFG_LVDRE(1U) : SPC_VD_IO_CFG_LVDRE(0U); - - base->VD_IO_CFG = reg; -} - -/*! - * brief Enables the IO VDD High Voltage Detector in Active mode. - * - * note If the IO high voltage detect is enabled in Active mode, - * please note that the bandgap must be enabled and the drive strength - * of each regulator must not set to low in Active mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable IO HVD. - * true - Enable IO High voltage detector in active mode. - * false - Disable IO High voltage detector in active mode. - * - * retval kStatus_Success Enable IO High Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeIOHighVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_IO_HVDE_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_IO_HVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the IO VDD Low Voltage Detector in Active mode. - * - * note If the IO low voltage detect is enabled in Active mode, - * please note that the bandgap must be enabled and the drive strength - * of each regulator must not set to low in Active mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable IO LVD. - * true - Enable IO Low voltage detector in active mode. - * false - Disable IO Low voltage detector in active mode. - * - * retval kStatus_Success Enable IO Low Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeIOLowVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_IO_LVDE_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_IO_LVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the IO VDD High Voltage Detector in Low Power mode. - * - * note If the IO high voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Low Power mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable IO HVD. - * true - Enable IO High voltage detector in low power mode. - * false - Disable IO High voltage detector in low power mode. - * - * retval kStatus_Success Enable IO High Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeIOHighVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_IO_HVDE_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_IO_HVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the IO VDD Low Voltage Detector in Low Power mode. - * - * note If the IO low voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Low Power mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable IO HVD. - * true - Enable IO Low voltage detector in low power mode. - * false - Disable IO Low voltage detector in low power mode. - * - * retval kStatus_Success Enable IO Low Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeIOLowVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_IO_LVDE_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_IO_LVDE_MASK; - } - - return status; -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD */ - -/*! - * brief Configs external voltage domains - * - * This function configs external voltage domains isolation. - * - * param base SPC peripheral base address. - * param lowPowerIsoMask The mask of external domains isolate enable during low power mode. - * param IsoMask The mask of external domains isolate. - */ -void SPC_SetExternalVoltageDomainsConfig(SPC_Type *base, uint8_t lowPowerIsoMask, uint8_t IsoMask) -{ - uint32_t reg = 0UL; - - reg |= SPC_EVD_CFG_REG_EVDISO(IsoMask) | SPC_EVD_CFG_REG_EVDLPISO(lowPowerIsoMask); - base->EVD_CFG = reg; -} - -/*! - * brief Configs Core LDO Regulator in Active mode. - * - * @note The bandgap must be enabled before invoking this function. - * @note To set Core LDO as low drive strength, all HVDs/LVDs must be disabled previously. - * - * param base SPC peripheral base address. - * param option Pointer to the spc_active_mode_Core_LDO_option_t structure. - * - * retval kStatus_Success Config Core LDO regulator in Active power mode successful. - * retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * retval kStatus_SPC_BandgapModeWrong Bandgap should be enabled before invoking this function. - * retval kStatus_SPC_CORELDOLowDriveStrengthIgnore To set Core LDO as low drive strength, - * all LVDs/HVDs must be disabled before invoking this function. - */ -status_t SPC_SetActiveModeCoreLDORegulatorConfig(SPC_Type *base, const spc_active_mode_core_ldo_option_t *option) -{ - assert(option != NULL); - - if ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - return kStatus_SPC_Busy; - } - - /* Check input parameters. */ - /* 1. Bandgap must not be disabled. */ - if (SPC_GetActiveModeBandgapMode(base) == kSPC_BandgapDisabled) - { - return kStatus_SPC_BandgapModeWrong; - } - - /* 2. To set to low drive strength, all LVDs/HVDs must be disabled previously. */ - if ((SPC_GetActiveModeVoltageDetectStatus(base) != 0UL) && - (option->CoreLDODriveStrength == kSPC_CoreLDO_LowDriveStrength)) - { - return kStatus_SPC_CORELDOLowDriveStrengthIgnore; - } - - if ((uint8_t)SPC_GetActiveModeCoreLDOVDDVoltageLevel(base) != (uint8_t)(option->CoreLDOVoltage)) - { -#if defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS - (void)SPC_SetActiveModeCoreLDORegulatorDriveStrength(base, kSPC_CoreLDO_NormalDriveStrength); -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - (void)SPC_SetActiveModeCoreLDORegulatorVoltageLevel(base, option->CoreLDOVoltage); - } - -#if defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS - (void)SPC_SetActiveModeCoreLDORegulatorDriveStrength(base, option->CoreLDODriveStrength); -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - - return kStatus_Success; -} - -/*! - * brief Set Core LDO VDD Regulator Voltage level in Active mode. - * - * @note In active mode, the Core LDO voltage level should only be changed when the - * Core LDO is in normal drive strength. - * - * @note Update Core LDO voltage level will set Busy flag, - * this function return only when busy flag is cleared by hardware - * - * param base SPC peripheral base address. - * param voltageLevel Specify the voltage level of CORE LDO Regulator in Active mode, please - refer to @ref spc_core_ldo_voltage_level_t. - * - * retval kStatus_SPC_CORELDOVoltageSetFail Core LDO voltage level should only be - * changed when the CORE_LDO is in normal drive strength. - * retval kStatus_Success Set Core LDO regulator voltage level in Active power mode successful. - */ -status_t SPC_SetActiveModeCoreLDORegulatorVoltageLevel(SPC_Type *base, spc_core_ldo_voltage_level_t voltageLevel) -{ - if ((uint8_t)voltageLevel != (uint8_t)SPC_GetActiveModeCoreLDOVDDVoltageLevel(base)) - { -#if (defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) - if (SPC_GetActiveModeCoreLDODriveStrength(base) != kSPC_CoreLDO_NormalDriveStrength) - { - return kStatus_SPC_CORELDOVoltageSetFail; - } -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - - base->ACTIVE_CFG = - ((base->ACTIVE_CFG & ~SPC_ACTIVE_CFG_CORELDO_VDD_LVL_MASK) | SPC_ACTIVE_CFG_CORELDO_VDD_LVL(voltageLevel)); - - /* - * $Branch Coverage Justification$ - * $ref spc_c_ref_1$. - */ - while ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - } - } - return kStatus_Success; -} - -#if defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS -/*! - * brief Set Core LDO VDD Regulator Drive Strength in Active mode. - * - * param base SPC peripheral base address. - * param driveStrength Specify the drive strength of CORE LDO Regulator in Active mode, please - refer to @ref spc_core_ldo_drive_strength_t. - * - * retval #kStatus_Success Set Core LDO regulator drive strength in Active power mode successful. - * retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore If any voltage detect enabled, - core_ldo's drive strength can not set to low. - * retval #kStatus_SPC_BandgapModeWrong The selected bandgap mode is not allowed. - */ -status_t SPC_SetActiveModeCoreLDORegulatorDriveStrength(SPC_Type *base, spc_core_ldo_drive_strength_t driveStrength) -{ - if (driveStrength == kSPC_CoreLDO_LowDriveStrength) - { - /* If any voltage detect feature is enabled in Active mode, then CORE_LDO's drive strength must not set to low. - */ - if (SPC_GetActiveModeVoltageDetectStatus(base) != 0UL) - { - return kStatus_SPC_CORELDOLowDriveStrengthIgnore; - } - } - - if (driveStrength == kSPC_CoreLDO_NormalDriveStrength) - { - /* If specify normal drive strength, bandgap must not be disabled. */ - if (SPC_GetActiveModeBandgapMode(base) == kSPC_BandgapDisabled) - { - return kStatus_SPC_BandgapModeWrong; - } - } - - base->ACTIVE_CFG = - ((base->ACTIVE_CFG & ~SPC_ACTIVE_CFG_CORELDO_VDD_DS_MASK) | SPC_ACTIVE_CFG_CORELDO_VDD_DS(driveStrength)); - - return kStatus_Success; -} -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - -/*! - * brief Configs CORE LDO Regulator in low power mode - * - * This function configs CORE LDO Regulator in Low Power mode. - * If CORE LDO VDD Drive Strength is set to Normal, the CORE LDO VDD regulator voltage - * level in Active mode must be equal to the voltage level in Low power mode. And the Bandgap - * must be programmed to select bandgap enabled. - * Core VDD voltage levels for the Core LDO low power regulator can only be changed when the CORE - * LDO Drive Strength is set as Normal. - * - * param base SPC peripheral base address. - * param option Pointer to the spc_lowpower_mode_Core_LDO_option_t structure. - * retval kStatus_Success Config Core LDO regulator in power mode successfully. - * retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * retval kStatus_SPC_CORELDOLowDriveStrengthIgnore HVDs/LVDs are not disabled before invoking this function. - * retval kStatus_SPC_BandgapModeWrong The bandgap is not enabled before invoking this function. - */ -status_t SPC_SetLowPowerModeCoreLDORegulatorConfig(SPC_Type *base, const spc_lowpower_mode_core_ldo_option_t *option) -{ - status_t status = kStatus_Success; - - if ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - /* - * $Line Coverage Justification$ - * $ref spc_c_ref_1$. - */ - return kStatus_SPC_Busy; - } - - status = SPC_SetLowPowerModeCoreLDORegulatorDriveStrength(base, option->CoreLDODriveStrength); - if (status == kStatus_Success) - { - (void)SPC_SetLowPowerModeCoreLDORegulatorVoltageLevel(base, option->CoreLDOVoltage); - } - - return status; -} - -/*! - * brief Set Core LDO VDD Regulator Voltage level in Low power mode. - * - * @note If Core LDO's drive strengths are same in active and low power mode, the Core LDO's voltage must be set to the - * same value in active and low power mode. Application should take care of this limitation. - * - * @note Some devices require Core LDO and DCDC have the same voltage level even if Core LDO is off. Application should - * take care of this limitation. - * - * param base SPC peripheral base address. - * param voltageLevel Voltage level of CORE LDO Regulator in Low power mode, please - refer to @ref spc_core_ldo_voltage_level_t. - * - * retval #kStatus_SPC_Busy The SPC instance is busy to execute other operation. - * retval #kStatus_Success Set Core LDO regulator voltage level in Low power mode successful. - */ -status_t SPC_SetLowPowerModeCoreLDORegulatorVoltageLevel(SPC_Type *base, spc_core_ldo_voltage_level_t voltageLevel) -{ - if ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - /* - * $Line Coverage Justification$ - * $ref spc_c_ref_1$. - */ - return kStatus_SPC_Busy; - } - - base->LP_CFG = ((base->LP_CFG & ~SPC_LP_CFG_CORELDO_VDD_LVL_MASK) | SPC_LP_CFG_CORELDO_VDD_LVL(voltageLevel)); - - /* - * $Branch Coverage Justification$ - * $ref spc_c_ref_1$. - */ - while ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - } - - return kStatus_Success; -} - -/*! - * brief Set Core LDO VDD Regulator Drive Strength in Low power mode. - * - * param base SPC peripheral base address. - * param driveStrength Specify drive strength of CORE LDO in low power mode. - * - * retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore Some voltage detect enabled, CORE LDO's drive strength can not set - * as low. - * retval #kStatus_Success Set Core LDO regulator drive strength in Low power mode successful. - * retval #kStatus_SPC_BandgapModeWrong Bandgap is disabled when attempt to set CORE LDO work as normal drive strength. - */ -status_t SPC_SetLowPowerModeCoreLDORegulatorDriveStrength(SPC_Type *base, spc_core_ldo_drive_strength_t driveStrength) -{ - if (driveStrength == kSPC_CoreLDO_LowDriveStrength) - { - /* If any voltage detect feature is enabled in Low Power mode, then CORE_LDO's drive strength must not set to - * low. - */ - if (SPC_GetLowPowerModeVoltageDetectStatus(base) != 0UL) - { - return kStatus_SPC_CORELDOLowDriveStrengthIgnore; - } - } - else - { - /* To specify normal drive strength, the bandgap must be enabled in low power mode. */ - if (SPC_GetLowPowerModeBandgapMode(base) == kSPC_BandgapDisabled) - { - return kStatus_SPC_BandgapModeWrong; - } - } - - base->LP_CFG = ((base->LP_CFG & ~SPC_LP_CFG_CORELDO_VDD_DS_MASK) | SPC_LP_CFG_CORELDO_VDD_DS(driveStrength)); - - return kStatus_Success; -} - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) -/*! - * brief Configs System LDO VDD Regulator in Active mode. - * - * This function configs System LDO VDD Regulator in Active mode. - * If System LDO VDD Drive Strength is set to Normal, the Bandgap mode in Active mode must be programmed - * to a value that enable the bandgap. - * If any voltage detects are kept enabled, configuration to set System LDO VDD drive strength to low will - * be ignored. - * If select System LDO VDD Regulator voltage level to Over Drive Voltage, the Drive Strength of System LDO VDD - * Regulator must be set to Normal otherwise the regulator Drive Strength will be forced to Normal. - * If select System LDO VDD Regulator voltage level to Over Drive Voltage, the High voltage detect must be disabled. - * Otherwise it will be fail to regulator to Over Drive Voltage. - * - * param base SPC peripheral base address. - * param option Pointer to the spc_active_mode_Sys_LDO_option_t structure. - * retval kStatus_Success Config System LDO regulator in Active power mode successful. - * retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * retval kStatus_SPC_BandgapModeWrong The bandgap is not enabled before invoking this function. - * retval kStatus_SPC_SYSLDOOverDriveVoltageFail HVD of System VDD is not disable before setting to Over Drive voltage. - * retval kStatus_SPC_SYSLDOLowDriveStrengthIgnore Set System LDO VDD regulator's driver strength to Low will be - * ignored. - */ -status_t SPC_SetActiveModeSystemLDORegulatorConfig(SPC_Type *base, const spc_active_mode_sys_ldo_option_t *option) -{ - assert(option != NULL); - - if ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - /* - * $Line Coverage Justification$ - * $ref spc_c_ref_1$. - */ - return kStatus_SPC_Busy; - } - - /* Check input parameters before setting registers. */ - /* 1. To set to low DS, all LVDs/HVDs must be disabled previously. */ - if ((SPC_GetActiveModeVoltageDetectStatus(base) != 0UL) && - (option->SysLDODriveStrength == kSPC_SysLDO_LowDriveStrength)) - { - return kStatus_SPC_SYSLDOLowDriveStrengthIgnore; - } - /* 2. If specify normal drive strength, bandgap must not be disabled. */ - if ((SPC_GetActiveModeBandgapMode(base) == kSPC_BandgapDisabled) && - (option->SysLDODriveStrength == kSPC_SysLDO_NormalDriveStrength)) - { - return kStatus_SPC_BandgapModeWrong; - } - - /* 3. Must disable system LDO high voltage detector before specifing overdrive voltage. */ - if ((option->SysLDOVoltage == kSPC_SysLDO_OverDriveVoltage) && - ((SPC_GetActiveModeVoltageDetectStatus(base) & SPC_ACTIVE_CFG_SYS_HVDE_MASK) != 0UL)) - { - return kStatus_SPC_SYSLDOOverDriveVoltageFail; - } - - (void)SPC_SetActiveModeSystemLDORegulatorDriveStrength(base, option->SysLDODriveStrength); - (void)SPC_SetActiveModeSystemLDORegulatorVoltageLevel(base, option->SysLDOVoltage); - - return kStatus_Success; -} - -/*! - * brief Set System LDO Regulator voltage level in Active mode. - * - * @note The system LDO regulator can only operate at the overdrive voltage level for a limited amount of time for the - * life of chip. - * - * param base SPC peripheral base address. - * param voltageLevel Specify the voltage level of System LDO Regulator in Active mode. - * - * retval #kStatus_Success Set System LDO Regulator voltage level in Active mode successfully. - * retval #kStatus_SPC_SYSLDOOverDriveVoltageFail Must disable system LDO high voltage detector before specifing - * overdrive voltage. - */ -status_t SPC_SetActiveModeSystemLDORegulatorVoltageLevel(SPC_Type *base, spc_sys_ldo_voltage_level_t voltageLevel) -{ - if (voltageLevel == kSPC_SysLDO_OverDriveVoltage) - { - /* Must disable system LDO high voltage detector before specifing overdrive voltage. */ - if ((SPC_GetActiveModeVoltageDetectStatus(base) & SPC_ACTIVE_CFG_SYS_HVDE_MASK) != 0UL) - { - return kStatus_SPC_SYSLDOOverDriveVoltageFail; - } - } - - base->ACTIVE_CFG = - (base->ACTIVE_CFG & ~SPC_ACTIVE_CFG_SYSLDO_VDD_LVL_MASK) | SPC_ACTIVE_CFG_SYSLDO_VDD_LVL(voltageLevel); - - return kStatus_Success; -} - -/*! - * brief Set System LDO Regulator Drive Strength in Active mode. - * - * param base SPC peripheral base address. - * param driveStrength Specify the drive strength of System LDO Regulator in Active mode. - * - * retval #kStatus_Success Set System LDO Regulator drive strength in Active mode successfully. - * retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Attempt to specify low drive strength is ignored due to any - voltage detect feature is enabled in active mode. - * retval #kStatus_SPC_BandgapModeWrong Bandgap mode in Active mode must be programmed to a value that enables - the bandgap if attempt to specify normal drive strength. - */ -status_t SPC_SetActiveModeSystemLDORegulatorDriveStrength(SPC_Type *base, spc_sys_ldo_drive_strength_t driveStrength) -{ - if (driveStrength == kSPC_SysLDO_LowDriveStrength) - { - /* If enabled any LVDs or HVDs, SPC will ignore the attempt to specify low drive strength. */ - if (SPC_GetActiveModeVoltageDetectStatus(base) != 0UL) - { - return kStatus_SPC_SYSLDOLowDriveStrengthIgnore; - } - } - - if (driveStrength == kSPC_SysLDO_NormalDriveStrength) - { - /* If specify normal drive strength, bandgap must not be disabled. */ - if (SPC_GetActiveModeBandgapMode(base) == kSPC_BandgapDisabled) - { - return kStatus_SPC_BandgapModeWrong; - } - } - - base->ACTIVE_CFG = - (base->ACTIVE_CFG & ~SPC_ACTIVE_CFG_SYSLDO_VDD_DS_MASK) | SPC_ACTIVE_CFG_SYSLDO_VDD_DS(driveStrength); - - return kStatus_Success; -} - -/*! - * brief Configs System LDO regulator in low power modes. - * - * This function configs System LDO regulator in low power modes. - * If System LDO VDD Regulator Drive strength is set to normal, bandgap mode in low power - * mode must be programmed to a value that enables the Bandgap. - * If any High voltage detectors or Low Voltage detectors are kept enabled, configuration - * to set System LDO Regulator drive strength as Low will be ignored. - * - * param base SPC peripheral base address. - * param option Pointer to spc_lowpower_mode_Sys_LDO_option_t structure. - * - * retval kStatus_Success Config System LDO regulator in Low Power Mode successfully. - * retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * retval kStatus_SPC_BandgapModeWrong The bandgap mode setting in Low Power Mode is wrong. - * retval kStatus_SPC_SYSLDOLowDriveStrengthIgnore Set driver strength to low will be ignored. - */ -status_t SPC_SetLowPowerModeSystemLDORegulatorConfig(SPC_Type *base, const spc_lowpower_mode_sys_ldo_option_t *option) -{ - status_t status; - - if ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - /* - * $Line Coverage Justification$ - * $ref spc_c_ref_1$. - */ - return kStatus_SPC_Busy; - } - - status = SPC_SetLowPowerModeSystemLDORegulatorDriveStrength(base, option->SysLDODriveStrength); - - return status; -} - -/*! - * brief Set System LDO Regulator drive strength in Low Power Mode. - * - * param base SPC peripheral base address. - * param driveStrength Specify the drive strength of System LDO Regulator in Low Power Mode. - * - * retval #kStatus_Success Set System LDO Regulator drive strength in Low Power Mode successfully. - * retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Attempt to specify low drive strength is ignored due to any - voltage detect feature is enabled in low power mode. - * retval #kStatus_SPC_BandgapModeWrong Bandgap mode in low power mode must be programmed to a value that enables - the bandgap if attempt to specify normal drive strength. - */ -status_t SPC_SetLowPowerModeSystemLDORegulatorDriveStrength(SPC_Type *base, spc_sys_ldo_drive_strength_t driveStrength) -{ - if (driveStrength == kSPC_SysLDO_LowDriveStrength) - { - /* If enabled any LVDs or HVDs, SPC will ignore the attempt to specify low drive strength. */ - if (SPC_GetLowPowerModeVoltageDetectStatus(base) != 0UL) - { - return kStatus_SPC_SYSLDOLowDriveStrengthIgnore; - } - } - else - { - /* If specify normal drive strength, bandgap must not be disabled. */ - if (SPC_GetLowPowerModeBandgapMode(base) == kSPC_BandgapDisabled) - { - return kStatus_SPC_BandgapModeWrong; - } - } - - base->LP_CFG = (base->LP_CFG & ~SPC_LP_CFG_SYSLDO_VDD_DS_MASK) | SPC_LP_CFG_SYSLDO_VDD_DS(driveStrength); - - return kStatus_Success; -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) -/*! - * brief Configs DCDC VDD Regulator in Active mode. - * - * note When changing the DCDC output voltage level, take care to change the CORE LDO voltage level. - * - * param base SPC peripheral base address. - * param option Pointer to the spc_active_mode_DCDC_option_t structure. - * - * retval kStatus_Success Config DCDC regulator in Active power mode successful. - * retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * retval kStatus_SPC_BandgapModeWrong The bandgap mode setting in Active mode is wrong. - */ -status_t SPC_SetActiveModeDCDCRegulatorConfig(SPC_Type *base, const spc_active_mode_dcdc_option_t *option) -{ - assert(option != NULL); - status_t status = kStatus_Success; - - if ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - /* - * $Line Coverage Justification$ - * $ref spc_c_ref_1$. - */ - return kStatus_SPC_Busy; - } - - status = SPC_SetActiveModeDCDCRegulatorDriveStrength(base, option->DCDCDriveStrength); - - if (status == kStatus_Success) - { - SPC_SetActiveModeDCDCRegulatorVoltageLevel(base, option->DCDCVoltage); - } - - /* - * $Branch Coverage Justification$ - * $ref spc_c_ref_1$. - */ - while ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - } - - return status; -} - -/*! - * brief Set DCDC VDD Regulator drive strength in Active mode. - * - * note To set DCDC drive strength as Normal, the bandgap must be enabled. - * - * param base SPC peripheral base address. - * param driveStrength Specify the DCDC VDD regulator drive strength, please refer to @ref spc_dcdc_drive_strength_t. - * - * retval #kStatus_Success Set DCDC VDD Regulator drive strength in Active mode successfully. - * retval #kStatus_SPC_BandgapModeWrong Set DCDC VDD Regulator drive strength to Normal, the Bandgap must be enabled. - */ -status_t SPC_SetActiveModeDCDCRegulatorDriveStrength(SPC_Type *base, spc_dcdc_drive_strength_t driveStrength) -{ - if (driveStrength == kSPC_DCDC_NormalDriveStrength) - { - /* If specify normal drive strength, bandgap must not be disabled. */ - if (SPC_GetActiveModeBandgapMode(base) == kSPC_BandgapDisabled) - { - return kStatus_SPC_BandgapModeWrong; - } - } - - base->ACTIVE_CFG = - ((base->ACTIVE_CFG) & (~SPC_ACTIVE_CFG_DCDC_VDD_DS_MASK)) | SPC_ACTIVE_CFG_DCDC_VDD_DS(driveStrength); - - return kStatus_Success; -} - -/*! - * brief Configs DCDC VDD Regulator in Low power modes. - * - * If DCDC VDD Drive Strength is set to Normal, the Bandgap mode in Low Power mode must be programmed - * to a value that enables the Bandgap. - * In Deep Power Down mode, DCDC regulator is always turned off. - * - * param base SPC peripheral base address. - * param option Pointer to the spc_lowpower_mode_DCDC_option_t structure. - * - * retval kStatus_Success Config DCDC regulator in low power mode successfully. - * retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * retval kStatus_SPC_BandgapModeWrong The bandgap should be enabled before invoking this function. - */ -status_t SPC_SetLowPowerModeDCDCRegulatorConfig(SPC_Type *base, const spc_lowpower_mode_dcdc_option_t *option) -{ - if ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - /* - * $Line Coverage Justification$ - * $ref spc_c_ref_1$. - */ - return kStatus_SPC_Busy; - } - - /* Check input parameter before setting registers. */ - if ((option->DCDCDriveStrength == kSPC_DCDC_NormalDriveStrength) && - (SPC_GetLowPowerModeBandgapMode(base) == kSPC_BandgapDisabled)) - { - return kStatus_SPC_BandgapModeWrong; - } - - /* - 1. Configure to desired voltage level. - 2. Change to low drive strength. - 3. Configure same voltage level in active mode. - */ - SPC_SetLowPowerModeDCDCRegulatorVoltageLevel(base, option->DCDCVoltage); - - /* Change to desired drive strength. */ - if (option->DCDCDriveStrength != kSPC_DCDC_LowDriveStrength) - { - (void)SPC_SetLowPowerModeDCDCRegulatorDriveStrength(base, option->DCDCDriveStrength); - } - - /* - * $Branch Coverage Justification$ - * $ref spc_c_ref_1$. - */ - while ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - } - - return kStatus_Success; -} - -/*! - * brief Set DCDC VDD Regulator drive strength in Low power mode. - * - * param base SPC peripheral base address. - * param driveStrength Specify the DCDC VDD Regulator drive strength, please refer to @ref spc_dcdc_drive_strength_t. - * - * retval #kStatus_Success Set DCDC VDD Regulator drive strength in Low power mode successfully. - * retval #kStatus_SPC_BandgapModeWrong Set DCDC VDD Regulator drive strength to Normal, the Bandgap must be enabled. - */ -status_t SPC_SetLowPowerModeDCDCRegulatorDriveStrength(SPC_Type *base, spc_dcdc_drive_strength_t driveStrength) -{ - if (driveStrength == kSPC_DCDC_NormalDriveStrength) - { - /* If specify normal drive strength, bandgap must not be disabled. */ - if (SPC_GetLowPowerModeBandgapMode(base) == kSPC_BandgapDisabled) - { - return kStatus_SPC_BandgapModeWrong; - } - } - - base->LP_CFG = ((base->LP_CFG) & (~SPC_LP_CFG_DCDC_VDD_DS_MASK)) | SPC_LP_CFG_DCDC_VDD_DS(driveStrength); - - return kStatus_Success; -} - -/*! - * brief Config DCDC Burst options - * - * param base SPC peripheral base address. - * param config Pointer to spc_DCDC_burst_config_t structure. - */ -void SPC_SetDCDCBurstConfig(SPC_Type *base, spc_dcdc_burst_config_t *config) -{ - assert(config != NULL); - uint32_t reg; - reg = base->DCDC_CFG; - reg &= ~(SPC_DCDC_CFG_FREQ_CNTRL_MASK | SPC_DCDC_CFG_FREQ_CNTRL_ON_MASK); - reg |= SPC_DCDC_CFG_FREQ_CNTRL(config->freq); - reg |= config->stabilizeBurstFreq ? SPC_DCDC_CFG_FREQ_CNTRL_ON(1U) : SPC_DCDC_CFG_FREQ_CNTRL_ON(0U); - base->DCDC_CFG = reg; - - /* Blocking until previous DCDC burst completed. */ - while ((base->DCDC_BURST_CFG & SPC_DCDC_BURST_CFG_BURST_ACK_MASK) == 0UL) - { - } - - if ((config->sofwareBurstRequest) || (config->externalBurstRequest)) - { - /* Clear DCDC burst acknowledge flag. */ - base->DCDC_BURST_CFG |= SPC_DCDC_BURST_CFG_BURST_ACK_MASK; - } - base->DCDC_BURST_CFG |= SPC_DCDC_BURST_CFG_EXT_BURST_EN(config->externalBurstRequest); - - if (config->sofwareBurstRequest) - { - base->DCDC_BURST_CFG |= SPC_DCDC_BURST_CFG_BURST_REQ_MASK; - } -} - -/*! - * brief Set the count value of the reference clock. - * - * This function set the count value of the reference clock to control the frequency - * of dcdc refresh when dcdc is configured in Pulse Refresh mode. - * - * param base SPC peripheral base address. - * param count The count value, 16 bit width. - */ -void SPC_SetDCDCRefreshCount(SPC_Type *base, uint16_t count) -{ - uint32_t reg; - - reg = base->DCDC_BURST_CFG; - reg &= ~SPC_DCDC_BURST_CFG_PULSE_REFRESH_CNT_MASK; - reg |= SPC_DCDC_BURST_CFG_PULSE_REFRESH_CNT(count); - - base->DCDC_BURST_CFG = reg; -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -/*! - * brief Configs all settings of regulators in Active mode at a time. - * - * @note This function is used to overwrite all settings of regulators(including bandgap mode, regulators' - * drive strength and voltage level) in active mode at a time. - * - * @note Enable/disable LVDs/HVDs before invoking this function. - * - * @note This function will check input parameters based on hardware restrictions before setting registers, if input - * parameters do not satisfy hardware restrictions the specific error will be reported. - * - * - * @note Some hardware restrictions not covered, application should be aware of this and follow this hardware - * restrictions otherwise some unkown issue may occur: - * 1. If Core LDO's drive strength are set to same value in both Active mode and low power mode, - * the voltage level should also set to same value. - * 2. When switching Core LDO's drive strength from low to normal, ensure the LDO_CORE high voltage level is set - * to same level that was set prior to switching to the LDO_CORE drive strength. Otherwise, if the LVDs are - * enabled, an unexpected LVD can occur. - * - * @note If this function can not satisfy some tricky settings, please invoke other low-level functions. - * - * param base SPC peripheral base address. - * param config Pointer to spc_active_mode_regulators_config_t structure. - * retval kStatus_Success Config regulators in Active power mode successful. - * retval kStatus_SPC_BandgapModeWrong The bandgap mode setting in Active mode is wrong. - * retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * retval kStatus_SPC_CORELDOVoltageWrong The selected voltage level in active mode is not allowed. - * retval kStatus_SPC_SYSLDOOverDriveVoltageFail Fail to regulator to Over Drive Voltage. - * retval kStatus_SPC_SYSLDOLowDriveStrengthIgnore Set driver strength to Low will be ignored. - * retval kStatus_SPC_DCDCLowDriveStrengthIgnore Set driver strength to Low will be ignored. - */ -status_t SPC_SetActiveModeRegulatorsConfig(SPC_Type *base, const spc_active_mode_regulators_config_t *config) -{ - assert(config != NULL); - - uint32_t activeModeVDValue = SPC_GetActiveModeVoltageDetectStatus(base); - - /* Check input parameters */ - /* 1. Bandgap should not be disabled if any of regulator in normal drive strength or - if any of LVDs/HVDs are enabled or if VDD CORE glitch detect are enabled. */ - if ((config->bandgapMode == kSPC_BandgapDisabled) && - ((activeModeVDValue != 0UL) -#if !(defined(FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) && FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) - || (SPC_CheckActiveModeVddCoreGlitchDetectEnabled(base) == true) -#endif /* FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - || (config->DCDCOption.DCDCDriveStrength == kSPC_DCDC_NormalDriveStrength) -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - || (config->SysLDOOption.SysLDODriveStrength == kSPC_SysLDO_NormalDriveStrength) -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ -#if (defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) - || (config->CoreLDOOption.CoreLDODriveStrength == kSPC_CoreLDO_NormalDriveStrength) -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - )) - { - return kStatus_SPC_BandgapModeWrong; - } - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - /* 2. Must disable system LDO high voltage detector before specifing SysLDO to overdrive voltage */ - if (((activeModeVDValue & SPC_ACTIVE_CFG_SYS_HVDE_MASK) != 0UL) && - (config->SysLDOOption.SysLDOVoltage == kSPC_SysLDO_OverDriveVoltage)) - { - return kStatus_SPC_SYSLDOOverDriveVoltageFail; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - /* 3. To set System LDO's drive strength to low, all LVDs and HVDs must be disabled. */ - if ((activeModeVDValue != 0UL) && (config->SysLDOOption.SysLDODriveStrength == kSPC_SysLDO_LowDriveStrength)) - { - return kStatus_SPC_SYSLDOLowDriveStrengthIgnore; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) - /* 4. To set Core LDO's drive strength to low, all LVDs and HVDs must be disabled. */ - if ((activeModeVDValue != 0UL) && (config->CoreLDOOption.CoreLDODriveStrength == kSPC_CoreLDO_LowDriveStrength)) - { - return kStatus_SPC_CORELDOLowDriveStrengthIgnore; - } -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - /* 5. Core LDO and DCDC should have same voltage level. */ - if ((uint8_t)config->DCDCOption.DCDCVoltage != (uint8_t)config->CoreLDOOption.CoreLDOVoltage) - { - return kStatus_SPC_CORELDOVoltageWrong; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - - if ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - return kStatus_SPC_Busy; - } - - base->ACTIVE_CFG = - ((base->ACTIVE_CFG) & ~(SPC_ACTIVE_CFG_BGMODE_MASK)) | SPC_ACTIVE_CFG_BGMODE(config->bandgapMode); -#if (defined(FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) - SPC_EnableActiveModeCMPBandgapBuffer(base, config->lpBuff); -#endif /* FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - (void)SPC_SetActiveModeSystemLDORegulatorConfig(base, &config->SysLDOOption); -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - (void)SPC_SetActiveModeDCDCRegulatorConfig(base, &config->DCDCOption); -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - - (void)SPC_SetActiveModeCoreLDORegulatorConfig(base, &config->CoreLDOOption); - - return kStatus_Success; -} - -/*! - * brief Configs regulators in Low Power mode. - * - * This function provides the method to config all on-chip regulators in Low Power mode. - * - * param base SPC peripheral base address. - * param config Pointer to spc_lowpower_mode_regulators_config_t structure. - * retval #kStatus_Success Config regulators in Low power mode successful. - * retval #kStatus_SPC_BandgapModeWrong The bandgap should not be disabled based on input settings. - * retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore Set driver strength to low will be ignored. - * retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Set driver strength to low will be ignored. - * retval #kStatus_SPC_CORELDOVoltageWrong Core LDO and System LDO do not have same voltage level. - */ -status_t SPC_SetLowPowerModeRegulatorsConfig(SPC_Type *base, const spc_lowpower_mode_regulators_config_t *config) -{ - assert(config != NULL); - uint32_t lpModeVDValue = SPC_GetLowPowerModeVoltageDetectStatus(base); - - /* Check input parameters */ - /* 1. Bandgap should not be disabled if any of regulator in normal drive strength or - if any of LVDs/HVDs are enabled or if VDD CORE glitch detect are enabled. */ - if ((config->bandgapMode == kSPC_BandgapDisabled) && - ((lpModeVDValue != 0UL) -#if !(defined(FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) && FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) - || (SPC_CheckLowPowerModeVddCoreGlitchDetectEnabled(base) == true) -#endif /* FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - || (config->DCDCOption.DCDCDriveStrength == kSPC_DCDC_NormalDriveStrength) -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - || (config->SysLDOOption.SysLDODriveStrength == kSPC_SysLDO_NormalDriveStrength) -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ -#if (defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) - || (config->CoreLDOOption.CoreLDODriveStrength == kSPC_CoreLDO_NormalDriveStrength) -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - )) - { - return kStatus_SPC_BandgapModeWrong; - } - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - /* 2. To set System LDO's drive strength to low, all LVDs and HVDs must be disabled. */ - if ((lpModeVDValue != 0UL) && (config->SysLDOOption.SysLDODriveStrength == kSPC_SysLDO_LowDriveStrength)) - { - return kStatus_SPC_SYSLDOLowDriveStrengthIgnore; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) - /* 3. To set Core LDO's drive strength to low, all LVDs and HVDs must be disabled. */ - if ((lpModeVDValue != 0UL) && (config->CoreLDOOption.CoreLDODriveStrength == kSPC_CoreLDO_LowDriveStrength)) - { - return kStatus_SPC_CORELDOLowDriveStrengthIgnore; - } -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - /* 5. Core LDO and DCDC should have same voltage level. */ - if ((uint8_t)config->DCDCOption.DCDCVoltage != (uint8_t)config->CoreLDOOption.CoreLDOVoltage) - { - return kStatus_SPC_CORELDOVoltageWrong; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - base->LP_CFG = ((base->LP_CFG) & ~(SPC_LP_CFG_BGMODE_MASK)) | SPC_LP_CFG_BGMODE(config->bandgapMode); -#if (defined(FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) - SPC_EnableLowPowerModeCMPBandgapBuffer(base, config->lpBuff); -#endif /* FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT) - SPC_EnableLowPowerModeCoreVDDInternalVoltageScaling(base, config->CoreIVS); -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT */ - SPC_EnableLowPowerModeLowPowerIREF(base, config->lpIREF); - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - (void)SPC_SetLowPowerModeSystemLDORegulatorConfig(base, &config->SysLDOOption); -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - (void)SPC_SetLowPowerModeDCDCRegulatorConfig(base, &config->DCDCOption); -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - - (void)SPC_SetLowPowerModeCoreLDORegulatorConfig(base, &config->CoreLDOOption); - - return kStatus_Success; -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_spc.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_spc.h deleted file mode 100644 index 52cb71c24db..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_spc.h +++ /dev/null @@ -1,2433 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_SPC_H_ -#define FSL_SPC_H_ -#include "fsl_common.h" - -/*! - * @addtogroup mcx_spc - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief SPC driver version 2.4.2. */ -#define FSL_SPC_DRIVER_VERSION (MAKE_VERSION(2, 4, 2)) -/*! @} */ - -#define SPC_EVD_CFG_REG_EVDISO_SHIFT 0UL -#define SPC_EVD_CFG_REG_EVDLPISO_SHIFT 8UL -#define SPC_EVD_CFG_REG_EVDSTAT_SHIFT 16UL - -#define SPC_EVD_CFG_REG_EVDISO(x) ((uint32_t)(x) << SPC_EVD_CFG_REG_EVDISO_SHIFT) -#define SPC_EVD_CFG_REG_EVDLPISO(x) ((uint32_t)(x) << SPC_EVD_CFG_REG_EVDLPISO_SHIFT) -#define SPC_EVD_CFG_REG_EVDSTAT(x) ((uint32_t)(x) << SPC_EVD_CFG_REG_EVDSTAT_SHIFT) - -#if (defined(SPC_GLITCH_DETECT_SC_CNT_SELECT_MASK)) -#define VDD_CORE_GLITCH_DETECT_SC GLITCH_DETECT_SC -#define SPC_VDD_CORE_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG_MASK SPC_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG_MASK -#define SPC_VDD_CORE_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG SPC_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG -#define SPC_VDD_CORE_GLITCH_DETECT_SC_LOCK_MASK SPC_GLITCH_DETECT_SC_LOCK_MASK -#define SPC_VDD_CORE_GLITCH_DETECT_SC_CNT_SELECT_MASK SPC_GLITCH_DETECT_SC_CNT_SELECT_MASK -#define SPC_VDD_CORE_GLITCH_DETECT_SC_CNT_SELECT SPC_GLITCH_DETECT_SC_CNT_SELECT -#define SPC_VDD_CORE_GLITCH_DETECT_SC_RE_MASK SPC_GLITCH_DETECT_SC_RE_MASK -#define SPC_VDD_CORE_GLITCH_DETECT_SC_RE SPC_GLITCH_DETECT_SC_RE -#define SPC_VDD_CORE_GLITCH_DETECT_SC_TIMEOUT_MASK SPC_GLITCH_DETECT_SC_TIMEOUT_MASK -#define SPC_VDD_CORE_GLITCH_DETECT_SC_TIMEOUT SPC_GLITCH_DETECT_SC_TIMEOUT -#define SPC_VDD_CORE_GLITCH_DETECT_SC_IE_MASK SPC_GLITCH_DETECT_SC_IE_MASK -#define SPC_VDD_CORE_GLITCH_DETECT_SC_IE SPC_GLITCH_DETECT_SC_IE -#endif - -/*! - * @brief SPC status enumeration. - * - * @note Some device(such as MCXA family) do not equip DCDC or System LDO, please refer to the reference manual - * to check. - */ -enum -{ - kStatus_SPC_Busy = MAKE_STATUS(kStatusGroup_SPC, 0U), /*!< The SPC instance is busy executing any - type of power mode transition. */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - kStatus_SPC_DCDCLowDriveStrengthIgnore = MAKE_STATUS(kStatusGroup_SPC, 1U), /*!< DCDC Low drive strength setting be - ignored for LVD/HVD enabled. */ - kStatus_SPC_DCDCPulseRefreshModeIgnore = MAKE_STATUS(kStatusGroup_SPC, 2U), /*!< DCDC Pulse Refresh Mode drive - strength setting be ignored for LVD/HVD enabled. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - kStatus_SPC_SYSLDOOverDriveVoltageFail = MAKE_STATUS(kStatusGroup_SPC, 3U), /*!< SYS LDO regulate to Over drive - voltage failed for SYS LDO HVD must be disabled. */ - kStatus_SPC_SYSLDOLowDriveStrengthIgnore = MAKE_STATUS(kStatusGroup_SPC, 4U), /*!< SYS LDO Low driver strength - setting be ignored for LDO LVD/HVD enabled. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - kStatus_SPC_CORELDOLowDriveStrengthIgnore = MAKE_STATUS(kStatusGroup_SPC, 5U), /*!< CORE LDO Low driver strength - setting be ignored for LDO LVD/HVD enabled. */ - kStatus_SPC_CORELDOVoltageWrong = MAKE_STATUS(kStatusGroup_SPC, 7U), /*!< Core LDO voltage is wrong. */ - kStatus_SPC_CORELDOVoltageSetFail = MAKE_STATUS(kStatusGroup_SPC, 8U), /*!< Core LDO voltage set fail. */ - kStatus_SPC_BandgapModeWrong = MAKE_STATUS(kStatusGroup_SPC, 6U), /*!< Selected Bandgap Mode wrong. */ -}; - -/*! - * @brief Voltage Detect Status Flags. - */ -enum _spc_voltage_detect_flags -{ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) && FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) - kSPC_IOVDDHighVoltageDetectFlag = SPC_VD_STAT_IOVDD_HVDF_MASK, /*!< IO VDD High-Voltage detect flag. */ - kSPC_IOVDDLowVoltageDetectFlag = SPC_VD_STAT_IOVDD_LVDF_MASK, /*!< IO VDD Low-Voltage detect flag. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD */ - kSPC_SystemVDDHighVoltageDetectFlag = SPC_VD_STAT_SYSVDD_HVDF_MASK, /*!< System VDD High-Voltage detect flag. */ - kSPC_SystemVDDLowVoltageDetectFlag = SPC_VD_STAT_SYSVDD_LVDF_MASK, /*!< System VDD Low-Voltage detect flag. */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) - kSPC_CoreVDDHighVoltageDetectFlag = SPC_VD_STAT_COREVDD_HVDF_MASK, /*!< Core VDD High-Voltage detect flag. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD */ - kSPC_CoreVDDLowVoltageDetectFlag = SPC_VD_STAT_COREVDD_LVDF_MASK, /*!< Core VDD Low-Voltage detect flag. */ -}; - -/*! - * @brief SPC power domain isolation status. - * @note Some devices(such as MCXA family) do not contain WAKE Power Domain, please refer to the reference manual to - * check. - */ -enum _spc_power_domains -{ - kSPC_MAINPowerDomainRetain = 1UL << 16U, /*!< Peripherals and IO pads retain in MAIN Power Domain. */ - kSPC_WAKEPowerDomainRetain = 1UL << 17U, /*!< Peripherals and IO pads retain in WAKE Power Domain. */ -}; - -/*! - * @brief The enumeration of all analog module that can be controlled by SPC in active or low-power modes. - * @anchor spc_analog_module_control - */ -enum _spc_analog_module_control -{ - kSPC_controlVref = 1UL << 0UL, /*!< Enable/disable VREF in active or low-power modes. */ - kSPC_controlUsb3vDet = 1UL << 1UL, /*!< Enable/disable USB3V_Det in active or low-power modes. */ - kSPC_controlDac0 = 1UL << 4UL, /*!< Enable/disable DAC0 in active or low-power modes. */ - kSPC_controlDac1 = 1UL << 5UL, /*!< Enable/disable DAC1 in active or low-power modes. */ - kSPC_controlDac2 = 1UL << 6UL, /*!< Enable/disable DAC2 in active or low-power modes. */ - kSPC_controlOpamp0 = 1UL << 8UL, /*!< Enable/disable OPAMP0 in active or low-power modes. */ - kSPC_controlOpamp1 = 1UL << 9UL, /*!< Enable/disable OPAMP1 in active or low-power modes. */ - kSPC_controlOpamp2 = 1UL << 10UL, /*!< Enable/disable OPAMP2 in active or low-power modes. */ - kSPC_controlCmp0 = 1UL << 16UL, /*!< Enable/disable CMP0 in active or low-power modes. */ - kSPC_controlCmp1 = 1UL << 17UL, /*!< Enable/disable CMP1 in active or low-power modes. */ - kSPC_controlCmp2 = 1UL << 18UL, /*!< Enable/disable CMP2 in active or low-power modes. */ - kSPC_controlCmp0Dac = 1UL << 20UL, /*!< Enable/disable CMP0_DAC in active or low-power modes. */ - kSPC_controlCmp1Dac = 1UL << 21UL, /*!< Enable/disable CMP1_DAC in active or low-power modes. */ - kSPC_controlCmp2Dac = 1UL << 22UL, /*!< Enable/disable CMP2_DAC in active or low-power modes. */ - kSPC_controlAllModules = 0x770773UL, /*!< Enable/disable all modules in active or low-power modes. */ -}; - -/*! - * @brief The enumeration of spc power domain, the connected power domain is chip specfic, please refer to chip's RM - * for details. - */ -typedef enum _spc_power_domain_id -{ - kSPC_PowerDomain0 = 0U, /*!< Power domain0, the connected power domain is chip specific. */ - kSPC_PowerDomain1 = 1U, /*!< Power domain1, the connected power domain is chip specific. */ -} spc_power_domain_id_t; - -/*! - * @brief The enumeration of Power domain's low power mode. - */ -typedef enum _spc_power_domain_low_power_mode -{ - kSPC_SleepWithSYSClockRunning = 0U, /*!< Power domain request SLEEP mode with SYS clock running. */ - kSPC_DeepSleepWithSysClockOff = 1U, /*!< Power domain request deep sleep mode with system clock off. */ - kSPC_PowerDownWithSysClockOff = 2U, /*!< Power domain request power down mode with system clock off. */ - kSPC_DeepPowerDownWithSysClockOff = 4U, /*!< Power domain request deep power down mode with system clock off. */ -} spc_power_domain_low_power_mode_t; - -/*! - * @brief SPC low power request output pin polarity. - */ -typedef enum _spc_lowPower_request_pin_polarity -{ - kSPC_HighTruePolarity = 0x0U, /*!< Control the High Polarity of the Low Power Reqest Pin. */ - kSPC_LowTruePolarity = 0x1U, /*!< Control the Low Polarity of the Low Power Reqest Pin. */ -} spc_lowpower_request_pin_polarity_t; - -/*! - * @brief SPC low power request output override. - */ -typedef enum _spc_lowPower_request_output_override -{ - kSPC_LowPowerRequestNotForced = 0x0U, /*!< Not Forced. */ - kSPC_LowPowerRequestReserved = 0x1U, /*!< Reserved. */ - kSPC_LowPowerRequestForcedLow = 0x2U, /*!< Forced Low (Ignore LowPower request output polarity setting.) */ - kSPC_LowPowerRequestForcedHigh = 0x3U, /*!< Forced High (Ignore LowPower request output polarity setting.) */ -} spc_lowpower_request_output_override_t; - -/*! - * @brief SPC Bandgap mode enumeration in Active mode or Low Power mode. - */ -typedef enum _spc_bandgap_mode -{ - kSPC_BandgapDisabled = 0x0U, /*!< Bandgap disabled. */ - kSPC_BandgapEnabledBufferDisabled = 0x1U, /*!< Bandgap enabled with Buffer disabled. */ - kSPC_BandgapEnabledBufferEnabled = 0x2U, /*!< Bandgap enabled with Buffer enabled. */ - kSPC_BandgapReserved = 0x3U, /*!< Reserved. */ -} spc_bandgap_mode_t; - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) -/*! - * @brief DCDC regulator voltage level enumeration in Active mode or Low Power Mode. - * - * @note #kSPC_DCDC_RetentionVoltage not supported for all power modes. - */ -typedef enum _spc_dcdc_voltage_level -{ - kSPC_DCDC_RetentionVoltage = 0x0U, /*!< DCDC_CORE Regulator regulate to retention - Voltage(Only supportedin low power modes) */ - kSPC_DCDC_MidVoltage = 0x1U, /*!< DCDC_CORE Regulator regulate to Mid Voltage(1.0V). */ - kSPC_DCDC_NormalVoltage = 0x2U, /*!< DCDC_CORE Regulator regulate to Normal Voltage(1.1V). */ - kSPC_DCDC_OverdriveVoltage = 0x3U, /*!< DCDC_CORE Regulator regulate to Safe-Mode Voltage(1.2V). */ -} spc_dcdc_voltage_level_t; - -/*! - * @brief DCDC regulator Drive Strength enumeration in Active mode or Low Power Mode. - * - * @note Different drive strength differ in these DCDC characterstics: - * Maximum load current - * Quiescent current - * Transient response. - */ -typedef enum _spc_dcdc_drive_strength -{ - kSPC_DCDC_PulseRefreshMode = 0x0U, /*!< DCDC_CORE Regulator Drive Strength set to Pulse Refresh Mode, - * This enum member is only useful for Low Power Mode config, please - * note that pluse refresh mode is invalid in SLEEP mode. - */ - kSPC_DCDC_LowDriveStrength = 0x1U, /*!< DCDC_CORE regulator Drive Strength set to low. */ - kSPC_DCDC_NormalDriveStrength = 0x2U, /*!< DCDC_CORE regulator Drive Strength set to Normal. */ -} spc_dcdc_drive_strength_t; -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) -/*! - * @brief SYS LDO regulator voltage level enumeration in Active mode. - */ -typedef enum _spc_sys_ldo_voltage_level -{ - kSPC_SysLDO_NormalVoltage = 0x0U, /*!< SYS LDO VDD Regulator regulate to Normal Voltage(1.8V). */ - kSPC_SysLDO_OverDriveVoltage = 0x1U, /*!< SYS LDO VDD Regulator regulate to Over Drive Voltage(2.5V). */ -} spc_sys_ldo_voltage_level_t; - -/*! - * @brief SYS LDO regulator Drive Strength enumeration in Active mode or Low Power mode. - */ -typedef enum _spc_sys_ldo_drive_strength -{ - kSPC_SysLDO_LowDriveStrength = 0x0U, /*!< SYS LDO VDD regulator Drive Strength set to low. */ - kSPC_SysLDO_NormalDriveStrength = 0x1U, /*!< SYS LDO VDD regulator Drive Strength set to Normal. */ -} spc_sys_ldo_drive_strength_t; -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -/*! - * @brief Core LDO regulator voltage level enumeration in Active mode or Low Power mode. - */ -typedef enum _spc_core_ldo_voltage_level -{ - kSPC_CoreLDO_UnderDriveVoltage = 0x0U, /*!< @deprecated, to align with description of latest RM, please use - #kSPC_Core_LDO_RetentionVoltage as instead. */ - kSPC_Core_LDO_RetentionVoltage = 0x0U, /*!< Core LDO VDD regulator regulate to retention voltage, please note that - only useful in low power modes and not all devices support this options - please refer to devices' RM for details. */ - kSPC_CoreLDO_MidDriveVoltage = 0x1U, /*!< Core LDO VDD regulator regulate to Mid Drive Voltage. */ - kSPC_CoreLDO_NormalVoltage = 0x2U, /*!< Core LDO VDD regulator regulate to Normal Voltage. */ - kSPC_CoreLDO_OverDriveVoltage = 0x3U, /*!< Core LDO VDD regulator regulate to overdrive Voltage. */ -} spc_core_ldo_voltage_level_t; - -/*! - * @brief CORE LDO VDD regulator Drive Strength enumeration in Low Power mode. - */ -typedef enum _spc_core_ldo_drive_strength -{ - kSPC_CoreLDO_LowDriveStrength = 0x0U, /*!< Core LDO VDD regulator Drive Strength set to low. */ - kSPC_CoreLDO_NormalDriveStrength = 0x1U, /*!< Core LDO VDD regulator Drive Strength set to Normal. */ -} spc_core_ldo_drive_strength_t; - -/*! - * @brief IO VDD Low-Voltage Level Select. - */ -typedef enum _spc_low_voltage_level_select -{ - kSPC_LowVoltageNormalLevel = 0x0U, /*!< @deprecated, please use kSPC_LowVoltageHighRange as instead. */ - kSPC_LowVoltageSafeLevel = 0x1U, /*!< @deprecated, please use kSPC_LowVoltageLowRange as instead. */ - - kSPC_LowVoltageHighRange = 0x0U, /*!< High range LVD threshold. */ - kSPC_LowVoltageLowRange = 0x1U, /*!< Low range LVD threshold. */ -} spc_low_voltage_level_select_t; - -#if !(defined(FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) && FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) -/*! - * @brief Used to select output of 4-bit ripple counter is used to monitor a glitch on VDD core. - */ -typedef enum _spc_vdd_core_glitch_ripple_counter_select -{ - kSPC_selectBit0Of4bitRippleCounter = 0x0U, /*!< Select bit-0 of 4-bit Ripple Counter - to detect glitch on VDD Core. */ - kSPC_selectBit1Of4bitRippleCounter = 0x1U, /*!< Select bit-1 of 4-bit Ripple Counter - to detect glitch on VDD Core. */ - kSPC_selectBit2Of4bitRippleCounter = 0x2U, /*!< Select bit-2 of 4-bit Ripple Counter - to detect glitch on VDD Core. */ - kSPC_selectBit3Of4bitRippleCounter = 0x3U, /*!< Select bit-3 of 4-bit Ripple Counter - to detect glitch on VDD Core. */ -} spc_vdd_core_glitch_ripple_counter_select_t; -#endif - -/*! - * @brief The list of the operating voltage for the SRAM's read/write timing margin. - */ -typedef enum _spc_sram_operate_voltage -{ - kSPC_sramOperateAt1P0V = 0x1U, /*!< SRAM configured for 1.0V operation. */ - kSPC_sramOperateAt1P1V = 0x2U, /*!< SRAM configured for 1.1V operation. */ - kSPC_sramOperateAt1P2V = 0x3U, /*!< SRAM configured for 1.2V operation. */ -} spc_sram_operate_voltage_t; - -#if !(defined(FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) && FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) -/*! - * @brief The configuration of VDD Core glitch detector. - */ -typedef struct _spc_vdd_core_glitch_detector_config -{ - spc_vdd_core_glitch_ripple_counter_select_t rippleCounterSelect; /*!< Used to set ripple counter. */ - uint8_t resetTimeoutValue; /*!< The timeout value used to reset glitch detect/compare logic after an initial - glitch is detected. */ - bool enableReset; /*!< Used to enable/disable POR/LVD reset that caused by CORE VDD glitch detect error. */ - bool enableInterrupt; /*!< Used to enable/disable hardware interrupt if CORE VDD glitch detect error. */ -} spc_vdd_core_glitch_detector_config_t; -#endif - -typedef struct _spc_sram_voltage_config -{ - spc_sram_operate_voltage_t operateVoltage; /*!< Specifies the operating voltage for the SRAM's - read/write timing margin. */ - bool requestVoltageUpdate; /*!< Used to control whether request an SRAM trim value change. */ -} spc_sram_voltage_config_t; - -/*! - * @brief Low Power Request output pin configuration. - */ -typedef struct _spc_lowpower_request_config -{ - bool enable; /*!< Low Power Request Output enable. */ - spc_lowpower_request_pin_polarity_t polarity; /*!< Low Power Request Output pin polarity select. */ - spc_lowpower_request_output_override_t override; /*!< Low Power Request Output Override. */ -} spc_lowpower_request_config_t; - -/*! - * @brief Core LDO regulator options in Active mode. - */ -typedef struct _spc_active_mode_core_ldo_option -{ - spc_core_ldo_voltage_level_t CoreLDOVoltage; /*!< Core LDO Regulator Voltage Level selection in Active mode. */ -#if defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS - spc_core_ldo_drive_strength_t CoreLDODriveStrength; /*!< Core LDO Regulator Drive Strength - selection in Active mode */ -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ -} spc_active_mode_core_ldo_option_t; - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) -/*! - * @brief System LDO regulator options in Active mode. - */ -typedef struct _spc_active_mode_sys_ldo_option -{ - spc_sys_ldo_voltage_level_t SysLDOVoltage; /*!< System LDO Regulator Voltage Level selection in Active mode. */ - spc_sys_ldo_drive_strength_t SysLDODriveStrength; /*!< System LDO Regulator Drive Strength - selection in Active mode. */ -} spc_active_mode_sys_ldo_option_t; -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) -/*! - * @brief DCDC regulator options in Active mode. - */ -typedef struct _spc_active_mode_dcdc_option -{ - spc_dcdc_voltage_level_t DCDCVoltage; /*!< DCDC Regulator Voltage Level selection in Active mode. */ - spc_dcdc_drive_strength_t DCDCDriveStrength; /*!< DCDC_CORE Regulator Drive Strength selection in Active mode. */ -} spc_active_mode_dcdc_option_t; -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -/*! - * @brief Core LDO regulator options in Low Power mode. - */ -typedef struct _spc_lowpower_mode_core_ldo_option -{ - spc_core_ldo_voltage_level_t CoreLDOVoltage; /*!< Core LDO Regulator Voltage Level selection in Low Power mode. */ - spc_core_ldo_drive_strength_t CoreLDODriveStrength; /*!< Core LDO Regulator Drive Strength - selection in Low Power mode */ -} spc_lowpower_mode_core_ldo_option_t; - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) -/*! - * @brief System LDO regulator options in Low Power mode. - */ -typedef struct _spc_lowpower_mode_sys_ldo_option -{ - spc_sys_ldo_drive_strength_t SysLDODriveStrength; /*!< System LDO Regulator Drive Strength - selection in Low Power mode. */ -} spc_lowpower_mode_sys_ldo_option_t; -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) -/*! - * @brief DCDC regulator options in Low Power mode. - */ -typedef struct _spc_lowpower_mode_dcdc_option -{ - spc_dcdc_voltage_level_t DCDCVoltage; /*!< DCDC Regulator Voltage Level selection in Low Power mode. */ - spc_dcdc_drive_strength_t DCDCDriveStrength; /*!< DCDC_CORE Regulator Drive Strength selection in Low Power mode. */ -} spc_lowpower_mode_dcdc_option_t; - -/*! - * @brief DCDC Burst configuration. - * @deprecated Do not recommend to use this structure. - */ -typedef struct _spc_dcdc_burst_config -{ - bool sofwareBurstRequest; /*!< Enable/Disable DCDC Software Burst Request. */ - bool externalBurstRequest; /*!< Enable/Disable DCDC External Burst Request. */ - bool stabilizeBurstFreq; /*!< Enable/Disable DCDC frequency stabilization. */ - uint8_t freq; /*!< The frequency of the current burst. */ -} spc_dcdc_burst_config_t; -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -/*! - * @brief CORE/SYS/IO VDD Voltage Detect options. - */ -typedef struct _spc_voltage_detect_option -{ - bool HVDInterruptEnable; /*!< CORE/SYS/IO VDD High Voltage Detect interrupt enable. */ - bool HVDResetEnable; /*!< CORE/SYS/IO VDD High Voltage Detect reset enable. */ - bool LVDInterruptEnable; /*!< CORE/SYS/IO VDD Low Voltage Detect interrupt enable. */ - bool LVDResetEnable; /*!< CORE/SYS/IO VDD Low Voltage Detect reset enable. */ -} spc_voltage_detect_option_t; - -/*! - * @brief Core Voltage Detect configuration. - */ -typedef struct _spc_core_voltage_detect_config -{ - spc_voltage_detect_option_t option; /*!< Core VDD Voltage Detect option. */ -} spc_core_voltage_detect_config_t; - -/*! - * @brief System Voltage Detect Configuration. - */ -typedef struct _spc_system_voltage_detect_config -{ - spc_voltage_detect_option_t option; /*!< System VDD Voltage Detect option. */ - spc_low_voltage_level_select_t level; /*!< @deprecated, reserved for all devices, will removed in next release. */ -} spc_system_voltage_detect_config_t; - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) && FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) -/*! - * @brief IO Voltage Detect Configuration. - */ -typedef struct _spc_io_voltage_detect_config -{ - spc_voltage_detect_option_t option; /*!< IO VDD Voltage Detect option. */ - spc_low_voltage_level_select_t level; /*!< IO VDD Low-voltage level selection. */ -} spc_io_voltage_detect_config_t; -#endif /* FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD */ - -/*! - * @brief Active mode configuration. - */ -typedef struct _spc_active_mode_regulators_config -{ - spc_bandgap_mode_t bandgapMode; /*!< Specify bandgap mode in active mode. */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) - bool lpBuff; /*!< Enable/disable CMP bandgap buffer. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - spc_active_mode_dcdc_option_t DCDCOption; /*!< Specify DCDC configurations in active mode. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - spc_active_mode_sys_ldo_option_t SysLDOOption; /*!< Specify System LDO configurations in active mode. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - - spc_active_mode_core_ldo_option_t CoreLDOOption; /*!< Specify Core LDO configurations in active mode. */ -} spc_active_mode_regulators_config_t; - -/*! - * @brief Low Power Mode configuration. - */ -typedef struct _spc_lowpower_mode_regulators_config -{ - bool lpIREF; /*!< Enable/disable low power IREF in low power modes. */ - spc_bandgap_mode_t bandgapMode; /*!< Specify bandgap mode in low power modes. */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) - bool lpBuff; /*!< Enable/disable CMP bandgap buffer in low power modes. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT) - bool CoreIVS; /*!< Enable/disable CORE VDD internal voltage scaling. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - spc_lowpower_mode_dcdc_option_t DCDCOption; /*!< Specify DCDC configurations in low power modes. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - spc_lowpower_mode_sys_ldo_option_t SysLDOOption; /*!< Specify system LDO configurations in low power modes. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - - spc_lowpower_mode_core_ldo_option_t CoreLDOOption; /*!< Specify core LDO configurations in low power modes. */ -} spc_lowpower_mode_regulators_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name SPC Status - * @{ - */ -/*! - * @brief Gets Isolation status for each power domains. - * - * This function gets the status which indicates whether certain - * peripheral and the IO pads are in a latched state as a result - * of having been in POWERDOWN mode. - * - * @param base SPC peripheral base address. - * @return Current isolation status for each power domains. See @ref _spc_power_domains for details. - */ -uint8_t SPC_GetPeriphIOIsolationStatus(SPC_Type *base); - -/*! - * @brief Clears peripherals and I/O pads isolation flags for each power domains. - * - * This function clears peripherals and I/O pads isolation flags for each power domains. - * After recovering from the POWERDOWN mode, user must invoke this function to release the - * I/O pads and certain peripherals to their normal run mode state. Before invoking this - * function, user must restore chip configuration in particular pin configuration for enabled - * WUU wakeup pins. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_ClearPeriphIOIsolationFlag(SPC_Type *base) -{ - base->SC |= SPC_SC_ISO_CLR_MASK; -} - -/*! - * @brief Gets SPC busy status flag. - * - * This function gets SPC busy status flag. When SPC executing any type of power mode - * transition in ACTIVE mode or any of the SOC low power mode, the SPC busy status flag is set - * and this function returns true. When changing CORE LDO voltage level and DCDC voltage level - * in ACTIVE mode, the SPC busy status flag is set and this function return true. - * - * @param base SPC peripheral base address. - * @return Ack busy flag. - * true - SPC is busy. - * false - SPC is not busy. - */ -static inline bool SPC_GetBusyStatusFlag(SPC_Type *base) -{ - return ((base->SC & SPC_SC_BUSY_MASK) != 0UL); -} - -/*! - * @brief Checks system low power request. - * - * @note Only when all power domains request low power mode entry, the result of this function is true. That means when - * all power domains request low power mode entry, the SPC regulators will be controlled by LP_CFG register. - * - * @param base SPC peripheral base address. - * @return The system low power request check result. - * - \b true All power domains have requested low power mode and SPC has entered a low power state and power mode - * configuration are based on the LP_CFG configuration register. - * - \b false SPC in active mode and ACTIVE_CFG register control system power supply. - */ -static inline bool SPC_CheckLowPowerReqest(SPC_Type *base) -{ - return ((base->SC & SPC_SC_SPC_LP_REQ_MASK) == SPC_SC_SPC_LP_REQ_MASK); -} - -/*! - * @brief Clears system low power request, set SPC in active mode. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_ClearLowPowerRequest(SPC_Type *base) -{ - base->SC |= SPC_SC_SPC_LP_REQ_MASK; -} - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SWITCH_STATE_BIT) && FSL_FEATURE_MCX_SPC_HAS_SWITCH_STATE_BIT) -/*! - * @brief Checks whether the power switch is on. - * - * @param base SPC peripheral base address. - * - * @retval true The power switch is on. - * @retval false The power switch is off. - */ -static inline bool SPC_CheckSwitchState(SPC_Type *base) -{ - return ((base->SC & SPC_SC_SWITCH_STATE_MASK) != 0UL); -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_SWITCH_STATE_BIT */ - -/*! - * @brief Gets selected power domain's requested low power mode. - * - * @param base SPC peripheral base address. - * @param powerDomainId Power Domain Id, please refer to @ref spc_power_domain_id_t. - * - * @return The selected power domain's requested low power mode, please refer to @ref spc_power_domain_low_power_mode_t. - */ -spc_power_domain_low_power_mode_t SPC_GetPowerDomainLowPowerMode(SPC_Type *base, spc_power_domain_id_t powerDomainId); - -/*! - * @brief Checks power domain's low power request. - * - * @param base SPC peripheral base address. - * @param powerDomainId Power Domain Id, please refer to @ref spc_power_domain_id_t. - * @return The result of power domain's low power request. - * - \b true The selected power domain requests low power mode entry. - * - \b false The selected power domain does not request low power mode entry. - */ -static inline bool SPC_CheckPowerDomainLowPowerRequest(SPC_Type *base, spc_power_domain_id_t powerDomainId) -{ - assert((uint8_t)powerDomainId < SPC_PD_STATUS_COUNT); - return ((base->PD_STATUS[(uint8_t)powerDomainId] & SPC_PD_STATUS_PWR_REQ_STATUS_MASK) == - SPC_PD_STATUS_PWR_REQ_STATUS_MASK); -} - -/*! - * @brief Clears selected power domain's low power request flag. - * - * @param base SPC peripheral base address. - * @param powerDomainId Power Domain Id, please refer to @ref spc_power_domain_id_t. - */ -static inline void SPC_ClearPowerDomainLowPowerRequestFlag(SPC_Type *base, spc_power_domain_id_t powerDomainId) -{ - assert((uint8_t)powerDomainId < SPC_PD_STATUS_COUNT); - base->PD_STATUS[(uint8_t)powerDomainId] |= SPC_PD_STATUS_PD_LP_REQ_MASK; -} - -/*! @} */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SRAMRETLDO_REG) && FSL_FEATURE_MCX_SPC_HAS_SRAMRETLDO_REG) -/*! - * @name SRAM Retention LDO Control APIs - * @{ - */ - -/*! - * @brief Trims SRAM retention regulator reference voltage, trim step is 12 mV, range is around 0.48V to 0.85V. - * - * @param base SPC peripheral base address. - * @param trimValue Reference voltage trim value. - */ -static inline void SPC_TrimSRAMLdoRefVoltage(SPC_Type *base, uint8_t trimValue) -{ - base->SRAMRETLDO_REFTRIM = - ((base->SRAMRETLDO_REFTRIM & ~SPC_SRAMRETLDO_REFTRIM_REFTRIM_MASK) | SPC_SRAMRETLDO_REFTRIM_REFTRIM(trimValue)); -} - -/*! - * @brief Enables/disables SRAM retention LDO. - * - * @param base SPC peripheral base address. - * @param enable Used to enable/disable SRAM LDO : - * - \b true Enable SRAM LDO; - * - \b false Disable SRAM LDO. - */ -static inline void SPC_EnableSRAMLdo(SPC_Type *base, bool enable) -{ - if (enable) - { - base->SRAMRETLDO_CNTRL |= SPC_SRAMRETLDO_CNTRL_SRAMLDO_ON_MASK; - } - else - { - base->SRAMRETLDO_CNTRL &= ~SPC_SRAMRETLDO_CNTRL_SRAMLDO_ON_MASK; - } -} - -/*! - * @brief - * - * @todo Need to check. - * - * @param base SPC peripheral base address. - * @param mask The OR'ed value of SRAM Array. - */ -static inline void SPC_RetainSRAMArray(SPC_Type *base, uint8_t mask) -{ - base->SRAMRETLDO_CNTRL |= SPC_SRAMRETLDO_CNTRL_SRAM_RET_EN(mask); -} - -/*! @} */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_SRAMRETLDO_REG */ - -/*! - * @name Low Power Request configuration - * @{ - */ -/*! - * @brief Configs Low power request output pin. - * - * This function config the low power request output pin - * - * @param base SPC peripheral base address. - * @param config Pointer the @ref spc_lowpower_request_config_t structure. - */ -void SPC_SetLowPowerRequestConfig(SPC_Type *base, const spc_lowpower_request_config_t *config); - -/*! @} */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_CFG_REG) && FSL_FEATURE_MCX_SPC_HAS_CFG_REG) -/*! - * @name Integrated Power Switch Control APIs - * @{ - */ - -/*! - * @brief Enables/disables the integrated power switch manually. - * - * @param base SPC peripheral base address. - * @param enable Used to enable/disable the integrated power switch: - * - \b true Enable the integrated power switch; - * - \b false Disable the integrated power switch. - */ -static inline void SPC_EnableIntegratedPowerSwitchManually(SPC_Type *base, bool enable) -{ - if (enable) - { - base->CFG |= (SPC_CFG_INTG_PWSWTCH_SLEEP_ACTIVE_EN_MASK | SPC_CFG_INTG_PWSWTCH_WKUP_ACTIVE_EN_MASK); - } - else - { - base->CFG &= ~(SPC_CFG_INTG_PWSWTCH_SLEEP_ACTIVE_EN_MASK | SPC_CFG_INTG_PWSWTCH_WKUP_ACTIVE_EN_MASK); - } -} - -/*! - * @brief Enables/disables the integrated power switch automatically. - * - * To gate the integrated power switch when chip enter low power modes, and ungate the switch after wake-up from low - * power modes: - * @code - * SPC_EnableIntegratedPowerSwitchAutomatically(SPC, true, true); - * @endcode - * - * @param base SPC peripheral base address. - * @param sleepGate Enable the integrated power switch when chip enter low power modes: - * - \b true SPC asserts an output pin at low-power entry to power-gate the switch; - * - \b false SPC does not assert an output pin at low-power entry to power-gate the switch. - * @param wakeupUngate Enables the switch after wake-up from low power modes: - * - \b true SPC asserts an output pin at low-power exit to power-ungate the switch; - * - \b false SPC does not assert an output pin at low-power exit to power-ungate the switch. - */ -static inline void SPC_EnableIntegratedPowerSwitchAutomatically(SPC_Type *base, bool sleepGate, bool wakeupUngate) -{ - uint32_t tmp32 = ((base->CFG) & ~(SPC_CFG_INTG_PWSWTCH_SLEEP_EN_MASK | SPC_CFG_INTG_PWSWTCH_WKUP_EN_MASK)); - - tmp32 |= SPC_CFG_INTG_PWSWTCH_SLEEP_EN(sleepGate) | SPC_CFG_INTG_PWSWTCH_WKUP_EN(wakeupUngate); - - base->CFG = tmp32; -} - -/*! @} */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_CFG_REG */ - -#if !(defined(FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) && FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) -/*! - * @name VDD Core Glitch Detector Control APIs - * @{ - */ - -/*! - * @brief Configures VDD Core Glitch detector, including ripple counter selection, timeout value and so on. - * - * @param base SPC peripheral base address. - * @param config Pointer to the structure in type of @ref spc_vdd_core_glitch_detector_config_t. - */ -void SPC_ConfigVddCoreGlitchDetector(SPC_Type *base, const spc_vdd_core_glitch_detector_config_t *config); - -/*! - * @brief Checks selected 4-bit glitch ripple counter's output. - * - * @param base SPC peripheral base address. - * @param rippleCounter The ripple counter to check, please refer to @ref spc_vdd_core_glitch_ripple_counter_select_t. - * - * @retval true The selected ripple counter output is 1, will generate interrupt or reset based on settings. - * @retval false The selected ripple counter output is 0. - */ - -static inline bool SPC_CheckGlitchRippleCounterOutput(SPC_Type *base, - spc_vdd_core_glitch_ripple_counter_select_t rippleCounter) -{ - return ((base->VDD_CORE_GLITCH_DETECT_SC & SPC_VDD_CORE_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG_MASK) == - SPC_VDD_CORE_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG(1UL << (uint32_t)(rippleCounter))); -} - -/*! - * @brief Clears output of selected glitch ripple counter. - * - * @param base SPC peripheral base address. - * @param rippleCounter The ripple counter to check, please refer to @ref spc_vdd_core_glitch_ripple_counter_select_t. - */ -static inline void SPC_ClearGlitchRippleCounterOutput(SPC_Type *base, - spc_vdd_core_glitch_ripple_counter_select_t rippleCounter) -{ - base->VDD_CORE_GLITCH_DETECT_SC |= - SPC_VDD_CORE_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG(1UL << (uint32_t)(rippleCounter)); -} - -/*! - * @brief After invoking this function, writes to SPC_VDD_CORE_GLITCH_DETECT_SC[RE] register are ignored. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_LockVddCoreVoltageGlitchDetectResetControl(SPC_Type *base) -{ - base->VDD_CORE_GLITCH_DETECT_SC |= SPC_VDD_CORE_GLITCH_DETECT_SC_LOCK_MASK; -} - -/*! - * @brief After invoking this function, writes to SPC_VDD_CORE_GLITCH_DETECT_SC[RE] register are allowed. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_UnlockVddCoreVoltageGlitchDetectResetControl(SPC_Type *base) -{ - base->VDD_CORE_GLITCH_DETECT_SC &= ~SPC_VDD_CORE_GLITCH_DETECT_SC_LOCK_MASK; -} - -/*! - * @brief Checks if SPC_VDD_CORE_GLITCH_DETECT_SC[RE] register is writable. - * - * @param base SPC peripheral base address. - * - * @retval true SPC_VDD_CORE_GLITCH_DETECT_SC[RE] register is writable. - * @retval false SPC_VDD_CORE_GLITCH_DETECT_SC[RE] register is not writable. - */ -static inline bool SPC_CheckVddCoreVoltageGlitchResetControlState(SPC_Type *base) -{ - return ((base->VDD_CORE_GLITCH_DETECT_SC & SPC_VDD_CORE_GLITCH_DETECT_SC_LOCK_MASK) != 0UL); -} - -/*! @} */ -#endif - -/*! - * @name SRAM Control APIs - * @{ - */ - -/*! - * @brief Set SRAM operate voltage. - * - * @param base SPC peripheral base address. - * @param config The pointer to @ref spc_sram_voltage_config_t, specifies the configuration of sram voltage. - */ -void SPC_SetSRAMOperateVoltage(SPC_Type *base, const spc_sram_voltage_config_t *config); - -/*! @} */ - -/*! - * @name Active Mode configuration - * @{ - */ - -/*! - * @brief Gets the Bandgap mode in Active mode. - * - * @param base SPC peripheral base address. - * @return Bandgap mode in the type of @ref spc_bandgap_mode_t enumeration. - */ -static inline spc_bandgap_mode_t SPC_GetActiveModeBandgapMode(SPC_Type *base) -{ - return (spc_bandgap_mode_t)(uint32_t)((base->ACTIVE_CFG & SPC_ACTIVE_CFG_BGMODE_MASK) >> - SPC_ACTIVE_CFG_BGMODE_SHIFT); -} - -/*! - * @brief Gets all voltage detectors status in Active mode. - * - * @param base SPC peripheral base address. - * @return All voltage detectors status in Active mode. - */ -static inline uint32_t SPC_GetActiveModeVoltageDetectStatus(SPC_Type *base) -{ - uint32_t state; - state = base->ACTIVE_CFG & - ( -#if (defined(FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) && FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) - SPC_ACTIVE_CFG_IO_HVDE_MASK | SPC_ACTIVE_CFG_IO_LVDE_MASK | - -#endif /* FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD */ - SPC_ACTIVE_CFG_SYS_HVDE_MASK | SPC_ACTIVE_CFG_SYS_LVDE_MASK | SPC_ACTIVE_CFG_CORE_LVDE_MASK - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) - | SPC_ACTIVE_CFG_CORE_HVDE_MASK - -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD */ - ); - return state; -} - -/*! - * @brief Configs Bandgap mode in Active mode. - * - * @note To disable bandgap in Active mode: - * 1. Disable all LVD's and HVD's in active mode; - * 2. Disable Glitch detect; - * 3. Configrue LDO's and DCDC to low drive strength in active mode; - * 4. Invoke this function to disable bandgap in active mode; - * otherwise the error status will be reported. - * - * @note Some other system resources(such as PLL, CMP) require bandgap to be enabled, to disable bandgap please - * take care of other system resources. - * - * @param base SPC peripheral base address. - * @param mode The Bandgap mode be selected. - * - * @retval #kStatus_SPC_BandgapModeWrong The Bandgap can not be disabled in active mode. - * @retval #kStatus_Success Config Bandgap mode in Active power mode successful. - */ -status_t SPC_SetActiveModeBandgapModeConfig(SPC_Type *base, spc_bandgap_mode_t mode); - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) -/*! - * @brief Enables/Disable the CMP Bandgap Buffer in Active mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable CMP Bandgap buffer. - * true - Enable Buffer Stored Reference voltage to CMP. - * false - Disable Buffer Stored Reference voltage to CMP. - */ -static inline void SPC_EnableActiveModeCMPBandgapBuffer(SPC_Type *base, bool enable) -{ - if (enable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_LPBUFF_EN_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_LPBUFF_EN_MASK; - } -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT */ - -/*! - * @brief Sets the delay when the regulators change voltage level in Active mode. - * - * @param base SPC peripheral base address. - * @param delay The number of SPC timer clock cycles. - */ -static inline void SPC_SetActiveModeVoltageTrimDelay(SPC_Type *base, uint16_t delay) -{ - base->ACTIVE_VDELAY = SPC_ACTIVE_VDELAY_ACTIVE_VDELAY(delay); -} - -/*! - * @brief Configs all settings of regulators in Active mode at a time. - * - * @note This function is used to overwrite all settings of regulators(including bandgap mode, regulators' - * drive strength and voltage level) in active mode at a time. - * - * @note Enable/disable LVDs/HVDs before invoking this function. - * - * @note This function will check input parameters based on hardware restrictions before setting registers, if input - * parameters do not satisfy hardware restrictions the specific error will be reported. - * - * - * @note Some hardware restrictions not covered, application should be aware of this and follow this hardware - * restrictions otherwise some unkown issue may occur: - * 1. If Core LDO's drive strength are set to same value in both Active mode and low power mode, - * the voltage level should also set to same value. - * 2. When switching Core LDO's drive strength from low to normal, ensure the LDO_CORE high voltage level is set - * to same level that was set prior to switching to the LDO_CORE drive strength. Otherwise, if the LVDs are - * enabled, an unexpected LVD can occur. - * - * @note If this function can not satisfy some tricky settings, please invoke other APIs in low-level function group. - * - * @param base SPC peripheral base address. - * @param config Pointer to spc_active_mode_regulators_config_t structure. - * - * @retval #kStatus_Success Config regulators in Active power mode successful. - * @retval #kStatus_SPC_BandgapModeWrong Based on input setting, bandgap can not be disabled. - * @retval #kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * @retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore Any of LVDs/HVDs kept enabled before invoking this function. - * @retval #kStatus_SPC_SYSLDOOverDriveVoltageFail Fail to regulator to Over Drive Voltage due to - * System VDD HVD is not disabled. - * @retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Any of LVDs/HVDs kept enabled before invoking this function. - * @retval #kStatus_SPC_CORELDOVoltageWrong Core LDO and System LDO do not have same voltage level. - */ -status_t SPC_SetActiveModeRegulatorsConfig(SPC_Type *base, const spc_active_mode_regulators_config_t *config); - -#if !(defined(FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) && FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) -/*! - * @brief Disables/Enables VDD Core Glitch Detect in Active mode. - * - * @note State of glitch detect disable feature will be ignored if bandgap is disabled and - * glitch detect hardware will be forced to OFF state. - * - * @param base SPC peripheral base address. - * @param disable Used to disable/enable VDD Core Glitch detect feature. - * - \b true Disable VDD Core Low Voltage detect; - * - \b false Enable VDD Core Low Voltage detect. - */ -static inline void SPC_DisableActiveModeVddCoreGlitchDetect(SPC_Type *base, bool disable) -{ - if (disable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE_MASK; - } -} - -/*! - * @brief Check if Glitch detect hardware is enabled in active mode. - * - * @param base SPC peripheral base address. - * @return Indicate if Glitch detector is enabled. - */ -static inline bool SPC_CheckActiveModeVddCoreGlitchDetectEnabled(SPC_Type *base) -{ - if ((base->ACTIVE_CFG & SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE_MASK) == 0UL) - { - return true; - } - else - { - return false; - } -} - -#endif /* FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT */ - -/*! - * @brief Enables analog modules in active mode. - * - * @param base SPC peripheral base address. - * @param maskValue The mask of analog modules to enable in active mode, should be the OR'ed value - * of @ref spc_analog_module_control. - */ -static inline void SPC_EnableActiveModeAnalogModules(SPC_Type *base, uint32_t maskValue) -{ - base->ACTIVE_CFG1 |= SPC_ACTIVE_CFG1_SOC_CNTRL(maskValue); -} - -/*! - * @brief Disables analog modules in active mode. - * - * @param base SPC peripheral base address. - * @param maskValue The mask of analog modules to disable in active mode, should be the OR'ed value - * of @ref spc_analog_module_control. - */ -static inline void SPC_DisableActiveModeAnalogModules(SPC_Type *base, uint32_t maskValue) -{ - base->ACTIVE_CFG1 &= ~SPC_ACTIVE_CFG1_SOC_CNTRL(maskValue); -} - -/*! - * @brief Gets enabled analog modules that enabled in active mode. - * - * @param base SPC peripheral base address. - * - * @return The mask of enabled analog modules that enabled in active mode. - */ -static inline uint32_t SPC_GetActiveModeEnabledAnalogModules(SPC_Type *base) -{ - return base->ACTIVE_CFG1; -} - -/*! @} */ - -/*! - * @name Low Power mode configuration - * @{ - */ - -/*! - * @brief Gets the Bandgap mode in Low Power mode. - * - * @param base SPC peripheral base address. - * @return Bandgap mode in the type of @ref spc_bandgap_mode_t enumeration. - */ -static inline spc_bandgap_mode_t SPC_GetLowPowerModeBandgapMode(SPC_Type *base) -{ - return (spc_bandgap_mode_t)(uint32_t)((base->LP_CFG & SPC_LP_CFG_BGMODE_MASK) >> SPC_LP_CFG_BGMODE_SHIFT); -} - -/*! - * @brief Gets the status of all voltage detectors in Low Power mode. - * - * @param base SPC peripheral base address. - * @return The status of all voltage detectors in low power mode. - */ -static inline uint32_t SPC_GetLowPowerModeVoltageDetectStatus(SPC_Type *base) -{ - uint32_t state; - state = base->LP_CFG & ( -#if (defined(FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) && FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) - SPC_LP_CFG_IO_HVDE_MASK | SPC_LP_CFG_IO_LVDE_MASK | - -#endif /* FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD */ - SPC_LP_CFG_SYS_HVDE_MASK | SPC_LP_CFG_SYS_LVDE_MASK | SPC_LP_CFG_CORE_LVDE_MASK - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) - | SPC_LP_CFG_CORE_HVDE_MASK - -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD */ - ); - return state; -} - -/*! - * @brief Enables/Disables Low Power IREF in low power modes. - * - * This function enables/disables Low Power IREF. Low Power IREF can only get - * disabled in Deep power down mode. In other low power modes, the Low Power IREF - * is always enabled. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable Low Power IREF. - * true - Enable Low Power IREF for Low Power modes. - * false - Disable Low Power IREF for Deep Power Down mode. - */ -static inline void SPC_EnableLowPowerModeLowPowerIREF(SPC_Type *base, bool enable) -{ - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_LP_IREFEN_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_LP_IREFEN_MASK; - } -} - -/*! - * @brief Configs Bandgap mode in Low Power mode. - * - * @note To disable Bandgap in Low-power mode: - * 1. Disable all LVD's ad HVD's in low power mode; - * 2. Disable Glitch detect in low power mode; - * 3. Configure LDO's and DCDC to low drive strength in low power mode; - * 4. Disable bandgap in low power mode; - * Otherwise, the error status will be reported. - * - * @note Some other system resources(such as PLL, CMP) require bandgap to be enabled, to disable bandgap please - * take care of other system resources. - * - * @param base SPC peripheral base address. - * @param mode The Bandgap mode be selected. - * - * @retval #kStatus_SPC_BandgapModeWrong The bandgap mode setting in Low Power mode is wrong. - * @retval #kStatus_Success Config Bandgap mode in Low Power power mode successful. - */ -status_t SPC_SetLowPowerModeBandgapmodeConfig(SPC_Type *base, spc_bandgap_mode_t mode); - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SRAMLDO_DPD_ON_BIT) && FSL_FEATURE_MCX_SPC_HAS_SRAMLDO_DPD_ON_BIT) -/*! - * @brief Enables/disables SRAM_LDO deep power low power IREF. - * - * @param base SPC peripheral base address. - * @param enable Used to enable/disable low power IREF : - * - \b true: Low Power IREF is enabled ; - * - \b false: Low Power IREF is disabled for power saving. - */ -static inline void SPC_EnableSRAMLdOLowPowerModeIREF(SPC_Type *base, bool enable) -{ - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_SRAMLDO_DPD_ON_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_SRAMLDO_DPD_ON_MASK; - } -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_SRAMLDO_DPD_ON_BIT */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) -/*! - * @brief Enables/Disables CMP Bandgap Buffer. - * - * This function gates CMP bandgap buffer. CMP bandgap buffer is automatically disabled and turned off - * in Deep Power Down mode. - * - * @deprecated No longer used, please use SPC_EnableLowPowerModeCMPBandgapBuffer as instead. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable CMP Bandgap buffer. - * true - Enable Buffer Stored Reference Voltage to CMP. - * false - Disable Buffer Stored Reference Voltage to CMP. - */ -static inline void SPC_EnableLowPowerModeCMPBandgapBufferMode(SPC_Type *base, bool enable) -{ - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_LPBUFF_EN_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_LPBUFF_EN_MASK; - } -} - -/*! - * @brief Enables/Disables CMP Bandgap Buffer. - * - * This function gates CMP bandgap buffer. CMP bandgap buffer is automatically disabled and turned off - * in Deep Power Down mode. - * - * @deprecated No longer used. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable CMP Bandgap buffer. - * true - Enable Buffer Stored Reference Voltage to CMP. - * false - Disable Buffer Stored Reference Voltage to CMP. - */ -static inline void SPC_EnableLowPowerModeCMPBandgapBuffer(SPC_Type *base, bool enable) -{ - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_LPBUFF_EN_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_LPBUFF_EN_MASK; - } -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT) -/*! - * @brief Enables/Disables CORE VDD IVS(Internal Voltage Scaling) in power down modes. - * - * This function gates CORE VDD IVS. When enabled, the IVS regulator will scale the - * external input CORE VDD to a lower voltage level to reduce internal leakage. - * IVS is invalid in Sleep or Deep power down mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable IVS. - * true - enable CORE VDD IVS in Power Down mode. - * false - disable CORE VDD IVS in Power Down mode. - */ -static inline void SPC_EnableLowPowerModeCoreVDDInternalVoltageScaling(SPC_Type *base, bool enable) -{ - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_COREVDD_IVS_EN_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_COREVDD_IVS_EN_MASK; - } -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT */ - -/*! - * @brief Sets the delay when exit the low power modes. - * - * @param base SPC peripheral base address. - * @param delay The number of SPC timer clock cycles that the SPC waits on exit from low power modes. - */ -static inline void SPC_SetLowPowerWakeUpDelay(SPC_Type *base, uint16_t delay) -{ - base->LPWKUP_DELAY = SPC_LPWKUP_DELAY_LPWKUP_DELAY(delay); -} - -/*! - * @brief Configs all settings of regulators in Low power mode at a time. - * - * @note This function is used to overwrite all settings of regulators(including bandgap mode, regulators' - * drive strength and voltage level) in low power mode at a time. - * - * @note Enable/disable LVDs/HVDs before invoking this function. - * - * @note This function will check input parameters based on hardware restrictions before setting registers, if input - * parameters do not satisfy hardware restrictions the specific error will be reported. - * - * @note Some hardware restrictions not covered, application should be aware of this and follow this hardware - * restrictions otherwise some unkown issue may occur: - * 1. If Core LDO's drive strength are set to same value in both Active mode and low power mode, - * the voltage level should also set to same value. - * 2. When switching Core LDO's drive strength from low to normal, ensure the LDO_CORE high voltage level is set - * to same level that was set prior to switching to the LDO_CORE drive strength. Otherwise, if the LVDs are - * enabled, an unexpected LVD can occur. - * - * @note If this function can not satisfy some tricky settings, please invoke other APIs in low-level function group. - * - * @param base SPC peripheral base address. - * @param config Pointer to spc_lowpower_mode_regulators_config_t structure. - * @retval #kStatus_Success Config regulators in Low power mode successful. - * @retval #kStatus_SPC_BandgapModeWrong The bandgap should not be disabled based on input settings. - * @retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore Set driver strength to low will be ignored. - * @retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Set driver strength to low will be ignored. - * @retval #kStatus_SPC_CORELDOVoltageWrong Core LDO and System LDO do not have same voltage level. - */ -status_t SPC_SetLowPowerModeRegulatorsConfig(SPC_Type *base, const spc_lowpower_mode_regulators_config_t *config); - -#if !(defined(FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) && FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) -/*! - * @brief Disable/Enable VDD Core Glitch Detect in low power mode. - * - * @note State of glitch detect disable feature will be ignored if bandgap is disabled and - * glitch detect hardware will be forced to OFF state. - * - * @param base SPC peripheral base address. - * @param disable Used to disable/enable VDD Core Glitch detect feature. - * - \b true Disable VDD Core Low Voltage detect; - * - \b false Enable VDD Core Low Voltage detect. - */ -static inline void SPC_DisableLowPowerModeVddCoreGlitchDetect(SPC_Type *base, bool disable) -{ - if (disable) - { - base->LP_CFG |= SPC_LP_CFG_GLITCH_DETECT_DISABLE_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_GLITCH_DETECT_DISABLE_MASK; - } -} - -/*! - * @brief Check if Glitch detect hardware is enabled in low power mode. - * - * @param base SPC peripheral base address. - * @return Indicate if Glitch detector is enabled. - */ -static inline bool SPC_CheckLowPowerModeVddCoreGlitchDetectEnabled(SPC_Type *base) -{ - if ((base->LP_CFG & SPC_LP_CFG_GLITCH_DETECT_DISABLE_MASK) == 0UL) - { - return true; - } - else - { - return false; - } -} -#endif - -/*! - * @brief Enables analog modules in low power modes. - * - * @param base SPC peripheral base address. - * @param maskValue The mask of analog modules to enable in low power modes, should be OR'ed value - of @ref spc_analog_module_control. - */ -static inline void SPC_EnableLowPowerModeAnalogModules(SPC_Type *base, uint32_t maskValue) -{ - base->LP_CFG1 |= SPC_LP_CFG1_SOC_CNTRL(maskValue); -} - -/*! - * @brief Disables analog modules in low power modes. - * - * @param base SPC peripheral base address. - * @param maskValue The mask of analog modules to disable in low power modes, should be OR'ed value - of @ref spc_analog_module_control. - */ -static inline void SPC_DisableLowPowerModeAnalogModules(SPC_Type *base, uint32_t maskValue) -{ - base->LP_CFG1 &= ~SPC_LP_CFG1_SOC_CNTRL(maskValue); -} - -/*! - * @brief Gets enabled analog modules that enabled in low power modes. - * - * @param base SPC peripheral base address. - * - * @return The mask of enabled analog modules that enabled in low power modes. - */ -static inline uint32_t SPC_GetLowPowerModeEnabledAnalogModules(SPC_Type *base) -{ - return base->LP_CFG1; -} - -/*! @} */ - -/*! - * @name Voltage Detect Status - * @{ - */ -/*! - * @brief Get Voltage Detect Status Flags. - * - * @param base SPC peripheral base address. - * @return Voltage Detect Status Flags. See @ref _spc_voltage_detect_flags for details. - */ -static inline uint8_t SPC_GetVoltageDetectStatusFlag(SPC_Type *base) -{ - return (uint8_t)(base->VD_STAT); -} - -/*! - * @brief Clear Voltage Detect Status Flags. - * - * @param base SPC peripheral base address. - * @param mask The mask of the voltage detect status flags. See @ref _spc_voltage_detect_flags for details. - */ -static inline void SPC_ClearVoltageDetectStatusFlag(SPC_Type *base, uint8_t mask) -{ - base->VD_STAT |= mask; -} - -/*! @} */ - -/*! - * @name Voltage Detect configuration for Core voltage domain. - * @{ - */ - -/*! - * @brief Configs CORE voltage detect options. - * - * @note: Setting both the voltage detect interrupt and reset - * enable will cause interrupt to be generated on exit from reset. - * If those conditioned is not desired, interrupt/reset so only one is enabled. - * - * @param base SPC peripheral base address. - * @param config Pointer to spc_core_voltage_detect_config_t structure. - */ -void SPC_SetCoreVoltageDetectConfig(SPC_Type *base, const spc_core_voltage_detect_config_t *config); - -/*! - * @brief Locks Core voltage detect reset setting. - * - * This function locks core voltage detect reset setting. After invoking this function - * any configuration of Core voltage detect reset will be ignored. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_LockCoreVoltageDetectResetSetting(SPC_Type *base) -{ - base->VD_CORE_CFG |= SPC_VD_CORE_CFG_LOCK_MASK; -} - -/*! - * @brief Unlocks Core voltage detect reset setting. - * - * This function unlocks core voltage detect reset setting. If locks the Core - * voltage detect reset setting, invoking this function to unlock. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_UnlockCoreVoltageDetectResetSetting(SPC_Type *base) -{ - base->VD_CORE_CFG &= ~SPC_VD_CORE_CFG_LOCK_MASK; -} - -/*! - * @brief Enables/Disables the Core Low Voltage Detector in Active mode. - * - * @note If the CORE_LDO low voltage detect is enabled in Active mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable Core LVD. - * true - Enable Core Low voltage detector in active mode. - * false - Disable Core Low voltage detector in active mode. - * - * @retval #kStatus_Success Enable/Disable Core Low Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeCoreLowVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disables the Core Low Voltage Detector in Low Power mode. - * - * This function enables/disables the Core Low Voltage Detector. - * If enabled the Core Low Voltage detector. The Bandgap mode in - * low power mode must be programmed so that Bandgap is enabled. - * - * @note If the CORE_LDO low voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Low Power mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable Core HVD. - * true - Enable Core Low voltage detector in low power mode. - * false - Disable Core Low voltage detector in low power mode. - * - * @retval #kStatus_Success Enable/Disable Core Low Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeCoreLowVoltageDetect(SPC_Type *base, bool enable); - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) -/*! - * @brief Enables/Disables the Core High Voltage Detector in Active mode. - * - * @note If the CORE_LDO high voltage detect is enabled in Active mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable Core HVD. - * true - Enable Core High voltage detector in active mode. - * false - Disable Core High voltage detector in active mode. - * - * @retval #kStatus_Success Enable/Disable Core High Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeCoreHighVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disables the Core High Voltage Detector in Low Power mode. - * - * This function enables/disables the Core High Voltage Detector. - * If enabled the Core High Voltage detector. The Bandgap mode in - * low power mode must be programmed so that Bandgap is enabled. - * - * @note If the CORE_LDO high voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in low power mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable Core HVD. - * true - Enable Core High voltage detector in low power mode. - * false - Disable Core High voltage detector in low power mode. - * - * @retval #kStatus_Success Enable/Disable Core High Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeCoreHighVoltageDetect(SPC_Type *base, bool enable); -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD */ - -/*! @} */ - -/*! - * @name Voltage detect configuration for System Voltage domain - * @{ - */ -/*! - * @brief Set system VDD Low-voltage level selection. - * - * This function selects the system VDD low-voltage level. Changing system VDD low-voltage level - * must be done after disabling the System VDD low voltage reset and interrupt. - * - * @deprecated In latest RM, reserved for all devices, will removed in next release. - * - * @param base SPC peripheral base address. - * @param level System VDD Low-Voltage level selection. - */ -void SPC_SetSystemVDDLowVoltageLevel(SPC_Type *base, spc_low_voltage_level_select_t level); - -/*! - * @brief Configs SYS voltage detect options. - * - * This function config SYS voltage detect options. - * @note: Setting both the voltage detect interrupt and reset - * enable will cause interrupt to be generated on exit from reset. - * If those conditioned is not desired, interrupt/reset so only one is enabled. - * - * @param base SPC peripheral base address. - * @param config Pointer to spc_system_voltage_detect_config_t structure. - */ -void SPC_SetSystemVoltageDetectConfig(SPC_Type *base, const spc_system_voltage_detect_config_t *config); - -/*! - * @brief Lock System voltage detect reset setting. - * - * This function locks system voltage detect reset setting. After invoking this function - * any configuration of System Voltage detect reset will be ignored. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_LockSystemVoltageDetectResetSetting(SPC_Type *base) -{ - base->VD_SYS_CFG |= SPC_VD_SYS_CFG_LOCK_MASK; -} - -/*! - * @brief Unlock System voltage detect reset setting. - * - * This function unlocks system voltage detect reset setting. If locks the System - * voltage detect reset setting, invoking this function to unlock. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_UnlockSystemVoltageDetectResetSetting(SPC_Type *base) -{ - base->VD_SYS_CFG &= ~SPC_VD_SYS_CFG_LOCK_MASK; -} - -/*! - * @brief Enables/Disables the System High Voltage Detector in Active mode. - * - * @note If the System_LDO high voltage detect is enabled in Active mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Active mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable System HVD. - * true - Enable System High voltage detector in active mode. - * false - Disable System High voltage detector in active mode. - * - * @retval #kStatus_Success Enable/Disable System High Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeSystemHighVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disable the System Low Voltage Detector in Active mode. - * - * @note If the System_LDO low voltage detect is enabled in Active mode, - * please note that the bandgap must be enabled and the drive strength of each - * regulator must not set to low in Active mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable System LVD. - * true - Enable System Low voltage detector in active mode. - * false - Disable System Low voltage detector in active mode. - * - * @retval #kStatus_Success Enable/Disable the System Low Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeSystemLowVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disables the System High Voltage Detector in Low Power mode. - * - * @note If the System_LDO high voltage detect is enabled in Low Power mode, please note - * that the bandgap must be enabled and the drive strength of each regulator must - * not set to low in Low Power mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable System HVD. - * true - Enable System High voltage detector in low power mode. - * false - Disable System High voltage detector in low power mode. - * - * @retval #kStatus_Success Enable/Disable System High Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeSystemHighVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disables the System Low Voltage Detector in Low Power mode. - * - * @note If the System_LDO low voltage detect is enabled in Low Power mode, - * please note that the bandgap must be enabled and the drive strength of each - * regulator must not set to low in Low Power mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable System HVD. - * true - Enable System Low voltage detector in low power mode. - * false - Disable System Low voltage detector in low power mode. - * - * @retval #kStatus_Success Enables System Low Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeSystemLowVoltageDetect(SPC_Type *base, bool enable); - -/*! @} */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) && FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) -/*! - * @name Voltage detect configuration for IO voltage domain - * @{ - */ -/*! - * @brief Set IO VDD Low-Voltage level selection. - * - * This function selects the IO VDD Low-voltage level. Changing IO VDD low-voltage level - * must be done after disabling the IO VDD low voltage reset and interrupt. - * - * @param base SPC peripheral base address. - * @param level IO VDD Low-voltage level selection. - */ -void SPC_SetIOVDDLowVoltageLevel(SPC_Type *base, spc_low_voltage_level_select_t level); - -/*! - * @brief Configs IO voltage detect options. - * - * This function config IO voltage detect options. - * @note: Setting both the voltage detect interrupt and reset - * enable will cause interrupt to be generated on exit from reset. - * If those conditioned is not desired, interrupt/reset so only one is enabled. - * - * @param base SPC peripheral base address. - * @param config Pointer to spc_voltage_detect_config_t structure. - */ -void SPC_SetIOVoltageDetectConfig(SPC_Type *base, const spc_io_voltage_detect_config_t *config); - -/*! - * @brief Lock IO Voltage detect reset setting. - * - * This function locks IO voltage detect reset setting. After invoking this function - * any configuration of system voltage detect reset will be ignored. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_LockIOVoltageDetectResetSetting(SPC_Type *base) -{ - base->VD_IO_CFG |= SPC_VD_IO_CFG_LOCK_MASK; -} - -/*! - * @brief Unlock IO voltage detect reset setting. - * - * This function unlocks IO voltage detect reset setting. If locks the IO - * voltage detect reset setting, invoking this function to unlock. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_UnlockIOVoltageDetectResetSetting(SPC_Type *base) -{ - base->VD_IO_CFG &= ~SPC_VD_IO_CFG_LOCK_MASK; -} - -/*! - * @brief Enables/Disables the IO High Voltage Detector in Active mode. - * - * @note If the IO high voltage detect is enabled in Active mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Active mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable IO HVD. - * true - Enable IO High voltage detector in active mode. - * false - Disable IO High voltage detector in active mode. - * - * @retval #kStatus_Success Enable/Disable IO High Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeIOHighVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disables the IO Low Voltage Detector in Active mode. - * - * @note If the IO low voltage detect is enabled in Active mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Active mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable IO LVD. - * true - Enable IO Low voltage detector in active mode. - * false - Disable IO Low voltage detector in active mode. - * - * @retval #kStatus_Success Enable IO Low Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeIOLowVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disables the IO High Voltage Detector in Low Power mode. - * - * @note If the IO high voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Low Power mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable IO HVD. - * true - Enable IO High voltage detector in low power mode. - * false - Disable IO High voltage detector in low power mode. - * - * @retval #kStatus_Success Enable IO High Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeIOHighVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disables the IO Low Voltage Detector in Low Power mode. - * - * @note If the IO low voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Low Power mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable IO LVD. - * true - Enable IO Low voltage detector in low power mode. - * false - Disable IO Low voltage detector in low power mode. - * - * @retval #kStatus_Success Enable/Disable IO Low Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeIOLowVoltageDetect(SPC_Type *base, bool enable); - -/*! @} */ - -#endif /* FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD */ - -/*! - * @name External Voltage domains configuration - * @{ - */ -/*! - * @brief Configs external voltage domains - * - * This function configs external voltage domains isolation. - * - * @param base SPC peripheral base address. - * @param lowPowerIsoMask The mask of external domains isolate enable during low power mode. Please read the Reference - * Manual for the Bitmap. - * @param IsoMask The mask of external domains isolate. Please read the Reference Manual for the Bitmap. - */ -void SPC_SetExternalVoltageDomainsConfig(SPC_Type *base, uint8_t lowPowerIsoMask, uint8_t IsoMask); - -/*! - * @brief Gets External Domains status. - * - * @param base SPC peripheral base address. - * @return The status of each external domain. - */ -static inline uint8_t SPC_GetExternalDomainsStatus(SPC_Type *base) -{ - return (uint8_t)(base->EVD_CFG >> SPC_EVD_CFG_REG_EVDSTAT_SHIFT); -} - -/*! @} */ - -/*! - * @name Low Level APIs To Set CORE LDO Regulator - * @{ - */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_CNTRL_REG) && FSL_FEATURE_MCX_SPC_HAS_CNTRL_REG) -/*! - * @brief Enable/Disable Core LDO regulator. - * - * @note The CORE LDO enable bit is write-once. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable CORE LDO Regulator. - * true - Enable CORE LDO Regulator. - * false - Disable CORE LDO Regulator. - */ -static inline void SPC_EnableCoreLDORegulator(SPC_Type *base, bool enable) -{ - if (enable) - { - base->CNTRL |= SPC_CNTRL_CORELDO_EN_MASK; - } - else - { - /* - * $Branch Coverage Justification$ - * If CORE_LDO is disabled, all RAMs data will powered off. - */ - base->CNTRL &= ~SPC_CNTRL_CORELDO_EN_MASK; - } -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_CNTRL_REG */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DPDOWN_PULLDOWN_DISABLE_BIT) && \ - FSL_FEATURE_MCX_SPC_HAS_DPDOWN_PULLDOWN_DISABLE_BIT) -/*! - * @brief Enable/Disable the CORE LDO Regulator pull down in Deep Power Down. - * - * @note This function only useful when enabled the CORE LDO Regulator. - * - * @param base SPC peripheral base address. - * @param pulldown Enable/Disable CORE LDO pulldown in Deep Power Down mode. - * true - CORE LDO Regulator will discharge in Deep Power Down mode. - * false - CORE LDO Regulator will not discharge in Deep Power Down mode. - */ -static inline void SPC_PullDownCoreLDORegulator(SPC_Type *base, bool pulldown) -{ - if (pulldown) - { - base->CORELDO_CFG &= ~SPC_CORELDO_CFG_DPDOWN_PULLDOWN_DISABLE_MASK; - } - else - { - base->CORELDO_CFG |= SPC_CORELDO_CFG_DPDOWN_PULLDOWN_DISABLE_MASK; - } -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_DPDOWN_PULLDOWN_DISABLE_BIT */ - -/*! - * @brief Configs Core LDO Regulator in Active mode. - * - * @note The bandgap must be enabled before invoking this function. - * @note To set Core LDO as low drive strength, all HVDs/LVDs must be disabled previously. - * - * @param base SPC peripheral base address. - * @param option Pointer to the spc_active_mode_core_ldo_option_t structure. - * - * @retval kStatus_Success Config Core LDO regulator in Active power mode successful. - * @retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * @retval kStatus_SPC_BandgapModeWrong Bandgap should be enabled before invoking this function. - * @retval kStatus_SPC_CORELDOLowDriveStrengthIgnore To set Core LDO as low drive strength, - * all LVDs/HVDs must be disabled before invoking this function. - */ -status_t SPC_SetActiveModeCoreLDORegulatorConfig(SPC_Type *base, const spc_active_mode_core_ldo_option_t *option); - -/*! - * @brief Set Core LDO Regulator Voltage level in Active mode. - * - * @param base SPC peripheral base address. - * @param voltageLevel Specify the voltage level of CORE LDO Regulator in Active mode, please - refer to @ref spc_core_ldo_voltage_level_t. - * - * @note In active mode, the Core LDO voltage level should only be changed when the - * Core LDO is in normal drive strength. - * - * @note Update Core LDO voltage level will set Busy flag, - * this function return only when busy flag is cleared by hardware - * - * @retval kStatus_SPC_CORELDOVoltageSetFail The drive strength of Core LDO is not normal. - * @retval kStatus_Success Set Core LDO regulator voltage level in Active power mode successful. - */ -status_t SPC_SetActiveModeCoreLDORegulatorVoltageLevel(SPC_Type *base, spc_core_ldo_voltage_level_t voltageLevel); - -/*! - * @brief Gets CORE LDO Regulator Voltage level. - * - * This function returns the voltage level of CORE LDO Regulator in Active mode. - * - * @param base SPC peripheral base address. - * @return Voltage level of CORE LDO in type of @ref spc_core_ldo_voltage_level_t enumeration. - */ -static inline spc_core_ldo_voltage_level_t SPC_GetActiveModeCoreLDOVDDVoltageLevel(SPC_Type *base) -{ - return (spc_core_ldo_voltage_level_t)(uint32_t)((base->ACTIVE_CFG & SPC_ACTIVE_CFG_CORELDO_VDD_LVL_MASK) >> - SPC_ACTIVE_CFG_CORELDO_VDD_LVL_SHIFT); -} - -#if (defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) -/*! - * @brief Set Core LDO VDD Regulator Drive Strength in Active mode. - * - * @param base SPC peripheral base address. - * @param driveStrength Specify the drive strength of CORE LDO Regulator in Active mode, please - refer to @ref spc_core_ldo_drive_strength_t. - * - * @retval #kStatus_Success Set Core LDO regulator drive strength in Active power mode successful. - * @retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore If any voltage detect enabled, - core_ldo's drive strength can not set to low. - * @retval #kStatus_SPC_BandgapModeWrong The selected bandgap mode is not allowed. - */ -status_t SPC_SetActiveModeCoreLDORegulatorDriveStrength(SPC_Type *base, spc_core_ldo_drive_strength_t driveStrength); - -/*! - * @brief Gets CORE LDO VDD Regulator Drive Strength in Active mode. - * - * @param base SPC peripheral base address. - * @return Drive Strength of CORE LDO regulator in Active mode, please refer to @ref spc_core_ldo_drive_strength_t. - */ -static inline spc_core_ldo_drive_strength_t SPC_GetActiveModeCoreLDODriveStrength(SPC_Type *base) -{ - return (spc_core_ldo_drive_strength_t)(uint32_t)((base->ACTIVE_CFG & SPC_ACTIVE_CFG_CORELDO_VDD_DS_MASK) >> - SPC_ACTIVE_CFG_CORELDO_VDD_DS_SHIFT); -} -#endif /* defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - -/*! - * @brief Configs CORE LDO Regulator in low power mode - * - * This function configs CORE LDO Regulator in Low Power mode. - * If CORE LDO VDD Drive Strength is set to Normal, the CORE LDO VDD regulator voltage - * level in Active mode must be equal to the voltage level in Low power mode. And the Bandgap - * must be programmed to select bandgap enabled. - * Core VDD voltage levels for the Core LDO low power regulator can only be changed when the CORE - * LDO Drive Strength set as Normal. - * - * @param base SPC peripheral base address. - * @param option Pointer to the spc_lowpower_mode_core_ldo_option_t structure. - * - * @retval #kStatus_Success Config Core LDO regulator in power mode successfully. - * @retval #kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * @retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore Set driver strength to low will be ignored. - * @retval #kStatus_SPC_CORELDOVoltageSetFail. Fail to change Core LDO voltage level. - */ -status_t SPC_SetLowPowerModeCoreLDORegulatorConfig(SPC_Type *base, const spc_lowpower_mode_core_ldo_option_t *option); - -/*! - * @brief Set Core LDO VDD Regulator Voltage level in Low power mode. - * - * @note If CORE LDO's drive strength is set to Normal, the CORE LDO VDD regulator voltage in active mode and low power - * mode must be same. - * @note Voltage level for the CORE LDO in low power mode can only be changed when the CORE LDO Drive Strength set as - * Normal. - * - * @param base SPC peripheral base address. - * @param voltageLevel Voltage level of CORE LDO Regulator in Low power mode, please - refer to @ref spc_core_ldo_voltage_level_t. - * - * @retval #kStatus_SPC_CORELDOVoltageWrong Voltage level in active mode and low power mode is not same. - * @retval #kStatus_Success Set Core LDO regulator voltage level in Low power mode successful. - * @retval #kStatus_SPC_CORELDOVoltageSetFail Fail to update voltage level because drive strength is incorrect. - */ -status_t SPC_SetLowPowerModeCoreLDORegulatorVoltageLevel(SPC_Type *base, spc_core_ldo_voltage_level_t voltageLevel); - -/*! - * @brief Gets the CORE LDO VDD Regulator Voltage Level for Low Power modes. - * - * @param base SPC peripheral base address. - * @return The CORE LDO VDD Regulator's voltage level. - */ -static inline spc_core_ldo_voltage_level_t SPC_GetLowPowerCoreLDOVDDVoltageLevel(SPC_Type *base) -{ - return ((spc_core_ldo_voltage_level_t)(uint32_t)((base->LP_CFG & SPC_LP_CFG_CORELDO_VDD_LVL_MASK) >> - SPC_LP_CFG_CORELDO_VDD_LVL_SHIFT)); -} - -/*! - * @brief Set Core LDO VDD Regulator Drive Strength in Low power mode. - * - * @param base SPC peripheral base address. - * @param driveStrength Specify drive strength of CORE LDO in low power mode. - * - * @retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore Some voltage detect enabled, CORE LDO's drive strength can not set - * as low. - * @retval #kStatus_Success Set Core LDO regulator drive strength in Low power mode successful. - * @retval #kStatus_SPC_BandgapModeWrong Bandgap is disabled when attempt to set CORE LDO work as normal drive strength. - */ -status_t SPC_SetLowPowerModeCoreLDORegulatorDriveStrength(SPC_Type *base, spc_core_ldo_drive_strength_t driveStrength); - -/*! - * @brief Gets CORE LDO VDD Drive Strength for Low Power modes. - * - * @param base SPC peripheral base address. - * @return The CORE LDO's VDD Drive Strength. - */ -static inline spc_core_ldo_drive_strength_t SPC_GetLowPowerCoreLDOVDDDriveStrength(SPC_Type *base) -{ - return (spc_core_ldo_drive_strength_t)(uint32_t)((base->LP_CFG & SPC_LP_CFG_CORELDO_VDD_DS_MASK) >> - SPC_LP_CFG_CORELDO_VDD_DS_SHIFT); -} - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) -/*! - * @name Low Level APIs To Set System LDO Regulator - * @{ - */ - -/*! - * @brief Enable/Disable System LDO regulator. - * - * @note The SYSTEM LDO enable bit is write-once. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable System LDO Regulator. - * true - Enable System LDO Regulator. - * false - Disable System LDO Regulator. - */ -static inline void SPC_EnableSystemLDORegulator(SPC_Type *base, bool enable) -{ - if (enable) - { - base->CNTRL |= SPC_CNTRL_SYSLDO_EN_MASK; - } - else - { - /* - * $Branch Coverage Justification$ - * If SYSTEM_LDO is disabled, may cause some unexpected issues. - */ - base->CNTRL &= ~SPC_CNTRL_SYSLDO_EN_MASK; - } -} - -/*! - * @brief Enable/Disable current sink feature of System LDO Regulator. - * - * @param base SPC peripheral base address. - * @param sink Enable/Disable current sink feature. - * true - Enable current sink feature of System LDO Regulator. - * false - Disable current sink feature of System LDO Regulator. - */ -static inline void SPC_EnableSystemLDOSinkFeature(SPC_Type *base, bool sink) -{ - if (sink) - { - base->SYSLDO_CFG |= SPC_SYSLDO_CFG_ISINKEN_MASK; - } - else - { - base->SYSLDO_CFG &= ~SPC_SYSLDO_CFG_ISINKEN_MASK; - } -} - -/*! - * @brief Configs System LDO VDD Regulator in Active mode. - * - * @note If System LDO VDD Drive Strength is set to Normal, the Bandgap mode in Active mode must be programmed - * to a value that enables the bandgap. - * @note If any voltage detects are kept enabled, configuration to set System LDO VDD drive strength to low will - * be ignored. - * @note If select System LDO VDD Regulator voltage level to Over Drive Voltage, the Drive Strength of System LDO VDD - * Regulator must be set to Normal otherwise the regulator Drive Strength will be forced to Normal. - * @note If select System LDO VDD Regulator voltage level to Over Drive Voltage, the High voltage detect must be - * disabled. Otherwise it will be fail to regulator to Over Drive Voltage. - * - * @param base SPC peripheral base address. - * @param option Pointer to the spc_active_mode_sys_ldo_option_t structure. - * - * @retval #kStatus_Success Config System LDO regulator in Active power mode successful. - * @retval #kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * @retval #kStatus_SPC_BandgapModeWrong The bandgap is not enabled before invoking this function. - * @retval #kStatus_SPC_SYSLDOOverDriveVoltageFail HVD of System VDD is not disable before setting to Over Drive - * voltage. - * @retval kStatus_SPC_SYSLDOLowDriveStrengthIgnore Set System LDO VDD regulator's driver strength to Low will be - * ignored. - */ -status_t SPC_SetActiveModeSystemLDORegulatorConfig(SPC_Type *base, const spc_active_mode_sys_ldo_option_t *option); - -/*! - * @brief Set System LDO Regulator voltage level in Active mode. - * - * @note The system LDO regulator can only operate at the overdrive voltage level for a limited amount of time for the - * life of chip. - * - * @param base SPC peripheral base address. - * @param voltageLevel Specify the voltage level of System LDO Regulator in Active mode. - * - * @retval #kStatus_Success Set System LDO Regulator voltage level in Active mode successfully. - * @retval #kStatus_SPC_SYSLDOOverDriveVoltageFail Must disable system LDO high voltage detector before specifing - * overdrive voltage. - */ -status_t SPC_SetActiveModeSystemLDORegulatorVoltageLevel(SPC_Type *base, spc_sys_ldo_voltage_level_t voltageLevel); - -/*! - * @brief Get System LDO Regulator voltage level in Active mode. - * - * @param base SPC peripheral base address. - * @return System LDO Regulator voltage level in Active mode, please refer to @ref spc_sys_ldo_voltage_level_t. - */ -static inline spc_sys_ldo_voltage_level_t SPC_GetActiveModeSystemLDORegulatorVoltageLevel(SPC_Type *base) -{ - return (spc_sys_ldo_voltage_level_t)(uint32_t)((base->ACTIVE_CFG & SPC_ACTIVE_CFG_SYSLDO_VDD_LVL_MASK) >> - SPC_ACTIVE_CFG_SYSLDO_VDD_LVL_SHIFT); -} - -/*! - * @brief Set System LDO Regulator Drive Strength in Active mode. - * - * @param base SPC peripheral base address. - * @param driveStrength Specify the drive strength of System LDO Regulator in Active mode. - * - * @retval #kStatus_Success Set System LDO Regulator drive strength in Active mode successfully. - * @retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Attempt to specify low drive strength is ignored due to any - voltage detect feature is enabled in active mode. - * @retval #kStatus_SPC_BandgapModeWrong Bandgap mode in Active mode must be programmed to a value that enables - the bandgap if attempt to specify normal drive strength. - */ -status_t SPC_SetActiveModeSystemLDORegulatorDriveStrength(SPC_Type *base, spc_sys_ldo_drive_strength_t driveStrength); - -/*! - * @brief Get System LDO Regulator Drive Strength in Active mode. - * - * @param base SPC peripheral base address. - * @return System LDO regulator drive strength in Active mode, please refer to @ref spc_sys_ldo_drive_strength_t. - */ -static inline spc_sys_ldo_drive_strength_t SPC_GetActiveModeSystemLDORegulatorDriveStrength(SPC_Type *base) -{ - return (spc_sys_ldo_drive_strength_t)(uint32_t)((base->ACTIVE_CFG & SPC_ACTIVE_CFG_SYSLDO_VDD_DS_MASK) >> - SPC_ACTIVE_CFG_SYSLDO_VDD_DS_SHIFT); -} - -/*! - * @brief Configs System LDO regulator in low power modes. - * - * This function configs System LDO regulator in low power modes. - * If System LDO VDD Regulator Drive strength is set to normal, bandgap mode in low power - * mode must be programmed to a value that enables the Bandgap. - * If any High voltage detectors or Low Voltage detectors are kept enabled, configuration - * to set System LDO Regulator drive strength as Low will be ignored. - * - * @param base SPC peripheral base address. - * @param option Pointer to spc_lowpower_mode_sys_ldo_option_t structure. - * - * @retval #kStatus_Success Config System LDO regulator in Low Power Mode successfully. - * @retval #kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * @retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Set driver strength to low will be ignored. - */ -status_t SPC_SetLowPowerModeSystemLDORegulatorConfig(SPC_Type *base, const spc_lowpower_mode_sys_ldo_option_t *option); - -/*! - * @brief Set System LDO Regulator drive strength in Low Power Mode. - * - * @param base SPC peripheral base address. - * @param driveStrength Specify the drive strength of System LDO Regulator in Low Power Mode. - * - * @retval #kStatus_Success Set System LDO Regulator drive strength in Low Power Mode successfully. - * @retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Attempt to specify low drive strength is ignored due to any - voltage detect feature is enabled in low power mode. - * @retval #kStatus_SPC_BandgapModeWrong Bandgap mode in low power mode must be programmed to a value that enables - the bandgap if attempt to specify normal drive strength. - */ -status_t SPC_SetLowPowerModeSystemLDORegulatorDriveStrength(SPC_Type *base, spc_sys_ldo_drive_strength_t driveStrength); - -/*! - * @brief Get System LDO Regulator drive strength in Low Power Mode. - * - * @param base SPC peripheral base address. - * @return System LDO regulator drive strength in Low Power Mode, please refer to @ref spc_sys_ldo_drive_strength_t. - */ -static inline spc_sys_ldo_drive_strength_t SPC_GetLowPowerModeSystemLDORegulatorDriveStrength(SPC_Type *base) -{ - return (spc_sys_ldo_drive_strength_t)(uint32_t)((base->LP_CFG & SPC_LP_CFG_SYSLDO_VDD_DS_MASK) >> - SPC_LP_CFG_SYSLDO_VDD_DS_SHIFT); -} -/*! @} */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) -/*! - * @name Low Level APIs To Set DCDC Regulator - * @{ - */ - -/*! - * @brief Enable/Disable DCDC Regulator. - * - * @note The DCDC enable bit is write-once, settings only reset after a POR, LVD, or HVD event. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable DCDC Regulator. - * true - Enable DCDC Regulator. - * false - Disable DCDC Regulator. - */ -static inline void SPC_EnableDCDCRegulator(SPC_Type *base, bool enable) -{ - if (enable) - { - base->CNTRL |= SPC_CNTRL_DCDC_EN_MASK; - } - else - { - /* - * $Branch Coverage Justification$ - * If DCDC is disabled, all RAMs data will powered off. - */ - base->CNTRL &= ~SPC_CNTRL_DCDC_EN_MASK; - } -} - -/*! - * @brief Config DCDC Burst options - * - * @param base SPC peripheral base address. - * @param config Pointer to spc_dcdc_burst_config_t structure. - */ -void SPC_SetDCDCBurstConfig(SPC_Type *base, spc_dcdc_burst_config_t *config); - -/*! - * @brief Trigger a software burst request to DCDC. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_TriggerDCDCBurstRequest(SPC_Type *base) -{ - /* Blocking until previous DCDC burst completed. */ - while ((base->DCDC_BURST_CFG & SPC_DCDC_BURST_CFG_BURST_ACK_MASK) == 0UL) - { - } - - base->DCDC_BURST_CFG |= SPC_DCDC_BURST_CFG_BURST_REQ_MASK; -} - -/*! - * @brief Check if burst acknowlege flag is asserted. - * - * @param base SPC peripheral base address. - * - * @retval false DCDC burst not complete. - * @retval true DCDC burst complete. - */ -static inline bool SPC_CheckDCDCBurstAck(SPC_Type *base) -{ - return ((base->DCDC_BURST_CFG & SPC_DCDC_BURST_CFG_BURST_ACK_MASK) != 0UL); -} - -/*! - * @brief Clear DCDC busrt acknowledge flag. - * - * @param base SPC periphral base address. - */ -static inline void SPC_ClearDCDCBurstAckFlag(SPC_Type *base) -{ - base->DCDC_BURST_CFG |= SPC_DCDC_BURST_CFG_BURST_ACK_MASK; -} - -/*! - * @brief Set the count value of the reference clock to configure the period of DCDC not active. - * - * @note This function is only useful when DCDC's drive strength is set as pulse refresh. - * @note The pulse duration(time between on and off) is: reference clock period * (count + 2). - * - * @param base SPC peripheral base address. - * @param count The count value, 16 bit width. - */ -void SPC_SetDCDCRefreshCount(SPC_Type *base, uint16_t count); - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC_CFG_BLEED_EN) && FSL_FEATURE_MCX_SPC_HAS_DCDC_CFG_BLEED_EN) -/*! - * @brief Enable a bleed resistor to discharge DCDC output when DCDC is disabled. - * - * @param base SPC peripheral base address. - * @param enable Used to enable/disable bleed resistor. - */ -static inline void SPC_EnableDCDCBleedResistor(SPC_Type *base, bool enable) -{ - if (enable) - { - base->DCDC_CFG |= SPC_DCDC_CFG_BLEED_EN_MASK; - } - else - { - base->DCDC_CFG &= ~SPC_DCDC_CFG_BLEED_EN_MASK; - } -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC_CFG_BLEED_EN */ - -/*! - * @brief Configs DCDC_CORE Regulator in Active mode. - * - * @note When changing the DCDC output voltage level, take care to change the CORE LDO voltage level. - * - * @param base SPC peripheral base address. - * @param option Pointer to the spc_active_mode_dcdc_option_t structure. - * - * @retval #kStatus_Success Config DCDC regulator in Active power mode successful. - * @retval #kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * @retval #kStatus_SPC_BandgapModeWrong Set DCDC_CORE Regulator drive strength to Normal, the Bandgap must be enabled. - */ -status_t SPC_SetActiveModeDCDCRegulatorConfig(SPC_Type *base, const spc_active_mode_dcdc_option_t *option); - -/*! - * @brief Set DCDC_CORE Regulator voltage level in Active mode. - * - * @note When changing the DCDC output voltage level, take care to change the CORE LDO voltage level. - * - * @param base SPC peripheral base address. - * @param voltageLevel Specify the DCDC_CORE Regulator voltage level, please refer to @ref spc_dcdc_voltage_level_t. - */ -static inline void SPC_SetActiveModeDCDCRegulatorVoltageLevel(SPC_Type *base, spc_dcdc_voltage_level_t voltageLevel) -{ - base->ACTIVE_CFG = - (base->ACTIVE_CFG & (~SPC_ACTIVE_CFG_DCDC_VDD_LVL_MASK)) | SPC_ACTIVE_CFG_DCDC_VDD_LVL(voltageLevel); -} - -/*! - * @brief Get DCDC_CORE Regulator voltage level in Active mode. - * - * @param base SPC peripheral base address. - * @return DCDC_CORE Regulator voltage level, please refer to @ref spc_dcdc_voltage_level_t. - */ -static inline spc_dcdc_voltage_level_t SPC_GetActiveModeDCDCRegulatorVoltageLevel(SPC_Type *base) -{ - return (spc_dcdc_voltage_level_t)((uint32_t)((base->ACTIVE_CFG & SPC_ACTIVE_CFG_DCDC_VDD_LVL_MASK) >> - SPC_ACTIVE_CFG_DCDC_VDD_LVL_SHIFT)); -} - -/*! - * @brief Set DCDC_CORE Regulator drive strength in Active mode. - * - * @note To set DCDC drive strength as Normal, the bandgap must be enabled. - * - * @param base SPC peripheral base address. - * @param driveStrength Specify the DCDC_CORE regulator drive strength, please refer to @ref spc_dcdc_drive_strength_t. - * - * @retval #kStatus_Success Set DCDC_CORE Regulator drive strength in Active mode successfully. - * @retval #kStatus_SPC_BandgapModeWrong Set DCDC_CORE Regulator drive strength to Normal, the Bandgap must be enabled. - */ -status_t SPC_SetActiveModeDCDCRegulatorDriveStrength(SPC_Type *base, spc_dcdc_drive_strength_t driveStrength); - -/*! - * @brief Get DCDC_CORE Regulator drive strength in Active mode. - * - * @param base SPC peripheral base address. - * @return DCDC_CORE Regulator drive strength, please refer to @ref spc_dcdc_drive_strength_t. - */ -static inline spc_dcdc_drive_strength_t SPC_GetActiveModeDCDCRegulatorDriveStrength(SPC_Type *base) -{ - return (spc_dcdc_drive_strength_t)((uint32_t)((base->ACTIVE_CFG & SPC_ACTIVE_CFG_DCDC_VDD_DS_MASK) >> - SPC_ACTIVE_CFG_DCDC_VDD_DS_SHIFT)); -} - -/*! - * @brief Configs DCDC_CORE Regulator in Low power modes. - * - * @note If DCDC_CORE Drive Strength is set to Normal, the Bandgap mode in Low Power mode must be programmed - * to a value that enables the Bandgap. - * @note In Deep Power Down mode, DCDC regulator is always turned off. - * - * @param base SPC peripheral base address. - * @param option Pointer to the spc_lowpower_mode_dcdc_option_t structure. - * - * @retval #kStatus_Success Config DCDC regulator in low power mode successfully. - * @retval #kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * @retval #kStatus_SPC_BandgapModeWrong The bandgap mode setting in Low Power mode is wrong. - */ -status_t SPC_SetLowPowerModeDCDCRegulatorConfig(SPC_Type *base, const spc_lowpower_mode_dcdc_option_t *option); - -/*! - * @brief Set DCDC_CORE Regulator drive strength in Low power mode. - * - * @note To set drive strength as normal, the bandgap must be enabled. - * - * @param base SPC peripheral base address. - * @param driveStrength Specify the DCDC_CORE Regulator drive strength, please refer to @ref spc_dcdc_drive_strength_t. - * - * @retval #kStatus_Success Set DCDC_CORE Regulator drive strength in Low power mode successfully. - * @retval #kStatus_SPC_BandgapModeWrong Set DCDC_CORE Regulator drive strength to Normal, the Bandgap must be enabled. - */ -status_t SPC_SetLowPowerModeDCDCRegulatorDriveStrength(SPC_Type *base, spc_dcdc_drive_strength_t driveStrength); - -/*! - * @brief Get DCDC_CORE Regulator drive strength in Low power mode. - * - * @param base SPC peripheral base address. - * @return DCDC_CORE Regulator drive strength, please refer to @ref spc_dcdc_drive_strength_t. - */ -static inline spc_dcdc_drive_strength_t SPC_GetLowPowerModeDCDCRegulatorDriveStrength(SPC_Type *base) -{ - return (spc_dcdc_drive_strength_t)((uint32_t)((base->LP_CFG & SPC_LP_CFG_DCDC_VDD_DS_MASK) >> - SPC_LP_CFG_DCDC_VDD_DS_SHIFT)); -} - -/*! - * @brief Set DCDC_CORE Regulator voltage level in Low power mode. - * - * @note To change DCDC level in Low-Power mode: - * 1. Configure LP_CFG[DCDC_VDD_LVL] to desired level; - * 2. Configure LP_CFG[DCDC_VDD_DS] to low driver strength; - * 3. Configure ACTIVE_CFG[DCDC_VDD_LVL] to same level programmed in #1. - * - * @note After invoking this function, the voltage level in active mode(wakeup from low power modes) also changed, - * if it is necessary, please invoke SPC_SetActiveModeDCDCRegulatorVoltageLevel() to change to desried voltage level. - * - * @param base SPC peripheral base address. - * @param voltageLevel Specify the DCDC_CORE Regulator voltage level, please refer to @ref spc_dcdc_voltage_level_t. - */ -static inline void SPC_SetLowPowerModeDCDCRegulatorVoltageLevel(SPC_Type *base, spc_dcdc_voltage_level_t voltageLevel) -{ - base->LP_CFG = (base->LP_CFG & (~SPC_LP_CFG_DCDC_VDD_LVL_MASK)) | SPC_LP_CFG_DCDC_VDD_LVL(voltageLevel); - (void)SPC_SetLowPowerModeDCDCRegulatorDriveStrength(base, kSPC_DCDC_LowDriveStrength); - SPC_SetActiveModeDCDCRegulatorVoltageLevel(base, voltageLevel); -} - -/*! - * @brief Get DCDC_CORE Regulator voltage level in Low power mode. - * - * @param base SPC peripheral base address. - * @return DCDC_CORE Regulator voltage level, please refer to @ref spc_dcdc_voltage_level_t. - */ -static inline spc_dcdc_voltage_level_t SPC_GetLowPowerModeDCDCRegulatorVoltageLevel(SPC_Type *base) -{ - return (spc_dcdc_voltage_level_t)((uint32_t)((base->LP_CFG & SPC_LP_CFG_DCDC_VDD_LVL_MASK) >> - SPC_LP_CFG_DCDC_VDD_LVL_SHIFT)); -} - -/*! @} */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @} */ - -#endif /* FSL_SPC_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_trdc.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_trdc.c deleted file mode 100644 index b94abe1afbc..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_trdc.c +++ /dev/null @@ -1,854 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_trdc.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.trdc1" -#endif - -/* The memory increment definition in byte of MBC and MRC configuration registers */ -#define TRDC_MRC_DOMAIN_INCREMENT 0x100UL -#define TRDC_MBC_DOMAIN_INCREMENT 0x200UL -/* In latest TRDC register definition this macro has been removed from device header file. Add this for backward - * compatability. */ -#ifndef TRDC_MBC_NSE_BLK_CLR_ALL_DID_SEL -#define TRDC_MBC_NSE_BLK_CLR_ALL_DID_SEL(x) ((uint32_t)(((uint32_t)(x)) << TRDC_MBC_NSE_BLK_CLR_ALL_DID_SEL0_SHIFT)) -#endif -/* Get the memory increment in for each slave inside MBC */ -#define TRDC_MBC_SLAVE_INCREMENT(x) \ - (((x) == 0U) ? (0U) : (((x) == 1U) ? (0x140UL) : (((x) == 2U) ? (0x168UL) : (0x190UL)))) - -typedef union -{ -#if defined(FSL_FEATURE_TRDC_HAS_DOMAIN_ASSIGNMENT) && FSL_FEATURE_TRDC_HAS_DOMAIN_ASSIGNMENT - trdc_processor_domain_assignment_t _processor_domain_assignment; - trdc_non_processor_domain_assignment_t _non_processor_domain_assignment; - trdc_pid_config_t _pid_config; -#endif -#if defined(FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG) && FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG - trdc_idau_config_t _idau_config; -#endif -#if (defined(FSL_FEATURE_TRDC_HAS_MBC) && FSL_FEATURE_TRDC_HAS_MBC) || \ - (defined(FSL_FEATURE_TRDC_HAS_MRC) && FSL_FEATURE_TRDC_HAS_MRC) - trdc_memory_access_control_config_t _memory_access_control; -#endif -#if defined(FSL_FEATURE_TRDC_HAS_MBC) && FSL_FEATURE_TRDC_HAS_MBC - trdc_mbc_memory_block_config_t _mbc_memory_blk; - trdc_mbc_nse_update_config_t _mbc_nse_update; -#endif - uint32_t _u32; -} trdc_reg32_convert_t; - -/******************************************************************************* - * Variables - ******************************************************************************/ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/******************************************************************************* - * Code - ******************************************************************************/ -#if defined(FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG) && FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG -/*! - * brief Gets the TRDC hardware configuration. - * - * This function gets the TRDC hardware configurations, including number of bus - * masters, number of domains, number of MRCs and number of PACs. - * - * param base TRDC peripheral base address. - * param config Pointer to the structure to get the configuration. - */ -void TRDC_GetHardwareConfig(TRDC_Type *base, trdc_hardware_config_t *config) -{ - assert(NULL != config); - - config->masterNumber = - (uint8_t)((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NMSTR_MASK) >> TRDC_TRDC_HWCFG0_NMSTR_SHIFT); - config->domainNumber = - (uint8_t)((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NDID_MASK) >> TRDC_TRDC_HWCFG0_NDID_SHIFT); - config->mbcNumber = - (uint8_t)((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NMBC_MASK) >> TRDC_TRDC_HWCFG0_NMBC_SHIFT); - config->mrcNumber = - (uint8_t)((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NMRC_MASK) >> TRDC_TRDC_HWCFG0_NMRC_SHIFT); -} -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_MBC) && FSL_FEATURE_TRDC_HAS_MBC -/*! - * brief Gets the hardware configuration of the one of two slave memories within each MBC(memory block checker). - * - * param base TRDC peripheral base address. - * param config Pointer to the structure to get the configuration. - * param mbcIdx MBC number. - * param slvIdx Slave number. - */ -void TRDC_GetMbcHardwareConfig(TRDC_Type *base, - trdc_slave_memory_hardware_config_t *config, - uint8_t mbcIdx, - uint8_t slvIdx) -{ - assert(NULL != config); -#if defined(TRDC_MBC_COUNT) && TRDC_MBC_COUNT - assert(mbcIdx < (uint8_t)TRDC_MBC_COUNT); -#else - assert(mbcIdx < (uint8_t)((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NMBC_MASK) >> - TRDC_TRDC_HWCFG0_NMBC_SHIFT)); -#endif - assert(slvIdx < 4U); - - config->blockNum = TRDC_MBC_BASE(base, mbcIdx)->MBC_MEM_GLBCFG[slvIdx] & TRDC_MBC_MEM_GLBCFG_NBLKS_MASK; - config->blockSize = (TRDC_MBC_BASE(base, mbcIdx)->MBC_MEM_GLBCFG[slvIdx] & TRDC_MBC_MEM_GLBCFG_SIZE_LOG2_MASK) >> - TRDC_MBC_MEM_GLBCFG_SIZE_LOG2_SHIFT; -} -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_DOMAIN_ASSIGNMENT) && FSL_FEATURE_TRDC_HAS_DOMAIN_ASSIGNMENT -/*! - * brief Gets the default master domain assignment for the processor bus master. - * - * This function gets the default master domain assignment for the processor bus master. - * It should only be used for the processor bus masters, such as CORE0. This function - * sets the assignment as follows: - * - * code - * assignment->domainId = 0U; - * assignment->domainIdSelect = kTRDC_DidMda; - * assignment->lock = 0U; - * endcode - * - * param domainAssignment Pointer to the assignment structure. - */ -void TRDC_GetDefaultProcessorDomainAssignment(trdc_processor_domain_assignment_t *domainAssignment) -{ - assert(NULL != domainAssignment); - - /* Initializes the configure structure to zero. */ - (void)memset(domainAssignment, 0, sizeof(*domainAssignment)); -} - -/*! - * brief Gets the default master domain assignment for non-processor bus master. - * - * This function gets the default master domain assignment for non-processor bus master. - * It should only be used for the non-processor bus masters, such as DMA. This function - * sets the assignment as follows: - * - * code - * assignment->domainId = 0U; - * assignment->privilegeAttr = kTRDC_ForceUser; - * assignment->secureAttr = kTRDC_ForceSecure; - * assignment->bypassDomainId = 0U; - * assignment->lock = 0U; - * endcode - * - * param domainAssignment Pointer to the assignment structure. - */ -void TRDC_GetDefaultNonProcessorDomainAssignment(trdc_non_processor_domain_assignment_t *domainAssignment) -{ - assert(NULL != domainAssignment); - - /* Initializes the configure structure to zero. */ - (void)memset(domainAssignment, 0, sizeof(*domainAssignment)); -} - -/*! - * brief Sets the processor bus master domain assignment. - * - * This function sets the processor master domain assignment as valid. - * One bus master might have multiple domain assignment registers. The parameter - * \p assignIndex specifies which assignment register to set. - * - * Example: Set domain assignment for core 0. - * - * code - * trdc_processor_domain_assignment_t processorAssignment; - * - * TRDC_GetDefaultProcessorDomainAssignment(&processorAssignment); - * - * processorAssignment.domainId = 0; - * processorAssignment.xxx = xxx; - * TRDC_SetMasterDomainAssignment(TRDC, 1, &processorAssignment); - * endcode - * - * param base TRDC peripheral base address. - * param master Which master to configure, refer to trdcx_master_t in processor header file, x is trdc instance. - * param regNum Which register to configure, processor master can have more than one register for the MDAC - * configuration. param domainAssignment Pointer to the assignment structure. - */ -void TRDC_SetProcessorDomainAssignment(TRDC_Type *base, - uint8_t master, - uint8_t regNum, - const trdc_processor_domain_assignment_t *domainAssignment) -{ - /* Make sure the master number does not exceed the max master count. */ - assert(master < - ((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NMSTR_MASK) >> TRDC_TRDC_HWCFG0_NMSTR_SHIFT)); - /* Make sure the master is a processor master. */ - assert(0U == (TRDC_GENERAL_BASE(base)->DACFG[master] & TRDC_DACFG_NCM_MASK)); - assert(NULL != domainAssignment); - assert(domainAssignment->domainId < - ((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NDID_MASK) >> TRDC_TRDC_HWCFG0_NDID_SHIFT)); - - trdc_reg32_convert_t pid; - pid._processor_domain_assignment = *domainAssignment; - TRDC_DOMAIN_ASSIGNMENT_BASE(base)->MDA_DFMT0[master].MDA_W_DFMT0[regNum] = pid._u32 | TRDC_MDA_W_DFMT0_VLD_MASK; -} - -/*! - * brief Sets the non-processor bus master domain assignment. - * - * This function sets the non-processor master domain assignment as valid. - * One bus master might have multiple domain assignment registers. The parameter - * \p assignIndex specifies which assignment register to set. - * - * Example: Set domain assignment for DMA0. - * code - * trdc_non_processor_domain_assignment_t nonProcessorAssignment; - * - * TRDC_GetDefaultNonProcessorDomainAssignment(&nonProcessorAssignment); - * nonProcessorAssignment.domainId = 1; - * nonProcessorAssignment.xxx = xxx; - * - * TRDC_SetMasterDomainAssignment(TRDC, kTrdcMasterDma0, 0U, &nonProcessorAssignment); - * endcode - * - * param base TRDC peripheral base address. - * param master Which master to configure, refer to trdc_master_t in processor header file. - * param domainAssignment Pointer to the assignment structure. - */ -void TRDC_SetNonProcessorDomainAssignment(TRDC_Type *base, - uint8_t master, - const trdc_non_processor_domain_assignment_t *domainAssignment) -{ - /* The master number should be less than the master count. */ - assert(master < - ((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NMSTR_MASK) >> TRDC_TRDC_HWCFG0_NMSTR_SHIFT)); - /* Make sure the master is a non-CPU/non-processor master */ - assert(0U != (TRDC_GENERAL_BASE(base)->DACFG[master] & TRDC_DACFG_NCM_MASK)); - assert(NULL != domainAssignment); - assert(domainAssignment->domainId < - ((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NDID_MASK) >> TRDC_TRDC_HWCFG0_NDID_SHIFT)); - - trdc_reg32_convert_t pid; - pid._non_processor_domain_assignment = *domainAssignment; - - TRDC_DOMAIN_ASSIGNMENT_BASE(base)->MDA_DFMT1[master].MDA_W_DFMT1[0] = pid._u32 | TRDC_MDA_W_DFMT1_VLD_MASK; -} - -/*! - * brief Sets the current Process identifier(PID) for processor core. - * - * Each processor has a corresponding process identifier (PID) which can be used to group tasks into different domains. - * Secure privileged software saves and restores the PID as part of any context switch. - * This data structure defines an array of 32-bit values, one per MDA module, that define the PID. Since this register - * resource is only applicable to processor cores, the data structure is typically sparsely populated. The HWCFG[2-3] - * registers provide a bitmap of the implemented PIDn registers. This data structure is indexed using the corresponding - * MDA instance number. Depending on the operating clock domain of each DAC instance, there may be optional information - * stored in the corresponding PIDm register to properly implement the LK2 = 2 functionality. - * - * param base TRDC peripheral base address. - * param master Which processor master to configure, refer to trdc_master_t in processor header file. - * param pidConfig Pointer to the configuration structure. - */ -void TRDC_SetPid(TRDC_Type *base, uint8_t master, const trdc_pid_config_t *pidConfig) -{ - assert(pidConfig != NULL); - /* The master number should be less than the master count. */ - assert(master < - ((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NMSTR_MASK) >> TRDC_TRDC_HWCFG0_NMSTR_SHIFT)); - /* This master has to be a processor master. */ - assert((TRDC_GENERAL_BASE(base)->DACFG[master] & TRDC_DACFG_NCM_MASK) == 0U); - - trdc_reg32_convert_t pid; - pid._pid_config = *pidConfig; - TRDC_DOMAIN_ASSIGNMENT_BASE(base)->PID[master] = pid._u32; -} -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG) && FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG -/*! - * brief Gets the default IDAU(Implementation-Defined Attribution Unit) configuration. - * - * code - * config->lockSecureVTOR = false; - * config->lockNonsecureVTOR = false; - * config->lockSecureMPU = false; - * config->lockNonsecureMPU = false; - * config->lockSAU = false; - * endcode - * - * param domainAssignment Pointer to the configuration structure. - */ -void TRDC_GetDefaultIDAUConfig(trdc_idau_config_t *idauConfiguration) -{ - assert(NULL != idauConfiguration); - - /* Initializes the configure structure to zero. */ - (void)memset(idauConfiguration, 0, sizeof(*idauConfiguration)); -} - -/*! - * brief Sets the IDAU(Implementation-Defined Attribution Unit) control configuration. - * - * Example: Lock the secure and non-secure MPU registers. - * - * code - * trdc_idau_config_t idauConfiguration; - * - * TRDC_GetDefaultIDAUConfig(&idauConfiguration); - * - * idauConfiguration.lockSecureMPU = true; - * idauConfiguration.lockNonsecureMPU = true; - * TRDC_SetIDAU(TRDC, &idauConfiguration); - * endcode - * - * param base TRDC peripheral base address. - * param domainAssignment Pointer to the configuration structure. - */ -void TRDC_SetIDAU(TRDC_Type *base, const trdc_idau_config_t *idauConfiguration) -{ - assert(NULL != idauConfiguration); - - trdc_reg32_convert_t pid; - pid._idau_config = *idauConfiguration; - - TRDC_GENERAL_BASE(base)->TRDC_IDAU_CR = pid._u32 | TRDC_TRDC_IDAU_CR_VLD_MASK; -} -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_FLW) && FSL_FEATURE_TRDC_HAS_FLW -/*! - * brief Gets the default FLW(Flsh Logical Window) configuration. - * - * code - * config->blockCount = false; - * config->arrayBaseAddr = false; - * config->lock = false; - * config->enable = false; - * endcode - * - * param flwConfiguration Pointer to the configuration structure. - */ -void TRDC_GetDefaultFlashLogicalWindowConfig(trdc_flw_config_t *flwConfiguration) -{ - assert(NULL != flwConfiguration); - - /* Initializes the configure structure to zero. */ - (void)memset(flwConfiguration, 0, sizeof(*flwConfiguration)); - - flwConfiguration->enable = 0x1UL; -} - -/*! - * brief Sets the FLW function's configuration. - * - * code - * trdc_flw_config_t flwConfiguration; - * - * TRDC_GetDefaultIDAUConfig(&flwConfiguration); - * - * flwConfiguration.blockCount = 32U; - * flwConfiguration.arrayBaseAddr = 0xXXXXXXXX; - * TRDC_SetIDAU(TRDC, &flwConfiguration); - * endcode - * - * param base TRDC peripheral base address. - * param flwConfiguration Pointer to the configuration structure. - */ -void TRDC_SetFlashLogicalWindow(TRDC_Type *base, const trdc_flw_config_t *flwConfiguration) -{ - assert(NULL != flwConfiguration); - - TRDC_FLW_BASE(base)->TRDC_FLW_ABASE = flwConfiguration->arrayBaseAddr; - TRDC_FLW_BASE(base)->TRDC_FLW_BCNT = flwConfiguration->blockCount; - TRDC_FLW_BASE(base)->TRDC_FLW_CTL = - TRDC_TRDC_FLW_CTL_V(flwConfiguration->enable) | TRDC_TRDC_FLW_CTL_LK(flwConfiguration->lock); -} -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_DOMAIN_ERROR) && FSL_FEATURE_TRDC_HAS_DOMAIN_ERROR -#if (((__CORTEX_M == 0U) && (defined(__ICCARM__))) || (defined(__XTENSA__))) -/*! - * @brief Count the leading zeros. - * - * Count the leading zeros of an 32-bit data. This function is only defined - * for CM0 and CM0+ for IAR, because other cortex series have the clz instruction, - * KEIL and ARMGCC have toolchain build in function for this purpose. - * - * @param data The data to process. - * @return Count of the leading zeros. - */ -static uint8_t TRDC_CountLeadingZeros(uint32_t data) -{ - uint8_t count = 0U; - uint32_t mask = 0x80000000U; - - while ((data & mask) == 0U) - { - count++; - mask >>= 1U; - } - - return count; -} -#endif -#endif - -/*! - * brief Initializes the TRDC module. - * - * This function enables the TRDC clock. - * - * param base TRDC peripheral base address. - */ -void TRDC_Init(TRDC_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief De-initializes the TRDC module. - * - * This function disables the TRDC clock. - * - * param base TRDC peripheral base address. - */ -void TRDC_Deinit(TRDC_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -#if defined(FSL_FEATURE_TRDC_HAS_DOMAIN_ERROR) && FSL_FEATURE_TRDC_HAS_DOMAIN_ERROR -/*! - * brief Gets and clears the first domain error of the current domain. - * - * This function gets the first access violation information for the current domain - * and clears the pending flag. There might be multiple access violations pending - * for the current domain. This function only processes the first error. - * - * param base TRDC peripheral base address. - * param error Pointer to the error information. - * return If the access violation is captured, this function returns the kStatus_Success. - * The error information can be obtained from the parameter error. If no - * access violation is captured, this function returns the kStatus_NoData. - */ -status_t TRDC_GetAndClearFirstDomainError(TRDC_Type *base, trdc_domain_error_t *error) -{ - return TRDC_GetAndClearFirstSpecificDomainError(base, error, TRDC_GetCurrentMasterDomainId(base)); -} - -/*! - * brief Gets and clears the first domain error of the specific domain. - * - * This function gets the first access violation information for the specific domain - * and clears the pending flag. There might be multiple access violations pending - * for the current domain. This function only processes the first error. - * - * param base TRDC peripheral base address. - * param error Pointer to the error information. - * param domainId The error of which domain to get and clear. - * return If the access violation is captured, this function returns the kStatus_Success. - * The error information can be obtained from the parameter error. If no - * access violation is captured, this function returns the kStatus_NoData. - */ -status_t TRDC_GetAndClearFirstSpecificDomainError(TRDC_Type *base, trdc_domain_error_t *error, uint8_t domainId) -{ - assert(NULL != error); - - status_t status; - uint8_t errorIndex; /* The index of first domain error. */ - uint32_t errorBitMap; /* Domain error location bit map. */ - uint32_t regW1; /* To save TRDC_DERR_W1. */ - - /* Get the error bitmap. */ - errorBitMap = TRDC_DOMAIN_ERROR_BASE(base)->TRDC_DERRLOC[domainId]; - - if (0U == errorBitMap) /* No error captured. */ - { - status = kStatus_NoData; - } - else - { - /* Get the first error controller index. */ -#if (((__CORTEX_M == 0U) && (defined(__ICCARM__))) || (defined(__XTENSA__))) - errorIndex = 31U - TRDC_CountLeadingZeros(errorBitMap); -#else - errorIndex = 31U - __CLZ(errorBitMap); -#endif - - /* Must write TRDC_FDID[TRDC_FDID] with the domain ID before reading the Domain Error registers. */ - TRDC_DOMAIN_ERROR_BASE(base)->TRDC_FDID = TRDC_TRDC_FDID_FDID(domainId); - - /* Initializes the error structure to zero. */ - (void)memset(error, 0, sizeof(*error)); - - if (errorIndex > 15U) - { - /* Error in Memory Region Checker (MRC) */ - errorIndex -= 12U; - error->controller = (trdc_controller_t)errorIndex; - errorIndex -= 4U; - - /* Get the error information. */ - regW1 = TRDC_DOMAIN_ERROR_BASE(base)->MRC_DERR[errorIndex].W1; - error->address = TRDC_DOMAIN_ERROR_BASE(base)->MRC_DERR[errorIndex].W0; - /* Clear error pending. */ - TRDC_DOMAIN_ERROR_BASE(base)->MRC_DERR[errorIndex].W3 = TRDC_W3_RECR(0x01U); - } - else - { - /* Error in Memory Block Controller (MBC) */ - error->slaveMemoryIdx = errorIndex % 4U; - errorIndex /= 4U; - error->controller = (trdc_controller_t)errorIndex; - - /* Check if the MBC error index exceeds the module's max MBC index to avoid overrun access. */ - if (errorIndex >= - ((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NMBC_MASK) >> TRDC_TRDC_HWCFG0_NMBC_SHIFT)) - { - return kStatus_Fail; - } - - error->controller = (trdc_controller_t)errorIndex; - - /* Get the error information. */ - regW1 = TRDC_DOMAIN_ERROR_BASE(base)->MBC_DERR[errorIndex].W1; - error->address = TRDC_DOMAIN_ERROR_BASE(base)->MBC_DERR[errorIndex].W0; - /* Clear error pending. */ - TRDC_DOMAIN_ERROR_BASE(base)->MBC_DERR[errorIndex].W3 = TRDC_W3_RECR(0x01U); - } - - uint8_t tempVal = 0U; - error->domainId = (uint8_t)((regW1 & TRDC_W1_EDID_MASK) >> TRDC_W1_EDID_MASK); - tempVal = (uint8_t)((regW1 & TRDC_W1_EATR_MASK) >> TRDC_W1_EATR_SHIFT); - error->errorAttr = (trdc_error_attr_t)tempVal; - tempVal = (uint8_t)((regW1 & TRDC_W1_ERW_MASK) >> TRDC_W1_ERW_SHIFT); - error->errorType = (trdc_error_type_t)tempVal; - error->errorPort = (uint8_t)((regW1 & TRDC_W1_EPORT_MASK) >> TRDC_W1_EPORT_SHIFT); - tempVal = (uint8_t)((regW1 & TRDC_W1_EST_MASK) >> TRDC_W1_EST_SHIFT); - error->errorState = (trdc_error_state_t)tempVal; - - status = kStatus_Success; - } - - return status; -} -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_MRC) && FSL_FEATURE_TRDC_HAS_MRC -/*! - * brief Sets the memory access configuration for one of the access control register of one MRC. - * - * Example: Enable the secure operations and lock the configuration for MRC0 region 1. - * - * code - * trdc_memory_access_control_config_t config; - * - * config.securePrivX = true; - * config.securePrivW = true; - * config.securePrivR = true; - * config.lock = true; - * TRDC_SetMrcMemoryAccess(TRDC, &config, 0, 1); - * endcode - * - * param base TRDC peripheral base address. - * param config Pointer to the configuration structure. - * param mrcIdx MRC index. - * param regIdx Register number. - */ -void TRDC_MrcSetMemoryAccessConfig(TRDC_Type *base, - const trdc_memory_access_control_config_t *config, - uint8_t mrcIdx, - uint8_t regIdx) -{ - assert(NULL != base); - assert(NULL != config); - - trdc_reg32_convert_t pid; - - pid._memory_access_control = *config; - TRDC_MRC_BASE(base, mrcIdx)->MRC_GLBAC[regIdx] = pid._u32; -} - -/*! - * brief Enables the update of the selected domians. - * - * After the domians' update are enabled, their regions' NSE bits can be set or clear. - * - * param base TRDC peripheral base address. - * param mrcIdx MRC index. - * param domianMask Bit mask of the domains to be enabled. - * param enable True to enable, false to disable. - */ -void TRDC_MrcEnableDomainNseUpdate(TRDC_Type *base, uint8_t mrcIdx, uint16_t domianMask, bool enable) -{ - assert(NULL != base); - - if (enable) - { - TRDC_MRC_BASE(base, mrcIdx)->MRC_NSE_RGN_INDIRECT |= ((uint32_t)domianMask << 16U); - } - else - { - TRDC_MRC_BASE(base, mrcIdx)->MRC_NSE_RGN_INDIRECT &= ~((uint32_t)domianMask << 16U); - } -} - -/*! - * brief Sets the NSE bits of the selected regions for domains. - * - * This function sets the NSE bits for the selected regions for the domains whose update are enabled. - * - * param base TRDC peripheral base address. - * param mrcIdx MRC index. - * param regionMask Bit mask of the regions whose NSE bits to set. - */ -void TRDC_MrcRegionNseSet(TRDC_Type *base, uint8_t mrcIdx, uint16_t regionMask) -{ - assert(NULL != base); - - TRDC_MRC_BASE(base, mrcIdx)->MRC_NSE_RGN_SET = ((uint32_t)regionMask); -} - -/*! - * brief Clears the NSE bits of the selected regions for domains. - * - * This function clears the NSE bits for the selected regions for the domains whose update are enabled. - * - * param base TRDC peripheral base address. - * param mrcIdx MRC index. - * param regionMask Bit mask of the regions whose NSE bits to clear. - */ -void TRDC_MrcRegionNseClear(TRDC_Type *base, uint8_t mrcIdx, uint16_t regionMask) -{ - assert(NULL != base); - - TRDC_MRC_BASE(base, mrcIdx)->MRC_NSE_RGN_CLR = ((uint32_t)regionMask); -} - -/*! - * brief Clears the NSE bits for all the regions of the selected domains. - * - * This function clears the NSE bits for all regions of selected domains whose update are enabled. - * - * param base TRDC peripheral base address. - * param mrcIdx MRC index. - * param domainMask Bit mask of the domians whose NSE bits to clear. - */ -void TRDC_MrcDomainNseClear(TRDC_Type *base, uint8_t mrcIdx, uint16_t domainMask) -{ - assert(NULL != base); - - uint8_t domainCount = - (uint8_t)((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NDID_MASK) >> TRDC_TRDC_HWCFG0_NDID_SHIFT); - uint8_t maxDomainId = 0U; - uint16_t tmpDomainMask = domainMask; - - while (tmpDomainMask != 0U) - { - tmpDomainMask >>= 1U; - maxDomainId++; - } - - /* Check whether the domain mask contains invalid domain. */ - if (maxDomainId > domainCount) - { - assert(false); - } - - TRDC_MRC_BASE(base, mrcIdx)->MRC_NSE_RGN_CLR_ALL = ((uint32_t)domainMask << 16U); -} - -/*! - * brief Sets the configuration for one of the region descriptor per domain per MRC instnce. - * - * This function sets the configuration for one of the region descriptor, including the start - * and end address of the region, memory access control policy and valid. - * - * param base TRDC peripheral base address. - * param config Pointer to region descriptor configuration structure. - */ -void TRDC_MrcSetRegionDescriptorConfig(TRDC_Type *base, const trdc_mrc_region_descriptor_config_t *config) -{ - assert(NULL != base); - - uint32_t regAddr = (uint32_t) & (TRDC_MRC_BASE(base, config->mrcIdx)->MRC_DOM0_RGD_W[config->regionIdx][0]); - - regAddr += TRDC_MRC_DOMAIN_INCREMENT * config->domainIdx; - - /* Set configuration for word 0 */ - uint32_t data = TRDC_MRC_DOM0_RGD_W_MRACSEL(config->memoryAccessControlSelect) | - ((config->startAddr) & ~(TRDC_MRC_DOM0_RGD_W_MRACSEL_MASK)); - *(uint32_t *)regAddr = data; - - /* Set configuration for word 1 */ - regAddr += 4U; - data = TRDC_MRC_DOM0_RGD_W_VLD(config->valid) | TRDC_MRC_DOM0_RGD_W_NSE(config->nseEnable) | - ((config->endAddr) & ~(TRDC_MRC_DOM0_RGD_W_VLD_MASK | TRDC_MRC_DOM0_RGD_W_NSE_MASK)); - *(uint32_t *)regAddr = data; -} -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_MBC) && FSL_FEATURE_TRDC_HAS_MBC -/*! - * brief Sets the NSR update configuration for one of the MBC instance. - * - * After set the NSE configuration, the configured memory area can be updateby NSE set/clear. - * - * param base TRDC peripheral base address. - * param config Pointer to NSE update configuration structure. - * param mbcIdx MBC index. - */ -void TRDC_MbcSetNseUpdateConfig(TRDC_Type *base, const trdc_mbc_nse_update_config_t *config, uint8_t mbcIdx) -{ - assert(base != NULL); - - trdc_reg32_convert_t pid; - - pid._mbc_nse_update = *config; - TRDC_MBC_BASE(base, mbcIdx)->MBC_NSE_BLK_INDEX = pid._u32; -} - -/*! - * brief Sets the NSE bits of the selected configuration words according to NSE update configuration. - * - * This function sets the NSE bits of the word for the configured regio, memory. - * - * param base TRDC peripheral base address. - * param mbcIdx MBC index. - * param bitMask Mask of the bits whose NSE bits to set. - */ -void TRDC_MbcWordNseSet(TRDC_Type *base, uint8_t mbcIdx, uint32_t bitMask) -{ - assert(NULL != base); - - TRDC_MBC_BASE(base, mbcIdx)->MBC_NSE_BLK_SET = ((uint32_t)bitMask); -} - -/*! - * brief Clears the NSE bits of the selected configuration words according to NSE update configuration. - * - * This function sets the NSE bits of the word for the configured regio, memory. - * - * param base TRDC peripheral base address. - * param mbcIdx MBC index. - * param bitMask Mask of the bits whose NSE bits to clear. - */ -void TRDC_MbcWordNseClear(TRDC_Type *base, uint8_t mbcIdx, uint32_t bitMask) -{ - assert(NULL != base); - - TRDC_MBC_BASE(base, mbcIdx)->MBC_NSE_BLK_CLR = ((uint32_t)bitMask); -} - -/*! - * brief Clears all configuration words' NSE bits of the selected domain and memory. - * - * param base TRDC peripheral base address. - * param mbcIdx MBC index. - * param domainMask Mask of the domains whose NSE bits to clear, 0b110 means clear domain 1&2. - * param slaveMask Mask of the slaves whose NSE bits to clear, 0x11 means clear all slave 0&1's NSE bits. - */ -void TRDC_MbcNseClearAll(TRDC_Type *base, uint8_t mbcIdx, uint16_t domainMask, uint8_t slave) -{ - assert(NULL != base); - -#if defined(FSL_FEATURE_TRDC_DOMAIN_COUNT) && FSL_FEATURE_TRDC_DOMAIN_COUNT - uint8_t dmainCount = FSL_FEATURE_TRDC_DOMAIN_COUNT; -#else - uint8_t dmainCount = - (uint8_t)((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NDID_MASK) >> TRDC_TRDC_HWCFG0_NDID_SHIFT); -#endif - uint8_t maxDomainId = 0U; - uint16_t tmpDomainMask = domainMask; - - while (tmpDomainMask != 0U) - { - tmpDomainMask >>= 1U; - maxDomainId++; - } - - if (maxDomainId > dmainCount) - { - assert(false); - } - - TRDC_MBC_BASE(base, mbcIdx)->MBC_NSE_BLK_CLR_ALL = - TRDC_MBC_NSE_BLK_CLR_ALL_DID_SEL(domainMask) | TRDC_MBC_NSE_BLK_CLR_ALL_MEMSEL(slave); -} - -/*! - * brief Sets the memory access configuration for one of the region descriptor of one MBC. - * - * Example: Enable the secure operations and lock the configuration for MRC0 region 1. - * - * code - * trdc_memory_access_control_config_t config; - * - * config.securePrivX = true; - * config.securePrivW = true; - * config.securePrivR = true; - * config.lock = true; - * TRDC_SetMbcMemoryAccess(TRDC, &config, 0, 1); - * endcode - * - * param base TRDC peripheral base address. - * param config Pointer to the configuration structure. - * param mbcIdx MBC index. - * param rgdIdx Region descriptor number. - */ -void TRDC_MbcSetMemoryAccessConfig(TRDC_Type *base, - const trdc_memory_access_control_config_t *config, - uint8_t mbcIdx, - uint8_t rgdIdx) -{ - assert(NULL != base); - assert(NULL != config); - - trdc_reg32_convert_t pid; - - pid._memory_access_control = *config; - TRDC_MBC_BASE(base, mbcIdx)->MBC_MEMN_GLBAC[rgdIdx] = pid._u32; -} - -/*! - * brief Sets the configuration for one of the memory block per domain per MBC instnce. - * - * This function sets the configuration for one of the memory block, including the memory access - * control policy and nse enable. - * - * param base TRDC peripheral base address. - * param config Pointer to memory block configuration structure. - */ -void TRDC_MbcSetMemoryBlockConfig(TRDC_Type *base, const trdc_mbc_memory_block_config_t *config) -{ - assert(NULL != base); - - uint32_t shift = 4UL * (config->memoryBlockIdx % 8UL); - uint32_t regAddr = (uint32_t) & (TRDC_MBC_BASE(base, config->mbcIdx)->MBC_DOM0_MEM0_BLK_CFG_W[0]); - uint32_t configWord = 0U; - trdc_reg32_convert_t pid; - - pid._mbc_memory_blk = *config; - configWord = (pid._u32 & 0xFU) << shift; - - regAddr += (TRDC_MBC_DOMAIN_INCREMENT * config->domainIdx + TRDC_MBC_SLAVE_INCREMENT(config->slaveMemoryIdx)) + - ((uint32_t)config->memoryBlockIdx / 8U) * sizeof(uint32_t); - configWord = configWord | (*(uint32_t *)regAddr & ~(0xFUL << shift)); - *(uint32_t *)regAddr = configWord; -} -#endif diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_trdc.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_trdc.h deleted file mode 100644 index 68d29530882..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_trdc.h +++ /dev/null @@ -1,1131 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_TRDC_H_ -#define FSL_TRDC_H_ - -#include "fsl_common.h" -#include "fsl_trdc_core.h" - -/*! - * @addtogroup trdc - * @{ - */ - -/****************************************************************************** - * Definitions - *****************************************************************************/ -#define FSL_TRDC_DRIVER_VERSION (MAKE_VERSION(2, 2, 1)) - -#if defined(FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG) && FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG -/* Hardware configuration definitions */ -/*! - * @brief TRDC hardware configuration. - */ -typedef struct _trdc_hardware_config -{ - uint8_t masterNumber; /*!< Number of bus masters. */ - uint8_t domainNumber; /*!< Number of domains. */ - uint8_t mbcNumber; /*!< Number of MBCs. */ - uint8_t mrcNumber; /*!< Number of MRCs. */ -} trdc_hardware_config_t; -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_MBC) && FSL_FEATURE_TRDC_HAS_MBC -/*! - * @brief Hardware configuration of the two slave memories within each MBC(memory block checker). - */ -typedef struct _trdc_slave_memory_hardware_config -{ - uint32_t blockNum; /*!< Number of blocks. */ - uint32_t blockSize; /*!< Block size. */ -} trdc_slave_memory_hardware_config_t; -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_DOMAIN_ASSIGNMENT) && FSL_FEATURE_TRDC_HAS_DOMAIN_ASSIGNMENT -/* Master domain assignment definitions */ -/*! - * @brief TRDC domain ID select method, the register bit TRDC_MDA_W0_0_DFMT0[DIDS], used for - * domain hit evaluation. - */ -typedef enum _trdc_did_sel -{ - kTRDC_DidMda, /*!< Use MDAn[2:0] as DID. */ - kTRDC_DidInput, /*!< Use the input DID (DID_in) as DID. */ - kTRDC_DidMdaAndInput, /*!< Use MDAn[2] concatenated with DID_in[1:0] as DID. */ - kTRDC_DidReserved /*!< Reserved. */ -} trdc_did_sel_t; - -/*! - * @brief TRDC secure attribute, the register bit TRDC_MDA_W0_0_DFMT0[SA], used for - * bus master domain assignment. - */ -typedef enum _trdc_secure_attr -{ - kTRDC_ForceSecure, /*!< Force the bus attribute for this master to secure. */ - kTRDC_ForceNonSecure, /*!< Force the bus attribute for this master to non-secure. */ - kTRDC_MasterSecure, /*!< Use the bus master's secure/nonsecure attribute directly. */ - kTRDC_MasterSecure1, /*!< Use the bus master's secure/nonsecure attribute directly. */ -} trdc_secure_attr_t; - -/*! - * @brief The configuration of domain hit evaluation of PID. - */ -typedef enum _trdc_pid_domain_hit_config -{ - kTRDC_pidDomainHitNone0, /*!< No PID is included in the domain hit evaluation. */ - kTRDC_pidDomainHitNone1, /*!< No PID is included in the domain hit evaluation. */ - kTRDC_pidDomainHitInclusive, /*!< The PID is included in the domain hit evaluation when (PID & ~PIDM). */ - kTRDC_pidDomainHitExclusive, /*!< The PID is included in the domain hit evaluation when ~(PID & ~PIDM). */ -} trdc_pid_domain_hit_config_t; - -/*! - * @brief Domain assignment for the processor bus master. - */ -typedef struct _trdc_processor_domain_assignment -{ - uint32_t domainId : 4U; /*!< Domain ID. */ - uint32_t domainIdSelect : 2U; /*!< Domain ID select method, see @ref trdc_did_sel_t. */ - uint32_t pidDomainHitConfig : 2U; /*!< The configuration of the domain hit evaluation for PID, see @ref - trdc_pid_domain_hit_config_t. */ - uint32_t pidMask : 6U; /*!< The mask combined with PID, so multiple PID can be included as part of the domain hit - determination. Set to 0 to disable. */ - uint32_t secureAttr : 2U; /*!< Secure attribute, see @ref trdc_secure_attr_t. */ - uint32_t pid : 6U; /*!< The process identifier, combined with pidMask to form the domain hit determination. */ - uint32_t : 8U; /*!< Reserved. */ - uint32_t lock : 1U; /*!< Lock the register. */ - uint32_t : 1U; /*!< Reserved. */ -} trdc_processor_domain_assignment_t; - -/*! - * @brief TRDC privileged attribute, the register bit TRDC_MDA_W0_x_DFMT1[PA], used for non-processor - * bus master domain assignment. - */ -typedef enum _trdc_privilege_attr -{ - kTRDC_ForceUser, /*!< Force the bus attribute for this master to user. */ - kTRDC_ForcePrivilege, /*!< Force the bus attribute for this master to privileged. */ - kTRDC_MasterPrivilege, /*!< Use the bus master's attribute directly. */ - kTRDC_MasterPrivilege1, /*!< Use the bus master's attribute directly. */ -} trdc_privilege_attr_t; - -/*! - * @brief Domain assignment for the non-processor bus master. - */ -typedef struct _trdc_non_processor_domain_assignment -{ - uint32_t domainId : 4U; /*!< Domain ID. */ - uint32_t privilegeAttr : 2U; /*!< Privileged attribute, see @ref trdc_privilege_attr_t. */ - uint32_t secureAttr : 2U; /*!< Secure attribute, see @ref trdc_secure_attr_t. */ - uint32_t bypassDomainId : 1U; /*!< Bypass domain ID. */ - uint32_t : 21U; /*!< Reserved. */ - uint32_t lock : 1U; /*!< Lock the register. */ - uint32_t : 1U; /*!< Reserved. */ -} trdc_non_processor_domain_assignment_t; - -/*! - * @brief PID lock configuration. - */ -typedef enum _trdc_pid_lock -{ - kTRDC_PidUnlocked0, /*!< The PID value can be updated by any secure priviledged write. */ - kTRDC_PidUnlocked1, /*!< The PID value can be updated by any secure priviledged write. */ - kTRDC_PidUnlocked2, /*!< The PID value can be updated by any secure priviledged write from the bus master that first - configured this register. */ - kTRDC_PidLocked, /*!< The PID value is locked until next reset. */ -} trdc_pid_lock_t; - -/*! - * @brief Process identifier(PID) configuration for processor cores. - */ -typedef struct _trdc_pid_config -{ - uint32_t pid : 6U; /*!< The process identifier of the executing task. The highest bit can be used to define - secure/nonsecure attribute of the task. */ - uint32_t : 23U; /*!< Reserved. */ - uint32_t lock : 2U; /*!< How to lock the register, see @ref trdc_pid_lock_t. */ - uint32_t : 1U; /*!< Reserved. */ -} trdc_pid_config_t; -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG) && FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG -/* TZ-M congiguration definitions */ -/*! - * @brief IDAU(Implementation-Defined Attribution Unit) configuration for TZ-M function control. - */ -typedef struct _trdc_idau_config -{ - uint32_t : 8U; /*!< Reserved. */ - uint32_t lockSecureVTOR : 1U; /*!< Disable writes to secure VTOR(Vector Table Offset Register). */ - uint32_t lockNonsecureVTOR : 1U; /*!< Disable writes to non-secure VTOR, Application interrupt and Reset Control - Registers. */ - uint32_t lockSecureMPU : 1U; /*!< Disable writes to secure MPU(Memory Protection Unit) from software or from a debug - agent connected to the processor in Secure state. */ - uint32_t lockNonsecureMPU : 1U; /*!< Disable writes to non-secure MPU(Memory Protection Unit) from software or from - a debug agent connected to the processor. */ - uint32_t lockSAU : 1U; /*!< Disable writes to SAU(Security Attribution Unit) registers. */ - uint32_t : 19U; /*!< Reserved. */ -} trdc_idau_config_t; - -/* FLW(Flash Logical Window) configuration definitions */ -/*! - * @brief FLW(Flash Logical Window) configuration. - */ -typedef struct _trdc_flw_config -{ - uint16_t blockCount; /*!< Block count of the Flash Logic Window in 32KByte blocks. */ - uint32_t arrayBaseAddr; /*!< Flash array base address of the Flash Logical Window. */ - bool lock; /*!< Disable writes to FLW registers. */ - bool enable; /*!< Enable FLW function. */ -} trdc_flw_config_t; -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_DOMAIN_ERROR) && FSL_FEATURE_TRDC_HAS_DOMAIN_ERROR -/* Domain error check and clear definitions */ -/*! - * @brief TRDC controller definition for domain error check. Each TRDC instance may have different - * MRC or MBC count, call TRDC_GetHardwareConfig to get the actual count. - */ -typedef enum _trdc_controller -{ - kTRDC_MemBlockController0 = 0U, /*!< Memory block checker 0. */ - kTRDC_MemBlockController1 = 1U, /*!< Memory block checker 1. */ - kTRDC_MemBlockController2 = 2U, /*!< Memory block checker 2. */ - kTRDC_MemBlockController3 = 3U, /*!< Memory block checker 3. */ - kTRDC_MemRegionChecker0 = 4U, /*!< Memory region checker 0. */ - kTRDC_MemRegionChecker1 = 5U, /*!< Memory region checker 1. */ - kTRDC_MemRegionChecker2 = 6U, /*!< Memory region checker 2. */ - kTRDC_MemRegionChecker3 = 7U, /*!< Memory region checker 3. */ - kTRDC_MemRegionChecker4 = 8U, /*!< Memory region checker 4. */ - kTRDC_MemRegionChecker5 = 9U, /*!< Memory region checker 5. */ - kTRDC_MemRegionChecker6 = 10U, /*!< Memory region checker 6. */ -} trdc_controller_t; - -/*! - * @brief TRDC domain error state definition TRDC_MBCn_DERR_W1[EST] or TRDC_MRCn_DERR_W1[EST]. - */ -typedef enum _trdc_error_state -{ - kTRDC_ErrorStateNone = 0x00U, /*!< No access violation detected. */ - kTRDC_ErrorStateNone1 = 0x01U, /*!< No access violation detected. */ - kTRDC_ErrorStateSingle = 0x02U, /*!< Single access violation detected. */ - kTRDC_ErrorStateMulti = 0x03U /*!< Multiple access violation detected. */ -} trdc_error_state_t; - -/*! - * @brief TRDC domain error attribute definition TRDC_MBCn_DERR_W1[EATR] or TRDC_MRCn_DERR_W1[EATR]. - */ -typedef enum _trdc_error_attr -{ - kTRDC_ErrorSecureUserInst = 0x00U, /*!< Secure user mode, instruction fetch access. */ - kTRDC_ErrorSecureUserData = 0x01U, /*!< Secure user mode, data access. */ - kTRDC_ErrorSecurePrivilegeInst = 0x02U, /*!< Secure privileged mode, instruction fetch access. */ - kTRDC_ErrorSecurePrivilegeData = 0x03U, /*!< Secure privileged mode, data access. */ - kTRDC_ErrorNonSecureUserInst = 0x04U, /*!< NonSecure user mode, instruction fetch access. */ - kTRDC_ErrorNonSecureUserData = 0x05U, /*!< NonSecure user mode, data access. */ - kTRDC_ErrorNonSecurePrivilegeInst = 0x06U, /*!< NonSecure privileged mode, instruction fetch access. */ - kTRDC_ErrorNonSecurePrivilegeData = 0x07U /*!< NonSecure privileged mode, data access. */ -} trdc_error_attr_t; - -/*! - * @brief TRDC domain error access type definition TRDC_DERR_W1_n[ERW]. - */ -typedef enum _trdc_error_type -{ - kTRDC_ErrorTypeRead = 0x00U, /*!< Error occurs on read reference. */ - kTRDC_ErrorTypeWrite = 0x01U /*!< Error occurs on write reference. */ -} trdc_error_type_t; - -/*! - * @brief TRDC domain error definition. - */ -typedef struct _trdc_domain_error -{ - trdc_controller_t controller; /*!< Which controller captured access violation. */ - uint32_t address; /*!< Access address that generated access violation. */ - trdc_error_state_t errorState; /*!< Error state. */ - trdc_error_attr_t errorAttr; /*!< Error attribute. */ - trdc_error_type_t errorType; /*!< Error type. */ - uint8_t errorPort; /*!< Error port. */ - uint8_t domainId; /*!< Domain ID. */ - uint8_t slaveMemoryIdx; /*!< The slave memory index. Only apply when violation in MBC. */ -} trdc_domain_error_t; -#endif - -#if (defined(FSL_FEATURE_TRDC_HAS_MBC) && FSL_FEATURE_TRDC_HAS_MBC) || \ - (defined(FSL_FEATURE_TRDC_HAS_MRC) && FSL_FEATURE_TRDC_HAS_MRC) -/* Common definitions for MBC/MRC configuration */ -/*! - * @brief Memory access control configuration for MBC/MRC. - */ -typedef struct _trdc_memory_access_control_config -{ - uint32_t nonsecureUsrX : 1U; /*!< Allow nonsecure user execute access. */ - uint32_t nonsecureUsrW : 1U; /*!< Allow nonsecure user write access. */ - uint32_t nonsecureUsrR : 1U; /*!< Allow nonsecure user read access. */ - uint32_t : 1U; /*!< Reserved. */ - uint32_t nonsecurePrivX : 1U; /*!< Allow nonsecure privilege execute access. */ - uint32_t nonsecurePrivW : 1U; /*!< Allow nonsecure privilege write access. */ - uint32_t nonsecurePrivR : 1U; /*!< Allow nonsecure privilege read access. */ - uint32_t : 1U; /*!< Reserved. */ - uint32_t secureUsrX : 1U; /*!< Allow secure user execute access. */ - uint32_t secureUsrW : 1U; /*!< Allow secure user write access. */ - uint32_t secureUsrR : 1U; /*!< Allow secure user read access. */ - uint32_t : 1U; /*!< Reserved. */ - uint32_t securePrivX : 1U; /*!< Allownsecure privilege execute access. */ - uint32_t securePrivW : 1U; /*!< Allownsecure privilege write access. */ - uint32_t securePrivR : 1U; /*!< Allownsecure privilege read access. */ - uint32_t : 16U; /*!< Reserved. */ - uint32_t lock : 1U; /*!< Lock the configuration until next reset, only apply to access control register 0. */ -} trdc_memory_access_control_config_t; -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_MRC) && FSL_FEATURE_TRDC_HAS_MRC -/*! @brief The region descriptor enumeration, used to form a mask to set/clear the NSE bits for one or several regions. - */ -enum _trdc_region_descriptor -{ - kTRDC_RegionDescriptor0 = (1U << 0U), /*!< Region descriptor 0. */ - kTRDC_RegionDescriptor1 = (1U << 1U), /*!< Region descriptor 1. */ - kTRDC_RegionDescriptor2 = (1U << 2U), /*!< Region descriptor 2. */ - kTRDC_RegionDescriptor3 = (1U << 3U), /*!< Region descriptor 3. */ - kTRDC_RegionDescriptor4 = (1U << 4U), /*!< Region descriptor 4. */ - kTRDC_RegionDescriptor5 = (1U << 5U), /*!< Region descriptor 5. */ - kTRDC_RegionDescriptor6 = (1U << 6U), /*!< Region descriptor 6. */ - kTRDC_RegionDescriptor7 = (1U << 7U), /*!< Region descriptor 7. */ - kTRDC_RegionDescriptor8 = (1U << 8U), /*!< Region descriptor 8. */ - kTRDC_RegionDescriptor9 = (1U << 9U), /*!< Region descriptor 9. */ - kTRDC_RegionDescriptor10 = (1U << 10U), /*!< Region descriptor 10. */ - kTRDC_RegionDescriptor11 = (1U << 11U), /*!< Region descriptor 11. */ - kTRDC_RegionDescriptor12 = (1U << 12U), /*!< Region descriptor 12. */ - kTRDC_RegionDescriptor13 = (1U << 13U), /*!< Region descriptor 13. */ - kTRDC_RegionDescriptor14 = (1U << 14U), /*!< Region descriptor 14. */ - kTRDC_RegionDescriptor15 = (1U << 15U), /*!< Region descriptor 15. */ -}; - -/* MRC configuration definitions */ -/*! @brief The MRC domain enumeration, used to form a mask to enable/disable the update or clear all NSE bits of one or - * several domains. */ -enum _trdc_MRC_domain -{ - kTRDC_MrcDomain0 = (1U << 0U), /*!< Domain 0. */ - kTRDC_MrcDomain1 = (1U << 1U), /*!< Domain 1. */ - kTRDC_MrcDomain2 = (1U << 2U), /*!< Domain 2. */ - kTRDC_MrcDomain3 = (1U << 3U), /*!< Domain 3. */ - kTRDC_MrcDomain4 = (1U << 4U), /*!< Domain 4. */ - kTRDC_MrcDomain5 = (1U << 5U), /*!< Domain 5. */ - kTRDC_MrcDomain6 = (1U << 6U), /*!< Domain 6. */ - kTRDC_MrcDomain7 = (1U << 7U), /*!< Domain 7. */ - kTRDC_MrcDomain8 = (1U << 8U), /*!< Domain 8. */ - kTRDC_MrcDomain9 = (1U << 9U), /*!< Domain 9. */ - kTRDC_MrcDomain10 = (1U << 10U), /*!< Domain 10. */ - kTRDC_MrcDomain11 = (1U << 11U), /*!< Domain 11. */ - kTRDC_MrcDomain12 = (1U << 12U), /*!< Domain 12. */ - kTRDC_MrcDomain13 = (1U << 13U), /*!< Domain 13. */ - kTRDC_MrcDomain14 = (1U << 14U), /*!< Domain 14. */ - kTRDC_MrcDomain15 = (1U << 15U), /*!< Domain 15. */ -}; - -/*! - * @brief The configuration of each region descriptor per domain per MRC instance. - */ -typedef struct _trdc_mrc_region_descriptor_config -{ - uint8_t memoryAccessControlSelect; /*!< Select one of the 8 access control policies for this region, for - access cotrol policies see @ref trdc_memory_access_control_config_t. */ - uint32_t startAddr; /*!< Physical start address. */ - bool valid; /*!< Lock the register. */ - bool nseEnable; /*!< Enable non-secure accesses and disable secure accesses. */ - uint32_t endAddr; /*!< Physical start address. */ - uint8_t mrcIdx; /*!< The index of the MRC for this configuration to take effect. */ - uint8_t domainIdx; /*!< The index of the domain for this configuration to take effect. */ - uint8_t regionIdx; /*!< The index of the region for this configuration to take effect. */ -} trdc_mrc_region_descriptor_config_t; -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_MBC) && FSL_FEATURE_TRDC_HAS_MBC -/* MBC configuration definitions */ -/*! - * @brief The configuration of MBC NSE update. - */ -#if defined(FSL_FEATURE_TRDC_DOMAIN_COUNT) && (FSL_FEATURE_TRDC_DOMAIN_COUNT > 0x8U) -typedef struct _trdc_mbc_nse_update_config -{ - uint32_t autoIncrement : 1U; /*!< Whether to increment the word index after current word is updated using this - configuration. */ - uint32_t : 1U; /*!< Reserved. */ - uint32_t wordIdx : 4U; /*!< MBC configuration word index to be updated. */ - uint32_t : 2U; /*!< Reserved. */ - uint32_t memorySelect : 4U; /*!< Bit mask of the selected memory to be updated. @ref _trdc_MBC_memory. */ - uint32_t : 4U; /*!< Reserved. */ - uint32_t domianSelect : 16U; /*!< Bit mask of the selected domain to be updated. @ref _trdc_MBC_domain. */ -} trdc_mbc_nse_update_config_t; -#else -typedef struct _trdc_mbc_nse_update_config -{ - uint32_t : 2U; /*!< Reserved. */ - uint32_t wordIdx : 4U; /*!< MBC configuration word index to be updated. */ - uint32_t : 2U; /*!< Reserved. */ - uint32_t memorySelect : 4U; /*!< Bit mask of the selected memory to be updated. @ref _trdc_MBC_memory. */ - uint32_t : 4U; /*!< Reserved. */ - uint32_t domianSelect : 8U; /*!< Bit mask of the selected domain to be updated. @ref _trdc_MBC_domain. */ - uint32_t : 7U; /*!< Reserved. */ - uint32_t autoIncrement : 1U; /*!< Whether to increment the word index after current word is updated using this - configuration. */ -} trdc_mbc_nse_update_config_t; -#endif - -/*! @brief The MBC domain enumeration, used to form a mask to enable/disable the update or clear NSE bits of one or - * several domains. */ -enum _trdc_MBC_domain -{ - kTRDC_MbcDomain0 = (1U << 0U), /*!< Domain 0. */ - kTRDC_MbcDomain1 = (1U << 1U), /*!< Domain 1. */ - kTRDC_MbcDomain2 = (1U << 2U), /*!< Domain 2. */ - kTRDC_MbcDomain3 = (1U << 3U), /*!< Domain 3. */ - kTRDC_MbcDomain4 = (1U << 4U), /*!< Domain 4. */ - kTRDC_MbcDomain5 = (1U << 5U), /*!< Domain 5. */ - kTRDC_MbcDomain6 = (1U << 6U), /*!< Domain 6. */ - kTRDC_MbcDomain7 = (1U << 7U), /*!< Domain 7. */ -}; - -/*! @brief The MBC slave memory enumeration, used to form a mask to enable/disable the update or clear NSE bits of one - * or several memory block. */ -enum _trdc_MBC_memory -{ - kTRDC_MbcSlaveMemory0 = (1U << 0U), /*!< Memory 0. */ - kTRDC_MbcSlaveMemory1 = (1U << 1U), /*!< Memory 1. */ - kTRDC_MbcSlaveMemory2 = (1U << 2U), /*!< Memory 2. */ - kTRDC_MbcSlaveMemory3 = (1U << 3U), /*!< Memory 3. */ -}; - -/*! @brief The MBC bit enumeration, used to form a mask to set/clear configured words' NSE. */ -enum _trdc_MBC_bit -{ - kTRDC_MbcBit0 = (1U << 0U), /*!< Bit 0. */ - kTRDC_MbcBit1 = (1U << 1U), /*!< Bit 1. */ - kTRDC_MbcBit2 = (1U << 2U), /*!< Bit 2. */ - kTRDC_MbcBit3 = (1U << 3U), /*!< Bit 3. */ - kTRDC_MbcBit4 = (1U << 4U), /*!< Bit 4. */ - kTRDC_MbcBit5 = (1U << 5U), /*!< Bit 5. */ - kTRDC_MbcBit6 = (1U << 6U), /*!< Bit 6. */ - kTRDC_MbcBit7 = (1U << 7U), /*!< Bit 7. */ - kTRDC_MbcBit8 = (1U << 8U), /*!< Bit 8. */ - kTRDC_MbcBit9 = (1U << 9U), /*!< Bit 9. */ - kTRDC_MbcBit10 = (1U << 10U), /*!< Bit 10. */ - kTRDC_MbcBit11 = (1U << 11U), /*!< Bit 11. */ - kTRDC_MbcBit12 = (1U << 12U), /*!< Bit 12. */ - kTRDC_MbcBit13 = (1U << 13U), /*!< Bit 13. */ - kTRDC_MbcBit14 = (1U << 14U), /*!< Bit 14. */ - kTRDC_MbcBit15 = (1U << 15U), /*!< Bit 15. */ - kTRDC_MbcBit16 = (1U << 16U), /*!< Bit 16. */ - kTRDC_MbcBit17 = (1U << 17U), /*!< Bit 17. */ - kTRDC_MbcBit18 = (1U << 18U), /*!< Bit 18. */ - kTRDC_MbcBit19 = (1U << 19U), /*!< Bit 19. */ - kTRDC_MbcBit20 = (1U << 20U), /*!< Bit 20. */ - kTRDC_MbcBit21 = (1U << 21U), /*!< Bit 21. */ - kTRDC_MbcBit22 = (1U << 22U), /*!< Bit 22. */ - kTRDC_MbcBit23 = (1U << 23U), /*!< Bit 23. */ - kTRDC_MbcBit24 = (1U << 24U), /*!< Bit 24. */ - kTRDC_MbcBit25 = (1U << 25U), /*!< Bit 25. */ - kTRDC_MbcBit26 = (1U << 26U), /*!< Bit 26. */ - kTRDC_MbcBit27 = (1U << 27U), /*!< Bit 27. */ - kTRDC_MbcBit28 = (1U << 28U), /*!< Bit 28. */ - kTRDC_MbcBit29 = (1U << 29U), /*!< Bit 29. */ - kTRDC_MbcBit30 = (1U << 30U), /*!< Bit 30. */ - kTRDC_MbcBit31 = (1U << 31U), /*!< Bit 31. */ -}; - -/*! - * @brief The configuration of each memory block per domain per MBC instance. - */ -typedef struct _trdc_mbc_memory_block_config -{ - uint32_t memoryAccessControlSelect : 3U; /*!< Select one of the 8 access control policies for this memory block, for - access cotrol policies see @ref trdc_memory_access_control_config_t. */ - uint32_t nseEnable : 1U; /*!< Enable non-secure accesses and disable secure accesses. */ - uint32_t mbcIdx : 4U; /*!< The index of the MBC for this configuration to take effect. */ - uint32_t domainIdx : 8U; /*!< The index of the domain for this configuration to take effect. */ - uint32_t slaveMemoryIdx : 8U; /*!< The index of the slave memory for this configuration to take effect. */ - uint32_t memoryBlockIdx : 8U; /*!< The index of the memory block for this configuration to take effect. */ -} trdc_mbc_memory_block_config_t; -#endif - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ -/*! - * @brief Initializes the TRDC module. - * - * This function enables the TRDC clock. - * - * @param base TRDC peripheral base address. - */ -void TRDC_Init(TRDC_Type *base); - -/*! - * @brief De-initializes the TRDC module. - * - * This function disables the TRDC clock. - * - * @param base TRDC peripheral base address. - */ -void TRDC_Deinit(TRDC_Type *base); -/*! @} */ - -#if defined(FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG) && FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG -/*! - * @name Hardware configuration - * @{ - */ -/*! - * @brief Gets the domain ID of the current bus master. - * - * @param base TRDC peripheral base address. - * @return Domain ID of current bus master. - */ -static inline uint8_t TRDC_GetCurrentMasterDomainId(TRDC_Type *base) -{ - return (uint8_t)((TRDC_GENERAL_BASE(base)->TRDC_HWCFG1 & TRDC_TRDC_HWCFG1_DID_MASK) >> TRDC_TRDC_HWCFG1_DID_SHIFT); -} - -/*! - * @brief Gets the TRDC hardware configuration. - * - * This function gets the TRDC hardware configurations, including number of bus - * masters, number of domains, number of MRCs and number of PACs. - * - * @param base TRDC peripheral base address. - * @param config Pointer to the structure to get the configuration. - */ -void TRDC_GetHardwareConfig(TRDC_Type *base, trdc_hardware_config_t *config); -/*! @} */ -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_DOMAIN_ASSIGNMENT) && FSL_FEATURE_TRDC_HAS_DOMAIN_ASSIGNMENT -/*! - * @name Master domain assignment - * @{ - */ -/*! - * @brief Sets the TRDC DAC(Domain Assignment Controllers) global valid. - * - * Once enabled, it will remain enabled until next reset. - * - * @param base TRDC peripheral base address. - */ -static inline void TRDC_SetDacGlobalValid(TRDC_Type *base) -{ - TRDC_GENERAL_BASE(base)->TRDC_CR |= TRDC_TRDC_CR_GVLDM_MASK; -} - -/*! - * @brief Locks the bus master domain assignment register. - * - * This function locks the master domain assignment. After it is locked, the register can't be changed - * until next reset. - * - * @param base TRDC peripheral base address. - * @param master Which master to configure, refer to trdcx_master_t in processor header file, x is trdc instance. - * @param regNum Which register to configure, processor master can have more than one register for the MDAC - configuration. - * @param assignIndex Which assignment register to lock. - */ -static inline void TRDC_LockMasterDomainAssignment(TRDC_Type *base, uint8_t master, uint8_t regNum) -{ - /* Make sure in the master range. */ - assert((uint32_t)master < - ((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NMSTR_MASK) >> TRDC_TRDC_HWCFG0_NMSTR_SHIFT)); - if (0U == (TRDC_GENERAL_BASE(base)->DACFG[master] & TRDC_DACFG_NCM_MASK)) - { - TRDC_DOMAIN_ASSIGNMENT_BASE(base)->MDA_DFMT0[master].MDA_W_DFMT0[regNum] |= TRDC_MDA_W_DFMT0_LK1_MASK; - } - else - { - TRDC_DOMAIN_ASSIGNMENT_BASE(base)->MDA_DFMT1[master].MDA_W_DFMT1[0] |= TRDC_MDA_W_DFMT1_LK1_MASK; - } -} - -/*! - * @brief Sets the master domain assignment as valid or invalid. - * - * This function sets the master domain assignment as valid or invalid. - * - * @param base TRDC peripheral base address. - * @param master Which master to configure. - * @param regNum Which register to configure, processor master can have more than one register for the MDAC - * configuration. - * @param assignIndex Index for the domain assignment register. - * @param valid True to set valid, false to set invalid. - */ -static inline void TRDC_SetMasterDomainAssignmentValid(TRDC_Type *base, uint8_t master, uint8_t regNum, bool valid) -{ - /* Make sure in the master range. */ - assert((uint32_t)master < - ((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NMSTR_MASK) >> TRDC_TRDC_HWCFG0_NMSTR_SHIFT)); - if (valid) - { - if (0U == (TRDC_GENERAL_BASE(base)->DACFG[master] & TRDC_DACFG_NCM_MASK)) - { - TRDC_DOMAIN_ASSIGNMENT_BASE(base)->MDA_DFMT0[master].MDA_W_DFMT0[regNum] |= TRDC_MDA_W_DFMT0_VLD_MASK; - } - else - { - TRDC_DOMAIN_ASSIGNMENT_BASE(base)->MDA_DFMT1[master].MDA_W_DFMT1[0] |= TRDC_MDA_W_DFMT1_VLD_MASK; - } - } - else - { - if (0U == (TRDC_GENERAL_BASE(base)->DACFG[master] & TRDC_DACFG_NCM_MASK)) - { - TRDC_DOMAIN_ASSIGNMENT_BASE(base)->MDA_DFMT0[master].MDA_W_DFMT0[regNum] &= ~TRDC_MDA_W_DFMT0_VLD_MASK; - } - else - { - TRDC_DOMAIN_ASSIGNMENT_BASE(base)->MDA_DFMT1[master].MDA_W_DFMT1[0] &= ~TRDC_MDA_W_DFMT1_VLD_MASK; - } - } -} - -/*! - * @brief Gets the default master domain assignment for the processor bus master. - * - * This function gets the default master domain assignment for the processor bus master. - * It should only be used for the processor bus masters, such as CORE0. This function - * sets the assignment as follows: - * - * @code - * assignment->domainId = 0U; - * assignment->domainIdSelect = kTRDC_DidMda; - * assignment->lock = 0U; - * @endcode - * - * @param domainAssignment Pointer to the assignment structure. - */ -void TRDC_GetDefaultProcessorDomainAssignment(trdc_processor_domain_assignment_t *domainAssignment); - -/*! - * @brief Gets the default master domain assignment for non-processor bus master. - * - * This function gets the default master domain assignment for non-processor bus master. - * It should only be used for the non-processor bus masters, such as DMA. This function - * sets the assignment as follows: - * - * @code - * assignment->domainId = 0U; - * assignment->privilegeAttr = kTRDC_ForceUser; - * assignment->secureAttr = kTRDC_ForceSecure; - * assignment->bypassDomainId = 0U; - * assignment->lock = 0U; - * @endcode - * - * @param domainAssignment Pointer to the assignment structure. - */ -void TRDC_GetDefaultNonProcessorDomainAssignment(trdc_non_processor_domain_assignment_t *domainAssignment); - -/*! - * @brief Sets the processor bus master domain assignment. - * - * This function sets the processor master domain assignment as valid. - * One bus master might have multiple domain assignment registers. The parameter - * \p assignIndex specifies which assignment register to set. - * - * Example: Set domain assignment for core 0. - * - * @code - * trdc_processor_domain_assignment_t processorAssignment; - * - * TRDC_GetDefaultProcessorDomainAssignment(&processorAssignment); - * - * processorAssignment.domainId = 0; - * processorAssignment.xxx = xxx; - * TRDC_SetMasterDomainAssignment(TRDC, &processorAssignment); - * @endcode - * - * @param base TRDC peripheral base address. - * @param master Which master to configure, refer to trdc_master_t in processor header file. - * @param regNum Which register to configure, processor master can have more than one register for the MDAC - * configuration. - * @param domainAssignment Pointer to the assignment structure. - */ -void TRDC_SetProcessorDomainAssignment(TRDC_Type *base, - uint8_t master, - uint8_t regNum, - const trdc_processor_domain_assignment_t *domainAssignment); - -/*! - * @brief Sets the non-processor bus master domain assignment. - * - * This function sets the non-processor master domain assignment as valid. - * One bus master might have multiple domain assignment registers. The parameter - * \p assignIndex specifies which assignment register to set. - * - * Example: Set domain assignment for DMA0. - * @code - * trdc_non_processor_domain_assignment_t nonProcessorAssignment; - * - * TRDC_GetDefaultNonProcessorDomainAssignment(&nonProcessorAssignment); - * nonProcessorAssignment.domainId = 1; - * nonProcessorAssignment.xxx = xxx; - * - * TRDC_SetMasterDomainAssignment(TRDC, kTrdcMasterDma0, 0U, &nonProcessorAssignment); - * @endcode - * - * @param base TRDC peripheral base address. - * @param master Which master to configure, refer to trdc_master_t in processor header file. - * @param domainAssignment Pointer to the assignment structure. - */ -void TRDC_SetNonProcessorDomainAssignment(TRDC_Type *base, - uint8_t master, - const trdc_non_processor_domain_assignment_t *domainAssignment); - -/*! - * @brief Gets the bit map of the bus master(s) that is(are) sourcing a PID register. - * - * This function sets the non-processor master domain assignment as valid. - * - * @param base TRDC peripheral base address. - * @return the bit map of the master(s). Bit 1 sets indicates bus master 1. - */ -static inline uint64_t TRDC_GetActiveMasterPidMap(TRDC_Type *base) -{ - return ((uint64_t)TRDC_GENERAL_BASE(base)->TRDC_HWCFG3 << 32U) | (uint64_t)TRDC_GENERAL_BASE(base)->TRDC_HWCFG2; -} - -/*! - * @brief Sets the current Process identifier(PID) for processor core. - * - * Each processor has a corresponding process identifier (PID) which can be used to group tasks into different domains. - * Secure privileged software saves and restores the PID as part of any context switch. - * This data structure defines an array of 32-bit values, one per MDA module, that define the PID. Since this register - * resource is only applicable to processor cores, the data structure is typically sparsely populated. The HWCFG[2-3] - * registers provide a bitmap of the implemented PIDn registers. This data structure is indexed using the corresponding - * MDA instance number. Depending on the operating clock domain of each DAC instance, there may be optional information - * stored in the corresponding PIDm register to properly implement the LK2 = 2 functionality. - * - * @param base TRDC peripheral base address. - * @param master Which processor master to configure, refer to trdc_master_t in processor header file. - * @param pidConfig Pointer to the configuration structure. - */ -void TRDC_SetPid(TRDC_Type *base, uint8_t master, const trdc_pid_config_t *pidConfig); -/*! @} */ -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG) && FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG -/*! - * @name TZ-M congiguration - * @{ - */ -/*! - * @brief Gets the default IDAU(Implementation-Defined Attribution Unit) configuration. - * - * @code - * config->lockSecureVTOR = false; - * config->lockNonsecureVTOR = false; - * config->lockSecureMPU = false; - * config->lockNonsecureMPU = false; - * config->lockSAU = false; - * @endcode - * - * @param domainAssignment Pointer to the configuration structure. - */ -void TRDC_GetDefaultIDAUConfig(trdc_idau_config_t *idauConfiguration); - -/*! - * @brief Sets the IDAU(Implementation-Defined Attribution Unit) control configuration. - * - * Example: Lock the secure and non-secure MPU registers. - * - * @code - * trdc_idau_config_t idauConfiguration; - * - * TRDC_GetDefaultIDAUConfig(&idauConfiguration); - * - * idauConfiguration.lockSecureMPU = true; - * idauConfiguration.lockNonsecureMPU = true; - * TRDC_SetIDAU(TRDC, &idauConfiguration); - * @endcode - * - * @param base TRDC peripheral base address. - * @param domainAssignment Pointer to the configuration structure. - */ -void TRDC_SetIDAU(TRDC_Type *base, const trdc_idau_config_t *idauConfiguration); -/*! @} */ -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_FLW) && FSL_FEATURE_TRDC_HAS_FLW -/*! - * @name FLW(Flash Logical Window) configuration - * @{ - */ -/*! - * @brief Enables/disables the FLW(flash logical window) function. - * - * @param base TRDC peripheral base address. - * @param enable True to enable, false to disable. - */ -static inline void TRDC_EnableFlashLogicalWindow(TRDC_Type *base, bool enable) -{ - if (enable) - { - TRDC_FLW_BASE(base)->TRDC_FLW_CTL |= TRDC_TRDC_FLW_CTL_V_MASK; - } - else - { - TRDC_FLW_BASE(base)->TRDC_FLW_CTL &= ~TRDC_TRDC_FLW_CTL_V_MASK; - } -} - -/*! - * @brief Locks FLW registers. Once locked the registers can noy be updated until next reset. - * - * @param base TRDC peripheral base address. - */ -static inline void TRDC_LockFlashLogicalWindow(TRDC_Type *base) -{ - TRDC_FLW_BASE(base)->TRDC_FLW_CTL |= TRDC_TRDC_FLW_CTL_LK_MASK; -} - -/*! - * @brief Gets the FLW physical base address. - * - * @param base TRDC peripheral base address. - * @return Physical address of the FLW function. - */ -static inline uint32_t TRDC_GetFlashLogicalWindowPbase(TRDC_Type *base) -{ - return TRDC_FLW_BASE(base)->TRDC_FLW_PBASE; -} - -/*! - * @brief Sets the FLW size. - * - * @param base TRDC peripheral base address. - * @param size Size of the FLW in unit of 32k bytes. - */ -static inline void TRDC_GetSetFlashLogicalWindowSize(TRDC_Type *base, uint16_t size) -{ - TRDC_FLW_BASE(base)->TRDC_FLW_BCNT = size; -} - -/*! - * @brief Gets the default FLW(Flsh Logical Window) configuration. - * - * @code - * config->blockCount = false; - * config->arrayBaseAddr = false; - * config->lock = false; - * config->enable = false; - * @endcode - * - * @param flwConfiguration Pointer to the configuration structure. - */ -void TRDC_GetDefaultFlashLogicalWindowConfig(trdc_flw_config_t *flwConfiguration); - -/*! - * @brief Sets the FLW function's configuration. - * - * @code - * trdc_flw_config_t flwConfiguration; - * - * TRDC_GetDefaultIDAUConfig(&flwConfiguration); - * - * flwConfiguration.blockCount = 32U; - * flwConfiguration.arrayBaseAddr = 0xXXXXXXXX; - * TRDC_SetIDAU(TRDC, &flwConfiguration); - * @endcode - * - * @param base TRDC peripheral base address. - * @param flwConfiguration Pointer to the configuration structure. - */ -void TRDC_SetFlashLogicalWindow(TRDC_Type *base, const trdc_flw_config_t *flwConfiguration); -/*! @} */ -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_DOMAIN_ERROR) && FSL_FEATURE_TRDC_HAS_DOMAIN_ERROR -/*! - * @name Domain error check and clear - * @{ - */ -/*! - * @brief Gets and clears the first domain error of the current domain. - * - * This function gets the first access violation information for the current domain - * and clears the pending flag. There might be multiple access violations pending - * for the current domain. This function only processes the first error. - * - * @param base TRDC peripheral base address. - * @param error Pointer to the error information. - * @return If the access violation is captured, this function returns the kStatus_Success. - * The error information can be obtained from the parameter error. If no - * access violation is captured, this function returns the kStatus_NoData. - */ -status_t TRDC_GetAndClearFirstDomainError(TRDC_Type *base, trdc_domain_error_t *error); - -/*! - * @brief Gets and clears the first domain error of the specific domain. - * - * This function gets the first access violation information for the specific domain - * and clears the pending flag. There might be multiple access violations pending - * for the current domain. This function only processes the first error. - * - * @param base TRDC peripheral base address. - * @param error Pointer to the error information. - * @param domainId The error of which domain to get and clear. - * @return If the access violation is captured, this function returns the kStatus_Success. - * The error information can be obtained from the parameter error. If no - * access violation is captured, this function returns the kStatus_NoData. - */ -status_t TRDC_GetAndClearFirstSpecificDomainError(TRDC_Type *base, trdc_domain_error_t *error, uint8_t domainId); -/*! @} */ -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_MRC) && FSL_FEATURE_TRDC_HAS_MRC -/*! - * @name MRC configuration - * @{ - */ -#if defined(FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG) && FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG -/*! - * @brief Sets the TRDC MRC(Memory Region Checkers) global valid. - * - * Once enabled, it will remain enabled until next reset. - * - * @param base TRDC peripheral base address. - */ -static inline void TRDC_SetMrcGlobalValid(TRDC_Type *base) -{ - TRDC_GENERAL_BASE(base)->TRDC_CR |= TRDC_TRDC_CR_GVLDR_MASK; -} -#endif - -/*! - * @brief Gets the TRDC MRC(Memory Region Checkers) region number valid. - * - * @param base TRDC peripheral base address. - * @return the region number of the given MRC instance - */ -static inline uint8_t TRDC_GetMrcRegionNumber(TRDC_Type *base, uint8_t mrcIdx) -{ - return (uint8_t)((TRDC_MRC_BASE(base, mrcIdx)->MRC_GLBCFG & TRDC_MRC_GLBCFG_NRGNS_MASK) >> - TRDC_MRC_GLBCFG_NRGNS_SHIFT); -} - -/*! - * @brief Sets the memory access configuration for one of the access control register of one MRC. - * - * Example: Enable the secure operations and lock the configuration for MRC0 region 1. - * - * @code - * trdc_memory_access_control_config_t config; - * - * config.securePrivX = true; - * config.securePrivW = true; - * config.securePrivR = true; - * config.lock = true; - * TRDC_SetMrcMemoryAccess(TRDC, &config, 0, 1); - * @endcode - * - * @param base TRDC peripheral base address. - * @param config Pointer to the configuration structure. - * @param mrcIdx MRC index. - * @param regIdx Register number. - */ -void TRDC_MrcSetMemoryAccessConfig(TRDC_Type *base, - const trdc_memory_access_control_config_t *config, - uint8_t mrcIdx, - uint8_t regIdx); - -/*! - * @brief Enables the update of the selected domians. - * - * After the domians' update are enabled, their regions' NSE bits can be set or clear. - * - * @param base TRDC peripheral base address. - * @param mrcIdx MRC index. - * @param domianMask Bit mask of the domains to be enabled. - * @param enable True to enable, false to disable. - */ -void TRDC_MrcEnableDomainNseUpdate(TRDC_Type *base, uint8_t mrcIdx, uint16_t domianMask, bool enable); - -/*! - * @brief Sets the NSE bits of the selected regions for domains. - * - * This function sets the NSE bits for the selected regions for the domains whose update are enabled. - * - * @param base TRDC peripheral base address. - * @param mrcIdx MRC index. - * @param regionMask Bit mask of the regions whose NSE bits to set. - */ -void TRDC_MrcRegionNseSet(TRDC_Type *base, uint8_t mrcIdx, uint16_t regionMask); - -/*! - * @brief Clears the NSE bits of the selected regions for domains. - * - * This function clears the NSE bits for the selected regions for the domains whose update are enabled. - * - * @param base TRDC peripheral base address. - * @param mrcIdx MRC index. - * @param regionMask Bit mask of the regions whose NSE bits to clear. - */ -void TRDC_MrcRegionNseClear(TRDC_Type *base, uint8_t mrcIdx, uint16_t regionMask); - -/*! - * @brief Clears the NSE bits for all the regions of the selected domains. - * - * This function clears the NSE bits for all regions of selected domains whose update are enabled. - * - * @param base TRDC peripheral base address. - * @param mrcIdx MRC index. - * @param domainMask Bit mask of the domians whose NSE bits to clear. - */ -void TRDC_MrcDomainNseClear(TRDC_Type *base, uint8_t mrcIdx, uint16_t domainMask); - -/*! - * @brief Sets the configuration for one of the region descriptor per domain per MRC instnce. - * - * This function sets the configuration for one of the region descriptor, including the start - * and end address of the region, memory access control policy and valid. - * - * @param base TRDC peripheral base address. - * @param config Pointer to region descriptor configuration structure. - */ -void TRDC_MrcSetRegionDescriptorConfig(TRDC_Type *base, const trdc_mrc_region_descriptor_config_t *config); -/*! @} */ -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_MBC) && FSL_FEATURE_TRDC_HAS_MBC -/*! - * @name MBC configuration - * @{ - */ -#if defined(FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG) && FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG -/*! - * @brief Sets the TRDC MBC(Memory Block Checkers) global valid. - * - * Once enabled, it will remain enabled until next reset. - * - * @param base TRDC peripheral base address. - */ -static inline void TRDC_SetMbcGlobalValid(TRDC_Type *base) -{ - TRDC_GENERAL_BASE(base)->TRDC_CR |= TRDC_TRDC_CR_GVLDB_MASK; -} -#endif - -/*! - * @brief Gets the hardware configuration of the one of two slave memories within each MBC(memory block checker). - * - * @param base TRDC peripheral base address. - * @param config Pointer to the structure to get the configuration. - * @param mbcIdx MBC number. - * @param slvIdx Slave number. - */ -void TRDC_GetMbcHardwareConfig(TRDC_Type *base, - trdc_slave_memory_hardware_config_t *config, - uint8_t mbcIdx, - uint8_t slvIdx); - -/*! - * @brief Sets the NSR update configuration for one of the MBC instance. - * - * After set the NSE configuration, the configured memory area can be updateby NSE set/clear. - * - * @param base TRDC peripheral base address. - * @param config Pointer to NSE update configuration structure. - * @param mbcIdx MBC index. - */ -void TRDC_MbcSetNseUpdateConfig(TRDC_Type *base, const trdc_mbc_nse_update_config_t *config, uint8_t mbcIdx); - -/*! - * @brief Sets the NSE bits of the selected configuration words according to NSE update configuration. - * - * This function sets the NSE bits of the word for the configured regio, memory. - * - * @param base TRDC peripheral base address. - * @param mbcIdx MBC index. - * @param bitMask Mask of the bits whose NSE bits to set. - */ -void TRDC_MbcWordNseSet(TRDC_Type *base, uint8_t mbcIdx, uint32_t bitMask); - -/*! - * @brief Clears the NSE bits of the selected configuration words according to NSE update configuration. - * - * This function sets the NSE bits of the word for the configured regio, memory. - * - * @param base TRDC peripheral base address. - * @param mbcIdx MBC index. - * @param bitMask Mask of the bits whose NSE bits to clear. - */ -void TRDC_MbcWordNseClear(TRDC_Type *base, uint8_t mbcIdx, uint32_t bitMask); - -/*! - * @brief Clears all configuration words' NSE bits of the selected domain and memory. - * - * @param base TRDC peripheral base address. - * @param mbcIdx MBC index. - * @param domainMask Mask of the domains whose NSE bits to clear, 0b110 means clear domain 1&2. - * @param slaveMask Mask of the slaves whose NSE bits to clear, 0x11 means clear all slave 0&1's NSE bits. - */ -void TRDC_MbcNseClearAll(TRDC_Type *base, uint8_t mbcIdx, uint16_t domainMask, uint8_t slave); - -/*! - * @brief Sets the memory access configuration for one of the region descriptor of one MBC. - * - * Example: Enable the secure operations and lock the configuration for MRC0 region 1. - * - * @code - * trdc_memory_access_control_config_t config; - * - * config.securePrivX = true; - * config.securePrivW = true; - * config.securePrivR = true; - * config.lock = true; - * TRDC_SetMbcMemoryAccess(TRDC, &config, 0, 1); - * @endcode - * - * @param base TRDC peripheral base address. - * @param config Pointer to the configuration structure. - * @param mbcIdx MBC index. - * @param rgdIdx Region descriptor number. - */ -void TRDC_MbcSetMemoryAccessConfig(TRDC_Type *base, - const trdc_memory_access_control_config_t *config, - uint8_t mbcIdx, - uint8_t rgdIdx); - -/*! - * @brief Sets the configuration for one of the memory block per domain per MBC instnce. - * - * This function sets the configuration for one of the memory block, including the memory access - * control policy and nse enable. - * - * @param base TRDC peripheral base address. - * @param config Pointer to memory block configuration structure. - */ -void TRDC_MbcSetMemoryBlockConfig(TRDC_Type *base, const trdc_mbc_memory_block_config_t *config); -/*! @} */ -#endif - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ - -#endif /* FSL_TRDC_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_trdc_core.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_trdc_core.h deleted file mode 100644 index 8c3e2a9b508..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_trdc_core.h +++ /dev/null @@ -1,489 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_TRDC_CORE_H_ -#define FSL_TRDC_CORE_H_ - -#include "fsl_trdc_soc.h" - -/*! - * @addtogroup trdc_core - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/*!@brief TRDC general configuration register definition. */ -typedef struct _TRDC_General_Type -{ - __IO uint32_t TRDC_CR; /**< TRDC Register, offset: 0x0 */ - uint8_t RESERVED_0[236]; - __I uint32_t TRDC_HWCFG0; /**< TRDC Hardware Configuration Register 0, offset: 0xF0 */ - __I uint32_t TRDC_HWCFG1; /**< TRDC Hardware Configuration Register 1, offset: 0xF4 */ - __I uint32_t TRDC_HWCFG2; /**< TRDC Hardware Configuration Register 2, offset: 0xF8 */ - __I uint32_t TRDC_HWCFG3; /**< TRDC Hardware Configuration Register 3, offset: 0xFC */ - __I uint8_t DACFG[8]; /**< Domain Assignment Configuration Register, array offset: 0x100, array step: 0x1 */ - uint8_t RESERVED_1[184]; - __IO uint32_t TRDC_IDAU_CR; /**< TRDC IDAU Control Register, offset: 0x1C0 */ -} TRDC_General_Type; - -/*!@brief TRDC flash logical control register definition. */ -typedef struct _TRDC_FLW_Type -{ - __IO uint32_t TRDC_FLW_CTL; /**< TRDC FLW Control, offset: 0x1E0 */ - __I uint32_t TRDC_FLW_PBASE; /**< TRDC FLW Physical Base, offset: 0x1E4 */ - __IO uint32_t TRDC_FLW_ABASE; /**< TRDC FLW Array Base, offset: 0x1E8 */ - __IO uint32_t TRDC_FLW_BCNT; /**< TRDC FLW Block Count, offset: 0x1EC */ -} TRDC_FLW_Type; - -/*!@brief TRDC domain error register definition. */ -typedef struct _TRDC_DomainError_Type -{ - __IO uint32_t TRDC_FDID; /**< TRDC Fault Domain ID, offset: 0x1FC */ - __I uint32_t TRDC_DERRLOC[16]; /**< TRDC Domain Error Location Register, array offset: 0x200, array step: 0x4 */ - uint8_t RESERVED_4[448]; - struct - { /* offset: 0x400, array step: 0x10 */ - __I uint32_t W0; /**< MBC Domain Error Word0 Register, array offset: 0x400, array step: 0x10 */ - __I uint32_t W1; /**< MBC Domain Error Word1 Register, array offset: 0x404, array step: 0x10 */ - uint8_t RESERVED_0[4]; - __O uint32_t W3; /**< MBC Domain Error Word3 Register, array offset: 0x40C, array step: 0x10 */ - } MBC_DERR[8]; - struct - { /* offset: 0x480, array step: 0x10 */ - __I uint32_t W0; /**< MRC Domain Error Word0 Register, array offset: 0x480, array step: 0x10 */ - __I uint32_t W1; /**< MRC Domain Error Word1 Register, array offset: 0x484, array step: 0x10 */ - uint8_t RESERVED_0[4]; - __O uint32_t W3; /**< MRC Domain Error Word3 Register, array offset: 0x48C, array step: 0x10 */ - } MRC_DERR[8]; -} TRDC_DomainError_Type; - -/*!@brief TRDC master domain assignment register definition. */ -typedef struct _TRDC_DomainAssignment_Type -{ - __IO uint32_t PID[8]; /**< Process Identifier, array offset: 0x700, array step: 0x4 */ - uint8_t RESERVED_7[224]; - union - { - struct - { /* offset: 0x800, array step: 0x20 */ - __IO uint32_t MDA_W_DFMT0[8]; /**< DAC Master Domain Assignment Register, array offset: 0x800, array step: - index*0x20, index2*0x4 */ - } MDA_DFMT0[8]; - struct - { /* offset: 0x800, array step: 0x20 */ - __IO uint32_t MDA_W_DFMT1[1]; /**< DAC Master Domain Assignment Register, array offset: 0x800, array step: - index*0x20, index2*0x4 */ - uint8_t RESERVED_0[28]; - } MDA_DFMT1[8]; - }; -} TRDC_DomainAssignment_Type; - -/*!@brief TRDC MBC control register definition. */ -typedef struct _TRDC_MBC_Type -{ - __I uint32_t MBC_MEM_GLBCFG[4]; /**< MBC Global Configuration Register, array offset: 0x10000, array step: - index*0x2000, index2*0x4 */ - __IO uint32_t MBC_NSE_BLK_INDEX; /**< MBC NonSecure Enable Block Index, array offset: 0x10010, array step: 0x2000 */ - __O uint32_t MBC_NSE_BLK_SET; /**< MBC NonSecure Enable Block Set, array offset: 0x10014, array step: 0x2000 */ - __O uint32_t MBC_NSE_BLK_CLR; /**< MBC NonSecure Enable Block Clear, array offset: 0x10018, array step: 0x2000 */ - __O uint32_t - MBC_NSE_BLK_CLR_ALL; /**< MBC NonSecure Enable Block Clear All, array offset: 0x1001C, array step: 0x2000 */ - __IO uint32_t MBC_MEMN_GLBAC[8]; /**< MBC Global Access Control, array offset: 0x10020, array step: index*0x2000, - index2*0x4 */ - __IO uint32_t MBC_DOM0_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x10040, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM0_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10140, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM0_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10180, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM0_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x101A0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM0_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x101A8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM0_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x101C8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM0_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x101D0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM0_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x101F0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_0[72]; - __IO uint32_t MBC_DOM1_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x10240, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM1_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10340, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM1_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10380, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM1_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x103A0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM1_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x103A8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM1_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x103C8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM1_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x103D0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM1_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x103F0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_1[72]; - __IO uint32_t MBC_DOM2_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x10440, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM2_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10540, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM2_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10580, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM2_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x105A0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM2_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x105A8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM2_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x105C8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM2_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x105D0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM2_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x105F0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_2[72]; - __IO uint32_t MBC_DOM3_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x10640, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM3_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10740, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM3_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10780, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM3_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x107A0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM3_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x107A8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM3_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x107C8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM3_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x107D0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM3_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x107F0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_3[72]; - __IO uint32_t MBC_DOM4_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x10840, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM4_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10940, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM4_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10980, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM4_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x109A0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM4_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x109A8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM4_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x109C8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM4_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x109D0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM4_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x109F0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_4[72]; - __IO uint32_t MBC_DOM5_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x10A40, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM5_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10B40, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM5_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10B80, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM5_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10BA0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM5_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10BA8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM5_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10BC8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM5_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10BD0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM5_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10BF0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_5[72]; - __IO uint32_t MBC_DOM6_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x10C40, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM6_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10D40, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM6_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10D80, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM6_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10DA0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM6_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10DA8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM6_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10DC8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM6_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10DD0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM6_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10DF0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_7[72]; - __IO uint32_t MBC_DOM7_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x10E40, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM7_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10F40, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM7_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10F80, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM7_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10FA0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM7_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10FA8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM7_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10FC8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM7_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10FD0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM7_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10FF0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_8[72]; - __IO uint32_t MBC_DOM8_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x11040, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM8_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11140, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM8_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11180, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM8_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x111A0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM8_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x111A8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM8_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x111C8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM8_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x111D0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM8_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x111F0, array - step: index*0x2000, index2*0x4 */ - - __IO uint32_t MBC_DOM9_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x11240, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM9_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11340, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM9_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11380, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM9_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x113A0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM9_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x113A8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM9_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x113C8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM9_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x113D0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM9_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x113F0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_9[72]; - __IO uint32_t MBC_DOM10_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x11440, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM10_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11540, - array step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM10_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11580, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM10_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x115A0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM10_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x115A8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM10_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x115C8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM10_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x115D0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM10_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x115F0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_10[72]; - __IO uint32_t MBC_DOM11_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x11640, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM11_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11740, - array step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM11_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11780, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM11_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x117A0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM11_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x117A8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM11_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x117C8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM11_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x117D0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM11_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x117F0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_11[72]; - __IO uint32_t MBC_DOM12_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x11840, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM12_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11940, - array step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM12_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11980, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM12_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x119A0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM12_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x119A8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM12_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x119C8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM12_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x119D0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM12_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x119F0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_12[72]; - __IO uint32_t MBC_DOM13_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x11A40, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM13_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11B40, - array step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM13_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11B80, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM13_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11BA0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM13_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11BA8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM13_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11BC8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM13_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11BD0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM13_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11BF0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_13[72]; - __IO uint32_t MBC_DOM14_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x11C40, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM14_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11D40, - array step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM14_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11D80, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM14_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11DA0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM14_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11DA8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM14_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11DC8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM14_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11DD0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM14_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11DF0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_14[72]; - __IO uint32_t MBC_DOM15_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x11E40, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM15_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11F40, - array step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM15_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11F80, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM15_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11FA0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM15_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11FA8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM15_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11FC8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM15_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11FD0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM15_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11FF0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_15[8]; -} TRDC_MBC_Type; - -/*!@brief TRDC MRC control register definition. MRC_DOM0_RGD_W[region][word] */ -typedef struct _TRDC_MRC_Type -{ - __I uint32_t MRC_GLBCFG; /**< MRC Global Configuration Register, array offset: 0x14000, array step: 0x1000 */ - uint8_t RESERVED_0[12]; - __IO uint32_t - MRC_NSE_RGN_INDIRECT; /**< MRC NonSecure Enable Region Indirect, array offset: 0x14010, array step: 0x1000 */ - __O uint32_t MRC_NSE_RGN_SET; /**< MRC NonSecure Enable Region Set, array offset: 0x14014, array step: 0x1000 */ - __O uint32_t MRC_NSE_RGN_CLR; /**< MRC NonSecure Enable Region Clear, array offset: 0x14018, array step: 0x1000 */ - __O uint32_t - MRC_NSE_RGN_CLR_ALL; /**< MRC NonSecure Enable Region Clear All, array offset: 0x1401C, array step: 0x1000 */ - __IO uint32_t - MRC_GLBAC[8]; /**< MRC Global Access Control, array offset: 0x14020, array step: index*0x1000, index2*0x4 */ - __IO uint32_t MRC_DOM0_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14040, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM0_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x140C0, array step: 0x1000 */ - uint8_t RESERVED_1[124]; - __IO uint32_t MRC_DOM1_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14140, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM1_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x141C0, array step: 0x1000 */ - uint8_t RESERVED_2[124]; - __IO uint32_t MRC_DOM2_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14240, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM2_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x142C0, array step: 0x1000 */ - uint8_t RESERVED_3[124]; - __IO uint32_t MRC_DOM3_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14340, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM3_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x143C0, array step: 0x1000 */ - uint8_t RESERVED_4[124]; - __IO uint32_t MRC_DOM4_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14440, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM4_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x144C0, array step: 0x1000 */ - uint8_t RESERVED_5[124]; - __IO uint32_t MRC_DOM5_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14540, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM5_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x145C0, array step: 0x1000 */ - uint8_t RESERVED_6[124]; - __IO uint32_t MRC_DOM6_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14640, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM6_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x146C0, array step: 0x1000 */ - uint8_t RESERVED_7[124]; - __IO uint32_t MRC_DOM7_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14740, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM7_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x147C0, array step: 0x1000 */ - uint8_t RESERVED_8[124]; - __IO uint32_t MRC_DOM8_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14840, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM8_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x148C0, array step: 0x1000 */ - uint8_t RESERVED_9[124]; - __IO uint32_t MRC_DOM9_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14940, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM9_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x149C0, array step: 0x1000 */ - uint8_t RESERVED_10[124]; - __IO uint32_t MRC_DOM10_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14A40, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM10_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x14AC0, array step: 0x1000 */ - uint8_t RESERVED_11[124]; - __IO uint32_t MRC_DOM11_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14B40, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM11_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x14BC0, array step: 0x1000 */ - uint8_t RESERVED_12[124]; - __IO uint32_t MRC_DOM12_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14C40, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM12_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x14CC0, array step: 0x1000 */ - uint8_t RESERVED_13[124]; - __IO uint32_t MRC_DOM13_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14D40, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM13_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x14DC0, array step: 0x1000 */ - uint8_t RESERVED_14[124]; - __IO uint32_t MRC_DOM14_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14E40, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM14_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x14EC0, array step: 0x1000 */ - uint8_t RESERVED_15[124]; - __IO uint32_t MRC_DOM15_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14F40, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM15_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x14FC0, array step: 0x1000 */ -} TRDC_MRC_Type; - -/*!@brief TRDC base address convert macro */ -#define TRDC_GENERAL_BASE(base) ((TRDC_General_Type *)((base))) -#define TRDC_FLW_BASE(base) ((TRDC_FLW_Type *)(((uint32_t)(uintptr_t)(base) + (uint32_t)TRDC_FLW_OFFSET))) -#define TRDC_DOMAIN_ERROR_BASE(base) ((TRDC_DomainError_Type *)(((uint32_t)(uintptr_t)(base) + (uint32_t)TRDC_DOMAIN_ERROR_OFFSET))) -#define TRDC_DOMAIN_ASSIGNMENT_BASE(base) \ - ((TRDC_DomainAssignment_Type *)(((uint32_t)(uintptr_t)(base) + (uint32_t)TRDC_DOMAIN_ASSIGNMENT_OFFSET))) -#define TRDC_MBC_BASE(base, instance) \ - ((TRDC_MBC_Type *)((uint32_t)(uintptr_t)(base) + (uint32_t)TRDC_MBC_OFFSET(base) + (instance) * (uint32_t)TRDC_MBC_ARRAY_STEP)) -#define TRDC_MRC_BASE(base, instance) \ - ((TRDC_MRC_Type *)((uint32_t)(uintptr_t)(base) + (uint32_t)TRDC_MRC_OFFSET(base) + (instance) * (uint32_t)TRDC_MRC_ARRAY_STEP)) - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif - -/*! - * @} - */ - -#endif /* FSL_TRDC_CORE_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_trdc_soc.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_trdc_soc.h deleted file mode 100644 index 978a2ef2200..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_trdc_soc.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2024 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef _FSL_TRDC_SOC_H_ -#define _FSL_TRDC_SOC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup trdc_soc - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - /* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.trdc_soc" -#endif - -/*! @name Driver version */ -/*@{*/ -/*! @brief Driver version 2.0.0. */ -#define FSL_TRDC_SOC_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) -/*@}*/ - -#define TRDC_MBC_MEM_GLBCFG_NBLKS_MASK 0x000003FFUL -#define TRDC_MBC_MEM_GLBCFG_SIZE_LOG2_MASK 0x001F0000UL -#define TRDC_MBC_MEM_GLBCFG_SIZE_LOG2_SHIFT 16U -#define TRDC_MBC_NSE_BLK_CLR_ALL_MEMSEL(x) (((uint32_t)(x) & 0xFUL) << 8U) -#define TRDC_MBC_NSE_BLK_CLR_ALL_DID_SEL(x) (((uint32_t)(x) & 0x1UL) << 16U) - -/*!@brief TRDC feature */ -#define FSL_FEATURE_TRDC_DOMAIN_COUNT 1 - -/*!@brief TRDC base address convert macro */ -#define TRDC_MBC_COUNT 1 -#define TRDC_MBC_OFFSET(x) 0x0000 /* MBC register offset in TRDC_Type structure. */ -#define TRDC_MBC_ARRAY_STEP 0U /* Offset between two MBC control block, useless if there is only one. */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif - -/*! - * @} - */ - -#endif /* _FSL_TRDC_SOC_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_utick.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_utick.c deleted file mode 100644 index 0eea419cd34..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_utick.c +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2019, 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_utick.h" -#if !(defined(FSL_FEATURE_UTICK_HAS_NO_PDCFG) && FSL_FEATURE_UTICK_HAS_NO_PDCFG) -#include "fsl_power.h" -#endif -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.utick" -#endif - -/* Typedef for interrupt handler. */ -typedef void (*utick_isr_t)(UTICK_Type *base, utick_callback_t cb); - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Gets the instance from the base address - * - * @param base UTICK peripheral base address - * - * @return The UTICK instance - */ -static uint32_t UTICK_GetInstance(UTICK_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/* Array of UTICK handle. */ -static utick_callback_t s_utickHandle[FSL_FEATURE_SOC_UTICK_COUNT]; -/* Array of UTICK peripheral base address. */ -static UTICK_Type *const s_utickBases[] = UTICK_BASE_PTRS; -/* Array of UTICK IRQ number. */ -static const IRQn_Type s_utickIRQ[] = UTICK_IRQS; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/* Array of UTICK clock name. */ -static const clock_ip_name_t s_utickClock[] = UTICK_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_FEATURE_UTICK_HAS_NO_RESET) && FSL_FEATURE_UTICK_HAS_NO_RESET) -/*! @brief Pointers to UTICK resets for each instance. */ -static const reset_ip_name_t s_utickResets[] = UTICK_RSTS; -#endif - -/* UTICK ISR for transactional APIs. */ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -static utick_isr_t s_utickIsr = (utick_isr_t)DefaultISR; -#else -static utick_isr_t s_utickIsr; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t UTICK_GetInstance(UTICK_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_utickBases); instance++) - { - if (s_utickBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_utickBases)); - - return instance; -} - -/*! - * brief Starts UTICK. - * - * This function starts a repeat/onetime countdown with an optional callback - * - * param base UTICK peripheral base address. - * param mode UTICK timer mode (ie kUTICK_onetime or kUTICK_repeat) - * param count UTICK timer mode (ie kUTICK_onetime or kUTICK_repeat) - * param cb UTICK callback (can be left as NULL if none, otherwise should be a void func(void)) - * return none - */ -void UTICK_SetTick(UTICK_Type *base, utick_mode_t mode, uint32_t count, utick_callback_t cb) -{ - uint32_t instance; - - /* Get instance from peripheral base address. */ - instance = UTICK_GetInstance(base); - - /* Save the handle in global variables to support the double weak mechanism. */ - s_utickHandle[instance] = cb; -#if ((defined(FSL_FEATURE_SOC_SYSCON_COUNT) && (FSL_FEATURE_SOC_SYSCON_COUNT > 0)) && \ - !(defined(FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS) && FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS)) - EnableDeepSleepIRQ(s_utickIRQ[instance]); -#else - (void)EnableIRQ(s_utickIRQ[instance]); -#endif /* FSL_FEATURE_SOC_SYSCON_COUNT && !FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS */ - base->CTRL = count | UTICK_CTRL_REPEAT(mode); -} - -/*! - * brief Initializes an UTICK by turning its bus clock on - * - */ -void UTICK_Init(UTICK_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable utick clock */ - CLOCK_EnableClock(s_utickClock[UTICK_GetInstance(base)]); -#endif - -#if !(defined(FSL_FEATURE_UTICK_HAS_NO_RESET) && FSL_FEATURE_UTICK_HAS_NO_RESET) - RESET_PeripheralReset(s_utickResets[UTICK_GetInstance(base)]); -#endif - -#if !(defined(FSL_FEATURE_UTICK_HAS_NO_PDCFG) && FSL_FEATURE_UTICK_HAS_NO_PDCFG) - /* Power up Watchdog oscillator*/ - POWER_DisablePD(kPDRUNCFG_PD_WDT_OSC); -#endif - - s_utickIsr = UTICK_HandleIRQ; -} - -/*! - * brief Deinitializes a UTICK instance. - * - * This function shuts down Utick bus clock - * - * param base UTICK peripheral base address. - */ -void UTICK_Deinit(UTICK_Type *base) -{ - /* Turn off utick */ - base->CTRL = 0; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable utick clock */ - CLOCK_DisableClock(s_utickClock[UTICK_GetInstance(base)]); -#endif -} - -/*! - * brief Get Status Flags. - * - * This returns the status flag - * - * param base UTICK peripheral base address. - * return status register value - */ -uint32_t UTICK_GetStatusFlags(UTICK_Type *base) -{ - return (base->STAT); -} - -/*! - * brief Clear Status Interrupt Flags. - * - * This clears intr status flag - * - * param base UTICK peripheral base address. - * return none - */ -void UTICK_ClearStatusFlags(UTICK_Type *base) -{ - base->STAT = UTICK_STAT_INTR_MASK; -} - -/*! - * brief UTICK Interrupt Service Handler. - * - * This function handles the interrupt and refers to the callback array in the driver to callback user (as per request - * in UTICK_SetTick()). - * if no user callback is scheduled, the interrupt will simply be cleared. - * - * param base UTICK peripheral base address. - * param cb callback scheduled for this instance of UTICK - * return none - */ -void UTICK_HandleIRQ(UTICK_Type *base, utick_callback_t cb) -{ - UTICK_ClearStatusFlags(base); - if (cb != NULL) - { - cb(); - } -} - -#if defined(UTICK0) -void UTICK0_DriverIRQHandler(void); -void UTICK0_DriverIRQHandler(void) -{ - s_utickIsr(UTICK0, s_utickHandle[0]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#if defined(UTICK1) -void UTICK1_DriverIRQHandler(void); -void UTICK1_DriverIRQHandler(void) -{ - s_utickIsr(UTICK1, s_utickHandle[1]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#if defined(UTICK2) -void UTICK2_DriverIRQHandler(void); -void UTICK2_DriverIRQHandler(void) -{ - s_utickIsr(UTICK2, s_utickHandle[2]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#if defined(UTICK) -void UTICK_DriverIRQHandler(void); -void UTICK_DriverIRQHandler(void) -{ - s_utickIsr(UTICK, s_utickHandle[0]); - SDK_ISR_EXIT_BARRIER; -} -#endif diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_utick.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_utick.h deleted file mode 100644 index a3b734eae47..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_utick.h +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2019, 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_UTICK_H_ -#define FSL_UTICK_H_ - -#include "fsl_common.h" -/*! - * @addtogroup utick - * @{ - */ - -/*! @file*/ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief UTICK driver version 2.0.5. */ -#define FSL_UTICK_DRIVER_VERSION (MAKE_VERSION(2, 0, 5)) -/*! @} */ - -/*! @brief UTICK timer operational mode. */ -typedef enum _utick_mode -{ - kUTICK_Onetime = 0x0U, /*!< Trigger once*/ - kUTICK_Repeat = 0x1U, /*!< Trigger repeatedly */ -} utick_mode_t; - -/*! @brief UTICK callback function. */ -typedef void (*utick_callback_t)(void); - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* _cplusplus */ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Initializes an UTICK by turning its bus clock on - * - */ -void UTICK_Init(UTICK_Type *base); - -/*! - * @brief Deinitializes a UTICK instance. - * - * This function shuts down Utick bus clock - * - * @param base UTICK peripheral base address. - */ -void UTICK_Deinit(UTICK_Type *base); -/*! - * @brief Get Status Flags. - * - * This returns the status flag - * - * @param base UTICK peripheral base address. - * @return status register value - */ -uint32_t UTICK_GetStatusFlags(UTICK_Type *base); -/*! - * @brief Clear Status Interrupt Flags. - * - * This clears intr status flag - * - * @param base UTICK peripheral base address. - * @return none - */ -void UTICK_ClearStatusFlags(UTICK_Type *base); - -/*! - * @brief Starts UTICK. - * - * This function starts a repeat/onetime countdown with an optional callback - * - * @param base UTICK peripheral base address. - * @param mode UTICK timer mode (ie kUTICK_onetime or kUTICK_repeat) - * @param count UTICK timer mode (ie kUTICK_onetime or kUTICK_repeat) - * @param cb UTICK callback (can be left as NULL if none, otherwise should be a void func(void)) - * @return none - */ -void UTICK_SetTick(UTICK_Type *base, utick_mode_t mode, uint32_t count, utick_callback_t cb); -/*! - * @brief UTICK Interrupt Service Handler. - * - * This function handles the interrupt and refers to the callback array in the driver to callback user (as per request - * in UTICK_SetTick()). - * if no user callback is scheduled, the interrupt will simply be cleared. - * - * @param base UTICK peripheral base address. - * @param cb callback scheduled for this instance of UTICK - * @return none - */ -void UTICK_HandleIRQ(UTICK_Type *base, utick_callback_t cb); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_UTICK_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_vbat.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_vbat.c deleted file mode 100644 index 60f97571576..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_vbat.c +++ /dev/null @@ -1,498 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_vbat.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.mcx_vbat" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Configure internal 16kHz free running oscillator, including enabel FRO16k, gate FRO16k output. - * - * param base VBAT peripheral base address. - * param config Pointer to vbat_fro16k_config_t structure. - */ -void VBAT_ConfigFRO16k(VBAT_Type *base, const vbat_fro16k_config_t *config) -{ - assert(config != NULL); - - VBAT_EnableFRO16k(base, config->enableFRO16k); - VBAT_UngateFRO16k(base, config->enabledConnectionsMask); -} - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG) -/*! - * brief Set 32k crystal oscillator mode and load capacitance for the XTAL/EXTAL pin. - * - * param base VBAT peripheral base address. - * param operateMode Specify the crystal oscillator mode, please refer to vbat_osc32k_operate_mode_t. - * param xtalCap Specify the internal capacitance for the XTAL pin from the capacitor bank. - * param extalCap Specify the internal capacitance for the EXTAL pin from the capacitor bank. - * - * retval kStatus_VBAT_WrongCapacitanceValue The load capacitance value to set is not align with operate mode's - * requirements. - * retval kStatus_Success Success to set operate mode and load capacitance. - */ -status_t VBAT_SetCrystalOsc32kModeAndLoadCapacitance(VBAT_Type *base, - vbat_osc32k_operate_mode_t operateMode, - vbat_osc32k_load_capacitance_select_t xtalCap, - vbat_osc32k_load_capacitance_select_t extalCap) -{ - if (operateMode == kVBAT_Osc32kEnabledToTransconductanceMode) - { - if (((uint8_t)extalCap & 0x1U) == 0U) - { - return kStatus_VBAT_WrongCapacitanceValue; - } - } - - if (operateMode == kVBAT_Osc32kEnabledToLowPowerSwitchedMode) - { - if ((extalCap != kVBAT_Osc32kCrystalLoadCap0pF) && (xtalCap != kVBAT_Osc32kCrystalLoadCap0pF)) - { - return kStatus_VBAT_WrongCapacitanceValue; - } - } - - if (operateMode == kVBAT_Osc32kEnabledToLowPowerBackupMode) - { - if (((uint8_t)extalCap & 0x1U) != 0U) - { - return kStatus_VBAT_WrongCapacitanceValue; - } - } - - if ((xtalCap != kVBAT_Osc32kCrystalLoadCapBankDisabled) && (extalCap != kVBAT_Osc32kCrystalLoadCapBankDisabled)) - { - base->OSCCTLA |= VBAT_OSCCTLA_CAP_SEL_EN_MASK; - base->OSCCTLB &= ~VBAT_OSCCTLA_CAP_SEL_EN_MASK; - base->OSCCTLA = ((base->OSCCTLA & ~(VBAT_OSCCTLA_EXTAL_CAP_SEL_MASK | VBAT_OSCCTLA_XTAL_CAP_SEL_MASK)) | - (VBAT_OSCCTLA_XTAL_CAP_SEL(xtalCap) | VBAT_OSCCTLA_EXTAL_CAP_SEL(extalCap))); - base->OSCCTLB = ((base->OSCCTLB & ~(VBAT_OSCCTLA_EXTAL_CAP_SEL_MASK | VBAT_OSCCTLA_XTAL_CAP_SEL_MASK)) | - VBAT_OSCCTLA_XTAL_CAP_SEL(~(uint32_t)xtalCap) | VBAT_OSCCTLA_EXTAL_CAP_SEL(~(uint32_t)extalCap)); - } - - base->OSCCTLA = (((base->OSCCTLA & ~VBAT_OSCCTLA_MODE_EN_MASK)) | VBAT_OSCCTLA_MODE_EN(operateMode)); - base->OSCCTLB = ((base->OSCCTLB & ~VBAT_OSCCTLA_MODE_EN_MASK) | VBAT_OSCCTLA_MODE_EN(~(uint32_t)operateMode)); - - return kStatus_Success; -} -#endif /* FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG) -/*! - * brief Enable/disable Bandgap. - * - * note The FRO16K must be enabled before enableing the bandgap. - * note This setting can be locked by VBAT_LockRamLdoSettings() function. - * - * param base VBAT peripheral base address. - * param enable Used to enable/disable bandgap. - * - \b true Enable the bandgap. - * - \b false Disable the bandgap. - * - * retval kStatus_Success Success to enable/disable the bandgap. - * retval kStatus_VBAT_Fro16kNotEnabled Fail to enable the bandgap due to FRO16k is not enabled previously. - */ -status_t VBAT_EnableBandgap(VBAT_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - if (VBAT_CheckFRO16kEnabled(base)) - { - base->LDOCTLA |= VBAT_LDOCTLA_BG_EN_MASK; - base->LDOCTLB &= ~VBAT_LDOCTLA_BG_EN_MASK; - } - else - { - /* FRO16K must be enabled before enabling the Bandgap. */ - status = kStatus_VBAT_Fro16kNotEnabled; - } - } - else - { - base->LDOCTLA &= ~VBAT_LDOCTLA_BG_EN_MASK; - base->LDOCTLB |= VBAT_LDOCTLA_BG_EN_MASK; - } - - return status; -} - -/*! - * brief Enable/disable Backup RAM Regulator(RAM_LDO). - * - * note This setting can be locked by VBAT_LockRamLdoSettings() function. - * - * param base VBAT peripheral base address. - * param enable Used to enable/disable RAM_LDO. - * - \b true Enable backup SRAM regulator. - * - \b false Disable backup SRAM regulator. - * - * retval kStatusSuccess Success to enable/disable backup SRAM regulator. - * retval kStatus_VBAT_Fro16kNotEnabled Fail to enable backup SRAM regulator due to FRO16k is not enabled previously. - * retval kStatus_VBAT_BandgapNotEnabled Fail to enable backup SRAM regulator due to the bandgap is not enabled - * previously. - */ -status_t VBAT_EnableBackupSRAMRegulator(VBAT_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - if (VBAT_CheckFRO16kEnabled(base)) - { - if (VBAT_CheckBandgapEnabled(base)) - { - base->LDOCTLA |= VBAT_LDOCTLA_LDO_EN_MASK; - base->LDOCTLB &= ~VBAT_LDOCTLA_LDO_EN_MASK; - /* Polling until LDO is enabled. */ - while ((base->STATUSA & VBAT_STATUSA_LDO_RDY_MASK) == 0UL) - { - } - } - else - { - /* The bandgap must be enabled previously. */ - status = kStatus_VBAT_BandgapNotEnabled; - } - } - else - { - /* FRO16k must be enabled previously. */ - status = kStatus_VBAT_Fro16kNotEnabled; - } - } - else - { - base->LDOCTLA &= ~VBAT_LDOCTLA_LDO_EN_MASK; - base->LDOCTLB |= VBAT_LDOCTLA_LDO_EN_MASK; - } - - return status; -} - -/*! - * brief Switch the SRAM to be powered by VBAT. - * - * param base VBAT peripheral base address. - * - * retval kStatusSuccess Success to Switch SRAM powered by VBAT. - * retval kStatus_VBAT_Fro16kNotEnabled Fail to switch SRAM powered by VBAT due to FRO16K not enabled previously. - */ -status_t VBAT_SwitchSRAMPowerByLDOSRAM(VBAT_Type *base) -{ - status_t status = kStatus_Success; - - status = VBAT_EnableBandgap(base, true); - - if (status == kStatus_Success) - { - VBAT_EnableBandgapRefreshMode(base, true); - (void)VBAT_EnableBackupSRAMRegulator(base, true); - - /* Isolate the SRAM array */ - base->LDORAMC |= VBAT_LDORAMC_ISO_MASK; - /* Switch the supply to VBAT LDO. */ - base->LDORAMC |= VBAT_LDORAMC_SWI_MASK; - } - - return status; -} -#endif /* FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) && FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) -/*! - * brief Enable/disable Bandgap timer. - * - * note The bandgap timer is available when the bandgap is enabled and are clocked by the FRO16k. - * - * param base VBAT peripheral base address. - * param enable Used to enable/disable bandgap timer. - * param timerIdMask The mask of bandgap timer Id, should be the OR'ed value of vbat_bandgap_timer_id_t. - * - * retval kStatus_Success Success to enable/disable selected bandgap timer. - * retval kStatus_VBAT_Fro16kNotEnabled Fail to enable/disable selected bandgap timer due to FRO16k not enabled - * previously. retval kStatus_VBAT_BandgapNotEnabled Fail to enable/disable selected bandgap timer due to bandgap not - * enabled previously. - */ -status_t VBAT_EnableBandgapTimer(VBAT_Type *base, bool enable, uint8_t timerIdMask) -{ - status_t status = kStatus_Success; - - if (enable) - { - if (VBAT_CheckFRO16kEnabled(base)) - { - if (VBAT_CheckBandgapEnabled(base)) - { - if ((timerIdMask & (uint8_t)kVBAT_BandgapTimer0) != 0U) - { - base->LDOTIMER0 |= VBAT_LDOTIMER0_TIMEN_MASK; - } - - if ((timerIdMask & (uint8_t)kVBAT_BandgapTimer1) != 0U) - { - base->LDOTIMER1 |= VBAT_LDOTIMER1_TIMEN_MASK; - } - } - else - { - /* Bandgap must be enabled previously. */ - status = kStatus_VBAT_BandgapNotEnabled; - } - } - else - { - /* FRO16K must be enabled previously. */ - status = kStatus_VBAT_Fro16kNotEnabled; - } - } - else - { - if ((timerIdMask & (uint8_t)kVBAT_BandgapTimer0) != 0U) - { - base->LDOTIMER0 &= ~VBAT_LDOTIMER0_TIMEN_MASK; - } - - if ((timerIdMask & (uint8_t)kVBAT_BandgapTimer1) != 0U) - { - base->LDOTIMER1 &= ~VBAT_LDOTIMER1_TIMEN_MASK; - } - } - - return status; -} - -/*! - * brief Set bandgap timer0 timeout value. - * - * param base VBAT peripheral base address. - * param timeoutPeriod Bandgap timer timeout value, please refer to vbat_bandgap_timer0_timeout_period_t. - */ -void VBAT_SetBandgapTimer0TimeoutValue(VBAT_Type *base, vbat_bandgap_timer0_timeout_period_t timeoutPeriod) -{ - bool timerEnabled = false; - - timerEnabled = ((base->LDOTIMER0 & VBAT_LDOTIMER0_TIMEN_MASK) != 0UL) ? true : false; - - if (timerEnabled) - { - base->LDOTIMER0 &= ~VBAT_LDOTIMER0_TIMEN_MASK; - } - - base->LDOTIMER0 = ((base->LDOTIMER0 & (~VBAT_LDOTIMER0_TIMCFG_MASK)) | VBAT_LDOTIMER0_TIMCFG(timeoutPeriod)); - - if (timerEnabled) - { - base->LDOTIMER0 |= VBAT_LDOTIMER0_TIMEN_MASK; - } -} - -/*! - * brief Set bandgap timer1 timeout value. - * - * note The timeout value can only be changed when the timer is disabled. - * - * param base VBAT peripheral base address. - * param timeoutPeriod The bandgap timerout 1 period, in number of seconds, ranging from 0 to 65535s. - */ -void VBAT_SetBandgapTimer1TimeoutValue(VBAT_Type *base, uint32_t timeoutPeriod) -{ - bool timerEnabled = false; - - timerEnabled = ((base->LDOTIMER1 & VBAT_LDOTIMER1_TIMEN_MASK) != 0UL) ? true : false; - - if (timerEnabled) - { - base->LDOTIMER1 &= ~VBAT_LDOTIMER1_TIMEN_MASK; - } - - base->LDOTIMER1 = ((base->LDOTIMER1 & (~VBAT_LDOTIMER1_TIMCFG_MASK)) | VBAT_LDOTIMER1_TIMCFG(timeoutPeriod)); - - if (timerEnabled) - { - base->LDOTIMER1 |= VBAT_LDOTIMER1_TIMEN_MASK; - } -} -#endif /* FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) && FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) -/*! - * brief Initializes the VBAT clock monitor, enable clock monitor and set the clock monitor configuration. - * - * note Both FRO16K and OSC32K should be enabled and stable before invoking this function. - * - * param base VBAT peripheral base address. - * param config Pointer to vbat_clock_monitor_config_t structure. - * - * retval kStatus_Success Clock monitor is initialized successfully. - * retval kStatus_VBAT_Fro16kNotEnabled FRO16K is not enabled. - * retval kStatus_VBAT_Osc32kNotReady OSC32K is not ready. - * retval kStatus_VBAT_ClockMonitorLocked Clock monitor is locked. - */ -status_t VBAT_InitClockMonitor(VBAT_Type *base, const vbat_clock_monitor_config_t *config) -{ - assert(config != NULL); - - status_t status = kStatus_Success; - - if (VBAT_CheckFRO16kEnabled(base)) - { - if ((VBAT_GetStatusFlags(base) & kVBAT_StatusFlagOsc32kReady) != 0UL) - { - if (VBAT_CheckClockMonitorControlLocked(base)) - { - status = kStatus_VBAT_ClockMonitorLocked; - } - else - { - /* Disable clock monitor before configuring clock monitor. */ - VBAT_EnableClockMonitor(base, false); - /* Set clock monitor divide trim value. */ - VBAT_SetClockMonitorDivideTrim(base, config->divideTrim); - /* Set clock monitor frequency trim value. */ - VBAT_SetClockMonitorFrequencyTrim(base, config->freqTrim); - /* Enable clock monitor. */ - VBAT_EnableClockMonitor(base, true); - - if (config->lock) - { - VBAT_LockClockMonitorControl(base); - } - } - } - else - { - status = kStatus_VBAT_OSC32KNotReady; - } - } - else - { - status = kStatus_VBAT_Fro16kNotEnabled; - } - - return status; -} - -/*! - * brief Deinitialize the VBAT clock monitor. - * - * param base VBAT peripheral base address. - * - * retval kStatus_Success Clock monitor is de-initialized successfully. - * retval kStatus_VBAT_ClockMonitorLocked Control of Clock monitor is locked. - */ -status_t VBAT_DeinitMonitor(VBAT_Type *base) -{ - if (VBAT_CheckClockMonitorControlLocked(base)) - { - return kStatus_VBAT_ClockMonitorLocked; - } - - VBAT_EnableClockMonitor(base, false); - - return kStatus_Success; -} -#endif /* FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) && FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) -/*! - * brief Initialize tamper control. - * - * note Both FRO16K and bandgap should be enabled before calling this function. - * - * param base VBAT peripheral base address. - * param config Pointer to vbat_tamper_config_t structure. - * - * retval kStatus_Success Tamper is initialized successfully. - * retval kStatus_VBAT_TamperLocked Tamper control is locked. - * retval kStatus_VBAT_BandgapNotEnabled Bandgap is not enabled. - * retval kStatus_VBAT_Fro16kNotEnabled FRO 16K is not enabled. - */ -status_t VBAT_InitTamper(VBAT_Type *base, const vbat_tamper_config_t *config) -{ - assert(config != NULL); - - status_t status = kStatus_Success; - - if (VBAT_CheckFRO16kEnabled(base)) - { - if (VBAT_CheckBandgapEnabled(base)) - { - if (VBAT_CheckTamperControlLocked(base)) - { - return kStatus_VBAT_TamperLocked; - } - else - { - base->TAMCTLA = ((base->TAMCTLA & (~VBAT_TAMCTLA_VOLT_EN_MASK | VBAT_TAMCTLA_TEMP_EN_MASK)) | - VBAT_TAMCTLA_VOLT_EN(config->enableVoltageDetect) | - VBAT_TAMCTLA_TEMP_EN(config->enableTemperatureDetect)); - base->TAMCTLB = ((base->TAMCTLB & (~VBAT_TAMCTLA_VOLT_EN_MASK | VBAT_TAMCTLA_TEMP_EN_MASK)) | - VBAT_TAMCTLA_VOLT_EN((config->enableVoltageDetect) ? 0U : 1U) | - VBAT_TAMCTLA_TEMP_EN((config->enableTemperatureDetect) ? 0U : 1U)); - - if (config->lock) - { - VBAT_LockTamperControl(base); - } - } - } - else - { - status = kStatus_VBAT_BandgapNotEnabled; - } - } - else - { - status = kStatus_VBAT_Fro16kNotEnabled; - } - - return status; -} - -/*! - * brief De-initialize tamper control. - * - * param base VBAT peripheral base address. - * - * retval kStatus_Success Tamper is de-initialized successfully. - * retval kStatus_VBAT_TamperLocked Tamper control is locked. - */ -status_t VBAT_DeinitTamper(VBAT_Type *base) -{ - if (VBAT_CheckTamperControlLocked(base)) - { - return kStatus_VBAT_TamperLocked; - } - - base->TAMCTLA &= ~(VBAT_TAMCTLA_VOLT_EN_MASK | VBAT_TAMCTLA_TEMP_EN_MASK); - base->TAMCTLB |= (VBAT_TAMCTLA_VOLT_EN_MASK | VBAT_TAMCTLA_TEMP_EN_MASK); - - return kStatus_Success; -} -#endif /* FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_vbat.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_vbat.h deleted file mode 100644 index 5858b005eb9..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_vbat.h +++ /dev/null @@ -1,1386 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_VBAT_H_ -#define FSL_VBAT_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup mcx_vbat - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief VBAT driver version 2.3.1. */ -#define FSL_VBAT_DRIVER_VERSION (MAKE_VERSION(2, 3, 1)) -/*@}*/ - -#if !defined(VBAT_LDORAMC_RET_MASK) -#define VBAT_LDORAMC_RET_MASK (0xF00U) -#define VBAT_LDORAMC_RET_SHIFT (8U) -#define VBAT_LDORAMC_RET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDORAMC_RET_SHIFT)) & VBAT_LDORAMC_RET_MASK) -#endif - -/*! - * @brief The enumeration of VBAT module status. - */ -enum -{ - kStatus_VBAT_Fro16kNotEnabled = MAKE_STATUS(kStatusGroup_VBAT, 0), /*!< Internal 16kHz free running - oscillator not enabled. */ - kStatus_VBAT_BandgapNotEnabled = MAKE_STATUS(kStatusGroup_VBAT, 1), /*!< Bandgap not enabled. */ - kStatus_VBAT_WrongCapacitanceValue = MAKE_STATUS(kStatusGroup_VBAT, 2), /*!< Wrong capacitance for - selected oscillator mode. */ - kStatus_VBAT_ClockMonitorLocked = MAKE_STATUS(kStatusGroup_VBAT, 3), /*!< Clock monitor locked. */ - kStatus_VBAT_OSC32KNotReady = MAKE_STATUS(kStatusGroup_VBAT, 4), /*!< OSC32K not ready. */ - kStatus_VBAT_LDONotReady = MAKE_STATUS(kStatusGroup_VBAT, 5), /*!< LDO not ready. */ - kStatus_VBAT_TamperLocked = MAKE_STATUS(kStatusGroup_VBAT, 6), /*!< Tamper locked. */ -}; - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_STATUS_REG) && FSL_FEATURE_MCX_VBAT_HAS_STATUS_REG) -/*! - * @brief The enumeration of VBAT status flags. - * - * @anchor vbat_status_flag_t - */ -enum _vbat_status_flag -{ - kVBAT_StatusFlagPORDetect = VBAT_STATUSA_POR_DET_MASK, /*!< VBAT domain has been reset */ - kVBAT_StatusFlagWakeupPin = VBAT_STATUSA_WAKEUP_FLAG_MASK, /*!< A falling edge is detected on the wakeup pin. */ - kVBAT_StatusFlagBandgapTimer0 = VBAT_STATUSA_TIMER0_FLAG_MASK, /*!< Bandgap Timer0 period reached. */ - kVBAT_StatusFlagBandgapTimer1 = VBAT_STATUSA_TIMER1_FLAG_MASK, /*!< Bandgap Timer1 period reached. */ - kVBAT_StatusFlagLdoReady = VBAT_STATUSA_LDO_RDY_MASK, /*!< LDO is enabled and ready. */ - kVBAT_StatusFlagOsc32kReady = VBAT_STATUSA_OSC_RDY_MASK, /*!< OSC32k is enabled and clock is ready. */ -#if defined(VBAT_STATUSA_CLOCK_DET_MASK) - kVBAT_StatusFlagClockDetect = VBAT_STATUSA_CLOCK_DET_MASK, /*!< The clock monitor has detected an error. */ -#endif /* VBAT_STATUSA_CLOCK_DET_MASK */ - kVBAT_StatusFlagConfigDetect = VBAT_STATUSA_CONFIG_DET_MASK, /*!< Configuration error detected. */ -#if defined(VBAT_STATUSA_VOLT_DET_MASK) - kVBAT_StatusFlagVoltageDetect = VBAT_STATUSA_VOLT_DET_MASK, /*!< Voltage monitor has detected - an error with VBAT supply. */ -#endif /* VBAT_STATUSA_VOLT_DET_MASK */ -#if defined(VBAT_STATUSA_TEMP_DET_MASK) - kVBAT_StatusFlagTemperatureDetect = VBAT_STATUSA_TEMP_DET_MASK, /*!< Temperature monitor has detected an error. */ -#endif /* VBAT_STATUSA_TEMP_DET_MASK */ -#if defined(VBAT_STATUSA_SEC0_DET_MASK) - kVBAT_StatusFlagSec0Detect = VBAT_STATUSA_SEC0_DET_MASK, /*!< Security input 0 has detected an error. */ -#endif /* VBAT_STATUSA_SEC0_DET_MASK */ - kVBAT_StatusFlagInterrupt0Detect = VBAT_STATUSA_IRQ0_DET_MASK, /*!< Interrupt 0 asserted. */ - kVBAT_StatusFlagInterrupt1Detect = VBAT_STATUSA_IRQ1_DET_MASK, /*!< Interrupt 1 asserted. */ - kVBAT_StatusFlagInterrupt2Detect = VBAT_STATUSA_IRQ2_DET_MASK, /*!< Interrupt 2 asserted. */ - kVBAT_StatusFlagInterrupt3Detect = VBAT_STATUSA_IRQ3_DET_MASK, /*!< Interrupt 2 asserted. */ -}; - -/*! - * @brief The enumeration of VBAT interrupt enable. - * - * @anchor vbat_interrupt_enable_t - */ -enum _vbat_interrupt_enable -{ - kVBAT_InterruptEnablePORDetect = VBAT_IRQENA_POR_DET_MASK, /*!< Enable POR detect interrupt. */ - kVBAT_InterruptEnableWakeupPin = VBAT_IRQENA_WAKEUP_FLAG_MASK, /*!< Enable the interrupt when a falling edge is - detected on the wakeup pin. */ - kVBAT_InterruptEnableBandgapTimer0 = VBAT_IRQENA_TIMER0_FLAG_MASK, /*!< Enable the interrupt if Bandgap - Timer0 period reached. */ - kVBAT_InterruptEnableBandgapTimer1 = VBAT_IRQENA_TIMER1_FLAG_MASK, /*!< Enable the interrupt if Bandgap - Timer1 period reached. */ - kVBAT_InterruptEnableLdoReady = VBAT_IRQENA_LDO_RDY_MASK, /*!< Enable LDO ready interrupt. */ - kVBAT_InterruptEnableOsc32kReady = VBAT_IRQENA_OSC_RDY_MASK, /*!< Enable OSC32K ready interrupt. */ -#if defined(VBAT_IRQENA_CLOCK_DET_MASK) - kVBAT_InterruptEnableClockDetect = VBAT_IRQENA_CLOCK_DET_MASK, /*!< Enable clock monitor detect interrupt. */ -#endif /* VBAT_IRQENA_CLOCK_DET_MASK */ - kVBAT_InterruptEnableConfigDetect = - VBAT_IRQENA_CONFIG_DET_MASK, /*!< Enable configuration error detected interrupt. */ -#if defined(VBAT_IRQENA_VOLT_DET_MASK) - kVBAT_InterruptEnableVoltageDetect = VBAT_IRQENA_VOLT_DET_MASK, /*!< Enable voltage monitor detect interrupt. */ -#endif /* VBAT_IRQENA_VOLT_DET_MASK */ -#if defined(VBAT_IRQENA_TEMP_DET_MASK) - kVBAT_InterruptEnableTemperatureDetect = VBAT_IRQENA_TEMP_DET_MASK, /*!< Enable temperature monitor detect - interrupt. */ -#endif /* VBAT_IRQENA_TEMP_DET_MASK */ -#if defined(VBAT_IRQENA_SEC0_DET_MASK) - kVBAT_InterruptEnableSec0Detect = VBAT_IRQENA_SEC0_DET_MASK, /*!< Enable security input 0 detect interrupt. */ -#endif /* VBAT_IRQENA_SEC0_DET_MASK */ - kVBAT_InterruptEnableInterrupt0 = VBAT_IRQENA_IRQ0_DET_MASK, /*!< Enable the interrupt0. */ - kVBAT_InterruptEnableInterrupt1 = VBAT_IRQENA_IRQ1_DET_MASK, /*!< Enable the interrupt1. */ - kVBAT_InterruptEnableInterrupt2 = VBAT_IRQENA_IRQ2_DET_MASK, /*!< Enable the interrupt2. */ - kVBAT_InterruptEnableInterrupt3 = VBAT_IRQENA_IRQ3_DET_MASK, /*!< Enable the interrupt3. */ - - kVBAT_AllInterruptsEnable = - (VBAT_IRQENA_POR_DET_MASK | VBAT_IRQENA_WAKEUP_FLAG_MASK | VBAT_IRQENA_TIMER0_FLAG_MASK | - VBAT_IRQENA_TIMER1_FLAG_MASK | VBAT_IRQENA_LDO_RDY_MASK | VBAT_IRQENA_OSC_RDY_MASK | - VBAT_IRQENA_CONFIG_DET_MASK | VBAT_IRQENA_IRQ0_DET_MASK | VBAT_IRQENA_IRQ1_DET_MASK | - VBAT_IRQENA_IRQ2_DET_MASK | VBAT_IRQENA_IRQ3_DET_MASK), /*!< Enable all interrupts. */ -}; - -/*! - * @brief The enumeration of VBAT wakeup enable. - * - * @anchor vbat_wakeup_enable_t - */ -enum _vbat_wakeup_enable -{ - kVBAT_WakeupEnablePORDetect = VBAT_WAKENA_POR_DET_MASK, /*!< Enable POR detect wakeup. */ - kVBAT_WakeupEnableWakeupPin = VBAT_WAKENA_WAKEUP_FLAG_MASK, /*!< Enable wakeup feature when a falling edge is - detected on the wakeup pin. */ - kVBAT_WakeupEnableBandgapTimer0 = VBAT_WAKENA_TIMER0_FLAG_MASK, /*!< Enable wakeup feature when bandgap - timer0 period reached. */ - kVBAT_WakeupEnableBandgapTimer1 = VBAT_WAKENA_TIMER1_FLAG_MASK, /*!< Enable wakeup feature when bandgap - timer1 period reached. */ - kVBAT_WakeupEnableLdoReady = VBAT_WAKENA_LDO_RDY_MASK, /*!< Enable wakeup when LDO ready. */ - kVBAT_WakeupEnableOsc32kReady = VBAT_WAKENA_OSC_RDY_MASK, /*!< Enable wakeup when OSC32k ready. */ -#if defined(VBAT_WAKENA_CLOCK_DET_MASK) - kVBAT_WakeupEnableClockDetect = - VBAT_WAKENA_CLOCK_DET_MASK, /*!< Enable wakeup when clock monitor detect an error. */ -#endif /* VBAT_WAKENA_CLOCK_DET_MASK */ - kVBAT_WakeupEnableConfigDetect = VBAT_WAKENA_CONFIG_DET_MASK, /*!< Enable wakeup when - configuration error detected. */ -#if defined(VBAT_WAKENA_VOLT_DET_MASK) - kVBAT_WakeupEnableVoltageDetect = VBAT_WAKENA_VOLT_DET_MASK, /*!< Enable wakeup when voltage monitor detect an - error. */ -#endif /* VBAT_WAKENA_VOLT_DET_MASK */ -#if defined(VBAT_WAKENA_TEMP_DET_MASK) - kVBAT_WakeupEnableTemperatureDetect = VBAT_WAKENA_TEMP_DET_MASK, /*!< Enable wakeup when temperature monitor - detect an error. */ -#endif /* VBAT_WAKENA_TEMP_DET_MASK */ -#if defined(VBAT_WAKENA_SEC0_DET_MASK) - kVBAT_WakeupEnableSec0Detect = VBAT_WAKENA_SEC0_DET_MASK, /*!< Enable wakeup when security input 0 detect an - error. */ -#endif /* VBAT_WAKENA_SEC0_DET_MASK */ - kVBAT_WakeupEnableInterrupt0 = VBAT_WAKENA_IRQ0_DET_MASK, /*!< Enable wakeup when interrupt0 asserted. */ - kVBAT_WakeupEnableInterrupt1 = VBAT_WAKENA_IRQ1_DET_MASK, /*!< Enable wakeup when interrupt1 asserted. */ - kVBAT_WakeupEnableInterrupt2 = VBAT_WAKENA_IRQ2_DET_MASK, /*!< Enable wakeup when interrupt2 asserted. */ - kVBAT_WakeupEnableInterrupt3 = VBAT_WAKENA_IRQ3_DET_MASK, /*!< Enable wakeup when interrupt3 asserted. */ - - kVBAT_AllWakeupsEnable = (VBAT_WAKENA_POR_DET_MASK | VBAT_WAKENA_WAKEUP_FLAG_MASK | VBAT_WAKENA_TIMER0_FLAG_MASK | - VBAT_WAKENA_TIMER1_FLAG_MASK | VBAT_WAKENA_LDO_RDY_MASK | VBAT_WAKENA_OSC_RDY_MASK | - VBAT_WAKENA_CONFIG_DET_MASK | VBAT_WAKENA_IRQ0_DET_MASK | VBAT_WAKENA_IRQ1_DET_MASK | - VBAT_WAKENA_IRQ2_DET_MASK | VBAT_WAKENA_IRQ3_DET_MASK - -#if defined(VBAT_WAKENA_CLOCK_DET_MASK) - | VBAT_WAKENA_CLOCK_DET_MASK - -#endif /* VBAT_WAKENA_CLOCK_DET_MASK */ -#if defined(VBAT_WAKENA_VOLT_DET_MASK) - | VBAT_WAKENA_VOLT_DET_MASK - -#endif /* VBAT_WAKENA_VOLT_DET_MASK */ -#if defined(VBAT_WAKENA_TEMP_DET_MASK) - | VBAT_WAKENA_TEMP_DET_MASK - -#endif /* VBAT_WAKENA_TEMP_DET_MASK */ -#if defined(VBAT_WAKENA_SEC0_DET_MASK) - | VBAT_WAKENA_SEC0_DET_MASK - -#endif /* VBAT_WAKENA_SEC0_DET_MASK */ - ), /*!< Enable all wakeup. */ -}; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_STATUS_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) && FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) -/*! - * @brief The enumeration of VBAT tamper enable. - */ -enum _vbat_tamper_enable -{ - kVBAT_TamperEnablePOR = VBAT_TAMPERA_POR_DET_MASK, /*!< Enable tamper if POR asserted in STATUS register. */ - kVBAT_TamperEnableClockDetect = VBAT_TAMPERA_CLOCK_DET_MASK, /*!< Enable tamper if clock monitor detect an error. */ - kVBAT_TamperEnableConfigDetect = - VBAT_TAMPERA_CONFIG_DET_MASK, /*!< Enable tamper if configuration error detected. */ - kVBAT_TamperEnableVoltageDetect = VBAT_TAMPERA_VOLT_DET_MASK, /*!< Enable tamper if voltage monitor detect an - error. */ - kVBAT_TamperEnableTemperatureDetect = VBAT_TAMPERA_TEMP_DET_MASK, /*!< Enable tamper if temperature monitor - detect an error. */ - kVBAT_TamperEnableSec0Detect = VBAT_TAMPERA_SEC0_DET_MASK, /*!< Enable tamper if security input 0 detect an - error. */ -}; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) && FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) -/*! - * @brief The enumeration of bandgap timer id, VBAT support two bandgap timers. - * - * @anchor vbat_bandgap_timer_id_t - */ -enum _vbat_bandgap_timer_id -{ - kVBAT_BandgapTimer0 = 1U << 0U, /*!< Bandgap Timer0. */ - kVBAT_BandgapTimer1 = 1U << 1U, /*!< Bandgap Timer1. */ -}; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER */ - -/*! - * @brief The enumeration of connections for OSC32K/FRO32K output clock to other modules. - * - * @anchor vbat_clock_enable_t - */ -enum _vbat_clock_enable -{ - kVBAT_EnableClockToDomain0 = 1U << 0U, /*!< Enable clock to power domain0. */ - kVBAT_EnableClockToDomain1 = 1U << 1U, /*!< Enable clock to power domain1. */ - kVBAT_EnableClockToDomain2 = 1U << 2U, /*!< Enable clock to power domain2. */ - kVBAT_EnableClockToDomain3 = 1U << 3U, /*!< Enable clock to power domain3. */ -}; -#define kVBAT_EnableClockToVddBat kVBAT_EnableClockToDomain0 -#define kVBAT_EnableClockToVddSys kVBAT_EnableClockToDomain1 -#define kVBAT_EnableClockToVddWake kVBAT_EnableClockToDomain2 -#define kVBAT_EnableClockToVddMain kVBAT_EnableClockToDomain3 - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG) -/*! - * @brief The enumeration of SRAM arrays that controlled by VBAT. - * @anchor vbat_ram_array_t - */ -enum _vbat_ram_array -{ - kVBAT_SramArray0 = 1U << 0U, /*!< Specify SRAM array0 that controlled by VBAT. */ - kVBAT_SramArray1 = 1U << 1U, /*!< Specify SRAM array1 that controlled by VBAT. */ - kVBAT_SramArray2 = 1U << 2U, /*!< Specify SRAM array2 that controlled by VBAT. */ - kVBAT_SramArray3 = 1U << 3U, /*!< Specify SRAM array3 that controlled by VBAT. */ -}; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG */ - -/*! - * @brief The enumeration of bandgap refresh period. - */ -typedef enum _vbat_bandgap_refresh_period -{ - kVBAT_BandgapRefresh7P8125ms = 0U, /*!< Bandgap refresh every 7.8125ms. */ - kVBAT_BandgapRefresh15P625ms = 1U, /*!< Bandgap refresh every 15.625ms. */ - kVBAT_BandgapRefresh31P25ms = 2U, /*!< Bandgap refresh every 31.25ms. */ - kVBAT_BandgapRefresh62P5ms = 3U, /*!< Bandgap refresh every 62.5ms. */ -} vbat_bandgap_refresh_period_t; - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) && FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) -/*! - * @brief The enumeration of bandgap timer0 timeout period. - */ -typedef enum _vbat_bandgap_timer0_timeout_period -{ - kVBAT_BangapTimer0Timeout1s = 0U, /*!< Bandgap timer0 timerout every 1s. */ - kVBAT_BangapTimer0Timeout500ms = 1U, /*!< Bandgap timer0 timerout every 500ms. */ - kVBAT_BangapTimer0Timeout250ms = 2U, /*!< Bandgap timer0 timerout every 250ms. */ - kVBAT_BangapTimer0Timeout125ms = 3U, /*!< Bandgap timer0 timerout every 125ms. */ - kVBAT_BangapTimer0Timeout62P5ms = 4U, /*!< Bandgap timer0 timerout every 62.5ms. */ - kVBAT_BangapTimer0Timeout31P25ms = 5U, /*!< Bandgap timer0 timerout every 31.25ms. */ -} vbat_bandgap_timer0_timeout_period_t; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG) -/*! - * @brief The enumeration of osc32k operate mode, including Bypass mode, low power switched mode and so on. - */ -typedef enum _vbat_osc32k_operate_mode -{ - kVBAT_Osc32kEnabledToTransconductanceMode = 0U, /*!< Set to transconductance mode. */ - kVBAT_Osc32kEnabledToLowPowerBackupMode = 1U, /*!< Set to low power backup mode. */ - kVBAT_Osc32kEnabledToLowPowerSwitchedMode = 2U, /*!< Set to low power switched mode. */ -} vbat_osc32k_operate_mode_t; - -/*! - * @brief The enumeration of OSC32K load capacitance. - */ -typedef enum _vbat_osc32k_load_capacitance_select -{ - kVBAT_Osc32kCrystalLoadCap0pF = - 0U, /*!< Internal capacitance bank is enabled, set the internal capacitance to 0 pF. */ - kVBAT_Osc32kCrystalLoadCap2pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 2 pF. */ - kVBAT_Osc32kCrystalLoadCap4pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 4 pF. */ - kVBAT_Osc32kCrystalLoadCap6pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 6 pF. */ - kVBAT_Osc32kCrystalLoadCap8pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 8 pF. */ - kVBAT_Osc32kCrystalLoadCap10pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 10 pF. */ - kVBAT_Osc32kCrystalLoadCap12pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 12 pF. */ - kVBAT_Osc32kCrystalLoadCap14pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 14 pF. */ - kVBAT_Osc32kCrystalLoadCap16pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 16 pF. */ - kVBAT_Osc32kCrystalLoadCap18pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 18 pF. */ - kVBAT_Osc32kCrystalLoadCap20pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 20 pF. */ - kVBAT_Osc32kCrystalLoadCap22pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 22 pF. */ - kVBAT_Osc32kCrystalLoadCap24pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 24 pF. */ - kVBAT_Osc32kCrystalLoadCap26pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 26 pF. */ - kVBAT_Osc32kCrystalLoadCap28pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 28 pF. */ - kVBAT_Osc32kCrystalLoadCap30pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 30 pF. */ - kVBAT_Osc32kCrystalLoadCapBankDisabled = 0xF0U, /*!< Internal capacitance bank is disabled. */ -} vbat_osc32k_load_capacitance_select_t; - -/*! - * @brief The enumeration of start-up time of the oscillator. - */ -typedef enum _vbat_osc32k_start_up_time -{ - kVBAT_Osc32kStartUpTime8Sec = 0U, /*!< Configure the start-up time as 8 seconds. */ - kVBAT_Osc32kStartUpTime4Sec, /*!< Configure the start-up time as 4 seconds. */ - kVBAT_Osc32kStartUpTime2Sec, /*!< Configure the start-up time as 2 seconds. */ - kVBAT_Osc32kStartUpTime1Sec, /*!< Configure the start-up time as 1 seconds. */ - kVBAT_Osc32kStartUpTime0P5Sec, /*!< Configure the start-up time as 0.5 seconds. */ - kVBAT_Osc32kStartUpTime0P25Sec, /*!< Configure the start-up time as 0.25 seconds. */ - kVBAT_Osc32kStartUpTime0P125Sec, /*!< Configure the start-up time as 0.125 seconds. */ - kVBAT_Osc32kStartUpTime0P5MSec, /*!< Configure the start-up time as 0.5 milliseconds. */ -} vbat_osc32k_start_up_time_t; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_SWICTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_SWICTL_REG) -/*! - * @brief The enumeration of VBAT module supplies. - */ -typedef enum _vbat_internal_module_supply -{ - kVBAT_ModuleSuppliedByVddBat = 0U, /*!< VDD_BAT supplies VBAT modules. */ - kVBAT_ModuleSuppliedByVddSys = 1U, /*!< VDD_SYS supplies VBAT modules. */ -} vbat_internal_module_supply_t; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_SWICTL_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) && FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) -/*! - * @brief The enumeration of VBAT clock monitor divide trim value - */ -typedef enum _vbat_clock_monitor_divide_trim -{ - kVBAT_ClockMonitorOperateAt1kHz = 0U, /*!< Clock monitor operates at 1 kHz. */ - kVBAT_ClockMonitorOperateAt64Hz = 1U, /*!< Clock monitor operates at 64 Hz. */ -} vbat_clock_monitor_divide_trim_t; - -/*! - * @brief The enumeration of VBAT clock monitor frequency trim value used to adjust the clock monitor assert. - */ -typedef enum _vbat_clock_monitor_freq_trim -{ - kVBAT_ClockMonitorAssert2Cycle = 0U, /*!< Clock monitor assert 2 cycles after expected edge. */ - kVBAT_ClockMonitorAssert4Cycle = 1U, /*!< Clock monitor assert 4 cycles after expected edge. */ - kVBAT_ClockMonitorAssert6Cycle = 2U, /*!< Clock monitor assert 8 cycles after expected edge. */ - kVBAT_ClockMonitorAssert8Cycle = 3U, /*!< Clock monitor assert 8 cycles after expected edge. */ -} vbat_clock_monitor_freq_trim_t; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG */ - -/*! - * @brief The structure of internal 16kHz free running oscillator attributes. - */ -typedef struct _vbat_fro16k_config -{ - bool enableFRO16k; /*!< Enable/disable internal 16kHz free running oscillator. */ - uint8_t enabledConnectionsMask; /*!< The mask of connected modules to enable FRO16k clock output. */ -} vbat_fro16k_config_t; - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) && FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) -/*! - * @brief The structure of internal clock monitor, including divide trim and frequency trim. - */ -typedef struct _vbat_clock_monitor_config -{ - vbat_clock_monitor_divide_trim_t divideTrim : 1U; /* !< Divide trim value, please - refer to @ref vbat_clock_monitor_divide_trim_t */ - vbat_clock_monitor_freq_trim_t freqTrim : 2U; /*!< Frequency trim value used to adjust the clock monitor - assert, please refer to @ref vbat_clock_monitor_freq_trim_t. */ - bool lock : 1U; /*!< Lock the clock monitor control after enabled. */ -} vbat_clock_monitor_config_t; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) && FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) -/*! - * @brief The structure of Tamper configuration. - */ -typedef struct _vbat_tamper_config -{ - bool enableVoltageDetect : 1U; /*!< Enable/disable voltage detection. */ - bool enableTemperatureDetect : 1U; /*!< Enable/disable temperature detection. */ - bool lock : 1U; /*!< Lock the tamper control after enabled. */ -} vbat_tamper_config_t; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name FRO16K Control Interfaces - * @{ - */ - -/*! - * @brief Configure internal 16kHz free running oscillator, including enabel FRO16k, gate FRO16k output. - * - * @param base VBAT peripheral base address. - * @param config Pointer to @ref vbat_fro16k_config_t structure. - */ -void VBAT_ConfigFRO16k(VBAT_Type *base, const vbat_fro16k_config_t *config); - -/*! - * @brief Enable/disable internal 16kHz free running oscillator. - * - * @param base VBAT peripheral base address. - * @param enable Used to enable/disable 16kHz FRO. - * - \b true Enable internal 16kHz free running oscillator. - * - \b false Disable internal 16kHz free running oscillator. - */ -static inline void VBAT_EnableFRO16k(VBAT_Type *base, bool enable) -{ - if (enable) - { - base->FROCTLA |= VBAT_FROCTLA_FRO_EN_MASK; -#if (defined(VBAT_FROCTLB_INVERSE_MASK)) - base->FROCTLB &= ~VBAT_FROCTLB_INVERSE_MASK; -#endif /* VBAT_FROCTLB_INVERSE_MASK */ - } - else - { - base->FROCTLA &= ~VBAT_FROCTLA_FRO_EN_MASK; -#if (defined(VBAT_FROCTLB_INVERSE_MASK)) - base->FROCTLB |= VBAT_FROCTLB_INVERSE_MASK; -#endif /* VBAT_FROCTLB_INVERSE_MASK */ - } -} - -/*! - * @brief Check if internal 16kHz free running oscillator is enabled. - * - * @param base VBAT peripheral base address. - * - * @retval true The internal 16kHz Free running oscillator is enabled. - * @retval false The internal 16kHz Free running oscillator is enabled. - */ -static inline bool VBAT_CheckFRO16kEnabled(VBAT_Type *base) -{ - return (bool)((base->FROCTLA & VBAT_FROCTLA_FRO_EN_MASK) == VBAT_FROCTLA_FRO_EN_MASK); -} - -/*! - * @brief Enable FRO16kHz output clock to selected modules. - * - * @param base VBAT peripheral base address. - * @param connectionsMask The mask of modules that FRO16k is connected, should be the OR'ed - * value of @ref vbat_clock_enable_t. - */ -static inline void VBAT_UngateFRO16k(VBAT_Type *base, uint8_t connectionsMask) -{ - base->FROCLKE |= VBAT_FROCLKE_CLKE(connectionsMask); -} - -/*! - * @brief Disable FRO16kHz output clock to selected modules. - * - * @param base VBAT peripheral base address. - * @param connectionsMask The OR'ed value of @ref vbat_clock_enable_t. - */ -static inline void VBAT_GateFRO16k(VBAT_Type *base, uint8_t connectionsMask) -{ - base->FROCLKE &= ~VBAT_FROCLKE_CLKE(connectionsMask); -} - -/*! - * @brief Lock settings of internal 16kHz free running oscillator, please note that if locked 16kHz FRO's settings can - * not be updated until the next POR. - * - * @note Please note that the operation to ungate/gate FRO 16kHz output clock can not be locked by this function. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_LockFRO16kSettings(VBAT_Type *base) -{ - base->FROLCKA |= VBAT_FROLCKA_LOCK_MASK; -#if (defined(VBAT_FROLCKB_LOCK_MASK)) - base->FROLCKB &= ~VBAT_FROLCKB_LOCK_MASK; -#endif /* VBAT_FROLCKB_LOCK_MASK */ -} - -/*! - * @brief Check if FRO16K settings are locked. - * - * @param base VBAT peripheral base address. - * - * @return @c true in case of FRO16k settings are locked, @c false in case of FRO16k settings are not locked. - */ -static inline bool VBAT_CheckFRO16kSettingsLocked(VBAT_Type *base) -{ - return ((base->FROLCKA & VBAT_FROLCKA_LOCK_MASK) != 0UL); -} - -/*! @} */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG) -/*! - * @name OSC32K Control Interfaces - * @{ - */ - -/*! - * @brief Enable/disable 32K Crystal Oscillator. - * - * @param base VBAT peripheral base address. - * @param enable Used to enable/disable 32k Crystal Oscillator: - * - \b true Enable crystal oscillator and polling status register to check clock is ready. - * - \b false Disable crystal oscillator. - */ -static inline void VBAT_EnableCrystalOsc32k(VBAT_Type *base, bool enable) -{ - if (enable) - { - base->OSCCTLA |= VBAT_OSCCTLA_OSC_EN_MASK; - base->OSCCTLB &= ~VBAT_OSCCTLA_OSC_EN_MASK; - - /* Polling status register to check clock is ready. */ - while ((base->STATUSA & VBAT_STATUSA_OSC_RDY_MASK) == 0UL) - {} - } - else - { - base->OSCCTLA &= ~VBAT_OSCCTLA_OSC_EN_MASK; - base->OSCCTLB |= VBAT_OSCCTLA_OSC_EN_MASK; - } -} - -/*! - * @brief Bypass 32k crystal oscillator, the clock is still output by oscillator but this clock is the same as clock - * provided on EXTAL pin. - * - * @note In bypass mode, oscillator must be enabled; To exit bypass mode, oscillator must be disabled. - * - * @param base VBAT peripheral base address. - * @param enableBypass Used to enter/exit bypass mode: - * - \b true Enter into bypass mode; - * - \b false Exit bypass mode. - */ -static inline void VBAT_BypassCrystalOsc32k(VBAT_Type *base, bool enableBypass) -{ - if (enableBypass) - { - base->OSCCTLA |= (VBAT_OSCCTLA_OSC_EN_MASK | VBAT_OSCCTLA_OSC_BYP_EN_MASK); - base->OSCCTLB &= ~(VBAT_OSCCTLA_OSC_EN_MASK | VBAT_OSCCTLA_OSC_BYP_EN_MASK); - } - else - { - base->OSCCTLA &= ~(VBAT_OSCCTLA_OSC_EN_MASK | VBAT_OSCCTLA_OSC_BYP_EN_MASK); - base->OSCCTLB |= (VBAT_OSCCTLA_OSC_EN_MASK | VBAT_OSCCTLA_OSC_BYP_EN_MASK); - } -} - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_OSCCTLA_FINE_AMP_GAIN_BIT) && FSL_FEATURE_MCX_VBAT_HAS_OSCCTLA_FINE_AMP_GAIN_BIT) -/*! - * @brief Adjust 32k crystal oscillator amplifier gain. - * - * @param base VBAT peripheral base address. - * @param coarse Specify amplifier coarse trim value. - * @param fine Specify amplifier fine trim value. - */ -static inline void VBAT_AdjustCrystalOsc32kAmplifierGain(VBAT_Type *base, uint8_t coarse, uint8_t fine) -{ - base->OSCCTLA = ((base->OSCCTLA & ~(VBAT_OSCCTLA_COARSE_AMP_GAIN_MASK | VBAT_OSCCTLA_FINE_AMP_GAIN_MASK)) | - (VBAT_OSCCTLA_COARSE_AMP_GAIN(coarse) | VBAT_OSCCTLA_FINE_AMP_GAIN(fine))); - base->OSCCTLB = ((base->OSCCTLB & ~(VBAT_OSCCTLA_COARSE_AMP_GAIN_MASK | VBAT_OSCCTLA_FINE_AMP_GAIN_MASK)) | - (VBAT_OSCCTLA_COARSE_AMP_GAIN(~coarse) | VBAT_OSCCTLA_FINE_AMP_GAIN(~fine))); -} -#else -/*! - * @brief Adjust 32k crystal oscillator amplifier gain. - * - * @param base VBAT peripheral base address. - * @param coarse Specify amplifier coarse trim value. - */ -static inline void VBAT_AdjustCrystalOsc32kAmplifierGain(VBAT_Type *base, uint8_t coarse) -{ - base->OSCCTLA = (base->OSCCTLA & ~VBAT_OSCCTLA_COARSE_AMP_GAIN_MASK) | (VBAT_OSCCTLA_COARSE_AMP_GAIN(coarse)); - base->OSCCTLB = (base->OSCCTLB & ~VBAT_OSCCTLA_COARSE_AMP_GAIN_MASK) | (VBAT_OSCCTLA_COARSE_AMP_GAIN(~(uint32_t)coarse)); -} - -#endif /* */ - -/*! - * @brief Set 32k crystal oscillator mode and load capacitance for the XTAL/EXTAL pin. - * - * @param base VBAT peripheral base address. - * @param operateMode Specify the crystal oscillator mode, please refer to @ref vbat_osc32k_operate_mode_t. - * @param xtalCap Specify the internal capacitance for the XTAL pin from the capacitor bank. - * @param extalCap Specify the internal capacitance for the EXTAL pin from the capacitor bank. - * - * @retval kStatus_VBAT_WrongCapacitanceValue The load capacitance value to set is not align with operate mode's - * requirements. - * @retval kStatus_Success Success to set operate mode and load capacitance. - */ -status_t VBAT_SetCrystalOsc32kModeAndLoadCapacitance(VBAT_Type *base, - vbat_osc32k_operate_mode_t operateMode, - vbat_osc32k_load_capacitance_select_t xtalCap, - vbat_osc32k_load_capacitance_select_t extalCap); - -/*! - * @brief Trim 32k crystal oscillator startup time. - * - * @param base VBAT peripheral base address. - * @param startupTime Specify the startup time of the oscillator. - */ -static inline void VBAT_TrimCrystalOsc32kStartupTime(VBAT_Type *base, vbat_osc32k_start_up_time_t startupTime) -{ - base->OSCCFGA = ((base->OSCCFGA & ~(VBAT_OSCCFGA_INIT_TRIM_MASK)) | VBAT_OSCCFGA_INIT_TRIM(startupTime)); - base->OSCCFGB = ((base->OSCCFGB & ~(VBAT_OSCCFGA_INIT_TRIM_MASK)) | VBAT_OSCCFGA_INIT_TRIM(~((uint32_t)startupTime))); -} - -/*! - * @brief Set crystal oscillator comparator trim value when oscillator is set as low power switch mode. - * - * @param base VBAT peripheral base address. - * @param comparatorTrimValue Comparator trim value, ranges from 0 to 7. - */ -static inline void VBAT_SetOsc32kSwitchModeComparatorTrimValue(VBAT_Type *base, uint8_t comparatorTrimValue) -{ - base->OSCCFGA = ((base->OSCCFGA & ~VBAT_OSCCFGA_CMP_TRIM_MASK) | VBAT_OSCCFGA_CMP_TRIM(comparatorTrimValue)); - base->OSCCFGB = ((base->OSCCFGB & ~VBAT_OSCCFGA_CMP_TRIM_MASK) | VBAT_OSCCFGA_CMP_TRIM(~((uint32_t)comparatorTrimValue))); -} - -/*! - * @brief Set crystal oscillator delay trim value when oscillator is set as low power switch mode. - * - * @param base VBAT peripheral base address. - * @param delayTrimValue Delay trim value, ranges from 0 to 15. - */ -static inline void VBAT_SetOsc32kSwitchModeDelayTrimValue(VBAT_Type *base, uint8_t delayTrimValue) -{ - base->OSCCFGA = ((base->OSCCFGA & ~VBAT_OSCCFGA_DLY_TRIM_MASK) | VBAT_OSCCFGA_DLY_TRIM(delayTrimValue)); - base->OSCCFGB = ((base->OSCCFGB & ~VBAT_OSCCFGA_DLY_TRIM_MASK) | VBAT_OSCCFGA_DLY_TRIM(~((uint32_t)delayTrimValue))); -} - -/*! - * @brief Set crystal oscillator capacitor trim value when oscillator is set as low power switch mode. - * - * @param base VBAT peripheral base address. - * @param capacitorTrimValue Capacitor value to trim, ranges from 0 to 3. - */ -static inline void VBAT_SetOsc32kSwitchModeCapacitorTrimValue(VBAT_Type *base, uint8_t capacitorTrimValue) -{ - base->OSCCFGA = ((base->OSCCFGA & ~VBAT_OSCCFGA_CAP_TRIM_MASK) | VBAT_OSCCFGA_CAP_TRIM(capacitorTrimValue)); - base->OSCCFGB = ((base->OSCCFGB & ~VBAT_OSCCFGA_CAP_TRIM_MASK) | VBAT_OSCCFGA_CAP_TRIM(~((uint32_t)capacitorTrimValue))); -} - -/*! - * @brief Lock Osc32k settings, after locked all writes to the Oscillator registers are blocked. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_LookOsc32kSettings(VBAT_Type *base) -{ - base->OSCLCKA |= VBAT_OSCLCKA_LOCK_MASK; - base->OSCLCKB &= ~VBAT_OSCLCKB_LOCK_MASK; -} - -/*! - * @brief Unlock Osc32k settings. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_UnlockOsc32kSettings(VBAT_Type *base) -{ - base->OSCLCKA &= ~VBAT_OSCLCKA_LOCK_MASK; - base->OSCLCKB |= VBAT_OSCLCKB_LOCK_MASK; -} - -/*! - * @brief Check if osc32k settings are locked. - * - * @param base VBAT peripheral base address. - * @return \c true in case of osc32k settings are locked, \c false in case of osc32k settings are not locked. - */ -static inline bool VBAT_CheckOsc32kSettingsLocked(VBAT_Type *base) -{ - return ((base->OSCLCKA & VBAT_OSCLCKA_LOCK_MASK) != 0UL); -} - -/*! - * @brief Enable OSC32k output clock to selected modules. - * - * @param base VBAT peripheral base address. - * @param connectionsMask The OR'ed value of @ref vbat_clock_enable_t. - */ -static inline void VBAT_UngateOsc32k(VBAT_Type *base, uint8_t connectionsMask) -{ - base->OSCCLKE |= VBAT_OSCCLKE_CLKE(connectionsMask); -} - -/*! - * @brief Disable OSC32k output clock to selected modules. - * - * @param base VBAT peripheral base address. - * @param connectionsMask The OR'ed value of @ref vbat_clock_enable_t. - */ -static inline void VBAT_GateOsc32k(VBAT_Type *base, uint8_t connectionsMask) -{ - base->OSCCLKE &= ~VBAT_OSCCLKE_CLKE(connectionsMask); -} - -/*! @} */ -#endif /* FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG) -/*! - * @name RAM_LDO Control Interfaces - * @{ - */ - -/*! - * @brief Enable/disable Bandgap. - * - * @note The FRO16K must be enabled before enabling the bandgap. - * @note This setting can be locked by VBAT_LockRamLdoSettings() function. - * - * @param base VBAT peripheral base address. - * @param enable Used to enable/disable bandgap. - * - \b true Enable the bandgap. - * - \b false Disable the bandgap. - * - * @retval kStatus_Success Success to enable/disable the bandgap. - * @retval kStatus_VBAT_Fro16kNotEnabled Fail to enable the bandgap due to FRO16k is not enabled previously. - */ -status_t VBAT_EnableBandgap(VBAT_Type *base, bool enable); - -/*! - * @brief Check if bandgap is enabled. - * - * @param base VBAT peripheral base address. - * - * @retval true The bandgap is enabled. - * @retval false The bandgap is disabled. - */ -static inline bool VBAT_CheckBandgapEnabled(VBAT_Type *base) -{ - return (bool)((base->LDOCTLA & VBAT_LDOCTLA_BG_EN_MASK) == VBAT_LDOCTLA_BG_EN_MASK); -} - -/*! - * @brief Enable/disable bandgap low power refresh mode. - * - * @note For lowest power consumption, refresh mode must be enabled. - * @note This setting can be locked by VBAT_LockRamLdoSettings() function. - * - * @param base VBAT peripheral base address. - * @param enableRefreshMode Used to enable/disable bandgap low power refresh mode. - * - \b true Enable bandgap low power refresh mode. - * - \b false Disable bandgap low power refresh mode. - */ -static inline void VBAT_EnableBandgapRefreshMode(VBAT_Type *base, bool enableRefreshMode) -{ - if (enableRefreshMode) - { - base->LDOCTLA |= VBAT_LDOCTLA_REFRESH_EN_MASK; - base->LDOCTLB &= ~VBAT_LDOCTLA_REFRESH_EN_MASK; - } - else - { - base->LDOCTLA &= ~VBAT_LDOCTLA_REFRESH_EN_MASK; - base->LDOCTLB |= VBAT_LDOCTLA_REFRESH_EN_MASK; - } -} - -/*! - * @brief Enable/disable Backup RAM Regulator(RAM_LDO). - * - * @note This setting can be locked by VBAT_LockRamLdoSettings() function. - * - * @param base VBAT peripheral base address. - * @param enable Used to enable/disable RAM_LDO. - * - \b true Enable backup SRAM regulator. - * - \b false Disable backup SRAM regulator. - * - * @retval kStatusSuccess Success to enable/disable backup SRAM regulator. - * @retval kStatus_VBAT_Fro16kNotEnabled Fail to enable backup SRAM regulator due to FRO16k is not enabled previously. - * @retval kStatus_VBAT_BandgapNotEnabled Fail to enable backup SRAM regulator due to the bandgap is not enabled - * previously. - */ -status_t VBAT_EnableBackupSRAMRegulator(VBAT_Type *base, bool enable); - -/*! - * @brief Lock settings of RAM_LDO, please note that if locked then RAM_LDO's settings - * can not be updated until the next POR. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_LockRamLdoSettings(VBAT_Type *base) -{ - base->LDOLCKA |= VBAT_LDOLCKA_LOCK_MASK; - base->LDOLCKB &= ~VBAT_LDOLCKA_LOCK_MASK; -} - -/*! - * @brief Check if RAM_LDO settings is locked. - * - * @param base VBAT peripheral base address. - * @return @c true in case of RAM_LDO settings are locked, @c false in case of RAM_LDO settings are unlocked. - */ -static inline bool VBAT_CheckRamLdoSettingsLocked(VBAT_Type *base) -{ - return ((base->LDOLCKA & VBAT_LDOLCKA_LOCK_MASK) != 0UL); -} - -/*! - * @brief Switch the SRAM to be powered by LDO_RAM. - * - * @note This function can be used to switch the SRAM to the VBAT retention supply at any time, but please note that the - * SRAM must not be accessed during this time. - * @note Invoke this function to switch power supply before switching off external power. - * @note RAM_LDO must be enabled before invoking this function. - * @note To access the SRAM arrays retained by the LDO_RAM, please invoke VBAT_SwitchSRAMPowerBySocSupply(), after - * external power is switched back on. - * - * @param base VBAT peripheral base address. - * - * @retval kStatusSuccess Success to Switch SRAM powered by VBAT. - * @retval kStatus_VBAT_Fro16kNotEnabled Fail to switch SRAM powered by VBAT due to FRO16K not enabled previously. - */ -status_t VBAT_SwitchSRAMPowerByLDOSRAM(VBAT_Type *base); - -/*! - * @brief Switch the RAM to be powered by Soc Supply in software mode. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_SwitchSRAMPowerBySocSupply(VBAT_Type *base) -{ - base->LDORAMC &= ~VBAT_LDORAMC_SWI_MASK; - base->LDORAMC &= ~VBAT_LDORAMC_ISO_MASK; -} - -/*! - * @brief Power off selected SRAM array in low power modes. - * - * @param base VBAT peripheral base address. - * @param sramMask The mask of SRAM array to power off, should be the OR'ed value of @ref vbat_ram_array_t. - */ -static inline void VBAT_PowerOffSRAMsInLowPowerModes(VBAT_Type *base, uint8_t sramMask) -{ - base->LDORAMC |= (uint32_t)VBAT_LDORAMC_RET(sramMask); -} - -/*! - * @brief Retain selected SRAM array in low power modes. - * - * @param base VBAT peripheral base address. - * @param sramMask The mask of SRAM array to retain, should be the OR'ed value of @ref vbat_ram_array_t. - */ -static inline void VBAT_RetainSRAMsInLowPowerModes(VBAT_Type *base, uint8_t sramMask) -{ - base->LDORAMC &= ~(uint32_t)VBAT_LDORAMC_RET(sramMask); -} - -/*! - * @brief Enable/disable SRAM isolation. - * - * @param base VBAT peripheral base address. - * @param enable Used to enable/disable SRAM violation. - * - \b true SRAM will be isolated. - * - \b false SRAM state follows the SoC power modes. - */ -static inline void VBAT_EnableSRAMIsolation(VBAT_Type *base, bool enable) -{ - if (enable) - { - base->LDORAMC |= VBAT_LDORAMC_ISO_MASK; - } - else - { - base->LDORAMC &= ~VBAT_LDORAMC_ISO_MASK; - } -} - -/*! @} */ -#endif /* FSL_FEATURE_MCX_VBAT_HAS_RAM_LDO */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) && FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) -/*! @name Bandgap Timer Control Interfaces - * @{ - */ - -/*! - * @brief Enable/disable Bandgap timer. - * - * @note The bandgap timer is available when the bandgap is enabled and are clocked by the FRO16k. - * - * @param base VBAT peripheral base address. - * @param enable Used to enable/disable bandgap timer. - * @param timerIdMask The mask of bandgap timer Id, should be the OR'ed value of @ref vbat_bandgap_timer_id_t. - * - * @retval kStatus_Success Success to enable/disable selected bandgap timer. - * @retval kStatus_VBAT_Fro16kNotEnabled Fail to enable/disable selected bandgap timer due to FRO16k not enabled - * previously. - * @retval kStatus_VBAT_BandgapNotEnabled Fail to enable/disable selected bandgap timer due to bandgap not enabled - * previously. - */ -status_t VBAT_EnableBandgapTimer(VBAT_Type *base, bool enable, uint8_t timerIdMask); - -/*! - * @brief Set bandgap timer0 timeout value. - * - * @note The timeout value can only be changed when the timer is disabled. - * - * @param base VBAT peripheral base address. - * @param timeoutPeriod Bandgap timer timeout value, please refer to @ref vbat_bandgap_timer0_timeout_period_t. - */ -void VBAT_SetBandgapTimer0TimeoutValue(VBAT_Type *base, vbat_bandgap_timer0_timeout_period_t timeoutPeriod); - -/*! - * @brief Set bandgap timer1 timeout value. - * - * @note The timeout value can only be changed when the timer is disabled. - * - * @param base VBAT peripheral base address. - * @param timeoutPeriod The bandgap timerout 1 period, in number of seconds, ranging from 0 to 65535s. - */ -void VBAT_SetBandgapTimer1TimeoutValue(VBAT_Type *base, uint32_t timeoutPeriod); - -/*! @} */ -#endif /* FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_SWICTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_SWICTL_REG) -/*! @name Switch Control Interfaces - * @{ - */ - -/*! - * @brief Control the VBAT internal switch in active mode, VBAT modules can be suppiled by VDD_BAT and VDD_SYS. - * - * @param base VBAT peripheral base address. - * @param supply Used to control the VBAT internal switch. - */ -static inline void VBAT_SwitchVBATModuleSupplyActiveMode(VBAT_Type *base, vbat_internal_module_supply_t supply) -{ - if (supply == kVBAT_ModuleSuppliedByVddBat) - { - base->SWICTLA &= ~VBAT_SWICTLA_SWI_EN_MASK; - base->SWICTLB |= VBAT_SWICTLA_SWI_EN_MASK; - } - else - { - base->SWICTLA |= VBAT_SWICTLA_SWI_EN_MASK; - base->SWICTLB &= ~VBAT_SWICTLA_SWI_EN_MASK; - } -} - -/*! - * @brief Get VBAT module supply in active mode. - * - * @param base VBAT peripheral base address. - * @return VDD_SYS supplies VBAT modules or VDD_BAT supplies VBAT modules, in type of @ref - * vbat_internal_module_supply_t. - */ -static inline vbat_internal_module_supply_t VBAT_GetVBATModuleSupply(VBAT_Type *base) -{ - return (vbat_internal_module_supply_t)(uint8_t)(base->SWICTLA & VBAT_SWICTLA_SWI_EN_MASK); -} - -/*! - * @brief Control the VBAT internal switch in low power modes. - * - * @note If VBAT modules are supplied by VDD_SYS in low power modes, VBAT module will also supplied by VDD_SYS in active - * mode. - * - * @param base VBAT peripheral base address. - * @param supply Used to specify which voltage input supply VBAT modules in low power mode. - */ -static inline void VBAT_SwitchVBATModuleSupplyLowPowerMode(VBAT_Type *base, vbat_internal_module_supply_t supply) -{ - if (supply == kVBAT_ModuleSuppliedByVddBat) - { - base->SWICTLA &= ~VBAT_SWICTLA_LP_EN_MASK; - base->SWICTLB |= VBAT_SWICTLA_LP_EN_MASK; - } - else - { - base->SWICTLA |= VBAT_SWICTLA_SWI_EN_MASK; - base->SWICTLB &= ~VBAT_SWICTLA_SWI_EN_MASK; - base->SWICTLA |= VBAT_SWICTLA_LP_EN_MASK; - base->SWICTLB &= ~VBAT_SWICTLA_LP_EN_MASK; - } -} - -/*! - * @brief Lock switch control, if locked all writes to the switch registers will be blocked. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_LockSwitchControl(VBAT_Type *base) -{ - base->SWILCKA |= VBAT_SWILCKA_LOCK_MASK; - base->SWILCKB &= ~VBAT_SWILCKB_LOCK_MASK; -} - -/*! - * @brief Unlock switch control. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_UnlockSwitchControl(VBAT_Type *base) -{ - base->SWILCKA &= ~VBAT_SWILCKA_LOCK_MASK; - base->SWILCKB |= VBAT_SWILCKB_LOCK_MASK; -} - -/*! - * @brief Check if switch control is locked. - * - * @param base VBAT peripheral base address. - * - * @retval false switch control is not locked. - * @retval true switch control is locked, any writes to related registers are blocked. - */ -static inline bool VBAT_CheckSwitchControlLocked(VBAT_Type *base) -{ - return ((base->SWILCKA & VBAT_SWILCKA_LOCK_MASK) != 0UL); -} - -/*! @} */ -#endif /* FSL_FEATURE_MCX_VBAT_HAS_SWICTL_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) && FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) -/*! - * @name Clock Monitor Interfaces - * @{ - */ - -/*! - * @brief Initialize the VBAT clock monitor, enable clock monitor and set the clock monitor configuration. - * - * @note Both FRO16K and OSC32K should be enabled and stable before invoking this function. - * - * @param base VBAT peripheral base address. - * @param config Pointer to @ref vbat_clock_monitor_config_t structure. - * - * @retval kStatus_Success Clock monitor is initialized successfully. - * @retval kStatus_VBAT_Fro16kNotEnabled FRO16K is not enabled. - * @retval kStatus_VBAT_Osc32kNotReady OSC32K is not ready. - * @retval kStatus_VBAT_ClockMonitorLocked Clock monitor is locked. - */ -status_t VBAT_InitClockMonitor(VBAT_Type *base, const vbat_clock_monitor_config_t *config); - -/*! - * @brief Deinitialize the VBAT clock monitor. - * - * @param base VBAT peripheral base address. - * - * @retval kStatus_Success Clock monitor is de-initialized successfully. - * @retval kStatus_VBAT_ClockMonitorLocked Control of Clock monitor is locked. - */ -status_t VBAT_DeinitMonitor(VBAT_Type *base); - -/*! - * @brief Enable/disable clock monitor. - * - * @param base VBAT peripheral base address. - * @param enable Switcher to enable/disable clock monitor: - * - true: enable clock monitor; - * - false: disable clock monitor. - */ -static inline void VBAT_EnableClockMonitor(VBAT_Type *base, bool enable) -{ - if (enable) - { - base->MONCTLA |= VBAT_MONCTLA_MON_EN_MASK; - base->MONCTLB &= ~VBAT_MONCTLA_MON_EN_MASK; - } - else - { - base->MONCTLA &= ~VBAT_MONCTLA_MON_EN_MASK; - base->MONCTLB |= VBAT_MONCTLA_MON_EN_MASK; - } -} - -/*! - * @brief Set clock monitor's divide trim, avaiable value is #kVBAT_ClockMonitorOperateAt1kHz and - * #kVBAT_ClockMonitorOperateAt64Hz - * - * @param base VBAT peripheral base address. - * @param divideTrim Specify divide trim value, please refer to @ref vbat_clock_monitor_divide_trim_t. - */ -static inline void VBAT_SetClockMonitorDivideTrim(VBAT_Type *base, vbat_clock_monitor_divide_trim_t divideTrim) -{ - base->MONCFGA = (base->MONCFGA & ~VBAT_MONCFGA_DIVIDE_TRIM_MASK) | VBAT_MONCFGA_DIVIDE_TRIM(divideTrim); - base->MONCFGB = (base->MONCFGB & ~VBAT_MONCFGA_DIVIDE_TRIM_MASK) | VBAT_MONCFGA_DIVIDE_TRIM(~divideTrim); -} - -/*! - * @brief Set clock monitor's frequency trim, avaiable value is #kVBAT_ClockMonitorAssert2Cycle, - * #kVBAT_ClockMonitorAssert4Cycle, #kVBAT_ClockMonitorAssert6Cycle and #kVBAT_ClockMonitorAssert8Cycle. - * - * @param base VBAT peripheral base address. - * @param freqTrim Specify frequency trim value, please refer to @ref vbat_clock_monitor_freq_trim_t. - */ -static inline void VBAT_SetClockMonitorFrequencyTrim(VBAT_Type *base, vbat_clock_monitor_freq_trim_t freqTrim) -{ - base->MONCFGA = (base->MONCFGA & ~VBAT_MONCFGA_FREQ_TRIM_MASK) | VBAT_MONCFGA_FREQ_TRIM(freqTrim); - base->MONCFGB = (base->MONCFGB & ~VBAT_MONCFGA_FREQ_TRIM_MASK) | VBAT_MONCFGA_FREQ_TRIM(~freqTrim); -} - -/*! - * @brief Lock clock monitor enable/disable control. - * - * @note If locked, it is not allowed to change clock monitor enable/disable control. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_LockClockMonitorControl(VBAT_Type *base) -{ - base->MONLCKA |= VBAT_MONLCKA_LOCK_MASK; - base->MONLCKB &= ~VBAT_MONLCKA_LOCK_MASK; -} - -/*! - * @brief Unlock clock monitor enable/disable control. - * - * @param base VBTA peripheral base address. - */ -static inline void VBAT_UnlockClockMonitorControl(VBAT_Type *base) -{ - base->MONLCKA &= ~VBAT_MONLCKA_LOCK_MASK; - base->MONLCKB |= VBAT_MONLCKA_LOCK_MASK; -} - -/*! - * @brief Check if clock monitor enable/disable control is locked. - * - * @note If locked, it is not allowed to change clock monitor enable/disable control. - * - * @param base VBAT peripheral base address. - * - * @retval false clock monitor enable/disable control is not locked. - * @retval true clock monitor enable/disable control is locked, any writes to related registers are blocked. - */ -static inline bool VBAT_CheckClockMonitorControlLocked(VBAT_Type *base) -{ - return ((base->MONLCKA & VBAT_MONLCKA_LOCK_MASK) != 0UL); -} - -/*! @} */ -#endif /* FSL_FEATURE_VBAT_HAS_CLOCK_MONITOR */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) && FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) -/*! @name Tamper Control Interfaces - * - */ - -/*! - * @brief Initialize tamper control. - * - * @note Both FRO16K and bandgap should be enabled before calling this function. - * - * @param base VBAT peripheral base address. - * @param config Pointer to @ref vbat_tamper_config_t structure. - * - * @retval kStatus_Success Tamper is initialized successfully. - * @retval kStatus_VBAT_TamperLocked Tamper control is locked. - * @retval kStatus_VBAT_BandgapNotEnabled Bandgap is not enabled. - * @retval kStatus_VBAT_Fro16kNotEnabled FRO 16K is not enabled. - */ -status_t VBAT_InitTamper(VBAT_Type *base, const vbat_tamper_config_t *config); - -/*! - * @brief De-initialize tamper control. - * - * @param base VBAT peripheral base address. - * - * @retval kStatus_Success Tamper is de-initialized successfully. - * @retval kStatus_VBAT_TamperLocked Tamper control is locked. - */ -status_t VBAT_DeinitTamper(VBAT_Type *base); - -/*! - * @brief Enable tampers for VBAT. - * - * @param base VBAT peripheral base address. - * @param tamperEnableMask Mask of tamper to be enabled, should be the OR'ed value of @ref _vbat_tamper_enable. - */ -static inline void VBAT_EnableTamper(VBAT_Type *base, uint32_t tamperEnableMask) -{ - base->TAMPERA |= tamperEnableMask; - base->TAMPERB &= ~tamperEnableMask; -} - -/*! - * @brief Disable tampers for VBAT. - * - * @param base VBAT peripheral base address. - * @param tamperEnableMask Mask of tamper to be disabled, should be the OR'ed value of @ref _vbat_tamper_enable. - */ -static inline void VBAT_DisableTamper(VBAT_Type *base, uint32_t tamperEnableMask) -{ - base->TAMPERA &= ~tamperEnableMask; - base->TAMPERB |= tamperEnableMask; -} - -/*! - * @brief Get tamper enable information. - * - * @param base VBAT peripheral base address. - * - * @return Mask of tamper enable information, should be the OR'ed value of @ref _vbat_tamper_enable. - */ -static inline uint32_t VBAT_GetTamperEnableInfo(VBAT_Type *base) -{ - return base->TAMPERA; -} - -/*! - * @brief Lock tamper control, if locked, it is not allowed to change tamper control. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_LockTamperControl(VBAT_Type *base) -{ - base->TAMLCKA |= VBAT_TAMLCKA_LOCK_MASK; - base->TAMLCKB &= ~VBAT_TAMLCKA_LOCK_MASK; -} - -/*! - * @brief Unlock tamper control. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_UnlockTamperControl(VBAT_Type *base) -{ - base->TAMLCKA &= ~VBAT_TAMLCKA_LOCK_MASK; - base->TAMLCKB |= VBAT_TAMLCKA_LOCK_MASK; -} - -/*! - * @brief Check if tamper control is locked. - * - * @param base VBAT peripheral base address. - * - * @retval false Tamper control is not locked. - * @retval true Tamper control is locked, any writes to related registers are blocked. - */ -static inline bool VBAT_CheckTamperControlLocked(VBAT_Type *base) -{ - return ((base->TAMLCKA & VBAT_TAMLCKA_LOCK_MASK) != 0UL); -} - -/*! @} */ -#endif /* FSL_FEATURE_VBAT_HAS_TAMPER */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_STATUS_REG) && FSL_FEATURE_MCX_VBAT_HAS_STATUS_REG) -/*! @name Status, Interrupt, Wakeup Control Interfaces - * @{ - */ - -/*! - * @brief Get VBAT status flags - * - * @param base VBAT peripheral base address. - * @return The asserted status flags, should be the OR'ed value of @ref vbat_status_flag_t. - */ -static inline uint32_t VBAT_GetStatusFlags(VBAT_Type *base) -{ - return (uint32_t)(base->STATUSA); -} - -/*! - * @brief Clear VBAT status flags. - * - * @param base VBAT peripheral base address. - * @param mask The mask of status flags to be cleared, should be the OR'ed value of @ref vbat_status_flag_t except - * @ref kVBAT_StatusFlagLdoReady, @ref kVBAT_StatusFlagOsc32kReady, @ref kVBAT_StatusFlagInterrupt0Detect, - * @ref kVBAT_StatusFlagInterrupt1Detect, @ref kVBAT_StatusFlagInterrupt2Detect, - * @ref kVBAT_StatusFlagInterrupt3Detect. - */ -static inline void VBAT_ClearStatusFlags(VBAT_Type *base, uint32_t mask) -{ - base->STATUSA = mask; - base->STATUSB = ~mask; -} - -/*! - * @brief Enable interrupts for the VBAT module, such as POR detect interrupt, Wakeup Pin interrupt and so on. - * - * @param base VBAT peripheral base address. - * @param mask The mask of interrupts to be enabled, should be the OR'ed value of @ref vbat_interrupt_enable_t. - */ -static inline void VBAT_EnableInterrupts(VBAT_Type *base, uint32_t mask) -{ - base->IRQENA |= mask; - base->IRQENB &= (uint32_t)~mask; -} - -/*! - * @brief Disable interrupts for the VBAT module, such as POR detect interrupt, wakeup pin interrupt and so on. - * - * @param base VBAT peripheral base address. - * @param mask The mask of interrupts to be disabled, should be the OR'ed value of @ref vbat_interrupt_enable_t. - */ -static inline void VBAT_DisableInterrupts(VBAT_Type *base, uint32_t mask) -{ - base->IRQENA &= ~mask; - base->IRQENB |= mask; -} - -/*! - * @brief Enable wakeup for the VBAT module, such as POR detect wakeup, wakeup pin wakeup and so on. - * - * @param base VBAT peripheral base address. - * @param mask The mask of enumerators in @ref vbat_wakeup_enable_t. - */ -static inline void VBAT_EnableWakeup(VBAT_Type *base, uint32_t mask) -{ - base->WAKENA |= mask; - base->WAKENB &= ~mask; -} - -/*! - * @brief Disable wakeup for VBAT module, such as POR detect wakeup, wakeup pin wakeup and so on. - * - * @param base VBAT peripheral base address. - * @param mask The mask of enumerators in @ref vbat_wakeup_enable_t. - */ -static inline void VBAT_DisableWakeup(VBAT_Type *base, uint32_t mask) -{ - base->WAKENA &= ~mask; - base->WAKENB |= mask; -} - -/*! - * @brief Lock VBAT interrupt and wakeup settings, please note that if locked the interrupt and wakeup settings can not - * be updated until the next POR. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_LockInterruptWakeupSettings(VBAT_Type *base) -{ - base->LOCKA |= VBAT_LOCKA_LOCK_MASK; -} - -/*! - * @brief Set the default state of the WAKEUP_b pin output when no enabled wakeup source is asserted. - * - * @param base VBAT peripheral base address. - * @param assert Used to set default state of the WAKEUP_b pin output: - * - \b true WAKEUP_b output state is logic one; - * - \b false WAKEUP_b output state is logic zero. - */ -static inline void VBAT_SetWakeupPinDefaultState(VBAT_Type *base, bool assert) -{ - if (assert) - { - base->WAKECFG |= VBAT_WAKECFG_OUT_MASK; - } - else - { - base->WAKECFG &= ~VBAT_WAKECFG_OUT_MASK; - } -} - -/*! @} */ -#endif /* FSL_FEATURE_MCX_VBAT_HAS_STATUS_REG */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ -#endif /* FSL_VBAT_H__ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_waketimer.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_waketimer.c deleted file mode 100644 index d45699c605d..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_waketimer.c +++ /dev/null @@ -1,253 +0,0 @@ -/* - * Copyright 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_waketimer.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.waketimer" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * brief Gets the instance from the base address - * - * param base WAKETIMER peripheral base address - * - * return The WAKETIMER instance - */ -static uint32_t WAKETIMER_GetInstance(WAKETIMER_Type *base); - -/*! - * brief WAKETIMER generic IRQ handle function. - * - * param index WAKETIMER peripheral instance index. - */ -static void WAKETIMER_GenericIRQHandler(WAKETIMER_Type *base, waketimer_callback_t callback); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/* Array of WAKETIMER peripheral base address. */ -static WAKETIMER_Type *const s_waketimerBases[] = WAKETIMER_BASE_PTRS; -/* Array of WAKETIMER ISR. */ -static waketimer_callback_t s_waketimerCallback[sizeof(s_waketimerBases) / sizeof(s_waketimerBases[0])]; -/* Array of WAKETIMER IRQ number. */ -static const IRQn_Type s_waketimerIRQ[] = WAKETIMER_IRQS; - -/******************************************************************************* - * Code - ******************************************************************************/ - -/* brief Function for getting the instance number of Waketimer. */ -static uint32_t WAKETIMER_GetInstance(WAKETIMER_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_waketimerBases); instance++) - { - if (s_waketimerBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_waketimerBases)); - - return instance; -} - -/*! - * brief Initializes an WAKETIMER. - * param base WAKETIMER peripheral base address. - */ -void WAKETIMER_Init(WAKETIMER_Type *base, const waketimer_config_t *config) -{ - assert(NULL != base); - - uint32_t index = WAKETIMER_GetInstance(base); - - /* Halt timer */ - base->WAKE_TIMER_CTRL |= WAKETIMER_WAKE_TIMER_CTRL_CLR_WAKE_TIMER_MASK; - - /* Set OSC divide */ - if (config->enableOSCDivide) - { - base->WAKE_TIMER_CTRL |= WAKETIMER_WAKE_TIMER_CTRL_OSC_DIV_ENA_MASK; - } - else - { - base->WAKE_TIMER_CTRL &= ~WAKETIMER_WAKE_TIMER_CTRL_OSC_DIV_ENA_MASK; - } - - /* Set callback */ - s_waketimerCallback[index] = config->callback; - - /* Set interrupt */ - if (config->enableInterrupt) - { - base->WAKE_TIMER_CTRL |= WAKETIMER_WAKE_TIMER_CTRL_INTR_EN_MASK; - (void)EnableIRQ(s_waketimerIRQ[index]); - } - else - { - base->WAKE_TIMER_CTRL &= ~WAKETIMER_WAKE_TIMER_CTRL_INTR_EN_MASK; - (void)DisableIRQ(s_waketimerIRQ[index]); - } -} - -/*! - * brief Deinitializes a WAKETIMER instance. - * - * This function deinitializes the WAKETIMER. - * - * param base WAKETIMER peripheral base address. - */ -void WAKETIMER_Deinit(WAKETIMER_Type *base) -{ - assert(NULL != base); - - uint32_t index = WAKETIMER_GetInstance(base); - - /* Disable IRQ at NVIC Level */ - (void)DisableIRQ(s_waketimerIRQ[index]); -} - -/*! - * brief Fills in the WAKETIMER configuration structure with the default settings. - * - * The default values are: - * code - * config->enableInterrupt = true; - * config->enableOSCDivide = true; - * config->callback = NULL; - * endcode - * param config Pointer to the user configuration structure. - */ -void WAKETIMER_GetDefaultConfig(waketimer_config_t *config) -{ - config->enableInterrupt = true; - config->enableOSCDivide = true; - config->callback = NULL; -} - -/*! - * brief Enables the selected WAKETIMER interrupts. - * - * param base WAKETIMER peripheral base address - * param mask Mask value for interrupt events. See to #_waketimer_interrupt_enable - */ -void WAKETIMER_EnableInterrupts(WAKETIMER_Type *base, uint32_t mask) -{ - assert(NULL != base); - - if (0U != (mask & (uint32_t)kWAKETIMER_WakeInterruptEnable)) - { - base->WAKE_TIMER_CTRL |= WAKETIMER_WAKE_TIMER_CTRL_INTR_EN_MASK; - } -} - -/*! - * brief Disable the selected WAKETIMER interrupts. - * - * param base WAKETIMER peripheral base address - * param mask Mask value for interrupt events. See to #_waketimer_interrupt_enable - */ -void WAKETIMER_DisableInterrupts(WAKETIMER_Type *base, uint32_t mask) -{ - assert(NULL != base); - - if (0U != (mask & (uint32_t)kWAKETIMER_WakeInterruptEnable)) - { - base->WAKE_TIMER_CTRL &= ~WAKETIMER_WAKE_TIMER_CTRL_INTR_EN_MASK; - } -} - -/*! - * brief Clear Status Interrupt Flag. - * - * This clears intrrupt status flag. - * Currently, only match interrupt flag can be cleared. - * - * param base WAKETIMER peripheral base address. - * param mask Mask value for flags to be cleared. See to #_waketimer_status_flags. - * return none - */ -void WAKETIMER_ClearStatusFlags(WAKETIMER_Type *base, uint32_t mask) -{ - if (0U != (mask & (uint32_t)kWAKETIMER_WakeFlag)) - { - base->WAKE_TIMER_CTRL |= WAKETIMER_WAKE_TIMER_CTRL_WAKE_FLAG_MASK; - } -} - -/*! - * brief Receive noticification when waketime countdown. - * - * If the interrupt for the waketime countdown is enabled, then a callback can be registered - * which will be invoked when the event is triggered - * - * param base WAKETIMER peripheral base address - * param callback Function to invoke when the event is triggered - */ -void WAKETIMER_SetCallback(WAKETIMER_Type *base, waketimer_callback_t callback) -{ - assert(NULL != base); - - uint32_t index = WAKETIMER_GetInstance(base); - s_waketimerCallback[index] = callback; -} - -/*! - * brief Get current timer count value from WAKETIMER. - * - * This function will get a decimal timer count value. - * The RAW value of timer count is gray code format, will be translated to decimal data internally. - * - * param base WAKETIMER peripheral base address. - * return Value of WAKETIMER which will formated to decimal value. - */ -uint32_t WAKETIMER_GetCurrentTimerValue(WAKETIMER_Type *base) -{ - uint32_t value1 = 0; - uint32_t value2 = 0; - - do - { - value1 = base->WAKE_TIMER_CNT; - value2 = base->WAKE_TIMER_CNT; - } while (value1 != value2); - - return value1; -} - -static void WAKETIMER_GenericIRQHandler(WAKETIMER_Type *base, waketimer_callback_t callback) -{ - /* Clear interrupt flag. */ - WAKETIMER_ClearStatusFlags(base, (uint32_t)kWAKETIMER_WakeFlag); - - if (callback != NULL) - { - callback(); - } -} - -#if defined(WAKETIMER0) -void WAKETIMER0_DriverIRQHandler(void); -void WAKETIMER0_DriverIRQHandler(void) -{ - WAKETIMER_GenericIRQHandler(WAKETIMER0, s_waketimerCallback[0]); - SDK_ISR_EXIT_BARRIER; -} -#endif diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_waketimer.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_waketimer.h deleted file mode 100644 index 9913ff96672..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_waketimer.h +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_WAKETIMER_H_ -#define FSL_WAKETIMER_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup waketimer - * @{ - */ - -/*! @file*/ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief WAKETIMER driver version. */ -#define FSL_WAKETIMER_DRIVER_VERSION (MAKE_VERSION(2, 0, 1)) -/*! @} */ - -/*! - * @brief WAKETIMER status flags. - */ -enum _waketimer_status_flags -{ - kWAKETIMER_WakeFlag = - (WAKETIMER_WAKE_TIMER_CTRL_WAKE_FLAG_MASK), /*!< Wake Timer Status Flag, sets wake timer has timed out. */ -}; - -/*! - * @brief Define interrupt switchers of the module. - */ -enum _waketimer_interrupt_enable -{ - kWAKETIMER_WakeInterruptEnable = WAKETIMER_WAKE_TIMER_CTRL_INTR_EN_MASK, /*!< Generate interrupt - requests when WAKE_FLAG is asserted. */ -}; - -/*! @brief waketimer callback function. */ -typedef void (*waketimer_callback_t)(void); - -/*! - * @brief WAKETIMER configuration structure - * - * This structure holds the configuration settings for the WAKETIMER peripheral. To initialize this - * structure to reasonable defaults, call the WAKETIMER_GetDefaultConfig() function and pass a - * pointer to the configuration structure instance. - * - * The configuration structure can be made constant so as to reside in flash. - */ -typedef struct _waketimer_config -{ - bool enableOSCDivide; /*!< true: Enable OSC Divide. - false: Disable OSC Divide. */ - bool enableInterrupt; /*!< true: Enable interrupt. - false: Disable interrupt. */ - waketimer_callback_t callback; /*!< timer countdown callback. */ -} waketimer_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* _cplusplus */ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Initializes an WAKETIMER - * - * This function initializes the WAKETIMER. - * - * @param base WAKETIMER peripheral base address. - * @param config Pointer to the user configuration structure. - */ -void WAKETIMER_Init(WAKETIMER_Type *base, const waketimer_config_t *config); - -/*! - * @brief Deinitializes a WAKETIMER instance. - * - * This function deinitialize the WAKETIMER. - * - * @param base WAKETIMER peripheral base address. - */ -void WAKETIMER_Deinit(WAKETIMER_Type *base); - -/*! - * @brief Fills in the WAKETIMER configuration structure with the default settings. - * - * The default values are: - * @code - * config->enableInterrupt = true; - * config->enableOSCDivide = true; - * config->callback = NULL; - * @endcode - * @param config Pointer to the user configuration structure. - */ -void WAKETIMER_GetDefaultConfig(waketimer_config_t *config); - -/*! @}*/ - -/*! - * @name Interrupt Interface - * @{ - */ - -/*! - * @brief Enables the selected WAKETIMER interrupts. - * - * @param base WAKETIMER peripheral base address - * @param mask Mask value for interrupt events. See to #_waketimer_interrupt_enable - */ -void WAKETIMER_EnableInterrupts(WAKETIMER_Type *base, uint32_t mask); - -/*! - * @brief Enables the selected WAKETIMER interrupts. - * - * @param base WAKETIMER peripheral base address - * @param mask Mask value for interrupt events. See to #_waketimer_interrupt_enable - */ -void WAKETIMER_DisableInterrupts(WAKETIMER_Type *base, uint32_t mask); - -/*! - * @brief Clear Status Interrupt Flag. - * - * This clears intrrupt status flag. - * Currently, only match interrupt flag can be cleared. - * - * @param base WAKETIMER peripheral base address. - * @param mask Mask value for flags to be cleared. See to #_waketimer_status_flags. - * @return none - */ -void WAKETIMER_ClearStatusFlags(WAKETIMER_Type *base, uint32_t mask); - -/*! - * @brief Receive noticification when waketime countdown. - * - * If the interrupt for the waketime countdown is enabled, then a callback can be registered - * which will be invoked when the event is triggered - * - * @param base WAKETIMER peripheral base address - * @param callback Function to invoke when the event is triggered - */ -void WAKETIMER_SetCallback(WAKETIMER_Type *base, waketimer_callback_t callback); - -/*! @}*/ - -/*! - * @name Timer Start and Stop - * @{ - */ - -/*! - * @brief Halt and clear timer counter. - * - * This halt and clear timer counter. - * - * @param base WAKETIMER peripheral base address. - * @return none - */ -static inline void WAKETIMER_HaltTimer(WAKETIMER_Type *base) -{ - base->WAKE_TIMER_CTRL |= WAKETIMER_WAKE_TIMER_CTRL_CLR_WAKE_TIMER_MASK; -} - -/*! - * @brief Set timer counter. - * - * This set the timer counter and start the timer countdown. - * - * @param base WAKETIMER peripheral base address. - * @param value countdown value. - * @return none - */ -static inline void WAKETIMER_StartTimer(WAKETIMER_Type *base, uint32_t value) -{ - base->WAKE_TIMER_CNT = value; -} - -/*! - * @brief Get current timer count value from WAKETIMER. - * - * This function will get a decimal timer count value. - * The RAW value of timer count is gray code format, will be translated to decimal data internally. - * - * @param base WAKETIMER peripheral base address. - * @return Value of WAKETIMER which will be formated to decimal value. - */ -uint32_t WAKETIMER_GetCurrentTimerValue(WAKETIMER_Type *base); - -/*! @}*/ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_WAKETIMER_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_wuu.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_wuu.c deleted file mode 100644 index 214e7c07f08..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_wuu.c +++ /dev/null @@ -1,312 +0,0 @@ -/* - * Copyright 2019-2024 NXP. - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_wuu.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.wuu" -#endif - -#define WUU_PE_REG_BIT_FIELD_MASK 0x03UL -#define WUU_PDC_REG_BIT_FIELD_MASK 0x03UL -#define WUU_PMC_REG_BIT_FIELD_MASK 0x01UL - -#define WUU_ME_REG_WUME_FIELD_MASK 0x01UL -#define WUU_DE_REG_WUME_FIELD_MASK 0x01UL - -#define WUU_FILT_REG_FILTE_FIELD_MASK 0x60U -#define WUU_FILT_REG_FILTSET_FIELD_MASK 0x1FU -#define WUU_FDC_REG_FILTC_FIELD_MASK 0x3U -#define WUU_FMC_REG_FILTM_FIELD_MASK 0x1U - -#define WUU_FILT_REG_FILTSET_FIELD(x) (((uint32_t)(x) << 5UL) & WUU_FILT_REG_FILTE_FIELD_MASK) -#define WUU_CLEAR_BIT_FIELD_IN_REG(mask, offset) (~((uint32_t)(mask) << (offset))) -#define WUU_SET_BIT_FIELD_IN_REG(val, offset) ((uint32_t)(val) << (offset)) -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Enables and Configs External WakeUp Pins. - * - * This function enables/disables the external pin as wakeup input. What's more this - * function configs pins options, including edge detection wakeup event and operate mode. - * - * param base MUU peripheral base address. - * param pinIndex The index of the external input pin. See Reference Manual for the details. - * param config Pointer to wuu_external_wakeup_pin_config_t structure. - */ -void WUU_SetExternalWakeUpPinsConfig(WUU_Type *base, uint8_t pinIndex, const wuu_external_wakeup_pin_config_t *config) -{ - assert(config != NULL); - - volatile uint32_t *edgeRegBase = NULL; - volatile uint32_t *eventRegBase = NULL; - uint32_t edgeReg; - uint32_t eventReg; - uint32_t modeReg; - uint8_t offset; - - /* Calculate offset. */ - offset = 2U * (pinIndex & 0xFU); - - if (config->edge != kWUU_ExternalPinDisable) - { - /* Based on pin index, get register base address. */ - if ((pinIndex >> 4U) != 0U) - { - edgeRegBase = &base->PE2; - eventRegBase = &base->PDC2; - } - else - { - edgeRegBase = &base->PE1; - eventRegBase = &base->PDC1; - } - - /* Enable and config the edge detection. */ - edgeReg = *edgeRegBase; - edgeReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_PE_REG_BIT_FIELD_MASK, offset); - edgeReg |= WUU_SET_BIT_FIELD_IN_REG(config->edge, offset); - *edgeRegBase = edgeReg; - - /* Config the wakeup event. */ - eventReg = *eventRegBase; - eventReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_PDC_REG_BIT_FIELD_MASK, offset); - eventReg |= WUU_SET_BIT_FIELD_IN_REG(config->event, offset); - *eventRegBase = eventReg; - - /* Config operate mode. */ - modeReg = base->PMC; - modeReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_PMC_REG_BIT_FIELD_MASK, pinIndex); - modeReg |= WUU_SET_BIT_FIELD_IN_REG(config->mode, pinIndex); - - base->PMC = modeReg; - } - else - { - /* Based on pin index, get register base address. */ - if ((pinIndex >> 4U) != 0U) - { - edgeRegBase = &base->PE2; - } - else - { - edgeRegBase = &base->PE1; - } - - edgeReg = *edgeRegBase; - edgeReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_PE_REG_BIT_FIELD_MASK, offset); - *edgeRegBase = edgeReg; - } -} - -/*! - * brief Disable and clear external wakeup pin settings. - * - * param base MUU peripheral base address. - * param pinIndex The index of the external input pin. - */ -void WUU_ClearExternalWakeupPinsConfig(WUU_Type *base, uint8_t pinIndex) -{ - if (pinIndex <= 15U) - { - base->PE1 &= ~(WUU_PE_REG_BIT_FIELD_MASK << (2UL * (uint32_t)pinIndex)); - base->PDC1 &= ~(WUU_PDC_REG_BIT_FIELD_MASK << (2UL * (uint32_t)pinIndex)); - } - else - { - base->PE1 &= ~(WUU_PE_REG_BIT_FIELD_MASK << (2UL * (uint32_t)((uint32_t)pinIndex % 16UL))); - base->PDC1 &= ~(WUU_PDC_REG_BIT_FIELD_MASK << (2UL * (uint32_t)((uint32_t)pinIndex % 16UL))); - } -} - -/*! - * brief Config Internal modules' event as the wake up soures. - * - * This function configs the internal modules event as the wake up sources. - * - * param base WUU peripheral base address. - * param moduleIndex The selected internal module. See the Reference Manual for the details. - * param event Select interrupt or DMA/Trigger of the internal module as the wake up source. - */ -void WUU_SetInternalWakeUpModulesConfig(WUU_Type *base, uint8_t moduleIndex, wuu_internal_wakeup_module_event_t event) -{ - switch (event) - { - case kWUU_InternalModuleInterrupt: - base->ME |= WUU_SET_BIT_FIELD_IN_REG(WUU_ME_REG_WUME_FIELD_MASK, moduleIndex); - break; - case kWUU_InternalModuleDMATrigger: - base->DE |= WUU_SET_BIT_FIELD_IN_REG(WUU_DE_REG_WUME_FIELD_MASK, moduleIndex); - break; - default: - assert(false); - break; - } -} - -/*! - * brief Disable an on-chip internal modules' event as the wakeup sources. - * - * param base WUU peripheral base address. - * param moduleIndex The selected internal module. See the Reference Manual for the details. - * param event The event(interrupt or DMA/trigger) of the internal module to disable. - */ -void WUU_ClearInternalWakeUpModulesConfig(WUU_Type *base, uint8_t moduleIndex, wuu_internal_wakeup_module_event_t event) -{ - switch(event) - { - case kWUU_InternalModuleInterrupt: - base->ME &= ~WUU_SET_BIT_FIELD_IN_REG(WUU_ME_REG_WUME_FIELD_MASK, moduleIndex); - break; - case kWUU_InternalModuleDMATrigger: - base->DE &= ~WUU_SET_BIT_FIELD_IN_REG(WUU_DE_REG_WUME_FIELD_MASK, moduleIndex); - break; - default: - assert(false); - break; - } -} - -/*! - * brief Configs and Enables Pin filters. - * - * This function configs Pin filter, including pin select, filer operate mode - * filer wakeup event and filter edge detection. - * - * param base WUU peripheral base address. - * param filterIndex The index of the pin filer. - * param config Pointer to wuu_pin_filter_config_t structure. - */ -void WUU_SetPinFilterConfig(WUU_Type *base, uint8_t filterIndex, const wuu_pin_filter_config_t *config) -{ - assert(config != NULL); - - uint8_t shift; - uint32_t filterReg; - uint32_t eventReg; - uint32_t modeReg; - - shift = (filterIndex - 1U) * 8U; - filterReg = base->FILT; - filterReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_FILT_REG_FILTE_FIELD_MASK, shift); - filterReg |= WUU_SET_BIT_FIELD_IN_REG(WUU_FILT_REG_FILTSET_FIELD(config->edge), shift); - - if (config->edge != kWUU_FilterDisabled) - { - filterReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_FILT_REG_FILTSET_FIELD_MASK, shift); - filterReg |= WUU_SET_BIT_FIELD_IN_REG(config->pinIndex, shift); - - /* Config wake up event. */ - shift = (filterIndex - 1U) * 2U; - eventReg = base->FDC; - eventReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_FDC_REG_FILTC_FIELD_MASK, shift); - eventReg |= WUU_SET_BIT_FIELD_IN_REG(config->event, shift); - base->FDC = eventReg; - - /* Config operate mode. */ - shift = (filterIndex - 1U) * 1U; - modeReg = base->FMC; - modeReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_FMC_REG_FILTM_FIELD_MASK, shift); - modeReg |= WUU_SET_BIT_FIELD_IN_REG(config->mode, shift); - base->FMC = modeReg; - } - - base->FILT = filterReg; -} - -/*! - * brief Gets the pin filter configuration. - * - * This function gets the pin filter flag. - * - * param base WUU peripheral base address. - * param filterIndex A pin filter index, which starts from 1. - * return True if the flag is a source of the existing low-leakage power mode. - */ -bool WUU_GetPinFilterFlag(WUU_Type *base, uint8_t filterIndex) -{ - bool ret = false; - - switch (filterIndex) - { - case 1: - ret = ((base->FILT & WUU_FILT_FILTF1_MASK) != 0U); - break; - case 2: - ret = ((base->FILT & WUU_FILT_FILTF2_MASK) != 0U); - break; - default: - ret = false; - break; - } - - return ret; -} - -/*! - * brief Clears the pin filter configuration. - * - * This function clears the pin filter flag. - * - * param base WUU peripheral base address. - * param filterIndex A pin filter index to clear the flag, starting from 1. - */ -void WUU_ClearPinFilterFlag(WUU_Type *base, uint8_t filterIndex) -{ - uint32_t reg; - - reg = base->FILT; - /* Clean the W1C bits, in case the flags are cleared by mistake. */ - reg &= ~(WUU_FILT_FILTF1_MASK | WUU_FILT_FILTF2_MASK); - - reg |= WUU_SET_BIT_FIELD_IN_REG(WUU_FILT_FILTF1_MASK, ((filterIndex - 1U) * 8U)); - - base->FILT = reg; -} - -/*! - * brief Gets the external wakeup source flag. - * - * This function checks the external pin flag to detect whether the MCU is - * woken up by the specific pin. - * - * param base WUU peripheral base address. - * param pinIndex A pin index, which starts from 0. - * return True if the specific pin is a wakeup source. - */ -bool WUU_GetExternalWakeupPinFlag(WUU_Type *base, uint32_t pinIndex) -{ - return (0U != (base->PF & (1UL << pinIndex))); -} - -/*! - * brief Clears the external wakeup source flag. - * - * This function clears the external wakeup source flag for a specific pin. - * - * param base WUU peripheral base address. - * param pinIndex A pin index, which starts from 0. - */ -void WUU_ClearExternalWakeupPinFlag(WUU_Type *base, uint32_t pinIndex) -{ - base->PF = (1UL << pinIndex); -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_wuu.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_wuu.h deleted file mode 100644 index bedfde56859..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_wuu.h +++ /dev/null @@ -1,294 +0,0 @@ -/* - * Copyright 2019-2024 NXP. - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_WUU_H_ -#define FSL_WUU_H_ - -#include "fsl_common.h" - -/*! @addtogroup wuu */ -/*! @{ */ - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief Defines WUU driver version 2.4.0. */ -#define FSL_WUU_DRIVER_VERSION (MAKE_VERSION(2, 4, 0)) -/*! @} */ - -/*! - * @brief External WakeUp pin edge detection enumeration. - */ -typedef enum _wuu_external_pin_edge_detection -{ - kWUU_ExternalPinDisable = 0x0U, /*!< External input Pin disabled as wake up input. */ - kWUU_ExternalPinRisingEdge = 0x1U, /*!< External input Pin enabled with the rising edge detection. */ - kWUU_ExternalPinFallingEdge = 0x2U, /*!< External input Pin enabled with the falling edge detection. */ - kWUU_ExternalPinAnyEdge = 0x3U, /*!< External input Pin enabled with any change detection. */ -} wuu_external_pin_edge_detection_t; - -/*! - * @brief External input wake up pin event enumeration. - */ -typedef enum _wuu_external_wakeup_pin_event -{ - kWUU_ExternalPinInterrupt = 0x0U, /*!< External input Pin configured as interrupt. */ - kWUU_ExternalPinDMARequest = 0x1U, /*!< External input Pin configured as DMA request. */ - kWUU_ExternalPinTriggerEvent = 0x2U, /*!< External input Pin configured as Trigger event. */ -} wuu_external_wakeup_pin_event_t; - -/*! - * @brief External input wake up pin mode enumeration. - */ -typedef enum _wuu_external_wakeup_pin_mode -{ - kWUU_ExternalPinActiveDSPD = 0x0U, /*!< External input Pin is active only during Deep Sleep/Power Down Mode. */ - kWUU_ExternalPinActiveAlways = 0x1U, /*!< External input Pin is active during all power modes. */ -} wuu_external_wakeup_pin_mode_t; - -/*! - * @brief Internal module wake up event enumeration. - */ -typedef enum _wuu_internal_wakeup_module_event -{ - kWUU_InternalModuleInterrupt = 0x0U, /*!< Internal modules' interrupt as a wakeup source. */ - kWUU_InternalModuleDMATrigger = 0x1U, /*!< Internal modules' DMA/Trigger as a wakeup source. */ -} wuu_internal_wakeup_module_event_t; - -/*! - * @brief Pin filter edge enumeration. - */ -typedef enum _wuu_filter_edge -{ - kWUU_FilterDisabled = 0x0U, /*!< Filter disabled. */ - kWUU_FilterPosedgeEnable = 0x1U, /*!< Filter posedge detect enabled. */ - kWUU_FilterNegedgeEnable = 0x2U, /*!< Filter negedge detect enabled. */ - kWUU_FilterAnyEdge = 0x3U, /*!< Filter any edge detect enabled. */ -} wuu_filter_edge_t; - -/*! - * @brief Pin Filter event enumeration. - */ -typedef enum _wuu_filter_event -{ - kWUU_FilterInterrupt = 0x0U, /*!< Filter output configured as interrupt. */ - kWUU_FilterDMARequest = 0x1U, /*!< Filter output configured as DMA request. */ - kWUU_FilterTriggerEvent = 0x2U, /*!< Filter output configured as Trigger event. */ -} wuu_filter_event_t; - -/*! - * @brief Pin filter mode enumeration. - */ -typedef enum _wuu_filter_mode -{ - kWUU_FilterActiveDSPD = 0x0U, /*!< External input pin filter is active only during Deep Sleep/Power Down Mode. */ - kWUU_FilterActiveAlways = 0x1U, /*!< External input Pin filter is active during all power modes. */ -} wuu_filter_mode_t; - -/*! - * @brief External WakeUp pin configuration - */ -typedef struct _wuu_external_wakeup_pin_config -{ - wuu_external_pin_edge_detection_t edge; /*!< External Input pin edge detection. */ - wuu_external_wakeup_pin_event_t event; /*!< External Input wakeup Pin event */ - wuu_external_wakeup_pin_mode_t mode; /*!< External Input wakeup Pin operate mode. */ -} wuu_external_wakeup_pin_config_t; - -/*! - * @brief Pin Filter configuration. - */ -typedef struct _wuu_pin_filter_config -{ - uint32_t pinIndex; /*!< The index of wakeup pin to be muxxed into filter. */ - wuu_filter_edge_t edge; /*!< The edge of the pin digital filter. */ - wuu_filter_event_t event; /*!< The event of the filter output. */ - wuu_filter_mode_t mode; /*!< The mode of the filter operate. */ -} wuu_pin_filter_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name External Wake up Pins Control APIs. - * @{ - */ -/*! - * @brief Enables and Configs External WakeUp Pins. - * - * This function enables/disables the external pin as wakeup input. What's more this - * function configs pins options, including edge detection wakeup event and operate mode. - * - * @param base MUU peripheral base address. - * @param pinIndex The index of the external input pin. See Reference Manual for the details. - * @param config Pointer to wuu_external_wakeup_pin_config_t structure. - */ -void WUU_SetExternalWakeUpPinsConfig(WUU_Type *base, uint8_t pinIndex, const wuu_external_wakeup_pin_config_t *config); - -/*! - * @brief Disable and clear external wakeup pin settings. - * - * @param base MUU peripheral base address. - * @param pinIndex The index of the external input pin. - */ -void WUU_ClearExternalWakeupPinsConfig(WUU_Type *base, uint8_t pinIndex); - -/*! - * @brief Gets External Wakeup pin flags. - * - * This function return the external wakeup pin flags. - * - * @param base WUU peripheral base address. - * @return Wakeup flags for all external wakeup pins. - */ -static inline uint32_t WUU_GetExternalWakeUpPinsFlag(WUU_Type *base) -{ - return base->PF; -} - -/*! - * @brief Clears External WakeUp Pin flags. - * - * This function clears external wakeup pins flags based on the mask. - * - * @param base WUU peripheral base address. - * @param mask The mask of Wakeup pin index to be cleared. - */ -static inline void WUU_ClearExternalWakeUpPinsFlag(WUU_Type *base, uint32_t mask) -{ - base->PF = mask; -} -/*! @} */ - -/*! - * @name Internal Wakeup Module control APIs. - * @{ - */ - -/*! - * @brief Config Internal modules' event as the wake up soures. - * - * This function configs the internal modules event as the wake up sources. - * - * @param base WUU peripheral base address. - * @param moduleIndex The selected internal module. See the Reference Manual for the details. - * @param event Select interrupt or DMA/Trigger of the internal module as the wake up source. - */ -void WUU_SetInternalWakeUpModulesConfig(WUU_Type *base, uint8_t moduleIndex, wuu_internal_wakeup_module_event_t event); - -/*! - * @brief Disable an on-chip internal modules' event as the wakeup sources. - * - * @param base WUU peripheral base address. - * @param moduleIndex The selected internal module. See the Reference Manual for the details. - * @param event The event(interrupt or DMA/trigger) of the internal module to disable. - */ -void WUU_ClearInternalWakeUpModulesConfig(WUU_Type *base, uint8_t moduleIndex, wuu_internal_wakeup_module_event_t event); - -#if (defined(FSL_FEATURE_WUU_HAS_MF) && FSL_FEATURE_WUU_HAS_MF) -/*! - * @brief Get wakeup flags for internal wakeup modules. - * - * @param base WUU peripheral base address. - * @return Wakeup flags for all internal wakeup modules. - */ -static inline uint32_t WUU_GetModuleInterruptFlag(WUU_Type *base) -{ - return base->MF; -} - -/*! - * @brief Gets the internal module wakeup source flag. - * - * This function checks the flag to detect whether the system is - * woken up by specific on-chip module interrupt. - * - * @param base WWU peripheral base address. - * @param moduleIndex A module index, which starts from 0. - * @return True if the specific pin is a wake up source. - */ -static inline bool WUU_GetInternalWakeupModuleFlag(WUU_Type *base, uint32_t moduleIndex) -{ - return ((1UL << moduleIndex) == (WUU_GetModuleInterruptFlag(base) & (1UL << moduleIndex))); -} -#endif /* FSL_FEATURE_WUU_HAS_MF */ - -/*! @} */ - -/*! - * @name Pin Filter Control APIs - * @{ - */ -/*! - * @brief Configs and Enables Pin filters. - * - * This function configs Pin filter, including pin select, filer operate mode - * filer wakeup event and filter edge detection. - * - * @param base WUU peripheral base address. - * @param filterIndex The index of the pin filer. - * @param config Pointer to wuu_pin_filter_config_t structure. - */ -void WUU_SetPinFilterConfig(WUU_Type *base, uint8_t filterIndex, const wuu_pin_filter_config_t *config); - -/*! - * @brief Gets the pin filter configuration. - * - * This function gets the pin filter flag. - * - * @param base WUU peripheral base address. - * @param filterIndex A pin filter index, which starts from 1. - * @return True if the flag is a source of the existing low-leakage power mode. - */ -bool WUU_GetPinFilterFlag(WUU_Type *base, uint8_t filterIndex); - -/*! - * @brief Clears the pin filter configuration. - * - * This function clears the pin filter flag. - * - * @param base WUU peripheral base address. - * @param filterIndex A pin filter index to clear the flag, starting from 1. - */ -void WUU_ClearPinFilterFlag(WUU_Type *base, uint8_t filterIndex); - -/*! - * brief Gets the external wakeup source flag. - * - * This function checks the external pin flag to detect whether the MCU is - * woken up by the specific pin. - * - * param base WUU peripheral base address. - * param pinIndex A pin index, which starts from 0. - * return True if the specific pin is a wakeup source. - */ -bool WUU_GetExternalWakeupPinFlag(WUU_Type *base, uint32_t pinIndex); - -/*! - * brief Clears the external wakeup source flag. - * - * This function clears the external wakeup source flag for a specific pin. - * - * param base WUU peripheral base address. - * param pinIndex A pin index, which starts from 0. - */ -void WUU_ClearExternalWakeupPinFlag(WUU_Type *base, uint32_t pinIndex); -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @} */ - -#endif /*FSL_WUU_H_*/ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_wwdt.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_wwdt.c deleted file mode 100644 index 6680148acf7..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_wwdt.c +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_wwdt.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.wwdt" -#endif - -#define FREQUENCY_3MHZ (3000000U) -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Gets the instance from the base address - * - * @param base WWDT peripheral base address - * - * @return The WWDT instance - */ -static uint32_t WWDT_GetInstance(WWDT_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to WWDT bases for each instance. */ -static WWDT_Type *const s_wwdtBases[] = WWDT_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to WWDT clocks for each instance. */ -static const clock_ip_name_t s_wwdtClocks[] = WWDT_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) -#if !(defined(FSL_FEATURE_WWDT_HAS_NO_RESET) && FSL_FEATURE_WWDT_HAS_NO_RESET) -/*! @brief Pointers to WWDT resets for each instance. */ -static const reset_ip_name_t s_wwdtResets[] = WWDT_RSTS; -#endif -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t WWDT_GetInstance(WWDT_Type *base) -{ - uint32_t instance; - uint32_t wwdtArrayCount = (sizeof(s_wwdtBases) / sizeof(s_wwdtBases[0])); - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < wwdtArrayCount; instance++) - { - if (s_wwdtBases[instance] == base) - { - break; - } - } - - assert(instance < wwdtArrayCount); - - return instance; -} - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Initializes WWDT configure structure. - * - * This function initializes the WWDT configure structure to default value. The default - * value are: - * code - * config->enableWwdt = true; - * config->enableWatchdogReset = false; - * config->enableWatchdogProtect = false; - * config->enableLockOscillator = false; - * config->windowValue = 0xFFFFFFU; - * config->timeoutValue = 0xFFFFFFU; - * config->warningValue = 0; - * endcode - * - * param config Pointer to WWDT config structure. - * see wwdt_config_t - */ -void WWDT_GetDefaultConfig(wwdt_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - /* Enable the watch dog */ - config->enableWwdt = true; - /* Disable the watchdog timeout reset */ - config->enableWatchdogReset = false; - /* Disable the watchdog protection for updating the timeout value */ - config->enableWatchdogProtect = false; -#if !(defined(FSL_FEATURE_WWDT_HAS_NO_OSCILLATOR_LOCK) && FSL_FEATURE_WWDT_HAS_NO_OSCILLATOR_LOCK) - /* Do not lock the watchdog oscillator */ - config->enableLockOscillator = false; -#endif - /* Windowing is not in effect */ - config->windowValue = 0xFFFFFFU; - /* Set the timeout value to the max */ - config->timeoutValue = 0xFFFFFFU; - /* No warning is provided */ - config->warningValue = 0; - /* Set clock frequency. */ - config->clockFreq_Hz = 0U; -} - -/*! - * brief Initializes the WWDT. - * - * This function initializes the WWDT. When called, the WWDT runs according to the configuration. - * - * Example: - * code - * wwdt_config_t config; - * WWDT_GetDefaultConfig(&config); - * config.timeoutValue = 0x7ffU; - * WWDT_Init(wwdt_base,&config); - * endcode - * - * param base WWDT peripheral base address - * param config The configuration of WWDT - */ -void WWDT_Init(WWDT_Type *base, const wwdt_config_t *config) -{ - assert(NULL != config); - - uint32_t value = 0U; - uint32_t DelayUs = 0U; - uint32_t primaskValue = 0U; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the WWDT clock */ - CLOCK_EnableClock(s_wwdtClocks[WWDT_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) -#if !(defined(FSL_FEATURE_WWDT_HAS_NO_RESET) && FSL_FEATURE_WWDT_HAS_NO_RESET) - /* Reset the module. */ - RESET_PeripheralReset(s_wwdtResets[WWDT_GetInstance(base)]); -#endif - -#if defined(FSL_FEATURE_WWDT_WDTRESET_FROM_PMC) && (FSL_FEATURE_WWDT_WDTRESET_FROM_PMC) - /* PMC RESETCAUSE: set bit to clear it by write 1. */ - PMC->RESETCAUSE = PMC_RESETCAUSE_WDTRESET_MASK; - /* Enable the watchdog reset event to affect the system in the Power Management Controller */ - PMC->CTRL |= PMC_CTRL_WDTRESETENABLE_MASK; -#endif /*FSL_FEATURE_WWDT_WDTRESET_FROM_PMC*/ - -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ - -#if !(defined(FSL_FEATURE_WWDT_HAS_NO_OSCILLATOR_LOCK) && FSL_FEATURE_WWDT_HAS_NO_OSCILLATOR_LOCK) - value = WWDT_MOD_WDEN(config->enableWwdt) | WWDT_MOD_WDRESET(config->enableWatchdogReset) | - WWDT_MOD_LOCK(config->enableLockOscillator); -#else - value = WWDT_MOD_WDEN(config->enableWwdt) | WWDT_MOD_WDRESET(config->enableWatchdogReset); -#endif - /* Clear legacy flag in the MOD register by software writing a "1" to this bit field.. */ - if (0U != (base->MOD & WWDT_MOD_WDINT_MASK)) - { - value |= WWDT_MOD_WDINT_MASK; - } - /* Set configuration */ - primaskValue = DisableGlobalIRQ(); - base->TC = WWDT_TC_COUNT(config->timeoutValue); - base->MOD = value; - base->WINDOW = WWDT_WINDOW_WINDOW(config->windowValue); - base->WARNINT = WWDT_WARNINT_WARNINT(config->warningValue); - /* Refreshes the WWDT timer. */ - base->FEED = WWDT_FIRST_WORD_OF_REFRESH; - base->FEED = WWDT_SECOND_WORD_OF_REFRESH; - EnableGlobalIRQ(primaskValue); - /* Read counter value to wait wwdt timer start*/ - if (config->enableWwdt) - { - while (base->TV == 0xFFUL) - { - } - } - - /* This WDPROTECT bit can be set once by software and is only cleared by a reset */ - if (config->enableWatchdogProtect && (0U == (base->MOD & WWDT_MOD_WDPROTECT_MASK))) - { - /* The config->clockFreq_Hz must be set in order to config the delay time. */ - assert(0U != config->clockFreq_Hz); - - /* Set the WDPROTECT bit after the Feed Sequence (0xAA, 0x55) with 3 WDCLK delay */ - DelayUs = FREQUENCY_3MHZ / config->clockFreq_Hz + 1U; - SDK_DelayAtLeastUs(DelayUs, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY); - - base->MOD |= WWDT_MOD_WDPROTECT(1U); - } -} - -/*! - * brief Shuts down the WWDT. - * - * This function shuts down the WWDT. - * - * param base WWDT peripheral base address - */ -void WWDT_Deinit(WWDT_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable the WWDT clock */ - CLOCK_DisableClock(s_wwdtClocks[WWDT_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Refreshes the WWDT timer. - * - * This function feeds the WWDT. - * This function should be called before WWDT timer is in timeout. Otherwise, a reset is asserted. - * - * param base WWDT peripheral base address - */ -void WWDT_Refresh(WWDT_Type *base) -{ - uint32_t primaskValue = 0U; - - /* Disable the global interrupt to protect refresh sequence */ - primaskValue = DisableGlobalIRQ(); - base->FEED = WWDT_FIRST_WORD_OF_REFRESH; - base->FEED = WWDT_SECOND_WORD_OF_REFRESH; - EnableGlobalIRQ(primaskValue); -} - -/*! - * brief Clear WWDT flag. - * - * This function clears WWDT status flag. - * - * Example for clearing warning flag: - * code - * WWDT_ClearStatusFlags(wwdt_base, kWWDT_WarningFlag); - * endcode - * param base WWDT peripheral base address - * param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::_wwdt_status_flags_t - */ -void WWDT_ClearStatusFlags(WWDT_Type *base, uint32_t mask) -{ - /* Clear the WDINT bit so that we don't accidentally clear it */ - uint32_t reg = (base->MOD & (~WWDT_MOD_WDINT_MASK)); - - /* Clear timeout by writing a zero */ - if (0U != (mask & (uint32_t)kWWDT_TimeoutFlag)) - { - reg &= ~WWDT_MOD_WDTOF_MASK; -#if defined(FSL_FEATURE_WWDT_WDTRESET_FROM_PMC) && (FSL_FEATURE_WWDT_WDTRESET_FROM_PMC) - /* PMC RESETCAUSE: set bit to clear it */ - PMC->RESETCAUSE = PMC_RESETCAUSE_WDTRESET_MASK; -#endif /*FSL_FEATURE_WWDT_WDTRESET_FROM_PMC*/ - } - - /* Clear warning interrupt flag by writing a one */ - if (0U != (mask & (uint32_t)kWWDT_WarningFlag)) - { - reg |= WWDT_MOD_WDINT_MASK; - } - - base->MOD = reg; -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_wwdt.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_wwdt.h deleted file mode 100644 index 40c90e48b38..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/drivers/fsl_wwdt.h +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_WWDT_H_ -#define FSL_WWDT_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup wwdt - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief Defines WWDT driver version. */ -#define FSL_WWDT_DRIVER_VERSION (MAKE_VERSION(2, 1, 9)) -/*! @} */ - -/*! @name Refresh sequence */ -/*! @{ */ -#define WWDT_FIRST_WORD_OF_REFRESH (0xAAU) /*!< First word of refresh sequence */ -#define WWDT_SECOND_WORD_OF_REFRESH (0x55U) /*!< Second word of refresh sequence */ -/*! @} */ - -/*! @brief Describes WWDT configuration structure. */ -typedef struct _wwdt_config -{ - bool enableWwdt; /*!< Enables or disables WWDT */ - bool enableWatchdogReset; /*!< true: Watchdog timeout will cause a chip reset - false: Watchdog timeout will not cause a chip reset */ - bool enableWatchdogProtect; /*!< true: Enable watchdog protect i.e timeout value can only be - changed after counter is below warning & window values - false: Disable watchdog protect; timeout value can be changed - at any time */ -#if !(defined(FSL_FEATURE_WWDT_HAS_NO_OSCILLATOR_LOCK) && FSL_FEATURE_WWDT_HAS_NO_OSCILLATOR_LOCK) - bool enableLockOscillator; /*!< true: Disabling or powering down the watchdog oscillator is prevented - Once set, this bit can only be cleared by a reset - false: Do not lock oscillator */ -#endif - uint32_t windowValue; /*!< Window value, set this to 0xFFFFFF if windowing is not in effect */ - uint32_t timeoutValue; /*!< Timeout value */ - uint32_t warningValue; /*!< Watchdog time counter value that will generate a - warning interrupt. Set this to 0 for no warning */ - uint32_t clockFreq_Hz; /*!< Watchdog clock source frequency. */ -} wwdt_config_t; - -/*! - * @brief WWDT status flags. - * - * This structure contains the WWDT status flags for use in the WWDT functions. - */ -enum _wwdt_status_flags_t -{ - kWWDT_TimeoutFlag = WWDT_MOD_WDTOF_MASK, /*!< Time-out flag, set when the timer times out */ - kWWDT_WarningFlag = WWDT_MOD_WDINT_MASK /*!< Warning interrupt flag, set when timer is below the value WDWARNINT */ -}; - -/******************************************************************************* - * API - *******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name WWDT Initialization and De-initialization - * @{ - */ - -/*! - * @brief Initializes WWDT configure structure. - * - * This function initializes the WWDT configure structure to default value. The default - * value are: - * @code - * config->enableWwdt = true; - * config->enableWatchdogReset = false; - * config->enableWatchdogProtect = false; - * config->enableLockOscillator = false; - * config->windowValue = 0xFFFFFFU; - * config->timeoutValue = 0xFFFFFFU; - * config->warningValue = 0; - * @endcode - * - * @param config Pointer to WWDT config structure. - * @see wwdt_config_t - */ -void WWDT_GetDefaultConfig(wwdt_config_t *config); - -/*! - * @brief Initializes the WWDT. - * - * This function initializes the WWDT. When called, the WWDT runs according to the configuration. - * - * Example: - * @code - * wwdt_config_t config; - * WWDT_GetDefaultConfig(&config); - * config.timeoutValue = 0x7ffU; - * WWDT_Init(wwdt_base,&config); - * @endcode - * - * @param base WWDT peripheral base address - * @param config The configuration of WWDT - */ -void WWDT_Init(WWDT_Type *base, const wwdt_config_t *config); - -/*! - * @brief Shuts down the WWDT. - * - * This function shuts down the WWDT. - * - * @param base WWDT peripheral base address - */ -void WWDT_Deinit(WWDT_Type *base); - -/*! @} */ - -/*! - * @name WWDT Functional Operation - * @{ - */ - -/*! - * @brief Enables the WWDT module. - * - * This function write value into WWDT_MOD register to enable the WWDT, it is a write-once bit; - * once this bit is set to one and a watchdog feed is performed, the watchdog timer will run - * permanently. - * - * @param base WWDT peripheral base address - */ -static inline void WWDT_Enable(WWDT_Type *base) -{ - base->MOD |= WWDT_MOD_WDEN_MASK; -} - -/*! - * @brief Disables the WWDT module. - * @deprecated Do not use this function. It will be deleted in next release version, for - * once the bit field of WDEN written with a 1, it can not be re-written with a 0. - * - * This function write value into WWDT_MOD register to disable the WWDT. - * - * @param base WWDT peripheral base address - */ -static inline void WWDT_Disable(WWDT_Type *base) -{ - base->MOD &= ~WWDT_MOD_WDEN_MASK; -} - -/*! - * @brief Gets all WWDT status flags. - * - * This function gets all status flags. - * - * Example for getting Timeout Flag: - * @code - * uint32_t status; - * status = WWDT_GetStatusFlags(wwdt_base) & kWWDT_TimeoutFlag; - * @endcode - * @param base WWDT peripheral base address - * @return The status flags. This is the logical OR of members of the - * enumeration ::_wwdt_status_flags_t - */ -static inline uint32_t WWDT_GetStatusFlags(WWDT_Type *base) -{ -#if defined(FSL_FEATURE_WWDT_WDTRESET_FROM_PMC) && (FSL_FEATURE_WWDT_WDTRESET_FROM_PMC) - uint32_t status; - /* WDTOF is not set in case of WD reset - get info from PMC instead */ - status = (base->MOD & (WWDT_MOD_WDTOF_MASK | WWDT_MOD_WDINT_MASK)); - if (PMC->RESETCAUSE & PMC_RESETCAUSE_WDTRESET_MASK) - { - status |= kWWDT_TimeoutFlag; - } - return status; -#else - return (base->MOD & (WWDT_MOD_WDTOF_MASK | WWDT_MOD_WDINT_MASK)); -#endif /*FSL_FEATURE_WWDT_WDTRESET_FROM_PMC*/ -} - -/*! - * @brief Clear WWDT flag. - * - * This function clears WWDT status flag. - * - * Example for clearing warning flag: - * @code - * WWDT_ClearStatusFlags(wwdt_base, kWWDT_WarningFlag); - * @endcode - * @param base WWDT peripheral base address - * @param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::_wwdt_status_flags_t - */ -void WWDT_ClearStatusFlags(WWDT_Type *base, uint32_t mask); - -/*! - * @brief Set the WWDT warning value. - * - * The WDWARNINT register determines the watchdog timer counter value that will generate a watchdog - * interrupt. When the watchdog timer counter is no longer greater than the value defined by - * WARNINT, an interrupt will be generated after the subsequent WDCLK. - * - * @param base WWDT peripheral base address - * @param warningValue WWDT warning value. - */ -static inline void WWDT_SetWarningValue(WWDT_Type *base, uint32_t warningValue) -{ - base->WARNINT = WWDT_WARNINT_WARNINT(warningValue); -} - -/*! - * @brief Set the WWDT timeout value. - * - * This function sets the timeout value. Every time a feed sequence occurs the value in the TC - * register is loaded into the Watchdog timer. Writing a value below 0xFF will cause 0xFF to be - * loaded into the TC register. Thus the minimum time-out interval is TWDCLK*256*4. - * If enableWatchdogProtect flag is true in wwdt_config_t config structure, any attempt to change - * the timeout value before the watchdog counter is below the warning and window values - * will cause a watchdog reset and set the WDTOF flag. - * - * @param base WWDT peripheral base address - * @param timeoutCount WWDT timeout value, count of WWDT clock tick. - */ -static inline void WWDT_SetTimeoutValue(WWDT_Type *base, uint32_t timeoutCount) -{ - base->TC = WWDT_TC_COUNT(timeoutCount); -} - -/*! - * @brief Sets the WWDT window value. - * - * The WINDOW register determines the highest TV value allowed when a watchdog feed is performed. - * If a feed sequence occurs when timer value is greater than the value in WINDOW, a watchdog - * event will occur. To disable windowing, set windowValue to 0xFFFFFF (maximum possible timer - * value) so windowing is not in effect. - * - * @param base WWDT peripheral base address - * @param windowValue WWDT window value. - */ -static inline void WWDT_SetWindowValue(WWDT_Type *base, uint32_t windowValue) -{ - base->WINDOW = WWDT_WINDOW_WINDOW(windowValue); -} - -/*! - * @brief Refreshes the WWDT timer. - * - * This function feeds the WWDT. - * This function should be called before WWDT timer is in timeout. Otherwise, a reset is asserted. - * - * @param base WWDT peripheral base address - */ -void WWDT_Refresh(WWDT_Type *base); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @}*/ - -#endif /* FSL_WWDT_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/fsl_device_registers.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/fsl_device_registers.h deleted file mode 100644 index e440662fc5d..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/fsl_device_registers.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2014-2016 Freescale Semiconductor, Inc. - * Copyright 2016-2024 NXP - * SPDX-License-Identifier: BSD-3-Clause - * - */ - -#ifndef __FSL_DEVICE_REGISTERS_H__ -#define __FSL_DEVICE_REGISTERS_H__ - -/* - * Include the cpu specific register header files. - * - * The CPU macro should be declared in the project or makefile. - */ -#if (defined(CPU_MCXA153VFM) || defined(CPU_MCXA153VFT) || defined(CPU_MCXA153VLF) || \ - defined(CPU_MCXA153VLH)) - -#define MCXA153_SERIES - -/* CMSIS-style register definitions */ -#include "MCXA153.h" -/* CPU specific feature definitions */ -#include "MCXA153_features.h" - -#else - #error "No valid CPU defined!" -#endif - -#endif /* __FSL_DEVICE_REGISTERS_H__ */ - -/******************************************************************************* - * EOF - ******************************************************************************/ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/gcc/MCXA153_flash.ld b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/gcc/MCXA153_flash.ld deleted file mode 100644 index c5a4d9cb262..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/gcc/MCXA153_flash.ld +++ /dev/null @@ -1,202 +0,0 @@ -/* -** ################################################################### -** Processors: MCXA153VFM -** MCXA153VFT -** MCXA153VLF -** MCXA153VLH -** -** Compiler: GNU C Compiler -** Reference manual: MCXA1 User manual -** Version: rev. 1.0, 2022-03-29 -** Build: b240403 -** -** Abstract: -** Linker file for the GNU C Compiler -** -** Copyright 2016 Freescale Semiconductor, Inc. -** Copyright 2016-2024 NXP -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** ################################################################### -*/ - - - -/* Entry Point */ -ENTRY(Reset_Handler) - -HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400; -STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0800; - -/* Specify the memory areas */ -MEMORY -{ - m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000200 - m_text (RX) : ORIGIN = 0x00000200, LENGTH = 0x0001FE00 - m_data (RW) : ORIGIN = 0x20000000, LENGTH = 0x00006000 - m_sramx0 (RW) : ORIGIN = 0x04000000, LENGTH = 0x00002000 -} - -/* Define output sections */ -SECTIONS -{ - /* The startup code goes first into internal flash */ - .interrupts : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - . = ALIGN(4); - } > m_interrupts - - /* The program code and other data goes into internal flash */ - .text : - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - KEEP (*(.init)) - KEEP (*(.fini)) - . = ALIGN(4); - } > m_text - - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > m_text - - .ARM : - { - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - } > m_text - - .ctors : - { - __CTOR_LIST__ = .; - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - from the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - __CTOR_END__ = .; - } > m_text - - .dtors : - { - __DTOR_LIST__ = .; - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - __DTOR_END__ = .; - } > m_text - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } > m_text - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - } > m_text - - .fini_array : - { - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - } > m_text - - __etext = .; /* define a global symbol at end of code */ - __DATA_ROM = .; /* Symbol is used by startup for data initialization */ - - .data : AT(__DATA_ROM) - { - . = ALIGN(4); - __DATA_RAM = .; - __data_start__ = .; /* create a global symbol at data start */ - *(.ramfunc*) /* for functions in ram */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - KEEP(*(.jcr*)) - . = ALIGN(4); - __data_end__ = .; /* define a global symbol at data end */ - } > m_data - - __DATA_END = __DATA_ROM + (__data_end__ - __data_start__); - text_end = ORIGIN(m_text) + LENGTH(m_text); - ASSERT(__DATA_END <= text_end, "region m_text overflowed with text and data") - - /* Uninitialized data section */ - .bss : - { - /* This is used by the startup in order to initialize the .bss section */ - . = ALIGN(4); - __START_BSS = .; - __bss_start__ = .; - *(.bss) - *(.bss*) - *(COMMON) - . = ALIGN(4); - __bss_end__ = .; - __END_BSS = .; - } > m_data - - .heap : - { - . = ALIGN(8); - __end__ = .; - PROVIDE(end = .); - __HeapBase = .; - . += HEAP_SIZE; - __HeapLimit = .; - __heap_limit = .; /* Add for _sbrk */ - } > m_data - - .stack : - { - . = ALIGN(8); - . += STACK_SIZE; - } > m_data - - - /* Initializes stack on the end of block */ - __StackTop = ORIGIN(m_data) + LENGTH(m_data); - __StackLimit = __StackTop - STACK_SIZE; - PROVIDE(__stack = __StackTop); - - .ARM.attributes 0 : { *(.ARM.attributes) } - - ASSERT(__StackLimit >= __HeapLimit, "region m_data overflowed with stack and heap") -} - diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/gcc/MCXA153_ram.ld b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/gcc/MCXA153_ram.ld deleted file mode 100644 index 5c268f096dc..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/gcc/MCXA153_ram.ld +++ /dev/null @@ -1,201 +0,0 @@ -/* -** ################################################################### -** Processors: MCXA153VFM -** MCXA153VFT -** MCXA153VLF -** MCXA153VLH -** -** Compiler: GNU C Compiler -** Reference manual: MCXA1 User manual -** Version: rev. 1.0, 2022-03-29 -** Build: b240403 -** -** Abstract: -** Linker file for the GNU C Compiler -** -** Copyright 2016 Freescale Semiconductor, Inc. -** Copyright 2016-2024 NXP -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** ################################################################### -*/ - - - -/* Entry Point */ -ENTRY(Reset_Handler) - -HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400; -STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0800; - -/* Specify the memory areas */ -MEMORY -{ - m_interrupts (RX) : ORIGIN = 0x04000000, LENGTH = 0x00000200 - m_text (RX) : ORIGIN = 0x04000200, LENGTH = 0x00001E00 - m_data (RW) : ORIGIN = 0x20000000, LENGTH = 0x00006000 -} - -/* Define output sections */ -SECTIONS -{ - /* The startup code goes first into internal flash */ - .interrupts : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - . = ALIGN(4); - } > m_interrupts - - /* The program code and other data goes into internal flash */ - .text : - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - KEEP (*(.init)) - KEEP (*(.fini)) - . = ALIGN(4); - } > m_text - - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > m_text - - .ARM : - { - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - } > m_text - - .ctors : - { - __CTOR_LIST__ = .; - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - from the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - __CTOR_END__ = .; - } > m_text - - .dtors : - { - __DTOR_LIST__ = .; - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - __DTOR_END__ = .; - } > m_text - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } > m_text - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - } > m_text - - .fini_array : - { - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - } > m_text - - __etext = .; /* define a global symbol at end of code */ - __DATA_ROM = .; /* Symbol is used by startup for data initialization */ - - .data : AT(__DATA_ROM) - { - . = ALIGN(4); - __DATA_RAM = .; - __data_start__ = .; /* create a global symbol at data start */ - *(.ramfunc*) /* for functions in ram */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - KEEP(*(.jcr*)) - . = ALIGN(4); - __data_end__ = .; /* define a global symbol at data end */ - } > m_data - - __DATA_END = __DATA_ROM + (__data_end__ - __data_start__); - text_end = ORIGIN(m_text) + LENGTH(m_text); - ASSERT(__DATA_END <= text_end, "region m_text overflowed with text and data") - - /* Uninitialized data section */ - .bss : - { - /* This is used by the startup in order to initialize the .bss section */ - . = ALIGN(4); - __START_BSS = .; - __bss_start__ = .; - *(.bss) - *(.bss*) - *(COMMON) - . = ALIGN(4); - __bss_end__ = .; - __END_BSS = .; - } > m_data - - .heap : - { - . = ALIGN(8); - __end__ = .; - PROVIDE(end = .); - __HeapBase = .; - . += HEAP_SIZE; - __HeapLimit = .; - __heap_limit = .; /* Add for _sbrk */ - } > m_data - - .stack : - { - . = ALIGN(8); - . += STACK_SIZE; - } > m_data - - - /* Initializes stack on the end of block */ - __StackTop = ORIGIN(m_data) + LENGTH(m_data); - __StackLimit = __StackTop - STACK_SIZE; - PROVIDE(__stack = __StackTop); - - .ARM.attributes 0 : { *(.ARM.attributes) } - - ASSERT(__StackLimit >= __HeapLimit, "region m_data overflowed with stack and heap") -} - diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/gcc/startup_MCXA153.S b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/gcc/startup_MCXA153.S deleted file mode 100644 index 872adc92cca..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/gcc/startup_MCXA153.S +++ /dev/null @@ -1,1112 +0,0 @@ -/* ------------------------------------------------------------------------- */ -/* @file: startup_MCXA153.s */ -/* @purpose: CMSIS Cortex-M33 Core Device Startup File */ -/* MCXA153 */ -/* @version: 1.0 */ -/* @date: 2022-3-29 */ -/* @build: b240401 */ -/* ------------------------------------------------------------------------- */ -/* */ -/* Copyright 1997-2016 Freescale Semiconductor, Inc. */ -/* Copyright 2016-2024 NXP */ -/* SPDX-License-Identifier: BSD-3-Clause */ -/*****************************************************************************/ -/* Version: GCC for ARM Embedded Processors */ -/*****************************************************************************/ - .syntax unified - .arch armv8-m.main - - .section .isr_vector, "a" - .align 2 - .globl __Vectors -__Vectors: - .long __StackTop /* Top of Stack */ - .long Reset_Handler /* Reset Handler */ - .long NMI_Handler /* NMI Handler*/ - .long HardFault_Handler /* Hard Fault Handler*/ - .long MemManage_Handler /* MPU Fault Handler*/ - .long BusFault_Handler /* Bus Fault Handler*/ - .long UsageFault_Handler /* Usage Fault Handler*/ - .long SecureFault_Handler /* Secure Fault Handler*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long SVC_Handler /* SVCall Handler*/ - .long DebugMon_Handler /* Debug Monitor Handler*/ - .long 0 /* Reserved*/ - .long PendSV_Handler /* PendSV Handler*/ - .long SysTick_Handler /* SysTick Handler*/ - - /* External Interrupts*/ - .long Reserved16_IRQHandler /* OR IRQ1 to IRQ53*/ - .long CMC_IRQHandler /* Core Mode Controller interrupt*/ - .long DMA_CH0_IRQHandler /* DMA3_0_CH0 error or transfer complete*/ - .long DMA_CH1_IRQHandler /* DMA3_0_CH1 error or transfer complete*/ - .long DMA_CH2_IRQHandler /* DMA3_0_CH2 error or transfer complete*/ - .long DMA_CH3_IRQHandler /* DMA3_0_CH3 error or transfer complete*/ - .long Reserved22_IRQHandler /* Reserved interrupt*/ - .long Reserved23_IRQHandler /* Reserved interrupt*/ - .long Reserved24_IRQHandler /* Reserved interrupt*/ - .long Reserved25_IRQHandler /* Reserved interrupt*/ - .long ERM0_SINGLE_BIT_IRQHandler /* ERM Single Bit error interrupt*/ - .long ERM0_MULTI_BIT_IRQHandler /* ERM Multi Bit error interrupt*/ - .long FMU0_IRQHandler /* Flash Management Unit interrupt*/ - .long GLIKEY0_IRQHandler /* GLIKEY Interrupt */ - .long MBC0_IRQHandler /* MBC secure violation interrupt*/ - .long SCG0_IRQHandler /* System Clock Generator interrupt*/ - .long SPC0_IRQHandler /* System Power Controller interrupt*/ - .long Reserved33_IRQHandler /* Reserved interrupt*/ - .long WUU0_IRQHandler /* Wake Up Unit interrupt*/ - .long Reserved35_IRQHandler /* Reserved interrupt*/ - .long Reserved36_IRQHandler /* Reserved interrupt*/ - .long Reserved37_IRQHandler /* Reserved interrupt*/ - .long Reserved38_IRQHandler /* Reserved interrupt*/ - .long Reserved39_IRQHandler /* Reserved interrupt*/ - .long I3C0_IRQHandler /* Improved Inter Integrated Circuit interrupt 0*/ - .long Reserved41_IRQHandler /* Reserved interrupt*/ - .long LPI2C0_IRQHandler /* Low-Power Inter Integrated Circuit interrupt*/ - .long Reserved43_IRQHandler /* Reserved interrupt*/ - .long LPSPI0_IRQHandler /* Low-Power Serial Peripheral Interface interrupt*/ - .long LPSPI1_IRQHandler /* Low-Power Serial Peripheral Interface interrupt*/ - .long Reserved46_IRQHandler /* Reserved interrupt*/ - .long LPUART0_IRQHandler /* Low-Power Universal Asynchronous Receive/Transmit interrupt*/ - .long LPUART1_IRQHandler /* Low-Power Universal Asynchronous Receive/Transmit interrupt*/ - .long LPUART2_IRQHandler /* Low-Power Universal Asynchronous Receive/Transmit interrupt*/ - .long Reserved50_IRQHandler /* Reserved interrupt*/ - .long Reserved51_IRQHandler /* Reserved interrupt*/ - .long USB0_IRQHandler /* Universal Serial Bus - Full Speed interrupt*/ - .long Reserved53_IRQHandler /* Reserved interrupt*/ - .long CDOG0_IRQHandler /* Code Watchdog Timer 0 interrupt*/ - .long CTIMER0_IRQHandler /* Standard counter/timer 0 interrupt*/ - .long CTIMER1_IRQHandler /* Standard counter/timer 1 interrupt*/ - .long CTIMER2_IRQHandler /* Standard counter/timer 2 interrupt*/ - .long Reserved58_IRQHandler /* Reserved interrupt*/ - .long Reserved59_IRQHandler /* Reserved interrupt*/ - .long FLEXPWM0_RELOAD_ERROR_IRQHandler /* FlexPWM0_reload_error interrupt*/ - .long FLEXPWM0_FAULT_IRQHandler /* FlexPWM0_fault interrupt*/ - .long FLEXPWM0_SUBMODULE0_IRQHandler /* FlexPWM0 Submodule 0 capture/compare/reload interrupt*/ - .long FLEXPWM0_SUBMODULE1_IRQHandler /* FlexPWM0 Submodule 1 capture/compare/reload interrupt*/ - .long FLEXPWM0_SUBMODULE2_IRQHandler /* FlexPWM0 Submodule 2 capture/compare/reload interrupt*/ - .long Reserved65_IRQHandler /* Reserved interrupt*/ - .long QDC0_COMPARE_IRQHandler /* Compare*/ - .long QDC0_HOME_IRQHandler /* Home*/ - .long QDC0_WATCHDOG_IRQHandler /* Watchdog / Simultaneous A and B Change*/ - .long QDC0_INDEX_IRQHandler /* Index / Roll Over / Roll Under*/ - .long FREQME0_IRQHandler /* Frequency Measurement interrupt*/ - .long LPTMR0_IRQHandler /* Low Power Timer 0 interrupt*/ - .long Reserved72_IRQHandler /* Reserved interrupt*/ - .long OS_EVENT_IRQHandler /* OS event timer interrupt*/ - .long WAKETIMER0_IRQHandler /* Wake Timer Interrupt*/ - .long UTICK0_IRQHandler /* Micro-Tick Timer interrupt*/ - .long WWDT0_IRQHandler /* Windowed Watchdog Timer 0 interrupt*/ - .long Reserved77_IRQHandler /* Reserved interrupt*/ - .long ADC0_IRQHandler /* Analog-to-Digital Converter interrupt*/ - .long Reserved79_IRQHandler /* Reserved interrupt*/ - .long CMP0_IRQHandler /* Comparator interrupt*/ - .long CMP1_IRQHandler /* Comparator interrupt*/ - .long Reserved82_IRQHandler /* Reserved interrupt*/ - .long Reserved83_IRQHandler /* Reserved interrupt*/ - .long Reserved84_IRQHandler /* Reserved interrupt*/ - .long Reserved85_IRQHandler /* Reserved interrupt*/ - .long Reserved86_IRQHandler /* Reserved interrupt*/ - .long GPIO0_IRQHandler /* General Purpose Input/Output interrupt 0*/ - .long GPIO1_IRQHandler /* General Purpose Input/Output interrupt 1*/ - .long GPIO2_IRQHandler /* General Purpose Input/Output interrupt 2*/ - .long GPIO3_IRQHandler /* General Purpose Input/Output interrupt 3*/ - .long Reserved91_IRQHandler /* Reserved interrupt*/ - .long Reserved92_IRQHandler /* Reserved interrupt*/ - .long Reserved93_IRQHandler /* Reserved interrupt*/ - .long Reserved94_IRQHandler /* Reserved interrupt*/ - .long Reserved95_IRQHandler /* Reserved interrupt*/ - - .size __Vectors, . - __Vectors - - .text - .thumb - -#if defined (__cplusplus) -#ifdef __REDLIB__ -#error Redlib does not support C++ -#endif -#endif -/* Reset Handler */ - - .thumb_func - .align 2 - .globl Reset_Handler - .weak Reset_Handler - .type Reset_Handler, %function -Reset_Handler: - cpsid i /* Mask interrupts */ - .equ VTOR, 0xE000ED08 - ldr r0, =VTOR - ldr r1, =__Vectors - str r1, [r0] - ldr r2, [r1] - msr msp, r2 - ldr r0, =__StackLimit - msr msplim, r0 -#ifndef __NO_SYSTEM_INIT - ldr r0,=SystemInit - blx r0 -#endif -/* Loop to copy data from read only memory to RAM. The ranges - * of copy from/to are specified by following symbols evaluated in - * linker script. - * __etext: End of code section, i.e., begin of data sections to copy from. - * __data_start__/__data_end__: RAM address range that data should be - * copied to. Both must be aligned to 4 bytes boundary. */ - - ldr r1, =__etext - ldr r2, =__data_start__ - ldr r3, =__data_end__ - -#if 1 -/* Here are two copies of loop implemenations. First one favors code size - * and the second one favors performance. Default uses the first one. - * Change to "#if 0" to use the second one */ -.LC0: - cmp r2, r3 - ittt lt - ldrlt r0, [r1], #4 - strlt r0, [r2], #4 - blt .LC0 -#else - subs r3, r2 - ble .LC1 -.LC0: - subs r3, #4 - ldr r0, [r1, r3] - str r0, [r2, r3] - bgt .LC0 -.LC1: -#endif - -#ifdef __STARTUP_CLEAR_BSS -/* This part of work usually is done in C library startup code. Otherwise, - * define this macro to enable it in this startup. - * - * Loop to zero out BSS section, which uses following symbols - * in linker script: - * __bss_start__: start of BSS section. Must align to 4 - * __bss_end__: end of BSS section. Must align to 4 - */ - ldr r1, =__bss_start__ - ldr r2, =__bss_end__ - - movs r0, 0 -.LC2: - cmp r1, r2 - itt lt - strlt r0, [r1], #4 - blt .LC2 -#endif /* __STARTUP_CLEAR_BSS */ - -/* Add stack / heap initializaiton */ - movs r0, 0 - ldr r1, =__HeapBase - ldr r2, =__HeapLimit -.LC3: - cmp r1, r2 - itt lt - strlt r0, [r1], #4 - blt .LC3 - - ldr r1, =__StackLimit - ldr r2, =__StackTop -.LC4: - cmp r1, r2 - itt lt - strlt r0, [r1], #4 - blt .LC4 - -/*End of stack / heap initializaiton */ - cpsie i /* Unmask interrupts */ -#ifndef __START -#ifdef __REDLIB__ -#define __START __main -#else -#define __START _start -#endif -#endif -#ifndef __ATOLLIC__ - ldr r0,=__START - blx r0 -#else - ldr r0,=__libc_init_array - blx r0 - ldr r0,=main - bx r0 -#endif - .pool - .size Reset_Handler, . - Reset_Handler - - .align 1 - .thumb_func - .weak DefaultISR - .type DefaultISR, %function -DefaultISR: - b DefaultISR - .size DefaultISR, . - DefaultISR - - .align 1 - .thumb_func - .weak NMI_Handler - .type NMI_Handler, %function -NMI_Handler: - ldr r0,=NMI_Handler - bx r0 - .size NMI_Handler, . - NMI_Handler - - .align 1 - .thumb_func - .weak HardFault_Handler - .type HardFault_Handler, %function -HardFault_Handler: - ldr r0,=HardFault_Handler - bx r0 - .size HardFault_Handler, . - HardFault_Handler - - .align 1 - .thumb_func - .weak SVC_Handler - .type SVC_Handler, %function -SVC_Handler: - ldr r0,=SVC_Handler - bx r0 - .size SVC_Handler, . - SVC_Handler - - .align 1 - .thumb_func - .weak PendSV_Handler - .type PendSV_Handler, %function -PendSV_Handler: - ldr r0,=PendSV_Handler - bx r0 - .size PendSV_Handler, . - PendSV_Handler - - .align 1 - .thumb_func - .weak SysTick_Handler - .type SysTick_Handler, %function -SysTick_Handler: - ldr r0,=SysTick_Handler - bx r0 - .size SysTick_Handler, . - SysTick_Handler - - .align 1 - .thumb_func - .weak Reserved16_IRQHandler - .type Reserved16_IRQHandler, %function -Reserved16_IRQHandler: - ldr r0,=Reserved16_DriverIRQHandler - bx r0 - .size Reserved16_IRQHandler, . - Reserved16_IRQHandler - - .align 1 - .thumb_func - .weak CMC_IRQHandler - .type CMC_IRQHandler, %function -CMC_IRQHandler: - ldr r0,=CMC_DriverIRQHandler - bx r0 - .size CMC_IRQHandler, . - CMC_IRQHandler - - .align 1 - .thumb_func - .weak DMA_CH0_IRQHandler - .type DMA_CH0_IRQHandler, %function -DMA_CH0_IRQHandler: - ldr r0,=DMA_CH0_DriverIRQHandler - bx r0 - .size DMA_CH0_IRQHandler, . - DMA_CH0_IRQHandler - - .align 1 - .thumb_func - .weak DMA_CH1_IRQHandler - .type DMA_CH1_IRQHandler, %function -DMA_CH1_IRQHandler: - ldr r0,=DMA_CH1_DriverIRQHandler - bx r0 - .size DMA_CH1_IRQHandler, . - DMA_CH1_IRQHandler - - .align 1 - .thumb_func - .weak DMA_CH2_IRQHandler - .type DMA_CH2_IRQHandler, %function -DMA_CH2_IRQHandler: - ldr r0,=DMA_CH2_DriverIRQHandler - bx r0 - .size DMA_CH2_IRQHandler, . - DMA_CH2_IRQHandler - - .align 1 - .thumb_func - .weak DMA_CH3_IRQHandler - .type DMA_CH3_IRQHandler, %function -DMA_CH3_IRQHandler: - ldr r0,=DMA_CH3_DriverIRQHandler - bx r0 - .size DMA_CH3_IRQHandler, . - DMA_CH3_IRQHandler - - .align 1 - .thumb_func - .weak Reserved22_IRQHandler - .type Reserved22_IRQHandler, %function -Reserved22_IRQHandler: - ldr r0,=Reserved22_DriverIRQHandler - bx r0 - .size Reserved22_IRQHandler, . - Reserved22_IRQHandler - - .align 1 - .thumb_func - .weak Reserved23_IRQHandler - .type Reserved23_IRQHandler, %function -Reserved23_IRQHandler: - ldr r0,=Reserved23_DriverIRQHandler - bx r0 - .size Reserved23_IRQHandler, . - Reserved23_IRQHandler - - .align 1 - .thumb_func - .weak Reserved24_IRQHandler - .type Reserved24_IRQHandler, %function -Reserved24_IRQHandler: - ldr r0,=Reserved24_DriverIRQHandler - bx r0 - .size Reserved24_IRQHandler, . - Reserved24_IRQHandler - - .align 1 - .thumb_func - .weak Reserved25_IRQHandler - .type Reserved25_IRQHandler, %function -Reserved25_IRQHandler: - ldr r0,=Reserved25_DriverIRQHandler - bx r0 - .size Reserved25_IRQHandler, . - Reserved25_IRQHandler - - .align 1 - .thumb_func - .weak ERM0_SINGLE_BIT_IRQHandler - .type ERM0_SINGLE_BIT_IRQHandler, %function -ERM0_SINGLE_BIT_IRQHandler: - ldr r0,=ERM0_SINGLE_BIT_DriverIRQHandler - bx r0 - .size ERM0_SINGLE_BIT_IRQHandler, . - ERM0_SINGLE_BIT_IRQHandler - - .align 1 - .thumb_func - .weak ERM0_MULTI_BIT_IRQHandler - .type ERM0_MULTI_BIT_IRQHandler, %function -ERM0_MULTI_BIT_IRQHandler: - ldr r0,=ERM0_MULTI_BIT_DriverIRQHandler - bx r0 - .size ERM0_MULTI_BIT_IRQHandler, . - ERM0_MULTI_BIT_IRQHandler - - .align 1 - .thumb_func - .weak FMU0_IRQHandler - .type FMU0_IRQHandler, %function -FMU0_IRQHandler: - ldr r0,=FMU0_DriverIRQHandler - bx r0 - .size FMU0_IRQHandler, . - FMU0_IRQHandler - - .align 1 - .thumb_func - .weak GLIKEY0_IRQHandler - .type GLIKEY0_IRQHandler, %function -GLIKEY0_IRQHandler: - ldr r0,=GLIKEY0_DriverIRQHandler - bx r0 - .size GLIKEY0_IRQHandler, . - GLIKEY0_IRQHandler - - .align 1 - .thumb_func - .weak MBC0_IRQHandler - .type MBC0_IRQHandler, %function -MBC0_IRQHandler: - ldr r0,=MBC0_DriverIRQHandler - bx r0 - .size MBC0_IRQHandler, . - MBC0_IRQHandler - - .align 1 - .thumb_func - .weak SCG0_IRQHandler - .type SCG0_IRQHandler, %function -SCG0_IRQHandler: - ldr r0,=SCG0_DriverIRQHandler - bx r0 - .size SCG0_IRQHandler, . - SCG0_IRQHandler - - .align 1 - .thumb_func - .weak SPC0_IRQHandler - .type SPC0_IRQHandler, %function -SPC0_IRQHandler: - ldr r0,=SPC0_DriverIRQHandler - bx r0 - .size SPC0_IRQHandler, . - SPC0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved33_IRQHandler - .type Reserved33_IRQHandler, %function -Reserved33_IRQHandler: - ldr r0,=Reserved33_DriverIRQHandler - bx r0 - .size Reserved33_IRQHandler, . - Reserved33_IRQHandler - - .align 1 - .thumb_func - .weak WUU0_IRQHandler - .type WUU0_IRQHandler, %function -WUU0_IRQHandler: - ldr r0,=WUU0_DriverIRQHandler - bx r0 - .size WUU0_IRQHandler, . - WUU0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved35_IRQHandler - .type Reserved35_IRQHandler, %function -Reserved35_IRQHandler: - ldr r0,=Reserved35_DriverIRQHandler - bx r0 - .size Reserved35_IRQHandler, . - Reserved35_IRQHandler - - .align 1 - .thumb_func - .weak Reserved36_IRQHandler - .type Reserved36_IRQHandler, %function -Reserved36_IRQHandler: - ldr r0,=Reserved36_DriverIRQHandler - bx r0 - .size Reserved36_IRQHandler, . - Reserved36_IRQHandler - - .align 1 - .thumb_func - .weak Reserved37_IRQHandler - .type Reserved37_IRQHandler, %function -Reserved37_IRQHandler: - ldr r0,=Reserved37_DriverIRQHandler - bx r0 - .size Reserved37_IRQHandler, . - Reserved37_IRQHandler - - .align 1 - .thumb_func - .weak Reserved38_IRQHandler - .type Reserved38_IRQHandler, %function -Reserved38_IRQHandler: - ldr r0,=Reserved38_DriverIRQHandler - bx r0 - .size Reserved38_IRQHandler, . - Reserved38_IRQHandler - - .align 1 - .thumb_func - .weak Reserved39_IRQHandler - .type Reserved39_IRQHandler, %function -Reserved39_IRQHandler: - ldr r0,=Reserved39_DriverIRQHandler - bx r0 - .size Reserved39_IRQHandler, . - Reserved39_IRQHandler - - .align 1 - .thumb_func - .weak I3C0_IRQHandler - .type I3C0_IRQHandler, %function -I3C0_IRQHandler: - ldr r0,=I3C0_DriverIRQHandler - bx r0 - .size I3C0_IRQHandler, . - I3C0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved41_IRQHandler - .type Reserved41_IRQHandler, %function -Reserved41_IRQHandler: - ldr r0,=Reserved41_DriverIRQHandler - bx r0 - .size Reserved41_IRQHandler, . - Reserved41_IRQHandler - - .align 1 - .thumb_func - .weak LPI2C0_IRQHandler - .type LPI2C0_IRQHandler, %function -LPI2C0_IRQHandler: - ldr r0,=LPI2C0_DriverIRQHandler - bx r0 - .size LPI2C0_IRQHandler, . - LPI2C0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved43_IRQHandler - .type Reserved43_IRQHandler, %function -Reserved43_IRQHandler: - ldr r0,=Reserved43_DriverIRQHandler - bx r0 - .size Reserved43_IRQHandler, . - Reserved43_IRQHandler - - .align 1 - .thumb_func - .weak LPSPI0_IRQHandler - .type LPSPI0_IRQHandler, %function -LPSPI0_IRQHandler: - ldr r0,=LPSPI0_DriverIRQHandler - bx r0 - .size LPSPI0_IRQHandler, . - LPSPI0_IRQHandler - - .align 1 - .thumb_func - .weak LPSPI1_IRQHandler - .type LPSPI1_IRQHandler, %function -LPSPI1_IRQHandler: - ldr r0,=LPSPI1_DriverIRQHandler - bx r0 - .size LPSPI1_IRQHandler, . - LPSPI1_IRQHandler - - .align 1 - .thumb_func - .weak Reserved46_IRQHandler - .type Reserved46_IRQHandler, %function -Reserved46_IRQHandler: - ldr r0,=Reserved46_DriverIRQHandler - bx r0 - .size Reserved46_IRQHandler, . - Reserved46_IRQHandler - - .align 1 - .thumb_func - .weak LPUART0_IRQHandler - .type LPUART0_IRQHandler, %function -LPUART0_IRQHandler: - ldr r0,=LPUART0_DriverIRQHandler - bx r0 - .size LPUART0_IRQHandler, . - LPUART0_IRQHandler - - .align 1 - .thumb_func - .weak LPUART1_IRQHandler - .type LPUART1_IRQHandler, %function -LPUART1_IRQHandler: - ldr r0,=LPUART1_DriverIRQHandler - bx r0 - .size LPUART1_IRQHandler, . - LPUART1_IRQHandler - - .align 1 - .thumb_func - .weak LPUART2_IRQHandler - .type LPUART2_IRQHandler, %function -LPUART2_IRQHandler: - ldr r0,=LPUART2_DriverIRQHandler - bx r0 - .size LPUART2_IRQHandler, . - LPUART2_IRQHandler - - .align 1 - .thumb_func - .weak Reserved50_IRQHandler - .type Reserved50_IRQHandler, %function -Reserved50_IRQHandler: - ldr r0,=Reserved50_DriverIRQHandler - bx r0 - .size Reserved50_IRQHandler, . - Reserved50_IRQHandler - - .align 1 - .thumb_func - .weak Reserved51_IRQHandler - .type Reserved51_IRQHandler, %function -Reserved51_IRQHandler: - ldr r0,=Reserved51_DriverIRQHandler - bx r0 - .size Reserved51_IRQHandler, . - Reserved51_IRQHandler - - .align 1 - .thumb_func - .weak USB0_IRQHandler - .type USB0_IRQHandler, %function -USB0_IRQHandler: - ldr r0,=USB0_DriverIRQHandler - bx r0 - .size USB0_IRQHandler, . - USB0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved53_IRQHandler - .type Reserved53_IRQHandler, %function -Reserved53_IRQHandler: - ldr r0,=Reserved53_DriverIRQHandler - bx r0 - .size Reserved53_IRQHandler, . - Reserved53_IRQHandler - - .align 1 - .thumb_func - .weak CDOG0_IRQHandler - .type CDOG0_IRQHandler, %function -CDOG0_IRQHandler: - ldr r0,=CDOG0_DriverIRQHandler - bx r0 - .size CDOG0_IRQHandler, . - CDOG0_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER0_IRQHandler - .type CTIMER0_IRQHandler, %function -CTIMER0_IRQHandler: - ldr r0,=CTIMER0_DriverIRQHandler - bx r0 - .size CTIMER0_IRQHandler, . - CTIMER0_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER1_IRQHandler - .type CTIMER1_IRQHandler, %function -CTIMER1_IRQHandler: - ldr r0,=CTIMER1_DriverIRQHandler - bx r0 - .size CTIMER1_IRQHandler, . - CTIMER1_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER2_IRQHandler - .type CTIMER2_IRQHandler, %function -CTIMER2_IRQHandler: - ldr r0,=CTIMER2_DriverIRQHandler - bx r0 - .size CTIMER2_IRQHandler, . - CTIMER2_IRQHandler - - .align 1 - .thumb_func - .weak Reserved58_IRQHandler - .type Reserved58_IRQHandler, %function -Reserved58_IRQHandler: - ldr r0,=Reserved58_DriverIRQHandler - bx r0 - .size Reserved58_IRQHandler, . - Reserved58_IRQHandler - - .align 1 - .thumb_func - .weak Reserved59_IRQHandler - .type Reserved59_IRQHandler, %function -Reserved59_IRQHandler: - ldr r0,=Reserved59_DriverIRQHandler - bx r0 - .size Reserved59_IRQHandler, . - Reserved59_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_RELOAD_ERROR_IRQHandler - .type FLEXPWM0_RELOAD_ERROR_IRQHandler, %function -FLEXPWM0_RELOAD_ERROR_IRQHandler: - ldr r0,=FLEXPWM0_RELOAD_ERROR_DriverIRQHandler - bx r0 - .size FLEXPWM0_RELOAD_ERROR_IRQHandler, . - FLEXPWM0_RELOAD_ERROR_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_FAULT_IRQHandler - .type FLEXPWM0_FAULT_IRQHandler, %function -FLEXPWM0_FAULT_IRQHandler: - ldr r0,=FLEXPWM0_FAULT_DriverIRQHandler - bx r0 - .size FLEXPWM0_FAULT_IRQHandler, . - FLEXPWM0_FAULT_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE0_IRQHandler - .type FLEXPWM0_SUBMODULE0_IRQHandler, %function -FLEXPWM0_SUBMODULE0_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE0_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE0_IRQHandler, . - FLEXPWM0_SUBMODULE0_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE1_IRQHandler - .type FLEXPWM0_SUBMODULE1_IRQHandler, %function -FLEXPWM0_SUBMODULE1_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE1_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE1_IRQHandler, . - FLEXPWM0_SUBMODULE1_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE2_IRQHandler - .type FLEXPWM0_SUBMODULE2_IRQHandler, %function -FLEXPWM0_SUBMODULE2_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE2_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE2_IRQHandler, . - FLEXPWM0_SUBMODULE2_IRQHandler - - .align 1 - .thumb_func - .weak Reserved65_IRQHandler - .type Reserved65_IRQHandler, %function -Reserved65_IRQHandler: - ldr r0,=Reserved65_DriverIRQHandler - bx r0 - .size Reserved65_IRQHandler, . - Reserved65_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_COMPARE_IRQHandler - .type QDC0_COMPARE_IRQHandler, %function -QDC0_COMPARE_IRQHandler: - ldr r0,=QDC0_COMPARE_DriverIRQHandler - bx r0 - .size QDC0_COMPARE_IRQHandler, . - QDC0_COMPARE_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_HOME_IRQHandler - .type QDC0_HOME_IRQHandler, %function -QDC0_HOME_IRQHandler: - ldr r0,=QDC0_HOME_DriverIRQHandler - bx r0 - .size QDC0_HOME_IRQHandler, . - QDC0_HOME_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_WATCHDOG_IRQHandler - .type QDC0_WATCHDOG_IRQHandler, %function -QDC0_WATCHDOG_IRQHandler: - ldr r0,=QDC0_WATCHDOG_DriverIRQHandler - bx r0 - .size QDC0_WATCHDOG_IRQHandler, . - QDC0_WATCHDOG_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_INDEX_IRQHandler - .type QDC0_INDEX_IRQHandler, %function -QDC0_INDEX_IRQHandler: - ldr r0,=QDC0_INDEX_DriverIRQHandler - bx r0 - .size QDC0_INDEX_IRQHandler, . - QDC0_INDEX_IRQHandler - - .align 1 - .thumb_func - .weak FREQME0_IRQHandler - .type FREQME0_IRQHandler, %function -FREQME0_IRQHandler: - ldr r0,=FREQME0_DriverIRQHandler - bx r0 - .size FREQME0_IRQHandler, . - FREQME0_IRQHandler - - .align 1 - .thumb_func - .weak LPTMR0_IRQHandler - .type LPTMR0_IRQHandler, %function -LPTMR0_IRQHandler: - ldr r0,=LPTMR0_DriverIRQHandler - bx r0 - .size LPTMR0_IRQHandler, . - LPTMR0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved72_IRQHandler - .type Reserved72_IRQHandler, %function -Reserved72_IRQHandler: - ldr r0,=Reserved72_DriverIRQHandler - bx r0 - .size Reserved72_IRQHandler, . - Reserved72_IRQHandler - - .align 1 - .thumb_func - .weak OS_EVENT_IRQHandler - .type OS_EVENT_IRQHandler, %function -OS_EVENT_IRQHandler: - ldr r0,=OS_EVENT_DriverIRQHandler - bx r0 - .size OS_EVENT_IRQHandler, . - OS_EVENT_IRQHandler - - .align 1 - .thumb_func - .weak WAKETIMER0_IRQHandler - .type WAKETIMER0_IRQHandler, %function -WAKETIMER0_IRQHandler: - ldr r0,=WAKETIMER0_DriverIRQHandler - bx r0 - .size WAKETIMER0_IRQHandler, . - WAKETIMER0_IRQHandler - - .align 1 - .thumb_func - .weak UTICK0_IRQHandler - .type UTICK0_IRQHandler, %function -UTICK0_IRQHandler: - ldr r0,=UTICK0_DriverIRQHandler - bx r0 - .size UTICK0_IRQHandler, . - UTICK0_IRQHandler - - .align 1 - .thumb_func - .weak WWDT0_IRQHandler - .type WWDT0_IRQHandler, %function -WWDT0_IRQHandler: - ldr r0,=WWDT0_DriverIRQHandler - bx r0 - .size WWDT0_IRQHandler, . - WWDT0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved77_IRQHandler - .type Reserved77_IRQHandler, %function -Reserved77_IRQHandler: - ldr r0,=Reserved77_DriverIRQHandler - bx r0 - .size Reserved77_IRQHandler, . - Reserved77_IRQHandler - - .align 1 - .thumb_func - .weak ADC0_IRQHandler - .type ADC0_IRQHandler, %function -ADC0_IRQHandler: - ldr r0,=ADC0_DriverIRQHandler - bx r0 - .size ADC0_IRQHandler, . - ADC0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved79_IRQHandler - .type Reserved79_IRQHandler, %function -Reserved79_IRQHandler: - ldr r0,=Reserved79_DriverIRQHandler - bx r0 - .size Reserved79_IRQHandler, . - Reserved79_IRQHandler - - .align 1 - .thumb_func - .weak CMP0_IRQHandler - .type CMP0_IRQHandler, %function -CMP0_IRQHandler: - ldr r0,=CMP0_DriverIRQHandler - bx r0 - .size CMP0_IRQHandler, . - CMP0_IRQHandler - - .align 1 - .thumb_func - .weak CMP1_IRQHandler - .type CMP1_IRQHandler, %function -CMP1_IRQHandler: - ldr r0,=CMP1_DriverIRQHandler - bx r0 - .size CMP1_IRQHandler, . - CMP1_IRQHandler - - .align 1 - .thumb_func - .weak Reserved82_IRQHandler - .type Reserved82_IRQHandler, %function -Reserved82_IRQHandler: - ldr r0,=Reserved82_DriverIRQHandler - bx r0 - .size Reserved82_IRQHandler, . - Reserved82_IRQHandler - - .align 1 - .thumb_func - .weak Reserved83_IRQHandler - .type Reserved83_IRQHandler, %function -Reserved83_IRQHandler: - ldr r0,=Reserved83_DriverIRQHandler - bx r0 - .size Reserved83_IRQHandler, . - Reserved83_IRQHandler - - .align 1 - .thumb_func - .weak Reserved84_IRQHandler - .type Reserved84_IRQHandler, %function -Reserved84_IRQHandler: - ldr r0,=Reserved84_DriverIRQHandler - bx r0 - .size Reserved84_IRQHandler, . - Reserved84_IRQHandler - - .align 1 - .thumb_func - .weak Reserved85_IRQHandler - .type Reserved85_IRQHandler, %function -Reserved85_IRQHandler: - ldr r0,=Reserved85_DriverIRQHandler - bx r0 - .size Reserved85_IRQHandler, . - Reserved85_IRQHandler - - .align 1 - .thumb_func - .weak Reserved86_IRQHandler - .type Reserved86_IRQHandler, %function -Reserved86_IRQHandler: - ldr r0,=Reserved86_DriverIRQHandler - bx r0 - .size Reserved86_IRQHandler, . - Reserved86_IRQHandler - - .align 1 - .thumb_func - .weak GPIO0_IRQHandler - .type GPIO0_IRQHandler, %function -GPIO0_IRQHandler: - ldr r0,=GPIO0_DriverIRQHandler - bx r0 - .size GPIO0_IRQHandler, . - GPIO0_IRQHandler - - .align 1 - .thumb_func - .weak GPIO1_IRQHandler - .type GPIO1_IRQHandler, %function -GPIO1_IRQHandler: - ldr r0,=GPIO1_DriverIRQHandler - bx r0 - .size GPIO1_IRQHandler, . - GPIO1_IRQHandler - - .align 1 - .thumb_func - .weak GPIO2_IRQHandler - .type GPIO2_IRQHandler, %function -GPIO2_IRQHandler: - ldr r0,=GPIO2_DriverIRQHandler - bx r0 - .size GPIO2_IRQHandler, . - GPIO2_IRQHandler - - .align 1 - .thumb_func - .weak GPIO3_IRQHandler - .type GPIO3_IRQHandler, %function -GPIO3_IRQHandler: - ldr r0,=GPIO3_DriverIRQHandler - bx r0 - .size GPIO3_IRQHandler, . - GPIO3_IRQHandler - - .align 1 - .thumb_func - .weak Reserved91_IRQHandler - .type Reserved91_IRQHandler, %function -Reserved91_IRQHandler: - ldr r0,=Reserved91_DriverIRQHandler - bx r0 - .size Reserved91_IRQHandler, . - Reserved91_IRQHandler - - .align 1 - .thumb_func - .weak Reserved92_IRQHandler - .type Reserved92_IRQHandler, %function -Reserved92_IRQHandler: - ldr r0,=Reserved92_DriverIRQHandler - bx r0 - .size Reserved92_IRQHandler, . - Reserved92_IRQHandler - - .align 1 - .thumb_func - .weak Reserved93_IRQHandler - .type Reserved93_IRQHandler, %function -Reserved93_IRQHandler: - ldr r0,=Reserved93_DriverIRQHandler - bx r0 - .size Reserved93_IRQHandler, . - Reserved93_IRQHandler - - .align 1 - .thumb_func - .weak Reserved94_IRQHandler - .type Reserved94_IRQHandler, %function -Reserved94_IRQHandler: - ldr r0,=Reserved94_DriverIRQHandler - bx r0 - .size Reserved94_IRQHandler, . - Reserved94_IRQHandler - - .align 1 - .thumb_func - .weak Reserved95_IRQHandler - .type Reserved95_IRQHandler, %function -Reserved95_IRQHandler: - ldr r0,=Reserved95_DriverIRQHandler - bx r0 - .size Reserved95_IRQHandler, . - Reserved95_IRQHandler - - -/* Macro to define default handlers. Default handler - * will be weak symbol and just dead loops. They can be - * overwritten by other handlers */ - .macro def_irq_handler handler_name - .weak \handler_name - .set \handler_name, DefaultISR - .endm -/* Exception Handlers */ - def_irq_handler MemManage_Handler - def_irq_handler BusFault_Handler - def_irq_handler UsageFault_Handler - def_irq_handler SecureFault_Handler - def_irq_handler DebugMon_Handler - def_irq_handler Reserved16_DriverIRQHandler - def_irq_handler CMC_DriverIRQHandler - def_irq_handler DMA_CH0_DriverIRQHandler - def_irq_handler DMA_CH1_DriverIRQHandler - def_irq_handler DMA_CH2_DriverIRQHandler - def_irq_handler DMA_CH3_DriverIRQHandler - def_irq_handler Reserved22_DriverIRQHandler - def_irq_handler Reserved23_DriverIRQHandler - def_irq_handler Reserved24_DriverIRQHandler - def_irq_handler Reserved25_DriverIRQHandler - def_irq_handler ERM0_SINGLE_BIT_DriverIRQHandler - def_irq_handler ERM0_MULTI_BIT_DriverIRQHandler - def_irq_handler FMU0_DriverIRQHandler - def_irq_handler GLIKEY0_DriverIRQHandler - def_irq_handler MBC0_DriverIRQHandler - def_irq_handler SCG0_DriverIRQHandler - def_irq_handler SPC0_DriverIRQHandler - def_irq_handler Reserved33_DriverIRQHandler - def_irq_handler WUU0_DriverIRQHandler - def_irq_handler Reserved35_DriverIRQHandler - def_irq_handler Reserved36_DriverIRQHandler - def_irq_handler Reserved37_DriverIRQHandler - def_irq_handler Reserved38_DriverIRQHandler - def_irq_handler Reserved39_DriverIRQHandler - def_irq_handler I3C0_DriverIRQHandler - def_irq_handler Reserved41_DriverIRQHandler - def_irq_handler LPI2C0_DriverIRQHandler - def_irq_handler Reserved43_DriverIRQHandler - def_irq_handler LPSPI0_DriverIRQHandler - def_irq_handler LPSPI1_DriverIRQHandler - def_irq_handler Reserved46_DriverIRQHandler - def_irq_handler LPUART0_DriverIRQHandler - def_irq_handler LPUART1_DriverIRQHandler - def_irq_handler LPUART2_DriverIRQHandler - def_irq_handler Reserved50_DriverIRQHandler - def_irq_handler Reserved51_DriverIRQHandler - def_irq_handler USB0_DriverIRQHandler - def_irq_handler Reserved53_DriverIRQHandler - def_irq_handler CDOG0_DriverIRQHandler - def_irq_handler CTIMER0_DriverIRQHandler - def_irq_handler CTIMER1_DriverIRQHandler - def_irq_handler CTIMER2_DriverIRQHandler - def_irq_handler Reserved58_DriverIRQHandler - def_irq_handler Reserved59_DriverIRQHandler - def_irq_handler FLEXPWM0_RELOAD_ERROR_DriverIRQHandler - def_irq_handler FLEXPWM0_FAULT_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE0_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE1_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE2_DriverIRQHandler - def_irq_handler Reserved65_DriverIRQHandler - def_irq_handler QDC0_COMPARE_DriverIRQHandler - def_irq_handler QDC0_HOME_DriverIRQHandler - def_irq_handler QDC0_WATCHDOG_DriverIRQHandler - def_irq_handler QDC0_INDEX_DriverIRQHandler - def_irq_handler FREQME0_DriverIRQHandler - def_irq_handler LPTMR0_DriverIRQHandler - def_irq_handler Reserved72_DriverIRQHandler - def_irq_handler OS_EVENT_DriverIRQHandler - def_irq_handler WAKETIMER0_DriverIRQHandler - def_irq_handler UTICK0_DriverIRQHandler - def_irq_handler WWDT0_DriverIRQHandler - def_irq_handler Reserved77_DriverIRQHandler - def_irq_handler ADC0_DriverIRQHandler - def_irq_handler Reserved79_DriverIRQHandler - def_irq_handler CMP0_DriverIRQHandler - def_irq_handler CMP1_DriverIRQHandler - def_irq_handler Reserved82_DriverIRQHandler - def_irq_handler Reserved83_DriverIRQHandler - def_irq_handler Reserved84_DriverIRQHandler - def_irq_handler Reserved85_DriverIRQHandler - def_irq_handler Reserved86_DriverIRQHandler - def_irq_handler GPIO0_DriverIRQHandler - def_irq_handler GPIO1_DriverIRQHandler - def_irq_handler GPIO2_DriverIRQHandler - def_irq_handler GPIO3_DriverIRQHandler - def_irq_handler Reserved91_DriverIRQHandler - def_irq_handler Reserved92_DriverIRQHandler - def_irq_handler Reserved93_DriverIRQHandler - def_irq_handler Reserved94_DriverIRQHandler - def_irq_handler Reserved95_DriverIRQHandler - - .end diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/iar/MCXA153_flash.icf b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/iar/MCXA153_flash.icf deleted file mode 100644 index b9f53a6a46b..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/iar/MCXA153_flash.icf +++ /dev/null @@ -1,86 +0,0 @@ -/* -** ################################################################### -** Processors: MCXA153VFM -** MCXA153VFT -** MCXA153VLF -** MCXA153VLH -** -** Compiler: IAR ANSI C/C++ Compiler for ARM -** Reference manual: MCXA1 User manual -** Version: rev. 1.0, 2022-03-29 -** Build: b240403 -** -** Abstract: -** Linker file for the IAR ANSI C/C++ Compiler for ARM -** -** Copyright 2016 Freescale Semiconductor, Inc. -** Copyright 2016-2024 NXP -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** ################################################################### -*/ - - -/* Stack and Heap Sizes */ -if (isdefinedsymbol(__stack_size__)) { - define symbol __size_cstack__ = __stack_size__; -} else { - define symbol __size_cstack__ = 0x0400; -} - -if (isdefinedsymbol(__heap_size__)) { - define symbol __size_heap__ = __heap_size__; -} else { - define symbol __size_heap__ = 0x0400; -} - -define symbol m_interrupts_start = 0x00000000; -define symbol m_interrupts_end = 0x000001FF; - -define symbol m_text_start = 0x00000200; -define symbol m_text_end = 0x0001FFFF; - -define symbol m_data_start = 0x20000000; -define symbol m_data_end = 0x20005FFF; - -define symbol m_sramx0_start = 0x04000000; -define symbol m_sramx0_end = 0x04001FFF; - -define memory mem with size = 4G; - -define region TEXT_region = mem:[from m_interrupts_start to m_interrupts_end] - | mem:[from m_text_start to m_text_end]; -define region DATA_region = mem:[from m_data_start to m_data_end-__size_cstack__] - | mem:[from m_sramx0_start to m_sramx0_end]; - -define region CSTACK_region = mem:[from m_data_end-__size_cstack__+1 to m_data_end]; -if (isdefinedsymbol(__use_shmem__)) { - define region rpmsg_sh_mem_region = mem:[from rpmsg_sh_mem_start to rpmsg_sh_mem_end]; -} - -define block CSTACK with alignment = 8, size = __size_cstack__ { }; -define block HEAP with alignment = 8, size = __size_heap__ { }; -define block RW { readwrite }; -define block ZI { zi }; - -initialize by copy { readwrite, section .textrw }; - -if (isdefinedsymbol(__USE_DLIB_PERTHREAD)) -{ - /* Required in a multi-threaded application */ - initialize by copy with packing = none { section __DLIB_PERTHREAD }; -} - - -place at address mem: m_interrupts_start { readonly section .intvec }; -place in TEXT_region { readonly }; -place in DATA_region { block RW }; -place in DATA_region { block ZI }; -place in DATA_region { last block HEAP }; -place in CSTACK_region { block CSTACK }; - - - diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/iar/MCXA153_ram.icf b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/iar/MCXA153_ram.icf deleted file mode 100644 index 24fe5e9955b..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/iar/MCXA153_ram.icf +++ /dev/null @@ -1,82 +0,0 @@ -/* -** ################################################################### -** Processors: MCXA153VFM -** MCXA153VFT -** MCXA153VLF -** MCXA153VLH -** -** Compiler: IAR ANSI C/C++ Compiler for ARM -** Reference manual: MCXA1 User manual -** Version: rev. 1.0, 2022-03-29 -** Build: b240403 -** -** Abstract: -** Linker file for the IAR ANSI C/C++ Compiler for ARM -** -** Copyright 2016 Freescale Semiconductor, Inc. -** Copyright 2016-2024 NXP -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** ################################################################### -*/ - - -/* Stack and Heap Sizes */ -if (isdefinedsymbol(__stack_size__)) { - define symbol __size_cstack__ = __stack_size__; -} else { - define symbol __size_cstack__ = 0x0400; -} - -if (isdefinedsymbol(__heap_size__)) { - define symbol __size_heap__ = __heap_size__; -} else { - define symbol __size_heap__ = 0x0400; -} - -define symbol m_interrupts_start = 0x04000000; -define symbol m_interrupts_end = 0x040001FF; - -define symbol m_text_start = 0x04000200; -define symbol m_text_end = 0x04001FFF; - -define symbol m_data_start = 0x20000000; -define symbol m_data_end = 0x20005FFF; - -define memory mem with size = 4G; - -define region TEXT_region = mem:[from m_interrupts_start to m_interrupts_end] - | mem:[from m_text_start to m_text_end]; -define region DATA_region = mem:[from m_data_start to m_data_end-__size_cstack__]; - -define region CSTACK_region = mem:[from m_data_end-__size_cstack__+1 to m_data_end]; -if (isdefinedsymbol(__use_shmem__)) { - define region rpmsg_sh_mem_region = mem:[from rpmsg_sh_mem_start to rpmsg_sh_mem_end]; -} - -define block CSTACK with alignment = 8, size = __size_cstack__ { }; -define block HEAP with alignment = 8, size = __size_heap__ { }; -define block RW { readwrite }; -define block ZI { zi }; - -initialize by copy { readwrite, section .textrw }; - -if (isdefinedsymbol(__USE_DLIB_PERTHREAD)) -{ - /* Required in a multi-threaded application */ - initialize by copy with packing = none { section __DLIB_PERTHREAD }; -} - - -place at address mem: m_interrupts_start { readonly section .intvec }; -place in TEXT_region { readonly }; -place in DATA_region { block RW }; -place in DATA_region { block ZI }; -place in DATA_region { last block HEAP }; -place in CSTACK_region { block CSTACK }; - - - diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/iar/startup_MCXA153.s b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/iar/startup_MCXA153.s deleted file mode 100644 index 634e8e97c6a..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/iar/startup_MCXA153.s +++ /dev/null @@ -1,872 +0,0 @@ -; ------------------------------------------------------------------------- -; @file: startup_MCXA153.s -; @purpose: CMSIS Cortex-M33 Core Device Startup File -; MCXA153 -; @version: 1.0 -; @date: 2022-3-29 -; @build: b240401 -; ------------------------------------------------------------------------- -; -; Copyright 1997-2016 Freescale Semiconductor, Inc. -; Copyright 2016-2024 NXP -; SPDX-License-Identifier: BSD-3-Clause -; -; The modules in this file are included in the libraries, and may be replaced -; by any user-defined modules that define the PUBLIC symbol _program_start or -; a user defined start symbol. -; To override the cstartup defined in the library, simply add your modified -; version to the workbench project. -; -; The vector table is normally located at address 0. -; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. -; The name "__vector_table" has special meaning for C-SPY: -; it is where the SP start value is found, and the NVIC vector -; table register (VTOR) is initialized to this address if != 0. -; -; Cortex-M version -; - - MODULE ?cstartup - - ;; Forward declaration of sections. - SECTION CSTACK:DATA:NOROOT(3) - - SECTION .intvec:CODE:NOROOT(2) - - EXTERN __iar_program_start - EXTERN SystemInit - PUBLIC __vector_table - PUBLIC __vector_table_0x1c - PUBLIC __Vectors - PUBLIC __Vectors_End - PUBLIC __Vectors_Size - - DATA - -__iar_init$$done: ; The vector table is not needed - ; until after copy initialization is done - -__vector_table - DCD sfe(CSTACK) - DCD Reset_Handler - - DCD NMI_Handler ;NMI Handler - DCD HardFault_Handler ;Hard Fault Handler - DCD MemManage_Handler ;MPU Fault Handler - DCD BusFault_Handler ;Bus Fault Handler - DCD UsageFault_Handler ;Usage Fault Handler -__vector_table_0x1c - DCD SecureFault_Handler ;Secure Fault Handler - DCD 0 ;Reserved - DCD 0 ;Reserved - DCD 0 ;Reserved - DCD SVC_Handler ;SVCall Handler - DCD DebugMon_Handler ;Debug Monitor Handler - DCD 0 ;Reserved - DCD PendSV_Handler ;PendSV Handler - DCD SysTick_Handler ;SysTick Handler - - ;External Interrupts - DCD Reserved16_IRQHandler ;OR IRQ1 to IRQ53 - DCD CMC_IRQHandler ;Core Mode Controller interrupt - DCD DMA_CH0_IRQHandler ;DMA3_0_CH0 error or transfer complete - DCD DMA_CH1_IRQHandler ;DMA3_0_CH1 error or transfer complete - DCD DMA_CH2_IRQHandler ;DMA3_0_CH2 error or transfer complete - DCD DMA_CH3_IRQHandler ;DMA3_0_CH3 error or transfer complete - DCD Reserved22_IRQHandler ;Reserved interrupt - DCD Reserved23_IRQHandler ;Reserved interrupt - DCD Reserved24_IRQHandler ;Reserved interrupt - DCD Reserved25_IRQHandler ;Reserved interrupt - DCD ERM0_SINGLE_BIT_IRQHandler ;ERM Single Bit error interrupt - DCD ERM0_MULTI_BIT_IRQHandler ;ERM Multi Bit error interrupt - DCD FMU0_IRQHandler ;Flash Management Unit interrupt - DCD GLIKEY0_IRQHandler ;GLIKEY Interrupt - DCD MBC0_IRQHandler ;MBC secure violation interrupt - DCD SCG0_IRQHandler ;System Clock Generator interrupt - DCD SPC0_IRQHandler ;System Power Controller interrupt - DCD Reserved33_IRQHandler ;Reserved interrupt - DCD WUU0_IRQHandler ;Wake Up Unit interrupt - DCD Reserved35_IRQHandler ;Reserved interrupt - DCD Reserved36_IRQHandler ;Reserved interrupt - DCD Reserved37_IRQHandler ;Reserved interrupt - DCD Reserved38_IRQHandler ;Reserved interrupt - DCD Reserved39_IRQHandler ;Reserved interrupt - DCD I3C0_IRQHandler ;Improved Inter Integrated Circuit interrupt 0 - DCD Reserved41_IRQHandler ;Reserved interrupt - DCD LPI2C0_IRQHandler ;Low-Power Inter Integrated Circuit interrupt - DCD Reserved43_IRQHandler ;Reserved interrupt - DCD LPSPI0_IRQHandler ;Low-Power Serial Peripheral Interface interrupt - DCD LPSPI1_IRQHandler ;Low-Power Serial Peripheral Interface interrupt - DCD Reserved46_IRQHandler ;Reserved interrupt - DCD LPUART0_IRQHandler ;Low-Power Universal Asynchronous Receive/Transmit interrupt - DCD LPUART1_IRQHandler ;Low-Power Universal Asynchronous Receive/Transmit interrupt - DCD LPUART2_IRQHandler ;Low-Power Universal Asynchronous Receive/Transmit interrupt - DCD Reserved50_IRQHandler ;Reserved interrupt - DCD Reserved51_IRQHandler ;Reserved interrupt - DCD USB0_IRQHandler ;Universal Serial Bus - Full Speed interrupt - DCD Reserved53_IRQHandler ;Reserved interrupt - DCD CDOG0_IRQHandler ;Code Watchdog Timer 0 interrupt - DCD CTIMER0_IRQHandler ;Standard counter/timer 0 interrupt - DCD CTIMER1_IRQHandler ;Standard counter/timer 1 interrupt - DCD CTIMER2_IRQHandler ;Standard counter/timer 2 interrupt - DCD Reserved58_IRQHandler ;Reserved interrupt - DCD Reserved59_IRQHandler ;Reserved interrupt - DCD FLEXPWM0_RELOAD_ERROR_IRQHandler ;FlexPWM0_reload_error interrupt - DCD FLEXPWM0_FAULT_IRQHandler ;FlexPWM0_fault interrupt - DCD FLEXPWM0_SUBMODULE0_IRQHandler ;FlexPWM0 Submodule 0 capture/compare/reload interrupt - DCD FLEXPWM0_SUBMODULE1_IRQHandler ;FlexPWM0 Submodule 1 capture/compare/reload interrupt - DCD FLEXPWM0_SUBMODULE2_IRQHandler ;FlexPWM0 Submodule 2 capture/compare/reload interrupt - DCD Reserved65_IRQHandler ;Reserved interrupt - DCD QDC0_COMPARE_IRQHandler ;Compare - DCD QDC0_HOME_IRQHandler ;Home - DCD QDC0_WATCHDOG_IRQHandler ;Watchdog / Simultaneous A and B Change - DCD QDC0_INDEX_IRQHandler ;Index / Roll Over / Roll Under - DCD FREQME0_IRQHandler ;Frequency Measurement interrupt - DCD LPTMR0_IRQHandler ;Low Power Timer 0 interrupt - DCD Reserved72_IRQHandler ;Reserved interrupt - DCD OS_EVENT_IRQHandler ;OS event timer interrupt - DCD WAKETIMER0_IRQHandler ;Wake Timer Interrupt - DCD UTICK0_IRQHandler ;Micro-Tick Timer interrupt - DCD WWDT0_IRQHandler ;Windowed Watchdog Timer 0 interrupt - DCD Reserved77_IRQHandler ;Reserved interrupt - DCD ADC0_IRQHandler ;Analog-to-Digital Converter interrupt - DCD Reserved79_IRQHandler ;Reserved interrupt - DCD CMP0_IRQHandler ;Comparator interrupt - DCD CMP1_IRQHandler ;Comparator interrupt - DCD Reserved82_IRQHandler ;Reserved interrupt - DCD Reserved83_IRQHandler ;Reserved interrupt - DCD Reserved84_IRQHandler ;Reserved interrupt - DCD Reserved85_IRQHandler ;Reserved interrupt - DCD Reserved86_IRQHandler ;Reserved interrupt - DCD GPIO0_IRQHandler ;General Purpose Input/Output interrupt 0 - DCD GPIO1_IRQHandler ;General Purpose Input/Output interrupt 1 - DCD GPIO2_IRQHandler ;General Purpose Input/Output interrupt 2 - DCD GPIO3_IRQHandler ;General Purpose Input/Output interrupt 3 - DCD Reserved91_IRQHandler ;Reserved interrupt - DCD Reserved92_IRQHandler ;Reserved interrupt - DCD Reserved93_IRQHandler ;Reserved interrupt - DCD Reserved94_IRQHandler ;Reserved interrupt - DCD Reserved95_IRQHandler ;Reserved interrupt -__Vectors_End - -__Vectors EQU __vector_table -__Vectors_Size EQU __Vectors_End - __Vectors - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Default interrupt handlers. -;; - THUMB - - PUBWEAK Reset_Handler - SECTION .text:CODE:REORDER:NOROOT(2) -Reset_Handler - CPSID I ; Mask interrupts - LDR R0, =0xE000ED08 - LDR R1, =__vector_table - STR R1, [R0] - LDR R2, [R1] - MSR MSP, R2 - LDR R0, =sfb(CSTACK) - MSR MSPLIM, R0 - CPSIE I ; Unmask interrupts - LDR R0, =SystemInit - BLX R0 - LDR R0, =__iar_program_start - BX R0 - - PUBWEAK NMI_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -NMI_Handler - B . - - PUBWEAK HardFault_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -HardFault_Handler - B . - - PUBWEAK MemManage_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -MemManage_Handler - B . - - PUBWEAK BusFault_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -BusFault_Handler - B . - - PUBWEAK UsageFault_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -UsageFault_Handler - B . - - PUBWEAK SecureFault_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -SecureFault_Handler - B . - - PUBWEAK SVC_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -SVC_Handler - B . - - PUBWEAK DebugMon_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -DebugMon_Handler - B . - - PUBWEAK PendSV_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -PendSV_Handler - B . - - PUBWEAK SysTick_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -SysTick_Handler - B . - - PUBWEAK Reserved16_IRQHandler - PUBWEAK Reserved16_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved16_IRQHandler - LDR R0, =Reserved16_DriverIRQHandler - BX R0 - - PUBWEAK CMC_IRQHandler - PUBWEAK CMC_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CMC_IRQHandler - LDR R0, =CMC_DriverIRQHandler - BX R0 - - PUBWEAK DMA_CH0_IRQHandler - PUBWEAK DMA_CH0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -DMA_CH0_IRQHandler - LDR R0, =DMA_CH0_DriverIRQHandler - BX R0 - - PUBWEAK DMA_CH1_IRQHandler - PUBWEAK DMA_CH1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -DMA_CH1_IRQHandler - LDR R0, =DMA_CH1_DriverIRQHandler - BX R0 - - PUBWEAK DMA_CH2_IRQHandler - PUBWEAK DMA_CH2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -DMA_CH2_IRQHandler - LDR R0, =DMA_CH2_DriverIRQHandler - BX R0 - - PUBWEAK DMA_CH3_IRQHandler - PUBWEAK DMA_CH3_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -DMA_CH3_IRQHandler - LDR R0, =DMA_CH3_DriverIRQHandler - BX R0 - - PUBWEAK Reserved22_IRQHandler - PUBWEAK Reserved22_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved22_IRQHandler - LDR R0, =Reserved22_DriverIRQHandler - BX R0 - - PUBWEAK Reserved23_IRQHandler - PUBWEAK Reserved23_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved23_IRQHandler - LDR R0, =Reserved23_DriverIRQHandler - BX R0 - - PUBWEAK Reserved24_IRQHandler - PUBWEAK Reserved24_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved24_IRQHandler - LDR R0, =Reserved24_DriverIRQHandler - BX R0 - - PUBWEAK Reserved25_IRQHandler - PUBWEAK Reserved25_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved25_IRQHandler - LDR R0, =Reserved25_DriverIRQHandler - BX R0 - - PUBWEAK ERM0_SINGLE_BIT_IRQHandler - PUBWEAK ERM0_SINGLE_BIT_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ERM0_SINGLE_BIT_IRQHandler - LDR R0, =ERM0_SINGLE_BIT_DriverIRQHandler - BX R0 - - PUBWEAK ERM0_MULTI_BIT_IRQHandler - PUBWEAK ERM0_MULTI_BIT_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ERM0_MULTI_BIT_IRQHandler - LDR R0, =ERM0_MULTI_BIT_DriverIRQHandler - BX R0 - - PUBWEAK FMU0_IRQHandler - PUBWEAK FMU0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FMU0_IRQHandler - LDR R0, =FMU0_DriverIRQHandler - BX R0 - - PUBWEAK GLIKEY0_IRQHandler - PUBWEAK GLIKEY0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GLIKEY0_IRQHandler - LDR R0, =GLIKEY0_DriverIRQHandler - BX R0 - - PUBWEAK MBC0_IRQHandler - PUBWEAK MBC0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -MBC0_IRQHandler - LDR R0, =MBC0_DriverIRQHandler - BX R0 - - PUBWEAK SCG0_IRQHandler - PUBWEAK SCG0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SCG0_IRQHandler - LDR R0, =SCG0_DriverIRQHandler - BX R0 - - PUBWEAK SPC0_IRQHandler - PUBWEAK SPC0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SPC0_IRQHandler - LDR R0, =SPC0_DriverIRQHandler - BX R0 - - PUBWEAK Reserved33_IRQHandler - PUBWEAK Reserved33_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved33_IRQHandler - LDR R0, =Reserved33_DriverIRQHandler - BX R0 - - PUBWEAK WUU0_IRQHandler - PUBWEAK WUU0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -WUU0_IRQHandler - LDR R0, =WUU0_DriverIRQHandler - BX R0 - - PUBWEAK Reserved35_IRQHandler - PUBWEAK Reserved35_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved35_IRQHandler - LDR R0, =Reserved35_DriverIRQHandler - BX R0 - - PUBWEAK Reserved36_IRQHandler - PUBWEAK Reserved36_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved36_IRQHandler - LDR R0, =Reserved36_DriverIRQHandler - BX R0 - - PUBWEAK Reserved37_IRQHandler - PUBWEAK Reserved37_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved37_IRQHandler - LDR R0, =Reserved37_DriverIRQHandler - BX R0 - - PUBWEAK Reserved38_IRQHandler - PUBWEAK Reserved38_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved38_IRQHandler - LDR R0, =Reserved38_DriverIRQHandler - BX R0 - - PUBWEAK Reserved39_IRQHandler - PUBWEAK Reserved39_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved39_IRQHandler - LDR R0, =Reserved39_DriverIRQHandler - BX R0 - - PUBWEAK I3C0_IRQHandler - PUBWEAK I3C0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -I3C0_IRQHandler - LDR R0, =I3C0_DriverIRQHandler - BX R0 - - PUBWEAK Reserved41_IRQHandler - PUBWEAK Reserved41_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved41_IRQHandler - LDR R0, =Reserved41_DriverIRQHandler - BX R0 - - PUBWEAK LPI2C0_IRQHandler - PUBWEAK LPI2C0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LPI2C0_IRQHandler - LDR R0, =LPI2C0_DriverIRQHandler - BX R0 - - PUBWEAK Reserved43_IRQHandler - PUBWEAK Reserved43_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved43_IRQHandler - LDR R0, =Reserved43_DriverIRQHandler - BX R0 - - PUBWEAK LPSPI0_IRQHandler - PUBWEAK LPSPI0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LPSPI0_IRQHandler - LDR R0, =LPSPI0_DriverIRQHandler - BX R0 - - PUBWEAK LPSPI1_IRQHandler - PUBWEAK LPSPI1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LPSPI1_IRQHandler - LDR R0, =LPSPI1_DriverIRQHandler - BX R0 - - PUBWEAK Reserved46_IRQHandler - PUBWEAK Reserved46_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved46_IRQHandler - LDR R0, =Reserved46_DriverIRQHandler - BX R0 - - PUBWEAK LPUART0_IRQHandler - PUBWEAK LPUART0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LPUART0_IRQHandler - LDR R0, =LPUART0_DriverIRQHandler - BX R0 - - PUBWEAK LPUART1_IRQHandler - PUBWEAK LPUART1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LPUART1_IRQHandler - LDR R0, =LPUART1_DriverIRQHandler - BX R0 - - PUBWEAK LPUART2_IRQHandler - PUBWEAK LPUART2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LPUART2_IRQHandler - LDR R0, =LPUART2_DriverIRQHandler - BX R0 - - PUBWEAK Reserved50_IRQHandler - PUBWEAK Reserved50_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved50_IRQHandler - LDR R0, =Reserved50_DriverIRQHandler - BX R0 - - PUBWEAK Reserved51_IRQHandler - PUBWEAK Reserved51_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved51_IRQHandler - LDR R0, =Reserved51_DriverIRQHandler - BX R0 - - PUBWEAK USB0_IRQHandler - PUBWEAK USB0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -USB0_IRQHandler - LDR R0, =USB0_DriverIRQHandler - BX R0 - - PUBWEAK Reserved53_IRQHandler - PUBWEAK Reserved53_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved53_IRQHandler - LDR R0, =Reserved53_DriverIRQHandler - BX R0 - - PUBWEAK CDOG0_IRQHandler - PUBWEAK CDOG0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CDOG0_IRQHandler - LDR R0, =CDOG0_DriverIRQHandler - BX R0 - - PUBWEAK CTIMER0_IRQHandler - PUBWEAK CTIMER0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CTIMER0_IRQHandler - LDR R0, =CTIMER0_DriverIRQHandler - BX R0 - - PUBWEAK CTIMER1_IRQHandler - PUBWEAK CTIMER1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CTIMER1_IRQHandler - LDR R0, =CTIMER1_DriverIRQHandler - BX R0 - - PUBWEAK CTIMER2_IRQHandler - PUBWEAK CTIMER2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CTIMER2_IRQHandler - LDR R0, =CTIMER2_DriverIRQHandler - BX R0 - - PUBWEAK Reserved58_IRQHandler - PUBWEAK Reserved58_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved58_IRQHandler - LDR R0, =Reserved58_DriverIRQHandler - BX R0 - - PUBWEAK Reserved59_IRQHandler - PUBWEAK Reserved59_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved59_IRQHandler - LDR R0, =Reserved59_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM0_RELOAD_ERROR_IRQHandler - PUBWEAK FLEXPWM0_RELOAD_ERROR_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM0_RELOAD_ERROR_IRQHandler - LDR R0, =FLEXPWM0_RELOAD_ERROR_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM0_FAULT_IRQHandler - PUBWEAK FLEXPWM0_FAULT_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM0_FAULT_IRQHandler - LDR R0, =FLEXPWM0_FAULT_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM0_SUBMODULE0_IRQHandler - PUBWEAK FLEXPWM0_SUBMODULE0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM0_SUBMODULE0_IRQHandler - LDR R0, =FLEXPWM0_SUBMODULE0_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM0_SUBMODULE1_IRQHandler - PUBWEAK FLEXPWM0_SUBMODULE1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM0_SUBMODULE1_IRQHandler - LDR R0, =FLEXPWM0_SUBMODULE1_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM0_SUBMODULE2_IRQHandler - PUBWEAK FLEXPWM0_SUBMODULE2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM0_SUBMODULE2_IRQHandler - LDR R0, =FLEXPWM0_SUBMODULE2_DriverIRQHandler - BX R0 - - PUBWEAK Reserved65_IRQHandler - PUBWEAK Reserved65_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved65_IRQHandler - LDR R0, =Reserved65_DriverIRQHandler - BX R0 - - PUBWEAK QDC0_COMPARE_IRQHandler - PUBWEAK QDC0_COMPARE_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC0_COMPARE_IRQHandler - LDR R0, =QDC0_COMPARE_DriverIRQHandler - BX R0 - - PUBWEAK QDC0_HOME_IRQHandler - PUBWEAK QDC0_HOME_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC0_HOME_IRQHandler - LDR R0, =QDC0_HOME_DriverIRQHandler - BX R0 - - PUBWEAK QDC0_WATCHDOG_IRQHandler - PUBWEAK QDC0_WATCHDOG_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC0_WATCHDOG_IRQHandler - LDR R0, =QDC0_WATCHDOG_DriverIRQHandler - BX R0 - - PUBWEAK QDC0_INDEX_IRQHandler - PUBWEAK QDC0_INDEX_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC0_INDEX_IRQHandler - LDR R0, =QDC0_INDEX_DriverIRQHandler - BX R0 - - PUBWEAK FREQME0_IRQHandler - PUBWEAK FREQME0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FREQME0_IRQHandler - LDR R0, =FREQME0_DriverIRQHandler - BX R0 - - PUBWEAK LPTMR0_IRQHandler - PUBWEAK LPTMR0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LPTMR0_IRQHandler - LDR R0, =LPTMR0_DriverIRQHandler - BX R0 - - PUBWEAK Reserved72_IRQHandler - PUBWEAK Reserved72_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved72_IRQHandler - LDR R0, =Reserved72_DriverIRQHandler - BX R0 - - PUBWEAK OS_EVENT_IRQHandler - PUBWEAK OS_EVENT_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -OS_EVENT_IRQHandler - LDR R0, =OS_EVENT_DriverIRQHandler - BX R0 - - PUBWEAK WAKETIMER0_IRQHandler - PUBWEAK WAKETIMER0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -WAKETIMER0_IRQHandler - LDR R0, =WAKETIMER0_DriverIRQHandler - BX R0 - - PUBWEAK UTICK0_IRQHandler - PUBWEAK UTICK0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -UTICK0_IRQHandler - LDR R0, =UTICK0_DriverIRQHandler - BX R0 - - PUBWEAK WWDT0_IRQHandler - PUBWEAK WWDT0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -WWDT0_IRQHandler - LDR R0, =WWDT0_DriverIRQHandler - BX R0 - - PUBWEAK Reserved77_IRQHandler - PUBWEAK Reserved77_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved77_IRQHandler - LDR R0, =Reserved77_DriverIRQHandler - BX R0 - - PUBWEAK ADC0_IRQHandler - PUBWEAK ADC0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ADC0_IRQHandler - LDR R0, =ADC0_DriverIRQHandler - BX R0 - - PUBWEAK Reserved79_IRQHandler - PUBWEAK Reserved79_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved79_IRQHandler - LDR R0, =Reserved79_DriverIRQHandler - BX R0 - - PUBWEAK CMP0_IRQHandler - PUBWEAK CMP0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CMP0_IRQHandler - LDR R0, =CMP0_DriverIRQHandler - BX R0 - - PUBWEAK CMP1_IRQHandler - PUBWEAK CMP1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CMP1_IRQHandler - LDR R0, =CMP1_DriverIRQHandler - BX R0 - - PUBWEAK Reserved82_IRQHandler - PUBWEAK Reserved82_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved82_IRQHandler - LDR R0, =Reserved82_DriverIRQHandler - BX R0 - - PUBWEAK Reserved83_IRQHandler - PUBWEAK Reserved83_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved83_IRQHandler - LDR R0, =Reserved83_DriverIRQHandler - BX R0 - - PUBWEAK Reserved84_IRQHandler - PUBWEAK Reserved84_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved84_IRQHandler - LDR R0, =Reserved84_DriverIRQHandler - BX R0 - - PUBWEAK Reserved85_IRQHandler - PUBWEAK Reserved85_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved85_IRQHandler - LDR R0, =Reserved85_DriverIRQHandler - BX R0 - - PUBWEAK Reserved86_IRQHandler - PUBWEAK Reserved86_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved86_IRQHandler - LDR R0, =Reserved86_DriverIRQHandler - BX R0 - - PUBWEAK GPIO0_IRQHandler - PUBWEAK GPIO0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO0_IRQHandler - LDR R0, =GPIO0_DriverIRQHandler - BX R0 - - PUBWEAK GPIO1_IRQHandler - PUBWEAK GPIO1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO1_IRQHandler - LDR R0, =GPIO1_DriverIRQHandler - BX R0 - - PUBWEAK GPIO2_IRQHandler - PUBWEAK GPIO2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO2_IRQHandler - LDR R0, =GPIO2_DriverIRQHandler - BX R0 - - PUBWEAK GPIO3_IRQHandler - PUBWEAK GPIO3_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO3_IRQHandler - LDR R0, =GPIO3_DriverIRQHandler - BX R0 - - PUBWEAK Reserved91_IRQHandler - PUBWEAK Reserved91_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved91_IRQHandler - LDR R0, =Reserved91_DriverIRQHandler - BX R0 - - PUBWEAK Reserved92_IRQHandler - PUBWEAK Reserved92_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved92_IRQHandler - LDR R0, =Reserved92_DriverIRQHandler - BX R0 - - PUBWEAK Reserved93_IRQHandler - PUBWEAK Reserved93_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved93_IRQHandler - LDR R0, =Reserved93_DriverIRQHandler - BX R0 - - PUBWEAK Reserved94_IRQHandler - PUBWEAK Reserved94_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved94_IRQHandler - LDR R0, =Reserved94_DriverIRQHandler - BX R0 - - PUBWEAK Reserved95_IRQHandler - PUBWEAK Reserved95_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved95_IRQHandler - LDR R0, =Reserved95_DriverIRQHandler - BX R0 - -Reserved16_DriverIRQHandler -CMC_DriverIRQHandler -DMA_CH0_DriverIRQHandler -DMA_CH1_DriverIRQHandler -DMA_CH2_DriverIRQHandler -DMA_CH3_DriverIRQHandler -Reserved22_DriverIRQHandler -Reserved23_DriverIRQHandler -Reserved24_DriverIRQHandler -Reserved25_DriverIRQHandler -ERM0_SINGLE_BIT_DriverIRQHandler -ERM0_MULTI_BIT_DriverIRQHandler -FMU0_DriverIRQHandler -GLIKEY0_DriverIRQHandler -MBC0_DriverIRQHandler -SCG0_DriverIRQHandler -SPC0_DriverIRQHandler -Reserved33_DriverIRQHandler -WUU0_DriverIRQHandler -Reserved35_DriverIRQHandler -Reserved36_DriverIRQHandler -Reserved37_DriverIRQHandler -Reserved38_DriverIRQHandler -Reserved39_DriverIRQHandler -I3C0_DriverIRQHandler -Reserved41_DriverIRQHandler -LPI2C0_DriverIRQHandler -Reserved43_DriverIRQHandler -LPSPI0_DriverIRQHandler -LPSPI1_DriverIRQHandler -Reserved46_DriverIRQHandler -LPUART0_DriverIRQHandler -LPUART1_DriverIRQHandler -LPUART2_DriverIRQHandler -Reserved50_DriverIRQHandler -Reserved51_DriverIRQHandler -USB0_DriverIRQHandler -Reserved53_DriverIRQHandler -CDOG0_DriverIRQHandler -CTIMER0_DriverIRQHandler -CTIMER1_DriverIRQHandler -CTIMER2_DriverIRQHandler -Reserved58_DriverIRQHandler -Reserved59_DriverIRQHandler -FLEXPWM0_RELOAD_ERROR_DriverIRQHandler -FLEXPWM0_FAULT_DriverIRQHandler -FLEXPWM0_SUBMODULE0_DriverIRQHandler -FLEXPWM0_SUBMODULE1_DriverIRQHandler -FLEXPWM0_SUBMODULE2_DriverIRQHandler -Reserved65_DriverIRQHandler -QDC0_COMPARE_DriverIRQHandler -QDC0_HOME_DriverIRQHandler -QDC0_WATCHDOG_DriverIRQHandler -QDC0_INDEX_DriverIRQHandler -FREQME0_DriverIRQHandler -LPTMR0_DriverIRQHandler -Reserved72_DriverIRQHandler -OS_EVENT_DriverIRQHandler -WAKETIMER0_DriverIRQHandler -UTICK0_DriverIRQHandler -WWDT0_DriverIRQHandler -Reserved77_DriverIRQHandler -ADC0_DriverIRQHandler -Reserved79_DriverIRQHandler -CMP0_DriverIRQHandler -CMP1_DriverIRQHandler -Reserved82_DriverIRQHandler -Reserved83_DriverIRQHandler -Reserved84_DriverIRQHandler -Reserved85_DriverIRQHandler -Reserved86_DriverIRQHandler -GPIO0_DriverIRQHandler -GPIO1_DriverIRQHandler -GPIO2_DriverIRQHandler -GPIO3_DriverIRQHandler -Reserved91_DriverIRQHandler -Reserved92_DriverIRQHandler -Reserved93_DriverIRQHandler -Reserved94_DriverIRQHandler -Reserved95_DriverIRQHandler -DefaultISR - B . - - END diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/system_MCXA153.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/system_MCXA153.c deleted file mode 100644 index faa6d5e212b..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/system_MCXA153.c +++ /dev/null @@ -1,128 +0,0 @@ -/* -** ################################################################### -** Processors: MCXA153VFM -** MCXA153VFT -** MCXA153VLF -** MCXA153VLH -** -** Compilers: GNU C Compiler -** IAR ANSI C/C++ Compiler for ARM -** Keil ARM C/C++ Compiler -** MCUXpresso Compiler -** -** Reference manual: MCXA1 User manual -** Version: rev. 1.0, 2022-03-29 -** Build: b240403 -** -** 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-2024 NXP -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** Revisions: -** - rev. 1.0 (2022-03-29) -** Initial version based on v0.1UM -** -** ################################################################### -*/ - -/*! - * @file MCXA153 - * @version 1.0 - * @date 2022-03-29 - * @brief Device specific configuration file for MCXA153 (implementation file) - * - * 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. - */ - -#include -#include "fsl_device_registers.h" - - - - - -/* ---------------------------------------------------------------------------- - -- Core clock - ---------------------------------------------------------------------------- */ - -uint32_t SystemCoreClock = DEFAULT_SYSTEM_CLOCK; - -/* ---------------------------------------------------------------------------- - -- SystemInit() - ---------------------------------------------------------------------------- */ - -__attribute__ ((weak)) void SystemInit (void) { - - SCB->CPACR |= ((3UL << 0*2) | (3UL << 1*2)); /* set CP0, CP1 Full Access in Secure mode (enable PowerQuad) */ -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) - SCB_NS->CPACR |= ((3UL << 0*2) | (3UL << 1*2)); /* set CP0, CP1 Full Access in Normal mode (enable PowerQuad) */ -#endif /* (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ - - SCB->NSACR |= ((3UL << 0) | (3UL << 10)); /* enable CP0, CP1, CP10, CP11 Non-secure Access */ - -#if defined(__MCUXPRESSO) - extern void(*const g_pfnVectors[]) (void); - SCB->VTOR = (uint32_t) &g_pfnVectors; -#else - extern void *__Vectors; - SCB->VTOR = (uint32_t) &__Vectors; -#endif - /* Enable the LPCAC */ - SYSCON->LPCAC_CTRL |= SYSCON_LPCAC_CTRL_LPCAC_MEM_REQ_MASK; - SYSCON->LPCAC_CTRL &= ~SYSCON_LPCAC_CTRL_DIS_LPCAC_MASK; - - /* Enable flash RWX when FLASH_ACL in IFR0 is invalid */ - if ((*((volatile const uint32_t *)(0x1000000)) == 0xFFFFFFFFU) || - ((*((volatile const uint32_t *)(0x1000000)) == 0x59630000U) && - (*((volatile const uint32_t *)(0x1000040)) == 0xFFFFFFFFU) && - (*((volatile const uint32_t *)(0x1000044)) == 0xFFFFFFFFU))) - { - /* Enable MBC register written with GLIKEY index15 */ - GLIKEY0->CTRL_0 = 0x00060000U; - GLIKEY0->CTRL_0 = 0x0002000FU; - GLIKEY0->CTRL_0 = 0x0001000FU; - GLIKEY0->CTRL_1 = 0x00290000U; - GLIKEY0->CTRL_0 = 0x0002000FU; - GLIKEY0->CTRL_1 = 0x00280000U; - GLIKEY0->CTRL_0 = 0x0000000FU; - - /* Enable RWX for GLBAC0 */ - MBC0->MBC_INDEX[0].MBC_MEMN_GLBAC[0] = 0x7700U; - - /* Use GLBAC0 for all flash block */ - for (uint8_t i = 0; i < 2U; i++) - { - MBC0->MBC_INDEX[0].MBC_DOM0_MEM0_BLK_CFG_W[i] = 0x00000000U; - } - - /* Disable MBC register written */ - GLIKEY0->CTRL_0 = 0x0002000FU; - } - SystemInitHook(); -} - -/* ---------------------------------------------------------------------------- - -- SystemCoreClockUpdate() - ---------------------------------------------------------------------------- */ - -void SystemCoreClockUpdate (void) { - -} - -/* ---------------------------------------------------------------------------- - -- SystemInitHook() - ---------------------------------------------------------------------------- */ - -__attribute__ ((weak)) void SystemInitHook (void) { - /* Void implementation of the weak function. */ -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/system_MCXA153.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/system_MCXA153.h deleted file mode 100644 index ab2050d1439..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/MCXA153/system_MCXA153.h +++ /dev/null @@ -1,109 +0,0 @@ -/* -** ################################################################### -** Processors: MCXA153VFM -** MCXA153VFT -** MCXA153VLF -** MCXA153VLH -** -** Compilers: GNU C Compiler -** IAR ANSI C/C++ Compiler for ARM -** Keil ARM C/C++ Compiler -** MCUXpresso Compiler -** -** Reference manual: MCXA1 User manual -** Version: rev. 1.0, 2022-03-29 -** Build: b240403 -** -** 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-2024 NXP -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** Revisions: -** - rev. 1.0 (2022-03-29) -** Initial version based on v0.1UM -** -** ################################################################### -*/ - -/*! - * @file MCXA153 - * @version 1.0 - * @date 2022-03-29 - * @brief Device specific configuration file for MCXA153 (header file) - * - * 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. - */ - -#ifndef _SYSTEM_MCXA153_H_ -#define _SYSTEM_MCXA153_H_ /**< Symbol preventing repeated inclusion */ - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#define DEFAULT_SYSTEM_CLOCK 12000000u /* Default System clock value */ -#define CLK_RTC_32K_CLK 32768u /* RTC oscillator 32 kHz output (32k_clk */ -#define CLK_FRO_12MHZ 12000000u /* FRO 12 MHz (fro_12m) */ -#define CLK_FRO_32MHZ 32000000u /* FRO 32 MHz (fro_32m) */ -#define CLK_FRO_48MHZ 48000000u /* FRO 48 MHz (fro_48m) */ -#define CLK_CLK_IN 16000000u /* Default CLK_IN pin clock */ - - -/** - * @brief System clock frequency (core clock) - * - * The system clock frequency supplied to the SysTick timer and the processor - * core clock. This variable can be used by the user application to setup the - * SysTick timer or configure other parameters. It may also be used by debugger to - * query the frequency of the debug timer or configure the trace clock speed - * SystemCoreClock is initialized with a correct predefined value. - */ -extern uint32_t SystemCoreClock; - -/** - * @brief Setup the microcontroller system. - * - * Typically this function configures the oscillator (PLL) that is part of the - * microcontroller device. For systems with variable clock speed it also updates - * the variable SystemCoreClock. SystemInit is called from startup_device file. - */ -void SystemInit (void); - -/** - * @brief Updates the SystemCoreClock variable. - * - * It must be called whenever the core clock is changed during program - * execution. SystemCoreClockUpdate() evaluates the clock register settings and calculates - * the current core clock. - */ -void SystemCoreClockUpdate (void); - -/** - * @brief SystemInit function hook. - * - * This weak function allows to call specific initialization code during the - * SystemInit() execution.This can be used when an application specific code needs - * to be called as close to the reset entry as possible (for example the Multicore - * Manager MCMGR_EarlyInit() function call). - * NOTE: No global r/w variables can be used in this hook function because the - * initialization of these variables happens after this function. - */ -void SystemInitHook (void); - -#ifdef __cplusplus -} -#endif - -#endif /* _SYSTEM_MCXA153_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/SConscript b/bsp/nxp/mcx/mcxa/Libraries/MCXA153/SConscript deleted file mode 100644 index 4edf9861888..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA153/SConscript +++ /dev/null @@ -1,58 +0,0 @@ -Import('rtconfig') -from building import * - -cwd = GetCurrentDir() -path = [cwd + '/../CMSIS/Core/Include',cwd + '/components/codec', cwd + '/MCXA153', cwd + '/MCXA153/drivers', cwd + '/middleware/sdmmc/inc', cwd + '/middleware/sdmmc/port'] -src = Split(''' - MCXA153/system_MCXA153.c - ''') - -if rtconfig.PLATFORM in ['gcc']: - src += ['MCXA153/gcc/startup_MCXA153.S'] -elif rtconfig.PLATFORM in ['armcc', 'armclang']: - src += ['MCXA153/arm/startup_MCXA153.s'] -elif rtconfig.PLATFORM in ['iccarm']: - src += ['MCXA153/iar/startup_MCXA153.s'] - -src += ['MCXA153/drivers/fsl_aoi.c'] -src += ['MCXA153/drivers/fsl_clock.c'] -src += ['MCXA153/drivers/fsl_cmc.c'] -src += ['MCXA153/drivers/fsl_common.c'] -src += ['MCXA153/drivers/fsl_common_arm.c'] -src += ['MCXA153/drivers/fsl_crc.c'] -src += ['MCXA153/drivers/fsl_ctimer.c'] -src += ['MCXA153/drivers/fsl_edma.c'] -src += ['MCXA153/drivers/fsl_edma_soc.c'] -src += ['MCXA153/drivers/fsl_eim.c'] -src += ['MCXA153/drivers/fsl_eqdc.c'] -src += ['MCXA153/drivers/fsl_erm.c'] -src += ['MCXA153/drivers/fsl_freqme.c'] -src += ['MCXA153/drivers/fsl_glikey.c'] -src += ['MCXA153/drivers/fsl_gpio.c'] -src += ['MCXA153/drivers/fsl_i3c.c'] -src += ['MCXA153/drivers/fsl_i3c_edma.c'] -src += ['MCXA153/drivers/fsl_inputmux.c'] -src += ['MCXA153/drivers/fsl_lpadc.c'] -src += ['MCXA153/drivers/fsl_lpcmp.c'] -src += ['MCXA153/drivers/fsl_lpi2c.c'] -src += ['MCXA153/drivers/fsl_lpi2c_edma.c'] -src += ['MCXA153/drivers/fsl_lptmr.c'] -src += ['MCXA153/drivers/fsl_lpuart.c'] -src += ['MCXA153/drivers/fsl_lpuart_edma.c'] -src += ['MCXA153/drivers/fsl_ostimer.c'] -src += ['MCXA153/drivers/fsl_pwm.c'] -src += ['MCXA153/drivers/fsl_reset.c'] -src += ['MCXA153/drivers/fsl_spc.c'] -src += ['MCXA153/drivers/fsl_utick.c'] -src += ['MCXA153/drivers/fsl_vbat.c'] -src += ['MCXA153/drivers/fsl_waketimer.c'] -src += ['MCXA153/drivers/fsl_wuu.c'] -src += ['MCXA153/drivers/fsl_wwdt.c'] - -if GetDepend('BSP_USING_SPI'): - src += ['MCXA153/drivers/fsl_lpspi.c'] - src += ['MCXA153/drivers/fsl_lpspi_edma.c'] - -group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path) - -Return('group') diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/MCXA156.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/MCXA156.h deleted file mode 100644 index 000600c5453..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/MCXA156.h +++ /dev/null @@ -1,38660 +0,0 @@ -/* -** ################################################################### -** Processors: MCXA156VLL -** MCXA156VMP -** MCXA156VPJ -** -** Compilers: GNU C Compiler -** IAR ANSI C/C++ Compiler for ARM -** Keil ARM C/C++ Compiler -** MCUXpresso Compiler -** -** Reference manual: MCXA18 User manual -** Version: rev. 1.0, 2022-03-29 -** Build: b240403 -** -** Abstract: -** CMSIS Peripheral Access Layer for MCXA156 -** -** Copyright 1997-2016 Freescale Semiconductor, Inc. -** Copyright 2016-2024 NXP -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** Revisions: -** - rev. 1.0 (2022-03-29) -** Initial version based on v0.1UM -** -** ################################################################### -*/ - -/*! - * @file MCXA156.h - * @version 1.0 - * @date 2022-03-29 - * @brief CMSIS Peripheral Access Layer for MCXA156 - * - * CMSIS Peripheral Access Layer for MCXA156 - */ - -#if !defined(MCXA156_H_) -#define MCXA156_H_ /**< Symbol preventing repeated inclusion */ - -/** Memory map major version (memory maps with equal major version number are - * compatible) */ -#define MCU_MEM_MAP_VERSION 0x0100U -/** Memory map minor version */ -#define MCU_MEM_MAP_VERSION_MINOR 0x0000U - - -/* ---------------------------------------------------------------------------- - -- Interrupt vector numbers - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup Interrupt_vector_numbers Interrupt vector numbers - * @{ - */ - -/** Interrupt Number Definitions */ -#define NUMBER_OF_INT_VECTORS 105 /**< Number of interrupts in the Vector table */ - -typedef enum IRQn { - /* Auxiliary constants */ - NotAvail_IRQn = -128, /**< Not available device specific interrupt */ - - /* Core interrupts */ - NonMaskableInt_IRQn = -14, /**< Non Maskable Interrupt */ - HardFault_IRQn = -13, /**< Cortex-M33 SV Hard Fault Interrupt */ - MemoryManagement_IRQn = -12, /**< Cortex-M33 Memory Management Interrupt */ - BusFault_IRQn = -11, /**< Cortex-M33 Bus Fault Interrupt */ - UsageFault_IRQn = -10, /**< Cortex-M33 Usage Fault Interrupt */ - SecureFault_IRQn = -9, /**< Cortex-M33 Secure Fault Interrupt */ - SVCall_IRQn = -5, /**< Cortex-M33 SV Call Interrupt */ - DebugMonitor_IRQn = -4, /**< Cortex-M33 Debug Monitor Interrupt */ - PendSV_IRQn = -2, /**< Cortex-M33 Pend SV Interrupt */ - SysTick_IRQn = -1, /**< Cortex-M33 System Tick Interrupt */ - - /* Device specific interrupts */ - Reserved16_IRQn = 0, /**< OR IRQ1 to IRQ53 */ - CMC_IRQn = 1, /**< Core Mode Controller interrupt */ - DMA_CH0_IRQn = 2, /**< DMA3_0_CH0 error or transfer complete */ - DMA_CH1_IRQn = 3, /**< DMA3_0_CH1 error or transfer complete */ - DMA_CH2_IRQn = 4, /**< DMA3_0_CH2 error or transfer complete */ - DMA_CH3_IRQn = 5, /**< DMA3_0_CH3 error or transfer complete */ - DMA_CH4_IRQn = 6, /**< DMA3_0_CH4 error or transfer complete */ - DMA_CH5_IRQn = 7, /**< DMA3_0_CH5 error or transfer complete */ - DMA_CH6_IRQn = 8, /**< DMA3_0_CH6 error or transfer complete */ - DMA_CH7_IRQn = 9, /**< DMA3_0_CH7 error or transfer complete */ - ERM0_SINGLE_BIT_IRQn = 10, /**< ERM Single Bit error interrupt */ - ERM0_MULTI_BIT_IRQn = 11, /**< ERM Multi Bit error interrupt */ - FMU0_IRQn = 12, /**< Flash Management Unit interrupt */ - GLIKEY0_IRQn = 13, /**< GLIKEY Interrupt */ - MBC0_IRQn = 14, /**< MBC secure violation interrupt */ - SCG0_IRQn = 15, /**< System Clock Generator interrupt */ - SPC0_IRQn = 16, /**< System Power Controller interrupt */ - VBAT0_IRQn = 17, /**< VBAT interrupt */ - WUU0_IRQn = 18, /**< Wake Up Unit interrupt */ - CAN0_IRQn = 19, /**< Controller Area Network 0 interrupt */ - Reserved36_IRQn = 20, /**< Reserved interrupt */ - Reserved37_IRQn = 21, /**< Reserved interrupt */ - Reserved38_IRQn = 22, /**< Reserved interrupt */ - FLEXIO_IRQn = 23, /**< Flexible Input/Output interrupt */ - I3C0_IRQn = 24, /**< Improved Inter Integrated Circuit interrupt 0 */ - Reserved41_IRQn = 25, /**< Reserved interrupt */ - LPI2C0_IRQn = 26, /**< Low-Power Inter Integrated Circuit interrupt */ - LPI2C1_IRQn = 27, /**< Low-Power Inter Integrated Circuit interrupt */ - LPSPI0_IRQn = 28, /**< Low-Power Serial Peripheral Interface interrupt */ - LPSPI1_IRQn = 29, /**< Low-Power Serial Peripheral Interface interrupt */ - Reserved46_IRQn = 30, /**< Reserved interrupt */ - LPUART0_IRQn = 31, /**< Low-Power Universal Asynchronous Receive/Transmit interrupt */ - LPUART1_IRQn = 32, /**< Low-Power Universal Asynchronous Receive/Transmit interrupt */ - LPUART2_IRQn = 33, /**< Low-Power Universal Asynchronous Receive/Transmit interrupt */ - LPUART3_IRQn = 34, /**< Low-Power Universal Asynchronous Receive/Transmit interrupt */ - LPUART4_IRQn = 35, /**< Low-Power Universal Asynchronous Receive/Transmit interrupt */ - USB0_IRQn = 36, /**< Universal Serial Bus - Full Speed interrupt */ - Reserved53_IRQn = 37, /**< Reserved interrupt */ - CDOG0_IRQn = 38, /**< Code Watchdog Timer 0 interrupt */ - CTIMER0_IRQn = 39, /**< Standard counter/timer 0 interrupt */ - CTIMER1_IRQn = 40, /**< Standard counter/timer 1 interrupt */ - CTIMER2_IRQn = 41, /**< Standard counter/timer 2 interrupt */ - CTIMER3_IRQn = 42, /**< Standard counter/timer 3 interrupt */ - CTIMER4_IRQn = 43, /**< Standard counter/timer 4 interrupt */ - FLEXPWM0_RELOAD_ERROR_IRQn = 44, /**< FlexPWM0_reload_error interrupt */ - FLEXPWM0_FAULT_IRQn = 45, /**< FlexPWM0_fault interrupt */ - FLEXPWM0_SUBMODULE0_IRQn = 46, /**< FlexPWM0 Submodule 0 capture/compare/reload interrupt */ - FLEXPWM0_SUBMODULE1_IRQn = 47, /**< FlexPWM0 Submodule 1 capture/compare/reload interrupt */ - FLEXPWM0_SUBMODULE2_IRQn = 48, /**< FlexPWM0 Submodule 2 capture/compare/reload interrupt */ - Reserved65_IRQn = 49, /**< Reserved interrupt */ - QDC0_COMPARE_IRQn = 50, /**< Compare */ - QDC0_HOME_IRQn = 51, /**< Home */ - QDC0_WATCHDOG_IRQn = 52, /**< Watchdog / Simultaneous A and B Change */ - QDC0_INDEX_IRQn = 53, /**< Index / Roll Over / Roll Under */ - FREQME0_IRQn = 54, /**< Frequency Measurement interrupt */ - LPTMR0_IRQn = 55, /**< Low Power Timer 0 interrupt */ - Reserved72_IRQn = 56, /**< Reserved interrupt */ - OS_EVENT_IRQn = 57, /**< OS event timer interrupt */ - WAKETIMER0_IRQn = 58, /**< Wake Timer Interrupt */ - UTICK0_IRQn = 59, /**< Micro-Tick Timer interrupt */ - WWDT0_IRQn = 60, /**< Windowed Watchdog Timer 0 interrupt */ - Reserved77_IRQn = 61, /**< Reserved interrupt */ - ADC0_IRQn = 62, /**< Analog-to-Digital Converter interrupt */ - ADC1_IRQn = 63, /**< Analog-to-Digital Converter interrupt */ - CMP0_IRQn = 64, /**< Comparator interrupt */ - CMP1_IRQn = 65, /**< Comparator interrupt */ - Reserved82_IRQn = 66, /**< Reserved interrupt */ - DAC0_IRQn = 67, /**< Digital-to-Analog Converter 0 - General Purpose interrupt */ - Reserved84_IRQn = 68, /**< Reserved interrupt */ - Reserved85_IRQn = 69, /**< Reserved interrupt */ - Reserved86_IRQn = 70, /**< Reserved interrupt */ - GPIO0_IRQn = 71, /**< General Purpose Input/Output interrupt 0 */ - GPIO1_IRQn = 72, /**< General Purpose Input/Output interrupt 1 */ - GPIO2_IRQn = 73, /**< General Purpose Input/Output interrupt 2 */ - GPIO3_IRQn = 74, /**< General Purpose Input/Output interrupt 3 */ - GPIO4_IRQn = 75, /**< General Purpose Input/Output interrupt 4 */ - Reserved92_IRQn = 76, /**< Reserved interrupt */ - LPI2C2_IRQn = 77, /**< Low-Power Inter Integrated Circuit interrupt */ - LPI2C3_IRQn = 78, /**< Low-Power Inter Integrated Circuit interrupt */ - FLEXPWM1_RELOAD_ERROR_IRQn = 79, /**< FlexPWM1_reload_error interrupt */ - FLEXPWM1_FAULT_IRQn = 80, /**< FlexPWM1_fault interrupt */ - FLEXPWM1_SUBMODULE0_IRQn = 81, /**< FlexPWM1 Submodule 0 capture/compare/reload interrupt */ - FLEXPWM1_SUBMODULE1_IRQn = 82, /**< FlexPWM1 Submodule 1 capture/compare/reload interrupt */ - FLEXPWM1_SUBMODULE2_IRQn = 83, /**< FlexPWM1 Submodule 2 capture/compare/reload interrupt */ - Reserved100_IRQn = 84, /**< Reserved interrupt */ - QDC1_COMPARE_IRQn = 85, /**< Compare */ - QDC1_HOME_IRQn = 86, /**< Home */ - QDC1_WATCHDOG_IRQn = 87, /**< Watchdog / Simultaneous A and B Change */ - QDC1_INDEX_IRQn = 88 /**< Index / Roll Over / Roll Under */ -} IRQn_Type; - -/*! - * @} - */ /* end of group Interrupt_vector_numbers */ - - -/* ---------------------------------------------------------------------------- - -- Cortex M33 Core Configuration - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup Cortex_Core_Configuration Cortex M33 Core Configuration - * @{ - */ - -#define __MPU_PRESENT 0 /**< Defines if an MPU is present or not */ -#define __NVIC_PRIO_BITS 3 /**< Number of priority bits implemented in the NVIC */ -#define __Vendor_SysTickConfig 0 /**< Vendor specific implementation of SysTickConfig is defined */ -#define __FPU_PRESENT 1 /**< Defines if an FPU is present or not */ -#define __DSP_PRESENT 1 /**< Defines if Armv8-M Mainline core supports DSP instructions */ -#define __SAUREGION_PRESENT 0 /**< Defines if an SAU is present or not */ - -#include "core_cm33.h" /* Core Peripheral Access Layer */ -#include "system_MCXA156.h" /* Device specific configuration file */ - -/*! - * @} - */ /* end of group Cortex_Core_Configuration */ - - -/* ---------------------------------------------------------------------------- - -- Mapping Information - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup Mapping_Information Mapping Information - * @{ - */ - -/** Mapping Information */ -/*! - * @addtogroup dma_request - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @brief Structure for the DMA hardware request - * - * Defines the structure for the DMA hardware request collections. The user can configure the - * hardware request to trigger the DMA transfer accordingly. The index - * of the hardware request varies according to the to SoC. - */ -typedef enum _dma_request_source -{ - kDma0RequestDisabled = 0U, /**< Disabled */ - kDma0RequestWUU0 = 1U, /**< WUU Wake up event */ - kDma0RequestMuxFlexCan0DmaRequest = 2U, /**< CAN0 DMA request */ - kDma0RequestLPI2C2Rx = 3U, /**< LPI2C2 Receive request */ - kDma0RequestLPI2C2Tx = 4U, /**< LPI2C2 Transmit request */ - kDma0RequestLPI2C3Rx = 5U, /**< LPI2C3 Receive request */ - kDma0RequestLPI2C3Tx = 6U, /**< LPI2C3 Transmit request */ - kDma0RequestMuxI3c0Rx = 7U, /**< I3C0 Receive request */ - kDma0RequestMuxI3c0Tx = 8U, /**< I3C0 Transmit request */ - kDma0RequestLPI2C0Rx = 11U, /**< LPI2C0 Receive request */ - kDma0RequestLPI2C0Tx = 12U, /**< LPI2C0 Transmit request */ - kDma0RequestLPI2C1Rx = 13U, /**< LPI2C1 Receive request */ - kDma0RequestLPI2C1Tx = 14U, /**< LPI2C1 Transmit request */ - kDma0RequestLPSPI0Rx = 15U, /**< LPSPI0 Receive request */ - kDma0RequestLPSPI0Tx = 16U, /**< LPSPI0 Transmit request */ - kDma0RequestLPSPI1Rx = 17U, /**< LPSPI1 Receive request */ - kDma0RequestLPSPI1Tx = 18U, /**< LPSPI1 Transmit request */ - kDma0RequestLPUART0Rx = 21U, /**< LPUART0 Receive request */ - kDma0RequestLPUART0Tx = 22U, /**< LPUART0 Transmit request */ - kDma0RequestLPUART1Rx = 23U, /**< LPUART1 Receive request */ - kDma0RequestLPUART1Tx = 24U, /**< LPUART1 Transmit request */ - kDma0RequestLPUART2Rx = 25U, /**< LPUART2 Receive request */ - kDma0RequestLPUART2Tx = 26U, /**< LPUART2 Transmit request */ - kDma0RequestLPUART3Rx = 27U, /**< LPUART3 Receive request */ - kDma0RequestLPUART3Tx = 28U, /**< LPUART3 Transmit request */ - kDma0RequestLPUART4Rx = 29U, /**< LPUART4 Receive request */ - kDma0RequestLPUART4Tx = 30U, /**< LPUART4 Transmit request */ - kDma0RequestMuxCtimer0M0 = 31U, /**< CTIMER0 Match channel 0 request */ - kDma0RequestMuxCtimer0M1 = 32U, /**< CTIMER0 Match channel 1 request */ - kDma0RequestMuxCtimer1M0 = 33U, /**< CTIMER1 Match channel 0 request */ - kDma0RequestMuxCtimer1M1 = 34U, /**< CTIMER1 Match channel 1 request */ - kDma0RequestMuxCtimer2M0 = 35U, /**< CTIMER2 Match channel 0 request */ - kDma0RequestMuxCtimer2M1 = 36U, /**< CTIMER2 Match channel 1 request */ - kDma0RequestMuxCtimer3M0 = 37U, /**< CTIMER3 Match channel 0 request */ - kDma0RequestMuxCtimer3M1 = 38U, /**< CTIMER3 Match channel 1 request */ - kDma0RequestMuxCtimer4M0 = 39U, /**< CTIMER4 Match channel 0 request */ - kDma0RequestMuxCtimer4M1 = 40U, /**< CTIMER4 Match channel 1 request */ - kDma0RequestMuxFlexPWM0ReqCapt0 = 41U, /**< FlexPWM0 capture0 request */ - kDma0RequestMuxFlexPWM0ReqCapt1 = 42U, /**< FlexPWM0 capture1 request */ - kDma0RequestMuxFlexPWM0ReqCapt2 = 43U, /**< FlexPWM0 capture2 request */ - kDma0RequestMuxFlexPWM0ReqVal0 = 45U, /**< FlexPWM0 value0 request */ - kDma0RequestMuxFlexPWM0ReqVal1 = 46U, /**< FlexPWM0 value1 request */ - kDma0RequestMuxFlexPWM0ReqVal2 = 47U, /**< FlexPWM0 value2 request */ - kDma0RequestMuxLptmr0 = 49U, /**< LPTMR0 Counter match event */ - kDma0RequestMuxAdc0FifoRequest = 51U, /**< ADC0 FIFO request */ - kDma0RequestMuxAdc1FifoRequest = 52U, /**< ADC1 FIFO request */ - kDma0RequestMuxHsCmp0DmaRequest = 53U, /**< CMP0 DMA_request */ - kDma0RequestMuxHsCmp1DmaRequest = 54U, /**< CMP1 DMA_request */ - kDma0RequestMuxDac0FifoRequest = 56U, /**< DAC0 FIFO request */ - kDma0RequestMuxGpio0PinEventRequest0 = 60U, /**< GPIO0 Pin event request 0 */ - kDma0RequestMuxGpio1PinEventRequest0 = 61U, /**< GPIO1 Pin event request 0 */ - kDma0RequestMuxGpio2PinEventRequest0 = 62U, /**< GPIO2 Pin event request 0 */ - kDma0RequestMuxGpio3PinEventRequest0 = 63U, /**< GPIO3 Pin event request 0 */ - kDma0RequestMuxGpio4PinEventRequest0 = 64U, /**< GPIO4 Pin event request 0 */ - kDma0RequestMuxQdc0 = 65U, /**< DMA request for new buffered value */ - kDma0RequestMuxQdc1 = 66U, /**< DMA request for new buffered value */ - kDma0RequestMuxFlexIO0ShiftRegister0Request = 71U, /**< FlexIO0 Shifter0 Status DMA request OR Timer0 Status DMA request */ - kDma0RequestMuxFlexIO0ShiftRegister1Request = 72U, /**< FlexIO0 Shifter1 Status DMA request OR Timer1 Status DMA request */ - kDma0RequestMuxFlexIO0ShiftRegister2Request = 73U, /**< FlexIO0 Shifter2 Status DMA request OR Timer2 Status DMA request */ - kDma0RequestMuxFlexIO0ShiftRegister3Request = 74U, /**< FlexIO0 Shifter3 Status DMA request OR Timer3 Status DMA request */ - kDma0RequestMuxFlexPWM1ReqCapt0 = 79U, /**< FlexPWM1 capture0 request */ - kDma0RequestMuxFlexPWM1ReqCapt1 = 80U, /**< FlexPWM1 capture1 request */ - kDma0RequestMuxFlexPWM1ReqCapt2 = 81U, /**< FlexPWM1 capture2 request */ - kDma0RequestMuxFlexPWM1ReqVal0 = 83U, /**< FlexPWM1 value0 request */ - kDma0RequestMuxFlexPWM1ReqVal1 = 84U, /**< FlexPWM1 value1 request */ - kDma0RequestMuxFlexPWM1ReqVal2 = 85U, /**< FlexPWM1 value2 request */ -} dma_request_source_t; - -/* @} */ - -/*! - * @addtogroup eim_memory_channel - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @brief Structure for the eim_memory_channel - * - * Defines the structure for the EIM resource collections. - */ - -typedef enum _eim_memory_channel -{ - kEIM_MemoryChannelRAMA0 = 0U, /**< Memory RAMA0 */ -} eim_memory_channel_t; - -/* @} */ - -/*! - * @addtogroup eim_error_injection_channel_enable - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @brief Structure for the eim_error_injection_channel_enable - * - * Defines the structure for the EIM error injection resource collections. - */ - -typedef enum _eim_error_injection_channel_enable -{ - kEIM_MemoryChannelRAMAEnable = 0x80000000U, /**< Memory channel 0(RAMA0) error injection enable */ -} eim_error_injection_channel_enable_t; - -/* @} */ - -/*! - * @addtogroup erm_memory_channel - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @brief Structure for the erm_memory_channel - * - * Defines the structure for the ERM resource collections. - */ - -typedef enum _erm_memory_channel -{ - kERM_MemoryChannelRAMA0 = 0U, /**< Memory RAMA0 */ - kERM_MemoryChannelFLASH = 1U, /**< Memory FLASH */ -} erm_memory_channel_t; - -/* @} */ - - -/*! - * @} - */ /* end of group Mapping_Information */ - - -/* ---------------------------------------------------------------------------- - -- Device Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup Peripheral_access_layer Device Peripheral Access Layer - * @{ - */ - - -/* -** Start of section using anonymous unions -*/ - -#if defined(__ARMCC_VERSION) - #if (__ARMCC_VERSION >= 6010050) - #pragma clang diagnostic push - #else - #pragma push - #pragma anon_unions - #endif -#elif defined(__GNUC__) - /* anonymous unions are enabled by default */ -#elif defined(__IAR_SYSTEMS_ICC__) - #pragma language=extended -#else - #error Not supported compiler type -#endif - -/* ---------------------------------------------------------------------------- - -- ADC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ADC_Peripheral_Access_Layer ADC Peripheral Access Layer - * @{ - */ - -/** ADC - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID Register, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter Register, offset: 0x4 */ - uint8_t RESERVED_0[8]; - __IO uint32_t CTRL; /**< Control Register, offset: 0x10 */ - __IO uint32_t STAT; /**< Status Register, offset: 0x14 */ - __IO uint32_t IE; /**< Interrupt Enable Register, offset: 0x18 */ - __IO uint32_t DE; /**< DMA Enable Register, offset: 0x1C */ - __IO uint32_t CFG; /**< Configuration Register, offset: 0x20 */ - __IO uint32_t PAUSE; /**< Pause Register, offset: 0x24 */ - uint8_t RESERVED_1[12]; - __O uint32_t SWTRIG; /**< Software Trigger Register, offset: 0x34 */ - __IO uint32_t TSTAT; /**< Trigger Status Register, offset: 0x38 */ - uint8_t RESERVED_2[4]; - __IO uint32_t OFSTRIM; /**< Offset Trim Register, offset: 0x40 */ - uint8_t RESERVED_3[4]; - __IO uint32_t HSTRIM; /**< High Speed Trim Register, offset: 0x48 */ - uint8_t RESERVED_4[84]; - __IO uint32_t TCTRL[4]; /**< Trigger Control Register, array offset: 0xA0, array step: 0x4 */ - uint8_t RESERVED_5[48]; - __IO uint32_t FCTRL; /**< FIFO Control Register, offset: 0xE0 */ - uint8_t RESERVED_6[12]; - __I uint32_t GCC[1]; /**< Gain Calibration Control, array offset: 0xF0, array step: 0x4 */ - uint8_t RESERVED_7[4]; - __IO uint32_t GCR[1]; /**< Gain Calculation Result, array offset: 0xF8, array step: 0x4 */ - uint8_t RESERVED_8[4]; - struct { /* offset: 0x100, array step: 0x8 */ - __IO uint32_t CMDL; /**< Command Low Buffer Register, array offset: 0x100, array step: 0x8 */ - __IO uint32_t CMDH; /**< Command High Buffer Register, array offset: 0x104, array step: 0x8 */ - } CMD[7]; - uint8_t RESERVED_9[200]; - __IO uint32_t CV[7]; /**< Compare Value Register, array offset: 0x200, array step: 0x4 */ - uint8_t RESERVED_10[228]; - __I uint32_t RESFIFO; /**< Data Result FIFO Register, offset: 0x300 */ - uint8_t RESERVED_11[252]; - __IO uint32_t CAL_GAR0; /**< Calibration General A-Side Registers, offset: 0x400 */ - __IO uint32_t CAL_GAR1; /**< Calibration General A-Side Registers, offset: 0x404 */ - __IO uint32_t CAL_GAR2; /**< Calibration General A-Side Registers, offset: 0x408 */ - __IO uint32_t CAL_GAR3; /**< Calibration General A-Side Registers, offset: 0x40C */ - __IO uint32_t CAL_GAR4; /**< Calibration General A-Side Registers, offset: 0x410 */ - __IO uint32_t CAL_GAR5; /**< Calibration General A-Side Registers, offset: 0x414 */ - __IO uint32_t CAL_GAR6; /**< Calibration General A-Side Registers, offset: 0x418 */ - __IO uint32_t CAL_GAR7; /**< Calibration General A-Side Registers, offset: 0x41C */ - __IO uint32_t CAL_GAR8; /**< Calibration General A-Side Registers, offset: 0x420 */ - __IO uint32_t CAL_GAR9; /**< Calibration General A-Side Registers, offset: 0x424 */ - __IO uint32_t CAL_GAR10; /**< Calibration General A-Side Registers, offset: 0x428 */ - __IO uint32_t CAL_GAR11; /**< Calibration General A-Side Registers, offset: 0x42C */ - __IO uint32_t CAL_GAR12; /**< Calibration General A-Side Registers, offset: 0x430 */ - __IO uint32_t CAL_GAR13; /**< Calibration General A-Side Registers, offset: 0x434 */ - __IO uint32_t CAL_GAR14; /**< Calibration General A-Side Registers, offset: 0x438 */ - __IO uint32_t CAL_GAR15; /**< Calibration General A-Side Registers, offset: 0x43C */ - __IO uint32_t CAL_GAR16; /**< Calibration General A-Side Registers, offset: 0x440 */ - __IO uint32_t CAL_GAR17; /**< Calibration General A-Side Registers, offset: 0x444 */ - __IO uint32_t CAL_GAR18; /**< Calibration General A-Side Registers, offset: 0x448 */ - __IO uint32_t CAL_GAR19; /**< Calibration General A-Side Registers, offset: 0x44C */ - __IO uint32_t CAL_GAR20; /**< Calibration General A-Side Registers, offset: 0x450 */ - __IO uint32_t CAL_GAR21; /**< Calibration General A-Side Registers, offset: 0x454 */ - __IO uint32_t CAL_GAR22; /**< Calibration General A-Side Registers, offset: 0x458 */ - __IO uint32_t CAL_GAR23; /**< Calibration General A-Side Registers, offset: 0x45C */ - __IO uint32_t CAL_GAR24; /**< Calibration General A-Side Registers, offset: 0x460 */ - __IO uint32_t CAL_GAR25; /**< Calibration General A-Side Registers, offset: 0x464 */ - __IO uint32_t CAL_GAR26; /**< Calibration General A-Side Registers, offset: 0x468 */ - __IO uint32_t CAL_GAR27; /**< Calibration General A-Side Registers, offset: 0x46C */ - __IO uint32_t CAL_GAR28; /**< Calibration General A-Side Registers, offset: 0x470 */ - __IO uint32_t CAL_GAR29; /**< Calibration General A-Side Registers, offset: 0x474 */ - __IO uint32_t CAL_GAR30; /**< Calibration General A-Side Registers, offset: 0x478 */ - __IO uint32_t CAL_GAR31; /**< Calibration General A-Side Registers, offset: 0x47C */ - __IO uint32_t CAL_GAR32; /**< Calibration General A-Side Registers, offset: 0x480 */ - __IO uint32_t CAL_GAR33; /**< Calibration General A-Side Registers, offset: 0x484 */ - uint8_t RESERVED_12[2928]; - __IO uint32_t CFG2; /**< Configuration 2 Register, offset: 0xFF8 */ -} ADC_Type; - -/* ---------------------------------------------------------------------------- - -- ADC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ADC_Register_Masks ADC Register Masks - * @{ - */ - -/*! @name VERID - Version ID Register */ -/*! @{ */ - -#define ADC_VERID_RES_MASK (0x1U) -#define ADC_VERID_RES_SHIFT (0U) -/*! RES - Resolution - * 0b0..Up to 12-bit single ended resolution supported (and 13-bit differential resolution if VERID[DIFFEN] = 1b). - * 0b1..Up to 16-bit single ended resolution supported (and 16-bit differential resolution if VERID[DIFFEN] = 1b). - */ -#define ADC_VERID_RES(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_RES_SHIFT)) & ADC_VERID_RES_MASK) - -#define ADC_VERID_DIFFEN_MASK (0x2U) -#define ADC_VERID_DIFFEN_SHIFT (1U) -/*! DIFFEN - Differential Supported - * 0b0..Differential operation not supported. - * 0b1..Differential operation supported. - */ -#define ADC_VERID_DIFFEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_DIFFEN_SHIFT)) & ADC_VERID_DIFFEN_MASK) - -#define ADC_VERID_MVI_MASK (0x8U) -#define ADC_VERID_MVI_SHIFT (3U) -/*! MVI - Multi Vref Implemented - * 0b0..Single voltage reference high (VREFH) input supported. - * 0b1..Multiple voltage reference high (VREFH) inputs supported. - */ -#define ADC_VERID_MVI(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_MVI_SHIFT)) & ADC_VERID_MVI_MASK) - -#define ADC_VERID_CSW_MASK (0x70U) -#define ADC_VERID_CSW_SHIFT (4U) -/*! CSW - Channel Scale Width - * 0b000..Channel scaling not supported. - * 0b001..Channel scaling supported. 1-bit CSCALE control field. - * 0b110..Channel scaling supported. 6-bit CSCALE control field. - */ -#define ADC_VERID_CSW(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_CSW_SHIFT)) & ADC_VERID_CSW_MASK) - -#define ADC_VERID_VR1RNGI_MASK (0x100U) -#define ADC_VERID_VR1RNGI_SHIFT (8U) -/*! VR1RNGI - Voltage Reference 1 Range Control Bit Implemented - * 0b0..Range control not required. CFG[VREF1RNG] is not implemented. - * 0b1..Range control required. CFG[VREF1RNG] is implemented. - */ -#define ADC_VERID_VR1RNGI(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_VR1RNGI_SHIFT)) & ADC_VERID_VR1RNGI_MASK) - -#define ADC_VERID_IADCKI_MASK (0x200U) -#define ADC_VERID_IADCKI_SHIFT (9U) -/*! IADCKI - Internal ADC Clock Implemented - * 0b0..Internal clock source not implemented. - * 0b1..Internal clock source (and CFG[ADCKEN]) implemented. - */ -#define ADC_VERID_IADCKI(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_IADCKI_SHIFT)) & ADC_VERID_IADCKI_MASK) - -#define ADC_VERID_CALOFSI_MASK (0x400U) -#define ADC_VERID_CALOFSI_SHIFT (10U) -/*! CALOFSI - Calibration Function Implemented - * 0b0..Calibration Not Implemented. - * 0b1..Calibration Implemented. - */ -#define ADC_VERID_CALOFSI(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_CALOFSI_SHIFT)) & ADC_VERID_CALOFSI_MASK) - -#define ADC_VERID_NUM_SEC_MASK (0x800U) -#define ADC_VERID_NUM_SEC_SHIFT (11U) -/*! NUM_SEC - Number of Single Ended Outputs Supported - * 0b0..This design supports one single ended conversion at a time. - * 0b1..This design supports two simultaneous single ended conversions. - */ -#define ADC_VERID_NUM_SEC(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_NUM_SEC_SHIFT)) & ADC_VERID_NUM_SEC_MASK) - -#define ADC_VERID_NUM_FIFO_MASK (0x7000U) -#define ADC_VERID_NUM_FIFO_SHIFT (12U) -/*! NUM_FIFO - Number of FIFOs - * 0b000..N/A - * 0b001..This design supports one result FIFO. - * 0b010..This design supports two result FIFOs. - * 0b011..This design supports three result FIFOs. - * 0b100..This design supports four result FIFOs. - */ -#define ADC_VERID_NUM_FIFO(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_NUM_FIFO_SHIFT)) & ADC_VERID_NUM_FIFO_MASK) - -#define ADC_VERID_MINOR_MASK (0xFF0000U) -#define ADC_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define ADC_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_MINOR_SHIFT)) & ADC_VERID_MINOR_MASK) - -#define ADC_VERID_MAJOR_MASK (0xFF000000U) -#define ADC_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define ADC_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_MAJOR_SHIFT)) & ADC_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter Register */ -/*! @{ */ - -#define ADC_PARAM_TRIG_NUM_MASK (0xFFU) -#define ADC_PARAM_TRIG_NUM_SHIFT (0U) -/*! TRIG_NUM - Trigger Number */ -#define ADC_PARAM_TRIG_NUM(x) (((uint32_t)(((uint32_t)(x)) << ADC_PARAM_TRIG_NUM_SHIFT)) & ADC_PARAM_TRIG_NUM_MASK) - -#define ADC_PARAM_FIFOSIZE_MASK (0xFF00U) -#define ADC_PARAM_FIFOSIZE_SHIFT (8U) -/*! FIFOSIZE - Result FIFO Depth - * 0b00000001..Result FIFO depth = 2 dataword. - * 0b00000100..Result FIFO depth = 4 datawords. - * 0b00001000..Result FIFO depth = 8 datawords. - * 0b00010000..Result FIFO depth = 16 datawords. - * 0b00100000..Result FIFO depth = 32 datawords. - * 0b01000000..Result FIFO depth = 64 datawords. - */ -#define ADC_PARAM_FIFOSIZE(x) (((uint32_t)(((uint32_t)(x)) << ADC_PARAM_FIFOSIZE_SHIFT)) & ADC_PARAM_FIFOSIZE_MASK) - -#define ADC_PARAM_CV_NUM_MASK (0xFF0000U) -#define ADC_PARAM_CV_NUM_SHIFT (16U) -/*! CV_NUM - Compare Value Number */ -#define ADC_PARAM_CV_NUM(x) (((uint32_t)(((uint32_t)(x)) << ADC_PARAM_CV_NUM_SHIFT)) & ADC_PARAM_CV_NUM_MASK) - -#define ADC_PARAM_CMD_NUM_MASK (0xFF000000U) -#define ADC_PARAM_CMD_NUM_SHIFT (24U) -/*! CMD_NUM - Command Buffer Number */ -#define ADC_PARAM_CMD_NUM(x) (((uint32_t)(((uint32_t)(x)) << ADC_PARAM_CMD_NUM_SHIFT)) & ADC_PARAM_CMD_NUM_MASK) -/*! @} */ - -/*! @name CTRL - Control Register */ -/*! @{ */ - -#define ADC_CTRL_ADCEN_MASK (0x1U) -#define ADC_CTRL_ADCEN_SHIFT (0U) -/*! ADCEN - ADC Enable - * 0b0..ADC is disabled. - * 0b1..ADC is enabled. - */ -#define ADC_CTRL_ADCEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_ADCEN_SHIFT)) & ADC_CTRL_ADCEN_MASK) - -#define ADC_CTRL_RST_MASK (0x2U) -#define ADC_CTRL_RST_SHIFT (1U) -/*! RST - Software Reset - * 0b0..ADC logic is not reset. - * 0b1..ADC logic is reset. - */ -#define ADC_CTRL_RST(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_RST_SHIFT)) & ADC_CTRL_RST_MASK) - -#define ADC_CTRL_DOZEN_MASK (0x4U) -#define ADC_CTRL_DOZEN_SHIFT (2U) -/*! DOZEN - Doze Enable - * 0b0..ADC is enabled in low power mode. - * 0b1..ADC is disabled in low power mode. - */ -#define ADC_CTRL_DOZEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_DOZEN_SHIFT)) & ADC_CTRL_DOZEN_MASK) - -#define ADC_CTRL_CAL_REQ_MASK (0x8U) -#define ADC_CTRL_CAL_REQ_SHIFT (3U) -/*! CAL_REQ - Auto-Calibration Request - * 0b0..No request for hardware calibration has been made - * 0b1..A request for hardware calibration has been made - */ -#define ADC_CTRL_CAL_REQ(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_CAL_REQ_SHIFT)) & ADC_CTRL_CAL_REQ_MASK) - -#define ADC_CTRL_CALOFS_MASK (0x10U) -#define ADC_CTRL_CALOFS_SHIFT (4U) -/*! CALOFS - Offset Calibration Request - * 0b0..No request for offset calibration has been made - * 0b1..Request for offset calibration function - */ -#define ADC_CTRL_CALOFS(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_CALOFS_SHIFT)) & ADC_CTRL_CALOFS_MASK) - -#define ADC_CTRL_CALHS_MASK (0x40U) -#define ADC_CTRL_CALHS_SHIFT (6U) -/*! CALHS - High Speed Mode Trim Request - * 0b0..No request for high speed mode trim has been made - * 0b1..Request for high speed mode trim has been made - */ -#define ADC_CTRL_CALHS(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_CALHS_SHIFT)) & ADC_CTRL_CALHS_MASK) - -#define ADC_CTRL_RSTFIFO0_MASK (0x100U) -#define ADC_CTRL_RSTFIFO0_SHIFT (8U) -/*! RSTFIFO0 - Reset FIFO 0 - * 0b0..No effect. - * 0b1..FIFO 0 is reset. - */ -#define ADC_CTRL_RSTFIFO0(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_RSTFIFO0_SHIFT)) & ADC_CTRL_RSTFIFO0_MASK) - -#define ADC_CTRL_CAL_AVGS_MASK (0xF0000U) -#define ADC_CTRL_CAL_AVGS_SHIFT (16U) -/*! CAL_AVGS - Auto-Calibration Averages - * 0b0000..Single conversion. - * 0b0001..2 conversions averaged. - * 0b0010..4 conversions averaged. - * 0b0011..8 conversions averaged. - * 0b0100..16 conversions averaged. - * 0b0101..32 conversions averaged. - * 0b0110..64 conversions averaged. - * 0b0111..128 conversions averaged. - * 0b1000..256 conversions averaged. - * 0b1001..512 conversions averaged. - * 0b1010..1024 conversions averaged. - */ -#define ADC_CTRL_CAL_AVGS(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_CAL_AVGS_SHIFT)) & ADC_CTRL_CAL_AVGS_MASK) -/*! @} */ - -/*! @name STAT - Status Register */ -/*! @{ */ - -#define ADC_STAT_RDY0_MASK (0x1U) -#define ADC_STAT_RDY0_SHIFT (0U) -/*! RDY0 - Result FIFO 0 Ready Flag - * 0b0..Result FIFO 0 data level not above watermark level. - * 0b1..Result FIFO 0 holding data above watermark level. - */ -#define ADC_STAT_RDY0(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_RDY0_SHIFT)) & ADC_STAT_RDY0_MASK) - -#define ADC_STAT_FOF0_MASK (0x2U) -#define ADC_STAT_FOF0_SHIFT (1U) -/*! FOF0 - Result FIFO 0 Overflow Flag - * 0b0..No result FIFO 0 overflow has occurred since the last time the flag was cleared. - * 0b1..At least one result FIFO 0 overflow has occurred since the last time the flag was cleared. - */ -#define ADC_STAT_FOF0(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_FOF0_SHIFT)) & ADC_STAT_FOF0_MASK) - -#define ADC_STAT_TEXC_INT_MASK (0x100U) -#define ADC_STAT_TEXC_INT_SHIFT (8U) -/*! TEXC_INT - Interrupt Flag For High Priority Trigger Exception - * 0b0..No trigger exceptions have occurred. - * 0b1..A trigger exception has occurred and is pending acknowledgement. - */ -#define ADC_STAT_TEXC_INT(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_TEXC_INT_SHIFT)) & ADC_STAT_TEXC_INT_MASK) - -#define ADC_STAT_TCOMP_INT_MASK (0x200U) -#define ADC_STAT_TCOMP_INT_SHIFT (9U) -/*! TCOMP_INT - Interrupt Flag For Trigger Completion - * 0b0..Either IE[TCOMP_IE] is set to 0, or no trigger sequences have run to completion. - * 0b1..Trigger sequence has been completed and all data is stored in the associated FIFO. - */ -#define ADC_STAT_TCOMP_INT(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_TCOMP_INT_SHIFT)) & ADC_STAT_TCOMP_INT_MASK) - -#define ADC_STAT_CAL_RDY_MASK (0x400U) -#define ADC_STAT_CAL_RDY_SHIFT (10U) -/*! CAL_RDY - Calibration Ready - * 0b0..Calibration is incomplete or hasn't been ran. - * 0b1..The ADC is calibrated. - */ -#define ADC_STAT_CAL_RDY(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_CAL_RDY_SHIFT)) & ADC_STAT_CAL_RDY_MASK) - -#define ADC_STAT_ADC_ACTIVE_MASK (0x800U) -#define ADC_STAT_ADC_ACTIVE_SHIFT (11U) -/*! ADC_ACTIVE - ADC Active - * 0b0..The ADC is IDLE. There are no pending triggers to service and no active commands are being processed. - * 0b1..The ADC is processing a conversion, running through the power up delay, or servicing a trigger. - */ -#define ADC_STAT_ADC_ACTIVE(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_ADC_ACTIVE_SHIFT)) & ADC_STAT_ADC_ACTIVE_MASK) - -#define ADC_STAT_TRGACT_MASK (0x30000U) -#define ADC_STAT_TRGACT_SHIFT (16U) -/*! TRGACT - Trigger Active - * 0b00..Command (sequence) associated with Trigger 0 currently being executed. - * 0b01..Command (sequence) associated with Trigger 1 currently being executed. - * 0b10..Command (sequence) associated with Trigger 2 currently being executed. - * 0b11..Command (sequence) associated with Trigger 3 currently being executed. - */ -#define ADC_STAT_TRGACT(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_TRGACT_SHIFT)) & ADC_STAT_TRGACT_MASK) - -#define ADC_STAT_CMDACT_MASK (0x7000000U) -#define ADC_STAT_CMDACT_SHIFT (24U) -/*! CMDACT - Command Active - * 0b000..No command is currently in progress. - * 0b001..Command 1 currently being executed. - * 0b010..Command 2 currently being executed. - * 0b011-0b111..Associated command number is currently being executed. - */ -#define ADC_STAT_CMDACT(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_CMDACT_SHIFT)) & ADC_STAT_CMDACT_MASK) -/*! @} */ - -/*! @name IE - Interrupt Enable Register */ -/*! @{ */ - -#define ADC_IE_FWMIE0_MASK (0x1U) -#define ADC_IE_FWMIE0_SHIFT (0U) -/*! FWMIE0 - FIFO 0 Watermark Interrupt Enable - * 0b0..FIFO 0 watermark interrupts are not enabled. - * 0b1..FIFO 0 watermark interrupts are enabled. - */ -#define ADC_IE_FWMIE0(x) (((uint32_t)(((uint32_t)(x)) << ADC_IE_FWMIE0_SHIFT)) & ADC_IE_FWMIE0_MASK) - -#define ADC_IE_FOFIE0_MASK (0x2U) -#define ADC_IE_FOFIE0_SHIFT (1U) -/*! FOFIE0 - Result FIFO 0 Overflow Interrupt Enable - * 0b0..FIFO 0 overflow interrupts are not enabled. - * 0b1..FIFO 0 overflow interrupts are enabled. - */ -#define ADC_IE_FOFIE0(x) (((uint32_t)(((uint32_t)(x)) << ADC_IE_FOFIE0_SHIFT)) & ADC_IE_FOFIE0_MASK) - -#define ADC_IE_TEXC_IE_MASK (0x100U) -#define ADC_IE_TEXC_IE_SHIFT (8U) -/*! TEXC_IE - Trigger Exception Interrupt Enable - * 0b0..Trigger exception interrupts are disabled. - * 0b1..Trigger exception interrupts are enabled. - */ -#define ADC_IE_TEXC_IE(x) (((uint32_t)(((uint32_t)(x)) << ADC_IE_TEXC_IE_SHIFT)) & ADC_IE_TEXC_IE_MASK) - -#define ADC_IE_TCOMP_IE_MASK (0xF0000U) -#define ADC_IE_TCOMP_IE_SHIFT (16U) -/*! TCOMP_IE - Trigger Completion Interrupt Enable - * 0b0000..Trigger completion interrupts are disabled. - * 0b0001..Trigger completion interrupts are enabled for trigger source 0 only. - * 0b0010..Trigger completion interrupts are enabled for trigger source 1 only. - * 0b0011-0b1110..Associated trigger completion interrupts are enabled. - * 0b1111..Trigger completion interrupts are enabled for every trigger source. - */ -#define ADC_IE_TCOMP_IE(x) (((uint32_t)(((uint32_t)(x)) << ADC_IE_TCOMP_IE_SHIFT)) & ADC_IE_TCOMP_IE_MASK) -/*! @} */ - -/*! @name DE - DMA Enable Register */ -/*! @{ */ - -#define ADC_DE_FWMDE0_MASK (0x1U) -#define ADC_DE_FWMDE0_SHIFT (0U) -/*! FWMDE0 - FIFO 0 Watermark DMA Enable - * 0b0..DMA request disabled. - * 0b1..DMA request enabled. - */ -#define ADC_DE_FWMDE0(x) (((uint32_t)(((uint32_t)(x)) << ADC_DE_FWMDE0_SHIFT)) & ADC_DE_FWMDE0_MASK) -/*! @} */ - -/*! @name CFG - Configuration Register */ -/*! @{ */ - -#define ADC_CFG_TPRICTRL_MASK (0x3U) -#define ADC_CFG_TPRICTRL_SHIFT (0U) -/*! TPRICTRL - ADC Trigger Priority Control - * 0b00..If a higher priority trigger is detected during command processing, the current conversion is aborted - * and the new command specified by the trigger is started. - * 0b01..If a higher priority trigger is received during command processing, the current command is stopped after - * completing the current conversion. If averaging is enabled, the averaging loop will be completed. - * However, CMDHa[LOOP] will be ignored and the higher priority trigger will be serviced. - * 0b10..If a higher priority trigger is received during command processing, the current command will be - * completed (averaging, looping, compare) before servicing the higher priority trigger. - * 0b11.. - */ -#define ADC_CFG_TPRICTRL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_TPRICTRL_SHIFT)) & ADC_CFG_TPRICTRL_MASK) - -#define ADC_CFG_PWRSEL_MASK (0x20U) -#define ADC_CFG_PWRSEL_SHIFT (5U) -/*! PWRSEL - Power Configuration Select - * 0b0..Low power - * 0b1..High power - */ -#define ADC_CFG_PWRSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_PWRSEL_SHIFT)) & ADC_CFG_PWRSEL_MASK) - -#define ADC_CFG_REFSEL_MASK (0xC0U) -#define ADC_CFG_REFSEL_SHIFT (6U) -/*! REFSEL - Voltage Reference Selection - * 0b00..(Default) Option 1 setting. - * 0b01..Option 2 setting. - * 0b10..Option 3 setting. - * 0b11..Reserved - */ -#define ADC_CFG_REFSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_REFSEL_SHIFT)) & ADC_CFG_REFSEL_MASK) - -#define ADC_CFG_TRES_MASK (0x100U) -#define ADC_CFG_TRES_SHIFT (8U) -/*! TRES - Trigger Resume Enable - * 0b0..Trigger sequences interrupted by a high priority trigger exception are not automatically resumed or restarted. - * 0b1..Trigger sequences interrupted by a high priority trigger exception are automatically resumed or restarted. - */ -#define ADC_CFG_TRES(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_TRES_SHIFT)) & ADC_CFG_TRES_MASK) - -#define ADC_CFG_TCMDRES_MASK (0x200U) -#define ADC_CFG_TCMDRES_SHIFT (9U) -/*! TCMDRES - Trigger Command Resume - * 0b0..Trigger sequences interrupted by a high priority trigger exception is automatically restarted. - * 0b1..Trigger sequences interrupted by a high priority trigger exception is resumed from the command executing before the exception. - */ -#define ADC_CFG_TCMDRES(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_TCMDRES_SHIFT)) & ADC_CFG_TCMDRES_MASK) - -#define ADC_CFG_HPT_EXDI_MASK (0x400U) -#define ADC_CFG_HPT_EXDI_SHIFT (10U) -/*! HPT_EXDI - High Priority Trigger Exception Disable - * 0b0..High priority trigger exceptions are enabled. - * 0b1..High priority trigger exceptions are disabled. - */ -#define ADC_CFG_HPT_EXDI(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_HPT_EXDI_SHIFT)) & ADC_CFG_HPT_EXDI_MASK) - -#define ADC_CFG_PUDLY_MASK (0xFF0000U) -#define ADC_CFG_PUDLY_SHIFT (16U) -/*! PUDLY - Power Up Delay */ -#define ADC_CFG_PUDLY(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_PUDLY_SHIFT)) & ADC_CFG_PUDLY_MASK) - -#define ADC_CFG_PWREN_MASK (0x10000000U) -#define ADC_CFG_PWREN_SHIFT (28U) -/*! PWREN - ADC Analog Pre-Enable - * 0b0..ADC analog circuits are only enabled while conversions are active. Performance is affected due to analog startup delays. - * 0b1..ADC analog circuits are pre-enabled and ready to execute conversions without startup delays (at the cost - * of higher DC current consumption). Note that a single power up delay (CFG[PUDLY]) is executed immediately - * once PWREN is set, and any detected trigger does not begin ADC operation until the power up delay time has - * passed. After this initial delay expires the analog remains pre-enabled and no additional delays are - * executed. - */ -#define ADC_CFG_PWREN(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_PWREN_SHIFT)) & ADC_CFG_PWREN_MASK) -/*! @} */ - -/*! @name PAUSE - Pause Register */ -/*! @{ */ - -#define ADC_PAUSE_PAUSEDLY_MASK (0x1FFU) -#define ADC_PAUSE_PAUSEDLY_SHIFT (0U) -/*! PAUSEDLY - Pause Delay */ -#define ADC_PAUSE_PAUSEDLY(x) (((uint32_t)(((uint32_t)(x)) << ADC_PAUSE_PAUSEDLY_SHIFT)) & ADC_PAUSE_PAUSEDLY_MASK) - -#define ADC_PAUSE_PAUSEEN_MASK (0x80000000U) -#define ADC_PAUSE_PAUSEEN_SHIFT (31U) -/*! PAUSEEN - PAUSE Option Enable - * 0b0..Pause operation disabled - * 0b1..Pause operation enabled - */ -#define ADC_PAUSE_PAUSEEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_PAUSE_PAUSEEN_SHIFT)) & ADC_PAUSE_PAUSEEN_MASK) -/*! @} */ - -/*! @name SWTRIG - Software Trigger Register */ -/*! @{ */ - -#define ADC_SWTRIG_SWT0_MASK (0x1U) -#define ADC_SWTRIG_SWT0_SHIFT (0U) -/*! SWT0 - Software Trigger 0 Event - * 0b0..No trigger 0 event generated. - * 0b1..Trigger 0 event generated. - */ -#define ADC_SWTRIG_SWT0(x) (((uint32_t)(((uint32_t)(x)) << ADC_SWTRIG_SWT0_SHIFT)) & ADC_SWTRIG_SWT0_MASK) - -#define ADC_SWTRIG_SWT1_MASK (0x2U) -#define ADC_SWTRIG_SWT1_SHIFT (1U) -/*! SWT1 - Software Trigger 1 Event - * 0b0..No trigger 1 event generated. - * 0b1..Trigger 1 event generated. - */ -#define ADC_SWTRIG_SWT1(x) (((uint32_t)(((uint32_t)(x)) << ADC_SWTRIG_SWT1_SHIFT)) & ADC_SWTRIG_SWT1_MASK) - -#define ADC_SWTRIG_SWT2_MASK (0x4U) -#define ADC_SWTRIG_SWT2_SHIFT (2U) -/*! SWT2 - Software Trigger 2 Event - * 0b0..No trigger 2 event generated. - * 0b1..Trigger 2 event generated. - */ -#define ADC_SWTRIG_SWT2(x) (((uint32_t)(((uint32_t)(x)) << ADC_SWTRIG_SWT2_SHIFT)) & ADC_SWTRIG_SWT2_MASK) - -#define ADC_SWTRIG_SWT3_MASK (0x8U) -#define ADC_SWTRIG_SWT3_SHIFT (3U) -/*! SWT3 - Software Trigger 3 Event - * 0b0..No trigger 3 event generated. - * 0b1..Trigger 3 event generated. - */ -#define ADC_SWTRIG_SWT3(x) (((uint32_t)(((uint32_t)(x)) << ADC_SWTRIG_SWT3_SHIFT)) & ADC_SWTRIG_SWT3_MASK) -/*! @} */ - -/*! @name TSTAT - Trigger Status Register */ -/*! @{ */ - -#define ADC_TSTAT_TEXC_NUM_MASK (0xFU) -#define ADC_TSTAT_TEXC_NUM_SHIFT (0U) -/*! TEXC_NUM - Trigger Exception Number - * 0b0000..No triggers have been interrupted by a high priority exception. Or CFG[TRES] = 1. - * 0b0001..Trigger 0 has been interrupted by a high priority exception. - * 0b0010..Trigger 1 has been interrupted by a high priority exception. - * 0b0011-0b1110..Associated trigger sequence has interrupted by a high priority exception. - * 0b1111..Every trigger sequence has been interrupted by a high priority exception. - */ -#define ADC_TSTAT_TEXC_NUM(x) (((uint32_t)(((uint32_t)(x)) << ADC_TSTAT_TEXC_NUM_SHIFT)) & ADC_TSTAT_TEXC_NUM_MASK) - -#define ADC_TSTAT_TCOMP_FLAG_MASK (0xF0000U) -#define ADC_TSTAT_TCOMP_FLAG_SHIFT (16U) -/*! TCOMP_FLAG - Trigger Completion Flag - * 0b0000..No triggers have been completed. Trigger completion interrupts are disabled. - * 0b0001..Trigger 0 has been completed and trigger 0 has enabled completion interrupts. - * 0b0010..Trigger 1 has been completed and trigger 1 has enabled completion interrupts. - * 0b0011-0b1110..Associated trigger sequence has completed and has enabled completion interrupts. - * 0b1111..Every trigger sequence has been completed and every trigger has enabled completion interrupts. - */ -#define ADC_TSTAT_TCOMP_FLAG(x) (((uint32_t)(((uint32_t)(x)) << ADC_TSTAT_TCOMP_FLAG_SHIFT)) & ADC_TSTAT_TCOMP_FLAG_MASK) -/*! @} */ - -/*! @name OFSTRIM - Offset Trim Register */ -/*! @{ */ - -#define ADC_OFSTRIM_OFSTRIM_MASK (0x3FFU) -#define ADC_OFSTRIM_OFSTRIM_SHIFT (0U) -/*! OFSTRIM - Trim for Offset */ -#define ADC_OFSTRIM_OFSTRIM(x) (((uint32_t)(((uint32_t)(x)) << ADC_OFSTRIM_OFSTRIM_SHIFT)) & ADC_OFSTRIM_OFSTRIM_MASK) -/*! @} */ - -/*! @name HSTRIM - High Speed Trim Register */ -/*! @{ */ - -#define ADC_HSTRIM_HSTRIM_MASK (0x1FU) -#define ADC_HSTRIM_HSTRIM_SHIFT (0U) -/*! HSTRIM - Trim for High Speed Conversions */ -#define ADC_HSTRIM_HSTRIM(x) (((uint32_t)(((uint32_t)(x)) << ADC_HSTRIM_HSTRIM_SHIFT)) & ADC_HSTRIM_HSTRIM_MASK) -/*! @} */ - -/*! @name TCTRL - Trigger Control Register */ -/*! @{ */ - -#define ADC_TCTRL_HTEN_MASK (0x1U) -#define ADC_TCTRL_HTEN_SHIFT (0U) -/*! HTEN - Trigger Enable - * 0b0..Hardware trigger source disabled - * 0b1..Hardware trigger source enabled - */ -#define ADC_TCTRL_HTEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_HTEN_SHIFT)) & ADC_TCTRL_HTEN_MASK) - -#define ADC_TCTRL_TPRI_MASK (0x300U) -#define ADC_TCTRL_TPRI_SHIFT (8U) -/*! TPRI - Trigger Priority Setting - * 0b00..Set to highest priority, Level 1 - * 0b01-0b10..Set to corresponding priority level - * 0b11..Set to lowest priority, Level 4 - */ -#define ADC_TCTRL_TPRI(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_TPRI_SHIFT)) & ADC_TCTRL_TPRI_MASK) - -#define ADC_TCTRL_RSYNC_MASK (0x8000U) -#define ADC_TCTRL_RSYNC_SHIFT (15U) -/*! RSYNC - Trigger Resync */ -#define ADC_TCTRL_RSYNC(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_RSYNC_SHIFT)) & ADC_TCTRL_RSYNC_MASK) - -#define ADC_TCTRL_TDLY_MASK (0xF0000U) -#define ADC_TCTRL_TDLY_SHIFT (16U) -/*! TDLY - Trigger Delay Select */ -#define ADC_TCTRL_TDLY(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_TDLY_SHIFT)) & ADC_TCTRL_TDLY_MASK) - -#define ADC_TCTRL_TSYNC_MASK (0x800000U) -#define ADC_TCTRL_TSYNC_SHIFT (23U) -/*! TSYNC - Trigger Synchronous Select */ -#define ADC_TCTRL_TSYNC(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_TSYNC_SHIFT)) & ADC_TCTRL_TSYNC_MASK) - -#define ADC_TCTRL_TCMD_MASK (0x7000000U) -#define ADC_TCTRL_TCMD_SHIFT (24U) -/*! TCMD - Trigger Command Select - * 0b000..Not a valid selection from the command buffer. Trigger event is ignored. - * 0b001..CMD1 is executed - * 0b010-0b110..Corresponding CMD is executed - * 0b111..CMD7 is executed - */ -#define ADC_TCTRL_TCMD(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_TCMD_SHIFT)) & ADC_TCTRL_TCMD_MASK) -/*! @} */ - -/* The count of ADC_TCTRL */ -#define ADC_TCTRL_COUNT (4U) - -/*! @name FCTRL - FIFO Control Register */ -/*! @{ */ - -#define ADC_FCTRL_FCOUNT_MASK (0xFU) -#define ADC_FCTRL_FCOUNT_SHIFT (0U) -/*! FCOUNT - Result FIFO Counter */ -#define ADC_FCTRL_FCOUNT(x) (((uint32_t)(((uint32_t)(x)) << ADC_FCTRL_FCOUNT_SHIFT)) & ADC_FCTRL_FCOUNT_MASK) - -#define ADC_FCTRL_FWMARK_MASK (0x70000U) -#define ADC_FCTRL_FWMARK_SHIFT (16U) -/*! FWMARK - Watermark Level Selection */ -#define ADC_FCTRL_FWMARK(x) (((uint32_t)(((uint32_t)(x)) << ADC_FCTRL_FWMARK_SHIFT)) & ADC_FCTRL_FWMARK_MASK) -/*! @} */ - -/*! @name GCC - Gain Calibration Control */ -/*! @{ */ - -#define ADC_GCC_GAIN_CAL_MASK (0xFFFFU) -#define ADC_GCC_GAIN_CAL_SHIFT (0U) -/*! GAIN_CAL - Gain Calibration Value */ -#define ADC_GCC_GAIN_CAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_GCC_GAIN_CAL_SHIFT)) & ADC_GCC_GAIN_CAL_MASK) - -#define ADC_GCC_RDY_MASK (0x1000000U) -#define ADC_GCC_RDY_SHIFT (24U) -/*! RDY - Gain Calibration Value Valid - * 0b0..The GAIN_CAL value is invalid. Run the hardware calibration routine for this value to be set. - * 0b1..The GAIN_CAL value is valid. GAIN_CAL should be used by software to derive GCRa[GCALR]. - */ -#define ADC_GCC_RDY(x) (((uint32_t)(((uint32_t)(x)) << ADC_GCC_RDY_SHIFT)) & ADC_GCC_RDY_MASK) -/*! @} */ - -/* The count of ADC_GCC */ -#define ADC_GCC_COUNT (1U) - -/*! @name GCR - Gain Calculation Result */ -/*! @{ */ - -#define ADC_GCR_GCALR_MASK (0x1FFFFU) -#define ADC_GCR_GCALR_SHIFT (0U) -/*! GCALR - Gain Calculation Result */ -#define ADC_GCR_GCALR(x) (((uint32_t)(((uint32_t)(x)) << ADC_GCR_GCALR_SHIFT)) & ADC_GCR_GCALR_MASK) - -#define ADC_GCR_RDY_MASK (0x1000000U) -#define ADC_GCR_RDY_SHIFT (24U) -/*! RDY - Gain Calculation Ready - * 0b0..The GCALR value is invalid. - * 0b1..The GCALR value is valid. - */ -#define ADC_GCR_RDY(x) (((uint32_t)(((uint32_t)(x)) << ADC_GCR_RDY_SHIFT)) & ADC_GCR_RDY_MASK) -/*! @} */ - -/* The count of ADC_GCR */ -#define ADC_GCR_COUNT (1U) - -/*! @name CMDL - Command Low Buffer Register */ -/*! @{ */ - -#define ADC_CMDL_ADCH_MASK (0x1FU) -#define ADC_CMDL_ADCH_SHIFT (0U) -/*! ADCH - Input Channel Select - * 0b00000..Select CH0A. - * 0b00001..Select CH1A. - * 0b00010..Select CH2A. - * 0b00011..Select CH3A. - * 0b00100-0b11101..Select corresponding channel CHnA. - * 0b11110..Select CH30A. - * 0b11111..Select CH31A. - */ -#define ADC_CMDL_ADCH(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDL_ADCH_SHIFT)) & ADC_CMDL_ADCH_MASK) - -#define ADC_CMDL_CTYPE_MASK (0x60U) -#define ADC_CMDL_CTYPE_SHIFT (5U) -/*! CTYPE - Conversion Type - * 0b00..Single-Ended Mode. Only A side channel is converted. - * 0b01-0b11..Reserved. - */ -#define ADC_CMDL_CTYPE(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDL_CTYPE_SHIFT)) & ADC_CMDL_CTYPE_MASK) - -#define ADC_CMDL_MODE_MASK (0x80U) -#define ADC_CMDL_MODE_SHIFT (7U) -/*! MODE - Select Resolution of Conversions - * 0b0..Standard resolution. Single-ended 12-bit conversion. - * 0b1..High resolution. Single-ended 16-bit conversion. - */ -#define ADC_CMDL_MODE(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDL_MODE_SHIFT)) & ADC_CMDL_MODE_MASK) -/*! @} */ - -/* The count of ADC_CMDL */ -#define ADC_CMDL_COUNT (7U) - -/*! @name CMDH - Command High Buffer Register */ -/*! @{ */ - -#define ADC_CMDH_CMPEN_MASK (0x3U) -#define ADC_CMDH_CMPEN_SHIFT (0U) -/*! CMPEN - Compare Function Enable - * 0b00..Compare disabled. - * 0b01..Reserved - * 0b10..Compare enabled. Store on true. - * 0b11..Compare enabled. Repeat channel acquisition (sample/convert/compare) until true. - */ -#define ADC_CMDH_CMPEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_CMPEN_SHIFT)) & ADC_CMDH_CMPEN_MASK) - -#define ADC_CMDH_WAIT_TRIG_MASK (0x4U) -#define ADC_CMDH_WAIT_TRIG_SHIFT (2U) -/*! WAIT_TRIG - Wait for Trigger Assertion before Execution. - * 0b0..This command will be automatically executed. - * 0b1..The active trigger must be asserted again before executing this command. - */ -#define ADC_CMDH_WAIT_TRIG(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_WAIT_TRIG_SHIFT)) & ADC_CMDH_WAIT_TRIG_MASK) - -#define ADC_CMDH_LWI_MASK (0x80U) -#define ADC_CMDH_LWI_SHIFT (7U) -/*! LWI - Loop with Increment - * 0b0..Auto channel increment disabled - * 0b1..Auto channel increment enabled - */ -#define ADC_CMDH_LWI(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_LWI_SHIFT)) & ADC_CMDH_LWI_MASK) - -#define ADC_CMDH_STS_MASK (0x700U) -#define ADC_CMDH_STS_SHIFT (8U) -/*! STS - Sample Time Select - * 0b000..Minimum sample time of 3.5 ADCK cycles. - * 0b001..3.5 + 21 ADCK cycles; 5.5 ADCK cycles total sample time. - * 0b010..3.5 + 22 ADCK cycles; 7.5 ADCK cycles total sample time. - * 0b011..3.5 + 23 ADCK cycles; 11.5 ADCK cycles total sample time. - * 0b100..3.5 + 24 ADCK cycles; 19.5 ADCK cycles total sample time. - * 0b101..3.5 + 25 ADCK cycles; 35.5 ADCK cycles total sample time. - * 0b110..3.5 + 26 ADCK cycles; 67.5 ADCK cycles total sample time. - * 0b111..3.5 + 27 ADCK cycles; 131.5 ADCK cycles total sample time. - */ -#define ADC_CMDH_STS(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_STS_SHIFT)) & ADC_CMDH_STS_MASK) - -#define ADC_CMDH_AVGS_MASK (0xF000U) -#define ADC_CMDH_AVGS_SHIFT (12U) -/*! AVGS - Hardware Average Select - * 0b0000..Single conversion. - * 0b0001..2 conversions averaged. - * 0b0010..4 conversions averaged. - * 0b0011..8 conversions averaged. - * 0b0100..16 conversions averaged. - * 0b0101..32 conversions averaged. - * 0b0110..64 conversions averaged. - * 0b0111..128 conversions averaged. - * 0b1000..256 conversions averaged. - * 0b1001..512 conversions averaged. - * 0b1010..1024 conversions averaged. - */ -#define ADC_CMDH_AVGS(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_AVGS_SHIFT)) & ADC_CMDH_AVGS_MASK) - -#define ADC_CMDH_LOOP_MASK (0xF0000U) -#define ADC_CMDH_LOOP_SHIFT (16U) -/*! LOOP - Loop Count Select - * 0b0000..Looping not enabled. Command executes 1 time. - * 0b0001..Loop 1 time. Command executes 2 times. - * 0b0010..Loop 2 times. Command executes 3 times. - * 0b0011-0b1110..Loop corresponding number of times. Command executes LOOP+1 times. - * 0b1111..Loop 15 times. Command executes 16 times. - */ -#define ADC_CMDH_LOOP(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_LOOP_SHIFT)) & ADC_CMDH_LOOP_MASK) - -#define ADC_CMDH_NEXT_MASK (0x7000000U) -#define ADC_CMDH_NEXT_SHIFT (24U) -/*! NEXT - Next Command Select - * 0b000..No next command defined. Terminate conversions at completion of current command. If lower priority - * trigger pending, begin command associated with lower priority trigger. - * 0b001..Select CMD1 command buffer register as next command. - * 0b010-0b110..Select corresponding CMD command buffer register as next command - * 0b111..Select CMD7 command buffer register as next command. - */ -#define ADC_CMDH_NEXT(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_NEXT_SHIFT)) & ADC_CMDH_NEXT_MASK) -/*! @} */ - -/* The count of ADC_CMDH */ -#define ADC_CMDH_COUNT (7U) - -/*! @name CV - Compare Value Register */ -/*! @{ */ - -#define ADC_CV_CVL_MASK (0xFFFFU) -#define ADC_CV_CVL_SHIFT (0U) -/*! CVL - Compare Value Low */ -#define ADC_CV_CVL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CV_CVL_SHIFT)) & ADC_CV_CVL_MASK) - -#define ADC_CV_CVH_MASK (0xFFFF0000U) -#define ADC_CV_CVH_SHIFT (16U) -/*! CVH - Compare Value High */ -#define ADC_CV_CVH(x) (((uint32_t)(((uint32_t)(x)) << ADC_CV_CVH_SHIFT)) & ADC_CV_CVH_MASK) -/*! @} */ - -/* The count of ADC_CV */ -#define ADC_CV_COUNT (7U) - -/*! @name RESFIFO - Data Result FIFO Register */ -/*! @{ */ - -#define ADC_RESFIFO_D_MASK (0xFFFFU) -#define ADC_RESFIFO_D_SHIFT (0U) -/*! D - Data Result */ -#define ADC_RESFIFO_D(x) (((uint32_t)(((uint32_t)(x)) << ADC_RESFIFO_D_SHIFT)) & ADC_RESFIFO_D_MASK) - -#define ADC_RESFIFO_TSRC_MASK (0x30000U) -#define ADC_RESFIFO_TSRC_SHIFT (16U) -/*! TSRC - Trigger Source - * 0b00..Trigger source 0 initiated this conversion. - * 0b01..Trigger source 1 initiated this conversion. - * 0b10..Trigger source 2 initiated this conversion. - * 0b11..Trigger source 3 initiated this conversion. - */ -#define ADC_RESFIFO_TSRC(x) (((uint32_t)(((uint32_t)(x)) << ADC_RESFIFO_TSRC_SHIFT)) & ADC_RESFIFO_TSRC_MASK) - -#define ADC_RESFIFO_LOOPCNT_MASK (0xF00000U) -#define ADC_RESFIFO_LOOPCNT_SHIFT (20U) -/*! LOOPCNT - Loop Count Value - * 0b0000..Result is from initial conversion in command. - * 0b0001..Result is from second conversion in command. - * 0b0010-0b1110..Result is from LOOPCNT+1 conversion in command. - * 0b1111..Result is from 16th conversion in command. - */ -#define ADC_RESFIFO_LOOPCNT(x) (((uint32_t)(((uint32_t)(x)) << ADC_RESFIFO_LOOPCNT_SHIFT)) & ADC_RESFIFO_LOOPCNT_MASK) - -#define ADC_RESFIFO_CMDSRC_MASK (0x7000000U) -#define ADC_RESFIFO_CMDSRC_SHIFT (24U) -/*! CMDSRC - Command Buffer Source - * 0b000..Not a valid value CMDSRC value for a dataword in RESFIFO. 0x0 is only found in initial FIFO state prior - * to an ADC conversion result dataword being stored to a RESFIFO buffer. - * 0b001..CMD1 buffer used as control settings for this conversion. - * 0b010-0b110..Corresponding command buffer used as control settings for this conversion. - * 0b111..CMD7 buffer used as control settings for this conversion. - */ -#define ADC_RESFIFO_CMDSRC(x) (((uint32_t)(((uint32_t)(x)) << ADC_RESFIFO_CMDSRC_SHIFT)) & ADC_RESFIFO_CMDSRC_MASK) - -#define ADC_RESFIFO_VALID_MASK (0x80000000U) -#define ADC_RESFIFO_VALID_SHIFT (31U) -/*! VALID - FIFO Entry is Valid - * 0b0..FIFO is empty. Discard any read from RESFIFO. - * 0b1..FIFO record read from RESFIFO is valid. - */ -#define ADC_RESFIFO_VALID(x) (((uint32_t)(((uint32_t)(x)) << ADC_RESFIFO_VALID_SHIFT)) & ADC_RESFIFO_VALID_MASK) -/*! @} */ - -/*! @name CAL_GAR0 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR0_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR0_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR0_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR0_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR0_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR1 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR1_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR1_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR1_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR1_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR1_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR2 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR2_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR2_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR2_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR2_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR2_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR3 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR3_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR3_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR3_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR3_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR3_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR4 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR4_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR4_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR4_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR4_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR4_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR5 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR5_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR5_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR5_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR5_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR5_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR6 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR6_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR6_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR6_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR6_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR6_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR7 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR7_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR7_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR7_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR7_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR7_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR8 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR8_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR8_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR8_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR8_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR8_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR9 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR9_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR9_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR9_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR9_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR9_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR10 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR10_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR10_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR10_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR10_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR10_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR11 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR11_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR11_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR11_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR11_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR11_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR12 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR12_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR12_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR12_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR12_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR12_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR13 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR13_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR13_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR13_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR13_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR13_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR14 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR14_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR14_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR14_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR14_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR14_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR15 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR15_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR15_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR15_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR15_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR15_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR16 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR16_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR16_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR16_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR16_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR16_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR17 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR17_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR17_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR17_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR17_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR17_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR18 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR18_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR18_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR18_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR18_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR18_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR19 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR19_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR19_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR19_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR19_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR19_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR20 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR20_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR20_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR20_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR20_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR20_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR21 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR21_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR21_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR21_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR21_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR21_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR22 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR22_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR22_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR22_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR22_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR22_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR23 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR23_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR23_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR23_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR23_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR23_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR24 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR24_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR24_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR24_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR24_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR24_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR25 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR25_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR25_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR25_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR25_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR25_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR26 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR26_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR26_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR26_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR26_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR26_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR27 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR27_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR27_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR27_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR27_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR27_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR28 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR28_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR28_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR28_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR28_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR28_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR29 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR29_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR29_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR29_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR29_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR29_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR30 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR30_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR30_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR30_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR30_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR30_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR31 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR31_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR31_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR31_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR31_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR31_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR32 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR32_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR32_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR32_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR32_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR32_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR33 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR33_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR33_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR33_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR33_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR33_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CFG2 - Configuration 2 Register */ -/*! @{ */ - -#define ADC_CFG2_JLEFT_MASK (0x100U) -#define ADC_CFG2_JLEFT_SHIFT (8U) -/*! JLEFT - Justified Left Enable register */ -#define ADC_CFG2_JLEFT(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG2_JLEFT_SHIFT)) & ADC_CFG2_JLEFT_MASK) - -#define ADC_CFG2_HS_MASK (0x200U) -#define ADC_CFG2_HS_SHIFT (9U) -/*! HS - High Speed Enable register - * 0b0..High speed conversion mode disabled - * 0b1..High speed conversion mode enabled - */ -#define ADC_CFG2_HS(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG2_HS_SHIFT)) & ADC_CFG2_HS_MASK) - -#define ADC_CFG2_HSEXTRA_MASK (0x400U) -#define ADC_CFG2_HSEXTRA_SHIFT (10U) -/*! HSEXTRA - High Speed Extra register - * 0b0..No extra cycle added - * 0b1..Extra cycle added - */ -#define ADC_CFG2_HSEXTRA(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG2_HSEXTRA_SHIFT)) & ADC_CFG2_HSEXTRA_MASK) - -#define ADC_CFG2_TUNE_MASK (0x3000U) -#define ADC_CFG2_TUNE_SHIFT (12U) -/*! TUNE - Tune Mode register */ -#define ADC_CFG2_TUNE(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG2_TUNE_SHIFT)) & ADC_CFG2_TUNE_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group ADC_Register_Masks */ - - -/* ADC - Peripheral instance base addresses */ -/** Peripheral ADC0 base address */ -#define ADC0_BASE (0x400AF000u) -/** Peripheral ADC0 base pointer */ -#define ADC0 ((ADC_Type *)ADC0_BASE) -/** Peripheral ADC1 base address */ -#define ADC1_BASE (0x400B0000u) -/** Peripheral ADC1 base pointer */ -#define ADC1 ((ADC_Type *)ADC1_BASE) -/** Array initializer of ADC peripheral base addresses */ -#define ADC_BASE_ADDRS { ADC0_BASE, ADC1_BASE } -/** Array initializer of ADC peripheral base pointers */ -#define ADC_BASE_PTRS { ADC0, ADC1 } -/** Interrupt vectors for the ADC peripheral type */ -#define ADC_IRQS { ADC0_IRQn, ADC1_IRQn } -/* Backward compatibility */ -#define ADC_CTRL_RSTFIFO_MASK ADC_CTRL_RSTFIFO0_MASK -#define ADC_CTRL_RSTFIFO_SHIFT ADC_CTRL_RSTFIFO0_SHIFT -#define ADC_CTRL_RSTFIFO(x) ADC_CTRL_RSTFIFO0(x) -#define ADC_STAT_RDY_MASK ADC_STAT_RDY0_MASK -#define ADC_STAT_RDY_SHIFT ADC_STAT_RDY0_SHIFT -#define ADC_STAT_RDY(x) ADC_STAT_RDY0(x) -#define ADC_STAT_FOF_MASK ADC_STAT_FOF0_MASK -#define ADC_STAT_FOF_SHIFT ADC_STAT_FOF0_SHIFT -#define ADC_STAT_FOF(x) ADC_STAT_FOF0(x) -#define ADC_IE_FWMIE_MASK ADC_IE_FWMIE0_MASK -#define ADC_IE_FWMIE_SHIFT ADC_IE_FWMIE0_SHIFT -#define ADC_IE_FWMIE(x) ADC_IE_FWMIE0(x) -#define ADC_IE_FOFIE_MASK ADC_IE_FOFIE0_MASK -#define ADC_IE_FOFIE_SHIFT ADC_IE_FOFIE0_SHIFT -#define ADC_IE_FOFIE(x) ADC_IE_FOFIE0(x) -#define ADC_DE_FWMDE_MASK ADC_DE_FWMDE0_MASK -#define ADC_DE_FWMDE_SHIFT ADC_DE_FWMDE0_SHIFT -#define ADC_DE_FWMDE(x) ADC_DE_FWMDE0(x) - - -/*! - * @} - */ /* end of group ADC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- AOI Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup AOI_Peripheral_Access_Layer AOI Peripheral Access Layer - * @{ - */ - -/** AOI - Register Layout Typedef */ -typedef struct { - struct { /* offset: 0x0, array step: 0x4 */ - __IO uint16_t BFCRT01; /**< Boolean Function Term 0 and 1 Configuration for EVENT0..Boolean Function Term 0 and 1 Configuration for EVENT3, array offset: 0x0, array step: 0x4 */ - __IO uint16_t BFCRT23; /**< Boolean Function Term 2 and 3 Configuration for EVENT0..Boolean Function Term 2 and 3 Configuration for EVENT3, array offset: 0x2, array step: 0x4 */ - } BFCRT[4]; -} AOI_Type; - -/* ---------------------------------------------------------------------------- - -- AOI Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup AOI_Register_Masks AOI Register Masks - * @{ - */ - -/*! @name BFCRT01 - Boolean Function Term 0 and 1 Configuration for EVENT0..Boolean Function Term 0 and 1 Configuration for EVENT3 */ -/*! @{ */ - -#define AOI_BFCRT01_PT1_DC_MASK (0x3U) -#define AOI_BFCRT01_PT1_DC_SHIFT (0U) -/*! PT1_DC - Product Term 1, Input D Configuration - * 0b00..Force input D to become 0 - * 0b01..Pass input D - * 0b10..Complement input D - * 0b11..Force input D to become 1 - */ -#define AOI_BFCRT01_PT1_DC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT01_PT1_DC_SHIFT)) & AOI_BFCRT01_PT1_DC_MASK) - -#define AOI_BFCRT01_PT1_CC_MASK (0xCU) -#define AOI_BFCRT01_PT1_CC_SHIFT (2U) -/*! PT1_CC - Product Term 1, Input C Configuration - * 0b00..Force input C to become 0 - * 0b01..Pass input C - * 0b10..Complement input C - * 0b11..Force input C to become 1 - */ -#define AOI_BFCRT01_PT1_CC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT01_PT1_CC_SHIFT)) & AOI_BFCRT01_PT1_CC_MASK) - -#define AOI_BFCRT01_PT1_BC_MASK (0x30U) -#define AOI_BFCRT01_PT1_BC_SHIFT (4U) -/*! PT1_BC - Product Term 1, Input B Configuration - * 0b00..Force input B to become 0 - * 0b01..Pass input B - * 0b10..Complement input B - * 0b11..Force input B to become 1 - */ -#define AOI_BFCRT01_PT1_BC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT01_PT1_BC_SHIFT)) & AOI_BFCRT01_PT1_BC_MASK) - -#define AOI_BFCRT01_PT1_AC_MASK (0xC0U) -#define AOI_BFCRT01_PT1_AC_SHIFT (6U) -/*! PT1_AC - Product Term 1, Input A Configuration - * 0b00..Force input A to become 0 - * 0b01..Pass input A - * 0b10..Complement input A - * 0b11..Force input A to become 1 - */ -#define AOI_BFCRT01_PT1_AC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT01_PT1_AC_SHIFT)) & AOI_BFCRT01_PT1_AC_MASK) - -#define AOI_BFCRT01_PT0_DC_MASK (0x300U) -#define AOI_BFCRT01_PT0_DC_SHIFT (8U) -/*! PT0_DC - Product Term 0, Input D Configuration - * 0b00..Force input D to become 0 - * 0b01..Pass input D - * 0b10..Complement input D - * 0b11..Force input D to become 1 - */ -#define AOI_BFCRT01_PT0_DC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT01_PT0_DC_SHIFT)) & AOI_BFCRT01_PT0_DC_MASK) - -#define AOI_BFCRT01_PT0_CC_MASK (0xC00U) -#define AOI_BFCRT01_PT0_CC_SHIFT (10U) -/*! PT0_CC - Product Term 0, Input C Configuration - * 0b00..Force input C to become 0 - * 0b01..Pass input C - * 0b10..Complement input C - * 0b11..Force input C to become 1 - */ -#define AOI_BFCRT01_PT0_CC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT01_PT0_CC_SHIFT)) & AOI_BFCRT01_PT0_CC_MASK) - -#define AOI_BFCRT01_PT0_BC_MASK (0x3000U) -#define AOI_BFCRT01_PT0_BC_SHIFT (12U) -/*! PT0_BC - Product Term 0, Input B Configuration - * 0b00..Force input B to become 0 - * 0b01..Pass input B - * 0b10..Complement input B - * 0b11..Force input B to become 1 - */ -#define AOI_BFCRT01_PT0_BC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT01_PT0_BC_SHIFT)) & AOI_BFCRT01_PT0_BC_MASK) - -#define AOI_BFCRT01_PT0_AC_MASK (0xC000U) -#define AOI_BFCRT01_PT0_AC_SHIFT (14U) -/*! PT0_AC - Product Term 0, Input A Configuration - * 0b00..Force input A to become 0 - * 0b01..Pass input A - * 0b10..Complement input A - * 0b11..Force input A to become 1 - */ -#define AOI_BFCRT01_PT0_AC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT01_PT0_AC_SHIFT)) & AOI_BFCRT01_PT0_AC_MASK) -/*! @} */ - -/* The count of AOI_BFCRT01 */ -#define AOI_BFCRT01_COUNT (4U) - -/*! @name BFCRT23 - Boolean Function Term 2 and 3 Configuration for EVENT0..Boolean Function Term 2 and 3 Configuration for EVENT3 */ -/*! @{ */ - -#define AOI_BFCRT23_PT3_DC_MASK (0x3U) -#define AOI_BFCRT23_PT3_DC_SHIFT (0U) -/*! PT3_DC - Product Term 3, Input D Configuration - * 0b00..Force input D to become 0 - * 0b01..Pass input D - * 0b10..Complement input D - * 0b11..Force input D to become 1 - */ -#define AOI_BFCRT23_PT3_DC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT23_PT3_DC_SHIFT)) & AOI_BFCRT23_PT3_DC_MASK) - -#define AOI_BFCRT23_PT3_CC_MASK (0xCU) -#define AOI_BFCRT23_PT3_CC_SHIFT (2U) -/*! PT3_CC - Product Term 3, Input C Configuration - * 0b00..Force input C to become 0 - * 0b01..Pass input C - * 0b10..Complement input C - * 0b11..Force input C to become 1 - */ -#define AOI_BFCRT23_PT3_CC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT23_PT3_CC_SHIFT)) & AOI_BFCRT23_PT3_CC_MASK) - -#define AOI_BFCRT23_PT3_BC_MASK (0x30U) -#define AOI_BFCRT23_PT3_BC_SHIFT (4U) -/*! PT3_BC - Product Term 3, Input B Configuration - * 0b00..Force input B to become 0 - * 0b01..Pass input B - * 0b10..Complement input B - * 0b11..Force input B to become 1 - */ -#define AOI_BFCRT23_PT3_BC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT23_PT3_BC_SHIFT)) & AOI_BFCRT23_PT3_BC_MASK) - -#define AOI_BFCRT23_PT3_AC_MASK (0xC0U) -#define AOI_BFCRT23_PT3_AC_SHIFT (6U) -/*! PT3_AC - Product Term 3, Input A Configuration - * 0b00..Force input A to become 0 - * 0b01..Pass input A - * 0b10..Complement input A - * 0b11..Force input to become 1 - */ -#define AOI_BFCRT23_PT3_AC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT23_PT3_AC_SHIFT)) & AOI_BFCRT23_PT3_AC_MASK) - -#define AOI_BFCRT23_PT2_DC_MASK (0x300U) -#define AOI_BFCRT23_PT2_DC_SHIFT (8U) -/*! PT2_DC - Product Term 2, Input D Configuration - * 0b00..Force input D to become 0 - * 0b01..Pass input D - * 0b10..Complement input D - * 0b11..Force input D to become 1 - */ -#define AOI_BFCRT23_PT2_DC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT23_PT2_DC_SHIFT)) & AOI_BFCRT23_PT2_DC_MASK) - -#define AOI_BFCRT23_PT2_CC_MASK (0xC00U) -#define AOI_BFCRT23_PT2_CC_SHIFT (10U) -/*! PT2_CC - Product Term 2, Input C Configuration - * 0b00..Force input C to become 0 - * 0b01..Pass input C - * 0b10..Complement input C - * 0b11..Force input C to become 1 - */ -#define AOI_BFCRT23_PT2_CC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT23_PT2_CC_SHIFT)) & AOI_BFCRT23_PT2_CC_MASK) - -#define AOI_BFCRT23_PT2_BC_MASK (0x3000U) -#define AOI_BFCRT23_PT2_BC_SHIFT (12U) -/*! PT2_BC - Product Term 2, Input B Configuration - * 0b00..Force input B to become 0 - * 0b01..Pass input B - * 0b10..Complement input B - * 0b11..Force input B to become 1 - */ -#define AOI_BFCRT23_PT2_BC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT23_PT2_BC_SHIFT)) & AOI_BFCRT23_PT2_BC_MASK) - -#define AOI_BFCRT23_PT2_AC_MASK (0xC000U) -#define AOI_BFCRT23_PT2_AC_SHIFT (14U) -/*! PT2_AC - Product Term 2, Input A Configuration - * 0b00..Force input A to become 0 - * 0b01..Pass input A - * 0b10..Complement input A - * 0b11..Force input A to become 1 - */ -#define AOI_BFCRT23_PT2_AC(x) (((uint16_t)(((uint16_t)(x)) << AOI_BFCRT23_PT2_AC_SHIFT)) & AOI_BFCRT23_PT2_AC_MASK) -/*! @} */ - -/* The count of AOI_BFCRT23 */ -#define AOI_BFCRT23_COUNT (4U) - - -/*! - * @} - */ /* end of group AOI_Register_Masks */ - - -/* AOI - Peripheral instance base addresses */ -/** Peripheral AOI0 base address */ -#define AOI0_BASE (0x40089000u) -/** Peripheral AOI0 base pointer */ -#define AOI0 ((AOI_Type *)AOI0_BASE) -/** Peripheral AOI1 base address */ -#define AOI1_BASE (0x40097000u) -/** Peripheral AOI1 base pointer */ -#define AOI1 ((AOI_Type *)AOI1_BASE) -/** Array initializer of AOI peripheral base addresses */ -#define AOI_BASE_ADDRS { AOI0_BASE, AOI1_BASE } -/** Array initializer of AOI peripheral base pointers */ -#define AOI_BASE_PTRS { AOI0, AOI1 } - -/*! - * @} - */ /* end of group AOI_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- CAN Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CAN_Peripheral_Access_Layer CAN Peripheral Access Layer - * @{ - */ - -/** CAN - Register Layout Typedef */ -typedef struct { - __IO uint32_t MCR; /**< Module Configuration, offset: 0x0 */ - __IO uint32_t CTRL1; /**< Control 1, offset: 0x4 */ - __IO uint32_t TIMER; /**< Free-Running Timer, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __IO uint32_t RXMGMASK; /**< RX Message Buffers Global Mask, offset: 0x10 */ - __IO uint32_t RX14MASK; /**< Receive 14 Mask, offset: 0x14 */ - __IO uint32_t RX15MASK; /**< Receive 15 Mask, offset: 0x18 */ - __IO uint32_t ECR; /**< Error Counter, offset: 0x1C */ - __IO uint32_t ESR1; /**< Error and Status 1, offset: 0x20 */ - uint8_t RESERVED_1[4]; - __IO uint32_t IMASK1; /**< Interrupt Masks 1, offset: 0x28 */ - uint8_t RESERVED_2[4]; - __IO uint32_t IFLAG1; /**< Interrupt Flags 1, offset: 0x30 */ - __IO uint32_t CTRL2; /**< Control 2, offset: 0x34 */ - __I uint32_t ESR2; /**< Error and Status 2, offset: 0x38 */ - uint8_t RESERVED_3[8]; - __I uint32_t CRCR; /**< Cyclic Redundancy Check, offset: 0x44 */ - __IO uint32_t RXFGMASK; /**< Legacy RX FIFO Global Mask, offset: 0x48 */ - __I uint32_t RXFIR; /**< Legacy RX FIFO Information, offset: 0x4C */ - __IO uint32_t CBT; /**< CAN Bit Timing, offset: 0x50 */ - uint8_t RESERVED_4[44]; - union { /* offset: 0x80 */ - struct { /* offset: 0x80, array step: 0x10 */ - __IO uint32_t CS; /**< Message Buffer 0 CS Register..Message Buffer 31 CS Register, array offset: 0x80, array step: 0x10 */ - __IO uint32_t ID; /**< Message Buffer 0 ID Register..Message Buffer 31 ID Register, array offset: 0x84, array step: 0x10 */ - __IO uint32_t WORD[2]; /**< Message Buffer 0 WORD_8B Register..Message Buffer 31 WORD_8B Register, array offset: 0x88, array step: index*0x10, index2*0x4 */ - } MB_8B[32]; - struct { /* offset: 0x80, array step: 0x18 */ - __IO uint32_t CS; /**< Message Buffer 0 CS Register..Message Buffer 20 CS Register, array offset: 0x80, array step: 0x18 */ - __IO uint32_t ID; /**< Message Buffer 0 ID Register..Message Buffer 20 ID Register, array offset: 0x84, array step: 0x18 */ - __IO uint32_t WORD[4]; /**< Message Buffer 0 WORD_16B Register..Message Buffer 20 WORD_16B Register, array offset: 0x88, array step: index*0x18, index2*0x4 */ - } MB_16B[21]; - struct { /* offset: 0x80, array step: 0x28 */ - __IO uint32_t CS; /**< Message Buffer 0 CS Register..Message Buffer 11 CS Register, array offset: 0x80, array step: 0x28 */ - __IO uint32_t ID; /**< Message Buffer 0 ID Register..Message Buffer 11 ID Register, array offset: 0x84, array step: 0x28 */ - __IO uint32_t WORD[8]; /**< Message Buffer 0 WORD_32B Register..Message Buffer 11 WORD_32B Register, array offset: 0x88, array step: index*0x28, index2*0x4 */ - } MB_32B[12]; - struct { /* offset: 0x80, array step: 0x48 */ - __IO uint32_t CS; /**< Message Buffer 0 CS Register..Message Buffer 6 CS Register, array offset: 0x80, array step: 0x48 */ - __IO uint32_t ID; /**< Message Buffer 0 ID Register..Message Buffer 6 ID Register, array offset: 0x84, array step: 0x48 */ - __IO uint32_t WORD[16]; /**< Message Buffer 0 WORD_64B Register..Message Buffer 6 WORD_64B Register, array offset: 0x88, array step: index*0x48, index2*0x4 */ - } MB_64B[7]; - struct { /* offset: 0x80, array step: 0x10 */ - __IO uint32_t CS; /**< Message Buffer 0 CS Register..Message Buffer 31 CS Register, array offset: 0x80, array step: 0x10 */ - __IO uint32_t ID; /**< Message Buffer 0 ID Register..Message Buffer 31 ID Register, array offset: 0x84, array step: 0x10 */ - __IO uint32_t WORD0; /**< Message Buffer 0 WORD0 Register..Message Buffer 31 WORD0 Register, array offset: 0x88, array step: 0x10 */ - __IO uint32_t WORD1; /**< Message Buffer 0 WORD1 Register..Message Buffer 31 WORD1 Register, array offset: 0x8C, array step: 0x10 */ - } MB[32]; - }; - uint8_t RESERVED_5[1536]; - __IO uint32_t RXIMR[32]; /**< Receive Individual Mask, array offset: 0x880, array step: 0x4 */ - uint8_t RESERVED_6[512]; - __IO uint32_t CTRL1_PN; /**< Pretended Networking Control 1, offset: 0xB00 */ - __IO uint32_t CTRL2_PN; /**< Pretended Networking Control 2, offset: 0xB04 */ - __IO uint32_t WU_MTC; /**< Pretended Networking Wake-Up Match, offset: 0xB08 */ - __IO uint32_t FLT_ID1; /**< Pretended Networking ID Filter 1, offset: 0xB0C */ - __IO uint32_t FLT_DLC; /**< Pretended Networking Data Length Code (DLC) Filter, offset: 0xB10 */ - __IO uint32_t PL1_LO; /**< Pretended Networking Payload Low Filter 1, offset: 0xB14 */ - __IO uint32_t PL1_HI; /**< Pretended Networking Payload High Filter 1, offset: 0xB18 */ - __IO uint32_t FLT_ID2_IDMASK; /**< Pretended Networking ID Filter 2 or ID Mask, offset: 0xB1C */ - __IO uint32_t PL2_PLMASK_LO; /**< Pretended Networking Payload Low Filter 2 and Payload Low Mask, offset: 0xB20 */ - __IO uint32_t PL2_PLMASK_HI; /**< Pretended Networking Payload High Filter 2 and Payload High Mask, offset: 0xB24 */ - uint8_t RESERVED_7[24]; - struct { /* offset: 0xB40, array step: 0x10 */ - __I uint32_t CS; /**< Wake-Up Message Buffer, array offset: 0xB40, array step: 0x10 */ - __I uint32_t ID; /**< Wake-Up Message Buffer for ID, array offset: 0xB44, array step: 0x10 */ - __I uint32_t D03; /**< Wake-Up Message Buffer for Data 0-3, array offset: 0xB48, array step: 0x10 */ - __I uint32_t D47; /**< Wake-Up Message Buffer Register Data 4-7, array offset: 0xB4C, array step: 0x10 */ - } WMB[4]; - uint8_t RESERVED_8[112]; - __IO uint32_t EPRS; /**< Enhanced CAN Bit Timing Prescalers, offset: 0xBF0 */ - __IO uint32_t ENCBT; /**< Enhanced Nominal CAN Bit Timing, offset: 0xBF4 */ - __IO uint32_t EDCBT; /**< Enhanced Data Phase CAN Bit Timing, offset: 0xBF8 */ - __IO uint32_t ETDC; /**< Enhanced Transceiver Delay Compensation, offset: 0xBFC */ - __IO uint32_t FDCTRL; /**< CAN FD Control, offset: 0xC00 */ - __IO uint32_t FDCBT; /**< CAN FD Bit Timing, offset: 0xC04 */ - __I uint32_t FDCRC; /**< CAN FD CRC, offset: 0xC08 */ - __IO uint32_t ERFCR; /**< Enhanced RX FIFO Control, offset: 0xC0C */ - __IO uint32_t ERFIER; /**< Enhanced RX FIFO Interrupt Enable, offset: 0xC10 */ - __IO uint32_t ERFSR; /**< Enhanced RX FIFO Status, offset: 0xC14 */ - uint8_t RESERVED_9[9192]; - __IO uint32_t ERFFEL[32]; /**< Enhanced RX FIFO Filter Element, array offset: 0x3000, array step: 0x4 */ -} CAN_Type; - -/* ---------------------------------------------------------------------------- - -- CAN Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CAN_Register_Masks CAN Register Masks - * @{ - */ - -/*! @name MCR - Module Configuration */ -/*! @{ */ - -#define CAN_MCR_MAXMB_MASK (0x7FU) -#define CAN_MCR_MAXMB_SHIFT (0U) -/*! MAXMB - Number of the Last Message Buffer */ -#define CAN_MCR_MAXMB(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_MAXMB_SHIFT)) & CAN_MCR_MAXMB_MASK) - -#define CAN_MCR_IDAM_MASK (0x300U) -#define CAN_MCR_IDAM_SHIFT (8U) -/*! IDAM - ID Acceptance Mode - * 0b00..Format A: One full ID (standard and extended) per ID filter table element. - * 0b01..Format B: Two full standard IDs or two partial 14-bit (standard and extended) IDs per ID filter table element. - * 0b10..Format C: Four partial 8-bit standard IDs per ID filter table element. - * 0b11..Format D: All frames rejected. - */ -#define CAN_MCR_IDAM(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_IDAM_SHIFT)) & CAN_MCR_IDAM_MASK) - -#define CAN_MCR_FDEN_MASK (0x800U) -#define CAN_MCR_FDEN_SHIFT (11U) -/*! FDEN - CAN FD Operation Enable - * 0b1..Enable - * 0b0..Disable - */ -#define CAN_MCR_FDEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_FDEN_SHIFT)) & CAN_MCR_FDEN_MASK) - -#define CAN_MCR_AEN_MASK (0x1000U) -#define CAN_MCR_AEN_SHIFT (12U) -/*! AEN - Abort Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define CAN_MCR_AEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_AEN_SHIFT)) & CAN_MCR_AEN_MASK) - -#define CAN_MCR_LPRIOEN_MASK (0x2000U) -#define CAN_MCR_LPRIOEN_SHIFT (13U) -/*! LPRIOEN - Local Priority Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_LPRIOEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_LPRIOEN_SHIFT)) & CAN_MCR_LPRIOEN_MASK) - -#define CAN_MCR_PNET_EN_MASK (0x4000U) -#define CAN_MCR_PNET_EN_SHIFT (14U) -/*! PNET_EN - Pretended Networking Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_PNET_EN(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_PNET_EN_SHIFT)) & CAN_MCR_PNET_EN_MASK) - -#define CAN_MCR_DMA_MASK (0x8000U) -#define CAN_MCR_DMA_SHIFT (15U) -/*! DMA - DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_DMA(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_DMA_SHIFT)) & CAN_MCR_DMA_MASK) - -#define CAN_MCR_IRMQ_MASK (0x10000U) -#define CAN_MCR_IRMQ_SHIFT (16U) -/*! IRMQ - Individual RX Masking and Queue Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_IRMQ(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_IRMQ_SHIFT)) & CAN_MCR_IRMQ_MASK) - -#define CAN_MCR_SRXDIS_MASK (0x20000U) -#define CAN_MCR_SRXDIS_SHIFT (17U) -/*! SRXDIS - Self-Reception Disable - * 0b0..Enable - * 0b1..Disable - */ -#define CAN_MCR_SRXDIS(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_SRXDIS_SHIFT)) & CAN_MCR_SRXDIS_MASK) - -#define CAN_MCR_DOZE_MASK (0x40000U) -#define CAN_MCR_DOZE_SHIFT (18U) -/*! DOZE - Doze Mode Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_DOZE(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_DOZE_SHIFT)) & CAN_MCR_DOZE_MASK) - -#define CAN_MCR_WAKSRC_MASK (0x80000U) -#define CAN_MCR_WAKSRC_SHIFT (19U) -/*! WAKSRC - Wake-Up Source - * 0b0..No filter applied - * 0b1..Filter applied - */ -#define CAN_MCR_WAKSRC(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_WAKSRC_SHIFT)) & CAN_MCR_WAKSRC_MASK) - -#define CAN_MCR_LPMACK_MASK (0x100000U) -#define CAN_MCR_LPMACK_SHIFT (20U) -/*! LPMACK - Low-Power Mode Acknowledge - * 0b0..Not in a low-power mode - * 0b1..In a low-power mode - */ -#define CAN_MCR_LPMACK(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_LPMACK_SHIFT)) & CAN_MCR_LPMACK_MASK) - -#define CAN_MCR_WRNEN_MASK (0x200000U) -#define CAN_MCR_WRNEN_SHIFT (21U) -/*! WRNEN - Warning Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_WRNEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_WRNEN_SHIFT)) & CAN_MCR_WRNEN_MASK) - -#define CAN_MCR_SLFWAK_MASK (0x400000U) -#define CAN_MCR_SLFWAK_SHIFT (22U) -/*! SLFWAK - Self Wake-up - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_SLFWAK(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_SLFWAK_SHIFT)) & CAN_MCR_SLFWAK_MASK) - -#define CAN_MCR_FRZACK_MASK (0x1000000U) -#define CAN_MCR_FRZACK_SHIFT (24U) -/*! FRZACK - Freeze Mode Acknowledge - * 0b0..Not in Freeze mode, prescaler running. - * 0b1..In Freeze mode, prescaler stopped. - */ -#define CAN_MCR_FRZACK(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_FRZACK_SHIFT)) & CAN_MCR_FRZACK_MASK) - -#define CAN_MCR_SOFTRST_MASK (0x2000000U) -#define CAN_MCR_SOFTRST_SHIFT (25U) -/*! SOFTRST - Soft Reset - * 0b0..No reset - * 0b1..Soft reset affects reset registers - */ -#define CAN_MCR_SOFTRST(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_SOFTRST_SHIFT)) & CAN_MCR_SOFTRST_MASK) - -#define CAN_MCR_WAKMSK_MASK (0x4000000U) -#define CAN_MCR_WAKMSK_SHIFT (26U) -/*! WAKMSK - Wake-up Interrupt Mask - * 0b0..Disabled - * 0b1..Enabled - */ -#define CAN_MCR_WAKMSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_WAKMSK_SHIFT)) & CAN_MCR_WAKMSK_MASK) - -#define CAN_MCR_NOTRDY_MASK (0x8000000U) -#define CAN_MCR_NOTRDY_SHIFT (27U) -/*! NOTRDY - FlexCAN Not Ready - * 0b0..FlexCAN is in Normal mode, Listen-Only mode, or Loopback mode. - * 0b1..FlexCAN is in Disable mode, Doze mode, Stop mode, or Freeze mode. - */ -#define CAN_MCR_NOTRDY(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_NOTRDY_SHIFT)) & CAN_MCR_NOTRDY_MASK) - -#define CAN_MCR_HALT_MASK (0x10000000U) -#define CAN_MCR_HALT_SHIFT (28U) -/*! HALT - Halt FlexCAN - * 0b0..No request - * 0b1..Enter Freeze mode, if MCR[FRZ] = 1. - */ -#define CAN_MCR_HALT(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_HALT_SHIFT)) & CAN_MCR_HALT_MASK) - -#define CAN_MCR_RFEN_MASK (0x20000000U) -#define CAN_MCR_RFEN_SHIFT (29U) -/*! RFEN - Legacy RX FIFO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_RFEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_RFEN_SHIFT)) & CAN_MCR_RFEN_MASK) - -#define CAN_MCR_FRZ_MASK (0x40000000U) -#define CAN_MCR_FRZ_SHIFT (30U) -/*! FRZ - Freeze Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_FRZ(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_FRZ_SHIFT)) & CAN_MCR_FRZ_MASK) - -#define CAN_MCR_MDIS_MASK (0x80000000U) -#define CAN_MCR_MDIS_SHIFT (31U) -/*! MDIS - Module Disable - * 0b0..Enable - * 0b1..Disable - */ -#define CAN_MCR_MDIS(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_MDIS_SHIFT)) & CAN_MCR_MDIS_MASK) -/*! @} */ - -/*! @name CTRL1 - Control 1 */ -/*! @{ */ - -#define CAN_CTRL1_PROPSEG_MASK (0x7U) -#define CAN_CTRL1_PROPSEG_SHIFT (0U) -/*! PROPSEG - Propagation Segment */ -#define CAN_CTRL1_PROPSEG(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PROPSEG_SHIFT)) & CAN_CTRL1_PROPSEG_MASK) - -#define CAN_CTRL1_LOM_MASK (0x8U) -#define CAN_CTRL1_LOM_SHIFT (3U) -/*! LOM - Listen-Only Mode - * 0b0..Listen-Only mode is deactivated. - * 0b1..FlexCAN module operates in Listen-Only mode. - */ -#define CAN_CTRL1_LOM(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_LOM_SHIFT)) & CAN_CTRL1_LOM_MASK) - -#define CAN_CTRL1_LBUF_MASK (0x10U) -#define CAN_CTRL1_LBUF_SHIFT (4U) -/*! LBUF - Lowest Buffer Transmitted First - * 0b0..Buffer with highest priority is transmitted first. - * 0b1..Lowest number buffer is transmitted first. - */ -#define CAN_CTRL1_LBUF(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_LBUF_SHIFT)) & CAN_CTRL1_LBUF_MASK) - -#define CAN_CTRL1_TSYN_MASK (0x20U) -#define CAN_CTRL1_TSYN_SHIFT (5U) -/*! TSYN - Timer Sync - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL1_TSYN(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_TSYN_SHIFT)) & CAN_CTRL1_TSYN_MASK) - -#define CAN_CTRL1_BOFFREC_MASK (0x40U) -#define CAN_CTRL1_BOFFREC_SHIFT (6U) -/*! BOFFREC - Bus Off Recovery - * 0b0..Enabled - * 0b1..Disabled - */ -#define CAN_CTRL1_BOFFREC(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_BOFFREC_SHIFT)) & CAN_CTRL1_BOFFREC_MASK) - -#define CAN_CTRL1_SMP_MASK (0x80U) -#define CAN_CTRL1_SMP_SHIFT (7U) -/*! SMP - CAN Bit Sampling - * 0b0..One sample is used to determine the bit value. - * 0b1..Three samples are used to determine the value of the received bit: the regular one (sample point) and two - * preceding samples. A majority rule is used. - */ -#define CAN_CTRL1_SMP(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_SMP_SHIFT)) & CAN_CTRL1_SMP_MASK) - -#define CAN_CTRL1_RWRNMSK_MASK (0x400U) -#define CAN_CTRL1_RWRNMSK_SHIFT (10U) -/*! RWRNMSK - RX Warning Interrupt Mask - * 0b0..Disabled - * 0b1..Enabled - */ -#define CAN_CTRL1_RWRNMSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_RWRNMSK_SHIFT)) & CAN_CTRL1_RWRNMSK_MASK) - -#define CAN_CTRL1_TWRNMSK_MASK (0x800U) -#define CAN_CTRL1_TWRNMSK_SHIFT (11U) -/*! TWRNMSK - TX Warning Interrupt Mask - * 0b0..Disabled - * 0b1..Enabled - */ -#define CAN_CTRL1_TWRNMSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_TWRNMSK_SHIFT)) & CAN_CTRL1_TWRNMSK_MASK) - -#define CAN_CTRL1_LPB_MASK (0x1000U) -#define CAN_CTRL1_LPB_SHIFT (12U) -/*! LPB - Loopback Mode - * 0b0..Disabled - * 0b1..Enabled - */ -#define CAN_CTRL1_LPB(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_LPB_SHIFT)) & CAN_CTRL1_LPB_MASK) - -#define CAN_CTRL1_ERRMSK_MASK (0x4000U) -#define CAN_CTRL1_ERRMSK_SHIFT (14U) -/*! ERRMSK - Error Interrupt Mask - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CAN_CTRL1_ERRMSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_ERRMSK_SHIFT)) & CAN_CTRL1_ERRMSK_MASK) - -#define CAN_CTRL1_BOFFMSK_MASK (0x8000U) -#define CAN_CTRL1_BOFFMSK_SHIFT (15U) -/*! BOFFMSK - Bus Off Interrupt Mask - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CAN_CTRL1_BOFFMSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_BOFFMSK_SHIFT)) & CAN_CTRL1_BOFFMSK_MASK) - -#define CAN_CTRL1_PSEG2_MASK (0x70000U) -#define CAN_CTRL1_PSEG2_SHIFT (16U) -/*! PSEG2 - Phase Segment 2 */ -#define CAN_CTRL1_PSEG2(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PSEG2_SHIFT)) & CAN_CTRL1_PSEG2_MASK) - -#define CAN_CTRL1_PSEG1_MASK (0x380000U) -#define CAN_CTRL1_PSEG1_SHIFT (19U) -/*! PSEG1 - Phase Segment 1 */ -#define CAN_CTRL1_PSEG1(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PSEG1_SHIFT)) & CAN_CTRL1_PSEG1_MASK) - -#define CAN_CTRL1_RJW_MASK (0xC00000U) -#define CAN_CTRL1_RJW_SHIFT (22U) -/*! RJW - Resync Jump Width */ -#define CAN_CTRL1_RJW(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_RJW_SHIFT)) & CAN_CTRL1_RJW_MASK) - -#define CAN_CTRL1_PRESDIV_MASK (0xFF000000U) -#define CAN_CTRL1_PRESDIV_SHIFT (24U) -/*! PRESDIV - Prescaler Division Factor */ -#define CAN_CTRL1_PRESDIV(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PRESDIV_SHIFT)) & CAN_CTRL1_PRESDIV_MASK) -/*! @} */ - -/*! @name TIMER - Free-Running Timer */ -/*! @{ */ - -#define CAN_TIMER_TIMER_MASK (0xFFFFU) -#define CAN_TIMER_TIMER_SHIFT (0U) -/*! TIMER - Timer Value */ -#define CAN_TIMER_TIMER(x) (((uint32_t)(((uint32_t)(x)) << CAN_TIMER_TIMER_SHIFT)) & CAN_TIMER_TIMER_MASK) -/*! @} */ - -/*! @name RXMGMASK - RX Message Buffers Global Mask */ -/*! @{ */ - -#define CAN_RXMGMASK_MG_MASK (0xFFFFFFFFU) -#define CAN_RXMGMASK_MG_SHIFT (0U) -/*! MG - Global Mask for RX Message Buffers */ -#define CAN_RXMGMASK_MG(x) (((uint32_t)(((uint32_t)(x)) << CAN_RXMGMASK_MG_SHIFT)) & CAN_RXMGMASK_MG_MASK) -/*! @} */ - -/*! @name RX14MASK - Receive 14 Mask */ -/*! @{ */ - -#define CAN_RX14MASK_RX14M_MASK (0xFFFFFFFFU) -#define CAN_RX14MASK_RX14M_SHIFT (0U) -/*! RX14M - RX Buffer 14 Mask Bits */ -#define CAN_RX14MASK_RX14M(x) (((uint32_t)(((uint32_t)(x)) << CAN_RX14MASK_RX14M_SHIFT)) & CAN_RX14MASK_RX14M_MASK) -/*! @} */ - -/*! @name RX15MASK - Receive 15 Mask */ -/*! @{ */ - -#define CAN_RX15MASK_RX15M_MASK (0xFFFFFFFFU) -#define CAN_RX15MASK_RX15M_SHIFT (0U) -/*! RX15M - RX Buffer 15 Mask Bits */ -#define CAN_RX15MASK_RX15M(x) (((uint32_t)(((uint32_t)(x)) << CAN_RX15MASK_RX15M_SHIFT)) & CAN_RX15MASK_RX15M_MASK) -/*! @} */ - -/*! @name ECR - Error Counter */ -/*! @{ */ - -#define CAN_ECR_TXERRCNT_MASK (0xFFU) -#define CAN_ECR_TXERRCNT_SHIFT (0U) -/*! TXERRCNT - Transmit Error Counter */ -#define CAN_ECR_TXERRCNT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ECR_TXERRCNT_SHIFT)) & CAN_ECR_TXERRCNT_MASK) - -#define CAN_ECR_RXERRCNT_MASK (0xFF00U) -#define CAN_ECR_RXERRCNT_SHIFT (8U) -/*! RXERRCNT - Receive Error Counter */ -#define CAN_ECR_RXERRCNT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ECR_RXERRCNT_SHIFT)) & CAN_ECR_RXERRCNT_MASK) - -#define CAN_ECR_TXERRCNT_FAST_MASK (0xFF0000U) -#define CAN_ECR_TXERRCNT_FAST_SHIFT (16U) -/*! TXERRCNT_FAST - Transmit Error Counter for Fast Bits */ -#define CAN_ECR_TXERRCNT_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ECR_TXERRCNT_FAST_SHIFT)) & CAN_ECR_TXERRCNT_FAST_MASK) - -#define CAN_ECR_RXERRCNT_FAST_MASK (0xFF000000U) -#define CAN_ECR_RXERRCNT_FAST_SHIFT (24U) -/*! RXERRCNT_FAST - Receive Error Counter for Fast Bits */ -#define CAN_ECR_RXERRCNT_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ECR_RXERRCNT_FAST_SHIFT)) & CAN_ECR_RXERRCNT_FAST_MASK) -/*! @} */ - -/*! @name ESR1 - Error and Status 1 */ -/*! @{ */ - -#define CAN_ESR1_WAKINT_MASK (0x1U) -#define CAN_ESR1_WAKINT_SHIFT (0U) -/*! WAKINT - Wake-up Interrupt Flag - * 0b0..No such occurrence. - * 0b1..Indicates that a recessive-to-dominant transition was received on the CAN bus. - */ -#define CAN_ESR1_WAKINT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_WAKINT_SHIFT)) & CAN_ESR1_WAKINT_MASK) - -#define CAN_ESR1_ERRINT_MASK (0x2U) -#define CAN_ESR1_ERRINT_SHIFT (1U) -/*! ERRINT - Error Interrupt Flag - * 0b0..No such occurrence. - * 0b1..Indicates setting of any error flag in the Error and Status register. - */ -#define CAN_ESR1_ERRINT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_ERRINT_SHIFT)) & CAN_ESR1_ERRINT_MASK) - -#define CAN_ESR1_BOFFINT_MASK (0x4U) -#define CAN_ESR1_BOFFINT_SHIFT (2U) -/*! BOFFINT - Bus Off Interrupt Flag - * 0b0..No such occurrence. - * 0b1..FlexCAN module entered Bus Off state. - */ -#define CAN_ESR1_BOFFINT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_BOFFINT_SHIFT)) & CAN_ESR1_BOFFINT_MASK) - -#define CAN_ESR1_RX_MASK (0x8U) -#define CAN_ESR1_RX_SHIFT (3U) -/*! RX - FlexCAN in Reception Flag - * 0b0..Not receiving - * 0b1..Receiving - */ -#define CAN_ESR1_RX(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_RX_SHIFT)) & CAN_ESR1_RX_MASK) - -#define CAN_ESR1_FLTCONF_MASK (0x30U) -#define CAN_ESR1_FLTCONF_SHIFT (4U) -/*! FLTCONF - Fault Confinement State - * 0b00..Error Active - * 0b01..Error Passive - * 0b1x..Bus Off - */ -#define CAN_ESR1_FLTCONF(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_FLTCONF_SHIFT)) & CAN_ESR1_FLTCONF_MASK) - -#define CAN_ESR1_TX_MASK (0x40U) -#define CAN_ESR1_TX_SHIFT (6U) -/*! TX - FlexCAN In Transmission - * 0b0..Not transmitting - * 0b1..Transmitting - */ -#define CAN_ESR1_TX(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_TX_SHIFT)) & CAN_ESR1_TX_MASK) - -#define CAN_ESR1_IDLE_MASK (0x80U) -#define CAN_ESR1_IDLE_SHIFT (7U) -/*! IDLE - Idle - * 0b0..Not IDLE - * 0b1..IDLE - */ -#define CAN_ESR1_IDLE(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_IDLE_SHIFT)) & CAN_ESR1_IDLE_MASK) - -#define CAN_ESR1_RXWRN_MASK (0x100U) -#define CAN_ESR1_RXWRN_SHIFT (8U) -/*! RXWRN - RX Error Warning Flag - * 0b0..No such occurrence. - * 0b1..RXERRCNT is greater than or equal to 96. - */ -#define CAN_ESR1_RXWRN(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_RXWRN_SHIFT)) & CAN_ESR1_RXWRN_MASK) - -#define CAN_ESR1_TXWRN_MASK (0x200U) -#define CAN_ESR1_TXWRN_SHIFT (9U) -/*! TXWRN - TX Error Warning Flag - * 0b0..No such occurrence. - * 0b1..TXERRCNT is 96 or greater. - */ -#define CAN_ESR1_TXWRN(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_TXWRN_SHIFT)) & CAN_ESR1_TXWRN_MASK) - -#define CAN_ESR1_STFERR_MASK (0x400U) -#define CAN_ESR1_STFERR_SHIFT (10U) -/*! STFERR - Stuffing Error Flag - * 0b0..No error - * 0b1..Error occurred since last read of this register. - */ -#define CAN_ESR1_STFERR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_STFERR_SHIFT)) & CAN_ESR1_STFERR_MASK) - -#define CAN_ESR1_FRMERR_MASK (0x800U) -#define CAN_ESR1_FRMERR_SHIFT (11U) -/*! FRMERR - Form Error Flag - * 0b0..No error - * 0b1..Error occurred since last read of this register. - */ -#define CAN_ESR1_FRMERR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_FRMERR_SHIFT)) & CAN_ESR1_FRMERR_MASK) - -#define CAN_ESR1_CRCERR_MASK (0x1000U) -#define CAN_ESR1_CRCERR_SHIFT (12U) -/*! CRCERR - Cyclic Redundancy Check Error Flag - * 0b0..No error - * 0b1..Error occurred since last read of this register. - */ -#define CAN_ESR1_CRCERR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_CRCERR_SHIFT)) & CAN_ESR1_CRCERR_MASK) - -#define CAN_ESR1_ACKERR_MASK (0x2000U) -#define CAN_ESR1_ACKERR_SHIFT (13U) -/*! ACKERR - Acknowledge Error Flag - * 0b0..No error - * 0b1..Error occurred since last read of this register. - */ -#define CAN_ESR1_ACKERR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_ACKERR_SHIFT)) & CAN_ESR1_ACKERR_MASK) - -#define CAN_ESR1_BIT0ERR_MASK (0x4000U) -#define CAN_ESR1_BIT0ERR_SHIFT (14U) -/*! BIT0ERR - Bit0 Error Flag - * 0b0..No such occurrence. - * 0b1..At least one bit sent as dominant is received as recessive. - */ -#define CAN_ESR1_BIT0ERR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_BIT0ERR_SHIFT)) & CAN_ESR1_BIT0ERR_MASK) - -#define CAN_ESR1_BIT1ERR_MASK (0x8000U) -#define CAN_ESR1_BIT1ERR_SHIFT (15U) -/*! BIT1ERR - Bit1 Error Flag - * 0b0..No such occurrence. - * 0b1..At least one bit sent as recessive is received as dominant. - */ -#define CAN_ESR1_BIT1ERR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_BIT1ERR_SHIFT)) & CAN_ESR1_BIT1ERR_MASK) - -#define CAN_ESR1_RWRNINT_MASK (0x10000U) -#define CAN_ESR1_RWRNINT_SHIFT (16U) -/*! RWRNINT - RX Warning Interrupt Flag - * 0b0..No such occurrence - * 0b1..RX error counter changed from less than 96 to greater than or equal to 96. - */ -#define CAN_ESR1_RWRNINT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_RWRNINT_SHIFT)) & CAN_ESR1_RWRNINT_MASK) - -#define CAN_ESR1_TWRNINT_MASK (0x20000U) -#define CAN_ESR1_TWRNINT_SHIFT (17U) -/*! TWRNINT - TX Warning Interrupt Flag - * 0b0..No such occurrence - * 0b1..TX error counter changed from less than 96 to greater than or equal to 96. - */ -#define CAN_ESR1_TWRNINT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_TWRNINT_SHIFT)) & CAN_ESR1_TWRNINT_MASK) - -#define CAN_ESR1_SYNCH_MASK (0x40000U) -#define CAN_ESR1_SYNCH_SHIFT (18U) -/*! SYNCH - CAN Synchronization Status Flag - * 0b0..Not synchronized - * 0b1..Synchronized - */ -#define CAN_ESR1_SYNCH(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_SYNCH_SHIFT)) & CAN_ESR1_SYNCH_MASK) - -#define CAN_ESR1_BOFFDONEINT_MASK (0x80000U) -#define CAN_ESR1_BOFFDONEINT_SHIFT (19U) -/*! BOFFDONEINT - Bus Off Done Interrupt Flag - * 0b0..No such occurrence - * 0b1..FlexCAN module has completed Bus Off process. - */ -#define CAN_ESR1_BOFFDONEINT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_BOFFDONEINT_SHIFT)) & CAN_ESR1_BOFFDONEINT_MASK) - -#define CAN_ESR1_ERRINT_FAST_MASK (0x100000U) -#define CAN_ESR1_ERRINT_FAST_SHIFT (20U) -/*! ERRINT_FAST - Fast Error Interrupt Flag - * 0b0..No such occurrence. - * 0b1..Error flag set in the data phase of CAN FD frames that have BRS = 1. - */ -#define CAN_ESR1_ERRINT_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_ERRINT_FAST_SHIFT)) & CAN_ESR1_ERRINT_FAST_MASK) - -#define CAN_ESR1_ERROVR_MASK (0x200000U) -#define CAN_ESR1_ERROVR_SHIFT (21U) -/*! ERROVR - Error Overrun Flag - * 0b0..No overrun - * 0b1..Overrun - */ -#define CAN_ESR1_ERROVR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_ERROVR_SHIFT)) & CAN_ESR1_ERROVR_MASK) - -#define CAN_ESR1_STFERR_FAST_MASK (0x4000000U) -#define CAN_ESR1_STFERR_FAST_SHIFT (26U) -/*! STFERR_FAST - Fast Stuffing Error Flag - * 0b0..No such occurrence. - * 0b1..A stuffing error occurred since last read of this register. - */ -#define CAN_ESR1_STFERR_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_STFERR_FAST_SHIFT)) & CAN_ESR1_STFERR_FAST_MASK) - -#define CAN_ESR1_FRMERR_FAST_MASK (0x8000000U) -#define CAN_ESR1_FRMERR_FAST_SHIFT (27U) -/*! FRMERR_FAST - Fast Form Error Flag - * 0b0..No such occurrence. - * 0b1..A form error occurred since last read of this register. - */ -#define CAN_ESR1_FRMERR_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_FRMERR_FAST_SHIFT)) & CAN_ESR1_FRMERR_FAST_MASK) - -#define CAN_ESR1_CRCERR_FAST_MASK (0x10000000U) -#define CAN_ESR1_CRCERR_FAST_SHIFT (28U) -/*! CRCERR_FAST - Fast Cyclic Redundancy Check Error Flag - * 0b0..No such occurrence. - * 0b1..A CRC error occurred since last read of this register. - */ -#define CAN_ESR1_CRCERR_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_CRCERR_FAST_SHIFT)) & CAN_ESR1_CRCERR_FAST_MASK) - -#define CAN_ESR1_BIT0ERR_FAST_MASK (0x40000000U) -#define CAN_ESR1_BIT0ERR_FAST_SHIFT (30U) -/*! BIT0ERR_FAST - Fast Bit0 Error Flag - * 0b0..No such occurrence. - * 0b1..At least one bit transmitted as dominant is received as recessive. - */ -#define CAN_ESR1_BIT0ERR_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_BIT0ERR_FAST_SHIFT)) & CAN_ESR1_BIT0ERR_FAST_MASK) - -#define CAN_ESR1_BIT1ERR_FAST_MASK (0x80000000U) -#define CAN_ESR1_BIT1ERR_FAST_SHIFT (31U) -/*! BIT1ERR_FAST - Fast Bit1 Error Flag - * 0b0..No such occurrence. - * 0b1..At least one bit transmitted as recessive is received as dominant. - */ -#define CAN_ESR1_BIT1ERR_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_BIT1ERR_FAST_SHIFT)) & CAN_ESR1_BIT1ERR_FAST_MASK) -/*! @} */ - -/*! @name IMASK1 - Interrupt Masks 1 */ -/*! @{ */ - -#define CAN_IMASK1_BUF31TO0M_MASK (0xFFFFFFFFU) -#define CAN_IMASK1_BUF31TO0M_SHIFT (0U) -/*! BUF31TO0M - Buffer MBi Mask */ -#define CAN_IMASK1_BUF31TO0M(x) (((uint32_t)(((uint32_t)(x)) << CAN_IMASK1_BUF31TO0M_SHIFT)) & CAN_IMASK1_BUF31TO0M_MASK) -/*! @} */ - -/*! @name IFLAG1 - Interrupt Flags 1 */ -/*! @{ */ - -#define CAN_IFLAG1_BUF0I_MASK (0x1U) -#define CAN_IFLAG1_BUF0I_SHIFT (0U) -/*! BUF0I - Buffer MB0 Interrupt or Clear Legacy FIFO bit - * 0b0..MB0 has no occurrence of successfully completed transmission or reception. - * 0b1..MB0 has successfully completed transmission or reception. - */ -#define CAN_IFLAG1_BUF0I(x) (((uint32_t)(((uint32_t)(x)) << CAN_IFLAG1_BUF0I_SHIFT)) & CAN_IFLAG1_BUF0I_MASK) - -#define CAN_IFLAG1_BUF4TO1I_MASK (0x1EU) -#define CAN_IFLAG1_BUF4TO1I_SHIFT (1U) -/*! BUF4TO1I - Buffer MBi Interrupt or Reserved */ -#define CAN_IFLAG1_BUF4TO1I(x) (((uint32_t)(((uint32_t)(x)) << CAN_IFLAG1_BUF4TO1I_SHIFT)) & CAN_IFLAG1_BUF4TO1I_MASK) - -#define CAN_IFLAG1_BUF5I_MASK (0x20U) -#define CAN_IFLAG1_BUF5I_SHIFT (5U) -/*! BUF5I - Buffer MB5 Interrupt or Frames available in Legacy RX FIFO - * 0b0..No occurrence of completed transmission or reception, or no frames available - * 0b1..MB5 completed transmission or reception, or frames available - */ -#define CAN_IFLAG1_BUF5I(x) (((uint32_t)(((uint32_t)(x)) << CAN_IFLAG1_BUF5I_SHIFT)) & CAN_IFLAG1_BUF5I_MASK) - -#define CAN_IFLAG1_BUF6I_MASK (0x40U) -#define CAN_IFLAG1_BUF6I_SHIFT (6U) -/*! BUF6I - Buffer MB6 Interrupt or Legacy RX FIFO Warning - * 0b0..No occurrence of MB6 completing transmission or reception, or FIFO not almost full. - * 0b1..MB6 completed transmission or reception, or FIFO almost full. - */ -#define CAN_IFLAG1_BUF6I(x) (((uint32_t)(((uint32_t)(x)) << CAN_IFLAG1_BUF6I_SHIFT)) & CAN_IFLAG1_BUF6I_MASK) - -#define CAN_IFLAG1_BUF7I_MASK (0x80U) -#define CAN_IFLAG1_BUF7I_SHIFT (7U) -/*! BUF7I - Buffer MB7 Interrupt or Legacy RX FIFO Overflow - * 0b0..No occurrence of MB7 completing transmission or reception, or no FIFO overflow. - * 0b1..MB7 completed transmission or reception, or FIFO overflow. - */ -#define CAN_IFLAG1_BUF7I(x) (((uint32_t)(((uint32_t)(x)) << CAN_IFLAG1_BUF7I_SHIFT)) & CAN_IFLAG1_BUF7I_MASK) - -#define CAN_IFLAG1_BUF31TO8I_MASK (0xFFFFFF00U) -#define CAN_IFLAG1_BUF31TO8I_SHIFT (8U) -/*! BUF31TO8I - Buffer MBi Interrupt */ -#define CAN_IFLAG1_BUF31TO8I(x) (((uint32_t)(((uint32_t)(x)) << CAN_IFLAG1_BUF31TO8I_SHIFT)) & CAN_IFLAG1_BUF31TO8I_MASK) -/*! @} */ - -/*! @name CTRL2 - Control 2 */ -/*! @{ */ - -#define CAN_CTRL2_PES_MASK (0x1U) -#define CAN_CTRL2_PES_SHIFT (0U) -/*! PES - Payload Byte and Bit Order Selection - * 0b0..Big-endian - * 0b1..Little-endian - */ -#define CAN_CTRL2_PES(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_PES_SHIFT)) & CAN_CTRL2_PES_MASK) - -#define CAN_CTRL2_ASD_MASK (0x2U) -#define CAN_CTRL2_ASD_SHIFT (1U) -/*! ASD - ACK Suppression Disable - * 0b0..Enabled - * 0b1..Disabled - */ -#define CAN_CTRL2_ASD(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_ASD_SHIFT)) & CAN_CTRL2_ASD_MASK) - -#define CAN_CTRL2_EDFLTDIS_MASK (0x800U) -#define CAN_CTRL2_EDFLTDIS_SHIFT (11U) -/*! EDFLTDIS - Edge Filter Disable - * 0b0..Enabled - * 0b1..Disabled - */ -#define CAN_CTRL2_EDFLTDIS(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_EDFLTDIS_SHIFT)) & CAN_CTRL2_EDFLTDIS_MASK) - -#define CAN_CTRL2_ISOCANFDEN_MASK (0x1000U) -#define CAN_CTRL2_ISOCANFDEN_SHIFT (12U) -/*! ISOCANFDEN - ISO CAN FD Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL2_ISOCANFDEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_ISOCANFDEN_SHIFT)) & CAN_CTRL2_ISOCANFDEN_MASK) - -#define CAN_CTRL2_BTE_MASK (0x2000U) -#define CAN_CTRL2_BTE_SHIFT (13U) -/*! BTE - Bit Timing Expansion Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL2_BTE(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_BTE_SHIFT)) & CAN_CTRL2_BTE_MASK) - -#define CAN_CTRL2_PREXCEN_MASK (0x4000U) -#define CAN_CTRL2_PREXCEN_SHIFT (14U) -/*! PREXCEN - Protocol Exception Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define CAN_CTRL2_PREXCEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_PREXCEN_SHIFT)) & CAN_CTRL2_PREXCEN_MASK) - -#define CAN_CTRL2_EACEN_MASK (0x10000U) -#define CAN_CTRL2_EACEN_SHIFT (16U) -/*! EACEN - Entire Frame Arbitration Field Comparison Enable for RX Message Buffers - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL2_EACEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_EACEN_SHIFT)) & CAN_CTRL2_EACEN_MASK) - -#define CAN_CTRL2_RRS_MASK (0x20000U) -#define CAN_CTRL2_RRS_SHIFT (17U) -/*! RRS - Remote Request Storing - * 0b0..Generated - * 0b1..Stored - */ -#define CAN_CTRL2_RRS(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_RRS_SHIFT)) & CAN_CTRL2_RRS_MASK) - -#define CAN_CTRL2_MRP_MASK (0x40000U) -#define CAN_CTRL2_MRP_SHIFT (18U) -/*! MRP - Message Buffers Reception Priority - * 0b0..Matching starts from Legacy RX FIFO or Enhanced RX FIFO and continues on message buffers. - * 0b1..Matching starts from message buffers and continues on Legacy RX FIFO or Enhanced RX FIFO. - */ -#define CAN_CTRL2_MRP(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_MRP_SHIFT)) & CAN_CTRL2_MRP_MASK) - -#define CAN_CTRL2_TASD_MASK (0xF80000U) -#define CAN_CTRL2_TASD_SHIFT (19U) -/*! TASD - Transmission Arbitration Start Delay */ -#define CAN_CTRL2_TASD(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_TASD_SHIFT)) & CAN_CTRL2_TASD_MASK) - -#define CAN_CTRL2_RFFN_MASK (0xF000000U) -#define CAN_CTRL2_RFFN_SHIFT (24U) -/*! RFFN - Number of Legacy Receive FIFO Filters */ -#define CAN_CTRL2_RFFN(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_RFFN_SHIFT)) & CAN_CTRL2_RFFN_MASK) - -#define CAN_CTRL2_BOFFDONEMSK_MASK (0x40000000U) -#define CAN_CTRL2_BOFFDONEMSK_SHIFT (30U) -/*! BOFFDONEMSK - Bus Off Done Interrupt Mask - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL2_BOFFDONEMSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_BOFFDONEMSK_SHIFT)) & CAN_CTRL2_BOFFDONEMSK_MASK) - -#define CAN_CTRL2_ERRMSK_FAST_MASK (0x80000000U) -#define CAN_CTRL2_ERRMSK_FAST_SHIFT (31U) -/*! ERRMSK_FAST - Error Interrupt Mask for Errors Detected in the Data Phase of Fast CAN FD Frames - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL2_ERRMSK_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_ERRMSK_FAST_SHIFT)) & CAN_CTRL2_ERRMSK_FAST_MASK) -/*! @} */ - -/*! @name ESR2 - Error and Status 2 */ -/*! @{ */ - -#define CAN_ESR2_IMB_MASK (0x2000U) -#define CAN_ESR2_IMB_SHIFT (13U) -/*! IMB - Inactive Message Buffer - * 0b0..Message buffer indicated by ESR2[LPTM] is not inactive. - * 0b1..At least one message buffer is inactive. - */ -#define CAN_ESR2_IMB(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR2_IMB_SHIFT)) & CAN_ESR2_IMB_MASK) - -#define CAN_ESR2_VPS_MASK (0x4000U) -#define CAN_ESR2_VPS_SHIFT (14U) -/*! VPS - Valid Priority Status - * 0b0..Invalid - * 0b1..Valid - */ -#define CAN_ESR2_VPS(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR2_VPS_SHIFT)) & CAN_ESR2_VPS_MASK) - -#define CAN_ESR2_LPTM_MASK (0x7F0000U) -#define CAN_ESR2_LPTM_SHIFT (16U) -/*! LPTM - Lowest Priority TX Message Buffer */ -#define CAN_ESR2_LPTM(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR2_LPTM_SHIFT)) & CAN_ESR2_LPTM_MASK) -/*! @} */ - -/*! @name CRCR - Cyclic Redundancy Check */ -/*! @{ */ - -#define CAN_CRCR_TXCRC_MASK (0x7FFFU) -#define CAN_CRCR_TXCRC_SHIFT (0U) -/*! TXCRC - Transmitted CRC value */ -#define CAN_CRCR_TXCRC(x) (((uint32_t)(((uint32_t)(x)) << CAN_CRCR_TXCRC_SHIFT)) & CAN_CRCR_TXCRC_MASK) - -#define CAN_CRCR_MBCRC_MASK (0x7F0000U) -#define CAN_CRCR_MBCRC_SHIFT (16U) -/*! MBCRC - CRC Message Buffer */ -#define CAN_CRCR_MBCRC(x) (((uint32_t)(((uint32_t)(x)) << CAN_CRCR_MBCRC_SHIFT)) & CAN_CRCR_MBCRC_MASK) -/*! @} */ - -/*! @name RXFGMASK - Legacy RX FIFO Global Mask */ -/*! @{ */ - -#define CAN_RXFGMASK_FGM_MASK (0xFFFFFFFFU) -#define CAN_RXFGMASK_FGM_SHIFT (0U) -/*! FGM - Legacy RX FIFO Global Mask Bits */ -#define CAN_RXFGMASK_FGM(x) (((uint32_t)(((uint32_t)(x)) << CAN_RXFGMASK_FGM_SHIFT)) & CAN_RXFGMASK_FGM_MASK) -/*! @} */ - -/*! @name RXFIR - Legacy RX FIFO Information */ -/*! @{ */ - -#define CAN_RXFIR_IDHIT_MASK (0x1FFU) -#define CAN_RXFIR_IDHIT_SHIFT (0U) -/*! IDHIT - Identifier Acceptance Filter Hit Indicator */ -#define CAN_RXFIR_IDHIT(x) (((uint32_t)(((uint32_t)(x)) << CAN_RXFIR_IDHIT_SHIFT)) & CAN_RXFIR_IDHIT_MASK) -/*! @} */ - -/*! @name CBT - CAN Bit Timing */ -/*! @{ */ - -#define CAN_CBT_EPSEG2_MASK (0x1FU) -#define CAN_CBT_EPSEG2_SHIFT (0U) -/*! EPSEG2 - Extended Phase Segment 2 */ -#define CAN_CBT_EPSEG2(x) (((uint32_t)(((uint32_t)(x)) << CAN_CBT_EPSEG2_SHIFT)) & CAN_CBT_EPSEG2_MASK) - -#define CAN_CBT_EPSEG1_MASK (0x3E0U) -#define CAN_CBT_EPSEG1_SHIFT (5U) -/*! EPSEG1 - Extended Phase Segment 1 */ -#define CAN_CBT_EPSEG1(x) (((uint32_t)(((uint32_t)(x)) << CAN_CBT_EPSEG1_SHIFT)) & CAN_CBT_EPSEG1_MASK) - -#define CAN_CBT_EPROPSEG_MASK (0xFC00U) -#define CAN_CBT_EPROPSEG_SHIFT (10U) -/*! EPROPSEG - Extended Propagation Segment */ -#define CAN_CBT_EPROPSEG(x) (((uint32_t)(((uint32_t)(x)) << CAN_CBT_EPROPSEG_SHIFT)) & CAN_CBT_EPROPSEG_MASK) - -#define CAN_CBT_ERJW_MASK (0x1F0000U) -#define CAN_CBT_ERJW_SHIFT (16U) -/*! ERJW - Extended Resync Jump Width */ -#define CAN_CBT_ERJW(x) (((uint32_t)(((uint32_t)(x)) << CAN_CBT_ERJW_SHIFT)) & CAN_CBT_ERJW_MASK) - -#define CAN_CBT_EPRESDIV_MASK (0x7FE00000U) -#define CAN_CBT_EPRESDIV_SHIFT (21U) -/*! EPRESDIV - Extended Prescaler Division Factor */ -#define CAN_CBT_EPRESDIV(x) (((uint32_t)(((uint32_t)(x)) << CAN_CBT_EPRESDIV_SHIFT)) & CAN_CBT_EPRESDIV_MASK) - -#define CAN_CBT_BTF_MASK (0x80000000U) -#define CAN_CBT_BTF_SHIFT (31U) -/*! BTF - Bit Timing Format Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CBT_BTF(x) (((uint32_t)(((uint32_t)(x)) << CAN_CBT_BTF_SHIFT)) & CAN_CBT_BTF_MASK) -/*! @} */ - -/* The count of CAN_CS */ -#define CAN_CS_COUNT_MB8B (32U) - -/* The count of CAN_ID */ -#define CAN_ID_COUNT_MB8B (32U) - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB8B (32U) - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB8B2 (2U) - -/* The count of CAN_CS */ -#define CAN_CS_COUNT_MB16B (21U) - -/* The count of CAN_ID */ -#define CAN_ID_COUNT_MB16B (21U) - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB16B (21U) - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB16B2 (4U) - -/* The count of CAN_CS */ -#define CAN_CS_COUNT_MB32B (12U) - -/* The count of CAN_ID */ -#define CAN_ID_COUNT_MB32B (12U) - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB32B (12U) - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB32B2 (8U) - -/*! @name CS - Message Buffer 0 CS Register..Message Buffer 6 CS Register */ -/*! @{ */ - -#define CAN_CS_TIME_STAMP_MASK (0xFFFFU) -#define CAN_CS_TIME_STAMP_SHIFT (0U) -/*! TIME_STAMP - Free-Running Counter Time stamp. This 16-bit field is a copy of the Free-Running - * Timer, captured for Tx and Rx frames at the time when the beginning of the Identifier field - * appears on the CAN bus. - */ -#define CAN_CS_TIME_STAMP(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_TIME_STAMP_SHIFT)) & CAN_CS_TIME_STAMP_MASK) - -#define CAN_CS_DLC_MASK (0xF0000U) -#define CAN_CS_DLC_SHIFT (16U) -/*! DLC - Length of the data to be stored/transmitted. */ -#define CAN_CS_DLC(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_DLC_SHIFT)) & CAN_CS_DLC_MASK) - -#define CAN_CS_RTR_MASK (0x100000U) -#define CAN_CS_RTR_SHIFT (20U) -/*! RTR - Remote Transmission Request. One/zero for remote/data frame. */ -#define CAN_CS_RTR(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_RTR_SHIFT)) & CAN_CS_RTR_MASK) - -#define CAN_CS_IDE_MASK (0x200000U) -#define CAN_CS_IDE_SHIFT (21U) -/*! IDE - ID Extended. One/zero for extended/standard format frame. */ -#define CAN_CS_IDE(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_IDE_SHIFT)) & CAN_CS_IDE_MASK) - -#define CAN_CS_SRR_MASK (0x400000U) -#define CAN_CS_SRR_SHIFT (22U) -/*! SRR - Substitute Remote Request. Contains a fixed recessive bit. */ -#define CAN_CS_SRR(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_SRR_SHIFT)) & CAN_CS_SRR_MASK) - -#define CAN_CS_CODE_MASK (0xF000000U) -#define CAN_CS_CODE_SHIFT (24U) -/*! CODE - Message Buffer Code. This 4-bit field can be accessed (read or write) by the CPU and by - * the FlexCAN module itself, as part of the message buffer matching and arbitration process. - */ -#define CAN_CS_CODE(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_CODE_SHIFT)) & CAN_CS_CODE_MASK) - -#define CAN_CS_ESI_MASK (0x20000000U) -#define CAN_CS_ESI_SHIFT (29U) -/*! ESI - Error State Indicator. This bit indicates if the transmitting node is error active or error passive. */ -#define CAN_CS_ESI(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_ESI_SHIFT)) & CAN_CS_ESI_MASK) - -#define CAN_CS_BRS_MASK (0x40000000U) -#define CAN_CS_BRS_SHIFT (30U) -/*! BRS - Bit Rate Switch. This bit defines whether the bit rate is switched inside a CAN FD format frame. */ -#define CAN_CS_BRS(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_BRS_SHIFT)) & CAN_CS_BRS_MASK) - -#define CAN_CS_EDL_MASK (0x80000000U) -#define CAN_CS_EDL_SHIFT (31U) -/*! EDL - Extended Data Length. This bit distinguishes between CAN format and CAN FD format frames. - * The EDL bit must not be set for Message Buffers configured to RANSWER with code field 0b1010. - */ -#define CAN_CS_EDL(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_EDL_SHIFT)) & CAN_CS_EDL_MASK) -/*! @} */ - -/* The count of CAN_CS */ -#define CAN_CS_COUNT_MB64B (7U) - -/*! @name ID - Message Buffer 0 ID Register..Message Buffer 6 ID Register */ -/*! @{ */ - -#define CAN_ID_EXT_MASK (0x3FFFFU) -#define CAN_ID_EXT_SHIFT (0U) -/*! EXT - Contains extended (LOW word) identifier of message buffer. */ -#define CAN_ID_EXT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ID_EXT_SHIFT)) & CAN_ID_EXT_MASK) - -#define CAN_ID_STD_MASK (0x1FFC0000U) -#define CAN_ID_STD_SHIFT (18U) -/*! STD - Contains standard/extended (HIGH word) identifier of message buffer. */ -#define CAN_ID_STD(x) (((uint32_t)(((uint32_t)(x)) << CAN_ID_STD_SHIFT)) & CAN_ID_STD_MASK) - -#define CAN_ID_PRIO_MASK (0xE0000000U) -#define CAN_ID_PRIO_SHIFT (29U) -/*! PRIO - Local priority. This 3-bit fieldis only used when LPRIO_EN bit is set in MCR and it only - * makes sense for Tx buffers. These bits are not transmitted. They are appended to the regular - * ID to define the transmission priority. - */ -#define CAN_ID_PRIO(x) (((uint32_t)(((uint32_t)(x)) << CAN_ID_PRIO_SHIFT)) & CAN_ID_PRIO_MASK) -/*! @} */ - -/* The count of CAN_ID */ -#define CAN_ID_COUNT_MB64B (7U) - -/*! @name WORD - Message Buffer 0 WORD_64B Register..Message Buffer 6 WORD_64B Register */ -/*! @{ */ - -#define CAN_WORD_DATA_BYTE_3_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_3_SHIFT (0U) -/*! DATA_BYTE_3 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_3(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_3_SHIFT)) & CAN_WORD_DATA_BYTE_3_MASK) - -#define CAN_WORD_DATA_BYTE_7_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_7_SHIFT (0U) -/*! DATA_BYTE_7 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_7(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_7_SHIFT)) & CAN_WORD_DATA_BYTE_7_MASK) - -#define CAN_WORD_DATA_BYTE_11_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_11_SHIFT (0U) -/*! DATA_BYTE_11 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_11(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_11_SHIFT)) & CAN_WORD_DATA_BYTE_11_MASK) - -#define CAN_WORD_DATA_BYTE_15_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_15_SHIFT (0U) -/*! DATA_BYTE_15 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_15(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_15_SHIFT)) & CAN_WORD_DATA_BYTE_15_MASK) - -#define CAN_WORD_DATA_BYTE_19_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_19_SHIFT (0U) -/*! DATA_BYTE_19 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_19(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_19_SHIFT)) & CAN_WORD_DATA_BYTE_19_MASK) - -#define CAN_WORD_DATA_BYTE_23_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_23_SHIFT (0U) -/*! DATA_BYTE_23 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_23(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_23_SHIFT)) & CAN_WORD_DATA_BYTE_23_MASK) - -#define CAN_WORD_DATA_BYTE_27_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_27_SHIFT (0U) -/*! DATA_BYTE_27 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_27(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_27_SHIFT)) & CAN_WORD_DATA_BYTE_27_MASK) - -#define CAN_WORD_DATA_BYTE_31_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_31_SHIFT (0U) -/*! DATA_BYTE_31 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_31(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_31_SHIFT)) & CAN_WORD_DATA_BYTE_31_MASK) - -#define CAN_WORD_DATA_BYTE_35_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_35_SHIFT (0U) -/*! DATA_BYTE_35 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_35(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_35_SHIFT)) & CAN_WORD_DATA_BYTE_35_MASK) - -#define CAN_WORD_DATA_BYTE_39_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_39_SHIFT (0U) -/*! DATA_BYTE_39 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_39(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_39_SHIFT)) & CAN_WORD_DATA_BYTE_39_MASK) - -#define CAN_WORD_DATA_BYTE_43_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_43_SHIFT (0U) -/*! DATA_BYTE_43 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_43(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_43_SHIFT)) & CAN_WORD_DATA_BYTE_43_MASK) - -#define CAN_WORD_DATA_BYTE_47_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_47_SHIFT (0U) -/*! DATA_BYTE_47 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_47(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_47_SHIFT)) & CAN_WORD_DATA_BYTE_47_MASK) - -#define CAN_WORD_DATA_BYTE_51_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_51_SHIFT (0U) -/*! DATA_BYTE_51 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_51(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_51_SHIFT)) & CAN_WORD_DATA_BYTE_51_MASK) - -#define CAN_WORD_DATA_BYTE_55_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_55_SHIFT (0U) -/*! DATA_BYTE_55 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_55(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_55_SHIFT)) & CAN_WORD_DATA_BYTE_55_MASK) - -#define CAN_WORD_DATA_BYTE_59_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_59_SHIFT (0U) -/*! DATA_BYTE_59 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_59(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_59_SHIFT)) & CAN_WORD_DATA_BYTE_59_MASK) - -#define CAN_WORD_DATA_BYTE_63_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_63_SHIFT (0U) -/*! DATA_BYTE_63 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_63(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_63_SHIFT)) & CAN_WORD_DATA_BYTE_63_MASK) - -#define CAN_WORD_DATA_BYTE_2_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_2_SHIFT (8U) -/*! DATA_BYTE_2 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_2(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_2_SHIFT)) & CAN_WORD_DATA_BYTE_2_MASK) - -#define CAN_WORD_DATA_BYTE_6_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_6_SHIFT (8U) -/*! DATA_BYTE_6 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_6(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_6_SHIFT)) & CAN_WORD_DATA_BYTE_6_MASK) - -#define CAN_WORD_DATA_BYTE_10_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_10_SHIFT (8U) -/*! DATA_BYTE_10 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_10(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_10_SHIFT)) & CAN_WORD_DATA_BYTE_10_MASK) - -#define CAN_WORD_DATA_BYTE_14_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_14_SHIFT (8U) -/*! DATA_BYTE_14 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_14(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_14_SHIFT)) & CAN_WORD_DATA_BYTE_14_MASK) - -#define CAN_WORD_DATA_BYTE_18_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_18_SHIFT (8U) -/*! DATA_BYTE_18 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_18(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_18_SHIFT)) & CAN_WORD_DATA_BYTE_18_MASK) - -#define CAN_WORD_DATA_BYTE_22_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_22_SHIFT (8U) -/*! DATA_BYTE_22 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_22(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_22_SHIFT)) & CAN_WORD_DATA_BYTE_22_MASK) - -#define CAN_WORD_DATA_BYTE_26_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_26_SHIFT (8U) -/*! DATA_BYTE_26 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_26(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_26_SHIFT)) & CAN_WORD_DATA_BYTE_26_MASK) - -#define CAN_WORD_DATA_BYTE_30_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_30_SHIFT (8U) -/*! DATA_BYTE_30 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_30(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_30_SHIFT)) & CAN_WORD_DATA_BYTE_30_MASK) - -#define CAN_WORD_DATA_BYTE_34_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_34_SHIFT (8U) -/*! DATA_BYTE_34 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_34(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_34_SHIFT)) & CAN_WORD_DATA_BYTE_34_MASK) - -#define CAN_WORD_DATA_BYTE_38_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_38_SHIFT (8U) -/*! DATA_BYTE_38 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_38(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_38_SHIFT)) & CAN_WORD_DATA_BYTE_38_MASK) - -#define CAN_WORD_DATA_BYTE_42_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_42_SHIFT (8U) -/*! DATA_BYTE_42 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_42(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_42_SHIFT)) & CAN_WORD_DATA_BYTE_42_MASK) - -#define CAN_WORD_DATA_BYTE_46_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_46_SHIFT (8U) -/*! DATA_BYTE_46 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_46(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_46_SHIFT)) & CAN_WORD_DATA_BYTE_46_MASK) - -#define CAN_WORD_DATA_BYTE_50_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_50_SHIFT (8U) -/*! DATA_BYTE_50 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_50(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_50_SHIFT)) & CAN_WORD_DATA_BYTE_50_MASK) - -#define CAN_WORD_DATA_BYTE_54_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_54_SHIFT (8U) -/*! DATA_BYTE_54 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_54(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_54_SHIFT)) & CAN_WORD_DATA_BYTE_54_MASK) - -#define CAN_WORD_DATA_BYTE_58_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_58_SHIFT (8U) -/*! DATA_BYTE_58 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_58(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_58_SHIFT)) & CAN_WORD_DATA_BYTE_58_MASK) - -#define CAN_WORD_DATA_BYTE_62_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_62_SHIFT (8U) -/*! DATA_BYTE_62 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_62(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_62_SHIFT)) & CAN_WORD_DATA_BYTE_62_MASK) - -#define CAN_WORD_DATA_BYTE_1_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_1_SHIFT (16U) -/*! DATA_BYTE_1 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_1(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_1_SHIFT)) & CAN_WORD_DATA_BYTE_1_MASK) - -#define CAN_WORD_DATA_BYTE_5_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_5_SHIFT (16U) -/*! DATA_BYTE_5 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_5(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_5_SHIFT)) & CAN_WORD_DATA_BYTE_5_MASK) - -#define CAN_WORD_DATA_BYTE_9_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_9_SHIFT (16U) -/*! DATA_BYTE_9 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_9(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_9_SHIFT)) & CAN_WORD_DATA_BYTE_9_MASK) - -#define CAN_WORD_DATA_BYTE_13_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_13_SHIFT (16U) -/*! DATA_BYTE_13 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_13(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_13_SHIFT)) & CAN_WORD_DATA_BYTE_13_MASK) - -#define CAN_WORD_DATA_BYTE_17_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_17_SHIFT (16U) -/*! DATA_BYTE_17 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_17(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_17_SHIFT)) & CAN_WORD_DATA_BYTE_17_MASK) - -#define CAN_WORD_DATA_BYTE_21_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_21_SHIFT (16U) -/*! DATA_BYTE_21 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_21(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_21_SHIFT)) & CAN_WORD_DATA_BYTE_21_MASK) - -#define CAN_WORD_DATA_BYTE_25_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_25_SHIFT (16U) -/*! DATA_BYTE_25 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_25(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_25_SHIFT)) & CAN_WORD_DATA_BYTE_25_MASK) - -#define CAN_WORD_DATA_BYTE_29_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_29_SHIFT (16U) -/*! DATA_BYTE_29 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_29(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_29_SHIFT)) & CAN_WORD_DATA_BYTE_29_MASK) - -#define CAN_WORD_DATA_BYTE_33_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_33_SHIFT (16U) -/*! DATA_BYTE_33 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_33(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_33_SHIFT)) & CAN_WORD_DATA_BYTE_33_MASK) - -#define CAN_WORD_DATA_BYTE_37_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_37_SHIFT (16U) -/*! DATA_BYTE_37 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_37(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_37_SHIFT)) & CAN_WORD_DATA_BYTE_37_MASK) - -#define CAN_WORD_DATA_BYTE_41_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_41_SHIFT (16U) -/*! DATA_BYTE_41 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_41(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_41_SHIFT)) & CAN_WORD_DATA_BYTE_41_MASK) - -#define CAN_WORD_DATA_BYTE_45_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_45_SHIFT (16U) -/*! DATA_BYTE_45 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_45(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_45_SHIFT)) & CAN_WORD_DATA_BYTE_45_MASK) - -#define CAN_WORD_DATA_BYTE_49_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_49_SHIFT (16U) -/*! DATA_BYTE_49 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_49(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_49_SHIFT)) & CAN_WORD_DATA_BYTE_49_MASK) - -#define CAN_WORD_DATA_BYTE_53_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_53_SHIFT (16U) -/*! DATA_BYTE_53 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_53(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_53_SHIFT)) & CAN_WORD_DATA_BYTE_53_MASK) - -#define CAN_WORD_DATA_BYTE_57_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_57_SHIFT (16U) -/*! DATA_BYTE_57 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_57(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_57_SHIFT)) & CAN_WORD_DATA_BYTE_57_MASK) - -#define CAN_WORD_DATA_BYTE_61_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_61_SHIFT (16U) -/*! DATA_BYTE_61 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_61(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_61_SHIFT)) & CAN_WORD_DATA_BYTE_61_MASK) - -#define CAN_WORD_DATA_BYTE_0_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_0_SHIFT (24U) -/*! DATA_BYTE_0 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_0(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_0_SHIFT)) & CAN_WORD_DATA_BYTE_0_MASK) - -#define CAN_WORD_DATA_BYTE_4_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_4_SHIFT (24U) -/*! DATA_BYTE_4 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_4(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_4_SHIFT)) & CAN_WORD_DATA_BYTE_4_MASK) - -#define CAN_WORD_DATA_BYTE_8_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_8_SHIFT (24U) -/*! DATA_BYTE_8 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_8(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_8_SHIFT)) & CAN_WORD_DATA_BYTE_8_MASK) - -#define CAN_WORD_DATA_BYTE_12_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_12_SHIFT (24U) -/*! DATA_BYTE_12 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_12(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_12_SHIFT)) & CAN_WORD_DATA_BYTE_12_MASK) - -#define CAN_WORD_DATA_BYTE_16_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_16_SHIFT (24U) -/*! DATA_BYTE_16 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_16(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_16_SHIFT)) & CAN_WORD_DATA_BYTE_16_MASK) - -#define CAN_WORD_DATA_BYTE_20_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_20_SHIFT (24U) -/*! DATA_BYTE_20 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_20(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_20_SHIFT)) & CAN_WORD_DATA_BYTE_20_MASK) - -#define CAN_WORD_DATA_BYTE_24_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_24_SHIFT (24U) -/*! DATA_BYTE_24 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_24(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_24_SHIFT)) & CAN_WORD_DATA_BYTE_24_MASK) - -#define CAN_WORD_DATA_BYTE_28_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_28_SHIFT (24U) -/*! DATA_BYTE_28 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_28(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_28_SHIFT)) & CAN_WORD_DATA_BYTE_28_MASK) - -#define CAN_WORD_DATA_BYTE_32_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_32_SHIFT (24U) -/*! DATA_BYTE_32 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_32(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_32_SHIFT)) & CAN_WORD_DATA_BYTE_32_MASK) - -#define CAN_WORD_DATA_BYTE_36_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_36_SHIFT (24U) -/*! DATA_BYTE_36 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_36(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_36_SHIFT)) & CAN_WORD_DATA_BYTE_36_MASK) - -#define CAN_WORD_DATA_BYTE_40_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_40_SHIFT (24U) -/*! DATA_BYTE_40 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_40(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_40_SHIFT)) & CAN_WORD_DATA_BYTE_40_MASK) - -#define CAN_WORD_DATA_BYTE_44_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_44_SHIFT (24U) -/*! DATA_BYTE_44 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_44(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_44_SHIFT)) & CAN_WORD_DATA_BYTE_44_MASK) - -#define CAN_WORD_DATA_BYTE_48_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_48_SHIFT (24U) -/*! DATA_BYTE_48 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_48(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_48_SHIFT)) & CAN_WORD_DATA_BYTE_48_MASK) - -#define CAN_WORD_DATA_BYTE_52_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_52_SHIFT (24U) -/*! DATA_BYTE_52 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_52(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_52_SHIFT)) & CAN_WORD_DATA_BYTE_52_MASK) - -#define CAN_WORD_DATA_BYTE_56_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_56_SHIFT (24U) -/*! DATA_BYTE_56 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_56(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_56_SHIFT)) & CAN_WORD_DATA_BYTE_56_MASK) - -#define CAN_WORD_DATA_BYTE_60_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_60_SHIFT (24U) -/*! DATA_BYTE_60 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_60(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_60_SHIFT)) & CAN_WORD_DATA_BYTE_60_MASK) -/*! @} */ - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB64B (7U) - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB64B2 (16U) - -/* The count of CAN_CS */ -#define CAN_CS_COUNT (32U) - -/* The count of CAN_ID */ -#define CAN_ID_COUNT (32U) - -/*! @name WORD0 - Message Buffer 0 WORD0 Register..Message Buffer 31 WORD0 Register */ -/*! @{ */ - -#define CAN_WORD0_DATA_BYTE_3_MASK (0xFFU) -#define CAN_WORD0_DATA_BYTE_3_SHIFT (0U) -/*! DATA_BYTE_3 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD0_DATA_BYTE_3(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD0_DATA_BYTE_3_SHIFT)) & CAN_WORD0_DATA_BYTE_3_MASK) - -#define CAN_WORD0_DATA_BYTE_2_MASK (0xFF00U) -#define CAN_WORD0_DATA_BYTE_2_SHIFT (8U) -/*! DATA_BYTE_2 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD0_DATA_BYTE_2(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD0_DATA_BYTE_2_SHIFT)) & CAN_WORD0_DATA_BYTE_2_MASK) - -#define CAN_WORD0_DATA_BYTE_1_MASK (0xFF0000U) -#define CAN_WORD0_DATA_BYTE_1_SHIFT (16U) -/*! DATA_BYTE_1 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD0_DATA_BYTE_1(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD0_DATA_BYTE_1_SHIFT)) & CAN_WORD0_DATA_BYTE_1_MASK) - -#define CAN_WORD0_DATA_BYTE_0_MASK (0xFF000000U) -#define CAN_WORD0_DATA_BYTE_0_SHIFT (24U) -/*! DATA_BYTE_0 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD0_DATA_BYTE_0(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD0_DATA_BYTE_0_SHIFT)) & CAN_WORD0_DATA_BYTE_0_MASK) -/*! @} */ - -/* The count of CAN_WORD0 */ -#define CAN_WORD0_COUNT (32U) - -/*! @name WORD1 - Message Buffer 0 WORD1 Register..Message Buffer 31 WORD1 Register */ -/*! @{ */ - -#define CAN_WORD1_DATA_BYTE_7_MASK (0xFFU) -#define CAN_WORD1_DATA_BYTE_7_SHIFT (0U) -/*! DATA_BYTE_7 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD1_DATA_BYTE_7(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD1_DATA_BYTE_7_SHIFT)) & CAN_WORD1_DATA_BYTE_7_MASK) - -#define CAN_WORD1_DATA_BYTE_6_MASK (0xFF00U) -#define CAN_WORD1_DATA_BYTE_6_SHIFT (8U) -/*! DATA_BYTE_6 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD1_DATA_BYTE_6(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD1_DATA_BYTE_6_SHIFT)) & CAN_WORD1_DATA_BYTE_6_MASK) - -#define CAN_WORD1_DATA_BYTE_5_MASK (0xFF0000U) -#define CAN_WORD1_DATA_BYTE_5_SHIFT (16U) -/*! DATA_BYTE_5 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD1_DATA_BYTE_5(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD1_DATA_BYTE_5_SHIFT)) & CAN_WORD1_DATA_BYTE_5_MASK) - -#define CAN_WORD1_DATA_BYTE_4_MASK (0xFF000000U) -#define CAN_WORD1_DATA_BYTE_4_SHIFT (24U) -/*! DATA_BYTE_4 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD1_DATA_BYTE_4(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD1_DATA_BYTE_4_SHIFT)) & CAN_WORD1_DATA_BYTE_4_MASK) -/*! @} */ - -/* The count of CAN_WORD1 */ -#define CAN_WORD1_COUNT (32U) - -/*! @name RXIMR - Receive Individual Mask */ -/*! @{ */ - -#define CAN_RXIMR_MI_MASK (0xFFFFFFFFU) -#define CAN_RXIMR_MI_SHIFT (0U) -/*! MI - Individual Mask Bits */ -#define CAN_RXIMR_MI(x) (((uint32_t)(((uint32_t)(x)) << CAN_RXIMR_MI_SHIFT)) & CAN_RXIMR_MI_MASK) -/*! @} */ - -/* The count of CAN_RXIMR */ -#define CAN_RXIMR_COUNT (32U) - -/*! @name CTRL1_PN - Pretended Networking Control 1 */ -/*! @{ */ - -#define CAN_CTRL1_PN_FCS_MASK (0x3U) -#define CAN_CTRL1_PN_FCS_SHIFT (0U) -/*! FCS - Filtering Combination Selection - * 0b00..Message ID filtering only - * 0b01..Message ID filtering and payload filtering - * 0b10..Message ID filtering occurring a specified number of times - * 0b11..Message ID filtering and payload filtering a specified number of times - */ -#define CAN_CTRL1_PN_FCS(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PN_FCS_SHIFT)) & CAN_CTRL1_PN_FCS_MASK) - -#define CAN_CTRL1_PN_IDFS_MASK (0xCU) -#define CAN_CTRL1_PN_IDFS_SHIFT (2U) -/*! IDFS - ID Filtering Selection - * 0b00..Match ID contents to an exact target value - * 0b01..Match an ID value greater than or equal to a specified target value - * 0b10..Match an ID value smaller than or equal to a specified target value - * 0b11..Match an ID value within a range of values, inclusive - */ -#define CAN_CTRL1_PN_IDFS(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PN_IDFS_SHIFT)) & CAN_CTRL1_PN_IDFS_MASK) - -#define CAN_CTRL1_PN_PLFS_MASK (0x30U) -#define CAN_CTRL1_PN_PLFS_SHIFT (4U) -/*! PLFS - Payload Filtering Selection - * 0b00..Match payload contents to an exact target value - * 0b01..Match a payload value greater than or equal to a specified target value - * 0b10..Match a payload value smaller than or equal to a specified target value - * 0b11..Match upon a payload value within a range of values, inclusive - */ -#define CAN_CTRL1_PN_PLFS(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PN_PLFS_SHIFT)) & CAN_CTRL1_PN_PLFS_MASK) - -#define CAN_CTRL1_PN_NMATCH_MASK (0xFF00U) -#define CAN_CTRL1_PN_NMATCH_SHIFT (8U) -/*! NMATCH - Number of Messages Matching the Same Filtering Criteria - * 0b00000001..Once - * 0b00000010..Twice - * 0b11111111..255 times - */ -#define CAN_CTRL1_PN_NMATCH(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PN_NMATCH_SHIFT)) & CAN_CTRL1_PN_NMATCH_MASK) - -#define CAN_CTRL1_PN_WUMF_MSK_MASK (0x10000U) -#define CAN_CTRL1_PN_WUMF_MSK_SHIFT (16U) -/*! WUMF_MSK - Wake-up by Matching Flag Mask - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL1_PN_WUMF_MSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PN_WUMF_MSK_SHIFT)) & CAN_CTRL1_PN_WUMF_MSK_MASK) - -#define CAN_CTRL1_PN_WTOF_MSK_MASK (0x20000U) -#define CAN_CTRL1_PN_WTOF_MSK_SHIFT (17U) -/*! WTOF_MSK - Wake-up by Timeout Flag Mask - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL1_PN_WTOF_MSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PN_WTOF_MSK_SHIFT)) & CAN_CTRL1_PN_WTOF_MSK_MASK) -/*! @} */ - -/*! @name CTRL2_PN - Pretended Networking Control 2 */ -/*! @{ */ - -#define CAN_CTRL2_PN_MATCHTO_MASK (0xFFFFU) -#define CAN_CTRL2_PN_MATCHTO_SHIFT (0U) -/*! MATCHTO - Timeout for No Message Matching the Filtering Criteria */ -#define CAN_CTRL2_PN_MATCHTO(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_PN_MATCHTO_SHIFT)) & CAN_CTRL2_PN_MATCHTO_MASK) -/*! @} */ - -/*! @name WU_MTC - Pretended Networking Wake-Up Match */ -/*! @{ */ - -#define CAN_WU_MTC_MCOUNTER_MASK (0xFF00U) -#define CAN_WU_MTC_MCOUNTER_SHIFT (8U) -/*! MCOUNTER - Number of Matches in Pretended Networking */ -#define CAN_WU_MTC_MCOUNTER(x) (((uint32_t)(((uint32_t)(x)) << CAN_WU_MTC_MCOUNTER_SHIFT)) & CAN_WU_MTC_MCOUNTER_MASK) - -#define CAN_WU_MTC_WUMF_MASK (0x10000U) -#define CAN_WU_MTC_WUMF_SHIFT (16U) -/*! WUMF - Wake-up by Match Flag - * 0b0..No event detected - * 0b1..Event detected - */ -#define CAN_WU_MTC_WUMF(x) (((uint32_t)(((uint32_t)(x)) << CAN_WU_MTC_WUMF_SHIFT)) & CAN_WU_MTC_WUMF_MASK) - -#define CAN_WU_MTC_WTOF_MASK (0x20000U) -#define CAN_WU_MTC_WTOF_SHIFT (17U) -/*! WTOF - Wake-up by Timeout Flag Bit - * 0b0..No event detected - * 0b1..Event detected - */ -#define CAN_WU_MTC_WTOF(x) (((uint32_t)(((uint32_t)(x)) << CAN_WU_MTC_WTOF_SHIFT)) & CAN_WU_MTC_WTOF_MASK) -/*! @} */ - -/*! @name FLT_ID1 - Pretended Networking ID Filter 1 */ -/*! @{ */ - -#define CAN_FLT_ID1_FLT_ID1_MASK (0x1FFFFFFFU) -#define CAN_FLT_ID1_FLT_ID1_SHIFT (0U) -/*! FLT_ID1 - ID Filter 1 for Pretended Networking filtering */ -#define CAN_FLT_ID1_FLT_ID1(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_ID1_FLT_ID1_SHIFT)) & CAN_FLT_ID1_FLT_ID1_MASK) - -#define CAN_FLT_ID1_FLT_RTR_MASK (0x20000000U) -#define CAN_FLT_ID1_FLT_RTR_SHIFT (29U) -/*! FLT_RTR - Remote Transmission Request Filter - * 0b0..Reject remote frame (accept data frame) - * 0b1..Accept remote frame - */ -#define CAN_FLT_ID1_FLT_RTR(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_ID1_FLT_RTR_SHIFT)) & CAN_FLT_ID1_FLT_RTR_MASK) - -#define CAN_FLT_ID1_FLT_IDE_MASK (0x40000000U) -#define CAN_FLT_ID1_FLT_IDE_SHIFT (30U) -/*! FLT_IDE - ID Extended Filter - * 0b0..Standard - * 0b1..Extended - */ -#define CAN_FLT_ID1_FLT_IDE(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_ID1_FLT_IDE_SHIFT)) & CAN_FLT_ID1_FLT_IDE_MASK) -/*! @} */ - -/*! @name FLT_DLC - Pretended Networking Data Length Code (DLC) Filter */ -/*! @{ */ - -#define CAN_FLT_DLC_FLT_DLC_HI_MASK (0xFU) -#define CAN_FLT_DLC_FLT_DLC_HI_SHIFT (0U) -/*! FLT_DLC_HI - Upper Limit for Length of Data Bytes Filter */ -#define CAN_FLT_DLC_FLT_DLC_HI(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_DLC_FLT_DLC_HI_SHIFT)) & CAN_FLT_DLC_FLT_DLC_HI_MASK) - -#define CAN_FLT_DLC_FLT_DLC_LO_MASK (0xF0000U) -#define CAN_FLT_DLC_FLT_DLC_LO_SHIFT (16U) -/*! FLT_DLC_LO - Lower Limit for Length of Data Bytes Filter */ -#define CAN_FLT_DLC_FLT_DLC_LO(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_DLC_FLT_DLC_LO_SHIFT)) & CAN_FLT_DLC_FLT_DLC_LO_MASK) -/*! @} */ - -/*! @name PL1_LO - Pretended Networking Payload Low Filter 1 */ -/*! @{ */ - -#define CAN_PL1_LO_Data_byte_3_MASK (0xFFU) -#define CAN_PL1_LO_Data_byte_3_SHIFT (0U) -/*! Data_byte_3 - Data byte 3 */ -#define CAN_PL1_LO_Data_byte_3(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_LO_Data_byte_3_SHIFT)) & CAN_PL1_LO_Data_byte_3_MASK) - -#define CAN_PL1_LO_Data_byte_2_MASK (0xFF00U) -#define CAN_PL1_LO_Data_byte_2_SHIFT (8U) -/*! Data_byte_2 - Data byte 2 */ -#define CAN_PL1_LO_Data_byte_2(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_LO_Data_byte_2_SHIFT)) & CAN_PL1_LO_Data_byte_2_MASK) - -#define CAN_PL1_LO_Data_byte_1_MASK (0xFF0000U) -#define CAN_PL1_LO_Data_byte_1_SHIFT (16U) -/*! Data_byte_1 - Data byte 1 */ -#define CAN_PL1_LO_Data_byte_1(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_LO_Data_byte_1_SHIFT)) & CAN_PL1_LO_Data_byte_1_MASK) - -#define CAN_PL1_LO_Data_byte_0_MASK (0xFF000000U) -#define CAN_PL1_LO_Data_byte_0_SHIFT (24U) -/*! Data_byte_0 - Data byte 0 */ -#define CAN_PL1_LO_Data_byte_0(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_LO_Data_byte_0_SHIFT)) & CAN_PL1_LO_Data_byte_0_MASK) -/*! @} */ - -/*! @name PL1_HI - Pretended Networking Payload High Filter 1 */ -/*! @{ */ - -#define CAN_PL1_HI_Data_byte_7_MASK (0xFFU) -#define CAN_PL1_HI_Data_byte_7_SHIFT (0U) -/*! Data_byte_7 - Data byte 7 */ -#define CAN_PL1_HI_Data_byte_7(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_HI_Data_byte_7_SHIFT)) & CAN_PL1_HI_Data_byte_7_MASK) - -#define CAN_PL1_HI_Data_byte_6_MASK (0xFF00U) -#define CAN_PL1_HI_Data_byte_6_SHIFT (8U) -/*! Data_byte_6 - Data byte 6 */ -#define CAN_PL1_HI_Data_byte_6(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_HI_Data_byte_6_SHIFT)) & CAN_PL1_HI_Data_byte_6_MASK) - -#define CAN_PL1_HI_Data_byte_5_MASK (0xFF0000U) -#define CAN_PL1_HI_Data_byte_5_SHIFT (16U) -/*! Data_byte_5 - Data byte 5 */ -#define CAN_PL1_HI_Data_byte_5(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_HI_Data_byte_5_SHIFT)) & CAN_PL1_HI_Data_byte_5_MASK) - -#define CAN_PL1_HI_Data_byte_4_MASK (0xFF000000U) -#define CAN_PL1_HI_Data_byte_4_SHIFT (24U) -/*! Data_byte_4 - Data byte 4 */ -#define CAN_PL1_HI_Data_byte_4(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_HI_Data_byte_4_SHIFT)) & CAN_PL1_HI_Data_byte_4_MASK) -/*! @} */ - -/*! @name FLT_ID2_IDMASK - Pretended Networking ID Filter 2 or ID Mask */ -/*! @{ */ - -#define CAN_FLT_ID2_IDMASK_FLT_ID2_IDMASK_MASK (0x1FFFFFFFU) -#define CAN_FLT_ID2_IDMASK_FLT_ID2_IDMASK_SHIFT (0U) -/*! FLT_ID2_IDMASK - ID Filter 2 for Pretended Networking Filtering or ID Mask Bits for Pretended Networking ID Filtering */ -#define CAN_FLT_ID2_IDMASK_FLT_ID2_IDMASK(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_ID2_IDMASK_FLT_ID2_IDMASK_SHIFT)) & CAN_FLT_ID2_IDMASK_FLT_ID2_IDMASK_MASK) - -#define CAN_FLT_ID2_IDMASK_RTR_MSK_MASK (0x20000000U) -#define CAN_FLT_ID2_IDMASK_RTR_MSK_SHIFT (29U) -/*! RTR_MSK - Remote Transmission Request Mask - * 0b0..The corresponding bit in the filter is "don't care." - * 0b1..The corresponding bit in the filter is checked. - */ -#define CAN_FLT_ID2_IDMASK_RTR_MSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_ID2_IDMASK_RTR_MSK_SHIFT)) & CAN_FLT_ID2_IDMASK_RTR_MSK_MASK) - -#define CAN_FLT_ID2_IDMASK_IDE_MSK_MASK (0x40000000U) -#define CAN_FLT_ID2_IDMASK_IDE_MSK_SHIFT (30U) -/*! IDE_MSK - ID Extended Mask - * 0b0..The corresponding bit in the filter is "don't care." - * 0b1..The corresponding bit in the filter is checked. - */ -#define CAN_FLT_ID2_IDMASK_IDE_MSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_ID2_IDMASK_IDE_MSK_SHIFT)) & CAN_FLT_ID2_IDMASK_IDE_MSK_MASK) -/*! @} */ - -/*! @name PL2_PLMASK_LO - Pretended Networking Payload Low Filter 2 and Payload Low Mask */ -/*! @{ */ - -#define CAN_PL2_PLMASK_LO_Data_byte_3_MASK (0xFFU) -#define CAN_PL2_PLMASK_LO_Data_byte_3_SHIFT (0U) -/*! Data_byte_3 - Data Byte 3 */ -#define CAN_PL2_PLMASK_LO_Data_byte_3(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_LO_Data_byte_3_SHIFT)) & CAN_PL2_PLMASK_LO_Data_byte_3_MASK) - -#define CAN_PL2_PLMASK_LO_Data_byte_2_MASK (0xFF00U) -#define CAN_PL2_PLMASK_LO_Data_byte_2_SHIFT (8U) -/*! Data_byte_2 - Data Byte 2 */ -#define CAN_PL2_PLMASK_LO_Data_byte_2(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_LO_Data_byte_2_SHIFT)) & CAN_PL2_PLMASK_LO_Data_byte_2_MASK) - -#define CAN_PL2_PLMASK_LO_Data_byte_1_MASK (0xFF0000U) -#define CAN_PL2_PLMASK_LO_Data_byte_1_SHIFT (16U) -/*! Data_byte_1 - Data Byte 1 */ -#define CAN_PL2_PLMASK_LO_Data_byte_1(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_LO_Data_byte_1_SHIFT)) & CAN_PL2_PLMASK_LO_Data_byte_1_MASK) - -#define CAN_PL2_PLMASK_LO_Data_byte_0_MASK (0xFF000000U) -#define CAN_PL2_PLMASK_LO_Data_byte_0_SHIFT (24U) -/*! Data_byte_0 - Data Byte 0 */ -#define CAN_PL2_PLMASK_LO_Data_byte_0(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_LO_Data_byte_0_SHIFT)) & CAN_PL2_PLMASK_LO_Data_byte_0_MASK) -/*! @} */ - -/*! @name PL2_PLMASK_HI - Pretended Networking Payload High Filter 2 and Payload High Mask */ -/*! @{ */ - -#define CAN_PL2_PLMASK_HI_Data_byte_7_MASK (0xFFU) -#define CAN_PL2_PLMASK_HI_Data_byte_7_SHIFT (0U) -/*! Data_byte_7 - Data Byte 7 */ -#define CAN_PL2_PLMASK_HI_Data_byte_7(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_HI_Data_byte_7_SHIFT)) & CAN_PL2_PLMASK_HI_Data_byte_7_MASK) - -#define CAN_PL2_PLMASK_HI_Data_byte_6_MASK (0xFF00U) -#define CAN_PL2_PLMASK_HI_Data_byte_6_SHIFT (8U) -/*! Data_byte_6 - Data Byte 6 */ -#define CAN_PL2_PLMASK_HI_Data_byte_6(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_HI_Data_byte_6_SHIFT)) & CAN_PL2_PLMASK_HI_Data_byte_6_MASK) - -#define CAN_PL2_PLMASK_HI_Data_byte_5_MASK (0xFF0000U) -#define CAN_PL2_PLMASK_HI_Data_byte_5_SHIFT (16U) -/*! Data_byte_5 - Data Byte 5 */ -#define CAN_PL2_PLMASK_HI_Data_byte_5(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_HI_Data_byte_5_SHIFT)) & CAN_PL2_PLMASK_HI_Data_byte_5_MASK) - -#define CAN_PL2_PLMASK_HI_Data_byte_4_MASK (0xFF000000U) -#define CAN_PL2_PLMASK_HI_Data_byte_4_SHIFT (24U) -/*! Data_byte_4 - Data Byte 4 */ -#define CAN_PL2_PLMASK_HI_Data_byte_4(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_HI_Data_byte_4_SHIFT)) & CAN_PL2_PLMASK_HI_Data_byte_4_MASK) -/*! @} */ - -/*! @name WMB_CS - Wake-Up Message Buffer */ -/*! @{ */ - -#define CAN_WMB_CS_DLC_MASK (0xF0000U) -#define CAN_WMB_CS_DLC_SHIFT (16U) -/*! DLC - Length of Data in Bytes */ -#define CAN_WMB_CS_DLC(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_CS_DLC_SHIFT)) & CAN_WMB_CS_DLC_MASK) - -#define CAN_WMB_CS_RTR_MASK (0x100000U) -#define CAN_WMB_CS_RTR_SHIFT (20U) -/*! RTR - Remote Transmission Request - * 0b0..Data - * 0b1..Remote - */ -#define CAN_WMB_CS_RTR(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_CS_RTR_SHIFT)) & CAN_WMB_CS_RTR_MASK) - -#define CAN_WMB_CS_IDE_MASK (0x200000U) -#define CAN_WMB_CS_IDE_SHIFT (21U) -/*! IDE - ID Extended Bit - * 0b0..Standard - * 0b1..Extended - */ -#define CAN_WMB_CS_IDE(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_CS_IDE_SHIFT)) & CAN_WMB_CS_IDE_MASK) - -#define CAN_WMB_CS_SRR_MASK (0x400000U) -#define CAN_WMB_CS_SRR_SHIFT (22U) -/*! SRR - Substitute Remote Request - * 0b0..Dominant - * 0b1..Recessive - */ -#define CAN_WMB_CS_SRR(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_CS_SRR_SHIFT)) & CAN_WMB_CS_SRR_MASK) -/*! @} */ - -/* The count of CAN_WMB_CS */ -#define CAN_WMB_CS_COUNT (4U) - -/*! @name WMB_ID - Wake-Up Message Buffer for ID */ -/*! @{ */ - -#define CAN_WMB_ID_ID_MASK (0x1FFFFFFFU) -#define CAN_WMB_ID_ID_SHIFT (0U) -/*! ID - Received ID in Pretended Networking Mode */ -#define CAN_WMB_ID_ID(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_ID_ID_SHIFT)) & CAN_WMB_ID_ID_MASK) -/*! @} */ - -/* The count of CAN_WMB_ID */ -#define CAN_WMB_ID_COUNT (4U) - -/*! @name WMB_D03 - Wake-Up Message Buffer for Data 0-3 */ -/*! @{ */ - -#define CAN_WMB_D03_Data_byte_3_MASK (0xFFU) -#define CAN_WMB_D03_Data_byte_3_SHIFT (0U) -/*! Data_byte_3 - Data Byte 3 */ -#define CAN_WMB_D03_Data_byte_3(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D03_Data_byte_3_SHIFT)) & CAN_WMB_D03_Data_byte_3_MASK) - -#define CAN_WMB_D03_Data_byte_2_MASK (0xFF00U) -#define CAN_WMB_D03_Data_byte_2_SHIFT (8U) -/*! Data_byte_2 - Data Byte 2 */ -#define CAN_WMB_D03_Data_byte_2(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D03_Data_byte_2_SHIFT)) & CAN_WMB_D03_Data_byte_2_MASK) - -#define CAN_WMB_D03_Data_byte_1_MASK (0xFF0000U) -#define CAN_WMB_D03_Data_byte_1_SHIFT (16U) -/*! Data_byte_1 - Data Byte 1 */ -#define CAN_WMB_D03_Data_byte_1(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D03_Data_byte_1_SHIFT)) & CAN_WMB_D03_Data_byte_1_MASK) - -#define CAN_WMB_D03_Data_byte_0_MASK (0xFF000000U) -#define CAN_WMB_D03_Data_byte_0_SHIFT (24U) -/*! Data_byte_0 - Data Byte 0 */ -#define CAN_WMB_D03_Data_byte_0(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D03_Data_byte_0_SHIFT)) & CAN_WMB_D03_Data_byte_0_MASK) -/*! @} */ - -/* The count of CAN_WMB_D03 */ -#define CAN_WMB_D03_COUNT (4U) - -/*! @name WMB_D47 - Wake-Up Message Buffer Register Data 4-7 */ -/*! @{ */ - -#define CAN_WMB_D47_Data_byte_7_MASK (0xFFU) -#define CAN_WMB_D47_Data_byte_7_SHIFT (0U) -/*! Data_byte_7 - Data Byte 7 */ -#define CAN_WMB_D47_Data_byte_7(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D47_Data_byte_7_SHIFT)) & CAN_WMB_D47_Data_byte_7_MASK) - -#define CAN_WMB_D47_Data_byte_6_MASK (0xFF00U) -#define CAN_WMB_D47_Data_byte_6_SHIFT (8U) -/*! Data_byte_6 - Data Byte 6 */ -#define CAN_WMB_D47_Data_byte_6(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D47_Data_byte_6_SHIFT)) & CAN_WMB_D47_Data_byte_6_MASK) - -#define CAN_WMB_D47_Data_byte_5_MASK (0xFF0000U) -#define CAN_WMB_D47_Data_byte_5_SHIFT (16U) -/*! Data_byte_5 - Data Byte 5 */ -#define CAN_WMB_D47_Data_byte_5(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D47_Data_byte_5_SHIFT)) & CAN_WMB_D47_Data_byte_5_MASK) - -#define CAN_WMB_D47_Data_byte_4_MASK (0xFF000000U) -#define CAN_WMB_D47_Data_byte_4_SHIFT (24U) -/*! Data_byte_4 - Data Byte 4 */ -#define CAN_WMB_D47_Data_byte_4(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D47_Data_byte_4_SHIFT)) & CAN_WMB_D47_Data_byte_4_MASK) -/*! @} */ - -/* The count of CAN_WMB_D47 */ -#define CAN_WMB_D47_COUNT (4U) - -/*! @name EPRS - Enhanced CAN Bit Timing Prescalers */ -/*! @{ */ - -#define CAN_EPRS_ENPRESDIV_MASK (0x3FFU) -#define CAN_EPRS_ENPRESDIV_SHIFT (0U) -/*! ENPRESDIV - Extended Nominal Prescaler Division Factor */ -#define CAN_EPRS_ENPRESDIV(x) (((uint32_t)(((uint32_t)(x)) << CAN_EPRS_ENPRESDIV_SHIFT)) & CAN_EPRS_ENPRESDIV_MASK) - -#define CAN_EPRS_EDPRESDIV_MASK (0x3FF0000U) -#define CAN_EPRS_EDPRESDIV_SHIFT (16U) -/*! EDPRESDIV - Extended Data Phase Prescaler Division Factor */ -#define CAN_EPRS_EDPRESDIV(x) (((uint32_t)(((uint32_t)(x)) << CAN_EPRS_EDPRESDIV_SHIFT)) & CAN_EPRS_EDPRESDIV_MASK) -/*! @} */ - -/*! @name ENCBT - Enhanced Nominal CAN Bit Timing */ -/*! @{ */ - -#define CAN_ENCBT_NTSEG1_MASK (0xFFU) -#define CAN_ENCBT_NTSEG1_SHIFT (0U) -/*! NTSEG1 - Nominal Time Segment 1 */ -#define CAN_ENCBT_NTSEG1(x) (((uint32_t)(((uint32_t)(x)) << CAN_ENCBT_NTSEG1_SHIFT)) & CAN_ENCBT_NTSEG1_MASK) - -#define CAN_ENCBT_NTSEG2_MASK (0x7F000U) -#define CAN_ENCBT_NTSEG2_SHIFT (12U) -/*! NTSEG2 - Nominal Time Segment 2 */ -#define CAN_ENCBT_NTSEG2(x) (((uint32_t)(((uint32_t)(x)) << CAN_ENCBT_NTSEG2_SHIFT)) & CAN_ENCBT_NTSEG2_MASK) - -#define CAN_ENCBT_NRJW_MASK (0x1FC00000U) -#define CAN_ENCBT_NRJW_SHIFT (22U) -/*! NRJW - Nominal Resynchronization Jump Width */ -#define CAN_ENCBT_NRJW(x) (((uint32_t)(((uint32_t)(x)) << CAN_ENCBT_NRJW_SHIFT)) & CAN_ENCBT_NRJW_MASK) -/*! @} */ - -/*! @name EDCBT - Enhanced Data Phase CAN Bit Timing */ -/*! @{ */ - -#define CAN_EDCBT_DTSEG1_MASK (0x1FU) -#define CAN_EDCBT_DTSEG1_SHIFT (0U) -/*! DTSEG1 - Data Phase Segment 1 */ -#define CAN_EDCBT_DTSEG1(x) (((uint32_t)(((uint32_t)(x)) << CAN_EDCBT_DTSEG1_SHIFT)) & CAN_EDCBT_DTSEG1_MASK) - -#define CAN_EDCBT_DTSEG2_MASK (0xF000U) -#define CAN_EDCBT_DTSEG2_SHIFT (12U) -/*! DTSEG2 - Data Phase Time Segment 2 */ -#define CAN_EDCBT_DTSEG2(x) (((uint32_t)(((uint32_t)(x)) << CAN_EDCBT_DTSEG2_SHIFT)) & CAN_EDCBT_DTSEG2_MASK) - -#define CAN_EDCBT_DRJW_MASK (0x3C00000U) -#define CAN_EDCBT_DRJW_SHIFT (22U) -/*! DRJW - Data Phase Resynchronization Jump Width */ -#define CAN_EDCBT_DRJW(x) (((uint32_t)(((uint32_t)(x)) << CAN_EDCBT_DRJW_SHIFT)) & CAN_EDCBT_DRJW_MASK) -/*! @} */ - -/*! @name ETDC - Enhanced Transceiver Delay Compensation */ -/*! @{ */ - -#define CAN_ETDC_ETDCVAL_MASK (0xFFU) -#define CAN_ETDC_ETDCVAL_SHIFT (0U) -/*! ETDCVAL - Enhanced Transceiver Delay Compensation Value */ -#define CAN_ETDC_ETDCVAL(x) (((uint32_t)(((uint32_t)(x)) << CAN_ETDC_ETDCVAL_SHIFT)) & CAN_ETDC_ETDCVAL_MASK) - -#define CAN_ETDC_ETDCFAIL_MASK (0x8000U) -#define CAN_ETDC_ETDCFAIL_SHIFT (15U) -/*! ETDCFAIL - Transceiver Delay Compensation Fail - * 0b0..In range - * 0b1..Out of range - */ -#define CAN_ETDC_ETDCFAIL(x) (((uint32_t)(((uint32_t)(x)) << CAN_ETDC_ETDCFAIL_SHIFT)) & CAN_ETDC_ETDCFAIL_MASK) - -#define CAN_ETDC_ETDCOFF_MASK (0x7F0000U) -#define CAN_ETDC_ETDCOFF_SHIFT (16U) -/*! ETDCOFF - Enhanced Transceiver Delay Compensation Offset */ -#define CAN_ETDC_ETDCOFF(x) (((uint32_t)(((uint32_t)(x)) << CAN_ETDC_ETDCOFF_SHIFT)) & CAN_ETDC_ETDCOFF_MASK) - -#define CAN_ETDC_TDMDIS_MASK (0x40000000U) -#define CAN_ETDC_TDMDIS_SHIFT (30U) -/*! TDMDIS - Transceiver Delay Measurement Disable - * 0b0..Enable - * 0b1..Disable - */ -#define CAN_ETDC_TDMDIS(x) (((uint32_t)(((uint32_t)(x)) << CAN_ETDC_TDMDIS_SHIFT)) & CAN_ETDC_TDMDIS_MASK) - -#define CAN_ETDC_ETDCEN_MASK (0x80000000U) -#define CAN_ETDC_ETDCEN_SHIFT (31U) -/*! ETDCEN - Transceiver Delay Compensation Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_ETDC_ETDCEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_ETDC_ETDCEN_SHIFT)) & CAN_ETDC_ETDCEN_MASK) -/*! @} */ - -/*! @name FDCTRL - CAN FD Control */ -/*! @{ */ - -#define CAN_FDCTRL_TDCVAL_MASK (0x3FU) -#define CAN_FDCTRL_TDCVAL_SHIFT (0U) -/*! TDCVAL - Transceiver Delay Compensation Value */ -#define CAN_FDCTRL_TDCVAL(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCTRL_TDCVAL_SHIFT)) & CAN_FDCTRL_TDCVAL_MASK) - -#define CAN_FDCTRL_TDCOFF_MASK (0x1F00U) -#define CAN_FDCTRL_TDCOFF_SHIFT (8U) -/*! TDCOFF - Transceiver Delay Compensation Offset */ -#define CAN_FDCTRL_TDCOFF(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCTRL_TDCOFF_SHIFT)) & CAN_FDCTRL_TDCOFF_MASK) - -#define CAN_FDCTRL_TDCFAIL_MASK (0x4000U) -#define CAN_FDCTRL_TDCFAIL_SHIFT (14U) -/*! TDCFAIL - Transceiver Delay Compensation Fail - * 0b0..In range - * 0b1..Out of range - */ -#define CAN_FDCTRL_TDCFAIL(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCTRL_TDCFAIL_SHIFT)) & CAN_FDCTRL_TDCFAIL_MASK) - -#define CAN_FDCTRL_TDCEN_MASK (0x8000U) -#define CAN_FDCTRL_TDCEN_SHIFT (15U) -/*! TDCEN - Transceiver Delay Compensation Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_FDCTRL_TDCEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCTRL_TDCEN_SHIFT)) & CAN_FDCTRL_TDCEN_MASK) - -#define CAN_FDCTRL_MBDSR0_MASK (0x30000U) -#define CAN_FDCTRL_MBDSR0_SHIFT (16U) -/*! MBDSR0 - Message Buffer Data Size for Region 0 - * 0b00..8 bytes - * 0b01..16 bytes - * 0b10..32 bytes - * 0b11..64 bytes - */ -#define CAN_FDCTRL_MBDSR0(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCTRL_MBDSR0_SHIFT)) & CAN_FDCTRL_MBDSR0_MASK) - -#define CAN_FDCTRL_FDRATE_MASK (0x80000000U) -#define CAN_FDCTRL_FDRATE_SHIFT (31U) -/*! FDRATE - Bit Rate Switch Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_FDCTRL_FDRATE(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCTRL_FDRATE_SHIFT)) & CAN_FDCTRL_FDRATE_MASK) -/*! @} */ - -/*! @name FDCBT - CAN FD Bit Timing */ -/*! @{ */ - -#define CAN_FDCBT_FPSEG2_MASK (0x7U) -#define CAN_FDCBT_FPSEG2_SHIFT (0U) -/*! FPSEG2 - Fast Phase Segment 2 */ -#define CAN_FDCBT_FPSEG2(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCBT_FPSEG2_SHIFT)) & CAN_FDCBT_FPSEG2_MASK) - -#define CAN_FDCBT_FPSEG1_MASK (0xE0U) -#define CAN_FDCBT_FPSEG1_SHIFT (5U) -/*! FPSEG1 - Fast Phase Segment 1 */ -#define CAN_FDCBT_FPSEG1(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCBT_FPSEG1_SHIFT)) & CAN_FDCBT_FPSEG1_MASK) - -#define CAN_FDCBT_FPROPSEG_MASK (0x7C00U) -#define CAN_FDCBT_FPROPSEG_SHIFT (10U) -/*! FPROPSEG - Fast Propagation Segment */ -#define CAN_FDCBT_FPROPSEG(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCBT_FPROPSEG_SHIFT)) & CAN_FDCBT_FPROPSEG_MASK) - -#define CAN_FDCBT_FRJW_MASK (0x70000U) -#define CAN_FDCBT_FRJW_SHIFT (16U) -/*! FRJW - Fast Resync Jump Width */ -#define CAN_FDCBT_FRJW(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCBT_FRJW_SHIFT)) & CAN_FDCBT_FRJW_MASK) - -#define CAN_FDCBT_FPRESDIV_MASK (0x3FF00000U) -#define CAN_FDCBT_FPRESDIV_SHIFT (20U) -/*! FPRESDIV - Fast Prescaler Division Factor */ -#define CAN_FDCBT_FPRESDIV(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCBT_FPRESDIV_SHIFT)) & CAN_FDCBT_FPRESDIV_MASK) -/*! @} */ - -/*! @name FDCRC - CAN FD CRC */ -/*! @{ */ - -#define CAN_FDCRC_FD_TXCRC_MASK (0x1FFFFFU) -#define CAN_FDCRC_FD_TXCRC_SHIFT (0U) -/*! FD_TXCRC - Extended Transmitted CRC value */ -#define CAN_FDCRC_FD_TXCRC(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCRC_FD_TXCRC_SHIFT)) & CAN_FDCRC_FD_TXCRC_MASK) - -#define CAN_FDCRC_FD_MBCRC_MASK (0x7F000000U) -#define CAN_FDCRC_FD_MBCRC_SHIFT (24U) -/*! FD_MBCRC - CRC Message Buffer Number for FD_TXCRC */ -#define CAN_FDCRC_FD_MBCRC(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCRC_FD_MBCRC_SHIFT)) & CAN_FDCRC_FD_MBCRC_MASK) -/*! @} */ - -/*! @name ERFCR - Enhanced RX FIFO Control */ -/*! @{ */ - -#define CAN_ERFCR_ERFWM_MASK (0x1FU) -#define CAN_ERFCR_ERFWM_SHIFT (0U) -/*! ERFWM - Enhanced RX FIFO Watermark */ -#define CAN_ERFCR_ERFWM(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFCR_ERFWM_SHIFT)) & CAN_ERFCR_ERFWM_MASK) - -#define CAN_ERFCR_NFE_MASK (0x3F00U) -#define CAN_ERFCR_NFE_SHIFT (8U) -/*! NFE - Number of Enhanced RX FIFO Filter Elements */ -#define CAN_ERFCR_NFE(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFCR_NFE_SHIFT)) & CAN_ERFCR_NFE_MASK) - -#define CAN_ERFCR_NEXIF_MASK (0x7F0000U) -#define CAN_ERFCR_NEXIF_SHIFT (16U) -/*! NEXIF - Number of Extended ID Filter Elements */ -#define CAN_ERFCR_NEXIF(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFCR_NEXIF_SHIFT)) & CAN_ERFCR_NEXIF_MASK) - -#define CAN_ERFCR_DMALW_MASK (0x7C000000U) -#define CAN_ERFCR_DMALW_SHIFT (26U) -/*! DMALW - DMA Last Word */ -#define CAN_ERFCR_DMALW(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFCR_DMALW_SHIFT)) & CAN_ERFCR_DMALW_MASK) - -#define CAN_ERFCR_ERFEN_MASK (0x80000000U) -#define CAN_ERFCR_ERFEN_SHIFT (31U) -/*! ERFEN - Enhanced RX FIFO enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_ERFCR_ERFEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFCR_ERFEN_SHIFT)) & CAN_ERFCR_ERFEN_MASK) -/*! @} */ - -/*! @name ERFIER - Enhanced RX FIFO Interrupt Enable */ -/*! @{ */ - -#define CAN_ERFIER_ERFDAIE_MASK (0x10000000U) -#define CAN_ERFIER_ERFDAIE_SHIFT (28U) -/*! ERFDAIE - Enhanced RX FIFO Data Available Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_ERFIER_ERFDAIE(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFIER_ERFDAIE_SHIFT)) & CAN_ERFIER_ERFDAIE_MASK) - -#define CAN_ERFIER_ERFWMIIE_MASK (0x20000000U) -#define CAN_ERFIER_ERFWMIIE_SHIFT (29U) -/*! ERFWMIIE - Enhanced RX FIFO Watermark Indication Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_ERFIER_ERFWMIIE(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFIER_ERFWMIIE_SHIFT)) & CAN_ERFIER_ERFWMIIE_MASK) - -#define CAN_ERFIER_ERFOVFIE_MASK (0x40000000U) -#define CAN_ERFIER_ERFOVFIE_SHIFT (30U) -/*! ERFOVFIE - Enhanced RX FIFO Overflow Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_ERFIER_ERFOVFIE(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFIER_ERFOVFIE_SHIFT)) & CAN_ERFIER_ERFOVFIE_MASK) - -#define CAN_ERFIER_ERFUFWIE_MASK (0x80000000U) -#define CAN_ERFIER_ERFUFWIE_SHIFT (31U) -/*! ERFUFWIE - Enhanced RX FIFO Underflow Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_ERFIER_ERFUFWIE(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFIER_ERFUFWIE_SHIFT)) & CAN_ERFIER_ERFUFWIE_MASK) -/*! @} */ - -/*! @name ERFSR - Enhanced RX FIFO Status */ -/*! @{ */ - -#define CAN_ERFSR_ERFEL_MASK (0x3FU) -#define CAN_ERFSR_ERFEL_SHIFT (0U) -/*! ERFEL - Enhanced RX FIFO Elements */ -#define CAN_ERFSR_ERFEL(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFEL_SHIFT)) & CAN_ERFSR_ERFEL_MASK) - -#define CAN_ERFSR_ERFF_MASK (0x10000U) -#define CAN_ERFSR_ERFF_SHIFT (16U) -/*! ERFF - Enhanced RX FIFO Full Flag - * 0b0..Not full - * 0b1..Full - */ -#define CAN_ERFSR_ERFF(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFF_SHIFT)) & CAN_ERFSR_ERFF_MASK) - -#define CAN_ERFSR_ERFE_MASK (0x20000U) -#define CAN_ERFSR_ERFE_SHIFT (17U) -/*! ERFE - Enhanced RX FIFO Empty Flag - * 0b0..Not empty - * 0b1..Empty - */ -#define CAN_ERFSR_ERFE(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFE_SHIFT)) & CAN_ERFSR_ERFE_MASK) - -#define CAN_ERFSR_ERFCLR_MASK (0x8000000U) -#define CAN_ERFSR_ERFCLR_SHIFT (27U) -/*! ERFCLR - Enhanced RX FIFO Clear - * 0b0..No effect - * 0b1..Clear enhanced RX FIFO content - */ -#define CAN_ERFSR_ERFCLR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFCLR_SHIFT)) & CAN_ERFSR_ERFCLR_MASK) - -#define CAN_ERFSR_ERFDA_MASK (0x10000000U) -#define CAN_ERFSR_ERFDA_SHIFT (28U) -/*! ERFDA - Enhanced RX FIFO Data Available Flag - * 0b0..No such occurrence - * 0b1..At least one message stored in Enhanced RX FIFO - */ -#define CAN_ERFSR_ERFDA(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFDA_SHIFT)) & CAN_ERFSR_ERFDA_MASK) - -#define CAN_ERFSR_ERFWMI_MASK (0x20000000U) -#define CAN_ERFSR_ERFWMI_SHIFT (29U) -/*! ERFWMI - Enhanced RX FIFO Watermark Indication Flag - * 0b0..No such occurrence - * 0b1..Number of messages in FIFO is greater than the watermark - */ -#define CAN_ERFSR_ERFWMI(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFWMI_SHIFT)) & CAN_ERFSR_ERFWMI_MASK) - -#define CAN_ERFSR_ERFOVF_MASK (0x40000000U) -#define CAN_ERFSR_ERFOVF_SHIFT (30U) -/*! ERFOVF - Enhanced RX FIFO Overflow Flag - * 0b0..No such occurrence - * 0b1..Overflow - */ -#define CAN_ERFSR_ERFOVF(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFOVF_SHIFT)) & CAN_ERFSR_ERFOVF_MASK) - -#define CAN_ERFSR_ERFUFW_MASK (0x80000000U) -#define CAN_ERFSR_ERFUFW_SHIFT (31U) -/*! ERFUFW - Enhanced RX FIFO Underflow Flag - * 0b0..No such occurrence - * 0b1..Underflow - */ -#define CAN_ERFSR_ERFUFW(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFUFW_SHIFT)) & CAN_ERFSR_ERFUFW_MASK) -/*! @} */ - -/*! @name ERFFEL - Enhanced RX FIFO Filter Element */ -/*! @{ */ - -#define CAN_ERFFEL_FEL_MASK (0xFFFFFFFFU) -#define CAN_ERFFEL_FEL_SHIFT (0U) -/*! FEL - Filter Element Bits */ -#define CAN_ERFFEL_FEL(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFFEL_FEL_SHIFT)) & CAN_ERFFEL_FEL_MASK) -/*! @} */ - -/* The count of CAN_ERFFEL */ -#define CAN_ERFFEL_COUNT (32U) - - -/*! - * @} - */ /* end of group CAN_Register_Masks */ - - -/* CAN - Peripheral instance base addresses */ -/** Peripheral CAN0 base address */ -#define CAN0_BASE (0x400CC000u) -/** Peripheral CAN0 base pointer */ -#define CAN0 ((CAN_Type *)CAN0_BASE) -/** Array initializer of CAN peripheral base addresses */ -#define CAN_BASE_ADDRS { CAN0_BASE } -/** Array initializer of CAN peripheral base pointers */ -#define CAN_BASE_PTRS { CAN0 } -/** Interrupt vectors for the CAN peripheral type */ -#define CAN_Rx_Warning_IRQS { CAN0_IRQn } -#define CAN_Tx_Warning_IRQS { CAN0_IRQn } -#define CAN_Wake_Up_IRQS { CAN0_IRQn } -#define CAN_Error_IRQS { CAN0_IRQn } -#define CAN_Bus_Off_IRQS { CAN0_IRQn } -#define CAN_ORed_Message_buffer_IRQS { CAN0_IRQn } - -/*! - * @} - */ /* end of group CAN_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- CDOG Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CDOG_Peripheral_Access_Layer CDOG Peripheral Access Layer - * @{ - */ - -/** CDOG - Register Layout Typedef */ -typedef struct { - __IO uint32_t CONTROL; /**< Control Register, offset: 0x0 */ - __IO uint32_t RELOAD; /**< Instruction Timer Reload Register, offset: 0x4 */ - __I uint32_t INSTRUCTION_TIMER; /**< Instruction Timer Register, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __I uint32_t STATUS; /**< Status 1 Register, offset: 0x10 */ - __I uint32_t STATUS2; /**< Status 2 Register, offset: 0x14 */ - __IO uint32_t FLAGS; /**< Flags Register, offset: 0x18 */ - __IO uint32_t PERSISTENT; /**< Persistent Data Storage Register, offset: 0x1C */ - __O uint32_t START; /**< START Command Register, offset: 0x20 */ - __O uint32_t STOP; /**< STOP Command Register, offset: 0x24 */ - __O uint32_t RESTART; /**< RESTART Command Register, offset: 0x28 */ - __O uint32_t ADD; /**< ADD Command Register, offset: 0x2C */ - __O uint32_t ADD1; /**< ADD1 Command Register, offset: 0x30 */ - __O uint32_t ADD16; /**< ADD16 Command Register, offset: 0x34 */ - __O uint32_t ADD256; /**< ADD256 Command Register, offset: 0x38 */ - __O uint32_t SUB; /**< SUB Command Register, offset: 0x3C */ - __O uint32_t SUB1; /**< SUB1 Command Register, offset: 0x40 */ - __O uint32_t SUB16; /**< SUB16 Command Register, offset: 0x44 */ - __O uint32_t SUB256; /**< SUB256 Command Register, offset: 0x48 */ - __O uint32_t ASSERT16; /**< ASSERT16 Command Register, offset: 0x4C */ -} CDOG_Type; - -/* ---------------------------------------------------------------------------- - -- CDOG Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CDOG_Register_Masks CDOG Register Masks - * @{ - */ - -/*! @name CONTROL - Control Register */ -/*! @{ */ - -#define CDOG_CONTROL_LOCK_CTRL_MASK (0x3U) -#define CDOG_CONTROL_LOCK_CTRL_SHIFT (0U) -/*! LOCK_CTRL - Lock control - * 0b01..Locked - * 0b10..Unlocked - */ -#define CDOG_CONTROL_LOCK_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_LOCK_CTRL_SHIFT)) & CDOG_CONTROL_LOCK_CTRL_MASK) - -#define CDOG_CONTROL_TIMEOUT_CTRL_MASK (0x1CU) -#define CDOG_CONTROL_TIMEOUT_CTRL_SHIFT (2U) -/*! TIMEOUT_CTRL - TIMEOUT fault control - * 0b100..Disable both reset and interrupt - * 0b001..Enable reset - * 0b010..Enable interrupt - */ -#define CDOG_CONTROL_TIMEOUT_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_TIMEOUT_CTRL_SHIFT)) & CDOG_CONTROL_TIMEOUT_CTRL_MASK) - -#define CDOG_CONTROL_MISCOMPARE_CTRL_MASK (0xE0U) -#define CDOG_CONTROL_MISCOMPARE_CTRL_SHIFT (5U) -/*! MISCOMPARE_CTRL - MISCOMPARE fault control - * 0b100..Disable both reset and interrupt - * 0b001..Enable reset - * 0b010..Enable interrupt - */ -#define CDOG_CONTROL_MISCOMPARE_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_MISCOMPARE_CTRL_SHIFT)) & CDOG_CONTROL_MISCOMPARE_CTRL_MASK) - -#define CDOG_CONTROL_SEQUENCE_CTRL_MASK (0x700U) -#define CDOG_CONTROL_SEQUENCE_CTRL_SHIFT (8U) -/*! SEQUENCE_CTRL - SEQUENCE fault control - * 0b001..Enable reset - * 0b010..Enable interrupt - * 0b100..Disable both reset and interrupt - */ -#define CDOG_CONTROL_SEQUENCE_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_SEQUENCE_CTRL_SHIFT)) & CDOG_CONTROL_SEQUENCE_CTRL_MASK) - -#define CDOG_CONTROL_STATE_CTRL_MASK (0x1C000U) -#define CDOG_CONTROL_STATE_CTRL_SHIFT (14U) -/*! STATE_CTRL - STATE fault control - * 0b001..Enable reset - * 0b010..Enable interrupt - * 0b100..Disable both reset and interrupt - */ -#define CDOG_CONTROL_STATE_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_STATE_CTRL_SHIFT)) & CDOG_CONTROL_STATE_CTRL_MASK) - -#define CDOG_CONTROL_ADDRESS_CTRL_MASK (0xE0000U) -#define CDOG_CONTROL_ADDRESS_CTRL_SHIFT (17U) -/*! ADDRESS_CTRL - ADDRESS fault control - * 0b001..Enable reset - * 0b010..Enable interrupt - * 0b100..Disable both reset and interrupt - */ -#define CDOG_CONTROL_ADDRESS_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_ADDRESS_CTRL_SHIFT)) & CDOG_CONTROL_ADDRESS_CTRL_MASK) - -#define CDOG_CONTROL_IRQ_PAUSE_MASK (0x30000000U) -#define CDOG_CONTROL_IRQ_PAUSE_SHIFT (28U) -/*! IRQ_PAUSE - IRQ pause control - * 0b01..Keep the timer running - * 0b10..Stop the timer - */ -#define CDOG_CONTROL_IRQ_PAUSE(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_IRQ_PAUSE_SHIFT)) & CDOG_CONTROL_IRQ_PAUSE_MASK) - -#define CDOG_CONTROL_DEBUG_HALT_CTRL_MASK (0xC0000000U) -#define CDOG_CONTROL_DEBUG_HALT_CTRL_SHIFT (30U) -/*! DEBUG_HALT_CTRL - DEBUG_HALT control - * 0b01..Keep the timer running - * 0b10..Stop the timer - */ -#define CDOG_CONTROL_DEBUG_HALT_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_DEBUG_HALT_CTRL_SHIFT)) & CDOG_CONTROL_DEBUG_HALT_CTRL_MASK) -/*! @} */ - -/*! @name RELOAD - Instruction Timer Reload Register */ -/*! @{ */ - -#define CDOG_RELOAD_RLOAD_MASK (0xFFFFFFFFU) -#define CDOG_RELOAD_RLOAD_SHIFT (0U) -/*! RLOAD - Instruction Timer reload value */ -#define CDOG_RELOAD_RLOAD(x) (((uint32_t)(((uint32_t)(x)) << CDOG_RELOAD_RLOAD_SHIFT)) & CDOG_RELOAD_RLOAD_MASK) -/*! @} */ - -/*! @name INSTRUCTION_TIMER - Instruction Timer Register */ -/*! @{ */ - -#define CDOG_INSTRUCTION_TIMER_INSTIM_MASK (0xFFFFFFFFU) -#define CDOG_INSTRUCTION_TIMER_INSTIM_SHIFT (0U) -/*! INSTIM - Current value of the Instruction Timer */ -#define CDOG_INSTRUCTION_TIMER_INSTIM(x) (((uint32_t)(((uint32_t)(x)) << CDOG_INSTRUCTION_TIMER_INSTIM_SHIFT)) & CDOG_INSTRUCTION_TIMER_INSTIM_MASK) -/*! @} */ - -/*! @name STATUS - Status 1 Register */ -/*! @{ */ - -#define CDOG_STATUS_NUMTOF_MASK (0xFFU) -#define CDOG_STATUS_NUMTOF_SHIFT (0U) -/*! NUMTOF - Number of TIMEOUT faults since the last POR */ -#define CDOG_STATUS_NUMTOF(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS_NUMTOF_SHIFT)) & CDOG_STATUS_NUMTOF_MASK) - -#define CDOG_STATUS_NUMMISCOMPF_MASK (0xFF00U) -#define CDOG_STATUS_NUMMISCOMPF_SHIFT (8U) -/*! NUMMISCOMPF - Number of MISCOMPARE faults since the last POR */ -#define CDOG_STATUS_NUMMISCOMPF(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS_NUMMISCOMPF_SHIFT)) & CDOG_STATUS_NUMMISCOMPF_MASK) - -#define CDOG_STATUS_NUMILSEQF_MASK (0xFF0000U) -#define CDOG_STATUS_NUMILSEQF_SHIFT (16U) -/*! NUMILSEQF - Number of SEQUENCE faults since the last POR */ -#define CDOG_STATUS_NUMILSEQF(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS_NUMILSEQF_SHIFT)) & CDOG_STATUS_NUMILSEQF_MASK) - -#define CDOG_STATUS_CURST_MASK (0xF0000000U) -#define CDOG_STATUS_CURST_SHIFT (28U) -/*! CURST - Current State */ -#define CDOG_STATUS_CURST(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS_CURST_SHIFT)) & CDOG_STATUS_CURST_MASK) -/*! @} */ - -/*! @name STATUS2 - Status 2 Register */ -/*! @{ */ - -#define CDOG_STATUS2_NUMCNTF_MASK (0xFFU) -#define CDOG_STATUS2_NUMCNTF_SHIFT (0U) -/*! NUMCNTF - Number of CONTROL faults since the last POR */ -#define CDOG_STATUS2_NUMCNTF(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS2_NUMCNTF_SHIFT)) & CDOG_STATUS2_NUMCNTF_MASK) - -#define CDOG_STATUS2_NUMILLSTF_MASK (0xFF00U) -#define CDOG_STATUS2_NUMILLSTF_SHIFT (8U) -/*! NUMILLSTF - Number of STATE faults since the last POR */ -#define CDOG_STATUS2_NUMILLSTF(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS2_NUMILLSTF_SHIFT)) & CDOG_STATUS2_NUMILLSTF_MASK) - -#define CDOG_STATUS2_NUMILLA_MASK (0xFF0000U) -#define CDOG_STATUS2_NUMILLA_SHIFT (16U) -/*! NUMILLA - Number of ADDRESS faults since the last POR */ -#define CDOG_STATUS2_NUMILLA(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS2_NUMILLA_SHIFT)) & CDOG_STATUS2_NUMILLA_MASK) -/*! @} */ - -/*! @name FLAGS - Flags Register */ -/*! @{ */ - -#define CDOG_FLAGS_TO_FLAG_MASK (0x1U) -#define CDOG_FLAGS_TO_FLAG_SHIFT (0U) -/*! TO_FLAG - TIMEOUT fault flag - * 0b0..A TIMEOUT fault has not occurred - * 0b1..A TIMEOUT fault has occurred - */ -#define CDOG_FLAGS_TO_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_TO_FLAG_SHIFT)) & CDOG_FLAGS_TO_FLAG_MASK) - -#define CDOG_FLAGS_MISCOM_FLAG_MASK (0x2U) -#define CDOG_FLAGS_MISCOM_FLAG_SHIFT (1U) -/*! MISCOM_FLAG - MISCOMPARE fault flag - * 0b0..A MISCOMPARE fault has not occurred - * 0b1..A MISCOMPARE fault has occurred - */ -#define CDOG_FLAGS_MISCOM_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_MISCOM_FLAG_SHIFT)) & CDOG_FLAGS_MISCOM_FLAG_MASK) - -#define CDOG_FLAGS_SEQ_FLAG_MASK (0x4U) -#define CDOG_FLAGS_SEQ_FLAG_SHIFT (2U) -/*! SEQ_FLAG - SEQUENCE fault flag - * 0b0..A SEQUENCE fault has not occurred - * 0b1..A SEQUENCE fault has occurred - */ -#define CDOG_FLAGS_SEQ_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_SEQ_FLAG_SHIFT)) & CDOG_FLAGS_SEQ_FLAG_MASK) - -#define CDOG_FLAGS_CNT_FLAG_MASK (0x8U) -#define CDOG_FLAGS_CNT_FLAG_SHIFT (3U) -/*! CNT_FLAG - CONTROL fault flag - * 0b0..A CONTROL fault has not occurred - * 0b1..A CONTROL fault has occurred - */ -#define CDOG_FLAGS_CNT_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_CNT_FLAG_SHIFT)) & CDOG_FLAGS_CNT_FLAG_MASK) - -#define CDOG_FLAGS_STATE_FLAG_MASK (0x10U) -#define CDOG_FLAGS_STATE_FLAG_SHIFT (4U) -/*! STATE_FLAG - STATE fault flag - * 0b0..A STATE fault has not occurred - * 0b1..A STATE fault has occurred - */ -#define CDOG_FLAGS_STATE_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_STATE_FLAG_SHIFT)) & CDOG_FLAGS_STATE_FLAG_MASK) - -#define CDOG_FLAGS_ADDR_FLAG_MASK (0x20U) -#define CDOG_FLAGS_ADDR_FLAG_SHIFT (5U) -/*! ADDR_FLAG - ADDRESS fault flag - * 0b0..An ADDRESS fault has not occurred - * 0b1..An ADDRESS fault has occurred - */ -#define CDOG_FLAGS_ADDR_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_ADDR_FLAG_SHIFT)) & CDOG_FLAGS_ADDR_FLAG_MASK) - -#define CDOG_FLAGS_POR_FLAG_MASK (0x10000U) -#define CDOG_FLAGS_POR_FLAG_SHIFT (16U) -/*! POR_FLAG - Power-on reset flag - * 0b0..A Power-on reset event has not occurred - * 0b1..A Power-on reset event has occurred - */ -#define CDOG_FLAGS_POR_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_POR_FLAG_SHIFT)) & CDOG_FLAGS_POR_FLAG_MASK) -/*! @} */ - -/*! @name PERSISTENT - Persistent Data Storage Register */ -/*! @{ */ - -#define CDOG_PERSISTENT_PERSIS_MASK (0xFFFFFFFFU) -#define CDOG_PERSISTENT_PERSIS_SHIFT (0U) -/*! PERSIS - Persistent Storage */ -#define CDOG_PERSISTENT_PERSIS(x) (((uint32_t)(((uint32_t)(x)) << CDOG_PERSISTENT_PERSIS_SHIFT)) & CDOG_PERSISTENT_PERSIS_MASK) -/*! @} */ - -/*! @name START - START Command Register */ -/*! @{ */ - -#define CDOG_START_STRT_MASK (0xFFFFFFFFU) -#define CDOG_START_STRT_SHIFT (0U) -/*! STRT - Start command */ -#define CDOG_START_STRT(x) (((uint32_t)(((uint32_t)(x)) << CDOG_START_STRT_SHIFT)) & CDOG_START_STRT_MASK) -/*! @} */ - -/*! @name STOP - STOP Command Register */ -/*! @{ */ - -#define CDOG_STOP_STP_MASK (0xFFFFFFFFU) -#define CDOG_STOP_STP_SHIFT (0U) -/*! STP - Stop command */ -#define CDOG_STOP_STP(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STOP_STP_SHIFT)) & CDOG_STOP_STP_MASK) -/*! @} */ - -/*! @name RESTART - RESTART Command Register */ -/*! @{ */ - -#define CDOG_RESTART_RSTRT_MASK (0xFFFFFFFFU) -#define CDOG_RESTART_RSTRT_SHIFT (0U) -/*! RSTRT - Restart command */ -#define CDOG_RESTART_RSTRT(x) (((uint32_t)(((uint32_t)(x)) << CDOG_RESTART_RSTRT_SHIFT)) & CDOG_RESTART_RSTRT_MASK) -/*! @} */ - -/*! @name ADD - ADD Command Register */ -/*! @{ */ - -#define CDOG_ADD_AD_MASK (0xFFFFFFFFU) -#define CDOG_ADD_AD_SHIFT (0U) -/*! AD - ADD Write Value */ -#define CDOG_ADD_AD(x) (((uint32_t)(((uint32_t)(x)) << CDOG_ADD_AD_SHIFT)) & CDOG_ADD_AD_MASK) -/*! @} */ - -/*! @name ADD1 - ADD1 Command Register */ -/*! @{ */ - -#define CDOG_ADD1_AD1_MASK (0xFFFFFFFFU) -#define CDOG_ADD1_AD1_SHIFT (0U) -/*! AD1 - ADD 1 */ -#define CDOG_ADD1_AD1(x) (((uint32_t)(((uint32_t)(x)) << CDOG_ADD1_AD1_SHIFT)) & CDOG_ADD1_AD1_MASK) -/*! @} */ - -/*! @name ADD16 - ADD16 Command Register */ -/*! @{ */ - -#define CDOG_ADD16_AD16_MASK (0xFFFFFFFFU) -#define CDOG_ADD16_AD16_SHIFT (0U) -/*! AD16 - ADD 16 */ -#define CDOG_ADD16_AD16(x) (((uint32_t)(((uint32_t)(x)) << CDOG_ADD16_AD16_SHIFT)) & CDOG_ADD16_AD16_MASK) -/*! @} */ - -/*! @name ADD256 - ADD256 Command Register */ -/*! @{ */ - -#define CDOG_ADD256_AD256_MASK (0xFFFFFFFFU) -#define CDOG_ADD256_AD256_SHIFT (0U) -/*! AD256 - ADD 256 */ -#define CDOG_ADD256_AD256(x) (((uint32_t)(((uint32_t)(x)) << CDOG_ADD256_AD256_SHIFT)) & CDOG_ADD256_AD256_MASK) -/*! @} */ - -/*! @name SUB - SUB Command Register */ -/*! @{ */ - -#define CDOG_SUB_SB_MASK (0xFFFFFFFFU) -#define CDOG_SUB_SB_SHIFT (0U) -/*! SB - Subtract Write Value */ -#define CDOG_SUB_SB(x) (((uint32_t)(((uint32_t)(x)) << CDOG_SUB_SB_SHIFT)) & CDOG_SUB_SB_MASK) -/*! @} */ - -/*! @name SUB1 - SUB1 Command Register */ -/*! @{ */ - -#define CDOG_SUB1_SB1_MASK (0xFFFFFFFFU) -#define CDOG_SUB1_SB1_SHIFT (0U) -/*! SB1 - Subtract 1 */ -#define CDOG_SUB1_SB1(x) (((uint32_t)(((uint32_t)(x)) << CDOG_SUB1_SB1_SHIFT)) & CDOG_SUB1_SB1_MASK) -/*! @} */ - -/*! @name SUB16 - SUB16 Command Register */ -/*! @{ */ - -#define CDOG_SUB16_SB16_MASK (0xFFFFFFFFU) -#define CDOG_SUB16_SB16_SHIFT (0U) -/*! SB16 - Subtract 16 */ -#define CDOG_SUB16_SB16(x) (((uint32_t)(((uint32_t)(x)) << CDOG_SUB16_SB16_SHIFT)) & CDOG_SUB16_SB16_MASK) -/*! @} */ - -/*! @name SUB256 - SUB256 Command Register */ -/*! @{ */ - -#define CDOG_SUB256_SB256_MASK (0xFFFFFFFFU) -#define CDOG_SUB256_SB256_SHIFT (0U) -/*! SB256 - Subtract 256 */ -#define CDOG_SUB256_SB256(x) (((uint32_t)(((uint32_t)(x)) << CDOG_SUB256_SB256_SHIFT)) & CDOG_SUB256_SB256_MASK) -/*! @} */ - -/*! @name ASSERT16 - ASSERT16 Command Register */ -/*! @{ */ - -#define CDOG_ASSERT16_AST16_MASK (0xFFFFFFFFU) -#define CDOG_ASSERT16_AST16_SHIFT (0U) -/*! AST16 - ASSERT16 Command */ -#define CDOG_ASSERT16_AST16(x) (((uint32_t)(((uint32_t)(x)) << CDOG_ASSERT16_AST16_SHIFT)) & CDOG_ASSERT16_AST16_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group CDOG_Register_Masks */ - - -/* CDOG - Peripheral instance base addresses */ -/** Peripheral CDOG base address */ -#define CDOG_BASE (0x40100000u) -/** Peripheral CDOG base pointer */ -#define CDOG ((CDOG_Type *)CDOG_BASE) -/** Array initializer of CDOG peripheral base addresses */ -#define CDOG_BASE_ADDRS { CDOG_BASE } -/** Array initializer of CDOG peripheral base pointers */ -#define CDOG_BASE_PTRS { CDOG } -/** Interrupt vectors for the CDOG peripheral type */ -#define CDOG_IRQS { CDOG0_IRQn } - -/*! - * @} - */ /* end of group CDOG_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- CMC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CMC_Peripheral_Access_Layer CMC Peripheral Access Layer - * @{ - */ - -/** CMC - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - uint8_t RESERVED_0[12]; - __IO uint32_t CKCTRL; /**< Clock Control, offset: 0x10 */ - __IO uint32_t CKSTAT; /**< Clock Status, offset: 0x14 */ - __IO uint32_t PMPROT; /**< Power Mode Protection, offset: 0x18 */ - __O uint32_t GPMCTRL; /**< Global Power Mode Control, offset: 0x1C */ - __IO uint32_t PMCTRL[1]; /**< Power Mode Control, array offset: 0x20, array step: 0x4 */ - uint8_t RESERVED_1[92]; - __I uint32_t SRS; /**< System Reset Status, offset: 0x80 */ - __IO uint32_t RPC; /**< Reset Pin Control, offset: 0x84 */ - __IO uint32_t SSRS; /**< Sticky System Reset Status, offset: 0x88 */ - __IO uint32_t SRIE; /**< System Reset Interrupt Enable, offset: 0x8C */ - __IO uint32_t SRIF; /**< System Reset Interrupt Flag, offset: 0x90 */ - uint8_t RESERVED_2[8]; - __I uint32_t RSTCNT; /**< Reset Count Register, offset: 0x9C */ - __IO uint32_t MR[1]; /**< Mode, array offset: 0xA0, array step: 0x4 */ - uint8_t RESERVED_3[12]; - __IO uint32_t FM[1]; /**< Force Mode, array offset: 0xB0, array step: 0x4 */ - uint8_t RESERVED_4[44]; - __IO uint32_t FLASHCR; /**< Flash Control, offset: 0xE0 */ - uint8_t RESERVED_5[44]; - __IO uint32_t CORECTL; /**< Core Control, offset: 0x110 */ - uint8_t RESERVED_6[12]; - __IO uint32_t DBGCTL; /**< Debug Control, offset: 0x120 */ -} CMC_Type; - -/* ---------------------------------------------------------------------------- - -- CMC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CMC_Register_Masks CMC Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define CMC_VERID_FEATURE_MASK (0xFFFFU) -#define CMC_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number */ -#define CMC_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << CMC_VERID_FEATURE_SHIFT)) & CMC_VERID_FEATURE_MASK) - -#define CMC_VERID_MINOR_MASK (0xFF0000U) -#define CMC_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define CMC_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << CMC_VERID_MINOR_SHIFT)) & CMC_VERID_MINOR_MASK) - -#define CMC_VERID_MAJOR_MASK (0xFF000000U) -#define CMC_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define CMC_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << CMC_VERID_MAJOR_SHIFT)) & CMC_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name CKCTRL - Clock Control */ -/*! @{ */ - -#define CMC_CKCTRL_CKMODE_MASK (0xFU) -#define CMC_CKCTRL_CKMODE_SHIFT (0U) -/*! CKMODE - Clocking Mode - * 0b0000..No clock gating - * 0b1111..Core, platform, and peripheral clocks are gated, and core enters Low-Power mode. - */ -#define CMC_CKCTRL_CKMODE(x) (((uint32_t)(((uint32_t)(x)) << CMC_CKCTRL_CKMODE_SHIFT)) & CMC_CKCTRL_CKMODE_MASK) - -#define CMC_CKCTRL_LOCK_MASK (0x80000000U) -#define CMC_CKCTRL_LOCK_SHIFT (31U) -/*! LOCK - Lock - * 0b0..Allowed - * 0b1..Blocked - */ -#define CMC_CKCTRL_LOCK(x) (((uint32_t)(((uint32_t)(x)) << CMC_CKCTRL_LOCK_SHIFT)) & CMC_CKCTRL_LOCK_MASK) -/*! @} */ - -/*! @name CKSTAT - Clock Status */ -/*! @{ */ - -#define CMC_CKSTAT_CKMODE_MASK (0xFU) -#define CMC_CKSTAT_CKMODE_SHIFT (0U) -/*! CKMODE - Low Power Status - * 0b0000..Core clock not gated - * 0b1111..Core, platform, and peripheral clocks were gated, and power domain entered Low-Power mode - * *.. - */ -#define CMC_CKSTAT_CKMODE(x) (((uint32_t)(((uint32_t)(x)) << CMC_CKSTAT_CKMODE_SHIFT)) & CMC_CKSTAT_CKMODE_MASK) - -#define CMC_CKSTAT_WAKEUP_MASK (0xFF00U) -#define CMC_CKSTAT_WAKEUP_SHIFT (8U) -/*! WAKEUP - Wake-up Source */ -#define CMC_CKSTAT_WAKEUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_CKSTAT_WAKEUP_SHIFT)) & CMC_CKSTAT_WAKEUP_MASK) - -#define CMC_CKSTAT_VALID_MASK (0x80000000U) -#define CMC_CKSTAT_VALID_SHIFT (31U) -/*! VALID - Clock Status Valid - * 0b0..Core clock not gated - * 0b1..Core clock was gated due to Low-Power mode entry - */ -#define CMC_CKSTAT_VALID(x) (((uint32_t)(((uint32_t)(x)) << CMC_CKSTAT_VALID_SHIFT)) & CMC_CKSTAT_VALID_MASK) -/*! @} */ - -/*! @name PMPROT - Power Mode Protection */ -/*! @{ */ - -#define CMC_PMPROT_LPMODE_MASK (0xFU) -#define CMC_PMPROT_LPMODE_SHIFT (0U) -/*! LPMODE - Low-Power Mode - * 0b0000..Not allowed - * 0b0001..Allowed - * 0b0010..Allowed - * 0b0011..Allowed - * 0b0100..Allowed - * 0b0101..Allowed - * 0b0110..Allowed - * 0b0111..Allowed - * 0b1000..Allowed - * 0b1001..Allowed - * 0b1010..Allowed - * 0b1011..Allowed - * 0b1100..Allowed - * 0b1101..Allowed - * 0b1110..Allowed - * 0b1111..Allowed - */ -#define CMC_PMPROT_LPMODE(x) (((uint32_t)(((uint32_t)(x)) << CMC_PMPROT_LPMODE_SHIFT)) & CMC_PMPROT_LPMODE_MASK) - -#define CMC_PMPROT_LOCK_MASK (0x80000000U) -#define CMC_PMPROT_LOCK_SHIFT (31U) -/*! LOCK - Lock Register - * 0b0..Allowed - * 0b1..Blocked - */ -#define CMC_PMPROT_LOCK(x) (((uint32_t)(((uint32_t)(x)) << CMC_PMPROT_LOCK_SHIFT)) & CMC_PMPROT_LOCK_MASK) -/*! @} */ - -/*! @name GPMCTRL - Global Power Mode Control */ -/*! @{ */ - -#define CMC_GPMCTRL_LPMODE_MASK (0xFU) -#define CMC_GPMCTRL_LPMODE_SHIFT (0U) -/*! LPMODE - Low-Power Mode */ -#define CMC_GPMCTRL_LPMODE(x) (((uint32_t)(((uint32_t)(x)) << CMC_GPMCTRL_LPMODE_SHIFT)) & CMC_GPMCTRL_LPMODE_MASK) -/*! @} */ - -/*! @name PMCTRL - Power Mode Control */ -/*! @{ */ - -#define CMC_PMCTRL_LPMODE_MASK (0xFU) -#define CMC_PMCTRL_LPMODE_SHIFT (0U) -/*! LPMODE - Low-Power Mode - * 0b0000..Active/Sleep - * 0b0001..Deep Sleep - * 0b0011..Power Down - * 0b0111..Reserved - * 0b1111..Deep-Power Down - */ -#define CMC_PMCTRL_LPMODE(x) (((uint32_t)(((uint32_t)(x)) << CMC_PMCTRL_LPMODE_SHIFT)) & CMC_PMCTRL_LPMODE_MASK) -/*! @} */ - -/* The count of CMC_PMCTRL */ -#define CMC_PMCTRL_COUNT (1U) - -/*! @name SRS - System Reset Status */ -/*! @{ */ - -#define CMC_SRS_WAKEUP_MASK (0x1U) -#define CMC_SRS_WAKEUP_SHIFT (0U) -/*! WAKEUP - Wake-up Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_WAKEUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_WAKEUP_SHIFT)) & CMC_SRS_WAKEUP_MASK) - -#define CMC_SRS_POR_MASK (0x2U) -#define CMC_SRS_POR_SHIFT (1U) -/*! POR - Power-on Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_POR(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_POR_SHIFT)) & CMC_SRS_POR_MASK) - -#define CMC_SRS_VD_MASK (0x4U) -#define CMC_SRS_VD_SHIFT (2U) -/*! VD - Voltage Detect Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_VD(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_VD_SHIFT)) & CMC_SRS_VD_MASK) - -#define CMC_SRS_WARM_MASK (0x10U) -#define CMC_SRS_WARM_SHIFT (4U) -/*! WARM - Warm Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_WARM(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_WARM_SHIFT)) & CMC_SRS_WARM_MASK) - -#define CMC_SRS_FATAL_MASK (0x20U) -#define CMC_SRS_FATAL_SHIFT (5U) -/*! FATAL - Fatal Reset - * 0b0..Reset was not generated - * 0b1..Reset was generated - */ -#define CMC_SRS_FATAL(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_FATAL_SHIFT)) & CMC_SRS_FATAL_MASK) - -#define CMC_SRS_PIN_MASK (0x100U) -#define CMC_SRS_PIN_SHIFT (8U) -/*! PIN - Pin Reset - * 0b0..Reset was not generated - * 0b1..Reset was generated - */ -#define CMC_SRS_PIN(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_PIN_SHIFT)) & CMC_SRS_PIN_MASK) - -#define CMC_SRS_DAP_MASK (0x200U) -#define CMC_SRS_DAP_SHIFT (9U) -/*! DAP - Debug Access Port Reset - * 0b0..Reset was not generated - * 0b1..Reset was generated - */ -#define CMC_SRS_DAP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_DAP_SHIFT)) & CMC_SRS_DAP_MASK) - -#define CMC_SRS_RSTACK_MASK (0x400U) -#define CMC_SRS_RSTACK_SHIFT (10U) -/*! RSTACK - Reset Timeout - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_RSTACK(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_RSTACK_SHIFT)) & CMC_SRS_RSTACK_MASK) - -#define CMC_SRS_LPACK_MASK (0x800U) -#define CMC_SRS_LPACK_SHIFT (11U) -/*! LPACK - Low Power Acknowledge Timeout Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_LPACK(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_LPACK_SHIFT)) & CMC_SRS_LPACK_MASK) - -#define CMC_SRS_SCG_MASK (0x1000U) -#define CMC_SRS_SCG_SHIFT (12U) -/*! SCG - System Clock Generation Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SRS_SCG(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_SCG_SHIFT)) & CMC_SRS_SCG_MASK) - -#define CMC_SRS_WWDT0_MASK (0x2000U) -#define CMC_SRS_WWDT0_SHIFT (13U) -/*! WWDT0 - Windowed Watchdog 0 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SRS_WWDT0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_WWDT0_SHIFT)) & CMC_SRS_WWDT0_MASK) - -#define CMC_SRS_SW_MASK (0x4000U) -#define CMC_SRS_SW_SHIFT (14U) -/*! SW - Software Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_SW(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_SW_SHIFT)) & CMC_SRS_SW_MASK) - -#define CMC_SRS_LOCKUP_MASK (0x8000U) -#define CMC_SRS_LOCKUP_SHIFT (15U) -/*! LOCKUP - Lockup Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_LOCKUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_LOCKUP_SHIFT)) & CMC_SRS_LOCKUP_MASK) - -#define CMC_SRS_CDOG0_MASK (0x4000000U) -#define CMC_SRS_CDOG0_SHIFT (26U) -/*! CDOG0 - Code Watchdog 0 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SRS_CDOG0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_CDOG0_SHIFT)) & CMC_SRS_CDOG0_MASK) - -#define CMC_SRS_JTAG_MASK (0x10000000U) -#define CMC_SRS_JTAG_SHIFT (28U) -/*! JTAG - JTAG System Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_JTAG(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_JTAG_SHIFT)) & CMC_SRS_JTAG_MASK) -/*! @} */ - -/*! @name RPC - Reset Pin Control */ -/*! @{ */ - -#define CMC_RPC_FILTCFG_MASK (0x1FU) -#define CMC_RPC_FILTCFG_SHIFT (0U) -/*! FILTCFG - Reset Filter Configuration */ -#define CMC_RPC_FILTCFG(x) (((uint32_t)(((uint32_t)(x)) << CMC_RPC_FILTCFG_SHIFT)) & CMC_RPC_FILTCFG_MASK) - -#define CMC_RPC_FILTEN_MASK (0x100U) -#define CMC_RPC_FILTEN_SHIFT (8U) -/*! FILTEN - Filter Enable - * 0b0..Disables - * 0b1..Enables - */ -#define CMC_RPC_FILTEN(x) (((uint32_t)(((uint32_t)(x)) << CMC_RPC_FILTEN_SHIFT)) & CMC_RPC_FILTEN_MASK) - -#define CMC_RPC_LPFEN_MASK (0x200U) -#define CMC_RPC_LPFEN_SHIFT (9U) -/*! LPFEN - Low-Power Filter Enable - * 0b0..Disables - * 0b1..Enables - */ -#define CMC_RPC_LPFEN(x) (((uint32_t)(((uint32_t)(x)) << CMC_RPC_LPFEN_SHIFT)) & CMC_RPC_LPFEN_MASK) -/*! @} */ - -/*! @name SSRS - Sticky System Reset Status */ -/*! @{ */ - -#define CMC_SSRS_WAKEUP_MASK (0x1U) -#define CMC_SSRS_WAKEUP_SHIFT (0U) -/*! WAKEUP - Wake-up Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_WAKEUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_WAKEUP_SHIFT)) & CMC_SSRS_WAKEUP_MASK) - -#define CMC_SSRS_POR_MASK (0x2U) -#define CMC_SSRS_POR_SHIFT (1U) -/*! POR - Power-on Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_POR(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_POR_SHIFT)) & CMC_SSRS_POR_MASK) - -#define CMC_SSRS_VD_MASK (0x4U) -#define CMC_SSRS_VD_SHIFT (2U) -/*! VD - Voltage Detect Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_VD(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_VD_SHIFT)) & CMC_SSRS_VD_MASK) - -#define CMC_SSRS_WARM_MASK (0x10U) -#define CMC_SSRS_WARM_SHIFT (4U) -/*! WARM - Warm Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_WARM(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_WARM_SHIFT)) & CMC_SSRS_WARM_MASK) - -#define CMC_SSRS_FATAL_MASK (0x20U) -#define CMC_SSRS_FATAL_SHIFT (5U) -/*! FATAL - Fatal Reset - * 0b0..Reset was not generated - * 0b1..Reset was generated - */ -#define CMC_SSRS_FATAL(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_FATAL_SHIFT)) & CMC_SSRS_FATAL_MASK) - -#define CMC_SSRS_PIN_MASK (0x100U) -#define CMC_SSRS_PIN_SHIFT (8U) -/*! PIN - Pin Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_PIN(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_PIN_SHIFT)) & CMC_SSRS_PIN_MASK) - -#define CMC_SSRS_DAP_MASK (0x200U) -#define CMC_SSRS_DAP_SHIFT (9U) -/*! DAP - DAP Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_DAP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_DAP_SHIFT)) & CMC_SSRS_DAP_MASK) - -#define CMC_SSRS_RSTACK_MASK (0x400U) -#define CMC_SSRS_RSTACK_SHIFT (10U) -/*! RSTACK - Reset Timeout - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_RSTACK(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_RSTACK_SHIFT)) & CMC_SSRS_RSTACK_MASK) - -#define CMC_SSRS_LPACK_MASK (0x800U) -#define CMC_SSRS_LPACK_SHIFT (11U) -/*! LPACK - Low Power Acknowledge Timeout Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_LPACK(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_LPACK_SHIFT)) & CMC_SSRS_LPACK_MASK) - -#define CMC_SSRS_SCG_MASK (0x1000U) -#define CMC_SSRS_SCG_SHIFT (12U) -/*! SCG - System Clock Generation Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SSRS_SCG(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_SCG_SHIFT)) & CMC_SSRS_SCG_MASK) - -#define CMC_SSRS_WWDT0_MASK (0x2000U) -#define CMC_SSRS_WWDT0_SHIFT (13U) -/*! WWDT0 - Windowed Watchdog 0 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SSRS_WWDT0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_WWDT0_SHIFT)) & CMC_SSRS_WWDT0_MASK) - -#define CMC_SSRS_SW_MASK (0x4000U) -#define CMC_SSRS_SW_SHIFT (14U) -/*! SW - Software Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_SW(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_SW_SHIFT)) & CMC_SSRS_SW_MASK) - -#define CMC_SSRS_LOCKUP_MASK (0x8000U) -#define CMC_SSRS_LOCKUP_SHIFT (15U) -/*! LOCKUP - Lockup Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_LOCKUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_LOCKUP_SHIFT)) & CMC_SSRS_LOCKUP_MASK) - -#define CMC_SSRS_CDOG0_MASK (0x4000000U) -#define CMC_SSRS_CDOG0_SHIFT (26U) -/*! CDOG0 - Code Watchdog 0 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SSRS_CDOG0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_CDOG0_SHIFT)) & CMC_SSRS_CDOG0_MASK) - -#define CMC_SSRS_JTAG_MASK (0x10000000U) -#define CMC_SSRS_JTAG_SHIFT (28U) -/*! JTAG - JTAG System Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_JTAG(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_JTAG_SHIFT)) & CMC_SSRS_JTAG_MASK) -/*! @} */ - -/*! @name SRIE - System Reset Interrupt Enable */ -/*! @{ */ - -#define CMC_SRIE_PIN_MASK (0x100U) -#define CMC_SRIE_PIN_SHIFT (8U) -/*! PIN - Pin Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_PIN(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_PIN_SHIFT)) & CMC_SRIE_PIN_MASK) - -#define CMC_SRIE_DAP_MASK (0x200U) -#define CMC_SRIE_DAP_SHIFT (9U) -/*! DAP - DAP Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_DAP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_DAP_SHIFT)) & CMC_SRIE_DAP_MASK) - -#define CMC_SRIE_LPACK_MASK (0x800U) -#define CMC_SRIE_LPACK_SHIFT (11U) -/*! LPACK - Low Power Acknowledge Timeout Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_LPACK(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_LPACK_SHIFT)) & CMC_SRIE_LPACK_MASK) - -#define CMC_SRIE_SCG_MASK (0x1000U) -#define CMC_SRIE_SCG_SHIFT (12U) -/*! SCG - System Clock Generation Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_SCG(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_SCG_SHIFT)) & CMC_SRIE_SCG_MASK) - -#define CMC_SRIE_WWDT0_MASK (0x2000U) -#define CMC_SRIE_WWDT0_SHIFT (13U) -/*! WWDT0 - Windowed Watchdog 0 Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_WWDT0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_WWDT0_SHIFT)) & CMC_SRIE_WWDT0_MASK) - -#define CMC_SRIE_SW_MASK (0x4000U) -#define CMC_SRIE_SW_SHIFT (14U) -/*! SW - Software Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_SW(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_SW_SHIFT)) & CMC_SRIE_SW_MASK) - -#define CMC_SRIE_LOCKUP_MASK (0x8000U) -#define CMC_SRIE_LOCKUP_SHIFT (15U) -/*! LOCKUP - Lockup Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_LOCKUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_LOCKUP_SHIFT)) & CMC_SRIE_LOCKUP_MASK) - -#define CMC_SRIE_CDOG0_MASK (0x4000000U) -#define CMC_SRIE_CDOG0_SHIFT (26U) -/*! CDOG0 - Code Watchdog 0 Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_CDOG0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_CDOG0_SHIFT)) & CMC_SRIE_CDOG0_MASK) -/*! @} */ - -/*! @name SRIF - System Reset Interrupt Flag */ -/*! @{ */ - -#define CMC_SRIF_PIN_MASK (0x100U) -#define CMC_SRIF_PIN_SHIFT (8U) -/*! PIN - Pin Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_PIN(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_PIN_SHIFT)) & CMC_SRIF_PIN_MASK) - -#define CMC_SRIF_DAP_MASK (0x200U) -#define CMC_SRIF_DAP_SHIFT (9U) -/*! DAP - DAP Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_DAP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_DAP_SHIFT)) & CMC_SRIF_DAP_MASK) - -#define CMC_SRIF_LPACK_MASK (0x800U) -#define CMC_SRIF_LPACK_SHIFT (11U) -/*! LPACK - Low Power Acknowledge Timeout Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_LPACK(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_LPACK_SHIFT)) & CMC_SRIF_LPACK_MASK) - -#define CMC_SRIF_WWDT0_MASK (0x2000U) -#define CMC_SRIF_WWDT0_SHIFT (13U) -/*! WWDT0 - Windowed Watchdog 0 Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_WWDT0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_WWDT0_SHIFT)) & CMC_SRIF_WWDT0_MASK) - -#define CMC_SRIF_SW_MASK (0x4000U) -#define CMC_SRIF_SW_SHIFT (14U) -/*! SW - Software Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_SW(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_SW_SHIFT)) & CMC_SRIF_SW_MASK) - -#define CMC_SRIF_LOCKUP_MASK (0x8000U) -#define CMC_SRIF_LOCKUP_SHIFT (15U) -/*! LOCKUP - Lockup Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_LOCKUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_LOCKUP_SHIFT)) & CMC_SRIF_LOCKUP_MASK) - -#define CMC_SRIF_CDOG0_MASK (0x4000000U) -#define CMC_SRIF_CDOG0_SHIFT (26U) -/*! CDOG0 - Code Watchdog 0 Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_CDOG0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_CDOG0_SHIFT)) & CMC_SRIF_CDOG0_MASK) -/*! @} */ - -/*! @name RSTCNT - Reset Count Register */ -/*! @{ */ - -#define CMC_RSTCNT_COUNT_MASK (0xFFU) -#define CMC_RSTCNT_COUNT_SHIFT (0U) -/*! COUNT - Count */ -#define CMC_RSTCNT_COUNT(x) (((uint32_t)(((uint32_t)(x)) << CMC_RSTCNT_COUNT_SHIFT)) & CMC_RSTCNT_COUNT_MASK) -/*! @} */ - -/*! @name MR - Mode */ -/*! @{ */ - -#define CMC_MR_ISPMODE_n_MASK (0x1U) -#define CMC_MR_ISPMODE_n_SHIFT (0U) -/*! ISPMODE_n - In System Programming Mode */ -#define CMC_MR_ISPMODE_n(x) (((uint32_t)(((uint32_t)(x)) << CMC_MR_ISPMODE_n_SHIFT)) & CMC_MR_ISPMODE_n_MASK) -/*! @} */ - -/* The count of CMC_MR */ -#define CMC_MR_COUNT (1U) - -/*! @name FM - Force Mode */ -/*! @{ */ - -#define CMC_FM_FORCECFG_MASK (0x1U) -#define CMC_FM_FORCECFG_SHIFT (0U) -/*! FORCECFG - Boot Configuration - * 0b0..No effect - * 0b1..Asserts - */ -#define CMC_FM_FORCECFG(x) (((uint32_t)(((uint32_t)(x)) << CMC_FM_FORCECFG_SHIFT)) & CMC_FM_FORCECFG_MASK) -/*! @} */ - -/* The count of CMC_FM */ -#define CMC_FM_COUNT (1U) - -/*! @name FLASHCR - Flash Control */ -/*! @{ */ - -#define CMC_FLASHCR_FLASHDIS_MASK (0x1U) -#define CMC_FLASHCR_FLASHDIS_SHIFT (0U) -/*! FLASHDIS - Flash Disable - * 0b0..No effect - * 0b1..Flash memory is disabled - */ -#define CMC_FLASHCR_FLASHDIS(x) (((uint32_t)(((uint32_t)(x)) << CMC_FLASHCR_FLASHDIS_SHIFT)) & CMC_FLASHCR_FLASHDIS_MASK) - -#define CMC_FLASHCR_FLASHDOZE_MASK (0x2U) -#define CMC_FLASHCR_FLASHDOZE_SHIFT (1U) -/*! FLASHDOZE - Flash Doze - * 0b0..No effect - * 0b1..Flash memory is disabled when core is sleeping (CKMODE > 0) - */ -#define CMC_FLASHCR_FLASHDOZE(x) (((uint32_t)(((uint32_t)(x)) << CMC_FLASHCR_FLASHDOZE_SHIFT)) & CMC_FLASHCR_FLASHDOZE_MASK) - -#define CMC_FLASHCR_FLASHWAKE_MASK (0x4U) -#define CMC_FLASHCR_FLASHWAKE_SHIFT (2U) -/*! FLASHWAKE - Flash Wake - * 0b0..No effect - * 0b1..Flash memory is not disabled during flash memory accesses - */ -#define CMC_FLASHCR_FLASHWAKE(x) (((uint32_t)(((uint32_t)(x)) << CMC_FLASHCR_FLASHWAKE_SHIFT)) & CMC_FLASHCR_FLASHWAKE_MASK) -/*! @} */ - -/*! @name CORECTL - Core Control */ -/*! @{ */ - -#define CMC_CORECTL_NPIE_MASK (0x1U) -#define CMC_CORECTL_NPIE_SHIFT (0U) -/*! NPIE - Non-maskable Pin Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define CMC_CORECTL_NPIE(x) (((uint32_t)(((uint32_t)(x)) << CMC_CORECTL_NPIE_SHIFT)) & CMC_CORECTL_NPIE_MASK) -/*! @} */ - -/*! @name DBGCTL - Debug Control */ -/*! @{ */ - -#define CMC_DBGCTL_SOD_MASK (0x1U) -#define CMC_DBGCTL_SOD_SHIFT (0U) -/*! SOD - Sleep Or Debug - * 0b0..Remains enabled - * 0b1..Disabled - */ -#define CMC_DBGCTL_SOD(x) (((uint32_t)(((uint32_t)(x)) << CMC_DBGCTL_SOD_SHIFT)) & CMC_DBGCTL_SOD_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group CMC_Register_Masks */ - - -/* CMC - Peripheral instance base addresses */ -/** Peripheral CMC base address */ -#define CMC_BASE (0x4008B000u) -/** Peripheral CMC base pointer */ -#define CMC ((CMC_Type *)CMC_BASE) -/** Array initializer of CMC peripheral base addresses */ -#define CMC_BASE_ADDRS { CMC_BASE } -/** Array initializer of CMC peripheral base pointers */ -#define CMC_BASE_PTRS { CMC } - -/*! - * @} - */ /* end of group CMC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- CRC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CRC_Peripheral_Access_Layer CRC Peripheral Access Layer - * @{ - */ - -/** CRC - Register Layout Typedef */ -typedef struct { - union { /* offset: 0x0 */ - struct { /* offset: 0x0 */ - __IO uint8_t DATALL; /**< CRC_DATALL register, offset: 0x0 */ - __IO uint8_t DATALU; /**< CRC_DATALU register, offset: 0x1 */ - __IO uint8_t DATAHL; /**< CRC_DATAHL register, offset: 0x2 */ - __IO uint8_t DATAHU; /**< CRC_DATAHU register, offset: 0x3 */ - } ACCESS8BIT; - struct { /* offset: 0x0 */ - __IO uint16_t DATAL; /**< CRC_DATAL register, offset: 0x0 */ - __IO uint16_t DATAH; /**< CRC_DATAH register, offset: 0x2 */ - } ACCESS16BIT; - __IO uint32_t DATA; /**< Data, offset: 0x0 */ - }; - union { /* offset: 0x4 */ - struct { /* offset: 0x4 */ - __IO uint8_t GPOLYLL; /**< CRC_GPOLYLL register, offset: 0x4 */ - __IO uint8_t GPOLYLU; /**< CRC_GPOLYLU register, offset: 0x5 */ - __IO uint8_t GPOLYHL; /**< CRC_GPOLYHL register, offset: 0x6 */ - __IO uint8_t GPOLYHU; /**< CRC_GPOLYHU register, offset: 0x7 */ - } GPOLY_ACCESS8BIT; - struct { /* offset: 0x4 */ - __IO uint16_t GPOLYL; /**< CRC_GPOLYL register, offset: 0x4 */ - __IO uint16_t GPOLYH; /**< CRC_GPOLYH register, offset: 0x6 */ - } GPOLY_ACCESS16BIT; - __IO uint32_t GPOLY; /**< Polynomial, offset: 0x4 */ - }; - union { /* offset: 0x8 */ - struct { /* offset: 0x8 */ - uint8_t RESERVED_0[3]; - __IO uint8_t CTRLHU; /**< CRC_CTRLHU register, offset: 0xB */ - } CTRL_ACCESS8BIT; - __IO uint32_t CTRL; /**< Control, offset: 0x8 */ - }; -} CRC_Type; - -/* ---------------------------------------------------------------------------- - -- CRC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CRC_Register_Masks CRC Register Masks - * @{ - */ - -/*! @name DATALL - CRC_DATALL register */ -/*! @{ */ - -#define CRC_DATALL_DATALL_MASK (0xFFU) -#define CRC_DATALL_DATALL_SHIFT (0U) -#define CRC_DATALL_DATALL(x) (((uint8_t)(((uint8_t)(x)) << CRC_DATALL_DATALL_SHIFT)) & CRC_DATALL_DATALL_MASK) -/*! @} */ - -/*! @name DATALU - CRC_DATALU register */ -/*! @{ */ - -#define CRC_DATALU_DATALU_MASK (0xFFU) -#define CRC_DATALU_DATALU_SHIFT (0U) -#define CRC_DATALU_DATALU(x) (((uint8_t)(((uint8_t)(x)) << CRC_DATALU_DATALU_SHIFT)) & CRC_DATALU_DATALU_MASK) -/*! @} */ - -/*! @name DATAHL - CRC_DATAHL register */ -/*! @{ */ - -#define CRC_DATAHL_DATAHL_MASK (0xFFU) -#define CRC_DATAHL_DATAHL_SHIFT (0U) -#define CRC_DATAHL_DATAHL(x) (((uint8_t)(((uint8_t)(x)) << CRC_DATAHL_DATAHL_SHIFT)) & CRC_DATAHL_DATAHL_MASK) -/*! @} */ - -/*! @name DATAHU - CRC_DATAHU register */ -/*! @{ */ - -#define CRC_DATAHU_DATAHU_MASK (0xFFU) -#define CRC_DATAHU_DATAHU_SHIFT (0U) -#define CRC_DATAHU_DATAHU(x) (((uint8_t)(((uint8_t)(x)) << CRC_DATAHU_DATAHU_SHIFT)) & CRC_DATAHU_DATAHU_MASK) -/*! @} */ - -/*! @name DATAL - CRC_DATAL register */ -/*! @{ */ - -#define CRC_DATAL_DATAL_MASK (0xFFFFU) -#define CRC_DATAL_DATAL_SHIFT (0U) -#define CRC_DATAL_DATAL(x) (((uint16_t)(((uint16_t)(x)) << CRC_DATAL_DATAL_SHIFT)) & CRC_DATAL_DATAL_MASK) -/*! @} */ - -/*! @name DATAH - CRC_DATAH register */ -/*! @{ */ - -#define CRC_DATAH_DATAH_MASK (0xFFFFU) -#define CRC_DATAH_DATAH_SHIFT (0U) -#define CRC_DATAH_DATAH(x) (((uint16_t)(((uint16_t)(x)) << CRC_DATAH_DATAH_SHIFT)) & CRC_DATAH_DATAH_MASK) -/*! @} */ - -/*! @name DATA - Data */ -/*! @{ */ - -#define CRC_DATA_LL_MASK (0xFFU) -#define CRC_DATA_LL_SHIFT (0U) -/*! LL - Lower Part of Low Byte */ -#define CRC_DATA_LL(x) (((uint32_t)(((uint32_t)(x)) << CRC_DATA_LL_SHIFT)) & CRC_DATA_LL_MASK) - -#define CRC_DATA_LU_MASK (0xFF00U) -#define CRC_DATA_LU_SHIFT (8U) -/*! LU - Upper Part of Low Byte */ -#define CRC_DATA_LU(x) (((uint32_t)(((uint32_t)(x)) << CRC_DATA_LU_SHIFT)) & CRC_DATA_LU_MASK) - -#define CRC_DATA_HL_MASK (0xFF0000U) -#define CRC_DATA_HL_SHIFT (16U) -/*! HL - Lower Part of High Byte */ -#define CRC_DATA_HL(x) (((uint32_t)(((uint32_t)(x)) << CRC_DATA_HL_SHIFT)) & CRC_DATA_HL_MASK) - -#define CRC_DATA_HU_MASK (0xFF000000U) -#define CRC_DATA_HU_SHIFT (24U) -/*! HU - Upper Part of High Byte */ -#define CRC_DATA_HU(x) (((uint32_t)(((uint32_t)(x)) << CRC_DATA_HU_SHIFT)) & CRC_DATA_HU_MASK) -/*! @} */ - -/*! @name GPOLYLL - CRC_GPOLYLL register */ -/*! @{ */ - -#define CRC_GPOLYLL_GPOLYLL_MASK (0xFFU) -#define CRC_GPOLYLL_GPOLYLL_SHIFT (0U) -#define CRC_GPOLYLL_GPOLYLL(x) (((uint8_t)(((uint8_t)(x)) << CRC_GPOLYLL_GPOLYLL_SHIFT)) & CRC_GPOLYLL_GPOLYLL_MASK) -/*! @} */ - -/*! @name GPOLYLU - CRC_GPOLYLU register */ -/*! @{ */ - -#define CRC_GPOLYLU_GPOLYLU_MASK (0xFFU) -#define CRC_GPOLYLU_GPOLYLU_SHIFT (0U) -#define CRC_GPOLYLU_GPOLYLU(x) (((uint8_t)(((uint8_t)(x)) << CRC_GPOLYLU_GPOLYLU_SHIFT)) & CRC_GPOLYLU_GPOLYLU_MASK) -/*! @} */ - -/*! @name GPOLYHL - CRC_GPOLYHL register */ -/*! @{ */ - -#define CRC_GPOLYHL_GPOLYHL_MASK (0xFFU) -#define CRC_GPOLYHL_GPOLYHL_SHIFT (0U) -#define CRC_GPOLYHL_GPOLYHL(x) (((uint8_t)(((uint8_t)(x)) << CRC_GPOLYHL_GPOLYHL_SHIFT)) & CRC_GPOLYHL_GPOLYHL_MASK) -/*! @} */ - -/*! @name GPOLYHU - CRC_GPOLYHU register */ -/*! @{ */ - -#define CRC_GPOLYHU_GPOLYHU_MASK (0xFFU) -#define CRC_GPOLYHU_GPOLYHU_SHIFT (0U) -#define CRC_GPOLYHU_GPOLYHU(x) (((uint8_t)(((uint8_t)(x)) << CRC_GPOLYHU_GPOLYHU_SHIFT)) & CRC_GPOLYHU_GPOLYHU_MASK) -/*! @} */ - -/*! @name GPOLYL - CRC_GPOLYL register */ -/*! @{ */ - -#define CRC_GPOLYL_GPOLYL_MASK (0xFFFFU) -#define CRC_GPOLYL_GPOLYL_SHIFT (0U) -#define CRC_GPOLYL_GPOLYL(x) (((uint16_t)(((uint16_t)(x)) << CRC_GPOLYL_GPOLYL_SHIFT)) & CRC_GPOLYL_GPOLYL_MASK) -/*! @} */ - -/*! @name GPOLYH - CRC_GPOLYH register */ -/*! @{ */ - -#define CRC_GPOLYH_GPOLYH_MASK (0xFFFFU) -#define CRC_GPOLYH_GPOLYH_SHIFT (0U) -#define CRC_GPOLYH_GPOLYH(x) (((uint16_t)(((uint16_t)(x)) << CRC_GPOLYH_GPOLYH_SHIFT)) & CRC_GPOLYH_GPOLYH_MASK) -/*! @} */ - -/*! @name GPOLY - Polynomial */ -/*! @{ */ - -#define CRC_GPOLY_LOW_MASK (0xFFFFU) -#define CRC_GPOLY_LOW_SHIFT (0U) -/*! LOW - Low Half-Word */ -#define CRC_GPOLY_LOW(x) (((uint32_t)(((uint32_t)(x)) << CRC_GPOLY_LOW_SHIFT)) & CRC_GPOLY_LOW_MASK) - -#define CRC_GPOLY_HIGH_MASK (0xFFFF0000U) -#define CRC_GPOLY_HIGH_SHIFT (16U) -/*! HIGH - High Half-Word */ -#define CRC_GPOLY_HIGH(x) (((uint32_t)(((uint32_t)(x)) << CRC_GPOLY_HIGH_SHIFT)) & CRC_GPOLY_HIGH_MASK) -/*! @} */ - -/*! @name CTRLHU - CRC_CTRLHU register */ -/*! @{ */ - -#define CRC_CTRLHU_TCRC_MASK (0x1U) -#define CRC_CTRLHU_TCRC_SHIFT (0U) -/*! TCRC - TCRC - * 0b0..16 bits - * 0b1..32 bits - */ -#define CRC_CTRLHU_TCRC(x) (((uint8_t)(((uint8_t)(x)) << CRC_CTRLHU_TCRC_SHIFT)) & CRC_CTRLHU_TCRC_MASK) - -#define CRC_CTRLHU_WAS_MASK (0x2U) -#define CRC_CTRLHU_WAS_SHIFT (1U) -/*! WAS - Write as Seed - * 0b0..Data values - * 0b1..Seed values - */ -#define CRC_CTRLHU_WAS(x) (((uint8_t)(((uint8_t)(x)) << CRC_CTRLHU_WAS_SHIFT)) & CRC_CTRLHU_WAS_MASK) - -#define CRC_CTRLHU_FXOR_MASK (0x4U) -#define CRC_CTRLHU_FXOR_SHIFT (2U) -/*! FXOR - Complement Read of CRC Data Register - * 0b0..Disables XOR on reading data. - * 0b1..Inverts or complements the read value of the CRC Data. - */ -#define CRC_CTRLHU_FXOR(x) (((uint8_t)(((uint8_t)(x)) << CRC_CTRLHU_FXOR_SHIFT)) & CRC_CTRLHU_FXOR_MASK) - -#define CRC_CTRLHU_TOTR_MASK (0x30U) -#define CRC_CTRLHU_TOTR_SHIFT (4U) -/*! TOTR - Transpose Type for Read - * 0b00..No transposition - * 0b01..Bits in bytes are transposed, but bytes are not transposed. - * 0b10..Both bits in bytes and bytes are transposed. - * 0b11..Only bytes are transposed, no bits in a byte are transposed. - */ -#define CRC_CTRLHU_TOTR(x) (((uint8_t)(((uint8_t)(x)) << CRC_CTRLHU_TOTR_SHIFT)) & CRC_CTRLHU_TOTR_MASK) - -#define CRC_CTRLHU_TOT_MASK (0xC0U) -#define CRC_CTRLHU_TOT_SHIFT (6U) -/*! TOT - Transpose Type for Write - * 0b00..No transposition - * 0b01..Bits in bytes are transposed, but bytes are not transposed. - * 0b10..Both bits in bytes and bytes are transposed. - * 0b11..Only bytes are transposed, no bits in a byte are transposed. - */ -#define CRC_CTRLHU_TOT(x) (((uint8_t)(((uint8_t)(x)) << CRC_CTRLHU_TOT_SHIFT)) & CRC_CTRLHU_TOT_MASK) -/*! @} */ - -/*! @name CTRL - Control */ -/*! @{ */ - -#define CRC_CTRL_TCRC_MASK (0x1000000U) -#define CRC_CTRL_TCRC_SHIFT (24U) -/*! TCRC - TCRC - * 0b0..16 bits - * 0b1..32 bits - */ -#define CRC_CTRL_TCRC(x) (((uint32_t)(((uint32_t)(x)) << CRC_CTRL_TCRC_SHIFT)) & CRC_CTRL_TCRC_MASK) - -#define CRC_CTRL_WAS_MASK (0x2000000U) -#define CRC_CTRL_WAS_SHIFT (25U) -/*! WAS - Write as Seed - * 0b0..Data values - * 0b1..Seed values - */ -#define CRC_CTRL_WAS(x) (((uint32_t)(((uint32_t)(x)) << CRC_CTRL_WAS_SHIFT)) & CRC_CTRL_WAS_MASK) - -#define CRC_CTRL_FXOR_MASK (0x4000000U) -#define CRC_CTRL_FXOR_SHIFT (26U) -/*! FXOR - Complement Read of CRC Data Register - * 0b0..Disables XOR on reading data. - * 0b1..Inverts or complements the read value of the CRC Data. - */ -#define CRC_CTRL_FXOR(x) (((uint32_t)(((uint32_t)(x)) << CRC_CTRL_FXOR_SHIFT)) & CRC_CTRL_FXOR_MASK) - -#define CRC_CTRL_TOTR_MASK (0x30000000U) -#define CRC_CTRL_TOTR_SHIFT (28U) -/*! TOTR - Transpose Type for Read - * 0b00..No transposition - * 0b01..Bits in bytes are transposed, but bytes are not transposed. - * 0b10..Both bits in bytes and bytes are transposed. - * 0b11..Only bytes are transposed, no bits in a byte are transposed. - */ -#define CRC_CTRL_TOTR(x) (((uint32_t)(((uint32_t)(x)) << CRC_CTRL_TOTR_SHIFT)) & CRC_CTRL_TOTR_MASK) - -#define CRC_CTRL_TOT_MASK (0xC0000000U) -#define CRC_CTRL_TOT_SHIFT (30U) -/*! TOT - Transpose Type for Write - * 0b00..No transposition - * 0b01..Bits in bytes are transposed, but bytes are not transposed. - * 0b10..Both bits in bytes and bytes are transposed. - * 0b11..Only bytes are transposed, no bits in a byte are transposed. - */ -#define CRC_CTRL_TOT(x) (((uint32_t)(((uint32_t)(x)) << CRC_CTRL_TOT_SHIFT)) & CRC_CTRL_TOT_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group CRC_Register_Masks */ - - -/* CRC - Peripheral instance base addresses */ -/** Peripheral CRC0 base address */ -#define CRC0_BASE (0x4008A000u) -/** Peripheral CRC0 base pointer */ -#define CRC0 ((CRC_Type *)CRC0_BASE) -/** Array initializer of CRC peripheral base addresses */ -#define CRC_BASE_ADDRS { CRC0_BASE } -/** Array initializer of CRC peripheral base pointers */ -#define CRC_BASE_PTRS { CRC0 } - -/*! - * @} - */ /* end of group CRC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- CTIMER Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CTIMER_Peripheral_Access_Layer CTIMER Peripheral Access Layer - * @{ - */ - -/** CTIMER - Register Layout Typedef */ -typedef struct { - __IO uint32_t IR; /**< Interrupt, offset: 0x0 */ - __IO uint32_t TCR; /**< Timer Control, offset: 0x4 */ - __IO uint32_t TC; /**< Timer Counter, offset: 0x8 */ - __IO uint32_t PR; /**< Prescale, offset: 0xC */ - __IO uint32_t PC; /**< Prescale Counter, offset: 0x10 */ - __IO uint32_t MCR; /**< Match Control, offset: 0x14 */ - __IO uint32_t MR[4]; /**< Match, array offset: 0x18, array step: 0x4 */ - __IO uint32_t CCR; /**< Capture Control, offset: 0x28 */ - __I uint32_t CR[4]; /**< Capture, array offset: 0x2C, array step: 0x4 */ - __IO uint32_t EMR; /**< External Match, offset: 0x3C */ - uint8_t RESERVED_0[48]; - __IO uint32_t CTCR; /**< Count Control, offset: 0x70 */ - __IO uint32_t PWMC; /**< PWM Control, offset: 0x74 */ - __IO uint32_t MSR[4]; /**< Match Shadow, array offset: 0x78, array step: 0x4 */ -} CTIMER_Type; - -/* ---------------------------------------------------------------------------- - -- CTIMER Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CTIMER_Register_Masks CTIMER Register Masks - * @{ - */ - -/*! @name IR - Interrupt */ -/*! @{ */ - -#define CTIMER_IR_MR0INT_MASK (0x1U) -#define CTIMER_IR_MR0INT_SHIFT (0U) -/*! MR0INT - Interrupt Flag for Match Channel 0 Event */ -#define CTIMER_IR_MR0INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_MR0INT_SHIFT)) & CTIMER_IR_MR0INT_MASK) - -#define CTIMER_IR_MR1INT_MASK (0x2U) -#define CTIMER_IR_MR1INT_SHIFT (1U) -/*! MR1INT - Interrupt Flag for Match Channel 1 Event */ -#define CTIMER_IR_MR1INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_MR1INT_SHIFT)) & CTIMER_IR_MR1INT_MASK) - -#define CTIMER_IR_MR2INT_MASK (0x4U) -#define CTIMER_IR_MR2INT_SHIFT (2U) -/*! MR2INT - Interrupt Flag for Match Channel 2 Event */ -#define CTIMER_IR_MR2INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_MR2INT_SHIFT)) & CTIMER_IR_MR2INT_MASK) - -#define CTIMER_IR_MR3INT_MASK (0x8U) -#define CTIMER_IR_MR3INT_SHIFT (3U) -/*! MR3INT - Interrupt Flag for Match Channel 3 Event */ -#define CTIMER_IR_MR3INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_MR3INT_SHIFT)) & CTIMER_IR_MR3INT_MASK) - -#define CTIMER_IR_CR0INT_MASK (0x10U) -#define CTIMER_IR_CR0INT_SHIFT (4U) -/*! CR0INT - Interrupt Flag for Capture Channel 0 Event */ -#define CTIMER_IR_CR0INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_CR0INT_SHIFT)) & CTIMER_IR_CR0INT_MASK) - -#define CTIMER_IR_CR1INT_MASK (0x20U) -#define CTIMER_IR_CR1INT_SHIFT (5U) -/*! CR1INT - Interrupt Flag for Capture Channel 1 Event */ -#define CTIMER_IR_CR1INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_CR1INT_SHIFT)) & CTIMER_IR_CR1INT_MASK) - -#define CTIMER_IR_CR2INT_MASK (0x40U) -#define CTIMER_IR_CR2INT_SHIFT (6U) -/*! CR2INT - Interrupt Flag for Capture Channel 2 Event */ -#define CTIMER_IR_CR2INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_CR2INT_SHIFT)) & CTIMER_IR_CR2INT_MASK) - -#define CTIMER_IR_CR3INT_MASK (0x80U) -#define CTIMER_IR_CR3INT_SHIFT (7U) -/*! CR3INT - Interrupt Flag for Capture Channel 3 Event */ -#define CTIMER_IR_CR3INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_CR3INT_SHIFT)) & CTIMER_IR_CR3INT_MASK) -/*! @} */ - -/*! @name TCR - Timer Control */ -/*! @{ */ - -#define CTIMER_TCR_CEN_MASK (0x1U) -#define CTIMER_TCR_CEN_SHIFT (0U) -/*! CEN - Counter Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_TCR_CEN(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TCR_CEN_SHIFT)) & CTIMER_TCR_CEN_MASK) - -#define CTIMER_TCR_CRST_MASK (0x2U) -#define CTIMER_TCR_CRST_SHIFT (1U) -/*! CRST - Counter Reset Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_TCR_CRST(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TCR_CRST_SHIFT)) & CTIMER_TCR_CRST_MASK) - -#define CTIMER_TCR_AGCEN_MASK (0x10U) -#define CTIMER_TCR_AGCEN_SHIFT (4U) -/*! AGCEN - Allow Global Count Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_TCR_AGCEN(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TCR_AGCEN_SHIFT)) & CTIMER_TCR_AGCEN_MASK) - -#define CTIMER_TCR_ATCEN_MASK (0x20U) -#define CTIMER_TCR_ATCEN_SHIFT (5U) -/*! ATCEN - Allow Trigger Count Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_TCR_ATCEN(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TCR_ATCEN_SHIFT)) & CTIMER_TCR_ATCEN_MASK) -/*! @} */ - -/*! @name TC - Timer Counter */ -/*! @{ */ - -#define CTIMER_TC_TCVAL_MASK (0xFFFFFFFFU) -#define CTIMER_TC_TCVAL_SHIFT (0U) -/*! TCVAL - Timer Counter Value */ -#define CTIMER_TC_TCVAL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TC_TCVAL_SHIFT)) & CTIMER_TC_TCVAL_MASK) -/*! @} */ - -/*! @name PR - Prescale */ -/*! @{ */ - -#define CTIMER_PR_PRVAL_MASK (0xFFFFFFFFU) -#define CTIMER_PR_PRVAL_SHIFT (0U) -/*! PRVAL - Prescale Reload Value */ -#define CTIMER_PR_PRVAL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PR_PRVAL_SHIFT)) & CTIMER_PR_PRVAL_MASK) -/*! @} */ - -/*! @name PC - Prescale Counter */ -/*! @{ */ - -#define CTIMER_PC_PCVAL_MASK (0xFFFFFFFFU) -#define CTIMER_PC_PCVAL_SHIFT (0U) -/*! PCVAL - Prescale Counter Value */ -#define CTIMER_PC_PCVAL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PC_PCVAL_SHIFT)) & CTIMER_PC_PCVAL_MASK) -/*! @} */ - -/*! @name MCR - Match Control */ -/*! @{ */ - -#define CTIMER_MCR_MR0I_MASK (0x1U) -#define CTIMER_MCR_MR0I_SHIFT (0U) -/*! MR0I - Interrupt on MR0 - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_MCR_MR0I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR0I_SHIFT)) & CTIMER_MCR_MR0I_MASK) - -#define CTIMER_MCR_MR0R_MASK (0x2U) -#define CTIMER_MCR_MR0R_SHIFT (1U) -/*! MR0R - Reset on MR0 - * 0b0..Does not reset - * 0b1..Resets - */ -#define CTIMER_MCR_MR0R(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR0R_SHIFT)) & CTIMER_MCR_MR0R_MASK) - -#define CTIMER_MCR_MR0S_MASK (0x4U) -#define CTIMER_MCR_MR0S_SHIFT (2U) -/*! MR0S - Stop on MR0 - * 0b0..Does not stop - * 0b1..Stops - */ -#define CTIMER_MCR_MR0S(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR0S_SHIFT)) & CTIMER_MCR_MR0S_MASK) - -#define CTIMER_MCR_MR1I_MASK (0x8U) -#define CTIMER_MCR_MR1I_SHIFT (3U) -/*! MR1I - Interrupt on MR1 - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_MCR_MR1I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR1I_SHIFT)) & CTIMER_MCR_MR1I_MASK) - -#define CTIMER_MCR_MR1R_MASK (0x10U) -#define CTIMER_MCR_MR1R_SHIFT (4U) -/*! MR1R - Reset on MR1 - * 0b0..Does not reset - * 0b1..Resets - */ -#define CTIMER_MCR_MR1R(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR1R_SHIFT)) & CTIMER_MCR_MR1R_MASK) - -#define CTIMER_MCR_MR1S_MASK (0x20U) -#define CTIMER_MCR_MR1S_SHIFT (5U) -/*! MR1S - Stop on MR1 - * 0b0..Does not stop - * 0b1..Stops - */ -#define CTIMER_MCR_MR1S(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR1S_SHIFT)) & CTIMER_MCR_MR1S_MASK) - -#define CTIMER_MCR_MR2I_MASK (0x40U) -#define CTIMER_MCR_MR2I_SHIFT (6U) -/*! MR2I - Interrupt on MR2 - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_MCR_MR2I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR2I_SHIFT)) & CTIMER_MCR_MR2I_MASK) - -#define CTIMER_MCR_MR2R_MASK (0x80U) -#define CTIMER_MCR_MR2R_SHIFT (7U) -/*! MR2R - Reset on MR2 - * 0b0..Does not reset - * 0b1..Resets - */ -#define CTIMER_MCR_MR2R(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR2R_SHIFT)) & CTIMER_MCR_MR2R_MASK) - -#define CTIMER_MCR_MR2S_MASK (0x100U) -#define CTIMER_MCR_MR2S_SHIFT (8U) -/*! MR2S - Stop on MR2 - * 0b0..Does not stop - * 0b1..Stops - */ -#define CTIMER_MCR_MR2S(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR2S_SHIFT)) & CTIMER_MCR_MR2S_MASK) - -#define CTIMER_MCR_MR3I_MASK (0x200U) -#define CTIMER_MCR_MR3I_SHIFT (9U) -/*! MR3I - Interrupt on MR3 - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_MCR_MR3I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR3I_SHIFT)) & CTIMER_MCR_MR3I_MASK) - -#define CTIMER_MCR_MR3R_MASK (0x400U) -#define CTIMER_MCR_MR3R_SHIFT (10U) -/*! MR3R - Reset on MR3 - * 0b0..Does not reset - * 0b1..Resets - */ -#define CTIMER_MCR_MR3R(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR3R_SHIFT)) & CTIMER_MCR_MR3R_MASK) - -#define CTIMER_MCR_MR3S_MASK (0x800U) -#define CTIMER_MCR_MR3S_SHIFT (11U) -/*! MR3S - Stop on MR3 - * 0b0..Does not stop - * 0b1..Stops - */ -#define CTIMER_MCR_MR3S(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR3S_SHIFT)) & CTIMER_MCR_MR3S_MASK) - -#define CTIMER_MCR_MR0RL_MASK (0x1000000U) -#define CTIMER_MCR_MR0RL_SHIFT (24U) -/*! MR0RL - Reload MR - * 0b0..Does not reload - * 0b1..Reloads - */ -#define CTIMER_MCR_MR0RL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR0RL_SHIFT)) & CTIMER_MCR_MR0RL_MASK) - -#define CTIMER_MCR_MR1RL_MASK (0x2000000U) -#define CTIMER_MCR_MR1RL_SHIFT (25U) -/*! MR1RL - Reload MR - * 0b0..Does not reload - * 0b1..Reloads - */ -#define CTIMER_MCR_MR1RL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR1RL_SHIFT)) & CTIMER_MCR_MR1RL_MASK) - -#define CTIMER_MCR_MR2RL_MASK (0x4000000U) -#define CTIMER_MCR_MR2RL_SHIFT (26U) -/*! MR2RL - Reload MR - * 0b0..Does not reload - * 0b1..Reloads - */ -#define CTIMER_MCR_MR2RL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR2RL_SHIFT)) & CTIMER_MCR_MR2RL_MASK) - -#define CTIMER_MCR_MR3RL_MASK (0x8000000U) -#define CTIMER_MCR_MR3RL_SHIFT (27U) -/*! MR3RL - Reload MR - * 0b0..Does not reload - * 0b1..Reloads - */ -#define CTIMER_MCR_MR3RL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR3RL_SHIFT)) & CTIMER_MCR_MR3RL_MASK) -/*! @} */ - -/*! @name MR - Match */ -/*! @{ */ - -#define CTIMER_MR_MATCH_MASK (0xFFFFFFFFU) -#define CTIMER_MR_MATCH_SHIFT (0U) -/*! MATCH - Timer Counter Match Value */ -#define CTIMER_MR_MATCH(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MR_MATCH_SHIFT)) & CTIMER_MR_MATCH_MASK) -/*! @} */ - -/* The count of CTIMER_MR */ -#define CTIMER_MR_COUNT (4U) - -/*! @name CCR - Capture Control */ -/*! @{ */ - -#define CTIMER_CCR_CAP0RE_MASK (0x1U) -#define CTIMER_CCR_CAP0RE_SHIFT (0U) -/*! CAP0RE - Rising Edge of Capture Channel 0 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP0RE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP0RE_SHIFT)) & CTIMER_CCR_CAP0RE_MASK) - -#define CTIMER_CCR_CAP0FE_MASK (0x2U) -#define CTIMER_CCR_CAP0FE_SHIFT (1U) -/*! CAP0FE - Falling Edge of Capture Channel 0 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP0FE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP0FE_SHIFT)) & CTIMER_CCR_CAP0FE_MASK) - -#define CTIMER_CCR_CAP0I_MASK (0x4U) -#define CTIMER_CCR_CAP0I_SHIFT (2U) -/*! CAP0I - Generate Interrupt on Channel 0 Capture Event - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_CCR_CAP0I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP0I_SHIFT)) & CTIMER_CCR_CAP0I_MASK) - -#define CTIMER_CCR_CAP1RE_MASK (0x8U) -#define CTIMER_CCR_CAP1RE_SHIFT (3U) -/*! CAP1RE - Rising Edge of Capture Channel 1 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP1RE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP1RE_SHIFT)) & CTIMER_CCR_CAP1RE_MASK) - -#define CTIMER_CCR_CAP1FE_MASK (0x10U) -#define CTIMER_CCR_CAP1FE_SHIFT (4U) -/*! CAP1FE - Falling Edge of Capture Channel 1 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP1FE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP1FE_SHIFT)) & CTIMER_CCR_CAP1FE_MASK) - -#define CTIMER_CCR_CAP1I_MASK (0x20U) -#define CTIMER_CCR_CAP1I_SHIFT (5U) -/*! CAP1I - Generate Interrupt on Channel 1 Capture Event - * 0b0..Does not generates - * 0b1..Generates - */ -#define CTIMER_CCR_CAP1I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP1I_SHIFT)) & CTIMER_CCR_CAP1I_MASK) - -#define CTIMER_CCR_CAP2RE_MASK (0x40U) -#define CTIMER_CCR_CAP2RE_SHIFT (6U) -/*! CAP2RE - Rising Edge of Capture Channel 2 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP2RE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP2RE_SHIFT)) & CTIMER_CCR_CAP2RE_MASK) - -#define CTIMER_CCR_CAP2FE_MASK (0x80U) -#define CTIMER_CCR_CAP2FE_SHIFT (7U) -/*! CAP2FE - Falling Edge of Capture Channel 2 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP2FE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP2FE_SHIFT)) & CTIMER_CCR_CAP2FE_MASK) - -#define CTIMER_CCR_CAP2I_MASK (0x100U) -#define CTIMER_CCR_CAP2I_SHIFT (8U) -/*! CAP2I - Generate Interrupt on Channel 2 Capture Event - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_CCR_CAP2I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP2I_SHIFT)) & CTIMER_CCR_CAP2I_MASK) - -#define CTIMER_CCR_CAP3RE_MASK (0x200U) -#define CTIMER_CCR_CAP3RE_SHIFT (9U) -/*! CAP3RE - Rising Edge of Capture Channel 3 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP3RE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP3RE_SHIFT)) & CTIMER_CCR_CAP3RE_MASK) - -#define CTIMER_CCR_CAP3FE_MASK (0x400U) -#define CTIMER_CCR_CAP3FE_SHIFT (10U) -/*! CAP3FE - Falling Edge of Capture Channel 3 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP3FE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP3FE_SHIFT)) & CTIMER_CCR_CAP3FE_MASK) - -#define CTIMER_CCR_CAP3I_MASK (0x800U) -#define CTIMER_CCR_CAP3I_SHIFT (11U) -/*! CAP3I - Generate Interrupt on Channel 3 Capture Event - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_CCR_CAP3I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP3I_SHIFT)) & CTIMER_CCR_CAP3I_MASK) -/*! @} */ - -/*! @name CR - Capture */ -/*! @{ */ - -#define CTIMER_CR_CAP_MASK (0xFFFFFFFFU) -#define CTIMER_CR_CAP_SHIFT (0U) -/*! CAP - Timer Counter Capture Value */ -#define CTIMER_CR_CAP(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CR_CAP_SHIFT)) & CTIMER_CR_CAP_MASK) -/*! @} */ - -/* The count of CTIMER_CR */ -#define CTIMER_CR_COUNT (4U) - -/*! @name EMR - External Match */ -/*! @{ */ - -#define CTIMER_EMR_EM0_MASK (0x1U) -#define CTIMER_EMR_EM0_SHIFT (0U) -/*! EM0 - External Match 0 - * 0b0..Low - * 0b1..High - */ -#define CTIMER_EMR_EM0(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EM0_SHIFT)) & CTIMER_EMR_EM0_MASK) - -#define CTIMER_EMR_EM1_MASK (0x2U) -#define CTIMER_EMR_EM1_SHIFT (1U) -/*! EM1 - External Match 1 - * 0b0..Low - * 0b1..High - */ -#define CTIMER_EMR_EM1(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EM1_SHIFT)) & CTIMER_EMR_EM1_MASK) - -#define CTIMER_EMR_EM2_MASK (0x4U) -#define CTIMER_EMR_EM2_SHIFT (2U) -/*! EM2 - External Match 2 - * 0b0..Low - * 0b1..High - */ -#define CTIMER_EMR_EM2(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EM2_SHIFT)) & CTIMER_EMR_EM2_MASK) - -#define CTIMER_EMR_EM3_MASK (0x8U) -#define CTIMER_EMR_EM3_SHIFT (3U) -/*! EM3 - External Match 3 - * 0b0..Low - * 0b1..High - */ -#define CTIMER_EMR_EM3(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EM3_SHIFT)) & CTIMER_EMR_EM3_MASK) - -#define CTIMER_EMR_EMC0_MASK (0x30U) -#define CTIMER_EMR_EMC0_SHIFT (4U) -/*! EMC0 - External Match Control 0 - * 0b00..Does nothing - * 0b01..Goes low - * 0b10..Goes high - * 0b11..Toggles - */ -#define CTIMER_EMR_EMC0(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EMC0_SHIFT)) & CTIMER_EMR_EMC0_MASK) - -#define CTIMER_EMR_EMC1_MASK (0xC0U) -#define CTIMER_EMR_EMC1_SHIFT (6U) -/*! EMC1 - External Match Control 1 - * 0b00..Does nothing - * 0b01..Goes low - * 0b10..Goes high - * 0b11..Toggles - */ -#define CTIMER_EMR_EMC1(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EMC1_SHIFT)) & CTIMER_EMR_EMC1_MASK) - -#define CTIMER_EMR_EMC2_MASK (0x300U) -#define CTIMER_EMR_EMC2_SHIFT (8U) -/*! EMC2 - External Match Control 2 - * 0b00..Does nothing - * 0b01..Goes low - * 0b10..Goes high - * 0b11..Toggles - */ -#define CTIMER_EMR_EMC2(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EMC2_SHIFT)) & CTIMER_EMR_EMC2_MASK) - -#define CTIMER_EMR_EMC3_MASK (0xC00U) -#define CTIMER_EMR_EMC3_SHIFT (10U) -/*! EMC3 - External Match Control 3 - * 0b00..Does nothing - * 0b01..Goes low - * 0b10..Goes high - * 0b11..Toggles - */ -#define CTIMER_EMR_EMC3(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EMC3_SHIFT)) & CTIMER_EMR_EMC3_MASK) -/*! @} */ - -/*! @name CTCR - Count Control */ -/*! @{ */ - -#define CTIMER_CTCR_CTMODE_MASK (0x3U) -#define CTIMER_CTCR_CTMODE_SHIFT (0U) -/*! CTMODE - Counter Timer Mode - * 0b00..Timer mode - * 0b01..Counter mode rising edge - * 0b10..Counter mode falling edge - * 0b11..Counter mode dual edge - */ -#define CTIMER_CTCR_CTMODE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CTCR_CTMODE_SHIFT)) & CTIMER_CTCR_CTMODE_MASK) - -#define CTIMER_CTCR_CINSEL_MASK (0xCU) -#define CTIMER_CTCR_CINSEL_SHIFT (2U) -/*! CINSEL - Count Input Select - * 0b00..Channel 0, CAPn[0] for CTIMERn - * 0b01..Channel 1, CAPn[1] for CTIMERn - * 0b10..Channel 2, CAPn[2] for CTIMERn - * 0b11..Channel 3, CAPn[3] for CTIMERn - */ -#define CTIMER_CTCR_CINSEL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CTCR_CINSEL_SHIFT)) & CTIMER_CTCR_CINSEL_MASK) - -#define CTIMER_CTCR_ENCC_MASK (0x10U) -#define CTIMER_CTCR_ENCC_SHIFT (4U) -/*! ENCC - Capture Channel Enable */ -#define CTIMER_CTCR_ENCC(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CTCR_ENCC_SHIFT)) & CTIMER_CTCR_ENCC_MASK) - -#define CTIMER_CTCR_SELCC_MASK (0xE0U) -#define CTIMER_CTCR_SELCC_SHIFT (5U) -/*! SELCC - Edge Select - * 0b000..Capture channel 0 rising edge - * 0b001..Capture channel 0 falling edge - * 0b010..Capture channel 1 rising edge - * 0b011..Capture channel 1 falling edge - * 0b100..Capture channel 2 rising edge - * 0b101..Capture channel 2 falling edge - */ -#define CTIMER_CTCR_SELCC(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CTCR_SELCC_SHIFT)) & CTIMER_CTCR_SELCC_MASK) -/*! @} */ - -/*! @name PWMC - PWM Control */ -/*! @{ */ - -#define CTIMER_PWMC_PWMEN0_MASK (0x1U) -#define CTIMER_PWMC_PWMEN0_SHIFT (0U) -/*! PWMEN0 - PWM Mode Enable for Channel 0 - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_PWMC_PWMEN0(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PWMC_PWMEN0_SHIFT)) & CTIMER_PWMC_PWMEN0_MASK) - -#define CTIMER_PWMC_PWMEN1_MASK (0x2U) -#define CTIMER_PWMC_PWMEN1_SHIFT (1U) -/*! PWMEN1 - PWM Mode Enable for Channel 1 - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_PWMC_PWMEN1(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PWMC_PWMEN1_SHIFT)) & CTIMER_PWMC_PWMEN1_MASK) - -#define CTIMER_PWMC_PWMEN2_MASK (0x4U) -#define CTIMER_PWMC_PWMEN2_SHIFT (2U) -/*! PWMEN2 - PWM Mode Enable for Channel 2 - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_PWMC_PWMEN2(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PWMC_PWMEN2_SHIFT)) & CTIMER_PWMC_PWMEN2_MASK) - -#define CTIMER_PWMC_PWMEN3_MASK (0x8U) -#define CTIMER_PWMC_PWMEN3_SHIFT (3U) -/*! PWMEN3 - PWM Mode Enable for Channel 3 - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_PWMC_PWMEN3(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PWMC_PWMEN3_SHIFT)) & CTIMER_PWMC_PWMEN3_MASK) -/*! @} */ - -/*! @name MSR - Match Shadow */ -/*! @{ */ - -#define CTIMER_MSR_MATCH_SHADOW_MASK (0xFFFFFFFFU) -#define CTIMER_MSR_MATCH_SHADOW_SHIFT (0U) -/*! MATCH_SHADOW - Timer Counter Match Shadow Value */ -#define CTIMER_MSR_MATCH_SHADOW(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MSR_MATCH_SHADOW_SHIFT)) & CTIMER_MSR_MATCH_SHADOW_MASK) -/*! @} */ - -/* The count of CTIMER_MSR */ -#define CTIMER_MSR_COUNT (4U) - - -/*! - * @} - */ /* end of group CTIMER_Register_Masks */ - - -/* CTIMER - Peripheral instance base addresses */ -/** Peripheral CTIMER0 base address */ -#define CTIMER0_BASE (0x40004000u) -/** Peripheral CTIMER0 base pointer */ -#define CTIMER0 ((CTIMER_Type *)CTIMER0_BASE) -/** Peripheral CTIMER1 base address */ -#define CTIMER1_BASE (0x40005000u) -/** Peripheral CTIMER1 base pointer */ -#define CTIMER1 ((CTIMER_Type *)CTIMER1_BASE) -/** Peripheral CTIMER2 base address */ -#define CTIMER2_BASE (0x40006000u) -/** Peripheral CTIMER2 base pointer */ -#define CTIMER2 ((CTIMER_Type *)CTIMER2_BASE) -/** Peripheral CTIMER3 base address */ -#define CTIMER3_BASE (0x40007000u) -/** Peripheral CTIMER3 base pointer */ -#define CTIMER3 ((CTIMER_Type *)CTIMER3_BASE) -/** Peripheral CTIMER4 base address */ -#define CTIMER4_BASE (0x40008000u) -/** Peripheral CTIMER4 base pointer */ -#define CTIMER4 ((CTIMER_Type *)CTIMER4_BASE) -/** Array initializer of CTIMER peripheral base addresses */ -#define CTIMER_BASE_ADDRS { CTIMER0_BASE, CTIMER1_BASE, CTIMER2_BASE, CTIMER3_BASE, CTIMER4_BASE } -/** Array initializer of CTIMER peripheral base pointers */ -#define CTIMER_BASE_PTRS { CTIMER0, CTIMER1, CTIMER2, CTIMER3, CTIMER4 } -/** Interrupt vectors for the CTIMER peripheral type */ -#define CTIMER_IRQS { CTIMER0_IRQn, CTIMER1_IRQn, CTIMER2_IRQn, CTIMER3_IRQn, CTIMER4_IRQn } - -/*! - * @} - */ /* end of group CTIMER_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- DEBUGMAILBOX Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DEBUGMAILBOX_Peripheral_Access_Layer DEBUGMAILBOX Peripheral Access Layer - * @{ - */ - -/** DEBUGMAILBOX - Register Layout Typedef */ -typedef struct { - __IO uint32_t CSW; /**< Command and Status Word, offset: 0x0 */ - __IO uint32_t REQUEST; /**< Request Value, offset: 0x4 */ - __IO uint32_t RETURN; /**< Return Value, offset: 0x8 */ - uint8_t RESERVED_0[240]; - __I uint32_t ID; /**< Identification, offset: 0xFC */ -} DEBUGMAILBOX_Type; - -/* ---------------------------------------------------------------------------- - -- DEBUGMAILBOX Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DEBUGMAILBOX_Register_Masks DEBUGMAILBOX Register Masks - * @{ - */ - -/*! @name CSW - Command and Status Word */ -/*! @{ */ - -#define DEBUGMAILBOX_CSW_RESYNCH_REQ_MASK (0x1U) -#define DEBUGMAILBOX_CSW_RESYNCH_REQ_SHIFT (0U) -/*! RESYNCH_REQ - Resynchronization Request - * 0b0..No request - * 0b1..Request for resynchronization - */ -#define DEBUGMAILBOX_CSW_RESYNCH_REQ(x) (((uint32_t)(((uint32_t)(x)) << DEBUGMAILBOX_CSW_RESYNCH_REQ_SHIFT)) & DEBUGMAILBOX_CSW_RESYNCH_REQ_MASK) - -#define DEBUGMAILBOX_CSW_REQ_PENDING_MASK (0x2U) -#define DEBUGMAILBOX_CSW_REQ_PENDING_SHIFT (1U) -/*! REQ_PENDING - Request Pending - * 0b0..No request pending - * 0b1..Request for resynchronization pending - */ -#define DEBUGMAILBOX_CSW_REQ_PENDING(x) (((uint32_t)(((uint32_t)(x)) << DEBUGMAILBOX_CSW_REQ_PENDING_SHIFT)) & DEBUGMAILBOX_CSW_REQ_PENDING_MASK) - -#define DEBUGMAILBOX_CSW_DBG_OR_ERR_MASK (0x4U) -#define DEBUGMAILBOX_CSW_DBG_OR_ERR_SHIFT (2U) -/*! DBG_OR_ERR - DBGMB Overrun Error - * 0b0..No overrun - * 0b1..Overrun occurred - */ -#define DEBUGMAILBOX_CSW_DBG_OR_ERR(x) (((uint32_t)(((uint32_t)(x)) << DEBUGMAILBOX_CSW_DBG_OR_ERR_SHIFT)) & DEBUGMAILBOX_CSW_DBG_OR_ERR_MASK) - -#define DEBUGMAILBOX_CSW_AHB_OR_ERR_MASK (0x8U) -#define DEBUGMAILBOX_CSW_AHB_OR_ERR_SHIFT (3U) -/*! AHB_OR_ERR - AHB Overrun Error - * 0b0..No overrun - * 0b1..Overrun occurred - */ -#define DEBUGMAILBOX_CSW_AHB_OR_ERR(x) (((uint32_t)(((uint32_t)(x)) << DEBUGMAILBOX_CSW_AHB_OR_ERR_SHIFT)) & DEBUGMAILBOX_CSW_AHB_OR_ERR_MASK) - -#define DEBUGMAILBOX_CSW_SOFT_RESET_MASK (0x10U) -#define DEBUGMAILBOX_CSW_SOFT_RESET_SHIFT (4U) -/*! SOFT_RESET - Soft Reset */ -#define DEBUGMAILBOX_CSW_SOFT_RESET(x) (((uint32_t)(((uint32_t)(x)) << DEBUGMAILBOX_CSW_SOFT_RESET_SHIFT)) & DEBUGMAILBOX_CSW_SOFT_RESET_MASK) - -#define DEBUGMAILBOX_CSW_CHIP_RESET_REQ_MASK (0x20U) -#define DEBUGMAILBOX_CSW_CHIP_RESET_REQ_SHIFT (5U) -/*! CHIP_RESET_REQ - Chip Reset Request */ -#define DEBUGMAILBOX_CSW_CHIP_RESET_REQ(x) (((uint32_t)(((uint32_t)(x)) << DEBUGMAILBOX_CSW_CHIP_RESET_REQ_SHIFT)) & DEBUGMAILBOX_CSW_CHIP_RESET_REQ_MASK) -/*! @} */ - -/*! @name REQUEST - Request Value */ -/*! @{ */ - -#define DEBUGMAILBOX_REQUEST_REQUEST_MASK (0xFFFFFFFFU) -#define DEBUGMAILBOX_REQUEST_REQUEST_SHIFT (0U) -/*! REQUEST - Request Value */ -#define DEBUGMAILBOX_REQUEST_REQUEST(x) (((uint32_t)(((uint32_t)(x)) << DEBUGMAILBOX_REQUEST_REQUEST_SHIFT)) & DEBUGMAILBOX_REQUEST_REQUEST_MASK) -/*! @} */ - -/*! @name RETURN - Return Value */ -/*! @{ */ - -#define DEBUGMAILBOX_RETURN_RET_MASK (0xFFFFFFFFU) -#define DEBUGMAILBOX_RETURN_RET_SHIFT (0U) -/*! RET - Return Value */ -#define DEBUGMAILBOX_RETURN_RET(x) (((uint32_t)(((uint32_t)(x)) << DEBUGMAILBOX_RETURN_RET_SHIFT)) & DEBUGMAILBOX_RETURN_RET_MASK) -/*! @} */ - -/*! @name ID - Identification */ -/*! @{ */ - -#define DEBUGMAILBOX_ID_ID_MASK (0xFFFFFFFFU) -#define DEBUGMAILBOX_ID_ID_SHIFT (0U) -/*! ID - Identification Value */ -#define DEBUGMAILBOX_ID_ID(x) (((uint32_t)(((uint32_t)(x)) << DEBUGMAILBOX_ID_ID_SHIFT)) & DEBUGMAILBOX_ID_ID_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group DEBUGMAILBOX_Register_Masks */ - - -/* DEBUGMAILBOX - Peripheral instance base addresses */ -/** Peripheral DBGMAILBOX base address */ -#define DBGMAILBOX_BASE (0x40101000u) -/** Peripheral DBGMAILBOX base pointer */ -#define DBGMAILBOX ((DEBUGMAILBOX_Type *)DBGMAILBOX_BASE) -/** Array initializer of DEBUGMAILBOX peripheral base addresses */ -#define DEBUGMAILBOX_BASE_ADDRS { DBGMAILBOX_BASE } -/** Array initializer of DEBUGMAILBOX peripheral base pointers */ -#define DEBUGMAILBOX_BASE_PTRS { DBGMAILBOX } - -/*! - * @} - */ /* end of group DEBUGMAILBOX_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- DMA Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DMA_Peripheral_Access_Layer DMA Peripheral Access Layer - * @{ - */ - -/** DMA - Register Layout Typedef */ -typedef struct { - __IO uint32_t MP_CSR; /**< Management Page Control, offset: 0x0 */ - __I uint32_t MP_ES; /**< Management Page Error Status, offset: 0x4 */ - __I uint32_t MP_INT; /**< Management Page Interrupt Request Status, offset: 0x8 */ - __I uint32_t MP_HRS; /**< Management Page Hardware Request Status, offset: 0xC */ - uint8_t RESERVED_0[240]; - __IO uint32_t CH_GRPRI[8]; /**< Channel Arbitration Group, array offset: 0x100, array step: 0x4 */ - uint8_t RESERVED_1[3808]; - struct { /* offset: 0x1000, array step: 0x1000 */ - __IO uint32_t CH_CSR; /**< Channel Control and Status, array offset: 0x1000, array step: 0x1000 */ - __IO uint32_t CH_ES; /**< Channel Error Status, array offset: 0x1004, array step: 0x1000 */ - __IO uint32_t CH_INT; /**< Channel Interrupt Status, array offset: 0x1008, array step: 0x1000 */ - __IO uint32_t CH_SBR; /**< Channel System Bus, array offset: 0x100C, array step: 0x1000 */ - __IO uint32_t CH_PRI; /**< Channel Priority, array offset: 0x1010, array step: 0x1000 */ - __IO uint32_t CH_MUX; /**< Channel Multiplexor Configuration, array offset: 0x1014, array step: 0x1000 */ - uint8_t RESERVED_0[8]; - __IO uint32_t TCD_SADDR; /**< TCD Source Address, array offset: 0x1020, array step: 0x1000 */ - __IO uint16_t TCD_SOFF; /**< TCD Signed Source Address Offset, array offset: 0x1024, array step: 0x1000 */ - __IO uint16_t TCD_ATTR; /**< TCD Transfer Attributes, array offset: 0x1026, array step: 0x1000 */ - union { /* offset: 0x1028, array step: 0x1000 */ - __IO uint32_t TCD_NBYTES_MLOFFNO; /**< TCD Transfer Size Without Minor Loop Offsets, array offset: 0x1028, array step: 0x1000 */ - __IO uint32_t TCD_NBYTES_MLOFFYES; /**< TCD Transfer Size with Minor Loop Offsets, array offset: 0x1028, array step: 0x1000 */ - }; - __IO uint32_t TCD_SLAST_SDA; /**< TCD Last Source Address Adjustment / Store DADDR Address, array offset: 0x102C, array step: 0x1000 */ - __IO uint32_t TCD_DADDR; /**< TCD Destination Address, array offset: 0x1030, array step: 0x1000 */ - __IO uint16_t TCD_DOFF; /**< TCD Signed Destination Address Offset, array offset: 0x1034, array step: 0x1000 */ - union { /* offset: 0x1036, array step: 0x1000 */ - __IO uint16_t TCD_CITER_ELINKNO; /**< TCD Current Major Loop Count (Minor Loop Channel Linking Disabled), array offset: 0x1036, array step: 0x1000 */ - __IO uint16_t TCD_CITER_ELINKYES; /**< TCD Current Major Loop Count (Minor Loop Channel Linking Enabled), array offset: 0x1036, array step: 0x1000 */ - }; - __IO uint32_t TCD_DLAST_SGA; /**< TCD Last Destination Address Adjustment / Scatter Gather Address, array offset: 0x1038, array step: 0x1000 */ - __IO uint16_t TCD_CSR; /**< TCD Control and Status, array offset: 0x103C, array step: 0x1000 */ - union { /* offset: 0x103E, array step: 0x1000 */ - __IO uint16_t TCD_BITER_ELINKNO; /**< TCD Beginning Major Loop Count (Minor Loop Channel Linking Disabled), array offset: 0x103E, array step: 0x1000 */ - __IO uint16_t TCD_BITER_ELINKYES; /**< TCD Beginning Major Loop Count (Minor Loop Channel Linking Enabled), array offset: 0x103E, array step: 0x1000 */ - }; - uint8_t RESERVED_1[4032]; - } CH[8]; -} DMA_Type; - -/* ---------------------------------------------------------------------------- - -- DMA Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DMA_Register_Masks DMA Register Masks - * @{ - */ - -/*! @name MP_CSR - Management Page Control */ -/*! @{ */ - -#define DMA_MP_CSR_EDBG_MASK (0x2U) -#define DMA_MP_CSR_EDBG_SHIFT (1U) -/*! EDBG - Enable Debug - * 0b0..Debug mode disabled - * 0b1..Debug mode is enabled. - */ -#define DMA_MP_CSR_EDBG(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_EDBG_SHIFT)) & DMA_MP_CSR_EDBG_MASK) - -#define DMA_MP_CSR_ERCA_MASK (0x4U) -#define DMA_MP_CSR_ERCA_SHIFT (2U) -/*! ERCA - Enable Round Robin Channel Arbitration - * 0b0..Round-robin channel arbitration disabled - * 0b1..Round-robin channel arbitration enabled - */ -#define DMA_MP_CSR_ERCA(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_ERCA_SHIFT)) & DMA_MP_CSR_ERCA_MASK) - -#define DMA_MP_CSR_HAE_MASK (0x10U) -#define DMA_MP_CSR_HAE_SHIFT (4U) -/*! HAE - Halt After Error - * 0b0..Normal operation - * 0b1..Any error causes the HALT field to be set to 1 - */ -#define DMA_MP_CSR_HAE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_HAE_SHIFT)) & DMA_MP_CSR_HAE_MASK) - -#define DMA_MP_CSR_HALT_MASK (0x20U) -#define DMA_MP_CSR_HALT_SHIFT (5U) -/*! HALT - Halt DMA Operations - * 0b0..Normal operation - * 0b1..Stall the start of any new channels - */ -#define DMA_MP_CSR_HALT(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_HALT_SHIFT)) & DMA_MP_CSR_HALT_MASK) - -#define DMA_MP_CSR_GCLC_MASK (0x40U) -#define DMA_MP_CSR_GCLC_SHIFT (6U) -/*! GCLC - Global Channel Linking Control - * 0b0..Channel linking disabled for all channels - * 0b1..Channel linking available and controlled by each channel's link settings - */ -#define DMA_MP_CSR_GCLC(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_GCLC_SHIFT)) & DMA_MP_CSR_GCLC_MASK) - -#define DMA_MP_CSR_GMRC_MASK (0x80U) -#define DMA_MP_CSR_GMRC_SHIFT (7U) -/*! GMRC - Global Master ID Replication Control - * 0b0..Master ID replication disabled for all channels - * 0b1..Master ID replication available and controlled by each channel's CHn_SBR[EMI] setting - */ -#define DMA_MP_CSR_GMRC(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_GMRC_SHIFT)) & DMA_MP_CSR_GMRC_MASK) - -#define DMA_MP_CSR_ECX_MASK (0x100U) -#define DMA_MP_CSR_ECX_SHIFT (8U) -/*! ECX - Cancel Transfer With Error - * 0b0..Normal operation - * 0b1..Cancel the remaining data transfer - */ -#define DMA_MP_CSR_ECX(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_ECX_SHIFT)) & DMA_MP_CSR_ECX_MASK) - -#define DMA_MP_CSR_CX_MASK (0x200U) -#define DMA_MP_CSR_CX_SHIFT (9U) -/*! CX - Cancel Transfer - * 0b0..Normal operation - * 0b1..Cancel the remaining data transfer - */ -#define DMA_MP_CSR_CX(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_CX_SHIFT)) & DMA_MP_CSR_CX_MASK) - -#define DMA_MP_CSR_ACTIVE_ID_MASK (0x7000000U) -#define DMA_MP_CSR_ACTIVE_ID_SHIFT (24U) -/*! ACTIVE_ID - Active Channel ID */ -#define DMA_MP_CSR_ACTIVE_ID(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_ACTIVE_ID_SHIFT)) & DMA_MP_CSR_ACTIVE_ID_MASK) - -#define DMA_MP_CSR_ACTIVE_MASK (0x80000000U) -#define DMA_MP_CSR_ACTIVE_SHIFT (31U) -/*! ACTIVE - DMA Active Status - * 0b0..eDMA is idle - * 0b1..eDMA is executing a channel - */ -#define DMA_MP_CSR_ACTIVE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_ACTIVE_SHIFT)) & DMA_MP_CSR_ACTIVE_MASK) -/*! @} */ - -/*! @name MP_ES - Management Page Error Status */ -/*! @{ */ - -#define DMA_MP_ES_DBE_MASK (0x1U) -#define DMA_MP_ES_DBE_SHIFT (0U) -/*! DBE - Destination Bus Error - * 0b0..No destination bus error - * 0b1..Last recorded error was a bus error on a destination write - */ -#define DMA_MP_ES_DBE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_DBE_SHIFT)) & DMA_MP_ES_DBE_MASK) - -#define DMA_MP_ES_SBE_MASK (0x2U) -#define DMA_MP_ES_SBE_SHIFT (1U) -/*! SBE - Source Bus Error - * 0b0..No source bus error - * 0b1..Last recorded error was a bus error on a source read - */ -#define DMA_MP_ES_SBE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_SBE_SHIFT)) & DMA_MP_ES_SBE_MASK) - -#define DMA_MP_ES_SGE_MASK (0x4U) -#define DMA_MP_ES_SGE_SHIFT (2U) -/*! SGE - Scatter/Gather Configuration Error - * 0b0..No scatter/gather configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_DLAST_SGA field - */ -#define DMA_MP_ES_SGE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_SGE_SHIFT)) & DMA_MP_ES_SGE_MASK) - -#define DMA_MP_ES_NCE_MASK (0x8U) -#define DMA_MP_ES_NCE_SHIFT (3U) -/*! NCE - NBYTES/CITER Configuration Error - * 0b0..No NBYTES/CITER configuration error - * 0b1..The last recorded error was NBYTES equal to zero or a CITER not equal to BITER error - */ -#define DMA_MP_ES_NCE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_NCE_SHIFT)) & DMA_MP_ES_NCE_MASK) - -#define DMA_MP_ES_DOE_MASK (0x10U) -#define DMA_MP_ES_DOE_SHIFT (4U) -/*! DOE - Destination Offset Error - * 0b0..No destination offset configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_DOFF field - */ -#define DMA_MP_ES_DOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_DOE_SHIFT)) & DMA_MP_ES_DOE_MASK) - -#define DMA_MP_ES_DAE_MASK (0x20U) -#define DMA_MP_ES_DAE_SHIFT (5U) -/*! DAE - Destination Address Error - * 0b0..No destination address configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_DADDR field - */ -#define DMA_MP_ES_DAE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_DAE_SHIFT)) & DMA_MP_ES_DAE_MASK) - -#define DMA_MP_ES_SOE_MASK (0x40U) -#define DMA_MP_ES_SOE_SHIFT (6U) -/*! SOE - Source Offset Error - * 0b0..No source offset configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_SOFF field - */ -#define DMA_MP_ES_SOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_SOE_SHIFT)) & DMA_MP_ES_SOE_MASK) - -#define DMA_MP_ES_SAE_MASK (0x80U) -#define DMA_MP_ES_SAE_SHIFT (7U) -/*! SAE - Source Address Error - * 0b0..No source address configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_SADDR field - */ -#define DMA_MP_ES_SAE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_SAE_SHIFT)) & DMA_MP_ES_SAE_MASK) - -#define DMA_MP_ES_ECX_MASK (0x100U) -#define DMA_MP_ES_ECX_SHIFT (8U) -/*! ECX - Transfer Canceled - * 0b0..No canceled transfers - * 0b1..Last recorded entry was a canceled transfer by the error cancel transfer input - */ -#define DMA_MP_ES_ECX(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_ECX_SHIFT)) & DMA_MP_ES_ECX_MASK) - -#define DMA_MP_ES_ERRCHN_MASK (0x7000000U) -#define DMA_MP_ES_ERRCHN_SHIFT (24U) -/*! ERRCHN - Error Channel Number or Canceled Channel Number */ -#define DMA_MP_ES_ERRCHN(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_ERRCHN_SHIFT)) & DMA_MP_ES_ERRCHN_MASK) - -#define DMA_MP_ES_VLD_MASK (0x80000000U) -#define DMA_MP_ES_VLD_SHIFT (31U) -/*! VLD - Valid - * 0b0..No CHn_ES[ERR] fields are set to 1 - * 0b1..At least one CHn_ES[ERR] field is set to 1, indicating a valid error exists that software has not cleared - */ -#define DMA_MP_ES_VLD(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_VLD_SHIFT)) & DMA_MP_ES_VLD_MASK) -/*! @} */ - -/*! @name MP_INT - Management Page Interrupt Request Status */ -/*! @{ */ - -#define DMA_MP_INT_INT_MASK (0xFFU) -#define DMA_MP_INT_INT_SHIFT (0U) -/*! INT - Interrupt Request Status */ -#define DMA_MP_INT_INT(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_INT_INT_SHIFT)) & DMA_MP_INT_INT_MASK) -/*! @} */ - -/*! @name MP_HRS - Management Page Hardware Request Status */ -/*! @{ */ - -#define DMA_MP_HRS_HRS_MASK (0xFFFFFFFFU) -#define DMA_MP_HRS_HRS_SHIFT (0U) -/*! HRS - Hardware Request Status */ -#define DMA_MP_HRS_HRS(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_HRS_HRS_SHIFT)) & DMA_MP_HRS_HRS_MASK) -/*! @} */ - -/*! @name CH_GRPRI - Channel Arbitration Group */ -/*! @{ */ - -#define DMA_CH_GRPRI_GRPRI_MASK (0x1FU) -#define DMA_CH_GRPRI_GRPRI_SHIFT (0U) -/*! GRPRI - Arbitration Group For Channel n */ -#define DMA_CH_GRPRI_GRPRI(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_GRPRI_GRPRI_SHIFT)) & DMA_CH_GRPRI_GRPRI_MASK) -/*! @} */ - -/* The count of DMA_CH_GRPRI */ -#define DMA_CH_GRPRI_COUNT (8U) - -/*! @name CH_CSR - Channel Control and Status */ -/*! @{ */ - -#define DMA_CH_CSR_ERQ_MASK (0x1U) -#define DMA_CH_CSR_ERQ_SHIFT (0U) -/*! ERQ - Enable DMA Request - * 0b0..DMA hardware request signal for corresponding channel disabled - * 0b1..DMA hardware request signal for corresponding channel enabled - */ -#define DMA_CH_CSR_ERQ(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_CSR_ERQ_SHIFT)) & DMA_CH_CSR_ERQ_MASK) - -#define DMA_CH_CSR_EARQ_MASK (0x2U) -#define DMA_CH_CSR_EARQ_SHIFT (1U) -/*! EARQ - Enable Asynchronous DMA Request - * 0b0..Disable asynchronous DMA request for the channel - * 0b1..Enable asynchronous DMA request for the channel - */ -#define DMA_CH_CSR_EARQ(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_CSR_EARQ_SHIFT)) & DMA_CH_CSR_EARQ_MASK) - -#define DMA_CH_CSR_EEI_MASK (0x4U) -#define DMA_CH_CSR_EEI_SHIFT (2U) -/*! EEI - Enable Error Interrupt - * 0b0..Error signal for corresponding channel does not generate error interrupt - * 0b1..Assertion of error signal for corresponding channel generates error interrupt request - */ -#define DMA_CH_CSR_EEI(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_CSR_EEI_SHIFT)) & DMA_CH_CSR_EEI_MASK) - -#define DMA_CH_CSR_EBW_MASK (0x8U) -#define DMA_CH_CSR_EBW_SHIFT (3U) -/*! EBW - Enable Buffered Writes - * 0b0..Buffered writes on system bus disabled - * 0b1..Buffered writes on system bus enabled - */ -#define DMA_CH_CSR_EBW(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_CSR_EBW_SHIFT)) & DMA_CH_CSR_EBW_MASK) - -#define DMA_CH_CSR_DONE_MASK (0x40000000U) -#define DMA_CH_CSR_DONE_SHIFT (30U) -/*! DONE - Channel Done */ -#define DMA_CH_CSR_DONE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_CSR_DONE_SHIFT)) & DMA_CH_CSR_DONE_MASK) - -#define DMA_CH_CSR_ACTIVE_MASK (0x80000000U) -#define DMA_CH_CSR_ACTIVE_SHIFT (31U) -/*! ACTIVE - Channel Active */ -#define DMA_CH_CSR_ACTIVE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_CSR_ACTIVE_SHIFT)) & DMA_CH_CSR_ACTIVE_MASK) -/*! @} */ - -/* The count of DMA_CH_CSR */ -#define DMA_CH_CSR_COUNT (8U) - -/*! @name CH_ES - Channel Error Status */ -/*! @{ */ - -#define DMA_CH_ES_DBE_MASK (0x1U) -#define DMA_CH_ES_DBE_SHIFT (0U) -/*! DBE - Destination Bus Error - * 0b0..No destination bus error - * 0b1..Last recorded error was bus error on destination write - */ -#define DMA_CH_ES_DBE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_DBE_SHIFT)) & DMA_CH_ES_DBE_MASK) - -#define DMA_CH_ES_SBE_MASK (0x2U) -#define DMA_CH_ES_SBE_SHIFT (1U) -/*! SBE - Source Bus Error - * 0b0..No source bus error - * 0b1..Last recorded error was bus error on source read - */ -#define DMA_CH_ES_SBE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_SBE_SHIFT)) & DMA_CH_ES_SBE_MASK) - -#define DMA_CH_ES_SGE_MASK (0x4U) -#define DMA_CH_ES_SGE_SHIFT (2U) -/*! SGE - Scatter/Gather Configuration Error - * 0b0..No scatter/gather configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_DLAST_SGA field - */ -#define DMA_CH_ES_SGE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_SGE_SHIFT)) & DMA_CH_ES_SGE_MASK) - -#define DMA_CH_ES_NCE_MASK (0x8U) -#define DMA_CH_ES_NCE_SHIFT (3U) -/*! NCE - NBYTES/CITER Configuration Error - * 0b0..No NBYTES/CITER configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_NBYTES or TCDn_CITER fields - */ -#define DMA_CH_ES_NCE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_NCE_SHIFT)) & DMA_CH_ES_NCE_MASK) - -#define DMA_CH_ES_DOE_MASK (0x10U) -#define DMA_CH_ES_DOE_SHIFT (4U) -/*! DOE - Destination Offset Error - * 0b0..No destination offset configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_DOFF field - */ -#define DMA_CH_ES_DOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_DOE_SHIFT)) & DMA_CH_ES_DOE_MASK) - -#define DMA_CH_ES_DAE_MASK (0x20U) -#define DMA_CH_ES_DAE_SHIFT (5U) -/*! DAE - Destination Address Error - * 0b0..No destination address configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_DADDR field - */ -#define DMA_CH_ES_DAE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_DAE_SHIFT)) & DMA_CH_ES_DAE_MASK) - -#define DMA_CH_ES_SOE_MASK (0x40U) -#define DMA_CH_ES_SOE_SHIFT (6U) -/*! SOE - Source Offset Error - * 0b0..No source offset configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_SOFF field - */ -#define DMA_CH_ES_SOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_SOE_SHIFT)) & DMA_CH_ES_SOE_MASK) - -#define DMA_CH_ES_SAE_MASK (0x80U) -#define DMA_CH_ES_SAE_SHIFT (7U) -/*! SAE - Source Address Error - * 0b0..No source address configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_SADDR field - */ -#define DMA_CH_ES_SAE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_SAE_SHIFT)) & DMA_CH_ES_SAE_MASK) - -#define DMA_CH_ES_ERR_MASK (0x80000000U) -#define DMA_CH_ES_ERR_SHIFT (31U) -/*! ERR - Error In Channel - * 0b0..An error in this channel has not occurred - * 0b1..An error in this channel has occurred - */ -#define DMA_CH_ES_ERR(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_ERR_SHIFT)) & DMA_CH_ES_ERR_MASK) -/*! @} */ - -/* The count of DMA_CH_ES */ -#define DMA_CH_ES_COUNT (8U) - -/*! @name CH_INT - Channel Interrupt Status */ -/*! @{ */ - -#define DMA_CH_INT_INT_MASK (0x1U) -#define DMA_CH_INT_INT_SHIFT (0U) -/*! INT - Interrupt Request - * 0b0..Interrupt request for corresponding channel cleared - * 0b1..Interrupt request for corresponding channel active - */ -#define DMA_CH_INT_INT(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_INT_INT_SHIFT)) & DMA_CH_INT_INT_MASK) -/*! @} */ - -/* The count of DMA_CH_INT */ -#define DMA_CH_INT_COUNT (8U) - -/*! @name CH_SBR - Channel System Bus */ -/*! @{ */ - -#define DMA_CH_SBR_MID_MASK (0xFU) -#define DMA_CH_SBR_MID_SHIFT (0U) -/*! MID - Master ID */ -#define DMA_CH_SBR_MID(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_SBR_MID_SHIFT)) & DMA_CH_SBR_MID_MASK) - -#define DMA_CH_SBR_PAL_MASK (0x8000U) -#define DMA_CH_SBR_PAL_SHIFT (15U) -/*! PAL - Privileged Access Level - * 0b0..User protection level for DMA transfers - * 0b1..Privileged protection level for DMA transfers - */ -#define DMA_CH_SBR_PAL(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_SBR_PAL_SHIFT)) & DMA_CH_SBR_PAL_MASK) - -#define DMA_CH_SBR_EMI_MASK (0x10000U) -#define DMA_CH_SBR_EMI_SHIFT (16U) -/*! EMI - Enable Master ID Replication - * 0b0..Master ID replication is disabled - * 0b1..Master ID replication is enabled - */ -#define DMA_CH_SBR_EMI(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_SBR_EMI_SHIFT)) & DMA_CH_SBR_EMI_MASK) -/*! @} */ - -/* The count of DMA_CH_SBR */ -#define DMA_CH_SBR_COUNT (8U) - -/*! @name CH_PRI - Channel Priority */ -/*! @{ */ - -#define DMA_CH_PRI_APL_MASK (0x7U) -#define DMA_CH_PRI_APL_SHIFT (0U) -/*! APL - Arbitration Priority Level */ -#define DMA_CH_PRI_APL(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_PRI_APL_SHIFT)) & DMA_CH_PRI_APL_MASK) - -#define DMA_CH_PRI_DPA_MASK (0x40000000U) -#define DMA_CH_PRI_DPA_SHIFT (30U) -/*! DPA - Disable Preempt Ability - * 0b0..Channel can suspend a lower-priority channel - * 0b1..Channel cannot suspend any other channel, regardless of channel priority - */ -#define DMA_CH_PRI_DPA(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_PRI_DPA_SHIFT)) & DMA_CH_PRI_DPA_MASK) - -#define DMA_CH_PRI_ECP_MASK (0x80000000U) -#define DMA_CH_PRI_ECP_SHIFT (31U) -/*! ECP - Enable Channel Preemption - * 0b0..Channel cannot be suspended by a higher-priority channel's service request - * 0b1..Channel can be temporarily suspended by a higher-priority channel's service request - */ -#define DMA_CH_PRI_ECP(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_PRI_ECP_SHIFT)) & DMA_CH_PRI_ECP_MASK) -/*! @} */ - -/* The count of DMA_CH_PRI */ -#define DMA_CH_PRI_COUNT (8U) - -/*! @name CH_MUX - Channel Multiplexor Configuration */ -/*! @{ */ - -#define DMA_CH_MUX_SRC_MASK (0x7FU) -#define DMA_CH_MUX_SRC_SHIFT (0U) -/*! SRC - Service Request Source */ -#define DMA_CH_MUX_SRC(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_MUX_SRC_SHIFT)) & DMA_CH_MUX_SRC_MASK) -/*! @} */ - -/* The count of DMA_CH_MUX */ -#define DMA_CH_MUX_COUNT (8U) - -/*! @name TCD_SADDR - TCD Source Address */ -/*! @{ */ - -#define DMA_TCD_SADDR_SADDR_MASK (0xFFFFFFFFU) -#define DMA_TCD_SADDR_SADDR_SHIFT (0U) -/*! SADDR - Source Address */ -#define DMA_TCD_SADDR_SADDR(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_SADDR_SADDR_SHIFT)) & DMA_TCD_SADDR_SADDR_MASK) -/*! @} */ - -/* The count of DMA_TCD_SADDR */ -#define DMA_TCD_SADDR_COUNT (8U) - -/*! @name TCD_SOFF - TCD Signed Source Address Offset */ -/*! @{ */ - -#define DMA_TCD_SOFF_SOFF_MASK (0xFFFFU) -#define DMA_TCD_SOFF_SOFF_SHIFT (0U) -/*! SOFF - Source Address Signed Offset */ -#define DMA_TCD_SOFF_SOFF(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_SOFF_SOFF_SHIFT)) & DMA_TCD_SOFF_SOFF_MASK) -/*! @} */ - -/* The count of DMA_TCD_SOFF */ -#define DMA_TCD_SOFF_COUNT (8U) - -/*! @name TCD_ATTR - TCD Transfer Attributes */ -/*! @{ */ - -#define DMA_TCD_ATTR_DSIZE_MASK (0x7U) -#define DMA_TCD_ATTR_DSIZE_SHIFT (0U) -/*! DSIZE - Destination Data Transfer Size */ -#define DMA_TCD_ATTR_DSIZE(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_ATTR_DSIZE_SHIFT)) & DMA_TCD_ATTR_DSIZE_MASK) - -#define DMA_TCD_ATTR_DMOD_MASK (0xF8U) -#define DMA_TCD_ATTR_DMOD_SHIFT (3U) -/*! DMOD - Destination Address Modulo */ -#define DMA_TCD_ATTR_DMOD(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_ATTR_DMOD_SHIFT)) & DMA_TCD_ATTR_DMOD_MASK) - -#define DMA_TCD_ATTR_SSIZE_MASK (0x700U) -#define DMA_TCD_ATTR_SSIZE_SHIFT (8U) -/*! SSIZE - Source Data Transfer Size - * 0b000..8-bit - * 0b001..16-bit - * 0b010..32-bit - * 0b011..64-bit - * 0b100..16-byte - * 0b101..32-byte - * 0b110.. - * 0b111.. - */ -#define DMA_TCD_ATTR_SSIZE(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_ATTR_SSIZE_SHIFT)) & DMA_TCD_ATTR_SSIZE_MASK) - -#define DMA_TCD_ATTR_SMOD_MASK (0xF800U) -#define DMA_TCD_ATTR_SMOD_SHIFT (11U) -/*! SMOD - Source Address Modulo - * 0b00000..Source address modulo feature disabled - * 0b00001..Source address modulo feature enabled for any non-zero value [1-31] - */ -#define DMA_TCD_ATTR_SMOD(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_ATTR_SMOD_SHIFT)) & DMA_TCD_ATTR_SMOD_MASK) -/*! @} */ - -/* The count of DMA_TCD_ATTR */ -#define DMA_TCD_ATTR_COUNT (8U) - -/*! @name TCD_NBYTES_MLOFFNO - TCD Transfer Size Without Minor Loop Offsets */ -/*! @{ */ - -#define DMA_TCD_NBYTES_MLOFFNO_NBYTES_MASK (0x3FFFFFFFU) -#define DMA_TCD_NBYTES_MLOFFNO_NBYTES_SHIFT (0U) -/*! NBYTES - Number of Bytes To Transfer Per Service Request */ -#define DMA_TCD_NBYTES_MLOFFNO_NBYTES(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFNO_NBYTES_SHIFT)) & DMA_TCD_NBYTES_MLOFFNO_NBYTES_MASK) - -#define DMA_TCD_NBYTES_MLOFFNO_DMLOE_MASK (0x40000000U) -#define DMA_TCD_NBYTES_MLOFFNO_DMLOE_SHIFT (30U) -/*! DMLOE - Destination Minor Loop Offset Enable - * 0b0..Minor loop offset not applied to DADDR - * 0b1..Minor loop offset applied to DADDR - */ -#define DMA_TCD_NBYTES_MLOFFNO_DMLOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFNO_DMLOE_SHIFT)) & DMA_TCD_NBYTES_MLOFFNO_DMLOE_MASK) - -#define DMA_TCD_NBYTES_MLOFFNO_SMLOE_MASK (0x80000000U) -#define DMA_TCD_NBYTES_MLOFFNO_SMLOE_SHIFT (31U) -/*! SMLOE - Source Minor Loop Offset Enable - * 0b0..Minor loop offset not applied to SADDR - * 0b1..Minor loop offset applied to SADDR - */ -#define DMA_TCD_NBYTES_MLOFFNO_SMLOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFNO_SMLOE_SHIFT)) & DMA_TCD_NBYTES_MLOFFNO_SMLOE_MASK) -/*! @} */ - -/* The count of DMA_TCD_NBYTES_MLOFFNO */ -#define DMA_TCD_NBYTES_MLOFFNO_COUNT (8U) - -/*! @name TCD_NBYTES_MLOFFYES - TCD Transfer Size with Minor Loop Offsets */ -/*! @{ */ - -#define DMA_TCD_NBYTES_MLOFFYES_NBYTES_MASK (0x3FFU) -#define DMA_TCD_NBYTES_MLOFFYES_NBYTES_SHIFT (0U) -/*! NBYTES - Number of Bytes To Transfer Per Service Request */ -#define DMA_TCD_NBYTES_MLOFFYES_NBYTES(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFYES_NBYTES_SHIFT)) & DMA_TCD_NBYTES_MLOFFYES_NBYTES_MASK) - -#define DMA_TCD_NBYTES_MLOFFYES_MLOFF_MASK (0x3FFFFC00U) -#define DMA_TCD_NBYTES_MLOFFYES_MLOFF_SHIFT (10U) -/*! MLOFF - Minor Loop Offset */ -#define DMA_TCD_NBYTES_MLOFFYES_MLOFF(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFYES_MLOFF_SHIFT)) & DMA_TCD_NBYTES_MLOFFYES_MLOFF_MASK) - -#define DMA_TCD_NBYTES_MLOFFYES_DMLOE_MASK (0x40000000U) -#define DMA_TCD_NBYTES_MLOFFYES_DMLOE_SHIFT (30U) -/*! DMLOE - Destination Minor Loop Offset Enable - * 0b0..Minor loop offset not applied to DADDR - * 0b1..Minor loop offset applied to DADDR - */ -#define DMA_TCD_NBYTES_MLOFFYES_DMLOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFYES_DMLOE_SHIFT)) & DMA_TCD_NBYTES_MLOFFYES_DMLOE_MASK) - -#define DMA_TCD_NBYTES_MLOFFYES_SMLOE_MASK (0x80000000U) -#define DMA_TCD_NBYTES_MLOFFYES_SMLOE_SHIFT (31U) -/*! SMLOE - Source Minor Loop Offset Enable - * 0b0..Minor loop offset not applied to SADDR - * 0b1..Minor loop offset applied to SADDR - */ -#define DMA_TCD_NBYTES_MLOFFYES_SMLOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFYES_SMLOE_SHIFT)) & DMA_TCD_NBYTES_MLOFFYES_SMLOE_MASK) -/*! @} */ - -/* The count of DMA_TCD_NBYTES_MLOFFYES */ -#define DMA_TCD_NBYTES_MLOFFYES_COUNT (8U) - -/*! @name TCD_SLAST_SDA - TCD Last Source Address Adjustment / Store DADDR Address */ -/*! @{ */ - -#define DMA_TCD_SLAST_SDA_SLAST_SDA_MASK (0xFFFFFFFFU) -#define DMA_TCD_SLAST_SDA_SLAST_SDA_SHIFT (0U) -/*! SLAST_SDA - Last Source Address Adjustment / Store DADDR Address */ -#define DMA_TCD_SLAST_SDA_SLAST_SDA(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_SLAST_SDA_SLAST_SDA_SHIFT)) & DMA_TCD_SLAST_SDA_SLAST_SDA_MASK) -/*! @} */ - -/* The count of DMA_TCD_SLAST_SDA */ -#define DMA_TCD_SLAST_SDA_COUNT (8U) - -/*! @name TCD_DADDR - TCD Destination Address */ -/*! @{ */ - -#define DMA_TCD_DADDR_DADDR_MASK (0xFFFFFFFFU) -#define DMA_TCD_DADDR_DADDR_SHIFT (0U) -/*! DADDR - Destination Address */ -#define DMA_TCD_DADDR_DADDR(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_DADDR_DADDR_SHIFT)) & DMA_TCD_DADDR_DADDR_MASK) -/*! @} */ - -/* The count of DMA_TCD_DADDR */ -#define DMA_TCD_DADDR_COUNT (8U) - -/*! @name TCD_DOFF - TCD Signed Destination Address Offset */ -/*! @{ */ - -#define DMA_TCD_DOFF_DOFF_MASK (0xFFFFU) -#define DMA_TCD_DOFF_DOFF_SHIFT (0U) -/*! DOFF - Destination Address Signed Offset */ -#define DMA_TCD_DOFF_DOFF(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_DOFF_DOFF_SHIFT)) & DMA_TCD_DOFF_DOFF_MASK) -/*! @} */ - -/* The count of DMA_TCD_DOFF */ -#define DMA_TCD_DOFF_COUNT (8U) - -/*! @name TCD_CITER_ELINKNO - TCD Current Major Loop Count (Minor Loop Channel Linking Disabled) */ -/*! @{ */ - -#define DMA_TCD_CITER_ELINKNO_CITER_MASK (0x7FFFU) -#define DMA_TCD_CITER_ELINKNO_CITER_SHIFT (0U) -/*! CITER - Current Major Iteration Count */ -#define DMA_TCD_CITER_ELINKNO_CITER(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CITER_ELINKNO_CITER_SHIFT)) & DMA_TCD_CITER_ELINKNO_CITER_MASK) - -#define DMA_TCD_CITER_ELINKNO_ELINK_MASK (0x8000U) -#define DMA_TCD_CITER_ELINKNO_ELINK_SHIFT (15U) -/*! ELINK - Enable Link - * 0b0..Channel-to-channel linking disabled - * 0b1..Channel-to-channel linking enabled - */ -#define DMA_TCD_CITER_ELINKNO_ELINK(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CITER_ELINKNO_ELINK_SHIFT)) & DMA_TCD_CITER_ELINKNO_ELINK_MASK) -/*! @} */ - -/* The count of DMA_TCD_CITER_ELINKNO */ -#define DMA_TCD_CITER_ELINKNO_COUNT (8U) - -/*! @name TCD_CITER_ELINKYES - TCD Current Major Loop Count (Minor Loop Channel Linking Enabled) */ -/*! @{ */ - -#define DMA_TCD_CITER_ELINKYES_CITER_MASK (0x1FFU) -#define DMA_TCD_CITER_ELINKYES_CITER_SHIFT (0U) -/*! CITER - Current Major Iteration Count */ -#define DMA_TCD_CITER_ELINKYES_CITER(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CITER_ELINKYES_CITER_SHIFT)) & DMA_TCD_CITER_ELINKYES_CITER_MASK) - -#define DMA_TCD_CITER_ELINKYES_LINKCH_MASK (0xE00U) -#define DMA_TCD_CITER_ELINKYES_LINKCH_SHIFT (9U) -/*! LINKCH - Minor Loop Link Channel Number */ -#define DMA_TCD_CITER_ELINKYES_LINKCH(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CITER_ELINKYES_LINKCH_SHIFT)) & DMA_TCD_CITER_ELINKYES_LINKCH_MASK) - -#define DMA_TCD_CITER_ELINKYES_ELINK_MASK (0x8000U) -#define DMA_TCD_CITER_ELINKYES_ELINK_SHIFT (15U) -/*! ELINK - Enable Link - * 0b0..Channel-to-channel linking disabled - * 0b1..Channel-to-channel linking enabled - */ -#define DMA_TCD_CITER_ELINKYES_ELINK(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CITER_ELINKYES_ELINK_SHIFT)) & DMA_TCD_CITER_ELINKYES_ELINK_MASK) -/*! @} */ - -/* The count of DMA_TCD_CITER_ELINKYES */ -#define DMA_TCD_CITER_ELINKYES_COUNT (8U) - -/*! @name TCD_DLAST_SGA - TCD Last Destination Address Adjustment / Scatter Gather Address */ -/*! @{ */ - -#define DMA_TCD_DLAST_SGA_DLAST_SGA_MASK (0xFFFFFFFFU) -#define DMA_TCD_DLAST_SGA_DLAST_SGA_SHIFT (0U) -/*! DLAST_SGA - Last Destination Address Adjustment / Scatter Gather Address */ -#define DMA_TCD_DLAST_SGA_DLAST_SGA(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_DLAST_SGA_DLAST_SGA_SHIFT)) & DMA_TCD_DLAST_SGA_DLAST_SGA_MASK) -/*! @} */ - -/* The count of DMA_TCD_DLAST_SGA */ -#define DMA_TCD_DLAST_SGA_COUNT (8U) - -/*! @name TCD_CSR - TCD Control and Status */ -/*! @{ */ - -#define DMA_TCD_CSR_START_MASK (0x1U) -#define DMA_TCD_CSR_START_SHIFT (0U) -/*! START - Channel Start - * 0b0..Channel not explicitly started - * 0b1..Channel explicitly started via a software-initiated service request - */ -#define DMA_TCD_CSR_START(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_START_SHIFT)) & DMA_TCD_CSR_START_MASK) - -#define DMA_TCD_CSR_INTMAJOR_MASK (0x2U) -#define DMA_TCD_CSR_INTMAJOR_SHIFT (1U) -/*! INTMAJOR - Enable Interrupt If Major count complete - * 0b0..End-of-major loop interrupt disabled - * 0b1..End-of-major loop interrupt enabled - */ -#define DMA_TCD_CSR_INTMAJOR(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_INTMAJOR_SHIFT)) & DMA_TCD_CSR_INTMAJOR_MASK) - -#define DMA_TCD_CSR_INTHALF_MASK (0x4U) -#define DMA_TCD_CSR_INTHALF_SHIFT (2U) -/*! INTHALF - Enable Interrupt If Major Counter Half-complete - * 0b0..Halfway point interrupt disabled - * 0b1..Halfway point interrupt enabled - */ -#define DMA_TCD_CSR_INTHALF(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_INTHALF_SHIFT)) & DMA_TCD_CSR_INTHALF_MASK) - -#define DMA_TCD_CSR_DREQ_MASK (0x8U) -#define DMA_TCD_CSR_DREQ_SHIFT (3U) -/*! DREQ - Disable Request - * 0b0..No operation - * 0b1..Clear the ERQ field to 0 upon major loop completion, thus disabling hardware service requests - */ -#define DMA_TCD_CSR_DREQ(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_DREQ_SHIFT)) & DMA_TCD_CSR_DREQ_MASK) - -#define DMA_TCD_CSR_ESG_MASK (0x10U) -#define DMA_TCD_CSR_ESG_SHIFT (4U) -/*! ESG - Enable Scatter/Gather Processing - * 0b0..Current channel's TCD is normal format - * 0b1..Current channel's TCD specifies scatter/gather format. - */ -#define DMA_TCD_CSR_ESG(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_ESG_SHIFT)) & DMA_TCD_CSR_ESG_MASK) - -#define DMA_TCD_CSR_MAJORELINK_MASK (0x20U) -#define DMA_TCD_CSR_MAJORELINK_SHIFT (5U) -/*! MAJORELINK - Enable Link When Major Loop Complete - * 0b0..Channel-to-channel linking disabled - * 0b1..Channel-to-channel linking enabled - */ -#define DMA_TCD_CSR_MAJORELINK(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_MAJORELINK_SHIFT)) & DMA_TCD_CSR_MAJORELINK_MASK) - -#define DMA_TCD_CSR_EEOP_MASK (0x40U) -#define DMA_TCD_CSR_EEOP_SHIFT (6U) -/*! EEOP - Enable End-Of-Packet Processing - * 0b0..End-of-packet operation disabled - * 0b1..End-of-packet hardware input signal enabled - */ -#define DMA_TCD_CSR_EEOP(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_EEOP_SHIFT)) & DMA_TCD_CSR_EEOP_MASK) - -#define DMA_TCD_CSR_ESDA_MASK (0x80U) -#define DMA_TCD_CSR_ESDA_SHIFT (7U) -/*! ESDA - Enable Store Destination Address - * 0b0..Ability to store destination address to system memory disabled - * 0b1..Ability to store destination address to system memory enabled - */ -#define DMA_TCD_CSR_ESDA(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_ESDA_SHIFT)) & DMA_TCD_CSR_ESDA_MASK) - -#define DMA_TCD_CSR_MAJORLINKCH_MASK (0x700U) -#define DMA_TCD_CSR_MAJORLINKCH_SHIFT (8U) -/*! MAJORLINKCH - Major Loop Link Channel Number */ -#define DMA_TCD_CSR_MAJORLINKCH(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_MAJORLINKCH_SHIFT)) & DMA_TCD_CSR_MAJORLINKCH_MASK) - -#define DMA_TCD_CSR_BWC_MASK (0xC000U) -#define DMA_TCD_CSR_BWC_SHIFT (14U) -/*! BWC - Bandwidth Control - * 0b00..No eDMA engine stalls - * 0b01.. - * 0b10..eDMA engine stalls for 4 cycles after each R/W - * 0b11..eDMA engine stalls for 8 cycles after each R/W - */ -#define DMA_TCD_CSR_BWC(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_BWC_SHIFT)) & DMA_TCD_CSR_BWC_MASK) -/*! @} */ - -/* The count of DMA_TCD_CSR */ -#define DMA_TCD_CSR_COUNT (8U) - -/*! @name TCD_BITER_ELINKNO - TCD Beginning Major Loop Count (Minor Loop Channel Linking Disabled) */ -/*! @{ */ - -#define DMA_TCD_BITER_ELINKNO_BITER_MASK (0x7FFFU) -#define DMA_TCD_BITER_ELINKNO_BITER_SHIFT (0U) -/*! BITER - Starting Major Iteration Count */ -#define DMA_TCD_BITER_ELINKNO_BITER(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_BITER_ELINKNO_BITER_SHIFT)) & DMA_TCD_BITER_ELINKNO_BITER_MASK) - -#define DMA_TCD_BITER_ELINKNO_ELINK_MASK (0x8000U) -#define DMA_TCD_BITER_ELINKNO_ELINK_SHIFT (15U) -/*! ELINK - Enables Link - * 0b0..Channel-to-channel linking disabled - * 0b1..Channel-to-channel linking enabled - */ -#define DMA_TCD_BITER_ELINKNO_ELINK(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_BITER_ELINKNO_ELINK_SHIFT)) & DMA_TCD_BITER_ELINKNO_ELINK_MASK) -/*! @} */ - -/* The count of DMA_TCD_BITER_ELINKNO */ -#define DMA_TCD_BITER_ELINKNO_COUNT (8U) - -/*! @name TCD_BITER_ELINKYES - TCD Beginning Major Loop Count (Minor Loop Channel Linking Enabled) */ -/*! @{ */ - -#define DMA_TCD_BITER_ELINKYES_BITER_MASK (0x1FFU) -#define DMA_TCD_BITER_ELINKYES_BITER_SHIFT (0U) -/*! BITER - Starting Major Iteration Count */ -#define DMA_TCD_BITER_ELINKYES_BITER(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_BITER_ELINKYES_BITER_SHIFT)) & DMA_TCD_BITER_ELINKYES_BITER_MASK) - -#define DMA_TCD_BITER_ELINKYES_LINKCH_MASK (0xE00U) -#define DMA_TCD_BITER_ELINKYES_LINKCH_SHIFT (9U) -/*! LINKCH - Link Channel Number */ -#define DMA_TCD_BITER_ELINKYES_LINKCH(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_BITER_ELINKYES_LINKCH_SHIFT)) & DMA_TCD_BITER_ELINKYES_LINKCH_MASK) - -#define DMA_TCD_BITER_ELINKYES_ELINK_MASK (0x8000U) -#define DMA_TCD_BITER_ELINKYES_ELINK_SHIFT (15U) -/*! ELINK - Enable Link - * 0b0..Channel-to-channel linking disabled - * 0b1..Channel-to-channel linking enabled - */ -#define DMA_TCD_BITER_ELINKYES_ELINK(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_BITER_ELINKYES_ELINK_SHIFT)) & DMA_TCD_BITER_ELINKYES_ELINK_MASK) -/*! @} */ - -/* The count of DMA_TCD_BITER_ELINKYES */ -#define DMA_TCD_BITER_ELINKYES_COUNT (8U) - - -/*! - * @} - */ /* end of group DMA_Register_Masks */ - - -/* DMA - Peripheral instance base addresses */ -/** Peripheral DMA0 base address */ -#define DMA0_BASE (0x40080000u) -/** Peripheral DMA0 base pointer */ -#define DMA0 ((DMA_Type *)DMA0_BASE) -/** Array initializer of DMA peripheral base addresses */ -#define DMA_BASE_ADDRS { DMA0_BASE } -/** Array initializer of DMA peripheral base pointers */ -#define DMA_BASE_PTRS { DMA0 } - -/*! - * @} - */ /* end of group DMA_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- EIM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup EIM_Peripheral_Access_Layer EIM Peripheral Access Layer - * @{ - */ - -/** EIM - Register Layout Typedef */ -typedef struct { - __IO uint32_t EIMCR; /**< Error Injection Module Configuration Register, offset: 0x0 */ - __IO uint32_t EICHEN; /**< Error Injection Channel Enable register, offset: 0x4 */ - uint8_t RESERVED_0[248]; - __IO uint32_t EICHD0_WORD0; /**< Error Injection Channel Descriptor 0, Word0, offset: 0x100 */ - __IO uint32_t EICHD0_WORD1; /**< Error Injection Channel Descriptor 0, Word1, offset: 0x104 */ -} EIM_Type; - -/* ---------------------------------------------------------------------------- - -- EIM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup EIM_Register_Masks EIM Register Masks - * @{ - */ - -/*! @name EIMCR - Error Injection Module Configuration Register */ -/*! @{ */ - -#define EIM_EIMCR_GEIEN_MASK (0x1U) -#define EIM_EIMCR_GEIEN_SHIFT (0U) -/*! GEIEN - Global Error Injection Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EIM_EIMCR_GEIEN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EIMCR_GEIEN_SHIFT)) & EIM_EIMCR_GEIEN_MASK) -/*! @} */ - -/*! @name EICHEN - Error Injection Channel Enable register */ -/*! @{ */ - -#define EIM_EICHEN_EICH0EN_MASK (0x80000000U) -#define EIM_EICHEN_EICH0EN_SHIFT (31U) -/*! EICH0EN - Error Injection Channel 0 Enable - * 0b0..Error injection is disabled on Error Injection Channel 0 - * 0b1..Error injection is enabled on Error Injection Channel 0 - */ -#define EIM_EICHEN_EICH0EN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHEN_EICH0EN_SHIFT)) & EIM_EICHEN_EICH0EN_MASK) -/*! @} */ - -/*! @name EICHD0_WORD0 - Error Injection Channel Descriptor 0, Word0 */ -/*! @{ */ - -#define EIM_EICHD0_WORD0_CHKBIT_MASK_MASK (0xFE000000U) -#define EIM_EICHD0_WORD0_CHKBIT_MASK_SHIFT (25U) -/*! CHKBIT_MASK - Checkbit Mask */ -#define EIM_EICHD0_WORD0_CHKBIT_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD0_WORD0_CHKBIT_MASK_SHIFT)) & EIM_EICHD0_WORD0_CHKBIT_MASK_MASK) -/*! @} */ - -/*! @name EICHD0_WORD1 - Error Injection Channel Descriptor 0, Word1 */ -/*! @{ */ - -#define EIM_EICHD0_WORD1_B0_3DATA_MASK_MASK (0xFFFFFFFFU) -#define EIM_EICHD0_WORD1_B0_3DATA_MASK_SHIFT (0U) -/*! B0_3DATA_MASK - Data Mask Bytes 0-3 */ -#define EIM_EICHD0_WORD1_B0_3DATA_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD0_WORD1_B0_3DATA_MASK_SHIFT)) & EIM_EICHD0_WORD1_B0_3DATA_MASK_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group EIM_Register_Masks */ - - -/* EIM - Peripheral instance base addresses */ -/** Peripheral EIM0 base address */ -#define EIM0_BASE (0x4008C000u) -/** Peripheral EIM0 base pointer */ -#define EIM0 ((EIM_Type *)EIM0_BASE) -/** Array initializer of EIM peripheral base addresses */ -#define EIM_BASE_ADDRS { EIM0_BASE } -/** Array initializer of EIM peripheral base pointers */ -#define EIM_BASE_PTRS { EIM0 } - -/*! - * @} - */ /* end of group EIM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- EQDC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup EQDC_Peripheral_Access_Layer EQDC Peripheral Access Layer - * @{ - */ - -/** EQDC - Register Layout Typedef */ -typedef struct { - __IO uint16_t CTRL; /**< Control Register, offset: 0x0 */ - __IO uint16_t CTRL2; /**< Control 2 Register, offset: 0x2 */ - __IO uint16_t FILT; /**< Input Filter Register, offset: 0x4 */ - __I uint16_t LASTEDGE; /**< Last Edge Time Register, offset: 0x6 */ - __I uint16_t POSDPER; /**< Position Difference Period Counter Register, offset: 0x8 */ - __I uint16_t POSDPERBFR; /**< Position Difference Period Buffer Register, offset: 0xA */ - __IO uint16_t UPOS; /**< Upper Position Counter Register, offset: 0xC */ - __IO uint16_t LPOS; /**< Lower Position Counter Register, offset: 0xE */ - __IO uint16_t POSD; /**< Position Difference Counter Register, offset: 0x10 */ - __I uint16_t POSDH; /**< Position Difference Hold Register, offset: 0x12 */ - __I uint16_t UPOSH; /**< Upper Position Hold Register, offset: 0x14 */ - __I uint16_t LPOSH; /**< Lower Position Hold Register, offset: 0x16 */ - __I uint16_t LASTEDGEH; /**< Last Edge Time Hold Register, offset: 0x18 */ - __I uint16_t POSDPERH; /**< Position Difference Period Hold Register, offset: 0x1A */ - __I uint16_t REVH; /**< Revolution Hold Register, offset: 0x1C */ - __IO uint16_t REV; /**< Revolution Counter Register, offset: 0x1E */ - __IO uint16_t UINIT; /**< Upper Initialization Register, offset: 0x20 */ - __IO uint16_t LINIT; /**< Lower Initialization Register, offset: 0x22 */ - __IO uint16_t UMOD; /**< Upper Modulus Register, offset: 0x24 */ - __IO uint16_t LMOD; /**< Lower Modulus Register, offset: 0x26 */ - __IO uint16_t UCOMP0; /**< Upper Position Compare Register 0, offset: 0x28 */ - __IO uint16_t LCOMP0; /**< Lower Position Compare Register 0, offset: 0x2A */ - union { /* offset: 0x2C */ - __O uint16_t UCOMP1; /**< Upper Position Compare 1, offset: 0x2C */ - __I uint16_t UPOSH1; /**< Upper Position Holder Register 1, offset: 0x2C */ - }; - union { /* offset: 0x2E */ - __O uint16_t LCOMP1; /**< Lower Position Compare 1, offset: 0x2E */ - __I uint16_t LPOSH1; /**< Lower Position Holder Register 1, offset: 0x2E */ - }; - union { /* offset: 0x30 */ - __O uint16_t UCOMP2; /**< Upper Position Compare 2, offset: 0x30 */ - __I uint16_t UPOSH2; /**< Upper Position Holder Register 3, offset: 0x30 */ - }; - union { /* offset: 0x32 */ - __O uint16_t LCOMP2; /**< Lower Position Compare 2, offset: 0x32 */ - __I uint16_t LPOSH2; /**< Lower Position Holder Register 2, offset: 0x32 */ - }; - union { /* offset: 0x34 */ - __O uint16_t UCOMP3; /**< Upper Position Compare 3, offset: 0x34 */ - __I uint16_t UPOSH3; /**< Upper Position Holder Register 3, offset: 0x34 */ - }; - union { /* offset: 0x36 */ - __O uint16_t LCOMP3; /**< Lower Position Compare 3, offset: 0x36 */ - __I uint16_t LPOSH3; /**< Lower Position Holder Register 3, offset: 0x36 */ - }; - __IO uint16_t INTCTRL; /**< Interrupt Control Register, offset: 0x38 */ - __IO uint16_t WTR; /**< Watchdog Timeout Register, offset: 0x3A */ - __IO uint16_t IMR; /**< Input Monitor Register, offset: 0x3C */ - __IO uint16_t TST; /**< Test Register, offset: 0x3E */ - uint8_t RESERVED_0[16]; - __I uint16_t UVERID; /**< Upper VERID, offset: 0x50 */ - __I uint16_t LVERID; /**< Lower VERID, offset: 0x52 */ -} EQDC_Type; - -/* ---------------------------------------------------------------------------- - -- EQDC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup EQDC_Register_Masks EQDC Register Masks - * @{ - */ - -/*! @name CTRL - Control Register */ -/*! @{ */ - -#define EQDC_CTRL_LDOK_MASK (0x1U) -#define EQDC_CTRL_LDOK_SHIFT (0U) -/*! LDOK - Load Okay - * 0b0..No loading action taken. Users can write new values to buffered registers (writing into outer-set of these buffered registers) - * 0b1..Outer-set values are ready to be loaded into inner-set and take effect. The loading time point depends on CTRL2[LDMOD]. - */ -#define EQDC_CTRL_LDOK(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_LDOK_SHIFT)) & EQDC_CTRL_LDOK_MASK) - -#define EQDC_CTRL_DMAEN_MASK (0x2U) -#define EQDC_CTRL_DMAEN_SHIFT (1U) -/*! DMAEN - DMA Enable - * 0b0..DMA is disabled - * 0b1..DMA is enabled. DMA request asserts automatically when the values in the outer-set of buffered compare - * registers (UCOMP0/LCOMP0;UCOMP1/LCOMP1;UCOMP2/LCOMP2;UCOMP3/LCOMP3), initial registers(UINIT/LINIT) and - * modulus registers (UMOD/LMOD) are loaded into the inner-set of buffer and then LDOK is cleared automatically. - * After the completion of this DMA transfer, LDOK is set automatically, it ensures outer-set values can be - * loaded into inner-set which in turn triggers DMA again. - */ -#define EQDC_CTRL_DMAEN(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_DMAEN_SHIFT)) & EQDC_CTRL_DMAEN_MASK) - -#define EQDC_CTRL_WDE_MASK (0x4U) -#define EQDC_CTRL_WDE_SHIFT (2U) -/*! WDE - Watchdog Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EQDC_CTRL_WDE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_WDE_SHIFT)) & EQDC_CTRL_WDE_MASK) - -#define EQDC_CTRL_WDIE_MASK (0x8U) -#define EQDC_CTRL_WDIE_SHIFT (3U) -/*! WDIE - Watchdog Timeout Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EQDC_CTRL_WDIE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_WDIE_SHIFT)) & EQDC_CTRL_WDIE_MASK) - -#define EQDC_CTRL_WDIRQ_MASK (0x10U) -#define EQDC_CTRL_WDIRQ_SHIFT (4U) -/*! WDIRQ - Watchdog Timeout Interrupt Request - * 0b0..No Watchdog timeout interrupt has occurred - * 0b1..Watchdog timeout interrupt has occurred - */ -#define EQDC_CTRL_WDIRQ(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_WDIRQ_SHIFT)) & EQDC_CTRL_WDIRQ_MASK) - -#define EQDC_CTRL_XNE_MASK (0x20U) -#define EQDC_CTRL_XNE_SHIFT (5U) -/*! XNE - Select Positive/Negative Edge of INDEX/PRESET Pulse - * 0b0..Use positive edge of INDEX/PRESET pulse - * 0b1..Use negative edge of INDEX/PRESET pulse - */ -#define EQDC_CTRL_XNE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_XNE_SHIFT)) & EQDC_CTRL_XNE_MASK) - -#define EQDC_CTRL_XIP_MASK (0x40U) -#define EQDC_CTRL_XIP_SHIFT (6U) -/*! XIP - INDEX Triggered Initialization of Position Counters UPOS and LPOS - * 0b0..INDEX pulse does not initialize the position counter - * 0b1..INDEX pulse initializes the position counter - */ -#define EQDC_CTRL_XIP(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_XIP_SHIFT)) & EQDC_CTRL_XIP_MASK) - -#define EQDC_CTRL_XIE_MASK (0x80U) -#define EQDC_CTRL_XIE_SHIFT (7U) -/*! XIE - INDEX/PRESET Pulse Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EQDC_CTRL_XIE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_XIE_SHIFT)) & EQDC_CTRL_XIE_MASK) - -#define EQDC_CTRL_XIRQ_MASK (0x100U) -#define EQDC_CTRL_XIRQ_SHIFT (8U) -/*! XIRQ - INDEX/PRESET Pulse Interrupt Request - * 0b0..INDEX/PRESET pulse has not occurred - * 0b1..INDEX/PRESET pulse has occurred - */ -#define EQDC_CTRL_XIRQ(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_XIRQ_SHIFT)) & EQDC_CTRL_XIRQ_MASK) - -#define EQDC_CTRL_PH1_MASK (0x200U) -#define EQDC_CTRL_PH1_SHIFT (9U) -/*! PH1 - Enable Single Phase Mode - * 0b0..Standard quadrature decoder, where PHASEA and PHASEB represent a two-phase quadrature signal. - * 0b1..Single phase mode, bypass the quadrature decoder, refer to CTRL2[CMODE] description - */ -#define EQDC_CTRL_PH1(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_PH1_SHIFT)) & EQDC_CTRL_PH1_MASK) - -#define EQDC_CTRL_REV_MASK (0x400U) -#define EQDC_CTRL_REV_SHIFT (10U) -/*! REV - Enable Reverse Direction Counting - * 0b0..Count normally and the position counter initialization uses upper/lower initialization register UINIT/LINIT - * 0b1..Count in the reverse direction and the position counter initialization uses upper/lower modulus register UMOD/LMOD - */ -#define EQDC_CTRL_REV(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_REV_SHIFT)) & EQDC_CTRL_REV_MASK) - -#define EQDC_CTRL_SWIP_MASK (0x800U) -#define EQDC_CTRL_SWIP_SHIFT (11U) -/*! SWIP - Software-Triggered Initialization of Position Counters UPOS and LPOS - * 0b0..No action - * 0b1..Initialize position counter - */ -#define EQDC_CTRL_SWIP(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_SWIP_SHIFT)) & EQDC_CTRL_SWIP_MASK) - -#define EQDC_CTRL_HNE_MASK (0x1000U) -#define EQDC_CTRL_HNE_SHIFT (12U) -/*! HNE - Use Negative Edge of HOME/ENABLE Input - * 0b0..When CTRL[OPMODE] = 0,use HOME positive edge to trigger initialization of position counters. When - * CTRL[OPMODE] = 1,use ENABLE high level to enable POS/POSD/WDG/REV counters - * 0b1..When CTRL[OPMODE] = 0,use HOME negative edge to trigger initialization of position counters. When - * CTRL[OPMODE] = 1,use ENABLE low level to enable POS/POSD/WDG/REV counters - */ -#define EQDC_CTRL_HNE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_HNE_SHIFT)) & EQDC_CTRL_HNE_MASK) - -#define EQDC_CTRL_HIP_MASK (0x2000U) -#define EQDC_CTRL_HIP_SHIFT (13U) -/*! HIP - Enable HOME to Initialize Position Counter UPOS/LPOS - * 0b0..No action - * 0b1..HOME signal initializes the position counter - */ -#define EQDC_CTRL_HIP(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_HIP_SHIFT)) & EQDC_CTRL_HIP_MASK) - -#define EQDC_CTRL_HIE_MASK (0x4000U) -#define EQDC_CTRL_HIE_SHIFT (14U) -/*! HIE - HOME/ENABLE Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EQDC_CTRL_HIE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_HIE_SHIFT)) & EQDC_CTRL_HIE_MASK) - -#define EQDC_CTRL_HIRQ_MASK (0x8000U) -#define EQDC_CTRL_HIRQ_SHIFT (15U) -/*! HIRQ - HOME/ENABLE Signal Transition Interrupt Request - * 0b0..No transition on the HOME/ENABLE signal has occurred - * 0b1..A transition on the HOME/ENABLE signal has occurred - */ -#define EQDC_CTRL_HIRQ(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL_HIRQ_SHIFT)) & EQDC_CTRL_HIRQ_MASK) -/*! @} */ - -/*! @name CTRL2 - Control 2 Register */ -/*! @{ */ - -#define EQDC_CTRL2_UPDHLD_MASK (0x1U) -#define EQDC_CTRL2_UPDHLD_SHIFT (0U) -/*! UPDHLD - Update Hold Registers */ -#define EQDC_CTRL2_UPDHLD(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL2_UPDHLD_SHIFT)) & EQDC_CTRL2_UPDHLD_MASK) - -#define EQDC_CTRL2_UPDPOS_MASK (0x2U) -#define EQDC_CTRL2_UPDPOS_SHIFT (1U) -/*! UPDPOS - Update Position Registers */ -#define EQDC_CTRL2_UPDPOS(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL2_UPDPOS_SHIFT)) & EQDC_CTRL2_UPDPOS_MASK) - -#define EQDC_CTRL2_OPMODE_MASK (0x4U) -#define EQDC_CTRL2_OPMODE_SHIFT (2U) -/*! OPMODE - Operation Mode Select - * 0b0..Decode Mode: Input nodes INDEX/PRESET and HOME/ENABLE are assigned to function of INDEX and HOME. - * 0b1..Count Mode: Input nodes INDEX/PRESET and HOME/ENABLE are assigned to functions of PRESET and ENABLE. In - * this mode: (1)only when ENABLE=1, all counters (position/position difference/revolution/watchdog) can run, - * when ENABLE=0, all counters (position/position difference/revolution/watchdog) can't run. (2) the rising - * edge of PRESET input can initialize position/revolution/watchdog counters (position counter initialization - * also need referring to bit CTRL[REV]). - */ -#define EQDC_CTRL2_OPMODE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL2_OPMODE_SHIFT)) & EQDC_CTRL2_OPMODE_MASK) - -#define EQDC_CTRL2_LDMOD_MASK (0x8U) -#define EQDC_CTRL2_LDMOD_SHIFT (3U) -/*! LDMOD - Buffered Register Load (Update) Mode Select - * 0b0..Buffered registers are loaded and take effect immediately upon CTRL[LDOK] is set. - * 0b1..Buffered registers are loaded and take effect at the next roll-over or roll-under if CTRL[LDOK] is set. - */ -#define EQDC_CTRL2_LDMOD(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL2_LDMOD_SHIFT)) & EQDC_CTRL2_LDMOD_MASK) - -#define EQDC_CTRL2_REVMOD_MASK (0x100U) -#define EQDC_CTRL2_REVMOD_SHIFT (8U) -/*! REVMOD - Revolution Counter Modulus Enable - * 0b0..Use INDEX pulse to increment/decrement revolution counter (REV) - * 0b1..Use modulus counting roll-over/under to increment/decrement revolution counter (REV) - */ -#define EQDC_CTRL2_REVMOD(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL2_REVMOD_SHIFT)) & EQDC_CTRL2_REVMOD_MASK) - -#define EQDC_CTRL2_OUTCTL_MASK (0x200U) -#define EQDC_CTRL2_OUTCTL_SHIFT (9U) -/*! OUTCTL - Output Control - * 0b0..POS_MATCH[x](x range is 0-3) is asserted when the Position Counter is equal to according compare value - * (UCOMPx/LCOMPx)(x range is 0-3), and de-asserted when the Position Counter not equal to the compare value - * (UCOMPx/LCOMPx)(x range is 0-3) - * 0b1..All POS_MATCH[x](x range is 0-3) are asserted a pulse, when the UPOS, LPOS, REV, or POSD registers are read - */ -#define EQDC_CTRL2_OUTCTL(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL2_OUTCTL_SHIFT)) & EQDC_CTRL2_OUTCTL_MASK) - -#define EQDC_CTRL2_PMEN_MASK (0x400U) -#define EQDC_CTRL2_PMEN_SHIFT (10U) -/*! PMEN - Period measurement function enable - * 0b0..Period measurement functions are not used. POSD is loaded to POSDH and then cleared whenever POSD, UPOS, LPOS or REV is read. - * 0b1..Period measurement functions are used. POSD is loaded into POSDH and then cleared only when POSD is read. - */ -#define EQDC_CTRL2_PMEN(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL2_PMEN_SHIFT)) & EQDC_CTRL2_PMEN_MASK) - -#define EQDC_CTRL2_EMIP_MASK (0x800U) -#define EQDC_CTRL2_EMIP_SHIFT (11U) -/*! EMIP - Enables/disables the position counter to be initialized by Index Event Edge Mark - * 0b0..disables the position counter to be initialized by Index Event Edge Mark - * 0b1..enables the position counter to be initialized by Index Event Edge Mark. - */ -#define EQDC_CTRL2_EMIP(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL2_EMIP_SHIFT)) & EQDC_CTRL2_EMIP_MASK) - -#define EQDC_CTRL2_INITPOS_MASK (0x1000U) -#define EQDC_CTRL2_INITPOS_SHIFT (12U) -/*! INITPOS - Initial Position Register - * 0b0..Don't initialize position counter on rising edge of TRIGGER - * 0b1..Initialize position counter on rising edge of TRIGGER - */ -#define EQDC_CTRL2_INITPOS(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL2_INITPOS_SHIFT)) & EQDC_CTRL2_INITPOS_MASK) - -#define EQDC_CTRL2_ONCE_MASK (0x2000U) -#define EQDC_CTRL2_ONCE_SHIFT (13U) -/*! ONCE - Count Once - * 0b0..Position counter counts repeatedly - * 0b1..Position counter counts until roll-over or roll-under, then stop. - */ -#define EQDC_CTRL2_ONCE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL2_ONCE_SHIFT)) & EQDC_CTRL2_ONCE_MASK) - -#define EQDC_CTRL2_CMODE_MASK (0xC000U) -#define EQDC_CTRL2_CMODE_SHIFT (14U) -/*! CMODE - Counting Mode */ -#define EQDC_CTRL2_CMODE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_CTRL2_CMODE_SHIFT)) & EQDC_CTRL2_CMODE_MASK) -/*! @} */ - -/*! @name FILT - Input Filter Register */ -/*! @{ */ - -#define EQDC_FILT_FILT_PER_MASK (0xFFU) -#define EQDC_FILT_FILT_PER_SHIFT (0U) -/*! FILT_PER - Input Filter Sample Period */ -#define EQDC_FILT_FILT_PER(x) (((uint16_t)(((uint16_t)(x)) << EQDC_FILT_FILT_PER_SHIFT)) & EQDC_FILT_FILT_PER_MASK) - -#define EQDC_FILT_FILT_CNT_MASK (0x700U) -#define EQDC_FILT_FILT_CNT_SHIFT (8U) -/*! FILT_CNT - Input Filter Sample Count */ -#define EQDC_FILT_FILT_CNT(x) (((uint16_t)(((uint16_t)(x)) << EQDC_FILT_FILT_CNT_SHIFT)) & EQDC_FILT_FILT_CNT_MASK) - -#define EQDC_FILT_FILT_CS_MASK (0x800U) -#define EQDC_FILT_FILT_CS_SHIFT (11U) -/*! FILT_CS - Filter Clock Source selection - * 0b0..Peripheral Clock - * 0b1..Prescaled peripheral clock by PRSC - */ -#define EQDC_FILT_FILT_CS(x) (((uint16_t)(((uint16_t)(x)) << EQDC_FILT_FILT_CS_SHIFT)) & EQDC_FILT_FILT_CS_MASK) - -#define EQDC_FILT_PRSC_MASK (0xF000U) -#define EQDC_FILT_PRSC_SHIFT (12U) -/*! PRSC - Prescaler */ -#define EQDC_FILT_PRSC(x) (((uint16_t)(((uint16_t)(x)) << EQDC_FILT_PRSC_SHIFT)) & EQDC_FILT_PRSC_MASK) -/*! @} */ - -/*! @name LASTEDGE - Last Edge Time Register */ -/*! @{ */ - -#define EQDC_LASTEDGE_LASTEDGE_MASK (0xFFFFU) -#define EQDC_LASTEDGE_LASTEDGE_SHIFT (0U) -/*! LASTEDGE - Last Edge Time Counter */ -#define EQDC_LASTEDGE_LASTEDGE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_LASTEDGE_LASTEDGE_SHIFT)) & EQDC_LASTEDGE_LASTEDGE_MASK) -/*! @} */ - -/*! @name POSDPER - Position Difference Period Counter Register */ -/*! @{ */ - -#define EQDC_POSDPER_POSDPER_MASK (0xFFFFU) -#define EQDC_POSDPER_POSDPER_SHIFT (0U) -/*! POSDPER - Position difference period */ -#define EQDC_POSDPER_POSDPER(x) (((uint16_t)(((uint16_t)(x)) << EQDC_POSDPER_POSDPER_SHIFT)) & EQDC_POSDPER_POSDPER_MASK) -/*! @} */ - -/*! @name POSDPERBFR - Position Difference Period Buffer Register */ -/*! @{ */ - -#define EQDC_POSDPERBFR_POSDPERBFR_MASK (0xFFFFU) -#define EQDC_POSDPERBFR_POSDPERBFR_SHIFT (0U) -/*! POSDPERBFR - Position difference period buffer */ -#define EQDC_POSDPERBFR_POSDPERBFR(x) (((uint16_t)(((uint16_t)(x)) << EQDC_POSDPERBFR_POSDPERBFR_SHIFT)) & EQDC_POSDPERBFR_POSDPERBFR_MASK) -/*! @} */ - -/*! @name UPOS - Upper Position Counter Register */ -/*! @{ */ - -#define EQDC_UPOS_POS_MASK (0xFFFFU) -#define EQDC_UPOS_POS_SHIFT (0U) -/*! POS - POS */ -#define EQDC_UPOS_POS(x) (((uint16_t)(((uint16_t)(x)) << EQDC_UPOS_POS_SHIFT)) & EQDC_UPOS_POS_MASK) -/*! @} */ - -/*! @name LPOS - Lower Position Counter Register */ -/*! @{ */ - -#define EQDC_LPOS_POS_MASK (0xFFFFU) -#define EQDC_LPOS_POS_SHIFT (0U) -/*! POS - POS */ -#define EQDC_LPOS_POS(x) (((uint16_t)(((uint16_t)(x)) << EQDC_LPOS_POS_SHIFT)) & EQDC_LPOS_POS_MASK) -/*! @} */ - -/*! @name POSD - Position Difference Counter Register */ -/*! @{ */ - -#define EQDC_POSD_POSD_MASK (0xFFFFU) -#define EQDC_POSD_POSD_SHIFT (0U) -/*! POSD - POSD */ -#define EQDC_POSD_POSD(x) (((uint16_t)(((uint16_t)(x)) << EQDC_POSD_POSD_SHIFT)) & EQDC_POSD_POSD_MASK) -/*! @} */ - -/*! @name POSDH - Position Difference Hold Register */ -/*! @{ */ - -#define EQDC_POSDH_POSDH_MASK (0xFFFFU) -#define EQDC_POSDH_POSDH_SHIFT (0U) -/*! POSDH - POSDH */ -#define EQDC_POSDH_POSDH(x) (((uint16_t)(((uint16_t)(x)) << EQDC_POSDH_POSDH_SHIFT)) & EQDC_POSDH_POSDH_MASK) -/*! @} */ - -/*! @name UPOSH - Upper Position Hold Register */ -/*! @{ */ - -#define EQDC_UPOSH_POSH_MASK (0xFFFFU) -#define EQDC_UPOSH_POSH_SHIFT (0U) -/*! POSH - POSH */ -#define EQDC_UPOSH_POSH(x) (((uint16_t)(((uint16_t)(x)) << EQDC_UPOSH_POSH_SHIFT)) & EQDC_UPOSH_POSH_MASK) -/*! @} */ - -/*! @name LPOSH - Lower Position Hold Register */ -/*! @{ */ - -#define EQDC_LPOSH_LPOSH_MASK (0xFFFFU) -#define EQDC_LPOSH_LPOSH_SHIFT (0U) -/*! LPOSH - POSH */ -#define EQDC_LPOSH_LPOSH(x) (((uint16_t)(((uint16_t)(x)) << EQDC_LPOSH_LPOSH_SHIFT)) & EQDC_LPOSH_LPOSH_MASK) -/*! @} */ - -/*! @name LASTEDGEH - Last Edge Time Hold Register */ -/*! @{ */ - -#define EQDC_LASTEDGEH_LASTEDGEH_MASK (0xFFFFU) -#define EQDC_LASTEDGEH_LASTEDGEH_SHIFT (0U) -/*! LASTEDGEH - Last Edge Time Hold */ -#define EQDC_LASTEDGEH_LASTEDGEH(x) (((uint16_t)(((uint16_t)(x)) << EQDC_LASTEDGEH_LASTEDGEH_SHIFT)) & EQDC_LASTEDGEH_LASTEDGEH_MASK) -/*! @} */ - -/*! @name POSDPERH - Position Difference Period Hold Register */ -/*! @{ */ - -#define EQDC_POSDPERH_POSDPERH_MASK (0xFFFFU) -#define EQDC_POSDPERH_POSDPERH_SHIFT (0U) -/*! POSDPERH - Position difference period hold */ -#define EQDC_POSDPERH_POSDPERH(x) (((uint16_t)(((uint16_t)(x)) << EQDC_POSDPERH_POSDPERH_SHIFT)) & EQDC_POSDPERH_POSDPERH_MASK) -/*! @} */ - -/*! @name REVH - Revolution Hold Register */ -/*! @{ */ - -#define EQDC_REVH_REVH_MASK (0xFFFFU) -#define EQDC_REVH_REVH_SHIFT (0U) -/*! REVH - REVH */ -#define EQDC_REVH_REVH(x) (((uint16_t)(((uint16_t)(x)) << EQDC_REVH_REVH_SHIFT)) & EQDC_REVH_REVH_MASK) -/*! @} */ - -/*! @name REV - Revolution Counter Register */ -/*! @{ */ - -#define EQDC_REV_REV_MASK (0xFFFFU) -#define EQDC_REV_REV_SHIFT (0U) -/*! REV - REV */ -#define EQDC_REV_REV(x) (((uint16_t)(((uint16_t)(x)) << EQDC_REV_REV_SHIFT)) & EQDC_REV_REV_MASK) -/*! @} */ - -/*! @name UINIT - Upper Initialization Register */ -/*! @{ */ - -#define EQDC_UINIT_INIT_MASK (0xFFFFU) -#define EQDC_UINIT_INIT_SHIFT (0U) -/*! INIT - INIT */ -#define EQDC_UINIT_INIT(x) (((uint16_t)(((uint16_t)(x)) << EQDC_UINIT_INIT_SHIFT)) & EQDC_UINIT_INIT_MASK) -/*! @} */ - -/*! @name LINIT - Lower Initialization Register */ -/*! @{ */ - -#define EQDC_LINIT_INIT_MASK (0xFFFFU) -#define EQDC_LINIT_INIT_SHIFT (0U) -/*! INIT - INIT */ -#define EQDC_LINIT_INIT(x) (((uint16_t)(((uint16_t)(x)) << EQDC_LINIT_INIT_SHIFT)) & EQDC_LINIT_INIT_MASK) -/*! @} */ - -/*! @name UMOD - Upper Modulus Register */ -/*! @{ */ - -#define EQDC_UMOD_MOD_MASK (0xFFFFU) -#define EQDC_UMOD_MOD_SHIFT (0U) -/*! MOD - MOD */ -#define EQDC_UMOD_MOD(x) (((uint16_t)(((uint16_t)(x)) << EQDC_UMOD_MOD_SHIFT)) & EQDC_UMOD_MOD_MASK) -/*! @} */ - -/*! @name LMOD - Lower Modulus Register */ -/*! @{ */ - -#define EQDC_LMOD_MOD_MASK (0xFFFFU) -#define EQDC_LMOD_MOD_SHIFT (0U) -/*! MOD - MOD */ -#define EQDC_LMOD_MOD(x) (((uint16_t)(((uint16_t)(x)) << EQDC_LMOD_MOD_SHIFT)) & EQDC_LMOD_MOD_MASK) -/*! @} */ - -/*! @name UCOMP0 - Upper Position Compare Register 0 */ -/*! @{ */ - -#define EQDC_UCOMP0_UCOMP0_MASK (0xFFFFU) -#define EQDC_UCOMP0_UCOMP0_SHIFT (0U) -/*! UCOMP0 - UCOMP0 */ -#define EQDC_UCOMP0_UCOMP0(x) (((uint16_t)(((uint16_t)(x)) << EQDC_UCOMP0_UCOMP0_SHIFT)) & EQDC_UCOMP0_UCOMP0_MASK) -/*! @} */ - -/*! @name LCOMP0 - Lower Position Compare Register 0 */ -/*! @{ */ - -#define EQDC_LCOMP0_LCOMP0_MASK (0xFFFFU) -#define EQDC_LCOMP0_LCOMP0_SHIFT (0U) -/*! LCOMP0 - LCOMP0 */ -#define EQDC_LCOMP0_LCOMP0(x) (((uint16_t)(((uint16_t)(x)) << EQDC_LCOMP0_LCOMP0_SHIFT)) & EQDC_LCOMP0_LCOMP0_MASK) -/*! @} */ - -/*! @name UCOMP1 - Upper Position Compare 1 */ -/*! @{ */ - -#define EQDC_UCOMP1_UCOMP1_MASK (0xFFFFU) -#define EQDC_UCOMP1_UCOMP1_SHIFT (0U) -/*! UCOMP1 - UCOMP1 */ -#define EQDC_UCOMP1_UCOMP1(x) (((uint16_t)(((uint16_t)(x)) << EQDC_UCOMP1_UCOMP1_SHIFT)) & EQDC_UCOMP1_UCOMP1_MASK) -/*! @} */ - -/*! @name UPOSH1 - Upper Position Holder Register 1 */ -/*! @{ */ - -#define EQDC_UPOSH1_UPOSH1_MASK (0xFFFFU) -#define EQDC_UPOSH1_UPOSH1_SHIFT (0U) -/*! UPOSH1 - UPOSH1 */ -#define EQDC_UPOSH1_UPOSH1(x) (((uint16_t)(((uint16_t)(x)) << EQDC_UPOSH1_UPOSH1_SHIFT)) & EQDC_UPOSH1_UPOSH1_MASK) -/*! @} */ - -/*! @name LCOMP1 - Lower Position Compare 1 */ -/*! @{ */ - -#define EQDC_LCOMP1_LCOMP1_MASK (0xFFFFU) -#define EQDC_LCOMP1_LCOMP1_SHIFT (0U) -/*! LCOMP1 - LCOMP1 */ -#define EQDC_LCOMP1_LCOMP1(x) (((uint16_t)(((uint16_t)(x)) << EQDC_LCOMP1_LCOMP1_SHIFT)) & EQDC_LCOMP1_LCOMP1_MASK) -/*! @} */ - -/*! @name LPOSH1 - Lower Position Holder Register 1 */ -/*! @{ */ - -#define EQDC_LPOSH1_LPOSH1_MASK (0xFFFFU) -#define EQDC_LPOSH1_LPOSH1_SHIFT (0U) -/*! LPOSH1 - LPOSH1 */ -#define EQDC_LPOSH1_LPOSH1(x) (((uint16_t)(((uint16_t)(x)) << EQDC_LPOSH1_LPOSH1_SHIFT)) & EQDC_LPOSH1_LPOSH1_MASK) -/*! @} */ - -/*! @name UCOMP2 - Upper Position Compare 2 */ -/*! @{ */ - -#define EQDC_UCOMP2_UCOMP2_MASK (0xFFFFU) -#define EQDC_UCOMP2_UCOMP2_SHIFT (0U) -/*! UCOMP2 - UCOMP2 */ -#define EQDC_UCOMP2_UCOMP2(x) (((uint16_t)(((uint16_t)(x)) << EQDC_UCOMP2_UCOMP2_SHIFT)) & EQDC_UCOMP2_UCOMP2_MASK) -/*! @} */ - -/*! @name UPOSH2 - Upper Position Holder Register 3 */ -/*! @{ */ - -#define EQDC_UPOSH2_UPOSH2_MASK (0xFFFFU) -#define EQDC_UPOSH2_UPOSH2_SHIFT (0U) -/*! UPOSH2 - UPOSH2 */ -#define EQDC_UPOSH2_UPOSH2(x) (((uint16_t)(((uint16_t)(x)) << EQDC_UPOSH2_UPOSH2_SHIFT)) & EQDC_UPOSH2_UPOSH2_MASK) -/*! @} */ - -/*! @name LCOMP2 - Lower Position Compare 2 */ -/*! @{ */ - -#define EQDC_LCOMP2_LCOMP2_MASK (0xFFFFU) -#define EQDC_LCOMP2_LCOMP2_SHIFT (0U) -/*! LCOMP2 - LCOMP2 */ -#define EQDC_LCOMP2_LCOMP2(x) (((uint16_t)(((uint16_t)(x)) << EQDC_LCOMP2_LCOMP2_SHIFT)) & EQDC_LCOMP2_LCOMP2_MASK) -/*! @} */ - -/*! @name LPOSH2 - Lower Position Holder Register 2 */ -/*! @{ */ - -#define EQDC_LPOSH2_LPOSH2_MASK (0xFFFFU) -#define EQDC_LPOSH2_LPOSH2_SHIFT (0U) -/*! LPOSH2 - LPOSH2 */ -#define EQDC_LPOSH2_LPOSH2(x) (((uint16_t)(((uint16_t)(x)) << EQDC_LPOSH2_LPOSH2_SHIFT)) & EQDC_LPOSH2_LPOSH2_MASK) -/*! @} */ - -/*! @name UCOMP3 - Upper Position Compare 3 */ -/*! @{ */ - -#define EQDC_UCOMP3_UCOMP3_MASK (0xFFFFU) -#define EQDC_UCOMP3_UCOMP3_SHIFT (0U) -/*! UCOMP3 - UCOMP3 */ -#define EQDC_UCOMP3_UCOMP3(x) (((uint16_t)(((uint16_t)(x)) << EQDC_UCOMP3_UCOMP3_SHIFT)) & EQDC_UCOMP3_UCOMP3_MASK) -/*! @} */ - -/*! @name UPOSH3 - Upper Position Holder Register 3 */ -/*! @{ */ - -#define EQDC_UPOSH3_UPOSH3_MASK (0xFFFFU) -#define EQDC_UPOSH3_UPOSH3_SHIFT (0U) -/*! UPOSH3 - UPOSH3 */ -#define EQDC_UPOSH3_UPOSH3(x) (((uint16_t)(((uint16_t)(x)) << EQDC_UPOSH3_UPOSH3_SHIFT)) & EQDC_UPOSH3_UPOSH3_MASK) -/*! @} */ - -/*! @name LCOMP3 - Lower Position Compare 3 */ -/*! @{ */ - -#define EQDC_LCOMP3_LCOMP3_MASK (0xFFFFU) -#define EQDC_LCOMP3_LCOMP3_SHIFT (0U) -/*! LCOMP3 - LCOMP3 */ -#define EQDC_LCOMP3_LCOMP3(x) (((uint16_t)(((uint16_t)(x)) << EQDC_LCOMP3_LCOMP3_SHIFT)) & EQDC_LCOMP3_LCOMP3_MASK) -/*! @} */ - -/*! @name LPOSH3 - Lower Position Holder Register 3 */ -/*! @{ */ - -#define EQDC_LPOSH3_LPOSH3_MASK (0xFFFFU) -#define EQDC_LPOSH3_LPOSH3_SHIFT (0U) -/*! LPOSH3 - LPOSH3 */ -#define EQDC_LPOSH3_LPOSH3(x) (((uint16_t)(((uint16_t)(x)) << EQDC_LPOSH3_LPOSH3_SHIFT)) & EQDC_LPOSH3_LPOSH3_MASK) -/*! @} */ - -/*! @name INTCTRL - Interrupt Control Register */ -/*! @{ */ - -#define EQDC_INTCTRL_SABIE_MASK (0x1U) -#define EQDC_INTCTRL_SABIE_SHIFT (0U) -/*! SABIE - Simultaneous PHASEA and PHASEB Change Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EQDC_INTCTRL_SABIE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_SABIE_SHIFT)) & EQDC_INTCTRL_SABIE_MASK) - -#define EQDC_INTCTRL_SABIRQ_MASK (0x2U) -#define EQDC_INTCTRL_SABIRQ_SHIFT (1U) -/*! SABIRQ - Simultaneous PHASEA and PHASEB Change Interrupt Request - * 0b0..No simultaneous change of PHASEA and PHASEB has occurred - * 0b1..A simultaneous change of PHASEA and PHASEB has occurred - */ -#define EQDC_INTCTRL_SABIRQ(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_SABIRQ_SHIFT)) & EQDC_INTCTRL_SABIRQ_MASK) - -#define EQDC_INTCTRL_DIRIE_MASK (0x4U) -#define EQDC_INTCTRL_DIRIE_SHIFT (2U) -/*! DIRIE - Count direction change interrupt enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EQDC_INTCTRL_DIRIE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_DIRIE_SHIFT)) & EQDC_INTCTRL_DIRIE_MASK) - -#define EQDC_INTCTRL_DIRIRQ_MASK (0x8U) -#define EQDC_INTCTRL_DIRIRQ_SHIFT (3U) -/*! DIRIRQ - Count direction change interrupt - * 0b0..Count direction unchanged - * 0b1..Count direction changed - */ -#define EQDC_INTCTRL_DIRIRQ(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_DIRIRQ_SHIFT)) & EQDC_INTCTRL_DIRIRQ_MASK) - -#define EQDC_INTCTRL_RUIE_MASK (0x10U) -#define EQDC_INTCTRL_RUIE_SHIFT (4U) -/*! RUIE - Roll-under Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EQDC_INTCTRL_RUIE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_RUIE_SHIFT)) & EQDC_INTCTRL_RUIE_MASK) - -#define EQDC_INTCTRL_RUIRQ_MASK (0x20U) -#define EQDC_INTCTRL_RUIRQ_SHIFT (5U) -/*! RUIRQ - Roll-under Interrupt Request - * 0b0..No roll-under has occurred - * 0b1..Roll-under has occurred - */ -#define EQDC_INTCTRL_RUIRQ(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_RUIRQ_SHIFT)) & EQDC_INTCTRL_RUIRQ_MASK) - -#define EQDC_INTCTRL_ROIE_MASK (0x40U) -#define EQDC_INTCTRL_ROIE_SHIFT (6U) -/*! ROIE - Roll-over Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EQDC_INTCTRL_ROIE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_ROIE_SHIFT)) & EQDC_INTCTRL_ROIE_MASK) - -#define EQDC_INTCTRL_ROIRQ_MASK (0x80U) -#define EQDC_INTCTRL_ROIRQ_SHIFT (7U) -/*! ROIRQ - Roll-over Interrupt Request - * 0b0..No roll-over has occurred - * 0b1..Roll-over has occurred - */ -#define EQDC_INTCTRL_ROIRQ(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_ROIRQ_SHIFT)) & EQDC_INTCTRL_ROIRQ_MASK) - -#define EQDC_INTCTRL_CMP0IE_MASK (0x100U) -#define EQDC_INTCTRL_CMP0IE_SHIFT (8U) -/*! CMP0IE - Compare 0 Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EQDC_INTCTRL_CMP0IE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_CMP0IE_SHIFT)) & EQDC_INTCTRL_CMP0IE_MASK) - -#define EQDC_INTCTRL_CMP0IRQ_MASK (0x200U) -#define EQDC_INTCTRL_CMP0IRQ_SHIFT (9U) -/*! CMP0IRQ - Compare 0 Interrupt Request - * 0b0..No match has occurred (the position counter does not match the COMP0 value) - * 0b1..COMP match has occurred (the position counter matches the COMP0 value) - */ -#define EQDC_INTCTRL_CMP0IRQ(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_CMP0IRQ_SHIFT)) & EQDC_INTCTRL_CMP0IRQ_MASK) - -#define EQDC_INTCTRL_CMP1IE_MASK (0x400U) -#define EQDC_INTCTRL_CMP1IE_SHIFT (10U) -/*! CMP1IE - Compare1 Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EQDC_INTCTRL_CMP1IE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_CMP1IE_SHIFT)) & EQDC_INTCTRL_CMP1IE_MASK) - -#define EQDC_INTCTRL_CMP1IRQ_MASK (0x800U) -#define EQDC_INTCTRL_CMP1IRQ_SHIFT (11U) -/*! CMP1IRQ - Compare1 Interrupt Request - * 0b0..No match has occurred (the position counter does not match the COMP1 value) - * 0b1..COMP1 match has occurred (the position counter matches the COMP1 value) - */ -#define EQDC_INTCTRL_CMP1IRQ(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_CMP1IRQ_SHIFT)) & EQDC_INTCTRL_CMP1IRQ_MASK) - -#define EQDC_INTCTRL_CMP2IE_MASK (0x1000U) -#define EQDC_INTCTRL_CMP2IE_SHIFT (12U) -/*! CMP2IE - Compare2 Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EQDC_INTCTRL_CMP2IE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_CMP2IE_SHIFT)) & EQDC_INTCTRL_CMP2IE_MASK) - -#define EQDC_INTCTRL_CMP2IRQ_MASK (0x2000U) -#define EQDC_INTCTRL_CMP2IRQ_SHIFT (13U) -/*! CMP2IRQ - Compare2 Interrupt Request - * 0b0..No match has occurred (the position counter does not match the COMP2 value) - * 0b1..COMP2 match has occurred (the position counter matches the COMP2 value) - */ -#define EQDC_INTCTRL_CMP2IRQ(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_CMP2IRQ_SHIFT)) & EQDC_INTCTRL_CMP2IRQ_MASK) - -#define EQDC_INTCTRL_CMP3IE_MASK (0x4000U) -#define EQDC_INTCTRL_CMP3IE_SHIFT (14U) -/*! CMP3IE - Compare3 Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EQDC_INTCTRL_CMP3IE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_CMP3IE_SHIFT)) & EQDC_INTCTRL_CMP3IE_MASK) - -#define EQDC_INTCTRL_CMP3IRQ_MASK (0x8000U) -#define EQDC_INTCTRL_CMP3IRQ_SHIFT (15U) -/*! CMP3IRQ - Compare3 Interrupt Request - * 0b0..No match has occurred (the position counter does not match the COMP3 value) - * 0b1..COMP3 match has occurred (the position counter matches the COMP3 value) - */ -#define EQDC_INTCTRL_CMP3IRQ(x) (((uint16_t)(((uint16_t)(x)) << EQDC_INTCTRL_CMP3IRQ_SHIFT)) & EQDC_INTCTRL_CMP3IRQ_MASK) -/*! @} */ - -/*! @name WTR - Watchdog Timeout Register */ -/*! @{ */ - -#define EQDC_WTR_WDOG_MASK (0xFFFFU) -#define EQDC_WTR_WDOG_SHIFT (0U) -/*! WDOG - WDOG */ -#define EQDC_WTR_WDOG(x) (((uint16_t)(((uint16_t)(x)) << EQDC_WTR_WDOG_SHIFT)) & EQDC_WTR_WDOG_MASK) -/*! @} */ - -/*! @name IMR - Input Monitor Register */ -/*! @{ */ - -#define EQDC_IMR_HOME_ENABLE_MASK (0x1U) -#define EQDC_IMR_HOME_ENABLE_SHIFT (0U) -/*! HOME_ENABLE - HOME_ENABLE */ -#define EQDC_IMR_HOME_ENABLE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_IMR_HOME_ENABLE_SHIFT)) & EQDC_IMR_HOME_ENABLE_MASK) - -#define EQDC_IMR_INDEX_PRESET_MASK (0x2U) -#define EQDC_IMR_INDEX_PRESET_SHIFT (1U) -/*! INDEX_PRESET - INDEX_PRESET */ -#define EQDC_IMR_INDEX_PRESET(x) (((uint16_t)(((uint16_t)(x)) << EQDC_IMR_INDEX_PRESET_SHIFT)) & EQDC_IMR_INDEX_PRESET_MASK) - -#define EQDC_IMR_PHB_MASK (0x4U) -#define EQDC_IMR_PHB_SHIFT (2U) -/*! PHB - PHB */ -#define EQDC_IMR_PHB(x) (((uint16_t)(((uint16_t)(x)) << EQDC_IMR_PHB_SHIFT)) & EQDC_IMR_PHB_MASK) - -#define EQDC_IMR_PHA_MASK (0x8U) -#define EQDC_IMR_PHA_SHIFT (3U) -/*! PHA - PHA */ -#define EQDC_IMR_PHA(x) (((uint16_t)(((uint16_t)(x)) << EQDC_IMR_PHA_SHIFT)) & EQDC_IMR_PHA_MASK) - -#define EQDC_IMR_FHOM_ENA_MASK (0x10U) -#define EQDC_IMR_FHOM_ENA_SHIFT (4U) -/*! FHOM_ENA - filter operation on HOME/ENABLE input */ -#define EQDC_IMR_FHOM_ENA(x) (((uint16_t)(((uint16_t)(x)) << EQDC_IMR_FHOM_ENA_SHIFT)) & EQDC_IMR_FHOM_ENA_MASK) - -#define EQDC_IMR_FIND_PRE_MASK (0x20U) -#define EQDC_IMR_FIND_PRE_SHIFT (5U) -/*! FIND_PRE - filter operation on INDEX/PRESET input */ -#define EQDC_IMR_FIND_PRE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_IMR_FIND_PRE_SHIFT)) & EQDC_IMR_FIND_PRE_MASK) - -#define EQDC_IMR_FPHB_MASK (0x40U) -#define EQDC_IMR_FPHB_SHIFT (6U) -/*! FPHB - filter operation on PHASEB input */ -#define EQDC_IMR_FPHB(x) (((uint16_t)(((uint16_t)(x)) << EQDC_IMR_FPHB_SHIFT)) & EQDC_IMR_FPHB_MASK) - -#define EQDC_IMR_FPHA_MASK (0x80U) -#define EQDC_IMR_FPHA_SHIFT (7U) -/*! FPHA - filter operation on PHASEA input */ -#define EQDC_IMR_FPHA(x) (((uint16_t)(((uint16_t)(x)) << EQDC_IMR_FPHA_SHIFT)) & EQDC_IMR_FPHA_MASK) - -#define EQDC_IMR_CMPF0_MASK (0x100U) -#define EQDC_IMR_CMPF0_SHIFT (8U) -/*! CMPF0 - Position Compare 0 Flag Output - * 0b0..When the position counter is less than value of COMP0 register - * 0b1..When the position counter is greater or equal than value of COMP0 register - */ -#define EQDC_IMR_CMPF0(x) (((uint16_t)(((uint16_t)(x)) << EQDC_IMR_CMPF0_SHIFT)) & EQDC_IMR_CMPF0_MASK) - -#define EQDC_IMR_CMP1F_MASK (0x200U) -#define EQDC_IMR_CMP1F_SHIFT (9U) -/*! CMP1F - Position Compare1 Flag Output - * 0b0..When the position counter is less than value of COMP1 register - * 0b1..When the position counter is greater or equal than value of COMP1 register - */ -#define EQDC_IMR_CMP1F(x) (((uint16_t)(((uint16_t)(x)) << EQDC_IMR_CMP1F_SHIFT)) & EQDC_IMR_CMP1F_MASK) - -#define EQDC_IMR_CMP2F_MASK (0x400U) -#define EQDC_IMR_CMP2F_SHIFT (10U) -/*! CMP2F - Position Compare2 Flag Output - * 0b0..When the position counter is less than value of COMP2 register - * 0b1..When the position counter is greater or equal than value of COMP2 register - */ -#define EQDC_IMR_CMP2F(x) (((uint16_t)(((uint16_t)(x)) << EQDC_IMR_CMP2F_SHIFT)) & EQDC_IMR_CMP2F_MASK) - -#define EQDC_IMR_CMP3F_MASK (0x800U) -#define EQDC_IMR_CMP3F_SHIFT (11U) -/*! CMP3F - Position Compare3 Flag Output - * 0b0..When the position counter value is less than value of COMP3 register - * 0b1..When the position counter is greater or equal than value of COMP3 register - */ -#define EQDC_IMR_CMP3F(x) (((uint16_t)(((uint16_t)(x)) << EQDC_IMR_CMP3F_SHIFT)) & EQDC_IMR_CMP3F_MASK) - -#define EQDC_IMR_DIRH_MASK (0x4000U) -#define EQDC_IMR_DIRH_SHIFT (14U) -/*! DIRH - Count Direction Flag Hold */ -#define EQDC_IMR_DIRH(x) (((uint16_t)(((uint16_t)(x)) << EQDC_IMR_DIRH_SHIFT)) & EQDC_IMR_DIRH_MASK) - -#define EQDC_IMR_DIR_MASK (0x8000U) -#define EQDC_IMR_DIR_SHIFT (15U) -/*! DIR - Count Direction Flag Output - * 0b0..Current count was in the down direction - * 0b1..Current count was in the up direction - */ -#define EQDC_IMR_DIR(x) (((uint16_t)(((uint16_t)(x)) << EQDC_IMR_DIR_SHIFT)) & EQDC_IMR_DIR_MASK) -/*! @} */ - -/*! @name TST - Test Register */ -/*! @{ */ - -#define EQDC_TST_TEST_COUNT_MASK (0xFFU) -#define EQDC_TST_TEST_COUNT_SHIFT (0U) -/*! TEST_COUNT - TEST_COUNT */ -#define EQDC_TST_TEST_COUNT(x) (((uint16_t)(((uint16_t)(x)) << EQDC_TST_TEST_COUNT_SHIFT)) & EQDC_TST_TEST_COUNT_MASK) - -#define EQDC_TST_TEST_PERIOD_MASK (0x1F00U) -#define EQDC_TST_TEST_PERIOD_SHIFT (8U) -/*! TEST_PERIOD - TEST_PERIOD */ -#define EQDC_TST_TEST_PERIOD(x) (((uint16_t)(((uint16_t)(x)) << EQDC_TST_TEST_PERIOD_SHIFT)) & EQDC_TST_TEST_PERIOD_MASK) - -#define EQDC_TST_QDN_MASK (0x2000U) -#define EQDC_TST_QDN_SHIFT (13U) -/*! QDN - Quadrature Decoder Negative Signal - * 0b0..Generates a positive quadrature decoder signal - * 0b1..Generates a negative quadrature decoder signal - */ -#define EQDC_TST_QDN(x) (((uint16_t)(((uint16_t)(x)) << EQDC_TST_QDN_SHIFT)) & EQDC_TST_QDN_MASK) - -#define EQDC_TST_TCE_MASK (0x4000U) -#define EQDC_TST_TCE_SHIFT (14U) -/*! TCE - Test Counter Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EQDC_TST_TCE(x) (((uint16_t)(((uint16_t)(x)) << EQDC_TST_TCE_SHIFT)) & EQDC_TST_TCE_MASK) - -#define EQDC_TST_TEN_MASK (0x8000U) -#define EQDC_TST_TEN_SHIFT (15U) -/*! TEN - Test Mode Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EQDC_TST_TEN(x) (((uint16_t)(((uint16_t)(x)) << EQDC_TST_TEN_SHIFT)) & EQDC_TST_TEN_MASK) -/*! @} */ - -/*! @name UVERID - Upper VERID */ -/*! @{ */ - -#define EQDC_UVERID_UVERID_MASK (0xFFFFU) -#define EQDC_UVERID_UVERID_SHIFT (0U) -/*! UVERID - UVERID */ -#define EQDC_UVERID_UVERID(x) (((uint16_t)(((uint16_t)(x)) << EQDC_UVERID_UVERID_SHIFT)) & EQDC_UVERID_UVERID_MASK) -/*! @} */ - -/*! @name LVERID - Lower VERID */ -/*! @{ */ - -#define EQDC_LVERID_LVERID_MASK (0xFFFFU) -#define EQDC_LVERID_LVERID_SHIFT (0U) -/*! LVERID - LVERID */ -#define EQDC_LVERID_LVERID(x) (((uint16_t)(((uint16_t)(x)) << EQDC_LVERID_LVERID_SHIFT)) & EQDC_LVERID_LVERID_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group EQDC_Register_Masks */ - - -/* EQDC - Peripheral instance base addresses */ -/** Peripheral QDC0 base address */ -#define QDC0_BASE (0x400A7000u) -/** Peripheral QDC0 base pointer */ -#define QDC0 ((EQDC_Type *)QDC0_BASE) -/** Peripheral QDC1 base address */ -#define QDC1_BASE (0x400A8000u) -/** Peripheral QDC1 base pointer */ -#define QDC1 ((EQDC_Type *)QDC1_BASE) -/** Array initializer of EQDC peripheral base addresses */ -#define EQDC_BASE_ADDRS { QDC0_BASE, QDC1_BASE } -/** Array initializer of EQDC peripheral base pointers */ -#define EQDC_BASE_PTRS { QDC0, QDC1 } -/** Interrupt vectors for the EQDC peripheral type */ -#define EQDC_COMPARE_IRQS { QDC0_COMPARE_IRQn, QDC1_COMPARE_IRQn } -#define EQDC_HOME_IRQS { QDC0_HOME_IRQn, QDC1_HOME_IRQn } -#define EQDC_WDOG_IRQS { QDC0_WATCHDOG_IRQn, QDC1_WATCHDOG_IRQn } -#define EQDC_INDEX_IRQS { QDC0_INDEX_IRQn, QDC1_INDEX_IRQn } -#define EQDC_INPUT_SWITCH_IRQS { QDC0_WATCHDOG_IRQn, QDC1_WATCHDOG_IRQn } - -/*! - * @} - */ /* end of group EQDC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- ERM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ERM_Peripheral_Access_Layer ERM Peripheral Access Layer - * @{ - */ - -/** ERM - Register Layout Typedef */ -typedef struct { - __IO uint32_t CR0; /**< ERM Configuration Register 0, offset: 0x0 */ - uint8_t RESERVED_0[12]; - __IO uint32_t SR0; /**< ERM Status Register 0, offset: 0x10 */ - uint8_t RESERVED_1[236]; - __I uint32_t EAR0; /**< ERM Memory 0 Error Address Register, offset: 0x100 */ - __I uint32_t SYN0; /**< ERM Memory 0 Syndrome Register, offset: 0x104 */ - __IO uint32_t CORR_ERR_CNT0; /**< ERM Memory 0 Correctable Error Count Register, offset: 0x108 */ - uint8_t RESERVED_2[12]; - __IO uint32_t CORR_ERR_CNT1; /**< ERM Memory 1 Correctable Error Count Register, offset: 0x118 */ -} ERM_Type; - -/* ---------------------------------------------------------------------------- - -- ERM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ERM_Register_Masks ERM Register Masks - * @{ - */ - -/*! @name CR0 - ERM Configuration Register 0 */ -/*! @{ */ - -#define ERM_CR0_ENCIE1_MASK (0x4000000U) -#define ERM_CR0_ENCIE1_SHIFT (26U) -/*! ENCIE1 - ENCIE1 - * 0b0..Interrupt notification of Memory 1 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 1 non-correctable error events is enabled. - */ -#define ERM_CR0_ENCIE1(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ENCIE1_SHIFT)) & ERM_CR0_ENCIE1_MASK) - -#define ERM_CR0_ESCIE1_MASK (0x8000000U) -#define ERM_CR0_ESCIE1_SHIFT (27U) -/*! ESCIE1 - ESCIE1 - * 0b0..Interrupt notification of Memory 1 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 1 single-bit correction events is enabled. - */ -#define ERM_CR0_ESCIE1(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ESCIE1_SHIFT)) & ERM_CR0_ESCIE1_MASK) - -#define ERM_CR0_ENCIE0_MASK (0x40000000U) -#define ERM_CR0_ENCIE0_SHIFT (30U) -/*! ENCIE0 - ENCIE0 - * 0b0..Interrupt notification of Memory 0 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 0 non-correctable error events is enabled. - */ -#define ERM_CR0_ENCIE0(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ENCIE0_SHIFT)) & ERM_CR0_ENCIE0_MASK) - -#define ERM_CR0_ESCIE0_MASK (0x80000000U) -#define ERM_CR0_ESCIE0_SHIFT (31U) -/*! ESCIE0 - ESCIE0 - * 0b0..Interrupt notification of Memory 0 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 0 single-bit correction events is enabled. - */ -#define ERM_CR0_ESCIE0(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ESCIE0_SHIFT)) & ERM_CR0_ESCIE0_MASK) -/*! @} */ - -/*! @name SR0 - ERM Status Register 0 */ -/*! @{ */ - -#define ERM_SR0_NCE1_MASK (0x4000000U) -#define ERM_SR0_NCE1_SHIFT (26U) -/*! NCE1 - NCE1 - * 0b0..No non-correctable error event on Memory 1 detected. - * 0b1..Non-correctable error event on Memory 1 detected. - */ -#define ERM_SR0_NCE1(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_NCE1_SHIFT)) & ERM_SR0_NCE1_MASK) - -#define ERM_SR0_SBC1_MASK (0x8000000U) -#define ERM_SR0_SBC1_SHIFT (27U) -/*! SBC1 - SBC1 - * 0b0..No single-bit correction event on Memory 1 detected. - * 0b1..Single-bit correction event on Memory 1 detected. - */ -#define ERM_SR0_SBC1(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_SBC1_SHIFT)) & ERM_SR0_SBC1_MASK) - -#define ERM_SR0_NCE0_MASK (0x40000000U) -#define ERM_SR0_NCE0_SHIFT (30U) -/*! NCE0 - NCE0 - * 0b0..No non-correctable error event on Memory 0 detected. - * 0b1..Non-correctable error event on Memory 0 detected. - */ -#define ERM_SR0_NCE0(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_NCE0_SHIFT)) & ERM_SR0_NCE0_MASK) - -#define ERM_SR0_SBC0_MASK (0x80000000U) -#define ERM_SR0_SBC0_SHIFT (31U) -/*! SBC0 - SBC0 - * 0b0..No single-bit correction event on Memory 0 detected. - * 0b1..Single-bit correction event on Memory 0 detected. - */ -#define ERM_SR0_SBC0(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_SBC0_SHIFT)) & ERM_SR0_SBC0_MASK) -/*! @} */ - -/*! @name EAR0 - ERM Memory 0 Error Address Register */ -/*! @{ */ - -#define ERM_EAR0_EAR_MASK (0xFFFFFFFFU) -#define ERM_EAR0_EAR_SHIFT (0U) -/*! EAR - EAR */ -#define ERM_EAR0_EAR(x) (((uint32_t)(((uint32_t)(x)) << ERM_EAR0_EAR_SHIFT)) & ERM_EAR0_EAR_MASK) -/*! @} */ - -/*! @name SYN0 - ERM Memory 0 Syndrome Register */ -/*! @{ */ - -#define ERM_SYN0_SYNDROME_MASK (0xFF000000U) -#define ERM_SYN0_SYNDROME_SHIFT (24U) -/*! SYNDROME - SYNDROME */ -#define ERM_SYN0_SYNDROME(x) (((uint32_t)(((uint32_t)(x)) << ERM_SYN0_SYNDROME_SHIFT)) & ERM_SYN0_SYNDROME_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT0 - ERM Memory 0 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT0_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT0_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT0_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT0_COUNT_SHIFT)) & ERM_CORR_ERR_CNT0_COUNT_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT1 - ERM Memory 1 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT1_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT1_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT1_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT1_COUNT_SHIFT)) & ERM_CORR_ERR_CNT1_COUNT_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group ERM_Register_Masks */ - - -/* ERM - Peripheral instance base addresses */ -/** Peripheral ERM0 base address */ -#define ERM0_BASE (0x4008D000u) -/** Peripheral ERM0 base pointer */ -#define ERM0 ((ERM_Type *)ERM0_BASE) -/** Array initializer of ERM peripheral base addresses */ -#define ERM_BASE_ADDRS { ERM0_BASE } -/** Array initializer of ERM peripheral base pointers */ -#define ERM_BASE_PTRS { ERM0 } - -/*! - * @} - */ /* end of group ERM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- FLEXIO Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FLEXIO_Peripheral_Access_Layer FLEXIO Peripheral Access Layer - * @{ - */ - -/** FLEXIO - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - __IO uint32_t CTRL; /**< FLEXIO Control, offset: 0x8 */ - __I uint32_t PIN; /**< Pin State, offset: 0xC */ - __IO uint32_t SHIFTSTAT; /**< Shifter Status, offset: 0x10 */ - __IO uint32_t SHIFTERR; /**< Shifter Error, offset: 0x14 */ - __IO uint32_t TIMSTAT; /**< Timer Status Flag, offset: 0x18 */ - uint8_t RESERVED_0[4]; - __IO uint32_t SHIFTSIEN; /**< Shifter Status Interrupt Enable, offset: 0x20 */ - __IO uint32_t SHIFTEIEN; /**< Shifter Error Interrupt Enable, offset: 0x24 */ - __IO uint32_t TIMIEN; /**< Timer Interrupt Enable, offset: 0x28 */ - uint8_t RESERVED_1[4]; - __IO uint32_t SHIFTSDEN; /**< Shifter Status DMA Enable, offset: 0x30 */ - uint8_t RESERVED_2[4]; - __IO uint32_t TIMERSDEN; /**< Timer Status DMA Enable, offset: 0x38 */ - uint8_t RESERVED_3[4]; - __IO uint32_t SHIFTSTATE; /**< Shifter State, offset: 0x40 */ - uint8_t RESERVED_4[4]; - __IO uint32_t TRGSTAT; /**< Trigger Status, offset: 0x48 */ - __IO uint32_t TRIGIEN; /**< External Trigger Interrupt Enable, offset: 0x4C */ - __IO uint32_t PINSTAT; /**< Pin Status, offset: 0x50 */ - __IO uint32_t PINIEN; /**< Pin Interrupt Enable, offset: 0x54 */ - __IO uint32_t PINREN; /**< Pin Rising Edge Enable, offset: 0x58 */ - __IO uint32_t PINFEN; /**< Pin Falling Edge Enable, offset: 0x5C */ - __IO uint32_t PINOUTD; /**< Pin Output Data, offset: 0x60 */ - __IO uint32_t PINOUTE; /**< Pin Output Enable, offset: 0x64 */ - __O uint32_t PINOUTDIS; /**< Pin Output Disable, offset: 0x68 */ - __O uint32_t PINOUTCLR; /**< Pin Output Clear, offset: 0x6C */ - __O uint32_t PINOUTSET; /**< Pin Output Set, offset: 0x70 */ - __O uint32_t PINOUTTOG; /**< Pin Output Toggle, offset: 0x74 */ - uint8_t RESERVED_5[8]; - __IO uint32_t SHIFTCTL[4]; /**< Shifter Control, array offset: 0x80, array step: 0x4 */ - uint8_t RESERVED_6[112]; - __IO uint32_t SHIFTCFG[4]; /**< Shifter Configuration, array offset: 0x100, array step: 0x4 */ - uint8_t RESERVED_7[240]; - __IO uint32_t SHIFTBUF[4]; /**< Shifter Buffer, array offset: 0x200, array step: 0x4 */ - uint8_t RESERVED_8[112]; - __IO uint32_t SHIFTBUFBIS[4]; /**< Shifter Buffer Bit Swapped, array offset: 0x280, array step: 0x4 */ - uint8_t RESERVED_9[112]; - __IO uint32_t SHIFTBUFBYS[4]; /**< Shifter Buffer Byte Swapped, array offset: 0x300, array step: 0x4 */ - uint8_t RESERVED_10[112]; - __IO uint32_t SHIFTBUFBBS[4]; /**< Shifter Buffer Bit Byte Swapped, array offset: 0x380, array step: 0x4 */ - uint8_t RESERVED_11[112]; - __IO uint32_t TIMCTL[4]; /**< Timer Control, array offset: 0x400, array step: 0x4 */ - uint8_t RESERVED_12[112]; - __IO uint32_t TIMCFG[4]; /**< Timer Configuration, array offset: 0x480, array step: 0x4 */ - uint8_t RESERVED_13[112]; - __IO uint32_t TIMCMP[4]; /**< Timer Compare, array offset: 0x500, array step: 0x4 */ - uint8_t RESERVED_14[368]; - __IO uint32_t SHIFTBUFNBS[4]; /**< Shifter Buffer Nibble Byte Swapped, array offset: 0x680, array step: 0x4 */ - uint8_t RESERVED_15[112]; - __IO uint32_t SHIFTBUFHWS[4]; /**< Shifter Buffer Halfword Swapped, array offset: 0x700, array step: 0x4 */ - uint8_t RESERVED_16[112]; - __IO uint32_t SHIFTBUFNIS[4]; /**< Shifter Buffer Nibble Swapped, array offset: 0x780, array step: 0x4 */ - uint8_t RESERVED_17[112]; - __IO uint32_t SHIFTBUFOES[4]; /**< Shifter Buffer Odd Even Swapped, array offset: 0x800, array step: 0x4 */ - uint8_t RESERVED_18[112]; - __IO uint32_t SHIFTBUFEOS[4]; /**< Shifter Buffer Even Odd Swapped, array offset: 0x880, array step: 0x4 */ - uint8_t RESERVED_19[112]; - __IO uint32_t SHIFTBUFHBS[4]; /**< Shifter Buffer Halfword Byte Swapped, array offset: 0x900, array step: 0x4 */ -} FLEXIO_Type; - -/* ---------------------------------------------------------------------------- - -- FLEXIO Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FLEXIO_Register_Masks FLEXIO Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define FLEXIO_VERID_FEATURE_MASK (0xFFFFU) -#define FLEXIO_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Standard features implemented - * 0b0000000000000001..State, logic, and parallel modes supported - * 0b0000000000000010..Pin control registers supported - * 0b0000000000000011..State, logic, and parallel modes, plus pin control registers supported - */ -#define FLEXIO_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_VERID_FEATURE_SHIFT)) & FLEXIO_VERID_FEATURE_MASK) - -#define FLEXIO_VERID_MINOR_MASK (0xFF0000U) -#define FLEXIO_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define FLEXIO_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_VERID_MINOR_SHIFT)) & FLEXIO_VERID_MINOR_MASK) - -#define FLEXIO_VERID_MAJOR_MASK (0xFF000000U) -#define FLEXIO_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define FLEXIO_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_VERID_MAJOR_SHIFT)) & FLEXIO_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define FLEXIO_PARAM_SHIFTER_MASK (0xFFU) -#define FLEXIO_PARAM_SHIFTER_SHIFT (0U) -/*! SHIFTER - Shifter Number */ -#define FLEXIO_PARAM_SHIFTER(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PARAM_SHIFTER_SHIFT)) & FLEXIO_PARAM_SHIFTER_MASK) - -#define FLEXIO_PARAM_TIMER_MASK (0xFF00U) -#define FLEXIO_PARAM_TIMER_SHIFT (8U) -/*! TIMER - Timer Number */ -#define FLEXIO_PARAM_TIMER(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PARAM_TIMER_SHIFT)) & FLEXIO_PARAM_TIMER_MASK) - -#define FLEXIO_PARAM_PIN_MASK (0xFF0000U) -#define FLEXIO_PARAM_PIN_SHIFT (16U) -/*! PIN - Pin Number */ -#define FLEXIO_PARAM_PIN(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PARAM_PIN_SHIFT)) & FLEXIO_PARAM_PIN_MASK) - -#define FLEXIO_PARAM_TRIGGER_MASK (0xFF000000U) -#define FLEXIO_PARAM_TRIGGER_SHIFT (24U) -/*! TRIGGER - Trigger Number */ -#define FLEXIO_PARAM_TRIGGER(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PARAM_TRIGGER_SHIFT)) & FLEXIO_PARAM_TRIGGER_MASK) -/*! @} */ - -/*! @name CTRL - FLEXIO Control */ -/*! @{ */ - -#define FLEXIO_CTRL_FLEXEN_MASK (0x1U) -#define FLEXIO_CTRL_FLEXEN_SHIFT (0U) -/*! FLEXEN - FLEXIO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXIO_CTRL_FLEXEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_CTRL_FLEXEN_SHIFT)) & FLEXIO_CTRL_FLEXEN_MASK) - -#define FLEXIO_CTRL_SWRST_MASK (0x2U) -#define FLEXIO_CTRL_SWRST_SHIFT (1U) -/*! SWRST - Software Reset - * 0b0..Disabled - * 0b1..Enabled - */ -#define FLEXIO_CTRL_SWRST(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_CTRL_SWRST_SHIFT)) & FLEXIO_CTRL_SWRST_MASK) - -#define FLEXIO_CTRL_FASTACC_MASK (0x4U) -#define FLEXIO_CTRL_FASTACC_SHIFT (2U) -/*! FASTACC - Fast Access - * 0b0..Normal - * 0b1..Fast - */ -#define FLEXIO_CTRL_FASTACC(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_CTRL_FASTACC_SHIFT)) & FLEXIO_CTRL_FASTACC_MASK) - -#define FLEXIO_CTRL_DBGE_MASK (0x40000000U) -#define FLEXIO_CTRL_DBGE_SHIFT (30U) -/*! DBGE - Debug Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXIO_CTRL_DBGE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_CTRL_DBGE_SHIFT)) & FLEXIO_CTRL_DBGE_MASK) - -#define FLEXIO_CTRL_DOZEN_MASK (0x80000000U) -#define FLEXIO_CTRL_DOZEN_SHIFT (31U) -/*! DOZEN - Doze Enable - * 0b0..Enable - * 0b1..Disable - */ -#define FLEXIO_CTRL_DOZEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_CTRL_DOZEN_SHIFT)) & FLEXIO_CTRL_DOZEN_MASK) -/*! @} */ - -/*! @name PIN - Pin State */ -/*! @{ */ - -#define FLEXIO_PIN_PDI_MASK (0xFFFFFFFFU) -#define FLEXIO_PIN_PDI_SHIFT (0U) -/*! PDI - Pin Data Input */ -#define FLEXIO_PIN_PDI(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PIN_PDI_SHIFT)) & FLEXIO_PIN_PDI_MASK) -/*! @} */ - -/*! @name SHIFTSTAT - Shifter Status */ -/*! @{ */ - -#define FLEXIO_SHIFTSTAT_SSF_MASK (0xFU) -#define FLEXIO_SHIFTSTAT_SSF_SHIFT (0U) -/*! SSF - Shifter Status Flag - * 0b0000..Clear - * 0b0001..Set - * 0b0000..No effect - * 0b0001..Clear the flag - */ -#define FLEXIO_SHIFTSTAT_SSF(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTSTAT_SSF_SHIFT)) & FLEXIO_SHIFTSTAT_SSF_MASK) -/*! @} */ - -/*! @name SHIFTERR - Shifter Error */ -/*! @{ */ - -#define FLEXIO_SHIFTERR_SEF_MASK (0xFU) -#define FLEXIO_SHIFTERR_SEF_SHIFT (0U) -/*! SEF - Shifter Error Flag - * 0b0000..Clear - * 0b0001..Set - * 0b0000..No effect - * 0b0001..Clear the flag - */ -#define FLEXIO_SHIFTERR_SEF(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTERR_SEF_SHIFT)) & FLEXIO_SHIFTERR_SEF_MASK) -/*! @} */ - -/*! @name TIMSTAT - Timer Status Flag */ -/*! @{ */ - -#define FLEXIO_TIMSTAT_TSF_MASK (0xFU) -#define FLEXIO_TIMSTAT_TSF_SHIFT (0U) -/*! TSF - Timer Status Flag - * 0b0000..Clear - * 0b0001..Set - * 0b0000..No effect - * 0b0001..Clear the flag - */ -#define FLEXIO_TIMSTAT_TSF(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMSTAT_TSF_SHIFT)) & FLEXIO_TIMSTAT_TSF_MASK) -/*! @} */ - -/*! @name SHIFTSIEN - Shifter Status Interrupt Enable */ -/*! @{ */ - -#define FLEXIO_SHIFTSIEN_SSIE_MASK (0xFU) -#define FLEXIO_SHIFTSIEN_SSIE_SHIFT (0U) -/*! SSIE - Shifter Status Interrupt Enable */ -#define FLEXIO_SHIFTSIEN_SSIE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTSIEN_SSIE_SHIFT)) & FLEXIO_SHIFTSIEN_SSIE_MASK) -/*! @} */ - -/*! @name SHIFTEIEN - Shifter Error Interrupt Enable */ -/*! @{ */ - -#define FLEXIO_SHIFTEIEN_SEIE_MASK (0xFU) -#define FLEXIO_SHIFTEIEN_SEIE_SHIFT (0U) -/*! SEIE - Shifter Error Interrupt Enable */ -#define FLEXIO_SHIFTEIEN_SEIE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTEIEN_SEIE_SHIFT)) & FLEXIO_SHIFTEIEN_SEIE_MASK) -/*! @} */ - -/*! @name TIMIEN - Timer Interrupt Enable */ -/*! @{ */ - -#define FLEXIO_TIMIEN_TEIE_MASK (0xFU) -#define FLEXIO_TIMIEN_TEIE_SHIFT (0U) -/*! TEIE - Timer Status Interrupt Enable */ -#define FLEXIO_TIMIEN_TEIE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMIEN_TEIE_SHIFT)) & FLEXIO_TIMIEN_TEIE_MASK) -/*! @} */ - -/*! @name SHIFTSDEN - Shifter Status DMA Enable */ -/*! @{ */ - -#define FLEXIO_SHIFTSDEN_SSDE_MASK (0xFU) -#define FLEXIO_SHIFTSDEN_SSDE_SHIFT (0U) -/*! SSDE - Shifter Status DMA Enable */ -#define FLEXIO_SHIFTSDEN_SSDE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTSDEN_SSDE_SHIFT)) & FLEXIO_SHIFTSDEN_SSDE_MASK) -/*! @} */ - -/*! @name TIMERSDEN - Timer Status DMA Enable */ -/*! @{ */ - -#define FLEXIO_TIMERSDEN_TSDE_MASK (0xFU) -#define FLEXIO_TIMERSDEN_TSDE_SHIFT (0U) -/*! TSDE - Timer Status DMA Enable */ -#define FLEXIO_TIMERSDEN_TSDE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMERSDEN_TSDE_SHIFT)) & FLEXIO_TIMERSDEN_TSDE_MASK) -/*! @} */ - -/*! @name SHIFTSTATE - Shifter State */ -/*! @{ */ - -#define FLEXIO_SHIFTSTATE_STATE_MASK (0x7U) -#define FLEXIO_SHIFTSTATE_STATE_SHIFT (0U) -/*! STATE - Current State Pointer */ -#define FLEXIO_SHIFTSTATE_STATE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTSTATE_STATE_SHIFT)) & FLEXIO_SHIFTSTATE_STATE_MASK) -/*! @} */ - -/*! @name TRGSTAT - Trigger Status */ -/*! @{ */ - -#define FLEXIO_TRGSTAT_ETSF_MASK (0xFU) -#define FLEXIO_TRGSTAT_ETSF_SHIFT (0U) -/*! ETSF - External Trigger Status Flag - * 0b0000..Clear - * 0b0001..Set - * 0b0000..No effect - * 0b0001..Clear the flag - */ -#define FLEXIO_TRGSTAT_ETSF(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TRGSTAT_ETSF_SHIFT)) & FLEXIO_TRGSTAT_ETSF_MASK) -/*! @} */ - -/*! @name TRIGIEN - External Trigger Interrupt Enable */ -/*! @{ */ - -#define FLEXIO_TRIGIEN_TRIE_MASK (0xFU) -#define FLEXIO_TRIGIEN_TRIE_SHIFT (0U) -/*! TRIE - External Trigger Interrupt Enable */ -#define FLEXIO_TRIGIEN_TRIE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TRIGIEN_TRIE_SHIFT)) & FLEXIO_TRIGIEN_TRIE_MASK) -/*! @} */ - -/*! @name PINSTAT - Pin Status */ -/*! @{ */ - -#define FLEXIO_PINSTAT_PSF_MASK (0xFFFFFFFFU) -#define FLEXIO_PINSTAT_PSF_SHIFT (0U) -/*! PSF - Pin Status Flag - * 0b00000000000000000000000000000000..Clear - * 0b00000000000000000000000000000001..Set - * 0b00000000000000000000000000000000..No effect - * 0b00000000000000000000000000000001..Clear the flag - */ -#define FLEXIO_PINSTAT_PSF(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINSTAT_PSF_SHIFT)) & FLEXIO_PINSTAT_PSF_MASK) -/*! @} */ - -/*! @name PINIEN - Pin Interrupt Enable */ -/*! @{ */ - -#define FLEXIO_PINIEN_PSIE_MASK (0xFFFFFFFFU) -#define FLEXIO_PINIEN_PSIE_SHIFT (0U) -/*! PSIE - Pin Status Interrupt Enable */ -#define FLEXIO_PINIEN_PSIE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINIEN_PSIE_SHIFT)) & FLEXIO_PINIEN_PSIE_MASK) -/*! @} */ - -/*! @name PINREN - Pin Rising Edge Enable */ -/*! @{ */ - -#define FLEXIO_PINREN_PRE_MASK (0xFFFFFFFFU) -#define FLEXIO_PINREN_PRE_SHIFT (0U) -/*! PRE - Pin Rising Edge */ -#define FLEXIO_PINREN_PRE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINREN_PRE_SHIFT)) & FLEXIO_PINREN_PRE_MASK) -/*! @} */ - -/*! @name PINFEN - Pin Falling Edge Enable */ -/*! @{ */ - -#define FLEXIO_PINFEN_PFE_MASK (0xFFFFFFFFU) -#define FLEXIO_PINFEN_PFE_SHIFT (0U) -/*! PFE - Pin Falling Edge */ -#define FLEXIO_PINFEN_PFE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINFEN_PFE_SHIFT)) & FLEXIO_PINFEN_PFE_MASK) -/*! @} */ - -/*! @name PINOUTD - Pin Output Data */ -/*! @{ */ - -#define FLEXIO_PINOUTD_OUTD_MASK (0xFFFFFFFFU) -#define FLEXIO_PINOUTD_OUTD_SHIFT (0U) -/*! OUTD - Output Data */ -#define FLEXIO_PINOUTD_OUTD(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINOUTD_OUTD_SHIFT)) & FLEXIO_PINOUTD_OUTD_MASK) -/*! @} */ - -/*! @name PINOUTE - Pin Output Enable */ -/*! @{ */ - -#define FLEXIO_PINOUTE_OUTE_MASK (0xFFFFFFFFU) -#define FLEXIO_PINOUTE_OUTE_SHIFT (0U) -/*! OUTE - Output Enable */ -#define FLEXIO_PINOUTE_OUTE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINOUTE_OUTE_SHIFT)) & FLEXIO_PINOUTE_OUTE_MASK) -/*! @} */ - -/*! @name PINOUTDIS - Pin Output Disable */ -/*! @{ */ - -#define FLEXIO_PINOUTDIS_OUTDIS_MASK (0xFFFFFFFFU) -#define FLEXIO_PINOUTDIS_OUTDIS_SHIFT (0U) -/*! OUTDIS - Output Disable */ -#define FLEXIO_PINOUTDIS_OUTDIS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINOUTDIS_OUTDIS_SHIFT)) & FLEXIO_PINOUTDIS_OUTDIS_MASK) -/*! @} */ - -/*! @name PINOUTCLR - Pin Output Clear */ -/*! @{ */ - -#define FLEXIO_PINOUTCLR_OUTCLR_MASK (0xFFFFFFFFU) -#define FLEXIO_PINOUTCLR_OUTCLR_SHIFT (0U) -/*! OUTCLR - Output Clear */ -#define FLEXIO_PINOUTCLR_OUTCLR(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINOUTCLR_OUTCLR_SHIFT)) & FLEXIO_PINOUTCLR_OUTCLR_MASK) -/*! @} */ - -/*! @name PINOUTSET - Pin Output Set */ -/*! @{ */ - -#define FLEXIO_PINOUTSET_OUTSET_MASK (0xFFFFFFFFU) -#define FLEXIO_PINOUTSET_OUTSET_SHIFT (0U) -/*! OUTSET - Output Set */ -#define FLEXIO_PINOUTSET_OUTSET(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINOUTSET_OUTSET_SHIFT)) & FLEXIO_PINOUTSET_OUTSET_MASK) -/*! @} */ - -/*! @name PINOUTTOG - Pin Output Toggle */ -/*! @{ */ - -#define FLEXIO_PINOUTTOG_OUTTOG_MASK (0xFFFFFFFFU) -#define FLEXIO_PINOUTTOG_OUTTOG_SHIFT (0U) -/*! OUTTOG - Output Toggle */ -#define FLEXIO_PINOUTTOG_OUTTOG(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINOUTTOG_OUTTOG_SHIFT)) & FLEXIO_PINOUTTOG_OUTTOG_MASK) -/*! @} */ - -/*! @name SHIFTCTL - Shifter Control */ -/*! @{ */ - -#define FLEXIO_SHIFTCTL_SMOD_MASK (0x7U) -#define FLEXIO_SHIFTCTL_SMOD_SHIFT (0U) -/*! SMOD - Shifter Mode - * 0b000..Disable - * 0b001..Receive mode; capture the current shifter content into SHIFTBUF on expiration of the timer - * 0b010..Transmit mode; load SHIFTBUF contents into the shifter on expiration of the timer - * 0b011..Reserved - * 0b100..Match Store mode; shifter data is compared to SHIFTBUF content on expiration of the timer - * 0b101..Match Continuous mode; shifter data is continuously compared to SHIFTBUF contents - * 0b110..State mode; SHIFTBUF contents store programmable state attributes - * 0b111..Logic mode; SHIFTBUF contents implement programmable logic lookup table - */ -#define FLEXIO_SHIFTCTL_SMOD(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCTL_SMOD_SHIFT)) & FLEXIO_SHIFTCTL_SMOD_MASK) - -#define FLEXIO_SHIFTCTL_PINPOL_MASK (0x80U) -#define FLEXIO_SHIFTCTL_PINPOL_SHIFT (7U) -/*! PINPOL - Shifter Pin Polarity - * 0b0..Active high - * 0b1..Active low - */ -#define FLEXIO_SHIFTCTL_PINPOL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCTL_PINPOL_SHIFT)) & FLEXIO_SHIFTCTL_PINPOL_MASK) - -#define FLEXIO_SHIFTCTL_PINSEL_MASK (0x1F00U) -#define FLEXIO_SHIFTCTL_PINSEL_SHIFT (8U) -/*! PINSEL - Shifter Pin Select */ -#define FLEXIO_SHIFTCTL_PINSEL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCTL_PINSEL_SHIFT)) & FLEXIO_SHIFTCTL_PINSEL_MASK) - -#define FLEXIO_SHIFTCTL_PINCFG_MASK (0x30000U) -#define FLEXIO_SHIFTCTL_PINCFG_SHIFT (16U) -/*! PINCFG - Shifter Pin Configuration - * 0b00..Shifter pin output disabled - * 0b01..Shifter pin open-drain or bidirectional output enable - * 0b10..Shifter pin bidirectional output data - * 0b11..Shifter pin output - */ -#define FLEXIO_SHIFTCTL_PINCFG(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCTL_PINCFG_SHIFT)) & FLEXIO_SHIFTCTL_PINCFG_MASK) - -#define FLEXIO_SHIFTCTL_TIMPOL_MASK (0x800000U) -#define FLEXIO_SHIFTCTL_TIMPOL_SHIFT (23U) -/*! TIMPOL - Timer Polarity - * 0b0..Positive edge - * 0b1..Negative edge - */ -#define FLEXIO_SHIFTCTL_TIMPOL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCTL_TIMPOL_SHIFT)) & FLEXIO_SHIFTCTL_TIMPOL_MASK) - -#define FLEXIO_SHIFTCTL_TIMSEL_MASK (0x3000000U) -#define FLEXIO_SHIFTCTL_TIMSEL_SHIFT (24U) -/*! TIMSEL - Timer Select */ -#define FLEXIO_SHIFTCTL_TIMSEL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCTL_TIMSEL_SHIFT)) & FLEXIO_SHIFTCTL_TIMSEL_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTCTL */ -#define FLEXIO_SHIFTCTL_COUNT (4U) - -/*! @name SHIFTCFG - Shifter Configuration */ -/*! @{ */ - -#define FLEXIO_SHIFTCFG_SSTART_MASK (0x3U) -#define FLEXIO_SHIFTCFG_SSTART_SHIFT (0U) -/*! SSTART - Shifter Start - * 0b00..Start bit disabled for Transmitter, Receiver, and Match Store modes; Transmitter mode loads data on enable - * 0b01..Start bit disabled for Transmitter, Receiver, and Match Store modes; Transmitter mode loads data on first shift - * 0b10..Transmitter mode outputs start bit value 0 before loading data on first shift; if start bit is not 0, - * Receiver and Match Store modes set error flag - * 0b11..Transmitter mode outputs start bit value 1 before loading data on first shift; if start bit is not 1, - * Receiver and Match Store modes set error flag - */ -#define FLEXIO_SHIFTCFG_SSTART(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCFG_SSTART_SHIFT)) & FLEXIO_SHIFTCFG_SSTART_MASK) - -#define FLEXIO_SHIFTCFG_SSTOP_MASK (0x30U) -#define FLEXIO_SHIFTCFG_SSTOP_SHIFT (4U) -/*! SSTOP - Shifter Stop - * 0b00..Stop bit disabled for Transmitter, Receiver, and Match Store modes - * 0b01..Stop bit disabled for Transmitter, Receiver, and Match Store modes; when timer is in stop condition, - * Receiver and Match Store modes store receive data on the configured shift edge - * 0b10..Transmitter mode outputs stop bit value 0 in Match Store mode; if stop bit is not 0, Receiver and Match - * Store modes set error flag (when timer is in stop condition, these modes also store receive data on the - * configured shift edge) - * 0b11..Transmitter mode outputs stop bit value 1 in Match Store mode; if stop bit is not 1, Receiver and Match - * Store modes set error flag (when timer is in stop condition, these modes also store receive data on the - * configured shift edge) - */ -#define FLEXIO_SHIFTCFG_SSTOP(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCFG_SSTOP_SHIFT)) & FLEXIO_SHIFTCFG_SSTOP_MASK) - -#define FLEXIO_SHIFTCFG_INSRC_MASK (0x100U) -#define FLEXIO_SHIFTCFG_INSRC_SHIFT (8U) -/*! INSRC - Input Source - * 0b0..Pin - * 0b1..Shifter n+1 output - */ -#define FLEXIO_SHIFTCFG_INSRC(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCFG_INSRC_SHIFT)) & FLEXIO_SHIFTCFG_INSRC_MASK) - -#define FLEXIO_SHIFTCFG_LATST_MASK (0x200U) -#define FLEXIO_SHIFTCFG_LATST_SHIFT (9U) -/*! LATST - Late Store - * 0b0..Store the pre-shift register state - * 0b1..Store the post-shift register state - */ -#define FLEXIO_SHIFTCFG_LATST(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCFG_LATST_SHIFT)) & FLEXIO_SHIFTCFG_LATST_MASK) - -#define FLEXIO_SHIFTCFG_SSIZE_MASK (0x1000U) -#define FLEXIO_SHIFTCFG_SSIZE_SHIFT (12U) -/*! SSIZE - Shifter Size - * 0b0..32-bit - * 0b1..24-bit - */ -#define FLEXIO_SHIFTCFG_SSIZE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCFG_SSIZE_SHIFT)) & FLEXIO_SHIFTCFG_SSIZE_MASK) - -#define FLEXIO_SHIFTCFG_PWIDTH_MASK (0x1F0000U) -#define FLEXIO_SHIFTCFG_PWIDTH_SHIFT (16U) -/*! PWIDTH - Parallel Width */ -#define FLEXIO_SHIFTCFG_PWIDTH(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCFG_PWIDTH_SHIFT)) & FLEXIO_SHIFTCFG_PWIDTH_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTCFG */ -#define FLEXIO_SHIFTCFG_COUNT (4U) - -/*! @name SHIFTBUF - Shifter Buffer */ -/*! @{ */ - -#define FLEXIO_SHIFTBUF_SHIFTBUF_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUF_SHIFTBUF_SHIFT (0U) -/*! SHIFTBUF - Shift Buffer */ -#define FLEXIO_SHIFTBUF_SHIFTBUF(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUF_SHIFTBUF_SHIFT)) & FLEXIO_SHIFTBUF_SHIFTBUF_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUF */ -#define FLEXIO_SHIFTBUF_COUNT (4U) - -/*! @name SHIFTBUFBIS - Shifter Buffer Bit Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFBIS_SHIFTBUFBIS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFBIS_SHIFTBUFBIS_SHIFT (0U) -/*! SHIFTBUFBIS - Shift Buffer */ -#define FLEXIO_SHIFTBUFBIS_SHIFTBUFBIS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFBIS_SHIFTBUFBIS_SHIFT)) & FLEXIO_SHIFTBUFBIS_SHIFTBUFBIS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFBIS */ -#define FLEXIO_SHIFTBUFBIS_COUNT (4U) - -/*! @name SHIFTBUFBYS - Shifter Buffer Byte Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFBYS_SHIFTBUFBYS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFBYS_SHIFTBUFBYS_SHIFT (0U) -/*! SHIFTBUFBYS - Shift Buffer */ -#define FLEXIO_SHIFTBUFBYS_SHIFTBUFBYS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFBYS_SHIFTBUFBYS_SHIFT)) & FLEXIO_SHIFTBUFBYS_SHIFTBUFBYS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFBYS */ -#define FLEXIO_SHIFTBUFBYS_COUNT (4U) - -/*! @name SHIFTBUFBBS - Shifter Buffer Bit Byte Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFBBS_SHIFTBUFBBS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFBBS_SHIFTBUFBBS_SHIFT (0U) -/*! SHIFTBUFBBS - Shift Buffer */ -#define FLEXIO_SHIFTBUFBBS_SHIFTBUFBBS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFBBS_SHIFTBUFBBS_SHIFT)) & FLEXIO_SHIFTBUFBBS_SHIFTBUFBBS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFBBS */ -#define FLEXIO_SHIFTBUFBBS_COUNT (4U) - -/*! @name TIMCTL - Timer Control */ -/*! @{ */ - -#define FLEXIO_TIMCTL_TIMOD_MASK (0x7U) -#define FLEXIO_TIMCTL_TIMOD_SHIFT (0U) -/*! TIMOD - Timer Mode - * 0b000..Timer disabled - * 0b001..Dual 8-bit counters baud mode - * 0b010..Dual 8-bit counters PWM high mode - * 0b011..Single 16-bit counter mode - * 0b100..Single 16-bit counter disable mode - * 0b101..Dual 8-bit counters word mode - * 0b110..Dual 8-bit counters PWM low mode - * 0b111..Single 16-bit input capture mode - */ -#define FLEXIO_TIMCTL_TIMOD(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_TIMOD_SHIFT)) & FLEXIO_TIMCTL_TIMOD_MASK) - -#define FLEXIO_TIMCTL_ONETIM_MASK (0x20U) -#define FLEXIO_TIMCTL_ONETIM_SHIFT (5U) -/*! ONETIM - Timer One Time Operation - * 0b0..Generate the timer enable event as normal - * 0b1..Block the timer enable event unless the timer status flag is clear - */ -#define FLEXIO_TIMCTL_ONETIM(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_ONETIM_SHIFT)) & FLEXIO_TIMCTL_ONETIM_MASK) - -#define FLEXIO_TIMCTL_PININS_MASK (0x40U) -#define FLEXIO_TIMCTL_PININS_SHIFT (6U) -/*! PININS - Timer Pin Input Select - * 0b0..PINSEL selects timer pin input and output - * 0b1..PINSEL + 1 selects the timer pin input; timer pin output remains selected by PINSEL - */ -#define FLEXIO_TIMCTL_PININS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_PININS_SHIFT)) & FLEXIO_TIMCTL_PININS_MASK) - -#define FLEXIO_TIMCTL_PINPOL_MASK (0x80U) -#define FLEXIO_TIMCTL_PINPOL_SHIFT (7U) -/*! PINPOL - Timer Pin Polarity - * 0b0..Active high - * 0b1..Active low - */ -#define FLEXIO_TIMCTL_PINPOL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_PINPOL_SHIFT)) & FLEXIO_TIMCTL_PINPOL_MASK) - -#define FLEXIO_TIMCTL_PINSEL_MASK (0x1F00U) -#define FLEXIO_TIMCTL_PINSEL_SHIFT (8U) -/*! PINSEL - Timer Pin Select */ -#define FLEXIO_TIMCTL_PINSEL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_PINSEL_SHIFT)) & FLEXIO_TIMCTL_PINSEL_MASK) - -#define FLEXIO_TIMCTL_PINCFG_MASK (0x30000U) -#define FLEXIO_TIMCTL_PINCFG_SHIFT (16U) -/*! PINCFG - Timer Pin Configuration - * 0b00..Timer pin output disabled - * 0b01..Timer pin open-drain or bidirectional output enable - * 0b10..Timer pin bidirectional output data - * 0b11..Timer pin output - */ -#define FLEXIO_TIMCTL_PINCFG(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_PINCFG_SHIFT)) & FLEXIO_TIMCTL_PINCFG_MASK) - -#define FLEXIO_TIMCTL_TRGSRC_MASK (0x400000U) -#define FLEXIO_TIMCTL_TRGSRC_SHIFT (22U) -/*! TRGSRC - Trigger Source - * 0b0..External - * 0b1..Internal - */ -#define FLEXIO_TIMCTL_TRGSRC(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_TRGSRC_SHIFT)) & FLEXIO_TIMCTL_TRGSRC_MASK) - -#define FLEXIO_TIMCTL_TRGPOL_MASK (0x800000U) -#define FLEXIO_TIMCTL_TRGPOL_SHIFT (23U) -/*! TRGPOL - Trigger Polarity - * 0b0..Active high - * 0b1..Active low - */ -#define FLEXIO_TIMCTL_TRGPOL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_TRGPOL_SHIFT)) & FLEXIO_TIMCTL_TRGPOL_MASK) - -#define FLEXIO_TIMCTL_TRGSEL_MASK (0x3F000000U) -#define FLEXIO_TIMCTL_TRGSEL_SHIFT (24U) -/*! TRGSEL - Trigger Select */ -#define FLEXIO_TIMCTL_TRGSEL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_TRGSEL_SHIFT)) & FLEXIO_TIMCTL_TRGSEL_MASK) -/*! @} */ - -/* The count of FLEXIO_TIMCTL */ -#define FLEXIO_TIMCTL_COUNT (4U) - -/*! @name TIMCFG - Timer Configuration */ -/*! @{ */ - -#define FLEXIO_TIMCFG_TSTART_MASK (0x2U) -#define FLEXIO_TIMCFG_TSTART_SHIFT (1U) -/*! TSTART - Timer Start - * 0b0..Disabled - * 0b1..Enabled - */ -#define FLEXIO_TIMCFG_TSTART(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TSTART_SHIFT)) & FLEXIO_TIMCFG_TSTART_MASK) - -#define FLEXIO_TIMCFG_TSTOP_MASK (0x30U) -#define FLEXIO_TIMCFG_TSTOP_SHIFT (4U) -/*! TSTOP - Timer Stop - * 0b00..Disabled - * 0b01..Enabled on timer compare - * 0b10..Enabled on timer disable - * 0b11..Enabled on timer compare and timer disable - */ -#define FLEXIO_TIMCFG_TSTOP(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TSTOP_SHIFT)) & FLEXIO_TIMCFG_TSTOP_MASK) - -#define FLEXIO_TIMCFG_TIMENA_MASK (0x700U) -#define FLEXIO_TIMCFG_TIMENA_SHIFT (8U) -/*! TIMENA - Timer Enable - * 0b000..Timer always enabled - * 0b001..Timer enabled on timer n-1 enable - * 0b010..Timer enabled on trigger high - * 0b011..Timer enabled on trigger high and pin high - * 0b100..Timer enabled on pin rising edge - * 0b101..Timer enabled on pin rising edge and trigger high - * 0b110..Timer enabled on trigger rising edge - * 0b111..Timer enabled on trigger rising or falling edge - */ -#define FLEXIO_TIMCFG_TIMENA(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TIMENA_SHIFT)) & FLEXIO_TIMCFG_TIMENA_MASK) - -#define FLEXIO_TIMCFG_TIMDIS_MASK (0x7000U) -#define FLEXIO_TIMCFG_TIMDIS_SHIFT (12U) -/*! TIMDIS - Timer Disable - * 0b000..Timer never disabled - * 0b001..Timer disabled on timer n-1 disable - * 0b010..Timer disabled on timer compare (upper 8 bits match and decrement) - * 0b011..Timer disabled on timer compare (upper 8 bits match and decrement) and trigger low - * 0b100..Timer disabled on pin rising or falling edge - * 0b101..Timer disabled on pin rising or falling edge provided trigger is high - * 0b110..Timer disabled on trigger falling edge - * 0b111..Reserved - */ -#define FLEXIO_TIMCFG_TIMDIS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TIMDIS_SHIFT)) & FLEXIO_TIMCFG_TIMDIS_MASK) - -#define FLEXIO_TIMCFG_TIMRST_MASK (0x70000U) -#define FLEXIO_TIMCFG_TIMRST_SHIFT (16U) -/*! TIMRST - Timer Reset - * 0b000..Never reset timer - * 0b001..Timer reset on timer output high. - * 0b010..Timer reset on timer pin equal to timer output - * 0b011..Timer reset on timer trigger equal to timer output - * 0b100..Timer reset on timer pin rising edge - * 0b101..Reserved - * 0b110..Timer reset on trigger rising edge - * 0b111..Timer reset on trigger rising or falling edge - */ -#define FLEXIO_TIMCFG_TIMRST(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TIMRST_SHIFT)) & FLEXIO_TIMCFG_TIMRST_MASK) - -#define FLEXIO_TIMCFG_TIMDEC_MASK (0x700000U) -#define FLEXIO_TIMCFG_TIMDEC_SHIFT (20U) -/*! TIMDEC - Timer Decrement - * 0b000..Decrement counter on FLEXIO clock; shift clock equals timer output - * 0b001..Decrement counter on trigger input (both edges); shift clock equals timer output - * 0b010..Decrement counter on pin input (both edges); shift clock equals pin input - * 0b011..Decrement counter on trigger input (both edges); shift clock equals trigger input - * 0b100..Decrement counter on FLEXIO clock divided by 16; shift clock equals timer output - * 0b101..Decrement counter on FLEXIO clock divided by 256; shift clock equals timer output - * 0b110..Decrement counter on pin input (rising edge); shift clock equals pin input - * 0b111..Decrement counter on trigger input (rising edge); shift clock equals trigger input - */ -#define FLEXIO_TIMCFG_TIMDEC(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TIMDEC_SHIFT)) & FLEXIO_TIMCFG_TIMDEC_MASK) - -#define FLEXIO_TIMCFG_TIMOUT_MASK (0x3000000U) -#define FLEXIO_TIMCFG_TIMOUT_SHIFT (24U) -/*! TIMOUT - Timer Output - * 0b00..Logic one when enabled; not affected by timer reset - * 0b01..Logic zero when enabled; not affected by timer reset - * 0b10..Logic one when enabled and on timer reset - * 0b11..Logic zero when enabled and on timer reset - */ -#define FLEXIO_TIMCFG_TIMOUT(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TIMOUT_SHIFT)) & FLEXIO_TIMCFG_TIMOUT_MASK) -/*! @} */ - -/* The count of FLEXIO_TIMCFG */ -#define FLEXIO_TIMCFG_COUNT (4U) - -/*! @name TIMCMP - Timer Compare */ -/*! @{ */ - -#define FLEXIO_TIMCMP_CMP_MASK (0xFFFFU) -#define FLEXIO_TIMCMP_CMP_SHIFT (0U) -/*! CMP - Timer Compare Value */ -#define FLEXIO_TIMCMP_CMP(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCMP_CMP_SHIFT)) & FLEXIO_TIMCMP_CMP_MASK) -/*! @} */ - -/* The count of FLEXIO_TIMCMP */ -#define FLEXIO_TIMCMP_COUNT (4U) - -/*! @name SHIFTBUFNBS - Shifter Buffer Nibble Byte Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFNBS_SHIFTBUFNBS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFNBS_SHIFTBUFNBS_SHIFT (0U) -/*! SHIFTBUFNBS - Shift Buffer */ -#define FLEXIO_SHIFTBUFNBS_SHIFTBUFNBS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFNBS_SHIFTBUFNBS_SHIFT)) & FLEXIO_SHIFTBUFNBS_SHIFTBUFNBS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFNBS */ -#define FLEXIO_SHIFTBUFNBS_COUNT (4U) - -/*! @name SHIFTBUFHWS - Shifter Buffer Halfword Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFHWS_SHIFTBUFHWS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFHWS_SHIFTBUFHWS_SHIFT (0U) -/*! SHIFTBUFHWS - Shift Buffer */ -#define FLEXIO_SHIFTBUFHWS_SHIFTBUFHWS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFHWS_SHIFTBUFHWS_SHIFT)) & FLEXIO_SHIFTBUFHWS_SHIFTBUFHWS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFHWS */ -#define FLEXIO_SHIFTBUFHWS_COUNT (4U) - -/*! @name SHIFTBUFNIS - Shifter Buffer Nibble Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFNIS_SHIFTBUFNIS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFNIS_SHIFTBUFNIS_SHIFT (0U) -/*! SHIFTBUFNIS - Shift Buffer */ -#define FLEXIO_SHIFTBUFNIS_SHIFTBUFNIS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFNIS_SHIFTBUFNIS_SHIFT)) & FLEXIO_SHIFTBUFNIS_SHIFTBUFNIS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFNIS */ -#define FLEXIO_SHIFTBUFNIS_COUNT (4U) - -/*! @name SHIFTBUFOES - Shifter Buffer Odd Even Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFOES_SHIFTBUFOES_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFOES_SHIFTBUFOES_SHIFT (0U) -/*! SHIFTBUFOES - Shift Buffer */ -#define FLEXIO_SHIFTBUFOES_SHIFTBUFOES(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFOES_SHIFTBUFOES_SHIFT)) & FLEXIO_SHIFTBUFOES_SHIFTBUFOES_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFOES */ -#define FLEXIO_SHIFTBUFOES_COUNT (4U) - -/*! @name SHIFTBUFEOS - Shifter Buffer Even Odd Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFEOS_SHIFTBUFEOS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFEOS_SHIFTBUFEOS_SHIFT (0U) -/*! SHIFTBUFEOS - Shift Buffer */ -#define FLEXIO_SHIFTBUFEOS_SHIFTBUFEOS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFEOS_SHIFTBUFEOS_SHIFT)) & FLEXIO_SHIFTBUFEOS_SHIFTBUFEOS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFEOS */ -#define FLEXIO_SHIFTBUFEOS_COUNT (4U) - -/*! @name SHIFTBUFHBS - Shifter Buffer Halfword Byte Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFHBS_SHIFTBUFHBS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFHBS_SHIFTBUFHBS_SHIFT (0U) -/*! SHIFTBUFHBS - Shift Buffer */ -#define FLEXIO_SHIFTBUFHBS_SHIFTBUFHBS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFHBS_SHIFTBUFHBS_SHIFT)) & FLEXIO_SHIFTBUFHBS_SHIFTBUFHBS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFHBS */ -#define FLEXIO_SHIFTBUFHBS_COUNT (4U) - - -/*! - * @} - */ /* end of group FLEXIO_Register_Masks */ - - -/* FLEXIO - Peripheral instance base addresses */ -/** Peripheral FLEXIO0 base address */ -#define FLEXIO0_BASE (0x40099000u) -/** Peripheral FLEXIO0 base pointer */ -#define FLEXIO0 ((FLEXIO_Type *)FLEXIO0_BASE) -/** Array initializer of FLEXIO peripheral base addresses */ -#define FLEXIO_BASE_ADDRS { FLEXIO0_BASE } -/** Array initializer of FLEXIO peripheral base pointers */ -#define FLEXIO_BASE_PTRS { FLEXIO0 } -/** Interrupt vectors for the FLEXIO peripheral type */ -#define FLEXIO_IRQS { FLEXIO_IRQn } - -/*! - * @} - */ /* end of group FLEXIO_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- FMC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FMC_Peripheral_Access_Layer FMC Peripheral Access Layer - * @{ - */ - -/** FMC - Register Layout Typedef */ -typedef struct { - uint8_t RESERVED_0[32]; - __IO uint32_t REMAP; /**< Data Remap, offset: 0x20 */ -} FMC_Type; - -/* ---------------------------------------------------------------------------- - -- FMC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FMC_Register_Masks FMC Register Masks - * @{ - */ - -/*! @name REMAP - Data Remap */ -/*! @{ */ - -#define FMC_REMAP_REMAPLK_MASK (0x1U) -#define FMC_REMAP_REMAPLK_SHIFT (0U) -/*! REMAPLK - Remap Lock Enable - * 0b1..Lock enabled: cannot write to REMAP - * 0b0..Lock disabled: can write to REMAP - */ -#define FMC_REMAP_REMAPLK(x) (((uint32_t)(((uint32_t)(x)) << FMC_REMAP_REMAPLK_SHIFT)) & FMC_REMAP_REMAPLK_MASK) - -#define FMC_REMAP_LIM_MASK (0x7F0000U) -#define FMC_REMAP_LIM_SHIFT (16U) -/*! LIM - LIM Remapping Address */ -#define FMC_REMAP_LIM(x) (((uint32_t)(((uint32_t)(x)) << FMC_REMAP_LIM_SHIFT)) & FMC_REMAP_LIM_MASK) - -#define FMC_REMAP_LIMDP_MASK (0x7F000000U) -#define FMC_REMAP_LIMDP_SHIFT (24U) -/*! LIMDP - LIMDP Remapping Address */ -#define FMC_REMAP_LIMDP(x) (((uint32_t)(((uint32_t)(x)) << FMC_REMAP_LIMDP_SHIFT)) & FMC_REMAP_LIMDP_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group FMC_Register_Masks */ - - -/* FMC - Peripheral instance base addresses */ -/** Peripheral FMC0 base address */ -#define FMC0_BASE (0x40094000u) -/** Peripheral FMC0 base pointer */ -#define FMC0 ((FMC_Type *)FMC0_BASE) -/** Array initializer of FMC peripheral base addresses */ -#define FMC_BASE_ADDRS { FMC0_BASE } -/** Array initializer of FMC peripheral base pointers */ -#define FMC_BASE_PTRS { FMC0 } - -/*! - * @} - */ /* end of group FMC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- FMU Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FMU_Peripheral_Access_Layer FMU Peripheral Access Layer - * @{ - */ - -/** FMU - Register Layout Typedef */ -typedef struct { - __IO uint32_t FSTAT; /**< Flash Status Register, offset: 0x0 */ - __IO uint32_t FCNFG; /**< Flash Configuration Register, offset: 0x4 */ - __IO uint32_t FCTRL; /**< Flash Control Register, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __IO uint32_t FCCOB[8]; /**< Flash Common Command Object Registers, array offset: 0x10, array step: 0x4 */ -} FMU_Type; - -/* ---------------------------------------------------------------------------- - -- FMU Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FMU_Register_Masks FMU Register Masks - * @{ - */ - -/*! @name FSTAT - Flash Status Register */ -/*! @{ */ - -#define FMU_FSTAT_FAIL_MASK (0x1U) -#define FMU_FSTAT_FAIL_SHIFT (0U) -/*! FAIL - Command Fail Flag - * 0b0..Error not detected - * 0b1..Error detected - */ -#define FMU_FSTAT_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_FAIL_SHIFT)) & FMU_FSTAT_FAIL_MASK) - -#define FMU_FSTAT_CMDABT_MASK (0x4U) -#define FMU_FSTAT_CMDABT_SHIFT (2U) -/*! CMDABT - Command Abort Flag - * 0b0..No command abort detected - * 0b1..Command abort detected - */ -#define FMU_FSTAT_CMDABT(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_CMDABT_SHIFT)) & FMU_FSTAT_CMDABT_MASK) - -#define FMU_FSTAT_PVIOL_MASK (0x10U) -#define FMU_FSTAT_PVIOL_SHIFT (4U) -/*! PVIOL - Command Protection Violation Flag - * 0b0..No protection violation detected - * 0b1..Protection violation detected - */ -#define FMU_FSTAT_PVIOL(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_PVIOL_SHIFT)) & FMU_FSTAT_PVIOL_MASK) - -#define FMU_FSTAT_ACCERR_MASK (0x20U) -#define FMU_FSTAT_ACCERR_SHIFT (5U) -/*! ACCERR - Command Access Error Flag - * 0b0..No access error detected - * 0b1..Access error detected - */ -#define FMU_FSTAT_ACCERR(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_ACCERR_SHIFT)) & FMU_FSTAT_ACCERR_MASK) - -#define FMU_FSTAT_CWSABT_MASK (0x40U) -#define FMU_FSTAT_CWSABT_SHIFT (6U) -/*! CWSABT - Command Write Sequence Abort Flag - * 0b0..Command write sequence not aborted - * 0b1..Command write sequence aborted - */ -#define FMU_FSTAT_CWSABT(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_CWSABT_SHIFT)) & FMU_FSTAT_CWSABT_MASK) - -#define FMU_FSTAT_CCIF_MASK (0x80U) -#define FMU_FSTAT_CCIF_SHIFT (7U) -/*! CCIF - Command Complete Interrupt Flag - * 0b0..Flash command, initialization, or power mode recovery in progress - * 0b1..Flash command, initialization, or power mode recovery has completed - */ -#define FMU_FSTAT_CCIF(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_CCIF_SHIFT)) & FMU_FSTAT_CCIF_MASK) - -#define FMU_FSTAT_CMDPRT_MASK (0x300U) -#define FMU_FSTAT_CMDPRT_SHIFT (8U) -/*! CMDPRT - Command protection level - * 0b00..Secure, normal access - * 0b01..Secure, privileged access - * 0b10..Nonsecure, normal access - * 0b11..Nonsecure, privileged access - */ -#define FMU_FSTAT_CMDPRT(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_CMDPRT_SHIFT)) & FMU_FSTAT_CMDPRT_MASK) - -#define FMU_FSTAT_CMDP_MASK (0x800U) -#define FMU_FSTAT_CMDP_SHIFT (11U) -/*! CMDP - Command protection status flag - * 0b0..Command protection level and domain ID are stale - * 0b1..Command protection level (CMDPRT) and domain ID (CMDDID) are set - */ -#define FMU_FSTAT_CMDP(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_CMDP_SHIFT)) & FMU_FSTAT_CMDP_MASK) - -#define FMU_FSTAT_CMDDID_MASK (0xF000U) -#define FMU_FSTAT_CMDDID_SHIFT (12U) -/*! CMDDID - Command domain ID */ -#define FMU_FSTAT_CMDDID(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_CMDDID_SHIFT)) & FMU_FSTAT_CMDDID_MASK) - -#define FMU_FSTAT_DFDIF_MASK (0x10000U) -#define FMU_FSTAT_DFDIF_SHIFT (16U) -/*! DFDIF - Double Bit Fault Detect Interrupt Flag - * 0b0..Double bit fault not detected during a valid flash read access - * 0b1..Double bit fault detected (or FCTRL[FDFD] is set) during a valid flash read access - */ -#define FMU_FSTAT_DFDIF(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_DFDIF_SHIFT)) & FMU_FSTAT_DFDIF_MASK) - -#define FMU_FSTAT_SALV_USED_MASK (0x20000U) -#define FMU_FSTAT_SALV_USED_SHIFT (17U) -/*! SALV_USED - Salvage Used for Erase operation - * 0b0..Salvage not used during last operation - * 0b1..Salvage used during the last erase operation - */ -#define FMU_FSTAT_SALV_USED(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_SALV_USED_SHIFT)) & FMU_FSTAT_SALV_USED_MASK) - -#define FMU_FSTAT_PEWEN_MASK (0x3000000U) -#define FMU_FSTAT_PEWEN_SHIFT (24U) -/*! PEWEN - Program-Erase Write Enable Control - * 0b00..Writes are not enabled - * 0b01..Writes are enabled for one flash or IFR phrase (phrase programming, sector erase) - * 0b10..Writes are enabled for one flash or IFR page (page programming) - * 0b11..Reserved - */ -#define FMU_FSTAT_PEWEN(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_PEWEN_SHIFT)) & FMU_FSTAT_PEWEN_MASK) - -#define FMU_FSTAT_PERDY_MASK (0x80000000U) -#define FMU_FSTAT_PERDY_SHIFT (31U) -/*! PERDY - Program-Erase Ready Control/Status Flag - * 0b0..Program or sector erase command operation not stalled - * 0b1..Program or sector erase command operation ready to execute - */ -#define FMU_FSTAT_PERDY(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_PERDY_SHIFT)) & FMU_FSTAT_PERDY_MASK) -/*! @} */ - -/*! @name FCNFG - Flash Configuration Register */ -/*! @{ */ - -#define FMU_FCNFG_CCIE_MASK (0x80U) -#define FMU_FCNFG_CCIE_SHIFT (7U) -/*! CCIE - Command Complete Interrupt Enable - * 0b0..Command complete interrupt disabled - * 0b1..Command complete interrupt enabled - */ -#define FMU_FCNFG_CCIE(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCNFG_CCIE_SHIFT)) & FMU_FCNFG_CCIE_MASK) - -#define FMU_FCNFG_ERSREQ_MASK (0x100U) -#define FMU_FCNFG_ERSREQ_SHIFT (8U) -/*! ERSREQ - Mass Erase Request - * 0b0..No request or request complete - * 0b1..Request to run the Mass Erase operation - */ -#define FMU_FCNFG_ERSREQ(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCNFG_ERSREQ_SHIFT)) & FMU_FCNFG_ERSREQ_MASK) - -#define FMU_FCNFG_DFDIE_MASK (0x10000U) -#define FMU_FCNFG_DFDIE_SHIFT (16U) -/*! DFDIE - Double Bit Fault Detect Interrupt Enable - * 0b0..Double bit fault detect interrupt disabled - * 0b1..Double bit fault detect interrupt enabled - */ -#define FMU_FCNFG_DFDIE(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCNFG_DFDIE_SHIFT)) & FMU_FCNFG_DFDIE_MASK) - -#define FMU_FCNFG_ERSIEN0_MASK (0xF000000U) -#define FMU_FCNFG_ERSIEN0_SHIFT (24U) -/*! ERSIEN0 - Erase IFR Sector Enable - Block 0 - * 0b0000..Block 0 IFR Sector X is protected from erase by ERSSCR command - * 0b0001..Block 0 IFR Sector X is not protected from erase by ERSSCR command - */ -#define FMU_FCNFG_ERSIEN0(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCNFG_ERSIEN0_SHIFT)) & FMU_FCNFG_ERSIEN0_MASK) - -#define FMU_FCNFG_ERSIEN1_MASK (0xF0000000U) -#define FMU_FCNFG_ERSIEN1_SHIFT (28U) -/*! ERSIEN1 - Erase IFR Sector Enable - Block 1 (for dual block configs) - * 0b0000..Block 1 IFR Sector X is protected from erase by ERSSCR command - * 0b0001..Block 1 IFR Sector X is not protected from erase by ERSSCR command - */ -#define FMU_FCNFG_ERSIEN1(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCNFG_ERSIEN1_SHIFT)) & FMU_FCNFG_ERSIEN1_MASK) -/*! @} */ - -/*! @name FCTRL - Flash Control Register */ -/*! @{ */ - -#define FMU_FCTRL_RWSC_MASK (0xFU) -#define FMU_FCTRL_RWSC_SHIFT (0U) -/*! RWSC - Read Wait-State Control */ -#define FMU_FCTRL_RWSC(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCTRL_RWSC_SHIFT)) & FMU_FCTRL_RWSC_MASK) - -#define FMU_FCTRL_LSACTIVE_MASK (0x100U) -#define FMU_FCTRL_LSACTIVE_SHIFT (8U) -/*! LSACTIVE - Low speed active mode - * 0b0..Full speed active mode requested - * 0b1..Low speed active mode requested - */ -#define FMU_FCTRL_LSACTIVE(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCTRL_LSACTIVE_SHIFT)) & FMU_FCTRL_LSACTIVE_MASK) - -#define FMU_FCTRL_FDFD_MASK (0x10000U) -#define FMU_FCTRL_FDFD_SHIFT (16U) -/*! FDFD - Force Double Bit Fault Detect - * 0b0..FSTAT[DFDIF] sets only if a double bit fault is detected during a valid flash read access from the platform flash controller - * 0b1..FSTAT[DFDIF] sets during any valid flash read access from the platform flash controller. An interrupt - * request is generated if the DFDIE bit is set. - */ -#define FMU_FCTRL_FDFD(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCTRL_FDFD_SHIFT)) & FMU_FCTRL_FDFD_MASK) - -#define FMU_FCTRL_ABTREQ_MASK (0x1000000U) -#define FMU_FCTRL_ABTREQ_SHIFT (24U) -/*! ABTREQ - Abort Request - * 0b0..No request to abort a command write sequence - * 0b1..Request to abort a command write sequence - */ -#define FMU_FCTRL_ABTREQ(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCTRL_ABTREQ_SHIFT)) & FMU_FCTRL_ABTREQ_MASK) -/*! @} */ - -/*! @name FCCOB - Flash Common Command Object Registers */ -/*! @{ */ - -#define FMU_FCCOB_CCOBn_MASK (0xFFFFFFFFU) -#define FMU_FCCOB_CCOBn_SHIFT (0U) -/*! CCOBn - CCOBn */ -#define FMU_FCCOB_CCOBn(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCCOB_CCOBn_SHIFT)) & FMU_FCCOB_CCOBn_MASK) -/*! @} */ - -/* The count of FMU_FCCOB */ -#define FMU_FCCOB_COUNT (8U) - - -/*! - * @} - */ /* end of group FMU_Register_Masks */ - - -/* FMU - Peripheral instance base addresses */ -/** Peripheral FMU0 base address */ -#define FMU0_BASE (0x40095000u) -/** Peripheral FMU0 base pointer */ -#define FMU0 ((FMU_Type *)FMU0_BASE) -/** Array initializer of FMU peripheral base addresses */ -#define FMU_BASE_ADDRS { FMU0_BASE } -/** Array initializer of FMU peripheral base pointers */ -#define FMU_BASE_PTRS { FMU0 } - -/*! - * @} - */ /* end of group FMU_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- FMUTEST Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FMUTEST_Peripheral_Access_Layer FMUTEST Peripheral Access Layer - * @{ - */ - -/** FMUTEST - Register Layout Typedef */ -typedef struct { - __IO uint32_t FSTAT; /**< Flash Status Register, offset: 0x0 */ - __IO uint32_t FCNFG; /**< Flash Configuration Register, offset: 0x4 */ - __IO uint32_t FCTRL; /**< Flash Control Register, offset: 0x8 */ - __I uint32_t FTEST; /**< Flash Test Register, offset: 0xC */ - __IO uint32_t FCCOB0; /**< Flash Command Control 0 Register, offset: 0x10 */ - __IO uint32_t FCCOB1; /**< Flash Command Control 1 Register, offset: 0x14 */ - __IO uint32_t FCCOB2; /**< Flash Command Control 2 Register, offset: 0x18 */ - __IO uint32_t FCCOB3; /**< Flash Command Control 3 Register, offset: 0x1C */ - __IO uint32_t FCCOB4; /**< Flash Command Control 4 Register, offset: 0x20 */ - __IO uint32_t FCCOB5; /**< Flash Command Control 5 Register, offset: 0x24 */ - __IO uint32_t FCCOB6; /**< Flash Command Control 6 Register, offset: 0x28 */ - __IO uint32_t FCCOB7; /**< Flash Command Control 7 Register, offset: 0x2C */ - uint8_t RESERVED_0[208]; - __IO uint32_t RESET_STATUS; /**< FMU Initialization Tracking Register, offset: 0x100 */ - __IO uint32_t MCTL; /**< FMU Control Register, offset: 0x104 */ - __I uint32_t BSEL_GEN; /**< FMU Block Select Generation Register, offset: 0x108 */ - __IO uint32_t PWR_OPT; /**< Power Mode Options Register, offset: 0x10C */ - __I uint32_t CMD_CHECK; /**< FMU Command Check Register, offset: 0x110 */ - uint8_t RESERVED_1[12]; - __IO uint32_t BSEL; /**< FMU Block Select Register, offset: 0x120 */ - __IO uint32_t MSIZE; /**< FMU Memory Size Register, offset: 0x124 */ - __IO uint32_t FLASH_RD_ADD; /**< Flash Read Address Register, offset: 0x128 */ - uint8_t RESERVED_2[4]; - __IO uint32_t FLASH_STOP_ADD; /**< Flash Stop Address Register, offset: 0x130 */ - __IO uint32_t FLASH_RD_CTRL; /**< Flash Read Control Register, offset: 0x134 */ - __IO uint32_t MM_ADDR; /**< Memory Map Address Register, offset: 0x138 */ - uint8_t RESERVED_3[4]; - __IO uint32_t MM_WDATA; /**< Memory Map Write Data Register, offset: 0x140 */ - __IO uint32_t MM_CTL; /**< Memory Map Control Register, offset: 0x144 */ - __IO uint32_t UINT_CTL; /**< User Interface Control Register, offset: 0x148 */ - __IO uint32_t RD_DATA0; /**< Read Data 0 Register, offset: 0x14C */ - __IO uint32_t RD_DATA1; /**< Read Data 1 Register, offset: 0x150 */ - __IO uint32_t RD_DATA2; /**< Read Data 2 Register, offset: 0x154 */ - __IO uint32_t RD_DATA3; /**< Read Data 3 Register, offset: 0x158 */ - __IO uint32_t PARITY; /**< Parity Register, offset: 0x15C */ - __IO uint32_t RD_PATH_CTRL_STATUS; /**< Read Path Control and Status Register, offset: 0x160 */ - __IO uint32_t SMW_DIN0; /**< SMW DIN 0 Register, offset: 0x164 */ - __IO uint32_t SMW_DIN1; /**< SMW DIN 1 Register, offset: 0x168 */ - __IO uint32_t SMW_DIN2; /**< SMW DIN 2 Register, offset: 0x16C */ - __IO uint32_t SMW_DIN3; /**< SMW DIN 3 Register, offset: 0x170 */ - __IO uint32_t SMW_ADDR; /**< SMW Address Register, offset: 0x174 */ - __IO uint32_t SMW_CMD_WAIT; /**< SMW Command and Wait Register, offset: 0x178 */ - __I uint32_t SMW_STATUS; /**< SMW Status Register, offset: 0x17C */ - __IO uint32_t SOCTRIM0_0; /**< SoC Trim Phrase 0 Word 0 Register, offset: 0x180 */ - __IO uint32_t SOCTRIM0_1; /**< SoC Trim Phrase 0 Word 1 Register, offset: 0x184 */ - __IO uint32_t SOCTRIM0_2; /**< SoC Trim Phrase 0 Word 2 Register, offset: 0x188 */ - __IO uint32_t SOCTRIM0_3; /**< SoC Trim Phrase 0 Word 3 Register, offset: 0x18C */ - __IO uint32_t SOCTRIM1_0; /**< SoC Trim Phrase 1 Word 0 Register, offset: 0x190 */ - __IO uint32_t SOCTRIM1_1; /**< SoC Trim Phrase 1 Word 1 Register, offset: 0x194 */ - __IO uint32_t SOCTRIM1_2; /**< SoC Trim Phrase 1 Word 2 Register, offset: 0x198 */ - __IO uint32_t SOCTRIM1_3; /**< SoC Trim Phrase 1 Word 3 Register, offset: 0x19C */ - __IO uint32_t SOCTRIM2_0; /**< SoC Trim Phrase 2 Word 0 Register, offset: 0x1A0 */ - __IO uint32_t SOCTRIM2_1; /**< SoC Trim Phrase 2 Word 1 Register, offset: 0x1A4 */ - __IO uint32_t SOCTRIM2_2; /**< SoC Trim Phrase 2 Word 2 Register, offset: 0x1A8 */ - __IO uint32_t SOCTRIM2_3; /**< SoC Trim Phrase 2 Word 3 Register, offset: 0x1AC */ - __IO uint32_t SOCTRIM3_0; /**< SoC Trim Phrase 3 Word 0 Register, offset: 0x1B0 */ - __IO uint32_t SOCTRIM3_1; /**< SoC Trim Phrase 3 Word 1 Register, offset: 0x1B4 */ - __IO uint32_t SOCTRIM3_2; /**< SoC Trim Phrase 3 Word 2 Register, offset: 0x1B8 */ - __IO uint32_t SOCTRIM3_3; /**< SoC Trim Phrase 3 Word 3 Register, offset: 0x1BC */ - __IO uint32_t SOCTRIM4_0; /**< SoC Trim Phrase 4 Word 0 Register, offset: 0x1C0 */ - __IO uint32_t SOCTRIM4_1; /**< SoC Trim Phrase 4 Word 1 Register, offset: 0x1C4 */ - __IO uint32_t SOCTRIM4_2; /**< SoC Trim Phrase 4 Word 2 Register, offset: 0x1C8 */ - __IO uint32_t SOCTRIM4_3; /**< SoC Trim Phrase 4 Word 3 Register, offset: 0x1CC */ - __IO uint32_t SOCTRIM5_0; /**< SoC Trim Phrase 5 Word 0 Register, offset: 0x1D0 */ - __IO uint32_t SOCTRIM5_1; /**< SoC Trim Phrase 5 Word 1 Register, offset: 0x1D4 */ - __IO uint32_t SOCTRIM5_2; /**< SoC Trim Phrase 5 Word 2 Register, offset: 0x1D8 */ - __IO uint32_t SOCTRIM5_3; /**< SoC Trim Phrase 5 Word 3 Register, offset: 0x1DC */ - __IO uint32_t SOCTRIM6_0; /**< SoC Trim Phrase 6 Word 0 Register, offset: 0x1E0 */ - __IO uint32_t SOCTRIM6_1; /**< SoC Trim Phrase 6 Word 1 Register, offset: 0x1E4 */ - __IO uint32_t SOCTRIM6_2; /**< SoC Trim Phrase 6 Word 2 Register, offset: 0x1E8 */ - __IO uint32_t SOCTRIM6_3; /**< SoC Trim Phrase 6 Word 3 Register, offset: 0x1EC */ - __IO uint32_t SOCTRIM7_0; /**< SoC Trim Phrase 7 Word 0 Register, offset: 0x1F0 */ - __IO uint32_t SOCTRIM7_1; /**< SoC Trim Phrase 7 Word 1 Register, offset: 0x1F4 */ - __IO uint32_t SOCTRIM7_2; /**< SoC Trim Phrase 7 Word 2 Register, offset: 0x1F8 */ - __IO uint32_t SOCTRIM7_3; /**< SoC Trim Phrase 7 Word 3 Register, offset: 0x1FC */ - uint8_t RESERVED_4[4]; - __IO uint32_t R_IP_CONFIG; /**< BIST Configuration Register, offset: 0x204 */ - __IO uint32_t R_TESTCODE; /**< BIST Test Code Register, offset: 0x208 */ - __IO uint32_t R_DFT_CTRL; /**< BIST DFT Control Register, offset: 0x20C */ - __IO uint32_t R_ADR_CTRL; /**< BIST Address Control Register, offset: 0x210 */ - __IO uint32_t R_DATA_CTRL0; /**< BIST Data Control 0 Register, offset: 0x214 */ - __IO uint32_t R_PIN_CTRL; /**< BIST Pin Control Register, offset: 0x218 */ - __IO uint32_t R_CNT_LOOP_CTRL; /**< BIST Loop Count Control Register, offset: 0x21C */ - __IO uint32_t R_TIMER_CTRL; /**< BIST Timer Control Register, offset: 0x220 */ - __IO uint32_t R_TEST_CTRL; /**< BIST Test Control Register, offset: 0x224 */ - __O uint32_t R_ABORT_LOOP; /**< BIST Abort Loop Register, offset: 0x228 */ - __I uint32_t R_ADR_QUERY; /**< BIST Address Query Register, offset: 0x22C */ - __I uint32_t R_DOUT_QUERY0; /**< BIST DOUT Query 0 Register, offset: 0x230 */ - uint8_t RESERVED_5[8]; - __I uint32_t R_SMW_QUERY; /**< BIST SMW Query Register, offset: 0x23C */ - __IO uint32_t R_SMW_SETTING0; /**< BIST SMW Setting 0 Register, offset: 0x240 */ - __IO uint32_t R_SMW_SETTING1; /**< BIST SMW Setting 1 Register, offset: 0x244 */ - __IO uint32_t R_SMP_WHV0; /**< BIST SMP WHV Setting 0 Register, offset: 0x248 */ - __IO uint32_t R_SMP_WHV1; /**< BIST SMP WHV Setting 1 Register, offset: 0x24C */ - __IO uint32_t R_SME_WHV0; /**< BIST SME WHV Setting 0 Register, offset: 0x250 */ - __IO uint32_t R_SME_WHV1; /**< BIST SME WHV Setting 1 Register, offset: 0x254 */ - __IO uint32_t R_SMW_SETTING2; /**< BIST SMW Setting 2 Register, offset: 0x258 */ - __I uint32_t R_D_MISR0; /**< BIST DIN MISR 0 Register, offset: 0x25C */ - __I uint32_t R_A_MISR0; /**< BIST Address MISR 0 Register, offset: 0x260 */ - __I uint32_t R_C_MISR0; /**< BIST Control MISR 0 Register, offset: 0x264 */ - __IO uint32_t R_SMW_SETTING3; /**< BIST SMW Setting 3 Register, offset: 0x268 */ - __IO uint32_t R_DATA_CTRL1; /**< BIST Data Control 1 Register, offset: 0x26C */ - __IO uint32_t R_DATA_CTRL2; /**< BIST Data Control 2 Register, offset: 0x270 */ - __IO uint32_t R_DATA_CTRL3; /**< BIST Data Control 3 Register, offset: 0x274 */ - uint8_t RESERVED_6[8]; - __I uint32_t R_REPAIR0_0; /**< BIST Repair 0 for Block 0 Register, offset: 0x280 */ - __I uint32_t R_REPAIR0_1; /**< BIST Repair 1 Block 0 Register, offset: 0x284 */ - __I uint32_t R_REPAIR1_0; /**< BIST Repair 0 Block 1 Register, offset: 0x288 */ - __I uint32_t R_REPAIR1_1; /**< BIST Repair 1 Block 1 Register, offset: 0x28C */ - uint8_t RESERVED_7[132]; - __IO uint32_t R_DATA_CTRL0_EX; /**< BIST Data Control 0 Extension Register, offset: 0x314 */ - uint8_t RESERVED_8[8]; - __IO uint32_t R_TIMER_CTRL_EX; /**< BIST Timer Control Extension Register, offset: 0x320 */ - uint8_t RESERVED_9[12]; - __I uint32_t R_DOUT_QUERY1; /**< BIST DOUT Query 1 Register, offset: 0x330 */ - uint8_t RESERVED_10[40]; - __I uint32_t R_D_MISR1; /**< BIST DIN MISR 1 Register, offset: 0x35C */ - __I uint32_t R_A_MISR1; /**< BIST Address MISR 1 Register, offset: 0x360 */ - __I uint32_t R_C_MISR1; /**< BIST Control MISR 1 Register, offset: 0x364 */ - uint8_t RESERVED_11[4]; - __IO uint32_t R_DATA_CTRL1_EX; /**< BIST Data Control 1 Extension Register, offset: 0x36C */ - __IO uint32_t R_DATA_CTRL2_EX; /**< BIST Data Control 2 Extension Register, offset: 0x370 */ - __IO uint32_t R_DATA_CTRL3_EX; /**< BIST Data Control 3 Extension Register, offset: 0x374 */ - uint8_t RESERVED_12[136]; - __IO uint32_t SMW_TIMER_OPTION; /**< SMW Timer Option Register, offset: 0x400 */ - __IO uint32_t SMW_SETTING_OPTION0; /**< SMW Setting Option 0 Register, offset: 0x404 */ - __IO uint32_t SMW_SETTING_OPTION2; /**< SMW Setting Option 2 Register, offset: 0x408 */ - __IO uint32_t SMW_SETTING_OPTION3; /**< SMW Setting Option 3 Register, offset: 0x40C */ - __IO uint32_t SMW_SMP_WHV_OPTION0; /**< SMW SMP WHV Option 0 Register, offset: 0x410 */ - __IO uint32_t SMW_SME_WHV_OPTION0; /**< SMW SME WHV Option 0 Register, offset: 0x414 */ - __IO uint32_t SMW_SETTING_OPTION1; /**< SMW Setting Option 1 Register, offset: 0x418 */ - __IO uint32_t SMW_SMP_WHV_OPTION1; /**< SMW SMP WHV Option 1 Register, offset: 0x41C */ - __IO uint32_t SMW_SME_WHV_OPTION1; /**< SMW SME WHV Option 1 Register, offset: 0x420 */ - uint8_t RESERVED_13[220]; - __IO uint32_t REPAIR0_0; /**< FMU Repair 0 Block 0 Register, offset: 0x500 */ - __IO uint32_t REPAIR0_1; /**< FMU Repair 1 Block 0 Register, offset: 0x504 */ - __IO uint32_t REPAIR1_0; /**< FMU Repair 0 Block 1 Register, offset: 0x508 */ - __IO uint32_t REPAIR1_1; /**< FMU Repair 1 Block 1 Register, offset: 0x50C */ - uint8_t RESERVED_14[240]; - __IO uint32_t SMW_HB_SIGNALS; /**< SMW HB Signals Register, offset: 0x600 */ - __IO uint32_t BIST_DUMP_CTRL; /**< BIST Datadump Control Register, offset: 0x604 */ - uint8_t RESERVED_15[4]; - __IO uint32_t ATX_PIN_CTRL; /**< ATX Pin Control Register, offset: 0x60C */ - __IO uint32_t FAILCNT; /**< Fail Count Register, offset: 0x610 */ - __IO uint32_t PGM_PULSE_CNT0; /**< Block 0 Program Pulse Count Register, offset: 0x614 */ - __IO uint32_t PGM_PULSE_CNT1; /**< Block 1 Program Pulse Count Register, offset: 0x618 */ - __IO uint32_t ERS_PULSE_CNT; /**< Erase Pulse Count Register, offset: 0x61C */ - __IO uint32_t MAX_PULSE_CNT; /**< Maximum Pulse Count Register, offset: 0x620 */ - __IO uint32_t PORT_CTRL; /**< Port Control Register, offset: 0x624 */ -} FMUTEST_Type; - -/* ---------------------------------------------------------------------------- - -- FMUTEST Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FMUTEST_Register_Masks FMUTEST Register Masks - * @{ - */ - -/*! @name FSTAT - Flash Status Register */ -/*! @{ */ - -#define FMUTEST_FSTAT_FAIL_MASK (0x1U) -#define FMUTEST_FSTAT_FAIL_SHIFT (0U) -/*! FAIL - Command Fail Flag - * 0b0..Error not detected - * 0b1..Error detected - */ -#define FMUTEST_FSTAT_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_FAIL_SHIFT)) & FMUTEST_FSTAT_FAIL_MASK) - -#define FMUTEST_FSTAT_CMDABT_MASK (0x4U) -#define FMUTEST_FSTAT_CMDABT_SHIFT (2U) -/*! CMDABT - Command Abort Flag - * 0b0..No command abort detected - * 0b1..Command abort detected - */ -#define FMUTEST_FSTAT_CMDABT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_CMDABT_SHIFT)) & FMUTEST_FSTAT_CMDABT_MASK) - -#define FMUTEST_FSTAT_PVIOL_MASK (0x10U) -#define FMUTEST_FSTAT_PVIOL_SHIFT (4U) -/*! PVIOL - Command Protection Violation Flag - * 0b0..No protection violation detected - * 0b1..Protection violation detected - */ -#define FMUTEST_FSTAT_PVIOL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_PVIOL_SHIFT)) & FMUTEST_FSTAT_PVIOL_MASK) - -#define FMUTEST_FSTAT_ACCERR_MASK (0x20U) -#define FMUTEST_FSTAT_ACCERR_SHIFT (5U) -/*! ACCERR - Command Access Error Flag - * 0b0..No access error detected - * 0b1..Access error detected - */ -#define FMUTEST_FSTAT_ACCERR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_ACCERR_SHIFT)) & FMUTEST_FSTAT_ACCERR_MASK) - -#define FMUTEST_FSTAT_CWSABT_MASK (0x40U) -#define FMUTEST_FSTAT_CWSABT_SHIFT (6U) -/*! CWSABT - Command Write Sequence Abort Flag - * 0b0..Command write sequence not aborted - * 0b1..Command write sequence aborted - */ -#define FMUTEST_FSTAT_CWSABT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_CWSABT_SHIFT)) & FMUTEST_FSTAT_CWSABT_MASK) - -#define FMUTEST_FSTAT_CCIF_MASK (0x80U) -#define FMUTEST_FSTAT_CCIF_SHIFT (7U) -/*! CCIF - Command Complete Interrupt Flag - * 0b0..Flash command or initialization in progress - * 0b1..Flash command or initialization has completed - */ -#define FMUTEST_FSTAT_CCIF(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_CCIF_SHIFT)) & FMUTEST_FSTAT_CCIF_MASK) - -#define FMUTEST_FSTAT_CMDPRT_MASK (0x300U) -#define FMUTEST_FSTAT_CMDPRT_SHIFT (8U) -/*! CMDPRT - Command Protection Level - * 0b00..Secure, normal access - * 0b01..Secure, privileged access - * 0b10..Nonsecure, normal access - * 0b11..Nonsecure, privileged access - */ -#define FMUTEST_FSTAT_CMDPRT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_CMDPRT_SHIFT)) & FMUTEST_FSTAT_CMDPRT_MASK) - -#define FMUTEST_FSTAT_CMDP_MASK (0x800U) -#define FMUTEST_FSTAT_CMDP_SHIFT (11U) -/*! CMDP - Command Protection Status Flag - * 0b0..Command protection level and domain ID are stale - * 0b1..Command protection level (CMDPRT) and domain ID (CMDDID) are set - */ -#define FMUTEST_FSTAT_CMDP(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_CMDP_SHIFT)) & FMUTEST_FSTAT_CMDP_MASK) - -#define FMUTEST_FSTAT_CMDDID_MASK (0xF000U) -#define FMUTEST_FSTAT_CMDDID_SHIFT (12U) -/*! CMDDID - Command Domain ID */ -#define FMUTEST_FSTAT_CMDDID(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_CMDDID_SHIFT)) & FMUTEST_FSTAT_CMDDID_MASK) - -#define FMUTEST_FSTAT_DFDIF_MASK (0x10000U) -#define FMUTEST_FSTAT_DFDIF_SHIFT (16U) -/*! DFDIF - Double Bit Fault Detect Interrupt Flag - * 0b0..Double bit fault not detected during a valid flash read access from the FMC - * 0b1..Double bit fault detected (or FCTRL[FDFD] is set) during a valid flash read access from the FMC - */ -#define FMUTEST_FSTAT_DFDIF(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_DFDIF_SHIFT)) & FMUTEST_FSTAT_DFDIF_MASK) - -#define FMUTEST_FSTAT_SALV_USED_MASK (0x20000U) -#define FMUTEST_FSTAT_SALV_USED_SHIFT (17U) -/*! SALV_USED - Salvage Used for Erase operation - * 0b0..Salvage not used during the last operation - * 0b1..Salvage used during the last erase operation - */ -#define FMUTEST_FSTAT_SALV_USED(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_SALV_USED_SHIFT)) & FMUTEST_FSTAT_SALV_USED_MASK) - -#define FMUTEST_FSTAT_PEWEN_MASK (0x3000000U) -#define FMUTEST_FSTAT_PEWEN_SHIFT (24U) -/*! PEWEN - Program-Erase Write Enable Control - * 0b00..Writes are not enabled - * 0b01..Writes are enabled for one flash or IFR phrase (phrase programming, sector erase) - * 0b10..Writes are enabled for one flash or IFR page (page programming) - * 0b11..Reserved - */ -#define FMUTEST_FSTAT_PEWEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_PEWEN_SHIFT)) & FMUTEST_FSTAT_PEWEN_MASK) - -#define FMUTEST_FSTAT_PERDY_MASK (0x80000000U) -#define FMUTEST_FSTAT_PERDY_SHIFT (31U) -/*! PERDY - Program/Erase Ready Control/Status Flag - * 0b0..Program or sector erase command operation is not stalled - * 0b1..Program or sector erase command operation is stalled - */ -#define FMUTEST_FSTAT_PERDY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_PERDY_SHIFT)) & FMUTEST_FSTAT_PERDY_MASK) -/*! @} */ - -/*! @name FCNFG - Flash Configuration Register */ -/*! @{ */ - -#define FMUTEST_FCNFG_CCIE_MASK (0x80U) -#define FMUTEST_FCNFG_CCIE_SHIFT (7U) -/*! CCIE - Command Complete Interrupt Enable - * 0b0..Command complete interrupt disabled - * 0b1..Command complete interrupt enabled. An interrupt request is generated whenever the FSTAT[CCIF] flag is set. - */ -#define FMUTEST_FCNFG_CCIE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCNFG_CCIE_SHIFT)) & FMUTEST_FCNFG_CCIE_MASK) - -#define FMUTEST_FCNFG_ERSREQ_MASK (0x100U) -#define FMUTEST_FCNFG_ERSREQ_SHIFT (8U) -/*! ERSREQ - Mass Erase (Erase All) Request - * 0b0..No request or request complete - * 0b1..Request to run the Mass Erase operation - */ -#define FMUTEST_FCNFG_ERSREQ(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCNFG_ERSREQ_SHIFT)) & FMUTEST_FCNFG_ERSREQ_MASK) - -#define FMUTEST_FCNFG_DFDIE_MASK (0x10000U) -#define FMUTEST_FCNFG_DFDIE_SHIFT (16U) -/*! DFDIE - Double Bit Fault Detect Interrupt Enable - * 0b0..Double bit fault detect interrupt disabled - * 0b1..Double bit fault detect interrupt enabled; an interrupt request is generated whenever the FSTAT[DFDIF] flag is set - */ -#define FMUTEST_FCNFG_DFDIE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCNFG_DFDIE_SHIFT)) & FMUTEST_FCNFG_DFDIE_MASK) - -#define FMUTEST_FCNFG_ERSIEN0_MASK (0xF000000U) -#define FMUTEST_FCNFG_ERSIEN0_SHIFT (24U) -/*! ERSIEN0 - Erase IFR Sector Enable - Block 0 - * 0b0000..Block 0 IFR Sector X is protected from erase by ERSSCR command - * 0b0001..Block 0 IFR Sector X is not protected from erase by ERSSCR command - */ -#define FMUTEST_FCNFG_ERSIEN0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCNFG_ERSIEN0_SHIFT)) & FMUTEST_FCNFG_ERSIEN0_MASK) - -#define FMUTEST_FCNFG_ERSIEN1_MASK (0xF0000000U) -#define FMUTEST_FCNFG_ERSIEN1_SHIFT (28U) -/*! ERSIEN1 - Erase IFR Sector Enable - Block 1 (for dual block configs) - * 0b0000..Block 1 IFR Sector X is protected from erase by ERSSCR command - * 0b0001..Block 1 IFR Sector X is not protected from erase by ERSSCR command - */ -#define FMUTEST_FCNFG_ERSIEN1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCNFG_ERSIEN1_SHIFT)) & FMUTEST_FCNFG_ERSIEN1_MASK) -/*! @} */ - -/*! @name FCTRL - Flash Control Register */ -/*! @{ */ - -#define FMUTEST_FCTRL_RWSC_MASK (0xFU) -#define FMUTEST_FCTRL_RWSC_SHIFT (0U) -/*! RWSC - Read Wait-State Control - * 0b0000..no additional wait-states are added (single cycle access) - * 0b0001..1 additional wait-state is added - * 0b0010..2 additional wait-states are added - * 0b0011..3 additional wait-states are added - * 0b0100..4 additional wait-states are added - * 0b0101..5 additional wait-states are added - * 0b0110..6 additional wait-states are added - * 0b0111..7 additional wait-states are added - * 0b1000..8 additional wait-states are added - * 0b1001..9 additional wait-states are added - * 0b1010..10 additional wait-states are added - * 0b1011..11 additional wait-states are added - * 0b1100..12 additional wait-states are added - * 0b1101..13 additional wait-states are added - * 0b1110..14 additional wait-states are added - * 0b1111..15 additional wait-states are added - */ -#define FMUTEST_FCTRL_RWSC(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCTRL_RWSC_SHIFT)) & FMUTEST_FCTRL_RWSC_MASK) - -#define FMUTEST_FCTRL_LSACTIVE_MASK (0x100U) -#define FMUTEST_FCTRL_LSACTIVE_SHIFT (8U) -/*! LSACTIVE - Low Speed Active Mode - * 0b0..Full speed active mode requested - * 0b1..Low speed active mode requested - */ -#define FMUTEST_FCTRL_LSACTIVE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCTRL_LSACTIVE_SHIFT)) & FMUTEST_FCTRL_LSACTIVE_MASK) - -#define FMUTEST_FCTRL_FDFD_MASK (0x10000U) -#define FMUTEST_FCTRL_FDFD_SHIFT (16U) -/*! FDFD - Force Double Bit Fault Detect - * 0b0..FSTAT[DFDIF] sets only if a double bit fault is detected during a valid flash read access from the FMC - * 0b1..FSTAT[DFDIF] sets during any valid flash read access from the FMC; an interrupt request is generated if the DFDIE bit is set - */ -#define FMUTEST_FCTRL_FDFD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCTRL_FDFD_SHIFT)) & FMUTEST_FCTRL_FDFD_MASK) - -#define FMUTEST_FCTRL_ABTREQ_MASK (0x1000000U) -#define FMUTEST_FCTRL_ABTREQ_SHIFT (24U) -/*! ABTREQ - Abort Request - * 0b0..No request to abort a command write sequence - * 0b1..Request to abort a command write sequence - */ -#define FMUTEST_FCTRL_ABTREQ(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCTRL_ABTREQ_SHIFT)) & FMUTEST_FCTRL_ABTREQ_MASK) -/*! @} */ - -/*! @name FTEST - Flash Test Register */ -/*! @{ */ - -#define FMUTEST_FTEST_TMECTL_MASK (0x1U) -#define FMUTEST_FTEST_TMECTL_SHIFT (0U) -/*! TMECTL - Test Mode Entry Control - * 0b0..FTEST register always reads 0 and writes to FTEST are ignored - * 0b1..FTEST register is readable and can be written to enable writability of TME - */ -#define FMUTEST_FTEST_TMECTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FTEST_TMECTL_SHIFT)) & FMUTEST_FTEST_TMECTL_MASK) - -#define FMUTEST_FTEST_TMEWR_MASK (0x2U) -#define FMUTEST_FTEST_TMEWR_SHIFT (1U) -/*! TMEWR - Test Mode Entry Writable - * 0b0..TME bit is not writable - * 0b1..TME bit is writable - */ -#define FMUTEST_FTEST_TMEWR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FTEST_TMEWR_SHIFT)) & FMUTEST_FTEST_TMEWR_MASK) - -#define FMUTEST_FTEST_TME_MASK (0x4U) -#define FMUTEST_FTEST_TME_SHIFT (2U) -/*! TME - Test Mode Entry - * 0b0..Test mode entry not requested - * 0b1..Test mode entry requested - */ -#define FMUTEST_FTEST_TME(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FTEST_TME_SHIFT)) & FMUTEST_FTEST_TME_MASK) - -#define FMUTEST_FTEST_TMODE_MASK (0x8U) -#define FMUTEST_FTEST_TMODE_SHIFT (3U) -/*! TMODE - Test Mode Status - * 0b0..Test mode not active - * 0b1..Test mode active - */ -#define FMUTEST_FTEST_TMODE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FTEST_TMODE_SHIFT)) & FMUTEST_FTEST_TMODE_MASK) - -#define FMUTEST_FTEST_TMELOCK_MASK (0x10U) -#define FMUTEST_FTEST_TMELOCK_SHIFT (4U) -/*! TMELOCK - Test Mode Entry Lock - * 0b0..FTEST register not locked from accepting writes - * 0b1..FTEST register locked from accepting writes - */ -#define FMUTEST_FTEST_TMELOCK(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FTEST_TMELOCK_SHIFT)) & FMUTEST_FTEST_TMELOCK_MASK) -/*! @} */ - -/*! @name FCCOB0 - Flash Command Control 0 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB0_CMDCODE_MASK (0xFFU) -#define FMUTEST_FCCOB0_CMDCODE_SHIFT (0U) -/*! CMDCODE - Command code */ -#define FMUTEST_FCCOB0_CMDCODE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB0_CMDCODE_SHIFT)) & FMUTEST_FCCOB0_CMDCODE_MASK) -/*! @} */ - -/*! @name FCCOB1 - Flash Command Control 1 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB1_CMDOPT_MASK (0xFFU) -#define FMUTEST_FCCOB1_CMDOPT_SHIFT (0U) -/*! CMDOPT - Command options */ -#define FMUTEST_FCCOB1_CMDOPT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB1_CMDOPT_SHIFT)) & FMUTEST_FCCOB1_CMDOPT_MASK) -/*! @} */ - -/*! @name FCCOB2 - Flash Command Control 2 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB2_CMDADDR_MASK (0xFFFFFFFFU) -#define FMUTEST_FCCOB2_CMDADDR_SHIFT (0U) -/*! CMDADDR - Command starting address */ -#define FMUTEST_FCCOB2_CMDADDR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB2_CMDADDR_SHIFT)) & FMUTEST_FCCOB2_CMDADDR_MASK) -/*! @} */ - -/*! @name FCCOB3 - Flash Command Control 3 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB3_CMDADDRE_MASK (0xFFFFFFFFU) -#define FMUTEST_FCCOB3_CMDADDRE_SHIFT (0U) -/*! CMDADDRE - Command ending address */ -#define FMUTEST_FCCOB3_CMDADDRE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB3_CMDADDRE_SHIFT)) & FMUTEST_FCCOB3_CMDADDRE_MASK) -/*! @} */ - -/*! @name FCCOB4 - Flash Command Control 4 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB4_CMDDATA0_MASK (0xFFFFFFFFU) -#define FMUTEST_FCCOB4_CMDDATA0_SHIFT (0U) -/*! CMDDATA0 - Command data word 0 */ -#define FMUTEST_FCCOB4_CMDDATA0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB4_CMDDATA0_SHIFT)) & FMUTEST_FCCOB4_CMDDATA0_MASK) -/*! @} */ - -/*! @name FCCOB5 - Flash Command Control 5 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB5_CMDDATA1_MASK (0xFFFFFFFFU) -#define FMUTEST_FCCOB5_CMDDATA1_SHIFT (0U) -/*! CMDDATA1 - Command data word 1 */ -#define FMUTEST_FCCOB5_CMDDATA1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB5_CMDDATA1_SHIFT)) & FMUTEST_FCCOB5_CMDDATA1_MASK) -/*! @} */ - -/*! @name FCCOB6 - Flash Command Control 6 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB6_CMDDATA2_MASK (0xFFFFFFFFU) -#define FMUTEST_FCCOB6_CMDDATA2_SHIFT (0U) -/*! CMDDATA2 - Command data word 2 */ -#define FMUTEST_FCCOB6_CMDDATA2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB6_CMDDATA2_SHIFT)) & FMUTEST_FCCOB6_CMDDATA2_MASK) -/*! @} */ - -/*! @name FCCOB7 - Flash Command Control 7 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB7_CMDDATA3_MASK (0xFFFFFFFFU) -#define FMUTEST_FCCOB7_CMDDATA3_SHIFT (0U) -/*! CMDDATA3 - Command data word 3 */ -#define FMUTEST_FCCOB7_CMDDATA3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB7_CMDDATA3_SHIFT)) & FMUTEST_FCCOB7_CMDDATA3_MASK) -/*! @} */ - -/*! @name RESET_STATUS - FMU Initialization Tracking Register */ -/*! @{ */ - -#define FMUTEST_RESET_STATUS_ARY_TRIM_DONE_MASK (0x1U) -#define FMUTEST_RESET_STATUS_ARY_TRIM_DONE_SHIFT (0U) -/*! ARY_TRIM_DONE - Array Trim Complete - * 0b0..Recall register load operation has not been completed - * 0b1..Recall register load operation has completed - */ -#define FMUTEST_RESET_STATUS_ARY_TRIM_DONE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_ARY_TRIM_DONE_SHIFT)) & FMUTEST_RESET_STATUS_ARY_TRIM_DONE_MASK) - -#define FMUTEST_RESET_STATUS_FMU_PARM_EN_MASK (0x2U) -#define FMUTEST_RESET_STATUS_FMU_PARM_EN_SHIFT (1U) -/*! FMU_PARM_EN - Status of the C0DE_C0DEh check to enable loading of the FMU parameters - * 0b0..C0DE_C0DEh check not attempted - * 0b1..C0DE_C0DEh check completed - */ -#define FMUTEST_RESET_STATUS_FMU_PARM_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_FMU_PARM_EN_SHIFT)) & FMUTEST_RESET_STATUS_FMU_PARM_EN_MASK) - -#define FMUTEST_RESET_STATUS_FMU_PARM_DONE_MASK (0x4U) -#define FMUTEST_RESET_STATUS_FMU_PARM_DONE_SHIFT (2U) -/*! FMU_PARM_DONE - FMU Register Load Complete - * 0b0..FMU registers have not been loaded - * 0b1..FMU registers have been loaded - */ -#define FMUTEST_RESET_STATUS_FMU_PARM_DONE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_FMU_PARM_DONE_SHIFT)) & FMUTEST_RESET_STATUS_FMU_PARM_DONE_MASK) - -#define FMUTEST_RESET_STATUS_SOC_TRIM_EN_MASK (0x8U) -#define FMUTEST_RESET_STATUS_SOC_TRIM_EN_SHIFT (3U) -/*! SOC_TRIM_EN - Status of the C0DE_C0DEh check to enable loading of the SoC trim settings - * 0b0..C0DE_C0DEh check not attempted - * 0b1..C0DE_C0DEh check completed - */ -#define FMUTEST_RESET_STATUS_SOC_TRIM_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_SOC_TRIM_EN_SHIFT)) & FMUTEST_RESET_STATUS_SOC_TRIM_EN_MASK) - -#define FMUTEST_RESET_STATUS_SOC_TRIM_ECC_MASK (0x10U) -#define FMUTEST_RESET_STATUS_SOC_TRIM_ECC_SHIFT (4U) -/*! SOC_TRIM_ECC - Status of the C0DE_C0DEh check for enabling ECC decoder during reads of SoC trim settings - * 0b0..C0DE_C0DEh check failed - * 0b1..C0DE_C0DEh check passed - */ -#define FMUTEST_RESET_STATUS_SOC_TRIM_ECC(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_SOC_TRIM_ECC_SHIFT)) & FMUTEST_RESET_STATUS_SOC_TRIM_ECC_MASK) - -#define FMUTEST_RESET_STATUS_SOC_TRIM_DONE_MASK (0x20U) -#define FMUTEST_RESET_STATUS_SOC_TRIM_DONE_SHIFT (5U) -/*! SOC_TRIM_DONE - SoC Trim Complete - * 0b0..SoC Trim registers have not been updated - * 0b1..All SoC Trim registers have been updated - */ -#define FMUTEST_RESET_STATUS_SOC_TRIM_DONE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_SOC_TRIM_DONE_SHIFT)) & FMUTEST_RESET_STATUS_SOC_TRIM_DONE_MASK) - -#define FMUTEST_RESET_STATUS_RPR_DONE_MASK (0x40U) -#define FMUTEST_RESET_STATUS_RPR_DONE_SHIFT (6U) -/*! RPR_DONE - Array Repair Complete - * 0b0..Repair registers have not been loaded - * 0b1..Repair registers have been loaded - */ -#define FMUTEST_RESET_STATUS_RPR_DONE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_RPR_DONE_SHIFT)) & FMUTEST_RESET_STATUS_RPR_DONE_MASK) - -#define FMUTEST_RESET_STATUS_INIT_DONE_MASK (0x80U) -#define FMUTEST_RESET_STATUS_INIT_DONE_SHIFT (7U) -/*! INIT_DONE - Initialization Done - * 0b0..All initialization steps did not complete - * 0b1..All initialization steps completed - */ -#define FMUTEST_RESET_STATUS_INIT_DONE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_INIT_DONE_SHIFT)) & FMUTEST_RESET_STATUS_INIT_DONE_MASK) - -#define FMUTEST_RESET_STATUS_RST_SF_ERR_MASK (0x100U) -#define FMUTEST_RESET_STATUS_RST_SF_ERR_SHIFT (8U) -/*! RST_SF_ERR - ECC Single Fault during Reset Recovery - * 0b0..No single-bit faults detected during initialization - * 0b1..At least one single ECC fault was detected during initialization - */ -#define FMUTEST_RESET_STATUS_RST_SF_ERR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_RST_SF_ERR_SHIFT)) & FMUTEST_RESET_STATUS_RST_SF_ERR_MASK) - -#define FMUTEST_RESET_STATUS_RST_DF_ERR_MASK (0x200U) -#define FMUTEST_RESET_STATUS_RST_DF_ERR_SHIFT (9U) -/*! RST_DF_ERR - ECC Double Fault during Reset Recovery - * 0b0..No double-bit faults detected during initialization - * 0b1..Double-bit ECC fault was detected during initialization - */ -#define FMUTEST_RESET_STATUS_RST_DF_ERR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_RST_DF_ERR_SHIFT)) & FMUTEST_RESET_STATUS_RST_DF_ERR_MASK) - -#define FMUTEST_RESET_STATUS_SOC_TRIM_DF_ERR_MASK (0x3FC00U) -#define FMUTEST_RESET_STATUS_SOC_TRIM_DF_ERR_SHIFT (10U) -/*! SOC_TRIM_DF_ERR - ECC Double Fault during load of SoC Trim phrases */ -#define FMUTEST_RESET_STATUS_SOC_TRIM_DF_ERR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_SOC_TRIM_DF_ERR_SHIFT)) & FMUTEST_RESET_STATUS_SOC_TRIM_DF_ERR_MASK) - -#define FMUTEST_RESET_STATUS_RST_PATCH_LD_MASK (0x40000U) -#define FMUTEST_RESET_STATUS_RST_PATCH_LD_SHIFT (18U) -/*! RST_PATCH_LD - Reset Patch Required - * 0b0..No patch required to be loaded during reset - * 0b1..Patch loaded during reset - */ -#define FMUTEST_RESET_STATUS_RST_PATCH_LD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_RST_PATCH_LD_SHIFT)) & FMUTEST_RESET_STATUS_RST_PATCH_LD_MASK) - -#define FMUTEST_RESET_STATUS_RECALL_DATA_MISMATCH_MASK (0x80000U) -#define FMUTEST_RESET_STATUS_RECALL_DATA_MISMATCH_SHIFT (19U) -/*! RECALL_DATA_MISMATCH - Recall Data Mismatch - * 0b0..Data read towards end of reset matched data read for Recall - * 0b1..Data read towards end of reset did not match data read for recall - */ -#define FMUTEST_RESET_STATUS_RECALL_DATA_MISMATCH(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_RECALL_DATA_MISMATCH_SHIFT)) & FMUTEST_RESET_STATUS_RECALL_DATA_MISMATCH_MASK) -/*! @} */ - -/*! @name MCTL - FMU Control Register */ -/*! @{ */ - -#define FMUTEST_MCTL_COREHLD_MASK (0x1U) -#define FMUTEST_MCTL_COREHLD_SHIFT (0U) -/*! COREHLD - Core Hold - * 0b0..CPU access is allowed - * 0b1..CPU access must be blocked - */ -#define FMUTEST_MCTL_COREHLD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_COREHLD_SHIFT)) & FMUTEST_MCTL_COREHLD_MASK) - -#define FMUTEST_MCTL_LSACT_EN_MASK (0x4U) -#define FMUTEST_MCTL_LSACT_EN_SHIFT (2U) -/*! LSACT_EN - LSACTIVE Feature Enable - * 0b0..LSACTIVE feature disabled completely: FCTRL[LSACTIVE] is forced low and no longer writable, LVE cannot assert at the TSMC array interface. - * 0b1..LSACTIVE feature fully enabled and controllable by SoC and internal UINT SM. - */ -#define FMUTEST_MCTL_LSACT_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_LSACT_EN_SHIFT)) & FMUTEST_MCTL_LSACT_EN_MASK) - -#define FMUTEST_MCTL_LSACTWREN_MASK (0x8U) -#define FMUTEST_MCTL_LSACTWREN_SHIFT (3U) -/*! LSACTWREN - LSACTIVE Write Enable - * 0b0..Unrestricted write access allowed - * 0b1..Write access while CMP set must match CMDDID and CMDPRT - */ -#define FMUTEST_MCTL_LSACTWREN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_LSACTWREN_SHIFT)) & FMUTEST_MCTL_LSACTWREN_MASK) - -#define FMUTEST_MCTL_MASTER_REPAIR_EN_MASK (0x10U) -#define FMUTEST_MCTL_MASTER_REPAIR_EN_SHIFT (4U) -/*! MASTER_REPAIR_EN - Master Repair Enable - * 0b0..Repair disabled - * 0b1..Repair enable determined by bit 0 of each REPAIR register - */ -#define FMUTEST_MCTL_MASTER_REPAIR_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_MASTER_REPAIR_EN_SHIFT)) & FMUTEST_MCTL_MASTER_REPAIR_EN_MASK) - -#define FMUTEST_MCTL_RFCMDEN_MASK (0x20U) -#define FMUTEST_MCTL_RFCMDEN_SHIFT (5U) -/*! RFCMDEN - RF Active Command Enable Control - * 0b0..Flash commands blocked (CCIF not writable) - * 0b1..Flash commands allowed - */ -#define FMUTEST_MCTL_RFCMDEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_RFCMDEN_SHIFT)) & FMUTEST_MCTL_RFCMDEN_MASK) - -#define FMUTEST_MCTL_CWSABTEN_MASK (0x40U) -#define FMUTEST_MCTL_CWSABTEN_SHIFT (6U) -/*! CWSABTEN - Command Write Sequence Abort Enable - * 0b0..CWS abort feature is disabled - * 0b1..CWS abort feature is enabled - */ -#define FMUTEST_MCTL_CWSABTEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_CWSABTEN_SHIFT)) & FMUTEST_MCTL_CWSABTEN_MASK) - -#define FMUTEST_MCTL_MRGRDDIS_MASK (0x80U) -#define FMUTEST_MCTL_MRGRDDIS_SHIFT (7U) -/*! MRGRDDIS - Margin Read Disable - * 0b0..Margin Read Settings are enabled - * 0b1..Margin Read Settings are disabled - */ -#define FMUTEST_MCTL_MRGRDDIS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_MRGRDDIS_SHIFT)) & FMUTEST_MCTL_MRGRDDIS_MASK) - -#define FMUTEST_MCTL_MRGRD0_MASK (0xF00U) -#define FMUTEST_MCTL_MRGRD0_SHIFT (8U) -/*! MRGRD0 - Margin Read Setting for Program */ -#define FMUTEST_MCTL_MRGRD0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_MRGRD0_SHIFT)) & FMUTEST_MCTL_MRGRD0_MASK) - -#define FMUTEST_MCTL_MRGRD1_MASK (0xF000U) -#define FMUTEST_MCTL_MRGRD1_SHIFT (12U) -/*! MRGRD1 - Margin Read Setting for Erase */ -#define FMUTEST_MCTL_MRGRD1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_MRGRD1_SHIFT)) & FMUTEST_MCTL_MRGRD1_MASK) - -#define FMUTEST_MCTL_ERSAACK_MASK (0x10000U) -#define FMUTEST_MCTL_ERSAACK_SHIFT (16U) -/*! ERSAACK - Mass Erase (Erase All) Acknowledge - * 0b0..Mass Erase operation is not active (operation has completed or has not started) - * 0b1..Mass Erase operation is active (controller acknowledges that the soc_ersall_req input is asserted and will continue with the operation) - */ -#define FMUTEST_MCTL_ERSAACK(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_ERSAACK_SHIFT)) & FMUTEST_MCTL_ERSAACK_MASK) - -#define FMUTEST_MCTL_SCAN_OBS_MASK (0x80000U) -#define FMUTEST_MCTL_SCAN_OBS_SHIFT (19U) -/*! SCAN_OBS - Scan Observability Control - * 0b0..Normal functional behavior - * 0b1..Enables observation of signals that may otherwise be ATPG untestable - */ -#define FMUTEST_MCTL_SCAN_OBS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_SCAN_OBS_SHIFT)) & FMUTEST_MCTL_SCAN_OBS_MASK) - -#define FMUTEST_MCTL_BIST_CTL_MASK (0x100000U) -#define FMUTEST_MCTL_BIST_CTL_SHIFT (20U) -/*! BIST_CTL - BIST IP Control - * 0b0..BIST IP disabled - * 0b1..BIST IP enabled - */ -#define FMUTEST_MCTL_BIST_CTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_BIST_CTL_SHIFT)) & FMUTEST_MCTL_BIST_CTL_MASK) - -#define FMUTEST_MCTL_SMWR_CTL_MASK (0x200000U) -#define FMUTEST_MCTL_SMWR_CTL_SHIFT (21U) -/*! SMWR_CTL - SMWR IP Control - * 0b0..SMWR IP disabled - * 0b1..SMWR IP enabled - */ -#define FMUTEST_MCTL_SMWR_CTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_SMWR_CTL_SHIFT)) & FMUTEST_MCTL_SMWR_CTL_MASK) - -#define FMUTEST_MCTL_SALV_DIS_MASK (0x1000000U) -#define FMUTEST_MCTL_SALV_DIS_SHIFT (24U) -/*! SALV_DIS - Salvage Disable - * 0b0..Salvage enabled (ECC used during erase verify) - * 0b1..Salvage disabled (ECC not used during erase verify) - */ -#define FMUTEST_MCTL_SALV_DIS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_SALV_DIS_SHIFT)) & FMUTEST_MCTL_SALV_DIS_MASK) - -#define FMUTEST_MCTL_SOC_ECC_CTL_MASK (0x2000000U) -#define FMUTEST_MCTL_SOC_ECC_CTL_SHIFT (25U) -/*! SOC_ECC_CTL - SOC ECC Control - * 0b0..ECC is enabled for SOC read access - * 0b1..ECC is disabled for SOC read access - */ -#define FMUTEST_MCTL_SOC_ECC_CTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_SOC_ECC_CTL_SHIFT)) & FMUTEST_MCTL_SOC_ECC_CTL_MASK) - -#define FMUTEST_MCTL_FMU_ECC_CTL_MASK (0x4000000U) -#define FMUTEST_MCTL_FMU_ECC_CTL_SHIFT (26U) -/*! FMU_ECC_CTL - FMU ECC Control - * 0b0..ECC is enabled for FMU program operations - * 0b1..ECC is disabled for FMU program operations - */ -#define FMUTEST_MCTL_FMU_ECC_CTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_FMU_ECC_CTL_SHIFT)) & FMUTEST_MCTL_FMU_ECC_CTL_MASK) - -#define FMUTEST_MCTL_BIST_PWR_DIS_MASK (0x20000000U) -#define FMUTEST_MCTL_BIST_PWR_DIS_SHIFT (29U) -/*! BIST_PWR_DIS - BIST Power Mode Disable - * 0b0..BIST DFT logic has full control of SLM and LVE when BIST is enabled (including during commands) - * 0b1..BIST DFT logic has no control of SLM and LVE; power mode RTL is in complete control of SLM and LVE values - */ -#define FMUTEST_MCTL_BIST_PWR_DIS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_BIST_PWR_DIS_SHIFT)) & FMUTEST_MCTL_BIST_PWR_DIS_MASK) - -#define FMUTEST_MCTL_OSC_H_MASK (0x80000000U) -#define FMUTEST_MCTL_OSC_H_SHIFT (31U) -/*! OSC_H - Oscillator control - * 0b0..Use APB clock - * 0b1..Use a known fixed-frequency clock, e.g. 12 MHz - */ -#define FMUTEST_MCTL_OSC_H(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_OSC_H_SHIFT)) & FMUTEST_MCTL_OSC_H_MASK) -/*! @} */ - -/*! @name BSEL_GEN - FMU Block Select Generation Register */ -/*! @{ */ - -#define FMUTEST_BSEL_GEN_SBSEL_GEN_MASK (0x3U) -#define FMUTEST_BSEL_GEN_SBSEL_GEN_SHIFT (0U) -/*! SBSEL_GEN - Generated SBSEL */ -#define FMUTEST_BSEL_GEN_SBSEL_GEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BSEL_GEN_SBSEL_GEN_SHIFT)) & FMUTEST_BSEL_GEN_SBSEL_GEN_MASK) - -#define FMUTEST_BSEL_GEN_MBSEL_GEN_MASK (0x300U) -#define FMUTEST_BSEL_GEN_MBSEL_GEN_SHIFT (8U) -/*! MBSEL_GEN - Generated MBSEL */ -#define FMUTEST_BSEL_GEN_MBSEL_GEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BSEL_GEN_MBSEL_GEN_SHIFT)) & FMUTEST_BSEL_GEN_MBSEL_GEN_MASK) -/*! @} */ - -/*! @name PWR_OPT - Power Mode Options Register */ -/*! @{ */ - -#define FMUTEST_PWR_OPT_PD_CDIV_MASK (0xFFU) -#define FMUTEST_PWR_OPT_PD_CDIV_SHIFT (0U) -/*! PD_CDIV - Power Down Clock Divider Setting */ -#define FMUTEST_PWR_OPT_PD_CDIV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PWR_OPT_PD_CDIV_SHIFT)) & FMUTEST_PWR_OPT_PD_CDIV_MASK) - -#define FMUTEST_PWR_OPT_SLM_COUNT_MASK (0x3FF0000U) -#define FMUTEST_PWR_OPT_SLM_COUNT_SHIFT (16U) -/*! SLM_COUNT - Sleep Recovery Timer Count */ -#define FMUTEST_PWR_OPT_SLM_COUNT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PWR_OPT_SLM_COUNT_SHIFT)) & FMUTEST_PWR_OPT_SLM_COUNT_MASK) - -#define FMUTEST_PWR_OPT_PD_TIMER_EN_MASK (0x80000000U) -#define FMUTEST_PWR_OPT_PD_TIMER_EN_SHIFT (31U) -/*! PD_TIMER_EN - Power Down BIST Timer Enable - * 0b0..BIST timer is not triggered during Power Down recovery - * 0b1..BIST timer is triggered during Power Down recovery (default behavior) - */ -#define FMUTEST_PWR_OPT_PD_TIMER_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PWR_OPT_PD_TIMER_EN_SHIFT)) & FMUTEST_PWR_OPT_PD_TIMER_EN_MASK) -/*! @} */ - -/*! @name CMD_CHECK - FMU Command Check Register */ -/*! @{ */ - -#define FMUTEST_CMD_CHECK_ALIGNFAIL_PHR_MASK (0x1U) -#define FMUTEST_CMD_CHECK_ALIGNFAIL_PHR_SHIFT (0U) -/*! ALIGNFAIL_PHR - Phrase Alignment Fail - * 0b0..The address is phrase-aligned - * 0b1..The address is not phrase-aligned - */ -#define FMUTEST_CMD_CHECK_ALIGNFAIL_PHR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ALIGNFAIL_PHR_SHIFT)) & FMUTEST_CMD_CHECK_ALIGNFAIL_PHR_MASK) - -#define FMUTEST_CMD_CHECK_ALIGNFAIL_PG_MASK (0x2U) -#define FMUTEST_CMD_CHECK_ALIGNFAIL_PG_SHIFT (1U) -/*! ALIGNFAIL_PG - Page Alignment Fail - * 0b0..The address is page-aligned - * 0b1..The address is not page-aligned - */ -#define FMUTEST_CMD_CHECK_ALIGNFAIL_PG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ALIGNFAIL_PG_SHIFT)) & FMUTEST_CMD_CHECK_ALIGNFAIL_PG_MASK) - -#define FMUTEST_CMD_CHECK_ALIGNFAIL_SCR_MASK (0x4U) -#define FMUTEST_CMD_CHECK_ALIGNFAIL_SCR_SHIFT (2U) -/*! ALIGNFAIL_SCR - Sector Alignment Fail - * 0b0..The address is sector-aligned - * 0b1..The address is not sector-aligned - */ -#define FMUTEST_CMD_CHECK_ALIGNFAIL_SCR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ALIGNFAIL_SCR_SHIFT)) & FMUTEST_CMD_CHECK_ALIGNFAIL_SCR_MASK) - -#define FMUTEST_CMD_CHECK_ALIGNFAIL_BLK_MASK (0x8U) -#define FMUTEST_CMD_CHECK_ALIGNFAIL_BLK_SHIFT (3U) -/*! ALIGNFAIL_BLK - Block Alignment Fail - * 0b0..The address is block-aligned - * 0b1..The address is not block-aligned - */ -#define FMUTEST_CMD_CHECK_ALIGNFAIL_BLK(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ALIGNFAIL_BLK_SHIFT)) & FMUTEST_CMD_CHECK_ALIGNFAIL_BLK_MASK) - -#define FMUTEST_CMD_CHECK_ADDR_FAIL_MASK (0x10U) -#define FMUTEST_CMD_CHECK_ADDR_FAIL_SHIFT (4U) -/*! ADDR_FAIL - Address Fail - * 0b0..The address is within the flash or IFR address space - * 0b1..The address is outside the flash or IFR address space - */ -#define FMUTEST_CMD_CHECK_ADDR_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ADDR_FAIL_SHIFT)) & FMUTEST_CMD_CHECK_ADDR_FAIL_MASK) - -#define FMUTEST_CMD_CHECK_IFR_CMD_MASK (0x20U) -#define FMUTEST_CMD_CHECK_IFR_CMD_SHIFT (5U) -/*! IFR_CMD - IFR Command - * 0b0..The command operates on a main flash address - * 0b1..The command operates on an IFR address - */ -#define FMUTEST_CMD_CHECK_IFR_CMD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_IFR_CMD_SHIFT)) & FMUTEST_CMD_CHECK_IFR_CMD_MASK) - -#define FMUTEST_CMD_CHECK_ALL_CMD_MASK (0x40U) -#define FMUTEST_CMD_CHECK_ALL_CMD_SHIFT (6U) -/*! ALL_CMD - All Blocks Command - * 0b0..The command operates on a single flash block - * 0b1..The command operates on all flash blocks - */ -#define FMUTEST_CMD_CHECK_ALL_CMD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ALL_CMD_SHIFT)) & FMUTEST_CMD_CHECK_ALL_CMD_MASK) - -#define FMUTEST_CMD_CHECK_RANGE_FAIL_MASK (0x80U) -#define FMUTEST_CMD_CHECK_RANGE_FAIL_SHIFT (7U) -/*! RANGE_FAIL - Address Range Fail - * 0b0..The address range is valid - * 0b1..The address range is invalid - */ -#define FMUTEST_CMD_CHECK_RANGE_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_RANGE_FAIL_SHIFT)) & FMUTEST_CMD_CHECK_RANGE_FAIL_MASK) - -#define FMUTEST_CMD_CHECK_SCR_ALIGN_CHK_MASK (0x100U) -#define FMUTEST_CMD_CHECK_SCR_ALIGN_CHK_SHIFT (8U) -/*! SCR_ALIGN_CHK - Sector Alignment Check - * 0b0..No sector alignment check - * 0b1..Sector alignment check - */ -#define FMUTEST_CMD_CHECK_SCR_ALIGN_CHK(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_SCR_ALIGN_CHK_SHIFT)) & FMUTEST_CMD_CHECK_SCR_ALIGN_CHK_MASK) - -#define FMUTEST_CMD_CHECK_OPTION_FAIL_MASK (0x200U) -#define FMUTEST_CMD_CHECK_OPTION_FAIL_SHIFT (9U) -/*! OPTION_FAIL - Option Check Fail - * 0b0..Option check passes for read command or command is not a read command - * 0b1..Option check fails for read command - */ -#define FMUTEST_CMD_CHECK_OPTION_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_OPTION_FAIL_SHIFT)) & FMUTEST_CMD_CHECK_OPTION_FAIL_MASK) - -#define FMUTEST_CMD_CHECK_ILLEGAL_CMD_MASK (0x400U) -#define FMUTEST_CMD_CHECK_ILLEGAL_CMD_SHIFT (10U) -/*! ILLEGAL_CMD - Illegal Command - * 0b0..Command is legal - * 0b1..Command is illegal - */ -#define FMUTEST_CMD_CHECK_ILLEGAL_CMD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ILLEGAL_CMD_SHIFT)) & FMUTEST_CMD_CHECK_ILLEGAL_CMD_MASK) -/*! @} */ - -/*! @name BSEL - FMU Block Select Register */ -/*! @{ */ - -#define FMUTEST_BSEL_SBSEL_MASK (0x3U) -#define FMUTEST_BSEL_SBSEL_SHIFT (0U) -/*! SBSEL - Slave Block Select */ -#define FMUTEST_BSEL_SBSEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BSEL_SBSEL_SHIFT)) & FMUTEST_BSEL_SBSEL_MASK) - -#define FMUTEST_BSEL_MBSEL_MASK (0x300U) -#define FMUTEST_BSEL_MBSEL_SHIFT (8U) -/*! MBSEL - Master Block Select */ -#define FMUTEST_BSEL_MBSEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BSEL_MBSEL_SHIFT)) & FMUTEST_BSEL_MBSEL_MASK) -/*! @} */ - -/*! @name MSIZE - FMU Memory Size Register */ -/*! @{ */ - -#define FMUTEST_MSIZE_MAXADDR0_MASK (0xFFU) -#define FMUTEST_MSIZE_MAXADDR0_SHIFT (0U) -/*! MAXADDR0 - Size of Flash Block 0 */ -#define FMUTEST_MSIZE_MAXADDR0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MSIZE_MAXADDR0_SHIFT)) & FMUTEST_MSIZE_MAXADDR0_MASK) -/*! @} */ - -/*! @name FLASH_RD_ADD - Flash Read Address Register */ -/*! @{ */ - -#define FMUTEST_FLASH_RD_ADD_FLASH_RD_ADD_MASK (0xFFFFFFFFU) -#define FMUTEST_FLASH_RD_ADD_FLASH_RD_ADD_SHIFT (0U) -/*! FLASH_RD_ADD - Flash Read Address */ -#define FMUTEST_FLASH_RD_ADD_FLASH_RD_ADD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FLASH_RD_ADD_FLASH_RD_ADD_SHIFT)) & FMUTEST_FLASH_RD_ADD_FLASH_RD_ADD_MASK) -/*! @} */ - -/*! @name FLASH_STOP_ADD - Flash Stop Address Register */ -/*! @{ */ - -#define FMUTEST_FLASH_STOP_ADD_FLASH_STOP_ADD_MASK (0xFFFFFFFFU) -#define FMUTEST_FLASH_STOP_ADD_FLASH_STOP_ADD_SHIFT (0U) -/*! FLASH_STOP_ADD - Flash Stop Address */ -#define FMUTEST_FLASH_STOP_ADD_FLASH_STOP_ADD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FLASH_STOP_ADD_FLASH_STOP_ADD_SHIFT)) & FMUTEST_FLASH_STOP_ADD_FLASH_STOP_ADD_MASK) -/*! @} */ - -/*! @name FLASH_RD_CTRL - Flash Read Control Register */ -/*! @{ */ - -#define FMUTEST_FLASH_RD_CTRL_FLASH_RD_MASK (0x1U) -#define FMUTEST_FLASH_RD_CTRL_FLASH_RD_SHIFT (0U) -/*! FLASH_RD - Flash Read Enable - * 0b0..Manual flash read not enabled.(default) - * 0b1..Manual flash read enabled - */ -#define FMUTEST_FLASH_RD_CTRL_FLASH_RD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FLASH_RD_CTRL_FLASH_RD_SHIFT)) & FMUTEST_FLASH_RD_CTRL_FLASH_RD_MASK) - -#define FMUTEST_FLASH_RD_CTRL_WIDE_LOAD_MASK (0x2U) -#define FMUTEST_FLASH_RD_CTRL_WIDE_LOAD_SHIFT (1U) -/*! WIDE_LOAD - Wide Load Enable - * 0b0..Wide load mode disabled (default) - * 0b1..Wide load mode enabled - */ -#define FMUTEST_FLASH_RD_CTRL_WIDE_LOAD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FLASH_RD_CTRL_WIDE_LOAD_SHIFT)) & FMUTEST_FLASH_RD_CTRL_WIDE_LOAD_MASK) - -#define FMUTEST_FLASH_RD_CTRL_SINGLE_RD_MASK (0x4U) -#define FMUTEST_FLASH_RD_CTRL_SINGLE_RD_SHIFT (2U) -/*! SINGLE_RD - Single Flash Read - * 0b0..Normal UINT operation - * 0b1..UINT configured for single cycle reads - */ -#define FMUTEST_FLASH_RD_CTRL_SINGLE_RD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FLASH_RD_CTRL_SINGLE_RD_SHIFT)) & FMUTEST_FLASH_RD_CTRL_SINGLE_RD_MASK) -/*! @} */ - -/*! @name MM_ADDR - Memory Map Address Register */ -/*! @{ */ - -#define FMUTEST_MM_ADDR_MM_ADDR_MASK (0xFFFFFFFFU) -#define FMUTEST_MM_ADDR_MM_ADDR_SHIFT (0U) -/*! MM_ADDR - Memory Map Address */ -#define FMUTEST_MM_ADDR_MM_ADDR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MM_ADDR_MM_ADDR_SHIFT)) & FMUTEST_MM_ADDR_MM_ADDR_MASK) -/*! @} */ - -/*! @name MM_WDATA - Memory Map Write Data Register */ -/*! @{ */ - -#define FMUTEST_MM_WDATA_MM_WDATA_MASK (0xFFFFFFFFU) -#define FMUTEST_MM_WDATA_MM_WDATA_SHIFT (0U) -/*! MM_WDATA - Memory Map Write Data */ -#define FMUTEST_MM_WDATA_MM_WDATA(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MM_WDATA_MM_WDATA_SHIFT)) & FMUTEST_MM_WDATA_MM_WDATA_MASK) -/*! @} */ - -/*! @name MM_CTL - Memory Map Control Register */ -/*! @{ */ - -#define FMUTEST_MM_CTL_MM_SEL_MASK (0x1U) -#define FMUTEST_MM_CTL_MM_SEL_SHIFT (0U) -/*! MM_SEL - Register Access Enable */ -#define FMUTEST_MM_CTL_MM_SEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MM_CTL_MM_SEL_SHIFT)) & FMUTEST_MM_CTL_MM_SEL_MASK) - -#define FMUTEST_MM_CTL_MM_RD_MASK (0x2U) -#define FMUTEST_MM_CTL_MM_RD_SHIFT (1U) -/*! MM_RD - Register R/W Control - * 0b0..Write to register - * 0b1..Read register - */ -#define FMUTEST_MM_CTL_MM_RD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MM_CTL_MM_RD_SHIFT)) & FMUTEST_MM_CTL_MM_RD_MASK) - -#define FMUTEST_MM_CTL_BIST_ON_MASK (0x4U) -#define FMUTEST_MM_CTL_BIST_ON_SHIFT (2U) -/*! BIST_ON - BIST on - * 0b0..BIST enable not forced by user interface - * 0b1..BIST enable control by user interface - */ -#define FMUTEST_MM_CTL_BIST_ON(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MM_CTL_BIST_ON_SHIFT)) & FMUTEST_MM_CTL_BIST_ON_MASK) - -#define FMUTEST_MM_CTL_FORCE_SW_CLK_MASK (0x8U) -#define FMUTEST_MM_CTL_FORCE_SW_CLK_SHIFT (3U) -/*! FORCE_SW_CLK - Force Switch Clock - * 0b0..Switch clock not forced on (gated normally) - * 0b1..Switch clock forced on - */ -#define FMUTEST_MM_CTL_FORCE_SW_CLK(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MM_CTL_FORCE_SW_CLK_SHIFT)) & FMUTEST_MM_CTL_FORCE_SW_CLK_MASK) -/*! @} */ - -/*! @name UINT_CTL - User Interface Control Register */ -/*! @{ */ - -#define FMUTEST_UINT_CTL_SET_FAIL_MASK (0x1U) -#define FMUTEST_UINT_CTL_SET_FAIL_SHIFT (0U) -/*! SET_FAIL - Set Fail On Exit - * 0b0..FAIL flag should not be set on command exit (no failure detected) - * 0b1..FAIL flag should be set on command exit - */ -#define FMUTEST_UINT_CTL_SET_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_UINT_CTL_SET_FAIL_SHIFT)) & FMUTEST_UINT_CTL_SET_FAIL_MASK) - -#define FMUTEST_UINT_CTL_DBERR_MASK (0x2U) -#define FMUTEST_UINT_CTL_DBERR_SHIFT (1U) -/*! DBERR - Double-Bit ECC Fault Detect - * 0b0..No double-bit fault detected during UINT-driven read sequence - * 0b1..Double-bit fault detected during UINT-driven read sequence - */ -#define FMUTEST_UINT_CTL_DBERR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_UINT_CTL_DBERR_SHIFT)) & FMUTEST_UINT_CTL_DBERR_MASK) -/*! @} */ - -/*! @name RD_DATA0 - Read Data 0 Register */ -/*! @{ */ - -#define FMUTEST_RD_DATA0_RD_DATA0_MASK (0xFFFFFFFFU) -#define FMUTEST_RD_DATA0_RD_DATA0_SHIFT (0U) -/*! RD_DATA0 - Read Data 0 */ -#define FMUTEST_RD_DATA0_RD_DATA0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_DATA0_RD_DATA0_SHIFT)) & FMUTEST_RD_DATA0_RD_DATA0_MASK) -/*! @} */ - -/*! @name RD_DATA1 - Read Data 1 Register */ -/*! @{ */ - -#define FMUTEST_RD_DATA1_RD_DATA1_MASK (0xFFFFFFFFU) -#define FMUTEST_RD_DATA1_RD_DATA1_SHIFT (0U) -/*! RD_DATA1 - Read Data 1 */ -#define FMUTEST_RD_DATA1_RD_DATA1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_DATA1_RD_DATA1_SHIFT)) & FMUTEST_RD_DATA1_RD_DATA1_MASK) -/*! @} */ - -/*! @name RD_DATA2 - Read Data 2 Register */ -/*! @{ */ - -#define FMUTEST_RD_DATA2_RD_DATA2_MASK (0xFFFFFFFFU) -#define FMUTEST_RD_DATA2_RD_DATA2_SHIFT (0U) -/*! RD_DATA2 - Read Data 2 */ -#define FMUTEST_RD_DATA2_RD_DATA2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_DATA2_RD_DATA2_SHIFT)) & FMUTEST_RD_DATA2_RD_DATA2_MASK) -/*! @} */ - -/*! @name RD_DATA3 - Read Data 3 Register */ -/*! @{ */ - -#define FMUTEST_RD_DATA3_RD_DATA3_MASK (0xFFFFFFFFU) -#define FMUTEST_RD_DATA3_RD_DATA3_SHIFT (0U) -/*! RD_DATA3 - Read Data 3 */ -#define FMUTEST_RD_DATA3_RD_DATA3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_DATA3_RD_DATA3_SHIFT)) & FMUTEST_RD_DATA3_RD_DATA3_MASK) -/*! @} */ - -/*! @name PARITY - Parity Register */ -/*! @{ */ - -#define FMUTEST_PARITY_PARITY_MASK (0x1FFU) -#define FMUTEST_PARITY_PARITY_SHIFT (0U) -/*! PARITY - Read data [136:128] */ -#define FMUTEST_PARITY_PARITY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PARITY_PARITY_SHIFT)) & FMUTEST_PARITY_PARITY_MASK) -/*! @} */ - -/*! @name RD_PATH_CTRL_STATUS - Read Path Control and Status Register */ -/*! @{ */ - -#define FMUTEST_RD_PATH_CTRL_STATUS_RD_CAPT_MASK (0xFFU) -#define FMUTEST_RD_PATH_CTRL_STATUS_RD_CAPT_SHIFT (0U) -/*! RD_CAPT - Read Capture Clock Periods */ -#define FMUTEST_RD_PATH_CTRL_STATUS_RD_CAPT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_RD_CAPT_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_RD_CAPT_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_SE_SIZE_MASK (0xFF00U) -#define FMUTEST_RD_PATH_CTRL_STATUS_SE_SIZE_SHIFT (8U) -/*! SE_SIZE - SE Clock Periods */ -#define FMUTEST_RD_PATH_CTRL_STATUS_SE_SIZE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_SE_SIZE_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_SE_SIZE_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_ECC_ENABLEB_MASK (0x10000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_ECC_ENABLEB_SHIFT (16U) -/*! ECC_ENABLEB - ECC Decoder Control - * 0b0..ECC decoder enabled (default) - * 0b1..ECC decoder disabled - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_ECC_ENABLEB(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_ECC_ENABLEB_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_ECC_ENABLEB_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_MISR_EN_MASK (0x20000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_MISR_EN_SHIFT (17U) -/*! MISR_EN - MISR Enable - * 0b0..MISR option disabled (default) - * 0b1..MISR option enabled - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_MISR_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_MISR_EN_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_MISR_EN_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_CPY_PAR_EN_MASK (0x40000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_CPY_PAR_EN_SHIFT (18U) -/*! CPY_PAR_EN - Copy Parity Enable - * 0b0..Copy parity disabled - * 0b1..Copy parity enabled - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_CPY_PAR_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_CPY_PAR_EN_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_CPY_PAR_EN_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_BIST_MUX_TO_SMW_MASK (0x80000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_BIST_MUX_TO_SMW_SHIFT (19U) -/*! BIST_MUX_TO_SMW - BIST Mux to SMW - * 0b0..BIST drives fields - * 0b1..SMW registers drive fields - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_BIST_MUX_TO_SMW(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_BIST_MUX_TO_SMW_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_BIST_MUX_TO_SMW_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_AD_SET_MASK (0xF00000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_AD_SET_SHIFT (20U) -/*! AD_SET - Multi-Cycle Address Setup Time */ -#define FMUTEST_RD_PATH_CTRL_STATUS_AD_SET(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_AD_SET_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_AD_SET_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_EN_MASK (0x1000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_EN_SHIFT (24U) -/*! WR_PATH_EN - Write Path Enable - * 0b0..Writes to BIST setting registers driven by MM_WDATA - * 0b1..Writes to BIST setting registers driven by SMW_DIN - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_EN_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_EN_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_ECC_EN_MASK (0x2000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_ECC_EN_SHIFT (25U) -/*! WR_PATH_ECC_EN - Write Path ECC Enable - * 0b0..ECC encoding disabled - * 0b1..ECC encoding enabled - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_ECC_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_ECC_EN_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_ECC_EN_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_DBERR_REG_MASK (0x4000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_DBERR_REG_SHIFT (26U) -/*! DBERR_REG - Double-Bit Error - * 0b0..Double-bit fault not detected - * 0b1..Double-bit fault detected on previous UINT flash read - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_DBERR_REG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_DBERR_REG_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_DBERR_REG_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_SBERR_REG_MASK (0x8000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_SBERR_REG_SHIFT (27U) -/*! SBERR_REG - Single-Bit Error - * 0b0..Single-bit fault not detected - * 0b1..Single-bit fault detected on previous UINT flash read - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_SBERR_REG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_SBERR_REG_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_SBERR_REG_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_CPY_PHRASE_EN_MASK (0x10000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_CPY_PHRASE_EN_SHIFT (28U) -/*! CPY_PHRASE_EN - Copy Phrase Enable - * 0b0..Copy Flash read data disabled - * 0b1..Copy Flash read data enabled - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_CPY_PHRASE_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_CPY_PHRASE_EN_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_CPY_PHRASE_EN_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_SMW_ARRAY1_SMW0_SEL_MASK (0x20000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_SMW_ARRAY1_SMW0_SEL_SHIFT (29U) -/*! SMW_ARRAY1_SMW0_SEL - SMW_ARRAY1_SMW0_SEL - * 0b0..Select block 0 - * 0b1..Select block 1 - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_SMW_ARRAY1_SMW0_SEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_SMW_ARRAY1_SMW0_SEL_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_SMW_ARRAY1_SMW0_SEL_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_BIST_ECC_EN_MASK (0x40000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_BIST_ECC_EN_SHIFT (30U) -/*! BIST_ECC_EN - BIST ECC Enable - * 0b0..ECC correction disabled - * 0b1..ECC correction enabled - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_BIST_ECC_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_BIST_ECC_EN_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_BIST_ECC_EN_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_LAST_READ_MASK (0x80000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_LAST_READ_SHIFT (31U) -/*! LAST_READ - Last Read - * 0b0..Latest read not last in multi-address operation - * 0b1..Latest read last in multi-address operation - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_LAST_READ(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_LAST_READ_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_LAST_READ_MASK) -/*! @} */ - -/*! @name SMW_DIN0 - SMW DIN 0 Register */ -/*! @{ */ - -#define FMUTEST_SMW_DIN0_SMW_DIN0_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_DIN0_SMW_DIN0_SHIFT (0U) -/*! SMW_DIN0 - SMW DIN 0 */ -#define FMUTEST_SMW_DIN0_SMW_DIN0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_DIN0_SMW_DIN0_SHIFT)) & FMUTEST_SMW_DIN0_SMW_DIN0_MASK) -/*! @} */ - -/*! @name SMW_DIN1 - SMW DIN 1 Register */ -/*! @{ */ - -#define FMUTEST_SMW_DIN1_SMW_DIN1_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_DIN1_SMW_DIN1_SHIFT (0U) -/*! SMW_DIN1 - SMW DIN 1 */ -#define FMUTEST_SMW_DIN1_SMW_DIN1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_DIN1_SMW_DIN1_SHIFT)) & FMUTEST_SMW_DIN1_SMW_DIN1_MASK) -/*! @} */ - -/*! @name SMW_DIN2 - SMW DIN 2 Register */ -/*! @{ */ - -#define FMUTEST_SMW_DIN2_SMW_DIN2_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_DIN2_SMW_DIN2_SHIFT (0U) -/*! SMW_DIN2 - SMW DIN 2 */ -#define FMUTEST_SMW_DIN2_SMW_DIN2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_DIN2_SMW_DIN2_SHIFT)) & FMUTEST_SMW_DIN2_SMW_DIN2_MASK) -/*! @} */ - -/*! @name SMW_DIN3 - SMW DIN 3 Register */ -/*! @{ */ - -#define FMUTEST_SMW_DIN3_SMW_DIN3_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_DIN3_SMW_DIN3_SHIFT (0U) -/*! SMW_DIN3 - SMW DIN 3 */ -#define FMUTEST_SMW_DIN3_SMW_DIN3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_DIN3_SMW_DIN3_SHIFT)) & FMUTEST_SMW_DIN3_SMW_DIN3_MASK) -/*! @} */ - -/*! @name SMW_ADDR - SMW Address Register */ -/*! @{ */ - -#define FMUTEST_SMW_ADDR_SMW_ADDR_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_ADDR_SMW_ADDR_SHIFT (0U) -/*! SMW_ADDR - SMW Address */ -#define FMUTEST_SMW_ADDR_SMW_ADDR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_ADDR_SMW_ADDR_SHIFT)) & FMUTEST_SMW_ADDR_SMW_ADDR_MASK) -/*! @} */ - -/*! @name SMW_CMD_WAIT - SMW Command and Wait Register */ -/*! @{ */ - -#define FMUTEST_SMW_CMD_WAIT_CMD_MASK (0x7U) -#define FMUTEST_SMW_CMD_WAIT_CMD_SHIFT (0U) -/*! CMD - SMW Command - * 0b000..IDLE - * 0b001..ABORT - * 0b010..SME2 to one-shot mass erase - * 0b011..SME3 to sector erase on selected array - * 0b100..SMP1 to program phrase or page on selected array with shot disabled on previously programmed bit - * 0b101..Reserved for SME4 (multi-sector erase) - * 0b110..SMP2 to program phrase or page on selected array to repair cells of weak program after power loss - * 0b111..Reserved - */ -#define FMUTEST_SMW_CMD_WAIT_CMD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_CMD_WAIT_CMD_SHIFT)) & FMUTEST_SMW_CMD_WAIT_CMD_MASK) - -#define FMUTEST_SMW_CMD_WAIT_WAIT_EN_MASK (0x8U) -#define FMUTEST_SMW_CMD_WAIT_WAIT_EN_SHIFT (3U) -/*! WAIT_EN - SMW Wait Enable - * 0b0..Wait feature disabled - * 0b1..Wait feature enabled - */ -#define FMUTEST_SMW_CMD_WAIT_WAIT_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_CMD_WAIT_WAIT_EN_SHIFT)) & FMUTEST_SMW_CMD_WAIT_WAIT_EN_MASK) - -#define FMUTEST_SMW_CMD_WAIT_WAIT_AUTO_SET_MASK (0x10U) -#define FMUTEST_SMW_CMD_WAIT_WAIT_AUTO_SET_SHIFT (4U) -/*! WAIT_AUTO_SET - SMW Wait Auto Set */ -#define FMUTEST_SMW_CMD_WAIT_WAIT_AUTO_SET(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_CMD_WAIT_WAIT_AUTO_SET_SHIFT)) & FMUTEST_SMW_CMD_WAIT_WAIT_AUTO_SET_MASK) -/*! @} */ - -/*! @name SMW_STATUS - SMW Status Register */ -/*! @{ */ - -#define FMUTEST_SMW_STATUS_SMW_ERR_MASK (0x1U) -#define FMUTEST_SMW_STATUS_SMW_ERR_SHIFT (0U) -/*! SMW_ERR - SMW Error - * 0b0..Error not detected - * 0b1..Error detected - */ -#define FMUTEST_SMW_STATUS_SMW_ERR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_STATUS_SMW_ERR_SHIFT)) & FMUTEST_SMW_STATUS_SMW_ERR_MASK) - -#define FMUTEST_SMW_STATUS_SMW_BUSY_MASK (0x2U) -#define FMUTEST_SMW_STATUS_SMW_BUSY_SHIFT (1U) -/*! SMW_BUSY - SMW Busy - * 0b0..SMW command not active - * 0b1..SMW command is active - */ -#define FMUTEST_SMW_STATUS_SMW_BUSY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_STATUS_SMW_BUSY_SHIFT)) & FMUTEST_SMW_STATUS_SMW_BUSY_MASK) - -#define FMUTEST_SMW_STATUS_BIST_BUSY_MASK (0x4U) -#define FMUTEST_SMW_STATUS_BIST_BUSY_SHIFT (2U) -/*! BIST_BUSY - BIST Busy - * 0b0..BIST Command not active - * 0b1..BIST Command is active - */ -#define FMUTEST_SMW_STATUS_BIST_BUSY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_STATUS_BIST_BUSY_SHIFT)) & FMUTEST_SMW_STATUS_BIST_BUSY_MASK) -/*! @} */ - -/*! @name SOCTRIM0_0 - SoC Trim Phrase 0 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM0_0_TRIM0_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM0_0_TRIM0_0_SHIFT (0U) -/*! TRIM0_0 - TRIM0_0 */ -#define FMUTEST_SOCTRIM0_0_TRIM0_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM0_0_TRIM0_0_SHIFT)) & FMUTEST_SOCTRIM0_0_TRIM0_0_MASK) -/*! @} */ - -/*! @name SOCTRIM0_1 - SoC Trim Phrase 0 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM0_1_TRIM0_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM0_1_TRIM0_1_SHIFT (0U) -/*! TRIM0_1 - TRIM0_1 */ -#define FMUTEST_SOCTRIM0_1_TRIM0_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM0_1_TRIM0_1_SHIFT)) & FMUTEST_SOCTRIM0_1_TRIM0_1_MASK) -/*! @} */ - -/*! @name SOCTRIM0_2 - SoC Trim Phrase 0 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM0_2_TRIM0_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM0_2_TRIM0_2_SHIFT (0U) -/*! TRIM0_2 - TRIM0_2 */ -#define FMUTEST_SOCTRIM0_2_TRIM0_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM0_2_TRIM0_2_SHIFT)) & FMUTEST_SOCTRIM0_2_TRIM0_2_MASK) -/*! @} */ - -/*! @name SOCTRIM0_3 - SoC Trim Phrase 0 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM0_3_TRIM0_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM0_3_TRIM0_3_SHIFT (0U) -/*! TRIM0_3 - TRIM0_3 */ -#define FMUTEST_SOCTRIM0_3_TRIM0_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM0_3_TRIM0_3_SHIFT)) & FMUTEST_SOCTRIM0_3_TRIM0_3_MASK) -/*! @} */ - -/*! @name SOCTRIM1_0 - SoC Trim Phrase 1 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM1_0_TRIM1_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM1_0_TRIM1_0_SHIFT (0U) -/*! TRIM1_0 - TRIM1_0 */ -#define FMUTEST_SOCTRIM1_0_TRIM1_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM1_0_TRIM1_0_SHIFT)) & FMUTEST_SOCTRIM1_0_TRIM1_0_MASK) -/*! @} */ - -/*! @name SOCTRIM1_1 - SoC Trim Phrase 1 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM1_1_TRIM1_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM1_1_TRIM1_1_SHIFT (0U) -/*! TRIM1_1 - TRIM1_1 */ -#define FMUTEST_SOCTRIM1_1_TRIM1_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM1_1_TRIM1_1_SHIFT)) & FMUTEST_SOCTRIM1_1_TRIM1_1_MASK) -/*! @} */ - -/*! @name SOCTRIM1_2 - SoC Trim Phrase 1 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM1_2_TRIM1_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM1_2_TRIM1_2_SHIFT (0U) -/*! TRIM1_2 - TRIM1_2 */ -#define FMUTEST_SOCTRIM1_2_TRIM1_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM1_2_TRIM1_2_SHIFT)) & FMUTEST_SOCTRIM1_2_TRIM1_2_MASK) -/*! @} */ - -/*! @name SOCTRIM1_3 - SoC Trim Phrase 1 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM1_3_TRIM1_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM1_3_TRIM1_3_SHIFT (0U) -/*! TRIM1_3 - TRIM1_3 */ -#define FMUTEST_SOCTRIM1_3_TRIM1_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM1_3_TRIM1_3_SHIFT)) & FMUTEST_SOCTRIM1_3_TRIM1_3_MASK) -/*! @} */ - -/*! @name SOCTRIM2_0 - SoC Trim Phrase 2 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM2_0_TRIM2_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM2_0_TRIM2_0_SHIFT (0U) -/*! TRIM2_0 - TRIM2_0 */ -#define FMUTEST_SOCTRIM2_0_TRIM2_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM2_0_TRIM2_0_SHIFT)) & FMUTEST_SOCTRIM2_0_TRIM2_0_MASK) -/*! @} */ - -/*! @name SOCTRIM2_1 - SoC Trim Phrase 2 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM2_1_TRIM2_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM2_1_TRIM2_1_SHIFT (0U) -/*! TRIM2_1 - TRIM2_1 */ -#define FMUTEST_SOCTRIM2_1_TRIM2_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM2_1_TRIM2_1_SHIFT)) & FMUTEST_SOCTRIM2_1_TRIM2_1_MASK) -/*! @} */ - -/*! @name SOCTRIM2_2 - SoC Trim Phrase 2 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM2_2_TRIM2_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM2_2_TRIM2_2_SHIFT (0U) -/*! TRIM2_2 - TRIM2_2 */ -#define FMUTEST_SOCTRIM2_2_TRIM2_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM2_2_TRIM2_2_SHIFT)) & FMUTEST_SOCTRIM2_2_TRIM2_2_MASK) -/*! @} */ - -/*! @name SOCTRIM2_3 - SoC Trim Phrase 2 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM2_3_TRIM2_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM2_3_TRIM2_3_SHIFT (0U) -/*! TRIM2_3 - TRIM2_3 */ -#define FMUTEST_SOCTRIM2_3_TRIM2_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM2_3_TRIM2_3_SHIFT)) & FMUTEST_SOCTRIM2_3_TRIM2_3_MASK) -/*! @} */ - -/*! @name SOCTRIM3_0 - SoC Trim Phrase 3 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM3_0_TRIM3_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM3_0_TRIM3_0_SHIFT (0U) -/*! TRIM3_0 - TRIM3_0 */ -#define FMUTEST_SOCTRIM3_0_TRIM3_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM3_0_TRIM3_0_SHIFT)) & FMUTEST_SOCTRIM3_0_TRIM3_0_MASK) -/*! @} */ - -/*! @name SOCTRIM3_1 - SoC Trim Phrase 3 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM3_1_TRIM3_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM3_1_TRIM3_1_SHIFT (0U) -/*! TRIM3_1 - TRIM3_1 */ -#define FMUTEST_SOCTRIM3_1_TRIM3_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM3_1_TRIM3_1_SHIFT)) & FMUTEST_SOCTRIM3_1_TRIM3_1_MASK) -/*! @} */ - -/*! @name SOCTRIM3_2 - SoC Trim Phrase 3 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM3_2_TRIM3_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM3_2_TRIM3_2_SHIFT (0U) -/*! TRIM3_2 - TRIM3_2 */ -#define FMUTEST_SOCTRIM3_2_TRIM3_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM3_2_TRIM3_2_SHIFT)) & FMUTEST_SOCTRIM3_2_TRIM3_2_MASK) -/*! @} */ - -/*! @name SOCTRIM3_3 - SoC Trim Phrase 3 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM3_3_TRIM3_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM3_3_TRIM3_3_SHIFT (0U) -/*! TRIM3_3 - TRIM3_3 */ -#define FMUTEST_SOCTRIM3_3_TRIM3_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM3_3_TRIM3_3_SHIFT)) & FMUTEST_SOCTRIM3_3_TRIM3_3_MASK) -/*! @} */ - -/*! @name SOCTRIM4_0 - SoC Trim Phrase 4 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM4_0_TRIM4_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM4_0_TRIM4_0_SHIFT (0U) -/*! TRIM4_0 - TRIM4_0 */ -#define FMUTEST_SOCTRIM4_0_TRIM4_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM4_0_TRIM4_0_SHIFT)) & FMUTEST_SOCTRIM4_0_TRIM4_0_MASK) -/*! @} */ - -/*! @name SOCTRIM4_1 - SoC Trim Phrase 4 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM4_1_TRIM4_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM4_1_TRIM4_1_SHIFT (0U) -/*! TRIM4_1 - TRIM4_1 */ -#define FMUTEST_SOCTRIM4_1_TRIM4_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM4_1_TRIM4_1_SHIFT)) & FMUTEST_SOCTRIM4_1_TRIM4_1_MASK) -/*! @} */ - -/*! @name SOCTRIM4_2 - SoC Trim Phrase 4 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM4_2_TRIM4_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM4_2_TRIM4_2_SHIFT (0U) -/*! TRIM4_2 - TRIM4_2 */ -#define FMUTEST_SOCTRIM4_2_TRIM4_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM4_2_TRIM4_2_SHIFT)) & FMUTEST_SOCTRIM4_2_TRIM4_2_MASK) -/*! @} */ - -/*! @name SOCTRIM4_3 - SoC Trim Phrase 4 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM4_3_TRIM4_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM4_3_TRIM4_3_SHIFT (0U) -/*! TRIM4_3 - TRIM4_3 */ -#define FMUTEST_SOCTRIM4_3_TRIM4_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM4_3_TRIM4_3_SHIFT)) & FMUTEST_SOCTRIM4_3_TRIM4_3_MASK) -/*! @} */ - -/*! @name SOCTRIM5_0 - SoC Trim Phrase 5 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM5_0_TRIM5_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM5_0_TRIM5_0_SHIFT (0U) -/*! TRIM5_0 - TRIM5_0 */ -#define FMUTEST_SOCTRIM5_0_TRIM5_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM5_0_TRIM5_0_SHIFT)) & FMUTEST_SOCTRIM5_0_TRIM5_0_MASK) -/*! @} */ - -/*! @name SOCTRIM5_1 - SoC Trim Phrase 5 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM5_1_TRIM5_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM5_1_TRIM5_1_SHIFT (0U) -/*! TRIM5_1 - TRIM5_1 */ -#define FMUTEST_SOCTRIM5_1_TRIM5_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM5_1_TRIM5_1_SHIFT)) & FMUTEST_SOCTRIM5_1_TRIM5_1_MASK) -/*! @} */ - -/*! @name SOCTRIM5_2 - SoC Trim Phrase 5 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM5_2_TRIM5_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM5_2_TRIM5_2_SHIFT (0U) -/*! TRIM5_2 - TRIM5_2 */ -#define FMUTEST_SOCTRIM5_2_TRIM5_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM5_2_TRIM5_2_SHIFT)) & FMUTEST_SOCTRIM5_2_TRIM5_2_MASK) -/*! @} */ - -/*! @name SOCTRIM5_3 - SoC Trim Phrase 5 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM5_3_TRIM5_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM5_3_TRIM5_3_SHIFT (0U) -/*! TRIM5_3 - TRIM5_3 */ -#define FMUTEST_SOCTRIM5_3_TRIM5_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM5_3_TRIM5_3_SHIFT)) & FMUTEST_SOCTRIM5_3_TRIM5_3_MASK) -/*! @} */ - -/*! @name SOCTRIM6_0 - SoC Trim Phrase 6 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM6_0_TRIM6_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM6_0_TRIM6_0_SHIFT (0U) -/*! TRIM6_0 - TRIM6_0 */ -#define FMUTEST_SOCTRIM6_0_TRIM6_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM6_0_TRIM6_0_SHIFT)) & FMUTEST_SOCTRIM6_0_TRIM6_0_MASK) -/*! @} */ - -/*! @name SOCTRIM6_1 - SoC Trim Phrase 6 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM6_1_TRIM6_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM6_1_TRIM6_1_SHIFT (0U) -/*! TRIM6_1 - TRIM6_1 */ -#define FMUTEST_SOCTRIM6_1_TRIM6_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM6_1_TRIM6_1_SHIFT)) & FMUTEST_SOCTRIM6_1_TRIM6_1_MASK) -/*! @} */ - -/*! @name SOCTRIM6_2 - SoC Trim Phrase 6 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM6_2_TRIM6_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM6_2_TRIM6_2_SHIFT (0U) -/*! TRIM6_2 - TRIM6_2 */ -#define FMUTEST_SOCTRIM6_2_TRIM6_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM6_2_TRIM6_2_SHIFT)) & FMUTEST_SOCTRIM6_2_TRIM6_2_MASK) -/*! @} */ - -/*! @name SOCTRIM6_3 - SoC Trim Phrase 6 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM6_3_TRIM6_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM6_3_TRIM6_3_SHIFT (0U) -/*! TRIM6_3 - TRIM6_3 */ -#define FMUTEST_SOCTRIM6_3_TRIM6_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM6_3_TRIM6_3_SHIFT)) & FMUTEST_SOCTRIM6_3_TRIM6_3_MASK) -/*! @} */ - -/*! @name SOCTRIM7_0 - SoC Trim Phrase 7 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM7_0_TRIM7_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM7_0_TRIM7_0_SHIFT (0U) -/*! TRIM7_0 - TRIM7_0 */ -#define FMUTEST_SOCTRIM7_0_TRIM7_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM7_0_TRIM7_0_SHIFT)) & FMUTEST_SOCTRIM7_0_TRIM7_0_MASK) -/*! @} */ - -/*! @name SOCTRIM7_1 - SoC Trim Phrase 7 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM7_1_TRIM7_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM7_1_TRIM7_1_SHIFT (0U) -/*! TRIM7_1 - TRIM7_1 */ -#define FMUTEST_SOCTRIM7_1_TRIM7_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM7_1_TRIM7_1_SHIFT)) & FMUTEST_SOCTRIM7_1_TRIM7_1_MASK) -/*! @} */ - -/*! @name SOCTRIM7_2 - SoC Trim Phrase 7 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM7_2_TRIM7_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM7_2_TRIM7_2_SHIFT (0U) -/*! TRIM7_2 - TRIM7_2 */ -#define FMUTEST_SOCTRIM7_2_TRIM7_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM7_2_TRIM7_2_SHIFT)) & FMUTEST_SOCTRIM7_2_TRIM7_2_MASK) -/*! @} */ - -/*! @name SOCTRIM7_3 - SoC Trim Phrase 7 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM7_3_TRIM7_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM7_3_TRIM7_3_SHIFT (0U) -/*! TRIM7_3 - TRIM7_3 */ -#define FMUTEST_SOCTRIM7_3_TRIM7_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM7_3_TRIM7_3_SHIFT)) & FMUTEST_SOCTRIM7_3_TRIM7_3_MASK) -/*! @} */ - -/*! @name R_IP_CONFIG - BIST Configuration Register */ -/*! @{ */ - -#define FMUTEST_R_IP_CONFIG_IPSEL0_MASK (0x3U) -#define FMUTEST_R_IP_CONFIG_IPSEL0_SHIFT (0U) -/*! IPSEL0 - Block 0 Select Control - * 0b00..Unselect block 0 - * 0b01..not used, reserved - * 0b10..Enable block 0 test, repair off (default) - * 0b11..Enable block 0 test, repair on - */ -#define FMUTEST_R_IP_CONFIG_IPSEL0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_IPSEL0_SHIFT)) & FMUTEST_R_IP_CONFIG_IPSEL0_MASK) - -#define FMUTEST_R_IP_CONFIG_IPSEL1_MASK (0xCU) -#define FMUTEST_R_IP_CONFIG_IPSEL1_SHIFT (2U) -/*! IPSEL1 - Block 1 Select Control - * 0b00..Unselect block 1 - * 0b01..not used, reserved - * 0b10..Enable block 1 test, repair off (default) - * 0b11..Enable block 1 test, repair on - */ -#define FMUTEST_R_IP_CONFIG_IPSEL1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_IPSEL1_SHIFT)) & FMUTEST_R_IP_CONFIG_IPSEL1_MASK) - -#define FMUTEST_R_IP_CONFIG_BIST_CDIVL_MASK (0xFF0U) -#define FMUTEST_R_IP_CONFIG_BIST_CDIVL_SHIFT (4U) -/*! BIST_CDIVL - Clock Divide Scalar for Long Pulse */ -#define FMUTEST_R_IP_CONFIG_BIST_CDIVL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_BIST_CDIVL_SHIFT)) & FMUTEST_R_IP_CONFIG_BIST_CDIVL_MASK) - -#define FMUTEST_R_IP_CONFIG_CDIVS_MASK (0x7000U) -#define FMUTEST_R_IP_CONFIG_CDIVS_SHIFT (12U) -/*! CDIVS - Number of clock cycles to generate short pulse */ -#define FMUTEST_R_IP_CONFIG_CDIVS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_CDIVS_SHIFT)) & FMUTEST_R_IP_CONFIG_CDIVS_MASK) - -#define FMUTEST_R_IP_CONFIG_BIST_TVFY_MASK (0xF8000U) -#define FMUTEST_R_IP_CONFIG_BIST_TVFY_SHIFT (15U) -/*! BIST_TVFY - Timer adjust for verify */ -#define FMUTEST_R_IP_CONFIG_BIST_TVFY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_BIST_TVFY_SHIFT)) & FMUTEST_R_IP_CONFIG_BIST_TVFY_MASK) - -#define FMUTEST_R_IP_CONFIG_TSTCTL_MASK (0x300000U) -#define FMUTEST_R_IP_CONFIG_TSTCTL_SHIFT (20U) -/*! TSTCTL - BIST self-test control - * 0b00..Default, disable both BIST self-test and MISR - * 0b01..Enable BIST self-test mode DOUT from macro will be forced to '0', and disable MISR. - * 0b10..Enable MISR - * 0b11..Enable both BIST self-test mode and MISR - */ -#define FMUTEST_R_IP_CONFIG_TSTCTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_TSTCTL_SHIFT)) & FMUTEST_R_IP_CONFIG_TSTCTL_MASK) - -#define FMUTEST_R_IP_CONFIG_DBGCTL_MASK (0x400000U) -#define FMUTEST_R_IP_CONFIG_DBGCTL_SHIFT (22U) -/*! DBGCTL - Debug feature control - * 0b0..Default - * 0b1..Enable debug feature to collect failure address and data. - */ -#define FMUTEST_R_IP_CONFIG_DBGCTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_DBGCTL_SHIFT)) & FMUTEST_R_IP_CONFIG_DBGCTL_MASK) - -#define FMUTEST_R_IP_CONFIG_BIST_CLK_SEL_MASK (0x800000U) -#define FMUTEST_R_IP_CONFIG_BIST_CLK_SEL_SHIFT (23U) -/*! BIST_CLK_SEL - BIST Clock Select */ -#define FMUTEST_R_IP_CONFIG_BIST_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_BIST_CLK_SEL_SHIFT)) & FMUTEST_R_IP_CONFIG_BIST_CLK_SEL_MASK) - -#define FMUTEST_R_IP_CONFIG_SMWTST_MASK (0x3000000U) -#define FMUTEST_R_IP_CONFIG_SMWTST_SHIFT (24U) -/*! SMWTST - SMWR DOUT Function Control - * 0b00..Default - * 0b01..Enable SMWR self-test mode, DOUT from macro will be forced to all 0 - * 0b10..Enable SMWR self-test mode, DOUT from macro will be forced to all 1 - * 0b11..Reserved (unused) - */ -#define FMUTEST_R_IP_CONFIG_SMWTST(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_SMWTST_SHIFT)) & FMUTEST_R_IP_CONFIG_SMWTST_MASK) - -#define FMUTEST_R_IP_CONFIG_ECCEN_MASK (0x4000000U) -#define FMUTEST_R_IP_CONFIG_ECCEN_SHIFT (26U) -/*! ECCEN - BIST ECC Control - * 0b0..Default mode (no ECC encode or decode) - * 0b1..Enable ECC encode/decode - */ -#define FMUTEST_R_IP_CONFIG_ECCEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_ECCEN_SHIFT)) & FMUTEST_R_IP_CONFIG_ECCEN_MASK) -/*! @} */ - -/*! @name R_TESTCODE - BIST Test Code Register */ -/*! @{ */ - -#define FMUTEST_R_TESTCODE_TESTCODE_MASK (0x3FU) -#define FMUTEST_R_TESTCODE_TESTCODE_SHIFT (0U) -/*! TESTCODE - Used to store test code information before running TMR-RST/TMRSET BIST command */ -#define FMUTEST_R_TESTCODE_TESTCODE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TESTCODE_TESTCODE_SHIFT)) & FMUTEST_R_TESTCODE_TESTCODE_MASK) -/*! @} */ - -/*! @name R_DFT_CTRL - BIST DFT Control Register */ -/*! @{ */ - -#define FMUTEST_R_DFT_CTRL_DFT_XADR_MASK (0xFU) -#define FMUTEST_R_DFT_CTRL_DFT_XADR_SHIFT (0U) -/*! DFT_XADR - DFT XADR Pattern - * 0b0000..XADR fixed, no change at all - * 0b0001..XADR increased by 1 after row. For READ operation, XADR increases by 1 after reading the last word of - * row. For PROG operation, XADR increases by 1 after NVSTR falls. - * 0b0010..XADR increased for diagonal. For PROG-DIAGONAL operation, XADR is increased to create diagonal pattern. - * 0b0011..XADR increased by sector. During ERASE operation, XADR increased by number of rows in a sector when NVSTR falls. - * 0b0100..XADR inversed. XADR is inversed after reading one word or after programming one row when NVSTR falls. - * 0b0101..XADR increased by 2 after row. For READ operation, XADR is increased by 2 after reading the last word - * of a row. For PROG operation, XADR is increased by 2 when NVSTR falls. - * 0b0110..XADR[0] inversed. XADR[0] is inversed after reading one word or after programming one row when NVSTR falls. - * 0b0111..XADR increased by 1. For READ operations only, XADR increased by 1 after each read cycle. - * 0b1000..XADR decreased by 1 after row. For READ operations only, XADR is decreased by 1 after YADR decreases to 0. - * 0b1001..XADR decreased by 1. For READ operations only, XADR is decreased by 1 after each read cycle. - */ -#define FMUTEST_R_DFT_CTRL_DFT_XADR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DFT_CTRL_DFT_XADR_SHIFT)) & FMUTEST_R_DFT_CTRL_DFT_XADR_MASK) - -#define FMUTEST_R_DFT_CTRL_DFT_YADR_MASK (0xF0U) -#define FMUTEST_R_DFT_CTRL_DFT_YADR_SHIFT (4U) -/*! DFT_YADR - DFT YADR Pattern - * 0b0000..YADR fixed, no change at all - * 0b0001..YADR for ICKBD. For PROG and READ operations, YADR changed to generate inverse checkerboard pattern. - * 0b0010..YADR for CKBD. For PROG and READ operations, YADR changed to generate checkerboard pattern. - * 0b0011..YADR increased by 1. For READ operations, YADR increased by 1 after each read cycle. For PROG - * operations, YADR increased by 1 after YE falls. - * 0b0100..YADR increased for diagonal. For PROG-DIAGONAL operation, YADR is increased to create diagonal pattern. - * 0b0101..YADR inversed. YADR is inversed after reading one word or after programming one word when YE falls. - * 0b0110..YADR[0] inversed. YADR[0] is inversed after reading one word or after programming one word when YE falls. - * 0b0111..YADR increased by 1 after last row. For READ operations only, YADR is increased by 1 after XADR reaches last row. - * 0b1000..YADR decreased by 1. For READ operations only, YADR is decreased by 1 after each read cycle. - * 0b1001..YADR decreased by 1 after first row. For READ operations only, YADR is decreased by 1 after XADR decreases to 0. - */ -#define FMUTEST_R_DFT_CTRL_DFT_YADR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DFT_CTRL_DFT_YADR_SHIFT)) & FMUTEST_R_DFT_CTRL_DFT_YADR_MASK) - -#define FMUTEST_R_DFT_CTRL_DFT_DATA_MASK (0xF00U) -#define FMUTEST_R_DFT_CTRL_DFT_DATA_SHIFT (8U) -/*! DFT_DATA - DFT Data Pattern - * 0b0000..CKBD pattern. For READ operations only, compare DOUT with checkerboard data pattern for each read cycle. - * 0b0001..ICKBD pattern. For READ operations only, compare DOUT with inverse checkerboard data pattern for each read cycle. - * 0b0010..Diagonal pattern. Used for READ operations only, compare DOUT to diagonal pattern. - * 0b0011..Fixed data pattern. For READ operations, comparison to DOUT for selected groups; refer to - * R_ADR_CTRL[GRPSEL] for modules with multiple groups. - * 0b0100..Random data pattern which will be generated based on the initial seed set in R_DATA; for READ - * operations, used for DOUT comparison of selected groups. For PROG operations, used to control DIN of selected - * groups. - * 0b0101..DOUT based pattern. For READ operations only, DOUT of selected group will be latched in R_DATA. If - * more than one group is selected in R_ADR_CTRL[GRPSEL], the group with the lower index will be latched. - * 0b0110..R_DATA based pattern. For READ operations, expected DOUT value of selected groups equals to R_DATA - * when XADR[0]==YADR[0] or ~R_DATA when XADR[0]!=YADR[0]. For PROG operations, DIN of selected groups equals - * R_DATA when XADR[0]==YADR[0] or ~R_DATA when XADR[0]!=YADR[0]. - * 0b0111..SCAN-IO pattern. For READ operations, control expected DOUT value of selected groups to SCAN-IO data - * pattern. For PROG operations, control DIN of selected groups to SCAN-IO data pattern. - * 0b1000..REPAIR set. For PROG operation to IFR1(7,1) and IFR1(7,2), R_REPAIR0_0 and R_REPAIR0_1 or R_REPAIR1_0 - * and R_REPAIR1_1 will control DIN. For READ operation on IFR1(7,1) and IFR1(7,2), DOUT will be compared - * against R_REPAIR0_0 and R_REPAIR0_1 or R_REPAIR1_0 andR_REPAIR1_1. When this option is selected, only - * one flash block can be selected. - * 0b1001..REPAIR load. For READ operation only, DOUT from IFR1(7,1) and IFR1(7,2) is loaded to R_REPAIR0 and R_REPAIR1. - */ -#define FMUTEST_R_DFT_CTRL_DFT_DATA(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DFT_CTRL_DFT_DATA_SHIFT)) & FMUTEST_R_DFT_CTRL_DFT_DATA_MASK) - -#define FMUTEST_R_DFT_CTRL_CMP_MASK_MASK (0x3000U) -#define FMUTEST_R_DFT_CTRL_CMP_MASK_SHIFT (12U) -/*! CMP_MASK - Data Compare Mask - * 0b00..Expected data is compared to DOUT - * 0b01..Expected data (only 0s are considered) are compared to DOUT - * 0b10..Expected data (only 1s are considered) are compared to DOUT - */ -#define FMUTEST_R_DFT_CTRL_CMP_MASK(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DFT_CTRL_CMP_MASK_SHIFT)) & FMUTEST_R_DFT_CTRL_CMP_MASK_MASK) - -#define FMUTEST_R_DFT_CTRL_DFT_DATA_SRC_MASK (0x4000U) -#define FMUTEST_R_DFT_CTRL_DFT_DATA_SRC_SHIFT (14U) -/*! DFT_DATA_SRC - DFT Data Source - * 0b0..{R_DATA_CTRL0,R_DATA_CTRL_EX[2:0],R_DATA_CTRL0,R_DATA_CTRL_EX[2:0],R_DATA_CTRL0,R_DATA_CTRL_EX[2:0],R_DATA_CTRL0} is used - * 0b1..{R_DATA_CTRL3,R_DATA_CTRL2_EX[2:0],R_DATA_CTRL2,R_DATA_CTRL1_EX[2:0],R_DATA_CTRL1,R_DATA_CTRL_EX[2:0],R_DATA_CTRL0} is used - */ -#define FMUTEST_R_DFT_CTRL_DFT_DATA_SRC(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DFT_CTRL_DFT_DATA_SRC_SHIFT)) & FMUTEST_R_DFT_CTRL_DFT_DATA_SRC_MASK) -/*! @} */ - -/*! @name R_ADR_CTRL - BIST Address Control Register */ -/*! @{ */ - -#define FMUTEST_R_ADR_CTRL_GRPSEL_MASK (0xFU) -#define FMUTEST_R_ADR_CTRL_GRPSEL_SHIFT (0U) -/*! GRPSEL - Data Group Select - * 0b0000..Select no data - * 0b0001..Select data slice [34:0] - * 0b0010..Select data slice [69:35] - * 0b0100..Select data slice [104:70] - * 0b1000..Select data slice [136:105] - * 0b1111..Select data [136:0] - */ -#define FMUTEST_R_ADR_CTRL_GRPSEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ADR_CTRL_GRPSEL_SHIFT)) & FMUTEST_R_ADR_CTRL_GRPSEL_MASK) - -#define FMUTEST_R_ADR_CTRL_XADR_MASK (0xFFF0U) -#define FMUTEST_R_ADR_CTRL_XADR_SHIFT (4U) -/*! XADR - BIST XADR */ -#define FMUTEST_R_ADR_CTRL_XADR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ADR_CTRL_XADR_SHIFT)) & FMUTEST_R_ADR_CTRL_XADR_MASK) - -#define FMUTEST_R_ADR_CTRL_YADR_MASK (0x1F0000U) -#define FMUTEST_R_ADR_CTRL_YADR_SHIFT (16U) -/*! YADR - BIST YADR */ -#define FMUTEST_R_ADR_CTRL_YADR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ADR_CTRL_YADR_SHIFT)) & FMUTEST_R_ADR_CTRL_YADR_MASK) - -#define FMUTEST_R_ADR_CTRL_PROG_ATTR_MASK (0xE00000U) -#define FMUTEST_R_ADR_CTRL_PROG_ATTR_SHIFT (21U) -/*! PROG_ATTR - Program Attribute - * 0b000..One YE pulse will program one data slice group - * 0b001..One YE pulse will program two data slice groups - * 0b010..One YE pulse will program three data slice groups (reserved) - * 0b011..One YE pulse will program four data slice groups - * 0b100..One YE pulse will program five data slice groups (reserved) - * 0b101..One YE pulse will program six data slice groups (reserved) - * 0b110..One YE pulse will program seven data slice groups (reserved) - * 0b111..One YE pulse will program eight data slice groups (reserved) - */ -#define FMUTEST_R_ADR_CTRL_PROG_ATTR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ADR_CTRL_PROG_ATTR_SHIFT)) & FMUTEST_R_ADR_CTRL_PROG_ATTR_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL0 - BIST Data Control 0 Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL0_DATA0_MASK (0xFFFFFFFFU) -#define FMUTEST_R_DATA_CTRL0_DATA0_SHIFT (0U) -/*! DATA0 - BIST Data 0 Low */ -#define FMUTEST_R_DATA_CTRL0_DATA0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL0_DATA0_SHIFT)) & FMUTEST_R_DATA_CTRL0_DATA0_MASK) -/*! @} */ - -/*! @name R_PIN_CTRL - BIST Pin Control Register */ -/*! @{ */ - -#define FMUTEST_R_PIN_CTRL_MAS1_MASK (0x1U) -#define FMUTEST_R_PIN_CTRL_MAS1_SHIFT (0U) -/*! MAS1 - Mass Erase */ -#define FMUTEST_R_PIN_CTRL_MAS1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_MAS1_SHIFT)) & FMUTEST_R_PIN_CTRL_MAS1_MASK) - -#define FMUTEST_R_PIN_CTRL_IFREN_MASK (0x2U) -#define FMUTEST_R_PIN_CTRL_IFREN_SHIFT (1U) -/*! IFREN - IFR Enable */ -#define FMUTEST_R_PIN_CTRL_IFREN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_IFREN_SHIFT)) & FMUTEST_R_PIN_CTRL_IFREN_MASK) - -#define FMUTEST_R_PIN_CTRL_IFREN1_MASK (0x4U) -#define FMUTEST_R_PIN_CTRL_IFREN1_SHIFT (2U) -/*! IFREN1 - IFR1 Enable */ -#define FMUTEST_R_PIN_CTRL_IFREN1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_IFREN1_SHIFT)) & FMUTEST_R_PIN_CTRL_IFREN1_MASK) - -#define FMUTEST_R_PIN_CTRL_REDEN_MASK (0x8U) -#define FMUTEST_R_PIN_CTRL_REDEN_SHIFT (3U) -/*! REDEN - Redundancy Block Enable */ -#define FMUTEST_R_PIN_CTRL_REDEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_REDEN_SHIFT)) & FMUTEST_R_PIN_CTRL_REDEN_MASK) - -#define FMUTEST_R_PIN_CTRL_LVE_MASK (0x10U) -#define FMUTEST_R_PIN_CTRL_LVE_SHIFT (4U) -/*! LVE - Low Voltage Enable */ -#define FMUTEST_R_PIN_CTRL_LVE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_LVE_SHIFT)) & FMUTEST_R_PIN_CTRL_LVE_MASK) - -#define FMUTEST_R_PIN_CTRL_PV_MASK (0x20U) -#define FMUTEST_R_PIN_CTRL_PV_SHIFT (5U) -/*! PV - Program Verify Enable */ -#define FMUTEST_R_PIN_CTRL_PV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_PV_SHIFT)) & FMUTEST_R_PIN_CTRL_PV_MASK) - -#define FMUTEST_R_PIN_CTRL_EV_MASK (0x40U) -#define FMUTEST_R_PIN_CTRL_EV_SHIFT (6U) -/*! EV - Erase Verify Enable */ -#define FMUTEST_R_PIN_CTRL_EV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_EV_SHIFT)) & FMUTEST_R_PIN_CTRL_EV_MASK) - -#define FMUTEST_R_PIN_CTRL_WIPGM_MASK (0x180U) -#define FMUTEST_R_PIN_CTRL_WIPGM_SHIFT (7U) -/*! WIPGM - Program Current */ -#define FMUTEST_R_PIN_CTRL_WIPGM(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_WIPGM_SHIFT)) & FMUTEST_R_PIN_CTRL_WIPGM_MASK) - -#define FMUTEST_R_PIN_CTRL_WHV_MASK (0x1E00U) -#define FMUTEST_R_PIN_CTRL_WHV_SHIFT (9U) -/*! WHV - High Voltage Level */ -#define FMUTEST_R_PIN_CTRL_WHV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_WHV_SHIFT)) & FMUTEST_R_PIN_CTRL_WHV_MASK) - -#define FMUTEST_R_PIN_CTRL_WMV_MASK (0xE000U) -#define FMUTEST_R_PIN_CTRL_WMV_SHIFT (13U) -/*! WMV - Medium Voltage Level */ -#define FMUTEST_R_PIN_CTRL_WMV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_WMV_SHIFT)) & FMUTEST_R_PIN_CTRL_WMV_MASK) - -#define FMUTEST_R_PIN_CTRL_XE_MASK (0x10000U) -#define FMUTEST_R_PIN_CTRL_XE_SHIFT (16U) -/*! XE - X Address Enable */ -#define FMUTEST_R_PIN_CTRL_XE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_XE_SHIFT)) & FMUTEST_R_PIN_CTRL_XE_MASK) - -#define FMUTEST_R_PIN_CTRL_YE_MASK (0x20000U) -#define FMUTEST_R_PIN_CTRL_YE_SHIFT (17U) -/*! YE - Y Address Enable */ -#define FMUTEST_R_PIN_CTRL_YE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_YE_SHIFT)) & FMUTEST_R_PIN_CTRL_YE_MASK) - -#define FMUTEST_R_PIN_CTRL_SE_MASK (0x40000U) -#define FMUTEST_R_PIN_CTRL_SE_SHIFT (18U) -/*! SE - Sense Amp Enable */ -#define FMUTEST_R_PIN_CTRL_SE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_SE_SHIFT)) & FMUTEST_R_PIN_CTRL_SE_MASK) - -#define FMUTEST_R_PIN_CTRL_ERASE_MASK (0x80000U) -#define FMUTEST_R_PIN_CTRL_ERASE_SHIFT (19U) -/*! ERASE - Erase Mode */ -#define FMUTEST_R_PIN_CTRL_ERASE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_ERASE_SHIFT)) & FMUTEST_R_PIN_CTRL_ERASE_MASK) - -#define FMUTEST_R_PIN_CTRL_PROG_MASK (0x100000U) -#define FMUTEST_R_PIN_CTRL_PROG_SHIFT (20U) -/*! PROG - Program Mode */ -#define FMUTEST_R_PIN_CTRL_PROG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_PROG_SHIFT)) & FMUTEST_R_PIN_CTRL_PROG_MASK) - -#define FMUTEST_R_PIN_CTRL_NVSTR_MASK (0x200000U) -#define FMUTEST_R_PIN_CTRL_NVSTR_SHIFT (21U) -/*! NVSTR - NVM Store */ -#define FMUTEST_R_PIN_CTRL_NVSTR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_NVSTR_SHIFT)) & FMUTEST_R_PIN_CTRL_NVSTR_MASK) - -#define FMUTEST_R_PIN_CTRL_SLM_MASK (0x400000U) -#define FMUTEST_R_PIN_CTRL_SLM_SHIFT (22U) -/*! SLM - Sleep Mode Enable */ -#define FMUTEST_R_PIN_CTRL_SLM(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_SLM_SHIFT)) & FMUTEST_R_PIN_CTRL_SLM_MASK) - -#define FMUTEST_R_PIN_CTRL_RECALL_MASK (0x800000U) -#define FMUTEST_R_PIN_CTRL_RECALL_SHIFT (23U) -/*! RECALL - Recall Trim Code */ -#define FMUTEST_R_PIN_CTRL_RECALL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_RECALL_SHIFT)) & FMUTEST_R_PIN_CTRL_RECALL_MASK) - -#define FMUTEST_R_PIN_CTRL_HEM_MASK (0x1000000U) -#define FMUTEST_R_PIN_CTRL_HEM_SHIFT (24U) -/*! HEM - HEM Control */ -#define FMUTEST_R_PIN_CTRL_HEM(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_HEM_SHIFT)) & FMUTEST_R_PIN_CTRL_HEM_MASK) -/*! @} */ - -/*! @name R_CNT_LOOP_CTRL - BIST Loop Count Control Register */ -/*! @{ */ - -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPCNT_MASK (0xFFFU) -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPCNT_SHIFT (0U) -/*! LOOPCNT - Loop Count Control */ -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPCNT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_CNT_LOOP_CTRL_LOOPCNT_SHIFT)) & FMUTEST_R_CNT_LOOP_CTRL_LOOPCNT_MASK) - -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPOPT_MASK (0x7000U) -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPOPT_SHIFT (12U) -/*! LOOPOPT - Loop Option - * 0b000..Loop is disabled; selected BIST operation is run once - * 0b001..Loop is enabled; XADR increments by 1 XADR increments by 1 for each new loop. Stops when total loop count meets LOOPCNT+1. - * 0b010..Loop is enabled; YADR increments by 1 YADR increments by 1 for each new loop. Stops when total loop count meets LOOPCNT+1. - * 0b011..Loop is enabled; XADR increments by 2 XADR increments by 2 for each new loop. Stops when total loop count meets LOOPCNT+1. - * 0b100..Loop is enabled; XADR increments by sector XADR increments by 16 for each new loop. Stops when total loop count meets LOOPCNT+1. - */ -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPOPT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_CNT_LOOP_CTRL_LOOPOPT_SHIFT)) & FMUTEST_R_CNT_LOOP_CTRL_LOOPOPT_MASK) - -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPUNIT_MASK (0x38000U) -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPUNIT_SHIFT (15U) -/*! LOOPUNIT - Loop Time Unit - * 0b000..Clock cycles - * 0b001..0.5 usec - * 0b010..1 usec - * 0b011..10 usec - * 0b100..100 usec - * 0b101..1 msec - * 0b110..10 msec - * 0b111..100 msec - */ -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPUNIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_CNT_LOOP_CTRL_LOOPUNIT_SHIFT)) & FMUTEST_R_CNT_LOOP_CTRL_LOOPUNIT_MASK) - -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPDLY_MASK (0x1FC0000U) -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPDLY_SHIFT (18U) -/*! LOOPDLY - Loop Time Delay Scalar */ -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPDLY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_CNT_LOOP_CTRL_LOOPDLY_SHIFT)) & FMUTEST_R_CNT_LOOP_CTRL_LOOPDLY_MASK) -/*! @} */ - -/*! @name R_TIMER_CTRL - BIST Timer Control Register */ -/*! @{ */ - -#define FMUTEST_R_TIMER_CTRL_TNVSUNIT_MASK (0x7U) -#define FMUTEST_R_TIMER_CTRL_TNVSUNIT_SHIFT (0U) -/*! TNVSUNIT - Tnvs Time Unit - * 0b000..Clock cycles - * 0b001..0.5 usec - * 0b010..1 usec - * 0b011..10 usec - * 0b100..100 usec - * 0b101..1 msec - * 0b110..10 msec - * 0b111..100 msec - */ -#define FMUTEST_R_TIMER_CTRL_TNVSUNIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TNVSUNIT_SHIFT)) & FMUTEST_R_TIMER_CTRL_TNVSUNIT_MASK) - -#define FMUTEST_R_TIMER_CTRL_TNVSDLY_MASK (0x78U) -#define FMUTEST_R_TIMER_CTRL_TNVSDLY_SHIFT (3U) -/*! TNVSDLY - Tnvs Time Delay Scalar */ -#define FMUTEST_R_TIMER_CTRL_TNVSDLY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TNVSDLY_SHIFT)) & FMUTEST_R_TIMER_CTRL_TNVSDLY_MASK) - -#define FMUTEST_R_TIMER_CTRL_TNVHUNIT_MASK (0x380U) -#define FMUTEST_R_TIMER_CTRL_TNVHUNIT_SHIFT (7U) -/*! TNVHUNIT - Tnvh Time Unit - * 0b000..Clock cycles - * 0b001..0.5 usec - * 0b010..1 usec - * 0b011..10 usec - * 0b100..100 usec - * 0b101..1 msec - * 0b110..10 msec - * 0b111..100 msec - */ -#define FMUTEST_R_TIMER_CTRL_TNVHUNIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TNVHUNIT_SHIFT)) & FMUTEST_R_TIMER_CTRL_TNVHUNIT_MASK) - -#define FMUTEST_R_TIMER_CTRL_TNVHDLY_MASK (0x3C00U) -#define FMUTEST_R_TIMER_CTRL_TNVHDLY_SHIFT (10U) -/*! TNVHDLY - Tnvh Time Delay Scalar */ -#define FMUTEST_R_TIMER_CTRL_TNVHDLY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TNVHDLY_SHIFT)) & FMUTEST_R_TIMER_CTRL_TNVHDLY_MASK) - -#define FMUTEST_R_TIMER_CTRL_TPGSUNIT_MASK (0x1C000U) -#define FMUTEST_R_TIMER_CTRL_TPGSUNIT_SHIFT (14U) -/*! TPGSUNIT - Tpgs Time Unit - * 0b000..Clock cycles - * 0b001..0.5 usec - * 0b010..1 usec - * 0b011..10 usec - * 0b100..100 usec - * 0b101..1 msec - * 0b110..10 msec - * 0b111..100 msec - */ -#define FMUTEST_R_TIMER_CTRL_TPGSUNIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TPGSUNIT_SHIFT)) & FMUTEST_R_TIMER_CTRL_TPGSUNIT_MASK) - -#define FMUTEST_R_TIMER_CTRL_TPGSDLY_MASK (0x1E0000U) -#define FMUTEST_R_TIMER_CTRL_TPGSDLY_SHIFT (17U) -/*! TPGSDLY - Tpgs Time Delay Scalar */ -#define FMUTEST_R_TIMER_CTRL_TPGSDLY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TPGSDLY_SHIFT)) & FMUTEST_R_TIMER_CTRL_TPGSDLY_MASK) - -#define FMUTEST_R_TIMER_CTRL_TRCVUNIT_MASK (0xE00000U) -#define FMUTEST_R_TIMER_CTRL_TRCVUNIT_SHIFT (21U) -/*! TRCVUNIT - Trcv Time Unit - * 0b000..Clock cycles - * 0b001..0.5 usec - * 0b010..1 usec - * 0b011..10 usec - * 0b100..100 usec - * 0b101..1 msec - * 0b110..10 msec - * 0b111..100 msec - */ -#define FMUTEST_R_TIMER_CTRL_TRCVUNIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TRCVUNIT_SHIFT)) & FMUTEST_R_TIMER_CTRL_TRCVUNIT_MASK) - -#define FMUTEST_R_TIMER_CTRL_TRCVDLY_MASK (0xF000000U) -#define FMUTEST_R_TIMER_CTRL_TRCVDLY_SHIFT (24U) -/*! TRCVDLY - Trcv Time Delay Scalar */ -#define FMUTEST_R_TIMER_CTRL_TRCVDLY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TRCVDLY_SHIFT)) & FMUTEST_R_TIMER_CTRL_TRCVDLY_MASK) - -#define FMUTEST_R_TIMER_CTRL_TLVSUNIT_MASK (0x70000000U) -#define FMUTEST_R_TIMER_CTRL_TLVSUNIT_SHIFT (28U) -/*! TLVSUNIT - Tlvs Time Unit - * 0b000..Clock cycles - * 0b001..0.5 usec - * 0b010..1 usec - * 0b011..10 usec - * 0b100..100 usec - * 0b101..1 msec - * 0b110..10 msec - * 0b111..100 msec - */ -#define FMUTEST_R_TIMER_CTRL_TLVSUNIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TLVSUNIT_SHIFT)) & FMUTEST_R_TIMER_CTRL_TLVSUNIT_MASK) - -#define FMUTEST_R_TIMER_CTRL_TLVSDLY_L_MASK (0x80000000U) -#define FMUTEST_R_TIMER_CTRL_TLVSDLY_L_SHIFT (31U) -/*! TLVSDLY_L - Tlvs Time Delay Scalar Low */ -#define FMUTEST_R_TIMER_CTRL_TLVSDLY_L(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TLVSDLY_L_SHIFT)) & FMUTEST_R_TIMER_CTRL_TLVSDLY_L_MASK) -/*! @} */ - -/*! @name R_TEST_CTRL - BIST Test Control Register */ -/*! @{ */ - -#define FMUTEST_R_TEST_CTRL_BUSY_MASK (0x1U) -#define FMUTEST_R_TEST_CTRL_BUSY_SHIFT (0U) -/*! BUSY - BIST Busy Status - * 0b0..BIST is idle - * 0b1..BIST is busy - */ -#define FMUTEST_R_TEST_CTRL_BUSY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_BUSY_SHIFT)) & FMUTEST_R_TEST_CTRL_BUSY_MASK) - -#define FMUTEST_R_TEST_CTRL_DEBUG_MASK (0x2U) -#define FMUTEST_R_TEST_CTRL_DEBUG_SHIFT (1U) -/*! DEBUG - BIST Debug Status */ -#define FMUTEST_R_TEST_CTRL_DEBUG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_DEBUG_SHIFT)) & FMUTEST_R_TEST_CTRL_DEBUG_MASK) - -#define FMUTEST_R_TEST_CTRL_STATUS0_MASK (0x4U) -#define FMUTEST_R_TEST_CTRL_STATUS0_SHIFT (2U) -/*! STATUS0 - BIST Status 0 - * 0b0..BIST test passed on flash block 0 - * 0b1..BIST test failed on flash block 0 - */ -#define FMUTEST_R_TEST_CTRL_STATUS0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_STATUS0_SHIFT)) & FMUTEST_R_TEST_CTRL_STATUS0_MASK) - -#define FMUTEST_R_TEST_CTRL_STATUS1_MASK (0x8U) -#define FMUTEST_R_TEST_CTRL_STATUS1_SHIFT (3U) -/*! STATUS1 - BIST status 1 - * 0b0..BIST test passed on flash block 1 - * 0b1..BIST test failed on flash block 1 - */ -#define FMUTEST_R_TEST_CTRL_STATUS1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_STATUS1_SHIFT)) & FMUTEST_R_TEST_CTRL_STATUS1_MASK) - -#define FMUTEST_R_TEST_CTRL_DEBUGRUN_MASK (0x10U) -#define FMUTEST_R_TEST_CTRL_DEBUGRUN_SHIFT (4U) -/*! DEBUGRUN - BIST Continue Debug Run */ -#define FMUTEST_R_TEST_CTRL_DEBUGRUN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_DEBUGRUN_SHIFT)) & FMUTEST_R_TEST_CTRL_DEBUGRUN_MASK) - -#define FMUTEST_R_TEST_CTRL_STARTRUN_MASK (0x20U) -#define FMUTEST_R_TEST_CTRL_STARTRUN_SHIFT (5U) -/*! STARTRUN - Run New BIST Operation */ -#define FMUTEST_R_TEST_CTRL_STARTRUN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_STARTRUN_SHIFT)) & FMUTEST_R_TEST_CTRL_STARTRUN_MASK) - -#define FMUTEST_R_TEST_CTRL_CMDINDEX_MASK (0xFFC0U) -#define FMUTEST_R_TEST_CTRL_CMDINDEX_SHIFT (6U) -/*! CMDINDEX - BIST Command Index (code) */ -#define FMUTEST_R_TEST_CTRL_CMDINDEX(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_CMDINDEX_SHIFT)) & FMUTEST_R_TEST_CTRL_CMDINDEX_MASK) - -#define FMUTEST_R_TEST_CTRL_DISABLE_IP1_MASK (0x10000U) -#define FMUTEST_R_TEST_CTRL_DISABLE_IP1_SHIFT (16U) -/*! DISABLE_IP1 - BIST Disable IP1 */ -#define FMUTEST_R_TEST_CTRL_DISABLE_IP1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_DISABLE_IP1_SHIFT)) & FMUTEST_R_TEST_CTRL_DISABLE_IP1_MASK) -/*! @} */ - -/*! @name R_ABORT_LOOP - BIST Abort Loop Register */ -/*! @{ */ - -#define FMUTEST_R_ABORT_LOOP_ABORT_LOOP_MASK (0x1U) -#define FMUTEST_R_ABORT_LOOP_ABORT_LOOP_SHIFT (0U) -/*! ABORT_LOOP - Abort Loop - * 0b0..No effect - * 0b1..Abort BIST loop commands and force the loop counter to return to 0x0 - */ -#define FMUTEST_R_ABORT_LOOP_ABORT_LOOP(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ABORT_LOOP_ABORT_LOOP_SHIFT)) & FMUTEST_R_ABORT_LOOP_ABORT_LOOP_MASK) -/*! @} */ - -/*! @name R_ADR_QUERY - BIST Address Query Register */ -/*! @{ */ - -#define FMUTEST_R_ADR_QUERY_YADRFAIL_MASK (0x1FU) -#define FMUTEST_R_ADR_QUERY_YADRFAIL_SHIFT (0U) -/*! YADRFAIL - Failing YADR */ -#define FMUTEST_R_ADR_QUERY_YADRFAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ADR_QUERY_YADRFAIL_SHIFT)) & FMUTEST_R_ADR_QUERY_YADRFAIL_MASK) - -#define FMUTEST_R_ADR_QUERY_XADRFAIL_MASK (0x1FFE0U) -#define FMUTEST_R_ADR_QUERY_XADRFAIL_SHIFT (5U) -/*! XADRFAIL - Failing XADR */ -#define FMUTEST_R_ADR_QUERY_XADRFAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ADR_QUERY_XADRFAIL_SHIFT)) & FMUTEST_R_ADR_QUERY_XADRFAIL_MASK) -/*! @} */ - -/*! @name R_DOUT_QUERY0 - BIST DOUT Query 0 Register */ -/*! @{ */ - -#define FMUTEST_R_DOUT_QUERY0_DOUTFAIL_MASK (0xFFFFFFFFU) -#define FMUTEST_R_DOUT_QUERY0_DOUTFAIL_SHIFT (0U) -/*! DOUTFAIL - Failing DOUT Low */ -#define FMUTEST_R_DOUT_QUERY0_DOUTFAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DOUT_QUERY0_DOUTFAIL_SHIFT)) & FMUTEST_R_DOUT_QUERY0_DOUTFAIL_MASK) -/*! @} */ - -/*! @name R_SMW_QUERY - BIST SMW Query Register */ -/*! @{ */ - -#define FMUTEST_R_SMW_QUERY_SMWLOOP_MASK (0x3FFU) -#define FMUTEST_R_SMW_QUERY_SMWLOOP_SHIFT (0U) -/*! SMWLOOP - SMW Total Loop Count */ -#define FMUTEST_R_SMW_QUERY_SMWLOOP(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMW_QUERY_SMWLOOP_SHIFT)) & FMUTEST_R_SMW_QUERY_SMWLOOP_MASK) - -#define FMUTEST_R_SMW_QUERY_SMWLAST_MASK (0x7FC00U) -#define FMUTEST_R_SMW_QUERY_SMWLAST_SHIFT (10U) -/*! SMWLAST - SMW Last Voltage Setting */ -#define FMUTEST_R_SMW_QUERY_SMWLAST(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMW_QUERY_SMWLAST_SHIFT)) & FMUTEST_R_SMW_QUERY_SMWLAST_MASK) -/*! @} */ - -/*! @name R_SMW_SETTING0 - BIST SMW Setting 0 Register */ -/*! @{ */ - -#define FMUTEST_R_SMW_SETTING0_SMWPARM0_MASK (0x7FFFFFFFU) -#define FMUTEST_R_SMW_SETTING0_SMWPARM0_SHIFT (0U) -/*! SMWPARM0 - SMW Parameter Set 0 */ -#define FMUTEST_R_SMW_SETTING0_SMWPARM0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMW_SETTING0_SMWPARM0_SHIFT)) & FMUTEST_R_SMW_SETTING0_SMWPARM0_MASK) -/*! @} */ - -/*! @name R_SMW_SETTING1 - BIST SMW Setting 1 Register */ -/*! @{ */ - -#define FMUTEST_R_SMW_SETTING1_SMWPARM1_MASK (0xFFFFFFFU) -#define FMUTEST_R_SMW_SETTING1_SMWPARM1_SHIFT (0U) -/*! SMWPARM1 - SMW Parameter Set 1 */ -#define FMUTEST_R_SMW_SETTING1_SMWPARM1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMW_SETTING1_SMWPARM1_SHIFT)) & FMUTEST_R_SMW_SETTING1_SMWPARM1_MASK) -/*! @} */ - -/*! @name R_SMP_WHV0 - BIST SMP WHV Setting 0 Register */ -/*! @{ */ - -#define FMUTEST_R_SMP_WHV0_SMPWHV0_MASK (0xFFFFFFFFU) -#define FMUTEST_R_SMP_WHV0_SMPWHV0_SHIFT (0U) -/*! SMPWHV0 - SMP WHV Parameter Set 0 */ -#define FMUTEST_R_SMP_WHV0_SMPWHV0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMP_WHV0_SMPWHV0_SHIFT)) & FMUTEST_R_SMP_WHV0_SMPWHV0_MASK) -/*! @} */ - -/*! @name R_SMP_WHV1 - BIST SMP WHV Setting 1 Register */ -/*! @{ */ - -#define FMUTEST_R_SMP_WHV1_SMPWHV1_MASK (0xFFFFFFFFU) -#define FMUTEST_R_SMP_WHV1_SMPWHV1_SHIFT (0U) -/*! SMPWHV1 - SMP WHV Parameter Set 1 */ -#define FMUTEST_R_SMP_WHV1_SMPWHV1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMP_WHV1_SMPWHV1_SHIFT)) & FMUTEST_R_SMP_WHV1_SMPWHV1_MASK) -/*! @} */ - -/*! @name R_SME_WHV0 - BIST SME WHV Setting 0 Register */ -/*! @{ */ - -#define FMUTEST_R_SME_WHV0_SMEWHV0_MASK (0xFFFFFFFFU) -#define FMUTEST_R_SME_WHV0_SMEWHV0_SHIFT (0U) -/*! SMEWHV0 - SME WHV Parameter Set 0 */ -#define FMUTEST_R_SME_WHV0_SMEWHV0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SME_WHV0_SMEWHV0_SHIFT)) & FMUTEST_R_SME_WHV0_SMEWHV0_MASK) -/*! @} */ - -/*! @name R_SME_WHV1 - BIST SME WHV Setting 1 Register */ -/*! @{ */ - -#define FMUTEST_R_SME_WHV1_SMEWHV1_MASK (0xFFFFFFFFU) -#define FMUTEST_R_SME_WHV1_SMEWHV1_SHIFT (0U) -/*! SMEWHV1 - SME WHV Parameter Set 1 */ -#define FMUTEST_R_SME_WHV1_SMEWHV1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SME_WHV1_SMEWHV1_SHIFT)) & FMUTEST_R_SME_WHV1_SMEWHV1_MASK) -/*! @} */ - -/*! @name R_SMW_SETTING2 - BIST SMW Setting 2 Register */ -/*! @{ */ - -#define FMUTEST_R_SMW_SETTING2_SMWPARM2_MASK (0x1FFFFFFFU) -#define FMUTEST_R_SMW_SETTING2_SMWPARM2_SHIFT (0U) -/*! SMWPARM2 - SMW Parameter Set 2 */ -#define FMUTEST_R_SMW_SETTING2_SMWPARM2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMW_SETTING2_SMWPARM2_SHIFT)) & FMUTEST_R_SMW_SETTING2_SMWPARM2_MASK) -/*! @} */ - -/*! @name R_D_MISR0 - BIST DIN MISR 0 Register */ -/*! @{ */ - -#define FMUTEST_R_D_MISR0_DATASIG0_MASK (0xFFFFFFFFU) -#define FMUTEST_R_D_MISR0_DATASIG0_SHIFT (0U) -/*! DATASIG0 - Data Signature */ -#define FMUTEST_R_D_MISR0_DATASIG0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_D_MISR0_DATASIG0_SHIFT)) & FMUTEST_R_D_MISR0_DATASIG0_MASK) -/*! @} */ - -/*! @name R_A_MISR0 - BIST Address MISR 0 Register */ -/*! @{ */ - -#define FMUTEST_R_A_MISR0_ADRSIG0_MASK (0xFFFFFFFFU) -#define FMUTEST_R_A_MISR0_ADRSIG0_SHIFT (0U) -/*! ADRSIG0 - Address Signature */ -#define FMUTEST_R_A_MISR0_ADRSIG0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_A_MISR0_ADRSIG0_SHIFT)) & FMUTEST_R_A_MISR0_ADRSIG0_MASK) -/*! @} */ - -/*! @name R_C_MISR0 - BIST Control MISR 0 Register */ -/*! @{ */ - -#define FMUTEST_R_C_MISR0_CTRLSIG0_MASK (0xFFFFFFFFU) -#define FMUTEST_R_C_MISR0_CTRLSIG0_SHIFT (0U) -/*! CTRLSIG0 - Control Signature */ -#define FMUTEST_R_C_MISR0_CTRLSIG0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_C_MISR0_CTRLSIG0_SHIFT)) & FMUTEST_R_C_MISR0_CTRLSIG0_MASK) -/*! @} */ - -/*! @name R_SMW_SETTING3 - BIST SMW Setting 3 Register */ -/*! @{ */ - -#define FMUTEST_R_SMW_SETTING3_SMWPARM3_MASK (0x1FFFFU) -#define FMUTEST_R_SMW_SETTING3_SMWPARM3_SHIFT (0U) -/*! SMWPARM3 - SMW Parameter Set 3 */ -#define FMUTEST_R_SMW_SETTING3_SMWPARM3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMW_SETTING3_SMWPARM3_SHIFT)) & FMUTEST_R_SMW_SETTING3_SMWPARM3_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL1 - BIST Data Control 1 Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL1_DATA1_MASK (0xFFFFFFFFU) -#define FMUTEST_R_DATA_CTRL1_DATA1_SHIFT (0U) -/*! DATA1 - BIST Data 1 Low */ -#define FMUTEST_R_DATA_CTRL1_DATA1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL1_DATA1_SHIFT)) & FMUTEST_R_DATA_CTRL1_DATA1_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL2 - BIST Data Control 2 Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL2_DATA2_MASK (0xFFFFFFFFU) -#define FMUTEST_R_DATA_CTRL2_DATA2_SHIFT (0U) -/*! DATA2 - BIST Data 2 Low */ -#define FMUTEST_R_DATA_CTRL2_DATA2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL2_DATA2_SHIFT)) & FMUTEST_R_DATA_CTRL2_DATA2_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL3 - BIST Data Control 3 Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL3_DATA3_MASK (0xFFFFFFFFU) -#define FMUTEST_R_DATA_CTRL3_DATA3_SHIFT (0U) -/*! DATA3 - BIST Data 3 Low */ -#define FMUTEST_R_DATA_CTRL3_DATA3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL3_DATA3_SHIFT)) & FMUTEST_R_DATA_CTRL3_DATA3_MASK) -/*! @} */ - -/*! @name R_REPAIR0_0 - BIST Repair 0 for Block 0 Register */ -/*! @{ */ - -#define FMUTEST_R_REPAIR0_0_RDIS0_0_MASK (0x1U) -#define FMUTEST_R_REPAIR0_0_RDIS0_0_SHIFT (0U) -/*! RDIS0_0 - Control Repair 0 in Block 0. - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_R_REPAIR0_0_RDIS0_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR0_0_RDIS0_0_SHIFT)) & FMUTEST_R_REPAIR0_0_RDIS0_0_MASK) - -#define FMUTEST_R_REPAIR0_0_RADR0_0_MASK (0x1FEU) -#define FMUTEST_R_REPAIR0_0_RADR0_0_SHIFT (1U) -/*! RADR0_0 - XADR for Repair 0 in Block 0 */ -#define FMUTEST_R_REPAIR0_0_RADR0_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR0_0_RADR0_0_SHIFT)) & FMUTEST_R_REPAIR0_0_RADR0_0_MASK) -/*! @} */ - -/*! @name R_REPAIR0_1 - BIST Repair 1 Block 0 Register */ -/*! @{ */ - -#define FMUTEST_R_REPAIR0_1_RDIS0_1_MASK (0x1U) -#define FMUTEST_R_REPAIR0_1_RDIS0_1_SHIFT (0U) -/*! RDIS0_1 - Control Repair 1 in Block 0. - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_R_REPAIR0_1_RDIS0_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR0_1_RDIS0_1_SHIFT)) & FMUTEST_R_REPAIR0_1_RDIS0_1_MASK) - -#define FMUTEST_R_REPAIR0_1_RADR0_1_MASK (0x1FEU) -#define FMUTEST_R_REPAIR0_1_RADR0_1_SHIFT (1U) -/*! RADR0_1 - XADR for Repair 1 in Block 0. */ -#define FMUTEST_R_REPAIR0_1_RADR0_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR0_1_RADR0_1_SHIFT)) & FMUTEST_R_REPAIR0_1_RADR0_1_MASK) -/*! @} */ - -/*! @name R_REPAIR1_0 - BIST Repair 0 Block 1 Register */ -/*! @{ */ - -#define FMUTEST_R_REPAIR1_0_RDIS1_0_MASK (0x1U) -#define FMUTEST_R_REPAIR1_0_RDIS1_0_SHIFT (0U) -/*! RDIS1_0 - Control Repair 0 in Block 1. - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_R_REPAIR1_0_RDIS1_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR1_0_RDIS1_0_SHIFT)) & FMUTEST_R_REPAIR1_0_RDIS1_0_MASK) - -#define FMUTEST_R_REPAIR1_0_RADR1_0_MASK (0x1FEU) -#define FMUTEST_R_REPAIR1_0_RADR1_0_SHIFT (1U) -/*! RADR1_0 - XADR for Repair 0 in Block 1. */ -#define FMUTEST_R_REPAIR1_0_RADR1_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR1_0_RADR1_0_SHIFT)) & FMUTEST_R_REPAIR1_0_RADR1_0_MASK) -/*! @} */ - -/*! @name R_REPAIR1_1 - BIST Repair 1 Block 1 Register */ -/*! @{ */ - -#define FMUTEST_R_REPAIR1_1_RDIS1_1_MASK (0x1U) -#define FMUTEST_R_REPAIR1_1_RDIS1_1_SHIFT (0U) -/*! RDIS1_1 - Control Repair 1 in Block 1. - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_R_REPAIR1_1_RDIS1_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR1_1_RDIS1_1_SHIFT)) & FMUTEST_R_REPAIR1_1_RDIS1_1_MASK) - -#define FMUTEST_R_REPAIR1_1_RADR1_1_MASK (0x1FEU) -#define FMUTEST_R_REPAIR1_1_RADR1_1_SHIFT (1U) -/*! RADR1_1 - XADR for Repair 1 in Block 1. */ -#define FMUTEST_R_REPAIR1_1_RADR1_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR1_1_RADR1_1_SHIFT)) & FMUTEST_R_REPAIR1_1_RADR1_1_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL0_EX - BIST Data Control 0 Extension Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL0_EX_DATA0X_MASK (0x7U) -#define FMUTEST_R_DATA_CTRL0_EX_DATA0X_SHIFT (0U) -/*! DATA0X - BIST Data 0 High */ -#define FMUTEST_R_DATA_CTRL0_EX_DATA0X(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL0_EX_DATA0X_SHIFT)) & FMUTEST_R_DATA_CTRL0_EX_DATA0X_MASK) -/*! @} */ - -/*! @name R_TIMER_CTRL_EX - BIST Timer Control Extension Register */ -/*! @{ */ - -#define FMUTEST_R_TIMER_CTRL_EX_TLVSDLY_H_MASK (0x7U) -#define FMUTEST_R_TIMER_CTRL_EX_TLVSDLY_H_SHIFT (0U) -/*! TLVSDLY_H - Tlvs Time Delay Scalar High */ -#define FMUTEST_R_TIMER_CTRL_EX_TLVSDLY_H(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_EX_TLVSDLY_H_SHIFT)) & FMUTEST_R_TIMER_CTRL_EX_TLVSDLY_H_MASK) -/*! @} */ - -/*! @name R_DOUT_QUERY1 - BIST DOUT Query 1 Register */ -/*! @{ */ - -#define FMUTEST_R_DOUT_QUERY1_DOUT_MASK (0x7U) -#define FMUTEST_R_DOUT_QUERY1_DOUT_SHIFT (0U) -/*! DOUT - Failing DOUT High */ -#define FMUTEST_R_DOUT_QUERY1_DOUT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DOUT_QUERY1_DOUT_SHIFT)) & FMUTEST_R_DOUT_QUERY1_DOUT_MASK) -/*! @} */ - -/*! @name R_D_MISR1 - BIST DIN MISR 1 Register */ -/*! @{ */ - -#define FMUTEST_R_D_MISR1_DATASIG1_MASK (0xFFU) -#define FMUTEST_R_D_MISR1_DATASIG1_SHIFT (0U) -/*! DATASIG1 - MISR Data Signature High */ -#define FMUTEST_R_D_MISR1_DATASIG1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_D_MISR1_DATASIG1_SHIFT)) & FMUTEST_R_D_MISR1_DATASIG1_MASK) -/*! @} */ - -/*! @name R_A_MISR1 - BIST Address MISR 1 Register */ -/*! @{ */ - -#define FMUTEST_R_A_MISR1_ADRSIG1_MASK (0xFFU) -#define FMUTEST_R_A_MISR1_ADRSIG1_SHIFT (0U) -/*! ADRSIG1 - MISR Address Signature High */ -#define FMUTEST_R_A_MISR1_ADRSIG1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_A_MISR1_ADRSIG1_SHIFT)) & FMUTEST_R_A_MISR1_ADRSIG1_MASK) -/*! @} */ - -/*! @name R_C_MISR1 - BIST Control MISR 1 Register */ -/*! @{ */ - -#define FMUTEST_R_C_MISR1_CTRLSIG1_MASK (0xFFU) -#define FMUTEST_R_C_MISR1_CTRLSIG1_SHIFT (0U) -/*! CTRLSIG1 - MISR Control Signature High */ -#define FMUTEST_R_C_MISR1_CTRLSIG1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_C_MISR1_CTRLSIG1_SHIFT)) & FMUTEST_R_C_MISR1_CTRLSIG1_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL1_EX - BIST Data Control 1 Extension Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL1_EX_DATA1X_MASK (0x7U) -#define FMUTEST_R_DATA_CTRL1_EX_DATA1X_SHIFT (0U) -/*! DATA1X - BIST Data 1 High */ -#define FMUTEST_R_DATA_CTRL1_EX_DATA1X(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL1_EX_DATA1X_SHIFT)) & FMUTEST_R_DATA_CTRL1_EX_DATA1X_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL2_EX - BIST Data Control 2 Extension Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL2_EX_DATA2X_MASK (0x7U) -#define FMUTEST_R_DATA_CTRL2_EX_DATA2X_SHIFT (0U) -/*! DATA2X - BIST Data 2 High */ -#define FMUTEST_R_DATA_CTRL2_EX_DATA2X(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL2_EX_DATA2X_SHIFT)) & FMUTEST_R_DATA_CTRL2_EX_DATA2X_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL3_EX - BIST Data Control 3 Extension Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL3_EX_DATA3X_MASK (0x7U) -#define FMUTEST_R_DATA_CTRL3_EX_DATA3X_SHIFT (0U) -/*! DATA3X - BIST Data 3 High */ -#define FMUTEST_R_DATA_CTRL3_EX_DATA3X(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL3_EX_DATA3X_SHIFT)) & FMUTEST_R_DATA_CTRL3_EX_DATA3X_MASK) -/*! @} */ - -/*! @name SMW_TIMER_OPTION - SMW Timer Option Register */ -/*! @{ */ - -#define FMUTEST_SMW_TIMER_OPTION_SMW_CDIVL_MASK (0xFFU) -#define FMUTEST_SMW_TIMER_OPTION_SMW_CDIVL_SHIFT (0U) -/*! SMW_CDIVL - Clock Divide Scalar for Long Pulse */ -#define FMUTEST_SMW_TIMER_OPTION_SMW_CDIVL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_TIMER_OPTION_SMW_CDIVL_SHIFT)) & FMUTEST_SMW_TIMER_OPTION_SMW_CDIVL_MASK) - -#define FMUTEST_SMW_TIMER_OPTION_SMW_TVFY_MASK (0x1F00U) -#define FMUTEST_SMW_TIMER_OPTION_SMW_TVFY_SHIFT (8U) -/*! SMW_TVFY - Timer Adjust for Verify */ -#define FMUTEST_SMW_TIMER_OPTION_SMW_TVFY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_TIMER_OPTION_SMW_TVFY_SHIFT)) & FMUTEST_SMW_TIMER_OPTION_SMW_TVFY_MASK) -/*! @} */ - -/*! @name SMW_SETTING_OPTION0 - SMW Setting Option 0 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SETTING_OPTION0_MV_INIT_MASK (0x1C000U) -#define FMUTEST_SMW_SETTING_OPTION0_MV_INIT_SHIFT (14U) -/*! MV_INIT - Medium Voltage Level Select Initial */ -#define FMUTEST_SMW_SETTING_OPTION0_MV_INIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION0_MV_INIT_SHIFT)) & FMUTEST_SMW_SETTING_OPTION0_MV_INIT_MASK) - -#define FMUTEST_SMW_SETTING_OPTION0_MV_END_MASK (0xE0000U) -#define FMUTEST_SMW_SETTING_OPTION0_MV_END_SHIFT (17U) -/*! MV_END - Medium Voltage Level Select Final */ -#define FMUTEST_SMW_SETTING_OPTION0_MV_END(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION0_MV_END_SHIFT)) & FMUTEST_SMW_SETTING_OPTION0_MV_END_MASK) - -#define FMUTEST_SMW_SETTING_OPTION0_MV_MISC_MASK (0xF00000U) -#define FMUTEST_SMW_SETTING_OPTION0_MV_MISC_SHIFT (20U) -/*! MV_MISC - Medium Voltage Control Misc */ -#define FMUTEST_SMW_SETTING_OPTION0_MV_MISC(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION0_MV_MISC_SHIFT)) & FMUTEST_SMW_SETTING_OPTION0_MV_MISC_MASK) - -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_INIT_MASK (0x3000000U) -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_INIT_SHIFT (24U) -/*! IPGM_INIT - Program Current Control Initial */ -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_INIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION0_IPGM_INIT_SHIFT)) & FMUTEST_SMW_SETTING_OPTION0_IPGM_INIT_MASK) - -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_END_MASK (0xC000000U) -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_END_SHIFT (26U) -/*! IPGM_END - Program Current Control Final */ -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_END(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION0_IPGM_END_SHIFT)) & FMUTEST_SMW_SETTING_OPTION0_IPGM_END_MASK) - -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_MISC_MASK (0x70000000U) -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_MISC_SHIFT (28U) -/*! IPGM_MISC - Program Current Control Misc */ -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_MISC(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION0_IPGM_MISC_SHIFT)) & FMUTEST_SMW_SETTING_OPTION0_IPGM_MISC_MASK) -/*! @} */ - -/*! @name SMW_SETTING_OPTION2 - SMW Setting Option 2 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SETTING_OPTION2_THVS_CTRL_MASK (0x7U) -#define FMUTEST_SMW_SETTING_OPTION2_THVS_CTRL_SHIFT (0U) -/*! THVS_CTRL - Thvs control */ -#define FMUTEST_SMW_SETTING_OPTION2_THVS_CTRL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_THVS_CTRL_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_THVS_CTRL_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_TRCV_CTRL_MASK (0x38U) -#define FMUTEST_SMW_SETTING_OPTION2_TRCV_CTRL_SHIFT (3U) -/*! TRCV_CTRL - Trcv Control */ -#define FMUTEST_SMW_SETTING_OPTION2_TRCV_CTRL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_TRCV_CTRL_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_TRCV_CTRL_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_XTRA_ERS_MASK (0xC0U) -#define FMUTEST_SMW_SETTING_OPTION2_XTRA_ERS_SHIFT (6U) -/*! XTRA_ERS - Number of Post Shots for SME */ -#define FMUTEST_SMW_SETTING_OPTION2_XTRA_ERS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_XTRA_ERS_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_XTRA_ERS_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_XTRA_PGM_MASK (0x300U) -#define FMUTEST_SMW_SETTING_OPTION2_XTRA_PGM_SHIFT (8U) -/*! XTRA_PGM - Number of Post Shots for SMP */ -#define FMUTEST_SMW_SETTING_OPTION2_XTRA_PGM(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_XTRA_PGM_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_XTRA_PGM_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_WHV_CNTR_MASK (0x3FC00U) -#define FMUTEST_SMW_SETTING_OPTION2_WHV_CNTR_SHIFT (10U) -/*! WHV_CNTR - WHV Counter */ -#define FMUTEST_SMW_SETTING_OPTION2_WHV_CNTR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_WHV_CNTR_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_WHV_CNTR_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_POST_TERS_MASK (0x1C0000U) -#define FMUTEST_SMW_SETTING_OPTION2_POST_TERS_SHIFT (18U) -/*! POST_TERS - Post Ters Time - * 0b000..50 usec - * 0b001..100 usec - * 0b010..200 usec - * 0b011..300 usec - * 0b100..500 usec - * 0b101..1 msec - * 0b110..1.5 msec - * 0b111..2 msec - */ -#define FMUTEST_SMW_SETTING_OPTION2_POST_TERS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_POST_TERS_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_POST_TERS_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_POST_TPGM_MASK (0x600000U) -#define FMUTEST_SMW_SETTING_OPTION2_POST_TPGM_SHIFT (21U) -/*! POST_TPGM - Post Tpgm Time - * 0b00..1 usec - * 0b01..2 usec - * 0b10..4 usec - * 0b11..8 usec - */ -#define FMUTEST_SMW_SETTING_OPTION2_POST_TPGM(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_POST_TPGM_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_POST_TPGM_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_VFY_OPT_MASK (0x1800000U) -#define FMUTEST_SMW_SETTING_OPTION2_VFY_OPT_SHIFT (23U) -/*! VFY_OPT - Verify Option - * 0b00..Skip verify for post shot only, verify for all other shots - * 0b01..Skip verify for the 1st and post shots - * 0b10..Skip the 1st, 2nd, and post shots - * 0b11..Skip verify for all shots - */ -#define FMUTEST_SMW_SETTING_OPTION2_VFY_OPT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_VFY_OPT_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_VFY_OPT_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_TPGM_OPT_MASK (0x6000000U) -#define FMUTEST_SMW_SETTING_OPTION2_TPGM_OPT_SHIFT (25U) -/*! TPGM_OPT - Tpgm Option - * 0b00..Fixed Tpgm for all shots, except post shot - * 0b01..Increase Tpgm option by 1 for each loop until Tpgm reaches 4 usec - * 0b10..Increase Tpgm option by 1 for each loop until Tpgm reaches 8 usec - * 0b11..Unused - */ -#define FMUTEST_SMW_SETTING_OPTION2_TPGM_OPT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_TPGM_OPT_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_TPGM_OPT_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_MASK0_OPT_MASK (0x8000000U) -#define FMUTEST_SMW_SETTING_OPTION2_MASK0_OPT_SHIFT (27U) -/*! MASK0_OPT - MASK0_OPT - * 0b0..Mask programmed bits passing PV until extra shot - * 0b1..Always program bits even if they pass PV - */ -#define FMUTEST_SMW_SETTING_OPTION2_MASK0_OPT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_MASK0_OPT_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_MASK0_OPT_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_DIS_PRER_MASK (0x10000000U) -#define FMUTEST_SMW_SETTING_OPTION2_DIS_PRER_SHIFT (28U) -/*! DIS_PRER - Disable pre-PV Read before First Program Shot - * 0b0..Enable pre-PV read before first program shot - * 0b1..Disable pre-PV read before first program shot - */ -#define FMUTEST_SMW_SETTING_OPTION2_DIS_PRER(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_DIS_PRER_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_DIS_PRER_MASK) -/*! @} */ - -/*! @name SMW_SETTING_OPTION3 - SMW Setting Option 3 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SETTING_OPTION3_HEM_WHV_CNTR_MASK (0xFFU) -#define FMUTEST_SMW_SETTING_OPTION3_HEM_WHV_CNTR_SHIFT (0U) -/*! HEM_WHV_CNTR - WHV_COUNTER for HEM-erase Cycle */ -#define FMUTEST_SMW_SETTING_OPTION3_HEM_WHV_CNTR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION3_HEM_WHV_CNTR_SHIFT)) & FMUTEST_SMW_SETTING_OPTION3_HEM_WHV_CNTR_MASK) - -#define FMUTEST_SMW_SETTING_OPTION3_HEM_MAX_ERS_MASK (0x1FF00U) -#define FMUTEST_SMW_SETTING_OPTION3_HEM_MAX_ERS_SHIFT (8U) -/*! HEM_MAX_ERS - HEM Max Erase Shot Count */ -#define FMUTEST_SMW_SETTING_OPTION3_HEM_MAX_ERS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION3_HEM_MAX_ERS_SHIFT)) & FMUTEST_SMW_SETTING_OPTION3_HEM_MAX_ERS_MASK) -/*! @} */ - -/*! @name SMW_SMP_WHV_OPTION0 - SMW SMP WHV Option 0 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SMP_WHV_OPTION0_SMP_WHV_OPT0_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_SMP_WHV_OPTION0_SMP_WHV_OPT0_SHIFT (0U) -/*! SMP_WHV_OPT0 - Smart Program WHV Option Low */ -#define FMUTEST_SMW_SMP_WHV_OPTION0_SMP_WHV_OPT0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SMP_WHV_OPTION0_SMP_WHV_OPT0_SHIFT)) & FMUTEST_SMW_SMP_WHV_OPTION0_SMP_WHV_OPT0_MASK) -/*! @} */ - -/*! @name SMW_SME_WHV_OPTION0 - SMW SME WHV Option 0 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SME_WHV_OPTION0_SME_WHV_OPT0_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_SME_WHV_OPTION0_SME_WHV_OPT0_SHIFT (0U) -/*! SME_WHV_OPT0 - Smart Erase WHV Option Low */ -#define FMUTEST_SMW_SME_WHV_OPTION0_SME_WHV_OPT0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SME_WHV_OPTION0_SME_WHV_OPT0_SHIFT)) & FMUTEST_SMW_SME_WHV_OPTION0_SME_WHV_OPT0_MASK) -/*! @} */ - -/*! @name SMW_SETTING_OPTION1 - SMW Setting Option 1 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SETTING_OPTION1_TERS_CTRL0_MASK (0x7U) -#define FMUTEST_SMW_SETTING_OPTION1_TERS_CTRL0_SHIFT (0U) -/*! TERS_CTRL0 - Ters Control - * 0b000..50 usec - * 0b001..100 usec - * 0b010..200 usec - * 0b011..300 usec - * 0b100..500 usec - * 0b101..1 msec - * 0b110..1.5 msec - * 0b111..2 msec - */ -#define FMUTEST_SMW_SETTING_OPTION1_TERS_CTRL0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_TERS_CTRL0_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_TERS_CTRL0_MASK) - -#define FMUTEST_SMW_SETTING_OPTION1_TPGM_CTRL_MASK (0x18U) -#define FMUTEST_SMW_SETTING_OPTION1_TPGM_CTRL_SHIFT (3U) -/*! TPGM_CTRL - Tpgm Control - * 0b00..1 usec - * 0b01..2 usec - * 0b10..4 usec - * 0b11..8 usec - */ -#define FMUTEST_SMW_SETTING_OPTION1_TPGM_CTRL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_TPGM_CTRL_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_TPGM_CTRL_MASK) - -#define FMUTEST_SMW_SETTING_OPTION1_TNVS_CTRL_MASK (0xE0U) -#define FMUTEST_SMW_SETTING_OPTION1_TNVS_CTRL_SHIFT (5U) -/*! TNVS_CTRL - Tnvs Control - * 0b000..5 usec - * 0b001..8 usec - * 0b010..11 usec - * 0b011..14 usec - * 0b100..17 usec - * 0b101..20 usec - * 0b110..23 usec - * 0b111..26 usec - */ -#define FMUTEST_SMW_SETTING_OPTION1_TNVS_CTRL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_TNVS_CTRL_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_TNVS_CTRL_MASK) - -#define FMUTEST_SMW_SETTING_OPTION1_TNVH_CTRL_MASK (0x700U) -#define FMUTEST_SMW_SETTING_OPTION1_TNVH_CTRL_SHIFT (8U) -/*! TNVH_CTRL - Tnvh Control - * 0b000..2 usec - * 0b001..2.5 usec - * 0b010..3 usec - * 0b011..3.5 usec - * 0b100..4 usec - * 0b101..4.5 usec - * 0b110..5 usec - * 0b111..5.5 usec - */ -#define FMUTEST_SMW_SETTING_OPTION1_TNVH_CTRL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_TNVH_CTRL_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_TNVH_CTRL_MASK) - -#define FMUTEST_SMW_SETTING_OPTION1_TPGS_CTRL_MASK (0x3800U) -#define FMUTEST_SMW_SETTING_OPTION1_TPGS_CTRL_SHIFT (11U) -/*! TPGS_CTRL - Tpgs Control - * 0b000..1 usec - * 0b001..2 usec - * 0b010..3 usec - * 0b011..4 usec - * 0b100..5 usec - * 0b101..6 usec - * 0b110..7 usec - * 0b111..8 usec - */ -#define FMUTEST_SMW_SETTING_OPTION1_TPGS_CTRL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_TPGS_CTRL_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_TPGS_CTRL_MASK) - -#define FMUTEST_SMW_SETTING_OPTION1_MAX_ERASE_MASK (0x7FC000U) -#define FMUTEST_SMW_SETTING_OPTION1_MAX_ERASE_SHIFT (14U) -/*! MAX_ERASE - Number of Erase Shots */ -#define FMUTEST_SMW_SETTING_OPTION1_MAX_ERASE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_MAX_ERASE_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_MAX_ERASE_MASK) - -#define FMUTEST_SMW_SETTING_OPTION1_MAX_PROG_MASK (0xF800000U) -#define FMUTEST_SMW_SETTING_OPTION1_MAX_PROG_SHIFT (23U) -/*! MAX_PROG - Number of Program Shots */ -#define FMUTEST_SMW_SETTING_OPTION1_MAX_PROG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_MAX_PROG_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_MAX_PROG_MASK) -/*! @} */ - -/*! @name SMW_SMP_WHV_OPTION1 - SMW SMP WHV Option 1 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SMP_WHV_OPTION1_SMP_WHV_OPT1_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_SMP_WHV_OPTION1_SMP_WHV_OPT1_SHIFT (0U) -/*! SMP_WHV_OPT1 - Smart Program WHV Option High */ -#define FMUTEST_SMW_SMP_WHV_OPTION1_SMP_WHV_OPT1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SMP_WHV_OPTION1_SMP_WHV_OPT1_SHIFT)) & FMUTEST_SMW_SMP_WHV_OPTION1_SMP_WHV_OPT1_MASK) -/*! @} */ - -/*! @name SMW_SME_WHV_OPTION1 - SMW SME WHV Option 1 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SME_WHV_OPTION1_SME_WHV_OPT1_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_SME_WHV_OPTION1_SME_WHV_OPT1_SHIFT (0U) -/*! SME_WHV_OPT1 - Smart Erase WHV Option High */ -#define FMUTEST_SMW_SME_WHV_OPTION1_SME_WHV_OPT1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SME_WHV_OPTION1_SME_WHV_OPT1_SHIFT)) & FMUTEST_SMW_SME_WHV_OPTION1_SME_WHV_OPT1_MASK) -/*! @} */ - -/*! @name REPAIR0_0 - FMU Repair 0 Block 0 Register */ -/*! @{ */ - -#define FMUTEST_REPAIR0_0_RDIS0_0_MASK (0x1U) -#define FMUTEST_REPAIR0_0_RDIS0_0_SHIFT (0U) -/*! RDIS0_0 - RDIS0_0 - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_REPAIR0_0_RDIS0_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR0_0_RDIS0_0_SHIFT)) & FMUTEST_REPAIR0_0_RDIS0_0_MASK) - -#define FMUTEST_REPAIR0_0_RADR0_0_MASK (0x1FEU) -#define FMUTEST_REPAIR0_0_RADR0_0_SHIFT (1U) -/*! RADR0_0 - RADR0_0 */ -#define FMUTEST_REPAIR0_0_RADR0_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR0_0_RADR0_0_SHIFT)) & FMUTEST_REPAIR0_0_RADR0_0_MASK) -/*! @} */ - -/*! @name REPAIR0_1 - FMU Repair 1 Block 0 Register */ -/*! @{ */ - -#define FMUTEST_REPAIR0_1_RDIS0_1_MASK (0x1U) -#define FMUTEST_REPAIR0_1_RDIS0_1_SHIFT (0U) -/*! RDIS0_1 - RDIS0_1 - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_REPAIR0_1_RDIS0_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR0_1_RDIS0_1_SHIFT)) & FMUTEST_REPAIR0_1_RDIS0_1_MASK) - -#define FMUTEST_REPAIR0_1_RADR0_1_MASK (0x1FEU) -#define FMUTEST_REPAIR0_1_RADR0_1_SHIFT (1U) -/*! RADR0_1 - RADR0_1 */ -#define FMUTEST_REPAIR0_1_RADR0_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR0_1_RADR0_1_SHIFT)) & FMUTEST_REPAIR0_1_RADR0_1_MASK) -/*! @} */ - -/*! @name REPAIR1_0 - FMU Repair 0 Block 1 Register */ -/*! @{ */ - -#define FMUTEST_REPAIR1_0_RDIS1_0_MASK (0x1U) -#define FMUTEST_REPAIR1_0_RDIS1_0_SHIFT (0U) -/*! RDIS1_0 - RDIS1_0 - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_REPAIR1_0_RDIS1_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR1_0_RDIS1_0_SHIFT)) & FMUTEST_REPAIR1_0_RDIS1_0_MASK) - -#define FMUTEST_REPAIR1_0_RADR1_0_MASK (0x1FEU) -#define FMUTEST_REPAIR1_0_RADR1_0_SHIFT (1U) -/*! RADR1_0 - RADR1_0 */ -#define FMUTEST_REPAIR1_0_RADR1_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR1_0_RADR1_0_SHIFT)) & FMUTEST_REPAIR1_0_RADR1_0_MASK) -/*! @} */ - -/*! @name REPAIR1_1 - FMU Repair 1 Block 1 Register */ -/*! @{ */ - -#define FMUTEST_REPAIR1_1_RDIS1_1_MASK (0x1U) -#define FMUTEST_REPAIR1_1_RDIS1_1_SHIFT (0U) -/*! RDIS1_1 - RDIS1_1 - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_REPAIR1_1_RDIS1_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR1_1_RDIS1_1_SHIFT)) & FMUTEST_REPAIR1_1_RDIS1_1_MASK) - -#define FMUTEST_REPAIR1_1_RADR1_1_MASK (0x1FEU) -#define FMUTEST_REPAIR1_1_RADR1_1_SHIFT (1U) -/*! RADR1_1 - RADR1_1 */ -#define FMUTEST_REPAIR1_1_RADR1_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR1_1_RADR1_1_SHIFT)) & FMUTEST_REPAIR1_1_RADR1_1_MASK) -/*! @} */ - -/*! @name SMW_HB_SIGNALS - SMW HB Signals Register */ -/*! @{ */ - -#define FMUTEST_SMW_HB_SIGNALS_SMW_ARRAY_MASK (0x7U) -#define FMUTEST_SMW_HB_SIGNALS_SMW_ARRAY_SHIFT (0U) -/*! SMW_ARRAY - SMW Region Select - * 0b000..Main array - * 0b001..IFR space only or main (and REDEN space) with IFR space for mass erase - * 0b010..IFR1 space - * 0b100..REDEN space - */ -#define FMUTEST_SMW_HB_SIGNALS_SMW_ARRAY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_SMW_ARRAY_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_SMW_ARRAY_MASK) - -#define FMUTEST_SMW_HB_SIGNALS_USER_IFREN1_MASK (0x8U) -#define FMUTEST_SMW_HB_SIGNALS_USER_IFREN1_SHIFT (3U) -/*! USER_IFREN1 - IFR1 Enable - * 0b0..IFREN1 input to the flash array is driven LOW - * 0b1..IFREN1 input to the flash array is driven HIGH - */ -#define FMUTEST_SMW_HB_SIGNALS_USER_IFREN1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_USER_IFREN1_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_USER_IFREN1_MASK) - -#define FMUTEST_SMW_HB_SIGNALS_USER_PV_MASK (0x10U) -#define FMUTEST_SMW_HB_SIGNALS_USER_PV_SHIFT (4U) -/*! USER_PV - Program Verify - * 0b0..PV input to the flash array is driven LOW - * 0b1..PV input to the flash array is driven HIGH - */ -#define FMUTEST_SMW_HB_SIGNALS_USER_PV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_USER_PV_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_USER_PV_MASK) - -#define FMUTEST_SMW_HB_SIGNALS_USER_EV_MASK (0x20U) -#define FMUTEST_SMW_HB_SIGNALS_USER_EV_SHIFT (5U) -/*! USER_EV - Erase Verify - * 0b0..EV input to the flash array is driven LOW - * 0b1..EV input to the flash array is driven HIGH - */ -#define FMUTEST_SMW_HB_SIGNALS_USER_EV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_USER_EV_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_USER_EV_MASK) - -#define FMUTEST_SMW_HB_SIGNALS_USER_IFREN_MASK (0x40U) -#define FMUTEST_SMW_HB_SIGNALS_USER_IFREN_SHIFT (6U) -/*! USER_IFREN - IFR Enable - * 0b0..IFREN input to the flash array is driven LOW - * 0b1..IFREN input to the flash array is driven HIGH - */ -#define FMUTEST_SMW_HB_SIGNALS_USER_IFREN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_USER_IFREN_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_USER_IFREN_MASK) - -#define FMUTEST_SMW_HB_SIGNALS_USER_REDEN_MASK (0x80U) -#define FMUTEST_SMW_HB_SIGNALS_USER_REDEN_SHIFT (7U) -/*! USER_REDEN - Repair Read Enable - * 0b0..REDEN input to the flash array is driven LOW - * 0b1..REDEN input to the flash array is driven HIGH - */ -#define FMUTEST_SMW_HB_SIGNALS_USER_REDEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_USER_REDEN_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_USER_REDEN_MASK) - -#define FMUTEST_SMW_HB_SIGNALS_USER_HEM_MASK (0x100U) -#define FMUTEST_SMW_HB_SIGNALS_USER_HEM_SHIFT (8U) -/*! USER_HEM - High Endurance Enable - * 0b0..HEM input to SMW / BIST PIN_CTRL[24] is driven LOW - * 0b1..HEM input to SMW / BIST PIN_CTRL[24] is driven HIGH - */ -#define FMUTEST_SMW_HB_SIGNALS_USER_HEM(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_USER_HEM_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_USER_HEM_MASK) -/*! @} */ - -/*! @name BIST_DUMP_CTRL - BIST Datadump Control Register */ -/*! @{ */ - -#define FMUTEST_BIST_DUMP_CTRL_BIST_DONE_MASK (0x10000U) -#define FMUTEST_BIST_DUMP_CTRL_BIST_DONE_SHIFT (16U) -/*! BIST_DONE - BIST Done - * 0b0..The BIST (or data dump) is running - * 0b1..The BIST (or data dump) has completed - */ -#define FMUTEST_BIST_DUMP_CTRL_BIST_DONE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_BIST_DONE_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_BIST_DONE_MASK) - -#define FMUTEST_BIST_DUMP_CTRL_BIST_FAIL_MASK (0x20000U) -#define FMUTEST_BIST_DUMP_CTRL_BIST_FAIL_SHIFT (17U) -/*! BIST_FAIL - BIST Fail - * 0b0..The last BIST operation completed successfully (or could not fail) - * 0b1..The last BIST operation failed - */ -#define FMUTEST_BIST_DUMP_CTRL_BIST_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_BIST_FAIL_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_BIST_FAIL_MASK) - -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MASK (0x40000U) -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_SHIFT (18U) -/*! DATADUMP - Data Dump Enable */ -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_DATADUMP_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_DATADUMP_MASK) - -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_TRIG_MASK (0x80000U) -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_TRIG_SHIFT (19U) -/*! DATADUMP_TRIG - Data Dump Trigger */ -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_TRIG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_DATADUMP_TRIG_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_DATADUMP_TRIG_MASK) - -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_PATT_MASK (0x300000U) -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_PATT_SHIFT (20U) -/*! DATADUMP_PATT - Data Dump Pattern Select - * 0b00..All ones - * 0b01..All zeroes - * 0b10..Checkerboard - * 0b11..Inverse checkerboard - */ -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_PATT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_DATADUMP_PATT_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_DATADUMP_PATT_MASK) - -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGEN_MASK (0x400000U) -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGEN_SHIFT (22U) -/*! DATADUMP_MRGEN - Data Dump Margin Enable - * 0b0..Normal read pulse shape - * 0b1..Margin read pulse shape - */ -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGEN_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGEN_MASK) - -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGTYPE_MASK (0x800000U) -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGTYPE_SHIFT (23U) -/*! DATADUMP_MRGTYPE - Data Dump Margin Type - * 0b0..DIN method used - * 0b1..TM method used - */ -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGTYPE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGTYPE_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGTYPE_MASK) -/*! @} */ - -/*! @name ATX_PIN_CTRL - ATX Pin Control Register */ -/*! @{ */ - -#define FMUTEST_ATX_PIN_CTRL_TM_TO_ATX_MASK (0xFFU) -#define FMUTEST_ATX_PIN_CTRL_TM_TO_ATX_SHIFT (0U) -/*! TM_TO_ATX - TM to ATX - * 0b00000001..TM[0] to ATX0 - * 0b00000010..TM[1] to ATX0 - * 0b00000100..TM[2] to ATX0 - * 0b00001000..TM[3] to ATX0 - * 0b00010000..TM[0] to ATX1 - * 0b00100000..TM[1] to ATX1 - * 0b01000000..TM[2] to ATX1 - * 0b10000000..TM[3] to ATX1 - */ -#define FMUTEST_ATX_PIN_CTRL_TM_TO_ATX(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_ATX_PIN_CTRL_TM_TO_ATX_SHIFT)) & FMUTEST_ATX_PIN_CTRL_TM_TO_ATX_MASK) -/*! @} */ - -/*! @name FAILCNT - Fail Count Register */ -/*! @{ */ - -#define FMUTEST_FAILCNT_FAILCNT_MASK (0xFFFFFFFFU) -#define FMUTEST_FAILCNT_FAILCNT_SHIFT (0U) -/*! FAILCNT - Fail Count */ -#define FMUTEST_FAILCNT_FAILCNT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FAILCNT_FAILCNT_SHIFT)) & FMUTEST_FAILCNT_FAILCNT_MASK) -/*! @} */ - -/*! @name PGM_PULSE_CNT0 - Block 0 Program Pulse Count Register */ -/*! @{ */ - -#define FMUTEST_PGM_PULSE_CNT0_PGM_CNT0_MASK (0xFFFFFFFFU) -#define FMUTEST_PGM_PULSE_CNT0_PGM_CNT0_SHIFT (0U) -/*! PGM_CNT0 - Program Pulse Count */ -#define FMUTEST_PGM_PULSE_CNT0_PGM_CNT0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PGM_PULSE_CNT0_PGM_CNT0_SHIFT)) & FMUTEST_PGM_PULSE_CNT0_PGM_CNT0_MASK) -/*! @} */ - -/*! @name PGM_PULSE_CNT1 - Block 1 Program Pulse Count Register */ -/*! @{ */ - -#define FMUTEST_PGM_PULSE_CNT1_PGM_CNT1_MASK (0xFFFFFFFFU) -#define FMUTEST_PGM_PULSE_CNT1_PGM_CNT1_SHIFT (0U) -/*! PGM_CNT1 - Program Pulse Count */ -#define FMUTEST_PGM_PULSE_CNT1_PGM_CNT1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PGM_PULSE_CNT1_PGM_CNT1_SHIFT)) & FMUTEST_PGM_PULSE_CNT1_PGM_CNT1_MASK) -/*! @} */ - -/*! @name ERS_PULSE_CNT - Erase Pulse Count Register */ -/*! @{ */ - -#define FMUTEST_ERS_PULSE_CNT_ERS_CNT0_MASK (0xFFFFU) -#define FMUTEST_ERS_PULSE_CNT_ERS_CNT0_SHIFT (0U) -/*! ERS_CNT0 - Block 0 Erase Pulse Count */ -#define FMUTEST_ERS_PULSE_CNT_ERS_CNT0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_ERS_PULSE_CNT_ERS_CNT0_SHIFT)) & FMUTEST_ERS_PULSE_CNT_ERS_CNT0_MASK) - -#define FMUTEST_ERS_PULSE_CNT_ERS_CNT1_MASK (0xFFFF0000U) -#define FMUTEST_ERS_PULSE_CNT_ERS_CNT1_SHIFT (16U) -/*! ERS_CNT1 - Block 1 Erase Pulse Count */ -#define FMUTEST_ERS_PULSE_CNT_ERS_CNT1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_ERS_PULSE_CNT_ERS_CNT1_SHIFT)) & FMUTEST_ERS_PULSE_CNT_ERS_CNT1_MASK) -/*! @} */ - -/*! @name MAX_PULSE_CNT - Maximum Pulse Count Register */ -/*! @{ */ - -#define FMUTEST_MAX_PULSE_CNT_LAST_PCNT_MASK (0x1FFU) -#define FMUTEST_MAX_PULSE_CNT_LAST_PCNT_SHIFT (0U) -/*! LAST_PCNT - Last SMW Operation's Pulse Count */ -#define FMUTEST_MAX_PULSE_CNT_LAST_PCNT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MAX_PULSE_CNT_LAST_PCNT_SHIFT)) & FMUTEST_MAX_PULSE_CNT_LAST_PCNT_MASK) - -#define FMUTEST_MAX_PULSE_CNT_MAX_ERS_CNT_MASK (0x1FF0000U) -#define FMUTEST_MAX_PULSE_CNT_MAX_ERS_CNT_SHIFT (16U) -/*! MAX_ERS_CNT - Maximum Erase Pulse Count */ -#define FMUTEST_MAX_PULSE_CNT_MAX_ERS_CNT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MAX_PULSE_CNT_MAX_ERS_CNT_SHIFT)) & FMUTEST_MAX_PULSE_CNT_MAX_ERS_CNT_MASK) - -#define FMUTEST_MAX_PULSE_CNT_MAX_PGM_CNT_MASK (0xF8000000U) -#define FMUTEST_MAX_PULSE_CNT_MAX_PGM_CNT_SHIFT (27U) -/*! MAX_PGM_CNT - Maximum Program Pulse Count */ -#define FMUTEST_MAX_PULSE_CNT_MAX_PGM_CNT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MAX_PULSE_CNT_MAX_PGM_CNT_SHIFT)) & FMUTEST_MAX_PULSE_CNT_MAX_PGM_CNT_MASK) -/*! @} */ - -/*! @name PORT_CTRL - Port Control Register */ -/*! @{ */ - -#define FMUTEST_PORT_CTRL_BDONE_SEL_MASK (0x3U) -#define FMUTEST_PORT_CTRL_BDONE_SEL_SHIFT (0U) -/*! BDONE_SEL - BIST Done Select - * 0b00..Select internal bist_done signal from current module instantiation - * 0b01..Select ipt_bist_fail signal from current module instantiation - * 0b10..Select ipt_bist_done signal from other module instantiation - * 0b11..Select AND of internal bist_done signal from current module instantiation with ipt_bist_done signal from other module instantiation - */ -#define FMUTEST_PORT_CTRL_BDONE_SEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PORT_CTRL_BDONE_SEL_SHIFT)) & FMUTEST_PORT_CTRL_BDONE_SEL_MASK) - -#define FMUTEST_PORT_CTRL_BSDO_SEL_MASK (0xCU) -#define FMUTEST_PORT_CTRL_BSDO_SEL_SHIFT (2U) -/*! BSDO_SEL - BIST Serial Data Output Select - * 0b00..Select internal bist_sdo signal from current module instantiation - * 0b01..Select ipt_bist_done signal from current module instantiation - * 0b10..Select ipt_bist_sdo signal from other module instantiation - * 0b11..Select ipt_bist_done signal from other module instantiation - */ -#define FMUTEST_PORT_CTRL_BSDO_SEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PORT_CTRL_BSDO_SEL_SHIFT)) & FMUTEST_PORT_CTRL_BSDO_SEL_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group FMUTEST_Register_Masks */ - - -/* FMUTEST - Peripheral instance base addresses */ -/** Peripheral FMU0TEST base address */ -#define FMU0TEST_BASE (0x40096000u) -/** Peripheral FMU0TEST base pointer */ -#define FMU0TEST ((FMUTEST_Type *)FMU0TEST_BASE) -/** Array initializer of FMUTEST peripheral base addresses */ -#define FMUTEST_BASE_ADDRS { FMU0TEST_BASE } -/** Array initializer of FMUTEST peripheral base pointers */ -#define FMUTEST_BASE_PTRS { FMU0TEST } - -/*! - * @} - */ /* end of group FMUTEST_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- FREQME Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FREQME_Peripheral_Access_Layer FREQME Peripheral Access Layer - * @{ - */ - -/** FREQME - Register Layout Typedef */ -typedef struct { - union { /* offset: 0x0 */ - __I uint32_t CTRL_R; /**< Control (in Read mode), offset: 0x0 */ - __O uint32_t CTRL_W; /**< Control (in Write mode), offset: 0x0 */ - }; - __IO uint32_t CTRLSTAT; /**< Control Status, offset: 0x4 */ - __IO uint32_t MIN; /**< Minimum, offset: 0x8 */ - __IO uint32_t MAX; /**< Maximum, offset: 0xC */ -} FREQME_Type; - -/* ---------------------------------------------------------------------------- - -- FREQME Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FREQME_Register_Masks FREQME Register Masks - * @{ - */ - -/*! @name CTRL_R - Control (in Read mode) */ -/*! @{ */ - -#define FREQME_CTRL_R_RESULT_MASK (0x7FFFFFFFU) -#define FREQME_CTRL_R_RESULT_SHIFT (0U) -#define FREQME_CTRL_R_RESULT(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_R_RESULT_SHIFT)) & FREQME_CTRL_R_RESULT_MASK) - -#define FREQME_CTRL_R_MEASURE_IN_PROGRESS_MASK (0x80000000U) -#define FREQME_CTRL_R_MEASURE_IN_PROGRESS_SHIFT (31U) -/*! MEASURE_IN_PROGRESS - Measurement In Progress - * 0b0..Complete - * 0b1..In progress - */ -#define FREQME_CTRL_R_MEASURE_IN_PROGRESS(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_R_MEASURE_IN_PROGRESS_SHIFT)) & FREQME_CTRL_R_MEASURE_IN_PROGRESS_MASK) -/*! @} */ - -/*! @name CTRL_W - Control (in Write mode) */ -/*! @{ */ - -#define FREQME_CTRL_W_REF_SCALE_MASK (0x1FU) -#define FREQME_CTRL_W_REF_SCALE_SHIFT (0U) -/*! REF_SCALE - Reference Clock Scaling Factor */ -#define FREQME_CTRL_W_REF_SCALE(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_REF_SCALE_SHIFT)) & FREQME_CTRL_W_REF_SCALE_MASK) - -#define FREQME_CTRL_W_PULSE_MODE_MASK (0x100U) -#define FREQME_CTRL_W_PULSE_MODE_SHIFT (8U) -/*! PULSE_MODE - Pulse Width Measurement Mode Select - * 0b0..Frequency Measurement mode - * 0b1..Pulse Width Measurement mode - */ -#define FREQME_CTRL_W_PULSE_MODE(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_PULSE_MODE_SHIFT)) & FREQME_CTRL_W_PULSE_MODE_MASK) - -#define FREQME_CTRL_W_PULSE_POL_MASK (0x200U) -#define FREQME_CTRL_W_PULSE_POL_SHIFT (9U) -/*! PULSE_POL - Pulse Polarity - * 0b0..High period - * 0b1..Low period - */ -#define FREQME_CTRL_W_PULSE_POL(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_PULSE_POL_SHIFT)) & FREQME_CTRL_W_PULSE_POL_MASK) - -#define FREQME_CTRL_W_LT_MIN_INT_EN_MASK (0x1000U) -#define FREQME_CTRL_W_LT_MIN_INT_EN_SHIFT (12U) -/*! LT_MIN_INT_EN - Less Than Minimum Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FREQME_CTRL_W_LT_MIN_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_LT_MIN_INT_EN_SHIFT)) & FREQME_CTRL_W_LT_MIN_INT_EN_MASK) - -#define FREQME_CTRL_W_GT_MAX_INT_EN_MASK (0x2000U) -#define FREQME_CTRL_W_GT_MAX_INT_EN_SHIFT (13U) -/*! GT_MAX_INT_EN - Greater Than Maximum Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FREQME_CTRL_W_GT_MAX_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_GT_MAX_INT_EN_SHIFT)) & FREQME_CTRL_W_GT_MAX_INT_EN_MASK) - -#define FREQME_CTRL_W_RESULT_READY_INT_EN_MASK (0x4000U) -#define FREQME_CTRL_W_RESULT_READY_INT_EN_SHIFT (14U) -/*! RESULT_READY_INT_EN - Result Ready Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FREQME_CTRL_W_RESULT_READY_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_RESULT_READY_INT_EN_SHIFT)) & FREQME_CTRL_W_RESULT_READY_INT_EN_MASK) - -#define FREQME_CTRL_W_CONTINUOUS_MODE_EN_MASK (0x40000000U) -#define FREQME_CTRL_W_CONTINUOUS_MODE_EN_SHIFT (30U) -/*! CONTINUOUS_MODE_EN - Continuous Mode Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FREQME_CTRL_W_CONTINUOUS_MODE_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_CONTINUOUS_MODE_EN_SHIFT)) & FREQME_CTRL_W_CONTINUOUS_MODE_EN_MASK) - -#define FREQME_CTRL_W_MEASURE_IN_PROGRESS_MASK (0x80000000U) -#define FREQME_CTRL_W_MEASURE_IN_PROGRESS_SHIFT (31U) -/*! MEASURE_IN_PROGRESS - Measurement In Progress - * 0b0..Terminates measurement - * 0b1..Initiates measurement - */ -#define FREQME_CTRL_W_MEASURE_IN_PROGRESS(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_MEASURE_IN_PROGRESS_SHIFT)) & FREQME_CTRL_W_MEASURE_IN_PROGRESS_MASK) -/*! @} */ - -/*! @name CTRLSTAT - Control Status */ -/*! @{ */ - -#define FREQME_CTRLSTAT_REF_SCALE_MASK (0x1FU) -#define FREQME_CTRLSTAT_REF_SCALE_SHIFT (0U) -/*! REF_SCALE - Reference Scale */ -#define FREQME_CTRLSTAT_REF_SCALE(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_REF_SCALE_SHIFT)) & FREQME_CTRLSTAT_REF_SCALE_MASK) - -#define FREQME_CTRLSTAT_PULSE_MODE_MASK (0x100U) -#define FREQME_CTRLSTAT_PULSE_MODE_SHIFT (8U) -/*! PULSE_MODE - Pulse Mode - * 0b0..Frequency Measurement mode - * 0b1..Pulse Width Measurement mode - */ -#define FREQME_CTRLSTAT_PULSE_MODE(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_PULSE_MODE_SHIFT)) & FREQME_CTRLSTAT_PULSE_MODE_MASK) - -#define FREQME_CTRLSTAT_PULSE_POL_MASK (0x200U) -#define FREQME_CTRLSTAT_PULSE_POL_SHIFT (9U) -/*! PULSE_POL - Pulse Polarity - * 0b0..High period - * 0b1..Low period - */ -#define FREQME_CTRLSTAT_PULSE_POL(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_PULSE_POL_SHIFT)) & FREQME_CTRLSTAT_PULSE_POL_MASK) - -#define FREQME_CTRLSTAT_LT_MIN_INT_EN_MASK (0x1000U) -#define FREQME_CTRLSTAT_LT_MIN_INT_EN_SHIFT (12U) -/*! LT_MIN_INT_EN - Less Than Minimum Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define FREQME_CTRLSTAT_LT_MIN_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_LT_MIN_INT_EN_SHIFT)) & FREQME_CTRLSTAT_LT_MIN_INT_EN_MASK) - -#define FREQME_CTRLSTAT_GT_MAX_INT_EN_MASK (0x2000U) -#define FREQME_CTRLSTAT_GT_MAX_INT_EN_SHIFT (13U) -/*! GT_MAX_INT_EN - Greater Than Maximum Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define FREQME_CTRLSTAT_GT_MAX_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_GT_MAX_INT_EN_SHIFT)) & FREQME_CTRLSTAT_GT_MAX_INT_EN_MASK) - -#define FREQME_CTRLSTAT_RESULT_READY_INT_EN_MASK (0x4000U) -#define FREQME_CTRLSTAT_RESULT_READY_INT_EN_SHIFT (14U) -/*! RESULT_READY_INT_EN - Result Ready Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define FREQME_CTRLSTAT_RESULT_READY_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_RESULT_READY_INT_EN_SHIFT)) & FREQME_CTRLSTAT_RESULT_READY_INT_EN_MASK) - -#define FREQME_CTRLSTAT_LT_MIN_STAT_MASK (0x1000000U) -#define FREQME_CTRLSTAT_LT_MIN_STAT_SHIFT (24U) -/*! LT_MIN_STAT - Less Than Minimum Results Status - * 0b0..Greater than MIN[MIN_VALUE] - * 0b1..Less than MIN[MIN_VALUE] - */ -#define FREQME_CTRLSTAT_LT_MIN_STAT(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_LT_MIN_STAT_SHIFT)) & FREQME_CTRLSTAT_LT_MIN_STAT_MASK) - -#define FREQME_CTRLSTAT_GT_MAX_STAT_MASK (0x2000000U) -#define FREQME_CTRLSTAT_GT_MAX_STAT_SHIFT (25U) -/*! GT_MAX_STAT - Greater Than Maximum Result Status - * 0b0..Less than MAX[MAX_VALUE] - * 0b1..Greater than MAX[MAX_VALUE] - */ -#define FREQME_CTRLSTAT_GT_MAX_STAT(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_GT_MAX_STAT_SHIFT)) & FREQME_CTRLSTAT_GT_MAX_STAT_MASK) - -#define FREQME_CTRLSTAT_RESULT_READY_STAT_MASK (0x4000000U) -#define FREQME_CTRLSTAT_RESULT_READY_STAT_SHIFT (26U) -/*! RESULT_READY_STAT - Result Ready Status - * 0b0..Not complete - * 0b1..Complete - */ -#define FREQME_CTRLSTAT_RESULT_READY_STAT(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_RESULT_READY_STAT_SHIFT)) & FREQME_CTRLSTAT_RESULT_READY_STAT_MASK) - -#define FREQME_CTRLSTAT_CONTINUOUS_MODE_EN_MASK (0x40000000U) -#define FREQME_CTRLSTAT_CONTINUOUS_MODE_EN_SHIFT (30U) -/*! CONTINUOUS_MODE_EN - Continuous Mode Enable Status - * 0b0..Disabled - * 0b1..Enabled - */ -#define FREQME_CTRLSTAT_CONTINUOUS_MODE_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_CONTINUOUS_MODE_EN_SHIFT)) & FREQME_CTRLSTAT_CONTINUOUS_MODE_EN_MASK) - -#define FREQME_CTRLSTAT_MEASURE_IN_PROGRESS_MASK (0x80000000U) -#define FREQME_CTRLSTAT_MEASURE_IN_PROGRESS_SHIFT (31U) -/*! MEASURE_IN_PROGRESS - Measurement in Progress Status - * 0b0..Not in progress - * 0b1..In progress - */ -#define FREQME_CTRLSTAT_MEASURE_IN_PROGRESS(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_MEASURE_IN_PROGRESS_SHIFT)) & FREQME_CTRLSTAT_MEASURE_IN_PROGRESS_MASK) -/*! @} */ - -/*! @name MIN - Minimum */ -/*! @{ */ - -#define FREQME_MIN_MIN_VALUE_MASK (0x7FFFFFFFU) -#define FREQME_MIN_MIN_VALUE_SHIFT (0U) -/*! MIN_VALUE - Minimum Value */ -#define FREQME_MIN_MIN_VALUE(x) (((uint32_t)(((uint32_t)(x)) << FREQME_MIN_MIN_VALUE_SHIFT)) & FREQME_MIN_MIN_VALUE_MASK) -/*! @} */ - -/*! @name MAX - Maximum */ -/*! @{ */ - -#define FREQME_MAX_MAX_VALUE_MASK (0x7FFFFFFFU) -#define FREQME_MAX_MAX_VALUE_SHIFT (0U) -/*! MAX_VALUE - Maximum Value */ -#define FREQME_MAX_MAX_VALUE(x) (((uint32_t)(((uint32_t)(x)) << FREQME_MAX_MAX_VALUE_SHIFT)) & FREQME_MAX_MAX_VALUE_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group FREQME_Register_Masks */ - - -/* FREQME - Peripheral instance base addresses */ -/** Peripheral FREQME0 base address */ -#define FREQME0_BASE (0x40009000u) -/** Peripheral FREQME0 base pointer */ -#define FREQME0 ((FREQME_Type *)FREQME0_BASE) -/** Array initializer of FREQME peripheral base addresses */ -#define FREQME_BASE_ADDRS { FREQME0_BASE } -/** Array initializer of FREQME peripheral base pointers */ -#define FREQME_BASE_PTRS { FREQME0 } - -/*! - * @} - */ /* end of group FREQME_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- GLIKEY Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup GLIKEY_Peripheral_Access_Layer GLIKEY Peripheral Access Layer - * @{ - */ - -/** GLIKEY - Register Layout Typedef */ -typedef struct { - __IO uint32_t CTRL_0; /**< Control Register 0 SFR, offset: 0x0 */ - __IO uint32_t CTRL_1; /**< Control Regsiter 1 SFR, offset: 0x4 */ - __IO uint32_t INTR_CTRL; /**< Interrupt Control, offset: 0x8 */ - __I uint32_t STATUS; /**< Status, offset: 0xC */ - uint8_t RESERVED_0[236]; - __I uint32_t VERSION; /**< IP Version, offset: 0xFC */ -} GLIKEY_Type; - -/* ---------------------------------------------------------------------------- - -- GLIKEY Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup GLIKEY_Register_Masks GLIKEY Register Masks - * @{ - */ - -/*! @name CTRL_0 - Control Register 0 SFR */ -/*! @{ */ - -#define GLIKEY_CTRL_0_WRITE_INDEX_MASK (0xFFU) -#define GLIKEY_CTRL_0_WRITE_INDEX_SHIFT (0U) -/*! WRITE_INDEX - Write Index */ -#define GLIKEY_CTRL_0_WRITE_INDEX(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_CTRL_0_WRITE_INDEX_SHIFT)) & GLIKEY_CTRL_0_WRITE_INDEX_MASK) - -#define GLIKEY_CTRL_0_RESERVED15_MASK (0xFF00U) -#define GLIKEY_CTRL_0_RESERVED15_SHIFT (8U) -/*! RESERVED15 - Reserved for Future Use */ -#define GLIKEY_CTRL_0_RESERVED15(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_CTRL_0_RESERVED15_SHIFT)) & GLIKEY_CTRL_0_RESERVED15_MASK) - -#define GLIKEY_CTRL_0_WR_EN_0_MASK (0x30000U) -#define GLIKEY_CTRL_0_WR_EN_0_SHIFT (16U) -/*! WR_EN_0 - Write Enable 0 */ -#define GLIKEY_CTRL_0_WR_EN_0(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_CTRL_0_WR_EN_0_SHIFT)) & GLIKEY_CTRL_0_WR_EN_0_MASK) - -#define GLIKEY_CTRL_0_SFT_RST_MASK (0x40000U) -#define GLIKEY_CTRL_0_SFT_RST_SHIFT (18U) -/*! SFT_RST - Soft reset for the core reset (SFR configuration will be preseved).This register reads as 0 - * 0b0..No effect - * 0b1..Triggers the soft reset - */ -#define GLIKEY_CTRL_0_SFT_RST(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_CTRL_0_SFT_RST_SHIFT)) & GLIKEY_CTRL_0_SFT_RST_MASK) - -#define GLIKEY_CTRL_0_RESERVED31_MASK (0xFFF80000U) -#define GLIKEY_CTRL_0_RESERVED31_SHIFT (19U) -/*! RESERVED31 - Reserved for Future Use */ -#define GLIKEY_CTRL_0_RESERVED31(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_CTRL_0_RESERVED31_SHIFT)) & GLIKEY_CTRL_0_RESERVED31_MASK) -/*! @} */ - -/*! @name CTRL_1 - Control Regsiter 1 SFR */ -/*! @{ */ - -#define GLIKEY_CTRL_1_READ_INDEX_MASK (0xFFU) -#define GLIKEY_CTRL_1_READ_INDEX_SHIFT (0U) -/*! READ_INDEX - Index status, Writing an index value to this register will request the block to return the lock status of this index. */ -#define GLIKEY_CTRL_1_READ_INDEX(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_CTRL_1_READ_INDEX_SHIFT)) & GLIKEY_CTRL_1_READ_INDEX_MASK) - -#define GLIKEY_CTRL_1_RESERVED15_MASK (0xFF00U) -#define GLIKEY_CTRL_1_RESERVED15_SHIFT (8U) -/*! RESERVED15 - Reserved for Future Use */ -#define GLIKEY_CTRL_1_RESERVED15(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_CTRL_1_RESERVED15_SHIFT)) & GLIKEY_CTRL_1_RESERVED15_MASK) - -#define GLIKEY_CTRL_1_WR_EN_1_MASK (0x30000U) -#define GLIKEY_CTRL_1_WR_EN_1_SHIFT (16U) -/*! WR_EN_1 - Write Enable One */ -#define GLIKEY_CTRL_1_WR_EN_1(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_CTRL_1_WR_EN_1_SHIFT)) & GLIKEY_CTRL_1_WR_EN_1_MASK) - -#define GLIKEY_CTRL_1_SFR_LOCK_MASK (0x3C0000U) -#define GLIKEY_CTRL_1_SFR_LOCK_SHIFT (18U) -/*! SFR_LOCK - LOCK register for GLIKEY */ -#define GLIKEY_CTRL_1_SFR_LOCK(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_CTRL_1_SFR_LOCK_SHIFT)) & GLIKEY_CTRL_1_SFR_LOCK_MASK) - -#define GLIKEY_CTRL_1_RESERVED31_MASK (0xFFC00000U) -#define GLIKEY_CTRL_1_RESERVED31_SHIFT (22U) -/*! RESERVED31 - Reserved for Future Use */ -#define GLIKEY_CTRL_1_RESERVED31(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_CTRL_1_RESERVED31_SHIFT)) & GLIKEY_CTRL_1_RESERVED31_MASK) -/*! @} */ - -/*! @name INTR_CTRL - Interrupt Control */ -/*! @{ */ - -#define GLIKEY_INTR_CTRL_INT_EN_MASK (0x1U) -#define GLIKEY_INTR_CTRL_INT_EN_SHIFT (0U) -/*! INT_EN - Interrupt Enable. Writing a 1, Interrupt asserts on Interrupt output port */ -#define GLIKEY_INTR_CTRL_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_INTR_CTRL_INT_EN_SHIFT)) & GLIKEY_INTR_CTRL_INT_EN_MASK) - -#define GLIKEY_INTR_CTRL_INT_CLR_MASK (0x2U) -#define GLIKEY_INTR_CTRL_INT_CLR_SHIFT (1U) -/*! INT_CLR - Interrupt Clear. Writing a 1 to this register creates a single interrupt clear pulse. This register reads as 0 */ -#define GLIKEY_INTR_CTRL_INT_CLR(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_INTR_CTRL_INT_CLR_SHIFT)) & GLIKEY_INTR_CTRL_INT_CLR_MASK) - -#define GLIKEY_INTR_CTRL_INT_SET_MASK (0x4U) -#define GLIKEY_INTR_CTRL_INT_SET_SHIFT (2U) -/*! INT_SET - Interrupt Set. Writing a 1 to this register asserts the interrupt. This register reads as 0 - * 0b0..No effect - * 0b1..Triggers interrupt - */ -#define GLIKEY_INTR_CTRL_INT_SET(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_INTR_CTRL_INT_SET_SHIFT)) & GLIKEY_INTR_CTRL_INT_SET_MASK) - -#define GLIKEY_INTR_CTRL_RESERVED31_MASK (0xFFFFFFF8U) -#define GLIKEY_INTR_CTRL_RESERVED31_SHIFT (3U) -/*! RESERVED31 - Reserved for Future Use */ -#define GLIKEY_INTR_CTRL_RESERVED31(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_INTR_CTRL_RESERVED31_SHIFT)) & GLIKEY_INTR_CTRL_RESERVED31_MASK) -/*! @} */ - -/*! @name STATUS - Status */ -/*! @{ */ - -#define GLIKEY_STATUS_INT_STATUS_MASK (0x1U) -#define GLIKEY_STATUS_INT_STATUS_SHIFT (0U) -/*! INT_STATUS - Interrupt Status. - * 0b0..No effect - * 0b1..Triggers interrupt - */ -#define GLIKEY_STATUS_INT_STATUS(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_STATUS_INT_STATUS_SHIFT)) & GLIKEY_STATUS_INT_STATUS_MASK) - -#define GLIKEY_STATUS_LOCK_STATUS_MASK (0x2U) -#define GLIKEY_STATUS_LOCK_STATUS_SHIFT (1U) -/*! LOCK_STATUS - Provides the current lock status of indexes. - * 0b0..Current read index is not locked - * 0b1..Current read index is locked - */ -#define GLIKEY_STATUS_LOCK_STATUS(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_STATUS_LOCK_STATUS_SHIFT)) & GLIKEY_STATUS_LOCK_STATUS_MASK) - -#define GLIKEY_STATUS_ERROR_STATUS_MASK (0x1CU) -#define GLIKEY_STATUS_ERROR_STATUS_SHIFT (2U) -/*! ERROR_STATUS - Status of the Error - * 0b000..No error - * 0b001..FSM error has occurred - * 0b010..Write index out of the bound (OOB) error - * 0b011..Write index OOB and FSM error - * 0b100..Read index OOB error - * 0b110..Write index and read index OOB error - * 0b111..Read index OOB, write index OOB, and FSM error - */ -#define GLIKEY_STATUS_ERROR_STATUS(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_STATUS_ERROR_STATUS_SHIFT)) & GLIKEY_STATUS_ERROR_STATUS_MASK) - -#define GLIKEY_STATUS_RESERVED18_MASK (0x7FFE0U) -#define GLIKEY_STATUS_RESERVED18_SHIFT (5U) -/*! RESERVED18 - Reserved for Future Use */ -#define GLIKEY_STATUS_RESERVED18(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_STATUS_RESERVED18_SHIFT)) & GLIKEY_STATUS_RESERVED18_MASK) - -#define GLIKEY_STATUS_FSM_STATE_MASK (0xFFF80000U) -#define GLIKEY_STATUS_FSM_STATE_SHIFT (19U) -/*! FSM_STATE - Status of FSM */ -#define GLIKEY_STATUS_FSM_STATE(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_STATUS_FSM_STATE_SHIFT)) & GLIKEY_STATUS_FSM_STATE_MASK) -/*! @} */ - -/*! @name VERSION - IP Version */ -/*! @{ */ - -#define GLIKEY_VERSION_RESERVED3_MASK (0xFU) -#define GLIKEY_VERSION_RESERVED3_SHIFT (0U) -/*! Reserved3 - Reserved */ -#define GLIKEY_VERSION_RESERVED3(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_VERSION_RESERVED3_SHIFT)) & GLIKEY_VERSION_RESERVED3_MASK) - -#define GLIKEY_VERSION_RESERVED7_MASK (0xF0U) -#define GLIKEY_VERSION_RESERVED7_SHIFT (4U) -/*! Reserved7 - Reserved */ -#define GLIKEY_VERSION_RESERVED7(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_VERSION_RESERVED7_SHIFT)) & GLIKEY_VERSION_RESERVED7_MASK) - -#define GLIKEY_VERSION_RESERVED11_MASK (0xF00U) -#define GLIKEY_VERSION_RESERVED11_SHIFT (8U) -/*! Reserved11 - Reserved */ -#define GLIKEY_VERSION_RESERVED11(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_VERSION_RESERVED11_SHIFT)) & GLIKEY_VERSION_RESERVED11_MASK) - -#define GLIKEY_VERSION_RESERVED15_MASK (0xF000U) -#define GLIKEY_VERSION_RESERVED15_SHIFT (12U) -/*! Reserved15 - Reserved */ -#define GLIKEY_VERSION_RESERVED15(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_VERSION_RESERVED15_SHIFT)) & GLIKEY_VERSION_RESERVED15_MASK) - -#define GLIKEY_VERSION_RESERVED16_MASK (0x30000U) -#define GLIKEY_VERSION_RESERVED16_SHIFT (16U) -/*! Reserved16 - Reserved */ -#define GLIKEY_VERSION_RESERVED16(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_VERSION_RESERVED16_SHIFT)) & GLIKEY_VERSION_RESERVED16_MASK) - -#define GLIKEY_VERSION_FSM_CONFIG_MASK (0x40000U) -#define GLIKEY_VERSION_FSM_CONFIG_SHIFT (18U) -/*! FSM_CONFIG - 0:4 step, 1:8 step */ -#define GLIKEY_VERSION_FSM_CONFIG(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_VERSION_FSM_CONFIG_SHIFT)) & GLIKEY_VERSION_FSM_CONFIG_MASK) - -#define GLIKEY_VERSION_INDEX_CONFIG_MASK (0x7F80000U) -#define GLIKEY_VERSION_INDEX_CONFIG_SHIFT (19U) -/*! INDEX_CONFIG - Configured number of addressable indexes */ -#define GLIKEY_VERSION_INDEX_CONFIG(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_VERSION_INDEX_CONFIG_SHIFT)) & GLIKEY_VERSION_INDEX_CONFIG_MASK) - -#define GLIKEY_VERSION_RESERVED31_MASK (0xF8000000U) -#define GLIKEY_VERSION_RESERVED31_SHIFT (27U) -/*! Reserved31 - Reserved for Future Use */ -#define GLIKEY_VERSION_RESERVED31(x) (((uint32_t)(((uint32_t)(x)) << GLIKEY_VERSION_RESERVED31_SHIFT)) & GLIKEY_VERSION_RESERVED31_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group GLIKEY_Register_Masks */ - - -/* GLIKEY - Peripheral instance base addresses */ -/** Peripheral GLIKEY0 base address */ -#define GLIKEY0_BASE (0x40091D00u) -/** Peripheral GLIKEY0 base pointer */ -#define GLIKEY0 ((GLIKEY_Type *)GLIKEY0_BASE) -/** Array initializer of GLIKEY peripheral base addresses */ -#define GLIKEY_BASE_ADDRS { GLIKEY0_BASE } -/** Array initializer of GLIKEY peripheral base pointers */ -#define GLIKEY_BASE_PTRS { GLIKEY0 } - -/*! - * @} - */ /* end of group GLIKEY_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- GPIO Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup GPIO_Peripheral_Access_Layer GPIO Peripheral Access Layer - * @{ - */ - -/** GPIO - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - uint8_t RESERVED_0[56]; - __IO uint32_t PDOR; /**< Port Data Output, offset: 0x40 */ - __O uint32_t PSOR; /**< Port Set Output, offset: 0x44 */ - __O uint32_t PCOR; /**< Port Clear Output, offset: 0x48 */ - __O uint32_t PTOR; /**< Port Toggle Output, offset: 0x4C */ - __I uint32_t PDIR; /**< Port Data Input, offset: 0x50 */ - __IO uint32_t PDDR; /**< Port Data Direction, offset: 0x54 */ - __IO uint32_t PIDR; /**< Port Input Disable, offset: 0x58 */ - uint8_t RESERVED_1[4]; - __IO uint8_t PDR[32]; /**< Pin Data, array offset: 0x60, array step: 0x1 */ - __IO uint32_t ICR[32]; /**< Interrupt Control 0..Interrupt Control 31, array offset: 0x80, array step: 0x4 */ - __O uint32_t GICLR; /**< Global Interrupt Control Low, offset: 0x100 */ - __O uint32_t GICHR; /**< Global Interrupt Control High, offset: 0x104 */ - uint8_t RESERVED_2[24]; - __IO uint32_t ISFR[1]; /**< Interrupt Status Flag, array offset: 0x120, array step: 0x4 */ -} GPIO_Type; - -/* ---------------------------------------------------------------------------- - -- GPIO Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup GPIO_Register_Masks GPIO Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define GPIO_VERID_FEATURE_MASK (0xFFFFU) -#define GPIO_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Basic implementation - * 0b0000000000000001..Protection registers implemented - */ -#define GPIO_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << GPIO_VERID_FEATURE_SHIFT)) & GPIO_VERID_FEATURE_MASK) - -#define GPIO_VERID_MINOR_MASK (0xFF0000U) -#define GPIO_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define GPIO_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << GPIO_VERID_MINOR_SHIFT)) & GPIO_VERID_MINOR_MASK) - -#define GPIO_VERID_MAJOR_MASK (0xFF000000U) -#define GPIO_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define GPIO_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << GPIO_VERID_MAJOR_SHIFT)) & GPIO_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define GPIO_PARAM_IRQNUM_MASK (0xFU) -#define GPIO_PARAM_IRQNUM_SHIFT (0U) -/*! IRQNUM - Interrupt Number */ -#define GPIO_PARAM_IRQNUM(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PARAM_IRQNUM_SHIFT)) & GPIO_PARAM_IRQNUM_MASK) -/*! @} */ - -/*! @name PDOR - Port Data Output */ -/*! @{ */ - -#define GPIO_PDOR_PDO0_MASK (0x1U) -#define GPIO_PDOR_PDO0_SHIFT (0U) -/*! PDO0 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO0_SHIFT)) & GPIO_PDOR_PDO0_MASK) - -#define GPIO_PDOR_PDO1_MASK (0x2U) -#define GPIO_PDOR_PDO1_SHIFT (1U) -/*! PDO1 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO1_SHIFT)) & GPIO_PDOR_PDO1_MASK) - -#define GPIO_PDOR_PDO2_MASK (0x4U) -#define GPIO_PDOR_PDO2_SHIFT (2U) -/*! PDO2 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO2_SHIFT)) & GPIO_PDOR_PDO2_MASK) - -#define GPIO_PDOR_PDO3_MASK (0x8U) -#define GPIO_PDOR_PDO3_SHIFT (3U) -/*! PDO3 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO3_SHIFT)) & GPIO_PDOR_PDO3_MASK) - -#define GPIO_PDOR_PDO4_MASK (0x10U) -#define GPIO_PDOR_PDO4_SHIFT (4U) -/*! PDO4 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO4_SHIFT)) & GPIO_PDOR_PDO4_MASK) - -#define GPIO_PDOR_PDO5_MASK (0x20U) -#define GPIO_PDOR_PDO5_SHIFT (5U) -/*! PDO5 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO5_SHIFT)) & GPIO_PDOR_PDO5_MASK) - -#define GPIO_PDOR_PDO6_MASK (0x40U) -#define GPIO_PDOR_PDO6_SHIFT (6U) -/*! PDO6 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO6_SHIFT)) & GPIO_PDOR_PDO6_MASK) - -#define GPIO_PDOR_PDO7_MASK (0x80U) -#define GPIO_PDOR_PDO7_SHIFT (7U) -/*! PDO7 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO7_SHIFT)) & GPIO_PDOR_PDO7_MASK) - -#define GPIO_PDOR_PDO8_MASK (0x100U) -#define GPIO_PDOR_PDO8_SHIFT (8U) -/*! PDO8 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO8_SHIFT)) & GPIO_PDOR_PDO8_MASK) - -#define GPIO_PDOR_PDO9_MASK (0x200U) -#define GPIO_PDOR_PDO9_SHIFT (9U) -/*! PDO9 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO9_SHIFT)) & GPIO_PDOR_PDO9_MASK) - -#define GPIO_PDOR_PDO10_MASK (0x400U) -#define GPIO_PDOR_PDO10_SHIFT (10U) -/*! PDO10 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO10_SHIFT)) & GPIO_PDOR_PDO10_MASK) - -#define GPIO_PDOR_PDO11_MASK (0x800U) -#define GPIO_PDOR_PDO11_SHIFT (11U) -/*! PDO11 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO11_SHIFT)) & GPIO_PDOR_PDO11_MASK) - -#define GPIO_PDOR_PDO12_MASK (0x1000U) -#define GPIO_PDOR_PDO12_SHIFT (12U) -/*! PDO12 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO12_SHIFT)) & GPIO_PDOR_PDO12_MASK) - -#define GPIO_PDOR_PDO13_MASK (0x2000U) -#define GPIO_PDOR_PDO13_SHIFT (13U) -/*! PDO13 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO13_SHIFT)) & GPIO_PDOR_PDO13_MASK) - -#define GPIO_PDOR_PDO14_MASK (0x4000U) -#define GPIO_PDOR_PDO14_SHIFT (14U) -/*! PDO14 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO14_SHIFT)) & GPIO_PDOR_PDO14_MASK) - -#define GPIO_PDOR_PDO15_MASK (0x8000U) -#define GPIO_PDOR_PDO15_SHIFT (15U) -/*! PDO15 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO15_SHIFT)) & GPIO_PDOR_PDO15_MASK) - -#define GPIO_PDOR_PDO16_MASK (0x10000U) -#define GPIO_PDOR_PDO16_SHIFT (16U) -/*! PDO16 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO16_SHIFT)) & GPIO_PDOR_PDO16_MASK) - -#define GPIO_PDOR_PDO17_MASK (0x20000U) -#define GPIO_PDOR_PDO17_SHIFT (17U) -/*! PDO17 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO17_SHIFT)) & GPIO_PDOR_PDO17_MASK) - -#define GPIO_PDOR_PDO18_MASK (0x40000U) -#define GPIO_PDOR_PDO18_SHIFT (18U) -/*! PDO18 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO18_SHIFT)) & GPIO_PDOR_PDO18_MASK) - -#define GPIO_PDOR_PDO19_MASK (0x80000U) -#define GPIO_PDOR_PDO19_SHIFT (19U) -/*! PDO19 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO19_SHIFT)) & GPIO_PDOR_PDO19_MASK) - -#define GPIO_PDOR_PDO20_MASK (0x100000U) -#define GPIO_PDOR_PDO20_SHIFT (20U) -/*! PDO20 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO20_SHIFT)) & GPIO_PDOR_PDO20_MASK) - -#define GPIO_PDOR_PDO21_MASK (0x200000U) -#define GPIO_PDOR_PDO21_SHIFT (21U) -/*! PDO21 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO21_SHIFT)) & GPIO_PDOR_PDO21_MASK) - -#define GPIO_PDOR_PDO22_MASK (0x400000U) -#define GPIO_PDOR_PDO22_SHIFT (22U) -/*! PDO22 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO22_SHIFT)) & GPIO_PDOR_PDO22_MASK) - -#define GPIO_PDOR_PDO23_MASK (0x800000U) -#define GPIO_PDOR_PDO23_SHIFT (23U) -/*! PDO23 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO23_SHIFT)) & GPIO_PDOR_PDO23_MASK) - -#define GPIO_PDOR_PDO24_MASK (0x1000000U) -#define GPIO_PDOR_PDO24_SHIFT (24U) -/*! PDO24 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO24_SHIFT)) & GPIO_PDOR_PDO24_MASK) - -#define GPIO_PDOR_PDO25_MASK (0x2000000U) -#define GPIO_PDOR_PDO25_SHIFT (25U) -/*! PDO25 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO25_SHIFT)) & GPIO_PDOR_PDO25_MASK) - -#define GPIO_PDOR_PDO26_MASK (0x4000000U) -#define GPIO_PDOR_PDO26_SHIFT (26U) -/*! PDO26 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO26_SHIFT)) & GPIO_PDOR_PDO26_MASK) - -#define GPIO_PDOR_PDO27_MASK (0x8000000U) -#define GPIO_PDOR_PDO27_SHIFT (27U) -/*! PDO27 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO27_SHIFT)) & GPIO_PDOR_PDO27_MASK) - -#define GPIO_PDOR_PDO28_MASK (0x10000000U) -#define GPIO_PDOR_PDO28_SHIFT (28U) -/*! PDO28 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO28_SHIFT)) & GPIO_PDOR_PDO28_MASK) - -#define GPIO_PDOR_PDO29_MASK (0x20000000U) -#define GPIO_PDOR_PDO29_SHIFT (29U) -/*! PDO29 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO29_SHIFT)) & GPIO_PDOR_PDO29_MASK) - -#define GPIO_PDOR_PDO30_MASK (0x40000000U) -#define GPIO_PDOR_PDO30_SHIFT (30U) -/*! PDO30 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO30_SHIFT)) & GPIO_PDOR_PDO30_MASK) - -#define GPIO_PDOR_PDO31_MASK (0x80000000U) -#define GPIO_PDOR_PDO31_SHIFT (31U) -/*! PDO31 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO31_SHIFT)) & GPIO_PDOR_PDO31_MASK) -/*! @} */ - -/*! @name PSOR - Port Set Output */ -/*! @{ */ - -#define GPIO_PSOR_PTSO0_MASK (0x1U) -#define GPIO_PSOR_PTSO0_SHIFT (0U) -/*! PTSO0 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO0_SHIFT)) & GPIO_PSOR_PTSO0_MASK) - -#define GPIO_PSOR_PTSO1_MASK (0x2U) -#define GPIO_PSOR_PTSO1_SHIFT (1U) -/*! PTSO1 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO1_SHIFT)) & GPIO_PSOR_PTSO1_MASK) - -#define GPIO_PSOR_PTSO2_MASK (0x4U) -#define GPIO_PSOR_PTSO2_SHIFT (2U) -/*! PTSO2 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO2_SHIFT)) & GPIO_PSOR_PTSO2_MASK) - -#define GPIO_PSOR_PTSO3_MASK (0x8U) -#define GPIO_PSOR_PTSO3_SHIFT (3U) -/*! PTSO3 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO3_SHIFT)) & GPIO_PSOR_PTSO3_MASK) - -#define GPIO_PSOR_PTSO4_MASK (0x10U) -#define GPIO_PSOR_PTSO4_SHIFT (4U) -/*! PTSO4 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO4_SHIFT)) & GPIO_PSOR_PTSO4_MASK) - -#define GPIO_PSOR_PTSO5_MASK (0x20U) -#define GPIO_PSOR_PTSO5_SHIFT (5U) -/*! PTSO5 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO5_SHIFT)) & GPIO_PSOR_PTSO5_MASK) - -#define GPIO_PSOR_PTSO6_MASK (0x40U) -#define GPIO_PSOR_PTSO6_SHIFT (6U) -/*! PTSO6 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO6_SHIFT)) & GPIO_PSOR_PTSO6_MASK) - -#define GPIO_PSOR_PTSO7_MASK (0x80U) -#define GPIO_PSOR_PTSO7_SHIFT (7U) -/*! PTSO7 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO7_SHIFT)) & GPIO_PSOR_PTSO7_MASK) - -#define GPIO_PSOR_PTSO8_MASK (0x100U) -#define GPIO_PSOR_PTSO8_SHIFT (8U) -/*! PTSO8 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO8_SHIFT)) & GPIO_PSOR_PTSO8_MASK) - -#define GPIO_PSOR_PTSO9_MASK (0x200U) -#define GPIO_PSOR_PTSO9_SHIFT (9U) -/*! PTSO9 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO9_SHIFT)) & GPIO_PSOR_PTSO9_MASK) - -#define GPIO_PSOR_PTSO10_MASK (0x400U) -#define GPIO_PSOR_PTSO10_SHIFT (10U) -/*! PTSO10 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO10_SHIFT)) & GPIO_PSOR_PTSO10_MASK) - -#define GPIO_PSOR_PTSO11_MASK (0x800U) -#define GPIO_PSOR_PTSO11_SHIFT (11U) -/*! PTSO11 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO11_SHIFT)) & GPIO_PSOR_PTSO11_MASK) - -#define GPIO_PSOR_PTSO12_MASK (0x1000U) -#define GPIO_PSOR_PTSO12_SHIFT (12U) -/*! PTSO12 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO12_SHIFT)) & GPIO_PSOR_PTSO12_MASK) - -#define GPIO_PSOR_PTSO13_MASK (0x2000U) -#define GPIO_PSOR_PTSO13_SHIFT (13U) -/*! PTSO13 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO13_SHIFT)) & GPIO_PSOR_PTSO13_MASK) - -#define GPIO_PSOR_PTSO14_MASK (0x4000U) -#define GPIO_PSOR_PTSO14_SHIFT (14U) -/*! PTSO14 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO14_SHIFT)) & GPIO_PSOR_PTSO14_MASK) - -#define GPIO_PSOR_PTSO15_MASK (0x8000U) -#define GPIO_PSOR_PTSO15_SHIFT (15U) -/*! PTSO15 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO15_SHIFT)) & GPIO_PSOR_PTSO15_MASK) - -#define GPIO_PSOR_PTSO16_MASK (0x10000U) -#define GPIO_PSOR_PTSO16_SHIFT (16U) -/*! PTSO16 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO16_SHIFT)) & GPIO_PSOR_PTSO16_MASK) - -#define GPIO_PSOR_PTSO17_MASK (0x20000U) -#define GPIO_PSOR_PTSO17_SHIFT (17U) -/*! PTSO17 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO17_SHIFT)) & GPIO_PSOR_PTSO17_MASK) - -#define GPIO_PSOR_PTSO18_MASK (0x40000U) -#define GPIO_PSOR_PTSO18_SHIFT (18U) -/*! PTSO18 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO18_SHIFT)) & GPIO_PSOR_PTSO18_MASK) - -#define GPIO_PSOR_PTSO19_MASK (0x80000U) -#define GPIO_PSOR_PTSO19_SHIFT (19U) -/*! PTSO19 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO19_SHIFT)) & GPIO_PSOR_PTSO19_MASK) - -#define GPIO_PSOR_PTSO20_MASK (0x100000U) -#define GPIO_PSOR_PTSO20_SHIFT (20U) -/*! PTSO20 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO20_SHIFT)) & GPIO_PSOR_PTSO20_MASK) - -#define GPIO_PSOR_PTSO21_MASK (0x200000U) -#define GPIO_PSOR_PTSO21_SHIFT (21U) -/*! PTSO21 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO21_SHIFT)) & GPIO_PSOR_PTSO21_MASK) - -#define GPIO_PSOR_PTSO22_MASK (0x400000U) -#define GPIO_PSOR_PTSO22_SHIFT (22U) -/*! PTSO22 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO22_SHIFT)) & GPIO_PSOR_PTSO22_MASK) - -#define GPIO_PSOR_PTSO23_MASK (0x800000U) -#define GPIO_PSOR_PTSO23_SHIFT (23U) -/*! PTSO23 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO23_SHIFT)) & GPIO_PSOR_PTSO23_MASK) - -#define GPIO_PSOR_PTSO24_MASK (0x1000000U) -#define GPIO_PSOR_PTSO24_SHIFT (24U) -/*! PTSO24 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO24_SHIFT)) & GPIO_PSOR_PTSO24_MASK) - -#define GPIO_PSOR_PTSO25_MASK (0x2000000U) -#define GPIO_PSOR_PTSO25_SHIFT (25U) -/*! PTSO25 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO25_SHIFT)) & GPIO_PSOR_PTSO25_MASK) - -#define GPIO_PSOR_PTSO26_MASK (0x4000000U) -#define GPIO_PSOR_PTSO26_SHIFT (26U) -/*! PTSO26 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO26_SHIFT)) & GPIO_PSOR_PTSO26_MASK) - -#define GPIO_PSOR_PTSO27_MASK (0x8000000U) -#define GPIO_PSOR_PTSO27_SHIFT (27U) -/*! PTSO27 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO27_SHIFT)) & GPIO_PSOR_PTSO27_MASK) - -#define GPIO_PSOR_PTSO28_MASK (0x10000000U) -#define GPIO_PSOR_PTSO28_SHIFT (28U) -/*! PTSO28 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO28_SHIFT)) & GPIO_PSOR_PTSO28_MASK) - -#define GPIO_PSOR_PTSO29_MASK (0x20000000U) -#define GPIO_PSOR_PTSO29_SHIFT (29U) -/*! PTSO29 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO29_SHIFT)) & GPIO_PSOR_PTSO29_MASK) - -#define GPIO_PSOR_PTSO30_MASK (0x40000000U) -#define GPIO_PSOR_PTSO30_SHIFT (30U) -/*! PTSO30 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO30_SHIFT)) & GPIO_PSOR_PTSO30_MASK) - -#define GPIO_PSOR_PTSO31_MASK (0x80000000U) -#define GPIO_PSOR_PTSO31_SHIFT (31U) -/*! PTSO31 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO31_SHIFT)) & GPIO_PSOR_PTSO31_MASK) -/*! @} */ - -/*! @name PCOR - Port Clear Output */ -/*! @{ */ - -#define GPIO_PCOR_PTCO0_MASK (0x1U) -#define GPIO_PCOR_PTCO0_SHIFT (0U) -/*! PTCO0 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO0_SHIFT)) & GPIO_PCOR_PTCO0_MASK) - -#define GPIO_PCOR_PTCO1_MASK (0x2U) -#define GPIO_PCOR_PTCO1_SHIFT (1U) -/*! PTCO1 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO1_SHIFT)) & GPIO_PCOR_PTCO1_MASK) - -#define GPIO_PCOR_PTCO2_MASK (0x4U) -#define GPIO_PCOR_PTCO2_SHIFT (2U) -/*! PTCO2 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO2_SHIFT)) & GPIO_PCOR_PTCO2_MASK) - -#define GPIO_PCOR_PTCO3_MASK (0x8U) -#define GPIO_PCOR_PTCO3_SHIFT (3U) -/*! PTCO3 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO3_SHIFT)) & GPIO_PCOR_PTCO3_MASK) - -#define GPIO_PCOR_PTCO4_MASK (0x10U) -#define GPIO_PCOR_PTCO4_SHIFT (4U) -/*! PTCO4 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO4_SHIFT)) & GPIO_PCOR_PTCO4_MASK) - -#define GPIO_PCOR_PTCO5_MASK (0x20U) -#define GPIO_PCOR_PTCO5_SHIFT (5U) -/*! PTCO5 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO5_SHIFT)) & GPIO_PCOR_PTCO5_MASK) - -#define GPIO_PCOR_PTCO6_MASK (0x40U) -#define GPIO_PCOR_PTCO6_SHIFT (6U) -/*! PTCO6 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO6_SHIFT)) & GPIO_PCOR_PTCO6_MASK) - -#define GPIO_PCOR_PTCO7_MASK (0x80U) -#define GPIO_PCOR_PTCO7_SHIFT (7U) -/*! PTCO7 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO7_SHIFT)) & GPIO_PCOR_PTCO7_MASK) - -#define GPIO_PCOR_PTCO8_MASK (0x100U) -#define GPIO_PCOR_PTCO8_SHIFT (8U) -/*! PTCO8 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO8_SHIFT)) & GPIO_PCOR_PTCO8_MASK) - -#define GPIO_PCOR_PTCO9_MASK (0x200U) -#define GPIO_PCOR_PTCO9_SHIFT (9U) -/*! PTCO9 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO9_SHIFT)) & GPIO_PCOR_PTCO9_MASK) - -#define GPIO_PCOR_PTCO10_MASK (0x400U) -#define GPIO_PCOR_PTCO10_SHIFT (10U) -/*! PTCO10 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO10_SHIFT)) & GPIO_PCOR_PTCO10_MASK) - -#define GPIO_PCOR_PTCO11_MASK (0x800U) -#define GPIO_PCOR_PTCO11_SHIFT (11U) -/*! PTCO11 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO11_SHIFT)) & GPIO_PCOR_PTCO11_MASK) - -#define GPIO_PCOR_PTCO12_MASK (0x1000U) -#define GPIO_PCOR_PTCO12_SHIFT (12U) -/*! PTCO12 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO12_SHIFT)) & GPIO_PCOR_PTCO12_MASK) - -#define GPIO_PCOR_PTCO13_MASK (0x2000U) -#define GPIO_PCOR_PTCO13_SHIFT (13U) -/*! PTCO13 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO13_SHIFT)) & GPIO_PCOR_PTCO13_MASK) - -#define GPIO_PCOR_PTCO14_MASK (0x4000U) -#define GPIO_PCOR_PTCO14_SHIFT (14U) -/*! PTCO14 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO14_SHIFT)) & GPIO_PCOR_PTCO14_MASK) - -#define GPIO_PCOR_PTCO15_MASK (0x8000U) -#define GPIO_PCOR_PTCO15_SHIFT (15U) -/*! PTCO15 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO15_SHIFT)) & GPIO_PCOR_PTCO15_MASK) - -#define GPIO_PCOR_PTCO16_MASK (0x10000U) -#define GPIO_PCOR_PTCO16_SHIFT (16U) -/*! PTCO16 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO16_SHIFT)) & GPIO_PCOR_PTCO16_MASK) - -#define GPIO_PCOR_PTCO17_MASK (0x20000U) -#define GPIO_PCOR_PTCO17_SHIFT (17U) -/*! PTCO17 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO17_SHIFT)) & GPIO_PCOR_PTCO17_MASK) - -#define GPIO_PCOR_PTCO18_MASK (0x40000U) -#define GPIO_PCOR_PTCO18_SHIFT (18U) -/*! PTCO18 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO18_SHIFT)) & GPIO_PCOR_PTCO18_MASK) - -#define GPIO_PCOR_PTCO19_MASK (0x80000U) -#define GPIO_PCOR_PTCO19_SHIFT (19U) -/*! PTCO19 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO19_SHIFT)) & GPIO_PCOR_PTCO19_MASK) - -#define GPIO_PCOR_PTCO20_MASK (0x100000U) -#define GPIO_PCOR_PTCO20_SHIFT (20U) -/*! PTCO20 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO20_SHIFT)) & GPIO_PCOR_PTCO20_MASK) - -#define GPIO_PCOR_PTCO21_MASK (0x200000U) -#define GPIO_PCOR_PTCO21_SHIFT (21U) -/*! PTCO21 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO21_SHIFT)) & GPIO_PCOR_PTCO21_MASK) - -#define GPIO_PCOR_PTCO22_MASK (0x400000U) -#define GPIO_PCOR_PTCO22_SHIFT (22U) -/*! PTCO22 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO22_SHIFT)) & GPIO_PCOR_PTCO22_MASK) - -#define GPIO_PCOR_PTCO23_MASK (0x800000U) -#define GPIO_PCOR_PTCO23_SHIFT (23U) -/*! PTCO23 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO23_SHIFT)) & GPIO_PCOR_PTCO23_MASK) - -#define GPIO_PCOR_PTCO24_MASK (0x1000000U) -#define GPIO_PCOR_PTCO24_SHIFT (24U) -/*! PTCO24 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO24_SHIFT)) & GPIO_PCOR_PTCO24_MASK) - -#define GPIO_PCOR_PTCO25_MASK (0x2000000U) -#define GPIO_PCOR_PTCO25_SHIFT (25U) -/*! PTCO25 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO25_SHIFT)) & GPIO_PCOR_PTCO25_MASK) - -#define GPIO_PCOR_PTCO26_MASK (0x4000000U) -#define GPIO_PCOR_PTCO26_SHIFT (26U) -/*! PTCO26 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO26_SHIFT)) & GPIO_PCOR_PTCO26_MASK) - -#define GPIO_PCOR_PTCO27_MASK (0x8000000U) -#define GPIO_PCOR_PTCO27_SHIFT (27U) -/*! PTCO27 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO27_SHIFT)) & GPIO_PCOR_PTCO27_MASK) - -#define GPIO_PCOR_PTCO28_MASK (0x10000000U) -#define GPIO_PCOR_PTCO28_SHIFT (28U) -/*! PTCO28 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO28_SHIFT)) & GPIO_PCOR_PTCO28_MASK) - -#define GPIO_PCOR_PTCO29_MASK (0x20000000U) -#define GPIO_PCOR_PTCO29_SHIFT (29U) -/*! PTCO29 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO29_SHIFT)) & GPIO_PCOR_PTCO29_MASK) - -#define GPIO_PCOR_PTCO30_MASK (0x40000000U) -#define GPIO_PCOR_PTCO30_SHIFT (30U) -/*! PTCO30 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO30_SHIFT)) & GPIO_PCOR_PTCO30_MASK) - -#define GPIO_PCOR_PTCO31_MASK (0x80000000U) -#define GPIO_PCOR_PTCO31_SHIFT (31U) -/*! PTCO31 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO31_SHIFT)) & GPIO_PCOR_PTCO31_MASK) -/*! @} */ - -/*! @name PTOR - Port Toggle Output */ -/*! @{ */ - -#define GPIO_PTOR_PTTO0_MASK (0x1U) -#define GPIO_PTOR_PTTO0_SHIFT (0U) -/*! PTTO0 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO0_SHIFT)) & GPIO_PTOR_PTTO0_MASK) - -#define GPIO_PTOR_PTTO1_MASK (0x2U) -#define GPIO_PTOR_PTTO1_SHIFT (1U) -/*! PTTO1 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO1_SHIFT)) & GPIO_PTOR_PTTO1_MASK) - -#define GPIO_PTOR_PTTO2_MASK (0x4U) -#define GPIO_PTOR_PTTO2_SHIFT (2U) -/*! PTTO2 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO2_SHIFT)) & GPIO_PTOR_PTTO2_MASK) - -#define GPIO_PTOR_PTTO3_MASK (0x8U) -#define GPIO_PTOR_PTTO3_SHIFT (3U) -/*! PTTO3 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO3_SHIFT)) & GPIO_PTOR_PTTO3_MASK) - -#define GPIO_PTOR_PTTO4_MASK (0x10U) -#define GPIO_PTOR_PTTO4_SHIFT (4U) -/*! PTTO4 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO4_SHIFT)) & GPIO_PTOR_PTTO4_MASK) - -#define GPIO_PTOR_PTTO5_MASK (0x20U) -#define GPIO_PTOR_PTTO5_SHIFT (5U) -/*! PTTO5 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO5_SHIFT)) & GPIO_PTOR_PTTO5_MASK) - -#define GPIO_PTOR_PTTO6_MASK (0x40U) -#define GPIO_PTOR_PTTO6_SHIFT (6U) -/*! PTTO6 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO6_SHIFT)) & GPIO_PTOR_PTTO6_MASK) - -#define GPIO_PTOR_PTTO7_MASK (0x80U) -#define GPIO_PTOR_PTTO7_SHIFT (7U) -/*! PTTO7 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO7_SHIFT)) & GPIO_PTOR_PTTO7_MASK) - -#define GPIO_PTOR_PTTO8_MASK (0x100U) -#define GPIO_PTOR_PTTO8_SHIFT (8U) -/*! PTTO8 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO8_SHIFT)) & GPIO_PTOR_PTTO8_MASK) - -#define GPIO_PTOR_PTTO9_MASK (0x200U) -#define GPIO_PTOR_PTTO9_SHIFT (9U) -/*! PTTO9 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO9_SHIFT)) & GPIO_PTOR_PTTO9_MASK) - -#define GPIO_PTOR_PTTO10_MASK (0x400U) -#define GPIO_PTOR_PTTO10_SHIFT (10U) -/*! PTTO10 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO10_SHIFT)) & GPIO_PTOR_PTTO10_MASK) - -#define GPIO_PTOR_PTTO11_MASK (0x800U) -#define GPIO_PTOR_PTTO11_SHIFT (11U) -/*! PTTO11 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO11_SHIFT)) & GPIO_PTOR_PTTO11_MASK) - -#define GPIO_PTOR_PTTO12_MASK (0x1000U) -#define GPIO_PTOR_PTTO12_SHIFT (12U) -/*! PTTO12 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO12_SHIFT)) & GPIO_PTOR_PTTO12_MASK) - -#define GPIO_PTOR_PTTO13_MASK (0x2000U) -#define GPIO_PTOR_PTTO13_SHIFT (13U) -/*! PTTO13 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO13_SHIFT)) & GPIO_PTOR_PTTO13_MASK) - -#define GPIO_PTOR_PTTO14_MASK (0x4000U) -#define GPIO_PTOR_PTTO14_SHIFT (14U) -/*! PTTO14 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO14_SHIFT)) & GPIO_PTOR_PTTO14_MASK) - -#define GPIO_PTOR_PTTO15_MASK (0x8000U) -#define GPIO_PTOR_PTTO15_SHIFT (15U) -/*! PTTO15 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO15_SHIFT)) & GPIO_PTOR_PTTO15_MASK) - -#define GPIO_PTOR_PTTO16_MASK (0x10000U) -#define GPIO_PTOR_PTTO16_SHIFT (16U) -/*! PTTO16 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO16_SHIFT)) & GPIO_PTOR_PTTO16_MASK) - -#define GPIO_PTOR_PTTO17_MASK (0x20000U) -#define GPIO_PTOR_PTTO17_SHIFT (17U) -/*! PTTO17 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO17_SHIFT)) & GPIO_PTOR_PTTO17_MASK) - -#define GPIO_PTOR_PTTO18_MASK (0x40000U) -#define GPIO_PTOR_PTTO18_SHIFT (18U) -/*! PTTO18 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO18_SHIFT)) & GPIO_PTOR_PTTO18_MASK) - -#define GPIO_PTOR_PTTO19_MASK (0x80000U) -#define GPIO_PTOR_PTTO19_SHIFT (19U) -/*! PTTO19 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO19_SHIFT)) & GPIO_PTOR_PTTO19_MASK) - -#define GPIO_PTOR_PTTO20_MASK (0x100000U) -#define GPIO_PTOR_PTTO20_SHIFT (20U) -/*! PTTO20 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO20_SHIFT)) & GPIO_PTOR_PTTO20_MASK) - -#define GPIO_PTOR_PTTO21_MASK (0x200000U) -#define GPIO_PTOR_PTTO21_SHIFT (21U) -/*! PTTO21 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO21_SHIFT)) & GPIO_PTOR_PTTO21_MASK) - -#define GPIO_PTOR_PTTO22_MASK (0x400000U) -#define GPIO_PTOR_PTTO22_SHIFT (22U) -/*! PTTO22 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO22_SHIFT)) & GPIO_PTOR_PTTO22_MASK) - -#define GPIO_PTOR_PTTO23_MASK (0x800000U) -#define GPIO_PTOR_PTTO23_SHIFT (23U) -/*! PTTO23 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO23_SHIFT)) & GPIO_PTOR_PTTO23_MASK) - -#define GPIO_PTOR_PTTO24_MASK (0x1000000U) -#define GPIO_PTOR_PTTO24_SHIFT (24U) -/*! PTTO24 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO24_SHIFT)) & GPIO_PTOR_PTTO24_MASK) - -#define GPIO_PTOR_PTTO25_MASK (0x2000000U) -#define GPIO_PTOR_PTTO25_SHIFT (25U) -/*! PTTO25 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO25_SHIFT)) & GPIO_PTOR_PTTO25_MASK) - -#define GPIO_PTOR_PTTO26_MASK (0x4000000U) -#define GPIO_PTOR_PTTO26_SHIFT (26U) -/*! PTTO26 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO26_SHIFT)) & GPIO_PTOR_PTTO26_MASK) - -#define GPIO_PTOR_PTTO27_MASK (0x8000000U) -#define GPIO_PTOR_PTTO27_SHIFT (27U) -/*! PTTO27 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO27_SHIFT)) & GPIO_PTOR_PTTO27_MASK) - -#define GPIO_PTOR_PTTO28_MASK (0x10000000U) -#define GPIO_PTOR_PTTO28_SHIFT (28U) -/*! PTTO28 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO28_SHIFT)) & GPIO_PTOR_PTTO28_MASK) - -#define GPIO_PTOR_PTTO29_MASK (0x20000000U) -#define GPIO_PTOR_PTTO29_SHIFT (29U) -/*! PTTO29 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO29_SHIFT)) & GPIO_PTOR_PTTO29_MASK) - -#define GPIO_PTOR_PTTO30_MASK (0x40000000U) -#define GPIO_PTOR_PTTO30_SHIFT (30U) -/*! PTTO30 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO30_SHIFT)) & GPIO_PTOR_PTTO30_MASK) - -#define GPIO_PTOR_PTTO31_MASK (0x80000000U) -#define GPIO_PTOR_PTTO31_SHIFT (31U) -/*! PTTO31 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO31_SHIFT)) & GPIO_PTOR_PTTO31_MASK) -/*! @} */ - -/*! @name PDIR - Port Data Input */ -/*! @{ */ - -#define GPIO_PDIR_PDI0_MASK (0x1U) -#define GPIO_PDIR_PDI0_SHIFT (0U) -/*! PDI0 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI0_SHIFT)) & GPIO_PDIR_PDI0_MASK) - -#define GPIO_PDIR_PDI1_MASK (0x2U) -#define GPIO_PDIR_PDI1_SHIFT (1U) -/*! PDI1 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI1_SHIFT)) & GPIO_PDIR_PDI1_MASK) - -#define GPIO_PDIR_PDI2_MASK (0x4U) -#define GPIO_PDIR_PDI2_SHIFT (2U) -/*! PDI2 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI2_SHIFT)) & GPIO_PDIR_PDI2_MASK) - -#define GPIO_PDIR_PDI3_MASK (0x8U) -#define GPIO_PDIR_PDI3_SHIFT (3U) -/*! PDI3 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI3_SHIFT)) & GPIO_PDIR_PDI3_MASK) - -#define GPIO_PDIR_PDI4_MASK (0x10U) -#define GPIO_PDIR_PDI4_SHIFT (4U) -/*! PDI4 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI4_SHIFT)) & GPIO_PDIR_PDI4_MASK) - -#define GPIO_PDIR_PDI5_MASK (0x20U) -#define GPIO_PDIR_PDI5_SHIFT (5U) -/*! PDI5 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI5_SHIFT)) & GPIO_PDIR_PDI5_MASK) - -#define GPIO_PDIR_PDI6_MASK (0x40U) -#define GPIO_PDIR_PDI6_SHIFT (6U) -/*! PDI6 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI6_SHIFT)) & GPIO_PDIR_PDI6_MASK) - -#define GPIO_PDIR_PDI7_MASK (0x80U) -#define GPIO_PDIR_PDI7_SHIFT (7U) -/*! PDI7 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI7_SHIFT)) & GPIO_PDIR_PDI7_MASK) - -#define GPIO_PDIR_PDI8_MASK (0x100U) -#define GPIO_PDIR_PDI8_SHIFT (8U) -/*! PDI8 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI8_SHIFT)) & GPIO_PDIR_PDI8_MASK) - -#define GPIO_PDIR_PDI9_MASK (0x200U) -#define GPIO_PDIR_PDI9_SHIFT (9U) -/*! PDI9 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI9_SHIFT)) & GPIO_PDIR_PDI9_MASK) - -#define GPIO_PDIR_PDI10_MASK (0x400U) -#define GPIO_PDIR_PDI10_SHIFT (10U) -/*! PDI10 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI10_SHIFT)) & GPIO_PDIR_PDI10_MASK) - -#define GPIO_PDIR_PDI11_MASK (0x800U) -#define GPIO_PDIR_PDI11_SHIFT (11U) -/*! PDI11 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI11_SHIFT)) & GPIO_PDIR_PDI11_MASK) - -#define GPIO_PDIR_PDI12_MASK (0x1000U) -#define GPIO_PDIR_PDI12_SHIFT (12U) -/*! PDI12 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI12_SHIFT)) & GPIO_PDIR_PDI12_MASK) - -#define GPIO_PDIR_PDI13_MASK (0x2000U) -#define GPIO_PDIR_PDI13_SHIFT (13U) -/*! PDI13 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI13_SHIFT)) & GPIO_PDIR_PDI13_MASK) - -#define GPIO_PDIR_PDI14_MASK (0x4000U) -#define GPIO_PDIR_PDI14_SHIFT (14U) -/*! PDI14 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI14_SHIFT)) & GPIO_PDIR_PDI14_MASK) - -#define GPIO_PDIR_PDI15_MASK (0x8000U) -#define GPIO_PDIR_PDI15_SHIFT (15U) -/*! PDI15 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI15_SHIFT)) & GPIO_PDIR_PDI15_MASK) - -#define GPIO_PDIR_PDI16_MASK (0x10000U) -#define GPIO_PDIR_PDI16_SHIFT (16U) -/*! PDI16 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI16_SHIFT)) & GPIO_PDIR_PDI16_MASK) - -#define GPIO_PDIR_PDI17_MASK (0x20000U) -#define GPIO_PDIR_PDI17_SHIFT (17U) -/*! PDI17 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI17_SHIFT)) & GPIO_PDIR_PDI17_MASK) - -#define GPIO_PDIR_PDI18_MASK (0x40000U) -#define GPIO_PDIR_PDI18_SHIFT (18U) -/*! PDI18 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI18_SHIFT)) & GPIO_PDIR_PDI18_MASK) - -#define GPIO_PDIR_PDI19_MASK (0x80000U) -#define GPIO_PDIR_PDI19_SHIFT (19U) -/*! PDI19 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI19_SHIFT)) & GPIO_PDIR_PDI19_MASK) - -#define GPIO_PDIR_PDI20_MASK (0x100000U) -#define GPIO_PDIR_PDI20_SHIFT (20U) -/*! PDI20 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI20_SHIFT)) & GPIO_PDIR_PDI20_MASK) - -#define GPIO_PDIR_PDI21_MASK (0x200000U) -#define GPIO_PDIR_PDI21_SHIFT (21U) -/*! PDI21 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI21_SHIFT)) & GPIO_PDIR_PDI21_MASK) - -#define GPIO_PDIR_PDI22_MASK (0x400000U) -#define GPIO_PDIR_PDI22_SHIFT (22U) -/*! PDI22 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI22_SHIFT)) & GPIO_PDIR_PDI22_MASK) - -#define GPIO_PDIR_PDI23_MASK (0x800000U) -#define GPIO_PDIR_PDI23_SHIFT (23U) -/*! PDI23 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI23_SHIFT)) & GPIO_PDIR_PDI23_MASK) - -#define GPIO_PDIR_PDI24_MASK (0x1000000U) -#define GPIO_PDIR_PDI24_SHIFT (24U) -/*! PDI24 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI24_SHIFT)) & GPIO_PDIR_PDI24_MASK) - -#define GPIO_PDIR_PDI25_MASK (0x2000000U) -#define GPIO_PDIR_PDI25_SHIFT (25U) -/*! PDI25 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI25_SHIFT)) & GPIO_PDIR_PDI25_MASK) - -#define GPIO_PDIR_PDI26_MASK (0x4000000U) -#define GPIO_PDIR_PDI26_SHIFT (26U) -/*! PDI26 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI26_SHIFT)) & GPIO_PDIR_PDI26_MASK) - -#define GPIO_PDIR_PDI27_MASK (0x8000000U) -#define GPIO_PDIR_PDI27_SHIFT (27U) -/*! PDI27 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI27_SHIFT)) & GPIO_PDIR_PDI27_MASK) - -#define GPIO_PDIR_PDI28_MASK (0x10000000U) -#define GPIO_PDIR_PDI28_SHIFT (28U) -/*! PDI28 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI28_SHIFT)) & GPIO_PDIR_PDI28_MASK) - -#define GPIO_PDIR_PDI29_MASK (0x20000000U) -#define GPIO_PDIR_PDI29_SHIFT (29U) -/*! PDI29 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI29_SHIFT)) & GPIO_PDIR_PDI29_MASK) - -#define GPIO_PDIR_PDI30_MASK (0x40000000U) -#define GPIO_PDIR_PDI30_SHIFT (30U) -/*! PDI30 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI30_SHIFT)) & GPIO_PDIR_PDI30_MASK) - -#define GPIO_PDIR_PDI31_MASK (0x80000000U) -#define GPIO_PDIR_PDI31_SHIFT (31U) -/*! PDI31 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI31_SHIFT)) & GPIO_PDIR_PDI31_MASK) -/*! @} */ - -/*! @name PDDR - Port Data Direction */ -/*! @{ */ - -#define GPIO_PDDR_PDD0_MASK (0x1U) -#define GPIO_PDDR_PDD0_SHIFT (0U) -/*! PDD0 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD0_SHIFT)) & GPIO_PDDR_PDD0_MASK) - -#define GPIO_PDDR_PDD1_MASK (0x2U) -#define GPIO_PDDR_PDD1_SHIFT (1U) -/*! PDD1 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD1_SHIFT)) & GPIO_PDDR_PDD1_MASK) - -#define GPIO_PDDR_PDD2_MASK (0x4U) -#define GPIO_PDDR_PDD2_SHIFT (2U) -/*! PDD2 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD2_SHIFT)) & GPIO_PDDR_PDD2_MASK) - -#define GPIO_PDDR_PDD3_MASK (0x8U) -#define GPIO_PDDR_PDD3_SHIFT (3U) -/*! PDD3 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD3_SHIFT)) & GPIO_PDDR_PDD3_MASK) - -#define GPIO_PDDR_PDD4_MASK (0x10U) -#define GPIO_PDDR_PDD4_SHIFT (4U) -/*! PDD4 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD4_SHIFT)) & GPIO_PDDR_PDD4_MASK) - -#define GPIO_PDDR_PDD5_MASK (0x20U) -#define GPIO_PDDR_PDD5_SHIFT (5U) -/*! PDD5 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD5_SHIFT)) & GPIO_PDDR_PDD5_MASK) - -#define GPIO_PDDR_PDD6_MASK (0x40U) -#define GPIO_PDDR_PDD6_SHIFT (6U) -/*! PDD6 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD6_SHIFT)) & GPIO_PDDR_PDD6_MASK) - -#define GPIO_PDDR_PDD7_MASK (0x80U) -#define GPIO_PDDR_PDD7_SHIFT (7U) -/*! PDD7 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD7_SHIFT)) & GPIO_PDDR_PDD7_MASK) - -#define GPIO_PDDR_PDD8_MASK (0x100U) -#define GPIO_PDDR_PDD8_SHIFT (8U) -/*! PDD8 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD8_SHIFT)) & GPIO_PDDR_PDD8_MASK) - -#define GPIO_PDDR_PDD9_MASK (0x200U) -#define GPIO_PDDR_PDD9_SHIFT (9U) -/*! PDD9 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD9_SHIFT)) & GPIO_PDDR_PDD9_MASK) - -#define GPIO_PDDR_PDD10_MASK (0x400U) -#define GPIO_PDDR_PDD10_SHIFT (10U) -/*! PDD10 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD10_SHIFT)) & GPIO_PDDR_PDD10_MASK) - -#define GPIO_PDDR_PDD11_MASK (0x800U) -#define GPIO_PDDR_PDD11_SHIFT (11U) -/*! PDD11 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD11_SHIFT)) & GPIO_PDDR_PDD11_MASK) - -#define GPIO_PDDR_PDD12_MASK (0x1000U) -#define GPIO_PDDR_PDD12_SHIFT (12U) -/*! PDD12 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD12_SHIFT)) & GPIO_PDDR_PDD12_MASK) - -#define GPIO_PDDR_PDD13_MASK (0x2000U) -#define GPIO_PDDR_PDD13_SHIFT (13U) -/*! PDD13 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD13_SHIFT)) & GPIO_PDDR_PDD13_MASK) - -#define GPIO_PDDR_PDD14_MASK (0x4000U) -#define GPIO_PDDR_PDD14_SHIFT (14U) -/*! PDD14 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD14_SHIFT)) & GPIO_PDDR_PDD14_MASK) - -#define GPIO_PDDR_PDD15_MASK (0x8000U) -#define GPIO_PDDR_PDD15_SHIFT (15U) -/*! PDD15 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD15_SHIFT)) & GPIO_PDDR_PDD15_MASK) - -#define GPIO_PDDR_PDD16_MASK (0x10000U) -#define GPIO_PDDR_PDD16_SHIFT (16U) -/*! PDD16 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD16_SHIFT)) & GPIO_PDDR_PDD16_MASK) - -#define GPIO_PDDR_PDD17_MASK (0x20000U) -#define GPIO_PDDR_PDD17_SHIFT (17U) -/*! PDD17 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD17_SHIFT)) & GPIO_PDDR_PDD17_MASK) - -#define GPIO_PDDR_PDD18_MASK (0x40000U) -#define GPIO_PDDR_PDD18_SHIFT (18U) -/*! PDD18 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD18_SHIFT)) & GPIO_PDDR_PDD18_MASK) - -#define GPIO_PDDR_PDD19_MASK (0x80000U) -#define GPIO_PDDR_PDD19_SHIFT (19U) -/*! PDD19 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD19_SHIFT)) & GPIO_PDDR_PDD19_MASK) - -#define GPIO_PDDR_PDD20_MASK (0x100000U) -#define GPIO_PDDR_PDD20_SHIFT (20U) -/*! PDD20 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD20_SHIFT)) & GPIO_PDDR_PDD20_MASK) - -#define GPIO_PDDR_PDD21_MASK (0x200000U) -#define GPIO_PDDR_PDD21_SHIFT (21U) -/*! PDD21 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD21_SHIFT)) & GPIO_PDDR_PDD21_MASK) - -#define GPIO_PDDR_PDD22_MASK (0x400000U) -#define GPIO_PDDR_PDD22_SHIFT (22U) -/*! PDD22 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD22_SHIFT)) & GPIO_PDDR_PDD22_MASK) - -#define GPIO_PDDR_PDD23_MASK (0x800000U) -#define GPIO_PDDR_PDD23_SHIFT (23U) -/*! PDD23 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD23_SHIFT)) & GPIO_PDDR_PDD23_MASK) - -#define GPIO_PDDR_PDD24_MASK (0x1000000U) -#define GPIO_PDDR_PDD24_SHIFT (24U) -/*! PDD24 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD24_SHIFT)) & GPIO_PDDR_PDD24_MASK) - -#define GPIO_PDDR_PDD25_MASK (0x2000000U) -#define GPIO_PDDR_PDD25_SHIFT (25U) -/*! PDD25 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD25_SHIFT)) & GPIO_PDDR_PDD25_MASK) - -#define GPIO_PDDR_PDD26_MASK (0x4000000U) -#define GPIO_PDDR_PDD26_SHIFT (26U) -/*! PDD26 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD26_SHIFT)) & GPIO_PDDR_PDD26_MASK) - -#define GPIO_PDDR_PDD27_MASK (0x8000000U) -#define GPIO_PDDR_PDD27_SHIFT (27U) -/*! PDD27 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD27_SHIFT)) & GPIO_PDDR_PDD27_MASK) - -#define GPIO_PDDR_PDD28_MASK (0x10000000U) -#define GPIO_PDDR_PDD28_SHIFT (28U) -/*! PDD28 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD28_SHIFT)) & GPIO_PDDR_PDD28_MASK) - -#define GPIO_PDDR_PDD29_MASK (0x20000000U) -#define GPIO_PDDR_PDD29_SHIFT (29U) -/*! PDD29 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD29_SHIFT)) & GPIO_PDDR_PDD29_MASK) - -#define GPIO_PDDR_PDD30_MASK (0x40000000U) -#define GPIO_PDDR_PDD30_SHIFT (30U) -/*! PDD30 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD30_SHIFT)) & GPIO_PDDR_PDD30_MASK) - -#define GPIO_PDDR_PDD31_MASK (0x80000000U) -#define GPIO_PDDR_PDD31_SHIFT (31U) -/*! PDD31 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD31_SHIFT)) & GPIO_PDDR_PDD31_MASK) -/*! @} */ - -/*! @name PIDR - Port Input Disable */ -/*! @{ */ - -#define GPIO_PIDR_PID0_MASK (0x1U) -#define GPIO_PIDR_PID0_SHIFT (0U) -/*! PID0 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID0_SHIFT)) & GPIO_PIDR_PID0_MASK) - -#define GPIO_PIDR_PID1_MASK (0x2U) -#define GPIO_PIDR_PID1_SHIFT (1U) -/*! PID1 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID1_SHIFT)) & GPIO_PIDR_PID1_MASK) - -#define GPIO_PIDR_PID2_MASK (0x4U) -#define GPIO_PIDR_PID2_SHIFT (2U) -/*! PID2 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID2_SHIFT)) & GPIO_PIDR_PID2_MASK) - -#define GPIO_PIDR_PID3_MASK (0x8U) -#define GPIO_PIDR_PID3_SHIFT (3U) -/*! PID3 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID3_SHIFT)) & GPIO_PIDR_PID3_MASK) - -#define GPIO_PIDR_PID4_MASK (0x10U) -#define GPIO_PIDR_PID4_SHIFT (4U) -/*! PID4 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID4_SHIFT)) & GPIO_PIDR_PID4_MASK) - -#define GPIO_PIDR_PID5_MASK (0x20U) -#define GPIO_PIDR_PID5_SHIFT (5U) -/*! PID5 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID5_SHIFT)) & GPIO_PIDR_PID5_MASK) - -#define GPIO_PIDR_PID6_MASK (0x40U) -#define GPIO_PIDR_PID6_SHIFT (6U) -/*! PID6 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID6_SHIFT)) & GPIO_PIDR_PID6_MASK) - -#define GPIO_PIDR_PID7_MASK (0x80U) -#define GPIO_PIDR_PID7_SHIFT (7U) -/*! PID7 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID7_SHIFT)) & GPIO_PIDR_PID7_MASK) - -#define GPIO_PIDR_PID8_MASK (0x100U) -#define GPIO_PIDR_PID8_SHIFT (8U) -/*! PID8 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID8_SHIFT)) & GPIO_PIDR_PID8_MASK) - -#define GPIO_PIDR_PID9_MASK (0x200U) -#define GPIO_PIDR_PID9_SHIFT (9U) -/*! PID9 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID9_SHIFT)) & GPIO_PIDR_PID9_MASK) - -#define GPIO_PIDR_PID10_MASK (0x400U) -#define GPIO_PIDR_PID10_SHIFT (10U) -/*! PID10 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID10_SHIFT)) & GPIO_PIDR_PID10_MASK) - -#define GPIO_PIDR_PID11_MASK (0x800U) -#define GPIO_PIDR_PID11_SHIFT (11U) -/*! PID11 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID11_SHIFT)) & GPIO_PIDR_PID11_MASK) - -#define GPIO_PIDR_PID12_MASK (0x1000U) -#define GPIO_PIDR_PID12_SHIFT (12U) -/*! PID12 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID12_SHIFT)) & GPIO_PIDR_PID12_MASK) - -#define GPIO_PIDR_PID13_MASK (0x2000U) -#define GPIO_PIDR_PID13_SHIFT (13U) -/*! PID13 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID13_SHIFT)) & GPIO_PIDR_PID13_MASK) - -#define GPIO_PIDR_PID14_MASK (0x4000U) -#define GPIO_PIDR_PID14_SHIFT (14U) -/*! PID14 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID14_SHIFT)) & GPIO_PIDR_PID14_MASK) - -#define GPIO_PIDR_PID15_MASK (0x8000U) -#define GPIO_PIDR_PID15_SHIFT (15U) -/*! PID15 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID15_SHIFT)) & GPIO_PIDR_PID15_MASK) - -#define GPIO_PIDR_PID16_MASK (0x10000U) -#define GPIO_PIDR_PID16_SHIFT (16U) -/*! PID16 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID16_SHIFT)) & GPIO_PIDR_PID16_MASK) - -#define GPIO_PIDR_PID17_MASK (0x20000U) -#define GPIO_PIDR_PID17_SHIFT (17U) -/*! PID17 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID17_SHIFT)) & GPIO_PIDR_PID17_MASK) - -#define GPIO_PIDR_PID18_MASK (0x40000U) -#define GPIO_PIDR_PID18_SHIFT (18U) -/*! PID18 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID18_SHIFT)) & GPIO_PIDR_PID18_MASK) - -#define GPIO_PIDR_PID19_MASK (0x80000U) -#define GPIO_PIDR_PID19_SHIFT (19U) -/*! PID19 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID19_SHIFT)) & GPIO_PIDR_PID19_MASK) - -#define GPIO_PIDR_PID20_MASK (0x100000U) -#define GPIO_PIDR_PID20_SHIFT (20U) -/*! PID20 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID20_SHIFT)) & GPIO_PIDR_PID20_MASK) - -#define GPIO_PIDR_PID21_MASK (0x200000U) -#define GPIO_PIDR_PID21_SHIFT (21U) -/*! PID21 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID21_SHIFT)) & GPIO_PIDR_PID21_MASK) - -#define GPIO_PIDR_PID22_MASK (0x400000U) -#define GPIO_PIDR_PID22_SHIFT (22U) -/*! PID22 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID22_SHIFT)) & GPIO_PIDR_PID22_MASK) - -#define GPIO_PIDR_PID23_MASK (0x800000U) -#define GPIO_PIDR_PID23_SHIFT (23U) -/*! PID23 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID23_SHIFT)) & GPIO_PIDR_PID23_MASK) - -#define GPIO_PIDR_PID24_MASK (0x1000000U) -#define GPIO_PIDR_PID24_SHIFT (24U) -/*! PID24 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID24_SHIFT)) & GPIO_PIDR_PID24_MASK) - -#define GPIO_PIDR_PID25_MASK (0x2000000U) -#define GPIO_PIDR_PID25_SHIFT (25U) -/*! PID25 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID25_SHIFT)) & GPIO_PIDR_PID25_MASK) - -#define GPIO_PIDR_PID26_MASK (0x4000000U) -#define GPIO_PIDR_PID26_SHIFT (26U) -/*! PID26 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID26_SHIFT)) & GPIO_PIDR_PID26_MASK) - -#define GPIO_PIDR_PID27_MASK (0x8000000U) -#define GPIO_PIDR_PID27_SHIFT (27U) -/*! PID27 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID27_SHIFT)) & GPIO_PIDR_PID27_MASK) - -#define GPIO_PIDR_PID28_MASK (0x10000000U) -#define GPIO_PIDR_PID28_SHIFT (28U) -/*! PID28 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID28_SHIFT)) & GPIO_PIDR_PID28_MASK) - -#define GPIO_PIDR_PID29_MASK (0x20000000U) -#define GPIO_PIDR_PID29_SHIFT (29U) -/*! PID29 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID29_SHIFT)) & GPIO_PIDR_PID29_MASK) - -#define GPIO_PIDR_PID30_MASK (0x40000000U) -#define GPIO_PIDR_PID30_SHIFT (30U) -/*! PID30 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID30_SHIFT)) & GPIO_PIDR_PID30_MASK) - -#define GPIO_PIDR_PID31_MASK (0x80000000U) -#define GPIO_PIDR_PID31_SHIFT (31U) -/*! PID31 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID31_SHIFT)) & GPIO_PIDR_PID31_MASK) -/*! @} */ - -/*! @name PDR - Pin Data */ -/*! @{ */ - -#define GPIO_PDR_PD_MASK (0x1U) -#define GPIO_PDR_PD_SHIFT (0U) -/*! PD - Pin Data (I/O) - * 0b0..Logic zero - * 0b1..Logic one - */ -#define GPIO_PDR_PD(x) (((uint8_t)(((uint8_t)(x)) << GPIO_PDR_PD_SHIFT)) & GPIO_PDR_PD_MASK) -/*! @} */ - -/* The count of GPIO_PDR */ -#define GPIO_PDR_COUNT (32U) - -/*! @name ICR - Interrupt Control 0..Interrupt Control 31 */ -/*! @{ */ - -#define GPIO_ICR_IRQC_MASK (0xF0000U) -#define GPIO_ICR_IRQC_SHIFT (16U) -/*! IRQC - Interrupt Configuration - * 0b0000..ISF is disabled - * 0b0001..ISF and DMA request on rising edge - * 0b0010..ISF and DMA request on falling edge - * 0b0011..ISF and DMA request on either edge - * 0b0100..Reserved - * 0b0101..ISF sets on rising edge - * 0b0110..ISF sets on falling edge - * 0b0111..ISF sets on either edge - * 0b1000..ISF and interrupt when logic 0 - * 0b1001..ISF and interrupt on rising edge - * 0b1010..ISF and interrupt on falling edge - * 0b1011..ISF and Interrupt on either edge - * 0b1100..ISF and interrupt when logic 1 - * 0b1101..Enable active-high trigger output; ISF on rising edge (pin state is ORed with other enabled triggers - * to generate the output trigger for use by other peripherals) - * 0b1110..Enable active-low trigger output; ISF on falling edge (pin state is inverted and ORed with other - * enabled triggers to generate the output trigger for use by other peripherals) - * 0b1111..Reserved - */ -#define GPIO_ICR_IRQC(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ICR_IRQC_SHIFT)) & GPIO_ICR_IRQC_MASK) - -#define GPIO_ICR_ISF_MASK (0x1000000U) -#define GPIO_ICR_ISF_SHIFT (24U) -/*! ISF - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ICR_ISF(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ICR_ISF_SHIFT)) & GPIO_ICR_ISF_MASK) -/*! @} */ - -/* The count of GPIO_ICR */ -#define GPIO_ICR_COUNT (32U) - -/*! @name GICLR - Global Interrupt Control Low */ -/*! @{ */ - -#define GPIO_GICLR_GIWE0_MASK (0x1U) -#define GPIO_GICLR_GIWE0_SHIFT (0U) -/*! GIWE0 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE0_SHIFT)) & GPIO_GICLR_GIWE0_MASK) - -#define GPIO_GICLR_GIWE1_MASK (0x2U) -#define GPIO_GICLR_GIWE1_SHIFT (1U) -/*! GIWE1 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE1_SHIFT)) & GPIO_GICLR_GIWE1_MASK) - -#define GPIO_GICLR_GIWE2_MASK (0x4U) -#define GPIO_GICLR_GIWE2_SHIFT (2U) -/*! GIWE2 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE2_SHIFT)) & GPIO_GICLR_GIWE2_MASK) - -#define GPIO_GICLR_GIWE3_MASK (0x8U) -#define GPIO_GICLR_GIWE3_SHIFT (3U) -/*! GIWE3 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE3_SHIFT)) & GPIO_GICLR_GIWE3_MASK) - -#define GPIO_GICLR_GIWE4_MASK (0x10U) -#define GPIO_GICLR_GIWE4_SHIFT (4U) -/*! GIWE4 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE4_SHIFT)) & GPIO_GICLR_GIWE4_MASK) - -#define GPIO_GICLR_GIWE5_MASK (0x20U) -#define GPIO_GICLR_GIWE5_SHIFT (5U) -/*! GIWE5 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE5_SHIFT)) & GPIO_GICLR_GIWE5_MASK) - -#define GPIO_GICLR_GIWE6_MASK (0x40U) -#define GPIO_GICLR_GIWE6_SHIFT (6U) -/*! GIWE6 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE6_SHIFT)) & GPIO_GICLR_GIWE6_MASK) - -#define GPIO_GICLR_GIWE7_MASK (0x80U) -#define GPIO_GICLR_GIWE7_SHIFT (7U) -/*! GIWE7 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE7_SHIFT)) & GPIO_GICLR_GIWE7_MASK) - -#define GPIO_GICLR_GIWE8_MASK (0x100U) -#define GPIO_GICLR_GIWE8_SHIFT (8U) -/*! GIWE8 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE8_SHIFT)) & GPIO_GICLR_GIWE8_MASK) - -#define GPIO_GICLR_GIWE9_MASK (0x200U) -#define GPIO_GICLR_GIWE9_SHIFT (9U) -/*! GIWE9 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE9_SHIFT)) & GPIO_GICLR_GIWE9_MASK) - -#define GPIO_GICLR_GIWE10_MASK (0x400U) -#define GPIO_GICLR_GIWE10_SHIFT (10U) -/*! GIWE10 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE10_SHIFT)) & GPIO_GICLR_GIWE10_MASK) - -#define GPIO_GICLR_GIWE11_MASK (0x800U) -#define GPIO_GICLR_GIWE11_SHIFT (11U) -/*! GIWE11 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE11_SHIFT)) & GPIO_GICLR_GIWE11_MASK) - -#define GPIO_GICLR_GIWE12_MASK (0x1000U) -#define GPIO_GICLR_GIWE12_SHIFT (12U) -/*! GIWE12 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE12_SHIFT)) & GPIO_GICLR_GIWE12_MASK) - -#define GPIO_GICLR_GIWE13_MASK (0x2000U) -#define GPIO_GICLR_GIWE13_SHIFT (13U) -/*! GIWE13 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE13_SHIFT)) & GPIO_GICLR_GIWE13_MASK) - -#define GPIO_GICLR_GIWE14_MASK (0x4000U) -#define GPIO_GICLR_GIWE14_SHIFT (14U) -/*! GIWE14 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE14_SHIFT)) & GPIO_GICLR_GIWE14_MASK) - -#define GPIO_GICLR_GIWE15_MASK (0x8000U) -#define GPIO_GICLR_GIWE15_SHIFT (15U) -/*! GIWE15 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE15_SHIFT)) & GPIO_GICLR_GIWE15_MASK) - -#define GPIO_GICLR_GIWD_MASK (0xFFFF0000U) -#define GPIO_GICLR_GIWD_SHIFT (16U) -/*! GIWD - Global Interrupt Write Data */ -#define GPIO_GICLR_GIWD(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWD_SHIFT)) & GPIO_GICLR_GIWD_MASK) -/*! @} */ - -/*! @name GICHR - Global Interrupt Control High */ -/*! @{ */ - -#define GPIO_GICHR_GIWE16_MASK (0x1U) -#define GPIO_GICHR_GIWE16_SHIFT (0U) -/*! GIWE16 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE16_SHIFT)) & GPIO_GICHR_GIWE16_MASK) - -#define GPIO_GICHR_GIWE17_MASK (0x2U) -#define GPIO_GICHR_GIWE17_SHIFT (1U) -/*! GIWE17 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE17_SHIFT)) & GPIO_GICHR_GIWE17_MASK) - -#define GPIO_GICHR_GIWE18_MASK (0x4U) -#define GPIO_GICHR_GIWE18_SHIFT (2U) -/*! GIWE18 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE18_SHIFT)) & GPIO_GICHR_GIWE18_MASK) - -#define GPIO_GICHR_GIWE19_MASK (0x8U) -#define GPIO_GICHR_GIWE19_SHIFT (3U) -/*! GIWE19 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE19_SHIFT)) & GPIO_GICHR_GIWE19_MASK) - -#define GPIO_GICHR_GIWE20_MASK (0x10U) -#define GPIO_GICHR_GIWE20_SHIFT (4U) -/*! GIWE20 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE20_SHIFT)) & GPIO_GICHR_GIWE20_MASK) - -#define GPIO_GICHR_GIWE21_MASK (0x20U) -#define GPIO_GICHR_GIWE21_SHIFT (5U) -/*! GIWE21 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE21_SHIFT)) & GPIO_GICHR_GIWE21_MASK) - -#define GPIO_GICHR_GIWE22_MASK (0x40U) -#define GPIO_GICHR_GIWE22_SHIFT (6U) -/*! GIWE22 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE22_SHIFT)) & GPIO_GICHR_GIWE22_MASK) - -#define GPIO_GICHR_GIWE23_MASK (0x80U) -#define GPIO_GICHR_GIWE23_SHIFT (7U) -/*! GIWE23 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE23_SHIFT)) & GPIO_GICHR_GIWE23_MASK) - -#define GPIO_GICHR_GIWE24_MASK (0x100U) -#define GPIO_GICHR_GIWE24_SHIFT (8U) -/*! GIWE24 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE24_SHIFT)) & GPIO_GICHR_GIWE24_MASK) - -#define GPIO_GICHR_GIWE25_MASK (0x200U) -#define GPIO_GICHR_GIWE25_SHIFT (9U) -/*! GIWE25 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE25_SHIFT)) & GPIO_GICHR_GIWE25_MASK) - -#define GPIO_GICHR_GIWE26_MASK (0x400U) -#define GPIO_GICHR_GIWE26_SHIFT (10U) -/*! GIWE26 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE26_SHIFT)) & GPIO_GICHR_GIWE26_MASK) - -#define GPIO_GICHR_GIWE27_MASK (0x800U) -#define GPIO_GICHR_GIWE27_SHIFT (11U) -/*! GIWE27 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE27_SHIFT)) & GPIO_GICHR_GIWE27_MASK) - -#define GPIO_GICHR_GIWE28_MASK (0x1000U) -#define GPIO_GICHR_GIWE28_SHIFT (12U) -/*! GIWE28 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE28_SHIFT)) & GPIO_GICHR_GIWE28_MASK) - -#define GPIO_GICHR_GIWE29_MASK (0x2000U) -#define GPIO_GICHR_GIWE29_SHIFT (13U) -/*! GIWE29 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE29_SHIFT)) & GPIO_GICHR_GIWE29_MASK) - -#define GPIO_GICHR_GIWE30_MASK (0x4000U) -#define GPIO_GICHR_GIWE30_SHIFT (14U) -/*! GIWE30 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE30_SHIFT)) & GPIO_GICHR_GIWE30_MASK) - -#define GPIO_GICHR_GIWE31_MASK (0x8000U) -#define GPIO_GICHR_GIWE31_SHIFT (15U) -/*! GIWE31 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE31_SHIFT)) & GPIO_GICHR_GIWE31_MASK) - -#define GPIO_GICHR_GIWD_MASK (0xFFFF0000U) -#define GPIO_GICHR_GIWD_SHIFT (16U) -/*! GIWD - Global Interrupt Write Data */ -#define GPIO_GICHR_GIWD(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWD_SHIFT)) & GPIO_GICHR_GIWD_MASK) -/*! @} */ - -/*! @name ISFR - Interrupt Status Flag */ -/*! @{ */ - -#define GPIO_ISFR_ISF0_MASK (0x1U) -#define GPIO_ISFR_ISF0_SHIFT (0U) -/*! ISF0 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF0_SHIFT)) & GPIO_ISFR_ISF0_MASK) - -#define GPIO_ISFR_ISF1_MASK (0x2U) -#define GPIO_ISFR_ISF1_SHIFT (1U) -/*! ISF1 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF1_SHIFT)) & GPIO_ISFR_ISF1_MASK) - -#define GPIO_ISFR_ISF2_MASK (0x4U) -#define GPIO_ISFR_ISF2_SHIFT (2U) -/*! ISF2 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF2_SHIFT)) & GPIO_ISFR_ISF2_MASK) - -#define GPIO_ISFR_ISF3_MASK (0x8U) -#define GPIO_ISFR_ISF3_SHIFT (3U) -/*! ISF3 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF3_SHIFT)) & GPIO_ISFR_ISF3_MASK) - -#define GPIO_ISFR_ISF4_MASK (0x10U) -#define GPIO_ISFR_ISF4_SHIFT (4U) -/*! ISF4 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF4_SHIFT)) & GPIO_ISFR_ISF4_MASK) - -#define GPIO_ISFR_ISF5_MASK (0x20U) -#define GPIO_ISFR_ISF5_SHIFT (5U) -/*! ISF5 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF5_SHIFT)) & GPIO_ISFR_ISF5_MASK) - -#define GPIO_ISFR_ISF6_MASK (0x40U) -#define GPIO_ISFR_ISF6_SHIFT (6U) -/*! ISF6 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF6_SHIFT)) & GPIO_ISFR_ISF6_MASK) - -#define GPIO_ISFR_ISF7_MASK (0x80U) -#define GPIO_ISFR_ISF7_SHIFT (7U) -/*! ISF7 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF7_SHIFT)) & GPIO_ISFR_ISF7_MASK) - -#define GPIO_ISFR_ISF8_MASK (0x100U) -#define GPIO_ISFR_ISF8_SHIFT (8U) -/*! ISF8 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF8_SHIFT)) & GPIO_ISFR_ISF8_MASK) - -#define GPIO_ISFR_ISF9_MASK (0x200U) -#define GPIO_ISFR_ISF9_SHIFT (9U) -/*! ISF9 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF9_SHIFT)) & GPIO_ISFR_ISF9_MASK) - -#define GPIO_ISFR_ISF10_MASK (0x400U) -#define GPIO_ISFR_ISF10_SHIFT (10U) -/*! ISF10 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF10_SHIFT)) & GPIO_ISFR_ISF10_MASK) - -#define GPIO_ISFR_ISF11_MASK (0x800U) -#define GPIO_ISFR_ISF11_SHIFT (11U) -/*! ISF11 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF11_SHIFT)) & GPIO_ISFR_ISF11_MASK) - -#define GPIO_ISFR_ISF12_MASK (0x1000U) -#define GPIO_ISFR_ISF12_SHIFT (12U) -/*! ISF12 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF12_SHIFT)) & GPIO_ISFR_ISF12_MASK) - -#define GPIO_ISFR_ISF13_MASK (0x2000U) -#define GPIO_ISFR_ISF13_SHIFT (13U) -/*! ISF13 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF13_SHIFT)) & GPIO_ISFR_ISF13_MASK) - -#define GPIO_ISFR_ISF14_MASK (0x4000U) -#define GPIO_ISFR_ISF14_SHIFT (14U) -/*! ISF14 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF14_SHIFT)) & GPIO_ISFR_ISF14_MASK) - -#define GPIO_ISFR_ISF15_MASK (0x8000U) -#define GPIO_ISFR_ISF15_SHIFT (15U) -/*! ISF15 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF15_SHIFT)) & GPIO_ISFR_ISF15_MASK) - -#define GPIO_ISFR_ISF16_MASK (0x10000U) -#define GPIO_ISFR_ISF16_SHIFT (16U) -/*! ISF16 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF16_SHIFT)) & GPIO_ISFR_ISF16_MASK) - -#define GPIO_ISFR_ISF17_MASK (0x20000U) -#define GPIO_ISFR_ISF17_SHIFT (17U) -/*! ISF17 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF17_SHIFT)) & GPIO_ISFR_ISF17_MASK) - -#define GPIO_ISFR_ISF18_MASK (0x40000U) -#define GPIO_ISFR_ISF18_SHIFT (18U) -/*! ISF18 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF18_SHIFT)) & GPIO_ISFR_ISF18_MASK) - -#define GPIO_ISFR_ISF19_MASK (0x80000U) -#define GPIO_ISFR_ISF19_SHIFT (19U) -/*! ISF19 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF19_SHIFT)) & GPIO_ISFR_ISF19_MASK) - -#define GPIO_ISFR_ISF20_MASK (0x100000U) -#define GPIO_ISFR_ISF20_SHIFT (20U) -/*! ISF20 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF20_SHIFT)) & GPIO_ISFR_ISF20_MASK) - -#define GPIO_ISFR_ISF21_MASK (0x200000U) -#define GPIO_ISFR_ISF21_SHIFT (21U) -/*! ISF21 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF21_SHIFT)) & GPIO_ISFR_ISF21_MASK) - -#define GPIO_ISFR_ISF22_MASK (0x400000U) -#define GPIO_ISFR_ISF22_SHIFT (22U) -/*! ISF22 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF22_SHIFT)) & GPIO_ISFR_ISF22_MASK) - -#define GPIO_ISFR_ISF23_MASK (0x800000U) -#define GPIO_ISFR_ISF23_SHIFT (23U) -/*! ISF23 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF23_SHIFT)) & GPIO_ISFR_ISF23_MASK) - -#define GPIO_ISFR_ISF24_MASK (0x1000000U) -#define GPIO_ISFR_ISF24_SHIFT (24U) -/*! ISF24 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF24_SHIFT)) & GPIO_ISFR_ISF24_MASK) - -#define GPIO_ISFR_ISF25_MASK (0x2000000U) -#define GPIO_ISFR_ISF25_SHIFT (25U) -/*! ISF25 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF25_SHIFT)) & GPIO_ISFR_ISF25_MASK) - -#define GPIO_ISFR_ISF26_MASK (0x4000000U) -#define GPIO_ISFR_ISF26_SHIFT (26U) -/*! ISF26 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF26_SHIFT)) & GPIO_ISFR_ISF26_MASK) - -#define GPIO_ISFR_ISF27_MASK (0x8000000U) -#define GPIO_ISFR_ISF27_SHIFT (27U) -/*! ISF27 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF27_SHIFT)) & GPIO_ISFR_ISF27_MASK) - -#define GPIO_ISFR_ISF28_MASK (0x10000000U) -#define GPIO_ISFR_ISF28_SHIFT (28U) -/*! ISF28 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF28_SHIFT)) & GPIO_ISFR_ISF28_MASK) - -#define GPIO_ISFR_ISF29_MASK (0x20000000U) -#define GPIO_ISFR_ISF29_SHIFT (29U) -/*! ISF29 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF29_SHIFT)) & GPIO_ISFR_ISF29_MASK) - -#define GPIO_ISFR_ISF30_MASK (0x40000000U) -#define GPIO_ISFR_ISF30_SHIFT (30U) -/*! ISF30 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF30_SHIFT)) & GPIO_ISFR_ISF30_MASK) - -#define GPIO_ISFR_ISF31_MASK (0x80000000U) -#define GPIO_ISFR_ISF31_SHIFT (31U) -/*! ISF31 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF31_SHIFT)) & GPIO_ISFR_ISF31_MASK) -/*! @} */ - -/* The count of GPIO_ISFR */ -#define GPIO_ISFR_COUNT (1U) - - -/*! - * @} - */ /* end of group GPIO_Register_Masks */ - - -/* GPIO - Peripheral instance base addresses */ -/** Peripheral GPIO0 base address */ -#define GPIO0_BASE (0x40102000u) -/** Peripheral GPIO0 base pointer */ -#define GPIO0 ((GPIO_Type *)GPIO0_BASE) -/** Peripheral GPIO1 base address */ -#define GPIO1_BASE (0x40103000u) -/** Peripheral GPIO1 base pointer */ -#define GPIO1 ((GPIO_Type *)GPIO1_BASE) -/** Peripheral GPIO2 base address */ -#define GPIO2_BASE (0x40104000u) -/** Peripheral GPIO2 base pointer */ -#define GPIO2 ((GPIO_Type *)GPIO2_BASE) -/** Peripheral GPIO3 base address */ -#define GPIO3_BASE (0x40105000u) -/** Peripheral GPIO3 base pointer */ -#define GPIO3 ((GPIO_Type *)GPIO3_BASE) -/** Peripheral GPIO4 base address */ -#define GPIO4_BASE (0x40106000u) -/** Peripheral GPIO4 base pointer */ -#define GPIO4 ((GPIO_Type *)GPIO4_BASE) -/** Array initializer of GPIO peripheral base addresses */ -#define GPIO_BASE_ADDRS { GPIO0_BASE, GPIO1_BASE, GPIO2_BASE, GPIO3_BASE, GPIO4_BASE } -/** Array initializer of GPIO peripheral base pointers */ -#define GPIO_BASE_PTRS { GPIO0, GPIO1, GPIO2, GPIO3, GPIO4 } -/** Interrupt vectors for the GPIO peripheral type */ -#define GPIO_IRQS { GPIO0_IRQn, GPIO1_IRQn, GPIO2_IRQn, GPIO3_IRQn, GPIO4_IRQn } - -/*! - * @} - */ /* end of group GPIO_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- I3C Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup I3C_Peripheral_Access_Layer I3C Peripheral Access Layer - * @{ - */ - -/** I3C - Register Layout Typedef */ -typedef struct { - __IO uint32_t MCONFIG; /**< Controller Configuration, offset: 0x0 */ - __IO uint32_t SCONFIG; /**< Target Configuration, offset: 0x4 */ - __IO uint32_t SSTATUS; /**< Target Status, offset: 0x8 */ - __IO uint32_t SCTRL; /**< Target Control, offset: 0xC */ - __IO uint32_t SINTSET; /**< Target Interrupt Set, offset: 0x10 */ - __IO uint32_t SINTCLR; /**< Target Interrupt Clear, offset: 0x14 */ - __I uint32_t SINTMASKED; /**< Target Interrupt Mask, offset: 0x18 */ - __IO uint32_t SERRWARN; /**< Target Errors and Warnings, offset: 0x1C */ - __IO uint32_t SDMACTRL; /**< Target DMA Control, offset: 0x20 */ - uint8_t RESERVED_0[8]; - __IO uint32_t SDATACTRL; /**< Target Data Control, offset: 0x2C */ - __O uint32_t SWDATAB; /**< Target Write Data Byte, offset: 0x30 */ - __O uint32_t SWDATABE; /**< Target Write Data Byte End, offset: 0x34 */ - __O uint32_t SWDATAH; /**< Target Write Data Halfword, offset: 0x38 */ - __O uint32_t SWDATAHE; /**< Target Write Data Halfword End, offset: 0x3C */ - __I uint32_t SRDATAB; /**< Target Read Data Byte, offset: 0x40 */ - uint8_t RESERVED_1[4]; - __I uint32_t SRDATAH; /**< Target Read Data Halfword, offset: 0x48 */ - uint8_t RESERVED_2[8]; - union { /* offset: 0x54 */ - __O uint32_t SWDATAB1; /**< Target Write Data Byte, offset: 0x54 */ - __O uint32_t SWDATAH1; /**< Target Write Data Halfword, offset: 0x54 */ - }; - uint8_t RESERVED_3[4]; - __I uint32_t SCAPABILITIES2; /**< Target Capabilities 2, offset: 0x5C */ - __I uint32_t SCAPABILITIES; /**< Target Capabilities, offset: 0x60 */ - __IO uint32_t SDYNADDR; /**< Target Dynamic Address, offset: 0x64 */ - __IO uint32_t SMAXLIMITS; /**< Target Maximum Limits, offset: 0x68 */ - __IO uint32_t SIDPARTNO; /**< Target ID Part Number, offset: 0x6C */ - __IO uint32_t SIDEXT; /**< Target ID Extension, offset: 0x70 */ - __IO uint32_t SVENDORID; /**< Target Vendor ID, offset: 0x74 */ - __IO uint32_t STCCLOCK; /**< Target Time Control Clock, offset: 0x78 */ - __I uint32_t SMSGMAPADDR; /**< Target Message Map Address, offset: 0x7C */ - __IO uint32_t MCONFIG_EXT; /**< Controller Extended Configuration, offset: 0x80 */ - __IO uint32_t MCTRL; /**< Controller Control, offset: 0x84 */ - __IO uint32_t MSTATUS; /**< Controller Status, offset: 0x88 */ - __IO uint32_t MIBIRULES; /**< Controller In-band Interrupt Registry and Rules, offset: 0x8C */ - __IO uint32_t MINTSET; /**< Controller Interrupt Set, offset: 0x90 */ - __IO uint32_t MINTCLR; /**< Controller Interrupt Clear, offset: 0x94 */ - __I uint32_t MINTMASKED; /**< Controller Interrupt Mask, offset: 0x98 */ - __IO uint32_t MERRWARN; /**< Controller Errors and Warnings, offset: 0x9C */ - __IO uint32_t MDMACTRL; /**< Controller DMA Control, offset: 0xA0 */ - uint8_t RESERVED_4[8]; - __IO uint32_t MDATACTRL; /**< Controller Data Control, offset: 0xAC */ - __O uint32_t MWDATAB; /**< Controller Write Data Byte, offset: 0xB0 */ - __O uint32_t MWDATABE; /**< Controller Write Data Byte End, offset: 0xB4 */ - __O uint32_t MWDATAH; /**< Controller Write Data Halfword, offset: 0xB8 */ - __O uint32_t MWDATAHE; /**< Controller Write Data Halfword End, offset: 0xBC */ - __I uint32_t MRDATAB; /**< Controller Read Data Byte, offset: 0xC0 */ - uint8_t RESERVED_5[4]; - __I uint32_t MRDATAH; /**< Controller Read Data Halfword, offset: 0xC8 */ - union { /* offset: 0xCC */ - __O uint32_t MWDATAB1; /**< Controller Write Byte Data 1 (to Bus), offset: 0xCC */ - __O uint32_t MWDATAH1; /**< Controller Write Halfword Data (to Bus), offset: 0xCC */ - }; - union { /* offset: 0xD0 */ - __O uint32_t MWMSG_SDR_CONTROL; /**< Controller Write Message Control in SDR mode, offset: 0xD0 */ - __O uint32_t MWMSG_SDR_DATA; /**< Controller Write Message Data in SDR mode, offset: 0xD0 */ - }; - __I uint32_t MRMSG_SDR; /**< Controller Read Message in SDR mode, offset: 0xD4 */ - union { /* offset: 0xD8 */ - __O uint32_t MWMSG_DDR_CONTROL; /**< Controller Write Message in DDR mode: First Control Word, offset: 0xD8 */ - __O uint32_t MWMSG_DDR_CONTROL2; /**< Controller Write Message in DDR Mode Control 2, offset: 0xD8 */ - __O uint32_t MWMSG_DDR_DATA; /**< Controller Write Message Data in DDR mode, offset: 0xD8 */ - }; - __I uint32_t MRMSG_DDR; /**< Controller Read Message in DDR mode, offset: 0xDC */ - uint8_t RESERVED_6[4]; - __IO uint32_t MDYNADDR; /**< Controller Dynamic Address, offset: 0xE4 */ - uint8_t RESERVED_7[52]; - __I uint32_t SMAPCTRL0; /**< Map Feature Control 0, offset: 0x11C */ - uint8_t RESERVED_8[32]; - __IO uint32_t IBIEXT1; /**< Extended IBI Data 1, offset: 0x140 */ - __IO uint32_t IBIEXT2; /**< Extended IBI Data 2, offset: 0x144 */ - uint8_t RESERVED_9[3764]; - __I uint32_t SID; /**< Target Module ID, offset: 0xFFC */ -} I3C_Type; - -/* ---------------------------------------------------------------------------- - -- I3C Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup I3C_Register_Masks I3C Register Masks - * @{ - */ - -/*! @name MCONFIG - Controller Configuration */ -/*! @{ */ - -#define I3C_MCONFIG_MSTENA_MASK (0x3U) -#define I3C_MCONFIG_MSTENA_SHIFT (0U) -/*! MSTENA - Controller Enable - * 0b00..CONTROLLER_OFF - * 0b01..CONTROLLER_ON - * 0b10..CONTROLLER_CAPABLE - * 0b11..I2C_CONTROLLER_MODE - */ -#define I3C_MCONFIG_MSTENA(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_MSTENA_SHIFT)) & I3C_MCONFIG_MSTENA_MASK) - -#define I3C_MCONFIG_DISTO_MASK (0x8U) -#define I3C_MCONFIG_DISTO_SHIFT (3U) -/*! DISTO - Disable Timeout - * 0b1..Disabled, if configured - * 0b0..Enabled - */ -#define I3C_MCONFIG_DISTO(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_DISTO_SHIFT)) & I3C_MCONFIG_DISTO_MASK) - -#define I3C_MCONFIG_HKEEP_MASK (0x30U) -#define I3C_MCONFIG_HKEEP_SHIFT (4U) -/*! HKEEP - High-Keeper - * 0b00..None - * 0b01..WIRED_IN - * 0b10..PASSIVE_SDA - * 0b11..PASSIVE_ON_SDA_SCL - */ -#define I3C_MCONFIG_HKEEP(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_HKEEP_SHIFT)) & I3C_MCONFIG_HKEEP_MASK) - -#define I3C_MCONFIG_ODSTOP_MASK (0x40U) -#define I3C_MCONFIG_ODSTOP_SHIFT (6U) -/*! ODSTOP - Open Drain Stop - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MCONFIG_ODSTOP(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_ODSTOP_SHIFT)) & I3C_MCONFIG_ODSTOP_MASK) - -#define I3C_MCONFIG_PPBAUD_MASK (0xF00U) -#define I3C_MCONFIG_PPBAUD_SHIFT (8U) -/*! PPBAUD - Push-Pull Baud Rate */ -#define I3C_MCONFIG_PPBAUD(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_PPBAUD_SHIFT)) & I3C_MCONFIG_PPBAUD_MASK) - -#define I3C_MCONFIG_PPLOW_MASK (0xF000U) -#define I3C_MCONFIG_PPLOW_SHIFT (12U) -/*! PPLOW - Push-Pull Low */ -#define I3C_MCONFIG_PPLOW(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_PPLOW_SHIFT)) & I3C_MCONFIG_PPLOW_MASK) - -#define I3C_MCONFIG_ODBAUD_MASK (0xFF0000U) -#define I3C_MCONFIG_ODBAUD_SHIFT (16U) -/*! ODBAUD - Open Drain Baud Rate */ -#define I3C_MCONFIG_ODBAUD(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_ODBAUD_SHIFT)) & I3C_MCONFIG_ODBAUD_MASK) - -#define I3C_MCONFIG_ODHPP_MASK (0x1000000U) -#define I3C_MCONFIG_ODHPP_SHIFT (24U) -/*! ODHPP - Open Drain High Push-Pull - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MCONFIG_ODHPP(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_ODHPP_SHIFT)) & I3C_MCONFIG_ODHPP_MASK) - -#define I3C_MCONFIG_SKEW_MASK (0xE000000U) -#define I3C_MCONFIG_SKEW_SHIFT (25U) -/*! SKEW - Skew */ -#define I3C_MCONFIG_SKEW(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_SKEW_SHIFT)) & I3C_MCONFIG_SKEW_MASK) - -#define I3C_MCONFIG_I2CBAUD_MASK (0xF0000000U) -#define I3C_MCONFIG_I2CBAUD_SHIFT (28U) -/*! I2CBAUD - I2C Baud Rate */ -#define I3C_MCONFIG_I2CBAUD(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_I2CBAUD_SHIFT)) & I3C_MCONFIG_I2CBAUD_MASK) -/*! @} */ - -/*! @name SCONFIG - Target Configuration */ -/*! @{ */ - -#define I3C_SCONFIG_SLVENA_MASK (0x1U) -#define I3C_SCONFIG_SLVENA_SHIFT (0U) -/*! SLVENA - Target Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SCONFIG_SLVENA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_SLVENA_SHIFT)) & I3C_SCONFIG_SLVENA_MASK) - -#define I3C_SCONFIG_NACK_MASK (0x2U) -#define I3C_SCONFIG_NACK_SHIFT (1U) -/*! NACK - Not Acknowledge - * 0b1..Always enable NACK mode (works normally) - * 0b0..Always disable NACK mode - */ -#define I3C_SCONFIG_NACK(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_NACK_SHIFT)) & I3C_SCONFIG_NACK_MASK) - -#define I3C_SCONFIG_MATCHSS_MASK (0x4U) -#define I3C_SCONFIG_MATCHSS_SHIFT (2U) -/*! MATCHSS - Match Start or Stop - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SCONFIG_MATCHSS(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_MATCHSS_SHIFT)) & I3C_SCONFIG_MATCHSS_MASK) - -#define I3C_SCONFIG_S0IGNORE_MASK (0x8U) -#define I3C_SCONFIG_S0IGNORE_SHIFT (3U) -/*! S0IGNORE - Ignore TE0 or TE1 Errors - * 0b1..Ignore TE0 or TE1 errors - * 0b0..Do not ignore TE0 or TE1 errors - */ -#define I3C_SCONFIG_S0IGNORE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_S0IGNORE_SHIFT)) & I3C_SCONFIG_S0IGNORE_MASK) - -#define I3C_SCONFIG_HDROK_MASK (0x10U) -#define I3C_SCONFIG_HDROK_SHIFT (4U) -/*! HDROK - HDR OK - * 0b1..Enable HDR OK - * 0b0..Disable HDR OK - */ -#define I3C_SCONFIG_HDROK(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_HDROK_SHIFT)) & I3C_SCONFIG_HDROK_MASK) - -#define I3C_SCONFIG_OFFLINE_MASK (0x200U) -#define I3C_SCONFIG_OFFLINE_SHIFT (9U) -/*! OFFLINE - Offline - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SCONFIG_OFFLINE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_OFFLINE_SHIFT)) & I3C_SCONFIG_OFFLINE_MASK) - -#define I3C_SCONFIG_BAMATCH_MASK (0xFF0000U) -#define I3C_SCONFIG_BAMATCH_SHIFT (16U) -/*! BAMATCH - Bus Available Match */ -#define I3C_SCONFIG_BAMATCH(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_BAMATCH_SHIFT)) & I3C_SCONFIG_BAMATCH_MASK) - -#define I3C_SCONFIG_SADDR_MASK (0xFE000000U) -#define I3C_SCONFIG_SADDR_SHIFT (25U) -/*! SADDR - Static Address */ -#define I3C_SCONFIG_SADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_SADDR_SHIFT)) & I3C_SCONFIG_SADDR_MASK) -/*! @} */ - -/*! @name SSTATUS - Target Status */ -/*! @{ */ - -#define I3C_SSTATUS_STNOTSTOP_MASK (0x1U) -#define I3C_SSTATUS_STNOTSTOP_SHIFT (0U) -/*! STNOTSTOP - Status not Stop - * 0b1..Busy - * 0b0..In STOP condition - */ -#define I3C_SSTATUS_STNOTSTOP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STNOTSTOP_SHIFT)) & I3C_SSTATUS_STNOTSTOP_MASK) - -#define I3C_SSTATUS_STMSG_MASK (0x2U) -#define I3C_SSTATUS_STMSG_SHIFT (1U) -/*! STMSG - Status Message - * 0b1..Busy - * 0b0..Idle - */ -#define I3C_SSTATUS_STMSG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STMSG_SHIFT)) & I3C_SSTATUS_STMSG_MASK) - -#define I3C_SSTATUS_STCCCH_MASK (0x4U) -#define I3C_SSTATUS_STCCCH_SHIFT (2U) -/*! STCCCH - Status Common Command Code Handler - * 0b1..Handled automatically - * 0b0..No CCC message handled - */ -#define I3C_SSTATUS_STCCCH(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STCCCH_SHIFT)) & I3C_SSTATUS_STCCCH_MASK) - -#define I3C_SSTATUS_STREQRD_MASK (0x8U) -#define I3C_SSTATUS_STREQRD_SHIFT (3U) -/*! STREQRD - Status Request Read - * 0b1..SDR read from this target or an IBI is being pushed out - * 0b0..Not an SDR read - */ -#define I3C_SSTATUS_STREQRD(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STREQRD_SHIFT)) & I3C_SSTATUS_STREQRD_MASK) - -#define I3C_SSTATUS_STREQWR_MASK (0x10U) -#define I3C_SSTATUS_STREQWR_SHIFT (4U) -/*! STREQWR - Status Request Write - * 0b1..SDR write data from the controller, but not in ENTDAA mode - * 0b0..Not an SDR write - */ -#define I3C_SSTATUS_STREQWR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STREQWR_SHIFT)) & I3C_SSTATUS_STREQWR_MASK) - -#define I3C_SSTATUS_STDAA_MASK (0x20U) -#define I3C_SSTATUS_STDAA_SHIFT (5U) -/*! STDAA - Status Dynamic Address Assignment - * 0b1..In ENTDAA mode - * 0b0..Not in ENTDAA mode - */ -#define I3C_SSTATUS_STDAA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STDAA_SHIFT)) & I3C_SSTATUS_STDAA_MASK) - -#define I3C_SSTATUS_STHDR_MASK (0x40U) -#define I3C_SSTATUS_STHDR_SHIFT (6U) -/*! STHDR - Status High Data Rate - * 0b1..I3C bus in HDR-DDR mode - * 0b0..I3C bus not in HDR-DDR mode - */ -#define I3C_SSTATUS_STHDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STHDR_SHIFT)) & I3C_SSTATUS_STHDR_MASK) - -#define I3C_SSTATUS_START_MASK (0x100U) -#define I3C_SSTATUS_START_SHIFT (8U) -/*! START - Start - * 0b1..Detected - * 0b0..Not detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_START(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_START_SHIFT)) & I3C_SSTATUS_START_MASK) - -#define I3C_SSTATUS_MATCHED_MASK (0x200U) -#define I3C_SSTATUS_MATCHED_SHIFT (9U) -/*! MATCHED - Matched - * 0b1..Header matched - * 0b0..Header not matched - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_MATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_MATCHED_SHIFT)) & I3C_SSTATUS_MATCHED_MASK) - -#define I3C_SSTATUS_STOP_MASK (0x400U) -#define I3C_SSTATUS_STOP_SHIFT (10U) -/*! STOP - Stop - * 0b1..Stopped state detected - * 0b0..No Stopped state detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_STOP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STOP_SHIFT)) & I3C_SSTATUS_STOP_MASK) - -#define I3C_SSTATUS_RX_PEND_MASK (0x800U) -#define I3C_SSTATUS_RX_PEND_SHIFT (11U) -/*! RX_PEND - Received Message Pending - * 0b1..Received message pending - * 0b0..No received message pending - */ -#define I3C_SSTATUS_RX_PEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_RX_PEND_SHIFT)) & I3C_SSTATUS_RX_PEND_MASK) - -#define I3C_SSTATUS_TXNOTFULL_MASK (0x1000U) -#define I3C_SSTATUS_TXNOTFULL_SHIFT (12U) -/*! TXNOTFULL - Transmit Buffer Not Full - * 0b1..Transmit buffer not full - * 0b0..Transmit buffer full - */ -#define I3C_SSTATUS_TXNOTFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_TXNOTFULL_SHIFT)) & I3C_SSTATUS_TXNOTFULL_MASK) - -#define I3C_SSTATUS_DACHG_MASK (0x2000U) -#define I3C_SSTATUS_DACHG_SHIFT (13U) -/*! DACHG - Dynamic Address Change - * 0b1..DA change detected - * 0b0..No DA change detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_DACHG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_DACHG_SHIFT)) & I3C_SSTATUS_DACHG_MASK) - -#define I3C_SSTATUS_CCC_MASK (0x4000U) -#define I3C_SSTATUS_CCC_SHIFT (14U) -/*! CCC - Common Command Code - * 0b1..CCC received - * 0b0..CCC not received - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_CCC(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_CCC_SHIFT)) & I3C_SSTATUS_CCC_MASK) - -#define I3C_SSTATUS_ERRWARN_MASK (0x8000U) -#define I3C_SSTATUS_ERRWARN_SHIFT (15U) -/*! ERRWARN - Error Warning */ -#define I3C_SSTATUS_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_ERRWARN_SHIFT)) & I3C_SSTATUS_ERRWARN_MASK) - -#define I3C_SSTATUS_HDRMATCH_MASK (0x10000U) -#define I3C_SSTATUS_HDRMATCH_SHIFT (16U) -/*! HDRMATCH - High Data Rate Command Match - * 0b1..Matched the I3C dynamic address - * 0b0..Did not match - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_HDRMATCH(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_HDRMATCH_SHIFT)) & I3C_SSTATUS_HDRMATCH_MASK) - -#define I3C_SSTATUS_CHANDLED_MASK (0x20000U) -#define I3C_SSTATUS_CHANDLED_SHIFT (17U) -/*! CHANDLED - Common Command Code Handled - * 0b1..CCC handling in progress - * 0b0..CCC handling not in progress - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_CHANDLED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_CHANDLED_SHIFT)) & I3C_SSTATUS_CHANDLED_MASK) - -#define I3C_SSTATUS_EVENT_MASK (0x40000U) -#define I3C_SSTATUS_EVENT_SHIFT (18U) -/*! EVENT - Event - * 0b1..IBI, CR, or HJ occurred - * 0b0..No event occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_EVENT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_EVENT_SHIFT)) & I3C_SSTATUS_EVENT_MASK) - -#define I3C_SSTATUS_EVDET_MASK (0x300000U) -#define I3C_SSTATUS_EVDET_SHIFT (20U) -/*! EVDET - Event Details - * 0b00..NONE (no event or no pending event) - * 0b01..NO_REQUEST (request is not sent yet; either there is no START condition yet, or is waiting for Bus-Available or Bus-Idle (HJ)) - * 0b10..NACKed (not acknowledged, request sent and rejected); I3C tries again - * 0b11..ACKed (acknowledged; request sent and accepted), so done (unless the time control data is still being sent) - */ -#define I3C_SSTATUS_EVDET(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_EVDET_SHIFT)) & I3C_SSTATUS_EVDET_MASK) - -#define I3C_SSTATUS_IBIDIS_MASK (0x1000000U) -#define I3C_SSTATUS_IBIDIS_SHIFT (24U) -/*! IBIDIS - In-Band Interrupts Disable - * 0b1..Disabled - * 0b0..Enabled - */ -#define I3C_SSTATUS_IBIDIS(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_IBIDIS_SHIFT)) & I3C_SSTATUS_IBIDIS_MASK) - -#define I3C_SSTATUS_MRDIS_MASK (0x2000000U) -#define I3C_SSTATUS_MRDIS_SHIFT (25U) -/*! MRDIS - Controller Requests Disable - * 0b1..Disabled - * 0b0..Enabled - */ -#define I3C_SSTATUS_MRDIS(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_MRDIS_SHIFT)) & I3C_SSTATUS_MRDIS_MASK) - -#define I3C_SSTATUS_HJDIS_MASK (0x8000000U) -#define I3C_SSTATUS_HJDIS_SHIFT (27U) -/*! HJDIS - Hot-Join Disabled - * 0b1..Disabled - * 0b0..Enabled - */ -#define I3C_SSTATUS_HJDIS(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_HJDIS_SHIFT)) & I3C_SSTATUS_HJDIS_MASK) - -#define I3C_SSTATUS_ACTSTATE_MASK (0x30000000U) -#define I3C_SSTATUS_ACTSTATE_SHIFT (28U) -/*! ACTSTATE - Activity State from Common Command Codes (CCC) - * 0b00..NO_LATENCY (normal bus operations) - * 0b01..LATENCY_1MS (1 ms of latency) - * 0b10..LATENCY_100MS (100 ms of latency) - * 0b11..LATENCY_10S (10 seconds of latency) - */ -#define I3C_SSTATUS_ACTSTATE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_ACTSTATE_SHIFT)) & I3C_SSTATUS_ACTSTATE_MASK) - -#define I3C_SSTATUS_TIMECTRL_MASK (0xC0000000U) -#define I3C_SSTATUS_TIMECTRL_SHIFT (30U) -/*! TIMECTRL - Time Control - * 0b00..NO_TIME_CONTROL (no time control is enabled) - * 0b01..SYNC_MODE (Synchronous mode is enabled) - * 0b10..ASYNC_MODE (Asynchronous standard mode (0 or 1) is enabled) - * 0b11..BOTHSYNCASYNC (both Synchronous and Asynchronous modes are enabled) - */ -#define I3C_SSTATUS_TIMECTRL(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_TIMECTRL_SHIFT)) & I3C_SSTATUS_TIMECTRL_MASK) -/*! @} */ - -/*! @name SCTRL - Target Control */ -/*! @{ */ - -#define I3C_SCTRL_EVENT_MASK (0x3U) -#define I3C_SCTRL_EVENT_SHIFT (0U) -/*! EVENT - Event - * 0b00..NORMAL_MODE - * 0b01..IBI - * 0b10..CONTROLLER_REQUEST - * 0b11..HOT_JOIN_REQUEST - */ -#define I3C_SCTRL_EVENT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCTRL_EVENT_SHIFT)) & I3C_SCTRL_EVENT_MASK) - -#define I3C_SCTRL_EXTDATA_MASK (0x8U) -#define I3C_SCTRL_EXTDATA_SHIFT (3U) -/*! EXTDATA - Extended Data - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SCTRL_EXTDATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCTRL_EXTDATA_SHIFT)) & I3C_SCTRL_EXTDATA_MASK) - -#define I3C_SCTRL_IBIDATA_MASK (0xFF00U) -#define I3C_SCTRL_IBIDATA_SHIFT (8U) -/*! IBIDATA - In-Band Interrupt Data */ -#define I3C_SCTRL_IBIDATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCTRL_IBIDATA_SHIFT)) & I3C_SCTRL_IBIDATA_MASK) - -#define I3C_SCTRL_PENDINT_MASK (0xF0000U) -#define I3C_SCTRL_PENDINT_SHIFT (16U) -/*! PENDINT - Pending Interrupt */ -#define I3C_SCTRL_PENDINT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCTRL_PENDINT_SHIFT)) & I3C_SCTRL_PENDINT_MASK) - -#define I3C_SCTRL_ACTSTATE_MASK (0x300000U) -#define I3C_SCTRL_ACTSTATE_SHIFT (20U) -/*! ACTSTATE - Activity State of Target */ -#define I3C_SCTRL_ACTSTATE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCTRL_ACTSTATE_SHIFT)) & I3C_SCTRL_ACTSTATE_MASK) - -#define I3C_SCTRL_VENDINFO_MASK (0xFF000000U) -#define I3C_SCTRL_VENDINFO_SHIFT (24U) -/*! VENDINFO - Vendor Information */ -#define I3C_SCTRL_VENDINFO(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCTRL_VENDINFO_SHIFT)) & I3C_SCTRL_VENDINFO_MASK) -/*! @} */ - -/*! @name SINTSET - Target Interrupt Set */ -/*! @{ */ - -#define I3C_SINTSET_START_MASK (0x100U) -#define I3C_SINTSET_START_SHIFT (8U) -/*! START - Start Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_START(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_START_SHIFT)) & I3C_SINTSET_START_MASK) - -#define I3C_SINTSET_MATCHED_MASK (0x200U) -#define I3C_SINTSET_MATCHED_SHIFT (9U) -/*! MATCHED - Match Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_MATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_MATCHED_SHIFT)) & I3C_SINTSET_MATCHED_MASK) - -#define I3C_SINTSET_STOP_MASK (0x400U) -#define I3C_SINTSET_STOP_SHIFT (10U) -/*! STOP - Stop Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_STOP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_STOP_SHIFT)) & I3C_SINTSET_STOP_MASK) - -#define I3C_SINTSET_RXPEND_MASK (0x800U) -#define I3C_SINTSET_RXPEND_SHIFT (11U) -/*! RXPEND - Receive Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_RXPEND_SHIFT)) & I3C_SINTSET_RXPEND_MASK) - -#define I3C_SINTSET_TXSEND_MASK (0x1000U) -#define I3C_SINTSET_TXSEND_SHIFT (12U) -/*! TXSEND - Transmit Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_TXSEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_TXSEND_SHIFT)) & I3C_SINTSET_TXSEND_MASK) - -#define I3C_SINTSET_DACHG_MASK (0x2000U) -#define I3C_SINTSET_DACHG_SHIFT (13U) -/*! DACHG - Dynamic Address Change Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_DACHG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_DACHG_SHIFT)) & I3C_SINTSET_DACHG_MASK) - -#define I3C_SINTSET_CCC_MASK (0x4000U) -#define I3C_SINTSET_CCC_SHIFT (14U) -/*! CCC - Common Command Code (CCC) Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_CCC(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_CCC_SHIFT)) & I3C_SINTSET_CCC_MASK) - -#define I3C_SINTSET_ERRWARN_MASK (0x8000U) -#define I3C_SINTSET_ERRWARN_SHIFT (15U) -/*! ERRWARN - Error or Warning Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_ERRWARN_SHIFT)) & I3C_SINTSET_ERRWARN_MASK) - -#define I3C_SINTSET_DDRMATCHED_MASK (0x10000U) -#define I3C_SINTSET_DDRMATCHED_SHIFT (16U) -/*! DDRMATCHED - Double Data Rate Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_DDRMATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_DDRMATCHED_SHIFT)) & I3C_SINTSET_DDRMATCHED_MASK) - -#define I3C_SINTSET_CHANDLED_MASK (0x20000U) -#define I3C_SINTSET_CHANDLED_SHIFT (17U) -/*! CHANDLED - Common Command Code (CCC) Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_CHANDLED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_CHANDLED_SHIFT)) & I3C_SINTSET_CHANDLED_MASK) - -#define I3C_SINTSET_EVENT_MASK (0x40000U) -#define I3C_SINTSET_EVENT_SHIFT (18U) -/*! EVENT - Event Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_EVENT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_EVENT_SHIFT)) & I3C_SINTSET_EVENT_MASK) -/*! @} */ - -/*! @name SINTCLR - Target Interrupt Clear */ -/*! @{ */ - -#define I3C_SINTCLR_START_MASK (0x100U) -#define I3C_SINTCLR_START_SHIFT (8U) -/*! START - START Interrupt Enable Clear */ -#define I3C_SINTCLR_START(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_START_SHIFT)) & I3C_SINTCLR_START_MASK) - -#define I3C_SINTCLR_MATCHED_MASK (0x200U) -#define I3C_SINTCLR_MATCHED_SHIFT (9U) -/*! MATCHED - Matched Interrupt Enable Clear */ -#define I3C_SINTCLR_MATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_MATCHED_SHIFT)) & I3C_SINTCLR_MATCHED_MASK) - -#define I3C_SINTCLR_STOP_MASK (0x400U) -#define I3C_SINTCLR_STOP_SHIFT (10U) -/*! STOP - STOP Interrupt Enable Clear */ -#define I3C_SINTCLR_STOP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_STOP_SHIFT)) & I3C_SINTCLR_STOP_MASK) - -#define I3C_SINTCLR_RXPEND_MASK (0x800U) -#define I3C_SINTCLR_RXPEND_SHIFT (11U) -/*! RXPEND - RXPEND Interrupt Enable Clear */ -#define I3C_SINTCLR_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_RXPEND_SHIFT)) & I3C_SINTCLR_RXPEND_MASK) - -#define I3C_SINTCLR_TXSEND_MASK (0x1000U) -#define I3C_SINTCLR_TXSEND_SHIFT (12U) -/*! TXSEND - TXSEND Interrupt Enable Clear */ -#define I3C_SINTCLR_TXSEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_TXSEND_SHIFT)) & I3C_SINTCLR_TXSEND_MASK) - -#define I3C_SINTCLR_DACHG_MASK (0x2000U) -#define I3C_SINTCLR_DACHG_SHIFT (13U) -/*! DACHG - DACHG Interrupt Enable Clear */ -#define I3C_SINTCLR_DACHG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_DACHG_SHIFT)) & I3C_SINTCLR_DACHG_MASK) - -#define I3C_SINTCLR_CCC_MASK (0x4000U) -#define I3C_SINTCLR_CCC_SHIFT (14U) -/*! CCC - CCC Interrupt Enable Clear */ -#define I3C_SINTCLR_CCC(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_CCC_SHIFT)) & I3C_SINTCLR_CCC_MASK) - -#define I3C_SINTCLR_ERRWARN_MASK (0x8000U) -#define I3C_SINTCLR_ERRWARN_SHIFT (15U) -/*! ERRWARN - ERRWARN Interrupt Enable Clear */ -#define I3C_SINTCLR_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_ERRWARN_SHIFT)) & I3C_SINTCLR_ERRWARN_MASK) - -#define I3C_SINTCLR_DDRMATCHED_MASK (0x10000U) -#define I3C_SINTCLR_DDRMATCHED_SHIFT (16U) -/*! DDRMATCHED - DDRMATCHED Interrupt Enable Clear */ -#define I3C_SINTCLR_DDRMATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_DDRMATCHED_SHIFT)) & I3C_SINTCLR_DDRMATCHED_MASK) - -#define I3C_SINTCLR_CHANDLED_MASK (0x20000U) -#define I3C_SINTCLR_CHANDLED_SHIFT (17U) -/*! CHANDLED - CHANDLED Interrupt Enable Clear */ -#define I3C_SINTCLR_CHANDLED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_CHANDLED_SHIFT)) & I3C_SINTCLR_CHANDLED_MASK) - -#define I3C_SINTCLR_EVENT_MASK (0x40000U) -#define I3C_SINTCLR_EVENT_SHIFT (18U) -/*! EVENT - EVENT Interrupt Enable Clear */ -#define I3C_SINTCLR_EVENT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_EVENT_SHIFT)) & I3C_SINTCLR_EVENT_MASK) -/*! @} */ - -/*! @name SINTMASKED - Target Interrupt Mask */ -/*! @{ */ - -#define I3C_SINTMASKED_START_MASK (0x100U) -#define I3C_SINTMASKED_START_SHIFT (8U) -/*! START - START Interrupt Mask */ -#define I3C_SINTMASKED_START(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_START_SHIFT)) & I3C_SINTMASKED_START_MASK) - -#define I3C_SINTMASKED_MATCHED_MASK (0x200U) -#define I3C_SINTMASKED_MATCHED_SHIFT (9U) -/*! MATCHED - MATCHED Interrupt Mask */ -#define I3C_SINTMASKED_MATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_MATCHED_SHIFT)) & I3C_SINTMASKED_MATCHED_MASK) - -#define I3C_SINTMASKED_STOP_MASK (0x400U) -#define I3C_SINTMASKED_STOP_SHIFT (10U) -/*! STOP - STOP Interrupt Mask */ -#define I3C_SINTMASKED_STOP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_STOP_SHIFT)) & I3C_SINTMASKED_STOP_MASK) - -#define I3C_SINTMASKED_RXPEND_MASK (0x800U) -#define I3C_SINTMASKED_RXPEND_SHIFT (11U) -/*! RXPEND - RXPEND Interrupt Mask */ -#define I3C_SINTMASKED_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_RXPEND_SHIFT)) & I3C_SINTMASKED_RXPEND_MASK) - -#define I3C_SINTMASKED_TXSEND_MASK (0x1000U) -#define I3C_SINTMASKED_TXSEND_SHIFT (12U) -/*! TXSEND - TXSEND Interrupt Mask */ -#define I3C_SINTMASKED_TXSEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_TXSEND_SHIFT)) & I3C_SINTMASKED_TXSEND_MASK) - -#define I3C_SINTMASKED_DACHG_MASK (0x2000U) -#define I3C_SINTMASKED_DACHG_SHIFT (13U) -/*! DACHG - DACHG Interrupt Mask */ -#define I3C_SINTMASKED_DACHG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_DACHG_SHIFT)) & I3C_SINTMASKED_DACHG_MASK) - -#define I3C_SINTMASKED_CCC_MASK (0x4000U) -#define I3C_SINTMASKED_CCC_SHIFT (14U) -/*! CCC - CCC Interrupt Mask */ -#define I3C_SINTMASKED_CCC(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_CCC_SHIFT)) & I3C_SINTMASKED_CCC_MASK) - -#define I3C_SINTMASKED_ERRWARN_MASK (0x8000U) -#define I3C_SINTMASKED_ERRWARN_SHIFT (15U) -/*! ERRWARN - ERRWARN Interrupt Mask */ -#define I3C_SINTMASKED_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_ERRWARN_SHIFT)) & I3C_SINTMASKED_ERRWARN_MASK) - -#define I3C_SINTMASKED_DDRMATCHED_MASK (0x10000U) -#define I3C_SINTMASKED_DDRMATCHED_SHIFT (16U) -/*! DDRMATCHED - DDRMATCHED Interrupt Mask */ -#define I3C_SINTMASKED_DDRMATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_DDRMATCHED_SHIFT)) & I3C_SINTMASKED_DDRMATCHED_MASK) - -#define I3C_SINTMASKED_CHANDLED_MASK (0x20000U) -#define I3C_SINTMASKED_CHANDLED_SHIFT (17U) -/*! CHANDLED - CHANDLED Interrupt Mask */ -#define I3C_SINTMASKED_CHANDLED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_CHANDLED_SHIFT)) & I3C_SINTMASKED_CHANDLED_MASK) - -#define I3C_SINTMASKED_EVENT_MASK (0x40000U) -#define I3C_SINTMASKED_EVENT_SHIFT (18U) -/*! EVENT - EVENT Interrupt Mask */ -#define I3C_SINTMASKED_EVENT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_EVENT_SHIFT)) & I3C_SINTMASKED_EVENT_MASK) -/*! @} */ - -/*! @name SERRWARN - Target Errors and Warnings */ -/*! @{ */ - -#define I3C_SERRWARN_ORUN_MASK (0x1U) -#define I3C_SERRWARN_ORUN_SHIFT (0U) -/*! ORUN - Overrun Error - * 0b1..Overrun error - * 0b0..No overrun error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_ORUN(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_ORUN_SHIFT)) & I3C_SERRWARN_ORUN_MASK) - -#define I3C_SERRWARN_URUN_MASK (0x2U) -#define I3C_SERRWARN_URUN_SHIFT (1U) -/*! URUN - Underrun Error - * 0b1..Underrun error - * 0b0..No underrun error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_URUN(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_URUN_SHIFT)) & I3C_SERRWARN_URUN_MASK) - -#define I3C_SERRWARN_URUNNACK_MASK (0x4U) -#define I3C_SERRWARN_URUNNACK_SHIFT (2U) -/*! URUNNACK - Underrun and Not Acknowledged (NACKed) Error - * 0b1..Underrun; not acknowledged error - * 0b0..No underrun; not acknowledged error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_URUNNACK(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_URUNNACK_SHIFT)) & I3C_SERRWARN_URUNNACK_MASK) - -#define I3C_SERRWARN_TERM_MASK (0x8U) -#define I3C_SERRWARN_TERM_SHIFT (3U) -/*! TERM - Terminated Error - * 0b1..Terminated error - * 0b0..No terminated error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_TERM(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_TERM_SHIFT)) & I3C_SERRWARN_TERM_MASK) - -#define I3C_SERRWARN_INVSTART_MASK (0x10U) -#define I3C_SERRWARN_INVSTART_SHIFT (4U) -/*! INVSTART - Invalid Start Error - * 0b1..Invalid start error - * 0b0..No invalid start error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_INVSTART(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_INVSTART_SHIFT)) & I3C_SERRWARN_INVSTART_MASK) - -#define I3C_SERRWARN_SPAR_MASK (0x100U) -#define I3C_SERRWARN_SPAR_SHIFT (8U) -/*! SPAR - SDR Parity Error - * 0b1..SDR parity error - * 0b0..No SDR parity error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_SPAR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_SPAR_SHIFT)) & I3C_SERRWARN_SPAR_MASK) - -#define I3C_SERRWARN_HPAR_MASK (0x200U) -#define I3C_SERRWARN_HPAR_SHIFT (9U) -/*! HPAR - HDR Parity Error - * 0b1..HDR parity error - * 0b0..No HDR parity error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_HPAR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_HPAR_SHIFT)) & I3C_SERRWARN_HPAR_MASK) - -#define I3C_SERRWARN_HCRC_MASK (0x400U) -#define I3C_SERRWARN_HCRC_SHIFT (10U) -/*! HCRC - HDR-DDR CRC Error - * 0b1..HDR-DDR CRC error occurred - * 0b0..No HDR-DDR CRC error occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_HCRC(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_HCRC_SHIFT)) & I3C_SERRWARN_HCRC_MASK) - -#define I3C_SERRWARN_S0S1_MASK (0x800U) -#define I3C_SERRWARN_S0S1_SHIFT (11U) -/*! S0S1 - TE0 or TE1 Error - * 0b1..TE0 or TE1 error occurred - * 0b0..No TE0 or TE1 error occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_S0S1(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_S0S1_SHIFT)) & I3C_SERRWARN_S0S1_MASK) - -#define I3C_SERRWARN_OREAD_MASK (0x10000U) -#define I3C_SERRWARN_OREAD_SHIFT (16U) -/*! OREAD - Over-Read Error - * 0b1..Over-read error - * 0b0..No over-read error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_OREAD(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_OREAD_SHIFT)) & I3C_SERRWARN_OREAD_MASK) - -#define I3C_SERRWARN_OWRITE_MASK (0x20000U) -#define I3C_SERRWARN_OWRITE_SHIFT (17U) -/*! OWRITE - Over-Write Error - * 0b1..Overwrite error - * 0b0..No overwrite error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_OWRITE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_OWRITE_SHIFT)) & I3C_SERRWARN_OWRITE_MASK) -/*! @} */ - -/*! @name SDMACTRL - Target DMA Control */ -/*! @{ */ - -#define I3C_SDMACTRL_DMAFB_MASK (0x3U) -#define I3C_SDMACTRL_DMAFB_SHIFT (0U) -/*! DMAFB - DMA Read (From-Bus) Trigger - * 0b00..DMA not used - * 0b01..DMA enabled for one frame - * 0b10..DMA enabled until turned off - * 0b11.. - */ -#define I3C_SDMACTRL_DMAFB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDMACTRL_DMAFB_SHIFT)) & I3C_SDMACTRL_DMAFB_MASK) - -#define I3C_SDMACTRL_DMATB_MASK (0xCU) -#define I3C_SDMACTRL_DMATB_SHIFT (2U) -/*! DMATB - DMA Write (To-Bus) Trigger - * 0b00..DMA not used - * 0b01..DMA enabled for one frame - * 0b10..DMA enabled until turned off - * 0b11.. - */ -#define I3C_SDMACTRL_DMATB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDMACTRL_DMATB_SHIFT)) & I3C_SDMACTRL_DMATB_MASK) - -#define I3C_SDMACTRL_DMAWIDTH_MASK (0x30U) -#define I3C_SDMACTRL_DMAWIDTH_SHIFT (4U) -/*! DMAWIDTH - Width of DMA Operations - * 0b00, 0b01..Byte - * 0b10..Halfword (16 bits) (this value ensures that two bytes are available in the FIFO) - * 0b11.. - */ -#define I3C_SDMACTRL_DMAWIDTH(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDMACTRL_DMAWIDTH_SHIFT)) & I3C_SDMACTRL_DMAWIDTH_MASK) -/*! @} */ - -/*! @name SDATACTRL - Target Data Control */ -/*! @{ */ - -#define I3C_SDATACTRL_FLUSHTB_MASK (0x1U) -#define I3C_SDATACTRL_FLUSHTB_SHIFT (0U) -/*! FLUSHTB - Flush To-Bus Buffer or FIFO */ -#define I3C_SDATACTRL_FLUSHTB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_FLUSHTB_SHIFT)) & I3C_SDATACTRL_FLUSHTB_MASK) - -#define I3C_SDATACTRL_FLUSHFB_MASK (0x2U) -#define I3C_SDATACTRL_FLUSHFB_SHIFT (1U) -/*! FLUSHFB - Flush From-Bus Buffer or FIFO */ -#define I3C_SDATACTRL_FLUSHFB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_FLUSHFB_SHIFT)) & I3C_SDATACTRL_FLUSHFB_MASK) - -#define I3C_SDATACTRL_UNLOCK_MASK (0x8U) -#define I3C_SDATACTRL_UNLOCK_SHIFT (3U) -/*! UNLOCK - Unlock - * 0b0..Cannot be changed - * 0b1..Can be changed - */ -#define I3C_SDATACTRL_UNLOCK(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_UNLOCK_SHIFT)) & I3C_SDATACTRL_UNLOCK_MASK) - -#define I3C_SDATACTRL_TXTRIG_MASK (0x30U) -#define I3C_SDATACTRL_TXTRIG_SHIFT (4U) -/*! TXTRIG - Transmit Trigger Level - * 0b00..Trigger when empty - * 0b01..Trigger when 1/4 full or less - * 0b10..Trigger when 1/2 full or less - * 0b11..Default (trigger when 1 less than full or less) - */ -#define I3C_SDATACTRL_TXTRIG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_TXTRIG_SHIFT)) & I3C_SDATACTRL_TXTRIG_MASK) - -#define I3C_SDATACTRL_RXTRIG_MASK (0xC0U) -#define I3C_SDATACTRL_RXTRIG_SHIFT (6U) -/*! RXTRIG - Receive Trigger Level - * 0b00..Trigger when not empty - * 0b01..Trigger when 1/4 or more full - * 0b10..Trigger when 1/2 or more full - * 0b11..Trigger when 3/4 or more full - */ -#define I3C_SDATACTRL_RXTRIG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_RXTRIG_SHIFT)) & I3C_SDATACTRL_RXTRIG_MASK) - -#define I3C_SDATACTRL_TXCOUNT_MASK (0x1F0000U) -#define I3C_SDATACTRL_TXCOUNT_SHIFT (16U) -/*! TXCOUNT - Count of Bytes in Transmit */ -#define I3C_SDATACTRL_TXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_TXCOUNT_SHIFT)) & I3C_SDATACTRL_TXCOUNT_MASK) - -#define I3C_SDATACTRL_RXCOUNT_MASK (0x1F000000U) -#define I3C_SDATACTRL_RXCOUNT_SHIFT (24U) -/*! RXCOUNT - Count of Bytes in Receive */ -#define I3C_SDATACTRL_RXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_RXCOUNT_SHIFT)) & I3C_SDATACTRL_RXCOUNT_MASK) - -#define I3C_SDATACTRL_TXFULL_MASK (0x40000000U) -#define I3C_SDATACTRL_TXFULL_SHIFT (30U) -/*! TXFULL - Transmit is Full - * 0b1..Full - * 0b0..Not full - */ -#define I3C_SDATACTRL_TXFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_TXFULL_SHIFT)) & I3C_SDATACTRL_TXFULL_MASK) - -#define I3C_SDATACTRL_RXEMPTY_MASK (0x80000000U) -#define I3C_SDATACTRL_RXEMPTY_SHIFT (31U) -/*! RXEMPTY - Receive is Empty - * 0b1..Empty - * 0b0..Not empty - */ -#define I3C_SDATACTRL_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_RXEMPTY_SHIFT)) & I3C_SDATACTRL_RXEMPTY_MASK) -/*! @} */ - -/*! @name SWDATAB - Target Write Data Byte */ -/*! @{ */ - -#define I3C_SWDATAB_DATA_MASK (0xFFU) -#define I3C_SWDATAB_DATA_SHIFT (0U) -/*! DATA - Data */ -#define I3C_SWDATAB_DATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAB_DATA_SHIFT)) & I3C_SWDATAB_DATA_MASK) - -#define I3C_SWDATAB_END_MASK (0x100U) -#define I3C_SWDATAB_END_SHIFT (8U) -/*! END - End - * 0b1..End - * 0b0..Not the end - */ -#define I3C_SWDATAB_END(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAB_END_SHIFT)) & I3C_SWDATAB_END_MASK) - -#define I3C_SWDATAB_END_ALSO_MASK (0x10000U) -#define I3C_SWDATAB_END_ALSO_SHIFT (16U) -/*! END_ALSO - End Also - * 0b1..End - * 0b0..Not the end - */ -#define I3C_SWDATAB_END_ALSO(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAB_END_ALSO_SHIFT)) & I3C_SWDATAB_END_ALSO_MASK) -/*! @} */ - -/*! @name SWDATABE - Target Write Data Byte End */ -/*! @{ */ - -#define I3C_SWDATABE_DATA_MASK (0xFFU) -#define I3C_SWDATABE_DATA_SHIFT (0U) -/*! DATA - Data */ -#define I3C_SWDATABE_DATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATABE_DATA_SHIFT)) & I3C_SWDATABE_DATA_MASK) -/*! @} */ - -/*! @name SWDATAH - Target Write Data Halfword */ -/*! @{ */ - -#define I3C_SWDATAH_DATA0_MASK (0xFFU) -#define I3C_SWDATAH_DATA0_SHIFT (0U) -/*! DATA0 - Data 0 */ -#define I3C_SWDATAH_DATA0(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAH_DATA0_SHIFT)) & I3C_SWDATAH_DATA0_MASK) - -#define I3C_SWDATAH_DATA1_MASK (0xFF00U) -#define I3C_SWDATAH_DATA1_SHIFT (8U) -/*! DATA1 - Data 1 */ -#define I3C_SWDATAH_DATA1(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAH_DATA1_SHIFT)) & I3C_SWDATAH_DATA1_MASK) - -#define I3C_SWDATAH_END_MASK (0x10000U) -#define I3C_SWDATAH_END_SHIFT (16U) -/*! END - End of Message - * 0b1..End - * 0b0..Not the end - */ -#define I3C_SWDATAH_END(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAH_END_SHIFT)) & I3C_SWDATAH_END_MASK) -/*! @} */ - -/*! @name SWDATAHE - Target Write Data Halfword End */ -/*! @{ */ - -#define I3C_SWDATAHE_DATA0_MASK (0xFFU) -#define I3C_SWDATAHE_DATA0_SHIFT (0U) -/*! DATA0 - Data 0 */ -#define I3C_SWDATAHE_DATA0(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAHE_DATA0_SHIFT)) & I3C_SWDATAHE_DATA0_MASK) - -#define I3C_SWDATAHE_DATA1_MASK (0xFF00U) -#define I3C_SWDATAHE_DATA1_SHIFT (8U) -/*! DATA1 - Data 1 */ -#define I3C_SWDATAHE_DATA1(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAHE_DATA1_SHIFT)) & I3C_SWDATAHE_DATA1_MASK) -/*! @} */ - -/*! @name SRDATAB - Target Read Data Byte */ -/*! @{ */ - -#define I3C_SRDATAB_DATA0_MASK (0xFFU) -#define I3C_SRDATAB_DATA0_SHIFT (0U) -/*! DATA0 - Data 0 */ -#define I3C_SRDATAB_DATA0(x) (((uint32_t)(((uint32_t)(x)) << I3C_SRDATAB_DATA0_SHIFT)) & I3C_SRDATAB_DATA0_MASK) -/*! @} */ - -/*! @name SRDATAH - Target Read Data Halfword */ -/*! @{ */ - -#define I3C_SRDATAH_LSB_MASK (0xFFU) -#define I3C_SRDATAH_LSB_SHIFT (0U) -/*! LSB - Low Byte */ -#define I3C_SRDATAH_LSB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SRDATAH_LSB_SHIFT)) & I3C_SRDATAH_LSB_MASK) - -#define I3C_SRDATAH_MSB_MASK (0xFF00U) -#define I3C_SRDATAH_MSB_SHIFT (8U) -/*! MSB - High Byte */ -#define I3C_SRDATAH_MSB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SRDATAH_MSB_SHIFT)) & I3C_SRDATAH_MSB_MASK) -/*! @} */ - -/*! @name SWDATAB1 - Target Write Data Byte */ -/*! @{ */ - -#define I3C_SWDATAB1_DATA_MASK (0xFFU) -#define I3C_SWDATAB1_DATA_SHIFT (0U) -/*! DATA - Data */ -#define I3C_SWDATAB1_DATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAB1_DATA_SHIFT)) & I3C_SWDATAB1_DATA_MASK) -/*! @} */ - -/*! @name SWDATAH1 - Target Write Data Halfword */ -/*! @{ */ - -#define I3C_SWDATAH1_DATA_MASK (0xFFFFU) -#define I3C_SWDATAH1_DATA_SHIFT (0U) -/*! DATA - Data */ -#define I3C_SWDATAH1_DATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAH1_DATA_SHIFT)) & I3C_SWDATAH1_DATA_MASK) -/*! @} */ - -/*! @name SCAPABILITIES2 - Target Capabilities 2 */ -/*! @{ */ - -#define I3C_SCAPABILITIES2_MAPCNT_MASK (0xFU) -#define I3C_SCAPABILITIES2_MAPCNT_SHIFT (0U) -/*! MAPCNT - Map Count */ -#define I3C_SCAPABILITIES2_MAPCNT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_MAPCNT_SHIFT)) & I3C_SCAPABILITIES2_MAPCNT_MASK) - -#define I3C_SCAPABILITIES2_I2C10B_MASK (0x10U) -#define I3C_SCAPABILITIES2_I2C10B_SHIFT (4U) -/*! I2C10B - I2C 10-bit Address - * 0b0..Not supported - * 0b1..Supported - */ -#define I3C_SCAPABILITIES2_I2C10B(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_I2C10B_SHIFT)) & I3C_SCAPABILITIES2_I2C10B_MASK) - -#define I3C_SCAPABILITIES2_I2CRST_MASK (0x20U) -#define I3C_SCAPABILITIES2_I2CRST_SHIFT (5U) -/*! I2CRST - I2C Software Reset - * 0b0..Not supported - * 0b1..Supported - */ -#define I3C_SCAPABILITIES2_I2CRST(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_I2CRST_SHIFT)) & I3C_SCAPABILITIES2_I2CRST_MASK) - -#define I3C_SCAPABILITIES2_I2CDEVID_MASK (0x40U) -#define I3C_SCAPABILITIES2_I2CDEVID_SHIFT (6U) -/*! I2CDEVID - I2C Device ID - * 0b0..Not supported - * 0b1..Supported - */ -#define I3C_SCAPABILITIES2_I2CDEVID(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_I2CDEVID_SHIFT)) & I3C_SCAPABILITIES2_I2CDEVID_MASK) - -#define I3C_SCAPABILITIES2_IBIEXT_MASK (0x100U) -#define I3C_SCAPABILITIES2_IBIEXT_SHIFT (8U) -/*! IBIEXT - In-Band Interrupt EXTDATA - * 0b0..Not supported - * 0b1..Supported - */ -#define I3C_SCAPABILITIES2_IBIEXT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_IBIEXT_SHIFT)) & I3C_SCAPABILITIES2_IBIEXT_MASK) - -#define I3C_SCAPABILITIES2_IBIXREG_MASK (0x200U) -#define I3C_SCAPABILITIES2_IBIXREG_SHIFT (9U) -/*! IBIXREG - In-Band Interrupt Extended Register - * 0b0..Not supported - * 0b1..Supported - */ -#define I3C_SCAPABILITIES2_IBIXREG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_IBIXREG_SHIFT)) & I3C_SCAPABILITIES2_IBIXREG_MASK) - -#define I3C_SCAPABILITIES2_SLVRST_MASK (0x20000U) -#define I3C_SCAPABILITIES2_SLVRST_SHIFT (17U) -/*! SLVRST - Target Reset - * 0b0..Not supported - * 0b1..Supported - */ -#define I3C_SCAPABILITIES2_SLVRST(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_SLVRST_SHIFT)) & I3C_SCAPABILITIES2_SLVRST_MASK) - -#define I3C_SCAPABILITIES2_GROUP_MASK (0xC0000U) -#define I3C_SCAPABILITIES2_GROUP_SHIFT (18U) -/*! GROUP - Group - * 0b00..v1.1 group addressing not supported - * 0b01..One group supported - * 0b10..Two groups supported - * 0b11..Three groups supported - */ -#define I3C_SCAPABILITIES2_GROUP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_GROUP_SHIFT)) & I3C_SCAPABILITIES2_GROUP_MASK) - -#define I3C_SCAPABILITIES2_AASA_MASK (0x200000U) -#define I3C_SCAPABILITIES2_AASA_SHIFT (21U) -/*! AASA - SETAASA - * 0b1..SETAASA supported - * 0b0..SETAASA not supported - */ -#define I3C_SCAPABILITIES2_AASA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_AASA_SHIFT)) & I3C_SCAPABILITIES2_AASA_MASK) - -#define I3C_SCAPABILITIES2_SSTSUB_MASK (0x400000U) -#define I3C_SCAPABILITIES2_SSTSUB_SHIFT (22U) -/*! SSTSUB - Target-Target(s)-Tunnel Subscriber Capable - * 0b1..Subscriber capable - * 0b0..Not subscriber capable - */ -#define I3C_SCAPABILITIES2_SSTSUB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_SSTSUB_SHIFT)) & I3C_SCAPABILITIES2_SSTSUB_MASK) - -#define I3C_SCAPABILITIES2_SSTWR_MASK (0x800000U) -#define I3C_SCAPABILITIES2_SSTWR_SHIFT (23U) -/*! SSTWR - Target-Target(s)-Tunnel Write Capable - * 0b1..Write capable - * 0b0..Not write capable - */ -#define I3C_SCAPABILITIES2_SSTWR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_SSTWR_SHIFT)) & I3C_SCAPABILITIES2_SSTWR_MASK) -/*! @} */ - -/*! @name SCAPABILITIES - Target Capabilities */ -/*! @{ */ - -#define I3C_SCAPABILITIES_IDENA_MASK (0x3U) -#define I3C_SCAPABILITIES_IDENA_SHIFT (0U) -/*! IDENA - ID 48b Handler - * 0b00..Application - * 0b01..Hardware - * 0b10..Hardware, but the I3C module instance handles ID 48b - * 0b11..A part number register (PARTNO) - */ -#define I3C_SCAPABILITIES_IDENA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_IDENA_SHIFT)) & I3C_SCAPABILITIES_IDENA_MASK) - -#define I3C_SCAPABILITIES_IDREG_MASK (0x3CU) -#define I3C_SCAPABILITIES_IDREG_SHIFT (2U) -/*! IDREG - ID Register - * 0b0000..All ID register features disabled - * 0bxxx1..ID Instance is a register; used if there is no PARTNO register - * 0bxx1x..An ID Random field is available - * 0bx1xx..A Device Characteristic Register (DCR) is available - * 0b1xxx..A Bus Characteristics Register (BCR) is available - */ -#define I3C_SCAPABILITIES_IDREG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_IDREG_SHIFT)) & I3C_SCAPABILITIES_IDREG_MASK) - -#define I3C_SCAPABILITIES_HDRSUPP_MASK (0xC0U) -#define I3C_SCAPABILITIES_HDRSUPP_SHIFT (6U) -/*! HDRSUPP - High Data Rate Support - * 0b00..No HDR modes supported - * 0b01..DDR mode supported - * *.. - */ -#define I3C_SCAPABILITIES_HDRSUPP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_HDRSUPP_SHIFT)) & I3C_SCAPABILITIES_HDRSUPP_MASK) - -#define I3C_SCAPABILITIES_MASTER_MASK (0x200U) -#define I3C_SCAPABILITIES_MASTER_SHIFT (9U) -/*! MASTER - Controller - * 0b0..Not supported - * 0b1..Supported - */ -#define I3C_SCAPABILITIES_MASTER(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_MASTER_SHIFT)) & I3C_SCAPABILITIES_MASTER_MASK) - -#define I3C_SCAPABILITIES_SADDR_MASK (0xC00U) -#define I3C_SCAPABILITIES_SADDR_SHIFT (10U) -/*! SADDR - Static Address - * 0b00..No static address - * 0b01..Static address is fixed in hardware - * 0b10..Hardware controls the static address dynamically (for example, from the pin strap) - * 0b11..SCONFIG register supplies the static address - */ -#define I3C_SCAPABILITIES_SADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_SADDR_SHIFT)) & I3C_SCAPABILITIES_SADDR_MASK) - -#define I3C_SCAPABILITIES_CCCHANDLE_MASK (0xF000U) -#define I3C_SCAPABILITIES_CCCHANDLE_SHIFT (12U) -/*! CCCHANDLE - Common Command Codes Handling - * 0b0000..All handling features disabled - * 0bxxx1..The I3C module manages events, activities, status, HDR, and if enabled for it, ID and static-address-related items - * 0bxx1x..The I3C module manages maximum read and write lengths, and max data speed - * 0bx1xx..GETSTATUS CCC returns the values of SCTRL[PENDINT] and SCTRL[ACTSTATE] - * 0b1xxx..GETSTATUS CCC returns the value of SCTRL[VENDINFO] - */ -#define I3C_SCAPABILITIES_CCCHANDLE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_CCCHANDLE_SHIFT)) & I3C_SCAPABILITIES_CCCHANDLE_MASK) - -#define I3C_SCAPABILITIES_IBI_MR_HJ_MASK (0x1F0000U) -#define I3C_SCAPABILITIES_IBI_MR_HJ_SHIFT (16U) -/*! IBI_MR_HJ - In-Band Interrupts, Controller Requests, Hot-Join Events - * 0b00000..Application cannot generate IBI, CR, or HJ - * 0bxxxx1..Application can generate an IBI - * 0bxxx1x..When bit 0 = 1, the IBI has data from the SCTRL register - * 0bxx1xx..Application can generate a controller request for a secondary controller - * 0bx1xxx..Application can generate a Hot-Join event - * 0b1xxxx..Application can use SCONFIG[BAMATCH] for bus-available timing - */ -#define I3C_SCAPABILITIES_IBI_MR_HJ(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_IBI_MR_HJ_SHIFT)) & I3C_SCAPABILITIES_IBI_MR_HJ_MASK) - -#define I3C_SCAPABILITIES_TIMECTRL_MASK (0x200000U) -#define I3C_SCAPABILITIES_TIMECTRL_SHIFT (21U) -/*! TIMECTRL - Time Control - * 0b0..No time control supported - * 0b1..At least one time-control type supported - */ -#define I3C_SCAPABILITIES_TIMECTRL(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_TIMECTRL_SHIFT)) & I3C_SCAPABILITIES_TIMECTRL_MASK) - -#define I3C_SCAPABILITIES_EXTFIFO_MASK (0x3800000U) -#define I3C_SCAPABILITIES_EXTFIFO_SHIFT (23U) -/*! EXTFIFO - External FIFO - * 0b000..No external FIFO available - * 0b001..Standard available or free external FIFO - * 0b010..Request track external FIFO - * *.. - */ -#define I3C_SCAPABILITIES_EXTFIFO(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_EXTFIFO_SHIFT)) & I3C_SCAPABILITIES_EXTFIFO_MASK) - -#define I3C_SCAPABILITIES_FIFOTX_MASK (0xC000000U) -#define I3C_SCAPABILITIES_FIFOTX_SHIFT (26U) -/*! FIFOTX - FIFO Transmit - * 0b00..Two - * 0b01..Four - * 0b10..Eight - * 0b11..16 or larger - */ -#define I3C_SCAPABILITIES_FIFOTX(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_FIFOTX_SHIFT)) & I3C_SCAPABILITIES_FIFOTX_MASK) - -#define I3C_SCAPABILITIES_FIFORX_MASK (0x30000000U) -#define I3C_SCAPABILITIES_FIFORX_SHIFT (28U) -/*! FIFORX - FIFO Receive - * 0b00..Two or three - * 0b01..Four - * 0b10..Eight - * 0b11..16 or larger - */ -#define I3C_SCAPABILITIES_FIFORX(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_FIFORX_SHIFT)) & I3C_SCAPABILITIES_FIFORX_MASK) - -#define I3C_SCAPABILITIES_INT_MASK (0x40000000U) -#define I3C_SCAPABILITIES_INT_SHIFT (30U) -/*! INT - Interrupts - * 0b1..Supported - * 0b0..Not supported - */ -#define I3C_SCAPABILITIES_INT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_INT_SHIFT)) & I3C_SCAPABILITIES_INT_MASK) - -#define I3C_SCAPABILITIES_DMA_MASK (0x80000000U) -#define I3C_SCAPABILITIES_DMA_SHIFT (31U) -/*! DMA - Direct Memory Access - * 0b1..Supported - * 0b0..Not supported - */ -#define I3C_SCAPABILITIES_DMA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_DMA_SHIFT)) & I3C_SCAPABILITIES_DMA_MASK) -/*! @} */ - -/*! @name SDYNADDR - Target Dynamic Address */ -/*! @{ */ - -#define I3C_SDYNADDR_DAVALID_MASK (0x1U) -#define I3C_SDYNADDR_DAVALID_SHIFT (0U) -/*! DAVALID - Dynamic Address Valid - * 0b0..DANOTASSIGNED: a dynamic address is not assigned - * 0b1..DAASSIGNED: a dynamic address is assigned - */ -#define I3C_SDYNADDR_DAVALID(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDYNADDR_DAVALID_SHIFT)) & I3C_SDYNADDR_DAVALID_MASK) - -#define I3C_SDYNADDR_DADDR_MASK (0xFEU) -#define I3C_SDYNADDR_DADDR_SHIFT (1U) -/*! DADDR - Dynamic Address */ -#define I3C_SDYNADDR_DADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDYNADDR_DADDR_SHIFT)) & I3C_SDYNADDR_DADDR_MASK) - -#define I3C_SDYNADDR_MAPSA_MASK (0x1000U) -#define I3C_SDYNADDR_MAPSA_SHIFT (12U) -/*! MAPSA - Map a Static Address */ -#define I3C_SDYNADDR_MAPSA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDYNADDR_MAPSA_SHIFT)) & I3C_SDYNADDR_MAPSA_MASK) - -#define I3C_SDYNADDR_SA10B_MASK (0xE000U) -#define I3C_SDYNADDR_SA10B_SHIFT (13U) -/*! SA10B - 10-Bit Static Address */ -#define I3C_SDYNADDR_SA10B(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDYNADDR_SA10B_SHIFT)) & I3C_SDYNADDR_SA10B_MASK) - -#define I3C_SDYNADDR_KEY_MASK (0xFFFF0000U) -#define I3C_SDYNADDR_KEY_SHIFT (16U) -/*! KEY - Key */ -#define I3C_SDYNADDR_KEY(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDYNADDR_KEY_SHIFT)) & I3C_SDYNADDR_KEY_MASK) -/*! @} */ - -/*! @name SMAXLIMITS - Target Maximum Limits */ -/*! @{ */ - -#define I3C_SMAXLIMITS_MAXRD_MASK (0xFFFU) -#define I3C_SMAXLIMITS_MAXRD_SHIFT (0U) -/*! MAXRD - Maximum Read Length */ -#define I3C_SMAXLIMITS_MAXRD(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMAXLIMITS_MAXRD_SHIFT)) & I3C_SMAXLIMITS_MAXRD_MASK) - -#define I3C_SMAXLIMITS_MAXWR_MASK (0xFFF0000U) -#define I3C_SMAXLIMITS_MAXWR_SHIFT (16U) -/*! MAXWR - Maximum Write Length */ -#define I3C_SMAXLIMITS_MAXWR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMAXLIMITS_MAXWR_SHIFT)) & I3C_SMAXLIMITS_MAXWR_MASK) -/*! @} */ - -/*! @name SIDPARTNO - Target ID Part Number */ -/*! @{ */ - -#define I3C_SIDPARTNO_PARTNO_MASK (0xFFFFFFFFU) -#define I3C_SIDPARTNO_PARTNO_SHIFT (0U) -/*! PARTNO - Part Number */ -#define I3C_SIDPARTNO_PARTNO(x) (((uint32_t)(((uint32_t)(x)) << I3C_SIDPARTNO_PARTNO_SHIFT)) & I3C_SIDPARTNO_PARTNO_MASK) -/*! @} */ - -/*! @name SIDEXT - Target ID Extension */ -/*! @{ */ - -#define I3C_SIDEXT_DCR_MASK (0xFF00U) -#define I3C_SIDEXT_DCR_SHIFT (8U) -/*! DCR - Device Characteristic Register */ -#define I3C_SIDEXT_DCR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SIDEXT_DCR_SHIFT)) & I3C_SIDEXT_DCR_MASK) - -#define I3C_SIDEXT_BCR_MASK (0xFF0000U) -#define I3C_SIDEXT_BCR_SHIFT (16U) -/*! BCR - Bus Characteristics Register */ -#define I3C_SIDEXT_BCR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SIDEXT_BCR_SHIFT)) & I3C_SIDEXT_BCR_MASK) -/*! @} */ - -/*! @name SVENDORID - Target Vendor ID */ -/*! @{ */ - -#define I3C_SVENDORID_VID_MASK (0x7FFFU) -#define I3C_SVENDORID_VID_SHIFT (0U) -/*! VID - Vendor ID */ -#define I3C_SVENDORID_VID(x) (((uint32_t)(((uint32_t)(x)) << I3C_SVENDORID_VID_SHIFT)) & I3C_SVENDORID_VID_MASK) -/*! @} */ - -/*! @name STCCLOCK - Target Time Control Clock */ -/*! @{ */ - -#define I3C_STCCLOCK_ACCURACY_MASK (0xFFU) -#define I3C_STCCLOCK_ACCURACY_SHIFT (0U) -/*! ACCURACY - Clock Accuracy */ -#define I3C_STCCLOCK_ACCURACY(x) (((uint32_t)(((uint32_t)(x)) << I3C_STCCLOCK_ACCURACY_SHIFT)) & I3C_STCCLOCK_ACCURACY_MASK) - -#define I3C_STCCLOCK_FREQ_MASK (0xFF00U) -#define I3C_STCCLOCK_FREQ_SHIFT (8U) -/*! FREQ - Clock Frequency */ -#define I3C_STCCLOCK_FREQ(x) (((uint32_t)(((uint32_t)(x)) << I3C_STCCLOCK_FREQ_SHIFT)) & I3C_STCCLOCK_FREQ_MASK) -/*! @} */ - -/*! @name SMSGMAPADDR - Target Message Map Address */ -/*! @{ */ - -#define I3C_SMSGMAPADDR_MAPLAST_MASK (0xFU) -#define I3C_SMSGMAPADDR_MAPLAST_SHIFT (0U) -/*! MAPLAST - Matched Address Index */ -#define I3C_SMSGMAPADDR_MAPLAST(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMSGMAPADDR_MAPLAST_SHIFT)) & I3C_SMSGMAPADDR_MAPLAST_MASK) - -#define I3C_SMSGMAPADDR_LASTSTATIC_MASK (0x10U) -#define I3C_SMSGMAPADDR_LASTSTATIC_SHIFT (4U) -/*! LASTSTATIC - Last Static Address Matched - * 0b1..I2C static address - * 0b0..I3C dynamic address - */ -#define I3C_SMSGMAPADDR_LASTSTATIC(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMSGMAPADDR_LASTSTATIC_SHIFT)) & I3C_SMSGMAPADDR_LASTSTATIC_MASK) - -#define I3C_SMSGMAPADDR_MAPLASTM1_MASK (0xF00U) -#define I3C_SMSGMAPADDR_MAPLASTM1_SHIFT (8U) -/*! MAPLASTM1 - Matched Previous Address Index 1 */ -#define I3C_SMSGMAPADDR_MAPLASTM1(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMSGMAPADDR_MAPLASTM1_SHIFT)) & I3C_SMSGMAPADDR_MAPLASTM1_MASK) - -#define I3C_SMSGMAPADDR_MAPLASTM2_MASK (0xF0000U) -#define I3C_SMSGMAPADDR_MAPLASTM2_SHIFT (16U) -/*! MAPLASTM2 - Matched Previous Index 2 */ -#define I3C_SMSGMAPADDR_MAPLASTM2(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMSGMAPADDR_MAPLASTM2_SHIFT)) & I3C_SMSGMAPADDR_MAPLASTM2_MASK) -/*! @} */ - -/*! @name MCONFIG_EXT - Controller Extended Configuration */ -/*! @{ */ - -#define I3C_MCONFIG_EXT_I3C_CAS_DEL_MASK (0x30000U) -#define I3C_MCONFIG_EXT_I3C_CAS_DEL_SHIFT (16U) -/*! I3C_CAS_DEL - I3C CAS Delay After START - * 0b00..No delay - * 0b01..Increases SCL clock period by 1/2 - * 0b10..Increases SCL clock period by 1 - * 0b11..Increases SCL clock period by 3/2 - */ -#define I3C_MCONFIG_EXT_I3C_CAS_DEL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_EXT_I3C_CAS_DEL_SHIFT)) & I3C_MCONFIG_EXT_I3C_CAS_DEL_MASK) - -#define I3C_MCONFIG_EXT_I3C_CASR_DEL_MASK (0xC0000U) -#define I3C_MCONFIG_EXT_I3C_CASR_DEL_SHIFT (18U) -/*! I3C_CASR_DEL - I3C CAS Delay After Repeated START - * 0b00..No delay - * 0b01..Increases SCL clock period by 1/2 - * 0b10..Increases SCL clock period by 1 - * 0b11..Increases SCL clock period by 1 1/2 - */ -#define I3C_MCONFIG_EXT_I3C_CASR_DEL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_EXT_I3C_CASR_DEL_SHIFT)) & I3C_MCONFIG_EXT_I3C_CASR_DEL_MASK) -/*! @} */ - -/*! @name MCTRL - Controller Control */ -/*! @{ */ - -#define I3C_MCTRL_REQUEST_MASK (0x7U) -#define I3C_MCTRL_REQUEST_SHIFT (0U) -/*! REQUEST - Request - * 0b000..NONE - * 0b001..EMITSTARTADDR - * 0b010..EMITSTOP - * 0b011..IBIACKNACK - * 0b100..PROCESSDAA - * 0b101.. - * 0b110..Force Exit and Target Reset - * 0b111..AUTOIBI - */ -#define I3C_MCTRL_REQUEST(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCTRL_REQUEST_SHIFT)) & I3C_MCTRL_REQUEST_MASK) - -#define I3C_MCTRL_TYPE_MASK (0x30U) -#define I3C_MCTRL_TYPE_SHIFT (4U) -/*! TYPE - Bus Type with EmitStartAddr - * 0b00..I3C - * 0b01..I2C - * 0b10..DDR - * 0b11.. - */ -#define I3C_MCTRL_TYPE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCTRL_TYPE_SHIFT)) & I3C_MCTRL_TYPE_MASK) - -#define I3C_MCTRL_IBIRESP_MASK (0xC0U) -#define I3C_MCTRL_IBIRESP_SHIFT (6U) -/*! IBIRESP - In-Band Interrupt Response - * 0b00..ACK (acknowledge) - * 0b01..NACK (reject) - * 0b10..Acknowledge with mandatory byte - * 0b11..Manual - */ -#define I3C_MCTRL_IBIRESP(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCTRL_IBIRESP_SHIFT)) & I3C_MCTRL_IBIRESP_MASK) - -#define I3C_MCTRL_DIR_MASK (0x100U) -#define I3C_MCTRL_DIR_SHIFT (8U) -/*! DIR - Direction - * 0b0..Write - * 0b1..Read - */ -#define I3C_MCTRL_DIR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCTRL_DIR_SHIFT)) & I3C_MCTRL_DIR_MASK) - -#define I3C_MCTRL_ADDR_MASK (0xFE00U) -#define I3C_MCTRL_ADDR_SHIFT (9U) -/*! ADDR - Address */ -#define I3C_MCTRL_ADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCTRL_ADDR_SHIFT)) & I3C_MCTRL_ADDR_MASK) - -#define I3C_MCTRL_RDTERM_MASK (0xFF0000U) -#define I3C_MCTRL_RDTERM_SHIFT (16U) -/*! RDTERM - Read Terminate Counter */ -#define I3C_MCTRL_RDTERM(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCTRL_RDTERM_SHIFT)) & I3C_MCTRL_RDTERM_MASK) -/*! @} */ - -/*! @name MSTATUS - Controller Status */ -/*! @{ */ - -#define I3C_MSTATUS_STATE_MASK (0x7U) -#define I3C_MSTATUS_STATE_SHIFT (0U) -/*! STATE - State of the Controller - * 0b000..IDLE (bus has stopped) - * 0b001..SLVREQ (target request) - * 0b010..MSGSDR - * 0b011..NORMACT - * 0b100..MSGDDR - * 0b101..DAA - * 0b110..IBIACK - * 0b111..IBIRCV - */ -#define I3C_MSTATUS_STATE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_STATE_SHIFT)) & I3C_MSTATUS_STATE_MASK) - -#define I3C_MSTATUS_BETWEEN_MASK (0x10U) -#define I3C_MSTATUS_BETWEEN_SHIFT (4U) -/*! BETWEEN - Between - * 0b0..Inactive (for other cases) - * 0b1..Active - */ -#define I3C_MSTATUS_BETWEEN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_BETWEEN_SHIFT)) & I3C_MSTATUS_BETWEEN_MASK) - -#define I3C_MSTATUS_NACKED_MASK (0x20U) -#define I3C_MSTATUS_NACKED_SHIFT (5U) -/*! NACKED - Not Acknowledged - * 0b1..NACKed (not acknowledged) - * 0b0..Not NACKed - */ -#define I3C_MSTATUS_NACKED(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_NACKED_SHIFT)) & I3C_MSTATUS_NACKED_MASK) - -#define I3C_MSTATUS_IBITYPE_MASK (0xC0U) -#define I3C_MSTATUS_IBITYPE_SHIFT (6U) -/*! IBITYPE - In-Band Interrupt (IBI) Type - * 0b00..NONE (no IBI: this status occurs when MSTATUS[IBIWON] becomes 0) - * 0b01..IBI - * 0b10..CR - * 0b11..HJ - */ -#define I3C_MSTATUS_IBITYPE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_IBITYPE_SHIFT)) & I3C_MSTATUS_IBITYPE_MASK) - -#define I3C_MSTATUS_SLVSTART_MASK (0x100U) -#define I3C_MSTATUS_SLVSTART_SHIFT (8U) -/*! SLVSTART - Target Start - * 0b1..Target requesting START - * 0b0..Target not requesting START - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MSTATUS_SLVSTART(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_SLVSTART_SHIFT)) & I3C_MSTATUS_SLVSTART_MASK) - -#define I3C_MSTATUS_MCTRLDONE_MASK (0x200U) -#define I3C_MSTATUS_MCTRLDONE_SHIFT (9U) -/*! MCTRLDONE - Controller Control Done - * 0b1..Done - * 0b0..Not done - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MSTATUS_MCTRLDONE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_MCTRLDONE_SHIFT)) & I3C_MSTATUS_MCTRLDONE_MASK) - -#define I3C_MSTATUS_COMPLETE_MASK (0x400U) -#define I3C_MSTATUS_COMPLETE_SHIFT (10U) -/*! COMPLETE - Complete - * 0b1..Complete - * 0b0..Not complete - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MSTATUS_COMPLETE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_COMPLETE_SHIFT)) & I3C_MSTATUS_COMPLETE_MASK) - -#define I3C_MSTATUS_RXPEND_MASK (0x800U) -#define I3C_MSTATUS_RXPEND_SHIFT (11U) -/*! RXPEND - RXPEND - * 0b1..Receive message pending - * 0b0..No receive message pending - */ -#define I3C_MSTATUS_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_RXPEND_SHIFT)) & I3C_MSTATUS_RXPEND_MASK) - -#define I3C_MSTATUS_TXNOTFULL_MASK (0x1000U) -#define I3C_MSTATUS_TXNOTFULL_SHIFT (12U) -/*! TXNOTFULL - TX Buffer or FIFO Not Full - * 0b1..Receive buffer or FIFO not full - * 0b0..Receive buffer or FIFO full - */ -#define I3C_MSTATUS_TXNOTFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_TXNOTFULL_SHIFT)) & I3C_MSTATUS_TXNOTFULL_MASK) - -#define I3C_MSTATUS_IBIWON_MASK (0x2000U) -#define I3C_MSTATUS_IBIWON_SHIFT (13U) -/*! IBIWON - In-Band Interrupt (IBI) Won - * 0b1..IBI arbitration won - * 0b0..No IBI arbitration won - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MSTATUS_IBIWON(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_IBIWON_SHIFT)) & I3C_MSTATUS_IBIWON_MASK) - -#define I3C_MSTATUS_ERRWARN_MASK (0x8000U) -#define I3C_MSTATUS_ERRWARN_SHIFT (15U) -/*! ERRWARN - Error or Warning - * 0b1..Error or warning - * 0b0..No error or warning - */ -#define I3C_MSTATUS_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_ERRWARN_SHIFT)) & I3C_MSTATUS_ERRWARN_MASK) - -#define I3C_MSTATUS_NOWMASTER_MASK (0x80000U) -#define I3C_MSTATUS_NOWMASTER_SHIFT (19U) -/*! NOWMASTER - Module is now Controller - * 0b1..Controller - * 0b0..Not a controller - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MSTATUS_NOWMASTER(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_NOWMASTER_SHIFT)) & I3C_MSTATUS_NOWMASTER_MASK) - -#define I3C_MSTATUS_IBIADDR_MASK (0x7F000000U) -#define I3C_MSTATUS_IBIADDR_SHIFT (24U) -/*! IBIADDR - IBI Address */ -#define I3C_MSTATUS_IBIADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_IBIADDR_SHIFT)) & I3C_MSTATUS_IBIADDR_MASK) -/*! @} */ - -/*! @name MIBIRULES - Controller In-band Interrupt Registry and Rules */ -/*! @{ */ - -#define I3C_MIBIRULES_ADDR0_MASK (0x3FU) -#define I3C_MIBIRULES_ADDR0_SHIFT (0U) -/*! ADDR0 - ADDR0 */ -#define I3C_MIBIRULES_ADDR0(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_ADDR0_SHIFT)) & I3C_MIBIRULES_ADDR0_MASK) - -#define I3C_MIBIRULES_ADDR1_MASK (0xFC0U) -#define I3C_MIBIRULES_ADDR1_SHIFT (6U) -/*! ADDR1 - ADDR1 */ -#define I3C_MIBIRULES_ADDR1(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_ADDR1_SHIFT)) & I3C_MIBIRULES_ADDR1_MASK) - -#define I3C_MIBIRULES_ADDR2_MASK (0x3F000U) -#define I3C_MIBIRULES_ADDR2_SHIFT (12U) -/*! ADDR2 - ADDR2 */ -#define I3C_MIBIRULES_ADDR2(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_ADDR2_SHIFT)) & I3C_MIBIRULES_ADDR2_MASK) - -#define I3C_MIBIRULES_ADDR3_MASK (0xFC0000U) -#define I3C_MIBIRULES_ADDR3_SHIFT (18U) -/*! ADDR3 - ADDR3 */ -#define I3C_MIBIRULES_ADDR3(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_ADDR3_SHIFT)) & I3C_MIBIRULES_ADDR3_MASK) - -#define I3C_MIBIRULES_ADDR4_MASK (0x3F000000U) -#define I3C_MIBIRULES_ADDR4_SHIFT (24U) -/*! ADDR4 - ADDR4 */ -#define I3C_MIBIRULES_ADDR4(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_ADDR4_SHIFT)) & I3C_MIBIRULES_ADDR4_MASK) - -#define I3C_MIBIRULES_MSB0_MASK (0x40000000U) -#define I3C_MIBIRULES_MSB0_SHIFT (30U) -/*! MSB0 - Most Significant Address Bit is 0 - * 0b1..MSB is 0 - * 0b0..MSB is not 0 - */ -#define I3C_MIBIRULES_MSB0(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_MSB0_SHIFT)) & I3C_MIBIRULES_MSB0_MASK) - -#define I3C_MIBIRULES_NOBYTE_MASK (0x80000000U) -#define I3C_MIBIRULES_NOBYTE_SHIFT (31U) -/*! NOBYTE - No IBI byte - * 0b1..Without mandatory IBI byte - * 0b0..With mandatory IBI byte - */ -#define I3C_MIBIRULES_NOBYTE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_NOBYTE_SHIFT)) & I3C_MIBIRULES_NOBYTE_MASK) -/*! @} */ - -/*! @name MINTSET - Controller Interrupt Set */ -/*! @{ */ - -#define I3C_MINTSET_SLVSTART_MASK (0x100U) -#define I3C_MINTSET_SLVSTART_SHIFT (8U) -/*! SLVSTART - Target Start Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_SLVSTART(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_SLVSTART_SHIFT)) & I3C_MINTSET_SLVSTART_MASK) - -#define I3C_MINTSET_MCTRLDONE_MASK (0x200U) -#define I3C_MINTSET_MCTRLDONE_SHIFT (9U) -/*! MCTRLDONE - Controller Control Done Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_MCTRLDONE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_MCTRLDONE_SHIFT)) & I3C_MINTSET_MCTRLDONE_MASK) - -#define I3C_MINTSET_COMPLETE_MASK (0x400U) -#define I3C_MINTSET_COMPLETE_SHIFT (10U) -/*! COMPLETE - Completed Message Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_COMPLETE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_COMPLETE_SHIFT)) & I3C_MINTSET_COMPLETE_MASK) - -#define I3C_MINTSET_RXPEND_MASK (0x800U) -#define I3C_MINTSET_RXPEND_SHIFT (11U) -/*! RXPEND - Receive Pending Interrupt Enable */ -#define I3C_MINTSET_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_RXPEND_SHIFT)) & I3C_MINTSET_RXPEND_MASK) - -#define I3C_MINTSET_TXNOTFULL_MASK (0x1000U) -#define I3C_MINTSET_TXNOTFULL_SHIFT (12U) -/*! TXNOTFULL - Transmit Buffer/FIFO Not Full Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_TXNOTFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_TXNOTFULL_SHIFT)) & I3C_MINTSET_TXNOTFULL_MASK) - -#define I3C_MINTSET_IBIWON_MASK (0x2000U) -#define I3C_MINTSET_IBIWON_SHIFT (13U) -/*! IBIWON - IBI Won Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_IBIWON(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_IBIWON_SHIFT)) & I3C_MINTSET_IBIWON_MASK) - -#define I3C_MINTSET_ERRWARN_MASK (0x8000U) -#define I3C_MINTSET_ERRWARN_SHIFT (15U) -/*! ERRWARN - Error or Warning (ERRWARN) Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_ERRWARN_SHIFT)) & I3C_MINTSET_ERRWARN_MASK) - -#define I3C_MINTSET_NOWMASTER_MASK (0x80000U) -#define I3C_MINTSET_NOWMASTER_SHIFT (19U) -/*! NOWMASTER - Now Controller Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_NOWMASTER(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_NOWMASTER_SHIFT)) & I3C_MINTSET_NOWMASTER_MASK) -/*! @} */ - -/*! @name MINTCLR - Controller Interrupt Clear */ -/*! @{ */ - -#define I3C_MINTCLR_SLVSTART_MASK (0x100U) -#define I3C_MINTCLR_SLVSTART_SHIFT (8U) -/*! SLVSTART - SLVSTART Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_SLVSTART(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_SLVSTART_SHIFT)) & I3C_MINTCLR_SLVSTART_MASK) - -#define I3C_MINTCLR_MCTRLDONE_MASK (0x200U) -#define I3C_MINTCLR_MCTRLDONE_SHIFT (9U) -/*! MCTRLDONE - MCTRLDONE Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_MCTRLDONE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_MCTRLDONE_SHIFT)) & I3C_MINTCLR_MCTRLDONE_MASK) - -#define I3C_MINTCLR_COMPLETE_MASK (0x400U) -#define I3C_MINTCLR_COMPLETE_SHIFT (10U) -/*! COMPLETE - COMPLETE Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_COMPLETE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_COMPLETE_SHIFT)) & I3C_MINTCLR_COMPLETE_MASK) - -#define I3C_MINTCLR_RXPEND_MASK (0x800U) -#define I3C_MINTCLR_RXPEND_SHIFT (11U) -/*! RXPEND - RXPEND Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_RXPEND_SHIFT)) & I3C_MINTCLR_RXPEND_MASK) - -#define I3C_MINTCLR_TXNOTFULL_MASK (0x1000U) -#define I3C_MINTCLR_TXNOTFULL_SHIFT (12U) -/*! TXNOTFULL - TXNOTFULL Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_TXNOTFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_TXNOTFULL_SHIFT)) & I3C_MINTCLR_TXNOTFULL_MASK) - -#define I3C_MINTCLR_IBIWON_MASK (0x2000U) -#define I3C_MINTCLR_IBIWON_SHIFT (13U) -/*! IBIWON - IBIWON Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_IBIWON(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_IBIWON_SHIFT)) & I3C_MINTCLR_IBIWON_MASK) - -#define I3C_MINTCLR_ERRWARN_MASK (0x8000U) -#define I3C_MINTCLR_ERRWARN_SHIFT (15U) -/*! ERRWARN - ERRWARN Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_ERRWARN_SHIFT)) & I3C_MINTCLR_ERRWARN_MASK) - -#define I3C_MINTCLR_NOWMASTER_MASK (0x80000U) -#define I3C_MINTCLR_NOWMASTER_SHIFT (19U) -/*! NOWMASTER - NOWCONTROLLER Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_NOWMASTER(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_NOWMASTER_SHIFT)) & I3C_MINTCLR_NOWMASTER_MASK) -/*! @} */ - -/*! @name MINTMASKED - Controller Interrupt Mask */ -/*! @{ */ - -#define I3C_MINTMASKED_SLVSTART_MASK (0x100U) -#define I3C_MINTMASKED_SLVSTART_SHIFT (8U) -/*! SLVSTART - SLVSTART Interrupt Mask - * 0b1..Enabled - * 0b0..Disabled - */ -#define I3C_MINTMASKED_SLVSTART(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_SLVSTART_SHIFT)) & I3C_MINTMASKED_SLVSTART_MASK) - -#define I3C_MINTMASKED_MCTRLDONE_MASK (0x200U) -#define I3C_MINTMASKED_MCTRLDONE_SHIFT (9U) -/*! MCTRLDONE - MCTRLDONE Interrupt Mask - * 0b1..Enabled - * 0b0..Disabled - */ -#define I3C_MINTMASKED_MCTRLDONE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_MCTRLDONE_SHIFT)) & I3C_MINTMASKED_MCTRLDONE_MASK) - -#define I3C_MINTMASKED_COMPLETE_MASK (0x400U) -#define I3C_MINTMASKED_COMPLETE_SHIFT (10U) -/*! COMPLETE - COMPLETE Interrupt Mask - * 0b1..Enabled - * 0b0..Disabled - */ -#define I3C_MINTMASKED_COMPLETE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_COMPLETE_SHIFT)) & I3C_MINTMASKED_COMPLETE_MASK) - -#define I3C_MINTMASKED_RXPEND_MASK (0x800U) -#define I3C_MINTMASKED_RXPEND_SHIFT (11U) -/*! RXPEND - RXPEND Interrupt Mask */ -#define I3C_MINTMASKED_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_RXPEND_SHIFT)) & I3C_MINTMASKED_RXPEND_MASK) - -#define I3C_MINTMASKED_TXNOTFULL_MASK (0x1000U) -#define I3C_MINTMASKED_TXNOTFULL_SHIFT (12U) -/*! TXNOTFULL - TXNOTFULL Interrupt Mask - * 0b1..Enabled - * 0b0..Disabled - */ -#define I3C_MINTMASKED_TXNOTFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_TXNOTFULL_SHIFT)) & I3C_MINTMASKED_TXNOTFULL_MASK) - -#define I3C_MINTMASKED_IBIWON_MASK (0x2000U) -#define I3C_MINTMASKED_IBIWON_SHIFT (13U) -/*! IBIWON - IBIWON Interrupt Mask - * 0b1..Enabled - * 0b0..Disabled - */ -#define I3C_MINTMASKED_IBIWON(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_IBIWON_SHIFT)) & I3C_MINTMASKED_IBIWON_MASK) - -#define I3C_MINTMASKED_ERRWARN_MASK (0x8000U) -#define I3C_MINTMASKED_ERRWARN_SHIFT (15U) -/*! ERRWARN - ERRWARN Interrupt Mask - * 0b1..Enabled - * 0b0..Disabled - */ -#define I3C_MINTMASKED_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_ERRWARN_SHIFT)) & I3C_MINTMASKED_ERRWARN_MASK) - -#define I3C_MINTMASKED_NOWMASTER_MASK (0x80000U) -#define I3C_MINTMASKED_NOWMASTER_SHIFT (19U) -/*! NOWMASTER - NOWCONTROLLER Interrupt Mask - * 0b1..Enabled - * 0b0..Disabled - */ -#define I3C_MINTMASKED_NOWMASTER(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_NOWMASTER_SHIFT)) & I3C_MINTMASKED_NOWMASTER_MASK) -/*! @} */ - -/*! @name MERRWARN - Controller Errors and Warnings */ -/*! @{ */ - -#define I3C_MERRWARN_URUN_MASK (0x2U) -#define I3C_MERRWARN_URUN_SHIFT (1U) -/*! URUN - Underrun Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_URUN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_URUN_SHIFT)) & I3C_MERRWARN_URUN_MASK) - -#define I3C_MERRWARN_NACK_MASK (0x4U) -#define I3C_MERRWARN_NACK_SHIFT (2U) -/*! NACK - Not Acknowledge Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_NACK(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_NACK_SHIFT)) & I3C_MERRWARN_NACK_MASK) - -#define I3C_MERRWARN_WRABT_MASK (0x8U) -#define I3C_MERRWARN_WRABT_SHIFT (3U) -/*! WRABT - Write Abort Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_WRABT(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_WRABT_SHIFT)) & I3C_MERRWARN_WRABT_MASK) - -#define I3C_MERRWARN_TERM_MASK (0x10U) -#define I3C_MERRWARN_TERM_SHIFT (4U) -/*! TERM - Terminate Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_TERM(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_TERM_SHIFT)) & I3C_MERRWARN_TERM_MASK) - -#define I3C_MERRWARN_HPAR_MASK (0x200U) -#define I3C_MERRWARN_HPAR_SHIFT (9U) -/*! HPAR - High Data Rate Parity - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_HPAR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_HPAR_SHIFT)) & I3C_MERRWARN_HPAR_MASK) - -#define I3C_MERRWARN_HCRC_MASK (0x400U) -#define I3C_MERRWARN_HCRC_SHIFT (10U) -/*! HCRC - High Data Rate CRC Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_HCRC(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_HCRC_SHIFT)) & I3C_MERRWARN_HCRC_MASK) - -#define I3C_MERRWARN_OREAD_MASK (0x10000U) -#define I3C_MERRWARN_OREAD_SHIFT (16U) -/*! OREAD - Overread Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_OREAD(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_OREAD_SHIFT)) & I3C_MERRWARN_OREAD_MASK) - -#define I3C_MERRWARN_OWRITE_MASK (0x20000U) -#define I3C_MERRWARN_OWRITE_SHIFT (17U) -/*! OWRITE - Overwrite Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_OWRITE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_OWRITE_SHIFT)) & I3C_MERRWARN_OWRITE_MASK) - -#define I3C_MERRWARN_MSGERR_MASK (0x40000U) -#define I3C_MERRWARN_MSGERR_SHIFT (18U) -/*! MSGERR - Message Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_MSGERR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_MSGERR_SHIFT)) & I3C_MERRWARN_MSGERR_MASK) - -#define I3C_MERRWARN_INVREQ_MASK (0x80000U) -#define I3C_MERRWARN_INVREQ_SHIFT (19U) -/*! INVREQ - Invalid Request Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_INVREQ(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_INVREQ_SHIFT)) & I3C_MERRWARN_INVREQ_MASK) - -#define I3C_MERRWARN_TIMEOUT_MASK (0x100000U) -#define I3C_MERRWARN_TIMEOUT_SHIFT (20U) -/*! TIMEOUT - Timeout Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_TIMEOUT(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_TIMEOUT_SHIFT)) & I3C_MERRWARN_TIMEOUT_MASK) -/*! @} */ - -/*! @name MDMACTRL - Controller DMA Control */ -/*! @{ */ - -#define I3C_MDMACTRL_DMAFB_MASK (0x3U) -#define I3C_MDMACTRL_DMAFB_SHIFT (0U) -/*! DMAFB - DMA from Bus - * 0b00..DMA not used - * 0b01..Enable DMA for one frame - * 0b10..Enable DMA until DMA is turned off - * 0b11.. - */ -#define I3C_MDMACTRL_DMAFB(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDMACTRL_DMAFB_SHIFT)) & I3C_MDMACTRL_DMAFB_MASK) - -#define I3C_MDMACTRL_DMATB_MASK (0xCU) -#define I3C_MDMACTRL_DMATB_SHIFT (2U) -/*! DMATB - DMA to Bus - * 0b00..DMA not used - * 0b01..Enable DMA for one frame (ended by DMA or terminated) - * 0b10..Enable DMA until DMA is turned off - * 0b11.. - */ -#define I3C_MDMACTRL_DMATB(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDMACTRL_DMATB_SHIFT)) & I3C_MDMACTRL_DMATB_MASK) - -#define I3C_MDMACTRL_DMAWIDTH_MASK (0x30U) -#define I3C_MDMACTRL_DMAWIDTH_SHIFT (4U) -/*! DMAWIDTH - DMA Width - * 0b00, 0b01..Byte - * 0b10..Halfword (16 bits) - * 0b11.. - */ -#define I3C_MDMACTRL_DMAWIDTH(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDMACTRL_DMAWIDTH_SHIFT)) & I3C_MDMACTRL_DMAWIDTH_MASK) -/*! @} */ - -/*! @name MDATACTRL - Controller Data Control */ -/*! @{ */ - -#define I3C_MDATACTRL_FLUSHTB_MASK (0x1U) -#define I3C_MDATACTRL_FLUSHTB_SHIFT (0U) -/*! FLUSHTB - Flush To-Bus Buffer or FIFO - * 0b1..Flush the buffer - * 0b0..No action - */ -#define I3C_MDATACTRL_FLUSHTB(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_FLUSHTB_SHIFT)) & I3C_MDATACTRL_FLUSHTB_MASK) - -#define I3C_MDATACTRL_FLUSHFB_MASK (0x2U) -#define I3C_MDATACTRL_FLUSHFB_SHIFT (1U) -/*! FLUSHFB - Flush From-Bus Buffer or FIFO - * 0b1..Flush the buffer - * 0b0..No action - */ -#define I3C_MDATACTRL_FLUSHFB(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_FLUSHFB_SHIFT)) & I3C_MDATACTRL_FLUSHFB_MASK) - -#define I3C_MDATACTRL_UNLOCK_MASK (0x8U) -#define I3C_MDATACTRL_UNLOCK_SHIFT (3U) -/*! UNLOCK - Unlock - * 0b0..Locked - * 0b1..Unlocked - */ -#define I3C_MDATACTRL_UNLOCK(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_UNLOCK_SHIFT)) & I3C_MDATACTRL_UNLOCK_MASK) - -#define I3C_MDATACTRL_TXTRIG_MASK (0x30U) -#define I3C_MDATACTRL_TXTRIG_SHIFT (4U) -/*! TXTRIG - Transmit Trigger Level - * 0b00..Trigger when empty - * 0b01..Trigger when 1/4 full or less - * 0b10..Trigger when 1/2 full or less - * 0b11..Trigger when 1 less than full or less (default) - */ -#define I3C_MDATACTRL_TXTRIG(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_TXTRIG_SHIFT)) & I3C_MDATACTRL_TXTRIG_MASK) - -#define I3C_MDATACTRL_RXTRIG_MASK (0xC0U) -#define I3C_MDATACTRL_RXTRIG_SHIFT (6U) -/*! RXTRIG - Receive Trigger Level - * 0b00..Trigger when not empty - * 0b01..Trigger when 1/4 full or more - * 0b10..Trigger when 1/2 full or more - * 0b11..Trigger when 3/4 full or more - */ -#define I3C_MDATACTRL_RXTRIG(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_RXTRIG_SHIFT)) & I3C_MDATACTRL_RXTRIG_MASK) - -#define I3C_MDATACTRL_TXCOUNT_MASK (0x1F0000U) -#define I3C_MDATACTRL_TXCOUNT_SHIFT (16U) -/*! TXCOUNT - Transmit Byte Count */ -#define I3C_MDATACTRL_TXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_TXCOUNT_SHIFT)) & I3C_MDATACTRL_TXCOUNT_MASK) - -#define I3C_MDATACTRL_RXCOUNT_MASK (0x1F000000U) -#define I3C_MDATACTRL_RXCOUNT_SHIFT (24U) -/*! RXCOUNT - Receive Byte Count */ -#define I3C_MDATACTRL_RXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_RXCOUNT_SHIFT)) & I3C_MDATACTRL_RXCOUNT_MASK) - -#define I3C_MDATACTRL_TXFULL_MASK (0x40000000U) -#define I3C_MDATACTRL_TXFULL_SHIFT (30U) -/*! TXFULL - Transmit is Full - * 0b0..Not full - * 0b1..Full - */ -#define I3C_MDATACTRL_TXFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_TXFULL_SHIFT)) & I3C_MDATACTRL_TXFULL_MASK) - -#define I3C_MDATACTRL_RXEMPTY_MASK (0x80000000U) -#define I3C_MDATACTRL_RXEMPTY_SHIFT (31U) -/*! RXEMPTY - Receive is Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define I3C_MDATACTRL_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_RXEMPTY_SHIFT)) & I3C_MDATACTRL_RXEMPTY_MASK) -/*! @} */ - -/*! @name MWDATAB - Controller Write Data Byte */ -/*! @{ */ - -#define I3C_MWDATAB_VALUE_MASK (0xFFU) -#define I3C_MWDATAB_VALUE_SHIFT (0U) -/*! VALUE - Data Byte */ -#define I3C_MWDATAB_VALUE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAB_VALUE_SHIFT)) & I3C_MWDATAB_VALUE_MASK) - -#define I3C_MWDATAB_END_MASK (0x100U) -#define I3C_MWDATAB_END_SHIFT (8U) -/*! END - End of Message - * 0b0..Not the end - * 0b1..End - */ -#define I3C_MWDATAB_END(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAB_END_SHIFT)) & I3C_MWDATAB_END_MASK) - -#define I3C_MWDATAB_END_ALSO_MASK (0x10000U) -#define I3C_MWDATAB_END_ALSO_SHIFT (16U) -/*! END_ALSO - End of Message ALSO - * 0b0..Not the end - * 0b1..End - */ -#define I3C_MWDATAB_END_ALSO(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAB_END_ALSO_SHIFT)) & I3C_MWDATAB_END_ALSO_MASK) -/*! @} */ - -/*! @name MWDATABE - Controller Write Data Byte End */ -/*! @{ */ - -#define I3C_MWDATABE_VALUE_MASK (0xFFU) -#define I3C_MWDATABE_VALUE_SHIFT (0U) -/*! VALUE - Data */ -#define I3C_MWDATABE_VALUE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATABE_VALUE_SHIFT)) & I3C_MWDATABE_VALUE_MASK) -/*! @} */ - -/*! @name MWDATAH - Controller Write Data Halfword */ -/*! @{ */ - -#define I3C_MWDATAH_DATA0_MASK (0xFFU) -#define I3C_MWDATAH_DATA0_SHIFT (0U) -/*! DATA0 - Data Byte 0 */ -#define I3C_MWDATAH_DATA0(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAH_DATA0_SHIFT)) & I3C_MWDATAH_DATA0_MASK) - -#define I3C_MWDATAH_DATA1_MASK (0xFF00U) -#define I3C_MWDATAH_DATA1_SHIFT (8U) -/*! DATA1 - Data Byte 1 */ -#define I3C_MWDATAH_DATA1(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAH_DATA1_SHIFT)) & I3C_MWDATAH_DATA1_MASK) - -#define I3C_MWDATAH_END_MASK (0x10000U) -#define I3C_MWDATAH_END_SHIFT (16U) -/*! END - End of Message - * 0b0..Not the end - * 0b1..End - */ -#define I3C_MWDATAH_END(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAH_END_SHIFT)) & I3C_MWDATAH_END_MASK) -/*! @} */ - -/*! @name MWDATAHE - Controller Write Data Halfword End */ -/*! @{ */ - -#define I3C_MWDATAHE_DATA0_MASK (0xFFU) -#define I3C_MWDATAHE_DATA0_SHIFT (0U) -/*! DATA0 - Data Byte 0 */ -#define I3C_MWDATAHE_DATA0(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAHE_DATA0_SHIFT)) & I3C_MWDATAHE_DATA0_MASK) - -#define I3C_MWDATAHE_DATA1_MASK (0xFF00U) -#define I3C_MWDATAHE_DATA1_SHIFT (8U) -/*! DATA1 - Data Byte 1 */ -#define I3C_MWDATAHE_DATA1(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAHE_DATA1_SHIFT)) & I3C_MWDATAHE_DATA1_MASK) -/*! @} */ - -/*! @name MRDATAB - Controller Read Data Byte */ -/*! @{ */ - -#define I3C_MRDATAB_VALUE_MASK (0xFFU) -#define I3C_MRDATAB_VALUE_SHIFT (0U) -/*! VALUE - Value */ -#define I3C_MRDATAB_VALUE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MRDATAB_VALUE_SHIFT)) & I3C_MRDATAB_VALUE_MASK) -/*! @} */ - -/*! @name MRDATAH - Controller Read Data Halfword */ -/*! @{ */ - -#define I3C_MRDATAH_LSB_MASK (0xFFU) -#define I3C_MRDATAH_LSB_SHIFT (0U) -/*! LSB - Low Byte */ -#define I3C_MRDATAH_LSB(x) (((uint32_t)(((uint32_t)(x)) << I3C_MRDATAH_LSB_SHIFT)) & I3C_MRDATAH_LSB_MASK) - -#define I3C_MRDATAH_MSB_MASK (0xFF00U) -#define I3C_MRDATAH_MSB_SHIFT (8U) -/*! MSB - High Byte */ -#define I3C_MRDATAH_MSB(x) (((uint32_t)(((uint32_t)(x)) << I3C_MRDATAH_MSB_SHIFT)) & I3C_MRDATAH_MSB_MASK) -/*! @} */ - -/*! @name MWDATAB1 - Controller Write Byte Data 1 (to Bus) */ -/*! @{ */ - -#define I3C_MWDATAB1_VALUE_MASK (0xFFU) -#define I3C_MWDATAB1_VALUE_SHIFT (0U) -/*! VALUE - Value */ -#define I3C_MWDATAB1_VALUE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAB1_VALUE_SHIFT)) & I3C_MWDATAB1_VALUE_MASK) -/*! @} */ - -/*! @name MWDATAH1 - Controller Write Halfword Data (to Bus) */ -/*! @{ */ - -#define I3C_MWDATAH1_VALUE_MASK (0xFFFFU) -#define I3C_MWDATAH1_VALUE_SHIFT (0U) -/*! VALUE - Value */ -#define I3C_MWDATAH1_VALUE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAH1_VALUE_SHIFT)) & I3C_MWDATAH1_VALUE_MASK) -/*! @} */ - -/*! @name MWMSG_SDR_CONTROL - Controller Write Message Control in SDR mode */ -/*! @{ */ - -#define I3C_MWMSG_SDR_CONTROL_DIR_MASK (0x1U) -#define I3C_MWMSG_SDR_CONTROL_DIR_SHIFT (0U) -/*! DIR - Direction - * 0b0..Write - * 0b1..Read - */ -#define I3C_MWMSG_SDR_CONTROL_DIR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_SDR_CONTROL_DIR_SHIFT)) & I3C_MWMSG_SDR_CONTROL_DIR_MASK) - -#define I3C_MWMSG_SDR_CONTROL_ADDR_MASK (0xFEU) -#define I3C_MWMSG_SDR_CONTROL_ADDR_SHIFT (1U) -/*! ADDR - Address */ -#define I3C_MWMSG_SDR_CONTROL_ADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_SDR_CONTROL_ADDR_SHIFT)) & I3C_MWMSG_SDR_CONTROL_ADDR_MASK) - -#define I3C_MWMSG_SDR_CONTROL_END_MASK (0x100U) -#define I3C_MWMSG_SDR_CONTROL_END_SHIFT (8U) -/*! END - End of SDR Message - * 0b0..Not the end - * 0b1..End - */ -#define I3C_MWMSG_SDR_CONTROL_END(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_SDR_CONTROL_END_SHIFT)) & I3C_MWMSG_SDR_CONTROL_END_MASK) - -#define I3C_MWMSG_SDR_CONTROL_I2C_MASK (0x400U) -#define I3C_MWMSG_SDR_CONTROL_I2C_SHIFT (10U) -/*! I2C - I2C - * 0b0..I3C message - * 0b1..I2C message - */ -#define I3C_MWMSG_SDR_CONTROL_I2C(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_SDR_CONTROL_I2C_SHIFT)) & I3C_MWMSG_SDR_CONTROL_I2C_MASK) - -#define I3C_MWMSG_SDR_CONTROL_LEN_MASK (0xF800U) -#define I3C_MWMSG_SDR_CONTROL_LEN_SHIFT (11U) -/*! LEN - Length */ -#define I3C_MWMSG_SDR_CONTROL_LEN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_SDR_CONTROL_LEN_SHIFT)) & I3C_MWMSG_SDR_CONTROL_LEN_MASK) -/*! @} */ - -/*! @name MWMSG_SDR_DATA - Controller Write Message Data in SDR mode */ -/*! @{ */ - -#define I3C_MWMSG_SDR_DATA_DATA16B_MASK (0xFFFFU) -#define I3C_MWMSG_SDR_DATA_DATA16B_SHIFT (0U) -/*! DATA16B - Data */ -#define I3C_MWMSG_SDR_DATA_DATA16B(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_SDR_DATA_DATA16B_SHIFT)) & I3C_MWMSG_SDR_DATA_DATA16B_MASK) -/*! @} */ - -/*! @name MRMSG_SDR - Controller Read Message in SDR mode */ -/*! @{ */ - -#define I3C_MRMSG_SDR_DATA_MASK (0xFFFFU) -#define I3C_MRMSG_SDR_DATA_SHIFT (0U) -/*! DATA - Data */ -#define I3C_MRMSG_SDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_MRMSG_SDR_DATA_SHIFT)) & I3C_MRMSG_SDR_DATA_MASK) -/*! @} */ - -/*! @name MWMSG_DDR_CONTROL - Controller Write Message in DDR mode: First Control Word */ -/*! @{ */ - -#define I3C_MWMSG_DDR_CONTROL_ADDRCMD_MASK (0xFFFFU) -#define I3C_MWMSG_DDR_CONTROL_ADDRCMD_SHIFT (0U) -/*! ADDRCMD - Address Command */ -#define I3C_MWMSG_DDR_CONTROL_ADDRCMD(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_DDR_CONTROL_ADDRCMD_SHIFT)) & I3C_MWMSG_DDR_CONTROL_ADDRCMD_MASK) -/*! @} */ - -/*! @name MWMSG_DDR_CONTROL2 - Controller Write Message in DDR Mode Control 2 */ -/*! @{ */ - -#define I3C_MWMSG_DDR_CONTROL2_LEN_MASK (0x3FFU) -#define I3C_MWMSG_DDR_CONTROL2_LEN_SHIFT (0U) -/*! LEN - Length of Message */ -#define I3C_MWMSG_DDR_CONTROL2_LEN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_DDR_CONTROL2_LEN_SHIFT)) & I3C_MWMSG_DDR_CONTROL2_LEN_MASK) - -#define I3C_MWMSG_DDR_CONTROL2_END_MASK (0x4000U) -#define I3C_MWMSG_DDR_CONTROL2_END_SHIFT (14U) -/*! END - End of Message - * 0b1..End - * 0b0..Not the end - */ -#define I3C_MWMSG_DDR_CONTROL2_END(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_DDR_CONTROL2_END_SHIFT)) & I3C_MWMSG_DDR_CONTROL2_END_MASK) -/*! @} */ - -/*! @name MWMSG_DDR_DATA - Controller Write Message Data in DDR mode */ -/*! @{ */ - -#define I3C_MWMSG_DDR_DATA_DATA16B_MASK (0xFFFFU) -#define I3C_MWMSG_DDR_DATA_DATA16B_SHIFT (0U) -/*! DATA16B - Data */ -#define I3C_MWMSG_DDR_DATA_DATA16B(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_DDR_DATA_DATA16B_SHIFT)) & I3C_MWMSG_DDR_DATA_DATA16B_MASK) -/*! @} */ - -/*! @name MRMSG_DDR - Controller Read Message in DDR mode */ -/*! @{ */ - -#define I3C_MRMSG_DDR_DATA_MASK (0xFFFFU) -#define I3C_MRMSG_DDR_DATA_SHIFT (0U) -/*! DATA - Data */ -#define I3C_MRMSG_DDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_MRMSG_DDR_DATA_SHIFT)) & I3C_MRMSG_DDR_DATA_MASK) -/*! @} */ - -/*! @name MDYNADDR - Controller Dynamic Address */ -/*! @{ */ - -#define I3C_MDYNADDR_DAVALID_MASK (0x1U) -#define I3C_MDYNADDR_DAVALID_SHIFT (0U) -/*! DAVALID - Dynamic Address Valid - * 0b1..Valid DA assigned - * 0b0..No valid DA assigned - */ -#define I3C_MDYNADDR_DAVALID(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDYNADDR_DAVALID_SHIFT)) & I3C_MDYNADDR_DAVALID_MASK) - -#define I3C_MDYNADDR_DADDR_MASK (0xFEU) -#define I3C_MDYNADDR_DADDR_SHIFT (1U) -/*! DADDR - Dynamic Address */ -#define I3C_MDYNADDR_DADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDYNADDR_DADDR_SHIFT)) & I3C_MDYNADDR_DADDR_MASK) -/*! @} */ - -/*! @name SMAPCTRL0 - Map Feature Control 0 */ -/*! @{ */ - -#define I3C_SMAPCTRL0_ENA_MASK (0x1U) -#define I3C_SMAPCTRL0_ENA_SHIFT (0U) -/*! ENA - Enable Primary Dynamic Address - * 0b0..Disabled - * 0b1..Enabled - */ -#define I3C_SMAPCTRL0_ENA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMAPCTRL0_ENA_SHIFT)) & I3C_SMAPCTRL0_ENA_MASK) - -#define I3C_SMAPCTRL0_DA_MASK (0xFEU) -#define I3C_SMAPCTRL0_DA_SHIFT (1U) -/*! DA - Dynamic Address */ -#define I3C_SMAPCTRL0_DA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMAPCTRL0_DA_SHIFT)) & I3C_SMAPCTRL0_DA_MASK) - -#define I3C_SMAPCTRL0_CAUSE_MASK (0x700U) -#define I3C_SMAPCTRL0_CAUSE_SHIFT (8U) -/*! CAUSE - Cause - * 0b000..No information (this value occurs when not configured to write DA) - * 0b001..Set using ENTDAA - * 0b010..Set using SETDASA, SETAASA, or SETNEWDA - * 0b011..Cleared using RSTDAA - * 0b100..Auto MAP change happened last - * *.. - */ -#define I3C_SMAPCTRL0_CAUSE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMAPCTRL0_CAUSE_SHIFT)) & I3C_SMAPCTRL0_CAUSE_MASK) -/*! @} */ - -/*! @name IBIEXT1 - Extended IBI Data 1 */ -/*! @{ */ - -#define I3C_IBIEXT1_CNT_MASK (0x7U) -#define I3C_IBIEXT1_CNT_SHIFT (0U) -/*! CNT - Count */ -#define I3C_IBIEXT1_CNT(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT1_CNT_SHIFT)) & I3C_IBIEXT1_CNT_MASK) - -#define I3C_IBIEXT1_MAX_MASK (0x70U) -#define I3C_IBIEXT1_MAX_SHIFT (4U) -/*! MAX - Maximum */ -#define I3C_IBIEXT1_MAX(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT1_MAX_SHIFT)) & I3C_IBIEXT1_MAX_MASK) - -#define I3C_IBIEXT1_EXT1_MASK (0xFF00U) -#define I3C_IBIEXT1_EXT1_SHIFT (8U) -/*! EXT1 - Extra Byte 1 */ -#define I3C_IBIEXT1_EXT1(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT1_EXT1_SHIFT)) & I3C_IBIEXT1_EXT1_MASK) - -#define I3C_IBIEXT1_EXT2_MASK (0xFF0000U) -#define I3C_IBIEXT1_EXT2_SHIFT (16U) -/*! EXT2 - Extra Byte 2 */ -#define I3C_IBIEXT1_EXT2(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT1_EXT2_SHIFT)) & I3C_IBIEXT1_EXT2_MASK) - -#define I3C_IBIEXT1_EXT3_MASK (0xFF000000U) -#define I3C_IBIEXT1_EXT3_SHIFT (24U) -/*! EXT3 - Extra Byte 3 */ -#define I3C_IBIEXT1_EXT3(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT1_EXT3_SHIFT)) & I3C_IBIEXT1_EXT3_MASK) -/*! @} */ - -/*! @name IBIEXT2 - Extended IBI Data 2 */ -/*! @{ */ - -#define I3C_IBIEXT2_EXT4_MASK (0xFFU) -#define I3C_IBIEXT2_EXT4_SHIFT (0U) -/*! EXT4 - Extra Byte 4 */ -#define I3C_IBIEXT2_EXT4(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT2_EXT4_SHIFT)) & I3C_IBIEXT2_EXT4_MASK) - -#define I3C_IBIEXT2_EXT5_MASK (0xFF00U) -#define I3C_IBIEXT2_EXT5_SHIFT (8U) -/*! EXT5 - Extra Byte 5 */ -#define I3C_IBIEXT2_EXT5(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT2_EXT5_SHIFT)) & I3C_IBIEXT2_EXT5_MASK) - -#define I3C_IBIEXT2_EXT6_MASK (0xFF0000U) -#define I3C_IBIEXT2_EXT6_SHIFT (16U) -/*! EXT6 - Extra Byte 6 */ -#define I3C_IBIEXT2_EXT6(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT2_EXT6_SHIFT)) & I3C_IBIEXT2_EXT6_MASK) - -#define I3C_IBIEXT2_EXT7_MASK (0xFF000000U) -#define I3C_IBIEXT2_EXT7_SHIFT (24U) -/*! EXT7 - Extra Byte 7 */ -#define I3C_IBIEXT2_EXT7(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT2_EXT7_SHIFT)) & I3C_IBIEXT2_EXT7_MASK) -/*! @} */ - -/*! @name SID - Target Module ID */ -/*! @{ */ - -#define I3C_SID_ID_MASK (0xFFFFFFFFU) -#define I3C_SID_ID_SHIFT (0U) -/*! ID - ID */ -#define I3C_SID_ID(x) (((uint32_t)(((uint32_t)(x)) << I3C_SID_ID_SHIFT)) & I3C_SID_ID_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group I3C_Register_Masks */ - - -/* I3C - Peripheral instance base addresses */ -/** Peripheral I3C0 base address */ -#define I3C0_BASE (0x40002000u) -/** Peripheral I3C0 base pointer */ -#define I3C0 ((I3C_Type *)I3C0_BASE) -/** Array initializer of I3C peripheral base addresses */ -#define I3C_BASE_ADDRS { I3C0_BASE } -/** Array initializer of I3C peripheral base pointers */ -#define I3C_BASE_PTRS { I3C0 } -/** Interrupt vectors for the I3C peripheral type */ -#define I3C_IRQS { I3C0_IRQn } - -/*! - * @} - */ /* end of group I3C_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- INPUTMUX Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup INPUTMUX_Peripheral_Access_Layer INPUTMUX Peripheral Access Layer - * @{ - */ - -/** INPUTMUX - Register Layout Typedef */ -typedef struct { - uint8_t RESERVED_0[32]; - __IO uint32_t CTIMER0CAP[4]; /**< Capture select register for CTIMER inputs, array offset: 0x20, array step: 0x4 */ - __IO uint32_t TIMER0TRIG; /**< Trigger register for TIMER0, offset: 0x30 */ - uint8_t RESERVED_1[12]; - __IO uint32_t CTIMER1CAP[4]; /**< Capture select register for CTIMER inputs, array offset: 0x40, array step: 0x4 */ - __IO uint32_t TIMER1TRIG; /**< Trigger register for TIMER1, offset: 0x50 */ - uint8_t RESERVED_2[12]; - __IO uint32_t CTIMER2CAP[4]; /**< Capture select register for CTIMER inputs, array offset: 0x60, array step: 0x4 */ - __IO uint32_t TIMER2TRIG; /**< Trigger register for TIMER2 inputs, offset: 0x70 */ - uint8_t RESERVED_3[268]; - __IO uint32_t FREQMEAS_REF; /**< Selection for frequency measurement reference clock, offset: 0x180 */ - __IO uint32_t FREQMEAS_TAR; /**< Selection for frequency measurement reference clock, offset: 0x184 */ - uint8_t RESERVED_4[24]; - __IO uint32_t CTIMER3CAP[4]; /**< Capture select register for CTIMER inputs, array offset: 0x1A0, array step: 0x4 */ - __IO uint32_t TIMER3TRIG; /**< Trigger register for TIMER3, offset: 0x1B0 */ - uint8_t RESERVED_5[12]; - __IO uint32_t CTIMER4CAP[4]; /**< Capture select register for CTIMER inputs, array offset: 0x1C0, array step: 0x4 */ - __IO uint32_t TIMER4TRIG; /**< Trigger register for TIMER4, offset: 0x1D0 */ - uint8_t RESERVED_6[44]; - __IO uint32_t AOI1_INPUT[16]; /**< AOI1 trigger input connections 0, array offset: 0x200, array step: 0x4 */ - uint8_t RESERVED_7[32]; - __IO uint32_t CMP0_TRIG; /**< CMP0 input connections, offset: 0x260 */ - uint8_t RESERVED_8[28]; - __IO uint32_t ADC0_TRIG[4]; /**< ADC Trigger input connections, array offset: 0x280, array step: 0x4 */ - uint8_t RESERVED_9[48]; - __IO uint32_t ADC1_TRIG[4]; /**< ADC Trigger input connections, array offset: 0x2C0, array step: 0x4 */ - uint8_t RESERVED_10[48]; - __IO uint32_t DAC0_TRIG; /**< This register selects the DAC0 trigger inputs., offset: 0x300 */ - uint8_t RESERVED_11[92]; - __IO uint32_t QDC0_TRIG; /**< QDC0 Trigger Input Connections, offset: 0x360 */ - __IO uint32_t QDC0_HOME; /**< QDC0 Trigger Input Connections, offset: 0x364 */ - __IO uint32_t QDC0_INDEX; /**< QDC0 Trigger Input Connections, offset: 0x368 */ - __IO uint32_t QDC0_PHASEB; /**< QDC0 Trigger Input Connections, offset: 0x36C */ - __IO uint32_t QDC0_PHASEA; /**< QDC0 Trigger Input Connections, offset: 0x370 */ - __IO uint32_t QDC0_ICAP1; /**< QDC0 Trigger Input Connections, offset: 0x374 */ - __IO uint32_t QDC0_ICAP2; /**< QDC0 Trigger Input Connections, offset: 0x378 */ - __IO uint32_t QDC0_ICAP3; /**< QDC0 Trigger Input Connections, offset: 0x37C */ - __IO uint32_t QDC1_TRIG; /**< QDC1 Trigger Input Connections, offset: 0x380 */ - __IO uint32_t QDC1_HOME; /**< QDC1 Trigger Input Connections, offset: 0x384 */ - __IO uint32_t QDC1_INDEX; /**< QDC1 Trigger Input Connections, offset: 0x388 */ - __IO uint32_t QDC1_PHASEB; /**< QDC1 Trigger Input Connections, offset: 0x38C */ - __IO uint32_t QDC1_PHASEA; /**< QDC1 Trigger Input Connections, offset: 0x390 */ - __IO uint32_t QDC1_ICAP1; /**< QDC1 Trigger Input Connections, offset: 0x394 */ - __IO uint32_t QDC1_ICAP2; /**< QDC1 Trigger Input Connections, offset: 0x398 */ - __IO uint32_t QDC1_ICAP3; /**< QDC1 Trigger Input Connections, offset: 0x39C */ - __IO uint32_t FLEXPWM0_SM0_EXTA0; /**< PWM0 input trigger connections, offset: 0x3A0 */ - __IO uint32_t FLEXPWM0_SM0_EXTSYNC; /**< PWM0 input trigger connections, offset: 0x3A4 */ - __IO uint32_t FLEXPWM0_SM1_EXTA; /**< PWM0 input trigger connections, offset: 0x3A8 */ - __IO uint32_t FLEXPWM0_SM1_EXTSYNC; /**< PWM0 input trigger connections, offset: 0x3AC */ - __IO uint32_t FLEXPWM0_SM2_EXTA; /**< PWM0 input trigger connections, offset: 0x3B0 */ - __IO uint32_t FLEXPWM0_SM2_EXTSYNC; /**< PWM0 input trigger connections, offset: 0x3B4 */ - uint8_t RESERVED_12[8]; - __IO uint32_t FLEXPWM0_FAULT[4]; /**< PWM0 Fault Input Trigger Connections, array offset: 0x3C0, array step: 0x4 */ - __IO uint32_t FLEXPWM0_FORCE; /**< PWM0 input trigger connections, offset: 0x3D0 */ - uint8_t RESERVED_13[12]; - __IO uint32_t FLEXPWM1_SM0_EXTA0; /**< PWM1 input trigger connections, offset: 0x3E0 */ - __IO uint32_t FLEXPWM1_SM0_EXTSYNC; /**< PWM1 input trigger connections, offset: 0x3E4 */ - __IO uint32_t FLEXPWM1_SM1_EXTA; /**< PWM1 input trigger connections, offset: 0x3E8 */ - __IO uint32_t FLEXPWM1_SM1_EXTSYNC; /**< PWM1 input trigger connections, offset: 0x3EC */ - __IO uint32_t FLEXPWM1_SM2_EXTA; /**< PWM1 input trigger connections, offset: 0x3F0 */ - __IO uint32_t FLEXPWM1_SM2_EXTSYNC; /**< PWM1 input trigger connections, offset: 0x3F4 */ - uint8_t RESERVED_14[8]; - __IO uint32_t FLEXPWM1_FAULT[4]; /**< PWM1 Fault Input Trigger Connections, array offset: 0x400, array step: 0x4 */ - __IO uint32_t FLEXPWM1_FORCE; /**< PWM1 input trigger connections, offset: 0x410 */ - uint8_t RESERVED_15[12]; - __IO uint32_t PWM0_EXT_CLK; /**< PWM0 external clock trigger, offset: 0x420 */ - __IO uint32_t PWM1_EXT_CLK; /**< PWM1 external clock trigger, offset: 0x424 */ - uint8_t RESERVED_16[24]; - __IO uint32_t AOI0_INPUT[16]; /**< AOI0 trigger input connections 0, array offset: 0x440, array step: 0x4 */ - __IO uint32_t USBFS_TRIG; /**< USB-FS trigger input connections, offset: 0x480 */ - uint8_t RESERVED_17[60]; - __IO uint32_t EXT_TRIG0; /**< EXT trigger connections 0, offset: 0x4C0 */ - uint8_t RESERVED_18[28]; - __IO uint32_t CMP1_TRIG; /**< CMP1 input connections, offset: 0x4E0 */ - uint8_t RESERVED_19[92]; - __IO uint32_t LPI2C2_TRIG; /**< LPI2C2 trigger input connections, offset: 0x540 */ - uint8_t RESERVED_20[60]; - __IO uint32_t OPAMP0_TRIG; /**< OPAMP0 Trigger Input Connections, offset: 0x580 */ - uint8_t RESERVED_21[28]; - __IO uint32_t LPI2C0_TRIG; /**< LPI2C0 trigger input connections, offset: 0x5A0 */ - uint8_t RESERVED_22[28]; - __IO uint32_t LPI2C1_TRIG; /**< LPI2C1 trigger input connections, offset: 0x5C0 */ - uint8_t RESERVED_23[28]; - __IO uint32_t LPSPI0_TRIG; /**< LPSPI0 trigger input connections, offset: 0x5E0 */ - uint8_t RESERVED_24[28]; - __IO uint32_t LPSPI1_TRIG; /**< LPSPI1 trigger input connections, offset: 0x600 */ - uint8_t RESERVED_25[28]; - __IO uint32_t LPUART0r; /**< LPUART0 trigger input connections, offset: 0x620, 'r' suffix has been added to avoid a clash with peripheral base pointer macro 'LPUART0' */ - uint8_t RESERVED_26[28]; - __IO uint32_t LPUART1r; /**< LPUART1 trigger input connections, offset: 0x640, 'r' suffix has been added to avoid a clash with peripheral base pointer macro 'LPUART1' */ - uint8_t RESERVED_27[28]; - __IO uint32_t LPUART2r; /**< LPUART2 trigger input connections, offset: 0x660, 'r' suffix has been added to avoid a clash with peripheral base pointer macro 'LPUART2' */ - uint8_t RESERVED_28[28]; - __IO uint32_t LPUART3r; /**< LPUART3 trigger input connections, offset: 0x680, 'r' suffix has been added to avoid a clash with peripheral base pointer macro 'LPUART3' */ - uint8_t RESERVED_29[28]; - __IO uint32_t LPUART4r; /**< LPUART4 trigger input connections, offset: 0x6A0, 'r' suffix has been added to avoid a clash with peripheral base pointer macro 'LPUART4' */ - uint8_t RESERVED_30[60]; - __IO uint32_t FLEXIO_TRIG[4]; /**< FlexIO Trigger Input Connections, array offset: 0x6E0, array step: 0x4 */ -} INPUTMUX_Type; - -/* ---------------------------------------------------------------------------- - -- INPUTMUX Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup INPUTMUX_Register_Masks INPUTMUX Register Masks - * @{ - */ - -/*! @name CTIMERA_CTIMER0CAP - Capture select register for CTIMER inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMERA_CTIMER0CAP_INP_MASK (0x7FU) -#define INPUTMUX_CTIMERA_CTIMER0CAP_INP_SHIFT (0U) -/*! INP - Input number for CTIMER0 - * 0b0000000..Reserved - * 0b0000001..CT_IPN0 input is selected - * 0b0000010..CT_IPN1 input is selected - * 0b0000011..CT_IPN2 input is selected - * 0b0000100..CT_IPN3 input is selected - * 0b0000101..CT_IPN4 input is selected - * 0b0000110..CT_IPN5 input is selected - * 0b0000111..CT_IPN6 input is selected - * 0b0001000..CT_IPN7 input is selected - * 0b0001001..CT_IPN8 input is selected - * 0b0001010..CT_IPN9 input is selected - * 0b0001011..CT_IPN10 input is selected - * 0b0001100..CT_IPN11 input is selected - * 0b0001101..CT_IPN12 input is selected - * 0b0001110..CT_IPN13 input is selected - * 0b0001111..CT_IPN14 input is selected - * 0b0010000..CT_IPN15 input is selected - * 0b0010001..CT_IPN16 input is selected - * 0b0010010..CT_IPN17 input is selected - * 0b0010011..CT_IPN18 input is selected - * 0b0010100..CT_IPN19 input is selected - * 0b0010101..USB0 usb0 start of frame input is selected - * 0b0010110..AOI0_OUT0 input is selected - * 0b0010111..AOI0_OUT1 input is selected - * 0b0011000..AOI0_OUT2 input is selected - * 0b0011001..AOI0_OUT3 input is selected - * 0b0011010..ADC0_tcomp[0] - * 0b0011011..ADC0_tcomp[1] - * 0b0011100..ADC0_tcomp[2] - * 0b0011101..ADC0_tcomp[3] input is selected - * 0b0011110..CMP0_OUT is selected - * 0b0011111..CMP1_OUT is selected - * 0b0100000..Reserved - * 0b0100001..CTimer1_MAT1 input is selected - * 0b0100010..CTimer1_MAT2 input is selected - * 0b0100011..CTimer1_MAT3 input is selected - * 0b0100100..CTimer2_MAT1 input is selected - * 0b0100101..CTimer2_MAT2 input is selected - * 0b0100110..CTimer2_MAT3 input is selected - * 0b0100111..QDC0_CMP_FLAG0 is selected - * 0b0101000..QDC0_CMP_FLAG1 input is selected - * 0b0101001..QDC0_CMP_FLAG2 input is selected - * 0b0101010..QDC0_CMP_FLAG3 input is selected - * 0b0101011..QDC0_POS_MATCH0 input is selected - * 0b0101100..PWM0_SM0_MUX_TRIG0 input is selected - * 0b0101101..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0101110..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0101111..Reserved - * 0b0110000..LPI2C0 Master End of Packet input is selected - * 0b0110001..LPI2C0 Slave End of Packet input is selected - * 0b0110010..LPI2C1 Master End of Packet input is selected - * 0b0110011..LPI2C1 Slave End of Packet input is selected - * 0b0110100..LPSPI0 End of Frame input is selected - * 0b0110101..LPSPI0 Received Data Word input is selected - * 0b0110110..LPSPI1 End of Frame input is selected - * 0b0110111..LPSPI1 Received Data Word input is selected - * 0b0111000..LPUART0 Received Data Word input is selected - * 0b0111001..LPUART0 Transmitted Data Word input is selected - * 0b0111010..LPUART0 Receive Line Idle input is selected - * 0b0111011..LPUART1 Received Data Word input is selected - * 0b0111100..LPUART1 Transmitted Data Word input is selected - * 0b0111101..LPUART1 Receive Line Idle input is selected - * 0b0111110..LPUART2 Received Data Word input is selected - * 0b0111111..LPUART2 Transmitted Data Word input is selected - * 0b1000000..LPUART2 Receive Line Idle input is selected - * 0b1000001..LPUART3 Received Data Word input is selected - * 0b1000010..LPUART3 Transmitted Data Word input is selected - * 0b1000011..LPUART3 Receive Line Idle input is selected - * 0b1000100..LPUART4 Received Data Word input is selected - * 0b1000101..LPUART4 Transmitted Data Word input is selected - * 0b1000110..LPUART4 Receive Line Idle input is selected - * 0b1000111..AOI1_OUT0 input is selected - * 0b1001000..AOI1_OUT1 input is selected - * 0b1001001..AOI1_OUT2 input is selected - * 0b1001010..AOI1_OUT3 input is selected - * 0b1001011..ADC1_tcomp[0] input is selected - * 0b1001100..ADC1_tcomp[1] input is selected - * 0b1001101..ADC1_tcomp[2] input is selected - * 0b1001110..ADC1_tcomp[3] input is selected - * 0b1001111..CTimer3_MAT1 input is selected - * 0b1010000..CTimer3_MAT2 input is selected - * 0b1010001..CTimer3_MAT3 input is selected - * 0b1010010..CTimer4_MAT1 input is selected - * 0b1010011..CTimer4_MAT2 input is selected - * 0b1010100..CTimer4_MAT3 input is selected - * 0b1010101..QDC1_CMP_FLAG0 input is selected - * 0b1010110..QDC1_CMP_FLAG1 input is selected - * 0b1010111..QDC1_CMP_FLAG2 input is selected - * 0b1011000..QDC1_CMP_FLAG3 input is selected - * 0b1011001..QDC1_POS_MATCH0 input is selected - * 0b1011010..PWM1_SM0_MUX_TRIG0 input is selected - * 0b1011011..PWM1_SM1_MUX_TRIG0 input is selected - * 0b1011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b1011101..Reserved - * 0b1011110..LPI2C2 Master End of Packet input is selected - * 0b1011111..LPI2C2 Slave End of Packet input is selected - * 0b1100000..LPI2C3 Master End of Packet input is selected - * 0b1100001..LPI2C3 Slave End of Packet input is selected - * *.. - */ -#define INPUTMUX_CTIMERA_CTIMER0CAP_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMERA_CTIMER0CAP_INP_SHIFT)) & INPUTMUX_CTIMERA_CTIMER0CAP_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_CTIMERA_CTIMER0CAP */ -#define INPUTMUX_CTIMERA_CTIMER0CAP_COUNT (4U) - -/*! @name TIMER0TRIG - Trigger register for TIMER0 */ -/*! @{ */ - -#define INPUTMUX_TIMER0TRIG_INP_MASK (0x7FU) -#define INPUTMUX_TIMER0TRIG_INP_SHIFT (0U) -/*! INP - Input number for CTIMER0 - * 0b0000000..Reserved - * 0b0000001..CT_IPN0 input is selected - * 0b0000010..CT_IPN1 input is selected - * 0b0000011..CT_IPN2 input is selected - * 0b0000100..CT_IPN3 input is selected - * 0b0000101..CT_IPN4 input is selected - * 0b0000110..CT_IPN5 input is selected - * 0b0000111..CT_IPN6 input is selected - * 0b0001000..CT_IPN7 input is selected - * 0b0001001..CT_IPN8 input is selected - * 0b0001010..CT_IPN9 input is selected - * 0b0001011..CT_IPN10 input is selected - * 0b0001100..CT_IPN11 input is selected - * 0b0001101..CT_IPN12 input is selected - * 0b0001110..CT_IPN13 input is selected - * 0b0001111..CT_IPN14 input is selected - * 0b0010000..CT_IPN15 input is selected - * 0b0010001..CT_IPN16 input is selected - * 0b0010010..CT_IPN17 input is selected - * 0b0010011..CT_IPN18 input is selected - * 0b0010100..CT_IPN19 input is selected - * 0b0010101..USB0 usb0 start of frame input is selected - * 0b0010110..AOI0_OUT0 input is selected - * 0b0010111..AOI0_OUT1 input is selected - * 0b0011000..AOI0_OUT2 input is selected - * 0b0011001..AOI0_OUT3 input is selected - * 0b0011010..ADC0_tcomp[0] - * 0b0011011..ADC0_tcomp[1] - * 0b0011100..ADC0_tcomp[2] - * 0b0011101..ADC0_tcomp[3] input is selected - * 0b0011110..CMP0_OUT is selected - * 0b0011111..CMP1_OUT is selected - * 0b0100000..Reserved - * 0b0100001..CTimer1_MAT1 input is selected - * 0b0100010..CTimer1_MAT2 input is selected - * 0b0100011..CTimer1_MAT3 input is selected - * 0b0100100..CTimer2_MAT1 input is selected - * 0b0100101..CTimer2_MAT2 input is selected - * 0b0100110..CTimer2_MAT3 input is selected - * 0b0100111..QDC0_CMP_FLAG0 is selected - * 0b0101000..QDC0_CMP_FLAG1 input is selected - * 0b0101001..QDC0_CMP_FLAG2 input is selected - * 0b0101010..QDC0_CMP_FLAG3 input is selected - * 0b0101011..QDC0_POS_MATCH0 input is selected - * 0b0101100..PWM0_SM0_MUX_TRIG0 input is selected - * 0b0101101..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0101110..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0101111..Reserved - * 0b0110000..LPI2C0 Master End of Packet input is selected - * 0b0110001..LPI2C0 Slave End of Packet input is selected - * 0b0110010..LPI2C1 Master End of Packet input is selected - * 0b0110011..LPI2C1 Slave End of Packet input is selected - * 0b0110100..LPSPI0 End of Frame input is selected - * 0b0110101..LPSPI0 Received Data Word input is selected - * 0b0110110..LPSPI1 End of Frame input is selected - * 0b0110111..LPSPI1 Received Data Word input is selected - * 0b0111000..LPUART0 Received Data Word input is selected - * 0b0111001..LPUART0 Transmitted Data Word input is selected - * 0b0111010..LPUART0 Receive Line Idle input is selected - * 0b0111011..LPUART1 Received Data Word input is selected - * 0b0111100..LPUART1 Transmitted Data Word input is selected - * 0b0111101..LPUART1 Receive Line Idle input is selected - * 0b0111110..LPUART2 Received Data Word input is selected - * 0b0111111..LPUART2 Transmitted Data Word input is selected - * 0b1000000..LPUART2 Receive Line Idle input is selected - * 0b1000001..LPUART3 Received Data Word input is selected - * 0b1000010..LPUART3 Transmitted Data Word input is selected - * 0b1000011..LPUART3 Receive Line Idle input is selected - * 0b1000100..LPUART4 Received Data Word input is selected - * 0b1000101..LPUART4 Transmitted Data Word input is selected - * 0b1000110..LPUART4 Receive Line Idle input is selected - * 0b1000111..AOI1_OUT0 input is selected - * 0b1001000..AOI1_OUT1 input is selected - * 0b1001001..AOI1_OUT2 input is selected - * 0b1001010..AOI1_OUT3 input is selected - * 0b1001011..ADC1_tcomp[0] input is selected - * 0b1001100..ADC1_tcomp[1] input is selected - * 0b1001101..ADC1_tcomp[2] input is selected - * 0b1001110..ADC1_tcomp[3] input is selected - * 0b1001111..CTimer3_MAT1 input is selected - * 0b1010000..CTimer3_MAT2 input is selected - * 0b1010001..CTimer3_MAT3 input is selected - * 0b1010010..CTimer4_MAT1 input is selected - * 0b1010011..CTimer4_MAT2 input is selected - * 0b1010100..CTimer4_MAT3 input is selected - * 0b1010101..QDC1_CMP_FLAG0 input is selected - * 0b1010110..QDC1_CMP_FLAG1 input is selected - * 0b1010111..QDC1_CMP_FLAG2 input is selected - * 0b1011000..QDC1_CMP_FLAG3 input is selected - * 0b1011001..QDC1_POS_MATCH0 input is selected - * 0b1011010..PWM1_SM0_MUX_TRIG0 input is selected - * 0b1011011..PWM1_SM1_MUX_TRIG0 input is selected - * 0b1011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b1011101..Reserved - * 0b1011110..LPI2C2 Master End of Packet input is selected - * 0b1011111..LPI2C2 Slave End of Packet input is selected - * 0b1100000..LPI2C3 Master End of Packet input is selected - * 0b1100001..LPI2C3 Slave End of Packet input is selected - * *.. - */ -#define INPUTMUX_TIMER0TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_TIMER0TRIG_INP_SHIFT)) & INPUTMUX_TIMER0TRIG_INP_MASK) -/*! @} */ - -/*! @name CTIMERB_CTIMER1CAP - Capture select register for CTIMER inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMERB_CTIMER1CAP_INP_MASK (0x7FU) -#define INPUTMUX_CTIMERB_CTIMER1CAP_INP_SHIFT (0U) -/*! INP - Input number for CTIMER1 - * 0b0000000..Reserved - * 0b0000001..CT_IPN0 input is selected - * 0b0000010..CT_IPN1 input is selected - * 0b0000011..CT_IPN2 input is selected - * 0b0000100..CT_IPN3 input is selected - * 0b0000101..CT_IPN4 input is selected - * 0b0000110..CT_IPN5 input is selected - * 0b0000111..CT_IPN6 input is selected - * 0b0001000..CT_IPN7 input is selected - * 0b0001001..CT_IPN8 input is selected - * 0b0001010..CT_IPN9 input is selected - * 0b0001011..CT_IPN10 input is selected - * 0b0001100..CT_IPN11 input is selected - * 0b0001101..CT_IPN12 input is selected - * 0b0001110..CT_IPN13 input is selected - * 0b0001111..CT_IPN14 input is selected - * 0b0010000..CT_IPN15 input is selected - * 0b0010001..CT_IPN16 input is selected - * 0b0010010..CT_IPN17 input is selected - * 0b0010011..CT_IPN18 input is selected - * 0b0010100..CT_IPN19 input is selected - * 0b0010101..USB0 usb0 start of frame input is selected - * 0b0010110..AOI0_OUT0 input is selected - * 0b0010111..AOI0_OUT1 input is selected - * 0b0011000..AOI0_OUT2 input is selected - * 0b0011001..AOI0_OUT3 input is selected - * 0b0011010..ADC0_tcomp[0] - * 0b0011011..ADC0_tcomp[1] - * 0b0011100..ADC0_tcomp[2] - * 0b0011101..ADC0_tcomp[3] input is selected - * 0b0011110..CMP0_OUT is selected - * 0b0011111..CMP1_OUT is selected - * 0b0100000..Reserved - * 0b0100001..CTimer0_MAT1 input is selected - * 0b0100010..CTimer0_MAT2 input is selected - * 0b0100011..CTimer0_MAT3 input is selected - * 0b0100100..CTimer2_MAT1 input is selected - * 0b0100101..CTimer2_MAT2 input is selected - * 0b0100110..CTimer2_MAT3 input is selected - * 0b0100111..QDC0_CMP_FLAG0 is selected - * 0b0101000..QDC0_CMP_FLAG1 input is selected - * 0b0101001..QDC0_CMP_FLAG2 input is selected - * 0b0101010..QDC0_CMP_FLAG3 input is selected - * 0b0101011..QDC0_POS_MATCH0 input is selected - * 0b0101100..PWM0_SM0_MUX_TRIG0 input is selected - * 0b0101101..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0101110..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0101111..Reserved - * 0b0110000..LPI2C0 Master End of Packet input is selected - * 0b0110001..LPI2C0 Slave End of Packet input is selected - * 0b0110010..LPI2C1 Master End of Packet input is selected - * 0b0110011..LPI2C1 Slave End of Packet input is selected - * 0b0110100..LPSPI0 End of Frame input is selected - * 0b0110101..LPSPI0 Received Data Word input is selected - * 0b0110110..LPSPI1 End of Frame input is selected - * 0b0110111..LPSPI1 Received Data Word input is selected - * 0b0111000..LPUART0 Received Data Word input is selected - * 0b0111001..LPUART0 Transmitted Data Word input is selected - * 0b0111010..LPUART0 Receive Line Idle input is selected - * 0b0111011..LPUART1 Received Data Word input is selected - * 0b0111100..LPUART1 Transmitted Data Word input is selected - * 0b0111101..LPUART1 Receive Line Idle input is selected - * 0b0111110..LPUART2 Received Data Word input is selected - * 0b0111111..LPUART2 Transmitted Data Word input is selected - * 0b1000000..LPUART2 Receive Line Idle input is selected - * 0b1000001..LPUART3 Received Data Word input is selected - * 0b1000010..LPUART3 Transmitted Data Word input is selected - * 0b1000011..LPUART3 Receive Line Idle input is selected - * 0b1000100..LPUART4 Received Data Word input is selected - * 0b1000101..LPUART4 Transmitted Data Word input is selected - * 0b1000110..LPUART4 Receive Line Idle input is selected - * 0b1000111..AOI1_OUT0 input is selected - * 0b1001000..AOI1_OUT1 input is selected - * 0b1001001..AOI1_OUT2 input is selected - * 0b1001010..AOI1_OUT3 input is selected - * 0b1001011..ADC1_tcomp[0] input is selected - * 0b1001100..ADC1_tcomp[1] input is selected - * 0b1001101..ADC1_tcomp[2] input is selected - * 0b1001110..ADC1_tcomp[3] input is selected - * 0b1001111..CTimer3_MAT1 input is selected - * 0b1010000..CTimer3_MAT2 input is selected - * 0b1010001..CTimer3_MAT3 input is selected - * 0b1010010..CTimer4_MAT1 input is selected - * 0b1010011..CTimer4_MAT2 input is selected - * 0b1010100..CTimer4_MAT3 input is selected - * 0b1010101..QDC1_CMP_FLAG0 input is selected - * 0b1010110..QDC1_CMP_FLAG1 input is selected - * 0b1010111..QDC1_CMP_FLAG2 input is selected - * 0b1011000..QDC1_CMP_FLAG3 input is selected - * 0b1011001..QDC1_POS_MATCH0 input is selected - * 0b1011010..PWM1_SM0_MUX_TRIG0 input is selected - * 0b1011011..PWM1_SM1_MUX_TRIG0 input is selected - * 0b1011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b1011101..Reserved - * 0b1011110..LPI2C2 Master End of Packet input is selected - * 0b1011111..LPI2C2 Slave End of Packet input is selected - * 0b1100000..LPI2C3 Master End of Packet input is selected - * 0b1100001..LPI2C3 Slave End of Packet input is selected - * *.. - */ -#define INPUTMUX_CTIMERB_CTIMER1CAP_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMERB_CTIMER1CAP_INP_SHIFT)) & INPUTMUX_CTIMERB_CTIMER1CAP_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_CTIMERB_CTIMER1CAP */ -#define INPUTMUX_CTIMERB_CTIMER1CAP_COUNT (4U) - -/*! @name TIMER1TRIG - Trigger register for TIMER1 */ -/*! @{ */ - -#define INPUTMUX_TIMER1TRIG_INP_MASK (0x7FU) -#define INPUTMUX_TIMER1TRIG_INP_SHIFT (0U) -/*! INP - Input number for CTIMER1 - * 0b0000000..Reserved - * 0b0000001..CT_IPN0 input is selected - * 0b0000010..CT_IPN1 input is selected - * 0b0000011..CT_IPN2 input is selected - * 0b0000100..CT_IPN3 input is selected - * 0b0000101..CT_IPN4 input is selected - * 0b0000110..CT_IPN5 input is selected - * 0b0000111..CT_IPN6 input is selected - * 0b0001000..CT_IPN7 input is selected - * 0b0001001..CT_IPN8 input is selected - * 0b0001010..CT_IPN9 input is selected - * 0b0001011..CT_IPN10 input is selected - * 0b0001100..CT_IPN11 input is selected - * 0b0001101..CT_IPN12 input is selected - * 0b0001110..CT_IPN13 input is selected - * 0b0001111..CT_IPN14 input is selected - * 0b0010000..CT_IPN15 input is selected - * 0b0010001..CT_IPN16 input is selected - * 0b0010010..CT_IPN17 input is selected - * 0b0010011..CT_IPN18 input is selected - * 0b0010100..CT_IPN19 input is selected - * 0b0010101..USB0 usb0 start of frame input is selected - * 0b0010110..AOI0_OUT0 input is selected - * 0b0010111..AOI0_OUT1 input is selected - * 0b0011000..AOI0_OUT2 input is selected - * 0b0011001..AOI0_OUT3 input is selected - * 0b0011010..ADC0_tcomp[0] - * 0b0011011..ADC0_tcomp[1] - * 0b0011100..ADC0_tcomp[2] - * 0b0011101..ADC0_tcomp[3] input is selected - * 0b0011110..CMP0_OUT is selected - * 0b0011111..CMP1_OUT is selected - * 0b0100000..Reserved - * 0b0100001..CTimer0_MAT1 input is selected - * 0b0100010..CTimer0_MAT2 input is selected - * 0b0100011..CTimer0_MAT3 input is selected - * 0b0100100..CTimer2_MAT1 input is selected - * 0b0100101..CTimer2_MAT2 input is selected - * 0b0100110..CTimer2_MAT3 input is selected - * 0b0100111..QDC0_CMP_FLAG0 is selected - * 0b0101000..QDC0_CMP_FLAG1 input is selected - * 0b0101001..QDC0_CMP_FLAG2 input is selected - * 0b0101010..QDC0_CMP_FLAG3 input is selected - * 0b0101011..QDC0_POS_MATCH0 input is selected - * 0b0101100..PWM0_SM0_MUX_TRIG0 input is selected - * 0b0101101..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0101110..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0101111..Reserved - * 0b0110000..LPI2C0 Master End of Packet input is selected - * 0b0110001..LPI2C0 Slave End of Packet input is selected - * 0b0110010..LPI2C1 Master End of Packet input is selected - * 0b0110011..LPI2C1 Slave End of Packet input is selected - * 0b0110100..LPSPI0 End of Frame input is selected - * 0b0110101..LPSPI0 Received Data Word input is selected - * 0b0110110..LPSPI1 End of Frame input is selected - * 0b0110111..LPSPI1 Received Data Word input is selected - * 0b0111000..LPUART0 Received Data Word input is selected - * 0b0111001..LPUART0 Transmitted Data Word input is selected - * 0b0111010..LPUART0 Receive Line Idle input is selected - * 0b0111011..LPUART1 Received Data Word input is selected - * 0b0111100..LPUART1 Transmitted Data Word input is selected - * 0b0111101..LPUART1 Receive Line Idle input is selected - * 0b0111110..LPUART2 Received Data Word input is selected - * 0b0111111..LPUART2 Transmitted Data Word input is selected - * 0b1000000..LPUART2 Receive Line Idle input is selected - * 0b1000001..LPUART3 Received Data Word input is selected - * 0b1000010..LPUART3 Transmitted Data Word input is selected - * 0b1000011..LPUART3 Receive Line Idle input is selected - * 0b1000100..LPUART4 Received Data Word input is selected - * 0b1000101..LPUART4 Transmitted Data Word input is selected - * 0b1000110..LPUART4 Receive Line Idle input is selected - * 0b1000111..AOI1_OUT0 input is selected - * 0b1001000..AOI1_OUT1 input is selected - * 0b1001001..AOI1_OUT2 input is selected - * 0b1001010..AOI1_OUT3 input is selected - * 0b1001011..ADC1_tcomp[0] input is selected - * 0b1001100..ADC1_tcomp[1] input is selected - * 0b1001101..ADC1_tcomp[2] input is selected - * 0b1001110..ADC1_tcomp[3] input is selected - * 0b1001111..CTimer3_MAT1 input is selected - * 0b1010000..CTimer3_MAT2 input is selected - * 0b1010001..CTimer3_MAT3 input is selected - * 0b1010010..CTimer4_MAT1 input is selected - * 0b1010011..CTimer4_MAT2 input is selected - * 0b1010100..CTimer4_MAT3 input is selected - * 0b1010101..QDC1_CMP_FLAG0 input is selected - * 0b1010110..QDC1_CMP_FLAG1 input is selected - * 0b1010111..QDC1_CMP_FLAG2 input is selected - * 0b1011000..QDC1_CMP_FLAG3 input is selected - * 0b1011001..QDC1_POS_MATCH0 input is selected - * 0b1011010..PWM1_SM0_MUX_TRIG0 input is selected - * 0b1011011..PWM1_SM1_MUX_TRIG0 input is selected - * 0b1011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b1011101..Reserved - * 0b1011110..LPI2C2 Master End of Packet input is selected - * 0b1011111..LPI2C2 Slave End of Packet input is selected - * 0b1100000..LPI2C3 Master End of Packet input is selected - * 0b1100001..LPI2C3 Slave End of Packet input is selected - * *.. - */ -#define INPUTMUX_TIMER1TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_TIMER1TRIG_INP_SHIFT)) & INPUTMUX_TIMER1TRIG_INP_MASK) -/*! @} */ - -/*! @name CTIMERC_CTIMER2CAP - Capture select register for CTIMER inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMERC_CTIMER2CAP_INP_MASK (0x7FU) -#define INPUTMUX_CTIMERC_CTIMER2CAP_INP_SHIFT (0U) -/*! INP - Input number for CTIMER2 - * 0b0000000..Reserved - * 0b0000001..CT_IPN0 input is selected - * 0b0000010..CT_IPN1 input is selected - * 0b0000011..CT_IPN2 input is selected - * 0b0000100..CT_IPN3 input is selected - * 0b0000101..CT_IPN4 input is selected - * 0b0000110..CT_IPN5 input is selected - * 0b0000111..CT_IPN6 input is selected - * 0b0001000..CT_IPN7 input is selected - * 0b0001001..CT_IPN8 input is selected - * 0b0001010..CT_IPN9 input is selected - * 0b0001011..CT_IPN10 input is selected - * 0b0001100..CT_IPN11 input is selected - * 0b0001101..CT_IPN12 input is selected - * 0b0001110..CT_IPN13 input is selected - * 0b0001111..CT_IPN14 input is selected - * 0b0010000..CT_IPN15 input is selected - * 0b0010001..CT_IPN16 input is selected - * 0b0010010..CT_IPN17 input is selected - * 0b0010011..CT_IPN18 input is selected - * 0b0010100..CT_IPN19 input is selected - * 0b0010101..USB0 usb0 start of frame input is selected - * 0b0010110..AOI0_OUT0 input is selected - * 0b0010111..AOI0_OUT1 input is selected - * 0b0011000..AOI0_OUT2 input is selected - * 0b0011001..AOI0_OUT3 input is selected - * 0b0011010..ADC0_tcomp[0] - * 0b0011011..ADC0_tcomp[1] - * 0b0011100..ADC0_tcomp[2] - * 0b0011101..ADC0_tcomp[3] input is selected - * 0b0011110..CMP0_OUT is selected - * 0b0011111..CMP1_OUT is selected - * 0b0100000..Reserved - * 0b0100001..CTimer0_MAT1 input is selected - * 0b0100010..CTimer0_MAT2 input is selected - * 0b0100011..CTimer0_MAT3 input is selected - * 0b0100100..CTimer1_MAT1 input is selected - * 0b0100101..CTimer1_MAT2 input is selected - * 0b0100110..CTimer1_MAT3 input is selected - * 0b0100111..QDC0_CMP_FLAG0 is selected - * 0b0101000..QDC0_CMP_FLAG1 input is selected - * 0b0101001..QDC0_CMP_FLAG2 input is selected - * 0b0101010..QDC0_CMP_FLAG3 input is selected - * 0b0101011..QDC0_POS_MATCH0 input is selected - * 0b0101100..PWM0_SM0_MUX_TRIG0 input is selected - * 0b0101101..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0101110..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0101111..Reserved - * 0b0110000..LPI2C0 Master End of Packet input is selected - * 0b0110001..LPI2C0 Slave End of Packet input is selected - * 0b0110010..LPI2C1 Master End of Packet input is selected - * 0b0110011..LPI2C1 Slave End of Packet input is selected - * 0b0110100..LPSPI0 End of Frame input is selected - * 0b0110101..LPSPI0 Received Data Word input is selected - * 0b0110110..LPSPI1 End of Frame input is selected - * 0b0110111..LPSPI1 Received Data Word input is selected - * 0b0111000..LPUART0 Received Data Word input is selected - * 0b0111001..LPUART0 Transmitted Data Word input is selected - * 0b0111010..LPUART0 Receive Line Idle input is selected - * 0b0111011..LPUART1 Received Data Word input is selected - * 0b0111100..LPUART1 Transmitted Data Word input is selected - * 0b0111101..LPUART1 Receive Line Idle input is selected - * 0b0111110..LPUART2 Received Data Word input is selected - * 0b0111111..LPUART2 Transmitted Data Word input is selected - * 0b1000000..LPUART2 Receive Line Idle input is selected - * 0b1000001..LPUART3 Received Data Word input is selected - * 0b1000010..LPUART3 Transmitted Data Word input is selected - * 0b1000011..LPUART3 Receive Line Idle input is selected - * 0b1000100..LPUART4 Received Data Word input is selected - * 0b1000101..LPUART4 Transmitted Data Word input is selected - * 0b1000110..LPUART4 Receive Line Idle input is selected - * 0b1000111..AOI1_OUT0 input is selected - * 0b1001000..AOI1_OUT1 input is selected - * 0b1001001..AOI1_OUT2 input is selected - * 0b1001010..AOI1_OUT3 input is selected - * 0b1001011..ADC1_tcomp[0] input is selected - * 0b1001100..ADC1_tcomp[1] input is selected - * 0b1001101..ADC1_tcomp[2] input is selected - * 0b1001110..ADC1_tcomp[3] input is selected - * 0b1001111..CTimer3_MAT1 input is selected - * 0b1010000..CTimer3_MAT2 input is selected - * 0b1010001..CTimer3_MAT3 input is selected - * 0b1010010..CTimer4_MAT1 input is selected - * 0b1010011..CTimer4_MAT2 input is selected - * 0b1010100..CTimer4_MAT3 input is selected - * 0b1010101..QDC1_CMP_FLAG0 input is selected - * 0b1010110..QDC1_CMP_FLAG1 input is selected - * 0b1010111..QDC1_CMP_FLAG2 input is selected - * 0b1011000..QDC1_CMP_FLAG3 input is selected - * 0b1011001..QDC1_POS_MATCH0 input is selected - * 0b1011010..PWM1_SM0_MUX_TRIG0 input is selected - * 0b1011011..PWM1_SM1_MUX_TRIG0 input is selected - * 0b1011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b1011101..Reserved - * 0b1011110..LPI2C2 Master End of Packet input is selected - * 0b1011111..LPI2C2 Slave End of Packet input is selected - * 0b1100000..LPI2C3 Master End of Packet input is selected - * 0b1100001..LPI2C3 Slave End of Packet input is selected - * *.. - */ -#define INPUTMUX_CTIMERC_CTIMER2CAP_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMERC_CTIMER2CAP_INP_SHIFT)) & INPUTMUX_CTIMERC_CTIMER2CAP_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_CTIMERC_CTIMER2CAP */ -#define INPUTMUX_CTIMERC_CTIMER2CAP_COUNT (4U) - -/*! @name TIMER2TRIG - Trigger register for TIMER2 inputs */ -/*! @{ */ - -#define INPUTMUX_TIMER2TRIG_INP_MASK (0x7FU) -#define INPUTMUX_TIMER2TRIG_INP_SHIFT (0U) -/*! INP - Input number for CTIMER2 - * 0b0000000..Reserved - * 0b0000001..CT_IPN0 input is selected - * 0b0000010..CT_IPN1 input is selected - * 0b0000011..CT_IPN2 input is selected - * 0b0000100..CT_IPN3 input is selected - * 0b0000101..CT_IPN4 input is selected - * 0b0000110..CT_IPN5 input is selected - * 0b0000111..CT_IPN6 input is selected - * 0b0001000..CT_IPN7 input is selected - * 0b0001001..CT_IPN8 input is selected - * 0b0001010..CT_IPN9 input is selected - * 0b0001011..CT_IPN10 input is selected - * 0b0001100..CT_IPN11 input is selected - * 0b0001101..CT_IPN12 input is selected - * 0b0001110..CT_IPN13 input is selected - * 0b0001111..CT_IPN14 input is selected - * 0b0010000..CT_IPN15 input is selected - * 0b0010001..CT_IPN16 input is selected - * 0b0010010..CT_IPN17 input is selected - * 0b0010011..CT_IPN18 input is selected - * 0b0010100..CT_IPN19 input is selected - * 0b0010101..USB0 usb0 start of frame input is selected - * 0b0010110..AOI0_OUT0 input is selected - * 0b0010111..AOI0_OUT1 input is selected - * 0b0011000..AOI0_OUT2 input is selected - * 0b0011001..AOI0_OUT3 input is selected - * 0b0011010..ADC0_tcomp[0] - * 0b0011011..ADC0_tcomp[1] - * 0b0011100..ADC0_tcomp[2] - * 0b0011101..ADC0_tcomp[3] input is selected - * 0b0011110..CMP0_OUT is selected - * 0b0011111..CMP1_OUT is selected - * 0b0100000..Reserved - * 0b0100001..CTimer0_MAT1 input is selected - * 0b0100010..CTimer0_MAT2 input is selected - * 0b0100011..CTimer0_MAT3 input is selected - * 0b0100100..CTimer1_MAT1 input is selected - * 0b0100101..CTimer1_MAT2 input is selected - * 0b0100110..CTimer1_MAT3 input is selected - * 0b0100111..QDC0_CMP_FLAG0 is selected - * 0b0101000..QDC0_CMP_FLAG1 input is selected - * 0b0101001..QDC0_CMP_FLAG2 input is selected - * 0b0101010..QDC0_CMP_FLAG3 input is selected - * 0b0101011..QDC0_POS_MATCH0 input is selected - * 0b0101100..PWM0_SM0_MUX_TRIG0 input is selected - * 0b0101101..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0101110..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0101111..Reserved - * 0b0110000..LPI2C0 Master End of Packet input is selected - * 0b0110001..LPI2C0 Slave End of Packet input is selected - * 0b0110010..LPI2C1 Master End of Packet input is selected - * 0b0110011..LPI2C1 Slave End of Packet input is selected - * 0b0110100..LPSPI0 End of Frame input is selected - * 0b0110101..LPSPI0 Received Data Word input is selected - * 0b0110110..LPSPI1 End of Frame input is selected - * 0b0110111..LPSPI1 Received Data Word input is selected - * 0b0111000..LPUART0 Received Data Word input is selected - * 0b0111001..LPUART0 Transmitted Data Word input is selected - * 0b0111010..LPUART0 Receive Line Idle input is selected - * 0b0111011..LPUART1 Received Data Word input is selected - * 0b0111100..LPUART1 Transmitted Data Word input is selected - * 0b0111101..LPUART1 Receive Line Idle input is selected - * 0b0111110..LPUART2 Received Data Word input is selected - * 0b0111111..LPUART2 Transmitted Data Word input is selected - * 0b1000000..LPUART2 Receive Line Idle input is selected - * 0b1000001..LPUART3 Received Data Word input is selected - * 0b1000010..LPUART3 Transmitted Data Word input is selected - * 0b1000011..LPUART3 Receive Line Idle input is selected - * 0b1000100..LPUART4 Received Data Word input is selected - * 0b1000101..LPUART4 Transmitted Data Word input is selected - * 0b1000110..LPUART4 Receive Line Idle input is selected - * 0b1000111..AOI1_OUT0 input is selected - * 0b1001000..AOI1_OUT1 input is selected - * 0b1001001..AOI1_OUT2 input is selected - * 0b1001010..AOI1_OUT3 input is selected - * 0b1001011..ADC1_tcomp[0] input is selected - * 0b1001100..ADC1_tcomp[1] input is selected - * 0b1001101..ADC1_tcomp[2] input is selected - * 0b1001110..ADC1_tcomp[3] input is selected - * 0b1001111..CTimer3_MAT1 input is selected - * 0b1010000..CTimer3_MAT2 input is selected - * 0b1010001..CTimer3_MAT3 input is selected - * 0b1010010..CTimer4_MAT1 input is selected - * 0b1010011..CTimer4_MAT2 input is selected - * 0b1010100..CTimer4_MAT3 input is selected - * 0b1010101..QDC1_CMP_FLAG0 input is selected - * 0b1010110..QDC1_CMP_FLAG1 input is selected - * 0b1010111..QDC1_CMP_FLAG2 input is selected - * 0b1011000..QDC1_CMP_FLAG3 input is selected - * 0b1011001..QDC1_POS_MATCH0 input is selected - * 0b1011010..PWM1_SM0_MUX_TRIG0 input is selected - * 0b1011011..PWM1_SM1_MUX_TRIG0 input is selected - * 0b1011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b1011101..Reserved - * 0b1011110..LPI2C2 Master End of Packet input is selected - * 0b1011111..LPI2C2 Slave End of Packet input is selected - * 0b1100000..LPI2C3 Master End of Packet input is selected - * 0b1100001..LPI2C3 Slave End of Packet input is selected - * *.. - */ -#define INPUTMUX_TIMER2TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_TIMER2TRIG_INP_SHIFT)) & INPUTMUX_TIMER2TRIG_INP_MASK) -/*! @} */ - -/*! @name FREQMEAS_REF - Selection for frequency measurement reference clock */ -/*! @{ */ - -#define INPUTMUX_FREQMEAS_REF_INP_MASK (0x7FU) -#define INPUTMUX_FREQMEAS_REF_INP_SHIFT (0U) -/*! INP - Clock source number (binary value) for frequency measure function target clock. - * 0b0000000..Reserved - * 0b0000001..clk_in input is selected - * 0b0000010..FRO_OSC_12M input is selected - * 0b0000011..fro_hf_div input is selected - * 0b0000100..Reserved - * 0b0000101..clk_16k[1] input is selected - * 0b0000110..SLOW_CLK input is selected - * 0b0000111..FREQME_CLK_IN0 input is selected - * 0b0001000..FREQME_CLK_IN1 input is selected input is selected - * 0b0001001..AOI0_OUT0 input is selected - * 0b0001010..AOI0_OUT1 - * 0b0001011..PWM0_SM0_MUX_TRIG0 - * 0b0001100..PWM0_SM0_MUX_TRIG1 - * 0b0001101..PWM0_SM1_MUX_TRIG0 - * 0b0001110..PWM0_SM1_MUX_TRIG1 - * 0b0001111..PWM0_SM2_MUX_TRIG0 - * 0b0010000..PWM0_SM2_MUX_TRIG1 - * 0b0010001..Reserved - * 0b0010010..Reserved - * 0b0010011..Reserved - * 0b0010100..Reserved - * 0b0010101..Reserved - * 0b0010110..Reserved - * 0b0010111..Reserved - * 0b0011000..Reserved - * 0b0011001..Reserved - * 0b0011010..Reserved - * 0b0011011..Reserved - * 0b0011100..Reserved - * 0b0011101..Reserved - * 0b0011110..Reserved - * 0b0011111..Reserved - * 0b0100000..AOI1_OUT0 input is selected - * 0b0100001..AOI1_OUT1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0 input is selected - * 0b0100011..PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM1_MUX_TRIG0 input is selected - * 0b0100101..PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100110..PWM1_SM2_MUX_TRIG0 input is selected - * 0b0100111..PWM1_SM2_MUX_TRIG1 input is selected - * 0b0101000..Reserved - * 0b0101001..Reserved - * *.. - */ -#define INPUTMUX_FREQMEAS_REF_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FREQMEAS_REF_INP_SHIFT)) & INPUTMUX_FREQMEAS_REF_INP_MASK) -/*! @} */ - -/*! @name FREQMEAS_TAR - Selection for frequency measurement reference clock */ -/*! @{ */ - -#define INPUTMUX_FREQMEAS_TAR_INP_MASK (0x7FU) -#define INPUTMUX_FREQMEAS_TAR_INP_SHIFT (0U) -/*! INP - Clock source number (binary value) for frequency measure function target clock. - * 0b0000000..Reserved - * 0b0000001..clk_in input is selected - * 0b0000010..FRO_OSC_12M input is selected - * 0b0000011..fro_hf_div input is selected - * 0b0000100..Reserved - * 0b0000101..clk_16k[1] input is selected - * 0b0000110..SLOW_CLK input is selected - * 0b0000111..FREQME_CLK_IN0 input is selected - * 0b0001000..FREQME_CLK_IN1 input is selected input is selected - * 0b0001001..AOI0_OUT0 input is selected - * 0b0001010..AOI0_OUT1 - * 0b0001011..PWM0_SM0_MUX_TRIG0 - * 0b0001100..PWM0_SM0_MUX_TRIG1 - * 0b0001101..PWM0_SM1_MUX_TRIG0 - * 0b0001110..PWM0_SM1_MUX_TRIG1 - * 0b0001111..PWM0_SM2_MUX_TRIG0 - * 0b0010000..PWM0_SM2_MUX_TRIG1 - * 0b0010001..Reserved - * 0b0010010..Reserved - * 0b0010011..Reserved - * 0b0010100..Reserved - * 0b0010101..Reserved - * 0b0010110..Reserved - * 0b0010111..Reserved - * 0b0011000..Reserved - * 0b0011001..Reserved - * 0b0011010..Reserved - * 0b0011011..Reserved - * 0b0011100..Reserved - * 0b0011101..Reserved - * 0b0011110..Reserved - * 0b0011111..Reserved - * 0b0100000..AOI1_OUT0 input is selected - * 0b0100001..AOI1_OUT1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0 input is selected - * 0b0100011..PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM1_MUX_TRIG0 input is selected - * 0b0100101..PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100110..PWM1_SM2_MUX_TRIG0 input is selected - * 0b0100111..PWM1_SM2_MUX_TRIG1 input is selected - * 0b0101000..Reserved - * 0b0101001..Reserved - * *.. - */ -#define INPUTMUX_FREQMEAS_TAR_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FREQMEAS_TAR_INP_SHIFT)) & INPUTMUX_FREQMEAS_TAR_INP_MASK) -/*! @} */ - -/*! @name CTIMERD_CTIMER3CAP - Capture select register for CTIMER inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMERD_CTIMER3CAP_INP_MASK (0x7FU) -#define INPUTMUX_CTIMERD_CTIMER3CAP_INP_SHIFT (0U) -/*! INP - Input number for CTIMER3 - * 0b0000000..Reserved - * 0b0000001..CT_IPN0 input is selected - * 0b0000010..CT_IPN1 input is selected - * 0b0000011..CT_IPN2 input is selected - * 0b0000100..CT_IPN3 input is selected - * 0b0000101..CT_IPN4 input is selected - * 0b0000110..CT_IPN5 input is selected - * 0b0000111..CT_IPN6 input is selected - * 0b0001000..CT_IPN7 input is selected - * 0b0001001..CT_IPN8 input is selected - * 0b0001010..CT_IPN9 input is selected - * 0b0001011..CT_IPN10 input is selected - * 0b0001100..CT_IPN11 input is selected - * 0b0001101..CT_IPN12 input is selected - * 0b0001110..CT_IPN13 input is selected - * 0b0001111..CT_IPN14 input is selected - * 0b0010000..CT_IPN15 input is selected - * 0b0010001..CT_IPN16 input is selected - * 0b0010010..CT_IPN17 input is selected - * 0b0010011..CT_IPN18 input is selected - * 0b0010100..CT_IPN19 input is selected - * 0b0010101..USB0 usb0 start of frame input is selected - * 0b0010110..AOI0_OUT0 input is selected - * 0b0010111..AOI0_OUT1 input is selected - * 0b0011000..AOI0_OUT2 input is selected - * 0b0011001..AOI0_OUT3 input is selected - * 0b0011010..ADC0_tcomp[0] - * 0b0011011..ADC0_tcomp[1] - * 0b0011100..ADC0_tcomp[2] - * 0b0011101..ADC0_tcomp[3] input is selected - * 0b0011110..CMP0_OUT is selected - * 0b0011111..CMP1_OUT is selected - * 0b0100000..Reserved - * 0b0100001..CTimer0_MAT1 input is selected - * 0b0100010..CTimer0_MAT2 input is selected - * 0b0100011..CTimer0_MAT3 input is selected - * 0b0100100..CTimer1_MAT1 input is selected - * 0b0100101..CTimer1_MAT2 input is selected - * 0b0100110..CTimer1_MAT3 input is selected - * 0b0100111..QDC0_CMP_FLAG0 is selected - * 0b0101000..QDC0_CMP_FLAG1 input is selected - * 0b0101001..QDC0_CMP_FLAG2 input is selected - * 0b0101010..QDC0_CMP_FLAG3 input is selected - * 0b0101011..QDC0_POS_MATCH0 input is selected - * 0b0101100..PWM0_SM0_MUX_TRIG0 input is selected - * 0b0101101..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0101110..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0101111..Reserved - * 0b0110000..LPI2C0 Master End of Packet input is selected - * 0b0110001..LPI2C0 Slave End of Packet input is selected - * 0b0110010..LPI2C1 Master End of Packet input is selected - * 0b0110011..LPI2C1 Slave End of Packet input is selected - * 0b0110100..LPSPI0 End of Frame input is selected - * 0b0110101..LPSPI0 Received Data Word input is selected - * 0b0110110..LPSPI1 End of Frame input is selected - * 0b0110111..LPSPI1 Received Data Word input is selected - * 0b0111000..LPUART0 Received Data Word input is selected - * 0b0111001..LPUART0 Transmitted Data Word input is selected - * 0b0111010..LPUART0 Receive Line Idle input is selected - * 0b0111011..LPUART1 Received Data Word input is selected - * 0b0111100..LPUART1 Transmitted Data Word input is selected - * 0b0111101..LPUART1 Receive Line Idle input is selected - * 0b0111110..LPUART2 Received Data Word input is selected - * 0b0111111..LPUART2 Transmitted Data Word input is selected - * 0b1000000..LPUART2 Receive Line Idle input is selected - * 0b1000001..LPUART3 Received Data Word input is selected - * 0b1000010..LPUART3 Transmitted Data Word input is selected - * 0b1000011..LPUART3 Receive Line Idle input is selected - * 0b1000100..LPUART4 Received Data Word input is selected - * 0b1000101..LPUART4 Transmitted Data Word input is selected - * 0b1000110..LPUART4 Receive Line Idle input is selected - * 0b1000111..AOI1_OUT0 input is selected - * 0b1001000..AOI1_OUT1 input is selected - * 0b1001001..AOI1_OUT2 input is selected - * 0b1001010..AOI1_OUT3 input is selected - * 0b1001011..ADC1_tcomp[0] input is selected - * 0b1001100..ADC1_tcomp[1] input is selected - * 0b1001101..ADC1_tcomp[2] input is selected - * 0b1001110..ADC1_tcomp[3] input is selected - * 0b1001111..CTimer2_MAT1 input is selected - * 0b1010000..CTimer2_MAT2 input is selected - * 0b1010001..CTimer2_MAT3 input is selected - * 0b1010010..CTimer4_MAT1 input is selected - * 0b1010011..CTimer4_MAT2 input is selected - * 0b1010100..CTimer4_MAT3 input is selected - * 0b1010101..QDC1_CMP_FLAG0 input is selected - * 0b1010110..QDC1_CMP_FLAG1 input is selected - * 0b1010111..QDC1_CMP_FLAG2 input is selected - * 0b1011000..QDC1_CMP_FLAG3 input is selected - * 0b1011001..QDC1_POS_MATCH0 input is selected - * 0b1011010..PWM1_SM0_MUX_TRIG0 input is selected - * 0b1011011..PWM1_SM1_MUX_TRIG0 input is selected - * 0b1011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b1011101..Reserved - * 0b1011110..LPI2C2 Master End of Packet input is selected - * 0b1011111..LPI2C2 Slave End of Packet input is selected - * 0b1100000..LPI2C3 Master End of Packet input is selected - * 0b1100001..LPI2C3 Slave End of Packet input is selected - * *.. - */ -#define INPUTMUX_CTIMERD_CTIMER3CAP_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMERD_CTIMER3CAP_INP_SHIFT)) & INPUTMUX_CTIMERD_CTIMER3CAP_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_CTIMERD_CTIMER3CAP */ -#define INPUTMUX_CTIMERD_CTIMER3CAP_COUNT (4U) - -/*! @name TIMER3TRIG - Trigger register for TIMER3 */ -/*! @{ */ - -#define INPUTMUX_TIMER3TRIG_INP_MASK (0x7FU) -#define INPUTMUX_TIMER3TRIG_INP_SHIFT (0U) -/*! INP - Input number for CTIMER3 - * 0b0000000..Reserved - * 0b0000001..CT_IPN0 input is selected - * 0b0000010..CT_IPN1 input is selected - * 0b0000011..CT_IPN2 input is selected - * 0b0000100..CT_IPN3 input is selected - * 0b0000101..CT_IPN4 input is selected - * 0b0000110..CT_IPN5 input is selected - * 0b0000111..CT_IPN6 input is selected - * 0b0001000..CT_IPN7 input is selected - * 0b0001001..CT_IPN8 input is selected - * 0b0001010..CT_IPN9 input is selected - * 0b0001011..CT_IPN10 input is selected - * 0b0001100..CT_IPN11 input is selected - * 0b0001101..CT_IPN12 input is selected - * 0b0001110..CT_IPN13 input is selected - * 0b0001111..CT_IPN14 input is selected - * 0b0010000..CT_IPN15 input is selected - * 0b0010001..CT_IPN16 input is selected - * 0b0010010..CT_IPN17 input is selected - * 0b0010011..CT_IPN18 input is selected - * 0b0010100..CT_IPN19 input is selected - * 0b0010101..USB0 usb0 start of frame input is selected - * 0b0010110..AOI0_OUT0 input is selected - * 0b0010111..AOI0_OUT1 input is selected - * 0b0011000..AOI0_OUT2 input is selected - * 0b0011001..AOI0_OUT3 input is selected - * 0b0011010..ADC0_tcomp[0] - * 0b0011011..ADC0_tcomp[1] - * 0b0011100..ADC0_tcomp[2] - * 0b0011101..ADC0_tcomp[3] input is selected - * 0b0011110..CMP0_OUT is selected - * 0b0011111..CMP1_OUT is selected - * 0b0100000..Reserved - * 0b0100001..CTimer0_MAT1 input is selected - * 0b0100010..CTimer0_MAT2 input is selected - * 0b0100011..CTimer0_MAT3 input is selected - * 0b0100100..CTimer1_MAT1 input is selected - * 0b0100101..CTimer1_MAT2 input is selected - * 0b0100110..CTimer1_MAT3 input is selected - * 0b0100111..QDC0_CMP_FLAG0 is selected - * 0b0101000..QDC0_CMP_FLAG1 input is selected - * 0b0101001..QDC0_CMP_FLAG2 input is selected - * 0b0101010..QDC0_CMP_FLAG3 input is selected - * 0b0101011..QDC0_POS_MATCH0 input is selected - * 0b0101100..PWM0_SM0_MUX_TRIG0 input is selected - * 0b0101101..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0101110..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0101111..Reserved - * 0b0110000..LPI2C0 Master End of Packet input is selected - * 0b0110001..LPI2C0 Slave End of Packet input is selected - * 0b0110010..LPI2C1 Master End of Packet input is selected - * 0b0110011..LPI2C1 Slave End of Packet input is selected - * 0b0110100..LPSPI0 End of Frame input is selected - * 0b0110101..LPSPI0 Received Data Word input is selected - * 0b0110110..LPSPI1 End of Frame input is selected - * 0b0110111..LPSPI1 Received Data Word input is selected - * 0b0111000..LPUART0 Received Data Word input is selected - * 0b0111001..LPUART0 Transmitted Data Word input is selected - * 0b0111010..LPUART0 Receive Line Idle input is selected - * 0b0111011..LPUART1 Received Data Word input is selected - * 0b0111100..LPUART1 Transmitted Data Word input is selected - * 0b0111101..LPUART1 Receive Line Idle input is selected - * 0b0111110..LPUART2 Received Data Word input is selected - * 0b0111111..LPUART2 Transmitted Data Word input is selected - * 0b1000000..LPUART2 Receive Line Idle input is selected - * 0b1000001..LPUART3 Received Data Word input is selected - * 0b1000010..LPUART3 Transmitted Data Word input is selected - * 0b1000011..LPUART3 Receive Line Idle input is selected - * 0b1000100..LPUART4 Received Data Word input is selected - * 0b1000101..LPUART4 Transmitted Data Word input is selected - * 0b1000110..LPUART4 Receive Line Idle input is selected - * 0b1000111..AOI1_OUT0 input is selected - * 0b1001000..AOI1_OUT1 input is selected - * 0b1001001..AOI1_OUT2 input is selected - * 0b1001010..AOI1_OUT3 input is selected - * 0b1001011..ADC1_tcomp[0] input is selected - * 0b1001100..ADC1_tcomp[1] input is selected - * 0b1001101..ADC1_tcomp[2] input is selected - * 0b1001110..ADC1_tcomp[3] input is selected - * 0b1001111..CTimer2_MAT1 input is selected - * 0b1010000..CTimer2_MAT2 input is selected - * 0b1010001..CTimer2_MAT3 input is selected - * 0b1010010..CTimer4_MAT1 input is selected - * 0b1010011..CTimer4_MAT2 input is selected - * 0b1010100..CTimer4_MAT3 input is selected - * 0b1010101..QDC1_CMP_FLAG0 input is selected - * 0b1010110..QDC1_CMP_FLAG1 input is selected - * 0b1010111..QDC1_CMP_FLAG2 input is selected - * 0b1011000..QDC1_CMP_FLAG3 input is selected - * 0b1011001..QDC1_POS_MATCH0 input is selected - * 0b1011010..PWM1_SM0_MUX_TRIG0 input is selected - * 0b1011011..PWM1_SM1_MUX_TRIG0 input is selected - * 0b1011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b1011101..Reserved - * 0b1011110..LPI2C2 Master End of Packet input is selected - * 0b1011111..LPI2C2 Slave End of Packet input is selected - * 0b1100000..LPI2C3 Master End of Packet input is selected - * 0b1100001..LPI2C3 Slave End of Packet input is selected - * *.. - */ -#define INPUTMUX_TIMER3TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_TIMER3TRIG_INP_SHIFT)) & INPUTMUX_TIMER3TRIG_INP_MASK) -/*! @} */ - -/*! @name CTIMERE_CTIMER4CAP - Capture select register for CTIMER inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMERE_CTIMER4CAP_INP_MASK (0x7FU) -#define INPUTMUX_CTIMERE_CTIMER4CAP_INP_SHIFT (0U) -/*! INP - Input number for CTIMER4 - * 0b0000000..Reserved - * 0b0000001..CT_IPN0 input is selected - * 0b0000010..CT_IPN1 input is selected - * 0b0000011..CT_IPN2 input is selected - * 0b0000100..CT_IPN3 input is selected - * 0b0000101..CT_IPN4 input is selected - * 0b0000110..CT_IPN5 input is selected - * 0b0000111..CT_IPN6 input is selected - * 0b0001000..CT_IPN7 input is selected - * 0b0001001..CT_IPN8 input is selected - * 0b0001010..CT_IPN9 input is selected - * 0b0001011..CT_IPN10 input is selected - * 0b0001100..CT_IPN11 input is selected - * 0b0001101..CT_IPN12 input is selected - * 0b0001110..CT_IPN13 input is selected - * 0b0001111..CT_IPN14 input is selected - * 0b0010000..CT_IPN15 input is selected - * 0b0010001..CT_IPN16 input is selected - * 0b0010010..CT_IPN17 input is selected - * 0b0010011..CT_IPN18 input is selected - * 0b0010100..CT_IPN19 input is selected - * 0b0010101..USB0 usb0 start of frame input is selected - * 0b0010110..AOI0_OUT0 input is selected - * 0b0010111..AOI0_OUT1 input is selected - * 0b0011000..AOI0_OUT2 input is selected - * 0b0011001..AOI0_OUT3 input is selected - * 0b0011010..ADC0_tcomp[0] - * 0b0011011..ADC0_tcomp[1] - * 0b0011100..ADC0_tcomp[2] - * 0b0011101..ADC0_tcomp[3] input is selected - * 0b0011110..CMP0_OUT is selected - * 0b0011111..CMP1_OUT is selected - * 0b0100000..Reserved - * 0b0100001..CTimer0_MAT1 input is selected - * 0b0100010..CTimer0_MAT2 input is selected - * 0b0100011..CTimer0_MAT3 input is selected - * 0b0100100..CTimer1_MAT1 input is selected - * 0b0100101..CTimer1_MAT2 input is selected - * 0b0100110..CTimer1_MAT3 input is selected - * 0b0100111..QDC0_CMP_FLAG0 is selected - * 0b0101000..QDC0_CMP_FLAG1 input is selected - * 0b0101001..QDC0_CMP_FLAG2 input is selected - * 0b0101010..QDC0_CMP_FLAG3 input is selected - * 0b0101011..QDC0_POS_MATCH0 input is selected - * 0b0101100..PWM0_SM0_MUX_TRIG0 input is selected - * 0b0101101..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0101110..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0101111..Reserved - * 0b0110000..LPI2C0 Master End of Packet input is selected - * 0b0110001..LPI2C0 Slave End of Packet input is selected - * 0b0110010..LPI2C1 Master End of Packet input is selected - * 0b0110011..LPI2C1 Slave End of Packet input is selected - * 0b0110100..LPSPI0 End of Frame input is selected - * 0b0110101..LPSPI0 Received Data Word input is selected - * 0b0110110..LPSPI1 End of Frame input is selected - * 0b0110111..LPSPI1 Received Data Word input is selected - * 0b0111000..LPUART0 Received Data Word input is selected - * 0b0111001..LPUART0 Transmitted Data Word input is selected - * 0b0111010..LPUART0 Receive Line Idle input is selected - * 0b0111011..LPUART1 Received Data Word input is selected - * 0b0111100..LPUART1 Transmitted Data Word input is selected - * 0b0111101..LPUART1 Receive Line Idle input is selected - * 0b0111110..LPUART2 Received Data Word input is selected - * 0b0111111..LPUART2 Transmitted Data Word input is selected - * 0b1000000..LPUART2 Receive Line Idle input is selected - * 0b1000001..LPUART3 Received Data Word input is selected - * 0b1000010..LPUART3 Transmitted Data Word input is selected - * 0b1000011..LPUART3 Receive Line Idle input is selected - * 0b1000100..LPUART4 Received Data Word input is selected - * 0b1000101..LPUART4 Transmitted Data Word input is selected - * 0b1000110..LPUART4 Receive Line Idle input is selected - * 0b1000111..AOI1_OUT0 input is selected - * 0b1001000..AOI1_OUT1 input is selected - * 0b1001001..AOI1_OUT2 input is selected - * 0b1001010..AOI1_OUT3 input is selected - * 0b1001011..ADC1_tcomp[0] input is selected - * 0b1001100..ADC1_tcomp[1] input is selected - * 0b1001101..ADC1_tcomp[2] input is selected - * 0b1001110..ADC1_tcomp[3] input is selected - * 0b1001111..CTimer2_MAT1 input is selected - * 0b1010000..CTimer2_MAT2 input is selected - * 0b1010001..CTimer2_MAT3 input is selected - * 0b1010010..CTimer3_MAT1 input is selected - * 0b1010011..CTimer3_MAT2 input is selected - * 0b1010100..CTimer3_MAT3 input is selected - * 0b1010101..QDC1_CMP_FLAG0 input is selected - * 0b1010110..QDC1_CMP_FLAG1 input is selected - * 0b1010111..QDC1_CMP_FLAG2 input is selected - * 0b1011000..QDC1_CMP_FLAG3 input is selected - * 0b1011001..QDC1_POS_MATCH0 input is selected - * 0b1011010..PWM1_SM0_MUX_TRIG0 input is selected - * 0b1011011..PWM1_SM1_MUX_TRIG0 input is selected - * 0b1011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b1011101..Reserved - * 0b1011110..LPI2C2 Master End of Packet input is selected - * 0b1011111..LPI2C2 Slave End of Packet input is selected - * 0b1100000..LPI2C3 Master End of Packet input is selected - * 0b1100001..LPI2C3 Slave End of Packet input is selected - * *.. - */ -#define INPUTMUX_CTIMERE_CTIMER4CAP_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMERE_CTIMER4CAP_INP_SHIFT)) & INPUTMUX_CTIMERE_CTIMER4CAP_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_CTIMERE_CTIMER4CAP */ -#define INPUTMUX_CTIMERE_CTIMER4CAP_COUNT (4U) - -/*! @name TIMER4TRIG - Trigger register for TIMER4 */ -/*! @{ */ - -#define INPUTMUX_TIMER4TRIG_INP_MASK (0x7FU) -#define INPUTMUX_TIMER4TRIG_INP_SHIFT (0U) -/*! INP - Input number for CTIMER4 - * 0b0000000..Reserved - * 0b0000001..CT_IPN0 input is selected - * 0b0000010..CT_IPN1 input is selected - * 0b0000011..CT_IPN2 input is selected - * 0b0000100..CT_IPN3 input is selected - * 0b0000101..CT_IPN4 input is selected - * 0b0000110..CT_IPN5 input is selected - * 0b0000111..CT_IPN6 input is selected - * 0b0001000..CT_IPN7 input is selected - * 0b0001001..CT_IPN8 input is selected - * 0b0001010..CT_IPN9 input is selected - * 0b0001011..CT_IPN10 input is selected - * 0b0001100..CT_IPN11 input is selected - * 0b0001101..CT_IPN12 input is selected - * 0b0001110..CT_IPN13 input is selected - * 0b0001111..CT_IPN14 input is selected - * 0b0010000..CT_IPN15 input is selected - * 0b0010001..CT_IPN16 input is selected - * 0b0010010..CT_IPN17 input is selected - * 0b0010011..CT_IPN18 input is selected - * 0b0010100..CT_IPN19 input is selected - * 0b0010101..USB0 usb0 start of frame input is selected - * 0b0010110..AOI0_OUT0 input is selected - * 0b0010111..AOI0_OUT1 input is selected - * 0b0011000..AOI0_OUT2 input is selected - * 0b0011001..AOI0_OUT3 input is selected - * 0b0011010..ADC0_tcomp[0] - * 0b0011011..ADC0_tcomp[1] - * 0b0011100..ADC0_tcomp[2] - * 0b0011101..ADC0_tcomp[3] input is selected - * 0b0011110..CMP0_OUT is selected - * 0b0011111..CMP1_OUT is selected - * 0b0100000..Reserved - * 0b0100001..CTimer0_MAT1 input is selected - * 0b0100010..CTimer0_MAT2 input is selected - * 0b0100011..CTimer0_MAT3 input is selected - * 0b0100100..CTimer1_MAT1 input is selected - * 0b0100101..CTimer1_MAT2 input is selected - * 0b0100110..CTimer1_MAT3 input is selected - * 0b0100111..QDC0_CMP_FLAG0 is selected - * 0b0101000..QDC0_CMP_FLAG1 input is selected - * 0b0101001..QDC0_CMP_FLAG2 input is selected - * 0b0101010..QDC0_CMP_FLAG3 input is selected - * 0b0101011..QDC0_POS_MATCH0 input is selected - * 0b0101100..PWM0_SM0_MUX_TRIG0 input is selected - * 0b0101101..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0101110..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0101111..Reserved - * 0b0110000..LPI2C0 Master End of Packet input is selected - * 0b0110001..LPI2C0 Slave End of Packet input is selected - * 0b0110010..LPI2C1 Master End of Packet input is selected - * 0b0110011..LPI2C1 Slave End of Packet input is selected - * 0b0110100..LPSPI0 End of Frame input is selected - * 0b0110101..LPSPI0 Received Data Word input is selected - * 0b0110110..LPSPI1 End of Frame input is selected - * 0b0110111..LPSPI1 Received Data Word input is selected - * 0b0111000..LPUART0 Received Data Word input is selected - * 0b0111001..LPUART0 Transmitted Data Word input is selected - * 0b0111010..LPUART0 Receive Line Idle input is selected - * 0b0111011..LPUART1 Received Data Word input is selected - * 0b0111100..LPUART1 Transmitted Data Word input is selected - * 0b0111101..LPUART1 Receive Line Idle input is selected - * 0b0111110..LPUART2 Received Data Word input is selected - * 0b0111111..LPUART2 Transmitted Data Word input is selected - * 0b1000000..LPUART2 Receive Line Idle input is selected - * 0b1000001..LPUART3 Received Data Word input is selected - * 0b1000010..LPUART3 Transmitted Data Word input is selected - * 0b1000011..LPUART3 Receive Line Idle input is selected - * 0b1000100..LPUART4 Received Data Word input is selected - * 0b1000101..LPUART4 Transmitted Data Word input is selected - * 0b1000110..LPUART4 Receive Line Idle input is selected - * 0b1000111..AOI1_OUT0 input is selected - * 0b1001000..AOI1_OUT1 input is selected - * 0b1001001..AOI1_OUT2 input is selected - * 0b1001010..AOI1_OUT3 input is selected - * 0b1001011..ADC1_tcomp[0] input is selected - * 0b1001100..ADC1_tcomp[1] input is selected - * 0b1001101..ADC1_tcomp[2] input is selected - * 0b1001110..ADC1_tcomp[3] input is selected - * 0b1001111..CTimer2_MAT1 input is selected - * 0b1010000..CTimer2_MAT2 input is selected - * 0b1010001..CTimer2_MAT3 input is selected - * 0b1010010..CTimer3_MAT1 input is selected - * 0b1010011..CTimer3_MAT2 input is selected - * 0b1010100..CTimer3_MAT3 input is selected - * 0b1010101..QDC1_CMP_FLAG0 input is selected - * 0b1010110..QDC1_CMP_FLAG1 input is selected - * 0b1010111..QDC1_CMP_FLAG2 input is selected - * 0b1011000..QDC1_CMP_FLAG3 input is selected - * 0b1011001..QDC1_POS_MATCH0 input is selected - * 0b1011010..PWM1_SM0_MUX_TRIG0 input is selected - * 0b1011011..PWM1_SM1_MUX_TRIG0 input is selected - * 0b1011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b1011101..Reserved - * 0b1011110..LPI2C2 Master End of Packet input is selected - * 0b1011111..LPI2C2 Slave End of Packet input is selected - * 0b1100000..LPI2C3 Master End of Packet input is selected - * 0b1100001..LPI2C3 Slave End of Packet input is selected - * *.. - */ -#define INPUTMUX_TIMER4TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_TIMER4TRIG_INP_SHIFT)) & INPUTMUX_TIMER4TRIG_INP_MASK) -/*! @} */ - -/*! @name AOI1_INPUTM_AOI1_INPUT - AOI1 trigger input connections 0 */ -/*! @{ */ - -#define INPUTMUX_AOI1_INPUTM_AOI1_INPUT_INP_MASK (0x7FU) -#define INPUTMUX_AOI1_INPUTM_AOI1_INPUT_INP_SHIFT (0U) -/*! INP - AOI0 trigger input connections - * 0b0000000..Reserved - * 0b0000001..ADC0_tcomp[0] input is selected - * 0b0000010..ADC0_tcomp[1] input is selected - * 0b0000011..ADC0_tcomp[2] input is selected - * 0b0000100..ADC0_tcomp[3] input is selected - * 0b0000101..CMP0_OUT input is selected - * 0b0000110..CMP1_OUT input is selected - * 0b0000111..Reserved - * 0b0001000..CTimer0_MAT0 input is selected - * 0b0001001..CTimer0_MAT1 input is selected - * 0b0001010..CTimer0_MAT2 input is selected - * 0b0001011..CTimer0_MAT3 input is selected - * 0b0001100..CTimer1_MAT0 - * 0b0001101..CTimer1_MAT1 input is selected - * 0b0001110..CTimer1_MAT2 input is selected - * 0b0001111..CTimer1_MAT3 input is selected - * 0b0010000..CTimer2_MAT0 input is selected - * 0b0010001..CTimer2_MAT1 input is selected - * 0b0010010..CTimer2_MAT2 input is selected - * 0b0010011..CTimer2_MAT3 input is selected - * 0b0010100..LPTMR0 input is selected - * 0b0010101..Reserved - * 0b0010110..QDC0_CMP_FLAG0 input is selected - * 0b0010111..QDC0_CMP_FLAG1 input is selected - * 0b0011000..QDC0_CMP_FLAG2 input is selected - * 0b0011001..QDC0_CMP_FLAG3 input is selected - * 0b0011010..QDC0_POS_MATCH input is selected - * 0b0011011..PWM0_SM0_MUX_TRIG0 0 input is selected - * 0b0011100..PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011101..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0011110..PWM0_SM1_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..Reserved - * 0b0100010..Reserved - * 0b0100011..TRIG_IN0 input is selected - * 0b0100100..TRIG_IN1 input is selected - * 0b0100101..TRIG_IN2 input is selected - * 0b0100110..TRIG_IN3 input is selected - * 0b0100111..TRIG_IN4 input is selected - * 0b0101000..TRIG_IN5 input is selected - * 0b0101001..TRIG_IN6 input is selected - * 0b0101010..TRIG_IN7 input is selected - * 0b0101011..TRIG_IN8 input is selected - * 0b0101100..TRIG_IN9 input is selected - * 0b0101101..TRIG_IN10 input is selected - * 0b0101110..TRIG_IN11 input is selected - * 0b0101111..GPIO0 Pin Event Trig 0 input is selected - * 0b0110000..GPIO1 Pin Event Trig 0 input is selected - * 0b0110001..GPIO2 Pin Event Trig 0 input is selected - * 0b0110010..GPIO3 Pin Event Trig 0 input is selected - * 0b0110011..GPIO4 Pin Event Trig 0 input is selected - * 0b0110100..ADC1_tcomp[0] input is selected - * 0b0110101..ADC1_tcomp[1] input is selected - * 0b0110110..ADC1_tcomp[2] input is selected - * 0b0110111..ADC1_tcomp[3] input is selected - * 0b0111000..CTimer3_MAT0 input is selected - * 0b0111001..CTimer3_MAT1 input is selected - * 0b0111010..CTimer3_MAT2 input is selected - * 0b0111011..CTimer3_MAT3 input is selected - * 0b0111100..CTimer4_MAT0 input is selected - * 0b0111101..CTimer4_MAT1 input is selected - * 0b0111110..CTimer4_MAT2 input is selected - * 0b0111111..CTimer4_MAT3 input is selected - * 0b1000000..FlexIO CH0 input is selected - * 0b1000001..FlexIO CH1 input is selected - * 0b1000010..FlexIO CH2 input is selected - * 0b1000011..FlexIO CH3 input is selected - * 0b1000100..QDC1_CMP_FLAG0 input is selected - * 0b1000101..QDC1_CMP_FLAG1 input is selected - * 0b1000110..QDC1_CMP_FLAG2 input is selected - * 0b1000111..QDC1_CMP_FLAG3 input is selected - * 0b1001000..QDC1_POS_MATCH0 input is selected - * 0b1001001..PWM1_SM0_MUX_TRIG0 input is selected - * 0b1001010..PWM1_SM0_MUX_TRIG1 input is selected - * 0b1001011..PWM1_SM1_MUX_TRIG0 input is selected - * 0b1001100..PWM1_SM1_MUX_TRIG1 input is selected - * 0b1001101..PWM1_SM2_MUX_TRIG0 input is selected - * 0b1001110..PWM1_SM2_MUX_TRIG1 input is selected - * 0b1001111..Reserved - * 0b1010000..Reserved - * *.. - */ -#define INPUTMUX_AOI1_INPUTM_AOI1_INPUT_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_AOI1_INPUTM_AOI1_INPUT_INP_SHIFT)) & INPUTMUX_AOI1_INPUTM_AOI1_INPUT_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_AOI1_INPUTM_AOI1_INPUT */ -#define INPUTMUX_AOI1_INPUTM_AOI1_INPUT_COUNT (16U) - -/*! @name CMP0_TRIG - CMP0 input connections */ -/*! @{ */ - -#define INPUTMUX_CMP0_TRIG_TRIGIN_MASK (0x3FU) -#define INPUTMUX_CMP0_TRIG_TRIGIN_SHIFT (0U) -/*! TRIGIN - CMP0 input trigger - * 0b000000..Reserved - * 0b000001..Reserved - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP1_OUT input is selected - * 0b000111..Reserved - * 0b001000..CTimer0_MAT0 input is selected - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer1_MAT0 - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer2_MAT0 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..LPTMR0 input is selected - * 0b001111..Reserved - * 0b010000..QDC0_POS_MATCH0 - * 0b010001..PWM0_SM0_MUX_TRIG0 input is selected - * 0b010010..PWM0_SM0_MUX_TRIG1 input is selected - * 0b010011..PWM0_SM1_MUX_TRIG0 input is selected - * 0b010100..PWM0_SM1_MUX_TRIG1 input is selected - * 0b010101..PWM0_SM2_MUX_TRIG0 input is selected - * 0b010110..PWM0_SM2_MUX_TRIG1 input is selected - * 0b010111..Reserved - * 0b011000..Reserved - * 0b011001..GPIO0 Pin Event Trig 0 input is selected - * 0b011010..GPIO1 Pin Event Trig 0 input is selected - * 0b011011..GPIO2 Pin Event Trig 0 input is selected - * 0b011100..GPIO3 Pin Event Trig 0 input is selected - * 0b011101..GPIO4 Pin Event Trig 0 input is selected - * 0b011110..WUU input is selected - * 0b011111..AOI1_OUT0 input is selected - * 0b100000..AOI1_OUT1 input is selected - * 0b100001..AOI1_OUT2 input is selected - * 0b100010..AOI1_OUT3 input is selected - * 0b100011..Reserved - * 0b100100..Reserved - * 0b100101..Reserved - * 0b100110..Reserved - * 0b100111..CTimer3_MAT0 - * 0b101000..CTimer3_MAT1 - * 0b101001..CTimer4_MAT0 input is selected - * 0b101010..CTimer4_MAT1 input is selected - * 0b101011..Reserved - * 0b101100..Reserved - * 0b101101..Reserved - * 0b101110..Reserved - * 0b101111..QDC1_POS_MATCH0 input is selected - * 0b110000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b110001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b110010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b110011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b110100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b110101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b110110..Reserved - * 0b110111..Reserved - * *.. - */ -#define INPUTMUX_CMP0_TRIG_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CMP0_TRIG_TRIGIN_SHIFT)) & INPUTMUX_CMP0_TRIG_TRIGIN_MASK) -/*! @} */ - -/*! @name ADC0_TRIGM_ADC0_TRIG - ADC Trigger input connections */ -/*! @{ */ - -#define INPUTMUX_ADC0_TRIGM_ADC0_TRIG_TRIGIN_MASK (0x3FU) -#define INPUTMUX_ADC0_TRIGM_ADC0_TRIG_TRIGIN_SHIFT (0U) -/*! TRIGIN - ADC0 trigger inputs - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT0 input is selected - * 0b001010..CTimer0_MAT1 input is selected - * 0b001011..CTimer1_MAT0 input is selected - * 0b001100..CTimer1_MAT1 input is selected - * 0b001101..CTimer2_MAT0 input is selected - * 0b001110..CTimer2_MAT1 input is selected - * 0b001111..LPTMR0 input is selected - * 0b010000..Reserved - * 0b010001..QDC0_POS_MATCH0 input is selected - * 0b010010..PWM0_SM0_OUT_TRIG0 input is selected - * 0b010011..PWM0_SM0_OUT_TRIG1 input is selected - * 0b010100..PWM0_SM1_OUT_TRIG0 input is selected - * 0b010101..PWM0_SM1_OUT_TRIG1 input is selected - * 0b010110..PWM0_SM2_OUT_TRIG0 input is selected - * 0b010111..PWM0_SM2_OUT_TRIG1 input is selected - * 0b011000..Reserved - * 0b011001..Reserved - * 0b011010..GPIO0 Pin Event Trig 0 input is selected - * 0b011011..GPIO1 Pin Event Trig 0 input is selected - * 0b011100..GPIO2 Pin Event Trig 0 input is selected - * 0b011101..GPIO3 Pin Event Trig 0 input is selected - * 0b011110..GPIO4 Pin Event Trig 0 input is selected - * 0b011111..WUU - * 0b100000..Reserved - * 0b100001..AOI1_OUT0 input is selected - * 0b100010..AOI1_OUT1 input is selected - * 0b100011..AOI1_OUT2 input is selected - * 0b100100..AOI1_OUT3 input is selected - * 0b100101..ADC1_tcomp[0] input is selected - * 0b100110..ADC1_tcomp[1] input is selected - * 0b100111..ADC1_tcomp[2] input is selected - * 0b101000..ADC1_tcomp[3] input is selected - * 0b101001..CTimer3_MAT0 input is selected - * 0b101010..CTimer3_MAT1 input is selected - * 0b101011..CTimer4_MAT0 input is selected - * 0b101100..CTimer4_MAT1 input is selected - * 0b101101..FlexIO CH0 input is selected - * 0b101110..FlexIO CH1 input is selected - * 0b101111..FlexIO CH2 input is selected - * 0b110000..FlexIO CH3 input is selected - * 0b110001..QDC1_POS_MATCH0 input is selected - * 0b110010..PWM1_SM0_MUX_TRIG0 input is selected - * 0b110011..PWM1_SM0_MUX_TRIG1 input is selected - * 0b110100..PWM1_SM1_MUX_TRIG0 input is selected - * 0b110101..PWM1_SM1_MUX_TRIG1 input is selected - * 0b110110..PWM1_SM2_MUX_TRIG0 input is selected - * 0b110111..PWM1_SM2_MUX_TRIG1 input is selected - * 0b111000..Reserved - * 0b111001..Reserved - * *.. - */ -#define INPUTMUX_ADC0_TRIGM_ADC0_TRIG_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_ADC0_TRIGM_ADC0_TRIG_TRIGIN_SHIFT)) & INPUTMUX_ADC0_TRIGM_ADC0_TRIG_TRIGIN_MASK) -/*! @} */ - -/* The count of INPUTMUX_ADC0_TRIGM_ADC0_TRIG */ -#define INPUTMUX_ADC0_TRIGM_ADC0_TRIG_COUNT (4U) - -/*! @name ADC1_TRIGM_ADC1_TRIG - ADC Trigger input connections */ -/*! @{ */ - -#define INPUTMUX_ADC1_TRIGM_ADC1_TRIG_TRIGIN_MASK (0x3FU) -#define INPUTMUX_ADC1_TRIGM_ADC1_TRIG_TRIGIN_SHIFT (0U) -/*! TRIGIN - ADC0 trigger inputs - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT0 input is selected - * 0b001010..CTimer0_MAT1 input is selected - * 0b001011..CTimer1_MAT0 input is selected - * 0b001100..CTimer1_MAT1 input is selected - * 0b001101..CTimer2_MAT0 input is selected - * 0b001110..CTimer2_MAT1 input is selected - * 0b001111..LPTMR0 input is selected - * 0b010000..Reserved - * 0b010001..QDC0_POS_MATCH0 input is selected - * 0b010010..PWM0_SM0_OUT_TRIG0 input is selected - * 0b010011..PWM0_SM0_OUT_TRIG1 input is selected - * 0b010100..PWM0_SM1_OUT_TRIG0 input is selected - * 0b010101..PWM0_SM1_OUT_TRIG1 input is selected - * 0b010110..PWM0_SM2_OUT_TRIG0 input is selected - * 0b010111..PWM0_SM2_OUT_TRIG1 input is selected - * 0b011000..Reserved - * 0b011001..Reserved - * 0b011010..GPIO0 Pin Event Trig 0 input is selected - * 0b011011..GPIO1 Pin Event Trig 0 input is selected - * 0b011100..GPIO2 Pin Event Trig 0 input is selected - * 0b011101..GPIO3 Pin Event Trig 0 input is selected - * 0b011110..GPIO4 Pin Event Trig 0 input is selected - * 0b011111..WUU - * 0b100000..Reserved - * 0b100001..AOI1_OUT0 input is selected - * 0b100010..AOI1_OUT1 input is selected - * 0b100011..AOI1_OUT2 input is selected - * 0b100100..AOI1_OUT3 input is selected - * 0b100101..ADC0_tcomp[0] input is selected - * 0b100110..ADC0_tcomp[1] input is selected - * 0b100111..ADC0_tcomp[2] input is selected - * 0b101000..ADC0_tcomp[3] input is selected - * 0b101001..CTimer3_MAT0 input is selected - * 0b101010..CTimer3_MAT1 input is selected - * 0b101011..CTimer4_MAT0 input is selected - * 0b101100..CTimer4_MAT1 input is selected - * 0b101101..FlexIO CH0 input is selected - * 0b101110..FlexIO CH1 input is selected - * 0b101111..FlexIO CH2 input is selected - * 0b110000..FlexIO CH3 input is selected - * 0b110001..QDC1_POS_MATCH0 input is selected - * 0b110010..PWM1_SM0_MUX_TRIG0 input is selected - * 0b110011..PWM1_SM0_MUX_TRIG1 input is selected - * 0b110100..PWM1_SM1_MUX_TRIG0 input is selected - * 0b110101..PWM1_SM1_MUX_TRIG1 input is selected - * 0b110110..PWM1_SM2_MUX_TRIG0 input is selected - * 0b110111..PWM1_SM2_MUX_TRIG1 input is selected - * 0b111000..Reserved - * 0b111001..Reserved - * *.. - */ -#define INPUTMUX_ADC1_TRIGM_ADC1_TRIG_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_ADC1_TRIGM_ADC1_TRIG_TRIGIN_SHIFT)) & INPUTMUX_ADC1_TRIGM_ADC1_TRIG_TRIGIN_MASK) -/*! @} */ - -/* The count of INPUTMUX_ADC1_TRIGM_ADC1_TRIG */ -#define INPUTMUX_ADC1_TRIGM_ADC1_TRIG_COUNT (4U) - -/*! @name DAC0_TRIG - This register selects the DAC0 trigger inputs. */ -/*! @{ */ - -#define INPUTMUX_DAC0_TRIG_TRIGIN_MASK (0x3FU) -#define INPUTMUX_DAC0_TRIG_TRIGIN_SHIFT (0U) -/*! TRIGIN - DAC0 trigger input - * 0b000000..Reserved - * 0b000001..ARM_TXEV - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT0 input is selected - * 0b001010..CTimer0_MAT1 input is selected - * 0b001011..CTimer1_MAT0 input is selected - * 0b001100..CTimer1_MAT1 input is selected - * 0b001101..CTimer2_MAT0 input is selected - * 0b001110..CTimer2_MAT1 input is selected - * 0b001111..LPTMR0 input is selected - * 0b010000..Reserved - * 0b010001..Reserved - * 0b010010..Reserved - * 0b010011..Reserved - * 0b010100..Reserved - * 0b010101..Reserved - * 0b010110..Reserved - * 0b010111..Reserved - * 0b011000..Reserved - * 0b011001..Reserved - * 0b011010..GPIO0 Pin Event Trig 0 input is selected - * 0b011011..GPIO1 Pin Event Trig 0 input is selected - * 0b011100..GPIO2 Pin Event Trig 0 input is selected - * 0b011101..GPIO3 Pin Event Trig 0 input is selected - * 0b011110..GPIO4 Pin Event Trig 0 input is selected - * 0b011111..WUU input is selected - * 0b100000..Reserved - * 0b100001..AOI1_OUT0 input is selected - * 0b100010..AOI1_OUT1 input is selected - * 0b100011..AOI1_OUT2 input is selected - * 0b100100..AOI1_OUT3 input is selected - * 0b100101..ADC0_tcomp[0] input is selected - * 0b100110..ADC0_tcomp[1] input is selected - * 0b100111..ADC1_tcomp[0] input is selected - * 0b101000..ADC1_tcomp[1] input is selected - * 0b101001..CTimer3_MAT0 input is selected - * 0b101010..CTimer3_MAT1 input is selected - * 0b101011..CTimer4_MAT0 input is selected - * 0b101100..CTimer4_MAT1 input is selected - * 0b101101..Reserved - * 0b101110..Reserved - * 0b101111..Reserved - * 0b110000..Reserved - * 0b110001..Reserved - * 0b110010..Reserved - * 0b110011..Reserved - * 0b110100..Reserved - * 0b110101..Reserved - * 0b110110..Reserved - * 0b110111..Reserved - * 0b111000..Reserved - * 0b111001..Reserved - * *.. - */ -#define INPUTMUX_DAC0_TRIG_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DAC0_TRIG_TRIGIN_SHIFT)) & INPUTMUX_DAC0_TRIG_TRIGIN_MASK) -/*! @} */ - -/*! @name QDC0_TRIG - QDC0 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDC0_TRIG_INP_MASK (0x7FU) -#define INPUTMUX_QDC0_TRIG_INP_SHIFT (0U) -/*! INP - QDC0 input connections - * 0b0000000..Reserved - * 0b0000001..ARM_TXEV input is selected - * 0b0000010..AOI0_OUT0 input is selected - * 0b0000011..AOI0_OUT1 input is selected - * 0b0000100..AOI0_OUT2 input is selected - * 0b0000101..AOI0_OUT3 input is selected - * 0b0000110..CMP0_OUT input is selected - * 0b0000111..CMP1_OUT input is selected - * 0b0001000..Reserved - * 0b0001001..CTimer0_MAT2 input is selected - * 0b0001010..CTimer0_MAT3 - * 0b0001011..CTimer1_MAT2 input is selected - * 0b0001100..CTimer1_MAT3 input is selected - * 0b0001101..CTimer2_MAT2 input is selected - * 0b0001110..CTimer2_MAT3 input is selected - * 0b0001111..Reserved - * 0b0010000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b0010001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b0010010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0010011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b0010100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0010101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b0010110..Reserved - * 0b0010111..Reserved - * 0b0011000..TRIG_IN0 input is selected - * 0b0011001..TRIG_IN1 input is selected - * 0b0011010..TRIG_IN2 input is selected - * 0b0011011..TRIG_IN3 input is selected - * 0b0011100..TRIG_IN4 input is selected - * 0b0011101..TRIG_IN5 input is selected - * 0b0011110..TRIG_IN6 input is selected - * 0b0011111..TRIG_IN7 input is selected - * 0b0100000..TRIG_IN8 input is selected - * 0b0100001..TRIG_IN9 input is selected - * 0b0100010..TRIG_IN10 input is selected - * 0b0100011..TRIG_IN11 input is selected - * 0b0100100..GPIO0 Pin Event Trig 0 is selected - * 0b0100101..GPIO1 Pin Event Trig 0 input is selected - * 0b0100110..GPIO2 Pin Event Trig 0 input is selected - * 0b0100111..GPIO3 Pin Event Trig 0 input is selected - * 0b0101000..GPIO4 Pin Event Trig 0 input is selected - * 0b0101001..AOI1_OUT0 input is selected - * 0b0101010..AOI1_OUT1 input is selected - * 0b0101011..AOI1_OUT2 input is selected - * 0b0101100..AOI1_OUT3 input is selected - * 0b0101101..Reserved - * 0b0101110..Reserved - * 0b0101111..Reserved - * 0b0110000..Reserved - * 0b0110001..CTimer3_MAT2 input is selected - * 0b0110010..CTimer3_MAT3 input is selected - * 0b0110011..CTimer4_MAT2 input is selected - * 0b0110100..CTimer4_MAT3 End of Frame input is selected - * 0b0110101..Reserved - * 0b0110110..Reserved - * 0b0110111..Reserved - * 0b0111000..Reserved - * 0b0111001..Reserved - * 0b0111010..Reserved - * 0b0111011..Reserved - * 0b0111100..Reserved - * 0b0111101..Reserved - * 0b0111110..PWM1_SM0_OUT_TRIG0 input is selected - * 0b0111111..PWM1_SM0_OUT_TRIG1 input is selected - * 0b1000000..PWM1_SM1_OUT_TRIG0 input is selected - * 0b1000001..PWM1_SM1_OUT_TRIG1 input is selected - * 0b1000010..PWM1_SM2_OUT_TRIG0 input is selected - * 0b1000011..PWM1_SM2_OUT_TRIG1 input is selected - * 0b1000100..Reserved - * 0b1000101..Reserved - * *.. - */ -#define INPUTMUX_QDC0_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDC0_TRIG_INP_SHIFT)) & INPUTMUX_QDC0_TRIG_INP_MASK) -/*! @} */ - -/*! @name QDC0_HOME - QDC0 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDC0_HOME_INP_MASK (0x7FU) -#define INPUTMUX_QDC0_HOME_INP_SHIFT (0U) -/*! INP - QDC0 input connections - * 0b0000000..Reserved - * 0b0000001..ARM_TXEV input is selected - * 0b0000010..AOI0_OUT0 input is selected - * 0b0000011..AOI0_OUT1 input is selected - * 0b0000100..AOI0_OUT2 input is selected - * 0b0000101..AOI0_OUT3 input is selected - * 0b0000110..CMP0_OUT input is selected - * 0b0000111..CMP1_OUT input is selected - * 0b0001000..Reserved - * 0b0001001..CTimer0_MAT2 input is selected - * 0b0001010..CTimer0_MAT3 - * 0b0001011..CTimer1_MAT2 input is selected - * 0b0001100..CTimer1_MAT3 input is selected - * 0b0001101..CTimer2_MAT2 input is selected - * 0b0001110..CTimer2_MAT3 input is selected - * 0b0001111..Reserved - * 0b0010000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b0010001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b0010010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0010011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b0010100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0010101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b0010110..Reserved - * 0b0010111..Reserved - * 0b0011000..TRIG_IN0 input is selected - * 0b0011001..TRIG_IN1 input is selected - * 0b0011010..TRIG_IN2 input is selected - * 0b0011011..TRIG_IN3 input is selected - * 0b0011100..TRIG_IN4 input is selected - * 0b0011101..TRIG_IN5 input is selected - * 0b0011110..TRIG_IN6 input is selected - * 0b0011111..TRIG_IN7 input is selected - * 0b0100000..TRIG_IN8 input is selected - * 0b0100001..TRIG_IN9 input is selected - * 0b0100010..TRIG_IN10 input is selected - * 0b0100011..TRIG_IN11 input is selected - * 0b0100100..GPIO0 Pin Event Trig 0 is selected - * 0b0100101..GPIO1 Pin Event Trig 0 input is selected - * 0b0100110..GPIO2 Pin Event Trig 0 input is selected - * 0b0100111..GPIO3 Pin Event Trig 0 input is selected - * 0b0101000..GPIO4 Pin Event Trig 0 input is selected - * 0b0101001..AOI1_OUT0 input is selected - * 0b0101010..AOI1_OUT1 input is selected - * 0b0101011..AOI1_OUT2 input is selected - * 0b0101100..AOI1_OUT3 input is selected - * 0b0101101..Reserved - * 0b0101110..Reserved - * 0b0101111..Reserved - * 0b0110000..Reserved - * 0b0110001..CTimer3_MAT2 input is selected - * 0b0110010..CTimer3_MAT3 input is selected - * 0b0110011..CTimer4_MAT2 input is selected - * 0b0110100..CTimer4_MAT3 End of Frame input is selected - * 0b0110101..Reserved - * 0b0110110..Reserved - * 0b0110111..Reserved - * 0b0111000..Reserved - * 0b0111001..Reserved - * 0b0111010..Reserved - * 0b0111011..Reserved - * 0b0111100..Reserved - * 0b0111101..Reserved - * 0b0111110..PWM1_SM0_OUT_TRIG0 input is selected - * 0b0111111..PWM1_SM0_OUT_TRIG1 input is selected - * 0b1000000..PWM1_SM1_OUT_TRIG0 input is selected - * 0b1000001..PWM1_SM1_OUT_TRIG1 input is selected - * 0b1000010..PWM1_SM2_OUT_TRIG0 input is selected - * 0b1000011..PWM1_SM2_OUT_TRIG1 input is selected - * 0b1000100..Reserved - * 0b1000101..Reserved - * *.. - */ -#define INPUTMUX_QDC0_HOME_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDC0_HOME_INP_SHIFT)) & INPUTMUX_QDC0_HOME_INP_MASK) -/*! @} */ - -/*! @name QDC0_INDEX - QDC0 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDC0_INDEX_INP_MASK (0x7FU) -#define INPUTMUX_QDC0_INDEX_INP_SHIFT (0U) -/*! INP - QDC0 input connections - * 0b0000000..Reserved - * 0b0000001..ARM_TXEV input is selected - * 0b0000010..AOI0_OUT0 input is selected - * 0b0000011..AOI0_OUT1 input is selected - * 0b0000100..AOI0_OUT2 input is selected - * 0b0000101..AOI0_OUT3 input is selected - * 0b0000110..CMP0_OUT input is selected - * 0b0000111..CMP1_OUT input is selected - * 0b0001000..Reserved - * 0b0001001..CTimer0_MAT2 input is selected - * 0b0001010..CTimer0_MAT3 - * 0b0001011..CTimer1_MAT2 input is selected - * 0b0001100..CTimer1_MAT3 input is selected - * 0b0001101..CTimer2_MAT2 input is selected - * 0b0001110..CTimer2_MAT3 input is selected - * 0b0001111..Reserved - * 0b0010000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b0010001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b0010010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0010011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b0010100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0010101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b0010110..Reserved - * 0b0010111..Reserved - * 0b0011000..TRIG_IN0 input is selected - * 0b0011001..TRIG_IN1 input is selected - * 0b0011010..TRIG_IN2 input is selected - * 0b0011011..TRIG_IN3 input is selected - * 0b0011100..TRIG_IN4 input is selected - * 0b0011101..TRIG_IN5 input is selected - * 0b0011110..TRIG_IN6 input is selected - * 0b0011111..TRIG_IN7 input is selected - * 0b0100000..TRIG_IN8 input is selected - * 0b0100001..TRIG_IN9 input is selected - * 0b0100010..TRIG_IN10 input is selected - * 0b0100011..TRIG_IN11 input is selected - * 0b0100100..GPIO0 Pin Event Trig 0 is selected - * 0b0100101..GPIO1 Pin Event Trig 0 input is selected - * 0b0100110..GPIO2 Pin Event Trig 0 input is selected - * 0b0100111..GPIO3 Pin Event Trig 0 input is selected - * 0b0101000..GPIO4 Pin Event Trig 0 input is selected - * 0b0101001..AOI1_OUT0 input is selected - * 0b0101010..AOI1_OUT1 input is selected - * 0b0101011..AOI1_OUT2 input is selected - * 0b0101100..AOI1_OUT3 input is selected - * 0b0101101..Reserved - * 0b0101110..Reserved - * 0b0101111..Reserved - * 0b0110000..Reserved - * 0b0110001..CTimer3_MAT2 input is selected - * 0b0110010..CTimer3_MAT3 input is selected - * 0b0110011..CTimer4_MAT2 input is selected - * 0b0110100..CTimer4_MAT3 End of Frame input is selected - * 0b0110101..Reserved - * 0b0110110..Reserved - * 0b0110111..Reserved - * 0b0111000..Reserved - * 0b0111001..Reserved - * 0b0111010..Reserved - * 0b0111011..Reserved - * 0b0111100..Reserved - * 0b0111101..Reserved - * 0b0111110..PWM1_SM0_OUT_TRIG0 input is selected - * 0b0111111..PWM1_SM0_OUT_TRIG1 input is selected - * 0b1000000..PWM1_SM1_OUT_TRIG0 input is selected - * 0b1000001..PWM1_SM1_OUT_TRIG1 input is selected - * 0b1000010..PWM1_SM2_OUT_TRIG0 input is selected - * 0b1000011..PWM1_SM2_OUT_TRIG1 input is selected - * 0b1000100..Reserved - * 0b1000101..Reserved - * *.. - */ -#define INPUTMUX_QDC0_INDEX_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDC0_INDEX_INP_SHIFT)) & INPUTMUX_QDC0_INDEX_INP_MASK) -/*! @} */ - -/*! @name QDC0_PHASEB - QDC0 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDC0_PHASEB_INP_MASK (0x7FU) -#define INPUTMUX_QDC0_PHASEB_INP_SHIFT (0U) -/*! INP - QDC0 input connections - * 0b0000000..Reserved - * 0b0000001..ARM_TXEV input is selected - * 0b0000010..AOI0_OUT0 input is selected - * 0b0000011..AOI0_OUT1 input is selected - * 0b0000100..AOI0_OUT2 input is selected - * 0b0000101..AOI0_OUT3 input is selected - * 0b0000110..CMP0_OUT input is selected - * 0b0000111..CMP1_OUT input is selected - * 0b0001000..Reserved - * 0b0001001..CTimer0_MAT2 input is selected - * 0b0001010..CTimer0_MAT3 - * 0b0001011..CTimer1_MAT2 input is selected - * 0b0001100..CTimer1_MAT3 input is selected - * 0b0001101..CTimer2_MAT2 input is selected - * 0b0001110..CTimer2_MAT3 input is selected - * 0b0001111..Reserved - * 0b0010000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b0010001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b0010010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0010011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b0010100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0010101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b0010110..Reserved - * 0b0010111..Reserved - * 0b0011000..TRIG_IN0 input is selected - * 0b0011001..TRIG_IN1 input is selected - * 0b0011010..TRIG_IN2 input is selected - * 0b0011011..TRIG_IN3 input is selected - * 0b0011100..TRIG_IN4 input is selected - * 0b0011101..TRIG_IN5 input is selected - * 0b0011110..TRIG_IN6 input is selected - * 0b0011111..TRIG_IN7 input is selected - * 0b0100000..TRIG_IN8 input is selected - * 0b0100001..TRIG_IN9 input is selected - * 0b0100010..TRIG_IN10 input is selected - * 0b0100011..TRIG_IN11 input is selected - * 0b0100100..GPIO0 Pin Event Trig 0 is selected - * 0b0100101..GPIO1 Pin Event Trig 0 input is selected - * 0b0100110..GPIO2 Pin Event Trig 0 input is selected - * 0b0100111..GPIO3 Pin Event Trig 0 input is selected - * 0b0101000..GPIO4 Pin Event Trig 0 input is selected - * 0b0101001..AOI1_OUT0 input is selected - * 0b0101010..AOI1_OUT1 input is selected - * 0b0101011..AOI1_OUT2 input is selected - * 0b0101100..AOI1_OUT3 input is selected - * 0b0101101..Reserved - * 0b0101110..Reserved - * 0b0101111..Reserved - * 0b0110000..Reserved - * 0b0110001..CTimer3_MAT2 input is selected - * 0b0110010..CTimer3_MAT3 input is selected - * 0b0110011..CTimer4_MAT2 input is selected - * 0b0110100..CTimer4_MAT3 End of Frame input is selected - * 0b0110101..Reserved - * 0b0110110..Reserved - * 0b0110111..Reserved - * 0b0111000..Reserved - * 0b0111001..Reserved - * 0b0111010..Reserved - * 0b0111011..Reserved - * 0b0111100..Reserved - * 0b0111101..Reserved - * 0b0111110..PWM1_SM0_OUT_TRIG0 input is selected - * 0b0111111..PWM1_SM0_OUT_TRIG1 input is selected - * 0b1000000..PWM1_SM1_OUT_TRIG0 input is selected - * 0b1000001..PWM1_SM1_OUT_TRIG1 input is selected - * 0b1000010..PWM1_SM2_OUT_TRIG0 input is selected - * 0b1000011..PWM1_SM2_OUT_TRIG1 input is selected - * 0b1000100..Reserved - * 0b1000101..Reserved - * *.. - */ -#define INPUTMUX_QDC0_PHASEB_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDC0_PHASEB_INP_SHIFT)) & INPUTMUX_QDC0_PHASEB_INP_MASK) -/*! @} */ - -/*! @name QDC0_PHASEA - QDC0 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDC0_PHASEA_INP_MASK (0x7FU) -#define INPUTMUX_QDC0_PHASEA_INP_SHIFT (0U) -/*! INP - QDC0 input connections - * 0b0000000..Reserved - * 0b0000001..ARM_TXEV input is selected - * 0b0000010..AOI0_OUT0 input is selected - * 0b0000011..AOI0_OUT1 input is selected - * 0b0000100..AOI0_OUT2 input is selected - * 0b0000101..AOI0_OUT3 input is selected - * 0b0000110..CMP0_OUT input is selected - * 0b0000111..CMP1_OUT input is selected - * 0b0001000..Reserved - * 0b0001001..CTimer0_MAT2 input is selected - * 0b0001010..CTimer0_MAT3 - * 0b0001011..CTimer1_MAT2 input is selected - * 0b0001100..CTimer1_MAT3 input is selected - * 0b0001101..CTimer2_MAT2 input is selected - * 0b0001110..CTimer2_MAT3 input is selected - * 0b0001111..Reserved - * 0b0010000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b0010001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b0010010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0010011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b0010100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0010101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b0010110..Reserved - * 0b0010111..Reserved - * 0b0011000..TRIG_IN0 input is selected - * 0b0011001..TRIG_IN1 input is selected - * 0b0011010..TRIG_IN2 input is selected - * 0b0011011..TRIG_IN3 input is selected - * 0b0011100..TRIG_IN4 input is selected - * 0b0011101..TRIG_IN5 input is selected - * 0b0011110..TRIG_IN6 input is selected - * 0b0011111..TRIG_IN7 input is selected - * 0b0100000..TRIG_IN8 input is selected - * 0b0100001..TRIG_IN9 input is selected - * 0b0100010..TRIG_IN10 input is selected - * 0b0100011..TRIG_IN11 input is selected - * 0b0100100..GPIO0 Pin Event Trig 0 is selected - * 0b0100101..GPIO1 Pin Event Trig 0 input is selected - * 0b0100110..GPIO2 Pin Event Trig 0 input is selected - * 0b0100111..GPIO3 Pin Event Trig 0 input is selected - * 0b0101000..GPIO4 Pin Event Trig 0 input is selected - * 0b0101001..AOI1_OUT0 input is selected - * 0b0101010..AOI1_OUT1 input is selected - * 0b0101011..AOI1_OUT2 input is selected - * 0b0101100..AOI1_OUT3 input is selected - * 0b0101101..Reserved - * 0b0101110..Reserved - * 0b0101111..Reserved - * 0b0110000..Reserved - * 0b0110001..CTimer3_MAT2 input is selected - * 0b0110010..CTimer3_MAT3 input is selected - * 0b0110011..CTimer4_MAT2 input is selected - * 0b0110100..CTimer4_MAT3 End of Frame input is selected - * 0b0110101..Reserved - * 0b0110110..Reserved - * 0b0110111..Reserved - * 0b0111000..Reserved - * 0b0111001..Reserved - * 0b0111010..Reserved - * 0b0111011..Reserved - * 0b0111100..Reserved - * 0b0111101..Reserved - * 0b0111110..PWM1_SM0_OUT_TRIG0 input is selected - * 0b0111111..PWM1_SM0_OUT_TRIG1 input is selected - * 0b1000000..PWM1_SM1_OUT_TRIG0 input is selected - * 0b1000001..PWM1_SM1_OUT_TRIG1 input is selected - * 0b1000010..PWM1_SM2_OUT_TRIG0 input is selected - * 0b1000011..PWM1_SM2_OUT_TRIG1 input is selected - * 0b1000100..Reserved - * 0b1000101..Reserved - * *.. - */ -#define INPUTMUX_QDC0_PHASEA_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDC0_PHASEA_INP_SHIFT)) & INPUTMUX_QDC0_PHASEA_INP_MASK) -/*! @} */ - -/*! @name QDC0_ICAP1 - QDC0 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDC0_ICAP1_INP_MASK (0x7FU) -#define INPUTMUX_QDC0_ICAP1_INP_SHIFT (0U) -/*! INP - QDC0 input connections - * 0b0000000..Reserved - * 0b0000001..ARM_TXEV input is selected - * 0b0000010..AOI0_OUT0 input is selected - * 0b0000011..AOI0_OUT1 input is selected - * 0b0000100..AOI0_OUT2 input is selected - * 0b0000101..AOI0_OUT3 input is selected - * 0b0000110..CMP0_OUT input is selected - * 0b0000111..CMP1_OUT input is selected - * 0b0001000..Reserved - * 0b0001001..CTimer0_MAT2 input is selected - * 0b0001010..CTimer0_MAT3 - * 0b0001011..CTimer1_MAT2 input is selected - * 0b0001100..CTimer1_MAT3 input is selected - * 0b0001101..CTimer2_MAT2 input is selected - * 0b0001110..CTimer2_MAT3 input is selected - * 0b0001111..Reserved - * 0b0010000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b0010001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b0010010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0010011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b0010100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0010101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b0010110..Reserved - * 0b0010111..Reserved - * 0b0011000..TRIG_IN0 input is selected - * 0b0011001..TRIG_IN1 input is selected - * 0b0011010..TRIG_IN2 input is selected - * 0b0011011..TRIG_IN3 input is selected - * 0b0011100..TRIG_IN4 input is selected - * 0b0011101..TRIG_IN5 input is selected - * 0b0011110..TRIG_IN6 input is selected - * 0b0011111..TRIG_IN7 input is selected - * 0b0100000..TRIG_IN8 input is selected - * 0b0100001..TRIG_IN9 input is selected - * 0b0100010..TRIG_IN10 input is selected - * 0b0100011..TRIG_IN11 input is selected - * 0b0100100..GPIO0 Pin Event Trig 0 is selected - * 0b0100101..GPIO1 Pin Event Trig 0 input is selected - * 0b0100110..GPIO2 Pin Event Trig 0 input is selected - * 0b0100111..GPIO3 Pin Event Trig 0 input is selected - * 0b0101000..GPIO4 Pin Event Trig 0 input is selected - * 0b0101001..AOI1_OUT0 input is selected - * 0b0101010..AOI1_OUT1 input is selected - * 0b0101011..AOI1_OUT2 input is selected - * 0b0101100..AOI1_OUT3 input is selected - * 0b0101101..Reserved - * 0b0101110..Reserved - * 0b0101111..Reserved - * 0b0110000..Reserved - * 0b0110001..CTimer3_MAT2 input is selected - * 0b0110010..CTimer3_MAT3 input is selected - * 0b0110011..CTimer4_MAT2 input is selected - * 0b0110100..CTimer4_MAT3 End of Frame input is selected - * 0b0110101..Reserved - * 0b0110110..Reserved - * 0b0110111..Reserved - * 0b0111000..Reserved - * 0b0111001..Reserved - * 0b0111010..Reserved - * 0b0111011..Reserved - * 0b0111100..Reserved - * 0b0111101..Reserved - * 0b0111110..PWM1_SM0_OUT_TRIG0 input is selected - * 0b0111111..PWM1_SM0_OUT_TRIG1 input is selected - * 0b1000000..PWM1_SM1_OUT_TRIG0 input is selected - * 0b1000001..PWM1_SM1_OUT_TRIG1 input is selected - * 0b1000010..PWM1_SM2_OUT_TRIG0 input is selected - * 0b1000011..PWM1_SM2_OUT_TRIG1 input is selected - * 0b1000100..Reserved - * 0b1000101..Reserved - * *.. - */ -#define INPUTMUX_QDC0_ICAP1_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDC0_ICAP1_INP_SHIFT)) & INPUTMUX_QDC0_ICAP1_INP_MASK) -/*! @} */ - -/*! @name QDC0_ICAP2 - QDC0 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDC0_ICAP2_INP_MASK (0x7FU) -#define INPUTMUX_QDC0_ICAP2_INP_SHIFT (0U) -/*! INP - QDC0 input connections - * 0b0000000..Reserved - * 0b0000001..ARM_TXEV input is selected - * 0b0000010..AOI0_OUT0 input is selected - * 0b0000011..AOI0_OUT1 input is selected - * 0b0000100..AOI0_OUT2 input is selected - * 0b0000101..AOI0_OUT3 input is selected - * 0b0000110..CMP0_OUT input is selected - * 0b0000111..CMP1_OUT input is selected - * 0b0001000..Reserved - * 0b0001001..CTimer0_MAT2 input is selected - * 0b0001010..CTimer0_MAT3 - * 0b0001011..CTimer1_MAT2 input is selected - * 0b0001100..CTimer1_MAT3 input is selected - * 0b0001101..CTimer2_MAT2 input is selected - * 0b0001110..CTimer2_MAT3 input is selected - * 0b0001111..Reserved - * 0b0010000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b0010001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b0010010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0010011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b0010100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0010101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b0010110..Reserved - * 0b0010111..Reserved - * 0b0011000..TRIG_IN0 input is selected - * 0b0011001..TRIG_IN1 input is selected - * 0b0011010..TRIG_IN2 input is selected - * 0b0011011..TRIG_IN3 input is selected - * 0b0011100..TRIG_IN4 input is selected - * 0b0011101..TRIG_IN5 input is selected - * 0b0011110..TRIG_IN6 input is selected - * 0b0011111..TRIG_IN7 input is selected - * 0b0100000..TRIG_IN8 input is selected - * 0b0100001..TRIG_IN9 input is selected - * 0b0100010..TRIG_IN10 input is selected - * 0b0100011..TRIG_IN11 input is selected - * 0b0100100..GPIO0 Pin Event Trig 0 is selected - * 0b0100101..GPIO1 Pin Event Trig 0 input is selected - * 0b0100110..GPIO2 Pin Event Trig 0 input is selected - * 0b0100111..GPIO3 Pin Event Trig 0 input is selected - * 0b0101000..GPIO4 Pin Event Trig 0 input is selected - * 0b0101001..AOI1_OUT0 input is selected - * 0b0101010..AOI1_OUT1 input is selected - * 0b0101011..AOI1_OUT2 input is selected - * 0b0101100..AOI1_OUT3 input is selected - * 0b0101101..Reserved - * 0b0101110..Reserved - * 0b0101111..Reserved - * 0b0110000..Reserved - * 0b0110001..CTimer3_MAT2 input is selected - * 0b0110010..CTimer3_MAT3 input is selected - * 0b0110011..CTimer4_MAT2 input is selected - * 0b0110100..CTimer4_MAT3 End of Frame input is selected - * 0b0110101..Reserved - * 0b0110110..Reserved - * 0b0110111..Reserved - * 0b0111000..Reserved - * 0b0111001..Reserved - * 0b0111010..Reserved - * 0b0111011..Reserved - * 0b0111100..Reserved - * 0b0111101..Reserved - * 0b0111110..PWM1_SM0_OUT_TRIG0 input is selected - * 0b0111111..PWM1_SM0_OUT_TRIG1 input is selected - * 0b1000000..PWM1_SM1_OUT_TRIG0 input is selected - * 0b1000001..PWM1_SM1_OUT_TRIG1 input is selected - * 0b1000010..PWM1_SM2_OUT_TRIG0 input is selected - * 0b1000011..PWM1_SM2_OUT_TRIG1 input is selected - * 0b1000100..Reserved - * 0b1000101..Reserved - * *.. - */ -#define INPUTMUX_QDC0_ICAP2_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDC0_ICAP2_INP_SHIFT)) & INPUTMUX_QDC0_ICAP2_INP_MASK) -/*! @} */ - -/*! @name QDC0_ICAP3 - QDC0 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDC0_ICAP3_INP_MASK (0x7FU) -#define INPUTMUX_QDC0_ICAP3_INP_SHIFT (0U) -/*! INP - QDC0 input connections - * 0b0000000..Reserved - * 0b0000001..ARM_TXEV input is selected - * 0b0000010..AOI0_OUT0 input is selected - * 0b0000011..AOI0_OUT1 input is selected - * 0b0000100..AOI0_OUT2 input is selected - * 0b0000101..AOI0_OUT3 input is selected - * 0b0000110..CMP0_OUT input is selected - * 0b0000111..CMP1_OUT input is selected - * 0b0001000..Reserved - * 0b0001001..CTimer0_MAT2 input is selected - * 0b0001010..CTimer0_MAT3 - * 0b0001011..CTimer1_MAT2 input is selected - * 0b0001100..CTimer1_MAT3 input is selected - * 0b0001101..CTimer2_MAT2 input is selected - * 0b0001110..CTimer2_MAT3 input is selected - * 0b0001111..Reserved - * 0b0010000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b0010001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b0010010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0010011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b0010100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0010101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b0010110..Reserved - * 0b0010111..Reserved - * 0b0011000..TRIG_IN0 input is selected - * 0b0011001..TRIG_IN1 input is selected - * 0b0011010..TRIG_IN2 input is selected - * 0b0011011..TRIG_IN3 input is selected - * 0b0011100..TRIG_IN4 input is selected - * 0b0011101..TRIG_IN5 input is selected - * 0b0011110..TRIG_IN6 input is selected - * 0b0011111..TRIG_IN7 input is selected - * 0b0100000..TRIG_IN8 input is selected - * 0b0100001..TRIG_IN9 input is selected - * 0b0100010..TRIG_IN10 input is selected - * 0b0100011..TRIG_IN11 input is selected - * 0b0100100..GPIO0 Pin Event Trig 0 is selected - * 0b0100101..GPIO1 Pin Event Trig 0 input is selected - * 0b0100110..GPIO2 Pin Event Trig 0 input is selected - * 0b0100111..GPIO3 Pin Event Trig 0 input is selected - * 0b0101000..GPIO4 Pin Event Trig 0 input is selected - * 0b0101001..AOI1_OUT0 input is selected - * 0b0101010..AOI1_OUT1 input is selected - * 0b0101011..AOI1_OUT2 input is selected - * 0b0101100..AOI1_OUT3 input is selected - * 0b0101101..Reserved - * 0b0101110..Reserved - * 0b0101111..Reserved - * 0b0110000..Reserved - * 0b0110001..CTimer3_MAT2 input is selected - * 0b0110010..CTimer3_MAT3 input is selected - * 0b0110011..CTimer4_MAT2 input is selected - * 0b0110100..CTimer4_MAT3 End of Frame input is selected - * 0b0110101..Reserved - * 0b0110110..Reserved - * 0b0110111..Reserved - * 0b0111000..Reserved - * 0b0111001..Reserved - * 0b0111010..Reserved - * 0b0111011..Reserved - * 0b0111100..Reserved - * 0b0111101..Reserved - * 0b0111110..PWM1_SM0_OUT_TRIG0 input is selected - * 0b0111111..PWM1_SM0_OUT_TRIG1 input is selected - * 0b1000000..PWM1_SM1_OUT_TRIG0 input is selected - * 0b1000001..PWM1_SM1_OUT_TRIG1 input is selected - * 0b1000010..PWM1_SM2_OUT_TRIG0 input is selected - * 0b1000011..PWM1_SM2_OUT_TRIG1 input is selected - * 0b1000100..Reserved - * 0b1000101..Reserved - * *.. - */ -#define INPUTMUX_QDC0_ICAP3_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDC0_ICAP3_INP_SHIFT)) & INPUTMUX_QDC0_ICAP3_INP_MASK) -/*! @} */ - -/*! @name QDC1_TRIG - QDC1 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDC1_TRIG_INP_MASK (0x7FU) -#define INPUTMUX_QDC1_TRIG_INP_SHIFT (0U) -/*! INP - QDC1 input connections - * 0b0000000..Reserved - * 0b0000001..ARM_TXEV input is selected - * 0b0000010..AOI0_OUT0 input is selected - * 0b0000011..AOI0_OUT1 input is selected - * 0b0000100..AOI0_OUT2 input is selected - * 0b0000101..AOI0_OUT3 input is selected - * 0b0000110..CMP0_OUT input is selected - * 0b0000111..CMP1_OUT input is selected - * 0b0001000..Reserved - * 0b0001001..CTimer0_MAT2 input is selected - * 0b0001010..CTimer0_MAT3 - * 0b0001011..CTimer1_MAT2 input is selected - * 0b0001100..CTimer1_MAT3 input is selected - * 0b0001101..CTimer2_MAT2 input is selected - * 0b0001110..CTimer2_MAT3 input is selected - * 0b0001111..Reserved - * 0b0010000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b0010001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b0010010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0010011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b0010100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0010101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b0010110..Reserved - * 0b0010111..Reserved - * 0b0011000..TRIG_IN0 input is selected - * 0b0011001..TRIG_IN1 input is selected - * 0b0011010..TRIG_IN2 input is selected - * 0b0011011..TRIG_IN3 input is selected - * 0b0011100..TRIG_IN4 input is selected - * 0b0011101..TRIG_IN5 input is selected - * 0b0011110..TRIG_IN6 input is selected - * 0b0011111..TRIG_IN7 input is selected - * 0b0100000..TRIG_IN8 input is selected - * 0b0100001..TRIG_IN9 input is selected - * 0b0100010..TRIG_IN10 input is selected - * 0b0100011..TRIG_IN11 input is selected - * 0b0100100..GPIO0 Pin Event Trig 0 is selected - * 0b0100101..GPIO1 Pin Event Trig 0 input is selected - * 0b0100110..GPIO2 Pin Event Trig 0 input is selected - * 0b0100111..GPIO3 Pin Event Trig 0 input is selected - * 0b0101000..GPIO4 Pin Event Trig 0 input is selected - * 0b0101001..AOI1_OUT0 input is selected - * 0b0101010..AOI1_OUT1 input is selected - * 0b0101011..AOI1_OUT2 input is selected - * 0b0101100..AOI1_OUT3 input is selected - * 0b0101101..Reserved - * 0b0101110..Reserved - * 0b0101111..Reserved - * 0b0110000..Reserved - * 0b0110001..CTimer3_MAT2 input is selected - * 0b0110010..CTimer3_MAT3 input is selected - * 0b0110011..CTimer4_MAT2 input is selected - * 0b0110100..CTimer4_MAT3 End of Frame input is selected - * 0b0110101..Reserved - * 0b0110110..Reserved - * 0b0110111..Reserved - * 0b0111000..Reserved - * 0b0111001..Reserved - * 0b0111010..Reserved - * 0b0111011..Reserved - * 0b0111100..Reserved - * 0b0111101..Reserved - * 0b0111110..PWM1_SM0_OUT_TRIG0 input is selected - * 0b0111111..PWM1_SM0_OUT_TRIG1 input is selected - * 0b1000000..PWM1_SM1_OUT_TRIG0 input is selected - * 0b1000001..PWM1_SM1_OUT_TRIG1 input is selected - * 0b1000010..PWM1_SM2_OUT_TRIG0 input is selected - * 0b1000011..PWM1_SM2_OUT_TRIG1 input is selected - * 0b1000100..Reserved - * 0b1000101..Reserved - * *.. - */ -#define INPUTMUX_QDC1_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDC1_TRIG_INP_SHIFT)) & INPUTMUX_QDC1_TRIG_INP_MASK) -/*! @} */ - -/*! @name QDC1_HOME - QDC1 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDC1_HOME_INP_MASK (0x7FU) -#define INPUTMUX_QDC1_HOME_INP_SHIFT (0U) -/*! INP - QDC1 input connections - * 0b0000000..Reserved - * 0b0000001..ARM_TXEV input is selected - * 0b0000010..AOI0_OUT0 input is selected - * 0b0000011..AOI0_OUT1 input is selected - * 0b0000100..AOI0_OUT2 input is selected - * 0b0000101..AOI0_OUT3 input is selected - * 0b0000110..CMP0_OUT input is selected - * 0b0000111..CMP1_OUT input is selected - * 0b0001000..Reserved - * 0b0001001..CTimer0_MAT2 input is selected - * 0b0001010..CTimer0_MAT3 - * 0b0001011..CTimer1_MAT2 input is selected - * 0b0001100..CTimer1_MAT3 input is selected - * 0b0001101..CTimer2_MAT2 input is selected - * 0b0001110..CTimer2_MAT3 input is selected - * 0b0001111..Reserved - * 0b0010000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b0010001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b0010010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0010011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b0010100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0010101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b0010110..Reserved - * 0b0010111..Reserved - * 0b0011000..TRIG_IN0 input is selected - * 0b0011001..TRIG_IN1 input is selected - * 0b0011010..TRIG_IN2 input is selected - * 0b0011011..TRIG_IN3 input is selected - * 0b0011100..TRIG_IN4 input is selected - * 0b0011101..TRIG_IN5 input is selected - * 0b0011110..TRIG_IN6 input is selected - * 0b0011111..TRIG_IN7 input is selected - * 0b0100000..TRIG_IN8 input is selected - * 0b0100001..TRIG_IN9 input is selected - * 0b0100010..TRIG_IN10 input is selected - * 0b0100011..TRIG_IN11 input is selected - * 0b0100100..GPIO0 Pin Event Trig 0 is selected - * 0b0100101..GPIO1 Pin Event Trig 0 input is selected - * 0b0100110..GPIO2 Pin Event Trig 0 input is selected - * 0b0100111..GPIO3 Pin Event Trig 0 input is selected - * 0b0101000..GPIO4 Pin Event Trig 0 input is selected - * 0b0101001..AOI1_OUT0 input is selected - * 0b0101010..AOI1_OUT1 input is selected - * 0b0101011..AOI1_OUT2 input is selected - * 0b0101100..AOI1_OUT3 input is selected - * 0b0101101..Reserved - * 0b0101110..Reserved - * 0b0101111..Reserved - * 0b0110000..Reserved - * 0b0110001..CTimer3_MAT2 input is selected - * 0b0110010..CTimer3_MAT3 input is selected - * 0b0110011..CTimer4_MAT2 input is selected - * 0b0110100..CTimer4_MAT3 End of Frame input is selected - * 0b0110101..Reserved - * 0b0110110..Reserved - * 0b0110111..Reserved - * 0b0111000..Reserved - * 0b0111001..Reserved - * 0b0111010..Reserved - * 0b0111011..Reserved - * 0b0111100..Reserved - * 0b0111101..Reserved - * 0b0111110..PWM1_SM0_OUT_TRIG0 input is selected - * 0b0111111..PWM1_SM0_OUT_TRIG1 input is selected - * 0b1000000..PWM1_SM1_OUT_TRIG0 input is selected - * 0b1000001..PWM1_SM1_OUT_TRIG1 input is selected - * 0b1000010..PWM1_SM2_OUT_TRIG0 input is selected - * 0b1000011..PWM1_SM2_OUT_TRIG1 input is selected - * 0b1000100..Reserved - * 0b1000101..Reserved - * *.. - */ -#define INPUTMUX_QDC1_HOME_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDC1_HOME_INP_SHIFT)) & INPUTMUX_QDC1_HOME_INP_MASK) -/*! @} */ - -/*! @name QDC1_INDEX - QDC1 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDC1_INDEX_INP_MASK (0x7FU) -#define INPUTMUX_QDC1_INDEX_INP_SHIFT (0U) -/*! INP - QDC1 input connections - * 0b0000000..Reserved - * 0b0000001..ARM_TXEV input is selected - * 0b0000010..AOI0_OUT0 input is selected - * 0b0000011..AOI0_OUT1 input is selected - * 0b0000100..AOI0_OUT2 input is selected - * 0b0000101..AOI0_OUT3 input is selected - * 0b0000110..CMP0_OUT input is selected - * 0b0000111..CMP1_OUT input is selected - * 0b0001000..Reserved - * 0b0001001..CTimer0_MAT2 input is selected - * 0b0001010..CTimer0_MAT3 - * 0b0001011..CTimer1_MAT2 input is selected - * 0b0001100..CTimer1_MAT3 input is selected - * 0b0001101..CTimer2_MAT2 input is selected - * 0b0001110..CTimer2_MAT3 input is selected - * 0b0001111..Reserved - * 0b0010000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b0010001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b0010010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0010011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b0010100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0010101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b0010110..Reserved - * 0b0010111..Reserved - * 0b0011000..TRIG_IN0 input is selected - * 0b0011001..TRIG_IN1 input is selected - * 0b0011010..TRIG_IN2 input is selected - * 0b0011011..TRIG_IN3 input is selected - * 0b0011100..TRIG_IN4 input is selected - * 0b0011101..TRIG_IN5 input is selected - * 0b0011110..TRIG_IN6 input is selected - * 0b0011111..TRIG_IN7 input is selected - * 0b0100000..TRIG_IN8 input is selected - * 0b0100001..TRIG_IN9 input is selected - * 0b0100010..TRIG_IN10 input is selected - * 0b0100011..TRIG_IN11 input is selected - * 0b0100100..GPIO0 Pin Event Trig 0 is selected - * 0b0100101..GPIO1 Pin Event Trig 0 input is selected - * 0b0100110..GPIO2 Pin Event Trig 0 input is selected - * 0b0100111..GPIO3 Pin Event Trig 0 input is selected - * 0b0101000..GPIO4 Pin Event Trig 0 input is selected - * 0b0101001..AOI1_OUT0 input is selected - * 0b0101010..AOI1_OUT1 input is selected - * 0b0101011..AOI1_OUT2 input is selected - * 0b0101100..AOI1_OUT3 input is selected - * 0b0101101..Reserved - * 0b0101110..Reserved - * 0b0101111..Reserved - * 0b0110000..Reserved - * 0b0110001..CTimer3_MAT2 input is selected - * 0b0110010..CTimer3_MAT3 input is selected - * 0b0110011..CTimer4_MAT2 input is selected - * 0b0110100..CTimer4_MAT3 End of Frame input is selected - * 0b0110101..Reserved - * 0b0110110..Reserved - * 0b0110111..Reserved - * 0b0111000..Reserved - * 0b0111001..Reserved - * 0b0111010..Reserved - * 0b0111011..Reserved - * 0b0111100..Reserved - * 0b0111101..Reserved - * 0b0111110..PWM1_SM0_OUT_TRIG0 input is selected - * 0b0111111..PWM1_SM0_OUT_TRIG1 input is selected - * 0b1000000..PWM1_SM1_OUT_TRIG0 input is selected - * 0b1000001..PWM1_SM1_OUT_TRIG1 input is selected - * 0b1000010..PWM1_SM2_OUT_TRIG0 input is selected - * 0b1000011..PWM1_SM2_OUT_TRIG1 input is selected - * 0b1000100..Reserved - * 0b1000101..Reserved - * *.. - */ -#define INPUTMUX_QDC1_INDEX_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDC1_INDEX_INP_SHIFT)) & INPUTMUX_QDC1_INDEX_INP_MASK) -/*! @} */ - -/*! @name QDC1_PHASEB - QDC1 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDC1_PHASEB_INP_MASK (0x7FU) -#define INPUTMUX_QDC1_PHASEB_INP_SHIFT (0U) -/*! INP - QDC1 input connections - * 0b0000000..Reserved - * 0b0000001..ARM_TXEV input is selected - * 0b0000010..AOI0_OUT0 input is selected - * 0b0000011..AOI0_OUT1 input is selected - * 0b0000100..AOI0_OUT2 input is selected - * 0b0000101..AOI0_OUT3 input is selected - * 0b0000110..CMP0_OUT input is selected - * 0b0000111..CMP1_OUT input is selected - * 0b0001000..Reserved - * 0b0001001..CTimer0_MAT2 input is selected - * 0b0001010..CTimer0_MAT3 - * 0b0001011..CTimer1_MAT2 input is selected - * 0b0001100..CTimer1_MAT3 input is selected - * 0b0001101..CTimer2_MAT2 input is selected - * 0b0001110..CTimer2_MAT3 input is selected - * 0b0001111..Reserved - * 0b0010000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b0010001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b0010010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0010011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b0010100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0010101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b0010110..Reserved - * 0b0010111..Reserved - * 0b0011000..TRIG_IN0 input is selected - * 0b0011001..TRIG_IN1 input is selected - * 0b0011010..TRIG_IN2 input is selected - * 0b0011011..TRIG_IN3 input is selected - * 0b0011100..TRIG_IN4 input is selected - * 0b0011101..TRIG_IN5 input is selected - * 0b0011110..TRIG_IN6 input is selected - * 0b0011111..TRIG_IN7 input is selected - * 0b0100000..TRIG_IN8 input is selected - * 0b0100001..TRIG_IN9 input is selected - * 0b0100010..TRIG_IN10 input is selected - * 0b0100011..TRIG_IN11 input is selected - * 0b0100100..GPIO0 Pin Event Trig 0 is selected - * 0b0100101..GPIO1 Pin Event Trig 0 input is selected - * 0b0100110..GPIO2 Pin Event Trig 0 input is selected - * 0b0100111..GPIO3 Pin Event Trig 0 input is selected - * 0b0101000..GPIO4 Pin Event Trig 0 input is selected - * 0b0101001..AOI1_OUT0 input is selected - * 0b0101010..AOI1_OUT1 input is selected - * 0b0101011..AOI1_OUT2 input is selected - * 0b0101100..AOI1_OUT3 input is selected - * 0b0101101..Reserved - * 0b0101110..Reserved - * 0b0101111..Reserved - * 0b0110000..Reserved - * 0b0110001..CTimer3_MAT2 input is selected - * 0b0110010..CTimer3_MAT3 input is selected - * 0b0110011..CTimer4_MAT2 input is selected - * 0b0110100..CTimer4_MAT3 End of Frame input is selected - * 0b0110101..Reserved - * 0b0110110..Reserved - * 0b0110111..Reserved - * 0b0111000..Reserved - * 0b0111001..Reserved - * 0b0111010..Reserved - * 0b0111011..Reserved - * 0b0111100..Reserved - * 0b0111101..Reserved - * 0b0111110..PWM1_SM0_OUT_TRIG0 input is selected - * 0b0111111..PWM1_SM0_OUT_TRIG1 input is selected - * 0b1000000..PWM1_SM1_OUT_TRIG0 input is selected - * 0b1000001..PWM1_SM1_OUT_TRIG1 input is selected - * 0b1000010..PWM1_SM2_OUT_TRIG0 input is selected - * 0b1000011..PWM1_SM2_OUT_TRIG1 input is selected - * 0b1000100..Reserved - * 0b1000101..Reserved - * *.. - */ -#define INPUTMUX_QDC1_PHASEB_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDC1_PHASEB_INP_SHIFT)) & INPUTMUX_QDC1_PHASEB_INP_MASK) -/*! @} */ - -/*! @name QDC1_PHASEA - QDC1 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDC1_PHASEA_INP_MASK (0x7FU) -#define INPUTMUX_QDC1_PHASEA_INP_SHIFT (0U) -/*! INP - QDC0 input connections - * 0b0000000..Reserved - * 0b0000001..ARM_TXEV input is selected - * 0b0000010..AOI0_OUT0 input is selected - * 0b0000011..AOI0_OUT1 input is selected - * 0b0000100..AOI0_OUT2 input is selected - * 0b0000101..AOI0_OUT3 input is selected - * 0b0000110..CMP0_OUT input is selected - * 0b0000111..CMP1_OUT input is selected - * 0b0001000..Reserved - * 0b0001001..CTimer0_MAT2 input is selected - * 0b0001010..CTimer0_MAT3 - * 0b0001011..CTimer1_MAT2 input is selected - * 0b0001100..CTimer1_MAT3 input is selected - * 0b0001101..CTimer2_MAT2 input is selected - * 0b0001110..CTimer2_MAT3 input is selected - * 0b0001111..Reserved - * 0b0010000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b0010001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b0010010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0010011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b0010100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0010101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b0010110..Reserved - * 0b0010111..Reserved - * 0b0011000..TRIG_IN0 input is selected - * 0b0011001..TRIG_IN1 input is selected - * 0b0011010..TRIG_IN2 input is selected - * 0b0011011..TRIG_IN3 input is selected - * 0b0011100..TRIG_IN4 input is selected - * 0b0011101..TRIG_IN5 input is selected - * 0b0011110..TRIG_IN6 input is selected - * 0b0011111..TRIG_IN7 input is selected - * 0b0100000..TRIG_IN8 input is selected - * 0b0100001..TRIG_IN9 input is selected - * 0b0100010..TRIG_IN10 input is selected - * 0b0100011..TRIG_IN11 input is selected - * 0b0100100..GPIO0 Pin Event Trig 0 is selected - * 0b0100101..GPIO1 Pin Event Trig 0 input is selected - * 0b0100110..GPIO2 Pin Event Trig 0 input is selected - * 0b0100111..GPIO3 Pin Event Trig 0 input is selected - * 0b0101000..GPIO4 Pin Event Trig 0 input is selected - * 0b0101001..AOI1_OUT0 input is selected - * 0b0101010..AOI1_OUT1 input is selected - * 0b0101011..AOI1_OUT2 input is selected - * 0b0101100..AOI1_OUT3 input is selected - * 0b0101101..Reserved - * 0b0101110..Reserved - * 0b0101111..Reserved - * 0b0110000..Reserved - * 0b0110001..CTimer3_MAT2 input is selected - * 0b0110010..CTimer3_MAT3 input is selected - * 0b0110011..CTimer4_MAT2 input is selected - * 0b0110100..CTimer4_MAT3 End of Frame input is selected - * 0b0110101..Reserved - * 0b0110110..Reserved - * 0b0110111..Reserved - * 0b0111000..Reserved - * 0b0111001..Reserved - * 0b0111010..Reserved - * 0b0111011..Reserved - * 0b0111100..Reserved - * 0b0111101..Reserved - * 0b0111110..PWM1_SM0_OUT_TRIG0 input is selected - * 0b0111111..PWM1_SM0_OUT_TRIG1 input is selected - * 0b1000000..PWM1_SM1_OUT_TRIG0 input is selected - * 0b1000001..PWM1_SM1_OUT_TRIG1 input is selected - * 0b1000010..PWM1_SM2_OUT_TRIG0 input is selected - * 0b1000011..PWM1_SM2_OUT_TRIG1 input is selected - * 0b1000100..Reserved - * 0b1000101..Reserved - * *.. - */ -#define INPUTMUX_QDC1_PHASEA_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDC1_PHASEA_INP_SHIFT)) & INPUTMUX_QDC1_PHASEA_INP_MASK) -/*! @} */ - -/*! @name QDC1_ICAP1 - QDC1 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDC1_ICAP1_INP_MASK (0x7FU) -#define INPUTMUX_QDC1_ICAP1_INP_SHIFT (0U) -/*! INP - QDC1 input connections - * 0b0000000..Reserved - * 0b0000001..ARM_TXEV input is selected - * 0b0000010..AOI0_OUT0 input is selected - * 0b0000011..AOI0_OUT1 input is selected - * 0b0000100..AOI0_OUT2 input is selected - * 0b0000101..AOI0_OUT3 input is selected - * 0b0000110..CMP0_OUT input is selected - * 0b0000111..CMP1_OUT input is selected - * 0b0001000..Reserved - * 0b0001001..CTimer0_MAT2 input is selected - * 0b0001010..CTimer0_MAT3 - * 0b0001011..CTimer1_MAT2 input is selected - * 0b0001100..CTimer1_MAT3 input is selected - * 0b0001101..CTimer2_MAT2 input is selected - * 0b0001110..CTimer2_MAT3 input is selected - * 0b0001111..Reserved - * 0b0010000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b0010001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b0010010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0010011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b0010100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0010101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b0010110..Reserved - * 0b0010111..Reserved - * 0b0011000..TRIG_IN0 input is selected - * 0b0011001..TRIG_IN1 input is selected - * 0b0011010..TRIG_IN2 input is selected - * 0b0011011..TRIG_IN3 input is selected - * 0b0011100..TRIG_IN4 input is selected - * 0b0011101..TRIG_IN5 input is selected - * 0b0011110..TRIG_IN6 input is selected - * 0b0011111..TRIG_IN7 input is selected - * 0b0100000..TRIG_IN8 input is selected - * 0b0100001..TRIG_IN9 input is selected - * 0b0100010..TRIG_IN10 input is selected - * 0b0100011..TRIG_IN11 input is selected - * 0b0100100..GPIO0 Pin Event Trig 0 is selected - * 0b0100101..GPIO1 Pin Event Trig 0 input is selected - * 0b0100110..GPIO2 Pin Event Trig 0 input is selected - * 0b0100111..GPIO3 Pin Event Trig 0 input is selected - * 0b0101000..GPIO4 Pin Event Trig 0 input is selected - * 0b0101001..AOI1_OUT0 input is selected - * 0b0101010..AOI1_OUT1 input is selected - * 0b0101011..AOI1_OUT2 input is selected - * 0b0101100..AOI1_OUT3 input is selected - * 0b0101101..Reserved - * 0b0101110..Reserved - * 0b0101111..Reserved - * 0b0110000..Reserved - * 0b0110001..CTimer3_MAT2 input is selected - * 0b0110010..CTimer3_MAT3 input is selected - * 0b0110011..CTimer4_MAT2 input is selected - * 0b0110100..CTimer4_MAT3 End of Frame input is selected - * 0b0110101..Reserved - * 0b0110110..Reserved - * 0b0110111..Reserved - * 0b0111000..Reserved - * 0b0111001..Reserved - * 0b0111010..Reserved - * 0b0111011..Reserved - * 0b0111100..Reserved - * 0b0111101..Reserved - * 0b0111110..PWM1_SM0_OUT_TRIG0 input is selected - * 0b0111111..PWM1_SM0_OUT_TRIG1 input is selected - * 0b1000000..PWM1_SM1_OUT_TRIG0 input is selected - * 0b1000001..PWM1_SM1_OUT_TRIG1 input is selected - * 0b1000010..PWM1_SM2_OUT_TRIG0 input is selected - * 0b1000011..PWM1_SM2_OUT_TRIG1 input is selected - * 0b1000100..Reserved - * 0b1000101..Reserved - * *.. - */ -#define INPUTMUX_QDC1_ICAP1_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDC1_ICAP1_INP_SHIFT)) & INPUTMUX_QDC1_ICAP1_INP_MASK) -/*! @} */ - -/*! @name QDC1_ICAP2 - QDC1 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDC1_ICAP2_INP_MASK (0x7FU) -#define INPUTMUX_QDC1_ICAP2_INP_SHIFT (0U) -/*! INP - QDC1 input connections - * 0b0000000..Reserved - * 0b0000001..ARM_TXEV input is selected - * 0b0000010..AOI0_OUT0 input is selected - * 0b0000011..AOI0_OUT1 input is selected - * 0b0000100..AOI0_OUT2 input is selected - * 0b0000101..AOI0_OUT3 input is selected - * 0b0000110..CMP0_OUT input is selected - * 0b0000111..CMP1_OUT input is selected - * 0b0001000..Reserved - * 0b0001001..CTimer0_MAT2 input is selected - * 0b0001010..CTimer0_MAT3 - * 0b0001011..CTimer1_MAT2 input is selected - * 0b0001100..CTimer1_MAT3 input is selected - * 0b0001101..CTimer2_MAT2 input is selected - * 0b0001110..CTimer2_MAT3 input is selected - * 0b0001111..Reserved - * 0b0010000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b0010001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b0010010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0010011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b0010100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0010101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b0010110..Reserved - * 0b0010111..Reserved - * 0b0011000..TRIG_IN0 input is selected - * 0b0011001..TRIG_IN1 input is selected - * 0b0011010..TRIG_IN2 input is selected - * 0b0011011..TRIG_IN3 input is selected - * 0b0011100..TRIG_IN4 input is selected - * 0b0011101..TRIG_IN5 input is selected - * 0b0011110..TRIG_IN6 input is selected - * 0b0011111..TRIG_IN7 input is selected - * 0b0100000..TRIG_IN8 input is selected - * 0b0100001..TRIG_IN9 input is selected - * 0b0100010..TRIG_IN10 input is selected - * 0b0100011..TRIG_IN11 input is selected - * 0b0100100..GPIO0 Pin Event Trig 0 is selected - * 0b0100101..GPIO1 Pin Event Trig 0 input is selected - * 0b0100110..GPIO2 Pin Event Trig 0 input is selected - * 0b0100111..GPIO3 Pin Event Trig 0 input is selected - * 0b0101000..GPIO4 Pin Event Trig 0 input is selected - * 0b0101001..AOI1_OUT0 input is selected - * 0b0101010..AOI1_OUT1 input is selected - * 0b0101011..AOI1_OUT2 input is selected - * 0b0101100..AOI1_OUT3 input is selected - * 0b0101101..Reserved - * 0b0101110..Reserved - * 0b0101111..Reserved - * 0b0110000..Reserved - * 0b0110001..CTimer3_MAT2 input is selected - * 0b0110010..CTimer3_MAT3 input is selected - * 0b0110011..CTimer4_MAT2 input is selected - * 0b0110100..CTimer4_MAT3 End of Frame input is selected - * 0b0110101..Reserved - * 0b0110110..Reserved - * 0b0110111..Reserved - * 0b0111000..Reserved - * 0b0111001..Reserved - * 0b0111010..Reserved - * 0b0111011..Reserved - * 0b0111100..Reserved - * 0b0111101..Reserved - * 0b0111110..PWM1_SM0_OUT_TRIG0 input is selected - * 0b0111111..PWM1_SM0_OUT_TRIG1 input is selected - * 0b1000000..PWM1_SM1_OUT_TRIG0 input is selected - * 0b1000001..PWM1_SM1_OUT_TRIG1 input is selected - * 0b1000010..PWM1_SM2_OUT_TRIG0 input is selected - * 0b1000011..PWM1_SM2_OUT_TRIG1 input is selected - * 0b1000100..Reserved - * 0b1000101..Reserved - * *.. - */ -#define INPUTMUX_QDC1_ICAP2_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDC1_ICAP2_INP_SHIFT)) & INPUTMUX_QDC1_ICAP2_INP_MASK) -/*! @} */ - -/*! @name QDC1_ICAP3 - QDC1 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDC1_ICAP3_INP_MASK (0x7FU) -#define INPUTMUX_QDC1_ICAP3_INP_SHIFT (0U) -/*! INP - QDC1 input connections - * 0b0000000..Reserved - * 0b0000001..ARM_TXEV input is selected - * 0b0000010..AOI0_OUT0 input is selected - * 0b0000011..AOI0_OUT1 input is selected - * 0b0000100..AOI0_OUT2 input is selected - * 0b0000101..AOI0_OUT3 input is selected - * 0b0000110..CMP0_OUT input is selected - * 0b0000111..CMP1_OUT input is selected - * 0b0001000..Reserved - * 0b0001001..CTimer0_MAT2 input is selected - * 0b0001010..CTimer0_MAT3 - * 0b0001011..CTimer1_MAT2 input is selected - * 0b0001100..CTimer1_MAT3 input is selected - * 0b0001101..CTimer2_MAT2 input is selected - * 0b0001110..CTimer2_MAT3 input is selected - * 0b0001111..Reserved - * 0b0010000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b0010001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b0010010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0010011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b0010100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0010101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b0010110..Reserved - * 0b0010111..Reserved - * 0b0011000..TRIG_IN0 input is selected - * 0b0011001..TRIG_IN1 input is selected - * 0b0011010..TRIG_IN2 input is selected - * 0b0011011..TRIG_IN3 input is selected - * 0b0011100..TRIG_IN4 input is selected - * 0b0011101..TRIG_IN5 input is selected - * 0b0011110..TRIG_IN6 input is selected - * 0b0011111..TRIG_IN7 input is selected - * 0b0100000..TRIG_IN8 input is selected - * 0b0100001..TRIG_IN9 input is selected - * 0b0100010..TRIG_IN10 input is selected - * 0b0100011..TRIG_IN11 input is selected - * 0b0100100..GPIO0 Pin Event Trig 0 is selected - * 0b0100101..GPIO1 Pin Event Trig 0 input is selected - * 0b0100110..GPIO2 Pin Event Trig 0 input is selected - * 0b0100111..GPIO3 Pin Event Trig 0 input is selected - * 0b0101000..GPIO4 Pin Event Trig 0 input is selected - * 0b0101001..AOI1_OUT0 input is selected - * 0b0101010..AOI1_OUT1 input is selected - * 0b0101011..AOI1_OUT2 input is selected - * 0b0101100..AOI1_OUT3 input is selected - * 0b0101101..Reserved - * 0b0101110..Reserved - * 0b0101111..Reserved - * 0b0110000..Reserved - * 0b0110001..CTimer3_MAT2 input is selected - * 0b0110010..CTimer3_MAT3 input is selected - * 0b0110011..CTimer4_MAT2 input is selected - * 0b0110100..CTimer4_MAT3 End of Frame input is selected - * 0b0110101..Reserved - * 0b0110110..Reserved - * 0b0110111..Reserved - * 0b0111000..Reserved - * 0b0111001..Reserved - * 0b0111010..Reserved - * 0b0111011..Reserved - * 0b0111100..Reserved - * 0b0111101..Reserved - * 0b0111110..PWM1_SM0_OUT_TRIG0 input is selected - * 0b0111111..PWM1_SM0_OUT_TRIG1 input is selected - * 0b1000000..PWM1_SM1_OUT_TRIG0 input is selected - * 0b1000001..PWM1_SM1_OUT_TRIG1 input is selected - * 0b1000010..PWM1_SM2_OUT_TRIG0 input is selected - * 0b1000011..PWM1_SM2_OUT_TRIG1 input is selected - * 0b1000100..Reserved - * 0b1000101..Reserved - * *.. - */ -#define INPUTMUX_QDC1_ICAP3_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDC1_ICAP3_INP_SHIFT)) & INPUTMUX_QDC1_ICAP3_INP_MASK) -/*! @} */ - -/*! @name FLEXPWM0_SM0_EXTA0 - PWM0 input trigger connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM0_SM0_EXTA0_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM0_SM0_EXTA0_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXTA input connections for PWM0 - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_CMP_FLAG0 input is selected - * 0b010000..QDC0_CMP_FLAG1 input is selected - * 0b010001..QDC0_CMP_FLAG2 input is selected - * 0b010010..QDC0_CMP_FLAG3 input is selected - * 0b010011..QDC0_POS_MATCH0 input is selected - * 0b010100..TRIG_IN0 input is selected - * 0b010101..TRIG_IN1 input is selected - * 0b010110..TRIG_IN2 input is selected - * 0b010111..TRIG_IN3 input is selected - * 0b011000..TRIG_IN4 input is selected - * 0b011001..TRIG_IN5 input is selected - * 0b011010..TRIG_IN6 input is selected - * 0b011011..TRIG_IN7 input is selected - * 0b011100..TRIG_IN8 input is selected - * 0b011101..TRIG_IN9 input is selected - * 0b011110..TRIG_IN10 input is selected - * 0b011111..TRIG_IN11 input is selected - * 0b100000..GPIO0 Pin Event Trig 0 input is selected - * 0b100001..GPIO1 Pin Event Trig 0 input is selected - * 0b100010..GPIO2 Pin Event Trig 0 input is selected - * 0b100011..GPIO3 Pin Event Trig 0 input is selected - * 0b100100..GPIO4 Pin Event Trig 0 input is selected - * 0b100101..AOI1_OUT0 input is selected - * 0b100110..AOI1_OUT1 input is selected - * 0b100111..AOI1_OUT2 input is selected - * 0b101000..AOI1_OUT3 input is selected - * 0b101001..Reserved - * 0b101010..Reserved - * 0b101011..Reserved - * 0b101100..Reserved - * 0b101101..CTimer3_MAT2 input is selected - * 0b101110..CTimer3_MAT3 input is selected - * 0b101111..CTimer4_MAT2 input is selected - * 0b110000..CTimer4_MAT3 input is selected - * 0b110001..QDC1_CMP_FLAG0 input is selected - * 0b110010..QDC1_CMP_FLAG1 input is selected - * 0b110011..QDC1_CMP_FLAG2 input is selected - * 0b110100..QDC1_CMP_FLAG3 input is selected - * 0b110101..QDC1_POS_MATCH0 input is selected - * 0b110110..PWM1_SM0_MUX_TRIG0 input is selected - * 0b110111..PWM1_SM0_MUX_TRIG1 input is selected - * 0b111000..PWM1_SM1_MUX_TRIG0 input is selected - * 0b111001..PWM1_SM1_MUX_TRIG1 input is selected - * 0b111010..PWM1_SM2_MUX_TRIG0 input is selected - * 0b111011..PWM1_SM2_MUX_TRIG1 input is selected - * 0b111100..Reserved - * 0b111101..Reserved - * *.. - */ -#define INPUTMUX_FLEXPWM0_SM0_EXTA0_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM0_SM0_EXTA0_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM0_SM0_EXTA0_TRIGIN_MASK) -/*! @} */ - -/*! @name FLEXPWM0_SM0_EXTSYNC - PWM0 input trigger connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM0_SM0_EXTSYNC_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM0_SM0_EXTSYNC_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXTSYNC input connections for PWM0 - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_CMP_FLAG0 input is selected - * 0b010000..QDC0_CMP_FLAG1 input is selected - * 0b010001..QDC0_CMP_FLAG2 input is selected - * 0b010010..QDC0_CMP_FLAG3 input is selected - * 0b010011..QDC0_POS_MATCH0 input is selected - * 0b010100..TRIG_IN0 input is selected - * 0b010101..TRIG_IN1 input is selected - * 0b010110..TRIG_IN2 input is selected - * 0b010111..TRIG_IN3 input is selected - * 0b011000..TRIG_IN4 input is selected - * 0b011001..TRIG_IN5 input is selected - * 0b011010..TRIG_IN6 input is selected - * 0b011011..TRIG_IN7 input is selected - * 0b011100..TRIG_IN8 input is selected - * 0b011101..TRIG_IN9 input is selected - * 0b011110..TRIG_IN10 input is selected - * 0b011111..TRIG_IN11 input is selected - * 0b100000..GPIO0 Pin Event Trig 0 input is selected - * 0b100001..GPIO1 Pin Event Trig 0 input is selected - * 0b100010..GPIO2 Pin Event Trig 0 input is selected - * 0b100011..GPIO3 Pin Event Trig 0 input is selected - * 0b100100..GPIO4 Pin Event Trig 0 input is selected - * 0b100101..AOI1_OUT0 input is selected - * 0b100110..AOI1_OUT1 input is selected - * 0b100111..AOI1_OUT2 input is selected - * 0b101000..AOI1_OUT3 input is selected - * 0b101001..Reserved - * 0b101010..Reserved - * 0b101011..Reserved - * 0b101100..Reserved - * 0b101101..CTimer3_MAT2 input is selected - * 0b101110..CTimer3_MAT3 input is selected - * 0b101111..CTimer4_MAT2 input is selected - * 0b110000..CTimer4_MAT3 input is selected - * 0b110001..QDC1_CMP_FLAG0 input is selected - * 0b110010..QDC1_CMP_FLAG1 input is selected - * 0b110011..QDC1_CMP_FLAG2 input is selected - * 0b110100..QDC1_CMP_FLAG3 input is selected - * 0b110101..QDC1_POS_MATCH0 input is selected - * 0b110110..PWM1_SM0_MUX_TRIG0 input is selected - * 0b110111..PWM1_SM0_MUX_TRIG1 input is selected - * 0b111000..PWM1_SM1_MUX_TRIG0 input is selected - * 0b111001..PWM1_SM1_MUX_TRIG1 input is selected - * 0b111010..PWM1_SM2_MUX_TRIG0 input is selected - * 0b111011..PWM1_SM2_MUX_TRIG1 input is selected - * 0b111100..Reserved - * 0b111101..Reserved - * *.. - */ -#define INPUTMUX_FLEXPWM0_SM0_EXTSYNC_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM0_SM0_EXTSYNC_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM0_SM0_EXTSYNC_TRIGIN_MASK) -/*! @} */ - -/*! @name FLEXPWM0_SM1_EXTA - PWM0 input trigger connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM0_SM1_EXTA_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM0_SM1_EXTA_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXTA input connections for PWM0 - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_CMP_FLAG0 input is selected - * 0b010000..QDC0_CMP_FLAG1 input is selected - * 0b010001..QDC0_CMP_FLAG2 input is selected - * 0b010010..QDC0_CMP_FLAG3 input is selected - * 0b010011..QDC0_POS_MATCH0 input is selected - * 0b010100..TRIG_IN0 input is selected - * 0b010101..TRIG_IN1 input is selected - * 0b010110..TRIG_IN2 input is selected - * 0b010111..TRIG_IN3 input is selected - * 0b011000..TRIG_IN4 input is selected - * 0b011001..TRIG_IN5 input is selected - * 0b011010..TRIG_IN6 input is selected - * 0b011011..TRIG_IN7 input is selected - * 0b011100..TRIG_IN8 input is selected - * 0b011101..TRIG_IN9 input is selected - * 0b011110..TRIG_IN10 input is selected - * 0b011111..TRIG_IN11 input is selected - * 0b100000..GPIO0 Pin Event Trig 0 input is selected - * 0b100001..GPIO1 Pin Event Trig 0 input is selected - * 0b100010..GPIO2 Pin Event Trig 0 input is selected - * 0b100011..GPIO3 Pin Event Trig 0 input is selected - * 0b100100..GPIO4 Pin Event Trig 0 input is selected - * 0b100101..AOI1_OUT0 input is selected - * 0b100110..AOI1_OUT1 input is selected - * 0b100111..AOI1_OUT2 input is selected - * 0b101000..AOI1_OUT3 input is selected - * 0b101001..Reserved - * 0b101010..Reserved - * 0b101011..Reserved - * 0b101100..Reserved - * 0b101101..CTimer3_MAT2 input is selected - * 0b101110..CTimer3_MAT3 input is selected - * 0b101111..CTimer4_MAT2 input is selected - * 0b110000..CTimer4_MAT3 input is selected - * 0b110001..QDC1_CMP_FLAG0 input is selected - * 0b110010..QDC1_CMP_FLAG1 input is selected - * 0b110011..QDC1_CMP_FLAG2 input is selected - * 0b110100..QDC1_CMP_FLAG3 input is selected - * 0b110101..QDC1_POS_MATCH0 input is selected - * 0b110110..PWM1_SM0_MUX_TRIG0 input is selected - * 0b110111..PWM1_SM0_MUX_TRIG1 input is selected - * 0b111000..PWM1_SM1_MUX_TRIG0 input is selected - * 0b111001..PWM1_SM1_MUX_TRIG1 input is selected - * 0b111010..PWM1_SM2_MUX_TRIG0 input is selected - * 0b111011..PWM1_SM2_MUX_TRIG1 input is selected - * 0b111100..Reserved - * 0b111101..Reserved - * *.. - */ -#define INPUTMUX_FLEXPWM0_SM1_EXTA_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM0_SM1_EXTA_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM0_SM1_EXTA_TRIGIN_MASK) -/*! @} */ - -/*! @name FLEXPWM0_SM1_EXTSYNC - PWM0 input trigger connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM0_SM1_EXTSYNC_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM0_SM1_EXTSYNC_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXTSYNC input connections for PWM0 - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_CMP_FLAG0 input is selected - * 0b010000..QDC0_CMP_FLAG1 input is selected - * 0b010001..QDC0_CMP_FLAG2 input is selected - * 0b010010..QDC0_CMP_FLAG3 input is selected - * 0b010011..QDC0_POS_MATCH0 input is selected - * 0b010100..TRIG_IN0 input is selected - * 0b010101..TRIG_IN1 input is selected - * 0b010110..TRIG_IN2 input is selected - * 0b010111..TRIG_IN3 input is selected - * 0b011000..TRIG_IN4 input is selected - * 0b011001..TRIG_IN5 input is selected - * 0b011010..TRIG_IN6 input is selected - * 0b011011..TRIG_IN7 input is selected - * 0b011100..TRIG_IN8 input is selected - * 0b011101..TRIG_IN9 input is selected - * 0b011110..TRIG_IN10 input is selected - * 0b011111..TRIG_IN11 input is selected - * 0b100000..GPIO0 Pin Event Trig 0 input is selected - * 0b100001..GPIO1 Pin Event Trig 0 input is selected - * 0b100010..GPIO2 Pin Event Trig 0 input is selected - * 0b100011..GPIO3 Pin Event Trig 0 input is selected - * 0b100100..GPIO4 Pin Event Trig 0 input is selected - * 0b100101..AOI1_OUT0 input is selected - * 0b100110..AOI1_OUT1 input is selected - * 0b100111..AOI1_OUT2 input is selected - * 0b101000..AOI1_OUT3 input is selected - * 0b101001..Reserved - * 0b101010..Reserved - * 0b101011..Reserved - * 0b101100..Reserved - * 0b101101..CTimer3_MAT2 input is selected - * 0b101110..CTimer3_MAT3 input is selected - * 0b101111..CTimer4_MAT2 input is selected - * 0b110000..CTimer4_MAT3 input is selected - * 0b110001..QDC1_CMP_FLAG0 input is selected - * 0b110010..QDC1_CMP_FLAG1 input is selected - * 0b110011..QDC1_CMP_FLAG2 input is selected - * 0b110100..QDC1_CMP_FLAG3 input is selected - * 0b110101..QDC1_POS_MATCH0 input is selected - * 0b110110..PWM1_SM0_MUX_TRIG0 input is selected - * 0b110111..PWM1_SM0_MUX_TRIG1 input is selected - * 0b111000..PWM1_SM1_MUX_TRIG0 input is selected - * 0b111001..PWM1_SM1_MUX_TRIG1 input is selected - * 0b111010..PWM1_SM2_MUX_TRIG0 input is selected - * 0b111011..PWM1_SM2_MUX_TRIG1 input is selected - * 0b111100..Reserved - * 0b111101..Reserved - * *.. - */ -#define INPUTMUX_FLEXPWM0_SM1_EXTSYNC_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM0_SM1_EXTSYNC_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM0_SM1_EXTSYNC_TRIGIN_MASK) -/*! @} */ - -/*! @name FLEXPWM0_SM2_EXTA - PWM0 input trigger connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM0_SM2_EXTA_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM0_SM2_EXTA_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXTA input connections for PWM0 - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_CMP_FLAG0 input is selected - * 0b010000..QDC0_CMP_FLAG1 input is selected - * 0b010001..QDC0_CMP_FLAG2 input is selected - * 0b010010..QDC0_CMP_FLAG3 input is selected - * 0b010011..QDC0_POS_MATCH0 input is selected - * 0b010100..TRIG_IN0 input is selected - * 0b010101..TRIG_IN1 input is selected - * 0b010110..TRIG_IN2 input is selected - * 0b010111..TRIG_IN3 input is selected - * 0b011000..TRIG_IN4 input is selected - * 0b011001..TRIG_IN5 input is selected - * 0b011010..TRIG_IN6 input is selected - * 0b011011..TRIG_IN7 input is selected - * 0b011100..TRIG_IN8 input is selected - * 0b011101..TRIG_IN9 input is selected - * 0b011110..TRIG_IN10 input is selected - * 0b011111..TRIG_IN11 input is selected - * 0b100000..GPIO0 Pin Event Trig 0 input is selected - * 0b100001..GPIO1 Pin Event Trig 0 input is selected - * 0b100010..GPIO2 Pin Event Trig 0 input is selected - * 0b100011..GPIO3 Pin Event Trig 0 input is selected - * 0b100100..GPIO4 Pin Event Trig 0 input is selected - * 0b100101..AOI1_OUT0 input is selected - * 0b100110..AOI1_OUT1 input is selected - * 0b100111..AOI1_OUT2 input is selected - * 0b101000..AOI1_OUT3 input is selected - * 0b101001..Reserved - * 0b101010..Reserved - * 0b101011..Reserved - * 0b101100..Reserved - * 0b101101..CTimer3_MAT2 input is selected - * 0b101110..CTimer3_MAT3 input is selected - * 0b101111..CTimer4_MAT2 input is selected - * 0b110000..CTimer4_MAT3 input is selected - * 0b110001..QDC1_CMP_FLAG0 input is selected - * 0b110010..QDC1_CMP_FLAG1 input is selected - * 0b110011..QDC1_CMP_FLAG2 input is selected - * 0b110100..QDC1_CMP_FLAG3 input is selected - * 0b110101..QDC1_POS_MATCH0 input is selected - * 0b110110..PWM1_SM0_MUX_TRIG0 input is selected - * 0b110111..PWM1_SM0_MUX_TRIG1 input is selected - * 0b111000..PWM1_SM1_MUX_TRIG0 input is selected - * 0b111001..PWM1_SM1_MUX_TRIG1 input is selected - * 0b111010..PWM1_SM2_MUX_TRIG0 input is selected - * 0b111011..PWM1_SM2_MUX_TRIG1 input is selected - * 0b111100..Reserved - * 0b111101..Reserved - * *.. - */ -#define INPUTMUX_FLEXPWM0_SM2_EXTA_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM0_SM2_EXTA_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM0_SM2_EXTA_TRIGIN_MASK) -/*! @} */ - -/*! @name FLEXPWM0_SM2_EXTSYNC - PWM0 input trigger connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM0_SM2_EXTSYNC_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM0_SM2_EXTSYNC_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXTSYNC input connections for PWM0 - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_CMP_FLAG0 input is selected - * 0b010000..QDC0_CMP_FLAG1 input is selected - * 0b010001..QDC0_CMP_FLAG2 input is selected - * 0b010010..QDC0_CMP_FLAG3 input is selected - * 0b010011..QDC0_POS_MATCH0 input is selected - * 0b010100..TRIG_IN0 input is selected - * 0b010101..TRIG_IN1 input is selected - * 0b010110..TRIG_IN2 input is selected - * 0b010111..TRIG_IN3 input is selected - * 0b011000..TRIG_IN4 input is selected - * 0b011001..TRIG_IN5 input is selected - * 0b011010..TRIG_IN6 input is selected - * 0b011011..TRIG_IN7 input is selected - * 0b011100..TRIG_IN8 input is selected - * 0b011101..TRIG_IN9 input is selected - * 0b011110..TRIG_IN10 input is selected - * 0b011111..TRIG_IN11 input is selected - * 0b100000..GPIO0 Pin Event Trig 0 input is selected - * 0b100001..GPIO1 Pin Event Trig 0 input is selected - * 0b100010..GPIO2 Pin Event Trig 0 input is selected - * 0b100011..GPIO3 Pin Event Trig 0 input is selected - * 0b100100..GPIO4 Pin Event Trig 0 input is selected - * 0b100101..AOI1_OUT0 input is selected - * 0b100110..AOI1_OUT1 input is selected - * 0b100111..AOI1_OUT2 input is selected - * 0b101000..AOI1_OUT3 input is selected - * 0b101001..Reserved - * 0b101010..Reserved - * 0b101011..Reserved - * 0b101100..Reserved - * 0b101101..CTimer3_MAT2 input is selected - * 0b101110..CTimer3_MAT3 input is selected - * 0b101111..CTimer4_MAT2 input is selected - * 0b110000..CTimer4_MAT3 input is selected - * 0b110001..QDC1_CMP_FLAG0 input is selected - * 0b110010..QDC1_CMP_FLAG1 input is selected - * 0b110011..QDC1_CMP_FLAG2 input is selected - * 0b110100..QDC1_CMP_FLAG3 input is selected - * 0b110101..QDC1_POS_MATCH0 input is selected - * 0b110110..PWM1_SM0_MUX_TRIG0 input is selected - * 0b110111..PWM1_SM0_MUX_TRIG1 input is selected - * 0b111000..PWM1_SM1_MUX_TRIG0 input is selected - * 0b111001..PWM1_SM1_MUX_TRIG1 input is selected - * 0b111010..PWM1_SM2_MUX_TRIG0 input is selected - * 0b111011..PWM1_SM2_MUX_TRIG1 input is selected - * 0b111100..Reserved - * 0b111101..Reserved - * *.. - */ -#define INPUTMUX_FLEXPWM0_SM2_EXTSYNC_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM0_SM2_EXTSYNC_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM0_SM2_EXTSYNC_TRIGIN_MASK) -/*! @} */ - -/*! @name FLEXPWM0_FAULT - PWM0 Fault Input Trigger Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM0_FAULT_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM0_FAULT_TRIGIN_SHIFT (0U) -/*! TRIGIN - FAULT input connections for PWM0 - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_CMP_FLAG0 input is selected - * 0b010000..QDC0_CMP_FLAG1 input is selected - * 0b010001..QDC0_CMP_FLAG2 input is selected - * 0b010010..QDC0_CMP_FLAG3 input is selected - * 0b010011..QDC0_POS_MATCH0 input is selected - * 0b010100..TRIG_IN0 input is selected - * 0b010101..TRIG_IN1 input is selected - * 0b010110..TRIG_IN2 input is selected - * 0b010111..TRIG_IN3 input is selected - * 0b011000..TRIG_IN4 input is selected - * 0b011001..TRIG_IN5 input is selected - * 0b011010..TRIG_IN6 input is selected - * 0b011011..TRIG_IN7 input is selected - * 0b011100..TRIG_IN8 input is selected - * 0b011101..TRIG_IN9 input is selected - * 0b011110..TRIG_IN10 input is selected - * 0b011111..TRIG_IN11 input is selected - * 0b100000..GPIO0 Pin Event Trig 0 input is selected - * 0b100001..GPIO1 Pin Event Trig 0 input is selected - * 0b100010..GPIO2 Pin Event Trig 0 input is selected - * 0b100011..GPIO3 Pin Event Trig 0 input is selected - * 0b100100..GPIO4 Pin Event Trig 0 input is selected - * 0b100101..AOI1_OUT0 input is selected - * 0b100110..AOI1_OUT1 input is selected - * 0b100111..AOI1_OUT2 input is selected - * 0b101000..AOI1_OUT3 input is selected - * 0b101001..Reserved - * 0b101010..Reserved - * 0b101011..Reserved - * 0b101100..Reserved - * 0b101101..CTimer3_MAT2 input is selected - * 0b101110..CTimer3_MAT3 input is selected - * 0b101111..CTimer4_MAT2 input is selected - * 0b110000..CTimer4_MAT3 input is selected - * 0b110001..QDC1_CMP_FLAG0 input is selected - * 0b110010..QDC1_CMP_FLAG1 input is selected - * 0b110011..QDC1_CMP_FLAG2 input is selected - * 0b110100..QDC1_CMP_FLAG3 input is selected - * 0b110101..QDC1_POS_MATCH0 input is selected - * 0b110110..PWM1_SM0_MUX_TRIG0 input is selected - * 0b110111..PWM1_SM0_MUX_TRIG1 input is selected - * 0b111000..PWM1_SM1_MUX_TRIG0 input is selected - * 0b111001..PWM1_SM1_MUX_TRIG1 input is selected - * 0b111010..PWM1_SM2_MUX_TRIG0 input is selected - * 0b111011..PWM1_SM2_MUX_TRIG1 input is selected - * 0b111100..Reserved - * 0b111101..Reserved - * *.. - */ -#define INPUTMUX_FLEXPWM0_FAULT_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM0_FAULT_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM0_FAULT_TRIGIN_MASK) -/*! @} */ - -/* The count of INPUTMUX_FLEXPWM0_FAULT */ -#define INPUTMUX_FLEXPWM0_FAULT_COUNT (4U) - -/*! @name FLEXPWM0_FORCE - PWM0 input trigger connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM0_FORCE_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM0_FORCE_TRIGIN_SHIFT (0U) -/*! TRIGIN - Trigger input connections for PWM0 - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_CMP_FLAG0 input is selected - * 0b010000..QDC0_CMP_FLAG1 input is selected - * 0b010001..QDC0_CMP_FLAG2 input is selected - * 0b010010..QDC0_CMP_FLAG3 input is selected - * 0b010011..QDC0_POS_MATCH0 input is selected - * 0b010100..TRIG_IN0 input is selected - * 0b010101..TRIG_IN1 input is selected - * 0b010110..TRIG_IN2 input is selected - * 0b010111..TRIG_IN3 input is selected - * 0b011000..TRIG_IN4 input is selected - * 0b011001..TRIG_IN5 input is selected - * 0b011010..TRIG_IN6 input is selected - * 0b011011..TRIG_IN7 input is selected - * 0b011100..TRIG_IN8 input is selected - * 0b011101..TRIG_IN9 input is selected - * 0b011110..TRIG_IN10 input is selected - * 0b011111..TRIG_IN11 input is selected - * 0b100000..GPIO0 Pin Event Trig 0 input is selected - * 0b100001..GPIO1 Pin Event Trig 0 input is selected - * 0b100010..GPIO2 Pin Event Trig 0 input is selected - * 0b100011..GPIO3 Pin Event Trig 0 input is selected - * 0b100100..GPIO4 Pin Event Trig 0 input is selected - * 0b100101..AOI1_OUT0 input is selected - * 0b100110..AOI1_OUT1 input is selected - * 0b100111..AOI1_OUT2 input is selected - * 0b101000..AOI1_OUT3 input is selected - * 0b101001..Reserved - * 0b101010..Reserved - * 0b101011..Reserved - * 0b101100..Reserved - * 0b101101..CTimer3_MAT2 input is selected - * 0b101110..CTimer3_MAT3 input is selected - * 0b101111..CTimer4_MAT2 input is selected - * 0b110000..CTimer4_MAT3 input is selected - * 0b110001..QDC1_CMP_FLAG0 input is selected - * 0b110010..QDC1_CMP_FLAG1 input is selected - * 0b110011..QDC1_CMP_FLAG2 input is selected - * 0b110100..QDC1_CMP_FLAG3 input is selected - * 0b110101..QDC1_POS_MATCH0 input is selected - * 0b110110..PWM1_SM0_MUX_TRIG0 input is selected - * 0b110111..PWM1_SM0_MUX_TRIG1 input is selected - * 0b111000..PWM1_SM1_MUX_TRIG0 input is selected - * 0b111001..PWM1_SM1_MUX_TRIG1 input is selected - * 0b111010..PWM1_SM2_MUX_TRIG0 input is selected - * 0b111011..PWM1_SM2_MUX_TRIG1 input is selected - * 0b111100..Reserved - * 0b111101..Reserved - * *.. - */ -#define INPUTMUX_FLEXPWM0_FORCE_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM0_FORCE_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM0_FORCE_TRIGIN_MASK) -/*! @} */ - -/*! @name FLEXPWM1_SM0_EXTA0 - PWM1 input trigger connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM1_SM0_EXTA0_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM1_SM0_EXTA0_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXTA input connections for PWM0 - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_CMP_FLAG0 input is selected - * 0b010000..QDC0_CMP_FLAG1 input is selected - * 0b010001..QDC0_CMP_FLAG2 input is selected - * 0b010010..QDC0_CMP_FLAG3 input is selected - * 0b010011..QDC0_POS_MATCH0 input is selected - * 0b010100..TRIG_IN0 input is selected - * 0b010101..TRIG_IN1 input is selected - * 0b010110..TRIG_IN2 input is selected - * 0b010111..TRIG_IN3 input is selected - * 0b011000..TRIG_IN4 input is selected - * 0b011001..TRIG_IN5 input is selected - * 0b011010..TRIG_IN6 input is selected - * 0b011011..TRIG_IN7 input is selected - * 0b011100..TRIG_IN8 input is selected - * 0b011101..TRIG_IN9 input is selected - * 0b011110..TRIG_IN10 input is selected - * 0b011111..TRIG_IN11 input is selected - * 0b100000..GPIO0 Pin Event Trig 0 input is selected - * 0b100001..GPIO1 Pin Event Trig 0 input is selected - * 0b100010..GPIO2 Pin Event Trig 0 input is selected - * 0b100011..GPIO3 Pin Event Trig 0 input is selected - * 0b100100..GPIO4 Pin Event Trig 0 input is selected - * 0b100101..AOI1_OUT0 input is selected - * 0b100110..AOI1_OUT1 input is selected - * 0b100111..AOI1_OUT2 input is selected - * 0b101000..AOI1_OUT3 input is selected - * 0b101001..Reserved - * 0b101010..Reserved - * 0b101011..Reserved - * 0b101100..Reserved - * 0b101101..CTimer3_MAT2 input is selected - * 0b101110..CTimer3_MAT3 input is selected - * 0b101111..CTimer4_MAT2 input is selected - * 0b110000..CTimer4_MAT3 input is selected - * 0b110001..QDC1_CMP_FLAG0 input is selected - * 0b110010..QDC1_CMP_FLAG1 input is selected - * 0b110011..QDC1_CMP_FLAG2 input is selected - * 0b110100..QDC1_CMP_FLAG3 input is selected - * 0b110101..QDC1_POS_MATCH0 input is selected - * 0b110110..PWM0_SM0_MUX_TRIG0 input is selected - * 0b110111..PWM0_SM0_MUX_TRIG1 input is selected - * 0b111000..PWM0_SM1_MUX_TRIG0 input is selected - * 0b111001..PWM0_SM1_MUX_TRIG1 input is selected - * 0b111010..PWM0_SM2_MUX_TRIG0 input is selected - * 0b111011..PWM0_SM2_MUX_TRIG1 input is selected - * 0b111100..Reserved - * 0b111101..Reserved - * *.. - */ -#define INPUTMUX_FLEXPWM1_SM0_EXTA0_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM1_SM0_EXTA0_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM1_SM0_EXTA0_TRIGIN_MASK) -/*! @} */ - -/*! @name FLEXPWM1_SM0_EXTSYNC - PWM1 input trigger connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM1_SM0_EXTSYNC_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM1_SM0_EXTSYNC_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXTSYNC input connections for PWM0 - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_CMP_FLAG0 input is selected - * 0b010000..QDC0_CMP_FLAG1 input is selected - * 0b010001..QDC0_CMP_FLAG2 input is selected - * 0b010010..QDC0_CMP_FLAG3 input is selected - * 0b010011..QDC0_POS_MATCH0 input is selected - * 0b010100..TRIG_IN0 input is selected - * 0b010101..TRIG_IN1 input is selected - * 0b010110..TRIG_IN2 input is selected - * 0b010111..TRIG_IN3 input is selected - * 0b011000..TRIG_IN4 input is selected - * 0b011001..TRIG_IN5 input is selected - * 0b011010..TRIG_IN6 input is selected - * 0b011011..TRIG_IN7 input is selected - * 0b011100..TRIG_IN8 input is selected - * 0b011101..TRIG_IN9 input is selected - * 0b011110..TRIG_IN10 input is selected - * 0b011111..TRIG_IN11 input is selected - * 0b100000..GPIO0 Pin Event Trig 0 input is selected - * 0b100001..GPIO1 Pin Event Trig 0 input is selected - * 0b100010..GPIO2 Pin Event Trig 0 input is selected - * 0b100011..GPIO3 Pin Event Trig 0 input is selected - * 0b100100..GPIO4 Pin Event Trig 0 input is selected - * 0b100101..AOI1_OUT0 input is selected - * 0b100110..AOI1_OUT1 input is selected - * 0b100111..AOI1_OUT2 input is selected - * 0b101000..AOI1_OUT3 input is selected - * 0b101001..Reserved - * 0b101010..Reserved - * 0b101011..Reserved - * 0b101100..Reserved - * 0b101101..CTimer3_MAT2 input is selected - * 0b101110..CTimer3_MAT3 input is selected - * 0b101111..CTimer4_MAT2 input is selected - * 0b110000..CTimer4_MAT3 input is selected - * 0b110001..QDC1_CMP_FLAG0 input is selected - * 0b110010..QDC1_CMP_FLAG1 input is selected - * 0b110011..QDC1_CMP_FLAG2 input is selected - * 0b110100..QDC1_CMP_FLAG3 input is selected - * 0b110101..QDC1_POS_MATCH0 input is selected - * 0b110110..PWM0_SM0_MUX_TRIG0 input is selected - * 0b110111..PWM0_SM0_MUX_TRIG1 input is selected - * 0b111000..PWM0_SM1_MUX_TRIG0 input is selected - * 0b111001..PWM0_SM1_MUX_TRIG1 input is selected - * 0b111010..PWM0_SM2_MUX_TRIG0 input is selected - * 0b111011..PWM0_SM2_MUX_TRIG1 input is selected - * 0b111100..Reserved - * 0b111101..Reserved - * *.. - */ -#define INPUTMUX_FLEXPWM1_SM0_EXTSYNC_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM1_SM0_EXTSYNC_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM1_SM0_EXTSYNC_TRIGIN_MASK) -/*! @} */ - -/*! @name FLEXPWM1_SM1_EXTA - PWM1 input trigger connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM1_SM1_EXTA_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM1_SM1_EXTA_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXTA input connections for PWM0 - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_CMP_FLAG0 input is selected - * 0b010000..QDC0_CMP_FLAG1 input is selected - * 0b010001..QDC0_CMP_FLAG2 input is selected - * 0b010010..QDC0_CMP_FLAG3 input is selected - * 0b010011..QDC0_POS_MATCH0 input is selected - * 0b010100..TRIG_IN0 input is selected - * 0b010101..TRIG_IN1 input is selected - * 0b010110..TRIG_IN2 input is selected - * 0b010111..TRIG_IN3 input is selected - * 0b011000..TRIG_IN4 input is selected - * 0b011001..TRIG_IN5 input is selected - * 0b011010..TRIG_IN6 input is selected - * 0b011011..TRIG_IN7 input is selected - * 0b011100..TRIG_IN8 input is selected - * 0b011101..TRIG_IN9 input is selected - * 0b011110..TRIG_IN10 input is selected - * 0b011111..TRIG_IN11 input is selected - * 0b100000..GPIO0 Pin Event Trig 0 input is selected - * 0b100001..GPIO1 Pin Event Trig 0 input is selected - * 0b100010..GPIO2 Pin Event Trig 0 input is selected - * 0b100011..GPIO3 Pin Event Trig 0 input is selected - * 0b100100..GPIO4 Pin Event Trig 0 input is selected - * 0b100101..AOI1_OUT0 input is selected - * 0b100110..AOI1_OUT1 input is selected - * 0b100111..AOI1_OUT2 input is selected - * 0b101000..AOI1_OUT3 input is selected - * 0b101001..Reserved - * 0b101010..Reserved - * 0b101011..Reserved - * 0b101100..Reserved - * 0b101101..CTimer3_MAT2 input is selected - * 0b101110..CTimer3_MAT3 input is selected - * 0b101111..CTimer4_MAT2 input is selected - * 0b110000..CTimer4_MAT3 input is selected - * 0b110001..QDC1_CMP_FLAG0 input is selected - * 0b110010..QDC1_CMP_FLAG1 input is selected - * 0b110011..QDC1_CMP_FLAG2 input is selected - * 0b110100..QDC1_CMP_FLAG3 input is selected - * 0b110101..QDC1_POS_MATCH0 input is selected - * 0b110110..PWM0_SM0_MUX_TRIG0 input is selected - * 0b110111..PWM0_SM0_MUX_TRIG1 input is selected - * 0b111000..PWM0_SM1_MUX_TRIG0 input is selected - * 0b111001..PWM0_SM1_MUX_TRIG1 input is selected - * 0b111010..PWM0_SM2_MUX_TRIG0 input is selected - * 0b111011..PWM0_SM2_MUX_TRIG1 input is selected - * 0b111100..Reserved - * 0b111101..Reserved - * *.. - */ -#define INPUTMUX_FLEXPWM1_SM1_EXTA_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM1_SM1_EXTA_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM1_SM1_EXTA_TRIGIN_MASK) -/*! @} */ - -/*! @name FLEXPWM1_SM1_EXTSYNC - PWM1 input trigger connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM1_SM1_EXTSYNC_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM1_SM1_EXTSYNC_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXTSYNC input connections for PWM0 - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_CMP_FLAG0 input is selected - * 0b010000..QDC0_CMP_FLAG1 input is selected - * 0b010001..QDC0_CMP_FLAG2 input is selected - * 0b010010..QDC0_CMP_FLAG3 input is selected - * 0b010011..QDC0_POS_MATCH0 input is selected - * 0b010100..TRIG_IN0 input is selected - * 0b010101..TRIG_IN1 input is selected - * 0b010110..TRIG_IN2 input is selected - * 0b010111..TRIG_IN3 input is selected - * 0b011000..TRIG_IN4 input is selected - * 0b011001..TRIG_IN5 input is selected - * 0b011010..TRIG_IN6 input is selected - * 0b011011..TRIG_IN7 input is selected - * 0b011100..TRIG_IN8 input is selected - * 0b011101..TRIG_IN9 input is selected - * 0b011110..TRIG_IN10 input is selected - * 0b011111..TRIG_IN11 input is selected - * 0b100000..GPIO0 Pin Event Trig 0 input is selected - * 0b100001..GPIO1 Pin Event Trig 0 input is selected - * 0b100010..GPIO2 Pin Event Trig 0 input is selected - * 0b100011..GPIO3 Pin Event Trig 0 input is selected - * 0b100100..GPIO4 Pin Event Trig 0 input is selected - * 0b100101..AOI1_OUT0 input is selected - * 0b100110..AOI1_OUT1 input is selected - * 0b100111..AOI1_OUT2 input is selected - * 0b101000..AOI1_OUT3 input is selected - * 0b101001..Reserved - * 0b101010..Reserved - * 0b101011..Reserved - * 0b101100..Reserved - * 0b101101..CTimer3_MAT2 input is selected - * 0b101110..CTimer3_MAT3 input is selected - * 0b101111..CTimer4_MAT2 input is selected - * 0b110000..CTimer4_MAT3 input is selected - * 0b110001..QDC1_CMP_FLAG0 input is selected - * 0b110010..QDC1_CMP_FLAG1 input is selected - * 0b110011..QDC1_CMP_FLAG2 input is selected - * 0b110100..QDC1_CMP_FLAG3 input is selected - * 0b110101..QDC1_POS_MATCH0 input is selected - * 0b110110..PWM0_SM0_MUX_TRIG0 input is selected - * 0b110111..PWM0_SM0_MUX_TRIG1 input is selected - * 0b111000..PWM0_SM1_MUX_TRIG0 input is selected - * 0b111001..PWM0_SM1_MUX_TRIG1 input is selected - * 0b111010..PWM0_SM2_MUX_TRIG0 input is selected - * 0b111011..PWM0_SM2_MUX_TRIG1 input is selected - * 0b111100..Reserved - * 0b111101..Reserved - * *.. - */ -#define INPUTMUX_FLEXPWM1_SM1_EXTSYNC_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM1_SM1_EXTSYNC_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM1_SM1_EXTSYNC_TRIGIN_MASK) -/*! @} */ - -/*! @name FLEXPWM1_SM2_EXTA - PWM1 input trigger connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM1_SM2_EXTA_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM1_SM2_EXTA_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXTA input connections for PWM0 - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_CMP_FLAG0 input is selected - * 0b010000..QDC0_CMP_FLAG1 input is selected - * 0b010001..QDC0_CMP_FLAG2 input is selected - * 0b010010..QDC0_CMP_FLAG3 input is selected - * 0b010011..QDC0_POS_MATCH0 input is selected - * 0b010100..TRIG_IN0 input is selected - * 0b010101..TRIG_IN1 input is selected - * 0b010110..TRIG_IN2 input is selected - * 0b010111..TRIG_IN3 input is selected - * 0b011000..TRIG_IN4 input is selected - * 0b011001..TRIG_IN5 input is selected - * 0b011010..TRIG_IN6 input is selected - * 0b011011..TRIG_IN7 input is selected - * 0b011100..TRIG_IN8 input is selected - * 0b011101..TRIG_IN9 input is selected - * 0b011110..TRIG_IN10 input is selected - * 0b011111..TRIG_IN11 input is selected - * 0b100000..GPIO0 Pin Event Trig 0 input is selected - * 0b100001..GPIO1 Pin Event Trig 0 input is selected - * 0b100010..GPIO2 Pin Event Trig 0 input is selected - * 0b100011..GPIO3 Pin Event Trig 0 input is selected - * 0b100100..GPIO4 Pin Event Trig 0 input is selected - * 0b100101..AOI1_OUT0 input is selected - * 0b100110..AOI1_OUT1 input is selected - * 0b100111..AOI1_OUT2 input is selected - * 0b101000..AOI1_OUT3 input is selected - * 0b101001..Reserved - * 0b101010..Reserved - * 0b101011..Reserved - * 0b101100..Reserved - * 0b101101..CTimer3_MAT2 input is selected - * 0b101110..CTimer3_MAT3 input is selected - * 0b101111..CTimer4_MAT2 input is selected - * 0b110000..CTimer4_MAT3 input is selected - * 0b110001..QDC1_CMP_FLAG0 input is selected - * 0b110010..QDC1_CMP_FLAG1 input is selected - * 0b110011..QDC1_CMP_FLAG2 input is selected - * 0b110100..QDC1_CMP_FLAG3 input is selected - * 0b110101..QDC1_POS_MATCH0 input is selected - * 0b110110..PWM0_SM0_MUX_TRIG0 input is selected - * 0b110111..PWM0_SM0_MUX_TRIG1 input is selected - * 0b111000..PWM0_SM1_MUX_TRIG0 input is selected - * 0b111001..PWM0_SM1_MUX_TRIG1 input is selected - * 0b111010..PWM0_SM2_MUX_TRIG0 input is selected - * 0b111011..PWM0_SM2_MUX_TRIG1 input is selected - * 0b111100..Reserved - * 0b111101..Reserved - * *.. - */ -#define INPUTMUX_FLEXPWM1_SM2_EXTA_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM1_SM2_EXTA_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM1_SM2_EXTA_TRIGIN_MASK) -/*! @} */ - -/*! @name FLEXPWM1_SM2_EXTSYNC - PWM1 input trigger connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM1_SM2_EXTSYNC_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM1_SM2_EXTSYNC_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXTSYNC input connections for PWM0 - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_CMP_FLAG0 input is selected - * 0b010000..QDC0_CMP_FLAG1 input is selected - * 0b010001..QDC0_CMP_FLAG2 input is selected - * 0b010010..QDC0_CMP_FLAG3 input is selected - * 0b010011..QDC0_POS_MATCH0 input is selected - * 0b010100..TRIG_IN0 input is selected - * 0b010101..TRIG_IN1 input is selected - * 0b010110..TRIG_IN2 input is selected - * 0b010111..TRIG_IN3 input is selected - * 0b011000..TRIG_IN4 input is selected - * 0b011001..TRIG_IN5 input is selected - * 0b011010..TRIG_IN6 input is selected - * 0b011011..TRIG_IN7 input is selected - * 0b011100..TRIG_IN8 input is selected - * 0b011101..TRIG_IN9 input is selected - * 0b011110..TRIG_IN10 input is selected - * 0b011111..TRIG_IN11 input is selected - * 0b100000..GPIO0 Pin Event Trig 0 input is selected - * 0b100001..GPIO1 Pin Event Trig 0 input is selected - * 0b100010..GPIO2 Pin Event Trig 0 input is selected - * 0b100011..GPIO3 Pin Event Trig 0 input is selected - * 0b100100..GPIO4 Pin Event Trig 0 input is selected - * 0b100101..AOI1_OUT0 input is selected - * 0b100110..AOI1_OUT1 input is selected - * 0b100111..AOI1_OUT2 input is selected - * 0b101000..AOI1_OUT3 input is selected - * 0b101001..Reserved - * 0b101010..Reserved - * 0b101011..Reserved - * 0b101100..Reserved - * 0b101101..CTimer3_MAT2 input is selected - * 0b101110..CTimer3_MAT3 input is selected - * 0b101111..CTimer4_MAT2 input is selected - * 0b110000..CTimer4_MAT3 input is selected - * 0b110001..QDC1_CMP_FLAG0 input is selected - * 0b110010..QDC1_CMP_FLAG1 input is selected - * 0b110011..QDC1_CMP_FLAG2 input is selected - * 0b110100..QDC1_CMP_FLAG3 input is selected - * 0b110101..QDC1_POS_MATCH0 input is selected - * 0b110110..PWM0_SM0_MUX_TRIG0 input is selected - * 0b110111..PWM0_SM0_MUX_TRIG1 input is selected - * 0b111000..PWM0_SM1_MUX_TRIG0 input is selected - * 0b111001..PWM0_SM1_MUX_TRIG1 input is selected - * 0b111010..PWM0_SM2_MUX_TRIG0 input is selected - * 0b111011..PWM0_SM2_MUX_TRIG1 input is selected - * 0b111100..Reserved - * 0b111101..Reserved - * *.. - */ -#define INPUTMUX_FLEXPWM1_SM2_EXTSYNC_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM1_SM2_EXTSYNC_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM1_SM2_EXTSYNC_TRIGIN_MASK) -/*! @} */ - -/*! @name FLEXPWM1_FAULT - PWM1 Fault Input Trigger Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM1_FAULT_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM1_FAULT_TRIGIN_SHIFT (0U) -/*! TRIGIN - FAULT input connections for PWM1 - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_CMP_FLAG0 input is selected - * 0b010000..QDC0_CMP_FLAG1 input is selected - * 0b010001..QDC0_CMP_FLAG2 input is selected - * 0b010010..QDC0_CMP_FLAG3 input is selected - * 0b010011..QDC0_POS_MATCH0 input is selected - * 0b010100..TRIG_IN0 input is selected - * 0b010101..TRIG_IN1 input is selected - * 0b010110..TRIG_IN2 input is selected - * 0b010111..TRIG_IN3 input is selected - * 0b011000..TRIG_IN4 input is selected - * 0b011001..TRIG_IN5 input is selected - * 0b011010..TRIG_IN6 input is selected - * 0b011011..TRIG_IN7 input is selected - * 0b011100..TRIG_IN8 input is selected - * 0b011101..TRIG_IN9 input is selected - * 0b011110..TRIG_IN10 input is selected - * 0b011111..TRIG_IN11 input is selected - * 0b100000..GPIO0 Pin Event Trig 0 input is selected - * 0b100001..GPIO1 Pin Event Trig 0 input is selected - * 0b100010..GPIO2 Pin Event Trig 0 input is selected - * 0b100011..GPIO3 Pin Event Trig 0 input is selected - * 0b100100..GPIO4 Pin Event Trig 0 input is selected - * 0b100101..AOI1_OUT0 input is selected - * 0b100110..AOI1_OUT1 input is selected - * 0b100111..AOI1_OUT2 input is selected - * 0b101000..AOI1_OUT3 input is selected - * 0b101001..Reserved - * 0b101010..Reserved - * 0b101011..Reserved - * 0b101100..Reserved - * 0b101101..CTimer3_MAT2 input is selected - * 0b101110..CTimer3_MAT3 input is selected - * 0b101111..CTimer4_MAT2 input is selected - * 0b110000..CTimer4_MAT3 input is selected - * 0b110001..QDC1_CMP_FLAG0 input is selected - * 0b110010..QDC1_CMP_FLAG1 input is selected - * 0b110011..QDC1_CMP_FLAG2 input is selected - * 0b110100..QDC1_CMP_FLAG3 input is selected - * 0b110101..QDC1_POS_MATCH0 input is selected - * 0b110110..PWM0_SM0_MUX_TRIG0 input is selected - * 0b110111..PWM0_SM0_MUX_TRIG1 input is selected - * 0b111000..PWM0_SM1_MUX_TRIG0 input is selected - * 0b111001..PWM0_SM1_MUX_TRIG1 input is selected - * 0b111010..PWM0_SM2_MUX_TRIG0 input is selected - * 0b111011..PWM0_SM2_MUX_TRIG1 input is selected - * 0b111100..Reserved - * 0b111101..Reserved - * *.. - */ -#define INPUTMUX_FLEXPWM1_FAULT_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM1_FAULT_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM1_FAULT_TRIGIN_MASK) -/*! @} */ - -/* The count of INPUTMUX_FLEXPWM1_FAULT */ -#define INPUTMUX_FLEXPWM1_FAULT_COUNT (4U) - -/*! @name FLEXPWM1_FORCE - PWM1 input trigger connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM1_FORCE_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM1_FORCE_TRIGIN_SHIFT (0U) -/*! TRIGIN - Trigger input connections for PWM1 - * 0b000000..Reserved - * 0b000001..ARM_TXEV input is selected - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..QDC0_CMP_FLAG0 input is selected - * 0b010000..QDC0_CMP_FLAG1 input is selected - * 0b010001..QDC0_CMP_FLAG2 input is selected - * 0b010010..QDC0_CMP_FLAG3 input is selected - * 0b010011..QDC0_POS_MATCH0 input is selected - * 0b010100..TRIG_IN0 input is selected - * 0b010101..TRIG_IN1 input is selected - * 0b010110..TRIG_IN2 input is selected - * 0b010111..TRIG_IN3 input is selected - * 0b011000..TRIG_IN4 input is selected - * 0b011001..TRIG_IN5 input is selected - * 0b011010..TRIG_IN6 input is selected - * 0b011011..TRIG_IN7 input is selected - * 0b011100..TRIG_IN8 input is selected - * 0b011101..TRIG_IN9 input is selected - * 0b011110..TRIG_IN10 input is selected - * 0b011111..TRIG_IN11 input is selected - * 0b100000..GPIO0 Pin Event Trig 0 input is selected - * 0b100001..GPIO1 Pin Event Trig 0 input is selected - * 0b100010..GPIO2 Pin Event Trig 0 input is selected - * 0b100011..GPIO3 Pin Event Trig 0 input is selected - * 0b100100..GPIO4 Pin Event Trig 0 input is selected - * 0b100101..AOI1_OUT0 input is selected - * 0b100110..AOI1_OUT1 input is selected - * 0b100111..AOI1_OUT2 input is selected - * 0b101000..AOI1_OUT3 input is selected - * 0b101001..Reserved - * 0b101010..Reserved - * 0b101011..Reserved - * 0b101100..Reserved - * 0b101101..CTimer3_MAT2 input is selected - * 0b101110..CTimer3_MAT3 input is selected - * 0b101111..CTimer4_MAT2 input is selected - * 0b110000..CTimer4_MAT3 input is selected - * 0b110001..QDC1_CMP_FLAG0 input is selected - * 0b110010..QDC1_CMP_FLAG1 input is selected - * 0b110011..QDC1_CMP_FLAG2 input is selected - * 0b110100..QDC1_CMP_FLAG3 input is selected - * 0b110101..QDC1_POS_MATCH0 input is selected - * 0b110110..PWM0_SM0_MUX_TRIG0 input is selected - * 0b110111..PWM0_SM0_MUX_TRIG1 input is selected - * 0b111000..PWM0_SM1_MUX_TRIG0 input is selected - * 0b111001..PWM0_SM1_MUX_TRIG1 input is selected - * 0b111010..PWM0_SM2_MUX_TRIG0 input is selected - * 0b111011..PWM0_SM2_MUX_TRIG1 input is selected - * 0b111100..Reserved - * 0b111101..Reserved - * *.. - */ -#define INPUTMUX_FLEXPWM1_FORCE_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM1_FORCE_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM1_FORCE_TRIGIN_MASK) -/*! @} */ - -/*! @name PWM0_EXT_CLK - PWM0 external clock trigger */ -/*! @{ */ - -#define INPUTMUX_PWM0_EXT_CLK_TRIGIN_MASK (0xFU) -#define INPUTMUX_PWM0_EXT_CLK_TRIGIN_SHIFT (0U) -/*! TRIGIN - Trigger input connections for PWM - * 0b0000..Reserved - * 0b0001..clk_16k[1] input is selected - * 0b0010..clk_in input is selected - * 0b0011..AOI0_OUT0 input is selected - * 0b0100..AOI0_OUT1 input is selected - * 0b0101..EXTTRIG_IN0 input is selected - * 0b0110..EXTTRIG_IN7 input is selected - * 0b0111..AOI1_OUT0 input is selected - * 0b1000..AOI1_OUT1 input is selected - * *.. - */ -#define INPUTMUX_PWM0_EXT_CLK_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_PWM0_EXT_CLK_TRIGIN_SHIFT)) & INPUTMUX_PWM0_EXT_CLK_TRIGIN_MASK) -/*! @} */ - -/*! @name PWM1_EXT_CLK - PWM1 external clock trigger */ -/*! @{ */ - -#define INPUTMUX_PWM1_EXT_CLK_TRIGIN_MASK (0xFU) -#define INPUTMUX_PWM1_EXT_CLK_TRIGIN_SHIFT (0U) -/*! TRIGIN - Trigger input connections for PWM - * 0b0000..Reserved - * 0b0001..clk_16k[1] input is selected - * 0b0010..clk_in input is selected - * 0b0011..AOI0_OUT0 input is selected - * 0b0100..AOI0_OUT1 input is selected - * 0b0101..EXTTRIG_IN0 input is selected - * 0b0110..EXTTRIG_IN7 input is selected - * 0b0111..AOI1_OUT0 input is selected - * 0b1000..AOI1_OUT1 input is selected - * *.. - */ -#define INPUTMUX_PWM1_EXT_CLK_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_PWM1_EXT_CLK_TRIGIN_SHIFT)) & INPUTMUX_PWM1_EXT_CLK_TRIGIN_MASK) -/*! @} */ - -/*! @name AOI0_INPUTK_AOI0_INPUT - AOI0 trigger input connections 0 */ -/*! @{ */ - -#define INPUTMUX_AOI0_INPUTK_AOI0_INPUT_INP_MASK (0x7FU) -#define INPUTMUX_AOI0_INPUTK_AOI0_INPUT_INP_SHIFT (0U) -/*! INP - AOI0 trigger input connections - * 0b0000000..Reserved - * 0b0000001..ADC0_tcomp[0] input is selected - * 0b0000010..ADC0_tcomp[1] input is selected - * 0b0000011..ADC0_tcomp[2] input is selected - * 0b0000100..ADC0_tcomp[3] input is selected - * 0b0000101..CMP0_OUT input is selected - * 0b0000110..CMP1_OUT input is selected - * 0b0000111..Reserved - * 0b0001000..CTimer0_MAT0 input is selected - * 0b0001001..CTimer0_MAT1 input is selected - * 0b0001010..CTimer0_MAT2 input is selected - * 0b0001011..CTimer0_MAT3 input is selected - * 0b0001100..CTimer1_MAT0 - * 0b0001101..CTimer1_MAT1 input is selected - * 0b0001110..CTimer1_MAT2 input is selected - * 0b0001111..CTimer1_MAT3 input is selected - * 0b0010000..CTimer2_MAT0 input is selected - * 0b0010001..CTimer2_MAT1 input is selected - * 0b0010010..CTimer2_MAT2 input is selected - * 0b0010011..CTimer2_MAT3 input is selected - * 0b0010100..LPTMR0 input is selected - * 0b0010101..Reserved - * 0b0010110..QDC0_CMP_FLAG0 input is selected - * 0b0010111..QDC0_CMP_FLAG1 input is selected - * 0b0011000..QDC0_CMP_FLAG2 input is selected - * 0b0011001..QDC0_CMP_FLAG3 input is selected - * 0b0011010..QDC0_POS_MATCH input is selected - * 0b0011011..PWM0_SM0_MUX_TRIG0 0 input is selected - * 0b0011100..PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011101..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0011110..PWM0_SM1_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..Reserved - * 0b0100010..Reserved - * 0b0100011..TRIG_IN0 input is selected - * 0b0100100..TRIG_IN1 input is selected - * 0b0100101..TRIG_IN2 input is selected - * 0b0100110..TRIG_IN3 input is selected - * 0b0100111..TRIG_IN4 input is selected - * 0b0101000..TRIG_IN5 input is selected - * 0b0101001..TRIG_IN6 input is selected - * 0b0101010..TRIG_IN7 input is selected - * 0b0101011..TRIG_IN8 input is selected - * 0b0101100..TRIG_IN9 input is selected - * 0b0101101..TRIG_IN10 input is selected - * 0b0101110..TRIG_IN11 input is selected - * 0b0101111..GPIO0 Pin Event Trig 0 input is selected - * 0b0110000..GPIO1 Pin Event Trig 0 input is selected - * 0b0110001..GPIO2 Pin Event Trig 0 input is selected - * 0b0110010..GPIO3 Pin Event Trig 0 input is selected - * 0b0110011..GPIO4 Pin Event Trig 0 input is selected - * 0b0110100..ADC1_tcomp[0] input is selected - * 0b0110101..ADC1_tcomp[1] input is selected - * 0b0110110..ADC1_tcomp[2] input is selected - * 0b0110111..ADC1_tcomp[3] input is selected - * 0b0111000..CTimer3_MAT0 input is selected - * 0b0111001..CTimer3_MAT1 input is selected - * 0b0111010..CTimer3_MAT2 input is selected - * 0b0111011..CTimer3_MAT3 input is selected - * 0b0111100..CTimer4_MAT0 input is selected - * 0b0111101..CTimer4_MAT1 input is selected - * 0b0111110..CTimer4_MAT2 input is selected - * 0b0111111..CTimer4_MAT3 input is selected - * 0b1000000..FlexIO CH0 input is selected - * 0b1000001..FlexIO CH1 input is selected - * 0b1000010..FlexIO CH2 input is selected - * 0b1000011..FlexIO CH3 input is selected - * 0b1000100..QDC1_CMP_FLAG0 input is selected - * 0b1000101..QDC1_CMP_FLAG1 input is selected - * 0b1000110..QDC1_CMP_FLAG2 input is selected - * 0b1000111..QDC1_CMP_FLAG3 input is selected - * 0b1001000..QDC1_POS_MATCH0 input is selected - * 0b1001001..PWM1_SM0_MUX_TRIG0 input is selected - * 0b1001010..PWM1_SM0_MUX_TRIG1 input is selected - * 0b1001011..PWM1_SM1_MUX_TRIG0 input is selected - * 0b1001100..PWM1_SM1_MUX_TRIG1 input is selected - * 0b1001101..PWM1_SM2_MUX_TRIG0 input is selected - * 0b1001110..PWM1_SM2_MUX_TRIG1 input is selected - * 0b1001111..Reserved - * 0b1010000..Reserved - * *.. - */ -#define INPUTMUX_AOI0_INPUTK_AOI0_INPUT_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_AOI0_INPUTK_AOI0_INPUT_INP_SHIFT)) & INPUTMUX_AOI0_INPUTK_AOI0_INPUT_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_AOI0_INPUTK_AOI0_INPUT */ -#define INPUTMUX_AOI0_INPUTK_AOI0_INPUT_COUNT (16U) - -/*! @name USBFS_TRIG - USB-FS trigger input connections */ -/*! @{ */ - -#define INPUTMUX_USBFS_TRIG_INP_MASK (0xFU) -#define INPUTMUX_USBFS_TRIG_INP_SHIFT (0U) -/*! INP - USB-FS trigger input connections. - * 0b0000..Reserved - * 0b0001..LPUART0 lpuart_trg_txdata input is selected - * 0b0010..LPUART1 lpuart_trg_txdata input is selected - * 0b0011..LPUART2 lpuart_trg_txdata input is selected - * 0b0100..LPUART3 lpuart_trg_txdata input is selected - * 0b0101..LPUART4 lpuart_trg_txda input is selected - * *.. - */ -#define INPUTMUX_USBFS_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_USBFS_TRIG_INP_SHIFT)) & INPUTMUX_USBFS_TRIG_INP_MASK) -/*! @} */ - -/*! @name EXT_TRIG0 - EXT trigger connections 0 */ -/*! @{ */ - -#define INPUTMUX_EXT_TRIG0_INP_MASK (0x1FU) -#define INPUTMUX_EXT_TRIG0_INP_SHIFT (0U) -/*! INP - EXT trigger input connections - * 0b00000..Reserved - * 0b00001..Reserved - * 0b00010..AOI0_OUT0 input is selected - * 0b00011..AOI0_OUT1 input is selected - * 0b00100..AOI0_OUT2 input is selected - * 0b00101..AOI0_OUT3 input is selected - * 0b00110..CMP0_OUT input is selected - * 0b00111..CMP1_OUT input is selected - * 0b01000..Reserved - * 0b01001..LPUART0 input is selected - * 0b01010..LPUART1 input is selected - * 0b01011..LPUART2 input is selected - * 0b01100..LPUART3 input is selected - * 0b01101..LPUART4 input is selected - * 0b01110..AOI1_OUT0 input is selected - * 0b01111..AOI1_OUT1 input is selected - * 0b10000..AOI1_OUT2 input is selected - * 0b10001..AOI1_OUT3 input is selected - * *.. - */ -#define INPUTMUX_EXT_TRIG0_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_EXT_TRIG0_INP_SHIFT)) & INPUTMUX_EXT_TRIG0_INP_MASK) -/*! @} */ - -/*! @name CMP1_TRIG - CMP1 input connections */ -/*! @{ */ - -#define INPUTMUX_CMP1_TRIG_TRIGIN_MASK (0x3FU) -#define INPUTMUX_CMP1_TRIG_TRIGIN_SHIFT (0U) -/*! TRIGIN - CMP0 input trigger - * 0b000000..Reserved - * 0b000001..Reserved - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..Reserved - * 0b001000..CTimer0_MAT0 input is selected - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer1_MAT0 - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer2_MAT0 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..LPTMR0 input is selected - * 0b001111..Reserved - * 0b010000..QDC0_POS_MATCH0 - * 0b010001..PWM0_SM0_MUX_TRIG0 input is selected - * 0b010010..PWM0_SM0_MUX_TRIG1 input is selected - * 0b010011..PWM0_SM1_MUX_TRIG0 input is selected - * 0b010100..PWM0_SM1_MUX_TRIG1 input is selected - * 0b010101..PWM0_SM2_MUX_TRIG0 input is selected - * 0b010110..PWM0_SM2_MUX_TRIG1 input is selected - * 0b010111..Reserved - * 0b011000..Reserved - * 0b011001..GPIO0 Pin Event Trig 0 input is selected - * 0b011010..GPIO1 Pin Event Trig 0 input is selected - * 0b011011..GPIO2 Pin Event Trig 0 input is selected - * 0b011100..GPIO3 Pin Event Trig 0 input is selected - * 0b011101..GPIO4 Pin Event Trig 0 input is selected - * 0b011110..WUU input is selected - * 0b011111..AOI1_OUT0 input is selected - * 0b100000..AOI1_OUT1 input is selected - * 0b100001..AOI1_OUT2 input is selected - * 0b100010..AOI1_OUT3 input is selected - * 0b100011..Reserved - * 0b100100..Reserved - * 0b100101..Reserved - * 0b100110..Reserved - * 0b100111..CTimer3_MAT0 - * 0b101000..CTimer3_MAT1 - * 0b101001..CTimer4_MAT0 input is selected - * 0b101010..CTimer4_MAT1 input is selected - * 0b101011..Reserved - * 0b101100..Reserved - * 0b101101..Reserved - * 0b101110..Reserved - * 0b101111..QDC1_POS_MATCH0 input is selected - * 0b110000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b110001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b110010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b110011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b110100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b110101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b110110..Reserved - * 0b110111..Reserved - * *.. - */ -#define INPUTMUX_CMP1_TRIG_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CMP1_TRIG_TRIGIN_SHIFT)) & INPUTMUX_CMP1_TRIG_TRIGIN_MASK) -/*! @} */ - -/*! @name LPI2C2_TRIG - LPI2C2 trigger input connections */ -/*! @{ */ - -#define INPUTMUX_LPI2C2_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_LPI2C2_TRIG_INP_SHIFT (0U) -/*! INP - LPI2C2 trigger input connections - * 0b000000..Reserved - * 0b000001..Reserved - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT0 input is selected - * 0b001010..CTimer0_MAT1 input is selected - * 0b001011..CTimer1_MAT0 input is selected - * 0b001100..CTimer1_MAT1 input is selected - * 0b001101..CTimer2_MAT0 input is selected - * 0b001110..CTimer2_MAT1 input is selected - * 0b001111..LPTMR0 input is selected - * 0b010000..Reserved - * 0b010001..TRIG_IN0 input is selected - * 0b010010..TRIG_IN1 input is selected - * 0b010011..TRIG_IN2 input is selected - * 0b010100..TRIG_IN3 input is selected - * 0b010101..TRIG_IN4 input is selected - * 0b010110..TRIG_IN5 input is selected - * 0b010111..TRIG_IN6 input is selected - * 0b011000..TRIG_IN7 input is selected - * 0b011001..GPIO0 Pin Event Trig 0 input is selected - * 0b011010..GPIO1 Pin Event Trig 0 input is selected - * 0b011011..GPIO2 Pin Event Trig 0 input is selected - * 0b011100..GPIO3 Pin Event Trig 0 input is selected - * 0b011101..GPIO4 Pin Event Trig 0 input is selected - * 0b011110..WUU input is selected - * 0b011111..AOI1_OUT0 input is selected - * 0b100000..AOI1_OUT1 input is selected - * 0b100001..AOI1_OUT2 input is selected - * 0b100010..AOI1_OUT3 input is selected - * 0b100011..CTimer3_MAT2 input is selected - * 0b100100..CTimer3_MAT3 input is selected - * 0b100101..CTimer4_MAT2 input is selected - * 0b100110..CTimer4_MAT3 input is selected - * 0b100111..FlexIO CH0 input is selected - * 0b101000..FlexIO CH1 input is selected - * 0b101001..FlexIO CH2 input is selected - * 0b101010..FlexIO CH3 input is selected - * *.. - */ -#define INPUTMUX_LPI2C2_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_LPI2C2_TRIG_INP_SHIFT)) & INPUTMUX_LPI2C2_TRIG_INP_MASK) -/*! @} */ - -/*! @name OPAMP0_TRIG - OPAMP0 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_OPAMP0_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_OPAMP0_TRIG_INP_SHIFT (0U) -/*! INP - DAC0 trigger input - * 0b000000..Reserved - * 0b000001..Reserved - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT0 input is selected - * 0b001010..CTimer0_MAT1 input is selected - * 0b001011..CTimer1_MAT0 input is selected - * 0b001100..CTimer1_MAT1 input is selected - * 0b001101..CTimer2_MAT0 input is selected - * 0b001110..CTimer2_MAT1 input is selected - * 0b001111..LPTMR0 input is selected - * 0b010000..Reserved - * 0b010001..Reserved - * 0b010010..PWM0_SM0_MUX_TRIG0 input is selected - * 0b010011..PWM0_SM0_MUX_TRIG1 input is selected - * 0b010100..PWM0_SM1_MUX_TRIG0 input is selected - * 0b010101..PWM0_SM1_MUX_TRIG1 input is selected - * 0b010110..PWM0_SM2_MUX_TRIG0 input is selected - * 0b010111..PWM0_SM2_MUX_TRIG1 input is selected - * 0b011000..Reserved - * 0b011001..Reserved - * 0b011010..GPIO0 Pin Event Trig 0 input is selected - * 0b011011..GPIO1 Pin Event Trig 0 input is selected - * 0b011100..GPIO2 Pin Event Trig 0 input is selected - * 0b011101..GPIO3 Pin Event Trig 0 input is selected - * 0b011110..GPIO4 Pin Event Trig 0 input is selected - * 0b011111..WUU input is selected - * 0b100000..Reserved - * 0b100001..AOI1_OUT0 input is selected - * 0b100010..AOI1_OUT1 input is selected - * 0b100011..AOI1_OUT2 input is selected - * 0b100100..AOI1_OUT3 input is selected - * 0b100101..ADC0_tcomp[0] input is selected - * 0b100110..ADC0_tcomp[1] input is selected - * 0b100111..ADC1_tcomp[0] input is selected - * 0b101000..ADC1_tcomp[1] input is selected - * 0b101001..CTimer3_MAT0 input is selected - * 0b101010..CTimer3_MAT1 input is selected - * 0b101011..CTimer4_MAT0 input is selected - * 0b101100..CTimer4_MAT1 input is selected - * 0b101101..FlexIO CH0 input is selected - * 0b101110..FlexIO CH1 input is selected - * 0b101111..FlexIO CH2 input is selected - * 0b110000..FlexIO CH3 input is selected - * 0b110001..Reserved - * 0b110010..PWM1_SM0_MUX_TRIG0 input is selected - * 0b110011..PWM1_SM0_MUX_TRIG1 input is selected - * 0b110100..PWM1_SM1_MUX_TRIG0 input is selected - * 0b110101..PWM1_SM1_MUX_TRIG1 input is selected - * 0b110110..PWM1_SM2_MUX_TRIG0 input is selected - * 0b110111..PWM1_SM2_MUX_TRIG1 input is selected - * 0b111000..Reserved - * 0b111001..Reserved - * *.. - */ -#define INPUTMUX_OPAMP0_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_OPAMP0_TRIG_INP_SHIFT)) & INPUTMUX_OPAMP0_TRIG_INP_MASK) -/*! @} */ - -/*! @name LPI2C0_TRIG - LPI2C0 trigger input connections */ -/*! @{ */ - -#define INPUTMUX_LPI2C0_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_LPI2C0_TRIG_INP_SHIFT (0U) -/*! INP - LPI2C0 trigger input connections - * 0b000000..Reserved - * 0b000001..Reserved - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT0 input is selected - * 0b001010..CTimer0_MAT1 input is selected - * 0b001011..CTimer1_MAT0 input is selected - * 0b001100..CTimer1_MAT1 input is selected - * 0b001101..CTimer2_MAT0 input is selected - * 0b001110..CTimer2_MAT1 input is selected - * 0b001111..LPTMR0 input is selected - * 0b010000..Reserved - * 0b010001..TRIG_IN0 input is selected - * 0b010010..TRIG_IN1 input is selected - * 0b010011..TRIG_IN2 input is selected - * 0b010100..TRIG_IN3 input is selected - * 0b010101..TRIG_IN4 input is selected - * 0b010110..TRIG_IN5 input is selected - * 0b010111..TRIG_IN6 input is selected - * 0b011000..TRIG_IN7 input is selected - * 0b011001..GPIO0 Pin Event Trig 0 input is selected - * 0b011010..GPIO1 Pin Event Trig 0 input is selected - * 0b011011..GPIO2 Pin Event Trig 0 input is selected - * 0b011100..GPIO3 Pin Event Trig 0 input is selected - * 0b011101..GPIO4 Pin Event Trig 0 input is selected - * 0b011110..WUU input is selected - * 0b011111..AOI1_OUT0 input is selected - * 0b100000..AOI1_OUT1 input is selected - * 0b100001..AOI1_OUT2 input is selected - * 0b100010..AOI1_OUT3 input is selected - * 0b100011..CTimer3_MAT2 input is selected - * 0b100100..CTimer3_MAT3 input is selected - * 0b100101..CTimer4_MAT2 input is selected - * 0b100110..CTimer4_MAT3 input is selected - * 0b100111..FlexIO CH0 input is selected - * 0b101000..FlexIO CH1 input is selected - * 0b101001..FlexIO CH2 input is selected - * 0b101010..FlexIO CH3 input is selected - * *.. - */ -#define INPUTMUX_LPI2C0_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_LPI2C0_TRIG_INP_SHIFT)) & INPUTMUX_LPI2C0_TRIG_INP_MASK) -/*! @} */ - -/*! @name LPI2C1_TRIG - LPI2C1 trigger input connections */ -/*! @{ */ - -#define INPUTMUX_LPI2C1_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_LPI2C1_TRIG_INP_SHIFT (0U) -/*! INP - LPI2C1 trigger input connections - * 0b000000..Reserved - * 0b000001..Reserved - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT0 input is selected - * 0b001010..CTimer0_MAT1 input is selected - * 0b001011..CTimer1_MAT0 input is selected - * 0b001100..CTimer1_MAT1 input is selected - * 0b001101..CTimer2_MAT0 input is selected - * 0b001110..CTimer2_MAT1 input is selected - * 0b001111..LPTMR0 input is selected - * 0b010000..Reserved - * 0b010001..TRIG_IN0 input is selected - * 0b010010..TRIG_IN1 input is selected - * 0b010011..TRIG_IN2 input is selected - * 0b010100..TRIG_IN3 input is selected - * 0b010101..TRIG_IN4 input is selected - * 0b010110..TRIG_IN5 input is selected - * 0b010111..TRIG_IN6 input is selected - * 0b011000..TRIG_IN7 input is selected - * 0b011001..GPIO0 Pin Event Trig 0 input is selected - * 0b011010..GPIO1 Pin Event Trig 0 input is selected - * 0b011011..GPIO2 Pin Event Trig 0 input is selected - * 0b011100..GPIO3 Pin Event Trig 0 input is selected - * 0b011101..GPIO4 Pin Event Trig 0 input is selected - * 0b011110..WUU input is selected - * 0b011111..AOI1_OUT0 input is selected - * 0b100000..AOI1_OUT1 input is selected - * 0b100001..AOI1_OUT2 input is selected - * 0b100010..AOI1_OUT3 input is selected - * 0b100011..CTimer3_MAT2 input is selected - * 0b100100..CTimer3_MAT3 input is selected - * 0b100101..CTimer4_MAT2 input is selected - * 0b100110..CTimer4_MAT3 input is selected - * 0b100111..FlexIO CH0 input is selected - * 0b101000..FlexIO CH1 input is selected - * 0b101001..FlexIO CH2 input is selected - * 0b101010..FlexIO CH3 input is selected - * *.. - */ -#define INPUTMUX_LPI2C1_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_LPI2C1_TRIG_INP_SHIFT)) & INPUTMUX_LPI2C1_TRIG_INP_MASK) -/*! @} */ - -/*! @name LPSPI0_TRIG - LPSPI0 trigger input connections */ -/*! @{ */ - -#define INPUTMUX_LPSPI0_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_LPSPI0_TRIG_INP_SHIFT (0U) -/*! INP - LPSPI0 trigger input connections - * 0b000000..Reserved - * 0b000001..Reserved - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT1 input is selected - * 0b001010..CTimer0_MAT2 input is selected - * 0b001011..CTimer1_MAT1 input is selected - * 0b001100..CTimer1_MAT2 input is selected - * 0b001101..CTimer2_MAT1 input is selected - * 0b001110..CTimer2_MAT2 input is selected - * 0b001111..LPTMR0 input is selected - * 0b010000..Reserved - * 0b010001..TRIG_IN0 input is selected - * 0b010010..TRIG_IN1 input is selected - * 0b010011..TRIG_IN2 input is selected - * 0b010100..TRIG_IN3 input is selected - * 0b010101..TRIG_IN4 input is selected - * 0b010110..TRIG_IN5 input is selected - * 0b010111..TRIG_IN6 input is selected - * 0b011000..TRIG_IN7 input is selected - * 0b011001..GPIO0 Pin Event Trig 0 input is selected - * 0b011010..GPIO1 Pin Event Trig 0 input is selected - * 0b011011..GPIO2 Pin Event Trig 0 input is selected - * 0b011100..GPIO3 Pin Event Trig 0 input is selected - * 0b011101..GPIO4 Pin Event Trig 0 input is selected - * 0b011110..WUU input is selected - * 0b011111..AOI1_OUT0 input is selected - * 0b100000..AOI1_OUT1 input is selected - * 0b100001..AOI1_OUT2 input is selected - * 0b100010..AOI1_OUT3 input is selected - * 0b100011..CTimer3_MAT2 input is selected - * 0b100100..CTimer3_MAT3 input is selected - * 0b100101..CTimer4_MAT2 input is selected - * 0b100110..CTimer4_MAT3 input is selected - * 0b100111..FlexIO CH0 input is selected - * 0b101000..FlexIO CH1 input is selected - * 0b101001..FlexIO CH2 input is selected - * 0b101010..FlexIO CH3 input is selected - * *.. - */ -#define INPUTMUX_LPSPI0_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_LPSPI0_TRIG_INP_SHIFT)) & INPUTMUX_LPSPI0_TRIG_INP_MASK) -/*! @} */ - -/*! @name LPSPI1_TRIG - LPSPI1 trigger input connections */ -/*! @{ */ - -#define INPUTMUX_LPSPI1_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_LPSPI1_TRIG_INP_SHIFT (0U) -/*! INP - LPSPI1 trigger input connections - * 0b000000..Reserved - * 0b000001..Reserved - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT1 input is selected - * 0b001010..CTimer0_MAT2 input is selected - * 0b001011..CTimer1_MAT1 input is selected - * 0b001100..CTimer1_MAT2 input is selected - * 0b001101..CTimer2_MAT1 input is selected - * 0b001110..CTimer2_MAT2 input is selected - * 0b001111..LPTMR0 input is selected - * 0b010000..Reserved - * 0b010001..TRIG_IN0 input is selected - * 0b010010..TRIG_IN1 input is selected - * 0b010011..TRIG_IN2 input is selected - * 0b010100..TRIG_IN3 input is selected - * 0b010101..TRIG_IN4 input is selected - * 0b010110..TRIG_IN5 input is selected - * 0b010111..TRIG_IN6 input is selected - * 0b011000..TRIG_IN7 input is selected - * 0b011001..GPIO0 Pin Event Trig 0 input is selected - * 0b011010..GPIO1 Pin Event Trig 0 input is selected - * 0b011011..GPIO2 Pin Event Trig 0 input is selected - * 0b011100..GPIO3 Pin Event Trig 0 input is selected - * 0b011101..GPIO4 Pin Event Trig 0 input is selected - * 0b011110..WUU input is selected - * 0b011111..AOI1_OUT0 input is selected - * 0b100000..AOI1_OUT1 input is selected - * 0b100001..AOI1_OUT2 input is selected - * 0b100010..AOI1_OUT3 input is selected - * 0b100011..CTimer3_MAT2 input is selected - * 0b100100..CTimer3_MAT3 input is selected - * 0b100101..CTimer4_MAT2 input is selected - * 0b100110..CTimer4_MAT3 input is selected - * 0b100111..FlexIO CH0 input is selected - * 0b101000..FlexIO CH1 input is selected - * 0b101001..FlexIO CH2 input is selected - * 0b101010..FlexIO CH3 input is selected - * *.. - */ -#define INPUTMUX_LPSPI1_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_LPSPI1_TRIG_INP_SHIFT)) & INPUTMUX_LPSPI1_TRIG_INP_MASK) -/*! @} */ - -/*! @name LPUART0 - LPUART0 trigger input connections */ -/*! @{ */ - -#define INPUTMUX_LPUART0_INP_MASK (0x3FU) -#define INPUTMUX_LPUART0_INP_SHIFT (0U) -/*! INP - LPUART0 trigger input connections - * 0b000000..Reserved - * 0b000001..Reserved - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..LPTMR0 input is selected - * 0b010000..Reserved - * 0b010001..TRIG_IN0 input is selected - * 0b010010..TRIG_IN1 input is selected - * 0b010011..TRIG_IN2 input is selected - * 0b010100..TRIG_IN3 input is selected - * 0b010101..TRIG_IN4 input is selected - * 0b010110..TRIG_IN5 input is selected - * 0b010111..TRIG_IN6 input is selected - * 0b011000..TRIG_IN7 input is selected - * 0b011001..TRIG_IN8 input is selected - * 0b011010..TRIG_IN9 input is selected - * 0b011011..TRIG_IN10 input is selected - * 0b011100..TRIG_IN11 input is selected - * 0b011101..GPIO0 Pin Event Trig 0 input is selected - * 0b011110..GPIO1 Pin Event Trig 0 input is selected - * 0b011111..GPIO2 Pin Event Trig 0 input is selected - * 0b100000..GPIO3 Pin Event Trig 0 input is selected - * 0b100001..GPIO4 Pin Event Trig 0 input is selected - * 0b100010..WUU selected - * 0b100011..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100100..AOI1_OUT0 input is selected - * 0b100101..AOI1_OUT1 input is selected - * 0b100110..AOI1_OUT2 input is selected - * 0b100111..AOI1_OUT3 input is selected - * 0b101000..CTimer3_MAT2 input is selected - * 0b101001..CTimer3_MAT3 input is selected - * 0b101010..CTimer4_MAT2 input is selected - * 0b101011..CTimer4_MAT3 input is selected - * 0b101100..FlexIO CH0 input is selected - * 0b101101..FlexIO CH1 input is selected - * 0b101110..FlexIO CH2 input is selected - * 0b101111..FlexIO CH3 input is selected - * *.. - */ -#define INPUTMUX_LPUART0_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_LPUART0_INP_SHIFT)) & INPUTMUX_LPUART0_INP_MASK) -/*! @} */ - -/*! @name LPUART1 - LPUART1 trigger input connections */ -/*! @{ */ - -#define INPUTMUX_LPUART1_INP_MASK (0x3FU) -#define INPUTMUX_LPUART1_INP_SHIFT (0U) -/*! INP - LPUART1 trigger input connections - * 0b000000..Reserved - * 0b000001..Reserved - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..LPTMR0 input is selected - * 0b010000..Reserved - * 0b010001..TRIG_IN0 input is selected - * 0b010010..TRIG_IN1 input is selected - * 0b010011..TRIG_IN2 input is selected - * 0b010100..TRIG_IN3 input is selected - * 0b010101..TRIG_IN4 input is selected - * 0b010110..TRIG_IN5 input is selected - * 0b010111..TRIG_IN6 input is selected - * 0b011000..TRIG_IN7 input is selected - * 0b011001..TRIG_IN8 input is selected - * 0b011010..TRIG_IN9 input is selected - * 0b011011..TRIG_IN10 input is selected - * 0b011100..TRIG_IN11 input is selected - * 0b011101..GPIO0 Pin Event Trig 0 input is selected - * 0b011110..GPIO1 Pin Event Trig 0 input is selected - * 0b011111..GPIO2 Pin Event Trig 0 input is selected - * 0b100000..GPIO3 Pin Event Trig 0 input is selected - * 0b100001..GPIO4 Pin Event Trig 0 input is selected - * 0b100010..WUU selected - * 0b100011..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100100..AOI1_OUT0 input is selected - * 0b100101..AOI1_OUT1 input is selected - * 0b100110..AOI1_OUT2 input is selected - * 0b100111..AOI1_OUT3 input is selected - * 0b101000..CTimer3_MAT2 input is selected - * 0b101001..CTimer3_MAT3 input is selected - * 0b101010..CTimer4_MAT2 input is selected - * 0b101011..CTimer4_MAT3 input is selected - * 0b101100..FlexIO CH0 input is selected - * 0b101101..FlexIO CH1 input is selected - * 0b101110..FlexIO CH2 input is selected - * 0b101111..FlexIO CH3 input is selected - * *.. - */ -#define INPUTMUX_LPUART1_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_LPUART1_INP_SHIFT)) & INPUTMUX_LPUART1_INP_MASK) -/*! @} */ - -/*! @name LPUART2 - LPUART2 trigger input connections */ -/*! @{ */ - -#define INPUTMUX_LPUART2_INP_MASK (0x3FU) -#define INPUTMUX_LPUART2_INP_SHIFT (0U) -/*! INP - LPUART2 trigger input connections - * 0b000000..Reserved - * 0b000001..Reserved - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..LPTMR0 input is selected - * 0b010000..Reserved - * 0b010001..TRIG_IN0 input is selected - * 0b010010..TRIG_IN1 input is selected - * 0b010011..TRIG_IN2 input is selected - * 0b010100..TRIG_IN3 input is selected - * 0b010101..TRIG_IN4 input is selected - * 0b010110..TRIG_IN5 input is selected - * 0b010111..TRIG_IN6 input is selected - * 0b011000..TRIG_IN7 input is selected - * 0b011001..TRIG_IN8 input is selected - * 0b011010..TRIG_IN9 input is selected - * 0b011011..TRIG_IN10 input is selected - * 0b011100..TRIG_IN11 input is selected - * 0b011101..GPIO0 Pin Event Trig 0 input is selected - * 0b011110..GPIO1 Pin Event Trig 0 input is selected - * 0b011111..GPIO2 Pin Event Trig 0 input is selected - * 0b100000..GPIO3 Pin Event Trig 0 input is selected - * 0b100001..GPIO4 Pin Event Trig 0 input is selected - * 0b100010..WUU selected - * 0b100011..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100100..AOI1_OUT0 input is selected - * 0b100101..AOI1_OUT1 input is selected - * 0b100110..AOI1_OUT2 input is selected - * 0b100111..AOI1_OUT3 input is selected - * 0b101000..CTimer3_MAT2 input is selected - * 0b101001..CTimer3_MAT3 input is selected - * 0b101010..CTimer4_MAT2 input is selected - * 0b101011..CTimer4_MAT3 input is selected - * 0b101100..FlexIO CH0 input is selected - * 0b101101..FlexIO CH1 input is selected - * 0b101110..FlexIO CH2 input is selected - * 0b101111..FlexIO CH3 input is selected - * *.. - */ -#define INPUTMUX_LPUART2_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_LPUART2_INP_SHIFT)) & INPUTMUX_LPUART2_INP_MASK) -/*! @} */ - -/*! @name LPUART3 - LPUART3 trigger input connections */ -/*! @{ */ - -#define INPUTMUX_LPUART3_INP_MASK (0x3FU) -#define INPUTMUX_LPUART3_INP_SHIFT (0U) -/*! INP - LPUART3 trigger input connections - * 0b000000..Reserved - * 0b000001..Reserved - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..LPTMR0 input is selected - * 0b010000..Reserved - * 0b010001..TRIG_IN0 input is selected - * 0b010010..TRIG_IN1 input is selected - * 0b010011..TRIG_IN2 input is selected - * 0b010100..TRIG_IN3 input is selected - * 0b010101..TRIG_IN4 input is selected - * 0b010110..TRIG_IN5 input is selected - * 0b010111..TRIG_IN6 input is selected - * 0b011000..TRIG_IN7 input is selected - * 0b011001..TRIG_IN8 input is selected - * 0b011010..TRIG_IN9 input is selected - * 0b011011..TRIG_IN10 input is selected - * 0b011100..TRIG_IN11 input is selected - * 0b011101..GPIO0 Pin Event Trig 0 input is selected - * 0b011110..GPIO1 Pin Event Trig 0 input is selected - * 0b011111..GPIO2 Pin Event Trig 0 input is selected - * 0b100000..GPIO3 Pin Event Trig 0 input is selected - * 0b100001..GPIO4 Pin Event Trig 0 input is selected - * 0b100010..WUU selected - * 0b100011..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100100..AOI1_OUT0 input is selected - * 0b100101..AOI1_OUT1 input is selected - * 0b100110..AOI1_OUT2 input is selected - * 0b100111..AOI1_OUT3 input is selected - * 0b101000..CTimer3_MAT2 input is selected - * 0b101001..CTimer3_MAT3 input is selected - * 0b101010..CTimer4_MAT2 input is selected - * 0b101011..CTimer4_MAT3 input is selected - * 0b101100..FlexIO CH0 input is selected - * 0b101101..FlexIO CH1 input is selected - * 0b101110..FlexIO CH2 input is selected - * 0b101111..FlexIO CH3 input is selected - * *.. - */ -#define INPUTMUX_LPUART3_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_LPUART3_INP_SHIFT)) & INPUTMUX_LPUART3_INP_MASK) -/*! @} */ - -/*! @name LPUART4 - LPUART4 trigger input connections */ -/*! @{ */ - -#define INPUTMUX_LPUART4_INP_MASK (0x3FU) -#define INPUTMUX_LPUART4_INP_SHIFT (0U) -/*! INP - LPUART4 trigger input connections - * 0b000000..Reserved - * 0b000001..Reserved - * 0b000010..AOI0_OUT0 input is selected - * 0b000011..AOI0_OUT1 input is selected - * 0b000100..AOI0_OUT2 input is selected - * 0b000101..AOI0_OUT3 input is selected - * 0b000110..CMP0_OUT input is selected - * 0b000111..CMP1_OUT input is selected - * 0b001000..Reserved - * 0b001001..CTimer0_MAT2 input is selected - * 0b001010..CTimer0_MAT3 input is selected - * 0b001011..CTimer1_MAT2 input is selected - * 0b001100..CTimer1_MAT3 input is selected - * 0b001101..CTimer2_MAT2 input is selected - * 0b001110..CTimer2_MAT3 input is selected - * 0b001111..LPTMR0 input is selected - * 0b010000..Reserved - * 0b010001..TRIG_IN0 input is selected - * 0b010010..TRIG_IN1 input is selected - * 0b010011..TRIG_IN2 input is selected - * 0b010100..TRIG_IN3 input is selected - * 0b010101..TRIG_IN4 input is selected - * 0b010110..TRIG_IN5 input is selected - * 0b010111..TRIG_IN6 input is selected - * 0b011000..TRIG_IN7 input is selected - * 0b011001..TRIG_IN8 input is selected - * 0b011010..TRIG_IN9 input is selected - * 0b011011..TRIG_IN10 input is selected - * 0b011100..TRIG_IN11 input is selected - * 0b011101..GPIO0 Pin Event Trig 0 input is selected - * 0b011110..GPIO1 Pin Event Trig 0 input is selected - * 0b011111..GPIO2 Pin Event Trig 0 input is selected - * 0b100000..GPIO3 Pin Event Trig 0 input is selected - * 0b100001..GPIO4 Pin Event Trig 0 input is selected - * 0b100010..WUU selected - * 0b100011..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100100..AOI1_OUT0 input is selected - * 0b100101..AOI1_OUT1 input is selected - * 0b100110..AOI1_OUT2 input is selected - * 0b100111..AOI1_OUT3 input is selected - * 0b101000..CTimer3_MAT2 input is selected - * 0b101001..CTimer3_MAT3 input is selected - * 0b101010..CTimer4_MAT2 input is selected - * 0b101011..CTimer4_MAT3 input is selected - * 0b101100..FlexIO CH0 input is selected - * 0b101101..FlexIO CH1 input is selected - * 0b101110..FlexIO CH2 input is selected - * 0b101111..FlexIO CH3 input is selected - * *.. - */ -#define INPUTMUX_LPUART4_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_LPUART4_INP_SHIFT)) & INPUTMUX_LPUART4_INP_MASK) -/*! @} */ - -/*! @name FLEXIO_TRIGN_FLEXIO_TRIG - FlexIO Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXIO_TRIGN_FLEXIO_TRIG_INP_MASK (0x7FU) -#define INPUTMUX_FLEXIO_TRIGN_FLEXIO_TRIG_INP_SHIFT (0U) -/*! INP - Input number for FlexIO0. - * 0b0000000..Reserved - * 0b0000001..AOI0_OUT0 input is selected - * 0b0000010..AOI0_OUT1 input is selected - * 0b0000011..AOI0_OUT2 input is selected - * 0b0000100..AOI0_OUT3 input is selected - * 0b0000101..ADC0_tcomp[0] input is selected - * 0b0000110..ADC0_tcomp[1] input is selected - * 0b0000111..ADC0_tcomp[2] input is selected - * 0b0001000..ADC0_tcomp[3] input is selected - * 0b0001001..CMP0_OUT input is selected - * 0b0001010..CMP1_OUT input is selected - * 0b0001011..Reserved - * 0b0001100..CTimer0_MAT1 input is selected - * 0b0001101..CTimer0_MAT2 input is selected - * 0b0001110..CTimer1_MAT1 input is selected - * 0b0001111..CTimer1_MAT2 input is selected - * 0b0010000..CTimer2_MAT1 input is selected - * 0b0010001..CTimer2_MAT2 input is selected - * 0b0010010..LPTMR0 input is selected - * 0b0010011..Reserved (LPTMR1) input is selected - * 0b0010100..PWM0_SM0_MUX_TRIG0 input is selected - * 0b0010101..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0010110..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0010111..Reserved - * 0b0011000..TRIG_IN0 input is selected - * 0b0011001..TRIG_IN1 input is selected - * 0b0011010..TRIG_IN2 input is selected - * 0b0011011..TRIG_IN3 input is selected - * 0b0011100..TRIG_IN4 input is selected - * 0b0011101..TRIG_IN5 input is selected - * 0b0011110..TRIG_IN6 input is selected - * 0b0011111..TRIG_IN7 input is selected - * 0b0100000..GPIO0 Pin Event Trig 0 input is selected - * 0b0100001..GPIO2 Pin Event Trig 0 input is selected - * 0b0100010..GPIO3 Pin Event Trig 0 input is selected - * 0b0100011..GPIO4 Pin Event Trig 0 input is selected - * 0b0100100..WUU input is selected - * 0b0100101..PWM1_A0_TRIG0 input is selected - * 0b0100110..LPI2C0 Master End of Packet - * 0b0100111..LPI2C0 Slave End of Packet - * 0b0101000..LPI2C1 Master End of Packet - * 0b0101001..LPI2C1 Slave End of Packet - * 0b0101010..LPSPI0 End of Frame - * 0b0101011..LPSPI0 Received Data Word - * 0b0101100..LPSPI1 End of Frame - * 0b0101101..LPSPI1 Received Data Word - * 0b0101110..LPUART0 Received Data Word - * 0b0101111..LPUART0 Transmitted Data Word - * 0b0110000..LPUART0 Receive Line Idle - * 0b0110001..LPUART1 Received Data Word - * 0b0110010..LPUART1 Transmitted Data Word - * 0b0110011..LPUART1 Receive Line Idle - * 0b0110100..LPUART2 Received Data Word - * 0b0110101..LPUART2 Transmitted Data Word - * 0b0110110..LPUART2 Receive Line Idle - * 0b0110111..LPUART3 Received Data Word - * 0b0111000..LPUART3 Transmitted Data Word - * 0b0111001..LPUART3 Receive Line Idle - * 0b0111010..LPUART4 Received Data Word - * 0b0111011..LPUART4 Transmitted Data Word - * 0b0111100..LPUART4 Receive Line Idle - * 0b0111101..AOI1_OUT0 input is selected - * 0b0111110..AOI1_OUT1 input is selected - * 0b0111111..AOI1_OUT2 input is selected - * 0b1000000..AOI1_OUT3 input is selected - * 0b1000001..ADC1_tcomp[0] input is selected - * 0b1000010..ADC1_tcomp[1] input is selected - * 0b1000011..ADC1_tcomp[2] input is selected - * 0b1000100..ADC1_tcomp[3] input is selected - * 0b1000101..CTimer3_MAT2 input is selected - * 0b1000110..CTimer3_MAT3 input is selected - * 0b1000111..CTimer4_MAT2 input is selected - * 0b1001000..CTimer4_MAT3 input is selected - * 0b1001001..PWM1_SM0_MUX_TRIG0 input is selected - * 0b1001010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b1001011..PWM1_SM2_MUX_TRIG0 input is selected - * 0b1001100..Reserved - * 0b1001101..LPI2C2 Master End of Packet - * 0b1001110..LPI2C2 Slave End of Packet - * 0b1001111..LPI2C3 Master End of Packet - * 0b1010000..LPI2C3 Slave End of Packet - * *.. - */ -#define INPUTMUX_FLEXIO_TRIGN_FLEXIO_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXIO_TRIGN_FLEXIO_TRIG_INP_SHIFT)) & INPUTMUX_FLEXIO_TRIGN_FLEXIO_TRIG_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_FLEXIO_TRIGN_FLEXIO_TRIG */ -#define INPUTMUX_FLEXIO_TRIGN_FLEXIO_TRIG_COUNT (4U) - - -/*! - * @} - */ /* end of group INPUTMUX_Register_Masks */ - - -/* INPUTMUX - Peripheral instance base addresses */ -/** Peripheral INPUTMUX0 base address */ -#define INPUTMUX0_BASE (0x40001000u) -/** Peripheral INPUTMUX0 base pointer */ -#define INPUTMUX0 ((INPUTMUX_Type *)INPUTMUX0_BASE) -/** Array initializer of INPUTMUX peripheral base addresses */ -#define INPUTMUX_BASE_ADDRS { INPUTMUX0_BASE } -/** Array initializer of INPUTMUX peripheral base pointers */ -#define INPUTMUX_BASE_PTRS { INPUTMUX0 } - -/*! - * @} - */ /* end of group INPUTMUX_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LPCMP Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPCMP_Peripheral_Access_Layer LPCMP Peripheral Access Layer - * @{ - */ - -/** LPCMP - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - __IO uint32_t CCR0; /**< Comparator Control Register 0, offset: 0x8 */ - __IO uint32_t CCR1; /**< Comparator Control Register 1, offset: 0xC */ - __IO uint32_t CCR2; /**< Comparator Control Register 2, offset: 0x10 */ - uint8_t RESERVED_0[4]; - __IO uint32_t DCR; /**< DAC Control, offset: 0x18 */ - __IO uint32_t IER; /**< Interrupt Enable, offset: 0x1C */ - __IO uint32_t CSR; /**< Comparator Status, offset: 0x20 */ - __IO uint32_t RRCR0; /**< Round Robin Control Register 0, offset: 0x24 */ - __IO uint32_t RRCR1; /**< Round Robin Control Register 1, offset: 0x28 */ - __IO uint32_t RRCSR; /**< Round Robin Control and Status, offset: 0x2C */ - __IO uint32_t RRSR; /**< Round Robin Status, offset: 0x30 */ - uint8_t RESERVED_1[4]; - __IO uint32_t RRCR2; /**< Round Robin Control Register 2, offset: 0x38 */ -} LPCMP_Type; - -/* ---------------------------------------------------------------------------- - -- LPCMP Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPCMP_Register_Masks LPCMP Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define LPCMP_VERID_FEATURE_MASK (0xFFFFU) -#define LPCMP_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000001..Round robin feature - */ -#define LPCMP_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_VERID_FEATURE_SHIFT)) & LPCMP_VERID_FEATURE_MASK) - -#define LPCMP_VERID_MINOR_MASK (0xFF0000U) -#define LPCMP_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define LPCMP_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_VERID_MINOR_SHIFT)) & LPCMP_VERID_MINOR_MASK) - -#define LPCMP_VERID_MAJOR_MASK (0xFF000000U) -#define LPCMP_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define LPCMP_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_VERID_MAJOR_SHIFT)) & LPCMP_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define LPCMP_PARAM_DAC_RES_MASK (0xFU) -#define LPCMP_PARAM_DAC_RES_SHIFT (0U) -/*! DAC_RES - DAC Resolution - * 0b0000..4-bit DAC - * 0b0001..6-bit DAC - * 0b0010..8-bit DAC - * 0b0011..10-bit DAC - * 0b0100..12-bit DAC - * 0b0101..14-bit DAC - * 0b0110..16-bit DAC - */ -#define LPCMP_PARAM_DAC_RES(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_PARAM_DAC_RES_SHIFT)) & LPCMP_PARAM_DAC_RES_MASK) -/*! @} */ - -/*! @name CCR0 - Comparator Control Register 0 */ -/*! @{ */ - -#define LPCMP_CCR0_CMP_EN_MASK (0x1U) -#define LPCMP_CCR0_CMP_EN_SHIFT (0U) -/*! CMP_EN - Comparator Enable - * 0b0..Disable (The analog logic remains off and consumes no power.) - * 0b1..Enable - */ -#define LPCMP_CCR0_CMP_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR0_CMP_EN_SHIFT)) & LPCMP_CCR0_CMP_EN_MASK) - -#define LPCMP_CCR0_CMP_STOP_EN_MASK (0x2U) -#define LPCMP_CCR0_CMP_STOP_EN_SHIFT (1U) -/*! CMP_STOP_EN - Comparator Deep sleep Mode Enable - * 0b0..Disables the analog comparator regardless of CMP_EN. - * 0b1..Allows CMP_EN to enable the analog comparator. - */ -#define LPCMP_CCR0_CMP_STOP_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR0_CMP_STOP_EN_SHIFT)) & LPCMP_CCR0_CMP_STOP_EN_MASK) -/*! @} */ - -/*! @name CCR1 - Comparator Control Register 1 */ -/*! @{ */ - -#define LPCMP_CCR1_WINDOW_EN_MASK (0x1U) -#define LPCMP_CCR1_WINDOW_EN_SHIFT (0U) -/*! WINDOW_EN - Windowing Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPCMP_CCR1_WINDOW_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_WINDOW_EN_SHIFT)) & LPCMP_CCR1_WINDOW_EN_MASK) - -#define LPCMP_CCR1_SAMPLE_EN_MASK (0x2U) -#define LPCMP_CCR1_SAMPLE_EN_SHIFT (1U) -/*! SAMPLE_EN - Sampling Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPCMP_CCR1_SAMPLE_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_SAMPLE_EN_SHIFT)) & LPCMP_CCR1_SAMPLE_EN_MASK) - -#define LPCMP_CCR1_DMA_EN_MASK (0x4U) -#define LPCMP_CCR1_DMA_EN_SHIFT (2U) -/*! DMA_EN - DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPCMP_CCR1_DMA_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_DMA_EN_SHIFT)) & LPCMP_CCR1_DMA_EN_MASK) - -#define LPCMP_CCR1_COUT_INV_MASK (0x8U) -#define LPCMP_CCR1_COUT_INV_SHIFT (3U) -/*! COUT_INV - Comparator Invert - * 0b0..Do not invert - * 0b1..Invert - */ -#define LPCMP_CCR1_COUT_INV(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_COUT_INV_SHIFT)) & LPCMP_CCR1_COUT_INV_MASK) - -#define LPCMP_CCR1_COUT_SEL_MASK (0x10U) -#define LPCMP_CCR1_COUT_SEL_SHIFT (4U) -/*! COUT_SEL - Comparator Output Select - * 0b0..Use COUT (filtered) - * 0b1..Use COUTA (unfiltered) - */ -#define LPCMP_CCR1_COUT_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_COUT_SEL_SHIFT)) & LPCMP_CCR1_COUT_SEL_MASK) - -#define LPCMP_CCR1_COUT_PEN_MASK (0x20U) -#define LPCMP_CCR1_COUT_PEN_SHIFT (5U) -/*! COUT_PEN - Comparator Output Pin Enable - * 0b0..Not available - * 0b1..Available - */ -#define LPCMP_CCR1_COUT_PEN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_COUT_PEN_SHIFT)) & LPCMP_CCR1_COUT_PEN_MASK) - -#define LPCMP_CCR1_COUTA_OWEN_MASK (0x40U) -#define LPCMP_CCR1_COUTA_OWEN_SHIFT (6U) -/*! COUTA_OWEN - COUTA_OW Enable - * 0b0..COUTA holds the last sampled value. - * 0b1..Enables the COUTA signal value to be defined by COUTA_OW. - */ -#define LPCMP_CCR1_COUTA_OWEN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_COUTA_OWEN_SHIFT)) & LPCMP_CCR1_COUTA_OWEN_MASK) - -#define LPCMP_CCR1_COUTA_OW_MASK (0x80U) -#define LPCMP_CCR1_COUTA_OW_SHIFT (7U) -/*! COUTA_OW - COUTA Output Level for Closed Window - * 0b0..COUTA is 0 - * 0b1..COUTA is 1 - */ -#define LPCMP_CCR1_COUTA_OW(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_COUTA_OW_SHIFT)) & LPCMP_CCR1_COUTA_OW_MASK) - -#define LPCMP_CCR1_WINDOW_INV_MASK (0x100U) -#define LPCMP_CCR1_WINDOW_INV_SHIFT (8U) -/*! WINDOW_INV - WINDOW/SAMPLE Signal Invert - * 0b0..Do not invert - * 0b1..Invert - */ -#define LPCMP_CCR1_WINDOW_INV(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_WINDOW_INV_SHIFT)) & LPCMP_CCR1_WINDOW_INV_MASK) - -#define LPCMP_CCR1_WINDOW_CLS_MASK (0x200U) -#define LPCMP_CCR1_WINDOW_CLS_SHIFT (9U) -/*! WINDOW_CLS - COUT Event Window Close - * 0b0..COUT event cannot close the window - * 0b1..COUT event can close the window - */ -#define LPCMP_CCR1_WINDOW_CLS(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_WINDOW_CLS_SHIFT)) & LPCMP_CCR1_WINDOW_CLS_MASK) - -#define LPCMP_CCR1_EVT_SEL_MASK (0xC00U) -#define LPCMP_CCR1_EVT_SEL_SHIFT (10U) -/*! EVT_SEL - COUT Event Select - * 0b00..Rising edge - * 0b01..Falling edge - * 0b1x..Both edges - */ -#define LPCMP_CCR1_EVT_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_EVT_SEL_SHIFT)) & LPCMP_CCR1_EVT_SEL_MASK) - -#define LPCMP_CCR1_FUNC_CLK_SEL_MASK (0x3000U) -#define LPCMP_CCR1_FUNC_CLK_SEL_SHIFT (12U) -/*! FUNC_CLK_SEL - Functional Clock Source Select - * 0b00..Select functional clock source 0 - * 0b01..Select functional clock source 1 - * 0b10..Select functional clock source 2 - * 0b11..Select functional clock source 3 - */ -#define LPCMP_CCR1_FUNC_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_FUNC_CLK_SEL_SHIFT)) & LPCMP_CCR1_FUNC_CLK_SEL_MASK) - -#define LPCMP_CCR1_FILT_CNT_MASK (0x70000U) -#define LPCMP_CCR1_FILT_CNT_SHIFT (16U) -/*! FILT_CNT - Filter Sample Count - * 0b000..Filter is bypassed: COUT = COUTA - * 0b001..1 consecutive sample (Comparator output is simply sampled.) - * 0b010..2 consecutive samples - * 0b011..3 consecutive samples - * 0b100..4 consecutive samples - * 0b101..5 consecutive samples - * 0b110..6 consecutive samples - * 0b111..7 consecutive samples - */ -#define LPCMP_CCR1_FILT_CNT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_FILT_CNT_SHIFT)) & LPCMP_CCR1_FILT_CNT_MASK) - -#define LPCMP_CCR1_FILT_PER_MASK (0xFF000000U) -#define LPCMP_CCR1_FILT_PER_SHIFT (24U) -/*! FILT_PER - Filter Sample Period */ -#define LPCMP_CCR1_FILT_PER(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_FILT_PER_SHIFT)) & LPCMP_CCR1_FILT_PER_MASK) -/*! @} */ - -/*! @name CCR2 - Comparator Control Register 2 */ -/*! @{ */ - -#define LPCMP_CCR2_CMP_HPMD_MASK (0x1U) -#define LPCMP_CCR2_CMP_HPMD_SHIFT (0U) -/*! CMP_HPMD - CMP High Power Mode Select - * 0b0..Low power (speed) comparison mode - * 0b1..High power (speed) comparison mode - */ -#define LPCMP_CCR2_CMP_HPMD(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR2_CMP_HPMD_SHIFT)) & LPCMP_CCR2_CMP_HPMD_MASK) - -#define LPCMP_CCR2_CMP_NPMD_MASK (0x2U) -#define LPCMP_CCR2_CMP_NPMD_SHIFT (1U) -/*! CMP_NPMD - CMP Nano Power Mode Select - * 0b0..Disables CMP Nano power mode. CCR2[CMP_HPMD] determines the mode for the comparator. - * 0b1..Enables CMP Nano power mode. - */ -#define LPCMP_CCR2_CMP_NPMD(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR2_CMP_NPMD_SHIFT)) & LPCMP_CCR2_CMP_NPMD_MASK) - -#define LPCMP_CCR2_HYSTCTR_MASK (0x30U) -#define LPCMP_CCR2_HYSTCTR_SHIFT (4U) -/*! HYSTCTR - Comparator Hysteresis Control - * 0b00..Level 0: Analog comparator hysteresis 0 mV. - * 0b01..Level 1: Analog comparator hysteresis 10 mV. - * 0b10..Level 2: Analog comparator hysteresis 20 mV. - * 0b11..Level 3: Analog comparator hysteresis 30 mV. - */ -#define LPCMP_CCR2_HYSTCTR(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR2_HYSTCTR_SHIFT)) & LPCMP_CCR2_HYSTCTR_MASK) - -#define LPCMP_CCR2_PSEL_MASK (0x70000U) -#define LPCMP_CCR2_PSEL_SHIFT (16U) -/*! PSEL - Plus Input MUX Select - * 0b000..Input 0p - * 0b001..Input 1p - * 0b010..Input 2p - * 0b011..Input 3p - * 0b100..Input 4p - * 0b101..Input 5p - * 0b110..Reserved - * 0b111..Internal DAC output - */ -#define LPCMP_CCR2_PSEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR2_PSEL_SHIFT)) & LPCMP_CCR2_PSEL_MASK) - -#define LPCMP_CCR2_MSEL_MASK (0x700000U) -#define LPCMP_CCR2_MSEL_SHIFT (20U) -/*! MSEL - Minus Input MUX Select - * 0b000..Input 0m - * 0b001..Input 1m - * 0b010..Input 2m - * 0b011..Input 3m - * 0b100..Input 4m - * 0b101..Input 5m - * 0b110..Reserved - * 0b111..Internal DAC output - */ -#define LPCMP_CCR2_MSEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR2_MSEL_SHIFT)) & LPCMP_CCR2_MSEL_MASK) -/*! @} */ - -/*! @name DCR - DAC Control */ -/*! @{ */ - -#define LPCMP_DCR_DAC_EN_MASK (0x1U) -#define LPCMP_DCR_DAC_EN_SHIFT (0U) -/*! DAC_EN - DAC Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPCMP_DCR_DAC_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_DCR_DAC_EN_SHIFT)) & LPCMP_DCR_DAC_EN_MASK) - -#define LPCMP_DCR_DAC_HPMD_MASK (0x2U) -#define LPCMP_DCR_DAC_HPMD_SHIFT (1U) -/*! DAC_HPMD - DAC High Power Mode - * 0b0..Disable - * 0b1..Enable - */ -#define LPCMP_DCR_DAC_HPMD(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_DCR_DAC_HPMD_SHIFT)) & LPCMP_DCR_DAC_HPMD_MASK) - -#define LPCMP_DCR_VRSEL_MASK (0x100U) -#define LPCMP_DCR_VRSEL_SHIFT (8U) -/*! VRSEL - DAC Reference High Voltage Source Select - * 0b0..VREFH0 - * 0b1..VREFH1 - */ -#define LPCMP_DCR_VRSEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_DCR_VRSEL_SHIFT)) & LPCMP_DCR_VRSEL_MASK) - -#define LPCMP_DCR_DAC_DATA_MASK (0xFF0000U) -#define LPCMP_DCR_DAC_DATA_SHIFT (16U) -/*! DAC_DATA - DAC Output Voltage Select */ -#define LPCMP_DCR_DAC_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_DCR_DAC_DATA_SHIFT)) & LPCMP_DCR_DAC_DATA_MASK) -/*! @} */ - -/*! @name IER - Interrupt Enable */ -/*! @{ */ - -#define LPCMP_IER_CFR_IE_MASK (0x1U) -#define LPCMP_IER_CFR_IE_SHIFT (0U) -/*! CFR_IE - Comparator Flag Rising Interrupt Enable - * 0b0..Disables the comparator flag rising interrupt. - * 0b1..Enables the comparator flag rising interrupt when CFR is set. - */ -#define LPCMP_IER_CFR_IE(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_IER_CFR_IE_SHIFT)) & LPCMP_IER_CFR_IE_MASK) - -#define LPCMP_IER_CFF_IE_MASK (0x2U) -#define LPCMP_IER_CFF_IE_SHIFT (1U) -/*! CFF_IE - Comparator Flag Falling Interrupt Enable - * 0b0..Disables the comparator flag falling interrupt. - * 0b1..Enables the comparator flag falling interrupt when CFF is set. - */ -#define LPCMP_IER_CFF_IE(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_IER_CFF_IE_SHIFT)) & LPCMP_IER_CFF_IE_MASK) - -#define LPCMP_IER_RRF_IE_MASK (0x4U) -#define LPCMP_IER_RRF_IE_SHIFT (2U) -/*! RRF_IE - Round-Robin Flag Interrupt Enable - * 0b0..Disables the round-robin flag interrupt. - * 0b1..Enables the round-robin flag interrupt when the comparison result changes for a given channel. - */ -#define LPCMP_IER_RRF_IE(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_IER_RRF_IE_SHIFT)) & LPCMP_IER_RRF_IE_MASK) -/*! @} */ - -/*! @name CSR - Comparator Status */ -/*! @{ */ - -#define LPCMP_CSR_CFR_MASK (0x1U) -#define LPCMP_CSR_CFR_SHIFT (0U) -/*! CFR - Analog Comparator Flag Rising - * 0b0..Not detected - * 0b1..Detected - */ -#define LPCMP_CSR_CFR(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CSR_CFR_SHIFT)) & LPCMP_CSR_CFR_MASK) - -#define LPCMP_CSR_CFF_MASK (0x2U) -#define LPCMP_CSR_CFF_SHIFT (1U) -/*! CFF - Analog Comparator Flag Falling - * 0b0..Not detected - * 0b1..Detected - */ -#define LPCMP_CSR_CFF(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CSR_CFF_SHIFT)) & LPCMP_CSR_CFF_MASK) - -#define LPCMP_CSR_RRF_MASK (0x4U) -#define LPCMP_CSR_RRF_SHIFT (2U) -/*! RRF - Round-Robin Flag - * 0b0..Not detected - * 0b1..Detected - */ -#define LPCMP_CSR_RRF(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CSR_RRF_SHIFT)) & LPCMP_CSR_RRF_MASK) - -#define LPCMP_CSR_COUT_MASK (0x100U) -#define LPCMP_CSR_COUT_SHIFT (8U) -/*! COUT - Analog Comparator Output */ -#define LPCMP_CSR_COUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CSR_COUT_SHIFT)) & LPCMP_CSR_COUT_MASK) -/*! @} */ - -/*! @name RRCR0 - Round Robin Control Register 0 */ -/*! @{ */ - -#define LPCMP_RRCR0_RR_EN_MASK (0x1U) -#define LPCMP_RRCR0_RR_EN_SHIFT (0U) -/*! RR_EN - Round-Robin Enable - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR0_RR_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_EN_SHIFT)) & LPCMP_RRCR0_RR_EN_MASK) - -#define LPCMP_RRCR0_RR_TRG_SEL_MASK (0x2U) -#define LPCMP_RRCR0_RR_TRG_SEL_SHIFT (1U) -/*! RR_TRG_SEL - Round-Robin Trigger Select - * 0b0..External trigger - * 0b1..Internal trigger - */ -#define LPCMP_RRCR0_RR_TRG_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_TRG_SEL_SHIFT)) & LPCMP_RRCR0_RR_TRG_SEL_MASK) - -#define LPCMP_RRCR0_RR_EXTTRG_SEL_MASK (0x3CU) -#define LPCMP_RRCR0_RR_EXTTRG_SEL_SHIFT (2U) -/*! RR_EXTTRG_SEL - External Trigger Source Select - * 0b0000..Select external trigger source 0 - * 0b0001..Select external trigger source 1 - * 0b0010..Select external trigger source 2 - * 0b0011..Select external trigger source 3 - * 0b0100..Select external trigger source 4 - * 0b0101..Select external trigger source 5 - * 0b0110..Select external trigger source 6 - * 0b0111..Select external trigger source 7 - * 0b1000..Select external trigger source 8 - * 0b1001..Select external trigger source 9 - * 0b1010..Select external trigger source 10 - * 0b1011..Select external trigger source 11 - * 0b1100..Select external trigger source 12 - * 0b1101..Select external trigger source 13 - * 0b1110..Select external trigger source 14 - * 0b1111..Select external trigger source 15 - */ -#define LPCMP_RRCR0_RR_EXTTRG_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_EXTTRG_SEL_SHIFT)) & LPCMP_RRCR0_RR_EXTTRG_SEL_MASK) - -#define LPCMP_RRCR0_RR_NSAM_MASK (0x300U) -#define LPCMP_RRCR0_RR_NSAM_SHIFT (8U) -/*! RR_NSAM - Number of Sample Clocks - * 0b00..0 clock - * 0b01..1 clock - * 0b10..2 clocks - * 0b11..3 clocks - */ -#define LPCMP_RRCR0_RR_NSAM(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_NSAM_SHIFT)) & LPCMP_RRCR0_RR_NSAM_MASK) - -#define LPCMP_RRCR0_RR_CLK_SEL_MASK (0x3000U) -#define LPCMP_RRCR0_RR_CLK_SEL_SHIFT (12U) -/*! RR_CLK_SEL - Round Robin Clock Source Select - * 0b00..Select Round Robin clock Source 0 - * 0b01..Select Round Robin clock Source 1 - * 0b10..Select Round Robin clock Source 2 - * 0b11..Select Round Robin clock Source 3 - */ -#define LPCMP_RRCR0_RR_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_CLK_SEL_SHIFT)) & LPCMP_RRCR0_RR_CLK_SEL_MASK) - -#define LPCMP_RRCR0_RR_INITMOD_MASK (0x3F0000U) -#define LPCMP_RRCR0_RR_INITMOD_SHIFT (16U) -/*! RR_INITMOD - Initialization Delay Modulus - * 0b000000..63 cycles (same as 111111b) - * 0b000001-0b111111..1 to 63 cycles - */ -#define LPCMP_RRCR0_RR_INITMOD(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_INITMOD_SHIFT)) & LPCMP_RRCR0_RR_INITMOD_MASK) - -#define LPCMP_RRCR0_RR_SAMPLE_CNT_MASK (0xF000000U) -#define LPCMP_RRCR0_RR_SAMPLE_CNT_SHIFT (24U) -/*! RR_SAMPLE_CNT - Number of Sample for One Channel - * 0b0000..1 samples - * 0b0001..2 samples - * 0b0010..3 samples - * 0b0011..4 samples - * 0b0100..5 samples - * 0b0101..6 samples - * 0b0110..7 samples - * 0b0111..8 samples - * 0b1000..9 samples - * 0b1001..10 samples - * 0b1010..11 samples - * 0b1011..12 samples - * 0b1100..13 samples - * 0b1101..14 samples - * 0b1110..15 samples - * 0b1111..16 samples - */ -#define LPCMP_RRCR0_RR_SAMPLE_CNT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_SAMPLE_CNT_SHIFT)) & LPCMP_RRCR0_RR_SAMPLE_CNT_MASK) - -#define LPCMP_RRCR0_RR_SAMPLE_THRESHOLD_MASK (0xF0000000U) -#define LPCMP_RRCR0_RR_SAMPLE_THRESHOLD_SHIFT (28U) -/*! RR_SAMPLE_THRESHOLD - Sample Time Threshold - * 0b0000..At least 1 sampled "1", the final result is "1" - * 0b0001..At least 2 sampled "1", the final result is "1" - * 0b0010..At least 3 sampled "1", the final result is "1" - * 0b0011..At least 4 sampled "1", the final result is "1" - * 0b0100..At least 5 sampled "1", the final result is "1" - * 0b0101..At least 6 sampled "1", the final result is "1" - * 0b0110..At least 7 sampled "1", the final result is "1" - * 0b0111..At least 8 sampled "1", the final result is "1" - * 0b1000..At least 9 sampled "1", the final result is "1" - * 0b1001..At least 10 sampled "1", the final result is "1" - * 0b1010..At least 11 sampled "1", the final result is "1" - * 0b1011..At least 12 sampled "1", the final result is "1" - * 0b1100..At least 13 sampled "1", the final result is "1" - * 0b1101..At least 14 sampled "1", the final result is "1" - * 0b1110..At least 15 sampled "1", the final result is "1" - * 0b1111..At least 16 sampled "1", the final result is "1" - */ -#define LPCMP_RRCR0_RR_SAMPLE_THRESHOLD(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_SAMPLE_THRESHOLD_SHIFT)) & LPCMP_RRCR0_RR_SAMPLE_THRESHOLD_MASK) -/*! @} */ - -/*! @name RRCR1 - Round Robin Control Register 1 */ -/*! @{ */ - -#define LPCMP_RRCR1_RR_CH0EN_MASK (0x1U) -#define LPCMP_RRCR1_RR_CH0EN_SHIFT (0U) -/*! RR_CH0EN - Channel 0 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH0EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH0EN_SHIFT)) & LPCMP_RRCR1_RR_CH0EN_MASK) - -#define LPCMP_RRCR1_RR_CH1EN_MASK (0x2U) -#define LPCMP_RRCR1_RR_CH1EN_SHIFT (1U) -/*! RR_CH1EN - Channel 1 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH1EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH1EN_SHIFT)) & LPCMP_RRCR1_RR_CH1EN_MASK) - -#define LPCMP_RRCR1_RR_CH2EN_MASK (0x4U) -#define LPCMP_RRCR1_RR_CH2EN_SHIFT (2U) -/*! RR_CH2EN - Channel 2 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH2EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH2EN_SHIFT)) & LPCMP_RRCR1_RR_CH2EN_MASK) - -#define LPCMP_RRCR1_RR_CH3EN_MASK (0x8U) -#define LPCMP_RRCR1_RR_CH3EN_SHIFT (3U) -/*! RR_CH3EN - Channel 3 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH3EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH3EN_SHIFT)) & LPCMP_RRCR1_RR_CH3EN_MASK) - -#define LPCMP_RRCR1_RR_CH4EN_MASK (0x10U) -#define LPCMP_RRCR1_RR_CH4EN_SHIFT (4U) -/*! RR_CH4EN - Channel 4 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH4EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH4EN_SHIFT)) & LPCMP_RRCR1_RR_CH4EN_MASK) - -#define LPCMP_RRCR1_RR_CH5EN_MASK (0x20U) -#define LPCMP_RRCR1_RR_CH5EN_SHIFT (5U) -/*! RR_CH5EN - Channel 5 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH5EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH5EN_SHIFT)) & LPCMP_RRCR1_RR_CH5EN_MASK) - -#define LPCMP_RRCR1_RR_CH6EN_MASK (0x40U) -#define LPCMP_RRCR1_RR_CH6EN_SHIFT (6U) -/*! RR_CH6EN - Channel 6 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH6EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH6EN_SHIFT)) & LPCMP_RRCR1_RR_CH6EN_MASK) - -#define LPCMP_RRCR1_RR_CH7EN_MASK (0x80U) -#define LPCMP_RRCR1_RR_CH7EN_SHIFT (7U) -/*! RR_CH7EN - Channel 7 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH7EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH7EN_SHIFT)) & LPCMP_RRCR1_RR_CH7EN_MASK) - -#define LPCMP_RRCR1_FIXP_MASK (0x10000U) -#define LPCMP_RRCR1_FIXP_SHIFT (16U) -/*! FIXP - Fixed Port - * 0b0..Fix the plus port. Sweep only the inputs to the minus port. - * 0b1..Fix the minus port. Sweep only the inputs to the plus port. - */ -#define LPCMP_RRCR1_FIXP(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_FIXP_SHIFT)) & LPCMP_RRCR1_FIXP_MASK) - -#define LPCMP_RRCR1_FIXCH_MASK (0x700000U) -#define LPCMP_RRCR1_FIXCH_SHIFT (20U) -/*! FIXCH - Fixed Channel Select - * 0b000..Channel 0 - * 0b001..Channel 1 - * 0b010..Channel 2 - * 0b011..Channel 3 - * 0b100..Channel 4 - * 0b101..Channel 5 - * 0b110..Channel 6 - * 0b111..Channel 7 - */ -#define LPCMP_RRCR1_FIXCH(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_FIXCH_SHIFT)) & LPCMP_RRCR1_FIXCH_MASK) -/*! @} */ - -/*! @name RRCSR - Round Robin Control and Status */ -/*! @{ */ - -#define LPCMP_RRCSR_RR_CH0OUT_MASK (0x1U) -#define LPCMP_RRCSR_RR_CH0OUT_SHIFT (0U) -/*! RR_CH0OUT - Comparison Result for Channel 0 */ -#define LPCMP_RRCSR_RR_CH0OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH0OUT_SHIFT)) & LPCMP_RRCSR_RR_CH0OUT_MASK) - -#define LPCMP_RRCSR_RR_CH1OUT_MASK (0x2U) -#define LPCMP_RRCSR_RR_CH1OUT_SHIFT (1U) -/*! RR_CH1OUT - Comparison Result for Channel 1 */ -#define LPCMP_RRCSR_RR_CH1OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH1OUT_SHIFT)) & LPCMP_RRCSR_RR_CH1OUT_MASK) - -#define LPCMP_RRCSR_RR_CH2OUT_MASK (0x4U) -#define LPCMP_RRCSR_RR_CH2OUT_SHIFT (2U) -/*! RR_CH2OUT - Comparison Result for Channel 2 */ -#define LPCMP_RRCSR_RR_CH2OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH2OUT_SHIFT)) & LPCMP_RRCSR_RR_CH2OUT_MASK) - -#define LPCMP_RRCSR_RR_CH3OUT_MASK (0x8U) -#define LPCMP_RRCSR_RR_CH3OUT_SHIFT (3U) -/*! RR_CH3OUT - Comparison Result for Channel 3 */ -#define LPCMP_RRCSR_RR_CH3OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH3OUT_SHIFT)) & LPCMP_RRCSR_RR_CH3OUT_MASK) - -#define LPCMP_RRCSR_RR_CH4OUT_MASK (0x10U) -#define LPCMP_RRCSR_RR_CH4OUT_SHIFT (4U) -/*! RR_CH4OUT - Comparison Result for Channel 4 */ -#define LPCMP_RRCSR_RR_CH4OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH4OUT_SHIFT)) & LPCMP_RRCSR_RR_CH4OUT_MASK) - -#define LPCMP_RRCSR_RR_CH5OUT_MASK (0x20U) -#define LPCMP_RRCSR_RR_CH5OUT_SHIFT (5U) -/*! RR_CH5OUT - Comparison Result for Channel 5 */ -#define LPCMP_RRCSR_RR_CH5OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH5OUT_SHIFT)) & LPCMP_RRCSR_RR_CH5OUT_MASK) - -#define LPCMP_RRCSR_RR_CH6OUT_MASK (0x40U) -#define LPCMP_RRCSR_RR_CH6OUT_SHIFT (6U) -/*! RR_CH6OUT - Comparison Result for Channel 6 */ -#define LPCMP_RRCSR_RR_CH6OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH6OUT_SHIFT)) & LPCMP_RRCSR_RR_CH6OUT_MASK) - -#define LPCMP_RRCSR_RR_CH7OUT_MASK (0x80U) -#define LPCMP_RRCSR_RR_CH7OUT_SHIFT (7U) -/*! RR_CH7OUT - Comparison Result for Channel 7 */ -#define LPCMP_RRCSR_RR_CH7OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH7OUT_SHIFT)) & LPCMP_RRCSR_RR_CH7OUT_MASK) -/*! @} */ - -/*! @name RRSR - Round Robin Status */ -/*! @{ */ - -#define LPCMP_RRSR_RR_CH0F_MASK (0x1U) -#define LPCMP_RRSR_RR_CH0F_SHIFT (0U) -/*! RR_CH0F - Channel 0 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH0F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH0F_SHIFT)) & LPCMP_RRSR_RR_CH0F_MASK) - -#define LPCMP_RRSR_RR_CH1F_MASK (0x2U) -#define LPCMP_RRSR_RR_CH1F_SHIFT (1U) -/*! RR_CH1F - Channel 1 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH1F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH1F_SHIFT)) & LPCMP_RRSR_RR_CH1F_MASK) - -#define LPCMP_RRSR_RR_CH2F_MASK (0x4U) -#define LPCMP_RRSR_RR_CH2F_SHIFT (2U) -/*! RR_CH2F - Channel 2 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH2F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH2F_SHIFT)) & LPCMP_RRSR_RR_CH2F_MASK) - -#define LPCMP_RRSR_RR_CH3F_MASK (0x8U) -#define LPCMP_RRSR_RR_CH3F_SHIFT (3U) -/*! RR_CH3F - Channel 3 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH3F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH3F_SHIFT)) & LPCMP_RRSR_RR_CH3F_MASK) - -#define LPCMP_RRSR_RR_CH4F_MASK (0x10U) -#define LPCMP_RRSR_RR_CH4F_SHIFT (4U) -/*! RR_CH4F - Channel 4 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH4F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH4F_SHIFT)) & LPCMP_RRSR_RR_CH4F_MASK) - -#define LPCMP_RRSR_RR_CH5F_MASK (0x20U) -#define LPCMP_RRSR_RR_CH5F_SHIFT (5U) -/*! RR_CH5F - Channel 5 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH5F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH5F_SHIFT)) & LPCMP_RRSR_RR_CH5F_MASK) - -#define LPCMP_RRSR_RR_CH6F_MASK (0x40U) -#define LPCMP_RRSR_RR_CH6F_SHIFT (6U) -/*! RR_CH6F - Channel 6 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH6F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH6F_SHIFT)) & LPCMP_RRSR_RR_CH6F_MASK) - -#define LPCMP_RRSR_RR_CH7F_MASK (0x80U) -#define LPCMP_RRSR_RR_CH7F_SHIFT (7U) -/*! RR_CH7F - Channel 7 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH7F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH7F_SHIFT)) & LPCMP_RRSR_RR_CH7F_MASK) -/*! @} */ - -/*! @name RRCR2 - Round Robin Control Register 2 */ -/*! @{ */ - -#define LPCMP_RRCR2_RR_TIMER_RELOAD_MASK (0xFFFFFFFU) -#define LPCMP_RRCR2_RR_TIMER_RELOAD_SHIFT (0U) -/*! RR_TIMER_RELOAD - Number of Sample Clocks */ -#define LPCMP_RRCR2_RR_TIMER_RELOAD(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR2_RR_TIMER_RELOAD_SHIFT)) & LPCMP_RRCR2_RR_TIMER_RELOAD_MASK) - -#define LPCMP_RRCR2_RR_TIMER_EN_MASK (0x80000000U) -#define LPCMP_RRCR2_RR_TIMER_EN_SHIFT (31U) -/*! RR_TIMER_EN - Round-Robin Internal Timer Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPCMP_RRCR2_RR_TIMER_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR2_RR_TIMER_EN_SHIFT)) & LPCMP_RRCR2_RR_TIMER_EN_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group LPCMP_Register_Masks */ - - -/* LPCMP - Peripheral instance base addresses */ -/** Peripheral CMP0 base address */ -#define CMP0_BASE (0x400B1000u) -/** Peripheral CMP0 base pointer */ -#define CMP0 ((LPCMP_Type *)CMP0_BASE) -/** Peripheral CMP1 base address */ -#define CMP1_BASE (0x400B2000u) -/** Peripheral CMP1 base pointer */ -#define CMP1 ((LPCMP_Type *)CMP1_BASE) -/** Array initializer of LPCMP peripheral base addresses */ -#define LPCMP_BASE_ADDRS { CMP0_BASE, CMP1_BASE } -/** Array initializer of LPCMP peripheral base pointers */ -#define LPCMP_BASE_PTRS { CMP0, CMP1 } - -/*! - * @} - */ /* end of group LPCMP_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LPDAC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPDAC_Peripheral_Access_Layer LPDAC Peripheral Access Layer - * @{ - */ - -/** LPDAC - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version Identifier, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - __O uint32_t DATA; /**< Data, offset: 0x8 */ - __IO uint32_t GCR; /**< Global Control, offset: 0xC */ - __IO uint32_t FCR; /**< DAC FIFO Control, offset: 0x10 */ - __I uint32_t FPR; /**< DAC FIFO Pointer, offset: 0x14 */ - __IO uint32_t FSR; /**< FIFO Status, offset: 0x18 */ - __IO uint32_t IER; /**< Interrupt Enable, offset: 0x1C */ - __IO uint32_t DER; /**< DMA Enable, offset: 0x20 */ - __IO uint32_t RCR; /**< Reset Control, offset: 0x24 */ - __O uint32_t TCR; /**< Trigger Control, offset: 0x28 */ - __IO uint32_t PCR; /**< Periodic Trigger Control, offset: 0x2C */ -} LPDAC_Type; - -/* ---------------------------------------------------------------------------- - -- LPDAC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPDAC_Register_Masks LPDAC Register Masks - * @{ - */ - -/*! @name VERID - Version Identifier */ -/*! @{ */ - -#define LPDAC_VERID_FEATURE_MASK (0xFFFFU) -#define LPDAC_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Identification Number */ -#define LPDAC_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_VERID_FEATURE_SHIFT)) & LPDAC_VERID_FEATURE_MASK) - -#define LPDAC_VERID_MINOR_MASK (0xFF0000U) -#define LPDAC_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define LPDAC_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_VERID_MINOR_SHIFT)) & LPDAC_VERID_MINOR_MASK) - -#define LPDAC_VERID_MAJOR_MASK (0xFF000000U) -#define LPDAC_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define LPDAC_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_VERID_MAJOR_SHIFT)) & LPDAC_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define LPDAC_PARAM_FIFOSZ_MASK (0x7U) -#define LPDAC_PARAM_FIFOSZ_SHIFT (0U) -/*! FIFOSZ - FIFO Size - * 0b000..Reserved - * 0b001..FIFO depth is 4 - * 0b010..FIFO depth is 8 - * 0b011..FIFO depth is 16 - * 0b100..FIFO depth is 32 - * 0b101..FIFO depth is 64 - * 0b110..FIFO depth is 128 - * 0b111..FIFO depth is 256 - */ -#define LPDAC_PARAM_FIFOSZ(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_PARAM_FIFOSZ_SHIFT)) & LPDAC_PARAM_FIFOSZ_MASK) -/*! @} */ - -/*! @name DATA - Data */ -/*! @{ */ - -#define LPDAC_DATA_DATA_MASK (0xFFFU) -#define LPDAC_DATA_DATA_SHIFT (0U) -/*! DATA - FIFO Entry or Buffer Entry */ -#define LPDAC_DATA_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_DATA_DATA_SHIFT)) & LPDAC_DATA_DATA_MASK) -/*! @} */ - -/*! @name GCR - Global Control */ -/*! @{ */ - -#define LPDAC_GCR_DACEN_MASK (0x1U) -#define LPDAC_GCR_DACEN_SHIFT (0U) -/*! DACEN - DAC Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_GCR_DACEN(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_DACEN_SHIFT)) & LPDAC_GCR_DACEN_MASK) - -#define LPDAC_GCR_DACRFS_MASK (0x6U) -#define LPDAC_GCR_DACRFS_SHIFT (1U) -/*! DACRFS - DAC Reference Select - * 0b00..Selects VREFH0 as the reference voltage. - * 0b01..Selects VREFH1 as the reference voltage. - * 0b10..Selects VREFH2 as the reference voltage. - * 0b11..Reserved. - */ -#define LPDAC_GCR_DACRFS(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_DACRFS_SHIFT)) & LPDAC_GCR_DACRFS_MASK) - -#define LPDAC_GCR_FIFOEN_MASK (0x8U) -#define LPDAC_GCR_FIFOEN_SHIFT (3U) -/*! FIFOEN - FIFO Enable - * 0b0..Enables FIFO mode and disables Buffer mode. Any data written to DATA[DATA] goes to buffer then goes to conversion. - * 0b1..Enables FIFO mode. Data will be first read from FIFO to buffer and then goes to conversion. - */ -#define LPDAC_GCR_FIFOEN(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_FIFOEN_SHIFT)) & LPDAC_GCR_FIFOEN_MASK) - -#define LPDAC_GCR_SWMD_MASK (0x10U) -#define LPDAC_GCR_SWMD_SHIFT (4U) -/*! SWMD - Swing Back Mode - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_GCR_SWMD(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_SWMD_SHIFT)) & LPDAC_GCR_SWMD_MASK) - -#define LPDAC_GCR_TRGSEL_MASK (0x20U) -#define LPDAC_GCR_TRGSEL_SHIFT (5U) -/*! TRGSEL - DAC Trigger Select - * 0b0..Hardware trigger - * 0b1..Software trigger - */ -#define LPDAC_GCR_TRGSEL(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_TRGSEL_SHIFT)) & LPDAC_GCR_TRGSEL_MASK) - -#define LPDAC_GCR_PTGEN_MASK (0x40U) -#define LPDAC_GCR_PTGEN_SHIFT (6U) -/*! PTGEN - DAC Periodic Trigger Mode Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_GCR_PTGEN(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_PTGEN_SHIFT)) & LPDAC_GCR_PTGEN_MASK) - -#define LPDAC_GCR_LATCH_CYC_MASK (0xF00U) -#define LPDAC_GCR_LATCH_CYC_SHIFT (8U) -/*! LATCH_CYC - RCLK Cycles Before Data Latch */ -#define LPDAC_GCR_LATCH_CYC(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_LATCH_CYC_SHIFT)) & LPDAC_GCR_LATCH_CYC_MASK) - -#define LPDAC_GCR_BUF_EN_MASK (0x20000U) -#define LPDAC_GCR_BUF_EN_SHIFT (17U) -/*! BUF_EN - Buffer Enable - * 0b0..Not used - * 0b1..Used - */ -#define LPDAC_GCR_BUF_EN(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_BUF_EN_SHIFT)) & LPDAC_GCR_BUF_EN_MASK) - -#define LPDAC_GCR_IREF_PTAT_EXT_SEL_MASK (0x100000U) -#define LPDAC_GCR_IREF_PTAT_EXT_SEL_SHIFT (20U) -/*! IREF_PTAT_EXT_SEL - External On-Chip PTAT Current Reference Select - * 0b0..Not selected - * 0b1..Selected - */ -#define LPDAC_GCR_IREF_PTAT_EXT_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_IREF_PTAT_EXT_SEL_SHIFT)) & LPDAC_GCR_IREF_PTAT_EXT_SEL_MASK) - -#define LPDAC_GCR_IREF_ZTC_EXT_SEL_MASK (0x200000U) -#define LPDAC_GCR_IREF_ZTC_EXT_SEL_SHIFT (21U) -/*! IREF_ZTC_EXT_SEL - External On-Chip ZTC Current Reference Select - * 0b0..Not selected - * 0b1..Selected - */ -#define LPDAC_GCR_IREF_ZTC_EXT_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_IREF_ZTC_EXT_SEL_SHIFT)) & LPDAC_GCR_IREF_ZTC_EXT_SEL_MASK) - -#define LPDAC_GCR_BUF_SPD_CTRL_MASK (0x800000U) -#define LPDAC_GCR_BUF_SPD_CTRL_SHIFT (23U) -/*! BUF_SPD_CTRL - OPAMP as Buffer, Speed Control Signal - * 0b0..Lower Low-Power mode - * 0b1..Low-Power mode - */ -#define LPDAC_GCR_BUF_SPD_CTRL(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_BUF_SPD_CTRL_SHIFT)) & LPDAC_GCR_BUF_SPD_CTRL_MASK) -/*! @} */ - -/*! @name FCR - DAC FIFO Control */ -/*! @{ */ - -#define LPDAC_FCR_WML_MASK (0xFU) -#define LPDAC_FCR_WML_SHIFT (0U) -/*! WML - Watermark Level */ -#define LPDAC_FCR_WML(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_FCR_WML_SHIFT)) & LPDAC_FCR_WML_MASK) -/*! @} */ - -/*! @name FPR - DAC FIFO Pointer */ -/*! @{ */ - -#define LPDAC_FPR_FIFO_RPT_MASK (0xFU) -#define LPDAC_FPR_FIFO_RPT_SHIFT (0U) -/*! FIFO_RPT - FIFO Read Pointer */ -#define LPDAC_FPR_FIFO_RPT(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_FPR_FIFO_RPT_SHIFT)) & LPDAC_FPR_FIFO_RPT_MASK) - -#define LPDAC_FPR_FIFO_WPT_MASK (0xF0000U) -#define LPDAC_FPR_FIFO_WPT_SHIFT (16U) -/*! FIFO_WPT - FIFO Write Pointer */ -#define LPDAC_FPR_FIFO_WPT(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_FPR_FIFO_WPT_SHIFT)) & LPDAC_FPR_FIFO_WPT_MASK) -/*! @} */ - -/*! @name FSR - FIFO Status */ -/*! @{ */ - -#define LPDAC_FSR_FULL_MASK (0x1U) -#define LPDAC_FSR_FULL_SHIFT (0U) -/*! FULL - FIFO Full Flag - * 0b0..Not full - * 0b1..Full - */ -#define LPDAC_FSR_FULL(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_FSR_FULL_SHIFT)) & LPDAC_FSR_FULL_MASK) - -#define LPDAC_FSR_EMPTY_MASK (0x2U) -#define LPDAC_FSR_EMPTY_SHIFT (1U) -/*! EMPTY - FIFO Empty Flag - * 0b0..Not empty - * 0b1..Empty - */ -#define LPDAC_FSR_EMPTY(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_FSR_EMPTY_SHIFT)) & LPDAC_FSR_EMPTY_MASK) - -#define LPDAC_FSR_WM_MASK (0x4U) -#define LPDAC_FSR_WM_SHIFT (2U) -/*! WM - FIFO Watermark Status Flag - * 0b0..Data in FIFO is more than watermark level - * 0b1..Data in FIFO is less than or equal to watermark level - */ -#define LPDAC_FSR_WM(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_FSR_WM_SHIFT)) & LPDAC_FSR_WM_MASK) - -#define LPDAC_FSR_SWBK_MASK (0x8U) -#define LPDAC_FSR_SWBK_SHIFT (3U) -/*! SWBK - Swing Back One Cycle Complete Flag - * 0b0..No swing back cycle has completed since the last time the flag was cleared - * 0b1..At least one swing back cycle has occurred since the last time the flag was cleared - */ -#define LPDAC_FSR_SWBK(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_FSR_SWBK_SHIFT)) & LPDAC_FSR_SWBK_MASK) - -#define LPDAC_FSR_OF_MASK (0x40U) -#define LPDAC_FSR_OF_SHIFT (6U) -/*! OF - FIFO Overflow Flag - * 0b0..No overflow has occurred since the last time the flag was cleared - * 0b1..At least one FIFO overflow has occurred since the last time the flag was cleared - */ -#define LPDAC_FSR_OF(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_FSR_OF_SHIFT)) & LPDAC_FSR_OF_MASK) - -#define LPDAC_FSR_UF_MASK (0x80U) -#define LPDAC_FSR_UF_SHIFT (7U) -/*! UF - FIFO Underflow Flag - * 0b0..No underflow has occurred since the last time the flag was cleared - * 0b1..At least one trigger underflow has occurred since the last time the flag was cleared - */ -#define LPDAC_FSR_UF(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_FSR_UF_SHIFT)) & LPDAC_FSR_UF_MASK) - -#define LPDAC_FSR_PTGCOCO_MASK (0x100U) -#define LPDAC_FSR_PTGCOCO_SHIFT (8U) -/*! PTGCOCO - Period Trigger Mode Conversion Complete Flag - * 0b0..Not completed or not started - * 0b1..Completed - */ -#define LPDAC_FSR_PTGCOCO(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_FSR_PTGCOCO_SHIFT)) & LPDAC_FSR_PTGCOCO_MASK) -/*! @} */ - -/*! @name IER - Interrupt Enable */ -/*! @{ */ - -#define LPDAC_IER_FULL_IE_MASK (0x1U) -#define LPDAC_IER_FULL_IE_SHIFT (0U) -/*! FULL_IE - FIFO Full Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_IER_FULL_IE(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_IER_FULL_IE_SHIFT)) & LPDAC_IER_FULL_IE_MASK) - -#define LPDAC_IER_EMPTY_IE_MASK (0x2U) -#define LPDAC_IER_EMPTY_IE_SHIFT (1U) -/*! EMPTY_IE - FIFO Empty Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_IER_EMPTY_IE(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_IER_EMPTY_IE_SHIFT)) & LPDAC_IER_EMPTY_IE_MASK) - -#define LPDAC_IER_WM_IE_MASK (0x4U) -#define LPDAC_IER_WM_IE_SHIFT (2U) -/*! WM_IE - FIFO Watermark Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_IER_WM_IE(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_IER_WM_IE_SHIFT)) & LPDAC_IER_WM_IE_MASK) - -#define LPDAC_IER_SWBK_IE_MASK (0x8U) -#define LPDAC_IER_SWBK_IE_SHIFT (3U) -/*! SWBK_IE - Swing Back One Cycle Complete Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_IER_SWBK_IE(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_IER_SWBK_IE_SHIFT)) & LPDAC_IER_SWBK_IE_MASK) - -#define LPDAC_IER_OF_IE_MASK (0x40U) -#define LPDAC_IER_OF_IE_SHIFT (6U) -/*! OF_IE - FIFO Overflow Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_IER_OF_IE(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_IER_OF_IE_SHIFT)) & LPDAC_IER_OF_IE_MASK) - -#define LPDAC_IER_UF_IE_MASK (0x80U) -#define LPDAC_IER_UF_IE_SHIFT (7U) -/*! UF_IE - FIFO Underflow Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_IER_UF_IE(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_IER_UF_IE_SHIFT)) & LPDAC_IER_UF_IE_MASK) - -#define LPDAC_IER_PTGCOCO_IE_MASK (0x100U) -#define LPDAC_IER_PTGCOCO_IE_SHIFT (8U) -/*! PTGCOCO_IE - PTG Mode Conversion Complete Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_IER_PTGCOCO_IE(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_IER_PTGCOCO_IE_SHIFT)) & LPDAC_IER_PTGCOCO_IE_MASK) -/*! @} */ - -/*! @name DER - DMA Enable */ -/*! @{ */ - -#define LPDAC_DER_EMPTY_DMAEN_MASK (0x2U) -#define LPDAC_DER_EMPTY_DMAEN_SHIFT (1U) -/*! EMPTY_DMAEN - FIFO Empty DMA Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_DER_EMPTY_DMAEN(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_DER_EMPTY_DMAEN_SHIFT)) & LPDAC_DER_EMPTY_DMAEN_MASK) - -#define LPDAC_DER_WM_DMAEN_MASK (0x4U) -#define LPDAC_DER_WM_DMAEN_SHIFT (2U) -/*! WM_DMAEN - FIFO Watermark DMA Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_DER_WM_DMAEN(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_DER_WM_DMAEN_SHIFT)) & LPDAC_DER_WM_DMAEN_MASK) -/*! @} */ - -/*! @name RCR - Reset Control */ -/*! @{ */ - -#define LPDAC_RCR_SWRST_MASK (0x1U) -#define LPDAC_RCR_SWRST_SHIFT (0U) -/*! SWRST - Software Reset - * 0b0..No effect - * 0b1..Software reset - */ -#define LPDAC_RCR_SWRST(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_RCR_SWRST_SHIFT)) & LPDAC_RCR_SWRST_MASK) - -#define LPDAC_RCR_FIFORST_MASK (0x2U) -#define LPDAC_RCR_FIFORST_SHIFT (1U) -/*! FIFORST - FIFO Reset - * 0b0..No effect - * 0b1..FIFO reset - */ -#define LPDAC_RCR_FIFORST(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_RCR_FIFORST_SHIFT)) & LPDAC_RCR_FIFORST_MASK) -/*! @} */ - -/*! @name TCR - Trigger Control */ -/*! @{ */ - -#define LPDAC_TCR_SWTRG_MASK (0x1U) -#define LPDAC_TCR_SWTRG_SHIFT (0U) -/*! SWTRG - Software Trigger - * 0b0..Not valid - * 0b1..Valid - */ -#define LPDAC_TCR_SWTRG(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_TCR_SWTRG_SHIFT)) & LPDAC_TCR_SWTRG_MASK) -/*! @} */ - -/*! @name PCR - Periodic Trigger Control */ -/*! @{ */ - -#define LPDAC_PCR_PTG_NUM_MASK (0xFFFFU) -#define LPDAC_PCR_PTG_NUM_SHIFT (0U) -/*! PTG_NUM - Periodic Trigger Number */ -#define LPDAC_PCR_PTG_NUM(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_PCR_PTG_NUM_SHIFT)) & LPDAC_PCR_PTG_NUM_MASK) - -#define LPDAC_PCR_PTG_PERIOD_MASK (0xFFFF0000U) -#define LPDAC_PCR_PTG_PERIOD_SHIFT (16U) -/*! PTG_PERIOD - Periodic Trigger Period Width */ -#define LPDAC_PCR_PTG_PERIOD(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_PCR_PTG_PERIOD_SHIFT)) & LPDAC_PCR_PTG_PERIOD_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group LPDAC_Register_Masks */ - - -/* LPDAC - Peripheral instance base addresses */ -/** Peripheral DAC0 base address */ -#define DAC0_BASE (0x400B4000u) -/** Peripheral DAC0 base pointer */ -#define DAC0 ((LPDAC_Type *)DAC0_BASE) -/** Array initializer of LPDAC peripheral base addresses */ -#define LPDAC_BASE_ADDRS { DAC0_BASE } -/** Array initializer of LPDAC peripheral base pointers */ -#define LPDAC_BASE_PTRS { DAC0 } -/** Interrupt vectors for the LPDAC peripheral type */ -#define LPDAC_IRQS { DAC0_IRQn } - -/*! - * @} - */ /* end of group LPDAC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LPI2C Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPI2C_Peripheral_Access_Layer LPI2C Peripheral Access Layer - * @{ - */ - -/** LPI2C - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - uint8_t RESERVED_0[8]; - __IO uint32_t MCR; /**< Controller Control, offset: 0x10 */ - __IO uint32_t MSR; /**< Controller Status, offset: 0x14 */ - __IO uint32_t MIER; /**< Controller Interrupt Enable, offset: 0x18 */ - __IO uint32_t MDER; /**< Controller DMA Enable, offset: 0x1C */ - __IO uint32_t MCFGR0; /**< Controller Configuration 0, offset: 0x20 */ - __IO uint32_t MCFGR1; /**< Controller Configuration 1, offset: 0x24 */ - __IO uint32_t MCFGR2; /**< Controller Configuration 2, offset: 0x28 */ - __IO uint32_t MCFGR3; /**< Controller Configuration 3, offset: 0x2C */ - uint8_t RESERVED_1[16]; - __IO uint32_t MDMR; /**< Controller Data Match, offset: 0x40 */ - uint8_t RESERVED_2[4]; - __IO uint32_t MCCR0; /**< Controller Clock Configuration 0, offset: 0x48 */ - uint8_t RESERVED_3[4]; - __IO uint32_t MCCR1; /**< Controller Clock Configuration 1, offset: 0x50 */ - uint8_t RESERVED_4[4]; - __IO uint32_t MFCR; /**< Controller FIFO Control, offset: 0x58 */ - __I uint32_t MFSR; /**< Controller FIFO Status, offset: 0x5C */ - __O uint32_t MTDR; /**< Controller Transmit Data, offset: 0x60 */ - uint8_t RESERVED_5[12]; - __I uint32_t MRDR; /**< Controller Receive Data, offset: 0x70 */ - uint8_t RESERVED_6[4]; - __I uint32_t MRDROR; /**< Controller Receive Data Read Only, offset: 0x78 */ - uint8_t RESERVED_7[148]; - __IO uint32_t SCR; /**< Target Control, offset: 0x110 */ - __IO uint32_t SSR; /**< Target Status, offset: 0x114 */ - __IO uint32_t SIER; /**< Target Interrupt Enable, offset: 0x118 */ - __IO uint32_t SDER; /**< Target DMA Enable, offset: 0x11C */ - __IO uint32_t SCFGR0; /**< Target Configuration 0, offset: 0x120 */ - __IO uint32_t SCFGR1; /**< Target Configuration 1, offset: 0x124 */ - __IO uint32_t SCFGR2; /**< Target Configuration 2, offset: 0x128 */ - uint8_t RESERVED_8[20]; - __IO uint32_t SAMR; /**< Target Address Match, offset: 0x140 */ - uint8_t RESERVED_9[12]; - __I uint32_t SASR; /**< Target Address Status, offset: 0x150 */ - __IO uint32_t STAR; /**< Target Transmit ACK, offset: 0x154 */ - uint8_t RESERVED_10[8]; - __O uint32_t STDR; /**< Target Transmit Data, offset: 0x160 */ - uint8_t RESERVED_11[12]; - __I uint32_t SRDR; /**< Target Receive Data, offset: 0x170 */ - uint8_t RESERVED_12[4]; - __I uint32_t SRDROR; /**< Target Receive Data Read Only, offset: 0x178 */ -} LPI2C_Type; - -/* ---------------------------------------------------------------------------- - -- LPI2C Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPI2C_Register_Masks LPI2C Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define LPI2C_VERID_FEATURE_MASK (0xFFFFU) -#define LPI2C_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000010..Controller only, with standard feature set - * 0b0000000000000011..Controller and target, with standard feature set - */ -#define LPI2C_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_VERID_FEATURE_SHIFT)) & LPI2C_VERID_FEATURE_MASK) - -#define LPI2C_VERID_MINOR_MASK (0xFF0000U) -#define LPI2C_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define LPI2C_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_VERID_MINOR_SHIFT)) & LPI2C_VERID_MINOR_MASK) - -#define LPI2C_VERID_MAJOR_MASK (0xFF000000U) -#define LPI2C_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define LPI2C_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_VERID_MAJOR_SHIFT)) & LPI2C_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define LPI2C_PARAM_MTXFIFO_MASK (0xFU) -#define LPI2C_PARAM_MTXFIFO_SHIFT (0U) -/*! MTXFIFO - Controller Transmit FIFO Size */ -#define LPI2C_PARAM_MTXFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_PARAM_MTXFIFO_SHIFT)) & LPI2C_PARAM_MTXFIFO_MASK) - -#define LPI2C_PARAM_MRXFIFO_MASK (0xF00U) -#define LPI2C_PARAM_MRXFIFO_SHIFT (8U) -/*! MRXFIFO - Controller Receive FIFO Size */ -#define LPI2C_PARAM_MRXFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_PARAM_MRXFIFO_SHIFT)) & LPI2C_PARAM_MRXFIFO_MASK) -/*! @} */ - -/*! @name MCR - Controller Control */ -/*! @{ */ - -#define LPI2C_MCR_MEN_MASK (0x1U) -#define LPI2C_MCR_MEN_SHIFT (0U) -/*! MEN - Controller Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MCR_MEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCR_MEN_SHIFT)) & LPI2C_MCR_MEN_MASK) - -#define LPI2C_MCR_RST_MASK (0x2U) -#define LPI2C_MCR_RST_SHIFT (1U) -/*! RST - Software Reset - * 0b0..No effect - * 0b1..Reset - */ -#define LPI2C_MCR_RST(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCR_RST_SHIFT)) & LPI2C_MCR_RST_MASK) - -#define LPI2C_MCR_DOZEN_MASK (0x4U) -#define LPI2C_MCR_DOZEN_SHIFT (2U) -/*! DOZEN - Doze Mode Enable - * 0b0..Enable - * 0b1..Disable - */ -#define LPI2C_MCR_DOZEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCR_DOZEN_SHIFT)) & LPI2C_MCR_DOZEN_MASK) - -#define LPI2C_MCR_DBGEN_MASK (0x8U) -#define LPI2C_MCR_DBGEN_SHIFT (3U) -/*! DBGEN - Debug Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MCR_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCR_DBGEN_SHIFT)) & LPI2C_MCR_DBGEN_MASK) - -#define LPI2C_MCR_RTF_MASK (0x100U) -#define LPI2C_MCR_RTF_SHIFT (8U) -/*! RTF - Reset Transmit FIFO - * 0b0..No effect - * 0b1..Reset transmit FIFO - */ -#define LPI2C_MCR_RTF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCR_RTF_SHIFT)) & LPI2C_MCR_RTF_MASK) - -#define LPI2C_MCR_RRF_MASK (0x200U) -#define LPI2C_MCR_RRF_SHIFT (9U) -/*! RRF - Reset Receive FIFO - * 0b0..No effect - * 0b1..Reset receive FIFO - */ -#define LPI2C_MCR_RRF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCR_RRF_SHIFT)) & LPI2C_MCR_RRF_MASK) -/*! @} */ - -/*! @name MSR - Controller Status */ -/*! @{ */ - -#define LPI2C_MSR_TDF_MASK (0x1U) -#define LPI2C_MSR_TDF_SHIFT (0U) -/*! TDF - Transmit Data Flag - * 0b0..Transmit data not requested - * 0b1..Transmit data requested - */ -#define LPI2C_MSR_TDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_TDF_SHIFT)) & LPI2C_MSR_TDF_MASK) - -#define LPI2C_MSR_RDF_MASK (0x2U) -#define LPI2C_MSR_RDF_SHIFT (1U) -/*! RDF - Receive Data Flag - * 0b0..Receive data not ready - * 0b1..Receive data ready - */ -#define LPI2C_MSR_RDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_RDF_SHIFT)) & LPI2C_MSR_RDF_MASK) - -#define LPI2C_MSR_EPF_MASK (0x100U) -#define LPI2C_MSR_EPF_SHIFT (8U) -/*! EPF - End Packet Flag - * 0b0..No Stop or repeated Start generated - * 0b1..Stop or repeated Start generated - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_EPF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_EPF_SHIFT)) & LPI2C_MSR_EPF_MASK) - -#define LPI2C_MSR_SDF_MASK (0x200U) -#define LPI2C_MSR_SDF_SHIFT (9U) -/*! SDF - Stop Detect Flag - * 0b0..No Stop condition generated - * 0b1..Stop condition generated - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_SDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_SDF_SHIFT)) & LPI2C_MSR_SDF_MASK) - -#define LPI2C_MSR_NDF_MASK (0x400U) -#define LPI2C_MSR_NDF_SHIFT (10U) -/*! NDF - NACK Detect Flag - * 0b0..No unexpected NACK detected - * 0b1..Unexpected NACK detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_NDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_NDF_SHIFT)) & LPI2C_MSR_NDF_MASK) - -#define LPI2C_MSR_ALF_MASK (0x800U) -#define LPI2C_MSR_ALF_SHIFT (11U) -/*! ALF - Arbitration Lost Flag - * 0b0..Controller did not lose arbitration - * 0b1..Controller lost arbitration - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_ALF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_ALF_SHIFT)) & LPI2C_MSR_ALF_MASK) - -#define LPI2C_MSR_FEF_MASK (0x1000U) -#define LPI2C_MSR_FEF_SHIFT (12U) -/*! FEF - FIFO Error Flag - * 0b0..No FIFO error - * 0b1..FIFO error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_FEF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_FEF_SHIFT)) & LPI2C_MSR_FEF_MASK) - -#define LPI2C_MSR_PLTF_MASK (0x2000U) -#define LPI2C_MSR_PLTF_SHIFT (13U) -/*! PLTF - Pin Low Timeout Flag - * 0b0..Pin low timeout did not occur - * 0b1..Pin low timeout occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_PLTF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_PLTF_SHIFT)) & LPI2C_MSR_PLTF_MASK) - -#define LPI2C_MSR_DMF_MASK (0x4000U) -#define LPI2C_MSR_DMF_SHIFT (14U) -/*! DMF - Data Match Flag - * 0b0..Matching data not received - * 0b1..Matching data received - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_DMF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_DMF_SHIFT)) & LPI2C_MSR_DMF_MASK) - -#define LPI2C_MSR_STF_MASK (0x8000U) -#define LPI2C_MSR_STF_SHIFT (15U) -/*! STF - Start Flag - * 0b0..Start condition not detected - * 0b1..Start condition detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_STF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_STF_SHIFT)) & LPI2C_MSR_STF_MASK) - -#define LPI2C_MSR_MBF_MASK (0x1000000U) -#define LPI2C_MSR_MBF_SHIFT (24U) -/*! MBF - Controller Busy Flag - * 0b0..Idle - * 0b1..Busy - */ -#define LPI2C_MSR_MBF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_MBF_SHIFT)) & LPI2C_MSR_MBF_MASK) - -#define LPI2C_MSR_BBF_MASK (0x2000000U) -#define LPI2C_MSR_BBF_SHIFT (25U) -/*! BBF - Bus Busy Flag - * 0b0..Idle - * 0b1..Busy - */ -#define LPI2C_MSR_BBF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_BBF_SHIFT)) & LPI2C_MSR_BBF_MASK) -/*! @} */ - -/*! @name MIER - Controller Interrupt Enable */ -/*! @{ */ - -#define LPI2C_MIER_TDIE_MASK (0x1U) -#define LPI2C_MIER_TDIE_SHIFT (0U) -/*! TDIE - Transmit Data Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_TDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_TDIE_SHIFT)) & LPI2C_MIER_TDIE_MASK) - -#define LPI2C_MIER_RDIE_MASK (0x2U) -#define LPI2C_MIER_RDIE_SHIFT (1U) -/*! RDIE - Receive Data Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_RDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_RDIE_SHIFT)) & LPI2C_MIER_RDIE_MASK) - -#define LPI2C_MIER_EPIE_MASK (0x100U) -#define LPI2C_MIER_EPIE_SHIFT (8U) -/*! EPIE - End Packet Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_EPIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_EPIE_SHIFT)) & LPI2C_MIER_EPIE_MASK) - -#define LPI2C_MIER_SDIE_MASK (0x200U) -#define LPI2C_MIER_SDIE_SHIFT (9U) -/*! SDIE - Stop Detect Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_SDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_SDIE_SHIFT)) & LPI2C_MIER_SDIE_MASK) - -#define LPI2C_MIER_NDIE_MASK (0x400U) -#define LPI2C_MIER_NDIE_SHIFT (10U) -/*! NDIE - NACK Detect Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_NDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_NDIE_SHIFT)) & LPI2C_MIER_NDIE_MASK) - -#define LPI2C_MIER_ALIE_MASK (0x800U) -#define LPI2C_MIER_ALIE_SHIFT (11U) -/*! ALIE - Arbitration Lost Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_ALIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_ALIE_SHIFT)) & LPI2C_MIER_ALIE_MASK) - -#define LPI2C_MIER_FEIE_MASK (0x1000U) -#define LPI2C_MIER_FEIE_SHIFT (12U) -/*! FEIE - FIFO Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_FEIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_FEIE_SHIFT)) & LPI2C_MIER_FEIE_MASK) - -#define LPI2C_MIER_PLTIE_MASK (0x2000U) -#define LPI2C_MIER_PLTIE_SHIFT (13U) -/*! PLTIE - Pin Low Timeout Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_PLTIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_PLTIE_SHIFT)) & LPI2C_MIER_PLTIE_MASK) - -#define LPI2C_MIER_DMIE_MASK (0x4000U) -#define LPI2C_MIER_DMIE_SHIFT (14U) -/*! DMIE - Data Match Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_DMIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_DMIE_SHIFT)) & LPI2C_MIER_DMIE_MASK) - -#define LPI2C_MIER_STIE_MASK (0x8000U) -#define LPI2C_MIER_STIE_SHIFT (15U) -/*! STIE - Start Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_STIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_STIE_SHIFT)) & LPI2C_MIER_STIE_MASK) -/*! @} */ - -/*! @name MDER - Controller DMA Enable */ -/*! @{ */ - -#define LPI2C_MDER_TDDE_MASK (0x1U) -#define LPI2C_MDER_TDDE_SHIFT (0U) -/*! TDDE - Transmit Data DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MDER_TDDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MDER_TDDE_SHIFT)) & LPI2C_MDER_TDDE_MASK) - -#define LPI2C_MDER_RDDE_MASK (0x2U) -#define LPI2C_MDER_RDDE_SHIFT (1U) -/*! RDDE - Receive Data DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MDER_RDDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MDER_RDDE_SHIFT)) & LPI2C_MDER_RDDE_MASK) -/*! @} */ - -/*! @name MCFGR0 - Controller Configuration 0 */ -/*! @{ */ - -#define LPI2C_MCFGR0_HREN_MASK (0x1U) -#define LPI2C_MCFGR0_HREN_SHIFT (0U) -/*! HREN - Host Request Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MCFGR0_HREN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_HREN_SHIFT)) & LPI2C_MCFGR0_HREN_MASK) - -#define LPI2C_MCFGR0_HRPOL_MASK (0x2U) -#define LPI2C_MCFGR0_HRPOL_SHIFT (1U) -/*! HRPOL - Host Request Polarity - * 0b0..Active low - * 0b1..Active high - */ -#define LPI2C_MCFGR0_HRPOL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_HRPOL_SHIFT)) & LPI2C_MCFGR0_HRPOL_MASK) - -#define LPI2C_MCFGR0_HRSEL_MASK (0x4U) -#define LPI2C_MCFGR0_HRSEL_SHIFT (2U) -/*! HRSEL - Host Request Select - * 0b0..Host request input is pin HREQ - * 0b1..Host request input is input trigger - */ -#define LPI2C_MCFGR0_HRSEL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_HRSEL_SHIFT)) & LPI2C_MCFGR0_HRSEL_MASK) - -#define LPI2C_MCFGR0_HRDIR_MASK (0x8U) -#define LPI2C_MCFGR0_HRDIR_SHIFT (3U) -/*! HRDIR - Host Request Direction - * 0b0..HREQ pin is input (for LPI2C controller) - * 0b1..HREQ pin is output (for LPI2C target) - */ -#define LPI2C_MCFGR0_HRDIR(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_HRDIR_SHIFT)) & LPI2C_MCFGR0_HRDIR_MASK) - -#define LPI2C_MCFGR0_CIRFIFO_MASK (0x100U) -#define LPI2C_MCFGR0_CIRFIFO_SHIFT (8U) -/*! CIRFIFO - Circular FIFO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MCFGR0_CIRFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_CIRFIFO_SHIFT)) & LPI2C_MCFGR0_CIRFIFO_MASK) - -#define LPI2C_MCFGR0_RDMO_MASK (0x200U) -#define LPI2C_MCFGR0_RDMO_SHIFT (9U) -/*! RDMO - Receive Data Match Only - * 0b0..Received data is stored in the receive FIFO - * 0b1..Received data is discarded unless MSR[DMF] is set - */ -#define LPI2C_MCFGR0_RDMO(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_RDMO_SHIFT)) & LPI2C_MCFGR0_RDMO_MASK) - -#define LPI2C_MCFGR0_RELAX_MASK (0x10000U) -#define LPI2C_MCFGR0_RELAX_SHIFT (16U) -/*! RELAX - Relaxed Mode - * 0b0..Normal transfer - * 0b1..Relaxed transfer - */ -#define LPI2C_MCFGR0_RELAX(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_RELAX_SHIFT)) & LPI2C_MCFGR0_RELAX_MASK) - -#define LPI2C_MCFGR0_ABORT_MASK (0x20000U) -#define LPI2C_MCFGR0_ABORT_SHIFT (17U) -/*! ABORT - Abort Transfer - * 0b0..Normal transfer - * 0b1..Abort existing transfer and do not start a new one - */ -#define LPI2C_MCFGR0_ABORT(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_ABORT_SHIFT)) & LPI2C_MCFGR0_ABORT_MASK) -/*! @} */ - -/*! @name MCFGR1 - Controller Configuration 1 */ -/*! @{ */ - -#define LPI2C_MCFGR1_PRESCALE_MASK (0x7U) -#define LPI2C_MCFGR1_PRESCALE_SHIFT (0U) -/*! PRESCALE - Prescaler - * 0b000..Divide by 1 - * 0b001..Divide by 2 - * 0b010..Divide by 4 - * 0b011..Divide by 8 - * 0b100..Divide by 16 - * 0b101..Divide by 32 - * 0b110..Divide by 64 - * 0b111..Divide by 128 - */ -#define LPI2C_MCFGR1_PRESCALE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_PRESCALE_SHIFT)) & LPI2C_MCFGR1_PRESCALE_MASK) - -#define LPI2C_MCFGR1_AUTOSTOP_MASK (0x100U) -#define LPI2C_MCFGR1_AUTOSTOP_SHIFT (8U) -/*! AUTOSTOP - Automatic Stop Generation - * 0b0..No effect - * 0b1..Stop automatically generated - */ -#define LPI2C_MCFGR1_AUTOSTOP(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_AUTOSTOP_SHIFT)) & LPI2C_MCFGR1_AUTOSTOP_MASK) - -#define LPI2C_MCFGR1_IGNACK_MASK (0x200U) -#define LPI2C_MCFGR1_IGNACK_SHIFT (9U) -/*! IGNACK - Ignore NACK - * 0b0..No effect - * 0b1..Treat a received NACK as an ACK - */ -#define LPI2C_MCFGR1_IGNACK(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_IGNACK_SHIFT)) & LPI2C_MCFGR1_IGNACK_MASK) - -#define LPI2C_MCFGR1_TIMECFG_MASK (0x400U) -#define LPI2C_MCFGR1_TIMECFG_SHIFT (10U) -/*! TIMECFG - Timeout Configuration - * 0b0..SCL - * 0b1..SCL or SDA - */ -#define LPI2C_MCFGR1_TIMECFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_TIMECFG_SHIFT)) & LPI2C_MCFGR1_TIMECFG_MASK) - -#define LPI2C_MCFGR1_STOPCFG_MASK (0x800U) -#define LPI2C_MCFGR1_STOPCFG_SHIFT (11U) -/*! STOPCFG - Stop Configuration - * 0b0..Any Stop condition - * 0b1..Last Stop condition - */ -#define LPI2C_MCFGR1_STOPCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_STOPCFG_SHIFT)) & LPI2C_MCFGR1_STOPCFG_MASK) - -#define LPI2C_MCFGR1_STARTCFG_MASK (0x1000U) -#define LPI2C_MCFGR1_STARTCFG_SHIFT (12U) -/*! STARTCFG - Start Configuration - * 0b0..Sets when both I2C bus and LPI2C controller are idle - * 0b1..Sets when I2C bus is idle - */ -#define LPI2C_MCFGR1_STARTCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_STARTCFG_SHIFT)) & LPI2C_MCFGR1_STARTCFG_MASK) - -#define LPI2C_MCFGR1_MATCFG_MASK (0x70000U) -#define LPI2C_MCFGR1_MATCFG_SHIFT (16U) -/*! MATCFG - Match Configuration - * 0b000..Match is disabled - * 0b001..Reserved - * 0b010..Match is enabled: first data word equals MDMR[MATCH0] OR MDMR[MATCH1] - * 0b011..Match is enabled: any data word equals MDMR[MATCH0] OR MDMR[MATCH1] - * 0b100..Match is enabled: (first data word equals MDMR[MATCH0]) AND (second data word equals MDMR[MATCH1) - * 0b101..Match is enabled: (any data word equals MDMR[MATCH0]) AND (next data word equals MDMR[MATCH1) - * 0b110..Match is enabled: (first data word AND MDMR[MATCH1]) equals (MDMR[MATCH0] AND MDMR[MATCH1]) - * 0b111..Match is enabled: (any data word AND MDMR[MATCH1]) equals (MDMR[MATCH0] AND MDMR[MATCH1]) - */ -#define LPI2C_MCFGR1_MATCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_MATCFG_SHIFT)) & LPI2C_MCFGR1_MATCFG_MASK) - -#define LPI2C_MCFGR1_PINCFG_MASK (0x7000000U) -#define LPI2C_MCFGR1_PINCFG_SHIFT (24U) -/*! PINCFG - Pin Configuration - * 0b000..Two-pin open drain mode - * 0b001..Two-pin output only mode (Ultra-Fast mode) - * 0b010..Two-pin push-pull mode - * 0b011..Four-pin push-pull mode - * 0b100..Two-pin open-drain mode with separate LPI2C target - * 0b101..Two-pin output only mode (Ultra-Fast mode) with separate LPI2C target - * 0b110..Two-pin push-pull mode with separate LPI2C target - * 0b111..Four-pin push-pull mode (inverted outputs) - */ -#define LPI2C_MCFGR1_PINCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_PINCFG_SHIFT)) & LPI2C_MCFGR1_PINCFG_MASK) -/*! @} */ - -/*! @name MCFGR2 - Controller Configuration 2 */ -/*! @{ */ - -#define LPI2C_MCFGR2_BUSIDLE_MASK (0xFFFU) -#define LPI2C_MCFGR2_BUSIDLE_SHIFT (0U) -/*! BUSIDLE - Bus Idle Timeout */ -#define LPI2C_MCFGR2_BUSIDLE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR2_BUSIDLE_SHIFT)) & LPI2C_MCFGR2_BUSIDLE_MASK) - -#define LPI2C_MCFGR2_FILTSCL_MASK (0xF0000U) -#define LPI2C_MCFGR2_FILTSCL_SHIFT (16U) -/*! FILTSCL - Glitch Filter SCL */ -#define LPI2C_MCFGR2_FILTSCL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR2_FILTSCL_SHIFT)) & LPI2C_MCFGR2_FILTSCL_MASK) - -#define LPI2C_MCFGR2_FILTSDA_MASK (0xF000000U) -#define LPI2C_MCFGR2_FILTSDA_SHIFT (24U) -/*! FILTSDA - Glitch Filter SDA */ -#define LPI2C_MCFGR2_FILTSDA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR2_FILTSDA_SHIFT)) & LPI2C_MCFGR2_FILTSDA_MASK) -/*! @} */ - -/*! @name MCFGR3 - Controller Configuration 3 */ -/*! @{ */ - -#define LPI2C_MCFGR3_PINLOW_MASK (0xFFF00U) -#define LPI2C_MCFGR3_PINLOW_SHIFT (8U) -/*! PINLOW - Pin Low Timeout */ -#define LPI2C_MCFGR3_PINLOW(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR3_PINLOW_SHIFT)) & LPI2C_MCFGR3_PINLOW_MASK) -/*! @} */ - -/*! @name MDMR - Controller Data Match */ -/*! @{ */ - -#define LPI2C_MDMR_MATCH0_MASK (0xFFU) -#define LPI2C_MDMR_MATCH0_SHIFT (0U) -/*! MATCH0 - Match 0 Value */ -#define LPI2C_MDMR_MATCH0(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MDMR_MATCH0_SHIFT)) & LPI2C_MDMR_MATCH0_MASK) - -#define LPI2C_MDMR_MATCH1_MASK (0xFF0000U) -#define LPI2C_MDMR_MATCH1_SHIFT (16U) -/*! MATCH1 - Match 1 Value */ -#define LPI2C_MDMR_MATCH1(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MDMR_MATCH1_SHIFT)) & LPI2C_MDMR_MATCH1_MASK) -/*! @} */ - -/*! @name MCCR0 - Controller Clock Configuration 0 */ -/*! @{ */ - -#define LPI2C_MCCR0_CLKLO_MASK (0x3FU) -#define LPI2C_MCCR0_CLKLO_SHIFT (0U) -/*! CLKLO - Clock Low Period */ -#define LPI2C_MCCR0_CLKLO(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR0_CLKLO_SHIFT)) & LPI2C_MCCR0_CLKLO_MASK) - -#define LPI2C_MCCR0_CLKHI_MASK (0x3F00U) -#define LPI2C_MCCR0_CLKHI_SHIFT (8U) -/*! CLKHI - Clock High Period */ -#define LPI2C_MCCR0_CLKHI(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR0_CLKHI_SHIFT)) & LPI2C_MCCR0_CLKHI_MASK) - -#define LPI2C_MCCR0_SETHOLD_MASK (0x3F0000U) -#define LPI2C_MCCR0_SETHOLD_SHIFT (16U) -/*! SETHOLD - Setup Hold Delay */ -#define LPI2C_MCCR0_SETHOLD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR0_SETHOLD_SHIFT)) & LPI2C_MCCR0_SETHOLD_MASK) - -#define LPI2C_MCCR0_DATAVD_MASK (0x3F000000U) -#define LPI2C_MCCR0_DATAVD_SHIFT (24U) -/*! DATAVD - Data Valid Delay */ -#define LPI2C_MCCR0_DATAVD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR0_DATAVD_SHIFT)) & LPI2C_MCCR0_DATAVD_MASK) -/*! @} */ - -/*! @name MCCR1 - Controller Clock Configuration 1 */ -/*! @{ */ - -#define LPI2C_MCCR1_CLKLO_MASK (0x3FU) -#define LPI2C_MCCR1_CLKLO_SHIFT (0U) -/*! CLKLO - Clock Low Period */ -#define LPI2C_MCCR1_CLKLO(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR1_CLKLO_SHIFT)) & LPI2C_MCCR1_CLKLO_MASK) - -#define LPI2C_MCCR1_CLKHI_MASK (0x3F00U) -#define LPI2C_MCCR1_CLKHI_SHIFT (8U) -/*! CLKHI - Clock High Period */ -#define LPI2C_MCCR1_CLKHI(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR1_CLKHI_SHIFT)) & LPI2C_MCCR1_CLKHI_MASK) - -#define LPI2C_MCCR1_SETHOLD_MASK (0x3F0000U) -#define LPI2C_MCCR1_SETHOLD_SHIFT (16U) -/*! SETHOLD - Setup Hold Delay */ -#define LPI2C_MCCR1_SETHOLD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR1_SETHOLD_SHIFT)) & LPI2C_MCCR1_SETHOLD_MASK) - -#define LPI2C_MCCR1_DATAVD_MASK (0x3F000000U) -#define LPI2C_MCCR1_DATAVD_SHIFT (24U) -/*! DATAVD - Data Valid Delay */ -#define LPI2C_MCCR1_DATAVD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR1_DATAVD_SHIFT)) & LPI2C_MCCR1_DATAVD_MASK) -/*! @} */ - -/*! @name MFCR - Controller FIFO Control */ -/*! @{ */ - -#define LPI2C_MFCR_TXWATER_MASK (0x3U) -#define LPI2C_MFCR_TXWATER_SHIFT (0U) -/*! TXWATER - Transmit FIFO Watermark */ -#define LPI2C_MFCR_TXWATER(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MFCR_TXWATER_SHIFT)) & LPI2C_MFCR_TXWATER_MASK) - -#define LPI2C_MFCR_RXWATER_MASK (0x30000U) -#define LPI2C_MFCR_RXWATER_SHIFT (16U) -/*! RXWATER - Receive FIFO Watermark */ -#define LPI2C_MFCR_RXWATER(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MFCR_RXWATER_SHIFT)) & LPI2C_MFCR_RXWATER_MASK) -/*! @} */ - -/*! @name MFSR - Controller FIFO Status */ -/*! @{ */ - -#define LPI2C_MFSR_TXCOUNT_MASK (0x7U) -#define LPI2C_MFSR_TXCOUNT_SHIFT (0U) -/*! TXCOUNT - Transmit FIFO Count */ -#define LPI2C_MFSR_TXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MFSR_TXCOUNT_SHIFT)) & LPI2C_MFSR_TXCOUNT_MASK) - -#define LPI2C_MFSR_RXCOUNT_MASK (0x70000U) -#define LPI2C_MFSR_RXCOUNT_SHIFT (16U) -/*! RXCOUNT - Receive FIFO Count */ -#define LPI2C_MFSR_RXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MFSR_RXCOUNT_SHIFT)) & LPI2C_MFSR_RXCOUNT_MASK) -/*! @} */ - -/*! @name MTDR - Controller Transmit Data */ -/*! @{ */ - -#define LPI2C_MTDR_DATA_MASK (0xFFU) -#define LPI2C_MTDR_DATA_SHIFT (0U) -/*! DATA - Transmit Data */ -#define LPI2C_MTDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MTDR_DATA_SHIFT)) & LPI2C_MTDR_DATA_MASK) - -#define LPI2C_MTDR_CMD_MASK (0x700U) -#define LPI2C_MTDR_CMD_SHIFT (8U) -/*! CMD - Command Data - * 0b000..Transmit the value in DATA[7:0] - * 0b001..Receive (DATA[7:0] + 1) bytes - * 0b010..Generate Stop condition on I2C bus - * 0b011..Receive and discard (DATA[7:0] + 1) bytes - * 0b100..Generate (repeated) Start on the I2C bus and transmit the address in DATA[7:0] - * 0b101..Generate (repeated) Start on the I2C bus and transmit the address in DATA[7:0] (this transfer expects a NACK to be returned) - * 0b110..Generate (repeated) Start on the I2C bus and transmit the address in DATA[7:0] using HS mode - * 0b111..Generate (repeated) Start on the I2C bus and transmit the address in DATA[7:0] using HS mode (this transfer expects a NACK to be returned) - */ -#define LPI2C_MTDR_CMD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MTDR_CMD_SHIFT)) & LPI2C_MTDR_CMD_MASK) -/*! @} */ - -/*! @name MRDR - Controller Receive Data */ -/*! @{ */ - -#define LPI2C_MRDR_DATA_MASK (0xFFU) -#define LPI2C_MRDR_DATA_SHIFT (0U) -/*! DATA - Receive Data */ -#define LPI2C_MRDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MRDR_DATA_SHIFT)) & LPI2C_MRDR_DATA_MASK) - -#define LPI2C_MRDR_RXEMPTY_MASK (0x4000U) -#define LPI2C_MRDR_RXEMPTY_SHIFT (14U) -/*! RXEMPTY - Receive Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPI2C_MRDR_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MRDR_RXEMPTY_SHIFT)) & LPI2C_MRDR_RXEMPTY_MASK) -/*! @} */ - -/*! @name MRDROR - Controller Receive Data Read Only */ -/*! @{ */ - -#define LPI2C_MRDROR_DATA_MASK (0xFFU) -#define LPI2C_MRDROR_DATA_SHIFT (0U) -/*! DATA - Receive Data */ -#define LPI2C_MRDROR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MRDROR_DATA_SHIFT)) & LPI2C_MRDROR_DATA_MASK) - -#define LPI2C_MRDROR_RXEMPTY_MASK (0x4000U) -#define LPI2C_MRDROR_RXEMPTY_SHIFT (14U) -/*! RXEMPTY - RX Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPI2C_MRDROR_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MRDROR_RXEMPTY_SHIFT)) & LPI2C_MRDROR_RXEMPTY_MASK) -/*! @} */ - -/*! @name SCR - Target Control */ -/*! @{ */ - -#define LPI2C_SCR_SEN_MASK (0x1U) -#define LPI2C_SCR_SEN_SHIFT (0U) -/*! SEN - Target Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCR_SEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCR_SEN_SHIFT)) & LPI2C_SCR_SEN_MASK) - -#define LPI2C_SCR_RST_MASK (0x2U) -#define LPI2C_SCR_RST_SHIFT (1U) -/*! RST - Software Reset - * 0b0..Not reset - * 0b1..Reset - */ -#define LPI2C_SCR_RST(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCR_RST_SHIFT)) & LPI2C_SCR_RST_MASK) - -#define LPI2C_SCR_FILTEN_MASK (0x10U) -#define LPI2C_SCR_FILTEN_SHIFT (4U) -/*! FILTEN - Filter Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCR_FILTEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCR_FILTEN_SHIFT)) & LPI2C_SCR_FILTEN_MASK) - -#define LPI2C_SCR_FILTDZ_MASK (0x20U) -#define LPI2C_SCR_FILTDZ_SHIFT (5U) -/*! FILTDZ - Filter Doze Enable - * 0b0..Enable - * 0b1..Disable - */ -#define LPI2C_SCR_FILTDZ(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCR_FILTDZ_SHIFT)) & LPI2C_SCR_FILTDZ_MASK) - -#define LPI2C_SCR_RTF_MASK (0x100U) -#define LPI2C_SCR_RTF_SHIFT (8U) -/*! RTF - Reset Transmit FIFO - * 0b0..No effect - * 0b1..STDR is now empty - */ -#define LPI2C_SCR_RTF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCR_RTF_SHIFT)) & LPI2C_SCR_RTF_MASK) - -#define LPI2C_SCR_RRF_MASK (0x200U) -#define LPI2C_SCR_RRF_SHIFT (9U) -/*! RRF - Reset Receive FIFO - * 0b0..No effect - * 0b1..SRDR is now empty - */ -#define LPI2C_SCR_RRF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCR_RRF_SHIFT)) & LPI2C_SCR_RRF_MASK) -/*! @} */ - -/*! @name SSR - Target Status */ -/*! @{ */ - -#define LPI2C_SSR_TDF_MASK (0x1U) -#define LPI2C_SSR_TDF_SHIFT (0U) -/*! TDF - Transmit Data Flag - * 0b0..Transmit data not requested - * 0b1..Transmit data is requested - */ -#define LPI2C_SSR_TDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_TDF_SHIFT)) & LPI2C_SSR_TDF_MASK) - -#define LPI2C_SSR_RDF_MASK (0x2U) -#define LPI2C_SSR_RDF_SHIFT (1U) -/*! RDF - Receive Data Flag - * 0b0..Not ready - * 0b1..Ready - */ -#define LPI2C_SSR_RDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_RDF_SHIFT)) & LPI2C_SSR_RDF_MASK) - -#define LPI2C_SSR_AVF_MASK (0x4U) -#define LPI2C_SSR_AVF_SHIFT (2U) -/*! AVF - Address Valid Flag - * 0b0..Not valid - * 0b1..Valid - */ -#define LPI2C_SSR_AVF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_AVF_SHIFT)) & LPI2C_SSR_AVF_MASK) - -#define LPI2C_SSR_TAF_MASK (0x8U) -#define LPI2C_SSR_TAF_SHIFT (3U) -/*! TAF - Transmit ACK Flag - * 0b0..Not required - * 0b1..Required - */ -#define LPI2C_SSR_TAF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_TAF_SHIFT)) & LPI2C_SSR_TAF_MASK) - -#define LPI2C_SSR_RSF_MASK (0x100U) -#define LPI2C_SSR_RSF_SHIFT (8U) -/*! RSF - Repeated Start Flag - * 0b0..No repeated Start detected - * 0b1..Repeated Start detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_SSR_RSF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_RSF_SHIFT)) & LPI2C_SSR_RSF_MASK) - -#define LPI2C_SSR_SDF_MASK (0x200U) -#define LPI2C_SSR_SDF_SHIFT (9U) -/*! SDF - Stop Detect Flag - * 0b0..No Stop detected - * 0b1..Stop detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_SSR_SDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_SDF_SHIFT)) & LPI2C_SSR_SDF_MASK) - -#define LPI2C_SSR_BEF_MASK (0x400U) -#define LPI2C_SSR_BEF_SHIFT (10U) -/*! BEF - Bit Error Flag - * 0b0..No bit error occurred - * 0b1..Bit error occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_SSR_BEF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_BEF_SHIFT)) & LPI2C_SSR_BEF_MASK) - -#define LPI2C_SSR_FEF_MASK (0x800U) -#define LPI2C_SSR_FEF_SHIFT (11U) -/*! FEF - FIFO Error Flag - * 0b0..No FIFO error - * 0b1..FIFO error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_SSR_FEF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_FEF_SHIFT)) & LPI2C_SSR_FEF_MASK) - -#define LPI2C_SSR_AM0F_MASK (0x1000U) -#define LPI2C_SSR_AM0F_SHIFT (12U) -/*! AM0F - Address Match 0 Flag - * 0b0..ADDR0 matching address not received - * 0b1..ADDR0 matching address received - */ -#define LPI2C_SSR_AM0F(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_AM0F_SHIFT)) & LPI2C_SSR_AM0F_MASK) - -#define LPI2C_SSR_AM1F_MASK (0x2000U) -#define LPI2C_SSR_AM1F_SHIFT (13U) -/*! AM1F - Address Match 1 Flag - * 0b0..Matching address not received - * 0b1..Matching address received - */ -#define LPI2C_SSR_AM1F(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_AM1F_SHIFT)) & LPI2C_SSR_AM1F_MASK) - -#define LPI2C_SSR_GCF_MASK (0x4000U) -#define LPI2C_SSR_GCF_SHIFT (14U) -/*! GCF - General Call Flag - * 0b0..General call address disabled or not detected - * 0b1..General call address detected - */ -#define LPI2C_SSR_GCF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_GCF_SHIFT)) & LPI2C_SSR_GCF_MASK) - -#define LPI2C_SSR_SARF_MASK (0x8000U) -#define LPI2C_SSR_SARF_SHIFT (15U) -/*! SARF - SMBus Alert Response Flag - * 0b0..Disabled or not detected - * 0b1..Enabled and detected - */ -#define LPI2C_SSR_SARF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_SARF_SHIFT)) & LPI2C_SSR_SARF_MASK) - -#define LPI2C_SSR_SBF_MASK (0x1000000U) -#define LPI2C_SSR_SBF_SHIFT (24U) -/*! SBF - Target Busy Flag - * 0b0..Idle - * 0b1..Busy - */ -#define LPI2C_SSR_SBF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_SBF_SHIFT)) & LPI2C_SSR_SBF_MASK) - -#define LPI2C_SSR_BBF_MASK (0x2000000U) -#define LPI2C_SSR_BBF_SHIFT (25U) -/*! BBF - Bus Busy Flag - * 0b0..Idle - * 0b1..Busy - */ -#define LPI2C_SSR_BBF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_BBF_SHIFT)) & LPI2C_SSR_BBF_MASK) -/*! @} */ - -/*! @name SIER - Target Interrupt Enable */ -/*! @{ */ - -#define LPI2C_SIER_TDIE_MASK (0x1U) -#define LPI2C_SIER_TDIE_SHIFT (0U) -/*! TDIE - Transmit Data Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_TDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_TDIE_SHIFT)) & LPI2C_SIER_TDIE_MASK) - -#define LPI2C_SIER_RDIE_MASK (0x2U) -#define LPI2C_SIER_RDIE_SHIFT (1U) -/*! RDIE - Receive Data Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_RDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_RDIE_SHIFT)) & LPI2C_SIER_RDIE_MASK) - -#define LPI2C_SIER_AVIE_MASK (0x4U) -#define LPI2C_SIER_AVIE_SHIFT (2U) -/*! AVIE - Address Valid Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_AVIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_AVIE_SHIFT)) & LPI2C_SIER_AVIE_MASK) - -#define LPI2C_SIER_TAIE_MASK (0x8U) -#define LPI2C_SIER_TAIE_SHIFT (3U) -/*! TAIE - Transmit ACK Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_TAIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_TAIE_SHIFT)) & LPI2C_SIER_TAIE_MASK) - -#define LPI2C_SIER_RSIE_MASK (0x100U) -#define LPI2C_SIER_RSIE_SHIFT (8U) -/*! RSIE - Repeated Start Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_RSIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_RSIE_SHIFT)) & LPI2C_SIER_RSIE_MASK) - -#define LPI2C_SIER_SDIE_MASK (0x200U) -#define LPI2C_SIER_SDIE_SHIFT (9U) -/*! SDIE - Stop Detect Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_SDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_SDIE_SHIFT)) & LPI2C_SIER_SDIE_MASK) - -#define LPI2C_SIER_BEIE_MASK (0x400U) -#define LPI2C_SIER_BEIE_SHIFT (10U) -/*! BEIE - Bit Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_BEIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_BEIE_SHIFT)) & LPI2C_SIER_BEIE_MASK) - -#define LPI2C_SIER_FEIE_MASK (0x800U) -#define LPI2C_SIER_FEIE_SHIFT (11U) -/*! FEIE - FIFO Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_FEIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_FEIE_SHIFT)) & LPI2C_SIER_FEIE_MASK) - -#define LPI2C_SIER_AM0IE_MASK (0x1000U) -#define LPI2C_SIER_AM0IE_SHIFT (12U) -/*! AM0IE - Address Match 0 Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_AM0IE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_AM0IE_SHIFT)) & LPI2C_SIER_AM0IE_MASK) - -#define LPI2C_SIER_AM1IE_MASK (0x2000U) -#define LPI2C_SIER_AM1IE_SHIFT (13U) -/*! AM1IE - Address Match 1 Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_AM1IE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_AM1IE_SHIFT)) & LPI2C_SIER_AM1IE_MASK) - -#define LPI2C_SIER_GCIE_MASK (0x4000U) -#define LPI2C_SIER_GCIE_SHIFT (14U) -/*! GCIE - General Call Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define LPI2C_SIER_GCIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_GCIE_SHIFT)) & LPI2C_SIER_GCIE_MASK) - -#define LPI2C_SIER_SARIE_MASK (0x8000U) -#define LPI2C_SIER_SARIE_SHIFT (15U) -/*! SARIE - SMBus Alert Response Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_SARIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_SARIE_SHIFT)) & LPI2C_SIER_SARIE_MASK) -/*! @} */ - -/*! @name SDER - Target DMA Enable */ -/*! @{ */ - -#define LPI2C_SDER_TDDE_MASK (0x1U) -#define LPI2C_SDER_TDDE_SHIFT (0U) -/*! TDDE - Transmit Data DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SDER_TDDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SDER_TDDE_SHIFT)) & LPI2C_SDER_TDDE_MASK) - -#define LPI2C_SDER_RDDE_MASK (0x2U) -#define LPI2C_SDER_RDDE_SHIFT (1U) -/*! RDDE - Receive Data DMA Enable - * 0b0..Disable DMA request - * 0b1..Enable DMA request - */ -#define LPI2C_SDER_RDDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SDER_RDDE_SHIFT)) & LPI2C_SDER_RDDE_MASK) - -#define LPI2C_SDER_AVDE_MASK (0x4U) -#define LPI2C_SDER_AVDE_SHIFT (2U) -/*! AVDE - Address Valid DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SDER_AVDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SDER_AVDE_SHIFT)) & LPI2C_SDER_AVDE_MASK) - -#define LPI2C_SDER_RSDE_MASK (0x100U) -#define LPI2C_SDER_RSDE_SHIFT (8U) -/*! RSDE - Repeated Start DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SDER_RSDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SDER_RSDE_SHIFT)) & LPI2C_SDER_RSDE_MASK) - -#define LPI2C_SDER_SDDE_MASK (0x200U) -#define LPI2C_SDER_SDDE_SHIFT (9U) -/*! SDDE - Stop Detect DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SDER_SDDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SDER_SDDE_SHIFT)) & LPI2C_SDER_SDDE_MASK) -/*! @} */ - -/*! @name SCFGR0 - Target Configuration 0 */ -/*! @{ */ - -#define LPI2C_SCFGR0_RDREQ_MASK (0x1U) -#define LPI2C_SCFGR0_RDREQ_SHIFT (0U) -/*! RDREQ - Read Request - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR0_RDREQ(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR0_RDREQ_SHIFT)) & LPI2C_SCFGR0_RDREQ_MASK) - -#define LPI2C_SCFGR0_RDACK_MASK (0x2U) -#define LPI2C_SCFGR0_RDACK_SHIFT (1U) -/*! RDACK - Read Acknowledge Flag - * 0b0..Read Request not acknowledged - * 0b1..Read Request acknowledged - */ -#define LPI2C_SCFGR0_RDACK(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR0_RDACK_SHIFT)) & LPI2C_SCFGR0_RDACK_MASK) -/*! @} */ - -/*! @name SCFGR1 - Target Configuration 1 */ -/*! @{ */ - -#define LPI2C_SCFGR1_ADRSTALL_MASK (0x1U) -#define LPI2C_SCFGR1_ADRSTALL_SHIFT (0U) -/*! ADRSTALL - Address SCL Stall - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_ADRSTALL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_ADRSTALL_SHIFT)) & LPI2C_SCFGR1_ADRSTALL_MASK) - -#define LPI2C_SCFGR1_RXSTALL_MASK (0x2U) -#define LPI2C_SCFGR1_RXSTALL_SHIFT (1U) -/*! RXSTALL - RX SCL Stall - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_RXSTALL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_RXSTALL_SHIFT)) & LPI2C_SCFGR1_RXSTALL_MASK) - -#define LPI2C_SCFGR1_TXDSTALL_MASK (0x4U) -#define LPI2C_SCFGR1_TXDSTALL_SHIFT (2U) -/*! TXDSTALL - Transmit Data SCL Stall - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_TXDSTALL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_TXDSTALL_SHIFT)) & LPI2C_SCFGR1_TXDSTALL_MASK) - -#define LPI2C_SCFGR1_ACKSTALL_MASK (0x8U) -#define LPI2C_SCFGR1_ACKSTALL_SHIFT (3U) -/*! ACKSTALL - ACK SCL Stall - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_ACKSTALL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_ACKSTALL_SHIFT)) & LPI2C_SCFGR1_ACKSTALL_MASK) - -#define LPI2C_SCFGR1_RXNACK_MASK (0x10U) -#define LPI2C_SCFGR1_RXNACK_SHIFT (4U) -/*! RXNACK - Receive NACK - * 0b0..ACK or NACK always determined by STAR[TXNACK] - * 0b1..NACK always generated on address overrun or receive data overrun, otherwise ACK or NACK is determined by STAR[TXNACK] - */ -#define LPI2C_SCFGR1_RXNACK(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_RXNACK_SHIFT)) & LPI2C_SCFGR1_RXNACK_MASK) - -#define LPI2C_SCFGR1_GCEN_MASK (0x100U) -#define LPI2C_SCFGR1_GCEN_SHIFT (8U) -/*! GCEN - General Call Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_GCEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_GCEN_SHIFT)) & LPI2C_SCFGR1_GCEN_MASK) - -#define LPI2C_SCFGR1_SAEN_MASK (0x200U) -#define LPI2C_SCFGR1_SAEN_SHIFT (9U) -/*! SAEN - SMBus Alert Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_SAEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_SAEN_SHIFT)) & LPI2C_SCFGR1_SAEN_MASK) - -#define LPI2C_SCFGR1_TXCFG_MASK (0x400U) -#define LPI2C_SCFGR1_TXCFG_SHIFT (10U) -/*! TXCFG - Transmit Flag Configuration - * 0b0..MSR[TDF] is set only during a target-transmit transfer when STDR is empty - * 0b1..MSR[TDF] is set whenever STDR is empty - */ -#define LPI2C_SCFGR1_TXCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_TXCFG_SHIFT)) & LPI2C_SCFGR1_TXCFG_MASK) - -#define LPI2C_SCFGR1_RXCFG_MASK (0x800U) -#define LPI2C_SCFGR1_RXCFG_SHIFT (11U) -/*! RXCFG - Receive Data Configuration - * 0b0..Return received data, clear MSR[RDF] - * 0b1..Return SASR and clear SSR[AVF] when SSR[AVF] is set, return received data and clear MSR[RDF] when SSR[AFV] is not set - */ -#define LPI2C_SCFGR1_RXCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_RXCFG_SHIFT)) & LPI2C_SCFGR1_RXCFG_MASK) - -#define LPI2C_SCFGR1_IGNACK_MASK (0x1000U) -#define LPI2C_SCFGR1_IGNACK_SHIFT (12U) -/*! IGNACK - Ignore NACK - * 0b0..End transfer on NACK - * 0b1..Do not end transfer on NACK - */ -#define LPI2C_SCFGR1_IGNACK(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_IGNACK_SHIFT)) & LPI2C_SCFGR1_IGNACK_MASK) - -#define LPI2C_SCFGR1_HSMEN_MASK (0x2000U) -#define LPI2C_SCFGR1_HSMEN_SHIFT (13U) -/*! HSMEN - HS Mode Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_HSMEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_HSMEN_SHIFT)) & LPI2C_SCFGR1_HSMEN_MASK) - -#define LPI2C_SCFGR1_ADDRCFG_MASK (0x70000U) -#define LPI2C_SCFGR1_ADDRCFG_SHIFT (16U) -/*! ADDRCFG - Address Configuration - * 0b000..Address match 0 (7-bit) - * 0b001..Address match 0 (10-bit) - * 0b010..Address match 0 (7-bit) or address match 1 (7-bit) - * 0b011..Address match 0 (10-bit) or address match 1 (10-bit) - * 0b100..Address match 0 (7-bit) or address match 1 (10-bit) - * 0b101..Address match 0 (10-bit) or address match 1 (7-bit) - * 0b110..From address match 0 (7-bit) to address match 1 (7-bit) - * 0b111..From address match 0 (10-bit) to address match 1 (10-bit) - */ -#define LPI2C_SCFGR1_ADDRCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_ADDRCFG_SHIFT)) & LPI2C_SCFGR1_ADDRCFG_MASK) - -#define LPI2C_SCFGR1_RXALL_MASK (0x1000000U) -#define LPI2C_SCFGR1_RXALL_SHIFT (24U) -/*! RXALL - Receive All - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_RXALL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_RXALL_SHIFT)) & LPI2C_SCFGR1_RXALL_MASK) - -#define LPI2C_SCFGR1_RSCFG_MASK (0x2000000U) -#define LPI2C_SCFGR1_RSCFG_SHIFT (25U) -/*! RSCFG - Repeated Start Configuration - * 0b0..Any repeated Start condition following an address match - * 0b1..Any repeated Start condition - */ -#define LPI2C_SCFGR1_RSCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_RSCFG_SHIFT)) & LPI2C_SCFGR1_RSCFG_MASK) - -#define LPI2C_SCFGR1_SDCFG_MASK (0x4000000U) -#define LPI2C_SCFGR1_SDCFG_SHIFT (26U) -/*! SDCFG - Stop Detect Configuration - * 0b0..Any Stop condition following an address match - * 0b1..Any Stop condition - */ -#define LPI2C_SCFGR1_SDCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_SDCFG_SHIFT)) & LPI2C_SCFGR1_SDCFG_MASK) -/*! @} */ - -/*! @name SCFGR2 - Target Configuration 2 */ -/*! @{ */ - -#define LPI2C_SCFGR2_CLKHOLD_MASK (0xFU) -#define LPI2C_SCFGR2_CLKHOLD_SHIFT (0U) -/*! CLKHOLD - Clock Hold Time */ -#define LPI2C_SCFGR2_CLKHOLD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR2_CLKHOLD_SHIFT)) & LPI2C_SCFGR2_CLKHOLD_MASK) - -#define LPI2C_SCFGR2_DATAVD_MASK (0x3F00U) -#define LPI2C_SCFGR2_DATAVD_SHIFT (8U) -/*! DATAVD - Data Valid Delay */ -#define LPI2C_SCFGR2_DATAVD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR2_DATAVD_SHIFT)) & LPI2C_SCFGR2_DATAVD_MASK) - -#define LPI2C_SCFGR2_FILTSCL_MASK (0xF0000U) -#define LPI2C_SCFGR2_FILTSCL_SHIFT (16U) -/*! FILTSCL - Glitch Filter SCL */ -#define LPI2C_SCFGR2_FILTSCL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR2_FILTSCL_SHIFT)) & LPI2C_SCFGR2_FILTSCL_MASK) - -#define LPI2C_SCFGR2_FILTSDA_MASK (0xF000000U) -#define LPI2C_SCFGR2_FILTSDA_SHIFT (24U) -/*! FILTSDA - Glitch Filter SDA */ -#define LPI2C_SCFGR2_FILTSDA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR2_FILTSDA_SHIFT)) & LPI2C_SCFGR2_FILTSDA_MASK) -/*! @} */ - -/*! @name SAMR - Target Address Match */ -/*! @{ */ - -#define LPI2C_SAMR_ADDR0_MASK (0x7FEU) -#define LPI2C_SAMR_ADDR0_SHIFT (1U) -/*! ADDR0 - Address 0 Value */ -#define LPI2C_SAMR_ADDR0(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SAMR_ADDR0_SHIFT)) & LPI2C_SAMR_ADDR0_MASK) - -#define LPI2C_SAMR_ADDR1_MASK (0x7FE0000U) -#define LPI2C_SAMR_ADDR1_SHIFT (17U) -/*! ADDR1 - Address 1 Value */ -#define LPI2C_SAMR_ADDR1(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SAMR_ADDR1_SHIFT)) & LPI2C_SAMR_ADDR1_MASK) -/*! @} */ - -/*! @name SASR - Target Address Status */ -/*! @{ */ - -#define LPI2C_SASR_RADDR_MASK (0x7FFU) -#define LPI2C_SASR_RADDR_SHIFT (0U) -/*! RADDR - Received Address */ -#define LPI2C_SASR_RADDR(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SASR_RADDR_SHIFT)) & LPI2C_SASR_RADDR_MASK) - -#define LPI2C_SASR_ANV_MASK (0x4000U) -#define LPI2C_SASR_ANV_SHIFT (14U) -/*! ANV - Address Not Valid - * 0b0..Valid - * 0b1..Not valid - */ -#define LPI2C_SASR_ANV(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SASR_ANV_SHIFT)) & LPI2C_SASR_ANV_MASK) -/*! @} */ - -/*! @name STAR - Target Transmit ACK */ -/*! @{ */ - -#define LPI2C_STAR_TXNACK_MASK (0x1U) -#define LPI2C_STAR_TXNACK_SHIFT (0U) -/*! TXNACK - Transmit NACK - * 0b0..Transmit ACK - * 0b1..Transmit NACK - */ -#define LPI2C_STAR_TXNACK(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_STAR_TXNACK_SHIFT)) & LPI2C_STAR_TXNACK_MASK) -/*! @} */ - -/*! @name STDR - Target Transmit Data */ -/*! @{ */ - -#define LPI2C_STDR_DATA_MASK (0xFFU) -#define LPI2C_STDR_DATA_SHIFT (0U) -/*! DATA - Transmit Data */ -#define LPI2C_STDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_STDR_DATA_SHIFT)) & LPI2C_STDR_DATA_MASK) -/*! @} */ - -/*! @name SRDR - Target Receive Data */ -/*! @{ */ - -#define LPI2C_SRDR_DATA_MASK (0xFFU) -#define LPI2C_SRDR_DATA_SHIFT (0U) -/*! DATA - Received Data */ -#define LPI2C_SRDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDR_DATA_SHIFT)) & LPI2C_SRDR_DATA_MASK) - -#define LPI2C_SRDR_RADDR_MASK (0x700U) -#define LPI2C_SRDR_RADDR_SHIFT (8U) -/*! RADDR - Received Address */ -#define LPI2C_SRDR_RADDR(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDR_RADDR_SHIFT)) & LPI2C_SRDR_RADDR_MASK) - -#define LPI2C_SRDR_RXEMPTY_MASK (0x4000U) -#define LPI2C_SRDR_RXEMPTY_SHIFT (14U) -/*! RXEMPTY - Receive Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPI2C_SRDR_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDR_RXEMPTY_SHIFT)) & LPI2C_SRDR_RXEMPTY_MASK) - -#define LPI2C_SRDR_SOF_MASK (0x8000U) -#define LPI2C_SRDR_SOF_SHIFT (15U) -/*! SOF - Start of Frame - * 0b0..Not first - * 0b1..First - */ -#define LPI2C_SRDR_SOF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDR_SOF_SHIFT)) & LPI2C_SRDR_SOF_MASK) -/*! @} */ - -/*! @name SRDROR - Target Receive Data Read Only */ -/*! @{ */ - -#define LPI2C_SRDROR_DATA_MASK (0xFFU) -#define LPI2C_SRDROR_DATA_SHIFT (0U) -/*! DATA - Receive Data */ -#define LPI2C_SRDROR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDROR_DATA_SHIFT)) & LPI2C_SRDROR_DATA_MASK) - -#define LPI2C_SRDROR_RADDR_MASK (0x700U) -#define LPI2C_SRDROR_RADDR_SHIFT (8U) -/*! RADDR - Received Address */ -#define LPI2C_SRDROR_RADDR(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDROR_RADDR_SHIFT)) & LPI2C_SRDROR_RADDR_MASK) - -#define LPI2C_SRDROR_RXEMPTY_MASK (0x4000U) -#define LPI2C_SRDROR_RXEMPTY_SHIFT (14U) -/*! RXEMPTY - Receive Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPI2C_SRDROR_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDROR_RXEMPTY_SHIFT)) & LPI2C_SRDROR_RXEMPTY_MASK) - -#define LPI2C_SRDROR_SOF_MASK (0x8000U) -#define LPI2C_SRDROR_SOF_SHIFT (15U) -/*! SOF - Start of Frame - * 0b0..Not the first - * 0b1..First - */ -#define LPI2C_SRDROR_SOF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDROR_SOF_SHIFT)) & LPI2C_SRDROR_SOF_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group LPI2C_Register_Masks */ - - -/* LPI2C - Peripheral instance base addresses */ -/** Peripheral LPI2C0 base address */ -#define LPI2C0_BASE (0x4009A000u) -/** Peripheral LPI2C0 base pointer */ -#define LPI2C0 ((LPI2C_Type *)LPI2C0_BASE) -/** Peripheral LPI2C1 base address */ -#define LPI2C1_BASE (0x4009B000u) -/** Peripheral LPI2C1 base pointer */ -#define LPI2C1 ((LPI2C_Type *)LPI2C1_BASE) -/** Peripheral LPI2C2 base address */ -#define LPI2C2_BASE (0x400D4000u) -/** Peripheral LPI2C2 base pointer */ -#define LPI2C2 ((LPI2C_Type *)LPI2C2_BASE) -/** Peripheral LPI2C3 base address */ -#define LPI2C3_BASE (0x400D5000u) -/** Peripheral LPI2C3 base pointer */ -#define LPI2C3 ((LPI2C_Type *)LPI2C3_BASE) -/** Array initializer of LPI2C peripheral base addresses */ -#define LPI2C_BASE_ADDRS { LPI2C0_BASE, LPI2C1_BASE, LPI2C2_BASE, LPI2C3_BASE } -/** Array initializer of LPI2C peripheral base pointers */ -#define LPI2C_BASE_PTRS { LPI2C0, LPI2C1, LPI2C2, LPI2C3 } -/** Interrupt vectors for the LPI2C peripheral type */ -#define LPI2C_IRQS { LPI2C0_IRQn, LPI2C1_IRQn, LPI2C2_IRQn, LPI2C3_IRQn } - -/*! - * @} - */ /* end of group LPI2C_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LPSPI Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPSPI_Peripheral_Access_Layer LPSPI Peripheral Access Layer - * @{ - */ - -/** LPSPI - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - uint8_t RESERVED_0[8]; - __IO uint32_t CR; /**< Control, offset: 0x10 */ - __IO uint32_t SR; /**< Status, offset: 0x14 */ - __IO uint32_t IER; /**< Interrupt Enable, offset: 0x18 */ - __IO uint32_t DER; /**< DMA Enable, offset: 0x1C */ - __IO uint32_t CFGR0; /**< Configuration 0, offset: 0x20 */ - __IO uint32_t CFGR1; /**< Configuration 1, offset: 0x24 */ - uint8_t RESERVED_1[8]; - __IO uint32_t DMR0; /**< Data Match 0, offset: 0x30 */ - __IO uint32_t DMR1; /**< Data Match 1, offset: 0x34 */ - uint8_t RESERVED_2[8]; - __IO uint32_t CCR; /**< Clock Configuration, offset: 0x40 */ - __IO uint32_t CCR1; /**< Clock Configuration 1, offset: 0x44 */ - uint8_t RESERVED_3[16]; - __IO uint32_t FCR; /**< FIFO Control, offset: 0x58 */ - __I uint32_t FSR; /**< FIFO Status, offset: 0x5C */ - __IO uint32_t TCR; /**< Transmit Command, offset: 0x60 */ - __O uint32_t TDR; /**< Transmit Data, offset: 0x64 */ - uint8_t RESERVED_4[8]; - __I uint32_t RSR; /**< Receive Status, offset: 0x70 */ - __I uint32_t RDR; /**< Receive Data, offset: 0x74 */ - __I uint32_t RDROR; /**< Receive Data Read Only, offset: 0x78 */ - uint8_t RESERVED_5[896]; - __O uint32_t TCBR; /**< Transmit Command Burst, offset: 0x3FC */ - __O uint32_t TDBR[128]; /**< Transmit Data Burst, array offset: 0x400, array step: 0x4 */ - __I uint32_t RDBR[128]; /**< Receive Data Burst, array offset: 0x600, array step: 0x4 */ -} LPSPI_Type; - -/* ---------------------------------------------------------------------------- - -- LPSPI Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPSPI_Register_Masks LPSPI Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define LPSPI_VERID_FEATURE_MASK (0xFFFFU) -#define LPSPI_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Module Identification Number - * 0b0000000000000100..Standard feature set supporting a 32-bit shift register. - * *.. - */ -#define LPSPI_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_VERID_FEATURE_SHIFT)) & LPSPI_VERID_FEATURE_MASK) - -#define LPSPI_VERID_MINOR_MASK (0xFF0000U) -#define LPSPI_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define LPSPI_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_VERID_MINOR_SHIFT)) & LPSPI_VERID_MINOR_MASK) - -#define LPSPI_VERID_MAJOR_MASK (0xFF000000U) -#define LPSPI_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define LPSPI_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_VERID_MAJOR_SHIFT)) & LPSPI_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define LPSPI_PARAM_TXFIFO_MASK (0xFFU) -#define LPSPI_PARAM_TXFIFO_SHIFT (0U) -/*! TXFIFO - Transmit FIFO Size */ -#define LPSPI_PARAM_TXFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_PARAM_TXFIFO_SHIFT)) & LPSPI_PARAM_TXFIFO_MASK) - -#define LPSPI_PARAM_RXFIFO_MASK (0xFF00U) -#define LPSPI_PARAM_RXFIFO_SHIFT (8U) -/*! RXFIFO - Receive FIFO Size */ -#define LPSPI_PARAM_RXFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_PARAM_RXFIFO_SHIFT)) & LPSPI_PARAM_RXFIFO_MASK) - -#define LPSPI_PARAM_PCSNUM_MASK (0xFF0000U) -#define LPSPI_PARAM_PCSNUM_SHIFT (16U) -/*! PCSNUM - PCS Number */ -#define LPSPI_PARAM_PCSNUM(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_PARAM_PCSNUM_SHIFT)) & LPSPI_PARAM_PCSNUM_MASK) -/*! @} */ - -/*! @name CR - Control */ -/*! @{ */ - -#define LPSPI_CR_MEN_MASK (0x1U) -#define LPSPI_CR_MEN_SHIFT (0U) -/*! MEN - Module Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CR_MEN(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CR_MEN_SHIFT)) & LPSPI_CR_MEN_MASK) - -#define LPSPI_CR_RST_MASK (0x2U) -#define LPSPI_CR_RST_SHIFT (1U) -/*! RST - Software Reset - * 0b0..Not reset - * 0b1..Reset - */ -#define LPSPI_CR_RST(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CR_RST_SHIFT)) & LPSPI_CR_RST_MASK) - -#define LPSPI_CR_DBGEN_MASK (0x8U) -#define LPSPI_CR_DBGEN_SHIFT (3U) -/*! DBGEN - Debug Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CR_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CR_DBGEN_SHIFT)) & LPSPI_CR_DBGEN_MASK) - -#define LPSPI_CR_RTF_MASK (0x100U) -#define LPSPI_CR_RTF_SHIFT (8U) -/*! RTF - Reset Transmit FIFO - * 0b0..No effect - * 0b1..Reset - */ -#define LPSPI_CR_RTF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CR_RTF_SHIFT)) & LPSPI_CR_RTF_MASK) - -#define LPSPI_CR_RRF_MASK (0x200U) -#define LPSPI_CR_RRF_SHIFT (9U) -/*! RRF - Reset Receive FIFO - * 0b0..No effect - * 0b1..Reset - */ -#define LPSPI_CR_RRF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CR_RRF_SHIFT)) & LPSPI_CR_RRF_MASK) -/*! @} */ - -/*! @name SR - Status */ -/*! @{ */ - -#define LPSPI_SR_TDF_MASK (0x1U) -#define LPSPI_SR_TDF_SHIFT (0U) -/*! TDF - Transmit Data Flag - * 0b0..Transmit data not requested - * 0b1..Transmit data requested - */ -#define LPSPI_SR_TDF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_TDF_SHIFT)) & LPSPI_SR_TDF_MASK) - -#define LPSPI_SR_RDF_MASK (0x2U) -#define LPSPI_SR_RDF_SHIFT (1U) -/*! RDF - Receive Data Flag - * 0b0..Receive data not ready - * 0b1..Receive data ready - */ -#define LPSPI_SR_RDF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_RDF_SHIFT)) & LPSPI_SR_RDF_MASK) - -#define LPSPI_SR_WCF_MASK (0x100U) -#define LPSPI_SR_WCF_SHIFT (8U) -/*! WCF - Word Complete Flag - * 0b0..Not complete - * 0b1..Complete - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPSPI_SR_WCF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_WCF_SHIFT)) & LPSPI_SR_WCF_MASK) - -#define LPSPI_SR_FCF_MASK (0x200U) -#define LPSPI_SR_FCF_SHIFT (9U) -/*! FCF - Frame Complete Flag - * 0b0..Not complete - * 0b1..Complete - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPSPI_SR_FCF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_FCF_SHIFT)) & LPSPI_SR_FCF_MASK) - -#define LPSPI_SR_TCF_MASK (0x400U) -#define LPSPI_SR_TCF_SHIFT (10U) -/*! TCF - Transfer Complete Flag - * 0b0..Not complete - * 0b1..Complete - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPSPI_SR_TCF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_TCF_SHIFT)) & LPSPI_SR_TCF_MASK) - -#define LPSPI_SR_TEF_MASK (0x800U) -#define LPSPI_SR_TEF_SHIFT (11U) -/*! TEF - Transmit Error Flag - * 0b0..No underrun - * 0b1..Underrun - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPSPI_SR_TEF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_TEF_SHIFT)) & LPSPI_SR_TEF_MASK) - -#define LPSPI_SR_REF_MASK (0x1000U) -#define LPSPI_SR_REF_SHIFT (12U) -/*! REF - Receive Error Flag - * 0b0..No overflow - * 0b1..Overflow - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPSPI_SR_REF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_REF_SHIFT)) & LPSPI_SR_REF_MASK) - -#define LPSPI_SR_DMF_MASK (0x2000U) -#define LPSPI_SR_DMF_SHIFT (13U) -/*! DMF - Data Match Flag - * 0b0..No match - * 0b1..Match - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPSPI_SR_DMF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_DMF_SHIFT)) & LPSPI_SR_DMF_MASK) - -#define LPSPI_SR_MBF_MASK (0x1000000U) -#define LPSPI_SR_MBF_SHIFT (24U) -/*! MBF - Module Busy Flag - * 0b0..LPSPI is idle - * 0b1..LPSPI is busy - */ -#define LPSPI_SR_MBF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_MBF_SHIFT)) & LPSPI_SR_MBF_MASK) -/*! @} */ - -/*! @name IER - Interrupt Enable */ -/*! @{ */ - -#define LPSPI_IER_TDIE_MASK (0x1U) -#define LPSPI_IER_TDIE_SHIFT (0U) -/*! TDIE - Transmit Data Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_TDIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_TDIE_SHIFT)) & LPSPI_IER_TDIE_MASK) - -#define LPSPI_IER_RDIE_MASK (0x2U) -#define LPSPI_IER_RDIE_SHIFT (1U) -/*! RDIE - Receive Data Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_RDIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_RDIE_SHIFT)) & LPSPI_IER_RDIE_MASK) - -#define LPSPI_IER_WCIE_MASK (0x100U) -#define LPSPI_IER_WCIE_SHIFT (8U) -/*! WCIE - Word Complete Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_WCIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_WCIE_SHIFT)) & LPSPI_IER_WCIE_MASK) - -#define LPSPI_IER_FCIE_MASK (0x200U) -#define LPSPI_IER_FCIE_SHIFT (9U) -/*! FCIE - Frame Complete Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_FCIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_FCIE_SHIFT)) & LPSPI_IER_FCIE_MASK) - -#define LPSPI_IER_TCIE_MASK (0x400U) -#define LPSPI_IER_TCIE_SHIFT (10U) -/*! TCIE - Transfer Complete Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_TCIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_TCIE_SHIFT)) & LPSPI_IER_TCIE_MASK) - -#define LPSPI_IER_TEIE_MASK (0x800U) -#define LPSPI_IER_TEIE_SHIFT (11U) -/*! TEIE - Transmit Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_TEIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_TEIE_SHIFT)) & LPSPI_IER_TEIE_MASK) - -#define LPSPI_IER_REIE_MASK (0x1000U) -#define LPSPI_IER_REIE_SHIFT (12U) -/*! REIE - Receive Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_REIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_REIE_SHIFT)) & LPSPI_IER_REIE_MASK) - -#define LPSPI_IER_DMIE_MASK (0x2000U) -#define LPSPI_IER_DMIE_SHIFT (13U) -/*! DMIE - Data Match Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_DMIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_DMIE_SHIFT)) & LPSPI_IER_DMIE_MASK) -/*! @} */ - -/*! @name DER - DMA Enable */ -/*! @{ */ - -#define LPSPI_DER_TDDE_MASK (0x1U) -#define LPSPI_DER_TDDE_SHIFT (0U) -/*! TDDE - Transmit Data DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_DER_TDDE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_DER_TDDE_SHIFT)) & LPSPI_DER_TDDE_MASK) - -#define LPSPI_DER_RDDE_MASK (0x2U) -#define LPSPI_DER_RDDE_SHIFT (1U) -/*! RDDE - Receive Data DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_DER_RDDE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_DER_RDDE_SHIFT)) & LPSPI_DER_RDDE_MASK) - -#define LPSPI_DER_FCDE_MASK (0x200U) -#define LPSPI_DER_FCDE_SHIFT (9U) -/*! FCDE - Frame Complete DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_DER_FCDE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_DER_FCDE_SHIFT)) & LPSPI_DER_FCDE_MASK) -/*! @} */ - -/*! @name CFGR0 - Configuration 0 */ -/*! @{ */ - -#define LPSPI_CFGR0_HREN_MASK (0x1U) -#define LPSPI_CFGR0_HREN_SHIFT (0U) -/*! HREN - Host Request Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CFGR0_HREN(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR0_HREN_SHIFT)) & LPSPI_CFGR0_HREN_MASK) - -#define LPSPI_CFGR0_HRPOL_MASK (0x2U) -#define LPSPI_CFGR0_HRPOL_SHIFT (1U) -/*! HRPOL - Host Request Polarity - * 0b0..Active high - * 0b1..Active low - */ -#define LPSPI_CFGR0_HRPOL(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR0_HRPOL_SHIFT)) & LPSPI_CFGR0_HRPOL_MASK) - -#define LPSPI_CFGR0_HRSEL_MASK (0x4U) -#define LPSPI_CFGR0_HRSEL_SHIFT (2U) -/*! HRSEL - Host Request Select - * 0b0..HREQ pin - * 0b1..Input trigger - */ -#define LPSPI_CFGR0_HRSEL(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR0_HRSEL_SHIFT)) & LPSPI_CFGR0_HRSEL_MASK) - -#define LPSPI_CFGR0_HRDIR_MASK (0x8U) -#define LPSPI_CFGR0_HRDIR_SHIFT (3U) -/*! HRDIR - Host Request Direction - * 0b0..Input - * 0b1..Output - */ -#define LPSPI_CFGR0_HRDIR(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR0_HRDIR_SHIFT)) & LPSPI_CFGR0_HRDIR_MASK) - -#define LPSPI_CFGR0_CIRFIFO_MASK (0x100U) -#define LPSPI_CFGR0_CIRFIFO_SHIFT (8U) -/*! CIRFIFO - Circular FIFO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CFGR0_CIRFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR0_CIRFIFO_SHIFT)) & LPSPI_CFGR0_CIRFIFO_MASK) - -#define LPSPI_CFGR0_RDMO_MASK (0x200U) -#define LPSPI_CFGR0_RDMO_SHIFT (9U) -/*! RDMO - Receive Data Match Only - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CFGR0_RDMO(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR0_RDMO_SHIFT)) & LPSPI_CFGR0_RDMO_MASK) -/*! @} */ - -/*! @name CFGR1 - Configuration 1 */ -/*! @{ */ - -#define LPSPI_CFGR1_MASTER_MASK (0x1U) -#define LPSPI_CFGR1_MASTER_SHIFT (0U) -/*! MASTER - Master Mode - * 0b0..Slave mode - * 0b1..Master mode - */ -#define LPSPI_CFGR1_MASTER(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_MASTER_SHIFT)) & LPSPI_CFGR1_MASTER_MASK) - -#define LPSPI_CFGR1_SAMPLE_MASK (0x2U) -#define LPSPI_CFGR1_SAMPLE_SHIFT (1U) -/*! SAMPLE - Sample Point - * 0b0..SCK edge - * 0b1..Delayed SCK edge - */ -#define LPSPI_CFGR1_SAMPLE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_SAMPLE_SHIFT)) & LPSPI_CFGR1_SAMPLE_MASK) - -#define LPSPI_CFGR1_AUTOPCS_MASK (0x4U) -#define LPSPI_CFGR1_AUTOPCS_SHIFT (2U) -/*! AUTOPCS - Automatic PCS - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CFGR1_AUTOPCS(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_AUTOPCS_SHIFT)) & LPSPI_CFGR1_AUTOPCS_MASK) - -#define LPSPI_CFGR1_NOSTALL_MASK (0x8U) -#define LPSPI_CFGR1_NOSTALL_SHIFT (3U) -/*! NOSTALL - No Stall - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CFGR1_NOSTALL(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_NOSTALL_SHIFT)) & LPSPI_CFGR1_NOSTALL_MASK) - -#define LPSPI_CFGR1_PARTIAL_MASK (0x10U) -#define LPSPI_CFGR1_PARTIAL_SHIFT (4U) -/*! PARTIAL - Partial Enable - * 0b0..Discard - * 0b1..Store - */ -#define LPSPI_CFGR1_PARTIAL(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_PARTIAL_SHIFT)) & LPSPI_CFGR1_PARTIAL_MASK) - -#define LPSPI_CFGR1_PCSPOL_MASK (0xF00U) -#define LPSPI_CFGR1_PCSPOL_SHIFT (8U) -/*! PCSPOL - Peripheral Chip Select Polarity - * 0b0000..Active low - * 0b0001..Active high - */ -#define LPSPI_CFGR1_PCSPOL(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_PCSPOL_SHIFT)) & LPSPI_CFGR1_PCSPOL_MASK) - -#define LPSPI_CFGR1_MATCFG_MASK (0x70000U) -#define LPSPI_CFGR1_MATCFG_SHIFT (16U) -/*! MATCFG - Match Configuration - * 0b000..Match is disabled - * 0b001.. - * 0b010..Match first data word with compare word - * 0b011..Match any data word with compare word - * 0b100..Sequential match, first data word - * 0b101..Sequential match, any data word - * 0b110..Match first data word (masked) with compare word (masked) - * 0b111..Match any data word (masked) with compare word (masked) - */ -#define LPSPI_CFGR1_MATCFG(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_MATCFG_SHIFT)) & LPSPI_CFGR1_MATCFG_MASK) - -#define LPSPI_CFGR1_PINCFG_MASK (0x3000000U) -#define LPSPI_CFGR1_PINCFG_SHIFT (24U) -/*! PINCFG - Pin Configuration - * 0b00..SIN is used for input data; SOUT is used for output data - * 0b01..SIN is used for both input and output data; only half-duplex serial transfers are supported - * 0b10..SOUT is used for both input and output data; only half-duplex serial transfers are supported - * 0b11..SOUT is used for input data; SIN is used for output data - */ -#define LPSPI_CFGR1_PINCFG(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_PINCFG_SHIFT)) & LPSPI_CFGR1_PINCFG_MASK) - -#define LPSPI_CFGR1_OUTCFG_MASK (0x4000000U) -#define LPSPI_CFGR1_OUTCFG_SHIFT (26U) -/*! OUTCFG - Output Configuration - * 0b0..Retain last value - * 0b1..3-stated - */ -#define LPSPI_CFGR1_OUTCFG(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_OUTCFG_SHIFT)) & LPSPI_CFGR1_OUTCFG_MASK) - -#define LPSPI_CFGR1_PCSCFG_MASK (0x8000000U) -#define LPSPI_CFGR1_PCSCFG_SHIFT (27U) -/*! PCSCFG - Peripheral Chip Select Configuration - * 0b0..PCS[3:2] configured for chip select function - * 0b1..PCS[3:2] configured for half-duplex 4-bit transfers (PCS[3:2] = DATA[3:2]) - */ -#define LPSPI_CFGR1_PCSCFG(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_PCSCFG_SHIFT)) & LPSPI_CFGR1_PCSCFG_MASK) -/*! @} */ - -/*! @name DMR0 - Data Match 0 */ -/*! @{ */ - -#define LPSPI_DMR0_MATCH0_MASK (0xFFFFFFFFU) -#define LPSPI_DMR0_MATCH0_SHIFT (0U) -/*! MATCH0 - Match 0 Value */ -#define LPSPI_DMR0_MATCH0(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_DMR0_MATCH0_SHIFT)) & LPSPI_DMR0_MATCH0_MASK) -/*! @} */ - -/*! @name DMR1 - Data Match 1 */ -/*! @{ */ - -#define LPSPI_DMR1_MATCH1_MASK (0xFFFFFFFFU) -#define LPSPI_DMR1_MATCH1_SHIFT (0U) -/*! MATCH1 - Match 1 Value */ -#define LPSPI_DMR1_MATCH1(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_DMR1_MATCH1_SHIFT)) & LPSPI_DMR1_MATCH1_MASK) -/*! @} */ - -/*! @name CCR - Clock Configuration */ -/*! @{ */ - -#define LPSPI_CCR_SCKDIV_MASK (0xFFU) -#define LPSPI_CCR_SCKDIV_SHIFT (0U) -/*! SCKDIV - SCK Divider */ -#define LPSPI_CCR_SCKDIV(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR_SCKDIV_SHIFT)) & LPSPI_CCR_SCKDIV_MASK) - -#define LPSPI_CCR_DBT_MASK (0xFF00U) -#define LPSPI_CCR_DBT_SHIFT (8U) -/*! DBT - Delay Between Transfers */ -#define LPSPI_CCR_DBT(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR_DBT_SHIFT)) & LPSPI_CCR_DBT_MASK) - -#define LPSPI_CCR_PCSSCK_MASK (0xFF0000U) -#define LPSPI_CCR_PCSSCK_SHIFT (16U) -/*! PCSSCK - PCS-to-SCK Delay */ -#define LPSPI_CCR_PCSSCK(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR_PCSSCK_SHIFT)) & LPSPI_CCR_PCSSCK_MASK) - -#define LPSPI_CCR_SCKPCS_MASK (0xFF000000U) -#define LPSPI_CCR_SCKPCS_SHIFT (24U) -/*! SCKPCS - SCK-to-PCS Delay */ -#define LPSPI_CCR_SCKPCS(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR_SCKPCS_SHIFT)) & LPSPI_CCR_SCKPCS_MASK) -/*! @} */ - -/*! @name CCR1 - Clock Configuration 1 */ -/*! @{ */ - -#define LPSPI_CCR1_SCKSET_MASK (0xFFU) -#define LPSPI_CCR1_SCKSET_SHIFT (0U) -/*! SCKSET - SCK Setup */ -#define LPSPI_CCR1_SCKSET(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR1_SCKSET_SHIFT)) & LPSPI_CCR1_SCKSET_MASK) - -#define LPSPI_CCR1_SCKHLD_MASK (0xFF00U) -#define LPSPI_CCR1_SCKHLD_SHIFT (8U) -/*! SCKHLD - SCK Hold */ -#define LPSPI_CCR1_SCKHLD(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR1_SCKHLD_SHIFT)) & LPSPI_CCR1_SCKHLD_MASK) - -#define LPSPI_CCR1_PCSPCS_MASK (0xFF0000U) -#define LPSPI_CCR1_PCSPCS_SHIFT (16U) -/*! PCSPCS - PCS to PCS Delay */ -#define LPSPI_CCR1_PCSPCS(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR1_PCSPCS_SHIFT)) & LPSPI_CCR1_PCSPCS_MASK) - -#define LPSPI_CCR1_SCKSCK_MASK (0xFF000000U) -#define LPSPI_CCR1_SCKSCK_SHIFT (24U) -/*! SCKSCK - SCK Inter-Frame Delay */ -#define LPSPI_CCR1_SCKSCK(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR1_SCKSCK_SHIFT)) & LPSPI_CCR1_SCKSCK_MASK) -/*! @} */ - -/*! @name FCR - FIFO Control */ -/*! @{ */ - -#define LPSPI_FCR_TXWATER_MASK (0x3U) -#define LPSPI_FCR_TXWATER_SHIFT (0U) -/*! TXWATER - Transmit FIFO Watermark */ -#define LPSPI_FCR_TXWATER(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_FCR_TXWATER_SHIFT)) & LPSPI_FCR_TXWATER_MASK) - -#define LPSPI_FCR_RXWATER_MASK (0x30000U) -#define LPSPI_FCR_RXWATER_SHIFT (16U) -/*! RXWATER - Receive FIFO Watermark */ -#define LPSPI_FCR_RXWATER(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_FCR_RXWATER_SHIFT)) & LPSPI_FCR_RXWATER_MASK) -/*! @} */ - -/*! @name FSR - FIFO Status */ -/*! @{ */ - -#define LPSPI_FSR_TXCOUNT_MASK (0x7U) -#define LPSPI_FSR_TXCOUNT_SHIFT (0U) -/*! TXCOUNT - Transmit FIFO Count */ -#define LPSPI_FSR_TXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_FSR_TXCOUNT_SHIFT)) & LPSPI_FSR_TXCOUNT_MASK) - -#define LPSPI_FSR_RXCOUNT_MASK (0x70000U) -#define LPSPI_FSR_RXCOUNT_SHIFT (16U) -/*! RXCOUNT - Receive FIFO Count */ -#define LPSPI_FSR_RXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_FSR_RXCOUNT_SHIFT)) & LPSPI_FSR_RXCOUNT_MASK) -/*! @} */ - -/*! @name TCR - Transmit Command */ -/*! @{ */ - -#define LPSPI_TCR_FRAMESZ_MASK (0xFFFU) -#define LPSPI_TCR_FRAMESZ_SHIFT (0U) -/*! FRAMESZ - Frame Size */ -#define LPSPI_TCR_FRAMESZ(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_FRAMESZ_SHIFT)) & LPSPI_TCR_FRAMESZ_MASK) - -#define LPSPI_TCR_WIDTH_MASK (0x30000U) -#define LPSPI_TCR_WIDTH_SHIFT (16U) -/*! WIDTH - Transfer Width - * 0b00..1-bit transfer - * 0b01..2-bit transfer - * 0b10..4-bit transfer - * 0b11..Reserved - */ -#define LPSPI_TCR_WIDTH(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_WIDTH_SHIFT)) & LPSPI_TCR_WIDTH_MASK) - -#define LPSPI_TCR_TXMSK_MASK (0x40000U) -#define LPSPI_TCR_TXMSK_SHIFT (18U) -/*! TXMSK - Transmit Data Mask - * 0b0..Normal transfer - * 0b1..Mask transmit data - */ -#define LPSPI_TCR_TXMSK(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_TXMSK_SHIFT)) & LPSPI_TCR_TXMSK_MASK) - -#define LPSPI_TCR_RXMSK_MASK (0x80000U) -#define LPSPI_TCR_RXMSK_SHIFT (19U) -/*! RXMSK - Receive Data Mask - * 0b0..Normal transfer - * 0b1..Mask receive data - */ -#define LPSPI_TCR_RXMSK(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_RXMSK_SHIFT)) & LPSPI_TCR_RXMSK_MASK) - -#define LPSPI_TCR_CONTC_MASK (0x100000U) -#define LPSPI_TCR_CONTC_SHIFT (20U) -/*! CONTC - Continuing Command - * 0b0..Command word for start of new transfer - * 0b1..Command word for continuing transfer - */ -#define LPSPI_TCR_CONTC(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_CONTC_SHIFT)) & LPSPI_TCR_CONTC_MASK) - -#define LPSPI_TCR_CONT_MASK (0x200000U) -#define LPSPI_TCR_CONT_SHIFT (21U) -/*! CONT - Continuous Transfer - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_TCR_CONT(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_CONT_SHIFT)) & LPSPI_TCR_CONT_MASK) - -#define LPSPI_TCR_BYSW_MASK (0x400000U) -#define LPSPI_TCR_BYSW_SHIFT (22U) -/*! BYSW - Byte Swap - * 0b0..Disable byte swap - * 0b1..Enable byte swap - */ -#define LPSPI_TCR_BYSW(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_BYSW_SHIFT)) & LPSPI_TCR_BYSW_MASK) - -#define LPSPI_TCR_LSBF_MASK (0x800000U) -#define LPSPI_TCR_LSBF_SHIFT (23U) -/*! LSBF - LSB First - * 0b0..MSB first - * 0b1..LSB first - */ -#define LPSPI_TCR_LSBF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_LSBF_SHIFT)) & LPSPI_TCR_LSBF_MASK) - -#define LPSPI_TCR_PCS_MASK (0x3000000U) -#define LPSPI_TCR_PCS_SHIFT (24U) -/*! PCS - Peripheral Chip Select - * 0b00..Transfer using PCS[0] - * 0b01..Transfer using PCS[1] - * 0b10..Transfer using PCS[2] - * 0b11..Transfer using PCS[3] - */ -#define LPSPI_TCR_PCS(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_PCS_SHIFT)) & LPSPI_TCR_PCS_MASK) - -#define LPSPI_TCR_PRESCALE_MASK (0x38000000U) -#define LPSPI_TCR_PRESCALE_SHIFT (27U) -/*! PRESCALE - Prescaler Value - * 0b000..Divide by 1 - * 0b001..Divide by 2 - * 0b010..Divide by 4 - * 0b011..Divide by 8 - * 0b100..Divide by 16 - * 0b101..Divide by 32 - * 0b110..Divide by 64 - * 0b111..Divide by 128 - */ -#define LPSPI_TCR_PRESCALE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_PRESCALE_SHIFT)) & LPSPI_TCR_PRESCALE_MASK) - -#define LPSPI_TCR_CPHA_MASK (0x40000000U) -#define LPSPI_TCR_CPHA_SHIFT (30U) -/*! CPHA - Clock Phase - * 0b0..Captured - * 0b1..Changed - */ -#define LPSPI_TCR_CPHA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_CPHA_SHIFT)) & LPSPI_TCR_CPHA_MASK) - -#define LPSPI_TCR_CPOL_MASK (0x80000000U) -#define LPSPI_TCR_CPOL_SHIFT (31U) -/*! CPOL - Clock Polarity - * 0b0..Inactive low - * 0b1..Inactive high - */ -#define LPSPI_TCR_CPOL(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_CPOL_SHIFT)) & LPSPI_TCR_CPOL_MASK) -/*! @} */ - -/*! @name TDR - Transmit Data */ -/*! @{ */ - -#define LPSPI_TDR_DATA_MASK (0xFFFFFFFFU) -#define LPSPI_TDR_DATA_SHIFT (0U) -/*! DATA - Transmit Data */ -#define LPSPI_TDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TDR_DATA_SHIFT)) & LPSPI_TDR_DATA_MASK) -/*! @} */ - -/*! @name RSR - Receive Status */ -/*! @{ */ - -#define LPSPI_RSR_SOF_MASK (0x1U) -#define LPSPI_RSR_SOF_SHIFT (0U) -/*! SOF - Start of Frame - * 0b0..Subsequent data word - * 0b1..First data word - */ -#define LPSPI_RSR_SOF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_RSR_SOF_SHIFT)) & LPSPI_RSR_SOF_MASK) - -#define LPSPI_RSR_RXEMPTY_MASK (0x2U) -#define LPSPI_RSR_RXEMPTY_SHIFT (1U) -/*! RXEMPTY - RX FIFO Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPSPI_RSR_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_RSR_RXEMPTY_SHIFT)) & LPSPI_RSR_RXEMPTY_MASK) -/*! @} */ - -/*! @name RDR - Receive Data */ -/*! @{ */ - -#define LPSPI_RDR_DATA_MASK (0xFFFFFFFFU) -#define LPSPI_RDR_DATA_SHIFT (0U) -/*! DATA - Receive Data */ -#define LPSPI_RDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_RDR_DATA_SHIFT)) & LPSPI_RDR_DATA_MASK) -/*! @} */ - -/*! @name RDROR - Receive Data Read Only */ -/*! @{ */ - -#define LPSPI_RDROR_DATA_MASK (0xFFFFFFFFU) -#define LPSPI_RDROR_DATA_SHIFT (0U) -/*! DATA - Receive Data */ -#define LPSPI_RDROR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_RDROR_DATA_SHIFT)) & LPSPI_RDROR_DATA_MASK) -/*! @} */ - -/*! @name TCBR - Transmit Command Burst */ -/*! @{ */ - -#define LPSPI_TCBR_DATA_MASK (0xFFFFFFFFU) -#define LPSPI_TCBR_DATA_SHIFT (0U) -/*! DATA - Command Data */ -#define LPSPI_TCBR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCBR_DATA_SHIFT)) & LPSPI_TCBR_DATA_MASK) -/*! @} */ - -/*! @name TDBR - Transmit Data Burst */ -/*! @{ */ - -#define LPSPI_TDBR_DATA_MASK (0xFFFFFFFFU) -#define LPSPI_TDBR_DATA_SHIFT (0U) -/*! DATA - Data */ -#define LPSPI_TDBR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TDBR_DATA_SHIFT)) & LPSPI_TDBR_DATA_MASK) -/*! @} */ - -/* The count of LPSPI_TDBR */ -#define LPSPI_TDBR_COUNT (128U) - -/*! @name RDBR - Receive Data Burst */ -/*! @{ */ - -#define LPSPI_RDBR_DATA_MASK (0xFFFFFFFFU) -#define LPSPI_RDBR_DATA_SHIFT (0U) -/*! DATA - Data */ -#define LPSPI_RDBR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_RDBR_DATA_SHIFT)) & LPSPI_RDBR_DATA_MASK) -/*! @} */ - -/* The count of LPSPI_RDBR */ -#define LPSPI_RDBR_COUNT (128U) - - -/*! - * @} - */ /* end of group LPSPI_Register_Masks */ - - -/* LPSPI - Peripheral instance base addresses */ -/** Peripheral LPSPI0 base address */ -#define LPSPI0_BASE (0x4009C000u) -/** Peripheral LPSPI0 base pointer */ -#define LPSPI0 ((LPSPI_Type *)LPSPI0_BASE) -/** Peripheral LPSPI1 base address */ -#define LPSPI1_BASE (0x4009D000u) -/** Peripheral LPSPI1 base pointer */ -#define LPSPI1 ((LPSPI_Type *)LPSPI1_BASE) -/** Array initializer of LPSPI peripheral base addresses */ -#define LPSPI_BASE_ADDRS { LPSPI0_BASE, LPSPI1_BASE } -/** Array initializer of LPSPI peripheral base pointers */ -#define LPSPI_BASE_PTRS { LPSPI0, LPSPI1 } -/** Interrupt vectors for the LPSPI peripheral type */ -#define LPSPI_IRQS { LPSPI0_IRQn, LPSPI1_IRQn } - -/*! - * @} - */ /* end of group LPSPI_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LPTMR Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPTMR_Peripheral_Access_Layer LPTMR Peripheral Access Layer - * @{ - */ - -/** LPTMR - Register Layout Typedef */ -typedef struct { - __IO uint32_t CSR; /**< Control Status, offset: 0x0 */ - __IO uint32_t PSR; /**< Prescaler and Glitch Filter, offset: 0x4 */ - __IO uint32_t CMR; /**< Compare, offset: 0x8 */ - __IO uint32_t CNR; /**< Counter, offset: 0xC */ -} LPTMR_Type; - -/* ---------------------------------------------------------------------------- - -- LPTMR Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPTMR_Register_Masks LPTMR Register Masks - * @{ - */ - -/*! @name CSR - Control Status */ -/*! @{ */ - -#define LPTMR_CSR_TEN_MASK (0x1U) -#define LPTMR_CSR_TEN_SHIFT (0U) -/*! TEN - Timer Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPTMR_CSR_TEN(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TEN_SHIFT)) & LPTMR_CSR_TEN_MASK) - -#define LPTMR_CSR_TMS_MASK (0x2U) -#define LPTMR_CSR_TMS_SHIFT (1U) -/*! TMS - Timer Mode Select - * 0b0..Time Counter - * 0b1..Pulse Counter - */ -#define LPTMR_CSR_TMS(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TMS_SHIFT)) & LPTMR_CSR_TMS_MASK) - -#define LPTMR_CSR_TFC_MASK (0x4U) -#define LPTMR_CSR_TFC_SHIFT (2U) -/*! TFC - Timer Free-Running Counter - * 0b0..Reset when TCF asserts - * 0b1..Reset on overflow - */ -#define LPTMR_CSR_TFC(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TFC_SHIFT)) & LPTMR_CSR_TFC_MASK) - -#define LPTMR_CSR_TPP_MASK (0x8U) -#define LPTMR_CSR_TPP_SHIFT (3U) -/*! TPP - Timer Pin Polarity - * 0b0..Active-high - * 0b1..Active-low - */ -#define LPTMR_CSR_TPP(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TPP_SHIFT)) & LPTMR_CSR_TPP_MASK) - -#define LPTMR_CSR_TPS_MASK (0x30U) -#define LPTMR_CSR_TPS_SHIFT (4U) -/*! TPS - Timer Pin Select - * 0b00..Input 0 - * 0b01..Input 1 - * 0b10..Input 2 - * 0b11..Input 3 - */ -#define LPTMR_CSR_TPS(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TPS_SHIFT)) & LPTMR_CSR_TPS_MASK) - -#define LPTMR_CSR_TIE_MASK (0x40U) -#define LPTMR_CSR_TIE_SHIFT (6U) -/*! TIE - Timer Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPTMR_CSR_TIE(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TIE_SHIFT)) & LPTMR_CSR_TIE_MASK) - -#define LPTMR_CSR_TCF_MASK (0x80U) -#define LPTMR_CSR_TCF_SHIFT (7U) -/*! TCF - Timer Compare Flag - * 0b0..CNR != (CMR + 1) - * 0b1..CNR = (CMR + 1) - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPTMR_CSR_TCF(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TCF_SHIFT)) & LPTMR_CSR_TCF_MASK) - -#define LPTMR_CSR_TDRE_MASK (0x100U) -#define LPTMR_CSR_TDRE_SHIFT (8U) -/*! TDRE - Timer DMA Request Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPTMR_CSR_TDRE(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TDRE_SHIFT)) & LPTMR_CSR_TDRE_MASK) -/*! @} */ - -/*! @name PSR - Prescaler and Glitch Filter */ -/*! @{ */ - -#define LPTMR_PSR_PCS_MASK (0x3U) -#define LPTMR_PSR_PCS_SHIFT (0U) -/*! PCS - Prescaler and Glitch Filter Clock Select - * 0b00..Clock 0 - * 0b01..Clock 1 - * 0b10..Clock 2 - * 0b11..Clock 3 - */ -#define LPTMR_PSR_PCS(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_PSR_PCS_SHIFT)) & LPTMR_PSR_PCS_MASK) - -#define LPTMR_PSR_PBYP_MASK (0x4U) -#define LPTMR_PSR_PBYP_SHIFT (2U) -/*! PBYP - Prescaler and Glitch Filter Bypass - * 0b0..Prescaler and glitch filter enable - * 0b1..Prescaler and glitch filter bypass - */ -#define LPTMR_PSR_PBYP(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_PSR_PBYP_SHIFT)) & LPTMR_PSR_PBYP_MASK) - -#define LPTMR_PSR_PRESCALE_MASK (0x78U) -#define LPTMR_PSR_PRESCALE_SHIFT (3U) -/*! PRESCALE - Prescaler and Glitch Filter Value - * 0b0000..Prescaler divides the prescaler clock by 2; glitch filter does not support this configuration - * 0b0001..Prescaler divides the prescaler clock by 4; glitch filter recognizes change on input pin after two rising clock edges - * 0b0010..Prescaler divides the prescaler clock by 8; glitch filter recognizes change on input pin after four rising clock edges - * 0b0011..Prescaler divides the prescaler clock by 16; glitch filter recognizes change on input pin after eight rising clock edges - * 0b0100..Prescaler divides the prescaler clock by 32; glitch filter recognizes change on input pin after 16 rising clock edges - * 0b0101..Prescaler divides the prescaler clock by 64; glitch filter recognizes change on input pin after 32 rising clock edges - * 0b0110..Prescaler divides the prescaler clock by 128; glitch filter recognizes change on input pin after 64 rising clock edges - * 0b0111..Prescaler divides the prescaler clock by 256; glitch filter recognizes change on input pin after 128 rising clock edges - * 0b1000..Prescaler divides the prescaler clock by 512; glitch filter recognizes change on input pin after 256 rising clock edges - * 0b1001..Prescaler divides the prescaler clock by 1024; glitch filter recognizes change on input pin after 512 rising clock edges - * 0b1010..Prescaler divides the prescaler clock by 2048; glitch filter recognizes change on input pin after 1024 rising clock edges - * 0b1011..Prescaler divides the prescaler clock by 4096; glitch filter recognizes change on input pin after 2048 rising clock edges - * 0b1100..Prescaler divides the prescaler clock by 8192; glitch filter recognizes change on input pin after 4096 rising clock edges - * 0b1101..Prescaler divides the prescaler clock by 16,384; glitch filter recognizes change on input pin after 8192 rising clock edges - * 0b1110..Prescaler divides the prescaler clock by 32,768; glitch filter recognizes change on input pin after 16,384 rising clock edges - * 0b1111..Prescaler divides the prescaler clock by 65,536; glitch filter recognizes change on input pin after 32,768 rising clock edges - */ -#define LPTMR_PSR_PRESCALE(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_PSR_PRESCALE_SHIFT)) & LPTMR_PSR_PRESCALE_MASK) -/*! @} */ - -/*! @name CMR - Compare */ -/*! @{ */ - -#define LPTMR_CMR_COMPARE_MASK (0xFFFFFFFFU) -#define LPTMR_CMR_COMPARE_SHIFT (0U) -/*! COMPARE - Compare Value */ -#define LPTMR_CMR_COMPARE(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CMR_COMPARE_SHIFT)) & LPTMR_CMR_COMPARE_MASK) -/*! @} */ - -/*! @name CNR - Counter */ -/*! @{ */ - -#define LPTMR_CNR_COUNTER_MASK (0xFFFFFFFFU) -#define LPTMR_CNR_COUNTER_SHIFT (0U) -/*! COUNTER - Counter Value */ -#define LPTMR_CNR_COUNTER(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CNR_COUNTER_SHIFT)) & LPTMR_CNR_COUNTER_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group LPTMR_Register_Masks */ - - -/* LPTMR - Peripheral instance base addresses */ -/** Peripheral LPTMR0 base address */ -#define LPTMR0_BASE (0x400AB000u) -/** Peripheral LPTMR0 base pointer */ -#define LPTMR0 ((LPTMR_Type *)LPTMR0_BASE) -/** Array initializer of LPTMR peripheral base addresses */ -#define LPTMR_BASE_ADDRS { LPTMR0_BASE } -/** Array initializer of LPTMR peripheral base pointers */ -#define LPTMR_BASE_PTRS { LPTMR0 } -/** Interrupt vectors for the LPTMR peripheral type */ -#define LPTMR_IRQS { LPTMR0_IRQn } - -/*! - * @} - */ /* end of group LPTMR_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LPUART Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPUART_Peripheral_Access_Layer LPUART Peripheral Access Layer - * @{ - */ - -/** LPUART - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - __IO uint32_t GLOBAL; /**< Global, offset: 0x8 */ - __IO uint32_t PINCFG; /**< Pin Configuration, offset: 0xC */ - __IO uint32_t BAUD; /**< Baud Rate, offset: 0x10 */ - __IO uint32_t STAT; /**< Status, offset: 0x14 */ - __IO uint32_t CTRL; /**< Control, offset: 0x18 */ - __IO uint32_t DATA; /**< Data, offset: 0x1C */ - __IO uint32_t MATCH; /**< Match Address, offset: 0x20 */ - __IO uint32_t MODIR; /**< MODEM IrDA, offset: 0x24 */ - __IO uint32_t FIFO; /**< FIFO, offset: 0x28 */ - __IO uint32_t WATER; /**< Watermark, offset: 0x2C */ - __I uint32_t DATARO; /**< Data Read-Only, offset: 0x30 */ -} LPUART_Type; - -/* ---------------------------------------------------------------------------- - -- LPUART Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPUART_Register_Masks LPUART Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define LPUART_VERID_FEATURE_MASK (0xFFFFU) -#define LPUART_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Identification Number - * 0b0000000000000001..Standard feature set - * 0b0000000000000011..Standard feature set with MODEM and IrDA support - */ -#define LPUART_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_VERID_FEATURE_SHIFT)) & LPUART_VERID_FEATURE_MASK) - -#define LPUART_VERID_MINOR_MASK (0xFF0000U) -#define LPUART_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define LPUART_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_VERID_MINOR_SHIFT)) & LPUART_VERID_MINOR_MASK) - -#define LPUART_VERID_MAJOR_MASK (0xFF000000U) -#define LPUART_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define LPUART_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_VERID_MAJOR_SHIFT)) & LPUART_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define LPUART_PARAM_TXFIFO_MASK (0xFFU) -#define LPUART_PARAM_TXFIFO_SHIFT (0U) -/*! TXFIFO - Transmit FIFO Size */ -#define LPUART_PARAM_TXFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPUART_PARAM_TXFIFO_SHIFT)) & LPUART_PARAM_TXFIFO_MASK) - -#define LPUART_PARAM_RXFIFO_MASK (0xFF00U) -#define LPUART_PARAM_RXFIFO_SHIFT (8U) -/*! RXFIFO - Receive FIFO Size */ -#define LPUART_PARAM_RXFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPUART_PARAM_RXFIFO_SHIFT)) & LPUART_PARAM_RXFIFO_MASK) -/*! @} */ - -/*! @name GLOBAL - Global */ -/*! @{ */ - -#define LPUART_GLOBAL_RST_MASK (0x2U) -#define LPUART_GLOBAL_RST_SHIFT (1U) -/*! RST - Software Reset - * 0b0..Not reset - * 0b1..Reset - */ -#define LPUART_GLOBAL_RST(x) (((uint32_t)(((uint32_t)(x)) << LPUART_GLOBAL_RST_SHIFT)) & LPUART_GLOBAL_RST_MASK) -/*! @} */ - -/*! @name PINCFG - Pin Configuration */ -/*! @{ */ - -#define LPUART_PINCFG_TRGSEL_MASK (0x3U) -#define LPUART_PINCFG_TRGSEL_SHIFT (0U) -/*! TRGSEL - Trigger Select - * 0b00..Input trigger disabled - * 0b01..Input trigger used instead of the RXD pin input - * 0b10..Input trigger used instead of the CTS_B pin input - * 0b11..Input trigger used to modulate the TXD pin output, which (after TXINV configuration) is internally ANDed with the input trigger - */ -#define LPUART_PINCFG_TRGSEL(x) (((uint32_t)(((uint32_t)(x)) << LPUART_PINCFG_TRGSEL_SHIFT)) & LPUART_PINCFG_TRGSEL_MASK) -/*! @} */ - -/*! @name BAUD - Baud Rate */ -/*! @{ */ - -#define LPUART_BAUD_SBR_MASK (0x1FFFU) -#define LPUART_BAUD_SBR_SHIFT (0U) -/*! SBR - Baud Rate Modulo Divisor */ -#define LPUART_BAUD_SBR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_SBR_SHIFT)) & LPUART_BAUD_SBR_MASK) - -#define LPUART_BAUD_SBNS_MASK (0x2000U) -#define LPUART_BAUD_SBNS_SHIFT (13U) -/*! SBNS - Stop Bit Number Select - * 0b0..One stop bit - * 0b1..Two stop bits - */ -#define LPUART_BAUD_SBNS(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_SBNS_SHIFT)) & LPUART_BAUD_SBNS_MASK) - -#define LPUART_BAUD_RXEDGIE_MASK (0x4000U) -#define LPUART_BAUD_RXEDGIE_SHIFT (14U) -/*! RXEDGIE - RX Input Active Edge Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_RXEDGIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_RXEDGIE_SHIFT)) & LPUART_BAUD_RXEDGIE_MASK) - -#define LPUART_BAUD_LBKDIE_MASK (0x8000U) -#define LPUART_BAUD_LBKDIE_SHIFT (15U) -/*! LBKDIE - LIN Break Detect Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_LBKDIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_LBKDIE_SHIFT)) & LPUART_BAUD_LBKDIE_MASK) - -#define LPUART_BAUD_RESYNCDIS_MASK (0x10000U) -#define LPUART_BAUD_RESYNCDIS_SHIFT (16U) -/*! RESYNCDIS - Resynchronization Disable - * 0b0..Enable - * 0b1..Disable - */ -#define LPUART_BAUD_RESYNCDIS(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_RESYNCDIS_SHIFT)) & LPUART_BAUD_RESYNCDIS_MASK) - -#define LPUART_BAUD_BOTHEDGE_MASK (0x20000U) -#define LPUART_BAUD_BOTHEDGE_SHIFT (17U) -/*! BOTHEDGE - Both Edge Sampling - * 0b0..Rising edge - * 0b1..Both rising and falling edges - */ -#define LPUART_BAUD_BOTHEDGE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_BOTHEDGE_SHIFT)) & LPUART_BAUD_BOTHEDGE_MASK) - -#define LPUART_BAUD_MATCFG_MASK (0xC0000U) -#define LPUART_BAUD_MATCFG_SHIFT (18U) -/*! MATCFG - Match Configuration - * 0b00..Address match wake-up - * 0b01..Idle match wake-up - * 0b10..Match on and match off - * 0b11..Enables RWU on data match and match on or off for the transmitter CTS input - */ -#define LPUART_BAUD_MATCFG(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_MATCFG_SHIFT)) & LPUART_BAUD_MATCFG_MASK) - -#define LPUART_BAUD_RIDMAE_MASK (0x100000U) -#define LPUART_BAUD_RIDMAE_SHIFT (20U) -/*! RIDMAE - Receiver Idle DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_RIDMAE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_RIDMAE_SHIFT)) & LPUART_BAUD_RIDMAE_MASK) - -#define LPUART_BAUD_RDMAE_MASK (0x200000U) -#define LPUART_BAUD_RDMAE_SHIFT (21U) -/*! RDMAE - Receiver Full DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_RDMAE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_RDMAE_SHIFT)) & LPUART_BAUD_RDMAE_MASK) - -#define LPUART_BAUD_TDMAE_MASK (0x800000U) -#define LPUART_BAUD_TDMAE_SHIFT (23U) -/*! TDMAE - Transmitter DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_TDMAE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_TDMAE_SHIFT)) & LPUART_BAUD_TDMAE_MASK) - -#define LPUART_BAUD_OSR_MASK (0x1F000000U) -#define LPUART_BAUD_OSR_SHIFT (24U) -/*! OSR - Oversampling Ratio - * 0b00000..Results in an OSR of 16 - * 0b00001..Reserved - * 0b00010..Reserved - * 0b00011..Results in an OSR of 4 (requires BAUD[BOTHEDGE] to be 1) - * 0b00100..Results in an OSR of 5 (requires BAUD[BOTHEDGE] to be 1) - * 0b00101..Results in an OSR of 6 (requires BAUD[BOTHEDGE] to be 1) - * 0b00110..Results in an OSR of 7 (requires BAUD[BOTHEDGE] to be 1) - * 0b00111..Results in an OSR of 8 - * 0b01000..Results in an OSR of 9 - * 0b01001..Results in an OSR of 10 - * 0b01010..Results in an OSR of 11 - * 0b01011..Results in an OSR of 12 - * 0b01100..Results in an OSR of 13 - * 0b01101..Results in an OSR of 14 - * 0b01110..Results in an OSR of 15 - * 0b01111..Results in an OSR of 16 - * 0b10000..Results in an OSR of 17 - * 0b10001..Results in an OSR of 18 - * 0b10010..Results in an OSR of 19 - * 0b10011..Results in an OSR of 20 - * 0b10100..Results in an OSR of 21 - * 0b10101..Results in an OSR of 22 - * 0b10110..Results in an OSR of 23 - * 0b10111..Results in an OSR of 24 - * 0b11000..Results in an OSR of 25 - * 0b11001..Results in an OSR of 26 - * 0b11010..Results in an OSR of 27 - * 0b11011..Results in an OSR of 28 - * 0b11100..Results in an OSR of 29 - * 0b11101..Results in an OSR of 30 - * 0b11110..Results in an OSR of 31 - * 0b11111..Results in an OSR of 32 - */ -#define LPUART_BAUD_OSR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_OSR_SHIFT)) & LPUART_BAUD_OSR_MASK) - -#define LPUART_BAUD_M10_MASK (0x20000000U) -#define LPUART_BAUD_M10_SHIFT (29U) -/*! M10 - 10-Bit Mode Select - * 0b0..Receiver and transmitter use 7-bit to 9-bit data characters - * 0b1..Receiver and transmitter use 10-bit data characters - */ -#define LPUART_BAUD_M10(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_M10_SHIFT)) & LPUART_BAUD_M10_MASK) - -#define LPUART_BAUD_MAEN2_MASK (0x40000000U) -#define LPUART_BAUD_MAEN2_SHIFT (30U) -/*! MAEN2 - Match Address Mode Enable 2 - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_MAEN2(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_MAEN2_SHIFT)) & LPUART_BAUD_MAEN2_MASK) - -#define LPUART_BAUD_MAEN1_MASK (0x80000000U) -#define LPUART_BAUD_MAEN1_SHIFT (31U) -/*! MAEN1 - Match Address Mode Enable 1 - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_MAEN1(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_MAEN1_SHIFT)) & LPUART_BAUD_MAEN1_MASK) -/*! @} */ - -/*! @name STAT - Status */ -/*! @{ */ - -#define LPUART_STAT_LBKFE_MASK (0x1U) -#define LPUART_STAT_LBKFE_SHIFT (0U) -/*! LBKFE - LIN Break Flag Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_STAT_LBKFE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_LBKFE_SHIFT)) & LPUART_STAT_LBKFE_MASK) - -#define LPUART_STAT_AME_MASK (0x2U) -#define LPUART_STAT_AME_SHIFT (1U) -/*! AME - Address Mark Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_STAT_AME(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_AME_SHIFT)) & LPUART_STAT_AME_MASK) - -#define LPUART_STAT_MA2F_MASK (0x4000U) -#define LPUART_STAT_MA2F_SHIFT (14U) -/*! MA2F - Match 2 Flag - * 0b0..Not equal to MA2 - * 0b1..Equal to MA2 - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_MA2F(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_MA2F_SHIFT)) & LPUART_STAT_MA2F_MASK) - -#define LPUART_STAT_MA1F_MASK (0x8000U) -#define LPUART_STAT_MA1F_SHIFT (15U) -/*! MA1F - Match 1 Flag - * 0b0..Not equal to MA1 - * 0b1..Equal to MA1 - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_MA1F(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_MA1F_SHIFT)) & LPUART_STAT_MA1F_MASK) - -#define LPUART_STAT_PF_MASK (0x10000U) -#define LPUART_STAT_PF_SHIFT (16U) -/*! PF - Parity Error Flag - * 0b0..No parity error detected - * 0b1..Parity error detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_PF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_PF_SHIFT)) & LPUART_STAT_PF_MASK) - -#define LPUART_STAT_FE_MASK (0x20000U) -#define LPUART_STAT_FE_SHIFT (17U) -/*! FE - Framing Error Flag - * 0b0..No framing error detected (this does not guarantee that the framing is correct) - * 0b1..Framing error detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_FE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_FE_SHIFT)) & LPUART_STAT_FE_MASK) - -#define LPUART_STAT_NF_MASK (0x40000U) -#define LPUART_STAT_NF_SHIFT (18U) -/*! NF - Noise Flag - * 0b0..No noise detected - * 0b1..Noise detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_NF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_NF_SHIFT)) & LPUART_STAT_NF_MASK) - -#define LPUART_STAT_OR_MASK (0x80000U) -#define LPUART_STAT_OR_SHIFT (19U) -/*! OR - Receiver Overrun Flag - * 0b0..No overrun - * 0b1..Receive overrun (new LPUART data is lost) - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_OR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_OR_SHIFT)) & LPUART_STAT_OR_MASK) - -#define LPUART_STAT_IDLE_MASK (0x100000U) -#define LPUART_STAT_IDLE_SHIFT (20U) -/*! IDLE - Idle Line Flag - * 0b0..Idle line detected - * 0b1..Idle line not detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_IDLE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_IDLE_SHIFT)) & LPUART_STAT_IDLE_MASK) - -#define LPUART_STAT_RDRF_MASK (0x200000U) -#define LPUART_STAT_RDRF_SHIFT (21U) -/*! RDRF - Receive Data Register Full Flag - * 0b0..Equal to or less than watermark - * 0b1..Greater than watermark - */ -#define LPUART_STAT_RDRF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_RDRF_SHIFT)) & LPUART_STAT_RDRF_MASK) - -#define LPUART_STAT_TC_MASK (0x400000U) -#define LPUART_STAT_TC_SHIFT (22U) -/*! TC - Transmission Complete Flag - * 0b0..Transmitter active - * 0b1..Transmitter idle - */ -#define LPUART_STAT_TC(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_TC_SHIFT)) & LPUART_STAT_TC_MASK) - -#define LPUART_STAT_TDRE_MASK (0x800000U) -#define LPUART_STAT_TDRE_SHIFT (23U) -/*! TDRE - Transmit Data Register Empty Flag - * 0b0..Greater than watermark - * 0b1..Equal to or less than watermark - */ -#define LPUART_STAT_TDRE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_TDRE_SHIFT)) & LPUART_STAT_TDRE_MASK) - -#define LPUART_STAT_RAF_MASK (0x1000000U) -#define LPUART_STAT_RAF_SHIFT (24U) -/*! RAF - Receiver Active Flag - * 0b0..Idle, waiting for a start bit - * 0b1..Receiver active (RXD pin input not idle) - */ -#define LPUART_STAT_RAF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_RAF_SHIFT)) & LPUART_STAT_RAF_MASK) - -#define LPUART_STAT_LBKDE_MASK (0x2000000U) -#define LPUART_STAT_LBKDE_SHIFT (25U) -/*! LBKDE - LIN Break Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_STAT_LBKDE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_LBKDE_SHIFT)) & LPUART_STAT_LBKDE_MASK) - -#define LPUART_STAT_BRK13_MASK (0x4000000U) -#define LPUART_STAT_BRK13_SHIFT (26U) -/*! BRK13 - Break Character Generation Length - * 0b0..9 to 13 bit times - * 0b1..12 to 15 bit times - */ -#define LPUART_STAT_BRK13(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_BRK13_SHIFT)) & LPUART_STAT_BRK13_MASK) - -#define LPUART_STAT_RWUID_MASK (0x8000000U) -#define LPUART_STAT_RWUID_SHIFT (27U) -/*! RWUID - Receive Wake Up Idle Detect - * 0b0..STAT[IDLE] does not become 1 - * 0b1..STAT[IDLE] becomes 1 - */ -#define LPUART_STAT_RWUID(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_RWUID_SHIFT)) & LPUART_STAT_RWUID_MASK) - -#define LPUART_STAT_RXINV_MASK (0x10000000U) -#define LPUART_STAT_RXINV_SHIFT (28U) -/*! RXINV - Receive Data Inversion - * 0b0..Inverted - * 0b1..Not inverted - */ -#define LPUART_STAT_RXINV(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_RXINV_SHIFT)) & LPUART_STAT_RXINV_MASK) - -#define LPUART_STAT_MSBF_MASK (0x20000000U) -#define LPUART_STAT_MSBF_SHIFT (29U) -/*! MSBF - MSB First - * 0b0..LSB - * 0b1..MSB - */ -#define LPUART_STAT_MSBF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_MSBF_SHIFT)) & LPUART_STAT_MSBF_MASK) - -#define LPUART_STAT_RXEDGIF_MASK (0x40000000U) -#define LPUART_STAT_RXEDGIF_SHIFT (30U) -/*! RXEDGIF - RXD Pin Active Edge Interrupt Flag - * 0b0..Not occurred - * 0b1..Occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_RXEDGIF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_RXEDGIF_SHIFT)) & LPUART_STAT_RXEDGIF_MASK) - -#define LPUART_STAT_LBKDIF_MASK (0x80000000U) -#define LPUART_STAT_LBKDIF_SHIFT (31U) -/*! LBKDIF - LIN Break Detect Interrupt Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_LBKDIF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_LBKDIF_SHIFT)) & LPUART_STAT_LBKDIF_MASK) -/*! @} */ - -/*! @name CTRL - Control */ -/*! @{ */ - -#define LPUART_CTRL_PT_MASK (0x1U) -#define LPUART_CTRL_PT_SHIFT (0U) -/*! PT - Parity Type - * 0b0..Even parity - * 0b1..Odd parity - */ -#define LPUART_CTRL_PT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_PT_SHIFT)) & LPUART_CTRL_PT_MASK) - -#define LPUART_CTRL_PE_MASK (0x2U) -#define LPUART_CTRL_PE_SHIFT (1U) -/*! PE - Parity Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_PE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_PE_SHIFT)) & LPUART_CTRL_PE_MASK) - -#define LPUART_CTRL_ILT_MASK (0x4U) -#define LPUART_CTRL_ILT_SHIFT (2U) -/*! ILT - Idle Line Type Select - * 0b0..After the start bit - * 0b1..After the stop bit - */ -#define LPUART_CTRL_ILT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_ILT_SHIFT)) & LPUART_CTRL_ILT_MASK) - -#define LPUART_CTRL_WAKE_MASK (0x8U) -#define LPUART_CTRL_WAKE_SHIFT (3U) -/*! WAKE - Receiver Wake-Up Method Select - * 0b0..Idle - * 0b1..Mark - */ -#define LPUART_CTRL_WAKE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_WAKE_SHIFT)) & LPUART_CTRL_WAKE_MASK) - -#define LPUART_CTRL_M_MASK (0x10U) -#define LPUART_CTRL_M_SHIFT (4U) -/*! M - 9-Bit Or 8-Bit Mode Select - * 0b0..8-bit - * 0b1..9-bit - */ -#define LPUART_CTRL_M(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_M_SHIFT)) & LPUART_CTRL_M_MASK) - -#define LPUART_CTRL_RSRC_MASK (0x20U) -#define LPUART_CTRL_RSRC_SHIFT (5U) -/*! RSRC - Receiver Source Select - * 0b0..Internal Loopback mode - * 0b1..Single-wire mode - */ -#define LPUART_CTRL_RSRC(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_RSRC_SHIFT)) & LPUART_CTRL_RSRC_MASK) - -#define LPUART_CTRL_DOZEEN_MASK (0x40U) -#define LPUART_CTRL_DOZEEN_SHIFT (6U) -/*! DOZEEN - Doze Mode - * 0b0..Enable - * 0b1..Disable - */ -#define LPUART_CTRL_DOZEEN(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_DOZEEN_SHIFT)) & LPUART_CTRL_DOZEEN_MASK) - -#define LPUART_CTRL_LOOPS_MASK (0x80U) -#define LPUART_CTRL_LOOPS_SHIFT (7U) -/*! LOOPS - Loop Mode Select - * 0b0..Normal operation: RXD and TXD use separate pins - * 0b1..Loop mode or Single-Wire mode - */ -#define LPUART_CTRL_LOOPS(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_LOOPS_SHIFT)) & LPUART_CTRL_LOOPS_MASK) - -#define LPUART_CTRL_IDLECFG_MASK (0x700U) -#define LPUART_CTRL_IDLECFG_SHIFT (8U) -/*! IDLECFG - Idle Configuration - * 0b000..1 - * 0b001..2 - * 0b010..4 - * 0b011..8 - * 0b100..16 - * 0b101..32 - * 0b110..64 - * 0b111..128 - */ -#define LPUART_CTRL_IDLECFG(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_IDLECFG_SHIFT)) & LPUART_CTRL_IDLECFG_MASK) - -#define LPUART_CTRL_M7_MASK (0x800U) -#define LPUART_CTRL_M7_SHIFT (11U) -/*! M7 - 7-Bit Mode Select - * 0b0..8-bit to 10-bit - * 0b1..7-bit - */ -#define LPUART_CTRL_M7(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_M7_SHIFT)) & LPUART_CTRL_M7_MASK) - -#define LPUART_CTRL_MA2IE_MASK (0x4000U) -#define LPUART_CTRL_MA2IE_SHIFT (14U) -/*! MA2IE - Match 2 (MA2F) Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_MA2IE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_MA2IE_SHIFT)) & LPUART_CTRL_MA2IE_MASK) - -#define LPUART_CTRL_MA1IE_MASK (0x8000U) -#define LPUART_CTRL_MA1IE_SHIFT (15U) -/*! MA1IE - Match 1 (MA1F) Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_MA1IE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_MA1IE_SHIFT)) & LPUART_CTRL_MA1IE_MASK) - -#define LPUART_CTRL_SBK_MASK (0x10000U) -#define LPUART_CTRL_SBK_SHIFT (16U) -/*! SBK - Send Break - * 0b0..Normal transmitter operation - * 0b1..Queue break character(s) to be sent - */ -#define LPUART_CTRL_SBK(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_SBK_SHIFT)) & LPUART_CTRL_SBK_MASK) - -#define LPUART_CTRL_RWU_MASK (0x20000U) -#define LPUART_CTRL_RWU_SHIFT (17U) -/*! RWU - Receiver Wake-Up Control - * 0b0..Normal receiver operation - * 0b1..LPUART receiver in standby, waiting for a wake-up condition - */ -#define LPUART_CTRL_RWU(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_RWU_SHIFT)) & LPUART_CTRL_RWU_MASK) - -#define LPUART_CTRL_RE_MASK (0x40000U) -#define LPUART_CTRL_RE_SHIFT (18U) -/*! RE - Receiver Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_RE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_RE_SHIFT)) & LPUART_CTRL_RE_MASK) - -#define LPUART_CTRL_TE_MASK (0x80000U) -#define LPUART_CTRL_TE_SHIFT (19U) -/*! TE - Transmitter Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_TE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_TE_SHIFT)) & LPUART_CTRL_TE_MASK) - -#define LPUART_CTRL_ILIE_MASK (0x100000U) -#define LPUART_CTRL_ILIE_SHIFT (20U) -/*! ILIE - Idle Line Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_ILIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_ILIE_SHIFT)) & LPUART_CTRL_ILIE_MASK) - -#define LPUART_CTRL_RIE_MASK (0x200000U) -#define LPUART_CTRL_RIE_SHIFT (21U) -/*! RIE - Receiver Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_RIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_RIE_SHIFT)) & LPUART_CTRL_RIE_MASK) - -#define LPUART_CTRL_TCIE_MASK (0x400000U) -#define LPUART_CTRL_TCIE_SHIFT (22U) -/*! TCIE - Transmission Complete Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_TCIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_TCIE_SHIFT)) & LPUART_CTRL_TCIE_MASK) - -#define LPUART_CTRL_TIE_MASK (0x800000U) -#define LPUART_CTRL_TIE_SHIFT (23U) -/*! TIE - Transmit Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_TIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_TIE_SHIFT)) & LPUART_CTRL_TIE_MASK) - -#define LPUART_CTRL_PEIE_MASK (0x1000000U) -#define LPUART_CTRL_PEIE_SHIFT (24U) -/*! PEIE - Parity Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_PEIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_PEIE_SHIFT)) & LPUART_CTRL_PEIE_MASK) - -#define LPUART_CTRL_FEIE_MASK (0x2000000U) -#define LPUART_CTRL_FEIE_SHIFT (25U) -/*! FEIE - Framing Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_FEIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_FEIE_SHIFT)) & LPUART_CTRL_FEIE_MASK) - -#define LPUART_CTRL_NEIE_MASK (0x4000000U) -#define LPUART_CTRL_NEIE_SHIFT (26U) -/*! NEIE - Noise Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_NEIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_NEIE_SHIFT)) & LPUART_CTRL_NEIE_MASK) - -#define LPUART_CTRL_ORIE_MASK (0x8000000U) -#define LPUART_CTRL_ORIE_SHIFT (27U) -/*! ORIE - Overrun Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_ORIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_ORIE_SHIFT)) & LPUART_CTRL_ORIE_MASK) - -#define LPUART_CTRL_TXINV_MASK (0x10000000U) -#define LPUART_CTRL_TXINV_SHIFT (28U) -/*! TXINV - Transmit Data Inversion - * 0b0..Not inverted - * 0b1..Inverted - */ -#define LPUART_CTRL_TXINV(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_TXINV_SHIFT)) & LPUART_CTRL_TXINV_MASK) - -#define LPUART_CTRL_TXDIR_MASK (0x20000000U) -#define LPUART_CTRL_TXDIR_SHIFT (29U) -/*! TXDIR - TXD Pin Direction in Single-Wire Mode - * 0b0..Input - * 0b1..Output - */ -#define LPUART_CTRL_TXDIR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_TXDIR_SHIFT)) & LPUART_CTRL_TXDIR_MASK) - -#define LPUART_CTRL_R9T8_MASK (0x40000000U) -#define LPUART_CTRL_R9T8_SHIFT (30U) -/*! R9T8 - Receive Bit 9 Transmit Bit 8 */ -#define LPUART_CTRL_R9T8(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_R9T8_SHIFT)) & LPUART_CTRL_R9T8_MASK) - -#define LPUART_CTRL_R8T9_MASK (0x80000000U) -#define LPUART_CTRL_R8T9_SHIFT (31U) -/*! R8T9 - Receive Bit 8 Transmit Bit 9 */ -#define LPUART_CTRL_R8T9(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_R8T9_SHIFT)) & LPUART_CTRL_R8T9_MASK) -/*! @} */ - -/*! @name DATA - Data */ -/*! @{ */ - -#define LPUART_DATA_R0T0_MASK (0x1U) -#define LPUART_DATA_R0T0_SHIFT (0U) -/*! R0T0 - Read receive FIFO bit 0 or write transmit FIFO bit 0 */ -#define LPUART_DATA_R0T0(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R0T0_SHIFT)) & LPUART_DATA_R0T0_MASK) - -#define LPUART_DATA_R1T1_MASK (0x2U) -#define LPUART_DATA_R1T1_SHIFT (1U) -/*! R1T1 - Read receive FIFO bit 1 or write transmit FIFO bit 1 */ -#define LPUART_DATA_R1T1(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R1T1_SHIFT)) & LPUART_DATA_R1T1_MASK) - -#define LPUART_DATA_R2T2_MASK (0x4U) -#define LPUART_DATA_R2T2_SHIFT (2U) -/*! R2T2 - Read receive FIFO bit 2 or write transmit FIFO bit 2 */ -#define LPUART_DATA_R2T2(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R2T2_SHIFT)) & LPUART_DATA_R2T2_MASK) - -#define LPUART_DATA_R3T3_MASK (0x8U) -#define LPUART_DATA_R3T3_SHIFT (3U) -/*! R3T3 - Read receive FIFO bit 3 or write transmit FIFO bit 3 */ -#define LPUART_DATA_R3T3(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R3T3_SHIFT)) & LPUART_DATA_R3T3_MASK) - -#define LPUART_DATA_R4T4_MASK (0x10U) -#define LPUART_DATA_R4T4_SHIFT (4U) -/*! R4T4 - Read receive FIFO bit 4 or write transmit FIFO bit 4 */ -#define LPUART_DATA_R4T4(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R4T4_SHIFT)) & LPUART_DATA_R4T4_MASK) - -#define LPUART_DATA_R5T5_MASK (0x20U) -#define LPUART_DATA_R5T5_SHIFT (5U) -/*! R5T5 - Read receive FIFO bit 5 or write transmit FIFO bit 5 */ -#define LPUART_DATA_R5T5(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R5T5_SHIFT)) & LPUART_DATA_R5T5_MASK) - -#define LPUART_DATA_R6T6_MASK (0x40U) -#define LPUART_DATA_R6T6_SHIFT (6U) -/*! R6T6 - Read receive FIFO bit 6 or write transmit FIFO bit 6 */ -#define LPUART_DATA_R6T6(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R6T6_SHIFT)) & LPUART_DATA_R6T6_MASK) - -#define LPUART_DATA_R7T7_MASK (0x80U) -#define LPUART_DATA_R7T7_SHIFT (7U) -/*! R7T7 - Read receive FIFO bit 7 or write transmit FIFO bit 7 */ -#define LPUART_DATA_R7T7(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R7T7_SHIFT)) & LPUART_DATA_R7T7_MASK) - -#define LPUART_DATA_R8T8_MASK (0x100U) -#define LPUART_DATA_R8T8_SHIFT (8U) -/*! R8T8 - Read receive FIFO bit 8 or write transmit FIFO bit 8 */ -#define LPUART_DATA_R8T8(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R8T8_SHIFT)) & LPUART_DATA_R8T8_MASK) - -#define LPUART_DATA_R9T9_MASK (0x200U) -#define LPUART_DATA_R9T9_SHIFT (9U) -/*! R9T9 - Read receive FIFO bit 9 or write transmit FIFO bit 9 */ -#define LPUART_DATA_R9T9(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R9T9_SHIFT)) & LPUART_DATA_R9T9_MASK) - -#define LPUART_DATA_LINBRK_MASK (0x400U) -#define LPUART_DATA_LINBRK_SHIFT (10U) -/*! LINBRK - LIN Break - * 0b0..Not detected - * 0b1..Detected - */ -#define LPUART_DATA_LINBRK(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_LINBRK_SHIFT)) & LPUART_DATA_LINBRK_MASK) - -#define LPUART_DATA_IDLINE_MASK (0x800U) -#define LPUART_DATA_IDLINE_SHIFT (11U) -/*! IDLINE - Idle Line - * 0b0..Not idle - * 0b1..Idle - */ -#define LPUART_DATA_IDLINE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_IDLINE_SHIFT)) & LPUART_DATA_IDLINE_MASK) - -#define LPUART_DATA_RXEMPT_MASK (0x1000U) -#define LPUART_DATA_RXEMPT_SHIFT (12U) -/*! RXEMPT - Receive Buffer Empty - * 0b0..Valid data - * 0b1..Invalid data and empty - */ -#define LPUART_DATA_RXEMPT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_RXEMPT_SHIFT)) & LPUART_DATA_RXEMPT_MASK) - -#define LPUART_DATA_FRETSC_MASK (0x2000U) -#define LPUART_DATA_FRETSC_SHIFT (13U) -/*! FRETSC - Frame Error Transmit Special Character - * 0b0..Received without a frame error on reads or transmits a normal character on writes - * 0b1..Received with a frame error on reads or transmits an idle or break character on writes - */ -#define LPUART_DATA_FRETSC(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_FRETSC_SHIFT)) & LPUART_DATA_FRETSC_MASK) - -#define LPUART_DATA_PARITYE_MASK (0x4000U) -#define LPUART_DATA_PARITYE_SHIFT (14U) -/*! PARITYE - Parity Error - * 0b0..Received without a parity error - * 0b1..Received with a parity error - */ -#define LPUART_DATA_PARITYE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_PARITYE_SHIFT)) & LPUART_DATA_PARITYE_MASK) - -#define LPUART_DATA_NOISY_MASK (0x8000U) -#define LPUART_DATA_NOISY_SHIFT (15U) -/*! NOISY - Noisy Data Received - * 0b0..Received without noise - * 0b1..Received with noise - */ -#define LPUART_DATA_NOISY(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_NOISY_SHIFT)) & LPUART_DATA_NOISY_MASK) -/*! @} */ - -/*! @name MATCH - Match Address */ -/*! @{ */ - -#define LPUART_MATCH_MA1_MASK (0x3FFU) -#define LPUART_MATCH_MA1_SHIFT (0U) -/*! MA1 - Match Address 1 */ -#define LPUART_MATCH_MA1(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MATCH_MA1_SHIFT)) & LPUART_MATCH_MA1_MASK) - -#define LPUART_MATCH_MA2_MASK (0x3FF0000U) -#define LPUART_MATCH_MA2_SHIFT (16U) -/*! MA2 - Match Address 2 */ -#define LPUART_MATCH_MA2(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MATCH_MA2_SHIFT)) & LPUART_MATCH_MA2_MASK) -/*! @} */ - -/*! @name MODIR - MODEM IrDA */ -/*! @{ */ - -#define LPUART_MODIR_TXCTSE_MASK (0x1U) -#define LPUART_MODIR_TXCTSE_SHIFT (0U) -/*! TXCTSE - Transmitter CTS Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_MODIR_TXCTSE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_TXCTSE_SHIFT)) & LPUART_MODIR_TXCTSE_MASK) - -#define LPUART_MODIR_TXRTSE_MASK (0x2U) -#define LPUART_MODIR_TXRTSE_SHIFT (1U) -/*! TXRTSE - Transmitter RTS Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_MODIR_TXRTSE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_TXRTSE_SHIFT)) & LPUART_MODIR_TXRTSE_MASK) - -#define LPUART_MODIR_TXRTSPOL_MASK (0x4U) -#define LPUART_MODIR_TXRTSPOL_SHIFT (2U) -/*! TXRTSPOL - Transmitter RTS Polarity - * 0b0..Active low - * 0b1..Active high - */ -#define LPUART_MODIR_TXRTSPOL(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_TXRTSPOL_SHIFT)) & LPUART_MODIR_TXRTSPOL_MASK) - -#define LPUART_MODIR_RXRTSE_MASK (0x8U) -#define LPUART_MODIR_RXRTSE_SHIFT (3U) -/*! RXRTSE - Receiver RTS Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_MODIR_RXRTSE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_RXRTSE_SHIFT)) & LPUART_MODIR_RXRTSE_MASK) - -#define LPUART_MODIR_TXCTSC_MASK (0x10U) -#define LPUART_MODIR_TXCTSC_SHIFT (4U) -/*! TXCTSC - Transmit CTS Configuration - * 0b0..Sampled at the start of each character - * 0b1..Sampled when the transmitter is idle - */ -#define LPUART_MODIR_TXCTSC(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_TXCTSC_SHIFT)) & LPUART_MODIR_TXCTSC_MASK) - -#define LPUART_MODIR_TXCTSSRC_MASK (0x20U) -#define LPUART_MODIR_TXCTSSRC_SHIFT (5U) -/*! TXCTSSRC - Transmit CTS Source - * 0b0..The CTS_B pin - * 0b1..An internal connection to the receiver address match result - */ -#define LPUART_MODIR_TXCTSSRC(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_TXCTSSRC_SHIFT)) & LPUART_MODIR_TXCTSSRC_MASK) - -#define LPUART_MODIR_RTSWATER_MASK (0x300U) -#define LPUART_MODIR_RTSWATER_SHIFT (8U) -/*! RTSWATER - Receive RTS Configuration */ -#define LPUART_MODIR_RTSWATER(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_RTSWATER_SHIFT)) & LPUART_MODIR_RTSWATER_MASK) - -#define LPUART_MODIR_TNP_MASK (0x30000U) -#define LPUART_MODIR_TNP_SHIFT (16U) -/*! TNP - Transmitter Narrow Pulse - * 0b00..1 / OSR - * 0b01..2 / OSR - * 0b10..3 / OSR - * 0b11..4 / OSR - */ -#define LPUART_MODIR_TNP(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_TNP_SHIFT)) & LPUART_MODIR_TNP_MASK) - -#define LPUART_MODIR_IREN_MASK (0x40000U) -#define LPUART_MODIR_IREN_SHIFT (18U) -/*! IREN - IR Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_MODIR_IREN(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_IREN_SHIFT)) & LPUART_MODIR_IREN_MASK) -/*! @} */ - -/*! @name FIFO - FIFO */ -/*! @{ */ - -#define LPUART_FIFO_RXFIFOSIZE_MASK (0x7U) -#define LPUART_FIFO_RXFIFOSIZE_SHIFT (0U) -/*! RXFIFOSIZE - Receive FIFO Buffer Depth - * 0b000..1 - * 0b001..4 - * 0b010..8 - * 0b011..16 - * 0b100..32 - * 0b101..64 - * 0b110..128 - * 0b111..256 - */ -#define LPUART_FIFO_RXFIFOSIZE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXFIFOSIZE_SHIFT)) & LPUART_FIFO_RXFIFOSIZE_MASK) - -#define LPUART_FIFO_RXFE_MASK (0x8U) -#define LPUART_FIFO_RXFE_SHIFT (3U) -/*! RXFE - Receive FIFO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_FIFO_RXFE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXFE_SHIFT)) & LPUART_FIFO_RXFE_MASK) - -#define LPUART_FIFO_TXFIFOSIZE_MASK (0x70U) -#define LPUART_FIFO_TXFIFOSIZE_SHIFT (4U) -/*! TXFIFOSIZE - Transmit FIFO Buffer Depth - * 0b000..1 - * 0b001..4 - * 0b010..8 - * 0b011..16 - * 0b100..32 - * 0b101..64 - * 0b110..128 - * 0b111..256 - */ -#define LPUART_FIFO_TXFIFOSIZE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_TXFIFOSIZE_SHIFT)) & LPUART_FIFO_TXFIFOSIZE_MASK) - -#define LPUART_FIFO_TXFE_MASK (0x80U) -#define LPUART_FIFO_TXFE_SHIFT (7U) -/*! TXFE - Transmit FIFO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_FIFO_TXFE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_TXFE_SHIFT)) & LPUART_FIFO_TXFE_MASK) - -#define LPUART_FIFO_RXUFE_MASK (0x100U) -#define LPUART_FIFO_RXUFE_SHIFT (8U) -/*! RXUFE - Receive FIFO Underflow Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_FIFO_RXUFE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXUFE_SHIFT)) & LPUART_FIFO_RXUFE_MASK) - -#define LPUART_FIFO_TXOFE_MASK (0x200U) -#define LPUART_FIFO_TXOFE_SHIFT (9U) -/*! TXOFE - Transmit FIFO Overflow Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_FIFO_TXOFE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_TXOFE_SHIFT)) & LPUART_FIFO_TXOFE_MASK) - -#define LPUART_FIFO_RXIDEN_MASK (0x1C00U) -#define LPUART_FIFO_RXIDEN_SHIFT (10U) -/*! RXIDEN - Receiver Idle Empty Enable - * 0b000..Disable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle - * 0b001..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for one character - * 0b010..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for two characters - * 0b011..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for four characters - * 0b100..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for eight characters - * 0b101..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for 16 characters - * 0b110..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for 32 characters - * 0b111..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for 64 characters - */ -#define LPUART_FIFO_RXIDEN(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXIDEN_SHIFT)) & LPUART_FIFO_RXIDEN_MASK) - -#define LPUART_FIFO_RXFLUSH_MASK (0x4000U) -#define LPUART_FIFO_RXFLUSH_SHIFT (14U) -/*! RXFLUSH - Receive FIFO Flush - * 0b0..No effect - * 0b1..All data flushed out - */ -#define LPUART_FIFO_RXFLUSH(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXFLUSH_SHIFT)) & LPUART_FIFO_RXFLUSH_MASK) - -#define LPUART_FIFO_TXFLUSH_MASK (0x8000U) -#define LPUART_FIFO_TXFLUSH_SHIFT (15U) -/*! TXFLUSH - Transmit FIFO Flush - * 0b0..No effect - * 0b1..All data flushed out - */ -#define LPUART_FIFO_TXFLUSH(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_TXFLUSH_SHIFT)) & LPUART_FIFO_TXFLUSH_MASK) - -#define LPUART_FIFO_RXUF_MASK (0x10000U) -#define LPUART_FIFO_RXUF_SHIFT (16U) -/*! RXUF - Receiver FIFO Underflow Flag - * 0b0..No underflow - * 0b1..Underflow - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_FIFO_RXUF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXUF_SHIFT)) & LPUART_FIFO_RXUF_MASK) - -#define LPUART_FIFO_TXOF_MASK (0x20000U) -#define LPUART_FIFO_TXOF_SHIFT (17U) -/*! TXOF - Transmitter FIFO Overflow Flag - * 0b0..No overflow - * 0b1..Overflow - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_FIFO_TXOF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_TXOF_SHIFT)) & LPUART_FIFO_TXOF_MASK) - -#define LPUART_FIFO_RXEMPT_MASK (0x400000U) -#define LPUART_FIFO_RXEMPT_SHIFT (22U) -/*! RXEMPT - Receive FIFO Or Buffer Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPUART_FIFO_RXEMPT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXEMPT_SHIFT)) & LPUART_FIFO_RXEMPT_MASK) - -#define LPUART_FIFO_TXEMPT_MASK (0x800000U) -#define LPUART_FIFO_TXEMPT_SHIFT (23U) -/*! TXEMPT - Transmit FIFO Or Buffer Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPUART_FIFO_TXEMPT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_TXEMPT_SHIFT)) & LPUART_FIFO_TXEMPT_MASK) -/*! @} */ - -/*! @name WATER - Watermark */ -/*! @{ */ - -#define LPUART_WATER_TXWATER_MASK (0x3U) -#define LPUART_WATER_TXWATER_SHIFT (0U) -/*! TXWATER - Transmit Watermark */ -#define LPUART_WATER_TXWATER(x) (((uint32_t)(((uint32_t)(x)) << LPUART_WATER_TXWATER_SHIFT)) & LPUART_WATER_TXWATER_MASK) - -#define LPUART_WATER_TXCOUNT_MASK (0x700U) -#define LPUART_WATER_TXCOUNT_SHIFT (8U) -/*! TXCOUNT - Transmit Counter */ -#define LPUART_WATER_TXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_WATER_TXCOUNT_SHIFT)) & LPUART_WATER_TXCOUNT_MASK) - -#define LPUART_WATER_RXWATER_MASK (0x30000U) -#define LPUART_WATER_RXWATER_SHIFT (16U) -/*! RXWATER - Receive Watermark */ -#define LPUART_WATER_RXWATER(x) (((uint32_t)(((uint32_t)(x)) << LPUART_WATER_RXWATER_SHIFT)) & LPUART_WATER_RXWATER_MASK) - -#define LPUART_WATER_RXCOUNT_MASK (0x7000000U) -#define LPUART_WATER_RXCOUNT_SHIFT (24U) -/*! RXCOUNT - Receive Counter */ -#define LPUART_WATER_RXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_WATER_RXCOUNT_SHIFT)) & LPUART_WATER_RXCOUNT_MASK) -/*! @} */ - -/*! @name DATARO - Data Read-Only */ -/*! @{ */ - -#define LPUART_DATARO_DATA_MASK (0xFFFFU) -#define LPUART_DATARO_DATA_SHIFT (0U) -/*! DATA - Receive Data */ -#define LPUART_DATARO_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATARO_DATA_SHIFT)) & LPUART_DATARO_DATA_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group LPUART_Register_Masks */ - - -/* LPUART - Peripheral instance base addresses */ -/** Peripheral LPUART0 base address */ -#define LPUART0_BASE (0x4009F000u) -/** Peripheral LPUART0 base pointer */ -#define LPUART0 ((LPUART_Type *)LPUART0_BASE) -/** Peripheral LPUART1 base address */ -#define LPUART1_BASE (0x400A0000u) -/** Peripheral LPUART1 base pointer */ -#define LPUART1 ((LPUART_Type *)LPUART1_BASE) -/** Peripheral LPUART2 base address */ -#define LPUART2_BASE (0x400A1000u) -/** Peripheral LPUART2 base pointer */ -#define LPUART2 ((LPUART_Type *)LPUART2_BASE) -/** Peripheral LPUART3 base address */ -#define LPUART3_BASE (0x400A2000u) -/** Peripheral LPUART3 base pointer */ -#define LPUART3 ((LPUART_Type *)LPUART3_BASE) -/** Peripheral LPUART4 base address */ -#define LPUART4_BASE (0x400A3000u) -/** Peripheral LPUART4 base pointer */ -#define LPUART4 ((LPUART_Type *)LPUART4_BASE) -/** Array initializer of LPUART peripheral base addresses */ -#define LPUART_BASE_ADDRS { LPUART0_BASE, LPUART1_BASE, LPUART2_BASE, LPUART3_BASE, LPUART4_BASE } -/** Array initializer of LPUART peripheral base pointers */ -#define LPUART_BASE_PTRS { LPUART0, LPUART1, LPUART2, LPUART3, LPUART4 } -/** Interrupt vectors for the LPUART peripheral type */ -#define LPUART_RX_TX_IRQS { LPUART0_IRQn, LPUART1_IRQn, LPUART2_IRQn, LPUART3_IRQn, LPUART4_IRQn } -#define LPUART_ERR_IRQS { LPUART0_IRQn, LPUART1_IRQn, LPUART2_IRQn, LPUART3_IRQn, LPUART4_IRQn } - -/*! - * @} - */ /* end of group LPUART_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- MRCC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup MRCC_Peripheral_Access_Layer MRCC Peripheral Access Layer - * @{ - */ - -/** MRCC - Register Layout Typedef */ -typedef struct { - __IO uint32_t MRCC_GLB_RST0; /**< Peripheral Reset Control 0, offset: 0x0 */ - __O uint32_t MRCC_GLB_RST0_SET; /**< Peripheral Reset Control Set 0, offset: 0x4 */ - __O uint32_t MRCC_GLB_RST0_CLR; /**< Peripheral Reset Control Clear 0, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __IO uint32_t MRCC_GLB_RST1; /**< Peripheral Reset Control 1, offset: 0x10 */ - __O uint32_t MRCC_GLB_RST1_SET; /**< Peripheral Reset Control Set 1, offset: 0x14 */ - __O uint32_t MRCC_GLB_RST1_CLR; /**< Peripheral Reset Control Clear 1, offset: 0x18 */ - uint8_t RESERVED_1[36]; - __IO uint32_t MRCC_GLB_CC0; /**< AHB Clock Control 0, offset: 0x40 */ - __O uint32_t MRCC_GLB_CC0_SET; /**< AHB Clock Control Set 0, offset: 0x44 */ - __O uint32_t MRCC_GLB_CC0_CLR; /**< AHB Clock Control Clear 0, offset: 0x48 */ - uint8_t RESERVED_2[4]; - __IO uint32_t MRCC_GLB_CC1; /**< AHB Clock Control 1, offset: 0x50 */ - __O uint32_t MRCC_GLB_CC_SET[1]; /**< AHB Clock Control Set 1, array offset: 0x54, array step: 0x4 */ - __O uint32_t MRCC_GLB_CC_CLR[1]; /**< AHB Clock Control Clear 1, array offset: 0x58, array step: 0x4 */ - uint8_t RESERVED_3[36]; - __IO uint32_t MRCC_GLB_ACC0; /**< Control Automatic Clock Gating 0, offset: 0x80 */ - __IO uint32_t MRCC_GLB_ACC1; /**< Control Automatic Clock Gating 1, offset: 0x84 */ - uint8_t RESERVED_4[24]; - __IO uint32_t MRCC_I3C0_FCLK_CLKSEL; /**< I3C0_FCLK clock selection control, offset: 0xA0 */ - __IO uint32_t MRCC_I3C0_FCLK_CLKDIV; /**< I3C0_FCLK clock divider control, offset: 0xA4 */ - __IO uint32_t MRCC_CTIMER0_CLKSEL; /**< CTIMER0 clock selection control, offset: 0xA8 */ - __IO uint32_t MRCC_CTIMER0_CLKDIV; /**< CTIMER0 clock divider control, offset: 0xAC */ - __IO uint32_t MRCC_CTIMER1_CLKSEL; /**< CTIMER1 clock selection control, offset: 0xB0 */ - __IO uint32_t MRCC_CTIMER1_CLKDIV; /**< CTIMER1 clock divider control, offset: 0xB4 */ - __IO uint32_t MRCC_CTIMER2_CLKSEL; /**< CTIMER2 clock selection control, offset: 0xB8 */ - __IO uint32_t MRCC_CTIMER2_CLKDIV; /**< CTIMER2 clock divider control, offset: 0xBC */ - __IO uint32_t MRCC_CTIMER3_CLKSEL; /**< CTIMER3 clock selection control, offset: 0xC0 */ - __IO uint32_t MRCC_CTIMER3_CLKDIV; /**< CTIMER3 clock divider control, offset: 0xC4 */ - __IO uint32_t MRCC_CTIMER4_CLKSEL; /**< CTIMER4 clock selection control, offset: 0xC8 */ - __IO uint32_t MRCC_CTIMER4_CLKDIV; /**< CTIMER4 clock divider control, offset: 0xCC */ - uint8_t RESERVED_5[4]; - __IO uint32_t MRCC_WWDT0_CLKDIV; /**< WWDT0 clock divider control, offset: 0xD4 */ - __IO uint32_t MRCC_FLEXIO0_CLKSEL; /**< FLEXIO0 clock selection control, offset: 0xD8 */ - __IO uint32_t MRCC_FLEXIO0_CLKDIV; /**< FLEXIO0 clock divider control, offset: 0xDC */ - __IO uint32_t MRCC_LPI2C0_CLKSEL; /**< LPI2C0 clock selection control, offset: 0xE0 */ - __IO uint32_t MRCC_LPI2C0_CLKDIV; /**< LPI2C0 clock divider control, offset: 0xE4 */ - __IO uint32_t MRCC_LPI2C1_CLKSEL; /**< LPI2C1 clock selection control, offset: 0xE8 */ - __IO uint32_t MRCC_LPI2C1_CLKDIV; /**< LPI2C1 clock divider control, offset: 0xEC */ - __IO uint32_t MRCC_LPSPI0_CLKSEL; /**< LPSPI0 clock selection control, offset: 0xF0 */ - __IO uint32_t MRCC_LPSPI0_CLKDIV; /**< LPSPI0 clock divider control, offset: 0xF4 */ - __IO uint32_t MRCC_LPSPI1_CLKSEL; /**< LPSPI1 clock selection control, offset: 0xF8 */ - __IO uint32_t MRCC_LPSPI1_CLKDIV; /**< LPSPI1 clock divider control, offset: 0xFC */ - __IO uint32_t MRCC_LPUART0_CLKSEL; /**< LPUART0 clock selection control, offset: 0x100 */ - __IO uint32_t MRCC_LPUART0_CLKDIV; /**< LPUART0 clock divider control, offset: 0x104 */ - __IO uint32_t MRCC_LPUART1_CLKSEL; /**< LPUART1 clock selection control, offset: 0x108 */ - __IO uint32_t MRCC_LPUART1_CLKDIV; /**< LPUART1 clock divider control, offset: 0x10C */ - __IO uint32_t MRCC_LPUART2_CLKSEL; /**< LPUART2 clock selection control, offset: 0x110 */ - __IO uint32_t MRCC_LPUART2_CLKDIV; /**< LPUART2 clock divider control, offset: 0x114 */ - __IO uint32_t MRCC_LPUART3_CLKSEL; /**< LPUART3 clock selection control, offset: 0x118 */ - __IO uint32_t MRCC_LPUART3_CLKDIV; /**< LPUART3 clock divider control, offset: 0x11C */ - __IO uint32_t MRCC_LPUART4_CLKSEL; /**< LPUART4 clock selection control, offset: 0x120 */ - __IO uint32_t MRCC_LPUART4_CLKDIV; /**< LPUART4 clock divider control, offset: 0x124 */ - __IO uint32_t MRCC_USB0_CLKSEL; /**< USB0 clock selection control, offset: 0x128 */ - uint8_t RESERVED_6[4]; - __IO uint32_t MRCC_LPTMR0_CLKSEL; /**< LPTMR0 clock selection control, offset: 0x130 */ - __IO uint32_t MRCC_LPTMR0_CLKDIV; /**< LPTMR0 clock divider control, offset: 0x134 */ - __IO uint32_t MRCC_OSTIMER0_CLKSEL; /**< OSTIMER0 clock selection control, offset: 0x138 */ - uint8_t RESERVED_7[4]; - __IO uint32_t MRCC_ADC0_CLKSEL; /**< ADC0 clock selection control, offset: 0x140 */ - __IO uint32_t MRCC_ADC0_CLKDIV; /**< ADC0 clock divider control, offset: 0x144 */ - __IO uint32_t MRCC_ADC1_CLKSEL; /**< ADC1 clock selection control, offset: 0x148 */ - __IO uint32_t MRCC_ADC1_CLKDIV; /**< ADC1 clock divider control, offset: 0x14C */ - uint8_t RESERVED_8[4]; - __IO uint32_t MRCC_CMP0_FUNC_CLKDIV; /**< CMP0_FUNC clock divider control, offset: 0x154 */ - __IO uint32_t MRCC_CMP0_RR_CLKSEL; /**< CMP0_RR clock selection control, offset: 0x158 */ - __IO uint32_t MRCC_CMP0_RR_CLKDIV; /**< CMP0_RR clock divider control, offset: 0x15C */ - uint8_t RESERVED_9[4]; - __IO uint32_t MRCC_CMP1_FUNC_CLKDIV; /**< CMP1_FUNC clock divider control, offset: 0x164 */ - __IO uint32_t MRCC_CMP1_RR_CLKSEL; /**< CMP1_RR clock selection control, offset: 0x168 */ - __IO uint32_t MRCC_CMP1_RR_CLKDIV; /**< CMP1_RR clock divider control, offset: 0x16C */ - __IO uint32_t MRCC_DAC0_CLKSEL; /**< DAC0 clock selection control, offset: 0x170 */ - __IO uint32_t MRCC_DAC0_CLKDIV; /**< DAC0 clock divider control, offset: 0x174 */ - __IO uint32_t MRCC_FLEXCAN0_CLKSEL; /**< FLEXCAN0 clock selection control, offset: 0x178 */ - __IO uint32_t MRCC_FLEXCAN0_CLKDIV; /**< FLEXCAN0 clock divider control, offset: 0x17C */ - __IO uint32_t MRCC_LPI2C2_CLKSEL; /**< LPI2C2 clock selection control, offset: 0x180 */ - __IO uint32_t MRCC_LPI2C2_CLKDIV; /**< LPI2C2 clock divider control, offset: 0x184 */ - __IO uint32_t MRCC_LPI2C3_CLKSEL; /**< LPI2C3 clock selection control, offset: 0x188 */ - __IO uint32_t MRCC_LPI2C3_CLKDIV; /**< LPI2C3 clock divider control, offset: 0x18C */ - __IO uint32_t MRCC_DBG_TRACE_CLKSEL; /**< DBG_TRACE clock selection control, offset: 0x190 */ - __IO uint32_t MRCC_DBG_TRACE_CLKDIV; /**< DBG_TRACE clock divider control, offset: 0x194 */ - __IO uint32_t MRCC_CLKOUT_CLKSEL; /**< CLKOUT clock selection control, offset: 0x198 */ - __IO uint32_t MRCC_CLKOUT_CLKDIV; /**< CLKOUT clock divider control, offset: 0x19C */ - __IO uint32_t MRCC_SYSTICK_CLKSEL; /**< SYSTICK clock selection control, offset: 0x1A0 */ - __IO uint32_t MRCC_SYSTICK_CLKDIV; /**< SYSTICK clock divider control, offset: 0x1A4 */ - uint8_t RESERVED_10[4]; - __IO uint32_t MRCC_FRO_HF_DIV_CLKDIV; /**< FRO_HF_DIV clock divider control, offset: 0x1AC */ -} MRCC_Type; - -/* ---------------------------------------------------------------------------- - -- MRCC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup MRCC_Register_Masks MRCC Register Masks - * @{ - */ - -/*! @name MRCC_GLB_RST0 - Peripheral Reset Control 0 */ -/*! @{ */ - -#define MRCC_MRCC_GLB_RST0_INPUTMUX0_MASK (0x1U) -#define MRCC_MRCC_GLB_RST0_INPUTMUX0_SHIFT (0U) -/*! INPUTMUX0 - INPUTMUX0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_INPUTMUX0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_INPUTMUX0_SHIFT)) & MRCC_MRCC_GLB_RST0_INPUTMUX0_MASK) - -#define MRCC_MRCC_GLB_RST0_I3C0_MASK (0x2U) -#define MRCC_MRCC_GLB_RST0_I3C0_SHIFT (1U) -/*! I3C0 - I3C0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_I3C0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_I3C0_SHIFT)) & MRCC_MRCC_GLB_RST0_I3C0_MASK) - -#define MRCC_MRCC_GLB_RST0_CTIMER0_MASK (0x4U) -#define MRCC_MRCC_GLB_RST0_CTIMER0_SHIFT (2U) -/*! CTIMER0 - CTIMER0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_CTIMER0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_CTIMER0_SHIFT)) & MRCC_MRCC_GLB_RST0_CTIMER0_MASK) - -#define MRCC_MRCC_GLB_RST0_CTIMER1_MASK (0x8U) -#define MRCC_MRCC_GLB_RST0_CTIMER1_SHIFT (3U) -/*! CTIMER1 - CTIMER1 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_CTIMER1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_CTIMER1_SHIFT)) & MRCC_MRCC_GLB_RST0_CTIMER1_MASK) - -#define MRCC_MRCC_GLB_RST0_CTIMER2_MASK (0x10U) -#define MRCC_MRCC_GLB_RST0_CTIMER2_SHIFT (4U) -/*! CTIMER2 - CTIMER2 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_CTIMER2(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_CTIMER2_SHIFT)) & MRCC_MRCC_GLB_RST0_CTIMER2_MASK) - -#define MRCC_MRCC_GLB_RST0_CTIMER3_MASK (0x20U) -#define MRCC_MRCC_GLB_RST0_CTIMER3_SHIFT (5U) -/*! CTIMER3 - CTIMER3 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_CTIMER3(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_CTIMER3_SHIFT)) & MRCC_MRCC_GLB_RST0_CTIMER3_MASK) - -#define MRCC_MRCC_GLB_RST0_CTIMER4_MASK (0x40U) -#define MRCC_MRCC_GLB_RST0_CTIMER4_SHIFT (6U) -/*! CTIMER4 - CTIMER4 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_CTIMER4(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_CTIMER4_SHIFT)) & MRCC_MRCC_GLB_RST0_CTIMER4_MASK) - -#define MRCC_MRCC_GLB_RST0_FREQME_MASK (0x80U) -#define MRCC_MRCC_GLB_RST0_FREQME_SHIFT (7U) -/*! FREQME - FREQME - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_FREQME(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_FREQME_SHIFT)) & MRCC_MRCC_GLB_RST0_FREQME_MASK) - -#define MRCC_MRCC_GLB_RST0_UTICK0_MASK (0x100U) -#define MRCC_MRCC_GLB_RST0_UTICK0_SHIFT (8U) -/*! UTICK0 - UTICK0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_UTICK0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_UTICK0_SHIFT)) & MRCC_MRCC_GLB_RST0_UTICK0_MASK) - -#define MRCC_MRCC_GLB_RST0_DMA_MASK (0x400U) -#define MRCC_MRCC_GLB_RST0_DMA_SHIFT (10U) -/*! DMA - DMA - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_DMA(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_DMA_SHIFT)) & MRCC_MRCC_GLB_RST0_DMA_MASK) - -#define MRCC_MRCC_GLB_RST0_AOI0_MASK (0x800U) -#define MRCC_MRCC_GLB_RST0_AOI0_SHIFT (11U) -/*! AOI0 - AOI0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_AOI0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_AOI0_SHIFT)) & MRCC_MRCC_GLB_RST0_AOI0_MASK) - -#define MRCC_MRCC_GLB_RST0_CRC0_MASK (0x1000U) -#define MRCC_MRCC_GLB_RST0_CRC0_SHIFT (12U) -/*! CRC0 - CRC0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_CRC0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_CRC0_SHIFT)) & MRCC_MRCC_GLB_RST0_CRC0_MASK) - -#define MRCC_MRCC_GLB_RST0_EIM0_MASK (0x2000U) -#define MRCC_MRCC_GLB_RST0_EIM0_SHIFT (13U) -/*! EIM0 - EIM0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_EIM0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_EIM0_SHIFT)) & MRCC_MRCC_GLB_RST0_EIM0_MASK) - -#define MRCC_MRCC_GLB_RST0_ERM0_MASK (0x4000U) -#define MRCC_MRCC_GLB_RST0_ERM0_SHIFT (14U) -/*! ERM0 - ERM0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_ERM0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_ERM0_SHIFT)) & MRCC_MRCC_GLB_RST0_ERM0_MASK) - -#define MRCC_MRCC_GLB_RST0_AOI1_MASK (0x10000U) -#define MRCC_MRCC_GLB_RST0_AOI1_SHIFT (16U) -/*! AOI1 - AOI1 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_AOI1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_AOI1_SHIFT)) & MRCC_MRCC_GLB_RST0_AOI1_MASK) - -#define MRCC_MRCC_GLB_RST0_FLEXIO0_MASK (0x20000U) -#define MRCC_MRCC_GLB_RST0_FLEXIO0_SHIFT (17U) -/*! FLEXIO0 - FLEXIO0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_FLEXIO0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_FLEXIO0_SHIFT)) & MRCC_MRCC_GLB_RST0_FLEXIO0_MASK) - -#define MRCC_MRCC_GLB_RST0_LPI2C0_MASK (0x40000U) -#define MRCC_MRCC_GLB_RST0_LPI2C0_SHIFT (18U) -/*! LPI2C0 - LPI2C0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_LPI2C0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_LPI2C0_SHIFT)) & MRCC_MRCC_GLB_RST0_LPI2C0_MASK) - -#define MRCC_MRCC_GLB_RST0_LPI2C1_MASK (0x80000U) -#define MRCC_MRCC_GLB_RST0_LPI2C1_SHIFT (19U) -/*! LPI2C1 - LPI2C1 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_LPI2C1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_LPI2C1_SHIFT)) & MRCC_MRCC_GLB_RST0_LPI2C1_MASK) - -#define MRCC_MRCC_GLB_RST0_LPSPI0_MASK (0x100000U) -#define MRCC_MRCC_GLB_RST0_LPSPI0_SHIFT (20U) -/*! LPSPI0 - LPSPI0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_LPSPI0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_LPSPI0_SHIFT)) & MRCC_MRCC_GLB_RST0_LPSPI0_MASK) - -#define MRCC_MRCC_GLB_RST0_LPSPI1_MASK (0x200000U) -#define MRCC_MRCC_GLB_RST0_LPSPI1_SHIFT (21U) -/*! LPSPI1 - LPSPI1 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_LPSPI1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_LPSPI1_SHIFT)) & MRCC_MRCC_GLB_RST0_LPSPI1_MASK) - -#define MRCC_MRCC_GLB_RST0_LPUART0_MASK (0x400000U) -#define MRCC_MRCC_GLB_RST0_LPUART0_SHIFT (22U) -/*! LPUART0 - LPUART0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_LPUART0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_LPUART0_SHIFT)) & MRCC_MRCC_GLB_RST0_LPUART0_MASK) - -#define MRCC_MRCC_GLB_RST0_LPUART1_MASK (0x800000U) -#define MRCC_MRCC_GLB_RST0_LPUART1_SHIFT (23U) -/*! LPUART1 - LPUART1 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_LPUART1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_LPUART1_SHIFT)) & MRCC_MRCC_GLB_RST0_LPUART1_MASK) - -#define MRCC_MRCC_GLB_RST0_LPUART2_MASK (0x1000000U) -#define MRCC_MRCC_GLB_RST0_LPUART2_SHIFT (24U) -/*! LPUART2 - LPUART2 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_LPUART2(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_LPUART2_SHIFT)) & MRCC_MRCC_GLB_RST0_LPUART2_MASK) - -#define MRCC_MRCC_GLB_RST0_LPUART3_MASK (0x2000000U) -#define MRCC_MRCC_GLB_RST0_LPUART3_SHIFT (25U) -/*! LPUART3 - LPUART3 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_LPUART3(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_LPUART3_SHIFT)) & MRCC_MRCC_GLB_RST0_LPUART3_MASK) - -#define MRCC_MRCC_GLB_RST0_LPUART4_MASK (0x4000000U) -#define MRCC_MRCC_GLB_RST0_LPUART4_SHIFT (26U) -/*! LPUART4 - LPUART4 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_LPUART4(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_LPUART4_SHIFT)) & MRCC_MRCC_GLB_RST0_LPUART4_MASK) - -#define MRCC_MRCC_GLB_RST0_USB0_MASK (0x8000000U) -#define MRCC_MRCC_GLB_RST0_USB0_SHIFT (27U) -/*! USB0 - USB0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_USB0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_USB0_SHIFT)) & MRCC_MRCC_GLB_RST0_USB0_MASK) - -#define MRCC_MRCC_GLB_RST0_QDC0_MASK (0x10000000U) -#define MRCC_MRCC_GLB_RST0_QDC0_SHIFT (28U) -/*! QDC0 - QDC0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_QDC0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_QDC0_SHIFT)) & MRCC_MRCC_GLB_RST0_QDC0_MASK) - -#define MRCC_MRCC_GLB_RST0_QDC1_MASK (0x20000000U) -#define MRCC_MRCC_GLB_RST0_QDC1_SHIFT (29U) -/*! QDC1 - QDC1 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_QDC1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_QDC1_SHIFT)) & MRCC_MRCC_GLB_RST0_QDC1_MASK) - -#define MRCC_MRCC_GLB_RST0_FLEXPWM0_MASK (0x40000000U) -#define MRCC_MRCC_GLB_RST0_FLEXPWM0_SHIFT (30U) -/*! FLEXPWM0 - FLEXPWM0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_FLEXPWM0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_FLEXPWM0_SHIFT)) & MRCC_MRCC_GLB_RST0_FLEXPWM0_MASK) - -#define MRCC_MRCC_GLB_RST0_FLEXPWM1_MASK (0x80000000U) -#define MRCC_MRCC_GLB_RST0_FLEXPWM1_SHIFT (31U) -/*! FLEXPWM1 - FLEXPWM1 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST0_FLEXPWM1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_FLEXPWM1_SHIFT)) & MRCC_MRCC_GLB_RST0_FLEXPWM1_MASK) -/*! @} */ - -/*! @name MRCC_GLB_RST0_SET - Peripheral Reset Control Set 0 */ -/*! @{ */ - -#define MRCC_MRCC_GLB_RST0_SET_DATA_MASK (0xFFFFFFFFU) -#define MRCC_MRCC_GLB_RST0_SET_DATA_SHIFT (0U) -/*! DATA - Data array value, refer to corresponding position in MRCC_GLB_RSTn. */ -#define MRCC_MRCC_GLB_RST0_SET_DATA(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_SET_DATA_SHIFT)) & MRCC_MRCC_GLB_RST0_SET_DATA_MASK) -/*! @} */ - -/*! @name MRCC_GLB_RST0_CLR - Peripheral Reset Control Clear 0 */ -/*! @{ */ - -#define MRCC_MRCC_GLB_RST0_CLR_DATA_MASK (0xFFFFFFFFU) -#define MRCC_MRCC_GLB_RST0_CLR_DATA_SHIFT (0U) -/*! DATA - Data array value, refer to corresponding position in MRCC_GLB_RSTn. */ -#define MRCC_MRCC_GLB_RST0_CLR_DATA(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST0_CLR_DATA_SHIFT)) & MRCC_MRCC_GLB_RST0_CLR_DATA_MASK) -/*! @} */ - -/*! @name MRCC_GLB_RST1 - Peripheral Reset Control 1 */ -/*! @{ */ - -#define MRCC_MRCC_GLB_RST1_OSTIMER0_MASK (0x1U) -#define MRCC_MRCC_GLB_RST1_OSTIMER0_SHIFT (0U) -/*! OSTIMER0 - OSTIMER0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST1_OSTIMER0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST1_OSTIMER0_SHIFT)) & MRCC_MRCC_GLB_RST1_OSTIMER0_MASK) - -#define MRCC_MRCC_GLB_RST1_ADC0_MASK (0x2U) -#define MRCC_MRCC_GLB_RST1_ADC0_SHIFT (1U) -/*! ADC0 - ADC0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST1_ADC0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST1_ADC0_SHIFT)) & MRCC_MRCC_GLB_RST1_ADC0_MASK) - -#define MRCC_MRCC_GLB_RST1_ADC1_MASK (0x4U) -#define MRCC_MRCC_GLB_RST1_ADC1_SHIFT (2U) -/*! ADC1 - ADC1 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST1_ADC1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST1_ADC1_SHIFT)) & MRCC_MRCC_GLB_RST1_ADC1_MASK) - -#define MRCC_MRCC_GLB_RST1_CMP1_MASK (0x10U) -#define MRCC_MRCC_GLB_RST1_CMP1_SHIFT (4U) -/*! CMP1 - CMP1 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST1_CMP1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST1_CMP1_SHIFT)) & MRCC_MRCC_GLB_RST1_CMP1_MASK) - -#define MRCC_MRCC_GLB_RST1_DAC0_MASK (0x20U) -#define MRCC_MRCC_GLB_RST1_DAC0_SHIFT (5U) -/*! DAC0 - DAC0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST1_DAC0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST1_DAC0_SHIFT)) & MRCC_MRCC_GLB_RST1_DAC0_MASK) - -#define MRCC_MRCC_GLB_RST1_OPAMP0_MASK (0x40U) -#define MRCC_MRCC_GLB_RST1_OPAMP0_SHIFT (6U) -/*! OPAMP0 - OPAMP0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST1_OPAMP0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST1_OPAMP0_SHIFT)) & MRCC_MRCC_GLB_RST1_OPAMP0_MASK) - -#define MRCC_MRCC_GLB_RST1_PORT0_MASK (0x80U) -#define MRCC_MRCC_GLB_RST1_PORT0_SHIFT (7U) -/*! PORT0 - PORT0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST1_PORT0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST1_PORT0_SHIFT)) & MRCC_MRCC_GLB_RST1_PORT0_MASK) - -#define MRCC_MRCC_GLB_RST1_PORT1_MASK (0x100U) -#define MRCC_MRCC_GLB_RST1_PORT1_SHIFT (8U) -/*! PORT1 - PORT1 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST1_PORT1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST1_PORT1_SHIFT)) & MRCC_MRCC_GLB_RST1_PORT1_MASK) - -#define MRCC_MRCC_GLB_RST1_PORT2_MASK (0x200U) -#define MRCC_MRCC_GLB_RST1_PORT2_SHIFT (9U) -/*! PORT2 - PORT2 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST1_PORT2(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST1_PORT2_SHIFT)) & MRCC_MRCC_GLB_RST1_PORT2_MASK) - -#define MRCC_MRCC_GLB_RST1_PORT3_MASK (0x400U) -#define MRCC_MRCC_GLB_RST1_PORT3_SHIFT (10U) -/*! PORT3 - PORT3 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST1_PORT3(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST1_PORT3_SHIFT)) & MRCC_MRCC_GLB_RST1_PORT3_MASK) - -#define MRCC_MRCC_GLB_RST1_PORT4_MASK (0x800U) -#define MRCC_MRCC_GLB_RST1_PORT4_SHIFT (11U) -/*! PORT4 - PORT4 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST1_PORT4(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST1_PORT4_SHIFT)) & MRCC_MRCC_GLB_RST1_PORT4_MASK) - -#define MRCC_MRCC_GLB_RST1_FLEXCAN0_MASK (0x1000U) -#define MRCC_MRCC_GLB_RST1_FLEXCAN0_SHIFT (12U) -/*! FLEXCAN0 - FLEXCAN0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST1_FLEXCAN0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST1_FLEXCAN0_SHIFT)) & MRCC_MRCC_GLB_RST1_FLEXCAN0_MASK) - -#define MRCC_MRCC_GLB_RST1_LPI2C2_MASK (0x2000U) -#define MRCC_MRCC_GLB_RST1_LPI2C2_SHIFT (13U) -/*! LPI2C2 - LPI2C2 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST1_LPI2C2(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST1_LPI2C2_SHIFT)) & MRCC_MRCC_GLB_RST1_LPI2C2_MASK) - -#define MRCC_MRCC_GLB_RST1_LPI2C3_MASK (0x4000U) -#define MRCC_MRCC_GLB_RST1_LPI2C3_SHIFT (14U) -/*! LPI2C3 - LPI2C3 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST1_LPI2C3(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST1_LPI2C3_SHIFT)) & MRCC_MRCC_GLB_RST1_LPI2C3_MASK) - -#define MRCC_MRCC_GLB_RST1_GPIO0_MASK (0x100000U) -#define MRCC_MRCC_GLB_RST1_GPIO0_SHIFT (20U) -/*! GPIO0 - GPIO0 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST1_GPIO0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST1_GPIO0_SHIFT)) & MRCC_MRCC_GLB_RST1_GPIO0_MASK) - -#define MRCC_MRCC_GLB_RST1_GPIO1_MASK (0x200000U) -#define MRCC_MRCC_GLB_RST1_GPIO1_SHIFT (21U) -/*! GPIO1 - GPIO1 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST1_GPIO1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST1_GPIO1_SHIFT)) & MRCC_MRCC_GLB_RST1_GPIO1_MASK) - -#define MRCC_MRCC_GLB_RST1_GPIO2_MASK (0x400000U) -#define MRCC_MRCC_GLB_RST1_GPIO2_SHIFT (22U) -/*! GPIO2 - GPIO2 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST1_GPIO2(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST1_GPIO2_SHIFT)) & MRCC_MRCC_GLB_RST1_GPIO2_MASK) - -#define MRCC_MRCC_GLB_RST1_GPIO3_MASK (0x800000U) -#define MRCC_MRCC_GLB_RST1_GPIO3_SHIFT (23U) -/*! GPIO3 - GPIO3 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST1_GPIO3(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST1_GPIO3_SHIFT)) & MRCC_MRCC_GLB_RST1_GPIO3_MASK) - -#define MRCC_MRCC_GLB_RST1_GPIO4_MASK (0x1000000U) -#define MRCC_MRCC_GLB_RST1_GPIO4_SHIFT (24U) -/*! GPIO4 - GPIO4 - * 0b0..Peripheral is held in reset - * 0b1..Peripheral is released from reset - */ -#define MRCC_MRCC_GLB_RST1_GPIO4(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST1_GPIO4_SHIFT)) & MRCC_MRCC_GLB_RST1_GPIO4_MASK) -/*! @} */ - -/*! @name MRCC_GLB_RST1_SET - Peripheral Reset Control Set 1 */ -/*! @{ */ - -#define MRCC_MRCC_GLB_RST1_SET_DATA_MASK (0xFFFFFFFFU) -#define MRCC_MRCC_GLB_RST1_SET_DATA_SHIFT (0U) -/*! DATA - Data array value, refer to corresponding position in MRCC_GLB_RSTn. */ -#define MRCC_MRCC_GLB_RST1_SET_DATA(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST1_SET_DATA_SHIFT)) & MRCC_MRCC_GLB_RST1_SET_DATA_MASK) -/*! @} */ - -/*! @name MRCC_GLB_RST1_CLR - Peripheral Reset Control Clear 1 */ -/*! @{ */ - -#define MRCC_MRCC_GLB_RST1_CLR_DATA_MASK (0xFFFFFFFFU) -#define MRCC_MRCC_GLB_RST1_CLR_DATA_SHIFT (0U) -/*! DATA - Data array value, refer to corresponding position in MRCC_GLB_RSTn. */ -#define MRCC_MRCC_GLB_RST1_CLR_DATA(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_RST1_CLR_DATA_SHIFT)) & MRCC_MRCC_GLB_RST1_CLR_DATA_MASK) -/*! @} */ - -/*! @name MRCC_GLB_CC0 - AHB Clock Control 0 */ -/*! @{ */ - -#define MRCC_MRCC_GLB_CC0_INPUTMUX0_MASK (0x1U) -#define MRCC_MRCC_GLB_CC0_INPUTMUX0_SHIFT (0U) -/*! INPUTMUX0 - INPUTMUX0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_INPUTMUX0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_INPUTMUX0_SHIFT)) & MRCC_MRCC_GLB_CC0_INPUTMUX0_MASK) - -#define MRCC_MRCC_GLB_CC0_I3C0_MASK (0x2U) -#define MRCC_MRCC_GLB_CC0_I3C0_SHIFT (1U) -/*! I3C0 - I3C0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_I3C0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_I3C0_SHIFT)) & MRCC_MRCC_GLB_CC0_I3C0_MASK) - -#define MRCC_MRCC_GLB_CC0_CTIMER0_MASK (0x4U) -#define MRCC_MRCC_GLB_CC0_CTIMER0_SHIFT (2U) -/*! CTIMER0 - CTIMER0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_CTIMER0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_CTIMER0_SHIFT)) & MRCC_MRCC_GLB_CC0_CTIMER0_MASK) - -#define MRCC_MRCC_GLB_CC0_CTIMER1_MASK (0x8U) -#define MRCC_MRCC_GLB_CC0_CTIMER1_SHIFT (3U) -/*! CTIMER1 - CTIMER1 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_CTIMER1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_CTIMER1_SHIFT)) & MRCC_MRCC_GLB_CC0_CTIMER1_MASK) - -#define MRCC_MRCC_GLB_CC0_CTIMER2_MASK (0x10U) -#define MRCC_MRCC_GLB_CC0_CTIMER2_SHIFT (4U) -/*! CTIMER2 - CTIMER2 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_CTIMER2(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_CTIMER2_SHIFT)) & MRCC_MRCC_GLB_CC0_CTIMER2_MASK) - -#define MRCC_MRCC_GLB_CC0_CTIMER3_MASK (0x20U) -#define MRCC_MRCC_GLB_CC0_CTIMER3_SHIFT (5U) -/*! CTIMER3 - CTIMER3 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_CTIMER3(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_CTIMER3_SHIFT)) & MRCC_MRCC_GLB_CC0_CTIMER3_MASK) - -#define MRCC_MRCC_GLB_CC0_CTIMER4_MASK (0x40U) -#define MRCC_MRCC_GLB_CC0_CTIMER4_SHIFT (6U) -/*! CTIMER4 - CTIMER4 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_CTIMER4(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_CTIMER4_SHIFT)) & MRCC_MRCC_GLB_CC0_CTIMER4_MASK) - -#define MRCC_MRCC_GLB_CC0_FREQME_MASK (0x80U) -#define MRCC_MRCC_GLB_CC0_FREQME_SHIFT (7U) -/*! FREQME - FREQME - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_FREQME(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_FREQME_SHIFT)) & MRCC_MRCC_GLB_CC0_FREQME_MASK) - -#define MRCC_MRCC_GLB_CC0_UTICK0_MASK (0x100U) -#define MRCC_MRCC_GLB_CC0_UTICK0_SHIFT (8U) -/*! UTICK0 - UTICK0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_UTICK0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_UTICK0_SHIFT)) & MRCC_MRCC_GLB_CC0_UTICK0_MASK) - -#define MRCC_MRCC_GLB_CC0_WWDT0_MASK (0x200U) -#define MRCC_MRCC_GLB_CC0_WWDT0_SHIFT (9U) -/*! WWDT0 - WWDT0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_WWDT0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_WWDT0_SHIFT)) & MRCC_MRCC_GLB_CC0_WWDT0_MASK) - -#define MRCC_MRCC_GLB_CC0_DMA_MASK (0x400U) -#define MRCC_MRCC_GLB_CC0_DMA_SHIFT (10U) -/*! DMA - DMA - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_DMA(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_DMA_SHIFT)) & MRCC_MRCC_GLB_CC0_DMA_MASK) - -#define MRCC_MRCC_GLB_CC0_AOI0_MASK (0x800U) -#define MRCC_MRCC_GLB_CC0_AOI0_SHIFT (11U) -/*! AOI0 - AOI0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_AOI0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_AOI0_SHIFT)) & MRCC_MRCC_GLB_CC0_AOI0_MASK) - -#define MRCC_MRCC_GLB_CC0_CRC0_MASK (0x1000U) -#define MRCC_MRCC_GLB_CC0_CRC0_SHIFT (12U) -/*! CRC0 - CRC0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_CRC0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_CRC0_SHIFT)) & MRCC_MRCC_GLB_CC0_CRC0_MASK) - -#define MRCC_MRCC_GLB_CC0_EIM0_MASK (0x2000U) -#define MRCC_MRCC_GLB_CC0_EIM0_SHIFT (13U) -/*! EIM0 - EIM0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_EIM0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_EIM0_SHIFT)) & MRCC_MRCC_GLB_CC0_EIM0_MASK) - -#define MRCC_MRCC_GLB_CC0_ERM0_MASK (0x4000U) -#define MRCC_MRCC_GLB_CC0_ERM0_SHIFT (14U) -/*! ERM0 - ERM0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_ERM0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_ERM0_SHIFT)) & MRCC_MRCC_GLB_CC0_ERM0_MASK) - -#define MRCC_MRCC_GLB_CC0_FMC_MASK (0x8000U) -#define MRCC_MRCC_GLB_CC0_FMC_SHIFT (15U) -/*! FMC - FMC - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_FMC(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_FMC_SHIFT)) & MRCC_MRCC_GLB_CC0_FMC_MASK) - -#define MRCC_MRCC_GLB_CC0_AOI1_MASK (0x10000U) -#define MRCC_MRCC_GLB_CC0_AOI1_SHIFT (16U) -/*! AOI1 - AOI1 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_AOI1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_AOI1_SHIFT)) & MRCC_MRCC_GLB_CC0_AOI1_MASK) - -#define MRCC_MRCC_GLB_CC0_FLEXIO0_MASK (0x20000U) -#define MRCC_MRCC_GLB_CC0_FLEXIO0_SHIFT (17U) -/*! FLEXIO0 - FLEXIO0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_FLEXIO0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_FLEXIO0_SHIFT)) & MRCC_MRCC_GLB_CC0_FLEXIO0_MASK) - -#define MRCC_MRCC_GLB_CC0_LPI2C0_MASK (0x40000U) -#define MRCC_MRCC_GLB_CC0_LPI2C0_SHIFT (18U) -/*! LPI2C0 - LPI2C0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_LPI2C0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_LPI2C0_SHIFT)) & MRCC_MRCC_GLB_CC0_LPI2C0_MASK) - -#define MRCC_MRCC_GLB_CC0_LPI2C1_MASK (0x80000U) -#define MRCC_MRCC_GLB_CC0_LPI2C1_SHIFT (19U) -/*! LPI2C1 - LPI2C1 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_LPI2C1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_LPI2C1_SHIFT)) & MRCC_MRCC_GLB_CC0_LPI2C1_MASK) - -#define MRCC_MRCC_GLB_CC0_LPSPI0_MASK (0x100000U) -#define MRCC_MRCC_GLB_CC0_LPSPI0_SHIFT (20U) -/*! LPSPI0 - LPSPI0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_LPSPI0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_LPSPI0_SHIFT)) & MRCC_MRCC_GLB_CC0_LPSPI0_MASK) - -#define MRCC_MRCC_GLB_CC0_LPSPI1_MASK (0x200000U) -#define MRCC_MRCC_GLB_CC0_LPSPI1_SHIFT (21U) -/*! LPSPI1 - LPSPI1 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_LPSPI1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_LPSPI1_SHIFT)) & MRCC_MRCC_GLB_CC0_LPSPI1_MASK) - -#define MRCC_MRCC_GLB_CC0_LPUART0_MASK (0x400000U) -#define MRCC_MRCC_GLB_CC0_LPUART0_SHIFT (22U) -/*! LPUART0 - LPUART0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_LPUART0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_LPUART0_SHIFT)) & MRCC_MRCC_GLB_CC0_LPUART0_MASK) - -#define MRCC_MRCC_GLB_CC0_LPUART1_MASK (0x800000U) -#define MRCC_MRCC_GLB_CC0_LPUART1_SHIFT (23U) -/*! LPUART1 - LPUART1 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_LPUART1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_LPUART1_SHIFT)) & MRCC_MRCC_GLB_CC0_LPUART1_MASK) - -#define MRCC_MRCC_GLB_CC0_LPUART2_MASK (0x1000000U) -#define MRCC_MRCC_GLB_CC0_LPUART2_SHIFT (24U) -/*! LPUART2 - LPUART2 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_LPUART2(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_LPUART2_SHIFT)) & MRCC_MRCC_GLB_CC0_LPUART2_MASK) - -#define MRCC_MRCC_GLB_CC0_LPUART3_MASK (0x2000000U) -#define MRCC_MRCC_GLB_CC0_LPUART3_SHIFT (25U) -/*! LPUART3 - LPUART3 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_LPUART3(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_LPUART3_SHIFT)) & MRCC_MRCC_GLB_CC0_LPUART3_MASK) - -#define MRCC_MRCC_GLB_CC0_LPUART4_MASK (0x4000000U) -#define MRCC_MRCC_GLB_CC0_LPUART4_SHIFT (26U) -/*! LPUART4 - LPUART4 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_LPUART4(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_LPUART4_SHIFT)) & MRCC_MRCC_GLB_CC0_LPUART4_MASK) - -#define MRCC_MRCC_GLB_CC0_USB0_MASK (0x8000000U) -#define MRCC_MRCC_GLB_CC0_USB0_SHIFT (27U) -/*! USB0 - USB0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_USB0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_USB0_SHIFT)) & MRCC_MRCC_GLB_CC0_USB0_MASK) - -#define MRCC_MRCC_GLB_CC0_QDC0_MASK (0x10000000U) -#define MRCC_MRCC_GLB_CC0_QDC0_SHIFT (28U) -/*! QDC0 - QDC0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_QDC0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_QDC0_SHIFT)) & MRCC_MRCC_GLB_CC0_QDC0_MASK) - -#define MRCC_MRCC_GLB_CC0_QDC1_MASK (0x20000000U) -#define MRCC_MRCC_GLB_CC0_QDC1_SHIFT (29U) -/*! QDC1 - QDC1 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_QDC1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_QDC1_SHIFT)) & MRCC_MRCC_GLB_CC0_QDC1_MASK) - -#define MRCC_MRCC_GLB_CC0_FLEXPWM0_MASK (0x40000000U) -#define MRCC_MRCC_GLB_CC0_FLEXPWM0_SHIFT (30U) -/*! FLEXPWM0 - FLEXPWM0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_FLEXPWM0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_FLEXPWM0_SHIFT)) & MRCC_MRCC_GLB_CC0_FLEXPWM0_MASK) - -#define MRCC_MRCC_GLB_CC0_FLEXPWM1_MASK (0x80000000U) -#define MRCC_MRCC_GLB_CC0_FLEXPWM1_SHIFT (31U) -/*! FLEXPWM1 - FLEXPWM1 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC0_FLEXPWM1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_FLEXPWM1_SHIFT)) & MRCC_MRCC_GLB_CC0_FLEXPWM1_MASK) -/*! @} */ - -/*! @name MRCC_GLB_CC0_SET - AHB Clock Control Set 0 */ -/*! @{ */ - -#define MRCC_MRCC_GLB_CC0_SET_DATA_MASK (0xFFFFFFFFU) -#define MRCC_MRCC_GLB_CC0_SET_DATA_SHIFT (0U) -/*! DATA - Data array value, refer to corresponding position in MRCC_GLB_CCn. */ -#define MRCC_MRCC_GLB_CC0_SET_DATA(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_SET_DATA_SHIFT)) & MRCC_MRCC_GLB_CC0_SET_DATA_MASK) -/*! @} */ - -/*! @name MRCC_GLB_CC0_CLR - AHB Clock Control Clear 0 */ -/*! @{ */ - -#define MRCC_MRCC_GLB_CC0_CLR_DATA_MASK (0xFFFFFFFFU) -#define MRCC_MRCC_GLB_CC0_CLR_DATA_SHIFT (0U) -/*! DATA - Data array value, refer to corresponding position in MRCC_GLB_CCn. */ -#define MRCC_MRCC_GLB_CC0_CLR_DATA(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC0_CLR_DATA_SHIFT)) & MRCC_MRCC_GLB_CC0_CLR_DATA_MASK) -/*! @} */ - -/*! @name MRCC_GLB_CC1 - AHB Clock Control 1 */ -/*! @{ */ - -#define MRCC_MRCC_GLB_CC1_OSTIMER0_MASK (0x1U) -#define MRCC_MRCC_GLB_CC1_OSTIMER0_SHIFT (0U) -/*! OSTIMER0 - OSTIMER0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_OSTIMER0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_OSTIMER0_SHIFT)) & MRCC_MRCC_GLB_CC1_OSTIMER0_MASK) - -#define MRCC_MRCC_GLB_CC1_ADC0_MASK (0x2U) -#define MRCC_MRCC_GLB_CC1_ADC0_SHIFT (1U) -/*! ADC0 - ADC0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_ADC0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_ADC0_SHIFT)) & MRCC_MRCC_GLB_CC1_ADC0_MASK) - -#define MRCC_MRCC_GLB_CC1_ADC1_MASK (0x4U) -#define MRCC_MRCC_GLB_CC1_ADC1_SHIFT (2U) -/*! ADC1 - ADC1 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_ADC1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_ADC1_SHIFT)) & MRCC_MRCC_GLB_CC1_ADC1_MASK) - -#define MRCC_MRCC_GLB_CC1_CMP0_MASK (0x8U) -#define MRCC_MRCC_GLB_CC1_CMP0_SHIFT (3U) -/*! CMP0 - CMP0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_CMP0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_CMP0_SHIFT)) & MRCC_MRCC_GLB_CC1_CMP0_MASK) - -#define MRCC_MRCC_GLB_CC1_CMP1_MASK (0x10U) -#define MRCC_MRCC_GLB_CC1_CMP1_SHIFT (4U) -/*! CMP1 - CMP1 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_CMP1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_CMP1_SHIFT)) & MRCC_MRCC_GLB_CC1_CMP1_MASK) - -#define MRCC_MRCC_GLB_CC1_DAC0_MASK (0x20U) -#define MRCC_MRCC_GLB_CC1_DAC0_SHIFT (5U) -/*! DAC0 - DAC0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_DAC0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_DAC0_SHIFT)) & MRCC_MRCC_GLB_CC1_DAC0_MASK) - -#define MRCC_MRCC_GLB_CC1_OPAMP0_MASK (0x40U) -#define MRCC_MRCC_GLB_CC1_OPAMP0_SHIFT (6U) -/*! OPAMP0 - OPAMP0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_OPAMP0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_OPAMP0_SHIFT)) & MRCC_MRCC_GLB_CC1_OPAMP0_MASK) - -#define MRCC_MRCC_GLB_CC1_PORT0_MASK (0x80U) -#define MRCC_MRCC_GLB_CC1_PORT0_SHIFT (7U) -/*! PORT0 - PORT0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_PORT0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_PORT0_SHIFT)) & MRCC_MRCC_GLB_CC1_PORT0_MASK) - -#define MRCC_MRCC_GLB_CC1_PORT1_MASK (0x100U) -#define MRCC_MRCC_GLB_CC1_PORT1_SHIFT (8U) -/*! PORT1 - PORT1 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_PORT1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_PORT1_SHIFT)) & MRCC_MRCC_GLB_CC1_PORT1_MASK) - -#define MRCC_MRCC_GLB_CC1_PORT2_MASK (0x200U) -#define MRCC_MRCC_GLB_CC1_PORT2_SHIFT (9U) -/*! PORT2 - PORT2 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_PORT2(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_PORT2_SHIFT)) & MRCC_MRCC_GLB_CC1_PORT2_MASK) - -#define MRCC_MRCC_GLB_CC1_PORT3_MASK (0x400U) -#define MRCC_MRCC_GLB_CC1_PORT3_SHIFT (10U) -/*! PORT3 - PORT3 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_PORT3(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_PORT3_SHIFT)) & MRCC_MRCC_GLB_CC1_PORT3_MASK) - -#define MRCC_MRCC_GLB_CC1_PORT4_MASK (0x800U) -#define MRCC_MRCC_GLB_CC1_PORT4_SHIFT (11U) -/*! PORT4 - PORT4 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_PORT4(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_PORT4_SHIFT)) & MRCC_MRCC_GLB_CC1_PORT4_MASK) - -#define MRCC_MRCC_GLB_CC1_FLEXCAN0_MASK (0x1000U) -#define MRCC_MRCC_GLB_CC1_FLEXCAN0_SHIFT (12U) -/*! FLEXCAN0 - FLEXCAN0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_FLEXCAN0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_FLEXCAN0_SHIFT)) & MRCC_MRCC_GLB_CC1_FLEXCAN0_MASK) - -#define MRCC_MRCC_GLB_CC1_LPI2C2_MASK (0x2000U) -#define MRCC_MRCC_GLB_CC1_LPI2C2_SHIFT (13U) -/*! LPI2C2 - LPI2C2 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_LPI2C2(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_LPI2C2_SHIFT)) & MRCC_MRCC_GLB_CC1_LPI2C2_MASK) - -#define MRCC_MRCC_GLB_CC1_LPI2C3_MASK (0x4000U) -#define MRCC_MRCC_GLB_CC1_LPI2C3_SHIFT (14U) -/*! LPI2C3 - LPI2C3 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_LPI2C3(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_LPI2C3_SHIFT)) & MRCC_MRCC_GLB_CC1_LPI2C3_MASK) - -#define MRCC_MRCC_GLB_CC1_RAMA_MASK (0x40000U) -#define MRCC_MRCC_GLB_CC1_RAMA_SHIFT (18U) -/*! RAMA - RAMA - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_RAMA(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_RAMA_SHIFT)) & MRCC_MRCC_GLB_CC1_RAMA_MASK) - -#define MRCC_MRCC_GLB_CC1_RAMB_MASK (0x80000U) -#define MRCC_MRCC_GLB_CC1_RAMB_SHIFT (19U) -/*! RAMB - RAMB - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_RAMB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_RAMB_SHIFT)) & MRCC_MRCC_GLB_CC1_RAMB_MASK) - -#define MRCC_MRCC_GLB_CC1_GPIO0_MASK (0x100000U) -#define MRCC_MRCC_GLB_CC1_GPIO0_SHIFT (20U) -/*! GPIO0 - GPIO0 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_GPIO0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_GPIO0_SHIFT)) & MRCC_MRCC_GLB_CC1_GPIO0_MASK) - -#define MRCC_MRCC_GLB_CC1_GPIO1_MASK (0x200000U) -#define MRCC_MRCC_GLB_CC1_GPIO1_SHIFT (21U) -/*! GPIO1 - GPIO1 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_GPIO1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_GPIO1_SHIFT)) & MRCC_MRCC_GLB_CC1_GPIO1_MASK) - -#define MRCC_MRCC_GLB_CC1_GPIO2_MASK (0x400000U) -#define MRCC_MRCC_GLB_CC1_GPIO2_SHIFT (22U) -/*! GPIO2 - GPIO2 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_GPIO2(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_GPIO2_SHIFT)) & MRCC_MRCC_GLB_CC1_GPIO2_MASK) - -#define MRCC_MRCC_GLB_CC1_GPIO3_MASK (0x800000U) -#define MRCC_MRCC_GLB_CC1_GPIO3_SHIFT (23U) -/*! GPIO3 - GPIO3 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_GPIO3(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_GPIO3_SHIFT)) & MRCC_MRCC_GLB_CC1_GPIO3_MASK) - -#define MRCC_MRCC_GLB_CC1_GPIO4_MASK (0x1000000U) -#define MRCC_MRCC_GLB_CC1_GPIO4_SHIFT (24U) -/*! GPIO4 - GPIO4 - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_GPIO4(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_GPIO4_SHIFT)) & MRCC_MRCC_GLB_CC1_GPIO4_MASK) - -#define MRCC_MRCC_GLB_CC1_ROMC_MASK (0x2000000U) -#define MRCC_MRCC_GLB_CC1_ROMC_SHIFT (25U) -/*! ROMC - ROMC - * 0b0..Peripheral clock is disabled - * 0b1..Peripheral clock is enabled - */ -#define MRCC_MRCC_GLB_CC1_ROMC(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC1_ROMC_SHIFT)) & MRCC_MRCC_GLB_CC1_ROMC_MASK) -/*! @} */ - -/*! @name MRCC_GLB_CC_SET - AHB Clock Control Set 1 */ -/*! @{ */ - -#define MRCC_MRCC_GLB_CC_SET_DATA_MASK (0xFFFFFFFFU) -#define MRCC_MRCC_GLB_CC_SET_DATA_SHIFT (0U) -/*! DATA - Data array value, refer to corresponding position in MRCC_GLB_CCn. */ -#define MRCC_MRCC_GLB_CC_SET_DATA(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC_SET_DATA_SHIFT)) & MRCC_MRCC_GLB_CC_SET_DATA_MASK) -/*! @} */ - -/* The count of MRCC_MRCC_GLB_CC_SET */ -#define MRCC_MRCC_GLB_CC_SET_COUNT (1U) - -/*! @name MRCC_GLB_CC_CLR - AHB Clock Control Clear 1 */ -/*! @{ */ - -#define MRCC_MRCC_GLB_CC_CLR_DATA_MASK (0xFFFFFFFFU) -#define MRCC_MRCC_GLB_CC_CLR_DATA_SHIFT (0U) -/*! DATA - Data array value, refer to corresponding position in MRCC_GLB_CCn. */ -#define MRCC_MRCC_GLB_CC_CLR_DATA(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_CC_CLR_DATA_SHIFT)) & MRCC_MRCC_GLB_CC_CLR_DATA_MASK) -/*! @} */ - -/* The count of MRCC_MRCC_GLB_CC_CLR */ -#define MRCC_MRCC_GLB_CC_CLR_COUNT (1U) - -/*! @name MRCC_GLB_ACC0 - Control Automatic Clock Gating 0 */ -/*! @{ */ - -#define MRCC_MRCC_GLB_ACC0_INPUTMUX0_MASK (0x1U) -#define MRCC_MRCC_GLB_ACC0_INPUTMUX0_SHIFT (0U) -/*! INPUTMUX0 - INPUTMUX0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_INPUTMUX0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_INPUTMUX0_SHIFT)) & MRCC_MRCC_GLB_ACC0_INPUTMUX0_MASK) - -#define MRCC_MRCC_GLB_ACC0_I3C0_MASK (0x2U) -#define MRCC_MRCC_GLB_ACC0_I3C0_SHIFT (1U) -/*! I3C0 - I3C0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_I3C0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_I3C0_SHIFT)) & MRCC_MRCC_GLB_ACC0_I3C0_MASK) - -#define MRCC_MRCC_GLB_ACC0_CTIMER0_MASK (0x4U) -#define MRCC_MRCC_GLB_ACC0_CTIMER0_SHIFT (2U) -/*! CTIMER0 - CTIMER0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_CTIMER0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_CTIMER0_SHIFT)) & MRCC_MRCC_GLB_ACC0_CTIMER0_MASK) - -#define MRCC_MRCC_GLB_ACC0_CTIMER1_MASK (0x8U) -#define MRCC_MRCC_GLB_ACC0_CTIMER1_SHIFT (3U) -/*! CTIMER1 - CTIMER1 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_CTIMER1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_CTIMER1_SHIFT)) & MRCC_MRCC_GLB_ACC0_CTIMER1_MASK) - -#define MRCC_MRCC_GLB_ACC0_CTIMER2_MASK (0x10U) -#define MRCC_MRCC_GLB_ACC0_CTIMER2_SHIFT (4U) -/*! CTIMER2 - CTIMER2 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_CTIMER2(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_CTIMER2_SHIFT)) & MRCC_MRCC_GLB_ACC0_CTIMER2_MASK) - -#define MRCC_MRCC_GLB_ACC0_CTIMER3_MASK (0x20U) -#define MRCC_MRCC_GLB_ACC0_CTIMER3_SHIFT (5U) -/*! CTIMER3 - CTIMER3 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_CTIMER3(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_CTIMER3_SHIFT)) & MRCC_MRCC_GLB_ACC0_CTIMER3_MASK) - -#define MRCC_MRCC_GLB_ACC0_CTIMER4_MASK (0x40U) -#define MRCC_MRCC_GLB_ACC0_CTIMER4_SHIFT (6U) -/*! CTIMER4 - CTIMER4 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_CTIMER4(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_CTIMER4_SHIFT)) & MRCC_MRCC_GLB_ACC0_CTIMER4_MASK) - -#define MRCC_MRCC_GLB_ACC0_FREQME_MASK (0x80U) -#define MRCC_MRCC_GLB_ACC0_FREQME_SHIFT (7U) -/*! FREQME - FREQME - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_FREQME(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_FREQME_SHIFT)) & MRCC_MRCC_GLB_ACC0_FREQME_MASK) - -#define MRCC_MRCC_GLB_ACC0_UTICK0_MASK (0x100U) -#define MRCC_MRCC_GLB_ACC0_UTICK0_SHIFT (8U) -/*! UTICK0 - UTICK0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_UTICK0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_UTICK0_SHIFT)) & MRCC_MRCC_GLB_ACC0_UTICK0_MASK) - -#define MRCC_MRCC_GLB_ACC0_WWDT0_MASK (0x200U) -#define MRCC_MRCC_GLB_ACC0_WWDT0_SHIFT (9U) -/*! WWDT0 - WWDT0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_WWDT0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_WWDT0_SHIFT)) & MRCC_MRCC_GLB_ACC0_WWDT0_MASK) - -#define MRCC_MRCC_GLB_ACC0_DMA_MASK (0x400U) -#define MRCC_MRCC_GLB_ACC0_DMA_SHIFT (10U) -/*! DMA - DMA - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_DMA(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_DMA_SHIFT)) & MRCC_MRCC_GLB_ACC0_DMA_MASK) - -#define MRCC_MRCC_GLB_ACC0_AOI0_MASK (0x800U) -#define MRCC_MRCC_GLB_ACC0_AOI0_SHIFT (11U) -/*! AOI0 - AOI0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_AOI0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_AOI0_SHIFT)) & MRCC_MRCC_GLB_ACC0_AOI0_MASK) - -#define MRCC_MRCC_GLB_ACC0_CRC0_MASK (0x1000U) -#define MRCC_MRCC_GLB_ACC0_CRC0_SHIFT (12U) -/*! CRC0 - CRC0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_CRC0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_CRC0_SHIFT)) & MRCC_MRCC_GLB_ACC0_CRC0_MASK) - -#define MRCC_MRCC_GLB_ACC0_EIM0_MASK (0x2000U) -#define MRCC_MRCC_GLB_ACC0_EIM0_SHIFT (13U) -/*! EIM0 - EIM0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_EIM0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_EIM0_SHIFT)) & MRCC_MRCC_GLB_ACC0_EIM0_MASK) - -#define MRCC_MRCC_GLB_ACC0_ERM0_MASK (0x4000U) -#define MRCC_MRCC_GLB_ACC0_ERM0_SHIFT (14U) -/*! ERM0 - ERM0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_ERM0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_ERM0_SHIFT)) & MRCC_MRCC_GLB_ACC0_ERM0_MASK) - -#define MRCC_MRCC_GLB_ACC0_FMC_MASK (0x8000U) -#define MRCC_MRCC_GLB_ACC0_FMC_SHIFT (15U) -/*! FMC - FMC - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_FMC(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_FMC_SHIFT)) & MRCC_MRCC_GLB_ACC0_FMC_MASK) - -#define MRCC_MRCC_GLB_ACC0_AOI1_MASK (0x10000U) -#define MRCC_MRCC_GLB_ACC0_AOI1_SHIFT (16U) -/*! AOI1 - AOI1 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_AOI1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_AOI1_SHIFT)) & MRCC_MRCC_GLB_ACC0_AOI1_MASK) - -#define MRCC_MRCC_GLB_ACC0_FLEXIO0_MASK (0x20000U) -#define MRCC_MRCC_GLB_ACC0_FLEXIO0_SHIFT (17U) -/*! FLEXIO0 - FLEXIO0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_FLEXIO0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_FLEXIO0_SHIFT)) & MRCC_MRCC_GLB_ACC0_FLEXIO0_MASK) - -#define MRCC_MRCC_GLB_ACC0_LPI2C0_MASK (0x40000U) -#define MRCC_MRCC_GLB_ACC0_LPI2C0_SHIFT (18U) -/*! LPI2C0 - LPI2C0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_LPI2C0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_LPI2C0_SHIFT)) & MRCC_MRCC_GLB_ACC0_LPI2C0_MASK) - -#define MRCC_MRCC_GLB_ACC0_LPI2C1_MASK (0x80000U) -#define MRCC_MRCC_GLB_ACC0_LPI2C1_SHIFT (19U) -/*! LPI2C1 - LPI2C1 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_LPI2C1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_LPI2C1_SHIFT)) & MRCC_MRCC_GLB_ACC0_LPI2C1_MASK) - -#define MRCC_MRCC_GLB_ACC0_LPSPI0_MASK (0x100000U) -#define MRCC_MRCC_GLB_ACC0_LPSPI0_SHIFT (20U) -/*! LPSPI0 - LPSPI0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_LPSPI0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_LPSPI0_SHIFT)) & MRCC_MRCC_GLB_ACC0_LPSPI0_MASK) - -#define MRCC_MRCC_GLB_ACC0_LPSPI1_MASK (0x200000U) -#define MRCC_MRCC_GLB_ACC0_LPSPI1_SHIFT (21U) -/*! LPSPI1 - LPSPI1 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_LPSPI1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_LPSPI1_SHIFT)) & MRCC_MRCC_GLB_ACC0_LPSPI1_MASK) - -#define MRCC_MRCC_GLB_ACC0_LPUART0_MASK (0x400000U) -#define MRCC_MRCC_GLB_ACC0_LPUART0_SHIFT (22U) -/*! LPUART0 - LPUART0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_LPUART0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_LPUART0_SHIFT)) & MRCC_MRCC_GLB_ACC0_LPUART0_MASK) - -#define MRCC_MRCC_GLB_ACC0_LPUART1_MASK (0x800000U) -#define MRCC_MRCC_GLB_ACC0_LPUART1_SHIFT (23U) -/*! LPUART1 - LPUART1 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_LPUART1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_LPUART1_SHIFT)) & MRCC_MRCC_GLB_ACC0_LPUART1_MASK) - -#define MRCC_MRCC_GLB_ACC0_LPUART2_MASK (0x1000000U) -#define MRCC_MRCC_GLB_ACC0_LPUART2_SHIFT (24U) -/*! LPUART2 - LPUART2 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_LPUART2(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_LPUART2_SHIFT)) & MRCC_MRCC_GLB_ACC0_LPUART2_MASK) - -#define MRCC_MRCC_GLB_ACC0_LPUART3_MASK (0x2000000U) -#define MRCC_MRCC_GLB_ACC0_LPUART3_SHIFT (25U) -/*! LPUART3 - LPUART3 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_LPUART3(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_LPUART3_SHIFT)) & MRCC_MRCC_GLB_ACC0_LPUART3_MASK) - -#define MRCC_MRCC_GLB_ACC0_LPUART4_MASK (0x4000000U) -#define MRCC_MRCC_GLB_ACC0_LPUART4_SHIFT (26U) -/*! LPUART4 - LPUART4 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_LPUART4(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_LPUART4_SHIFT)) & MRCC_MRCC_GLB_ACC0_LPUART4_MASK) - -#define MRCC_MRCC_GLB_ACC0_USB0_MASK (0x8000000U) -#define MRCC_MRCC_GLB_ACC0_USB0_SHIFT (27U) -/*! USB0 - USB0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_USB0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_USB0_SHIFT)) & MRCC_MRCC_GLB_ACC0_USB0_MASK) - -#define MRCC_MRCC_GLB_ACC0_QDC0_MASK (0x10000000U) -#define MRCC_MRCC_GLB_ACC0_QDC0_SHIFT (28U) -/*! QDC0 - QDC0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_QDC0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_QDC0_SHIFT)) & MRCC_MRCC_GLB_ACC0_QDC0_MASK) - -#define MRCC_MRCC_GLB_ACC0_QDC1_MASK (0x20000000U) -#define MRCC_MRCC_GLB_ACC0_QDC1_SHIFT (29U) -/*! QDC1 - QDC1 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_QDC1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_QDC1_SHIFT)) & MRCC_MRCC_GLB_ACC0_QDC1_MASK) - -#define MRCC_MRCC_GLB_ACC0_FLEXPWM0_MASK (0x40000000U) -#define MRCC_MRCC_GLB_ACC0_FLEXPWM0_SHIFT (30U) -/*! FLEXPWM0 - FLEXPWM0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_FLEXPWM0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_FLEXPWM0_SHIFT)) & MRCC_MRCC_GLB_ACC0_FLEXPWM0_MASK) - -#define MRCC_MRCC_GLB_ACC0_FLEXPWM1_MASK (0x80000000U) -#define MRCC_MRCC_GLB_ACC0_FLEXPWM1_SHIFT (31U) -/*! FLEXPWM1 - FLEXPWM1 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC0_FLEXPWM1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC0_FLEXPWM1_SHIFT)) & MRCC_MRCC_GLB_ACC0_FLEXPWM1_MASK) -/*! @} */ - -/*! @name MRCC_GLB_ACC1 - Control Automatic Clock Gating 1 */ -/*! @{ */ - -#define MRCC_MRCC_GLB_ACC1_OSTIMER0_MASK (0x1U) -#define MRCC_MRCC_GLB_ACC1_OSTIMER0_SHIFT (0U) -/*! OSTIMER0 - OSTIMER0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC1_OSTIMER0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC1_OSTIMER0_SHIFT)) & MRCC_MRCC_GLB_ACC1_OSTIMER0_MASK) - -#define MRCC_MRCC_GLB_ACC1_ADC0_MASK (0x2U) -#define MRCC_MRCC_GLB_ACC1_ADC0_SHIFT (1U) -/*! ADC0 - ADC0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC1_ADC0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC1_ADC0_SHIFT)) & MRCC_MRCC_GLB_ACC1_ADC0_MASK) - -#define MRCC_MRCC_GLB_ACC1_ADC1_MASK (0x4U) -#define MRCC_MRCC_GLB_ACC1_ADC1_SHIFT (2U) -/*! ADC1 - ADC1 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC1_ADC1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC1_ADC1_SHIFT)) & MRCC_MRCC_GLB_ACC1_ADC1_MASK) - -#define MRCC_MRCC_GLB_ACC1_CMP0_MASK (0x8U) -#define MRCC_MRCC_GLB_ACC1_CMP0_SHIFT (3U) -/*! CMP0 - CMP0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC1_CMP0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC1_CMP0_SHIFT)) & MRCC_MRCC_GLB_ACC1_CMP0_MASK) - -#define MRCC_MRCC_GLB_ACC1_CMP1_MASK (0x10U) -#define MRCC_MRCC_GLB_ACC1_CMP1_SHIFT (4U) -/*! CMP1 - CMP1 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC1_CMP1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC1_CMP1_SHIFT)) & MRCC_MRCC_GLB_ACC1_CMP1_MASK) - -#define MRCC_MRCC_GLB_ACC1_DAC0_MASK (0x20U) -#define MRCC_MRCC_GLB_ACC1_DAC0_SHIFT (5U) -/*! DAC0 - DAC0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC1_DAC0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC1_DAC0_SHIFT)) & MRCC_MRCC_GLB_ACC1_DAC0_MASK) - -#define MRCC_MRCC_GLB_ACC1_OPAMP0_MASK (0x40U) -#define MRCC_MRCC_GLB_ACC1_OPAMP0_SHIFT (6U) -/*! OPAMP0 - OPAMP0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC1_OPAMP0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC1_OPAMP0_SHIFT)) & MRCC_MRCC_GLB_ACC1_OPAMP0_MASK) - -#define MRCC_MRCC_GLB_ACC1_PORT0_MASK (0x80U) -#define MRCC_MRCC_GLB_ACC1_PORT0_SHIFT (7U) -/*! PORT0 - PORT0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC1_PORT0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC1_PORT0_SHIFT)) & MRCC_MRCC_GLB_ACC1_PORT0_MASK) - -#define MRCC_MRCC_GLB_ACC1_PORT1_MASK (0x100U) -#define MRCC_MRCC_GLB_ACC1_PORT1_SHIFT (8U) -/*! PORT1 - PORT1 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC1_PORT1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC1_PORT1_SHIFT)) & MRCC_MRCC_GLB_ACC1_PORT1_MASK) - -#define MRCC_MRCC_GLB_ACC1_PORT2_MASK (0x200U) -#define MRCC_MRCC_GLB_ACC1_PORT2_SHIFT (9U) -/*! PORT2 - PORT2 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC1_PORT2(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC1_PORT2_SHIFT)) & MRCC_MRCC_GLB_ACC1_PORT2_MASK) - -#define MRCC_MRCC_GLB_ACC1_PORT3_MASK (0x400U) -#define MRCC_MRCC_GLB_ACC1_PORT3_SHIFT (10U) -/*! PORT3 - PORT3 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC1_PORT3(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC1_PORT3_SHIFT)) & MRCC_MRCC_GLB_ACC1_PORT3_MASK) - -#define MRCC_MRCC_GLB_ACC1_PORT4_MASK (0x800U) -#define MRCC_MRCC_GLB_ACC1_PORT4_SHIFT (11U) -/*! PORT4 - PORT4 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC1_PORT4(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC1_PORT4_SHIFT)) & MRCC_MRCC_GLB_ACC1_PORT4_MASK) - -#define MRCC_MRCC_GLB_ACC1_FLEXCAN0_MASK (0x1000U) -#define MRCC_MRCC_GLB_ACC1_FLEXCAN0_SHIFT (12U) -/*! FLEXCAN0 - FLEXCAN0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC1_FLEXCAN0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC1_FLEXCAN0_SHIFT)) & MRCC_MRCC_GLB_ACC1_FLEXCAN0_MASK) - -#define MRCC_MRCC_GLB_ACC1_LPI2C2_MASK (0x2000U) -#define MRCC_MRCC_GLB_ACC1_LPI2C2_SHIFT (13U) -/*! LPI2C2 - LPI2C2 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC1_LPI2C2(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC1_LPI2C2_SHIFT)) & MRCC_MRCC_GLB_ACC1_LPI2C2_MASK) - -#define MRCC_MRCC_GLB_ACC1_LPI2C3_MASK (0x4000U) -#define MRCC_MRCC_GLB_ACC1_LPI2C3_SHIFT (14U) -/*! LPI2C3 - LPI2C3 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC1_LPI2C3(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC1_LPI2C3_SHIFT)) & MRCC_MRCC_GLB_ACC1_LPI2C3_MASK) - -#define MRCC_MRCC_GLB_ACC1_RAMA_MASK (0x40000U) -#define MRCC_MRCC_GLB_ACC1_RAMA_SHIFT (18U) -/*! RAMA - RAMA - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC1_RAMA(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC1_RAMA_SHIFT)) & MRCC_MRCC_GLB_ACC1_RAMA_MASK) - -#define MRCC_MRCC_GLB_ACC1_RAMB_MASK (0x80000U) -#define MRCC_MRCC_GLB_ACC1_RAMB_SHIFT (19U) -/*! RAMB - RAMB - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC1_RAMB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC1_RAMB_SHIFT)) & MRCC_MRCC_GLB_ACC1_RAMB_MASK) - -#define MRCC_MRCC_GLB_ACC1_GPIO0_MASK (0x100000U) -#define MRCC_MRCC_GLB_ACC1_GPIO0_SHIFT (20U) -/*! GPIO0 - GPIO0 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC1_GPIO0(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC1_GPIO0_SHIFT)) & MRCC_MRCC_GLB_ACC1_GPIO0_MASK) - -#define MRCC_MRCC_GLB_ACC1_GPIO1_MASK (0x200000U) -#define MRCC_MRCC_GLB_ACC1_GPIO1_SHIFT (21U) -/*! GPIO1 - GPIO1 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC1_GPIO1(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC1_GPIO1_SHIFT)) & MRCC_MRCC_GLB_ACC1_GPIO1_MASK) - -#define MRCC_MRCC_GLB_ACC1_GPIO2_MASK (0x400000U) -#define MRCC_MRCC_GLB_ACC1_GPIO2_SHIFT (22U) -/*! GPIO2 - GPIO2 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC1_GPIO2(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC1_GPIO2_SHIFT)) & MRCC_MRCC_GLB_ACC1_GPIO2_MASK) - -#define MRCC_MRCC_GLB_ACC1_GPIO3_MASK (0x800000U) -#define MRCC_MRCC_GLB_ACC1_GPIO3_SHIFT (23U) -/*! GPIO3 - GPIO3 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC1_GPIO3(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC1_GPIO3_SHIFT)) & MRCC_MRCC_GLB_ACC1_GPIO3_MASK) - -#define MRCC_MRCC_GLB_ACC1_GPIO4_MASK (0x1000000U) -#define MRCC_MRCC_GLB_ACC1_GPIO4_SHIFT (24U) -/*! GPIO4 - GPIO4 - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC1_GPIO4(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC1_GPIO4_SHIFT)) & MRCC_MRCC_GLB_ACC1_GPIO4_MASK) - -#define MRCC_MRCC_GLB_ACC1_ROMC_MASK (0x2000000U) -#define MRCC_MRCC_GLB_ACC1_ROMC_SHIFT (25U) -/*! ROMC - ROMC - * 0b0..Automatic clock gating is disabled - * 0b1..Automatic clock gating is enabled - */ -#define MRCC_MRCC_GLB_ACC1_ROMC(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_GLB_ACC1_ROMC_SHIFT)) & MRCC_MRCC_GLB_ACC1_ROMC_MASK) -/*! @} */ - -/*! @name MRCC_I3C0_FCLK_CLKSEL - I3C0_FCLK clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_I3C0_FCLK_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_I3C0_FCLK_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b111..Reserved(NO Clock) - * 0b101..CLK_1M - * 0b011..CLK_IN - * 0b010..FRO_HF_DIV - * 0b000..FRO_12M - */ -#define MRCC_MRCC_I3C0_FCLK_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_I3C0_FCLK_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_I3C0_FCLK_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_I3C0_FCLK_CLKDIV - I3C0_FCLK clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_I3C0_FCLK_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_I3C0_FCLK_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_I3C0_FCLK_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_I3C0_FCLK_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_I3C0_FCLK_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_I3C0_FCLK_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_I3C0_FCLK_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_I3C0_FCLK_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_I3C0_FCLK_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_I3C0_FCLK_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_I3C0_FCLK_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_I3C0_FCLK_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_I3C0_FCLK_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_I3C0_FCLK_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_I3C0_FCLK_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_I3C0_FCLK_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_I3C0_FCLK_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_I3C0_FCLK_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_I3C0_FCLK_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_I3C0_FCLK_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_CTIMER0_CLKSEL - CTIMER0 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_CTIMER0_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_CTIMER0_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b111..Reserved(NO Clock) - * 0b101..CLK_1M - * 0b100..CLK_16K - * 0b011..CLK_IN - * 0b001..FRO_HF_GATED - * 0b000..FRO_12M - */ -#define MRCC_MRCC_CTIMER0_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER0_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_CTIMER0_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_CTIMER0_CLKDIV - CTIMER0 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_CTIMER0_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_CTIMER0_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_CTIMER0_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER0_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_CTIMER0_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_CTIMER0_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_CTIMER0_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_CTIMER0_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER0_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_CTIMER0_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_CTIMER0_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_CTIMER0_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_CTIMER0_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER0_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_CTIMER0_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_CTIMER0_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_CTIMER0_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_CTIMER0_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER0_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_CTIMER0_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_CTIMER1_CLKSEL - CTIMER1 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_CTIMER1_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_CTIMER1_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b111..Reserved(NO Clock) - * 0b101..CLK_1M - * 0b100..CLK_16K - * 0b011..CLK_IN - * 0b001..FRO_HF_GATED - * 0b000..FRO_12M - */ -#define MRCC_MRCC_CTIMER1_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER1_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_CTIMER1_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_CTIMER1_CLKDIV - CTIMER1 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_CTIMER1_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_CTIMER1_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_CTIMER1_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER1_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_CTIMER1_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_CTIMER1_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_CTIMER1_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_CTIMER1_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER1_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_CTIMER1_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_CTIMER1_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_CTIMER1_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_CTIMER1_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER1_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_CTIMER1_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_CTIMER1_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_CTIMER1_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_CTIMER1_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER1_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_CTIMER1_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_CTIMER2_CLKSEL - CTIMER2 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_CTIMER2_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_CTIMER2_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b111..Reserved(NO Clock) - * 0b101..CLK_1M - * 0b100..CLK_16K - * 0b011..CLK_IN - * 0b001..FRO_HF_GATED - * 0b000..FRO_12M - */ -#define MRCC_MRCC_CTIMER2_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER2_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_CTIMER2_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_CTIMER2_CLKDIV - CTIMER2 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_CTIMER2_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_CTIMER2_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_CTIMER2_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER2_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_CTIMER2_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_CTIMER2_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_CTIMER2_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_CTIMER2_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER2_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_CTIMER2_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_CTIMER2_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_CTIMER2_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_CTIMER2_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER2_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_CTIMER2_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_CTIMER2_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_CTIMER2_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_CTIMER2_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER2_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_CTIMER2_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_CTIMER3_CLKSEL - CTIMER3 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_CTIMER3_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_CTIMER3_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b111..Reserved(NO Clock) - * 0b101..CLK_1M - * 0b100..CLK_16K - * 0b011..CLK_IN - * 0b001..FRO_HF_GATED - * 0b000..FRO_12M - */ -#define MRCC_MRCC_CTIMER3_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER3_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_CTIMER3_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_CTIMER3_CLKDIV - CTIMER3 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_CTIMER3_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_CTIMER3_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_CTIMER3_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER3_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_CTIMER3_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_CTIMER3_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_CTIMER3_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_CTIMER3_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER3_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_CTIMER3_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_CTIMER3_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_CTIMER3_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_CTIMER3_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER3_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_CTIMER3_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_CTIMER3_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_CTIMER3_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_CTIMER3_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER3_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_CTIMER3_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_CTIMER4_CLKSEL - CTIMER4 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_CTIMER4_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_CTIMER4_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b111..Reserved(NO Clock) - * 0b101..CLK_1M - * 0b100..CLK_16K - * 0b011..CLK_IN - * 0b001..FRO_HF_GATED - * 0b000..FRO_12M - */ -#define MRCC_MRCC_CTIMER4_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER4_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_CTIMER4_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_CTIMER4_CLKDIV - CTIMER4 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_CTIMER4_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_CTIMER4_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_CTIMER4_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER4_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_CTIMER4_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_CTIMER4_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_CTIMER4_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_CTIMER4_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER4_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_CTIMER4_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_CTIMER4_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_CTIMER4_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_CTIMER4_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER4_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_CTIMER4_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_CTIMER4_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_CTIMER4_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_CTIMER4_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CTIMER4_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_CTIMER4_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_WWDT0_CLKDIV - WWDT0 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_WWDT0_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_WWDT0_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_WWDT0_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_WWDT0_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_WWDT0_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_WWDT0_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_WWDT0_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_WWDT0_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_WWDT0_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_WWDT0_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_WWDT0_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_WWDT0_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_WWDT0_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_WWDT0_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_WWDT0_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_WWDT0_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_WWDT0_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_WWDT0_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_WWDT0_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_WWDT0_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_FLEXIO0_CLKSEL - FLEXIO0 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_FLEXIO0_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_FLEXIO0_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b111..Reserved(NO Clock) - * 0b101..CLK_1M - * 0b011..CLK_IN - * 0b001..FRO_HF_GATED - * 0b000..FRO_12M - */ -#define MRCC_MRCC_FLEXIO0_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_FLEXIO0_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_FLEXIO0_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_FLEXIO0_CLKDIV - FLEXIO0 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_FLEXIO0_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_FLEXIO0_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_FLEXIO0_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_FLEXIO0_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_FLEXIO0_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_FLEXIO0_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_FLEXIO0_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_FLEXIO0_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_FLEXIO0_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_FLEXIO0_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_FLEXIO0_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_FLEXIO0_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_FLEXIO0_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_FLEXIO0_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_FLEXIO0_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_FLEXIO0_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_FLEXIO0_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_FLEXIO0_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_FLEXIO0_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_FLEXIO0_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_LPI2C0_CLKSEL - LPI2C0 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_LPI2C0_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_LPI2C0_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b111..Reserved(NO Clock) - * 0b101..CLK_1M - * 0b011..CLK_IN - * 0b010..FRO_HF_DIV - * 0b000..FRO_12M - */ -#define MRCC_MRCC_LPI2C0_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPI2C0_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_LPI2C0_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_LPI2C0_CLKDIV - LPI2C0 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_LPI2C0_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_LPI2C0_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_LPI2C0_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPI2C0_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_LPI2C0_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_LPI2C0_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_LPI2C0_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_LPI2C0_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPI2C0_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_LPI2C0_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_LPI2C0_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_LPI2C0_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_LPI2C0_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPI2C0_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_LPI2C0_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_LPI2C0_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_LPI2C0_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_LPI2C0_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPI2C0_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_LPI2C0_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_LPI2C1_CLKSEL - LPI2C1 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_LPI2C1_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_LPI2C1_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b111..Reserved(NO Clock) - * 0b101..CLK_1M - * 0b011..CLK_IN - * 0b010..FRO_HF_DIV - * 0b000..FRO_12M - */ -#define MRCC_MRCC_LPI2C1_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPI2C1_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_LPI2C1_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_LPI2C1_CLKDIV - LPI2C1 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_LPI2C1_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_LPI2C1_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_LPI2C1_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPI2C1_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_LPI2C1_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_LPI2C1_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_LPI2C1_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_LPI2C1_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPI2C1_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_LPI2C1_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_LPI2C1_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_LPI2C1_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_LPI2C1_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPI2C1_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_LPI2C1_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_LPI2C1_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_LPI2C1_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_LPI2C1_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPI2C1_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_LPI2C1_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_LPSPI0_CLKSEL - LPSPI0 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_LPSPI0_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_LPSPI0_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b111..Reserved(NO Clock) - * 0b101..CLK_1M - * 0b011..CLK_IN - * 0b010..FRO_HF_DIV - * 0b000..FRO_12M - */ -#define MRCC_MRCC_LPSPI0_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPSPI0_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_LPSPI0_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_LPSPI0_CLKDIV - LPSPI0 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_LPSPI0_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_LPSPI0_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_LPSPI0_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPSPI0_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_LPSPI0_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_LPSPI0_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_LPSPI0_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_LPSPI0_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPSPI0_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_LPSPI0_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_LPSPI0_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_LPSPI0_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_LPSPI0_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPSPI0_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_LPSPI0_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_LPSPI0_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_LPSPI0_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_LPSPI0_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPSPI0_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_LPSPI0_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_LPSPI1_CLKSEL - LPSPI1 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_LPSPI1_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_LPSPI1_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b111..Reserved(NO Clock) - * 0b101..CLK_1M - * 0b011..CLK_IN - * 0b010..FRO_HF_DIV - * 0b000..FRO_12M - */ -#define MRCC_MRCC_LPSPI1_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPSPI1_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_LPSPI1_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_LPSPI1_CLKDIV - LPSPI1 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_LPSPI1_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_LPSPI1_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_LPSPI1_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPSPI1_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_LPSPI1_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_LPSPI1_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_LPSPI1_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_LPSPI1_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPSPI1_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_LPSPI1_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_LPSPI1_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_LPSPI1_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_LPSPI1_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPSPI1_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_LPSPI1_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_LPSPI1_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_LPSPI1_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_LPSPI1_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPSPI1_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_LPSPI1_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_LPUART0_CLKSEL - LPUART0 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_LPUART0_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_LPUART0_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b111..Reserved(NO Clock) - * 0b101..CLK_1M - * 0b100..CLK_16K - * 0b011..CLK_IN - * 0b010..FRO_HF_DIV - * 0b000..FRO_12M - */ -#define MRCC_MRCC_LPUART0_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART0_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_LPUART0_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_LPUART0_CLKDIV - LPUART0 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_LPUART0_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_LPUART0_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_LPUART0_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART0_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_LPUART0_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_LPUART0_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_LPUART0_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_LPUART0_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART0_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_LPUART0_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_LPUART0_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_LPUART0_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_LPUART0_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART0_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_LPUART0_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_LPUART0_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_LPUART0_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_LPUART0_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART0_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_LPUART0_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_LPUART1_CLKSEL - LPUART1 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_LPUART1_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_LPUART1_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b111..Reserved(NO Clock) - * 0b101..CLK_1M - * 0b100..CLK_16K - * 0b011..CLK_IN - * 0b010..FRO_HF_DIV - * 0b000..FRO_12M - */ -#define MRCC_MRCC_LPUART1_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART1_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_LPUART1_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_LPUART1_CLKDIV - LPUART1 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_LPUART1_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_LPUART1_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_LPUART1_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART1_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_LPUART1_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_LPUART1_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_LPUART1_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_LPUART1_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART1_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_LPUART1_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_LPUART1_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_LPUART1_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_LPUART1_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART1_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_LPUART1_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_LPUART1_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_LPUART1_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_LPUART1_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART1_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_LPUART1_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_LPUART2_CLKSEL - LPUART2 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_LPUART2_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_LPUART2_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b111..Reserved(NO Clock) - * 0b101..CLK_1M - * 0b100..CLK_16K - * 0b011..CLK_IN - * 0b010..FRO_HF_DIV - * 0b000..FRO_12M - */ -#define MRCC_MRCC_LPUART2_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART2_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_LPUART2_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_LPUART2_CLKDIV - LPUART2 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_LPUART2_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_LPUART2_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_LPUART2_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART2_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_LPUART2_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_LPUART2_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_LPUART2_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_LPUART2_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART2_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_LPUART2_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_LPUART2_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_LPUART2_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_LPUART2_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART2_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_LPUART2_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_LPUART2_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_LPUART2_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_LPUART2_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART2_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_LPUART2_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_LPUART3_CLKSEL - LPUART3 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_LPUART3_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_LPUART3_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b111..Reserved(NO Clock) - * 0b101..CLK_1M - * 0b100..CLK_16K - * 0b011..CLK_IN - * 0b010..FRO_HF_DIV - * 0b000..FRO_12M - */ -#define MRCC_MRCC_LPUART3_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART3_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_LPUART3_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_LPUART3_CLKDIV - LPUART3 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_LPUART3_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_LPUART3_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_LPUART3_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART3_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_LPUART3_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_LPUART3_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_LPUART3_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_LPUART3_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART3_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_LPUART3_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_LPUART3_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_LPUART3_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_LPUART3_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART3_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_LPUART3_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_LPUART3_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_LPUART3_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_LPUART3_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART3_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_LPUART3_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_LPUART4_CLKSEL - LPUART4 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_LPUART4_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_LPUART4_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b111..Reserved(NO Clock) - * 0b101..CLK_1M - * 0b100..CLK_16K - * 0b011..CLK_IN - * 0b010..FRO_HF_DIV - * 0b000..FRO_12M - */ -#define MRCC_MRCC_LPUART4_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART4_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_LPUART4_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_LPUART4_CLKDIV - LPUART4 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_LPUART4_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_LPUART4_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_LPUART4_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART4_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_LPUART4_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_LPUART4_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_LPUART4_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_LPUART4_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART4_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_LPUART4_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_LPUART4_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_LPUART4_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_LPUART4_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART4_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_LPUART4_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_LPUART4_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_LPUART4_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_LPUART4_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPUART4_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_LPUART4_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_USB0_CLKSEL - USB0 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_USB0_CLKSEL_MUX_MASK (0x3U) -#define MRCC_MRCC_USB0_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b11..Reserved(NO Clock) - * 0b10..CLK_IN - * 0b01..CLK_48M - */ -#define MRCC_MRCC_USB0_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_USB0_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_USB0_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_LPTMR0_CLKSEL - LPTMR0 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_LPTMR0_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_LPTMR0_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b111..Reserved(NO Clock) - * 0b101..CLK_1M - * 0b011..CLK_IN - * 0b010..FRO_HF_DIV - * 0b000..FRO_12M - */ -#define MRCC_MRCC_LPTMR0_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPTMR0_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_LPTMR0_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_LPTMR0_CLKDIV - LPTMR0 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_LPTMR0_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_LPTMR0_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_LPTMR0_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPTMR0_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_LPTMR0_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_LPTMR0_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_LPTMR0_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_LPTMR0_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPTMR0_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_LPTMR0_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_LPTMR0_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_LPTMR0_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_LPTMR0_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPTMR0_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_LPTMR0_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_LPTMR0_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_LPTMR0_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_LPTMR0_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPTMR0_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_LPTMR0_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_OSTIMER0_CLKSEL - OSTIMER0 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_OSTIMER0_CLKSEL_MUX_MASK (0x3U) -#define MRCC_MRCC_OSTIMER0_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b11..Reserved2(NO Clock) - * 0b10..CLK_1M - * 0b00..CLK_16K - */ -#define MRCC_MRCC_OSTIMER0_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_OSTIMER0_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_OSTIMER0_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_ADC0_CLKSEL - ADC0 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_ADC0_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_ADC0_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b111..Reserved(NO Clock) - * 0b101..CLK_1M - * 0b011..CLK_IN - * 0b001..FRO_HF_GATED - * 0b000..FRO_12M - */ -#define MRCC_MRCC_ADC0_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_ADC0_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_ADC0_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_ADC0_CLKDIV - ADC0 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_ADC0_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_ADC0_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_ADC0_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_ADC0_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_ADC0_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_ADC0_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_ADC0_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_ADC0_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_ADC0_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_ADC0_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_ADC0_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_ADC0_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_ADC0_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_ADC0_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_ADC0_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_ADC0_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_ADC0_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_ADC0_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_ADC0_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_ADC0_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_ADC1_CLKSEL - ADC1 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_ADC1_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_ADC1_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b111..Reserved(NO Clock) - * 0b101..CLK_1M - * 0b011..CLK_IN - * 0b001..FRO_HF_GATED - * 0b000..FRO_12M - */ -#define MRCC_MRCC_ADC1_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_ADC1_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_ADC1_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_ADC1_CLKDIV - ADC1 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_ADC1_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_ADC1_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_ADC1_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_ADC1_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_ADC1_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_ADC1_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_ADC1_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_ADC1_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_ADC1_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_ADC1_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_ADC1_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_ADC1_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_ADC1_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_ADC1_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_ADC1_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_ADC1_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_ADC1_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_ADC1_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_ADC1_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_ADC1_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_CMP0_FUNC_CLKDIV - CMP0_FUNC clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_CMP0_FUNC_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_CMP0_FUNC_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_CMP0_FUNC_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP0_FUNC_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_CMP0_FUNC_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_CMP0_FUNC_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_CMP0_FUNC_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_CMP0_FUNC_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP0_FUNC_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_CMP0_FUNC_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_CMP0_FUNC_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_CMP0_FUNC_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_CMP0_FUNC_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP0_FUNC_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_CMP0_FUNC_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_CMP0_FUNC_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_CMP0_FUNC_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_CMP0_FUNC_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP0_FUNC_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_CMP0_FUNC_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_CMP0_RR_CLKSEL - CMP0_RR clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_CMP0_RR_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_CMP0_RR_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b111..Reserved(NO Clock) - * 0b101..CLK_1M - * 0b011..CLK_IN - * 0b010..FRO_HF_DIV - * 0b000..FRO_12M - */ -#define MRCC_MRCC_CMP0_RR_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP0_RR_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_CMP0_RR_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_CMP0_RR_CLKDIV - CMP0_RR clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_CMP0_RR_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_CMP0_RR_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_CMP0_RR_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP0_RR_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_CMP0_RR_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_CMP0_RR_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_CMP0_RR_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_CMP0_RR_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP0_RR_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_CMP0_RR_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_CMP0_RR_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_CMP0_RR_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_CMP0_RR_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP0_RR_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_CMP0_RR_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_CMP0_RR_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_CMP0_RR_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_CMP0_RR_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP0_RR_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_CMP0_RR_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_CMP1_FUNC_CLKDIV - CMP1_FUNC clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_CMP1_FUNC_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_CMP1_FUNC_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_CMP1_FUNC_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP1_FUNC_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_CMP1_FUNC_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_CMP1_FUNC_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_CMP1_FUNC_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_CMP1_FUNC_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP1_FUNC_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_CMP1_FUNC_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_CMP1_FUNC_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_CMP1_FUNC_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_CMP1_FUNC_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP1_FUNC_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_CMP1_FUNC_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_CMP1_FUNC_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_CMP1_FUNC_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_CMP1_FUNC_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP1_FUNC_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_CMP1_FUNC_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_CMP1_RR_CLKSEL - CMP1_RR clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_CMP1_RR_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_CMP1_RR_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b111..Reserved(NO Clock) - * 0b101..CLK_1M - * 0b011..CLK_IN - * 0b010..FRO_HF_DIV - * 0b000..FRO_12M - */ -#define MRCC_MRCC_CMP1_RR_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP1_RR_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_CMP1_RR_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_CMP1_RR_CLKDIV - CMP1_RR clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_CMP1_RR_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_CMP1_RR_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_CMP1_RR_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP1_RR_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_CMP1_RR_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_CMP1_RR_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_CMP1_RR_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_CMP1_RR_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP1_RR_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_CMP1_RR_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_CMP1_RR_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_CMP1_RR_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_CMP1_RR_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP1_RR_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_CMP1_RR_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_CMP1_RR_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_CMP1_RR_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_CMP1_RR_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CMP1_RR_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_CMP1_RR_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_DAC0_CLKSEL - DAC0 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_DAC0_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_DAC0_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b111..Reserved(NO Clock) - * 0b101..CLK_1M - * 0b011..CLK_IN - * 0b010..FRO_HF_DIV - * 0b000..FRO_12M - */ -#define MRCC_MRCC_DAC0_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_DAC0_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_DAC0_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_DAC0_CLKDIV - DAC0 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_DAC0_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_DAC0_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_DAC0_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_DAC0_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_DAC0_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_DAC0_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_DAC0_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_DAC0_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_DAC0_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_DAC0_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_DAC0_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_DAC0_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_DAC0_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_DAC0_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_DAC0_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_DAC0_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_DAC0_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_DAC0_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_DAC0_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_DAC0_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_FLEXCAN0_CLKSEL - FLEXCAN0 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_FLEXCAN0_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_FLEXCAN0_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b111..Reserved(NO Clock) - * 0b011..CLK_IN - * 0b010..FRO_HF_DIV - */ -#define MRCC_MRCC_FLEXCAN0_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_FLEXCAN0_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_FLEXCAN0_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_FLEXCAN0_CLKDIV - FLEXCAN0 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_FLEXCAN0_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_FLEXCAN0_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_FLEXCAN0_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_FLEXCAN0_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_FLEXCAN0_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_FLEXCAN0_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_FLEXCAN0_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_FLEXCAN0_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_FLEXCAN0_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_FLEXCAN0_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_FLEXCAN0_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_FLEXCAN0_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_FLEXCAN0_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_FLEXCAN0_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_FLEXCAN0_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_FLEXCAN0_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_FLEXCAN0_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_FLEXCAN0_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_FLEXCAN0_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_FLEXCAN0_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_LPI2C2_CLKSEL - LPI2C2 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_LPI2C2_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_LPI2C2_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b111..Reserved(NO Clock) - * 0b101..CLK_1M - * 0b011..CLK_IN - * 0b010..FRO_HF_DIV - * 0b000..FRO_12M - */ -#define MRCC_MRCC_LPI2C2_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPI2C2_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_LPI2C2_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_LPI2C2_CLKDIV - LPI2C2 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_LPI2C2_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_LPI2C2_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_LPI2C2_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPI2C2_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_LPI2C2_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_LPI2C2_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_LPI2C2_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_LPI2C2_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPI2C2_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_LPI2C2_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_LPI2C2_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_LPI2C2_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_LPI2C2_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPI2C2_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_LPI2C2_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_LPI2C2_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_LPI2C2_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_LPI2C2_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPI2C2_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_LPI2C2_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_LPI2C3_CLKSEL - LPI2C3 clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_LPI2C3_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_LPI2C3_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b111..Reserved(NO Clock) - * 0b101..CLK_1M - * 0b011..CLK_IN - * 0b010..FRO_HF_DIV - * 0b000..FRO_12M - */ -#define MRCC_MRCC_LPI2C3_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPI2C3_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_LPI2C3_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_LPI2C3_CLKDIV - LPI2C3 clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_LPI2C3_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_LPI2C3_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_LPI2C3_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPI2C3_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_LPI2C3_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_LPI2C3_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_LPI2C3_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_LPI2C3_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPI2C3_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_LPI2C3_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_LPI2C3_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_LPI2C3_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_LPI2C3_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPI2C3_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_LPI2C3_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_LPI2C3_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_LPI2C3_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_LPI2C3_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_LPI2C3_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_LPI2C3_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_DBG_TRACE_CLKSEL - DBG_TRACE clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_DBG_TRACE_CLKSEL_MUX_MASK (0x3U) -#define MRCC_MRCC_DBG_TRACE_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b11..Reserved1(NO Clock) - * 0b10..CLK_16K - * 0b01..CLK_1M - * 0b00..CPU_CLK - */ -#define MRCC_MRCC_DBG_TRACE_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_DBG_TRACE_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_DBG_TRACE_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_DBG_TRACE_CLKDIV - DBG_TRACE clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_DBG_TRACE_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_DBG_TRACE_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_DBG_TRACE_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_DBG_TRACE_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_DBG_TRACE_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_DBG_TRACE_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_DBG_TRACE_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_DBG_TRACE_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_DBG_TRACE_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_DBG_TRACE_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_DBG_TRACE_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_DBG_TRACE_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_DBG_TRACE_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_DBG_TRACE_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_DBG_TRACE_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_DBG_TRACE_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_DBG_TRACE_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_DBG_TRACE_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_DBG_TRACE_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_DBG_TRACE_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_CLKOUT_CLKSEL - CLKOUT clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_CLKOUT_CLKSEL_MUX_MASK (0x7U) -#define MRCC_MRCC_CLKOUT_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b111..Reserved(NO Clock) - * 0b110..SLOW_CLK - * 0b011..CLK_16K - * 0b010..CLK_IN - * 0b001..FRO_HF_DIV - * 0b000..FRO_12M - */ -#define MRCC_MRCC_CLKOUT_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CLKOUT_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_CLKOUT_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_CLKOUT_CLKDIV - CLKOUT clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_CLKOUT_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_CLKOUT_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_CLKOUT_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CLKOUT_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_CLKOUT_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_CLKOUT_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_CLKOUT_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_CLKOUT_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CLKOUT_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_CLKOUT_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_CLKOUT_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_CLKOUT_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_CLKOUT_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CLKOUT_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_CLKOUT_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_CLKOUT_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_CLKOUT_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_CLKOUT_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_CLKOUT_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_CLKOUT_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_SYSTICK_CLKSEL - SYSTICK clock selection control */ -/*! @{ */ - -#define MRCC_MRCC_SYSTICK_CLKSEL_MUX_MASK (0x3U) -#define MRCC_MRCC_SYSTICK_CLKSEL_MUX_SHIFT (0U) -/*! MUX - Functional Clock Mux Select - * 0b11..Reserved1(NO Clock) - * 0b10..CLK_16K - * 0b01..CLK_1M - * 0b00..CPU_CLK - */ -#define MRCC_MRCC_SYSTICK_CLKSEL_MUX(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_SYSTICK_CLKSEL_MUX_SHIFT)) & MRCC_MRCC_SYSTICK_CLKSEL_MUX_MASK) -/*! @} */ - -/*! @name MRCC_SYSTICK_CLKDIV - SYSTICK clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_SYSTICK_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_SYSTICK_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_SYSTICK_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_SYSTICK_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_SYSTICK_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_SYSTICK_CLKDIV_RESET_MASK (0x20000000U) -#define MRCC_MRCC_SYSTICK_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Reset divider counter - * 0b0..Divider isn't reset - * 0b1..Divider is reset - */ -#define MRCC_MRCC_SYSTICK_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_SYSTICK_CLKDIV_RESET_SHIFT)) & MRCC_MRCC_SYSTICK_CLKDIV_RESET_MASK) - -#define MRCC_MRCC_SYSTICK_CLKDIV_HALT_MASK (0x40000000U) -#define MRCC_MRCC_SYSTICK_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halt divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock is stopped - */ -#define MRCC_MRCC_SYSTICK_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_SYSTICK_CLKDIV_HALT_SHIFT)) & MRCC_MRCC_SYSTICK_CLKDIV_HALT_MASK) - -#define MRCC_MRCC_SYSTICK_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_SYSTICK_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_SYSTICK_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_SYSTICK_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_SYSTICK_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MRCC_FRO_HF_DIV_CLKDIV - FRO_HF_DIV clock divider control */ -/*! @{ */ - -#define MRCC_MRCC_FRO_HF_DIV_CLKDIV_DIV_MASK (0xFU) -#define MRCC_MRCC_FRO_HF_DIV_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Functional Clock Divider */ -#define MRCC_MRCC_FRO_HF_DIV_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_FRO_HF_DIV_CLKDIV_DIV_SHIFT)) & MRCC_MRCC_FRO_HF_DIV_CLKDIV_DIV_MASK) - -#define MRCC_MRCC_FRO_HF_DIV_CLKDIV_UNSTAB_MASK (0x80000000U) -#define MRCC_MRCC_FRO_HF_DIV_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Divider clock is stable - * 0b1..Clock frequency isn't stable - */ -#define MRCC_MRCC_FRO_HF_DIV_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << MRCC_MRCC_FRO_HF_DIV_CLKDIV_UNSTAB_SHIFT)) & MRCC_MRCC_FRO_HF_DIV_CLKDIV_UNSTAB_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group MRCC_Register_Masks */ - - -/* MRCC - Peripheral instance base addresses */ -/** Peripheral MRCC0 base address */ -#define MRCC0_BASE (0x40091000u) -/** Peripheral MRCC0 base pointer */ -#define MRCC0 ((MRCC_Type *)MRCC0_BASE) -/** Array initializer of MRCC peripheral base addresses */ -#define MRCC_BASE_ADDRS { MRCC0_BASE } -/** Array initializer of MRCC peripheral base pointers */ -#define MRCC_BASE_PTRS { MRCC0 } - -/*! - * @} - */ /* end of group MRCC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- OPAMP Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup OPAMP_Peripheral_Access_Layer OPAMP Peripheral Access Layer - * @{ - */ - -/** OPAMP - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - __IO uint32_t OPAMP_CTR; /**< OPAMP Control, offset: 0x8 */ -} OPAMP_Type; - -/* ---------------------------------------------------------------------------- - -- OPAMP Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup OPAMP_Register_Masks OPAMP Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define OPAMP_VERID_FEATURE_MASK (0xFFFFU) -#define OPAMP_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number */ -#define OPAMP_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_VERID_FEATURE_SHIFT)) & OPAMP_VERID_FEATURE_MASK) - -#define OPAMP_VERID_MINOR_MASK (0xFF0000U) -#define OPAMP_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define OPAMP_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_VERID_MINOR_SHIFT)) & OPAMP_VERID_MINOR_MASK) - -#define OPAMP_VERID_MAJOR_MASK (0xFF000000U) -#define OPAMP_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define OPAMP_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_VERID_MAJOR_SHIFT)) & OPAMP_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define OPAMP_PARAM_PGA_FUNCTION_MASK (0x1U) -#define OPAMP_PARAM_PGA_FUNCTION_SHIFT (0U) -/*! PGA_FUNCTION - PGA Function Option - * 0b0..Core amplifier enabled - * 0b1..PGA function enabled - */ -#define OPAMP_PARAM_PGA_FUNCTION(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_PARAM_PGA_FUNCTION_SHIFT)) & OPAMP_PARAM_PGA_FUNCTION_MASK) -/*! @} */ - -/*! @name OPAMP_CTR - OPAMP Control */ -/*! @{ */ - -#define OPAMP_OPAMP_CTR_EN_MASK (0x1U) -#define OPAMP_OPAMP_CTR_EN_SHIFT (0U) -/*! EN - OPAMP Enable - * 0b0..Disable - * 0b1..Enable - */ -#define OPAMP_OPAMP_CTR_EN(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_EN_SHIFT)) & OPAMP_OPAMP_CTR_EN_MASK) - -#define OPAMP_OPAMP_CTR_MODE_MASK (0x2U) -#define OPAMP_OPAMP_CTR_MODE_SHIFT (1U) -/*! MODE - Mode Selection - * 0b0..High performance mode - * 0b1..Low power mode - */ -#define OPAMP_OPAMP_CTR_MODE(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_MODE_SHIFT)) & OPAMP_OPAMP_CTR_MODE_MASK) - -#define OPAMP_OPAMP_CTR_BIASC_MASK (0xCU) -#define OPAMP_OPAMP_CTR_BIASC_SHIFT (2U) -/*! BIASC - Bias Current Trim Selection - * 0b00..Default - * 0b01..Increase current - * 0b10..Decrease current - * 0b11..Further decrease current - */ -#define OPAMP_OPAMP_CTR_BIASC(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_BIASC_SHIFT)) & OPAMP_OPAMP_CTR_BIASC_MASK) - -#define OPAMP_OPAMP_CTR_INTREF_MASK (0x30U) -#define OPAMP_OPAMP_CTR_INTREF_SHIFT (4U) -/*! INTREF - Provide OPAMP rail to rail voltage selection - * 0b00..Select OPAMP input rail to rail voltage from 0 to VDD_ANA - * 0b01..Select OPAMP input rail to rail voltage from 0 to VDD_ANA-0.8V - * 0b10..Select OPAMP input rail to rail voltage from 0.8V to VDD_ANA - * 0b11..Not allowed - */ -#define OPAMP_OPAMP_CTR_INTREF(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_INTREF_SHIFT)) & OPAMP_OPAMP_CTR_INTREF_MASK) - -#define OPAMP_OPAMP_CTR_TRIGMD_MASK (0x100U) -#define OPAMP_OPAMP_CTR_TRIGMD_SHIFT (8U) -/*! TRIGMD - Trigger Mode - * 0b0..Disable - * 0b1..Enable - */ -#define OPAMP_OPAMP_CTR_TRIGMD(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_TRIGMD_SHIFT)) & OPAMP_OPAMP_CTR_TRIGMD_MASK) - -#define OPAMP_OPAMP_CTR_INPSEL_MASK (0x200U) -#define OPAMP_OPAMP_CTR_INPSEL_SHIFT (9U) -/*! INPSEL - Positive Input Channel Selection - * 0b0..When OPAMP is not in trigger mode, select positive input 0 (INP0) - * 0b1..When OPAMP is not in trigger mode, select positive input 1 (INP1) - */ -#define OPAMP_OPAMP_CTR_INPSEL(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_INPSEL_SHIFT)) & OPAMP_OPAMP_CTR_INPSEL_MASK) - -#define OPAMP_OPAMP_CTR_INPF_MASK (0x1000U) -#define OPAMP_OPAMP_CTR_INPF_SHIFT (12U) -/*! INPF - Positive Input Connection Status - * 0b0..Positive input 0 (INP0) - * 0b1..Positive input 1 (INP1) - */ -#define OPAMP_OPAMP_CTR_INPF(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_INPF_SHIFT)) & OPAMP_OPAMP_CTR_INPF_MASK) - -#define OPAMP_OPAMP_CTR_BUFEN_MASK (0x10000U) -#define OPAMP_OPAMP_CTR_BUFEN_SHIFT (16U) -/*! BUFEN - Reference Buffer - * 0b0..Disables - * 0b1..Enables - */ -#define OPAMP_OPAMP_CTR_BUFEN(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_BUFEN_SHIFT)) & OPAMP_OPAMP_CTR_BUFEN_MASK) - -#define OPAMP_OPAMP_CTR_PREF_MASK (0x60000U) -#define OPAMP_OPAMP_CTR_PREF_SHIFT (17U) -/*! PREF - Positive Reference Voltage Selection - * 0b00..Input 0 - * 0b01..Input 1 - * 0b10..Input 2 - * 0b11..Input 3 - */ -#define OPAMP_OPAMP_CTR_PREF(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_PREF_SHIFT)) & OPAMP_OPAMP_CTR_PREF_MASK) - -#define OPAMP_OPAMP_CTR_ADCSW1_MASK (0x100000U) -#define OPAMP_OPAMP_CTR_ADCSW1_SHIFT (20U) -/*! ADCSW1 - Measure Switch 1 - * 0b0..Measure negative gain resistor ladder voltage switch off - * 0b1..Measure negative gain resistor ladder voltage switch on - */ -#define OPAMP_OPAMP_CTR_ADCSW1(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_ADCSW1_SHIFT)) & OPAMP_OPAMP_CTR_ADCSW1_MASK) - -#define OPAMP_OPAMP_CTR_ADCSW2_MASK (0x200000U) -#define OPAMP_OPAMP_CTR_ADCSW2_SHIFT (21U) -/*! ADCSW2 - Measure Switch 2 - * 0b0..Measure positive gain resistor ladder reference voltage switch off - * 0b1..Measure positive gain resistor ladder reference voltage switch on - */ -#define OPAMP_OPAMP_CTR_ADCSW2(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_ADCSW2_SHIFT)) & OPAMP_OPAMP_CTR_ADCSW2_MASK) - -#define OPAMP_OPAMP_CTR_OUTSW_MASK (0x400000U) -#define OPAMP_OPAMP_CTR_OUTSW_SHIFT (22U) -/*! OUTSW - Output Switch - * 0b0..OPAMP out to negative gain resistor ladder switch off - * 0b1..OPAMP out to negative gain resistor ladder switch on - */ -#define OPAMP_OPAMP_CTR_OUTSW(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_OUTSW_SHIFT)) & OPAMP_OPAMP_CTR_OUTSW_MASK) - -#define OPAMP_OPAMP_CTR_PGAIN_MASK (0x7000000U) -#define OPAMP_OPAMP_CTR_PGAIN_SHIFT (24U) -/*! PGAIN - Positive PGA Selection - * 0b000..Positive input 1 (INP1) - * 0b001..Pgain=1 - * 0b010..Pgain=2 - * 0b011..Pgain=4 - * 0b100..Pgain=8 - * 0b101..Pgain=16 - * 0b110..Pgain=33 - * 0b111..Pgain=64 - */ -#define OPAMP_OPAMP_CTR_PGAIN(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_PGAIN_SHIFT)) & OPAMP_OPAMP_CTR_PGAIN_MASK) - -#define OPAMP_OPAMP_CTR_NGAIN_MASK (0x70000000U) -#define OPAMP_OPAMP_CTR_NGAIN_SHIFT (28U) -/*! NGAIN - Negative PGA Selection - * 0b000..Buffer - * 0b001..Ngain=1 - * 0b010..Ngain=2 - * 0b011..Ngain=4 - * 0b100..Ngain=8 - * 0b101..Ngain=16 - * 0b110..Ngain=33 - * 0b111..Ngain=64 - */ -#define OPAMP_OPAMP_CTR_NGAIN(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_NGAIN_SHIFT)) & OPAMP_OPAMP_CTR_NGAIN_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group OPAMP_Register_Masks */ - - -/* OPAMP - Peripheral instance base addresses */ -/** Peripheral OPAMP0 base address */ -#define OPAMP0_BASE (0x400B7000u) -/** Peripheral OPAMP0 base pointer */ -#define OPAMP0 ((OPAMP_Type *)OPAMP0_BASE) -/** Array initializer of OPAMP peripheral base addresses */ -#define OPAMP_BASE_ADDRS { OPAMP0_BASE } -/** Array initializer of OPAMP peripheral base pointers */ -#define OPAMP_BASE_PTRS { OPAMP0 } - -/*! - * @} - */ /* end of group OPAMP_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- OSTIMER Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup OSTIMER_Peripheral_Access_Layer OSTIMER Peripheral Access Layer - * @{ - */ - -/** OSTIMER - Register Layout Typedef */ -typedef struct { - __I uint32_t EVTIMERL; /**< EVTIMER Low, offset: 0x0 */ - __I uint32_t EVTIMERH; /**< EVTIMER High, offset: 0x4 */ - __I uint32_t CAPTURE_L; /**< Local Capture Low for CPU, offset: 0x8 */ - __I uint32_t CAPTURE_H; /**< Local Capture High for CPU, offset: 0xC */ - __IO uint32_t MATCH_L; /**< Local Match Low for CPU, offset: 0x10 */ - __IO uint32_t MATCH_H; /**< Local Match High for CPU, offset: 0x14 */ - uint8_t RESERVED_0[4]; - __IO uint32_t OSEVENT_CTRL; /**< OSTIMER Control for CPU, offset: 0x1C */ -} OSTIMER_Type; - -/* ---------------------------------------------------------------------------- - -- OSTIMER Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup OSTIMER_Register_Masks OSTIMER Register Masks - * @{ - */ - -/*! @name EVTIMERL - EVTIMER Low */ -/*! @{ */ - -#define OSTIMER_EVTIMERL_EVTIMER_COUNT_VALUE_MASK (0xFFFFFFFFU) -#define OSTIMER_EVTIMERL_EVTIMER_COUNT_VALUE_SHIFT (0U) -/*! EVTIMER_COUNT_VALUE - EVTimer Count Value */ -#define OSTIMER_EVTIMERL_EVTIMER_COUNT_VALUE(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_EVTIMERL_EVTIMER_COUNT_VALUE_SHIFT)) & OSTIMER_EVTIMERL_EVTIMER_COUNT_VALUE_MASK) -/*! @} */ - -/*! @name EVTIMERH - EVTIMER High */ -/*! @{ */ - -#define OSTIMER_EVTIMERH_EVTIMER_COUNT_VALUE_MASK (0x3FFU) -#define OSTIMER_EVTIMERH_EVTIMER_COUNT_VALUE_SHIFT (0U) -/*! EVTIMER_COUNT_VALUE - EVTimer Count Value */ -#define OSTIMER_EVTIMERH_EVTIMER_COUNT_VALUE(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_EVTIMERH_EVTIMER_COUNT_VALUE_SHIFT)) & OSTIMER_EVTIMERH_EVTIMER_COUNT_VALUE_MASK) -/*! @} */ - -/*! @name CAPTURE_L - Local Capture Low for CPU */ -/*! @{ */ - -#define OSTIMER_CAPTURE_L_CAPTURE_VALUE_MASK (0xFFFFFFFFU) -#define OSTIMER_CAPTURE_L_CAPTURE_VALUE_SHIFT (0U) -/*! CAPTURE_VALUE - EVTimer Capture Value */ -#define OSTIMER_CAPTURE_L_CAPTURE_VALUE(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_CAPTURE_L_CAPTURE_VALUE_SHIFT)) & OSTIMER_CAPTURE_L_CAPTURE_VALUE_MASK) -/*! @} */ - -/*! @name CAPTURE_H - Local Capture High for CPU */ -/*! @{ */ - -#define OSTIMER_CAPTURE_H_CAPTURE_VALUE_MASK (0x3FFU) -#define OSTIMER_CAPTURE_H_CAPTURE_VALUE_SHIFT (0U) -/*! CAPTURE_VALUE - EVTimer Capture Value */ -#define OSTIMER_CAPTURE_H_CAPTURE_VALUE(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_CAPTURE_H_CAPTURE_VALUE_SHIFT)) & OSTIMER_CAPTURE_H_CAPTURE_VALUE_MASK) -/*! @} */ - -/*! @name MATCH_L - Local Match Low for CPU */ -/*! @{ */ - -#define OSTIMER_MATCH_L_MATCH_VALUE_MASK (0xFFFFFFFFU) -#define OSTIMER_MATCH_L_MATCH_VALUE_SHIFT (0U) -/*! MATCH_VALUE - EVTimer Match Value */ -#define OSTIMER_MATCH_L_MATCH_VALUE(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_MATCH_L_MATCH_VALUE_SHIFT)) & OSTIMER_MATCH_L_MATCH_VALUE_MASK) -/*! @} */ - -/*! @name MATCH_H - Local Match High for CPU */ -/*! @{ */ - -#define OSTIMER_MATCH_H_MATCH_VALUE_MASK (0x3FFU) -#define OSTIMER_MATCH_H_MATCH_VALUE_SHIFT (0U) -/*! MATCH_VALUE - EVTimer Match Value */ -#define OSTIMER_MATCH_H_MATCH_VALUE(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_MATCH_H_MATCH_VALUE_SHIFT)) & OSTIMER_MATCH_H_MATCH_VALUE_MASK) -/*! @} */ - -/*! @name OSEVENT_CTRL - OSTIMER Control for CPU */ -/*! @{ */ - -#define OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG_MASK (0x1U) -#define OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG_SHIFT (0U) -/*! OSTIMER_INTRFLAG - Interrupt Flag */ -#define OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG_SHIFT)) & OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG_MASK) - -#define OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_MASK (0x2U) -#define OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_SHIFT (1U) -/*! OSTIMER_INTENA - Interrupt or Wake-Up Request - * 0b0..Interrupts blocked - * 0b1..Interrupts enabled - */ -#define OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_SHIFT)) & OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_MASK) - -#define OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK (0x4U) -#define OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_SHIFT (2U) -/*! MATCH_WR_RDY - EVTimer Match Write Ready */ -#define OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_SHIFT)) & OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK) - -#define OSTIMER_OSEVENT_CTRL_DEBUG_EN_MASK (0x8U) -#define OSTIMER_OSEVENT_CTRL_DEBUG_EN_SHIFT (3U) -/*! DEBUG_EN - Debug Enable - * 0b0..Disables - * 0b1..Enables - */ -#define OSTIMER_OSEVENT_CTRL_DEBUG_EN(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_OSEVENT_CTRL_DEBUG_EN_SHIFT)) & OSTIMER_OSEVENT_CTRL_DEBUG_EN_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group OSTIMER_Register_Masks */ - - -/* OSTIMER - Peripheral instance base addresses */ -/** Peripheral OSTIMER0 base address */ -#define OSTIMER0_BASE (0x400AD000u) -/** Peripheral OSTIMER0 base pointer */ -#define OSTIMER0 ((OSTIMER_Type *)OSTIMER0_BASE) -/** Array initializer of OSTIMER peripheral base addresses */ -#define OSTIMER_BASE_ADDRS { OSTIMER0_BASE } -/** Array initializer of OSTIMER peripheral base pointers */ -#define OSTIMER_BASE_PTRS { OSTIMER0 } -/** Interrupt vectors for the OSTIMER peripheral type */ -#define OSTIMER_IRQS { OS_EVENT_IRQn } - -/*! - * @} - */ /* end of group OSTIMER_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- PORT Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PORT_Peripheral_Access_Layer PORT Peripheral Access Layer - * @{ - */ - -/** PORT - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - uint8_t RESERVED_0[12]; - __O uint32_t GPCLR; /**< Global Pin Control Low, offset: 0x10 */ - __O uint32_t GPCHR; /**< Global Pin Control High, offset: 0x14 */ - uint8_t RESERVED_1[8]; - __IO uint32_t CONFIG; /**< Configuration, offset: 0x20 */ - uint8_t RESERVED_2[60]; - __IO uint32_t CALIB0; /**< Calibration 0, offset: 0x60, available only on: PORT0, PORT1, PORT3, PORT4 (missing on PORT2) */ - __IO uint32_t CALIB1; /**< Calibration 1, offset: 0x64, available only on: PORT0, PORT1, PORT3, PORT4 (missing on PORT2) */ - uint8_t RESERVED_3[24]; - __IO uint32_t PCR[32]; /**< Pin Control 0..Pin Control 31, array offset: 0x80, array step: 0x4 */ -} PORT_Type; - -/* ---------------------------------------------------------------------------- - -- PORT Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PORT_Register_Masks PORT Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define PORT_VERID_FEATURE_MASK (0xFFFFU) -#define PORT_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Basic implementation - */ -#define PORT_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << PORT_VERID_FEATURE_SHIFT)) & PORT_VERID_FEATURE_MASK) - -#define PORT_VERID_MINOR_MASK (0xFF0000U) -#define PORT_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define PORT_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << PORT_VERID_MINOR_SHIFT)) & PORT_VERID_MINOR_MASK) - -#define PORT_VERID_MAJOR_MASK (0xFF000000U) -#define PORT_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define PORT_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << PORT_VERID_MAJOR_SHIFT)) & PORT_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name GPCLR - Global Pin Control Low */ -/*! @{ */ - -#define PORT_GPCLR_GPWD_MASK (0xFFFFU) -#define PORT_GPCLR_GPWD_SHIFT (0U) -/*! GPWD - Global Pin Write Data */ -#define PORT_GPCLR_GPWD(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWD_SHIFT)) & PORT_GPCLR_GPWD_MASK) - -#define PORT_GPCLR_GPWE0_MASK (0x10000U) -#define PORT_GPCLR_GPWE0_SHIFT (16U) -/*! GPWE0 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE0(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE0_SHIFT)) & PORT_GPCLR_GPWE0_MASK) - -#define PORT_GPCLR_GPWE1_MASK (0x20000U) -#define PORT_GPCLR_GPWE1_SHIFT (17U) -/*! GPWE1 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE1(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE1_SHIFT)) & PORT_GPCLR_GPWE1_MASK) - -#define PORT_GPCLR_GPWE2_MASK (0x40000U) -#define PORT_GPCLR_GPWE2_SHIFT (18U) -/*! GPWE2 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE2(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE2_SHIFT)) & PORT_GPCLR_GPWE2_MASK) - -#define PORT_GPCLR_GPWE3_MASK (0x80000U) -#define PORT_GPCLR_GPWE3_SHIFT (19U) -/*! GPWE3 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE3(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE3_SHIFT)) & PORT_GPCLR_GPWE3_MASK) - -#define PORT_GPCLR_GPWE4_MASK (0x100000U) -#define PORT_GPCLR_GPWE4_SHIFT (20U) -/*! GPWE4 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE4(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE4_SHIFT)) & PORT_GPCLR_GPWE4_MASK) - -#define PORT_GPCLR_GPWE5_MASK (0x200000U) -#define PORT_GPCLR_GPWE5_SHIFT (21U) -/*! GPWE5 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE5(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE5_SHIFT)) & PORT_GPCLR_GPWE5_MASK) - -#define PORT_GPCLR_GPWE6_MASK (0x400000U) -#define PORT_GPCLR_GPWE6_SHIFT (22U) -/*! GPWE6 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE6(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE6_SHIFT)) & PORT_GPCLR_GPWE6_MASK) - -#define PORT_GPCLR_GPWE7_MASK (0x800000U) -#define PORT_GPCLR_GPWE7_SHIFT (23U) -/*! GPWE7 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE7(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE7_SHIFT)) & PORT_GPCLR_GPWE7_MASK) - -#define PORT_GPCLR_GPWE8_MASK (0x1000000U) -#define PORT_GPCLR_GPWE8_SHIFT (24U) -/*! GPWE8 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE8(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE8_SHIFT)) & PORT_GPCLR_GPWE8_MASK) - -#define PORT_GPCLR_GPWE9_MASK (0x2000000U) -#define PORT_GPCLR_GPWE9_SHIFT (25U) -/*! GPWE9 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE9(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE9_SHIFT)) & PORT_GPCLR_GPWE9_MASK) - -#define PORT_GPCLR_GPWE10_MASK (0x4000000U) -#define PORT_GPCLR_GPWE10_SHIFT (26U) -/*! GPWE10 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE10(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE10_SHIFT)) & PORT_GPCLR_GPWE10_MASK) - -#define PORT_GPCLR_GPWE11_MASK (0x8000000U) -#define PORT_GPCLR_GPWE11_SHIFT (27U) -/*! GPWE11 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE11(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE11_SHIFT)) & PORT_GPCLR_GPWE11_MASK) - -#define PORT_GPCLR_GPWE12_MASK (0x10000000U) -#define PORT_GPCLR_GPWE12_SHIFT (28U) -/*! GPWE12 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE12(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE12_SHIFT)) & PORT_GPCLR_GPWE12_MASK) - -#define PORT_GPCLR_GPWE13_MASK (0x20000000U) -#define PORT_GPCLR_GPWE13_SHIFT (29U) -/*! GPWE13 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE13(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE13_SHIFT)) & PORT_GPCLR_GPWE13_MASK) - -#define PORT_GPCLR_GPWE14_MASK (0x40000000U) -#define PORT_GPCLR_GPWE14_SHIFT (30U) -/*! GPWE14 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE14(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE14_SHIFT)) & PORT_GPCLR_GPWE14_MASK) - -#define PORT_GPCLR_GPWE15_MASK (0x80000000U) -#define PORT_GPCLR_GPWE15_SHIFT (31U) -/*! GPWE15 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE15(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE15_SHIFT)) & PORT_GPCLR_GPWE15_MASK) -/*! @} */ - -/*! @name GPCHR - Global Pin Control High */ -/*! @{ */ - -#define PORT_GPCHR_GPWD_MASK (0xFFFFU) -#define PORT_GPCHR_GPWD_SHIFT (0U) -/*! GPWD - Global Pin Write Data */ -#define PORT_GPCHR_GPWD(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWD_SHIFT)) & PORT_GPCHR_GPWD_MASK) - -#define PORT_GPCHR_GPWE16_MASK (0x10000U) -#define PORT_GPCHR_GPWE16_SHIFT (16U) -/*! GPWE16 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE16(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE16_SHIFT)) & PORT_GPCHR_GPWE16_MASK) - -#define PORT_GPCHR_GPWE17_MASK (0x20000U) -#define PORT_GPCHR_GPWE17_SHIFT (17U) -/*! GPWE17 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE17(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE17_SHIFT)) & PORT_GPCHR_GPWE17_MASK) - -#define PORT_GPCHR_GPWE18_MASK (0x40000U) -#define PORT_GPCHR_GPWE18_SHIFT (18U) -/*! GPWE18 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE18(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE18_SHIFT)) & PORT_GPCHR_GPWE18_MASK) - -#define PORT_GPCHR_GPWE19_MASK (0x80000U) -#define PORT_GPCHR_GPWE19_SHIFT (19U) -/*! GPWE19 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE19(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE19_SHIFT)) & PORT_GPCHR_GPWE19_MASK) - -#define PORT_GPCHR_GPWE20_MASK (0x100000U) -#define PORT_GPCHR_GPWE20_SHIFT (20U) -/*! GPWE20 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE20(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE20_SHIFT)) & PORT_GPCHR_GPWE20_MASK) - -#define PORT_GPCHR_GPWE21_MASK (0x200000U) -#define PORT_GPCHR_GPWE21_SHIFT (21U) -/*! GPWE21 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE21(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE21_SHIFT)) & PORT_GPCHR_GPWE21_MASK) - -#define PORT_GPCHR_GPWE22_MASK (0x400000U) -#define PORT_GPCHR_GPWE22_SHIFT (22U) -/*! GPWE22 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE22(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE22_SHIFT)) & PORT_GPCHR_GPWE22_MASK) - -#define PORT_GPCHR_GPWE23_MASK (0x800000U) -#define PORT_GPCHR_GPWE23_SHIFT (23U) -/*! GPWE23 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE23(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE23_SHIFT)) & PORT_GPCHR_GPWE23_MASK) - -#define PORT_GPCHR_GPWE24_MASK (0x1000000U) -#define PORT_GPCHR_GPWE24_SHIFT (24U) -/*! GPWE24 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE24(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE24_SHIFT)) & PORT_GPCHR_GPWE24_MASK) - -#define PORT_GPCHR_GPWE25_MASK (0x2000000U) -#define PORT_GPCHR_GPWE25_SHIFT (25U) -/*! GPWE25 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE25(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE25_SHIFT)) & PORT_GPCHR_GPWE25_MASK) - -#define PORT_GPCHR_GPWE26_MASK (0x4000000U) -#define PORT_GPCHR_GPWE26_SHIFT (26U) -/*! GPWE26 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE26(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE26_SHIFT)) & PORT_GPCHR_GPWE26_MASK) - -#define PORT_GPCHR_GPWE27_MASK (0x8000000U) -#define PORT_GPCHR_GPWE27_SHIFT (27U) -/*! GPWE27 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE27(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE27_SHIFT)) & PORT_GPCHR_GPWE27_MASK) - -#define PORT_GPCHR_GPWE28_MASK (0x10000000U) -#define PORT_GPCHR_GPWE28_SHIFT (28U) -/*! GPWE28 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE28(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE28_SHIFT)) & PORT_GPCHR_GPWE28_MASK) - -#define PORT_GPCHR_GPWE29_MASK (0x20000000U) -#define PORT_GPCHR_GPWE29_SHIFT (29U) -/*! GPWE29 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE29(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE29_SHIFT)) & PORT_GPCHR_GPWE29_MASK) - -#define PORT_GPCHR_GPWE30_MASK (0x40000000U) -#define PORT_GPCHR_GPWE30_SHIFT (30U) -/*! GPWE30 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE30(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE30_SHIFT)) & PORT_GPCHR_GPWE30_MASK) - -#define PORT_GPCHR_GPWE31_MASK (0x80000000U) -#define PORT_GPCHR_GPWE31_SHIFT (31U) -/*! GPWE31 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE31(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE31_SHIFT)) & PORT_GPCHR_GPWE31_MASK) -/*! @} */ - -/*! @name CONFIG - Configuration */ -/*! @{ */ - -#define PORT_CONFIG_RANGE_MASK (0x1U) -#define PORT_CONFIG_RANGE_SHIFT (0U) -/*! RANGE - Port Voltage Range - * 0b0..1.71 V-3.6 V - * 0b1..2.70 V-3.6 V - */ -#define PORT_CONFIG_RANGE(x) (((uint32_t)(((uint32_t)(x)) << PORT_CONFIG_RANGE_SHIFT)) & PORT_CONFIG_RANGE_MASK) -/*! @} */ - -/*! @name CALIB0 - Calibration 0 */ -/*! @{ */ - -#define PORT_CALIB0_NCAL_MASK (0x3FU) -#define PORT_CALIB0_NCAL_SHIFT (0U) -/*! NCAL - Calibration of NMOS Output Driver */ -#define PORT_CALIB0_NCAL(x) (((uint32_t)(((uint32_t)(x)) << PORT_CALIB0_NCAL_SHIFT)) & PORT_CALIB0_NCAL_MASK) - -#define PORT_CALIB0_PCAL_MASK (0x3F0000U) -#define PORT_CALIB0_PCAL_SHIFT (16U) -/*! PCAL - Calibration of PMOS Output Driver */ -#define PORT_CALIB0_PCAL(x) (((uint32_t)(((uint32_t)(x)) << PORT_CALIB0_PCAL_SHIFT)) & PORT_CALIB0_PCAL_MASK) -/*! @} */ - -/*! @name CALIB1 - Calibration 1 */ -/*! @{ */ - -#define PORT_CALIB1_NCAL_MASK (0x3FU) -#define PORT_CALIB1_NCAL_SHIFT (0U) -/*! NCAL - Calibration of NMOS Output Driver */ -#define PORT_CALIB1_NCAL(x) (((uint32_t)(((uint32_t)(x)) << PORT_CALIB1_NCAL_SHIFT)) & PORT_CALIB1_NCAL_MASK) - -#define PORT_CALIB1_PCAL_MASK (0x3F0000U) -#define PORT_CALIB1_PCAL_SHIFT (16U) -/*! PCAL - Calibration of PMOS Output Driver */ -#define PORT_CALIB1_PCAL(x) (((uint32_t)(((uint32_t)(x)) << PORT_CALIB1_PCAL_SHIFT)) & PORT_CALIB1_PCAL_MASK) -/*! @} */ - -/*! @name PCR - Pin Control 0..Pin Control 31 */ -/*! @{ */ - -#define PORT_PCR_PS_MASK (0x1U) -#define PORT_PCR_PS_SHIFT (0U) -/*! PS - Pull Select - * 0b0..Enables internal pulldown resistor - * 0b1..Enables internal pullup resistor - */ -#define PORT_PCR_PS(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_PS_SHIFT)) & PORT_PCR_PS_MASK) - -#define PORT_PCR_PE_MASK (0x2U) -#define PORT_PCR_PE_SHIFT (1U) -/*! PE - Pull Enable - * 0b0..Disables - * 0b1..Enables - */ -#define PORT_PCR_PE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_PE_SHIFT)) & PORT_PCR_PE_MASK) - -#define PORT_PCR_PV_MASK (0x4U) -#define PORT_PCR_PV_SHIFT (2U) -/*! PV - Pull Value - * 0b0..Low - * 0b1..High - */ -#define PORT_PCR_PV(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_PV_SHIFT)) & PORT_PCR_PV_MASK) - -#define PORT_PCR_SRE_MASK (0x8U) -#define PORT_PCR_SRE_SHIFT (3U) -/*! SRE - Slew Rate Enable - * 0b0..Fast - * 0b1..Slow - */ -#define PORT_PCR_SRE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_SRE_SHIFT)) & PORT_PCR_SRE_MASK) - -#define PORT_PCR_PFE_MASK (0x10U) -#define PORT_PCR_PFE_SHIFT (4U) -/*! PFE - Passive Filter Enable - * 0b0..Disables - * 0b1..Enables - */ -#define PORT_PCR_PFE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_PFE_SHIFT)) & PORT_PCR_PFE_MASK) - -#define PORT_PCR_ODE_MASK (0x20U) -#define PORT_PCR_ODE_SHIFT (5U) -/*! ODE - Open Drain Enable - * 0b0..Disables - * 0b1..Enables - */ -#define PORT_PCR_ODE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_ODE_SHIFT)) & PORT_PCR_ODE_MASK) - -#define PORT_PCR_DSE_MASK (0x40U) -#define PORT_PCR_DSE_SHIFT (6U) -/*! DSE - Drive Strength Enable - * 0b0..Low - * 0b1..High - */ -#define PORT_PCR_DSE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_DSE_SHIFT)) & PORT_PCR_DSE_MASK) - -#define PORT_PCR_DSE1_MASK (0x80U) -#define PORT_PCR_DSE1_SHIFT (7U) -/*! DSE1 - Drive Strength Enable - * 0b0..Normal - * 0b1..Double - */ -#define PORT_PCR_DSE1(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_DSE1_SHIFT)) & PORT_PCR_DSE1_MASK) - -#define PORT_PCR_MUX_MASK (0xF00U) /* Merged from fields with different position or width, of widths (2, 3, 4), largest definition used */ -#define PORT_PCR_MUX_SHIFT (8U) -/*! MUX - Pin Multiplex Control - * 0b0000..Alternative 0 (GPIO) - * 0b0001..Alternative 1 (chip-specific) - * 0b0010..Alternative 2 (chip-specific) - * 0b0011..Alternative 3 (chip-specific) - * 0b0100..Alternative 4 (chip-specific) - * 0b0101..Alternative 5 (chip-specific) - * 0b0110..Alternative 6 (chip-specific) - * 0b0111..Alternative 7 (chip-specific) - * 0b1000..Alternative 8 (chip-specific) - * 0b1001..Alternative 9 (chip-specific) - * 0b1010..Alternative 10 (chip-specific) - * 0b1011..Alternative 11 (chip-specific) - * 0b1100..Alternative 12 (chip-specific) - * 0b1101..Alternative 13 (chip-specific) - */ -#define PORT_PCR_MUX(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_MUX_SHIFT)) & PORT_PCR_MUX_MASK) /* Merged from fields with different position or width, of widths (2, 3, 4), largest definition used */ - -#define PORT_PCR_IBE_MASK (0x1000U) -#define PORT_PCR_IBE_SHIFT (12U) -/*! IBE - Input Buffer Enable - * 0b0..Disables - * 0b1..Enables - */ -#define PORT_PCR_IBE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_IBE_SHIFT)) & PORT_PCR_IBE_MASK) - -#define PORT_PCR_INV_MASK (0x2000U) -#define PORT_PCR_INV_SHIFT (13U) -/*! INV - Invert Input - * 0b0..Does not invert - * 0b1..Inverts - */ -#define PORT_PCR_INV(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_INV_SHIFT)) & PORT_PCR_INV_MASK) - -#define PORT_PCR_LK_MASK (0x8000U) -#define PORT_PCR_LK_SHIFT (15U) -/*! LK - Lock Register - * 0b0..Does not lock - * 0b1..Locks - */ -#define PORT_PCR_LK(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_LK_SHIFT)) & PORT_PCR_LK_MASK) -/*! @} */ - -/* The count of PORT_PCR */ -#define PORT_PCR_COUNT (32U) - - -/*! - * @} - */ /* end of group PORT_Register_Masks */ - - -/* PORT - Peripheral instance base addresses */ -/** Peripheral PORT0 base address */ -#define PORT0_BASE (0x400BC000u) -/** Peripheral PORT0 base pointer */ -#define PORT0 ((PORT_Type *)PORT0_BASE) -/** Peripheral PORT1 base address */ -#define PORT1_BASE (0x400BD000u) -/** Peripheral PORT1 base pointer */ -#define PORT1 ((PORT_Type *)PORT1_BASE) -/** Peripheral PORT2 base address */ -#define PORT2_BASE (0x400BE000u) -/** Peripheral PORT2 base pointer */ -#define PORT2 ((PORT_Type *)PORT2_BASE) -/** Peripheral PORT3 base address */ -#define PORT3_BASE (0x400BF000u) -/** Peripheral PORT3 base pointer */ -#define PORT3 ((PORT_Type *)PORT3_BASE) -/** Peripheral PORT4 base address */ -#define PORT4_BASE (0x400C0000u) -/** Peripheral PORT4 base pointer */ -#define PORT4 ((PORT_Type *)PORT4_BASE) -/** Array initializer of PORT peripheral base addresses */ -#define PORT_BASE_ADDRS { PORT0_BASE, PORT1_BASE, PORT2_BASE, PORT3_BASE, PORT4_BASE } -/** Array initializer of PORT peripheral base pointers */ -#define PORT_BASE_PTRS { PORT0, PORT1, PORT2, PORT3, PORT4 } - -/*! - * @} - */ /* end of group PORT_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- PWM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PWM_Peripheral_Access_Layer PWM Peripheral Access Layer - * @{ - */ - -/** PWM - Register Layout Typedef */ -typedef struct { - struct { /* offset: 0x0, array step: 0x60 */ - __I uint16_t CNT; /**< Counter Register, array offset: 0x0, array step: 0x60 */ - __IO uint16_t INIT; /**< Initial Count Register, array offset: 0x2, array step: 0x60 */ - __IO uint16_t CTRL2; /**< Control 2 Register, array offset: 0x4, array step: 0x60 */ - __IO uint16_t CTRL; /**< Control Register, array offset: 0x6, array step: 0x60 */ - uint8_t RESERVED_0[2]; - __IO uint16_t VAL0; /**< Value Register 0, array offset: 0xA, array step: 0x60 */ - uint8_t RESERVED_1[2]; - __IO uint16_t VAL1; /**< Value Register 1, array offset: 0xE, array step: 0x60 */ - uint8_t RESERVED_2[2]; - __IO uint16_t VAL2; /**< Value Register 2, array offset: 0x12, array step: 0x60 */ - uint8_t RESERVED_3[2]; - __IO uint16_t VAL3; /**< Value Register 3, array offset: 0x16, array step: 0x60 */ - uint8_t RESERVED_4[2]; - __IO uint16_t VAL4; /**< Value Register 4, array offset: 0x1A, array step: 0x60 */ - uint8_t RESERVED_5[2]; - __IO uint16_t VAL5; /**< Value Register 5, array offset: 0x1E, array step: 0x60 */ - uint8_t RESERVED_6[2]; - __IO uint16_t OCTRL; /**< Output Control Register, array offset: 0x22, array step: 0x60 */ - __IO uint16_t STS; /**< Status Register, array offset: 0x24, array step: 0x60 */ - __IO uint16_t INTEN; /**< Interrupt Enable Register, array offset: 0x26, array step: 0x60 */ - __IO uint16_t DMAEN; /**< DMA Enable Register, array offset: 0x28, array step: 0x60 */ - __IO uint16_t TCTRL; /**< Output Trigger Control Register, array offset: 0x2A, array step: 0x60 */ - __IO uint16_t DISMAP[1]; /**< Fault Disable Mapping Register 0, array offset: 0x2C, array step: index*0x60, index2*0x2 */ - uint8_t RESERVED_7[2]; - __IO uint16_t DTCNT0; /**< Deadtime Count Register 0, array offset: 0x30, array step: 0x60 */ - __IO uint16_t DTCNT1; /**< Deadtime Count Register 1, array offset: 0x32, array step: 0x60 */ - uint8_t RESERVED_8[8]; - __IO uint16_t CAPTCTRLX; /**< Capture Control X Register, array offset: 0x3C, array step: 0x60 */ - __IO uint16_t CAPTCOMPX; /**< Capture Compare X Register, array offset: 0x3E, array step: 0x60 */ - __I uint16_t CVAL0; /**< Capture Value 0 Register, array offset: 0x40, array step: 0x60 */ - __I uint16_t CVAL0CYC; /**< Capture Value 0 Cycle Register, array offset: 0x42, array step: 0x60 */ - __I uint16_t CVAL1; /**< Capture Value 1 Register, array offset: 0x44, array step: 0x60 */ - __I uint16_t CVAL1CYC; /**< Capture Value 1 Cycle Register, array offset: 0x46, array step: 0x60 */ - uint8_t RESERVED_9[16]; - __IO uint16_t PHASEDLY; /**< Phase Delay Register, array offset: 0x58, array step: 0x60, valid indices: [1-2] */ - uint8_t RESERVED_10[4]; - __IO uint16_t CAPTFILTX; /**< Capture PWM_X Input Filter Register, array offset: 0x5E, array step: 0x60 */ - } SM[3]; - uint8_t RESERVED_0[96]; - __IO uint16_t OUTEN; /**< Output Enable Register, offset: 0x180 */ - __IO uint16_t MASK; /**< Mask Register, offset: 0x182 */ - __IO uint16_t SWCOUT; /**< Software Controlled Output Register, offset: 0x184 */ - __IO uint16_t DTSRCSEL; /**< PWM Source Select Register, offset: 0x186 */ - __IO uint16_t MCTRL; /**< Master Control Register, offset: 0x188 */ - __IO uint16_t MCTRL2; /**< Master Control 2 Register, offset: 0x18A */ - __IO uint16_t FCTRL; /**< Fault Control Register, offset: 0x18C */ - __IO uint16_t FSTS; /**< Fault Status Register, offset: 0x18E */ - __IO uint16_t FFILT; /**< Fault Filter Register, offset: 0x190 */ - __IO uint16_t FTST; /**< Fault Test Register, offset: 0x192 */ - __IO uint16_t FCTRL2; /**< Fault Control 2 Register, offset: 0x194 */ -} PWM_Type; - -/* ---------------------------------------------------------------------------- - -- PWM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PWM_Register_Masks PWM Register Masks - * @{ - */ - -/*! @name CNT - Counter Register */ -/*! @{ */ - -#define PWM_CNT_CNT_MASK (0xFFFFU) -#define PWM_CNT_CNT_SHIFT (0U) -/*! CNT - Counter Register Bits */ -#define PWM_CNT_CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CNT_CNT_SHIFT)) & PWM_CNT_CNT_MASK) -/*! @} */ - -/* The count of PWM_CNT */ -#define PWM_CNT_COUNT (3U) - -/*! @name INIT - Initial Count Register */ -/*! @{ */ - -#define PWM_INIT_INIT_MASK (0xFFFFU) -#define PWM_INIT_INIT_SHIFT (0U) -/*! INIT - Initial Count Register Bits */ -#define PWM_INIT_INIT(x) (((uint16_t)(((uint16_t)(x)) << PWM_INIT_INIT_SHIFT)) & PWM_INIT_INIT_MASK) -/*! @} */ - -/* The count of PWM_INIT */ -#define PWM_INIT_COUNT (3U) - -/*! @name CTRL2 - Control 2 Register */ -/*! @{ */ - -#define PWM_CTRL2_CLK_SEL_MASK (0x3U) -#define PWM_CTRL2_CLK_SEL_SHIFT (0U) -/*! CLK_SEL - Clock Source Select - * 0b00..The IPBus clock is used as the clock for the local prescaler and counter. - * 0b01..EXT_CLK is used as the clock for the local prescaler and counter. - * 0b10..Submodule 0's clock (AUX_CLK) is used as the source clock for the local prescaler and counter. This - * setting should not be used in submodule 0 as it forces the clock to logic 0. - * 0b11..Reserved - */ -#define PWM_CTRL2_CLK_SEL(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_CLK_SEL_SHIFT)) & PWM_CTRL2_CLK_SEL_MASK) - -#define PWM_CTRL2_RELOAD_SEL_MASK (0x4U) -#define PWM_CTRL2_RELOAD_SEL_SHIFT (2U) -/*! RELOAD_SEL - Reload Source Select - * 0b0..The local RELOAD signal is used to reload registers. - * 0b1..The master RELOAD signal (from submodule 0) is used to reload registers. This setting should not be used - * in submodule 0 as it forces the RELOAD signal to logic 0. - */ -#define PWM_CTRL2_RELOAD_SEL(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_RELOAD_SEL_SHIFT)) & PWM_CTRL2_RELOAD_SEL_MASK) - -#define PWM_CTRL2_FORCE_SEL_MASK (0x38U) -#define PWM_CTRL2_FORCE_SEL_SHIFT (3U) -/*! FORCE_SEL - Force Select - * 0b000..The local force signal, CTRL2[FORCE], from this submodule is used to force updates. - * 0b001..The master force signal from submodule 0 is used to force updates. This setting should not be used in - * submodule 0 as it holds the FORCE OUTPUT signal to logic 0. - * 0b010..The local reload signal from this submodule is used to force updates without regard to the state of LDOK. - * 0b011..The master reload signal from submodule0 is used to force updates if LDOK is set. This setting should - * not be used in submodule0 as it holds the FORCE OUTPUT signal to logic 0. - * 0b100..The local sync signal from this submodule is used to force updates. - * 0b101..The master sync signal from submodule0 is used to force updates. This setting should not be used in - * submodule0 as it holds the FORCE OUTPUT signal to logic 0. - * 0b110..The external force signal, EXT_FORCE, from outside the PWM module causes updates. - * 0b111..The external sync signal, EXT_SYNC, from outside the PWM module causes updates. - */ -#define PWM_CTRL2_FORCE_SEL(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_FORCE_SEL_SHIFT)) & PWM_CTRL2_FORCE_SEL_MASK) - -#define PWM_CTRL2_FORCE_MASK (0x40U) -#define PWM_CTRL2_FORCE_SHIFT (6U) -/*! FORCE - Force Initialization */ -#define PWM_CTRL2_FORCE(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_FORCE_SHIFT)) & PWM_CTRL2_FORCE_MASK) - -#define PWM_CTRL2_FRCEN_MASK (0x80U) -#define PWM_CTRL2_FRCEN_SHIFT (7U) -/*! FRCEN - Force Enable - * 0b0..Initialization from a FORCE_OUT is disabled. - * 0b1..Initialization from a FORCE_OUT is enabled. - */ -#define PWM_CTRL2_FRCEN(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_FRCEN_SHIFT)) & PWM_CTRL2_FRCEN_MASK) - -#define PWM_CTRL2_INIT_SEL_MASK (0x300U) -#define PWM_CTRL2_INIT_SEL_SHIFT (8U) -/*! INIT_SEL - Initialization Control Select - * 0b00..Local sync (PWM_X) causes initialization. - * 0b01..Master reload from submodule 0 causes initialization. This setting should not be used in submodule 0 as - * it forces the INIT signal to logic 0. The submodule counter will only re-initialize when a master reload - * occurs. - * 0b10..Master sync from submodule 0 causes initialization. This setting should not be used in submodule 0 as it forces the INIT signal to logic 0. - * 0b11..EXT_SYNC causes initialization. - */ -#define PWM_CTRL2_INIT_SEL(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_INIT_SEL_SHIFT)) & PWM_CTRL2_INIT_SEL_MASK) - -#define PWM_CTRL2_PWMX_INIT_MASK (0x400U) -#define PWM_CTRL2_PWMX_INIT_SHIFT (10U) -/*! PWMX_INIT - PWM_X Initial Value */ -#define PWM_CTRL2_PWMX_INIT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_PWMX_INIT_SHIFT)) & PWM_CTRL2_PWMX_INIT_MASK) - -#define PWM_CTRL2_PWM45_INIT_MASK (0x800U) -#define PWM_CTRL2_PWM45_INIT_SHIFT (11U) -/*! PWM45_INIT - PWM45 Initial Value */ -#define PWM_CTRL2_PWM45_INIT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_PWM45_INIT_SHIFT)) & PWM_CTRL2_PWM45_INIT_MASK) - -#define PWM_CTRL2_PWM23_INIT_MASK (0x1000U) -#define PWM_CTRL2_PWM23_INIT_SHIFT (12U) -/*! PWM23_INIT - PWM23 Initial Value */ -#define PWM_CTRL2_PWM23_INIT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_PWM23_INIT_SHIFT)) & PWM_CTRL2_PWM23_INIT_MASK) - -#define PWM_CTRL2_INDEP_MASK (0x2000U) -#define PWM_CTRL2_INDEP_SHIFT (13U) -/*! INDEP - Independent or Complementary Pair Operation - * 0b0..PWM_A and PWM_B form a complementary PWM pair. - * 0b1..PWM_A and PWM_B outputs are independent PWMs. - */ -#define PWM_CTRL2_INDEP(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_INDEP_SHIFT)) & PWM_CTRL2_INDEP_MASK) - -#define PWM_CTRL2_DBGEN_MASK (0x8000U) -#define PWM_CTRL2_DBGEN_SHIFT (15U) -/*! DBGEN - Debug Enable */ -#define PWM_CTRL2_DBGEN(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_DBGEN_SHIFT)) & PWM_CTRL2_DBGEN_MASK) -/*! @} */ - -/* The count of PWM_CTRL2 */ -#define PWM_CTRL2_COUNT (3U) - -/*! @name CTRL - Control Register */ -/*! @{ */ - -#define PWM_CTRL_DBLEN_MASK (0x1U) -#define PWM_CTRL_DBLEN_SHIFT (0U) -/*! DBLEN - Double Switching Enable - * 0b0..Double switching disabled. - * 0b1..Double switching enabled. - */ -#define PWM_CTRL_DBLEN(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_DBLEN_SHIFT)) & PWM_CTRL_DBLEN_MASK) - -#define PWM_CTRL_DBLX_MASK (0x2U) -#define PWM_CTRL_DBLX_SHIFT (1U) -/*! DBLX - PWM_X Double Switching Enable - * 0b0..PWM_X double pulse disabled. - * 0b1..PWM_X double pulse enabled. - */ -#define PWM_CTRL_DBLX(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_DBLX_SHIFT)) & PWM_CTRL_DBLX_MASK) - -#define PWM_CTRL_LDMOD_MASK (0x4U) -#define PWM_CTRL_LDMOD_SHIFT (2U) -/*! LDMOD - Load Mode Select - * 0b0..Buffered registers of this submodule are loaded and take effect at the next PWM reload if MCTRL[LDOK] is set. - * 0b1..Buffered registers of this submodule are loaded and take effect immediately upon MCTRL[LDOK] being set. - * In this case, it is not necessary to set CTRL[FULL] or CTRL[HALF]. - */ -#define PWM_CTRL_LDMOD(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_LDMOD_SHIFT)) & PWM_CTRL_LDMOD_MASK) - -#define PWM_CTRL_SPLIT_MASK (0x8U) -#define PWM_CTRL_SPLIT_SHIFT (3U) -/*! SPLIT - Split the DBLPWM signal to PWM_A and PWM_B - * 0b0..DBLPWM is not split. PWM_A and PWM_B each have double pulses. - * 0b1..DBLPWM is split to PWM_A and PWM_B. - */ -#define PWM_CTRL_SPLIT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_SPLIT_SHIFT)) & PWM_CTRL_SPLIT_MASK) - -#define PWM_CTRL_PRSC_MASK (0x70U) -#define PWM_CTRL_PRSC_SHIFT (4U) -/*! PRSC - Prescaler - * 0b000..Prescaler 1 - * 0b001..Prescaler 2 - * 0b010..Prescaler 4 - * 0b011..Prescaler 8 - * 0b100..Prescaler 16 - * 0b101..Prescaler 32 - * 0b110..Prescaler 64 - * 0b111..Prescaler 128 - */ -#define PWM_CTRL_PRSC(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_PRSC_SHIFT)) & PWM_CTRL_PRSC_MASK) - -#define PWM_CTRL_COMPMODE_MASK (0x80U) -#define PWM_CTRL_COMPMODE_SHIFT (7U) -/*! COMPMODE - Compare Mode - * 0b0..The VAL* registers and the PWM counter are compared using an "equal to" method. This means that PWM edges - * are only produced when the counter is equal to one of the VAL* register values. This implies that a PWM_A - * output that is high at the end of a period maintains this state until a match with VAL3 clears the output - * in the following period. - * 0b1..The VAL* registers and the PWM counter are compared using an "equal to or greater than" method. This - * means that PWM edges are produced when the counter is equal to or greater than one of the VAL* register - * values. This implies that a PWM_A output that is high at the end of a period could go low at the start of the - * next period if the starting counter value is greater than (but not necessarily equal to) the new VAL3 value. - */ -#define PWM_CTRL_COMPMODE(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_COMPMODE_SHIFT)) & PWM_CTRL_COMPMODE_MASK) - -#define PWM_CTRL_DT_MASK (0x300U) -#define PWM_CTRL_DT_SHIFT (8U) -/*! DT - Deadtime */ -#define PWM_CTRL_DT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_DT_SHIFT)) & PWM_CTRL_DT_MASK) - -#define PWM_CTRL_FULL_MASK (0x400U) -#define PWM_CTRL_FULL_SHIFT (10U) -/*! FULL - Full Cycle Reload - * 0b0..Full-cycle reloads disabled. - * 0b1..Full-cycle reloads enabled. - */ -#define PWM_CTRL_FULL(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_FULL_SHIFT)) & PWM_CTRL_FULL_MASK) - -#define PWM_CTRL_HALF_MASK (0x800U) -#define PWM_CTRL_HALF_SHIFT (11U) -/*! HALF - Half Cycle Reload - * 0b0..Half-cycle reloads disabled. - * 0b1..Half-cycle reloads enabled. - */ -#define PWM_CTRL_HALF(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_HALF_SHIFT)) & PWM_CTRL_HALF_MASK) - -#define PWM_CTRL_LDFQ_MASK (0xF000U) -#define PWM_CTRL_LDFQ_SHIFT (12U) -/*! LDFQ - Load Frequency - * 0b0000..Every PWM opportunity - * 0b0001..Every 2 PWM opportunities - * 0b0010..Every 3 PWM opportunities - * 0b0011..Every 4 PWM opportunities - * 0b0100..Every 5 PWM opportunities - * 0b0101..Every 6 PWM opportunities - * 0b0110..Every 7 PWM opportunities - * 0b0111..Every 8 PWM opportunities - * 0b1000..Every 9 PWM opportunities - * 0b1001..Every 10 PWM opportunities - * 0b1010..Every 11 PWM opportunities - * 0b1011..Every 12 PWM opportunities - * 0b1100..Every 13 PWM opportunities - * 0b1101..Every 14 PWM opportunities - * 0b1110..Every 15 PWM opportunities - * 0b1111..Every 16 PWM opportunities - */ -#define PWM_CTRL_LDFQ(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_LDFQ_SHIFT)) & PWM_CTRL_LDFQ_MASK) -/*! @} */ - -/* The count of PWM_CTRL */ -#define PWM_CTRL_COUNT (3U) - -/*! @name VAL0 - Value Register 0 */ -/*! @{ */ - -#define PWM_VAL0_VAL0_MASK (0xFFFFU) -#define PWM_VAL0_VAL0_SHIFT (0U) -/*! VAL0 - Value 0 */ -#define PWM_VAL0_VAL0(x) (((uint16_t)(((uint16_t)(x)) << PWM_VAL0_VAL0_SHIFT)) & PWM_VAL0_VAL0_MASK) -/*! @} */ - -/* The count of PWM_VAL0 */ -#define PWM_VAL0_COUNT (3U) - -/*! @name VAL1 - Value Register 1 */ -/*! @{ */ - -#define PWM_VAL1_VAL1_MASK (0xFFFFU) -#define PWM_VAL1_VAL1_SHIFT (0U) -/*! VAL1 - Value 1 */ -#define PWM_VAL1_VAL1(x) (((uint16_t)(((uint16_t)(x)) << PWM_VAL1_VAL1_SHIFT)) & PWM_VAL1_VAL1_MASK) -/*! @} */ - -/* The count of PWM_VAL1 */ -#define PWM_VAL1_COUNT (3U) - -/*! @name VAL2 - Value Register 2 */ -/*! @{ */ - -#define PWM_VAL2_VAL2_MASK (0xFFFFU) -#define PWM_VAL2_VAL2_SHIFT (0U) -/*! VAL2 - Value 2 */ -#define PWM_VAL2_VAL2(x) (((uint16_t)(((uint16_t)(x)) << PWM_VAL2_VAL2_SHIFT)) & PWM_VAL2_VAL2_MASK) -/*! @} */ - -/* The count of PWM_VAL2 */ -#define PWM_VAL2_COUNT (3U) - -/*! @name VAL3 - Value Register 3 */ -/*! @{ */ - -#define PWM_VAL3_VAL3_MASK (0xFFFFU) -#define PWM_VAL3_VAL3_SHIFT (0U) -/*! VAL3 - Value 3 */ -#define PWM_VAL3_VAL3(x) (((uint16_t)(((uint16_t)(x)) << PWM_VAL3_VAL3_SHIFT)) & PWM_VAL3_VAL3_MASK) -/*! @} */ - -/* The count of PWM_VAL3 */ -#define PWM_VAL3_COUNT (3U) - -/*! @name VAL4 - Value Register 4 */ -/*! @{ */ - -#define PWM_VAL4_VAL4_MASK (0xFFFFU) -#define PWM_VAL4_VAL4_SHIFT (0U) -/*! VAL4 - Value 4 */ -#define PWM_VAL4_VAL4(x) (((uint16_t)(((uint16_t)(x)) << PWM_VAL4_VAL4_SHIFT)) & PWM_VAL4_VAL4_MASK) -/*! @} */ - -/* The count of PWM_VAL4 */ -#define PWM_VAL4_COUNT (3U) - -/*! @name VAL5 - Value Register 5 */ -/*! @{ */ - -#define PWM_VAL5_VAL5_MASK (0xFFFFU) -#define PWM_VAL5_VAL5_SHIFT (0U) -/*! VAL5 - Value 5 */ -#define PWM_VAL5_VAL5(x) (((uint16_t)(((uint16_t)(x)) << PWM_VAL5_VAL5_SHIFT)) & PWM_VAL5_VAL5_MASK) -/*! @} */ - -/* The count of PWM_VAL5 */ -#define PWM_VAL5_COUNT (3U) - -/*! @name OCTRL - Output Control Register */ -/*! @{ */ - -#define PWM_OCTRL_PWMXFS_MASK (0x3U) -#define PWM_OCTRL_PWMXFS_SHIFT (0U) -/*! PWMXFS - PWM_X Fault State - * 0b00..Output is forced to logic 0 state prior to consideration of output polarity control. - * 0b01..Output is forced to logic 1 state prior to consideration of output polarity control. - * 0b10, 0b11..Output is put in a high-impedance state. - */ -#define PWM_OCTRL_PWMXFS(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_PWMXFS_SHIFT)) & PWM_OCTRL_PWMXFS_MASK) - -#define PWM_OCTRL_PWMBFS_MASK (0xCU) -#define PWM_OCTRL_PWMBFS_SHIFT (2U) -/*! PWMBFS - PWM_B Fault State - * 0b00..Output is forced to logic 0 state prior to consideration of output polarity control. - * 0b01..Output is forced to logic 1 state prior to consideration of output polarity control. - * 0b10, 0b11..Output is put in a high-impedance state. - */ -#define PWM_OCTRL_PWMBFS(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_PWMBFS_SHIFT)) & PWM_OCTRL_PWMBFS_MASK) - -#define PWM_OCTRL_PWMAFS_MASK (0x30U) -#define PWM_OCTRL_PWMAFS_SHIFT (4U) -/*! PWMAFS - PWM_A Fault State - * 0b00..Output is forced to logic 0 state prior to consideration of output polarity control. - * 0b01..Output is forced to logic 1 state prior to consideration of output polarity control. - * 0b10, 0b11..Output is put in a high-impedance state. - */ -#define PWM_OCTRL_PWMAFS(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_PWMAFS_SHIFT)) & PWM_OCTRL_PWMAFS_MASK) - -#define PWM_OCTRL_POLX_MASK (0x100U) -#define PWM_OCTRL_POLX_SHIFT (8U) -/*! POLX - PWM_X Output Polarity - * 0b0..PWM_X output not inverted. A high level on the PWM_X pin represents the "on" or "active" state. - * 0b1..PWM_X output inverted. A low level on the PWM_X pin represents the "on" or "active" state. - */ -#define PWM_OCTRL_POLX(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_POLX_SHIFT)) & PWM_OCTRL_POLX_MASK) - -#define PWM_OCTRL_POLB_MASK (0x200U) -#define PWM_OCTRL_POLB_SHIFT (9U) -/*! POLB - PWM_B Output Polarity - * 0b0..PWM_B output not inverted. A high level on the PWM_B pin represents the "on" or "active" state. - * 0b1..PWM_B output inverted. A low level on the PWM_B pin represents the "on" or "active" state. - */ -#define PWM_OCTRL_POLB(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_POLB_SHIFT)) & PWM_OCTRL_POLB_MASK) - -#define PWM_OCTRL_POLA_MASK (0x400U) -#define PWM_OCTRL_POLA_SHIFT (10U) -/*! POLA - PWM_A Output Polarity - * 0b0..PWM_A output not inverted. A high level on the PWM_A pin represents the "on" or "active" state. - * 0b1..PWM_A output inverted. A low level on the PWM_A pin represents the "on" or "active" state. - */ -#define PWM_OCTRL_POLA(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_POLA_SHIFT)) & PWM_OCTRL_POLA_MASK) - -#define PWM_OCTRL_PWMX_IN_MASK (0x2000U) -#define PWM_OCTRL_PWMX_IN_SHIFT (13U) -/*! PWMX_IN - PWM_X Input */ -#define PWM_OCTRL_PWMX_IN(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_PWMX_IN_SHIFT)) & PWM_OCTRL_PWMX_IN_MASK) - -#define PWM_OCTRL_PWMB_IN_MASK (0x4000U) -#define PWM_OCTRL_PWMB_IN_SHIFT (14U) -/*! PWMB_IN - PWM_B Input */ -#define PWM_OCTRL_PWMB_IN(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_PWMB_IN_SHIFT)) & PWM_OCTRL_PWMB_IN_MASK) - -#define PWM_OCTRL_PWMA_IN_MASK (0x8000U) -#define PWM_OCTRL_PWMA_IN_SHIFT (15U) -/*! PWMA_IN - PWM_A Input */ -#define PWM_OCTRL_PWMA_IN(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_PWMA_IN_SHIFT)) & PWM_OCTRL_PWMA_IN_MASK) -/*! @} */ - -/* The count of PWM_OCTRL */ -#define PWM_OCTRL_COUNT (3U) - -/*! @name STS - Status Register */ -/*! @{ */ - -#define PWM_STS_CMPF_MASK (0x3FU) -#define PWM_STS_CMPF_SHIFT (0U) -/*! CMPF - Compare Flags - * 0b000000..No compare event has occurred for a particular VALx value. - * 0b000001..A compare event has occurred for a particular VALx value. - */ -#define PWM_STS_CMPF(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_CMPF_SHIFT)) & PWM_STS_CMPF_MASK) - -#define PWM_STS_CFX0_MASK (0x40U) -#define PWM_STS_CFX0_SHIFT (6U) -/*! CFX0 - Capture Flag X0 */ -#define PWM_STS_CFX0(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_CFX0_SHIFT)) & PWM_STS_CFX0_MASK) - -#define PWM_STS_CFX1_MASK (0x80U) -#define PWM_STS_CFX1_SHIFT (7U) -/*! CFX1 - Capture Flag X1 */ -#define PWM_STS_CFX1(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_CFX1_SHIFT)) & PWM_STS_CFX1_MASK) - -#define PWM_STS_RF_MASK (0x1000U) -#define PWM_STS_RF_SHIFT (12U) -/*! RF - Reload Flag - * 0b0..No new reload cycle since last STS[RF] clearing - * 0b1..New reload cycle since last STS[RF] clearing - */ -#define PWM_STS_RF(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_RF_SHIFT)) & PWM_STS_RF_MASK) - -#define PWM_STS_REF_MASK (0x2000U) -#define PWM_STS_REF_SHIFT (13U) -/*! REF - Reload Error Flag - * 0b0..No reload error occurred. - * 0b1..Reload signal occurred with non-coherent data and MCTRL[LDOK] = 0. - */ -#define PWM_STS_REF(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_REF_SHIFT)) & PWM_STS_REF_MASK) - -#define PWM_STS_RUF_MASK (0x4000U) -#define PWM_STS_RUF_SHIFT (14U) -/*! RUF - Registers Updated Flag - * 0b0..No register update has occurred since last reload. - * 0b1..At least one of the double buffered registers has been updated since the last reload. - */ -#define PWM_STS_RUF(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_RUF_SHIFT)) & PWM_STS_RUF_MASK) -/*! @} */ - -/* The count of PWM_STS */ -#define PWM_STS_COUNT (3U) - -/*! @name INTEN - Interrupt Enable Register */ -/*! @{ */ - -#define PWM_INTEN_CMPIE_MASK (0x3FU) -#define PWM_INTEN_CMPIE_SHIFT (0U) -/*! CMPIE - Compare Interrupt Enables - * 0b000000..The corresponding STS[CMPF] bit will not cause an interrupt request. - * 0b000001..The corresponding STS[CMPF] bit will cause an interrupt request. - */ -#define PWM_INTEN_CMPIE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_CMPIE_SHIFT)) & PWM_INTEN_CMPIE_MASK) - -#define PWM_INTEN_CX0IE_MASK (0x40U) -#define PWM_INTEN_CX0IE_SHIFT (6U) -/*! CX0IE - Capture X 0 Interrupt Enable - * 0b0..Interrupt request disabled for STS[CFX0]. - * 0b1..Interrupt request enabled for STS[CFX0]. - */ -#define PWM_INTEN_CX0IE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_CX0IE_SHIFT)) & PWM_INTEN_CX0IE_MASK) - -#define PWM_INTEN_CX1IE_MASK (0x80U) -#define PWM_INTEN_CX1IE_SHIFT (7U) -/*! CX1IE - Capture X 1 Interrupt Enable - * 0b0..Interrupt request disabled for STS[CFX1]. - * 0b1..Interrupt request enabled for STS[CFX1]. - */ -#define PWM_INTEN_CX1IE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_CX1IE_SHIFT)) & PWM_INTEN_CX1IE_MASK) - -#define PWM_INTEN_RIE_MASK (0x1000U) -#define PWM_INTEN_RIE_SHIFT (12U) -/*! RIE - Reload Interrupt Enable - * 0b0..STS[RF] CPU interrupt requests disabled - * 0b1..STS[RF] CPU interrupt requests enabled - */ -#define PWM_INTEN_RIE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_RIE_SHIFT)) & PWM_INTEN_RIE_MASK) - -#define PWM_INTEN_REIE_MASK (0x2000U) -#define PWM_INTEN_REIE_SHIFT (13U) -/*! REIE - Reload Error Interrupt Enable - * 0b0..STS[REF] CPU interrupt requests disabled - * 0b1..STS[REF] CPU interrupt requests enabled - */ -#define PWM_INTEN_REIE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_REIE_SHIFT)) & PWM_INTEN_REIE_MASK) -/*! @} */ - -/* The count of PWM_INTEN */ -#define PWM_INTEN_COUNT (3U) - -/*! @name DMAEN - DMA Enable Register */ -/*! @{ */ - -#define PWM_DMAEN_CX0DE_MASK (0x1U) -#define PWM_DMAEN_CX0DE_SHIFT (0U) -/*! CX0DE - Capture X0 FIFO DMA Enable */ -#define PWM_DMAEN_CX0DE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_CX0DE_SHIFT)) & PWM_DMAEN_CX0DE_MASK) - -#define PWM_DMAEN_CX1DE_MASK (0x2U) -#define PWM_DMAEN_CX1DE_SHIFT (1U) -/*! CX1DE - Capture X1 FIFO DMA Enable */ -#define PWM_DMAEN_CX1DE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_CX1DE_SHIFT)) & PWM_DMAEN_CX1DE_MASK) - -#define PWM_DMAEN_CAPTDE_MASK (0xC0U) -#define PWM_DMAEN_CAPTDE_SHIFT (6U) -/*! CAPTDE - Capture DMA Enable Source Select - * 0b00..Read DMA requests disabled. - * 0b01..Exceeding a FIFO watermark sets the DMA read request. This requires at least one of DMAEN[CA1DE], - * DMAEN[CA0DE], DMAEN[CB1DE], DMAEN[CB0DE], DMAEN[CX1DE], or DMAEN[CX0DE] to be set to determine which - * watermark(s) the DMA request is sensitive. - * 0b10..A local synchronization (VAL1 matches counter) sets the read DMA request. - * 0b11..A local reload (STS[RF] being set) sets the read DMA request. - */ -#define PWM_DMAEN_CAPTDE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_CAPTDE_SHIFT)) & PWM_DMAEN_CAPTDE_MASK) - -#define PWM_DMAEN_FAND_MASK (0x100U) -#define PWM_DMAEN_FAND_SHIFT (8U) -/*! FAND - FIFO Watermark AND Control - * 0b0..Selected FIFO watermarks are OR'ed together. - * 0b1..Selected FIFO watermarks are AND'ed together. - */ -#define PWM_DMAEN_FAND(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_FAND_SHIFT)) & PWM_DMAEN_FAND_MASK) - -#define PWM_DMAEN_VALDE_MASK (0x200U) -#define PWM_DMAEN_VALDE_SHIFT (9U) -/*! VALDE - Value Registers DMA Enable - * 0b0..DMA write requests disabled - * 0b1..Enabled - */ -#define PWM_DMAEN_VALDE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_VALDE_SHIFT)) & PWM_DMAEN_VALDE_MASK) -/*! @} */ - -/* The count of PWM_DMAEN */ -#define PWM_DMAEN_COUNT (3U) - -/*! @name TCTRL - Output Trigger Control Register */ -/*! @{ */ - -#define PWM_TCTRL_OUT_TRIG_EN_MASK (0x3FU) -#define PWM_TCTRL_OUT_TRIG_EN_SHIFT (0U) -/*! OUT_TRIG_EN - Output Trigger Enables - * 0bxxxxx1..PWM_OUT_TRIG0 will set when the counter value matches the VAL0 value. - * 0bxxxx1x..PWM_OUT_TRIG1 will set when the counter value matches the VAL1 value. - * 0bxxx1xx..PWM_OUT_TRIG0 will set when the counter value matches the VAL2 value. - * 0bxx1xxx..PWM_OUT_TRIG1 will set when the counter value matches the VAL3 value. - * 0bx1xxxx..PWM_OUT_TRIG0 will set when the counter value matches the VAL4 value. - * 0b1xxxxx..PWM_OUT_TRIG1 will set when the counter value matches the VAL5 value. - */ -#define PWM_TCTRL_OUT_TRIG_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_TCTRL_OUT_TRIG_EN_SHIFT)) & PWM_TCTRL_OUT_TRIG_EN_MASK) - -#define PWM_TCTRL_TRGFRQ_MASK (0x1000U) -#define PWM_TCTRL_TRGFRQ_SHIFT (12U) -/*! TRGFRQ - Trigger Frequency - * 0b0..Trigger outputs are generated during every PWM period even if the PWM is not reloaded every period due to CTRL[LDFQ] being non-zero. - * 0b1..Trigger outputs are generated only during the final PWM period prior to a reload opportunity when the PWM - * is not reloaded every period due to CTRL[LDFQ] being non-zero. - */ -#define PWM_TCTRL_TRGFRQ(x) (((uint16_t)(((uint16_t)(x)) << PWM_TCTRL_TRGFRQ_SHIFT)) & PWM_TCTRL_TRGFRQ_MASK) - -#define PWM_TCTRL_PWBOT1_MASK (0x4000U) -#define PWM_TCTRL_PWBOT1_SHIFT (14U) -/*! PWBOT1 - Mux Output Trigger 1 Source Select - * 0b0..Route the PWM_OUT_TRIG1 signal to PWM_MUX_TRIG1 port. - * 0b1..Route the PWM_B output to the PWM_MUX_TRIG1 port. - */ -#define PWM_TCTRL_PWBOT1(x) (((uint16_t)(((uint16_t)(x)) << PWM_TCTRL_PWBOT1_SHIFT)) & PWM_TCTRL_PWBOT1_MASK) - -#define PWM_TCTRL_PWAOT0_MASK (0x8000U) -#define PWM_TCTRL_PWAOT0_SHIFT (15U) -/*! PWAOT0 - Mux Output Trigger 0 Source Select - * 0b0..Route the PWM_OUT_TRIG0 signal to PWM_MUX_TRIG0 port. - * 0b1..Route the PWM_A output to the PWM_MUX_TRIG0 port. - */ -#define PWM_TCTRL_PWAOT0(x) (((uint16_t)(((uint16_t)(x)) << PWM_TCTRL_PWAOT0_SHIFT)) & PWM_TCTRL_PWAOT0_MASK) -/*! @} */ - -/* The count of PWM_TCTRL */ -#define PWM_TCTRL_COUNT (3U) - -/*! @name DISMAP - Fault Disable Mapping Register 0 */ -/*! @{ */ - -#define PWM_DISMAP_DIS0A_MASK (0xFU) -#define PWM_DISMAP_DIS0A_SHIFT (0U) -/*! DIS0A - PWM_A Fault Disable Mask 0 */ -#define PWM_DISMAP_DIS0A(x) (((uint16_t)(((uint16_t)(x)) << PWM_DISMAP_DIS0A_SHIFT)) & PWM_DISMAP_DIS0A_MASK) - -#define PWM_DISMAP_DIS0B_MASK (0xF0U) -#define PWM_DISMAP_DIS0B_SHIFT (4U) -/*! DIS0B - PWM_B Fault Disable Mask 0 */ -#define PWM_DISMAP_DIS0B(x) (((uint16_t)(((uint16_t)(x)) << PWM_DISMAP_DIS0B_SHIFT)) & PWM_DISMAP_DIS0B_MASK) - -#define PWM_DISMAP_DIS0X_MASK (0xF00U) -#define PWM_DISMAP_DIS0X_SHIFT (8U) -/*! DIS0X - PWM_X Fault Disable Mask 0 */ -#define PWM_DISMAP_DIS0X(x) (((uint16_t)(((uint16_t)(x)) << PWM_DISMAP_DIS0X_SHIFT)) & PWM_DISMAP_DIS0X_MASK) -/*! @} */ - -/* The count of PWM_DISMAP */ -#define PWM_DISMAP_COUNT (3U) - -/* The count of PWM_DISMAP */ -#define PWM_DISMAP_COUNT2 (1U) - -/*! @name DTCNT0 - Deadtime Count Register 0 */ -/*! @{ */ - -#define PWM_DTCNT0_DTCNT0_MASK (0x7FFU) -#define PWM_DTCNT0_DTCNT0_SHIFT (0U) -/*! DTCNT0 - Deadtime Count Register 0 */ -#define PWM_DTCNT0_DTCNT0(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTCNT0_DTCNT0_SHIFT)) & PWM_DTCNT0_DTCNT0_MASK) -/*! @} */ - -/* The count of PWM_DTCNT0 */ -#define PWM_DTCNT0_COUNT (3U) - -/*! @name DTCNT1 - Deadtime Count Register 1 */ -/*! @{ */ - -#define PWM_DTCNT1_DTCNT1_MASK (0x7FFU) -#define PWM_DTCNT1_DTCNT1_SHIFT (0U) -/*! DTCNT1 - Deadtime Count Register 1 */ -#define PWM_DTCNT1_DTCNT1(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTCNT1_DTCNT1_SHIFT)) & PWM_DTCNT1_DTCNT1_MASK) -/*! @} */ - -/* The count of PWM_DTCNT1 */ -#define PWM_DTCNT1_COUNT (3U) - -/*! @name CAPTCTRLX - Capture Control X Register */ -/*! @{ */ - -#define PWM_CAPTCTRLX_ARMX_MASK (0x1U) -#define PWM_CAPTCTRLX_ARMX_SHIFT (0U) -/*! ARMX - Arm X - * 0b0..Input capture operation is disabled. - * 0b1..Input capture operation as specified by CAPTCTRLX[EDGXx] is enabled. - */ -#define PWM_CAPTCTRLX_ARMX(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_ARMX_SHIFT)) & PWM_CAPTCTRLX_ARMX_MASK) - -#define PWM_CAPTCTRLX_ONESHOTX_MASK (0x2U) -#define PWM_CAPTCTRLX_ONESHOTX_SHIFT (1U) -/*! ONESHOTX - One Shot Mode Aux - * 0b0..Free Running - * 0b1..One Shot - */ -#define PWM_CAPTCTRLX_ONESHOTX(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_ONESHOTX_SHIFT)) & PWM_CAPTCTRLX_ONESHOTX_MASK) - -#define PWM_CAPTCTRLX_EDGX0_MASK (0xCU) -#define PWM_CAPTCTRLX_EDGX0_SHIFT (2U) -/*! EDGX0 - Edge X 0 - * 0b00..Disabled - * 0b01..Capture falling edges - * 0b10..Capture rising edges - * 0b11..Capture any edge - */ -#define PWM_CAPTCTRLX_EDGX0(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_EDGX0_SHIFT)) & PWM_CAPTCTRLX_EDGX0_MASK) - -#define PWM_CAPTCTRLX_EDGX1_MASK (0x30U) -#define PWM_CAPTCTRLX_EDGX1_SHIFT (4U) -/*! EDGX1 - Edge X 1 - * 0b00..Disabled - * 0b01..Capture falling edges - * 0b10..Capture rising edges - * 0b11..Capture any edge - */ -#define PWM_CAPTCTRLX_EDGX1(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_EDGX1_SHIFT)) & PWM_CAPTCTRLX_EDGX1_MASK) - -#define PWM_CAPTCTRLX_INP_SELX_MASK (0x40U) -#define PWM_CAPTCTRLX_INP_SELX_SHIFT (6U) -/*! INP_SELX - Input Select X - * 0b0..Raw PWM_X input signal selected as source. - * 0b1..Edge Counter - */ -#define PWM_CAPTCTRLX_INP_SELX(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_INP_SELX_SHIFT)) & PWM_CAPTCTRLX_INP_SELX_MASK) - -#define PWM_CAPTCTRLX_EDGCNTX_EN_MASK (0x80U) -#define PWM_CAPTCTRLX_EDGCNTX_EN_SHIFT (7U) -/*! EDGCNTX_EN - Edge Counter X Enable - * 0b0..Edge counter disabled and held in reset - * 0b1..Edge counter enabled - */ -#define PWM_CAPTCTRLX_EDGCNTX_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_EDGCNTX_EN_SHIFT)) & PWM_CAPTCTRLX_EDGCNTX_EN_MASK) - -#define PWM_CAPTCTRLX_CFXWM_MASK (0x300U) -#define PWM_CAPTCTRLX_CFXWM_SHIFT (8U) -/*! CFXWM - Capture X FIFOs Water Mark */ -#define PWM_CAPTCTRLX_CFXWM(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_CFXWM_SHIFT)) & PWM_CAPTCTRLX_CFXWM_MASK) - -#define PWM_CAPTCTRLX_CX0CNT_MASK (0x1C00U) -#define PWM_CAPTCTRLX_CX0CNT_SHIFT (10U) -/*! CX0CNT - Capture X0 FIFO Word Count */ -#define PWM_CAPTCTRLX_CX0CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_CX0CNT_SHIFT)) & PWM_CAPTCTRLX_CX0CNT_MASK) - -#define PWM_CAPTCTRLX_CX1CNT_MASK (0xE000U) -#define PWM_CAPTCTRLX_CX1CNT_SHIFT (13U) -/*! CX1CNT - Capture X1 FIFO Word Count */ -#define PWM_CAPTCTRLX_CX1CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_CX1CNT_SHIFT)) & PWM_CAPTCTRLX_CX1CNT_MASK) -/*! @} */ - -/* The count of PWM_CAPTCTRLX */ -#define PWM_CAPTCTRLX_COUNT (3U) - -/*! @name CAPTCOMPX - Capture Compare X Register */ -/*! @{ */ - -#define PWM_CAPTCOMPX_EDGCMPX_MASK (0xFFU) -#define PWM_CAPTCOMPX_EDGCMPX_SHIFT (0U) -/*! EDGCMPX - Edge Compare X */ -#define PWM_CAPTCOMPX_EDGCMPX(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCOMPX_EDGCMPX_SHIFT)) & PWM_CAPTCOMPX_EDGCMPX_MASK) - -#define PWM_CAPTCOMPX_EDGCNTX_MASK (0xFF00U) -#define PWM_CAPTCOMPX_EDGCNTX_SHIFT (8U) -/*! EDGCNTX - Edge Counter X */ -#define PWM_CAPTCOMPX_EDGCNTX(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCOMPX_EDGCNTX_SHIFT)) & PWM_CAPTCOMPX_EDGCNTX_MASK) -/*! @} */ - -/* The count of PWM_CAPTCOMPX */ -#define PWM_CAPTCOMPX_COUNT (3U) - -/*! @name CVAL0 - Capture Value 0 Register */ -/*! @{ */ - -#define PWM_CVAL0_CAPTVAL0_MASK (0xFFFFU) -#define PWM_CVAL0_CAPTVAL0_SHIFT (0U) -/*! CAPTVAL0 - Capture Value 0 */ -#define PWM_CVAL0_CAPTVAL0(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL0_CAPTVAL0_SHIFT)) & PWM_CVAL0_CAPTVAL0_MASK) -/*! @} */ - -/* The count of PWM_CVAL0 */ -#define PWM_CVAL0_COUNT (3U) - -/*! @name CVAL0CYC - Capture Value 0 Cycle Register */ -/*! @{ */ - -#define PWM_CVAL0CYC_CVAL0CYC_MASK (0xFU) -#define PWM_CVAL0CYC_CVAL0CYC_SHIFT (0U) -/*! CVAL0CYC - Capture Value 0 Cycle */ -#define PWM_CVAL0CYC_CVAL0CYC(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL0CYC_CVAL0CYC_SHIFT)) & PWM_CVAL0CYC_CVAL0CYC_MASK) -/*! @} */ - -/* The count of PWM_CVAL0CYC */ -#define PWM_CVAL0CYC_COUNT (3U) - -/*! @name CVAL1 - Capture Value 1 Register */ -/*! @{ */ - -#define PWM_CVAL1_CAPTVAL1_MASK (0xFFFFU) -#define PWM_CVAL1_CAPTVAL1_SHIFT (0U) -/*! CAPTVAL1 - Capture Value 1 */ -#define PWM_CVAL1_CAPTVAL1(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL1_CAPTVAL1_SHIFT)) & PWM_CVAL1_CAPTVAL1_MASK) -/*! @} */ - -/* The count of PWM_CVAL1 */ -#define PWM_CVAL1_COUNT (3U) - -/*! @name CVAL1CYC - Capture Value 1 Cycle Register */ -/*! @{ */ - -#define PWM_CVAL1CYC_CVAL1CYC_MASK (0xFU) -#define PWM_CVAL1CYC_CVAL1CYC_SHIFT (0U) -/*! CVAL1CYC - Capture Value 1 Cycle */ -#define PWM_CVAL1CYC_CVAL1CYC(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL1CYC_CVAL1CYC_SHIFT)) & PWM_CVAL1CYC_CVAL1CYC_MASK) -/*! @} */ - -/* The count of PWM_CVAL1CYC */ -#define PWM_CVAL1CYC_COUNT (3U) - -/*! @name PHASEDLY - Phase Delay Register */ -/*! @{ */ - -#define PWM_PHASEDLY_PHASEDLY_MASK (0xFFFFU) -#define PWM_PHASEDLY_PHASEDLY_SHIFT (0U) -/*! PHASEDLY - Initial Count Register Bits */ -#define PWM_PHASEDLY_PHASEDLY(x) (((uint16_t)(((uint16_t)(x)) << PWM_PHASEDLY_PHASEDLY_SHIFT)) & PWM_PHASEDLY_PHASEDLY_MASK) -/*! @} */ - -/* The count of PWM_PHASEDLY */ -#define PWM_PHASEDLY_COUNT (3U) - -/*! @name CAPTFILTX - Capture PWM_X Input Filter Register */ -/*! @{ */ - -#define PWM_CAPTFILTX_CAPTX_FILT_PER_MASK (0xFFU) -#define PWM_CAPTFILTX_CAPTX_FILT_PER_SHIFT (0U) -/*! CAPTX_FILT_PER - Input Capture Filter Period */ -#define PWM_CAPTFILTX_CAPTX_FILT_PER(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTFILTX_CAPTX_FILT_PER_SHIFT)) & PWM_CAPTFILTX_CAPTX_FILT_PER_MASK) - -#define PWM_CAPTFILTX_CAPTX_FILT_CNT_MASK (0x700U) -#define PWM_CAPTFILTX_CAPTX_FILT_CNT_SHIFT (8U) -/*! CAPTX_FILT_CNT - Input Capture Filter Count */ -#define PWM_CAPTFILTX_CAPTX_FILT_CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTFILTX_CAPTX_FILT_CNT_SHIFT)) & PWM_CAPTFILTX_CAPTX_FILT_CNT_MASK) -/*! @} */ - -/* The count of PWM_CAPTFILTX */ -#define PWM_CAPTFILTX_COUNT (3U) - -/*! @name OUTEN - Output Enable Register */ -/*! @{ */ - -#define PWM_OUTEN_PWMX_EN_MASK (0x7U) -#define PWM_OUTEN_PWMX_EN_SHIFT (0U) -/*! PWMX_EN - PWM_X Output Enables */ -#define PWM_OUTEN_PWMX_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_OUTEN_PWMX_EN_SHIFT)) & PWM_OUTEN_PWMX_EN_MASK) - -#define PWM_OUTEN_PWMB_EN_MASK (0x70U) -#define PWM_OUTEN_PWMB_EN_SHIFT (4U) -/*! PWMB_EN - PWM_B Output Enables */ -#define PWM_OUTEN_PWMB_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_OUTEN_PWMB_EN_SHIFT)) & PWM_OUTEN_PWMB_EN_MASK) - -#define PWM_OUTEN_PWMA_EN_MASK (0x700U) -#define PWM_OUTEN_PWMA_EN_SHIFT (8U) -/*! PWMA_EN - PWM_A Output Enables */ -#define PWM_OUTEN_PWMA_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_OUTEN_PWMA_EN_SHIFT)) & PWM_OUTEN_PWMA_EN_MASK) -/*! @} */ - -/*! @name MASK - Mask Register */ -/*! @{ */ - -#define PWM_MASK_MASKX_MASK (0x7U) -#define PWM_MASK_MASKX_SHIFT (0U) -/*! MASKX - PWM_X Masks */ -#define PWM_MASK_MASKX(x) (((uint16_t)(((uint16_t)(x)) << PWM_MASK_MASKX_SHIFT)) & PWM_MASK_MASKX_MASK) - -#define PWM_MASK_MASKB_MASK (0x70U) -#define PWM_MASK_MASKB_SHIFT (4U) -/*! MASKB - PWM_B Masks */ -#define PWM_MASK_MASKB(x) (((uint16_t)(((uint16_t)(x)) << PWM_MASK_MASKB_SHIFT)) & PWM_MASK_MASKB_MASK) - -#define PWM_MASK_MASKA_MASK (0x700U) -#define PWM_MASK_MASKA_SHIFT (8U) -/*! MASKA - PWM_A Masks */ -#define PWM_MASK_MASKA(x) (((uint16_t)(((uint16_t)(x)) << PWM_MASK_MASKA_SHIFT)) & PWM_MASK_MASKA_MASK) - -#define PWM_MASK_UPDATE_MASK_MASK (0x7000U) -#define PWM_MASK_UPDATE_MASK_SHIFT (12U) -/*! UPDATE_MASK - Update Mask Bits Immediately */ -#define PWM_MASK_UPDATE_MASK(x) (((uint16_t)(((uint16_t)(x)) << PWM_MASK_UPDATE_MASK_SHIFT)) & PWM_MASK_UPDATE_MASK_MASK) -/*! @} */ - -/*! @name SWCOUT - Software Controlled Output Register */ -/*! @{ */ - -#define PWM_SWCOUT_SM0OUT45_MASK (0x1U) -#define PWM_SWCOUT_SM0OUT45_SHIFT (0U) -/*! SM0OUT45 - Submodule 0 Software Controlled Output 45 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 0 instead of PWM45. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 0 instead of PWM45. - */ -#define PWM_SWCOUT_SM0OUT45(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM0OUT45_SHIFT)) & PWM_SWCOUT_SM0OUT45_MASK) - -#define PWM_SWCOUT_SM0OUT23_MASK (0x2U) -#define PWM_SWCOUT_SM0OUT23_SHIFT (1U) -/*! SM0OUT23 - Submodule 0 Software Controlled Output 23 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 0 instead of PWM23. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 0 instead of PWM23. - */ -#define PWM_SWCOUT_SM0OUT23(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM0OUT23_SHIFT)) & PWM_SWCOUT_SM0OUT23_MASK) - -#define PWM_SWCOUT_SM1OUT45_MASK (0x4U) -#define PWM_SWCOUT_SM1OUT45_SHIFT (2U) -/*! SM1OUT45 - Submodule 1 Software Controlled Output 45 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 1 instead of PWM45. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 1 instead of PWM45. - */ -#define PWM_SWCOUT_SM1OUT45(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM1OUT45_SHIFT)) & PWM_SWCOUT_SM1OUT45_MASK) - -#define PWM_SWCOUT_SM1OUT23_MASK (0x8U) -#define PWM_SWCOUT_SM1OUT23_SHIFT (3U) -/*! SM1OUT23 - Submodule 1 Software Controlled Output 23 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 1 instead of PWM23. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 1 instead of PWM23. - */ -#define PWM_SWCOUT_SM1OUT23(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM1OUT23_SHIFT)) & PWM_SWCOUT_SM1OUT23_MASK) - -#define PWM_SWCOUT_SM2OUT45_MASK (0x10U) -#define PWM_SWCOUT_SM2OUT45_SHIFT (4U) -/*! SM2OUT45 - Submodule 2 Software Controlled Output 45 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 2 instead of PWM45. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 2 instead of PWM45. - */ -#define PWM_SWCOUT_SM2OUT45(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM2OUT45_SHIFT)) & PWM_SWCOUT_SM2OUT45_MASK) - -#define PWM_SWCOUT_SM2OUT23_MASK (0x20U) -#define PWM_SWCOUT_SM2OUT23_SHIFT (5U) -/*! SM2OUT23 - Submodule 2 Software Controlled Output 23 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 2 instead of PWM23. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 2 instead of PWM23. - */ -#define PWM_SWCOUT_SM2OUT23(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM2OUT23_SHIFT)) & PWM_SWCOUT_SM2OUT23_MASK) -/*! @} */ - -/*! @name DTSRCSEL - PWM Source Select Register */ -/*! @{ */ - -#define PWM_DTSRCSEL_SM0SEL45_MASK (0x3U) -#define PWM_DTSRCSEL_SM0SEL45_SHIFT (0U) -/*! SM0SEL45 - Submodule 0 PWM45 Control Select - * 0b00..Generated SM0PWM45 signal used by the deadtime logic. - * 0b01..Inverted generated SM0PWM45 signal used by the deadtime logic. - * 0b10..SWCOUT[SM0OUT45] used by the deadtime logic. - * 0b11..Reserved - */ -#define PWM_DTSRCSEL_SM0SEL45(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM0SEL45_SHIFT)) & PWM_DTSRCSEL_SM0SEL45_MASK) - -#define PWM_DTSRCSEL_SM0SEL23_MASK (0xCU) -#define PWM_DTSRCSEL_SM0SEL23_SHIFT (2U) -/*! SM0SEL23 - Submodule 0 PWM23 Control Select - * 0b00..Generated SM0PWM23 signal used by the deadtime logic. - * 0b01..Inverted generated SM0PWM23 signal used by the deadtime logic. - * 0b10..SWCOUT[SM0OUT23] used by the deadtime logic. - * 0b11..PWM0_EXTA signal used by the deadtime logic. - */ -#define PWM_DTSRCSEL_SM0SEL23(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM0SEL23_SHIFT)) & PWM_DTSRCSEL_SM0SEL23_MASK) - -#define PWM_DTSRCSEL_SM1SEL45_MASK (0x30U) -#define PWM_DTSRCSEL_SM1SEL45_SHIFT (4U) -/*! SM1SEL45 - Submodule 1 PWM45 Control Select - * 0b00..Generated SM1PWM45 signal used by the deadtime logic. - * 0b01..Inverted generated SM1PWM45 signal used by the deadtime logic. - * 0b10..SWCOUT[SM1OUT45] used by the deadtime logic. - * 0b11..Reserved - */ -#define PWM_DTSRCSEL_SM1SEL45(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM1SEL45_SHIFT)) & PWM_DTSRCSEL_SM1SEL45_MASK) - -#define PWM_DTSRCSEL_SM1SEL23_MASK (0xC0U) -#define PWM_DTSRCSEL_SM1SEL23_SHIFT (6U) -/*! SM1SEL23 - Submodule 1 PWM23 Control Select - * 0b00..Generated SM1PWM23 signal used by the deadtime logic. - * 0b01..Inverted generated SM1PWM23 signal used by the deadtime logic. - * 0b10..SWCOUT[SM1OUT23] used by the deadtime logic. - * 0b11..PWM1_EXTA signal used by the deadtime logic. - */ -#define PWM_DTSRCSEL_SM1SEL23(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM1SEL23_SHIFT)) & PWM_DTSRCSEL_SM1SEL23_MASK) - -#define PWM_DTSRCSEL_SM2SEL45_MASK (0x300U) -#define PWM_DTSRCSEL_SM2SEL45_SHIFT (8U) -/*! SM2SEL45 - Submodule 2 PWM45 Control Select - * 0b00..Generated SM2PWM45 signal used by the deadtime logic. - * 0b01..Inverted generated SM2PWM45 signal used by the deadtime logic. - * 0b10..SWCOUT[SM2OUT45] used by the deadtime logic. - * 0b11..Reserved - */ -#define PWM_DTSRCSEL_SM2SEL45(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM2SEL45_SHIFT)) & PWM_DTSRCSEL_SM2SEL45_MASK) - -#define PWM_DTSRCSEL_SM2SEL23_MASK (0xC00U) -#define PWM_DTSRCSEL_SM2SEL23_SHIFT (10U) -/*! SM2SEL23 - Submodule 2 PWM23 Control Select - * 0b00..Generated SM2PWM23 signal used by the deadtime logic. - * 0b01..Inverted generated SM2PWM23 signal used by the deadtime logic. - * 0b10..SWCOUT[SM2OUT23] used by the deadtime logic. - * 0b11..PWM2_EXTA signal used by the deadtime logic. - */ -#define PWM_DTSRCSEL_SM2SEL23(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM2SEL23_SHIFT)) & PWM_DTSRCSEL_SM2SEL23_MASK) -/*! @} */ - -/*! @name MCTRL - Master Control Register */ -/*! @{ */ - -#define PWM_MCTRL_LDOK_MASK (0x7U) -#define PWM_MCTRL_LDOK_SHIFT (0U) -/*! LDOK - Load Okay - * 0b000..Do not load new values. - * 0b001..Load prescaler, modulus, and PWM values of the corresponding submodule. - */ -#define PWM_MCTRL_LDOK(x) (((uint16_t)(((uint16_t)(x)) << PWM_MCTRL_LDOK_SHIFT)) & PWM_MCTRL_LDOK_MASK) - -#define PWM_MCTRL_CLDOK_MASK (0x70U) -#define PWM_MCTRL_CLDOK_SHIFT (4U) -/*! CLDOK - Clear Load Okay */ -#define PWM_MCTRL_CLDOK(x) (((uint16_t)(((uint16_t)(x)) << PWM_MCTRL_CLDOK_SHIFT)) & PWM_MCTRL_CLDOK_MASK) - -#define PWM_MCTRL_RUN_MASK (0x700U) -#define PWM_MCTRL_RUN_SHIFT (8U) -/*! RUN - Run - * 0b000..PWM counter is stopped, but PWM outputs hold the current state. - * 0b001..PWM counter is started in the corresponding submodule. - */ -#define PWM_MCTRL_RUN(x) (((uint16_t)(((uint16_t)(x)) << PWM_MCTRL_RUN_SHIFT)) & PWM_MCTRL_RUN_MASK) - -#define PWM_MCTRL_IPOL_MASK (0x7000U) -#define PWM_MCTRL_IPOL_SHIFT (12U) -/*! IPOL - Current Polarity - * 0b000..PWM23 is used to generate complementary PWM pair in the corresponding submodule. - * 0b001..PWM45 is used to generate complementary PWM pair in the corresponding submodule. - */ -#define PWM_MCTRL_IPOL(x) (((uint16_t)(((uint16_t)(x)) << PWM_MCTRL_IPOL_SHIFT)) & PWM_MCTRL_IPOL_MASK) -/*! @} */ - -/*! @name MCTRL2 - Master Control 2 Register */ -/*! @{ */ - -#define PWM_MCTRL2_WRPROT_MASK (0xCU) -#define PWM_MCTRL2_WRPROT_SHIFT (2U) -/*! WRPROT - Write protect - * 0b00..Write protection off (default). - * 0b01..Write protection on. - * 0b10..Write protection off and locked until chip reset. - * 0b11..Write protection on and locked until chip reset. - */ -#define PWM_MCTRL2_WRPROT(x) (((uint16_t)(((uint16_t)(x)) << PWM_MCTRL2_WRPROT_SHIFT)) & PWM_MCTRL2_WRPROT_MASK) - -#define PWM_MCTRL2_STRETCH_CNT_PRSC_MASK (0xC0U) -#define PWM_MCTRL2_STRETCH_CNT_PRSC_SHIFT (6U) -/*! STRETCH_CNT_PRSC - Stretch IPBus clock count prescaler for mux0_trig/mux1_trig/out0_trig/out1_trig/pwma_trig/pwmb_trig - * 0b00..Stretch count is zero, no stretch. - * 0b01..Stretch mux0_trig/mux1_trig/out0_trig/out1_trig/pwma_trig/pwmb_trig for 2 IPBus clock period. - * 0b10..Stretch mux0_trig/mux1_trig/out0_trig/out1_trig/pwma_trig/pwmb_trig for 4 IPBus clock period. - * 0b11..Stretch mux0_trig/mux1_trig/out0_trig/out1_trig/pwma_trig/pwmb_trig for 8 IPBus clock period. - */ -#define PWM_MCTRL2_STRETCH_CNT_PRSC(x) (((uint16_t)(((uint16_t)(x)) << PWM_MCTRL2_STRETCH_CNT_PRSC_SHIFT)) & PWM_MCTRL2_STRETCH_CNT_PRSC_MASK) -/*! @} */ - -/*! @name FCTRL - Fault Control Register */ -/*! @{ */ - -#define PWM_FCTRL_FIE_MASK (0xFU) -#define PWM_FCTRL_FIE_SHIFT (0U) -/*! FIE - Fault Interrupt Enables - * 0b0000..FAULTx CPU interrupt requests disabled. - * 0b0001..FAULTx CPU interrupt requests enabled. - */ -#define PWM_FCTRL_FIE(x) (((uint16_t)(((uint16_t)(x)) << PWM_FCTRL_FIE_SHIFT)) & PWM_FCTRL_FIE_MASK) - -#define PWM_FCTRL_FSAFE_MASK (0xF0U) -#define PWM_FCTRL_FSAFE_SHIFT (4U) -/*! FSAFE - Fault Safety Mode - * 0b0000..Normal mode. PWM outputs disabled by this fault are not enabled until FSTS[FFLAGx] is clear at the - * start of a half cycle or full cycle depending on the states of FSTS[FHALF] and FSTS[FFULL] without regard - * to the state of FSTS[FFPINx]. If neither FHALF nor FFULL is set, then the fault condition cannot be - * cleared. The PWM outputs disabled by this fault input will not be re-enabled until the actual FAULTx input - * signal de-asserts since the fault input will combinationally disable the PWM outputs (as programmed in - * DISMAPn). - * 0b0001..Safe mode. PWM outputs disabled by this fault are not enabled until FSTS[FFLAGx] is clear and - * FSTS[FFPINx] is clear at the start of a half cycle or full cycle depending on the states of FSTS[FHALF] and - * FSTS[FFULL]. If neither FHLAF nor FFULL is set, then the fault condition cannot be cleared. - */ -#define PWM_FCTRL_FSAFE(x) (((uint16_t)(((uint16_t)(x)) << PWM_FCTRL_FSAFE_SHIFT)) & PWM_FCTRL_FSAFE_MASK) - -#define PWM_FCTRL_FAUTO_MASK (0xF00U) -#define PWM_FCTRL_FAUTO_SHIFT (8U) -/*! FAUTO - Automatic Fault Clearing - * 0b0000..Manual fault clearing. PWM outputs disabled by this fault are not enabled until FSTS[FFLAGx] is clear - * at the start of a half cycle or full cycle depending on the states of FSTS[FHALF] and FSTS[FFULL]. If - * neither FFULL nor FHALF is set, then the fault condition cannot be cleared. This is further controlled - * by FCTRL[FSAFE]. - * 0b0001..Automatic fault clearing. PWM outputs disabled by this fault are enabled when FSTS[FFPINx] is clear at - * the start of a half cycle or full cycle depending on the states of FSTS[FHALF] and FSTS[FFULL] without - * regard to the state of FSTS[FFLAGx]. If neither FFULL nor FHALF is set, then the fault condition - * cannot be cleared. - */ -#define PWM_FCTRL_FAUTO(x) (((uint16_t)(((uint16_t)(x)) << PWM_FCTRL_FAUTO_SHIFT)) & PWM_FCTRL_FAUTO_MASK) - -#define PWM_FCTRL_FLVL_MASK (0xF000U) -#define PWM_FCTRL_FLVL_SHIFT (12U) -/*! FLVL - Fault Level - * 0b0000..A logic 0 on the fault input indicates a fault condition. - * 0b0001..A logic 1 on the fault input indicates a fault condition. - */ -#define PWM_FCTRL_FLVL(x) (((uint16_t)(((uint16_t)(x)) << PWM_FCTRL_FLVL_SHIFT)) & PWM_FCTRL_FLVL_MASK) -/*! @} */ - -/*! @name FSTS - Fault Status Register */ -/*! @{ */ - -#define PWM_FSTS_FFLAG_MASK (0xFU) -#define PWM_FSTS_FFLAG_SHIFT (0U) -/*! FFLAG - Fault Flags - * 0b0000..No fault on the FAULTx pin. - * 0b0001..Fault on the FAULTx pin. - */ -#define PWM_FSTS_FFLAG(x) (((uint16_t)(((uint16_t)(x)) << PWM_FSTS_FFLAG_SHIFT)) & PWM_FSTS_FFLAG_MASK) - -#define PWM_FSTS_FFULL_MASK (0xF0U) -#define PWM_FSTS_FFULL_SHIFT (4U) -/*! FFULL - Full Cycle - * 0b0000..PWM outputs are not re-enabled at the start of a full cycle - * 0b0001..PWM outputs are re-enabled at the start of a full cycle - */ -#define PWM_FSTS_FFULL(x) (((uint16_t)(((uint16_t)(x)) << PWM_FSTS_FFULL_SHIFT)) & PWM_FSTS_FFULL_MASK) - -#define PWM_FSTS_FFPIN_MASK (0xF00U) -#define PWM_FSTS_FFPIN_SHIFT (8U) -/*! FFPIN - Filtered Fault Pins */ -#define PWM_FSTS_FFPIN(x) (((uint16_t)(((uint16_t)(x)) << PWM_FSTS_FFPIN_SHIFT)) & PWM_FSTS_FFPIN_MASK) - -#define PWM_FSTS_FHALF_MASK (0xF000U) -#define PWM_FSTS_FHALF_SHIFT (12U) -/*! FHALF - Half Cycle Fault Recovery - * 0b0000..PWM outputs are not re-enabled at the start of a half cycle. - * 0b0001..PWM outputs are re-enabled at the start of a half cycle (as defined by VAL0). - */ -#define PWM_FSTS_FHALF(x) (((uint16_t)(((uint16_t)(x)) << PWM_FSTS_FHALF_SHIFT)) & PWM_FSTS_FHALF_MASK) -/*! @} */ - -/*! @name FFILT - Fault Filter Register */ -/*! @{ */ - -#define PWM_FFILT_FILT_PER_MASK (0xFFU) -#define PWM_FFILT_FILT_PER_SHIFT (0U) -/*! FILT_PER - Fault Filter Period */ -#define PWM_FFILT_FILT_PER(x) (((uint16_t)(((uint16_t)(x)) << PWM_FFILT_FILT_PER_SHIFT)) & PWM_FFILT_FILT_PER_MASK) - -#define PWM_FFILT_FILT_CNT_MASK (0x700U) -#define PWM_FFILT_FILT_CNT_SHIFT (8U) -/*! FILT_CNT - Fault Filter Count */ -#define PWM_FFILT_FILT_CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_FFILT_FILT_CNT_SHIFT)) & PWM_FFILT_FILT_CNT_MASK) - -#define PWM_FFILT_GSTR_MASK (0x8000U) -#define PWM_FFILT_GSTR_SHIFT (15U) -/*! GSTR - Fault Glitch Stretch Enable - * 0b0..Fault input glitch stretching is disabled. - * 0b1..Input fault signals are stretched to at least 2 IPBus clock cycles. - */ -#define PWM_FFILT_GSTR(x) (((uint16_t)(((uint16_t)(x)) << PWM_FFILT_GSTR_SHIFT)) & PWM_FFILT_GSTR_MASK) -/*! @} */ - -/*! @name FTST - Fault Test Register */ -/*! @{ */ - -#define PWM_FTST_FTEST_MASK (0x1U) -#define PWM_FTST_FTEST_SHIFT (0U) -/*! FTEST - Fault Test - * 0b0..No fault - * 0b1..Cause a simulated fault - */ -#define PWM_FTST_FTEST(x) (((uint16_t)(((uint16_t)(x)) << PWM_FTST_FTEST_SHIFT)) & PWM_FTST_FTEST_MASK) -/*! @} */ - -/*! @name FCTRL2 - Fault Control 2 Register */ -/*! @{ */ - -#define PWM_FCTRL2_NOCOMB_MASK (0xFU) -#define PWM_FCTRL2_NOCOMB_SHIFT (0U) -/*! NOCOMB - No Combinational Path From Fault Input To PWM Output - * 0b0000..There is a combinational link from the fault inputs to the PWM outputs. The fault inputs are combined - * with the filtered and latched fault signals to disable the PWM outputs. - * 0b0001..The direct combinational path from the fault inputs to the PWM outputs is disabled and the filtered - * and latched fault signals are used to disable the PWM outputs. - */ -#define PWM_FCTRL2_NOCOMB(x) (((uint16_t)(((uint16_t)(x)) << PWM_FCTRL2_NOCOMB_SHIFT)) & PWM_FCTRL2_NOCOMB_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group PWM_Register_Masks */ - - -/* PWM - Peripheral instance base addresses */ -/** Peripheral FLEXPWM0 base address */ -#define FLEXPWM0_BASE (0x400A9000u) -/** Peripheral FLEXPWM0 base pointer */ -#define FLEXPWM0 ((PWM_Type *)FLEXPWM0_BASE) -/** Peripheral FLEXPWM1 base address */ -#define FLEXPWM1_BASE (0x400AA000u) -/** Peripheral FLEXPWM1 base pointer */ -#define FLEXPWM1 ((PWM_Type *)FLEXPWM1_BASE) -/** Array initializer of PWM peripheral base addresses */ -#define PWM_BASE_ADDRS { FLEXPWM0_BASE, FLEXPWM1_BASE } -/** Array initializer of PWM peripheral base pointers */ -#define PWM_BASE_PTRS { FLEXPWM0, FLEXPWM1 } -/** Interrupt vectors for the PWM peripheral type */ -#define PWM_CMP_IRQS { { FLEXPWM0_SUBMODULE0_IRQn, FLEXPWM0_SUBMODULE1_IRQn, FLEXPWM0_SUBMODULE2_IRQn }, { FLEXPWM1_SUBMODULE0_IRQn, FLEXPWM1_SUBMODULE1_IRQn, FLEXPWM1_SUBMODULE2_IRQn } } -#define PWM_RELOAD_IRQS { { FLEXPWM0_SUBMODULE0_IRQn, FLEXPWM0_SUBMODULE1_IRQn, FLEXPWM0_SUBMODULE2_IRQn }, { FLEXPWM1_SUBMODULE0_IRQn, FLEXPWM1_SUBMODULE1_IRQn, FLEXPWM1_SUBMODULE2_IRQn } } -#define PWM_CAPTURE_IRQS { { FLEXPWM0_SUBMODULE0_IRQn, FLEXPWM0_SUBMODULE1_IRQn, FLEXPWM0_SUBMODULE2_IRQn }, { FLEXPWM1_SUBMODULE0_IRQn, FLEXPWM1_SUBMODULE1_IRQn, FLEXPWM1_SUBMODULE2_IRQn } } -#define PWM_FAULT_IRQS { FLEXPWM0_FAULT_IRQn, FLEXPWM1_FAULT_IRQn } -#define PWM_RELOAD_ERROR_IRQS { FLEXPWM0_RELOAD_ERROR_IRQn, FLEXPWM1_RELOAD_ERROR_IRQn } - -/*! - * @} - */ /* end of group PWM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- SCG Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SCG_Peripheral_Access_Layer SCG Peripheral Access Layer - * @{ - */ - -/** SCG - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID Register, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter Register, offset: 0x4 */ - __IO uint32_t TRIM_LOCK; /**< Trim Lock register, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __I uint32_t CSR; /**< Clock Status Register, offset: 0x10 */ - __IO uint32_t RCCR; /**< Run Clock Control Register, offset: 0x14 */ - uint8_t RESERVED_1[232]; - __IO uint32_t SOSCCSR; /**< SOSC Control Status Register, offset: 0x100 */ - uint8_t RESERVED_2[4]; - __IO uint32_t SOSCCFG; /**< SOSC Configuration Register, offset: 0x108 */ - uint8_t RESERVED_3[244]; - __IO uint32_t SIRCCSR; /**< SIRC Control Status Register, offset: 0x200 */ - uint8_t RESERVED_4[8]; - __IO uint32_t SIRCTCFG; /**< SIRC Trim Configuration Register, offset: 0x20C */ - __IO uint32_t SIRCTRIM; /**< SIRC Trim Register, offset: 0x210 */ - uint8_t RESERVED_5[4]; - __IO uint32_t SIRCSTAT; /**< SIRC Auto-trimming Status Register, offset: 0x218 */ - uint8_t RESERVED_6[228]; - __IO uint32_t FIRCCSR; /**< FIRC Control Status Register, offset: 0x300 */ - uint8_t RESERVED_7[4]; - __IO uint32_t FIRCCFG; /**< FIRC Configuration Register, offset: 0x308 */ - __IO uint32_t FIRCTCFG; /**< FIRC Trim Configuration Register, offset: 0x30C */ - __IO uint32_t FIRCTRIM; /**< FIRC Trim Register, offset: 0x310 */ - uint8_t RESERVED_8[4]; - __IO uint32_t FIRCSTAT; /**< FIRC Auto-trimming Status Register, offset: 0x318 */ - __IO uint32_t FIRCATC1; /**< FIRC Auto-trimming Counter 1, offset: 0x31C */ - __IO uint32_t FIRCATC2; /**< FIRC Auto-trimming Counter 2, offset: 0x320 */ - __IO uint32_t FIRCATC3; /**< FIRC Auto-trimming Counter 2, offset: 0x324 */ - uint8_t RESERVED_9[216]; - __IO uint32_t ROSCCSR; /**< ROSC Control Status Register, offset: 0x400 */ -} SCG_Type; - -/* ---------------------------------------------------------------------------- - -- SCG Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SCG_Register_Masks SCG Register Masks - * @{ - */ - -/*! @name VERID - Version ID Register */ -/*! @{ */ - -#define SCG_VERID_VERSION_MASK (0xFFFFFFFFU) -#define SCG_VERID_VERSION_SHIFT (0U) -/*! VERSION - SCG Version Number */ -#define SCG_VERID_VERSION(x) (((uint32_t)(((uint32_t)(x)) << SCG_VERID_VERSION_SHIFT)) & SCG_VERID_VERSION_MASK) -/*! @} */ - -/*! @name PARAM - Parameter Register */ -/*! @{ */ - -#define SCG_PARAM_SOSCCLKPRES_MASK (0x2U) -#define SCG_PARAM_SOSCCLKPRES_SHIFT (1U) -/*! SOSCCLKPRES - SOSC Clock Present - * 0b1..SOSC clock source is present - * 0b0..SOSC clock source is not present - */ -#define SCG_PARAM_SOSCCLKPRES(x) (((uint32_t)(((uint32_t)(x)) << SCG_PARAM_SOSCCLKPRES_SHIFT)) & SCG_PARAM_SOSCCLKPRES_MASK) - -#define SCG_PARAM_SIRCCLKPRES_MASK (0x4U) -#define SCG_PARAM_SIRCCLKPRES_SHIFT (2U) -/*! SIRCCLKPRES - SIRC Clock Present - * 0b1..SIRC clock source is present - * 0b0..SIRC clock source is not present - */ -#define SCG_PARAM_SIRCCLKPRES(x) (((uint32_t)(((uint32_t)(x)) << SCG_PARAM_SIRCCLKPRES_SHIFT)) & SCG_PARAM_SIRCCLKPRES_MASK) - -#define SCG_PARAM_FIRCCLKPRES_MASK (0x8U) -#define SCG_PARAM_FIRCCLKPRES_SHIFT (3U) -/*! FIRCCLKPRES - FIRC Clock Present - * 0b1..FIRC clock source is present - * 0b0..FIRC clock source is not present - */ -#define SCG_PARAM_FIRCCLKPRES(x) (((uint32_t)(((uint32_t)(x)) << SCG_PARAM_FIRCCLKPRES_SHIFT)) & SCG_PARAM_FIRCCLKPRES_MASK) - -#define SCG_PARAM_ROSCCLKPRES_MASK (0x10U) -#define SCG_PARAM_ROSCCLKPRES_SHIFT (4U) -/*! ROSCCLKPRES - ROSC Clock Present - * 0b1..ROSC clock source is present - * 0b0..ROSC clock source is not present - */ -#define SCG_PARAM_ROSCCLKPRES(x) (((uint32_t)(((uint32_t)(x)) << SCG_PARAM_ROSCCLKPRES_SHIFT)) & SCG_PARAM_ROSCCLKPRES_MASK) -/*! @} */ - -/*! @name TRIM_LOCK - Trim Lock register */ -/*! @{ */ - -#define SCG_TRIM_LOCK_TRIM_UNLOCK_MASK (0x1U) -#define SCG_TRIM_LOCK_TRIM_UNLOCK_SHIFT (0U) -/*! TRIM_UNLOCK - TRIM_UNLOCK - * 0b0..SCG Trim Registers locked and not writable. - * 0b1..SCG Trim registers unlocked and writable. - */ -#define SCG_TRIM_LOCK_TRIM_UNLOCK(x) (((uint32_t)(((uint32_t)(x)) << SCG_TRIM_LOCK_TRIM_UNLOCK_SHIFT)) & SCG_TRIM_LOCK_TRIM_UNLOCK_MASK) - -#define SCG_TRIM_LOCK_IFR_DISABLE_MASK (0x2U) -#define SCG_TRIM_LOCK_IFR_DISABLE_SHIFT (1U) -/*! IFR_DISABLE - IFR_DISABLE - * 0b0..IFR write access to SCG trim registers not disabled. The SCG Trim registers are reprogrammed with the IFR values after any system reset. - * 0b1..IFR write access to SCG trim registers during system reset is blocked. - */ -#define SCG_TRIM_LOCK_IFR_DISABLE(x) (((uint32_t)(((uint32_t)(x)) << SCG_TRIM_LOCK_IFR_DISABLE_SHIFT)) & SCG_TRIM_LOCK_IFR_DISABLE_MASK) - -#define SCG_TRIM_LOCK_TRIM_LOCK_KEY_MASK (0xFFFF0000U) -#define SCG_TRIM_LOCK_TRIM_LOCK_KEY_SHIFT (16U) -/*! TRIM_LOCK_KEY - TRIM_LOCK_KEY */ -#define SCG_TRIM_LOCK_TRIM_LOCK_KEY(x) (((uint32_t)(((uint32_t)(x)) << SCG_TRIM_LOCK_TRIM_LOCK_KEY_SHIFT)) & SCG_TRIM_LOCK_TRIM_LOCK_KEY_MASK) -/*! @} */ - -/*! @name CSR - Clock Status Register */ -/*! @{ */ - -#define SCG_CSR_SCS_MASK (0x7000000U) -#define SCG_CSR_SCS_SHIFT (24U) -/*! SCS - System Clock Source - * 0b000..Reserved - * 0b001..SOSC - * 0b010..SIRC - * 0b011..FIRC - * 0b100..ROSC - * 0b101-0b111..Reserved - */ -#define SCG_CSR_SCS(x) (((uint32_t)(((uint32_t)(x)) << SCG_CSR_SCS_SHIFT)) & SCG_CSR_SCS_MASK) -/*! @} */ - -/*! @name RCCR - Run Clock Control Register */ -/*! @{ */ - -#define SCG_RCCR_SCS_MASK (0x7000000U) -#define SCG_RCCR_SCS_SHIFT (24U) -/*! SCS - System Clock Source - * 0b000..Reserved - * 0b001..SOSC - * 0b010..SIRC - * 0b011..FIRC - * 0b100..ROSC - * 0b101-0b111..Reserved - */ -#define SCG_RCCR_SCS(x) (((uint32_t)(((uint32_t)(x)) << SCG_RCCR_SCS_SHIFT)) & SCG_RCCR_SCS_MASK) -/*! @} */ - -/*! @name SOSCCSR - SOSC Control Status Register */ -/*! @{ */ - -#define SCG_SOSCCSR_SOSCEN_MASK (0x1U) -#define SCG_SOSCCSR_SOSCEN_SHIFT (0U) -/*! SOSCEN - SOSC Enable - * 0b0..SOSC is disabled - * 0b1..SOSC is enabled - */ -#define SCG_SOSCCSR_SOSCEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCEN_SHIFT)) & SCG_SOSCCSR_SOSCEN_MASK) - -#define SCG_SOSCCSR_SOSCSTEN_MASK (0x2U) -#define SCG_SOSCCSR_SOSCSTEN_SHIFT (1U) -/*! SOSCSTEN - SOSC Stop Enable - * 0b0..SOSC is disabled in Deep Sleep mode - * 0b1..SOSC is enabled in Deep Sleep mode only if SOSCEN is set - */ -#define SCG_SOSCCSR_SOSCSTEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCSTEN_SHIFT)) & SCG_SOSCCSR_SOSCSTEN_MASK) - -#define SCG_SOSCCSR_SOSCCM_MASK (0x10000U) -#define SCG_SOSCCSR_SOSCCM_SHIFT (16U) -/*! SOSCCM - SOSC Clock Monitor Enable - * 0b0..SOSC Clock Monitor is disabled - * 0b1..SOSC Clock Monitor is enabled - */ -#define SCG_SOSCCSR_SOSCCM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCCM_SHIFT)) & SCG_SOSCCSR_SOSCCM_MASK) - -#define SCG_SOSCCSR_SOSCCMRE_MASK (0x20000U) -#define SCG_SOSCCSR_SOSCCMRE_SHIFT (17U) -/*! SOSCCMRE - SOSC Clock Monitor Reset Enable - * 0b0..Clock monitor generates an interrupt when an error is detected - * 0b1..Clock monitor generates a reset when an error is detected - */ -#define SCG_SOSCCSR_SOSCCMRE(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCCMRE_SHIFT)) & SCG_SOSCCSR_SOSCCMRE_MASK) - -#define SCG_SOSCCSR_LK_MASK (0x800000U) -#define SCG_SOSCCSR_LK_SHIFT (23U) -/*! LK - Lock Register - * 0b0..This Control Status Register can be written - * 0b1..This Control Status Register cannot be written - */ -#define SCG_SOSCCSR_LK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_LK_SHIFT)) & SCG_SOSCCSR_LK_MASK) - -#define SCG_SOSCCSR_SOSCVLD_MASK (0x1000000U) -#define SCG_SOSCCSR_SOSCVLD_SHIFT (24U) -/*! SOSCVLD - SOSC Valid - * 0b0..SOSC is not enabled or clock is not valid - * 0b1..SOSC is enabled and output clock is valid - */ -#define SCG_SOSCCSR_SOSCVLD(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCVLD_SHIFT)) & SCG_SOSCCSR_SOSCVLD_MASK) - -#define SCG_SOSCCSR_SOSCSEL_MASK (0x2000000U) -#define SCG_SOSCCSR_SOSCSEL_SHIFT (25U) -/*! SOSCSEL - SOSC Selected - * 0b0..SOSC is not the system clock source - * 0b1..SOSC is the system clock source - */ -#define SCG_SOSCCSR_SOSCSEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCSEL_SHIFT)) & SCG_SOSCCSR_SOSCSEL_MASK) - -#define SCG_SOSCCSR_SOSCERR_MASK (0x4000000U) -#define SCG_SOSCCSR_SOSCERR_SHIFT (26U) -/*! SOSCERR - SOSC Clock Error - * 0b0..SOSC Clock Monitor is disabled or has not detected an error - * 0b1..SOSC Clock Monitor is enabled and detected an error - */ -#define SCG_SOSCCSR_SOSCERR(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCERR_SHIFT)) & SCG_SOSCCSR_SOSCERR_MASK) - -#define SCG_SOSCCSR_SOSCVLD_IE_MASK (0x40000000U) -#define SCG_SOSCCSR_SOSCVLD_IE_SHIFT (30U) -/*! SOSCVLD_IE - SOSC Valid Interrupt Enable - * 0b0..SOSCVLD interrupt is not enabled - * 0b1..SOSCVLD interrupt is enabled - */ -#define SCG_SOSCCSR_SOSCVLD_IE(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCVLD_IE_SHIFT)) & SCG_SOSCCSR_SOSCVLD_IE_MASK) -/*! @} */ - -/*! @name SOSCCFG - SOSC Configuration Register */ -/*! @{ */ - -#define SCG_SOSCCFG_EREFS_MASK (0x4U) -#define SCG_SOSCCFG_EREFS_SHIFT (2U) -/*! EREFS - External Reference Select - * 0b0..External reference clock selected. - * 0b1..Internal crystal oscillator of OSC selected. - */ -#define SCG_SOSCCFG_EREFS(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCFG_EREFS_SHIFT)) & SCG_SOSCCFG_EREFS_MASK) - -#define SCG_SOSCCFG_RANGE_MASK (0x30U) -#define SCG_SOSCCFG_RANGE_SHIFT (4U) -/*! RANGE - SOSC Range Select - * 0b00..Frequency range select of 8-16 MHz. - * 0b01..Frequency range select of 16-25 MHz. - * 0b10..Frequency range select of 25-40 MHz. - * 0b11..Frequency range select of 40-50 MHz. - */ -#define SCG_SOSCCFG_RANGE(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCFG_RANGE_SHIFT)) & SCG_SOSCCFG_RANGE_MASK) -/*! @} */ - -/*! @name SIRCCSR - SIRC Control Status Register */ -/*! @{ */ - -#define SCG_SIRCCSR_SIRCSTEN_MASK (0x2U) -#define SCG_SIRCCSR_SIRCSTEN_SHIFT (1U) -/*! SIRCSTEN - SIRC Stop Enable - * 0b0..SIRC is disabled in Deep Sleep mode - * 0b1..SIRC is enabled in Deep Sleep mode - */ -#define SCG_SIRCCSR_SIRCSTEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCSTEN_SHIFT)) & SCG_SIRCCSR_SIRCSTEN_MASK) - -#define SCG_SIRCCSR_SIRC_CLK_PERIPH_EN_MASK (0x20U) -#define SCG_SIRCCSR_SIRC_CLK_PERIPH_EN_SHIFT (5U) -/*! SIRC_CLK_PERIPH_EN - SIRC Clock to Peripherals Enable - * 0b0..SIRC clock to peripherals is disabled - * 0b1..SIRC clock to peripherals is enabled - */ -#define SCG_SIRCCSR_SIRC_CLK_PERIPH_EN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRC_CLK_PERIPH_EN_SHIFT)) & SCG_SIRCCSR_SIRC_CLK_PERIPH_EN_MASK) - -#define SCG_SIRCCSR_SIRCTREN_MASK (0x100U) -#define SCG_SIRCCSR_SIRCTREN_SHIFT (8U) -/*! SIRCTREN - SIRC 12 MHz Trim Enable (SIRCCFG[RANGE]=1) - * 0b0..Disables trimming SIRC to an external clock source - * 0b1..Enables trimming SIRC to an external clock source - */ -#define SCG_SIRCCSR_SIRCTREN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCTREN_SHIFT)) & SCG_SIRCCSR_SIRCTREN_MASK) - -#define SCG_SIRCCSR_SIRCTRUP_MASK (0x200U) -#define SCG_SIRCCSR_SIRCTRUP_SHIFT (9U) -/*! SIRCTRUP - SIRC Trim Update - * 0b0..Disables SIRC trimming updates - * 0b1..Enables SIRC trimming updates - */ -#define SCG_SIRCCSR_SIRCTRUP(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCTRUP_SHIFT)) & SCG_SIRCCSR_SIRCTRUP_MASK) - -#define SCG_SIRCCSR_TRIM_LOCK_MASK (0x400U) -#define SCG_SIRCCSR_TRIM_LOCK_SHIFT (10U) -/*! TRIM_LOCK - SIRC TRIM LOCK - * 0b0..SIRC auto trim not locked to target frequency range - * 0b1..SIRC auto trim locked to target frequency range - */ -#define SCG_SIRCCSR_TRIM_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_TRIM_LOCK_SHIFT)) & SCG_SIRCCSR_TRIM_LOCK_MASK) - -#define SCG_SIRCCSR_COARSE_TRIM_BYPASS_MASK (0x800U) -#define SCG_SIRCCSR_COARSE_TRIM_BYPASS_SHIFT (11U) -/*! COARSE_TRIM_BYPASS - Coarse Auto Trim Bypass - * 0b0..SIRC Coarse Auto Trim NOT Bypassed - * 0b1..SIRC Coarse Auto Trim Bypassed - */ -#define SCG_SIRCCSR_COARSE_TRIM_BYPASS(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_COARSE_TRIM_BYPASS_SHIFT)) & SCG_SIRCCSR_COARSE_TRIM_BYPASS_MASK) - -#define SCG_SIRCCSR_LK_MASK (0x800000U) -#define SCG_SIRCCSR_LK_SHIFT (23U) -/*! LK - Lock Register - * 0b0..Control Status Register can be written - * 0b1..Control Status Register cannot be written - */ -#define SCG_SIRCCSR_LK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_LK_SHIFT)) & SCG_SIRCCSR_LK_MASK) - -#define SCG_SIRCCSR_SIRCVLD_MASK (0x1000000U) -#define SCG_SIRCCSR_SIRCVLD_SHIFT (24U) -/*! SIRCVLD - SIRC Valid - * 0b0..SIRC is not enabled or clock is not valid - * 0b1..SIRC is enabled and output clock is valid - */ -#define SCG_SIRCCSR_SIRCVLD(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCVLD_SHIFT)) & SCG_SIRCCSR_SIRCVLD_MASK) - -#define SCG_SIRCCSR_SIRCSEL_MASK (0x2000000U) -#define SCG_SIRCCSR_SIRCSEL_SHIFT (25U) -/*! SIRCSEL - SIRC Selected - * 0b0..SIRC is not the system clock source - * 0b1..SIRC is the system clock source - */ -#define SCG_SIRCCSR_SIRCSEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCSEL_SHIFT)) & SCG_SIRCCSR_SIRCSEL_MASK) - -#define SCG_SIRCCSR_SIRCERR_MASK (0x4000000U) -#define SCG_SIRCCSR_SIRCERR_SHIFT (26U) -/*! SIRCERR - SIRC Clock Error - * 0b0..Error not detected with the SIRC trimming - * 0b1..Error detected with the SIRC trimming - */ -#define SCG_SIRCCSR_SIRCERR(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCERR_SHIFT)) & SCG_SIRCCSR_SIRCERR_MASK) - -#define SCG_SIRCCSR_SIRCERR_IE_MASK (0x8000000U) -#define SCG_SIRCCSR_SIRCERR_IE_SHIFT (27U) -/*! SIRCERR_IE - SIRC Clock Error Interrupt Enable - * 0b0..SIRCERR interrupt is not enabled - * 0b1..SIRCERR interrupt is enabled - */ -#define SCG_SIRCCSR_SIRCERR_IE(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCERR_IE_SHIFT)) & SCG_SIRCCSR_SIRCERR_IE_MASK) -/*! @} */ - -/*! @name SIRCTCFG - SIRC Trim Configuration Register */ -/*! @{ */ - -#define SCG_SIRCTCFG_TRIMSRC_MASK (0x3U) -#define SCG_SIRCTCFG_TRIMSRC_SHIFT (0U) -/*! TRIMSRC - Trim Source - * 0b00..Reserved - * 0b01..Reserved - * 0b10..SOSC. This option requires that SOSC be divided using the TRIMDIV field to get a frequency of 1 MHz. - * 0b11..Reserved - */ -#define SCG_SIRCTCFG_TRIMSRC(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCTCFG_TRIMSRC_SHIFT)) & SCG_SIRCTCFG_TRIMSRC_MASK) - -#define SCG_SIRCTCFG_TRIMDIV_MASK (0x7F0000U) -#define SCG_SIRCTCFG_TRIMDIV_SHIFT (16U) -/*! TRIMDIV - SIRC Trim Pre-divider */ -#define SCG_SIRCTCFG_TRIMDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCTCFG_TRIMDIV_SHIFT)) & SCG_SIRCTCFG_TRIMDIV_MASK) -/*! @} */ - -/*! @name SIRCTRIM - SIRC Trim Register */ -/*! @{ */ - -#define SCG_SIRCTRIM_CCOTRIM_MASK (0x3FU) -#define SCG_SIRCTRIM_CCOTRIM_SHIFT (0U) -/*! CCOTRIM - CCO Trim */ -#define SCG_SIRCTRIM_CCOTRIM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCTRIM_CCOTRIM_SHIFT)) & SCG_SIRCTRIM_CCOTRIM_MASK) - -#define SCG_SIRCTRIM_CLTRIM_MASK (0x3F00U) -#define SCG_SIRCTRIM_CLTRIM_SHIFT (8U) -/*! CLTRIM - CL Trim */ -#define SCG_SIRCTRIM_CLTRIM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCTRIM_CLTRIM_SHIFT)) & SCG_SIRCTRIM_CLTRIM_MASK) - -#define SCG_SIRCTRIM_TCTRIM_MASK (0x1F0000U) -#define SCG_SIRCTRIM_TCTRIM_SHIFT (16U) -/*! TCTRIM - Trim Temp */ -#define SCG_SIRCTRIM_TCTRIM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCTRIM_TCTRIM_SHIFT)) & SCG_SIRCTRIM_TCTRIM_MASK) - -#define SCG_SIRCTRIM_FVCHTRIM_MASK (0x1F000000U) -#define SCG_SIRCTRIM_FVCHTRIM_SHIFT (24U) -#define SCG_SIRCTRIM_FVCHTRIM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCTRIM_FVCHTRIM_SHIFT)) & SCG_SIRCTRIM_FVCHTRIM_MASK) -/*! @} */ - -/*! @name SIRCSTAT - SIRC Auto-trimming Status Register */ -/*! @{ */ - -#define SCG_SIRCSTAT_CCOTRIM_MASK (0x3FU) -#define SCG_SIRCSTAT_CCOTRIM_SHIFT (0U) -/*! CCOTRIM - CCO Trim */ -#define SCG_SIRCSTAT_CCOTRIM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCSTAT_CCOTRIM_SHIFT)) & SCG_SIRCSTAT_CCOTRIM_MASK) - -#define SCG_SIRCSTAT_CLTRIM_MASK (0x3F00U) -#define SCG_SIRCSTAT_CLTRIM_SHIFT (8U) -/*! CLTRIM - CL Trim */ -#define SCG_SIRCSTAT_CLTRIM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCSTAT_CLTRIM_SHIFT)) & SCG_SIRCSTAT_CLTRIM_MASK) -/*! @} */ - -/*! @name FIRCCSR - FIRC Control Status Register */ -/*! @{ */ - -#define SCG_FIRCCSR_FIRCEN_MASK (0x1U) -#define SCG_FIRCCSR_FIRCEN_SHIFT (0U) -/*! FIRCEN - FIRC Enable - * 0b0..FIRC is disabled - * 0b1..FIRC is enabled - */ -#define SCG_FIRCCSR_FIRCEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCEN_SHIFT)) & SCG_FIRCCSR_FIRCEN_MASK) - -#define SCG_FIRCCSR_FIRCSTEN_MASK (0x2U) -#define SCG_FIRCCSR_FIRCSTEN_SHIFT (1U) -/*! FIRCSTEN - FIRC Stop Enable - * 0b0..FIRC is disabled in Deep Sleep mode - * 0b1..FIRC is enabled in Deep Sleep mode - */ -#define SCG_FIRCCSR_FIRCSTEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCSTEN_SHIFT)) & SCG_FIRCCSR_FIRCSTEN_MASK) - -#define SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_MASK (0x10U) -#define SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_SHIFT (4U) -/*! FIRC_SCLK_PERIPH_EN - FIRC 48 MHz Clock to peripherals Enable - * 0b0..FIRC 48 MHz to peripherals is disabled - * 0b1..FIRC 48 MHz to peripherals is enabled - */ -#define SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_SHIFT)) & SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_MASK) - -#define SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN_MASK (0x20U) -#define SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN_SHIFT (5U) -/*! FIRC_FCLK_PERIPH_EN - FRO_HF Clock to peripherals Enable - * 0b0..FRO_HF to peripherals is disabled - * 0b1..FRO_HF to peripherals is enabled - */ -#define SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN_SHIFT)) & SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN_MASK) - -#define SCG_FIRCCSR_FIRCTREN_MASK (0x100U) -#define SCG_FIRCCSR_FIRCTREN_SHIFT (8U) -/*! FIRCTREN - FRO_HF Trim Enable - * 0b0..Disables trimming FRO_HF by an external clock source - * 0b1..Enables trimming FRO_HF by an external clock source - */ -#define SCG_FIRCCSR_FIRCTREN(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCTREN_SHIFT)) & SCG_FIRCCSR_FIRCTREN_MASK) - -#define SCG_FIRCCSR_FIRCTRUP_MASK (0x200U) -#define SCG_FIRCCSR_FIRCTRUP_SHIFT (9U) -/*! FIRCTRUP - FIRC Trim Update - * 0b0..Disables FIRC trimming updates - * 0b1..Enables FIRC trimming updates - */ -#define SCG_FIRCCSR_FIRCTRUP(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCTRUP_SHIFT)) & SCG_FIRCCSR_FIRCTRUP_MASK) - -#define SCG_FIRCCSR_TRIM_LOCK_MASK (0x400U) -#define SCG_FIRCCSR_TRIM_LOCK_SHIFT (10U) -/*! TRIM_LOCK - FIRC TRIM LOCK - * 0b0..FIRC auto trim not locked to target frequency range - * 0b1..FIRC auto trim locked to target frequency range - */ -#define SCG_FIRCCSR_TRIM_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_TRIM_LOCK_SHIFT)) & SCG_FIRCCSR_TRIM_LOCK_MASK) - -#define SCG_FIRCCSR_COARSE_TRIM_BYPASS_MASK (0x800U) -#define SCG_FIRCCSR_COARSE_TRIM_BYPASS_SHIFT (11U) -/*! COARSE_TRIM_BYPASS - Coarse Auto Trim Bypass - * 0b0..FIRC Coarse Auto Trim NOT Bypassed - * 0b1..FIRC Coarse Auto Trim Bypassed - */ -#define SCG_FIRCCSR_COARSE_TRIM_BYPASS(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_COARSE_TRIM_BYPASS_SHIFT)) & SCG_FIRCCSR_COARSE_TRIM_BYPASS_MASK) - -#define SCG_FIRCCSR_LK_MASK (0x800000U) -#define SCG_FIRCCSR_LK_SHIFT (23U) -/*! LK - Lock Register - * 0b0..Control Status Register can be written - * 0b1..Control Status Register cannot be written - */ -#define SCG_FIRCCSR_LK(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_LK_SHIFT)) & SCG_FIRCCSR_LK_MASK) - -#define SCG_FIRCCSR_FIRCVLD_MASK (0x1000000U) -#define SCG_FIRCCSR_FIRCVLD_SHIFT (24U) -/*! FIRCVLD - FIRC Valid status - * 0b0..FIRC is not enabled or clock is not valid. - * 0b1..FIRC is enabled and output clock is valid. The clock is valid after there is an output clock from the FIRC analog. - */ -#define SCG_FIRCCSR_FIRCVLD(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCVLD_SHIFT)) & SCG_FIRCCSR_FIRCVLD_MASK) - -#define SCG_FIRCCSR_FIRCSEL_MASK (0x2000000U) -#define SCG_FIRCCSR_FIRCSEL_SHIFT (25U) -/*! FIRCSEL - FIRC Selected - * 0b0..FIRC is not the system clock source - * 0b1..FIRC is the system clock source - */ -#define SCG_FIRCCSR_FIRCSEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCSEL_SHIFT)) & SCG_FIRCCSR_FIRCSEL_MASK) - -#define SCG_FIRCCSR_FIRCERR_MASK (0x4000000U) -#define SCG_FIRCCSR_FIRCERR_SHIFT (26U) -/*! FIRCERR - FIRC Clock Error - * 0b0..Error not detected with the FIRC trimming - * 0b1..Error detected with the FIRC trimming - */ -#define SCG_FIRCCSR_FIRCERR(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCERR_SHIFT)) & SCG_FIRCCSR_FIRCERR_MASK) - -#define SCG_FIRCCSR_FIRCERR_IE_MASK (0x8000000U) -#define SCG_FIRCCSR_FIRCERR_IE_SHIFT (27U) -/*! FIRCERR_IE - FIRC Clock Error Interrupt Enable - * 0b0..FIRCERR interrupt is not enabled - * 0b1..FIRCERR interrupt is enabled - */ -#define SCG_FIRCCSR_FIRCERR_IE(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCERR_IE_SHIFT)) & SCG_FIRCCSR_FIRCERR_IE_MASK) - -#define SCG_FIRCCSR_FIRCACC_IE_MASK (0x40000000U) -#define SCG_FIRCCSR_FIRCACC_IE_SHIFT (30U) -/*! FIRCACC_IE - FIRC Accurate Interrupt Enable - * 0b0..FIRCACC interrupt is not enabled - * 0b1..FIRCACC interrupt is enabled - */ -#define SCG_FIRCCSR_FIRCACC_IE(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCACC_IE_SHIFT)) & SCG_FIRCCSR_FIRCACC_IE_MASK) - -#define SCG_FIRCCSR_FIRCACC_MASK (0x80000000U) -#define SCG_FIRCCSR_FIRCACC_SHIFT (31U) -/*! FIRCACC - FIRC Frequency Accurate - * 0b0..FIRC is not enabled or clock is not accurate. - * 0b1..FIRC is enabled and output clock is accurate after some preparation time which is obtained by counting FRO_HF clock. - */ -#define SCG_FIRCCSR_FIRCACC(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCACC_SHIFT)) & SCG_FIRCCSR_FIRCACC_MASK) -/*! @} */ - -/*! @name FIRCCFG - FIRC Configuration Register */ -/*! @{ */ - -#define SCG_FIRCCFG_FREQ_SEL_MASK (0xEU) -#define SCG_FIRCCFG_FREQ_SEL_SHIFT (1U) -/*! FREQ_SEL - Frequency select - * 0b111..192 MHz FIRC clock selected - * 0b101..96 MHz FIRC clock selected - * 0b011..64 MHz FIRC clock selected - * 0b001..48 MHz FIRC clock selected, divided from 192 MHz - */ -#define SCG_FIRCCFG_FREQ_SEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCFG_FREQ_SEL_SHIFT)) & SCG_FIRCCFG_FREQ_SEL_MASK) -/*! @} */ - -/*! @name FIRCTCFG - FIRC Trim Configuration Register */ -/*! @{ */ - -#define SCG_FIRCTCFG_TRIMSRC_MASK (0x3U) -#define SCG_FIRCTCFG_TRIMSRC_SHIFT (0U) -/*! TRIMSRC - Trim Source - * 0b00..USB0 Start of Frame (1 KHz). This option does not use TRIMDIV . - * 0b01..Reserved - * 0b10..SOSC. This option requires that SOSC be divided using the TRIMDIV field to get a frequency of 1 MHz. - * 0b11..Reserved - */ -#define SCG_FIRCTCFG_TRIMSRC(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTCFG_TRIMSRC_SHIFT)) & SCG_FIRCTCFG_TRIMSRC_MASK) - -#define SCG_FIRCTCFG_TRIMDIV_MASK (0x7F0000U) -#define SCG_FIRCTCFG_TRIMDIV_SHIFT (16U) -/*! TRIMDIV - FIRC Trim Pre-divider */ -#define SCG_FIRCTCFG_TRIMDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTCFG_TRIMDIV_SHIFT)) & SCG_FIRCTCFG_TRIMDIV_MASK) -/*! @} */ - -/*! @name FIRCTRIM - FIRC Trim Register */ -/*! @{ */ - -#define SCG_FIRCTRIM_TRIMFINE_MASK (0xFFU) -#define SCG_FIRCTRIM_TRIMFINE_SHIFT (0U) -/*! TRIMFINE - Trim Fine */ -#define SCG_FIRCTRIM_TRIMFINE(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTRIM_TRIMFINE_SHIFT)) & SCG_FIRCTRIM_TRIMFINE_MASK) - -#define SCG_FIRCTRIM_TRIMCOAR_MASK (0x3F00U) -#define SCG_FIRCTRIM_TRIMCOAR_SHIFT (8U) -/*! TRIMCOAR - Trim Coarse */ -#define SCG_FIRCTRIM_TRIMCOAR(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTRIM_TRIMCOAR_SHIFT)) & SCG_FIRCTRIM_TRIMCOAR_MASK) - -#define SCG_FIRCTRIM_TRIMTEMP2_MASK (0xC0000U) -#define SCG_FIRCTRIM_TRIMTEMP2_SHIFT (18U) -/*! TRIMTEMP2 - Trim Temperature2 */ -#define SCG_FIRCTRIM_TRIMTEMP2(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTRIM_TRIMTEMP2_SHIFT)) & SCG_FIRCTRIM_TRIMTEMP2_MASK) - -#define SCG_FIRCTRIM_TRIMSTART_MASK (0x3F000000U) -#define SCG_FIRCTRIM_TRIMSTART_SHIFT (24U) -/*! TRIMSTART - Trim Start */ -#define SCG_FIRCTRIM_TRIMSTART(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTRIM_TRIMSTART_SHIFT)) & SCG_FIRCTRIM_TRIMSTART_MASK) -/*! @} */ - -/*! @name FIRCSTAT - FIRC Auto-trimming Status Register */ -/*! @{ */ - -#define SCG_FIRCSTAT_TRIMFINE_MASK (0xFFU) -#define SCG_FIRCSTAT_TRIMFINE_SHIFT (0U) -/*! TRIMFINE - Trim Fine */ -#define SCG_FIRCSTAT_TRIMFINE(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCSTAT_TRIMFINE_SHIFT)) & SCG_FIRCSTAT_TRIMFINE_MASK) - -#define SCG_FIRCSTAT_TRIMCOAR_MASK (0x3F00U) -#define SCG_FIRCSTAT_TRIMCOAR_SHIFT (8U) -/*! TRIMCOAR - Trim Coarse */ -#define SCG_FIRCSTAT_TRIMCOAR(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCSTAT_TRIMCOAR_SHIFT)) & SCG_FIRCSTAT_TRIMCOAR_MASK) -/*! @} */ - -/*! @name FIRCATC1 - FIRC Auto-trimming Counter 1 */ -/*! @{ */ - -#define SCG_FIRCATC1_IDEALC_MASK (0xFFFFU) -#define SCG_FIRCATC1_IDEALC_SHIFT (0U) -/*! IDEALC - Ideal Counter */ -#define SCG_FIRCATC1_IDEALC(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCATC1_IDEALC_SHIFT)) & SCG_FIRCATC1_IDEALC_MASK) -/*! @} */ - -/*! @name FIRCATC2 - FIRC Auto-trimming Counter 2 */ -/*! @{ */ - -#define SCG_FIRCATC2_COARMINC_MASK (0xFFFFU) -#define SCG_FIRCATC2_COARMINC_SHIFT (0U) -/*! COARMINC - Coarse Trim Minimum Counter */ -#define SCG_FIRCATC2_COARMINC(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCATC2_COARMINC_SHIFT)) & SCG_FIRCATC2_COARMINC_MASK) - -#define SCG_FIRCATC2_COARMAXC_MASK (0xFFFF0000U) -#define SCG_FIRCATC2_COARMAXC_SHIFT (16U) -/*! COARMAXC - Coarse Trim Maximum Counter */ -#define SCG_FIRCATC2_COARMAXC(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCATC2_COARMAXC_SHIFT)) & SCG_FIRCATC2_COARMAXC_MASK) -/*! @} */ - -/*! @name FIRCATC3 - FIRC Auto-trimming Counter 2 */ -/*! @{ */ - -#define SCG_FIRCATC3_FINEMINC_MASK (0xFFFFU) -#define SCG_FIRCATC3_FINEMINC_SHIFT (0U) -/*! FINEMINC - Fine Trim Minimum Counter */ -#define SCG_FIRCATC3_FINEMINC(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCATC3_FINEMINC_SHIFT)) & SCG_FIRCATC3_FINEMINC_MASK) - -#define SCG_FIRCATC3_FINEMAXC_MASK (0xFFFF0000U) -#define SCG_FIRCATC3_FINEMAXC_SHIFT (16U) -/*! FINEMAXC - Fine Trim Maximum Counter */ -#define SCG_FIRCATC3_FINEMAXC(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCATC3_FINEMAXC_SHIFT)) & SCG_FIRCATC3_FINEMAXC_MASK) -/*! @} */ - -/*! @name ROSCCSR - ROSC Control Status Register */ -/*! @{ */ - -#define SCG_ROSCCSR_LK_MASK (0x800000U) -#define SCG_ROSCCSR_LK_SHIFT (23U) -/*! LK - Lock Register - * 0b0..Control Status Register can be written - * 0b1..Control Status Register cannot be written - */ -#define SCG_ROSCCSR_LK(x) (((uint32_t)(((uint32_t)(x)) << SCG_ROSCCSR_LK_SHIFT)) & SCG_ROSCCSR_LK_MASK) - -#define SCG_ROSCCSR_ROSCVLD_MASK (0x1000000U) -#define SCG_ROSCCSR_ROSCVLD_SHIFT (24U) -/*! ROSCVLD - ROSC Valid - * 0b0..ROSC is not enabled or clock is not valid - * 0b1..ROSC is enabled and output clock is valid - */ -#define SCG_ROSCCSR_ROSCVLD(x) (((uint32_t)(((uint32_t)(x)) << SCG_ROSCCSR_ROSCVLD_SHIFT)) & SCG_ROSCCSR_ROSCVLD_MASK) - -#define SCG_ROSCCSR_ROSCSEL_MASK (0x2000000U) -#define SCG_ROSCCSR_ROSCSEL_SHIFT (25U) -/*! ROSCSEL - ROSC Selected - * 0b0..ROSC is not the system clock source - * 0b1..ROSC is the system clock source - */ -#define SCG_ROSCCSR_ROSCSEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_ROSCCSR_ROSCSEL_SHIFT)) & SCG_ROSCCSR_ROSCSEL_MASK) - -#define SCG_ROSCCSR_ROSCERR_MASK (0x4000000U) -#define SCG_ROSCCSR_ROSCERR_SHIFT (26U) -/*! ROSCERR - ROSC Clock Error - * 0b0..ROSC Clock has not detected an error - * 0b1..ROSC Clock has detected an error - */ -#define SCG_ROSCCSR_ROSCERR(x) (((uint32_t)(((uint32_t)(x)) << SCG_ROSCCSR_ROSCERR_SHIFT)) & SCG_ROSCCSR_ROSCERR_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group SCG_Register_Masks */ - - -/* SCG - Peripheral instance base addresses */ -/** Peripheral SCG0 base address */ -#define SCG0_BASE (0x4008F000u) -/** Peripheral SCG0 base pointer */ -#define SCG0 ((SCG_Type *)SCG0_BASE) -/** Array initializer of SCG peripheral base addresses */ -#define SCG_BASE_ADDRS { SCG0_BASE } -/** Array initializer of SCG peripheral base pointers */ -#define SCG_BASE_PTRS { SCG0 } - -/*! - * @} - */ /* end of group SCG_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- SPC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SPC_Peripheral_Access_Layer SPC Peripheral Access Layer - * @{ - */ - -/** SPC - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - uint8_t RESERVED_0[12]; - __IO uint32_t SC; /**< Status Control, offset: 0x10 */ - uint8_t RESERVED_1[8]; - __IO uint32_t LPREQ_CFG; /**< Low-Power Request Configuration, offset: 0x1C */ - uint8_t RESERVED_2[16]; - __IO uint32_t PD_STATUS[1]; /**< SPC Power Domain Mode Status, array offset: 0x30, array step: 0x4 */ - uint8_t RESERVED_3[12]; - __IO uint32_t SRAMCTL; /**< SRAM Control, offset: 0x40 */ - uint8_t RESERVED_4[16]; - __IO uint32_t SRAMRETLDO_REFTRIM; /**< SRAM Retention Reference Trim, offset: 0x54 */ - __IO uint32_t SRAMRETLDO_CNTRL; /**< SRAM Retention LDO Control, offset: 0x58 */ - uint8_t RESERVED_5[164]; - __IO uint32_t ACTIVE_CFG; /**< Active Power Mode Configuration, offset: 0x100 */ - __IO uint32_t ACTIVE_CFG1; /**< Active Power Mode Configuration 1, offset: 0x104 */ - __IO uint32_t LP_CFG; /**< Low-Power Mode Configuration, offset: 0x108 */ - __IO uint32_t LP_CFG1; /**< Low Power Mode Configuration 1, offset: 0x10C */ - uint8_t RESERVED_6[16]; - __IO uint32_t LPWKUP_DELAY; /**< Low Power Wake-Up Delay, offset: 0x120 */ - __IO uint32_t ACTIVE_VDELAY; /**< Active Voltage Trim Delay, offset: 0x124 */ - uint8_t RESERVED_7[8]; - __IO uint32_t VD_STAT; /**< Voltage Detect Status, offset: 0x130 */ - __IO uint32_t VD_CORE_CFG; /**< Core Voltage Detect Configuration, offset: 0x134 */ - __IO uint32_t VD_SYS_CFG; /**< System Voltage Detect Configuration, offset: 0x138 */ - uint8_t RESERVED_8[4]; - __IO uint32_t EVD_CFG; /**< External Voltage Domain Configuration, offset: 0x140 */ - uint8_t RESERVED_9[444]; - uint32_t CORELDO_CFG; /**< LDO_CORE Configuration, offset: 0x300 */ -} SPC_Type; - -/* ---------------------------------------------------------------------------- - -- SPC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SPC_Register_Masks SPC Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define SPC_VERID_FEATURE_MASK (0xFFFFU) -#define SPC_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Standard features - * *.. - */ -#define SPC_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VERID_FEATURE_SHIFT)) & SPC_VERID_FEATURE_MASK) - -#define SPC_VERID_MINOR_MASK (0xFF0000U) -#define SPC_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define SPC_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << SPC_VERID_MINOR_SHIFT)) & SPC_VERID_MINOR_MASK) - -#define SPC_VERID_MAJOR_MASK (0xFF000000U) -#define SPC_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define SPC_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << SPC_VERID_MAJOR_SHIFT)) & SPC_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name SC - Status Control */ -/*! @{ */ - -#define SPC_SC_BUSY_MASK (0x1U) -#define SPC_SC_BUSY_SHIFT (0U) -/*! BUSY - SPC Busy Status Flag - * 0b0..Not busy - * 0b1..Busy - */ -#define SPC_SC_BUSY(x) (((uint32_t)(((uint32_t)(x)) << SPC_SC_BUSY_SHIFT)) & SPC_SC_BUSY_MASK) - -#define SPC_SC_SPC_LP_REQ_MASK (0x2U) -#define SPC_SC_SPC_LP_REQ_SHIFT (1U) -/*! SPC_LP_REQ - SPC Power Mode Configuration Status Flag - * 0b0..SPC is in Active mode; the ACTIVE_CFG register has control - * 0b1..All power domains requested low-power mode; SPC entered a low-power state; power-mode configuration based on the LP_CFG register - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_SC_SPC_LP_REQ(x) (((uint32_t)(((uint32_t)(x)) << SPC_SC_SPC_LP_REQ_SHIFT)) & SPC_SC_SPC_LP_REQ_MASK) - -#define SPC_SC_SPC_LP_MODE_MASK (0xF0U) -#define SPC_SC_SPC_LP_MODE_SHIFT (4U) -/*! SPC_LP_MODE - Power Domain Low-Power Mode Request - * 0b0000..Sleep mode with system clock running - * 0b0001..DSLEEP with system clock off - * 0b0010..PDOWN with system clock off - * 0b0100.. - * 0b1000..DPDOWN with system clock off - */ -#define SPC_SC_SPC_LP_MODE(x) (((uint32_t)(((uint32_t)(x)) << SPC_SC_SPC_LP_MODE_SHIFT)) & SPC_SC_SPC_LP_MODE_MASK) - -#define SPC_SC_ISO_CLR_MASK (0x10000U) -#define SPC_SC_ISO_CLR_SHIFT (16U) -/*! ISO_CLR - Isolation Clear Flags */ -#define SPC_SC_ISO_CLR(x) (((uint32_t)(((uint32_t)(x)) << SPC_SC_ISO_CLR_SHIFT)) & SPC_SC_ISO_CLR_MASK) -/*! @} */ - -/*! @name LPREQ_CFG - Low-Power Request Configuration */ -/*! @{ */ - -#define SPC_LPREQ_CFG_LPREQOE_MASK (0x1U) -#define SPC_LPREQ_CFG_LPREQOE_SHIFT (0U) -/*! LPREQOE - Low-Power Request Output Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LPREQ_CFG_LPREQOE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LPREQ_CFG_LPREQOE_SHIFT)) & SPC_LPREQ_CFG_LPREQOE_MASK) - -#define SPC_LPREQ_CFG_LPREQPOL_MASK (0x2U) -#define SPC_LPREQ_CFG_LPREQPOL_SHIFT (1U) -/*! LPREQPOL - Low-Power Request Output Pin Polarity Control - * 0b0..High - * 0b1..Low - */ -#define SPC_LPREQ_CFG_LPREQPOL(x) (((uint32_t)(((uint32_t)(x)) << SPC_LPREQ_CFG_LPREQPOL_SHIFT)) & SPC_LPREQ_CFG_LPREQPOL_MASK) - -#define SPC_LPREQ_CFG_LPREQOV_MASK (0xCU) -#define SPC_LPREQ_CFG_LPREQOV_SHIFT (2U) -/*! LPREQOV - Low-Power Request Output Override - * 0b00..Not forced - * 0b01.. - * 0b10..Forced low (ignore LPREQPOL settings) - * 0b11..Forced high (ignore LPREQPOL settings) - */ -#define SPC_LPREQ_CFG_LPREQOV(x) (((uint32_t)(((uint32_t)(x)) << SPC_LPREQ_CFG_LPREQOV_SHIFT)) & SPC_LPREQ_CFG_LPREQOV_MASK) -/*! @} */ - -/*! @name PD_STATUS - SPC Power Domain Mode Status */ -/*! @{ */ - -#define SPC_PD_STATUS_PWR_REQ_STATUS_MASK (0x1U) -#define SPC_PD_STATUS_PWR_REQ_STATUS_SHIFT (0U) -/*! PWR_REQ_STATUS - Power Request Status Flag - * 0b0..Did not request - * 0b1..Requested - */ -#define SPC_PD_STATUS_PWR_REQ_STATUS(x) (((uint32_t)(((uint32_t)(x)) << SPC_PD_STATUS_PWR_REQ_STATUS_SHIFT)) & SPC_PD_STATUS_PWR_REQ_STATUS_MASK) - -#define SPC_PD_STATUS_PD_LP_REQ_MASK (0x10U) -#define SPC_PD_STATUS_PD_LP_REQ_SHIFT (4U) -/*! PD_LP_REQ - Power Domain Low Power Request Flag - * 0b0..Did not request - * 0b1..Requested - */ -#define SPC_PD_STATUS_PD_LP_REQ(x) (((uint32_t)(((uint32_t)(x)) << SPC_PD_STATUS_PD_LP_REQ_SHIFT)) & SPC_PD_STATUS_PD_LP_REQ_MASK) - -#define SPC_PD_STATUS_LP_MODE_MASK (0xF00U) -#define SPC_PD_STATUS_LP_MODE_SHIFT (8U) -/*! LP_MODE - Power Domain Low Power Mode Request - * 0b0000..SLEEP with system clock running - * 0b0001..DSLEEP with system clock off - * 0b0010..PDOWN with system clock off - * 0b0100.. - * 0b1000..DPDOWN with system clock off - */ -#define SPC_PD_STATUS_LP_MODE(x) (((uint32_t)(((uint32_t)(x)) << SPC_PD_STATUS_LP_MODE_SHIFT)) & SPC_PD_STATUS_LP_MODE_MASK) -/*! @} */ - -/* The count of SPC_PD_STATUS */ -#define SPC_PD_STATUS_COUNT (1U) - -/*! @name SRAMCTL - SRAM Control */ -/*! @{ */ - -#define SPC_SRAMCTL_VSM_MASK (0x3U) -#define SPC_SRAMCTL_VSM_SHIFT (0U) -/*! VSM - Voltage Select Margin - * 0b00.. - * 0b01..1.0 V - * 0b10..1.1 V - * 0b11.. - */ -#define SPC_SRAMCTL_VSM(x) (((uint32_t)(((uint32_t)(x)) << SPC_SRAMCTL_VSM_SHIFT)) & SPC_SRAMCTL_VSM_MASK) - -#define SPC_SRAMCTL_REQ_MASK (0x40000000U) -#define SPC_SRAMCTL_REQ_SHIFT (30U) -/*! REQ - SRAM Voltage Update Request - * 0b0..Do not request - * 0b1..Request - */ -#define SPC_SRAMCTL_REQ(x) (((uint32_t)(((uint32_t)(x)) << SPC_SRAMCTL_REQ_SHIFT)) & SPC_SRAMCTL_REQ_MASK) - -#define SPC_SRAMCTL_ACK_MASK (0x80000000U) -#define SPC_SRAMCTL_ACK_SHIFT (31U) -/*! ACK - SRAM Voltage Update Request Acknowledge - * 0b0..Not acknowledged - * 0b1..Acknowledged - */ -#define SPC_SRAMCTL_ACK(x) (((uint32_t)(((uint32_t)(x)) << SPC_SRAMCTL_ACK_SHIFT)) & SPC_SRAMCTL_ACK_MASK) -/*! @} */ - -/*! @name SRAMRETLDO_REFTRIM - SRAM Retention Reference Trim */ -/*! @{ */ - -#define SPC_SRAMRETLDO_REFTRIM_REFTRIM_MASK (0x1FU) -#define SPC_SRAMRETLDO_REFTRIM_REFTRIM_SHIFT (0U) -/*! REFTRIM - Reference Trim. Voltage range is around 0.48V - 0.85V. Trim step is 12 mV. */ -#define SPC_SRAMRETLDO_REFTRIM_REFTRIM(x) (((uint32_t)(((uint32_t)(x)) << SPC_SRAMRETLDO_REFTRIM_REFTRIM_SHIFT)) & SPC_SRAMRETLDO_REFTRIM_REFTRIM_MASK) -/*! @} */ - -/*! @name SRAMRETLDO_CNTRL - SRAM Retention LDO Control */ -/*! @{ */ - -#define SPC_SRAMRETLDO_CNTRL_SRAMLDO_ON_MASK (0x1U) -#define SPC_SRAMRETLDO_CNTRL_SRAMLDO_ON_SHIFT (0U) -/*! SRAMLDO_ON - SRAM LDO Regulator Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_SRAMRETLDO_CNTRL_SRAMLDO_ON(x) (((uint32_t)(((uint32_t)(x)) << SPC_SRAMRETLDO_CNTRL_SRAMLDO_ON_SHIFT)) & SPC_SRAMRETLDO_CNTRL_SRAMLDO_ON_MASK) - -#define SPC_SRAMRETLDO_CNTRL_SRAM_RET_EN_MASK (0xF00U) -#define SPC_SRAMRETLDO_CNTRL_SRAM_RET_EN_SHIFT (8U) -/*! SRAM_RET_EN - SRAM Retention */ -#define SPC_SRAMRETLDO_CNTRL_SRAM_RET_EN(x) (((uint32_t)(((uint32_t)(x)) << SPC_SRAMRETLDO_CNTRL_SRAM_RET_EN_SHIFT)) & SPC_SRAMRETLDO_CNTRL_SRAM_RET_EN_MASK) -/*! @} */ - -/*! @name ACTIVE_CFG - Active Power Mode Configuration */ -/*! @{ */ - -#define SPC_ACTIVE_CFG_CORELDO_VDD_DS_MASK (0x1U) -#define SPC_ACTIVE_CFG_CORELDO_VDD_DS_SHIFT (0U) -/*! CORELDO_VDD_DS - LDO_CORE VDD Drive Strength - * 0b0..Low - * 0b1..Normal - */ -#define SPC_ACTIVE_CFG_CORELDO_VDD_DS(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_CORELDO_VDD_DS_SHIFT)) & SPC_ACTIVE_CFG_CORELDO_VDD_DS_MASK) - -#define SPC_ACTIVE_CFG_CORELDO_VDD_LVL_MASK (0xCU) -#define SPC_ACTIVE_CFG_CORELDO_VDD_LVL_SHIFT (2U) -/*! CORELDO_VDD_LVL - LDO_CORE VDD Regulator Voltage Level - * 0b00.. - * 0b01..Regulate to mid voltage (1.0 V) - * 0b10..Regulate to normal voltage (1.1 V) - * 0b11..Reserved - * 0b11..Reserved - */ -#define SPC_ACTIVE_CFG_CORELDO_VDD_LVL(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_CORELDO_VDD_LVL_SHIFT)) & SPC_ACTIVE_CFG_CORELDO_VDD_LVL_MASK) - -#define SPC_ACTIVE_CFG_BGMODE_MASK (0x300000U) -#define SPC_ACTIVE_CFG_BGMODE_SHIFT (20U) -/*! BGMODE - Bandgap Mode - * 0b00..Bandgap disabled - * 0b01..Bandgap enabled, buffer disabled - * 0b10..Bandgap enabled, buffer enabled - * 0b11.. - */ -#define SPC_ACTIVE_CFG_BGMODE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_BGMODE_SHIFT)) & SPC_ACTIVE_CFG_BGMODE_MASK) - -#define SPC_ACTIVE_CFG_VDD_VD_DISABLE_MASK (0x800000U) -#define SPC_ACTIVE_CFG_VDD_VD_DISABLE_SHIFT (23U) -/*! VDD_VD_DISABLE - VDD Voltage Detect Disable - * 0b0..Enable - * 0b1..Disable - */ -#define SPC_ACTIVE_CFG_VDD_VD_DISABLE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_VDD_VD_DISABLE_SHIFT)) & SPC_ACTIVE_CFG_VDD_VD_DISABLE_MASK) - -#define SPC_ACTIVE_CFG_CORE_LVDE_MASK (0x1000000U) -#define SPC_ACTIVE_CFG_CORE_LVDE_SHIFT (24U) -/*! CORE_LVDE - Core Low-Voltage Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_ACTIVE_CFG_CORE_LVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_CORE_LVDE_SHIFT)) & SPC_ACTIVE_CFG_CORE_LVDE_MASK) - -#define SPC_ACTIVE_CFG_SYS_LVDE_MASK (0x2000000U) -#define SPC_ACTIVE_CFG_SYS_LVDE_SHIFT (25U) -/*! SYS_LVDE - System Low-Voltage Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_ACTIVE_CFG_SYS_LVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_SYS_LVDE_SHIFT)) & SPC_ACTIVE_CFG_SYS_LVDE_MASK) - -#define SPC_ACTIVE_CFG_SYS_HVDE_MASK (0x10000000U) -#define SPC_ACTIVE_CFG_SYS_HVDE_SHIFT (28U) -/*! SYS_HVDE - System High-Voltage Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_ACTIVE_CFG_SYS_HVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_SYS_HVDE_SHIFT)) & SPC_ACTIVE_CFG_SYS_HVDE_MASK) -/*! @} */ - -/*! @name ACTIVE_CFG1 - Active Power Mode Configuration 1 */ -/*! @{ */ - -#define SPC_ACTIVE_CFG1_SOC_CNTRL_MASK (0xFFFFFFFFU) -#define SPC_ACTIVE_CFG1_SOC_CNTRL_SHIFT (0U) -/*! SOC_CNTRL - Active Config Chip Control */ -#define SPC_ACTIVE_CFG1_SOC_CNTRL(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG1_SOC_CNTRL_SHIFT)) & SPC_ACTIVE_CFG1_SOC_CNTRL_MASK) -/*! @} */ - -/*! @name LP_CFG - Low-Power Mode Configuration */ -/*! @{ */ - -#define SPC_LP_CFG_CORELDO_VDD_DS_MASK (0x1U) -#define SPC_LP_CFG_CORELDO_VDD_DS_SHIFT (0U) -/*! CORELDO_VDD_DS - LDO_CORE VDD Drive Strength - * 0b0..Low - * 0b1..Normal - */ -#define SPC_LP_CFG_CORELDO_VDD_DS(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_CORELDO_VDD_DS_SHIFT)) & SPC_LP_CFG_CORELDO_VDD_DS_MASK) - -#define SPC_LP_CFG_CORELDO_VDD_LVL_MASK (0xCU) -#define SPC_LP_CFG_CORELDO_VDD_LVL_SHIFT (2U) -/*! CORELDO_VDD_LVL - LDO_CORE VDD Regulator Voltage Level - * 0b00..Retention voltage - * 0b01..Mid voltage (1.0 V) - * 0b10..Normal voltage (1.1 V) - * 0b11..Reserved - * 0b11..Overdrive voltage (1.15 V) - */ -#define SPC_LP_CFG_CORELDO_VDD_LVL(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_CORELDO_VDD_LVL_SHIFT)) & SPC_LP_CFG_CORELDO_VDD_LVL_MASK) - -#define SPC_LP_CFG_SRAMLDO_DPD_ON_MASK (0x80000U) -#define SPC_LP_CFG_SRAMLDO_DPD_ON_SHIFT (19U) -/*! SRAMLDO_DPD_ON - SRAM_LDO Deep Power Low Power IREF Enable - * 0b0..Low Power IREF is disabled for power saving in Deep Power Down mode - * 0b1..Low Power IREF is enabled - */ -#define SPC_LP_CFG_SRAMLDO_DPD_ON(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_SRAMLDO_DPD_ON_SHIFT)) & SPC_LP_CFG_SRAMLDO_DPD_ON_MASK) - -#define SPC_LP_CFG_BGMODE_MASK (0x300000U) -#define SPC_LP_CFG_BGMODE_SHIFT (20U) -/*! BGMODE - Bandgap Mode - * 0b00..Bandgap disabled - * 0b01..Bandgap enabled, buffer disabled - * 0b10..Bandgap enabled, buffer enabled - * 0b11.. - */ -#define SPC_LP_CFG_BGMODE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_BGMODE_SHIFT)) & SPC_LP_CFG_BGMODE_MASK) - -#define SPC_LP_CFG_LP_IREFEN_MASK (0x800000U) -#define SPC_LP_CFG_LP_IREFEN_SHIFT (23U) -/*! LP_IREFEN - Low-Power IREF Enable - * 0b0..Disable for power saving in Deep Power Down mode - * 0b1..Enable - */ -#define SPC_LP_CFG_LP_IREFEN(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_LP_IREFEN_SHIFT)) & SPC_LP_CFG_LP_IREFEN_MASK) - -#define SPC_LP_CFG_CORE_LVDE_MASK (0x1000000U) -#define SPC_LP_CFG_CORE_LVDE_SHIFT (24U) -/*! CORE_LVDE - Core Low Voltage Detect Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LP_CFG_CORE_LVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_CORE_LVDE_SHIFT)) & SPC_LP_CFG_CORE_LVDE_MASK) - -#define SPC_LP_CFG_SYS_LVDE_MASK (0x2000000U) -#define SPC_LP_CFG_SYS_LVDE_SHIFT (25U) -/*! SYS_LVDE - System Low Voltage Detect Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LP_CFG_SYS_LVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_SYS_LVDE_SHIFT)) & SPC_LP_CFG_SYS_LVDE_MASK) - -#define SPC_LP_CFG_SYS_HVDE_MASK (0x10000000U) -#define SPC_LP_CFG_SYS_HVDE_SHIFT (28U) -/*! SYS_HVDE - System High Voltage Detect Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LP_CFG_SYS_HVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_SYS_HVDE_SHIFT)) & SPC_LP_CFG_SYS_HVDE_MASK) -/*! @} */ - -/*! @name LP_CFG1 - Low Power Mode Configuration 1 */ -/*! @{ */ - -#define SPC_LP_CFG1_SOC_CNTRL_MASK (0xFFFFFFFFU) -#define SPC_LP_CFG1_SOC_CNTRL_SHIFT (0U) -/*! SOC_CNTRL - Low-Power Configuration Chip Control */ -#define SPC_LP_CFG1_SOC_CNTRL(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG1_SOC_CNTRL_SHIFT)) & SPC_LP_CFG1_SOC_CNTRL_MASK) -/*! @} */ - -/*! @name LPWKUP_DELAY - Low Power Wake-Up Delay */ -/*! @{ */ - -#define SPC_LPWKUP_DELAY_LPWKUP_DELAY_MASK (0xFFFFU) -#define SPC_LPWKUP_DELAY_LPWKUP_DELAY_SHIFT (0U) -/*! LPWKUP_DELAY - Low-Power Wake-Up Delay */ -#define SPC_LPWKUP_DELAY_LPWKUP_DELAY(x) (((uint32_t)(((uint32_t)(x)) << SPC_LPWKUP_DELAY_LPWKUP_DELAY_SHIFT)) & SPC_LPWKUP_DELAY_LPWKUP_DELAY_MASK) -/*! @} */ - -/*! @name ACTIVE_VDELAY - Active Voltage Trim Delay */ -/*! @{ */ - -#define SPC_ACTIVE_VDELAY_ACTIVE_VDELAY_MASK (0xFFFFU) -#define SPC_ACTIVE_VDELAY_ACTIVE_VDELAY_SHIFT (0U) -/*! ACTIVE_VDELAY - Active Voltage Delay */ -#define SPC_ACTIVE_VDELAY_ACTIVE_VDELAY(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_VDELAY_ACTIVE_VDELAY_SHIFT)) & SPC_ACTIVE_VDELAY_ACTIVE_VDELAY_MASK) -/*! @} */ - -/*! @name VD_STAT - Voltage Detect Status */ -/*! @{ */ - -#define SPC_VD_STAT_COREVDD_LVDF_MASK (0x1U) -#define SPC_VD_STAT_COREVDD_LVDF_SHIFT (0U) -/*! COREVDD_LVDF - Core Low-Voltage Detect Flag - * 0b0..Event not detected - * 0b1..Event detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_VD_STAT_COREVDD_LVDF(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_STAT_COREVDD_LVDF_SHIFT)) & SPC_VD_STAT_COREVDD_LVDF_MASK) - -#define SPC_VD_STAT_SYSVDD_LVDF_MASK (0x2U) -#define SPC_VD_STAT_SYSVDD_LVDF_SHIFT (1U) -/*! SYSVDD_LVDF - System Low-Voltage Detect Flag - * 0b0..Event not detected - * 0b1..Event detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_VD_STAT_SYSVDD_LVDF(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_STAT_SYSVDD_LVDF_SHIFT)) & SPC_VD_STAT_SYSVDD_LVDF_MASK) - -#define SPC_VD_STAT_SYSVDD_HVDF_MASK (0x20U) -#define SPC_VD_STAT_SYSVDD_HVDF_SHIFT (5U) -/*! SYSVDD_HVDF - System HVD Flag - * 0b0..Event not detected - * 0b1..Event detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_VD_STAT_SYSVDD_HVDF(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_STAT_SYSVDD_HVDF_SHIFT)) & SPC_VD_STAT_SYSVDD_HVDF_MASK) -/*! @} */ - -/*! @name VD_CORE_CFG - Core Voltage Detect Configuration */ -/*! @{ */ - -#define SPC_VD_CORE_CFG_LVDRE_MASK (0x1U) -#define SPC_VD_CORE_CFG_LVDRE_SHIFT (0U) -/*! LVDRE - Core LVD Reset Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_CORE_CFG_LVDRE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_CORE_CFG_LVDRE_SHIFT)) & SPC_VD_CORE_CFG_LVDRE_MASK) - -#define SPC_VD_CORE_CFG_LVDIE_MASK (0x2U) -#define SPC_VD_CORE_CFG_LVDIE_SHIFT (1U) -/*! LVDIE - Core LVD Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_CORE_CFG_LVDIE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_CORE_CFG_LVDIE_SHIFT)) & SPC_VD_CORE_CFG_LVDIE_MASK) - -#define SPC_VD_CORE_CFG_LOCK_MASK (0x10000U) -#define SPC_VD_CORE_CFG_LOCK_SHIFT (16U) -/*! LOCK - Core Voltage Detect Reset Enable Lock - * 0b0..Allow - * 0b1..Deny - */ -#define SPC_VD_CORE_CFG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_CORE_CFG_LOCK_SHIFT)) & SPC_VD_CORE_CFG_LOCK_MASK) -/*! @} */ - -/*! @name VD_SYS_CFG - System Voltage Detect Configuration */ -/*! @{ */ - -#define SPC_VD_SYS_CFG_LVDRE_MASK (0x1U) -#define SPC_VD_SYS_CFG_LVDRE_SHIFT (0U) -/*! LVDRE - System LVD Reset Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_SYS_CFG_LVDRE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_SYS_CFG_LVDRE_SHIFT)) & SPC_VD_SYS_CFG_LVDRE_MASK) - -#define SPC_VD_SYS_CFG_LVDIE_MASK (0x2U) -#define SPC_VD_SYS_CFG_LVDIE_SHIFT (1U) -/*! LVDIE - System LVD Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_SYS_CFG_LVDIE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_SYS_CFG_LVDIE_SHIFT)) & SPC_VD_SYS_CFG_LVDIE_MASK) - -#define SPC_VD_SYS_CFG_HVDRE_MASK (0x4U) -#define SPC_VD_SYS_CFG_HVDRE_SHIFT (2U) -/*! HVDRE - System HVD Reset Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_SYS_CFG_HVDRE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_SYS_CFG_HVDRE_SHIFT)) & SPC_VD_SYS_CFG_HVDRE_MASK) - -#define SPC_VD_SYS_CFG_HVDIE_MASK (0x8U) -#define SPC_VD_SYS_CFG_HVDIE_SHIFT (3U) -/*! HVDIE - System HVD Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_SYS_CFG_HVDIE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_SYS_CFG_HVDIE_SHIFT)) & SPC_VD_SYS_CFG_HVDIE_MASK) - -#define SPC_VD_SYS_CFG_LVSEL_MASK (0x100U) -#define SPC_VD_SYS_CFG_LVSEL_SHIFT (8U) -/*! LVSEL - System Low-Voltage Level Select - * 0b0..Normal - * 0b1..Safe - */ -#define SPC_VD_SYS_CFG_LVSEL(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_SYS_CFG_LVSEL_SHIFT)) & SPC_VD_SYS_CFG_LVSEL_MASK) - -#define SPC_VD_SYS_CFG_LOCK_MASK (0x10000U) -#define SPC_VD_SYS_CFG_LOCK_SHIFT (16U) -/*! LOCK - System Voltage Detect Reset Enable Lock - * 0b0..Allow - * 0b1..Deny - */ -#define SPC_VD_SYS_CFG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_SYS_CFG_LOCK_SHIFT)) & SPC_VD_SYS_CFG_LOCK_MASK) -/*! @} */ - -/*! @name EVD_CFG - External Voltage Domain Configuration */ -/*! @{ */ - -#define SPC_EVD_CFG_EVDISO_MASK (0xFU) -#define SPC_EVD_CFG_EVDISO_SHIFT (0U) -/*! EVDISO - External Voltage Domain Isolation */ -#define SPC_EVD_CFG_EVDISO(x) (((uint32_t)(((uint32_t)(x)) << SPC_EVD_CFG_EVDISO_SHIFT)) & SPC_EVD_CFG_EVDISO_MASK) - -#define SPC_EVD_CFG_EVDLPISO_MASK (0xF00U) -#define SPC_EVD_CFG_EVDLPISO_SHIFT (8U) -/*! EVDLPISO - External Voltage Domain Low-Power Isolation */ -#define SPC_EVD_CFG_EVDLPISO(x) (((uint32_t)(((uint32_t)(x)) << SPC_EVD_CFG_EVDLPISO_SHIFT)) & SPC_EVD_CFG_EVDLPISO_MASK) - -#define SPC_EVD_CFG_EVDSTAT_MASK (0xF0000U) -#define SPC_EVD_CFG_EVDSTAT_SHIFT (16U) -/*! EVDSTAT - External Voltage Domain Status */ -#define SPC_EVD_CFG_EVDSTAT(x) (((uint32_t)(((uint32_t)(x)) << SPC_EVD_CFG_EVDSTAT_SHIFT)) & SPC_EVD_CFG_EVDSTAT_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group SPC_Register_Masks */ - - -/* SPC - Peripheral instance base addresses */ -/** Peripheral SPC0 base address */ -#define SPC0_BASE (0x40090000u) -/** Peripheral SPC0 base pointer */ -#define SPC0 ((SPC_Type *)SPC0_BASE) -/** Array initializer of SPC peripheral base addresses */ -#define SPC_BASE_ADDRS { SPC0_BASE } -/** Array initializer of SPC peripheral base pointers */ -#define SPC_BASE_PTRS { SPC0 } - -/*! - * @} - */ /* end of group SPC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- SYSCON Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SYSCON_Peripheral_Access_Layer SYSCON Peripheral Access Layer - * @{ - */ - -/** SYSCON - Register Layout Typedef */ -typedef struct { - uint8_t RESERVED_0[512]; - __IO uint32_t REMAP; /**< AHB Matrix Remap Control, offset: 0x200 */ - uint8_t RESERVED_1[12]; - __IO uint32_t AHBMATPRIO; /**< AHB Matrix Priority Control, offset: 0x210 */ - uint8_t RESERVED_2[40]; - __IO uint32_t CPU0NSTCKCAL; /**< Non-Secure CPU0 System Tick Calibration, offset: 0x23C */ - uint8_t RESERVED_3[8]; - __IO uint32_t NMISRC; /**< NMI Source Select, offset: 0x248 */ - uint8_t RESERVED_4[300]; - __IO uint32_t SLOWCLKDIV; /**< SLOW_CLK Clock Divider, offset: 0x378 */ - uint8_t RESERVED_5[4]; - __IO uint32_t AHBCLKDIV; /**< System Clock Divider, offset: 0x380 */ - uint8_t RESERVED_6[120]; - __IO uint32_t CLKUNLOCK; /**< Clock Configuration Unlock, offset: 0x3FC */ - __IO uint32_t NVM_CTRL; /**< NVM Control, offset: 0x400 */ - uint32_t ROMCR; /**< ROM Wait State, offset: 0x404 */ - uint8_t RESERVED_7[1028]; - __I uint32_t CPUSTAT; /**< CPU Status, offset: 0x80C */ - uint8_t RESERVED_8[20]; - __IO uint32_t LPCAC_CTRL; /**< LPCAC Control, offset: 0x824 */ - uint8_t RESERVED_9[272]; - __IO uint32_t PWM0SUBCTL; /**< PWM0 Submodule Control, offset: 0x938 */ - __IO uint32_t PWM1SUBCTL; /**< PWM1 Submodule Control, offset: 0x93C */ - __IO uint32_t CTIMERGLOBALSTARTEN; /**< CTIMER Global Start Enable, offset: 0x940 */ - __IO uint32_t RAM_CTRL; /**< RAM Control, offset: 0x944 */ - uint8_t RESERVED_10[536]; - __IO uint32_t GRAY_CODE_LSB; /**< Gray to Binary Converter Gray Code [31:0], offset: 0xB60 */ - __IO uint32_t GRAY_CODE_MSB; /**< Gray to Binary Converter Gray Code [41:32], offset: 0xB64 */ - __I uint32_t BINARY_CODE_LSB; /**< Gray to Binary Converter Binary Code [31:0], offset: 0xB68 */ - __I uint32_t BINARY_CODE_MSB; /**< Gray to Binary Converter Binary Code [41:32], offset: 0xB6C */ - uint8_t RESERVED_11[716]; - __I uint32_t ROP_STATE; /**< ROP State Register, offset: 0xE3C */ - __I uint32_t OVP_PAD_STATE; /**< OVP_PAD_STATE, offset: 0xE40 */ - __I uint32_t PROBE_STATE; /**< PROBE_STATE, offset: 0xE44 */ - __I uint32_t FT_STATE_A; /**< FT_STATE_A, offset: 0xE48 */ - __I uint32_t FT_STATE_B; /**< FT_STATE_B, offset: 0xE4C */ - uint8_t RESERVED_12[8]; - __IO uint32_t SRAM_XEN; /**< RAM XEN Control, offset: 0xE58 */ - __IO uint32_t SRAM_XEN_DP; /**< RAM XEN Control (Duplicate), offset: 0xE5C */ - uint8_t RESERVED_13[32]; - __I uint32_t ELS_OTP_LC_STATE; /**< Life Cycle State Register, offset: 0xE80 */ - __I uint32_t ELS_OTP_LC_STATE_DP; /**< Life Cycle State Register (Duplicate), offset: 0xE84 */ - uint8_t RESERVED_14[280]; - __IO uint32_t DEBUG_LOCK_EN; /**< Control Write Access to Security, offset: 0xFA0 */ - __IO uint32_t DEBUG_FEATURES; /**< Cortex Debug Features Control, offset: 0xFA4 */ - __IO uint32_t DEBUG_FEATURES_DP; /**< Cortex Debug Features Control (Duplicate), offset: 0xFA8 */ - uint8_t RESERVED_15[8]; - __IO uint32_t SWD_ACCESS_CPU0; /**< CPU0 Software Debug Access, offset: 0xFB4 */ - uint8_t RESERVED_16[8]; - __IO uint32_t DEBUG_AUTH_BEACON; /**< Debug Authentication BEACON, offset: 0xFC0 */ - uint8_t RESERVED_17[44]; - __I uint32_t JTAG_ID; /**< JTAG Chip ID, offset: 0xFF0 */ - __I uint32_t DEVICE_TYPE; /**< Device Type, offset: 0xFF4 */ - __I uint32_t DEVICE_ID0; /**< Device ID, offset: 0xFF8 */ - __I uint32_t DIEID; /**< Chip Revision ID and Number, offset: 0xFFC */ -} SYSCON_Type; - -/* ---------------------------------------------------------------------------- - -- SYSCON Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SYSCON_Register_Masks SYSCON Register Masks - * @{ - */ - -/*! @name REMAP - AHB Matrix Remap Control */ -/*! @{ */ - -#define SYSCON_REMAP_CPU0_SBUS_MASK (0x3U) -#define SYSCON_REMAP_CPU0_SBUS_SHIFT (0U) -/*! CPU0_SBUS - RAMX0 address remap for CPU System bus - * 0b00..RAMX0: 0x04000000 - 0x04001fff - * 0b01..RAMX0: 0x2001e000 - 0x2001ffff(for 128KB RAM chip) / 0x20016000 - 0x20017fff(for 96KB RAM chip) / 0x2000e000 - 0x2000ffff(for 64KB RAM chip) - */ -#define SYSCON_REMAP_CPU0_SBUS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_REMAP_CPU0_SBUS_SHIFT)) & SYSCON_REMAP_CPU0_SBUS_MASK) - -#define SYSCON_REMAP_DMA0_MASK (0xCU) -#define SYSCON_REMAP_DMA0_SHIFT (2U) -/*! DMA0 - RAMX0 address remap for DMA0 - * 0b00..RAMX0: 0x04000000 - 0x04001fff - * 0b01..RAMX0: same alias space as CPU0_SBUS - */ -#define SYSCON_REMAP_DMA0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_REMAP_DMA0_SHIFT)) & SYSCON_REMAP_DMA0_MASK) - -#define SYSCON_REMAP_USB0_MASK (0x30U) -#define SYSCON_REMAP_USB0_SHIFT (4U) -/*! USB0 - RAMX0 address remap for USB0 - * 0b00..RAMX0: 0x04000000 - 0x04001fff - * 0b01..RAMX0: same alias space as CPU0_SBUS - */ -#define SYSCON_REMAP_USB0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_REMAP_USB0_SHIFT)) & SYSCON_REMAP_USB0_MASK) - -#define SYSCON_REMAP_LOCK_MASK (0x80000000U) -#define SYSCON_REMAP_LOCK_SHIFT (31U) -/*! LOCK - This 1-bit field provides a mechanism to limit writes to the this register to protect its - * contents. Once set, this bit remains asserted until a system reset. - * 0b0..This register is not locked and can be altered. - * 0b1..This register is locked and cannot be altered until a system reset. - */ -#define SYSCON_REMAP_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_REMAP_LOCK_SHIFT)) & SYSCON_REMAP_LOCK_MASK) -/*! @} */ - -/*! @name AHBMATPRIO - AHB Matrix Priority Control */ -/*! @{ */ - -#define SYSCON_AHBMATPRIO_CPU0_CBUS_MASK (0x3U) -#define SYSCON_AHBMATPRIO_CPU0_CBUS_SHIFT (0U) -/*! CPU0_CBUS - CPU0 C-AHB bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_CPU0_CBUS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_CPU0_CBUS_SHIFT)) & SYSCON_AHBMATPRIO_CPU0_CBUS_MASK) - -#define SYSCON_AHBMATPRIO_CPU0_SBUS_MASK (0xCU) -#define SYSCON_AHBMATPRIO_CPU0_SBUS_SHIFT (2U) -/*! CPU0_SBUS - CPU0 S-AHB bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_CPU0_SBUS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_CPU0_SBUS_SHIFT)) & SYSCON_AHBMATPRIO_CPU0_SBUS_MASK) - -#define SYSCON_AHBMATPRIO_DMA0_MASK (0x300U) -#define SYSCON_AHBMATPRIO_DMA0_SHIFT (8U) -/*! DMA0 - DMA0 controller bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_DMA0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_DMA0_SHIFT)) & SYSCON_AHBMATPRIO_DMA0_MASK) - -#define SYSCON_AHBMATPRIO_USB_FS_ENET_MASK (0x3000000U) -#define SYSCON_AHBMATPRIO_USB_FS_ENET_SHIFT (24U) -/*! USB_FS_ENET - USB-FS bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_USB_FS_ENET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_USB_FS_ENET_SHIFT)) & SYSCON_AHBMATPRIO_USB_FS_ENET_MASK) -/*! @} */ - -/*! @name CPU0NSTCKCAL - Non-Secure CPU0 System Tick Calibration */ -/*! @{ */ - -#define SYSCON_CPU0NSTCKCAL_TENMS_MASK (0xFFFFFFU) -#define SYSCON_CPU0NSTCKCAL_TENMS_SHIFT (0U) -/*! TENMS - Reload value for 10 ms (100 Hz) timing, subject to system clock skew errors. If the - * value reads as zero, the calibration value is not known. - */ -#define SYSCON_CPU0NSTCKCAL_TENMS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPU0NSTCKCAL_TENMS_SHIFT)) & SYSCON_CPU0NSTCKCAL_TENMS_MASK) - -#define SYSCON_CPU0NSTCKCAL_SKEW_MASK (0x1000000U) -#define SYSCON_CPU0NSTCKCAL_SKEW_SHIFT (24U) -/*! SKEW - Indicates whether the TENMS value is exact. - * 0b0..TENMS value is exact - * 0b1..TENMS value is not exact or not given - */ -#define SYSCON_CPU0NSTCKCAL_SKEW(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPU0NSTCKCAL_SKEW_SHIFT)) & SYSCON_CPU0NSTCKCAL_SKEW_MASK) - -#define SYSCON_CPU0NSTCKCAL_NOREF_MASK (0x2000000U) -#define SYSCON_CPU0NSTCKCAL_NOREF_SHIFT (25U) -/*! NOREF - Indicates whether the device provides a reference clock to the processor. - * 0b0..Reference clock is provided - * 0b1..No reference clock is provided - */ -#define SYSCON_CPU0NSTCKCAL_NOREF(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPU0NSTCKCAL_NOREF_SHIFT)) & SYSCON_CPU0NSTCKCAL_NOREF_MASK) -/*! @} */ - -/*! @name NMISRC - NMI Source Select */ -/*! @{ */ - -#define SYSCON_NMISRC_IRQCPU0_MASK (0xFFU) -#define SYSCON_NMISRC_IRQCPU0_SHIFT (0U) -/*! IRQCPU0 - The IRQ number of the interrupt that acts as the Non-Maskable Interrupt (NMI) for CPU0, if enabled by NMIENCPU0. */ -#define SYSCON_NMISRC_IRQCPU0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NMISRC_IRQCPU0_SHIFT)) & SYSCON_NMISRC_IRQCPU0_MASK) - -#define SYSCON_NMISRC_NMIENCPU0_MASK (0x80000000U) -#define SYSCON_NMISRC_NMIENCPU0_SHIFT (31U) -/*! NMIENCPU0 - Enables the Non-Maskable Interrupt (NMI) source selected by IRQCPU0. - * 0b1..Enable. - * 0b0..Disable. - */ -#define SYSCON_NMISRC_NMIENCPU0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NMISRC_NMIENCPU0_SHIFT)) & SYSCON_NMISRC_NMIENCPU0_MASK) -/*! @} */ - -/*! @name SLOWCLKDIV - SLOW_CLK Clock Divider */ -/*! @{ */ - -#define SYSCON_SLOWCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_SLOWCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_SLOWCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SLOWCLKDIV_RESET_SHIFT)) & SYSCON_SLOWCLKDIV_RESET_MASK) - -#define SYSCON_SLOWCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_SLOWCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_SLOWCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SLOWCLKDIV_HALT_SHIFT)) & SYSCON_SLOWCLKDIV_HALT_MASK) - -#define SYSCON_SLOWCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_SLOWCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_SLOWCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SLOWCLKDIV_UNSTAB_SHIFT)) & SYSCON_SLOWCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name AHBCLKDIV - System Clock Divider */ -/*! @{ */ - -#define SYSCON_AHBCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_AHBCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_AHBCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKDIV_DIV_SHIFT)) & SYSCON_AHBCLKDIV_DIV_MASK) - -#define SYSCON_AHBCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_AHBCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_AHBCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKDIV_UNSTAB_SHIFT)) & SYSCON_AHBCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name CLKUNLOCK - Clock Configuration Unlock */ -/*! @{ */ - -#define SYSCON_CLKUNLOCK_UNLOCK_MASK (0x1U) -#define SYSCON_CLKUNLOCK_UNLOCK_SHIFT (0U) -/*! UNLOCK - Controls clock configuration registers access (for example, MRCC_xxx_CLKDIV, MRCC_xxx_CLKSEL, MRCC_GLB_xxx) - * 0b1..Freezes all clock configuration registers update. - * 0b0..Updates are allowed to all clock configuration registers - */ -#define SYSCON_CLKUNLOCK_UNLOCK(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLKUNLOCK_UNLOCK_SHIFT)) & SYSCON_CLKUNLOCK_UNLOCK_MASK) -/*! @} */ - -/*! @name NVM_CTRL - NVM Control */ -/*! @{ */ - -#define SYSCON_NVM_CTRL_DIS_FLASH_SPEC_MASK (0x1U) -#define SYSCON_NVM_CTRL_DIS_FLASH_SPEC_SHIFT (0U) -/*! DIS_FLASH_SPEC - Flash speculation control - * 0b0..Enables flash speculation - * 0b1..Disables flash speculation - */ -#define SYSCON_NVM_CTRL_DIS_FLASH_SPEC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_DIS_FLASH_SPEC_SHIFT)) & SYSCON_NVM_CTRL_DIS_FLASH_SPEC_MASK) - -#define SYSCON_NVM_CTRL_DIS_DATA_SPEC_MASK (0x2U) -#define SYSCON_NVM_CTRL_DIS_DATA_SPEC_SHIFT (1U) -/*! DIS_DATA_SPEC - Flash data speculation control - * 0b0..Enables data speculation - * 0b1..Disables data speculation - */ -#define SYSCON_NVM_CTRL_DIS_DATA_SPEC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_DIS_DATA_SPEC_SHIFT)) & SYSCON_NVM_CTRL_DIS_DATA_SPEC_MASK) - -#define SYSCON_NVM_CTRL_FLASH_STALL_EN_MASK (0x400U) -#define SYSCON_NVM_CTRL_FLASH_STALL_EN_SHIFT (10U) -/*! FLASH_STALL_EN - FLASH stall on busy control - * 0b0..No stall on FLASH busy - * 0b1..Stall on FLASH busy - */ -#define SYSCON_NVM_CTRL_FLASH_STALL_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_FLASH_STALL_EN_SHIFT)) & SYSCON_NVM_CTRL_FLASH_STALL_EN_MASK) - -#define SYSCON_NVM_CTRL_DIS_MBECC_ERR_INST_MASK (0x10000U) -#define SYSCON_NVM_CTRL_DIS_MBECC_ERR_INST_SHIFT (16U) -/*! DIS_MBECC_ERR_INST - * 0b0..Enables bus error on multi-bit ECC error for instruction - * 0b1..Disables bus error on multi-bit ECC error for instruction - */ -#define SYSCON_NVM_CTRL_DIS_MBECC_ERR_INST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_DIS_MBECC_ERR_INST_SHIFT)) & SYSCON_NVM_CTRL_DIS_MBECC_ERR_INST_MASK) - -#define SYSCON_NVM_CTRL_DIS_MBECC_ERR_DATA_MASK (0x20000U) -#define SYSCON_NVM_CTRL_DIS_MBECC_ERR_DATA_SHIFT (17U) -/*! DIS_MBECC_ERR_DATA - * 0b0..Enables bus error on multi-bit ECC error for data - * 0b1..Disables bus error on multi-bit ECC error for data - */ -#define SYSCON_NVM_CTRL_DIS_MBECC_ERR_DATA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_DIS_MBECC_ERR_DATA_SHIFT)) & SYSCON_NVM_CTRL_DIS_MBECC_ERR_DATA_MASK) -/*! @} */ - -/*! @name CPUSTAT - CPU Status */ -/*! @{ */ - -#define SYSCON_CPUSTAT_CPU0SLEEPING_MASK (0x1U) -#define SYSCON_CPUSTAT_CPU0SLEEPING_SHIFT (0U) -/*! CPU0SLEEPING - CPU0 sleeping state - * 0b1..CPU is sleeping - * 0b0..CPU is not sleeping - */ -#define SYSCON_CPUSTAT_CPU0SLEEPING(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPUSTAT_CPU0SLEEPING_SHIFT)) & SYSCON_CPUSTAT_CPU0SLEEPING_MASK) - -#define SYSCON_CPUSTAT_CPU0LOCKUP_MASK (0x4U) -#define SYSCON_CPUSTAT_CPU0LOCKUP_SHIFT (2U) -/*! CPU0LOCKUP - CPU0 lockup state - * 0b1..CPU is in lockup - * 0b0..CPU is not in lockup - */ -#define SYSCON_CPUSTAT_CPU0LOCKUP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPUSTAT_CPU0LOCKUP_SHIFT)) & SYSCON_CPUSTAT_CPU0LOCKUP_MASK) -/*! @} */ - -/*! @name LPCAC_CTRL - LPCAC Control */ -/*! @{ */ - -#define SYSCON_LPCAC_CTRL_DIS_LPCAC_MASK (0x1U) -#define SYSCON_LPCAC_CTRL_DIS_LPCAC_SHIFT (0U) -/*! DIS_LPCAC - Disables/enables the cache function. - * 0b0..Enabled - * 0b1..Disabled - */ -#define SYSCON_LPCAC_CTRL_DIS_LPCAC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_DIS_LPCAC_SHIFT)) & SYSCON_LPCAC_CTRL_DIS_LPCAC_MASK) - -#define SYSCON_LPCAC_CTRL_CLR_LPCAC_MASK (0x2U) -#define SYSCON_LPCAC_CTRL_CLR_LPCAC_SHIFT (1U) -/*! CLR_LPCAC - Clears the cache function. - * 0b0..Unclears the cache - * 0b1..Clears the cache - */ -#define SYSCON_LPCAC_CTRL_CLR_LPCAC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_CLR_LPCAC_SHIFT)) & SYSCON_LPCAC_CTRL_CLR_LPCAC_MASK) - -#define SYSCON_LPCAC_CTRL_FRC_NO_ALLOC_MASK (0x4U) -#define SYSCON_LPCAC_CTRL_FRC_NO_ALLOC_SHIFT (2U) -/*! FRC_NO_ALLOC - Forces no allocation. - * 0b0..Forces allocation - * 0b1..Forces no allocation - */ -#define SYSCON_LPCAC_CTRL_FRC_NO_ALLOC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_FRC_NO_ALLOC_SHIFT)) & SYSCON_LPCAC_CTRL_FRC_NO_ALLOC_MASK) - -#define SYSCON_LPCAC_CTRL_DIS_LPCAC_WTBF_MASK (0x10U) -#define SYSCON_LPCAC_CTRL_DIS_LPCAC_WTBF_SHIFT (4U) -/*! DIS_LPCAC_WTBF - Disable LPCAC Write Through Buffer. - * 0b1..Disables write through buffer - * 0b0..Enables write through buffer - */ -#define SYSCON_LPCAC_CTRL_DIS_LPCAC_WTBF(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_DIS_LPCAC_WTBF_SHIFT)) & SYSCON_LPCAC_CTRL_DIS_LPCAC_WTBF_MASK) - -#define SYSCON_LPCAC_CTRL_LIM_LPCAC_WTBF_MASK (0x20U) -#define SYSCON_LPCAC_CTRL_LIM_LPCAC_WTBF_SHIFT (5U) -/*! LIM_LPCAC_WTBF - Limit LPCAC Write Through Buffer. - * 0b1..Write buffer enabled when transaction is cacheable and bufferable - * 0b0..Write buffer enabled when transaction is bufferable. - */ -#define SYSCON_LPCAC_CTRL_LIM_LPCAC_WTBF(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_LIM_LPCAC_WTBF_SHIFT)) & SYSCON_LPCAC_CTRL_LIM_LPCAC_WTBF_MASK) - -#define SYSCON_LPCAC_CTRL_LPCAC_XOM_MASK (0x80U) -#define SYSCON_LPCAC_CTRL_LPCAC_XOM_SHIFT (7U) -/*! LPCAC_XOM - LPCAC XOM(eXecute-Only-Memory) attribute control - * 0b1..Enabled. - * 0b0..Disabled. - */ -#define SYSCON_LPCAC_CTRL_LPCAC_XOM(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_LPCAC_XOM_SHIFT)) & SYSCON_LPCAC_CTRL_LPCAC_XOM_MASK) - -#define SYSCON_LPCAC_CTRL_LPCAC_MEM_REQ_MASK (0x100U) -#define SYSCON_LPCAC_CTRL_LPCAC_MEM_REQ_SHIFT (8U) -/*! LPCAC_MEM_REQ - Request LPCAC memories. - * 0b1..Configure shared memories RAMX1 as LPCAC memories, write one lock until a system reset. - * 0b0..Configure shared memories RAMX1 as general memories. - */ -#define SYSCON_LPCAC_CTRL_LPCAC_MEM_REQ(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_LPCAC_MEM_REQ_SHIFT)) & SYSCON_LPCAC_CTRL_LPCAC_MEM_REQ_MASK) -/*! @} */ - -/*! @name PWM0SUBCTL - PWM0 Submodule Control */ -/*! @{ */ - -#define SYSCON_PWM0SUBCTL_CLK0_EN_MASK (0x1U) -#define SYSCON_PWM0SUBCTL_CLK0_EN_SHIFT (0U) -/*! CLK0_EN - Enables PWM0 SUB Clock0 - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_PWM0SUBCTL_CLK0_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_CLK0_EN_SHIFT)) & SYSCON_PWM0SUBCTL_CLK0_EN_MASK) - -#define SYSCON_PWM0SUBCTL_CLK1_EN_MASK (0x2U) -#define SYSCON_PWM0SUBCTL_CLK1_EN_SHIFT (1U) -/*! CLK1_EN - Enables PWM0 SUB Clock1 - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_PWM0SUBCTL_CLK1_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_CLK1_EN_SHIFT)) & SYSCON_PWM0SUBCTL_CLK1_EN_MASK) - -#define SYSCON_PWM0SUBCTL_CLK2_EN_MASK (0x4U) -#define SYSCON_PWM0SUBCTL_CLK2_EN_SHIFT (2U) -/*! CLK2_EN - Enables PWM0 SUB Clock2 - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_PWM0SUBCTL_CLK2_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_CLK2_EN_SHIFT)) & SYSCON_PWM0SUBCTL_CLK2_EN_MASK) - -#define SYSCON_PWM0SUBCTL_CLK3_EN_MASK (0x8U) -#define SYSCON_PWM0SUBCTL_CLK3_EN_SHIFT (3U) -/*! CLK3_EN - Enables PWM0 SUB Clock3 - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_PWM0SUBCTL_CLK3_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_CLK3_EN_SHIFT)) & SYSCON_PWM0SUBCTL_CLK3_EN_MASK) -/*! @} */ - -/*! @name PWM1SUBCTL - PWM1 Submodule Control */ -/*! @{ */ - -#define SYSCON_PWM1SUBCTL_CLK0_EN_MASK (0x1U) -#define SYSCON_PWM1SUBCTL_CLK0_EN_SHIFT (0U) -/*! CLK0_EN - Enables PWM1 SUB Clock0 - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_PWM1SUBCTL_CLK0_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM1SUBCTL_CLK0_EN_SHIFT)) & SYSCON_PWM1SUBCTL_CLK0_EN_MASK) - -#define SYSCON_PWM1SUBCTL_CLK1_EN_MASK (0x2U) -#define SYSCON_PWM1SUBCTL_CLK1_EN_SHIFT (1U) -/*! CLK1_EN - Enables PWM1 SUB Clock1 - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_PWM1SUBCTL_CLK1_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM1SUBCTL_CLK1_EN_SHIFT)) & SYSCON_PWM1SUBCTL_CLK1_EN_MASK) - -#define SYSCON_PWM1SUBCTL_CLK2_EN_MASK (0x4U) -#define SYSCON_PWM1SUBCTL_CLK2_EN_SHIFT (2U) -/*! CLK2_EN - Enables PWM1 SUB Clock2 - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_PWM1SUBCTL_CLK2_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM1SUBCTL_CLK2_EN_SHIFT)) & SYSCON_PWM1SUBCTL_CLK2_EN_MASK) - -#define SYSCON_PWM1SUBCTL_CLK3_EN_MASK (0x8U) -#define SYSCON_PWM1SUBCTL_CLK3_EN_SHIFT (3U) -/*! CLK3_EN - Enables PWM1 SUB Clock3 - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_PWM1SUBCTL_CLK3_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM1SUBCTL_CLK3_EN_SHIFT)) & SYSCON_PWM1SUBCTL_CLK3_EN_MASK) -/*! @} */ - -/*! @name CTIMERGLOBALSTARTEN - CTIMER Global Start Enable */ -/*! @{ */ - -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER0_CLK_EN_MASK (0x1U) -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER0_CLK_EN_SHIFT (0U) -/*! CTIMER0_CLK_EN - Enables the CTIMER0 function clock - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER0_CLK_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERGLOBALSTARTEN_CTIMER0_CLK_EN_SHIFT)) & SYSCON_CTIMERGLOBALSTARTEN_CTIMER0_CLK_EN_MASK) - -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER1_CLK_EN_MASK (0x2U) -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER1_CLK_EN_SHIFT (1U) -/*! CTIMER1_CLK_EN - Enables the CTIMER1 function clock - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER1_CLK_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERGLOBALSTARTEN_CTIMER1_CLK_EN_SHIFT)) & SYSCON_CTIMERGLOBALSTARTEN_CTIMER1_CLK_EN_MASK) - -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER2_CLK_EN_MASK (0x4U) -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER2_CLK_EN_SHIFT (2U) -/*! CTIMER2_CLK_EN - Enables the CTIMER2 function clock - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER2_CLK_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERGLOBALSTARTEN_CTIMER2_CLK_EN_SHIFT)) & SYSCON_CTIMERGLOBALSTARTEN_CTIMER2_CLK_EN_MASK) - -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER3_CLK_EN_MASK (0x8U) -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER3_CLK_EN_SHIFT (3U) -/*! CTIMER3_CLK_EN - Enables the CTIMER3 function clock - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER3_CLK_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERGLOBALSTARTEN_CTIMER3_CLK_EN_SHIFT)) & SYSCON_CTIMERGLOBALSTARTEN_CTIMER3_CLK_EN_MASK) - -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER4_CLK_EN_MASK (0x10U) -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER4_CLK_EN_SHIFT (4U) -/*! CTIMER4_CLK_EN - Enables the CTIMER4 function clock - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER4_CLK_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERGLOBALSTARTEN_CTIMER4_CLK_EN_SHIFT)) & SYSCON_CTIMERGLOBALSTARTEN_CTIMER4_CLK_EN_MASK) -/*! @} */ - -/*! @name RAM_CTRL - RAM Control */ -/*! @{ */ - -#define SYSCON_RAM_CTRL_RAMA_ECC_ENABLE_MASK (0x1U) -#define SYSCON_RAM_CTRL_RAMA_ECC_ENABLE_SHIFT (0U) -/*! RAMA_ECC_ENABLE - RAMA0 ECC enable - * 0b1..ECC is enabled - * 0b0..ECC is disabled - */ -#define SYSCON_RAM_CTRL_RAMA_ECC_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_RAM_CTRL_RAMA_ECC_ENABLE_SHIFT)) & SYSCON_RAM_CTRL_RAMA_ECC_ENABLE_MASK) - -#define SYSCON_RAM_CTRL_RAMA_CG_OVERRIDE_MASK (0x10000U) -#define SYSCON_RAM_CTRL_RAMA_CG_OVERRIDE_SHIFT (16U) -/*! RAMA_CG_OVERRIDE - RAMA bank clock gating control, only avaiable when RAMA_ECC_ENABLE = 0. - * 0b1..Auto clock gating feature is disabled - * 0b0..Memory bank clock is gated automatically if no access more than 16 clock cycles - */ -#define SYSCON_RAM_CTRL_RAMA_CG_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_RAM_CTRL_RAMA_CG_OVERRIDE_SHIFT)) & SYSCON_RAM_CTRL_RAMA_CG_OVERRIDE_MASK) - -#define SYSCON_RAM_CTRL_RAMX_CG_OVERRIDE_MASK (0x20000U) -#define SYSCON_RAM_CTRL_RAMX_CG_OVERRIDE_SHIFT (17U) -/*! RAMX_CG_OVERRIDE - RAMX bank clock gating control - * 0b1..Auto clock gating feature is disabled - * 0b0..Memory bank clock is gated automatically if no access more than 16 clock cycles - */ -#define SYSCON_RAM_CTRL_RAMX_CG_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_RAM_CTRL_RAMX_CG_OVERRIDE_SHIFT)) & SYSCON_RAM_CTRL_RAMX_CG_OVERRIDE_MASK) - -#define SYSCON_RAM_CTRL_RAMB_CG_OVERRIDE_MASK (0x40000U) -#define SYSCON_RAM_CTRL_RAMB_CG_OVERRIDE_SHIFT (18U) -/*! RAMB_CG_OVERRIDE - RAMB bank clock gating control - * 0b1..Auto clock gating feature is disabled - * 0b0..Memory bank clock is gated automatically if no access more than 16 clock cycles - */ -#define SYSCON_RAM_CTRL_RAMB_CG_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_RAM_CTRL_RAMB_CG_OVERRIDE_SHIFT)) & SYSCON_RAM_CTRL_RAMB_CG_OVERRIDE_MASK) -/*! @} */ - -/*! @name GRAY_CODE_LSB - Gray to Binary Converter Gray Code [31:0] */ -/*! @{ */ - -#define SYSCON_GRAY_CODE_LSB_code_gray_31_0_MASK (0xFFFFFFFFU) -#define SYSCON_GRAY_CODE_LSB_code_gray_31_0_SHIFT (0U) -/*! code_gray_31_0 - Gray code [31:0] */ -#define SYSCON_GRAY_CODE_LSB_code_gray_31_0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GRAY_CODE_LSB_code_gray_31_0_SHIFT)) & SYSCON_GRAY_CODE_LSB_code_gray_31_0_MASK) -/*! @} */ - -/*! @name GRAY_CODE_MSB - Gray to Binary Converter Gray Code [41:32] */ -/*! @{ */ - -#define SYSCON_GRAY_CODE_MSB_code_gray_41_32_MASK (0x3FFU) -#define SYSCON_GRAY_CODE_MSB_code_gray_41_32_SHIFT (0U) -/*! code_gray_41_32 - Gray code [41:32] */ -#define SYSCON_GRAY_CODE_MSB_code_gray_41_32(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GRAY_CODE_MSB_code_gray_41_32_SHIFT)) & SYSCON_GRAY_CODE_MSB_code_gray_41_32_MASK) -/*! @} */ - -/*! @name BINARY_CODE_LSB - Gray to Binary Converter Binary Code [31:0] */ -/*! @{ */ - -#define SYSCON_BINARY_CODE_LSB_code_bin_31_0_MASK (0xFFFFFFFFU) -#define SYSCON_BINARY_CODE_LSB_code_bin_31_0_SHIFT (0U) -/*! code_bin_31_0 - Binary code [31:0] */ -#define SYSCON_BINARY_CODE_LSB_code_bin_31_0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_BINARY_CODE_LSB_code_bin_31_0_SHIFT)) & SYSCON_BINARY_CODE_LSB_code_bin_31_0_MASK) -/*! @} */ - -/*! @name BINARY_CODE_MSB - Gray to Binary Converter Binary Code [41:32] */ -/*! @{ */ - -#define SYSCON_BINARY_CODE_MSB_code_bin_41_32_MASK (0x3FFU) -#define SYSCON_BINARY_CODE_MSB_code_bin_41_32_SHIFT (0U) -/*! code_bin_41_32 - Binary code [41:32] */ -#define SYSCON_BINARY_CODE_MSB_code_bin_41_32(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_BINARY_CODE_MSB_code_bin_41_32_SHIFT)) & SYSCON_BINARY_CODE_MSB_code_bin_41_32_MASK) -/*! @} */ - -/*! @name ROP_STATE - ROP State Register */ -/*! @{ */ - -#define SYSCON_ROP_STATE_ROP_STATE_MASK (0xFFFFFFFFU) -#define SYSCON_ROP_STATE_ROP_STATE_SHIFT (0U) -/*! ROP_STATE - ROP state */ -#define SYSCON_ROP_STATE_ROP_STATE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ROP_STATE_ROP_STATE_SHIFT)) & SYSCON_ROP_STATE_ROP_STATE_MASK) -/*! @} */ - -/*! @name OVP_PAD_STATE - OVP_PAD_STATE */ -/*! @{ */ - -#define SYSCON_OVP_PAD_STATE_OVP_PAD_STATE_MASK (0xFFFFFFFFU) -#define SYSCON_OVP_PAD_STATE_OVP_PAD_STATE_SHIFT (0U) -/*! OVP_PAD_STATE - OVP_PAD_STATE */ -#define SYSCON_OVP_PAD_STATE_OVP_PAD_STATE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_OVP_PAD_STATE_OVP_PAD_STATE_SHIFT)) & SYSCON_OVP_PAD_STATE_OVP_PAD_STATE_MASK) -/*! @} */ - -/*! @name PROBE_STATE - PROBE_STATE */ -/*! @{ */ - -#define SYSCON_PROBE_STATE_PROBE_STATE_MASK (0xFFFFFFFFU) -#define SYSCON_PROBE_STATE_PROBE_STATE_SHIFT (0U) -/*! PROBE_STATE - PROBE_STATE */ -#define SYSCON_PROBE_STATE_PROBE_STATE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PROBE_STATE_PROBE_STATE_SHIFT)) & SYSCON_PROBE_STATE_PROBE_STATE_MASK) -/*! @} */ - -/*! @name FT_STATE_A - FT_STATE_A */ -/*! @{ */ - -#define SYSCON_FT_STATE_A_FT_STATE_A_MASK (0xFFFFFFFFU) -#define SYSCON_FT_STATE_A_FT_STATE_A_SHIFT (0U) -/*! FT_STATE_A - FT_STATE_A */ -#define SYSCON_FT_STATE_A_FT_STATE_A(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FT_STATE_A_FT_STATE_A_SHIFT)) & SYSCON_FT_STATE_A_FT_STATE_A_MASK) -/*! @} */ - -/*! @name FT_STATE_B - FT_STATE_B */ -/*! @{ */ - -#define SYSCON_FT_STATE_B_FT_STATE_B_MASK (0xFFFFFFFFU) -#define SYSCON_FT_STATE_B_FT_STATE_B_SHIFT (0U) -/*! FT_STATE_B - FT_STATE_B */ -#define SYSCON_FT_STATE_B_FT_STATE_B(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FT_STATE_B_FT_STATE_B_SHIFT)) & SYSCON_FT_STATE_B_FT_STATE_B_MASK) -/*! @} */ - -/*! @name SRAM_XEN - RAM XEN Control */ -/*! @{ */ - -#define SYSCON_SRAM_XEN_RAMX0_XEN_MASK (0x1U) -#define SYSCON_SRAM_XEN_RAMX0_XEN_SHIFT (0U) -/*! RAMX0_XEN - RAMX0 Execute permission control. - * 0b1..Execute permission is enabled, R/W/X are enabled. - * 0b0..Execute permission is disabled, R/W are enabled. - */ -#define SYSCON_SRAM_XEN_RAMX0_XEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SRAM_XEN_RAMX0_XEN_SHIFT)) & SYSCON_SRAM_XEN_RAMX0_XEN_MASK) - -#define SYSCON_SRAM_XEN_RAMX1_XEN_MASK (0x2U) -#define SYSCON_SRAM_XEN_RAMX1_XEN_SHIFT (1U) -/*! RAMX1_XEN - RAMX1 Execute permission control. - * 0b1..Execute permission is enabled, R/W/X are enabled. - * 0b0..Execute permission is disabled, R/W are enabled. - */ -#define SYSCON_SRAM_XEN_RAMX1_XEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SRAM_XEN_RAMX1_XEN_SHIFT)) & SYSCON_SRAM_XEN_RAMX1_XEN_MASK) - -#define SYSCON_SRAM_XEN_RAMA0_XEN_MASK (0x4U) -#define SYSCON_SRAM_XEN_RAMA0_XEN_SHIFT (2U) -/*! RAMA0_XEN - RAMA0 Execute permission control. - * 0b1..Execute permission is enabled, R/W/X are enabled. - * 0b0..Execute permission is disabled, R/W are enabled. - */ -#define SYSCON_SRAM_XEN_RAMA0_XEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SRAM_XEN_RAMA0_XEN_SHIFT)) & SYSCON_SRAM_XEN_RAMA0_XEN_MASK) - -#define SYSCON_SRAM_XEN_RAMA1_XEN_MASK (0x8U) -#define SYSCON_SRAM_XEN_RAMA1_XEN_SHIFT (3U) -/*! RAMA1_XEN - RAMAx (excepts RAMA0) Execute permission control. - * 0b1..Execute permission is enabled, R/W/X are enabled. - * 0b0..Execute permission is disabled, R/W are enabled. - */ -#define SYSCON_SRAM_XEN_RAMA1_XEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SRAM_XEN_RAMA1_XEN_SHIFT)) & SYSCON_SRAM_XEN_RAMA1_XEN_MASK) - -#define SYSCON_SRAM_XEN_RAMB_XEN_MASK (0x10U) -#define SYSCON_SRAM_XEN_RAMB_XEN_SHIFT (4U) -/*! RAMB_XEN - RAMBx Execute permission control. - * 0b1..Execute permission is enabled, R/W/X are enabled. - * 0b0..Execute permission is disabled, R/W are enabled. - */ -#define SYSCON_SRAM_XEN_RAMB_XEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SRAM_XEN_RAMB_XEN_SHIFT)) & SYSCON_SRAM_XEN_RAMB_XEN_MASK) - -#define SYSCON_SRAM_XEN_LOCK_MASK (0x80000000U) -#define SYSCON_SRAM_XEN_LOCK_SHIFT (31U) -/*! LOCK - This 1-bit field provides a mechanism to limit writes to the this register (and - * SRAM_XEN_DP) to protect its contents. Once set, this bit remains asserted until a system reset. - * 0b0..This register is not locked and can be altered. - * 0b1..This register is locked and cannot be altered. - */ -#define SYSCON_SRAM_XEN_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SRAM_XEN_LOCK_SHIFT)) & SYSCON_SRAM_XEN_LOCK_MASK) -/*! @} */ - -/*! @name SRAM_XEN_DP - RAM XEN Control (Duplicate) */ -/*! @{ */ - -#define SYSCON_SRAM_XEN_DP_RAMX0_XEN_MASK (0x1U) -#define SYSCON_SRAM_XEN_DP_RAMX0_XEN_SHIFT (0U) -/*! RAMX0_XEN - Refer to SRAM_XEN for more details. */ -#define SYSCON_SRAM_XEN_DP_RAMX0_XEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SRAM_XEN_DP_RAMX0_XEN_SHIFT)) & SYSCON_SRAM_XEN_DP_RAMX0_XEN_MASK) - -#define SYSCON_SRAM_XEN_DP_RAMX1_XEN_MASK (0x2U) -#define SYSCON_SRAM_XEN_DP_RAMX1_XEN_SHIFT (1U) -/*! RAMX1_XEN - Refer to SRAM_XEN for more details. */ -#define SYSCON_SRAM_XEN_DP_RAMX1_XEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SRAM_XEN_DP_RAMX1_XEN_SHIFT)) & SYSCON_SRAM_XEN_DP_RAMX1_XEN_MASK) - -#define SYSCON_SRAM_XEN_DP_RAMA0_XEN_MASK (0x4U) -#define SYSCON_SRAM_XEN_DP_RAMA0_XEN_SHIFT (2U) -/*! RAMA0_XEN - Refer to SRAM_XEN for more details. */ -#define SYSCON_SRAM_XEN_DP_RAMA0_XEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SRAM_XEN_DP_RAMA0_XEN_SHIFT)) & SYSCON_SRAM_XEN_DP_RAMA0_XEN_MASK) - -#define SYSCON_SRAM_XEN_DP_RAMA1_XEN_MASK (0x8U) -#define SYSCON_SRAM_XEN_DP_RAMA1_XEN_SHIFT (3U) -/*! RAMA1_XEN - Refer to SRAM_XEN for more details. */ -#define SYSCON_SRAM_XEN_DP_RAMA1_XEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SRAM_XEN_DP_RAMA1_XEN_SHIFT)) & SYSCON_SRAM_XEN_DP_RAMA1_XEN_MASK) - -#define SYSCON_SRAM_XEN_DP_RAMB_XEN_MASK (0x10U) -#define SYSCON_SRAM_XEN_DP_RAMB_XEN_SHIFT (4U) -/*! RAMB_XEN - Refer to SRAM_XEN for more details. */ -#define SYSCON_SRAM_XEN_DP_RAMB_XEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SRAM_XEN_DP_RAMB_XEN_SHIFT)) & SYSCON_SRAM_XEN_DP_RAMB_XEN_MASK) -/*! @} */ - -/*! @name ELS_OTP_LC_STATE - Life Cycle State Register */ -/*! @{ */ - -#define SYSCON_ELS_OTP_LC_STATE_OTP_LC_STATE_MASK (0xFFU) -#define SYSCON_ELS_OTP_LC_STATE_OTP_LC_STATE_SHIFT (0U) -/*! OTP_LC_STATE - OTP life cycle state */ -#define SYSCON_ELS_OTP_LC_STATE_OTP_LC_STATE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_OTP_LC_STATE_OTP_LC_STATE_SHIFT)) & SYSCON_ELS_OTP_LC_STATE_OTP_LC_STATE_MASK) -/*! @} */ - -/*! @name ELS_OTP_LC_STATE_DP - Life Cycle State Register (Duplicate) */ -/*! @{ */ - -#define SYSCON_ELS_OTP_LC_STATE_DP_OTP_LC_STATE_DP_MASK (0xFFU) -#define SYSCON_ELS_OTP_LC_STATE_DP_OTP_LC_STATE_DP_SHIFT (0U) -/*! OTP_LC_STATE_DP - OTP life cycle state */ -#define SYSCON_ELS_OTP_LC_STATE_DP_OTP_LC_STATE_DP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_OTP_LC_STATE_DP_OTP_LC_STATE_DP_SHIFT)) & SYSCON_ELS_OTP_LC_STATE_DP_OTP_LC_STATE_DP_MASK) -/*! @} */ - -/*! @name DEBUG_LOCK_EN - Control Write Access to Security */ -/*! @{ */ - -#define SYSCON_DEBUG_LOCK_EN_LOCK_ALL_MASK (0xFU) -#define SYSCON_DEBUG_LOCK_EN_LOCK_ALL_SHIFT (0U) -/*! LOCK_ALL - Controls write access to the security registers - * 0b1010..Enables write access to all registers - * 0b0000..Any other value than b1010: disables write access to all registers - */ -#define SYSCON_DEBUG_LOCK_EN_LOCK_ALL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_LOCK_EN_LOCK_ALL_SHIFT)) & SYSCON_DEBUG_LOCK_EN_LOCK_ALL_MASK) -/*! @} */ - -/*! @name DEBUG_FEATURES - Cortex Debug Features Control */ -/*! @{ */ - -#define SYSCON_DEBUG_FEATURES_CPU0_DBGEN_MASK (0x3U) -#define SYSCON_DEBUG_FEATURES_CPU0_DBGEN_SHIFT (0U) -/*! CPU0_DBGEN - CPU0 invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_CPU0_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_CPU0_DBGEN_SHIFT)) & SYSCON_DEBUG_FEATURES_CPU0_DBGEN_MASK) - -#define SYSCON_DEBUG_FEATURES_CPU0_NIDEN_MASK (0xCU) -#define SYSCON_DEBUG_FEATURES_CPU0_NIDEN_SHIFT (2U) -/*! CPU0_NIDEN - CPU0 non-invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_CPU0_NIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_CPU0_NIDEN_SHIFT)) & SYSCON_DEBUG_FEATURES_CPU0_NIDEN_MASK) -/*! @} */ - -/*! @name DEBUG_FEATURES_DP - Cortex Debug Features Control (Duplicate) */ -/*! @{ */ - -#define SYSCON_DEBUG_FEATURES_DP_CPU0_DBGEN_MASK (0x3U) -#define SYSCON_DEBUG_FEATURES_DP_CPU0_DBGEN_SHIFT (0U) -/*! CPU0_DBGEN - CPU0 invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_DP_CPU0_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_DP_CPU0_DBGEN_SHIFT)) & SYSCON_DEBUG_FEATURES_DP_CPU0_DBGEN_MASK) - -#define SYSCON_DEBUG_FEATURES_DP_CPU0_NIDEN_MASK (0xCU) -#define SYSCON_DEBUG_FEATURES_DP_CPU0_NIDEN_SHIFT (2U) -/*! CPU0_NIDEN - CPU0 non-invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_DP_CPU0_NIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_DP_CPU0_NIDEN_SHIFT)) & SYSCON_DEBUG_FEATURES_DP_CPU0_NIDEN_MASK) -/*! @} */ - -/*! @name SWD_ACCESS_CPU0 - CPU0 Software Debug Access */ -/*! @{ */ - -#define SYSCON_SWD_ACCESS_CPU0_SEC_CODE_MASK (0xFFFFFFFFU) -#define SYSCON_SWD_ACCESS_CPU0_SEC_CODE_SHIFT (0U) -/*! SEC_CODE - CPU0 SWD-AP: 0x12345678 - * 0b00010010001101000101011001111000..Value to write to enable CPU0 SWD access. Reading back register is read as 0xA. - * 0b00000000000000000000000000000000..CPU0 DAP is not allowed. Reading back register is read as 0x5. - */ -#define SYSCON_SWD_ACCESS_CPU0_SEC_CODE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SWD_ACCESS_CPU0_SEC_CODE_SHIFT)) & SYSCON_SWD_ACCESS_CPU0_SEC_CODE_MASK) -/*! @} */ - -/*! @name DEBUG_AUTH_BEACON - Debug Authentication BEACON */ -/*! @{ */ - -#define SYSCON_DEBUG_AUTH_BEACON_BEACON_MASK (0xFFFFFFFFU) -#define SYSCON_DEBUG_AUTH_BEACON_BEACON_SHIFT (0U) -/*! BEACON - Sets by the debug authentication code in ROM to pass the debug beacons (Credential - * Beacon and Authentication Beacon) to the application code. - */ -#define SYSCON_DEBUG_AUTH_BEACON_BEACON(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_AUTH_BEACON_BEACON_SHIFT)) & SYSCON_DEBUG_AUTH_BEACON_BEACON_MASK) -/*! @} */ - -/*! @name JTAG_ID - JTAG Chip ID */ -/*! @{ */ - -#define SYSCON_JTAG_ID_JTAG_ID_MASK (0xFFFFFFFFU) -#define SYSCON_JTAG_ID_JTAG_ID_SHIFT (0U) -/*! JTAG_ID - Indicates the device ID */ -#define SYSCON_JTAG_ID_JTAG_ID(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_JTAG_ID_JTAG_ID_SHIFT)) & SYSCON_JTAG_ID_JTAG_ID_MASK) -/*! @} */ - -/*! @name DEVICE_TYPE - Device Type */ -/*! @{ */ - -#define SYSCON_DEVICE_TYPE_DEVICE_TYPE_MASK (0xFFFFFFFFU) -#define SYSCON_DEVICE_TYPE_DEVICE_TYPE_SHIFT (0U) -/*! DEVICE_TYPE - Indicates DEVICE TYPE. */ -#define SYSCON_DEVICE_TYPE_DEVICE_TYPE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEVICE_TYPE_DEVICE_TYPE_SHIFT)) & SYSCON_DEVICE_TYPE_DEVICE_TYPE_MASK) -/*! @} */ - -/*! @name DEVICE_ID0 - Device ID */ -/*! @{ */ - -#define SYSCON_DEVICE_ID0_RAM_SIZE_MASK (0xFU) -#define SYSCON_DEVICE_ID0_RAM_SIZE_SHIFT (0U) -/*! RAM_SIZE - Chip RAM Size - * 0b0000..8KB. - * 0b0001..16KB. - * 0b0010..32KB. - * 0b0011..64KB. - * 0b0100..96KB. - * 0b0101..128KB. - * 0b0110..160KB. - * 0b0111..192KB. - * 0b1000..256KB. - * 0b1001..288KB. - * 0b1010..352KB. - * 0b1011..512KB. - */ -#define SYSCON_DEVICE_ID0_RAM_SIZE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEVICE_ID0_RAM_SIZE_SHIFT)) & SYSCON_DEVICE_ID0_RAM_SIZE_MASK) - -#define SYSCON_DEVICE_ID0_FLASH_SIZE_MASK (0xF0U) -#define SYSCON_DEVICE_ID0_FLASH_SIZE_SHIFT (4U) -/*! FLASH_SIZE - Chip FLASH Size - * 0b0000..32KB. - * 0b0001..64KB. - * 0b0010..128KB. - * 0b0011..256KB. - * 0b0100..512KB. - * 0b0101..768KB. - * 0b0110..1MB. - * 0b0111..1.5MB. - * 0b1000..2MB. - */ -#define SYSCON_DEVICE_ID0_FLASH_SIZE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEVICE_ID0_FLASH_SIZE_SHIFT)) & SYSCON_DEVICE_ID0_FLASH_SIZE_MASK) - -#define SYSCON_DEVICE_ID0_SECURITY_MASK (0xF000000U) -#define SYSCON_DEVICE_ID0_SECURITY_SHIFT (24U) -/*! SECURITY - * 0b1010..Non secure version. - * 0b0101..Secure version. - */ -#define SYSCON_DEVICE_ID0_SECURITY(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEVICE_ID0_SECURITY_SHIFT)) & SYSCON_DEVICE_ID0_SECURITY_MASK) -/*! @} */ - -/*! @name DIEID - Chip Revision ID and Number */ -/*! @{ */ - -#define SYSCON_DIEID_MINOR_REVISION_MASK (0xFU) -#define SYSCON_DIEID_MINOR_REVISION_SHIFT (0U) -/*! MINOR_REVISION - Chip minor revision */ -#define SYSCON_DIEID_MINOR_REVISION(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DIEID_MINOR_REVISION_SHIFT)) & SYSCON_DIEID_MINOR_REVISION_MASK) - -#define SYSCON_DIEID_MAJOR_REVISION_MASK (0xF0U) -#define SYSCON_DIEID_MAJOR_REVISION_SHIFT (4U) -/*! MAJOR_REVISION - Chip major revision */ -#define SYSCON_DIEID_MAJOR_REVISION(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DIEID_MAJOR_REVISION_SHIFT)) & SYSCON_DIEID_MAJOR_REVISION_MASK) - -#define SYSCON_DIEID_MCO_NUM_IN_DIE_ID_MASK (0xFFFFF00U) -#define SYSCON_DIEID_MCO_NUM_IN_DIE_ID_SHIFT (8U) -/*! MCO_NUM_IN_DIE_ID - Chip number */ -#define SYSCON_DIEID_MCO_NUM_IN_DIE_ID(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DIEID_MCO_NUM_IN_DIE_ID_SHIFT)) & SYSCON_DIEID_MCO_NUM_IN_DIE_ID_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group SYSCON_Register_Masks */ - - -/* SYSCON - Peripheral instance base addresses */ -/** Peripheral SYSCON base address */ -#define SYSCON_BASE (0x40091000u) -/** Peripheral SYSCON base pointer */ -#define SYSCON ((SYSCON_Type *)SYSCON_BASE) -/** Array initializer of SYSCON peripheral base addresses */ -#define SYSCON_BASE_ADDRS { SYSCON_BASE } -/** Array initializer of SYSCON peripheral base pointers */ -#define SYSCON_BASE_PTRS { SYSCON } - -/*! - * @} - */ /* end of group SYSCON_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- TRDC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup TRDC_Peripheral_Access_Layer TRDC Peripheral Access Layer - * @{ - */ - -/** TRDC - Register Layout Typedef */ -typedef struct { - struct { /* offset: 0x0, array step: 0x1AC */ - __IO uint32_t MBC_MEM_GLBCFG[4]; /**< MBC Global Configuration Register, array offset: 0x0, array step: index*0x1AC, index2*0x4 */ - uint8_t RESERVED_0[16]; - __IO uint32_t MBC_MEMN_GLBAC[8]; /**< MBC Global Access Control, array offset: 0x20, array step: index*0x1AC, index2*0x4 */ - __IO uint32_t MBC_DOM0_MEM0_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x40, array step: index*0x1AC, index2*0x4 */ - uint8_t RESERVED_1[288]; - __IO uint32_t MBC_DOM0_MEM1_BLK_CFG_W[1]; /**< MBC Memory Block Configuration Word, array offset: 0x180, array step: index*0x1AC, index2*0x4 */ - uint8_t RESERVED_2[36]; - __IO uint32_t MBC_DOM0_MEM2_BLK_CFG_W[1]; /**< MBC Memory Block Configuration Word, array offset: 0x1A8, array step: index*0x1AC, index2*0x4 */ - } MBC_INDEX[1]; -} TRDC_Type; - -/* ---------------------------------------------------------------------------- - -- TRDC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup TRDC_Register_Masks TRDC Register Masks - * @{ - */ - -/*! @name MBC_INDEX_MBC_MEM_GLBCFG - MBC Global Configuration Register */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_NBLKS_MASK (0x3FFU) -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_NBLKS_SHIFT (0U) -/*! NBLKS - Number of blocks in this memory */ -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_NBLKS(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEM_GLBCFG_NBLKS_SHIFT)) & TRDC_MBC_INDEX_MBC_MEM_GLBCFG_NBLKS_MASK) - -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_SIZE_LOG2_MASK (0x1F0000U) -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_SIZE_LOG2_SHIFT (16U) -/*! SIZE_LOG2 - Log2 size per block */ -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_SIZE_LOG2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEM_GLBCFG_SIZE_LOG2_SHIFT)) & TRDC_MBC_INDEX_MBC_MEM_GLBCFG_SIZE_LOG2_MASK) - -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_CLRE_MASK (0xC0000000U) -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_CLRE_SHIFT (30U) -/*! CLRE - Clear Error */ -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_CLRE(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEM_GLBCFG_CLRE_SHIFT)) & TRDC_MBC_INDEX_MBC_MEM_GLBCFG_CLRE_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_MEM_GLBCFG */ -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_MEM_GLBCFG */ -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_COUNT2 (4U) - -/*! @name MBC_INDEX_MBC_MEMN_GLBAC - MBC Global Access Control */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUX_MASK (0x1U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUX_SHIFT (0U) -/*! NUX - NonsecureUser Execute - * 0b0..Execute access is not allowed in Nonsecure User mode. - * 0b1..Execute access is allowed in Nonsecure User mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUX(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUX_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUX_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUW_MASK (0x2U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUW_SHIFT (1U) -/*! NUW - NonsecureUser Write - * 0b0..Write access is not allowed in Nonsecure User mode. - * 0b1..Write access is allowed in Nonsecure User mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUW(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUW_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUW_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUR_MASK (0x4U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUR_SHIFT (2U) -/*! NUR - NonsecureUser Read - * 0b0..Read access is not allowed in Nonsecure User mode. - * 0b1..Read access is allowed in Nonsecure User mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUR(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUR_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUR_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPX_MASK (0x10U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPX_SHIFT (4U) -/*! NPX - NonsecurePriv Execute - * 0b0..Execute access is not allowed in Nonsecure Privilege mode. - * 0b1..Execute access is allowed in Nonsecure Privilege mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPX(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPX_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPX_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPW_MASK (0x20U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPW_SHIFT (5U) -/*! NPW - NonsecurePriv Write - * 0b0..Write access is not allowed in Nonsecure Privilege mode. - * 0b1..Write access is allowed in Nonsecure Privilege mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPW(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPW_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPW_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPR_MASK (0x40U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPR_SHIFT (6U) -/*! NPR - NonsecurePriv Read - * 0b0..Read access is not allowed in Nonsecure Privilege mode. - * 0b1..Read access is allowed in Nonsecure Privilege mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPR(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPR_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPR_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUX_MASK (0x100U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUX_SHIFT (8U) -/*! SUX - SecureUser Execute - * 0b0..Execute access is not allowed in Secure User mode. - * 0b1..Execute access is allowed in Secure User mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUX(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUX_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUX_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUW_MASK (0x200U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUW_SHIFT (9U) -/*! SUW - SecureUser Write - * 0b0..Write access is not allowed in Secure User mode. - * 0b1..Write access is allowed in Secure User mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUW(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUW_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUW_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUR_MASK (0x400U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUR_SHIFT (10U) -/*! SUR - SecureUser Read - * 0b0..Read access is not allowed in Secure User mode. - * 0b1..Read access is allowed in Secure User mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUR(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUR_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUR_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPX_MASK (0x1000U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPX_SHIFT (12U) -/*! SPX - SecurePriv Execute - * 0b0..Execute access is not allowed in Secure Privilege mode. - * 0b1..Execute access is allowed in Secure Privilege mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPX(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPX_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPX_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPW_MASK (0x2000U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPW_SHIFT (13U) -/*! SPW - SecurePriv Write - * 0b0..Write access is not allowed in Secure Privilege mode. - * 0b1..Write access is allowed in Secure Privilege mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPW(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPW_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPW_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPR_MASK (0x4000U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPR_SHIFT (14U) -/*! SPR - SecurePriv Read - * 0b0..Read access is not allowed in Secure Privilege mode. - * 0b1..Read access is allowed in Secure Privilege mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPR(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPR_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPR_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_LK_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_LK_SHIFT (31U) -/*! LK - LOCK - * 0b0..This register is not locked and can be altered. - * 0b1..This register is locked and cannot be altered. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_LK(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_LK_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_LK_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_MEMN_GLBAC */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_MEMN_GLBAC */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_COUNT2 (8U) - -/*! @name MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W - MBC Memory Block Configuration Word */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL0_MASK (0x7U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL0_SHIFT (0U) -/*! MBACSEL0 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE0_MASK (0x8U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE0_SHIFT (3U) -/*! NSE0 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL1_MASK (0x70U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL1_SHIFT (4U) -/*! MBACSEL1 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE1_MASK (0x80U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE1_SHIFT (7U) -/*! NSE1 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL2_MASK (0x700U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL2_SHIFT (8U) -/*! MBACSEL2 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE2_MASK (0x800U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE2_SHIFT (11U) -/*! NSE2 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL3_MASK (0x7000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL3_SHIFT (12U) -/*! MBACSEL3 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE3_MASK (0x8000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE3_SHIFT (15U) -/*! NSE3 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL4_MASK (0x70000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL4_SHIFT (16U) -/*! MBACSEL4 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE4_MASK (0x80000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE4_SHIFT (19U) -/*! NSE4 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL5_MASK (0x700000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL5_SHIFT (20U) -/*! MBACSEL5 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE5_MASK (0x800000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE5_SHIFT (23U) -/*! NSE5 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL6_MASK (0x7000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL6_SHIFT (24U) -/*! MBACSEL6 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE6_MASK (0x8000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE6_SHIFT (27U) -/*! NSE6 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL7_MASK (0x70000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL7_SHIFT (28U) -/*! MBACSEL7 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL7_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE7_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE7_SHIFT (31U) -/*! NSE7 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE7_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_COUNT2 (8U) - -/*! @name MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W - MBC Memory Block Configuration Word */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL0_MASK (0x7U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL0_SHIFT (0U) -/*! MBACSEL0 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE0_MASK (0x8U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE0_SHIFT (3U) -/*! NSE0 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL1_MASK (0x70U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL1_SHIFT (4U) -/*! MBACSEL1 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE1_MASK (0x80U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE1_SHIFT (7U) -/*! NSE1 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL2_MASK (0x700U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL2_SHIFT (8U) -/*! MBACSEL2 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE2_MASK (0x800U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE2_SHIFT (11U) -/*! NSE2 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL3_MASK (0x7000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL3_SHIFT (12U) -/*! MBACSEL3 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE3_MASK (0x8000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE3_SHIFT (15U) -/*! NSE3 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL4_MASK (0x70000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL4_SHIFT (16U) -/*! MBACSEL4 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE4_MASK (0x80000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE4_SHIFT (19U) -/*! NSE4 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL5_MASK (0x700000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL5_SHIFT (20U) -/*! MBACSEL5 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE5_MASK (0x800000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE5_SHIFT (23U) -/*! NSE5 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL6_MASK (0x7000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL6_SHIFT (24U) -/*! MBACSEL6 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE6_MASK (0x8000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE6_SHIFT (27U) -/*! NSE6 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL7_MASK (0x70000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL7_SHIFT (28U) -/*! MBACSEL7 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL7_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE7_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE7_SHIFT (31U) -/*! NSE7 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE7_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_COUNT2 (1U) - -/*! @name MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W - MBC Memory Block Configuration Word */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL0_MASK (0x7U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL0_SHIFT (0U) -/*! MBACSEL0 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE0_MASK (0x8U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE0_SHIFT (3U) -/*! NSE0 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL1_MASK (0x70U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL1_SHIFT (4U) -/*! MBACSEL1 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE1_MASK (0x80U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE1_SHIFT (7U) -/*! NSE1 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL2_MASK (0x700U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL2_SHIFT (8U) -/*! MBACSEL2 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE2_MASK (0x800U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE2_SHIFT (11U) -/*! NSE2 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL3_MASK (0x7000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL3_SHIFT (12U) -/*! MBACSEL3 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE3_MASK (0x8000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE3_SHIFT (15U) -/*! NSE3 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL4_MASK (0x70000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL4_SHIFT (16U) -/*! MBACSEL4 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE4_MASK (0x80000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE4_SHIFT (19U) -/*! NSE4 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL5_MASK (0x700000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL5_SHIFT (20U) -/*! MBACSEL5 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE5_MASK (0x800000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE5_SHIFT (23U) -/*! NSE5 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL6_MASK (0x7000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL6_SHIFT (24U) -/*! MBACSEL6 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE6_MASK (0x8000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE6_SHIFT (27U) -/*! NSE6 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL7_MASK (0x70000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL7_SHIFT (28U) -/*! MBACSEL7 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL7_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE7_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE7_SHIFT (31U) -/*! NSE7 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE7_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_COUNT2 (1U) - - -/*! - * @} - */ /* end of group TRDC_Register_Masks */ - - -/* TRDC - Peripheral instance base addresses */ -/** Peripheral MBC0 base address */ -#define MBC0_BASE (0x4008E000u) -/** Peripheral MBC0 base pointer */ -#define MBC0 ((TRDC_Type *)MBC0_BASE) -/** Array initializer of TRDC peripheral base addresses */ -#define TRDC_BASE_ADDRS { MBC0_BASE } -/** Array initializer of TRDC peripheral base pointers */ -#define TRDC_BASE_PTRS { MBC0 } -#define MBC0_MEMORY_CFG_WORD_COUNT {1,2,4,1} -#define MBC1_MEMORY_CFG_WORD_COUNT {1,1,1,1} -#define MBC2_MEMORY_CFG_WORD_COUNT {9,6,1,1} -#define MBC3_MEMORY_CFG_WORD_COUNT {3,0,0,0} -#define MBC_MEMORY_CFG_WORD_COUNT {MBC0_MEMORY_CFG_WORD_COUNT , MBC1_MEMORY_CFG_WORD_COUNT, MBC2_MEMORY_CFG_WORD_COUNT, MBC3_MEMORY_CFG_WORD_COUNT} -#define MBC0_MEMORY_NSE_WORD_COUNT {1,1,1,1} -#define MBC1_MEMORY_NSE_WORD_COUNT {1,1,1,1} -#define MBC2_MEMORY_NSE_WORD_COUNT {3,2,1,1} -#define MBC3_MEMORY_NSE_WORD_COUNT {1,0,0,0} -#define MBC_MEMORY_NSE_WORD_COUNT {MBC0_MEMORY_NSE_WORD_COUNT , MBC1_MEMORY_NSE_WORD_COUNT, MBC2_MEMORY_NSE_WORD_COUNT, MBC3_MEMORY_NSE_WORD_COUNT} - - -/*! - * @} - */ /* end of group TRDC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- USB Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USB_Peripheral_Access_Layer USB Peripheral Access Layer - * @{ - */ - -/** USB - Register Layout Typedef */ -typedef struct { - __I uint8_t PERID; /**< Peripheral ID, offset: 0x0 */ - uint8_t RESERVED_0[3]; - __I uint8_t IDCOMP; /**< Peripheral ID Complement, offset: 0x4 */ - uint8_t RESERVED_1[3]; - __I uint8_t REV; /**< Peripheral Revision, offset: 0x8 */ - uint8_t RESERVED_2[19]; - __IO uint8_t OTGCTL; /**< OTG Control, offset: 0x1C */ - uint8_t RESERVED_3[99]; - __IO uint8_t ISTAT; /**< Interrupt Status, offset: 0x80 */ - uint8_t RESERVED_4[3]; - __IO uint8_t INTEN; /**< Interrupt Enable, offset: 0x84 */ - uint8_t RESERVED_5[3]; - __IO uint8_t ERRSTAT; /**< Error Interrupt Status, offset: 0x88 */ - uint8_t RESERVED_6[3]; - __IO uint8_t ERREN; /**< Error Interrupt Enable, offset: 0x8C */ - uint8_t RESERVED_7[3]; - __I uint8_t STAT; /**< Status, offset: 0x90 */ - uint8_t RESERVED_8[3]; - __IO uint8_t CTL; /**< Control, offset: 0x94 */ - uint8_t RESERVED_9[3]; - __IO uint8_t ADDR; /**< Address, offset: 0x98 */ - uint8_t RESERVED_10[3]; - __IO uint8_t BDTPAGE1; /**< BDT Page 1, offset: 0x9C */ - uint8_t RESERVED_11[3]; - __I uint8_t FRMNUML; /**< Frame Number Register Low, offset: 0xA0 */ - uint8_t RESERVED_12[3]; - __I uint8_t FRMNUMH; /**< Frame Number Register High, offset: 0xA4 */ - uint8_t RESERVED_13[11]; - __IO uint8_t BDTPAGE2; /**< BDT Page 2, offset: 0xB0 */ - uint8_t RESERVED_14[3]; - __IO uint8_t BDTPAGE3; /**< BDT Page 3, offset: 0xB4 */ - uint8_t RESERVED_15[11]; - struct { /* offset: 0xC0, array step: 0x4 */ - __IO uint8_t ENDPT; /**< Endpoint Control, array offset: 0xC0, array step: 0x4 */ - uint8_t RESERVED_0[3]; - } ENDPOINT[16]; - __IO uint8_t USBCTRL; /**< USB Control, offset: 0x100 */ - uint8_t RESERVED_16[3]; - __I uint8_t OBSERVE; /**< USB OTG Observe, offset: 0x104 */ - uint8_t RESERVED_17[3]; - __IO uint8_t CONTROL; /**< USB OTG Control, offset: 0x108 */ - uint8_t RESERVED_18[3]; - __IO uint8_t USBTRC0; /**< USB Transceiver Control 0, offset: 0x10C */ - uint8_t RESERVED_19[23]; - uint8_t KEEP_ALIVE_CTRL_RSVD; /**< Reserved, offset: 0x124 */ - uint8_t RESERVED_20[3]; - uint8_t KEEP_ALIVE_WKCTRL_RSVD; /**< Reserved, offset: 0x128 */ - uint8_t RESERVED_21[3]; - __IO uint8_t MISCCTRL; /**< Miscellaneous Control, offset: 0x12C */ - uint8_t RESERVED_22[3]; - __IO uint8_t STALL_IL_DIS; /**< Peripheral Mode Stall Disable for Endpoints 7 to 0 in IN Direction, offset: 0x130 */ - uint8_t RESERVED_23[3]; - __IO uint8_t STALL_IH_DIS; /**< Peripheral Mode Stall Disable for Endpoints 15 to 8 in IN Direction, offset: 0x134 */ - uint8_t RESERVED_24[3]; - __IO uint8_t STALL_OL_DIS; /**< Peripheral Mode Stall Disable for Endpoints 7 to 0 in OUT Direction, offset: 0x138 */ - uint8_t RESERVED_25[3]; - __IO uint8_t STALL_OH_DIS; /**< Peripheral Mode Stall Disable for Endpoints 15 to 8 in OUT Direction, offset: 0x13C */ - uint8_t RESERVED_26[3]; - __IO uint8_t CLK_RECOVER_CTRL; /**< USB Clock Recovery Control, offset: 0x140 */ - uint8_t RESERVED_27[3]; - __IO uint8_t CLK_RECOVER_IRC_EN; /**< FIRC Oscillator Enable, offset: 0x144 */ - uint8_t RESERVED_28[15]; - __IO uint8_t CLK_RECOVER_INT_EN; /**< Clock Recovery Combined Interrupt Enable, offset: 0x154 */ - uint8_t RESERVED_29[7]; - __IO uint8_t CLK_RECOVER_INT_STATUS; /**< Clock Recovery Separated Interrupt Status, offset: 0x15C */ -} USB_Type; - -/* ---------------------------------------------------------------------------- - -- USB Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USB_Register_Masks USB Register Masks - * @{ - */ - -/*! @name PERID - Peripheral ID */ -/*! @{ */ - -#define USB_PERID_ID_MASK (0x3FU) -#define USB_PERID_ID_SHIFT (0U) -/*! ID - Peripheral Identification */ -#define USB_PERID_ID(x) (((uint8_t)(((uint8_t)(x)) << USB_PERID_ID_SHIFT)) & USB_PERID_ID_MASK) -/*! @} */ - -/*! @name IDCOMP - Peripheral ID Complement */ -/*! @{ */ - -#define USB_IDCOMP_NID_MASK (0x3FU) -#define USB_IDCOMP_NID_SHIFT (0U) -/*! NID - Negative Peripheral ID */ -#define USB_IDCOMP_NID(x) (((uint8_t)(((uint8_t)(x)) << USB_IDCOMP_NID_SHIFT)) & USB_IDCOMP_NID_MASK) -/*! @} */ - -/*! @name REV - Peripheral Revision */ -/*! @{ */ - -#define USB_REV_REV_MASK (0xFFU) -#define USB_REV_REV_SHIFT (0U) -/*! REV - Revision */ -#define USB_REV_REV(x) (((uint8_t)(((uint8_t)(x)) << USB_REV_REV_SHIFT)) & USB_REV_REV_MASK) -/*! @} */ - -/*! @name OTGCTL - OTG Control */ -/*! @{ */ - -#define USB_OTGCTL_DPHIGH_MASK (0x80U) -#define USB_OTGCTL_DPHIGH_SHIFT (7U) -/*! DPHIGH - D+ Data Line Pullup Resistor Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_OTGCTL_DPHIGH(x) (((uint8_t)(((uint8_t)(x)) << USB_OTGCTL_DPHIGH_SHIFT)) & USB_OTGCTL_DPHIGH_MASK) -/*! @} */ - -/*! @name ISTAT - Interrupt Status */ -/*! @{ */ - -#define USB_ISTAT_USBRST_MASK (0x1U) -#define USB_ISTAT_USBRST_SHIFT (0U) -/*! USBRST - USB Reset Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ISTAT_USBRST(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_USBRST_SHIFT)) & USB_ISTAT_USBRST_MASK) - -#define USB_ISTAT_ERROR_MASK (0x2U) -#define USB_ISTAT_ERROR_SHIFT (1U) -/*! ERROR - Error Flag - * 0b0..Error did not occur - * 0b1..Error occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ISTAT_ERROR(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_ERROR_SHIFT)) & USB_ISTAT_ERROR_MASK) - -#define USB_ISTAT_SOFTOK_MASK (0x4U) -#define USB_ISTAT_SOFTOK_SHIFT (2U) -/*! SOFTOK - Start Of Frame (SOF) Token Flag - * 0b0..Did not receive - * 0b1..Received - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ISTAT_SOFTOK(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_SOFTOK_SHIFT)) & USB_ISTAT_SOFTOK_MASK) - -#define USB_ISTAT_TOKDNE_MASK (0x8U) -#define USB_ISTAT_TOKDNE_SHIFT (3U) -/*! TOKDNE - Current Token Processing Flag - * 0b0..Not processed - * 0b1..Processed - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ISTAT_TOKDNE(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_TOKDNE_SHIFT)) & USB_ISTAT_TOKDNE_MASK) - -#define USB_ISTAT_SLEEP_MASK (0x10U) -#define USB_ISTAT_SLEEP_SHIFT (4U) -/*! SLEEP - Sleep Flag - * 0b0..Interrupt did not occur - * 0b1..Interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ISTAT_SLEEP(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_SLEEP_SHIFT)) & USB_ISTAT_SLEEP_MASK) - -#define USB_ISTAT_RESUME_MASK (0x20U) -#define USB_ISTAT_RESUME_SHIFT (5U) -/*! RESUME - Resume Flag - * 0b0..Interrupt did not occur - * 0b1..Interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ISTAT_RESUME(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_RESUME_SHIFT)) & USB_ISTAT_RESUME_MASK) - -#define USB_ISTAT_STALL_MASK (0x80U) -#define USB_ISTAT_STALL_SHIFT (7U) -/*! STALL - Stall Interrupt Flag - * 0b0..Interrupt did not occur - * 0b1..Interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ISTAT_STALL(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_STALL_SHIFT)) & USB_ISTAT_STALL_MASK) -/*! @} */ - -/*! @name INTEN - Interrupt Enable */ -/*! @{ */ - -#define USB_INTEN_USBRSTEN_MASK (0x1U) -#define USB_INTEN_USBRSTEN_SHIFT (0U) -/*! USBRSTEN - USBRST Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_INTEN_USBRSTEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_USBRSTEN_SHIFT)) & USB_INTEN_USBRSTEN_MASK) - -#define USB_INTEN_ERROREN_MASK (0x2U) -#define USB_INTEN_ERROREN_SHIFT (1U) -/*! ERROREN - ERROR Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_INTEN_ERROREN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_ERROREN_SHIFT)) & USB_INTEN_ERROREN_MASK) - -#define USB_INTEN_SOFTOKEN_MASK (0x4U) -#define USB_INTEN_SOFTOKEN_SHIFT (2U) -/*! SOFTOKEN - SOFTOK Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_INTEN_SOFTOKEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_SOFTOKEN_SHIFT)) & USB_INTEN_SOFTOKEN_MASK) - -#define USB_INTEN_TOKDNEEN_MASK (0x8U) -#define USB_INTEN_TOKDNEEN_SHIFT (3U) -/*! TOKDNEEN - TOKDNE Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_INTEN_TOKDNEEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_TOKDNEEN_SHIFT)) & USB_INTEN_TOKDNEEN_MASK) - -#define USB_INTEN_SLEEPEN_MASK (0x10U) -#define USB_INTEN_SLEEPEN_SHIFT (4U) -/*! SLEEPEN - SLEEP Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_INTEN_SLEEPEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_SLEEPEN_SHIFT)) & USB_INTEN_SLEEPEN_MASK) - -#define USB_INTEN_RESUMEEN_MASK (0x20U) -#define USB_INTEN_RESUMEEN_SHIFT (5U) -/*! RESUMEEN - RESUME Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_INTEN_RESUMEEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_RESUMEEN_SHIFT)) & USB_INTEN_RESUMEEN_MASK) - -#define USB_INTEN_STALLEN_MASK (0x80U) -#define USB_INTEN_STALLEN_SHIFT (7U) -/*! STALLEN - STALL Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_INTEN_STALLEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_STALLEN_SHIFT)) & USB_INTEN_STALLEN_MASK) -/*! @} */ - -/*! @name ERRSTAT - Error Interrupt Status */ -/*! @{ */ - -#define USB_ERRSTAT_PIDERR_MASK (0x1U) -#define USB_ERRSTAT_PIDERR_SHIFT (0U) -/*! PIDERR - PID Error Flag - * 0b0..Did not fail - * 0b1..Failed - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_PIDERR(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_PIDERR_SHIFT)) & USB_ERRSTAT_PIDERR_MASK) - -#define USB_ERRSTAT_CRC5EOF_MASK (0x2U) -#define USB_ERRSTAT_CRC5EOF_SHIFT (1U) -/*! CRC5EOF - CRC5 Error or End of Frame Error Flag - * 0b0..Interrupt did not occur - * 0b1..Interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_CRC5EOF(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_CRC5EOF_SHIFT)) & USB_ERRSTAT_CRC5EOF_MASK) - -#define USB_ERRSTAT_CRC16_MASK (0x4U) -#define USB_ERRSTAT_CRC16_SHIFT (2U) -/*! CRC16 - CRC16 Error Flag - * 0b0..Not rejected - * 0b1..Rejected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_CRC16(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_CRC16_SHIFT)) & USB_ERRSTAT_CRC16_MASK) - -#define USB_ERRSTAT_DFN8_MASK (0x8U) -#define USB_ERRSTAT_DFN8_SHIFT (3U) -/*! DFN8 - Data Field Not 8 Bits Flag - * 0b0..Integer number of bytes - * 0b1..Not an integer number of bytes - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_DFN8(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_DFN8_SHIFT)) & USB_ERRSTAT_DFN8_MASK) - -#define USB_ERRSTAT_BTOERR_MASK (0x10U) -#define USB_ERRSTAT_BTOERR_SHIFT (4U) -/*! BTOERR - Bus Turnaround Timeout Error Flag - * 0b0..Not timed out - * 0b1..Timed out - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_BTOERR(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_BTOERR_SHIFT)) & USB_ERRSTAT_BTOERR_MASK) - -#define USB_ERRSTAT_DMAERR_MASK (0x20U) -#define USB_ERRSTAT_DMAERR_SHIFT (5U) -/*! DMAERR - DMA Access Error Flag - * 0b0..Interrupt did not occur - * 0b1..Interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_DMAERR(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_DMAERR_SHIFT)) & USB_ERRSTAT_DMAERR_MASK) - -#define USB_ERRSTAT_OWNERR_MASK (0x40U) -#define USB_ERRSTAT_OWNERR_SHIFT (6U) -/*! OWNERR - BD Unavailable Error Flag - * 0b0..Interrupt did not occur - * 0b1..Interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_OWNERR(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_OWNERR_SHIFT)) & USB_ERRSTAT_OWNERR_MASK) - -#define USB_ERRSTAT_BTSERR_MASK (0x80U) -#define USB_ERRSTAT_BTSERR_SHIFT (7U) -/*! BTSERR - Bit Stuff Error Flag - * 0b0..Packet not rejected due to the error - * 0b1..Packet rejected due to the error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_BTSERR(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_BTSERR_SHIFT)) & USB_ERRSTAT_BTSERR_MASK) -/*! @} */ - -/*! @name ERREN - Error Interrupt Enable */ -/*! @{ */ - -#define USB_ERREN_PIDERREN_MASK (0x1U) -#define USB_ERREN_PIDERREN_SHIFT (0U) -/*! PIDERREN - PIDERR Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_PIDERREN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_PIDERREN_SHIFT)) & USB_ERREN_PIDERREN_MASK) - -#define USB_ERREN_CRC5EOFEN_MASK (0x2U) -#define USB_ERREN_CRC5EOFEN_SHIFT (1U) -/*! CRC5EOFEN - CRC5/EOF Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_CRC5EOFEN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_CRC5EOFEN_SHIFT)) & USB_ERREN_CRC5EOFEN_MASK) - -#define USB_ERREN_CRC16EN_MASK (0x4U) -#define USB_ERREN_CRC16EN_SHIFT (2U) -/*! CRC16EN - CRC16 Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_CRC16EN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_CRC16EN_SHIFT)) & USB_ERREN_CRC16EN_MASK) - -#define USB_ERREN_DFN8EN_MASK (0x8U) -#define USB_ERREN_DFN8EN_SHIFT (3U) -/*! DFN8EN - DFN8 (Data Field Not Integer Number of Bytes) Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_DFN8EN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_DFN8EN_SHIFT)) & USB_ERREN_DFN8EN_MASK) - -#define USB_ERREN_BTOERREN_MASK (0x10U) -#define USB_ERREN_BTOERREN_SHIFT (4U) -/*! BTOERREN - BTOERR (Bus Timeout Error) Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_BTOERREN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_BTOERREN_SHIFT)) & USB_ERREN_BTOERREN_MASK) - -#define USB_ERREN_DMAERREN_MASK (0x20U) -#define USB_ERREN_DMAERREN_SHIFT (5U) -/*! DMAERREN - DMAERR Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_DMAERREN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_DMAERREN_SHIFT)) & USB_ERREN_DMAERREN_MASK) - -#define USB_ERREN_OWNERREN_MASK (0x40U) -#define USB_ERREN_OWNERREN_SHIFT (6U) -/*! OWNERREN - OWNERR Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_OWNERREN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_OWNERREN_SHIFT)) & USB_ERREN_OWNERREN_MASK) - -#define USB_ERREN_BTSERREN_MASK (0x80U) -#define USB_ERREN_BTSERREN_SHIFT (7U) -/*! BTSERREN - BTSERR (Bit Stuff Error) Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_BTSERREN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_BTSERREN_SHIFT)) & USB_ERREN_BTSERREN_MASK) -/*! @} */ - -/*! @name STAT - Status */ -/*! @{ */ - -#define USB_STAT_ODD_MASK (0x4U) -#define USB_STAT_ODD_SHIFT (2U) -/*! ODD - Odd Bank - * 0b0..Not in the odd bank - * 0b1..In the odd bank - */ -#define USB_STAT_ODD(x) (((uint8_t)(((uint8_t)(x)) << USB_STAT_ODD_SHIFT)) & USB_STAT_ODD_MASK) - -#define USB_STAT_TX_MASK (0x8U) -#define USB_STAT_TX_SHIFT (3U) -/*! TX - Transmit Indicator - * 0b0..Receive - * 0b1..Transmit - */ -#define USB_STAT_TX(x) (((uint8_t)(((uint8_t)(x)) << USB_STAT_TX_SHIFT)) & USB_STAT_TX_MASK) - -#define USB_STAT_ENDP_MASK (0xF0U) -#define USB_STAT_ENDP_SHIFT (4U) -/*! ENDP - Endpoint address */ -#define USB_STAT_ENDP(x) (((uint8_t)(((uint8_t)(x)) << USB_STAT_ENDP_SHIFT)) & USB_STAT_ENDP_MASK) -/*! @} */ - -/*! @name CTL - Control */ -/*! @{ */ - -#define USB_CTL_USBENSOFEN_MASK (0x1U) -#define USB_CTL_USBENSOFEN_SHIFT (0U) -/*! USBENSOFEN - USB Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_CTL_USBENSOFEN(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_USBENSOFEN_SHIFT)) & USB_CTL_USBENSOFEN_MASK) - -#define USB_CTL_ODDRST_MASK (0x2U) -#define USB_CTL_ODDRST_SHIFT (1U) -/*! ODDRST - Odd Reset */ -#define USB_CTL_ODDRST(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_ODDRST_SHIFT)) & USB_CTL_ODDRST_MASK) - -#define USB_CTL_RESUME_MASK (0x4U) -#define USB_CTL_RESUME_SHIFT (2U) -/*! RESUME - Resume */ -#define USB_CTL_RESUME(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_RESUME_SHIFT)) & USB_CTL_RESUME_MASK) - -#define USB_CTL_TXSUSPENDTOKENBUSY_MASK (0x20U) -#define USB_CTL_TXSUSPENDTOKENBUSY_SHIFT (5U) -/*! TXSUSPENDTOKENBUSY - TXD Suspend And Token Busy */ -#define USB_CTL_TXSUSPENDTOKENBUSY(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_TXSUSPENDTOKENBUSY_SHIFT)) & USB_CTL_TXSUSPENDTOKENBUSY_MASK) - -#define USB_CTL_SE0_MASK (0x40U) -#define USB_CTL_SE0_SHIFT (6U) -/*! SE0 - Live USB Single-Ended Zero signal */ -#define USB_CTL_SE0(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_SE0_SHIFT)) & USB_CTL_SE0_MASK) -/*! @} */ - -/*! @name ADDR - Address */ -/*! @{ */ - -#define USB_ADDR_ADDR_MASK (0x7FU) -#define USB_ADDR_ADDR_SHIFT (0U) -/*! ADDR - USB Address */ -#define USB_ADDR_ADDR(x) (((uint8_t)(((uint8_t)(x)) << USB_ADDR_ADDR_SHIFT)) & USB_ADDR_ADDR_MASK) -/*! @} */ - -/*! @name BDTPAGE1 - BDT Page 1 */ -/*! @{ */ - -#define USB_BDTPAGE1_BDTBA_MASK (0xFEU) -#define USB_BDTPAGE1_BDTBA_SHIFT (1U) -/*! BDTBA - BDT Base Address */ -#define USB_BDTPAGE1_BDTBA(x) (((uint8_t)(((uint8_t)(x)) << USB_BDTPAGE1_BDTBA_SHIFT)) & USB_BDTPAGE1_BDTBA_MASK) -/*! @} */ - -/*! @name FRMNUML - Frame Number Register Low */ -/*! @{ */ - -#define USB_FRMNUML_FRM_MASK (0xFFU) -#define USB_FRMNUML_FRM_SHIFT (0U) -/*! FRM - Frame Number, Bits 0-7 */ -#define USB_FRMNUML_FRM(x) (((uint8_t)(((uint8_t)(x)) << USB_FRMNUML_FRM_SHIFT)) & USB_FRMNUML_FRM_MASK) -/*! @} */ - -/*! @name FRMNUMH - Frame Number Register High */ -/*! @{ */ - -#define USB_FRMNUMH_FRM_MASK (0x7U) -#define USB_FRMNUMH_FRM_SHIFT (0U) -/*! FRM - Frame Number, Bits 8-10 */ -#define USB_FRMNUMH_FRM(x) (((uint8_t)(((uint8_t)(x)) << USB_FRMNUMH_FRM_SHIFT)) & USB_FRMNUMH_FRM_MASK) -/*! @} */ - -/*! @name BDTPAGE2 - BDT Page 2 */ -/*! @{ */ - -#define USB_BDTPAGE2_BDTBA_MASK (0xFFU) -#define USB_BDTPAGE2_BDTBA_SHIFT (0U) -/*! BDTBA - BDT Base Address */ -#define USB_BDTPAGE2_BDTBA(x) (((uint8_t)(((uint8_t)(x)) << USB_BDTPAGE2_BDTBA_SHIFT)) & USB_BDTPAGE2_BDTBA_MASK) -/*! @} */ - -/*! @name BDTPAGE3 - BDT Page 3 */ -/*! @{ */ - -#define USB_BDTPAGE3_BDTBA_MASK (0xFFU) -#define USB_BDTPAGE3_BDTBA_SHIFT (0U) -/*! BDTBA - BDT Base Address */ -#define USB_BDTPAGE3_BDTBA(x) (((uint8_t)(((uint8_t)(x)) << USB_BDTPAGE3_BDTBA_SHIFT)) & USB_BDTPAGE3_BDTBA_MASK) -/*! @} */ - -/*! @name ENDPT - Endpoint Control */ -/*! @{ */ - -#define USB_ENDPT_EPHSHK_MASK (0x1U) -#define USB_ENDPT_EPHSHK_SHIFT (0U) -/*! EPHSHK - Endpoint Handshaking Enable */ -#define USB_ENDPT_EPHSHK(x) (((uint8_t)(((uint8_t)(x)) << USB_ENDPT_EPHSHK_SHIFT)) & USB_ENDPT_EPHSHK_MASK) - -#define USB_ENDPT_EPSTALL_MASK (0x2U) -#define USB_ENDPT_EPSTALL_SHIFT (1U) -/*! EPSTALL - Endpoint Stalled */ -#define USB_ENDPT_EPSTALL(x) (((uint8_t)(((uint8_t)(x)) << USB_ENDPT_EPSTALL_SHIFT)) & USB_ENDPT_EPSTALL_MASK) - -#define USB_ENDPT_EPTXEN_MASK (0x4U) -#define USB_ENDPT_EPTXEN_SHIFT (2U) -/*! EPTXEN - Endpoint for TX transfers enable */ -#define USB_ENDPT_EPTXEN(x) (((uint8_t)(((uint8_t)(x)) << USB_ENDPT_EPTXEN_SHIFT)) & USB_ENDPT_EPTXEN_MASK) - -#define USB_ENDPT_EPRXEN_MASK (0x8U) -#define USB_ENDPT_EPRXEN_SHIFT (3U) -/*! EPRXEN - Endpoint for RX transfers enable */ -#define USB_ENDPT_EPRXEN(x) (((uint8_t)(((uint8_t)(x)) << USB_ENDPT_EPRXEN_SHIFT)) & USB_ENDPT_EPRXEN_MASK) - -#define USB_ENDPT_EPCTLDIS_MASK (0x10U) -#define USB_ENDPT_EPCTLDIS_SHIFT (4U) -/*! EPCTLDIS - Control Transfer Disable - * 0b0..Enable - * 0b1..Disable - */ -#define USB_ENDPT_EPCTLDIS(x) (((uint8_t)(((uint8_t)(x)) << USB_ENDPT_EPCTLDIS_SHIFT)) & USB_ENDPT_EPCTLDIS_MASK) -/*! @} */ - -/* The count of USB_ENDPT */ -#define USB_ENDPT_COUNT (16U) - -/*! @name USBCTRL - USB Control */ -/*! @{ */ - -#define USB_USBCTRL_DPDM_LANE_REVERSE_MASK (0x4U) -#define USB_USBCTRL_DPDM_LANE_REVERSE_SHIFT (2U) -/*! DPDM_LANE_REVERSE - DP and DM Lane Reversal Control - * 0b0..Standard USB DP and DM package pin assignment - * 0b1..Reverse roles of USB DP and DM package pins - */ -#define USB_USBCTRL_DPDM_LANE_REVERSE(x) (((uint8_t)(((uint8_t)(x)) << USB_USBCTRL_DPDM_LANE_REVERSE_SHIFT)) & USB_USBCTRL_DPDM_LANE_REVERSE_MASK) - -#define USB_USBCTRL_UARTSEL_MASK (0x10U) -#define USB_USBCTRL_UARTSEL_SHIFT (4U) -/*! UARTSEL - UART Select - * 0b0..USB DP and DM external package pins are used for USB signaling. - * 0b1..USB DP and DM external package pins are used for UART signaling. - */ -#define USB_USBCTRL_UARTSEL(x) (((uint8_t)(((uint8_t)(x)) << USB_USBCTRL_UARTSEL_SHIFT)) & USB_USBCTRL_UARTSEL_MASK) - -#define USB_USBCTRL_UARTCHLS_MASK (0x20U) -#define USB_USBCTRL_UARTCHLS_SHIFT (5U) -/*! UARTCHLS - UART Signal Channel Select - * 0b0..USB DP and DM signals are used as UART TX/RX. - * 0b1..USB DP and DM signals are used as UART RX/TX. - */ -#define USB_USBCTRL_UARTCHLS(x) (((uint8_t)(((uint8_t)(x)) << USB_USBCTRL_UARTCHLS_SHIFT)) & USB_USBCTRL_UARTCHLS_MASK) - -#define USB_USBCTRL_PDE_MASK (0x40U) -#define USB_USBCTRL_PDE_SHIFT (6U) -/*! PDE - Pulldown Enable - * 0b0..Disable on D+ and D- - * 0b1..Enable on D+ and D- - */ -#define USB_USBCTRL_PDE(x) (((uint8_t)(((uint8_t)(x)) << USB_USBCTRL_PDE_SHIFT)) & USB_USBCTRL_PDE_MASK) - -#define USB_USBCTRL_SUSP_MASK (0x80U) -#define USB_USBCTRL_SUSP_SHIFT (7U) -/*! SUSP - Suspend - * 0b0..Not in Suspend state - * 0b1..In Suspend state - */ -#define USB_USBCTRL_SUSP(x) (((uint8_t)(((uint8_t)(x)) << USB_USBCTRL_SUSP_SHIFT)) & USB_USBCTRL_SUSP_MASK) -/*! @} */ - -/*! @name OBSERVE - USB OTG Observe */ -/*! @{ */ - -#define USB_OBSERVE_DMPD_MASK (0x10U) -#define USB_OBSERVE_DMPD_SHIFT (4U) -/*! DMPD - D- Pulldown - * 0b0..Disabled - * 0b1..Enabled - */ -#define USB_OBSERVE_DMPD(x) (((uint8_t)(((uint8_t)(x)) << USB_OBSERVE_DMPD_SHIFT)) & USB_OBSERVE_DMPD_MASK) - -#define USB_OBSERVE_DPPD_MASK (0x40U) -#define USB_OBSERVE_DPPD_SHIFT (6U) -/*! DPPD - D+ Pulldown - * 0b0..Disabled - * 0b1..Enabled - */ -#define USB_OBSERVE_DPPD(x) (((uint8_t)(((uint8_t)(x)) << USB_OBSERVE_DPPD_SHIFT)) & USB_OBSERVE_DPPD_MASK) - -#define USB_OBSERVE_DPPU_MASK (0x80U) -#define USB_OBSERVE_DPPU_SHIFT (7U) -/*! DPPU - D+ Pullup - * 0b0..Disabled - * 0b1..Enabled - */ -#define USB_OBSERVE_DPPU(x) (((uint8_t)(((uint8_t)(x)) << USB_OBSERVE_DPPU_SHIFT)) & USB_OBSERVE_DPPU_MASK) -/*! @} */ - -/*! @name CONTROL - USB OTG Control */ -/*! @{ */ - -#define USB_CONTROL_VBUS_SOURCE_SEL_MASK (0x1U) -#define USB_CONTROL_VBUS_SOURCE_SEL_SHIFT (0U) -/*! VBUS_SOURCE_SEL - VBUS Monitoring Source Select - * 0b0..Reserved - * 0b1..Resistive divider attached to a GPIO pin - */ -#define USB_CONTROL_VBUS_SOURCE_SEL(x) (((uint8_t)(((uint8_t)(x)) << USB_CONTROL_VBUS_SOURCE_SEL_SHIFT)) & USB_CONTROL_VBUS_SOURCE_SEL_MASK) - -#define USB_CONTROL_SESS_VLD_MASK (0x2U) -#define USB_CONTROL_SESS_VLD_SHIFT (1U) -/*! SESS_VLD - VBUS Session Valid status - * 0b1..Above - * 0b0..Below - */ -#define USB_CONTROL_SESS_VLD(x) (((uint8_t)(((uint8_t)(x)) << USB_CONTROL_SESS_VLD_SHIFT)) & USB_CONTROL_SESS_VLD_MASK) - -#define USB_CONTROL_DPPULLUPNONOTG_MASK (0x10U) -#define USB_CONTROL_DPPULLUPNONOTG_SHIFT (4U) -/*! DPPULLUPNONOTG - DP Pullup in Non-OTG Device Mode - * 0b0..Disable - * 0b1..Enabled - */ -#define USB_CONTROL_DPPULLUPNONOTG(x) (((uint8_t)(((uint8_t)(x)) << USB_CONTROL_DPPULLUPNONOTG_SHIFT)) & USB_CONTROL_DPPULLUPNONOTG_MASK) -/*! @} */ - -/*! @name USBTRC0 - USB Transceiver Control 0 */ -/*! @{ */ - -#define USB_USBTRC0_USB_RESUME_INT_MASK (0x1U) -#define USB_USBTRC0_USB_RESUME_INT_SHIFT (0U) -/*! USB_RESUME_INT - USB Asynchronous Interrupt - * 0b0..Not generated - * 0b1..Generated because of the USB asynchronous interrupt - */ -#define USB_USBTRC0_USB_RESUME_INT(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_USB_RESUME_INT_SHIFT)) & USB_USBTRC0_USB_RESUME_INT_MASK) - -#define USB_USBTRC0_SYNC_DET_MASK (0x2U) -#define USB_USBTRC0_SYNC_DET_SHIFT (1U) -/*! SYNC_DET - Synchronous USB Interrupt Detect - * 0b0..Not detected - * 0b1..Detected - */ -#define USB_USBTRC0_SYNC_DET(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_SYNC_DET_SHIFT)) & USB_USBTRC0_SYNC_DET_MASK) - -#define USB_USBTRC0_USB_CLK_RECOVERY_INT_MASK (0x4U) -#define USB_USBTRC0_USB_CLK_RECOVERY_INT_SHIFT (2U) -/*! USB_CLK_RECOVERY_INT - Combined USB Clock Recovery interrupt status */ -#define USB_USBTRC0_USB_CLK_RECOVERY_INT(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_USB_CLK_RECOVERY_INT_SHIFT)) & USB_USBTRC0_USB_CLK_RECOVERY_INT_MASK) - -#define USB_USBTRC0_VREDG_DET_MASK (0x8U) -#define USB_USBTRC0_VREDG_DET_SHIFT (3U) -/*! VREDG_DET - VREGIN Rising Edge Interrupt Detect - * 0b0..Not detected - * 0b1..Detected - */ -#define USB_USBTRC0_VREDG_DET(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_VREDG_DET_SHIFT)) & USB_USBTRC0_VREDG_DET_MASK) - -#define USB_USBTRC0_VFEDG_DET_MASK (0x10U) -#define USB_USBTRC0_VFEDG_DET_SHIFT (4U) -/*! VFEDG_DET - VREGIN Falling Edge Interrupt Detect - * 0b0..Not detected - * 0b1..Detected - */ -#define USB_USBTRC0_VFEDG_DET(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_VFEDG_DET_SHIFT)) & USB_USBTRC0_VFEDG_DET_MASK) - -#define USB_USBTRC0_USBRESMEN_MASK (0x20U) -#define USB_USBTRC0_USBRESMEN_SHIFT (5U) -/*! USBRESMEN - Asynchronous Resume Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_USBTRC0_USBRESMEN(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_USBRESMEN_SHIFT)) & USB_USBTRC0_USBRESMEN_MASK) - -#define USB_USBTRC0_VREGIN_STS_MASK (0x40U) -#define USB_USBTRC0_VREGIN_STS_SHIFT (6U) -/*! VREGIN_STS - VREGIN Status */ -#define USB_USBTRC0_VREGIN_STS(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_VREGIN_STS_SHIFT)) & USB_USBTRC0_VREGIN_STS_MASK) - -#define USB_USBTRC0_USBRESET_MASK (0x80U) -#define USB_USBTRC0_USBRESET_SHIFT (7U) -/*! USBRESET - USB Reset - * 0b0..Normal USBFS operation - * 0b1..Returns USBFS to its reset state - */ -#define USB_USBTRC0_USBRESET(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_USBRESET_SHIFT)) & USB_USBTRC0_USBRESET_MASK) -/*! @} */ - -/*! @name MISCCTRL - Miscellaneous Control */ -/*! @{ */ - -#define USB_MISCCTRL_OWNERRISODIS_MASK (0x4U) -#define USB_MISCCTRL_OWNERRISODIS_SHIFT (2U) -/*! OWNERRISODIS - OWN Error Detect for ISO IN and ISO OUT Disable - * 0b0..Enable - * 0b1..Disable - */ -#define USB_MISCCTRL_OWNERRISODIS(x) (((uint8_t)(((uint8_t)(x)) << USB_MISCCTRL_OWNERRISODIS_SHIFT)) & USB_MISCCTRL_OWNERRISODIS_MASK) - -#define USB_MISCCTRL_VREDG_EN_MASK (0x8U) -#define USB_MISCCTRL_VREDG_EN_SHIFT (3U) -/*! VREDG_EN - VREGIN Rising Edge Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_MISCCTRL_VREDG_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_MISCCTRL_VREDG_EN_SHIFT)) & USB_MISCCTRL_VREDG_EN_MASK) - -#define USB_MISCCTRL_VFEDG_EN_MASK (0x10U) -#define USB_MISCCTRL_VFEDG_EN_SHIFT (4U) -/*! VFEDG_EN - VREGIN Falling Edge Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_MISCCTRL_VFEDG_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_MISCCTRL_VFEDG_EN_SHIFT)) & USB_MISCCTRL_VFEDG_EN_MASK) - -#define USB_MISCCTRL_STL_ADJ_EN_MASK (0x80U) -#define USB_MISCCTRL_STL_ADJ_EN_SHIFT (7U) -/*! STL_ADJ_EN - USB Peripheral Mode Stall Adjust Enable - * 0b0..If ENDPTn[END_STALL] = 1, both IN and OUT directions for the associated endpoint stalls. - * 0b1..If ENDPTn[END_STALL] = 1, the STALL_xx_DIS registers control which directions for the associated endpoint stalls. - */ -#define USB_MISCCTRL_STL_ADJ_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_MISCCTRL_STL_ADJ_EN_SHIFT)) & USB_MISCCTRL_STL_ADJ_EN_MASK) -/*! @} */ - -/*! @name STALL_IL_DIS - Peripheral Mode Stall Disable for Endpoints 7 to 0 in IN Direction */ -/*! @{ */ - -#define USB_STALL_IL_DIS_STALL_I_DIS0_MASK (0x1U) -#define USB_STALL_IL_DIS_STALL_I_DIS0_SHIFT (0U) -/*! STALL_I_DIS0 - Disable Endpoint 0 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS0(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS0_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS0_MASK) - -#define USB_STALL_IL_DIS_STALL_I_DIS1_MASK (0x2U) -#define USB_STALL_IL_DIS_STALL_I_DIS1_SHIFT (1U) -/*! STALL_I_DIS1 - Disable Endpoint 1 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS1(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS1_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS1_MASK) - -#define USB_STALL_IL_DIS_STALL_I_DIS2_MASK (0x4U) -#define USB_STALL_IL_DIS_STALL_I_DIS2_SHIFT (2U) -/*! STALL_I_DIS2 - Disable Endpoint 2 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS2(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS2_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS2_MASK) - -#define USB_STALL_IL_DIS_STALL_I_DIS3_MASK (0x8U) -#define USB_STALL_IL_DIS_STALL_I_DIS3_SHIFT (3U) -/*! STALL_I_DIS3 - Disable Endpoint 3 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS3(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS3_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS3_MASK) - -#define USB_STALL_IL_DIS_STALL_I_DIS4_MASK (0x10U) -#define USB_STALL_IL_DIS_STALL_I_DIS4_SHIFT (4U) -/*! STALL_I_DIS4 - Disable Endpoint 4 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS4(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS4_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS4_MASK) - -#define USB_STALL_IL_DIS_STALL_I_DIS5_MASK (0x20U) -#define USB_STALL_IL_DIS_STALL_I_DIS5_SHIFT (5U) -/*! STALL_I_DIS5 - Disable Endpoint 5 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS5(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS5_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS5_MASK) - -#define USB_STALL_IL_DIS_STALL_I_DIS6_MASK (0x40U) -#define USB_STALL_IL_DIS_STALL_I_DIS6_SHIFT (6U) -/*! STALL_I_DIS6 - Disable Endpoint 6 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS6(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS6_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS6_MASK) - -#define USB_STALL_IL_DIS_STALL_I_DIS7_MASK (0x80U) -#define USB_STALL_IL_DIS_STALL_I_DIS7_SHIFT (7U) -/*! STALL_I_DIS7 - Disable Endpoint 7 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS7(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS7_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS7_MASK) -/*! @} */ - -/*! @name STALL_IH_DIS - Peripheral Mode Stall Disable for Endpoints 15 to 8 in IN Direction */ -/*! @{ */ - -#define USB_STALL_IH_DIS_STALL_I_DIS8_MASK (0x1U) -#define USB_STALL_IH_DIS_STALL_I_DIS8_SHIFT (0U) -/*! STALL_I_DIS8 - Disable Endpoint 8 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS8(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS8_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS8_MASK) - -#define USB_STALL_IH_DIS_STALL_I_DIS9_MASK (0x2U) -#define USB_STALL_IH_DIS_STALL_I_DIS9_SHIFT (1U) -/*! STALL_I_DIS9 - Disable Endpoint 9 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS9(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS9_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS9_MASK) - -#define USB_STALL_IH_DIS_STALL_I_DIS10_MASK (0x4U) -#define USB_STALL_IH_DIS_STALL_I_DIS10_SHIFT (2U) -/*! STALL_I_DIS10 - Disable Endpoint 10 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS10(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS10_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS10_MASK) - -#define USB_STALL_IH_DIS_STALL_I_DIS11_MASK (0x8U) -#define USB_STALL_IH_DIS_STALL_I_DIS11_SHIFT (3U) -/*! STALL_I_DIS11 - Disable Endpoint 11 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS11(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS11_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS11_MASK) - -#define USB_STALL_IH_DIS_STALL_I_DIS12_MASK (0x10U) -#define USB_STALL_IH_DIS_STALL_I_DIS12_SHIFT (4U) -/*! STALL_I_DIS12 - Disable Endpoint 12 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS12(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS12_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS12_MASK) - -#define USB_STALL_IH_DIS_STALL_I_DIS13_MASK (0x20U) -#define USB_STALL_IH_DIS_STALL_I_DIS13_SHIFT (5U) -/*! STALL_I_DIS13 - Disable Endpoint 13 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS13(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS13_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS13_MASK) - -#define USB_STALL_IH_DIS_STALL_I_DIS14_MASK (0x40U) -#define USB_STALL_IH_DIS_STALL_I_DIS14_SHIFT (6U) -/*! STALL_I_DIS14 - Disable Endpoint 14 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS14(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS14_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS14_MASK) - -#define USB_STALL_IH_DIS_STALL_I_DIS15_MASK (0x80U) -#define USB_STALL_IH_DIS_STALL_I_DIS15_SHIFT (7U) -/*! STALL_I_DIS15 - Disable Endpoint 15 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS15(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS15_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS15_MASK) -/*! @} */ - -/*! @name STALL_OL_DIS - Peripheral Mode Stall Disable for Endpoints 7 to 0 in OUT Direction */ -/*! @{ */ - -#define USB_STALL_OL_DIS_STALL_O_DIS0_MASK (0x1U) -#define USB_STALL_OL_DIS_STALL_O_DIS0_SHIFT (0U) -/*! STALL_O_DIS0 - Disable Endpoint 0 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS0(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS0_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS0_MASK) - -#define USB_STALL_OL_DIS_STALL_O_DIS1_MASK (0x2U) -#define USB_STALL_OL_DIS_STALL_O_DIS1_SHIFT (1U) -/*! STALL_O_DIS1 - Disable Endpoint 1 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS1(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS1_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS1_MASK) - -#define USB_STALL_OL_DIS_STALL_O_DIS2_MASK (0x4U) -#define USB_STALL_OL_DIS_STALL_O_DIS2_SHIFT (2U) -/*! STALL_O_DIS2 - Disable Endpoint 2 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS2(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS2_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS2_MASK) - -#define USB_STALL_OL_DIS_STALL_O_DIS3_MASK (0x8U) -#define USB_STALL_OL_DIS_STALL_O_DIS3_SHIFT (3U) -/*! STALL_O_DIS3 - Disable Endpoint 3 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS3(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS3_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS3_MASK) - -#define USB_STALL_OL_DIS_STALL_O_DIS4_MASK (0x10U) -#define USB_STALL_OL_DIS_STALL_O_DIS4_SHIFT (4U) -/*! STALL_O_DIS4 - Disable Endpoint 4 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS4(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS4_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS4_MASK) - -#define USB_STALL_OL_DIS_STALL_O_DIS5_MASK (0x20U) -#define USB_STALL_OL_DIS_STALL_O_DIS5_SHIFT (5U) -/*! STALL_O_DIS5 - Disable Endpoint 5 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS5(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS5_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS5_MASK) - -#define USB_STALL_OL_DIS_STALL_O_DIS6_MASK (0x40U) -#define USB_STALL_OL_DIS_STALL_O_DIS6_SHIFT (6U) -/*! STALL_O_DIS6 - Disable Endpoint 6 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS6(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS6_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS6_MASK) - -#define USB_STALL_OL_DIS_STALL_O_DIS7_MASK (0x80U) -#define USB_STALL_OL_DIS_STALL_O_DIS7_SHIFT (7U) -/*! STALL_O_DIS7 - Disable Endpoint 7 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS7(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS7_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS7_MASK) -/*! @} */ - -/*! @name STALL_OH_DIS - Peripheral Mode Stall Disable for Endpoints 15 to 8 in OUT Direction */ -/*! @{ */ - -#define USB_STALL_OH_DIS_STALL_O_DIS8_MASK (0x1U) -#define USB_STALL_OH_DIS_STALL_O_DIS8_SHIFT (0U) -/*! STALL_O_DIS8 - Disable Endpoint 8 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS8(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS8_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS8_MASK) - -#define USB_STALL_OH_DIS_STALL_O_DIS9_MASK (0x2U) -#define USB_STALL_OH_DIS_STALL_O_DIS9_SHIFT (1U) -/*! STALL_O_DIS9 - Disable Endpoint 9 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS9(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS9_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS9_MASK) - -#define USB_STALL_OH_DIS_STALL_O_DIS10_MASK (0x4U) -#define USB_STALL_OH_DIS_STALL_O_DIS10_SHIFT (2U) -/*! STALL_O_DIS10 - Disable Endpoint 10 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS10(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS10_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS10_MASK) - -#define USB_STALL_OH_DIS_STALL_O_DIS11_MASK (0x8U) -#define USB_STALL_OH_DIS_STALL_O_DIS11_SHIFT (3U) -/*! STALL_O_DIS11 - Disable Endpoint 11 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS11(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS11_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS11_MASK) - -#define USB_STALL_OH_DIS_STALL_O_DIS12_MASK (0x10U) -#define USB_STALL_OH_DIS_STALL_O_DIS12_SHIFT (4U) -/*! STALL_O_DIS12 - Disable endpoint 12 OUT direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS12(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS12_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS12_MASK) - -#define USB_STALL_OH_DIS_STALL_O_DIS13_MASK (0x20U) -#define USB_STALL_OH_DIS_STALL_O_DIS13_SHIFT (5U) -/*! STALL_O_DIS13 - Disable Endpoint 13 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS13(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS13_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS13_MASK) - -#define USB_STALL_OH_DIS_STALL_O_DIS14_MASK (0x40U) -#define USB_STALL_OH_DIS_STALL_O_DIS14_SHIFT (6U) -/*! STALL_O_DIS14 - Disable Endpoint 14 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS14(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS14_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS14_MASK) - -#define USB_STALL_OH_DIS_STALL_O_DIS15_MASK (0x80U) -#define USB_STALL_OH_DIS_STALL_O_DIS15_SHIFT (7U) -/*! STALL_O_DIS15 - Disable Endpoint 15 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS15(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS15_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS15_MASK) -/*! @} */ - -/*! @name CLK_RECOVER_CTRL - USB Clock Recovery Control */ -/*! @{ */ - -#define USB_CLK_RECOVER_CTRL_TRIM_INIT_VAL_SEL_MASK (0x8U) -#define USB_CLK_RECOVER_CTRL_TRIM_INIT_VAL_SEL_SHIFT (3U) -/*! TRIM_INIT_VAL_SEL - Selects the source for the initial FIRC trim fine value used after a reset. - * 0b0..Mid-scale - * 0b1..IFR - */ -#define USB_CLK_RECOVER_CTRL_TRIM_INIT_VAL_SEL(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_CTRL_TRIM_INIT_VAL_SEL_SHIFT)) & USB_CLK_RECOVER_CTRL_TRIM_INIT_VAL_SEL_MASK) - -#define USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN_MASK (0x20U) -#define USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN_SHIFT (5U) -/*! RESTART_IFRTRIM_EN - Restart from IFR Trim Value - * 0b0..Trim fine adjustment always works based on the previous updated trim fine value. - * 0b1..Trim fine restarts from the IFR trim value whenever you detect bus_reset or bus_resume or deassert module enable. - */ -#define USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN_SHIFT)) & USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN_MASK) - -#define USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN_MASK (0x40U) -#define USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN_SHIFT (6U) -/*! RESET_RESUME_ROUGH_EN - Reset or Resume to Rough Phase Enable - * 0b0..Always works in tracking phase after the first time rough phase, to track transition. - * 0b1..Go back to rough stage whenever a bus reset or bus resume occurs. - */ -#define USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN_SHIFT)) & USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN_MASK) - -#define USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN_MASK (0x80U) -#define USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN_SHIFT (7U) -/*! CLOCK_RECOVER_EN - Crystal-Less USB Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN_SHIFT)) & USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN_MASK) -/*! @} */ - -/*! @name CLK_RECOVER_IRC_EN - FIRC Oscillator Enable */ -/*! @{ */ - -#define USB_CLK_RECOVER_IRC_EN_IRC_EN_MASK (0x2U) -#define USB_CLK_RECOVER_IRC_EN_IRC_EN_SHIFT (1U) -/*! IRC_EN - Fast IRC enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_CLK_RECOVER_IRC_EN_IRC_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_IRC_EN_IRC_EN_SHIFT)) & USB_CLK_RECOVER_IRC_EN_IRC_EN_MASK) -/*! @} */ - -/*! @name CLK_RECOVER_INT_EN - Clock Recovery Combined Interrupt Enable */ -/*! @{ */ - -#define USB_CLK_RECOVER_INT_EN_OVF_ERROR_EN_MASK (0x10U) -#define USB_CLK_RECOVER_INT_EN_OVF_ERROR_EN_SHIFT (4U) -/*! OVF_ERROR_EN - Overflow error interrupt enable - * 0b0..The interrupt is masked - * 0b1..The interrupt is enabled - */ -#define USB_CLK_RECOVER_INT_EN_OVF_ERROR_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_INT_EN_OVF_ERROR_EN_SHIFT)) & USB_CLK_RECOVER_INT_EN_OVF_ERROR_EN_MASK) -/*! @} */ - -/*! @name CLK_RECOVER_INT_STATUS - Clock Recovery Separated Interrupt Status */ -/*! @{ */ - -#define USB_CLK_RECOVER_INT_STATUS_OVF_ERROR_MASK (0x10U) -#define USB_CLK_RECOVER_INT_STATUS_OVF_ERROR_SHIFT (4U) -/*! OVF_ERROR - Overflow Error Interrupt Status Flag - * 0b0..Interrupt did not occur - * 0b1..Unmasked interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_CLK_RECOVER_INT_STATUS_OVF_ERROR(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_INT_STATUS_OVF_ERROR_SHIFT)) & USB_CLK_RECOVER_INT_STATUS_OVF_ERROR_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group USB_Register_Masks */ - - -/* USB - Peripheral instance base addresses */ -/** Peripheral USB0 base address */ -#define USB0_BASE (0x400A4000u) -/** Peripheral USB0 base pointer */ -#define USB0 ((USB_Type *)USB0_BASE) -/** Array initializer of USB peripheral base addresses */ -#define USB_BASE_ADDRS { USB0_BASE } -/** Array initializer of USB peripheral base pointers */ -#define USB_BASE_PTRS { USB0 } -/** Interrupt vectors for the USB peripheral type */ -#define USB_IRQS { USB0_IRQn } -/* Backward compatibility */ -#define USBFS_IRQS USB_IRQS -#define USBFS_IRQHandler USB0_IRQHandler - - -/*! - * @} - */ /* end of group USB_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- UTICK Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup UTICK_Peripheral_Access_Layer UTICK Peripheral Access Layer - * @{ - */ - -/** UTICK - Register Layout Typedef */ -typedef struct { - __IO uint32_t CTRL; /**< Control, offset: 0x0 */ - __IO uint32_t STAT; /**< Status, offset: 0x4 */ - __IO uint32_t CFG; /**< Capture Configuration, offset: 0x8 */ - __O uint32_t CAPCLR; /**< Capture Clear, offset: 0xC */ - __I uint32_t CAP[4]; /**< Capture, array offset: 0x10, array step: 0x4 */ -} UTICK_Type; - -/* ---------------------------------------------------------------------------- - -- UTICK Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup UTICK_Register_Masks UTICK Register Masks - * @{ - */ - -/*! @name CTRL - Control */ -/*! @{ */ - -#define UTICK_CTRL_DELAYVAL_MASK (0x7FFFFFFFU) -#define UTICK_CTRL_DELAYVAL_SHIFT (0U) -/*! DELAYVAL - Tick Interval - * 0b0000000000000000000000000000000.. - * *..Clock cycles as defined in the description - */ -#define UTICK_CTRL_DELAYVAL(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CTRL_DELAYVAL_SHIFT)) & UTICK_CTRL_DELAYVAL_MASK) - -#define UTICK_CTRL_REPEAT_MASK (0x80000000U) -#define UTICK_CTRL_REPEAT_SHIFT (31U) -/*! REPEAT - Repeat Delay - * 0b0..One-time delay - * 0b1..Delay repeats continuously - */ -#define UTICK_CTRL_REPEAT(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CTRL_REPEAT_SHIFT)) & UTICK_CTRL_REPEAT_MASK) -/*! @} */ - -/*! @name STAT - Status */ -/*! @{ */ - -#define UTICK_STAT_INTR_MASK (0x1U) -#define UTICK_STAT_INTR_SHIFT (0U) -/*! INTR - Interrupt Flag - * 0b0..Not pending - * 0b1..Pending - */ -#define UTICK_STAT_INTR(x) (((uint32_t)(((uint32_t)(x)) << UTICK_STAT_INTR_SHIFT)) & UTICK_STAT_INTR_MASK) - -#define UTICK_STAT_ACTIVE_MASK (0x2U) -#define UTICK_STAT_ACTIVE_SHIFT (1U) -/*! ACTIVE - Timer Active Flag - * 0b0..Inactive (stopped) - * 0b1..Active - */ -#define UTICK_STAT_ACTIVE(x) (((uint32_t)(((uint32_t)(x)) << UTICK_STAT_ACTIVE_SHIFT)) & UTICK_STAT_ACTIVE_MASK) -/*! @} */ - -/*! @name CFG - Capture Configuration */ -/*! @{ */ - -#define UTICK_CFG_CAPEN0_MASK (0x1U) -#define UTICK_CFG_CAPEN0_SHIFT (0U) -/*! CAPEN0 - Enable Capture 0 - * 0b0..Disable - * 0b1..Enable - */ -#define UTICK_CFG_CAPEN0(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPEN0_SHIFT)) & UTICK_CFG_CAPEN0_MASK) - -#define UTICK_CFG_CAPEN1_MASK (0x2U) -#define UTICK_CFG_CAPEN1_SHIFT (1U) -/*! CAPEN1 - Enable Capture 1 - * 0b0..Disable - * 0b1..Enable - */ -#define UTICK_CFG_CAPEN1(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPEN1_SHIFT)) & UTICK_CFG_CAPEN1_MASK) - -#define UTICK_CFG_CAPEN2_MASK (0x4U) -#define UTICK_CFG_CAPEN2_SHIFT (2U) -/*! CAPEN2 - Enable Capture 2 - * 0b0..Disable - * 0b1..Enable - */ -#define UTICK_CFG_CAPEN2(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPEN2_SHIFT)) & UTICK_CFG_CAPEN2_MASK) - -#define UTICK_CFG_CAPEN3_MASK (0x8U) -#define UTICK_CFG_CAPEN3_SHIFT (3U) -/*! CAPEN3 - Enable Capture 3 - * 0b0..Disable - * 0b1..Enable - */ -#define UTICK_CFG_CAPEN3(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPEN3_SHIFT)) & UTICK_CFG_CAPEN3_MASK) - -#define UTICK_CFG_CAPPOL0_MASK (0x100U) -#define UTICK_CFG_CAPPOL0_SHIFT (8U) -/*! CAPPOL0 - Capture Polarity 0 - * 0b0..Positive - * 0b1..Negative - */ -#define UTICK_CFG_CAPPOL0(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPPOL0_SHIFT)) & UTICK_CFG_CAPPOL0_MASK) - -#define UTICK_CFG_CAPPOL1_MASK (0x200U) -#define UTICK_CFG_CAPPOL1_SHIFT (9U) -/*! CAPPOL1 - Capture-Polarity 1 - * 0b0..Positive - * 0b1..Negative - */ -#define UTICK_CFG_CAPPOL1(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPPOL1_SHIFT)) & UTICK_CFG_CAPPOL1_MASK) - -#define UTICK_CFG_CAPPOL2_MASK (0x400U) -#define UTICK_CFG_CAPPOL2_SHIFT (10U) -/*! CAPPOL2 - Capture Polarity 2 - * 0b0..Positive - * 0b1..Negative - */ -#define UTICK_CFG_CAPPOL2(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPPOL2_SHIFT)) & UTICK_CFG_CAPPOL2_MASK) - -#define UTICK_CFG_CAPPOL3_MASK (0x800U) -#define UTICK_CFG_CAPPOL3_SHIFT (11U) -/*! CAPPOL3 - Capture Polarity 3 - * 0b0..Positive - * 0b1..Negative - */ -#define UTICK_CFG_CAPPOL3(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPPOL3_SHIFT)) & UTICK_CFG_CAPPOL3_MASK) -/*! @} */ - -/*! @name CAPCLR - Capture Clear */ -/*! @{ */ - -#define UTICK_CAPCLR_CAPCLR0_MASK (0x1U) -#define UTICK_CAPCLR_CAPCLR0_SHIFT (0U) -/*! CAPCLR0 - Clear Capture 0 - * 0b0..Does nothing - * 0b1..Clears the CAP0 register value - */ -#define UTICK_CAPCLR_CAPCLR0(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CAPCLR_CAPCLR0_SHIFT)) & UTICK_CAPCLR_CAPCLR0_MASK) - -#define UTICK_CAPCLR_CAPCLR1_MASK (0x2U) -#define UTICK_CAPCLR_CAPCLR1_SHIFT (1U) -/*! CAPCLR1 - Clear Capture 1 - * 0b0..Does nothing - * 0b1..Clears the CAP1 register value - */ -#define UTICK_CAPCLR_CAPCLR1(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CAPCLR_CAPCLR1_SHIFT)) & UTICK_CAPCLR_CAPCLR1_MASK) - -#define UTICK_CAPCLR_CAPCLR2_MASK (0x4U) -#define UTICK_CAPCLR_CAPCLR2_SHIFT (2U) -/*! CAPCLR2 - Clear Capture 2 - * 0b0..Does nothing - * 0b1..Clears the CAP2 register value - */ -#define UTICK_CAPCLR_CAPCLR2(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CAPCLR_CAPCLR2_SHIFT)) & UTICK_CAPCLR_CAPCLR2_MASK) - -#define UTICK_CAPCLR_CAPCLR3_MASK (0x8U) -#define UTICK_CAPCLR_CAPCLR3_SHIFT (3U) -/*! CAPCLR3 - Clear Capture 3 - * 0b0..Does nothing - * 0b1..Clears the CAP3 register value - */ -#define UTICK_CAPCLR_CAPCLR3(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CAPCLR_CAPCLR3_SHIFT)) & UTICK_CAPCLR_CAPCLR3_MASK) -/*! @} */ - -/*! @name CAP - Capture */ -/*! @{ */ - -#define UTICK_CAP_CAP_VALUE_MASK (0x7FFFFFFFU) -#define UTICK_CAP_CAP_VALUE_SHIFT (0U) -/*! CAP_VALUE - Captured Value for the Related Capture Event */ -#define UTICK_CAP_CAP_VALUE(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CAP_CAP_VALUE_SHIFT)) & UTICK_CAP_CAP_VALUE_MASK) - -#define UTICK_CAP_VALID_MASK (0x80000000U) -#define UTICK_CAP_VALID_SHIFT (31U) -/*! VALID - Captured Value Valid Flag - * 0b0..Valid value not captured - * 0b1..Valid value captured - */ -#define UTICK_CAP_VALID(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CAP_VALID_SHIFT)) & UTICK_CAP_VALID_MASK) -/*! @} */ - -/* The count of UTICK_CAP */ -#define UTICK_CAP_COUNT (4U) - - -/*! - * @} - */ /* end of group UTICK_Register_Masks */ - - -/* UTICK - Peripheral instance base addresses */ -/** Peripheral UTICK0 base address */ -#define UTICK0_BASE (0x4000B000u) -/** Peripheral UTICK0 base pointer */ -#define UTICK0 ((UTICK_Type *)UTICK0_BASE) -/** Array initializer of UTICK peripheral base addresses */ -#define UTICK_BASE_ADDRS { UTICK0_BASE } -/** Array initializer of UTICK peripheral base pointers */ -#define UTICK_BASE_PTRS { UTICK0 } -/** Interrupt vectors for the UTICK peripheral type */ -#define UTICK_IRQS { UTICK0_IRQn } - -/*! - * @} - */ /* end of group UTICK_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- VBAT Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup VBAT_Peripheral_Access_Layer VBAT Peripheral Access Layer - * @{ - */ - -/** VBAT - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - uint8_t RESERVED_0[508]; - __IO uint32_t FROCTLA; /**< FRO16K Control A, offset: 0x200 */ - uint8_t RESERVED_1[20]; - __IO uint32_t FROLCKA; /**< FRO16K Lock A, offset: 0x218 */ - uint8_t RESERVED_2[4]; - __IO uint32_t FROCLKE; /**< FRO16K Clock Enable, offset: 0x220 */ - uint8_t RESERVED_3[1244]; - struct { /* offset: 0x700, array step: 0x8 */ - __IO uint32_t WAKEUPA; /**< Wakeup 0 Register A, array offset: 0x700, array step: 0x8 */ - uint8_t RESERVED_0[4]; - } WAKEUP[2]; - uint8_t RESERVED_4[232]; - __IO uint32_t WAKLCKA; /**< Wakeup Lock A, offset: 0x7F8 */ -} VBAT_Type; - -/* ---------------------------------------------------------------------------- - -- VBAT Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup VBAT_Register_Masks VBAT Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define VBAT_VERID_FEATURE_MASK (0xFFFFU) -#define VBAT_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number */ -#define VBAT_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_VERID_FEATURE_SHIFT)) & VBAT_VERID_FEATURE_MASK) - -#define VBAT_VERID_MINOR_MASK (0xFF0000U) -#define VBAT_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define VBAT_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << VBAT_VERID_MINOR_SHIFT)) & VBAT_VERID_MINOR_MASK) - -#define VBAT_VERID_MAJOR_MASK (0xFF000000U) -#define VBAT_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define VBAT_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << VBAT_VERID_MAJOR_SHIFT)) & VBAT_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name FROCTLA - FRO16K Control A */ -/*! @{ */ - -#define VBAT_FROCTLA_FRO_EN_MASK (0x1U) -#define VBAT_FROCTLA_FRO_EN_SHIFT (0U) -/*! FRO_EN - FRO16K Enable - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_FROCTLA_FRO_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_FROCTLA_FRO_EN_SHIFT)) & VBAT_FROCTLA_FRO_EN_MASK) -/*! @} */ - -/*! @name FROLCKA - FRO16K Lock A */ -/*! @{ */ - -#define VBAT_FROLCKA_LOCK_MASK (0x1U) -#define VBAT_FROLCKA_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b0..Do not block - * 0b1..Block - */ -#define VBAT_FROLCKA_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_FROLCKA_LOCK_SHIFT)) & VBAT_FROLCKA_LOCK_MASK) -/*! @} */ - -/*! @name FROCLKE - FRO16K Clock Enable */ -/*! @{ */ - -#define VBAT_FROCLKE_CLKE_MASK (0x3U) -#define VBAT_FROCLKE_CLKE_SHIFT (0U) -/*! CLKE - Clock Enable */ -#define VBAT_FROCLKE_CLKE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_FROCLKE_CLKE_SHIFT)) & VBAT_FROCLKE_CLKE_MASK) -/*! @} */ - -/*! @name WAKEUP_WAKEUPA - Wakeup 0 Register A */ -/*! @{ */ - -#define VBAT_WAKEUP_WAKEUPA_REG_MASK (0xFFFFFFFFU) -#define VBAT_WAKEUP_WAKEUPA_REG_SHIFT (0U) -/*! REG - Register */ -#define VBAT_WAKEUP_WAKEUPA_REG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKEUP_WAKEUPA_REG_SHIFT)) & VBAT_WAKEUP_WAKEUPA_REG_MASK) -/*! @} */ - -/* The count of VBAT_WAKEUP_WAKEUPA */ -#define VBAT_WAKEUP_WAKEUPA_COUNT (2U) - -/*! @name WAKLCKA - Wakeup Lock A */ -/*! @{ */ - -#define VBAT_WAKLCKA_LOCK_MASK (0x1U) -#define VBAT_WAKLCKA_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b0..Lock is disabled - * 0b1..Lock is enabled - */ -#define VBAT_WAKLCKA_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKLCKA_LOCK_SHIFT)) & VBAT_WAKLCKA_LOCK_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group VBAT_Register_Masks */ - - -/* VBAT - Peripheral instance base addresses */ -/** Peripheral VBAT0 base address */ -#define VBAT0_BASE (0x40093000u) -/** Peripheral VBAT0 base pointer */ -#define VBAT0 ((VBAT_Type *)VBAT0_BASE) -/** Array initializer of VBAT peripheral base addresses */ -#define VBAT_BASE_ADDRS { VBAT0_BASE } -/** Array initializer of VBAT peripheral base pointers */ -#define VBAT_BASE_PTRS { VBAT0 } - -/*! - * @} - */ /* end of group VBAT_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- WAKETIMER Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup WAKETIMER_Peripheral_Access_Layer WAKETIMER Peripheral Access Layer - * @{ - */ - -/** WAKETIMER - Register Layout Typedef */ -typedef struct { - __IO uint32_t WAKE_TIMER_CTRL; /**< Wake Timer Control, offset: 0x0 */ - uint8_t RESERVED_0[8]; - __IO uint32_t WAKE_TIMER_CNT; /**< Wake Timer Counter, offset: 0xC */ -} WAKETIMER_Type; - -/* ---------------------------------------------------------------------------- - -- WAKETIMER Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup WAKETIMER_Register_Masks WAKETIMER Register Masks - * @{ - */ - -/*! @name WAKE_TIMER_CTRL - Wake Timer Control */ -/*! @{ */ - -#define WAKETIMER_WAKE_TIMER_CTRL_WAKE_FLAG_MASK (0x2U) -#define WAKETIMER_WAKE_TIMER_CTRL_WAKE_FLAG_SHIFT (1U) -/*! WAKE_FLAG - Wake Timer Status Flag - * 0b0..Wake timer has not timed out. - * 0b1..Wake timer has timed out. - */ -#define WAKETIMER_WAKE_TIMER_CTRL_WAKE_FLAG(x) (((uint32_t)(((uint32_t)(x)) << WAKETIMER_WAKE_TIMER_CTRL_WAKE_FLAG_SHIFT)) & WAKETIMER_WAKE_TIMER_CTRL_WAKE_FLAG_MASK) - -#define WAKETIMER_WAKE_TIMER_CTRL_CLR_WAKE_TIMER_MASK (0x4U) -#define WAKETIMER_WAKE_TIMER_CTRL_CLR_WAKE_TIMER_SHIFT (2U) -/*! CLR_WAKE_TIMER - Clear Wake Timer - * 0b0..No effect. - * 0b1..Clears the wake timer counter and halts operation until a new count value is loaded. - */ -#define WAKETIMER_WAKE_TIMER_CTRL_CLR_WAKE_TIMER(x) (((uint32_t)(((uint32_t)(x)) << WAKETIMER_WAKE_TIMER_CTRL_CLR_WAKE_TIMER_SHIFT)) & WAKETIMER_WAKE_TIMER_CTRL_CLR_WAKE_TIMER_MASK) - -#define WAKETIMER_WAKE_TIMER_CTRL_OSC_DIV_ENA_MASK (0x10U) -#define WAKETIMER_WAKE_TIMER_CTRL_OSC_DIV_ENA_SHIFT (4U) -/*! OSC_DIV_ENA - OSC Divide Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define WAKETIMER_WAKE_TIMER_CTRL_OSC_DIV_ENA(x) (((uint32_t)(((uint32_t)(x)) << WAKETIMER_WAKE_TIMER_CTRL_OSC_DIV_ENA_SHIFT)) & WAKETIMER_WAKE_TIMER_CTRL_OSC_DIV_ENA_MASK) - -#define WAKETIMER_WAKE_TIMER_CTRL_INTR_EN_MASK (0x20U) -#define WAKETIMER_WAKE_TIMER_CTRL_INTR_EN_SHIFT (5U) -/*! INTR_EN - Enable Interrupt - * 0b0..Disabled - * 0b1..Enabled - */ -#define WAKETIMER_WAKE_TIMER_CTRL_INTR_EN(x) (((uint32_t)(((uint32_t)(x)) << WAKETIMER_WAKE_TIMER_CTRL_INTR_EN_SHIFT)) & WAKETIMER_WAKE_TIMER_CTRL_INTR_EN_MASK) -/*! @} */ - -/*! @name WAKE_TIMER_CNT - Wake Timer Counter */ -/*! @{ */ - -#define WAKETIMER_WAKE_TIMER_CNT_WAKE_CNT_MASK (0xFFFFFFFFU) -#define WAKETIMER_WAKE_TIMER_CNT_WAKE_CNT_SHIFT (0U) -/*! WAKE_CNT - Wake Counter */ -#define WAKETIMER_WAKE_TIMER_CNT_WAKE_CNT(x) (((uint32_t)(((uint32_t)(x)) << WAKETIMER_WAKE_TIMER_CNT_WAKE_CNT_SHIFT)) & WAKETIMER_WAKE_TIMER_CNT_WAKE_CNT_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group WAKETIMER_Register_Masks */ - - -/* WAKETIMER - Peripheral instance base addresses */ -/** Peripheral WAKETIMER0 base address */ -#define WAKETIMER0_BASE (0x400AE000u) -/** Peripheral WAKETIMER0 base pointer */ -#define WAKETIMER0 ((WAKETIMER_Type *)WAKETIMER0_BASE) -/** Array initializer of WAKETIMER peripheral base addresses */ -#define WAKETIMER_BASE_ADDRS { WAKETIMER0_BASE } -/** Array initializer of WAKETIMER peripheral base pointers */ -#define WAKETIMER_BASE_PTRS { WAKETIMER0 } -/** Interrupt vectors for the WAKETIMER peripheral type */ -#define WAKETIMER_IRQS { WAKETIMER0_IRQn } - -/*! - * @} - */ /* end of group WAKETIMER_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- WUU Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup WUU_Peripheral_Access_Layer WUU Peripheral Access Layer - * @{ - */ - -/** WUU - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - __IO uint32_t PE1; /**< Pin Enable 1, offset: 0x8 */ - __IO uint32_t PE2; /**< Pin Enable 2, offset: 0xC */ - uint8_t RESERVED_0[8]; - __IO uint32_t ME; /**< Module Interrupt Enable, offset: 0x18 */ - __IO uint32_t DE; /**< Module DMA/Trigger Enable, offset: 0x1C */ - __IO uint32_t PF; /**< Pin Flag, offset: 0x20 */ - uint8_t RESERVED_1[12]; - __IO uint32_t FILT; /**< Pin Filter, offset: 0x30 */ - uint8_t RESERVED_2[4]; - __IO uint32_t PDC1; /**< Pin DMA/Trigger Configuration 1, offset: 0x38 */ - __IO uint32_t PDC2; /**< Pin DMA/Trigger Configuration 2, offset: 0x3C */ - uint8_t RESERVED_3[8]; - __IO uint32_t FDC; /**< Pin Filter DMA/Trigger Configuration, offset: 0x48 */ - uint8_t RESERVED_4[4]; - __IO uint32_t PMC; /**< Pin Mode Configuration, offset: 0x50 */ - uint8_t RESERVED_5[4]; - __IO uint32_t FMC; /**< Pin Filter Mode Configuration, offset: 0x58 */ -} WUU_Type; - -/* ---------------------------------------------------------------------------- - -- WUU Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup WUU_Register_Masks WUU Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define WUU_VERID_FEATURE_MASK (0xFFFFU) -#define WUU_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Standard features implemented - * 0b0000000000000001..Support for DMA/Trigger generation from wake-up pins and filters enabled. Support for - * external pin/filter detection during all power modes enabled. - * *.. - */ -#define WUU_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << WUU_VERID_FEATURE_SHIFT)) & WUU_VERID_FEATURE_MASK) - -#define WUU_VERID_MINOR_MASK (0xFF0000U) -#define WUU_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define WUU_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << WUU_VERID_MINOR_SHIFT)) & WUU_VERID_MINOR_MASK) - -#define WUU_VERID_MAJOR_MASK (0xFF000000U) -#define WUU_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define WUU_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << WUU_VERID_MAJOR_SHIFT)) & WUU_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define WUU_PARAM_FILTERS_MASK (0xFFU) -#define WUU_PARAM_FILTERS_SHIFT (0U) -/*! FILTERS - Filter Number */ -#define WUU_PARAM_FILTERS(x) (((uint32_t)(((uint32_t)(x)) << WUU_PARAM_FILTERS_SHIFT)) & WUU_PARAM_FILTERS_MASK) - -#define WUU_PARAM_DMAS_MASK (0xFF00U) -#define WUU_PARAM_DMAS_SHIFT (8U) -/*! DMAS - DMA Number */ -#define WUU_PARAM_DMAS(x) (((uint32_t)(((uint32_t)(x)) << WUU_PARAM_DMAS_SHIFT)) & WUU_PARAM_DMAS_MASK) - -#define WUU_PARAM_MODULES_MASK (0xFF0000U) -#define WUU_PARAM_MODULES_SHIFT (16U) -/*! MODULES - Module Number */ -#define WUU_PARAM_MODULES(x) (((uint32_t)(((uint32_t)(x)) << WUU_PARAM_MODULES_SHIFT)) & WUU_PARAM_MODULES_MASK) - -#define WUU_PARAM_PINS_MASK (0xFF000000U) -#define WUU_PARAM_PINS_SHIFT (24U) -/*! PINS - Pin Number */ -#define WUU_PARAM_PINS(x) (((uint32_t)(((uint32_t)(x)) << WUU_PARAM_PINS_SHIFT)) & WUU_PARAM_PINS_MASK) -/*! @} */ - -/*! @name PE1 - Pin Enable 1 */ -/*! @{ */ - -#define WUU_PE1_Reserved0_MASK (0x3U) -#define WUU_PE1_Reserved0_SHIFT (0U) -/*! Reserved0 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PE1_Reserved0(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_Reserved0_SHIFT)) & WUU_PE1_Reserved0_MASK) - -#define WUU_PE1_Reserved1_MASK (0xCU) -#define WUU_PE1_Reserved1_SHIFT (2U) -/*! Reserved1 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PE1_Reserved1(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_Reserved1_SHIFT)) & WUU_PE1_Reserved1_MASK) - -#define WUU_PE1_WUPE2_MASK (0x30U) -#define WUU_PE1_WUPE2_SHIFT (4U) -/*! WUPE2 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE2(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE2_SHIFT)) & WUU_PE1_WUPE2_MASK) - -#define WUU_PE1_Reserved3_MASK (0xC0U) -#define WUU_PE1_Reserved3_SHIFT (6U) -/*! Reserved3 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PE1_Reserved3(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_Reserved3_SHIFT)) & WUU_PE1_Reserved3_MASK) - -#define WUU_PE1_Reserved4_MASK (0x300U) -#define WUU_PE1_Reserved4_SHIFT (8U) -/*! Reserved4 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PE1_Reserved4(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_Reserved4_SHIFT)) & WUU_PE1_Reserved4_MASK) - -#define WUU_PE1_Reserved5_MASK (0xC00U) -#define WUU_PE1_Reserved5_SHIFT (10U) -/*! Reserved5 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PE1_Reserved5(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_Reserved5_SHIFT)) & WUU_PE1_Reserved5_MASK) - -#define WUU_PE1_WUPE6_MASK (0x3000U) -#define WUU_PE1_WUPE6_SHIFT (12U) -/*! WUPE6 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE6(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE6_SHIFT)) & WUU_PE1_WUPE6_MASK) - -#define WUU_PE1_WUPE7_MASK (0xC000U) -#define WUU_PE1_WUPE7_SHIFT (14U) -/*! WUPE7 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE7(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE7_SHIFT)) & WUU_PE1_WUPE7_MASK) - -#define WUU_PE1_WUPE8_MASK (0x30000U) -#define WUU_PE1_WUPE8_SHIFT (16U) -/*! WUPE8 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE8(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE8_SHIFT)) & WUU_PE1_WUPE8_MASK) - -#define WUU_PE1_WUPE9_MASK (0xC0000U) -#define WUU_PE1_WUPE9_SHIFT (18U) -/*! WUPE9 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE9(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE9_SHIFT)) & WUU_PE1_WUPE9_MASK) - -#define WUU_PE1_WUPE10_MASK (0x300000U) -#define WUU_PE1_WUPE10_SHIFT (20U) -/*! WUPE10 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE10(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE10_SHIFT)) & WUU_PE1_WUPE10_MASK) - -#define WUU_PE1_WUPE11_MASK (0xC00000U) -#define WUU_PE1_WUPE11_SHIFT (22U) -/*! WUPE11 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE11(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE11_SHIFT)) & WUU_PE1_WUPE11_MASK) - -#define WUU_PE1_WUPE12_MASK (0x3000000U) -#define WUU_PE1_WUPE12_SHIFT (24U) -/*! WUPE12 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE12(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE12_SHIFT)) & WUU_PE1_WUPE12_MASK) - -#define WUU_PE1_Reserved13_MASK (0xC000000U) -#define WUU_PE1_Reserved13_SHIFT (26U) -/*! Reserved13 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PE1_Reserved13(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_Reserved13_SHIFT)) & WUU_PE1_Reserved13_MASK) - -#define WUU_PE1_Reserved14_MASK (0x30000000U) -#define WUU_PE1_Reserved14_SHIFT (28U) -/*! Reserved14 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PE1_Reserved14(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_Reserved14_SHIFT)) & WUU_PE1_Reserved14_MASK) - -#define WUU_PE1_Reserved15_MASK (0xC0000000U) -#define WUU_PE1_Reserved15_SHIFT (30U) -/*! Reserved15 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PE1_Reserved15(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_Reserved15_SHIFT)) & WUU_PE1_Reserved15_MASK) -/*! @} */ - -/*! @name PE2 - Pin Enable 2 */ -/*! @{ */ - -#define WUU_PE2_WUPE16_MASK (0x3U) -#define WUU_PE2_WUPE16_SHIFT (0U) -/*! WUPE16 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE16(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE16_SHIFT)) & WUU_PE2_WUPE16_MASK) - -#define WUU_PE2_WUPE17_MASK (0xCU) -#define WUU_PE2_WUPE17_SHIFT (2U) -/*! WUPE17 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE17(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE17_SHIFT)) & WUU_PE2_WUPE17_MASK) - -#define WUU_PE2_WUPE18_MASK (0x30U) -#define WUU_PE2_WUPE18_SHIFT (4U) -/*! WUPE18 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE18(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE18_SHIFT)) & WUU_PE2_WUPE18_MASK) - -#define WUU_PE2_WUPE19_MASK (0xC0U) -#define WUU_PE2_WUPE19_SHIFT (6U) -/*! WUPE19 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE19(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE19_SHIFT)) & WUU_PE2_WUPE19_MASK) - -#define WUU_PE2_WUPE20_MASK (0x300U) -#define WUU_PE2_WUPE20_SHIFT (8U) -/*! WUPE20 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE20(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE20_SHIFT)) & WUU_PE2_WUPE20_MASK) - -#define WUU_PE2_Reserved21_MASK (0xC00U) -#define WUU_PE2_Reserved21_SHIFT (10U) -/*! Reserved21 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PE2_Reserved21(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_Reserved21_SHIFT)) & WUU_PE2_Reserved21_MASK) - -#define WUU_PE2_WUPE22_MASK (0x3000U) -#define WUU_PE2_WUPE22_SHIFT (12U) -/*! WUPE22 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE22(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE22_SHIFT)) & WUU_PE2_WUPE22_MASK) - -#define WUU_PE2_WUPE23_MASK (0xC000U) -#define WUU_PE2_WUPE23_SHIFT (14U) -/*! WUPE23 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE23(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE23_SHIFT)) & WUU_PE2_WUPE23_MASK) - -#define WUU_PE2_WUPE24_MASK (0x30000U) -#define WUU_PE2_WUPE24_SHIFT (16U) -/*! WUPE24 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE24(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE24_SHIFT)) & WUU_PE2_WUPE24_MASK) - -#define WUU_PE2_WUPE25_MASK (0xC0000U) -#define WUU_PE2_WUPE25_SHIFT (18U) -/*! WUPE25 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE25(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE25_SHIFT)) & WUU_PE2_WUPE25_MASK) - -#define WUU_PE2_WUPE26_MASK (0x300000U) -#define WUU_PE2_WUPE26_SHIFT (20U) -/*! WUPE26 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE26(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE26_SHIFT)) & WUU_PE2_WUPE26_MASK) - -#define WUU_PE2_WUPE27_MASK (0xC00000U) -#define WUU_PE2_WUPE27_SHIFT (22U) -/*! WUPE27 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE27(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE27_SHIFT)) & WUU_PE2_WUPE27_MASK) - -#define WUU_PE2_WUPE28_MASK (0x3000000U) -#define WUU_PE2_WUPE28_SHIFT (24U) -/*! WUPE28 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE28(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE28_SHIFT)) & WUU_PE2_WUPE28_MASK) - -#define WUU_PE2_WUPE29_MASK (0xC000000U) -#define WUU_PE2_WUPE29_SHIFT (26U) -/*! WUPE29 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE29(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE29_SHIFT)) & WUU_PE2_WUPE29_MASK) - -#define WUU_PE2_WUPE30_MASK (0x30000000U) -#define WUU_PE2_WUPE30_SHIFT (28U) -/*! WUPE30 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE30(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE30_SHIFT)) & WUU_PE2_WUPE30_MASK) - -#define WUU_PE2_WUPE31_MASK (0xC0000000U) -#define WUU_PE2_WUPE31_SHIFT (30U) -/*! WUPE31 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE31(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE31_SHIFT)) & WUU_PE2_WUPE31_MASK) -/*! @} */ - -/*! @name ME - Module Interrupt Enable */ -/*! @{ */ - -#define WUU_ME_WUME0_MASK (0x1U) -#define WUU_ME_WUME0_SHIFT (0U) -/*! WUME0 - Module Interrupt Wake-up Enable for Module 0 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME0(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME0_SHIFT)) & WUU_ME_WUME0_MASK) - -#define WUU_ME_WUME2_MASK (0x4U) -#define WUU_ME_WUME2_SHIFT (2U) -/*! WUME2 - Module Interrupt Wake-up Enable for Module 2 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME2(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME2_SHIFT)) & WUU_ME_WUME2_MASK) - -#define WUU_ME_WUME6_MASK (0x40U) -#define WUU_ME_WUME6_SHIFT (6U) -/*! WUME6 - Module Interrupt Wake-up Enable for Module 6 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME6(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME6_SHIFT)) & WUU_ME_WUME6_MASK) - -#define WUU_ME_WUME8_MASK (0x100U) -#define WUU_ME_WUME8_SHIFT (8U) -/*! WUME8 - Module Interrupt Wake-up Enable for Module 8 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME8(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME8_SHIFT)) & WUU_ME_WUME8_MASK) -/*! @} */ - -/*! @name DE - Module DMA/Trigger Enable */ -/*! @{ */ - -#define WUU_DE_WUDE4_MASK (0x10U) -#define WUU_DE_WUDE4_SHIFT (4U) -/*! WUDE4 - DMA/Trigger Wake-up Enable for Module 4 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE4(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE4_SHIFT)) & WUU_DE_WUDE4_MASK) - -#define WUU_DE_WUDE6_MASK (0x40U) -#define WUU_DE_WUDE6_SHIFT (6U) -/*! WUDE6 - DMA/Trigger Wake-up Enable for Module 6 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE6(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE6_SHIFT)) & WUU_DE_WUDE6_MASK) - -#define WUU_DE_WUDE8_MASK (0x100U) -#define WUU_DE_WUDE8_SHIFT (8U) -/*! WUDE8 - DMA/Trigger Wake-up Enable for Module 8 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE8(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE8_SHIFT)) & WUU_DE_WUDE8_MASK) -/*! @} */ - -/*! @name PF - Pin Flag */ -/*! @{ */ - -#define WUU_PF_Reserved0_MASK (0x1U) -#define WUU_PF_Reserved0_SHIFT (0U) -/*! Reserved0 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PF_Reserved0(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_Reserved0_SHIFT)) & WUU_PF_Reserved0_MASK) - -#define WUU_PF_Reserved1_MASK (0x2U) -#define WUU_PF_Reserved1_SHIFT (1U) -/*! Reserved1 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PF_Reserved1(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_Reserved1_SHIFT)) & WUU_PF_Reserved1_MASK) - -#define WUU_PF_WUF2_MASK (0x4U) -#define WUU_PF_WUF2_SHIFT (2U) -/*! WUF2 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF2(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF2_SHIFT)) & WUU_PF_WUF2_MASK) - -#define WUU_PF_Reserved3_MASK (0x8U) -#define WUU_PF_Reserved3_SHIFT (3U) -/*! Reserved3 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PF_Reserved3(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_Reserved3_SHIFT)) & WUU_PF_Reserved3_MASK) - -#define WUU_PF_Reserved4_MASK (0x10U) -#define WUU_PF_Reserved4_SHIFT (4U) -/*! Reserved4 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PF_Reserved4(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_Reserved4_SHIFT)) & WUU_PF_Reserved4_MASK) - -#define WUU_PF_Reserved5_MASK (0x20U) -#define WUU_PF_Reserved5_SHIFT (5U) -/*! Reserved5 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PF_Reserved5(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_Reserved5_SHIFT)) & WUU_PF_Reserved5_MASK) - -#define WUU_PF_WUF6_MASK (0x40U) -#define WUU_PF_WUF6_SHIFT (6U) -/*! WUF6 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF6(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF6_SHIFT)) & WUU_PF_WUF6_MASK) - -#define WUU_PF_WUF7_MASK (0x80U) -#define WUU_PF_WUF7_SHIFT (7U) -/*! WUF7 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF7(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF7_SHIFT)) & WUU_PF_WUF7_MASK) - -#define WUU_PF_WUF8_MASK (0x100U) -#define WUU_PF_WUF8_SHIFT (8U) -/*! WUF8 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF8(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF8_SHIFT)) & WUU_PF_WUF8_MASK) - -#define WUU_PF_WUF9_MASK (0x200U) -#define WUU_PF_WUF9_SHIFT (9U) -/*! WUF9 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF9(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF9_SHIFT)) & WUU_PF_WUF9_MASK) - -#define WUU_PF_WUF10_MASK (0x400U) -#define WUU_PF_WUF10_SHIFT (10U) -/*! WUF10 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF10(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF10_SHIFT)) & WUU_PF_WUF10_MASK) - -#define WUU_PF_WUF11_MASK (0x800U) -#define WUU_PF_WUF11_SHIFT (11U) -/*! WUF11 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF11(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF11_SHIFT)) & WUU_PF_WUF11_MASK) - -#define WUU_PF_WUF12_MASK (0x1000U) -#define WUU_PF_WUF12_SHIFT (12U) -/*! WUF12 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF12(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF12_SHIFT)) & WUU_PF_WUF12_MASK) - -#define WUU_PF_Reserved13_MASK (0x2000U) -#define WUU_PF_Reserved13_SHIFT (13U) -/*! Reserved13 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PF_Reserved13(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_Reserved13_SHIFT)) & WUU_PF_Reserved13_MASK) - -#define WUU_PF_Reserved14_MASK (0x4000U) -#define WUU_PF_Reserved14_SHIFT (14U) -/*! Reserved14 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PF_Reserved14(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_Reserved14_SHIFT)) & WUU_PF_Reserved14_MASK) - -#define WUU_PF_Reserved15_MASK (0x8000U) -#define WUU_PF_Reserved15_SHIFT (15U) -/*! Reserved15 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PF_Reserved15(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_Reserved15_SHIFT)) & WUU_PF_Reserved15_MASK) - -#define WUU_PF_WUF16_MASK (0x10000U) -#define WUU_PF_WUF16_SHIFT (16U) -/*! WUF16 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF16(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF16_SHIFT)) & WUU_PF_WUF16_MASK) - -#define WUU_PF_WUF17_MASK (0x20000U) -#define WUU_PF_WUF17_SHIFT (17U) -/*! WUF17 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF17(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF17_SHIFT)) & WUU_PF_WUF17_MASK) - -#define WUU_PF_WUF18_MASK (0x40000U) -#define WUU_PF_WUF18_SHIFT (18U) -/*! WUF18 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF18(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF18_SHIFT)) & WUU_PF_WUF18_MASK) - -#define WUU_PF_WUF19_MASK (0x80000U) -#define WUU_PF_WUF19_SHIFT (19U) -/*! WUF19 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF19(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF19_SHIFT)) & WUU_PF_WUF19_MASK) - -#define WUU_PF_WUF20_MASK (0x100000U) -#define WUU_PF_WUF20_SHIFT (20U) -/*! WUF20 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF20(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF20_SHIFT)) & WUU_PF_WUF20_MASK) - -#define WUU_PF_Reserved21_MASK (0x200000U) -#define WUU_PF_Reserved21_SHIFT (21U) -/*! Reserved21 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PF_Reserved21(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_Reserved21_SHIFT)) & WUU_PF_Reserved21_MASK) - -#define WUU_PF_WUF22_MASK (0x400000U) -#define WUU_PF_WUF22_SHIFT (22U) -/*! WUF22 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF22(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF22_SHIFT)) & WUU_PF_WUF22_MASK) - -#define WUU_PF_WUF23_MASK (0x800000U) -#define WUU_PF_WUF23_SHIFT (23U) -/*! WUF23 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF23(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF23_SHIFT)) & WUU_PF_WUF23_MASK) - -#define WUU_PF_WUF24_MASK (0x1000000U) -#define WUU_PF_WUF24_SHIFT (24U) -/*! WUF24 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF24(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF24_SHIFT)) & WUU_PF_WUF24_MASK) - -#define WUU_PF_WUF25_MASK (0x2000000U) -#define WUU_PF_WUF25_SHIFT (25U) -/*! WUF25 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF25(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF25_SHIFT)) & WUU_PF_WUF25_MASK) - -#define WUU_PF_WUF26_MASK (0x4000000U) -#define WUU_PF_WUF26_SHIFT (26U) -/*! WUF26 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF26(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF26_SHIFT)) & WUU_PF_WUF26_MASK) - -#define WUU_PF_WUF27_MASK (0x8000000U) -#define WUU_PF_WUF27_SHIFT (27U) -/*! WUF27 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF27(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF27_SHIFT)) & WUU_PF_WUF27_MASK) - -#define WUU_PF_WUF28_MASK (0x10000000U) -#define WUU_PF_WUF28_SHIFT (28U) -/*! WUF28 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF28(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF28_SHIFT)) & WUU_PF_WUF28_MASK) - -#define WUU_PF_WUF29_MASK (0x20000000U) -#define WUU_PF_WUF29_SHIFT (29U) -/*! WUF29 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF29(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF29_SHIFT)) & WUU_PF_WUF29_MASK) - -#define WUU_PF_WUF30_MASK (0x40000000U) -#define WUU_PF_WUF30_SHIFT (30U) -/*! WUF30 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF30(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF30_SHIFT)) & WUU_PF_WUF30_MASK) - -#define WUU_PF_WUF31_MASK (0x80000000U) -#define WUU_PF_WUF31_SHIFT (31U) -/*! WUF31 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF31(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF31_SHIFT)) & WUU_PF_WUF31_MASK) -/*! @} */ - -/*! @name FILT - Pin Filter */ -/*! @{ */ - -#define WUU_FILT_FILTSEL1_MASK (0x1FU) -#define WUU_FILT_FILTSEL1_SHIFT (0U) -/*! FILTSEL1 - Filter 1 Pin Select */ -#define WUU_FILT_FILTSEL1(x) (((uint32_t)(((uint32_t)(x)) << WUU_FILT_FILTSEL1_SHIFT)) & WUU_FILT_FILTSEL1_MASK) - -#define WUU_FILT_FILTE1_MASK (0x60U) -#define WUU_FILT_FILTE1_SHIFT (5U) -/*! FILTE1 - Filter 1 Enable - * 0b00..Disable - * 0b01..Enable (Detect on rising edge or high level) - * 0b10..Enable (Detect on falling edge or low level) - * 0b11..Enable (Detect on any edge) - */ -#define WUU_FILT_FILTE1(x) (((uint32_t)(((uint32_t)(x)) << WUU_FILT_FILTE1_SHIFT)) & WUU_FILT_FILTE1_MASK) - -#define WUU_FILT_FILTF1_MASK (0x80U) -#define WUU_FILT_FILTF1_SHIFT (7U) -/*! FILTF1 - Filter 1 Flag - * 0b0..No - * 0b1..Yes - */ -#define WUU_FILT_FILTF1(x) (((uint32_t)(((uint32_t)(x)) << WUU_FILT_FILTF1_SHIFT)) & WUU_FILT_FILTF1_MASK) - -#define WUU_FILT_FILTSEL2_MASK (0x1F00U) -#define WUU_FILT_FILTSEL2_SHIFT (8U) -/*! FILTSEL2 - Filter 2 Pin Select */ -#define WUU_FILT_FILTSEL2(x) (((uint32_t)(((uint32_t)(x)) << WUU_FILT_FILTSEL2_SHIFT)) & WUU_FILT_FILTSEL2_MASK) - -#define WUU_FILT_FILTE2_MASK (0x6000U) -#define WUU_FILT_FILTE2_SHIFT (13U) -/*! FILTE2 - Filter 2 Enable - * 0b00..Disable - * 0b01..Enable (Detect on rising edge or high level) - * 0b10..Enable (Detect on falling edge or low level) - * 0b11..Enable (Detect on any edge) - */ -#define WUU_FILT_FILTE2(x) (((uint32_t)(((uint32_t)(x)) << WUU_FILT_FILTE2_SHIFT)) & WUU_FILT_FILTE2_MASK) - -#define WUU_FILT_FILTF2_MASK (0x8000U) -#define WUU_FILT_FILTF2_SHIFT (15U) -/*! FILTF2 - Filter 2 Flag - * 0b0..No - * 0b1..Yes - */ -#define WUU_FILT_FILTF2(x) (((uint32_t)(((uint32_t)(x)) << WUU_FILT_FILTF2_SHIFT)) & WUU_FILT_FILTF2_MASK) -/*! @} */ - -/*! @name PDC1 - Pin DMA/Trigger Configuration 1 */ -/*! @{ */ - -#define WUU_PDC1_Reserved0_MASK (0x3U) -#define WUU_PDC1_Reserved0_SHIFT (0U) -/*! Reserved0 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PDC1_Reserved0(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_Reserved0_SHIFT)) & WUU_PDC1_Reserved0_MASK) - -#define WUU_PDC1_Reserved1_MASK (0xCU) -#define WUU_PDC1_Reserved1_SHIFT (2U) -/*! Reserved1 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PDC1_Reserved1(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_Reserved1_SHIFT)) & WUU_PDC1_Reserved1_MASK) - -#define WUU_PDC1_WUPDC2_MASK (0x30U) -#define WUU_PDC1_WUPDC2_SHIFT (4U) -/*! WUPDC2 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC2(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC2_SHIFT)) & WUU_PDC1_WUPDC2_MASK) - -#define WUU_PDC1_Reserved3_MASK (0xC0U) -#define WUU_PDC1_Reserved3_SHIFT (6U) -/*! Reserved3 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PDC1_Reserved3(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_Reserved3_SHIFT)) & WUU_PDC1_Reserved3_MASK) - -#define WUU_PDC1_Reserved4_MASK (0x300U) -#define WUU_PDC1_Reserved4_SHIFT (8U) -/*! Reserved4 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PDC1_Reserved4(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_Reserved4_SHIFT)) & WUU_PDC1_Reserved4_MASK) - -#define WUU_PDC1_Reserved5_MASK (0xC00U) -#define WUU_PDC1_Reserved5_SHIFT (10U) -/*! Reserved5 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PDC1_Reserved5(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_Reserved5_SHIFT)) & WUU_PDC1_Reserved5_MASK) - -#define WUU_PDC1_WUPDC6_MASK (0x3000U) -#define WUU_PDC1_WUPDC6_SHIFT (12U) -/*! WUPDC6 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC6(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC6_SHIFT)) & WUU_PDC1_WUPDC6_MASK) - -#define WUU_PDC1_WUPDC7_MASK (0xC000U) -#define WUU_PDC1_WUPDC7_SHIFT (14U) -/*! WUPDC7 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC7(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC7_SHIFT)) & WUU_PDC1_WUPDC7_MASK) - -#define WUU_PDC1_WUPDC8_MASK (0x30000U) -#define WUU_PDC1_WUPDC8_SHIFT (16U) -/*! WUPDC8 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC8(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC8_SHIFT)) & WUU_PDC1_WUPDC8_MASK) - -#define WUU_PDC1_WUPDC9_MASK (0xC0000U) -#define WUU_PDC1_WUPDC9_SHIFT (18U) -/*! WUPDC9 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC9(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC9_SHIFT)) & WUU_PDC1_WUPDC9_MASK) - -#define WUU_PDC1_WUPDC10_MASK (0x300000U) -#define WUU_PDC1_WUPDC10_SHIFT (20U) -/*! WUPDC10 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC10(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC10_SHIFT)) & WUU_PDC1_WUPDC10_MASK) - -#define WUU_PDC1_WUPDC11_MASK (0xC00000U) -#define WUU_PDC1_WUPDC11_SHIFT (22U) -/*! WUPDC11 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC11(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC11_SHIFT)) & WUU_PDC1_WUPDC11_MASK) - -#define WUU_PDC1_WUPDC12_MASK (0x3000000U) -#define WUU_PDC1_WUPDC12_SHIFT (24U) -/*! WUPDC12 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC12(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC12_SHIFT)) & WUU_PDC1_WUPDC12_MASK) - -#define WUU_PDC1_Reserved13_MASK (0xC000000U) -#define WUU_PDC1_Reserved13_SHIFT (26U) -/*! Reserved13 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PDC1_Reserved13(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_Reserved13_SHIFT)) & WUU_PDC1_Reserved13_MASK) - -#define WUU_PDC1_Reserved14_MASK (0x30000000U) -#define WUU_PDC1_Reserved14_SHIFT (28U) -/*! Reserved14 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PDC1_Reserved14(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_Reserved14_SHIFT)) & WUU_PDC1_Reserved14_MASK) - -#define WUU_PDC1_Reserved15_MASK (0xC0000000U) -#define WUU_PDC1_Reserved15_SHIFT (30U) -/*! Reserved15 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PDC1_Reserved15(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_Reserved15_SHIFT)) & WUU_PDC1_Reserved15_MASK) -/*! @} */ - -/*! @name PDC2 - Pin DMA/Trigger Configuration 2 */ -/*! @{ */ - -#define WUU_PDC2_WUPDC16_MASK (0x3U) -#define WUU_PDC2_WUPDC16_SHIFT (0U) -/*! WUPDC16 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC16(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC16_SHIFT)) & WUU_PDC2_WUPDC16_MASK) - -#define WUU_PDC2_WUPDC17_MASK (0xCU) -#define WUU_PDC2_WUPDC17_SHIFT (2U) -/*! WUPDC17 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC17(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC17_SHIFT)) & WUU_PDC2_WUPDC17_MASK) - -#define WUU_PDC2_WUPDC18_MASK (0x30U) -#define WUU_PDC2_WUPDC18_SHIFT (4U) -/*! WUPDC18 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC18(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC18_SHIFT)) & WUU_PDC2_WUPDC18_MASK) - -#define WUU_PDC2_WUPDC19_MASK (0xC0U) -#define WUU_PDC2_WUPDC19_SHIFT (6U) -/*! WUPDC19 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC19(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC19_SHIFT)) & WUU_PDC2_WUPDC19_MASK) - -#define WUU_PDC2_WUPDC20_MASK (0x300U) -#define WUU_PDC2_WUPDC20_SHIFT (8U) -/*! WUPDC20 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC20(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC20_SHIFT)) & WUU_PDC2_WUPDC20_MASK) - -#define WUU_PDC2_Reserved21_MASK (0xC00U) -#define WUU_PDC2_Reserved21_SHIFT (10U) -/*! Reserved21 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PDC2_Reserved21(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_Reserved21_SHIFT)) & WUU_PDC2_Reserved21_MASK) - -#define WUU_PDC2_WUPDC22_MASK (0x3000U) -#define WUU_PDC2_WUPDC22_SHIFT (12U) -/*! WUPDC22 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC22(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC22_SHIFT)) & WUU_PDC2_WUPDC22_MASK) - -#define WUU_PDC2_WUPDC23_MASK (0xC000U) -#define WUU_PDC2_WUPDC23_SHIFT (14U) -/*! WUPDC23 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC23(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC23_SHIFT)) & WUU_PDC2_WUPDC23_MASK) - -#define WUU_PDC2_WUPDC24_MASK (0x30000U) -#define WUU_PDC2_WUPDC24_SHIFT (16U) -/*! WUPDC24 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC24(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC24_SHIFT)) & WUU_PDC2_WUPDC24_MASK) - -#define WUU_PDC2_WUPDC25_MASK (0xC0000U) -#define WUU_PDC2_WUPDC25_SHIFT (18U) -/*! WUPDC25 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC25(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC25_SHIFT)) & WUU_PDC2_WUPDC25_MASK) - -#define WUU_PDC2_WUPDC26_MASK (0x300000U) -#define WUU_PDC2_WUPDC26_SHIFT (20U) -/*! WUPDC26 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC26(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC26_SHIFT)) & WUU_PDC2_WUPDC26_MASK) - -#define WUU_PDC2_WUPDC27_MASK (0xC00000U) -#define WUU_PDC2_WUPDC27_SHIFT (22U) -/*! WUPDC27 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC27(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC27_SHIFT)) & WUU_PDC2_WUPDC27_MASK) - -#define WUU_PDC2_WUPDC28_MASK (0x3000000U) -#define WUU_PDC2_WUPDC28_SHIFT (24U) -/*! WUPDC28 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC28(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC28_SHIFT)) & WUU_PDC2_WUPDC28_MASK) - -#define WUU_PDC2_WUPDC29_MASK (0xC000000U) -#define WUU_PDC2_WUPDC29_SHIFT (26U) -/*! WUPDC29 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC29(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC29_SHIFT)) & WUU_PDC2_WUPDC29_MASK) - -#define WUU_PDC2_WUPDC30_MASK (0x30000000U) -#define WUU_PDC2_WUPDC30_SHIFT (28U) -/*! WUPDC30 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC30(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC30_SHIFT)) & WUU_PDC2_WUPDC30_MASK) - -#define WUU_PDC2_WUPDC31_MASK (0xC0000000U) -#define WUU_PDC2_WUPDC31_SHIFT (30U) -/*! WUPDC31 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC31(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC31_SHIFT)) & WUU_PDC2_WUPDC31_MASK) -/*! @} */ - -/*! @name FDC - Pin Filter DMA/Trigger Configuration */ -/*! @{ */ - -#define WUU_FDC_FILTC1_MASK (0x3U) -#define WUU_FDC_FILTC1_SHIFT (0U) -/*! FILTC1 - Filter Configuration for FILTn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_FDC_FILTC1(x) (((uint32_t)(((uint32_t)(x)) << WUU_FDC_FILTC1_SHIFT)) & WUU_FDC_FILTC1_MASK) - -#define WUU_FDC_FILTC2_MASK (0xCU) -#define WUU_FDC_FILTC2_SHIFT (2U) -/*! FILTC2 - Filter Configuration for FILTn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_FDC_FILTC2(x) (((uint32_t)(((uint32_t)(x)) << WUU_FDC_FILTC2_SHIFT)) & WUU_FDC_FILTC2_MASK) -/*! @} */ - -/*! @name PMC - Pin Mode Configuration */ -/*! @{ */ - -#define WUU_PMC_Reserved0_MASK (0x1U) -#define WUU_PMC_Reserved0_SHIFT (0U) -/*! Reserved0 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PMC_Reserved0(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_Reserved0_SHIFT)) & WUU_PMC_Reserved0_MASK) - -#define WUU_PMC_Reserved1_MASK (0x2U) -#define WUU_PMC_Reserved1_SHIFT (1U) -/*! Reserved1 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PMC_Reserved1(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_Reserved1_SHIFT)) & WUU_PMC_Reserved1_MASK) - -#define WUU_PMC_WUPMC2_MASK (0x4U) -#define WUU_PMC_WUPMC2_SHIFT (2U) -/*! WUPMC2 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC2(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC2_SHIFT)) & WUU_PMC_WUPMC2_MASK) - -#define WUU_PMC_Reserved3_MASK (0x8U) -#define WUU_PMC_Reserved3_SHIFT (3U) -/*! Reserved3 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PMC_Reserved3(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_Reserved3_SHIFT)) & WUU_PMC_Reserved3_MASK) - -#define WUU_PMC_Reserved4_MASK (0x10U) -#define WUU_PMC_Reserved4_SHIFT (4U) -/*! Reserved4 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PMC_Reserved4(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_Reserved4_SHIFT)) & WUU_PMC_Reserved4_MASK) - -#define WUU_PMC_Reserved5_MASK (0x20U) -#define WUU_PMC_Reserved5_SHIFT (5U) -/*! Reserved5 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PMC_Reserved5(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_Reserved5_SHIFT)) & WUU_PMC_Reserved5_MASK) - -#define WUU_PMC_WUPMC6_MASK (0x40U) -#define WUU_PMC_WUPMC6_SHIFT (6U) -/*! WUPMC6 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC6(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC6_SHIFT)) & WUU_PMC_WUPMC6_MASK) - -#define WUU_PMC_WUPMC7_MASK (0x80U) -#define WUU_PMC_WUPMC7_SHIFT (7U) -/*! WUPMC7 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC7(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC7_SHIFT)) & WUU_PMC_WUPMC7_MASK) - -#define WUU_PMC_WUPMC8_MASK (0x100U) -#define WUU_PMC_WUPMC8_SHIFT (8U) -/*! WUPMC8 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC8(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC8_SHIFT)) & WUU_PMC_WUPMC8_MASK) - -#define WUU_PMC_WUPMC9_MASK (0x200U) -#define WUU_PMC_WUPMC9_SHIFT (9U) -/*! WUPMC9 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC9(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC9_SHIFT)) & WUU_PMC_WUPMC9_MASK) - -#define WUU_PMC_WUPMC10_MASK (0x400U) -#define WUU_PMC_WUPMC10_SHIFT (10U) -/*! WUPMC10 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC10(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC10_SHIFT)) & WUU_PMC_WUPMC10_MASK) - -#define WUU_PMC_WUPMC11_MASK (0x800U) -#define WUU_PMC_WUPMC11_SHIFT (11U) -/*! WUPMC11 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC11(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC11_SHIFT)) & WUU_PMC_WUPMC11_MASK) - -#define WUU_PMC_WUPMC12_MASK (0x1000U) -#define WUU_PMC_WUPMC12_SHIFT (12U) -/*! WUPMC12 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC12(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC12_SHIFT)) & WUU_PMC_WUPMC12_MASK) - -#define WUU_PMC_Reserved13_MASK (0x2000U) -#define WUU_PMC_Reserved13_SHIFT (13U) -/*! Reserved13 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PMC_Reserved13(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_Reserved13_SHIFT)) & WUU_PMC_Reserved13_MASK) - -#define WUU_PMC_Reserved14_MASK (0x4000U) -#define WUU_PMC_Reserved14_SHIFT (14U) -/*! Reserved14 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PMC_Reserved14(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_Reserved14_SHIFT)) & WUU_PMC_Reserved14_MASK) - -#define WUU_PMC_Reserved15_MASK (0x8000U) -#define WUU_PMC_Reserved15_SHIFT (15U) -/*! Reserved15 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PMC_Reserved15(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_Reserved15_SHIFT)) & WUU_PMC_Reserved15_MASK) - -#define WUU_PMC_WUPMC16_MASK (0x10000U) -#define WUU_PMC_WUPMC16_SHIFT (16U) -/*! WUPMC16 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC16(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC16_SHIFT)) & WUU_PMC_WUPMC16_MASK) - -#define WUU_PMC_WUPMC17_MASK (0x20000U) -#define WUU_PMC_WUPMC17_SHIFT (17U) -/*! WUPMC17 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC17(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC17_SHIFT)) & WUU_PMC_WUPMC17_MASK) - -#define WUU_PMC_WUPMC18_MASK (0x40000U) -#define WUU_PMC_WUPMC18_SHIFT (18U) -/*! WUPMC18 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC18(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC18_SHIFT)) & WUU_PMC_WUPMC18_MASK) - -#define WUU_PMC_WUPMC19_MASK (0x80000U) -#define WUU_PMC_WUPMC19_SHIFT (19U) -/*! WUPMC19 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC19(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC19_SHIFT)) & WUU_PMC_WUPMC19_MASK) - -#define WUU_PMC_WUPMC20_MASK (0x100000U) -#define WUU_PMC_WUPMC20_SHIFT (20U) -/*! WUPMC20 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC20(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC20_SHIFT)) & WUU_PMC_WUPMC20_MASK) - -#define WUU_PMC_Reserved21_MASK (0x200000U) -#define WUU_PMC_Reserved21_SHIFT (21U) -/*! Reserved21 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PMC_Reserved21(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_Reserved21_SHIFT)) & WUU_PMC_Reserved21_MASK) - -#define WUU_PMC_WUPMC22_MASK (0x400000U) -#define WUU_PMC_WUPMC22_SHIFT (22U) -/*! WUPMC22 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC22(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC22_SHIFT)) & WUU_PMC_WUPMC22_MASK) - -#define WUU_PMC_WUPMC23_MASK (0x800000U) -#define WUU_PMC_WUPMC23_SHIFT (23U) -/*! WUPMC23 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC23(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC23_SHIFT)) & WUU_PMC_WUPMC23_MASK) - -#define WUU_PMC_WUPMC24_MASK (0x1000000U) -#define WUU_PMC_WUPMC24_SHIFT (24U) -/*! WUPMC24 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC24(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC24_SHIFT)) & WUU_PMC_WUPMC24_MASK) - -#define WUU_PMC_WUPMC25_MASK (0x2000000U) -#define WUU_PMC_WUPMC25_SHIFT (25U) -/*! WUPMC25 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC25(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC25_SHIFT)) & WUU_PMC_WUPMC25_MASK) - -#define WUU_PMC_WUPMC26_MASK (0x4000000U) -#define WUU_PMC_WUPMC26_SHIFT (26U) -/*! WUPMC26 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC26(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC26_SHIFT)) & WUU_PMC_WUPMC26_MASK) - -#define WUU_PMC_WUPMC27_MASK (0x8000000U) -#define WUU_PMC_WUPMC27_SHIFT (27U) -/*! WUPMC27 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC27(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC27_SHIFT)) & WUU_PMC_WUPMC27_MASK) - -#define WUU_PMC_WUPMC28_MASK (0x10000000U) -#define WUU_PMC_WUPMC28_SHIFT (28U) -/*! WUPMC28 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC28(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC28_SHIFT)) & WUU_PMC_WUPMC28_MASK) - -#define WUU_PMC_WUPMC29_MASK (0x20000000U) -#define WUU_PMC_WUPMC29_SHIFT (29U) -/*! WUPMC29 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC29(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC29_SHIFT)) & WUU_PMC_WUPMC29_MASK) - -#define WUU_PMC_WUPMC30_MASK (0x40000000U) -#define WUU_PMC_WUPMC30_SHIFT (30U) -/*! WUPMC30 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC30(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC30_SHIFT)) & WUU_PMC_WUPMC30_MASK) - -#define WUU_PMC_WUPMC31_MASK (0x80000000U) -#define WUU_PMC_WUPMC31_SHIFT (31U) -/*! WUPMC31 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC31(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC31_SHIFT)) & WUU_PMC_WUPMC31_MASK) -/*! @} */ - -/*! @name FMC - Pin Filter Mode Configuration */ -/*! @{ */ - -#define WUU_FMC_FILTM1_MASK (0x1U) -#define WUU_FMC_FILTM1_SHIFT (0U) -/*! FILTM1 - Filter Mode for FILTn - * 0b0..Active only during Power Down/Deep Power Down mode - * 0b1..Active during all power modes - */ -#define WUU_FMC_FILTM1(x) (((uint32_t)(((uint32_t)(x)) << WUU_FMC_FILTM1_SHIFT)) & WUU_FMC_FILTM1_MASK) - -#define WUU_FMC_FILTM2_MASK (0x2U) -#define WUU_FMC_FILTM2_SHIFT (1U) -/*! FILTM2 - Filter Mode for FILTn - * 0b0..Active only during Power Down/Deep Power Down mode - * 0b1..Active during all power modes - */ -#define WUU_FMC_FILTM2(x) (((uint32_t)(((uint32_t)(x)) << WUU_FMC_FILTM2_SHIFT)) & WUU_FMC_FILTM2_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group WUU_Register_Masks */ - - -/* WUU - Peripheral instance base addresses */ -/** Peripheral WUU0 base address */ -#define WUU0_BASE (0x40092000u) -/** Peripheral WUU0 base pointer */ -#define WUU0 ((WUU_Type *)WUU0_BASE) -/** Array initializer of WUU peripheral base addresses */ -#define WUU_BASE_ADDRS { WUU0_BASE } -/** Array initializer of WUU peripheral base pointers */ -#define WUU_BASE_PTRS { WUU0 } - -/*! - * @} - */ /* end of group WUU_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- WWDT Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup WWDT_Peripheral_Access_Layer WWDT Peripheral Access Layer - * @{ - */ - -/** WWDT - Register Layout Typedef */ -typedef struct { - __IO uint32_t MOD; /**< Mode, offset: 0x0 */ - __IO uint32_t TC; /**< Timer Constant, offset: 0x4 */ - __O uint32_t FEED; /**< Feed Sequence, offset: 0x8 */ - __I uint32_t TV; /**< Timer Value, offset: 0xC */ - uint8_t RESERVED_0[4]; - __IO uint32_t WARNINT; /**< Warning Interrupt Compare Value, offset: 0x14 */ - __IO uint32_t WINDOW; /**< Window Compare Value, offset: 0x18 */ -} WWDT_Type; - -/* ---------------------------------------------------------------------------- - -- WWDT Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup WWDT_Register_Masks WWDT Register Masks - * @{ - */ - -/*! @name MOD - Mode */ -/*! @{ */ - -#define WWDT_MOD_WDEN_MASK (0x1U) -#define WWDT_MOD_WDEN_SHIFT (0U) -/*! WDEN - Watchdog Enable - * 0b0..Timer stopped - * 0b1..Timer running - */ -#define WWDT_MOD_WDEN(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_WDEN_SHIFT)) & WWDT_MOD_WDEN_MASK) - -#define WWDT_MOD_WDRESET_MASK (0x2U) -#define WWDT_MOD_WDRESET_SHIFT (1U) -/*! WDRESET - Watchdog Reset Enable - * 0b0..Interrupt - * 0b1..Reset - */ -#define WWDT_MOD_WDRESET(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_WDRESET_SHIFT)) & WWDT_MOD_WDRESET_MASK) - -#define WWDT_MOD_WDTOF_MASK (0x4U) -#define WWDT_MOD_WDTOF_SHIFT (2U) -/*! WDTOF - Watchdog Timeout Flag - * 0b0..Watchdog event has not occurred. - * 0b1..Watchdog event has occurred (causes a chip reset if WDRESET = 1). - */ -#define WWDT_MOD_WDTOF(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_WDTOF_SHIFT)) & WWDT_MOD_WDTOF_MASK) - -#define WWDT_MOD_WDINT_MASK (0x8U) -#define WWDT_MOD_WDINT_SHIFT (3U) -/*! WDINT - Warning Interrupt Flag - * 0b0..No flag - * 0b1..Flag - */ -#define WWDT_MOD_WDINT(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_WDINT_SHIFT)) & WWDT_MOD_WDINT_MASK) - -#define WWDT_MOD_WDPROTECT_MASK (0x10U) -#define WWDT_MOD_WDPROTECT_SHIFT (4U) -/*! WDPROTECT - Watchdog Update Mode - * 0b0..Flexible - * 0b1..Threshold - */ -#define WWDT_MOD_WDPROTECT(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_WDPROTECT_SHIFT)) & WWDT_MOD_WDPROTECT_MASK) - -#define WWDT_MOD_LOCK_MASK (0x20U) -#define WWDT_MOD_LOCK_SHIFT (5U) -/*! LOCK - Lock - * 0b0..No Lock - * 0b1..Lock - */ -#define WWDT_MOD_LOCK(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_LOCK_SHIFT)) & WWDT_MOD_LOCK_MASK) - -#define WWDT_MOD_DEBUG_EN_MASK (0x40U) -#define WWDT_MOD_DEBUG_EN_SHIFT (6U) -/*! DEBUG_EN - Debug Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define WWDT_MOD_DEBUG_EN(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_DEBUG_EN_SHIFT)) & WWDT_MOD_DEBUG_EN_MASK) -/*! @} */ - -/*! @name TC - Timer Constant */ -/*! @{ */ - -#define WWDT_TC_COUNT_MASK (0xFFFFFFU) -#define WWDT_TC_COUNT_SHIFT (0U) -/*! COUNT - Watchdog Timeout Value */ -#define WWDT_TC_COUNT(x) (((uint32_t)(((uint32_t)(x)) << WWDT_TC_COUNT_SHIFT)) & WWDT_TC_COUNT_MASK) -/*! @} */ - -/*! @name FEED - Feed Sequence */ -/*! @{ */ - -#define WWDT_FEED_FEED_MASK (0xFFU) -#define WWDT_FEED_FEED_SHIFT (0U) -/*! FEED - Feed Value */ -#define WWDT_FEED_FEED(x) (((uint32_t)(((uint32_t)(x)) << WWDT_FEED_FEED_SHIFT)) & WWDT_FEED_FEED_MASK) -/*! @} */ - -/*! @name TV - Timer Value */ -/*! @{ */ - -#define WWDT_TV_COUNT_MASK (0xFFFFFFU) -#define WWDT_TV_COUNT_SHIFT (0U) -/*! COUNT - Counter Timer Value */ -#define WWDT_TV_COUNT(x) (((uint32_t)(((uint32_t)(x)) << WWDT_TV_COUNT_SHIFT)) & WWDT_TV_COUNT_MASK) -/*! @} */ - -/*! @name WARNINT - Warning Interrupt Compare Value */ -/*! @{ */ - -#define WWDT_WARNINT_WARNINT_MASK (0x3FFU) -#define WWDT_WARNINT_WARNINT_SHIFT (0U) -/*! WARNINT - Watchdog Warning Interrupt Compare Value */ -#define WWDT_WARNINT_WARNINT(x) (((uint32_t)(((uint32_t)(x)) << WWDT_WARNINT_WARNINT_SHIFT)) & WWDT_WARNINT_WARNINT_MASK) -/*! @} */ - -/*! @name WINDOW - Window Compare Value */ -/*! @{ */ - -#define WWDT_WINDOW_WINDOW_MASK (0xFFFFFFU) -#define WWDT_WINDOW_WINDOW_SHIFT (0U) -/*! WINDOW - Watchdog Window Value */ -#define WWDT_WINDOW_WINDOW(x) (((uint32_t)(((uint32_t)(x)) << WWDT_WINDOW_WINDOW_SHIFT)) & WWDT_WINDOW_WINDOW_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group WWDT_Register_Masks */ - - -/* WWDT - Peripheral instance base addresses */ -/** Peripheral WWDT0 base address */ -#define WWDT0_BASE (0x4000C000u) -/** Peripheral WWDT0 base pointer */ -#define WWDT0 ((WWDT_Type *)WWDT0_BASE) -/** Array initializer of WWDT peripheral base addresses */ -#define WWDT_BASE_ADDRS { WWDT0_BASE } -/** Array initializer of WWDT peripheral base pointers */ -#define WWDT_BASE_PTRS { WWDT0 } - -/*! - * @} - */ /* end of group WWDT_Peripheral_Access_Layer */ - - -/* -** End of section using anonymous unions -*/ - -#if defined(__ARMCC_VERSION) - #if (__ARMCC_VERSION >= 6010050) - #pragma clang diagnostic pop - #else - #pragma pop - #endif -#elif defined(__GNUC__) - /* leave anonymous unions enabled */ -#elif defined(__IAR_SYSTEMS_ICC__) - #pragma language=default -#else - #error Not supported compiler type -#endif - -/*! - * @} - */ /* end of group Peripheral_access_layer */ - - -/* ---------------------------------------------------------------------------- - -- Macros for use with bit field definitions (xxx_SHIFT, xxx_MASK). - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup Bit_Field_Generic_Macros Macros for use with bit field definitions (xxx_SHIFT, xxx_MASK). - * @{ - */ - -#if defined(__ARMCC_VERSION) - #if (__ARMCC_VERSION >= 6010050) - #pragma clang system_header - #endif -#elif defined(__IAR_SYSTEMS_ICC__) - #pragma system_include -#endif - -/** - * @brief Mask and left-shift a bit field value for use in a register bit range. - * @param field Name of the register bit field. - * @param value Value of the bit field. - * @return Masked and shifted value. - */ -#define NXP_VAL2FLD(field, value) (((value) << (field ## _SHIFT)) & (field ## _MASK)) -/** - * @brief Mask and right-shift a register value to extract a bit field value. - * @param field Name of the register bit field. - * @param value Value of the register. - * @return Masked and shifted bit field value. - */ -#define NXP_FLD2VAL(field, value) (((value) & (field ## _MASK)) >> (field ## _SHIFT)) - -/*! - * @} - */ /* end of group Bit_Field_Generic_Macros */ - - -/* ---------------------------------------------------------------------------- - -- SDK Compatibility - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SDK_Compatibility_Symbols SDK Compatibility - * @{ - */ - -/** High Speed SPI (Flexcomm 8) interrupt name */ -#define LSPI_HS_IRQn FLEXCOMM8_IRQn - - -/*! - * @} - */ /* end of group SDK_Compatibility_Symbols */ - - -#endif /* MCXA156_H_ */ - diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/MCXA156_features.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/MCXA156_features.h deleted file mode 100644 index b362ed44e65..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/MCXA156_features.h +++ /dev/null @@ -1,793 +0,0 @@ -/* -** ################################################################### -** Version: rev. 1.0, 2022-03-29 -** Build: b240411 -** -** Abstract: -** Chip specific module features. -** -** Copyright 2016 Freescale Semiconductor, Inc. -** Copyright 2016-2024 NXP -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** Revisions: -** - rev. 1.0 (2022-03-29) -** Initial version based on v0.1UM -** -** ################################################################### -*/ - -#ifndef _MCXA156_FEATURES_H_ -#define _MCXA156_FEATURES_H_ - -/* SOC module features */ - -/* @brief AOI availability on the SoC. */ -#define FSL_FEATURE_SOC_AOI_COUNT (2) -/* @brief CDOG availability on the SoC. */ -#define FSL_FEATURE_SOC_CDOG_COUNT (1) -/* @brief CMC availability on the SoC. */ -#define FSL_FEATURE_SOC_CMC_COUNT (1) -/* @brief CRC availability on the SoC. */ -#define FSL_FEATURE_SOC_CRC_COUNT (1) -/* @brief CTIMER availability on the SoC. */ -#define FSL_FEATURE_SOC_CTIMER_COUNT (5) -/* @brief EDMA availability on the SoC. */ -#define FSL_FEATURE_SOC_EDMA_COUNT (1) -/* @brief EIM availability on the SoC. */ -#define FSL_FEATURE_SOC_EIM_COUNT (1) -/* @brief EQDC availability on the SoC. */ -#define FSL_FEATURE_SOC_EQDC_COUNT (2) -/* @brief FLEXCAN availability on the SoC. */ -#define FSL_FEATURE_SOC_FLEXCAN_COUNT (1) -/* @brief FLEXIO availability on the SoC. */ -#define FSL_FEATURE_SOC_FLEXIO_COUNT (1) -/* @brief FMC availability on the SoC. */ -#define FSL_FEATURE_SOC_FMC_COUNT (1) -/* @brief FREQME availability on the SoC. */ -#define FSL_FEATURE_SOC_FREQME_COUNT (1) -/* @brief GPIO availability on the SoC. */ -#define FSL_FEATURE_SOC_GPIO_COUNT (5) -/* @brief SPC availability on the SoC. */ -#define FSL_FEATURE_SOC_SPC_COUNT (1) -/* @brief I3C availability on the SoC. */ -#define FSL_FEATURE_SOC_I3C_COUNT (1) -/* @brief INPUTMUX availability on the SoC. */ -#define FSL_FEATURE_SOC_INPUTMUX_COUNT (1) -/* @brief LPADC availability on the SoC. */ -#define FSL_FEATURE_SOC_LPADC_COUNT (2) -/* @brief LPCMP availability on the SoC. */ -#define FSL_FEATURE_SOC_LPCMP_COUNT (2) -/* @brief LPDAC availability on the SoC. */ -#define FSL_FEATURE_SOC_LPDAC_COUNT (1) -/* @brief LPI2C availability on the SoC. */ -#define FSL_FEATURE_SOC_LPI2C_COUNT (4) -/* @brief LPSPI availability on the SoC. */ -#define FSL_FEATURE_SOC_LPSPI_COUNT (2) -/* @brief LPTMR availability on the SoC. */ -#define FSL_FEATURE_SOC_LPTMR_COUNT (1) -/* @brief LPUART availability on the SoC. */ -#define FSL_FEATURE_SOC_LPUART_COUNT (5) -/* @brief OPAMP availability on the SoC. */ -#define FSL_FEATURE_SOC_OPAMP_COUNT (1) -/* @brief OSTIMER availability on the SoC. */ -#define FSL_FEATURE_SOC_OSTIMER_COUNT (1) -/* @brief PORT availability on the SoC. */ -#define FSL_FEATURE_SOC_PORT_COUNT (5) -/* @brief PWM availability on the SoC. */ -#define FSL_FEATURE_SOC_PWM_COUNT (2) -/* @brief SCG availability on the SoC. */ -#define FSL_FEATURE_SOC_SCG_COUNT (1) -/* @brief SYSCON availability on the SoC. */ -#define FSL_FEATURE_SOC_SYSCON_COUNT (1) -/* @brief USB availability on the SoC. */ -#define FSL_FEATURE_SOC_USB_COUNT (1) -/* @brief UTICK availability on the SoC. */ -#define FSL_FEATURE_SOC_UTICK_COUNT (1) -/* @brief WAKETIMER availability on the SoC. */ -#define FSL_FEATURE_SOC_WAKETIMER_COUNT (1) -/* @brief WWDT availability on the SoC. */ -#define FSL_FEATURE_SOC_WWDT_COUNT (1) -/* @brief WUU availability on the SoC. */ -#define FSL_FEATURE_SOC_WUU_COUNT (1) - -/* LPADC module features */ - -/* @brief FIFO availability on the SoC. */ -#define FSL_FEATURE_LPADC_FIFO_COUNT (1) -/* @brief Has subsequent trigger priority (bitfield CFG[TPRICTRL]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_SUBSEQUENT_PRIORITY (1) -/* @brief Has differential mode (bitfield CMDLn[DIFF]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_DIFF (0) -/* @brief Has channel scale (bitfield CMDLn[CSCALE]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_CSCALE (0) -/* @brief Has conversion type select (bitfield CMDLn[CTYPE]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_CTYPE (1) -/* @brief Has conversion resolution select (bitfield CMDLn[MODE]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_MODE (1) -/* @brief Has compare function enable (bitfield CMDHn[CMPEN]). */ -#define FSL_FEATURE_LPADC_HAS_CMDH_CMPEN (1) -/* @brief Has Wait for trigger assertion before execution (bitfield CMDHn[WAIT_TRIG]). */ -#define FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG (1) -/* @brief Has offset calibration (bitfield CTRL[CALOFS]). */ -#define FSL_FEATURE_LPADC_HAS_CTRL_CALOFS (1) -/* @brief Has gain calibration (bitfield CTRL[CAL_REQ]). */ -#define FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ (1) -/* @brief Has calibration average (bitfield CTRL[CAL_AVGS]). */ -#define FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS (1) -/* @brief Has internal clock (bitfield CFG[ADCKEN]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_ADCKEN (0) -/* @brief Enable support for low voltage reference on option 1 reference (bitfield CFG[VREF1RNG]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG (0) -/* @brief Has calibration (bitfield CFG[CALOFS]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_CALOFS (0) -/* @brief Has offset trim (register OFSTRIM). */ -#define FSL_FEATURE_LPADC_HAS_OFSTRIM (1) -/* @brief OFSTRIM availability on the SoC. */ -#define FSL_FEATURE_LPADC_OFSTRIM_COUNT (1) -/* @brief Has Trigger status register. */ -#define FSL_FEATURE_LPADC_HAS_TSTAT (1) -/* @brief Has power select (bitfield CFG[PWRSEL]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_PWRSEL (1) -/* @brief Has alternate channel B scale (bitfield CMDLn[ALTB_CSCALE]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE (0) -/* @brief Has alternate channel B select enable (bitfield CMDLn[ALTBEN]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN (0) -/* @brief Has alternate channel input (bitfield CMDLn[ALTB_ADCH]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_ALTB_ADCH (0) -/* @brief Has offset calibration mode (bitfield CTRL[CALOFSMODE]). */ -#define FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE (0) -/* @brief Conversion averaged bitfiled width. */ -#define FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH (4) -/* @brief Has B side channels. */ -#define FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS (0) -/* @brief Indicate whether the LPADC STAT register has trigger exception interrupt function (bitfield STAT[TEXC_INT]). */ -#define FSL_FEATURE_LPADC_HAS_STAT_TEXC_INT (1) -/* @brief Indicate whether the LPADC STAT register has trigger completion interrupt function (bitfield STAT[TCOMP_INT]). */ -#define FSL_FEATURE_LPADC_HAS_STAT_TCOMP_INT (1) -/* @brief Indicate whether the LPADC STAT register has calibration ready function (bitfield STAT[CAL_RDY]). */ -#define FSL_FEATURE_LPADC_HAS_STAT_CAL_RDY (1) -/* @brief Indicate whether the LPADC STAT register has ADC active function (bitfield STAT[ADC_ACTIVE]). */ -#define FSL_FEATURE_LPADC_HAS_STAT_ADC_ACTIVE (1) -/* @brief Indicate whether the LPADC IE register has trigger exception interrupt enable function (bitfield IE[TEXC_IE]). */ -#define FSL_FEATURE_LPADC_HAS_IE_TEXC_IE (1) -/* @brief Indicate whether the LPADC IE register has trigger completion interrupt enable function (bitfield IE[TCOMP_IE]). */ -#define FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE (1) -/* @brief Indicate whether the LPADC CFG register has trigger resume/restart enable function (bitfield CFG[TRES]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_TRES (1) -/* @brief Indicate whether the LPADC CFG register has trigger command resume/restart enable function (bitfield CFG[TCMDRES]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_TCMDRES (1) -/* @brief Indicate whether the LPADC CFG register has high priority trigger exception disable function (bitfield CFG[HPT_EXDI]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI (1) -/* @brief Indicate LPADC CFG register TPRICTRL bitfield width. */ -#define FSL_FEATURE_LPADC_CFG_TPRICTRL_BITFIELD_WIDTH (2) -/* @brief Has internal temperature sensor. */ -#define FSL_FEATURE_LPADC_HAS_INTERNAL_TEMP_SENSOR (1) -/* @brief Temperature sensor parameter A (slope). */ -#define FSL_FEATURE_LPADC_TEMP_PARAMETER_A (738.0f) -/* @brief Temperature sensor parameter B (offset). */ -#define FSL_FEATURE_LPADC_TEMP_PARAMETER_B (287.5f) -/* @brief Temperature sensor parameter Alpha. */ -#define FSL_FEATURE_LPADC_TEMP_PARAMETER_ALPHA (10.06f) -/* @brief The buffer size of temperature sensor. */ -#define FSL_FEATURE_LPADC_TEMP_SENS_BUFFER_SIZE (2U) - -/* AOI module features */ - -/* @brief Maximum value of input mux. */ -#define FSL_FEATURE_AOI_MODULE_INPUTS (4) -/* @brief Number of events related to number of registers AOIx_BFCRT01n/AOIx_BFCRT23n. */ -#define FSL_FEATURE_AOI_EVENT_COUNT (4) - -/* FLEXCAN module features */ - -/* @brief Has more than 64 MBs. */ -#define FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB (0) -/* @brief Message buffer size */ -#define FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(x) (32) -/* @brief Has doze mode support (register bit field MCR[DOZE]). */ -#define FSL_FEATURE_FLEXCAN_HAS_DOZE_MODE_SUPPORT (1) -/* @brief Insatnce has doze mode support (register bit field MCR[DOZE]). */ -#define FSL_FEATURE_FLEXCAN_INSTANCE_HAS_DOZE_MODE_SUPPORTn(x) (1) -/* @brief Has a glitch filter on the receive pin (register bit field MCR[WAKSRC]). */ -#define FSL_FEATURE_FLEXCAN_HAS_GLITCH_FILTER (1) -/* @brief Has extended interrupt mask and flag register (register IMASK2, IFLAG2). */ -#define FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER (0) -/* @brief Instance has extended bit timing register (register CBT). */ -#define FSL_FEATURE_FLEXCAN_INSTANCE_HAS_EXTENDED_TIMING_REGISTERn(x) (1) -/* @brief Has a receive FIFO DMA feature (register bit field MCR[DMA]). */ -#define FSL_FEATURE_FLEXCAN_HAS_RX_FIFO_DMA (1) -/* @brief Instance has a receive FIFO DMA feature (register bit field MCR[DMA]). */ -#define FSL_FEATURE_FLEXCAN_INSTANCE_HAS_RX_FIFO_DMAn(x) (1) -/* @brief Remove CAN Engine Clock Source Selection from unsupported part. */ -#define FSL_FEATURE_FLEXCAN_SUPPORT_ENGINE_CLK_SEL_REMOVE (1) -/* @brief Instance remove CAN Engine Clock Source Selection from unsupported part. */ -#define FSL_FEATURE_FLEXCAN_INSTANCE_SUPPORT_ENGINE_CLK_SEL_REMOVEn(x) (1) -/* @brief Is affected by errata with ID 5641 (Module does not transmit a message that is enabled to be transmitted at a specific moment during the arbitration process). */ -#define FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641 (0) -/* @brief Is affected by errata with ID 5829 (FlexCAN: FlexCAN does not transmit a message that is enabled to be transmitted in a specific moment during the arbitration process). */ -#define FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829 (0) -/* @brief Is affected by errata with ID 6032 (FlexCAN: A frame with wrong ID or payload is transmitted into the CAN bus when the Message Buffer under transmission is either aborted or deactivated while the CAN bus is in the Bus Idle state). */ -#define FSL_FEATURE_FLEXCAN_HAS_ERRATA_6032 (0) -/* @brief Is affected by errata with ID 9595 (FlexCAN: Corrupt frame possible if the Freeze Mode or the Low-Power Mode are entered during a Bus-Off state). */ -#define FSL_FEATURE_FLEXCAN_HAS_ERRATA_9595 (0) -/* @brief Has CAN with Flexible Data rate (CAN FD) protocol. */ -#define FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE (1) -/* @brief CAN instance support Flexible Data rate (CAN FD) protocol. */ -#define FSL_FEATURE_FLEXCAN_INSTANCE_HAS_FLEXIBLE_DATA_RATEn(x) (1) -/* @brief Has memory error control (register MECR). */ -#define FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL (0) -/* @brief Has enhanced bit timing register (register EPRS, ENCBT, EDCBT and ETDC). */ -#define FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG (1) -/* @brief Has Pretended Networking mode support. */ -#define FSL_FEATURE_FLEXCAN_HAS_PN_MODE (1) -/* @brief Has Enhanced Rx FIFO. */ -#define FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO (1) -/* @brief Enhanced Rx FIFO size (Indicates how many CAN FD messages can be stored). */ -#define FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO_SIZE (12) -/* @brief The number of enhanced Rx FIFO filter element registers. */ -#define FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO_FILTER_MAX_NUMBER (32) -/* @brief Does not support Supervisor Mode (bitfield MCR[SUPV]. */ -#define FSL_FEATURE_FLEXCAN_HAS_NO_SUPV_SUPPORT (1) - -/* CDOG module features */ - -/* @brief CDOG Has No Reset */ -#define FSL_FEATURE_CDOG_HAS_NO_RESET (1) - -/* CMC module features */ - -/* @brief Has SRAM_DIS register */ -#define FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG (0) -/* @brief Has BSR register */ -#define FSL_FEATURE_MCX_CMC_HAS_BSR_REG (0) -/* @brief Has RSTCNT register */ -#define FSL_FEATURE_MCX_CMC_HAS_RSTCNT_REG (1) -/* @brief Has BLR register */ -#define FSL_FEATURE_MCX_CMC_HAS_BLR_REG (0) - -/* LPCMP module features */ - -/* @brief Has CCR1 FUNC_CLK_SEL bitfield. */ -#define FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL (1) -/* @brief Has IER RRF_IE bitfield. */ -#define FSL_FEATURE_LPCMP_HAS_IER_RRF_IE (1) -/* @brief Has CSR RRF bitfield. */ -#define FSL_FEATURE_LPCMP_HAS_CSR_RRF (1) -/* @brief Has Round Robin mode (related to existence of registers RRCR0). */ -#define FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE (1) -/* @brief Has window mode (related to existence of CCR1.WINDOW_CLS). */ -#define FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL (1) - -/* CTIMER module features */ - -/* @brief CTIMER has no capture channel. */ -#define FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE (0) -/* @brief CTIMER has no capture 2 interrupt. */ -#define FSL_FEATURE_CTIMER_HAS_NO_IR_CR2INT (0) -/* @brief CTIMER capture 3 interrupt. */ -#define FSL_FEATURE_CTIMER_HAS_IR_CR3INT (1) -/* @brief Has CTIMER CCR_CAP2 (register bits CCR[CAP2RE][CAP2FE][CAP2I]. */ -#define FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2 (0) -/* @brief Has CTIMER CCR_CAP3 (register bits CCR[CAP3RE][CAP3FE][CAP3I]). */ -#define FSL_FEATURE_CTIMER_HAS_CCR_CAP3 (1) -/* @brief CTIMER Has register MSR */ -#define FSL_FEATURE_CTIMER_HAS_MSR (1) - -/* LPDAC module features */ - -/* @brief FIFO size. */ -#define FSL_FEATURE_LPDAC_FIFO_SIZE (16) -/* @brief Has OPAMP as buffer, speed control signal (bitfield GCR[BUF_SPD_CTRL]). */ -#define FSL_FEATURE_LPDAC_HAS_GCR_BUF_SPD_CTRL (1) -/* @brief Buffer Enable(bitfield GCR[BUF_EN]). */ -#define FSL_FEATURE_LPDAC_HAS_GCR_BUF_EN (1) -/* @brief RCLK cycles before data latch(bitfield GCR[LATCH_CYC]). */ -#define FSL_FEATURE_LPDAC_HAS_GCR_LATCH_CYC (1) -/* @brief VREF source number. */ -#define FSL_FEATURE_ANALOG_NUM_OF_VREF_SRC (3) -/* @brief Has internal reference current options. */ -#define FSL_FEATURE_LPDAC_HAS_INTERNAL_REFERENCE_CURRENT (1) - -/* EDMA module features */ - -/* @brief Number of DMA channels (related to number of registers TCD, DCHPRI, bit fields ERQ[ERQn], EEI[EEIn], INT[INTn], ERR[ERRn], HRS[HRSn] and bit field widths ES[ERRCHN], CEEI[CEEI], SEEI[SEEI], CERQ[CERQ], SERQ[SERQ], CDNE[CDNE], SSRT[SSRT], CERR[CERR], CINT[CINT], TCDn_CITER_ELINKYES[LINKCH], TCDn_CSR[MAJORLINKCH], TCDn_BITER_ELINKYES[LINKCH]). (Valid only for eDMA modules.) */ -#define FSL_FEATURE_EDMA_MODULE_CHANNEL (8) -/* @brief If 8 bytes transfer supported. */ -#define FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER (1) -/* @brief Number of DMA channel groups (register bit fields CR[ERGA], CR[GRPnPRI], ES[GPE], DCHPRIn[GRPPRI]). (Valid only for eDMA modules.) */ -#define FSL_FEATURE_EDMA_CHANNEL_GROUP_COUNT (1) -/* @brief If 16 bytes transfer supported. */ -#define FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER (1) -/* @brief Has DMA_Error interrupt vector. */ -#define FSL_FEATURE_EDMA_HAS_ERROR_IRQ (1) -/* @brief If 64 bytes transfer supported. */ -#define FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER (1) -/* @brief If channel clock controlled independently */ -#define FSL_FEATURE_EDMA_CHANNEL_HAS_OWN_CLOCK_GATE (1) -/* @brief If 128 bytes transfer supported. */ -#define FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER (1) -/* @brief Number of channel for each EDMA instance, (only defined for soc with different channel numbers for difference instance) */ -#define FSL_FEATURE_EDMA_INSTANCE_CHANNELn(x) (8) -/* @brief If 128 bytes transfer supported. */ -#define FSL_FEATURE_EDMA_INSTANCE_SUPPORT_128_BYTES_TRANSFERn(x) (1) -/* @brief Has no register bit fields MP_CSR[EBW]. */ -#define FSL_FEATURE_EDMA_HAS_NO_MP_CSR_EBW (1) -/* @brief Has register CH_CSR. */ -#define FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG (1) -/* @brief If dma has common clock gate */ -#define FSL_FEATURE_EDMA_HAS_COMMON_CLOCK_GATE (0) -/* @brief Has channel mux */ -#define FSL_FEATURE_EDMA_HAS_CHANNEL_MUX (1) -/* @brief If dma channel IRQ support parameter */ -#define FSL_FEATURE_EDMA_MODULE_CHANNEL_IRQ_ENTRY_SUPPORT_PARAMETER (0) -/* @brief Instance has channel mux */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_MUXn(x) (1) -/* @brief NBYTES must be multiple of 8 when using scatter gather. */ -#define FSL_FEATURE_EDMA_HAS_ERRATA_51327 (0) -/* @brief Has register CH_SBR. */ -#define FSL_FEATURE_EDMA_HAS_SBR (1) -/* @brief NBYTES must be multiple of 8 when using scatter gather. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_ERRATA_51327n(x) (0) -/* @brief Has no register bit fields CH_SBR[ATTR]. */ -#define FSL_FEATURE_EDMA_HAS_NO_CH_SBR_ATTR (1) -/* @brief Has register bit fields MP_CSR[GMRC]. */ -#define FSL_FEATURE_EDMA_HAS_GLOBAL_MASTER_ID_REPLICATION (1) -/* @brief Has register bit field CH_CSR[SWAP]. */ -#define FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE (0) -/* @brief Instance has register bit field CH_CSR[SWAP]. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_SWAP_SIZEn(x) (0) -/* @brief Has register bit field CH_SBR[INSTR]. */ -#define FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE (0) -/* @brief Instance has register bit field CH_SBR[INSTR]. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_ACCESS_TYPEn(x) (0) -/* @brief Has register bit fields CH_MATTR[WCACHE], CH_MATTR[RCACHE]. */ -#define FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE (0) -/* @brief Instance has register CH_MATTR. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_MEMORY_ATTRIBUTEn(x) (0) -/* @brief Has register bit field CH_CSR[SIGNEXT]. */ -#define FSL_FEATURE_EDMA_HAS_CHANNEL_SIGN_EXTENSION (0) -/* @brief Instance Has register bit field CH_CSR[SIGNEXT]. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_SIGN_EXTENSIONn(x) (0) -/* @brief Has register bit field TCD_CSR[BWC]. */ -#define FSL_FEATURE_EDMA_HAS_BANDWIDTH (1) -/* @brief Instance has register bit field TCD_CSR[BWC]. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_BANDWIDTHn(x) (1) -/* @brief Has register bit fields TCD_CSR[TMC]. */ -#define FSL_FEATURE_EDMA_HAS_TRANSFER_MODE (0) -/* @brief Instance has register bit fields TCD_CSR[TMC]. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_TRANSFER_MODEn(x) (0) -/* @brief Has no register bit fields CH_SBR[SEC]. */ -#define FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC (1) - -/* FLEXIO module features */ - -/* @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) */ -#define FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_HALF_WORD_SWAP (1) -/* @brief Has Shifter Buffer N Nibble Swapped Register (FLEXIO_SHIFTBUFNISn) */ -#define FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_SWAP (1) -/* @brief Supports Shifter State Mode (FLEXIO_SHIFTCTLn[SMOD]) */ -#define FSL_FEATURE_FLEXIO_HAS_STATE_MODE (1) -/* @brief Supports Shifter Logic Mode (FLEXIO_SHIFTCTLn[SMOD]) */ -#define FSL_FEATURE_FLEXIO_HAS_LOGIC_MODE (1) -/* @brief Supports paralle width (FLEXIO_SHIFTCFGn[PWIDTH]) */ -#define FSL_FEATURE_FLEXIO_HAS_PARALLEL_WIDTH (1) -/* @brief Reset value of the FLEXIO_VERID register */ -#define FSL_FEATURE_FLEXIO_VERID_RESET_VALUE (0x2010003) -/* @brief Reset value of the FLEXIO_PARAM register */ -#define FSL_FEATURE_FLEXIO_PARAM_RESET_VALUE (0x4200404) -/* @brief Represent the bit width of the TIMDCE field (FLEXIO_TIMCFGLn[TIMDEC]) */ -#define FSL_FEATURE_FLEXIO_TIMCFG_TIMDCE_FIELD_WIDTH (3) - -/* PWM module features */ - -/* @brief If (e)FlexPWM has module A channels (outputs). */ -#define FSL_FEATURE_PWM_HAS_CHANNELA (1) -/* @brief If (e)FlexPWM has module B channels (outputs). */ -#define FSL_FEATURE_PWM_HAS_CHANNELB (1) -/* @brief If (e)FlexPWM has module X channels (outputs). */ -#define FSL_FEATURE_PWM_HAS_CHANNELX (1) -/* @brief If (e)FlexPWM has fractional feature. */ -#define FSL_FEATURE_PWM_HAS_FRACTIONAL (0) -/* @brief If (e)FlexPWM has mux trigger source select bit field. */ -#define FSL_FEATURE_PWM_HAS_MUX_TRIGGER_SOURCE_SEL (1) -/* @brief Number of submodules in each (e)FlexPWM module. */ -#define FSL_FEATURE_PWM_SUBMODULE_COUNT (3) -/* @brief Number of fault channel in each (e)FlexPWM module. */ -#define FSL_FEATURE_PWM_FAULT_CH_COUNT (1) -/* @brief (e)FlexPWM has no WAITEN Bitfield In CTRL2 Register. */ -#define FSL_FEATURE_PWM_HAS_NO_WAITEN (1) -/* @brief If (e)FlexPWM has phase delay feature. */ -#define FSL_FEATURE_PWM_HAS_PHASE_DELAY (1) -/* @brief If (e)FlexPWM has input filter capture feature. */ -#define FSL_FEATURE_PWM_HAS_INPUT_FILTER_CAPTURE (1) -/* @brief If (e)FlexPWM has module capture functionality on A channels (inputs). */ -#define FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA (0) -/* @brief If (e)FlexPWM has module capture functionality on B channels (inputs). */ -#define FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB (0) -/* @brief If (e)FlexPWM has module capture functionality on X channels (inputs). */ -#define FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX (1) - -/* FMU module features */ - -/* @brief Is the flash module msf1? */ -#define FSL_FEATURE_FSL_FEATURE_FLASH_IS_MSF1 (1) -/* @brief P-Flash block count. */ -#define FSL_FEATURE_FLASH_PFLASH_BLOCK_COUNT (1) -/* @brief P-Flash block0 start address. */ -#define FSL_FEATURE_FLASH_PFLASH_START_ADDRESS (0x00000000U) -/* @brief P-Flash block0 size. */ -#define FSL_FEATURE_FLASH_PFLASH_BLOCK_SIZE (0x100000U) -/* @brief P-Flash sector size. */ -#define FSL_FEATURE_FLASH_PFLASH_SECTOR_SIZE (0x2000U) -/* @brief P-Flash page size. */ -#define FSL_FEATURE_FLASH_PFLASH_PAGE_SIZE (128) -/* @brief P-Flash phrase size. */ -#define FSL_FEATURE_FLASH_PFLASH_PHRASE_SIZE (16) -/* @brief Has IFR memory. */ -#define FSL_FEATURE_FLASH_HAS_IFR (1) -/* @brief flash BLOCK0 IFR0 start address. */ -#define FSL_FEATURE_FLASH_IFR0_START_ADDRESS (0x01000000u) -/* @brief flash BLOCK0 IFR1 start address. */ -#define FSL_FEATURE_FLASH_IFR1_START_ADDRESS (0x02100000U) -/* @brief flash block IFR0 size. */ -#define FSL_FEATURE_FLASH_IFR0_SIZE (0x8000U) -/* @brief flash block IFR1 size. */ -#define FSL_FEATURE_FLASH_IFR1_SIZE (0x2000U) -/* @brief IFR sector size. */ -#define FSL_FEATURE_FLASH_IFR_SECTOR_SIZE (0x2000U) -/* @brief IFR page size. */ -#define FSL_FEATURE_FLASH_IFR_PAGE_SIZE (128) - -/* GLIKEY module features */ - -/* @brief GLIKEY has 8 step FSM configuration */ -#define FSL_FEATURE_GLIKEY_HAS_EIGHT_STEPS (1) - -/* GPIO module features */ - -/* @brief Has GPIO attribute checker register (GACR). */ -#define FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER (0) -/* @brief Has GPIO version ID register (VERID). */ -#define FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER (1) -/* @brief Has secure/non-secure access protection registers (LOCK, PCNS, PCNP, ICNS, ICNP). */ -#define FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL (0) -/* @brief Has GPIO port input disable register (PIDR). */ -#define FSL_FEATURE_GPIO_HAS_PORT_INPUT_CONTROL (1) -/* @brief Has GPIO interrupt/DMA request/trigger output selection. */ -#define FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT (0) - -/* I3C module features */ - -/* @brief Has TERM bitfile in MERRWARN register. */ -#define FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM (0) -/* @brief SOC has no reset driver. */ -#define FSL_FEATURE_I3C_HAS_NO_RESET (0) -/* @brief Use fixed BAMATCH count, do not provide editable BAMATCH. */ -#define FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH (0) -/* @brief Register SCONFIG do not have IDRAND bitfield. */ -#define FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND (1) -/* @brief Register SCONFIG has HDROK bitfield. */ -#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 SCL delay after START. */ -#define FSL_FEATURE_I3C_HAS_START_SCL_DELAY (1) - -/* LPI2C module features */ - -/* @brief Has separate DMA RX and TX requests. */ -#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) (4) - -/* LPSPI module features */ - -/* @brief Capacity (number of entries) of the transmit/receive FIFO (or zero if no FIFO is available). */ -#define FSL_FEATURE_LPSPI_FIFO_SIZEn(x) (4) -/* @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 */ -#define FSL_FEATURE_LPSPI_HAS_NO_PCSCFG (0) -/* @brief Has no WIDTH bits in TCR register */ -#define FSL_FEATURE_LPSPI_HAS_NO_MULTI_WIDTH (0) - -/* LPTMR module features */ - -/* @brief Has shared interrupt handler with another LPTMR module. */ -#define FSL_FEATURE_LPTMR_HAS_SHARED_IRQ_HANDLER (0) -/* @brief Whether LPTMR counter is 32 bits width. */ -#define FSL_FEATURE_LPTMR_CNR_WIDTH_IS_32B (1) -/* @brief Has timer DMA request enable (register bit CSR[TDRE]). */ -#define FSL_FEATURE_LPTMR_HAS_CSR_TDRE (1) -/* @brief Do not has prescaler clock source 0. */ -#define FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_0_SUPPORT (1) -/* @brief Do not has prescaler clock source 1. */ -#define FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT (0) -/* @brief Do not has prescaler clock source 2. */ -#define FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_2_SUPPORT (1) -/* @brief Do not has prescaler clock source 3. */ -#define FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_3_SUPPORT (0) - -/* LPUART module features */ - -/* @brief Has receive FIFO overflow detection (bit field CFIFO[RXOFE]). */ -#define FSL_FEATURE_LPUART_HAS_IRQ_EXTENDED_FUNCTIONS (0) -/* @brief Has low power features (can be enabled in wait mode via register bit C1[DOZEEN] or CTRL[DOZEEN] if the registers are 32-bit wide). */ -#define FSL_FEATURE_LPUART_HAS_LOW_POWER_UART_SUPPORT (1) -/* @brief Has extended data register ED (or extra flags in the DATA register if the registers are 32-bit wide). */ -#define FSL_FEATURE_LPUART_HAS_EXTENDED_DATA_REGISTER_FLAGS (1) -/* @brief Capacity (number of entries) of the transmit/receive FIFO (or zero if no FIFO is available). */ -#define FSL_FEATURE_LPUART_HAS_FIFO (1) -/* @brief Has 32-bit register MODIR */ -#define FSL_FEATURE_LPUART_HAS_MODIR (1) -/* @brief Hardware flow control (RTS, CTS) is supported. */ -#define FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT (1) -/* @brief Infrared (modulation) is supported. */ -#define FSL_FEATURE_LPUART_HAS_IR_SUPPORT (1) -/* @brief 2 bits long stop bit is available. */ -#define FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT (1) -/* @brief If 10-bit mode is supported. */ -#define FSL_FEATURE_LPUART_HAS_10BIT_DATA_SUPPORT (1) -/* @brief If 7-bit mode is supported. */ -#define FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT (1) -/* @brief Baud rate fine adjustment is available. */ -#define FSL_FEATURE_LPUART_HAS_BAUD_RATE_FINE_ADJUST_SUPPORT (0) -/* @brief Baud rate oversampling is available (has bit fields C4[OSR], C5[BOTHEDGE], C5[RESYNCDIS] or BAUD[OSR], BAUD[BOTHEDGE], BAUD[RESYNCDIS] if the registers are 32-bit wide). */ -#define FSL_FEATURE_LPUART_HAS_BAUD_RATE_OVER_SAMPLING_SUPPORT (1) -/* @brief Baud rate oversampling is available. */ -#define FSL_FEATURE_LPUART_HAS_RX_RESYNC_SUPPORT (1) -/* @brief Baud rate oversampling is available. */ -#define FSL_FEATURE_LPUART_HAS_BOTH_EDGE_SAMPLING_SUPPORT (1) -/* @brief Peripheral type. */ -#define FSL_FEATURE_LPUART_IS_SCI (1) -/* @brief Capacity (number of entries) of the transmit/receive FIFO (or zero if no FIFO is available). */ -#define FSL_FEATURE_LPUART_FIFO_SIZEn(x) (4) -/* @brief Supports two match addresses to filter incoming frames. */ -#define FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING (1) -/* @brief Has transmitter/receiver DMA enable bits C5[TDMAE]/C5[RDMAE] (or BAUD[TDMAE]/BAUD[RDMAE] if the registers are 32-bit wide). */ -#define FSL_FEATURE_LPUART_HAS_DMA_ENABLE (1) -/* @brief Has transmitter/receiver DMA select bits C4[TDMAS]/C4[RDMAS], resp. C5[TDMAS]/C5[RDMAS] if IS_SCI = 0. */ -#define FSL_FEATURE_LPUART_HAS_DMA_SELECT (0) -/* @brief Data character bit order selection is supported (bit field S2[MSBF] or STAT[MSBF] if the registers are 32-bit wide). */ -#define FSL_FEATURE_LPUART_HAS_BIT_ORDER_SELECT (1) -/* @brief Has smart card (ISO7816 protocol) support and no improved smart card support. */ -#define FSL_FEATURE_LPUART_HAS_SMART_CARD_SUPPORT (0) -/* @brief Has improved smart card (ISO7816 protocol) support. */ -#define FSL_FEATURE_LPUART_HAS_IMPROVED_SMART_CARD_SUPPORT (0) -/* @brief Has local operation network (CEA709.1-B protocol) support. */ -#define FSL_FEATURE_LPUART_HAS_LOCAL_OPERATION_NETWORK_SUPPORT (0) -/* @brief Has 32-bit registers (BAUD, STAT, CTRL, DATA, MATCH, MODIR) instead of 8-bit (BDH, BDL, C1, S1, D, etc.). */ -#define FSL_FEATURE_LPUART_HAS_32BIT_REGISTERS (1) -/* @brief Lin break detect available (has bit BAUD[LBKDIE]). */ -#define FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT (1) -/* @brief UART stops in Wait mode available (has bit C1[UARTSWAI]). */ -#define FSL_FEATURE_LPUART_HAS_WAIT_MODE_OPERATION (0) -/* @brief Has separate DMA RX and TX requests. */ -#define FSL_FEATURE_LPUART_HAS_SEPARATE_DMA_RX_TX_REQn(x) (1) -/* @brief Has separate RX and TX interrupts. */ -#define FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ (0) -/* @brief Has LPAURT_PARAM. */ -#define FSL_FEATURE_LPUART_HAS_PARAM (1) -/* @brief Has LPUART_VERID. */ -#define FSL_FEATURE_LPUART_HAS_VERID (1) -/* @brief Has LPUART_GLOBAL. */ -#define FSL_FEATURE_LPUART_HAS_GLOBAL (1) -/* @brief Has LPUART_PINCFG. */ -#define FSL_FEATURE_LPUART_HAS_PINCFG (1) -/* @brief Has register MODEM Control. */ -#define FSL_FEATURE_LPUART_HAS_MCR (0) -/* @brief Has register Half Duplex Control. */ -#define FSL_FEATURE_LPUART_HAS_HDCR (0) -/* @brief Has register Timeout. */ -#define FSL_FEATURE_LPUART_HAS_TIMEOUT (0) - -/* TRDC module features */ - -/* @brief Process master count. */ -#define FSL_FEATURE_TRDC_PROCESSOR_MASTER_COUNT (2) -/* @brief TRDC instance has PID configuration or not. */ -#define FSL_FEATURE_TRDC_INSTANCE_HAS_PID_CONFIGURATIONn(x) (0) -/* @brief TRDC instance has MBC. */ -#define FSL_FEATURE_TRDC_HAS_MBC (1) -/* @brief TRDC instance has MRC. */ -#define FSL_FEATURE_TRDC_HAS_MRC (0) -/* @brief TRDC instance has TRDC_CR. */ -#define FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG (0) -/* @brief TRDC instance has MDA_Wx_y_DFMT. */ -#define FSL_FEATURE_TRDC_HAS_DOMAIN_ASSIGNMENT (0) -/* @brief TRDC instance has TRDC_FDID. */ -#define FSL_FEATURE_TRDC_HAS_DOMAIN_ERROR (0) -/* @brief TRDC instance has TRDC_FLW_CTL. */ -#define FSL_FEATURE_TRDC_HAS_FLW (0) - -/* OPAMP module features */ - -/* @brief Opamp has OPAMP_CTR OUTSW bit */ -#define FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_OUTSW (1) -/* @brief Opamp has OPAMP_CTR ADCSW1 bit */ -#define FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW1 (1) -/* @brief Opamp has OPAMP_CTR ADCSW2 bit */ -#define FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW2 (1) -/* @brief Opamp has OPAMP_CTR BUFEN bit */ -#define FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_BUFEN (1) -/* @brief Opamp has OPAMP_CTR INPSEL bit */ -#define FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_INPSEL (1) -/* @brief Opamp has OPAMP_CTR TRIGMD bit */ -#define FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_TRIGMD (1) -/* @brief OPAMP support reference buffer */ -#define FSL_FEATURE_OPAMP_HAS_SUPPORT_REFERENCE_BUFFER (1U) - -/* PORT module features */ - -/* @brief Has control lock (register bit PCR[LK]). */ -#define FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK (1) -/* @brief Has open drain control (register bit PCR[ODE]). */ -#define FSL_FEATURE_PORT_HAS_OPEN_DRAIN (1) -/* @brief Has digital filter (registers DFER, DFCR and DFWR). */ -#define FSL_FEATURE_PORT_HAS_DIGITAL_FILTER (0) -/* @brief Has DMA request (register bit field PCR[IRQC] or ICR[IRQC] values). */ -#define FSL_FEATURE_PORT_HAS_DMA_REQUEST (0) -/* @brief Has pull resistor selection available. */ -#define FSL_FEATURE_PORT_HAS_PULL_SELECTION (1) -/* @brief Has pull resistor enable (register bit PCR[PE]). */ -#define FSL_FEATURE_PORT_HAS_PULL_ENABLE (1) -/* @brief Has slew rate control (register bit PCR[SRE]). */ -#define FSL_FEATURE_PORT_HAS_SLEW_RATE (1) -/* @brief Has passive filter (register bit field PCR[PFE]). */ -#define FSL_FEATURE_PORT_HAS_PASSIVE_FILTER (1) -/* @brief Do not has interrupt control (register ISFR). */ -#define FSL_FEATURE_PORT_HAS_NO_INTERRUPT (1) -/* @brief Has pull value (register bit field PCR[PV]). */ -#define FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE (1) -/* @brief Has drive strength1 control (register bit PCR[DSE1]). */ -#define FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1 (1) -/* @brief Has version ID register (register VERID). */ -#define FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER (1) -/* @brief Has voltage range control (register bit CONFIG[RANGE]). */ -#define FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE (1) -/* @brief Has EFT detect (registers EDFR, EDIER and EDCR). */ -#define FSL_FEATURE_PORT_SUPPORT_EFT (0) -/* @brief Function 0 is GPIO. */ -#define FSL_FEATURE_PORT_PCR_MUX_GPIO (0) -/* @brief Has drive strength control (register bit PCR[DSE]). */ -#define FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH (1) -/* @brief Defines width of PCR[MUX] field. */ -#define FSL_FEATURE_PORT_PCR_MUX_WIDTH (4) -/* @brief Has dedicated interrupt vector. */ -#define FSL_FEATURE_PORT_HAS_INTERRUPT_VECTOR (1) -/* @brief Has independent interrupt control(register ICR). */ -#define FSL_FEATURE_PORT_HAS_INDEPENDENT_INTERRUPT_CONTROL (0) -/* @brief Has multiple pin IRQ configuration (register GICLR and GICHR). */ -#define FSL_FEATURE_PORT_HAS_MULTIPLE_IRQ_CONFIG (0) -/* @brief Has Input Buffer Enable (register bit field PCR[IBE]). */ -#define FSL_FEATURE_PORT_HAS_INPUT_BUFFER (1) -/* @brief Has Invert Input (register bit field PCR[INV]). */ -#define FSL_FEATURE_PORT_HAS_INVERT_INPUT (1) -/* @brief Defines whether PCR[IRQC] bit-field has flag states. */ -#define FSL_FEATURE_PORT_HAS_IRQC_FLAG (0) -/* @brief Defines whether PCR[IRQC] bit-field has trigger states. */ -#define FSL_FEATURE_PORT_HAS_IRQC_TRIGGER (0) - -/* EQDC module features */ - -/* @brief If EQDC CTRL2 register has EMIP bit field. */ -#define FSL_FEATURE_EQDC_CTRL2_HAS_EMIP_BIT_FIELD (1) - -/* SPC module features */ - -/* @brief Has DCDC */ -#define FSL_FEATURE_MCX_SPC_HAS_DCDC (0) -/* @brief Has SYS LDO */ -#define FSL_FEATURE_MCX_SPC_HAS_SYS_LDO (0) -/* @brief Has IOVDD_LVDF */ -#define FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD (0) -/* @brief Has COREVDD_HVDF */ -#define FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD (0) -/* @brief Has CORELDO_VDD_DS */ -#define FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS (1) -/* @brief Has LPBUFF_EN */ -#define FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT (0) -/* @brief Has COREVDD_IVS_EN */ -#define FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT (0) -/* @brief Has SWITCH_STATE */ -#define FSL_FEATURE_MCX_SPC_HAS_SWITCH_STATE_BIT (0) -/* @brief Has SRAMRETLDO */ -#define FSL_FEATURE_MCX_SPC_HAS_SRAMRETLDO_REG (1) -/* @brief Has CFG register */ -#define FSL_FEATURE_MCX_SPC_HAS_CFG_REG (0) -/* @brief Has SRAMLDO_DPD_ON */ -#define FSL_FEATURE_MCX_SPC_HAS_SRAMLDO_DPD_ON_BIT (1) -/* @brief Has CNTRL register */ -#define FSL_FEATURE_MCX_SPC_HAS_CNTRL_REG (0) -/* @brief Has DPDOWN_PULLDOWN_DISABLE */ -#define FSL_FEATURE_MCX_SPC_HAS_DPDOWN_PULLDOWN_DISABLE_BIT (0) -/* @brief Not have glitch detect */ -#define FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT (1) -/* @brief Has BLEED_EN */ -#define FSL_FEATURE_MCX_SPC_HAS_DCDC_CFG_BLEED_EN (0) - -/* SYSCON module features */ - -/* @brief Flash page size in bytes */ -#define FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES (128) -/* @brief Flash sector size in bytes */ -#define FSL_FEATURE_SYSCON_FLASH_SECTOR_SIZE_BYTES (8192) -/* @brief Flash size in bytes */ -#define FSL_FEATURE_SYSCON_FLASH_SIZE_BYTES (1048576) -/* @brief Support ROMAPI */ -#define FSL_FEATURE_SYSCON_ROMAPI (1) -/* @brief Powerlib API is different with other series devices */ -#define FSL_FEATURE_POWERLIB_EXTEND (1) -/* @brief No OSTIMER register in PMC */ -#define FSL_FEATURE_PMC_HAS_NO_OSTIMER_REG (1) -/* @brief Starter register discontinuous. */ -#define FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS (1) - -/* USB module features */ - -/* @brief KHCI module instance count */ -#define FSL_FEATURE_USB_KHCI_COUNT (1) -/* @brief HOST mode enabled */ -#define FSL_FEATURE_USB_KHCI_HOST_ENABLED (0) -/* @brief OTG mode enabled */ -#define FSL_FEATURE_USB_KHCI_OTG_ENABLED (0) -/* @brief Size of the USB dedicated RAM */ -#define FSL_FEATURE_USB_KHCI_USB_RAM (0) -/* @brief Has KEEP_ALIVE_CTRL register */ -#define FSL_FEATURE_USB_KHCI_KEEP_ALIVE_ENABLED (0) -/* @brief Has the Dynamic SOF threshold compare support */ -#define FSL_FEATURE_USB_KHCI_DYNAMIC_SOF_THRESHOLD_COMPARE_ENABLED (0) -/* @brief Has the VBUS detect support */ -#define FSL_FEATURE_USB_KHCI_VBUS_DETECT_ENABLED (1) -/* @brief Has the IRC48M module clock support */ -#define FSL_FEATURE_USB_KHCI_IRC48M_MODULE_CLOCK_ENABLED (1) -/* @brief Number of endpoints supported */ -#define FSL_FEATURE_USB_ENDPT_COUNT (16) -/* @brief Has STALL_IL/OL_DIS registers */ -#define FSL_FEATURE_USB_KHCI_HAS_STALL_LOW (1) -/* @brief Has STALL_IH/OH_DIS registers */ -#define FSL_FEATURE_USB_KHCI_HAS_STALL_HIGH (1) - -/* UTICK module features */ - -/* @brief UTICK does not support PD configure. */ -#define FSL_FEATURE_UTICK_HAS_NO_PDCFG (1) - -/* VBAT module features */ - -/* @brief Has STATUS register */ -#define FSL_FEATURE_MCX_VBAT_HAS_STATUS_REG (0) -/* @brief Has TAMPER register */ -#define FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG (0) -/* @brief Has BANDGAP register */ -#define FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER (0) -/* @brief Has LDOCTL register */ -#define FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG (0) -/* @brief Has OSCCTL register */ -#define FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG (0) -/* @brief Has SWICTL register */ -#define FSL_FEATURE_MCX_VBAT_HAS_SWICTL_REG (0) -/* @brief Has CLKMON register */ -#define FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG (0) - -/* WWDT module features */ - -/* @brief Has no RESET register. */ -#define FSL_FEATURE_WWDT_HAS_NO_RESET (1) - -#endif /* _MCXA156_FEATURES_H_ */ - diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/arm/MCXA156_flash.scf b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/arm/MCXA156_flash.scf deleted file mode 100644 index 265cd9533cc..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/arm/MCXA156_flash.scf +++ /dev/null @@ -1,71 +0,0 @@ -#!armclang --target=arm-arm-none-eabi -march=armv8-m.main -E -x c -/* -** ################################################################### -** Processors: MCXA156VLL -** MCXA156VMP -** MCXA156VPJ -** -** Compiler: Keil ARM C/C++ Compiler -** Reference manual: MCXA18 User manual -** Version: rev. 1.0, 2022-03-29 -** Build: b240104 -** -** Abstract: -** Linker file for the Keil ARM C/C++ Compiler -** -** Copyright 2016 Freescale Semiconductor, Inc. -** Copyright 2016-2024 NXP -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** ################################################################### -*/ - - -/* Sizes */ -#if (defined(__stack_size__)) - #define Stack_Size __stack_size__ -#else - #define Stack_Size 0x0400 -#endif - -#if (defined(__heap_size__)) - #define Heap_Size __heap_size__ -#else - #define Heap_Size 0x0400 -#endif - -#define m_interrupts_start 0x00000000 -#define m_interrupts_size 0x00000200 - -#define m_text_start 0x00000200 -#define m_text_size 0x000FFE00 - -#define m_data_start 0x20000000 -#define m_data_size 0x0001E000 - -#define m_sramx0_start 0x04000000; -#define m_sramx0_size 0x00002000; - -LR_m_text m_interrupts_start m_interrupts_size+m_text_size { ; load region size_region - - VECTOR_ROM m_interrupts_start m_interrupts_size { ; load address = execution address - * (.isr_vector,+FIRST) - } - - ER_m_text m_text_start FIXED m_text_size { ; load address = execution address - * (InRoot$$Sections) - .ANY (+RO) - } - - RW_m_data m_data_start m_data_size-Stack_Size-Heap_Size { ; RW data - .ANY (+RW +ZI) - } - ARM_LIB_HEAP +0 EMPTY Heap_Size { ; Heap region growing up - } - ARM_LIB_STACK m_data_start+m_data_size EMPTY -Stack_Size { ; Stack region growing down - } - -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/arm/MCXA156_ram.scf b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/arm/MCXA156_ram.scf deleted file mode 100644 index d3cdf8c9006..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/arm/MCXA156_ram.scf +++ /dev/null @@ -1,68 +0,0 @@ -#!armclang --target=arm-arm-none-eabi -march=armv8-m.main -E -x c -/* -** ################################################################### -** Processors: MCXA156VLL -** MCXA156VMP -** MCXA156VPJ -** -** Compiler: Keil ARM C/C++ Compiler -** Reference manual: MCXA18 User manual -** Version: rev. 1.0, 2022-03-29 -** Build: b240104 -** -** Abstract: -** Linker file for the Keil ARM C/C++ Compiler -** -** Copyright 2016 Freescale Semiconductor, Inc. -** Copyright 2016-2024 NXP -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** ################################################################### -*/ - - -/* Sizes */ -#if (defined(__stack_size__)) - #define Stack_Size __stack_size__ -#else - #define Stack_Size 0x0400 -#endif - -#if (defined(__heap_size__)) - #define Heap_Size __heap_size__ -#else - #define Heap_Size 0x0400 -#endif - -#define m_interrupts_start 0x20000000 -#define m_interrupts_size 0x00000200 - -#define m_text_start 0x20000200 -#define m_text_size 0x00005E00 - -#define m_data_start 0x20006000 -#define m_data_size 0x00018000 - -LR_m_text m_interrupts_start m_interrupts_size+m_text_size { ; load region size_region - - VECTOR_ROM m_interrupts_start m_interrupts_size { ; load address = execution address - * (.isr_vector,+FIRST) - } - - ER_m_text m_text_start FIXED m_text_size { ; load address = execution address - * (InRoot$$Sections) - .ANY (+RO) - } - - RW_m_data m_data_start m_data_size-Stack_Size-Heap_Size { ; RW data - .ANY (+RW +ZI) - } - ARM_LIB_HEAP +0 EMPTY Heap_Size { ; Heap region growing up - } - ARM_LIB_STACK m_data_start+m_data_size EMPTY -Stack_Size { ; Stack region growing down - } - -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/arm/MCXA15X.dbgconf b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/arm/MCXA15X.dbgconf deleted file mode 100644 index a59776c1989..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/arm/MCXA15X.dbgconf +++ /dev/null @@ -1,18 +0,0 @@ -// <<< Use Configuration Wizard in Context Menu >>> - -// SWO pin -// The SWO (Serial Wire Output) pin optionally provides data from the ITM -// for an external debug tool to evaluate. -// <0=> PIO0_10 -// <1=> PIO0_8 -SWO_Pin = 0; -// - -// Debug Configuration -// StopAfterBootloader Stop after Bootloader -// -Dbg_CR = 0x00000001; -// - - -// <<< end of configuration section >>> diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/arm/MCXA15X_1024.FLM b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/arm/MCXA15X_1024.FLM deleted file mode 100644 index 036b2fb9a15..00000000000 Binary files a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/arm/MCXA15X_1024.FLM and /dev/null differ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/arm/startup_MCXA156.S b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/arm/startup_MCXA156.S deleted file mode 100644 index e775526a520..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/arm/startup_MCXA156.S +++ /dev/null @@ -1,1121 +0,0 @@ -/* ------------------------------------------------------------------------- */ -/* @file: startup_MCXA156.s */ -/* @purpose: CMSIS Cortex-M33 Core Device Startup File */ -/* MCXA156 */ -/* @version: 1.0 */ -/* @date: 2022-3-29 */ -/* @build: b231107 */ -/* ------------------------------------------------------------------------- */ -/* */ -/* Copyright 1997-2016 Freescale Semiconductor, Inc. */ -/* Copyright 2016-2023 NXP */ -/* SPDX-License-Identifier: BSD-3-Clause */ -/*****************************************************************************/ -/* Version: GCC for ARM Embedded Processors */ -/*****************************************************************************/ - .syntax unified - .arch armv8-m.main - .eabi_attribute Tag_ABI_align_preserved, 1 /*8-byte alignment */ - - .section .isr_vector, "a" - .align 2 - .globl __Vectors -__Vectors: - .long Image$$ARM_LIB_STACK$$ZI$$Limit /* Top of Stack */ - .long Reset_Handler /* Reset Handler */ - .long NMI_Handler /* NMI Handler*/ - .long HardFault_Handler /* Hard Fault Handler*/ - .long MemManage_Handler /* MPU Fault Handler*/ - .long BusFault_Handler /* Bus Fault Handler*/ - .long UsageFault_Handler /* Usage Fault Handler*/ - .long SecureFault_Handler /* Secure Fault Handler*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long SVC_Handler /* SVCall Handler*/ - .long DebugMon_Handler /* Debug Monitor Handler*/ - .long 0 /* Reserved*/ - .long PendSV_Handler /* PendSV Handler*/ - .long SysTick_Handler /* SysTick Handler*/ - - /* External Interrupts*/ - .long Reserved16_IRQHandler /* OR IRQ1 to IRQ53*/ - .long CMC_IRQHandler /* Core Mode Controller interrupt*/ - .long DMA_CH0_IRQHandler /* DMA3_0_CH0 error or transfer complete*/ - .long DMA_CH1_IRQHandler /* DMA3_0_CH1 error or transfer complete*/ - .long DMA_CH2_IRQHandler /* DMA3_0_CH2 error or transfer complete*/ - .long DMA_CH3_IRQHandler /* DMA3_0_CH3 error or transfer complete*/ - .long DMA_CH4_IRQHandler /* DMA3_0_CH4 error or transfer complete*/ - .long DMA_CH5_IRQHandler /* DMA3_0_CH5 error or transfer complete*/ - .long DMA_CH6_IRQHandler /* DMA3_0_CH6 error or transfer complete*/ - .long DMA_CH7_IRQHandler /* DMA3_0_CH7 error or transfer complete*/ - .long ERM0_SINGLE_BIT_IRQHandler /* ERM Single Bit error interrupt*/ - .long ERM0_MULTI_BIT_IRQHandler /* ERM Multi Bit error interrupt*/ - .long FMU0_IRQHandler /* Flash Management Unit interrupt*/ - .long GLIKEY0_IRQHandler /* GLIKEY Interrupt */ - .long MBC0_IRQHandler /* MBC secure violation interrupt*/ - .long SCG0_IRQHandler /* System Clock Generator interrupt*/ - .long SPC0_IRQHandler /* System Power Controller interrupt*/ - .long VBAT0_IRQHandler /* VBAT interrupt*/ - .long WUU0_IRQHandler /* Wake Up Unit interrupt*/ - .long CAN0_IRQHandler /* Controller Area Network 0 interrupt*/ - .long Reserved36_IRQHandler /* Reserved interrupt*/ - .long Reserved37_IRQHandler /* Reserved interrupt*/ - .long Reserved38_IRQHandler /* Reserved interrupt*/ - .long FLEXIO_IRQHandler /* Flexible Input/Output interrupt*/ - .long I3C0_IRQHandler /* Improved Inter Integrated Circuit interrupt 0*/ - .long Reserved41_IRQHandler /* Reserved interrupt*/ - .long LPI2C0_IRQHandler /* Low-Power Inter Integrated Circuit interrupt*/ - .long LPI2C1_IRQHandler /* Low-Power Inter Integrated Circuit interrupt*/ - .long LPSPI0_IRQHandler /* Low-Power Serial Peripheral Interface interrupt*/ - .long LPSPI1_IRQHandler /* Low-Power Serial Peripheral Interface interrupt*/ - .long Reserved46_IRQHandler /* Reserved interrupt*/ - .long LPUART0_IRQHandler /* Low-Power Universal Asynchronous Receive/Transmit interrupt*/ - .long LPUART1_IRQHandler /* Low-Power Universal Asynchronous Receive/Transmit interrupt*/ - .long LPUART2_IRQHandler /* Low-Power Universal Asynchronous Receive/Transmit interrupt*/ - .long LPUART3_IRQHandler /* Low-Power Universal Asynchronous Receive/Transmit interrupt*/ - .long LPUART4_IRQHandler /* Low-Power Universal Asynchronous Receive/Transmit interrupt*/ - .long USB0_IRQHandler /* Universal Serial Bus - Full Speed interrupt*/ - .long Reserved53_IRQHandler /* Reserved interrupt*/ - .long CDOG0_IRQHandler /* Code Watchdog Timer 0 interrupt*/ - .long CTIMER0_IRQHandler /* Standard counter/timer 0 interrupt*/ - .long CTIMER1_IRQHandler /* Standard counter/timer 1 interrupt*/ - .long CTIMER2_IRQHandler /* Standard counter/timer 2 interrupt*/ - .long CTIMER3_IRQHandler /* Standard counter/timer 3 interrupt*/ - .long CTIMER4_IRQHandler /* Standard counter/timer 4 interrupt*/ - .long FLEXPWM0_RELOAD_ERROR_IRQHandler /* FlexPWM0_reload_error interrupt*/ - .long FLEXPWM0_FAULT_IRQHandler /* FlexPWM0_fault interrupt*/ - .long FLEXPWM0_SUBMODULE0_IRQHandler /* FlexPWM0 Submodule 0 capture/compare/reload interrupt*/ - .long FLEXPWM0_SUBMODULE1_IRQHandler /* FlexPWM0 Submodule 1 capture/compare/reload interrupt*/ - .long FLEXPWM0_SUBMODULE2_IRQHandler /* FlexPWM0 Submodule 2 capture/compare/reload interrupt*/ - .long Reserved65_IRQHandler /* Reserved interrupt*/ - .long QDC0_COMPARE_IRQHandler /* Compare*/ - .long QDC0_HOME_IRQHandler /* Home*/ - .long QDC0_WATCHDOG_IRQHandler /* Watchdog / Simultaneous A and B Change*/ - .long QDC0_INDEX_IRQHandler /* Index / Roll Over / Roll Under*/ - .long FREQME0_IRQHandler /* Frequency Measurement interrupt*/ - .long LPTMR0_IRQHandler /* Low Power Timer 0 interrupt*/ - .long Reserved72_IRQHandler /* Reserved interrupt*/ - .long OS_EVENT_IRQHandler /* OS event timer interrupt*/ - .long WAKETIMER0_IRQHandler /* Wake Timer Interrupt*/ - .long UTICK0_IRQHandler /* Micro-Tick Timer interrupt*/ - .long WWDT0_IRQHandler /* Windowed Watchdog Timer 0 interrupt*/ - .long Reserved77_IRQHandler /* Reserved interrupt*/ - .long ADC0_IRQHandler /* Analog-to-Digital Converter interrupt*/ - .long ADC1_IRQHandler /* Analog-to-Digital Converter interrupt*/ - .long CMP0_IRQHandler /* Comparator interrupt*/ - .long CMP1_IRQHandler /* Comparator interrupt*/ - .long Reserved82_IRQHandler /* Reserved interrupt*/ - .long DAC0_IRQHandler /* Digital-to-Analog Converter 0 - General Purpose interrupt*/ - .long Reserved84_IRQHandler /* Reserved interrupt*/ - .long Reserved85_IRQHandler /* Reserved interrupt*/ - .long Reserved86_IRQHandler /* Reserved interrupt*/ - .long GPIO0_IRQHandler /* General Purpose Input/Output interrupt 0*/ - .long GPIO1_IRQHandler /* General Purpose Input/Output interrupt 1*/ - .long GPIO2_IRQHandler /* General Purpose Input/Output interrupt 2*/ - .long GPIO3_IRQHandler /* General Purpose Input/Output interrupt 3*/ - .long GPIO4_IRQHandler /* General Purpose Input/Output interrupt 4*/ - .long Reserved92_IRQHandler /* Reserved interrupt*/ - .long LPI2C2_IRQHandler /* Low-Power Inter Integrated Circuit interrupt*/ - .long LPI2C3_IRQHandler /* Low-Power Inter Integrated Circuit interrupt*/ - .long FLEXPWM1_RELOAD_ERROR_IRQHandler /* FlexPWM1_reload_error interrupt*/ - .long FLEXPWM1_FAULT_IRQHandler /* FlexPWM1_fault interrupt*/ - .long FLEXPWM1_SUBMODULE0_IRQHandler /* FlexPWM1 Submodule 0 capture/compare/reload interrupt*/ - .long FLEXPWM1_SUBMODULE1_IRQHandler /* FlexPWM1 Submodule 1 capture/compare/reload interrupt*/ - .long FLEXPWM1_SUBMODULE2_IRQHandler /* FlexPWM1 Submodule 2 capture/compare/reload interrupt*/ - .long Reserved100_IRQHandler /* Reserved interrupt*/ - .long QDC1_COMPARE_IRQHandler /* Compare*/ - .long QDC1_HOME_IRQHandler /* Home*/ - .long QDC1_WATCHDOG_IRQHandler /* Watchdog / Simultaneous A and B Change*/ - .long QDC1_INDEX_IRQHandler /* Index / Roll Over / Roll Under*/ - - .size __Vectors, . - __Vectors - - .text - .thumb - -/* Reset Handler */ - - .thumb_func - .align 2 - .weak Reset_Handler - .type Reset_Handler, %function -Reset_Handler: - cpsid i /* Mask interrupts */ - .equ VTOR, 0xE000ED08 - ldr r0, =VTOR - ldr r1, =__Vectors - str r1, [r0] - ldr r2, [r1] - msr msp, r2 - ldr r0, =Image$$ARM_LIB_STACK$$ZI$$Base - msr msplim, r0 - ldr r0,=SystemInit - blx r0 - cpsie i /* Unmask interrupts */ - ldr r0,=__main - bx r0 - - .pool - .size Reset_Handler, . - Reset_Handler - - .align 1 - .thumb_func - .weak DefaultISR - .type DefaultISR, %function -DefaultISR: - b DefaultISR - .size DefaultISR, . - DefaultISR - - .align 1 - .thumb_func - .weak NMI_Handler - .type NMI_Handler, %function -NMI_Handler: - ldr r0,=NMI_Handler - bx r0 - .size NMI_Handler, . - NMI_Handler - - .align 1 - .thumb_func - .weak HardFault_Handler - .type HardFault_Handler, %function -HardFault_Handler: - ldr r0,=HardFault_Handler - bx r0 - .size HardFault_Handler, . - HardFault_Handler - - .align 1 - .thumb_func - .weak SVC_Handler - .type SVC_Handler, %function -SVC_Handler: - ldr r0,=SVC_Handler - bx r0 - .size SVC_Handler, . - SVC_Handler - - .align 1 - .thumb_func - .weak PendSV_Handler - .type PendSV_Handler, %function -PendSV_Handler: - ldr r0,=PendSV_Handler - bx r0 - .size PendSV_Handler, . - PendSV_Handler - - .align 1 - .thumb_func - .weak SysTick_Handler - .type SysTick_Handler, %function -SysTick_Handler: - ldr r0,=SysTick_Handler - bx r0 - .size SysTick_Handler, . - SysTick_Handler - - .align 1 - .thumb_func - .weak Reserved16_IRQHandler - .type Reserved16_IRQHandler, %function -Reserved16_IRQHandler: - ldr r0,=Reserved16_DriverIRQHandler - bx r0 - .size Reserved16_IRQHandler, . - Reserved16_IRQHandler - - .align 1 - .thumb_func - .weak CMC_IRQHandler - .type CMC_IRQHandler, %function -CMC_IRQHandler: - ldr r0,=CMC_DriverIRQHandler - bx r0 - .size CMC_IRQHandler, . - CMC_IRQHandler - - .align 1 - .thumb_func - .weak DMA_CH0_IRQHandler - .type DMA_CH0_IRQHandler, %function -DMA_CH0_IRQHandler: - ldr r0,=DMA_CH0_DriverIRQHandler - bx r0 - .size DMA_CH0_IRQHandler, . - DMA_CH0_IRQHandler - - .align 1 - .thumb_func - .weak DMA_CH1_IRQHandler - .type DMA_CH1_IRQHandler, %function -DMA_CH1_IRQHandler: - ldr r0,=DMA_CH1_DriverIRQHandler - bx r0 - .size DMA_CH1_IRQHandler, . - DMA_CH1_IRQHandler - - .align 1 - .thumb_func - .weak DMA_CH2_IRQHandler - .type DMA_CH2_IRQHandler, %function -DMA_CH2_IRQHandler: - ldr r0,=DMA_CH2_DriverIRQHandler - bx r0 - .size DMA_CH2_IRQHandler, . - DMA_CH2_IRQHandler - - .align 1 - .thumb_func - .weak DMA_CH3_IRQHandler - .type DMA_CH3_IRQHandler, %function -DMA_CH3_IRQHandler: - ldr r0,=DMA_CH3_DriverIRQHandler - bx r0 - .size DMA_CH3_IRQHandler, . - DMA_CH3_IRQHandler - - .align 1 - .thumb_func - .weak DMA_CH4_IRQHandler - .type DMA_CH4_IRQHandler, %function -DMA_CH4_IRQHandler: - ldr r0,=DMA_CH4_DriverIRQHandler - bx r0 - .size DMA_CH4_IRQHandler, . - DMA_CH4_IRQHandler - - .align 1 - .thumb_func - .weak DMA_CH5_IRQHandler - .type DMA_CH5_IRQHandler, %function -DMA_CH5_IRQHandler: - ldr r0,=DMA_CH5_DriverIRQHandler - bx r0 - .size DMA_CH5_IRQHandler, . - DMA_CH5_IRQHandler - - .align 1 - .thumb_func - .weak DMA_CH6_IRQHandler - .type DMA_CH6_IRQHandler, %function -DMA_CH6_IRQHandler: - ldr r0,=DMA_CH6_DriverIRQHandler - bx r0 - .size DMA_CH6_IRQHandler, . - DMA_CH6_IRQHandler - - .align 1 - .thumb_func - .weak DMA_CH7_IRQHandler - .type DMA_CH7_IRQHandler, %function -DMA_CH7_IRQHandler: - ldr r0,=DMA_CH7_DriverIRQHandler - bx r0 - .size DMA_CH7_IRQHandler, . - DMA_CH7_IRQHandler - - .align 1 - .thumb_func - .weak ERM0_SINGLE_BIT_IRQHandler - .type ERM0_SINGLE_BIT_IRQHandler, %function -ERM0_SINGLE_BIT_IRQHandler: - ldr r0,=ERM0_SINGLE_BIT_DriverIRQHandler - bx r0 - .size ERM0_SINGLE_BIT_IRQHandler, . - ERM0_SINGLE_BIT_IRQHandler - - .align 1 - .thumb_func - .weak ERM0_MULTI_BIT_IRQHandler - .type ERM0_MULTI_BIT_IRQHandler, %function -ERM0_MULTI_BIT_IRQHandler: - ldr r0,=ERM0_MULTI_BIT_DriverIRQHandler - bx r0 - .size ERM0_MULTI_BIT_IRQHandler, . - ERM0_MULTI_BIT_IRQHandler - - .align 1 - .thumb_func - .weak FMU0_IRQHandler - .type FMU0_IRQHandler, %function -FMU0_IRQHandler: - ldr r0,=FMU0_DriverIRQHandler - bx r0 - .size FMU0_IRQHandler, . - FMU0_IRQHandler - - .align 1 - .thumb_func - .weak GLIKEY0_IRQHandler - .type GLIKEY0_IRQHandler, %function -GLIKEY0_IRQHandler: - ldr r0,=GLIKEY0_DriverIRQHandler - bx r0 - .size GLIKEY0_IRQHandler, . - GLIKEY0_IRQHandler - - .align 1 - .thumb_func - .weak MBC0_IRQHandler - .type MBC0_IRQHandler, %function -MBC0_IRQHandler: - ldr r0,=MBC0_DriverIRQHandler - bx r0 - .size MBC0_IRQHandler, . - MBC0_IRQHandler - - .align 1 - .thumb_func - .weak SCG0_IRQHandler - .type SCG0_IRQHandler, %function -SCG0_IRQHandler: - ldr r0,=SCG0_DriverIRQHandler - bx r0 - .size SCG0_IRQHandler, . - SCG0_IRQHandler - - .align 1 - .thumb_func - .weak SPC0_IRQHandler - .type SPC0_IRQHandler, %function -SPC0_IRQHandler: - ldr r0,=SPC0_DriverIRQHandler - bx r0 - .size SPC0_IRQHandler, . - SPC0_IRQHandler - - .align 1 - .thumb_func - .weak VBAT0_IRQHandler - .type VBAT0_IRQHandler, %function -VBAT0_IRQHandler: - ldr r0,=VBAT0_DriverIRQHandler - bx r0 - .size VBAT0_IRQHandler, . - VBAT0_IRQHandler - - .align 1 - .thumb_func - .weak WUU0_IRQHandler - .type WUU0_IRQHandler, %function -WUU0_IRQHandler: - ldr r0,=WUU0_DriverIRQHandler - bx r0 - .size WUU0_IRQHandler, . - WUU0_IRQHandler - - .align 1 - .thumb_func - .weak CAN0_IRQHandler - .type CAN0_IRQHandler, %function -CAN0_IRQHandler: - ldr r0,=CAN0_DriverIRQHandler - bx r0 - .size CAN0_IRQHandler, . - CAN0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved36_IRQHandler - .type Reserved36_IRQHandler, %function -Reserved36_IRQHandler: - ldr r0,=Reserved36_DriverIRQHandler - bx r0 - .size Reserved36_IRQHandler, . - Reserved36_IRQHandler - - .align 1 - .thumb_func - .weak Reserved37_IRQHandler - .type Reserved37_IRQHandler, %function -Reserved37_IRQHandler: - ldr r0,=Reserved37_DriverIRQHandler - bx r0 - .size Reserved37_IRQHandler, . - Reserved37_IRQHandler - - .align 1 - .thumb_func - .weak Reserved38_IRQHandler - .type Reserved38_IRQHandler, %function -Reserved38_IRQHandler: - ldr r0,=Reserved38_DriverIRQHandler - bx r0 - .size Reserved38_IRQHandler, . - Reserved38_IRQHandler - - .align 1 - .thumb_func - .weak FLEXIO_IRQHandler - .type FLEXIO_IRQHandler, %function -FLEXIO_IRQHandler: - ldr r0,=FLEXIO_DriverIRQHandler - bx r0 - .size FLEXIO_IRQHandler, . - FLEXIO_IRQHandler - - .align 1 - .thumb_func - .weak I3C0_IRQHandler - .type I3C0_IRQHandler, %function -I3C0_IRQHandler: - ldr r0,=I3C0_DriverIRQHandler - bx r0 - .size I3C0_IRQHandler, . - I3C0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved41_IRQHandler - .type Reserved41_IRQHandler, %function -Reserved41_IRQHandler: - ldr r0,=Reserved41_DriverIRQHandler - bx r0 - .size Reserved41_IRQHandler, . - Reserved41_IRQHandler - - .align 1 - .thumb_func - .weak LPI2C0_IRQHandler - .type LPI2C0_IRQHandler, %function -LPI2C0_IRQHandler: - ldr r0,=LPI2C0_DriverIRQHandler - bx r0 - .size LPI2C0_IRQHandler, . - LPI2C0_IRQHandler - - .align 1 - .thumb_func - .weak LPI2C1_IRQHandler - .type LPI2C1_IRQHandler, %function -LPI2C1_IRQHandler: - ldr r0,=LPI2C1_DriverIRQHandler - bx r0 - .size LPI2C1_IRQHandler, . - LPI2C1_IRQHandler - - .align 1 - .thumb_func - .weak LPSPI0_IRQHandler - .type LPSPI0_IRQHandler, %function -LPSPI0_IRQHandler: - ldr r0,=LPSPI0_DriverIRQHandler - bx r0 - .size LPSPI0_IRQHandler, . - LPSPI0_IRQHandler - - .align 1 - .thumb_func - .weak LPSPI1_IRQHandler - .type LPSPI1_IRQHandler, %function -LPSPI1_IRQHandler: - ldr r0,=LPSPI1_DriverIRQHandler - bx r0 - .size LPSPI1_IRQHandler, . - LPSPI1_IRQHandler - - .align 1 - .thumb_func - .weak Reserved46_IRQHandler - .type Reserved46_IRQHandler, %function -Reserved46_IRQHandler: - ldr r0,=Reserved46_DriverIRQHandler - bx r0 - .size Reserved46_IRQHandler, . - Reserved46_IRQHandler - - .align 1 - .thumb_func - .weak LPUART0_IRQHandler - .type LPUART0_IRQHandler, %function -LPUART0_IRQHandler: - ldr r0,=LPUART0_DriverIRQHandler - bx r0 - .size LPUART0_IRQHandler, . - LPUART0_IRQHandler - - .align 1 - .thumb_func - .weak LPUART1_IRQHandler - .type LPUART1_IRQHandler, %function -LPUART1_IRQHandler: - ldr r0,=LPUART1_DriverIRQHandler - bx r0 - .size LPUART1_IRQHandler, . - LPUART1_IRQHandler - - .align 1 - .thumb_func - .weak LPUART2_IRQHandler - .type LPUART2_IRQHandler, %function -LPUART2_IRQHandler: - ldr r0,=LPUART2_DriverIRQHandler - bx r0 - .size LPUART2_IRQHandler, . - LPUART2_IRQHandler - - .align 1 - .thumb_func - .weak LPUART3_IRQHandler - .type LPUART3_IRQHandler, %function -LPUART3_IRQHandler: - ldr r0,=LPUART3_DriverIRQHandler - bx r0 - .size LPUART3_IRQHandler, . - LPUART3_IRQHandler - - .align 1 - .thumb_func - .weak LPUART4_IRQHandler - .type LPUART4_IRQHandler, %function -LPUART4_IRQHandler: - ldr r0,=LPUART4_DriverIRQHandler - bx r0 - .size LPUART4_IRQHandler, . - LPUART4_IRQHandler - - .align 1 - .thumb_func - .weak USB0_IRQHandler - .type USB0_IRQHandler, %function -USB0_IRQHandler: - ldr r0,=USB0_DriverIRQHandler - bx r0 - .size USB0_IRQHandler, . - USB0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved53_IRQHandler - .type Reserved53_IRQHandler, %function -Reserved53_IRQHandler: - ldr r0,=Reserved53_DriverIRQHandler - bx r0 - .size Reserved53_IRQHandler, . - Reserved53_IRQHandler - - .align 1 - .thumb_func - .weak CDOG0_IRQHandler - .type CDOG0_IRQHandler, %function -CDOG0_IRQHandler: - ldr r0,=CDOG0_DriverIRQHandler - bx r0 - .size CDOG0_IRQHandler, . - CDOG0_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER0_IRQHandler - .type CTIMER0_IRQHandler, %function -CTIMER0_IRQHandler: - ldr r0,=CTIMER0_DriverIRQHandler - bx r0 - .size CTIMER0_IRQHandler, . - CTIMER0_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER1_IRQHandler - .type CTIMER1_IRQHandler, %function -CTIMER1_IRQHandler: - ldr r0,=CTIMER1_DriverIRQHandler - bx r0 - .size CTIMER1_IRQHandler, . - CTIMER1_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER2_IRQHandler - .type CTIMER2_IRQHandler, %function -CTIMER2_IRQHandler: - ldr r0,=CTIMER2_DriverIRQHandler - bx r0 - .size CTIMER2_IRQHandler, . - CTIMER2_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER3_IRQHandler - .type CTIMER3_IRQHandler, %function -CTIMER3_IRQHandler: - ldr r0,=CTIMER3_DriverIRQHandler - bx r0 - .size CTIMER3_IRQHandler, . - CTIMER3_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER4_IRQHandler - .type CTIMER4_IRQHandler, %function -CTIMER4_IRQHandler: - ldr r0,=CTIMER4_DriverIRQHandler - bx r0 - .size CTIMER4_IRQHandler, . - CTIMER4_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_RELOAD_ERROR_IRQHandler - .type FLEXPWM0_RELOAD_ERROR_IRQHandler, %function -FLEXPWM0_RELOAD_ERROR_IRQHandler: - ldr r0,=FLEXPWM0_RELOAD_ERROR_DriverIRQHandler - bx r0 - .size FLEXPWM0_RELOAD_ERROR_IRQHandler, . - FLEXPWM0_RELOAD_ERROR_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_FAULT_IRQHandler - .type FLEXPWM0_FAULT_IRQHandler, %function -FLEXPWM0_FAULT_IRQHandler: - ldr r0,=FLEXPWM0_FAULT_DriverIRQHandler - bx r0 - .size FLEXPWM0_FAULT_IRQHandler, . - FLEXPWM0_FAULT_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE0_IRQHandler - .type FLEXPWM0_SUBMODULE0_IRQHandler, %function -FLEXPWM0_SUBMODULE0_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE0_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE0_IRQHandler, . - FLEXPWM0_SUBMODULE0_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE1_IRQHandler - .type FLEXPWM0_SUBMODULE1_IRQHandler, %function -FLEXPWM0_SUBMODULE1_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE1_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE1_IRQHandler, . - FLEXPWM0_SUBMODULE1_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE2_IRQHandler - .type FLEXPWM0_SUBMODULE2_IRQHandler, %function -FLEXPWM0_SUBMODULE2_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE2_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE2_IRQHandler, . - FLEXPWM0_SUBMODULE2_IRQHandler - - .align 1 - .thumb_func - .weak Reserved65_IRQHandler - .type Reserved65_IRQHandler, %function -Reserved65_IRQHandler: - ldr r0,=Reserved65_DriverIRQHandler - bx r0 - .size Reserved65_IRQHandler, . - Reserved65_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_COMPARE_IRQHandler - .type QDC0_COMPARE_IRQHandler, %function -QDC0_COMPARE_IRQHandler: - ldr r0,=QDC0_COMPARE_DriverIRQHandler - bx r0 - .size QDC0_COMPARE_IRQHandler, . - QDC0_COMPARE_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_HOME_IRQHandler - .type QDC0_HOME_IRQHandler, %function -QDC0_HOME_IRQHandler: - ldr r0,=QDC0_HOME_DriverIRQHandler - bx r0 - .size QDC0_HOME_IRQHandler, . - QDC0_HOME_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_WATCHDOG_IRQHandler - .type QDC0_WATCHDOG_IRQHandler, %function -QDC0_WATCHDOG_IRQHandler: - ldr r0,=QDC0_WATCHDOG_DriverIRQHandler - bx r0 - .size QDC0_WATCHDOG_IRQHandler, . - QDC0_WATCHDOG_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_INDEX_IRQHandler - .type QDC0_INDEX_IRQHandler, %function -QDC0_INDEX_IRQHandler: - ldr r0,=QDC0_INDEX_DriverIRQHandler - bx r0 - .size QDC0_INDEX_IRQHandler, . - QDC0_INDEX_IRQHandler - - .align 1 - .thumb_func - .weak FREQME0_IRQHandler - .type FREQME0_IRQHandler, %function -FREQME0_IRQHandler: - ldr r0,=FREQME0_DriverIRQHandler - bx r0 - .size FREQME0_IRQHandler, . - FREQME0_IRQHandler - - .align 1 - .thumb_func - .weak LPTMR0_IRQHandler - .type LPTMR0_IRQHandler, %function -LPTMR0_IRQHandler: - ldr r0,=LPTMR0_DriverIRQHandler - bx r0 - .size LPTMR0_IRQHandler, . - LPTMR0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved72_IRQHandler - .type Reserved72_IRQHandler, %function -Reserved72_IRQHandler: - ldr r0,=Reserved72_DriverIRQHandler - bx r0 - .size Reserved72_IRQHandler, . - Reserved72_IRQHandler - - .align 1 - .thumb_func - .weak OS_EVENT_IRQHandler - .type OS_EVENT_IRQHandler, %function -OS_EVENT_IRQHandler: - ldr r0,=OS_EVENT_DriverIRQHandler - bx r0 - .size OS_EVENT_IRQHandler, . - OS_EVENT_IRQHandler - - .align 1 - .thumb_func - .weak WAKETIMER0_IRQHandler - .type WAKETIMER0_IRQHandler, %function -WAKETIMER0_IRQHandler: - ldr r0,=WAKETIMER0_DriverIRQHandler - bx r0 - .size WAKETIMER0_IRQHandler, . - WAKETIMER0_IRQHandler - - .align 1 - .thumb_func - .weak UTICK0_IRQHandler - .type UTICK0_IRQHandler, %function -UTICK0_IRQHandler: - ldr r0,=UTICK0_DriverIRQHandler - bx r0 - .size UTICK0_IRQHandler, . - UTICK0_IRQHandler - - .align 1 - .thumb_func - .weak WWDT0_IRQHandler - .type WWDT0_IRQHandler, %function -WWDT0_IRQHandler: - ldr r0,=WWDT0_DriverIRQHandler - bx r0 - .size WWDT0_IRQHandler, . - WWDT0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved77_IRQHandler - .type Reserved77_IRQHandler, %function -Reserved77_IRQHandler: - ldr r0,=Reserved77_DriverIRQHandler - bx r0 - .size Reserved77_IRQHandler, . - Reserved77_IRQHandler - - .align 1 - .thumb_func - .weak ADC0_IRQHandler - .type ADC0_IRQHandler, %function -ADC0_IRQHandler: - ldr r0,=ADC0_DriverIRQHandler - bx r0 - .size ADC0_IRQHandler, . - ADC0_IRQHandler - - .align 1 - .thumb_func - .weak ADC1_IRQHandler - .type ADC1_IRQHandler, %function -ADC1_IRQHandler: - ldr r0,=ADC1_DriverIRQHandler - bx r0 - .size ADC1_IRQHandler, . - ADC1_IRQHandler - - .align 1 - .thumb_func - .weak CMP0_IRQHandler - .type CMP0_IRQHandler, %function -CMP0_IRQHandler: - ldr r0,=CMP0_DriverIRQHandler - bx r0 - .size CMP0_IRQHandler, . - CMP0_IRQHandler - - .align 1 - .thumb_func - .weak CMP1_IRQHandler - .type CMP1_IRQHandler, %function -CMP1_IRQHandler: - ldr r0,=CMP1_DriverIRQHandler - bx r0 - .size CMP1_IRQHandler, . - CMP1_IRQHandler - - .align 1 - .thumb_func - .weak Reserved82_IRQHandler - .type Reserved82_IRQHandler, %function -Reserved82_IRQHandler: - ldr r0,=Reserved82_DriverIRQHandler - bx r0 - .size Reserved82_IRQHandler, . - Reserved82_IRQHandler - - .align 1 - .thumb_func - .weak DAC0_IRQHandler - .type DAC0_IRQHandler, %function -DAC0_IRQHandler: - ldr r0,=DAC0_DriverIRQHandler - bx r0 - .size DAC0_IRQHandler, . - DAC0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved84_IRQHandler - .type Reserved84_IRQHandler, %function -Reserved84_IRQHandler: - ldr r0,=Reserved84_DriverIRQHandler - bx r0 - .size Reserved84_IRQHandler, . - Reserved84_IRQHandler - - .align 1 - .thumb_func - .weak Reserved85_IRQHandler - .type Reserved85_IRQHandler, %function -Reserved85_IRQHandler: - ldr r0,=Reserved85_DriverIRQHandler - bx r0 - .size Reserved85_IRQHandler, . - Reserved85_IRQHandler - - .align 1 - .thumb_func - .weak Reserved86_IRQHandler - .type Reserved86_IRQHandler, %function -Reserved86_IRQHandler: - ldr r0,=Reserved86_DriverIRQHandler - bx r0 - .size Reserved86_IRQHandler, . - Reserved86_IRQHandler - - .align 1 - .thumb_func - .weak GPIO0_IRQHandler - .type GPIO0_IRQHandler, %function -GPIO0_IRQHandler: - ldr r0,=GPIO0_DriverIRQHandler - bx r0 - .size GPIO0_IRQHandler, . - GPIO0_IRQHandler - - .align 1 - .thumb_func - .weak GPIO1_IRQHandler - .type GPIO1_IRQHandler, %function -GPIO1_IRQHandler: - ldr r0,=GPIO1_DriverIRQHandler - bx r0 - .size GPIO1_IRQHandler, . - GPIO1_IRQHandler - - .align 1 - .thumb_func - .weak GPIO2_IRQHandler - .type GPIO2_IRQHandler, %function -GPIO2_IRQHandler: - ldr r0,=GPIO2_DriverIRQHandler - bx r0 - .size GPIO2_IRQHandler, . - GPIO2_IRQHandler - - .align 1 - .thumb_func - .weak GPIO3_IRQHandler - .type GPIO3_IRQHandler, %function -GPIO3_IRQHandler: - ldr r0,=GPIO3_DriverIRQHandler - bx r0 - .size GPIO3_IRQHandler, . - GPIO3_IRQHandler - - .align 1 - .thumb_func - .weak GPIO4_IRQHandler - .type GPIO4_IRQHandler, %function -GPIO4_IRQHandler: - ldr r0,=GPIO4_DriverIRQHandler - bx r0 - .size GPIO4_IRQHandler, . - GPIO4_IRQHandler - - .align 1 - .thumb_func - .weak Reserved92_IRQHandler - .type Reserved92_IRQHandler, %function -Reserved92_IRQHandler: - ldr r0,=Reserved92_DriverIRQHandler - bx r0 - .size Reserved92_IRQHandler, . - Reserved92_IRQHandler - - .align 1 - .thumb_func - .weak LPI2C2_IRQHandler - .type LPI2C2_IRQHandler, %function -LPI2C2_IRQHandler: - ldr r0,=LPI2C2_DriverIRQHandler - bx r0 - .size LPI2C2_IRQHandler, . - LPI2C2_IRQHandler - - .align 1 - .thumb_func - .weak LPI2C3_IRQHandler - .type LPI2C3_IRQHandler, %function -LPI2C3_IRQHandler: - ldr r0,=LPI2C3_DriverIRQHandler - bx r0 - .size LPI2C3_IRQHandler, . - LPI2C3_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_RELOAD_ERROR_IRQHandler - .type FLEXPWM1_RELOAD_ERROR_IRQHandler, %function -FLEXPWM1_RELOAD_ERROR_IRQHandler: - ldr r0,=FLEXPWM1_RELOAD_ERROR_DriverIRQHandler - bx r0 - .size FLEXPWM1_RELOAD_ERROR_IRQHandler, . - FLEXPWM1_RELOAD_ERROR_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_FAULT_IRQHandler - .type FLEXPWM1_FAULT_IRQHandler, %function -FLEXPWM1_FAULT_IRQHandler: - ldr r0,=FLEXPWM1_FAULT_DriverIRQHandler - bx r0 - .size FLEXPWM1_FAULT_IRQHandler, . - FLEXPWM1_FAULT_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_SUBMODULE0_IRQHandler - .type FLEXPWM1_SUBMODULE0_IRQHandler, %function -FLEXPWM1_SUBMODULE0_IRQHandler: - ldr r0,=FLEXPWM1_SUBMODULE0_DriverIRQHandler - bx r0 - .size FLEXPWM1_SUBMODULE0_IRQHandler, . - FLEXPWM1_SUBMODULE0_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_SUBMODULE1_IRQHandler - .type FLEXPWM1_SUBMODULE1_IRQHandler, %function -FLEXPWM1_SUBMODULE1_IRQHandler: - ldr r0,=FLEXPWM1_SUBMODULE1_DriverIRQHandler - bx r0 - .size FLEXPWM1_SUBMODULE1_IRQHandler, . - FLEXPWM1_SUBMODULE1_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_SUBMODULE2_IRQHandler - .type FLEXPWM1_SUBMODULE2_IRQHandler, %function -FLEXPWM1_SUBMODULE2_IRQHandler: - ldr r0,=FLEXPWM1_SUBMODULE2_DriverIRQHandler - bx r0 - .size FLEXPWM1_SUBMODULE2_IRQHandler, . - FLEXPWM1_SUBMODULE2_IRQHandler - - .align 1 - .thumb_func - .weak Reserved100_IRQHandler - .type Reserved100_IRQHandler, %function -Reserved100_IRQHandler: - ldr r0,=Reserved100_DriverIRQHandler - bx r0 - .size Reserved100_IRQHandler, . - Reserved100_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_COMPARE_IRQHandler - .type QDC1_COMPARE_IRQHandler, %function -QDC1_COMPARE_IRQHandler: - ldr r0,=QDC1_COMPARE_DriverIRQHandler - bx r0 - .size QDC1_COMPARE_IRQHandler, . - QDC1_COMPARE_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_HOME_IRQHandler - .type QDC1_HOME_IRQHandler, %function -QDC1_HOME_IRQHandler: - ldr r0,=QDC1_HOME_DriverIRQHandler - bx r0 - .size QDC1_HOME_IRQHandler, . - QDC1_HOME_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_WATCHDOG_IRQHandler - .type QDC1_WATCHDOG_IRQHandler, %function -QDC1_WATCHDOG_IRQHandler: - ldr r0,=QDC1_WATCHDOG_DriverIRQHandler - bx r0 - .size QDC1_WATCHDOG_IRQHandler, . - QDC1_WATCHDOG_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_INDEX_IRQHandler - .type QDC1_INDEX_IRQHandler, %function -QDC1_INDEX_IRQHandler: - ldr r0,=QDC1_INDEX_DriverIRQHandler - bx r0 - .size QDC1_INDEX_IRQHandler, . - QDC1_INDEX_IRQHandler - - -/* Macro to define default handlers. Default handler - * will be weak symbol and just dead loops. They can be - * overwritten by other handlers */ - .macro def_irq_handler handler_name - .weak \handler_name - .set \handler_name, DefaultISR - .endm - -/* Exception Handlers */ - def_irq_handler MemManage_Handler - def_irq_handler BusFault_Handler - def_irq_handler UsageFault_Handler - def_irq_handler SecureFault_Handler - def_irq_handler DebugMon_Handler - def_irq_handler Reserved16_DriverIRQHandler - def_irq_handler CMC_DriverIRQHandler - def_irq_handler DMA_CH0_DriverIRQHandler - def_irq_handler DMA_CH1_DriverIRQHandler - def_irq_handler DMA_CH2_DriverIRQHandler - def_irq_handler DMA_CH3_DriverIRQHandler - def_irq_handler DMA_CH4_DriverIRQHandler - def_irq_handler DMA_CH5_DriverIRQHandler - def_irq_handler DMA_CH6_DriverIRQHandler - def_irq_handler DMA_CH7_DriverIRQHandler - def_irq_handler ERM0_SINGLE_BIT_DriverIRQHandler - def_irq_handler ERM0_MULTI_BIT_DriverIRQHandler - def_irq_handler FMU0_DriverIRQHandler - def_irq_handler GLIKEY0_DriverIRQHandler - def_irq_handler MBC0_DriverIRQHandler - def_irq_handler SCG0_DriverIRQHandler - def_irq_handler SPC0_DriverIRQHandler - def_irq_handler VBAT0_DriverIRQHandler - def_irq_handler WUU0_DriverIRQHandler - def_irq_handler CAN0_DriverIRQHandler - def_irq_handler Reserved36_DriverIRQHandler - def_irq_handler Reserved37_DriverIRQHandler - def_irq_handler Reserved38_DriverIRQHandler - def_irq_handler FLEXIO_DriverIRQHandler - def_irq_handler I3C0_DriverIRQHandler - def_irq_handler Reserved41_DriverIRQHandler - def_irq_handler LPI2C0_DriverIRQHandler - def_irq_handler LPI2C1_DriverIRQHandler - def_irq_handler LPSPI0_DriverIRQHandler - def_irq_handler LPSPI1_DriverIRQHandler - def_irq_handler Reserved46_DriverIRQHandler - def_irq_handler LPUART0_DriverIRQHandler - def_irq_handler LPUART1_DriverIRQHandler - def_irq_handler LPUART2_DriverIRQHandler - def_irq_handler LPUART3_DriverIRQHandler - def_irq_handler LPUART4_DriverIRQHandler - def_irq_handler USB0_DriverIRQHandler - def_irq_handler Reserved53_DriverIRQHandler - def_irq_handler CDOG0_DriverIRQHandler - def_irq_handler CTIMER0_DriverIRQHandler - def_irq_handler CTIMER1_DriverIRQHandler - def_irq_handler CTIMER2_DriverIRQHandler - def_irq_handler CTIMER3_DriverIRQHandler - def_irq_handler CTIMER4_DriverIRQHandler - def_irq_handler FLEXPWM0_RELOAD_ERROR_DriverIRQHandler - def_irq_handler FLEXPWM0_FAULT_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE0_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE1_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE2_DriverIRQHandler - def_irq_handler Reserved65_DriverIRQHandler - def_irq_handler QDC0_COMPARE_DriverIRQHandler - def_irq_handler QDC0_HOME_DriverIRQHandler - def_irq_handler QDC0_WATCHDOG_DriverIRQHandler - def_irq_handler QDC0_INDEX_DriverIRQHandler - def_irq_handler FREQME0_DriverIRQHandler - def_irq_handler LPTMR0_DriverIRQHandler - def_irq_handler Reserved72_DriverIRQHandler - def_irq_handler OS_EVENT_DriverIRQHandler - def_irq_handler WAKETIMER0_DriverIRQHandler - def_irq_handler UTICK0_DriverIRQHandler - def_irq_handler WWDT0_DriverIRQHandler - def_irq_handler Reserved77_DriverIRQHandler - def_irq_handler ADC0_DriverIRQHandler - def_irq_handler ADC1_DriverIRQHandler - def_irq_handler CMP0_DriverIRQHandler - def_irq_handler CMP1_DriverIRQHandler - def_irq_handler Reserved82_DriverIRQHandler - def_irq_handler DAC0_DriverIRQHandler - def_irq_handler Reserved84_DriverIRQHandler - def_irq_handler Reserved85_DriverIRQHandler - def_irq_handler Reserved86_DriverIRQHandler - def_irq_handler GPIO0_DriverIRQHandler - def_irq_handler GPIO1_DriverIRQHandler - def_irq_handler GPIO2_DriverIRQHandler - def_irq_handler GPIO3_DriverIRQHandler - def_irq_handler GPIO4_DriverIRQHandler - def_irq_handler Reserved92_DriverIRQHandler - def_irq_handler LPI2C2_DriverIRQHandler - def_irq_handler LPI2C3_DriverIRQHandler - def_irq_handler FLEXPWM1_RELOAD_ERROR_DriverIRQHandler - def_irq_handler FLEXPWM1_FAULT_DriverIRQHandler - def_irq_handler FLEXPWM1_SUBMODULE0_DriverIRQHandler - def_irq_handler FLEXPWM1_SUBMODULE1_DriverIRQHandler - def_irq_handler FLEXPWM1_SUBMODULE2_DriverIRQHandler - def_irq_handler Reserved100_DriverIRQHandler - def_irq_handler QDC1_COMPARE_DriverIRQHandler - def_irq_handler QDC1_HOME_DriverIRQHandler - def_irq_handler QDC1_WATCHDOG_DriverIRQHandler - def_irq_handler QDC1_INDEX_DriverIRQHandler - - .end diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_aoi.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_aoi.c deleted file mode 100644 index 41a2650d264..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_aoi.c +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2019 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#include "fsl_aoi.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.aoi" -#endif - -#if defined(AOI_RSTS) -#define AOI_RESETS_ARRAY AOI_RSTS -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to aoi bases for each instance. */ -static AOI_Type *const s_aoiBases[] = AOI_BASE_PTRS; - -#if defined(AOI_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_aoiResets[] = AOI_RESETS_ARRAY; -#endif - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to aoi clocks for each instance. */ -static const clock_ip_name_t s_aoiClocks[] = AOI_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Get instance number for AOI module. - * - * @param base AOI peripheral base address - * - * @return The AOI instance - */ -static uint32_t AOI_GetInstance(AOI_Type *base); -/******************************************************************************* - * Code - ******************************************************************************/ - -static uint32_t AOI_GetInstance(AOI_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_aoiBases); instance++) - { - if (s_aoiBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_aoiBases)); - - return instance; -} - -/*! - * brief Initializes an AOI instance for operation. - * - * This function un-gates the AOI clock. - * - * param base AOI peripheral address. - */ -void AOI_Init(AOI_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock gate from clock manager. */ - CLOCK_EnableClock(s_aoiClocks[AOI_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(AOI_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_aoiResets[AOI_GetInstance(base)]); -#endif -} - -/*! - * brief Deinitializes an AOI instance for operation. - * - * This function shutdowns AOI module. - * - * param base AOI peripheral address. - */ -void AOI_Deinit(AOI_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable the clock gate from clock manager */ - CLOCK_DisableClock(s_aoiClocks[AOI_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Gets the Boolean evaluation associated. - * - * This function returns the Boolean evaluation associated. - * - * Example: - code - aoi_event_config_t demoEventLogicStruct; - - AOI_GetEventLogicConfig(AOI, kAOI_Event0, &demoEventLogicStruct); - endcode - * - * param base AOI peripheral address. - * param event Index of the event which will be set of type aoi_event_t. - * param config Selected input configuration . - */ -void AOI_GetEventLogicConfig(AOI_Type *base, aoi_event_t event, aoi_event_config_t *config) -{ - assert((uint32_t)event < (uint32_t)FSL_FEATURE_AOI_EVENT_COUNT); - assert(config != NULL); - - uint16_t value; - uint16_t temp; - /* Read BFCRT01 register at event index. */ - value = base->BFCRT[event].BFCRT01; - - temp = (value & AOI_BFCRT01_PT0_AC_MASK) >> AOI_BFCRT01_PT0_AC_SHIFT; - config->PT0AC = (aoi_input_config_t)temp; - temp = (value & AOI_BFCRT01_PT0_BC_MASK) >> AOI_BFCRT01_PT0_BC_SHIFT; - config->PT0BC = (aoi_input_config_t)temp; - temp = (value & AOI_BFCRT01_PT0_CC_MASK) >> AOI_BFCRT01_PT0_CC_SHIFT; - config->PT0CC = (aoi_input_config_t)temp; - temp = (value & AOI_BFCRT01_PT0_DC_MASK) >> AOI_BFCRT01_PT0_DC_SHIFT; - config->PT0DC = (aoi_input_config_t)temp; - - temp = (value & AOI_BFCRT01_PT1_AC_MASK) >> AOI_BFCRT01_PT1_AC_SHIFT; - config->PT1AC = (aoi_input_config_t)temp; - temp = (value & AOI_BFCRT01_PT1_BC_MASK) >> AOI_BFCRT01_PT1_BC_SHIFT; - config->PT1BC = (aoi_input_config_t)temp; - temp = (value & AOI_BFCRT01_PT1_CC_MASK) >> AOI_BFCRT01_PT1_CC_SHIFT; - config->PT1CC = (aoi_input_config_t)temp; - temp = (value & AOI_BFCRT01_PT1_DC_MASK) >> AOI_BFCRT01_PT1_DC_SHIFT; - config->PT1DC = (aoi_input_config_t)temp; - - /* Read BFCRT23 register at event index. */ - value = base->BFCRT[event].BFCRT23; - - temp = (value & AOI_BFCRT23_PT2_AC_MASK) >> AOI_BFCRT23_PT2_AC_SHIFT; - config->PT2AC = (aoi_input_config_t)temp; - temp = (value & AOI_BFCRT23_PT2_BC_MASK) >> AOI_BFCRT23_PT2_BC_SHIFT; - config->PT2BC = (aoi_input_config_t)temp; - temp = (value & AOI_BFCRT23_PT2_CC_MASK) >> AOI_BFCRT23_PT2_CC_SHIFT; - config->PT2CC = (aoi_input_config_t)temp; - temp = (value & AOI_BFCRT23_PT2_DC_MASK) >> AOI_BFCRT23_PT2_DC_SHIFT; - config->PT2DC = (aoi_input_config_t)temp; - - temp = (value & AOI_BFCRT23_PT3_AC_MASK) >> AOI_BFCRT23_PT3_AC_SHIFT; - config->PT3AC = (aoi_input_config_t)temp; - temp = (value & AOI_BFCRT23_PT3_BC_MASK) >> AOI_BFCRT23_PT3_BC_SHIFT; - config->PT3BC = (aoi_input_config_t)temp; - temp = (value & AOI_BFCRT23_PT3_CC_MASK) >> AOI_BFCRT23_PT3_CC_SHIFT; - config->PT3CC = (aoi_input_config_t)temp; - temp = (value & AOI_BFCRT23_PT3_DC_MASK) >> AOI_BFCRT23_PT3_DC_SHIFT; - config->PT3DC = (aoi_input_config_t)temp; -} - -/*! - * brief Configures an AOI event. - * - * This function configures an AOI event according - * to the aoiEventConfig structure. This function configures all inputs (A, B, C, and D) - * of all product terms (0, 1, 2, and 3) of a desired event. - * - * Example: - code - aoi_event_config_t demoEventLogicStruct; - - demoEventLogicStruct.PT0AC = kAOI_InvInputSignal; - demoEventLogicStruct.PT0BC = kAOI_InputSignal; - demoEventLogicStruct.PT0CC = kAOI_LogicOne; - demoEventLogicStruct.PT0DC = kAOI_LogicOne; - - demoEventLogicStruct.PT1AC = kAOI_LogicZero; - demoEventLogicStruct.PT1BC = kAOI_LogicOne; - demoEventLogicStruct.PT1CC = kAOI_LogicOne; - demoEventLogicStruct.PT1DC = kAOI_LogicOne; - - demoEventLogicStruct.PT2AC = kAOI_LogicZero; - demoEventLogicStruct.PT2BC = kAOI_LogicOne; - demoEventLogicStruct.PT2CC = kAOI_LogicOne; - demoEventLogicStruct.PT2DC = kAOI_LogicOne; - - demoEventLogicStruct.PT3AC = kAOI_LogicZero; - demoEventLogicStruct.PT3BC = kAOI_LogicOne; - demoEventLogicStruct.PT3CC = kAOI_LogicOne; - demoEventLogicStruct.PT3DC = kAOI_LogicOne; - - AOI_SetEventLogicConfig(AOI, kAOI_Event0, demoEventLogicStruct); - endcode - * - * param base AOI peripheral address. - * param event Event which will be configured of type aoi_event_t. - * param eventConfig Pointer to type aoi_event_config_t structure. The user is responsible for - * filling out the members of this structure and passing the pointer to this function. - */ -void AOI_SetEventLogicConfig(AOI_Type *base, aoi_event_t event, const aoi_event_config_t *eventConfig) -{ - assert(eventConfig != NULL); - assert((uint32_t)event < (uint32_t)FSL_FEATURE_AOI_EVENT_COUNT); - - uint16_t value; - /* Calculate value to configure product term 0, 1 */ - value = AOI_BFCRT01_PT0_AC(eventConfig->PT0AC) | AOI_BFCRT01_PT0_BC(eventConfig->PT0BC) | - AOI_BFCRT01_PT0_CC(eventConfig->PT0CC) | AOI_BFCRT01_PT0_DC(eventConfig->PT0DC) | - AOI_BFCRT01_PT1_AC(eventConfig->PT1AC) | AOI_BFCRT01_PT1_BC(eventConfig->PT1BC) | - AOI_BFCRT01_PT1_CC(eventConfig->PT1CC) | AOI_BFCRT01_PT1_DC(eventConfig->PT1DC); - /* Write value to register */ - base->BFCRT[event].BFCRT01 = value; - - /* Reset and calculate value to configure product term 2, 3 */ - value = AOI_BFCRT23_PT2_AC(eventConfig->PT2AC) | AOI_BFCRT23_PT2_BC(eventConfig->PT2BC) | - AOI_BFCRT23_PT2_CC(eventConfig->PT2CC) | AOI_BFCRT23_PT2_DC(eventConfig->PT2DC) | - AOI_BFCRT23_PT3_AC(eventConfig->PT3AC) | AOI_BFCRT23_PT3_BC(eventConfig->PT3BC) | - AOI_BFCRT23_PT3_CC(eventConfig->PT3CC) | AOI_BFCRT23_PT3_DC(eventConfig->PT3DC); - /* Write value to register */ - base->BFCRT[event].BFCRT23 = value; -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_aoi.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_aoi.h deleted file mode 100644 index 3b1126e623e..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_aoi.h +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2019 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_AOI_H_ -#define FSL_AOI_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup aoi - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -#ifndef AOI -#define AOI AOI0 /*!< AOI peripheral address */ -#endif - -/*! @name Driver version */ -/*! @{ */ -#define FSL_AOI_DRIVER_VERSION (MAKE_VERSION(2, 0, 2)) /*!< Version 2.0.2. */ -/*! @} */ - -/*! - * @brief AOI input configurations. - * - * The selection item represents the Boolean evaluations. - */ -typedef enum _aoi_input_config -{ - kAOI_LogicZero = 0x0U, /*!< Forces the input to logical zero. */ - kAOI_InputSignal = 0x1U, /*!< Passes the input signal. */ - kAOI_InvInputSignal = 0x2U, /*!< Inverts the input signal. */ - kAOI_LogicOne = 0x3U /*!< Forces the input to logical one. */ -} aoi_input_config_t; - -/*! - * @brief AOI event indexes, where an event is the collection of the four product - * terms (0, 1, 2, and 3) and the four signal inputs (A, B, C, and D). - */ -typedef enum _aoi_event -{ - kAOI_Event0 = 0x0U, /*!< Event 0 index */ - kAOI_Event1 = 0x1U, /*!< Event 1 index */ - kAOI_Event2 = 0x2U, /*!< Event 2 index */ - kAOI_Event3 = 0x3U /*!< Event 3 index */ -} aoi_event_t; - -/*! - * @brief AOI event configuration structure - * - * Defines structure _aoi_event_config and use the AOI_SetEventLogicConfig() function to make - * whole event configuration. - */ -typedef struct _aoi_event_config -{ - aoi_input_config_t PT0AC; /*!< Product term 0 input A */ - aoi_input_config_t PT0BC; /*!< Product term 0 input B */ - aoi_input_config_t PT0CC; /*!< Product term 0 input C */ - aoi_input_config_t PT0DC; /*!< Product term 0 input D */ - aoi_input_config_t PT1AC; /*!< Product term 1 input A */ - aoi_input_config_t PT1BC; /*!< Product term 1 input B */ - aoi_input_config_t PT1CC; /*!< Product term 1 input C */ - aoi_input_config_t PT1DC; /*!< Product term 1 input D */ - aoi_input_config_t PT2AC; /*!< Product term 2 input A */ - aoi_input_config_t PT2BC; /*!< Product term 2 input B */ - aoi_input_config_t PT2CC; /*!< Product term 2 input C */ - aoi_input_config_t PT2DC; /*!< Product term 2 input D */ - aoi_input_config_t PT3AC; /*!< Product term 3 input A */ - aoi_input_config_t PT3BC; /*!< Product term 3 input B */ - aoi_input_config_t PT3CC; /*!< Product term 3 input C */ - aoi_input_config_t PT3DC; /*!< Product term 3 input D */ -} aoi_event_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus*/ - -/*! - * @name AOI Initialization - * @{ - */ - -/*! - * @brief Initializes an AOI instance for operation. - * - * This function un-gates the AOI clock. - * - * @param base AOI peripheral address. - */ -void AOI_Init(AOI_Type *base); - -/*! - * @brief Deinitializes an AOI instance for operation. - * - * This function shutdowns AOI module. - * - * @param base AOI peripheral address. - */ -void AOI_Deinit(AOI_Type *base); - -/*! @} */ - -/*! - * @name AOI Get Set Operation - * @{ - */ - -/*! - * @brief Gets the Boolean evaluation associated. - * - * This function returns the Boolean evaluation associated. - * - * Example: - @code - aoi_event_config_t demoEventLogicStruct; - - AOI_GetEventLogicConfig(AOI, kAOI_Event0, &demoEventLogicStruct); - @endcode - * - * @param base AOI peripheral address. - * @param event Index of the event which will be set of type aoi_event_t. - * @param config Selected input configuration . - */ -void AOI_GetEventLogicConfig(AOI_Type *base, aoi_event_t event, aoi_event_config_t *config); - -/*! - * @brief Configures an AOI event. - * - * This function configures an AOI event according - * to the aoiEventConfig structure. This function configures all inputs (A, B, C, and D) - * of all product terms (0, 1, 2, and 3) of a desired event. - * - * Example: - @code - aoi_event_config_t demoEventLogicStruct; - - demoEventLogicStruct.PT0AC = kAOI_InvInputSignal; - demoEventLogicStruct.PT0BC = kAOI_InputSignal; - demoEventLogicStruct.PT0CC = kAOI_LogicOne; - demoEventLogicStruct.PT0DC = kAOI_LogicOne; - - demoEventLogicStruct.PT1AC = kAOI_LogicZero; - demoEventLogicStruct.PT1BC = kAOI_LogicOne; - demoEventLogicStruct.PT1CC = kAOI_LogicOne; - demoEventLogicStruct.PT1DC = kAOI_LogicOne; - - demoEventLogicStruct.PT2AC = kAOI_LogicZero; - demoEventLogicStruct.PT2BC = kAOI_LogicOne; - demoEventLogicStruct.PT2CC = kAOI_LogicOne; - demoEventLogicStruct.PT2DC = kAOI_LogicOne; - - demoEventLogicStruct.PT3AC = kAOI_LogicZero; - demoEventLogicStruct.PT3BC = kAOI_LogicOne; - demoEventLogicStruct.PT3CC = kAOI_LogicOne; - demoEventLogicStruct.PT3DC = kAOI_LogicOne; - - AOI_SetEventLogicConfig(AOI, kAOI_Event0, demoEventLogicStruct); - @endcode - * - * @param base AOI peripheral address. - * @param event Event which will be configured of type aoi_event_t. - * @param eventConfig Pointer to type aoi_event_config_t structure. The user is responsible for - * filling out the members of this structure and passing the pointer to this function. - */ -void AOI_SetEventLogicConfig(AOI_Type *base, aoi_event_t event, const aoi_event_config_t *eventConfig); - -#if defined(__cplusplus) -} -#endif /* __cplusplus*/ - -/*! @} */ - -/*!* @} */ - -#endif /* FSL_AOI_H_*/ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_cdog.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_cdog.c deleted file mode 100644 index cd3ed6eaa3f..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_cdog.c +++ /dev/null @@ -1,378 +0,0 @@ -/* - * Copyright 2020-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_cdog.h" - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.cdog" -#endif - -/* Reset CONTROL mask */ -#define RESERVED_CTRL_MASK 0x800u - -#if defined(CDOG_IRQS) -/* Array of IRQs */ -static const IRQn_Type s_CdogIrqs[] = CDOG_IRQS; -#endif /* CDOG_IRQS */ - -#ifdef CDOG_CLOCKS -static const clock_ip_name_t s_CdogClocks[] = CDOG_CLOCKS; -#endif /* CDOG_CLOCKS */ - -#ifdef CDOG_BASE_PTRS -static const CDOG_Type* s_cdogBases[] = CDOG_BASE_PTRS; -#endif /* CDOG_BASE_PTRS */ - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -static uint32_t CDOG_GetInstance(CDOG_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_cdogBases); instance++) - { - if (s_cdogBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_cdogBases)); - - return instance; -} - -/*! - * brief Sets the default configuration of CDOG - * - * This function initialize CDOG config structure to default values. - * - * param conf CDOG configuration structure - */ -void CDOG_GetDefaultConfig(cdog_config_t *conf) -{ - /* Default configuration after reset */ - conf->lock = (uint8_t)kCDOG_LockCtrl_Unlock; /* Lock control */ - conf->timeout = (uint8_t)kCDOG_FaultCtrl_NoAction; /* Timeout control */ - conf->miscompare = (uint8_t)kCDOG_FaultCtrl_NoAction; /* Miscompare control */ - conf->sequence = (uint8_t)kCDOG_FaultCtrl_NoAction; /* Sequence control */ - conf->state = (uint8_t)kCDOG_FaultCtrl_NoAction; /* State control */ - conf->address = (uint8_t)kCDOG_FaultCtrl_NoAction; /* Address control */ - conf->irq_pause = (uint8_t)kCDOG_IrqPauseCtrl_Run; /* IRQ pause control */ - conf->debug_halt = (uint8_t)kCDOG_DebugHaltCtrl_Run; /* Debug halt control */ - return; -} - -/*! - * brief Sets secure counter and instruction timer values - * - * This function sets value in RELOAD and START registers for instruction timer. - * - * param base CDOG peripheral base address - * param reload reload value - * param start start value - */ -void CDOG_Start(CDOG_Type *base, uint32_t reload, uint32_t start) -{ - base->RELOAD = reload; - base->START = start; -} - -/*! - * brief Stops secure counter and instruction timer - * - * This function stops instruction timer and secure counter. - * This also change state of CDOG to IDLE. - * - * param base CDOG peripheral base address - * param stop expected value which will be compared with value of secure counter - */ -void CDOG_Stop(CDOG_Type *base, uint32_t stop) -{ - base->STOP = stop; -} - -/*! - * brief Sets secure counter and instruction timer values - * - * This function sets value in STOP, RELOAD and START registers - * for instruction timer and secure counter. - * - * param base CDOG peripheral base address - * param stop expected value which will be compared with value of secure counter - * param reload reload value for instruction timer - * param start start value for secure timer - */ -void CDOG_Set(CDOG_Type *base, uint32_t stop, uint32_t reload, uint32_t start) -{ - base->STOP = stop; - base->RELOAD = reload; - base->START = start; -} - -/*! - * brief Add value to secure counter - * - * This function add specified value to secure counter. - * - * param base CDOG peripheral base address. - * param add Value to be added. - */ -void CDOG_Add(CDOG_Type *base, uint32_t add) -{ - base->ADD = (secure_counter_t)add; -} - -/*! - * brief Add 1 to secure counter - * - * This function add 1 to secure counter. - * - * param base CDOG peripheral base address. - * param add Value to be added. - */ -void CDOG_Add1(CDOG_Type *base) -{ - base->ADD1 = (secure_counter_t)0x1U; -} - -/*! - * brief Add 16 to secure counter - * - * This function add 16 to secure counter. - * - * param base CDOG peripheral base address. - * param add Value to be added. - */ -void CDOG_Add16(CDOG_Type *base) -{ - base->ADD16 = (secure_counter_t)0x1U; -} - -/*! - * brief Add 256 to secure counter - * - * This function add 256 to secure counter. - * - * param base CDOG peripheral base address. - * param add Value to be added. - */ -void CDOG_Add256(CDOG_Type *base) -{ - base->ADD256 = (secure_counter_t)0x1U; -} - -/*! - * brief Substract value to secure counter - * - * This function substract specified value to secure counter. - * - * param base CDOG peripheral base address. - * param sub Value to be substracted. - */ -void CDOG_Sub(CDOG_Type *base, uint32_t sub) -{ - base->SUB = (secure_counter_t)sub; -} - -/*! - * brief Substract 1 from secure counter - * - * This function substract specified 1 from secure counter. - * - * param base CDOG peripheral base address. - */ -void CDOG_Sub1(CDOG_Type *base) -{ - base->SUB1 = (secure_counter_t)0x1U; -} - -/*! - * brief Substract 16 from secure counter - * - * This function substract specified 16 from secure counter. - * - * param base CDOG peripheral base address. - */ -void CDOG_Sub16(CDOG_Type *base) -{ - base->SUB16 = (secure_counter_t)0x1U; -} - -/*! - * brief Substract 256 from secure counter - * - * This function substract specified 256 from secure counter. - * - * param base CDOG peripheral base address. - */ -void CDOG_Sub256(CDOG_Type *base) -{ - base->SUB256 = (secure_counter_t)0x1U; -} - -/*! - * brief Checks secure counter. - * - * This function compares stop value with secure counter value - * by writting to RELOAD refister. - * - * param base CDOG peripheral base address - * param check expected (stop) value. - */ -void CDOG_Check(CDOG_Type *base, uint32_t check) -{ -#if defined(FLS_FEATURE_CDOG_USE_RESTART) - base->RESTART = check; -#else - base->STOP = check; - base->RELOAD = base->RELOAD; - base->START= check; -#endif -} - -/*! - * brief Set the CDOG persistent word. - * - * param base CDOG peripheral base address. - * param value The value to be written. - */ -void CDOG_WritePersistent(CDOG_Type *base, uint32_t value) -{ - base->PERSISTENT = value; -} - -/*! - * brief Get the CDOG persistent word. - * - * param base CDOG peripheral base address. - * return The persistent word. - */ -uint32_t CDOG_ReadPersistent(CDOG_Type *base) -{ - return base->PERSISTENT; -} - -/*! - * brief Initialize CDOG - * - * This function initializes CDOG setting and enable all interrupts. - * - * param base CDOG peripheral base address - * param conf CDOG configuration structure - * return Status of the init operation - */ -status_t CDOG_Init(CDOG_Type *base, cdog_config_t *conf) -{ - /* Ungate clock to CDOG engine and reset it */ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#ifdef CDOG_CLOCKS - CLOCK_EnableClock(s_CdogClocks[CDOG_GetInstance(base)]); -#endif /* CDOG_CLOCKS */ -#endif /* !FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_FEATURE_CDOG_HAS_NO_RESET) && FSL_FEATURE_CDOG_HAS_NO_RESET) - RESET_PeripheralReset(kCDOG_RST_SHIFT_RSTn); -#endif /* !FSL_FEATURE_CDOG_HAS_NO_RESET */ - - if (base->CONTROL == 0x0U) - { - /* CDOG is not in IDLE mode, which may be cause after SW reset. */ - /* Writing to CONTROL register will trigger fault. */ - return kStatus_Fail; - } - - /* Clear pending errors, otherwise the device will reset */ - /* itself immediately after enable Code Watchdog */ - if ((uint32_t)kCDOG_LockCtrl_Lock == - ((base->CONTROL & CDOG_CONTROL_LOCK_CTRL_MASK) >> CDOG_CONTROL_LOCK_CTRL_SHIFT)) - - { - base->FLAGS = CDOG_FLAGS_TO_FLAG(1U) | CDOG_FLAGS_MISCOM_FLAG(1U) | CDOG_FLAGS_SEQ_FLAG(1U) | - CDOG_FLAGS_CNT_FLAG(1U) | CDOG_FLAGS_STATE_FLAG(1U) | CDOG_FLAGS_ADDR_FLAG(1U) | - CDOG_FLAGS_POR_FLAG(1U); - } - else - { -/* load default values for CDOG->CONTROL before flags clear */ -#if defined(FSL_FEATURE_CDOG_NEED_LOAD_DEFAULT_CONF) && (FSL_FEATURE_CDOG_NEED_LOAD_DEFAULT_CONF > 0) - cdog_config_t default_conf; - - /* Initialize CDOG */ - CDOG_GetDefaultConfig(&default_conf); - - /* Write default value to CDOG->CONTROL*/ - base->CONTROL = - CDOG_CONTROL_TIMEOUT_CTRL(default_conf.timeout) | /* Action if the timeout event is triggered */ - CDOG_CONTROL_MISCOMPARE_CTRL(default_conf.miscompare) | /* Action if the miscompare error event is triggered */ - CDOG_CONTROL_SEQUENCE_CTRL(default_conf.sequence) | /* Action if the sequence error event is triggered */ - CDOG_CONTROL_STATE_CTRL(default_conf.state) | /* Action if the state error event is triggered */ - CDOG_CONTROL_ADDRESS_CTRL(default_conf.address) | /* Action if the address error event is triggered */ - CDOG_CONTROL_IRQ_PAUSE(default_conf.irq_pause) | /* Pause running during interrupts setup */ - CDOG_CONTROL_DEBUG_HALT_CTRL(default_conf.debug_halt) | /* Halt CDOG timer during debug */ - CDOG_CONTROL_LOCK_CTRL(default_conf.lock) | RESERVED_CTRL_MASK; /* Lock control register, RESERVED */ -#endif /* FSL_FEATURE_CDOG_NEED_LOAD_DEFAULT_CONF */ - - base->FLAGS = CDOG_FLAGS_TO_FLAG(0U) | CDOG_FLAGS_MISCOM_FLAG(0U) | CDOG_FLAGS_SEQ_FLAG(0U) | - CDOG_FLAGS_CNT_FLAG(0U) | CDOG_FLAGS_STATE_FLAG(0U) | CDOG_FLAGS_ADDR_FLAG(0U) | - CDOG_FLAGS_POR_FLAG(0U); - } - - base->CONTROL = - CDOG_CONTROL_TIMEOUT_CTRL(conf->timeout) | /* Action if the timeout event is triggered */ - CDOG_CONTROL_MISCOMPARE_CTRL(conf->miscompare) | /* Action if the miscompare error event is triggered */ - CDOG_CONTROL_SEQUENCE_CTRL(conf->sequence) | /* Action if the sequence error event is triggered */ - CDOG_CONTROL_STATE_CTRL(conf->state) | /* Action if the state error event is triggered */ - CDOG_CONTROL_ADDRESS_CTRL(conf->address) | /* Action if the address error event is triggered */ - CDOG_CONTROL_IRQ_PAUSE(conf->irq_pause) | /* Pause running during interrupts setup */ - CDOG_CONTROL_DEBUG_HALT_CTRL(conf->debug_halt) | /* Halt CDOG timer during debug */ - CDOG_CONTROL_LOCK_CTRL(conf->lock) | RESERVED_CTRL_MASK; /* Lock control register, RESERVED */ - -#if defined(CDOG_IRQS) - /* Enable peripheral IRQ */ - NVIC_EnableIRQ(s_CdogIrqs[CDOG_GetInstance(base)]); -#endif /* CDOG_IRQS */ - - return kStatus_Success; -} - -/*! - * brief Deinitialize CDOG - * - * This function stops CDOG secure counter. - * - * param base CDOG peripheral base address - */ -void CDOG_Deinit(CDOG_Type *base) -{ -#if defined(CDOG_IRQS) - /* Disable peripheral IRQ */ - NVIC_DisableIRQ(s_CdogIrqs[CDOG_GetInstance(base)]); -#endif /* CDOG_IRQS */ - -#if !(defined(FSL_FEATURE_CDOG_HAS_NO_RESET) && FSL_FEATURE_CDOG_HAS_NO_RESET) - RESET_SetPeripheralReset(kCDOG_RST_SHIFT_RSTn); -#endif /* !FSL_FEATURE_CDOG_HAS_NO_RESET */ - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#ifdef CDOG_CLOCKS - CLOCK_DisableClock(s_CdogClocks[CDOG_GetInstance(base)]); -#endif /* CDOG_CLOCKS */ -#endif /* !FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_cdog.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_cdog.h deleted file mode 100644 index 7252eaccd8c..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_cdog.h +++ /dev/null @@ -1,329 +0,0 @@ -/* - * Copyright 2020-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_CDOG_H_ -#define FSL_CDOG_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup CDOG - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief Defines CDOG driver version 2.1.3. - * - * Change log: - * - Version 2.1.3 - * - Re-design multiple instance IRQs and Clocks - * - Add fix for RESTART command errata - * - Version 2.1.2 - * - Support multiple IRQs - * - Fix default CONTROL values - * - Version 2.1.1 - * - Remove bit CONTROL[CONTROL_CTRL] - * - Version 2.1.0 - * - Rename CWT to CDOG - * - Version 2.0.2 - * - Fix MISRA-2012 issues - * - Version 2.0.1 - * - Fix doxygen issues - * - Version 2.0.0 - * - initial version - */ -#define FSL_CDOG_DRIVER_VERSION (MAKE_VERSION(2, 1, 3)) -/*! @} */ - -typedef struct -{ - uint8_t lock : 2; - uint8_t timeout : 3; - uint8_t miscompare : 3; - uint8_t sequence : 3; - uint8_t state : 3; - uint8_t address : 3; - uint8_t reserved : 8; - uint8_t irq_pause : 2; - uint8_t debug_halt : 2; -} cdog_config_t; - -enum __cdog_debug_Action_ctrl_enum -{ - kCDOG_DebugHaltCtrl_Run = 0x1, - kCDOG_DebugHaltCtrl_Pause = 0x2, -}; - -enum __cdog_irq_pause_ctrl_enum -{ - kCDOG_IrqPauseCtrl_Run = 0x1, - kCDOG_IrqPauseCtrl_Pause = 0x2, -}; - -enum __cdog_fault_ctrl_enum -{ - kCDOG_FaultCtrl_EnableReset = 0x1U, - kCDOG_FaultCtrl_EnableInterrupt = 0x2U, - kCDOG_FaultCtrl_NoAction = 0x4U, -}; - -enum __code_lock_ctrl_enum -{ - kCDOG_LockCtrl_Lock = 0x1, - kCDOG_LockCtrl_Unlock = 0x2, -}; - -typedef uint32_t secure_counter_t; - -#define SC_ADD(add) \ - do \ - { \ - CDOG->ADD = (secure_counter_t)(add); \ - } while (0) - -#define SC_ADD1 \ - do \ - { \ - CDOG->ADD1 = (secure_counter_t)0x1U; \ - } while (0) - -#define SC_ADD16 \ - do \ - { \ - CDOG->ADD16 = (secure_counter_t)0x1U; \ - } while (0) - -#define SC_ADD256 \ - do \ - { \ - CDOG->ADD256 = (secure_counter_t)0x1U; \ - } while (0) - -#define SC_SUB(sub) \ - do \ - { \ - CDOG->SUB = (secure_counter_t)(sub); \ - } while (0) - -#define SC_SUB1 \ - do \ - { \ - CDOG->SUB1 = (secure_counter_t)0x1U; \ - } while (0) - -#define SC_SUB16 \ - do \ - { \ - CDOG->SUB16 = (secure_counter_t)0x1U; \ - } while (0) - -#define SC_SUB256 \ - do \ - { \ - CDOG->SUB256 = (secure_counter_t)0x1U; \ - } while (0) - -#define SC_CHECK(val) \ - do \ - { \ - CDOG->RESTART = (secure_counter_t)val; \ - } while (0) - -/******************************************************************************* - * API - *******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name CDOG Functional Operation - * @{ - */ - -/*! - * @brief Initialize CDOG - * - * This function initializes CDOG block and setting. - * - * @param base CDOG peripheral base address - * @param conf CDOG configuration structure - * @return Status of the init operation - */ -status_t CDOG_Init(CDOG_Type *base, cdog_config_t *conf); - -/*! - * @brief Deinitialize CDOG - * - * This function deinitializes CDOG secure counter. - * - * @param base CDOG peripheral base address - */ -void CDOG_Deinit(CDOG_Type *base); - -/*! - * @brief Sets the default configuration of CDOG - * - * This function initialize CDOG config structure to default values. - * - * @param conf CDOG configuration structure - */ -void CDOG_GetDefaultConfig(cdog_config_t *conf); - -/*! - * @brief Stops secure counter and instruction timer - * - * This function stops instruction timer and secure counter. - * This also change state od CDOG to IDLE. - * - * @param base CDOG peripheral base address - * @param stop expected value which will be compared with value of secure counter - */ -void CDOG_Stop(CDOG_Type *base, uint32_t stop); - -/*! - * @brief Sets secure counter and instruction timer values - * - * This function sets value in RELOAD and START registers - * for instruction timer and secure counter - * - * @param base CDOG peripheral base address - * @param reload reload value - * @param start start value - */ -void CDOG_Start(CDOG_Type *base, uint32_t reload, uint32_t start); - -/*! - * @brief Checks secure counter. - * - * This function compares stop value in handler with secure counter value - * by writting to RELOAD refister. - * - * @param base CDOG peripheral base address - * @param check expected (stop) value - */ -void CDOG_Check(CDOG_Type *base, uint32_t check); - -/*! - * @brief Sets secure counter and instruction timer values - * - * This function sets value in STOP, RELOAD and START registers - * for instruction timer and secure counter. - * - * @param base CDOG peripheral base address - * @param stop expected value which will be compared with value of secure counter - * @param reload reload value for instruction timer - * @param start start value for secure timer - */ -void CDOG_Set(CDOG_Type *base, uint32_t stop, uint32_t reload, uint32_t start); - -/*! - * @brief Add value to secure counter - * - * This function add specified value to secure counter. - * - * @param base CDOG peripheral base address. - * @param add Value to be added. - */ -void CDOG_Add(CDOG_Type *base, uint32_t add); - -/*! - * @brief Add 1 to secure counter - * - * This function add 1 to secure counter. - * - * @param base CDOG peripheral base address. - */ -void CDOG_Add1(CDOG_Type *base); - -/*! - * @brief Add 16 to secure counter - * - * This function add 16 to secure counter. - * - * @param base CDOG peripheral base address. - */ -void CDOG_Add16(CDOG_Type *base); - -/*! - * @brief Add 256 to secure counter - * - * This function add 256 to secure counter. - * - * @param base CDOG peripheral base address. - */ -void CDOG_Add256(CDOG_Type *base); - -/*! - * brief Substract value to secure counter - * - * This function substract specified value to secure counter. - * - * param base CDOG peripheral base address. - * param sub Value to be substracted. - */ -void CDOG_Sub(CDOG_Type *base, uint32_t sub); - -/*! - * @brief Substract 1 from secure counter - * - * This function substract specified 1 from secure counter. - * - * @param base CDOG peripheral base address. - */ -void CDOG_Sub1(CDOG_Type *base); - -/*! - * @brief Substract 16 from secure counter - * - * This function substract specified 16 from secure counter. - * - * @param base CDOG peripheral base address. - */ -void CDOG_Sub16(CDOG_Type *base); - -/*! - * @brief Substract 256 from secure counter - * - * This function substract specified 256 from secure counter. - * - * @param base CDOG peripheral base address. - */ -void CDOG_Sub256(CDOG_Type *base); - -/*! - * @brief Set the CDOG persistent word. - * - * @param base CDOG peripheral base address. - * @param value The value to be written. - */ -void CDOG_WritePersistent(CDOG_Type *base, uint32_t value); - -/*! - * @brief Get the CDOG persistent word. - * - * @param base CDOG peripheral base address. - * @return The persistent word. - */ -uint32_t CDOG_ReadPersistent(CDOG_Type *base); - -/*! @}*/ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @}*/ /* end of group cdog */ - -#endif /* FSL_CDOG_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_clock.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_clock.c deleted file mode 100644 index 00f13896cd5..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_clock.c +++ /dev/null @@ -1,1353 +0,0 @@ -/* - * Copyright 2023, NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_clock.h" -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.clock" -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ -/** External clock rate on the CLKIN pin in Hz. If not used, - set this to 0. Otherwise, set it to the exact rate in Hz this pin is - being driven at. */ -volatile static uint32_t s_Ext_Clk_Freq = 16000000U; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/* Get FRO 12M Clk */ -static uint32_t CLOCK_GetFro12MFreq(void); -/* Get CLK 1M Clk */ -static uint32_t CLOCK_GetClk1MFreq(void); -/* Get HF FRO Clk */ -static uint32_t CLOCK_GetFroHfFreq(void); -/* Get CLK 48M Clk */ -static uint32_t CLOCK_GetClk48MFreq(void); -/* Get CLK 16K Clk */ -static uint32_t CLOCK_GetClk16KFreq(uint8_t id); -/* Get EXT OSC Clk */ -static uint32_t CLOCK_GetExtClkFreq(void); -/* Get Main_Clk */ -uint32_t CLOCK_GetMainClk(void); -/* Get FRO_16K */ -static uint32_t CLOCK_GetFRO16KFreq(void); - -/* Check if DIV is halt */ -static inline bool CLOCK_IsDivHalt(uint32_t div_value) -{ - if (0U != (div_value & (1UL << 30U))) - { - return true; - } - else - { - return false; - } -} - -/******************************************************************************* - * Code - ******************************************************************************/ - -/* Clock Selection for IP */ -/** - * brief Configure the clock selection muxes. - * param connection : Clock to be configured. - * return Nothing - */ -void CLOCK_AttachClk(clock_attach_id_t connection) -{ - const uint32_t reg_offset = CLK_ATTACH_REG_OFFSET(connection); - const uint32_t clk_sel = CLK_ATTACH_CLK_SEL(connection); - - if (kNONE_to_NONE != connection) - { - CLOCK_SetClockSelect((clock_select_name_t)reg_offset, clk_sel); - } -} - -/* Return the actual clock attach id */ -/** - * brief Get the actual clock attach id. - * This fuction uses the offset in input attach id, then it reads the actual source value in - * the register and combine the offset to obtain an actual attach id. - * param connection : Clock attach id to get. - * return Clock source value. - */ -clock_attach_id_t CLOCK_GetClockAttachId(clock_attach_id_t connection) -{ - const uint32_t reg_offset = CLK_ATTACH_REG_OFFSET(connection); - uint32_t actual_sel = 0U; - uint32_t clock_attach_id = 0U; - - if (kNONE_to_NONE == connection) - { - return kNONE_to_NONE; - } - - actual_sel = CLOCK_GetClockSelect((clock_select_name_t)reg_offset); - clock_attach_id = CLK_ATTACH_MUX(reg_offset, actual_sel); - - return (clock_attach_id_t)clock_attach_id; -} - -/* Set the clock selection value */ -void CLOCK_SetClockSelect(clock_select_name_t sel_name, uint32_t value) -{ - volatile uint32_t *pClkCtrl = (volatile uint32_t *)(MRCC0_BASE + (uint32_t)sel_name); - assert(sel_name <= kCLOCK_SelMax); - - if (sel_name == kCLOCK_SelSCGSCS) - { - SCG0->RCCR = (SCG0->RCCR & ~(SCG_RCCR_SCS_MASK)) | SCG_RCCR_SCS(value); - while ((SCG0->CSR & SCG_CSR_SCS_MASK) != SCG_CSR_SCS(value)) - { - } - } - else - { - /* Unlock clock configuration */ - SYSCON->CLKUNLOCK &= ~SYSCON_CLKUNLOCK_UNLOCK_MASK; - - *pClkCtrl = value; - - /* Freeze clock configuration */ - SYSCON->CLKUNLOCK |= SYSCON_CLKUNLOCK_UNLOCK_MASK; - } -} - -/* Get the clock selection value */ -uint32_t CLOCK_GetClockSelect(clock_select_name_t sel_name) -{ - volatile uint32_t *pClkCtrl = (volatile uint32_t *)(MRCC0_BASE + (uint32_t)sel_name); - uint32_t actual_sel = 0U; - assert(sel_name <= kCLOCK_SelMax); - - if (sel_name == kCLOCK_SelSCGSCS) - { - actual_sel = (uint32_t)((SCG0->RCCR & SCG_RCCR_SCS_MASK) >> SCG_RCCR_SCS_SHIFT); - } - else - { - actual_sel = *pClkCtrl; - } - - return actual_sel; -} - -/* Set the clock divider value */ -void CLOCK_SetClockDiv(clock_div_name_t div_name, uint32_t value) -{ - volatile uint32_t *pDivCtrl = (volatile uint32_t *)(MRCC0_BASE + (uint32_t)div_name); - assert(div_name <= kCLOCK_DivMax); - - /* Unlock clock configuration */ - SYSCON->CLKUNLOCK &= ~SYSCON_CLKUNLOCK_UNLOCK_MASK; - - /* halt and reset clock dividers */ - *pDivCtrl = 0x3UL << 29U; - - if (value == 0U) /*!< halt */ - { - *pDivCtrl |= (1UL << 30U); - } - else - { - *pDivCtrl = (value - 1U); - } - - /* Freeze clock configuration */ - SYSCON->CLKUNLOCK |= SYSCON_CLKUNLOCK_UNLOCK_MASK; -} - -/* Get the clock divider value */ -uint32_t CLOCK_GetClockDiv(clock_div_name_t div_name) -{ - volatile uint32_t *pDivCtrl = (volatile uint32_t *)(MRCC0_BASE + (uint32_t)div_name); - assert(div_name <= kCLOCK_DivMax); - - if (((*pDivCtrl) & (1UL << 30U)) != 0U) - { - return 0; - } - else - { - return ((*pDivCtrl & 0xFFU) + 1U); - } -} - -/* Halt the clock divider value */ -void CLOCK_HaltClockDiv(clock_div_name_t div_name) -{ - volatile uint32_t *pDivCtrl = (volatile uint32_t *)(MRCC0_BASE + (uint32_t)div_name); - assert(div_name <= kCLOCK_DivMax); - - /* Unlock clock configuration */ - SYSCON->CLKUNLOCK &= ~SYSCON_CLKUNLOCK_UNLOCK_MASK; - - *pDivCtrl |= (1UL << 30U); - - /* Freeze clock configuration */ - SYSCON->CLKUNLOCK |= SYSCON_CLKUNLOCK_UNLOCK_MASK; -} - -/* Initialize the FROHF to given frequency (48,64,96,192) */ -status_t CLOCK_SetupFROHFClocking(uint32_t iFreq) -{ - uint8_t freq_select = 0x0U; - switch (iFreq) - { - case 48000000U: - freq_select = 1U; - break; - case 64000000U: - freq_select = 3U; - break; - case 96000000U: - freq_select = 5U; - break; - case 192000000U: - freq_select = 7U; - break; - default: - freq_select = 0xFU; - break; - } - - if (0xFU == freq_select) - { - return kStatus_Fail; - } - - /* Set FIRC frequency */ - SCG0->FIRCCFG = SCG_FIRCCFG_FREQ_SEL(freq_select); - - /* Unlock FIRCCSR */ - SCG0->FIRCCSR &= ~SCG_FIRCCSR_LK_MASK; - - /* Enable CLK 48 MHz clock for peripheral use */ - SCG0->FIRCCSR |= SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_MASK; - /* Enable FIRC HF clock for peripheral use */ - SCG0->FIRCCSR |= SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN_MASK; - /* Enable FIRC */ - SCG0->FIRCCSR |= SCG_FIRCCSR_FIRCEN_MASK; - - /* Lock FIRCCSR */ - SCG0->FIRCCSR |= SCG_FIRCCSR_LK_MASK; - - /* Wait for FIRC clock to be valid. */ - while ((SCG0->FIRCCSR & SCG_FIRCCSR_FIRCVLD_MASK) == 0U) - { - } - - return kStatus_Success; -} - -/* Initialize the FRO12M. */ -status_t CLOCK_SetupFRO12MClocking(void) -{ - /* Unlock SIRCCSR */ - SCG0->SIRCCSR &= ~SCG_SIRCCSR_LK_MASK; - - /* Enable FRO12M clock for peripheral use */ - SCG0->SIRCCSR |= SCG_SIRCCSR_SIRC_CLK_PERIPH_EN_MASK; - - /* Lock SIRCCSR */ - SCG0->SIRCCSR |= SCG_SIRCCSR_LK_MASK; - - /* Wait for SIRC clock to be valid. */ - while ((SCG0->SIRCCSR & SCG_SIRCCSR_SIRCVLD_MASK) == 0U) - { - } - - return kStatus_Success; -} - -/*! - * brief Initialize the FRO16K. - * This function turns on FRO16K. - * return returns success or fail status. - */ -status_t CLOCK_SetupFRO16KClocking(uint8_t clk_16k_enable_mask) -{ - VBAT0->FROCTLA |= VBAT_FROCTLA_FRO_EN_MASK; - VBAT0->FROLCKA |= VBAT_FROLCKA_LOCK_MASK; - - /* enable clk_16k output clock to corresponding modules according to the enable_mask. */ - VBAT0->FROCLKE |= VBAT_FROCLKE_CLKE(((uint32_t)clk_16k_enable_mask)); - - return kStatus_Success; -} - -/*! - * brief Initialize the external osc clock to given frequency. - * param iFreq : Desired frequency (must be equal to exact rate in Hz) - * return returns success or fail status. - */ -status_t CLOCK_SetupExtClocking(uint32_t iFreq) -{ - uint8_t range = 0U; - - if ((iFreq >= 8000000U) && (iFreq < 16000000U)) - { - range = 0U; - } - else if ((iFreq >= 16000000U) && (iFreq < 25000000U)) - { - range = 1U; - } - else if ((iFreq >= 25000000U) && (iFreq < 40000000U)) - { - range = 2U; - } - else if ((iFreq >= 40000000U) && (iFreq <= 50000000U)) - { - range = 3U; - } - else - { - return kStatus_InvalidArgument; - } - - /* If configure register is locked, return error. */ - if ((SCG0->SOSCCSR & SCG_SOSCCSR_LK_MASK) != 0U) - { - return kStatus_ReadOnly; - } - - /* De-initializes the SCG SOSC */ - SCG0->SOSCCSR = SCG_SOSCCSR_SOSCERR_MASK; - - /* Select SOSC source (internal crystal oscillator) and Configure SOSC range */ - SCG0->SOSCCFG = SCG_SOSCCFG_EREFS_MASK | SCG_SOSCCFG_RANGE(range); - - /* Unlock SOSCCSR */ - SCG0->SOSCCSR &= ~SCG_SOSCCSR_LK_MASK; - - /* Enable SOSC clock monitor and Enable SOSC */ - SCG0->SOSCCSR |= (SCG_SOSCCSR_SOSCCM_MASK | SCG_SOSCCSR_SOSCEN_MASK); - - /* Wait for SOSC clock to be valid. */ - while ((SCG0->SOSCCSR & SCG_SOSCCSR_SOSCVLD_MASK) == 0U) - { - } - - s_Ext_Clk_Freq = iFreq; - - return kStatus_Success; -} - -/*! - * @brief Initialize the external reference clock to given frequency. - * param iFreq : Desired frequency (must be equal to exact rate in Hz) - * return returns success or fail status. - */ -status_t CLOCK_SetupExtRefClocking(uint32_t iFreq) -{ - - if (iFreq > 50000000U) - { - return kStatus_InvalidArgument; - } - - /* If configure register is locked, return error. */ - if ((SCG0->SOSCCSR & SCG_SOSCCSR_LK_MASK) != 0U) - { - return kStatus_ReadOnly; - } - - /* De-initializes the SCG SOSC */ - SCG0->SOSCCSR = SCG_SOSCCSR_SOSCERR_MASK; - - /* Select SOSC source (external reference clock)*/ - SCG0->SOSCCFG &= ~SCG_SOSCCFG_EREFS_MASK; - - /* Unlock SOSCCSR */ - SCG0->SOSCCSR &= ~SCG_SOSCCSR_LK_MASK; - - /* Enable SOSC clock monitor and Enable SOSC */ - SCG0->SOSCCSR |= (SCG_SOSCCSR_SOSCCM_MASK | SCG_SOSCCSR_SOSCEN_MASK); - - /* Wait for SOSC clock to be valid. */ - while ((SCG0->SOSCCSR & SCG_SOSCCSR_SOSCVLD_MASK) == 0U) - { - } - - s_Ext_Clk_Freq = iFreq; - - return kStatus_Success; -} - -/* Get IP Clk */ -/*! brief Return Frequency of selected clock - * return Frequency of selected clock - */ -uint32_t CLOCK_GetFreq(clock_name_t clockName) -{ - uint32_t freq = 0U; - - switch (clockName) - { - case kCLOCK_MainClk: /* MAIN_CLK */ - freq = CLOCK_GetMainClk(); - break; - case kCLOCK_CoreSysClk: /* Core/system clock(CPU_CLK) */ - freq = CLOCK_GetCoreSysClkFreq(); - break; - case kCLOCK_SYSTEM_CLK: /* AHB clock */ - freq = CLOCK_GetCoreSysClkFreq(); - break; - case kCLOCK_BusClk: /* Bus clock (AHB clock) */ - freq = CLOCK_GetCoreSysClkFreq(); - break; - case kCLOCK_ExtClk: /* External Clock */ - freq = CLOCK_GetExtClkFreq(); - break; - case kCLOCK_FroHf: /* FROHF */ - freq = CLOCK_GetFroHfFreq(); - break; - case kCLOCK_FroHfDiv: /* Divided by FROHF */ - freq = CLOCK_GetFroHfFreq() / ((MRCC0->MRCC_FRO_HF_DIV_CLKDIV & 0xfU) + 1U); - break; - case kCLOCK_Clk48M: /* CLK48M */ - freq = CLOCK_GetClk48MFreq(); - break; - case kCLOCK_Fro12M: /* FRO12M */ - freq = CLOCK_GetFro12MFreq(); - break; - case kCLOCK_Clk1M: /* CLK1M */ - freq = CLOCK_GetClk1MFreq(); - break; - case kCLOCK_Fro16K: /* FRO16K */ - freq = CLOCK_GetFRO16KFreq(); - break; - case kCLOCK_Clk16K0: /* CLK16K[0] */ - freq = CLOCK_GetClk16KFreq(0); - break; - case kCLOCK_Clk16K1: /* CLK16K[1] */ - freq = CLOCK_GetClk16KFreq(1); - break; - case kCLOCK_SLOW_CLK: /* SYSTEM_CLK divided by 4 */ - freq = CLOCK_GetCoreSysClkFreq() >> 2; - break; - default: - freq = 0U; - break; - } - return freq; -} - -/* Get FRO 12M Clk */ -/*! brief Return Frequency of FRO 12MHz - * return Frequency of FRO 12MHz - */ -static uint32_t CLOCK_GetFro12MFreq(void) -{ - return ((SCG0->SIRCCSR & SCG_SIRCCSR_SIRC_CLK_PERIPH_EN_MASK) != 0U) ? 12000000U : 0U; -} - -/* Get CLK 1M Clk */ -/*! brief Return Frequency of CLK 1MHz - * return Frequency of CLK 1MHz - */ -static uint32_t CLOCK_GetClk1MFreq(void) -{ - return 1000000U; -} - -/* Get HF FRO Clk */ -/*! brief Return Frequency of High-Freq output of FRO - * return Frequency of High-Freq output of FRO - */ -static uint32_t CLOCK_GetFroHfFreq(void) -{ - uint32_t freq; - - if (((SCG0->FIRCCSR & SCG_FIRCCSR_FIRCEN_MASK) == 0U) || - ((SCG0->FIRCCSR & SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN_SHIFT) == 0U)) - { - freq = 0U; - } - - switch ((SCG0->FIRCCFG & SCG_FIRCCFG_FREQ_SEL_MASK) >> SCG_FIRCCFG_FREQ_SEL_SHIFT) - { - case 0U: - freq = 36000000U; - break; - case 1U: - freq = 48000000U; - break; - case 2U: - freq = 48000000U; - break; - case 3U: - freq = 64000000U; - break; - case 4U: - freq = 72000000U; - break; - case 5U: - freq = 96000000U; - break; - case 6U: - freq = 144000000U; - break; - case 7U: - freq = 192000000U; - break; - default: - freq = 0U; - break; - } - - return freq; -} - -/* Get CLK 48M Clk */ -/*! brief Return Frequency of CLK 48MHz - * return Frequency of CLK 48MHz - */ -static uint32_t CLOCK_GetClk48MFreq(void) -{ - return (((SCG0->FIRCCSR & SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_MASK) != 0U) || - ((SCG0->FIRCCSR & SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_SHIFT) == 0U)) ? - 48000000U : - 0U; -} - -/*! brief Return Frequency of FRO16K - * return Frequency of FRO_16K - */ -static uint32_t CLOCK_GetFRO16KFreq(void) -{ - return ((VBAT0->FROCTLA & VBAT_FROCTLA_FRO_EN_MASK) != 0U) ? 16000U : 0U; -} -/* Get CLK 16K Clk */ -/*! brief Return Frequency of CLK 16KHz - * return Frequency of CLK 16KHz - */ -static uint32_t CLOCK_GetClk16KFreq(uint8_t id) -{ - return (((VBAT0->FROCTLA & VBAT_FROCTLA_FRO_EN_MASK) != 0U) && - ((VBAT0->FROCLKE & VBAT_FROCLKE_CLKE((((uint32_t)id) << 1U))) != 0U)) ? - 16000U : - 0U; -} - -/* Get EXT OSC Clk */ -/*! brief Return Frequency of External Clock - * return Frequency of External Clock. If no external clock is used returns 0. - */ -static uint32_t CLOCK_GetExtClkFreq(void) -{ - return ((SCG0->SOSCCSR & SCG_SOSCCSR_SOSCVLD_MASK) != 0U) ? s_Ext_Clk_Freq : 0U; -} - -/* Get MAIN Clk */ -/*! brief Return Frequency of Core System - * return Frequency of Core System - */ -uint32_t CLOCK_GetMainClk(void) -{ - uint32_t freq = 0U; - - switch ((SCG0->CSR & SCG_CSR_SCS_MASK) >> SCG_CSR_SCS_SHIFT) - { - case 1U: - freq = CLOCK_GetExtClkFreq(); - break; - case 2U: - freq = CLOCK_GetFro12MFreq(); - break; - case 3U: - freq = CLOCK_GetFroHfFreq(); - break; - case 4U: - freq = CLOCK_GetClk16KFreq(1); - break; - default: - freq = 0U; - break; - } - - return freq; -} - -/*! brief Return Frequency of core - * return Frequency of the core - */ -uint32_t CLOCK_GetCoreSysClkFreq(void) -{ - return CLOCK_GetMainClk() / ((SYSCON->AHBCLKDIV & 0xFFU) + 1U); -} - -/* Get I3C Clk */ -/*! brief Return Frequency of I3C Clock - * return Frequency of I3C Clock - */ -uint32_t CLOCK_GetI3CFClkFreq(void) -{ - uint32_t freq = 0U; - uint32_t clksel = (MRCC0->MRCC_I3C0_FCLK_CLKSEL); - uint32_t clkdiv = (MRCC0->MRCC_I3C0_FCLK_CLKDIV); - - if (true == CLOCK_IsDivHalt(clkdiv)) - { - return 0; - } - - switch (clksel) - { - case 0U: - freq = CLOCK_GetFro12MFreq(); - break; - case 2U: - freq = CLOCK_GetFroHfFreq() / ((MRCC0->MRCC_FRO_HF_DIV_CLKDIV & 0xfU) + 1U); - break; - case 3U: - freq = CLOCK_GetExtClkFreq(); - break; - case 5U: - freq = CLOCK_GetClk1MFreq(); - break; - default: - freq = 0U; - break; - } - - return freq / ((clkdiv & 0xFFU) + 1U); -} - -/* Get CTimer Clk */ -/*! brief Return Frequency of CTimer functional Clock - * return Frequency of CTimer functional Clock - */ -uint32_t CLOCK_GetCTimerClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - uint32_t clksel = 0U; - uint32_t clkdiv = 0U; - - switch (id) - { - case 0U: - clksel = MRCC0->MRCC_CTIMER0_CLKSEL; - clkdiv = MRCC0->MRCC_CTIMER0_CLKDIV; - break; - case 1U: - clksel = MRCC0->MRCC_CTIMER1_CLKSEL; - clkdiv = MRCC0->MRCC_CTIMER1_CLKDIV; - break; - case 2U: - clksel = MRCC0->MRCC_CTIMER2_CLKSEL; - clkdiv = MRCC0->MRCC_CTIMER2_CLKDIV; - break; - case 3U: - clksel = MRCC0->MRCC_CTIMER3_CLKSEL; - clkdiv = MRCC0->MRCC_CTIMER3_CLKDIV; - break; - case 4U: - clksel = MRCC0->MRCC_CTIMER4_CLKSEL; - clkdiv = MRCC0->MRCC_CTIMER4_CLKDIV; - break; - default: - clksel = MRCC0->MRCC_CTIMER0_CLKSEL; - clkdiv = MRCC0->MRCC_CTIMER0_CLKDIV; - break; - } - - if (true == CLOCK_IsDivHalt(clkdiv)) - { - return 0; - } - - switch (clksel) - { - case 0U: - freq = CLOCK_GetFro12MFreq(); - break; - case 1U: - freq = CLOCK_GetFroHfFreq(); - break; - case 3U: - freq = CLOCK_GetExtClkFreq(); - break; - case 4U: - freq = CLOCK_GetClk16KFreq(1); - break; - case 5U: - freq = CLOCK_GetClk1MFreq(); - break; - default: - freq = 0U; - break; - } - - return freq / ((clkdiv & 0xFFU) + 1U); -} - -/* Get LPI2C Clk */ -/*! brief Return Frequency of LPI2C functional Clock - * return Frequency of LPI2C functional Clock - */ -uint32_t CLOCK_GetLpi2cClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - - uint32_t clksel = 0U; - uint32_t clkdiv = 0U; - - switch (id) - { - case 0U: - clksel = MRCC0->MRCC_LPI2C0_CLKSEL; - clkdiv = MRCC0->MRCC_LPI2C0_CLKDIV; - break; - case 1U: - clksel = MRCC0->MRCC_LPI2C1_CLKSEL; - clkdiv = MRCC0->MRCC_LPI2C1_CLKDIV; - break; - case 2U: - clksel = MRCC0->MRCC_LPI2C2_CLKSEL; - clkdiv = MRCC0->MRCC_LPI2C2_CLKDIV; - break; - case 3U: - clksel = MRCC0->MRCC_LPI2C3_CLKSEL; - clkdiv = MRCC0->MRCC_LPI2C3_CLKDIV; - break; - default: - clksel = MRCC0->MRCC_LPI2C0_CLKSEL; - clkdiv = MRCC0->MRCC_LPI2C0_CLKDIV; - break; - } - - if (true == CLOCK_IsDivHalt(clkdiv)) - { - return 0; - } - - switch (clksel) - { - case 0U: - freq = CLOCK_GetFro12MFreq(); - break; - case 2U: - freq = CLOCK_GetFroHfFreq() / ((MRCC0->MRCC_FRO_HF_DIV_CLKDIV & 0xfU) + 1U); - break; - case 3U: - freq = CLOCK_GetExtClkFreq(); - break; - case 5U: - freq = CLOCK_GetClk1MFreq(); - break; - default: - freq = 0U; - break; - } - - return freq / ((clkdiv & 0xFFU) + 1U); -} - -/*! brief Return Frequency of LPSPI Clock - * return Frequency of LPSPI Clock - */ -uint32_t CLOCK_GetLpspiClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - uint32_t clksel = (0U == id) ? (MRCC0->MRCC_LPSPI0_CLKSEL) : (MRCC0->MRCC_LPSPI1_CLKSEL); - uint32_t clkdiv = (0U == id) ? (MRCC0->MRCC_LPSPI0_CLKDIV) : (MRCC0->MRCC_LPSPI1_CLKDIV); - - if (true == CLOCK_IsDivHalt(clkdiv)) - { - return 0; - } - - switch (clksel) - { - case 0U: - freq = CLOCK_GetFro12MFreq(); - break; - case 2U: - freq = CLOCK_GetFroHfFreq() / ((MRCC0->MRCC_FRO_HF_DIV_CLKDIV & 0xfU) + 1U); - break; - case 3U: - freq = CLOCK_GetExtClkFreq(); - break; - case 5U: - freq = CLOCK_GetClk1MFreq(); - break; - default: - freq = 0U; - break; - } - - return freq / ((clkdiv & 0xFFU) + 1U); -} - -/*! brief Return Frequency of LPUART Clock - * return Frequency of LPUART Clock - */ -uint32_t CLOCK_GetLpuartClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - uint32_t clksel = 0U; - uint32_t clkdiv = 0U; - - switch (id) - { - case 0U: - clksel = MRCC0->MRCC_LPUART0_CLKSEL; - clkdiv = MRCC0->MRCC_LPUART0_CLKDIV; - break; - case 1U: - clksel = MRCC0->MRCC_LPUART1_CLKSEL; - clkdiv = MRCC0->MRCC_LPUART1_CLKDIV; - break; - case 2U: - clksel = MRCC0->MRCC_LPUART2_CLKSEL; - clkdiv = MRCC0->MRCC_LPUART2_CLKDIV; - break; - case 3U: - clksel = MRCC0->MRCC_LPUART3_CLKSEL; - clkdiv = MRCC0->MRCC_LPUART3_CLKDIV; - break; - case 4U: - clksel = MRCC0->MRCC_LPUART4_CLKSEL; - clkdiv = MRCC0->MRCC_LPUART4_CLKDIV; - break; - default: - clksel = MRCC0->MRCC_LPUART0_CLKSEL; - clkdiv = MRCC0->MRCC_LPUART0_CLKDIV; - break; - } - if (true == CLOCK_IsDivHalt(clkdiv)) - { - return 0; - } - - switch (clksel) - { - case 0U: - freq = CLOCK_GetFro12MFreq(); - break; - case 2U: - freq = CLOCK_GetFroHfFreq() / ((MRCC0->MRCC_FRO_HF_DIV_CLKDIV & 0xfU) + 1U); - break; - case 3U: - freq = CLOCK_GetExtClkFreq(); - break; - case 4U: - freq = CLOCK_GetClk16KFreq(1); - break; - case 5U: - freq = CLOCK_GetClk1MFreq(); - break; - default: - freq = 0U; - break; - } - - return freq / ((clkdiv & 0xFFU) + 1U); -} - -/*! brief Return Frequency of LPTMR Clock - * return Frequency of LPTMR Clock - */ -uint32_t CLOCK_GetLptmrClkFreq(void) -{ - uint32_t freq = 0U; - uint32_t clksel = (MRCC0->MRCC_LPTMR0_CLKSEL); - uint32_t clkdiv = (MRCC0->MRCC_LPTMR0_CLKDIV); - - if (true == CLOCK_IsDivHalt(clkdiv)) - { - return 0; - } - - switch (clksel) - { - case 0U: - freq = CLOCK_GetFro12MFreq(); - break; - case 2U: - freq = CLOCK_GetFroHfFreq() / ((MRCC0->MRCC_FRO_HF_DIV_CLKDIV & 0xfU) + 1U); - break; - case 3U: - freq = CLOCK_GetExtClkFreq(); - break; - case 5U: - freq = CLOCK_GetClk1MFreq(); - break; - default: - freq = 0U; - break; - } - - return freq / ((clkdiv & 0xFFU) + 1U); -} - -/*! brief Return Frequency of OSTIMER - * return Frequency of OSTIMER Clock - */ -uint32_t CLOCK_GetOstimerClkFreq(void) -{ - uint32_t freq = 0U; - uint32_t clksel = (MRCC0->MRCC_OSTIMER0_CLKSEL); - - switch (clksel) - { - case 0U: - freq = CLOCK_GetClk16KFreq(1); - break; - case 2U: - freq = CLOCK_GetClk1MFreq(); - break; - default: - freq = 0U; - break; - } - - return freq; -} - -/*! brief Return Frequency of Adc Clock - * return Frequency of Adc. - */ -uint32_t CLOCK_GetAdcClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - - uint32_t clksel = (0U == id) ? (MRCC0->MRCC_ADC0_CLKSEL) : (MRCC0->MRCC_ADC1_CLKSEL); - uint32_t clkdiv = (0U == id) ? (MRCC0->MRCC_ADC0_CLKDIV) : (MRCC0->MRCC_ADC1_CLKDIV); - - if (true == CLOCK_IsDivHalt(clkdiv)) - { - return 0; - } - - switch (clksel) - { - case 0U: - freq = CLOCK_GetFro12MFreq(); - break; - case 1U: - freq = CLOCK_GetFroHfFreq(); - break; - case 3U: - freq = CLOCK_GetExtClkFreq(); - break; - case 5U: - freq = CLOCK_GetClk1MFreq(); - break; - default: - freq = 0U; - break; - } - - return freq / ((clkdiv & 0xFFU) + 1U); -} - -/*! brief Return Frequency of Dac Clock - * return Frequency of Dac. - */ -uint32_t CLOCK_GetDacClkFreq(void) -{ - uint32_t freq = 0U; - uint32_t clksel = (MRCC0->MRCC_DAC0_CLKSEL); - uint32_t clkdiv = (MRCC0->MRCC_DAC0_CLKDIV); - - if (true == CLOCK_IsDivHalt(clkdiv)) - { - return 0; - } - - switch (clksel) - { - case 0U: - freq = CLOCK_GetFro12MFreq(); - break; - case 1U: - freq = CLOCK_GetFroHfFreq() / ((MRCC0->MRCC_FRO_HF_DIV_CLKDIV & 0xfU) + 1U); - break; - case 3U: - freq = CLOCK_GetExtClkFreq(); - break; - case 5U: - freq = CLOCK_GetClk1MFreq(); - break; - default: - freq = 0U; - break; - } - - return freq / ((clkdiv & 0xFFU) + 1U); -} - -/*! brief Return Frequency of CMP Function Clock - * return Frequency of CMP Function. - */ -uint32_t CLOCK_GetCmpFClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - uint32_t clksel = (0U == id) ? (MRCC0->MRCC_CMP0_RR_CLKSEL) : (MRCC0->MRCC_CMP1_RR_CLKSEL); - uint32_t clkdiv = (0U == id) ? (MRCC0->MRCC_CMP0_FUNC_CLKDIV) : (MRCC0->MRCC_CMP1_FUNC_CLKDIV); - - if (true == CLOCK_IsDivHalt(clkdiv)) - { - return 0; - } - - switch (clksel) - { - case 0U: - freq = CLOCK_GetFro12MFreq(); - break; - case 2U: - freq = CLOCK_GetFroHfFreq() / ((MRCC0->MRCC_FRO_HF_DIV_CLKDIV & 0xfU) + 1U); - break; - case 3U: - freq = CLOCK_GetExtClkFreq(); - break; - case 5U: - freq = CLOCK_GetClk1MFreq(); - break; - default: - freq = 0U; - break; - } - - return freq / ((clkdiv & 0xFFU) + 1U); -} - -/*! brief Return Frequency of CMP Round Robin Clock - * return Frequency of CMP Round Robin. - */ -uint32_t CLOCK_GetCmpRRClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - uint32_t clksel = (0U == id) ? (MRCC0->MRCC_CMP0_RR_CLKSEL) : (MRCC0->MRCC_CMP1_RR_CLKSEL); - uint32_t clkdiv = (0U == id) ? (MRCC0->MRCC_CMP0_RR_CLKDIV) : (MRCC0->MRCC_CMP1_RR_CLKDIV); - - if (true == CLOCK_IsDivHalt(clkdiv)) - { - return 0; - } - - switch (clksel) - { - case 0U: - freq = CLOCK_GetFro12MFreq(); - break; - case 2U: - freq = CLOCK_GetFroHfFreq() / ((MRCC0->MRCC_FRO_HF_DIV_CLKDIV & 0xfU) + 1U); - break; - case 3U: - freq = CLOCK_GetExtClkFreq(); - break; - case 5U: - freq = CLOCK_GetClk1MFreq(); - break; - default: - freq = 0U; - break; - } - - return freq / ((clkdiv & 0xFFU) + 1U); -} - -/*! brief Return Frequency of Trace Clock - * return Frequency of Trace. - */ -uint32_t CLOCK_GetTraceClkFreq(void) -{ - uint32_t freq = 0U; - uint32_t clksel = (MRCC0->MRCC_DBG_TRACE_CLKSEL); - uint32_t clkdiv = (MRCC0->MRCC_DBG_TRACE_CLKDIV); - - if (true == CLOCK_IsDivHalt(clkdiv)) - { - return 0; - } - - switch (clksel) - { - case 0U: - freq = CLOCK_GetCoreSysClkFreq(); - break; - case 1U: - freq = CLOCK_GetClk1MFreq(); - break; - case 2U: - freq = CLOCK_GetClk16KFreq(1); - break; - default: - freq = 0U; - break; - } - - return freq / ((clkdiv & 0xFFU) + 1U); -} - -/*! brief Return Frequency of CLKOUT Clock - * return Frequency of CLKOUT. - */ -uint32_t CLOCK_GetClkoutClkFreq(void) -{ - uint32_t freq = 0U; - uint32_t clksel = (MRCC0->MRCC_CLKOUT_CLKSEL); - uint32_t clkdiv = (MRCC0->MRCC_CLKOUT_CLKDIV); - - if (true == CLOCK_IsDivHalt(clkdiv)) - { - return 0; - } - - switch (clksel) - { - case 0U: - freq = CLOCK_GetFro12MFreq(); - break; - case 1U: - freq = CLOCK_GetFroHfFreq() / ((MRCC0->MRCC_FRO_HF_DIV_CLKDIV & 0xfU) + 1U); - break; - case 2U: - freq = CLOCK_GetExtClkFreq(); - break; - case 3U: - freq = CLOCK_GetClk16KFreq(1); - break; - case 6U: - freq = CLOCK_GetCoreSysClkFreq() >> 2; - break; - default: - freq = 0U; - break; - } - - return freq / ((clkdiv & 0xFFU) + 1U); -} - -/*! brief Return Frequency of Systick Clock - * return Frequency of Systick. - */ -uint32_t CLOCK_GetSystickClkFreq(void) -{ - uint32_t freq = 0U; - uint32_t clksel = (MRCC0->MRCC_SYSTICK_CLKSEL); - uint32_t clkdiv = (MRCC0->MRCC_SYSTICK_CLKDIV); - - if (true == CLOCK_IsDivHalt(clkdiv)) - { - return 0; - } - - switch (clksel) - { - case 0U: - freq = CLOCK_GetCoreSysClkFreq(); - break; - case 1U: - freq = CLOCK_GetClk1MFreq(); - break; - case 2U: - freq = CLOCK_GetClk16KFreq(1); - break; - default: - freq = 0U; - break; - } - - return freq / ((clkdiv & 0xFFU) + 1U); -} - -/*! brief Return Frequency of Systick Clock - * return Frequency of Systick. - */ -uint32_t CLOCK_GetWwdtClkFreq(void) -{ - uint32_t freq = 0U; - uint32_t clkdiv = (MRCC0->MRCC_WWDT0_CLKDIV); - - if (true == CLOCK_IsDivHalt(clkdiv)) - { - return 0; - } - - freq = CLOCK_GetClk1MFreq(); - - return freq / ((clkdiv & 0xFFU) + 1U); -} - -/*! brief Return Frequency of FLEXIO FCLK - * return Frequency of FLEXIO FCLK. - */ -uint32_t CLOCK_GetFlexioClkFreq(void) -{ - uint32_t freq = 0U; - - uint32_t clksel = MRCC0->MRCC_FLEXIO0_CLKSEL; - uint32_t clkdiv = MRCC0->MRCC_FLEXIO0_CLKDIV; - - if (true == CLOCK_IsDivHalt(clkdiv)) - { - return 0; - } - - switch (clksel) - { - case 0U: - freq = CLOCK_GetFro12MFreq(); - break; - case 1U: - freq = CLOCK_GetFroHfFreq(); - break; - case 3U: - freq = CLOCK_GetExtClkFreq(); - break; - case 5U: - freq = CLOCK_GetClk1MFreq(); - break; - default: - freq = 0U; - break; - } - - return freq / ((clkdiv & 0xFFU) + 1U); -} - -/*! brief Return Frequency of FlexCAN FCLK - * return Frequency of FlexCAN FCLK. - */ -uint32_t CLOCK_GetFlexcanClkFreq(void) -{ - uint32_t freq = 0U; - - uint32_t clksel = MRCC0->MRCC_FLEXCAN0_CLKSEL; - uint32_t clkdiv = MRCC0->MRCC_FLEXCAN0_CLKDIV; - - if (true == CLOCK_IsDivHalt(clkdiv)) - { - return 0; - } - - switch (clksel) - { - case 2U: - freq = CLOCK_GetFroHfFreq() / ((MRCC0->MRCC_FRO_HF_DIV_CLKDIV & 0xfU) + 1U); - break; - case 3U: - freq = CLOCK_GetExtClkFreq(); - break; - default: - freq = 0U; - break; - } - - return freq / ((clkdiv & 0xFFU) + 1U); -} - -/** - * @brief Setup FROHF trim. - * @param config : FROHF trim value - * @return returns success or fail status. - */ -status_t CLOCK_FROHFTrimConfig(firc_trim_config_t config) -{ - SCG0->FIRCTCFG = SCG_FIRCTCFG_TRIMDIV(config.trimDiv) | SCG_FIRCTCFG_TRIMSRC(config.trimSrc); - - if (kSCG_FircTrimNonUpdate == config.trimMode) - { - SCG0->FIRCSTAT = SCG_FIRCSTAT_TRIMFINE(config.trimFine); - } - - /* Set trim mode. */ - SCG0->FIRCCSR = (uint32_t)config.trimMode; - - if ((SCG0->FIRCCSR & SCG_FIRCCSR_FIRCERR_MASK) == SCG_FIRCCSR_FIRCERR_MASK) - { - return (status_t)kStatus_Fail; - } - - return (status_t)kStatus_Success; -} - -/** - * @brief Setup FRO 12M trim. - * @param config : FRO 12M trim value - * @return returns success or fail status. - */ -status_t CLOCK_FRO12MTrimConfig(sirc_trim_config_t config) -{ - SCG0->SIRCTCFG = SCG_SIRCTCFG_TRIMDIV(config.trimDiv) | SCG_SIRCTCFG_TRIMSRC(config.trimSrc); - - if (kSCG_SircTrimNonUpdate == config.trimMode) - { - SCG0->SIRCSTAT = SCG_SIRCSTAT_CCOTRIM(config.cltrim); - SCG0->SIRCSTAT = SCG_SIRCSTAT_CCOTRIM(config.ccotrim); - } - - /* Set trim mode. */ - SCG0->SIRCCSR = (uint32_t)config.trimMode; - - if ((SCG0->SIRCCSR & SCG_SIRCCSR_SIRCERR_MASK) == SCG_SIRCCSR_SIRCERR_MASK) - { - return (status_t)kStatus_Fail; - } - - return (status_t)kStatus_Success; -} - -/*! - * @brief Sets the system OSC monitor mode. - * - * This function sets the system OSC monitor mode. The mode can be disabled, - * it can generate an interrupt when the error is disabled, or reset when the error is detected. - * - * @param mode Monitor mode to set. - */ -void CLOCK_SetSysOscMonitorMode(scg_sosc_monitor_mode_t mode) -{ - uint32_t reg = SCG0->SOSCCSR; - - reg &= ~(SCG_SOSCCSR_SOSCCM_MASK | SCG_SOSCCSR_SOSCCMRE_MASK); - - reg |= (uint32_t)mode; - - SCG0->SOSCCSR = reg; -} - -/*! brief Enable USB FS clock. - * Enable USB Full Speed clock. - */ -bool CLOCK_EnableUsbfsClock(void) -{ - /* Enable USB clock */ - CLOCK_EnableClock(kCLOCK_GateUSB0); - - /* Enable FROHF with 48MHZ if it is disabled */ - if (0U == (SCG0->FIRCCSR & SCG_FIRCCSR_FIRCEN_MASK)) - { - if (kStatus_Success != CLOCK_SetupFROHFClocking(48000000U)) - { - return false; - } - } - - /* Enable CLK_48 MHz clock for peripheral use */ - SCG0->FIRCCSR |= SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_MASK; - - /* Use clk_48M for USB FS */ - CLOCK_AttachClk(kCLK_48M_to_USB0); - - return true; -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_clock.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_clock.h deleted file mode 100644 index 2e43e7fbed8..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_clock.h +++ /dev/null @@ -1,983 +0,0 @@ -/* - * Copyright 2023, NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _FSL_CLOCK_H_ -#define _FSL_CLOCK_H_ - -#include "fsl_common.h" - -/*! @addtogroup clock */ -/*! @{ */ - -/*! @file */ - -/******************************************************************************* - * Definitions - *****************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief CLOCK driver version 1.0.0. */ -#define FSL_CLOCK_DRIVER_VERSION (MAKE_VERSION(1, 0, 0)) -/*@}*/ - -/*! @brief Configure whether driver controls clock - * - * When set to 0, peripheral drivers will enable clock in initialize function - * and disable clock in de-initialize function. When set to 1, peripheral - * driver will not control the clock, application could control the clock out of - * the driver. - * - * @note All drivers share this feature switcher. If it is set to 1, application - * should handle clock enable and disable for all drivers. - */ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)) -#define FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL 0U -#endif - -/* Definition for delay API in clock driver, users can redefine it to the real application. */ -#ifndef SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY -#define SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY (96000000U) -#endif - -/*! @brief Clock gate name used for CLOCK_EnableClock/CLOCK_DisableClock. */ -/*------------------------------------------------------------------------------ - clock_ip_name_t definition: -------------------------------------------------------------------------------*/ -#define CLK_GATE_REG_OFFSET(value) (((uint32_t)(value)) >> 16U) -#define CLK_GATE_BIT_SHIFT(value) (((uint32_t)(value)) & 0x0000FFFFU) - -#define REG_PWM0SUBCTL (250U) -#define REG_PWM1SUBCTL (240U) - -/*! @brief Clock gate name used for CLOCK_EnableClock/CLOCK_DisableClock. */ -typedef enum _clock_ip_name -{ - kCLOCK_InputMux = (0x0000U | (0U)), /*!< Clock gate name: INPUTMUX0 */ - kCLOCK_GateINPUTMUX0 = (0x0000U | (0U)), /*!< Clock gate name: INPUTMUX0 */ - kCLOCK_GateI3C0 = (0x0000U | (1U)), /*!< Clock gate name: I3C0 */ - kCLOCK_GateCTIMER0 = (0x0000U | (2U)), /*!< Clock gate name: CTIMER0 */ - kCLOCK_GateCTIMER1 = (0x0000U | (3U)), /*!< Clock gate name: CTIMER1 */ - kCLOCK_GateCTIMER2 = (0x0000U | (4U)), /*!< Clock gate name: CTIMER2 */ - kCLOCK_GateCTIMER3 = (0x0000U | (5U)), /*!< Clock gate name: CTIMER3 */ - kCLOCK_GateCTIMER4 = (0x0000U | (6U)), /*!< Clock gate name: CTIMER4 */ - kCLOCK_GateFREQME = (0x0000U | (7U)), /*!< Clock gate name: FREQME */ - kCLOCK_GateUTICK0 = (0x0000U | (8U)), /*!< Clock gate name: UTICK0 */ - kCLOCK_GateWWDT0 = (0x0000U | (9U)), /*!< Clock gate name: WWDT0 */ - kCLOCK_GateDMA = (0x0000U | (10U)), /*!< Clock gate name: DMA */ - kCLOCK_GateAOI0 = (0x0000U | (11U)), /*!< Clock gate name: AOI0 */ - kCLOCK_GateCRC0 = (0x0000U | (12U)), /*!< Clock gate name: CRC0 */ - kCLOCK_Crc0 = (0x0000U | (12U)), /*!< Clock gate name: CRC0 */ - kCLOCK_GateEIM0 = (0x0000U | (13U)), /*!< Clock gate name: EIM0 */ - kCLOCK_GateERM0 = (0x0000U | (14U)), /*!< Clock gate name: ERM0 */ - kCLOCK_GateFMC = (0x0000U | (15U)), /*!< Clock gate name: FMC */ - kCLOCK_GateAOI1 = (0x0000U | (16U)), /*!< Clock gate name: AOI1 */ - kCLOCK_GateFLEXIO0 = (0x0000U | (17U)), /*!< Clock gate name: FLEXIO0 */ - kCLOCK_GateLPI2C0 = (0x0000U | (18U)), /*!< Clock gate name: LPI2C0 */ - kCLOCK_GateLPI2C1 = (0x0000U | (19U)), /*!< Clock gate name: LPI2C1 */ - kCLOCK_GateLPSPI0 = (0x0000U | (20U)), /*!< Clock gate name: LPSPI0 */ - kCLOCK_GateLPSPI1 = (0x0000U | (21U)), /*!< Clock gate name: LPSPI1 */ - kCLOCK_GateLPUART0 = (0x0000U | (22U)), /*!< Clock gate name: LPUART0 */ - kCLOCK_GateLPUART1 = (0x0000U | (23U)), /*!< Clock gate name: LPUART1 */ - kCLOCK_GateLPUART2 = (0x0000U | (24U)), /*!< Clock gate name: LPUART2 */ - kCLOCK_GateLPUART3 = (0x0000U | (25U)), /*!< Clock gate name: LPUART3 */ - kCLOCK_GateLPUART4 = (0x0000U | (26U)), /*!< Clock gate name: LPUART4 */ - kCLOCK_GateUSB0 = (0x0000U | (27U)), /*!< Clock gate name: USB0 */ - kCLOCK_GateQDC0 = (0x0000U | (28U)), /*!< Clock gate name: QDC0 */ - kCLOCK_GateQDC1 = (0x0000U | (29U)), /*!< Clock gate name: QDC1 */ - kCLOCK_GateFLEXPWM0 = (0x0000U | (30U)), /*!< Clock gate name: FLEXPWM0 */ - kCLOCK_GateFLEXPWM1 = (0x0000U | (31U)), /*!< Clock gate name: FLEXPWM1 */ - kCLOCK_GateOSTIMER0 = ((0x10U << 16U) | (0U)), /*!< Clock gate name: OSTIMER0 */ - kCLOCK_GateADC0 = ((0x10U << 16U) | (1U)), /*!< Clock gate name: ADC0 */ - kCLOCK_GateADC1 = ((0x10U << 16U) | (2U)), /*!< Clock gate name: ADC1 */ - kCLOCK_GateCMP0 = ((0x10U << 16U) | (3U)), /*!< Clock gate name: CMP0 */ - kCLOCK_GateCMP1 = ((0x10U << 16U) | (4U)), /*!< Clock gate name: CMP1 */ - kCLOCK_GateDAC0 = ((0x10U << 16U) | (5U)), /*!< Clock gate name: DAC0 */ - kCLOCK_GateOPAMP0 = ((0x10U << 16U) | (6U)), /*!< Clock gate name: OPAMP0 */ - kCLOCK_GatePORT0 = ((0x10U << 16U) | (7U)), /*!< Clock gate name: PORT0 */ - kCLOCK_GatePORT1 = ((0x10U << 16U) | (8U)), /*!< Clock gate name: PORT1 */ - kCLOCK_GatePORT2 = ((0x10U << 16U) | (9U)), /*!< Clock gate name: PORT2 */ - kCLOCK_GatePORT3 = ((0x10U << 16U) | (10U)), /*!< Clock gate name: PORT3 */ - kCLOCK_GatePORT4 = ((0x10U << 16U) | (11U)), /*!< Clock gate name: PORT4 */ - kCLOCK_GateFLEXCAN0 = ((0x10U << 16U) | (12U)), /*!< Clock gate name: FLEXCAN0 */ - kCLOCK_GateLPI2C2 = ((0x10U << 16U) | (13U)), /*!< Clock gate name: LPI2C2 */ - kCLOCK_GateLPI2C3 = ((0x10U << 16U) | (14U)), /*!< Clock gate name: LPI2C3 */ - kCLOCK_GateMTR = ((0x10U << 16U) | (16U)), /*!< Clock gate name: MTR */ - kCLOCK_GateTCU = ((0x10U << 16U) | (17U)), /*!< Clock gate name: TCU */ - kCLOCK_GateRAMA = ((0x10U << 16U) | (18U)), /*!< Clock gate name: RAMA */ - kCLOCK_GateRAMB = ((0x10U << 16U) | (19U)), /*!< Clock gate name: RAMB */ - kCLOCK_GateGPIO0 = ((0x10U << 16U) | (20U)), /*!< Clock gate name: GPIO0 */ - kCLOCK_GateGPIO1 = ((0x10U << 16U) | (21U)), /*!< Clock gate name: GPIO1 */ - kCLOCK_GateGPIO2 = ((0x10U << 16U) | (22U)), /*!< Clock gate name: GPIO2 */ - kCLOCK_GateGPIO3 = ((0x10U << 16U) | (23U)), /*!< Clock gate name: GPIO3 */ - kCLOCK_GateGPIO4 = ((0x10U << 16U) | (24U)), /*!< Clock gate name: GPIO4 */ - kCLOCK_GateROMC = ((0x10U << 16U) | (25U)), /*!< Clock gate name: ROMC */ - kCLOCK_GatePWM0SM0 = ((REG_PWM0SUBCTL << 16U) | (0U)), /*!< Clock gate name: FlexPWM0 SM0 */ - kCLOCK_GatePWM0SM1 = ((REG_PWM0SUBCTL << 16U) | (1U)), /*!< Clock gate name: FlexPWM0 SM1 */ - kCLOCK_GatePWM0SM2 = ((REG_PWM0SUBCTL << 16U) | (2U)), /*!< Clock gate name: FlexPWM0 SM2 */ - kCLOCK_GatePWM1SM0 = ((REG_PWM1SUBCTL << 16U) | (0U)), /*!< Clock gate name: FlexPWM1 SM0 */ - kCLOCK_GatePWM1SM1 = ((REG_PWM1SUBCTL << 16U) | (1U)), /*!< Clock gate name: FlexPWM1 SM1 */ - kCLOCK_GatePWM1SM2 = ((REG_PWM1SUBCTL << 16U) | (2U)), /*!< Clock gate name: FlexPWM1 SM2 */ - kCLOCK_GateNotAvail = (0xFFFFFFFFU), /**< Clock gate name: None */ -} clock_ip_name_t; - -/*! @brief Clock ip name array for AOI. */ -#define AOI_CLOCKS \ - { \ - kCLOCK_GateAOI0, kCLOCK_GateAOI1 \ - } -/*! @brief Clock ip name array for CRC. */ -#define CRC_CLOCKS \ - { \ - kCLOCK_GateCRC0 \ - } -/*! @brief Clock ip name array for CTIMER. */ -#define CTIMER_CLOCKS \ - { \ - kCLOCK_GateCTIMER0, kCLOCK_GateCTIMER1, kCLOCK_GateCTIMER2, kCLOCK_GateCTIMER3, kCLOCK_GateCTIMER4 \ - } -/*! @brief Clock ip name array for DAC. */ -#define LPDAC_CLOCKS \ - { \ - kCLOCK_GateDAC0 \ - } -/*! @brief Clock ip name array for DMA. */ -#define DMA_CLOCKS \ - { \ - kCLOCK_GateDMA \ - } -/*! @brief Clock gate name array for EDMA. */ -#define EDMA_CLOCKS \ - { \ - kCLOCK_GateDMA \ - } -/*! @brief Clock ip name array for ERM. */ -#define ERM_CLOCKS \ - { \ - kCLOCK_GateERM0 \ - } -/*! @brief Clock ip name array for EIM. */ -#define EIM_CLOCKS \ - { \ - kCLOCK_GateEIM0 \ - } -/*! @brief Clock ip name array for FLEXCAN. */ -#define FLEXCAN_CLOCKS \ - { \ - kCLOCK_GateFLEXCAN0 \ - } -/*! @brief Clock ip name array for FLEXIO. */ -#define FLEXIO_CLOCKS \ - { \ - kCLOCK_GateFLEXIO0 \ - } -/*! @brief Clock ip name array for FREQME. */ -#define FREQME_CLOCKS \ - { \ - kCLOCK_GateFREQME \ - } -/*! @brief Clock ip name array for GPIO. */ -#define GPIO_CLOCKS \ - { \ - kCLOCK_GateGPIO0, kCLOCK_GateGPIO1, kCLOCK_GateGPIO2, kCLOCK_GateGPIO3, kCLOCK_GateGPIO4 \ - } -/*! @brief Clock ip name array for I3C */ -#define I3C_CLOCKS \ - { \ - kCLOCK_GateI3C0 \ - } -/*! @brief Clock ip name array for INPUTMUX. */ -#define INPUTMUX_CLOCKS \ - { \ - kCLOCK_GateINPUTMUX0 \ - } -/*! @brief Clock ip name array for GPIO. */ -#define LPCMP_CLOCKS \ - { \ - kCLOCK_GateCMP0, kCLOCK_GateCMP1 \ - } -/*! @brief Clock ip name array for LPADC. */ -#define LPADC_CLOCKS \ - { \ - kCLOCK_GateADC0, kCLOCK_GateADC1 \ - } -/*! @brief Clock ip name array for LPUART. */ -#define LPUART_CLOCKS \ - { \ - kCLOCK_GateLPUART0, kCLOCK_GateLPUART1, kCLOCK_GateLPUART2, kCLOCK_GateLPUART3, kCLOCK_GateLPUART4 \ - } -/*! @brief Clock ip name array for LPI2C. */ -#define LPI2C_CLOCKS \ - { \ - kCLOCK_GateLPI2C0, kCLOCK_GateLPI2C1, kCLOCK_GateLPI2C2, kCLOCK_GateLPI2C3 \ - } -/*! @brief Clock ip name array for LSPI. */ -#define LPSPI_CLOCKS \ - { \ - kCLOCK_GateLPSPI0, kCLOCK_GateLPSPI1 \ - } -/*! @brief Clock ip name array for MTR. */ -#define MTR_CLOCKS \ - { \ - kCLOCK_GateMTR \ - } -/*! @brief Clock ip name array for OSTIMER. */ -#define OSTIMER_CLOCKS \ - { \ - kCLOCK_GateOSTIMER0 \ - } -/*! @brief Clock ip name array for DAC. */ -#define OPAMP_CLOCKS \ - { \ - kCLOCK_GateOPAMP0 \ - } -/*! @brief Clock ip name array for PWM. */ -#define PWM_CLOCKS \ - { \ - {kCLOCK_GatePWM0SM0, kCLOCK_GatePWM0SM1, kCLOCK_GatePWM0SM2}, \ - { \ - kCLOCK_GatePWM1SM0, kCLOCK_GatePWM1SM1, kCLOCK_GatePWM1SM2 \ - } \ - } -/*! @brief Clock ip name array for QDC. */ -#define QDC_CLOCKS \ - { \ - kCLOCK_GateQDC0, kCLOCK_GateQDC1 \ - } -/*! @brief Clock ip name array for UTICK. */ -#define UTICK_CLOCKS \ - { \ - kCLOCK_GateUTICK0 \ - } -/*! @brief Clock ip name array for WWDT. */ -#define WWDT_CLOCKS \ - { \ - kCLOCK_GateWWDT0 \ - } - -/*! @brief Peripherals clock source definition. */ -#define BUS_CLK kCLOCK_BusClk - -/*! @brief Clock name used to get clock frequency. */ -typedef enum _clock_name -{ - kCLOCK_MainClk, /*!< MAIN_CLK */ - kCLOCK_CoreSysClk, /*!< Core/system clock(CPU_CLK) */ - kCLOCK_SYSTEM_CLK, /*!< AHB clock */ - kCLOCK_BusClk, /*!< Bus clock (AHB clock) */ - kCLOCK_ExtClk, /*!< External Clock */ - kCLOCK_FroHf, /*!< FRO192 */ - kCLOCK_FroHfDiv, /*!< Divided by FRO192 */ - kCLOCK_Clk48M, /*!< CLK48M */ - kCLOCK_Fro12M, /*!< FRO12M */ - kCLOCK_Clk1M, /*!< CLK1M */ - kCLOCK_Fro16K, /*!< FRO16K */ - kCLOCK_Clk16K0, /*!< CLK16K[0] */ - kCLOCK_Clk16K1, /*!< CLK16K[1] */ - kCLOCK_SLOW_CLK, /*!< SYSTEM_CLK divided by 4 */ -} clock_name_t; - -/*! @brief Clock Mux Switches - * The encoding is as follows each connection identified is 32bits wide while 24bits are valuable - * starting from LSB upwards - * - * [4 bits for choice, 0 means invalid choice] [8 bits mux ID]* - * - */ - -#define CLK_ATTACH_REG_OFFSET(value) (((uint32_t)(value)) >> 16U) -#define CLK_ATTACH_CLK_SEL(value) (((uint32_t)(value)) & 0x0000FFFFU) -#define CLK_ATTACH_MUX(reg, sel) ((((uint32_t)(reg)) << 16U) | (sel)) - -/*! @brief Clock name used to get clock frequency. */ -typedef enum _clock_select_name -{ - kCLOCK_SelI3C0_FCLK = (0x0A0), /*MRCC_GLB_CC0_SET)) + reg_offset); - - if (clk == kCLOCK_GateNotAvail) - { - return; - } - - /* Unlock clock configuration */ - SYSCON->CLKUNLOCK &= ~SYSCON_CLKUNLOCK_UNLOCK_MASK; - - if (reg_offset == REG_PWM0SUBCTL) - { - SYSCON->PWM0SUBCTL |= (1UL << bit_shift); - MRCC0->MRCC_GLB_CC0_SET = MRCC_MRCC_GLB_CC0_FLEXPWM0_MASK; - } - else if (reg_offset == REG_PWM1SUBCTL) - { - SYSCON->PWM1SUBCTL |= (1UL << bit_shift); - MRCC0->MRCC_GLB_CC0_SET = MRCC_MRCC_GLB_CC0_FLEXPWM1_MASK; - } - else - { - *pClkCtrl = (1UL << bit_shift); - } - - /* Freeze clock configuration */ - SYSCON->CLKUNLOCK |= SYSCON_CLKUNLOCK_UNLOCK_MASK; -} - -/** - * @brief Disable the clock for specific IP. - * @param clk : Clock to be Disabled. - * @return Nothing - */ -static inline void CLOCK_DisableClock(clock_ip_name_t clk) -{ - uint32_t reg_offset = CLK_GATE_REG_OFFSET(clk); - uint32_t bit_shift = CLK_GATE_BIT_SHIFT(clk); - volatile uint32_t *pClkCtrl = (volatile uint32_t *)((uint32_t)(&(MRCC0->MRCC_GLB_CC0_CLR)) + reg_offset); - - if (clk == kCLOCK_GateNotAvail) - { - return; - } - - /* Unlock clock configuration */ - SYSCON->CLKUNLOCK &= ~SYSCON_CLKUNLOCK_UNLOCK_MASK; - - if (reg_offset == REG_PWM0SUBCTL) - { - SYSCON->PWM0SUBCTL &= ~(1UL << bit_shift); - - if (0U == (SYSCON->PWM0SUBCTL & 0xFU)) - { - MRCC0->MRCC_GLB_CC0_CLR = MRCC_MRCC_GLB_CC0_FLEXPWM0_MASK; - } - } - else if (reg_offset == REG_PWM1SUBCTL) - { - SYSCON->PWM1SUBCTL &= ~(1UL << bit_shift); - - if (0U == (SYSCON->PWM1SUBCTL & 0xFU)) - { - MRCC0->MRCC_GLB_CC0_CLR = MRCC_MRCC_GLB_CC0_FLEXPWM1_MASK; - } - } - else - { - *pClkCtrl = (1UL << bit_shift); - } - - /* Freeze clock configuration */ - SYSCON->CLKUNLOCK |= SYSCON_CLKUNLOCK_UNLOCK_MASK; -} - -/** - * @brief Configure the clock selection muxes. - * @param connection : Clock to be configured. - * @return Nothing - */ -void CLOCK_AttachClk(clock_attach_id_t connection); - -/** - * @brief Get the actual clock attach id. - * This fuction uses the offset in input attach id, then it reads the actual source value in - * the register and combine the offset to obtain an actual attach id. - * @param connection : Clock attach id to get. - * @return Clock source value. - */ -clock_attach_id_t CLOCK_GetClockAttachId(clock_attach_id_t connection); - -/** - * @brief Set the clock select value. - * This fuction set the peripheral clock select value. - * @param sel_name : Clock select. - * @param value : value to be set. - */ -void CLOCK_SetClockSelect(clock_select_name_t sel_name, uint32_t value); - -/** - * @brief Get the clock select value. - * This fuction get the peripheral clock select value. - * @param sel_name : Clock select. - * @return Clock source value. - */ -uint32_t CLOCK_GetClockSelect(clock_select_name_t sel_name); - -/** - * @brief Setup peripheral clock dividers. - * @param div_name : Clock divider name - * @param value : Value to be divided - * @return Nothing - */ -void CLOCK_SetClockDiv(clock_div_name_t div_name, uint32_t value); - -/** - * @brief Get peripheral clock dividers. - * @param div_name : Clock divider name - * @return peripheral clock dividers - */ -uint32_t CLOCK_GetClockDiv(clock_div_name_t div_name); - -/** - * @brief Halt peripheral clock dividers. - * @param div_name : Clock divider name - * @return Nothing - */ -void CLOCK_HaltClockDiv(clock_div_name_t div_name); - -/** - * @brief Initialize the FROHF to given frequency (48,64,96,192). - * This function turns on FIRC and select the given frequency as the source of fro_hf - * @param iFreq : Desired frequency. - * @return returns success or fail status. - */ -status_t CLOCK_SetupFROHFClocking(uint32_t iFreq); - -/** - * @brief Initialize the FRO12M. - * This function turns on FRO12M. - * @return returns success or fail status. - */ -status_t CLOCK_SetupFRO12MClocking(void); - -/** - * @brief Initialize the FRO16K. - * This function turns on FRO16K. - * @param clk_16k_enable_mask: 0-3 - * 0b00: disable both clk_16k0 and clk_16k1 - * 0b01: only enable clk_16k0 - * 0b10: only enable clk_16k1 - * 0b11: enable both clk_16k0 and clk_16k1 - * @return returns success or fail status. - */ -status_t CLOCK_SetupFRO16KClocking(uint8_t clk_16k_enable_mask); - -/** - * @brief Initialize the external osc clock to given frequency. - * @param iFreq : Desired frequency (must be equal to exact rate in Hz) - * @return returns success or fail status. - */ -status_t CLOCK_SetupExtClocking(uint32_t iFreq); - -/** - * @brief Initialize the external reference clock to given frequency. - * @param iFreq : Desired frequency (must be equal to exact rate in Hz) - * @return returns success or fail status. - */ -status_t CLOCK_SetupExtRefClocking(uint32_t iFreq); - -/*! @brief Return Frequency of selected clock - * @return Frequency of selected clock - */ -uint32_t CLOCK_GetFreq(clock_name_t clockName); - -/*! @brief Return Frequency of core - * @return Frequency of the core - */ -uint32_t CLOCK_GetCoreSysClkFreq(void); - -/*! @brief Return Frequency of I3C FCLK - * @return Frequency of I3C FCLK. - */ -uint32_t CLOCK_GetI3CFClkFreq(void); - -/*! @brief Return Frequency of CTimer functional Clock - * @return Frequency of CTimer functional Clock - */ -uint32_t CLOCK_GetCTimerClkFreq(uint32_t id); - -/*! @brief Return Frequency of LPI2C0 functional Clock - * @return Frequency of LPI2C0 functional Clock - */ -uint32_t CLOCK_GetLpi2cClkFreq(uint32_t id); - -/*! @brief Return Frequency of LPSPI functional Clock - * @return Frequency of LPSPI functional Clock - */ -uint32_t CLOCK_GetLpspiClkFreq(uint32_t id); - -/*! @brief Return Frequency of LPUART functional Clock - * @return Frequency of LPUART functional Clock - */ -uint32_t CLOCK_GetLpuartClkFreq(uint32_t id); - -/*! @brief Return Frequency of LPTMR functional Clock - * @return Frequency of LPTMR functional Clock - */ -uint32_t CLOCK_GetLptmrClkFreq(void); - -/*! @brief Return Frequency of OSTIMER - * @return Frequency of OSTIMER Clock - */ -uint32_t CLOCK_GetOstimerClkFreq(void); - -/*! @brief Return Frequency of Adc Clock - * @return Frequency of Adc. - */ -uint32_t CLOCK_GetAdcClkFreq(uint32_t id); - -/*! @brief Return Frequency of Dac Clock - * @return Frequency of Dac. - */ -uint32_t CLOCK_GetDacClkFreq(void); - -/*! @brief Return Frequency of CMP Function Clock - * @return Frequency of CMP Function. - */ -uint32_t CLOCK_GetCmpFClkFreq(uint32_t id); - -/*! @brief Return Frequency of CMP Round Robin Clock - * @return Frequency of CMP Round Robin. - */ -uint32_t CLOCK_GetCmpRRClkFreq(uint32_t id); - -/*! @brief Return Frequency of Trace Clock - * @return Frequency of Trace. - */ -uint32_t CLOCK_GetTraceClkFreq(void); - -/*! @brief Return Frequency of CLKOUT Clock - * @return Frequency of CLKOUT. - */ -uint32_t CLOCK_GetClkoutClkFreq(void); - -/*! @brief Return Frequency of Systick Clock - * @return Frequency of Systick. - */ -uint32_t CLOCK_GetSystickClkFreq(void); - -/*! brief Return Frequency of Systick Clock - * return Frequency of Systick. - */ -uint32_t CLOCK_GetWwdtClkFreq(void); - -/*! @brief Return Frequency of FLEXIO FCLK - * @return Frequency of FLEXIO FCLK. - */ -uint32_t CLOCK_GetFlexioClkFreq(void); - -/*! @brief Return Frequency of FlexCAN FCLK - * @return Frequency of FlexCAN FCLK. - */ -uint32_t CLOCK_GetFlexcanClkFreq(void); - -/** - * @brief Setup FROHF trim. - * @param config : FROHF trim value - * @return returns success or fail status. - */ -status_t CLOCK_FROHFTrimConfig(firc_trim_config_t config); - -/** - * @brief Setup FRO 12M trim. - * @param config : FRO 12M trim value - * @return returns success or fail status. - */ -status_t CLOCK_FRO12MTrimConfig(sirc_trim_config_t config); - -/*! - * @brief Sets the system OSC monitor mode. - * - * This function sets the system OSC monitor mode. The mode can be disabled, - * it can generate an interrupt when the error is disabled, or reset when the error is detected. - * - * @param mode Monitor mode to set. - */ -void CLOCK_SetSysOscMonitorMode(scg_sosc_monitor_mode_t mode); - -/*! brief Enable USB FS clock. - * Enable USB Full Speed clock. - */ -bool CLOCK_EnableUsbfsClock(void); - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @} */ - -#endif /* _FSL_CLOCK_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_cmc.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_cmc.c deleted file mode 100644 index 4e388d9e73a..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_cmc.c +++ /dev/null @@ -1,310 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#include "fsl_cmc.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.mcx_cmc" -#endif - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ -static uint32_t g_savedPrimask; - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Sets clock mode. - * - * This function configs the amount of clock gating when the core asserts - * Sleeping due to WFI, WFE or SLEEPONEXIT. - * - * param base CMC peripheral base address. - * param mode System clock mode. - */ -void CMC_SetClockMode(CMC_Type *base, cmc_clock_mode_t mode) -{ - uint32_t reg; - - reg = base->CKCTRL; - reg &= ~CMC_CKCTRL_CKMODE_MASK; - reg |= CMC_CKCTRL_CKMODE((mode)); - base->CKCTRL = reg; -} - -/*! - * brief Configures all power mode protection settings. - * - * This function configures the power mode protection settings for - * supported power modes. This should be done before setting the lowPower mode - * for each power doamin. - * - * The allowed lowpower modes are passed as bit map. For example, to allow - * Sleep and DeepSleep, use CMC_SetPowerModeProtection(CMC_base, kCMC_AllowSleepMode|kCMC_AllowDeepSleepMode). - * To allow all low power modes, use CMC_SetPowerModeProtection(CMC_base, kCMC_AllowAllLowPowerModes). - * - * param base CMC peripheral base address. - * param allowedModes Bitmaps of the allowed power modes. - */ -void CMC_SetPowerModeProtection(CMC_Type *base, uint32_t allowedModes) -{ - uint32_t reg; - - reg = base->PMPROT; - reg &= ~0xFUL; - reg |= allowedModes; - - base->PMPROT = reg; -} - -/*! - * brief Configure reset pin. - * - * This function configures reset pin. When enabled, the low power filter is enabled in both - * Active and Low power modes, the reset filter is only enabled in Active mode. When both filers - * are enabled, they operate in series. - * - * param base CMC peripheral base address. - * param config Pointer to the reset pin config structure. - */ -void CMC_ConfigResetPin(CMC_Type *base, const cmc_reset_pin_config_t *config) -{ - assert(config != NULL); - - uint32_t reg = base->RPC; - - if (config->lowpowerFilterEnable) - { - reg |= CMC_RPC_LPFEN_MASK; - } - else - { - reg &= ~CMC_RPC_LPFEN_MASK; - } - if (config->resetFilterEnable) - { - reg |= (CMC_RPC_FILTEN_MASK | CMC_RPC_FILTCFG(config->resetFilterWidth)); - } - else - { - reg &= ~(CMC_RPC_FILTEN_MASK | CMC_RPC_FILTCFG_MASK); - } - base->RPC = reg; -} - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG) && FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG) -/*! - * brief Power off the selected system SRAM always. - * - * This function powers off the selected system SRAM always. The SRAM arrays should - * not be accessed while they are shut down. SRAM array contents are not retained - * if they are powered off. - * - * param base CMC peripheral base address. - * param mask Bitmap of the SRAM arrays to be powered off all modes. - */ -void CMC_PowerOffSRAMAllMode(CMC_Type *base, uint32_t mask) -{ - uint32_t reg = base->SRAMDIS[0]; - uint32_t maskToSet = mask & ((uint32_t)kCMC_AllSramArrays); - - reg &= ~((uint32_t)kCMC_AllSramArrays); - reg |= CMC_SRAMDIS_DIS(maskToSet); - base->SRAMDIS[0] = reg; -} - -/*! - * brief Power off the selected system SRAm during low power mode only. - * - * This function powers off the selected system SRAM only during low power mode. - * SRAM array contents are not retained if they are power off. - * - * param base CMC peripheral base address. - * param mask Bitmap of the SRAM arrays to be power off during low power mode only. - */ -void CMC_PowerOffSRAMLowPowerOnly(CMC_Type *base, uint32_t mask) -{ - uint32_t reg = base->SRAMRET[0]; - uint32_t maskToSet = mask & ((uint32_t)kCMC_AllSramArrays); - - reg &= ~((uint32_t)kCMC_AllSramArrays); - reg |= CMC_SRAMRET_RET(maskToSet); - base->SRAMRET[0] = reg; -} -#endif /* FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG */ - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_NO_FLASHCR_WAKE) && FSL_FEATURE_MCX_CMC_HAS_NO_FLASHCR_WAKE) -/*! - * brief Configs the low power mode of the on-chip flash memory. - * - * This function configs the low power mode of the on-chip flash memory. - * - * param base CMC peripheral base address. - * param doze true: Flash is disabled while core is sleeping - * false: No effect. - * param disable true: Flash memory is placed in low power state. - * false: No effect. - */ -void CMC_ConfigFlashMode(CMC_Type *base, bool doze, bool disable) -{ - uint32_t reg = 0UL; - - reg |= (disable ? CMC_FLASHCR_FLASHDIS(1U) : CMC_FLASHCR_FLASHDIS(0U)) | - (doze ? CMC_FLASHCR_FLASHDOZE(1U) : CMC_FLASHCR_FLASHDOZE(0U)); - base->FLASHCR = reg; -} -#else -/*! - * brief Configs the low power mode of the on-chip flash memory. - * - * This function config the low power mode of the on-chip flash memory. - * - * param base CMC peripheral base address. - * param wake - * true - Flash will exit low power state during the flash memory accesses. - * false - No effect. - * param doze - * true - Flash is disabled while core is sleeping - * false - No effect. - * param disable - * true - Flash memory is placed in low power state. - * false - No effect. - */ -void CMC_ConfigFlashMode(CMC_Type *base, bool wake, bool doze, bool disable) -{ - uint32_t reg = 0UL; - - reg |= (disable ? CMC_FLASHCR_FLASHDIS(1U) : CMC_FLASHCR_FLASHDIS(0U)) | - (doze ? CMC_FLASHCR_FLASHDOZE(1U) : CMC_FLASHCR_FLASHDOZE(0U)) | - (wake ? CMC_FLASHCR_FLASHWAKE(1U) : CMC_FLASHCR_FLASHWAKE(0U)); - base->FLASHCR = reg; -} -#endif /* FSL_FEATURE_MCX_CMC_HAS_NO_FLASHCR_WAKE */ - -/*! - * brief Prepares to enter stop modes. - * - * This function should be called before entering low power modes. - * - */ -void CMC_PreEnterLowPowerMode(void) -{ - g_savedPrimask = DisableGlobalIRQ(); - __ISB(); -} - -/*! - * brief Recovers after wake up from stop modes. - * - * This function should be called after waking up from low power modes. - * This function should be used with CMC_PreEnterLowPowerMode() - * - */ -void CMC_PostExitLowPowerMode(void) -{ - EnableGlobalIRQ(g_savedPrimask); - __ISB(); -} - -/*! - * brief Configs the entry into the same low power mode for each power domains. - * - * This function provides the feature to entry into the same low power mode for each power - * domains. Before invoking this function, please ensure the selected power mode have been allowed. - * - * param base CMC peripheral base address. - * param lowPowerMode The low power mode to be entered. See @ref cmc_low_power_mode_t for the details. - * - */ -void CMC_GlobalEnterLowPowerMode(CMC_Type *base, cmc_low_power_mode_t lowPowerMode) -{ - /* Note: unlock the CKCTRL register if this API will be reinvoked later. */ - CMC_SetClockMode(base, kCMC_GateAllSystemClocksEnterLowPowerMode); - CMC_SetGlobalPowerMode(base, lowPowerMode); - /* Before executing WFI instruction read back the last register to - * ensure all registers writes have completed. */ - (void)base->GPMCTRL; - /* Set the core into DeepSleep mode. */ - SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; - __DSB(); - __WFI(); - __ISB(); -} - -/*! - * brief Configs the entry into different low power modes for each of the power domains. - * - * This function provides the feature to entry into different low power modes for - * each power domains. Before invoking this function please ensure the selected - * modes are allowed. - * - * param base CMC peripheral base address. - * param base config Pointer to the cmc_power_domain_config_t structure. - */ -void CMC_EnterLowPowerMode(CMC_Type *base, const cmc_power_domain_config_t *config) -{ - assert(config != NULL); - -#if (CMC_PMCTRL_COUNT > 1U) - /* The WAKE domain must never be configured to a lower power mode compared with main power mode. */ - assert(config->wake_domain <= config->main_domain); -#endif /* (CMC_PMCTRL_COUNT > 1U) */ - - if (config->clock_mode < kCMC_GateAllSystemClocksEnterLowPowerMode) - { - /* In This case the power domain doesn't need to be placed in low power state. */ - /* Note: unlock the register if this API will be reinvoked later. */ - CMC_SetClockMode(base, config->clock_mode); - - CMC_SetMAINPowerMode(base, kCMC_ActiveOrSleepMode); -#if (CMC_PMCTRL_COUNT > 1U) - CMC_SetWAKEPowerMode(base, kCMC_ActiveOrSleepMode); -#endif /* (CMC_PMCTRL_COUNT > 1U) */ - - /* Before executing WFI instruction read back the last register to - * ensure all registers writes have completed. */ - (void)base->CKCTRL; - SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; - __DSB(); - __WFI(); - __ISB(); - } - else - { - /* Note: unlock the register if this API will be reinvoked later. */ - CMC_SetClockMode(base, kCMC_GateAllSystemClocksEnterLowPowerMode); - CMC_SetMAINPowerMode(base, config->main_domain); -#if (CMC_PMCTRL_COUNT > 1U) - CMC_SetWAKEPowerMode(base, config->wake_domain); -#endif /* (CMC_PMCTRL_COUNT > 1U) */ - - /* Before execute WFI instruction read back the last register to - * ensure all registers writes have completed. */ -#if (CMC_PMCTRL_COUNT > 1U) - if ((CMC_GetWAKEPowerMode(base) == config->wake_domain) && (CMC_GetMAINPowerMode(base) == config->main_domain)) - { -#endif /* (CMC_PMCTRL_COUNT > 1U) */ - SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; - __DSB(); - __WFI(); - __ISB(); -#if (CMC_PMCTRL_COUNT > 1U) - } -#endif /* (CMC_PMCTRL_COUNT > 1U) */ - } -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_cmc.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_cmc.h deleted file mode 100644 index 6dbe8e974bd..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_cmc.h +++ /dev/null @@ -1,929 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_CMC_H_ -#define FSL_CMC_H_ -#include "fsl_common.h" - -/*! - * @addtogroup mcx_cmc - * @{ - */ -/******************************************************************************* - * Definitions - ******************************************************************************/ -/*! @name Driver version */ -/*@{*/ -/*! @brief CMC driver version 2.2.2. */ -#define FSL_CMC_DRIVER_VERSION (MAKE_VERSION(2, 2, 2)) -/* @} */ - -/*! - * @brief CMC power mode Protection enumeration. - */ -enum _cmc_power_mode_protection -{ - kCMC_AllowDeepSleepMode = 0x1UL, /*!< Allow Deep Sleep mode. */ - kCMC_AllowPowerDownMode = 0x2UL, /*!< Allow Power Down mode. */ - kCMC_AllowDeepPowerDownMode = 0x8UL, /*!< Allow Deep Power Down mode. */ - kCMC_AllowAllLowPowerModes = 0xFUL, /*!< Allow Deep Sleep, Power Down, Deep Power Down modes. */ -}; - -/*! - * @brief Wake up sources from the previous low power mode entry. - * - * @note #kCMC_WakeupFromUsbFs, #kCMC_WakeupFromITRC, #kCMC_WakeupFromCpu1 are not supported in MCXA family. - */ -enum _cmc_wakeup_sources -{ - kCMC_WakeupFromResetInterruptOrPowerDown = - CMC_CKSTAT_WAKEUP(1U << 0U), /*!< Wakeup source is reset interrupt, or wake up from Deep Power Down. */ - kCMC_WakeupFromDebugReuqest = CMC_CKSTAT_WAKEUP(1U << 1U), /*!< Wakeup source is debug request. */ - kCMC_WakeupFromInterrupt = CMC_CKSTAT_WAKEUP(1U << 2U), /*!< Wakeup source is interrupt. */ - kCMC_WakeupFromDMAWakeup = CMC_CKSTAT_WAKEUP(1U << 3U), /*!< Wakeup source is DMA Wakeup. */ - kCMC_WakeupFromWUURequest = CMC_CKSTAT_WAKEUP(1U << 4U), /*!< Wakeup source is WUU request. */ - kCMC_WakeupFromUsbFs = CMC_CKSTAT_WAKEUP(1U << 5U), /*!< Wakeup source is USBFS(USB0). */ - kCMC_WakeupFromITRC = CMC_CKSTAT_WAKEUP(1U << 6U), /*!< Wakeup source is ITRC. */ - kCMC_WakeupFromCpu1 = CMC_CKSTAT_WAKEUP(1U << 7U), /*!< Wakeup source is CPU1. */ -}; - -/*! - * @brief System Reset Interrupt enable enumeration. - */ -enum _cmc_system_reset_interrupt_enable -{ - kCMC_PinResetInterruptEnable = CMC_SRIE_PIN_MASK, /*!< Pin Reset interrupt enable. */ - kCMC_DAPResetInterruptEnable = CMC_SRIE_DAP_MASK, /*!< DAP Reset interrupt enable. */ - kCMC_LowPowerAcknowledgeTimeoutResetInterruptEnable = CMC_SRIE_LPACK_MASK, /*!< Low Power Acknowledge Timeout - Reset interrupt enable. */ - kCMC_WindowedWatchdog0ResetInterruptEnable = CMC_SRIE_WWDT0_MASK, /*!< Windowed Watchdog 0 reset - interrupt enable. */ - kCMC_SoftwareResetInterruptEnable = CMC_SRIE_SW_MASK, /*!< Software Reset interrupt enable. */ - kCMC_LockupResetInterruptEnable = CMC_SRIE_LOCKUP_MASK, /*!< Lockup Reset interrupt enable. */ -#if defined(CMC_SRIE_CPU1_MASK) - kCMC_Cpu1ResetInterruptEnable = CMC_SRIE_CPU1_MASK, /*!< CPU1 Reset interrupt enable. */ -#endif /* CMC_SRIE_CPU1_MASK */ -#if defined(CMC_SRIE_ADVC_MASK) - kCMC_AdvcResetInterruptEnable = CMC_SRIE_ADVC_MASK, /*!< ADVC Reset interrupt enable. */ -#endif /* CMC_SRIE_ADVC_MASK */ -#if defined(CMC_SRIE_VBAT_MASK) - kCMC_VBATResetInterruptEnable = CMC_SRIE_VBAT_MASK, /*!< VBAT reset interrupt enable. */ -#endif /* CMC_SRIE_VBAT_MASK */ -#if defined(CMC_SRIE_WWDT1_MASK) - kCMC_WindowedWatchdog1ResetInterruptEnable = CMC_SRIE_WWDT1_MASK, /*!< Windowed Watchdog 1 reset - interrupt enable. */ -#endif /* CMC_SRIE_WWDT1_MASK */ - kCMC_CodeWatchDog0ResetInterruptEnable = CMC_SRIE_CDOG0_MASK, /*!< Code watchdog 0 reset interrupt enable. */ -#if defined(CMC_SRIE_CDOG1_MASK) - kCMC_CodeWatchDog1ResetInterruptEnable = CMC_SRIE_CDOG1_MASK, /*!< Code watchdog 1 reset interrupt enable. */ -#endif /* CMC_SRIE_CDOG1_MASK */ -}; - -/*! - * @brief CMC System Reset Interrupt Status flag. - */ -enum _cmc_system_reset_interrupt_flag -{ - kCMC_PinResetInterruptFlag = CMC_SRIF_PIN_MASK, /*!< Pin Reset interrupt flag. */ - kCMC_DAPResetInterruptFlag = CMC_SRIF_DAP_MASK, /*!< DAP Reset interrupt flag. */ - kCMC_LowPowerAcknowledgeTimeoutResetFlag = CMC_SRIF_LPACK_MASK, /*!< Low Power Acknowledge - Timeout Reset interrupt flag. */ - kCMC_WindowedWatchdog0ResetInterruptFlag = CMC_SRIF_WWDT0_MASK, /*!< Windowned Watchdog 0 Reset interrupt flag. */ - kCMC_SoftwareResetInterruptFlag = CMC_SRIF_SW_MASK, /*!< Software Reset interrupt flag. */ - kCMC_LockupResetInterruptFlag = CMC_SRIF_LOCKUP_MASK, /*!< Lock up Reset interrupt flag. */ -#if defined(CMC_SRIF_CPU1_MASK) - kCMC_Cpu1ResetInterruptFlag = CMC_SRIF_CPU1_MASK, /*!< CPU1 Reset interrupt flag. */ -#endif /* CMC_SRIF_CPU1_MASK */ -#if defined(CMC_SRIF_ADVC_MASK) - kCMC_AdvcResetInterruptFlag = CMC_SRIF_ADVC_MASK, /*!< ADVC Reset interrupt flag. */ -#endif /* CMC_SRIF_ADVC_MASK */ -#if defined(CMC_SRIF_VBAT_MASK) - kCMC_VbatResetInterruptFlag = CMC_SRIF_VBAT_MASK, /*!< VBAT system reset interrupt flag. */ -#endif /* CMC_SRIF_VBAT_MASK */ -#if defined(CMC_SRIF_WWDT1_MASK) - kCMC_WindowedWatchdog1ResetInterruptFlag = CMC_SRIF_WWDT1_MASK, /*!< Windowned Watchdog 1 Reset interrupt flag. */ -#endif /* CMC_SRIF_WWDT1_MASK */ - kCMC_CodeWatchdog0ResetInterruptFlag = CMC_SRIF_CDOG0_MASK, /*!< Code watchdog0 reset interrupt flag. */ -#if defined(CMC_SRIF_CDOG1_MASK) - kCMC_CodeWatchdog1ResetInterruptFlag = CMC_SRIF_CDOG1_MASK, /*!< Code watchdog1 reset interrupt flag. */ -#endif /* CMC_SRIF_CDOG1_MASK */ -}; - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG) && FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG) -/*! - * @brief CMC System SRAM arrays low power mode enable enumeration. - */ -enum _cmc_system_sram_arrays -{ - kCMC_RAMX0 = 1UL << 0UL, /*!< Used to control RAMX0. */ - kCMC_RAMX1 = 1UL << 1UL, /*!< Used to control RAMX1. */ - kCMC_RAMX2 = 1UL << 2UL, /*!< Used to control RAMX2. */ - kCMC_RAMB = 1UL << 3UL, /*!< Used to control RAMB. */ - kCMC_RAMC0 = 1UL << 4UL, /*!< Used to control RAMC0. */ - kCMC_RAMC1 = 1UL << 5UL, /*!< Used to control RAMC1. */ - kCMC_RAMD0 = 1UL << 6UL, /*!< Used to control RAMD0. */ - kCMC_RAMD1 = 1UL << 7UL, /*!< Used to control RAMD1. */ - kCMC_RAME0 = 1UL << 8UL, /*!< Used to control RAME0. */ - kCMC_RAME1 = 1UL << 9UL, /*!< Used to control RAME1. */ - kCMC_RAMF0 = 1UL << 10UL, /*!< Used to control RAMF0. */ - kCMC_RAMF1 = 1UL << 11UL, /*!< Used to control RAMF1. */ - kCMC_RAMG0_RAMG1 = 1UL << 12UL, /*!< Used to control RAMG0 and RAMG1. */ - kCMC_RAMG2_RAMG3 = 1UL << 13UL, /*!< Used to control RAMG2 and RAMG3. */ - kCMC_RAMH0_RAMH1 = 1UL << 14UL, /*!< Used to control RAMH0 and RAMH1. */ - kCMC_LPCAC = 1UL << 24UL, /*!< Used to control LPCAC. */ - kCMC_DMA0_DMA1_PKC = 1UL << 25UL, /*!< Used to control DMA0, DMA1 and PKC. */ - kCMC_USB0 = 1UL << 26UL, /*!< Used to control USB0. */ - kCMC_PQ = 1UL << 27UL, /*!< Used to control PQ. */ - kCMC_CAN0_CAN1_ENET_USB1 = 1UL << 28UL, /*!< Used to control CAN0, CAN1, ENET, USB1. */ - kCMC_FlexSPI = 1UL << 29UL, /*!< Used to control FlexSPI. */ - - kCMC_AllSramArrays = (kCMC_RAMX0 | kCMC_RAMX1 | kCMC_RAMX2 | kCMC_RAMB | kCMC_RAMC0 | kCMC_RAMC1 | kCMC_RAMD0 | - kCMC_RAMD1 | kCMC_RAME0 | kCMC_RAME1 | kCMC_RAMF0 | kCMC_RAMF1 | kCMC_RAMG0_RAMG1 | - kCMC_RAMG2_RAMG3 | kCMC_RAMH0_RAMH1 | kCMC_LPCAC | kCMC_DMA0_DMA1_PKC | kCMC_USB0 | kCMC_PQ | - kCMC_CAN0_CAN1_ENET_USB1 | kCMC_FlexSPI), /*!< Mask of all System SRAM arrays. */ -}; -#endif /* FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG */ - -/*! - * @brief System reset sources enumeration. - */ -enum _cmc_system_reset_sources -{ - kCMC_WakeUpReset = CMC_SRS_WAKEUP_MASK, /*!< The reset caused by a wakeup from Power Down or - Deep Power Down mode. */ - kCMC_PORReset = CMC_SRS_POR_MASK, /*!< The reset caused by power on reset detection logic. */ - kCMC_VDReset = CMC_SRS_VD_MASK, /*!< The reset caused by an LVD or HVD. */ - kCMC_WarmReset = CMC_SRS_WARM_MASK, /*!< The last reset source is a warm reset source. */ - kCMC_FatalReset = CMC_SRS_FATAL_MASK, /*!< The last reset source is a fatal reset source. */ - kCMC_PinReset = CMC_SRS_PIN_MASK, /*!< The reset caused by the RESET_b pin. */ - kCMC_DAPReset = CMC_SRS_DAP_MASK, /*!< The reset caused by a reset request from the Debug Access port. */ - kCMC_ResetTimeout = CMC_SRS_RSTACK_MASK, /*!< The reset caused by a timeout or other error condition in the system - reset generation. */ - kCMC_LowPowerAcknowledgeTimeoutReset = CMC_SRS_LPACK_MASK, /*!< The reset caused by a timeout in - low power mode entry logic. */ - kCMC_SCGReset = CMC_SRS_SCG_MASK, /*!< The reset caused by a loss of clock or loss of lock event in the SCG. */ - kCMC_WindowedWatchdog0Reset = CMC_SRS_WWDT0_MASK, /*!< The reset caused by the Windowed WatchDog 0 timeout. */ - kCMC_SoftwareReset = CMC_SRS_SW_MASK, /*!< The reset caused by a software reset request. */ - kCMC_LockUoReset = CMC_SRS_LOCKUP_MASK, /*!< The reset caused by the ARM core indication of a LOCKUP event. */ -#if defined(CMC_SRS_CPU1_MASK) - kCMC_Cpu1Reset = CMC_SRS_CPU1_MASK, /*!< The reset caused by a CPU1 system reset. */ -#endif /* CMC_SRS_CPU1_MASK */ -#if defined(CMC_SRS_ADVC_MASK) - kCMC_AdvcReset = CMC_SRS_ADVC_MASK, /*!< The reset caused by ADVC critical reset. */ -#endif /* CMC_SRS_ADVC_MASK */ -#if defined(CMC_SRS_VBAT_MASK) - kCMC_VbatReset = CMC_SRS_VBAT_MASK, /*!< The reset caused by a VBAT POR. */ -#endif /* CMC_SRS_VBAT_MASK */ -#if defined(CMC_SRS_WWDT1_MASK) - kCMC_WindowedWatchdog1Reset = CMC_SRS_WWDT1_MASK, /*!< The reset caused by the Windowed WatchDog 1 timeout. */ -#endif /* CMC_SRS_WWDT1_MASK */ - kCMC_CodeWatchDog0Reset = CMC_SRS_CDOG0_MASK, /*!< The reset caused by the code watchdog0 fault. */ -#if defined(CMC_SRS_CDOG1_MASK) - kCMC_CodeWatchDog1Reset = CMC_SRS_CDOG1_MASK, /*!< The reset caused by the code watchdog1 fault. */ -#endif /* CMC_SRS_CDOG1_MASK */ - kCMC_JTAGSystemReset = CMC_SRS_JTAG_MASK, /*!< The reset caused by a JTAG system reset request. */ -#if defined(CMC_SRS_SECVIO_MASK) - kCMC_SecurityViolationReset = CMC_SRS_SECVIO_MASK, /*!< The reset caused by a Security Violation logic. */ -#endif /* CMC_SRS_SECVIO_MASK */ -#if defined(CMC_SRS_TAMPER_MASK) - kCMC_TapmerReset = CMC_SRS_TAMPER_MASK, /*!< The reset caused by the tamper detection logic. */ -#endif /* CMC_SRS_TAMPER_MASK */ -}; - -/*! - * @brief Indicate the core clock was gated. - */ -typedef enum _cmc_core_clock_gate_status -{ - kCMC_CoreClockNotGated = 0U, /*!< Core clock not gated. */ - kCMC_CoreClockGated = 1U /*!< Core clock was gated due to low power mode entry. */ -} cmc_core_clock_gate_status_t; - -/*! - * @brief CMC clock mode enumeration. - */ -typedef enum _cmc_clock_mode -{ - kCMC_GateNoneClock = 0x00U, /*!< No clock gating. */ - kCMC_GateCoreClock = 0x01U, /*!< Gate Core clock. */ - kCMC_GateCorePlatformClock = 0x03U, /*!< Gate Core clock and platform clock. */ - kCMC_GateAllSystemClocks = 0x07U, /*!< Gate all System clocks, without getting core entering into low power mode. */ - kCMC_GateAllSystemClocksEnterLowPowerMode = 0x0FU /*!< Gate all System clocks, with core - entering into low power mode. */ -} cmc_clock_mode_t; - -/*! - * @brief CMC power mode enumeration. - */ -typedef enum _cmc_low_power_mode -{ - kCMC_ActiveOrSleepMode = 0x0U, /*!< Select Active/Sleep mode. */ - kCMC_DeepSleepMode = 0x1U, /*!< Select Deep Sleep mode when a core executes WFI or WFE instruction. */ - kCMC_PowerDownMode = 0x3U, /*!< Select Power Down mode when a core executes WFI or WFE instruction. */ - kCMC_DeepPowerDown = 0xFU, /*!< Select Deep Power Down mode when a core executes WFI or WFE instruction. */ -} cmc_low_power_mode_t; - -/*! - * @brief CMC reset pin configuration. - */ -typedef struct _cmc_reset_pin_config -{ - bool lowpowerFilterEnable; /*!< Low Power Filter enable. */ - bool resetFilterEnable; /*!< Reset Filter enable. */ - uint8_t resetFilterWidth; /*!< Width of the Reset Filter. */ -} cmc_reset_pin_config_t; - -/*! - * @brief power mode configuration for each power domain. - */ -typedef struct _cmc_power_domain_config -{ - cmc_clock_mode_t clock_mode; /*!< Clock mode for each power domain. */ - cmc_low_power_mode_t main_domain; /*!< The low power mode of the MAIN power domain. */ -#if (CMC_PMCTRL_COUNT > 1U) - cmc_low_power_mode_t wake_domain; /*!< The low power mode of the WAKE power domain. */ -#endif /* (CMC_PMCTRL_COUNT > 1U) */ -} cmc_power_domain_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name CLOCK mode configuration. - * @{ - */ - -/*! - * @brief Sets clock mode. - * - * This function configs the amount of clock gating when the core asserts - * Sleeping due to WFI, WFE or SLEEPONEXIT. - * - * @param base CMC peripheral base address. - * @param mode System clock mode. - */ -void CMC_SetClockMode(CMC_Type *base, cmc_clock_mode_t mode); - -/*! - * @brief Locks the clock mode setting. - * - * After invoking this function, any clock mode setting will be blocked. - * - * @param base CMC peripheral base address. - */ -static inline void CMC_LockClockModeSetting(CMC_Type *base) -{ - base->CKCTRL |= CMC_CKCTRL_LOCK_MASK; -} - -/* @} */ - -/*! - * @name Gets/Clears the Clock Mode, the wake up source, the Reset source. - * @{ - */ - -/*! - * @brief Gets the core clock gated status. - * - * This function get the status to indicate whether the core clock is gated. - * The core clock gated status can be cleared by software. - * - * @param base CMC peripheral base address. - * @return The status to indicate whether the core clock is gated. - */ -static inline cmc_core_clock_gate_status_t CMC_GetCoreClockGatedStatus(CMC_Type *base) -{ - return (cmc_core_clock_gate_status_t)(uint32_t)((base->CKSTAT & CMC_CKSTAT_VALID_MASK) >> CMC_CKSTAT_VALID_SHIFT); -} - -/*! - * @brief Clears the core clock gated status. - * - * This function clear clock status flag by software. - * - * @param base CMC peripheral base address. - */ -static inline void CMC_ClearCoreClockGatedStatus(CMC_Type *base) -{ - base->CKSTAT |= CMC_CKSTAT_VALID_MASK; -} - -/*! - * @brief Gets the Wakeup Source. - * - * This function gets the Wakeup sources from the previous low power mode entry. - * - * @param base CMC peripheral base address. - * @return The Wakeup sources from the previous low power mode entry. See @ref _cmc_wakeup_sources for details. - */ -static inline uint8_t CMC_GetWakeupSource(CMC_Type *base) -{ - return ((uint8_t)((base->CKSTAT & CMC_CKSTAT_WAKEUP_MASK) >> CMC_CKSTAT_WAKEUP_SHIFT)); -} - -/*! - * @brief Gets the Clock mode. - * - * This function gets the clock mode of the previous low power mode entry. - * - * @param base CMC peripheral base address. - * @return The Low Power status. - */ -static inline cmc_clock_mode_t CMC_GetClockMode(CMC_Type *base) -{ - return (cmc_clock_mode_t)(uint32_t)((base->CKSTAT & CMC_CKSTAT_CKMODE_MASK) >> CMC_CKSTAT_CKMODE_SHIFT); -} - -/*! - * @brief Gets the System reset status. - * - * This function returns the system reset status. Those status - * updates on every MAIN Warm Reset to indicate the type/source - * of the most recent reset. - * - * @param base CMC peripheral base address. - * @return The most recent system reset status. See @ref _cmc_system_reset_sources for details. - */ -static inline uint32_t CMC_GetSystemResetStatus(CMC_Type *base) -{ - return base->SRS; -} - -/*! - * @brief Gets the sticky system reset status since the last WAKE Cold Reset. - * - * This function gets all source of system reset that have generated a - * system reset since the last WAKE Cold Reset, and that have not been - * cleared by software. - * - * @param base CMC peripheral base address. - * @return System reset status that have not been cleared by software. See @ref _cmc_system_reset_sources for details. - */ -static inline uint32_t CMC_GetStickySystemResetStatus(CMC_Type *base) -{ - return base->SSRS; -} - -/*! - * @brief Clears the sticky system reset status flags. - * - * @param base CMC peripheral base address. - * @param mask Bitmap of the sticky system reset status to be cleared. - */ -static inline void CMC_ClearStickySystemResetStatus(CMC_Type *base, uint32_t mask) -{ - base->SSRS = mask; -} - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_RSTCNT_REG) && FSL_FEATURE_MCX_CMC_HAS_RSTCNT_REG) -/*! - * @brief Gets the number of reset sequences completed since the last Cold Reset. - * - * @param base CMC peripheral base address. - * @return The number of reset sequences. - */ -static inline uint8_t CMC_GetResetCount(CMC_Type *base) -{ - return (uint8_t)(base->RSTCNT & CMC_RSTCNT_COUNT_MASK); -} -#endif /* FSL_FEATURE_MCX_CMC_HAS_RSTCNT_REG */ - -/* @} */ - -/*! - * @name Power mode configuration. - * @{ - */ - -/*! - * @brief Configures all power mode protection settings. - * - * This function configures the power mode protection settings for - * supported power modes. This should be done before set the lowPower mode - * for each power doamin. - * - * The allowed lowpower modes are passed as bit map. For example, to allow - * Sleep and DeepSleep, use CMC_SetPowerModeProtection(CMC_base, kCMC_AllowSleepMode|kCMC_AllowDeepSleepMode). - * To allow all low power modes, use CMC_SetPowerModeProtection(CMC_base, kCMC_AllowAllLowPowerModes). - * - * @param base CMC peripheral base address. - * @param allowedModes Bitmaps of the allowed power modes. See @ref _cmc_power_mode_protection for details. - */ -void CMC_SetPowerModeProtection(CMC_Type *base, uint32_t allowedModes); - -/*! - * @brief Locks the power mode protection. - * - * This function locks the power mode protection. After invoking this function, - * any power mode protection setting will be ignored. - * - * @param base CMC peripheral base address. - */ -static inline void CMC_LockPowerModeProtectionSetting(CMC_Type *base) -{ - base->PMPROT |= CMC_PMPROT_LOCK_MASK; -} - -/*! - * @brief Config the same lowPower mode for all power domain. - * - * This function configures the same low power mode for MAIN power domian and WAKE power domain. - * - * @param base CMC peripheral base address. - * @param lowPowerMode The desired lowPower mode. See @ref cmc_low_power_mode_t for details. - */ -static inline void CMC_SetGlobalPowerMode(CMC_Type *base, cmc_low_power_mode_t lowPowerMode) -{ - base->GPMCTRL = CMC_GPMCTRL_LPMODE((uint8_t)lowPowerMode); -} - -/*! - * @brief Configures entry into low power mode for the MAIN Power domain. - * - * This function configures the low power mode for the MAIN power domian, - * when the core executes WFI/WFE instruction. The available lowPower modes - * are defined in the @ref cmc_low_power_mode_t. - * - * @param base CMC peripheral base address. - * @param lowPowerMode The desired lowPower mode. See @ref cmc_low_power_mode_t for details. - * - */ -static inline void CMC_SetMAINPowerMode(CMC_Type *base, cmc_low_power_mode_t lowPowerMode) -{ - base->PMCTRL[0] = CMC_PMCTRL_LPMODE((uint8_t)lowPowerMode); -} - -/*! - * @brief Gets the power mode of the MAIN Power domain. - * - * @param base CMC peripheral base address. - * @return The power mode of MAIN Power domain. See @ref cmc_low_power_mode_t for details. - */ -static inline cmc_low_power_mode_t CMC_GetMAINPowerMode(CMC_Type *base) -{ - return (cmc_low_power_mode_t)(uint32_t)(base->PMCTRL[0] & CMC_PMCTRL_LPMODE_MASK); -} - -#if (CMC_PMCTRL_COUNT > 1U) -/*! - * @brief Configure entry into low power mode for the WAKE Power domain. - * - * This function configures the low power mode for the WAKE power domian, - * when the core executes WFI/WFE instruction. The available lowPower mode - * are defined in the @ref cmc_low_power_mode_t. - * - * @note The lowPower Mode for the WAKE domain must not be configured to a - * lower power mode than any other power domain. - * - * @param base CMC peripheral base address. - * @param lowPowerMode The desired lowPower mode. See @ref cmc_low_power_mode_t for details. - * - */ -static inline void CMC_SetWAKEPowerMode(CMC_Type *base, cmc_low_power_mode_t lowPowerMode) -{ - base->PMCTRL[1] = CMC_PMCTRL_LPMODE((uint8_t)lowPowerMode); -} - -/*! - * @brief Gets the power mode of the WAKE Power domain. - * - * @param base CMC peripheral base address. - * @return The power mode of WAKE Power domain. See @ref cmc_low_power_mode_t for details. - */ -static inline cmc_low_power_mode_t CMC_GetWAKEPowerMode(CMC_Type *base) -{ - return (cmc_low_power_mode_t)(uint32_t)(base->PMCTRL[1] & CMC_PMCTRL_LPMODE_MASK); -} -#endif /* CMC_PMCTRL_COUNT > 1U */ - -/* @} */ - -/*! - * @name Reset Pin configuration. - * @{ - */ - -/*! - * @brief Configure reset pin. - * - * This function configures reset pin. When enabled, the low power filter is enabled in both - * Active and Low power modes, the reset filter is only enabled in Active mode. When both filers - * are enabled, they operate in series. - * - * @param base CMC peripheral base address. - * @param config Pointer to the reset pin config structure. - */ -void CMC_ConfigResetPin(CMC_Type *base, const cmc_reset_pin_config_t *config); - -/* @} */ - -/*! - * @name System Reset Interrupts. - * @{ - */ - -/*! - * @brief Enable system reset interrupts. - * - * This function enables the system reset interrupts. The assertion of - * non-fatal warm reset can be delayed for 258 cycles of the 32K_CLK clock - * while an enabled interrupt is generated. Then Software can perform a graceful - * shutdown or abort the non-fatal warm reset provided the pending reset source is cleared - * by resetting the reset source and then clearing the pending flag. - * - * @param base CMC peripheral base address. - * @param mask System reset interrupts. See @ref _cmc_system_reset_interrupt_enable for details. - * - */ -static inline void CMC_EnableSystemResetInterrupt(CMC_Type *base, uint32_t mask) -{ - base->SRIE |= mask; -} - -/*! - * @brief Disable system reset interrupts. - * - * This function disables the system reset interrupts. - * - * @param base CMC peripheral base address. - * @param mask System reset interrupts. See @ref _cmc_system_reset_interrupt_enable for details. - */ -static inline void CMC_DisableSystemResetInterrupt(CMC_Type *base, uint32_t mask) -{ - base->SRIE &= (uint32_t)(~mask); -} - -/*! - * @brief Gets System Reset interrupt flags. - * - * This function returns the System reset interrupt flags. - * - * @param base CMC peripheral base address. - * @return System reset interrupt flags. See @ref _cmc_system_reset_interrupt_flag for details. - */ -static inline uint32_t CMC_GetSystemResetInterruptFlags(CMC_Type *base) -{ - return base->SRIF; -} - -/*! - * @brief Clears System Reset interrupt flags. - * - * This function clears system reset interrupt flags. The pending reset source - * can be cleared by resetting the source of the reset and then clearing the pending - * flags. - * - * @param base CMC peripheral base address. - * @param mask System Reset interrupt flags. See @ref _cmc_system_reset_interrupt_flag for details. - * - */ -static inline void CMC_ClearSystemResetInterruptFlags(CMC_Type *base, uint32_t mask) -{ - base->SRIF = mask; -} - -/* @} */ - -/*! - * @name Non Maskable Pin interrupt. - * @{ - */ - -/*! - * @brief Enable/Disable Non maskable Pin interrupt. - * - * @param base CMC peripheral base address. - * @param enable Enable or disable Non maskable pin interrupt. - * true - enable Non-maskable pin interrupt. - * false - disable Non-maskable pin interupt. - */ -static inline void CMC_EnableNonMaskablePinInterrupt(CMC_Type *base, bool enable) -{ - if (enable) - { - base->CORECTL |= CMC_CORECTL_NPIE_MASK; - } - else - { - base->CORECTL &= ~CMC_CORECTL_NPIE_MASK; - } -} - -/* @} */ - -/*! - * @name Boot Configuration. - * @{ - */ - -/*! - * @brief Gets the logic state of the ISPMODE_n pin. - * - * This function returns the logic state of the ISPMODE_n pin - * on the last negation of RESET_b pin. - * - * @param base CMC peripheral base address. - * @return The logic state of the ISPMODE_n pin on the last negation of RESET_b pin. - */ -static inline uint8_t CMC_GetISPMODEPinLogic(CMC_Type *base) -{ - return (uint8_t)((base->MR[0] & CMC_MR_ISPMODE_n_MASK) >> CMC_MR_ISPMODE_n_SHIFT); -} - -/*! - * @brief Clears ISPMODE_n pin state. - * - * @param base CMC peripheral base address. - */ -static inline void CMC_ClearISPMODEPinLogic(CMC_Type *base) -{ - base->MR[0] = CMC_MR_ISPMODE_n_MASK; -} - -/*! - * @brief Set the logic state of the BOOT_CONFIGn pin. - * - * This function force the logic state of the Boot_Confign pin to assert - * on next system reset. - * - * @param base CMC peripheral base address. - * @param assert Assert the corresponding pin or not. - * true - Assert corresponding pin on next system reset. - * false - No effect. - */ -static inline void CMC_ForceBootConfiguration(CMC_Type *base, bool assert) -{ - if (assert) - { - base->FM[0] |= CMC_FM_FORCECFG_MASK; - } - else - { - base->FM[0] &= ~CMC_FM_FORCECFG_MASK; - } -} - -/* @} */ - -/*! - * @name BootROM Status. - * @{ - */ - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_BSR_REG) && FSL_FEATURE_MCX_CMC_HAS_BSR_REG) -/*! - * @brief Gets the status information written by the BootROM. - * - * @param base CMC peripheral base address. - * @return The status information written by the BootROM. - */ -static inline uint32_t CMC_GetBootRomStatus(CMC_Type *base) -{ - return base->BSR; -} - -/*! - * @brief Sets the bootROM status value. - * - * @note This function is useful when result of CMC_CheckBootRomRegisterWrittable() is true. - * - * @param base CMC peripheral base address. - * @param stat The state value to set. - */ -static inline void CMC_SetBootRomStatus(CMC_Type *base, uint32_t statValue) -{ - base->BSR = CMC_BSR_STAT(statValue); -} -#endif /* FSL_FEATURE_MCX_CMC_HAS_BSR_REG */ - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_BLR_REG) && FSL_FEATURE_MCX_CMC_HAS_BLR_REG) -/*! - * @brief Check if BootROM status and lock registers is writtable. - * - * @param base CMC peripheral base address. - * @return The result of whether BootROM status and lock register is writtable. - * - \b true BootROM status and lock registers are writtable; - * - \b false BootROM status and lock registers are not writtable. - */ -static inline bool CMC_CheckBootRomRegisterWrittable(CMC_Type *base) -{ - return (base->BLR == 0x2UL); -} - -/*! - * @brief After invoking this function, BootROM status and lock registers cannot be written. - * - * @param base CMC peripheral base address. - */ -static inline void CMC_LockBootRomStatusWritten(CMC_Type *base) -{ - base->BLR = CMC_BLR_LOCK(0x5U); -} - -/*! - * @brief After invoking this function, BootROM status and lock register can be written.s - * - * @param base - */ -static inline void CMC_UnlockBootRomStatusWritten(CMC_Type *base) -{ - base->BLR = CMC_BLR_LOCK(0x2U); -} -#endif /* FSL_FEATURE_MCX_CMC_HAS_BLR_REG */ - -/* @} */ - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG) && FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG) -/*! - * @name System SRAM Configuration. - * @{ - */ - -/*! - * @brief Power off the selected system SRAM always. - * - * @note This function power off the selected system SRAM always. The SRAM arrays should - * not be accessed while they are shut down. SRAM array contents are not retained - * if they are powered off. - * - * @note Once invoked, the previous settings will be overwritten. - * - * @param base CMC peripheral base address. - * @param mask Bitmap of the SRAM arrays to be powered off all modes. - * See @ref _cmc_system_sram_arrays for details. - * Check Reference Manual for the SRAM region and mask bit relationship. - */ -void CMC_PowerOffSRAMAllMode(CMC_Type *base, uint32_t mask); - -/*! - * @brief Power on SRAM during all mode. - * - * @note Once invoked, the previous settings will be overwritten. - * - * @param base CMC peripheral base address. - * @param mask Bitmap of the SRAM arrays to be powered on all modes. - * See @ref _cmc_system_sram_arrays for details. - * Check Reference Manual for the SRAM region and mask bit relationship. - */ -static inline void CMC_PowerOnSRAMAllMode(CMC_Type *base, uint32_t mask) -{ - base->SRAMDIS[0] &= CMC_SRAMDIS_DIS((uint32_t)(~mask)); -} - -/*! - * @brief Power off the selected system SRAM during low power modes only. - * - * This function power off the selected system SRAM only during low power mode. - * SRAM array contents are not retained if they are power off. - * - * @param base CMC peripheral base address. - * @param mask Bitmap of the SRAM arrays to be power off during low power mode only. - * See @ref _cmc_system_sram_arrays for details. - * Check Reference Manual for the SRAM region and mask bit relationship. - */ -void CMC_PowerOffSRAMLowPowerOnly(CMC_Type *base, uint32_t mask); - -/*! - * @brief Power on the selected system SRAM during low power modes only. - * - * This function power on the selected system SRAM. The SRAM arrray contents are - * retained in low power modes. - * - * @param base CMC peripheral base address. - * @param mask Bitmap of the SRAM arrays to be power on during low power mode only. - * See @ref _cmc_system_sram_arrays for details. - * Check Reference Manual for the SRAM region and mask bit relationship. - */ -static inline void CMC_PowerOnSRAMLowPowerOnly(CMC_Type *base, uint32_t mask) -{ - base->SRAMRET[0] &= CMC_SRAMRET_RET((uint32_t)(~mask)); -} - -/* @} */ -#endif /* FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG */ - -/*! - * @name Flash Low Power Mode configuration. - * @{ - */ - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_NO_FLASHCR_WAKE) && FSL_FEATURE_MCX_CMC_HAS_NO_FLASHCR_WAKE) -/*! - * @brief Configs the low power mode of the on-chip flash memory. - * - * This function configs the low power mode of the on-chip flash memory. - * - * @param base CMC peripheral base address. - * @param doze true: Flash is disabled while core is sleeping - * false: No effect. - * @param disable true: Flash memory is placed in low power state. - * false: No effect. - */ -void CMC_ConfigFlashMode(CMC_Type *base, bool doze, bool disable); -#else -/*! - * @brief Configs the low power mode of the on-chip flash memory. - * - * This function configs the low power mode of the on-chip flash memory. - * - * @param base CMC peripheral base address. - * @param wake true: Flash will exit low power state during the flash memory accesses. - * false: No effect. - * @param doze true: Flash is disabled while core is sleeping - * false: No effect. - * @param disable true: Flash memory is placed in low power state. - * false: No effect. - */ -void CMC_ConfigFlashMode(CMC_Type *base, bool wake, bool doze, bool disable); -#endif /* FSL_FEATURE_MCX_CMC_HAS_NO_FLASHCR_WAKE */ -/* @} */ - -/*! - * @name Debug Configuration. - */ - -/*! - * @brief Enables/Disables debug Operation when the core sleep. - * - * This function configs what happens to debug when core sleeps. - * - * @param base CMC peripheral base address. - * @param enable Enable or disable Debug when Core is sleeping. - * true - Debug remains enabled when the core is sleeping. - * false - Debug is disabled when the core is sleeping. - */ -static inline void CMC_EnableDebugOperation(CMC_Type *base, bool enable) -{ - if (enable) - { - base->DBGCTL &= ~CMC_DBGCTL_SOD_MASK; - } - else - { - base->DBGCTL |= CMC_DBGCTL_SOD_MASK; - } -} - -/* @} */ - -/*! - * @name Low Power modes enter. - * @{ - */ -/*! - * @brief Prepares to enter low power modes. - * - * This function should be called before entering low power modes. - * - */ -void CMC_PreEnterLowPowerMode(void); - -/*! - * @brief Recovers after wake up from low power modes. - * - * This function should be called after wake up from low power modes. - * This function should be used with CMC_PreEnterLowPowerMode() - * - */ -void CMC_PostExitLowPowerMode(void); - -/*! - * @brief Configs the entry into the same low power mode for each power domains. - * - * This function provides the feature to entry into the same low power mode for each power - * domains. Before invoking this function, please ensure the selected power mode have been allowed. - * - * @param base CMC peripheral base address. - * @param lowPowerMode The low power mode to be entered. See @ref cmc_low_power_mode_t for the details. - * - */ -void CMC_GlobalEnterLowPowerMode(CMC_Type *base, cmc_low_power_mode_t lowPowerMode); - -/*! - * @brief Configs the entry into different low power modes for each power domains. - * - * This function provides the feature to entry into different low power modes for - * each power domains. Before invoking this function please ensure the selected - * modes are allowed. - * - * @param base CMC peripheral base address. - * @param config Pointer to the cmc_power_domain_config_t structure. - */ -void CMC_EnterLowPowerMode(CMC_Type *base, const cmc_power_domain_config_t *config); - -/* @} */ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @}*/ -#endif /* FSL_CMC_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_common.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_common.c deleted file mode 100644 index d3af9fdfc67..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_common.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_common.h" - -#define SDK_MEM_MAGIC_NUMBER 12345U - -typedef struct _mem_align_control_block -{ - uint16_t identifier; /*!< Identifier for the memory control block. */ - uint16_t offset; /*!< offset from aligned address to real address */ -} mem_align_cb_t; - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.common" -#endif - -#if !((defined(__DSC__) && defined(__CW__))) -void *SDK_Malloc(size_t size, size_t alignbytes) -{ - mem_align_cb_t *p_cb = NULL; - uint32_t alignedsize; - - /* Check overflow. */ - alignedsize = (uint32_t)(unsigned int)SDK_SIZEALIGN(size, alignbytes); - if (alignedsize < size) - { - return NULL; - } - - if (alignedsize > SIZE_MAX - alignbytes - sizeof(mem_align_cb_t)) - { - return NULL; - } - - alignedsize += alignbytes + (uint32_t)sizeof(mem_align_cb_t); - - union - { - void *pointer_value; - uintptr_t unsigned_value; - } p_align_addr, p_addr; - - p_addr.pointer_value = malloc((size_t)alignedsize); - - if (p_addr.pointer_value == NULL) - { - return NULL; - } - - p_align_addr.unsigned_value = SDK_SIZEALIGN(p_addr.unsigned_value + sizeof(mem_align_cb_t), alignbytes); - - p_cb = (mem_align_cb_t *)(p_align_addr.unsigned_value - 4U); - p_cb->identifier = SDK_MEM_MAGIC_NUMBER; - p_cb->offset = (uint16_t)(p_align_addr.unsigned_value - p_addr.unsigned_value); - - return p_align_addr.pointer_value; -} - -void SDK_Free(void *ptr) -{ - union - { - void *pointer_value; - uintptr_t unsigned_value; - } p_free; - p_free.pointer_value = ptr; - mem_align_cb_t *p_cb = (mem_align_cb_t *)(p_free.unsigned_value - 4U); - - if (p_cb->identifier != SDK_MEM_MAGIC_NUMBER) - { - return; - } - - p_free.unsigned_value = p_free.unsigned_value - p_cb->offset; - - free(p_free.pointer_value); -} -#endif diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_common.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_common.h deleted file mode 100644 index e6d5cce7190..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_common.h +++ /dev/null @@ -1,345 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_COMMON_H_ -#define FSL_COMMON_H_ - -#include -#include -#include -#include -#include - -#if defined(__ICCARM__) || (defined(__CC_ARM) || defined(__ARMCC_VERSION)) || defined(__GNUC__) -#include -#endif - -#include "fsl_device_registers.h" - -/*! - * @addtogroup ksdk_common - * @{ - */ - -/******************************************************************************* - * Configurations - ******************************************************************************/ - -/*! @brief Macro to use the default weak IRQ handler in drivers. */ -#ifndef FSL_DRIVER_TRANSFER_DOUBLE_WEAK_IRQ -#define FSL_DRIVER_TRANSFER_DOUBLE_WEAK_IRQ 1 -#endif - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @brief Construct a status code value from a group and code number. */ -#define MAKE_STATUS(group, code) ((((group)*100L) + (code))) - -/*! @brief Construct the version number for drivers. - * - * The driver version is a 32-bit number, for both 32-bit platforms(such as Cortex M) - * and 16-bit platforms(such as DSC). - * - * @verbatim - - | Unused || Major Version || Minor Version || Bug Fix | - 31 25 24 17 16 9 8 0 - - @endverbatim - */ -#define MAKE_VERSION(major, minor, bugfix) (((major)*65536L) + ((minor)*256L) + (bugfix)) - -/*! @name Driver version */ -/*! @{ */ -/*! @brief common driver version. */ -#define FSL_COMMON_DRIVER_VERSION (MAKE_VERSION(2, 4, 1)) -/*! @} */ - -/*! @name Debug console type definition. */ -/*! @{ */ -#define DEBUG_CONSOLE_DEVICE_TYPE_NONE 0U /*!< No debug console. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_UART 1U /*!< Debug console based on UART. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_LPUART 2U /*!< Debug console based on LPUART. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_LPSCI 3U /*!< Debug console based on LPSCI. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_USBCDC 4U /*!< Debug console based on USBCDC. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_FLEXCOMM 5U /*!< Debug console based on FLEXCOMM. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_IUART 6U /*!< Debug console based on i.MX UART. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_VUSART 7U /*!< Debug console based on LPC_VUSART. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_MINI_USART 8U /*!< Debug console based on LPC_USART. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_SWO 9U /*!< Debug console based on SWO. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_QSCI 10U /*!< Debug console based on QSCI. */ -/*! @} */ - -/*! @brief Status group numbers. */ -enum _status_groups -{ - kStatusGroup_Generic = 0, /*!< Group number for generic status codes. */ - kStatusGroup_FLASH = 1, /*!< Group number for FLASH status codes. */ - kStatusGroup_LPSPI = 4, /*!< Group number for LPSPI status codes. */ - kStatusGroup_FLEXIO_SPI = 5, /*!< Group number for FLEXIO SPI status codes. */ - kStatusGroup_DSPI = 6, /*!< Group number for DSPI status codes. */ - kStatusGroup_FLEXIO_UART = 7, /*!< Group number for FLEXIO UART status codes. */ - kStatusGroup_FLEXIO_I2C = 8, /*!< Group number for FLEXIO I2C status codes. */ - kStatusGroup_LPI2C = 9, /*!< Group number for LPI2C status codes. */ - kStatusGroup_UART = 10, /*!< Group number for UART status codes. */ - kStatusGroup_I2C = 11, /*!< Group number for UART status codes. */ - kStatusGroup_LPSCI = 12, /*!< Group number for LPSCI status codes. */ - kStatusGroup_LPUART = 13, /*!< Group number for LPUART status codes. */ - kStatusGroup_SPI = 14, /*!< Group number for SPI status code.*/ - kStatusGroup_XRDC = 15, /*!< Group number for XRDC status code.*/ - kStatusGroup_SEMA42 = 16, /*!< Group number for SEMA42 status code.*/ - kStatusGroup_SDHC = 17, /*!< Group number for SDHC status code */ - kStatusGroup_SDMMC = 18, /*!< Group number for SDMMC status code */ - kStatusGroup_SAI = 19, /*!< Group number for SAI status code */ - kStatusGroup_MCG = 20, /*!< Group number for MCG status codes. */ - kStatusGroup_SCG = 21, /*!< Group number for SCG status codes. */ - kStatusGroup_SDSPI = 22, /*!< Group number for SDSPI status codes. */ - kStatusGroup_FLEXIO_I2S = 23, /*!< Group number for FLEXIO I2S status codes */ - kStatusGroup_FLEXIO_MCULCD = 24, /*!< Group number for FLEXIO LCD status codes */ - kStatusGroup_FLASHIAP = 25, /*!< Group number for FLASHIAP status codes */ - kStatusGroup_FLEXCOMM_I2C = 26, /*!< Group number for FLEXCOMM I2C status codes */ - kStatusGroup_I2S = 27, /*!< Group number for I2S status codes */ - kStatusGroup_IUART = 28, /*!< Group number for IUART status codes */ - kStatusGroup_CSI = 29, /*!< Group number for CSI status codes */ - kStatusGroup_MIPI_DSI = 30, /*!< Group number for MIPI DSI status codes */ - kStatusGroup_SDRAMC = 35, /*!< Group number for SDRAMC status codes. */ - kStatusGroup_POWER = 39, /*!< Group number for POWER status codes. */ - kStatusGroup_ENET = 40, /*!< Group number for ENET status codes. */ - kStatusGroup_PHY = 41, /*!< Group number for PHY status codes. */ - kStatusGroup_TRGMUX = 42, /*!< Group number for TRGMUX status codes. */ - kStatusGroup_SMARTCARD = 43, /*!< Group number for SMARTCARD status codes. */ - kStatusGroup_LMEM = 44, /*!< Group number for LMEM status codes. */ - kStatusGroup_QSPI = 45, /*!< Group number for QSPI status codes. */ - kStatusGroup_DMA = 50, /*!< Group number for DMA status codes. */ - kStatusGroup_EDMA = 51, /*!< Group number for EDMA status codes. */ - kStatusGroup_DMAMGR = 52, /*!< Group number for DMAMGR status codes. */ - kStatusGroup_FLEXCAN = 53, /*!< Group number for FlexCAN status codes. */ - kStatusGroup_LTC = 54, /*!< Group number for LTC status codes. */ - kStatusGroup_FLEXIO_CAMERA = 55, /*!< Group number for FLEXIO CAMERA status codes. */ - kStatusGroup_LPC_SPI = 56, /*!< Group number for LPC_SPI status codes. */ - kStatusGroup_LPC_USART = 57, /*!< Group number for LPC_USART status codes. */ - kStatusGroup_DMIC = 58, /*!< Group number for DMIC status codes. */ - kStatusGroup_SDIF = 59, /*!< Group number for SDIF status codes.*/ - kStatusGroup_SPIFI = 60, /*!< Group number for SPIFI status codes. */ - kStatusGroup_OTP = 61, /*!< Group number for OTP status codes. */ - kStatusGroup_MCAN = 62, /*!< Group number for MCAN status codes. */ - kStatusGroup_CAAM = 63, /*!< Group number for CAAM status codes. */ - kStatusGroup_ECSPI = 64, /*!< Group number for ECSPI status codes. */ - kStatusGroup_USDHC = 65, /*!< Group number for USDHC status codes.*/ - kStatusGroup_LPC_I2C = 66, /*!< Group number for LPC_I2C status codes.*/ - kStatusGroup_DCP = 67, /*!< Group number for DCP status codes.*/ - kStatusGroup_MSCAN = 68, /*!< Group number for MSCAN status codes.*/ - kStatusGroup_ESAI = 69, /*!< Group number for ESAI status codes. */ - kStatusGroup_FLEXSPI = 70, /*!< Group number for FLEXSPI status codes. */ - kStatusGroup_MMDC = 71, /*!< Group number for MMDC status codes. */ - kStatusGroup_PDM = 72, /*!< Group number for MIC status codes. */ - kStatusGroup_SDMA = 73, /*!< Group number for SDMA status codes. */ - kStatusGroup_ICS = 74, /*!< Group number for ICS status codes. */ - kStatusGroup_SPDIF = 75, /*!< Group number for SPDIF status codes. */ - kStatusGroup_LPC_MINISPI = 76, /*!< Group number for LPC_MINISPI status codes. */ - kStatusGroup_HASHCRYPT = 77, /*!< Group number for Hashcrypt status codes */ - kStatusGroup_LPC_SPI_SSP = 78, /*!< Group number for LPC_SPI_SSP status codes. */ - kStatusGroup_I3C = 79, /*!< Group number for I3C status codes */ - kStatusGroup_LPC_I2C_1 = 97, /*!< Group number for LPC_I2C_1 status codes. */ - kStatusGroup_NOTIFIER = 98, /*!< Group number for NOTIFIER status codes. */ - kStatusGroup_DebugConsole = 99, /*!< Group number for debug console status codes. */ - kStatusGroup_SEMC = 100, /*!< Group number for SEMC status codes. */ - kStatusGroup_ApplicationRangeStart = 101, /*!< Starting number for application groups. */ - kStatusGroup_IAP = 102, /*!< Group number for IAP status codes */ - kStatusGroup_SFA = 103, /*!< Group number for SFA status codes*/ - kStatusGroup_SPC = 104, /*!< Group number for SPC status codes. */ - kStatusGroup_PUF = 105, /*!< Group number for PUF status codes. */ - kStatusGroup_TOUCH_PANEL = 106, /*!< Group number for touch panel status codes */ - kStatusGroup_VBAT = 107, /*!< Group number for VBAT status codes */ - kStatusGroup_XSPI = 108, /*!< Group number for XSPI status codes */ - kStatusGroup_PNGDEC = 109, /*!< Group number for PNGDEC status codes */ - kStatusGroup_JPEGDEC = 110, /*!< Group number for JPEGDEC status codes */ - - kStatusGroup_HAL_GPIO = 121, /*!< Group number for HAL GPIO status codes. */ - kStatusGroup_HAL_UART = 122, /*!< Group number for HAL UART status codes. */ - kStatusGroup_HAL_TIMER = 123, /*!< Group number for HAL TIMER status codes. */ - kStatusGroup_HAL_SPI = 124, /*!< Group number for HAL SPI status codes. */ - kStatusGroup_HAL_I2C = 125, /*!< Group number for HAL I2C status codes. */ - kStatusGroup_HAL_FLASH = 126, /*!< Group number for HAL FLASH status codes. */ - kStatusGroup_HAL_PWM = 127, /*!< Group number for HAL PWM status codes. */ - kStatusGroup_HAL_RNG = 128, /*!< Group number for HAL RNG status codes. */ - kStatusGroup_HAL_I2S = 129, /*!< Group number for HAL I2S status codes. */ - kStatusGroup_HAL_ADC_SENSOR = 130, /*!< Group number for HAL ADC SENSOR status codes. */ - kStatusGroup_TIMERMANAGER = 135, /*!< Group number for TiMER MANAGER status codes. */ - kStatusGroup_SERIALMANAGER = 136, /*!< Group number for SERIAL MANAGER status codes. */ - kStatusGroup_LED = 137, /*!< Group number for LED status codes. */ - kStatusGroup_BUTTON = 138, /*!< Group number for BUTTON status codes. */ - kStatusGroup_EXTERN_EEPROM = 139, /*!< Group number for EXTERN EEPROM status codes. */ - kStatusGroup_SHELL = 140, /*!< Group number for SHELL status codes. */ - kStatusGroup_MEM_MANAGER = 141, /*!< Group number for MEM MANAGER status codes. */ - kStatusGroup_LIST = 142, /*!< Group number for List status codes. */ - kStatusGroup_OSA = 143, /*!< Group number for OSA status codes. */ - kStatusGroup_COMMON_TASK = 144, /*!< Group number for Common task status codes. */ - kStatusGroup_MSG = 145, /*!< Group number for messaging status codes. */ - kStatusGroup_SDK_OCOTP = 146, /*!< Group number for OCOTP status codes. */ - kStatusGroup_SDK_FLEXSPINOR = 147, /*!< Group number for FLEXSPINOR status codes.*/ - kStatusGroup_CODEC = 148, /*!< Group number for codec status codes. */ - kStatusGroup_ASRC = 149, /*!< Group number for codec status ASRC. */ - kStatusGroup_OTFAD = 150, /*!< Group number for codec status codes. */ - kStatusGroup_SDIOSLV = 151, /*!< Group number for SDIOSLV status codes. */ - kStatusGroup_MECC = 152, /*!< Group number for MECC status codes. */ - kStatusGroup_ENET_QOS = 153, /*!< Group number for ENET_QOS status codes. */ - kStatusGroup_LOG = 154, /*!< Group number for LOG status codes. */ - kStatusGroup_I3CBUS = 155, /*!< Group number for I3CBUS status codes. */ - kStatusGroup_QSCI = 156, /*!< Group number for QSCI status codes. */ - kStatusGroup_ELEMU = 157, /*!< Group number for ELEMU status codes. */ - kStatusGroup_QUEUEDSPI = 158, /*!< Group number for QSPI status codes. */ - kStatusGroup_POWER_MANAGER = 159, /*!< Group number for POWER_MANAGER status codes. */ - kStatusGroup_IPED = 160, /*!< Group number for IPED status codes. */ - kStatusGroup_ELS_PKC = 161, /*!< Group number for ELS PKC status codes. */ - kStatusGroup_CSS_PKC = 162, /*!< Group number for CSS PKC status codes. */ - kStatusGroup_HOSTIF = 163, /*!< Group number for HOSTIF status codes. */ - kStatusGroup_CLIF = 164, /*!< Group number for CLIF status codes. */ - kStatusGroup_BMA = 165, /*!< Group number for BMA status codes. */ - kStatusGroup_NETC = 166, /*!< Group number for NETC status codes. */ - kStatusGroup_ELE = 167, /*!< Group number for ELE status codes. */ - kStatusGroup_GLIKEY = 168, /*!< Group number for GLIKEY status codes. */ -}; - -/*! \public - * @brief Generic status return codes. - */ -enum -{ - kStatus_Success = MAKE_STATUS(kStatusGroup_Generic, 0), /*!< Generic status for Success. */ - kStatus_Fail = MAKE_STATUS(kStatusGroup_Generic, 1), /*!< Generic status for Fail. */ - kStatus_ReadOnly = MAKE_STATUS(kStatusGroup_Generic, 2), /*!< Generic status for read only failure. */ - kStatus_OutOfRange = MAKE_STATUS(kStatusGroup_Generic, 3), /*!< Generic status for out of range access. */ - kStatus_InvalidArgument = MAKE_STATUS(kStatusGroup_Generic, 4), /*!< Generic status for invalid argument check. */ - kStatus_Timeout = MAKE_STATUS(kStatusGroup_Generic, 5), /*!< Generic status for timeout. */ - kStatus_NoTransferInProgress = - MAKE_STATUS(kStatusGroup_Generic, 6), /*!< Generic status for no transfer in progress. */ - kStatus_Busy = MAKE_STATUS(kStatusGroup_Generic, 7), /*!< Generic status for module is busy. */ - kStatus_NoData = - MAKE_STATUS(kStatusGroup_Generic, 8), /*!< Generic status for no data is found for the operation. */ -}; - -/*! @brief Type used for all status and error return values. */ -typedef int32_t status_t; - -#ifdef __ZEPHYR__ -#include -#else -/*! - * @name Min/max macros - * @{ - */ -#if !defined(MIN) -/*! Computes the minimum of \a a and \a b. */ -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - -#if !defined(MAX) -/*! Computes the maximum of \a a and \a b. */ -#define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif -/*! @} */ - -/*! @brief Computes the number of elements in an array. */ -#if !defined(ARRAY_SIZE) -#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) -#endif -#endif /* __ZEPHYR__ */ - -/*! @name UINT16_MAX/UINT32_MAX value */ -/*! @{ */ -#if !defined(UINT16_MAX) -/*! Max value of uint16_t type. */ -#define UINT16_MAX ((uint16_t)-1) -#endif - -#if !defined(UINT32_MAX) -/*! Max value of uint32_t type. */ -#define UINT32_MAX ((uint32_t)-1) -#endif -/*! @} */ - -/*! Macro to get upper 32 bits of a 64-bit value */ -#if !defined(UINT64_H) -#define UINT64_H(X) ((uint32_t)((((uint64_t) (X)) >> 32U) & 0x0FFFFFFFFULL)) -#endif - -/*! Macro to get lower 32 bits of a 64-bit value */ -#if !defined(UINT64_L) -#define UINT64_L(X) ((uint32_t)(((uint64_t) (X)) & 0x0FFFFFFFFULL)) -#endif - -/*! - * @def SUPPRESS_FALL_THROUGH_WARNING() - * - * For switch case code block, if case section ends without "break;" statement, there wil be - * fallthrough warning with compiler flag -Wextra or -Wimplicit-fallthrough=n when using armgcc. - * To suppress this warning, "SUPPRESS_FALL_THROUGH_WARNING();" need to be added at the end of each - * case section which misses "break;"statement. - */ -#if defined(__GNUC__) && !defined(__ARMCC_VERSION) -#define SUPPRESS_FALL_THROUGH_WARNING() __attribute__((fallthrough)) -#else -#define SUPPRESS_FALL_THROUGH_WARNING() -#endif - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -#if !((defined(__DSC__) && defined(__CW__))) -/*! - * @brief Allocate memory with given alignment and aligned size. - * - * This is provided to support the dynamically allocated memory - * used in cache-able region. - * @param size The length required to malloc. - * @param alignbytes The alignment size. - * @retval The allocated memory. - */ -void *SDK_Malloc(size_t size, size_t alignbytes); - -/*! - * @brief Free memory. - * - * @param ptr The memory to be release. - */ -void SDK_Free(void *ptr); -#endif - -/*! - * @brief Delay at least for some time. - * Please note that, this API uses while loop for delay, different run-time environments make the time not precise, - * if precise delay count was needed, please implement a new delay function with hardware timer. - * - * @param delayTime_us Delay time in unit of microsecond. - * @param coreClock_Hz Core clock frequency with Hz. - */ -void SDK_DelayAtLeastUs(uint32_t delayTime_us, uint32_t coreClock_Hz); - -#if defined(__cplusplus) -} -#endif - -/*! @} */ - -#if (defined(__DSC__) && defined(__CW__)) -#include "fsl_common_dsc.h" -#elif defined(__XTENSA__) -#include "fsl_common_dsp.h" -#else -#include "fsl_common_arm.h" -#endif - -#endif /* FSL_COMMON_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_common_arm.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_common_arm.c deleted file mode 100644 index e9f32aadf4a..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_common_arm.c +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_common.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.common_arm" -#endif - -#ifndef __GIC_PRIO_BITS -#if defined(ENABLE_RAM_VECTOR_TABLE) -uint32_t InstallIRQHandler(IRQn_Type irq, uint32_t irqHandler) -{ -#ifdef __VECTOR_TABLE -#undef __VECTOR_TABLE -#endif - -/* Addresses for VECTOR_TABLE and VECTOR_RAM come from the linker file */ -#if defined(__CC_ARM) || defined(__ARMCC_VERSION) - extern uint32_t Image$$VECTOR_ROM$$Base[]; - extern uint32_t Image$$VECTOR_RAM$$Base[]; - extern uint32_t Image$$VECTOR_RAM$$ZI$$Limit[]; - -#define __VECTOR_TABLE Image$$VECTOR_ROM$$Base -#define __VECTOR_RAM Image$$VECTOR_RAM$$Base -#define __RAM_VECTOR_TABLE_SIZE (((uint32_t)Image$$VECTOR_RAM$$ZI$$Limit - (uint32_t)Image$$VECTOR_RAM$$Base)) -#elif defined(__ICCARM__) - extern uint32_t __RAM_VECTOR_TABLE_SIZE[]; - extern uint32_t __VECTOR_TABLE[]; - extern uint32_t __VECTOR_RAM[]; -#elif defined(__GNUC__) - extern uint32_t __VECTOR_TABLE[]; - extern uint32_t __VECTOR_RAM[]; - extern uint32_t __RAM_VECTOR_TABLE_SIZE_BYTES[]; - uint32_t __RAM_VECTOR_TABLE_SIZE = (uint32_t)(__RAM_VECTOR_TABLE_SIZE_BYTES); -#endif /* defined(__CC_ARM) || defined(__ARMCC_VERSION) */ - uint32_t n; - uint32_t ret; - uint32_t irqMaskValue; - - irqMaskValue = DisableGlobalIRQ(); - if (SCB->VTOR != (uint32_t)__VECTOR_RAM) - { - /* Copy the vector table from ROM to RAM */ - for (n = 0; n < ((uint32_t)__RAM_VECTOR_TABLE_SIZE) / sizeof(uint32_t); n++) - { - __VECTOR_RAM[n] = __VECTOR_TABLE[n]; - } - /* Point the VTOR to the position of vector table */ - SCB->VTOR = (uint32_t)__VECTOR_RAM; - } - - ret = __VECTOR_RAM[(int32_t)irq + 16]; - /* make sure the __VECTOR_RAM is noncachable */ - __VECTOR_RAM[(int32_t)irq + 16] = irqHandler; - - EnableGlobalIRQ(irqMaskValue); - - return ret; -} -#endif /* ENABLE_RAM_VECTOR_TABLE. */ -#endif /* __GIC_PRIO_BITS. */ - -#if (defined(FSL_FEATURE_SOC_SYSCON_COUNT) && (FSL_FEATURE_SOC_SYSCON_COUNT > 0)) - -/* - * When FSL_FEATURE_POWERLIB_EXTEND is defined to non-zero value, - * powerlib should be used instead of these functions. - */ -#if !(defined(FSL_FEATURE_POWERLIB_EXTEND) && (FSL_FEATURE_POWERLIB_EXTEND != 0)) - -/* - * When the SYSCON STARTER registers are discontinuous, these functions are - * implemented in fsl_power.c. - */ -#if !(defined(FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS) && FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS) - -void EnableDeepSleepIRQ(IRQn_Type interrupt) -{ - uint32_t intNumber = (uint32_t)interrupt; - - uint32_t index = 0; - - while (intNumber >= 32u) - { - index++; - intNumber -= 32u; - } - - SYSCON->STARTERSET[index] = 1UL << intNumber; - (void)EnableIRQ(interrupt); /* also enable interrupt at NVIC */ -} - -void DisableDeepSleepIRQ(IRQn_Type interrupt) -{ - uint32_t intNumber = (uint32_t)interrupt; - - (void)DisableIRQ(interrupt); /* also disable interrupt at NVIC */ - uint32_t index = 0; - - while (intNumber >= 32u) - { - index++; - intNumber -= 32u; - } - - SYSCON->STARTERCLR[index] = 1UL << intNumber; -} -#endif /* FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS */ -#endif /* FSL_FEATURE_POWERLIB_EXTEND */ -#endif /* FSL_FEATURE_SOC_SYSCON_COUNT */ - -#if defined(DWT) -/* Use WDT. */ -void MSDK_EnableCpuCycleCounter(void) -{ - /* Make sure the DWT trace fucntion is enabled. */ - if (CoreDebug_DEMCR_TRCENA_Msk != (CoreDebug_DEMCR_TRCENA_Msk & CoreDebug->DEMCR)) - { - CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; - } - - /* CYCCNT not supported on this device. */ - assert(DWT_CTRL_NOCYCCNT_Msk != (DWT->CTRL & DWT_CTRL_NOCYCCNT_Msk)); - - /* Read CYCCNT directly if CYCCENT has already been enabled, otherwise enable CYCCENT first. */ - if (DWT_CTRL_CYCCNTENA_Msk != (DWT_CTRL_CYCCNTENA_Msk & DWT->CTRL)) - { - DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk; - } -} - -uint32_t MSDK_GetCpuCycleCount(void) -{ - return DWT->CYCCNT; -} -#endif /* defined(DWT) */ - -#if !(defined(SDK_DELAY_USE_DWT) && defined(DWT)) -/* Use software loop. */ -#if defined(__CC_ARM) /* This macro is arm v5 specific */ -/* clang-format off */ -__ASM static void DelayLoop(uint32_t count) -{ -loop - SUBS R0, R0, #1 - CMP R0, #0 - BNE loop - BX LR -} -#elif defined(__ARM_ARCH_8A__) /* This macro is ARMv8-A specific */ -static void DelayLoop(uint32_t count) -{ - __ASM volatile(" MOV X0, %0" : : "r"(count)); - __ASM volatile( - "loop%=: \n" - " SUB X0, X0, #1 \n" - " CMP X0, #0 \n" - - " BNE loop%= \n" - : - : - : "r0"); -} -/* clang-format on */ -#elif defined(__ARMCC_VERSION) || defined(__ICCARM__) || defined(__GNUC__) -/* Cortex-M0 has a smaller instruction set, SUBS isn't supported in thumb-16 mode reported from __GNUC__ compiler, - * use SUB and CMP here for compatibility */ -static void DelayLoop(uint32_t count) -{ - __ASM volatile(" MOV R0, %0" : : "r"(count)); - __ASM volatile( - "loop%=: \n" -#if defined(__GNUC__) && !defined(__ARMCC_VERSION) - " SUB R0, R0, #1 \n" -#else - " SUBS R0, R0, #1 \n" -#endif - " CMP R0, #0 \n" - - " BNE loop%= \n" - : - : - : "r0"); -} -#endif /* defined(__CC_ARM) */ -#endif /* defined(SDK_DELAY_USE_DWT) && defined(DWT) */ - -/*! - * @brief Delay at least for some time. - * Please note that, if not uses DWT, this API will use while loop for delay, different run-time environments have - * effect on the delay time. If precise delay is needed, please enable DWT delay. The two parmeters delayTime_us and - * coreClock_Hz have limitation. For example, in the platform with 1GHz coreClock_Hz, the delayTime_us only supports - * up to 4294967 in current code. If long time delay is needed, please implement a new delay function. - * - * @param delayTime_us Delay time in unit of microsecond. - * @param coreClock_Hz Core clock frequency with Hz. - */ -void SDK_DelayAtLeastUs(uint32_t delayTime_us, uint32_t coreClock_Hz) -{ - uint64_t count; - - if (delayTime_us > 0U) - { - count = USEC_TO_COUNT(delayTime_us, coreClock_Hz); - - assert(count <= UINT32_MAX); - -#if defined(SDK_DELAY_USE_DWT) && defined(DWT) /* Use DWT for better accuracy */ - - MSDK_EnableCpuCycleCounter(); - /* Calculate the count ticks. */ - count += MSDK_GetCpuCycleCount(); - - if (count > UINT32_MAX) - { - count -= UINT32_MAX; - /* Wait for cyccnt overflow. */ - while (count < MSDK_GetCpuCycleCount()) - { - } - } - - /* Wait for cyccnt reach count value. */ - while (count > MSDK_GetCpuCycleCount()) - { - } -#else -#if defined(__CORTEX_Axx) && ((__CORTEX_Axx == 53) || (__CORTEX_Axx == 55)) - /* - * Cortex-A53/A55 execution throughput: - * - SUB/CMP: 2 instructions per cycle - * - BNE: 1 instruction per cycle - * So, each loop takes 2 CPU cycles. - */ - count = count / 2U; -#elif (__CORTEX_M == 7) - /* Divide value may be different in various environment to ensure delay is precise. - * Every loop count includes three instructions, due to Cortex-M7 sometimes executes - * two instructions in one period, through test here set divide 1.5. Other M cores use - * divide 4. By the way, divide 1.5 or 4 could let the count lose precision, but it does - * not matter because other instructions outside while loop is enough to fill the time. - */ - count = count / 3U * 2U; -#else - count = count / 4U; -#endif - DelayLoop((uint32_t)count); -#endif /* defined(SDK_DELAY_USE_DWT) && defined(DWT) */ - } -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_common_arm.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_common_arm.h deleted file mode 100644 index 3d35d76f812..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_common_arm.h +++ /dev/null @@ -1,898 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_COMMON_ARM_H_ -#define FSL_COMMON_ARM_H_ - -/* - * For CMSIS pack RTE. - * CMSIS pack RTE generates "RTC_Components.h" which contains the statements - * of the related element for all selected software components. - */ -#ifdef _RTE_ -#include "RTE_Components.h" -#endif - -/*! - * @addtogroup ksdk_common - * @{ - */ - -/*! @name Atomic modification - * - * These macros are used for atomic access, such as read-modify-write - * to the peripheral registers. - * - * Take @ref SDK_ATOMIC_LOCAL_CLEAR_AND_SET as an example: the parameter @c addr - * means the address of the peripheral register or variable you want to modify - * atomically, the parameter @c clearBits is the bits to clear, the parameter - * @c setBits it the bits to set. - * For example, to set a 32-bit register bit1:bit0 to 0b10, use like this: - * - * @code - volatile uint32_t * reg = (volatile uint32_t *)REG_ADDR; - - SDK_ATOMIC_LOCAL_CLEAR_AND_SET(reg, 0x03, 0x02); - @endcode - * - * In this example, the register bit1:bit0 are cleared and bit1 is set, as a result, - * register bit1:bit0 = 0b10. - * - * @note For the platforms don't support exclusive load and store, these macros - * disable the global interrupt to pretect the modification. - * - * @note These macros only guarantee the local processor atomic operations. For - * the multi-processor devices, use hardware semaphore such as SEMA42 to - * guarantee exclusive access if necessary. - * - * @{ - */ - -/*! - * @def SDK_ATOMIC_LOCAL_ADD(addr, val) - * Add value \a val from the variable at address \a address. - * - * @def SDK_ATOMIC_LOCAL_SUB(addr, val) - * Subtract value \a val to the variable at address \a address. - * - * @def SDK_ATOMIC_LOCAL_SET(addr, bits) - * Set the bits specifiled by \a bits to the variable at address \a address. - * - * @def SDK_ATOMIC_LOCAL_CLEAR(addr, bits) - * Clear the bits specifiled by \a bits to the variable at address \a address. - * - * @def SDK_ATOMIC_LOCAL_TOGGLE(addr, bits) - * Toggle the bits specifiled by \a bits to the variable at address \a address. - * - * @def SDK_ATOMIC_LOCAL_CLEAR_AND_SET(addr, clearBits, setBits) - * For the variable at address \a address, clear the bits specifiled by \a clearBits - * and set the bits specifiled by \a setBits. - */ - -/* clang-format off */ -#if ((defined(__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined(__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined(__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined(__ARM_ARCH_8M_BASE__) && (__ARM_ARCH_8M_BASE__ == 1))) -/* clang-format on */ - -/* If the LDREX and STREX are supported, use them. */ -#define _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, val, ops) \ - do \ - { \ - (val) = __LDREXB(addr); \ - (ops); \ - } while (0UL != __STREXB((val), (addr))) - -#define _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, val, ops) \ - do \ - { \ - (val) = __LDREXH(addr); \ - (ops); \ - } while (0UL != __STREXH((val), (addr))) - -#define _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, val, ops) \ - do \ - { \ - (val) = __LDREXW(addr); \ - (ops); \ - } while (0UL != __STREXW((val), (addr))) - -static inline void _SDK_AtomicLocalAdd1Byte(volatile uint8_t *addr, uint8_t val) -{ - uint8_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, s_val, s_val += val); -} - -static inline void _SDK_AtomicLocalAdd2Byte(volatile uint16_t *addr, uint16_t val) -{ - uint16_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, s_val, s_val += val); -} - -static inline void _SDK_AtomicLocalAdd4Byte(volatile uint32_t *addr, uint32_t val) -{ - uint32_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, s_val, s_val += val); -} - -static inline void _SDK_AtomicLocalSub1Byte(volatile uint8_t *addr, uint8_t val) -{ - uint8_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, s_val, s_val -= val); -} - -static inline void _SDK_AtomicLocalSub2Byte(volatile uint16_t *addr, uint16_t val) -{ - uint16_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, s_val, s_val -= val); -} - -static inline void _SDK_AtomicLocalSub4Byte(volatile uint32_t *addr, uint32_t val) -{ - uint32_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, s_val, s_val -= val); -} - -static inline void _SDK_AtomicLocalSet1Byte(volatile uint8_t *addr, uint8_t bits) -{ - uint8_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, s_val, s_val |= bits); -} - -static inline void _SDK_AtomicLocalSet2Byte(volatile uint16_t *addr, uint16_t bits) -{ - uint16_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, s_val, s_val |= bits); -} - -static inline void _SDK_AtomicLocalSet4Byte(volatile uint32_t *addr, uint32_t bits) -{ - uint32_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, s_val, s_val |= bits); -} - -static inline void _SDK_AtomicLocalClear1Byte(volatile uint8_t *addr, uint8_t bits) -{ - uint8_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, s_val, s_val &= ~bits); -} - -static inline void _SDK_AtomicLocalClear2Byte(volatile uint16_t *addr, uint16_t bits) -{ - uint16_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, s_val, s_val &= ~bits); -} - -static inline void _SDK_AtomicLocalClear4Byte(volatile uint32_t *addr, uint32_t bits) -{ - uint32_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, s_val, s_val &= ~bits); -} - -static inline void _SDK_AtomicLocalToggle1Byte(volatile uint8_t *addr, uint8_t bits) -{ - uint8_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, s_val, s_val ^= bits); -} - -static inline void _SDK_AtomicLocalToggle2Byte(volatile uint16_t *addr, uint16_t bits) -{ - uint16_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, s_val, s_val ^= bits); -} - -static inline void _SDK_AtomicLocalToggle4Byte(volatile uint32_t *addr, uint32_t bits) -{ - uint32_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, s_val, s_val ^= bits); -} - -static inline void _SDK_AtomicLocalClearAndSet1Byte(volatile uint8_t *addr, uint8_t clearBits, uint8_t setBits) -{ - uint8_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, s_val, s_val = (s_val & ~clearBits) | setBits); -} - -static inline void _SDK_AtomicLocalClearAndSet2Byte(volatile uint16_t *addr, uint16_t clearBits, uint16_t setBits) -{ - uint16_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, s_val, s_val = (s_val & ~clearBits) | setBits); -} - -static inline void _SDK_AtomicLocalClearAndSet4Byte(volatile uint32_t *addr, uint32_t clearBits, uint32_t setBits) -{ - uint32_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, s_val, s_val = (s_val & ~clearBits) | setBits); -} - -#define SDK_ATOMIC_LOCAL_ADD(addr, val) \ - ((1UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalAdd1Byte((volatile uint8_t *)(volatile void *)(addr), (uint8_t)(val)) : \ - ((2UL == sizeof(*(addr))) ? _SDK_AtomicLocalAdd2Byte((volatile uint16_t *)(volatile void *)(addr), (uint16_t)(val)) : \ - _SDK_AtomicLocalAdd4Byte((volatile uint32_t *)(volatile void *)(addr), (uint32_t)(val)))) - -#define SDK_ATOMIC_LOCAL_SUB(addr, val) \ - ((1UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalSub1Byte((volatile uint8_t *)(volatile void *)(addr), (uint8_t)(val)) : \ - ((2UL == sizeof(*(addr))) ? _SDK_AtomicLocalSub2Byte((volatile uint16_t *)(volatile void *)(addr), (uint16_t)(val)) : \ - _SDK_AtomicLocalSub4Byte((volatile uint32_t *)(volatile void *)(addr), (uint32_t)(val)))) - -#define SDK_ATOMIC_LOCAL_SET(addr, bits) \ - ((1UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalSet1Byte((volatile uint8_t *)(volatile void *)(addr), (uint8_t)(bits)) : \ - ((2UL == sizeof(*(addr))) ? _SDK_AtomicLocalSet2Byte((volatile uint16_t *)(volatile void *)(addr), (uint16_t)(bits)) : \ - _SDK_AtomicLocalSet4Byte((volatile uint32_t *)(volatile void *)(addr), (uint32_t)(bits)))) - -#define SDK_ATOMIC_LOCAL_CLEAR(addr, bits) \ - ((1UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalClear1Byte((volatile uint8_t *)(volatile void *)(addr), (uint8_t)(bits)) : \ - ((2UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalClear2Byte((volatile uint16_t *)(volatile void *)(addr), (uint16_t)(bits)) : \ - _SDK_AtomicLocalClear4Byte((volatile uint32_t *)(volatile void *)(addr), (uint32_t)(bits)))) - -#define SDK_ATOMIC_LOCAL_TOGGLE(addr, bits) \ - ((1UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalToggle1Byte((volatile uint8_t *)(volatile void *)(addr), (uint8_t)(bits)) : \ - ((2UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalToggle2Byte((volatile uint16_t *)(volatile void *)(addr), (uint16_t)(bits)) : \ - _SDK_AtomicLocalToggle4Byte((volatile uint32_t *)(volatile void *)(addr), (uint32_t)(bits)))) - -#define SDK_ATOMIC_LOCAL_CLEAR_AND_SET(addr, clearBits, setBits) \ - ((1UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalClearAndSet1Byte((volatile uint8_t *)(volatile void *)(addr), (uint8_t)(clearBits), (uint8_t)(setBits)) : \ - ((2UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalClearAndSet2Byte((volatile uint16_t *)(volatile void *)(addr), (uint16_t)(clearBits), (uint16_t)(setBits)) : \ - _SDK_AtomicLocalClearAndSet4Byte((volatile uint32_t *)(volatile void *)(addr), (uint32_t)(clearBits), (uint32_t)(setBits)))) -#else - -#define SDK_ATOMIC_LOCAL_ADD(addr, val) \ - do \ - { \ - uint32_t s_atomicOldInt; \ - s_atomicOldInt = DisableGlobalIRQ(); \ - *(addr) += (val); \ - EnableGlobalIRQ(s_atomicOldInt); \ - } while (false) - -#define SDK_ATOMIC_LOCAL_SUB(addr, val) \ - do \ - { \ - uint32_t s_atomicOldInt; \ - s_atomicOldInt = DisableGlobalIRQ(); \ - *(addr) -= (val); \ - EnableGlobalIRQ(s_atomicOldInt); \ - } while (false) - -#define SDK_ATOMIC_LOCAL_SET(addr, bits) \ - do \ - { \ - uint32_t s_atomicOldInt; \ - s_atomicOldInt = DisableGlobalIRQ(); \ - *(addr) |= (bits); \ - EnableGlobalIRQ(s_atomicOldInt); \ - } while (false) - -#define SDK_ATOMIC_LOCAL_CLEAR(addr, bits) \ - do \ - { \ - uint32_t s_atomicOldInt; \ - s_atomicOldInt = DisableGlobalIRQ(); \ - *(addr) &= ~(bits); \ - EnableGlobalIRQ(s_atomicOldInt); \ - } while (false) - -#define SDK_ATOMIC_LOCAL_TOGGLE(addr, bits) \ - do \ - { \ - uint32_t s_atomicOldInt; \ - s_atomicOldInt = DisableGlobalIRQ(); \ - *(addr) ^= (bits); \ - EnableGlobalIRQ(s_atomicOldInt); \ - } while (false) - -#define SDK_ATOMIC_LOCAL_CLEAR_AND_SET(addr, clearBits, setBits) \ - do \ - { \ - uint32_t s_atomicOldInt; \ - s_atomicOldInt = DisableGlobalIRQ(); \ - *(addr) = (*(addr) & ~(clearBits)) | (setBits); \ - EnableGlobalIRQ(s_atomicOldInt); \ - } while (false) - -#endif -/*! @} */ - -/*! @name Timer utilities */ -/*! @{ */ -/*! Macro to convert a microsecond period to raw count value */ -#define USEC_TO_COUNT(us, clockFreqInHz) (uint64_t)(((uint64_t)(us) * (clockFreqInHz)) / 1000000U) -/*! Macro to convert a raw count value to microsecond */ -#define COUNT_TO_USEC(count, clockFreqInHz) (uint64_t)((uint64_t)(count)*1000000U / (clockFreqInHz)) - -/*! Macro to convert a millisecond period to raw count value */ -#define MSEC_TO_COUNT(ms, clockFreqInHz) (uint64_t)((uint64_t)(ms) * (clockFreqInHz) / 1000U) -/*! Macro to convert a raw count value to millisecond */ -#define COUNT_TO_MSEC(count, clockFreqInHz) (uint64_t)((uint64_t)(count)*1000U / (clockFreqInHz)) -/*! @} */ - -/*! @name ISR exit barrier - * @{ - * - * ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping - * exception return operation might vector to incorrect interrupt. - * For Cortex-M7, if core speed much faster than peripheral register write speed, - * the peripheral interrupt flags may be still set after exiting ISR, this results to - * the same error similar with errata 83869. - */ -#if (defined __CORTEX_M) && ((__CORTEX_M == 4U) || (__CORTEX_M == 7U)) -#define SDK_ISR_EXIT_BARRIER __DSB() -#else -#define SDK_ISR_EXIT_BARRIER -#endif - -/*! @} */ - -/*! @name Alignment variable definition macros */ -/*! @{ */ -#if (defined(__ICCARM__)) -/* - * Workaround to disable MISRA C message suppress warnings for IAR compiler. - * http:/ /supp.iar.com/Support/?note=24725 - */ -_Pragma("diag_suppress=Pm120") -#define SDK_PRAGMA(x) _Pragma(#x) - _Pragma("diag_error=Pm120") -/*! Macro to define a variable with alignbytes alignment */ -#define SDK_ALIGN(var, alignbytes) SDK_PRAGMA(data_alignment = alignbytes) var -#elif defined(__CC_ARM) || defined(__ARMCC_VERSION) -/*! Macro to define a variable with alignbytes alignment */ -#define SDK_ALIGN(var, alignbytes) __attribute__((aligned(alignbytes))) var -#elif defined(__GNUC__) || defined(DOXYGEN_OUTPUT) -/*! Macro to define a variable with alignbytes alignment */ -#define SDK_ALIGN(var, alignbytes) var __attribute__((aligned(alignbytes))) -#else -#error Toolchain not supported -#endif - -/*! Macro to define a variable with L1 d-cache line size alignment */ -#if defined(FSL_FEATURE_L1DCACHE_LINESIZE_BYTE) -#define SDK_L1DCACHE_ALIGN(var) SDK_ALIGN(var, FSL_FEATURE_L1DCACHE_LINESIZE_BYTE) -#endif -/*! Macro to define a variable with L2 cache line size alignment */ -#if defined(FSL_FEATURE_L2CACHE_LINESIZE_BYTE) -#define SDK_L2CACHE_ALIGN(var) SDK_ALIGN(var, FSL_FEATURE_L2CACHE_LINESIZE_BYTE) -#endif - -/*! Macro to change a value to a given size aligned value */ -#define SDK_SIZEALIGN(var, alignbytes) \ - ((unsigned int)((var) + ((alignbytes)-1U)) & (unsigned int)(~(unsigned int)((alignbytes)-1U))) -/*! @} */ - -/*! - * @name Non-cacheable region definition macros - * - * For initialized non-zero non-cacheable variables, please use "AT_NONCACHEABLE_SECTION_INIT(var) ={xx};" or - * "AT_NONCACHEABLE_SECTION_ALIGN_INIT(var) ={xx};" in your projects to define them. For zero-inited non-cacheable - * variables, please use "AT_NONCACHEABLE_SECTION(var);" or "AT_NONCACHEABLE_SECTION_ALIGN(var);" to define them, - * these zero-inited variables will be initialized to zero in system startup. - * - * @note For GCC, when the non-cacheable section is required, please define "__STARTUP_INITIALIZE_NONCACHEDATA" - * in your projects to make sure the non-cacheable section variables will be initialized in system startup. - * - * @{ - */ - -/*! - * @def AT_NONCACHEABLE_SECTION(var) - * Define a variable \a var, and place it in non-cacheable section. - * - * @def AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) - * Define a variable \a var, and place it in non-cacheable section, the start address - * of the variable is aligned to \a alignbytes. - * - * @def AT_NONCACHEABLE_SECTION_INIT(var) - * Define a variable \a var with initial value, and place it in non-cacheable section. - * - * @def AT_NONCACHEABLE_SECTION_ALIGN_INIT(var, alignbytes) - * Define a variable \a var with initial value, and place it in non-cacheable section, - * the start address of the variable is aligned to \a alignbytes. - */ - -#if ((!(defined(FSL_FEATURE_HAS_NO_NONCACHEABLE_SECTION) && FSL_FEATURE_HAS_NO_NONCACHEABLE_SECTION)) && \ - defined(FSL_FEATURE_L1ICACHE_LINESIZE_BYTE)) - -#if (defined(__ICCARM__)) -#define AT_NONCACHEABLE_SECTION(var) var @"NonCacheable" -#define AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) SDK_PRAGMA(data_alignment = alignbytes) var @"NonCacheable" -#define AT_NONCACHEABLE_SECTION_INIT(var) var @"NonCacheable.init" -#define AT_NONCACHEABLE_SECTION_ALIGN_INIT(var, alignbytes) \ - SDK_PRAGMA(data_alignment = alignbytes) var @"NonCacheable.init" - -#elif (defined(__CC_ARM) || defined(__ARMCC_VERSION)) -#define AT_NONCACHEABLE_SECTION_INIT(var) __attribute__((section("NonCacheable.init"))) var -#define AT_NONCACHEABLE_SECTION_ALIGN_INIT(var, alignbytes) \ - __attribute__((section("NonCacheable.init"))) __attribute__((aligned(alignbytes))) var -#if (defined(__CC_ARM)) -#define AT_NONCACHEABLE_SECTION(var) __attribute__((section("NonCacheable"), zero_init)) var -#define AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) \ - __attribute__((section("NonCacheable"), zero_init)) __attribute__((aligned(alignbytes))) var -#else -#define AT_NONCACHEABLE_SECTION(var) __attribute__((section(".bss.NonCacheable"))) var -#define AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) \ - __attribute__((section(".bss.NonCacheable"))) __attribute__((aligned(alignbytes))) var -#endif - -#elif (defined(__GNUC__)) || defined(DOXYGEN_OUTPUT) -/* For GCC, when the non-cacheable section is required, please define "__STARTUP_INITIALIZE_NONCACHEDATA" - * in your projects to make sure the non-cacheable section variables will be initialized in system startup. - */ -#define AT_NONCACHEABLE_SECTION_INIT(var) __attribute__((section("NonCacheable.init"))) var -#define AT_NONCACHEABLE_SECTION_ALIGN_INIT(var, alignbytes) \ - __attribute__((section("NonCacheable.init"))) var __attribute__((aligned(alignbytes))) -#define AT_NONCACHEABLE_SECTION(var) __attribute__((section("NonCacheable,\"aw\",%nobits @"))) var -#define AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) \ - __attribute__((section("NonCacheable,\"aw\",%nobits @"))) var __attribute__((aligned(alignbytes))) -#else -#error Toolchain not supported. -#endif - -#else - -#define AT_NONCACHEABLE_SECTION(var) var -#define AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) SDK_ALIGN(var, alignbytes) -#define AT_NONCACHEABLE_SECTION_INIT(var) var -#define AT_NONCACHEABLE_SECTION_ALIGN_INIT(var, alignbytes) SDK_ALIGN(var, alignbytes) - -#endif - -/*! @} */ - -/*! - * @name Time sensitive region - * @{ - */ - -/*! - * @def AT_QUICKACCESS_SECTION_CODE(func) - * Place function in a section which can be accessed quickly by core. - * - * @def AT_QUICKACCESS_SECTION_DATA(var) - * Place data in a section which can be accessed quickly by core. - * - * @def AT_QUICKACCESS_SECTION_DATA_ALIGN(var, alignbytes) - * Place data in a section which can be accessed quickly by core, and the variable - * address is set to align with \a alignbytes. - */ -#if (defined(__ICCARM__)) -#define AT_QUICKACCESS_SECTION_CODE(func) func @"CodeQuickAccess" -#define AT_QUICKACCESS_SECTION_DATA(var) var @"DataQuickAccess" -#define AT_QUICKACCESS_SECTION_DATA_ALIGN(var, alignbytes) \ - SDK_PRAGMA(data_alignment = alignbytes) var @"DataQuickAccess" -#elif (defined(__CC_ARM) || defined(__ARMCC_VERSION)) -#define AT_QUICKACCESS_SECTION_CODE(func) __attribute__((section("CodeQuickAccess"), __noinline__)) func -#define AT_QUICKACCESS_SECTION_DATA(var) __attribute__((section("DataQuickAccess"))) var -#define AT_QUICKACCESS_SECTION_DATA_ALIGN(var, alignbytes) \ - __attribute__((section("DataQuickAccess"))) __attribute__((aligned(alignbytes))) var -#elif (defined(__GNUC__)) || defined(DOXYGEN_OUTPUT) -#define AT_QUICKACCESS_SECTION_CODE(func) __attribute__((section("CodeQuickAccess"), __noinline__)) func -#define AT_QUICKACCESS_SECTION_DATA(var) __attribute__((section("DataQuickAccess"))) var -#define AT_QUICKACCESS_SECTION_DATA_ALIGN(var, alignbytes) \ - __attribute__((section("DataQuickAccess"))) var __attribute__((aligned(alignbytes))) -#else -#error Toolchain not supported. -#endif /* defined(__ICCARM__) */ -/*! @} */ - -/*! - * @name Ram Function - * @{ - * - * @def RAMFUNCTION_SECTION_CODE(func) - * Place function in ram. - */ -#if (defined(__ICCARM__)) -#define RAMFUNCTION_SECTION_CODE(func) func @"RamFunction" -#elif (defined(__CC_ARM) || defined(__ARMCC_VERSION)) -#define RAMFUNCTION_SECTION_CODE(func) __attribute__((section("RamFunction"))) func -#elif (defined(__GNUC__)) || defined(DOXYGEN_OUTPUT) -#define RAMFUNCTION_SECTION_CODE(func) __attribute__((section("RamFunction"))) func -#else -#error Toolchain not supported. -#endif /* defined(__ICCARM__) */ -/*! @} */ - -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - void DefaultISR(void); -#endif - -/* - * The fsl_clock.h is included here because it needs MAKE_VERSION/MAKE_STATUS/status_t - * defined in previous of this file. - */ -#include "fsl_clock.h" - -/* - * Chip level peripheral reset API, for MCUs that implement peripheral reset control external to a peripheral - */ -#if ((defined(FSL_FEATURE_SOC_SYSCON_COUNT) && (FSL_FEATURE_SOC_SYSCON_COUNT > 0)) || \ - (defined(FSL_FEATURE_SOC_ASYNC_SYSCON_COUNT) && (FSL_FEATURE_SOC_ASYNC_SYSCON_COUNT > 0))) -#include "fsl_reset.h" -#endif - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus*/ - -/*! - * @brief Enable specific interrupt. - * - * Enable LEVEL1 interrupt. For some devices, there might be multiple interrupt - * levels. For example, there are NVIC and intmux. Here the interrupts connected - * to NVIC are the LEVEL1 interrupts, because they are routed to the core directly. - * The interrupts connected to intmux are the LEVEL2 interrupts, they are routed - * to NVIC first then routed to core. - * - * This function only enables the LEVEL1 interrupts. The number of LEVEL1 interrupts - * is indicated by the feature macro FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS. - * - * @param interrupt The IRQ number. - * @retval kStatus_Success Interrupt enabled successfully - * @retval kStatus_Fail Failed to enable the interrupt - */ -static inline status_t EnableIRQ(IRQn_Type interrupt) -{ - status_t status = kStatus_Success; - - if (NotAvail_IRQn == interrupt) - { - status = kStatus_Fail; - } - -#if defined(FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) && (FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS > 0) - else if ((int32_t)interrupt >= (int32_t)FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) - { - status = kStatus_Fail; - } -#endif - - else - { -#if defined(__GIC_PRIO_BITS) - GIC_EnableIRQ(interrupt); -#else - NVIC_EnableIRQ(interrupt); -#endif - } - - return status; -} - -/*! - * @brief Disable specific interrupt. - * - * Disable LEVEL1 interrupt. For some devices, there might be multiple interrupt - * levels. For example, there are NVIC and intmux. Here the interrupts connected - * to NVIC are the LEVEL1 interrupts, because they are routed to the core directly. - * The interrupts connected to intmux are the LEVEL2 interrupts, they are routed - * to NVIC first then routed to core. - * - * This function only disables the LEVEL1 interrupts. The number of LEVEL1 interrupts - * is indicated by the feature macro FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS. - * - * @param interrupt The IRQ number. - * @retval kStatus_Success Interrupt disabled successfully - * @retval kStatus_Fail Failed to disable the interrupt - */ -static inline status_t DisableIRQ(IRQn_Type interrupt) -{ - status_t status = kStatus_Success; - - if (NotAvail_IRQn == interrupt) - { - status = kStatus_Fail; - } - -#if defined(FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) && (FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS > 0) - else if ((int32_t)interrupt >= (int32_t)FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) - { - status = kStatus_Fail; - } -#endif - - else - { -#if defined(__GIC_PRIO_BITS) - GIC_DisableIRQ(interrupt); -#else - NVIC_DisableIRQ(interrupt); -#endif - } - - return status; -} - -/*! - * @brief Enable the IRQ, and also set the interrupt priority. - * - * Only handle LEVEL1 interrupt. For some devices, there might be multiple interrupt - * levels. For example, there are NVIC and intmux. Here the interrupts connected - * to NVIC are the LEVEL1 interrupts, because they are routed to the core directly. - * The interrupts connected to intmux are the LEVEL2 interrupts, they are routed - * to NVIC first then routed to core. - * - * This function only handles the LEVEL1 interrupts. The number of LEVEL1 interrupts - * is indicated by the feature macro FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS. - * - * @param interrupt The IRQ to Enable. - * @param priNum Priority number set to interrupt controller register. - * @retval kStatus_Success Interrupt priority set successfully - * @retval kStatus_Fail Failed to set the interrupt priority. - */ -static inline status_t EnableIRQWithPriority(IRQn_Type interrupt, uint8_t priNum) -{ - status_t status = kStatus_Success; - - if (NotAvail_IRQn == interrupt) - { - status = kStatus_Fail; - } - -#if defined(FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) && (FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS > 0) - else if ((int32_t)interrupt >= (int32_t)FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) - { - status = kStatus_Fail; - } -#endif - - else - { -#if defined(__GIC_PRIO_BITS) - GIC_SetPriority(interrupt, priNum); - GIC_EnableIRQ(interrupt); -#else - NVIC_SetPriority(interrupt, priNum); - NVIC_EnableIRQ(interrupt); -#endif - } - - return status; -} - -/*! - * @brief Set the IRQ priority. - * - * Only handle LEVEL1 interrupt. For some devices, there might be multiple interrupt - * levels. For example, there are NVIC and intmux. Here the interrupts connected - * to NVIC are the LEVEL1 interrupts, because they are routed to the core directly. - * The interrupts connected to intmux are the LEVEL2 interrupts, they are routed - * to NVIC first then routed to core. - * - * This function only handles the LEVEL1 interrupts. The number of LEVEL1 interrupts - * is indicated by the feature macro FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS. - * - * @param interrupt The IRQ to set. - * @param priNum Priority number set to interrupt controller register. - * - * @retval kStatus_Success Interrupt priority set successfully - * @retval kStatus_Fail Failed to set the interrupt priority. - */ -static inline status_t IRQ_SetPriority(IRQn_Type interrupt, uint8_t priNum) -{ - status_t status = kStatus_Success; - - if (NotAvail_IRQn == interrupt) - { - status = kStatus_Fail; - } - -#if defined(FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) && (FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS > 0) - else if ((int32_t)interrupt >= (int32_t)FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) - { - status = kStatus_Fail; - } -#endif - - else - { -#if defined(__GIC_PRIO_BITS) - GIC_SetPriority(interrupt, priNum); -#else - NVIC_SetPriority(interrupt, priNum); -#endif - } - - return status; -} - -/*! - * @brief Clear the pending IRQ flag. - * - * Only handle LEVEL1 interrupt. For some devices, there might be multiple interrupt - * levels. For example, there are NVIC and intmux. Here the interrupts connected - * to NVIC are the LEVEL1 interrupts, because they are routed to the core directly. - * The interrupts connected to intmux are the LEVEL2 interrupts, they are routed - * to NVIC first then routed to core. - * - * This function only handles the LEVEL1 interrupts. The number of LEVEL1 interrupts - * is indicated by the feature macro FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS. - * - * @param interrupt The flag which IRQ to clear. - * - * @retval kStatus_Success Interrupt priority set successfully - * @retval kStatus_Fail Failed to set the interrupt priority. - */ -static inline status_t IRQ_ClearPendingIRQ(IRQn_Type interrupt) -{ - status_t status = kStatus_Success; - - if (NotAvail_IRQn == interrupt) - { - status = kStatus_Fail; - } - -#if defined(FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) && (FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS > 0) - else if ((int32_t)interrupt >= (int32_t)FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) - { - status = kStatus_Fail; - } -#endif - - else - { -#if defined(__GIC_PRIO_BITS) - GIC_ClearPendingIRQ(interrupt); -#else - NVIC_ClearPendingIRQ(interrupt); -#endif - } - - return status; -} - -/*! - * @brief Disable the global IRQ - * - * Disable the global interrupt and return the current primask register. User is required to provided the primask - * register for the EnableGlobalIRQ(). - * - * @return Current primask value. - */ -static inline uint32_t DisableGlobalIRQ(void) -{ - uint32_t mask; - -#if defined(CPSR_I_Msk) - mask = __get_CPSR() & CPSR_I_Msk; -#elif defined(DAIF_I_BIT) - mask = __get_DAIF() & DAIF_I_BIT; -#else - mask = __get_PRIMASK(); -#endif - __disable_irq(); - - return mask; -} - -/*! - * @brief Enable the global IRQ - * - * Set the primask register with the provided primask value but not just enable the primask. The idea is for the - * convenience of integration of RTOS. some RTOS get its own management mechanism of primask. User is required to - * use the EnableGlobalIRQ() and DisableGlobalIRQ() in pair. - * - * @param primask value of primask register to be restored. The primask value is supposed to be provided by the - * DisableGlobalIRQ(). - */ -static inline void EnableGlobalIRQ(uint32_t primask) -{ -#if defined(CPSR_I_Msk) - __set_CPSR((__get_CPSR() & ~CPSR_I_Msk) | primask); -#elif defined(DAIF_I_BIT) - if (0UL == primask) - { - __enable_irq(); - } -#else - __set_PRIMASK(primask); -#endif -} - -#if defined(ENABLE_RAM_VECTOR_TABLE) -/*! - * @brief install IRQ handler - * - * @param irq IRQ number - * @param irqHandler IRQ handler address - * @return The old IRQ handler address - */ -uint32_t InstallIRQHandler(IRQn_Type irq, uint32_t irqHandler); -#endif /* ENABLE_RAM_VECTOR_TABLE. */ - -#if (defined(FSL_FEATURE_SOC_SYSCON_COUNT) && (FSL_FEATURE_SOC_SYSCON_COUNT > 0)) - -/* - * When FSL_FEATURE_POWERLIB_EXTEND is defined to non-zero value, - * powerlib should be used instead of these functions. - */ -#if !(defined(FSL_FEATURE_POWERLIB_EXTEND) && (FSL_FEATURE_POWERLIB_EXTEND != 0)) -/*! - * @brief Enable specific interrupt for wake-up from deep-sleep mode. - * - * Enable the interrupt for wake-up from deep sleep mode. - * Some interrupts are typically used in sleep mode only and will not occur during - * deep-sleep mode because relevant clocks are stopped. However, it is possible to enable - * those clocks (significantly increasing power consumption in the reduced power mode), - * making these wake-ups possible. - * - * @note This function also enables the interrupt in the NVIC (EnableIRQ() is called internaly). - * - * @param interrupt The IRQ number. - */ -void EnableDeepSleepIRQ(IRQn_Type interrupt); - -/*! - * @brief Disable specific interrupt for wake-up from deep-sleep mode. - * - * Disable the interrupt for wake-up from deep sleep mode. - * Some interrupts are typically used in sleep mode only and will not occur during - * deep-sleep mode because relevant clocks are stopped. However, it is possible to enable - * those clocks (significantly increasing power consumption in the reduced power mode), - * making these wake-ups possible. - * - * @note This function also disables the interrupt in the NVIC (DisableIRQ() is called internaly). - * - * @param interrupt The IRQ number. - */ -void DisableDeepSleepIRQ(IRQn_Type interrupt); -#endif /* FSL_FEATURE_POWERLIB_EXTEND */ -#endif /* FSL_FEATURE_SOC_SYSCON_COUNT */ - -#if defined(DWT) -/*! - * @brief Enable the counter to get CPU cycles. - */ -void MSDK_EnableCpuCycleCounter(void); - -/*! - * @brief Get the current CPU cycle count. - * - * @return Current CPU cycle count. - */ -uint32_t MSDK_GetCpuCycleCount(void); -#endif - -#if defined(__cplusplus) -} -#endif /* __cplusplus*/ - -/*! @} */ - -#endif /* FSL_COMMON_ARM_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_crc.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_crc.c deleted file mode 100644 index f4e303be95e..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_crc.c +++ /dev/null @@ -1,371 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2017, 2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#include "fsl_crc.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.crc" -#endif - -/*! @internal @brief Has data register with name CRC. */ -#if defined(FSL_FEATURE_CRC_HAS_CRC_REG) && FSL_FEATURE_CRC_HAS_CRC_REG -#define DATA CRC -#define DATALL CRCLL -#endif - -#if defined(CRC_DRIVER_USE_CRC16_CCIT_FALSE_AS_DEFAULT) && CRC_DRIVER_USE_CRC16_CCIT_FALSE_AS_DEFAULT -/* @brief Default user configuration structure for CRC-16-CCITT */ -#define CRC_DRIVER_DEFAULT_POLYNOMIAL 0x1021U -/*< CRC-16-CCIT polynomial x**16 + x**12 + x**5 + x**0 */ -#define CRC_DRIVER_DEFAULT_SEED 0xFFFFU -/*< Default initial checksum */ -#define CRC_DRIVER_DEFAULT_REFLECT_IN false -/*< Default is no transpose */ -#define CRC_DRIVER_DEFAULT_REFLECT_OUT false -/*< Default is transpose bytes */ -#define CRC_DRIVER_DEFAULT_COMPLEMENT_CHECKSUM false -/*< Default is without complement of CRC data register read data */ -#define CRC_DRIVER_DEFAULT_CRC_BITS kCrcBits16 -/*< Default is 16-bit CRC protocol */ -#define CRC_DRIVER_DEFAULT_CRC_RESULT kCrcFinalChecksum -/*< Default is resutl type is final checksum */ -#endif /* CRC_DRIVER_USE_CRC16_CCIT_FALSE_AS_DEFAULT */ - -#if defined(CRC_RSTS) -#define CRC_RESETS_ARRAY CRC_RSTS -#endif - -/*! @brief CRC type of transpose of read write data */ -typedef enum _crc_transpose_type -{ - kCrcTransposeNone = 0U, /*! No transpose */ - kCrcTransposeBits = 1U, /*! Tranpose bits in bytes */ - kCrcTransposeBitsAndBytes = 2U, /*! Transpose bytes and bits in bytes */ - kCrcTransposeBytes = 3U, /*! Transpose bytes */ -} crc_transpose_type_t; - -/*! - * @brief CRC module configuration. - * - * This structure holds the configuration for the CRC module. - */ -typedef struct _crc_module_config -{ - uint32_t polynomial; /*!< CRC Polynomial, MSBit first.@n - Example polynomial: 0x1021 = 1_0000_0010_0001 = x^12+x^5+1 */ - uint32_t seed; /*!< Starting checksum value */ - crc_transpose_type_t readTranspose; /*!< Type of transpose when reading CRC result. */ - crc_transpose_type_t writeTranspose; /*!< Type of transpose when writing CRC input data. */ - bool complementChecksum; /*!< True if the result shall be complement of the actual checksum. */ - crc_bits_t crcBits; /*!< Selects 16- or 32- bit CRC protocol. */ -} crc_module_config_t; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#if defined(CRC_RESETS_ARRAY) -/*! - * @brief Get instance number for CRC module. - * - * @param base CRC peripheral base address - */ -static uint32_t CRC_GetInstance(CRC_Type *base); -#endif -/******************************************************************************* - * Variables - ******************************************************************************/ -#if defined(CRC_RESETS_ARRAY) -static CRC_Type *const s_crcBases[] = CRC_BASE_PTRS; - -/* Reset array */ -static const reset_ip_name_t s_crcResets[] = CRC_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -#if defined(CRC_RESETS_ARRAY) -static uint32_t CRC_GetInstance(CRC_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_crcBases); instance++) - { - if (s_crcBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_crcBases)); - - return instance; -} -#endif - -/*! - * @brief Returns transpose type for CRC protocol reflect in parameter. - * - * This functions helps to set writeTranspose member of crc_config_t structure. Reflect in is CRC protocol parameter. - * - * @param enable True or false for the selected CRC protocol Reflect In (refin) parameter. - */ -static inline crc_transpose_type_t CRC_GetTransposeTypeFromReflectIn(bool enable) -{ - return ((enable) ? kCrcTransposeBitsAndBytes : kCrcTransposeBytes); -} - -/*! - * @brief Returns transpose type for CRC protocol reflect out parameter. - * - * This functions helps to set readTranspose member of crc_config_t structure. Reflect out is CRC protocol parameter. - * - * @param enable True or false for the selected CRC protocol Reflect Out (refout) parameter. - */ -static inline crc_transpose_type_t CRC_GetTransposeTypeFromReflectOut(bool enable) -{ - return ((enable) ? kCrcTransposeBitsAndBytes : kCrcTransposeNone); -} - -/*! - * @brief Starts checksum computation. - * - * Configures the CRC module for the specified CRC protocol. @n - * Starts the checksum computation by writing the seed value - * - * @param base CRC peripheral address. - * @param config Pointer to protocol configuration structure. - */ -static void CRC_ConfigureAndStart(CRC_Type *base, const crc_module_config_t *config) -{ - uint32_t crcControl; - - /* pre-compute value for CRC control registger based on user configuraton without WAS field */ - crcControl = 0U | CRC_CTRL_TOT(config->writeTranspose) | CRC_CTRL_TOTR(config->readTranspose) | - CRC_CTRL_FXOR(config->complementChecksum) | CRC_CTRL_TCRC(config->crcBits); - - /* make sure the control register is clear - WAS is deasserted, and protocol is set */ - base->CTRL = crcControl; - - /* write polynomial register */ - base->GPOLY = config->polynomial; - - /* write pre-computed control register value along with WAS to start checksum computation */ - base->CTRL = crcControl | CRC_CTRL_WAS(true); - - /* write seed (initial checksum) */ - base->DATA = config->seed; - - /* deassert WAS by writing pre-computed CRC control register value */ - base->CTRL = crcControl; -} - -/*! - * @brief Starts final checksum computation. - * - * Configures the CRC module for the specified CRC protocol. @n - * Starts final checksum computation by writing the seed value. - * @note CRC_Get16bitResult() or CRC_Get32bitResult() return final checksum - * (output reflection and xor functions are applied). - * - * @param base CRC peripheral address. - * @param protocolConfig Pointer to protocol configuration structure. - */ -static void CRC_SetProtocolConfig(CRC_Type *base, const crc_config_t *protocolConfig) -{ - crc_module_config_t moduleConfig; - /* convert protocol to CRC peripheral module configuration, prepare for final checksum */ - moduleConfig.polynomial = protocolConfig->polynomial; - moduleConfig.seed = protocolConfig->seed; - moduleConfig.readTranspose = CRC_GetTransposeTypeFromReflectOut(protocolConfig->reflectOut); - moduleConfig.writeTranspose = CRC_GetTransposeTypeFromReflectIn(protocolConfig->reflectIn); - moduleConfig.complementChecksum = protocolConfig->complementChecksum; - moduleConfig.crcBits = protocolConfig->crcBits; - - CRC_ConfigureAndStart(base, &moduleConfig); -} - -/*! - * @brief Starts intermediate checksum computation. - * - * Configures the CRC module for the specified CRC protocol. @n - * Starts intermediate checksum computation by writing the seed value. - * @note CRC_Get16bitResult() or CRC_Get32bitResult() return intermediate checksum (raw data register value). - * - * @param base CRC peripheral address. - * @param protocolConfig Pointer to protocol configuration structure. - */ -static void CRC_SetRawProtocolConfig(CRC_Type *base, const crc_config_t *protocolConfig) -{ - crc_module_config_t moduleConfig; - /* convert protocol to CRC peripheral module configuration, prepare for intermediate checksum */ - moduleConfig.polynomial = protocolConfig->polynomial; - moduleConfig.seed = protocolConfig->seed; - moduleConfig.readTranspose = - kCrcTransposeNone; /* intermediate checksum does no transpose of data register read value */ - moduleConfig.writeTranspose = CRC_GetTransposeTypeFromReflectIn(protocolConfig->reflectIn); - moduleConfig.complementChecksum = false; /* intermediate checksum does no xor of data register read value */ - moduleConfig.crcBits = protocolConfig->crcBits; - - CRC_ConfigureAndStart(base, &moduleConfig); -} - -/*! - * brief Enables and configures the CRC peripheral module. - * - * This function enables the clock gate in the SIM module for the CRC peripheral. - * It also configures the CRC module and starts a checksum computation by writing the seed. - * - * param base CRC peripheral address. - * param config CRC module configuration structure. - */ -void CRC_Init(CRC_Type *base, const crc_config_t *config) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* ungate clock */ - CLOCK_EnableClock(kCLOCK_Crc0); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(CRC_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_crcResets[CRC_GetInstance(base)]); -#endif - - /* configure CRC module and write the seed */ - if (config->crcResult == kCrcFinalChecksum) - { - CRC_SetProtocolConfig(base, config); - } - else - { - CRC_SetRawProtocolConfig(base, config); - } -} - -/*! - * brief Loads default values to the CRC protocol configuration structure. - * - * Loads default values to the CRC protocol configuration structure. The default values are as follows. - * code - * config->polynomial = 0x1021; - * config->seed = 0xFFFF; - * config->reflectIn = false; - * config->reflectOut = false; - * config->complementChecksum = false; - * config->crcBits = kCrcBits16; - * config->crcResult = kCrcFinalChecksum; - * endcode - * - * param config CRC protocol configuration structure. - */ -void CRC_GetDefaultConfig(crc_config_t *config) -{ - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - static const crc_config_t crc16ccit = { - CRC_DRIVER_DEFAULT_POLYNOMIAL, CRC_DRIVER_DEFAULT_SEED, - CRC_DRIVER_DEFAULT_REFLECT_IN, CRC_DRIVER_DEFAULT_REFLECT_OUT, - CRC_DRIVER_DEFAULT_COMPLEMENT_CHECKSUM, CRC_DRIVER_DEFAULT_CRC_BITS, - CRC_DRIVER_DEFAULT_CRC_RESULT, - }; - - *config = crc16ccit; -} - -/*! - * brief Writes data to the CRC module. - * - * Writes input data buffer bytes to the CRC data register. - * The configured type of transpose is applied. - * - * param base CRC peripheral address. - * param data Input data stream, MSByte in data[0]. - * param dataSize Size in bytes of the input data buffer. - */ -void CRC_WriteData(CRC_Type *base, const uint8_t *data, size_t dataSize) -{ - const uint32_t *data32; - - /* 8-bit reads and writes till source address is aligned 4 bytes */ - while ((0U != dataSize) && (0U != ((uint32_t)data & 3U))) - { - base->ACCESS8BIT.DATALL = *data; - data++; - dataSize--; - } - - /* use 32-bit reads and writes as long as possible */ - data32 = (const uint32_t *)(uint32_t)data; - while (dataSize >= sizeof(uint32_t)) - { - base->DATA = *data32; - data32++; - dataSize -= sizeof(uint32_t); - } - - data = (const uint8_t *)data32; - - /* 8-bit reads and writes till end of data buffer */ - while (dataSize != 0U) - { - base->ACCESS8BIT.DATALL = *data; - data++; - dataSize--; - } -} - -/*! - * brief Reads the 32-bit checksum from the CRC module. - * - * Reads the CRC data register (either an intermediate or the final checksum). - * The configured type of transpose and complement is applied. - * - * param base CRC peripheral address. - * return An intermediate or the final 32-bit checksum, after configured transpose and complement operations. - */ -uint32_t CRC_Get32bitResult(CRC_Type *base) -{ - return base->DATA; -} - -/*! - * brief Reads a 16-bit checksum from the CRC module. - * - * Reads the CRC data register (either an intermediate or the final checksum). - * The configured type of transpose and complement is applied. - * - * param base CRC peripheral address. - * return An intermediate or the final 16-bit checksum, after configured transpose and complement operations. - */ -uint16_t CRC_Get16bitResult(CRC_Type *base) -{ - uint32_t retval; - uint32_t totr; /* type of transpose read bitfield */ - - retval = base->DATA; - totr = (base->CTRL & CRC_CTRL_TOTR_MASK) >> CRC_CTRL_TOTR_SHIFT; - - /* check transpose type to get 16-bit out of 32-bit register */ - if (totr >= 2U) - { - /* transpose of bytes for read is set, the result CRC is in CRC_DATA[HU:HL] */ - retval &= 0xFFFF0000U; - retval = retval >> 16U; - } - else - { - /* no transpose of bytes for read, the result CRC is in CRC_DATA[LU:LL] */ - retval &= 0x0000FFFFU; - } - return (uint16_t)retval; -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_crc.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_crc.h deleted file mode 100644 index 487e9f1095f..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_crc.h +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2017, 2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_CRC_H_ -#define FSL_CRC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup crc - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief CRC driver version. Version 2.0.4. - * - * Current version: 2.0.4 - * - * Change log: - * - * - Version 2.0.4 - * - Release peripheral from reset if necessary in init function. - * - * - Version 2.0.3 - * - Fix MISRA issues - * - * - Version 2.0.2 - * - Fix MISRA issues - * - * - Version 2.0.1 - * - move DATA and DATALL macro definition from header file to source file - */ -#define FSL_CRC_DRIVER_VERSION (MAKE_VERSION(2, 0, 4)) -/*! @} */ - -#ifndef CRC_DRIVER_CUSTOM_DEFAULTS -/*! @brief Default configuration structure filled by CRC_GetDefaultConfig(). Use CRC16-CCIT-FALSE as defeault. */ -#define CRC_DRIVER_USE_CRC16_CCIT_FALSE_AS_DEFAULT 1 -#endif - -/*! @brief CRC bit width */ -typedef enum _crc_bits -{ - kCrcBits16 = 0U, /*!< Generate 16-bit CRC code */ - kCrcBits32 = 1U /*!< Generate 32-bit CRC code */ -} crc_bits_t; - -/*! @brief CRC result type */ -typedef enum _crc_result -{ - kCrcFinalChecksum = 0U, /*!< CRC data register read value is the final checksum. - Reflect out and final xor protocol features are applied. */ - kCrcIntermediateChecksum = 1U /*!< CRC data register read value is intermediate checksum (raw value). - Reflect out and final xor protocol feature are not applied. - Intermediate checksum can be used as a seed for CRC_Init() - to continue adding data to this checksum. */ -} crc_result_t; - -/*! - * @brief CRC protocol configuration. - * - * This structure holds the configuration for the CRC protocol. - * - */ -typedef struct _crc_config -{ - uint32_t polynomial; /*!< CRC Polynomial, MSBit first. - Example polynomial: 0x1021 = 1_0000_0010_0001 = x^12+x^5+1 */ - uint32_t seed; /*!< Starting checksum value */ - bool reflectIn; /*!< Reflect bits on input. */ - bool reflectOut; /*!< Reflect bits on output. */ - bool complementChecksum; /*!< True if the result shall be complement of the actual checksum. */ - crc_bits_t crcBits; /*!< Selects 16- or 32- bit CRC protocol. */ - crc_result_t crcResult; /*!< Selects final or intermediate checksum return from CRC_Get16bitResult() or - CRC_Get32bitResult() */ -} crc_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @brief Enables and configures the CRC peripheral module. - * - * This function enables the clock gate in the SIM module for the CRC peripheral. - * It also configures the CRC module and starts a checksum computation by writing the seed. - * - * @param base CRC peripheral address. - * @param config CRC module configuration structure. - */ -void CRC_Init(CRC_Type *base, const crc_config_t *config); - -/*! - * @brief Disables the CRC peripheral module. - * - * This function disables the clock gate in the SIM module for the CRC peripheral. - * - * @param base CRC peripheral address. - */ -static inline void CRC_Deinit(CRC_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* gate clock */ - CLOCK_DisableClock(kCLOCK_Crc0); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * @brief Loads default values to the CRC protocol configuration structure. - * - * Loads default values to the CRC protocol configuration structure. The default values are as follows. - * @code - * config->polynomial = 0x1021; - * config->seed = 0xFFFF; - * config->reflectIn = false; - * config->reflectOut = false; - * config->complementChecksum = false; - * config->crcBits = kCrcBits16; - * config->crcResult = kCrcFinalChecksum; - * @endcode - * - * @param config CRC protocol configuration structure. - */ -void CRC_GetDefaultConfig(crc_config_t *config); - -/*! - * @brief Writes data to the CRC module. - * - * Writes input data buffer bytes to the CRC data register. - * The configured type of transpose is applied. - * - * @param base CRC peripheral address. - * @param data Input data stream, MSByte in data[0]. - * @param dataSize Size in bytes of the input data buffer. - */ -void CRC_WriteData(CRC_Type *base, const uint8_t *data, size_t dataSize); - -/*! - * @brief Reads the 32-bit checksum from the CRC module. - * - * Reads the CRC data register (either an intermediate or the final checksum). - * The configured type of transpose and complement is applied. - * - * @param base CRC peripheral address. - * @return An intermediate or the final 32-bit checksum, after configured transpose and complement operations. - */ -uint32_t CRC_Get32bitResult(CRC_Type *base); - -/*! - * @brief Reads a 16-bit checksum from the CRC module. - * - * Reads the CRC data register (either an intermediate or the final checksum). - * The configured type of transpose and complement is applied. - * - * @param base CRC peripheral address. - * @return An intermediate or the final 16-bit checksum, after configured transpose and complement operations. - */ -uint16_t CRC_Get16bitResult(CRC_Type *base); - -#if defined(__cplusplus) -} -#endif - -/*! - *@} - */ - -#endif /* FSL_CRC_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_ctimer.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_ctimer.c deleted file mode 100644 index 3317157fdeb..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_ctimer.c +++ /dev/null @@ -1,604 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_ctimer.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.ctimer" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Gets the instance from the base address - * - * @param base Ctimer peripheral base address - * - * @return The Timer instance - */ -static uint32_t CTIMER_GetInstance(CTIMER_Type *base); - -/*! - * @brief CTIMER generic IRQ handle function. - * - * @param index FlexCAN peripheral instance index. - */ -static void CTIMER_GenericIRQHandler(uint32_t index); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to Timer bases for each instance. */ -static CTIMER_Type *const s_ctimerBases[] = CTIMER_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to Timer clocks for each instance. */ -static const clock_ip_name_t s_ctimerClocks[] = CTIMER_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_RESET) && (FSL_FEATURE_CTIMER_HAS_NO_RESET)) -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) -#if defined(FSL_FEATURE_CTIMER_WRITE_ZERO_ASSERT_RESET) && FSL_FEATURE_CTIMER_WRITE_ZERO_ASSERT_RESET -/*! @brief Pointers to Timer resets for each instance, writing a zero asserts the reset */ -static const reset_ip_name_t s_ctimerResets[] = CTIMER_RSTS_N; -#else -/*! @brief Pointers to Timer resets for each instance, writing a one asserts the reset */ -static const reset_ip_name_t s_ctimerResets[] = CTIMER_RSTS; -#endif -#endif -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ - -/*! @brief Pointers real ISRs installed by drivers for each instance. */ -static ctimer_callback_t *s_ctimerCallback[sizeof(s_ctimerBases) / sizeof(s_ctimerBases[0])] = {0}; - -/*! @brief Callback type installed by drivers for each instance. */ -static ctimer_callback_type_t ctimerCallbackType[sizeof(s_ctimerBases) / sizeof(s_ctimerBases[0])] = { - kCTIMER_SingleCallback}; - -/*! @brief Array to map timer instance to IRQ number. */ -static const IRQn_Type s_ctimerIRQ[] = CTIMER_IRQS; - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t CTIMER_GetInstance(CTIMER_Type *base) -{ - uint32_t instance; - uint32_t ctimerArrayCount = (sizeof(s_ctimerBases) / sizeof(s_ctimerBases[0])); - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ctimerArrayCount; instance++) - { - if (s_ctimerBases[instance] == base) - { - break; - } - } - - assert(instance < ctimerArrayCount); - - return instance; -} - -/*! - * brief Ungates the clock and configures the peripheral for basic operation. - * - * note This API should be called at the beginning of the application before using the driver. - * - * param base Ctimer peripheral base address - * param config Pointer to the user configuration structure. - */ -void CTIMER_Init(CTIMER_Type *base, const ctimer_config_t *config) -{ - assert(config != NULL); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the timer clock*/ - CLOCK_EnableClock(s_ctimerClocks[CTIMER_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) -/* Reset the module. */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_RESET) && (FSL_FEATURE_CTIMER_HAS_NO_RESET)) - RESET_PeripheralReset(s_ctimerResets[CTIMER_GetInstance(base)]); -#endif -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ - -/* Setup the cimer mode and count select */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && (FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE)) - base->CTCR = CTIMER_CTCR_CTMODE(config->mode) | CTIMER_CTCR_CINSEL(config->input); -#endif - /* Setup the timer prescale value */ - base->PR = CTIMER_PR_PRVAL(config->prescale); -} - -/*! - * brief Gates the timer clock. - * - * param base Ctimer peripheral base address - */ -void CTIMER_Deinit(CTIMER_Type *base) -{ - uint32_t index = CTIMER_GetInstance(base); - /* Stop the timer */ - base->TCR &= ~CTIMER_TCR_CEN_MASK; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable the timer clock*/ - CLOCK_DisableClock(s_ctimerClocks[index]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Disable IRQ at NVIC Level */ - (void)DisableIRQ(s_ctimerIRQ[index]); -} - -/*! - * brief Fills in the timers configuration structure with the default settings. - * - * The default values are: - * code - * config->mode = kCTIMER_TimerMode; - * config->input = kCTIMER_Capture_0; - * config->prescale = 0; - * endcode - * param config Pointer to the user configuration structure. - */ -void CTIMER_GetDefaultConfig(ctimer_config_t *config) -{ - assert(config != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - /* Run as a timer */ - config->mode = kCTIMER_TimerMode; - /* This field is ignored when mode is timer */ - config->input = kCTIMER_Capture_0; - /* Timer counter is incremented on every APB bus clock */ - config->prescale = 0; -} - -/*! - * brief Configures the PWM signal parameters. - * - * Enables PWM mode on the match channel passed in and will then setup the match value - * and other match parameters to generate a PWM signal. - * This function can manually assign the specified channel to set the PWM cycle. - * - * note When setting PWM output from multiple output pins, all should use the same PWM - * frequency. Please use CTIMER_SetupPwmPeriod to set up the PWM with high resolution. - * - * param base Ctimer peripheral base address - * param pwmPeriodChannel Specify the channel to control the PWM period - * param matchChannel Match pin to be used to output the PWM signal - * param dutyCyclePercent PWM pulse width; the value should be between 0 to 100 - * param pwmFreq_Hz PWM signal frequency in Hz - * param srcClock_Hz Timer counter clock in Hz - * param enableInt Enable interrupt when the timer value reaches the match value of the PWM pulse, - * if it is 0 then no interrupt will be generated. - * - * return kStatus_Success on success - * kStatus_Fail If matchChannel is equal to pwmPeriodChannel; this channel is reserved to set the PWM cycle - */ -status_t CTIMER_SetupPwm(CTIMER_Type *base, - const ctimer_match_t pwmPeriodChannel, - ctimer_match_t matchChannel, - uint8_t dutyCyclePercent, - uint32_t pwmFreq_Hz, - uint32_t srcClock_Hz, - bool enableInt) -{ - assert(pwmFreq_Hz > 0U); - - uint32_t reg; - uint32_t period, pulsePeriod = 0; - uint32_t timerClock = srcClock_Hz / (base->PR + 1U); - uint32_t index = CTIMER_GetInstance(base); - - if (matchChannel == pwmPeriodChannel) - { - return kStatus_Fail; - } - - /* Enable PWM mode on the match channel */ - base->PWMC |= (1UL << (uint32_t)matchChannel); - - /* Clear the stop, reset and interrupt bits for this channel */ - reg = base->MCR; - reg &= - ~(((uint32_t)((uint32_t)CTIMER_MCR_MR0R_MASK | (uint32_t)CTIMER_MCR_MR0S_MASK | (uint32_t)CTIMER_MCR_MR0I_MASK)) - << ((uint32_t)matchChannel * 3U)); - - /* If call back function is valid then enable match interrupt for the channel */ - if (enableInt) - { - reg |= (((uint32_t)CTIMER_MCR_MR0I_MASK) << (CTIMER_MCR_MR0I_SHIFT + ((uint32_t)matchChannel * 3U))); - } - - /* Reset the counter when match on PWM period channel (pwmPeriodChannel) */ - reg |= ((uint32_t)((uint32_t)CTIMER_MCR_MR0R_MASK) << ((uint32_t)pwmPeriodChannel * 3U)); - - base->MCR = reg; - - /* Calculate PWM period match value */ - period = (timerClock / pwmFreq_Hz) - 1U; - - /* Calculate pulse width match value */ - if (dutyCyclePercent == 0U) - { - pulsePeriod = period + 1U; - } - else - { - pulsePeriod = (period * (100U - (uint32_t)dutyCyclePercent)) / 100U; - } - - /* Specified channel pwmPeriodChannel will define the PWM period */ - base->MR[pwmPeriodChannel] = period; - - /* This will define the PWM pulse period */ - base->MR[matchChannel] = pulsePeriod; - /* Clear status flags */ - CTIMER_ClearStatusFlags(base, ((uint32_t)CTIMER_IR_MR0INT_MASK) << (uint32_t)matchChannel); - /* If call back function is valid then enable interrupt and update the call back function */ - if (enableInt) - { - (void)EnableIRQ(s_ctimerIRQ[index]); - } - - return kStatus_Success; -} - -/*! - * brief Configures the PWM signal parameters. - * - * Enables PWM mode on the match channel passed in and will then setup the match value - * and other match parameters to generate a PWM signal. - * This function can manually assign the specified channel to set the PWM cycle. - * - * note When setting PWM output from multiple output pins, all should use the same PWM - * period - * - * param base Ctimer peripheral base address - * param pwmPeriodChannel Specify the channel to control the PWM period - * param matchChannel Match pin to be used to output the PWM signal - * param pwmPeriod PWM period match value - * param pulsePeriod Pulse width match value - * param enableInt Enable interrupt when the timer value reaches the match value of the PWM pulse, - * if it is 0 then no interrupt will be generated. - * - * return kStatus_Success on success - * kStatus_Fail If matchChannel is equal to pwmPeriodChannel; this channel is reserved to set the PWM period - */ -status_t CTIMER_SetupPwmPeriod(CTIMER_Type *base, - const ctimer_match_t pwmPeriodChannel, - ctimer_match_t matchChannel, - uint32_t pwmPeriod, - uint32_t pulsePeriod, - bool enableInt) -{ -/* Some CTimers only have 16bits , so the value is limited*/ -#if defined(FSL_FEATURE_SOC_CTIMER16B) && FSL_FEATURE_SOC_CTIMER16B - assert(!((FSL_FEATURE_CTIMER_BIT_SIZEn(base) < 32) && (pulsePeriod > 0xFFFFU))); -#endif - - uint32_t reg; - uint32_t index = CTIMER_GetInstance(base); - - if (matchChannel == pwmPeriodChannel) - { - return kStatus_Fail; - } - - /* Enable PWM mode on PWM pulse channel */ - base->PWMC |= (1UL << (uint32_t)matchChannel); - - /* Clear the stop, reset and interrupt bits for PWM pulse channel */ - reg = base->MCR; - reg &= - ~((uint32_t)((uint32_t)CTIMER_MCR_MR0R_MASK | (uint32_t)CTIMER_MCR_MR0S_MASK | (uint32_t)CTIMER_MCR_MR0I_MASK) - << ((uint32_t)matchChannel * 3U)); - - /* If call back function is valid then enable match interrupt for PWM pulse channel */ - if (enableInt) - { - reg |= (((uint32_t)CTIMER_MCR_MR0I_MASK) << (CTIMER_MCR_MR0I_SHIFT + ((uint32_t)matchChannel * 3U))); - } - - /* Reset the counter when match on PWM period channel (pwmPeriodChannel) */ - reg |= ((uint32_t)((uint32_t)CTIMER_MCR_MR0R_MASK) << ((uint32_t)pwmPeriodChannel * 3U)); - - base->MCR = reg; - - /* Specified channel pwmPeriodChannel will define the PWM period */ - base->MR[pwmPeriodChannel] = pwmPeriod; - - /* This will define the PWM pulse period */ - base->MR[matchChannel] = pulsePeriod; - /* Clear status flags */ - CTIMER_ClearStatusFlags(base, ((uint32_t)CTIMER_IR_MR0INT_MASK) << (uint32_t)matchChannel); - /* If call back function is valid then enable interrupt and update the call back function */ - if (enableInt) - { - (void)EnableIRQ(s_ctimerIRQ[index]); - } - - return kStatus_Success; -} - -/*! - * brief Updates the duty cycle of an active PWM signal. - * - * note Please use CTIMER_SetupPwmPeriod to update the PWM with high resolution. - * This function can manually assign the specified channel to set the PWM cycle. - * - * param base Ctimer peripheral base address - * param pwmPeriodChannel Specify the channel to control the PWM period - * param matchChannel Match pin to be used to output the PWM signal - * param dutyCyclePercent New PWM pulse width; the value should be between 0 to 100 - */ -void CTIMER_UpdatePwmDutycycle(CTIMER_Type *base, - const ctimer_match_t pwmPeriodChannel, - ctimer_match_t matchChannel, - uint8_t dutyCyclePercent) -{ - uint32_t pulsePeriod = 0, period; - - /* Specified channel pwmPeriodChannel defines the PWM period */ - period = base->MR[pwmPeriodChannel]; - - /* For 0% dutycyle, make pulse period greater than period so the event will never occur */ - if (dutyCyclePercent == 0U) - { - pulsePeriod = period + 1U; - } - else - { - pulsePeriod = (period * (100U - (uint32_t)dutyCyclePercent)) / 100U; - } - - /* Update dutycycle */ - base->MR[matchChannel] = pulsePeriod; -} - -/*! - * brief Setup the match register. - * - * User configuration is used to setup the match value and action to be taken when a match occurs. - * - * param base Ctimer peripheral base address - * param matchChannel Match register to configure - * param config Pointer to the match configuration structure - */ -void CTIMER_SetupMatch(CTIMER_Type *base, ctimer_match_t matchChannel, const ctimer_match_config_t *config) -{ -/* Some CTimers only have 16bits , so the value is limited*/ -#if defined(FSL_FEATURE_SOC_CTIMER16B) && FSL_FEATURE_SOC_CTIMER16B - assert(!(FSL_FEATURE_CTIMER_BIT_SIZEn(base) < 32 && config->matchValue > 0xFFFFU)); -#endif - uint32_t reg; - uint32_t index = CTIMER_GetInstance(base); - - /* Set the counter operation when a match on this channel occurs */ - reg = base->MCR; - reg &= - ~((uint32_t)((uint32_t)CTIMER_MCR_MR0R_MASK | (uint32_t)CTIMER_MCR_MR0S_MASK | (uint32_t)CTIMER_MCR_MR0I_MASK) - << ((uint32_t)matchChannel * 3U)); - reg |= ((uint32_t)(config->enableCounterReset) << (CTIMER_MCR_MR0R_SHIFT + ((uint32_t)matchChannel * 3U))); - reg |= ((uint32_t)(config->enableCounterStop) << (CTIMER_MCR_MR0S_SHIFT + ((uint32_t)matchChannel * 3U))); - reg |= ((uint32_t)(config->enableInterrupt) << (CTIMER_MCR_MR0I_SHIFT + ((uint32_t)matchChannel * 3U))); - base->MCR = reg; - - reg = base->EMR; - /* Set the match output operation when a match on this channel occurs */ - reg &= ~(((uint32_t)CTIMER_EMR_EMC0_MASK) << ((uint32_t)matchChannel * 2U)); - reg |= ((uint32_t)config->outControl) << (CTIMER_EMR_EMC0_SHIFT + ((uint32_t)matchChannel * 2U)); - - /* Set the initial state of the EM bit/output */ - reg &= ~(((uint32_t)CTIMER_EMR_EM0_MASK) << (uint32_t)matchChannel); - reg |= ((uint32_t)config->outPinInitState) << (uint32_t)matchChannel; - base->EMR = reg; - - /* Set the match value */ - base->MR[matchChannel] = config->matchValue; - /* Clear status flags */ - CTIMER_ClearStatusFlags(base, ((uint32_t)CTIMER_IR_MR0INT_MASK) << (uint32_t)matchChannel); - /* If interrupt is enabled then enable interrupt and update the call back function */ - if (config->enableInterrupt) - { - (void)EnableIRQ(s_ctimerIRQ[index]); - } -} - -/*! - * brief Get the status of output match. - * - * This function gets the status of output MAT, whether or not this output is connected to a pin. - * This status is driven to the MAT pins if the match function is selected via IOCON. 0 = LOW. 1 = HIGH. - * - * param base Ctimer peripheral base address - * param matchChannel External match channel, user can obtain the status of multiple match channels - * at the same time by using the logic of "|" - * enumeration ::ctimer_external_match_t - * return The mask of external match channel status flags. Users need to use the - * _ctimer_external_match type to decode the return variables. - */ -uint32_t CTIMER_GetOutputMatchStatus(CTIMER_Type *base, uint32_t matchChannel) -{ - return (base->EMR & matchChannel); -} - -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && (FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE)) -/*! - * brief Setup the capture. - * - * param base Ctimer peripheral base address - * param capture Capture channel to configure - * param edge Edge on the channel that will trigger a capture - * param enableInt Flag to enable channel interrupts, if enabled then the registered call back - * is called upon capture - */ -void CTIMER_SetupCapture(CTIMER_Type *base, - ctimer_capture_channel_t capture, - ctimer_capture_edge_t edge, - bool enableInt) -{ - uint32_t reg = base->CCR; - uint32_t index = CTIMER_GetInstance(base); - - /* Set the capture edge */ - reg &= ~((uint32_t)((uint32_t)CTIMER_CCR_CAP0RE_MASK | (uint32_t)CTIMER_CCR_CAP0FE_MASK | - (uint32_t)CTIMER_CCR_CAP0I_MASK) - << ((uint32_t)capture * 3U)); - reg |= ((uint32_t)edge) << (CTIMER_CCR_CAP0RE_SHIFT + ((uint32_t)capture * 3U)); - /* Clear status flags */ - CTIMER_ClearStatusFlags(base, (((uint32_t)kCTIMER_Capture0Flag) << (uint32_t)capture)); - /* If call back function is valid then enable capture interrupt for the channel and update the call back function */ - if (enableInt) - { - reg |= ((uint32_t)CTIMER_CCR_CAP0I_MASK) << ((uint32_t)capture * 3U); - (void)EnableIRQ(s_ctimerIRQ[index]); - } - base->CCR = reg; -} -#endif - -/*! - * brief Register callback. - * - * param base Ctimer peripheral base address - * param cb_func callback function - * param cb_type callback function type, singular or multiple - */ -void CTIMER_RegisterCallBack(CTIMER_Type *base, ctimer_callback_t *cb_func, ctimer_callback_type_t cb_type) -{ - uint32_t index = CTIMER_GetInstance(base); - s_ctimerCallback[index] = cb_func; - ctimerCallbackType[index] = cb_type; -} - -/*! - * brief CTIMER generic IRQ handle function. - * - * param index FlexCAN peripheral instance index. - */ -static void CTIMER_GenericIRQHandler(uint32_t index) -{ - uint32_t int_stat, i, mask; - /* Get Interrupt status flags */ - int_stat = CTIMER_GetStatusFlags(s_ctimerBases[index]); - /* Clear the status flags that were set */ - CTIMER_ClearStatusFlags(s_ctimerBases[index], int_stat); - if (ctimerCallbackType[index] == kCTIMER_SingleCallback) - { - if (s_ctimerCallback[index][0] != NULL) - { - s_ctimerCallback[index][0](int_stat); - } - } - else - { -#if defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE - for (i = 0; i <= CTIMER_IR_MR3INT_SHIFT; i++) -#else -#if defined(FSL_FEATURE_CTIMER_HAS_IR_CR3INT) && FSL_FEATURE_CTIMER_HAS_IR_CR3INT - for (i = 0; i <= CTIMER_IR_CR3INT_SHIFT; i++) -#else -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_IR_CR2INT) && FSL_FEATURE_CTIMER_HAS_NO_IR_CR2INT) - for (i = 0; i <= CTIMER_IR_CR2INT_SHIFT; i++) -#else - for (i = 0; i <= CTIMER_IR_CR1INT_SHIFT; i++) -#endif /* FSL_FEATURE_CTIMER_HAS_NO_IR_CR2INT */ -#endif /* FSL_FEATURE_CTIMER_HAS_IR_CR3INT */ -#endif - { - mask = 0x01UL << i; - /* For each status flag bit that was set call the callback function if it is valid */ - if (((int_stat & mask) != 0U) && (s_ctimerCallback[index][i] != NULL)) - { - s_ctimerCallback[index][i](int_stat); - } - } - } - SDK_ISR_EXIT_BARRIER; -} - -/* IRQ handler functions overloading weak symbols in the startup */ -#if defined(CTIMER0) -void CTIMER0_DriverIRQHandler(void); -void CTIMER0_DriverIRQHandler(void) -{ - CTIMER_GenericIRQHandler(0); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CTIMER1) -void CTIMER1_DriverIRQHandler(void); -void CTIMER1_DriverIRQHandler(void) -{ - CTIMER_GenericIRQHandler(1); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CTIMER2) -void CTIMER2_DriverIRQHandler(void); -void CTIMER2_DriverIRQHandler(void) -{ - CTIMER_GenericIRQHandler(2); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CTIMER3) -void CTIMER3_DriverIRQHandler(void); -void CTIMER3_DriverIRQHandler(void) -{ - CTIMER_GenericIRQHandler(3); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CTIMER4) -void CTIMER4_DriverIRQHandler(void); -void CTIMER4_DriverIRQHandler(void) -{ - CTIMER_GenericIRQHandler(4); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CTIMER5) -void CTIMER5_DriverIRQHandler(void); -void CTIMER5_DriverIRQHandler(void) -{ - CTIMER_GenericIRQHandler(5); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CTIMER6) -void CTIMER6_DriverIRQHandler(void); -void CTIMER6_DriverIRQHandler(void) -{ - CTIMER_GenericIRQHandler(6); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CTIMER7) -void CTIMER7_DriverIRQHandler(void); -void CTIMER7_DriverIRQHandler(void) -{ - CTIMER_GenericIRQHandler(7); - SDK_ISR_EXIT_BARRIER; -} -#endif diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_ctimer.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_ctimer.h deleted file mode 100644 index 0ec7286e6c6..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_ctimer.h +++ /dev/null @@ -1,682 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_CTIMER_H_ -#define FSL_CTIMER_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup ctimer - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -#define FSL_CTIMER_DRIVER_VERSION (MAKE_VERSION(2, 3, 1)) /*!< Version 2.3.1 */ -/*! @} */ - -/*! @brief List of Timer capture channels */ -typedef enum _ctimer_capture_channel -{ - kCTIMER_Capture_0 = 0U, /*!< Timer capture channel 0 */ - kCTIMER_Capture_1, /*!< Timer capture channel 1 */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) && FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) - kCTIMER_Capture_2, /*!< Timer capture channel 2 */ -#endif /* FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2 */ -#if defined(FSL_FEATURE_CTIMER_HAS_CCR_CAP3) && FSL_FEATURE_CTIMER_HAS_CCR_CAP3 - kCTIMER_Capture_3 /*!< Timer capture channel 3 */ -#endif /* FSL_FEATURE_CTIMER_HAS_CCR_CAP3 */ -} ctimer_capture_channel_t; - -/*! @brief List of capture edge options */ -typedef enum _ctimer_capture_edge -{ - kCTIMER_Capture_RiseEdge = 1U, /*!< Capture on rising edge */ - kCTIMER_Capture_FallEdge = 2U, /*!< Capture on falling edge */ - kCTIMER_Capture_BothEdge = 3U, /*!< Capture on rising and falling edge */ -} ctimer_capture_edge_t; - -/*! @brief List of Timer match registers */ -typedef enum _ctimer_match -{ - kCTIMER_Match_0 = 0U, /*!< Timer match register 0 */ - kCTIMER_Match_1, /*!< Timer match register 1 */ - kCTIMER_Match_2, /*!< Timer match register 2 */ - kCTIMER_Match_3 /*!< Timer match register 3 */ -} ctimer_match_t; - -/*! @brief List of external match */ -typedef enum _ctimer_external_match -{ - kCTIMER_External_Match_0 = (1UL << 0), /*!< External match 0 */ - kCTIMER_External_Match_1 = (1UL << 1), /*!< External match 1 */ - kCTIMER_External_Match_2 = (1UL << 2), /*!< External match 2 */ - kCTIMER_External_Match_3 = (1UL << 3) /*!< External match 3 */ -} ctimer_external_match_t; - -/*! @brief List of output control options */ -typedef enum _ctimer_match_output_control -{ - kCTIMER_Output_NoAction = 0U, /*!< No action is taken */ - kCTIMER_Output_Clear, /*!< Clear the EM bit/output to 0 */ - kCTIMER_Output_Set, /*!< Set the EM bit/output to 1 */ - kCTIMER_Output_Toggle /*!< Toggle the EM bit/output */ -} ctimer_match_output_control_t; - -/*! @brief List of Timer modes */ -typedef enum _ctimer_timer_mode -{ - kCTIMER_TimerMode = 0U, /* TC is incremented every rising APB bus clock edge */ - kCTIMER_IncreaseOnRiseEdge, /* TC is incremented on rising edge of input signal */ - kCTIMER_IncreaseOnFallEdge, /* TC is incremented on falling edge of input signal */ - kCTIMER_IncreaseOnBothEdge /* TC is incremented on both edges of input signal */ -} ctimer_timer_mode_t; - -/*! @brief List of Timer interrupts */ -typedef enum _ctimer_interrupt_enable -{ - kCTIMER_Match0InterruptEnable = CTIMER_MCR_MR0I_MASK, /*!< Match 0 interrupt */ - kCTIMER_Match1InterruptEnable = CTIMER_MCR_MR1I_MASK, /*!< Match 1 interrupt */ - kCTIMER_Match2InterruptEnable = CTIMER_MCR_MR2I_MASK, /*!< Match 2 interrupt */ - kCTIMER_Match3InterruptEnable = CTIMER_MCR_MR3I_MASK, /*!< Match 3 interrupt */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && (FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE)) - kCTIMER_Capture0InterruptEnable = CTIMER_CCR_CAP0I_MASK, /*!< Capture 0 interrupt */ - kCTIMER_Capture1InterruptEnable = CTIMER_CCR_CAP1I_MASK, /*!< Capture 1 interrupt */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) && FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) - kCTIMER_Capture2InterruptEnable = CTIMER_CCR_CAP2I_MASK, /*!< Capture 2 interrupt */ -#endif /* FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2 */ -#if defined(FSL_FEATURE_CTIMER_HAS_CCR_CAP3) && FSL_FEATURE_CTIMER_HAS_CCR_CAP3 - kCTIMER_Capture3InterruptEnable = CTIMER_CCR_CAP3I_MASK, /*!< Capture 3 interrupt */ -#endif /* FSL_FEATURE_CTIMER_HAS_CCR_CAP3 */ -#endif -} ctimer_interrupt_enable_t; - -/*! @brief List of Timer flags */ -typedef enum _ctimer_status_flags -{ - kCTIMER_Match0Flag = CTIMER_IR_MR0INT_MASK, /*!< Match 0 interrupt flag */ - kCTIMER_Match1Flag = CTIMER_IR_MR1INT_MASK, /*!< Match 1 interrupt flag */ - kCTIMER_Match2Flag = CTIMER_IR_MR2INT_MASK, /*!< Match 2 interrupt flag */ - kCTIMER_Match3Flag = CTIMER_IR_MR3INT_MASK, /*!< Match 3 interrupt flag */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && (FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE)) - kCTIMER_Capture0Flag = CTIMER_IR_CR0INT_MASK, /*!< Capture 0 interrupt flag */ - kCTIMER_Capture1Flag = CTIMER_IR_CR1INT_MASK, /*!< Capture 1 interrupt flag */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_IR_CR2INT) && FSL_FEATURE_CTIMER_HAS_NO_IR_CR2INT) - kCTIMER_Capture2Flag = CTIMER_IR_CR2INT_MASK, /*!< Capture 2 interrupt flag */ -#endif /* FSL_FEATURE_CTIMER_HAS_NO_IR_CR2INT */ -#if defined(FSL_FEATURE_CTIMER_HAS_IR_CR3INT) && FSL_FEATURE_CTIMER_HAS_IR_CR3INT - kCTIMER_Capture3Flag = CTIMER_IR_CR3INT_MASK, /*!< Capture 3 interrupt flag */ -#endif /* FSL_FEATURE_CTIMER_HAS_IR_CR3INT */ -#endif -} ctimer_status_flags_t; - -typedef void (*ctimer_callback_t)(uint32_t flags); - -/*! @brief Callback type when registering for a callback. When registering a callback - * an array of function pointers is passed the size could be 1 or 8, the callback - * type will tell that. - */ -typedef enum -{ - kCTIMER_SingleCallback, /*!< Single Callback type where there is only one callback for the timer. - based on the status flags different channels needs to be handled differently */ - kCTIMER_MultipleCallback /*!< Multiple Callback type where there can be 8 valid callbacks, one per channel. - for both match/capture */ -} ctimer_callback_type_t; - -/*! - * @brief Match configuration - * - * This structure holds the configuration settings for each match register. - */ -typedef struct _ctimer_match_config -{ - uint32_t matchValue; /*!< This is stored in the match register */ - bool enableCounterReset; /*!< true: Match will reset the counter - false: Match will not reser the counter */ - bool enableCounterStop; /*!< true: Match will stop the counter - false: Match will not stop the counter */ - ctimer_match_output_control_t outControl; /*!< Action to be taken on a match on the EM bit/output */ - bool outPinInitState; /*!< Initial value of the EM bit/output */ - bool enableInterrupt; /*!< true: Generate interrupt upon match - false: Do not generate interrupt on match */ - -} ctimer_match_config_t; - -/*! - * @brief Timer configuration structure - * - * This structure holds the configuration settings for the Timer peripheral. To initialize this - * structure to reasonable defaults, call the CTIMER_GetDefaultConfig() function and pass a - * pointer to the configuration structure instance. - * - * The configuration structure can be made constant so as to reside in flash. - */ -typedef struct _ctimer_config -{ - ctimer_timer_mode_t mode; /*!< Timer mode */ - ctimer_capture_channel_t input; /*!< Input channel to increment the timer, used only in timer - modes that rely on this input signal to increment TC */ - uint32_t prescale; /*!< Prescale value */ -} ctimer_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Ungates the clock and configures the peripheral for basic operation. - * - * @note This API should be called at the beginning of the application before using the driver. - * - * @param base Ctimer peripheral base address - * @param config Pointer to the user configuration structure. - */ -void CTIMER_Init(CTIMER_Type *base, const ctimer_config_t *config); - -/*! - * @brief Gates the timer clock. - * - * @param base Ctimer peripheral base address - */ -void CTIMER_Deinit(CTIMER_Type *base); - -/*! - * @brief Fills in the timers configuration structure with the default settings. - * - * The default values are: - * @code - * config->mode = kCTIMER_TimerMode; - * config->input = kCTIMER_Capture_0; - * config->prescale = 0; - * @endcode - * @param config Pointer to the user configuration structure. - */ -void CTIMER_GetDefaultConfig(ctimer_config_t *config); - -/*! @}*/ - -/*! - * @name PWM setup operations - * @{ - */ - -/*! - * @brief Configures the PWM signal parameters. - * - * Enables PWM mode on the match channel passed in and will then setup the match value - * and other match parameters to generate a PWM signal. - * This function can manually assign the specified channel to set the PWM cycle. - * - * @note When setting PWM output from multiple output pins, all should use the same PWM - * period - * - * @param base Ctimer peripheral base address - * @param pwmPeriodChannel Specify the channel to control the PWM period - * @param matchChannel Match pin to be used to output the PWM signal - * @param pwmPeriod PWM period match value - * @param pulsePeriod Pulse width match value - * @param enableInt Enable interrupt when the timer value reaches the match value of the PWM pulse, - * if it is 0 then no interrupt will be generated. - */ -status_t CTIMER_SetupPwmPeriod(CTIMER_Type *base, - const ctimer_match_t pwmPeriodChannel, - ctimer_match_t matchChannel, - uint32_t pwmPeriod, - uint32_t pulsePeriod, - bool enableInt); - -/*! - * @brief Configures the PWM signal parameters. - * - * Enables PWM mode on the match channel passed in and will then setup the match value - * and other match parameters to generate a PWM signal. - * This function can manually assign the specified channel to set the PWM cycle. - * - * @note When setting PWM output from multiple output pins, all should use the same PWM - * frequency. Please use CTIMER_SetupPwmPeriod to set up the PWM with high resolution. - * - * @param base Ctimer peripheral base address - * @param pwmPeriodChannel Specify the channel to control the PWM period - * @param matchChannel Match pin to be used to output the PWM signal - * @param dutyCyclePercent PWM pulse width; the value should be between 0 to 100 - * @param pwmFreq_Hz PWM signal frequency in Hz - * @param srcClock_Hz Timer counter clock in Hz - * @param enableInt Enable interrupt when the timer value reaches the match value of the PWM pulse, - * if it is 0 then no interrupt will be generated. - */ -status_t CTIMER_SetupPwm(CTIMER_Type *base, - const ctimer_match_t pwmPeriodChannel, - ctimer_match_t matchChannel, - uint8_t dutyCyclePercent, - uint32_t pwmFreq_Hz, - uint32_t srcClock_Hz, - bool enableInt); - -/*! - * @brief Updates the pulse period of an active PWM signal. - * - * @param base Ctimer peripheral base address - * @param matchChannel Match pin to be used to output the PWM signal - * @param pulsePeriod New PWM pulse width match value - */ -static inline void CTIMER_UpdatePwmPulsePeriod(CTIMER_Type *base, ctimer_match_t matchChannel, uint32_t pulsePeriod) -{ - /* Update PWM pulse period match value */ - base->MR[matchChannel] = pulsePeriod; -} - -/*! - * @brief Updates the duty cycle of an active PWM signal. - * - * @note Please use CTIMER_SetupPwmPeriod to update the PWM with high resolution. - * This function can manually assign the specified channel to set the PWM cycle. - * - * @param base Ctimer peripheral base address - * @param pwmPeriodChannel Specify the channel to control the PWM period - * @param matchChannel Match pin to be used to output the PWM signal - * @param dutyCyclePercent New PWM pulse width; the value should be between 0 to 100 - */ -void CTIMER_UpdatePwmDutycycle(CTIMER_Type *base, - const ctimer_match_t pwmPeriodChannel, - ctimer_match_t matchChannel, - uint8_t dutyCyclePercent); - -/*! @}*/ - -/*! - * @brief Setup the match register. - * - * User configuration is used to setup the match value and action to be taken when a match occurs. - * - * @param base Ctimer peripheral base address - * @param matchChannel Match register to configure - * @param config Pointer to the match configuration structure - */ -void CTIMER_SetupMatch(CTIMER_Type *base, ctimer_match_t matchChannel, const ctimer_match_config_t *config); - -/*! - * @brief Get the status of output match. - * - * This function gets the status of output MAT, whether or not this output is connected to a pin. - * This status is driven to the MAT pins if the match function is selected via IOCON. 0 = LOW. 1 = HIGH. - * - * @param base Ctimer peripheral base address - * @param matchChannel External match channel, user can obtain the status of multiple match channels - * at the same time by using the logic of "|" - * enumeration ::ctimer_external_match_t - * @return The mask of external match channel status flags. Users need to use the - * _ctimer_external_match type to decode the return variables. - */ -uint32_t CTIMER_GetOutputMatchStatus(CTIMER_Type *base, uint32_t matchChannel); - -/*! - * @brief Setup the capture. - * - * @param base Ctimer peripheral base address - * @param capture Capture channel to configure - * @param edge Edge on the channel that will trigger a capture - * @param enableInt Flag to enable channel interrupts, if enabled then the registered call back - * is called upon capture - */ -void CTIMER_SetupCapture(CTIMER_Type *base, - ctimer_capture_channel_t capture, - ctimer_capture_edge_t edge, - bool enableInt); - -/*! - * @brief Get the timer count value from TC register. - * - * @param base Ctimer peripheral base address. - * @return return the timer count value. - */ -static inline uint32_t CTIMER_GetTimerCountValue(CTIMER_Type *base) -{ - return (base->TC); -} - -/*! - * @brief Register callback. - * - * @param base Ctimer peripheral base address - * @param cb_func callback function - * @param cb_type callback function type, singular or multiple - */ -void CTIMER_RegisterCallBack(CTIMER_Type *base, ctimer_callback_t *cb_func, ctimer_callback_type_t cb_type); - -/*! - * @name Interrupt Interface - * @{ - */ - -/*! - * @brief Enables the selected Timer interrupts. - * - * @param base Ctimer peripheral base address - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::ctimer_interrupt_enable_t - */ -static inline void CTIMER_EnableInterrupts(CTIMER_Type *base, uint32_t mask) -{ - /* Enable match interrupts */ - base->MCR |= mask & (CTIMER_MCR_MR0I_MASK | CTIMER_MCR_MR1I_MASK | CTIMER_MCR_MR2I_MASK | CTIMER_MCR_MR3I_MASK); - -/* Enable capture interrupts */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && (FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE)) - base->CCR |= mask & (CTIMER_CCR_CAP0I_MASK | CTIMER_CCR_CAP1I_MASK -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) && FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) - | CTIMER_CCR_CAP2I_MASK -#endif /* FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2 */ -#if defined(FSL_FEATURE_CTIMER_HAS_CCR_CAP3) && FSL_FEATURE_CTIMER_HAS_CCR_CAP3 - | CTIMER_CCR_CAP3I_MASK -#endif /* FSL_FEATURE_CTIMER_HAS_CCR_CAP3 */ - ); -#endif -} - -/*! - * @brief Disables the selected Timer interrupts. - * - * @param base Ctimer peripheral base address - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::ctimer_interrupt_enable_t - */ -static inline void CTIMER_DisableInterrupts(CTIMER_Type *base, uint32_t mask) -{ - /* Disable match interrupts */ - base->MCR &= ~(mask & (CTIMER_MCR_MR0I_MASK | CTIMER_MCR_MR1I_MASK | CTIMER_MCR_MR2I_MASK | CTIMER_MCR_MR3I_MASK)); - -/* Disable capture interrupts */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && (FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE)) - base->CCR &= ~(mask & (CTIMER_CCR_CAP0I_MASK | CTIMER_CCR_CAP1I_MASK -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) && FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) - | CTIMER_CCR_CAP2I_MASK -#endif /* FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2 */ -#if defined(FSL_FEATURE_CTIMER_HAS_CCR_CAP3) && FSL_FEATURE_CTIMER_HAS_CCR_CAP3 - | CTIMER_CCR_CAP3I_MASK -#endif /* FSL_FEATURE_CTIMER_HAS_CCR_CAP3 */ - )); -#endif -} - -/*! - * @brief Gets the enabled Timer interrupts. - * - * @param base Ctimer peripheral base address - * - * @return The enabled interrupts. This is the logical OR of members of the - * enumeration ::ctimer_interrupt_enable_t - */ -static inline uint32_t CTIMER_GetEnabledInterrupts(CTIMER_Type *base) -{ - uint32_t enabledIntrs = 0; - - /* Get all the match interrupts enabled */ - enabledIntrs = - base->MCR & (CTIMER_MCR_MR0I_MASK | CTIMER_MCR_MR1I_MASK | CTIMER_MCR_MR2I_MASK | CTIMER_MCR_MR3I_MASK); - -/* Get all the capture interrupts enabled */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && (FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE)) - enabledIntrs |= base->CCR & (CTIMER_CCR_CAP0I_MASK | CTIMER_CCR_CAP1I_MASK -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) && FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) - | CTIMER_CCR_CAP2I_MASK -#endif /* FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2 */ -#if defined(FSL_FEATURE_CTIMER_HAS_CCR_CAP3) && FSL_FEATURE_CTIMER_HAS_CCR_CAP3 - | CTIMER_CCR_CAP3I_MASK -#endif /* FSL_FEATURE_CTIMER_HAS_CCR_CAP3 */ - ); -#endif - - return enabledIntrs; -} - -/*! @}*/ - -/*! - * @name Status Interface - * @{ - */ - -/*! - * @brief Gets the Timer status flags. - * - * @param base Ctimer peripheral base address - * - * @return The status flags. This is the logical OR of members of the - * enumeration ::ctimer_status_flags_t - */ -static inline uint32_t CTIMER_GetStatusFlags(CTIMER_Type *base) -{ - return base->IR; -} - -/*! - * @brief Clears the Timer status flags. - * - * @param base Ctimer peripheral base address - * @param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::ctimer_status_flags_t - */ -static inline void CTIMER_ClearStatusFlags(CTIMER_Type *base, uint32_t mask) -{ - base->IR = mask; -} - -/*! @}*/ - -/*! - * @name Counter Start and Stop - * @{ - */ - -/*! - * @brief Starts the Timer counter. - * - * @param base Ctimer peripheral base address - */ -static inline void CTIMER_StartTimer(CTIMER_Type *base) -{ - base->TCR |= CTIMER_TCR_CEN_MASK; -} - -/*! - * @brief Stops the Timer counter. - * - * @param base Ctimer peripheral base address - */ -static inline void CTIMER_StopTimer(CTIMER_Type *base) -{ - base->TCR &= ~CTIMER_TCR_CEN_MASK; -} - -/*! @}*/ - -/*! - * @brief Reset the counter. - * - * The timer counter and prescale counter are reset on the next positive edge of the APB clock. - * - * @param base Ctimer peripheral base address - */ -static inline void CTIMER_Reset(CTIMER_Type *base) -{ - base->TCR |= CTIMER_TCR_CRST_MASK; - base->TCR &= ~CTIMER_TCR_CRST_MASK; -} - -/*! - * @brief Setup the timer prescale value. - * - * Specifies the maximum value for the Prescale Counter. - * - * @param base Ctimer peripheral base address - * @param prescale Prescale value - */ -static inline void CTIMER_SetPrescale(CTIMER_Type *base, uint32_t prescale) -{ - base->PR = CTIMER_PR_PRVAL(prescale); -} - -/*! - * @brief Get capture channel value. - * - * Get the counter/timer value on the corresponding capture channel. - * - * @param base Ctimer peripheral base address - * @param capture Select capture channel - * - * @return The timer count capture value. - */ -static inline uint32_t CTIMER_GetCaptureValue(CTIMER_Type *base, ctimer_capture_channel_t capture) -{ - return base->CR[capture]; -} - -/*! - * @brief Enable reset match channel. - * - * Set the specified match channel reset operation. - * - * @param base Ctimer peripheral base address - * @param match match channel used - * @param enable Enable match channel reset operation. - */ -static inline void CTIMER_EnableResetMatchChannel(CTIMER_Type *base, ctimer_match_t match, bool enable) -{ - if (enable) - { - base->MCR |= (1UL << (CTIMER_MCR_MR0R_SHIFT + ((uint32_t)match * 3U))); - } - else - { - base->MCR &= ~(1UL << (CTIMER_MCR_MR0R_SHIFT + ((uint32_t)match * 3U))); - } -} - -/*! - * @brief Enable stop match channel. - * - * Set the specified match channel stop operation. - * - * @param base Ctimer peripheral base address. - * @param match match channel used. - * @param enable Enable match channel stop operation. - */ -static inline void CTIMER_EnableStopMatchChannel(CTIMER_Type *base, ctimer_match_t match, bool enable) -{ - if (enable) - { - base->MCR |= (1UL << (CTIMER_MCR_MR0S_SHIFT + ((uint32_t)match * 3U))); - } - else - { - base->MCR &= ~(1UL << (CTIMER_MCR_MR0S_SHIFT + ((uint32_t)match * 3U))); - } -} - -#if (defined(FSL_FEATURE_CTIMER_HAS_MSR) && (FSL_FEATURE_CTIMER_HAS_MSR)) -/*! - * @brief Enable reload channel falling edge. - * - * Enable the specified match channel reload match shadow value. - * - * @param base Ctimer peripheral base address. - * @param match match channel used. - * @param enable Enable . - */ -static inline void CTIMER_EnableMatchChannelReload(CTIMER_Type *base, ctimer_match_t match, bool enable) -{ - if (enable) - { - base->MCR |= (1UL << (CTIMER_MCR_MR0RL_SHIFT + (uint32_t)match)); - } - else - { - base->MCR &= ~(1UL << (CTIMER_MCR_MR0RL_SHIFT + (uint32_t)match)); - } -} -#endif /* FSL_FEATURE_CTIMER_HAS_MSR */ - -/*! - * @brief Enable capture channel rising edge. - * - * Sets the specified capture channel for rising edge capture. - * - * @param base Ctimer peripheral base address. - * @param capture capture channel used. - * @param enable Enable rising edge capture. - */ -static inline void CTIMER_EnableRisingEdgeCapture(CTIMER_Type *base, ctimer_capture_channel_t capture, bool enable) -{ - if (enable) - { - base->CCR |= (1UL << (CTIMER_CCR_CAP0RE_SHIFT + ((uint32_t)capture * 3U))); - } - else - { - base->CCR &= ~(1UL << (CTIMER_CCR_CAP0RE_SHIFT + ((uint32_t)capture * 3U))); - } -} - -/*! - * @brief Enable capture channel falling edge. - * - * Sets the specified capture channel for falling edge capture. - * - * @param base Ctimer peripheral base address. - * @param capture capture channel used. - * @param enable Enable falling edge capture. - */ -static inline void CTIMER_EnableFallingEdgeCapture(CTIMER_Type *base, ctimer_capture_channel_t capture, bool enable) -{ - if (enable) - { - base->CCR |= (1UL << (CTIMER_CCR_CAP0FE_SHIFT + ((uint32_t)capture * 3U))); - } - else - { - base->CCR &= ~(1UL << (CTIMER_CCR_CAP0FE_SHIFT + ((uint32_t)capture * 3U))); - } -} - -#if (defined(FSL_FEATURE_CTIMER_HAS_MSR) && (FSL_FEATURE_CTIMER_HAS_MSR)) -/*! - * @brief Set the specified match shadow channel. - * - * @param base Ctimer peripheral base address. - * @param match match channel used. - * @param matchvalue Reload the value of the corresponding match register. - */ -static inline void CTIMER_SetShadowValue(CTIMER_Type *base, ctimer_match_t match, uint32_t matchvalue) -{ - base->MSR[match] = matchvalue; -} -#endif /* FSL_FEATURE_CTIMER_HAS_MSR */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_CTIMER_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_dac.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_dac.c deleted file mode 100644 index 09845018deb..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_dac.c +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2019, 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_dac.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.dac_1" -#endif - -#if defined(DAC_RSTS) -#define DAC_RESETS_ARRAY DAC_RSTS -#elif defined(DAC_RSTS_N) -#define DAC_RESETS_ARRAY DAC_RSTS_N -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Get instance number for DAC module. - * - * @param base DAC peripheral base address - */ -static uint32_t DAC_GetInstance(LPDAC_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to DAC bases for each instance. */ -static LPDAC_Type *const s_dacBases[] = LPDAC_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to DAC clocks for each instance. */ -static const clock_ip_name_t s_dacClocks[] = LPDAC_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(DAC_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_dacResets[] = DAC_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t DAC_GetInstance(LPDAC_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_dacBases); instance++) - { - if (s_dacBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_dacBases)); - - return instance; -} - -/*! - * brief Initialize the DAC module with common configuartion. - * - * The clock will be enabled in this function. - * - * param base DAC peripheral base address. - * param config Pointer to configuration structure. - */ -void DAC_Init(LPDAC_Type *base, const dac_config_t *config) -{ - assert(NULL != config); - - uint32_t tmp32 = 0U; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock. */ - CLOCK_EnableClock(s_dacClocks[DAC_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(DAC_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_dacResets[DAC_GetInstance(base)]); -#endif - - /* Reset the logic. */ - DAC_SetReset(base, kDAC_ResetLogic); - DAC_ClearReset(base, kDAC_ResetLogic); - - /* Reset the FIFO. */ - DAC_SetReset(base, kDAC_ResetFIFO); - DAC_ClearReset(base, kDAC_ResetFIFO); - - /* Configuration. */ - if (kDAC_FIFOTriggerBySoftwareMode == config->fifoTriggerMode) - { - tmp32 |= LPDAC_GCR_TRGSEL_MASK; /* Software trigger. */ - } - switch (config->fifoWorkMode) - { - case kDAC_FIFOWorkAsNormalMode: /* Normal FIFO. */ - tmp32 |= LPDAC_GCR_FIFOEN_MASK; - break; - case kDAC_FIFOWorkAsSwingMode: - tmp32 |= LPDAC_GCR_FIFOEN_MASK | LPDAC_GCR_SWMD_MASK; /* Enable swing mode. */ - break; -#if defined(FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE) && FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE - case kDAC_FIFOWorkAsPeriodTriggerMode: - tmp32 |= LPDAC_GCR_FIFOEN_MASK | LPDAC_GCR_PTGEN_MASK; /* Enable period trigger mode. */ - /* Set trigger number and width. */ - base->PCR = - LPDAC_PCR_PTG_NUM(config->periodicTriggerNumber) | LPDAC_PCR_PTG_PERIOD(config->periodicTriggerWidth); - break; - case kDAC_FIFOWorkAsPeriodTriggerAndSwingMode: - tmp32 |= LPDAC_GCR_FIFOEN_MASK | LPDAC_GCR_PTGEN_MASK | LPDAC_GCR_SWMD_MASK; - /* Set trigger number and width. */ - base->PCR = - LPDAC_PCR_PTG_NUM(config->periodicTriggerNumber) | LPDAC_PCR_PTG_PERIOD(config->periodicTriggerWidth); - break; -#endif /* FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE */ - default: /* kDAC_FIFODisabled. */ - break; - } - -#if defined(FSL_FEATURE_LPDAC_HAS_GCR_RCV_TRG) && FSL_FEATURE_LPDAC_HAS_GCR_RCV_TRG - if (config->enableExternalTriggerSource) - { - tmp32 |= LPDAC_GCR_RCV_TRG_MASK; /* Use trigger source from another DAC. */ - } -#endif /* FSL_FEATURE_LPDAC_HAS_GCR_RCV_TRG */ -#if defined(FSL_FEATURE_LPDAC_HAS_GCR_BUF_SPD_CTRL) && FSL_FEATURE_LPDAC_HAS_GCR_BUF_SPD_CTRL - if (false == config->enableLowerLowPowerMode) - { - tmp32 |= LPDAC_GCR_BUF_SPD_CTRL_MASK; /* Enable low power. */ - } -#else - if (config->enableLowPowerMode) - { - tmp32 |= LPDAC_GCR_LPEN_MASK; /* Enable low power. */ - } -#endif /* LPDAC_GCR_BUF_SPD_CTRL_MASK */ - -#if defined(FSL_FEATURE_LPDAC_HAS_GCR_BUF_EN) && FSL_FEATURE_LPDAC_HAS_GCR_BUF_EN - tmp32 |= LPDAC_GCR_BUF_EN_MASK; /* Opamp is used as buffer. */ -#endif /* FSL_FEATURE_LPDAC_HAS_GCR_BUF_EN */ -#if defined(FSL_FEATURE_LPDAC_HAS_GCR_LATCH_CYC) && FSL_FEATURE_LPDAC_HAS_GCR_LATCH_CYC - /* Configure DAC sync cycles. */ - tmp32 |= LPDAC_GCR_LATCH_CYC(config->syncTime); -#endif /* FSL_FEATURE_LPDAC_HAS_GCR_LATCH_CYC */ -#if defined(FSL_FEATURE_LPDAC_HAS_INTERNAL_REFERENCE_CURRENT) && FSL_FEATURE_LPDAC_HAS_INTERNAL_REFERENCE_CURRENT - tmp32 |= (uint32_t)config->referenceCurrentSource; -#endif /* FSL_FEATURE_LPDAC_HAS_INTERNAL_REFERENCE_CURRENT */ - /* Set reference voltage source. */ - tmp32 |= LPDAC_GCR_DACRFS(config->referenceVoltageSource); - - base->GCR = tmp32; - base->FCR = LPDAC_FCR_WML(config->fifoWatermarkLevel); - - /* Now, the DAC is disabled. It needs to be enabled in application. */ -} - -/*! - * brief Get the default settings for initialization's configuration. - * - * This function initializes the user configuration structure to a default value. The default values are: - * code - * config->fifoWatermarkLevel = 0U; - * config->fifoTriggerMode = kDAC_FIFOTriggerByHardwareMode; - * config->fifoWorkMode = kDAC_FIFODisabled; - * config->enableLowPowerMode = false; - * config->referenceVoltageSource = kDAC_ReferenceVoltageSourceAlt1; - * endcode - * - * param config Pointer to configuration structure. - * param - */ -void DAC_GetDefaultConfig(dac_config_t *config) -{ - assert(config != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->fifoWatermarkLevel = 0U; - config->fifoTriggerMode = kDAC_FIFOTriggerByHardwareMode; - config->fifoWorkMode = kDAC_FIFODisabled; - -#if defined(FSL_FEATURE_LPDAC_HAS_GCR_RCV_TRG) && FSL_FEATURE_LPDAC_HAS_GCR_RCV_TRG - config->enableExternalTriggerSource = false; -#endif /* FSL_FEATURE_LPDAC_HAS_GCR_RCV_TRG */ -#if defined(FSL_FEATURE_LPDAC_HAS_GCR_BUF_SPD_CTRL) && FSL_FEATURE_LPDAC_HAS_GCR_BUF_SPD_CTRL - config->enableLowerLowPowerMode = true; -#else - config->enableLowPowerMode = false; -#endif /* FSL_FEATURE_LPDAC_HAS_GCR_BUF_SPD_CTRL */ -#if defined(FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE) && FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE - config->periodicTriggerNumber = 0UL; - config->periodicTriggerWidth = 0UL; -#endif /* FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE */ -#if defined(FSL_FEATURE_LPDAC_HAS_GCR_LATCH_CYC) && FSL_FEATURE_LPDAC_HAS_GCR_LATCH_CYC - /* Configure DAC sync cycles. */ - config->syncTime = 1U; -#endif /* FSL_FEATURE_LPDAC_HAS_GCR_LATCH_CYC */ -#if defined(FSL_FEATURE_LPDAC_HAS_INTERNAL_REFERENCE_CURRENT) && FSL_FEATURE_LPDAC_HAS_INTERNAL_REFERENCE_CURRENT - config->referenceCurrentSource = kDAC_ReferenceCurrentSourcePtat; -#endif /* FSL_FEATURE_LPDAC_HAS_INTERNAL_REFERENCE_CURRENT */ - config->referenceVoltageSource = kDAC_ReferenceVoltageSourceAlt1; -} - -/*! - * brief De-initialize the DAC module. - * - * The clock will be disabled in this function. - * - * param base DAC peripheral base address. - * param - */ -void DAC_Deinit(LPDAC_Type *base) -{ - /* Disable the module. */ - DAC_Enable(base, false); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable the clock. */ - CLOCK_DisableClock(s_dacClocks[DAC_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_dac.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_dac.h deleted file mode 100644 index 5dcecf2db57..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_dac.h +++ /dev/null @@ -1,442 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2020, 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_DAC_H_ -#define FSL_DAC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup dac - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief DAC driver version 2.1.2. */ -#define FSL_DAC_DRIVER_VERSION (MAKE_VERSION(2, 1, 2)) -/*! @} */ - -/*! - * @brief DAC reset control. - */ -enum -{ - kDAC_ResetFIFO = LPDAC_RCR_FIFORST_MASK, /*!< Resets the FIFO pointers and flags. */ - kDAC_ResetLogic = LPDAC_RCR_SWRST_MASK, /*!< Resets all DAC registers and internal logic. */ -}; - -/*! - * @brief DAC interrupts. - */ -enum -{ - kDAC_FIFOFullInterruptEnable = LPDAC_IER_FULL_IE_MASK, /*!< FIFO full interrupt enable. */ - kDAC_FIFOEmptyInterruptEnable = LPDAC_IER_EMPTY_IE_MASK, /*!< FIFO empty interrupt enable. */ - kDAC_FIFOWatermarkInterruptEnable = LPDAC_IER_WM_IE_MASK, /*!< FIFO watermark interrupt enable. */ - kDAC_SwingBackInterruptEnable = LPDAC_IER_SWBK_IE_MASK, /*!< Swing back one cycle complete interrupt enable. */ - kDAC_FIFOOverflowInterruptEnable = LPDAC_IER_OF_IE_MASK, /*!< FIFO overflow interrupt enable. */ - kDAC_FIFOUnderflowInterruptEnable = LPDAC_IER_UF_IE_MASK, /*!< FIFO underflow interrupt enable. */ -#if defined(FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE) && FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE - kDAC_PeriodTriggerCompleteInterruptEnable = - LPDAC_IER_PTGCOCO_IE_MASK, /*!< Period trigger mode conversion complete interrupt enable */ -#endif /* FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE */ -}; - -/*! - * @brief DAC DMA switchers. - */ -enum -{ - kDAC_FIFOEmptyDMAEnable = LPDAC_DER_EMPTY_DMAEN_MASK, /*!< FIFO empty DMA enable. */ - kDAC_FIFOWatermarkDMAEnable = LPDAC_DER_WM_DMAEN_MASK, /*!< FIFO watermark DMA enable. */ -}; - -/*! - * @brief DAC status flags. - */ -enum -{ - kDAC_FIFOUnderflowFlag = LPDAC_FSR_UF_MASK, /*!< This flag means that there is a new trigger after the buffer is -empty. The FIFO read pointer will not -increase in this case and the data sent to DAC analog conversion will not changed. This flag is cleared by writing a 1 -to it. */ - - kDAC_FIFOOverflowFlag = - LPDAC_FSR_OF_MASK, /*!< This flag indicates that data is intended to write into FIFO after the -buffer is full. The writer pointer will -not increase in this case. The extra data will not be written into the FIFO. This flag is cleared by writing a 1 to it. -*/ - - kDAC_FIFOSwingBackFlag = LPDAC_FSR_SWBK_MASK, /*!< This flag indicates that the DAC has completed one period of -conversion in swing back mode. It means -that the read pointer has increased to the top (write pointer) once and then decreased to zero once. For -example, after three data is written to FIFO, the writer pointer is now 3. Then, if continually triggered, the -read pointer will swing like: 0-1-2-1-0-1-2-, and so on. After the fourth trigger, the flag is set. This flag is -cleared by writing a 1 to it. */ - - kDAC_FIFOWatermarkFlag = LPDAC_FSR_WM_MASK, /*!< This field is set if the remaining data in FIFO is less than or - equal to the setting value of wartermark. By writing data into FIFO by DMA or CPU, this flag is - cleared automatically when the data in FIFO is more than the setting value of watermark. */ - - kDAC_FIFOEmptyFlag = LPDAC_FSR_EMPTY_MASK, /*!< FIFO empty flag. */ - kDAC_FIFOFullFlag = LPDAC_FSR_FULL_MASK, /*!< FIFO full flag. */ -#if defined(FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE) && FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE - kDAC_PeriodTriggerCompleteFlag = LPDAC_FSR_PTGCOCO_MASK, /*!< Period trigger mode conversion complete flag. */ -#endif /* FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE */ -}; - -/*! - * @brief DAC FIFO trigger mode. - */ -typedef enum _dac_fifo_trigger_mode -{ - kDAC_FIFOTriggerByHardwareMode = 0U, /*!< Buffer would be triggered by hardware. */ - kDAC_FIFOTriggerBySoftwareMode = 1U, /*!< Buffer would be triggered by software. */ -} dac_fifo_trigger_mode_t; - -/*! - * @brief DAC FIFO work mode. - */ -typedef enum _dac_fifo_work_mode -{ - kDAC_FIFODisabled = 0U, /*!< FIFO mode is disabled and buffer mode is enabled. Any data written to DATA[DATA] goes - to buffer then goes to conversion. */ - kDAC_FIFOWorkAsNormalMode = 1U, /*!< FIFO mode is enabled. Data will be first read from FIFO to buffer then goes to - conversion. */ - kDAC_FIFOWorkAsSwingMode = 2U, /*!< In swing mode, the read pointer swings between the writer pointer and zero. That - is, the trigger increases the read pointer till reach the writer pointer and - decreases the read pointer till zero, and so on. The FIFO empty/full/watermark - flag will not update during swing back mode. */ -#if defined(FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE) && FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE - kDAC_FIFOWorkAsPeriodTriggerMode = - 3U, /*!< In periodic trigger mode, user only needs to send the first trigger. Then after every [PTG_PERIOD+1] - RCLK cycles, DAC will be automatically triggered by internal trigger. There will be [PTG_NUM] internal - triggers, thus in total [PTG_NUM+1] conversions including the first trigger sent by user. User can - terminate the current conversion queue by clearing the GCR[PTGEN] bit. Then, after the current conversion - is completed, the conversion is terminated and the PTGCOCO flag is set. If PCR[PTG_NUM] is set to zero, - there will be infinite triggers following the first hardware/software trigger, until the GCR[PTGEN] is - cleared by software. In any case, the conversion can be terminated by FIFORST/SWRST. */ - kDAC_FIFOWorkAsPeriodTriggerAndSwingMode = 4U, /*!< Periodically trigger DAC and swing back. */ -#endif /* FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE */ -} dac_fifo_work_mode_t; - -/*! - * @brief DAC reference voltage source. - */ -typedef enum _dac_reference_voltage_source -{ -#if defined(FSL_FEATURE_ANALOG_NUM_OF_VREF_SRC) && (FSL_FEATURE_ANALOG_NUM_OF_VREF_SRC == 3) - kDAC_ReferenceVoltageSourceAlt1 = 0U, /*!< The DAC selects VDD_ANA as the reference voltage. */ - kDAC_ReferenceVoltageSourceAlt2 = 1U, /*!< The DAC selects VREF_OUT as the reference voltage. */ - kDAC_ReferenceVoltageSourceAlt3 = 2U, /*!< THe DAC selects VREFH as the reference voltage. */ -#else - kDAC_ReferenceVoltageSourceAlt1 = 0U, /*!< The DAC selects VREFH_INT as the reference voltage. */ - kDAC_ReferenceVoltageSourceAlt2 = 1U, /*!< The DAC selects VREFH_EXT as the reference voltage. */ -#endif /* FSL_FEATURE_ANALOG_NUM_OF_VREF_SRC */ -} dac_reference_voltage_source_t; - -#if defined(FSL_FEATURE_LPDAC_HAS_INTERNAL_REFERENCE_CURRENT) && FSL_FEATURE_LPDAC_HAS_INTERNAL_REFERENCE_CURRENT -/* - * @brief DAC internal reference current source - */ -typedef enum _dac_reference_current_source -{ - kDAC_ReferenceCurrentSourcePtat = LPDAC_GCR_IREF_PTAT_EXT_SEL_MASK, /* Internal PTAT Current Reference selected */ - kDAC_ReferenceCurrentSourceZtc = LPDAC_GCR_IREF_ZTC_EXT_SEL_MASK, /* Internal ZTC Current Reference selected */ -} dac_reference_current_source_t; -#endif /* FSL_FEATURE_LPDAC_HAS_INTERNAL_REFERENCE_CURRENT */ - -/*! - * @brief DAC configuration structure. - */ -typedef struct _dac_config -{ - uint32_t fifoWatermarkLevel; /*!< FIFO's watermark, the max value can be the hardware FIFO size. */ - dac_fifo_trigger_mode_t fifoTriggerMode; /*!< Select the trigger mode for FIFO. */ - dac_fifo_work_mode_t fifoWorkMode; /*!< Select the work mode for FIFO. */ -#if defined(FSL_FEATURE_LPDAC_HAS_GCR_BUF_EN) && FSL_FEATURE_LPDAC_HAS_GCR_BUF_EN - bool enableOpampBuffer; /*!< Opamp is used as buffer. */ -#endif /* FSL_FEATURE_LPDAC_HAS_GCR_BUF_EN */ -#if defined(FSL_FEATURE_LPDAC_HAS_GCR_RCV_TRG) && FSL_FEATURE_LPDAC_HAS_GCR_RCV_TRG - bool enableExternalTriggerSource; /* DAC uses another DAC's hardware/software trigger as its trigger source. */ -#endif /* FSL_FEATURE_LPDAC_HAS_GCR_RCV_TRG */ -#if defined(FSL_FEATURE_LPDAC_HAS_GCR_BUF_SPD_CTRL) && FSL_FEATURE_LPDAC_HAS_GCR_BUF_SPD_CTRL - bool enableLowerLowPowerMode; /*!< Enable the lower low power mode. */ -#else - bool enableLowPowerMode; /*!< Enable the low power mode. */ -#endif /* FSL_FEATURE_LPDAC_HAS_GCR_BUF_SPD_CTRL */ -#if defined(FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE) && FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE - uint32_t periodicTriggerNumber; /*!< There will be 'periodicTriggerNumber' internal triggers following the first - hardware/software trigger. So there will be 'periodicTriggerNumber + 1' - conversions in total. If set to zero, there will be infinite triggers following - the first hw/sw trigger, until the GCR[PTGEN] is cleared. */ - uint32_t periodicTriggerWidth; /*!< Control the periodic trigger frequency. There will be 'periodicTriggerWidth + 1' - RCLK cycles between each periodic trigger. The periodic trigger frequency should - be configured to not larger than the analog conversion speed. */ -#endif /* FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE */ -#if defined(FSL_FEATURE_LPDAC_HAS_GCR_LATCH_CYC) && FSL_FEATURE_LPDAC_HAS_GCR_LATCH_CYC - uint32_t syncTime; /*!< RCLK cycles before data latch. accessible range is 0-15. It is used to configure the DAC - sync cycles which is helpful to reduce glitch on the output. The sync time is (LATCH_CYC+1) - RCLK cycles. User should configure this register according to the RCLK frequency. The - recommended sync time is at least 40ns.*/ -#endif /* FSL_FEATURE_LPDAC_HAS_GCR_LATCH_CYC */ -#if defined(FSL_FEATURE_LPDAC_HAS_INTERNAL_REFERENCE_CURRENT) && FSL_FEATURE_LPDAC_HAS_INTERNAL_REFERENCE_CURRENT - dac_reference_current_source_t referenceCurrentSource; /*!< Select the internal reference current source. */ -#endif /* FSL_FEATURE_LPDAC_HAS_INTERNAL_REFERENCE_CURRENT */ - dac_reference_voltage_source_t referenceVoltageSource; /*!< Select the reference voltage source. */ -} dac_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and de-initialization - * @{ - */ - -/*! - * @brief Initialize the DAC module with common configuartion. - * - * The clock will be enabled in this function. - * - * @param base DAC peripheral base address. - * @param config Pointer to configuration structure. - */ -void DAC_Init(LPDAC_Type *base, const dac_config_t *config); - -/*! - * @brief Get the default settings for initialization's configuration. - * - * This function initializes the user configuration structure to a default value. The default values are: - * @code - * config->fifoWatermarkLevel = 0U; - * config->fifoTriggerMode = kDAC_FIFOTriggerByHardwareMode; - * config->fifoWorkMode = kDAC_FIFODisabled; - * config->enableLowPowerMode = false; - * config->referenceVoltageSource = kDAC_ReferenceVoltageSourceAlt1; - * @endcode - * - * @param config Pointer to configuration structure. - */ -void DAC_GetDefaultConfig(dac_config_t *config); - -/*! - * @brief De-initialize the DAC module. - * - * The clock will be disabled in this function. - * - * @param base DAC peripheral base address. - */ -void DAC_Deinit(LPDAC_Type *base); - -/*! - * @brief Assert the reset control to part hardware. - * - * This function is to assert the reset control to part hardware. Responding part hardware would remain reset untill - * cleared by software. - * - * @param base DAC peripheral base address. - * @param mask The reset control mask, see to _dac_reset_control_t. - */ -static inline void DAC_SetReset(LPDAC_Type *base, uint32_t mask) -{ - base->RCR |= mask; -} - -/*! - * @brief Clear the reset control to part hardware. - * - * This function is to clear the reset control to part hardware. Responding part hardware would work after the reset - * control is cleared by software. - * - * @param base DAC peripheral base address. - * @param mask The reset control mask, see to _dac_reset_control_t. - */ -static inline void DAC_ClearReset(LPDAC_Type *base, uint32_t mask) -{ - base->RCR &= ~mask; -} - -/*! - * @brief Enable the DAC hardware system or not. - * - * This function is to start the Programmable Reference Generator operation or not. - * - * @param base DAC peripheral base address. - * @param enable Assertion of indicated event. - */ -static inline void DAC_Enable(LPDAC_Type *base, bool enable) -{ - if (enable) - { - base->GCR |= LPDAC_GCR_DACEN_MASK; - } - else - { - base->GCR &= ~LPDAC_GCR_DACEN_MASK; - } -} - -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enable the interrupts. - * - * @param base DAC peripheral base address. - * @param mask Mask value of indicated interrupt events. See to _dac_interrupt_enable. - */ -static inline void DAC_EnableInterrupts(LPDAC_Type *base, uint32_t mask) -{ - base->IER |= mask; -} - -/*! - * @brief Disable the interrupts. - * - * @param base DAC peripheral base address. - * @param mask Mask value of indicated interrupt events. See to _dac_interrupt_enable. - */ -static inline void DAC_DisableInterrupts(LPDAC_Type *base, uint32_t mask) -{ - base->IER &= ~mask; -} - -/*! @} */ - -/*! - * @name DMA control - * @{ - */ - -/*! - * @brief Enable the DMA switchers or not. - * - * @param base DAC peripheral base address. - * @param mask Mask value of indicated DMA requeset. See to _dac_dma_enable. - * @param enable Enable the DMA or not. - */ -static inline void DAC_EnableDMA(LPDAC_Type *base, uint32_t mask, bool enable) -{ - if (enable) - { - base->DER |= mask; - } - else - { - base->DER &= ~mask; - } -} - -/*! @} */ - -/*! - * @name Status flags - * @{ - */ - -/*! - * @brief Get status flags of DAC module. - * - * @param base DAC peripheral base address. - * @return Mask value of status flags. See to _dac_status_flags. - */ -static inline uint32_t DAC_GetStatusFlags(LPDAC_Type *base) -{ - return base->FSR; -} - -/*! - * @brief Clear status flags of DAC module. - * - * @param base DAC peripheral base address. - * @param flags Mask value of status flags to be cleared. See to _dac_status_flags. - */ -static inline void DAC_ClearStatusFlags(LPDAC_Type *base, uint32_t flags) -{ - base->FSR = flags; -} - -/*! @} */ - -/*! - * @name Functional feature - * @{ - */ - -/*! - * @brief Set data into the entry of FIFO buffer. - * - * @param base DAC peripheral base address. - * @param value Setting value into FIFO buffer. - */ -static inline void DAC_SetData(LPDAC_Type *base, uint32_t value) -{ - base->DATA = LPDAC_DATA_DATA(value); -} - -/*! - * @brief Get the value of the FIFO write pointer. - * - * @param base DAC peripheral base address. - * @return Current value of the FIFO write pointer. - */ - -static inline uint32_t DAC_GetFIFOWritePointer(LPDAC_Type *base) -{ - return (LPDAC_FPR_FIFO_WPT_MASK & base->FPR) >> LPDAC_FPR_FIFO_WPT_SHIFT; -} - -/*! - * @brief Get the value of the FIFO read pointer. - * - * @param base DAC peripheral base address. - * @return Current value of the FIFO read pointer. - */ - -static inline uint32_t DAC_GetFIFOReadPointer(LPDAC_Type *base) -{ - return (LPDAC_FPR_FIFO_RPT_MASK & base->FPR) >> LPDAC_FPR_FIFO_RPT_SHIFT; -} - -/*! - * @brief Do software trigger to FIFO when in software mode. - * - * @param base DAC peripheral base address. - */ - -static inline void DAC_DoSoftwareTriggerFIFO(LPDAC_Type *base) -{ - base->TCR = LPDAC_TCR_SWTRG_MASK; -} - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ -#endif /* FSL_DAC12_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_edma.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_edma.c deleted file mode 100644 index b444faac9be..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_edma.c +++ /dev/null @@ -1,2654 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_edma.h" -#if defined FSL_FEATURE_MEMORY_HAS_ADDRESS_OFFSET && FSL_FEATURE_MEMORY_HAS_ADDRESS_OFFSET -#include "fsl_memory.h" -#endif - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.edma4" -#endif -#if defined FSL_FEATURE_MEMORY_HAS_ADDRESS_OFFSET && FSL_FEATURE_MEMORY_HAS_ADDRESS_OFFSET -#define CONVERT_TO_DMA_ADDRESS(addr) (MEMORY_ConvertMemoryMapAddress((uint32_t)(addr), kMEMORY_Local2DMA)) -#else -#define CONVERT_TO_DMA_ADDRESS(addr) ((uint32_t)(addr)) -#endif -#if defined(DMA_RSTS_N) -#define EDMA_RESETS_ARRAY DMA_RSTS_N -#endif -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Map transfer width. - * - * @param width transfer width. - */ -static edma_transfer_size_t EDMA_TransferWidthMapping(uint32_t width); - -/*! - * @brief validate edma errata. - * - * @param base edma base address. - * @param tcd edma transfer content descriptor. - */ -#if defined FSL_FEATURE_EDMA_HAS_ERRATA_51327 -static inline status_t EDMA_CheckErrata(EDMA_Type *base, edma_tcd_t *tcd); -#endif -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Array to map EDMA instance number to base pointer. */ -static EDMA_Type *const s_edmaBases[] = EDMA_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Array to map EDMA instance number to clock name. */ -static const clock_ip_name_t s_edmaClockName[] = EDMA_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(EDMA_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_edmaResets[] = EDMA_RESETS_ARRAY; -#endif - -/*! @brief Array to map EDMA instance number to IRQ number. */ -static const IRQn_Type s_edmaIRQNumber[][FSL_FEATURE_EDMA_MODULE_CHANNEL] = EDMA_CHN_IRQS; - -/*! @brief Pointers to transfer handle for each EDMA channel. */ -static edma_handle_t *s_EDMAHandle[FSL_FEATURE_SOC_EDMA_COUNT][FSL_FEATURE_EDMA_MODULE_CHANNEL]; -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t EDMA_GetInstance(EDMA_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_edmaBases); instance++) - { - if (s_edmaBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_edmaBases)); - - return instance; -} - -#if defined FSL_FEATURE_EDMA_HAS_ERRATA_51327 -static inline status_t EDMA_CheckErrata(EDMA_Type *base, edma_tcd_t *tcd) -{ - status_t status = kStatus_Success; - /* errata 51327: to use scatter gather feature, NBYTES must be multiple of 8 */ - if ((uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_ERRATA_51327n(base) == 1U) - { - if ((EDMA_TCD_NBYTES(tcd, EDMA_TCD_TYPE(base)) % 8U) != 0U) - { - assert(false); - status = kStatus_InvalidArgument; - } - } - - return status; -} -#endif - -/*! - * brief Push content of TCD structure into hardware TCD register. - * - * param base EDMA peripheral base address. - * param channel EDMA channel number. - * param tcd Point to TCD structure. - */ -void EDMA_InstallTCD(EDMA_Type *base, uint32_t channel, edma_tcd_t *tcd) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - assert(tcd != NULL); - - edma_tcd_t *tcdRegs = EDMA_TCD_BASE(base, channel); - -#if defined FSL_FEATURE_EDMA_HAS_ERRATA_51327 - if ((EDMA_TCD_DLAST_SGA(tcd, EDMA_TCD_TYPE(base)) != 0U) && - ((EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) & (uint16_t)DMA_CSR_ESG_MASK) != 0U) && - (EDMA_CheckErrata(base, tcd) != kStatus_Success)) - { - assert(false); - } -#endif - - /* Clear DONE bit first, otherwise ESG cannot be set */ - DMA_CLEAR_DONE_STATUS(base, channel); - /* Push tcd into hardware TCD register */ - EDMA_TCD_SADDR(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_SADDR(tcd, EDMA_TCD_TYPE(base)); - EDMA_TCD_SOFF(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_SOFF(tcd, EDMA_TCD_TYPE(base)); - EDMA_TCD_ATTR(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_ATTR(tcd, EDMA_TCD_TYPE(base)); - EDMA_TCD_NBYTES(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_NBYTES(tcd, EDMA_TCD_TYPE(base)); - EDMA_TCD_SLAST(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_SLAST(tcd, EDMA_TCD_TYPE(base)); - EDMA_TCD_DADDR(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_DADDR(tcd, EDMA_TCD_TYPE(base)); - EDMA_TCD_DOFF(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_DOFF(tcd, EDMA_TCD_TYPE(base)); - EDMA_TCD_CITER(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)); - EDMA_TCD_DLAST_SGA(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_DLAST_SGA(tcd, EDMA_TCD_TYPE(base)); - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)); - EDMA_TCD_BITER(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)); -} - -/*! - * brief Initializes the eDMA peripheral. - * - * This function ungates the eDMA clock and configures the eDMA peripheral according - * to the configuration structure. - * - * param base eDMA peripheral base address. - * param config A pointer to the configuration structure, see "edma_config_t". - * note This function enables the minor loop map feature. - */ -void EDMA_Init(EDMA_Type *base, const edma_config_t *config) -{ - assert(config != NULL); - assert(FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base) != -1); - - uint32_t tmpreg, i = 0U; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate EDMA peripheral clock */ - CLOCK_EnableClock(s_edmaClockName[EDMA_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(EDMA_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_edmaResets[EDMA_GetInstance(base)]); -#endif - -#if defined(FSL_EDMA_SOC_IP_EDMA) && FSL_EDMA_SOC_IP_EDMA - /* clear all the enabled request, status to make sure EDMA status is in normal condition */ - EDMA_BASE(base)->ERQ = 0U; - EDMA_BASE(base)->INT = 0xFFFFFFFFU; - EDMA_BASE(base)->ERR = 0xFFFFFFFFU; - /* Configure EDMA peripheral according to the configuration structure. */ - tmpreg = EDMA_BASE(base)->CR; - tmpreg &= ~(DMA_CR_ERCA_MASK | DMA_CR_HOE_MASK | DMA_CR_CLM_MASK | DMA_CR_EDBG_MASK); - tmpreg |= (DMA_CR_ERCA(config->enableRoundRobinArbitration) | DMA_CR_HOE(config->enableHaltOnError) | - DMA_CR_CLM(config->enableContinuousLinkMode) | DMA_CR_EDBG(config->enableDebugMode) | DMA_CR_EMLM(1U)); - EDMA_BASE(base)->CR = tmpreg; -#else - tmpreg = EDMA_MP_BASE(base)->MP_CSR; -#if defined FSL_FEATURE_EDMA_HAS_GLOBAL_MASTER_ID_REPLICATION && FSL_FEATURE_EDMA_HAS_GLOBAL_MASTER_ID_REPLICATION - tmpreg = (tmpreg & ~(DMA_MP_CSR_HAE_MASK | DMA_MP_CSR_ERCA_MASK | DMA_MP_CSR_EDBG_MASK | DMA_MP_CSR_GCLC_MASK | - DMA_MP_CSR_GMRC_MASK | DMA_MP_CSR_HALT_MASK)) | - DMA_MP_CSR_GMRC(config->enableMasterIdReplication) | DMA_MP_CSR_HAE(config->enableHaltOnError) | - DMA_MP_CSR_ERCA(config->enableRoundRobinArbitration) | DMA_MP_CSR_EDBG(config->enableDebugMode) | - DMA_MP_CSR_GCLC(config->enableGlobalChannelLink); -#else - tmpreg = (tmpreg & ~(DMA_MP_CSR_HAE_MASK | DMA_MP_CSR_ERCA_MASK | DMA_MP_CSR_EDBG_MASK | DMA_MP_CSR_GCLC_MASK | - DMA_MP_CSR_HALT_MASK)) | - DMA_MP_CSR_HAE(config->enableHaltOnError) | DMA_MP_CSR_ERCA(config->enableRoundRobinArbitration) | - DMA_MP_CSR_EDBG(config->enableDebugMode) | DMA_MP_CSR_GCLC(config->enableGlobalChannelLink); -#endif - EDMA_MP_BASE(base)->MP_CSR = tmpreg; - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG && FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG - /* channel transfer configuration */ - for (i = 0U; i < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base); i++) - { - if (config->channelConfig[i] != NULL) - { - EDMA_InitChannel(base, i, config->channelConfig[i]); - } - } -#endif -#endif -} - -/*! - * brief Deinitializes the eDMA peripheral. - * - * This function gates the eDMA clock. - * - * param base eDMA peripheral base address. - */ -void EDMA_Deinit(EDMA_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate EDMA peripheral clock */ - CLOCK_DisableClock(s_edmaClockName[EDMA_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG && FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG -/*! - * brief EDMA Channel initialization - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param channelConfig pointer to user's eDMA channel config structure, see edma_channel_config_t for detail. - */ -void EDMA_InitChannel(EDMA_Type *base, uint32_t channel, edma_channel_config_t *channelConfig) -{ - assert(channelConfig != NULL); - - EDMA_SetChannelPreemptionConfig(base, channel, &channelConfig->channelPreemptionConfig); - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE && FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE - EDMA_SetChannelSwapSize(base, channel, channelConfig->channelSwapSize); -#endif - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE && FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE - EDMA_SetChannelMemoryAttribute(base, channel, channelConfig->channelWriteMemoryAttribute, - channelConfig->channelReadMemoryAttribute); -#endif -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_SIGN_EXTENSION && FSL_FEATURE_EDMA_HAS_CHANNEL_SIGN_EXTENSION - EDMA_SetChannelSignExtension(base, channel, channelConfig->channelDataSignExtensionBitPosition); -#endif -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE && FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE - EDMA_SetChannelAccessType(base, channel, channelConfig->channelAccessType); -#endif - -#if (defined FSL_FEATURE_EDMA_HAS_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_CHANNEL_MUX) || \ - (defined FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX) - if (0U != (uint32_t)channelConfig->channelRequestSource) - { - /* dma request source */ - EDMA_SetChannelMux(base, channel, (int32_t)channelConfig->channelRequestSource); - } -#endif - - /* master ID replication */ - EDMA_EnableChannelMasterIDReplication(base, channel, channelConfig->enableMasterIDReplication); -#if !(defined(FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) && FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) - /* dma transfer security level */ - EDMA_SetChannelSecurityLevel(base, channel, channelConfig->securityLevel); -#endif - /* dma transfer protection level */ - EDMA_SetChannelProtectionLevel(base, channel, channelConfig->protectionLevel); -} -#endif - -/*! - * brief Gets the eDMA default configuration structure. - * - * This function sets the configuration structure to default values. - * The default configuration is set to the following values. - * code - * config.enableContinuousLinkMode = false; - * config.enableHaltOnError = true; - * config.enableRoundRobinArbitration = false; - * config.enableDebugMode = false; - * endcode - * - * param config A pointer to the eDMA configuration structure. - */ -void EDMA_GetDefaultConfig(edma_config_t *config) -{ - assert(config != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->enableRoundRobinArbitration = false; - - config->enableHaltOnError = true; - -#if defined FSL_FEATURE_EDMA_HAS_CONTINUOUS_LINK_MODE && FSL_FEATURE_EDMA_HAS_CONTINUOUS_LINK_MODE - config->enableContinuousLinkMode = false; -#endif - -#if defined FSL_FEATURE_EDMA_HAS_GLOBAL_MASTER_ID_REPLICATION && FSL_FEATURE_EDMA_HAS_GLOBAL_MASTER_ID_REPLICATION - config->enableMasterIdReplication = false; -#endif - - config->enableDebugMode = false; - - config->enableGlobalChannelLink = true; -} - -/*! - * brief Sets all TCD registers to default values. - * - * This function sets TCD registers for this channel to default values. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * note This function must not be called while the channel transfer is ongoing - * or it causes unpredictable results. - * note This function enables the auto stop request feature. - */ -void EDMA_ResetChannel(EDMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - /* reset channel CSR */ - EDMA_ClearChannelStatusFlags(base, channel, (uint32_t)kEDMA_DoneFlag | (uint32_t)kEDMA_ErrorFlag); - /* reset channel TCD */ - EDMA_TcdResetExt(base, EDMA_TCD_BASE(base, channel)); -} - -/*! - * brief Configures the eDMA transfer attribute. - * - * This function configures the transfer attribute, including source address, destination address, - * transfer size, address offset, and so on. It also configures the scatter gather feature if the - * user supplies the TCD address. - * Example: - * code - * edma_transfer_t config; - * edma_tcd_t tcd; - * config.srcAddr = ..; - * config.destAddr = ..; - * ... - * EDMA_SetTransferConfig(DMA0, channel, &config, &stcd); - * endcode - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param config Pointer to eDMA transfer configuration structure. - * param nextTcd Point to TCD structure. It can be NULL if users - * do not want to enable scatter/gather feature. - * note If nextTcd is not NULL, it means scatter gather feature is enabled - * and DREQ bit is cleared in the previous transfer configuration, which - * is set in the eDMA_ResetChannel. - */ -void EDMA_SetTransferConfig(EDMA_Type *base, - uint32_t channel, - const edma_transfer_config_t *config, - edma_tcd_t *nextTcd) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - assert(config != NULL); - - EDMA_TcdSetTransferConfigExt(base, EDMA_TCD_BASE(base, channel), config, - (edma_tcd_t *)CONVERT_TO_DMA_ADDRESS(nextTcd)); -} - -/*! - * brief Configures the eDMA minor offset feature. - * - * The minor offset means that the signed-extended value is added to the source address or destination - * address after each minor loop. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param config A pointer to the minor offset configuration structure. - */ -void EDMA_SetMinorOffsetConfig(EDMA_Type *base, uint32_t channel, const edma_minor_offset_config_t *config) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - assert(config != NULL); - - uint32_t tmpreg; - - tmpreg = EDMA_TCD_NBYTES(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)); - tmpreg &= ~(DMA_NBYTES_MLOFFYES_SMLOE_MASK | DMA_NBYTES_MLOFFYES_DMLOE_MASK | DMA_NBYTES_MLOFFYES_MLOFF_MASK); - tmpreg |= - (DMA_NBYTES_MLOFFYES_SMLOE(config->enableSrcMinorOffset) | - DMA_NBYTES_MLOFFYES_DMLOE(config->enableDestMinorOffset) | DMA_NBYTES_MLOFFYES_MLOFF(config->minorOffset)); - EDMA_TCD_NBYTES(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) = tmpreg; -} - -/*! - * brief Configures the eDMA channel TCD major offset feature. - * - * Adjustment value added to the source address at the completion of the major iteration count - * - * param base eDMA peripheral base address. - * param channel edma channel number. - * param sourceOffset source address offset. - * param destOffset destination address offset. - */ -void EDMA_SetMajorOffsetConfig(EDMA_Type *base, uint32_t channel, int32_t sourceOffset, int32_t destOffset) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - EDMA_TCD_SLAST(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) = (uint32_t)sourceOffset; - EDMA_TCD_DLAST_SGA(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) = (uint32_t)destOffset; -} - -/*! - * brief Configures the eDMA channel preemption feature. - * - * This function configures the channel preemption attribute and the priority of the channel. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number - * param config A pointer to the channel preemption configuration structure. - */ -void EDMA_SetChannelPreemptionConfig(EDMA_Type *base, uint32_t channel, const edma_channel_Preemption_config_t *config) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - assert(config != NULL); - - bool tmpEnablePreemptAbility = config->enablePreemptAbility; - bool tmpEnablchannelPreemption = config->enableChannelPreemption; - uint8_t tmpChannelPriority = config->channelPriority; - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - - volatile uint8_t *tmpReg = &EDMA_BASE(base)->DCHPRI3; - - ((volatile uint8_t *)tmpReg)[DMA_DCHPRI_INDEX(channel)] = - (DMA_DCHPRI0_DPA((true == tmpEnablePreemptAbility ? 0U : 1U)) | - DMA_DCHPRI0_ECP((true == tmpEnablchannelPreemption ? 1U : 0U)) | DMA_DCHPRI0_CHPRI(tmpChannelPriority)); -#else - EDMA_CHANNEL_BASE(base, channel)->CH_PRI = DMA_CH_PRI_ECP(tmpEnablchannelPreemption) | - DMA_CH_PRI_DPA(tmpEnablePreemptAbility) | - DMA_CH_PRI_APL(tmpChannelPriority); -#endif -} - -/*! - * brief Sets the channel link for the eDMA transfer. - * - * This function configures either the minor link or the major link mode. The minor link means that the channel link is - * triggered every time CITER decreases by 1. The major link means that the channel link is triggered when the CITER is - * exhausted. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param type A channel link type, which can be one of the following: - * arg kEDMA_LinkNone - * arg kEDMA_MinorLink - * arg kEDMA_MajorLink - * param linkedChannel The linked channel number. - * note Users should ensure that DONE flag is cleared before calling this interface, or the configuration is invalid. - */ -void EDMA_SetChannelLink(EDMA_Type *base, uint32_t channel, edma_channel_link_type_t type, uint32_t linkedChannel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - assert(linkedChannel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - EDMA_TcdSetChannelLinkExt(base, EDMA_TCD_BASE(base, channel), type, linkedChannel); -} - -#if defined FSL_FEATURE_EDMA_HAS_BANDWIDTH && FSL_FEATURE_EDMA_HAS_BANDWIDTH -/*! - * brief Sets the bandwidth for the eDMA transfer. - * - * Because the eDMA processes the minor loop, it continuously generates read/write sequences - * until the minor count is exhausted. The bandwidth forces the eDMA to stall after the completion of - * each read/write access to control the bus request bandwidth seen by the crossbar switch. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param bandWidth A bandwidth setting, which can be one of the following: - * arg kEDMABandwidthStallNone - * arg kEDMABandwidthStall4Cycle - * arg kEDMABandwidthStall8Cycle - */ -void EDMA_SetBandWidth(EDMA_Type *base, uint32_t channel, edma_bandwidth_t bandWidth) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - EDMA_TCD_CSR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) = - (uint16_t)((EDMA_TCD_CSR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) & (~DMA_CSR_BWC_MASK)) | - DMA_CSR_BWC(bandWidth)); -} -#endif - -/*! - * brief Sets the source modulo and the destination modulo for the eDMA transfer. - * - * This function defines a specific address range specified to be the value after (SADDR + SOFF)/(DADDR + DOFF) - * calculation is performed or the original register value. It provides the ability to implement a circular data - * queue easily. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param srcModulo A source modulo value. - * param destModulo A destination modulo value. - */ -void EDMA_SetModulo(EDMA_Type *base, uint32_t channel, edma_modulo_t srcModulo, edma_modulo_t destModulo) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - uint16_t tmpreg = EDMA_TCD_ATTR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) & - (~(uint16_t)(DMA_ATTR_SMOD_MASK | DMA_ATTR_DMOD_MASK)); - EDMA_TCD_ATTR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) = - tmpreg | DMA_ATTR_DMOD(destModulo) | DMA_ATTR_SMOD(srcModulo); -} - -/*! - * brief Sets all fields to default values for the TCD structure. - * - * This function sets all fields for this TCD structure to default value. - * - * param base eDMA peripheral base address. - * param tcd Pointer to the TCD structure. - * note This function enables the auto stop request feature. - */ -void EDMA_TcdResetExt(EDMA_Type *base, edma_tcd_t *tcd) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - - /* Reset channel TCD */ - EDMA_TCD_SADDR(tcd, EDMA_TCD_TYPE(base)) = 0U; - EDMA_TCD_SOFF(tcd, EDMA_TCD_TYPE(base)) = 0U; - EDMA_TCD_ATTR(tcd, EDMA_TCD_TYPE(base)) = 0U; - EDMA_TCD_NBYTES(tcd, EDMA_TCD_TYPE(base)) = 0U; - EDMA_TCD_SLAST(tcd, EDMA_TCD_TYPE(base)) = 0U; - EDMA_TCD_DADDR(tcd, EDMA_TCD_TYPE(base)) = 0U; - EDMA_TCD_DOFF(tcd, EDMA_TCD_TYPE(base)) = 0U; - EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)) = 0U; - EDMA_TCD_DLAST_SGA(tcd, EDMA_TCD_TYPE(base)) = 0U; - /* Enable auto disable request feature */ - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) = DMA_CSR_DREQ(1U); - EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)) = 0U; -} - -/*! - * brief Configures the eDMA TCD transfer attribute. - * - * The TCD is a transfer control descriptor. The content of the TCD is the same as the hardware TCD registers. - * The TCD is used in the scatter-gather mode. - * This function configures the TCD transfer attribute, including source address, destination address, - * transfer size, address offset, and so on. It also configures the scatter gather feature if the - * user supplies the next TCD address. - * Example: - * code - * edma_transfer_t config = { - * ... - * } - * edma_tcd_t tcd __aligned(32); - * edma_tcd_t nextTcd __aligned(32); - * EDMA_TcdSetTransferConfig(&tcd, &config, &nextTcd); - * endcode - * - * param base eDMA peripheral base address. - * param tcd Pointer to the TCD structure. - * param config Pointer to eDMA transfer configuration structure. - * param nextTcd Pointer to the next TCD structure. It can be NULL if users - * do not want to enable scatter/gather feature. - * note TCD address should be 32 bytes aligned or it causes an eDMA error. - * note If the nextTcd is not NULL, the scatter gather feature is enabled - * and DREQ bit is cleared in the previous transfer configuration, which - * is set in the EDMA_TcdReset. - */ -void EDMA_TcdSetTransferConfigExt(EDMA_Type *base, - edma_tcd_t *tcd, - const edma_transfer_config_t *config, - edma_tcd_t *nextTcd) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - assert(config != NULL); - - EDMA_ConfigChannelSoftwareTCDExt(base, tcd, config); - - if (nextTcd != NULL) - { - EDMA_TCD_DLAST_SGA(tcd, EDMA_TCD_TYPE(base)) = CONVERT_TO_DMA_ADDRESS(nextTcd); - /* - Before call EDMA_TcdSetTransferConfig or EDMA_SetTransferConfig, - user must call EDMA_TcdReset or EDMA_ResetChannel which will set - DREQ, so must use "|" or "&" rather than "=". - - Clear the DREQ bit because scatter gather has been enabled, so the - previous transfer is not the last transfer, and channel request should - be enabled at the next transfer(the next TCD). - */ - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) = - (EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) | (uint16_t)DMA_CSR_ESG_MASK) & ~(uint16_t)DMA_CSR_DREQ_MASK; - } -} - -/*! - * brief Sets TCD fields according to the user's channel transfer configuration structure, see - * edma_transfer_config_t. - * - * Application should be careful about the TCD pool buffer storage class, - * - For the platform has cache, the software TCD should be put in non cache section - * - The TCD pool buffer should have a consistent storage class. - * - * param base eDMA peripheral base address. - * param tcd Pointer to the TCD structure. - * param transfer channel transfer configuration pointer. - * - */ -void EDMA_ConfigChannelSoftwareTCDExt(EDMA_Type *base, edma_tcd_t *tcd, const edma_transfer_config_t *transfer) -{ - assert(transfer != NULL); - assert((transfer->minorLoopBytes % (1UL << ((uint32_t)transfer->srcTransferSize))) == 0U); - assert((transfer->minorLoopBytes % (1UL << ((uint32_t)transfer->destTransferSize))) == 0U); - assert(((uint32_t)transfer->srcOffset % (1UL << ((uint32_t)transfer->srcTransferSize))) == 0U); - assert(((uint32_t)transfer->destOffset % (1UL << ((uint32_t)transfer->destTransferSize))) == 0U); - assert((transfer->srcAddr % (1UL << ((uint32_t)transfer->srcTransferSize))) == 0U); - assert((transfer->destAddr % (1UL << ((uint32_t)transfer->destTransferSize))) == 0U); - assert((transfer->srcAddr % (1UL << ((uint32_t)transfer->srcAddrModulo))) == 0U); - assert((transfer->destAddr % (1UL << ((uint32_t)transfer->dstAddrModulo))) == 0U); - - uint16_t tmpreg; - - EDMA_TCD_SADDR(tcd, EDMA_TCD_TYPE(base)) = CONVERT_TO_DMA_ADDRESS(transfer->srcAddr); - /* destination address */ - EDMA_TCD_DADDR(tcd, EDMA_TCD_TYPE(base)) = CONVERT_TO_DMA_ADDRESS(transfer->destAddr); - /* Source data and destination data transfer size */ - EDMA_TCD_ATTR(tcd, EDMA_TCD_TYPE(base)) = - DMA_ATTR_SSIZE(transfer->srcTransferSize) | DMA_ATTR_DSIZE(transfer->destTransferSize); - - /* Source address signed offset */ - EDMA_TCD_SOFF(tcd, EDMA_TCD_TYPE(base)) = (uint16_t)(transfer->srcOffset); - /* Destination address signed offset */ - EDMA_TCD_DOFF(tcd, EDMA_TCD_TYPE(base)) = (uint16_t)(transfer->destOffset); - - if (((transfer->enableSrcMinorLoopOffset) || (transfer->enableDstMinorLoopOffset))) - { - EDMA_TCD_NBYTES(tcd, EDMA_TCD_TYPE(base)) = DMA_NBYTES_MLOFFYES_NBYTES(transfer->minorLoopBytes) | - DMA_NBYTES_MLOFFYES_MLOFF(transfer->minorLoopOffset) | - DMA_NBYTES_MLOFFYES_DMLOE(transfer->enableDstMinorLoopOffset) | - DMA_NBYTES_MLOFFYES_SMLOE(transfer->enableSrcMinorLoopOffset); - } - else - { - EDMA_TCD_NBYTES(tcd, EDMA_TCD_TYPE(base)) = DMA_NBYTES_MLOFFNO_NBYTES(transfer->minorLoopBytes); - } - - /* Current major iteration count */ - EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)) = (uint16_t)(transfer->majorLoopCounts); - /* Starting major iteration count */ - EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)) = (uint16_t)(transfer->majorLoopCounts); - /* reset CSR firstly */ - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) = DMA_CSR_DREQ(1U); - /* Enable scatter/gather processing */ - if (transfer->linkTCD != NULL) - { - EDMA_TCD_DLAST_SGA(tcd, EDMA_TCD_TYPE(base)) = CONVERT_TO_DMA_ADDRESS((uint32_t)((uint8_t *)transfer->linkTCD)); - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) = - (EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) | (uint16_t)DMA_CSR_ESG_MASK) & ~(uint16_t)DMA_CSR_DREQ_MASK; - } - else - { - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_CSR_ESG_MASK; - EDMA_TCD_DLAST_SGA(tcd, EDMA_TCD_TYPE(base)) = (uint32_t)transfer->dstMajorLoopOffset; - } - - /* configure interrupt/auto disable channel request */ - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) |= (transfer->enabledInterruptMask & (~(uint16_t)kEDMA_ErrorInterruptEnable)); - - /* Minor link config */ - if (transfer->enableChannelMinorLoopLink) - { - /* Enable minor link */ - EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)) |= DMA_CITER_ELINKYES_ELINK_MASK; - EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)) |= DMA_BITER_ELINKYES_ELINK_MASK; - /* Set linked channel */ - tmpreg = EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)) & (~(uint16_t)DMA_CITER_ELINKYES_LINKCH_MASK); - tmpreg |= DMA_CITER_ELINKYES_LINKCH(transfer->minorLoopLinkChannel); - EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)) = tmpreg; - tmpreg = EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)) & (~(uint16_t)DMA_BITER_ELINKYES_LINKCH_MASK); - tmpreg |= DMA_BITER_ELINKYES_LINKCH(transfer->minorLoopLinkChannel); - EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)) = tmpreg; - } - /* Major link config */ - if (transfer->enableChannelMajorLoopLink) - { - /* Enable major link */ - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) |= DMA_CSR_MAJORELINK_MASK; - /* Set major linked channel */ - tmpreg = EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) & (~(uint16_t)DMA_CSR_MAJORLINKCH_MASK); - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) = tmpreg | DMA_CSR_MAJORLINKCH(transfer->majorLoopLinkChannel); - } - - /* clear link relate field if no channel link enabled */ - if ((!transfer->enableChannelMajorLoopLink) && (!transfer->enableChannelMinorLoopLink)) - { - EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_CITER_ELINKYES_ELINK_MASK; - EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_BITER_ELINKYES_ELINK_MASK; - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_CSR_MAJORELINK_MASK; - } - - /* major loop offset */ - EDMA_TCD_SLAST(tcd, EDMA_TCD_TYPE(base)) = (uint32_t)transfer->srcMajorLoopOffset; - /* modulo feature */ - tmpreg = EDMA_TCD_ATTR(tcd, EDMA_TCD_TYPE(base)) & (~(uint16_t)(DMA_ATTR_SMOD_MASK | DMA_ATTR_DMOD_MASK)); - EDMA_TCD_ATTR(tcd, EDMA_TCD_TYPE(base)) = - tmpreg | DMA_ATTR_DMOD(transfer->dstAddrModulo) | DMA_ATTR_SMOD(transfer->srcAddrModulo); -} - -/*! - * brief Configures the eDMA TCD minor offset feature. - * - * A minor offset is a signed-extended value added to the source address or a destination - * address after each minor loop. - * - * param base eDMA peripheral base address. - * param tcd A point to the TCD structure. - * param config A pointer to the minor offset configuration structure. - */ -void EDMA_TcdSetMinorOffsetConfigExt(EDMA_Type *base, edma_tcd_t *tcd, const edma_minor_offset_config_t *config) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - - uint32_t tmpreg; - - tmpreg = EDMA_TCD_NBYTES(tcd, EDMA_TCD_TYPE(base)) & - ~(DMA_NBYTES_MLOFFYES_SMLOE_MASK | DMA_NBYTES_MLOFFYES_DMLOE_MASK | DMA_NBYTES_MLOFFYES_MLOFF_MASK); - tmpreg |= - (DMA_NBYTES_MLOFFYES_SMLOE(config->enableSrcMinorOffset) | - DMA_NBYTES_MLOFFYES_DMLOE(config->enableDestMinorOffset) | DMA_NBYTES_MLOFFYES_MLOFF(config->minorOffset)); - EDMA_TCD_NBYTES(tcd, EDMA_TCD_TYPE(base)) = tmpreg; -} - -/*! - * brief Configures the eDMA TCD major offset feature. - * - * Adjustment value added to the source address at the completion of the major iteration count - * - * param base eDMA peripheral base address. - * param tcd A point to the TCD structure. - * param sourceOffset source address offset. - * param destOffset destination address offset. - */ -void EDMA_TcdSetMajorOffsetConfigExt(EDMA_Type *base, edma_tcd_t *tcd, int32_t sourceOffset, int32_t destOffset) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - - EDMA_TCD_SLAST(tcd, EDMA_TCD_TYPE(base)) = (uint32_t)sourceOffset; - EDMA_TCD_DLAST_SGA(tcd, EDMA_TCD_TYPE(base)) = (uint32_t)destOffset; -} - -/*! - * brief Sets the channel link for the eDMA TCD. - * - * This function configures either a minor link or a major link. The minor link means the channel link is - * triggered every time CITER decreases by 1. The major link means that the channel link is triggered when the CITER is - * exhausted. - * - * note Users should ensure that DONE flag is cleared before calling this interface, or the configuration is invalid. - * param base eDMA peripheral base address. - * param tcd Point to the TCD structure. - * param type Channel link type, it can be one of: - * arg kEDMA_LinkNone - * arg kEDMA_MinorLink - * arg kEDMA_MajorLink - * param linkedChannel The linked channel number. - */ -void EDMA_TcdSetChannelLinkExt(EDMA_Type *base, edma_tcd_t *tcd, edma_channel_link_type_t type, uint32_t linkedChannel) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - assert(linkedChannel < (uint32_t)FSL_FEATURE_EDMA_MODULE_CHANNEL); - - if (type == kEDMA_MinorLink) /* Minor link config */ - { - uint16_t tmpreg; - - /* Enable minor link */ - EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)) |= DMA_CITER_ELINKYES_ELINK_MASK; - EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)) |= DMA_BITER_ELINKYES_ELINK_MASK; - /* Set linked channel */ - tmpreg = EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)) & (~(uint16_t)DMA_CITER_ELINKYES_LINKCH_MASK); - tmpreg |= DMA_CITER_ELINKYES_LINKCH(linkedChannel); - EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)) = tmpreg; - tmpreg = EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)) & (~(uint16_t)DMA_BITER_ELINKYES_LINKCH_MASK); - tmpreg |= DMA_BITER_ELINKYES_LINKCH(linkedChannel); - EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)) = tmpreg; - } - else if (type == kEDMA_MajorLink) /* Major link config */ - { - uint16_t tmpreg; - - /* Enable major link */ - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) |= DMA_CSR_MAJORELINK_MASK; - /* Set major linked channel */ - tmpreg = EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) & (~(uint16_t)DMA_CSR_MAJORLINKCH_MASK); - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) = tmpreg | DMA_CSR_MAJORLINKCH(linkedChannel); - } - else /* Link none */ - { - EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_CITER_ELINKYES_ELINK_MASK; - EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_BITER_ELINKYES_ELINK_MASK; - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_CSR_MAJORELINK_MASK; - } -} - -/*! - * brief Sets the source modulo and the destination modulo for the eDMA TCD. - * - * This function defines a specific address range specified to be the value after (SADDR + SOFF)/(DADDR + DOFF) - * calculation is performed or the original register value. It provides the ability to implement a circular data - * queue easily. - * - * param base eDMA peripheral base address. - * param tcd A pointer to the TCD structure. - * param srcModulo A source modulo value. - * param destModulo A destination modulo value. - */ -void EDMA_TcdSetModuloExt(EDMA_Type *base, edma_tcd_t *tcd, edma_modulo_t srcModulo, edma_modulo_t destModulo) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - - uint16_t tmpreg; - - tmpreg = EDMA_TCD_ATTR(tcd, EDMA_TCD_TYPE(base)) & (~(uint16_t)(DMA_ATTR_SMOD_MASK | DMA_ATTR_DMOD_MASK)); - EDMA_TCD_ATTR(tcd, EDMA_TCD_TYPE(base)) = tmpreg | DMA_ATTR_DMOD(destModulo) | DMA_ATTR_SMOD(srcModulo); -} - -/*! - * brief Enables the interrupt source for the eDMA TCD. - * - * param base eDMA peripheral base address. - * param tcd Point to the TCD structure. - * param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_TcdEnableInterruptsExt(EDMA_Type *base, edma_tcd_t *tcd, uint32_t mask) -{ - assert(tcd != NULL); - - /* Enable Major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_MajorInterruptEnable)) - { - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) |= DMA_CSR_INTMAJOR_MASK; - } - - /* Enable Half major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_HalfInterruptEnable)) - { - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) |= DMA_CSR_INTHALF_MASK; - } -} - -/*! - * brief Disables the interrupt source for the eDMA TCD. - * - * param base eDMA peripheral base address. - * param tcd Point to the TCD structure. - * param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_TcdDisableInterruptsExt(EDMA_Type *base, edma_tcd_t *tcd, uint32_t mask) -{ - assert(tcd != NULL); - - /* Disable Major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_MajorInterruptEnable)) - { - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_CSR_INTMAJOR_MASK; - } - - /* Disable Half major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_HalfInterruptEnable)) - { - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_CSR_INTHALF_MASK; - } -} - -/*! - * brief Sets all fields to default values for the TCD structure. - * - * Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API ref - * EDMA_TcdResetExt - * - * This function sets all fields for this TCD structure to default value. - * - * param tcd Pointer to the TCD structure. - * note This function enables the auto stop request feature. - */ -void EDMA_TcdReset(edma_tcd_t *tcd) -{ - assert(tcd != NULL); - - /* Reset channel TCD */ - EDMA_TCD_SADDR(tcd, kEDMA_EDMA4Flag) = 0U; - EDMA_TCD_SOFF(tcd, kEDMA_EDMA4Flag) = 0U; - EDMA_TCD_ATTR(tcd, kEDMA_EDMA4Flag) = 0U; - EDMA_TCD_NBYTES(tcd, kEDMA_EDMA4Flag) = 0U; - EDMA_TCD_SLAST(tcd, kEDMA_EDMA4Flag) = 0U; - EDMA_TCD_DADDR(tcd, kEDMA_EDMA4Flag) = 0U; - EDMA_TCD_DOFF(tcd, kEDMA_EDMA4Flag) = 0U; - EDMA_TCD_CITER(tcd, kEDMA_EDMA4Flag) = 0U; - EDMA_TCD_DLAST_SGA(tcd, kEDMA_EDMA4Flag) = 0U; - /* Enable auto disable request feature */ - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) = DMA_CSR_DREQ(1U); - EDMA_TCD_BITER(tcd, kEDMA_EDMA4Flag) = 0U; -} - -/*! - * brief Configures the eDMA TCD transfer attribute. - * - * Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API ref - * EDMA_TcdSetTransferConfigExt - * - * The TCD is a transfer control descriptor. The content of the TCD is the same as the hardware TCD registers. - * The TCD is used in the scatter-gather mode. - * This function configures the TCD transfer attribute, including source address, destination address, - * transfer size, address offset, and so on. It also configures the scatter gather feature if the - * user supplies the next TCD address. - * Example: - * code - * edma_transfer_t config = { - * ... - * } - * edma_tcd_t tcd __aligned(32); - * edma_tcd_t nextTcd __aligned(32); - * EDMA_TcdSetTransferConfig(&tcd, &config, &nextTcd); - * endcode - * - * param tcd Pointer to the TCD structure. - * param config Pointer to eDMA transfer configuration structure. - * param nextTcd Pointer to the next TCD structure. It can be NULL if users - * do not want to enable scatter/gather feature. - * note TCD address should be 32 bytes aligned or it causes an eDMA error. - * note If the nextTcd is not NULL, the scatter gather feature is enabled - * and DREQ bit is cleared in the previous transfer configuration, which - * is set in the EDMA_TcdReset. - */ -void EDMA_TcdSetTransferConfig(edma_tcd_t *tcd, const edma_transfer_config_t *config, edma_tcd_t *nextTcd) -{ - assert(tcd != NULL); - assert(config != NULL); - - EDMA_ConfigChannelSoftwareTCD(tcd, config); - - if (nextTcd != NULL) - { - EDMA_TCD_DLAST_SGA(tcd, kEDMA_EDMA4Flag) = CONVERT_TO_DMA_ADDRESS(nextTcd); - /* - Before call EDMA_TcdSetTransferConfig or EDMA_SetTransferConfig, - user must call EDMA_TcdReset or EDMA_ResetChannel which will set - DREQ, so must use "|" or "&" rather than "=". - - Clear the DREQ bit because scatter gather has been enabled, so the - previous transfer is not the last transfer, and channel request should - be enabled at the next transfer(the next TCD). - */ - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) = - (EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) | (uint16_t)DMA_CSR_ESG_MASK) & ~(uint16_t)DMA_CSR_DREQ_MASK; - } -} - -/*! - * brief Sets TCD fields according to the user's channel transfer configuration structure, see - * edma_transfer_config_t. - * - * Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API ref - * EDMA_ConfigChannelSoftwareTCDExt - * - * Application should be careful about the TCD pool buffer storage class, - * - For the platform has cache, the software TCD should be put in non cache section - * - The TCD pool buffer should have a consistent storage class. - * - * param tcd Pointer to the TCD structure. - * param transfer channel transfer configuration pointer. - * - */ -void EDMA_ConfigChannelSoftwareTCD(edma_tcd_t *tcd, const edma_transfer_config_t *transfer) -{ - assert(transfer != NULL); - assert((transfer->minorLoopBytes % (1UL << ((uint32_t)transfer->srcTransferSize))) == 0U); - assert((transfer->minorLoopBytes % (1UL << ((uint32_t)transfer->destTransferSize))) == 0U); - assert(((uint32_t)transfer->srcOffset % (1UL << ((uint32_t)transfer->srcTransferSize))) == 0U); - assert(((uint32_t)transfer->destOffset % (1UL << ((uint32_t)transfer->destTransferSize))) == 0U); - assert((transfer->srcAddr % (1UL << ((uint32_t)transfer->srcTransferSize))) == 0U); - assert((transfer->destAddr % (1UL << ((uint32_t)transfer->destTransferSize))) == 0U); - assert((transfer->srcAddr % (1UL << ((uint32_t)transfer->srcAddrModulo))) == 0U); - assert((transfer->destAddr % (1UL << ((uint32_t)transfer->dstAddrModulo))) == 0U); - - uint16_t tmpreg; - - EDMA_TCD_SADDR(tcd, kEDMA_EDMA4Flag) = CONVERT_TO_DMA_ADDRESS(transfer->srcAddr); - /* destination address */ - EDMA_TCD_DADDR(tcd, kEDMA_EDMA4Flag) = CONVERT_TO_DMA_ADDRESS(transfer->destAddr); - /* Source data and destination data transfer size */ - EDMA_TCD_ATTR(tcd, kEDMA_EDMA4Flag) = - DMA_ATTR_SSIZE(transfer->srcTransferSize) | DMA_ATTR_DSIZE(transfer->destTransferSize); - - /* Source address signed offset */ - EDMA_TCD_SOFF(tcd, kEDMA_EDMA4Flag) = (uint16_t)(transfer->srcOffset); - /* Destination address signed offset */ - EDMA_TCD_DOFF(tcd, kEDMA_EDMA4Flag) = (uint16_t)(transfer->destOffset); - - if (((transfer->enableSrcMinorLoopOffset) || (transfer->enableDstMinorLoopOffset))) - { - EDMA_TCD_NBYTES(tcd, kEDMA_EDMA4Flag) = DMA_NBYTES_MLOFFYES_NBYTES(transfer->minorLoopBytes) | - DMA_NBYTES_MLOFFYES_MLOFF(transfer->minorLoopOffset) | - DMA_NBYTES_MLOFFYES_DMLOE(transfer->enableDstMinorLoopOffset) | - DMA_NBYTES_MLOFFYES_SMLOE(transfer->enableSrcMinorLoopOffset); - } - else - { - EDMA_TCD_NBYTES(tcd, kEDMA_EDMA4Flag) = DMA_NBYTES_MLOFFNO_NBYTES(transfer->minorLoopBytes); - } - - /* Current major iteration count */ - EDMA_TCD_CITER(tcd, kEDMA_EDMA4Flag) = (uint16_t)(transfer->majorLoopCounts); - /* Starting major iteration count */ - EDMA_TCD_BITER(tcd, kEDMA_EDMA4Flag) = (uint16_t)(transfer->majorLoopCounts); - /* reset CSR firstly */ - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) = DMA_CSR_DREQ(1U); - /* Enable scatter/gather processing */ - if (transfer->linkTCD != NULL) - { - EDMA_TCD_DLAST_SGA(tcd, kEDMA_EDMA4Flag) = CONVERT_TO_DMA_ADDRESS((uint32_t)((uint8_t *)transfer->linkTCD)); - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) = - (EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) | (uint16_t)DMA_CSR_ESG_MASK) & ~(uint16_t)DMA_CSR_DREQ_MASK; - } - else - { - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) &= ~(uint16_t)DMA_CSR_ESG_MASK; - EDMA_TCD_DLAST_SGA(tcd, kEDMA_EDMA4Flag) = (uint32_t)transfer->dstMajorLoopOffset; - } - - /* configure interrupt/auto disable channel request */ - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) |= (transfer->enabledInterruptMask & (~(uint16_t)kEDMA_ErrorInterruptEnable)); - - /* Minor link config */ - if (transfer->enableChannelMinorLoopLink) - { - /* Enable minor link */ - EDMA_TCD_CITER(tcd, kEDMA_EDMA4Flag) |= DMA_CITER_ELINKYES_ELINK_MASK; - EDMA_TCD_BITER(tcd, kEDMA_EDMA4Flag) |= DMA_BITER_ELINKYES_ELINK_MASK; - /* Set linked channel */ - tmpreg = EDMA_TCD_CITER(tcd, kEDMA_EDMA4Flag) & (~(uint16_t)DMA_CITER_ELINKYES_LINKCH_MASK); - tmpreg |= DMA_CITER_ELINKYES_LINKCH(transfer->minorLoopLinkChannel); - EDMA_TCD_CITER(tcd, kEDMA_EDMA4Flag) = tmpreg; - tmpreg = EDMA_TCD_BITER(tcd, kEDMA_EDMA4Flag) & (~(uint16_t)DMA_BITER_ELINKYES_LINKCH_MASK); - tmpreg |= DMA_BITER_ELINKYES_LINKCH(transfer->minorLoopLinkChannel); - EDMA_TCD_BITER(tcd, kEDMA_EDMA4Flag) = tmpreg; - } - /* Major link config */ - if (transfer->enableChannelMajorLoopLink) - { - /* Enable major link */ - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) |= DMA_CSR_MAJORELINK_MASK; - /* Set major linked channel */ - tmpreg = EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) & (~(uint16_t)DMA_CSR_MAJORLINKCH_MASK); - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) = tmpreg | DMA_CSR_MAJORLINKCH(transfer->majorLoopLinkChannel); - } - - /* clear link relate field if no channel link enabled */ - if ((!transfer->enableChannelMajorLoopLink) && (!transfer->enableChannelMinorLoopLink)) - { - EDMA_TCD_CITER(tcd, kEDMA_EDMA4Flag) &= ~(uint16_t)DMA_CITER_ELINKYES_ELINK_MASK; - EDMA_TCD_BITER(tcd, kEDMA_EDMA4Flag) &= ~(uint16_t)DMA_BITER_ELINKYES_ELINK_MASK; - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) &= ~(uint16_t)DMA_CSR_MAJORELINK_MASK; - } - - /* major loop offset */ - EDMA_TCD_SLAST(tcd, kEDMA_EDMA4Flag) = (uint32_t)transfer->srcMajorLoopOffset; - /* modulo feature */ - tmpreg = EDMA_TCD_ATTR(tcd, kEDMA_EDMA4Flag) & (~(uint16_t)(DMA_ATTR_SMOD_MASK | DMA_ATTR_DMOD_MASK)); - EDMA_TCD_ATTR(tcd, kEDMA_EDMA4Flag) = - tmpreg | DMA_ATTR_DMOD(transfer->dstAddrModulo) | DMA_ATTR_SMOD(transfer->srcAddrModulo); -} - -/*! - * brief Configures the eDMA TCD minor offset feature. - * - * Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API ref - * EDMA_TcdSetMinorOffsetConfigExt - * - * A minor offset is a signed-extended value added to the source address or a destination - * address after each minor loop. - * - * param tcd A point to the TCD structure. - * param config A pointer to the minor offset configuration structure. - */ -void EDMA_TcdSetMinorOffsetConfig(edma_tcd_t *tcd, const edma_minor_offset_config_t *config) -{ - assert(tcd != NULL); - - uint32_t tmpreg; - - tmpreg = EDMA_TCD_NBYTES(tcd, kEDMA_EDMA4Flag) & - ~(DMA_NBYTES_MLOFFYES_SMLOE_MASK | DMA_NBYTES_MLOFFYES_DMLOE_MASK | DMA_NBYTES_MLOFFYES_MLOFF_MASK); - tmpreg |= - (DMA_NBYTES_MLOFFYES_SMLOE(config->enableSrcMinorOffset) | - DMA_NBYTES_MLOFFYES_DMLOE(config->enableDestMinorOffset) | DMA_NBYTES_MLOFFYES_MLOFF(config->minorOffset)); - EDMA_TCD_NBYTES(tcd, kEDMA_EDMA4Flag) = tmpreg; -} - -/*! - * brief Configures the eDMA TCD major offset feature. - * - * Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API ref - * EDMA_TcdSetMajorOffsetConfigExt - * - * Adjustment value added to the source address at the completion of the major iteration count - * - * param tcd A point to the TCD structure. - * param sourceOffset source address offset. - * param destOffset destination address offset. - */ -void EDMA_TcdSetMajorOffsetConfig(edma_tcd_t *tcd, int32_t sourceOffset, int32_t destOffset) -{ - assert(tcd != NULL); - - EDMA_TCD_SLAST(tcd, kEDMA_EDMA4Flag) = (uint32_t)sourceOffset; - EDMA_TCD_DLAST_SGA(tcd, kEDMA_EDMA4Flag) = (uint32_t)destOffset; -} - -/*! - * brief Sets the channel link for the eDMA TCD. - * - * Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API ref - * EDMA_TcdSetChannelLinkExt - * - * This function configures either a minor link or a major link. The minor link means the channel link is - * triggered every time CITER decreases by 1. The major link means that the channel link is triggered when the CITER is - * exhausted. - * - * note Users should ensure that DONE flag is cleared before calling this interface, or the configuration is invalid. - * param tcd Point to the TCD structure. - * param type Channel link type, it can be one of: - * arg kEDMA_LinkNone - * arg kEDMA_MinorLink - * arg kEDMA_MajorLink - * param linkedChannel The linked channel number. - */ -void EDMA_TcdSetChannelLink(edma_tcd_t *tcd, edma_channel_link_type_t type, uint32_t linkedChannel) -{ - assert(tcd != NULL); - assert(linkedChannel < (uint32_t)FSL_FEATURE_EDMA_MODULE_CHANNEL); - - if (type == kEDMA_MinorLink) /* Minor link config */ - { - uint16_t tmpreg; - - /* Enable minor link */ - EDMA_TCD_CITER(tcd, kEDMA_EDMA4Flag) |= DMA_CITER_ELINKYES_ELINK_MASK; - EDMA_TCD_BITER(tcd, kEDMA_EDMA4Flag) |= DMA_BITER_ELINKYES_ELINK_MASK; - /* Set linked channel */ - tmpreg = EDMA_TCD_CITER(tcd, kEDMA_EDMA4Flag) & (~(uint16_t)DMA_CITER_ELINKYES_LINKCH_MASK); - tmpreg |= DMA_CITER_ELINKYES_LINKCH(linkedChannel); - EDMA_TCD_CITER(tcd, kEDMA_EDMA4Flag) = tmpreg; - tmpreg = EDMA_TCD_BITER(tcd, kEDMA_EDMA4Flag) & (~(uint16_t)DMA_BITER_ELINKYES_LINKCH_MASK); - tmpreg |= DMA_BITER_ELINKYES_LINKCH(linkedChannel); - EDMA_TCD_BITER(tcd, kEDMA_EDMA4Flag) = tmpreg; - } - else if (type == kEDMA_MajorLink) /* Major link config */ - { - uint16_t tmpreg; - - /* Enable major link */ - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) |= DMA_CSR_MAJORELINK_MASK; - /* Set major linked channel */ - tmpreg = EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) & (~(uint16_t)DMA_CSR_MAJORLINKCH_MASK); - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) = tmpreg | DMA_CSR_MAJORLINKCH(linkedChannel); - } - else /* Link none */ - { - EDMA_TCD_CITER(tcd, kEDMA_EDMA4Flag) &= ~(uint16_t)DMA_CITER_ELINKYES_ELINK_MASK; - EDMA_TCD_BITER(tcd, kEDMA_EDMA4Flag) &= ~(uint16_t)DMA_BITER_ELINKYES_ELINK_MASK; - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) &= ~(uint16_t)DMA_CSR_MAJORELINK_MASK; - } -} - -/*! - * brief Sets the source modulo and the destination modulo for the eDMA TCD. - * - * Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API ref - * EDMA_TcdSetModuloExt - * - * This function defines a specific address range specified to be the value after (SADDR + SOFF)/(DADDR + DOFF) - * calculation is performed or the original register value. It provides the ability to implement a circular data - * queue easily. - * - * param tcd A pointer to the TCD structure. - * param srcModulo A source modulo value. - * param destModulo A destination modulo value. - */ -void EDMA_TcdSetModulo(edma_tcd_t *tcd, edma_modulo_t srcModulo, edma_modulo_t destModulo) -{ - assert(tcd != NULL); - - uint16_t tmpreg; - - tmpreg = EDMA_TCD_ATTR(tcd, kEDMA_EDMA4Flag) & (~(uint16_t)(DMA_ATTR_SMOD_MASK | DMA_ATTR_DMOD_MASK)); - EDMA_TCD_ATTR(tcd, kEDMA_EDMA4Flag) = tmpreg | DMA_ATTR_DMOD(destModulo) | DMA_ATTR_SMOD(srcModulo); -} - -/*! - * brief Enables the interrupt source for the eDMA TCD. - * - * Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API ref - * EDMA_TcdEnableInterruptsExt - * - * param tcd Point to the TCD structure. - * param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_TcdEnableInterrupts(edma_tcd_t *tcd, uint32_t mask) -{ - assert(tcd != NULL); - - /* Enable Major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_MajorInterruptEnable)) - { - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) |= DMA_CSR_INTMAJOR_MASK; - } - - /* Enable Half major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_HalfInterruptEnable)) - { - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) |= DMA_CSR_INTHALF_MASK; - } -} - -/*! - * brief Disables the interrupt source for the eDMA TCD. - * - * Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API ref - * EDMA_TcdDisableInterruptsExt - * - * param tcd Point to the TCD structure. - * param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_TcdDisableInterrupts(edma_tcd_t *tcd, uint32_t mask) -{ - assert(tcd != NULL); - - /* Disable Major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_MajorInterruptEnable)) - { - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) &= ~(uint16_t)DMA_CSR_INTMAJOR_MASK; - } - - /* Disable Half major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_HalfInterruptEnable)) - { - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) &= ~(uint16_t)DMA_CSR_INTHALF_MASK; - } -} - -/*! - * brief Gets the remaining major loop count from the eDMA current channel TCD. - * - * This function checks the TCD (Task Control Descriptor) status for a specified - * eDMA channel and returns the number of major loop count that has not finished. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * return Major loop count which has not been transferred yet for the current TCD. - * note 1. This function can only be used to get unfinished major loop count of transfer without - * the next TCD, or it might be inaccuracy. - * 2. The unfinished/remaining transfer bytes cannot be obtained directly from registers while - * the channel is running. - * Because to calculate the remaining bytes, the initial NBYTES configured in DMA_TCDn_NBYTES_MLNO - * register is needed while the eDMA IP does not support getting it while a channel is active. - * In another word, the NBYTES value reading is always the actual (decrementing) NBYTES value the dma_engine - * is working with while a channel is running. - * Consequently, to get the remaining transfer bytes, a software-saved initial value of NBYTES (for example - * copied before enabling the channel) is needed. The formula to calculate it is shown below: - * RemainingBytes = RemainingMajorLoopCount * NBYTES(initially configured) - */ -uint32_t EDMA_GetRemainingMajorLoopCount(EDMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - uint32_t remainingCount = 0; - - if (0U != DMA_GET_DONE_STATUS(base, channel)) - { - remainingCount = 0; - } - else - { - /* Calculate the unfinished bytes */ - if (0U != (EDMA_TCD_CITER(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) & DMA_CITER_ELINKNO_ELINK_MASK)) - { - remainingCount = (((uint32_t)EDMA_TCD_CITER(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) & - DMA_CITER_ELINKYES_CITER_MASK) >> - DMA_CITER_ELINKYES_CITER_SHIFT); - } - else - { - remainingCount = (((uint32_t)EDMA_TCD_CITER(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) & - DMA_CITER_ELINKNO_CITER_MASK) >> - DMA_CITER_ELINKNO_CITER_SHIFT); - } - } - - return remainingCount; -} - -/*! - * brief Enables the interrupt source for the eDMA transfer. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_EnableChannelInterrupts(EDMA_Type *base, uint32_t channel, uint32_t mask) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - /* Enable error interrupt */ - if (0U != (mask & (uint32_t)kEDMA_ErrorInterruptEnable)) - { - DMA_ENABLE_ERROR_INT(base, channel); - } - - /* Enable Major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_MajorInterruptEnable)) - { - DMA_ENABLE_MAJOR_INT(base, channel); - } - - /* Enable Half major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_HalfInterruptEnable)) - { - DMA_ENABLE_HALF_INT(base, channel); - } -} - -/*! - * brief Disables the interrupt source for the eDMA transfer. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param mask The mask of the interrupt source to be set. Use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_DisableChannelInterrupts(EDMA_Type *base, uint32_t channel, uint32_t mask) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - /* Disable error interrupt */ - if (0U != (mask & (uint32_t)kEDMA_ErrorInterruptEnable)) - { - DMA_DISABLE_ERROR_INT(base, channel); - } - - /* Disable Major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_MajorInterruptEnable)) - { - DMA_DISABLE_MAJOR_INT(base, channel); - } - - /* Disable Half major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_HalfInterruptEnable)) - { - DMA_DISABLE_HALF_INT(base, channel); - } -} - -/*! - * brief Gets the eDMA channel status flags. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * return The mask of channel status flags. Users need to use the - * _edma_channel_status_flags type to decode the return variables. - */ -uint32_t EDMA_GetChannelStatusFlags(EDMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - uint32_t retval = 0; - - /* Get DONE bit flag */ - retval |= DMA_GET_DONE_STATUS(base, channel); - /* Get ERROR bit flag */ - retval |= (DMA_GET_ERROR_STATUS(base, channel) << 1U); - /* Get INT bit flag */ - retval |= (DMA_GET_INT_STATUS(base, channel) << 2U); - - return retval; -} - -/*! - * brief Clears the eDMA channel status flags. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param mask The mask of channel status to be cleared. Users need to use - * the defined _edma_channel_status_flags type. - */ -void EDMA_ClearChannelStatusFlags(EDMA_Type *base, uint32_t channel, uint32_t mask) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - /* Clear DONE bit flag */ - if (0U != (mask & (uint32_t)kEDMA_DoneFlag)) - { - DMA_CLEAR_DONE_STATUS(base, channel); - } - /* Clear ERROR bit flag */ - if (0U != (mask & (uint32_t)kEDMA_ErrorFlag)) - { - DMA_CLEAR_ERROR_STATUS(base, channel); - } - /* Clear INT bit flag */ - if (0U != (mask & (uint32_t)kEDMA_InterruptFlag)) - { - DMA_CLEAR_INT_STATUS(base, channel); - } -} - -/*! - * brief Creates the eDMA handle. - * - * This function is called if using the transactional API for eDMA. This function - * initializes the internal state of the eDMA handle. - * - * param handle eDMA handle pointer. The eDMA handle stores callback function and - * parameters. - * param base eDMA peripheral base address. - * param channel eDMA channel number. - */ -void EDMA_CreateHandle(edma_handle_t *handle, EDMA_Type *base, uint32_t channel) -{ - assert(handle != NULL); - assert(FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base) != -1); - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - uint32_t edmaInstance; - edma_tcd_t *tcdRegs; - - /* Zero the handle */ - (void)memset(handle, 0, sizeof(*handle)); - - handle->channel = channel; - - /* Get the DMA instance number */ - edmaInstance = EDMA_GetInstance(base); - s_EDMAHandle[edmaInstance][channel] = handle; - /* Enable NVIC interrupt */ - (void)EnableIRQ(s_edmaIRQNumber[edmaInstance][channel]); - - handle->tcdBase = EDMA_TCD_BASE(base, channel); - handle->channelBase = EDMA_CHANNEL_BASE(base, channel); - handle->base = base; - /* - Reset TCD registers to zero. Unlike the EDMA_TcdReset(DREQ will be set), - CSR will be 0. Because in order to suit EDMA busy check mechanism in - EDMA_SubmitTransfer, CSR must be set 0. - */ - tcdRegs = handle->tcdBase; - EDMA_TCD_SADDR(tcdRegs, EDMA_TCD_TYPE(base)) = 0; - EDMA_TCD_SOFF(tcdRegs, EDMA_TCD_TYPE(base)) = 0; - EDMA_TCD_ATTR(tcdRegs, EDMA_TCD_TYPE(base)) = 0; - EDMA_TCD_NBYTES(tcdRegs, EDMA_TCD_TYPE(base)) = 0; - EDMA_TCD_SLAST(tcdRegs, EDMA_TCD_TYPE(base)) = 0; - EDMA_TCD_DADDR(tcdRegs, EDMA_TCD_TYPE(base)) = 0; - EDMA_TCD_DOFF(tcdRegs, EDMA_TCD_TYPE(base)) = 0; - EDMA_TCD_CITER(tcdRegs, EDMA_TCD_TYPE(base)) = 0; - EDMA_TCD_DLAST_SGA(tcdRegs, EDMA_TCD_TYPE(base)) = 0; - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(base)) = 0; - EDMA_TCD_BITER(tcdRegs, EDMA_TCD_TYPE(base)) = 0; -} - -/*! - * brief Installs the TCDs memory pool into the eDMA handle. - * - * This function is called after the EDMA_CreateHandle to use scatter/gather feature. This function shall only be used - * while users need to use scatter gather mode. Scatter gather mode enables EDMA to load a new transfer control block - * (tcd) in hardware, and automatically reconfigure that DMA channel for a new transfer. - * Users need to prepare tcd memory and also configure tcds using interface EDMA_SubmitTransfer. - * - * param handle eDMA handle pointer. - * param tcdPool A memory pool to store TCDs. It must be 32 bytes aligned. - * param tcdSize The number of TCD slots. - */ -void EDMA_InstallTCDMemory(edma_handle_t *handle, edma_tcd_t *tcdPool, uint32_t tcdSize) -{ - assert(handle != NULL); - assert(((uint32_t)tcdPool & 0x1FU) == 0U); - - /* Initialize tcd queue attribute. */ - /* header should initial as 1, since that it is used to point to the next TCD to be loaded into TCD memory, - * In EDMA driver IRQ handler, header will be used to calculate how many tcd has done, for example, - * If application submit 4 transfer request, A->B->C->D, - * when A finshed, the header is 0, C is the next TCD to be load, since B is already loaded, - * according to EDMA driver IRQ handler, tcdDone = C - A - header = 2 - header = 2, but actually only 1 TCD done, - * so the issue will be the wrong TCD done count will pass to application in first TCD interrupt. - * During first submit, the header should be assigned to 1, since 0 is current one and 1 is next TCD to be loaded, - * but software cannot know which submission is the first one, so assign 1 to header here. - */ - handle->header = 1; - handle->tcdUsed = 0; - handle->tcdSize = (int8_t)tcdSize; - handle->tcdPool = tcdPool; -} - -/*! - * brief Installs a callback function for the eDMA transfer. - * - * This callback is called in the eDMA IRQ handler. Use the callback to do something after - * the current major loop transfer completes. This function will be called every time one tcd finished transfer. - * - * param handle eDMA handle pointer. - * param callback eDMA callback function pointer. - * param userData A parameter for the callback function. - */ -void EDMA_SetCallback(edma_handle_t *handle, edma_callback callback, void *userData) -{ - assert(handle != NULL); - - handle->callback = callback; - handle->userData = userData; -} - -static edma_transfer_size_t EDMA_TransferWidthMapping(uint32_t width) -{ - edma_transfer_size_t transferSize = kEDMA_TransferSize1Bytes; - - /* map width to register value */ - switch (width) - { - /* width 8bit */ - case 1U: - transferSize = kEDMA_TransferSize1Bytes; - break; - /* width 16bit */ - case 2U: - transferSize = kEDMA_TransferSize2Bytes; - break; - /* width 32bit */ - case 4U: - transferSize = kEDMA_TransferSize4Bytes; - break; -#if (defined(FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) - /* width 64bit */ - case 8U: - transferSize = kEDMA_TransferSize8Bytes; - break; -#endif -#if (defined(FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) - /* width 128bit */ - case 16U: - transferSize = kEDMA_TransferSize16Bytes; - break; -#endif - /* width 256bit */ - case 32U: - transferSize = kEDMA_TransferSize32Bytes; - break; -#if (defined(FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) - /* width 512bit */ - case 64U: - transferSize = kEDMA_TransferSize64Bytes; - break; -#endif -#if (defined(FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) - /* width 1024bit */ - case 128U: - transferSize = kEDMA_TransferSize128Bytes; - break; -#endif - default: - /* All the cases have been listed above, the default clause should not be reached. */ - assert(false); - break; - } - - return transferSize; -} - -/*! - * brief Prepares the eDMA transfer structure configurations. - * - * This function prepares the transfer configuration structure according to the user input. - * - * param config The user configuration structure of type edma_transfer_t. - * param srcAddr eDMA transfer source address. - * param srcWidth eDMA transfer source address width(bytes). - * param srcOffset source address offset. - * param destAddr eDMA transfer destination address. - * param destWidth eDMA transfer destination address width(bytes). - * param destOffset destination address offset. - * param bytesEachRequest eDMA transfer bytes per channel request. - * param transferBytes eDMA transfer bytes to be transferred. - * note The data address and the data width must be consistent. For example, if the SRC - * is 4 bytes, the source address must be 4 bytes aligned, or it results in - * source address error (SAE). - * User can check if 128 bytes support is available for specific instance by - * FSL_FEATURE_EDMA_INSTANCE_SUPPORT_128_BYTES_TRANSFERn. - */ -void EDMA_PrepareTransferConfig(edma_transfer_config_t *config, - void *srcAddr, - uint32_t srcWidth, - int16_t srcOffset, - void *destAddr, - uint32_t destWidth, - int16_t destOffset, - uint32_t bytesEachRequest, - uint32_t transferBytes) -{ - assert(config != NULL); - assert(srcAddr != NULL); - assert(destAddr != NULL); -#if (defined(FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) - assert((srcWidth != 0U) && (srcWidth <= 128U) && ((srcWidth & (srcWidth - 1U)) == 0U)); - assert((destWidth != 0U) && (destWidth <= 128U) && ((destWidth & (destWidth - 1U)) == 0U)); -#elif (defined(FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) - assert((srcWidth != 0U) && (srcWidth <= 64U) && ((srcWidth & (srcWidth - 1U)) == 0U)); - assert((destWidth != 0U) && (destWidth <= 64U) && ((destWidth & (destWidth - 1U)) == 0U)); -#else - assert((srcWidth != 0U) && (srcWidth <= 32U) && ((srcWidth & (srcWidth - 1U)) == 0U)); - assert((destWidth != 0U) && (destWidth <= 32U) && ((destWidth & (destWidth - 1U)) == 0U)); -#endif -#if (!defined(FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) || !FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) - assert(srcWidth != 8U); - assert(srcWidth != 8U); -#endif -#if (!defined(FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) || !FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) - assert(srcWidth != 16U); - assert(srcWidth != 16U); -#endif -#if (!defined(FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) || !FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) - assert(srcWidth != 64U); - assert(srcWidth != 64U); -#endif - assert((transferBytes % bytesEachRequest) == 0U); - assert((((uint32_t)(uint8_t *)srcAddr) % srcWidth) == 0U); - assert((((uint32_t)(uint8_t *)destAddr) % destWidth) == 0U); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->destAddr = CONVERT_TO_DMA_ADDRESS((uint32_t)(uint32_t *)destAddr); - config->srcAddr = CONVERT_TO_DMA_ADDRESS((uint32_t)(uint32_t *)srcAddr); - config->minorLoopBytes = bytesEachRequest; - config->majorLoopCounts = transferBytes / bytesEachRequest; - config->srcTransferSize = EDMA_TransferWidthMapping(srcWidth); - config->destTransferSize = EDMA_TransferWidthMapping(destWidth); - config->destOffset = destOffset; - config->srcOffset = srcOffset; - /* enable major interrupt by default */ - config->enabledInterruptMask = (uint16_t)kEDMA_MajorInterruptEnable; -} - -/*! - * brief Prepares the eDMA transfer structure. - * - * This function prepares the transfer configuration structure according to the user input. - * - * param config The user configuration structure of type edma_transfer_t. - * param srcAddr eDMA transfer source address. - * param srcWidth eDMA transfer source address width(bytes). - * param destAddr eDMA transfer destination address. - * param destWidth eDMA transfer destination address width(bytes). - * param bytesEachRequest eDMA transfer bytes per channel request. - * param transferBytes eDMA transfer bytes to be transferred. - * param type eDMA transfer type. - * note The data address and the data width must be consistent. For example, if the SRC - * is 4 bytes, the source address must be 4 bytes aligned, or it results in - * source address error (SAE). - */ -void EDMA_PrepareTransfer(edma_transfer_config_t *config, - void *srcAddr, - uint32_t srcWidth, - void *destAddr, - uint32_t destWidth, - uint32_t bytesEachRequest, - uint32_t transferBytes, - edma_transfer_type_t type) -{ - assert(config != NULL); - - int16_t srcOffset = 0, destOffset = 0; - - switch (type) - { - case kEDMA_MemoryToMemory: - destOffset = (int16_t)destWidth; - srcOffset = (int16_t)srcWidth; - break; - case kEDMA_MemoryToPeripheral: - destOffset = 0; - srcOffset = (int16_t)srcWidth; - break; - case kEDMA_PeripheralToMemory: - destOffset = (int16_t)destWidth; - srcOffset = 0; - break; - case kEDMA_PeripheralToPeripheral: - destOffset = 0; - srcOffset = 0; - break; - default: - /* All the cases have been listed above, the default clause should not be reached. */ - assert(false); - break; - } - - EDMA_PrepareTransferConfig(config, srcAddr, srcWidth, srcOffset, destAddr, destWidth, destOffset, bytesEachRequest, - transferBytes); -} - -/*! - * brief Prepares the eDMA transfer content descriptor. - * - * This function prepares the transfer content descriptor structure according to the user input. - * - * param handle eDMA handle pointer. - * param tcd Pointer to eDMA transfer content descriptor structure. - * param srcAddr eDMA transfer source address. - * param srcWidth eDMA transfer source address width(bytes). - * param srcOffset source address offset. - * param destAddr eDMA transfer destination address. - * param destWidth eDMA transfer destination address width(bytes). - * param destOffset destination address offset. - * param bytesEachRequest eDMA transfer bytes per channel request. - * param transferBytes eDMA transfer bytes to be transferred. - * param nextTcd eDMA transfer linked TCD address. - * - * note The data address and the data width must be consistent. For example, if the SRC - * is 4 bytes, the source address must be 4 bytes aligned, or it results in - * source address error (SAE). - */ -void EDMA_PrepareTransferTCD(edma_handle_t *handle, - edma_tcd_t *tcd, - void *srcAddr, - uint32_t srcWidth, - int16_t srcOffset, - void *destAddr, - uint32_t destWidth, - int16_t destOffset, - uint32_t bytesEachRequest, - uint32_t transferBytes, - edma_tcd_t *nextTcd) -{ - assert(tcd != NULL); - assert(srcAddr != NULL); - assert(destAddr != NULL); -#if (defined(FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) - assert((srcWidth != 0U) && (srcWidth <= 128U) && ((srcWidth & (srcWidth - 1U)) == 0U) && - (FSL_FEATURE_EDMA_INSTANCE_SUPPORT_128_BYTES_TRANSFERn(handle->base) == 1)); - assert((destWidth != 0U) && (destWidth <= 128U) && ((destWidth & (destWidth - 1U)) == 0U) && - (FSL_FEATURE_EDMA_INSTANCE_SUPPORT_128_BYTES_TRANSFERn(handle->base) == 1)); -#elif (defined(FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) - assert((srcWidth != 0U) && (srcWidth <= 64U) && ((srcWidth & (srcWidth - 1U)) == 0U)); - assert((destWidth != 0U) && (destWidth <= 64U) && ((destWidth & (destWidth - 1U)) == 0U)); -#else - assert((srcWidth != 0U) && (srcWidth <= 32U) && ((srcWidth & (srcWidth - 1U)) == 0U)); - assert((destWidth != 0U) && (destWidth <= 32U) && ((destWidth & (destWidth - 1U)) == 0U)); -#endif -#if (!defined(FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) || !FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) - assert(srcWidth != 8U); - assert(srcWidth != 8U); -#endif -#if (!defined(FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) || !FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) - assert(srcWidth != 16U); - assert(srcWidth != 16U); -#endif -#if (!defined(FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) || !FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) - assert(srcWidth != 64U); - assert(srcWidth != 64U); -#endif - assert((transferBytes % bytesEachRequest) == 0U); - assert((((uint32_t)(uint32_t *)srcAddr) % srcWidth) == 0U); - assert((((uint32_t)(uint32_t *)destAddr) % destWidth) == 0U); - - edma_transfer_size_t srcTransferSize = EDMA_TransferWidthMapping(srcWidth), - destTransferSize = EDMA_TransferWidthMapping(srcWidth); - - /* Initializes the configure structure to zero. */ - EDMA_TcdResetExt(handle->base, tcd); - assert((bytesEachRequest % (1UL << ((uint32_t)srcTransferSize))) == 0U); - assert((bytesEachRequest % (1UL << ((uint32_t)destTransferSize))) == 0U); - assert(((uint32_t)srcOffset % (1UL << ((uint32_t)srcTransferSize))) == 0U); - assert(((uint32_t)destOffset % (1UL << ((uint32_t)destTransferSize))) == 0U); - assert(((uint32_t)(uint32_t *)srcAddr % (1UL << ((uint32_t)srcTransferSize))) == 0U); - assert(((uint32_t)(uint32_t *)destAddr % (1UL << ((uint32_t)destTransferSize))) == 0U); - - EDMA_TCD_SADDR(tcd, EDMA_TCD_TYPE(handle->base)) = CONVERT_TO_DMA_ADDRESS((uint32_t *)srcAddr); - /* destination address */ - EDMA_TCD_DADDR(tcd, EDMA_TCD_TYPE(handle->base)) = CONVERT_TO_DMA_ADDRESS((uint32_t *)destAddr); - /* Source data and destination data transfer size */ - EDMA_TCD_ATTR(tcd, EDMA_TCD_TYPE(handle->base)) = DMA_ATTR_SSIZE(srcTransferSize) | DMA_ATTR_DSIZE(destTransferSize); - - /* Source address signed offset */ - EDMA_TCD_SOFF(tcd, EDMA_TCD_TYPE(handle->base)) = (uint16_t)(srcOffset); - /* Destination address signed offset */ - EDMA_TCD_DOFF(tcd, EDMA_TCD_TYPE(handle->base)) = (uint16_t)(destOffset); - - EDMA_TCD_NBYTES(tcd, EDMA_TCD_TYPE(handle->base)) = DMA_NBYTES_MLOFFNO_NBYTES(bytesEachRequest); - - /* Current major iteration count */ - EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(handle->base)) = (uint16_t)(transferBytes / bytesEachRequest); - /* Starting major iteration count */ - EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(handle->base)) = (uint16_t)(transferBytes / bytesEachRequest); - /* reset CSR firstly */ - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(handle->base)) = DMA_CSR_DREQ(1U); - /* Enable scatter/gather processing */ - if (nextTcd != NULL) - { - EDMA_TCD_DLAST_SGA(tcd, EDMA_TCD_TYPE(handle->base)) = CONVERT_TO_DMA_ADDRESS(nextTcd); - /* - Before call EDMA_TcdSetTransferConfig or EDMA_SetTransferConfig, - user must call EDMA_TcdReset or EDMA_ResetChannel which will set - DREQ, so must use "|" or "&" rather than "=". - - Clear the DREQ bit because scatter gather has been enabled, so the - previous transfer is not the last transfer, and channel request should - be enabled at the next transfer(the next TCD). - */ - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(handle->base)) = - (EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(handle->base)) | (uint16_t)DMA_CSR_ESG_MASK) & ~(uint16_t)DMA_CSR_DREQ_MASK; - } - - /* configure interrupt/auto disable channel request, enable major interrupt by default */ - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(handle->base)) |= - (EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(handle->base)) & (~(uint16_t)kEDMA_ErrorInterruptEnable)) | - (uint16_t)kEDMA_MajorInterruptEnable; -} - -/*! - * brief Submits the eDMA transfer content descriptor. - * - * This function submits the eDMA transfer request according to the transfer content descriptor. - * In scatter gather mode, call this function will add a configured tcd to the circular list of tcd pool. - * The tcd pools is setup by call function EDMA_InstallTCDMemory before. - * - * Typical user case: - * 1. submit single transfer - * code - * edma_tcd_t tcd; - * EDMA_PrepareTransferTCD(handle, tcd, ....) - * EDMA_SubmitTransferTCD(handle, tcd) - * EDMA_StartTransfer(handle) - * endcode - * - * 2. submit static link transfer, - * code - * edma_tcd_t tcd[2]; - * EDMA_PrepareTransferTCD(handle, &tcd[0], ....) - * EDMA_PrepareTransferTCD(handle, &tcd[1], ....) - * EDMA_SubmitTransferTCD(handle, &tcd[0]) - * EDMA_StartTransfer(handle) - * endcode - * - * 3. submit dynamic link transfer - * code - * edma_tcd_t tcdpool[2]; - * EDMA_InstallTCDMemory(&g_DMA_Handle, tcdpool, 2); - * edma_tcd_t tcd; - * EDMA_PrepareTransferTCD(handle, tcd, ....) - * EDMA_SubmitTransferTCD(handle, tcd) - * EDMA_PrepareTransferTCD(handle, tcd, ....) - * EDMA_SubmitTransferTCD(handle, tcd) - * EDMA_StartTransfer(handle) - * endcode - * - * 4. submit loop transfer - * code - * edma_tcd_t tcd[2]; - * EDMA_PrepareTransferTCD(handle, &tcd[0], ...,&tcd[1]) - * EDMA_PrepareTransferTCD(handle, &tcd[1], ..., &tcd[0]) - * EDMA_SubmitTransferTCD(handle, &tcd[0]) - * EDMA_StartTransfer(handle) - * endcode - * - * param handle eDMA handle pointer. - * param tcd Pointer to eDMA transfer content descriptor structure. - * - * retval kStatus_EDMA_Success It means submit transfer request succeed. - * retval kStatus_EDMA_QueueFull It means TCD queue is full. Submit transfer request is not allowed. - * retval kStatus_EDMA_Busy It means the given channel is busy, need to submit request later. - */ -status_t EDMA_SubmitTransferTCD(edma_handle_t *handle, edma_tcd_t *tcd) -{ - assert(handle != NULL); - assert(handle->tcdBase != NULL); - - edma_tcd_t *tcdRegs = handle->tcdBase; - - if (handle->tcdPool == NULL) - { - /* - * Check if EDMA channel is busy: - * 1. if channel active bit is set, it implies that minor loop is executing, then channel is busy - * 2. if channel active bit is not set and BITER not equal to CITER, it implies that major loop is executing, - * then channel is busy - * - * There is one case can not be covered in below condition: - * When transfer request is submitted, but no request from peripheral, that is to say channel sevice doesn't - * begin, if application would like to submit another transfer , then the TCD will be overwritten, since the - * ACTIVE is 0 and BITER = CITER, for such case, it is a scatter gather(link TCD) case actually, so - * application should enabled TCD pool for dynamic scatter gather mode by calling EDMA_InstallTCDMemory. - */ -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - if (((tcdRegs->CSR & DMA_CSR_ACTIVE_MASK) != 0U) || -#else - if (((handle->channelBase->CH_CSR & DMA_CH_CSR_ACTIVE_MASK) != 0U) || -#endif - (((EDMA_TCD_CITER(tcdRegs, EDMA_TCD_TYPE(handle->base)) & DMA_CITER_ELINKNO_CITER_MASK) != - (EDMA_TCD_BITER(tcdRegs, EDMA_TCD_TYPE(handle->base)) & DMA_BITER_ELINKNO_BITER_MASK)))) - { - return kStatus_EDMA_Busy; - } - else - { - EDMA_InstallTCD(handle->base, handle->channel, tcd); - /* Enable auto disable request feature */ - EDMA_EnableAutoStopRequest(handle->base, handle->channel, true); - /* Enable major interrupt */ - EDMA_EnableChannelInterrupts(handle->base, handle->channel, kEDMA_MajorInterruptEnable); - - return kStatus_Success; - } - } - else /* Use the TCD queue. */ - { - uint32_t primask; - uint16_t csr; - int8_t currentTcd; - int8_t previousTcd; - int8_t nextTcd; - int8_t tmpTcdUsed; - int8_t tmpTcdSize; - - /* Check if tcd pool is full. */ - primask = DisableGlobalIRQ(); - tmpTcdUsed = handle->tcdUsed; - tmpTcdSize = handle->tcdSize; - if (tmpTcdUsed >= tmpTcdSize) - { - EnableGlobalIRQ(primask); - - return kStatus_EDMA_QueueFull; - } - currentTcd = handle->tail; - handle->tcdUsed++; - /* Calculate index of next TCD */ - nextTcd = currentTcd + 1; - if (nextTcd == handle->tcdSize) - { - nextTcd = 0; - } - /* Advance queue tail index */ - handle->tail = nextTcd; - EnableGlobalIRQ(primask); - /* Calculate index of previous TCD */ - previousTcd = currentTcd != 0 ? currentTcd - 1 : (handle->tcdSize - 1); - - /* Configure current TCD block. */ - EDMA_TcdResetExt(handle->base, &handle->tcdPool[currentTcd]); - (void)memcpy(&handle->tcdPool[currentTcd], tcd, sizeof(edma_tcd_t)); - - /* Enable major interrupt */ - EDMA_TCD_CSR((&handle->tcdPool[currentTcd]), EDMA_TCD_TYPE(handle->base)) |= DMA_CSR_INTMAJOR_MASK; - - if ((EDMA_TCD_DLAST_SGA(tcd, EDMA_TCD_TYPE(handle->base)) == 0U) || - ((EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(handle->base)) & DMA_CSR_ESG_MASK) == 0U)) - { - /* Link current TCD with next TCD for identification of current TCD */ - EDMA_TCD_DLAST_SGA((&handle->tcdPool[currentTcd]), EDMA_TCD_TYPE(handle->base)) = - CONVERT_TO_DMA_ADDRESS((uint32_t)&handle->tcdPool[nextTcd]); - } - - /* Chain from previous descriptor unless tcd pool size is 1(this descriptor is its own predecessor). */ - if (currentTcd != previousTcd) - { -#if defined FSL_FEATURE_EDMA_HAS_ERRATA_51327 - if (EDMA_CheckErrata(handle->base, &handle->tcdPool[previousTcd]) != kStatus_Success) - { - return kStatus_InvalidArgument; - } -#endif - /* Enable scatter/gather feature in the previous TCD block. */ - csr = EDMA_TCD_CSR((&handle->tcdPool[previousTcd]), EDMA_TCD_TYPE(handle->base)) | - ((uint16_t)DMA_CSR_ESG_MASK); - csr &= ~((uint16_t)DMA_CSR_DREQ_MASK); - EDMA_TCD_CSR((&handle->tcdPool[previousTcd]), EDMA_TCD_TYPE(handle->base)) = csr; - /* - Check if the TCD block in the registers is the previous one (points to current TCD block). It - is used to check if the previous TCD linked has been loaded in TCD register. If so, it need to - link the TCD register in case link the current TCD with the dead chain when TCD loading occurs - before link the previous TCD block. - */ - if (EDMA_TCD_DLAST_SGA(tcdRegs, EDMA_TCD_TYPE(handle->base)) == - CONVERT_TO_DMA_ADDRESS((uint32_t)&handle->tcdPool[currentTcd])) - { - /* Clear the DREQ bits for the dynamic scatter gather */ - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) |= DMA_CSR_DREQ_MASK; - /* Enable scatter/gather also in the TCD registers. */ - csr = EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) | DMA_CSR_ESG_MASK; - /* Must write the CSR register one-time, because the transfer maybe finished anytime. */ - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) = csr; - /* - It is very important to check the ESG bit! - Because this hardware design: if DONE bit is set, the ESG bit can not be set. So it can - be used to check if the dynamic TCD link operation is successful. If ESG bit is not set - and the DLAST_SGA is not the next TCD address(it means the dynamic TCD link succeed and - the current TCD block has been loaded into TCD registers), it means transfer finished - and TCD link operation fail, so must install TCD content into TCD registers and enable - transfer again. And if ESG is set, it means transfer has not finished, so TCD dynamic - link succeed. - */ - if (0U != (EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) & DMA_CSR_ESG_MASK)) - { - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) &= ~(uint16_t)DMA_CSR_DREQ_MASK; - return kStatus_Success; - } - /* - Check whether the current TCD block is already loaded in the TCD registers. It is another - condition when ESG bit is not set: it means the dynamic TCD link succeed and the current - TCD block has been loaded into TCD registers. - */ - if (EDMA_TCD_DLAST_SGA(tcdRegs, EDMA_TCD_TYPE(handle->base)) == - CONVERT_TO_DMA_ADDRESS((uint32_t)&handle->tcdPool[nextTcd])) - { - return kStatus_Success; - } - /* - If go to this, means the previous transfer finished, and the DONE bit is set. - So shall configure TCD registers. - */ - } - else if (EDMA_TCD_DLAST_SGA(tcdRegs, EDMA_TCD_TYPE(handle->base)) != 0UL) - { - /* The current TCD block has been linked successfully. */ - return kStatus_Success; - } - else - { - /* - DLAST_SGA is 0 and it means the first submit transfer, so shall configure - TCD registers. - */ - } - } - /* There is no live chain, TCD block need to be installed in TCD registers. */ - EDMA_InstallTCD(handle->base, handle->channel, &handle->tcdPool[currentTcd]); - - return kStatus_Success; - } -} - -/*! - * brief Submits the eDMA transfer request. - * - * This function submits the eDMA transfer request according to the transfer configuration structure. - * In scatter gather mode, call this function will add a configured tcd to the circular list of tcd pool. - * The tcd pools is setup by call function EDMA_InstallTCDMemory before. - * - * param handle eDMA handle pointer. - * param config Pointer to eDMA transfer configuration structure. - * retval kStatus_EDMA_Success It means submit transfer request succeed. - * retval kStatus_EDMA_QueueFull It means TCD queue is full. Submit transfer request is not allowed. - * retval kStatus_EDMA_Busy It means the given channel is busy, need to submit request later. - */ -status_t EDMA_SubmitTransfer(edma_handle_t *handle, const edma_transfer_config_t *config) -{ - assert(handle != NULL); - assert(config != NULL); - assert(handle->tcdBase != NULL); -#if (defined(FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) - assert(((config->srcTransferSize != kEDMA_TransferSize128Bytes) && - (config->destTransferSize != kEDMA_TransferSize128Bytes)) || - (FSL_FEATURE_EDMA_INSTANCE_SUPPORT_128_BYTES_TRANSFERn(handle->base) == 1)); -#endif - edma_tcd_t *tcdRegs = handle->tcdBase; - - if (handle->tcdPool == NULL) - { - /* - * Check if EDMA channel is busy: - * 1. if channel active bit is set, it implies that minor loop is executing, then channel is busy - * 2. if channel active bit is not set and BITER not equal to CITER, it implies that major loop is executing, - * then channel is busy - * - * There is one case can not be covered in below condition: - * When transfer request is submitted, but no request from peripheral, that is to say channel sevice doesn't - * begin, if application would like to submit another transfer , then the TCD will be overwritten, since the - * ACTIVE is 0 and BITER = CITER, for such case, it is a scatter gather(link TCD) case actually, so - * application should enabled TCD pool for dynamic scatter gather mode by calling EDMA_InstallTCDMemory. - */ -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - if (((tcdRegs->CSR & DMA_CSR_ACTIVE_MASK) != 0U) || -#else - if (((handle->channelBase->CH_CSR & DMA_CH_CSR_ACTIVE_MASK) != 0U) || -#endif - (((EDMA_TCD_CITER(tcdRegs, EDMA_TCD_TYPE(handle->base)) & DMA_CITER_ELINKNO_CITER_MASK) != - (EDMA_TCD_BITER(tcdRegs, EDMA_TCD_TYPE(handle->base)) & DMA_BITER_ELINKNO_BITER_MASK)))) - { - return kStatus_EDMA_Busy; - } - else - { - EDMA_TcdSetTransferConfigExt(handle->base, tcdRegs, config, NULL); - /* Enable auto disable request feature */ - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) |= DMA_CSR_DREQ_MASK; - /* Enable major interrupt */ - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) |= DMA_CSR_INTMAJOR_MASK; - - return kStatus_Success; - } - } - else /* Use the TCD queue. */ - { - uint32_t primask; - uint16_t csr; - int8_t currentTcd; - int8_t previousTcd; - int8_t nextTcd; - int8_t tmpTcdUsed; - int8_t tmpTcdSize; - - /* Check if tcd pool is full. */ - primask = DisableGlobalIRQ(); - tmpTcdUsed = handle->tcdUsed; - tmpTcdSize = handle->tcdSize; - if (tmpTcdUsed >= tmpTcdSize) - { - EnableGlobalIRQ(primask); - - return kStatus_EDMA_QueueFull; - } - currentTcd = handle->tail; - handle->tcdUsed++; - /* Calculate index of next TCD */ - nextTcd = currentTcd + 1; - if (nextTcd == handle->tcdSize) - { - nextTcd = 0; - } - /* Advance queue tail index */ - handle->tail = nextTcd; - EnableGlobalIRQ(primask); - /* Calculate index of previous TCD */ - previousTcd = currentTcd != 0 ? currentTcd - 1 : (handle->tcdSize - 1); - /* Configure current TCD block. */ - EDMA_TcdResetExt(handle->base, &handle->tcdPool[currentTcd]); - EDMA_TcdSetTransferConfigExt(handle->base, &handle->tcdPool[currentTcd], config, NULL); - /* Enable major interrupt */ - EDMA_TCD_CSR((&handle->tcdPool[currentTcd]), EDMA_TCD_TYPE(handle->base)) |= DMA_CSR_INTMAJOR_MASK; - /* Link current TCD with next TCD for identification of current TCD */ - EDMA_TCD_DLAST_SGA((&handle->tcdPool[currentTcd]), EDMA_TCD_TYPE(handle->base)) = - CONVERT_TO_DMA_ADDRESS((uint32_t)&handle->tcdPool[nextTcd]); - /* Chain from previous descriptor unless tcd pool size is 1(this descriptor is its own predecessor). */ - if (currentTcd != previousTcd) - { -#if defined FSL_FEATURE_EDMA_HAS_ERRATA_51327 - if (EDMA_CheckErrata(handle->base, &handle->tcdPool[previousTcd]) != kStatus_Success) - { - return kStatus_InvalidArgument; - } -#endif - /* Enable scatter/gather feature in the previous TCD block. */ - csr = EDMA_TCD_CSR((&handle->tcdPool[previousTcd]), EDMA_TCD_TYPE(handle->base)) | - ((uint16_t)DMA_CSR_ESG_MASK); - csr &= ~((uint16_t)DMA_CSR_DREQ_MASK); - EDMA_TCD_CSR((&handle->tcdPool[previousTcd]), EDMA_TCD_TYPE(handle->base)) = csr; - /* - Check if the TCD block in the registers is the previous one (points to current TCD block). It - is used to check if the previous TCD linked has been loaded in TCD register. If so, it need to - link the TCD register in case link the current TCD with the dead chain when TCD loading occurs - before link the previous TCD block. - */ - if (EDMA_TCD_DLAST_SGA(handle->tcdBase, EDMA_TCD_TYPE(handle->base)) == - CONVERT_TO_DMA_ADDRESS((uint32_t)&handle->tcdPool[currentTcd])) - { - /* Clear the DREQ bits for the dynamic scatter gather */ - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) |= DMA_CSR_DREQ_MASK; - /* Enable scatter/gather also in the TCD registers. */ - csr = EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) | DMA_CSR_ESG_MASK; - /* Must write the CSR register one-time, because the transfer maybe finished anytime. */ - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) = csr; - /* - It is very important to check the ESG bit! - Because this hardware design: if DONE bit is set, the ESG bit can not be set. So it can - be used to check if the dynamic TCD link operation is successful. If ESG bit is not set - and the DLAST_SGA is not the next TCD address(it means the dynamic TCD link succeed and - the current TCD block has been loaded into TCD registers), it means transfer finished - and TCD link operation fail, so must install TCD content into TCD registers and enable - transfer again. And if ESG is set, it means transfer has not finished, so TCD dynamic - link succeed. - */ - if (0U != (EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) & DMA_CSR_ESG_MASK)) - { - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) &= ~(uint16_t)DMA_CSR_DREQ_MASK; - return kStatus_Success; - } - /* - Check whether the current TCD block is already loaded in the TCD registers. It is another - condition when ESG bit is not set: it means the dynamic TCD link succeed and the current - TCD block has been loaded into TCD registers. - */ - if (EDMA_TCD_DLAST_SGA(handle->tcdBase, EDMA_TCD_TYPE(handle->base)) == - CONVERT_TO_DMA_ADDRESS((uint32_t)&handle->tcdPool[nextTcd])) - { - return kStatus_Success; - } - /* - If go to this, means the previous transfer finished, and the DONE bit is set. - So shall configure TCD registers. - */ - } - else if (EDMA_TCD_DLAST_SGA(handle->tcdBase, EDMA_TCD_TYPE(handle->base)) != 0UL) - { - /* The current TCD block has been linked successfully. */ - return kStatus_Success; - } - else - { - /* - DLAST_SGA is 0 and it means the first submit transfer, so shall configure - TCD registers. - */ - } - } - /* There is no live chain, TCD block need to be installed in TCD registers. */ - EDMA_InstallTCD(handle->base, handle->channel, &handle->tcdPool[currentTcd]); - - return kStatus_Success; - } -} - -/*! - * brief Submits the eDMA scatter gather transfer configurations. - * - * The function is target for submit loop transfer request, - * the ring transfer request means that the transfer request TAIL is link to HEAD, such as, - * A->B->C->D->A, or A->A - * - * To use the ring transfer feature, the application should allocate several transfer object, such as - * @code - * edma_channel_transfer_config_t transfer[2]; - * EDMA_TransferSubmitLoopTransfer(handle, &transfer, 2U); - * @endcode - * Then eDMA driver will link transfer[0] and transfer[1] to each other - * - * note Application should check the return value of this function to avoid transfer request - * submit failed - * - * param handle eDMA handle pointer - * param transfer pointer to user's eDMA channel configure structure, see edma_channel_transfer_config_t for detail - * param transferLoopCount the count of the transfer ring, if loop count is 1, that means that the one will link to - * itself. - * - * retval #kStatus_Success It means submit transfer request succeed - * retval #kStatus_EDMA_Busy channel is in busy status - * retval #kStatus_InvalidArgument Invalid Argument - */ -status_t EDMA_SubmitLoopTransfer(edma_handle_t *handle, edma_transfer_config_t *transfer, uint32_t transferLoopCount) -{ - assert(transfer != NULL); - assert(handle != NULL); - assert(handle->tcdPool != NULL); - - uint32_t i = 0U; - - if (handle->tcdSize < (int8_t)transferLoopCount) - { - return kStatus_InvalidArgument; - } - - /* - * Check if EDMA channel is busy: - * 1. if channel active bit is set, it implies that minor loop is executing, then channel is busy - * 2. if channel active bit is not set and BITER not equal to CITER, it implies that major loop is executing, - * then channel is busy - * - * There is one case can not be covered in below condition: - * When transfer request is submitted, but no request from peripheral, that is to say channel service doesn't - * begin, if application would like to submit another transfer , then the TCD will be overwritten, since the - * ACTIVE is 0 and BITER = CITER, for such case, it is a scatter gather(link TCD) case actually, so - * application should enabled TCD pool for dynamic scatter gather mode by calling EDMA_InstallTCDMemory. - */ -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - if (((handle->tcdBase->CSR & DMA_CSR_ACTIVE_MASK) != 0U) || -#else - if (((handle->channelBase->CH_CSR & DMA_CH_CSR_ACTIVE_MASK) != 0U) || -#endif - (((EDMA_TCD_CITER(handle->tcdBase, EDMA_TCD_TYPE(handle->base)) & DMA_CITER_ELINKNO_CITER_MASK) != - (EDMA_TCD_BITER(handle->tcdBase, EDMA_TCD_TYPE(handle->base)) & DMA_BITER_ELINKNO_BITER_MASK)))) - { - return kStatus_EDMA_Busy; - } - - (void)memset(handle->tcdPool, 0, (uint32_t)handle->tcdSize * sizeof(edma_tcd_t)); - for (i = 0U; i < transferLoopCount - 1UL; i++) - { - transfer[i].linkTCD = &handle->tcdPool[i + 1UL]; - EDMA_ConfigChannelSoftwareTCDExt(handle->base, &(handle->tcdPool[i]), &transfer[i]); -#if defined FSL_FEATURE_EDMA_HAS_ERRATA_51327 - if (EDMA_CheckErrata(handle->base, &(handle->tcdPool[i])) != kStatus_Success) - { - return kStatus_InvalidArgument; - } -#endif - } - - /* prepare last one in the ring and link it to the HEAD of the ring */ - transfer[i].linkTCD = &handle->tcdPool[0]; - EDMA_ConfigChannelSoftwareTCDExt(handle->base, &(handle->tcdPool[i]), &transfer[i]); - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - if (((transfer->enableSrcMinorLoopOffset) || (transfer->enableDstMinorLoopOffset))) - { - EDMA_EnableMinorLoopMapping(handle->psBase, true); - } -#endif - /* There is no live chain, TCD block need to be installed in TCD registers. */ - EDMA_InstallTCD(handle->base, handle->channel, &handle->tcdPool[0U]); - - /* enable interrupt */ - EDMA_EnableChannelInterrupts(handle->base, handle->channel, - ((uint32_t)transfer->enabledInterruptMask & ~((uint32_t)kEDMA_ErrorInterruptEnable))); - - return kStatus_Success; -} - -/*! - * brief eDMA starts transfer. - * - * This function enables the channel request. Users can call this function after submitting the transfer request - * or before submitting the transfer request. - * - * param handle eDMA handle pointer. - */ -void EDMA_StartTransfer(edma_handle_t *handle) -{ - assert(handle != NULL); - - edma_tcd_t *tcdRegs = handle->tcdBase; - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - if (handle->tcdPool == NULL) - { - handle->base->SERQ = DMA_SERQ_SERQ(handle->channel); - } - else /* Use the TCD queue. */ - { - uint32_t primask; - - /* Check if there was at least one descriptor submitted since reset (TCD in registers is valid) */ - if (tcdRegs->DLAST_SGA != 0U) - { - primask = DisableGlobalIRQ(); - /* Check if channel request is actually disable. */ - if ((handle->base->ERQ & ((uint32_t)1U << handle->channel)) == 0U) - { - /* Check if transfer is paused. */ - tmpCSR = tcdRegs->CSR; - if ((0U == (tmpCSR & DMA_CSR_DONE_MASK)) || (0U != (tmpCSR & DMA_CSR_ESG_MASK))) - { - /* - Re-enable channel request must be as soon as possible, so must put it into - critical section to avoid task switching or interrupt service routine. - */ - handle->base->SERQ = DMA_SERQ_SERQ(handle->channel); - } - } - EnableGlobalIRQ(primask); - } - } -#else -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_CHANNEL_MUX -#if defined FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX - if (((uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_MUXn(handle->base) == 1U) && - (EDMA_MP_BASE(handle->base)->MP_REGS.EDMA5_REG.CH_MUX[handle->channel] == 0U) && - (FSL_FEATURE_EDMA_INSTANCE_HAS_MP_CHANNEL_MUXn(handle->base) == 1U)) - { - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) |= DMA_CSR_START_MASK; - } - else if (((uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_MUXn(handle->base) == 1U) && - handle->channelBase->CH_REGS.EDMA4_REG.CH_MUX == 0U && - !(FSL_FEATURE_EDMA_INSTANCE_HAS_MP_CHANNEL_MUXn(handle->base) == 1U)) - { - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) |= DMA_CSR_START_MASK; - } - else -#else - if (((uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_MUXn(handle->base) == 1U) && - handle->channelBase->CH_REGS.EDMA4_REG.CH_MUX == 0U) - { - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) |= DMA_CSR_START_MASK; - } - else -#endif -#endif - if (handle->tcdPool == NULL) - { - handle->channelBase->CH_CSR |= DMA_CH_CSR_ERQ_MASK; - } - else - { - /* Check if channel request is actually disable. */ - if ((handle->channelBase->CH_CSR & DMA_CH_CSR_ERQ_MASK) == 0U) - { - /* Check if transfer is paused. */ - if ((!((handle->channelBase->CH_CSR & DMA_CH_CSR_DONE_MASK) != 0U)) || - ((EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) & DMA_CSR_ESG_MASK) != 0U)) - { - /* - Re-enable channel request must be as soon as possible, so must put it into - critical section to avoid task switching or interrupt service routine. - */ - handle->channelBase->CH_CSR |= DMA_CH_CSR_ERQ_MASK; - } - } - } -#endif -} - -/*! - * brief eDMA stops transfer. - * - * This function disables the channel request to pause the transfer. Users can call EDMA_StartTransfer() - * again to resume the transfer. - * - * param handle eDMA handle pointer. - */ -void EDMA_StopTransfer(edma_handle_t *handle) -{ - assert(handle != NULL); -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - handle->base->CERQ = DMA_CERQ_CERQ(handle->channel); -#else - handle->channelBase->CH_CSR = handle->channelBase->CH_CSR & (~(DMA_CH_CSR_DONE_MASK | DMA_CH_CSR_ERQ_MASK)); -#endif -} - -/*! - * brief eDMA aborts transfer. - * - * This function disables the channel request and clear transfer status bits. - * Users can submit another transfer after calling this API. - * - * param handle DMA handle pointer. - */ -void EDMA_AbortTransfer(edma_handle_t *handle) -{ - EDMA_StopTransfer(handle); - /* - Clear CSR to release channel. Because if the given channel started transfer, - CSR will be not zero. Because if it is the last transfer, DREQ will be set. - If not, ESG will be set. - */ - EDMA_TcdResetExt(handle->base, handle->tcdBase); - - /* Handle the tcd */ - if (handle->tcdPool != NULL) - { - handle->header = 1; - handle->tail = 0; - handle->tcdUsed = 0; - } -} - -/*! - * brief eDMA IRQ handler for the current major loop transfer completion. - * - * This function clears the channel major interrupt flag and calls - * the callback function if it is not NULL. - * - * Note: - * For the case using TCD queue, when the major iteration count is exhausted, additional operations are performed. - * These include the final address adjustments and reloading of the BITER field into the CITER. - * Assertion of an optional interrupt request also occurs at this time, as does a possible fetch of a new TCD from - * memory using the scatter/gather address pointer included in the descriptor (if scatter/gather is enabled). - * - * For instance, when the time interrupt of TCD[0] happens, the TCD[1] has already been loaded into the eDMA engine. - * As sga and sga_index are calculated based on the DLAST_SGA bitfield lies in the TCD_CSR register, the sga_index - * in this case should be 2 (DLAST_SGA of TCD[1] stores the address of TCD[2]). Thus, the "tcdUsed" updated should be - * (tcdUsed - 2U) which indicates the number of TCDs can be loaded in the memory pool (because TCD[0] and TCD[1] have - * been loaded into the eDMA engine at this point already.). - * - * For the last two continuous ISRs in a scatter/gather process, they both load the last TCD (The last ISR does not - * load a new TCD) from the memory pool to the eDMA engine when major loop completes. - * Therefore, ensure that the header and tcdUsed updated are identical for them. - * tcdUsed are both 0 in this case as no TCD to be loaded. - * - * See the "eDMA basic data flow" in the eDMA Functional description section of the Reference Manual for - * further details. - * - * param handle eDMA handle pointer. - */ -void EDMA_HandleIRQ(edma_handle_t *handle) -{ - assert(handle != NULL); - - bool transfer_done; - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - /* Check if transfer is already finished. */ - transfer_done = ((handle->tcdBase->CSR & DMA_CSR_DONE_MASK) != 0U); -#else - transfer_done = (bool)(handle->channelBase->CH_CSR & DMA_CH_CSR_DONE_MASK); -#endif - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - if ((handle->base->INT >> channel) != 0U) - { - handle->base->CINT = channel; - } -#else - if ((handle->channelBase->CH_INT & DMA_CH_INT_INT_MASK) != 0U) - { - handle->channelBase->CH_INT |= DMA_CH_INT_INT_MASK; - } -#endif - - if (handle->tcdPool == NULL) - { - if (handle->callback != NULL) - { - (handle->callback)(handle, handle->userData, transfer_done, 0); - } - } - else /* Use the TCD queue. Please refer to the API descriptions in the eDMA header file for detailed information. */ - { - uint32_t sga = (uint32_t)EDMA_TCD_DLAST_SGA(handle->tcdBase, EDMA_TCD_TYPE(handle->base)); - uint32_t sga_index; - int32_t tcds_done; - uint8_t new_header; - bool esg = ((EDMA_TCD_CSR(handle->tcdBase, EDMA_TCD_TYPE(handle->base)) & DMA_CSR_ESG_MASK) != 0U); - - /* Get the offset of the next transfer TCD blocks to be loaded into the eDMA engine. */ - sga -= CONVERT_TO_DMA_ADDRESS((uint32_t)handle->tcdPool); - /* Get the index of the next transfer TCD blocks to be loaded into the eDMA engine. */ - sga_index = sga / sizeof(edma_tcd_t); - /* Adjust header positions. */ - if (transfer_done) - { - /* New header shall point to the next TCD to be loaded (current one is already finished) */ - new_header = (uint8_t)sga_index; - } - else - { - /* New header shall point to this descriptor currently loaded (not finished yet) */ - new_header = sga_index != 0U ? (uint8_t)sga_index - 1U : (uint8_t)handle->tcdSize - 1U; - } - /* Calculate the number of finished TCDs */ - if (new_header == (uint8_t)handle->header) - { - int8_t tmpTcdUsed = handle->tcdUsed; - int8_t tmpTcdSize = handle->tcdSize; - - /* check esg here for the case that application submit only one request, once the request complete: - * new_header(1) = handle->header(1) - * tcdUsed(1) != tcdSize(>1) - * As the application submit only once, so scatter gather must not enabled, then tcds_done should be 1 - */ - if ((tmpTcdUsed == tmpTcdSize) || (!esg)) - { - tcds_done = handle->tcdUsed; - } - else - { - /* No TCD in the memory are going to be loaded or internal error occurs. */ - tcds_done = 0; - } - } - else - { - tcds_done = (int32_t)new_header - (int32_t)handle->header; - if (tcds_done < 0) - { - tcds_done += handle->tcdSize; - } - /* - * While code run to here, it means a TCD transfer Done and a new TCD has loaded to the hardware - * so clear DONE here to allow submit scatter gather transfer request in the callback to avoid TCD - * overwritten. - */ - if (transfer_done) - { -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - handle->base->CDNE = handle->channel; -#else - handle->channelBase->CH_CSR |= DMA_CH_CSR_DONE_MASK; -#endif - } - } - /* Advance header which points to the TCD to be loaded into the eDMA engine from memory. */ - handle->header = (int8_t)new_header; - /* Release TCD blocks. tcdUsed is the TCD number which can be used/loaded in the memory pool. */ - handle->tcdUsed -= (int8_t)tcds_done; - /* Invoke callback function. */ - if (NULL != handle->callback) - { - (handle->callback)(handle, handle->userData, transfer_done, tcds_done); - } - - /* - * 1.clear the DONE bit here is meaningful for below cases: - * A new TCD has been loaded to EDMA already: - * need to clear the DONE bit in the IRQ handler to avoid TCD in EDMA been overwritten - * if peripheral request isn't coming before next transfer request. - * 2. Don't clear DONE bit for below case, - * for the case that transfer request submitted in the privious edma callback, this is a case that doesn't - * need scatter gather, so keep DONE bit during the next transfer request submission will re-install the TCD and - * the DONE bit will be cleared together with TCD re-installation. - */ - if (transfer_done) - { - if ((EDMA_TCD_CSR(handle->tcdBase, EDMA_TCD_TYPE(handle->base)) & DMA_CSR_ESG_MASK) != 0U) - { -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - handle->base->CDNE = handle->channel; -#else - handle->channelBase->CH_CSR |= DMA_CH_CSR_DONE_MASK; -#endif - } - } - } -} - -void EDMA_DriverIRQHandler(uint32_t instance, uint32_t channel); -void EDMA_DriverIRQHandler(uint32_t instance, uint32_t channel) -{ -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - if ((s_edmaBases[instance]->INT >> channel) != 0U) - { - EDMA_HandleIRQ(s_EDMAHandle[instance][channel]); - } -#else - if ((EDMA_CHANNEL_BASE(s_edmaBases[instance], channel)->CH_INT & DMA_CH_INT_INT_MASK) != 0U) - { - EDMA_HandleIRQ(s_EDMAHandle[instance][channel]); - } -#endif - SDK_ISR_EXIT_BARRIER; -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_edma.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_edma.h deleted file mode 100644 index aafd8603ee1..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_edma.h +++ /dev/null @@ -1,1893 +0,0 @@ -/* - * Copyright 2022-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_EDMA_H_ -#define FSL_EDMA_H_ - -#include "fsl_common.h" -#include "fsl_edma_core.h" -/*! - * @addtogroup edma - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief eDMA driver version */ -#define FSL_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 10, 0)) /*!< Version 2.10.0. */ -/*! @} */ - -/*! @brief eDMA driver name */ -#ifndef FSL_EDMA_DRIVER_EDMA4 -#define FSL_EDMA_DRIVER_EDMA4 (1) -#endif - -/*!@brief Macro used for allocate edma TCD */ -#define EDMA_ALLOCATE_TCD(name, number) AT_NONCACHEABLE_SECTION_ALIGN(edma_tcd_t name[number], EDMA_TCD_ALIGN_SIZE) - -/*! @brief _edma_transfer_status eDMA transfer status */ -enum -{ - kStatus_EDMA_QueueFull = MAKE_STATUS(kStatusGroup_EDMA, 0), /*!< TCD queue is full. */ - kStatus_EDMA_Busy = MAKE_STATUS(kStatusGroup_EDMA, 1), /*!< Channel is busy and can't handle the - transfer request. */ -}; - -/*! @brief Compute the offset unit from DCHPRI3 */ -#define DMA_DCHPRI_INDEX(channel) (((channel) & ~0x03U) | (3U - ((channel)&0x03U))) - -/*! @brief eDMA transfer configuration */ -typedef enum _edma_transfer_size -{ - kEDMA_TransferSize1Bytes = 0x0U, /*!< Source/Destination data transfer size is 1 byte every time */ - kEDMA_TransferSize2Bytes = 0x1U, /*!< Source/Destination data transfer size is 2 bytes every time */ - kEDMA_TransferSize4Bytes = 0x2U, /*!< Source/Destination data transfer size is 4 bytes every time */ -#if (defined(FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) - kEDMA_TransferSize8Bytes = 0x3U, /*!< Source/Destination data transfer size is 8 bytes every time */ -#endif -#if (defined(FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) - kEDMA_TransferSize16Bytes = 0x4U, /*!< Source/Destination data transfer size is 16 bytes every time */ -#endif - kEDMA_TransferSize32Bytes = 0x5U, /*!< Source/Destination data transfer size is 32 bytes every time */ -#if (defined(FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) - kEDMA_TransferSize64Bytes = 0x6U, /*!< Source/Destination data transfer size is 64 bytes every time */ -#endif -#if (defined(FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) - kEDMA_TransferSize128Bytes = 0x7U, /*!< Source/Destination data transfer size is 128 bytes every time */ -#endif -} edma_transfer_size_t; - -/*! @brief eDMA modulo configuration */ -typedef enum _edma_modulo -{ - kEDMA_ModuloDisable = 0x0U, /*!< Disable modulo */ - kEDMA_Modulo2bytes, /*!< Circular buffer size is 2 bytes. */ - kEDMA_Modulo4bytes, /*!< Circular buffer size is 4 bytes. */ - kEDMA_Modulo8bytes, /*!< Circular buffer size is 8 bytes. */ - kEDMA_Modulo16bytes, /*!< Circular buffer size is 16 bytes. */ - kEDMA_Modulo32bytes, /*!< Circular buffer size is 32 bytes. */ - kEDMA_Modulo64bytes, /*!< Circular buffer size is 64 bytes. */ - kEDMA_Modulo128bytes, /*!< Circular buffer size is 128 bytes. */ - kEDMA_Modulo256bytes, /*!< Circular buffer size is 256 bytes. */ - kEDMA_Modulo512bytes, /*!< Circular buffer size is 512 bytes. */ - kEDMA_Modulo1Kbytes, /*!< Circular buffer size is 1 K bytes. */ - kEDMA_Modulo2Kbytes, /*!< Circular buffer size is 2 K bytes. */ - kEDMA_Modulo4Kbytes, /*!< Circular buffer size is 4 K bytes. */ - kEDMA_Modulo8Kbytes, /*!< Circular buffer size is 8 K bytes. */ - kEDMA_Modulo16Kbytes, /*!< Circular buffer size is 16 K bytes. */ - kEDMA_Modulo32Kbytes, /*!< Circular buffer size is 32 K bytes. */ - kEDMA_Modulo64Kbytes, /*!< Circular buffer size is 64 K bytes. */ - kEDMA_Modulo128Kbytes, /*!< Circular buffer size is 128 K bytes. */ - kEDMA_Modulo256Kbytes, /*!< Circular buffer size is 256 K bytes. */ - kEDMA_Modulo512Kbytes, /*!< Circular buffer size is 512 K bytes. */ - kEDMA_Modulo1Mbytes, /*!< Circular buffer size is 1 M bytes. */ - kEDMA_Modulo2Mbytes, /*!< Circular buffer size is 2 M bytes. */ - kEDMA_Modulo4Mbytes, /*!< Circular buffer size is 4 M bytes. */ - kEDMA_Modulo8Mbytes, /*!< Circular buffer size is 8 M bytes. */ - kEDMA_Modulo16Mbytes, /*!< Circular buffer size is 16 M bytes. */ - kEDMA_Modulo32Mbytes, /*!< Circular buffer size is 32 M bytes. */ - kEDMA_Modulo64Mbytes, /*!< Circular buffer size is 64 M bytes. */ - kEDMA_Modulo128Mbytes, /*!< Circular buffer size is 128 M bytes. */ - kEDMA_Modulo256Mbytes, /*!< Circular buffer size is 256 M bytes. */ - kEDMA_Modulo512Mbytes, /*!< Circular buffer size is 512 M bytes. */ - kEDMA_Modulo1Gbytes, /*!< Circular buffer size is 1 G bytes. */ - kEDMA_Modulo2Gbytes, /*!< Circular buffer size is 2 G bytes. */ -} edma_modulo_t; - -#if defined FSL_FEATURE_EDMA_HAS_BANDWIDTH && FSL_FEATURE_EDMA_HAS_BANDWIDTH -/*! @brief Bandwidth control */ -typedef enum _edma_bandwidth -{ - kEDMA_BandwidthStallNone = 0x0U, /*!< No eDMA engine stalls. */ - kEDMA_BandwidthStall4Cycle = 0x2U, /*!< eDMA engine stalls for 4 cycles after each read/write. */ - kEDMA_BandwidthStall8Cycle = 0x3U, /*!< eDMA engine stalls for 8 cycles after each read/write. */ -} edma_bandwidth_t; -#endif - -/*! @brief Channel link type */ -typedef enum _edma_channel_link_type -{ - kEDMA_LinkNone = 0x0U, /*!< No channel link */ - kEDMA_MinorLink, /*!< Channel link after each minor loop */ - kEDMA_MajorLink, /*!< Channel link while major loop count exhausted */ -} edma_channel_link_type_t; - -/*!@brief _edma_channel_status_flags eDMA channel status flags. */ -enum -{ - kEDMA_DoneFlag = 0x1U, /*!< DONE flag, set while transfer finished, CITER value exhausted*/ - kEDMA_ErrorFlag = 0x2U, /*!< eDMA error flag, an error occurred in a transfer */ - kEDMA_InterruptFlag = 0x4U, /*!< eDMA interrupt flag, set while an interrupt occurred of this channel */ -}; - -/*! @brief _edma_error_status_flags eDMA channel error status flags. */ -enum -{ - kEDMA_DestinationBusErrorFlag = DMA_ERR_DBE_FLAG, /*!< Bus error on destination address */ - kEDMA_SourceBusErrorFlag = DMA_ERR_SBE_FLAG, /*!< Bus error on the source address */ - kEDMA_ScatterGatherErrorFlag = DMA_ERR_SGE_FLAG, /*!< Error on the Scatter/Gather address, not 32byte aligned. */ - kEDMA_NbytesErrorFlag = DMA_ERR_NCE_FLAG, /*!< NBYTES/CITER configuration error */ - kEDMA_DestinationOffsetErrorFlag = DMA_ERR_DOE_FLAG, /*!< Destination offset not aligned with destination size */ - kEDMA_DestinationAddressErrorFlag = DMA_ERR_DAE_FLAG, /*!< Destination address not aligned with destination size */ - kEDMA_SourceOffsetErrorFlag = DMA_ERR_SOE_FLAG, /*!< Source offset not aligned with source size */ - kEDMA_SourceAddressErrorFlag = DMA_ERR_SAE_FLAG, /*!< Source address not aligned with source size*/ - kEDMA_ErrorChannelFlag = DMA_ERR_ERRCHAN_FLAG, /*!< Error channel number of the cancelled channel number */ -#if defined(FSL_FEATURE_EDMA_HAS_PRIORITY_ERROR) && (FSL_FEATURE_EDMA_HAS_PRIORITY_ERROR > 1) - kEDMA_ChannelPriorityErrorFlag = DMA_ERR_CPE_FLAG, /*!< Channel priority is not unique. */ -#endif - kEDMA_TransferCanceledFlag = DMA_ERR_ECX_FLAG, /*!< Transfer cancelled */ -#if defined(FSL_FEATURE_EDMA_CHANNEL_GROUP_COUNT) && (FSL_FEATURE_EDMA_CHANNEL_GROUP_COUNT > 1) - kEDMA_GroupPriorityErrorFlag = DMA_ERR_GPE_FLAG, /*!< Group priority is not unique. */ -#endif - kEDMA_ValidFlag = (int)DMA_ERR_FLAG, /*!< No error occurred, this bit is 0. Otherwise, it is 1. */ -}; - -/*! @brief _edma_interrupt_enable eDMA interrupt source */ -enum -{ - kEDMA_ErrorInterruptEnable = 0x1U, /*!< Enable interrupt while channel error occurs. */ - kEDMA_MajorInterruptEnable = DMA_CSR_INTMAJOR_MASK, /*!< Enable interrupt while major count exhausted. */ - kEDMA_HalfInterruptEnable = DMA_CSR_INTHALF_MASK, /*!< Enable interrupt while major count to half value. */ -}; - -/*! @brief eDMA transfer type */ -typedef enum _edma_transfer_type -{ - kEDMA_MemoryToMemory = 0x0U, /*!< Transfer from memory to memory */ - kEDMA_PeripheralToMemory, /*!< Transfer from peripheral to memory */ - kEDMA_MemoryToPeripheral, /*!< Transfer from memory to peripheral */ - kEDMA_PeripheralToPeripheral, /*!< Transfer from Peripheral to peripheral */ -} edma_transfer_type_t; - -/*! @brief eDMA channel priority configuration */ -typedef struct _edma_channel_Preemption_config -{ - bool enableChannelPreemption; /*!< If true: a channel can be suspended by other channel with higher priority */ - bool enablePreemptAbility; /*!< If true: a channel can suspend other channel with low priority */ - uint8_t channelPriority; /*!< Channel priority */ -} edma_channel_Preemption_config_t; - -/*! @brief eDMA minor offset configuration */ -typedef struct _edma_minor_offset_config -{ - bool enableSrcMinorOffset; /*!< Enable(true) or Disable(false) source minor loop offset. */ - bool enableDestMinorOffset; /*!< Enable(true) or Disable(false) destination minor loop offset. */ - uint32_t minorOffset; /*!< Offset for a minor loop mapping. */ -} edma_minor_offset_config_t; - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG && FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE && FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE -/*! @brief eDMA channel memory attribute */ -typedef enum edma_channel_memory_attribute -{ - kEDMA_ChannelNoWriteNoReadNoCacheNoBuffer = - 0x0U, /*!< No write allocate, no read allocate, non-cacheable, non-bufferable. */ - kEDMA_ChannelNoWriteNoReadNoCacheBufferable, /*!< No write allocate, no read allocate, non-cacheable, bufferable. - */ - kEDMA_ChannelNoWriteNoReadCacheableNoBuffer, /*!< No write allocate, no read allocate, cacheable, non-bufferable. - */ - kEDMA_ChannelNoWriteNoReadCacheableBufferable, /*!< No write allocate, no read allocate, cacheable, bufferable. */ - kEDMA_ChannelNoWriteReadNoCacheNoBuffer, /*!< No write allocate, read allocate, non-cacheable, non-bufferable. */ - kEDMA_ChannelNoWriteReadNoCacheBufferable, /*!< No write allocate, read allocate, non-cacheable, bufferable. */ - kEDMA_ChannelNoWriteReadCacheableNoBuffer, /*!< No write allocate, read allocate, cacheable, non-bufferable. */ - kEDMA_ChannelNoWriteReadCacheableBufferable, /*!< No write allocate, read allocate, cacheable, bufferable. */ - kEDMA_ChannelWriteNoReadNoCacheNoBuffer, /*!< write allocate, no read allocate, non-cacheable, non-bufferable. */ - kEDMA_ChannelWriteNoReadNoCacheBufferable, /*!< write allocate, no read allocate, non-cacheable, bufferable. */ - kEDMA_ChannelWriteNoReadCacheableNoBuffer, /*!< write allocate, no read allocate, cacheable, non-bufferable. */ - kEDMA_ChannelWriteNoReadCacheableBufferable, /*!< write allocate, no read allocate, cacheable, bufferable. */ - kEDMA_ChannelWriteReadNoCacheNoBuffer, /*!< write allocate, read allocate, non-cacheable, non-bufferable. */ - kEDMA_ChannelWriteReadNoCacheBufferable, /*!< write allocate, read allocate, non-cacheable, bufferable. */ - kEDMA_ChannelWriteReadCacheableNoBuffer, /*!< write allocate, read allocate, cacheable, non-bufferable. */ - kEDMA_ChannelWriteReadCacheableBufferable, /*!< write allocate, read allocate, cacheable, bufferable. */ -} edma_channel_memory_attribute_t; -#endif - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE && FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE -/*! @brief eDMA4 channel swap size */ -typedef enum _edma_channel_swap_size -{ - kEDMA_ChannelSwapDisabled = 0x0U, /*!< Swap is disabled. */ - kEDMA_ChannelReadWith8bitSwap = 0x1U, /*!< Swap occurs with respect to the read 8bit. */ - kEDMA_ChannelReadWith16bitSwap = 0x2U, /*!< Swap occurs with respect to the read 16bit. */ - kEDMA_ChannelReadWith32bitSwap = 0x3U, /*!< Swap occurs with respect to the read 32bit. */ - kEDMA_ChannelWriteWith8bitSwap = 0x9U, /*!< Swap occurs with respect to the write 8bit. */ - kEDMA_ChannelWriteWith16bitSwap = 0x10U, /*!< Swap occurs with respect to the write 16bit. */ - kEDMA_ChannelWriteWith32bitSwap = 0x11U, /*!< Swap occurs with respect to the write 32bit. */ -} edma_channel_swap_size_t; -#endif - -/*! @brief eDMA channel system bus information, _edma_channel_sys_bus_info*/ -enum -{ -#if !(defined(FSL_FEATURE_EDMA_HAS_NO_CH_SBR_ATTR) && FSL_FEATURE_EDMA_HAS_NO_CH_SBR_ATTR) - kEDMA_AttributeOutput = DMA_CH_SBR_ATTR_MASK, /*!< DMA's AHB system bus attribute output value. */ -#endif - - kEDMA_PrivilegedAccessLevel = DMA_CH_SBR_PAL_MASK, /*!< Privileged Access Level for DMA transfers. 0b - User - protection level; 1b - Privileged protection level. */ - kEDMA_MasterId = - DMA_CH_SBR_MID_MASK, /*!< DMA's master ID when channel is active and master ID replication is enabled. */ -}; - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE && FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE -/*! @brief eDMA4 channel access type */ -typedef enum _edma_channel_access_type -{ - kEDMA_ChannelDataAccess = 0x0U, /*!< Data access for eDMA4 transfers. */ - kEDMA_ChannelInstructionAccess = 0x1U, /*!< Instruction access for eDMA4 transfers. */ -} edma_channel_access_type_t; -#endif - -/*! @brief eDMA4 channel protection level */ -typedef enum _edma_channel_protection_level -{ - kEDMA_ChannelProtectionLevelUser = 0x0U, /*!< user protection level for eDMA transfers. */ - kEDMA_ChannelProtectionLevelPrivileged = 0x1U, /*!< Privileged protection level eDMA transfers. */ -} edma_channel_protection_level_t; - -#if !(defined(FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) && FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) - -/*! @brief eDMA4 channel security level */ -typedef enum _edma_channel_security_level -{ - kEDMA_ChannelSecurityLevelNonSecure = 0x0U, /*!< non secure level for eDMA transfers. */ - kEDMA_ChannelSecurityLevelSecure = 0x1U, /*!< secure level for eDMA transfers. */ -} edma_channel_security_level_t; -#endif - -/*! @brief eDMA4 channel configuration*/ -typedef struct _edma_channel_config -{ - edma_channel_Preemption_config_t channelPreemptionConfig; /*!< channel preemption configuration */ - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE && FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE - edma_channel_memory_attribute_t channelReadMemoryAttribute; /*!< channel memory read attribute configuration */ - edma_channel_memory_attribute_t channelWriteMemoryAttribute; /*!< channel memory write attribute configuration */ -#endif - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE && FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE - edma_channel_swap_size_t channelSwapSize; /*!< channel swap size configuration */ -#endif - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE && FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE - edma_channel_access_type_t channelAccessType; /*!< channel access type configuration */ -#endif - - uint8_t channelDataSignExtensionBitPosition; /*!< channel data sign extension bit psition configuration */ - -#if (defined FSL_FEATURE_EDMA_HAS_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_CHANNEL_MUX) || (defined FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX) - int channelRequestSource; /*!< hardware service request source for the channel */ -#endif - - bool enableMasterIDReplication; /*!< enable master ID replication */ -#if !(defined(FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) && FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) - edma_channel_security_level_t securityLevel; /*!< security level */ -#endif - edma_channel_protection_level_t protectionLevel; /*!< protection level */ - -} edma_channel_config_t; -#endif - -/*! - * @brief eDMA TCD. - * - * This structure is same as TCD register which is described in reference manual, - * and is used to configure the scatter/gather feature as a next hardware TCD. - */ -typedef edma_core_tcd_t edma_tcd_t; - -/*! @brief edma4 channel transfer configuration - * - * The transfer configuration structure support full feature configuration of the transfer control descriptor. - * - * @note User should pay attention to the transfer size alignment limitation - * 1. the bytesEachRequest should align with the srcWidthOfEachTransfer and the dstWidthOfEachTransfer - * that is to say bytesEachRequest % srcWidthOfEachTransfer should be 0 - * 2. the srcOffsetOfEachTransfer and dstOffsetOfEachTransfer must be aligne with transfer width - * 3. the totalBytes should align with the bytesEachRequest - * 4. the srcAddr should align with the srcWidthOfEachTransfer - * 5. the dstAddr should align with the dstWidthOfEachTransfer - * 6. the srcAddr should align with srcAddrModulo if modulo feature is enabled - * 7. the dstAddr should align with dstAddrModulo if modulo feature is enabled - * If anyone of above condition can not be satisfied, the edma4 interfaces will generate assert error. - * - * 1.To perform a simple transfer, below members should be initialized at least - * .srcAddr - source address - * .dstAddr - destination address - * .srcWidthOfEachTransfer - data width of source address - * .dstWidthOfEachTransfer - data width of destination address, normally it should be as same as - * srcWidthOfEachTransfer .bytesEachRequest - bytes to be transferred in each DMA request .totalBytes - total - * bytes to be transferred .srcOffsetOfEachTransfer - offset value in bytes unit to be applied to source address as - * each source read is completed .dstOffsetOfEachTransfer - offset value in bytes unit to be applied to destination - * address as each destination write is completed enablchannelRequest - channel request can be enabled together with - * transfer configure submission - * - * 2.The transfer configuration structure also support advance feature: - * Programmable source/destination address range(MODULO) - * Programmable minor loop offset - * Programmable major loop offset - * Programmable channel chain feature - * Programmable channel transfer control descriptor link feature - * - */ -typedef struct _edma_transfer_config -{ - uint32_t srcAddr; /*!< Source data address. */ - uint32_t destAddr; /*!< Destination data address. */ - edma_transfer_size_t srcTransferSize; /*!< Source data transfer size. */ - edma_transfer_size_t destTransferSize; /*!< Destination data transfer size. */ - int16_t srcOffset; /*!< Sign-extended offset value in byte unit applied to the current source - address to form the next-state value as each source read is completed */ - int16_t destOffset; /*!< Sign-extended offset value in byte unit applied to the current destination - address to form the next-state value as each destination write is completed. */ - uint32_t minorLoopBytes; /*!< bytes in each minor loop or each request - * range: 1 - (2^30 -1) when minor loop mapping is enabled - * range: 1 - (2^10 - 1) when minor loop mapping is enabled and source or dest minor - * loop offset is enabled - * range: 1 - (2^32 - 1) when minor loop mapping is disabled - */ - uint32_t majorLoopCounts; /*!< minor loop counts in each major loop, should be 1 at least for each - * transfer range: (0 - (2^15 - 1)) when minor loop channel link is - * disabled range: (0 - (2^9 - 1)) when minor loop channel link is enabled - * total bytes in a transfer = minorLoopCountsEachMajorLoop * - * bytesEachMinorLoop - */ - - uint16_t enabledInterruptMask; /*!< channel interrupt to enable, can be OR'ed value of _edma_interrupt_enable */ - - edma_modulo_t srcAddrModulo; /*!< source circular data queue range */ - int32_t srcMajorLoopOffset; /*!< source major loop offset */ - - edma_modulo_t dstAddrModulo; /*!< destination circular data queue range */ - int32_t dstMajorLoopOffset; /*!< destination major loop offset */ - - bool enableSrcMinorLoopOffset; /*!< enable source minor loop offset */ - bool enableDstMinorLoopOffset; /*!< enable dest minor loop offset */ - int32_t minorLoopOffset; /*!< burst offset, the offset will be applied after minor loop update */ - - bool enableChannelMajorLoopLink; /*!< channel link when major loop complete */ - uint32_t majorLoopLinkChannel; /*!< major loop link channel number */ - - bool enableChannelMinorLoopLink; /*!< channel link when minor loop complete */ - uint32_t minorLoopLinkChannel; /*!< minor loop link channel number */ - - edma_tcd_t *linkTCD; /*!< pointer to the link transfer control descriptor */ -} edma_transfer_config_t; - -/*! @brief eDMA global configuration structure.*/ -typedef struct _edma_config -{ -#if defined FSL_FEATURE_EDMA_HAS_CONTINUOUS_LINK_MODE && FSL_FEATURE_EDMA_HAS_CONTINUOUS_LINK_MODE - bool enableContinuousLinkMode; /*!< Enable (true) continuous link mode. Upon minor loop completion, the channel - activates again if that channel has a minor loop channel link enabled and - the link channel is itself. */ -#endif - -#if defined FSL_FEATURE_EDMA_HAS_GLOBAL_MASTER_ID_REPLICATION && FSL_FEATURE_EDMA_HAS_GLOBAL_MASTER_ID_REPLICATION - bool enableMasterIdReplication; /*!< Enable (true) master ID replication. If Master ID replication is disabled, the - privileged protection level (supervisor mode) for eDMA4 transfers is used. */ -#endif - - bool enableGlobalChannelLink; /*!< Enable(true) channel linking is available and controlled by each channel's link - settings. */ - - bool enableHaltOnError; /*!< Enable (true) transfer halt on error. Any error causes the HALT bit to set. - Subsequently, all service requests are ignored until the HALT bit is cleared.*/ - - bool enableDebugMode; /*!< Enable(true) eDMA4 debug mode. When in debug mode, the eDMA4 stalls the start of - a new channel. Executing channels are allowed to complete. */ - - bool enableRoundRobinArbitration; /*!< Enable(true) channel linking is available and controlled by each channel's - link settings. */ -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG && FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG - edma_channel_config_t *channelConfig[FSL_FEATURE_EDMA_MODULE_CHANNEL]; /*!< channel preemption configuration */ -#endif -} edma_config_t; - -/*! @brief Callback for eDMA */ -struct _edma_handle; - -/*! @brief Define callback function for eDMA. - * - * This callback function is called in the EDMA interrupt handle. - * In normal mode, run into callback function means the transfer users need is done. - * In scatter gather mode, run into callback function means a transfer control block (tcd) is finished. Not - * all transfer finished, users can get the finished tcd numbers using interface EDMA_GetUnusedTCDNumber. - * - * @param handle EDMA handle pointer, users shall not touch the values inside. - * @param userData The callback user parameter pointer. Users can use this parameter to involve things users need to - * change in EDMA callback function. - * @param transferDone If the current loaded transfer done. In normal mode it means if all transfer done. In scatter - * gather mode, this parameter shows is the current transfer block in EDMA register is done. As the - * load of core is different, it will be different if the new tcd loaded into EDMA registers while - * this callback called. If true, it always means new tcd still not loaded into registers, while - * false means new tcd already loaded into registers. - * @param tcds How many tcds are done from the last callback. This parameter only used in scatter gather mode. It - * tells user how many tcds are finished between the last callback and this. - */ -typedef void (*edma_callback)(struct _edma_handle *handle, void *userData, bool transferDone, uint32_t tcds); - -/*! @brief eDMA transfer handle structure */ -typedef struct _edma_handle -{ - edma_callback callback; /*!< Callback function for major count exhausted. */ - void *userData; /*!< Callback function parameter. */ - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG && FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG - EDMA_ChannelType *channelBase; /*!< eDMA peripheral channel base address. */ -#endif - EDMA_Type *base; /*!< eDMA peripheral base address*/ - EDMA_TCDType *tcdBase; /*!< eDMA peripheral tcd base address. */ - - edma_tcd_t *tcdPool; /*!< Pointer to memory stored TCDs. */ - uint32_t channel; /*!< eDMA channel number. */ - - volatile int8_t header; /*!< The first TCD index. Should point to the next TCD to be loaded into the eDMA engine. */ - volatile int8_t tail; /*!< The last TCD index. Should point to the next TCD to be stored into the memory pool. */ - volatile int8_t tcdUsed; /*!< The number of used TCD slots. Should reflect the number of TCDs can be used/loaded in - the memory. */ - volatile int8_t tcdSize; /*!< The total number of TCD slots in the queue. */ -} edma_handle_t; -/******************************************************************************* - * APIs - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name eDMA initialization and de-initialization - * @{ - */ - -/*! - * @brief Initializes the eDMA peripheral. - * - * This function ungates the eDMA clock and configures the eDMA peripheral according - * to the configuration structure. - * - * @param base eDMA peripheral base address. - * @param config A pointer to the configuration structure, see "edma_config_t". - * @note This function enables the minor loop map feature. - */ -void EDMA_Init(EDMA_Type *base, const edma_config_t *config); - -/*! - * @brief Deinitializes the eDMA peripheral. - * - * This function gates the eDMA clock. - * - * @param base eDMA peripheral base address. - */ -void EDMA_Deinit(EDMA_Type *base); - -/*! - * @brief Push content of TCD structure into hardware TCD register. - * - * @param base EDMA peripheral base address. - * @param channel EDMA channel number. - * @param tcd Point to TCD structure. - */ -void EDMA_InstallTCD(EDMA_Type *base, uint32_t channel, edma_tcd_t *tcd); - -/*! - * @brief Gets the eDMA default configuration structure. - * - * This function sets the configuration structure to default values. - * The default configuration is set to the following values. - * @code - * config.enableContinuousLinkMode = false; - * config.enableHaltOnError = true; - * config.enableRoundRobinArbitration = false; - * config.enableDebugMode = false; - * @endcode - * - * @param config A pointer to the eDMA configuration structure. - */ -void EDMA_GetDefaultConfig(edma_config_t *config); - -#if defined(FSL_FEATURE_DMA_HAS_CONTINUOUS_CHANNEL_LINK) && FSL_FEATURE_DMA_HAS_CONTINUOUS_CHANNEL_LINK -/*! - * @brief Enable/Disable continuous channel link mode. - * - * @note Do not use continuous link mode with a channel linking to itself if there is only one minor loop - * iteration per service request, for example, if the channel's NBYTES value is the same as either - * the source or destination size. The same data transfer profile can be achieved by simply - * increasing the NBYTES value, which provides more efficient, faster processing. - * - * @param base EDMA peripheral base address. - * @param enable true is enable, false is disable. - */ -static inline void EDMA_EnableContinuousChannelLinkMode(EDMA_Type *base, bool enable) -{ - if (enable) - { - EDMA_BASE(base)->CR |= DMA_CR_CLM_MASK; - } - else - { - EDMA_BASE(base)->CR &= ~DMA_CR_CLM_MASK; - } -} -#endif - -#if defined(FSL_FEATURE_DMA_HAS_MINOR_LOOP_MAPPING) && FSL_FEATURE_DMA_HAS_MINOR_LOOP_MAPPING -/*! - * @brief Enable/Disable minor loop mapping. - * - * The TCDn.word2 is redefined to include individual enable fields, an offset field, and the - * NBYTES field. - * - * @param base EDMA peripheral base address. - * @param enable true is enable, false is disable. - */ -static inline void EDMA_EnableMinorLoopMapping(EDMA_Type *base, bool enable) -{ - if (enable) - { - EDMA_BASE(base)->CR |= DMA_CR_EMLM_MASK; - } - else - { - EDMA_BASE(base)->CR &= ~DMA_CR_EMLM_MASK; - } -} -#endif - -/*! @} */ -/*! - * @name eDMA Channel Operation - * @{ - */ - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG && FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG -/*! - * @brief EDMA Channel initialization - * - * @param base eDMA4 peripheral base address. - * @param channel eDMA4 channel number. - * @param channelConfig pointer to user's eDMA4 channel config structure, see edma_channel_config_t for detail. - */ -void EDMA_InitChannel(EDMA_Type *base, uint32_t channel, edma_channel_config_t *channelConfig); - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE && FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE -/*! - * @brief Set channel memory attribute. - * - * @param base eDMA4 peripheral base address. - * @param channel eDMA4 channel number. - * @param writeAttribute Attributes associated with a write transaction. - * @param readAttribute Attributes associated with a read transaction. - */ -static inline void EDMA_SetChannelMemoryAttribute(EDMA_Type *base, - uint32_t channel, - edma_channel_memory_attribute_t writeAttribute, - edma_channel_memory_attribute_t readAttribute) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - if (0U != (uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_MEMORY_ATTRIBUTEn(base)) - { -#if defined FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX - if ((uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_MP_CHANNEL_MUXn(base) == 1U) - { - EDMA_CHANNEL_BASE(base, channel)->CH_REGS.EDMA5_REG.CH_MATTR = - DMA_CH_MATTR_WCACHE(writeAttribute) | DMA_CH_MATTR_RCACHE(readAttribute); - } - else -#endif - { - EDMA_CHANNEL_BASE(base, channel)->CH_REGS.EDMA4_REG.CH_MATTR = - DMA_CH_MATTR_WCACHE(writeAttribute) | DMA_CH_MATTR_RCACHE(readAttribute); - } - } -} -#endif - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_SIGN_EXTENSION && FSL_FEATURE_EDMA_HAS_CHANNEL_SIGN_EXTENSION -/*! - * @brief Set channel sign extension. - * - * @param base eDMA4 peripheral base address. - * @param channel eDMA4 channel number. - * @param position A non-zero value specifing the sign extend bit position. - * If 0, sign extension is disabled. - */ -static inline void EDMA_SetChannelSignExtension(EDMA_Type *base, uint32_t channel, uint8_t position) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - if (0U != (uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_SIGN_EXTENSIONn(base)) - { - EDMA_CHANNEL_BASE(base, channel)->CH_CSR = - (EDMA_CHANNEL_BASE(base, channel)->CH_CSR & (~DMA_CH_CSR_SIGNEXT_MASK)) | - ((uint32_t)position << DMA_CH_CSR_SIGNEXT_SHIFT); - } -} -#endif - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE && FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE -/*! - * @brief Set channel swap size. - * - * @param base eDMA4 peripheral base address. - * @param channel eDMA4 channel number. - * @param swapSize Swap occurs with respect to the specified transfer size. - * If 0, swap is disabled. - */ -static inline void EDMA_SetChannelSwapSize(EDMA_Type *base, uint32_t channel, edma_channel_swap_size_t swapSize) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - if (0U != (uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_SWAP_SIZEn(base)) - { - EDMA_CHANNEL_BASE(base, channel)->CH_CSR = - (EDMA_CHANNEL_BASE(base, channel)->CH_CSR & (~DMA_CH_CSR_SWAP_MASK)) | - ((uint32_t)swapSize << DMA_CH_CSR_SWAP_SHIFT); - } -} -#endif - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE && FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE -/*! - * @brief Set channel access type. - * - * @param base eDMA4 peripheral base address. - * @param channel eDMA4 channel number. - * @param channelAccessType eDMA4's transactions type on the system bus when the channel is active. - */ -static inline void EDMA_SetChannelAccessType(EDMA_Type *base, - uint32_t channel, - edma_channel_access_type_t channelAccessType) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - if (0U != (uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_ACCESS_TYPEn(base)) - { -#if defined FSL_FEATURE_EDMA_HAS_PROT_REGISTER && FSL_FEATURE_EDMA_HAS_PROT_REGISTER - if (FSL_FEATURE_EDMA_INSTANCE_HAS_PROT_REGISTERn(base) == 1) - { - EDMA_MP_BASE(base)->MP_REGS.EDMA5_REG.CH_PROT[channel] = - (EDMA_MP_BASE(base)->MP_REGS.EDMA5_REG.CH_PROT[channel] & (~DMA_CH_SBR_INSTR_MASK)) | - ((uint32_t)channelAccessType << DMA_CH_SBR_INSTR_SHIFT); - } - else -#endif - { - EDMA_CHANNEL_BASE(base, channel)->CH_SBR = - (EDMA_CHANNEL_BASE(base, channel)->CH_SBR & (~DMA_CH_SBR_INSTR_MASK)) | - ((uint32_t)channelAccessType << DMA_CH_SBR_INSTR_SHIFT); - } - } -} -#endif - -#if (defined FSL_FEATURE_EDMA_HAS_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_CHANNEL_MUX) || \ - (defined FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX) -/*! - * @brief Set channel request source. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param channelRequestSource eDMA hardware service request source for the channel. User need to use - * the dma_request_source_t type as the input parameter. Note that devices - * may use other enum type to express dma request source and User can fined it in - * SOC header or fsl_edma_soc.h. - */ -static inline void EDMA_SetChannelMux(EDMA_Type *base, uint32_t channel, int32_t channelRequestSource) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - if ((uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_MUXn(base) == 1U) - { - /* Reset channel mux */ -#if defined FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX - if ((uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_MP_CHANNEL_MUXn(base) == 1U) - { - EDMA_MP_BASE(base)->MP_REGS.EDMA5_REG.CH_MUX[channel] = DMA_CH_MUX_SOURCE(0); - EDMA_MP_BASE(base)->MP_REGS.EDMA5_REG.CH_MUX[channel] = DMA_CH_MUX_SOURCE(channelRequestSource); - } - else -#endif - { -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_CHANNEL_MUX - EDMA_CHANNEL_BASE(base, channel)->CH_REGS.EDMA4_REG.CH_MUX = DMA_CH_MUX_SOURCE(0); - EDMA_CHANNEL_BASE(base, channel)->CH_REGS.EDMA4_REG.CH_MUX = DMA_CH_MUX_SOURCE(channelRequestSource); -#endif - } - } -} -#endif - -/*! - * @brief Gets the channel identification and attribute information on the system bus interface. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @return The mask of the channel system bus information. Users need to use the - * _edma_channel_sys_bus_info type to decode the return variables. - */ -static inline uint32_t EDMA_GetChannelSystemBusInformation(EDMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - return EDMA_CHANNEL_BASE(base, channel)->CH_SBR; -} - -/*! - * @brief Set channel master ID replication. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param enable true is enable, false is disable. - */ -static inline void EDMA_EnableChannelMasterIDReplication(EDMA_Type *base, uint32_t channel, bool enable) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - -#if defined FSL_FEATURE_EDMA_HAS_PROT_REGISTER && FSL_FEATURE_EDMA_HAS_PROT_REGISTER - if (FSL_FEATURE_EDMA_INSTANCE_HAS_PROT_REGISTERn(base) == 1) - { - if (enable) - { - EDMA_MP_BASE(base)->MP_REGS.EDMA5_REG.CH_PROT[channel] |= DMA_CH_SBR_EMI_MASK; - } - else - { - EDMA_MP_BASE(base)->MP_REGS.EDMA5_REG.CH_PROT[channel] &= ~DMA_CH_SBR_EMI_MASK; - } - } - else -#endif - { - if (enable) - { - EDMA_CHANNEL_BASE(base, channel)->CH_SBR |= DMA_CH_SBR_EMI_MASK; - } - else - { - EDMA_CHANNEL_BASE(base, channel)->CH_SBR &= ~DMA_CH_SBR_EMI_MASK; - } - } -} - -#if !(defined(FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) && FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) -/*! - * @brief Set channel security level. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param level security level. - */ -static inline void EDMA_SetChannelSecurityLevel(EDMA_Type *base, uint32_t channel, edma_channel_security_level_t level) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - -#if defined FSL_FEATURE_EDMA_HAS_PROT_REGISTER && FSL_FEATURE_EDMA_HAS_PROT_REGISTER - if (FSL_FEATURE_EDMA_INSTANCE_HAS_PROT_REGISTERn(base) == 1) - { - if (level == kEDMA_ChannelSecurityLevelSecure) - { - EDMA_MP_BASE(base)->MP_REGS.EDMA5_REG.CH_PROT[channel] |= DMA_CH_SBR_SEC_MASK; - } - else - { - EDMA_MP_BASE(base)->MP_REGS.EDMA5_REG.CH_PROT[channel] &= ~DMA_CH_SBR_SEC_MASK; - } - } - else -#endif - { - if (level == kEDMA_ChannelSecurityLevelSecure) - { - EDMA_CHANNEL_BASE(base, channel)->CH_SBR |= DMA_CH_SBR_SEC_MASK; - } - else - { - EDMA_CHANNEL_BASE(base, channel)->CH_SBR &= ~DMA_CH_SBR_SEC_MASK; - } - } -} -#endif - -/*! - * @brief Set channel security level. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param level security level. - */ -static inline void EDMA_SetChannelProtectionLevel(EDMA_Type *base, - uint32_t channel, - edma_channel_protection_level_t level) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - -#if defined FSL_FEATURE_EDMA_HAS_PROT_REGISTER && FSL_FEATURE_EDMA_HAS_PROT_REGISTER - if (FSL_FEATURE_EDMA_INSTANCE_HAS_PROT_REGISTERn(base) == 1) - { - if (level == kEDMA_ChannelProtectionLevelPrivileged) - { - EDMA_MP_BASE(base)->MP_REGS.EDMA5_REG.CH_PROT[channel] |= DMA_CH_SBR_PAL_MASK; - } - else - { - EDMA_MP_BASE(base)->MP_REGS.EDMA5_REG.CH_PROT[channel] &= ~DMA_CH_SBR_PAL_MASK; - } - } - else -#endif - { - if (level == kEDMA_ChannelProtectionLevelPrivileged) - { - EDMA_CHANNEL_BASE(base, channel)->CH_SBR |= DMA_CH_SBR_PAL_MASK; - } - else - { - EDMA_CHANNEL_BASE(base, channel)->CH_SBR &= ~DMA_CH_SBR_PAL_MASK; - } - } -} - -#endif -/*! - * @brief Sets all TCD registers to default values. - * - * This function sets TCD registers for this channel to default values. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @note This function must not be called while the channel transfer is ongoing - * or it causes unpredictable results. - * @note This function enables the auto stop request feature. - */ -void EDMA_ResetChannel(EDMA_Type *base, uint32_t channel); - -/*! - * @brief Configures the eDMA transfer attribute. - * - * This function configures the transfer attribute, including source address, destination address, - * transfer size, address offset, and so on. It also configures the scatter gather feature if the - * user supplies the TCD address. - * Example: - * @code - * edma_transfer_t config; - * edma_tcd_t tcd; - * config.srcAddr = ..; - * config.destAddr = ..; - * ... - * EDMA_SetTransferConfig(DMA0, channel, &config, &stcd); - * @endcode - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param config Pointer to eDMA transfer configuration structure. - * @param nextTcd Point to TCD structure. It can be NULL if users - * do not want to enable scatter/gather feature. - * @note If nextTcd is not NULL, it means scatter gather feature is enabled - * and DREQ bit is cleared in the previous transfer configuration, which - * is set in the eDMA_ResetChannel. - */ -void EDMA_SetTransferConfig(EDMA_Type *base, - uint32_t channel, - const edma_transfer_config_t *config, - edma_tcd_t *nextTcd); - -/*! - * @brief Configures the eDMA minor offset feature. - * - * The minor offset means that the signed-extended value is added to the source address or destination - * address after each minor loop. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param config A pointer to the minor offset configuration structure. - */ -void EDMA_SetMinorOffsetConfig(EDMA_Type *base, uint32_t channel, const edma_minor_offset_config_t *config); - -/*! - * @brief Configures the eDMA channel preemption feature. - * - * This function configures the channel preemption attribute and the priority of the channel. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number - * @param config A pointer to the channel preemption configuration structure. - */ -void EDMA_SetChannelPreemptionConfig(EDMA_Type *base, uint32_t channel, const edma_channel_Preemption_config_t *config); - -/*! - * @brief Sets the channel link for the eDMA transfer. - * - * This function configures either the minor link or the major link mode. The minor link means that the channel link is - * triggered every time CITER decreases by 1. The major link means that the channel link is triggered when the CITER is - * exhausted. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param type A channel link type, which can be one of the following: - * @arg kEDMA_LinkNone - * @arg kEDMA_MinorLink - * @arg kEDMA_MajorLink - * @param linkedChannel The linked channel number. - * @note Users should ensure that DONE flag is cleared before calling this interface, or the configuration is invalid. - */ -void EDMA_SetChannelLink(EDMA_Type *base, uint32_t channel, edma_channel_link_type_t type, uint32_t linkedChannel); - -#if defined FSL_FEATURE_EDMA_HAS_BANDWIDTH && FSL_FEATURE_EDMA_HAS_BANDWIDTH -/*! - * @brief Sets the bandwidth for the eDMA transfer. - * - * Because the eDMA processes the minor loop, it continuously generates read/write sequences - * until the minor count is exhausted. The bandwidth forces the eDMA to stall after the completion of - * each read/write access to control the bus request bandwidth seen by the crossbar switch. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param bandWidth A bandwidth setting, which can be one of the following: - * @arg kEDMABandwidthStallNone - * @arg kEDMABandwidthStall4Cycle - * @arg kEDMABandwidthStall8Cycle - */ -void EDMA_SetBandWidth(EDMA_Type *base, uint32_t channel, edma_bandwidth_t bandWidth); -#endif - -/*! - * @brief Sets the source modulo and the destination modulo for the eDMA transfer. - * - * This function defines a specific address range specified to be the value after (SADDR + SOFF)/(DADDR + DOFF) - * calculation is performed or the original register value. It provides the ability to implement a circular data - * queue easily. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param srcModulo A source modulo value. - * @param destModulo A destination modulo value. - */ -void EDMA_SetModulo(EDMA_Type *base, uint32_t channel, edma_modulo_t srcModulo, edma_modulo_t destModulo); - -#if defined(FSL_FEATURE_EDMA_ASYNCHRO_REQUEST_CHANNEL_COUNT) && FSL_FEATURE_EDMA_ASYNCHRO_REQUEST_CHANNEL_COUNT -/*! - * @brief Enables an async request for the eDMA transfer. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param enable The command to enable (true) or disable (false). - */ -static inline void EDMA_EnableAsyncRequest(EDMA_Type *base, uint32_t channel, bool enable) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - EDMA_BASE(base)->EARS &= ~((uint32_t)1U << channel); - EDMA_BASE(base)->EARS |= ((uint32_t)(true == enable ? 1U : 0U) << channel); -#else - if (enable) - { - EDMA_CHANNEL_BASE(base, channel)->CH_CSR |= DMA_CH_CSR_EARQ_MASK; - } - else - { - EDMA_CHANNEL_BASE(base, channel)->CH_CSR &= ~DMA_CH_CSR_EARQ_MASK; - } -#endif -} -#endif - -/*! - * @brief Enables an auto stop request for the eDMA transfer. - * - * If enabling the auto stop request, the eDMA hardware automatically disables the hardware channel request. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param enable The command to enable (true) or disable (false). - */ -static inline void EDMA_EnableAutoStopRequest(EDMA_Type *base, uint32_t channel, bool enable) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - if (enable) - { - EDMA_TCD_CSR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) |= DMA_CSR_DREQ_MASK; - } - else - { - EDMA_TCD_CSR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_CSR_DREQ_MASK; - } -} - -/*! - * @brief Enables the interrupt source for the eDMA transfer. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_EnableChannelInterrupts(EDMA_Type *base, uint32_t channel, uint32_t mask); - -/*! - * @brief Disables the interrupt source for the eDMA transfer. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param mask The mask of the interrupt source to be set. Use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_DisableChannelInterrupts(EDMA_Type *base, uint32_t channel, uint32_t mask); - -/*! - * @brief Configures the eDMA channel TCD major offset feature. - * - * Adjustment value added to the source address at the completion of the major iteration count - * - * @param base eDMA peripheral base address. - * @param channel edma channel number. - * @param sourceOffset source address offset will be applied to source address after major loop done. - * @param destOffset destination address offset will be applied to source address after major loop done. - */ -void EDMA_SetMajorOffsetConfig(EDMA_Type *base, uint32_t channel, int32_t sourceOffset, int32_t destOffset); - -/*! @} */ -/*! - * @name eDMA TCD Operation - * @{ - */ -/*! - * @brief Sets TCD fields according to the user's channel transfer configuration structure, @ref - * edma_transfer_config_t. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_ConfigChannelSoftwareTCDExt - * - * Application should be careful about the TCD pool buffer storage class, - * - For the platform has cache, the software TCD should be put in non cache section - * - The TCD pool buffer should have a consistent storage class. - * - * @param tcd Pointer to the TCD structure. - * @param transfer channel transfer configuration pointer. - * - * @note This function enables the auto stop request feature. - */ -void EDMA_ConfigChannelSoftwareTCD(edma_tcd_t *tcd, const edma_transfer_config_t *transfer); - -/*! - * @brief Sets all fields to default values for the TCD structure. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_TcdResetExt - * - * This function sets all fields for this TCD structure to default value. - * - * @param tcd Pointer to the TCD structure. - * @note This function enables the auto stop request feature. - */ -void EDMA_TcdReset(edma_tcd_t *tcd); - -/*! - * @brief Configures the eDMA TCD transfer attribute. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_TcdSetTransferConfigExt - * - * The TCD is a transfer control descriptor. The content of the TCD is the same as the hardware TCD registers. - * The TCD is used in the scatter-gather mode. - * This function configures the TCD transfer attribute, including source address, destination address, - * transfer size, address offset, and so on. It also configures the scatter gather feature if the - * user supplies the next TCD address. - * Example: - * @code - * edma_transfer_t config = { - * ... - * } - * edma_tcd_t tcd __aligned(32); - * edma_tcd_t nextTcd __aligned(32); - * EDMA_TcdSetTransferConfig(&tcd, &config, &nextTcd); - * @endcode - * - * @param tcd Pointer to the TCD structure. - * @param config Pointer to eDMA transfer configuration structure. - * @param nextTcd Pointer to the next TCD structure. It can be NULL if users - * do not want to enable scatter/gather feature. - * @note TCD address should be 32 bytes aligned or it causes an eDMA error. - * @note If the nextTcd is not NULL, the scatter gather feature is enabled - * and DREQ bit is cleared in the previous transfer configuration, which - * is set in the EDMA_TcdReset. - */ -void EDMA_TcdSetTransferConfig(edma_tcd_t *tcd, const edma_transfer_config_t *config, edma_tcd_t *nextTcd); - -/*! - * @brief Configures the eDMA TCD minor offset feature. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_TcdSetMinorOffsetConfigExt - * - * A minor offset is a signed-extended value added to the source address or a destination - * address after each minor loop. - * - * @param tcd A point to the TCD structure. - * @param config A pointer to the minor offset configuration structure. - */ -void EDMA_TcdSetMinorOffsetConfig(edma_tcd_t *tcd, const edma_minor_offset_config_t *config); - -/*! - * @brief Sets the channel link for the eDMA TCD. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_TcdSetChannelLinkExt - * - * This function configures either a minor link or a major link. The minor link means the channel link is - * triggered every time CITER decreases by 1. The major link means that the channel link is triggered when the CITER is - * exhausted. - * - * @note Users should ensure that DONE flag is cleared before calling this interface, or the configuration is invalid. - * @param tcd Point to the TCD structure. - * @param type Channel link type, it can be one of: - * @arg kEDMA_LinkNone - * @arg kEDMA_MinorLink - * @arg kEDMA_MajorLink - * @param linkedChannel The linked channel number. - */ -void EDMA_TcdSetChannelLink(edma_tcd_t *tcd, edma_channel_link_type_t type, uint32_t linkedChannel); - -#if defined FSL_FEATURE_EDMA_HAS_BANDWIDTH && FSL_FEATURE_EDMA_HAS_BANDWIDTH -/*! - * @brief Sets the bandwidth for the eDMA TCD. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_TcdSetBandWidthExt - * - * Because the eDMA processes the minor loop, it continuously generates read/write sequences - * until the minor count is exhausted. The bandwidth forces the eDMA to stall after the completion of - * each read/write access to control the bus request bandwidth seen by the crossbar switch. - * @param tcd A pointer to the TCD structure. - * @param bandWidth A bandwidth setting, which can be one of the following: - * @arg kEDMABandwidthStallNone - * @arg kEDMABandwidthStall4Cycle - * @arg kEDMABandwidthStall8Cycle - */ -static inline void EDMA_TcdSetBandWidth(edma_tcd_t *tcd, edma_bandwidth_t bandWidth) -{ - assert(tcd != NULL); - - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) = - (uint16_t)((EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) & (~DMA_CSR_BWC_MASK)) | DMA_CSR_BWC(bandWidth)); -} -#endif - -/*! - * @brief Sets the source modulo and the destination modulo for the eDMA TCD. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_TcdSetModuloExt - * - * This function defines a specific address range specified to be the value after (SADDR + SOFF)/(DADDR + DOFF) - * calculation is performed or the original register value. It provides the ability to implement a circular data - * queue easily. - * - * @param tcd A pointer to the TCD structure. - * @param srcModulo A source modulo value. - * @param destModulo A destination modulo value. - */ -void EDMA_TcdSetModulo(edma_tcd_t *tcd, edma_modulo_t srcModulo, edma_modulo_t destModulo); - -/*! - * @brief Sets the auto stop request for the eDMA TCD. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_TcdEnableAutoStopRequestExt - * - * If enabling the auto stop request, the eDMA hardware automatically disables the hardware channel request. - * - * @param tcd A pointer to the TCD structure. - * @param enable The command to enable (true) or disable (false). - */ -static inline void EDMA_TcdEnableAutoStopRequest(edma_tcd_t *tcd, bool enable) -{ - assert(tcd != NULL); - - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) = (uint16_t)((EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) & (~DMA_CSR_DREQ_MASK)) | - DMA_CSR_DREQ((true == enable ? 1U : 0U))); -} - -/*! - * @brief Enables the interrupt source for the eDMA TCD. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_TcdEnableInterruptsExt - * - * @param tcd Point to the TCD structure. - * @param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_TcdEnableInterrupts(edma_tcd_t *tcd, uint32_t mask); - -/*! - * @brief Disables the interrupt source for the eDMA TCD. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_TcdDisableInterruptsExt - * - * @param tcd Point to the TCD structure. - * @param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_TcdDisableInterrupts(edma_tcd_t *tcd, uint32_t mask); - -/*! - * @brief Configures the eDMA TCD major offset feature. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_TcdSetMajorOffsetConfigExt - * - * Adjustment value added to the source address at the completion of the major iteration count - * - * @param tcd A point to the TCD structure. - * @param sourceOffset source address offset wiil be applied to source address after major loop done. - * @param destOffset destination address offset will be applied to source address after major loop done. - */ -void EDMA_TcdSetMajorOffsetConfig(edma_tcd_t *tcd, int32_t sourceOffset, int32_t destOffset); - -/*! - * @brief Sets TCD fields according to the user's channel transfer configuration structure, @ref - * edma_transfer_config_t. - * - * Application should be careful about the TCD pool buffer storage class, - * - For the platform has cache, the software TCD should be put in non cache section - * - The TCD pool buffer should have a consistent storage class. - * - * @param base eDMA peripheral base address. - * @param tcd Pointer to the TCD structure. - * @param transfer channel transfer configuration pointer. - * - * @note This function enables the auto stop request feature. - */ -void EDMA_ConfigChannelSoftwareTCDExt(EDMA_Type *base, edma_tcd_t *tcd, const edma_transfer_config_t *transfer); - -/*! - * @brief Sets all fields to default values for the TCD structure. - * - * This function sets all fields for this TCD structure to default value. - * - * @param base eDMA peripheral base address. - * @param tcd Pointer to the TCD structure. - * @note This function enables the auto stop request feature. - */ -void EDMA_TcdResetExt(EDMA_Type *base, edma_tcd_t *tcd); - -/*! - * @brief Configures the eDMA TCD transfer attribute. - * - * The TCD is a transfer control descriptor. The content of the TCD is the same as the hardware TCD registers. - * The TCD is used in the scatter-gather mode. - * This function configures the TCD transfer attribute, including source address, destination address, - * transfer size, address offset, and so on. It also configures the scatter gather feature if the - * user supplies the next TCD address. - * Example: - * @code - * edma_transfer_t config = { - * ... - * } - * edma_tcd_t tcd __aligned(32); - * edma_tcd_t nextTcd __aligned(32); - * EDMA_TcdSetTransferConfig(&tcd, &config, &nextTcd); - * @endcode - * - * @param base eDMA peripheral base address. - * @param tcd Pointer to the TCD structure. - * @param config Pointer to eDMA transfer configuration structure. - * @param nextTcd Pointer to the next TCD structure. It can be NULL if users - * do not want to enable scatter/gather feature. - * @note TCD address should be 32 bytes aligned or it causes an eDMA error. - * @note If the nextTcd is not NULL, the scatter gather feature is enabled - * and DREQ bit is cleared in the previous transfer configuration, which - * is set in the EDMA_TcdReset. - */ -void EDMA_TcdSetTransferConfigExt(EDMA_Type *base, - edma_tcd_t *tcd, - const edma_transfer_config_t *config, - edma_tcd_t *nextTcd); - -/*! - * @brief Configures the eDMA TCD minor offset feature. - * - * A minor offset is a signed-extended value added to the source address or a destination - * address after each minor loop. - * - * @param base eDMA peripheral base address. - * @param tcd A point to the TCD structure. - * @param config A pointer to the minor offset configuration structure. - */ -void EDMA_TcdSetMinorOffsetConfigExt(EDMA_Type *base, edma_tcd_t *tcd, const edma_minor_offset_config_t *config); - -/*! - * @brief Sets the channel link for the eDMA TCD. - * - * This function configures either a minor link or a major link. The minor link means the channel link is - * triggered every time CITER decreases by 1. The major link means that the channel link is triggered when the CITER is - * exhausted. - * - * @note Users should ensure that DONE flag is cleared before calling this interface, or the configuration is invalid. - * @param base eDMA peripheral base address. - * @param tcd Point to the TCD structure. - * @param type Channel link type, it can be one of: - * @arg kEDMA_LinkNone - * @arg kEDMA_MinorLink - * @arg kEDMA_MajorLink - * @param linkedChannel The linked channel number. - */ -void EDMA_TcdSetChannelLinkExt(EDMA_Type *base, edma_tcd_t *tcd, edma_channel_link_type_t type, uint32_t linkedChannel); - -#if defined FSL_FEATURE_EDMA_HAS_BANDWIDTH && FSL_FEATURE_EDMA_HAS_BANDWIDTH -/*! - * @brief Sets the bandwidth for the eDMA TCD. - * - * Because the eDMA processes the minor loop, it continuously generates read/write sequences - * until the minor count is exhausted. The bandwidth forces the eDMA to stall after the completion of - * each read/write access to control the bus request bandwidth seen by the crossbar switch. - * @param base eDMA peripheral base address. - * @param tcd A pointer to the TCD structure. - * @param bandWidth A bandwidth setting, which can be one of the following: - * @arg kEDMABandwidthStallNone - * @arg kEDMABandwidthStall4Cycle - * @arg kEDMABandwidthStall8Cycle - */ -static inline void EDMA_TcdSetBandWidthExt(EDMA_Type *base, edma_tcd_t *tcd, edma_bandwidth_t bandWidth) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) = - (uint16_t)((EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) & (~DMA_CSR_BWC_MASK)) | DMA_CSR_BWC(bandWidth)); -} -#endif - -/*! - * @brief Sets the source modulo and the destination modulo for the eDMA TCD. - * - * This function defines a specific address range specified to be the value after (SADDR + SOFF)/(DADDR + DOFF) - * calculation is performed or the original register value. It provides the ability to implement a circular data - * queue easily. - * - * @param base eDMA peripheral base address. - * @param tcd A pointer to the TCD structure. - * @param srcModulo A source modulo value. - * @param destModulo A destination modulo value. - */ -void EDMA_TcdSetModuloExt(EDMA_Type *base, edma_tcd_t *tcd, edma_modulo_t srcModulo, edma_modulo_t destModulo); - -/*! - * @brief Sets the auto stop request for the eDMA TCD. - * - * If enabling the auto stop request, the eDMA hardware automatically disables the hardware channel request. - * - * @param base eDMA peripheral base address. - * @param tcd A pointer to the TCD structure. - * @param enable The command to enable (true) or disable (false). - */ -static inline void EDMA_TcdEnableAutoStopRequestExt(EDMA_Type *base, edma_tcd_t *tcd, bool enable) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) = (uint16_t)((EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) & (~DMA_CSR_DREQ_MASK)) | - DMA_CSR_DREQ((true == enable ? 1U : 0U))); -} - -/*! - * @brief Enables the interrupt source for the eDMA TCD. - * - * @param base eDMA peripheral base address. - * @param tcd Point to the TCD structure. - * @param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_TcdEnableInterruptsExt(EDMA_Type *base, edma_tcd_t *tcd, uint32_t mask); - -/*! - * @brief Disables the interrupt source for the eDMA TCD. - * - * @param base eDMA peripheral base address. - * @param tcd Point to the TCD structure. - * @param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_TcdDisableInterruptsExt(EDMA_Type *base, edma_tcd_t *tcd, uint32_t mask); - -/*! - * @brief Configures the eDMA TCD major offset feature. - * - * Adjustment value added to the source address at the completion of the major iteration count - * - * @param base eDMA peripheral base address. - * @param tcd A point to the TCD structure. - * @param sourceOffset source address offset wiil be applied to source address after major loop done. - * @param destOffset destination address offset will be applied to source address after major loop done. - */ -void EDMA_TcdSetMajorOffsetConfigExt(EDMA_Type *base, edma_tcd_t *tcd, int32_t sourceOffset, int32_t destOffset); - -/*! @} */ -/*! - * @name eDMA Channel Transfer Operation - * @{ - */ - -/*! - * @brief Enables the eDMA hardware channel request. - * - * This function enables the hardware channel request. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - */ -static inline void EDMA_EnableChannelRequest(EDMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - EDMA_BASE(base)->SERQ = DMA_SERQ_SERQ(channel); -#else - EDMA_CHANNEL_BASE(base, channel)->CH_CSR |= DMA_CH_CSR_ERQ_MASK; -#endif -} - -/*! - * @brief Disables the eDMA hardware channel request. - * - * This function disables the hardware channel request. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - */ -static inline void EDMA_DisableChannelRequest(EDMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - EDMA_BASE(base)->CERQ = DMA_CERQ_CERQ(channel); -#else - EDMA_CHANNEL_BASE(base, channel)->CH_CSR &= ~DMA_CH_CSR_ERQ_MASK; -#endif -} - -/*! - * @brief Starts the eDMA transfer by using the software trigger. - * - * This function starts a minor loop transfer. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - */ -static inline void EDMA_TriggerChannelStart(EDMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - EDMA_BASE(base)->SSRT = DMA_SSRT_SSRT(channel); -#else - EDMA_TCD_CSR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) |= DMA_CSR_START_MASK; -#endif -} - -/*! @} */ -/*! - * @name eDMA Channel Status Operation - * @{ - */ - -/*! - * @brief Gets the remaining major loop count from the eDMA current channel TCD. - * - * This function checks the TCD (Task Control Descriptor) status for a specified - * eDMA channel and returns the number of major loop count that has not finished. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @return Major loop count which has not been transferred yet for the current TCD. - * @note 1. This function can only be used to get unfinished major loop count of transfer without - * the next TCD, or it might be inaccuracy. - * 2. The unfinished/remaining transfer bytes cannot be obtained directly from registers while - * the channel is running. - * Because to calculate the remaining bytes, the initial NBYTES configured in DMA_TCDn_NBYTES_MLNO - * register is needed while the eDMA IP does not support getting it while a channel is active. - * In another word, the NBYTES value reading is always the actual (decrementing) NBYTES value the dma_engine - * is working with while a channel is running. - * Consequently, to get the remaining transfer bytes, a software-saved initial value of NBYTES (for example - * copied before enabling the channel) is needed. The formula to calculate it is shown below: - * RemainingBytes = RemainingMajorLoopCount * NBYTES(initially configured) - */ -uint32_t EDMA_GetRemainingMajorLoopCount(EDMA_Type *base, uint32_t channel); - -/*! - * @brief Gets the eDMA channel error status flags. - * - * @param base eDMA peripheral base address. - * @return The mask of error status flags. Users need to use the - * _edma_error_status_flags type to decode the return variables. - */ -static inline uint32_t EDMA_GetErrorStatusFlags(EDMA_Type *base) -{ -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - return EDMA_BASE(base)->ES; -#else - return EDMA_MP_BASE(base)->MP_ES; -#endif -} - -/*! - * @brief Gets the eDMA channel status flags. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @return The mask of channel status flags. Users need to use the - * _edma_channel_status_flags type to decode the return variables. - */ -uint32_t EDMA_GetChannelStatusFlags(EDMA_Type *base, uint32_t channel); - -/*! - * @brief Clears the eDMA channel status flags. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param mask The mask of channel status to be cleared. Users need to use - * the defined _edma_channel_status_flags type. - */ -void EDMA_ClearChannelStatusFlags(EDMA_Type *base, uint32_t channel, uint32_t mask); - -/*! @} */ -/*! - * @name eDMA Transactional Operation - */ - -/*! - * @brief Creates the eDMA handle. - * - * This function is called if using the transactional API for eDMA. This function - * initializes the internal state of the eDMA handle. - * - * @param handle eDMA handle pointer. The eDMA handle stores callback function and - * parameters. - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - */ -void EDMA_CreateHandle(edma_handle_t *handle, EDMA_Type *base, uint32_t channel); - -/*! - * @brief Installs the TCDs memory pool into the eDMA handle. - * - * This function is called after the EDMA_CreateHandle to use scatter/gather feature. This function shall only be used - * while users need to use scatter gather mode. Scatter gather mode enables EDMA to load a new transfer control block - * (tcd) in hardware, and automatically reconfigure that DMA channel for a new transfer. - * Users need to prepare tcd memory and also configure tcds using interface EDMA_SubmitTransfer. - * - * @param handle eDMA handle pointer. - * @param tcdPool A memory pool to store TCDs. It must be 32 bytes aligned. - * @param tcdSize The number of TCD slots. - */ -void EDMA_InstallTCDMemory(edma_handle_t *handle, edma_tcd_t *tcdPool, uint32_t tcdSize); - -/*! - * @brief Installs a callback function for the eDMA transfer. - * - * This callback is called in the eDMA IRQ handler. Use the callback to do something after - * the current major loop transfer completes. This function will be called every time one tcd finished transfer. - * - * @param handle eDMA handle pointer. - * @param callback eDMA callback function pointer. - * @param userData A parameter for the callback function. - */ -void EDMA_SetCallback(edma_handle_t *handle, edma_callback callback, void *userData); - -/*! - * @brief Prepares the eDMA transfer structure configurations. - * - * This function prepares the transfer configuration structure according to the user input. - * - * @param config The user configuration structure of type edma_transfer_t. - * @param srcAddr eDMA transfer source address. - * @param srcWidth eDMA transfer source address width(bytes). - * @param srcOffset source address offset. - * @param destAddr eDMA transfer destination address. - * @param destWidth eDMA transfer destination address width(bytes). - * @param destOffset destination address offset. - * @param bytesEachRequest eDMA transfer bytes per channel request. - * @param transferBytes eDMA transfer bytes to be transferred. - * @note The data address and the data width must be consistent. For example, if the SRC - * is 4 bytes, the source address must be 4 bytes aligned, or it results in - * source address error (SAE). - * User can check if 128 bytes support is available for specific instance by - * FSL_FEATURE_EDMA_INSTANCE_SUPPORT_128_BYTES_TRANSFERn. - */ -void EDMA_PrepareTransferConfig(edma_transfer_config_t *config, - void *srcAddr, - uint32_t srcWidth, - int16_t srcOffset, - void *destAddr, - uint32_t destWidth, - int16_t destOffset, - uint32_t bytesEachRequest, - uint32_t transferBytes); - -/*! - * @brief Prepares the eDMA transfer structure. - * - * This function prepares the transfer configuration structure according to the user input. - * - * @param config The user configuration structure of type edma_transfer_t. - * @param srcAddr eDMA transfer source address. - * @param srcWidth eDMA transfer source address width(bytes). - * @param destAddr eDMA transfer destination address. - * @param destWidth eDMA transfer destination address width(bytes). - * @param bytesEachRequest eDMA transfer bytes per channel request. - * @param transferBytes eDMA transfer bytes to be transferred. - * @param type eDMA transfer type. - * @note The data address and the data width must be consistent. For example, if the SRC - * is 4 bytes, the source address must be 4 bytes aligned, or it results in - * source address error (SAE). - */ -void EDMA_PrepareTransfer(edma_transfer_config_t *config, - void *srcAddr, - uint32_t srcWidth, - void *destAddr, - uint32_t destWidth, - uint32_t bytesEachRequest, - uint32_t transferBytes, - edma_transfer_type_t type); - -/*! - * @brief Prepares the eDMA transfer content descriptor. - * - * This function prepares the transfer content descriptor structure according to the user input. - * - * @param handle eDMA handle pointer. - * @param tcd Pointer to eDMA transfer content descriptor structure. - * @param srcAddr eDMA transfer source address. - * @param srcWidth eDMA transfer source address width(bytes). - * @param srcOffset source address offset. - * @param destAddr eDMA transfer destination address. - * @param destWidth eDMA transfer destination address width(bytes). - * @param destOffset destination address offset. - * @param bytesEachRequest eDMA transfer bytes per channel request. - * @param transferBytes eDMA transfer bytes to be transferred. - * @param nextTcd eDMA transfer linked TCD address. - * - * @note The data address and the data width must be consistent. For example, if the SRC - * is 4 bytes, the source address must be 4 bytes aligned, or it results in - * source address error (SAE). - */ -void EDMA_PrepareTransferTCD(edma_handle_t *handle, - edma_tcd_t *tcd, - void *srcAddr, - uint32_t srcWidth, - int16_t srcOffset, - void *destAddr, - uint32_t destWidth, - int16_t destOffset, - uint32_t bytesEachRequest, - uint32_t transferBytes, - edma_tcd_t *nextTcd); - -/*! - * @brief Submits the eDMA transfer content descriptor. - * - * This function submits the eDMA transfer request according to the transfer content descriptor. - * In scatter gather mode, call this function will add a configured tcd to the circular list of tcd pool. - * The tcd pools is setup by call function EDMA_InstallTCDMemory before. - * - * Typical user case: - * 1. submit single transfer - * @code - * edma_tcd_t tcd; - * EDMA_PrepareTransferTCD(handle, tcd, ....) - * EDMA_SubmitTransferTCD(handle, tcd) - * EDMA_StartTransfer(handle) - * @endcode - * - * 2. submit static link transfer, - * @code - * edma_tcd_t tcd[2]; - * EDMA_PrepareTransferTCD(handle, &tcd[0], ....) - * EDMA_PrepareTransferTCD(handle, &tcd[1], ....) - * EDMA_SubmitTransferTCD(handle, &tcd[0]) - * EDMA_StartTransfer(handle) - * @endcode - * - * 3. submit dynamic link transfer - * @code - * edma_tcd_t tcdpool[2]; - * EDMA_InstallTCDMemory(&g_DMA_Handle, tcdpool, 2); - * edma_tcd_t tcd; - * EDMA_PrepareTransferTCD(handle, tcd, ....) - * EDMA_SubmitTransferTCD(handle, tcd) - * EDMA_PrepareTransferTCD(handle, tcd, ....) - * EDMA_SubmitTransferTCD(handle, tcd) - * EDMA_StartTransfer(handle) - * @endcode - * - * 4. submit loop transfer - * @code - * edma_tcd_t tcd[2]; - * EDMA_PrepareTransferTCD(handle, &tcd[0], ...,&tcd[1]) - * EDMA_PrepareTransferTCD(handle, &tcd[1], ..., &tcd[0]) - * EDMA_SubmitTransferTCD(handle, &tcd[0]) - * EDMA_StartTransfer(handle) - * @endcode - * - * @param handle eDMA handle pointer. - * @param tcd Pointer to eDMA transfer content descriptor structure. - * - * @retval kStatus_EDMA_Success It means submit transfer request succeed. - * @retval kStatus_EDMA_QueueFull It means TCD queue is full. Submit transfer request is not allowed. - * @retval kStatus_EDMA_Busy It means the given channel is busy, need to submit request later. - */ -status_t EDMA_SubmitTransferTCD(edma_handle_t *handle, edma_tcd_t *tcd); - -/*! - * @brief Submits the eDMA transfer request. - * - * This function submits the eDMA transfer request according to the transfer configuration structure. - * In scatter gather mode, call this function will add a configured tcd to the circular list of tcd pool. - * The tcd pools is setup by call function EDMA_InstallTCDMemory before. - * - * @param handle eDMA handle pointer. - * @param config Pointer to eDMA transfer configuration structure. - * @retval kStatus_EDMA_Success It means submit transfer request succeed. - * @retval kStatus_EDMA_QueueFull It means TCD queue is full. Submit transfer request is not allowed. - * @retval kStatus_EDMA_Busy It means the given channel is busy, need to submit request later. - */ -status_t EDMA_SubmitTransfer(edma_handle_t *handle, const edma_transfer_config_t *config); - -/*! - * @brief Submits the eDMA scatter gather transfer configurations. - * - * The function is target for submit loop transfer request, - * the ring transfer request means that the transfer request TAIL is link to HEAD, such as, - * A->B->C->D->A, or A->A - * - * To use the ring transfer feature, the application should allocate several transfer object, such as - * @code - * edma_channel_transfer_config_t transfer[2]; - * EDMA_TransferSubmitLoopTransfer(psHandle, &transfer, 2U); - * @endcode - * Then eDMA driver will link transfer[0] and transfer[1] to each other - * - * @note Application should check the return value of this function to avoid transfer request - * submit failed - * - * @param handle eDMA handle pointer - * @param transfer pointer to user's eDMA channel configure structure, see edma_channel_transfer_config_t for detail - * @param transferLoopCount the count of the transfer ring, if loop count is 1, that means that the one will link to - * itself. - * - * @retval #kStatus_Success It means submit transfer request succeed - * @retval #kStatus_EDMA_Busy channel is in busy status - * @retval #kStatus_InvalidArgument Invalid Argument - */ -status_t EDMA_SubmitLoopTransfer(edma_handle_t *handle, edma_transfer_config_t *transfer, uint32_t transferLoopCount); - -/*! - * @brief eDMA starts transfer. - * - * This function enables the channel request. Users can call this function after submitting the transfer request - * or before submitting the transfer request. - * - * @param handle eDMA handle pointer. - */ -void EDMA_StartTransfer(edma_handle_t *handle); - -/*! - * @brief eDMA stops transfer. - * - * This function disables the channel request to pause the transfer. Users can call EDMA_StartTransfer() - * again to resume the transfer. - * - * @param handle eDMA handle pointer. - */ -void EDMA_StopTransfer(edma_handle_t *handle); - -/*! - * @brief eDMA aborts transfer. - * - * This function disables the channel request and clear transfer status bits. - * Users can submit another transfer after calling this API. - * - * @param handle DMA handle pointer. - */ -void EDMA_AbortTransfer(edma_handle_t *handle); - -/*! - * @brief Get unused TCD slot number. - * - * This function gets current tcd index which is run. If the TCD pool pointer is NULL, it will return 0. - * - * @param handle DMA handle pointer. - * @return The unused tcd slot number. - */ -static inline uint32_t EDMA_GetUnusedTCDNumber(edma_handle_t *handle) -{ - int8_t tmpTcdSize = handle->tcdSize; - int8_t tmpTcdUsed = handle->tcdUsed; - return ((uint32_t)tmpTcdSize - (uint32_t)tmpTcdUsed); -} - -/*! - * @brief Get the next tcd address. - * - * This function gets the next tcd address. If this is last TCD, return 0. - * - * @param handle DMA handle pointer. - * @return The next TCD address. - */ -static inline uint32_t EDMA_GetNextTCDAddress(edma_handle_t *handle) -{ - return (uint32_t)(EDMA_TCD_DLAST_SGA(handle->tcdBase, EDMA_TCD_TYPE(handle->base))); -} - -/*! - * @brief eDMA IRQ handler for the current major loop transfer completion. - * - * This function clears the channel major interrupt flag and calls - * the callback function if it is not NULL. - * - * Note: - * For the case using TCD queue, when the major iteration count is exhausted, additional operations are performed. - * These include the final address adjustments and reloading of the BITER field into the CITER. - * Assertion of an optional interrupt request also occurs at this time, as does a possible fetch of a new TCD from - * memory using the scatter/gather address pointer included in the descriptor (if scatter/gather is enabled). - * - * For instance, when the time interrupt of TCD[0] happens, the TCD[1] has already been loaded into the eDMA engine. - * As sga and sga_index are calculated based on the DLAST_SGA bitfield lies in the TCD_CSR register, the sga_index - * in this case should be 2 (DLAST_SGA of TCD[1] stores the address of TCD[2]). Thus, the "tcdUsed" updated should be - * (tcdUsed - 2U) which indicates the number of TCDs can be loaded in the memory pool (because TCD[0] and TCD[1] have - * been loaded into the eDMA engine at this point already.). - * - * For the last two continuous ISRs in a scatter/gather process, they both load the last TCD (The last ISR does not - * load a new TCD) from the memory pool to the eDMA engine when major loop completes. - * Therefore, ensure that the header and tcdUsed updated are identical for them. - * tcdUsed are both 0 in this case as no TCD to be loaded. - * - * See the "eDMA basic data flow" in the eDMA Functional description section of the Reference Manual for - * further details. - * - * @param handle eDMA handle pointer. - */ -void EDMA_HandleIRQ(edma_handle_t *handle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @} */ - -#endif /*FSL_EDMA_H_*/ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_edma_core.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_edma_core.h deleted file mode 100644 index 482f4e19883..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_edma_core.h +++ /dev/null @@ -1,357 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_EDMA_CORE_H_ -#define FSL_EDMA_CORE_H_ - -#include "fsl_edma_soc.h" - -/*! - * @addtogroup edma_core - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -#define DMA_CSR_INTMAJOR_MASK (0x2U) -#define DMA_CSR_INTHALF_MASK (0x4U) -#define DMA_CSR_DREQ_MASK (0x8U) -#define DMA_CSR_ESG_MASK (0x10U) -#define DMA_CSR_BWC_MASK (0xC000U) -#define DMA_CSR_BWC(x) (((uint16_t)(((uint16_t)(x)) << (14U))) & (0xC000U)) -#define DMA_CSR_START_MASK (0x1U) -#define DMA_CITER_ELINKNO_CITER_MASK (0x7FFFU) -#define DMA_BITER_ELINKNO_BITER_MASK (0x7FFFU) -#define DMA_CITER_ELINKNO_CITER_SHIFT (0U) -#define DMA_CITER_ELINKYES_CITER_MASK (0x1FFU) -#define DMA_CITER_ELINKYES_CITER_SHIFT (0U) -#define DMA_ATTR_SMOD_MASK (0xF800U) -#define DMA_ATTR_DMOD_MASK (0xF8U) -#define DMA_CITER_ELINKNO_ELINK_MASK (0x8000U) -#define DMA_CSR_MAJORELINK_MASK (0x20U) -#define DMA_BITER_ELINKYES_ELINK_MASK (0x8000U) -#define DMA_CITER_ELINKYES_ELINK_MASK (0x8000U) -#define DMA_CSR_MAJORLINKCH_MASK (0x1F00U) -#define DMA_BITER_ELINKYES_LINKCH_MASK (0x3E00U) -#define DMA_CITER_ELINKYES_LINKCH_MASK (0x3E00U) -#define DMA_NBYTES_MLOFFYES_MLOFF_MASK (0x3FFFFC00U) -#define DMA_NBYTES_MLOFFYES_DMLOE_MASK (0x40000000U) -#define DMA_NBYTES_MLOFFYES_SMLOE_MASK (0x80000000U) -#define DMA_NBYTES_MLOFFNO_NBYTES_MASK (0x3FFFFFFFU) -#define DMA_ATTR_DMOD(x) (((uint16_t)(((uint16_t)(x)) << (3U))) & (0xF8U)) -#define DMA_ATTR_SMOD(x) (((uint16_t)(((uint16_t)(x)) << (11U))) & (0xF800U)) -#define DMA_BITER_ELINKYES_LINKCH(x) (((uint16_t)(((uint16_t)(x)) << (9U))) & (0x3E00U)) -#define DMA_CITER_ELINKYES_LINKCH(x) (((uint16_t)(((uint16_t)(x)) << (9U))) & (0x3E00U)) -#define DMA_NBYTES_MLOFFYES_MLOFF(x) (((uint32_t)(((uint32_t)(x)) << (10U))) & (0x3FFFFC00U)) -#define DMA_NBYTES_MLOFFYES_DMLOE(x) (((uint32_t)(((uint32_t)(x)) << (30U))) & (0x40000000U)) -#define DMA_NBYTES_MLOFFYES_SMLOE(x) (((uint32_t)(((uint32_t)(x)) << (31U))) & (0x80000000U)) -#define DMA_NBYTES_MLOFFNO_NBYTES(x) (((uint32_t)(((uint32_t)(x)) << (0U))) & (0x3FFFFFFFU)) -#define DMA_NBYTES_MLOFFYES_NBYTES(x) (((uint32_t)(((uint32_t)(x)) << (0U))) & (0x3FFU)) -#define DMA_ATTR_DSIZE(x) (((uint16_t)(((uint16_t)(x)) << (0U))) & (0x7U)) -#define DMA_ATTR_SSIZE(x) (((uint16_t)(((uint16_t)(x)) << (8U))) & (0x700U)) -#define DMA_CSR_DREQ(x) (((uint16_t)(((uint16_t)(x)) << (3U))) & (0x8U)) -#define DMA_CSR_MAJORLINKCH(x) (((uint16_t)(((uint16_t)(x)) << (8U))) & (0x1F00U)) -#define DMA_CH_MATTR_WCACHE(x) (((uint16_t)(((uint16_t)(x)) << (4U))) & (0xF0U)) -#define DMA_CH_MATTR_RCACHE(x) (((uint16_t)(((uint16_t)(x)) << (0U))) & (0xFU)) -#define DMA_CH_CSR_SIGNEXT_MASK (0x3F0000U) -#define DMA_CH_CSR_SIGNEXT_SHIFT (16U) -#define DMA_CH_CSR_SWAP_MASK (0xF000U) -#define DMA_CH_CSR_SWAP_SHIFT (12U) -#define DMA_CH_SBR_INSTR_MASK (0x2000U) -#define DMA_CH_SBR_INSTR_SHIFT (13U) -#define DMA_CH_MUX_SOURCE(x) (((uint32_t)(((uint32_t)(x)) << (0U))) & (0xFFU)) - -/*! @brief DMA error flag */ -#if defined(FSL_EDMA_SOC_IP_EDMA) && FSL_EDMA_SOC_IP_EDMA -#define DMA_ERR_DBE_FLAG DMA_ES_DBE_MASK -#define DMA_ERR_SBE_FLAG DMA_ES_SBE_MASK -#define DMA_ERR_SGE_FLAG DMA_ES_SGE_MASK -#define DMA_ERR_NCE_FLAG DMA_ES_NCE_MASK -#define DMA_ERR_DOE_FLAG DMA_ES_DOE_MASK -#define DMA_ERR_DAE_FLAG DMA_ES_DAE_MASK -#define DMA_ERR_SOE_FLAG DMA_ES_SOE_MASK -#define DMA_ERR_SAE_FLAG DMA_ES_SAE_MASK -#define DMA_ERR_ERRCHAN_FLAG DMA_ES_ERRCHN_MASK -#define DMA_ERR_CPE_FLAG DMA_ES_CPE_MASK -#define DMA_ERR_ECX_FLAG DMA_ES_ECX_MASK -#if defined(FSL_FEATURE_EDMA_CHANNEL_GROUP_COUNT) && (FSL_FEATURE_EDMA_CHANNEL_GROUP_COUNT > 1) -#define DMA_ERR_GPE_FLAG DMA_ES_GPE_MASK -#endif -#define DMA_ERR_FLAG DMA_ES_VLD_MASK - -/*! @brief get/clear DONE status*/ -#define DMA_CLEAR_DONE_STATUS(base, channel) (EDMA_BASE(base)->CDNE = (uint8_t)channel) -#define DMA_GET_DONE_STATUS(base, channel) \ - ((EDMA_TCD_BASE(base, channel)->CSR & DMA_CSR_DONE_MASK) >> DMA_CSR_DONE_SHIFT) -/*! @brief enable/disable error interrupt*/ -#define DMA_ENABLE_ERROR_INT(base, channel) (base->EEI |= ((uint32_t)0x1U << channel)) -#define DMA_DISABLE_ERROR_INT(base, channel) (base->EEI &= (~((uint32_t)0x1U << channel))) -/*! @brief get/clear error status*/ -#define DMA_GET_ERROR_STATUS(base, channel) (((uint32_t)EDMA_BASE(base)->ERR >> channel) & 0x1U) -#define DMA_CLEAR_ERROR_STATUS(base, channel) ((uint32_t)EDMA_BASE(base)->CERR = (uint8_t)channel) -/*! @brief get/clear int status*/ -#define DMA_GET_INT_STATUS(base, channel) ((((uint32_t)EDMA_BASE(base)->INT >> channel) & 0x1U)) -#define DMA_CLEAR_INT_STATUS(base, channel) ((uint32_t)EDMA_BASE(base)->CINT = (uint8_t)channel) - -#else - -#define DMA_ERR_DBE_FLAG DMA_MP_ES_DBE_MASK -#define DMA_ERR_SBE_FLAG DMA_MP_ES_SBE_MASK -#define DMA_ERR_SGE_FLAG DMA_MP_ES_SGE_MASK -#define DMA_ERR_NCE_FLAG DMA_MP_ES_NCE_MASK -#define DMA_ERR_DOE_FLAG DMA_MP_ES_DOE_MASK -#define DMA_ERR_DAE_FLAG DMA_MP_ES_DAE_MASK -#define DMA_ERR_SOE_FLAG DMA_MP_ES_SOE_MASK -#define DMA_ERR_SAE_FLAG DMA_MP_ES_SAE_MASK -#define DMA_ERR_ERRCHAN_FLAG DMA_MP_ES_ERRCHN_MASK -#define DMA_ERR_ECX_FLAG DMA_MP_ES_ECX_MASK -#define DMA_ERR_FLAG DMA_MP_ES_VLD_MASK - -/*! @brief get/clear DONE bit*/ -#define DMA_CLEAR_DONE_STATUS(base, channel) (EDMA_CHANNEL_BASE(base, channel)->CH_CSR |= DMA_CH_CSR_DONE_MASK) -#define DMA_GET_DONE_STATUS(base, channel) \ - ((EDMA_CHANNEL_BASE(base, channel)->CH_CSR & DMA_CH_CSR_DONE_MASK) >> DMA_CH_CSR_DONE_SHIFT) -/*! @brief enable/disable error interupt*/ -#define DMA_ENABLE_ERROR_INT(base, channel) (EDMA_CHANNEL_BASE(base, channel)->CH_CSR |= DMA_CH_CSR_EEI_MASK) -#define DMA_DISABLE_ERROR_INT(base, channel) (EDMA_CHANNEL_BASE(base, channel)->CH_CSR &= ~DMA_CH_CSR_EEI_MASK) -/*! @brief get/clear error status*/ -#define DMA_CLEAR_ERROR_STATUS(base, channel) (EDMA_CHANNEL_BASE(base, channel)->CH_ES |= DMA_CH_ES_ERR_MASK) -#define DMA_GET_ERROR_STATUS(base, channel) \ - (((uint32_t)EDMA_CHANNEL_BASE(base, channel)->CH_ES >> DMA_CH_ES_ERR_SHIFT) & 0x1U) -/*! @brief get/clear INT status*/ -#define DMA_CLEAR_INT_STATUS(base, channel) (EDMA_CHANNEL_BASE(base, channel)->CH_INT = DMA_CH_INT_INT_MASK) -#define DMA_GET_INT_STATUS(base, channel) ((((uint32_t)EDMA_CHANNEL_BASE(base, channel)->CH_INT) & 0x1U)) -#endif /*FSL_EDMA_SOC_IP_EDMA*/ - -/*! @brief enable/dsiable MAJOR/HALF INT*/ -#define DMA_ENABLE_MAJOR_INT(base, channel) \ - (EDMA_TCD_CSR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) |= DMA_CSR_INTMAJOR_MASK) -#define DMA_ENABLE_HALF_INT(base, channel) \ - (EDMA_TCD_CSR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) |= DMA_CSR_INTHALF_MASK) -#define DMA_DISABLE_MAJOR_INT(base, channel) \ - (EDMA_TCD_CSR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_CSR_INTMAJOR_MASK) -#define DMA_DISABLE_HALF_INT(base, channel) \ - (EDMA_TCD_CSR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_CSR_INTHALF_MASK) - -/*!@brief EDMA tcd align size */ -#define EDMA_TCD_ALIGN_SIZE (32U) - -/*!@brief edma core channel struture definition */ -typedef struct _edma_core_mp -{ - __IO uint32_t MP_CSR; /**< Channel Control and Status, array offset: 0x10000, array step: 0x10000 */ - __IO uint32_t MP_ES; /**< Channel Error Status, array offset: 0x10004, array step: 0x10000 */ - union - { - struct - { - __IO uint32_t MP_INT_LOW; /**< Channel Control and Status, array offset: 0x10008, array step: 0x10000 */ - __I uint32_t MP_INT_HIGH; /**< Channel Control and Status, array offset: 0x1000C, array step: 0x10000 */ - __I uint32_t MP_HRS_LOW; /**< Channel Control and Status, array offset: 0x10010, array step: 0x10000 */ - __I uint32_t MP_HRS_HIGH; /**< Channel Control and Status, array offset: 0x10014, array step: 0x10000 */ - uint8_t RESERVED_0[8]; - __IO uint32_t MP_STOPCH; /**< Channel Control and Status, array offset: 0x10020, array step: 0x10000 */ - uint8_t RESERVED_1[12]; - __I uint32_t MP_SSR_LOW; /**< Channel Control and Status, array offset: 0x10030, array step: 0x10000 */ - __I uint32_t MP_SSR_HIGH; /**< Channel Control and Status, array offset: 0x10034, array step: 0x10000 */ - uint8_t RESERVED_2[200]; - __IO uint32_t CH_GRPRI[64]; /**< Channel Control and Status, array offset: 0x10100, array step: 0x10000 */ - __IO uint32_t CH_MUX[64]; /**< Channel Control and Status, array offset: 0x10200, array step: 0x10000 */ - uint8_t RESERVED_3[256]; - __IO uint32_t CH_PROT[64]; /**< Channel Control and Status, array offset: 0x10400, array step: 0x10000 */ - } EDMA5_REG; - } MP_REGS; -} edma_core_mp_t; - -/*!@brief edma core channel struture definition */ -typedef struct _edma_core_channel -{ - __IO uint32_t CH_CSR; /**< Channel Control and Status, array offset: 0x10000, array step: 0x10000 */ - __IO uint32_t CH_ES; /**< Channel Error Status, array offset: 0x10004, array step: 0x10000 */ - __IO uint32_t CH_INT; /**< Channel Interrupt Status, array offset: 0x10008, array step: 0x10000 */ - __IO uint32_t CH_SBR; /**< Channel System Bus, array offset: 0x1000C, array step: 0x10000 */ - __IO uint32_t CH_PRI; /**< Channel Priority, array offset: 0x10010, array step: 0x10000 */ - union - { - struct - { - __IO uint8_t RESERVED_1[4]; - __IO uint32_t CH_MATTR; /**< Memory Attributes Register, array offset: 0x10018, array step: 0x8000 */ - } EDMA5_REG; - struct - { - __IO uint32_t CH_MUX; /**< Channel Multiplexor Configuration, array offset: 0x10014, array step: 0x10000 */ - __IO uint16_t CH_MATTR; /**< Memory Attributes Register, array offset: 0x10018, array step: 0x8000 */ - } EDMA4_REG; - } CH_REGS; -} edma_core_channel_t; - -/*! @brief eDMA tcd flag type */ -typedef enum _edma_tcd_type -{ - kEDMA_EDMA4Flag = 0x0U, /*!< Data access for eDMA4 transfers. */ - kEDMA_EDMA5Flag = 0x1U, /*!< Instruction access for eDMA4 transfers. */ -} edma_tcd_type_t; - -/*!@brief edma5 core TCD struture definition */ -typedef struct _edma5_core_tcd -{ - __IO uint32_t SADDR; /*!< SADDR register, used to save source address */ - __IO uint32_t SADDR_HIGH; /*!< SADDR HIGH register, used to save source address */ - __IO uint16_t SOFF; /*!< SOFF register, save offset bytes every transfer */ - __IO uint16_t ATTR; /*!< ATTR register, source/destination transfer size and modulo */ - __IO uint32_t NBYTES; /*!< Nbytes register, minor loop length in bytes */ - __IO uint32_t SLAST; /*!< SLAST register */ - __IO uint32_t SLAST_SDA_HIGH; /*!< SLAST SDA HIGH register */ - __IO uint32_t DADDR; /*!< DADDR register, used for destination address */ - __IO uint32_t DADDR_HIGH; /*!< DADDR HIGH register, used for destination address */ - __IO uint32_t DLAST_SGA; /*!< DLASTSGA register, next tcd address used in scatter-gather mode */ - __IO uint32_t DLAST_SGA_HIGH; /*!< DLASTSGA HIGH register, next tcd address used in scatter-gather mode */ - __IO uint16_t DOFF; /*!< DOFF register, used for destination offset */ - __IO uint16_t CITER; /*!< CITER register, current minor loop numbers, for unfinished minor loop.*/ - __IO uint16_t CSR; /*!< CSR register, for TCD control status */ - __IO uint16_t BITER; /*!< BITER register, begin minor loop count. */ - uint8_t RESERVED[16]; /*!< Aligned 64 bytes */ -} edma5_core_tcd_t; - -/*!@brief edma4 core TCD struture definition */ -typedef struct _edma4_core_tcd -{ - __IO uint32_t SADDR; /*!< SADDR register, used to save source address */ - __IO uint16_t SOFF; /*!< SOFF register, save offset bytes every transfer */ - __IO uint16_t ATTR; /*!< ATTR register, source/destination transfer size and modulo */ - __IO uint32_t NBYTES; /*!< Nbytes register, minor loop length in bytes */ - __IO uint32_t SLAST; /*!< SLAST register */ - __IO uint32_t DADDR; /*!< DADDR register, used for destination address */ - __IO uint16_t DOFF; /*!< DOFF register, used for destination offset */ - __IO uint16_t CITER; /*!< CITER register, current minor loop numbers, for unfinished minor loop.*/ - __IO uint32_t DLAST_SGA; /*!< DLASTSGA register, next tcd address used in scatter-gather mode */ - __IO uint16_t CSR; /*!< CSR register, for TCD control status */ - __IO uint16_t BITER; /*!< BITER register, begin minor loop count. */ -} edma4_core_tcd_t; - -/*!@brief edma core TCD struture definition */ -typedef struct _edma_core_tcd -{ - union - { - edma4_core_tcd_t edma4_tcd; -#if defined FSL_EDMA_SOC_IP_DMA5 && FSL_EDMA_SOC_IP_DMA5 - edma5_core_tcd_t edma5_tcd; -#endif /* FSL_EDMA_SOC_IP_DMA5 */ - } TCD_REGS; -} edma_core_tcd_t; - -/*!@brief EDMA typedef */ -typedef edma_core_channel_t EDMA_ChannelType; -typedef edma_core_tcd_t EDMA_TCDType; -typedef void EDMA_Type; - -/*!@brief EDMA base address convert macro */ -#define EDMA_BASE(base) -#define EDMA_CHANNEL_BASE(base, channel) \ - ((edma_core_channel_t *)((uint32_t)(uint32_t *)(base) + EDMA_CHANNEL_OFFSET + \ - (channel)*EDMA_CHANNEL_ARRAY_STEP(base))) -#define EDMA_TCD_BASE(base, channel) \ - ((edma_core_tcd_t *)((uint32_t)(uint32_t *)(base) + EDMA_CHANNEL_OFFSET + \ - (channel)*EDMA_CHANNEL_ARRAY_STEP(base) + 0x20U)) -#define EDMA_MP_BASE(base) ((edma_core_mp_t *)((uint32_t)(uint32_t *)(base))) - -/*!@brief EDMA TCD type macro */ -#if defined FSL_FEATURE_EDMA_TCD_TYPEn -#define EDMA_TCD_TYPE(x) FSL_FEATURE_EDMA_TCD_TYPEn(x) -#else -#define EDMA_TCD_TYPE(x) (0) -#endif - -#if defined FSL_EDMA_SOC_IP_DMA5 && FSL_EDMA_SOC_IP_DMA5 -/*!@brief EDMA TCD address convert macro */ -#define EDMA_TCD_SADDR(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->SADDR)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->SADDR)))) - -#define EDMA_TCD_SOFF(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->SOFF)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->SOFF)))) - -#define EDMA_TCD_ATTR(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->ATTR)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->ATTR)))) - -#define EDMA_TCD_NBYTES(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->NBYTES)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->NBYTES)))) - -#define EDMA_TCD_SLAST(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->SLAST)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->SLAST)))) - -#define EDMA_TCD_DADDR(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->DADDR)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->DADDR)))) - -#define EDMA_TCD_DOFF(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->DOFF)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->DOFF)))) - -#define EDMA_TCD_CITER(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->CITER)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->CITER)))) - -#define EDMA_TCD_DLAST_SGA(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? \ - (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->DLAST_SGA)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->DLAST_SGA)))) - -#define EDMA_TCD_CSR(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->CSR)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->CSR)))) - -#define EDMA_TCD_BITER(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->BITER)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->BITER)))) -#else -/*!@brief EDMA TCD address convert macro */ -#define EDMA_TCD_SADDR(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->SADDR) - -#define EDMA_TCD_SOFF(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->SOFF) - -#define EDMA_TCD_ATTR(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->ATTR) - -#define EDMA_TCD_NBYTES(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->NBYTES) - -#define EDMA_TCD_SLAST(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->SLAST) - -#define EDMA_TCD_DADDR(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->DADDR) - -#define EDMA_TCD_DOFF(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->DOFF) - -#define EDMA_TCD_CITER(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->CITER) - -#define EDMA_TCD_DLAST_SGA(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->DLAST_SGA) - -#define EDMA_TCD_CSR(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->CSR) - -#define EDMA_TCD_BITER(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->BITER) -#endif /* FSL_EDMA_SOC_IP_DMA5 */ -/******************************************************************************* - * API - ******************************************************************************/ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif - -/*! - * @} - */ - -#endif /* FSL_EDMA_CORE_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_edma_soc.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_edma_soc.c deleted file mode 100644 index f32c9e0e1b4..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_edma_soc.c +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_edma_soc.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.edma_soc" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -extern void DMA_CH0_DriverIRQHandler(void); -extern void DMA_CH1_DriverIRQHandler(void); -extern void DMA_CH2_DriverIRQHandler(void); -extern void DMA_CH3_DriverIRQHandler(void); -extern void DMA_CH4_DriverIRQHandler(void); -extern void DMA_CH5_DriverIRQHandler(void); -extern void DMA_CH6_DriverIRQHandler(void); -extern void DMA_CH7_DriverIRQHandler(void); -extern void EDMA_DriverIRQHandler(uint32_t instance, uint32_t channel); -/******************************************************************************* - * Code - ******************************************************************************/ -/*! - * brief DMA instance 0, channel 0 IRQ handler. - * - */ -void DMA_CH0_DriverIRQHandler(void) -{ - /* Instance 0 channel 0 */ - EDMA_DriverIRQHandler(0U, 0U); -} - -/*! - * brief DMA instance 0, channel 1 IRQ handler. - * - */ -void DMA_CH1_DriverIRQHandler(void) -{ - /* Instance 0 channel 1 */ - EDMA_DriverIRQHandler(0U, 1U); -} - -/*! - * brief DMA instance 0, channel 2 IRQ handler. - * - */ -void DMA_CH2_DriverIRQHandler(void) -{ - /* Instance 0 channel 2 */ - EDMA_DriverIRQHandler(0U, 2U); -} - -/*! - * brief DMA instance 0, channel 3 IRQ handler. - * - */ -void DMA_CH3_DriverIRQHandler(void) -{ - /* Instance 0 channel 3 */ - EDMA_DriverIRQHandler(0U, 3U); -} - -/*! - * brief DMA instance 0, channel 4 IRQ handler. - * - */ -void DMA_CH4_DriverIRQHandler(void) -{ - /* Instance 0 channel 4 */ - EDMA_DriverIRQHandler(0U, 4U); -} -/*! - * brief DMA instance 0, channel 5 IRQ handler. - * - */ -void DMA_CH5_DriverIRQHandler(void) -{ - /* Instance 0 channel 5 */ - EDMA_DriverIRQHandler(0U, 5U); -} - -/*! - * brief DMA instance 0, channel 6 IRQ handler. - * - */ -void DMA_CH6_DriverIRQHandler(void) -{ - /* Instance 0 channel 6 */ - EDMA_DriverIRQHandler(0U, 6U); -} - -/*! - * brief DMA instance 0, channel 7 IRQ handler. - * - */ -void DMA_CH7_DriverIRQHandler(void) -{ - /* Instance 0 channel 7 */ - EDMA_DriverIRQHandler(0U, 7U); -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_edma_soc.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_edma_soc.h deleted file mode 100644 index 7090fdc6f5c..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_edma_soc.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef _FSL_EDMA_SOC_H_ -#define _FSL_EDMA_SOC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup edma_soc - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/*! @name Driver version */ -/*@{*/ -/*! @brief Driver version 2.0.0. */ -#define FSL_EDMA_SOC_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) -/*@}*/ - -/*!@brief DMA IP version */ -#define FSL_EDMA_SOC_IP_DMA3 (1) -#define FSL_EDMA_SOC_IP_DMA4 (0) - -/*!@brief DMA base table */ -#define EDMA_BASE_PTRS \ - { \ - DMA0 \ - } - -#define EDMA_CHN_IRQS \ - { \ - { \ - DMA_CH0_IRQn, DMA_CH1_IRQn, DMA_CH2_IRQn, DMA_CH3_IRQn, DMA_CH4_IRQn, DMA_CH5_IRQn, DMA_CH6_IRQn, \ - DMA_CH7_IRQn \ - } \ - } - -/*!@brief EDMA base address convert macro */ -#define EDMA_CHANNEL_OFFSET 0x1000U -#define EDMA_CHANNEL_ARRAY_STEP(base) (0x1000U) - -/******************************************************************************* - * API - ******************************************************************************/ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif - -/*! - * @} - */ - -#endif /* _FSL_EDMA_SOC_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_eim.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_eim.c deleted file mode 100644 index bae11683f40..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_eim.c +++ /dev/null @@ -1,312 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_eim.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.eim" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to EIM bases for each instance. */ -static EIM_Type *const s_eimBases[] = EIM_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to EIM clocks for each instance. */ -static const clock_ip_name_t s_eimClocks[] = EIM_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t EIM_GetInstance(EIM_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_eimBases); instance++) - { - if (s_eimBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_eimBases)); - - return instance; -} - -/*! - * brief EIM module initialization function. - * - * param base EIM base address. - */ -void EIM_Init(EIM_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate EIM clock. */ - CLOCK_EnableClock(s_eimClocks[EIM_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - base->EIMCR = 0x00U; - base->EICHEN = 0x00U; -} - -/*! - * brief Deinitializes the EIM. - * - */ -void EIM_Deinit(EIM_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate EIM clock. */ - CLOCK_DisableClock(s_eimClocks[EIM_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -void EIM_InjectCheckBitError(EIM_Type *base, eim_memory_channel_t channel, uint8_t mask) -{ - switch ((uint8_t)channel) - { - case 0U: - base->EICHD0_WORD0 = EIM_EICHD0_WORD0_CHKBIT_MASK(mask); - break; -#ifdef EIM_EICHEN_EICH1EN_MASK - case 1U: - base->EICHD1_WORD0 = EIM_EICHD1_WORD0_CHKBIT_MASK(mask); - break; -#endif - -#ifdef EIM_EICHEN_EICH2EN_MASK - case 2U: - base->EICHD2_WORD0 = EIM_EICHD2_WORD0_CHKBIT_MASK(mask); - break; -#endif -#ifdef EIM_EICHEN_EICH3EN_MASK - case 3U: - base->EICHD3_WORD0 = EIM_EICHD3_WORD0_CHKBIT_MASK(mask); - break; -#endif -#ifdef EIM_EICHEN_EICH4EN_MASK - case 4U: - base->EICHD4_WORD0 = EIM_EICHD4_WORD0_CHKBIT_MASK(mask); - break; -#endif -#ifdef EIM_EICHEN_EICH5EN_MASK - case 5U: - base->EICHD5_WORD0 = EIM_EICHD5_WORD0_CHKBIT_MASK(mask); - break; -#endif -#ifdef EIM_EICHEN_EICH6EN_MASK - case 6U: - base->EICHD6_WORD0 = EIM_EICHD6_WORD0_CHKBIT_MASK(mask); - break; -#endif -#ifdef EIM_EICHEN_EICH7EN_MASK - case 7U: - base->EICHD7_WORD0 = EIM_EICHD7_WORD0_CHKBIT_MASK(mask); - break; -#endif -#ifdef EIM_EICHEN_EICH8EN_MASK - case 8U: - base->EICHD8_WORD0 = EIM_EICHD8_WORD0_CHKBIT_MASK(mask); - break; -#endif - default: - assert(NULL); - break; - } -} - -uint8_t EIM_GetCheckBitMask(EIM_Type *base, eim_memory_channel_t channel) -{ - uint8_t mask = 0x00U; - - switch ((uint8_t)channel) - { - case 0U: - mask = (uint8_t)((base->EICHD0_WORD0 & EIM_EICHD0_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD0_WORD0_CHKBIT_MASK_SHIFT); - break; -#ifdef EIM_EICHEN_EICH1EN_MASK - case 1U: - mask = (uint8_t)((base->EICHD1_WORD0 & EIM_EICHD1_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD1_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif -#ifdef EIM_EICHEN_EICH2EN_MASK - case 2U: - mask = (uint8_t)((base->EICHD2_WORD0 & EIM_EICHD2_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD2_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif -#ifdef EIM_EICHEN_EICH3EN_MASK - case 3U: - mask = (uint8_t)((base->EICHD3_WORD0 & EIM_EICHD3_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD3_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif -#ifdef EIM_EICHEN_EICH4EN_MASK - case 4U: - mask = (uint8_t)((base->EICHD4_WORD0 & EIM_EICHD4_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD4_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif -#ifdef EIM_EICHEN_EICH5EN_MASK - case 5U: - mask = (uint8_t)((base->EICHD5_WORD0 & EIM_EICHD5_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD5_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif -#ifdef EIM_EICHEN_EICH6EN_MASK - case 6U: - mask = (uint8_t)((base->EICHD6_WORD0 & EIM_EICHD6_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD6_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif -#ifdef EIM_EICHEN_EICH7EN_MASK - case 7U: - mask = (uint8_t)((base->EICHD7_WORD0 & EIM_EICHD7_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD7_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif -#ifdef EIM_EICHEN_EICH8EN_MASK - case 8U: - mask = (uint8_t)((base->EICHD8_WORD0 & EIM_EICHD8_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD8_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif - default: - assert(NULL); - break; - } - - return mask; -} - -void EIM_InjectDataBitError(EIM_Type *base, eim_memory_channel_t channel, uint8_t mask) -{ - switch ((uint8_t)channel) - { - case 0U: - base->EICHD0_WORD1 = mask; - break; -#ifdef EIM_EICHEN_EICH1EN_MASK - case 1U: - base->EICHD1_WORD1 = mask; - break; -#endif -#ifdef EIM_EICHEN_EICH2EN_MASK - case 2U: - base->EICHD2_WORD1 = mask; - break; -#endif -#ifdef EIM_EICHEN_EICH3EN_MASK - case kEIM_MemoryChannelRAMC: - base->EICHD3_WORD1 = mask; - break; -#endif -#ifdef EIM_EICHEN_EICH4EN_MASK - case kEIM_MemoryChannelRAMD: - base->EICHD4_WORD1 = mask; - break; -#endif -#ifdef EIM_EICHEN_EICH5EN_MASK - case kEIM_MemoryChannelRAME: - base->EICHD5_WORD1 = mask; - break; -#endif -#ifdef EIM_EICHEN_EICH6EN_MASK - case kEIM_MemoryChannelRAMF: - base->EICHD6_WORD1 = mask; - break; -#endif -#ifdef EIM_EICHEN_EICH7EN_MASK - case kEIM_MemoryChannelLPCACRAM: - base->EICHD7_WORD1 = mask; - break; -#endif -#ifdef EIM_EICHEN_EICH8EN_MASK - case kEIM_MemoryChannelPKCRAM: - base->EICHD8_WORD1 = mask; - break; -#endif - default: - assert(NULL); - break; - } -} - -uint32_t EIM_GetDataBitMask(EIM_Type *base, eim_memory_channel_t channel) -{ - uint32_t mask = 0x00U; - - switch ((uint8_t)channel) - { - case 0U: - mask = (base->EICHD0_WORD0 & EIM_EICHD0_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD0_WORD1_B0_3DATA_MASK_SHIFT; - break; - -#ifdef EIM_EICHEN_EICH1EN_MASK - case 1U: - mask = (base->EICHD1_WORD0 & EIM_EICHD1_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD1_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif -#ifdef EIM_EICHEN_EICH2EN_MASK - case 2U: - mask = (base->EICHD2_WORD0 & EIM_EICHD2_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD2_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif -#ifdef EIM_EICHEN_EICH3EN_MASK - case 3U: - mask = (base->EICHD3_WORD0 & EIM_EICHD3_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD3_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif -#ifdef EIM_EICHEN_EICH4EN_MASK - case 4U: - mask = (base->EICHD4_WORD0 & EIM_EICHD4_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD4_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif -#ifdef EIM_EICHEN_EICH5EN_MASK - case 5U: - mask = (base->EICHD5_WORD0 & EIM_EICHD5_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD5_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif -#ifdef EIM_EICHEN_EICH6EN_MASK - case 6U: - mask = (base->EICHD6_WORD0 & EIM_EICHD6_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD6_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif -#ifdef EIM_EICHEN_EICH7EN_MASK - case 7U: - mask = (base->EICHD7_WORD0 & EIM_EICHD7_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD7_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif -#ifdef EIM_EICHEN_EICH8EN_MASK - case 8U: - mask = (base->EICHD8_WORD1 & EIM_EICHD8_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD8_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif - default: - assert(NULL); - break; - } - - return mask; -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_eim.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_eim.h deleted file mode 100644 index 799ff3f20a5..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_eim.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_EIM_H_ -#define FSL_EIM_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup eim - * @{ - */ - -/****************************************************************************** - * Definitions. - *****************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief Driver version. */ -#define FSL_ERM_DRIVER_VERSION (MAKE_VERSION(2U, 0U, 1U)) -/*! @} */ - -/******************************************************************************* - * APIs - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @brief EIM module initialization function. - * - * @param base EIM base address. - */ -void EIM_Init(EIM_Type *base); - -/*! - * @brief De-initializes the EIM. - * - */ -void EIM_Deinit(EIM_Type *base); - -/*! @} */ - -/*! - * @name functional - * @{ - */ - -/*! - * @brief EIM module enable global error injection. - * - * @param base EIM base address. - * @param mask The interrupts to enable. - */ -static inline void EIM_EnableGlobalErrorInjection(EIM_Type *base, bool enable) -{ - if (enable) - { - base->EIMCR = EIM_EIMCR_GEIEN_MASK; - } - else - { - base->EIMCR = ~EIM_EIMCR_GEIEN_MASK; - } -} - -/*! - * @brief EIM module enable error injection for memory channel n, this function enables the corresponding error - * injection channel. The Global Error Injection Enable function must also be called to enable error injection. - * - * @param base EIM base address. - * @param mask The interrupts to enable. Refer to "_eim_error_injection_channel_enable" enumeration. - */ -static inline void EIM_EnableErrorInjectionChannels(EIM_Type *base, uint32_t mask) -{ - base->EICHEN |= mask; -} - -/*! - * @brief EIM module disable error injection for memory channel n. - * - * @param base EIM base address. - * @param mask The interrupts to enable. Refer to "_eim_error_injection_channel_enable" enumeration. - */ -static inline void EIM_DisableErrorInjectionChannels(EIM_Type *base, uint32_t mask) -{ - base->EICHEN &= ~mask; -} - -/*! - * @brief EIM module inject checkbit error for memory channel n, an attempt to invert more than 2 bits in one operation - * might result in undefined behavior. - * - * @param base EIM base address. - * @param channel memory channel. - * @param mask The interrupts to enable. - */ -void EIM_InjectCheckBitError(EIM_Type *base, eim_memory_channel_t channel, uint8_t mask); - -/*! - * @brief EIM module get checkbit mask for memory channel n. - * - * @param base EIM base address. - * @param channel memory channel. - * @retval return checkbit mask. - */ -uint8_t EIM_GetCheckBitMask(EIM_Type *base, eim_memory_channel_t channel); - -/*! - * @brief EIM module inject databit error for memory channel n, an attempt to invert more than 2 bits in one operation - * might result in undefined behavior. - * - * @param base EIM base address. - * @param channel memory channel. - * @param mask The interrupts to enable. - */ -void EIM_InjectDataBitError(EIM_Type *base, eim_memory_channel_t channel, uint8_t mask); - -/*! - * @brief EIM module get databit mask for memory channel n. - * - * @param base EIM base address. - * @param channel memory channel. - * @retval return checkbit mask. - */ -uint32_t EIM_GetDataBitMask(EIM_Type *base, eim_memory_channel_t channel); - -/*! @}*/ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_eqdc.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_eqdc.c deleted file mode 100644 index 00f5fd8859b..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_eqdc.c +++ /dev/null @@ -1,301 +0,0 @@ -/* - * Copyright 2022, 2023 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_eqdc.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.eqdc" -#endif - -#if defined(EQDC_RSTS) -#define EQDC_RESETS_ARRAY EQDC_RSTS -#endif -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Get instance number for EQDC module. - * - * @param base EQDC peripheral base address - */ -static uint32_t EQDC_GetInstance(EQDC_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to EQDC bases for each instance. */ -static EQDC_Type *const s_eqdcBases[] = EQDC_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to EQDC clocks for each instance. */ -#if defined(QDC_CLOCKS) -static const clock_ip_name_t s_eqdcClocks[] = QDC_CLOCKS; -#elif defined(ENC_CLOCKS) -static const clock_ip_name_t s_eqdcClocks[] = ENC_CLOCKS; -#endif -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(EQDC_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_eqdcResets[] = EQDC_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t EQDC_GetInstance(EQDC_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_eqdcBases); instance++) - { - if (s_eqdcBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_eqdcBases)); - - return instance; -} - -/* - * Initializes the EQDC module. - * - * This function initializes the EQDC by enabling the IP bus clock (optional). - * - * param base EQDC peripheral base address. - * param psConfig Pointer to configuration structure. - */ -void EQDC_Init(EQDC_Type *base, const eqdc_config_t *psConfig) -{ - assert(NULL != psConfig); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock. */ - CLOCK_EnableClock(s_eqdcClocks[EQDC_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(EQDC_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_eqdcResets[EQDC_GetInstance(base)]); -#endif - - /* Initialize Double-set registers */ - EQDC_ClearBufferedRegisterLoadUpdateMode(base); - EQDC_ClearEqdcLdok(base); - - /* Counter value. */ - EQDC_SetPositionCounterValue(base, psConfig->positionCounterValue); - - /* Initial value. */ - EQDC_SetInitialPositionValue(base, psConfig->positionInitialValue); - - /* Modulus value. */ - EQDC_SetPositionModulusValue(base, psConfig->positionModulusValue); - - /* Compare value. */ - EQDC_SetPositionCompare0Value(base, psConfig->positionCompareValue[0]); - EQDC_SetPositionCompare1Value(base, psConfig->positionCompareValue[1]); - EQDC_SetPositionCompare2Value(base, psConfig->positionCompareValue[2]); - EQDC_SetPositionCompare3Value(base, psConfig->positionCompareValue[3]); - - EQDC_SetEqdcLdok(base); - while (EQDC_GetEqdcLdok(base) != 0U) - { - } - - /* Watchdog. */ - EQDC_SetWatchdogTimeout(base, psConfig->watchdogTimeoutValue); - - /* Clear EQDC_REV */ - base->REV = 0U; - - /* EQDC_IMR. */ - base->IMR = EQDC_IMR_FPHA(psConfig->filterPhaseA) | EQDC_IMR_FPHB(psConfig->filterPhaseB) | - EQDC_IMR_FIND_PRE(psConfig->filterIndPre) | EQDC_IMR_FHOM_ENA(psConfig->filterHomEna); - - /* EQDC_FILT. */ - base->FILT = EQDC_FILT_PRSC(psConfig->prescaler) | /* Prescaler used by LASTEDGE and POSDPER. */ - EQDC_FILT_FILT_CS(psConfig->filterClockSourceselection) | - EQDC_FILT_FILT_CNT(psConfig->filterSampleCount) | EQDC_FILT_FILT_PER(psConfig->filterSamplePeriod); - - /* EQDC_CTRL. */ - base->CTRL = EQDC_CTRL_W1C_FLAGS | /* W1C flags. */ - (uint16_t)psConfig->homeEnableInitPosCounterMode | /* HOME Enable trigger. */ - (uint16_t)psConfig->indexPresetInitPosCounterMode | /* INDEX Preset trigger. */ - EQDC_CTRL_REV(psConfig->enableReverseDirection) | /* Reverse direction. */ - EQDC_CTRL_WDE(psConfig->enableWatchdog) | /* Enable watchdog. */ - EQDC_CTRL_DMAEN(psConfig->enableDma); /* Enable Dma. */ - - /* Set mode of count. */ - EQDC_SetCountMode(base, psConfig->countMode); /* eqdcoder count mode. */ - - /* EQDC_CTRL2. */ - base->CTRL2 = - EQDC_CTRL2_ONCE(psConfig->countOnce) | - EQDC_CTRL2_INITPOS(psConfig->enableTriggerInitPositionCounter) | /* TRIGGER initializes position counter. */ -#if (defined(FSL_FEATURE_EQDC_CTRL2_HAS_EMIP_BIT_FIELD) && FSL_FEATURE_EQDC_CTRL2_HAS_EMIP_BIT_FIELD) - EQDC_CTRL2_EMIP(psConfig->enableIndexInitPositionCounter)| /* Index Event Edge Mark initializes position counter */ -#endif /* FSL_FEATURE_EQDC_CTRL2_HAS_EMIP_BIT_FIELD */ - EQDC_CTRL2_PMEN(psConfig->enablePeriodMeasurement) | /* Enable period measurement. */ - EQDC_CTRL2_OUTCTL(psConfig->outputPulseMode) | /* Output pulse. */ - EQDC_CTRL2_REVMOD(psConfig->revolutionCountCondition) | /* Revolution count condition. */ - EQDC_CTRL2_LDMOD(psConfig->bufferedRegisterLoadMode) | /* Buffered register load (Update) mode select. */ - EQDC_CTRL2_UPDPOS(psConfig->enableTriggerClearPositionRegisters) | /* TRIGGER clears position register. */ - EQDC_CTRL2_UPDHLD(psConfig->enableTriggerHoldPositionRegisters); /* TRIGGER loads position registers. */ - - /* Set mode of operation. */ - EQDC_SetOperateMode(base, psConfig->operateMode); /* eqdcoder work mode. */ - - /* Enable interrupts. */ - EQDC_EnableInterrupts(base, psConfig->enabledInterruptsMask); -} - -/* - * De-initializes the EQDC module. - * - * This function deinitializes the EQDC by: - * 1. Disables the IP bus clock (optional). - * - * param base EQDC peripheral base address. - */ -void EQDC_Deinit(EQDC_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable the clock. */ - CLOCK_DisableClock(s_eqdcClocks[EQDC_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * Gets an available pre-defined configuration. - * - * The default value are: - * psConfig->enableReverseDirection = false; - * psConfig->countOnce = false; - * psConfig->operateMode = kEQDC_QuadratureDecodeOperationMode; - * psConfig->countMode = kEQDC_QuadratureX4; - * psConfig->homeEnableInitPosCounterMode = kEQDC_HomeInitPosCounterDisabled; - * psConfig->indexPresetInitPosCounterMode = kEQDC_IndexInitPosCounterDisabled; - * psConfig->enableIndexInitPositionCounter = false; - * psConfig->enableDma = false; - * psConfig->bufferedRegisterLoadMode = false; - * psConfig->enableTriggerInitPositionCounter = false; - * psConfig->enableTriggerClearPositionRegisters = false; - * psConfig->enableTriggerHoldPositionRegisters = false; - * psConfig->enableWatchdog = false; - * psConfig->watchdogTimeoutValue = 0xFFFFU; - * psConfig->filterPhaseA = 0U; - * psConfig->filterPhaseB = 0U; - * psConfig->filterIndPre = 0U; - * psConfig->filterHomEna = 0U; - * psConfig->filterClockSourceselection = false; - * psConfig->filterSampleCount = kEQDC_Filter3Samples; - * psConfig->filterSamplePeriod = 0U; - * psConfig->outputPulseMode = kEQDC_OutputPulseOnCounterEqualCompare; - * psConfig->positionCompareValue[0] = 0xFFFFFFFFU; - * psConfig->positionCompareValue[1] = 0xFFFFFFFFU; - * psConfig->positionCompareValue[2] = 0xFFFFFFFFU; - * psConfig->positionCompareValue[3] = 0xFFFFFFFFU; - * psConfig->revolutionCountCondition = kEQDC_RevolutionCountOnIndexPulse; - * psConfig->positionModulusValue = 0U; - * psConfig->positionInitialValue = 0U; - * psConfig->positionCounterValue = 0U; - * psConfig->enablePeriodMeasurement = false; - * psConfig->prescaler = kEQDC_Prescaler1; - * psConfig->enabledInterruptsMask = 0U; - * - * param psConfig Pointer to configuration structure. - */ -void EQDC_GetDefaultConfig(eqdc_config_t *psConfig) -{ - assert(NULL != psConfig); - - psConfig->enableReverseDirection = false; - psConfig->countOnce = false; - psConfig->operateMode = kEQDC_QuadratureDecodeOperationMode; /*!< Decode Mode. */ - psConfig->countMode = kEQDC_QuadratureX4; - psConfig->homeEnableInitPosCounterMode = kEQDC_HomeInitPosCounterDisabled; - psConfig->indexPresetInitPosCounterMode = kEQDC_IndexInitPosCounterDisabled; -#if (defined(FSL_FEATURE_EQDC_CTRL2_HAS_EMIP_BIT_FIELD) && FSL_FEATURE_EQDC_CTRL2_HAS_EMIP_BIT_FIELD) - psConfig->enableIndexInitPositionCounter = false; -#endif /* FSL_FEATURE_EQDC_CTRL2_HAS_EMIP_BIT_FIELD */ - psConfig->enableDma = false; - psConfig->bufferedRegisterLoadMode = false; - psConfig->enableTriggerInitPositionCounter = false; - psConfig->enableTriggerClearPositionRegisters = false; - psConfig->enableTriggerHoldPositionRegisters = false; - psConfig->enableWatchdog = false; - psConfig->watchdogTimeoutValue = 0xFFFFU; - psConfig->filterPhaseA = 0U; - psConfig->filterPhaseB = 0U; - psConfig->filterIndPre = 0U; - psConfig->filterHomEna = 0U; - psConfig->filterClockSourceselection = false; - psConfig->filterSampleCount = kEQDC_Filter3Samples; - psConfig->filterSamplePeriod = 0U; - psConfig->outputPulseMode = kEQDC_OutputPulseOnCounterEqualCompare; - psConfig->positionCompareValue[0] = 0xFFFFFFFFU; - psConfig->positionCompareValue[1] = 0xFFFFFFFFU; - psConfig->positionCompareValue[2] = 0xFFFFFFFFU; - psConfig->positionCompareValue[3] = 0xFFFFFFFFU; - psConfig->revolutionCountCondition = kEQDC_RevolutionCountOnIndexPulse; - psConfig->positionModulusValue = 0U; - psConfig->positionInitialValue = 0U; - psConfig->positionCounterValue = 0U; - psConfig->enablePeriodMeasurement = false; - psConfig->prescaler = kEQDC_Prescaler1; - psConfig->enabledInterruptsMask = 0U; -} - -/* - * Initializes the mode of operation. - * - * The Quadrature Decoder operates in following 4 operation modes: - * 1.Quadrature Decode(QDC) Operation Mode (CTRL[PH1] = 0,CTRL2[OPMODE] = 0) - * 2.Quadrature Count(QCT) Operation Mode (CTRL[PH1] = 0,CTRL2[OPMODE] = 1) - * 3.Single Phase Decode(PH1DC) Operation Mode (CTRL[PH1] = 1,CTRL2[OPMODE] = 0) - * 4.Single Phase Count(PH1CT) Operation Mode (CTRL[PH1] = 1,CTRL2[OPMODE] = 1) - * - * param base EQDC peripheral base address. - * param psConfig Pointer to configuration structure. - */ -void EQDC_SetOperateMode(EQDC_Type *base, eqdc_operate_mode_t operateMode) -{ - switch (operateMode) - { - case kEQDC_QuadratureDecodeOperationMode: - base->CTRL &= ~EQDC_CTRL_PH1_MASK; - base->CTRL2 &= ~EQDC_CTRL2_OPMODE_MASK; - break; - - case kEQDC_QuadratureCountOperationMode: - base->CTRL &= ~EQDC_CTRL_PH1_MASK; - base->CTRL2 |= EQDC_CTRL2_OPMODE_MASK; - break; - - case kEQDC_SinglePhaseDecodeOperationMode: - base->CTRL |= EQDC_CTRL_PH1_MASK; - base->CTRL2 &= ~EQDC_CTRL2_OPMODE_MASK; - break; - - case kEQDC_SinglePhaseCountOperationMode: - base->CTRL |= EQDC_CTRL_PH1_MASK; - base->CTRL2 |= EQDC_CTRL2_OPMODE_MASK; - break; - - default: - assert(false); - break; - } -} \ No newline at end of file diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_eqdc.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_eqdc.h deleted file mode 100644 index 3f3ef5baf54..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_eqdc.h +++ /dev/null @@ -1,1211 +0,0 @@ -/* - * Copyright 2022, 2023 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_EQDC_H_ -#define FSL_EQDC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup eqdc - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -#define FSL_EQDC_DRIVER_VERSION (MAKE_VERSION(2, 3, 0)) - -/*! @brief W1C bits in EQDC CTRL registers. */ -#define EQDC_CTRL_W1C_FLAGS (EQDC_CTRL_HIRQ_MASK | EQDC_CTRL_XIRQ_MASK | EQDC_CTRL_WDIRQ_MASK) - -/*! @brief W1C bits in EQDC INTCTRL registers. */ -#define EQDC_INTCTRL_W1C_FLAGS \ - (EQDC_INTCTRL_SABIRQ_MASK | EQDC_INTCTRL_DIRIRQ_MASK | EQDC_INTCTRL_RUIRQ_MASK | EQDC_INTCTRL_ROIRQ_MASK | \ - EQDC_INTCTRL_CMP0IRQ_MASK | EQDC_INTCTRL_CMP1IRQ_MASK | EQDC_INTCTRL_CMP2IRQ_MASK | EQDC_INTCTRL_CMP3IRQ_MASK) - -/*! @brief Interrupt enable bits in EQDC CTRL registers. */ -#define EQDC_CTRL_INT_EN (EQDC_CTRL_HIE_MASK | EQDC_CTRL_XIE_MASK | EQDC_CTRL_WDIE_MASK) - -/*! @brief Interrupt enable bits in EQDC INTCTRL registers. */ -#if (defined(FSL_FEATURE_EQDC_HAS_NO_COMPARE_INTERRUPT) && FSL_FEATURE_EQDC_HAS_NO_COMPARE_INTERRUPT) -#define EQDC_INTCTRL_INT_EN \ - (EQDC_INTCTRL_SABIE_MASK | EQDC_INTCTRL_DIRIE_MASK | EQDC_INTCTRL_RUIE_MASK | EQDC_INTCTRL_ROIE_MASK) -#else -#define EQDC_INTCTRL_INT_EN \ - (EQDC_INTCTRL_SABIE_MASK | EQDC_INTCTRL_DIRIE_MASK | EQDC_INTCTRL_RUIE_MASK | EQDC_INTCTRL_ROIE_MASK | \ - EQDC_INTCTRL_CMP0IE_MASK | EQDC_INTCTRL_CMP1IE_MASK | EQDC_INTCTRL_CMP2IE_MASK | EQDC_INTCTRL_CMP3IE_MASK) -#endif - -/*! @brief Interrupt flag bits in EQDC CTRL registers. */ -#define EQDC_CTRL_INT_FLAGS (EQDC_CTRL_HIRQ_MASK | EQDC_CTRL_XIRQ_MASK | EQDC_CTRL_WDIRQ_MASK) - -/*! @brief Interrupt flag bits in EQDC INTCTRL registers. */ -#define EQDC_INTCTRL_INT_FLAGS \ - (EQDC_INTCTRL_SABIRQ_MASK | EQDC_INTCTRL_DIRIRQ_MASK | EQDC_INTCTRL_RUIRQ_MASK | EQDC_INTCTRL_ROIRQ_MASK | \ - EQDC_INTCTRL_CMP0IRQ_MASK | EQDC_INTCTRL_CMP1IRQ_MASK | EQDC_INTCTRL_CMP2IRQ_MASK | EQDC_INTCTRL_CMP3IRQ_MASK) - -#if !(defined(FSL_FEATURE_EQDC_HAS_NO_COMPARE_INTERRUPT) && FSL_FEATURE_EQDC_HAS_NO_COMPARE_INTERRUPT) -#define kEQDC_PositionCompare0InerruptEnable kEQDC_PositionCompare0InterruptEnable -#define kEQDC_PositionCompare1InerruptEnable kEQDC_PositionCompare1InterruptEnable -#define kEQDC_PositionCompare2InerruptEnable kEQDC_PositionCompare2InterruptEnable -#define kEQDC_PositionCompare3InerruptEnable kEQDC_PositionCompare3InterruptEnable -#endif - -/*! - * @brief EQDC status flags, these flags indicate the counter's events. - * @anchor _eqdc_status_flags - */ -enum _eqdc_status_flags -{ - kEQDC_HomeEnableTransitionFlag = EQDC_CTRL_HIRQ_MASK, /*!< HOME/ENABLE signal transition occured. */ - kEQDC_IndexPresetPulseFlag = EQDC_CTRL_XIRQ_MASK, /*!< INDEX/PRESET pulse occured. */ - kEQDC_WatchdogTimeoutFlag = EQDC_CTRL_WDIRQ_MASK, /*!< Watchdog timeout occured. */ - - kEQDC_SimultPhaseChangeFlag = (uint32_t)EQDC_INTCTRL_SABIRQ_MASK - << 16U, /*!< Simultaneous change of PHASEA and PHASEB occured. */ - kEQDC_CountDirectionChangeFlag = (uint32_t)EQDC_INTCTRL_DIRIRQ_MASK - << 16U, /*!< Count direction change interrupt enable. */ - kEQDC_PositionRollOverFlag = (uint32_t)EQDC_INTCTRL_ROIRQ_MASK - << 16U, /*!< Position counter rolls over from 0xFFFFFFFF to 0, or - from MOD value to INIT value. */ - kEQDC_PositionRollUnderFlag = (uint32_t)EQDC_INTCTRL_RUIRQ_MASK - << 16U, /*!< Position register roll under from 0 to 0xFFFFFFFF, or - from INIT value to MOD value. */ - - kEQDC_PositionCompare0Flag = (uint32_t)EQDC_INTCTRL_CMP0IRQ_MASK - << 16U, /*!< Position counter match the COMP0 value. */ - kEQDC_PositionCompare1Flag = (uint32_t)EQDC_INTCTRL_CMP1IRQ_MASK - << 16U, /*!< Position counter match the COMP1 value. */ - kEQDC_PositionCompare2Flag = (uint32_t)EQDC_INTCTRL_CMP2IRQ_MASK - << 16U, /*!< Position counter match the COMP2 value. */ - kEQDC_PositionCompare3Flag = (uint32_t)EQDC_INTCTRL_CMP3IRQ_MASK - << 16U, /*!< Position counter match the COMP3 value. */ - - kEQDC_StatusAllFlags = kEQDC_HomeEnableTransitionFlag | kEQDC_IndexPresetPulseFlag | kEQDC_WatchdogTimeoutFlag | - kEQDC_SimultPhaseChangeFlag | kEQDC_PositionRollOverFlag | kEQDC_PositionRollUnderFlag | - kEQDC_PositionCompare0Flag | kEQDC_PositionCompare1Flag | kEQDC_PositionCompare2Flag | - kEQDC_PositionCompare3Flag -}; - -/*! - * @brief Signal status, these flags indicate the raw and filtered input signal status. - * @anchor _eqdc_signal_status - */ -enum _eqdc_signal_status -{ - kEQDC_SignalStatusRawHomeEnable = EQDC_IMR_HOME_ENABLE_MASK, /*!< Raw HOME/ENABLE input. */ - kEQDC_SignalStatusRawIndexPreset = EQDC_IMR_INDEX_PRESET_MASK, /*!< Raw INDEX/PRESET input. */ - kEQDC_SignalStatusRawPhaseB = EQDC_IMR_PHB_MASK, /*!< Raw PHASEB input. */ - kEQDC_SignalStatusRawPhaseA = EQDC_IMR_PHA_MASK, /*!< Raw PHASEA input. */ - kEQDC_SignalStatusFilteredHomeEnable = EQDC_IMR_FHOM_ENA_MASK, /*!< The filtered HOME/ENABLE input. */ - kEQDC_SignalStatusFilteredIndexPreset = EQDC_IMR_FIND_PRE_MASK, /*!< The filtered INDEX/PRESET input. */ - kEQDC_SignalStatusFilteredPhaseB = EQDC_IMR_FPHB_MASK, /*!< The filtered PHASEB input. */ - kEQDC_SignalStatusFilteredPhaseA = EQDC_IMR_FPHA_MASK, /*!< The filtered PHASEA input. */ - - kEQDC_SignalStatusPositionCompare0Flag = EQDC_IMR_CMPF0_MASK, /*!< Position Compare 0 Flag Output. */ - kEQDC_SignalStatusPositionCompare1Flag = EQDC_IMR_CMP1F_MASK, /*!< Position Compare 1 Flag Output. */ - kEQDC_SignalStatusPositionCompare2Flag = EQDC_IMR_CMP2F_MASK, /*!< Position Compare 2 Flag Output. */ - kEQDC_SignalStatusPositionCompare3Flag = EQDC_IMR_CMP3F_MASK, /*!< Position Compare 3 Flag Output. */ - kEQDC_SignalStatusCountDirectionFlagHold = EQDC_IMR_DIRH_MASK, /*!< Count Direction Flag Hold. */ - kEQDC_SignalStatusCountDirectionFlag = EQDC_IMR_DIR_MASK, /*!< Count Direction Flag Output. */ - - kEQDC_SignalStatusAllFlags = kEQDC_SignalStatusRawHomeEnable | kEQDC_SignalStatusRawIndexPreset | - kEQDC_SignalStatusRawPhaseB | kEQDC_SignalStatusRawPhaseA | - kEQDC_SignalStatusFilteredHomeEnable | kEQDC_SignalStatusFilteredIndexPreset | - kEQDC_SignalStatusFilteredPhaseB | kEQDC_SignalStatusFilteredPhaseA | - kEQDC_SignalStatusPositionCompare0Flag | kEQDC_SignalStatusPositionCompare1Flag | - kEQDC_SignalStatusPositionCompare2Flag | kEQDC_SignalStatusPositionCompare3Flag | - kEQDC_SignalStatusCountDirectionFlagHold | kEQDC_SignalStatusCountDirectionFlag -}; - -/*! - * @brief Interrupt enable/disable mask. - * @anchor _eqdc_interrupt_enable - */ -enum _eqdc_interrupt_enable -{ - kEQDC_HomeEnableTransitionInterruptEnable = - EQDC_CTRL_HIE_MASK, /*!< HOME/ENABLE signal transition interrupt enable. */ - kEQDC_IndexPresetPulseInterruptEnable = EQDC_CTRL_XIE_MASK, /*!< INDEX/PRESET pulse interrupt enable. */ - kEQDC_WatchdogTimeoutInterruptEnable = EQDC_CTRL_WDIE_MASK, /*!< Watchdog timeout interrupt enable. */ - - kEQDC_SimultPhaseChangeInterruptEnable = (uint32_t)EQDC_INTCTRL_SABIE_MASK - << 16U, /*!< Simultaneous PHASEA and PHASEB change interrupt enable. */ - kEQDC_CountDirectionChangeInterruptEnable = (uint32_t)EQDC_INTCTRL_DIRIE_MASK - << 16U, /*!< Count direction change interrupt enable. */ - kEQDC_PositionRollOverInterruptEnable = (uint32_t)EQDC_INTCTRL_ROIE_MASK << 16U, /*!< Roll-over interrupt enable. */ - kEQDC_PositionRollUnderInterruptEnable = (uint32_t)EQDC_INTCTRL_RUIE_MASK - << 16U, /*!< Roll-under interrupt enable. */ - -#if !(defined(FSL_FEATURE_EQDC_HAS_NO_COMPARE_INTERRUPT) && FSL_FEATURE_EQDC_HAS_NO_COMPARE_INTERRUPT) - kEQDC_PositionCompare0InterruptEnable = (uint32_t)EQDC_INTCTRL_CMP0IE_MASK - << 16U, /*!< Position compare 0 interrupt enable. */ - kEQDC_PositionCompare1InterruptEnable = (uint32_t)EQDC_INTCTRL_CMP1IE_MASK - << 16U, /*!< Position compare 1 interrupt enable. */ - kEQDC_PositionCompare2InterruptEnable = (uint32_t)EQDC_INTCTRL_CMP2IE_MASK - << 16U, /*!< Position compare 2 interrupt enable. */ - kEQDC_PositionCompare3InterruptEnable = (uint32_t)EQDC_INTCTRL_CMP3IE_MASK - << 16U, /*!< Position compare 3 interrupt enable. */ -#endif - -#if (defined(FSL_FEATURE_EQDC_HAS_NO_COMPARE_INTERRUPT) && FSL_FEATURE_EQDC_HAS_NO_COMPARE_INTERRUPT) - kEQDC_AllInterruptEnable = kEQDC_HomeEnableTransitionInterruptEnable | kEQDC_IndexPresetPulseInterruptEnable | - kEQDC_WatchdogTimeoutInterruptEnable | kEQDC_SimultPhaseChangeInterruptEnable | - kEQDC_CountDirectionChangeInterruptEnable | kEQDC_PositionRollOverInterruptEnable | - kEQDC_PositionRollUnderInterruptEnable -#else - kEQDC_AllInterruptEnable = kEQDC_HomeEnableTransitionInterruptEnable | kEQDC_IndexPresetPulseInterruptEnable | - kEQDC_WatchdogTimeoutInterruptEnable | kEQDC_SimultPhaseChangeInterruptEnable | - kEQDC_CountDirectionChangeInterruptEnable | kEQDC_PositionRollOverInterruptEnable | - kEQDC_PositionRollUnderInterruptEnable | kEQDC_PositionCompare0InterruptEnable | - kEQDC_PositionCompare1InterruptEnable | kEQDC_PositionCompare2InterruptEnable | - kEQDC_PositionCompare3InterruptEnable -#endif -}; - -/*! - * @brief Define HOME/ENABLE signal's trigger mode. - */ -typedef enum _eqdc_home_enable_init_pos_counter_mode -{ - /*! Don't use HOME/ENABLE signal to initialize the position counter. */ - kEQDC_HomeInitPosCounterDisabled = 0U, - - /*! Use positive going edge to trigger initialization of position counters. */ - kEQDC_HomeInitPosCounterOnRisingEdge = EQDC_CTRL_HIP_MASK, - - /*! Use negative going edge to trigger initialization of position counters. */ - kEQDC_HomeInitPosCounterOnFallingEdge = EQDC_CTRL_HIP_MASK | EQDC_CTRL_HNE_MASK, -} eqdc_home_enable_init_pos_counter_mode_t; - -/*! - * @brief Define INDEX/PRESET signal's trigger mode. - */ -typedef enum _eqdc_index_preset_init_pos_counter_mode -{ - /*! INDEX/PRESET pulse does not initialize the position counter. */ - kEQDC_IndexInitPosCounterDisabled = 0U, - - /*! Use INDEX/PRESET pulse rising edge to initialize position counter. */ - kEQDC_IndexInitPosCounterOnRisingEdge = EQDC_CTRL_XIP_MASK, - - /*! Use INDEX/PRESET pulse falling edge to initialize position counter. */ - kEQDC_IndexInitPosCounterOnFallingEdge = EQDC_CTRL_XIP_MASK | EQDC_CTRL_XNE_MASK, -} eqdc_index_preset_init_pos_counter_mode_t; - -/*! - * @brief Define type for decoder opertion mode. - * - * The Quadrature Decoder operates in following 4 operation modes: - * 1.Quadrature Decode(QDC) Operation Mode (CTRL[PH1] = 0,CTRL2[OPMODE] = 0) - * In QDC operation mode, Module uses PHASEA, PHASEB, INDEX, HOME, TRIGGER - * and ICAP[3:1] to decode the PHASEA and PHASEB signals from Speed/Position sensor. - * 2.Quadrature Count(QCT) Operation Mode (CTRL[PH1] = 0,CTRL2[OPMODE] = 1) - * In QCT operation mode, Module uses PHASEA, PHASEB, PRESET, ENABLE, - * TRIGGER and ICAP[3:1] to count the PHASEA and PHASEB signals from Speed/Position sensor. - * 3.Single Phase Decode(PH1DC) Operation Mode (CTRL[PH1] = 1,CTRL2[OPMODE] = 0) - * In PH1DC operation mode, the module uses PHASEA, PHASEB, INDEX, HOME, - * TRIGGER and ICAP[3:1] to decode the PHASEA and PHASEB signals from Speed/Position sensor. - * 4.Single Phase Count(PH1CT) Operation Mode (CTRL[PH1] = 1,CTRL2[OPMODE] = 1) - * In PH1CT operation mode, the module uses PHASEA, PHASEB, PRESET, ENABLE, - * TRIGGER and ICAP[3:1] to count the PHASEA and PHASEB signals from Speed/Position sensor. - */ -typedef enum _eqdc_operate_mode -{ - kEQDC_QuadratureDecodeOperationMode = 0U, /*!< Use standard quadrature decoder with PHASEA/PHASEB, INDEX/HOME. */ - kEQDC_QuadratureCountOperationMode, /*!< Use quadrature count operation mode with PHASEA/PHASEB, PRESET/ENABLE. */ - kEQDC_SinglePhaseDecodeOperationMode, /*!< Use single phase quadrature decoder with PHASEA/PHASEB, INDEX/HOME. */ - kEQDC_SinglePhaseCountOperationMode, /*!< Use single phase count decoder with PHASEA/PHASEB, PRESET/ENABLE. */ -} eqdc_operate_mode_t; - -/*! - * @brief Define type for decoder count mode. - * - * In decode mode, it uses the standard quadrature decoder with PHASEA and PHASEB, - * PHASEA = 0 and PHASEB = 0 mean reverse direction. - * - If PHASEA leads PHASEB, then motion is in the positive direction. - * - If PHASEA trails PHASEB,then motion is in the negative direction. - * In single phase mode, there are three count modes: - * - In Signed Count mode (Single Edge). Both position counter (POS) and position difference counter (POSD) count - * on the input PHASEA rising edge while the input PHASEB provides the selected position counter direction - * (up/down). If CTRL[REV] is 1, then the position counter will count in the opposite direction. - * - In Signed Count mode (double edge), both position counter (POS) and - * position difference counter (POSD) count the input PHASEA on both rising edge and falling edge while the input - * PHASEB provides the selected position counter direction (up/down). - * - In UP/DOWN Pulse Count mode. Both position counter (POS) and position difference counter (POSD) count in the - * up direction when input PHASEA rising edge occurs. Both counters count in the down direction when input PHASEB rising - * edge occurs. If CTRL[REV] is 1, then the position counter will count in the opposite direction. - */ -typedef enum _eqdc_count_mode -{ - kEQDC_QuadratureX4 = 0U, /*!< Active on kEQDC_QuadratureDecodeOperationMode/kEQDC_QuadratureCountOperationMode. */ - kEQDC_QuadratureX2 = 1U, /*!< Active on kEQDC_QuadratureDecodeOperationMode/kEQDC_QuadratureCountOperationMode. */ - kEQDC_QuadratureX1 = 2U, /*!< Active on kEQDC_QuadratureDecodeOperationMode/kEQDC_QuadratureCountOperationMode. */ - kEQDC_UpDownPulseCount = - 0U, /*!< Active on kEQDC_SinglePhaseDecodeOperationMode/kEQDC_SinglePhaseCountOperationMode. */ - kEQDC_SignedCountDoubleEdge = - 1U, /*!< Active on kEQDC_SinglePhaseDecodeOperationMode/kEQDC_SinglePhaseCountOperationMode. */ - kEQDC_SignedCountSingleEdge = - 2U, /*!< Active on kEQDC_SinglePhaseDecodeOperationMode/kEQDC_SinglePhaseCountOperationMode. */ -} eqdc_count_mode_t; - -/*! - * @brief Define type for the condition of POSMATCH pulses. - */ -typedef enum _eqdc_output_pulse_mode -{ - kEQDC_OutputPulseOnCounterEqualCompare = 0U, /*!< POSMATCH pulses when a match occurs between the position counters - (POS) and the compare value (UCOMPx/LCOMPx)(x range is 0-3). */ - kEQDC_OutputPulseOnReadingPositionCounter, /*!< POSMATCH pulses when reading position counter(POS and LPOS), - revolution counter(REV), position difference counter(POSD). */ -} eqdc_output_pulse_mode_t; - -/*! - * @brief Define type for determining how the revolution counter (REV) is incremented/decremented. - */ -typedef enum _eqdc_revolution_count_condition -{ - kEQDC_RevolutionCountOnIndexPulse = 0U, /*!< Use INDEX pulse to increment/decrement revolution counter. */ - kEQDC_RevolutionCountOnRollOverModulus, /*!< Use modulus counting roll-over/under to increment/decrement revolution - counter. */ -} eqdc_revolution_count_condition_t; - -/*! - * @brief Input Filter Sample Count - * - * The Input Filter Sample Count represents the number of consecutive samples - * that must agree, before the input filter accepts an input transition - */ -typedef enum _eqdc_filter_sample_count -{ - kEQDC_Filter3Samples = 0U, /*!< 3 samples. */ - kEQDC_Filter4Samples = 1U, /*!< 4 samples. */ - kEQDC_Filter5Samples = 2U, /*!< 5 samples. */ - kEQDC_Filter6Samples = 3U, /*!< 6 samples. */ - kEQDC_Filter7Samples = 4U, /*!< 7 samples. */ - kEQDC_Filter8Samples = 5U, /*!< 8 samples. */ - kEQDC_Filter9Samples = 6U, /*!< 9 samples. */ - kEQDC_Filter10Samples = 7U, /*!< 10 samples. */ -} eqdc_filter_sample_count_t; - -/*! - * @brief Count direction. - */ -typedef enum _eqdc_count_direction_flag -{ - kEQDC_CountDirectionDown = 0U, /*!< Last count was in down direction. */ - kEQDC_CountDirectionUp, /*!< Last count was in up direction. */ -} eqdc_count_direction_flag_t; - -/*! - * @brief Prescaler used by Last Edge Time (LASTEDGE) and - * Position Difference Period Counter (POSDPER). - */ -typedef enum _eqdc_prescaler -{ - kEQDC_Prescaler1 = 0U, /*!< Prescaler value 1. */ - kEQDC_Prescaler2 = 1U, /*!< Prescaler value 2. */ - kEQDC_Prescaler4 = 2U, /*!< Prescaler value 4. */ - kEQDC_Prescaler8 = 3U, /*!< Prescaler value 8. */ - kEQDC_Prescaler16 = 4U, /*!< Prescaler value 16. */ - kEQDC_Prescaler32 = 5U, /*!< Prescaler value 32. */ - kEQDC_Prescaler64 = 6U, /*!< Prescaler value 64. */ - kEQDC_Prescaler128 = 7U, /*!< Prescaler value 128. */ - kEQDC_Prescaler256 = 8U, /*!< Prescaler value 256. */ - kEQDC_Prescaler512 = 9U, /*!< Prescaler value 512. */ - kEQDC_Prescaler1024 = 10U, /*!< Prescaler value 1024. */ - kEQDC_Prescaler2048 = 11U, /*!< Prescaler value 2048. */ - kEQDC_Prescaler4096 = 12U, /*!< Prescaler value 4096. */ - kEQDC_Prescaler8192 = 13U, /*!< Prescaler value 8192. */ - kEQDC_Prescaler16384 = 14U, /*!< Prescaler value 16384. */ - kEQDC_Prescaler32768 = 15U, /*!< Prescaler value 32768. */ -} eqdc_prescaler_t; - -/*! - * @brief Define user configuration structure for EQDC module. - */ -typedef struct _eqdc_config -{ - /* Basic counter. */ - bool enableReverseDirection; /*!< Enable reverse direction counting. */ - bool countOnce; /*!< Selects modulo loop or one shot counting mode. */ - - bool enableDma; /*!< Enable DMA for new written buffer values of COMPx/INIT/MOD(x range is 0-3) */ - bool bufferedRegisterLoadMode; /*!enableReverseDirection = false; - psConfig->countOnce = false; - psConfig->operateMode = kEQDC_QuadratureDecodeOperationMode; - psConfig->countMode = kEQDC_QuadratureX4; - psConfig->homeEnableInitPosCounterMode = kEQDC_HomeInitPosCounterDisabled; - psConfig->indexPresetInitPosCounterMode = kEQDC_IndexInitPosCounterDisabled; - psConfig->enableIndexInitPositionCounter = false; - psConfig->enableDma = false; - psConfig->bufferedRegisterLoadMode = false; - psConfig->enableTriggerInitPositionCounter = false; - psConfig->enableTriggerClearPositionRegisters = false; - psConfig->enableTriggerHoldPositionRegisters = false; - psConfig->enableWatchdog = false; - psConfig->watchdogTimeoutValue = 0xFFFFU; - psConfig->filterPhaseA = 0U; - psConfig->filterPhaseB = 0U; - psConfig->filterIndPre = 0U; - psConfig->filterHomEna = 0U; - psConfig->filterClockSourceselection = false; - psConfig->filterSampleCount = kEQDC_Filter3Samples; - psConfig->filterSamplePeriod = 0U; - psConfig->outputPulseMode = kEQDC_OutputPulseOnCounterEqualCompare; - psConfig->positionCompareValue[0] = 0xFFFFFFFFU; - psConfig->positionCompareValue[1] = 0xFFFFFFFFU; - psConfig->positionCompareValue[2] = 0xFFFFFFFFU; - psConfig->positionCompareValue[3] = 0xFFFFFFFFU; - psConfig->revolutionCountCondition = kEQDC_RevolutionCountOnIndexPulse; - psConfig->positionModulusValue = 0U; - psConfig->positionInitialValue = 0U; - psConfig->positionCounterValue = 0U; - psConfig->enablePeriodMeasurement = false; - psConfig->prescaler = kEQDC_Prescaler1; - psConfig->enabledInterruptsMask = 0U; - @endcode - * - * @param psConfig Pointer to configuration structure. - */ -void EQDC_GetDefaultConfig(eqdc_config_t *psConfig); - -/*! - * @brief De-initializes the EQDC module. - * - * This function deinitializes the EQDC by disabling the IP bus clock (optional). - * - * @param base EQDC peripheral base address. - */ -void EQDC_Deinit(EQDC_Type *base); - -/*! - * @brief Initializes the mode of operation. - * - * This function initializes mode of operation by enabling the IP bus clock (optional). - * - * @param base EQDC peripheral base address. - * @param operateMode Select operation mode. - */ -void EQDC_SetOperateMode(EQDC_Type *base, eqdc_operate_mode_t operateMode); - -/*! - * @brief Initializes the mode of count. - * - * These bits control the basic counting and behavior of Position Counter and Position Difference Counter. - * Setting CTRL[REV] to 1 can reverse the counting direction. - * 1.In quadrature Mode (CTRL[PH1] = 0): - * 00b - CM0: Normal/Reverse Quadrature X4 - * 01b - CM1: Normal/Reverse Quadrature X2 - * 10b - CM2: Normal/Reverse Quadrature X1 - * 11b - CM3: Reserved - * 2.In Single Phase Mode (CTRL[PH1] = 1): - * 00b - CM0: UP/DOWN Pulse Count Mode - * 01b - CM1: Signed Mode, count PHASEA rising/falling edge, position counter counts up when PHASEB - * is low and counts down when PHASEB is high - * 10b - CM2: Signed Count Mode,count PHASEA rising edge only, position counter counts up when - * PHASEB is low and counts down when PHASEB is high - * 11b - CM3: Reserved - * - * @param base EQDC peripheral base address. - * @param countMode Select count mode. - */ -static inline void EQDC_SetCountMode(EQDC_Type *base, eqdc_count_mode_t countMode) -{ - base->CTRL2 = (base->CTRL2 & (uint16_t)(~EQDC_CTRL2_CMODE_MASK)) | EQDC_CTRL2_CMODE(countMode); -} - -/*! @} */ - -/*! - * @name Watchdog - * @{ - */ - -/*! - * @brief Enable watchdog for EQDC module. - * - * @param base EQDC peripheral base address - * @param bEnable Enables or disables the watchdog - */ -static inline void EQDC_EnableWatchdog(EQDC_Type *base, bool bEnable) -{ - if (bEnable) - { - base->CTRL = (base->CTRL & (~EQDC_CTRL_W1C_FLAGS)) | EQDC_CTRL_WDE_MASK; - } - else - { - base->CTRL = (base->CTRL & (~(EQDC_CTRL_W1C_FLAGS | EQDC_CTRL_WDE_MASK))); - } -} - -/*! - * @brief Set watchdog timeout value. - * - * @param base EQDC peripheral base address - * @param u16Timeout Number of clock cycles, plus one clock cycle that the - * watchdog timer counts before timing out - */ -static inline void EQDC_SetWatchdogTimeout(EQDC_Type *base, uint16_t u16Timeout) -{ - base->WTR = u16Timeout; -} - -/*! @} */ - -/*! - * @name DMA - * @{ - */ - -/*! - * @brief Enable DMA for EQDC module. - * - * @param base EQDC peripheral base address - * @param bEnable Enables or disables the DMA - */ -static inline void EQDC_EnableDMA(EQDC_Type *base, bool bEnable) -{ - if (bEnable) - { - base->CTRL |= EQDC_CTRL_DMAEN_MASK; - } - else - { -#if (defined(FSL_FEATURE_EQDC_HAS_ERRATA_051383) && FSL_FEATURE_EQDC_HAS_ERRATA_051383) - /* Quadrature decoder CTRL[DMAEN] bit can not be cleared except do EQDC reset*/ - assert(false); -#else - base->CTRL &= ~EQDC_CTRL_DMAEN_MASK; -#endif - } -} - -/*! @} */ - -/*! - * @name Double-set Registers Loading Operation - * @{ - */ - -/*! - * @brief Set Buffered Register Load (Update) Mode. - * - * This bit selects the loading time point of the buffered compare registers UCOMPx/LCOMPx, x=0~3, - * initial register (UINIT/LINIT), and modulus register (UMOD/LMOD). - * Buffered registers are loaded and take effect at the next roll-over or roll-under if CTRL[LDOK] is set. - * - * @param base EQDC peripheral base address - */ -static inline void EQDC_SetBufferedRegisterLoadUpdateMode(EQDC_Type *base) -{ - base->CTRL2 |= EQDC_CTRL2_LDMOD_MASK; -} - -/*! - * @brief Clear Buffered Register Load (Update) Mode. - * - * Buffered Register Load (Update) Mode bit selects the loading time point of the buffered compare registers - * UCOMPx/LCOMPx, x=0~3, initial register (UINIT/LINIT), and modulus register (UMOD/LMOD). Buffered registers are loaded - * and take effect immediately upon CTRL[LDOK] is set. - * - * @param base EQDC peripheral base address - */ -static inline void EQDC_ClearBufferedRegisterLoadUpdateMode(EQDC_Type *base) -{ - base->CTRL2 &= ~EQDC_CTRL2_LDMOD_MASK; -} - -/*! - * @brief Set load okay. - * - * Load okay enables that the outer-set values of buffered compare registers (UCOMPx/LCOMPx, x=0~3), - * initial register(UINIT/LINIT) and modulus register(UMOD/LMOD) can be loaded into their inner-sets and - * take effect. - * When LDOK is set, this loading action occurs at the next position counter roll-over or roll-under if - * CTRL2[LDMOD] is set, or it occurs immediately if CTRL2[LDMOD] is cleared. LDOK is automatically - * cleared after the values in outer-set is loaded into the inner-set. - * - * @param base EQDC peripheral base address. - */ -static inline void EQDC_SetEqdcLdok(EQDC_Type *base) -{ - base->CTRL |= EQDC_CTRL_LDOK_MASK; -} - -/*! - * @brief Get load okay. - * - * @param base EQDC peripheral base address. - */ -static inline uint8_t EQDC_GetEqdcLdok(EQDC_Type *base) -{ - return base->CTRL & EQDC_CTRL_LDOK_MASK; -} - -/*! - * @brief Clear load okay. - * - * @param base EQDC peripheral base address. - */ -static inline void EQDC_ClearEqdcLdok(EQDC_Type *base) -{ - base->CTRL &= ~EQDC_CTRL_LDOK_MASK; -} - -/*! @} */ - -/*! - * @name Status - * @{ - */ -/*! - * @brief Get the status flags. - * - * @param base EQDC peripheral base address. - * - * @return Logical OR'ed value of the status flags, @ref _eqdc_status_flags. - */ -static inline uint32_t EQDC_GetStatusFlags(EQDC_Type *base) -{ - uint32_t u32Flags = 0U; - - u32Flags = (uint32_t)(base->CTRL) & EQDC_CTRL_INT_FLAGS; - - u32Flags |= ((uint32_t)(base->INTCTRL) & EQDC_INTCTRL_INT_FLAGS) << 16; - return u32Flags; -} - -/*! - * @brief Clear the status flags. - * - * @param base EQDC peripheral base address. - * @param u32Flags Logical OR'ed value of the flags to clear, @ref _eqdc_status_flags. - */ -static inline void EQDC_ClearStatusFlags(EQDC_Type *base, uint32_t u32Flags) -{ - if (0U != (u32Flags & EQDC_CTRL_INT_FLAGS)) - { - base->CTRL = (base->CTRL & (~EQDC_CTRL_W1C_FLAGS)) | (u32Flags & EQDC_CTRL_INT_FLAGS); - } - - if (0U != ((u32Flags >> 16) & EQDC_INTCTRL_INT_FLAGS)) - { - base->INTCTRL = (base->INTCTRL & (~EQDC_INTCTRL_W1C_FLAGS)) | ((u32Flags >> 16) & EQDC_INTCTRL_INT_FLAGS); - } -} - -/*! - * @brief Get the signals' real-time status. - * - * @param base EQDC peripheral base address. - * @return Logical OR'ed value of the real-time signal status, @ref _eqdc_signal_status. - */ -static inline uint16_t EQDC_GetSignalStatusFlags(EQDC_Type *base) -{ - return base->IMR; -} - -/*! - * @brief Get the direction of the last count. - * - * @param base EQDC peripheral base address. - * @return Direction of the last count. - */ -static inline eqdc_count_direction_flag_t EQDC_GetLastCountDirection(EQDC_Type *base) -{ - return ((0U != (base->IMR & EQDC_IMR_DIR_MASK)) ? kEQDC_CountDirectionUp : kEQDC_CountDirectionDown); -} -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enable the interrupts. - * - * @param base EQDC peripheral base address. - * @param u32Interrupts Logical OR'ed value of the interrupts, @ref _eqdc_interrupt_enable. - */ -static inline void EQDC_EnableInterrupts(EQDC_Type *base, uint32_t u32Interrupts) -{ - if (0U != (u32Interrupts & EQDC_CTRL_INT_EN)) - { - base->CTRL = (base->CTRL & (~EQDC_CTRL_W1C_FLAGS)) | (u32Interrupts & EQDC_CTRL_INT_EN); - } - - if (0U != ((u32Interrupts >> 16) & EQDC_INTCTRL_INT_EN)) - { - base->INTCTRL = (base->INTCTRL & (~EQDC_INTCTRL_W1C_FLAGS)) | ((u32Interrupts >> 16) & EQDC_INTCTRL_INT_EN); - } -} - -/*! - * @brief Disable the interrupts. - * - * @param base EQDC peripheral base address. - * @param u32Interrupts Logical OR'ed value of the interrupts, @ref _eqdc_interrupt_enable. - */ -static inline void EQDC_DisableInterrupts(EQDC_Type *base, uint32_t u32Interrupts) -{ - if (0U != (u32Interrupts & EQDC_CTRL_INT_EN)) - { - base->CTRL = (base->CTRL & (~EQDC_CTRL_W1C_FLAGS)) & (~(u32Interrupts & EQDC_CTRL_INT_EN)); - } - - if (0U != ((u32Interrupts >> 16) & EQDC_INTCTRL_INT_EN)) - { - base->INTCTRL = (base->INTCTRL & (~EQDC_INTCTRL_W1C_FLAGS)) & (~((u32Interrupts >> 16) & EQDC_INTCTRL_INT_EN)); - } -} - -/*! @} */ - -/*! - * @name Counter Operation - * @{ - */ - -/*! - * @brief Load the initial position value to position counter. - * - * Software trigger to load the initial position value (UINIT and LINIT) contents - * to position counter (UPOS and LPOS), so that to provide the consistent - * operation the position counter registers. - * - * @param base EQDC peripheral base address. - */ -static inline void EQDC_DoSoftwareLoadInitialPositionValue(EQDC_Type *base) -{ - base->CTRL = (base->CTRL & (~EQDC_CTRL_W1C_FLAGS)) | EQDC_CTRL_SWIP_MASK; -} - -/*! - * @brief Set initial position value for EQDC module. - * - * Set the position counter initial value (UINIT, LINIT). - * After writing values to the UINIT and LINIT registers, the values are "buffered" into outer-set - * registers temporarily. Values will be loaded into inner-set registers and take effect using - * the following two methods: - * 1. If CTRL2[LDMODE] is 1, "buffered" values are loaded into inner-set and take effect - * at the next roll-over or roll-under if CTRL[LDOK] is set. - * 2. If CTRL2[LDMODE] is 0, "buffered" values are loaded into inner-set and take effect - * immediately when CTRL[LDOK] is set. - * - * @param base EQDC peripheral base address - * @param u32PositionInitValue Position initial value - */ -static inline void EQDC_SetInitialPositionValue(EQDC_Type *base, uint32_t u32PositionInitValue) -{ - base->UINIT = (uint16_t)(u32PositionInitValue >> 16U); - base->LINIT = (uint16_t)(u32PositionInitValue); -} - -/*! - * @brief Set position counter value. - * - * Set the position counter value (POS or UPOS, LPOS). - * - * @param base EQDC peripheral base address - * @param positionCounterValue Position counter value - */ -static inline void EQDC_SetPositionCounterValue(EQDC_Type *base, uint32_t positionCounterValue) -{ - base->UPOS = (uint16_t)(positionCounterValue >> 16U); - base->LPOS = (uint16_t)(positionCounterValue); -} - -/*! - * @brief Set position counter modulus value. - * - * Set the position counter modulus value (UMOD, LMOD). - * After writing values to the UMOD and LMOD registers, the values are "buffered" into outer-set - * registers temporarily. Values will be loaded into inner-set registers and take effect using - * the following two methods: - * 1. If CTRL2[LDMODE] is 1, "buffered" values are loaded into inner-set and take effect - * at the next roll-over or roll-under if CTRL[LDOK] is set. - * 2. If CTRL2[LDMODE] is 0, "buffered" values are loaded into inner-set and take effect - * immediately when CTRL[LDOK] is set. - * - * @param base EQDC peripheral base address - * @param positionModulusValue Position modulus value - */ -static inline void EQDC_SetPositionModulusValue(EQDC_Type *base, uint32_t positionModulusValue) -{ - base->UMOD = (uint16_t)(positionModulusValue >> 16U); - base->LMOD = (uint16_t)(positionModulusValue); -} - -/*! - * @brief Set position counter compare 0 value. - * - * Set the position counter compare 0 value (UCOMP0, LCOMP0). - * After writing values to the UCOMP0 and LCOMP0 registers, the values are "buffered" into outer-set - * registers temporarily. Values will be loaded into inner-set registers and take effect using - * the following two methods: - * 1. If CTRL2[LDMODE] is 1, "buffered" values are loaded into inner-set and take effect - * at the next roll-over or roll-under if CTRL[LDOK] is set. - * 2. If CTRL2[LDMODE] is 0, "buffered" values are loaded into inner-set and take effect - * immediately when CTRL[LDOK] is set. - * - * @param base EQDC peripheral base address - * @param u32PositionComp0Value Position modulus value - */ -static inline void EQDC_SetPositionCompare0Value(EQDC_Type *base, uint32_t u32PositionComp0Value) -{ - base->UCOMP0 = (uint16_t)(u32PositionComp0Value >> 16U); - base->LCOMP0 = (uint16_t)(u32PositionComp0Value); -} - -/*! - * @brief Set position counter compare 1 value. - * - * Set the position counter compare 1 value (UCOMP1, LCOMP1). - * After writing values to the UCOMP1 and LCOMP1 registers, the values are "buffered" into outer-set - * registers temporarily. Values will be loaded into inner-set registers and take effect using - * the following two methods: - * 1. If CTRL2[LDMODE] is 1, "buffered" values are loaded into inner-set and take effect - * at the next roll-over or roll-under if CTRL[LDOK] is set. - * 2. If CTRL2[LDMODE] is 0, "buffered" values are loaded into inner-set and take effect - * immediately when CTRL[LDOK] is set. - * - * @param base EQDC peripheral base address - * @param u32PositionComp1Value Position modulus value - */ -static inline void EQDC_SetPositionCompare1Value(EQDC_Type *base, uint32_t u32PositionComp1Value) -{ - base->UCOMP1 = (uint16_t)(u32PositionComp1Value >> 16U); - base->LCOMP1 = (uint16_t)(u32PositionComp1Value); -} - -/*! - * @brief Set position counter compare 2 value. - * - * Set the position counter compare 2 value (UCOMP2, LCOMP2). - * After writing values to the UCOMP2 and LCOMP2 registers, the values are "buffered" into outer-set - * registers temporarily. Values will be loaded into inner-set registers and take effect using - * the following two methods: - * 1. If CTRL2[LDMODE] is 1, "buffered" values are loaded into inner-set and take effect - * at the next roll-over or roll-under if CTRL[LDOK] is set. - * 2. If CTRL2[LDMODE] is 0, "buffered" values are loaded into inner-set and take effect - * immediately when CTRL[LDOK] is set. - * - * @param base EQDC peripheral base address - * @param u32PositionComp2Value Position modulus value - */ -static inline void EQDC_SetPositionCompare2Value(EQDC_Type *base, uint32_t u32PositionComp2Value) -{ - base->UCOMP2 = (uint16_t)(u32PositionComp2Value >> 16U); - base->LCOMP2 = (uint16_t)(u32PositionComp2Value); -} - -/*! - * @brief Set position counter compare 3 value. - * - * Set the position counter compare 3 value (UCOMP3, LCOMP3). - * After writing values to the UCOMP3 and LCOMP3 registers, the values are "buffered" into outer-set - * registers temporarily. Values will be loaded into inner-set registers and take effect using - * the following two methods: - * 1. If CTRL2[LDMODE] is 1, "buffered" values are loaded into inner-set and take effect - * at the next roll-over or roll-under if CTRL[LDOK] is set. - * 2. If CTRL2[LDMODE] is 0, "buffered" values are loaded into inner-set and take effect - * immediately when CTRL[LDOK] is set. - * - * @param base EQDC peripheral base address - * @param u32PositionComp3Value Position modulus value - */ -static inline void EQDC_SetPositionCompare3Value(EQDC_Type *base, uint32_t u32PositionComp3Value) -{ - base->UCOMP3 = (uint16_t)(u32PositionComp3Value >> 16U); - base->LCOMP3 = (uint16_t)(u32PositionComp3Value); -} - -/*! - * @brief Get the current position counter's value. - * - * @param base EQDC peripheral base address. - * - * @return Current position counter's value. - */ -static inline uint32_t EQDC_GetPosition(EQDC_Type *base) -{ - uint32_t u32Pos; - - u32Pos = base->UPOS; /* Get upper 16 bits and make a snapshot. */ - u32Pos <<= 16U; - u32Pos |= base->LPOSH; /* Get lower 16 bits from hold register. */ - - return u32Pos; -} - -/*! - * @brief Get the hold position counter's value. - * - * The position counter (POS or UPOS, LPOS) value is loaded to hold position (POSH or UPOSH, LPOSH) - * when: - * 1. Position register (POS or UPOS, LPOS), or position difference register (POSD), - * or revolution register (REV) is read. - * 2. TRIGGER happens and TRIGGER is enabled to update the hold registers. - * - * @param base EQDC peripheral base address. - * @return Hold position counter's value. - */ -static inline uint32_t EQDC_GetHoldPosition(EQDC_Type *base) -{ - uint32_t u32Pos; - - u32Pos = base->UPOSH; /* Get upper 16 bits from hold register. */ - u32Pos <<= 16U; - u32Pos |= base->LPOSH; /* Get lower 16 bits from hold register. */ - - return u32Pos; -} - -/*! - * @brief Get the hold position counter1's value. - * - * The Upper Position Counter Hold Register 1(UPOSH1) shares the same address with UCOMP1. - * When read, this register means the value of UPOSH1, which is the upper 16 bits of POSH1. - * The Lower Position Counter Hold Register 1(LPOSH1) shares the same address with LCOMP1. - * When read, this register means the value of LPOSH1, which is the lower 16 bits of POSH1. - * Position counter is captured into POSH1 on the rising edge of ICAP[1]. - * - * @param base EQDC peripheral base address. - * @return Hold position counter1's value. - */ -static inline uint32_t EQDC_GetHoldPosition1(EQDC_Type *base) -{ - uint32_t u32Pos; - - u32Pos = base->UPOSH1; /* Get upper 16 bits from hold register. */ - u32Pos <<= 16U; - u32Pos |= base->LPOSH1; /* Get lower 16 bits from hold register. */ - - return u32Pos; -} - -/*! - * @brief Get the hold position counter2's value. - * - * The Upper Position Counter Hold Register 2(UPOSH2) shares the same address with UCOMP2. - * When read,this register means the value of UPOSH2, which is the upper 16 bits of POSH2. - * The Lower Position Counter Hold Register 2(LPOSH2) shares the same address with LCOMP2. - * When read, this register means the value of LPOSH2, which is the lower 16 bits of POSH2. - * Position counter is captured into POSH2 on the rising edge of ICAP[2]. - * - * @param base EQDC peripheral base address. - * @return Hold position counter2's value. - */ -static inline uint32_t EQDC_GetHoldPosition2(EQDC_Type *base) -{ - uint32_t u32Pos; - - u32Pos = base->UPOSH2; /* Get upper 16 bits from hold register. */ - u32Pos <<= 16U; - u32Pos |= base->LPOSH2; /* Get lower 16 bits from hold register. */ - - return u32Pos; -} - -/*! - * @brief Get the hold position counter3's value. - * - * The Upper Position Counter Hold Register 3(UPOSH3) shares the same address with UCOMP3. - * When read,this register means the value of UPOSH3, which is the upper 16 bits of POSH3. - * The Lower Position Counter Hold Register 3(LPOSH3) shares the same address with LCOMP3. - * When read, this register means the value of LPOSH3, which is the lower 16 bits of POSH3. - * Position counter is captured into POSH3 on the rising edge of ICAP[3]. - * - * @param base EQDC peripheral base address. - * @return Hold position counter3's value. - */ -static inline uint32_t EQDC_GetHoldPosition3(EQDC_Type *base) -{ - uint32_t u32Pos; - - u32Pos = base->UPOSH3; /* Get upper 16 bits from hold register. */ - u32Pos <<= 16U; - u32Pos |= base->LPOSH3; /* Get lower 16 bits from hold register. */ - - return u32Pos; -} - -/*! - * @brief Get the position difference counter's value. - * - * @param base EQDC peripheral base address. - * @return The position difference counter's value. - */ -static inline uint16_t EQDC_GetPositionDifference(EQDC_Type *base) -{ - return base->POSD; -} - -/*! - * @brief Get the hold position difference counter's value. - * - * The position difference (POSD) value is loaded to hold position difference (POSDH) - * when: - * 1. Position register (POS or UPOS, LPOS), or position difference register (POSD), - * or revolution register (REV) is read. When Period Measurement is enabled (CTRL3[PMEN] = 1), - * POSDH will only be udpated when reading POSD. - * 2. TRIGGER happens and TRIGGER is enabled to update the hold registers. - * - * @param base EQDC peripheral base address. - * @return Hold position difference counter's value. - */ -static inline uint16_t EQDC_GetHoldPositionDifference(EQDC_Type *base) -{ - return base->POSDH; -} - -/*! - * @brief Get the revolution counter's value. - * - * Get the revolution counter (REV) value. - * - * @param base EQDC peripheral base address. - * @return The revolution counter's value. - */ -static inline uint16_t EQDC_GetRevolution(EQDC_Type *base) -{ - return base->REV; -} - -/*! - * @brief Get the hold revolution counter's value. - * - * The revolution counter (REV) value is loaded to hold revolution (REVH) - * when: - * 1. Position register (POS or UPOS, LPOS), or position difference register (POSD), - * or revolution register (REV) is read. - * 2. TRIGGER happens and TRIGGER is enabled to update the hold registers. - * - * @param base EQDC peripheral base address. - * @return Hold position revolution counter's value. - */ -static inline uint16_t EQDC_GetHoldRevolution(EQDC_Type *base) -{ - return base->REVH; -} - -/*! - * @brief Get the last edge time. - * - * Last edge time (LASTEDGE) is the time since the last edge occurred on PHASEA or PHASEB. - * The last edge time register counts up using the peripheral clock after prescaler. - * Any edge on PHASEA or PHASEB will reset this register to 0 and start counting. - * If the last edge timer count reaches 0xffff, the counting will stop in order to - * prevent an overflow.Counting will continue when an edge occurs on - * PHASEA or PHASEB. - * - * @param base EQDC peripheral base address. - * - * @return The last edge time. - */ -static inline uint16_t EQDC_GetLastEdgeTime(EQDC_Type *base) -{ - return base->LASTEDGE; -} - -/*! - * @brief Get the hold last edge time. - * - * The hold of last edge time(LASTEDGEH) is update to last edge time(LASTEDGE) - * when the position difference register register (POSD) is read. - * - * @param base EQDC peripheral base address. - * @return Hold of last edge time. - */ -static inline uint16_t EQDC_GetHoldLastEdgeTime(EQDC_Type *base) -{ - return base->LASTEDGEH; -} - -/*! - * @brief Get the Position Difference Period counter value - * - * The Position Difference Period counter (POSDPER) counts up using the - * prescaled peripheral clock. When reading the position difference register(POSD), - * the last edge time (LASTEDGE) will be loaded to position difference period counter(POSDPER). - * If the POSDPER count reaches 0xffff, the counting will stop in order to prevent an - * overflow. Counting will continue when an edge occurs on PHASEA or PHASEB. - * - * @param base EQDC peripheral base address. - * @return The position difference period counter value. - */ -static inline uint16_t EQDC_GetPositionDifferencePeriod(EQDC_Type *base) -{ - return base->POSDPER; -} - -/*! - * @brief Get buffered Position Difference Period counter value - * - * The Bufferd Position Difference Period (POSDPERBFR) value is updated with - * the position difference period counter(POSDPER) when any edge occurs - * on PHASEA or PHASEB. - * - * @param base EQDC peripheral base address. - * @return The buffered position difference period counter value. - */ -static inline uint16_t EQDC_GetBufferedPositionDifferencePeriod(EQDC_Type *base) -{ - return base->POSDPERBFR; -} - -/*! - * @brief Get Hold Position Difference Period counter value - * - * The hold position difference period(POSDPERH) is updated with the value of - * buffered position difference period(POSDPERBFR) when the - * position difference(POSD) register is read. - * - * @param base EQDC peripheral base address. - * @return The hold position difference period counter value. - */ -static inline uint16_t EQDC_GetHoldPositionDifferencePeriod(EQDC_Type *base) -{ - return base->POSDPERH; -} - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ -#endif /* FSL_EQDC_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_erm.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_erm.c deleted file mode 100644 index cdd35b56b09..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_erm.c +++ /dev/null @@ -1,317 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_erm.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.erm" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to ERM bases for each instance. */ -static ERM_Type *const s_ermBases[] = ERM_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to ERM clocks for each instance. */ -static const clock_ip_name_t s_ermClocks[] = ERM_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t ERM_GetInstance(ERM_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_ermBases); instance++) - { - if (s_ermBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_ermBases)); - - return instance; -} - -/*! - * brief ERM module initialization function. - * - * param base ERM base address. - */ -void ERM_Init(ERM_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate ERM clock. */ - CLOCK_EnableClock(s_ermClocks[ERM_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - base->CR0 = 0x00U; -#ifdef ERM_CR1_ENCIE8_MASK - base->CR1 = 0x00U; -#endif - base->SR0 = 0xFFFFFFFFU; -#ifdef ERM_SR1_SBC8_MASK - base->SR1 = 0xFFFFFFFFU; -#endif -} - -/*! - * brief Deinitializes the ERM. - * - */ -void ERM_Deinit(ERM_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate ERM clock. */ - CLOCK_DisableClock(s_ermClocks[ERM_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -uint32_t ERM_GetMemoryErrorAddr(ERM_Type *base, erm_memory_channel_t channel) -{ - uint32_t absoluteErrorAddress = 0x00U; - - switch ((uint8_t)channel) - { - case 0U: - absoluteErrorAddress = base->EAR0; - break; -#ifdef ERM_EAR1_EAR_MASK - case 1U: - absoluteErrorAddress = base->EAR1; - break; -#endif -#ifdef ERM_EAR2_EAR_MASK - case 2U: - absoluteErrorAddress = base->EAR2; - break; -#endif -#ifdef ERM_EAR3_EAR_MASK - case 3U: - absoluteErrorAddress = base->EAR3; - break; -#endif -#ifdef ERM_EAR4_EAR_MASK - case 4U: - absoluteErrorAddress = base->EAR4; - break; -#endif -#ifdef ERM_EAR5_EAR_MASK - case 5U: - absoluteErrorAddress = base->EAR5; - break; -#endif -#ifdef ERM_EAR6_EAR_MASK - case 6U: - absoluteErrorAddress = base->EAR6; - break; -#endif - default: - assert(NULL); - break; - } - - return absoluteErrorAddress; -} - -uint32_t ERM_GetSyndrome(ERM_Type *base, erm_memory_channel_t channel) -{ - uint32_t syndrome = 0x00U; - - switch ((uint8_t)channel) - { - case 0U: - syndrome = (base->SYN0 & ERM_SYN0_SYNDROME_MASK) >> ERM_SYN0_SYNDROME_SHIFT; - break; -#ifdef ERM_SYN1_SYNDROME_MASK - case 1U: - syndrome = (base->SYN1 & ERM_SYN1_SYNDROME_MASK) >> ERM_SYN1_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN2_SYNDROME_MASK - case 2U: - syndrome = (base->SYN2 & ERM_SYN2_SYNDROME_MASK) >> ERM_SYN2_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN3_SYNDROME_MASK - case 3U: - syndrome = (base->SYN3 & ERM_SYN3_SYNDROME_MASK) >> ERM_SYN3_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN4_SYNDROME_MASK - case 4U: - syndrome = (base->SYN4 & ERM_SYN4_SYNDROME_MASK) >> ERM_SYN4_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN5_SYNDROME_MASK - case 5U: - syndrome = (base->SYN5 & ERM_SYN5_SYNDROME_MASK) >> ERM_SYN5_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN6_SYNDROME_MASK - case 6U: - syndrome = (base->SYN6 & ERM_SYN6_SYNDROME_MASK) >> ERM_SYN6_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN7_SYNDROME_MASK - case 7U: - syndrome = (base->SYN7 & ERM_SYN6_SYNDROME_MASK) >> ERM_SYN7_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN8_SYNDROME_MASK - case 8U: - syndrome = (base->SYN8 & ERM_SYN8_SYNDROME_MASK) >> ERM_SYN8_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN9_SYNDROME_MASK - case 8U: - syndrome = (base->SYN9 & ERM_SYN9_SYNDROME_MASK) >> ERM_SYN9_SYNDROME_SHIFT; - break; -#endif - default: - assert(NULL); - break; - } - - return syndrome; -} - -uint32_t ERM_GetErrorCount(ERM_Type *base, erm_memory_channel_t channel) -{ - uint32_t count = 0x00U; - - switch ((uint8_t)channel) - { - case 0U: - count = (base->CORR_ERR_CNT0 & ERM_CORR_ERR_CNT0_COUNT_MASK) >> ERM_CORR_ERR_CNT0_COUNT_SHIFT; - break; -#ifdef ERM_CORR_ERR_CNT1_COUNT_MASK - case 1U: - count = (base->CORR_ERR_CNT1 & ERM_CORR_ERR_CNT1_COUNT_MASK) >> ERM_CORR_ERR_CNT1_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT2_COUNT_MASK - case 2U: - count = (base->CORR_ERR_CNT2 & ERM_CORR_ERR_CNT2_COUNT_MASK) >> ERM_CORR_ERR_CNT2_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT3_COUNT_MASK - case 3U: - count = (base->CORR_ERR_CNT3 & ERM_CORR_ERR_CNT3_COUNT_MASK) >> ERM_CORR_ERR_CNT3_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT4_COUNT_MASK - case 4U: - count = (base->CORR_ERR_CNT4 & ERM_CORR_ERR_CNT4_COUNT_MASK) >> ERM_CORR_ERR_CNT4_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT5_COUNT_MASK - case 5U: - count = (base->CORR_ERR_CNT5 & ERM_CORR_ERR_CNT5_COUNT_MASK) >> ERM_CORR_ERR_CNT5_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT6_COUNT_MASK - case 6U: - count = (base->CORR_ERR_CNT6 & ERM_CORR_ERR_CNT6_COUNT_MASK) >> ERM_CORR_ERR_CNT6_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT7_COUNT_MASK - case 7U: - count = (base->CORR_ERR_CNT7 & ERM_CORR_ERR_CNT7_COUNT_MASK) >> ERM_CORR_ERR_CNT7_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT8_COUNT_MASK - case 8U: - count = (base->CORR_ERR_CNT8 & ERM_CORR_ERR_CNT8_COUNT_MASK) >> ERM_CORR_ERR_CNT8_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT9_COUNT_MASK - case 9U: - count = (base->CORR_ERR_CNT9 & ERM_CORR_ERR_CNT9_COUNT_MASK) >> ERM_CORR_ERR_CNT9_COUNT_SHIFT; - break; -#endif - default: - assert(NULL); - break; - } - - return count; -} - -void ERM_ResetErrorCount(ERM_Type *base, erm_memory_channel_t channel) -{ - switch ((uint8_t)channel) - { - case 0U: - base->CORR_ERR_CNT0 = 0x00U; - break; - -#ifdef ERM_CORR_ERR_CNT1_COUNT_MASK - case 1U: - base->CORR_ERR_CNT1 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT2_COUNT_MASK - case 2U: - base->CORR_ERR_CNT2 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT3_COUNT_MASK - case 3U: - base->CORR_ERR_CNT3 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT4_COUNT_MASK - case 4U: - base->CORR_ERR_CNT4 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT5_COUNT_MASK - case 5U: - base->CORR_ERR_CNT5 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT6_COUNT_MASK - case 6U: - base->CORR_ERR_CNT6 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT6_COUNT_MASK - case 7U: - base->CORR_ERR_CNT7 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT8_COUNT_MASK - case 8U: - base->CORR_ERR_CNT8 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT9_COUNT_MASK - case 9U: - base->CORR_ERR_CNT9 = 0x00U; - break; -#endif - default: - assert(NULL); - break; - } -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_erm.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_erm.h deleted file mode 100644 index 45303523e76..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_erm.h +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_ERM_H_ -#define FSL_ERM_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup erm - * @{ - */ - -/****************************************************************************** - * Definitions. - *****************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief Driver version. */ -#define FSL_ERM_DRIVER_VERSION (MAKE_VERSION(2U, 0U, 1U)) -/*! @} */ - -/*! - * @brief ERM interrupt configuration structure, default settings all disabled, _erm_interrupt_enable. - * - * This structure contains the settings for all of the ERM interrupt configurations. - */ -enum -{ - kERM_SingleCorrectionIntEnable = 0x08U, /*!< Single Correction Interrupt Notification enable.*/ - kERM_NonCorrectableIntEnable = 0x04U, /*!< Non-Correction Interrupt Notification enable.*/ - - kERM_AllInterruptsEnable = 0xFFFFFFFFUL, /*!< All Interrupts enable */ -}; - -/*! - * @brief ERM interrupt status, _erm_interrupt_flag. - * - * This provides constants for the ERM event status for use in the ERM functions. - */ -enum -{ - kERM_SingleBitCorrectionIntFlag = 0x08U, /*!< Single-Bit Correction Event.*/ - kERM_NonCorrectableErrorIntFlag = 0x04U, /*!< Non-Correctable Error Event.*/ - - kERM_AllIntsFlag = 0xFFFFFFFFUL, /*!< All Events. */ -}; - -/******************************************************************************* - * APIs - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and de-initialization - * @{ - */ - -/*! - * @brief ERM module initialization function. - * - * @param base ERM base address. - */ -void ERM_Init(ERM_Type *base); - -/*! - * @brief De-initializes the ERM. - * - */ -void ERM_Deinit(ERM_Type *base); - -/*! @} */ - -/*! - * @name Interrupt - * @{ - */ -/*! - * @brief ERM enable interrupts. - * - * @param base ERM peripheral base address. - * @param channel memory channel. - * @param mask single correction interrupt or non-correction interrupt enable to disable for one specific memory region. - * Refer to "_erm_interrupt_enable" enumeration. - */ -static inline void ERM_EnableInterrupts(ERM_Type *base, erm_memory_channel_t channel, uint32_t mask) -{ - uint32_t temp = 0x00U; - if ((uint32_t)channel <= 0x07U) - { - temp = base->CR0; - base->CR0 = - (temp & ~(0x0CUL << ((0x07U - (uint32_t)channel) * 4U))) | (mask << ((0x07U - (uint32_t)channel) * 4U)); - } -#ifdef ERM_CR1_ESCIE8_MASK - else - { - temp = base->CR1; - base->CR1 = (temp & ~(0x0CUL << ((0x07U + 0x08U - (uint32_t)channel) * 4U))) | - (mask << ((0x07U + 0x08U - (uint32_t)channel) * 4U)); - } -#endif -} - -/*! - * @brief ERM module disable interrupts. - * - * @param base ERM base address. - * @param channel memory channel. - * @param mask single correction interrupt or non-correction interrupt enable to disable for one specific memory region. - * Refer to "_erm_interrupt_enable" enumeration. - */ -static inline void ERM_DisableInterrupts(ERM_Type *base, erm_memory_channel_t channel, uint32_t mask) -{ - if ((uint32_t)channel <= 0x07U) - { - base->CR0 &= ~(mask << ((0x07U - (uint32_t)channel) * 4U)); - } -#ifdef ERM_CR1_ESCIE8_MASK - else - { - base->CR1 &= ~(mask << ((0x07U + 0x08U - (uint32_t)channel) * 4U)); - } -#endif -} - -/*! - * @brief Gets ERM interrupt flags. - * - * @param base ERM peripheral base address. - * @return ERM event flags. - */ -static inline uint32_t ERM_GetInterruptStatus(ERM_Type *base, erm_memory_channel_t channel) -{ - if ((uint32_t)channel <= 0x07U) - { - return ((base->SR0 & (uint32_t)kERM_AllIntsFlag) >> (0x07U - (uint32_t)channel) * 4U); - } -#ifdef ERM_SR1_SBC8_MASK - else - { - return ((base->SR1 & (uint32_t)kERM_AllIntsFlag) >> ((0x07U + 0x08U - (uint32_t)channel) * 4U)); - } -#else - { - return 0; - } -#endif -} - -/*! - * @brief ERM module clear interrupt status flag. - * - * @param base ERM base address. - * @param mask event flag to clear. Refer to "_erm_interrupt_flag" enumeration. - */ -static inline void ERM_ClearInterruptStatus(ERM_Type *base, erm_memory_channel_t channel, uint32_t mask) -{ - if ((uint32_t)channel <= 0x07U) - { - base->SR0 = mask << ((0x07U - (uint32_t)channel) * 4U); - } -#ifdef ERM_SR1_SBC8_MASK - else - { - base->SR1 = mask << ((0x07U + 0x08U - (uint32_t)channel) * 4U); - } -#endif -} - -/*! @} */ - -/*! - * @name functional - * @{ - */ - -/*! - * @brief ERM get memory error absolute address, which capturing the address of the last ECC event in Memory n. - * - * @param base ERM base address. - * @param channel memory channel. - * @retval memory error absolute address. - */ - -uint32_t ERM_GetMemoryErrorAddr(ERM_Type *base, erm_memory_channel_t channel); - -/*! - * @brief ERM get syndrome, which identifies the pertinent bit position on a correctable, single-bit data inversion or a - * non-correctable, single-bit address inversion. The syndrome value does not provide any additional diagnostic - * information on non-correctable, multi-bit inversions. - * - * @param base ERM base address. - * @param channel memory channel. - * @retval syndrome value. - */ -uint32_t ERM_GetSyndrome(ERM_Type *base, erm_memory_channel_t channel); - -/*! - * @brief ERM get error count, which records the count value of the number of correctable ECC error events for Memory - * n. Non-correctable errors are considered a serious fault, so the ERM does not provide any mechanism to count - * non-correctable errors. Only correctable errors are counted. - * - * @param base ERM base address. - * @param channel memory channel. - * @retval error count. - */ -uint32_t ERM_GetErrorCount(ERM_Type *base, erm_memory_channel_t channel); - -/*! - * @brief ERM reset error count. - * - * @param base ERM base address. - * @param channel memory channel. - */ -void ERM_ResetErrorCount(ERM_Type *base, erm_memory_channel_t channel); - -/*! @}*/ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexcan.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexcan.c deleted file mode 100644 index 8717791e182..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexcan.c +++ /dev/null @@ -1,4927 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexcan.h" - -/* - * $Coverage Justification Reference$ - * - * $Justification flexcan_c_ref_1$ - * The FLEXCAN_ReadRxFifo() return fail only when Rx FIFO is diabled. But in IRQ handler, will first check whether the - * FIFO is enabled, and only call FLEXCAN_ReadRxFifo if the FIFO is enabled. So to cover this line/branch, need to - * interrupt the current execution by a high priority IRQ after confirming that the FIFO is enabled, and disabled the - * FIFO in the high priority interrupt. It is difficult to simulate this situation in unit test, so add Justification. - * - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexcan" -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_6032) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_6032) -#define RXINTERMISSION (CAN_DBG1_CFSM(0x2f)) -#define TXINTERMISSION (CAN_DBG1_CFSM(0x14)) -#define BUSIDLE (CAN_DBG1_CFSM(0x02)) -#define CBN_VALUE3 (CAN_DBG1_CBN(0x03)) -#define DELAY_BUSIDLE (200) -#endif - -/* According to CiA doc 1301 v1.0.0, specified data/nominal phase sample point postion for CAN FD at 80 MHz. */ -#define IDEAL_DATA_SP_1 (800U) -#define IDEAL_DATA_SP_2 (750U) -#define IDEAL_DATA_SP_3 (700U) -#define IDEAL_DATA_SP_4 (625U) -#define IDEAL_NOMINAL_SP (800U) - -/* According to CiA doc 301 v4.2.0 and previous version. */ -#define IDEAL_SP_LOW (750U) -#define IDEAL_SP_MID (800U) -#define IDEAL_SP_HIGH (875U) - -#define IDEAL_SP_FACTOR (1000U) - -/* Define the max value of bit timing segments when use different timing register. */ -#define MAX_PROPSEG (CAN_CTRL1_PROPSEG_MASK >> CAN_CTRL1_PROPSEG_SHIFT) -#define MAX_PSEG1 (CAN_CTRL1_PSEG1_MASK >> CAN_CTRL1_PSEG1_SHIFT) -#define MAX_PSEG2 (CAN_CTRL1_PSEG2_MASK >> CAN_CTRL1_PSEG2_SHIFT) -#define MAX_RJW (CAN_CTRL1_RJW_MASK >> CAN_CTRL1_RJW_SHIFT) -#define MAX_PRESDIV (CAN_CTRL1_PRESDIV_MASK >> CAN_CTRL1_PRESDIV_SHIFT) -#define CTRL1_MAX_TIME_QUANTA (1U + MAX_PROPSEG + 1U + MAX_PSEG1 + 1U + MAX_PSEG2 + 1U) -#define CTRL1_MIN_TIME_QUANTA (8U) - -#define MAX_EPROPSEG (CAN_CBT_EPROPSEG_MASK >> CAN_CBT_EPROPSEG_SHIFT) -#define MAX_EPSEG1 (CAN_CBT_EPSEG1_MASK >> CAN_CBT_EPSEG1_SHIFT) -#define MAX_EPSEG2 (CAN_CBT_EPSEG2_MASK >> CAN_CBT_EPSEG2_SHIFT) -#define MAX_ERJW (CAN_CBT_ERJW_MASK >> CAN_CBT_ERJW_SHIFT) -#define MAX_EPRESDIV (CAN_CBT_EPRESDIV_MASK >> CAN_CBT_EPRESDIV_SHIFT) -#define CBT_MAX_TIME_QUANTA (1U + MAX_EPROPSEG + 1U + MAX_EPSEG1 + 1U + MAX_EPSEG2 + 1U) -#define CBT_MIN_TIME_QUANTA (8U) - -#define MAX_FPROPSEG (CAN_FDCBT_FPROPSEG_MASK >> CAN_FDCBT_FPROPSEG_SHIFT) -#define MAX_FPSEG1 (CAN_FDCBT_FPSEG1_MASK >> CAN_FDCBT_FPSEG1_SHIFT) -#define MAX_FPSEG2 (CAN_FDCBT_FPSEG2_MASK >> CAN_FDCBT_FPSEG2_SHIFT) -#define MAX_FRJW (CAN_FDCBT_FRJW_MASK >> CAN_FDCBT_FRJW_SHIFT) -#define MAX_FPRESDIV (CAN_FDCBT_FPRESDIV_MASK >> CAN_FDCBT_FPRESDIV_SHIFT) -#define FDCBT_MAX_TIME_QUANTA (1U + MAX_FPROPSEG + 0U + MAX_FPSEG1 + 1U + MAX_FPSEG2 + 1U) -#define FDCBT_MIN_TIME_QUANTA (5U) - -#define MAX_TDCOFF ((uint32_t)CAN_FDCTRL_TDCOFF_MASK >> CAN_FDCTRL_TDCOFF_SHIFT) - -#define MAX_NTSEG1 (CAN_ENCBT_NTSEG1_MASK >> CAN_ENCBT_NTSEG1_SHIFT) -#define MAX_NTSEG2 (CAN_ENCBT_NTSEG2_MASK >> CAN_ENCBT_NTSEG2_SHIFT) -#define MAX_NRJW (CAN_ENCBT_NRJW_MASK >> CAN_ENCBT_NRJW_SHIFT) -#define MAX_ENPRESDIV (CAN_EPRS_ENPRESDIV_MASK >> CAN_EPRS_ENPRESDIV_SHIFT) -#define ENCBT_MAX_TIME_QUANTA (1U + MAX_NTSEG1 + 1U + MAX_NTSEG2 + 1U) -#define ENCBT_MIN_TIME_QUANTA (8U) - -#define MAX_DTSEG1 (CAN_EDCBT_DTSEG1_MASK >> CAN_EDCBT_DTSEG1_SHIFT) -#define MAX_DTSEG2 (CAN_EDCBT_DTSEG2_MASK >> CAN_EDCBT_DTSEG2_SHIFT) -#define MAX_DRJW (CAN_EDCBT_DRJW_MASK >> CAN_EDCBT_DRJW_SHIFT) -#define MAX_EDPRESDIV (CAN_EPRS_EDPRESDIV_MASK >> CAN_EPRS_EDPRESDIV_SHIFT) -#define EDCBT_MAX_TIME_QUANTA (1U + MAX_DTSEG1 + 1U + MAX_DTSEG2 + 1U) -#define EDCBT_MIN_TIME_QUANTA (5U) - -#define MAX_ETDCOFF ((uint32_t)CAN_ETDC_ETDCOFF_MASK >> CAN_ETDC_ETDCOFF_SHIFT) - -/* TSEG1 corresponds to the sum of xPROPSEG and xPSEG1, TSEG2 corresponds to the xPSEG2 value. */ -#define MIN_TIME_SEGMENT1 (2U) -#define MIN_TIME_SEGMENT2 (2U) - -/* Define maximum CAN and CAN FD bit rate supported by FLEXCAN. */ -#if (defined(FSL_FEATURE_FLEXCAN_MAX_CANFD_BITRATE)) -#define MAX_CANFD_BITRATE ((uint32_t)(FSL_FEATURE_FLEXCAN_MAX_CANFD_BITRATE)) -#else -#define MAX_CANFD_BITRATE (8000000U) -#endif -#define MAX_CAN_BITRATE (1000000U) - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_9595) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_9595) -#define CAN_ESR1_FLTCONF_BUSOFF CAN_ESR1_FLTCONF(2U) -#endif - -/* Define the range of memory that needs to be initialized when the device has memory error detection feature. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -#define CAN_INIT_RXFIR ((uintptr_t)base + 0x4Cu) -#define CAN_INIT_MEMORY_BASE_1 (uint32_t *)((uintptr_t)base + (uintptr_t)FSL_FEATURE_FLEXCAN_INIT_MEMORY_BASE_1) -#define CAN_INIT_MEMORY_SIZE_1 FSL_FEATURE_FLEXCAN_INIT_MEMORY_SIZE_1 -#define CAN_INIT_MEMORY_BASE_2 (uint32_t *)((uintptr_t)base + (uintptr_t)FSL_FEATURE_FLEXCAN_INIT_MEMORY_BASE_2) -#define CAN_INIT_MEMORY_SIZE_2 FSL_FEATURE_FLEXCAN_INIT_MEMORY_SIZE_2 -#endif - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#ifndef CAN_CLOCK_CHECK_NO_AFFECTS -/* If no define such MACRO, it mean that the CAN in current device have no clock affect issue. */ -#define CAN_CLOCK_CHECK_NO_AFFECTS (true) -#endif /* CAN_CLOCK_CHECK_NO_AFFECTS */ -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(FLEXCAN_RSTS) -#define FLEXCAN_RESETS_ARRAY FLEXCAN_RSTS -#elif defined(FLEXCAN_RSTS_N) -#define FLEXCAN_RESETS_ARRAY FLEXCAN_RSTS_N -#endif - -/*! @brief FlexCAN Internal State. */ -enum _flexcan_state -{ - kFLEXCAN_StateIdle = 0x0, /*!< MB/RxFIFO idle.*/ - kFLEXCAN_StateRxData = 0x1, /*!< MB receiving.*/ - kFLEXCAN_StateRxRemote = 0x2, /*!< MB receiving remote reply.*/ - kFLEXCAN_StateTxData = 0x3, /*!< MB transmitting.*/ - kFLEXCAN_StateTxRemote = 0x4, /*!< MB transmitting remote request.*/ - kFLEXCAN_StateRxFifo = 0x5, /*!< RxFIFO receiving.*/ -}; - -/*! @brief FlexCAN message buffer CODE for Rx buffers. */ -enum _flexcan_mb_code_rx -{ - kFLEXCAN_RxMbInactive = 0x0, /*!< MB is not active.*/ - kFLEXCAN_RxMbFull = 0x2, /*!< MB is full.*/ - kFLEXCAN_RxMbEmpty = 0x4, /*!< MB is active and empty.*/ - kFLEXCAN_RxMbOverrun = 0x6, /*!< MB is overwritten into a full buffer.*/ - kFLEXCAN_RxMbBusy = 0x8, /*!< FlexCAN is updating the contents of the MB, The CPU must not access the MB.*/ - kFLEXCAN_RxMbRanswer = 0xA, /*!< A frame was configured to recognize a Remote Request Frame and transmit a - Response Frame in return.*/ - kFLEXCAN_RxMbNotUsed = 0xF, /*!< Not used.*/ -}; - -/*! @brief FlexCAN message buffer CODE FOR Tx buffers. */ -enum _flexcan_mb_code_tx -{ - kFLEXCAN_TxMbInactive = 0x8, /*!< MB is not active.*/ - kFLEXCAN_TxMbAbort = 0x9, /*!< MB is aborted.*/ - kFLEXCAN_TxMbDataOrRemote = 0xC, /*!< MB is a TX Data Frame(when MB RTR = 0) or MB is a TX Remote Request - Frame (when MB RTR = 1).*/ - kFLEXCAN_TxMbTanswer = 0xE, /*!< MB is a TX Response Request Frame from an incoming Remote Request Frame.*/ - kFLEXCAN_TxMbNotUsed = 0xF, /*!< Not used.*/ -}; - -/* Typedef for interrupt handler. */ -typedef void (*flexcan_isr_t)(CAN_Type *base, flexcan_handle_t *handle); - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -#if !defined(NDEBUG) -/*! - * @brief Check if Message Buffer is occupied by Rx FIFO. - * - * This function check if Message Buffer is occupied by Rx FIFO. - * - * @param base FlexCAN peripheral base address. - * @param mbIdx The FlexCAN Message Buffer index. - * @return TRUE if the index MB is occupied by Rx FIFO, FALSE if the index MB not occupied by Rx FIFO. - */ -static bool FLEXCAN_IsMbOccupied(CAN_Type *base, uint8_t mbIdx); -#endif - -#if ((defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829)) -/*! - * @brief Get the first valid Message buffer ID of give FlexCAN instance. - * - * This function is a helper function for Errata 5641 workaround. - * - * @param base FlexCAN peripheral base address. - * @return The first valid Message Buffer Number. - */ -static uint8_t FLEXCAN_GetFirstValidMb(CAN_Type *base); -#endif - -/*! - * @brief Reset the FlexCAN Instance. - * - * Restores the FlexCAN module to reset state, notice that this function - * will set all the registers to reset state so the FlexCAN module can not work - * after calling this API. - * - * @param base FlexCAN peripheral base address. - */ -static void FLEXCAN_Reset(CAN_Type *base); - -/*! - * @brief Calculates the segment values for a single bit time for classical CAN. - * - * This function use to calculates the Classical CAN segment values which will be set in CTRL1/CBT/ENCBT register. - * - * @param base FlexCAN peripheral base address. - * @param tqNum Number of time quantas per bit, range in 8 ~ 25 when use CTRL1, range in 8 ~ 129 when use CBT, range in - * 8 ~ 385 when use ENCBT. param pTimingConfig Pointer to the FlexCAN timing configuration structure. - */ -static void FLEXCAN_GetSegments(CAN_Type *base, - uint32_t bitRate, - uint32_t tqNum, - flexcan_timing_config_t *pTimingConfig); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * @brief Get Mailbox offset number by dword. - * - * This function gets the offset number of the specified mailbox. - * Mailbox is not consecutive between memory regions when payload is not 8 bytes - * so need to calculate the specified mailbox address. - * For example, in the first memory region, MB[0].CS address is 0x4002_4080. For 32 bytes - * payload frame, the second mailbox is ((1/12)*512 + 1%12*40)/4 = 10, meaning 10 dword - * after the 0x4002_4080, which is actually the address of mailbox MB[1].CS. - * - * @param base FlexCAN peripheral base address. - * @param mbIdx Mailbox index. - */ -static uint32_t FLEXCAN_GetFDMailboxOffset(CAN_Type *base, uint8_t mbIdx); - -/*! - * @brief Calculates the segment values for a single bit time for CAN FD data phase. - * - * This function use to calculates the CAN FD data phase segment values which will be set in CFDCBT/EDCBT - * register. - * - * @param bitRateFD Data phase bit rate - * @param tqNum Number of time quanta per bit - * @param pTimingConfig Pointer to the FlexCAN timing configuration structure. - */ -static void FLEXCAN_FDGetSegments(uint32_t bitRateFD, uint32_t tqNum, flexcan_timing_config_t *pTimingConfig); - -/*! - * @brief Calculates the improved timing values by specific bit rate for CAN FD nominal phase. - * - * This function use to calculates the CAN FD nominal phase timing values according to the given nominal phase bit rate. - * The Calculated timing values will be set in CBT/ENCBT registers. The calculation is based on the recommendation of - * the CiA 1301 v1.0.0 document. - * - * @param bitRate The CAN FD nominal phase speed in bps defined by user, should be less than or equal to 1Mbps. - * @param sourceClock_Hz The Source clock frequency in Hz. - * @param pTimingConfig Pointer to the FlexCAN timing configuration structure. - * - * @return TRUE if timing configuration found, FALSE if failed to find configuration. - */ -static bool FLEXCAN_CalculateImprovedNominalTimingValues(uint32_t bitRate, - uint32_t sourceClock_Hz, - flexcan_timing_config_t *pTimingConfig); - -#endif - -/*! - * @brief Check unhandle interrupt events - * - * @param base FlexCAN peripheral base address. - * @return TRUE if unhandled interrupt action exist, FALSE if no unhandlered interrupt action exist. - */ -static bool FLEXCAN_CheckUnhandleInterruptEvents(CAN_Type *base); - -/*! - * @brief Sub Handler Data Trasfered Events - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param pResult Pointer to the Handle result. - * - * @return the status after handle each data transfered event. - */ -static status_t FLEXCAN_SubHandlerForDataTransfered(CAN_Type *base, flexcan_handle_t *handle, uint32_t *pResult); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * @brief Sub Handler Ehanced Rx FIFO event - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param flags FlexCAN interrupt flags. - * - * @return the status after handle Ehanced Rx FIFO event. - */ -static status_t FLEXCAN_SubHandlerForEhancedRxFifo(CAN_Type *base, flexcan_handle_t *handle, uint64_t flags); -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/* Array of FlexCAN peripheral base address. */ -static CAN_Type *const s_flexcanBases[] = CAN_BASE_PTRS; - -/* Array of FlexCAN IRQ number. */ -static const IRQn_Type s_flexcanRxWarningIRQ[] = CAN_Rx_Warning_IRQS; -static const IRQn_Type s_flexcanTxWarningIRQ[] = CAN_Tx_Warning_IRQS; -static const IRQn_Type s_flexcanWakeUpIRQ[] = CAN_Wake_Up_IRQS; -static const IRQn_Type s_flexcanErrorIRQ[] = CAN_Error_IRQS; -static const IRQn_Type s_flexcanBusOffIRQ[] = CAN_Bus_Off_IRQS; -static const IRQn_Type s_flexcanMbIRQ[] = CAN_ORed_Message_buffer_IRQS; - -/* Array of FlexCAN handle. */ -static flexcan_handle_t *s_flexcanHandle[ARRAY_SIZE(s_flexcanBases)]; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/* Array of FlexCAN clock name. */ -static const clock_ip_name_t s_flexcanClock[] = FLEXCAN_CLOCKS; -#if defined(FLEXCAN_PERIPH_CLOCKS) -/* Array of FlexCAN serial clock name. */ -static const clock_ip_name_t s_flexcanPeriphClock[] = FLEXCAN_PERIPH_CLOCKS; -#endif /* FLEXCAN_PERIPH_CLOCKS */ -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(FLEXCAN_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_flexcanResets[] = FLEXCAN_RESETS_ARRAY; -#endif - -/* FlexCAN ISR for transactional APIs. */ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -static flexcan_isr_t s_flexcanIsr = (flexcan_isr_t)DefaultISR; -#else -static flexcan_isr_t s_flexcanIsr; -#endif - -/******************************************************************************* - * Implementation of 32-bit memset - ******************************************************************************/ - -static void flexcan_memset(void *s, uint32_t c, size_t n) -{ - size_t m; - volatile uint32_t *ptr = s; - - m = n / sizeof(*ptr); - - while ((m--) != (size_t)0) - { - *ptr++ = c; - } -} - -/******************************************************************************* - * Code - ******************************************************************************/ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * brief Determine whether the FlexCAN instance support CAN FD mode at run time. - * - * note Use this API only if different soc parts share the SOC part name macro define. Otherwise, a different SOC part - * name can be used to determine at compile time whether the FlexCAN instance supports CAN FD mode or not. - * If need use this API to determine if CAN FD mode is supported, the FLEXCAN_Init function needs to be - * executed first, and then call this API and use the return to value determines whether to supports CAN FD mode, - * if return true, continue calling FLEXCAN_FDInit to enable CAN FD mode. - * - * param base FlexCAN peripheral base address. - * return return TRUE if instance support CAN FD mode, FALSE if instance only support classic CAN (2.0) mode. - */ -bool FLEXCAN_IsInstanceHasFDMode(CAN_Type *base) -{ - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - /* Enable CAN FD operation. */ - base->MCR |= CAN_MCR_FDEN_MASK; - - /* There are some SoC parts that don't support CAN FD. - * Checking if FDEN bit is really set to 1 is a way to ensure that CAN FD is supported. - * When SoC parts don't support CAN FD, FDEN bit stuck at 0 and can't be set to 1. */ - if (0U == (base->MCR & CAN_MCR_FDEN_MASK)) - { - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); - return false; - } - else - { - /* Clear CAN FD operation. */ - base->MCR &= ~CAN_MCR_FDEN_MASK; - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); - return true; - } -} -#endif - -/*! - * brief Get the FlexCAN instance from peripheral base address. - * - * param base FlexCAN peripheral base address. - * return FlexCAN instance. - */ -uint32_t FLEXCAN_GetInstance(CAN_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_flexcanBases); instance++) - { - if (s_flexcanBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_flexcanBases)); - - return instance; -} - -/*! - * brief Enter FlexCAN Freeze Mode. - * - * This function makes the FlexCAN work under Freeze Mode. - * - * param base FlexCAN peripheral base address. - */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_9595) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_9595) -void FLEXCAN_EnterFreezeMode(CAN_Type *base) -{ - uint32_t u32TimeoutCount = 0U; - uint32_t u32TempMCR = 0U; - uint32_t u32TempIMASK1 = 0U; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - uint32_t u32TempIMASK2 = 0U; -#endif - - /* Step1: set FRZ enable in MCR. */ - base->MCR |= CAN_MCR_FRZ_MASK; - - /* Step2: to check if MDIS bit set in MCR. if yes, clear it. */ - if (0U != (base->MCR & CAN_MCR_MDIS_MASK)) - { - base->MCR &= ~CAN_MCR_MDIS_MASK; - } - - /* Step3: polling LPMACK. */ - u32TimeoutCount = (uint32_t)FLEXCAN_WAIT_TIMEOUT; - while ((0U == (base->MCR & CAN_MCR_LPMACK_MASK)) && (u32TimeoutCount > 0U)) - { - u32TimeoutCount--; - } - - /* Step4: to check FLTCONF in ESR1 register */ - if (0U == (base->ESR1 & CAN_ESR1_FLTCONF_BUSOFF)) - { - /* Error Active and Error Passive state */ - /* Step5B: Set Halt bits. */ - base->MCR |= CAN_MCR_HALT_MASK; - - /* Step6B: Poll the MCR register until the Freeze Acknowledge (FRZACK) bit is set, timeout need more than 178 - * CAN bit length, so 20 multiply timeout is enough. */ - u32TimeoutCount = (uint32_t)FLEXCAN_WAIT_TIMEOUT * 20U; - while ((0U == (base->MCR & CAN_MCR_FRZACK_MASK)) && (u32TimeoutCount > 0U)) - { - u32TimeoutCount--; - } - - /* Merge ERRATA_9595 and ERRATA_8341 because both errata exist on some platform. */ - if (0U == u32TimeoutCount) - { - /* backup MCR and IMASK register. */ - u32TempMCR = base->MCR; - u32TempIMASK1 = base->IMASK1; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - u32TempIMASK2 = base->IMASK2; -#endif - /* Set the Soft Reset bit ((SOFTRST) in the MCR.*/ - base->MCR |= CAN_MCR_SOFTRST_MASK; - - /* Poll the MCR register until the Soft Reset (SOFTRST) bit is cleared, timeout need more than 178 - * CAN bit length, so 20 multiply timeout is enough. */ - u32TimeoutCount = (uint32_t)FLEXCAN_WAIT_TIMEOUT * 20U; - while ((CAN_MCR_SOFTRST_MASK == (base->MCR & CAN_MCR_SOFTRST_MASK)) && (u32TimeoutCount > 0U)) - { - u32TimeoutCount--; - } - - /* Reconfig MCR. */ - base->MCR = u32TempMCR; - - /* Reconfig IMASK. */ - base->IMASK1 = u32TempIMASK1; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - base->IMASK2 = u32TempIMASK2; -#endif - } - } - else - { - /* Bus Off state */ - /* backup MCR and IMASK register. Errata document not descript it, but we need backup for step 8A and 9A. */ - u32TempMCR = base->MCR; - u32TempIMASK1 = base->IMASK1; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - u32TempIMASK2 = base->IMASK2; -#endif - - /* Step5A: Set the Soft Reset bit ((SOFTRST) in the MCR.*/ - base->MCR |= CAN_MCR_SOFTRST_MASK; - - /* Step6A: Poll the MCR register until the Soft Reset (SOFTRST) bit is cleared. */ - u32TimeoutCount = (uint32_t)FLEXCAN_WAIT_TIMEOUT; - while ((CAN_MCR_SOFTRST_MASK == (base->MCR & CAN_MCR_SOFTRST_MASK)) && (u32TimeoutCount > 0U)) - { - u32TimeoutCount--; - } - - /* Step7A: Poll the MCR register until the Freeze Acknowledge (FRZACK) bit is set. */ - u32TimeoutCount = (uint32_t)FLEXCAN_WAIT_TIMEOUT; - while ((0U == (base->MCR & CAN_MCR_FRZACK_MASK)) && (u32TimeoutCount > 0U)) - { - u32TimeoutCount--; - } - - /* Step8A: reconfig MCR. */ - base->MCR = u32TempMCR; - - /* Step9A: reconfig IMASK. */ - base->IMASK1 = u32TempIMASK1; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - base->IMASK2 = u32TempIMASK2; -#endif - } -} -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_8341) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_8341) -void FLEXCAN_EnterFreezeMode(CAN_Type *base) -{ - uint32_t u32TimeoutCount = 0U; - uint32_t u32TempMCR = 0U; - uint32_t u32TempIMASK1 = 0U; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - uint32_t u32TempIMASK2 = 0U; -#endif - - /* Step1: set FRZ and HALT bit enable in MCR. */ - base->MCR |= CAN_MCR_FRZ_MASK; - base->MCR |= CAN_MCR_HALT_MASK; - - /* Step2: to check if MDIS bit set in MCR. if yes, clear it. */ - if (0U != (base->MCR & CAN_MCR_MDIS_MASK)) - { - base->MCR &= ~CAN_MCR_MDIS_MASK; - } - - /* Step3: Poll the MCR register until the Freeze Acknowledge (FRZACK) bit is set. */ - u32TimeoutCount = (uint32_t)FLEXCAN_WAIT_TIMEOUT * 100U; - while ((0U == (base->MCR & CAN_MCR_FRZACK_MASK)) && (u32TimeoutCount > 0U)) - { - u32TimeoutCount--; - } - - /* Step4: check whether the timeout reached. if no skip step5 to step8. */ - if (0U == u32TimeoutCount) - { - /* backup MCR and IMASK register. Errata document not descript it, but we need backup for step 8A and 9A. */ - u32TempMCR = base->MCR; - u32TempIMASK1 = base->IMASK1; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - u32TempIMASK2 = base->IMASK2; -#endif - /* Step5: Set the Soft Reset bit ((SOFTRST) in the MCR.*/ - base->MCR |= CAN_MCR_SOFTRST_MASK; - - /* Step6: Poll the MCR register until the Soft Reset (SOFTRST) bit is cleared. */ - while (CAN_MCR_SOFTRST_MASK == (base->MCR & CAN_MCR_SOFTRST_MASK)) - { - } - - /* Step7: reconfig MCR. */ - base->MCR = u32TempMCR; - - /* Step8: reconfig IMASK. */ - base->IMASK1 = u32TempIMASK1; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - base->IMASK2 = u32TempIMASK2; -#endif - } -} -#else -void FLEXCAN_EnterFreezeMode(CAN_Type *base) -{ - /* Set Freeze, Halt bits. */ - base->MCR |= CAN_MCR_FRZ_MASK; - base->MCR |= CAN_MCR_HALT_MASK; - while (0U == (base->MCR & CAN_MCR_FRZACK_MASK)) - { - } -} -#endif - -/*! - * brief Exit FlexCAN Freeze Mode. - * - * This function makes the FlexCAN leave Freeze Mode. - * - * param base FlexCAN peripheral base address. - */ -void FLEXCAN_ExitFreezeMode(CAN_Type *base) -{ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - /* Clean FlexCAN Access With Non-Correctable Error Interrupt Flag to avoid be put in freeze mode. */ - FLEXCAN_ClearStatusFlags(base, (uint64_t)kFLEXCAN_FlexCanAccessNonCorrectableErrorIntFlag | - (uint64_t)kFLEXCAN_FlexCanAccessNonCorrectableErrorOverrunFlag); -#endif - - /* Clear Freeze, Halt bits. */ - base->MCR &= ~CAN_MCR_HALT_MASK; - base->MCR &= ~CAN_MCR_FRZ_MASK; - - /* Wait until the FlexCAN Module exit freeze mode. */ - while (0U != (base->MCR & CAN_MCR_FRZACK_MASK)) - { - } -} - -#if !defined(NDEBUG) -/*! - * brief Check if Message Buffer is occupied by Rx FIFO. - * - * This function check if Message Buffer is occupied by Rx FIFO. - * - * param base FlexCAN peripheral base address. - * param mbIdx The FlexCAN Message Buffer index. - * return TRUE if the index MB is occupied by Rx FIFO, FALSE if the index MB not occupied by Rx FIFO. - */ -static bool FLEXCAN_IsMbOccupied(CAN_Type *base, uint8_t mbIdx) -{ - uint8_t lastOccupiedMb; - bool fgRet; - - /* Is Rx FIFO enabled? */ - if (0U != (base->MCR & CAN_MCR_RFEN_MASK)) - { - /* Get RFFN value. */ - lastOccupiedMb = (uint8_t)((base->CTRL2 & CAN_CTRL2_RFFN_MASK) >> CAN_CTRL2_RFFN_SHIFT); - /* Calculate the number of last Message Buffer occupied by Rx FIFO. */ - lastOccupiedMb = ((lastOccupiedMb + 1U) * 2U) + 5U; - -#if ((defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829)) - /* the first valid MB should be occupied by ERRATA 5461 or 5829. */ - lastOccupiedMb += 1U; -#endif - fgRet = (mbIdx <= lastOccupiedMb); - } - else - { -#if ((defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829)) - if (0U == mbIdx) - { - fgRet = true; - } - else -#endif - { - fgRet = false; - } - } - - return fgRet; -} -#endif - -#if ((defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829)) -/*! - * brief Get the first valid Message buffer ID of give FlexCAN instance. - * - * This function is a helper function for Errata 5641 workaround. - * - * param base FlexCAN peripheral base address. - * return The first valid Message Buffer Number. - */ -static uint8_t FLEXCAN_GetFirstValidMb(CAN_Type *base) -{ - uint8_t firstValidMbNum; - - if (0U != (base->MCR & CAN_MCR_RFEN_MASK)) - { - firstValidMbNum = (uint8_t)((base->CTRL2 & CAN_CTRL2_RFFN_MASK) >> CAN_CTRL2_RFFN_SHIFT); - firstValidMbNum = ((firstValidMbNum + 1U) * 2U) + 6U; - } - else - { - firstValidMbNum = 0U; - } - - return firstValidMbNum; -} -#endif - -/*! - * brief Reset the FlexCAN Instance. - * - * Restores the FlexCAN module to reset state, notice that this function - * will set all the registers to reset state so the FlexCAN module can not work - * after calling this API. - * - * param base FlexCAN peripheral base address. - */ -static void FLEXCAN_Reset(CAN_Type *base) -{ - /* The module must should be first exit from low power - * mode, and then soft reset can be applied. - */ - assert(0U == (base->MCR & CAN_MCR_MDIS_MASK)); - - uint8_t i; - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_DOZE_MODE_SUPPORT) && FSL_FEATURE_FLEXCAN_HAS_DOZE_MODE_SUPPORT) - if (0 != (FSL_FEATURE_FLEXCAN_INSTANCE_HAS_DOZE_MODE_SUPPORTn(base))) - { - /* De-assert DOZE Enable Bit. */ - base->MCR &= ~CAN_MCR_DOZE_MASK; - } -#endif - - /* Wait until FlexCAN exit from any Low Power Mode. */ - while (0U != (base->MCR & CAN_MCR_LPMACK_MASK)) - { - } - - /* Assert Soft Reset Signal. */ - base->MCR |= CAN_MCR_SOFTRST_MASK; - /* Wait until FlexCAN reset completes. */ - while (0U != (base->MCR & CAN_MCR_SOFTRST_MASK)) - { - } - -/* Reset MCR register. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_GLITCH_FILTER) && FSL_FEATURE_FLEXCAN_HAS_GLITCH_FILTER) - base->MCR |= CAN_MCR_WRNEN_MASK | CAN_MCR_WAKSRC_MASK | - CAN_MCR_MAXMB((uint32_t)FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(base) - 1U); -#else - base->MCR |= - CAN_MCR_WRNEN_MASK | CAN_MCR_MAXMB((uint32_t)FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(base) - 1U); -#endif - - /* Reset CTRL1 and CTRL2 register, default to eanble SMP feature which enable three sample point to determine the - * received bit's value of the. */ - base->CTRL1 = CAN_CTRL1_SMP_MASK; - base->CTRL2 = CAN_CTRL2_TASD(0x16) | CAN_CTRL2_RRS_MASK | CAN_CTRL2_EACEN_MASK; - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - /* Enable unrestricted write access to FlexCAN memory. */ - base->CTRL2 |= CAN_CTRL2_WRMFRZ_MASK; - /* Do memory initialization for all FlexCAN RAM in order to have the parity bits in memory properly - updated. */ - *(volatile uint32_t *)CAN_INIT_RXFIR = 0x0U; - flexcan_memset(CAN_INIT_MEMORY_BASE_1, 0, CAN_INIT_MEMORY_SIZE_1); - flexcan_memset(CAN_INIT_MEMORY_BASE_2, 0, CAN_INIT_MEMORY_SIZE_2); - /* Disable unrestricted write access to FlexCAN memory. */ - base->CTRL2 &= ~CAN_CTRL2_WRMFRZ_MASK; - - /* Clean all memory error flags. */ - FLEXCAN_ClearStatusFlags(base, (uint64_t)kFLEXCAN_AllMemoryErrorFlag); -#else - /* Only need clean all Message Buffer memory. */ - flexcan_memset((void *)&base->MB[0], 0, sizeof(base->MB)); -#endif - - /* Clean all individual Rx Mask of Message Buffers. */ - for (i = 0; i < (uint32_t)FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(base); i++) - { - base->RXIMR[i] = 0x3FFFFFFF; - } - - /* Clean Global Mask of Message Buffers. */ - base->RXMGMASK = 0x3FFFFFFF; - /* Clean Global Mask of Message Buffer 14. */ - base->RX14MASK = 0x3FFFFFFF; - /* Clean Global Mask of Message Buffer 15. */ - base->RX15MASK = 0x3FFFFFFF; - /* Clean Global Mask of Rx FIFO. */ - base->RXFGMASK = 0x3FFFFFFF; -} - -/*! - * brief Set bit rate of FlexCAN classical CAN frame or CAN FD frame nominal phase. - * - * This function set the bit rate of classical CAN frame or CAN FD frame nominal phase base on - * FLEXCAN_CalculateImprovedTimingValues() API calculated timing values. - * - * note Calling FLEXCAN_SetBitRate() overrides the bit rate set in FLEXCAN_Init(). - * - * param base FlexCAN peripheral base address. - * param sourceClock_Hz Source Clock in Hz. - * param bitRate_Bps Bit rate in Bps. - * return kStatus_Success - Set CAN baud rate (only Nominal phase) successfully. - */ -status_t FLEXCAN_SetBitRate(CAN_Type *base, uint32_t sourceClock_Hz, uint32_t bitRate_Bps) -{ - flexcan_timing_config_t timingCfg; - status_t result = kStatus_Fail; - - if (FLEXCAN_CalculateImprovedTimingValues(base, bitRate_Bps, sourceClock_Hz, &timingCfg)) - { - FLEXCAN_SetTimingConfig(base, &timingCfg); - result = kStatus_Success; - } - - return result; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * @brief Set bit rate of FlexCAN FD frame. - * - * This function set the baud rate of FLEXCAN FD base on FLEXCAN_FDCalculateImprovedTimingValues() API calculated timing - * values. - * - * @param base FlexCAN peripheral base address. - * @param sourceClock_Hz Source Clock in Hz. - * @param bitRateN_Bps Nominal bit Rate in Bps. - * @param bitRateD_Bps Data bit Rate in Bps. - * @return kStatus_Success - Set CAN FD bit rate (include Nominal and Data phase) successfully. - */ -status_t FLEXCAN_SetFDBitRate(CAN_Type *base, uint32_t sourceClock_Hz, uint32_t bitRateN_Bps, uint32_t bitRateD_Bps) -{ - flexcan_timing_config_t timingCfg; - status_t result = kStatus_Fail; - - if (FLEXCAN_FDCalculateImprovedTimingValues(base, bitRateN_Bps, bitRateD_Bps, sourceClock_Hz, &timingCfg)) - { - FLEXCAN_SetFDTimingConfig(base, &timingCfg); - result = kStatus_Success; - } - - return result; -} -#endif - -/*! - * brief Initializes a FlexCAN instance. - * - * This function initializes the FlexCAN module with user-defined settings. - * This example shows how to set up the flexcan_config_t parameters and how - * to call the FLEXCAN_Init function by passing in these parameters. - * code - * flexcan_config_t flexcanConfig; - * flexcanConfig.clkSrc = kFLEXCAN_ClkSrc0; - * flexcanConfig.bitRate = 1000000U; - * flexcanConfig.maxMbNum = 16; - * flexcanConfig.enableLoopBack = false; - * flexcanConfig.enableSelfWakeup = false; - * flexcanConfig.enableIndividMask = false; - * flexcanConfig.disableSelfReception = false; - * flexcanConfig.enableListenOnlyMode = false; - * flexcanConfig.enableDoze = false; - * flexcanConfig.timingConfig = timingConfig; - * FLEXCAN_Init(CAN0, &flexcanConfig, 40000000UL); - * endcode - * - * param base FlexCAN peripheral base address. - * param pConfig Pointer to the user-defined configuration structure. - * param sourceClock_Hz FlexCAN Protocol Engine clock source frequency in Hz. - */ -void FLEXCAN_Init(CAN_Type *base, const flexcan_config_t *pConfig, uint32_t sourceClock_Hz) -{ - /* Assertion. */ - assert(NULL != pConfig); - assert((pConfig->maxMbNum > 0U) && - (pConfig->maxMbNum <= (uint8_t)FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(base))); - - uint32_t mcrTemp; - uint32_t ctrl1Temp; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - uint32_t instance; -#endif - flexcan_timing_config_t timingCfg = pConfig->timingConfig; - /* FlexCAN classical CAN frame or CAN FD frame nominal phase timing setting formula: - * quantum = 1 + (phaseSeg1 + 1) + (phaseSeg2 + 1) + (propSeg + 1); - */ - uint32_t quantum = (1U + ((uint32_t)timingCfg.phaseSeg1 + 1U) + ((uint32_t)timingCfg.phaseSeg2 + 1U) + - ((uint32_t)timingCfg.propSeg + 1U)); - uint32_t tqFre = pConfig->bitRate * quantum; - uint16_t maxDivider; - - /* Assertion: Check bit rate value. */ - assert((pConfig->bitRate != 0U) && (pConfig->bitRate <= 1000000U) && (tqFre <= sourceClock_Hz)); -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0 != FSL_FEATURE_FLEXCAN_INSTANCE_HAS_FLEXIBLE_DATA_RATEn(base)) - { -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - assert((tqFre * MAX_ENPRESDIV) >= sourceClock_Hz); - maxDivider = MAX_ENPRESDIV; -#else - assert((tqFre * MAX_EPRESDIV) >= sourceClock_Hz); - maxDivider = MAX_EPRESDIV; -#endif - } - else - { - assert((tqFre * MAX_PRESDIV) >= sourceClock_Hz); - maxDivider = MAX_PRESDIV; - } -#else - assert((tqFre * MAX_PRESDIV) >= sourceClock_Hz); - maxDivider = MAX_PRESDIV; -#endif - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - instance = FLEXCAN_GetInstance(base); - /* Enable FlexCAN clock. */ - (void)CLOCK_EnableClock(s_flexcanClock[instance]); - /* - * Check the CAN clock in this device whether affected by Other clock gate - * If it affected, we'd better to change other clock source, - * If user insist on using that clock source, user need open these gate at same time, - * In this scene, User need to care the power consumption. - */ - assert(CAN_CLOCK_CHECK_NO_AFFECTS); -#if defined(FLEXCAN_PERIPH_CLOCKS) - /* Enable FlexCAN serial clock. */ - (void)CLOCK_EnableClock(s_flexcanPeriphClock[instance]); -#endif /* FLEXCAN_PERIPH_CLOCKS */ -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(FLEXCAN_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_flexcanResets[FLEXCAN_GetInstance(base)]); -#endif - -#if defined(CAN_CTRL1_CLKSRC_MASK) -#if (defined(FSL_FEATURE_FLEXCAN_SUPPORT_ENGINE_CLK_SEL_REMOVE) && FSL_FEATURE_FLEXCAN_SUPPORT_ENGINE_CLK_SEL_REMOVE) - if (0 == FSL_FEATURE_FLEXCAN_INSTANCE_SUPPORT_ENGINE_CLK_SEL_REMOVEn(base)) -#endif /* FSL_FEATURE_FLEXCAN_SUPPORT_ENGINE_CLK_SEL_REMOVE */ - { - /* Disable FlexCAN Module. */ - FLEXCAN_Enable(base, false); - - /* Protocol-Engine clock source selection, This bit must be set - * when FlexCAN Module in Disable Mode. - */ - base->CTRL1 = (kFLEXCAN_ClkSrc0 == pConfig->clkSrc) ? (base->CTRL1 & ~CAN_CTRL1_CLKSRC_MASK) : - (base->CTRL1 | CAN_CTRL1_CLKSRC_MASK); - } -#endif /* CAN_CTRL1_CLKSRC_MASK */ - - /* Enable FlexCAN Module for configuration. */ - FLEXCAN_Enable(base, true); - - /* Reset to known status. */ - FLEXCAN_Reset(base); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - /* Enable to update in MCER. */ - base->CTRL2 |= CAN_CTRL2_ECRWRE_MASK; - base->MECR &= ~CAN_MECR_ECRWRDIS_MASK; - - /* Enable/Disable Memory Error Detection and Correction.*/ - base->MECR = (pConfig->enableMemoryErrorControl) ? (base->MECR & ~CAN_MECR_ECCDIS_MASK) : - (base->MECR | CAN_MECR_ECCDIS_MASK); - - /* Enable/Disable Non-Correctable Errors In FlexCAN Access Put Device In Freeze Mode. */ - base->MECR = (pConfig->enableNonCorrectableErrorEnterFreeze) ? (base->MECR | CAN_MECR_NCEFAFRZ_MASK) : - (base->MECR & ~CAN_MECR_NCEFAFRZ_MASK); - /* Lock MCER register. */ - base->CTRL2 &= ~CAN_CTRL2_ECRWRE_MASK; -#endif - - /* Save current CTRL1 value and enable to enter Freeze mode(enabled by default). */ - ctrl1Temp = base->CTRL1; - - /* Save current MCR value and enable to enter Freeze mode(enabled by default). */ - mcrTemp = base->MCR; - - /* Enable Loop Back Mode? */ - ctrl1Temp = (pConfig->enableLoopBack) ? (ctrl1Temp | CAN_CTRL1_LPB_MASK) : (ctrl1Temp & ~CAN_CTRL1_LPB_MASK); - - /* Enable Timer Sync? */ - ctrl1Temp = (pConfig->enableTimerSync) ? (ctrl1Temp | CAN_CTRL1_TSYN_MASK) : (ctrl1Temp & ~CAN_CTRL1_TSYN_MASK); - - /* Enable Listen Only Mode? */ - ctrl1Temp = (pConfig->enableListenOnlyMode) ? ctrl1Temp | CAN_CTRL1_LOM_MASK : ctrl1Temp & ~CAN_CTRL1_LOM_MASK; - -#if !(defined(FSL_FEATURE_FLEXCAN_HAS_NO_SUPV_SUPPORT) && FSL_FEATURE_FLEXCAN_HAS_NO_SUPV_SUPPORT) - /* Enable Supervisor Mode? */ - mcrTemp = (pConfig->enableSupervisorMode) ? mcrTemp | CAN_MCR_SUPV_MASK : mcrTemp & ~CAN_MCR_SUPV_MASK; -#endif - - /* Set the maximum number of Message Buffers */ - mcrTemp = (mcrTemp & ~CAN_MCR_MAXMB_MASK) | CAN_MCR_MAXMB((uint32_t)pConfig->maxMbNum - 1U); - - /* Enable Self Wake Up Mode and configure the wake up source. */ - mcrTemp = (pConfig->enableSelfWakeup) ? (mcrTemp | CAN_MCR_SLFWAK_MASK) : (mcrTemp & ~CAN_MCR_SLFWAK_MASK); - mcrTemp = (kFLEXCAN_WakeupSrcFiltered == pConfig->wakeupSrc) ? (mcrTemp | CAN_MCR_WAKSRC_MASK) : - (mcrTemp & ~CAN_MCR_WAKSRC_MASK); -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - /* Enable Pretended Networking Mode? When Pretended Networking mode is set, Self Wake Up feature must be disabled.*/ - mcrTemp = (pConfig->enablePretendedeNetworking) ? ((mcrTemp & ~CAN_MCR_SLFWAK_MASK) | CAN_MCR_PNET_EN_MASK) : - (mcrTemp & ~CAN_MCR_PNET_EN_MASK); -#endif - - /* Enable Individual Rx Masking and Queue feature? */ - mcrTemp = (pConfig->enableIndividMask) ? (mcrTemp | CAN_MCR_IRMQ_MASK) : (mcrTemp & ~CAN_MCR_IRMQ_MASK); - - /* Disable Self Reception? */ - mcrTemp = (pConfig->disableSelfReception) ? mcrTemp | CAN_MCR_SRXDIS_MASK : mcrTemp & ~CAN_MCR_SRXDIS_MASK; - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_DOZE_MODE_SUPPORT) && FSL_FEATURE_FLEXCAN_HAS_DOZE_MODE_SUPPORT) - if (0 != FSL_FEATURE_FLEXCAN_INSTANCE_HAS_DOZE_MODE_SUPPORTn(base)) - { - /* Enable Doze Mode? */ - mcrTemp = (pConfig->enableDoze) ? (mcrTemp | CAN_MCR_DOZE_MASK) : (mcrTemp & ~CAN_MCR_DOZE_MASK); - } -#endif - - /* Write back CTRL1 Configuration to register. */ - base->CTRL1 = ctrl1Temp; - - /* Write back MCR Configuration to register. */ - base->MCR = mcrTemp; - - /* Check whether Nominal Bit Rate Prescaler is overflow. */ - if ((sourceClock_Hz / tqFre - 1U) > maxDivider) - { - timingCfg.preDivider = maxDivider; - } - else - { - timingCfg.preDivider = (uint16_t)(sourceClock_Hz / tqFre) - 1U; - } - - /* Update actual timing characteristic. */ - FLEXCAN_SetTimingConfig(base, &timingCfg); -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * brief Initializes a FlexCAN instance. - * - * This function initializes the FlexCAN module with user-defined settings. - * This example shows how to set up the flexcan_config_t parameters and how - * to call the FLEXCAN_FDInit function by passing in these parameters. - * code - * flexcan_config_t flexcanConfig; - * flexcanConfig.clkSrc = kFLEXCAN_ClkSrc0; - * flexcanConfig.bitRate = 1000000U; - * flexcanConfig.bitRateFD = 2000000U; - * flexcanConfig.maxMbNum = 16; - * flexcanConfig.enableLoopBack = false; - * flexcanConfig.enableSelfWakeup = false; - * flexcanConfig.enableIndividMask = false; - * flexcanConfig.disableSelfReception = false; - * flexcanConfig.enableListenOnlyMode = false; - * flexcanConfig.enableDoze = false; - * flexcanConfig.timingConfig = timingConfig; - * FLEXCAN_FDInit(CAN0, &flexcanConfig, 80000000UL, kFLEXCAN_16BperMB, true); - * endcode - * - * param base FlexCAN peripheral base address. - * param pConfig Pointer to the user-defined configuration structure. - * param sourceClock_Hz FlexCAN Protocol Engine clock source frequency in Hz. - * param dataSize FlexCAN Message Buffer payload size. The actual transmitted or received CAN FD frame data size needs - * to be less than or equal to this value. - * param brs True if bit rate switch is enabled in FD mode. - */ -void FLEXCAN_FDInit( - CAN_Type *base, const flexcan_config_t *pConfig, uint32_t sourceClock_Hz, flexcan_mb_size_t dataSize, bool brs) -{ - assert((uint32_t)dataSize <= 3U); - assert(((pConfig->bitRate < pConfig->bitRateFD) && brs) || ((pConfig->bitRate == pConfig->bitRateFD) && (!brs))); - - uint32_t fdctrl = 0U; - flexcan_timing_config_t timingCfg = pConfig->timingConfig; - /* FlexCAN FD frame data phase timing setting formula: - * quantum = 1 + (fphaseSeg1 + 1) + (fphaseSeg2 + 1) + fpropSeg; - */ - uint32_t quantum = (1U + ((uint32_t)timingCfg.fphaseSeg1 + 1U) + ((uint32_t)timingCfg.fphaseSeg2 + 1U) + - (uint32_t)timingCfg.fpropSeg); - uint32_t tqFre = pConfig->bitRateFD * quantum; - uint16_t maxDivider; - - /* Check bit rate value. */ - assert((pConfig->bitRateFD <= MAX_CANFD_BITRATE) && (tqFre <= sourceClock_Hz)); -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - assert((tqFre * MAX_EDPRESDIV) >= sourceClock_Hz); - maxDivider = MAX_EDPRESDIV; -#else - assert((tqFre * MAX_FPRESDIV) >= sourceClock_Hz); - maxDivider = MAX_FPRESDIV; -#endif - - /* Initialization of classical CAN. */ - FLEXCAN_Init(base, pConfig, sourceClock_Hz); - - /* Check whether Data Bit Rate Prescaler is overflow. */ - if ((sourceClock_Hz / tqFre - 1U) > maxDivider) - { - timingCfg.fpreDivider = maxDivider; - } - else - { - timingCfg.fpreDivider = (uint16_t)(sourceClock_Hz / tqFre) - 1U; - } - - /* Update actual timing characteristic. */ - FLEXCAN_SetFDTimingConfig(base, &timingCfg); - - /* read FDCTRL register. */ - fdctrl = base->FDCTRL; - - /* Enable FD operation and set bit rate switch. */ - if (brs) - { - fdctrl |= CAN_FDCTRL_FDRATE_MASK; - } - else - { - fdctrl &= ~CAN_FDCTRL_FDRATE_MASK; - } - - /* Before use "|=" operation for multi-bits field, CPU should clean previous Setting. */ - fdctrl = (fdctrl & ~CAN_FDCTRL_MBDSR0_MASK) | CAN_FDCTRL_MBDSR0(dataSize); -#if defined(CAN_FDCTRL_MBDSR1_MASK) - fdctrl = (fdctrl & ~CAN_FDCTRL_MBDSR1_MASK) | CAN_FDCTRL_MBDSR1(dataSize); -#endif -#if defined(CAN_FDCTRL_MBDSR2_MASK) - fdctrl = (fdctrl & ~CAN_FDCTRL_MBDSR2_MASK) | CAN_FDCTRL_MBDSR2(dataSize); -#endif -#if defined(CAN_FDCTRL_MBDSR3_MASK) - fdctrl = (fdctrl & ~CAN_FDCTRL_MBDSR3_MASK) | CAN_FDCTRL_MBDSR3(dataSize); -#endif - - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - /* Enable CAN FD operation. */ - base->MCR |= CAN_MCR_FDEN_MASK; - /* Clear SMP bit when CAN FD is enabled (CAN FD only can use one regular sample point plus one optional secondary - * sampling point). */ - base->CTRL1 &= ~CAN_CTRL1_SMP_MASK; - - if (brs && !(pConfig->enableLoopBack)) - { -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - /* The TDC offset should be configured as shown in this equation : offset = DTSEG1 + 2 */ - if (((uint32_t)pConfig->timingConfig.fphaseSeg1 + pConfig->timingConfig.fpropSeg + 2U) * - (pConfig->timingConfig.fpreDivider + 1U) < - MAX_ETDCOFF) - { - base->ETDC = - CAN_ETDC_ETDCEN_MASK | CAN_ETDC_TDMDIS(!pConfig->enableTransceiverDelayMeasure) | - CAN_ETDC_ETDCOFF(((uint32_t)pConfig->timingConfig.fphaseSeg1 + pConfig->timingConfig.fpropSeg + 2U) * - (pConfig->timingConfig.fpreDivider + 1U)); - } - else - { - /* Enable the Transceiver Delay Compensation */ - base->ETDC = CAN_ETDC_ETDCEN_MASK | CAN_ETDC_TDMDIS(!pConfig->enableTransceiverDelayMeasure) | - CAN_ETDC_ETDCOFF(MAX_ETDCOFF); - } -#else - /* The TDC offset should be configured as shown in this equation : offset = PSEG1 + PROPSEG + 2 */ - if (((uint32_t)pConfig->timingConfig.fphaseSeg1 + pConfig->timingConfig.fpropSeg + 2U) * - (pConfig->timingConfig.fpreDivider + 1U) < - MAX_TDCOFF) - { - fdctrl = - (fdctrl & ~CAN_FDCTRL_TDCOFF_MASK) | - CAN_FDCTRL_TDCOFF(((uint32_t)pConfig->timingConfig.fphaseSeg1 + pConfig->timingConfig.fpropSeg + 2U) * - (pConfig->timingConfig.fpreDivider + 1U)); - } - else - { - fdctrl = (fdctrl & ~CAN_FDCTRL_TDCOFF_MASK) | CAN_FDCTRL_TDCOFF(MAX_TDCOFF); - } - /* Enable the Transceiver Delay Compensation */ - fdctrl = (fdctrl & ~CAN_FDCTRL_TDCEN_MASK) | CAN_FDCTRL_TDCEN_MASK; -#endif - } - - /* update the FDCTL register. */ - base->FDCTRL = fdctrl; - - /* Enable CAN FD ISO mode by default. */ - base->CTRL2 |= CAN_CTRL2_ISOCANFDEN_MASK; - - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); -} -#endif - -/*! - * brief De-initializes a FlexCAN instance. - * - * This function disables the FlexCAN module clock and sets all register values - * to the reset value. - * - * param base FlexCAN peripheral base address. - */ -void FLEXCAN_Deinit(CAN_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - uint32_t instance; -#endif - /* Reset all Register Contents. */ - FLEXCAN_Reset(base); - - /* Disable FlexCAN module. */ - FLEXCAN_Enable(base, false); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - instance = FLEXCAN_GetInstance(base); -#if defined(FLEXCAN_PERIPH_CLOCKS) - /* Disable FlexCAN serial clock. */ - (void)CLOCK_DisableClock(s_flexcanPeriphClock[instance]); -#endif /* FLEXCAN_PERIPH_CLOCKS */ - /* Disable FlexCAN clock. */ - (void)CLOCK_DisableClock(s_flexcanClock[instance]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Gets the default configuration structure. - * - * This function initializes the FlexCAN configuration structure to default values. The default - * values are as follows. - * flexcanConfig->clkSrc = kFLEXCAN_ClkSrc0; - * flexcanConfig->bitRate = 1000000U; - * flexcanConfig->bitRateFD = 2000000U; - * flexcanConfig->maxMbNum = 16; - * flexcanConfig->enableLoopBack = false; - * flexcanConfig->enableSelfWakeup = false; - * flexcanConfig->enableIndividMask = false; - * flexcanConfig->disableSelfReception = false; - * flexcanConfig->enableListenOnlyMode = false; - * flexcanConfig->enableDoze = false; - * flexcanConfig->enablePretendedeNetworking = false; - * flexcanConfig->enableMemoryErrorControl = true; - * flexcanConfig->enableNonCorrectableErrorEnterFreeze = true; - * flexcanConfig->enableTransceiverDelayMeasure = true; - * flexcanConfig.timingConfig = timingConfig; - * - * param pConfig Pointer to the FlexCAN configuration structure. - */ -void FLEXCAN_GetDefaultConfig(flexcan_config_t *pConfig) -{ - /* Assertion. */ - assert(NULL != pConfig); - - /* Initializes the configure structure to zero. */ - (void)memset(pConfig, 0, sizeof(*pConfig)); - - /* Initialize FlexCAN Module config struct with default value. */ - pConfig->clkSrc = kFLEXCAN_ClkSrc0; - pConfig->bitRate = 1000000U; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - pConfig->bitRateFD = 2000000U; -#endif - pConfig->maxMbNum = 16; - pConfig->enableLoopBack = false; - pConfig->enableTimerSync = true; - pConfig->enableSelfWakeup = false; - pConfig->wakeupSrc = kFLEXCAN_WakeupSrcUnfiltered; - pConfig->enableIndividMask = false; - pConfig->disableSelfReception = false; - pConfig->enableListenOnlyMode = false; -#if !(defined(FSL_FEATURE_FLEXCAN_HAS_NO_SUPV_SUPPORT) && FSL_FEATURE_FLEXCAN_HAS_NO_SUPV_SUPPORT) - pConfig->enableSupervisorMode = true; -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_DOZE_MODE_SUPPORT) && FSL_FEATURE_FLEXCAN_HAS_DOZE_MODE_SUPPORT) - pConfig->enableDoze = false; -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - pConfig->enablePretendedeNetworking = false; -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - pConfig->enableMemoryErrorControl = true; - pConfig->enableNonCorrectableErrorEnterFreeze = true; -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - pConfig->enableTransceiverDelayMeasure = true; -#endif - - /* Default protocol timing configuration, nominal bit time quantum is 10 (80% SP), data bit time quantum is 5 - * (60%). Suggest use FLEXCAN_CalculateImprovedTimingValues/FLEXCAN_FDCalculateImprovedTimingValues to get the - * improved timing configuration.*/ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - pConfig->timingConfig.phaseSeg1 = 1; - pConfig->timingConfig.phaseSeg2 = 1; - pConfig->timingConfig.propSeg = 4; - pConfig->timingConfig.rJumpwidth = 1; - pConfig->timingConfig.fphaseSeg1 = 1; - pConfig->timingConfig.fphaseSeg2 = 1; - pConfig->timingConfig.fpropSeg = 0; - pConfig->timingConfig.frJumpwidth = 1; -#else - pConfig->timingConfig.phaseSeg1 = 1; - pConfig->timingConfig.phaseSeg2 = 1; - pConfig->timingConfig.propSeg = 4; - pConfig->timingConfig.rJumpwidth = 1; -#endif -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) -/*! - * brief Configures the FlexCAN Pretended Networking mode. - * - * This function configures the FlexCAN Pretended Networking mode with given configuration. - * - * param base FlexCAN peripheral base address. - * param pConfig Pointer to the FlexCAN Rx FIFO configuration structure. - */ -void FLEXCAN_SetPNConfig(CAN_Type *base, const flexcan_pn_config_t *pConfig) -{ - /* Assertion. */ - assert(NULL != pConfig); - assert(0U != pConfig->matchNum); - uint32_t pnctrl; - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - pnctrl = (pConfig->matchNum > 1U) ? CAN_CTRL1_PN_FCS(0x2U | (uint32_t)pConfig->matchSrc) : - CAN_CTRL1_PN_FCS(pConfig->matchSrc); - pnctrl |= (pConfig->enableMatch) ? (CAN_CTRL1_PN_WUMF_MSK_MASK) : 0U; - pnctrl |= (pConfig->enableTimeout) ? (CAN_CTRL1_PN_WTOF_MSK_MASK) : 0U; - pnctrl |= CAN_CTRL1_PN_NMATCH(pConfig->matchNum) | CAN_CTRL1_PN_IDFS(pConfig->idMatchMode) | - CAN_CTRL1_PN_PLFS(pConfig->dataMatchMode); - base->CTRL1_PN = pnctrl; - base->CTRL2_PN = CAN_CTRL2_PN_MATCHTO(pConfig->timeoutValue); - base->FLT_ID1 = pConfig->idLower; - base->FLT_ID2_IDMASK = pConfig->idUpper; - base->FLT_DLC = CAN_FLT_DLC_FLT_DLC_LO(pConfig->lengthLower) | CAN_FLT_DLC_FLT_DLC_HI(pConfig->lengthUpper); - base->PL1_LO = pConfig->lowerWord0; - base->PL1_HI = pConfig->lowerWord1; - base->PL2_PLMASK_LO = pConfig->upperWord0; - base->PL2_PLMASK_HI = pConfig->upperWord1; - - FLEXCAN_ClearStatusFlags(base, (uint64_t)kFLEXCAN_PNMatchIntFlag | (uint64_t)kFLEXCAN_PNTimeoutIntFlag); - - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); -} - -/*! - * brief Reads a FlexCAN Message from Wake Up MB. - * - * This function reads a CAN message from the FlexCAN Wake up Message Buffers. There are four Wake up Message Buffers - * (WMBs) used to store incoming messages in Pretended Networking mode. The WMB index indicates the arrival order. The - * last message is stored in WMB3. - * - * param base FlexCAN peripheral base address. - * param pRxFrame Pointer to CAN message frame structure for reception. - * param mbIdx The FlexCAN Wake up Message Buffer index. Range in 0x0 ~ 0x3. - * retval kStatus_Success - Read Message from Wake up Message Buffer successfully. - * retval kStatus_Fail - Wake up Message Buffer has no valid content. - */ -status_t FLEXCAN_ReadPNWakeUpMB(CAN_Type *base, uint8_t mbIdx, flexcan_frame_t *pRxFrame) -{ - /* Assertion. */ - assert(NULL != pRxFrame); - assert(mbIdx <= 0x3U); - - uint32_t cs_temp; - status_t status; - - /* Check if Wake Up MB has valid content. */ - if (CAN_WU_MTC_MCOUNTER(mbIdx) < (base->WU_MTC & CAN_WU_MTC_MCOUNTER_MASK)) - { - /* Read CS field of wake up Message Buffer. */ - cs_temp = base->WMB[mbIdx].CS; - - /* Store Message ID. */ - pRxFrame->id = base->WMB[mbIdx].ID & (CAN_ID_EXT_MASK | CAN_ID_STD_MASK); - - /* Get the message ID and format. */ - pRxFrame->format = (cs_temp & CAN_CS_IDE_MASK) != 0U ? (uint8_t)kFLEXCAN_FrameFormatExtend : - (uint8_t)kFLEXCAN_FrameFormatStandard; - - /* Get the message type. */ - pRxFrame->type = - (cs_temp & CAN_CS_RTR_MASK) != 0U ? (uint8_t)kFLEXCAN_FrameTypeRemote : (uint8_t)kFLEXCAN_FrameTypeData; - - /* Get the message length. */ - pRxFrame->length = (uint8_t)((cs_temp & CAN_CS_DLC_MASK) >> CAN_CS_DLC_SHIFT); - - /* Messages received during Pretended Networking mode don't have time stamps, and the respective field in the - WMB structure must be ignored. */ - pRxFrame->timestamp = 0x0; - - /* Store Message Payload. */ - pRxFrame->dataWord0 = base->WMB[mbIdx].D03; - pRxFrame->dataWord1 = base->WMB[mbIdx].D47; - - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} -#endif - -/*! - * brief Sets the FlexCAN classical protocol timing characteristic. - * - * This function gives user settings to classical CAN or CAN FD nominal phase timing characteristic. - * The function is for an experienced user. For less experienced users, call the FLEXCAN_GetDefaultConfig() - * and get the default timing characteristicsthe, then call FLEXCAN_Init() and fill the - * bit rate field. - * - * note Calling FLEXCAN_SetTimingConfig() overrides the bit rate set - * in FLEXCAN_Init(). - * - * param base FlexCAN peripheral base address. - * param pConfig Pointer to the timing configuration structure. - */ -void FLEXCAN_SetTimingConfig(CAN_Type *base, const flexcan_timing_config_t *pConfig) -{ - /* Assertion. */ - assert(NULL != pConfig); - - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0 != FSL_FEATURE_FLEXCAN_INSTANCE_HAS_FLEXIBLE_DATA_RATEn(base)) - { -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - /* Enable extended Bit Timing register ENCBT. */ - base->CTRL2 |= CAN_CTRL2_BTE_MASK; - - /* Updating Timing Setting according to configuration structure. */ - base->EPRS = (base->EPRS & (~CAN_EPRS_ENPRESDIV_MASK)) | CAN_EPRS_ENPRESDIV(pConfig->preDivider); - base->ENCBT = CAN_ENCBT_NRJW(pConfig->rJumpwidth) | - CAN_ENCBT_NTSEG1((uint32_t)pConfig->phaseSeg1 + pConfig->propSeg + 1U) | - CAN_ENCBT_NTSEG2(pConfig->phaseSeg2); -#else - /* On RT106x devices, a single write may be ignored, so it is necessary to read back the register value to - * determine whether the value is written successfully. */ - - do - { - /* Enable Bit Timing register CBT, updating Timing Setting according to configuration structure. */ - base->CBT = CAN_CBT_BTF_MASK | CAN_CBT_EPRESDIV(pConfig->preDivider) | CAN_CBT_ERJW(pConfig->rJumpwidth) | - CAN_CBT_EPSEG1(pConfig->phaseSeg1) | CAN_CBT_EPSEG2(pConfig->phaseSeg2) | - CAN_CBT_EPROPSEG(pConfig->propSeg); - - } while ((CAN_CBT_EPRESDIV(pConfig->preDivider) | CAN_CBT_ERJW(pConfig->rJumpwidth) | - CAN_CBT_EPSEG1(pConfig->phaseSeg1) | CAN_CBT_EPSEG2(pConfig->phaseSeg2) | - CAN_CBT_EPROPSEG(pConfig->propSeg)) != - (base->CBT & (CAN_CBT_EPRESDIV_MASK | CAN_CBT_ERJW_MASK | CAN_CBT_EPSEG1_MASK | CAN_CBT_EPSEG2_MASK | - CAN_CBT_EPROPSEG_MASK))); -#endif - } - else - { - /* Cleaning previous Timing Setting. */ - base->CTRL1 &= ~(CAN_CTRL1_PRESDIV_MASK | CAN_CTRL1_RJW_MASK | CAN_CTRL1_PSEG1_MASK | CAN_CTRL1_PSEG2_MASK | - CAN_CTRL1_PROPSEG_MASK); - - /* Updating Timing Setting according to configuration structure. */ - base->CTRL1 |= (CAN_CTRL1_PRESDIV(pConfig->preDivider) | CAN_CTRL1_RJW(pConfig->rJumpwidth) | - CAN_CTRL1_PSEG1(pConfig->phaseSeg1) | CAN_CTRL1_PSEG2(pConfig->phaseSeg2) | - CAN_CTRL1_PROPSEG(pConfig->propSeg)); - } -#else - /* Cleaning previous Timing Setting. */ - base->CTRL1 &= ~(CAN_CTRL1_PRESDIV_MASK | CAN_CTRL1_RJW_MASK | CAN_CTRL1_PSEG1_MASK | CAN_CTRL1_PSEG2_MASK | - CAN_CTRL1_PROPSEG_MASK); - - /* Updating Timing Setting according to configuration structure. */ - base->CTRL1 |= (CAN_CTRL1_PRESDIV(pConfig->preDivider) | CAN_CTRL1_RJW(pConfig->rJumpwidth) | - CAN_CTRL1_PSEG1(pConfig->phaseSeg1) | CAN_CTRL1_PSEG2(pConfig->phaseSeg2) | - CAN_CTRL1_PROPSEG(pConfig->propSeg)); -#endif - - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * brief Sets the FlexCAN FD data phase timing characteristic. - * - * This function gives user settings to CAN FD data phase timing characteristic. - * The function is for an experienced user. For less experienced users, call the FLEXCAN_GetDefaultConfig() - * and get the default timing characteristicsthe, then call FLEXCAN_FDInit() and fill the - * data phase bit rate field. - * - * note Calling FLEXCAN_SetFDTimingConfig() overrides the bit rate set - * in FLEXCAN_FDInit(). - * - * param base FlexCAN peripheral base address. - * param pConfig Pointer to the timing configuration structure. - */ -void FLEXCAN_SetFDTimingConfig(CAN_Type *base, const flexcan_timing_config_t *pConfig) -{ - /* Assertion. */ - assert(NULL != pConfig); - - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - /* Enable extended Bit Timing register EDCBT. */ - base->CTRL2 |= CAN_CTRL2_BTE_MASK; - - base->EPRS = (base->EPRS & (~CAN_EPRS_EDPRESDIV_MASK)) | CAN_EPRS_EDPRESDIV(pConfig->fpreDivider); - base->EDCBT = CAN_EDCBT_DRJW(pConfig->frJumpwidth) | CAN_EDCBT_DTSEG2(pConfig->fphaseSeg2) | - CAN_EDCBT_DTSEG1((uint32_t)pConfig->fphaseSeg1 + pConfig->fpropSeg); -#else - /* Enable Bit Timing register FDCBT,*/ - base->CBT |= CAN_CBT_BTF_MASK; - - /* On RT106x devices, a single write may be ignored, so it is necessary to read back the register value to determine - * whether the value is written successfully. */ - do - { - /* Updating Timing Setting according to configuration structure. */ - base->FDCBT = (CAN_FDCBT_FPRESDIV(pConfig->fpreDivider) | CAN_FDCBT_FRJW(pConfig->frJumpwidth) | - CAN_FDCBT_FPSEG1(pConfig->fphaseSeg1) | CAN_FDCBT_FPSEG2(pConfig->fphaseSeg2) | - CAN_FDCBT_FPROPSEG(pConfig->fpropSeg)); - } while ((CAN_FDCBT_FPRESDIV(pConfig->fpreDivider) | CAN_FDCBT_FRJW(pConfig->frJumpwidth) | - CAN_FDCBT_FPSEG1(pConfig->fphaseSeg1) | CAN_FDCBT_FPSEG2(pConfig->fphaseSeg2) | - CAN_FDCBT_FPROPSEG(pConfig->fpropSeg)) != - (base->FDCBT & (CAN_FDCBT_FPRESDIV_MASK | CAN_FDCBT_FRJW_MASK | CAN_FDCBT_FPSEG1_MASK | - CAN_FDCBT_FPSEG2_MASK | CAN_FDCBT_FPROPSEG_MASK))); -#endif - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); -} -#endif - -/*! - * brief Sets the FlexCAN receive message buffer global mask. - * - * This function sets the global mask for the FlexCAN message buffer in a matching process. - * The configuration is only effective when the Rx individual mask is disabled in the FLEXCAN_Init(). - * - * param base FlexCAN peripheral base address. - * param mask Rx Message Buffer Global Mask value. - */ -void FLEXCAN_SetRxMbGlobalMask(CAN_Type *base, uint32_t mask) -{ - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - - /* Setting Rx Message Buffer Global Mask value. */ - base->RXMGMASK = mask; - base->RX14MASK = mask; - base->RX15MASK = mask; - - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); -} - -/*! - * brief Sets the FlexCAN receive FIFO global mask. - * - * This function sets the global mask for FlexCAN FIFO in a matching process. - * - * param base FlexCAN peripheral base address. - * param mask Rx Fifo Global Mask value. - */ -void FLEXCAN_SetRxFifoGlobalMask(CAN_Type *base, uint32_t mask) -{ - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - - /* Setting Rx FIFO Global Mask value. */ - base->RXFGMASK = mask; - - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); -} - -/*! - * brief Sets the FlexCAN receive individual mask. - * - * This function sets the individual mask for the FlexCAN matching process. - * The configuration is only effective when the Rx individual mask is enabled in the FLEXCAN_Init(). - * If the Rx FIFO is disabled, the individual mask is applied to the corresponding Message Buffer. - * If the Rx FIFO is enabled, the individual mask for Rx FIFO occupied Message Buffer is applied to - * the Rx Filter with the same index. Note that only the first 32 - * individual masks can be used as the Rx FIFO filter mask. - * - * param base FlexCAN peripheral base address. - * param maskIdx The Index of individual Mask. - * param mask Rx Individual Mask value. - */ -void FLEXCAN_SetRxIndividualMask(CAN_Type *base, uint8_t maskIdx, uint32_t mask) -{ - assert(maskIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); - - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - - /* Setting Rx Individual Mask value. */ - base->RXIMR[maskIdx] = mask; - - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); -} - -/*! - * brief Configures a FlexCAN transmit message buffer. - * - * This function aborts the previous transmission, cleans the Message Buffer, and - * configures it as a Transmit Message Buffer. - * - * param base FlexCAN peripheral base address. - * param mbIdx The Message Buffer index. - * param enable Enable/disable Tx Message Buffer. - * - true: Enable Tx Message Buffer. - * - false: Disable Tx Message Buffer. - */ -void FLEXCAN_SetTxMbConfig(CAN_Type *base, uint8_t mbIdx, bool enable) -{ - /* Assertion. */ - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - /* Inactivate Message Buffer. */ - if (enable) - { - base->MB[mbIdx].CS = CAN_CS_CODE(kFLEXCAN_TxMbInactive); - } - else - { - base->MB[mbIdx].CS = 0; - } - - /* Clean Message Buffer content. */ - base->MB[mbIdx].ID = 0x0; - base->MB[mbIdx].WORD0 = 0x0; - base->MB[mbIdx].WORD1 = 0x0; -} - -/*! - * brief Calculates the segment values for a single bit time for classical CAN. - * - * This function use to calculates the Classical CAN segment values which will be set in CTRL1/CBT/ENCBT register. - * - * param bitRate The classical CAN bit rate in bps. - * param base FlexCAN peripheral base address. - * param tqNum Number of time quantas per bit, range in 8 ~ 25 when use CTRL1, range in 8 ~ 129 when use CBT, range in - * 8 ~ 385 when use ENCBT. param pTimingConfig Pointer to the FlexCAN timing configuration structure. - */ -static void FLEXCAN_GetSegments(CAN_Type *base, - uint32_t bitRate, - uint32_t tqNum, - flexcan_timing_config_t *pTimingConfig) -{ - uint32_t ideal_sp; - uint32_t seg1Max, proSegMax; - uint32_t seg1Temp; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0 != FSL_FEATURE_FLEXCAN_INSTANCE_HAS_FLEXIBLE_DATA_RATEn(base)) - { -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - /* Maximum value allowed in ENCBT register. */ - seg1Max = MAX_NTSEG2 + 1U; - proSegMax = MAX_NTSEG1 - MAX_NTSEG2; -#else - /* Maximum value allowed in CBT register. */ - seg1Max = MAX_EPSEG1 + 1U; - proSegMax = MAX_EPROPSEG + 1U; -#endif - } - else - { - /* Maximum value allowed in CTRL1 register. */ - seg1Max = MAX_PSEG1 + 1U; - proSegMax = MAX_PROPSEG + 1U; - } -#else - /* Maximum value allowed in CTRL1 register. */ - seg1Max = MAX_PSEG1 + 1U; - proSegMax = MAX_PROPSEG + 1U; -#endif - - /* Try to find the ideal sample point, according to CiA 301 doc.*/ - if (bitRate == 1000000U) - { - ideal_sp = IDEAL_SP_LOW; - } - else if (bitRate >= 800000U) - { - ideal_sp = IDEAL_SP_MID; - } - else - { - ideal_sp = IDEAL_SP_HIGH; - } - /* Calculates phaseSeg2. */ - pTimingConfig->phaseSeg2 = (uint8_t)(tqNum - (tqNum * ideal_sp) / (uint32_t)IDEAL_SP_FACTOR); - if (pTimingConfig->phaseSeg2 < MIN_TIME_SEGMENT2) - { - pTimingConfig->phaseSeg2 = MIN_TIME_SEGMENT2; - } - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0 != FSL_FEATURE_FLEXCAN_INSTANCE_HAS_FLEXIBLE_DATA_RATEn(base)) - { -#if !(defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - if (pTimingConfig->phaseSeg2 > (uint8_t)(MAX_EPSEG2 + 1U)) - { - pTimingConfig->phaseSeg2 = (uint8_t)(MAX_EPSEG2 + 1U); - } -#endif - } -#endif - - /* Calculates phaseSeg1 and propSeg and try to make phaseSeg1 equal to phaseSeg2. */ - if ((tqNum - pTimingConfig->phaseSeg2 - 1U) > (seg1Max + proSegMax)) - { - seg1Temp = seg1Max + proSegMax; - pTimingConfig->phaseSeg2 = (uint8_t)(tqNum - 1U - seg1Temp); - } - else - { - seg1Temp = tqNum - pTimingConfig->phaseSeg2 - 1U; - } - if (seg1Temp > (pTimingConfig->phaseSeg2 + proSegMax)) - { - pTimingConfig->propSeg = (uint8_t)proSegMax; - pTimingConfig->phaseSeg1 = (uint8_t)(seg1Temp - proSegMax); - } - else - { - pTimingConfig->propSeg = (uint8_t)(seg1Temp - pTimingConfig->phaseSeg2); - pTimingConfig->phaseSeg1 = pTimingConfig->phaseSeg2; - } - - /* rJumpwidth (sjw) is the minimum value of phaseSeg1 and phaseSeg2. */ - pTimingConfig->rJumpwidth = - (pTimingConfig->phaseSeg1 > pTimingConfig->phaseSeg2) ? pTimingConfig->phaseSeg2 : pTimingConfig->phaseSeg1; -#if !(defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (pTimingConfig->rJumpwidth > (MAX_RJW + 1U)) - { - pTimingConfig->rJumpwidth = (uint8_t)(MAX_RJW + 1U); - } -#else - if (0 == FSL_FEATURE_FLEXCAN_INSTANCE_HAS_FLEXIBLE_DATA_RATEn(base)) - { - if (pTimingConfig->rJumpwidth > (MAX_RJW + 1U)) - { - pTimingConfig->rJumpwidth = (uint8_t)(MAX_RJW + 1U); - } - } -#endif - - pTimingConfig->phaseSeg1 -= 1U; - pTimingConfig->phaseSeg2 -= 1U; - pTimingConfig->propSeg -= 1U; - pTimingConfig->rJumpwidth -= 1U; -} - -/*! - * brief Calculates the improved timing values by specific bit Rates for classical CAN. - * - * This function use to calculates the Classical CAN timing values according to the given bit rate. The Calculated - * timing values will be set in CTRL1/CBT/ENCBT register. The calculation is based on the recommendation of the CiA 301 - * v4.2.0 and previous version document. - * - * param base FlexCAN peripheral base address. - * param bitRate The classical CAN speed in bps defined by user, should be less than or equal to 1Mbps. - * param sourceClock_Hz The Source clock frequency in Hz. - * param pTimingConfig Pointer to the FlexCAN timing configuration structure. - * - * return TRUE if timing configuration found, FALSE if failed to find configuration. - */ -bool FLEXCAN_CalculateImprovedTimingValues(CAN_Type *base, - uint32_t bitRate, - uint32_t sourceClock_Hz, - flexcan_timing_config_t *pTimingConfig) -{ - /* Observe bit rate maximums. */ - assert(bitRate <= MAX_CAN_BITRATE); - - uint32_t clk; - uint32_t tqNum, tqMin, pdivMAX; - uint32_t spTemp = 1000U; - flexcan_timing_config_t configTemp = {0}; - bool fgRet = false; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0 != FSL_FEATURE_FLEXCAN_INSTANCE_HAS_FLEXIBLE_DATA_RATEn(base)) - { -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - /* Auto Improved Protocal timing for ENCBT. */ - tqNum = ENCBT_MAX_TIME_QUANTA; - tqMin = ENCBT_MIN_TIME_QUANTA; - pdivMAX = MAX_ENPRESDIV; -#else - /* Auto Improved Protocal timing for CBT. */ - tqNum = CBT_MAX_TIME_QUANTA; - tqMin = CBT_MIN_TIME_QUANTA; - pdivMAX = MAX_PRESDIV; -#endif - } - else - { - /* Auto Improved Protocal timing for CTRL1. */ - tqNum = CTRL1_MAX_TIME_QUANTA; - tqMin = CTRL1_MIN_TIME_QUANTA; - pdivMAX = MAX_PRESDIV; - } -#else - /* Auto Improved Protocal timing for CTRL1. */ - tqNum = CTRL1_MAX_TIME_QUANTA; - tqMin = CTRL1_MIN_TIME_QUANTA; - pdivMAX = MAX_PRESDIV; -#endif - do - { - clk = bitRate * tqNum; - if (clk > sourceClock_Hz) - { - continue; /* tqNum too large, clk has been exceed sourceClock_Hz. */ - } - - if ((sourceClock_Hz / clk * clk) != sourceClock_Hz) - { - continue; /* Non-supporting: the frequency of clock source is not divisible by target bit rate, the user - should change a divisible bit rate. */ - } - - configTemp.preDivider = (uint16_t)(sourceClock_Hz / clk) - 1U; - if (configTemp.preDivider > pdivMAX) - { - break; /* The frequency of source clock is too large or the bit rate is too small, the pre-divider could - not handle it. */ - } - - /* Calculates the best timing configuration under current tqNum. */ - FLEXCAN_GetSegments(base, bitRate, tqNum, &configTemp); - /* Determine whether the calculated timing configuration can get the optimal sampling point. */ - if (((((uint32_t)configTemp.phaseSeg2 + 1U) * 1000U) / tqNum) < spTemp) - { - spTemp = (((uint32_t)configTemp.phaseSeg2 + 1U) * 1000U) / tqNum; - pTimingConfig->preDivider = configTemp.preDivider; - pTimingConfig->rJumpwidth = configTemp.rJumpwidth; - pTimingConfig->phaseSeg1 = configTemp.phaseSeg1; - pTimingConfig->phaseSeg2 = configTemp.phaseSeg2; - pTimingConfig->propSeg = configTemp.propSeg; - } - fgRet = true; - } while (--tqNum >= tqMin); - - return fgRet; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * brief Get Mailbox offset number by dword. - * - * This function gets the offset number of the specified mailbox. - * Mailbox is not consecutive between memory regions when payload is not 8 bytes - * so need to calculate the specified mailbox address. - * For example, in the first memory region, MB[0].CS address is 0x4002_4080. For 32 bytes - * payload frame, the second mailbox is ((1/12)*512 + 1%12*40)/4 = 10, meaning 10 dword - * after the 0x4002_4080, which is actually the address of mailbox MB[1].CS. - * - * param base FlexCAN peripheral base address. - * param mbIdx Mailbox index. - */ -static uint32_t FLEXCAN_GetFDMailboxOffset(CAN_Type *base, uint8_t mbIdx) -{ - uint32_t offset = 0; - uint32_t dataSize = (base->FDCTRL & CAN_FDCTRL_MBDSR0_MASK) >> CAN_FDCTRL_MBDSR0_SHIFT; - if (dataSize == (uint32_t)kFLEXCAN_8BperMB) - { - offset = (((uint32_t)mbIdx / 32U) * 512U + ((uint32_t)mbIdx % 32U) * 16U); - } - else if (dataSize == (uint32_t)kFLEXCAN_16BperMB) - { - offset = (((uint32_t)mbIdx / 21U) * 512U + ((uint32_t)mbIdx % 21U) * 24U); - } - else if (dataSize == (uint32_t)kFLEXCAN_32BperMB) - { - offset = (((uint32_t)mbIdx / 12U) * 512U + ((uint32_t)mbIdx % 12U) * 40U); - } - else - { - offset = (((uint32_t)mbIdx / 7U) * 512U + ((uint32_t)mbIdx % 7U) * 72U); - } - - /* To get the dword aligned offset, need to divide by 4. */ - offset = offset / 4U; - return offset; -} - -/*! - * brief Calculates the segment values for a single bit time for CAN FD data phase. - * - * This function use to calculates the CAN FD data phase segment values which will be set in CFDCBT/EDCBT - * register. - * - * param bitRateFD CAN FD data phase bit rate. - * param tqNum Number of time quanta per bit - * param pTimingConfig Pointer to the FlexCAN timing configuration structure. - */ -static void FLEXCAN_FDGetSegments(uint32_t bitRateFD, uint32_t tqNum, flexcan_timing_config_t *pTimingConfig) -{ - uint32_t ideal_sp; - uint32_t seg1Max, proSegMax, seg2Max; - uint32_t seg1Temp; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - /* Maximum value allowed in EDCBT register. */ - seg1Max = MAX_DTSEG2 + 1U; - proSegMax = MAX_DTSEG1 - MAX_DTSEG2; - seg2Max = MAX_DTSEG2 + 1U; -#else - /* Maximum value allowed in FDCBT register. */ - seg1Max = MAX_FPSEG1 + 1U; - proSegMax = MAX_FPROPSEG; - seg2Max = MAX_FPSEG2 + 1U; -#endif - - /* According to CiA doc 1301 v1.0.0, which specified data phase sample point postion for CAN FD at 80 MHz. */ - if (bitRateFD <= 1000000U) - { - ideal_sp = IDEAL_DATA_SP_1; - } - else if (bitRateFD <= 2000000U) - { - ideal_sp = IDEAL_DATA_SP_2; - } - else if (bitRateFD <= 4000000U) - { - ideal_sp = IDEAL_DATA_SP_3; - } - else - { - ideal_sp = IDEAL_DATA_SP_4; - } - - /* Calculates fphaseSeg2. */ - pTimingConfig->fphaseSeg2 = (uint8_t)(tqNum - (tqNum * ideal_sp) / (uint32_t)IDEAL_SP_FACTOR); - if (pTimingConfig->fphaseSeg2 < MIN_TIME_SEGMENT2) - { - pTimingConfig->fphaseSeg2 = MIN_TIME_SEGMENT2; - } - else if (pTimingConfig->fphaseSeg2 > seg2Max) - { - pTimingConfig->fphaseSeg2 = (uint8_t)seg2Max; - } - else - { - ; /* Intentional empty */ - } - - /* Calculates fphaseSeg1 and fpropSeg and try to make phaseSeg1 equal to phaseSeg2 */ - if ((tqNum - pTimingConfig->fphaseSeg2 - 1U) > (seg1Max + proSegMax)) - { - seg1Temp = seg1Max + proSegMax; - pTimingConfig->fphaseSeg2 = (uint8_t)(tqNum - 1U - seg1Temp); - } - else - { - seg1Temp = tqNum - pTimingConfig->fphaseSeg2 - 1U; - } - if (seg1Temp > (pTimingConfig->fphaseSeg2 + proSegMax)) - { - pTimingConfig->fpropSeg = (uint8_t)proSegMax; - pTimingConfig->fphaseSeg1 = (uint8_t)(seg1Temp - proSegMax); - } - else if (seg1Temp > pTimingConfig->fphaseSeg2) - { - pTimingConfig->fpropSeg = (uint8_t)(seg1Temp - pTimingConfig->fphaseSeg2); - pTimingConfig->fphaseSeg1 = pTimingConfig->fphaseSeg2; - } - else - { - pTimingConfig->fpropSeg = 0U; - pTimingConfig->fphaseSeg1 = (uint8_t)seg1Temp; - } - - /* rJumpwidth (sjw) is the minimum value of phaseSeg1 and phaseSeg2. */ - pTimingConfig->frJumpwidth = - (pTimingConfig->fphaseSeg1 > pTimingConfig->fphaseSeg2) ? pTimingConfig->fphaseSeg2 : pTimingConfig->fphaseSeg1; - - pTimingConfig->fphaseSeg1 -= 1U; - pTimingConfig->fphaseSeg2 -= 1U; - pTimingConfig->frJumpwidth -= 1U; -} - -/*! - * brief Calculates the improved timing values by specific bit rate for CAN FD nominal phase. - * - * This function use to calculates the CAN FD nominal phase timing values according to the given nominal phase bit rate. - * The Calculated timing values will be set in CBT/ENCBT registers. The calculation is based on the recommendation of - * the CiA 1301 v1.0.0 document. - * - * param bitRate The CAN FD nominal phase speed in bps defined by user, should be less than or equal to 1Mbps. - * param sourceClock_Hz The Source clock frequency in Hz. - * param pTimingConfig Pointer to the FlexCAN timing configuration structure. - * - * return TRUE if timing configuration found, FALSE if failed to find configuration. - */ -static bool FLEXCAN_CalculateImprovedNominalTimingValues(uint32_t bitRate, - uint32_t sourceClock_Hz, - flexcan_timing_config_t *pTimingConfig) -{ - /* Observe bit rate maximums. */ - assert(bitRate <= MAX_CAN_BITRATE); - - uint32_t clk; - uint32_t tqNum, tqMin, pdivMAX, seg1Max, proSegMax, seg1Temp; - uint32_t spTemp = 1000U; - flexcan_timing_config_t configTemp = {0}; - bool fgRet = false; - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - /* Auto Improved Protocal timing for ENCBT. */ - tqNum = ENCBT_MAX_TIME_QUANTA; - tqMin = ENCBT_MIN_TIME_QUANTA; - pdivMAX = MAX_ENPRESDIV; - seg1Max = MAX_NTSEG2 + 1U; - proSegMax = MAX_NTSEG1 - MAX_NTSEG2; -#else - /* Auto Improved Protocal timing for CBT. */ - tqNum = CBT_MAX_TIME_QUANTA; - tqMin = CBT_MIN_TIME_QUANTA; - pdivMAX = MAX_PRESDIV; - seg1Max = MAX_EPSEG1 + 1U; - proSegMax = MAX_EPROPSEG + 1U; -#endif - - do - { - clk = bitRate * tqNum; - if (clk > sourceClock_Hz) - { - continue; /* tqNum too large, clk has been exceed sourceClock_Hz. */ - } - - if ((sourceClock_Hz / clk * clk) != sourceClock_Hz) - { - continue; /* Non-supporting: the frequency of clock source is not divisible by target bit rate, the user - should change a divisible bit rate. */ - } - - configTemp.preDivider = (uint16_t)(sourceClock_Hz / clk) - 1U; - if (configTemp.preDivider > pdivMAX) - { - break; /* The frequency of source clock is too large or the bit rate is too small, the pre-divider could - not handle it. */ - } - - /* Calculates the best timing configuration under current tqNum. */ - configTemp.phaseSeg2 = (uint8_t)(tqNum - (tqNum * IDEAL_NOMINAL_SP) / (uint32_t)IDEAL_SP_FACTOR); - - /* Calculates phaseSeg1 and propSeg and try to make phaseSeg1 equal to phaseSeg2. */ - if ((tqNum - configTemp.phaseSeg2 - 1U) > (seg1Max + proSegMax)) - { - seg1Temp = seg1Max + proSegMax; - configTemp.phaseSeg2 = (uint8_t)(tqNum - 1U - seg1Temp); - } - else - { - seg1Temp = tqNum - configTemp.phaseSeg2 - 1U; - } - if (seg1Temp > (configTemp.phaseSeg2 + proSegMax)) - { - configTemp.propSeg = (uint8_t)proSegMax; - configTemp.phaseSeg1 = (uint8_t)(seg1Temp - proSegMax); - } - else - { - configTemp.propSeg = (uint8_t)(seg1Temp - configTemp.phaseSeg2); - configTemp.phaseSeg1 = configTemp.phaseSeg2; - } - - /* rJumpwidth (sjw) is the minimum value of phaseSeg1 and phaseSeg2. */ - configTemp.rJumpwidth = - (configTemp.phaseSeg1 > configTemp.phaseSeg2) ? configTemp.phaseSeg2 : configTemp.phaseSeg1; - configTemp.phaseSeg1 -= 1U; - configTemp.phaseSeg2 -= 1U; - configTemp.propSeg -= 1U; - configTemp.rJumpwidth -= 1U; - - if (((((uint32_t)configTemp.phaseSeg2 + 1U) * 1000U) / tqNum) < spTemp) - { - spTemp = (((uint32_t)configTemp.phaseSeg2 + 1U) * 1000U) / tqNum; - pTimingConfig->preDivider = configTemp.preDivider; - pTimingConfig->rJumpwidth = configTemp.rJumpwidth; - pTimingConfig->phaseSeg1 = configTemp.phaseSeg1; - pTimingConfig->phaseSeg2 = configTemp.phaseSeg2; - pTimingConfig->propSeg = configTemp.propSeg; - } - fgRet = true; - } while (--tqNum >= tqMin); - - return fgRet; -} - -/*! - * brief Calculates the improved timing values by specific bit rates for CAN FD. - * - * This function use to calculates the CAN FD timing values according to the given nominal phase bit rate and data phase - * bit rate. The Calculated timing values will be set in CBT/ENCBT and FDCBT/EDCBT registers. The calculation is based - * on the recommendation of the CiA 1301 v1.0.0 document. - * - * param bitRate The CAN FD nominal phase speed in bps defined by user. - * param bitRateFD The CAN FD data phase speed in bps defined by user. Equal to bitRate means disable bit rate - * switching. param sourceClock_Hz The Source clock frequency in Hz. param pTimingConfig Pointer to the FlexCAN timing - * configuration structure. - * - * return TRUE if timing configuration found, FALSE if failed to find configuration - */ -bool FLEXCAN_FDCalculateImprovedTimingValues(CAN_Type *base, - uint32_t bitRate, - uint32_t bitRateFD, - uint32_t sourceClock_Hz, - flexcan_timing_config_t *pTimingConfig) -{ - /* Observe bit rate maximums */ - assert(bitRate <= MAX_CANFD_BITRATE); - assert(bitRateFD <= MAX_CANFD_BITRATE); - /* Data phase bit rate need greater or equal to nominal phase bit rate. */ - assert(bitRate <= bitRateFD); - - uint32_t clk; - uint32_t tqMin, pdivMAX, tqTemp; - bool fgRet = false; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - /* Auto Improved Protocal timing for EDCBT. */ - tqTemp = EDCBT_MAX_TIME_QUANTA; - tqMin = EDCBT_MIN_TIME_QUANTA; - pdivMAX = MAX_EDPRESDIV; -#else - /* Auto Improved Protocal timing for FDCBT. */ - tqTemp = FDCBT_MAX_TIME_QUANTA; - tqMin = FDCBT_MIN_TIME_QUANTA; - pdivMAX = MAX_FPRESDIV; -#endif - - if (bitRate != bitRateFD) - { - /* To minimize errors when processing FD frames, try to get the same bit rate prescaler value for nominal phase - and data phase. */ - do - { - clk = bitRateFD * tqTemp; - if (clk > sourceClock_Hz) - { - continue; /* tqTemp too large, clk x tqTemp has been exceed sourceClock_Hz. */ - } - - if ((sourceClock_Hz / clk * clk) != sourceClock_Hz) - { - continue; /* the frequency of clock source is not divisible by target bit rate. */ - } - - pTimingConfig->fpreDivider = (uint16_t)(sourceClock_Hz / clk) - 1U; - - if (pTimingConfig->fpreDivider > pdivMAX) - { - break; /* The frequency of source clock is too large or the bit rate is too small, the pre-divider - could not handle it. */ - } - - /* Calculates the best data phase timing configuration. */ - FLEXCAN_FDGetSegments(bitRateFD, tqTemp, pTimingConfig); - - if (FLEXCAN_CalculateImprovedNominalTimingValues( - bitRate, sourceClock_Hz / ((uint32_t)pTimingConfig->fpreDivider + 1U), pTimingConfig)) - { - fgRet = true; - if (pTimingConfig->preDivider == 0U) - { - pTimingConfig->preDivider = pTimingConfig->fpreDivider; - break; - } - else - { - pTimingConfig->preDivider = - (pTimingConfig->preDivider + 1U) * (pTimingConfig->fpreDivider + 1U) - 1U; - continue; - } - } - } while (--tqTemp >= tqMin); - } - else - { - if (FLEXCAN_CalculateImprovedNominalTimingValues(bitRate, sourceClock_Hz, pTimingConfig)) - { - /* No need data phase timing configuration, data phase rate equal to nominal phase rate, user don't use Brs - feature. */ - pTimingConfig->fpreDivider = 0U; - pTimingConfig->frJumpwidth = 0U; - pTimingConfig->fphaseSeg1 = 0U; - pTimingConfig->fphaseSeg2 = 0U; - pTimingConfig->fpropSeg = 0U; - fgRet = true; - } - } - return fgRet; -} - -/*! - * brief Configures a FlexCAN transmit message buffer. - * - * This function aborts the previous transmission, cleans the Message Buffer, and - * configures it as a Transmit Message Buffer. - * - * param base FlexCAN peripheral base address. - * param mbIdx The Message Buffer index. - * param enable Enable/disable Tx Message Buffer. - * - true: Enable Tx Message Buffer. - * - false: Disable Tx Message Buffer. - */ -void FLEXCAN_SetFDTxMbConfig(CAN_Type *base, uint8_t mbIdx, bool enable) -{ - /* Assertion. */ - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - uint8_t cnt = 0; - uint8_t payload_dword = 1; - uint32_t dataSize; - dataSize = (base->FDCTRL & CAN_FDCTRL_MBDSR0_MASK) >> CAN_FDCTRL_MBDSR0_SHIFT; - volatile uint32_t *mbAddr = &(base->MB[0].CS); - uint32_t offset = FLEXCAN_GetFDMailboxOffset(base, mbIdx); -#if ((defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829)) - uint32_t availoffset = FLEXCAN_GetFDMailboxOffset(base, FLEXCAN_GetFirstValidMb(base)); -#endif - - /* Inactivate Message Buffer. */ - if (enable) - { - /* Inactivate by writing CS. */ - mbAddr[offset] = CAN_CS_CODE(kFLEXCAN_TxMbInactive); - } - else - { - mbAddr[offset] = 0x0; - } - - /* Calculate the DWORD number, dataSize 0/1/2/3 corresponds to 8/16/32/64 - Bytes payload. */ - for (cnt = 0; cnt < (dataSize + 1U); cnt++) - { - payload_dword *= 2U; - } - - /* Clean ID. */ - mbAddr[offset + 1U] = 0x0U; - /* Clean Message Buffer content, DWORD by DWORD. */ - for (cnt = 0; cnt < payload_dword; cnt++) - { - mbAddr[offset + 2U + cnt] = 0x0U; - } - -#if ((defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829)) - mbAddr[availoffset] = CAN_CS_CODE(kFLEXCAN_TxMbInactive); -#endif -} -#endif /* FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE */ - -/*! - * brief Configures a FlexCAN Receive Message Buffer. - * - * This function cleans a FlexCAN build-in Message Buffer and configures it - * as a Receive Message Buffer. - * - * param base FlexCAN peripheral base address. - * param mbIdx The Message Buffer index. - * param pRxMbConfig Pointer to the FlexCAN Message Buffer configuration structure. - * param enable Enable/disable Rx Message Buffer. - * - true: Enable Rx Message Buffer. - * - false: Disable Rx Message Buffer. - */ -void FLEXCAN_SetRxMbConfig(CAN_Type *base, uint8_t mbIdx, const flexcan_rx_mb_config_t *pRxMbConfig, bool enable) -{ - /* Assertion. */ - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); - assert(((NULL != pRxMbConfig) || (false == enable))); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - uint32_t cs_temp = 0; - - /* Inactivate Message Buffer. */ - base->MB[mbIdx].CS = 0; - - /* Clean Message Buffer content. */ - base->MB[mbIdx].ID = 0x0; - base->MB[mbIdx].WORD0 = 0x0; - base->MB[mbIdx].WORD1 = 0x0; - - if (enable) - { - /* Setup Message Buffer ID. */ - base->MB[mbIdx].ID = pRxMbConfig->id; - - /* Setup Message Buffer format. */ - if (kFLEXCAN_FrameFormatExtend == pRxMbConfig->format) - { - cs_temp |= CAN_CS_IDE_MASK; - } - - /* Setup Message Buffer type. */ - if (kFLEXCAN_FrameTypeRemote == pRxMbConfig->type) - { - cs_temp |= CAN_CS_RTR_MASK; - } - - /* Activate Rx Message Buffer. */ - cs_temp |= CAN_CS_CODE(kFLEXCAN_RxMbEmpty); - base->MB[mbIdx].CS = cs_temp; - } -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * brief Configures a FlexCAN Receive Message Buffer. - * - * This function cleans a FlexCAN build-in Message Buffer and configures it - * as a Receive Message Buffer. - * - * param base FlexCAN peripheral base address. - * param mbIdx The Message Buffer index. - * param pRxMbConfig Pointer to the FlexCAN Message Buffer configuration structure. - * param enable Enable/disable Rx Message Buffer. - * - true: Enable Rx Message Buffer. - * - false: Disable Rx Message Buffer. - */ -void FLEXCAN_SetFDRxMbConfig(CAN_Type *base, uint8_t mbIdx, const flexcan_rx_mb_config_t *pRxMbConfig, bool enable) -{ - /* Assertion. */ - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); - assert(((NULL != pRxMbConfig) || (false == enable))); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - uint32_t cs_temp = 0; - uint8_t cnt = 0; - volatile uint32_t *mbAddr = &(base->MB[0].CS); - uint32_t offset = FLEXCAN_GetFDMailboxOffset(base, mbIdx); - uint8_t payload_dword; - uint32_t dataSize = (base->FDCTRL & CAN_FDCTRL_MBDSR0_MASK) >> CAN_FDCTRL_MBDSR0_SHIFT; - - /* Inactivate Message Buffer. */ - mbAddr[offset] = 0U; - - /* Clean Message Buffer content. */ - mbAddr[offset + 1U] = 0U; - /* Calculate the DWORD number, dataSize 0/1/2/3 corresponds to 8/16/32/64 - Bytes payload. */ - payload_dword = (2U << dataSize); - for (cnt = 0; cnt < payload_dword; cnt++) - { - mbAddr[offset + 2U + cnt] = 0x0; - } - - if (enable) - { - /* Setup Message Buffer ID. */ - mbAddr[offset + 1U] = pRxMbConfig->id; - - /* Setup Message Buffer format. */ - if (kFLEXCAN_FrameFormatExtend == pRxMbConfig->format) - { - cs_temp |= CAN_CS_IDE_MASK; - } - - /* Setup Message Buffer type. */ - if (kFLEXCAN_FrameTypeRemote == pRxMbConfig->type) - { - cs_temp |= CAN_CS_RTR_MASK; - } - - /* Activate Rx Message Buffer. */ - cs_temp |= CAN_CS_CODE(kFLEXCAN_RxMbEmpty); - mbAddr[offset] = cs_temp; - } -} -#endif - -/*! - * brief Configures the FlexCAN Legacy Rx FIFO. - * - * This function configures the FlexCAN Rx FIFO with given configuration. - * note Legacy Rx FIFO only can receive classic CAN message. - * - * param base FlexCAN peripheral base address. - * param pRxFifoConfig Pointer to the FlexCAN Legacy Rx FIFO configuration structure. Can be NULL when enable parameter - * is false. - * param enable Enable/disable Legacy Rx FIFO. - * - true: Enable Legacy Rx FIFO. - * - false: Disable Legacy Rx FIFO. - */ -void FLEXCAN_SetRxFifoConfig(CAN_Type *base, const flexcan_rx_fifo_config_t *pRxFifoConfig, bool enable) -{ - /* Assertion. */ - assert((NULL != pRxFifoConfig) || (false == enable)); - - volatile uint32_t *mbAddr; - uint8_t i, j, k, rffn = 0, numMbOccupy; - uint32_t setup_mb = 0; - - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - - if (enable) - { - assert(pRxFifoConfig->idFilterNum <= 128U); -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - /* Legacy Rx FIFO and Enhanced Rx FIFO cannot be enabled at the same time. */ - assert((base->ERFCR & CAN_ERFCR_ERFEN_MASK) == 0U); -#endif - - /* Get the setup_mb value. */ - setup_mb = (uint8_t)((base->MCR & CAN_MCR_MAXMB_MASK) >> CAN_MCR_MAXMB_SHIFT); - setup_mb = (setup_mb < (uint32_t)FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(base)) ? - setup_mb : - (uint32_t)FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(base); - - /* Determine RFFN value. */ - for (i = 0; i <= 0xFU; i++) - { - if ((8U * (i + 1U)) >= pRxFifoConfig->idFilterNum) - { - rffn = i; - assert(((setup_mb - 8U) - (2U * rffn)) > 0U); - - base->CTRL2 = (base->CTRL2 & ~CAN_CTRL2_RFFN_MASK) | CAN_CTRL2_RFFN(rffn); - break; - } - } - - /* caculate the Number of Mailboxes occupied by RX Legacy FIFO and the filter. */ - numMbOccupy = 6U + (rffn + 1U) * 2U; - - /* Copy ID filter table to Message Buffer Region (Fix MISRA_C-2012 Rule 18.1). */ - j = 0U; - for (i = 6U; i < numMbOccupy; i++) - { - /* Get address for current mail box. */ - mbAddr = &(base->MB[i].CS); - - /* One Mail box contain 4U DWORD registers. */ - for (k = 0; k < 4U; k++) - { - /* Fill all valid filter in the mail box occupied by filter. - * Disable unused Rx FIFO Filter, the other rest of register in the last Mail box occupied by fiter set - * as 0xffffffff. - */ - mbAddr[k] = (j < pRxFifoConfig->idFilterNum) ? (pRxFifoConfig->idFilterTable[j]) : 0xFFFFFFFFU; - - /* Try to fill next filter in current Mail Box. */ - j++; - } - } - - /* Setup ID Fitlter Type. */ - switch (pRxFifoConfig->idFilterType) - { - case kFLEXCAN_RxFifoFilterTypeA: - base->MCR = (base->MCR & ~CAN_MCR_IDAM_MASK) | CAN_MCR_IDAM(0x0); - break; - case kFLEXCAN_RxFifoFilterTypeB: - base->MCR = (base->MCR & ~CAN_MCR_IDAM_MASK) | CAN_MCR_IDAM(0x1); - break; - case kFLEXCAN_RxFifoFilterTypeC: - base->MCR = (base->MCR & ~CAN_MCR_IDAM_MASK) | CAN_MCR_IDAM(0x2); - break; - case kFLEXCAN_RxFifoFilterTypeD: - /* All frames rejected. */ - base->MCR = (base->MCR & ~CAN_MCR_IDAM_MASK) | CAN_MCR_IDAM(0x3); - break; - default: - /* All the cases have been listed above, the default clause should not be reached. */ - assert(false); - break; - } - - /* Setting Message Reception Priority. */ - base->CTRL2 = (pRxFifoConfig->priority == kFLEXCAN_RxFifoPrioHigh) ? (base->CTRL2 & ~CAN_CTRL2_MRP_MASK) : - (base->CTRL2 | CAN_CTRL2_MRP_MASK); - - /* Enable Rx Message FIFO. */ - base->MCR |= CAN_MCR_RFEN_MASK; - } - else - { - rffn = (uint8_t)((base->CTRL2 & CAN_CTRL2_RFFN_MASK) >> CAN_CTRL2_RFFN_SHIFT); - /* caculate the Number of Mailboxes occupied by RX Legacy FIFO and the filter. */ - numMbOccupy = 6U + (rffn + 1U) * 2U; - - /* Disable Rx Message FIFO. */ - base->MCR &= ~CAN_MCR_RFEN_MASK; - - /* Clean MB0 ~ MB5 and all MB occupied by ID filters (Fix MISRA_C-2012 Rule 18.1). */ - - for (i = 0; i < numMbOccupy; i++) - { - FLEXCAN_SetRxMbConfig(base, i, NULL, false); - } - } - - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * brief Configures the FlexCAN Enhanced Rx FIFO. - * - * This function configures the Enhanced Rx FIFO with given configuration. - * note Enhanced Rx FIFO support receive classic CAN or CAN FD messages, Legacy Rx FIFO and Enhanced Rx FIFO - * cannot be enabled at the same time. - * - * param base FlexCAN peripheral base address. - * param pConfig Pointer to the FlexCAN Enhanced Rx FIFO configuration structure. Can be NULL when enable parameter - * is false. - * param enable Enable/disable Enhanced Rx FIFO. - * - true: Enable Enhanced Rx FIFO. - * - false: Disable Enhanced Rx FIFO. - */ -void FLEXCAN_SetEnhancedRxFifoConfig(CAN_Type *base, const flexcan_enhanced_rx_fifo_config_t *pConfig, bool enable) -{ - /* Assertion. */ - assert((NULL != pConfig) || (false == enable)); - uint32_t i; - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - - if (enable) - { - /* Each pair of filter elements occupies 2 words and can consist of one extended ID filter element or two - * standard ID filter elements. */ - assert((((uint32_t)pConfig->idFilterPairNum * 2UL) < - (uint32_t)FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO_FILTER_MAX_NUMBER) && - (pConfig->extendIdFilterNum <= pConfig->idFilterPairNum) && (0UL != pConfig->idFilterPairNum)); - - /* The Enhanced Rx FIFO Watermark cannot be greater than the enhanced Rx FIFO size. */ - assert(pConfig->fifoWatermark < (uint32_t)FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO_SIZE); - - /* Legacy Rx FIFO and Enhanced Rx FIFO cannot be enabled at the same time. */ - assert((base->MCR & CAN_MCR_RFEN_MASK) == 0U); - - /* Reset Enhanced Rx FIFO engine and clear flags. */ - base->ERFSR |= CAN_ERFSR_ERFCLR_MASK | CAN_ERFSR_ERFUFW_MASK | CAN_ERFSR_ERFOVF_MASK | CAN_ERFSR_ERFWMI_MASK | - CAN_ERFSR_ERFDA_MASK; - /* Setting Enhanced Rx FIFO. */ - base->ERFCR = CAN_ERFCR_DMALW(pConfig->dmaPerReadLength) | CAN_ERFCR_NEXIF(pConfig->extendIdFilterNum) | - CAN_ERFCR_NFE((uint32_t)pConfig->idFilterPairNum - 1UL) | CAN_ERFCR_ERFWM(pConfig->fifoWatermark); - /* Copy ID filter table to Enhanced Rx FIFO Filter Element registers. */ - for (i = 0; i < (uint32_t)FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO_FILTER_MAX_NUMBER; i++) - { - base->ERFFEL[i] = (i < ((uint32_t)pConfig->idFilterPairNum * 2U)) ? pConfig->idFilterTable[i] : 0xFFFFFFFFU; - } - - /* Setting Message Reception Priority. */ - base->CTRL2 = (pConfig->priority == kFLEXCAN_RxFifoPrioHigh) ? (base->CTRL2 & ~CAN_CTRL2_MRP_MASK) : - (base->CTRL2 | CAN_CTRL2_MRP_MASK); - /* Enable Enhanced Rx FIFO. */ - base->ERFCR |= CAN_ERFCR_ERFEN_MASK; - } - else - { - /* Disable Enhanced Rx FIFO. */ - base->ERFCR = 0U; - /* Reset Enhanced Rx FIFO engine and clear flags. */ - base->ERFSR |= CAN_ERFSR_ERFCLR_MASK | CAN_ERFSR_ERFUFW_MASK | CAN_ERFSR_ERFOVF_MASK | CAN_ERFSR_ERFWMI_MASK | - CAN_ERFSR_ERFDA_MASK; - /* Clean all Enhanced Rx FIFO Filter Element registers. */ - for (i = 0; i < (uint32_t)FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO_FILTER_MAX_NUMBER; i++) - { - base->ERFFEL[i] = 0xFFFFFFFFU; - } - } - - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); -} -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_RX_FIFO_DMA) && FSL_FEATURE_FLEXCAN_HAS_RX_FIFO_DMA) -/*! - * brief Enables or disables the FlexCAN Legacy/Enhanced Rx FIFO DMA request. - * - * This function enables or disables the DMA feature of FlexCAN build-in Rx FIFO. - * - * param base FlexCAN peripheral base address. - * param enable true to enable, false to disable. - */ -void FLEXCAN_EnableRxFifoDMA(CAN_Type *base, bool enable) -{ - if (enable) - { - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - - /* Enable FlexCAN DMA. */ - base->MCR |= CAN_MCR_DMA_MASK; - - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); - } - else - { - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - - /* Disable FlexCAN DMA. */ - base->MCR &= ~CAN_MCR_DMA_MASK; - - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); - } -} -#endif /* FSL_FEATURE_FLEXCAN_HAS_RX_FIFO_DMA */ - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -/*! - * brief Gets the FlexCAN Memory Error Report registers status. - * - * This function gets the FlexCAN Memory Error Report registers status. - * - * param base FlexCAN peripheral base address. - * param errorStatus Pointer to FlexCAN Memory Error Report registers status structure. - */ -void FLEXCAN_GetMemoryErrorReportStatus(CAN_Type *base, flexcan_memory_error_report_status_t *errorStatus) -{ - uint32_t temp; - /* Disable updates of the error report registers. */ - base->MECR |= CAN_MECR_RERRDIS_MASK; - - errorStatus->accessAddress = (uint16_t)(base->RERRAR & CAN_RERRAR_ERRADDR_MASK); - errorStatus->errorData = base->RERRDR; - errorStatus->errorType = - (base->RERRAR & CAN_RERRAR_NCE_MASK) == 0U ? kFLEXCAN_CorrectableError : kFLEXCAN_NonCorrectableError; - - temp = (base->RERRAR & CAN_RERRAR_SAID_MASK) >> CAN_RERRAR_SAID_SHIFT; - switch (temp) - { - case (uint32_t)kFLEXCAN_MoveOutFlexCanAccess: - case (uint32_t)kFLEXCAN_MoveInAccess: - case (uint32_t)kFLEXCAN_TxArbitrationAccess: - case (uint32_t)kFLEXCAN_RxMatchingAccess: - case (uint32_t)kFLEXCAN_MoveOutHostAccess: - errorStatus->accessType = (flexcan_memory_access_type_t)temp; - break; - default: - assert(false); - break; - } - - for (uint32_t i = 0; i < 4U; i++) - { - temp = (base->RERRSYNR & ((uint32_t)CAN_RERRSYNR_SYND0_MASK << (i * 8U))) >> (i * 8U); - errorStatus->byteStatus[i].byteIsRead = (base->RERRSYNR & ((uint32_t)CAN_RERRSYNR_BE0_MASK << (i * 8U))) != 0U; - switch (temp) - { - case CAN_RERRSYNR_SYND0(kFLEXCAN_NoError): - case CAN_RERRSYNR_SYND0(kFLEXCAN_ParityBits0Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_ParityBits1Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_ParityBits2Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_ParityBits3Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_ParityBits4Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_DataBits0Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_DataBits1Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_DataBits2Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_DataBits3Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_DataBits4Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_DataBits5Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_DataBits6Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_DataBits7Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_AllZeroError): - case CAN_RERRSYNR_SYND0(kFLEXCAN_AllOneError): - errorStatus->byteStatus[i].bitAffected = (flexcan_byte_error_syndrome_t)temp; - break; - default: - errorStatus->byteStatus[i].bitAffected = kFLEXCAN_NonCorrectableErrors; - break; - } - } - - /* Re-enable updates of the error report registers. */ - base->MECR &= CAN_MECR_RERRDIS_MASK; -} -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_6032) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_6032) -/*! - * FlexCAN: A frame with wrong ID or payload is transmitted into - * the CAN bus when the Message Buffer under transmission is - * either aborted or deactivated while the CAN bus is in the Bus Idle state - * - * This function to do workaround for ERR006032 - * - * param base FlexCAN peripheral base address. - * param mbIdx The FlexCAN Message Buffer index. - */ -static void FLEXCAN_ERRATA_6032(CAN_Type *base, volatile uint32_t *mbCSAddr) -{ - uint32_t dbg_temp = 0U; - uint32_t u32TempCS = 0U; - uint32_t u32Timeout = DELAY_BUSIDLE; - /*disable ALL interrupts to prevent any context switching*/ - uint32_t irqMask = DisableGlobalIRQ(); - dbg_temp = (uint32_t)(base->DBG1); - switch (dbg_temp & CAN_DBG1_CFSM_MASK) - { - case RXINTERMISSION: - if (CBN_VALUE3 == (dbg_temp & CAN_DBG1_CBN_MASK)) - { - /*wait until CFSM is different from RXINTERMISSION */ - while (RXINTERMISSION == (base->DBG1 & CAN_DBG1_CFSM_MASK)) - { - __NOP(); - } - } - break; - case TXINTERMISSION: - if (CBN_VALUE3 == (dbg_temp & CAN_DBG1_CBN_MASK)) - { - /*wait until CFSM is different from TXINTERMISSION*/ - while (TXINTERMISSION == (base->DBG1 & CAN_DBG1_CFSM_MASK)) - { - __NOP(); - } - } - break; - default: - /* To avoid MISRA-C 2012 rule 16.4 issue. */ - break; - } - /*Anyway, BUSIDLE need to delay*/ - if (BUSIDLE == (base->DBG1 & CAN_DBG1_CFSM_MASK)) - { - while (u32Timeout-- > 0U) - { - __NOP(); - } - - /*Write 0x0 into Code field of CS word.*/ - u32TempCS = (uint32_t)(*mbCSAddr); - u32TempCS &= ~CAN_CS_CODE_MASK; - *mbCSAddr = u32TempCS; - } - /*restore interruption*/ - EnableGlobalIRQ(irqMask); -} -#endif - -/*! - * brief Writes a FlexCAN Message to the Transmit Message Buffer. - * - * This function writes a CAN Message to the specified Transmit Message Buffer - * and changes the Message Buffer state to start CAN Message transmit. After - * that the function returns immediately. - * - * param base FlexCAN peripheral base address. - * param mbIdx The FlexCAN Message Buffer index. - * param pTxFrame Pointer to CAN message frame to be sent. - * retval kStatus_Success - Write Tx Message Buffer Successfully. - * retval kStatus_Fail - Tx Message Buffer is currently in use. - */ -status_t FLEXCAN_WriteTxMb(CAN_Type *base, uint8_t mbIdx, const flexcan_frame_t *pTxFrame) -{ - /* Assertion. */ - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); - assert(NULL != pTxFrame); - assert(pTxFrame->length <= 8U); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - uint32_t cs_temp = 0; - status_t status; - - /* Check if Message Buffer is available. */ - if (CAN_CS_CODE(kFLEXCAN_TxMbDataOrRemote) != (base->MB[mbIdx].CS & CAN_CS_CODE_MASK)) - { -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_6032) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_6032) - FLEXCAN_ERRATA_6032(base, &(base->MB[mbIdx].CS)); -#endif - /* Inactive Tx Message Buffer. */ - base->MB[mbIdx].CS = (base->MB[mbIdx].CS & ~CAN_CS_CODE_MASK) | CAN_CS_CODE(kFLEXCAN_TxMbInactive); - - /* Fill Message ID field. */ - base->MB[mbIdx].ID = pTxFrame->id; - - /* Fill Message Format field. */ - if ((uint32_t)kFLEXCAN_FrameFormatExtend == pTxFrame->format) - { - cs_temp |= CAN_CS_SRR_MASK | CAN_CS_IDE_MASK; - } - - /* Fill Message Type field. */ - if ((uint32_t)kFLEXCAN_FrameTypeRemote == pTxFrame->type) - { - cs_temp |= CAN_CS_RTR_MASK; - } - - cs_temp |= CAN_CS_CODE(kFLEXCAN_TxMbDataOrRemote) | CAN_CS_DLC(pTxFrame->length); - - /* Load Message Payload. */ - base->MB[mbIdx].WORD0 = pTxFrame->dataWord0; - base->MB[mbIdx].WORD1 = pTxFrame->dataWord1; - - /* Activate Tx Message Buffer. */ - base->MB[mbIdx].CS = cs_temp; - -#if ((defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829)) - base->MB[FLEXCAN_GetFirstValidMb(base)].CS = CAN_CS_CODE(kFLEXCAN_TxMbInactive); - base->MB[FLEXCAN_GetFirstValidMb(base)].CS = CAN_CS_CODE(kFLEXCAN_TxMbInactive); -#endif - - status = kStatus_Success; - } - else - { - /* Tx Message Buffer is activated, return immediately. */ - status = kStatus_Fail; - } - - return status; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * brief Writes a FlexCAN FD Message to the Transmit Message Buffer. - * - * This function writes a CAN FD Message to the specified Transmit Message Buffer - * and changes the Message Buffer state to start CAN FD Message transmit. After - * that the function returns immediately. - * - * param base FlexCAN peripheral base address. - * param mbIdx The FlexCAN FD Message Buffer index. - * param pTxFrame Pointer to CAN FD message frame to be sent. - * retval kStatus_Success - Write Tx Message Buffer Successfully. - * retval kStatus_Fail - Tx Message Buffer is currently in use. - */ -status_t FLEXCAN_WriteFDTxMb(CAN_Type *base, uint8_t mbIdx, const flexcan_fd_frame_t *pTxFrame) -{ - /* Assertion. */ - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); - assert(NULL != pTxFrame); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - status_t status; - uint32_t cs_temp = 0; - uint8_t cnt = 0; - uint32_t can_cs = 0; - uint8_t payload_dword = 1; - uint32_t dataSize = (base->FDCTRL & CAN_FDCTRL_MBDSR0_MASK) >> CAN_FDCTRL_MBDSR0_SHIFT; -#if ((defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829)) - uint32_t availoffset = FLEXCAN_GetFDMailboxOffset(base, FLEXCAN_GetFirstValidMb(base)); -#endif - volatile uint32_t *mbAddr = &(base->MB[0].CS); - uint32_t offset = FLEXCAN_GetFDMailboxOffset(base, mbIdx); - - can_cs = mbAddr[offset]; - /* Check if Message Buffer is available. */ - if (CAN_CS_CODE(kFLEXCAN_TxMbDataOrRemote) != (can_cs & CAN_CS_CODE_MASK)) - { -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_6032) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_6032) - FLEXCAN_ERRATA_6032(base, &(mbAddr[offset])); -#endif - /* Inactive Tx Message Buffer and Fill Message ID field. */ - mbAddr[offset] = (can_cs & ~CAN_CS_CODE_MASK) | CAN_CS_CODE(kFLEXCAN_TxMbInactive); - mbAddr[offset + 1U] = pTxFrame->id; - - /* Fill Message Format field. */ - if ((uint32_t)kFLEXCAN_FrameFormatExtend == pTxFrame->format) - { - cs_temp |= CAN_CS_SRR_MASK | CAN_CS_IDE_MASK; - } - - /* Fill Message Type field. */ - if ((uint32_t)kFLEXCAN_FrameTypeRemote == pTxFrame->type) - { - cs_temp |= CAN_CS_RTR_MASK; - } - - cs_temp |= CAN_CS_CODE(kFLEXCAN_TxMbDataOrRemote) | CAN_CS_DLC(pTxFrame->length) | CAN_CS_EDL(pTxFrame->edl) | - CAN_CS_BRS(pTxFrame->brs); - - /* Calculate the DWORD number, dataSize 0/1/2/3 corresponds to 8/16/32/64 - Bytes payload. */ - for (cnt = 0; cnt < (dataSize + 1U); cnt++) - { - payload_dword *= 2U; - } - - /* Load Message Payload and Activate Tx Message Buffer. */ - for (cnt = 0; cnt < payload_dword; cnt++) - { - mbAddr[offset + 2U + cnt] = pTxFrame->dataWord[cnt]; - } - mbAddr[offset] = cs_temp; - -#if ((defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829)) - mbAddr[availoffset] = CAN_CS_CODE(kFLEXCAN_TxMbInactive); - mbAddr[availoffset] = CAN_CS_CODE(kFLEXCAN_TxMbInactive); -#endif - - status = kStatus_Success; - } - else - { - /* Tx Message Buffer is activated, return immediately. */ - status = kStatus_Fail; - } - - return status; -} -#endif - -/*! - * brief Reads a FlexCAN Message from Receive Message Buffer. - * - * This function reads a CAN message from a specified Receive Message Buffer. - * The function fills a receive CAN message frame structure with - * just received data and activates the Message Buffer again. - * The function returns immediately. - * - * param base FlexCAN peripheral base address. - * param mbIdx The FlexCAN Message Buffer index. - * param pRxFrame Pointer to CAN message frame structure for reception. - * retval kStatus_Success - Rx Message Buffer is full and has been read successfully. - * retval kStatus_FLEXCAN_RxOverflow - Rx Message Buffer is already overflowed and has been read successfully. - * retval kStatus_Fail - Rx Message Buffer is empty. - */ -status_t FLEXCAN_ReadRxMb(CAN_Type *base, uint8_t mbIdx, flexcan_frame_t *pRxFrame) -{ - /* Assertion. */ - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); - assert(NULL != pRxFrame); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - uint32_t cs_temp; - uint32_t rx_code; - status_t status; - - /* Read CS field of Rx Message Buffer to lock Message Buffer. */ - cs_temp = base->MB[mbIdx].CS; - /* Get Rx Message Buffer Code field. */ - rx_code = (cs_temp & CAN_CS_CODE_MASK) >> CAN_CS_CODE_SHIFT; - - /* Check to see if Rx Message Buffer is full. */ - if (((uint32_t)kFLEXCAN_RxMbFull == rx_code) || ((uint32_t)kFLEXCAN_RxMbOverrun == rx_code)) - { - /* Store Message ID. */ - pRxFrame->id = base->MB[mbIdx].ID & (CAN_ID_EXT_MASK | CAN_ID_STD_MASK); - - /* Get the message ID and format. */ - pRxFrame->format = (cs_temp & CAN_CS_IDE_MASK) != 0U ? (uint8_t)kFLEXCAN_FrameFormatExtend : - (uint8_t)kFLEXCAN_FrameFormatStandard; - - /* Get the message type. */ - pRxFrame->type = - (cs_temp & CAN_CS_RTR_MASK) != 0U ? (uint8_t)kFLEXCAN_FrameTypeRemote : (uint8_t)kFLEXCAN_FrameTypeData; - - /* Get the message length. */ - pRxFrame->length = (uint8_t)((cs_temp & CAN_CS_DLC_MASK) >> CAN_CS_DLC_SHIFT); - - /* Get the time stamp. */ - pRxFrame->timestamp = (uint16_t)((cs_temp & CAN_CS_TIME_STAMP_MASK) >> CAN_CS_TIME_STAMP_SHIFT); - - /* Store Message Payload. */ - pRxFrame->dataWord0 = base->MB[mbIdx].WORD0; - pRxFrame->dataWord1 = base->MB[mbIdx].WORD1; - - /* Read free-running timer to unlock Rx Message Buffer. */ - (void)base->TIMER; - - if ((uint32_t)kFLEXCAN_RxMbFull == rx_code) - { - status = kStatus_Success; - } - else - { - status = kStatus_FLEXCAN_RxOverflow; - } - } - else - { - /* Read free-running timer to unlock Rx Message Buffer. */ - (void)base->TIMER; - - status = kStatus_Fail; - } - - return status; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * brief Reads a FlexCAN FD Message from Receive Message Buffer. - * - * This function reads a CAN FD message from a specified Receive Message Buffer. - * The function fills a receive CAN FD message frame structure with - * just received data and activates the Message Buffer again. - * The function returns immediately. - * - * param base FlexCAN peripheral base address. - * param mbIdx The FlexCAN FD Message Buffer index. - * param pRxFrame Pointer to CAN FD message frame structure for reception. - * retval kStatus_Success - Rx Message Buffer is full and has been read successfully. - * retval kStatus_FLEXCAN_RxOverflow - Rx Message Buffer is already overflowed and has been read successfully. - * retval kStatus_Fail - Rx Message Buffer is empty. - */ -status_t FLEXCAN_ReadFDRxMb(CAN_Type *base, uint8_t mbIdx, flexcan_fd_frame_t *pRxFrame) -{ - /* Assertion. */ - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); - assert(NULL != pRxFrame); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - status_t status; - uint32_t cs_temp; - uint8_t rx_code; - uint8_t cnt = 0; - uint32_t can_id = 0; - uint32_t dataSize; - dataSize = (base->FDCTRL & CAN_FDCTRL_MBDSR0_MASK) >> CAN_FDCTRL_MBDSR0_SHIFT; - uint8_t payload_dword = 1; - volatile uint32_t *mbAddr = &(base->MB[0].CS); - uint32_t offset = FLEXCAN_GetFDMailboxOffset(base, mbIdx); - - /* Read CS field of Rx Message Buffer to lock Message Buffer. */ - cs_temp = mbAddr[offset]; - can_id = mbAddr[offset + 1U]; - - /* Get Rx Message Buffer Code field. */ - rx_code = (uint8_t)((cs_temp & CAN_CS_CODE_MASK) >> CAN_CS_CODE_SHIFT); - - /* Check to see if Rx Message Buffer is full. */ - if (((uint8_t)kFLEXCAN_RxMbFull == rx_code) || ((uint8_t)kFLEXCAN_RxMbOverrun == rx_code)) - { - /* Store Message ID. */ - pRxFrame->id = can_id & (CAN_ID_EXT_MASK | CAN_ID_STD_MASK); - - /* Get the message ID and format. */ - pRxFrame->format = (cs_temp & CAN_CS_IDE_MASK) != 0U ? (uint8_t)kFLEXCAN_FrameFormatExtend : - (uint8_t)kFLEXCAN_FrameFormatStandard; - - /* Get Bit Rate Switch flag. */ - pRxFrame->brs = (cs_temp & CAN_CS_BRS_MASK) != 0U ? 1U : 0U; - - /* Get Extended Data Length flag. */ - pRxFrame->edl = (cs_temp & CAN_CS_EDL_MASK) != 0U ? 1U : 0U; - - /* Get the message type. */ - pRxFrame->type = - (cs_temp & CAN_CS_RTR_MASK) != 0U ? (uint8_t)kFLEXCAN_FrameTypeRemote : (uint8_t)kFLEXCAN_FrameTypeData; - - /* Get the message length. */ - pRxFrame->length = (uint8_t)((cs_temp & CAN_CS_DLC_MASK) >> CAN_CS_DLC_SHIFT); - - /* Get the time stamp. */ - pRxFrame->timestamp = (uint16_t)((cs_temp & CAN_CS_TIME_STAMP_MASK) >> CAN_CS_TIME_STAMP_SHIFT); - - /* Calculate the DWORD number, dataSize 0/1/2/3 corresponds to 8/16/32/64 - Bytes payload. */ - for (cnt = 0; cnt < (dataSize + 1U); cnt++) - { - payload_dword *= 2U; - } - - /* Store Message Payload. */ - for (cnt = 0; cnt < payload_dword; cnt++) - { - pRxFrame->dataWord[cnt] = mbAddr[offset + 2U + cnt]; - } - - /* Read free-running timer to unlock Rx Message Buffer. */ - (void)base->TIMER; - - if ((uint32_t)kFLEXCAN_RxMbFull == rx_code) - { - status = kStatus_Success; - } - else - { - status = kStatus_FLEXCAN_RxOverflow; - } - } - else - { - /* Read free-running timer to unlock Rx Message Buffer. */ - (void)base->TIMER; - - status = kStatus_Fail; - } - - return status; -} -#endif - -/*! - * brief Reads a FlexCAN Message from Legacy Rx FIFO. - * - * This function reads a CAN message from the FlexCAN Legacy Rx FIFO. - * - * param base FlexCAN peripheral base address. - * param pRxFrame Pointer to CAN message frame structure for reception. - * retval kStatus_Success - Read Message from Rx FIFO successfully. - * retval kStatus_Fail - Rx FIFO is not enabled. - */ -status_t FLEXCAN_ReadRxFifo(CAN_Type *base, flexcan_frame_t *pRxFrame) -{ - /* Assertion. */ - assert(NULL != pRxFrame); - - uint32_t cs_temp; - status_t status; - - /* Check if Legacy Rx FIFO is Enabled. */ - if (0U != (base->MCR & CAN_MCR_RFEN_MASK)) - { - /* Read CS field of Rx Message Buffer to lock Message Buffer. */ - cs_temp = base->MB[0].CS; - - /* Read data from Rx FIFO output port. */ - /* Store Message ID. */ - pRxFrame->id = base->MB[0].ID & (CAN_ID_EXT_MASK | CAN_ID_STD_MASK); - - /* Get the message ID and format. */ - pRxFrame->format = (cs_temp & CAN_CS_IDE_MASK) != 0U ? (uint8_t)kFLEXCAN_FrameFormatExtend : - (uint8_t)kFLEXCAN_FrameFormatStandard; - - /* Get the message type. */ - pRxFrame->type = - (cs_temp & CAN_CS_RTR_MASK) != 0U ? (uint8_t)kFLEXCAN_FrameTypeRemote : (uint8_t)kFLEXCAN_FrameTypeData; - - /* Get the message length. */ - pRxFrame->length = (uint8_t)((cs_temp & CAN_CS_DLC_MASK) >> CAN_CS_DLC_SHIFT); - - /* Get the time stamp. */ - pRxFrame->timestamp = (uint16_t)((cs_temp & CAN_CS_TIME_STAMP_MASK) >> CAN_CS_TIME_STAMP_SHIFT); - - /* Store Message Payload. */ - pRxFrame->dataWord0 = base->MB[0].WORD0; - pRxFrame->dataWord1 = base->MB[0].WORD1; - - /* Store ID Filter Hit Index. */ - pRxFrame->idhit = (uint16_t)(base->RXFIR & CAN_RXFIR_IDHIT_MASK); - - /* Read free-running timer to unlock Rx Message Buffer. */ - (void)base->TIMER; - - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * brief Reads a FlexCAN Message from Enhanced Rx FIFO. - * - * This function reads a CAN or CAN FD message from the FlexCAN Enhanced Rx FIFO. - * - * param base FlexCAN peripheral base address. - * param pRxFrame Pointer to CAN FD message frame structure for reception. - * retval kStatus_Success - Read Message from Rx FIFO successfully. - * retval kStatus_Fail - Rx FIFO is not enabled. - */ -status_t FLEXCAN_ReadEnhancedRxFifo(CAN_Type *base, flexcan_fd_frame_t *pRxFrame) -{ - /* Assertion. */ - assert(NULL != pRxFrame); - - status_t status; - uint32_t idHitOff; - - /* Check if Enhanced Rx FIFO is Enabled. */ - if (0U != (base->ERFCR & CAN_ERFCR_ERFEN_MASK)) - { - /* Enhanced Rx FIFO ID HIT offset is changed dynamically according to data length code (DLC) . */ - idHitOff = (DLC_LENGTH_DECODE(((flexcan_fd_frame_t *)E_RX_FIFO(base))->length) + 3U) / 4U + 3U; - /* Copy CAN FD Message from Enhanced Rx FIFO, should use the DLC value to identify the bytes that belong to the - * message which is being read. */ - (void)memcpy((void *)pRxFrame, (void *)(uint32_t *)E_RX_FIFO(base), sizeof(uint32_t) * idHitOff); - pRxFrame->idhit = pRxFrame->dataWord[idHitOff - 3U]; - /* Clear the unused frame data. */ - for (uint32_t i = (idHitOff - 3U); i < 16U; i++) - { - pRxFrame->dataWord[i] = 0x0; - } - - /* Clear data available flag to let FlexCAN know one frame has been read from the Enhanced Rx FIFO. */ - base->ERFSR = CAN_ERFSR_ERFDA_MASK; - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} -#endif - -/*! - * brief Performs a polling send transaction on the CAN bus. - * - * note A transfer handle does not need to be created before calling this API. - * - * param base FlexCAN peripheral base pointer. - * param mbIdx The FlexCAN Message Buffer index. - * param pTxFrame Pointer to CAN message frame to be sent. - * retval kStatus_Success - Write Tx Message Buffer Successfully. - * retval kStatus_Fail - Tx Message Buffer is currently in use. - */ -status_t FLEXCAN_TransferSendBlocking(CAN_Type *base, uint8_t mbIdx, flexcan_frame_t *pTxFrame) -{ - status_t status; - - /* Write Tx Message Buffer to initiate a data sending. */ - if (kStatus_Success == FLEXCAN_WriteTxMb(base, mbIdx, (const flexcan_frame_t *)(uintptr_t)pTxFrame)) - { - /* Wait until CAN Message send out. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (mbIdx >= 64U) - { - while (0U == FLEXCAN_GetHigh64MbStatusFlags(base, (uint64_t)1U << (mbIdx - 64U))) - { - } - FLEXCAN_ClearHigh64MbStatusFlags(base, (uint64_t)1U << (mbIdx - 64U)); - } - else - { - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint64_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint64_t)1U << mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER) && FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER) - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint64_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint64_t)1U << mbIdx); -#else - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint32_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint32_t)1U << mbIdx); -#endif - - /*After TX MB tranfered success, update the Timestamp from MB[mbIdx].CS register*/ - pTxFrame->timestamp = (uint16_t)((base->MB[mbIdx].CS & CAN_CS_TIME_STAMP_MASK) >> CAN_CS_TIME_STAMP_SHIFT); - - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -/*! - * brief Performs a polling receive transaction on the CAN bus. - * - * note A transfer handle does not need to be created before calling this API. - * - * param base FlexCAN peripheral base pointer. - * param mbIdx The FlexCAN Message Buffer index. - * param pRxFrame Pointer to CAN message frame structure for reception. - * retval kStatus_Success - Rx Message Buffer is full and has been read successfully. - * retval kStatus_FLEXCAN_RxOverflow - Rx Message Buffer is already overflowed and has been read successfully. - * retval kStatus_Fail - Rx Message Buffer is empty. - */ -status_t FLEXCAN_TransferReceiveBlocking(CAN_Type *base, uint8_t mbIdx, flexcan_frame_t *pRxFrame) -{ -/* Wait until Rx Message Buffer non-empty. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (mbIdx >= 64U) - { - while (0U == FLEXCAN_GetHigh64MbStatusFlags(base, (uint64_t)1U << (mbIdx - 64U))) - { - } - FLEXCAN_ClearHigh64MbStatusFlags(base, (uint64_t)1U << (mbIdx - 64U)); - } - else - { - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint64_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint64_t)1U << mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER) && FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER) - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint64_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint64_t)1U << mbIdx); -#else - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint32_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint32_t)1U << mbIdx); -#endif - - /* Read Received CAN Message. */ - return FLEXCAN_ReadRxMb(base, mbIdx, pRxFrame); -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * brief Performs a polling send transaction on the CAN bus. - * - * note A transfer handle does not need to be created before calling this API. - * - * param base FlexCAN peripheral base pointer. - * param mbIdx The FlexCAN FD Message Buffer index. - * param pTxFrame Pointer to CAN FD message frame to be sent. - * retval kStatus_Success - Write Tx Message Buffer Successfully. - * retval kStatus_Fail - Tx Message Buffer is currently in use. - */ -status_t FLEXCAN_TransferFDSendBlocking(CAN_Type *base, uint8_t mbIdx, flexcan_fd_frame_t *pTxFrame) -{ - status_t status; - - /* Write Tx Message Buffer to initiate a data sending. */ - if (kStatus_Success == FLEXCAN_WriteFDTxMb(base, mbIdx, (const flexcan_fd_frame_t *)(uintptr_t)pTxFrame)) - { - /* Wait until CAN Message send out. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (mbIdx >= 64U) - { - while (0U == FLEXCAN_GetHigh64MbStatusFlags(base, (uint64_t)1U << (mbIdx - 64U))) - { - } - FLEXCAN_ClearHigh64MbStatusFlags(base, (uint64_t)1U << (mbIdx - 64U)); - } - else - { - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint64_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint64_t)1U << mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER) && FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER) - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint64_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint64_t)1U << mbIdx); -#else - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint32_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint32_t)1U << mbIdx); -#endif - /*After TX MB tranfered success, update the Timestamp from base->MB[offset for CAN FD].CS register*/ - volatile uint32_t *mbAddr = &(base->MB[0].CS); - uint32_t offset = FLEXCAN_GetFDMailboxOffset(base, mbIdx); - pTxFrame->timestamp = (uint16_t)((mbAddr[offset] & CAN_CS_TIME_STAMP_MASK) >> CAN_CS_TIME_STAMP_SHIFT); - - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -/*! - * brief Performs a polling receive transaction on the CAN bus. - * - * note A transfer handle does not need to be created before calling this API. - * - * param base FlexCAN peripheral base pointer. - * param mbIdx The FlexCAN FD Message Buffer index. - * param pRxFrame Pointer to CAN FD message frame structure for reception. - * retval kStatus_Success - Rx Message Buffer is full and has been read successfully. - * retval kStatus_FLEXCAN_RxOverflow - Rx Message Buffer is already overflowed and has been read successfully. - * retval kStatus_Fail - Rx Message Buffer is empty. - */ -status_t FLEXCAN_TransferFDReceiveBlocking(CAN_Type *base, uint8_t mbIdx, flexcan_fd_frame_t *pRxFrame) -{ -/* Wait until Rx Message Buffer non-empty. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (mbIdx >= 64U) - { - while (0U == FLEXCAN_GetHigh64MbStatusFlags(base, (uint64_t)1U << (mbIdx - 64U))) - { - } - FLEXCAN_ClearHigh64MbStatusFlags(base, (uint64_t)1U << (mbIdx - 64U)); - } - else - { - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint64_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint64_t)1U << mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER) && FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER) - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint64_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint64_t)1U << mbIdx); -#else - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint32_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint32_t)1U << mbIdx); -#endif - - /* Read Received CAN Message. */ - return FLEXCAN_ReadFDRxMb(base, mbIdx, pRxFrame); -} -#endif - -/*! - * brief Performs a polling receive transaction from Legacy Rx FIFO on the CAN bus. - * - * note A transfer handle does not need to be created before calling this API. - * - * param base FlexCAN peripheral base pointer. - * param pRxFrame Pointer to CAN message frame structure for reception. - * retval kStatus_Success - Read Message from Rx FIFO successfully. - * retval kStatus_Fail - Rx FIFO is not enabled. - */ -status_t FLEXCAN_TransferReceiveFifoBlocking(CAN_Type *base, flexcan_frame_t *pRxFrame) -{ - status_t rxFifoStatus; - - /* Wait until Legacy Rx FIFO non-empty. */ - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint32_t)kFLEXCAN_RxFifoFrameAvlFlag)) - { - } - - /* Read data from Legacy Rx FIFO. */ - rxFifoStatus = FLEXCAN_ReadRxFifo(base, pRxFrame); - - /* Clean Rx Fifo available flag. */ - FLEXCAN_ClearMbStatusFlags(base, (uint32_t)kFLEXCAN_RxFifoFrameAvlFlag); - - return rxFifoStatus; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * brief Performs a polling receive transaction from Enhanced Rx FIFO on the CAN bus. - * - * note A transfer handle does not need to be created before calling this API. - * - * param base FlexCAN peripheral base pointer. - * param pRxFrame Pointer to CAN FD message frame structure for reception. - * retval kStatus_Success - Read Message from Rx FIFO successfully. - * retval kStatus_Fail - Rx FIFO is not enabled. - */ -status_t FLEXCAN_TransferReceiveEnhancedFifoBlocking(CAN_Type *base, flexcan_fd_frame_t *pRxFrame) -{ - status_t rxFifoStatus; - - /* Wait until Enhanced Rx FIFO non-empty. */ - while (0U == (FLEXCAN_GetStatusFlags(base) & (uint64_t)kFLEXCAN_ERxFifoDataAvlIntFlag)) - { - } - - /* Read data from Enhanced Rx FIFO */ - rxFifoStatus = FLEXCAN_ReadEnhancedRxFifo(base, pRxFrame); - - return rxFifoStatus; -} -#endif - -/*! - * brief Initializes the FlexCAN handle. - * - * This function initializes the FlexCAN handle, which can be used for other FlexCAN - * transactional APIs. Usually, for a specified FlexCAN instance, - * call this API once to get the initialized handle. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param callback The callback function. - * param userData The parameter of the callback function. - */ -void FLEXCAN_TransferCreateHandle(CAN_Type *base, - flexcan_handle_t *handle, - flexcan_transfer_callback_t callback, - void *userData) -{ - assert(NULL != handle); - - uint8_t instance; - - /* Clean FlexCAN transfer handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Get instance from peripheral base address. */ - instance = (uint8_t)FLEXCAN_GetInstance(base); - - /* Save the context in global variables to support the double weak mechanism. */ - s_flexcanHandle[instance] = handle; - - /* Register Callback function. */ - handle->callback = callback; - handle->userData = userData; - - s_flexcanIsr = FLEXCAN_TransferHandleIRQ; - - /* We Enable Error & Status interrupt here, because this interrupt just - * report current status of FlexCAN module through Callback function. - * It is insignificance without a available callback function. - */ - if (handle->callback != NULL) - { - FLEXCAN_EnableInterrupts( - base, (uint32_t)kFLEXCAN_BusOffInterruptEnable | (uint32_t)kFLEXCAN_ErrorInterruptEnable | - (uint32_t)kFLEXCAN_RxWarningInterruptEnable | (uint32_t)kFLEXCAN_TxWarningInterruptEnable | - (uint32_t)kFLEXCAN_WakeUpInterruptEnable -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - | (uint64_t)kFLEXCAN_PNMatchWakeUpInterruptEnable | - (uint64_t)kFLEXCAN_PNTimeoutWakeUpInterruptEnable -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - | (uint64_t)kFLEXCAN_HostAccessNCErrorInterruptEnable | - (uint64_t)kFLEXCAN_FlexCanAccessNCErrorInterruptEnable | - (uint64_t)kFLEXCAN_HostOrFlexCanCErrorInterruptEnable -#endif - ); - } - else - { - FLEXCAN_DisableInterrupts( - base, (uint32_t)kFLEXCAN_BusOffInterruptEnable | (uint32_t)kFLEXCAN_ErrorInterruptEnable | - (uint32_t)kFLEXCAN_RxWarningInterruptEnable | (uint32_t)kFLEXCAN_TxWarningInterruptEnable | - (uint32_t)kFLEXCAN_WakeUpInterruptEnable -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - | (uint64_t)kFLEXCAN_PNMatchWakeUpInterruptEnable | - (uint64_t)kFLEXCAN_PNTimeoutWakeUpInterruptEnable -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - | (uint64_t)kFLEXCAN_HostAccessNCErrorInterruptEnable | - (uint64_t)kFLEXCAN_FlexCanAccessNCErrorInterruptEnable | - (uint64_t)kFLEXCAN_HostOrFlexCanCErrorInterruptEnable -#endif - ); - } - - /* Enable interrupts in NVIC. */ - (void)EnableIRQ((IRQn_Type)(s_flexcanRxWarningIRQ[instance])); - (void)EnableIRQ((IRQn_Type)(s_flexcanTxWarningIRQ[instance])); - (void)EnableIRQ((IRQn_Type)(s_flexcanWakeUpIRQ[instance])); - (void)EnableIRQ((IRQn_Type)(s_flexcanErrorIRQ[instance])); - (void)EnableIRQ((IRQn_Type)(s_flexcanBusOffIRQ[instance])); - (void)EnableIRQ((IRQn_Type)(s_flexcanMbIRQ[instance])); -} - -/*! - * brief Sends a message using IRQ. - * - * This function sends a message using IRQ. This is a non-blocking function, which returns - * right away. When messages have been sent out, the send callback function is called. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param pMbXfer FlexCAN Message Buffer transfer structure. See the #flexcan_mb_transfer_t. - * retval kStatus_Success Start Tx Message Buffer sending process successfully. - * retval kStatus_Fail Write Tx Message Buffer failed. - * retval kStatus_FLEXCAN_TxBusy Tx Message Buffer is in use. - */ -status_t FLEXCAN_TransferSendNonBlocking(CAN_Type *base, flexcan_handle_t *handle, flexcan_mb_transfer_t *pMbXfer) -{ - /* Assertion. */ - assert(NULL != handle); - assert(NULL != pMbXfer); - assert(pMbXfer->mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, pMbXfer->mbIdx)); -#endif - - status_t status; - - /* Check if Message Buffer is idle. */ - if ((uint8_t)kFLEXCAN_StateIdle == handle->mbState[pMbXfer->mbIdx]) - { - /* Distinguish transmit type. */ - if ((uint32_t)kFLEXCAN_FrameTypeRemote == pMbXfer->frame->type) - { - handle->mbState[pMbXfer->mbIdx] = (uint8_t)kFLEXCAN_StateTxRemote; - } - else - { - handle->mbState[pMbXfer->mbIdx] = (uint8_t)kFLEXCAN_StateTxData; - } - - if (kStatus_Success == - FLEXCAN_WriteTxMb(base, pMbXfer->mbIdx, (const flexcan_frame_t *)(uintptr_t)pMbXfer->frame)) - { - /* Enable Message Buffer Interrupt. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (pMbXfer->mbIdx >= 64U) - { - FLEXCAN_EnableHigh64MbInterrupts(base, (uint64_t)1U << (pMbXfer->mbIdx - 64U)); - } - else - { - FLEXCAN_EnableMbInterrupts(base, (uint64_t)1U << pMbXfer->mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - FLEXCAN_EnableMbInterrupts(base, (uint64_t)1U << pMbXfer->mbIdx); -#else - FLEXCAN_EnableMbInterrupts(base, (uint32_t)1U << pMbXfer->mbIdx); -#endif - status = kStatus_Success; - } - else - { - handle->mbState[pMbXfer->mbIdx] = (uint8_t)kFLEXCAN_StateIdle; - status = kStatus_Fail; - } - } - else - { - status = kStatus_FLEXCAN_TxBusy; - } - - return status; -} - -/*! - * brief Receives a message using IRQ. - * - * This function receives a message using IRQ. This is non-blocking function, which returns - * right away. When the message has been received, the receive callback function is called. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param pMbXfer FlexCAN Message Buffer transfer structure. See the #flexcan_mb_transfer_t. - * retval kStatus_Success - Start Rx Message Buffer receiving process successfully. - * retval kStatus_FLEXCAN_RxBusy - Rx Message Buffer is in use. - */ -status_t FLEXCAN_TransferReceiveNonBlocking(CAN_Type *base, flexcan_handle_t *handle, flexcan_mb_transfer_t *pMbXfer) -{ - status_t status; - - /* Assertion. */ - assert(NULL != handle); - assert(NULL != pMbXfer); - assert(pMbXfer->mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, pMbXfer->mbIdx)); -#endif - - /* Check if Message Buffer is idle. */ - if ((uint8_t)kFLEXCAN_StateIdle == handle->mbState[pMbXfer->mbIdx]) - { - handle->mbState[pMbXfer->mbIdx] = (uint8_t)kFLEXCAN_StateRxData; - - /* Register Message Buffer. */ - handle->mbFrameBuf[pMbXfer->mbIdx] = pMbXfer->frame; - - /* Enable Message Buffer Interrupt. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (pMbXfer->mbIdx >= 64U) - { - FLEXCAN_EnableHigh64MbInterrupts(base, (uint64_t)1U << (pMbXfer->mbIdx - 64U)); - } - else - { - FLEXCAN_EnableMbInterrupts(base, (uint64_t)1U << pMbXfer->mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - FLEXCAN_EnableMbInterrupts(base, (uint64_t)1U << pMbXfer->mbIdx); -#else - FLEXCAN_EnableMbInterrupts(base, (uint32_t)1U << pMbXfer->mbIdx); -#endif - - status = kStatus_Success; - } - else - { - status = kStatus_FLEXCAN_RxBusy; - } - - return status; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * brief Sends a message using IRQ. - * - * This function sends a message using IRQ. This is a non-blocking function, which returns - * right away. When messages have been sent out, the send callback function is called. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param pMbXfer FlexCAN FD Message Buffer transfer structure. See the #flexcan_mb_transfer_t. - * retval kStatus_Success Start Tx Message Buffer sending process successfully. - * retval kStatus_Fail Write Tx Message Buffer failed. - * retval kStatus_FLEXCAN_TxBusy Tx Message Buffer is in use. - */ -status_t FLEXCAN_TransferFDSendNonBlocking(CAN_Type *base, flexcan_handle_t *handle, flexcan_mb_transfer_t *pMbXfer) -{ - /* Assertion. */ - assert(NULL != handle); - assert(NULL != pMbXfer); - assert(pMbXfer->mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, pMbXfer->mbIdx)); -#endif - - status_t status; - - /* Check if Message Buffer is idle. */ - if ((uint8_t)kFLEXCAN_StateIdle == handle->mbState[pMbXfer->mbIdx]) - { - /* Distinguish transmit type. */ - if ((uint32_t)kFLEXCAN_FrameTypeRemote == pMbXfer->framefd->type) - { - handle->mbState[pMbXfer->mbIdx] = (uint8_t)kFLEXCAN_StateTxRemote; - } - else - { - handle->mbState[pMbXfer->mbIdx] = (uint8_t)kFLEXCAN_StateTxData; - } - - if (kStatus_Success == - FLEXCAN_WriteFDTxMb(base, pMbXfer->mbIdx, (const flexcan_fd_frame_t *)(uintptr_t)pMbXfer->framefd)) - { - /* Enable Message Buffer Interrupt. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (pMbXfer->mbIdx >= 64U) - { - FLEXCAN_EnableHigh64MbInterrupts(base, (uint64_t)1U << (pMbXfer->mbIdx - 64U)); - } - else - { - FLEXCAN_EnableMbInterrupts(base, (uint64_t)1U << pMbXfer->mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - FLEXCAN_EnableMbInterrupts(base, (uint64_t)1U << pMbXfer->mbIdx); -#else - FLEXCAN_EnableMbInterrupts(base, (uint32_t)1U << pMbXfer->mbIdx); -#endif - - status = kStatus_Success; - } - else - { - handle->mbState[pMbXfer->mbIdx] = (uint8_t)kFLEXCAN_StateIdle; - status = kStatus_Fail; - } - } - else - { - status = kStatus_FLEXCAN_TxBusy; - } - - return status; -} - -/*! - * brief Receives a message using IRQ. - * - * This function receives a message using IRQ. This is non-blocking function, which returns - * right away. When the message has been received, the receive callback function is called. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param pMbXfer FlexCAN FD Message Buffer transfer structure. See the #flexcan_mb_transfer_t. - * retval kStatus_Success - Start Rx Message Buffer receiving process successfully. - * retval kStatus_FLEXCAN_RxBusy - Rx Message Buffer is in use. - */ -status_t FLEXCAN_TransferFDReceiveNonBlocking(CAN_Type *base, flexcan_handle_t *handle, flexcan_mb_transfer_t *pMbXfer) -{ - /* Assertion. */ - assert(NULL != handle); - assert(NULL != pMbXfer); - assert(pMbXfer->mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, pMbXfer->mbIdx)); -#endif - - status_t status; - - /* Check if Message Buffer is idle. */ - if ((uint8_t)kFLEXCAN_StateIdle == handle->mbState[pMbXfer->mbIdx]) - { - handle->mbState[pMbXfer->mbIdx] = (uint8_t)kFLEXCAN_StateRxData; - - /* Register Message Buffer. */ - handle->mbFDFrameBuf[pMbXfer->mbIdx] = pMbXfer->framefd; - - /* Enable Message Buffer Interrupt. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (pMbXfer->mbIdx >= 64U) - { - FLEXCAN_EnableHigh64MbInterrupts(base, (uint64_t)1U << (pMbXfer->mbIdx - 64U)); - } - else - { - FLEXCAN_EnableMbInterrupts(base, (uint64_t)1U << pMbXfer->mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - FLEXCAN_EnableMbInterrupts(base, (uint64_t)1U << pMbXfer->mbIdx); -#else - FLEXCAN_EnableMbInterrupts(base, (uint32_t)1U << pMbXfer->mbIdx); -#endif - - status = kStatus_Success; - } - else - { - status = kStatus_FLEXCAN_RxBusy; - } - - return status; -} -#endif - -/*! - * brief Receives a message from Legacy Rx FIFO using IRQ. - * - * This function receives a message using IRQ. This is a non-blocking function, which returns - * right away. When all messages have been received, the receive callback function is called. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param pFifoXfer FlexCAN Rx FIFO transfer structure. See the ref flexcan_fifo_transfer_t. - * retval kStatus_Success - Start Rx FIFO receiving process successfully. - * retval kStatus_FLEXCAN_RxFifoBusy - Rx FIFO is currently in use. - */ -status_t FLEXCAN_TransferReceiveFifoNonBlocking(CAN_Type *base, - flexcan_handle_t *handle, - flexcan_fifo_transfer_t *pFifoXfer) -{ - /* Assertion. */ - assert(NULL != handle); - assert(NULL != pFifoXfer); - - status_t status; - uint32_t irqMask = (uint32_t)kFLEXCAN_RxFifoOverflowFlag | (uint32_t)kFLEXCAN_RxFifoWarningFlag; - - /* Check if Message Buffer is idle. */ - if ((uint8_t)kFLEXCAN_StateIdle == handle->rxFifoState) - { - handle->rxFifoState = (uint8_t)kFLEXCAN_StateRxFifo; - - /* Register Message Buffer. */ - handle->rxFifoFrameBuf = pFifoXfer->frame; - handle->rxFifoFrameNum = pFifoXfer->frameNum; - handle->rxFifoTransferTotalNum = pFifoXfer->frameNum; - - if (handle->rxFifoTransferTotalNum < 5U) - { - /* Enable data available interrupt. */ - irqMask |= (uint32_t)kFLEXCAN_RxFifoFrameAvlFlag; - } - - /* Enable Message Buffer Interrupt. */ - FLEXCAN_EnableMbInterrupts(base, irqMask); - - status = kStatus_Success; - } - else - { - status = kStatus_FLEXCAN_RxFifoBusy; - } - - return status; -} - -/*! - * brief Gets the Legacy Rx Fifo transfer status during a interrupt non-blocking receive. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param count Number of CAN messages receive so far by the non-blocking transaction. - * retval kStatus_InvalidArgument count is Invalid. - * retval kStatus_Success Successfully return the count. - */ - -status_t FLEXCAN_TransferGetReceiveFifoCount(CAN_Type *base, flexcan_handle_t *handle, size_t *count) -{ - assert(NULL != handle); - - status_t result = kStatus_Success; - - if (handle->rxFifoState == (uint32_t)kFLEXCAN_StateIdle) - { - result = kStatus_NoTransferInProgress; - } - else - { - *count = handle->rxFifoTransferTotalNum - handle->rxFifoFrameNum; - } - - return result; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * brief Receives a message from Enhanced Rx FIFO using IRQ. - * - * This function receives a message using IRQ. This is a non-blocking function, which returns - * right away. When all messages have been received, the receive callback function is called. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param pFifoXfer FlexCAN Rx FIFO transfer structure. See the ref flexcan_fifo_transfer_t. - * retval kStatus_Success - Start Rx FIFO receiving process successfully. - * retval kStatus_FLEXCAN_RxFifoBusy - Rx FIFO is currently in use. - */ -status_t FLEXCAN_TransferReceiveEnhancedFifoNonBlocking(CAN_Type *base, - flexcan_handle_t *handle, - flexcan_fifo_transfer_t *pFifoXfer) -{ - /* Assertion. */ - assert(NULL != handle); - assert(NULL != pFifoXfer); - - status_t status; - uint32_t watermark = ((base->ERFCR & CAN_ERFCR_ERFWM_MASK) >> CAN_ERFCR_ERFWM_SHIFT) + 1U; - uint64_t irqMask = - (uint64_t)kFLEXCAN_ERxFifoUnderflowInterruptEnable | (uint64_t)kFLEXCAN_ERxFifoOverflowInterruptEnable; - - /* Check if Enhanced Rx FIFO is idle. */ - if ((uint8_t)kFLEXCAN_StateIdle == handle->rxFifoState) - { - handle->rxFifoState = (uint8_t)kFLEXCAN_StateRxFifo; - - /* Register Message Buffer. */ - handle->rxFifoFDFrameBuf = pFifoXfer->framefd; - handle->rxFifoFrameNum = pFifoXfer->frameNum; - handle->rxFifoTransferTotalNum = pFifoXfer->frameNum; - - if (handle->rxFifoTransferTotalNum >= watermark) - { - /* Enable watermark interrupt. */ - irqMask |= (uint64_t)kFLEXCAN_ERxFifoWatermarkInterruptEnable; - } - else - { - /* Enable data available interrupt. */ - irqMask |= (uint64_t)kFLEXCAN_ERxFifoDataAvlInterruptEnable; - } - /* Enable Enhanced Rx FIFO Interrupt. */ - FLEXCAN_EnableInterrupts(base, irqMask); - - status = kStatus_Success; - } - else - { - status = kStatus_FLEXCAN_RxFifoBusy; - } - - return status; -} -#endif - -/*! - * brief Aborts the interrupt driven message send process. - * - * This function aborts the interrupt driven message send process. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param mbIdx The FlexCAN Message Buffer index. - */ -void FLEXCAN_TransferAbortSend(CAN_Type *base, flexcan_handle_t *handle, uint8_t mbIdx) -{ - uint16_t timestamp; - - /* Assertion. */ - assert(NULL != handle); - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - /* Disable Message Buffer Interrupt. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (mbIdx >= 64U) - { - FLEXCAN_DisableHigh64MbInterrupts(base, (uint64_t)1U << (mbIdx - 64U)); - } - else - { - FLEXCAN_DisableMbInterrupts(base, (uint64_t)1U << mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - FLEXCAN_DisableMbInterrupts(base, (uint64_t)1U << mbIdx); -#else - FLEXCAN_DisableMbInterrupts(base, (uint32_t)1U << mbIdx); -#endif - - /* Update the TX frame 's time stamp by MB[mbIdx].cs. */ - timestamp = (uint16_t)((base->MB[mbIdx].CS & CAN_CS_TIME_STAMP_MASK) >> CAN_CS_TIME_STAMP_SHIFT); - handle->timestamp[mbIdx] = timestamp; - - /* Clean Message Buffer. */ - FLEXCAN_SetTxMbConfig(base, mbIdx, true); - - handle->mbState[mbIdx] = (uint8_t)kFLEXCAN_StateIdle; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * brief Aborts the interrupt driven message send process. - * - * This function aborts the interrupt driven message send process. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param mbIdx The FlexCAN FD Message Buffer index. - */ -void FLEXCAN_TransferFDAbortSend(CAN_Type *base, flexcan_handle_t *handle, uint8_t mbIdx) -{ - volatile uint32_t *mbAddr; - uint32_t offset; - uint16_t timestamp; - - /* Assertion. */ - assert(NULL != handle); - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - /* Disable Message Buffer Interrupt. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (mbIdx >= 64U) - { - FLEXCAN_DisableHigh64MbInterrupts(base, (uint64_t)1U << (mbIdx - 64U)); - } - else - { - FLEXCAN_DisableMbInterrupts(base, (uint64_t)1U << mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - FLEXCAN_DisableMbInterrupts(base, (uint64_t)1U << mbIdx); -#else - FLEXCAN_DisableMbInterrupts(base, (uint32_t)1U << mbIdx); -#endif - - /* Update the TX frame 's time stamp by base->MB[offset for CAN FD].CS. */ - mbAddr = &(base->MB[0].CS); - offset = FLEXCAN_GetFDMailboxOffset(base, mbIdx); - timestamp = (uint16_t)((mbAddr[offset] & CAN_CS_TIME_STAMP_MASK) >> CAN_CS_TIME_STAMP_SHIFT); - handle->timestamp[mbIdx] = timestamp; - - /* Clean Message Buffer. */ - FLEXCAN_SetFDTxMbConfig(base, mbIdx, true); - - handle->mbState[mbIdx] = (uint8_t)kFLEXCAN_StateIdle; -} - -/*! - * brief Aborts the interrupt driven message receive process. - * - * This function aborts the interrupt driven message receive process. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param mbIdx The FlexCAN FD Message Buffer index. - */ -void FLEXCAN_TransferFDAbortReceive(CAN_Type *base, flexcan_handle_t *handle, uint8_t mbIdx) -{ - /* Assertion. */ - assert(NULL != handle); - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - /* Disable Message Buffer Interrupt. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (mbIdx >= 64U) - { - FLEXCAN_DisableHigh64MbInterrupts(base, (uint64_t)1U << (mbIdx - 64U)); - } - else - { - FLEXCAN_DisableMbInterrupts(base, (uint64_t)1U << mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - FLEXCAN_DisableMbInterrupts(base, (uint64_t)1U << mbIdx); -#else - FLEXCAN_DisableMbInterrupts(base, (uint32_t)1U << mbIdx); -#endif - - /* Un-register handle. */ - handle->mbFDFrameBuf[mbIdx] = NULL; - handle->mbState[mbIdx] = (uint8_t)kFLEXCAN_StateIdle; -} -#endif - -/*! - * brief Aborts the interrupt driven message receive process. - * - * This function aborts the interrupt driven message receive process. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param mbIdx The FlexCAN Message Buffer index. - */ -void FLEXCAN_TransferAbortReceive(CAN_Type *base, flexcan_handle_t *handle, uint8_t mbIdx) -{ - /* Assertion. */ - assert(NULL != handle); - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - /* Disable Message Buffer Interrupt. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (mbIdx >= 64U) - { - FLEXCAN_DisableHigh64MbInterrupts(base, (uint64_t)1U << (mbIdx - 64U)); - } - else - { - FLEXCAN_DisableMbInterrupts(base, (uint64_t)1U << mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - FLEXCAN_DisableMbInterrupts(base, (uint64_t)1U << mbIdx); -#else - FLEXCAN_DisableMbInterrupts(base, (uint32_t)1U << mbIdx); -#endif - - /* Un-register handle. */ - handle->mbFrameBuf[mbIdx] = NULL; - handle->mbState[mbIdx] = (uint8_t)kFLEXCAN_StateIdle; -} - -/*! - * brief Aborts the interrupt driven message receive from Legacy Rx FIFO process. - * - * This function aborts the interrupt driven message receive from Legacy Rx FIFO process. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - */ -void FLEXCAN_TransferAbortReceiveFifo(CAN_Type *base, flexcan_handle_t *handle) -{ - /* Assertion. */ - assert(NULL != handle); - - /* Check if Rx FIFO is enabled. */ - if (0U != (base->MCR & CAN_MCR_RFEN_MASK)) - { - /* Disable Rx Message FIFO Interrupts. */ - FLEXCAN_DisableMbInterrupts(base, (uint32_t)kFLEXCAN_RxFifoOverflowFlag | (uint32_t)kFLEXCAN_RxFifoWarningFlag | - (uint32_t)kFLEXCAN_RxFifoFrameAvlFlag); - - /* Un-register handle. */ - handle->rxFifoFrameBuf = NULL; - /* Clear transfer count. */ - handle->rxFifoFrameNum = 0U; - handle->rxFifoTransferTotalNum = 0U; - } - - handle->rxFifoState = (uint8_t)kFLEXCAN_StateIdle; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * brief Aborts the interrupt driven message receive from Enhanced Rx FIFO process. - * - * This function aborts the interrupt driven message receive from Rx FIFO process. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - */ -void FLEXCAN_TransferAbortReceiveEnhancedFifo(CAN_Type *base, flexcan_handle_t *handle) -{ - /* Assertion. */ - assert(NULL != handle); - - /* Check if Enhanced Rx FIFO is enabled. */ - if (0U != (base->ERFCR & CAN_ERFCR_ERFEN_MASK)) - { - /* Disable all Rx Message FIFO interrupts. */ - FLEXCAN_DisableInterrupts(base, (uint64_t)kFLEXCAN_ERxFifoUnderflowInterruptEnable | - (uint64_t)kFLEXCAN_ERxFifoOverflowInterruptEnable | - (uint64_t)kFLEXCAN_ERxFifoWatermarkInterruptEnable | - (uint64_t)kFLEXCAN_ERxFifoDataAvlInterruptEnable); - - /* Un-register handle. */ - handle->rxFifoFDFrameBuf = NULL; - /* Clear transfer count. */ - handle->rxFifoFrameNum = 0U; - handle->rxFifoTransferTotalNum = 0U; - } - - handle->rxFifoState = (uint8_t)kFLEXCAN_StateIdle; -} -#endif - -/*! - * brief Gets the detail index of Mailbox's Timestamp by handle. - * - * Then function can only be used when calling non-blocking Data transfer (TX/RX) API, - * After TX/RX data transfer done (User can get the status by handler's callback function), - * we can get the detail index of Mailbox's timestamp by handle, - * Detail non-blocking data transfer API (TX/RX) contain. - * -FLEXCAN_TransferSendNonBlocking - * -FLEXCAN_TransferFDSendNonBlocking - * -FLEXCAN_TransferReceiveNonBlocking - * -FLEXCAN_TransferFDReceiveNonBlocking - * -FLEXCAN_TransferReceiveFifoNonBlocking - * - * param handle FlexCAN handle pointer. - * param mbIdx The FlexCAN FD Message Buffer index. - * return the index of mailbox 's timestamp stored in the handle. - * - */ -uint32_t FLEXCAN_GetTimeStamp(flexcan_handle_t *handle, uint8_t mbIdx) -{ - /* Assertion. */ - assert(NULL != handle); - - return (uint32_t)(handle->timestamp[mbIdx]); -} - -/*! - * brief Check unhandle interrupt events - * - * param base FlexCAN peripheral base address. - * return TRUE if unhandled interrupt action exist, FALSE if no unhandlered interrupt action exist. - */ -static bool FLEXCAN_CheckUnhandleInterruptEvents(CAN_Type *base) -{ - uint64_t tempmask; - uint64_t tempflag; - bool fgRet = false; - - if (0U == (FLEXCAN_GetStatusFlags(base) & - (FLEXCAN_ERROR_AND_STATUS_INIT_FLAG | FLEXCAN_WAKE_UP_FLAG | FLEXCAN_MEMORY_ENHANCED_RX_FIFO_INIT_FLAG))) - { - /* If no error, wake_up or enhanced RX FIFO status, Checking whether exist MB interrupt status and legacy RX - * FIFO interrupt status */ - tempmask = (uint64_t)base->IMASK1; - tempflag = (uint64_t)base->IFLAG1; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - tempmask |= ((uint64_t)base->IMASK2) << 32; - tempflag |= ((uint64_t)base->IFLAG2) << 32; -#endif - fgRet = (0U != (tempmask & tempflag)); -#if defined(CAN_IMASK3_BUF95TO64M_MASK) - if (0U != (base->IMASK3 & base->IFLAG3)) - { - fgRet = true; - } -#endif -#if defined(CAN_IMASK4_BUF127TO96M_MASK) - if (0U != (base->IMASK4 & base->IFLAG4)) - { - fgRet = true; - } -#endif - } -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - else if (0U != (FLEXCAN_GetStatusFlags(base) & FLEXCAN_MEMORY_ENHANCED_RX_FIFO_INIT_FLAG)) - { - /* Checking whether exist enhanced RX FIFO interrupt status. */ - tempmask = (uint64_t)base->ERFIER; - tempflag = (uint64_t)base->ERFSR; - fgRet = (0U != (tempmask & tempflag)); - } -#endif - else - { - /* Exist error or wake up flag. */ - fgRet = true; - } - - return fgRet; -} - -/*! - * brief Sub Handler Legacy Rx FIFO Trasfered Events - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param result The MB flag number. - * - * return the status after handle transfered event. - */ -static status_t FLEXCAN_SubHandlerForLegacyRxFIFO(CAN_Type *base, flexcan_handle_t *handle, uint32_t result) -{ - uint32_t u32mask = 1; - status_t status = kStatus_FLEXCAN_UnHandled; - - switch (u32mask << result) - { - case kFLEXCAN_RxFifoOverflowFlag: - status = kStatus_FLEXCAN_RxFifoOverflow; - break; - - case kFLEXCAN_RxFifoWarningFlag: - if ((handle->rxFifoFrameNum > 5U) && (0U != (base->IFLAG1 & (uint32_t)kFLEXCAN_RxFifoFrameAvlFlag))) - { - for (uint32_t i = 0; i < 5UL; i++) - { - status = FLEXCAN_ReadRxFifo(base, handle->rxFifoFrameBuf); - /* - * $Branch Coverage Justification$ - * (kStatus_Success != status) not covered. $ref flexcan_c_ref_1$. - */ - if (kStatus_Success == status) - { - /* Align the current rxfifo timestamp to the timestamp array by handle. */ - handle->timestamp[i] = handle->rxFifoFrameBuf->timestamp; - handle->rxFifoFrameBuf++; - handle->rxFifoFrameNum--; - /* Clean Rx Fifo available flag to discard the frame that has been read. */ - FLEXCAN_ClearMbStatusFlags(base, (uint32_t)kFLEXCAN_RxFifoFrameAvlFlag); - } - else - { - /* - * $Line Coverage Justification$ - * $ref flexcan_c_ref_1$. - */ - return kStatus_FLEXCAN_RxFifoDisabled; - } - } - if (handle->rxFifoFrameNum < 5UL) - { - /* Enable data avaliable interrupt. */ - FLEXCAN_EnableMbInterrupts(base, (uint32_t)kFLEXCAN_RxFifoFrameAvlFlag); - } - status = kStatus_FLEXCAN_RxFifoBusy; - } - else - { - /* Should enter case kFLEXCAN_RxFifoFrameAvlFlag but not, means previous transfer may have - * overflow*/ - status = kStatus_FLEXCAN_RxFifoWarning; - } - break; - - case kFLEXCAN_RxFifoFrameAvlFlag: - /* Whether still has CAN messages remaining to be received. */ - if (handle->rxFifoFrameNum > 0U) - { - status = FLEXCAN_ReadRxFifo(base, handle->rxFifoFrameBuf); - /* - * $Branch Coverage Justification$ - * (kStatus_Success != status) not covered. $ref flexcan_c_ref_1$. - */ - if (kStatus_Success == status) - { - /* Align the current (index 0) rxfifo timestamp to the timestamp array by handle. */ - handle->timestamp[0] = handle->rxFifoFrameBuf->timestamp; - handle->rxFifoFrameBuf++; - handle->rxFifoFrameNum--; - } - else - { - /* - * $Line Coverage Justification$ - * $ref flexcan_c_ref_1$. - */ - return kStatus_FLEXCAN_RxFifoDisabled; - } - } - if (handle->rxFifoFrameNum == 0U) - { - /* Stop receiving Ehanced Rx FIFO when the transmission is over. */ - FLEXCAN_TransferAbortReceiveFifo(base, handle); - status = kStatus_FLEXCAN_RxFifoIdle; - } - else - { - /* Continue use data avaliable interrupt. */ - status = kStatus_FLEXCAN_RxFifoBusy; - } - break; - - default: - status = kStatus_FLEXCAN_UnHandled; - break; - } - - return status; -} - -/*! - * brief Sub Handler Message Buffer Trasfered Events - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param result The MB flag number. - * - * return the status after handle transfered event. - */ -static status_t FLEXCAN_SubHandlerForMB(CAN_Type *base, flexcan_handle_t *handle, uint32_t result) -{ - status_t status = kStatus_FLEXCAN_UnHandled; - - /* Get current State of Message Buffer. */ - switch (handle->mbState[result]) - { - /* Solve Rx Data Frame. */ - case (uint8_t)kFLEXCAN_StateRxData: -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0U != (base->MCR & CAN_MCR_FDEN_MASK)) - { - status = FLEXCAN_ReadFDRxMb(base, (uint8_t)result, handle->mbFDFrameBuf[result]); - if ((kStatus_Success == status) || (kStatus_FLEXCAN_RxOverflow == status)) - { - /* Align the current index of RX MB timestamp to the timestamp array by handle. */ - handle->timestamp[result] = handle->mbFDFrameBuf[result]->timestamp; - - if (kStatus_Success == status) - { - status = kStatus_FLEXCAN_RxIdle; - } - } - } - else -#endif - { - status = FLEXCAN_ReadRxMb(base, (uint8_t)result, handle->mbFrameBuf[result]); - if ((kStatus_Success == status) || (kStatus_FLEXCAN_RxOverflow == status)) - { - /* Align the current index of RX MB timestamp to the timestamp array by handle. */ - handle->timestamp[result] = handle->mbFrameBuf[result]->timestamp; - - if (kStatus_Success == status) - { - status = kStatus_FLEXCAN_RxIdle; - } - } - } -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0U != (base->MCR & CAN_MCR_FDEN_MASK)) - { - FLEXCAN_TransferFDAbortReceive(base, handle, (uint8_t)result); - } - else -#endif - { - FLEXCAN_TransferAbortReceive(base, handle, (uint8_t)result); - } - break; - - /* Sove Rx Remote Frame. User need to Read the frame in Mail box in time by Read from MB API. */ - case (uint8_t)kFLEXCAN_StateRxRemote: - status = kStatus_FLEXCAN_RxRemote; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0U != (base->MCR & CAN_MCR_FDEN_MASK)) - { - FLEXCAN_TransferFDAbortReceive(base, handle, (uint8_t)result); - } - else -#endif - { - FLEXCAN_TransferAbortReceive(base, handle, (uint8_t)result); - } - break; - - /* Solve Tx Data Frame. */ - case (uint8_t)kFLEXCAN_StateTxData: - status = kStatus_FLEXCAN_TxIdle; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0U != (base->MCR & CAN_MCR_FDEN_MASK)) - { - FLEXCAN_TransferFDAbortSend(base, handle, (uint8_t)result); - } - else -#endif - { - FLEXCAN_TransferAbortSend(base, handle, (uint8_t)result); - } - break; - - /* Solve Tx Remote Frame. */ - case (uint8_t)kFLEXCAN_StateTxRemote: - handle->mbState[result] = (uint8_t)kFLEXCAN_StateRxRemote; - status = kStatus_FLEXCAN_TxSwitchToRx; - break; - - default: - status = kStatus_FLEXCAN_UnHandled; - break; - } - - return status; -} - -/*! - * brief Sub Handler Data Trasfered Events - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param pResult Pointer to the Handle result. - * - * return the status after handle each data transfered event. - */ -static status_t FLEXCAN_SubHandlerForDataTransfered(CAN_Type *base, flexcan_handle_t *handle, uint32_t *pResult) -{ - status_t status = kStatus_FLEXCAN_UnHandled; - uint32_t result = 0xFFU; - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - uint32_t intflag[4] = {(base->IMASK1 & base->IFLAG1), (base->IMASK2 & base->IFLAG2), 0U, 0U}; -#if defined(CAN_IMASK3_BUF95TO64M_MASK) - intflag[2] = base->IMASK3 & base->IFLAG3; -#endif -#if defined(CAN_IMASK4_BUF127TO96M_MASK) - intflag[3] = base->IMASK4 & base->IFLAG4; -#endif -#else - uint32_t intflag = base->IMASK1 & base->IFLAG1; -#endif - - /* For this implementation, we solve the Message with lowest MB index first. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - for (uint32_t i = 0U; i < 4U; i++) - { - if (intflag[i] != 0U) - { - for (uint32_t j = 0U; j < 32U; j++) - { - if (0UL != (intflag[i] & ((uint32_t)1UL << j))) - { - result = i * 32U + j; - break; - } - } - break; - } - } -#else - for (result = 0U; result < (uint32_t)FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(base); result++) - { - if (0UL != (intflag & ((uint32_t)1UL << result))) - { - break; - } - } -#endif - - /* find Message to deal with. */ - if (result < (uint32_t)FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(base)) - { - /* Solve Legacy Rx FIFO interrupt. */ - if (((uint8_t)kFLEXCAN_StateIdle != handle->rxFifoState) && (result <= (uint32_t)CAN_IFLAG1_BUF7I_SHIFT) && - ((base->MCR & CAN_MCR_RFEN_MASK) != 0U)) - { - status = FLEXCAN_SubHandlerForLegacyRxFIFO(base, handle, result); - /* - * $Branch Coverage Justification$ - * (status == kStatus_FLEXCAN_RxFifoDisabled) not covered. $ref flexcan_c_ref_1$. - */ - if (status == kStatus_FLEXCAN_RxFifoDisabled) - { - /* - * $Line Coverage Justification$ - * $ref flexcan_c_ref_1$. - */ - return status; - } - } - else - { - status = FLEXCAN_SubHandlerForMB(base, handle, result); - } - - /* Clear resolved Message Buffer IRQ. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (result >= 64U) - { - FLEXCAN_ClearHigh64MbStatusFlags(base, (uint64_t)1U << (result - 64U)); - } - else - { - FLEXCAN_ClearMbStatusFlags(base, (uint64_t)1U << result); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - FLEXCAN_ClearMbStatusFlags(base, (uint64_t)1U << result); -#else - FLEXCAN_ClearMbStatusFlags(base, (uint32_t)1U << result); -#endif - } - - *pResult = result; - - return status; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * brief Sub Handler Ehanced Rx FIFO event - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param flags FlexCAN interrupt flags. - * - * return the status after handle Ehanced Rx FIFO event. - */ -static status_t FLEXCAN_SubHandlerForEhancedRxFifo(CAN_Type *base, flexcan_handle_t *handle, uint64_t flags) -{ - uint32_t watermark = ((base->ERFCR & CAN_ERFCR_ERFWM_MASK) >> CAN_ERFCR_ERFWM_SHIFT) + 1U; - uint32_t transferFrames; - - status_t status; - /* Solve Ehanced Rx FIFO interrupt. */ - if ((0u != (flags & (uint64_t)kFLEXCAN_ERxFifoUnderflowIntFlag)) && - (0u != (base->ERFIER & CAN_ERFIER_ERFUFWIE_MASK))) - { - status = kStatus_FLEXCAN_RxFifoUnderflow; - FLEXCAN_ClearStatusFlags(base, (uint64_t)kFLEXCAN_ERxFifoUnderflowIntFlag); - } - else if ((0u != (flags & (uint64_t)kFLEXCAN_ERxFifoOverflowIntFlag)) && - (0u != (base->ERFIER & CAN_ERFIER_ERFOVFIE_MASK))) - { - status = kStatus_FLEXCAN_RxFifoOverflow; - FLEXCAN_ClearStatusFlags(base, (uint64_t)kFLEXCAN_ERxFifoOverflowIntFlag); - } - else if ((0u != (flags & (uint64_t)kFLEXCAN_ERxFifoWatermarkIntFlag)) && - (0u != (base->ERFIER & CAN_ERFIER_ERFWMIIE_MASK))) - { - /* Whether the number of CAN messages remaining to be received is greater than the watermark. */ - transferFrames = (handle->rxFifoFrameNum > watermark) ? watermark : handle->rxFifoFrameNum; - - for (uint32_t i = 0; i < transferFrames; i++) - { - status = FLEXCAN_ReadEnhancedRxFifo(base, handle->rxFifoFDFrameBuf); - - if (kStatus_Success == status) - { - handle->rxFifoFDFrameBuf++; - handle->rxFifoFrameNum--; - /* Clear data Watermark flag due to has read back one frame. */ - base->ERFSR = CAN_ERFSR_ERFWMI_MASK; - } - else - { - return kStatus_FLEXCAN_RxFifoDisabled; - } - } - if (handle->rxFifoFrameNum == 0U) - { - /* Stop receiving Ehanced Rx FIFO when the transmission is over. */ - FLEXCAN_TransferAbortReceiveEnhancedFifo(base, handle); - status = kStatus_FLEXCAN_RxFifoIdle; - } - else if (handle->rxFifoFrameNum < watermark) - { - /* Disable watermark interrupt and enable data avaliable interrupt. */ - FLEXCAN_DisableInterrupts(base, (uint64_t)kFLEXCAN_ERxFifoWatermarkInterruptEnable); - FLEXCAN_EnableInterrupts(base, (uint64_t)kFLEXCAN_ERxFifoDataAvlInterruptEnable); - status = kStatus_FLEXCAN_RxFifoBusy; - } - else - { - /* Continue use watermark interrupt. */ - status = kStatus_FLEXCAN_RxFifoBusy; - } - } - else - { - /* Data available status, check Whether still has CAN messages remaining to be received. */ - if (handle->rxFifoFrameNum > 0U) - { - status = FLEXCAN_ReadEnhancedRxFifo(base, handle->rxFifoFDFrameBuf); - - if (kStatus_Success == status) - { - handle->rxFifoFDFrameBuf++; - handle->rxFifoFrameNum--; - } - else - { - return kStatus_FLEXCAN_RxFifoDisabled; - } - } - if (handle->rxFifoFrameNum == 0U) - { - /* Stop receiving Ehanced Rx FIFO when the transmission is over. */ - FLEXCAN_TransferAbortReceiveEnhancedFifo(base, handle); - status = kStatus_FLEXCAN_RxFifoIdle; - } - else - { - /* Continue use data avaliable interrupt. */ - status = kStatus_FLEXCAN_RxFifoBusy; - } - } - return status; -} -#endif - -/*! - * brief FlexCAN IRQ handle function. - * - * This function handles the FlexCAN Error, the Message Buffer, and the Rx FIFO IRQ request. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - */ -void FLEXCAN_TransferHandleIRQ(CAN_Type *base, flexcan_handle_t *handle) -{ - /* Assertion. */ - assert(NULL != handle); - - status_t status; - uint32_t mbNum = 0xFFU; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - uint64_t result = 0U; -#else - uint32_t result = 0U; -#endif - do - { - /* Get Current FlexCAN Module Error and Status. */ - result = FLEXCAN_GetStatusFlags(base); - - /* To handle FlexCAN Error and Status Interrupt first. */ - if (0U != (result & FLEXCAN_ERROR_AND_STATUS_INIT_FLAG)) - { - status = kStatus_FLEXCAN_ErrorStatus; - /* Clear FlexCAN Error and Status Interrupt. */ - FLEXCAN_ClearStatusFlags(base, FLEXCAN_ERROR_AND_STATUS_INIT_FLAG); - } - else if (0U != (result & FLEXCAN_WAKE_UP_FLAG)) - { - status = kStatus_FLEXCAN_WakeUp; - FLEXCAN_ClearStatusFlags(base, FLEXCAN_WAKE_UP_FLAG); - } -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - else if (0U != (FLEXCAN_EFIFO_STATUS_UNMASK(result & FLEXCAN_MEMORY_ENHANCED_RX_FIFO_INIT_FLAG) & base->ERFIER)) - { - status = FLEXCAN_SubHandlerForEhancedRxFifo(base, handle, result); - } -#endif - else - { - /* To handle Message Buffer or Legacy Rx FIFO transfer. */ - status = FLEXCAN_SubHandlerForDataTransfered(base, handle, &mbNum); - result = mbNum; - } - - /* Calling Callback Function if has one. */ - if (handle->callback != NULL) - { - handle->callback(base, handle, status, result, handle->userData); - } - } while (FLEXCAN_CheckUnhandleInterruptEvents(base)); -} - -#if defined(CAN0) -void CAN0_DriverIRQHandler(void); -void CAN0_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[0]); - - s_flexcanIsr(CAN0, s_flexcanHandle[0]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CAN1) -void CAN1_DriverIRQHandler(void); -void CAN1_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[1]); - - s_flexcanIsr(CAN1, s_flexcanHandle[1]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CAN2) -void CAN2_DriverIRQHandler(void); -void CAN2_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[2]); - - s_flexcanIsr(CAN2, s_flexcanHandle[2]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CAN3) -void CAN3_DriverIRQHandler(void); -void CAN3_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[3]); - - s_flexcanIsr(CAN3, s_flexcanHandle[3]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CAN4) -void CAN4_DriverIRQHandler(void); -void CAN4_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[4]); - - s_flexcanIsr(CAN4, s_flexcanHandle[4]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(DMA__CAN0) -void DMA_FLEXCAN0_INT_DriverIRQHandler(void); -void DMA_FLEXCAN0_INT_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[FLEXCAN_GetInstance(DMA__CAN0)]); - - s_flexcanIsr(DMA__CAN0, s_flexcanHandle[FLEXCAN_GetInstance(DMA__CAN0)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(DMA__CAN1) -void DMA_FLEXCAN1_INT_DriverIRQHandler(void); -void DMA_FLEXCAN1_INT_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[FLEXCAN_GetInstance(DMA__CAN1)]); - - s_flexcanIsr(DMA__CAN1, s_flexcanHandle[FLEXCAN_GetInstance(DMA__CAN1)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(DMA__CAN2) -void DMA_FLEXCAN2_INT_DriverIRQHandler(void); -void DMA_FLEXCAN2_INT_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[FLEXCAN_GetInstance(DMA__CAN2)]); - - s_flexcanIsr(DMA__CAN2, s_flexcanHandle[FLEXCAN_GetInstance(DMA__CAN2)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(ADMA__CAN0) -void ADMA_FLEXCAN0_INT_DriverIRQHandler(void); -void ADMA_FLEXCAN0_INT_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[FLEXCAN_GetInstance(ADMA__CAN0)]); - - s_flexcanIsr(ADMA__CAN0, s_flexcanHandle[FLEXCAN_GetInstance(ADMA__CAN0)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(ADMA__CAN1) -void ADMA_FLEXCAN1_INT_DriverIRQHandler(void); -void ADMA_FLEXCAN1_INT_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[FLEXCAN_GetInstance(ADMA__CAN1)]); - - s_flexcanIsr(ADMA__CAN1, s_flexcanHandle[FLEXCAN_GetInstance(ADMA__CAN1)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(ADMA__CAN2) -void ADMA_FLEXCAN2_INT_DriverIRQHandler(void); -void ADMA_FLEXCAN2_INT_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[FLEXCAN_GetInstance(ADMA__CAN2)]); - - s_flexcanIsr(ADMA__CAN2, s_flexcanHandle[FLEXCAN_GetInstance(ADMA__CAN2)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(FLEXCAN1) -void CAN_FD1_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[1]); - - s_flexcanIsr(FLEXCAN1, s_flexcanHandle[1]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(FLEXCAN2) -void CAN_FD2_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[2]); - - s_flexcanIsr(FLEXCAN2, s_flexcanHandle[2]); - SDK_ISR_EXIT_BARRIER; -} -#endif diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexcan.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexcan.h deleted file mode 100644 index 9170938afe5..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexcan.h +++ /dev/null @@ -1,2360 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_FLEXCAN_H_ -#define FSL_FLEXCAN_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup flexcan_driver - * @{ - */ - -/****************************************************************************** - * Definitions - *****************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief FlexCAN driver version. */ -#define FSL_FLEXCAN_DRIVER_VERSION (MAKE_VERSION(2, 11, 6)) -/*! @} */ - -#if !(defined(FLEXCAN_WAIT_TIMEOUT) && FLEXCAN_WAIT_TIMEOUT) -/* Define to 1000 means keep waiting 1000 times until the flag is assert/deassert. */ -#define FLEXCAN_WAIT_TIMEOUT (1000U) -#endif - -/*! @brief FlexCAN frame length helper macro. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -#define DLC_LENGTH_DECODE(dlc) (((dlc) <= 8U) ? (dlc) : (((dlc) <= 12U) ? (((dlc)-6U) * 4U) : (((dlc)-11U) * 16U))) -#endif - -/*! @brief FlexCAN Frame ID helper macro. */ -#define FLEXCAN_ID_STD(id) \ - (((uint32_t)(((uint32_t)(id)) << CAN_ID_STD_SHIFT)) & CAN_ID_STD_MASK) /*!< Standard Frame ID helper macro. */ -#define FLEXCAN_ID_EXT(id) \ - (((uint32_t)(((uint32_t)(id)) << CAN_ID_EXT_SHIFT)) & \ - (CAN_ID_EXT_MASK | CAN_ID_STD_MASK)) /*!< Extend Frame ID helper macro. */ - -/*! @brief FlexCAN Rx Message Buffer Mask helper macro. */ -#define FLEXCAN_RX_MB_STD_MASK(id, rtr, ide) \ - (((uint32_t)((uint32_t)(rtr) << 31) | (uint32_t)((uint32_t)(ide) << 30)) | \ - FLEXCAN_ID_STD(id)) /*!< Standard Rx Message Buffer Mask helper macro. */ -#define FLEXCAN_RX_MB_EXT_MASK(id, rtr, ide) \ - (((uint32_t)((uint32_t)(rtr) << 31) | (uint32_t)((uint32_t)(ide) << 30)) | \ - FLEXCAN_ID_EXT(id)) /*!< Extend Rx Message Buffer Mask helper macro. */ - -/*! @brief FlexCAN Legacy Rx FIFO Mask helper macro. */ -#define FLEXCAN_RX_FIFO_STD_MASK_TYPE_A(id, rtr, ide) \ - (((uint32_t)((uint32_t)(rtr) << 31) | (uint32_t)((uint32_t)(ide) << 30)) | \ - (FLEXCAN_ID_STD(id) << 1)) /*!< Standard Rx FIFO Mask helper macro Type A helper macro. */ -#define FLEXCAN_RX_FIFO_STD_MASK_TYPE_B_HIGH(id, rtr, ide) \ - (((uint32_t)((uint32_t)(rtr) << 31) | (uint32_t)((uint32_t)(ide) << 30)) | \ - (((uint32_t)(id)&0x7FF) << 19)) /*!< Standard Rx FIFO Mask helper macro Type B upper part helper macro. */ -#define FLEXCAN_RX_FIFO_STD_MASK_TYPE_B_LOW(id, rtr, ide) \ - (((uint32_t)((uint32_t)(rtr) << 15) | (uint32_t)((uint32_t)(ide) << 14)) | \ - (((uint32_t)(id)&0x7FF) << 3)) /*!< Standard Rx FIFO Mask helper macro Type B lower part helper macro. */ -#define FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_HIGH(id) \ - (((uint32_t)(id)&0x7F8) << 21) /*!< Standard Rx FIFO Mask helper macro Type C upper part helper macro. */ -#define FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_MID_HIGH(id) \ - (((uint32_t)(id)&0x7F8) << 13) /*!< Standard Rx FIFO Mask helper macro Type C mid-upper part helper macro. */ -#define FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_MID_LOW(id) \ - (((uint32_t)(id)&0x7F8) << 5) /*!< Standard Rx FIFO Mask helper macro Type C mid-lower part helper macro. */ -#define FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_LOW(id) \ - (((uint32_t)(id)&0x7F8) >> 3) /*!< Standard Rx FIFO Mask helper macro Type C lower part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_MASK_TYPE_A(id, rtr, ide) \ - (((uint32_t)((uint32_t)(rtr) << 31) | (uint32_t)((uint32_t)(ide) << 30)) | \ - (FLEXCAN_ID_EXT(id) << 1)) /*!< Extend Rx FIFO Mask helper macro Type A helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_MASK_TYPE_B_HIGH(id, rtr, ide) \ - ( \ - ((uint32_t)((uint32_t)(rtr) << 31) | (uint32_t)((uint32_t)(ide) << 30)) | \ - ((FLEXCAN_ID_EXT(id) & 0x1FFF8000) \ - << 1)) /*!< Extend Rx FIFO Mask helper macro Type B upper part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_MASK_TYPE_B_LOW(id, rtr, ide) \ - (((uint32_t)((uint32_t)(rtr) << 15) | (uint32_t)((uint32_t)(ide) << 14)) | \ - ((FLEXCAN_ID_EXT(id) & 0x1FFF8000) >> \ - 15)) /*!< Extend Rx FIFO Mask helper macro Type B lower part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_HIGH(id) \ - ((FLEXCAN_ID_EXT(id) & 0x1FE00000) << 3) /*!< Extend Rx FIFO Mask helper macro Type C upper part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_MID_HIGH(id) \ - ((FLEXCAN_ID_EXT(id) & 0x1FE00000) >> \ - 5) /*!< Extend Rx FIFO Mask helper macro Type C mid-upper part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_MID_LOW(id) \ - ((FLEXCAN_ID_EXT(id) & 0x1FE00000) >> \ - 13) /*!< Extend Rx FIFO Mask helper macro Type C mid-lower part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_LOW(id) \ - ((FLEXCAN_ID_EXT(id) & 0x1FE00000) >> 21) /*!< Extend Rx FIFO Mask helper macro Type C lower part helper macro. */ - -/*! @brief FlexCAN Rx FIFO Filter helper macro. */ -#define FLEXCAN_RX_FIFO_STD_FILTER_TYPE_A(id, rtr, ide) \ - FLEXCAN_RX_FIFO_STD_MASK_TYPE_A(id, rtr, ide) /*!< Standard Rx FIFO Filter helper macro Type A helper macro. */ -#define FLEXCAN_RX_FIFO_STD_FILTER_TYPE_B_HIGH(id, rtr, ide) \ - FLEXCAN_RX_FIFO_STD_MASK_TYPE_B_HIGH( \ - id, rtr, ide) /*!< Standard Rx FIFO Filter helper macro Type B upper part helper macro. */ -#define FLEXCAN_RX_FIFO_STD_FILTER_TYPE_B_LOW(id, rtr, ide) \ - FLEXCAN_RX_FIFO_STD_MASK_TYPE_B_LOW( \ - id, rtr, ide) /*!< Standard Rx FIFO Filter helper macro Type B lower part helper macro. */ -#define FLEXCAN_RX_FIFO_STD_FILTER_TYPE_C_HIGH(id) \ - FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_HIGH( \ - id) /*!< Standard Rx FIFO Filter helper macro Type C upper part helper macro. */ -#define FLEXCAN_RX_FIFO_STD_FILTER_TYPE_C_MID_HIGH(id) \ - FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_MID_HIGH( \ - id) /*!< Standard Rx FIFO Filter helper macro Type C mid-upper part helper macro. */ -#define FLEXCAN_RX_FIFO_STD_FILTER_TYPE_C_MID_LOW(id) \ - FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_MID_LOW( \ - id) /*!< Standard Rx FIFO Filter helper macro Type C mid-lower part helper macro. */ -#define FLEXCAN_RX_FIFO_STD_FILTER_TYPE_C_LOW(id) \ - FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_LOW( \ - id) /*!< Standard Rx FIFO Filter helper macro Type C lower part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_A(id, rtr, ide) \ - FLEXCAN_RX_FIFO_EXT_MASK_TYPE_A(id, rtr, ide) /*!< Extend Rx FIFO Filter helper macro Type A helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_B_HIGH(id, rtr, ide) \ - FLEXCAN_RX_FIFO_EXT_MASK_TYPE_B_HIGH( \ - id, rtr, ide) /*!< Extend Rx FIFO Filter helper macro Type B upper part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_B_LOW(id, rtr, ide) \ - FLEXCAN_RX_FIFO_EXT_MASK_TYPE_B_LOW( \ - id, rtr, ide) /*!< Extend Rx FIFO Filter helper macro Type B lower part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_C_HIGH(id) \ - FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_HIGH( \ - id) /*!< Extend Rx FIFO Filter helper macro Type C upper part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_C_MID_HIGH(id) \ - FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_MID_HIGH( \ - id) /*!< Extend Rx FIFO Filter helper macro Type C mid-upper part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_C_MID_LOW(id) \ - FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_MID_LOW( \ - id) /*!< Extend Rx FIFO Filter helper macro Type C mid-lower part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_C_LOW(id) \ - FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_LOW(id) /*!< Extend Rx FIFO Filter helper macro Type C lower part helper macro. */ - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! @brief FlexCAN Enhanced Rx FIFO Filter and Mask helper macro. */ -#define ENHANCED_RX_FIFO_FSCH(x) (((uint32_t)(((uint32_t)(x)) << 30)) & 0xC0000000U) -#define RTR_STD_HIGH(x) (((uint32_t)(((uint32_t)(x)) << 27)) & 0x08000000U) -#define RTR_STD_LOW(x) (((uint32_t)(((uint32_t)(x)) << 11)) & 0x00000800U) -#define RTR_EXT(x) (((uint32_t)(((uint32_t)(x)) << 29)) & 0x40000000U) -#define ID_STD_LOW(id) (((uint32_t)id) & 0x7FFU) -#define ID_STD_HIGH(id) (((uint32_t)(((uint32_t)(id)) << 16)) & 0x07FF0000U) -#define ID_EXT(id) (((uint32_t)id) & 0x1FFFFFFFU) - -/*! Standard ID filter element with filter + mask scheme. */ -#define FLEXCAN_ENHANCED_RX_FIFO_STD_MASK_AND_FILTER(id, rtr, id_mask, rtr_mask) \ - (ENHANCED_RX_FIFO_FSCH(0x0) | RTR_STD_HIGH(rtr) | ID_STD_HIGH(id) | RTR_STD_LOW(rtr_mask) | ID_STD_LOW(id_mask)) -/*! Standard ID filter element with filter range. */ -#define FLEXCAN_ENHANCED_RX_FIFO_STD_FILTER_WITH_RANGE(id_upper, rtr, id_lower, rtr_mask) \ - (ENHANCED_RX_FIFO_FSCH(0x1) | RTR_STD_HIGH(rtr) | ID_STD_HIGH(id_upper) | RTR_STD_LOW(rtr_mask) | \ - ID_STD_LOW(id_lower)) -/*! Standard ID filter element with two filters without masks. */ -#define FLEXCAN_ENHANCED_RX_FIFO_STD_TWO_FILTERS(id1, rtr1, id2, rtr2) \ - (ENHANCED_RX_FIFO_FSCH(0x2) | RTR_STD_HIGH(rtr1) | ID_STD_HIGH(id1) | RTR_STD_LOW(rtr2) | ID_STD_LOW(id2)) -/*! Extended ID filter element with filter + mask scheme low word. */ -#define FLEXCAN_ENHANCED_RX_FIFO_EXT_MASK_AND_FILTER_LOW(id, rtr) \ - (ENHANCED_RX_FIFO_FSCH(0x0) | RTR_EXT(rtr) | ID_EXT(id)) -/*! Extended ID filter element with filter + mask scheme high word. */ -#define FLEXCAN_ENHANCED_RX_FIFO_EXT_MASK_AND_FILTER_HIGH(id_mask, rtr_mask) \ - (ENHANCED_RX_FIFO_FSCH(0x0) | RTR_EXT(rtr_mask) | ID_EXT(id_mask)) -/*! Extended ID filter element with range scheme low word. */ -#define FLEXCAN_ENHANCED_RX_FIFO_EXT_FILTER_WITH_RANGE_LOW(id_upper, rtr) \ - (ENHANCED_RX_FIFO_FSCH(0x1) | RTR_EXT(rtr) | ID_EXT(id_upper)) -/*! Extended ID filter element with range scheme high word. */ -#define FLEXCAN_ENHANCED_RX_FIFO_EXT_FILTER_WITH_RANGE_HIGH(id_lower, rtr_mask) \ - (ENHANCED_RX_FIFO_FSCH(0x1) | RTR_EXT(rtr_mask) | ID_EXT(id_lower)) -/*! Extended ID filter element with two filters without masks low word. */ -#define FLEXCAN_ENHANCED_RX_FIFO_EXT_TWO_FILTERS_LOW(id2, rtr2) \ - (ENHANCED_RX_FIFO_FSCH(0x2) | RTR_EXT(rtr2) | ID_EXT(id2)) -/*! Extended ID filter element with two filters without masks high word. */ -#define FLEXCAN_ENHANCED_RX_FIFO_EXT_TWO_FILTERS_HIGH(id1, rtr1) \ - (ENHANCED_RX_FIFO_FSCH(0x2) | RTR_EXT(rtr1) | ID_EXT(id1)) -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) -/*! @brief FlexCAN Pretended Networking ID Mask helper macro. */ -#define FLEXCAN_PN_STD_MASK(id, rtr) \ - ((uint32_t)((uint32_t)(rtr) << CAN_FLT_ID1_FLT_RTR_SHIFT) | \ - FLEXCAN_ID_STD(id)) /*!< Standard Rx Message Buffer Mask helper macro. */ -#define FLEXCAN_PN_EXT_MASK(id, rtr) \ - ((uint32_t)CAN_FLT_ID1_FLT_IDE_MASK | (uint32_t)((uint32_t)(rtr) << CAN_FLT_ID1_FLT_RTR_SHIFT) | \ - FLEXCAN_ID_EXT(id)) /*!< Extend Rx Message Buffer Mask helper macro. */ -#endif - -/*! @brief FlexCAN interrupt/status flag helper macro. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) -#define FLEXCAN_PN_INT_MASK(x) (((uint64_t)(((uint64_t)(x)) << 32)) & 0x3000000000000U) -#define FLEXCAN_PN_INT_UNMASK(x) (((uint32_t)(((uint64_t)(x)) >> 32)) & 0x00030000U) -#define FLEXCAN_PN_STATUS_MASK(x) (((uint64_t)(((uint64_t)(x)) << 16)) & 0x300000000U) -#define FLEXCAN_PN_STATUS_UNMASK(x) (((uint32_t)(((uint64_t)(x)) >> 16)) & 0x00030000U) -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -#define FLEXCAN_EFIFO_INT_MASK(x) (((uint64_t)(((uint64_t)(x)) << 32)) & 0xF000000000000000U) -#define FLEXCAN_EFIFO_INT_UNMASK(x) (((uint32_t)(((uint64_t)(x)) >> 32)) & 0xF0000000U) -#define FLEXCAN_EFIFO_STATUS_MASK(x) (((uint64_t)(((uint64_t)(x)) << 32)) & 0xF003000000000000U) -#define FLEXCAN_EFIFO_STATUS_UNMASK(x) (((uint32_t)(((uint64_t)(x)) >> 32)) & 0xF0030000U) -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -#define FLEXCAN_MECR_INT_MASK(x) (((uint64_t)(((uint64_t)(x)) << 16)) & 0xD00000000U) -#define FLEXCAN_MECR_INT_UNMASK(x) (((uint32_t)(((uint64_t)(x)) >> 16)) & 0x000D0000U) -#define FLEXCAN_MECR_STATUS_MASK(x) (((uint64_t)(((uint64_t)(x)) << 34)) & 0x34003400000000U) -#define FLEXCAN_MECR_STATUS_UNMASK(x) (((uint32_t)(((uint64_t)(x)) >> 34)) & 0x000D000DU) -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -#define FLEXCAN_ERROR_AND_STATUS_INIT_FLAG \ - ((uint32_t)kFLEXCAN_ErrorOverrunFlag | (uint32_t)kFLEXCAN_FDErrorIntFlag | (uint32_t)kFLEXCAN_BusoffDoneIntFlag | \ - (uint32_t)kFLEXCAN_TxWarningIntFlag | (uint32_t)kFLEXCAN_RxWarningIntFlag | (uint32_t)kFLEXCAN_BusOffIntFlag | \ - (uint32_t)kFLEXCAN_ErrorIntFlag | FLEXCAN_MEMORY_ERROR_INIT_FLAG) -#else -#define FLEXCAN_ERROR_AND_STATUS_INIT_FLAG \ - ((uint32_t)kFLEXCAN_TxWarningIntFlag | (uint32_t)kFLEXCAN_RxWarningIntFlag | (uint32_t)kFLEXCAN_BusOffIntFlag | \ - (uint32_t)kFLEXCAN_ErrorIntFlag | FLEXCAN_MEMORY_ERROR_INIT_FLAG) -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) -#define FLEXCAN_WAKE_UP_FLAG \ - ((uint32_t)kFLEXCAN_WakeUpIntFlag | (uint64_t)kFLEXCAN_PNMatchIntFlag | (uint64_t)kFLEXCAN_PNTimeoutIntFlag) -#else -#define FLEXCAN_WAKE_UP_FLAG ((uint32_t)kFLEXCAN_WakeUpIntFlag) -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -#define FLEXCAN_MEMORY_ERROR_INIT_FLAG ((uint64_t)kFLEXCAN_AllMemoryErrorFlag) -#else -#define FLEXCAN_MEMORY_ERROR_INIT_FLAG (0U) -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -#define FLEXCAN_MEMORY_ENHANCED_RX_FIFO_INIT_FLAG \ - ((uint64_t)kFLEXCAN_ERxFifoUnderflowIntFlag | (uint64_t)kFLEXCAN_ERxFifoOverflowIntFlag | \ - (uint64_t)kFLEXCAN_ERxFifoWatermarkIntFlag | (uint64_t)kFLEXCAN_ERxFifoDataAvlIntFlag) -#endif -/*! @brief FlexCAN Enhanced Rx FIFO base address helper macro. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -#define E_RX_FIFO(base) ((uintptr_t)(base) + 0x2000U) -#else -#define FLEXCAN_MEMORY_ENHANCED_RX_FIFO_INIT_FLAG (0U) -#endif -/*! @brief FlexCAN transfer status. */ -enum -{ - kStatus_FLEXCAN_TxBusy = MAKE_STATUS(kStatusGroup_FLEXCAN, 0), /*!< Tx Message Buffer is Busy. */ - kStatus_FLEXCAN_TxIdle = MAKE_STATUS(kStatusGroup_FLEXCAN, 1), /*!< Tx Message Buffer is Idle. */ - kStatus_FLEXCAN_TxSwitchToRx = MAKE_STATUS( - kStatusGroup_FLEXCAN, 2), /*!< Remote Message is send out and Message buffer changed to Receive one. */ - kStatus_FLEXCAN_RxBusy = MAKE_STATUS(kStatusGroup_FLEXCAN, 3), /*!< Rx Message Buffer is Busy. */ - kStatus_FLEXCAN_RxIdle = MAKE_STATUS(kStatusGroup_FLEXCAN, 4), /*!< Rx Message Buffer is Idle. */ - kStatus_FLEXCAN_RxOverflow = MAKE_STATUS(kStatusGroup_FLEXCAN, 5), /*!< Rx Message Buffer is Overflowed. */ - kStatus_FLEXCAN_RxFifoBusy = MAKE_STATUS(kStatusGroup_FLEXCAN, 6), /*!< Rx Message FIFO is Busy. */ - kStatus_FLEXCAN_RxFifoIdle = MAKE_STATUS(kStatusGroup_FLEXCAN, 7), /*!< Rx Message FIFO is Idle. */ - kStatus_FLEXCAN_RxFifoOverflow = MAKE_STATUS(kStatusGroup_FLEXCAN, 8), /*!< Rx Message FIFO is overflowed. */ - kStatus_FLEXCAN_RxFifoWarning = MAKE_STATUS(kStatusGroup_FLEXCAN, 9), /*!< Rx Message FIFO is almost overflowed. */ - kStatus_FLEXCAN_RxFifoDisabled = - MAKE_STATUS(kStatusGroup_FLEXCAN, 10), /*!< Rx Message FIFO is disabled during reading. */ - kStatus_FLEXCAN_ErrorStatus = MAKE_STATUS(kStatusGroup_FLEXCAN, 11), /*!< FlexCAN Module Error and Status. */ - kStatus_FLEXCAN_WakeUp = MAKE_STATUS(kStatusGroup_FLEXCAN, 12), /*!< FlexCAN is waken up from STOP mode. */ - kStatus_FLEXCAN_UnHandled = MAKE_STATUS(kStatusGroup_FLEXCAN, 13), /*!< UnHadled Interrupt asserted. */ - kStatus_FLEXCAN_RxRemote = MAKE_STATUS(kStatusGroup_FLEXCAN, 14), /*!< Rx Remote Message Received in Mail box. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - kStatus_FLEXCAN_RxFifoUnderflow = - MAKE_STATUS(kStatusGroup_FLEXCAN, 15), /*!< Enhanced Rx Message FIFO is underflow. */ -#endif -}; - -/*! @brief FlexCAN frame format. */ -typedef enum _flexcan_frame_format -{ - kFLEXCAN_FrameFormatStandard = 0x0U, /*!< Standard frame format attribute. */ - kFLEXCAN_FrameFormatExtend = 0x1U, /*!< Extend frame format attribute. */ -} flexcan_frame_format_t; - -/*! @brief FlexCAN frame type. */ -typedef enum _flexcan_frame_type -{ - kFLEXCAN_FrameTypeData = 0x0U, /*!< Data frame type attribute. */ - kFLEXCAN_FrameTypeRemote = 0x1U, /*!< Remote frame type attribute. */ -} flexcan_frame_type_t; - -/*! @brief FlexCAN clock source. - * @deprecated Do not use the kFLEXCAN_ClkSrcOs. It has been superceded kFLEXCAN_ClkSrc0 - * @deprecated Do not use the kFLEXCAN_ClkSrcPeri. It has been superceded kFLEXCAN_ClkSrc1 - */ -typedef enum _flexcan_clock_source -{ - kFLEXCAN_ClkSrcOsc = 0x0U, /*!< FlexCAN Protocol Engine clock from Oscillator. */ - kFLEXCAN_ClkSrcPeri = 0x1U, /*!< FlexCAN Protocol Engine clock from Peripheral Clock. */ - kFLEXCAN_ClkSrc0 = 0x0U, /*!< FlexCAN Protocol Engine clock selected by user as SRC == 0. */ - kFLEXCAN_ClkSrc1 = 0x1U, /*!< FlexCAN Protocol Engine clock selected by user as SRC == 1. */ -} flexcan_clock_source_t; - -/*! @brief FlexCAN wake up source. */ -typedef enum _flexcan_wake_up_source -{ - kFLEXCAN_WakeupSrcUnfiltered = 0x0U, /*!< FlexCAN uses unfiltered Rx input to detect edge. */ - kFLEXCAN_WakeupSrcFiltered = 0x1U, /*!< FlexCAN uses filtered Rx input to detect edge. */ -} flexcan_wake_up_source_t; - -/*! @brief FlexCAN Rx Fifo Filter type. */ -typedef enum _flexcan_rx_fifo_filter_type -{ - kFLEXCAN_RxFifoFilterTypeA = 0x0U, /*!< One full ID (standard and extended) per ID Filter element. */ - kFLEXCAN_RxFifoFilterTypeB = - 0x1U, /*!< Two full standard IDs or two partial 14-bit ID slices per ID Filter Table element. */ - kFLEXCAN_RxFifoFilterTypeC = - 0x2U, /*!< Four partial 8-bit Standard or extended ID slices per ID Filter Table element. */ - kFLEXCAN_RxFifoFilterTypeD = 0x3U, /*!< All frames rejected. */ -} flexcan_rx_fifo_filter_type_t; - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * @brief FlexCAN Message Buffer Payload size. - */ -typedef enum _flexcan_mb_size -{ - kFLEXCAN_8BperMB = 0x0U, /*!< Selects 8 bytes per Message Buffer. */ - kFLEXCAN_16BperMB = 0x1U, /*!< Selects 16 bytes per Message Buffer. */ - kFLEXCAN_32BperMB = 0x2U, /*!< Selects 32 bytes per Message Buffer. */ - kFLEXCAN_64BperMB = 0x3U, /*!< Selects 64 bytes per Message Buffer. */ -} flexcan_mb_size_t; - -/*! - * @brief FlexCAN CAN FD frame supporting data length (available DLC values). - * - * For Tx, when the Data size corresponding to DLC value stored in the MB selected for transmission is larger than the - * MB Payload size, FlexCAN adds the necessary number of bytes with constant 0xCC pattern to complete the expected DLC. - * For Rx, when the Data size corresponding to DLC value received from the CAN bus is larger than the MB Payload size, - * the high order bytes that do not fit the Payload size will lose. - */ -enum _flexcan_fd_frame_length -{ - kFLEXCAN_0BperFrame = 0x0U, /*!< Frame contains 0 valid data bytes. */ - kFLEXCAN_1BperFrame, /*!< Frame contains 1 valid data bytes. */ - kFLEXCAN_2BperFrame, /*!< Frame contains 2 valid data bytes. */ - kFLEXCAN_3BperFrame, /*!< Frame contains 3 valid data bytes. */ - kFLEXCAN_4BperFrame, /*!< Frame contains 4 valid data bytes. */ - kFLEXCAN_5BperFrame, /*!< Frame contains 5 valid data bytes. */ - kFLEXCAN_6BperFrame, /*!< Frame contains 6 valid data bytes. */ - kFLEXCAN_7BperFrame, /*!< Frame contains 7 valid data bytes. */ - kFLEXCAN_8BperFrame, /*!< Frame contains 8 valid data bytes. */ - kFLEXCAN_12BperFrame, /*!< Frame contains 12 valid data bytes. */ - kFLEXCAN_16BperFrame, /*!< Frame contains 16 valid data bytes. */ - kFLEXCAN_20BperFrame, /*!< Frame contains 20 valid data bytes. */ - kFLEXCAN_24BperFrame, /*!< Frame contains 24 valid data bytes. */ - kFLEXCAN_32BperFrame, /*!< Frame contains 32 valid data bytes. */ - kFLEXCAN_48BperFrame, /*!< Frame contains 48 valid data bytes. */ - kFLEXCAN_64BperFrame, /*!< Frame contains 64 valid data bytes. */ -}; -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! @brief FlexCAN Enhanced Rx Fifo DMA transfer per read length enumerations. */ -typedef enum _flexcan_efifo_dma_per_read_length -{ - kFLEXCAN_1WordPerRead = 0x0U, /*!< Transfer 1 32-bit words (CS).*/ - kFLEXCAN_2WordPerRead, /*!< Transfer 2 32-bit words (CS + ID).*/ - kFLEXCAN_3WordPerRead, /*!< Transfer 3 32-bit words (CS + ID + 1~4 bytes data).*/ - kFLEXCAN_4WordPerRead, /*!< Transfer 4 32-bit words (CS + ID + 5~8 bytes data).*/ - kFLEXCAN_5WordPerRead, /*!< Transfer 5 32-bit words (CS + ID + 9~12 bytes data).*/ - kFLEXCAN_6WordPerRead, /*!< Transfer 6 32-bit words (CS + ID + 13~16 bytes data).*/ - kFLEXCAN_7WordPerRead, /*!< Transfer 7 32-bit words (CS + ID + 17~20 bytes data).*/ - kFLEXCAN_8WordPerRead, /*!< Transfer 8 32-bit words (CS + ID + 21~24 bytes data).*/ - kFLEXCAN_9WordPerRead, /*!< Transfer 9 32-bit words (CS + ID + 25~28 bytes data).*/ - kFLEXCAN_10WordPerRead, /*!< Transfer 10 32-bit words (CS + ID + 29~32 bytes data).*/ - kFLEXCAN_11WordPerRead, /*!< Transfer 11 32-bit words (CS + ID + 33~36 bytes data).*/ - kFLEXCAN_12WordPerRead, /*!< Transfer 12 32-bit words (CS + ID + 37~40 bytes data).*/ - kFLEXCAN_13WordPerRead, /*!< Transfer 13 32-bit words (CS + ID + 41~44 bytes data).*/ - kFLEXCAN_14WordPerRead, /*!< Transfer 14 32-bit words (CS + ID + 45~48 bytes data).*/ - kFLEXCAN_15WordPerRead, /*!< Transfer 15 32-bit words (CS + ID + 49~52 bytes data).*/ - kFLEXCAN_16WordPerRead, /*!< Transfer 16 32-bit words (CS + ID + 53~56 bytes data).*/ - kFLEXCAN_17WordPerRead, /*!< Transfer 17 32-bit words (CS + ID + 57~60 bytes data).*/ - kFLEXCAN_18WordPerRead, /*!< Transfer 18 32-bit words (CS + ID + 61~64 bytes data).*/ - kFLEXCAN_19WordPerRead /*!< Transfer 19 32-bit words (CS + ID + 64 bytes data + ID HIT).*/ -} flexcan_efifo_dma_per_read_length_t; -#endif - -/*! - * @brief FlexCAN Enhanced/Legacy Rx FIFO priority. - * - * The matching process starts from the Rx MB(or Enhanced/Legacy Rx FIFO) with higher priority. - * If no MB(or Enhanced/Legacy Rx FIFO filter) is satisfied, the matching process goes on with - * the Enhanced/Legacy Rx FIFO(or Rx MB) with lower priority. - */ -typedef enum _flexcan_rx_fifo_priority -{ - kFLEXCAN_RxFifoPrioLow = 0x0U, /*!< Matching process start from Rx Message Buffer first. */ - kFLEXCAN_RxFifoPrioHigh = 0x1U, /*!< Matching process start from Enhanced/Legacy Rx FIFO first. */ -} flexcan_rx_fifo_priority_t; - -/*! - * @brief FlexCAN interrupt enable enumerations. - * - * This provides constants for the FlexCAN interrupt enable enumerations for use in the FlexCAN functions. - * @note FlexCAN Message Buffers and Legacy Rx FIFO interrupts not included in. - */ -enum _flexcan_interrupt_enable -{ - kFLEXCAN_BusOffInterruptEnable = CAN_CTRL1_BOFFMSK_MASK, /*!< Bus Off interrupt, use bit 15. */ - kFLEXCAN_ErrorInterruptEnable = CAN_CTRL1_ERRMSK_MASK, /*!< CAN Error interrupt, use bit 14. */ - kFLEXCAN_TxWarningInterruptEnable = CAN_CTRL1_TWRNMSK_MASK, /*!< Tx Warning interrupt, use bit 11. */ - kFLEXCAN_RxWarningInterruptEnable = CAN_CTRL1_RWRNMSK_MASK, /*!< Rx Warning interrupt, use bit 10. */ - kFLEXCAN_WakeUpInterruptEnable = CAN_MCR_WAKMSK_MASK, /*!< Self Wake Up interrupt, use bit 26. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - kFLEXCAN_FDErrorInterruptEnable = CAN_CTRL2_ERRMSK_FAST_MASK, /*!< CAN FD Error interrupt, use bit 31. */ -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - /*! PN Match Wake Up interrupt, use high word bit 17. */ - kFLEXCAN_PNMatchWakeUpInterruptEnable = FLEXCAN_PN_INT_MASK(CAN_CTRL1_PN_WTOF_MSK_MASK), - /*! PN Timeout Wake Up interrupt, use high word bit 16. */ - kFLEXCAN_PNTimeoutWakeUpInterruptEnable = FLEXCAN_PN_INT_MASK(CAN_CTRL1_PN_WUMF_MSK_MASK), -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - /*!< Enhanced Rx FIFO Underflow interrupt, use high word bit 31. */ - kFLEXCAN_ERxFifoUnderflowInterruptEnable = FLEXCAN_EFIFO_INT_MASK(CAN_ERFIER_ERFUFWIE_MASK), - /*!< Enhanced Rx FIFO Overflow interrupt, use high word bit 30. */ - kFLEXCAN_ERxFifoOverflowInterruptEnable = FLEXCAN_EFIFO_INT_MASK(CAN_ERFIER_ERFOVFIE_MASK), - /*!< Enhanced Rx FIFO Watermark interrupt, use high word bit 29. */ - kFLEXCAN_ERxFifoWatermarkInterruptEnable = FLEXCAN_EFIFO_INT_MASK(CAN_ERFIER_ERFWMIIE_MASK), - /*!< Enhanced Rx FIFO Data Avilable interrupt, use high word bit 28. */ - kFLEXCAN_ERxFifoDataAvlInterruptEnable = FLEXCAN_EFIFO_INT_MASK(CAN_ERFIER_ERFDAIE_MASK), -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - /*! Host Access With Non-Correctable Errors interrupt, use high word bit 0. */ - kFLEXCAN_HostAccessNCErrorInterruptEnable = FLEXCAN_MECR_INT_MASK(CAN_MECR_HANCEI_MSK_MASK), - /*! FlexCAN Access With Non-Correctable Errors interrupt, use high word bit 2. */ - kFLEXCAN_FlexCanAccessNCErrorInterruptEnable = FLEXCAN_MECR_INT_MASK(CAN_MECR_FANCEI_MSK_MASK), - /*! Host or FlexCAN Access With Correctable Errors interrupt, use high word bit 3. */ - kFLEXCAN_HostOrFlexCanCErrorInterruptEnable = FLEXCAN_MECR_INT_MASK(CAN_MECR_CEI_MSK_MASK), -#endif -}; - -/*! - * @brief FlexCAN status flags. - * - * This provides constants for the FlexCAN status flags for use in the FlexCAN functions. - * @note The CPU read action clears the bits corresponding to the FlEXCAN_ErrorFlag macro, therefore user need to - * read status flags and distinguish which error is occur using @ref _flexcan_error_flags enumerations. - */ -enum _flexcan_flags -{ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - kFLEXCAN_ErrorOverrunFlag = CAN_ESR1_ERROVR_MASK, /*!< Error Overrun Status. */ - kFLEXCAN_FDErrorIntFlag = CAN_ESR1_ERRINT_FAST_MASK, /*!< CAN FD Error Interrupt Flag. */ - kFLEXCAN_BusoffDoneIntFlag = CAN_ESR1_BOFFDONEINT_MASK, /*!< Bus Off process completed Interrupt Flag. */ -#endif - kFLEXCAN_SynchFlag = CAN_ESR1_SYNCH_MASK, /*!< CAN Synchronization Status. */ - kFLEXCAN_TxWarningIntFlag = CAN_ESR1_TWRNINT_MASK, /*!< Tx Warning Interrupt Flag. */ - kFLEXCAN_RxWarningIntFlag = CAN_ESR1_RWRNINT_MASK, /*!< Rx Warning Interrupt Flag. */ - kFLEXCAN_IdleFlag = CAN_ESR1_IDLE_MASK, /*!< FlexCAN In IDLE Status. */ - kFLEXCAN_FaultConfinementFlag = CAN_ESR1_FLTCONF_MASK, /*!< FlexCAN Fault Confinement State. */ - kFLEXCAN_TransmittingFlag = CAN_ESR1_TX_MASK, /*!< FlexCAN In Transmission Status. */ - kFLEXCAN_ReceivingFlag = CAN_ESR1_RX_MASK, /*!< FlexCAN In Reception Status. */ - kFLEXCAN_BusOffIntFlag = CAN_ESR1_BOFFINT_MASK, /*!< Bus Off Interrupt Flag. */ - kFLEXCAN_ErrorIntFlag = CAN_ESR1_ERRINT_MASK, /*!< CAN Error Interrupt Flag. */ - kFLEXCAN_WakeUpIntFlag = CAN_ESR1_WAKINT_MASK, /*!< Self Wake-Up Interrupt Flag. */ - kFLEXCAN_ErrorFlag = - (uint32_t)(/*!< All FlexCAN Read Clear Error Status. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - CAN_ESR1_STFERR_FAST_MASK | CAN_ESR1_FRMERR_FAST_MASK | CAN_ESR1_CRCERR_FAST_MASK | - CAN_ESR1_BIT0ERR_FAST_MASK | CAN_ESR1_BIT1ERR_FAST_MASK | CAN_ESR1_ERROVR_MASK | -#endif - CAN_ESR1_TXWRN_MASK | CAN_ESR1_RXWRN_MASK | CAN_ESR1_BIT1ERR_MASK | CAN_ESR1_BIT0ERR_MASK | - CAN_ESR1_ACKERR_MASK | CAN_ESR1_CRCERR_MASK | CAN_ESR1_FRMERR_MASK | CAN_ESR1_STFERR_MASK), -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - kFLEXCAN_PNMatchIntFlag = FLEXCAN_PN_STATUS_MASK(CAN_WU_MTC_WUMF_MASK), /*!< PN Matching Event Interrupt Flag. */ - kFLEXCAN_PNTimeoutIntFlag = FLEXCAN_PN_STATUS_MASK(CAN_WU_MTC_WTOF_MASK), /*!< PN Timeout Event Interrupt Flag. */ -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - kFLEXCAN_ERxFifoUnderflowIntFlag = - FLEXCAN_EFIFO_STATUS_MASK(CAN_ERFSR_ERFUFW_MASK), /*!< Enhanced Rx FIFO underflow Interrupt Flag. */ - kFLEXCAN_ERxFifoOverflowIntFlag = - FLEXCAN_EFIFO_STATUS_MASK(CAN_ERFSR_ERFOVF_MASK), /*!< Enhanced Rx FIFO overflow Interrupt Flag. */ - kFLEXCAN_ERxFifoWatermarkIntFlag = - FLEXCAN_EFIFO_STATUS_MASK(CAN_ERFSR_ERFWMI_MASK), /*!< Enhanced Rx FIFO watermark Interrupt Flag. */ - kFLEXCAN_ERxFifoDataAvlIntFlag = - FLEXCAN_EFIFO_STATUS_MASK(CAN_ERFSR_ERFDA_MASK), /*!< Enhanced Rx FIFO data available Interrupt Flag. */ - kFLEXCAN_ERxFifoEmptyFlag = FLEXCAN_EFIFO_STATUS_MASK(CAN_ERFSR_ERFE_MASK), /*!< Enhanced Rx FIFO empty status. */ - kFLEXCAN_ERxFifoFullFlag = FLEXCAN_EFIFO_STATUS_MASK(CAN_ERFSR_ERFF_MASK), /*!< Enhanced Rx FIFO full status. */ -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - /*! Host Access With Non-Correctable Error Interrupt Flag. */ - kFLEXCAN_HostAccessNonCorrectableErrorIntFlag = FLEXCAN_MECR_INT_MASK(CAN_ERRSR_HANCEIF_MASK), - /*! FlexCAN Access With Non-Correctable Error Interrupt Flag. */ - kFLEXCAN_FlexCanAccessNonCorrectableErrorIntFlag = FLEXCAN_MECR_INT_MASK(CAN_ERRSR_FANCEIF_MASK), - /*! Correctable Error Interrupt Flag. */ - kFLEXCAN_CorrectableErrorIntFlag = FLEXCAN_MECR_INT_MASK(CAN_ERRSR_CEIF_MASK), - /*! Host Access With Non-Correctable Error Interrupt Overrun Flag. */ - kFLEXCAN_HostAccessNonCorrectableErrorOverrunFlag = FLEXCAN_MECR_INT_MASK(CAN_ERRSR_HANCEIOF_MASK), - /*! FlexCAN Access With Non-Correctable Error Interrupt Overrun Flag. */ - kFLEXCAN_FlexCanAccessNonCorrectableErrorOverrunFlag = FLEXCAN_MECR_INT_MASK(CAN_ERRSR_FANCEIOF_MASK), - /*! Correctable Error Interrupt Overrun Flag. */ - kFLEXCAN_CorrectableErrorOverrunFlag = FLEXCAN_MECR_INT_MASK(CAN_ERRSR_CEIOF_MASK), - /*! All Memory Error Flags. */ - kFLEXCAN_AllMemoryErrorFlag = - (kFLEXCAN_HostAccessNonCorrectableErrorIntFlag | kFLEXCAN_FlexCanAccessNonCorrectableErrorIntFlag | - kFLEXCAN_CorrectableErrorIntFlag | kFLEXCAN_HostAccessNonCorrectableErrorOverrunFlag | - kFLEXCAN_FlexCanAccessNonCorrectableErrorOverrunFlag | kFLEXCAN_CorrectableErrorOverrunFlag) -#endif -}; - -/*! - * @brief FlexCAN error status flags. - * - * The FlexCAN Error Status enumerations is used to report current error of the FlexCAN bus. - * This enumerations should be used with KFLEXCAN_ErrorFlag in @ref _flexcan_flags enumerations - * to ditermine which error is generated. - */ -enum _flexcan_error_flags -{ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - kFLEXCAN_FDStuffingError = CAN_ESR1_STFERR_FAST_MASK, /*!< Stuffing Error. */ - kFLEXCAN_FDFormError = CAN_ESR1_FRMERR_FAST_MASK, /*!< Form Error. */ - kFLEXCAN_FDCrcError = CAN_ESR1_CRCERR_FAST_MASK, /*!< Cyclic Redundancy Check Error. */ - kFLEXCAN_FDBit0Error = CAN_ESR1_BIT0ERR_FAST_MASK, /*!< Unable to send dominant bit. */ - kFLEXCAN_FDBit1Error = (int)CAN_ESR1_BIT1ERR_FAST_MASK, /*!< Unable to send recessive bit. */ -#endif - kFLEXCAN_TxErrorWarningFlag = CAN_ESR1_TXWRN_MASK, /*!< Tx Error Warning Status. */ - kFLEXCAN_RxErrorWarningFlag = CAN_ESR1_RXWRN_MASK, /*!< Rx Error Warning Status. */ - kFLEXCAN_StuffingError = CAN_ESR1_STFERR_MASK, /*!< Stuffing Error. */ - kFLEXCAN_FormError = CAN_ESR1_FRMERR_MASK, /*!< Form Error. */ - kFLEXCAN_CrcError = CAN_ESR1_CRCERR_MASK, /*!< Cyclic Redundancy Check Error. */ - kFLEXCAN_AckError = CAN_ESR1_ACKERR_MASK, /*!< Received no ACK on transmission. */ - kFLEXCAN_Bit0Error = CAN_ESR1_BIT0ERR_MASK, /*!< Unable to send dominant bit. */ - kFLEXCAN_Bit1Error = CAN_ESR1_BIT1ERR_MASK, /*!< Unable to send recessive bit. */ -}; - -/*! - * @brief FlexCAN Legacy Rx FIFO status flags. - * - * The FlexCAN Legacy Rx FIFO Status enumerations are used to determine the status of the - * Rx FIFO. Because Rx FIFO occupy the MB0 ~ MB7 (Rx Fifo filter also occupies - * more Message Buffer space), Rx FIFO status flags are mapped to the corresponding - * Message Buffer status flags. - */ -enum -{ - kFLEXCAN_RxFifoOverflowFlag = CAN_IFLAG1_BUF7I_MASK, /*!< Rx FIFO overflow flag. */ - kFLEXCAN_RxFifoWarningFlag = CAN_IFLAG1_BUF6I_MASK, /*!< Rx FIFO almost full flag. */ - kFLEXCAN_RxFifoFrameAvlFlag = CAN_IFLAG1_BUF5I_MASK, /*!< Frames available in Rx FIFO flag. */ -}; - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -/*! - * @brief FlexCAN Memory Error Type. - */ -typedef enum _flexcan_memory_error_type -{ - kFLEXCAN_CorrectableError = 0U, /*!< The memory error is correctable which means on bit error. */ - kFLEXCAN_NonCorrectableError /*!< The memory error is non-correctable which means two bit errors. */ -} flexcan_memory_error_type_t; - -/*! - * @brief FlexCAN Memory Access Type. - */ -typedef enum _flexcan_memory_access_type -{ - kFLEXCAN_MoveOutFlexCanAccess = 0U, /*!< The memory error was detected during move-out FlexCAN access. */ - kFLEXCAN_MoveInAccess, /*!< The memory error was detected during move-in FlexCAN access. */ - kFLEXCAN_TxArbitrationAccess, /*!< The memory error was detected during Tx Arbitration FlexCAN access. */ - kFLEXCAN_RxMatchingAccess, /*!< The memory error was detected during Rx Matching FlexCAN access. */ - kFLEXCAN_MoveOutHostAccess /*!< The memory error was detected during Rx Matching Host (CPU) access. */ -} flexcan_memory_access_type_t; - -/*! - * @brief FlexCAN Memory Error Byte Syndrome. - */ -typedef enum _flexcan_byte_error_syndrome -{ - kFLEXCAN_NoError = 0U, /*!< No bit error in this byte. */ - kFLEXCAN_ParityBits0Error = 1U, /*!< Parity bit 0 error in this byte. */ - kFLEXCAN_ParityBits1Error = 2U, /*!< Parity bit 1 error in this byte. */ - kFLEXCAN_ParityBits2Error = 4U, /*!< Parity bit 2 error in this byte. */ - kFLEXCAN_ParityBits3Error = 8U, /*!< Parity bit 3 error in this byte. */ - kFLEXCAN_ParityBits4Error = 16U, /*!< Parity bit 4 error in this byte. */ - kFLEXCAN_DataBits0Error = 28U, /*!< Data bit 0 error in this byte. */ - kFLEXCAN_DataBits1Error = 22U, /*!< Data bit 1 error in this byte. */ - kFLEXCAN_DataBits2Error = 19U, /*!< Data bit 2 error in this byte. */ - kFLEXCAN_DataBits3Error = 25U, /*!< Data bit 3 error in this byte. */ - kFLEXCAN_DataBits4Error = 26U, /*!< Data bit 4 error in this byte. */ - kFLEXCAN_DataBits5Error = 7U, /*!< Data bit 5 error in this byte. */ - kFLEXCAN_DataBits6Error = 21U, /*!< Data bit 6 error in this byte. */ - kFLEXCAN_DataBits7Error = 14U, /*!< Data bit 7 error in this byte. */ - kFLEXCAN_AllZeroError = 6U, /*!< All-zeros non-correctable error in this byte. */ - kFLEXCAN_AllOneError = 31U, /*!< All-ones non-correctable error in this byte. */ - kFLEXCAN_NonCorrectableErrors /*!< Non-correctable error in this byte. */ -} flexcan_byte_error_syndrome_t; - -/*! - * @brief FlexCAN memory error register status structure - * - * This structure contains the memory access properties that caused a memory error access. - * It is used as the parameter of FLEXCAN_GetMemoryErrorReportStatus() function. And user can - * use FLEXCAN_GetMemoryErrorReportStatus to get the status of the last memory error access. - */ -typedef struct _flexcan_memory_error_report_status -{ - flexcan_memory_error_type_t errorType; /*!< The type of memory error that giving rise to the report. */ - flexcan_memory_access_type_t accessType; /*!< The type of memory access that giving rise to the memory error. */ - uint16_t accessAddress; /*!< The address where memory error detected. */ - uint32_t errorData; /*!< The raw data word read from memory with error. */ - struct - { - bool byteIsRead; /*!< The byte n (0~3) was read or not. */ - /*!< The type of error and which bit in byte (n) is affected by the error. */ - flexcan_byte_error_syndrome_t bitAffected; - } byteStatus[4]; -} flexcan_memory_error_report_status_t; -#endif - -#if defined(__CC_ARM) -#pragma anon_unions -#endif -/*! @brief FlexCAN message frame structure. */ -typedef struct _flexcan_frame -{ - struct - { - uint32_t timestamp : 16; /*!< FlexCAN internal Free-Running Counter Time Stamp. */ - uint32_t length : 4; /*!< CAN frame data length in bytes (Range: 0~8). */ - uint32_t type : 1; /*!< CAN Frame Type(DATA or REMOTE). */ - uint32_t format : 1; /*!< CAN Frame Identifier(STD or EXT format). */ - uint32_t : 1; /*!< Reserved. */ - uint32_t idhit : 9; /*!< CAN Rx FIFO filter hit id(This value is only used in Rx FIFO receive mode). */ - }; - struct - { - uint32_t id : 29; /*!< CAN Frame Identifier, should be set using FLEXCAN_ID_EXT() or FLEXCAN_ID_STD() macro. */ - uint32_t : 3; /*!< Reserved. */ - }; - union - { - struct - { - uint32_t dataWord0; /*!< CAN Frame payload word0. */ - uint32_t dataWord1; /*!< CAN Frame payload word1. */ - }; - struct - { - uint8_t dataByte3; /*!< CAN Frame payload byte3. */ - uint8_t dataByte2; /*!< CAN Frame payload byte2. */ - uint8_t dataByte1; /*!< CAN Frame payload byte1. */ - uint8_t dataByte0; /*!< CAN Frame payload byte0. */ - uint8_t dataByte7; /*!< CAN Frame payload byte7. */ - uint8_t dataByte6; /*!< CAN Frame payload byte6. */ - uint8_t dataByte5; /*!< CAN Frame payload byte5. */ - uint8_t dataByte4; /*!< CAN Frame payload byte4. */ - }; - }; -} flexcan_frame_t; - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! @brief CAN FD message frame structure. - * - * The CAN FD message supporting up to sixty four bytes can be used for a data frame, depending on the length - * selected for the message buffers. The length should be a enumeration member, see @ref _flexcan_fd_frame_length. - */ -typedef struct _flexcan_fd_frame -{ - struct - { - uint32_t timestamp : 16; /*!< FlexCAN internal Free-Running Counter Time Stamp. */ - uint32_t length : 4; /*!< CAN FD frame data length code (DLC), range see @ref _flexcan_fd_frame_length, When the - length <= 8, it equal to the data length, otherwise the number of valid frame data is - not equal to the length value. user can - use DLC_LENGTH_DECODE(length) macro to get the number of valid data bytes. */ - uint32_t type : 1; /*!< CAN Frame Type(DATA or REMOTE). */ - uint32_t format : 1; /*!< CAN Frame Identifier(STD or EXT format). */ - uint32_t srr : 1; /*!< Substitute Remote request. */ - uint32_t : 6; - uint32_t esi : 1; /*!< Error State Indicator. */ - uint32_t brs : 1; /*!< Bit Rate Switch. */ - uint32_t edl : 1; /*!< Extended Data Length. */ - }; - struct - { - uint32_t id : 29; /*!< CAN Frame Identifier, should be set using FLEXCAN_ID_EXT() or FLEXCAN_ID_STD() macro. */ - uint32_t : 3; /*!< Reserved. */ - }; - union - { - struct - { - uint32_t dataWord[16]; /*!< CAN FD Frame payload, 16 double word maximum. */ - }; - /* Note: the maximum databyte* below is actually 64, user can add them if needed, - or just use dataWord[*] instead. */ - struct - { - uint8_t dataByte3; /*!< CAN Frame payload byte3. */ - uint8_t dataByte2; /*!< CAN Frame payload byte2. */ - uint8_t dataByte1; /*!< CAN Frame payload byte1. */ - uint8_t dataByte0; /*!< CAN Frame payload byte0. */ - uint8_t dataByte7; /*!< CAN Frame payload byte7. */ - uint8_t dataByte6; /*!< CAN Frame payload byte6. */ - uint8_t dataByte5; /*!< CAN Frame payload byte5. */ - uint8_t dataByte4; /*!< CAN Frame payload byte4. */ - }; - }; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - /*! @note ID HIT offset is changed dynamically according to data length code (DLC), when DLC is 15, they will be - * located below. Using FLEXCAN_FixEnhancedRxFifoFrameIdHit API is recommended to ensure this idhit value is - * correct.*/ - uint32_t idhit; /*!< CAN Enhanced Rx FIFO filter hit id (This value is only used in Enhanced Rx FIFO receive - mode). */ -#endif -} flexcan_fd_frame_t; -#endif - -/*! @brief FlexCAN protocol timing characteristic configuration structure. */ -typedef struct _flexcan_timing_config -{ - uint16_t preDivider; /*!< Classic CAN or CAN FD nominal phase bit rate prescaler. */ - uint8_t rJumpwidth; /*!< Classic CAN or CAN FD nominal phase Re-sync Jump Width. */ - uint8_t phaseSeg1; /*!< Classic CAN or CAN FD nominal phase Segment 1. */ - uint8_t phaseSeg2; /*!< Classic CAN or CAN FD nominal phase Segment 2. */ - uint8_t propSeg; /*!< Classic CAN or CAN FD nominal phase Propagation Segment. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - uint16_t fpreDivider; /*!< CAN FD data phase bit rate prescaler. */ - uint8_t frJumpwidth; /*!< CAN FD data phase Re-sync Jump Width. */ - uint8_t fphaseSeg1; /*!< CAN FD data phase Phase Segment 1. */ - uint8_t fphaseSeg2; /*!< CAN FD data phase Phase Segment 2. */ - uint8_t fpropSeg; /*!< CAN FD data phase Propagation Segment. */ -#endif -} flexcan_timing_config_t; - -/*! @brief FlexCAN module configuration structure. - * @deprecated Do not use the baudRate. It has been superceded bitRate - * @deprecated Do not use the baudRateFD. It has been superceded bitRateFD - */ -typedef struct _flexcan_config -{ - union - { - struct - { - uint32_t baudRate; /*!< FlexCAN bit rate in bps, for classical CAN or CANFD nominal phase. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - uint32_t baudRateFD; /*!< FlexCAN FD bit rate in bps, for CANFD data phase. */ -#endif - }; - struct - { - uint32_t bitRate; /*!< FlexCAN bit rate in bps, for classical CAN or CANFD nominal phase. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - uint32_t bitRateFD; /*!< FlexCAN FD bit rate in bps, for CANFD data phase. */ -#endif - }; - }; - flexcan_clock_source_t clkSrc; /*!< Clock source for FlexCAN Protocol Engine. */ - flexcan_wake_up_source_t wakeupSrc; /*!< Wake up source selection. */ - uint8_t maxMbNum; /*!< The maximum number of Message Buffers used by user. */ - bool enableLoopBack; /*!< Enable or Disable Loop Back Self Test Mode. */ - bool enableTimerSync; /*!< Enable or Disable Timer Synchronization. */ - bool enableSelfWakeup; /*!< Enable or Disable Self Wakeup Mode. */ - bool enableIndividMask; /*!< Enable or Disable Rx Individual Mask and Queue feature. */ - bool disableSelfReception; /*!< Enable or Disable Self Reflection. */ - bool enableListenOnlyMode; /*!< Enable or Disable Listen Only Mode. */ -#if !(defined(FSL_FEATURE_FLEXCAN_HAS_NO_SUPV_SUPPORT) && FSL_FEATURE_FLEXCAN_HAS_NO_SUPV_SUPPORT) - bool enableSupervisorMode; /*!< Enable or Disable Supervisor Mode, enable this mode will make registers allow only - Supervisor access. */ -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_DOZE_MODE_SUPPORT) && FSL_FEATURE_FLEXCAN_HAS_DOZE_MODE_SUPPORT) - bool enableDoze; /*!< Enable or Disable Doze Mode. */ -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - bool enablePretendedeNetworking; /*!< Enable or Disable the Pretended Networking mode. */ -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - bool enableMemoryErrorControl; /*!< Enable or Disable the memory errors detection and correction mechanism. */ - bool enableNonCorrectableErrorEnterFreeze; /*!< Enable or Disable Non-Correctable Errors In FlexCAN Access Put - Device In Freeze Mode. */ -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - bool enableTransceiverDelayMeasure; /*!< Enable or Disable the transceiver delay measurement, when it is enabled, - then the secondary sample point position is determined by the sum of the - transceiver delay measurement plus the enhanced TDC offset. */ -#endif - flexcan_timing_config_t timingConfig; /* Protocol timing . */ -} flexcan_config_t; - -/*! - * @brief FlexCAN Receive Message Buffer configuration structure - * - * This structure is used as the parameter of FLEXCAN_SetRxMbConfig() function. - * The FLEXCAN_SetRxMbConfig() function is used to configure FlexCAN Receive - * Message Buffer. The function abort previous receiving process, clean the - * Message Buffer and activate the Rx Message Buffer using given Message Buffer - * setting. - */ -typedef struct _flexcan_rx_mb_config -{ - uint32_t id; /*!< CAN Message Buffer Frame Identifier, should be set using - FLEXCAN_ID_EXT() or FLEXCAN_ID_STD() macro. */ - flexcan_frame_format_t format; /*!< CAN Frame Identifier format(Standard of Extend). */ - flexcan_frame_type_t type; /*!< CAN Frame Type(Data or Remote). */ -} flexcan_rx_mb_config_t; - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) -/*! @brief FlexCAN Pretended Networking match source selection. */ -typedef enum _flexcan_pn_match_source -{ - kFLEXCAN_PNMatSrcID = 0U, /*!< Message match with ID filtering. */ - kFLEXCAN_PNMatSrcIDAndData, /*!< Message match with ID filtering and payload filtering. */ -} flexcan_pn_match_source_t; - -/*! @brief FlexCAN Pretended Networking mode match type. */ -typedef enum _flexcan_pn_match_mode -{ - kFLEXCAN_PNMatModeEqual = 0x0U, /*!< Match upon ID/Payload contents against an exact target value. */ - kFLEXCAN_PNMatModeGreater, /*!< Match upon an ID/Payload value greater than or equal to a specified target value. - */ - kFLEXCAN_PNMatModeSmaller, /*!< Match upon an ID/Payload value smaller than or equal to a specified target value. - */ - kFLEXCAN_PNMatModeRange, /*!< Match upon an ID/Payload value inside a range, greater than or equal to a specified - lower limit, and smaller than or equal to a specified upper limit */ -} flexcan_pn_match_mode_t; - -/*! - * @brief FlexCAN Pretended Networking configuration structure - * - * This structure is used as the parameter of FLEXCAN_SetPNConfig() function. - * The FLEXCAN_SetPNConfig() function is used to configure FlexCAN Networking work mode. - */ -typedef struct _flexcan_pn_config -{ - bool enableTimeout; /*!< Enable or Disable timeout event trigger wakeup.*/ - uint16_t timeoutValue; /*!< The timeout value that generates a wakeup event, the counter timer is incremented based - on 64 times the CAN Bit Time unit. */ - bool enableMatch; /*!< Enable or Disable match event trigger wakeup.*/ - flexcan_pn_match_source_t matchSrc; /*!< Selects the match source (ID and/or data match) to trigger wakeup. */ - uint8_t matchNum; /*!< The number of times a given message must match the predefined ID and/or data before - generating a wakeup event, range in 0x1 ~ 0xFF. */ - flexcan_pn_match_mode_t idMatchMode; /*!< The ID match type. */ - flexcan_pn_match_mode_t dataMatchMode; /*!< The data match type. */ - uint32_t idLower; /*!< The ID target values 1 which used either for ID match "equal to", "smaller than", - "greater than" comparisons, or as the lower limit value in ID match "range detection". */ - uint32_t idUpper; /*!< The ID target values 2 which used only as the upper limit value in ID match "range - detection" or used to store the ID mask in "equal to". */ - uint8_t lengthLower; /*!< The lower limit for length of data bytes which used only in data match "range - detection". Range in 0x0 ~ 0x8.*/ - uint8_t lengthUpper; /*!< The upper limit for length of data bytes which used only in data match "range - detection". Range in 0x0 ~ 0x8.*/ - union - { - /*!< The data target values 1 which used either for data match "equal to", "smaller than", - "greater than" comparisons, or as the lower limit value in data match "range - detection". */ - struct - { - uint32_t lowerWord0; /*!< CAN Frame payload word0. */ - uint32_t lowerWord1; /*!< CAN Frame payload word1. */ - }; - struct - { - uint8_t lowerByte3; /*!< CAN Frame payload byte3. */ - uint8_t lowerByte2; /*!< CAN Frame payload byte2. */ - uint8_t lowerByte1; /*!< CAN Frame payload byte1. */ - uint8_t lowerByte0; /*!< CAN Frame payload byte0. */ - uint8_t lowerByte7; /*!< CAN Frame payload byte7. */ - uint8_t lowerByte6; /*!< CAN Frame payload byte6. */ - uint8_t lowerByte5; /*!< CAN Frame payload byte5. */ - uint8_t lowerByte4; /*!< CAN Frame payload byte4. */ - }; - }; - union - { - /*!< The data target values 2 which used only as the upper limit value in data match "range - detection" or used to store the data mask in "equal to". */ - struct - { - uint32_t upperWord0; /*!< CAN Frame payload word0. */ - uint32_t upperWord1; /*!< CAN Frame payload word1. */ - }; - struct - { - uint8_t upperByte3; /*!< CAN Frame payload byte3. */ - uint8_t upperByte2; /*!< CAN Frame payload byte2. */ - uint8_t upperByte1; /*!< CAN Frame payload byte1. */ - uint8_t upperByte0; /*!< CAN Frame payload byte0. */ - uint8_t upperByte7; /*!< CAN Frame payload byte7. */ - uint8_t upperByte6; /*!< CAN Frame payload byte6. */ - uint8_t upperByte5; /*!< CAN Frame payload byte5. */ - uint8_t upperByte4; /*!< CAN Frame payload byte4. */ - }; - }; -} flexcan_pn_config_t; -#endif - -/*! @brief FlexCAN Legacy Rx FIFO configuration structure. */ -typedef struct _flexcan_rx_fifo_config -{ - uint32_t *idFilterTable; /*!< Pointer to the FlexCAN Legacy Rx FIFO identifier filter table. */ - uint8_t idFilterNum; /*!< The FlexCAN Legacy Rx FIFO Filter elements quantity. */ - flexcan_rx_fifo_filter_type_t idFilterType; /*!< The FlexCAN Legacy Rx FIFO Filter type. */ - flexcan_rx_fifo_priority_t priority; /*!< The FlexCAN Legacy Rx FIFO receive priority. */ -} flexcan_rx_fifo_config_t; - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! @brief FlexCAN Enhanced Rx FIFO Standard ID filter element structure. */ -typedef struct _flexcan_enhanced_rx_fifo_std_id_filter -{ - uint32_t filterType : 2; /*!< FlexCAN internal Free-Running Counter Time Stamp. */ - uint32_t : 2; - uint32_t rtr1 : 1; /*!< CAN FD frame data length code (DLC), range see @ref _flexcan_fd_frame_length, When the - length <= 8, it equal to the data length, otherwise the number of valid frame data is - not equal to the length value. user can - use DLC_LENGTH_DECODE(length) macro to get the number of valid data bytes. */ - uint32_t std1 : 11; /*!< CAN Frame Type(DATA or REMOTE). */ - uint32_t : 4; - uint32_t rtr2 : 1; /*!< CAN Frame Identifier(STD or EXT format). */ - uint32_t std2 : 11; /*!< Substitute Remote request. */ -} flexcan_enhanced_rx_fifo_std_id_filter_t; - -/*! @brief FlexCAN Enhanced Rx FIFO Extended ID filter element structure. */ -typedef struct _flexcan_enhanced_rx_fifo_ext_id_filter -{ - uint32_t filterType : 2; /*!< FlexCAN internal Free-Running Counter Time Stamp. */ - uint32_t rtr1 : 1; /*!< CAN FD frame data length code (DLC), range see @ref _flexcan_fd_frame_length, When the - length <= 8, it equal to the data length, otherwise the number of valid frame data is - not equal to the length value. user can - use DLC_LENGTH_DECODE(length) macro to get the number of valid data bytes. */ - uint32_t std1 : 29; /*!< CAN Frame Type(DATA or REMOTE). */ - uint32_t : 2; - uint32_t rtr2 : 1; /*!< CAN Frame Identifier(STD or EXT format). */ - uint32_t std2 : 29; /*!< Substitute Remote request. */ -} flexcan_enhanced_rx_fifo_ext_id_filter_t; -/*! @brief FlexCAN Enhanced Rx FIFO configuration structure. */ -typedef struct _flexcan_enhanced_rx_fifo_config -{ - uint32_t *idFilterTable; /*!< Pointer to the FlexCAN Enhanced Rx FIFO identifier filter table, each table member - occupies 32 bit word, table size should be equal to idFilterNum. There are two types of - Enhanced Rx FIFO filter elements that can be stored in table : extended-ID filter element - (1 word, occupie 1 table members) and standard-ID filter element (2 words, occupies 2 table - members), the extended-ID filter element needs to be placed in front of the table. */ - uint8_t idFilterPairNum; /*!< idFilterPairNum is the Enhanced Rx FIFO identifier filter element pair numbers, - each pair of filter elements occupies 2 words and can consist of one extended ID filter - element or two standard ID filter elements. */ - uint8_t extendIdFilterNum; /*!< The number of extended ID filter element items in the FlexCAN enhanced Rx FIFO - identifier filter table, each extended-ID filter element occupies 2 words, - extendIdFilterNum need less than or equal to idFilterPairNum. */ - uint8_t fifoWatermark; /*!< (fifoWatermark + 1) is the minimum number of CAN messages stored in the Enhanced RX FIFO - which can trigger FIFO watermark interrupt or a DMA request. */ - flexcan_efifo_dma_per_read_length_t dmaPerReadLength; /*!< Define the length of each read of the Enhanced RX FIFO - element by the DAM, see @ref _flexcan_fd_frame_length. */ - flexcan_rx_fifo_priority_t priority; /*!< The FlexCAN Enhanced Rx FIFO receive priority. */ -} flexcan_enhanced_rx_fifo_config_t; -#endif - -/*! @brief FlexCAN Message Buffer transfer. */ -typedef struct _flexcan_mb_transfer -{ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - flexcan_fd_frame_t *framefd; -#endif - flexcan_frame_t *frame; /*!< The buffer of CAN Message to be transfer. */ - uint8_t mbIdx; /*!< The index of Message buffer used to transfer Message. */ -} flexcan_mb_transfer_t; - -/*! @brief FlexCAN Rx FIFO transfer. */ -typedef struct _flexcan_fifo_transfer -{ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - flexcan_fd_frame_t *framefd; /*!< The buffer of CAN Message to be received from Enhanced Rx FIFO. */ -#endif - flexcan_frame_t *frame; /*!< The buffer of CAN Message to be received from Legacy Rx FIFO. */ - size_t frameNum; /*!< Number of CAN Message need to be received from Legacy or Ehanced Rx FIFO. */ -} flexcan_fifo_transfer_t; - -/*! @brief FlexCAN handle structure definition. */ -typedef struct _flexcan_handle flexcan_handle_t; - -/*! @brief FlexCAN transfer callback function. - * - * The FlexCAN transfer callback returns a value from the underlying layer. - * If the status equals to kStatus_FLEXCAN_ErrorStatus, the result parameter is the Content of - * FlexCAN status register which can be used to get the working status(or error status) of FlexCAN module. - * If the status equals to other FlexCAN Message Buffer transfer status, the result is the index of - * Message Buffer that generate transfer event. - * If the status equals to other FlexCAN Message Buffer transfer status, the result is meaningless and should be - * Ignored. - */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -#define FLEXCAN_CALLBACK(x) \ - void(x)(CAN_Type * base, flexcan_handle_t * handle, status_t status, uint64_t result, void *userData) -typedef void (*flexcan_transfer_callback_t)( - CAN_Type *base, flexcan_handle_t *handle, status_t status, uint64_t result, void *userData); -#else -#define FLEXCAN_CALLBACK(x) \ - void(x)(CAN_Type * base, flexcan_handle_t * handle, status_t status, uint32_t result, void *userData) -typedef void (*flexcan_transfer_callback_t)( - CAN_Type *base, flexcan_handle_t *handle, status_t status, uint32_t result, void *userData); -#endif - -/*! @brief FlexCAN handle structure. */ -struct _flexcan_handle -{ - flexcan_transfer_callback_t callback; /*!< Callback function. */ - void *userData; /*!< FlexCAN callback function parameter.*/ - flexcan_frame_t - *volatile mbFrameBuf[CAN_WORD1_COUNT]; /*!< The buffer for received CAN data from Message Buffers. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - flexcan_fd_frame_t - *volatile mbFDFrameBuf[CAN_WORD1_COUNT]; /*!< The buffer for received CAN FD data from Message Buffers. */ -#endif - flexcan_frame_t *volatile rxFifoFrameBuf; /*!< The buffer for received CAN data from Legacy Rx FIFO. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - flexcan_fd_frame_t *volatile rxFifoFDFrameBuf; /*!< The buffer for received CAN FD data from Ehanced Rx FIFO. */ -#endif - size_t rxFifoFrameNum; /*!< The number of CAN messages remaining to be received from Legacy or Ehanced Rx FIFO. */ - size_t rxFifoTransferTotalNum; /*!< Total CAN Message number need to be received from Legacy or Ehanced Rx FIFO. */ - volatile uint8_t mbState[CAN_WORD1_COUNT]; /*!< Message Buffer transfer state. */ - volatile uint8_t rxFifoState; /*!< Rx FIFO transfer state. */ - volatile uint32_t timestamp[CAN_WORD1_COUNT]; /*!< Mailbox transfer timestamp. */ -}; - -/****************************************************************************** - * API - *****************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * @brief Determine whether the FlexCAN instance support CAN FD mode at run time. - * - * @note Use this API only if different soc parts share the SOC part name macro define. Otherwise, a different SOC part - * name can be used to determine at compile time whether the FlexCAN instance supports CAN FD mode or not. - * If need use this API to determine if CAN FD mode is supported, the FLEXCAN_Init function needs to be - * executed first, and then call this API and use the return to value determines whether to supports CAN FD mode, - * if return true, continue calling FLEXCAN_FDInit to enable CAN FD mode. - * - * @param base FlexCAN peripheral base address. - * @return return TRUE if instance support CAN FD mode, FALSE if instance only support classic CAN (2.0) mode. - */ -bool FLEXCAN_IsInstanceHasFDMode(CAN_Type *base); -#endif - -/*! - * @brief Enter FlexCAN Freeze Mode. - * - * This function makes the FlexCAN work under Freeze Mode. - * - * @param base FlexCAN peripheral base address. - */ -void FLEXCAN_EnterFreezeMode(CAN_Type *base); - -/*! - * @brief Exit FlexCAN Freeze Mode. - * - * This function makes the FlexCAN leave Freeze Mode. - * - * @param base FlexCAN peripheral base address. - */ -void FLEXCAN_ExitFreezeMode(CAN_Type *base); - -/*! - * @brief Get the FlexCAN instance from peripheral base address. - * - * @param base FlexCAN peripheral base address. - * @return FlexCAN instance. - */ -uint32_t FLEXCAN_GetInstance(CAN_Type *base); - -/*! - * @brief Calculates the improved timing values by specific bit Rates for classical CAN. - * - * This function use to calculates the Classical CAN timing values according to the given bit rate. The Calculated - * timing values will be set in CTRL1/CBT/ENCBT register. The calculation is based on the recommendation of the CiA 301 - * v4.2.0 and previous version document. - * - * @param base FlexCAN peripheral base address. - * @param bitRate The classical CAN speed in bps defined by user, should be less than or equal to 1Mbps. - * @param sourceClock_Hz The Source clock frequency in Hz. - * @param pTimingConfig Pointer to the FlexCAN timing configuration structure. - * - * @return TRUE if timing configuration found, FALSE if failed to find configuration. - */ -bool FLEXCAN_CalculateImprovedTimingValues(CAN_Type *base, - uint32_t bitRate, - uint32_t sourceClock_Hz, - flexcan_timing_config_t *pTimingConfig); - -/*! - * @brief Initializes a FlexCAN instance. - * - * This function initializes the FlexCAN module with user-defined settings. - * This example shows how to set up the flexcan_config_t parameters and how - * to call the FLEXCAN_Init function by passing in these parameters. - * @code - * flexcan_config_t flexcanConfig; - * flexcanConfig.clkSrc = kFLEXCAN_ClkSrc0; - * flexcanConfig.bitRate = 1000000U; - * flexcanConfig.maxMbNum = 16; - * flexcanConfig.enableLoopBack = false; - * flexcanConfig.enableSelfWakeup = false; - * flexcanConfig.enableIndividMask = false; - * flexcanConfig.enableDoze = false; - * flexcanConfig.disableSelfReception = false; - * flexcanConfig.enableListenOnlyMode = false; - * flexcanConfig.timingConfig = timingConfig; - * FLEXCAN_Init(CAN0, &flexcanConfig, 40000000UL); - * @endcode - * - * @param base FlexCAN peripheral base address. - * @param pConfig Pointer to the user-defined configuration structure. - * @param sourceClock_Hz FlexCAN Protocol Engine clock source frequency in Hz. - */ -void FLEXCAN_Init(CAN_Type *base, const flexcan_config_t *pConfig, uint32_t sourceClock_Hz); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * @brief Calculates the improved timing values by specific bit rates for CANFD. - * - * This function use to calculates the CANFD timing values according to the given nominal phase bit rate and data phase - * bit rate. The Calculated timing values will be set in CBT/ENCBT and FDCBT/EDCBT registers. The calculation is based - * on the recommendation of the CiA 1301 v1.0.0 document. - * - * @param base FlexCAN peripheral base address. - * @param bitRate The CANFD bus control speed in bps defined by user. - * @param bitRateFD The CAN FD data phase speed in bps defined by user. Equal to bitRate means disable bit rate - * switching. - * @param sourceClock_Hz The Source clock frequency in Hz. - * @param pTimingConfig Pointer to the FlexCAN timing configuration structure. - * - * @return TRUE if timing configuration found, FALSE if failed to find configuration - */ -bool FLEXCAN_FDCalculateImprovedTimingValues(CAN_Type *base, - uint32_t bitRate, - uint32_t bitRateFD, - uint32_t sourceClock_Hz, - flexcan_timing_config_t *pTimingConfig); -/*! - * @brief Initializes a FlexCAN instance. - * - * This function initializes the FlexCAN module with user-defined settings. - * This example shows how to set up the flexcan_config_t parameters and how - * to call the FLEXCAN_FDInit function by passing in these parameters. - * @code - * flexcan_config_t flexcanConfig; - * flexcanConfig.clkSrc = kFLEXCAN_ClkSrc0; - * flexcanConfig.bitRate = 1000000U; - * flexcanConfig.bitRateFD = 2000000U; - * flexcanConfig.maxMbNum = 16; - * flexcanConfig.enableLoopBack = false; - * flexcanConfig.enableSelfWakeup = false; - * flexcanConfig.enableIndividMask = false; - * flexcanConfig.disableSelfReception = false; - * flexcanConfig.enableListenOnlyMode = false; - * flexcanConfig.enableDoze = false; - * flexcanConfig.timingConfig = timingConfig; - * FLEXCAN_FDInit(CAN0, &flexcanConfig, 80000000UL, kFLEXCAN_16BperMB, true); - * @endcode - * - * @param base FlexCAN peripheral base address. - * @param pConfig Pointer to the user-defined configuration structure. - * @param sourceClock_Hz FlexCAN Protocol Engine clock source frequency in Hz. - * @param dataSize FlexCAN Message Buffer payload size. The actual transmitted or received CAN FD frame data size needs - * to be less than or equal to this value. - * @param brs True if bit rate switch is enabled in FD mode. - */ -void FLEXCAN_FDInit( - CAN_Type *base, const flexcan_config_t *pConfig, uint32_t sourceClock_Hz, flexcan_mb_size_t dataSize, bool brs); -#endif - -/*! - * @brief De-initializes a FlexCAN instance. - * - * This function disables the FlexCAN module clock and sets all register values - * to the reset value. - * - * @param base FlexCAN peripheral base address. - */ -void FLEXCAN_Deinit(CAN_Type *base); - -/*! - * @brief Gets the default configuration structure. - * - * This function initializes the FlexCAN configuration structure to default values. The default - * values are as follows. - * flexcanConfig->clkSrc = kFLEXCAN_ClkSrc0; - * flexcanConfig->bitRate = 1000000U; - * flexcanConfig->bitRateFD = 2000000U; - * flexcanConfig->maxMbNum = 16; - * flexcanConfig->enableLoopBack = false; - * flexcanConfig->enableSelfWakeup = false; - * flexcanConfig->enableIndividMask = false; - * flexcanConfig->disableSelfReception = false; - * flexcanConfig->enableListenOnlyMode = false; - * flexcanConfig->enableDoze = false; - * flexcanConfig->enableMemoryErrorControl = true; - * flexcanConfig->enableNonCorrectableErrorEnterFreeze = true; - * flexcanConfig.timingConfig = timingConfig; - * - * @param pConfig Pointer to the FlexCAN configuration structure. - */ -void FLEXCAN_GetDefaultConfig(flexcan_config_t *pConfig); - -/*! @} */ - -/*! - * @name Configuration. - * @{ - */ - -/*! - * @brief Sets the FlexCAN classical CAN protocol timing characteristic. - * - * This function gives user settings to classical CAN or CAN FD nominal phase timing characteristic. - * The function is for an experienced user. For less experienced users, call the FLEXCAN_SetBitRate() instead. - * - * @note Calling FLEXCAN_SetTimingConfig() overrides the bit rate set in FLEXCAN_Init() or FLEXCAN_SetBitRate(). - * - * @param base FlexCAN peripheral base address. - * @param pConfig Pointer to the timing configuration structure. - */ -void FLEXCAN_SetTimingConfig(CAN_Type *base, const flexcan_timing_config_t *pConfig); - -/*! - * @brief Set bit rate of FlexCAN classical CAN frame or CAN FD frame nominal phase. - * - * This function set the bit rate of classical CAN frame or CAN FD frame nominal phase base on - * FLEXCAN_CalculateImprovedTimingValues() API calculated timing values. - * - * @note Calling FLEXCAN_SetBitRate() overrides the bit rate set in FLEXCAN_Init(). - * - * @param base FlexCAN peripheral base address. - * @param sourceClock_Hz Source Clock in Hz. - * @param bitRate_Bps Bit rate in Bps. - * @return kStatus_Success - Set CAN baud rate (only Nominal phase) successfully. - */ -status_t FLEXCAN_SetBitRate(CAN_Type *base, uint32_t sourceClock_Hz, uint32_t bitRate_Bps); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * @brief Sets the FlexCAN CANFD data phase timing characteristic. - * - * This function gives user settings to CANFD data phase timing characteristic. - * The function is for an experienced user. For less experienced users, call the FLEXCAN_SetFDBitRate() - * to set both Nominal/Data bit Rate instead. - * - * @note Calling FLEXCAN_SetFDTimingConfig() overrides the data phase bit rate set in - * FLEXCAN_FDInit()/FLEXCAN_SetFDBitRate(). - * - * @param base FlexCAN peripheral base address. - * @param pConfig Pointer to the timing configuration structure. - */ -void FLEXCAN_SetFDTimingConfig(CAN_Type *base, const flexcan_timing_config_t *pConfig); - -/*! - * @brief Set bit rate of FlexCAN FD frame. - * - * This function set the baud rate of FLEXCAN FD base on FLEXCAN_FDCalculateImprovedTimingValues() API calculated timing - * values. - * - * @param base FlexCAN peripheral base address. - * @param sourceClock_Hz Source Clock in Hz. - * @param bitRateN_Bps Nominal bit Rate in Bps. - * @param bitRateD_Bps Data bit Rate in Bps. - * @return kStatus_Success - Set CAN FD bit rate (include Nominal and Data phase) successfully. - */ -status_t FLEXCAN_SetFDBitRate(CAN_Type *base, uint32_t sourceClock_Hz, uint32_t bitRateN_Bps, uint32_t bitRateD_Bps); -#endif - -/*! - * @brief Sets the FlexCAN receive message buffer global mask. - * - * This function sets the global mask for the FlexCAN message buffer in a matching process. - * The configuration is only effective when the Rx individual mask is disabled in the FLEXCAN_Init(). - * - * @param base FlexCAN peripheral base address. - * @param mask Rx Message Buffer Global Mask value. - */ -void FLEXCAN_SetRxMbGlobalMask(CAN_Type *base, uint32_t mask); - -/*! - * @brief Sets the FlexCAN receive FIFO global mask. - * - * This function sets the global mask for FlexCAN FIFO in a matching process. - * - * @param base FlexCAN peripheral base address. - * @param mask Rx Fifo Global Mask value. - */ -void FLEXCAN_SetRxFifoGlobalMask(CAN_Type *base, uint32_t mask); - -/*! - * @brief Sets the FlexCAN receive individual mask. - * - * This function sets the individual mask for the FlexCAN matching process. - * The configuration is only effective when the Rx individual mask is enabled in the FLEXCAN_Init(). - * If the Rx FIFO is disabled, the individual mask is applied to the corresponding Message Buffer. - * If the Rx FIFO is enabled, the individual mask for Rx FIFO occupied Message Buffer is applied to - * the Rx Filter with the same index. Note that only the first 32 - * individual masks can be used as the Rx FIFO filter mask. - * - * @param base FlexCAN peripheral base address. - * @param maskIdx The Index of individual Mask. - * @param mask Rx Individual Mask value. - */ -void FLEXCAN_SetRxIndividualMask(CAN_Type *base, uint8_t maskIdx, uint32_t mask); - -/*! - * @brief Configures a FlexCAN transmit message buffer. - * - * This function aborts the previous transmission, cleans the Message Buffer, and - * configures it as a Transmit Message Buffer. - * - * @param base FlexCAN peripheral base address. - * @param mbIdx The Message Buffer index. - * @param enable Enable/disable Tx Message Buffer. - * - true: Enable Tx Message Buffer. - * - false: Disable Tx Message Buffer. - */ -void FLEXCAN_SetTxMbConfig(CAN_Type *base, uint8_t mbIdx, bool enable); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * @brief Configures a FlexCAN transmit message buffer. - * - * This function aborts the previous transmission, cleans the Message Buffer, and - * configures it as a Transmit Message Buffer. - * - * @param base FlexCAN peripheral base address. - * @param mbIdx The Message Buffer index. - * @param enable Enable/disable Tx Message Buffer. - * - true: Enable Tx Message Buffer. - * - false: Disable Tx Message Buffer. - */ -void FLEXCAN_SetFDTxMbConfig(CAN_Type *base, uint8_t mbIdx, bool enable); -#endif - -/*! - * @brief Configures a FlexCAN Receive Message Buffer. - * - * This function cleans a FlexCAN build-in Message Buffer and configures it - * as a Receive Message Buffer. - * - * @param base FlexCAN peripheral base address. - * @param mbIdx The Message Buffer index. - * @param pRxMbConfig Pointer to the FlexCAN Message Buffer configuration structure. - * @param enable Enable/disable Rx Message Buffer. - * - true: Enable Rx Message Buffer. - * - false: Disable Rx Message Buffer. - */ -void FLEXCAN_SetRxMbConfig(CAN_Type *base, uint8_t mbIdx, const flexcan_rx_mb_config_t *pRxMbConfig, bool enable); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * @brief Configures a FlexCAN Receive Message Buffer. - * - * This function cleans a FlexCAN build-in Message Buffer and configures it - * as a Receive Message Buffer. - * - * @param base FlexCAN peripheral base address. - * @param mbIdx The Message Buffer index. - * @param pRxMbConfig Pointer to the FlexCAN Message Buffer configuration structure. - * @param enable Enable/disable Rx Message Buffer. - * - true: Enable Rx Message Buffer. - * - false: Disable Rx Message Buffer. - */ -void FLEXCAN_SetFDRxMbConfig(CAN_Type *base, uint8_t mbIdx, const flexcan_rx_mb_config_t *pRxMbConfig, bool enable); -#endif - -/*! - * @brief Configures the FlexCAN Legacy Rx FIFO. - * - * This function configures the FlexCAN Rx FIFO with given configuration. - * @note Legacy Rx FIFO only can receive classic CAN message. - * - * @param base FlexCAN peripheral base address. - * @param pRxFifoConfig Pointer to the FlexCAN Legacy Rx FIFO configuration structure. Can be NULL when enable parameter - * is false. - * @param enable Enable/disable Legacy Rx FIFO. - * - true: Enable Legacy Rx FIFO. - * - false: Disable Legacy Rx FIFO. - */ -void FLEXCAN_SetRxFifoConfig(CAN_Type *base, const flexcan_rx_fifo_config_t *pRxFifoConfig, bool enable); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * @brief Configures the FlexCAN Enhanced Rx FIFO. - * - * This function configures the Enhanced Rx FIFO with given configuration. - * @note Enhanced Rx FIFO support receive classic CAN or CAN FD messages, Legacy Rx FIFO and Enhanced Rx FIFO - * cannot be enabled at the same time. - * - * @param base FlexCAN peripheral base address. - * @param pConfig Pointer to the FlexCAN Enhanced Rx FIFO configuration structure. Can be NULL when enable parameter - * is false. - * @param enable Enable/disable Enhanced Rx FIFO. - * - true: Enable Enhanced Rx FIFO. - * - false: Disable Enhanced Rx FIFO. - */ -void FLEXCAN_SetEnhancedRxFifoConfig(CAN_Type *base, const flexcan_enhanced_rx_fifo_config_t *pConfig, bool enable); -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) -/*! - * @brief Configures the FlexCAN Pretended Networking mode. - * - * This function configures the FlexCAN Pretended Networking mode with given configuration. - * - * @param base FlexCAN peripheral base address. - * @param pConfig Pointer to the FlexCAN Rx FIFO configuration structure. - */ -void FLEXCAN_SetPNConfig(CAN_Type *base, const flexcan_pn_config_t *pConfig); -#endif -/*! @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets the FlexCAN module interrupt flags. - * - * This function gets all FlexCAN status flags. The flags are returned as the logical - * OR value of the enumerators @ref _flexcan_flags. To check the specific status, - * compare the return value with enumerators in @ref _flexcan_flags. - * - * @param base FlexCAN peripheral base address. - * @return FlexCAN status flags which are ORed by the enumerators in the _flexcan_flags. - */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -static inline uint64_t FLEXCAN_GetStatusFlags(CAN_Type *base) -{ - uint64_t tempflag = (uint64_t)base->ESR1; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - /* Get PN Wake Up status. */ - tempflag |= FLEXCAN_PN_STATUS_MASK(base->WU_MTC); -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - /* Get Enhanced Rx FIFO status. */ - tempflag |= FLEXCAN_EFIFO_STATUS_MASK(base->ERFSR); -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - /* Get Memory Error status. */ - tempflag |= FLEXCAN_MECR_STATUS_MASK(base->ERRSR); -#endif - return tempflag; -} -#else -static inline uint32_t FLEXCAN_GetStatusFlags(CAN_Type *base) -{ - return base->ESR1; -} -#endif -/*! - * @brief Clears status flags with the provided mask. - * - * This function clears the FlexCAN status flags with a provided mask. An automatically cleared flag - * can't be cleared by this function. - * - * @param base FlexCAN peripheral base address. - * @param mask The status flags to be cleared, it is logical OR value of @ref _flexcan_flags. - */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -static inline void FLEXCAN_ClearStatusFlags(CAN_Type *base, uint64_t mask) -{ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - /* Clear PN Wake Up status. */ - base->WU_MTC = FLEXCAN_PN_STATUS_UNMASK(mask); -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - /* Clear Enhanced Rx FIFO status. */ - base->ERFSR = FLEXCAN_EFIFO_STATUS_UNMASK(mask); -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - /* Clear Memory Error status. */ - base->ERRSR = FLEXCAN_MECR_STATUS_UNMASK(mask); -#endif - base->ESR1 = (uint32_t)(mask & 0xFFFFFFFFU); -} -#else -static inline void FLEXCAN_ClearStatusFlags(CAN_Type *base, uint32_t mask) -{ - /* Write 1 to clear status flag. */ - base->ESR1 = mask; -} -#endif -/*! - * @brief Gets the FlexCAN Bus Error Counter value. - * - * This function gets the FlexCAN Bus Error Counter value for both Tx and - * Rx direction. These values may be needed in the upper layer error handling. - * - * @param base FlexCAN peripheral base address. - * @param txErrBuf Buffer to store Tx Error Counter value. - * @param rxErrBuf Buffer to store Rx Error Counter value. - */ -static inline void FLEXCAN_GetBusErrCount(CAN_Type *base, uint8_t *txErrBuf, uint8_t *rxErrBuf) -{ - if (NULL != txErrBuf) - { - *txErrBuf = (uint8_t)((base->ECR & CAN_ECR_TXERRCNT_MASK) >> CAN_ECR_TXERRCNT_SHIFT); - } - - if (NULL != rxErrBuf) - { - *rxErrBuf = (uint8_t)((base->ECR & CAN_ECR_RXERRCNT_MASK) >> CAN_ECR_RXERRCNT_SHIFT); - } -} - -/*! - * @brief Gets the FlexCAN Message Buffer interrupt flags. - * - * This function gets the interrupt flags of a given Message Buffers. - * - * @param base FlexCAN peripheral base address. - * @param mask The ORed FlexCAN Message Buffer mask. - * @return The status of given Message Buffers. - */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) -static inline uint64_t FLEXCAN_GetMbStatusFlags(CAN_Type *base, uint64_t mask) -#else -static inline uint32_t FLEXCAN_GetMbStatusFlags(CAN_Type *base, uint32_t mask) -#endif -{ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - uint64_t tempflag = (uint64_t)base->IFLAG1; - return (tempflag | (((uint64_t)base->IFLAG2) << 32)) & mask; -#else - return (base->IFLAG1 & mask); -#endif -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) -/*! - * @brief Gets the FlexCAN High 64 Message Buffer interrupt flags. - * - * Valid only if the number of available MBs exceeds 64. - * - * @param base FlexCAN peripheral base address. - * @param mask The ORed FlexCAN Message Buffer mask. - * @return The status of given Message Buffers. - */ -static inline uint64_t FLEXCAN_GetHigh64MbStatusFlags(CAN_Type *base, uint64_t mask) -{ - uint64_t tempflag = 0U; -#if defined(CAN_IFLAG3_BUF95TO64_MASK) - tempflag |= (uint64_t)base->IFLAG3; -#endif -#if defined(CAN_IFLAG4_BUF127TO96_MASK) - tempflag |= (uint64_t)base->IFLAG4; -#endif - return (tempflag & mask); -} -#endif - -/*! - * @brief Clears the FlexCAN Message Buffer interrupt flags. - * - * This function clears the interrupt flags of a given Message Buffers. - * - * @param base FlexCAN peripheral base address. - * @param mask The ORed FlexCAN Message Buffer mask. - */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) -static inline void FLEXCAN_ClearMbStatusFlags(CAN_Type *base, uint64_t mask) -#else -static inline void FLEXCAN_ClearMbStatusFlags(CAN_Type *base, uint32_t mask) -#endif -{ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - base->IFLAG1 = (uint32_t)(mask & 0xFFFFFFFFU); - base->IFLAG2 = (uint32_t)(mask >> 32); -#else - base->IFLAG1 = mask; -#endif -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) -/*! - * @brief Clears the FlexCAN High 64 Message Buffer interrupt flags. - * - * Valid only if the number of available MBs exceeds 64. - * - * @param base FlexCAN peripheral base address. - * @param mask The ORed FlexCAN Message Buffer mask. - */ -static inline void FLEXCAN_ClearHigh64MbStatusFlags(CAN_Type *base, uint64_t mask) -{ -#if defined(CAN_IFLAG3_BUF95TO64_MASK) - base->IFLAG3 = (uint32_t)(mask & 0xFFFFFFFFU); -#endif -#if defined(CAN_IFLAG4_BUF127TO96_MASK) - base->IFLAG4 = (uint32_t)(mask >> 32U); -#endif -} -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -/*! - * @brief Gets the FlexCAN Memory Error Report registers status. - * - * This function gets the FlexCAN Memory Error Report registers status. - * - * @param base FlexCAN peripheral base address. - * @param errorStatus Pointer to FlexCAN Memory Error Report registers status structure. - */ -void FLEXCAN_GetMemoryErrorReportStatus(CAN_Type *base, flexcan_memory_error_report_status_t *errorStatus); -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) -/*! - * @brief Gets the FlexCAN Number of Matches when in Pretended Networking. - * - * This function gets the number of times a given message has matched the predefined filtering criteria for ID and/or PL - * before a wakeup event. - * - * @param base FlexCAN peripheral base address. - * @return The number of received wake up msessages. - */ -static inline uint8_t FLEXCAN_GetPNMatchCount(CAN_Type *base) -{ - return (uint8_t)((base->WU_MTC & CAN_WU_MTC_MCOUNTER_MASK) >> CAN_WU_MTC_MCOUNTER_SHIFT); -} -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * @brief Gets the number of FlexCAN Enhanced Rx FIFO available frames. - * - * This function gets the number of CAN messages stored in the Enhanced Rx FIFO. - * - * @param base FlexCAN peripheral base address. - * @return The number of available CAN messages stored in the Enhanced Rx FIFO. - */ -static inline uint32_t FLEXCAN_GetEnhancedFifoDataCount(CAN_Type *base) -{ - return (base->ERFSR & CAN_ERFSR_ERFEL_MASK); -} -#endif -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables FlexCAN interrupts according to the provided mask. - * - * This function enables the FlexCAN interrupts according to the provided mask. The mask - * is a logical OR of enumeration members, see @ref _flexcan_interrupt_enable. - * - * @param base FlexCAN peripheral base address. - * @param mask The interrupts to enable. Logical OR of @ref _flexcan_interrupt_enable. - */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -static inline void FLEXCAN_EnableInterrupts(CAN_Type *base, uint64_t mask) -#else -static inline void FLEXCAN_EnableInterrupts(CAN_Type *base, uint32_t mask) -#endif -{ - uint32_t primask = DisableGlobalIRQ(); - - /* Solve Self Wake Up interrupt. */ - base->MCR |= (uint32_t)(mask & (uint32_t)kFLEXCAN_WakeUpInterruptEnable); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0 != FSL_FEATURE_FLEXCAN_INSTANCE_HAS_FLEXIBLE_DATA_RATEn(base)) - { - /* Solve CAN FD frames data phase error interrupt. */ - base->CTRL2 |= (uint32_t)(mask & (uint32_t)kFLEXCAN_FDErrorInterruptEnable); - } -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - /* Solve PN Wake Up interrupt. */ - base->CTRL1_PN |= FLEXCAN_PN_INT_UNMASK(mask); -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - /* Solve Enhanced Rx FIFO interrupt. */ - base->ERFIER |= FLEXCAN_EFIFO_INT_UNMASK(mask); -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - /* Solve Memory Error interrupt. */ - base->MECR |= FLEXCAN_MECR_INT_UNMASK(mask); -#endif - - /* Solve interrupt enable bits in CTRL1 register. */ - base->CTRL1 |= - (uint32_t)(mask & ((uint32_t)kFLEXCAN_BusOffInterruptEnable | (uint32_t)kFLEXCAN_ErrorInterruptEnable | - (uint32_t)kFLEXCAN_RxWarningInterruptEnable | (uint32_t)kFLEXCAN_TxWarningInterruptEnable)); - - EnableGlobalIRQ(primask); -} - -/*! - * @brief Disables FlexCAN interrupts according to the provided mask. - * - * This function disables the FlexCAN interrupts according to the provided mask. The mask - * is a logical OR of enumeration members, see @ref _flexcan_interrupt_enable. - * - * @param base FlexCAN peripheral base address. - * @param mask The interrupts to disable. Logical OR of @ref _flexcan_interrupt_enable. - */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -static inline void FLEXCAN_DisableInterrupts(CAN_Type *base, uint64_t mask) -#else -static inline void FLEXCAN_DisableInterrupts(CAN_Type *base, uint32_t mask) -#endif -{ - uint32_t primask = DisableGlobalIRQ(); - - /* Solve Wake Up Interrupt. */ - base->MCR &= ~(uint32_t)(mask & (uint32_t)kFLEXCAN_WakeUpInterruptEnable); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0 != FSL_FEATURE_FLEXCAN_INSTANCE_HAS_FLEXIBLE_DATA_RATEn(base)) - { - /* Solve CAN FD frames data phase error interrupt. */ - base->CTRL2 &= ~(uint32_t)(mask & (uint32_t)kFLEXCAN_FDErrorInterruptEnable); - } -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - /* Solve PN Wake Up Interrupt. */ - base->CTRL1_PN &= ~FLEXCAN_PN_STATUS_UNMASK(mask); -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - /* Solve Enhanced Rx FIFO interrupt. */ - base->ERFIER &= ~FLEXCAN_EFIFO_INT_UNMASK(mask); -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - /* Solve Memory Error Interrupt. */ - base->MECR &= ~FLEXCAN_MECR_STATUS_UNMASK(mask); -#endif - - /* Solve interrupt enable bits in CTRL1 register. */ - base->CTRL1 &= - ~(uint32_t)(mask & ((uint32_t)kFLEXCAN_BusOffInterruptEnable | (uint32_t)kFLEXCAN_ErrorInterruptEnable | - (uint32_t)kFLEXCAN_RxWarningInterruptEnable | (uint32_t)kFLEXCAN_TxWarningInterruptEnable)); - - EnableGlobalIRQ(primask); -} - -/*! - * @brief Enables FlexCAN Message Buffer interrupts. - * - * This function enables the interrupts of given Message Buffers. - * - * @param base FlexCAN peripheral base address. - * @param mask The ORed FlexCAN Message Buffer mask. - */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) -static inline void FLEXCAN_EnableMbInterrupts(CAN_Type *base, uint64_t mask) -#else -static inline void FLEXCAN_EnableMbInterrupts(CAN_Type *base, uint32_t mask) -#endif -{ - uint32_t primask = DisableGlobalIRQ(); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - base->IMASK1 |= (uint32_t)(mask & 0xFFFFFFFFU); - base->IMASK2 |= (uint32_t)(mask >> 32); -#else - base->IMASK1 |= mask; -#endif - EnableGlobalIRQ(primask); -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) -/*! - * @brief Enables FlexCAN high 64 Message Buffer interrupts. - * - * Valid only if the number of available MBs exceeds 64. - * - * @param base FlexCAN peripheral base address. - * @param mask The ORed FlexCAN Message Buffer mask. - */ -static inline void FLEXCAN_EnableHigh64MbInterrupts(CAN_Type *base, uint64_t mask) -{ - uint32_t primask = DisableGlobalIRQ(); - -#if defined(CAN_IMASK3_BUF95TO64M_MASK) - base->IMASK3 |= (uint32_t)(mask & 0xFFFFFFFFU); -#endif -#if defined(CAN_IMASK4_BUF127TO96_MASK) - base->IMASK4 |= (uint32_t)(mask >> 32U); -#endif - EnableGlobalIRQ(primask); -} -#endif - -/*! - * @brief Disables FlexCAN Message Buffer interrupts. - * - * This function disables the interrupts of given Message Buffers. - * - * @param base FlexCAN peripheral base address. - * @param mask The ORed FlexCAN Message Buffer mask. - */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) -static inline void FLEXCAN_DisableMbInterrupts(CAN_Type *base, uint64_t mask) -#else -static inline void FLEXCAN_DisableMbInterrupts(CAN_Type *base, uint32_t mask) -#endif -{ - uint32_t primask = DisableGlobalIRQ(); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - base->IMASK1 &= ~((uint32_t)(mask & 0xFFFFFFFFU)); - base->IMASK2 &= ~((uint32_t)(mask >> 32)); -#else - base->IMASK1 &= ~mask; -#endif - EnableGlobalIRQ(primask); -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) -/*! - * @brief Disables FlexCAN high 64 Message Buffer interrupts. - * - * Valid only if the number of available MBs exceeds 64. - * - * @param base FlexCAN peripheral base address. - * @param mask The ORed FlexCAN Message Buffer mask. - */ -static inline void FLEXCAN_DisableHigh64MbInterrupts(CAN_Type *base, uint64_t mask) -{ - uint32_t primask = DisableGlobalIRQ(); - -#if defined(CAN_IMASK3_BUF95TO64M_MASK) - base->IMASK3 &= ~((uint32_t)(mask & 0xFFFFFFFFU)); -#endif -#if defined(CAN_IMASK4_BUF127TO96_MASK) - base->IMASK4 &= ~((uint32_t)(mask >> 32U)); -#endif - EnableGlobalIRQ(primask); -} -#endif - -/*! @} */ - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_RX_FIFO_DMA) && FSL_FEATURE_FLEXCAN_HAS_RX_FIFO_DMA) -/*! - * @name DMA Control - * @{ - */ - -/*! - * @brief Enables or disables the FlexCAN Rx FIFO DMA request. - * - * This function enables or disables the DMA feature of FlexCAN build-in Rx FIFO. - * - * @param base FlexCAN peripheral base address. - * @param enable true to enable, false to disable. - */ -void FLEXCAN_EnableRxFifoDMA(CAN_Type *base, bool enable); - -/*! - * @brief Gets the Rx FIFO Head address. - * - * This function returns the FlexCAN Rx FIFO Head address, which is mainly used for the DMA/eDMA use case. - * - * @param base FlexCAN peripheral base address. - * @return FlexCAN Rx FIFO Head address. - */ -static inline uintptr_t FLEXCAN_GetRxFifoHeadAddr(CAN_Type *base) -{ - return (uintptr_t) & (base->MB[0].CS); -} - -/*! @} */ -#endif /* FSL_FEATURE_FLEXCAN_HAS_RX_FIFO_DMA */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Enables or disables the FlexCAN module operation. - * - * This function enables or disables the FlexCAN module. - * - * @param base FlexCAN base pointer. - * @param enable true to enable, false to disable. - */ -static inline void FLEXCAN_Enable(CAN_Type *base, bool enable) -{ - if (enable) - { - base->MCR &= ~CAN_MCR_MDIS_MASK; - - /* Wait FlexCAN exit from low-power mode. */ - while (0U != (base->MCR & CAN_MCR_LPMACK_MASK)) - { - } - } - else - { - base->MCR |= CAN_MCR_MDIS_MASK; - - /* Wait FlexCAN enter low-power mode. */ - while (0U == (base->MCR & CAN_MCR_LPMACK_MASK)) - { - } - } -} - -/*! - * @brief Writes a FlexCAN Message to the Transmit Message Buffer. - * - * This function writes a CAN Message to the specified Transmit Message Buffer - * and changes the Message Buffer state to start CAN Message transmit. After - * that the function returns immediately. - * - * @param base FlexCAN peripheral base address. - * @param mbIdx The FlexCAN Message Buffer index. - * @param pTxFrame Pointer to CAN message frame to be sent. - * @retval kStatus_Success - Write Tx Message Buffer Successfully. - * @retval kStatus_Fail - Tx Message Buffer is currently in use. - */ -status_t FLEXCAN_WriteTxMb(CAN_Type *base, uint8_t mbIdx, const flexcan_frame_t *pTxFrame); - -/*! - * @brief Reads a FlexCAN Message from Receive Message Buffer. - * - * This function reads a CAN message from a specified Receive Message Buffer. - * The function fills a receive CAN message frame structure with - * just received data and activates the Message Buffer again. - * The function returns immediately. - * - * @param base FlexCAN peripheral base address. - * @param mbIdx The FlexCAN Message Buffer index. - * @param pRxFrame Pointer to CAN message frame structure for reception. - * @retval kStatus_Success - Rx Message Buffer is full and has been read successfully. - * @retval kStatus_FLEXCAN_RxOverflow - Rx Message Buffer is already overflowed and has been read successfully. - * @retval kStatus_Fail - Rx Message Buffer is empty. - */ -status_t FLEXCAN_ReadRxMb(CAN_Type *base, uint8_t mbIdx, flexcan_frame_t *pRxFrame); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * @brief Writes a FlexCAN FD Message to the Transmit Message Buffer. - * - * This function writes a CAN FD Message to the specified Transmit Message Buffer - * and changes the Message Buffer state to start CAN FD Message transmit. After - * that the function returns immediately. - * - * @param base FlexCAN peripheral base address. - * @param mbIdx The FlexCAN FD Message Buffer index. - * @param pTxFrame Pointer to CAN FD message frame to be sent. - * @retval kStatus_Success - Write Tx Message Buffer Successfully. - * @retval kStatus_Fail - Tx Message Buffer is currently in use. - */ -status_t FLEXCAN_WriteFDTxMb(CAN_Type *base, uint8_t mbIdx, const flexcan_fd_frame_t *pTxFrame); - -/*! - * @brief Reads a FlexCAN FD Message from Receive Message Buffer. - * - * This function reads a CAN FD message from a specified Receive Message Buffer. - * The function fills a receive CAN FD message frame structure with - * just received data and activates the Message Buffer again. - * The function returns immediately. - * - * @param base FlexCAN peripheral base address. - * @param mbIdx The FlexCAN FD Message Buffer index. - * @param pRxFrame Pointer to CAN FD message frame structure for reception. - * @retval kStatus_Success - Rx Message Buffer is full and has been read successfully. - * @retval kStatus_FLEXCAN_RxOverflow - Rx Message Buffer is already overflowed and has been read successfully. - * @retval kStatus_Fail - Rx Message Buffer is empty. - */ -status_t FLEXCAN_ReadFDRxMb(CAN_Type *base, uint8_t mbIdx, flexcan_fd_frame_t *pRxFrame); -#endif - -/*! - * @brief Reads a FlexCAN Message from Legacy Rx FIFO. - * - * This function reads a CAN message from the FlexCAN Legacy Rx FIFO. - * - * @param base FlexCAN peripheral base address. - * @param pRxFrame Pointer to CAN message frame structure for reception. - * @retval kStatus_Success - Read Message from Rx FIFO successfully. - * @retval kStatus_Fail - Rx FIFO is not enabled. - */ -status_t FLEXCAN_ReadRxFifo(CAN_Type *base, flexcan_frame_t *pRxFrame); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * @brief Reads a FlexCAN Message from Enhanced Rx FIFO. - * - * This function reads a CAN or CAN FD message from the FlexCAN Enhanced Rx FIFO. - * - * @param base FlexCAN peripheral base address. - * @param pRxFrame Pointer to CAN FD message frame structure for reception. - * @retval kStatus_Success - Read Message from Rx FIFO successfully. - * @retval kStatus_Fail - Rx FIFO is not enabled. - */ -status_t FLEXCAN_ReadEnhancedRxFifo(CAN_Type *base, flexcan_fd_frame_t *pRxFrame); -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) -/*! - * @brief Reads a FlexCAN Message from Wake Up MB. - * - * This function reads a CAN message from the FlexCAN Wake up Message Buffers. There are four Wake up Message Buffers - * (WMBs) used to store incoming messages in Pretended Networking mode. The WMB index indicates the arrival order. The - * last message is stored in WMB3. - * - * @param base FlexCAN peripheral base address. - * @param pRxFrame Pointer to CAN message frame structure for reception. - * @param mbIdx The FlexCAN Wake up Message Buffer index. Range in 0x0 ~ 0x3. - * @retval kStatus_Success - Read Message from Wake up Message Buffer successfully. - * @retval kStatus_Fail - Wake up Message Buffer has no valid content. - */ -status_t FLEXCAN_ReadPNWakeUpMB(CAN_Type *base, uint8_t mbIdx, flexcan_frame_t *pRxFrame); -#endif -/*! @} */ - -/*! - * @name Transactional - * @{ - */ - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * @brief Performs a polling send transaction on the CAN bus. - * - * @note A transfer handle does not need to be created before calling this API. - * - * @param base FlexCAN peripheral base pointer. - * @param mbIdx The FlexCAN FD Message Buffer index. - * @param pTxFrame Pointer to CAN FD message frame to be sent. - * @retval kStatus_Success - Write Tx Message Buffer Successfully. - * @retval kStatus_Fail - Tx Message Buffer is currently in use. - */ -status_t FLEXCAN_TransferFDSendBlocking(CAN_Type *base, uint8_t mbIdx, flexcan_fd_frame_t *pTxFrame); - -/*! - * @brief Performs a polling receive transaction on the CAN bus. - * - * @note A transfer handle does not need to be created before calling this API. - * - * @param base FlexCAN peripheral base pointer. - * @param mbIdx The FlexCAN FD Message Buffer index. - * @param pRxFrame Pointer to CAN FD message frame structure for reception. - * @retval kStatus_Success - Rx Message Buffer is full and has been read successfully. - * @retval kStatus_FLEXCAN_RxOverflow - Rx Message Buffer is already overflowed and has been read successfully. - * @retval kStatus_Fail - Rx Message Buffer is empty. - */ -status_t FLEXCAN_TransferFDReceiveBlocking(CAN_Type *base, uint8_t mbIdx, flexcan_fd_frame_t *pRxFrame); - -/*! - * @brief Sends a message using IRQ. - * - * This function sends a message using IRQ. This is a non-blocking function, which returns - * right away. When messages have been sent out, the send callback function is called. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param pMbXfer FlexCAN FD Message Buffer transfer structure. See the #flexcan_mb_transfer_t. - * @retval kStatus_Success Start Tx Message Buffer sending process successfully. - * @retval kStatus_Fail Write Tx Message Buffer failed. - * @retval kStatus_FLEXCAN_TxBusy Tx Message Buffer is in use. - */ -status_t FLEXCAN_TransferFDSendNonBlocking(CAN_Type *base, flexcan_handle_t *handle, flexcan_mb_transfer_t *pMbXfer); - -/*! - * @brief Receives a message using IRQ. - * - * This function receives a message using IRQ. This is non-blocking function, which returns - * right away. When the message has been received, the receive callback function is called. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param pMbXfer FlexCAN FD Message Buffer transfer structure. See the #flexcan_mb_transfer_t. - * @retval kStatus_Success - Start Rx Message Buffer receiving process successfully. - * @retval kStatus_FLEXCAN_RxBusy - Rx Message Buffer is in use. - */ -status_t FLEXCAN_TransferFDReceiveNonBlocking(CAN_Type *base, flexcan_handle_t *handle, flexcan_mb_transfer_t *pMbXfer); - -/*! - * @brief Aborts the interrupt driven message send process. - * - * This function aborts the interrupt driven message send process. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param mbIdx The FlexCAN FD Message Buffer index. - */ -void FLEXCAN_TransferFDAbortSend(CAN_Type *base, flexcan_handle_t *handle, uint8_t mbIdx); - -/*! - * @brief Aborts the interrupt driven message receive process. - * - * This function aborts the interrupt driven message receive process. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param mbIdx The FlexCAN FD Message Buffer index. - */ -void FLEXCAN_TransferFDAbortReceive(CAN_Type *base, flexcan_handle_t *handle, uint8_t mbIdx); -#endif - -/*! - * @brief Performs a polling send transaction on the CAN bus. - * - * @note A transfer handle does not need to be created before calling this API. - * - * @param base FlexCAN peripheral base pointer. - * @param mbIdx The FlexCAN Message Buffer index. - * @param pTxFrame Pointer to CAN message frame to be sent. - * @retval kStatus_Success - Write Tx Message Buffer Successfully. - * @retval kStatus_Fail - Tx Message Buffer is currently in use. - */ -status_t FLEXCAN_TransferSendBlocking(CAN_Type *base, uint8_t mbIdx, flexcan_frame_t *pTxFrame); - -/*! - * @brief Performs a polling receive transaction on the CAN bus. - * - * @note A transfer handle does not need to be created before calling this API. - * - * @param base FlexCAN peripheral base pointer. - * @param mbIdx The FlexCAN Message Buffer index. - * @param pRxFrame Pointer to CAN message frame structure for reception. - * @retval kStatus_Success - Rx Message Buffer is full and has been read successfully. - * @retval kStatus_FLEXCAN_RxOverflow - Rx Message Buffer is already overflowed and has been read successfully. - * @retval kStatus_Fail - Rx Message Buffer is empty. - */ -status_t FLEXCAN_TransferReceiveBlocking(CAN_Type *base, uint8_t mbIdx, flexcan_frame_t *pRxFrame); - -/*! - * @brief Performs a polling receive transaction from Legacy Rx FIFO on the CAN bus. - * - * @note A transfer handle does not need to be created before calling this API. - * - * @param base FlexCAN peripheral base pointer. - * @param pRxFrame Pointer to CAN message frame structure for reception. - * @retval kStatus_Success - Read Message from Rx FIFO successfully. - * @retval kStatus_Fail - Rx FIFO is not enabled. - */ -status_t FLEXCAN_TransferReceiveFifoBlocking(CAN_Type *base, flexcan_frame_t *pRxFrame); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * @brief Performs a polling receive transaction from Enhanced Rx FIFO on the CAN bus. - * - * @note A transfer handle does not need to be created before calling this API. - * - * @param base FlexCAN peripheral base pointer. - * @param pRxFrame Pointer to CAN FD message frame structure for reception. - * @retval kStatus_Success - Read Message from Rx FIFO successfully. - * @retval kStatus_Fail - Rx FIFO is not enabled. - */ -status_t FLEXCAN_TransferReceiveEnhancedFifoBlocking(CAN_Type *base, flexcan_fd_frame_t *pRxFrame); -#endif - -/*! - * @brief Initializes the FlexCAN handle. - * - * This function initializes the FlexCAN handle, which can be used for other FlexCAN - * transactional APIs. Usually, for a specified FlexCAN instance, - * call this API once to get the initialized handle. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param callback The callback function. - * @param userData The parameter of the callback function. - */ -void FLEXCAN_TransferCreateHandle(CAN_Type *base, - flexcan_handle_t *handle, - flexcan_transfer_callback_t callback, - void *userData); - -/*! - * @brief Sends a message using IRQ. - * - * This function sends a message using IRQ. This is a non-blocking function, which returns - * right away. When messages have been sent out, the send callback function is called. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param pMbXfer FlexCAN Message Buffer transfer structure. See the #flexcan_mb_transfer_t. - * @retval kStatus_Success Start Tx Message Buffer sending process successfully. - * @retval kStatus_Fail Write Tx Message Buffer failed. - * @retval kStatus_FLEXCAN_TxBusy Tx Message Buffer is in use. - */ -status_t FLEXCAN_TransferSendNonBlocking(CAN_Type *base, flexcan_handle_t *handle, flexcan_mb_transfer_t *pMbXfer); - -/*! - * @brief Receives a message using IRQ. - * - * This function receives a message using IRQ. This is non-blocking function, which returns - * right away. When the message has been received, the receive callback function is called. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param pMbXfer FlexCAN Message Buffer transfer structure. See the #flexcan_mb_transfer_t. - * @retval kStatus_Success - Start Rx Message Buffer receiving process successfully. - * @retval kStatus_FLEXCAN_RxBusy - Rx Message Buffer is in use. - */ -status_t FLEXCAN_TransferReceiveNonBlocking(CAN_Type *base, flexcan_handle_t *handle, flexcan_mb_transfer_t *pMbXfer); - -/*! - * @brief Receives a message from Rx FIFO using IRQ. - * - * This function receives a message using IRQ. This is a non-blocking function, which returns - * right away. When all messages have been received, the receive callback function is called. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param pFifoXfer FlexCAN Rx FIFO transfer structure. See the @ref flexcan_fifo_transfer_t. - * @retval kStatus_Success - Start Rx FIFO receiving process successfully. - * @retval kStatus_FLEXCAN_RxFifoBusy - Rx FIFO is currently in use. - */ -status_t FLEXCAN_TransferReceiveFifoNonBlocking(CAN_Type *base, - flexcan_handle_t *handle, - flexcan_fifo_transfer_t *pFifoXfer); - -/*! - * @brief Gets the Legacy Rx Fifo transfer status during a interrupt non-blocking receive. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param count Number of CAN messages receive so far by the non-blocking transaction. - * @retval kStatus_InvalidArgument count is Invalid. - * @retval kStatus_Success Successfully return the count. - */ - -status_t FLEXCAN_TransferGetReceiveFifoCount(CAN_Type *base, flexcan_handle_t *handle, size_t *count); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * @brief Receives a message from Enhanced Rx FIFO using IRQ. - * - * This function receives a message using IRQ. This is a non-blocking function, which returns - * right away. When all messages have been received, the receive callback function is called. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param pFifoXfer FlexCAN Rx FIFO transfer structure. See the ref flexcan_fifo_transfer_t.@ - * @retval kStatus_Success - Start Rx FIFO receiving process successfully. - * @retval kStatus_FLEXCAN_RxFifoBusy - Rx FIFO is currently in use. - */ -status_t FLEXCAN_TransferReceiveEnhancedFifoNonBlocking(CAN_Type *base, - flexcan_handle_t *handle, - flexcan_fifo_transfer_t *pFifoXfer); - -/*! - * @brief Gets the Enhanced Rx Fifo transfer status during a interrupt non-blocking receive. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param count Number of CAN messages receive so far by the non-blocking transaction. - * @retval kStatus_InvalidArgument count is Invalid. - * @retval kStatus_Success Successfully return the count. - */ - -static inline status_t FLEXCAN_TransferGetReceiveEnhancedFifoCount(CAN_Type *base, - flexcan_handle_t *handle, - size_t *count) -{ - return FLEXCAN_TransferGetReceiveFifoCount(base, handle, count); -} -#endif - -/*! - * @brief Gets the detail index of Mailbox's Timestamp by handle. - * - * Then function can only be used when calling non-blocking Data transfer (TX/RX) API, - * After TX/RX data transfer done (User can get the status by handler's callback function), - * we can get the detail index of Mailbox's timestamp by handle, - * Detail non-blocking data transfer API (TX/RX) contain. - * -FLEXCAN_TransferSendNonBlocking - * -FLEXCAN_TransferFDSendNonBlocking - * -FLEXCAN_TransferReceiveNonBlocking - * -FLEXCAN_TransferFDReceiveNonBlocking - * -FLEXCAN_TransferReceiveFifoNonBlocking - * - * @param handle FlexCAN handle pointer. - * @param mbIdx The FlexCAN Message Buffer index. - * @retval the index of mailbox 's timestamp stored in the handle. - * - */ -uint32_t FLEXCAN_GetTimeStamp(flexcan_handle_t *handle, uint8_t mbIdx); - -/*! - * @brief Aborts the interrupt driven message send process. - * - * This function aborts the interrupt driven message send process. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param mbIdx The FlexCAN Message Buffer index. - */ -void FLEXCAN_TransferAbortSend(CAN_Type *base, flexcan_handle_t *handle, uint8_t mbIdx); - -/*! - * @brief Aborts the interrupt driven message receive process. - * - * This function aborts the interrupt driven message receive process. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param mbIdx The FlexCAN Message Buffer index. - */ -void FLEXCAN_TransferAbortReceive(CAN_Type *base, flexcan_handle_t *handle, uint8_t mbIdx); - -/*! - * @brief Aborts the interrupt driven message receive from Rx FIFO process. - * - * This function aborts the interrupt driven message receive from Rx FIFO process. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - */ -void FLEXCAN_TransferAbortReceiveFifo(CAN_Type *base, flexcan_handle_t *handle); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * @brief Aborts the interrupt driven message receive from Enhanced Rx FIFO process. - * - * This function aborts the interrupt driven message receive from Enhanced Rx FIFO process. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - */ -void FLEXCAN_TransferAbortReceiveEnhancedFifo(CAN_Type *base, flexcan_handle_t *handle); -#endif - -/*! - * @brief FlexCAN IRQ handle function. - * - * This function handles the FlexCAN Error, the Message Buffer, and the Rx FIFO IRQ request. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - */ -void FLEXCAN_TransferHandleIRQ(CAN_Type *base, flexcan_handle_t *handle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_FLEXCAN_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexcan_edma.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexcan_edma.c deleted file mode 100644 index a5f68487f31..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexcan_edma.c +++ /dev/null @@ -1,381 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexcan_edma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexcan_edma" -#endif - -/*base->ERFCR & CAN_ERFCR_ERFEN_MASK)) - { - framefd = flexcanPrivateHandle->handle->framefd; - for (uint32_t i = 0; i < flexcanPrivateHandle->handle->frameNum; i++) - { - /* Enhanced Rx FIFO ID HIT offset is changed dynamically according to data length code (DLC) . */ - idHitIndex = (DLC_LENGTH_DECODE(framefd->length) + 3U) / 4U; - framefd->idhit = framefd->dataWord[idHitIndex]; - /* Clear the unused frame data. */ - for (uint32_t j = idHitIndex; j < 16U; j++) - { - framefd->dataWord[j] = 0x0U; - } - framefd++; - } - } -#endif - /* Disable transfer. */ - FLEXCAN_TransferAbortReceiveFifoEDMA(flexcanPrivateHandle->base, flexcanPrivateHandle->handle); - - if (NULL != flexcanPrivateHandle->handle->callback) - { - flexcanPrivateHandle->handle->callback(flexcanPrivateHandle->base, flexcanPrivateHandle->handle, - kStatus_FLEXCAN_RxFifoIdle, flexcanPrivateHandle->handle->userData); - } - } -} - -/*! - * brief Initializes the FlexCAN handle, which is used in transactional functions. - * - * param base FlexCAN peripheral base address. - * param handle Pointer to flexcan_edma_handle_t structure. - * param callback The callback function. - * param userData The parameter of the callback function. - * param rxFifoEdmaHandle User-requested DMA handle for Rx FIFO DMA transfer. - */ -void FLEXCAN_TransferCreateHandleEDMA(CAN_Type *base, - flexcan_edma_handle_t *handle, - flexcan_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *rxFifoEdmaHandle) -{ - assert(NULL != handle); - - uint32_t instance = FLEXCAN_GetInstance(base); - s_flexcanEdmaPrivateHandle[instance].base = base; - s_flexcanEdmaPrivateHandle[instance].handle = handle; - - (void)memset(handle, 0, sizeof(flexcan_edma_handle_t)); - - handle->rxFifoState = (uint8_t)KFLEXCAN_RxFifoIdle; - handle->rxFifoEdmaHandle = rxFifoEdmaHandle; - - /* Register Callback. */ - handle->callback = callback; - handle->userData = userData; - - /* Configure Legacy/Enhanced Rx FIFO DMA callback. */ - EDMA_SetCallback(handle->rxFifoEdmaHandle, FLEXCAN_ReceiveFifoEDMACallback, &s_flexcanEdmaPrivateHandle[instance]); -} - -/*! - * brief Prepares the eDMA transfer configuration for FLEXCAN Legacy RX FIFO. - * - * This function prepares the eDMA transfer configuration structure according to FLEXCAN Legacy RX FIFO. - * - * param base FlexCAN peripheral base address. - * param pFifoXfer FlexCAN Rx FIFO EDMA transfer structure, see #flexcan_fifo_transfer_t. - * param pEdmaConfig The user configuration structure of type edma_transfer_t. - * - */ -void FLEXCAN_PrepareTransfConfiguration(CAN_Type *base, - flexcan_fifo_transfer_t *pFifoXfer, - edma_transfer_config_t *pEdmaConfig) -{ - assert(NULL != pFifoXfer); - assert(NULL != pFifoXfer->frame); - assert(NULL != pEdmaConfig); - - flexcan_frame_t *fifoAddr = (flexcan_frame_t *)FLEXCAN_GetRxFifoHeadAddr(base); - -#if (defined(FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) - EDMA_PrepareTransfer(pEdmaConfig, (void *)fifoAddr, sizeof(flexcan_frame_t), (void *)pFifoXfer->frame, - sizeof(uint32_t), sizeof(flexcan_frame_t), sizeof(flexcan_frame_t) * pFifoXfer->frameNum, - kEDMA_PeripheralToMemory); -#else - /* The Data Size of FLEXCAN Legacy RX FIFO output port is 16 Bytes, but lots of chips not support 16Bytes width DMA - * transfer. These chips always support 4Byte width memory transfer, so we need prepare Memory to Memory mode by 4 - * Bytes width mode. - */ - EDMA_PrepareTransfer(pEdmaConfig, (void *)fifoAddr, 4U, (void *)pFifoXfer->frame, sizeof(uint32_t), - sizeof(flexcan_frame_t), sizeof(flexcan_frame_t) * pFifoXfer->frameNum, kEDMA_MemoryToMemory); -#endif -} - -/*! - * brief Start Transfer Data from the FLEXCAN Legacy Rx FIFO using eDMA. - * - * This function to Update edma transfer confiugration and Start eDMA transfer - * - * param base FlexCAN peripheral base address. - * param handle Pointer to flexcan_edma_handle_t structure. - * param pEdmaConfig The user configuration structure of type edma_transfer_t. - * retval kStatus_Success if succeed, others failed. - * retval kStatus_FLEXCAN_RxFifoBusy Previous transfer ongoing. - */ -status_t FLEXCAN_StartTransferDatafromRxFIFO(CAN_Type *base, - flexcan_edma_handle_t *handle, - edma_transfer_config_t *pEdmaConfig) -{ - assert(NULL != handle->rxFifoEdmaHandle); - assert(NULL != pEdmaConfig); - status_t status; - - /* If previous Rx FIFO receive not finished. */ - if ((uint8_t)KFLEXCAN_RxFifoBusy == handle->rxFifoState) - { - status = kStatus_FLEXCAN_RxFifoBusy; - } - else - { - handle->rxFifoState = (uint8_t)KFLEXCAN_RxFifoBusy; - - /* Enable FlexCAN Rx FIFO EDMA. */ - FLEXCAN_EnableRxFifoDMA(base, true); - - /* Submit configuration. */ - (void)EDMA_SubmitTransfer(handle->rxFifoEdmaHandle, (const edma_transfer_config_t *)pEdmaConfig); - EDMA_SetModulo(handle->rxFifoEdmaHandle->base, handle->rxFifoEdmaHandle->channel, kEDMA_Modulo16bytes, - kEDMA_ModuloDisable); - /* Start transfer. */ - EDMA_StartTransfer(handle->rxFifoEdmaHandle); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Receives the CAN Messages from the Legacy Rx FIFO using eDMA. - * - * This function receives the CAN Message using eDMA. This is a non-blocking function, which returns - * right away. After the CAN Message is received, the receive callback function is called. - * - * param base FlexCAN peripheral base address. - * param handle Pointer to flexcan_edma_handle_t structure. - * param pFifoXfer FlexCAN Rx FIFO EDMA transfer structure, see #flexcan_fifo_transfer_t. - * retval kStatus_Success if succeed, others failed. - * retval kStatus_FLEXCAN_RxFifoBusy Previous transfer ongoing. - */ -status_t FLEXCAN_TransferReceiveFifoEDMA(CAN_Type *base, - flexcan_edma_handle_t *handle, - flexcan_fifo_transfer_t *pFifoXfer) -{ - assert(NULL != handle->rxFifoEdmaHandle); - assert(NULL != pFifoXfer->frame); - - edma_transfer_config_t dmaXferConfig = {0}; - status_t status; - - handle->frameNum = pFifoXfer->frameNum; - /* Prepare transfer. */ - FLEXCAN_PrepareTransfConfiguration(base, pFifoXfer, &dmaXferConfig); - - /* Submit configuration and start edma transfer. */ - status = FLEXCAN_StartTransferDatafromRxFIFO(base, handle, &dmaXferConfig); - - return status; -} - -/*! - * brief Gets the Legacy Rx Fifo transfer status during a interrupt non-blocking receive. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param count Number of CAN messages receive so far by the non-blocking transaction. - * retval kStatus_InvalidArgument count is Invalid. - * retval kStatus_Success Successfully return the count. - */ - -status_t FLEXCAN_TransferGetReceiveFifoCountEMDA(CAN_Type *base, flexcan_edma_handle_t *handle, size_t *count) -{ - assert(NULL != handle); - - status_t result = kStatus_Success; - - if (handle->rxFifoState == (uint32_t)KFLEXCAN_RxFifoIdle) - { - result = kStatus_NoTransferInProgress; - } - else - { - *count = handle->frameNum - - EDMA_GetRemainingMajorLoopCount(handle->rxFifoEdmaHandle->base, handle->rxFifoEdmaHandle->channel); - } - - return result; -} - -/*! - * brief Aborts the receive Legacy/Enhanced Rx FIFO process which used eDMA. - * - * This function aborts the receive Legacy/Enhanced Rx FIFO process which used eDMA. - * - * param base FlexCAN peripheral base address. - * param handle Pointer to flexcan_edma_handle_t structure. - */ -void FLEXCAN_TransferAbortReceiveFifoEDMA(CAN_Type *base, flexcan_edma_handle_t *handle) -{ - assert(NULL != handle->rxFifoEdmaHandle); - - /* Stop transfer. */ - EDMA_AbortTransfer(handle->rxFifoEdmaHandle); - - handle->rxFifoState = (uint8_t)KFLEXCAN_RxFifoIdle; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - handle->framefd = NULL; -#endif - handle->frameNum = 0U; - /* Disable FlexCAN Legacy/Enhanced Rx FIFO EDMA. */ - FLEXCAN_EnableRxFifoDMA(base, false); -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * brief Receives the CAN FD Message from the Enhanced Rx FIFO using eDMA. - * - * This function receives the CAN FD Message using eDMA. This is a non-blocking function, which returns - * right away. After the CAN Message is received, the receive callback function is called. - * - * param base FlexCAN peripheral base address. - * param handle Pointer to flexcan_edma_handle_t structure. - * param pFifoXfer FlexCAN Rx FIFO EDMA transfer structure, see #flexcan_fifo_transfer_t. - * retval kStatus_Success if succeed, others failed. - * retval kStatus_FLEXCAN_RxFifoBusy Previous transfer ongoing. - * retval kStatus_InvalidArgument The watermark configuration is invalid, the watermark need be set to - 1 to do successfully EDMA transfer with this API. - */ -status_t FLEXCAN_TransferReceiveEnhancedFifoEDMA(CAN_Type *base, - flexcan_edma_handle_t *handle, - flexcan_fifo_transfer_t *pFifoXfer) -{ - assert(NULL != handle->rxFifoEdmaHandle); - assert(NULL != pFifoXfer->framefd); - - edma_transfer_config_t dmaXferConfig; - edma_minor_offset_config_t dmaMinorOffsetConfig; - status_t status; - flexcan_fd_frame_t *fifoAddr = (flexcan_fd_frame_t *)E_RX_FIFO(base); - uint32_t perReadWords = ((base->ERFCR & CAN_ERFCR_DMALW_MASK) >> CAN_ERFCR_DMALW_SHIFT) + 1U; - uint32_t watermark = ((base->ERFCR & CAN_ERFCR_ERFWM_MASK) >> CAN_ERFCR_ERFWM_SHIFT) + 1U; - - /* If previous Rx FIFO receive not finished. */ - if ((uint8_t)KFLEXCAN_RxFifoBusy == handle->rxFifoState) - { - status = kStatus_FLEXCAN_RxFifoBusy; - } - else - { - handle->frameNum = pFifoXfer->frameNum; - handle->framefd = pFifoXfer->framefd; - /*!< To reduce the complexity of DMA software configuration, need to set watermark to 1 to make that each DMA - request read once Rx FIFO. Because a DMA transfer cannot be dynamically changed, Number of words read per - transfer (ERFCR[DMALW] + 1) should be programmed so that the Enhanced Rx FIFO element can store the largest - CAN message present on the CAN bus. */ - if ((watermark != 1U) || ((sizeof(uint32_t) * perReadWords) != sizeof(flexcan_fd_frame_t))) - { - return kStatus_InvalidArgument; - } - - /* Prepare transfer. */ - EDMA_PrepareTransfer( - &dmaXferConfig, (void *)fifoAddr, sizeof(uint32_t), (void *)pFifoXfer->framefd, sizeof(uint32_t), - sizeof(uint32_t) * perReadWords, /* minor loop bytes : 4* perReadWords */ - sizeof(uint32_t) * perReadWords * handle->frameNum, /* major loop counts : handle->frameNum */ - kEDMA_MemoryToMemory); - /* Submit configuration. */ - (void)EDMA_SubmitTransfer(handle->rxFifoEdmaHandle, &dmaXferConfig); - - dmaMinorOffsetConfig.enableDestMinorOffset = false; - dmaMinorOffsetConfig.enableSrcMinorOffset = true; - dmaMinorOffsetConfig.minorOffset = 128U - sizeof(uint32_t) * perReadWords; - EDMA_SetMinorOffsetConfig(handle->rxFifoEdmaHandle->base, handle->rxFifoEdmaHandle->channel, - &dmaMinorOffsetConfig); - - EDMA_SetModulo(handle->rxFifoEdmaHandle->base, handle->rxFifoEdmaHandle->channel, kEDMA_Modulo128bytes, - kEDMA_ModuloDisable); - - handle->rxFifoState = (uint8_t)KFLEXCAN_RxFifoBusy; - - /* Enable FlexCAN Rx FIFO EDMA. */ - FLEXCAN_EnableRxFifoDMA(base, true); - /* Start transfer. */ - EDMA_StartTransfer(handle->rxFifoEdmaHandle); - - status = kStatus_Success; - } - - return status; -} -#endif diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexcan_edma.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexcan_edma.h deleted file mode 100644 index 90d78ef6690..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexcan_edma.h +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_FLEXCAN_EDMA_H_ -#define FSL_FLEXCAN_EDMA_H_ - -#include "fsl_flexcan.h" -#include "fsl_edma.h" - -/*! - * @addtogroup flexcan_edma_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief FlexCAN EDMA driver version. */ -#define FSL_FLEXCAN_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 11, 3)) -/*! @} */ - -/* Forward declaration of the handle typedef. */ -typedef struct _flexcan_edma_handle flexcan_edma_handle_t; - -/*! @brief FlexCAN transfer callback function. */ -typedef void (*flexcan_edma_transfer_callback_t)(CAN_Type *base, - flexcan_edma_handle_t *handle, - status_t status, - void *userData); - -/*! - * @brief FlexCAN eDMA handle - */ -struct _flexcan_edma_handle -{ - flexcan_edma_transfer_callback_t callback; /*!< Callback function. */ - void *userData; /*!< FlexCAN callback function parameter.*/ - edma_handle_t *rxFifoEdmaHandle; /*!< The EDMA handler for Rx FIFO. */ - volatile uint8_t rxFifoState; /*!< Rx FIFO transfer state. */ - size_t frameNum; /*!< The number of messages that need to be received. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - flexcan_fd_frame_t *framefd; /*!< Point to the buffer of CAN Message to be received from Enhanced Rx FIFO. */ -#endif -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name eDMA transactional - * @{ - */ - -/*! - * @brief Initializes the FlexCAN handle, which is used in transactional functions. - * - * @param base FlexCAN peripheral base address. - * @param handle Pointer to flexcan_edma_handle_t structure. - * @param callback The callback function. - * @param userData The parameter of the callback function. - * @param rxFifoEdmaHandle User-requested DMA handle for Rx FIFO DMA transfer. - */ -void FLEXCAN_TransferCreateHandleEDMA(CAN_Type *base, - flexcan_edma_handle_t *handle, - flexcan_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *rxFifoEdmaHandle); - -/*! - * @brief Prepares the eDMA transfer configuration for FLEXCAN Legacy RX FIFO. - * - * This function prepares the eDMA transfer configuration structure according to FLEXCAN Legacy RX FIFO. - * - * @param base FlexCAN peripheral base address. - * @param pFifoXfer FlexCAN Rx FIFO EDMA transfer structure, see #flexcan_fifo_transfer_t. - * @param pEdmaConfig The user configuration structure of type edma_transfer_t. - * - */ -void FLEXCAN_PrepareTransfConfiguration(CAN_Type *base, - flexcan_fifo_transfer_t *pFifoXfer, - edma_transfer_config_t *pEdmaConfig); - -/*! - * @brief Start Transfer Data from the FLEXCAN Legacy Rx FIFO using eDMA. - * - * This function to Update edma transfer confiugration and Start eDMA transfer - * - * @param base FlexCAN peripheral base address. - * @param handle Pointer to flexcan_edma_handle_t structure. - * @param pEdmaConfig The user configuration structure of type edma_transfer_t. - * @retval kStatus_Success if succeed, others failed. - * @retval kStatus_FLEXCAN_RxFifoBusy Previous transfer ongoing. - */ -status_t FLEXCAN_StartTransferDatafromRxFIFO(CAN_Type *base, - flexcan_edma_handle_t *handle, - edma_transfer_config_t *pEdmaConfig); - -/*! - * @brief Receives the CAN Message from the Legacy Rx FIFO using eDMA. - * - * This function receives the CAN Message using eDMA. This is a non-blocking function, which returns - * right away. After the CAN Message is received, the receive callback function is called. - * - * @param base FlexCAN peripheral base address. - * @param handle Pointer to flexcan_edma_handle_t structure. - * @param pFifoXfer FlexCAN Rx FIFO EDMA transfer structure, see #flexcan_fifo_transfer_t. - * @retval kStatus_Success if succeed, others failed. - * @retval kStatus_FLEXCAN_RxFifoBusy Previous transfer ongoing. - */ -status_t FLEXCAN_TransferReceiveFifoEDMA(CAN_Type *base, - flexcan_edma_handle_t *handle, - flexcan_fifo_transfer_t *pFifoXfer); -/*! - * @brief Gets the Legacy Rx Fifo transfer status during a interrupt non-blocking receive. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param count Number of CAN messages receive so far by the non-blocking transaction. - * @retval kStatus_InvalidArgument count is Invalid. - * @retval kStatus_Success Successfully return the count. - */ - -status_t FLEXCAN_TransferGetReceiveFifoCountEMDA(CAN_Type *base, flexcan_edma_handle_t *handle, size_t *count); -/*! - * @brief Aborts the receive Legacy/Enhanced Rx FIFO process which used eDMA. - * - * This function aborts the receive Legacy/Enhanced Rx FIFO process which used eDMA. - * - * @param base FlexCAN peripheral base address. - * @param handle Pointer to flexcan_edma_handle_t structure. - */ -void FLEXCAN_TransferAbortReceiveFifoEDMA(CAN_Type *base, flexcan_edma_handle_t *handle); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * @brief Receives the CAN FD Message from the Enhanced Rx FIFO using eDMA. - * - * This function receives the CAN FD Message using eDMA. This is a non-blocking function, which returns - * right away. After the CAN Message is received, the receive callback function is called. - * - * @param base FlexCAN peripheral base address. - * @param handle Pointer to flexcan_edma_handle_t structure. - * @param pFifoXfer FlexCAN Rx FIFO EDMA transfer structure, see #flexcan_fifo_transfer_t. - * @retval kStatus_Success if succeed, others failed. - * @retval kStatus_FLEXCAN_RxFifoBusy Previous transfer ongoing. - */ -status_t FLEXCAN_TransferReceiveEnhancedFifoEDMA(CAN_Type *base, - flexcan_edma_handle_t *handle, - flexcan_fifo_transfer_t *pFifoXfer); -/*! - * @brief Gets the Enhanced Rx Fifo transfer status during a interrupt non-blocking receive. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param count Number of CAN messages receive so far by the non-blocking transaction. - * @retval kStatus_InvalidArgument count is Invalid. - * @retval kStatus_Success Successfully return the count. - */ - -static inline status_t FLEXCAN_TransferGetReceiveEnhancedFifoCountEMDA(CAN_Type *base, - flexcan_edma_handle_t *handle, - size_t *count) -{ - return FLEXCAN_TransferGetReceiveFifoCountEMDA(base, handle, count); -} -#endif - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_FLEXCAN_EDMA_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio.c deleted file mode 100644 index 52741f2a4de..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio.c +++ /dev/null @@ -1,511 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio" -#endif - -/*< @brief user configurable flexio handle count. */ -#define FLEXIO_HANDLE_COUNT 2 - -#if defined(FLEXIO_RSTS) -#define FLEXIO_RESETS_ARRAY FLEXIO_RSTS -#elif defined(FLEXIO_RSTS_N) -#define FLEXIO_RESETS_ARRAY FLEXIO_RSTS_N -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to flexio bases for each instance. */ -FLEXIO_Type *const s_flexioBases[] = FLEXIO_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to flexio clocks for each instance. */ -const clock_ip_name_t s_flexioClocks[] = FLEXIO_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/*< @brief pointer to array of FLEXIO handle. */ -static void *s_flexioHandle[FLEXIO_HANDLE_COUNT]; - -/*< @brief pointer to array of FLEXIO IP types. */ -static void *s_flexioType[FLEXIO_HANDLE_COUNT]; - -/*< @brief pointer to array of FLEXIO Isr. */ -static flexio_isr_t s_flexioIsr[FLEXIO_HANDLE_COUNT]; - -/* FlexIO common IRQ Handler. */ -static void FLEXIO_CommonIRQHandler(void); - -#if defined(FLEXIO_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_flexioResets[] = FLEXIO_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Codes - ******************************************************************************/ - -/*! - * brief Get instance number for FLEXIO module. - * - * param base FLEXIO peripheral base address. - */ -uint32_t FLEXIO_GetInstance(FLEXIO_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_flexioBases); instance++) - { - if (s_flexioBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_flexioBases)); - - return instance; -} - -/*! - * brief Configures the FlexIO with a FlexIO configuration. The configuration structure - * can be filled by the user or be set with default values by FLEXIO_GetDefaultConfig(). - * - * Example - code - flexio_config_t config = { - .enableFlexio = true, - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false - }; - FLEXIO_Configure(base, &config); - endcode - * - * param base FlexIO peripheral base address - * param userConfig pointer to flexio_config_t structure -*/ -void FLEXIO_Init(FLEXIO_Type *base, const flexio_config_t *userConfig) -{ - uint32_t ctrlReg = 0; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_EnableClock(s_flexioClocks[FLEXIO_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(FLEXIO_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_flexioResets[FLEXIO_GetInstance(base)]); -#endif - - FLEXIO_Reset(base); - - ctrlReg = base->CTRL; - ctrlReg &= ~(FLEXIO_CTRL_DOZEN_MASK | FLEXIO_CTRL_DBGE_MASK | FLEXIO_CTRL_FASTACC_MASK | FLEXIO_CTRL_FLEXEN_MASK); - ctrlReg |= (FLEXIO_CTRL_DBGE(userConfig->enableInDebug) | FLEXIO_CTRL_FASTACC(userConfig->enableFastAccess) | - FLEXIO_CTRL_FLEXEN(userConfig->enableFlexio)); - if (!userConfig->enableInDoze) - { - ctrlReg |= FLEXIO_CTRL_DOZEN_MASK; - } - - base->CTRL = ctrlReg; -} - -/*! - * brief Gates the FlexIO clock. Call this API to stop the FlexIO clock. - * - * note After calling this API, call the FLEXO_Init to use the FlexIO module. - * - * param base FlexIO peripheral base address - */ -void FLEXIO_Deinit(FLEXIO_Type *base) -{ - FLEXIO_Enable(base, false); -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_DisableClock(s_flexioClocks[FLEXIO_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Gets the default configuration to configure the FlexIO module. The configuration - * can used directly to call the FLEXIO_Configure(). - * - * Example: - code - flexio_config_t config; - FLEXIO_GetDefaultConfig(&config); - endcode - * - * param userConfig pointer to flexio_config_t structure -*/ -void FLEXIO_GetDefaultConfig(flexio_config_t *userConfig) -{ - assert(userConfig != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(userConfig, 0, sizeof(*userConfig)); - - userConfig->enableFlexio = true; - userConfig->enableInDoze = false; - userConfig->enableInDebug = true; - userConfig->enableFastAccess = false; -} - -/*! - * brief Resets the FlexIO module. - * - * param base FlexIO peripheral base address - */ -void FLEXIO_Reset(FLEXIO_Type *base) -{ - /*do software reset, software reset operation affect all other FLEXIO registers except CTRL*/ - base->CTRL |= FLEXIO_CTRL_SWRST_MASK; - base->CTRL = 0; -} - -/*! - * brief Gets the shifter buffer address for the DMA transfer usage. - * - * param base FlexIO peripheral base address - * param type Shifter type of flexio_shifter_buffer_type_t - * param index Shifter index - * return Corresponding shifter buffer index - */ -uint32_t FLEXIO_GetShifterBufferAddress(FLEXIO_Type *base, flexio_shifter_buffer_type_t type, uint8_t index) -{ - assert(index < FLEXIO_SHIFTBUF_COUNT); - - uint32_t address = 0; - - switch (type) - { - case kFLEXIO_ShifterBuffer: - address = (uint32_t) & (base->SHIFTBUF[index]); - break; - - case kFLEXIO_ShifterBufferBitSwapped: - address = (uint32_t) & (base->SHIFTBUFBIS[index]); - break; - - case kFLEXIO_ShifterBufferByteSwapped: - address = (uint32_t) & (base->SHIFTBUFBYS[index]); - break; - - case kFLEXIO_ShifterBufferBitByteSwapped: - address = (uint32_t) & (base->SHIFTBUFBBS[index]); - break; - -#if defined(FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_BYTE_SWAP) && FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_BYTE_SWAP - case kFLEXIO_ShifterBufferNibbleByteSwapped: - address = (uint32_t) & (base->SHIFTBUFNBS[index]); - break; - -#endif -#if defined(FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_HALF_WORD_SWAP) && FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_HALF_WORD_SWAP - case kFLEXIO_ShifterBufferHalfWordSwapped: - address = (uint32_t) & (base->SHIFTBUFHWS[index]); - break; - -#endif -#if defined(FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_SWAP) && FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_SWAP - case kFLEXIO_ShifterBufferNibbleSwapped: - address = (uint32_t) & (base->SHIFTBUFNIS[index]); - break; - -#endif - default: - address = (uint32_t) & (base->SHIFTBUF[index]); - break; - } - return address; -} - -/*! - * brief Configures the shifter with the shifter configuration. The configuration structure - * covers both the SHIFTCTL and SHIFTCFG registers. To configure the shifter to the proper - * mode, select which timer controls the shifter to shift, whether to generate start bit/stop - * bit, and the polarity of start bit and stop bit. - * - * Example - code - flexio_shifter_config_t config = { - .timerSelect = 0, - .timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive, - .pinConfig = kFLEXIO_PinConfigOpenDrainOrBidirection, - .pinPolarity = kFLEXIO_PinActiveLow, - .shifterMode = kFLEXIO_ShifterModeTransmit, - .inputSource = kFLEXIO_ShifterInputFromPin, - .shifterStop = kFLEXIO_ShifterStopBitHigh, - .shifterStart = kFLEXIO_ShifterStartBitLow - }; - FLEXIO_SetShifterConfig(base, &config); - endcode - * - * param base FlexIO peripheral base address - * param index Shifter index - * param shifterConfig Pointer to flexio_shifter_config_t structure -*/ -void FLEXIO_SetShifterConfig(FLEXIO_Type *base, uint8_t index, const flexio_shifter_config_t *shifterConfig) -{ - base->SHIFTCFG[index] = FLEXIO_SHIFTCFG_INSRC(shifterConfig->inputSource) -#if FSL_FEATURE_FLEXIO_HAS_PARALLEL_WIDTH - | FLEXIO_SHIFTCFG_PWIDTH(shifterConfig->parallelWidth) -#endif /* FSL_FEATURE_FLEXIO_HAS_PARALLEL_WIDTH */ - | FLEXIO_SHIFTCFG_SSTOP(shifterConfig->shifterStop) | - FLEXIO_SHIFTCFG_SSTART(shifterConfig->shifterStart); - - base->SHIFTCTL[index] = - FLEXIO_SHIFTCTL_TIMSEL(shifterConfig->timerSelect) | FLEXIO_SHIFTCTL_TIMPOL(shifterConfig->timerPolarity) | - FLEXIO_SHIFTCTL_PINCFG(shifterConfig->pinConfig) | FLEXIO_SHIFTCTL_PINSEL(shifterConfig->pinSelect) | - FLEXIO_SHIFTCTL_PINPOL(shifterConfig->pinPolarity) | FLEXIO_SHIFTCTL_SMOD(shifterConfig->shifterMode); -} - -/*! - * brief Configures the timer with the timer configuration. The configuration structure - * covers both the TIMCTL and TIMCFG registers. To configure the timer to the proper - * mode, select trigger source for timer and the timer pin output and the timing for timer. - * - * Example - code - flexio_timer_config_t config = { - .triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(0), - .triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow, - .triggerSource = kFLEXIO_TimerTriggerSourceInternal, - .pinConfig = kFLEXIO_PinConfigOpenDrainOrBidirection, - .pinSelect = 0, - .pinPolarity = kFLEXIO_PinActiveHigh, - .timerMode = kFLEXIO_TimerModeDual8BitBaudBit, - .timerOutput = kFLEXIO_TimerOutputZeroNotAffectedByReset, - .timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput, - .timerReset = kFLEXIO_TimerResetOnTimerPinEqualToTimerOutput, - .timerDisable = kFLEXIO_TimerDisableOnTimerCompare, - .timerEnable = kFLEXIO_TimerEnableOnTriggerHigh, - .timerStop = kFLEXIO_TimerStopBitEnableOnTimerDisable, - .timerStart = kFLEXIO_TimerStartBitEnabled - }; - FLEXIO_SetTimerConfig(base, &config); - endcode - * - * param base FlexIO peripheral base address - * param index Timer index - * param timerConfig Pointer to the flexio_timer_config_t structure -*/ -void FLEXIO_SetTimerConfig(FLEXIO_Type *base, uint8_t index, const flexio_timer_config_t *timerConfig) -{ - base->TIMCFG[index] = - FLEXIO_TIMCFG_TIMOUT(timerConfig->timerOutput) | FLEXIO_TIMCFG_TIMDEC(timerConfig->timerDecrement) | - FLEXIO_TIMCFG_TIMRST(timerConfig->timerReset) | FLEXIO_TIMCFG_TIMDIS(timerConfig->timerDisable) | - FLEXIO_TIMCFG_TIMENA(timerConfig->timerEnable) | FLEXIO_TIMCFG_TSTOP(timerConfig->timerStop) | - FLEXIO_TIMCFG_TSTART(timerConfig->timerStart); - - base->TIMCMP[index] = FLEXIO_TIMCMP_CMP(timerConfig->timerCompare); - - base->TIMCTL[index] = FLEXIO_TIMCTL_TRGSEL(timerConfig->triggerSelect) | - FLEXIO_TIMCTL_TRGPOL(timerConfig->triggerPolarity) | - FLEXIO_TIMCTL_TRGSRC(timerConfig->triggerSource) | - FLEXIO_TIMCTL_PINCFG(timerConfig->pinConfig) | FLEXIO_TIMCTL_PINSEL(timerConfig->pinSelect) | - FLEXIO_TIMCTL_PINPOL(timerConfig->pinPolarity) | FLEXIO_TIMCTL_TIMOD(timerConfig->timerMode); -} - -/*! - * brief Registers the handle and the interrupt handler for the FlexIO-simulated peripheral. - * - * param base Pointer to the FlexIO simulated peripheral type. - * param handle Pointer to the handler for FlexIO simulated peripheral. - * param isr FlexIO simulated peripheral interrupt handler. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_RegisterHandleIRQ(void *base, void *handle, flexio_isr_t isr) -{ - assert(base != NULL); - assert(handle != NULL); - assert(isr != NULL); - - uint8_t index; - - /* Find the an empty handle pointer to store the handle. */ - for (index = 0U; index < (uint8_t)FLEXIO_HANDLE_COUNT; index++) - { - if (s_flexioHandle[index] == NULL) - { - /* Register FLEXIO simulated driver base, handle and isr. */ - s_flexioType[index] = base; - s_flexioHandle[index] = handle; - s_flexioIsr[index] = isr; - break; - } - } - - if (index == (uint8_t)FLEXIO_HANDLE_COUNT) - { - return kStatus_OutOfRange; - } - else - { - return kStatus_Success; - } -} - -/*! - * brief Unregisters the handle and the interrupt handler for the FlexIO-simulated peripheral. - * - * param base Pointer to the FlexIO simulated peripheral type. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_UnregisterHandleIRQ(void *base) -{ - assert(base != NULL); - - uint8_t index; - - /* Find the index from base address mappings. */ - for (index = 0U; index < (uint8_t)FLEXIO_HANDLE_COUNT; index++) - { - if (s_flexioType[index] == base) - { - /* Unregister FLEXIO simulated driver handle and isr. */ - s_flexioType[index] = NULL; - s_flexioHandle[index] = NULL; - s_flexioIsr[index] = NULL; - break; - } - } - - if (index == (uint8_t)FLEXIO_HANDLE_COUNT) - { - return kStatus_OutOfRange; - } - else - { - return kStatus_Success; - } -} - -static void FLEXIO_CommonIRQHandler(void) -{ - uint8_t index; - - for (index = 0U; index < (uint8_t)FLEXIO_HANDLE_COUNT; index++) - { - if (s_flexioHandle[index] != NULL) - { - s_flexioIsr[index](s_flexioType[index], s_flexioHandle[index]); - } - } - SDK_ISR_EXIT_BARRIER; -} - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER) && FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER -/*! - * brief Configure a FLEXIO pin used by the board. - * - * To Config the FLEXIO PIN, define a pin configuration, as either input or output, in the user file. - * Then, call the FLEXIO_SetPinConfig() function. - * - * This is an example to define an input pin or an output pin configuration. - * code - * Define a digital input pin configuration, - * flexio_gpio_config_t config = - * { - * kFLEXIO_DigitalInput, - * 0U, - * kFLEXIO_FlagRisingEdgeEnable | kFLEXIO_InputInterruptEnable, - * } - * Define a digital output pin configuration, - * flexio_gpio_config_t config = - * { - * kFLEXIO_DigitalOutput, - * 0U, - * 0U - * } - * endcode - * param base FlexIO peripheral base address - * param pin FLEXIO pin number. - * param config FLEXIO pin configuration pointer. - */ -void FLEXIO_SetPinConfig(FLEXIO_Type *base, uint32_t pin, flexio_gpio_config_t *config) -{ - assert(NULL != config); - IRQn_Type flexio_irqs[] = FLEXIO_IRQS; - - if (config->pinDirection == kFLEXIO_DigitalInput) - { - base->PINOUTE &= ~(1UL << pin); - if (0U != (config->inputConfig & (uint8_t)kFLEXIO_InputInterruptEnable)) - { - base->PINIEN = 1UL << pin; - /* Clear pending NVIC IRQ before enable NVIC IRQ. */ - NVIC_ClearPendingIRQ(flexio_irqs[FLEXIO_GetInstance(base)]); - /* Enable interrupt in NVIC. */ - (void)EnableIRQ(flexio_irqs[FLEXIO_GetInstance(base)]); - } - - if (0U != (config->inputConfig & (uint8_t)kFLEXIO_FlagRisingEdgeEnable)) - { - base->PINREN = 1UL << pin; - } - - if (0U != (config->inputConfig & (uint8_t)kFLEXIO_FlagFallingEdgeEnable)) - { - base->PINFEN = 1UL << pin; - } - } - else - { - FLEXIO_EnablePinOutput(base, pin); - FLEXIO_PinWrite(base, pin, config->outputLogic); - } -} -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER*/ - -void FLEXIO_DriverIRQHandler(void); -void FLEXIO_DriverIRQHandler(void) -{ - FLEXIO_CommonIRQHandler(); -} - -void FLEXIO0_DriverIRQHandler(void); -void FLEXIO0_DriverIRQHandler(void) -{ - FLEXIO_CommonIRQHandler(); -} - -void FLEXIO1_DriverIRQHandler(void); -void FLEXIO1_DriverIRQHandler(void) -{ - FLEXIO_CommonIRQHandler(); -} - -void UART2_FLEXIO_DriverIRQHandler(void); -void UART2_FLEXIO_DriverIRQHandler(void) -{ - FLEXIO_CommonIRQHandler(); -} - -void FLEXIO2_DriverIRQHandler(void); -void FLEXIO2_DriverIRQHandler(void) -{ - FLEXIO_CommonIRQHandler(); -} - -void FLEXIO3_DriverIRQHandler(void); -void FLEXIO3_DriverIRQHandler(void) -{ - FLEXIO_CommonIRQHandler(); -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio.h deleted file mode 100644 index 1e1bc6278d0..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio.h +++ /dev/null @@ -1,917 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020, 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_FLEXIO_H_ -#define FSL_FLEXIO_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup flexio_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief FlexIO driver version. */ -#define FSL_FLEXIO_DRIVER_VERSION (MAKE_VERSION(2, 2, 2)) -/*! @} */ - -/*! @brief Calculate FlexIO timer trigger.*/ -#define FLEXIO_TIMER_TRIGGER_SEL_PININPUT(x) ((uint32_t)(x) << 1U) -#define FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(x) (((uint32_t)(x) << 2U) | 0x1U) -#define FLEXIO_TIMER_TRIGGER_SEL_TIMn(x) (((uint32_t)(x) << 2U) | 0x3U) - -/*! @brief Define time of timer trigger polarity.*/ -typedef enum _flexio_timer_trigger_polarity -{ - kFLEXIO_TimerTriggerPolarityActiveHigh = 0x0U, /*!< Active high. */ - kFLEXIO_TimerTriggerPolarityActiveLow = 0x1U, /*!< Active low. */ -} flexio_timer_trigger_polarity_t; - -/*! @brief Define type of timer trigger source.*/ -typedef enum _flexio_timer_trigger_source -{ - kFLEXIO_TimerTriggerSourceExternal = 0x0U, /*!< External trigger selected. */ - kFLEXIO_TimerTriggerSourceInternal = 0x1U, /*!< Internal trigger selected. */ -} flexio_timer_trigger_source_t; - -/*! @brief Define type of timer/shifter pin configuration.*/ -typedef enum _flexio_pin_config -{ - kFLEXIO_PinConfigOutputDisabled = 0x0U, /*!< Pin output disabled. */ - kFLEXIO_PinConfigOpenDrainOrBidirection = 0x1U, /*!< Pin open drain or bidirectional output enable. */ - kFLEXIO_PinConfigBidirectionOutputData = 0x2U, /*!< Pin bidirectional output data. */ - kFLEXIO_PinConfigOutput = 0x3U, /*!< Pin output. */ -} flexio_pin_config_t; - -/*! @brief Definition of pin polarity.*/ -typedef enum _flexio_pin_polarity -{ - kFLEXIO_PinActiveHigh = 0x0U, /*!< Active high. */ - kFLEXIO_PinActiveLow = 0x1U, /*!< Active low. */ -} flexio_pin_polarity_t; - -/*! @brief Define type of timer work mode.*/ -typedef enum _flexio_timer_mode -{ - kFLEXIO_TimerModeDisabled = 0x0U, /*!< Timer Disabled. */ - kFLEXIO_TimerModeDual8BitBaudBit = 0x1U, /*!< Dual 8-bit counters baud/bit mode. */ - kFLEXIO_TimerModeDual8BitPWM = 0x2U, /*!< Dual 8-bit counters PWM mode. */ - kFLEXIO_TimerModeSingle16Bit = 0x3U, /*!< Single 16-bit counter mode. */ -} flexio_timer_mode_t; - -/*! @brief Define type of timer initial output or timer reset condition.*/ -typedef enum _flexio_timer_output -{ - kFLEXIO_TimerOutputOneNotAffectedByReset = 0x0U, /*!< Logic one when enabled and is not affected by timer - reset. */ - kFLEXIO_TimerOutputZeroNotAffectedByReset = 0x1U, /*!< Logic zero when enabled and is not affected by timer - reset. */ - kFLEXIO_TimerOutputOneAffectedByReset = 0x2U, /*!< Logic one when enabled and on timer reset. */ - kFLEXIO_TimerOutputZeroAffectedByReset = 0x3U, /*!< Logic zero when enabled and on timer reset. */ -} flexio_timer_output_t; - -/*! @brief Define type of timer decrement.*/ -typedef enum _flexio_timer_decrement_source -{ - kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput = 0x0U, /*!< Decrement counter on FlexIO clock, Shift clock - equals Timer output. */ - kFLEXIO_TimerDecSrcOnTriggerInputShiftTimerOutput, /*!< Decrement counter on Trigger input (both edges), - Shift clock equals Timer output. */ - kFLEXIO_TimerDecSrcOnPinInputShiftPinInput, /*!< Decrement counter on Pin input (both edges), - Shift clock equals Pin input. */ - kFLEXIO_TimerDecSrcOnTriggerInputShiftTriggerInput /*!< Decrement counter on Trigger input (both edges), - Shift clock equals Trigger input. */ -#if (defined(FSL_FEATURE_FLEXIO_TIMCFG_TIMDCE_FIELD_WIDTH) && (FSL_FEATURE_FLEXIO_TIMCFG_TIMDCE_FIELD_WIDTH == 3)) - , - kFLEXIO_TimerDecSrcDiv16OnFlexIOClockShiftTimerOutput, /*!< Decrement counter on FlexIO clock divided by 16, - Shift clock equals Timer output. */ - kFLEXIO_TimerDecSrcDiv256OnFlexIOClockShiftTimerOutput, /*!< Decrement counter on FlexIO clock divided by 256, - Shift clock equals Timer output. */ - kFLEXIO_TimerRisSrcOnPinInputShiftPinInput, /*!< Decrement counter on Pin input (rising edges), - Shift clock equals Pin input. */ - kFLEXIO_TimerRisSrcOnTriggerInputShiftTriggerInput /*!< Decrement counter on Trigger input (rising edges), Shift - clock equals Trigger input. */ -#endif /* FSL_FEATURE_FLEXIO_TIMCFG_TIMDCE_FIELD_WIDTH */ -} flexio_timer_decrement_source_t; - -/*! @brief Define type of timer reset condition.*/ -typedef enum _flexio_timer_reset_condition -{ - kFLEXIO_TimerResetNever = 0x0U, /*!< Timer never reset. */ - kFLEXIO_TimerResetOnTimerPinEqualToTimerOutput = 0x2U, /*!< Timer reset on Timer Pin equal to Timer Output. */ - kFLEXIO_TimerResetOnTimerTriggerEqualToTimerOutput = 0x3U, /*!< Timer reset on Timer Trigger equal to - Timer Output. */ - kFLEXIO_TimerResetOnTimerPinRisingEdge = 0x4U, /*!< Timer reset on Timer Pin rising edge. */ - kFLEXIO_TimerResetOnTimerTriggerRisingEdge = 0x6U, /*!< Timer reset on Trigger rising edge. */ - kFLEXIO_TimerResetOnTimerTriggerBothEdge = 0x7U, /*!< Timer reset on Trigger rising or falling edge. */ -} flexio_timer_reset_condition_t; - -/*! @brief Define type of timer disable condition.*/ -typedef enum _flexio_timer_disable_condition -{ - kFLEXIO_TimerDisableNever = 0x0U, /*!< Timer never disabled. */ - kFLEXIO_TimerDisableOnPreTimerDisable = 0x1U, /*!< Timer disabled on Timer N-1 disable. */ - kFLEXIO_TimerDisableOnTimerCompare = 0x2U, /*!< Timer disabled on Timer compare. */ - kFLEXIO_TimerDisableOnTimerCompareTriggerLow = 0x3U, /*!< Timer disabled on Timer compare and Trigger Low. */ - kFLEXIO_TimerDisableOnPinBothEdge = 0x4U, /*!< Timer disabled on Pin rising or falling edge. */ - kFLEXIO_TimerDisableOnPinBothEdgeTriggerHigh = 0x5U, /*!< Timer disabled on Pin rising or falling edge provided - Trigger is high. */ - kFLEXIO_TimerDisableOnTriggerFallingEdge = 0x6U, /*!< Timer disabled on Trigger falling edge. */ -} flexio_timer_disable_condition_t; - -/*! @brief Define type of timer enable condition.*/ -typedef enum _flexio_timer_enable_condition -{ - kFLEXIO_TimerEnabledAlways = 0x0U, /*!< Timer always enabled. */ - kFLEXIO_TimerEnableOnPrevTimerEnable = 0x1U, /*!< Timer enabled on Timer N-1 enable. */ - kFLEXIO_TimerEnableOnTriggerHigh = 0x2U, /*!< Timer enabled on Trigger high. */ - kFLEXIO_TimerEnableOnTriggerHighPinHigh = 0x3U, /*!< Timer enabled on Trigger high and Pin high. */ - kFLEXIO_TimerEnableOnPinRisingEdge = 0x4U, /*!< Timer enabled on Pin rising edge. */ - kFLEXIO_TimerEnableOnPinRisingEdgeTriggerHigh = 0x5U, /*!< Timer enabled on Pin rising edge and Trigger high. */ - kFLEXIO_TimerEnableOnTriggerRisingEdge = 0x6U, /*!< Timer enabled on Trigger rising edge. */ - kFLEXIO_TimerEnableOnTriggerBothEdge = 0x7U, /*!< Timer enabled on Trigger rising or falling edge. */ -} flexio_timer_enable_condition_t; - -/*! @brief Define type of timer stop bit generate condition.*/ -typedef enum _flexio_timer_stop_bit_condition -{ - kFLEXIO_TimerStopBitDisabled = 0x0U, /*!< Stop bit disabled. */ - kFLEXIO_TimerStopBitEnableOnTimerCompare = 0x1U, /*!< Stop bit is enabled on timer compare. */ - kFLEXIO_TimerStopBitEnableOnTimerDisable = 0x2U, /*!< Stop bit is enabled on timer disable. */ - kFLEXIO_TimerStopBitEnableOnTimerCompareDisable = 0x3U, /*!< Stop bit is enabled on timer compare and timer - disable. */ -} flexio_timer_stop_bit_condition_t; - -/*! @brief Define type of timer start bit generate condition.*/ -typedef enum _flexio_timer_start_bit_condition -{ - kFLEXIO_TimerStartBitDisabled = 0x0U, /*!< Start bit disabled. */ - kFLEXIO_TimerStartBitEnabled = 0x1U, /*!< Start bit enabled. */ -} flexio_timer_start_bit_condition_t; - -/*! @brief FlexIO as PWM channel output state */ -typedef enum _flexio_timer_output_state -{ - kFLEXIO_PwmLow = 0, /*!< The output state of PWM channel is low */ - kFLEXIO_PwmHigh, /*!< The output state of PWM channel is high */ -} flexio_timer_output_state_t; - -/*! @brief Define type of timer polarity for shifter control. */ -typedef enum _flexio_shifter_timer_polarity -{ - kFLEXIO_ShifterTimerPolarityOnPositive = 0x0U, /*!< Shift on positive edge of shift clock. */ - kFLEXIO_ShifterTimerPolarityOnNegitive = 0x1U, /*!< Shift on negative edge of shift clock. */ -} flexio_shifter_timer_polarity_t; - -/*! @brief Define type of shifter working mode.*/ -typedef enum _flexio_shifter_mode -{ - kFLEXIO_ShifterDisabled = 0x0U, /*!< Shifter is disabled. */ - kFLEXIO_ShifterModeReceive = 0x1U, /*!< Receive mode. */ - kFLEXIO_ShifterModeTransmit = 0x2U, /*!< Transmit mode. */ - kFLEXIO_ShifterModeMatchStore = 0x4U, /*!< Match store mode. */ - kFLEXIO_ShifterModeMatchContinuous = 0x5U, /*!< Match continuous mode. */ -#if FSL_FEATURE_FLEXIO_HAS_STATE_MODE - kFLEXIO_ShifterModeState = 0x6U, /*!< SHIFTBUF contents are used for storing - programmable state attributes. */ -#endif /* FSL_FEATURE_FLEXIO_HAS_STATE_MODE */ -#if FSL_FEATURE_FLEXIO_HAS_LOGIC_MODE - kFLEXIO_ShifterModeLogic = 0x7U, /*!< SHIFTBUF contents are used for implementing - programmable logic look up table. */ -#endif /* FSL_FEATURE_FLEXIO_HAS_LOGIC_MODE */ -} flexio_shifter_mode_t; - -/*! @brief Define type of shifter input source.*/ -typedef enum _flexio_shifter_input_source -{ - kFLEXIO_ShifterInputFromPin = 0x0U, /*!< Shifter input from pin. */ - kFLEXIO_ShifterInputFromNextShifterOutput = 0x1U, /*!< Shifter input from Shifter N+1. */ -} flexio_shifter_input_source_t; - -/*! @brief Define of STOP bit configuration.*/ -typedef enum _flexio_shifter_stop_bit -{ - kFLEXIO_ShifterStopBitDisable = 0x0U, /*!< Disable shifter stop bit. */ - kFLEXIO_ShifterStopBitLow = 0x2U, /*!< Set shifter stop bit to logic low level. */ - kFLEXIO_ShifterStopBitHigh = 0x3U, /*!< Set shifter stop bit to logic high level. */ -} flexio_shifter_stop_bit_t; - -/*! @brief Define type of START bit configuration.*/ -typedef enum _flexio_shifter_start_bit -{ - kFLEXIO_ShifterStartBitDisabledLoadDataOnEnable = 0x0U, /*!< Disable shifter start bit, transmitter loads - data on enable. */ - kFLEXIO_ShifterStartBitDisabledLoadDataOnShift = 0x1U, /*!< Disable shifter start bit, transmitter loads - data on first shift. */ - kFLEXIO_ShifterStartBitLow = 0x2U, /*!< Set shifter start bit to logic low level. */ - kFLEXIO_ShifterStartBitHigh = 0x3U, /*!< Set shifter start bit to logic high level. */ -} flexio_shifter_start_bit_t; - -/*! @brief Define FlexIO shifter buffer type*/ -typedef enum _flexio_shifter_buffer_type -{ - kFLEXIO_ShifterBuffer = 0x0U, /*!< Shifter Buffer N Register. */ - kFLEXIO_ShifterBufferBitSwapped = 0x1U, /*!< Shifter Buffer N Bit Byte Swapped Register. */ - kFLEXIO_ShifterBufferByteSwapped = 0x2U, /*!< Shifter Buffer N Byte Swapped Register. */ - kFLEXIO_ShifterBufferBitByteSwapped = 0x3U, /*!< Shifter Buffer N Bit Swapped Register. */ -#if defined(FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_BYTE_SWAP) && FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_BYTE_SWAP - kFLEXIO_ShifterBufferNibbleByteSwapped = 0x4U, /*!< Shifter Buffer N Nibble Byte Swapped Register. */ -#endif /*FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_BYTE_SWAP*/ -#if defined(FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_HALF_WORD_SWAP) && FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_HALF_WORD_SWAP - kFLEXIO_ShifterBufferHalfWordSwapped = 0x5U, /*!< Shifter Buffer N Half Word Swapped Register. */ -#endif -#if defined(FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_SWAP) && FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_SWAP - kFLEXIO_ShifterBufferNibbleSwapped = 0x6U, /*!< Shifter Buffer N Nibble Swapped Register. */ -#endif -} flexio_shifter_buffer_type_t; - -/*! @brief Define FlexIO user configuration structure. */ -typedef struct _flexio_config_ -{ - bool enableFlexio; /*!< Enable/disable FlexIO module */ - bool enableInDoze; /*!< Enable/disable FlexIO operation in doze mode */ - bool enableInDebug; /*!< Enable/disable FlexIO operation in debug mode */ - bool enableFastAccess; /*!< Enable/disable fast access to FlexIO registers, fast access requires - the FlexIO clock to be at least twice the frequency of the bus clock. */ -} flexio_config_t; - -/*! @brief Define FlexIO timer configuration structure. */ -typedef struct _flexio_timer_config -{ - /* Trigger. */ - uint32_t triggerSelect; /*!< The internal trigger selection number using MACROs. */ - flexio_timer_trigger_polarity_t triggerPolarity; /*!< Trigger Polarity. */ - flexio_timer_trigger_source_t triggerSource; /*!< Trigger Source, internal (see 'trgsel') or external. */ - /* Pin. */ - flexio_pin_config_t pinConfig; /*!< Timer Pin Configuration. */ - uint32_t pinSelect; /*!< Timer Pin number Select. */ - flexio_pin_polarity_t pinPolarity; /*!< Timer Pin Polarity. */ - /* Timer. */ - flexio_timer_mode_t timerMode; /*!< Timer work Mode. */ - flexio_timer_output_t timerOutput; /*!< Configures the initial state of the Timer Output and - whether it is affected by the Timer reset. */ - flexio_timer_decrement_source_t timerDecrement; /*!< Configures the source of the Timer decrement and the - source of the Shift clock. */ - flexio_timer_reset_condition_t timerReset; /*!< Configures the condition that causes the timer counter - (and optionally the timer output) to be reset. */ - flexio_timer_disable_condition_t timerDisable; /*!< Configures the condition that causes the Timer to be - disabled and stop decrementing. */ - flexio_timer_enable_condition_t timerEnable; /*!< Configures the condition that causes the Timer to be - enabled and start decrementing. */ - flexio_timer_stop_bit_condition_t timerStop; /*!< Timer STOP Bit generation. */ - flexio_timer_start_bit_condition_t timerStart; /*!< Timer STRAT Bit generation. */ - uint32_t timerCompare; /*!< Value for Timer Compare N Register. */ -} flexio_timer_config_t; - -/*! @brief Define FlexIO shifter configuration structure. */ -typedef struct _flexio_shifter_config -{ - /* Timer. */ - uint32_t timerSelect; /*!< Selects which Timer is used for controlling the - logic/shift register and generating the Shift clock. */ - flexio_shifter_timer_polarity_t timerPolarity; /*!< Timer Polarity. */ - /* Pin. */ - flexio_pin_config_t pinConfig; /*!< Shifter Pin Configuration. */ - uint32_t pinSelect; /*!< Shifter Pin number Select. */ - flexio_pin_polarity_t pinPolarity; /*!< Shifter Pin Polarity. */ - /* Shifter. */ - flexio_shifter_mode_t shifterMode; /*!< Configures the mode of the Shifter. */ -#if FSL_FEATURE_FLEXIO_HAS_PARALLEL_WIDTH - uint32_t parallelWidth; /*!< Configures the parallel width when using parallel mode.*/ -#endif /* FSL_FEATURE_FLEXIO_HAS_PARALLEL_WIDTH */ - flexio_shifter_input_source_t inputSource; /*!< Selects the input source for the shifter. */ - flexio_shifter_stop_bit_t shifterStop; /*!< Shifter STOP bit. */ - flexio_shifter_start_bit_t shifterStart; /*!< Shifter START bit. */ -} flexio_shifter_config_t; - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER) && FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER -/*! @brief FLEXIO gpio direction definition */ -typedef enum _flexio_gpio_direction -{ - kFLEXIO_DigitalInput = 0U, /*!< Set current pin as digital input*/ - kFLEXIO_DigitalOutput = 1U, /*!< Set current pin as digital output*/ -} flexio_gpio_direction_t; - -/*! @brief FLEXIO gpio input config */ -typedef enum _flexio_pin_input_config -{ - kFLEXIO_InputInterruptDisabled = 0x0U, /*!< Interrupt request is disabled. */ - kFLEXIO_InputInterruptEnable = 0x1U, /*!< Interrupt request is enable. */ - kFLEXIO_FlagRisingEdgeEnable = 0x2U, /*!< Input pin flag on rising edge. */ - kFLEXIO_FlagFallingEdgeEnable = 0x4U, /*!< Input pin flag on falling edge. */ -} flexio_pin_input_config_t; - -/*! - * @brief The FLEXIO pin configuration structure. - * - * Each pin can only be configured as either an output pin or an input pin at a time. - * If configured as an input pin, use inputConfig param. - * If configured as an output pin, use outputLogic. - */ -typedef struct _flexio_gpio_config -{ - flexio_gpio_direction_t pinDirection; /*!< FLEXIO pin direction, input or output */ - uint8_t outputLogic; /*!< Set a default output logic, which has no use in input */ - uint8_t inputConfig; /*!< Set an input config */ -} flexio_gpio_config_t; -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER*/ - -/*! @brief typedef for FlexIO simulated driver interrupt handler.*/ -typedef void (*flexio_isr_t)(void *base, void *handle); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to flexio bases for each instance. */ -extern FLEXIO_Type *const s_flexioBases[]; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to flexio clocks for each instance. */ -extern const clock_ip_name_t s_flexioClocks[]; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus*/ - -/*! - * @name FlexIO Initialization and De-initialization - * @{ - */ - -/*! - * @brief Gets the default configuration to configure the FlexIO module. The configuration - * can used directly to call the FLEXIO_Configure(). - * - * Example: - @code - flexio_config_t config; - FLEXIO_GetDefaultConfig(&config); - @endcode - * - * @param userConfig pointer to flexio_config_t structure -*/ -void FLEXIO_GetDefaultConfig(flexio_config_t *userConfig); - -/*! - * @brief Configures the FlexIO with a FlexIO configuration. The configuration structure - * can be filled by the user or be set with default values by FLEXIO_GetDefaultConfig(). - * - * Example - @code - flexio_config_t config = { - .enableFlexio = true, - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false - }; - FLEXIO_Configure(base, &config); - @endcode - * - * @param base FlexIO peripheral base address - * @param userConfig pointer to flexio_config_t structure -*/ -void FLEXIO_Init(FLEXIO_Type *base, const flexio_config_t *userConfig); - -/*! - * @brief Gates the FlexIO clock. Call this API to stop the FlexIO clock. - * - * @note After calling this API, call the FLEXO_Init to use the FlexIO module. - * - * @param base FlexIO peripheral base address - */ -void FLEXIO_Deinit(FLEXIO_Type *base); - -/*! - * @brief Get instance number for FLEXIO module. - * - * @param base FLEXIO peripheral base address. - */ -uint32_t FLEXIO_GetInstance(FLEXIO_Type *base); - -/*! @} */ - -/*! - * @name FlexIO Basic Operation - * @{ - */ - -/*! - * @brief Resets the FlexIO module. - * - * @param base FlexIO peripheral base address - */ -void FLEXIO_Reset(FLEXIO_Type *base); - -/*! - * @brief Enables the FlexIO module operation. - * - * @param base FlexIO peripheral base address - * @param enable true to enable, false to disable. - */ -static inline void FLEXIO_Enable(FLEXIO_Type *base, bool enable) -{ - if (enable) - { - base->CTRL |= FLEXIO_CTRL_FLEXEN_MASK; - } - else - { - base->CTRL &= ~FLEXIO_CTRL_FLEXEN_MASK; - } -} - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_STATUS) && FSL_FEATURE_FLEXIO_HAS_PIN_STATUS -/*! - * @brief Reads the input data on each of the FlexIO pins. - * - * @param base FlexIO peripheral base address - * @return FlexIO pin input data - */ -static inline uint32_t FLEXIO_ReadPinInput(FLEXIO_Type *base) -{ - return base->PIN; -} -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_STATUS*/ - -#if defined(FSL_FEATURE_FLEXIO_HAS_STATE_MODE) && FSL_FEATURE_FLEXIO_HAS_STATE_MODE -/*! - * @brief Gets the current state pointer for state mode use. - * - * @param base FlexIO peripheral base address - * @return current State pointer - */ -static inline uint8_t FLEXIO_GetShifterState(FLEXIO_Type *base) -{ - return ((uint8_t)(base->SHIFTSTATE) & FLEXIO_SHIFTSTATE_STATE_MASK); -} -#endif /*FSL_FEATURE_FLEXIO_HAS_STATE_MODE*/ - -/*! - * @brief Configures the shifter with the shifter configuration. The configuration structure - * covers both the SHIFTCTL and SHIFTCFG registers. To configure the shifter to the proper - * mode, select which timer controls the shifter to shift, whether to generate start bit/stop - * bit, and the polarity of start bit and stop bit. - * - * Example - @code - flexio_shifter_config_t config = { - .timerSelect = 0, - .timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive, - .pinConfig = kFLEXIO_PinConfigOpenDrainOrBidirection, - .pinPolarity = kFLEXIO_PinActiveLow, - .shifterMode = kFLEXIO_ShifterModeTransmit, - .inputSource = kFLEXIO_ShifterInputFromPin, - .shifterStop = kFLEXIO_ShifterStopBitHigh, - .shifterStart = kFLEXIO_ShifterStartBitLow - }; - FLEXIO_SetShifterConfig(base, &config); - @endcode - * - * @param base FlexIO peripheral base address - * @param index Shifter index - * @param shifterConfig Pointer to flexio_shifter_config_t structure -*/ -void FLEXIO_SetShifterConfig(FLEXIO_Type *base, uint8_t index, const flexio_shifter_config_t *shifterConfig); -/*! - * @brief Configures the timer with the timer configuration. The configuration structure - * covers both the TIMCTL and TIMCFG registers. To configure the timer to the proper - * mode, select trigger source for timer and the timer pin output and the timing for timer. - * - * Example - @code - flexio_timer_config_t config = { - .triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(0), - .triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow, - .triggerSource = kFLEXIO_TimerTriggerSourceInternal, - .pinConfig = kFLEXIO_PinConfigOpenDrainOrBidirection, - .pinSelect = 0, - .pinPolarity = kFLEXIO_PinActiveHigh, - .timerMode = kFLEXIO_TimerModeDual8BitBaudBit, - .timerOutput = kFLEXIO_TimerOutputZeroNotAffectedByReset, - .timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput, - .timerReset = kFLEXIO_TimerResetOnTimerPinEqualToTimerOutput, - .timerDisable = kFLEXIO_TimerDisableOnTimerCompare, - .timerEnable = kFLEXIO_TimerEnableOnTriggerHigh, - .timerStop = kFLEXIO_TimerStopBitEnableOnTimerDisable, - .timerStart = kFLEXIO_TimerStartBitEnabled - }; - FLEXIO_SetTimerConfig(base, &config); - @endcode - * - * @param base FlexIO peripheral base address - * @param index Timer index - * @param timerConfig Pointer to the flexio_timer_config_t structure -*/ -void FLEXIO_SetTimerConfig(FLEXIO_Type *base, uint8_t index, const flexio_timer_config_t *timerConfig); - -/*! - * @brief This function set the value of the prescaler on flexio channels - * - * @param base Pointer to the FlexIO simulated peripheral type. - * @param index Timer index - * @param clocksource Set clock value - */ -static inline void FLEXIO_SetClockMode(FLEXIO_Type *base, uint8_t index, flexio_timer_decrement_source_t clocksource) -{ - uint32_t reg = base->TIMCFG[index]; - - reg &= ~FLEXIO_TIMCFG_TIMDEC_MASK; - - reg |= FLEXIO_TIMCFG_TIMDEC(clocksource); - - base->TIMCFG[index] = reg; -} - -/*! @} */ - -/*! - * @name FlexIO Interrupt Operation - * @{ - */ - -/*! - * @brief Enables the shifter status interrupt. The interrupt generates when the corresponding SSF is set. - * - * @param base FlexIO peripheral base address - * @param mask The shifter status mask which can be calculated by (1 << shifter index) - * @note For multiple shifter status interrupt enable, for example, two shifter status enable, can calculate - * the mask by using ((1 << shifter index0) | (1 << shifter index1)) - */ -static inline void FLEXIO_EnableShifterStatusInterrupts(FLEXIO_Type *base, uint32_t mask) -{ - base->SHIFTSIEN |= mask; -} - -/*! - * @brief Disables the shifter status interrupt. The interrupt won't generate when the corresponding SSF is set. - * - * @param base FlexIO peripheral base address - * @param mask The shifter status mask which can be calculated by (1 << shifter index) - * @note For multiple shifter status interrupt enable, for example, two shifter status enable, can calculate - * the mask by using ((1 << shifter index0) | (1 << shifter index1)) - */ -static inline void FLEXIO_DisableShifterStatusInterrupts(FLEXIO_Type *base, uint32_t mask) -{ - base->SHIFTSIEN &= ~mask; -} - -/*! - * @brief Enables the shifter error interrupt. The interrupt generates when the corresponding SEF is set. - * - * @param base FlexIO peripheral base address - * @param mask The shifter error mask which can be calculated by (1 << shifter index) - * @note For multiple shifter error interrupt enable, for example, two shifter error enable, can calculate - * the mask by using ((1 << shifter index0) | (1 << shifter index1)) - */ -static inline void FLEXIO_EnableShifterErrorInterrupts(FLEXIO_Type *base, uint32_t mask) -{ - base->SHIFTEIEN |= mask; -} - -/*! - * @brief Disables the shifter error interrupt. The interrupt won't generate when the corresponding SEF is set. - * - * @param base FlexIO peripheral base address - * @param mask The shifter error mask which can be calculated by (1 << shifter index) - * @note For multiple shifter error interrupt enable, for example, two shifter error enable, can calculate - * the mask by using ((1 << shifter index0) | (1 << shifter index1)) - */ -static inline void FLEXIO_DisableShifterErrorInterrupts(FLEXIO_Type *base, uint32_t mask) -{ - base->SHIFTEIEN &= ~mask; -} - -/*! - * @brief Enables the timer status interrupt. The interrupt generates when the corresponding SSF is set. - * - * @param base FlexIO peripheral base address - * @param mask The timer status mask which can be calculated by (1 << timer index) - * @note For multiple timer status interrupt enable, for example, two timer status enable, can calculate - * the mask by using ((1 << timer index0) | (1 << timer index1)) - */ -static inline void FLEXIO_EnableTimerStatusInterrupts(FLEXIO_Type *base, uint32_t mask) -{ - base->TIMIEN |= mask; -} - -/*! - * @brief Disables the timer status interrupt. The interrupt won't generate when the corresponding SSF is set. - * - * @param base FlexIO peripheral base address - * @param mask The timer status mask which can be calculated by (1 << timer index) - * @note For multiple timer status interrupt enable, for example, two timer status enable, can calculate - * the mask by using ((1 << timer index0) | (1 << timer index1)) - */ -static inline void FLEXIO_DisableTimerStatusInterrupts(FLEXIO_Type *base, uint32_t mask) -{ - base->TIMIEN &= ~mask; -} - -/*! @} */ - -/*! - * @name FlexIO Status Operation - * @{ - */ - -/*! - * @brief Gets the shifter status flags. - * - * @param base FlexIO peripheral base address - * @return Shifter status flags - */ -static inline uint32_t FLEXIO_GetShifterStatusFlags(FLEXIO_Type *base) -{ - return ((base->SHIFTSTAT) & FLEXIO_SHIFTSTAT_SSF_MASK); -} - -/*! - * @brief Clears the shifter status flags. - * - * @param base FlexIO peripheral base address - * @param mask The shifter status mask which can be calculated by (1 << shifter index) - * @note For clearing multiple shifter status flags, for example, two shifter status flags, can calculate - * the mask by using ((1 << shifter index0) | (1 << shifter index1)) - */ -static inline void FLEXIO_ClearShifterStatusFlags(FLEXIO_Type *base, uint32_t mask) -{ - base->SHIFTSTAT = mask; -} - -/*! - * @brief Gets the shifter error flags. - * - * @param base FlexIO peripheral base address - * @return Shifter error flags - */ -static inline uint32_t FLEXIO_GetShifterErrorFlags(FLEXIO_Type *base) -{ - return ((base->SHIFTERR) & FLEXIO_SHIFTERR_SEF_MASK); -} - -/*! - * @brief Clears the shifter error flags. - * - * @param base FlexIO peripheral base address - * @param mask The shifter error mask which can be calculated by (1 << shifter index) - * @note For clearing multiple shifter error flags, for example, two shifter error flags, can calculate - * the mask by using ((1 << shifter index0) | (1 << shifter index1)) - */ -static inline void FLEXIO_ClearShifterErrorFlags(FLEXIO_Type *base, uint32_t mask) -{ - base->SHIFTERR = mask; -} - -/*! - * @brief Gets the timer status flags. - * - * @param base FlexIO peripheral base address - * @return Timer status flags - */ -static inline uint32_t FLEXIO_GetTimerStatusFlags(FLEXIO_Type *base) -{ - return ((base->TIMSTAT) & FLEXIO_TIMSTAT_TSF_MASK); -} - -/*! - * @brief Clears the timer status flags. - * - * @param base FlexIO peripheral base address - * @param mask The timer status mask which can be calculated by (1 << timer index) - * @note For clearing multiple timer status flags, for example, two timer status flags, can calculate - * the mask by using ((1 << timer index0) | (1 << timer index1)) - */ -static inline void FLEXIO_ClearTimerStatusFlags(FLEXIO_Type *base, uint32_t mask) -{ - base->TIMSTAT = mask; -} - -/*! @} */ - -/*! - * @name FlexIO DMA Operation - * @{ - */ - -/*! - * @brief Enables/disables the shifter status DMA. The DMA request generates when the corresponding SSF is set. - * - * @note For multiple shifter status DMA enables, for example, calculate - * the mask by using ((1 << shifter index0) | (1 << shifter index1)) - * - * @param base FlexIO peripheral base address - * @param mask The shifter status mask which can be calculated by (1 << shifter index) - * @param enable True to enable, false to disable. - */ -static inline void FLEXIO_EnableShifterStatusDMA(FLEXIO_Type *base, uint32_t mask, bool enable) -{ - if (enable) - { - base->SHIFTSDEN |= mask; - } - else - { - base->SHIFTSDEN &= ~mask; - } -} - -/*! - * @brief Gets the shifter buffer address for the DMA transfer usage. - * - * @param base FlexIO peripheral base address - * @param type Shifter type of flexio_shifter_buffer_type_t - * @param index Shifter index - * @return Corresponding shifter buffer index - */ -uint32_t FLEXIO_GetShifterBufferAddress(FLEXIO_Type *base, flexio_shifter_buffer_type_t type, uint8_t index); - -/*! - * @brief Registers the handle and the interrupt handler for the FlexIO-simulated peripheral. - * - * @param base Pointer to the FlexIO simulated peripheral type. - * @param handle Pointer to the handler for FlexIO simulated peripheral. - * @param isr FlexIO simulated peripheral interrupt handler. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_RegisterHandleIRQ(void *base, void *handle, flexio_isr_t isr); - -/*! - * @brief Unregisters the handle and the interrupt handler for the FlexIO-simulated peripheral. - * - * @param base Pointer to the FlexIO simulated peripheral type. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_UnregisterHandleIRQ(void *base); -/*! @} */ - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER) && FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER - -/*! - * @brief Configure a FLEXIO pin used by the board. - * - * To Config the FLEXIO PIN, define a pin configuration, as either input or output, in the user file. - * Then, call the FLEXIO_SetPinConfig() function. - * - * This is an example to define an input pin or an output pin configuration. - * @code - * Define a digital input pin configuration, - * flexio_gpio_config_t config = - * { - * kFLEXIO_DigitalInput, - * 0U, - * kFLEXIO_FlagRisingEdgeEnable | kFLEXIO_InputInterruptEnable, - * } - * Define a digital output pin configuration, - * flexio_gpio_config_t config = - * { - * kFLEXIO_DigitalOutput, - * 0U, - * 0U - * } - * @endcode - * @param base FlexIO peripheral base address - * @param pin FLEXIO pin number. - * @param config FLEXIO pin configuration pointer. - */ -void FLEXIO_SetPinConfig(FLEXIO_Type *base, uint32_t pin, flexio_gpio_config_t *config); - -/*! - * @name GPIO Output Operations - * @{ - */ - -/*! - * @brief Sets the output level of the multiple FLEXIO pins to the logic 0. - * - * @param base FlexIO peripheral base address - * @param mask FLEXIO pin number mask - */ -static inline void FLEXIO_ClearPortOutput(FLEXIO_Type *base, uint32_t mask) -{ - base->PINOUTCLR = mask; -} - -/*! - * @brief Sets the output level of the multiple FLEXIO pins to the logic 1. - * - * @param base FlexIO peripheral base address - * @param mask FLEXIO pin number mask - */ -static inline void FLEXIO_SetPortOutput(FLEXIO_Type *base, uint32_t mask) -{ - base->PINOUTSET = mask; -} - -/*! - * @brief Reverses the current output logic of the multiple FLEXIO pins. - * - * @param base FlexIO peripheral base address - * @param mask FLEXIO pin number mask - */ -static inline void FLEXIO_TogglePortOutput(FLEXIO_Type *base, uint32_t mask) -{ - base->PINOUTTOG = mask; -} - -/*! - * @brief Sets the output level of the FLEXIO pins to the logic 1 or 0. - * - * @param base FlexIO peripheral base address - * @param pin FLEXIO pin number. - * @param output FLEXIO pin output logic level. - * - 0: corresponding pin output low-logic level. - * - 1: corresponding pin output high-logic level. - */ -static inline void FLEXIO_PinWrite(FLEXIO_Type *base, uint32_t pin, uint8_t output) -{ - if (output == 0U) - { - FLEXIO_ClearPortOutput(base, 1UL << pin); - } - else - { - FLEXIO_SetPortOutput(base, 1UL << pin); - } -} - -/*! - * @brief Enables the FLEXIO output pin function. - * - * @param base FlexIO peripheral base address - * @param pin FLEXIO pin number. - */ -static inline void FLEXIO_EnablePinOutput(FLEXIO_Type *base, uint32_t pin) -{ - base->PINOUTE |= (1UL << pin); -} -/*! @} */ - -/*! - * @name FLEXIO PIN Input Operations - * @{ - */ - -/*! - * @brief Reads the current input value of the FLEXIO pin. - * - * @param base FlexIO peripheral base address - * @param pin FLEXIO pin number. - * @retval FLEXIO port input value - * - 0: corresponding pin input low-logic level. - * - 1: corresponding pin input high-logic level. - */ -static inline uint32_t FLEXIO_PinRead(FLEXIO_Type *base, uint32_t pin) -{ - return (((base->PIN) >> pin) & 0x01U); -} - -/*! - * @brief Gets the FLEXIO input pin status. - * - * @param base FlexIO peripheral base address - * @param pin FLEXIO pin number. - * @retval FLEXIO port input status - * - 0: corresponding pin input capture no status. - * - 1: corresponding pin input capture rising or falling edge. - */ -static inline uint32_t FLEXIO_GetPinStatus(FLEXIO_Type *base, uint32_t pin) -{ - return (((base->PINSTAT) >> pin) & 0x01U); -} - -/*! - * @brief Clears the multiple FLEXIO input pins status. - * - * @param base FlexIO peripheral base address - * @param mask FLEXIO pin number mask - */ -static inline void FLEXIO_ClearPortStatus(FLEXIO_Type *base, uint32_t mask) -{ - base->PINSTAT = mask; -} -/*! @} */ - -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER*/ - -#if defined(__cplusplus) -} -#endif /*_cplusplus*/ -/*! @} */ - -#endif /*FSL_FLEXIO_H_*/ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_i2c_master.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_i2c_master.c deleted file mode 100644 index 9239527c6fa..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_i2c_master.c +++ /dev/null @@ -1,1377 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio_i2c_master.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio_i2c_master" -#endif - -/*! @brief FLEXIO I2C transfer state */ -enum _flexio_i2c_master_transfer_states -{ - kFLEXIO_I2C_Idle = 0x0U, /*!< I2C bus idle */ - kFLEXIO_I2C_Start = 0x1U, /*!< I2C start phase */ - kFLEXIO_I2C_SendCommand = 0x2U, /*!< Send command byte phase */ - kFLEXIO_I2C_SendData = 0x3U, /*!< Send data transfer phase*/ - kFLEXIO_I2C_ReceiveDataBegin = 0x4U, /*!< Receive data begin transfer phase*/ - kFLEXIO_I2C_ReceiveData = 0x5U, /*!< Receive data transfer phase*/ -}; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Set up master transfer, send slave address and decide the initial - * transfer state. - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param transfer pointer to flexio_i2c_master_transfer_t structure - */ -static status_t FLEXIO_I2C_MasterTransferInitStateMachine(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - flexio_i2c_master_transfer_t *xfer); - -/*! - * @brief Master run transfer state machine to perform a byte of transfer. - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param statusFlags flexio i2c hardware status - * @retval kStatus_Success Successfully run state machine - * @retval kStatus_FLEXIO_I2C_Nak Receive Nak during transfer - */ -static status_t FLEXIO_I2C_MasterTransferRunStateMachine(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags); - -/*! - * @brief Complete transfer, disable interrupt and call callback. - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param status flexio transfer status - */ -static void FLEXIO_I2C_MasterTransferComplete(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - status_t status); - -/*! - * @brief introduce function FLEXIO_I2C_MasterTransferStateMachineStart. - * This function was deal with Initial state, i2c start state. - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - */ -static void FLEXIO_I2C_MasterTransferStateMachineStart(FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle); - -/*! - * @brief introduce function FLEXIO_I2C_MasterTransferStateMachineSendCommand. - * This function was deal with Check address only needed for transfer with subaddress . - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param statusFlags flexio i2c hardware status - * - * @return default is true when No abnormality. - * @return false when time out. - */ -static bool FLEXIO_I2C_MasterTransferStateMachineSendCommand(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags); - -/*! - * @brief introduce function FLEXIO_I2C_MasterTransferStateMachineSendData. - * This function was deal with Send command byte. - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param statusFlags flexio i2c hardware status - * - * @return default is true when No abnormality. - * @return false when time out. - */ -static bool FLEXIO_I2C_MasterTransferStateMachineSendData(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags); - -/*! - * @brief introduce function FLEXIO_I2C_MasterTransferStateMachineReceiveDataBegin. - * This function was deal with Receive Data Begin. - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param statusFlags flexio i2c hardware status - * - * @return default is true when No abnormality. - * @return false when time out. - */ -static bool FLEXIO_I2C_MasterTransferStateMachineReceiveDataBegin(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags); - -/*! - * @brief introduce function Case_kFLEXIO_I2C_ReceiveDataBegin. - * This function was deal with Receive Data. - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param statusFlags flexio i2c hardware status - * - * @return default is kStatus_Success when No abnormality. - * @return kStatus_FLEXIO_I2C_Nak when ReceiveNakFlag is not set. - * @return kStatus_FLEXIO_I2C_Timeout when time out. - */ -static status_t FLEXIO_I2C_MasterTransferStateMachineReceiveData(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags); - -/******************************************************************************* - * Codes - ******************************************************************************/ - -static uint32_t FLEXIO_I2C_GetInstance(FLEXIO_I2C_Type *base) -{ - return FLEXIO_GetInstance(base->flexioBase); -} - -static status_t FLEXIO_I2C_MasterTransferInitStateMachine(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - flexio_i2c_master_transfer_t *xfer) -{ - bool needRestart; - uint32_t byteCount; - - /* Init the handle member. */ - handle->transfer.slaveAddress = xfer->slaveAddress; - handle->transfer.direction = xfer->direction; - handle->transfer.subaddress = xfer->subaddress; - handle->transfer.subaddressSize = xfer->subaddressSize; - handle->transfer.data = xfer->data; - handle->transfer.dataSize = xfer->dataSize; - handle->transfer.flags = xfer->flags; - handle->transferSize = xfer->dataSize; - - /* Initial state, i2c start state. */ - handle->state = (uint8_t)kFLEXIO_I2C_Start; - - /* Clear all status before transfer. */ - FLEXIO_I2C_MasterClearStatusFlags(base, (uint32_t)kFLEXIO_I2C_ReceiveNakFlag); - - /* Calculate whether need to send re-start. */ - needRestart = (handle->transfer.subaddressSize != 0U) && (handle->transfer.direction == kFLEXIO_I2C_Read); - handle->needRestart = needRestart; - - /* Calculate total byte count in a frame. */ - byteCount = 1U; - - if (!needRestart) - { - byteCount += handle->transfer.dataSize; - } - - if (handle->transfer.subaddressSize != 0U) - { - byteCount += handle->transfer.subaddressSize; - } - - /* Configure data count. */ - if (FLEXIO_I2C_MasterSetTransferCount(base, (uint16_t)byteCount) != kStatus_Success) - { - return kStatus_InvalidArgument; - } - - /* Configure timer1 disable condition. */ - uint32_t tmpConfig = base->flexioBase->TIMCFG[base->timerIndex[1]]; - tmpConfig &= ~FLEXIO_TIMCFG_TIMDIS_MASK; - tmpConfig |= FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnPreTimerDisable); - base->flexioBase->TIMCFG[base->timerIndex[1]] = tmpConfig; - -#if I2C_RETRY_TIMES - uint32_t waitTimes = I2C_RETRY_TIMES; - while ((0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return kStatus_FLEXIO_I2C_Timeout; - } -#else - while (0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) - { - } -#endif - - return kStatus_Success; -} - -static void FLEXIO_I2C_MasterTransferStateMachineStart(FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle) -{ - if (handle->needRestart) - { - FLEXIO_I2C_MasterStart(base, handle->transfer.slaveAddress, kFLEXIO_I2C_Write); - } - else - { - FLEXIO_I2C_MasterStart(base, handle->transfer.slaveAddress, handle->transfer.direction); - } - if (handle->transfer.subaddressSize == 0U) - { - if (handle->transfer.direction == kFLEXIO_I2C_Write) - { - /* Next state, send data. */ - handle->state = (uint8_t)kFLEXIO_I2C_SendData; - } - else - { - /* Next state, receive data begin. */ - handle->state = (uint8_t)kFLEXIO_I2C_ReceiveDataBegin; - } - } - else - { - /* Next state, send command byte. */ - handle->state = (uint8_t)kFLEXIO_I2C_SendCommand; - } -} - -static bool FLEXIO_I2C_MasterTransferStateMachineSendCommand(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags) -{ - if ((statusFlags & (uint32_t)kFLEXIO_I2C_TxEmptyFlag) != 0U) - { - if (handle->transfer.subaddressSize > 0U) - { - handle->transfer.subaddressSize--; - FLEXIO_I2C_MasterWriteByte(base, ((handle->transfer.subaddress) >> (8U * handle->transfer.subaddressSize))); - - if (handle->transfer.subaddressSize == 0U) - { - /* Load re-start in advance. */ - if (handle->transfer.direction == kFLEXIO_I2C_Read) - { -#if I2C_RETRY_TIMES - while ((0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return false; - } -#else - while (0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) - { - } -#endif - FLEXIO_I2C_MasterRepeatedStart(base); - } - } - } - else - { - if (handle->transfer.direction == kFLEXIO_I2C_Write) - { - /* Send first byte of data. */ - if (handle->transfer.dataSize > 0U) - { - /* Next state, send data. */ - handle->state = (uint8_t)kFLEXIO_I2C_SendData; - - FLEXIO_I2C_MasterWriteByte(base, *handle->transfer.data); - handle->transfer.data++; - handle->transfer.dataSize--; - } - else - { - FLEXIO_I2C_MasterStop(base); - -#if I2C_RETRY_TIMES - while ((0U == (FLEXIO_I2C_MasterGetStatusFlags(base) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return false; - } -#else - while (0U == (FLEXIO_I2C_MasterGetStatusFlags(base) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) - { - } -#endif - (void)FLEXIO_I2C_MasterReadByte(base); - - handle->state = (uint8_t)kFLEXIO_I2C_Idle; - } - } - else - { - (void)FLEXIO_I2C_MasterSetTransferCount(base, (uint16_t)(handle->transfer.dataSize + 1U)); - /* Delay at least one clock cycle so that the restart setup time is up to spec standard. */ - SDK_DelayAtLeastUs(1000000UL / base->baudrate, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY); - FLEXIO_I2C_MasterStart(base, handle->transfer.slaveAddress, kFLEXIO_I2C_Read); - - /* Next state, receive data begin. */ - handle->state = (uint8_t)kFLEXIO_I2C_ReceiveDataBegin; - } - } - } - return true; -} - -static bool FLEXIO_I2C_MasterTransferStateMachineSendData(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags) -{ - if ((statusFlags & (uint32_t)kFLEXIO_I2C_TxEmptyFlag) != 0U) - { - /* Send one byte of data. */ - if (handle->transfer.dataSize > 0U) - { - FLEXIO_I2C_MasterWriteByte(base, *handle->transfer.data); - - handle->transfer.data++; - handle->transfer.dataSize--; - } - else - { - FLEXIO_I2C_MasterStop(base); - -#if I2C_RETRY_TIMES - while ((0U == (FLEXIO_I2C_MasterGetStatusFlags(base) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return false; - } -#else - while (0U == (FLEXIO_I2C_MasterGetStatusFlags(base) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) - { - } -#endif - (void)FLEXIO_I2C_MasterReadByte(base); - - handle->state = (uint8_t)kFLEXIO_I2C_Idle; - } - } - return true; -} - -static bool FLEXIO_I2C_MasterTransferStateMachineReceiveDataBegin(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags) -{ - if ((statusFlags & (uint32_t)kFLEXIO_I2C_RxFullFlag) != 0U) - { - handle->state = (uint8_t)kFLEXIO_I2C_ReceiveData; - /* Send nak at the last receive byte. */ - if (handle->transfer.dataSize == 1U) - { - FLEXIO_I2C_MasterEnableAck(base, false); -#if I2C_RETRY_TIMES - while ((0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return false; - } -#else - while (0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) - { - } -#endif - FLEXIO_I2C_MasterStop(base); - } - else - { - FLEXIO_I2C_MasterEnableAck(base, true); - } - } - else if ((statusFlags & (uint32_t)kFLEXIO_I2C_TxEmptyFlag) != 0U) - { - /* Read one byte of data. */ - FLEXIO_I2C_MasterWriteByte(base, 0xFFFFFFFFU); - } - else - { - ; /* Avoid MISRA 2012 rule 15.7 */ - } - return true; -} - -static status_t FLEXIO_I2C_MasterTransferStateMachineReceiveData(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags) -{ - if ((statusFlags & (uint32_t)kFLEXIO_I2C_RxFullFlag) != 0U) - { - *handle->transfer.data = FLEXIO_I2C_MasterReadByte(base); - handle->transfer.data++; - if (0U != handle->transfer.dataSize--) - { - if (handle->transfer.dataSize == 0U) - { - FLEXIO_I2C_MasterDisableInterrupts(base, (uint32_t)kFLEXIO_I2C_RxFullInterruptEnable); - handle->state = (uint8_t)kFLEXIO_I2C_Idle; - /* Return nak if ReceiveNakFlag is not set */ - if ((statusFlags & (uint32_t)kFLEXIO_I2C_ReceiveNakFlag) == 0U) - { - return kStatus_FLEXIO_I2C_Nak; - } - } - - /* Send nak at the last receive byte. */ - if (handle->transfer.dataSize == 1U) - { - FLEXIO_I2C_MasterEnableAck(base, false); -#if I2C_RETRY_TIMES - while ((0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return kStatus_FLEXIO_I2C_Timeout; - } -#else - while (0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) - { - } -#endif - FLEXIO_I2C_MasterStop(base); - } - } - } - else if ((statusFlags & (uint32_t)kFLEXIO_I2C_TxEmptyFlag) != 0U) - { - if (handle->transfer.dataSize > 1U) - { - FLEXIO_I2C_MasterWriteByte(base, 0xFFFFFFFFU); - } - } - else - { - ; /* Avoid MISRA 2012 rule 15.7 */ - } - return kStatus_Success; -} - -static status_t FLEXIO_I2C_MasterTransferRunStateMachine(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags) -{ - status_t status; -#if I2C_RETRY_TIMES - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - - if ((statusFlags & (uint32_t)kFLEXIO_I2C_ReceiveNakFlag) != 0U) - { - /* Clear receive nak flag. */ - FLEXIO_ClearShifterErrorFlags(base->flexioBase, 1UL << base->shifterIndex[1]); - - if ((!((handle->state == (uint8_t)kFLEXIO_I2C_SendData) && (handle->transfer.dataSize == 0U))) && - (!(((handle->state == (uint8_t)kFLEXIO_I2C_ReceiveData) || - (handle->state == (uint8_t)kFLEXIO_I2C_ReceiveDataBegin)) && - (handle->transfer.dataSize == 1U)))) - { - (void)FLEXIO_I2C_MasterReadByte(base); - - FLEXIO_I2C_MasterAbortStop(base); - - /* Delay one clk cycle to ensure the bus is idle. */ - SDK_DelayAtLeastUs(1000000UL / base->baudrate, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY); - - handle->state = (uint8_t)kFLEXIO_I2C_Idle; - - return kStatus_FLEXIO_I2C_Nak; - } - } - - if (((statusFlags & (uint8_t)kFLEXIO_I2C_RxFullFlag) != 0U) && (handle->state != (uint8_t)kFLEXIO_I2C_ReceiveData)) - { - (void)FLEXIO_I2C_MasterReadByte(base); - } - - switch (handle->state) - { - /* Initial state, i2c start state. */ - case (uint8_t)kFLEXIO_I2C_Start: - /* Send address byte first. */ - FLEXIO_I2C_MasterTransferStateMachineStart(base, handle); - break; - - /* Check address only needed for transfer with subaddress */ - case (uint8_t)kFLEXIO_I2C_SendCommand: - if (false == FLEXIO_I2C_MasterTransferStateMachineSendCommand(base, handle, statusFlags)) - { - return kStatus_FLEXIO_I2C_Timeout; - } - break; - - /* Send command byte. */ - case (uint8_t)kFLEXIO_I2C_SendData: - if (false == FLEXIO_I2C_MasterTransferStateMachineSendData(base, handle, statusFlags)) - { - return kStatus_FLEXIO_I2C_Timeout; - } - break; - - case (uint8_t)kFLEXIO_I2C_ReceiveDataBegin: - if (false == FLEXIO_I2C_MasterTransferStateMachineReceiveDataBegin(base, handle, statusFlags)) - { - return kStatus_FLEXIO_I2C_Timeout; - } - break; - - case (uint8_t)kFLEXIO_I2C_ReceiveData: - status = FLEXIO_I2C_MasterTransferStateMachineReceiveData(base, handle, statusFlags); - if (kStatus_Success != status) - { - return status; - } - break; - - default: - /* Add comment to avoid MISRA violation */ - break; - } - - return kStatus_Success; -} - -static void FLEXIO_I2C_MasterTransferComplete(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - status_t status) -{ - FLEXIO_I2C_MasterDisableInterrupts( - base, (uint32_t)kFLEXIO_I2C_TxEmptyInterruptEnable | (uint32_t)kFLEXIO_I2C_RxFullInterruptEnable); - - if (handle->completionCallback != NULL) - { - handle->completionCallback(base, handle, status, handle->userData); - } -} - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_STATUS) && FSL_FEATURE_FLEXIO_HAS_PIN_STATUS -/*! - * brief Make sure the bus isn't already pulled down. - * - * Check the FLEXIO pin status to see whether either of SDA and SCL pin is pulled down. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * retval kStatus_Success - * retval kStatus_FLEXIO_I2C_Busy - */ -status_t FLEXIO_I2C_CheckForBusyBus(FLEXIO_I2C_Type *base) -{ - uint32_t mask; - /* If in certain loops the SDA/SCL is continuously pulled down, then return bus busy status. */ - /* The loop count is determined by maximum CPU clock frequency */ - for (uint32_t i = 0U; i < SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY / 600000U; ++i) - { - mask = 1UL << base->SDAPinIndex | 1UL << base->SCLPinIndex; - if ((FLEXIO_ReadPinInput(base->flexioBase) & mask) == mask) - { - return kStatus_Success; - } - } - return kStatus_FLEXIO_I2C_Busy; -} -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_STATUS*/ - -/*! - * brief Ungates the FlexIO clock, resets the FlexIO module, and configures the FlexIO I2C - * hardware configuration. - * - * Example - code - FLEXIO_I2C_Type base = { - .flexioBase = FLEXIO, - .SDAPinIndex = 0, - .SCLPinIndex = 1, - .shifterIndex = {0,1}, - .timerIndex = {0,1} - }; - flexio_i2c_master_config_t config = { - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .baudRate_Bps = 100000 - }; - FLEXIO_I2C_MasterInit(base, &config, srcClock_Hz); - endcode - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param masterConfig Pointer to flexio_i2c_master_config_t structure. - * param srcClock_Hz FlexIO source clock in Hz. - * retval kStatus_Success Initialization successful - * retval kStatus_InvalidArgument The source clock exceed upper range limitation -*/ -status_t FLEXIO_I2C_MasterInit(FLEXIO_I2C_Type *base, flexio_i2c_master_config_t *masterConfig, uint32_t srcClock_Hz) -{ - assert((base != NULL) && (masterConfig != NULL)); - - flexio_shifter_config_t shifterConfig; - flexio_timer_config_t timerConfig; - uint32_t controlVal = 0; - uint16_t timerDiv = 0; - status_t result = kStatus_Success; - - (void)memset(&shifterConfig, 0, sizeof(shifterConfig)); - (void)memset(&timerConfig, 0, sizeof(timerConfig)); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate flexio clock. */ - CLOCK_EnableClock(s_flexioClocks[FLEXIO_I2C_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Do hardware configuration. */ - /* 1. Configure the shifter 0 for tx. */ - shifterConfig.timerSelect = base->timerIndex[2]; - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive; - shifterConfig.pinConfig = kFLEXIO_PinConfigOpenDrainOrBidirection; - shifterConfig.pinSelect = base->SDAPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveLow; - shifterConfig.shifterMode = kFLEXIO_ShifterModeTransmit; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitHigh; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitLow; - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[0], &shifterConfig); - - /* 2. Configure the shifter 1 for rx. */ - shifterConfig.timerSelect = base->timerIndex[2]; - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnNegitive; - shifterConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - shifterConfig.pinSelect = base->SDAPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveHigh; - shifterConfig.shifterMode = kFLEXIO_ShifterModeReceive; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitLow; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnEnable; - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[1], &shifterConfig); - - /*3. Configure the timer 0 and timer 1 for generating bit clock. */ - /* timer 1 is used to config baudrate */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->shifterIndex[0]); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOpenDrainOrBidirection; - timerConfig.pinSelect = base->SCLPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveHigh; - timerConfig.timerMode = kFLEXIO_TimerModeSingle16Bit; - timerConfig.timerOutput = kFLEXIO_TimerOutputZeroNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput; - timerConfig.timerReset = kFLEXIO_TimerResetOnTimerPinEqualToTimerOutput; - timerConfig.timerDisable = kFLEXIO_TimerDisableOnPreTimerDisable; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnTriggerHigh; - timerConfig.timerStop = kFLEXIO_TimerStopBitDisabled; - timerConfig.timerStart = kFLEXIO_TimerStartBitDisabled; - - /* Set TIMCMP = (baud rate divider / 2) - 1. */ - timerDiv = (uint16_t)(srcClock_Hz / masterConfig->baudRate_Bps) / 2U - 1U; - /* Calculate and assign the actual baudrate. */ - base->baudrate = srcClock_Hz / (2U * ((uint32_t)timerDiv + 1U)); - - timerConfig.timerCompare = timerDiv; - - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[1], &timerConfig); - - /* timer 0 is used to config total shift clock edges */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->shifterIndex[0]); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - timerConfig.pinSelect = base->SCLPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveHigh; - timerConfig.timerMode = kFLEXIO_TimerModeSingle16Bit; - timerConfig.timerOutput = kFLEXIO_TimerOutputOneNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnPinInputShiftPinInput; - timerConfig.timerReset = kFLEXIO_TimerResetNever; - timerConfig.timerDisable = kFLEXIO_TimerDisableOnTimerCompare; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnTriggerHigh; - timerConfig.timerStop = kFLEXIO_TimerStopBitDisabled; - timerConfig.timerStart = kFLEXIO_TimerStartBitDisabled; - - /* Set TIMCMP when confinguring transfer bytes. */ - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[0], &timerConfig); - - /* 4. Configure the timer 2 for controlling shifters. */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->shifterIndex[0]); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - timerConfig.pinSelect = base->SCLPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveLow; - timerConfig.timerMode = kFLEXIO_TimerModeSingle16Bit; - timerConfig.timerOutput = kFLEXIO_TimerOutputOneNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnPinInputShiftPinInput; - timerConfig.timerReset = kFLEXIO_TimerResetNever; - timerConfig.timerDisable = kFLEXIO_TimerDisableOnPreTimerDisable; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnPrevTimerEnable; - timerConfig.timerStop = kFLEXIO_TimerStopBitEnableOnTimerCompare; - timerConfig.timerStart = kFLEXIO_TimerStartBitEnabled; - - /* Set TIMCMP[15:0] = (number of bits x 2) - 1. */ - timerConfig.timerCompare = 8U * 2U - 1U; - - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[2], &timerConfig); - - /* Configure FLEXIO I2C Master. */ - controlVal = base->flexioBase->CTRL; - controlVal &= - ~(FLEXIO_CTRL_DOZEN_MASK | FLEXIO_CTRL_DBGE_MASK | FLEXIO_CTRL_FASTACC_MASK | FLEXIO_CTRL_FLEXEN_MASK); - controlVal |= (FLEXIO_CTRL_DBGE(masterConfig->enableInDebug) | FLEXIO_CTRL_FASTACC(masterConfig->enableFastAccess) | - FLEXIO_CTRL_FLEXEN(masterConfig->enableMaster)); - if (!masterConfig->enableInDoze) - { - controlVal |= FLEXIO_CTRL_DOZEN_MASK; - } - - base->flexioBase->CTRL = controlVal; - /* Disable internal IRQs. */ - FLEXIO_I2C_MasterDisableInterrupts( - base, (uint32_t)kFLEXIO_I2C_TxEmptyInterruptEnable | (uint32_t)kFLEXIO_I2C_RxFullInterruptEnable); - return result; -} - -/*! - * brief De-initializes the FlexIO I2C master peripheral. Calling this API Resets the FlexIO I2C master - * shifer and timer config, module can't work unless the FLEXIO_I2C_MasterInit is called. - * - * param base pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterDeinit(FLEXIO_I2C_Type *base) -{ - base->flexioBase->SHIFTCFG[base->shifterIndex[0]] = 0; - base->flexioBase->SHIFTCTL[base->shifterIndex[0]] = 0; - base->flexioBase->SHIFTCFG[base->shifterIndex[1]] = 0; - base->flexioBase->SHIFTCTL[base->shifterIndex[1]] = 0; - base->flexioBase->TIMCFG[base->timerIndex[0]] = 0; - base->flexioBase->TIMCMP[base->timerIndex[0]] = 0; - base->flexioBase->TIMCTL[base->timerIndex[0]] = 0; - base->flexioBase->TIMCFG[base->timerIndex[1]] = 0; - base->flexioBase->TIMCMP[base->timerIndex[1]] = 0; - base->flexioBase->TIMCTL[base->timerIndex[1]] = 0; - base->flexioBase->TIMCFG[base->timerIndex[2]] = 0; - base->flexioBase->TIMCMP[base->timerIndex[2]] = 0; - base->flexioBase->TIMCTL[base->timerIndex[2]] = 0; - /* Clear the shifter flag. */ - base->flexioBase->SHIFTSTAT = (1UL << base->shifterIndex[0]); - base->flexioBase->SHIFTSTAT = (1UL << base->shifterIndex[1]); - /* Clear the timer flag. */ - base->flexioBase->TIMSTAT = (1UL << base->timerIndex[0]); - base->flexioBase->TIMSTAT = (1UL << base->timerIndex[1]); - base->flexioBase->TIMSTAT = (1UL << base->timerIndex[2]); -} - -/*! - * brief Gets the default configuration to configure the FlexIO module. The configuration - * can be used directly for calling the FLEXIO_I2C_MasterInit(). - * - * Example: - code - flexio_i2c_master_config_t config; - FLEXIO_I2C_MasterGetDefaultConfig(&config); - endcode - * param masterConfig Pointer to flexio_i2c_master_config_t structure. -*/ -void FLEXIO_I2C_MasterGetDefaultConfig(flexio_i2c_master_config_t *masterConfig) -{ - assert(masterConfig != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(masterConfig, 0, sizeof(*masterConfig)); - - masterConfig->enableMaster = true; - masterConfig->enableInDoze = false; - masterConfig->enableInDebug = true; - masterConfig->enableFastAccess = false; - - /* Default baud rate at 100kbps. */ - masterConfig->baudRate_Bps = 100000U; -} - -/*! - * brief Gets the FlexIO I2C master status flags. - * - * param base Pointer to FLEXIO_I2C_Type structure - * return Status flag, use status flag to AND #_flexio_i2c_master_status_flags can get the related status. - */ - -uint32_t FLEXIO_I2C_MasterGetStatusFlags(FLEXIO_I2C_Type *base) -{ - uint32_t status = 0; - - status = - ((FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0])) >> base->shifterIndex[0]); - status |= - (((FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[1])) >> (base->shifterIndex[1])) - << 1U); - status |= - (((FLEXIO_GetShifterErrorFlags(base->flexioBase) & (1UL << base->shifterIndex[1])) >> (base->shifterIndex[1])) - << 2U); - - return status; -} - -/*! - * brief Clears the FlexIO I2C master status flags. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param mask Status flag. - * The parameter can be any combination of the following values: - * arg kFLEXIO_I2C_RxFullFlag - * arg kFLEXIO_I2C_ReceiveNakFlag - */ - -void FLEXIO_I2C_MasterClearStatusFlags(FLEXIO_I2C_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_I2C_TxEmptyFlag) != 0U) - { - FLEXIO_ClearShifterStatusFlags(base->flexioBase, 1UL << base->shifterIndex[0]); - } - - if ((mask & (uint32_t)kFLEXIO_I2C_RxFullFlag) != 0U) - { - FLEXIO_ClearShifterStatusFlags(base->flexioBase, 1UL << base->shifterIndex[1]); - } - - if ((mask & (uint32_t)kFLEXIO_I2C_ReceiveNakFlag) != 0U) - { - FLEXIO_ClearShifterErrorFlags(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Enables the FlexIO i2c master interrupt requests. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param mask Interrupt source. - * Currently only one interrupt request source: - * arg kFLEXIO_I2C_TransferCompleteInterruptEnable - */ -void FLEXIO_I2C_MasterEnableInterrupts(FLEXIO_I2C_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_I2C_TxEmptyInterruptEnable) != 0U) - { - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_I2C_RxFullInterruptEnable) != 0U) - { - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Disables the FlexIO I2C master interrupt requests. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param mask Interrupt source. - */ -void FLEXIO_I2C_MasterDisableInterrupts(FLEXIO_I2C_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_I2C_TxEmptyInterruptEnable) != 0U) - { - FLEXIO_DisableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_I2C_RxFullInterruptEnable) != 0U) - { - FLEXIO_DisableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Sets the FlexIO I2C master transfer baudrate. - * - * param base Pointer to FLEXIO_I2C_Type structure - * param baudRate_Bps the baud rate value in HZ - * param srcClock_Hz source clock in HZ - */ -void FLEXIO_I2C_MasterSetBaudRate(FLEXIO_I2C_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz) -{ - uint16_t timerDiv = 0; - FLEXIO_Type *flexioBase = base->flexioBase; - - /* Set TIMCMP = (baud rate divider / 2) - 1.*/ - timerDiv = (uint16_t)((srcClock_Hz / baudRate_Bps) / 2U - 1U); - - flexioBase->TIMCMP[base->timerIndex[1]] = timerDiv; - - /* Calculate and assign the actual baudrate. */ - base->baudrate = srcClock_Hz / (2U * ((uint32_t)timerDiv + 1U)); -} - -/*! - * brief Sets the number of bytes to be transferred from a start signal to a stop signal. - * - * note Call this API before a transfer begins because the timer generates a number of clocks according - * to the number of bytes that need to be transferred. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param count Number of bytes need to be transferred from a start signal to a re-start/stop signal - * retval kStatus_Success Successfully configured the count. - * retval kStatus_InvalidArgument Input argument is invalid. - */ -status_t FLEXIO_I2C_MasterSetTransferCount(FLEXIO_I2C_Type *base, uint16_t count) -{ - /* Calculate whether the transfer count is larger than the max value compare register can achieve */ - if (count > ((0xFFFFUL - 1UL) / (16UL + 1UL + 1UL))) - { - return kStatus_InvalidArgument; - } - - uint32_t timerConfig = 0U; - FLEXIO_Type *flexioBase = base->flexioBase; - - flexioBase->TIMCMP[base->timerIndex[0]] = (uint32_t)count * 18U + 1U; - timerConfig = flexioBase->TIMCFG[base->timerIndex[0]]; - timerConfig &= ~FLEXIO_TIMCFG_TIMDIS_MASK; - timerConfig |= FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTimerCompare); - flexioBase->TIMCFG[base->timerIndex[0]] = timerConfig; - - return kStatus_Success; -} - -/*! - * brief Sends START + 7-bit address to the bus. - * - * note This API should be called when the transfer configuration is ready to send a START signal - * and 7-bit address to the bus. This is a non-blocking API, which returns directly after the address - * is put into the data register but the address transfer is not finished on the bus. Ensure that - * the kFLEXIO_I2C_RxFullFlag status is asserted before calling this API. - * param base Pointer to FLEXIO_I2C_Type structure. - * param address 7-bit address. - * param direction transfer direction. - * This parameter is one of the values in flexio_i2c_direction_t: - * arg kFLEXIO_I2C_Write: Transmit - * arg kFLEXIO_I2C_Read: Receive - */ - -void FLEXIO_I2C_MasterStart(FLEXIO_I2C_Type *base, uint8_t address, flexio_i2c_direction_t direction) -{ - uint32_t data; - - data = ((uint32_t)address) << 1U | ((direction == kFLEXIO_I2C_Read) ? 1U : 0U); - - FLEXIO_I2C_MasterWriteByte(base, data); -} - -/*! - * brief Sends the repeated start signal on the bus. - * - * param base Pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterRepeatedStart(FLEXIO_I2C_Type *base) -{ - /* Prepare for RESTART condition, no stop.*/ - FLEXIO_I2C_MasterWriteByte(base, 0xFFFFFFFFU); -} - -/*! - * brief Sends the stop signal on the bus. - * - * param base Pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterStop(FLEXIO_I2C_Type *base) -{ - /* Prepare normal stop. */ - (void)FLEXIO_I2C_MasterSetTransferCount(base, 0x0U); - FLEXIO_I2C_MasterWriteByte(base, 0x0U); -} - -/*! - * brief Sends the stop signal when transfer is still on-going. - * - * param base Pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterAbortStop(FLEXIO_I2C_Type *base) -{ - uint32_t tmpConfig; - - /* Prepare abort stop. */ - /* Disable timer 0. */ - tmpConfig = base->flexioBase->TIMCFG[base->timerIndex[0]]; - tmpConfig &= ~FLEXIO_TIMCFG_TIMDIS_MASK; - tmpConfig |= FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnPinBothEdge); - base->flexioBase->TIMCFG[base->timerIndex[0]] = tmpConfig; - - /* Disable timer 1. */ - tmpConfig = base->flexioBase->TIMCFG[base->timerIndex[1]]; - tmpConfig &= ~FLEXIO_TIMCFG_TIMDIS_MASK; - tmpConfig |= FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnPinBothEdge); - base->flexioBase->TIMCFG[base->timerIndex[1]] = tmpConfig; -} - -/*! - * brief Configures the sent ACK/NAK for the following byte. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param enable True to configure send ACK, false configure to send NAK. - */ -void FLEXIO_I2C_MasterEnableAck(FLEXIO_I2C_Type *base, bool enable) -{ - uint32_t tmpConfig = 0; - - tmpConfig = base->flexioBase->SHIFTCFG[base->shifterIndex[0]]; - tmpConfig &= ~FLEXIO_SHIFTCFG_SSTOP_MASK; - if (enable) - { - tmpConfig |= FLEXIO_SHIFTCFG_SSTOP(kFLEXIO_ShifterStopBitLow); - } - else - { - tmpConfig |= FLEXIO_SHIFTCFG_SSTOP(kFLEXIO_ShifterStopBitHigh); - } - base->flexioBase->SHIFTCFG[base->shifterIndex[0]] = tmpConfig; -} - -/*! - * brief Sends a buffer of data in bytes. - * - * note This function blocks via polling until all bytes have been sent. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param txBuff The data bytes to send. - * param txSize The number of data bytes to send. - * retval kStatus_Success Successfully write data. - * retval kStatus_FLEXIO_I2C_Nak Receive NAK during writing data. - * retval kStatus_FLEXIO_I2C_Timeout Timeout polling status flags. - */ -status_t FLEXIO_I2C_MasterWriteBlocking(FLEXIO_I2C_Type *base, const uint8_t *txBuff, uint8_t txSize) -{ - assert(txBuff != NULL); - assert(txSize != 0U); - - uint32_t status; -#if I2C_RETRY_TIMES - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - - while (0U != txSize--) - { - FLEXIO_I2C_MasterWriteByte(base, *txBuff++); - - /* Wait until data transfer complete. */ -#if I2C_RETRY_TIMES - waitTimes = I2C_RETRY_TIMES; - while ((0U == ((status = FLEXIO_I2C_MasterGetStatusFlags(base)) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return kStatus_FLEXIO_I2C_Timeout; - } -#else - while (0U == ((status = FLEXIO_I2C_MasterGetStatusFlags(base)) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) - { - } -#endif - - if ((status & (uint32_t)kFLEXIO_I2C_ReceiveNakFlag) != 0U) - { - FLEXIO_ClearShifterErrorFlags(base->flexioBase, 1UL << base->shifterIndex[1]); - return kStatus_FLEXIO_I2C_Nak; - } - } - return kStatus_Success; -} - -/*! - * brief Receives a buffer of bytes. - * - * note This function blocks via polling until all bytes have been received. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param rxBuff The buffer to store the received bytes. - * param rxSize The number of data bytes to be received. - * retval kStatus_Success Successfully read data. - * retval kStatus_FLEXIO_I2C_Timeout Timeout polling status flags. - */ -status_t FLEXIO_I2C_MasterReadBlocking(FLEXIO_I2C_Type *base, uint8_t *rxBuff, uint8_t rxSize) -{ - assert(rxBuff != NULL); - assert(rxSize != 0U); - -#if I2C_RETRY_TIMES - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - - while (0U != rxSize--) - { - /* Wait until data transfer complete. */ -#if I2C_RETRY_TIMES - waitTimes = I2C_RETRY_TIMES; - while ((0U == (FLEXIO_I2C_MasterGetStatusFlags(base) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return kStatus_FLEXIO_I2C_Timeout; - } -#else - while (0U == (FLEXIO_I2C_MasterGetStatusFlags(base) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) - { - } -#endif - *rxBuff++ = FLEXIO_I2C_MasterReadByte(base); - } - return kStatus_Success; -} - -/*! - * brief Performs a master polling transfer on the I2C bus. - * - * note The API does not return until the transfer succeeds or fails due - * to receiving NAK. - * - * param base pointer to FLEXIO_I2C_Type structure. - * param xfer pointer to flexio_i2c_master_transfer_t structure. - * return status of status_t. - */ -status_t FLEXIO_I2C_MasterTransferBlocking(FLEXIO_I2C_Type *base, flexio_i2c_master_transfer_t *xfer) -{ - assert(xfer != NULL); - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_STATUS) && FSL_FEATURE_FLEXIO_HAS_PIN_STATUS - /* Return an error if the bus is already in use not by us.*/ - status_t status = FLEXIO_I2C_CheckForBusyBus(base); - if (status != kStatus_Success) - { - return status; - } -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_STATUS*/ - - flexio_i2c_master_handle_t tmpHandle; - uint32_t statusFlags; - status_t result = kStatus_Success; -#if I2C_RETRY_TIMES - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - - /* Zero the handle. */ - (void)memset(&tmpHandle, 0, sizeof(tmpHandle)); - - /* Set up transfer machine. */ - result = FLEXIO_I2C_MasterTransferInitStateMachine(base, &tmpHandle, xfer); - if (result != kStatus_Success) - { - return result; - } - - do - { - /* Wait either tx empty or rx full flag is asserted. */ -#if I2C_RETRY_TIMES - waitTimes = I2C_RETRY_TIMES; - while ((0U == ((statusFlags = FLEXIO_I2C_MasterGetStatusFlags(base)) & - ((uint32_t)kFLEXIO_I2C_TxEmptyFlag | (uint32_t)kFLEXIO_I2C_RxFullFlag))) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return kStatus_FLEXIO_I2C_Timeout; - } -#else - while (0U == ((statusFlags = FLEXIO_I2C_MasterGetStatusFlags(base)) & - ((uint32_t)kFLEXIO_I2C_TxEmptyFlag | (uint32_t)kFLEXIO_I2C_RxFullFlag))) - { - } -#endif - FLEXIO_ClearTimerStatusFlags(base->flexioBase, ((1UL << base->timerIndex[0]) | (1UL << base->timerIndex[1]))); - result = FLEXIO_I2C_MasterTransferRunStateMachine(base, &tmpHandle, statusFlags); - - } while ((tmpHandle.state != (uint8_t)kFLEXIO_I2C_Idle) && (result == kStatus_Success)); - - /* Timer disable on timer compare, wait until bit clock TSF set, which means timer disable and stop has been sent. - */ - while (0U == (FLEXIO_GetTimerStatusFlags(base->flexioBase) & (1UL << base->timerIndex[1]))) - { - } - - return result; -} - -/*! - * brief Initializes the I2C handle which is used in transactional functions. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param handle Pointer to flexio_i2c_master_handle_t structure to store the transfer state. - * param callback Pointer to user callback function. - * param userData User param passed to the callback function. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO type/handle/isr table out of range. - */ -status_t FLEXIO_I2C_MasterTransferCreateHandle(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - flexio_i2c_master_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - IRQn_Type flexio_irqs[] = FLEXIO_IRQS; - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Register callback and userData. */ - handle->completionCallback = callback; - handle->userData = userData; - - /* Clear pending NVIC IRQ before enable NVIC IRQ. */ - NVIC_ClearPendingIRQ(flexio_irqs[FLEXIO_I2C_GetInstance(base)]); - (void)EnableIRQ(flexio_irqs[FLEXIO_I2C_GetInstance(base)]); - - /* Save the context in global variables to support the double weak mechanism. */ - return FLEXIO_RegisterHandleIRQ(base, handle, FLEXIO_I2C_MasterTransferHandleIRQ); -} - -/*! - * brief Performs a master interrupt non-blocking transfer on the I2C bus. - * - * note The API returns immediately after the transfer initiates. - * Call FLEXIO_I2C_MasterTransferGetCount to poll the transfer status to check whether - * the transfer is finished. If the return status is not kStatus_FLEXIO_I2C_Busy, the transfer - * is finished. - * - * param base Pointer to FLEXIO_I2C_Type structure - * param handle Pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * param xfer pointer to flexio_i2c_master_transfer_t structure - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_FLEXIO_I2C_Busy FlexIO I2C is not idle, is running another transfer. - */ -status_t FLEXIO_I2C_MasterTransferNonBlocking(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - flexio_i2c_master_transfer_t *xfer) -{ - assert(handle != NULL); - assert(xfer != NULL); - - status_t result = kStatus_Success; - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_STATUS) && FSL_FEATURE_FLEXIO_HAS_PIN_STATUS - /* Return an error if the bus is already in use not by us.*/ - result = FLEXIO_I2C_CheckForBusyBus(base); - if (result != kStatus_Success) - { - return result; - } -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_STATUS*/ - - if (handle->state != (uint8_t)kFLEXIO_I2C_Idle) - { - return kStatus_FLEXIO_I2C_Busy; - } - else - { - /* Set up transfer machine. */ - result = FLEXIO_I2C_MasterTransferInitStateMachine(base, handle, xfer); - if (result != kStatus_Success) - { - return result; - } - - /* Enable both tx empty and rxfull interrupt. */ - FLEXIO_I2C_MasterEnableInterrupts( - base, (uint32_t)kFLEXIO_I2C_TxEmptyInterruptEnable | (uint32_t)kFLEXIO_I2C_RxFullInterruptEnable); - - return kStatus_Success; - } -} - -/*! - * brief Aborts an interrupt non-blocking transfer early. - * - * note This API can be called at any time when an interrupt non-blocking transfer initiates - * to abort the transfer early. - * - * param base Pointer to FLEXIO_I2C_Type structure - * param handle Pointer to flexio_i2c_master_handle_t structure which stores the transfer state - */ -void FLEXIO_I2C_MasterTransferAbort(FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable interrupts. */ - FLEXIO_I2C_MasterDisableInterrupts( - base, (uint32_t)kFLEXIO_I2C_TxEmptyInterruptEnable | (uint32_t)kFLEXIO_I2C_RxFullInterruptEnable); - - /* Reset to idle state. */ - handle->state = (uint8_t)kFLEXIO_I2C_Idle; -} - -/*! - * brief Gets the master transfer status during a interrupt non-blocking transfer. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param handle Pointer to flexio_i2c_master_handle_t structure which stores the transfer state. - * param count Number of bytes transferred so far by the non-blocking transaction. - * retval kStatus_InvalidArgument count is Invalid. - * retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - * retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_I2C_MasterTransferGetCount(FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle, size_t *count) -{ - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (handle->state == (uint8_t)kFLEXIO_I2C_Idle) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - *count = handle->transferSize - handle->transfer.dataSize; - - return kStatus_Success; -} - -/*! - * brief Master interrupt handler. - * - * param i2cType Pointer to FLEXIO_I2C_Type structure - * param i2cHandle Pointer to flexio_i2c_master_transfer_t structure - */ -void FLEXIO_I2C_MasterTransferHandleIRQ(void *i2cType, void *i2cHandle) -{ - FLEXIO_I2C_Type *base = (FLEXIO_I2C_Type *)i2cType; - flexio_i2c_master_handle_t *handle = (flexio_i2c_master_handle_t *)i2cHandle; - uint32_t statusFlags; - status_t result; - - statusFlags = FLEXIO_I2C_MasterGetStatusFlags(base); - - result = FLEXIO_I2C_MasterTransferRunStateMachine(base, handle, statusFlags); - - if (handle->state == (uint8_t)kFLEXIO_I2C_Idle) - { - FLEXIO_I2C_MasterTransferComplete(base, handle, result); - } -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_i2c_master.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_i2c_master.h deleted file mode 100644 index 6b33abe22ca..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_i2c_master.h +++ /dev/null @@ -1,485 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_FLEXIO_I2C_MASTER_H_ -#define FSL_FLEXIO_I2C_MASTER_H_ - -#include "fsl_common.h" -#include "fsl_flexio.h" - -/*! - * @addtogroup flexio_i2c_master - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -#define FSL_FLEXIO_I2C_MASTER_DRIVER_VERSION (MAKE_VERSION(2, 5, 0)) -/*! @} */ - -/*! @brief Retry times for waiting flag. */ -#ifndef I2C_RETRY_TIMES -#define I2C_RETRY_TIMES 0U /* Define to zero means keep waiting until the flag is assert/deassert. */ -#endif - -/*! @brief FlexIO I2C transfer status*/ -enum -{ - kStatus_FLEXIO_I2C_Busy = MAKE_STATUS(kStatusGroup_FLEXIO_I2C, 0), /*!< I2C is busy doing transfer. */ - kStatus_FLEXIO_I2C_Idle = MAKE_STATUS(kStatusGroup_FLEXIO_I2C, 1), /*!< I2C is busy doing transfer. */ - kStatus_FLEXIO_I2C_Nak = MAKE_STATUS(kStatusGroup_FLEXIO_I2C, 2), /*!< NAK received during transfer. */ - kStatus_FLEXIO_I2C_Timeout = MAKE_STATUS(kStatusGroup_FLEXIO_I2C, 3), /*!< Timeout polling status flags. */ -}; - -/*! @brief Define FlexIO I2C master interrupt mask. */ -enum _flexio_i2c_master_interrupt -{ - kFLEXIO_I2C_TxEmptyInterruptEnable = 0x1U, /*!< Tx buffer empty interrupt enable. */ - kFLEXIO_I2C_RxFullInterruptEnable = 0x2U, /*!< Rx buffer full interrupt enable. */ -}; - -/*! @brief Define FlexIO I2C master status mask. */ -enum _flexio_i2c_master_status_flags -{ - kFLEXIO_I2C_TxEmptyFlag = 0x1U, /*!< Tx shifter empty flag. */ - kFLEXIO_I2C_RxFullFlag = 0x2U, /*!< Rx shifter full/Transfer complete flag. */ - kFLEXIO_I2C_ReceiveNakFlag = 0x4U, /*!< Receive NAK flag. */ -}; - -/*! @brief Direction of master transfer.*/ -typedef enum _flexio_i2c_direction -{ - kFLEXIO_I2C_Write = 0x0U, /*!< Master send to slave. */ - kFLEXIO_I2C_Read = 0x1U, /*!< Master receive from slave. */ -} flexio_i2c_direction_t; - -/*! @brief Define FlexIO I2C master access structure typedef. */ -typedef struct _flexio_i2c_type -{ - FLEXIO_Type *flexioBase; /*!< FlexIO base pointer. */ - uint8_t SDAPinIndex; /*!< Pin select for I2C SDA. */ - uint8_t SCLPinIndex; /*!< Pin select for I2C SCL. */ - uint8_t shifterIndex[2]; /*!< Shifter index used in FlexIO I2C. */ - uint8_t timerIndex[3]; /*!< Timer index used in FlexIO I2C. */ - uint32_t baudrate; /*!< Master transfer baudrate, used to calculate delay time. */ -} FLEXIO_I2C_Type; - -/*! @brief Define FlexIO I2C master user configuration structure. */ -typedef struct _flexio_i2c_master_config -{ - bool enableMaster; /*!< Enables the FlexIO I2C peripheral at initialization time. */ - bool enableInDoze; /*!< Enable/disable FlexIO operation in doze mode. */ - bool enableInDebug; /*!< Enable/disable FlexIO operation in debug mode. */ - bool enableFastAccess; /*!< Enable/disable fast access to FlexIO registers, fast access requires - the FlexIO clock to be at least twice the frequency of the bus clock. */ - uint32_t baudRate_Bps; /*!< Baud rate in Bps. */ -} flexio_i2c_master_config_t; - -/*! @brief Define FlexIO I2C master transfer structure. */ -typedef struct _flexio_i2c_master_transfer -{ - uint32_t flags; /*!< Transfer flag which controls the transfer, reserved for FlexIO I2C. */ - uint8_t slaveAddress; /*!< 7-bit slave address. */ - flexio_i2c_direction_t direction; /*!< Transfer direction, read or write. */ - uint32_t subaddress; /*!< Sub address. Transferred MSB first. */ - uint8_t subaddressSize; /*!< Size of command buffer. */ - uint8_t volatile *data; /*!< Transfer buffer. */ - volatile size_t dataSize; /*!< Transfer size. */ -} flexio_i2c_master_transfer_t; - -/*! @brief FlexIO I2C master handle typedef. */ -typedef struct _flexio_i2c_master_handle flexio_i2c_master_handle_t; - -/*! @brief FlexIO I2C master transfer callback typedef. */ -typedef void (*flexio_i2c_master_transfer_callback_t)(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - status_t status, - void *userData); - -/*! @brief Define FlexIO I2C master handle structure. */ -struct _flexio_i2c_master_handle -{ - flexio_i2c_master_transfer_t transfer; /*!< FlexIO I2C master transfer copy. */ - size_t transferSize; /*!< Total bytes to be transferred. */ - uint8_t state; /*!< Transfer state maintained during transfer. */ - flexio_i2c_master_transfer_callback_t completionCallback; /*!< Callback function called at transfer event. */ - /*!< Callback function called at transfer event. */ - void *userData; /*!< Callback parameter passed to callback function. */ - bool needRestart; /*!< Whether master needs to send re-start signal. */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus*/ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_STATUS) && FSL_FEATURE_FLEXIO_HAS_PIN_STATUS -/*! - * @brief Make sure the bus isn't already pulled down. - * - * Check the FLEXIO pin status to see whether either of SDA and SCL pin is pulled down. - * - * @param base Pointer to FLEXIO_I2C_Type structure.. - * @retval kStatus_Success - * @retval kStatus_FLEXIO_I2C_Busy - */ -status_t FLEXIO_I2C_CheckForBusyBus(FLEXIO_I2C_Type *base); -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_STATUS*/ - -/*! - * @brief Ungates the FlexIO clock, resets the FlexIO module, and configures the FlexIO I2C - * hardware configuration. - * - * Example - @code - FLEXIO_I2C_Type base = { - .flexioBase = FLEXIO, - .SDAPinIndex = 0, - .SCLPinIndex = 1, - .shifterIndex = {0,1}, - .timerIndex = {0,1} - }; - flexio_i2c_master_config_t config = { - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .baudRate_Bps = 100000 - }; - FLEXIO_I2C_MasterInit(base, &config, srcClock_Hz); - @endcode - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param masterConfig Pointer to flexio_i2c_master_config_t structure. - * @param srcClock_Hz FlexIO source clock in Hz. - * @retval kStatus_Success Initialization successful - * @retval kStatus_InvalidArgument The source clock exceed upper range limitation -*/ -status_t FLEXIO_I2C_MasterInit(FLEXIO_I2C_Type *base, flexio_i2c_master_config_t *masterConfig, uint32_t srcClock_Hz); - -/*! - * @brief De-initializes the FlexIO I2C master peripheral. Calling this API Resets the FlexIO I2C master - * shifer and timer config, module can't work unless the FLEXIO_I2C_MasterInit is called. - * - * @param base pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterDeinit(FLEXIO_I2C_Type *base); - -/*! - * @brief Gets the default configuration to configure the FlexIO module. The configuration - * can be used directly for calling the FLEXIO_I2C_MasterInit(). - * - * Example: - @code - flexio_i2c_master_config_t config; - FLEXIO_I2C_MasterGetDefaultConfig(&config); - @endcode - * @param masterConfig Pointer to flexio_i2c_master_config_t structure. -*/ -void FLEXIO_I2C_MasterGetDefaultConfig(flexio_i2c_master_config_t *masterConfig); - -/*! - * @brief Enables/disables the FlexIO module operation. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param enable Pass true to enable module, false does not have any effect. - */ -static inline void FLEXIO_I2C_MasterEnable(FLEXIO_I2C_Type *base, bool enable) -{ - if (enable) - { - base->flexioBase->CTRL |= FLEXIO_CTRL_FLEXEN_MASK; - } -} - -/*! @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets the FlexIO I2C master status flags. - * - * @param base Pointer to FLEXIO_I2C_Type structure - * @return Status flag, use status flag to AND #_flexio_i2c_master_status_flags can get the related status. - */ - -uint32_t FLEXIO_I2C_MasterGetStatusFlags(FLEXIO_I2C_Type *base); - -/*! - * @brief Clears the FlexIO I2C master status flags. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param mask Status flag. - * The parameter can be any combination of the following values: - * @arg kFLEXIO_I2C_RxFullFlag - * @arg kFLEXIO_I2C_ReceiveNakFlag - */ - -void FLEXIO_I2C_MasterClearStatusFlags(FLEXIO_I2C_Type *base, uint32_t mask); - -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables the FlexIO i2c master interrupt requests. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param mask Interrupt source. - * Currently only one interrupt request source: - * @arg kFLEXIO_I2C_TransferCompleteInterruptEnable - */ -void FLEXIO_I2C_MasterEnableInterrupts(FLEXIO_I2C_Type *base, uint32_t mask); - -/*! - * @brief Disables the FlexIO I2C master interrupt requests. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param mask Interrupt source. - */ -void FLEXIO_I2C_MasterDisableInterrupts(FLEXIO_I2C_Type *base, uint32_t mask); - -/*! @} */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Sets the FlexIO I2C master transfer baudrate. - * - * @param base Pointer to FLEXIO_I2C_Type structure - * @param baudRate_Bps the baud rate value in HZ - * @param srcClock_Hz source clock in HZ - */ -void FLEXIO_I2C_MasterSetBaudRate(FLEXIO_I2C_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz); - -/*! - * @brief Sends START + 7-bit address to the bus. - * - * @note This API should be called when the transfer configuration is ready to send a START signal - * and 7-bit address to the bus. This is a non-blocking API, which returns directly after the address - * is put into the data register but the address transfer is not finished on the bus. Ensure that - * the kFLEXIO_I2C_RxFullFlag status is asserted before calling this API. - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param address 7-bit address. - * @param direction transfer direction. - * This parameter is one of the values in flexio_i2c_direction_t: - * @arg kFLEXIO_I2C_Write: Transmit - * @arg kFLEXIO_I2C_Read: Receive - */ - -void FLEXIO_I2C_MasterStart(FLEXIO_I2C_Type *base, uint8_t address, flexio_i2c_direction_t direction); - -/*! - * @brief Sends the stop signal on the bus. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterStop(FLEXIO_I2C_Type *base); - -/*! - * @brief Sends the repeated start signal on the bus. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterRepeatedStart(FLEXIO_I2C_Type *base); - -/*! - * @brief Sends the stop signal when transfer is still on-going. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterAbortStop(FLEXIO_I2C_Type *base); - -/*! - * @brief Configures the sent ACK/NAK for the following byte. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param enable True to configure send ACK, false configure to send NAK. - */ -void FLEXIO_I2C_MasterEnableAck(FLEXIO_I2C_Type *base, bool enable); - -/*! - * @brief Sets the number of bytes to be transferred from a start signal to a stop signal. - * - * @note Call this API before a transfer begins because the timer generates a number of clocks according - * to the number of bytes that need to be transferred. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param count Number of bytes need to be transferred from a start signal to a re-start/stop signal - * @retval kStatus_Success Successfully configured the count. - * @retval kStatus_InvalidArgument Input argument is invalid. - */ -status_t FLEXIO_I2C_MasterSetTransferCount(FLEXIO_I2C_Type *base, uint16_t count); - -/*! - * @brief Writes one byte of data to the I2C bus. - * - * @note This is a non-blocking API, which returns directly after the data is put into the - * data register but the data transfer is not finished on the bus. Ensure that - * the TxEmptyFlag is asserted before calling this API. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param data a byte of data. - */ -static inline void FLEXIO_I2C_MasterWriteByte(FLEXIO_I2C_Type *base, uint32_t data) -{ - base->flexioBase->SHIFTBUFBBS[base->shifterIndex[0]] = data; -} - -/*! - * @brief Reads one byte of data from the I2C bus. - * - * @note This is a non-blocking API, which returns directly after the data is read from the - * data register. Ensure that the data is ready in the register. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @return data byte read. - */ -static inline uint8_t FLEXIO_I2C_MasterReadByte(FLEXIO_I2C_Type *base) -{ - return (uint8_t)(base->flexioBase->SHIFTBUFBIS[base->shifterIndex[1]]); -} - -/*! - * @brief Sends a buffer of data in bytes. - * - * @note This function blocks via polling until all bytes have been sent. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param txBuff The data bytes to send. - * @param txSize The number of data bytes to send. - * @retval kStatus_Success Successfully write data. - * @retval kStatus_FLEXIO_I2C_Nak Receive NAK during writing data. - * @retval kStatus_FLEXIO_I2C_Timeout Timeout polling status flags. - */ -status_t FLEXIO_I2C_MasterWriteBlocking(FLEXIO_I2C_Type *base, const uint8_t *txBuff, uint8_t txSize); - -/*! - * @brief Receives a buffer of bytes. - * - * @note This function blocks via polling until all bytes have been received. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param rxBuff The buffer to store the received bytes. - * @param rxSize The number of data bytes to be received. - * @retval kStatus_Success Successfully read data. - * @retval kStatus_FLEXIO_I2C_Timeout Timeout polling status flags. - */ -status_t FLEXIO_I2C_MasterReadBlocking(FLEXIO_I2C_Type *base, uint8_t *rxBuff, uint8_t rxSize); - -/*! - * @brief Performs a master polling transfer on the I2C bus. - * - * @note The API does not return until the transfer succeeds or fails due - * to receiving NAK. - * - * @param base pointer to FLEXIO_I2C_Type structure. - * @param xfer pointer to flexio_i2c_master_transfer_t structure. - * @return status of status_t. - */ -status_t FLEXIO_I2C_MasterTransferBlocking(FLEXIO_I2C_Type *base, flexio_i2c_master_transfer_t *xfer); -/*! @} */ - -/*Transactional APIs*/ - -/*! - * @name Transactional - * @{ - */ - -/*! - * @brief Initializes the I2C handle which is used in transactional functions. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param handle Pointer to flexio_i2c_master_handle_t structure to store the transfer state. - * @param callback Pointer to user callback function. - * @param userData User param passed to the callback function. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO type/handle/isr table out of range. - */ -status_t FLEXIO_I2C_MasterTransferCreateHandle(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - flexio_i2c_master_transfer_callback_t callback, - void *userData); - -/*! - * @brief Performs a master interrupt non-blocking transfer on the I2C bus. - * - * @note The API returns immediately after the transfer initiates. - * Call FLEXIO_I2C_MasterTransferGetCount to poll the transfer status to check whether - * the transfer is finished. If the return status is not kStatus_FLEXIO_I2C_Busy, the transfer - * is finished. - * - * @param base Pointer to FLEXIO_I2C_Type structure - * @param handle Pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param xfer pointer to flexio_i2c_master_transfer_t structure - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_FLEXIO_I2C_Busy FlexIO I2C is not idle, is running another transfer. - */ -status_t FLEXIO_I2C_MasterTransferNonBlocking(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - flexio_i2c_master_transfer_t *xfer); - -/*! - * @brief Gets the master transfer status during a interrupt non-blocking transfer. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param handle Pointer to flexio_i2c_master_handle_t structure which stores the transfer state. - * @param count Number of bytes transferred so far by the non-blocking transaction. - * @retval kStatus_InvalidArgument count is Invalid. - * @retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - * @retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_I2C_MasterTransferGetCount(FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle, size_t *count); - -/*! - * @brief Aborts an interrupt non-blocking transfer early. - * - * @note This API can be called at any time when an interrupt non-blocking transfer initiates - * to abort the transfer early. - * - * @param base Pointer to FLEXIO_I2C_Type structure - * @param handle Pointer to flexio_i2c_master_handle_t structure which stores the transfer state - */ -void FLEXIO_I2C_MasterTransferAbort(FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle); - -/*! - * @brief Master interrupt handler. - * - * @param i2cType Pointer to FLEXIO_I2C_Type structure - * @param i2cHandle Pointer to flexio_i2c_master_transfer_t structure - */ -void FLEXIO_I2C_MasterTransferHandleIRQ(void *i2cType, void *i2cHandle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /*_cplusplus*/ -/*! @} */ - -#endif /*FSL_FLEXIO_I2C_MASTER_H_*/ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_mculcd.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_mculcd.c deleted file mode 100644 index 217b6595a32..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_mculcd.c +++ /dev/null @@ -1,1334 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio_mculcd.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio_mculcd" -#endif - -/******************************************************************************* - * Definitations - ******************************************************************************/ - -enum _mculcd_transfer_state -{ - kFLEXIO_MCULCD_StateIdle, /*!< No transfer in progress. */ - kFLEXIO_MCULCD_StateReadArray, /*!< Reading array in progress. */ - kFLEXIO_MCULCD_StateWriteArray, /*!< Writing array in progress. */ - kFLEXIO_MCULCD_StateWriteSameValue, /*!< Writing the same value in progress. */ -}; - -/* The TIMCFG[0:7] is used for baud rate divider in dual 8-bit counters baud/bit mode. */ -#define FLEXIO_BAUDRATE_DIV_MASK 0xFFU - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ -/*! - * brief Ungates the FlexIO clock, resets the FlexIO module, configures the - * FlexIO MCULCD hardware, and configures the FlexIO MCULCD with FlexIO MCULCD - * configuration. - * The configuration structure can be filled by the user, or be set with default - * values - * by the ref FLEXIO_MCULCD_GetDefaultConfig. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param config Pointer to the flexio_mculcd_config_t structure. - * param srcClock_Hz FlexIO source clock in Hz. - * retval kStatus_Success Initialization success. - * retval kStatus_InvalidArgument Initialization failed because of invalid - * argument. - */ -status_t FLEXIO_MCULCD_Init(FLEXIO_MCULCD_Type *base, flexio_mculcd_config_t *config, uint32_t srcClock_Hz) -{ - assert(NULL != config); - status_t status; - - flexio_config_t flexioConfig = {config->enable, config->enableInDoze, config->enableInDebug, - config->enableFastAccess}; - - FLEXIO_Init(base->flexioBase, &flexioConfig); - - status = FLEXIO_MCULCD_SetBaudRate(base, config->baudRate_Bps, srcClock_Hz); - - if (kStatus_Success == status) - { - base->setCSPin(true); - base->setRSPin(true); - } - - return status; -} - -/*! - * brief Resets the FLEXIO_MCULCD timer and shifter configuration. - * - * param base Pointer to the FLEXIO_MCULCD_Type. - */ -void FLEXIO_MCULCD_Deinit(FLEXIO_MCULCD_Type *base) -{ - FLEXIO_MCULCD_ClearSingleBeatWriteConfig(base); - FLEXIO_MCULCD_ClearSingleBeatReadConfig(base); -} - -/*! - * brief Gets the default configuration to configure the FlexIO MCULCD. - * - * The default configuration value is: - * code - * config->enable = true; - * config->enableInDoze = false; - * config->enableInDebug = true; - * config->enableFastAccess = true; - * config->baudRate_Bps = 96000000U; - * endcode - * param Config Pointer to the flexio_mculcd_config_t structure. - */ -void FLEXIO_MCULCD_GetDefaultConfig(flexio_mculcd_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->enable = true; - config->enableInDoze = false; - config->enableInDebug = true; - config->enableFastAccess = true; - config->baudRate_Bps = 96000000U; -} - -/*! - * brief Set desired baud rate. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param baudRate_Bps Desired baud rate in bit-per-second for all data lines combined. - * param srcClock_Hz FLEXIO clock frequency in Hz. - * retval kStatus_Success Set successfully. - * retval kStatus_InvalidArgument Could not set the baud rate. - */ -status_t FLEXIO_MCULCD_SetBaudRate(FLEXIO_MCULCD_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz) -{ - uint32_t baudRateDiv; - uint32_t baudRatePerDataLine; - uint32_t timerCompare; - status_t status; - - baudRatePerDataLine = baudRate_Bps / (uint32_t)FLEXIO_MCULCD_DATA_BUS_WIDTH; - - baudRateDiv = (srcClock_Hz + baudRatePerDataLine) / (baudRatePerDataLine * 2U); - - if ((0U == baudRateDiv) || (baudRateDiv > (FLEXIO_BAUDRATE_DIV_MASK + 1U))) - { - status = kStatus_InvalidArgument; - } - else - { - baudRateDiv--; - - timerCompare = base->flexioBase->TIMCMP[base->timerIndex]; - - timerCompare = (timerCompare & ~FLEXIO_BAUDRATE_DIV_MASK) | baudRateDiv; - - base->flexioBase->TIMCMP[base->timerIndex] = timerCompare; - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Gets FlexIO MCULCD status flags. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * return status flag; OR'ed value or the ref _flexio_mculcd_status_flags. - * - * note Don't use this function with DMA APIs. - */ -uint32_t FLEXIO_MCULCD_GetStatusFlags(FLEXIO_MCULCD_Type *base) -{ - uint32_t ret = 0U; - uint32_t flags; - - /* Get shifter status. */ - flags = FLEXIO_GetShifterStatusFlags(base->flexioBase); - - if (0U != (flags & (1UL << base->rxShifterEndIndex))) - { - ret |= (uint32_t)kFLEXIO_MCULCD_RxFullFlag; - } - - if (0U != (flags & (1UL << base->txShifterStartIndex))) - { - ret |= (uint32_t)kFLEXIO_MCULCD_TxEmptyFlag; - } - - return ret; -} - -/*! - * brief Clears FlexIO MCULCD status flags. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param mask Status to clear, it is the OR'ed value of ref - * _flexio_mculcd_status_flags. - * - * note Don't use this function with DMA APIs. - */ -void FLEXIO_MCULCD_ClearStatusFlags(FLEXIO_MCULCD_Type *base, uint32_t mask) -{ - uint32_t flags = 0U; - - /* Clear the shifter flags. */ - if (0U != (mask & (uint32_t)kFLEXIO_MCULCD_RxFullFlag)) - { - flags |= (1UL << base->rxShifterEndIndex); - } - - if (0U != (mask & (uint32_t)kFLEXIO_MCULCD_TxEmptyFlag)) - { - flags |= (1UL << base->txShifterStartIndex); - } - - FLEXIO_ClearShifterStatusFlags(base->flexioBase, flags); -} - -/*! - * brief Enables the FlexIO MCULCD interrupt. - * - * This function enables the FlexIO MCULCD interrupt. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param mask Interrupts to enable, it is the OR'ed value of ref - * _flexio_mculcd_interrupt_enable. - */ -void FLEXIO_MCULCD_EnableInterrupts(FLEXIO_MCULCD_Type *base, uint32_t mask) -{ - uint32_t interrupts = 0U; - - /* Enable shifter interrupts. */ - if (0U != (mask & (uint32_t)kFLEXIO_MCULCD_RxFullFlag)) - { - interrupts |= (1UL << base->rxShifterEndIndex); - } - - if (0U != (mask & (uint32_t)kFLEXIO_MCULCD_TxEmptyFlag)) - { - interrupts |= (1UL << base->txShifterStartIndex); - } - - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, interrupts); -} - -/*! - * brief Disables the FlexIO MCULCD interrupt. - * - * This function disables the FlexIO MCULCD interrupt. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param mask Interrupts to disable, it is the OR'ed value of ref - * _flexio_mculcd_interrupt_enable. - */ -void FLEXIO_MCULCD_DisableInterrupts(FLEXIO_MCULCD_Type *base, uint32_t mask) -{ - uint32_t interrupts = 0U; - - /* Disable shifter interrupts. */ - if (0U != (mask & (uint32_t)kFLEXIO_MCULCD_RxFullFlag)) - { - interrupts |= (1UL << base->rxShifterEndIndex); - } - - if (0U != (mask & (uint32_t)kFLEXIO_MCULCD_TxEmptyFlag)) - { - interrupts |= (1UL << base->txShifterStartIndex); - } - - FLEXIO_DisableShifterStatusInterrupts(base->flexioBase, interrupts); -} - -/*! - * brief Read data from the FLEXIO MCULCD RX shifter buffer. - * - * Read data from the RX shift buffer directly, it does no check whether the - * buffer is empty or not. - * - * If the data bus width is 8-bit: - * code - * uint8_t value; - * value = (uint8_t)FLEXIO_MCULCD_ReadData(base); - * endcode - * - * If the data bus width is 16-bit: - * code - * uint16_t value; - * value = (uint16_t)FLEXIO_MCULCD_ReadData(base); - * endcode - * - * note This function returns the RX shifter buffer value (32-bit) directly. - * The return value should be converted according to data bus width. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * return The data read out. - * - * note Don't use this function with DMA APIs. - */ -uint32_t FLEXIO_MCULCD_ReadData(FLEXIO_MCULCD_Type *base) -{ -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - return base->flexioBase->SHIFTBUFBYS[base->rxShifterEndIndex]; -#else - return base->flexioBase->SHIFTBUFHWS[base->rxShifterEndIndex]; -#endif -} - -/*! - * brief Configures the FLEXIO MCULCD to single beats write mode. - * - * At the begining multiple beats write operation, the FLEXIO MCULCD is configured to - * multiple beats write mode using this function. After write operation, the configuration - * is cleared by ref FLEXIO_MCULCD_ClearSingleBeatWriteConfig. - * - * param base Pointer to the FLEXIO_MCULCD_Type. - * - * note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_SetSingleBeatWriteConfig(FLEXIO_MCULCD_Type *base) -{ - /* - * This function will be called at the beginning of every data writing. For - * performance consideration, it access the FlexIO registers directly, but not - * call FlexIO driver APIs. - */ - - uint32_t timerCompare; - uint32_t timerControl; - - /* Enable the TX Shifter output. */ - base->flexioBase->SHIFTCFG[base->txShifterStartIndex] = - FLEXIO_SHIFTCFG_PWIDTH((uint32_t)FLEXIO_MCULCD_DATA_BUS_WIDTH - 1U) | - FLEXIO_SHIFTCFG_INSRC(kFLEXIO_ShifterInputFromNextShifterOutput); - - base->flexioBase->SHIFTCTL[base->txShifterStartIndex] = - FLEXIO_SHIFTCTL_TIMSEL(base->timerIndex) | FLEXIO_SHIFTCTL_TIMPOL(kFLEXIO_ShifterTimerPolarityOnPositive) | - FLEXIO_SHIFTCTL_PINCFG(kFLEXIO_PinConfigOutput) | FLEXIO_SHIFTCTL_PINSEL(base->dataPinStartIndex) | - FLEXIO_SHIFTCTL_PINPOL(kFLEXIO_PinActiveHigh) | FLEXIO_SHIFTCTL_SMOD(kFLEXIO_ShifterModeTransmit); - - timerCompare = base->flexioBase->TIMCMP[base->timerIndex] & 0xFFU; - - /* - * TIMCMP[15:8] = (number of beats x 2) - 1. Because the number of beat is 1, - * so the TIMCMP[15:8] is 1. - */ - base->flexioBase->TIMCMP[base->timerIndex] = (1UL << 8U) | timerCompare; - - /* Use TX shifter flag as the inverted timer trigger. Timer output to WR/EN pin. */ - base->flexioBase->TIMCFG[base->timerIndex] = - FLEXIO_TIMCFG_TIMOUT(kFLEXIO_TimerOutputOneNotAffectedByReset) | - FLEXIO_TIMCFG_TIMDEC(kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput) | - FLEXIO_TIMCFG_TIMRST(kFLEXIO_TimerResetNever) | FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTimerCompare) | - FLEXIO_TIMCFG_TIMENA(kFLEXIO_TimerEnableOnTriggerHigh) | FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitDisabled) | - FLEXIO_TIMCFG_TSTART(kFLEXIO_TimerStartBitDisabled); - - /* When initially configure the timer pin as output, the pin may be driven low causing glitch on bus. - Configure the pin as bidirection output first then perform a subsequent write to change to output to avoid the - issue. */ - timerControl = FLEXIO_TIMCTL_TRGSEL(FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->txShifterStartIndex)) | - FLEXIO_TIMCTL_TRGPOL(kFLEXIO_TimerTriggerPolarityActiveLow) | - FLEXIO_TIMCTL_TRGSRC(kFLEXIO_TimerTriggerSourceInternal) | - FLEXIO_TIMCTL_PINCFG(kFLEXIO_PinConfigBidirectionOutputData) | - FLEXIO_TIMCTL_PINSEL(base->ENWRPinIndex) | FLEXIO_TIMCTL_PINPOL(kFLEXIO_PinActiveLow) | - FLEXIO_TIMCTL_TIMOD(kFLEXIO_TimerModeDual8BitBaudBit); - - base->flexioBase->TIMCTL[base->timerIndex] = timerControl; - timerControl = (timerControl & ~FLEXIO_TIMCTL_PINCFG_MASK) | FLEXIO_TIMCTL_PINCFG(kFLEXIO_PinConfigOutput); - base->flexioBase->TIMCTL[base->timerIndex] = timerControl; -} - -/*! - * brief Clear the FLEXIO MCULCD single beats write mode configuration. - * - * Clear the write configuration set by ref FLEXIO_MCULCD_SetSingleBeatWriteConfig. - * - * param base Pointer to the FLEXIO_MCULCD_Type. - * - * note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_ClearSingleBeatWriteConfig(FLEXIO_MCULCD_Type *base) -{ - /* Disable the timer. */ - /* Set to bidirection output first then set to disable to avoid glitch on bus. */ - base->flexioBase->TIMCTL[base->timerIndex] = - (base->flexioBase->TIMCTL[base->timerIndex] & ~FLEXIO_TIMCTL_PINCFG_MASK) | - FLEXIO_TIMCTL_PINCFG(kFLEXIO_PinConfigBidirectionOutputData); - base->flexioBase->TIMCTL[base->timerIndex] = 0U; - base->flexioBase->TIMCFG[base->timerIndex] = 0U; - /* Clear the timer flag. */ - base->flexioBase->TIMSTAT = (1UL << base->timerIndex); - /* Stop the TX shifter. */ - base->flexioBase->SHIFTCTL[base->txShifterStartIndex] = 0U; - base->flexioBase->SHIFTCFG[base->txShifterStartIndex] = 0U; - /* Clear the shifter flag. */ - base->flexioBase->SHIFTSTAT = (1UL << base->txShifterStartIndex); -} - -/*! - * brief Configures the FLEXIO MCULCD to single beats read mode. - * - * At the begining or multiple beats read operation, the FLEXIO MCULCD is configured - * to multiple beats read mode using this function. After read operation, the configuration - * is cleared by ref FLEXIO_MCULCD_ClearSingleBeatReadConfig. - * - * param base Pointer to the FLEXIO_MCULCD_Type. - * - * note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_SetSingleBeatReadConfig(FLEXIO_MCULCD_Type *base) -{ - /* - * This function will be called at the beginning of every data reading. For - * performance consideration, it access the FlexIO registers directly, but not - * call FlexIO driver APIs. - */ - - uint8_t timerPin; - uint32_t timerCompare; - flexio_pin_polarity_t timerPinPolarity; - - /* Timer output to RD pin (8080 mode), to WR/EN pin in 6800 mode. */ - if (kFLEXIO_MCULCD_8080 == base->busType) - { - timerPin = base->RDPinIndex; - timerPinPolarity = kFLEXIO_PinActiveLow; - } - else - { - timerPin = base->ENWRPinIndex; - timerPinPolarity = kFLEXIO_PinActiveHigh; - } - - /* Enable the RX Shifter input. */ - base->flexioBase->SHIFTCFG[base->rxShifterEndIndex] = - FLEXIO_SHIFTCFG_PWIDTH((uint32_t)FLEXIO_MCULCD_DATA_BUS_WIDTH - 1U); - - base->flexioBase->SHIFTCTL[base->rxShifterEndIndex] = - FLEXIO_SHIFTCTL_TIMSEL(base->timerIndex) | FLEXIO_SHIFTCTL_TIMPOL(kFLEXIO_ShifterTimerPolarityOnNegitive) | - FLEXIO_SHIFTCTL_PINCFG(kFLEXIO_PinConfigOutputDisabled) | FLEXIO_SHIFTCTL_PINSEL(base->dataPinStartIndex) | - FLEXIO_SHIFTCTL_PINPOL(kFLEXIO_PinActiveHigh) | FLEXIO_SHIFTCTL_SMOD(kFLEXIO_ShifterModeReceive); - - /* Use RX shifter flag as the inverted timer trigger. */ - base->flexioBase->TIMCFG[base->timerIndex] = - FLEXIO_TIMCFG_TIMOUT(kFLEXIO_TimerOutputOneNotAffectedByReset) | - FLEXIO_TIMCFG_TIMDEC(kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput) | - FLEXIO_TIMCFG_TIMRST(kFLEXIO_TimerResetNever) | FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTimerCompare) | - FLEXIO_TIMCFG_TIMENA(kFLEXIO_TimerEnableOnTriggerHigh) | - FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitEnableOnTimerDisable) | - FLEXIO_TIMCFG_TSTART(kFLEXIO_TimerStartBitDisabled); - - timerCompare = base->flexioBase->TIMCMP[base->timerIndex] & 0xFFU; - - /* - * TIMCMP[15:8] = (number of beats x 2) - 1. Because the number of beat is 1, - * so the TIMCMP[15:8] is 1. - */ - base->flexioBase->TIMCMP[base->timerIndex] = (1UL << 8U) | timerCompare; - - base->flexioBase->TIMCTL[base->timerIndex] |= - FLEXIO_TIMCTL_TRGSEL(FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->rxShifterEndIndex)) | - FLEXIO_TIMCTL_TRGPOL(kFLEXIO_TimerTriggerPolarityActiveLow) | - FLEXIO_TIMCTL_TRGSRC(kFLEXIO_TimerTriggerSourceInternal) | FLEXIO_TIMCTL_PINCFG(kFLEXIO_PinConfigOutput) | - FLEXIO_TIMCTL_PINSEL(timerPin) | FLEXIO_TIMCTL_PINPOL(timerPinPolarity) | - FLEXIO_TIMCTL_TIMOD(kFLEXIO_TimerModeDual8BitBaudBit); -} - -/*! - * brief Clear the FLEXIO MCULCD single beats read mode configuration. - * - * Clear the read configuration set by ref FLEXIO_MCULCD_SetSingleBeatReadConfig. - * - * param base Pointer to the FLEXIO_MCULCD_Type. - * - * note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_ClearSingleBeatReadConfig(FLEXIO_MCULCD_Type *base) -{ - /* Disable the timer. */ - /* Set to bidirection output first then set to disable to avoid glitch on bus. */ - base->flexioBase->TIMCTL[base->timerIndex] = - (base->flexioBase->TIMCTL[base->timerIndex] & ~FLEXIO_TIMCTL_PINCFG_MASK) | - FLEXIO_TIMCTL_PINCFG(kFLEXIO_PinConfigBidirectionOutputData); - base->flexioBase->TIMCTL[base->timerIndex] = 0U; - base->flexioBase->TIMCFG[base->timerIndex] = 0U; - /* Clear the timer flag. */ - base->flexioBase->TIMSTAT = (1UL << base->timerIndex); - /* Stop the RX shifter. */ - base->flexioBase->SHIFTCTL[base->rxShifterEndIndex] = 0U; - base->flexioBase->SHIFTCFG[base->rxShifterEndIndex] = 0U; - /* Clear the shifter flag. */ - base->flexioBase->SHIFTSTAT = (1UL << base->rxShifterEndIndex); -} - -/*! - * brief Configures the FLEXIO MCULCD to multiple beats write mode. - * - * At the begining multiple beats write operation, the FLEXIO MCULCD is configured to - * multiple beats write mode using this function. After write operation, the configuration - * is cleared by ref FLEXIO_MCULCD_ClearMultBeatsWriteConfig. - * - * param base Pointer to the FLEXIO_MCULCD_Type. - * - * note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_SetMultiBeatsWriteConfig(FLEXIO_MCULCD_Type *base) -{ - /* - * This function will be called at the beginning of every data writing. For - * performance consideration, it access the FlexIO registers directly, but not - * call FlexIO driver APIs. - */ - - uint32_t timerCompare; - uint32_t timerControl; - uint8_t beats; - uint8_t i; - - /* Enable the TX Shifter output. */ - base->flexioBase->SHIFTCFG[base->txShifterStartIndex] = - FLEXIO_SHIFTCFG_PWIDTH((uint32_t)FLEXIO_MCULCD_DATA_BUS_WIDTH - 1U) | - FLEXIO_SHIFTCFG_INSRC(kFLEXIO_ShifterInputFromNextShifterOutput); - - base->flexioBase->SHIFTCTL[base->txShifterStartIndex] = - FLEXIO_SHIFTCTL_TIMSEL(base->timerIndex) | FLEXIO_SHIFTCTL_TIMPOL(kFLEXIO_ShifterTimerPolarityOnPositive) | - FLEXIO_SHIFTCTL_PINCFG(kFLEXIO_PinConfigOutput) | FLEXIO_SHIFTCTL_PINSEL(base->dataPinStartIndex) | - FLEXIO_SHIFTCTL_PINPOL(kFLEXIO_PinActiveHigh) | FLEXIO_SHIFTCTL_SMOD(kFLEXIO_ShifterModeTransmit); - - for (i = base->txShifterStartIndex + 1U; i <= base->txShifterEndIndex; i++) - { - base->flexioBase->SHIFTCFG[i] = FLEXIO_SHIFTCFG_PWIDTH((uint32_t)FLEXIO_MCULCD_DATA_BUS_WIDTH - 1U) | - FLEXIO_SHIFTCFG_INSRC(kFLEXIO_ShifterInputFromNextShifterOutput); - - base->flexioBase->SHIFTCTL[i] = - FLEXIO_SHIFTCTL_TIMSEL(base->timerIndex) | FLEXIO_SHIFTCTL_TIMPOL(kFLEXIO_ShifterTimerPolarityOnPositive) | - FLEXIO_SHIFTCTL_PINCFG(kFLEXIO_PinConfigOutputDisabled) | FLEXIO_SHIFTCTL_PINSEL(0) | - FLEXIO_SHIFTCTL_PINPOL(kFLEXIO_PinActiveHigh) | FLEXIO_SHIFTCTL_SMOD(kFLEXIO_ShifterModeTransmit); - } - - timerCompare = base->flexioBase->TIMCMP[base->timerIndex] & 0xFFU; - -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - beats = 4U * (base->txShifterEndIndex - base->txShifterStartIndex + 1U); -#else - beats = 2U * (base->txShifterEndIndex - base->txShifterStartIndex + 1U); -#endif - - /* - * TIMCMP[15:8] = (number of beats x 2) - 1. - */ - base->flexioBase->TIMCMP[base->timerIndex] = ((beats * 2UL - 1UL) << 8U) | timerCompare; - - /* Use TX shifter flag as the inverted timer trigger. Timer output to WR/EN pin. */ - base->flexioBase->TIMCFG[base->timerIndex] = - FLEXIO_TIMCFG_TIMOUT(kFLEXIO_TimerOutputOneNotAffectedByReset) | - FLEXIO_TIMCFG_TIMDEC(kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput) | - FLEXIO_TIMCFG_TIMRST(kFLEXIO_TimerResetNever) | FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTimerCompare) | - FLEXIO_TIMCFG_TIMENA(kFLEXIO_TimerEnableOnTriggerHigh) | FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitDisabled) | - FLEXIO_TIMCFG_TSTART(kFLEXIO_TimerStartBitDisabled); - - /* When initially configure the timer pin as output, the pin may be driven low causing glitch on bus. - Configure the pin as bidirection output first then perform a subsequent write to change to output to avoid the - issue. */ - timerControl = FLEXIO_TIMCTL_TRGSEL(FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->txShifterEndIndex)) | - FLEXIO_TIMCTL_TRGPOL(kFLEXIO_TimerTriggerPolarityActiveLow) | - FLEXIO_TIMCTL_TRGSRC(kFLEXIO_TimerTriggerSourceInternal) | - FLEXIO_TIMCTL_PINCFG(kFLEXIO_PinConfigBidirectionOutputData) | - FLEXIO_TIMCTL_PINSEL(base->ENWRPinIndex) | FLEXIO_TIMCTL_PINPOL(kFLEXIO_PinActiveLow) | - FLEXIO_TIMCTL_TIMOD(kFLEXIO_TimerModeDual8BitBaudBit); - - base->flexioBase->TIMCTL[base->timerIndex] = timerControl; - timerControl = (timerControl & ~FLEXIO_TIMCTL_PINCFG_MASK) | FLEXIO_TIMCTL_PINCFG(kFLEXIO_PinConfigOutput); - base->flexioBase->TIMCTL[base->timerIndex] = timerControl; -} - -/*! - * brief Clear the FLEXIO MCULCD multiple beats write mode configuration. - * - * Clear the write configuration set by ref FLEXIO_MCULCD_SetMultBeatsWriteConfig. - * - * param base Pointer to the FLEXIO_MCULCD_Type. - * - * note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_ClearMultiBeatsWriteConfig(FLEXIO_MCULCD_Type *base) -{ - uint8_t i; - uint32_t statusFlags = 0U; - - /* Disable the timer. */ - /* Set to bidirection output first then set to disable to avoid glitch on bus. */ - base->flexioBase->TIMCTL[base->timerIndex] = - (base->flexioBase->TIMCTL[base->timerIndex] & ~FLEXIO_TIMCTL_PINCFG_MASK) | - FLEXIO_TIMCTL_PINCFG(kFLEXIO_PinConfigBidirectionOutputData); - base->flexioBase->TIMCTL[base->timerIndex] = 0U; - base->flexioBase->TIMCFG[base->timerIndex] = 0U; - /* Clear the timer flag. */ - base->flexioBase->TIMSTAT = (1UL << base->timerIndex); - - /* Stop the TX shifter. */ - for (i = base->txShifterStartIndex; i <= base->txShifterEndIndex; i++) - { - base->flexioBase->SHIFTCFG[i] = 0U; - base->flexioBase->SHIFTCTL[i] = 0U; - statusFlags |= (1UL << i); - } - /* Clear the shifter flag. */ - base->flexioBase->SHIFTSTAT = statusFlags; -} - -/*! - * brief Configures the FLEXIO MCULCD to multiple beats read mode. - * - * At the begining or multiple beats read operation, the FLEXIO MCULCD is configured - * to multiple beats read mode using this function. After read operation, the configuration - * is cleared by ref FLEXIO_MCULCD_ClearMultBeatsReadConfig. - * - * param base Pointer to the FLEXIO_MCULCD_Type. - * - * note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_SetMultiBeatsReadConfig(FLEXIO_MCULCD_Type *base) -{ - /* - * This function will be called at the beginning of every data reading. For - * performance consideration, it access the FlexIO registers directly, but not - * call FlexIO driver APIs. - */ - - uint8_t timerPin; - uint8_t beats; - uint8_t i; - uint32_t timerCompare; - flexio_pin_polarity_t timerPinPolarity; - - /* Timer output to RD pin (8080 mode), to WR/EN pin in 6800 mode. */ - if (kFLEXIO_MCULCD_8080 == base->busType) - { - timerPin = base->RDPinIndex; - timerPinPolarity = kFLEXIO_PinActiveLow; - } - else - { - timerPin = base->ENWRPinIndex; - timerPinPolarity = kFLEXIO_PinActiveHigh; - } - - /* Enable the RX Shifter input. */ - for (i = base->rxShifterStartIndex; i < base->rxShifterEndIndex; i++) - { - base->flexioBase->SHIFTCFG[i] = FLEXIO_SHIFTCFG_PWIDTH((uint32_t)FLEXIO_MCULCD_DATA_BUS_WIDTH - 1U) | - FLEXIO_SHIFTCFG_INSRC(kFLEXIO_ShifterInputFromNextShifterOutput); - - base->flexioBase->SHIFTCTL[i] = - FLEXIO_SHIFTCTL_TIMSEL(base->timerIndex) | FLEXIO_SHIFTCTL_TIMPOL(kFLEXIO_ShifterTimerPolarityOnNegitive) | - FLEXIO_SHIFTCTL_PINCFG(kFLEXIO_PinConfigOutputDisabled) | FLEXIO_SHIFTCTL_PINSEL(base->dataPinStartIndex) | - FLEXIO_SHIFTCTL_PINPOL(kFLEXIO_PinActiveHigh) | FLEXIO_SHIFTCTL_SMOD(kFLEXIO_ShifterModeReceive); - } - - base->flexioBase->SHIFTCFG[base->rxShifterEndIndex] = - FLEXIO_SHIFTCFG_PWIDTH((uint32_t)FLEXIO_MCULCD_DATA_BUS_WIDTH - 1U); - base->flexioBase->SHIFTCTL[base->rxShifterEndIndex] = - FLEXIO_SHIFTCTL_TIMSEL(base->timerIndex) | FLEXIO_SHIFTCTL_TIMPOL(kFLEXIO_ShifterTimerPolarityOnNegitive) | - FLEXIO_SHIFTCTL_PINCFG(kFLEXIO_PinConfigOutputDisabled) | FLEXIO_SHIFTCTL_PINSEL(base->dataPinStartIndex) | - FLEXIO_SHIFTCTL_PINPOL(kFLEXIO_PinActiveHigh) | FLEXIO_SHIFTCTL_SMOD(kFLEXIO_ShifterModeReceive); - - timerCompare = base->flexioBase->TIMCMP[base->timerIndex] & 0xFFU; - -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - beats = 4U * (base->rxShifterEndIndex - base->rxShifterStartIndex + 1U); -#else - beats = 2U * (base->rxShifterEndIndex - base->rxShifterStartIndex + 1U); -#endif - - /* - * TIMCMP[15:8] = (number of beats x 2) - 1. - */ - base->flexioBase->TIMCMP[base->timerIndex] = ((beats * 2UL - 1UL) << 8U) | timerCompare; - - /* Use RX shifter flag as the inverted timer trigger. */ - base->flexioBase->TIMCFG[base->timerIndex] = - FLEXIO_TIMCFG_TIMOUT(kFLEXIO_TimerOutputOneNotAffectedByReset) | - FLEXIO_TIMCFG_TIMDEC(kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput) | - FLEXIO_TIMCFG_TIMRST(kFLEXIO_TimerResetNever) | FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTimerCompare) | - FLEXIO_TIMCFG_TIMENA(kFLEXIO_TimerEnableOnTriggerHigh) | - FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitEnableOnTimerDisable) | - FLEXIO_TIMCFG_TSTART(kFLEXIO_TimerStartBitDisabled); - - base->flexioBase->TIMCTL[base->timerIndex] |= - FLEXIO_TIMCTL_TRGSEL(FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->rxShifterEndIndex)) | - FLEXIO_TIMCTL_TRGPOL(kFLEXIO_TimerTriggerPolarityActiveLow) | - FLEXIO_TIMCTL_TRGSRC(kFLEXIO_TimerTriggerSourceInternal) | FLEXIO_TIMCTL_PINCFG(kFLEXIO_PinConfigOutput) | - FLEXIO_TIMCTL_PINSEL(timerPin) | FLEXIO_TIMCTL_PINPOL(timerPinPolarity) | - FLEXIO_TIMCTL_TIMOD(kFLEXIO_TimerModeDual8BitBaudBit); -} - -/*! - * brief Clear the FLEXIO MCULCD multiple beats read mode configuration. - * - * Clear the read configuration set by ref FLEXIO_MCULCD_SetMultBeatsReadConfig. - * - * param base Pointer to the FLEXIO_MCULCD_Type. - * - * note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_ClearMultiBeatsReadConfig(FLEXIO_MCULCD_Type *base) -{ - uint8_t i; - uint32_t statusFlags = 0U; - - /* Disable the timer. */ - /* Set to bidirection output first then set to disable to avoid glitch on bus. */ - base->flexioBase->TIMCTL[base->timerIndex] = - (base->flexioBase->TIMCTL[base->timerIndex] & ~FLEXIO_TIMCTL_PINCFG_MASK) | - FLEXIO_TIMCTL_PINCFG(kFLEXIO_PinConfigBidirectionOutputData); - base->flexioBase->TIMCTL[base->timerIndex] = 0U; - base->flexioBase->TIMCFG[base->timerIndex] = 0U; - /* Clear the timer flag. */ - base->flexioBase->TIMSTAT = (1UL << base->timerIndex); - /* Stop the RX shifter. */ - for (i = base->rxShifterStartIndex; i <= base->rxShifterEndIndex; i++) - { - base->flexioBase->SHIFTCTL[i] = 0U; - base->flexioBase->SHIFTCFG[i] = 0U; - statusFlags |= (1UL << i); - } - /* Clear the shifter flag. */ - base->flexioBase->SHIFTSTAT = statusFlags; -} - -/*! - * brief Wait for transmit data send out finished. - * - * Currently there is no effective method to wait for the data send out - * from the shiter, so here use a while loop to wait. - * - * note This is an internal used function. - */ -void FLEXIO_MCULCD_WaitTransmitComplete(void) -{ - uint32_t i = FLEXIO_MCULCD_WAIT_COMPLETE_TIME; - - while (0U != (i--)) - { - __NOP(); - } -} - -/*! - * brief Send command in blocking way. - * - * This function sends the command and returns when the command has been sent - * out. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param command The command to send. - */ -void FLEXIO_MCULCD_WriteCommandBlocking(FLEXIO_MCULCD_Type *base, uint32_t command) -{ - FLEXIO_Type *flexioBase = base->flexioBase; - - /* De-assert the RS pin. */ - base->setRSPin(false); - - /* For 6800, de-assert the RDWR pin. */ - if (kFLEXIO_MCULCD_6800 == base->busType) - { - base->setRDWRPin(false); - } - - /* Configure the timer and TX shifter. */ - FLEXIO_MCULCD_SetSingleBeatWriteConfig(base); - - /* Write command to shifter buffer. */ - flexioBase->SHIFTBUF[base->txShifterStartIndex] = command; - - /* Wait for command send out. */ - while (0U == ((1UL << base->timerIndex) & FLEXIO_GetTimerStatusFlags(flexioBase))) - { - } - - /* Stop the timer and TX shifter. */ - FLEXIO_MCULCD_ClearSingleBeatWriteConfig(base); - - /* Assert the RS pin. */ - base->setRSPin(true); - /* For 6800, assert the RDWR pin. */ - if (kFLEXIO_MCULCD_6800 == base->busType) - { - base->setRDWRPin(true); - } -} - -/*! - * brief Send data array in blocking way. - * - * This function sends the data array and returns when the data sent out. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param data The data array to send. - * param size How many bytes to write. - */ -void FLEXIO_MCULCD_WriteDataArrayBlocking(FLEXIO_MCULCD_Type *base, const void *data, size_t size) -{ - assert(size > 0U); - - uint32_t i; -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - const uint8_t *data8Bit; -#else - const uint16_t *data16Bit; -#endif - FLEXIO_Type *flexioBase = base->flexioBase; - - /* Assert the RS pin. */ - base->setRSPin(true); - /* For 6800, de-assert the RDWR pin. */ - if (kFLEXIO_MCULCD_6800 == base->busType) - { - base->setRDWRPin(false); - } - - /* Configure the timer and TX shifter. */ - FLEXIO_MCULCD_SetSingleBeatWriteConfig(base); - -/* If data bus width is 8. */ -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - data8Bit = (const uint8_t *)data; - - for (i = 0; i < size; i++) - { - flexioBase->SHIFTBUF[base->txShifterStartIndex] = data8Bit[i]; - - /* Wait for the data send out. */ - while (0U == ((1UL << base->timerIndex) & flexioBase->TIMSTAT)) - { - } - - /* Clear the timer stat. */ - flexioBase->TIMSTAT = 1UL << base->timerIndex; - } -#else - data16Bit = (const uint16_t *)data; - size /= 2U; - - for (i = 0; i < size; i++) - { - flexioBase->SHIFTBUF[base->txShifterStartIndex] = data16Bit[i]; - - /* Wait for the data send out. */ - while (0U == ((1UL << base->timerIndex) & flexioBase->TIMSTAT)) - { - } - - /* Clear the timer stat. */ - flexioBase->TIMSTAT = 1UL << base->timerIndex; - } -#endif - - /* Stop the timer and TX shifter. */ - FLEXIO_MCULCD_ClearSingleBeatWriteConfig(base); -} - -/*! - * brief Read data into array in blocking way. - * - * This function reads the data into array and returns when the data read - * finished. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param data The array to save the data. - * param size How many bytes to read. - */ -void FLEXIO_MCULCD_ReadDataArrayBlocking(FLEXIO_MCULCD_Type *base, void *data, size_t size) -{ - assert(size > 0U); - - uint32_t i; - -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - uint8_t *data8Bit = (uint8_t *)data; -#else - uint16_t *data16Bit = (uint16_t *)data; -#endif - FLEXIO_Type *flexioBase = base->flexioBase; - - /* Assert the RS pin. */ - base->setRSPin(true); - /* For 6800, de-assert the RDWR pin. */ - if (kFLEXIO_MCULCD_6800 == base->busType) - { - base->setRDWRPin(false); - } - - /* Enable the timer and RX shifter. */ - FLEXIO_MCULCD_SetSingleBeatReadConfig(base); - -/* If data bus width is 8. */ -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - for (i = 0; i < (size - 1U); i++) - { - /* Wait for shifter buffer full. */ - while (0U == ((1UL << base->rxShifterEndIndex) & FLEXIO_GetShifterStatusFlags(flexioBase))) - { - } - - data8Bit[i] = (uint8_t)flexioBase->SHIFTBUFBYS[base->rxShifterEndIndex]; - } -#else - /* Data bus width is 16. */ - size /= 2U; - - for (i = 0; i < (size - 1U); i++) - { - /* Wait for shifter buffer full. */ - while (0U == ((1UL << base->rxShifterEndIndex) & FLEXIO_GetShifterStatusFlags(flexioBase))) - { - } - - data16Bit[i] = (uint16_t)flexioBase->SHIFTBUFHWS[base->rxShifterEndIndex]; - } -#endif - - /* Wait for shifter buffer full. */ - while (0U == ((1UL << base->rxShifterEndIndex) & FLEXIO_GetShifterStatusFlags(flexioBase))) - { - } - - /* Stop the timer and disable the RX shifter. */ - FLEXIO_MCULCD_ClearSingleBeatReadConfig(base); - -/* Read out the last data. */ -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - data8Bit[i] = (uint8_t)flexioBase->SHIFTBUFBYS[base->rxShifterEndIndex]; -#else - data16Bit[i] = (uint16_t)flexioBase->SHIFTBUFHWS[base->rxShifterEndIndex]; -#endif -} - -/*! - * brief Send the same value many times in blocking way. - * - * This function sends the same value many times. It could be used to clear the - * LCD screen. If the data bus width is 8, this function will send LSB 8 bits of - * p sameValue for p size times. If the data bus is 16, this function will send - * LSB 16 bits of p sameValue for p size / 2 times. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param sameValue The same value to send. - * param size How many bytes to send. - */ -void FLEXIO_MCULCD_WriteSameValueBlocking(FLEXIO_MCULCD_Type *base, uint32_t sameValue, size_t size) -{ - assert(size > 0U); - - uint32_t i; - FLEXIO_Type *flexioBase = base->flexioBase; - -#if (16 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - size /= 2U; -#endif - - /* Assert the RS pin. */ - base->setRSPin(true); - /* For 6800, de-assert the RDWR pin. */ - if (kFLEXIO_MCULCD_6800 == base->busType) - { - base->setRDWRPin(false); - } - - /* Configure the timer and TX shifter. */ - FLEXIO_MCULCD_SetSingleBeatWriteConfig(base); - - for (i = 0; i < size; i++) - { - flexioBase->SHIFTBUF[base->txShifterStartIndex] = sameValue; - - /* Wait for the data send out. */ - while (0U == ((1UL << base->timerIndex) & flexioBase->TIMSTAT)) - { - } - - /* Clear the timer stat. */ - flexioBase->TIMSTAT = 1UL << base->timerIndex; - } - - /* Stop the timer and TX shifter. */ - FLEXIO_MCULCD_ClearSingleBeatWriteConfig(base); -} - -/*! - * brief Performs a polling transfer. - * - * note The API does not return until the transfer finished. - * - * param base pointer to FLEXIO_MCULCD_Type structure. - * param xfer pointer to flexio_mculcd_transfer_t structure. - */ -void FLEXIO_MCULCD_TransferBlocking(FLEXIO_MCULCD_Type *base, flexio_mculcd_transfer_t *xfer) -{ - FLEXIO_MCULCD_StartTransfer(base); - - if (!xfer->dataOnly) - { - FLEXIO_MCULCD_WriteCommandBlocking(base, xfer->command); - } - - if (xfer->dataSize > 0U) - { - if (kFLEXIO_MCULCD_ReadArray == xfer->mode) - { - FLEXIO_MCULCD_ReadDataArrayBlocking(base, (uint8_t *)(xfer->dataAddrOrSameValue), xfer->dataSize); - } - else if (kFLEXIO_MCULCD_WriteArray == xfer->mode) - { - FLEXIO_MCULCD_WriteDataArrayBlocking(base, (uint8_t *)(xfer->dataAddrOrSameValue), xfer->dataSize); - } - else - { - FLEXIO_MCULCD_WriteSameValueBlocking(base, xfer->dataAddrOrSameValue, xfer->dataSize); - } - } - - FLEXIO_MCULCD_StopTransfer(base); -} - -/*! - * brief Initializes the FlexIO MCULCD handle, which is used in transactional - * functions. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param handle Pointer to the flexio_mculcd_handle_t structure to store the - * transfer state. - * param callback The callback function. - * param userData The parameter of the callback function. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_MCULCD_TransferCreateHandle(FLEXIO_MCULCD_Type *base, - flexio_mculcd_handle_t *handle, - flexio_mculcd_transfer_callback_t callback, - void *userData) -{ - assert(NULL != handle); - - IRQn_Type flexio_irqs[] = FLEXIO_IRQS; - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - handle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - - /* Register callback and userData. */ - handle->completionCallback = callback; - handle->userData = userData; - - /* Enable interrupt in NVIC. */ - (void)EnableIRQ(flexio_irqs[FLEXIO_GetInstance(base->flexioBase)]); - - /* Save the context in global variables to support the double weak mechanism. - */ - return FLEXIO_RegisterHandleIRQ(base, handle, FLEXIO_MCULCD_TransferHandleIRQ); -} - -/*! - * brief Transfer data using IRQ. - * - * This function sends data using IRQ. This is a non-blocking function, which - * returns right away. When all data is sent out/received, the callback - * function is called. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param handle Pointer to the flexio_mculcd_handle_t structure to store the - * transfer state. - * param xfer FlexIO MCULCD transfer structure. See #flexio_mculcd_transfer_t. - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_InvalidArgument Input argument is invalid. - * retval kStatus_FLEXIO_MCULCD_Busy MCULCD is busy with another transfer. - */ -status_t FLEXIO_MCULCD_TransferNonBlocking(FLEXIO_MCULCD_Type *base, - flexio_mculcd_handle_t *handle, - flexio_mculcd_transfer_t *xfer) -{ - /* If previous transfer is in progress. */ - if ((uint32_t)kFLEXIO_MCULCD_StateIdle != handle->state) - { - return kStatus_FLEXIO_MCULCD_Busy; - } - - /* Set the state in handle. */ - if (kFLEXIO_MCULCD_ReadArray == xfer->mode) - { - handle->state = (uint32_t)kFLEXIO_MCULCD_StateReadArray; - } - else if (kFLEXIO_MCULCD_WriteArray == xfer->mode) - { - handle->state = (uint32_t)kFLEXIO_MCULCD_StateWriteArray; - } - else - { - handle->state = (uint32_t)kFLEXIO_MCULCD_StateWriteSameValue; - } - - /* Assert the nCS. */ - FLEXIO_MCULCD_StartTransfer(base); - - if (!xfer->dataOnly) - { - /* Send the command. */ - FLEXIO_MCULCD_WriteCommandBlocking(base, xfer->command); - } - - /* If transfer count is 0 (only to send command), return directly. */ - if (0U == xfer->dataSize) - { - handle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - - /* De-assert the nCS. */ - FLEXIO_MCULCD_StopTransfer(base); - - if (NULL != handle->completionCallback) - { - handle->completionCallback(base, handle, kStatus_FLEXIO_MCULCD_Idle, handle->userData); - } - } - else - { -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - handle->dataCount = xfer->dataSize; -#else - handle->dataCount = xfer->dataSize / 2U; -#endif - - handle->remainingCount = handle->dataCount; - - handle->dataAddrOrSameValue = xfer->dataAddrOrSameValue; - - /* Enable interrupt. */ - if (kFLEXIO_MCULCD_ReadArray == xfer->mode) - { - /* For 6800, assert the RDWR pin. */ - if (kFLEXIO_MCULCD_6800 == base->busType) - { - base->setRDWRPin(true); - } - FLEXIO_MCULCD_SetSingleBeatReadConfig(base); - FLEXIO_MCULCD_EnableInterrupts(base, (uint32_t)kFLEXIO_MCULCD_RxFullInterruptEnable); - } - else - { - /* For 6800, de-assert the RDWR pin. */ - if (kFLEXIO_MCULCD_6800 == base->busType) - { - base->setRDWRPin(false); - } - FLEXIO_MCULCD_SetSingleBeatWriteConfig(base); - FLEXIO_MCULCD_EnableInterrupts(base, (uint32_t)kFLEXIO_MCULCD_TxEmptyInterruptEnable); - } - } - - return kStatus_Success; -} - -/*! - * brief Aborts the data transfer, which used IRQ. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param handle Pointer to the flexio_mculcd_handle_t structure to store the - * transfer state. - */ -void FLEXIO_MCULCD_TransferAbort(FLEXIO_MCULCD_Type *base, flexio_mculcd_handle_t *handle) -{ - /* If no transfer in process, return directly. */ - if ((uint32_t)kFLEXIO_MCULCD_StateIdle == handle->state) - { - return; - } - - /* Disable the interrupt. */ - FLEXIO_MCULCD_DisableInterrupts( - base, (uint32_t)kFLEXIO_MCULCD_RxFullInterruptEnable | (uint32_t)kFLEXIO_MCULCD_TxEmptyInterruptEnable); - - if ((uint32_t)kFLEXIO_MCULCD_StateReadArray == handle->state) - { - /* Stop the timer and disable the RX shifter. */ - FLEXIO_MCULCD_ClearSingleBeatReadConfig(base); - } - else - { - /* Stop the timer and disable the TX shifter. */ - FLEXIO_MCULCD_ClearSingleBeatWriteConfig(base); - } - - /* Clean the flags. */ - FLEXIO_MCULCD_ClearStatusFlags(base, (uint32_t)kFLEXIO_MCULCD_TxEmptyFlag | (uint32_t)kFLEXIO_MCULCD_RxFullFlag); - - /* De-assert the nCS. */ - FLEXIO_MCULCD_StopTransfer(base); - - handle->dataCount = 0; - handle->remainingCount = 0; - handle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; -} - -/*! - * brief Gets the data transfer status which used IRQ. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param handle Pointer to the flexio_mculcd_handle_t structure to store the - * transfer state. - * param count How many bytes transferred so far by the non-blocking transaction. - * retval kStatus_Success Get the transferred count Successfully. - * retval kStatus_NoTransferInProgress No transfer in process. - */ -status_t FLEXIO_MCULCD_TransferGetCount(FLEXIO_MCULCD_Type *base, flexio_mculcd_handle_t *handle, size_t *count) -{ - assert(NULL != count); - - if ((uint32_t)kFLEXIO_MCULCD_StateIdle == handle->state) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->dataCount - handle->remainingCount; - -#if (16 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - *count *= 2U; -#endif - - return kStatus_Success; -} - -/*! - * brief FlexIO MCULCD IRQ handler function. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param handle Pointer to the flexio_mculcd_handle_t structure to store the - * transfer state. - */ -void FLEXIO_MCULCD_TransferHandleIRQ(void *base, void *handle) -{ - FLEXIO_MCULCD_Type *flexioLcdMcuBase = (FLEXIO_MCULCD_Type *)base; - flexio_mculcd_handle_t *flexioLcdMcuHandle = (flexio_mculcd_handle_t *)handle; - uint32_t statusFlags = FLEXIO_MCULCD_GetStatusFlags(flexioLcdMcuBase); - uint32_t data; - - if ((uint32_t)kFLEXIO_MCULCD_StateReadArray == flexioLcdMcuHandle->state) - { - /* Handle the reading process. */ - while ((0U != ((uint32_t)kFLEXIO_MCULCD_RxFullFlag & statusFlags)) && (flexioLcdMcuHandle->remainingCount > 0U)) - { - if (1U == flexioLcdMcuHandle->remainingCount) - { - /* If this is the last data, stop the RX shifter and timer. */ - FLEXIO_MCULCD_DisableInterrupts(flexioLcdMcuBase, (uint32_t)kFLEXIO_MCULCD_RxFullInterruptEnable); - FLEXIO_MCULCD_ClearSingleBeatReadConfig(flexioLcdMcuBase); - FLEXIO_MCULCD_StopTransfer(flexioLcdMcuBase); - } - - /* Read out the data. */ - data = FLEXIO_MCULCD_ReadData(flexioLcdMcuBase); - -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - *(uint8_t *)(flexioLcdMcuHandle->dataAddrOrSameValue) = (uint8_t)data; - flexioLcdMcuHandle->dataAddrOrSameValue++; -#else - *(uint16_t *)(flexioLcdMcuHandle->dataAddrOrSameValue) = (uint16_t)data; - flexioLcdMcuHandle->dataAddrOrSameValue += 2U; -#endif - - flexioLcdMcuHandle->remainingCount--; - - /* Transfer finished, call the callback. */ - if (0U == flexioLcdMcuHandle->remainingCount) - { - flexioLcdMcuHandle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - - if (NULL != flexioLcdMcuHandle->completionCallback) - { - flexioLcdMcuHandle->completionCallback(flexioLcdMcuBase, flexioLcdMcuHandle, - kStatus_FLEXIO_MCULCD_Idle, flexioLcdMcuHandle->userData); - } - } - - /* Is the shifter buffer ready to send the next data? */ - statusFlags = FLEXIO_MCULCD_GetStatusFlags(flexioLcdMcuBase); - } - } - else - { - /* Handle the writing process. */ - while ((0U != ((uint32_t)kFLEXIO_MCULCD_TxEmptyFlag & statusFlags)) && - (flexioLcdMcuHandle->remainingCount > 0U)) - { - /* Send the data. */ - if ((uint32_t)kFLEXIO_MCULCD_StateWriteSameValue == flexioLcdMcuHandle->state) - { - data = flexioLcdMcuHandle->dataAddrOrSameValue; - } - else - { -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - data = *(uint8_t *)(flexioLcdMcuHandle->dataAddrOrSameValue); - flexioLcdMcuHandle->dataAddrOrSameValue++; -#else - data = *(uint16_t *)(flexioLcdMcuHandle->dataAddrOrSameValue); - flexioLcdMcuHandle->dataAddrOrSameValue += 2U; -#endif - } - - /* If this is the last data to send, delay to wait for the data shift out. */ - if (1U == flexioLcdMcuHandle->remainingCount) - { - FLEXIO_MCULCD_DisableInterrupts(flexioLcdMcuBase, (uint32_t)kFLEXIO_MCULCD_TxEmptyInterruptEnable); - - /* Write the last data. */ - FLEXIO_MCULCD_WriteData(flexioLcdMcuBase, data); - - /* Wait for the last data send finished. */ - FLEXIO_MCULCD_WaitTransmitComplete(); - flexioLcdMcuHandle->remainingCount = 0; - - FLEXIO_MCULCD_ClearSingleBeatWriteConfig(flexioLcdMcuBase); - FLEXIO_MCULCD_StopTransfer(flexioLcdMcuBase); - flexioLcdMcuHandle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - - if (NULL != flexioLcdMcuHandle->completionCallback) - { - flexioLcdMcuHandle->completionCallback(flexioLcdMcuBase, flexioLcdMcuHandle, - kStatus_FLEXIO_MCULCD_Idle, flexioLcdMcuHandle->userData); - } - } - else - { - FLEXIO_MCULCD_WriteData(flexioLcdMcuBase, data); - flexioLcdMcuHandle->remainingCount--; - } - /* Is the shifter buffer ready to send the next data? */ - statusFlags = FLEXIO_MCULCD_GetStatusFlags(flexioLcdMcuBase); - } - } -} \ No newline at end of file diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_mculcd.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_mculcd.h deleted file mode 100644 index 298287b48da..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_mculcd.h +++ /dev/null @@ -1,686 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_FLEXIO_MCULCD_H_ -#define FSL_FLEXIO_MCULCD_H_ - -#include "fsl_common.h" -#include "fsl_flexio.h" - -/*! - * @addtogroup flexio_mculcd - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief FlexIO MCULCD driver version. */ -#define FSL_FLEXIO_MCULCD_DRIVER_VERSION (MAKE_VERSION(2, 1, 0)) -/*! @} */ - -#ifndef FLEXIO_MCULCD_WAIT_COMPLETE_TIME -/*! - * @brief The delay time to wait for FLEXIO transmit complete. - * - * Currently there is no method to detect whether the data has been - * sent out from the shifter, so the driver use a software delay for this. When - * the data is written to shifter buffer, the driver call the delay - * function to wait for the data shift out. - * If this value is too small, then the last few bytes might be lost when writing - * data using interrupt method or DMA method. - */ -#define FLEXIO_MCULCD_WAIT_COMPLETE_TIME 512 -#endif - -#ifndef FLEXIO_MCULCD_DATA_BUS_WIDTH -/*! - * @brief The data bus width, must be 8 or 16. - */ -#define FLEXIO_MCULCD_DATA_BUS_WIDTH 16UL -#endif - -#if (16UL != FLEXIO_MCULCD_DATA_BUS_WIDTH) && (8UL != FLEXIO_MCULCD_DATA_BUS_WIDTH) -#error Only support data bus 8-bit or 16-bit -#endif - -/*! @brief FlexIO LCD transfer status */ -enum -{ - kStatus_FLEXIO_MCULCD_Idle = MAKE_STATUS(kStatusGroup_FLEXIO_MCULCD, 0), /*!< FlexIO LCD is idle. */ - kStatus_FLEXIO_MCULCD_Busy = MAKE_STATUS(kStatusGroup_FLEXIO_MCULCD, 1), /*!< FlexIO LCD is busy */ - kStatus_FLEXIO_MCULCD_Error = MAKE_STATUS(kStatusGroup_FLEXIO_MCULCD, 2), /*!< FlexIO LCD error occurred */ -}; - -/*! @brief Define FlexIO MCULCD pixel format. */ -typedef enum _flexio_mculcd_pixel_format -{ - kFLEXIO_MCULCD_RGB565 = 0, /*!< RGB565, 16-bit. */ - kFLEXIO_MCULCD_BGR565, /*!< BGR565, 16-bit. */ - kFLEXIO_MCULCD_RGB888, /*!< RGB888, 24-bit. */ - kFLEXIO_MCULCD_BGR888, /*!< BGR888, 24-bit. */ -} flexio_mculcd_pixel_format_t; - -/*! @brief Define FlexIO MCULCD bus type. */ -typedef enum _flexio_mculcd_bus -{ - kFLEXIO_MCULCD_8080, /*!< Using Intel 8080 bus. */ - kFLEXIO_MCULCD_6800, /*!< Using Motorola 6800 bus. */ -} flexio_mculcd_bus_t; - -/*! @brief Define FlexIO MCULCD interrupt mask. */ -enum _flexio_mculcd_interrupt_enable -{ - kFLEXIO_MCULCD_TxEmptyInterruptEnable = (1U << 0U), /*!< Transmit buffer empty interrupt enable. */ - kFLEXIO_MCULCD_RxFullInterruptEnable = (1U << 1U), /*!< Receive buffer full interrupt enable. */ -}; - -/*! @brief Define FlexIO MCULCD status mask. */ -enum _flexio_mculcd_status_flags -{ - kFLEXIO_MCULCD_TxEmptyFlag = (1U << 0U), /*!< Transmit buffer empty flag. */ - kFLEXIO_MCULCD_RxFullFlag = (1U << 1U), /*!< Receive buffer full flag. */ -}; - -/*! @brief Define FlexIO MCULCD DMA mask. */ -enum _flexio_mculcd_dma_enable -{ - kFLEXIO_MCULCD_TxDmaEnable = 0x1U, /*!< Tx DMA request source */ - kFLEXIO_MCULCD_RxDmaEnable = 0x2U, /*!< Rx DMA request source */ -}; - -/*! @brief Function to set or clear the CS and RS pin. */ -typedef void (*flexio_mculcd_pin_func_t)(bool set); - -/*! @brief Define FlexIO MCULCD access structure typedef. */ -typedef struct _flexio_mculcd_type -{ - FLEXIO_Type *flexioBase; /*!< FlexIO base pointer. */ - flexio_mculcd_bus_t busType; /*!< The bus type, 8080 or 6800. */ - uint8_t dataPinStartIndex; /*!< Start index of the data pin, the FlexIO pin dataPinStartIndex - to (dataPinStartIndex + FLEXIO_MCULCD_DATA_BUS_WIDTH -1) - will be used for data transfer. Only support data bus width 8 and 16. */ - uint8_t ENWRPinIndex; /*!< Pin select for WR(8080 mode), EN(6800 mode). */ - uint8_t RDPinIndex; /*!< Pin select for RD(8080 mode), not used in 6800 mode. */ - uint8_t txShifterStartIndex; /*!< Start index of shifters used for data write, it must be 0 or 4. */ - uint8_t txShifterEndIndex; /*!< End index of shifters used for data write. */ - uint8_t rxShifterStartIndex; /*!< Start index of shifters used for data read. */ - uint8_t rxShifterEndIndex; /*!< End index of shifters used for data read, it must be 3 or 7. */ - uint8_t timerIndex; /*!< Timer index used in FlexIO MCULCD. */ - flexio_mculcd_pin_func_t setCSPin; /*!< Function to set or clear the CS pin. */ - flexio_mculcd_pin_func_t setRSPin; /*!< Function to set or clear the RS pin. */ - flexio_mculcd_pin_func_t setRDWRPin; /*!< Function to set or clear the RD/WR pin, only used in 6800 mode. */ -} FLEXIO_MCULCD_Type; - -/*! @brief Define FlexIO MCULCD configuration structure. */ -typedef struct _flexio_mculcd_config -{ - bool enable; /*!< Enable/disable FlexIO MCULCD after configuration. */ - bool enableInDoze; /*!< Enable/disable FlexIO operation in doze mode. */ - bool enableInDebug; /*!< Enable/disable FlexIO operation in debug mode. */ - bool enableFastAccess; /*!< Enable/disable fast access to FlexIO registers, - fast access requires the FlexIO clock to be at least - twice the frequency of the bus clock. */ - uint32_t baudRate_Bps; /*!< Baud rate in bit-per-second for all data lines combined. */ -} flexio_mculcd_config_t; - -/*! @brief Transfer mode.*/ -typedef enum _flexio_mculcd_transfer_mode -{ - kFLEXIO_MCULCD_ReadArray, /*!< Read data into an array. */ - kFLEXIO_MCULCD_WriteArray, /*!< Write data from an array. */ - kFLEXIO_MCULCD_WriteSameValue, /*!< Write the same value many times. */ -} flexio_mculcd_transfer_mode_t; - -/*! @brief Define FlexIO MCULCD transfer structure. */ -typedef struct _flexio_mculcd_transfer -{ - uint32_t command; /*!< Command to send. */ - uint32_t dataAddrOrSameValue; /*!< When sending the same value for many times, - this is the value to send. When writing or reading array, - this is the address of the data array. */ - size_t dataSize; /*!< How many bytes to transfer. */ - flexio_mculcd_transfer_mode_t mode; /*!< Transfer mode. */ - bool dataOnly; /*!< Send data only when tx without the command. */ -} flexio_mculcd_transfer_t; - -/*! @brief typedef for flexio_mculcd_handle_t in advance. */ -typedef struct _flexio_mculcd_handle flexio_mculcd_handle_t; - -/*! @brief FlexIO MCULCD callback for finished transfer. - * - * When transfer finished, the callback function is called and returns the - * @p status as kStatus_FLEXIO_MCULCD_Idle. - */ -typedef void (*flexio_mculcd_transfer_callback_t)(FLEXIO_MCULCD_Type *base, - flexio_mculcd_handle_t *handle, - status_t status, - void *userData); - -/*! @brief Define FlexIO MCULCD handle structure. */ -struct _flexio_mculcd_handle -{ - uint32_t dataAddrOrSameValue; /*!< When sending the same value for many times, - this is the value to send. When writing or reading array, - this is the address of the data array. */ - size_t dataCount; /*!< Total count to be transferred. */ - volatile size_t remainingCount; /*!< Remaining count to transfer. */ - volatile uint32_t state; /*!< FlexIO MCULCD internal state. */ - flexio_mculcd_transfer_callback_t completionCallback; /*!< FlexIO MCULCD transfer completed callback. */ - void *userData; /*!< Callback parameter. */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus*/ - -/*! - * @name FlexIO MCULCD Configuration - * @{ - */ - -/*! - * @brief Ungates the FlexIO clock, resets the FlexIO module, configures the - * FlexIO MCULCD hardware, and configures the FlexIO MCULCD with FlexIO MCULCD - * configuration. - * The configuration structure can be filled by the user, or be set with default - * values - * by the @ref FLEXIO_MCULCD_GetDefaultConfig. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param config Pointer to the flexio_mculcd_config_t structure. - * @param srcClock_Hz FlexIO source clock in Hz. - * @retval kStatus_Success Initialization success. - * @retval kStatus_InvalidArgument Initialization failed because of invalid - * argument. - */ -status_t FLEXIO_MCULCD_Init(FLEXIO_MCULCD_Type *base, flexio_mculcd_config_t *config, uint32_t srcClock_Hz); - -/*! - * @brief Resets the FLEXIO_MCULCD timer and shifter configuration. - * - * @param base Pointer to the FLEXIO_MCULCD_Type. - */ -void FLEXIO_MCULCD_Deinit(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Gets the default configuration to configure the FlexIO MCULCD. - * - * The default configuration value is: - * @code - * config->enable = true; - * config->enableInDoze = false; - * config->enableInDebug = true; - * config->enableFastAccess = true; - * config->baudRate_Bps = 96000000U; - * @endcode - * @param config Pointer to the flexio_mculcd_config_t structure. - */ -void FLEXIO_MCULCD_GetDefaultConfig(flexio_mculcd_config_t *config); - -/*! @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets FlexIO MCULCD status flags. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @return status flag; OR'ed value or the @ref _flexio_mculcd_status_flags. - * - * @note Don't use this function with DMA APIs. - */ -uint32_t FLEXIO_MCULCD_GetStatusFlags(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Clears FlexIO MCULCD status flags. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param mask Status to clear, it is the OR'ed value of @ref - * _flexio_mculcd_status_flags. - * - * @note Don't use this function with DMA APIs. - */ -void FLEXIO_MCULCD_ClearStatusFlags(FLEXIO_MCULCD_Type *base, uint32_t mask); - -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables the FlexIO MCULCD interrupt. - * - * This function enables the FlexIO MCULCD interrupt. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param mask Interrupts to enable, it is the OR'ed value of @ref - * _flexio_mculcd_interrupt_enable. - */ -void FLEXIO_MCULCD_EnableInterrupts(FLEXIO_MCULCD_Type *base, uint32_t mask); - -/*! - * @brief Disables the FlexIO MCULCD interrupt. - * - * This function disables the FlexIO MCULCD interrupt. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param mask Interrupts to disable, it is the OR'ed value of @ref - * _flexio_mculcd_interrupt_enable. - */ -void FLEXIO_MCULCD_DisableInterrupts(FLEXIO_MCULCD_Type *base, uint32_t mask); - -/*! @} */ - -/*! - * @name DMA Control - * @{ - */ - -/*! - * @brief Enables/disables the FlexIO MCULCD transmit DMA. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param enable True means enable DMA, false means disable DMA. - */ -static inline void FLEXIO_MCULCD_EnableTxDMA(FLEXIO_MCULCD_Type *base, bool enable) -{ - FLEXIO_EnableShifterStatusDMA(base->flexioBase, (1UL << base->txShifterStartIndex), enable); -} - -/*! - * @brief Enables/disables the FlexIO MCULCD receive DMA. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param enable True means enable DMA, false means disable DMA. - */ -static inline void FLEXIO_MCULCD_EnableRxDMA(FLEXIO_MCULCD_Type *base, bool enable) -{ - FLEXIO_EnableShifterStatusDMA(base->flexioBase, (1UL << base->rxShifterEndIndex), enable); -} - -/*! - * @brief Gets the FlexIO MCULCD transmit data register address. - * - * This function returns the MCULCD data register address, which is mainly used - * by DMA/eDMA. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @return FlexIO MCULCD transmit data register address. - */ -static inline uint32_t FLEXIO_MCULCD_GetTxDataRegisterAddress(FLEXIO_MCULCD_Type *base) -{ - return (uint32_t) & (base->flexioBase->SHIFTBUF[base->txShifterStartIndex]); -} - -/*! - * @brief Gets the FlexIO MCULCD receive data register address. - * - * This function returns the MCULCD data register address, which is mainly used - * by DMA/eDMA. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @return FlexIO MCULCD receive data register address. - */ -static inline uint32_t FLEXIO_MCULCD_GetRxDataRegisterAddress(FLEXIO_MCULCD_Type *base) -{ - return (uint32_t) & (base->flexioBase->SHIFTBUF[base->rxShifterStartIndex]); -} - -/*! @} */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Set desired baud rate. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param baudRate_Bps Desired baud rate in bit-per-second for all data lines combined. - * @param srcClock_Hz FLEXIO clock frequency in Hz. - * @retval kStatus_Success Set successfully. - * @retval kStatus_InvalidArgument Could not set the baud rate. - */ -status_t FLEXIO_MCULCD_SetBaudRate(FLEXIO_MCULCD_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz); - -/*! - * @brief Configures the FLEXIO MCULCD to multiple beats write mode. - * - * At the begining multiple beats write operation, the FLEXIO MCULCD is configured to - * multiple beats write mode using this function. After write operation, the configuration - * is cleared by @ref FLEXIO_MCULCD_ClearSingleBeatWriteConfig. - * - * @param base Pointer to the FLEXIO_MCULCD_Type. - * - * @note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_SetSingleBeatWriteConfig(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Clear the FLEXIO MCULCD multiple beats write mode configuration. - * - * Clear the write configuration set by @ref FLEXIO_MCULCD_SetSingleBeatWriteConfig. - * - * @param base Pointer to the FLEXIO_MCULCD_Type. - * - * @note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_ClearSingleBeatWriteConfig(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Configures the FLEXIO MCULCD to multiple beats read mode. - * - * At the begining or multiple beats read operation, the FLEXIO MCULCD is configured - * to multiple beats read mode using this function. After read operation, the configuration - * is cleared by @ref FLEXIO_MCULCD_ClearSingleBeatReadConfig. - * - * @param base Pointer to the FLEXIO_MCULCD_Type. - * - * @note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_SetSingleBeatReadConfig(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Clear the FLEXIO MCULCD multiple beats read mode configuration. - * - * Clear the read configuration set by @ref FLEXIO_MCULCD_SetSingleBeatReadConfig. - * - * @param base Pointer to the FLEXIO_MCULCD_Type. - * - * @note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_ClearSingleBeatReadConfig(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Configures the FLEXIO MCULCD to multiple beats write mode. - * - * At the begining multiple beats write operation, the FLEXIO MCULCD is configured to - * multiple beats write mode using this function. After write operation, the configuration - * is cleared by FLEXIO_MCULCD_ClearMultBeatsWriteConfig. - * - * @param base Pointer to the FLEXIO_MCULCD_Type. - * - * @note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_SetMultiBeatsWriteConfig(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Clear the FLEXIO MCULCD multiple beats write mode configuration. - * - * Clear the write configuration set by FLEXIO_MCULCD_SetMultBeatsWriteConfig. - * - * @param base Pointer to the FLEXIO_MCULCD_Type. - * - * @note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_ClearMultiBeatsWriteConfig(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Configures the FLEXIO MCULCD to multiple beats read mode. - * - * At the begining or multiple beats read operation, the FLEXIO MCULCD is configured - * to multiple beats read mode using this function. After read operation, the configuration - * is cleared by FLEXIO_MCULCD_ClearMultBeatsReadConfig. - * - * @param base Pointer to the FLEXIO_MCULCD_Type. - * - * @note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_SetMultiBeatsReadConfig(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Clear the FLEXIO MCULCD multiple beats read mode configuration. - * - * Clear the read configuration set by FLEXIO_MCULCD_SetMultBeatsReadConfig. - * - * @param base Pointer to the FLEXIO_MCULCD_Type. - * - * @note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_ClearMultiBeatsReadConfig(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Enables/disables the FlexIO MCULCD module operation. - * - * @param base Pointer to the FLEXIO_MCULCD_Type. - * @param enable True to enable, false does not have any effect. - */ -static inline void FLEXIO_MCULCD_Enable(FLEXIO_MCULCD_Type *base, bool enable) -{ - if (enable) - { - FLEXIO_Enable(base->flexioBase, enable); - } -} - -/*! - * @brief Read data from the FLEXIO MCULCD RX shifter buffer. - * - * Read data from the RX shift buffer directly, it does no check whether the - * buffer is empty or not. - * - * If the data bus width is 8-bit: - * @code - * uint8_t value; - * value = (uint8_t)FLEXIO_MCULCD_ReadData(base); - * @endcode - * - * If the data bus width is 16-bit: - * @code - * uint16_t value; - * value = (uint16_t)FLEXIO_MCULCD_ReadData(base); - * @endcode - * - * @note This function returns the RX shifter buffer value (32-bit) directly. - * The return value should be converted according to data bus width. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @return The data read out. - * - * @note Don't use this function with DMA APIs. - */ -uint32_t FLEXIO_MCULCD_ReadData(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Write data into the FLEXIO MCULCD TX shifter buffer. - * - * Write data into the TX shift buffer directly, it does no check whether the - * buffer is full or not. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param data The data to write. - * - * @note Don't use this function with DMA APIs. - */ -static inline void FLEXIO_MCULCD_WriteData(FLEXIO_MCULCD_Type *base, uint32_t data) -{ - base->flexioBase->SHIFTBUF[base->txShifterStartIndex] = data; -} - -/*! - * @brief Assert the nCS to start transfer. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - */ -static inline void FLEXIO_MCULCD_StartTransfer(FLEXIO_MCULCD_Type *base) -{ - base->setCSPin(false); -} - -/*! - * @brief De-assert the nCS to stop transfer. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - */ -static inline void FLEXIO_MCULCD_StopTransfer(FLEXIO_MCULCD_Type *base) -{ - base->setCSPin(true); -} - -/*! - * @brief Wait for transmit data send out finished. - * - * Currently there is no effective method to wait for the data send out - * from the shiter, so here use a while loop to wait. - * - * @note This is an internal used function. - */ -void FLEXIO_MCULCD_WaitTransmitComplete(void); - -/*! - * @brief Send command in blocking way. - * - * This function sends the command and returns when the command has been sent - * out. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param command The command to send. - */ -void FLEXIO_MCULCD_WriteCommandBlocking(FLEXIO_MCULCD_Type *base, uint32_t command); - -/*! - * @brief Send data array in blocking way. - * - * This function sends the data array and returns when the data sent out. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param data The data array to send. - * @param size How many bytes to write. - */ -void FLEXIO_MCULCD_WriteDataArrayBlocking(FLEXIO_MCULCD_Type *base, const void *data, size_t size); - -/*! - * @brief Read data into array in blocking way. - * - * This function reads the data into array and returns when the data read - * finished. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param data The array to save the data. - * @param size How many bytes to read. - */ -void FLEXIO_MCULCD_ReadDataArrayBlocking(FLEXIO_MCULCD_Type *base, void *data, size_t size); - -/*! - * @brief Send the same value many times in blocking way. - * - * This function sends the same value many times. It could be used to clear the - * LCD screen. If the data bus width is 8, this function will send LSB 8 bits of - * @p sameValue for @p size times. If the data bus is 16, this function will send - * LSB 16 bits of @p sameValue for @p size / 2 times. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param sameValue The same value to send. - * @param size How many bytes to send. - */ -void FLEXIO_MCULCD_WriteSameValueBlocking(FLEXIO_MCULCD_Type *base, uint32_t sameValue, size_t size); - -/*! - * @brief Performs a polling transfer. - * - * @note The API does not return until the transfer finished. - * - * @param base pointer to FLEXIO_MCULCD_Type structure. - * @param xfer pointer to flexio_mculcd_transfer_t structure. - */ -void FLEXIO_MCULCD_TransferBlocking(FLEXIO_MCULCD_Type *base, flexio_mculcd_transfer_t *xfer); -/*! @} */ - -/*! - * @name Transactional - * @{ - */ - -/*! - * @brief Initializes the FlexIO MCULCD handle, which is used in transactional - * functions. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param handle Pointer to the flexio_mculcd_handle_t structure to store the - * transfer state. - * @param callback The callback function. - * @param userData The parameter of the callback function. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_MCULCD_TransferCreateHandle(FLEXIO_MCULCD_Type *base, - flexio_mculcd_handle_t *handle, - flexio_mculcd_transfer_callback_t callback, - void *userData); - -/*! - * @brief Transfer data using IRQ. - * - * This function sends data using IRQ. This is a non-blocking function, which - * returns right away. When all data is sent out/received, the callback - * function is called. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param handle Pointer to the flexio_mculcd_handle_t structure to store the - * transfer state. - * @param xfer FlexIO MCULCD transfer structure. See #flexio_mculcd_transfer_t. - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_InvalidArgument Input argument is invalid. - * @retval kStatus_FLEXIO_MCULCD_Busy MCULCD is busy with another transfer. - */ -status_t FLEXIO_MCULCD_TransferNonBlocking(FLEXIO_MCULCD_Type *base, - flexio_mculcd_handle_t *handle, - flexio_mculcd_transfer_t *xfer); - -/*! - * @brief Aborts the data transfer, which used IRQ. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param handle Pointer to the flexio_mculcd_handle_t structure to store the - * transfer state. - */ -void FLEXIO_MCULCD_TransferAbort(FLEXIO_MCULCD_Type *base, flexio_mculcd_handle_t *handle); - -/*! - * @brief Gets the data transfer status which used IRQ. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param handle Pointer to the flexio_mculcd_handle_t structure to store the - * transfer state. - * @param count How many bytes transferred so far by the non-blocking transaction. - * @retval kStatus_Success Get the transferred count Successfully. - * @retval kStatus_NoTransferInProgress No transfer in process. - */ -status_t FLEXIO_MCULCD_TransferGetCount(FLEXIO_MCULCD_Type *base, flexio_mculcd_handle_t *handle, size_t *count); - -/*! - * @brief FlexIO MCULCD IRQ handler function. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param handle Pointer to the flexio_mculcd_handle_t structure to store the - * transfer state. - */ -void FLEXIO_MCULCD_TransferHandleIRQ(void *base, void *handle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /*_cplusplus*/ -/*! @} */ - -#endif /*FSL_FLEXIO_MCULCD_H_*/ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_mculcd_edma.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_mculcd_edma.c deleted file mode 100644 index 0c52c4e8c08..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_mculcd_edma.c +++ /dev/null @@ -1,568 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2019,2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio_mculcd_edma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio_mculcd_edma" -#endif - -#define EDMA_MAX_MAJOR_COUNT (DMA_CITER_ELINKNO_CITER_MASK >> DMA_CITER_ELINKNO_CITER_SHIFT) - -enum -{ - kFLEXIO_MCULCD_StateIdle, /*!< No transfer in progress. */ - kFLEXIO_MCULCD_StateReadArray, /*!< Reading array in progress. */ - kFLEXIO_MCULCD_StateWriteArray, /*!< Writing array in progress. */ - kFLEXIO_MCULCD_StateWriteSameValue, /*!< Writing the same value in progress. - */ -}; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief EDMA callback function for FLEXIO MCULCD TX. - * - * For details, see @ref edma_callback. - */ -static void FLEXIO_MCULCD_TxEDMACallback(edma_handle_t *DmaHandle, void *param, bool transferDone, uint32_t tcds); - -/*! - * @brief EDMA callback function for FLEXIO MCULCD RX. - * - * For details, see @ref edma_callback. - */ -static void FLEXIO_MCULCD_RxEDMACallback(edma_handle_t *DmaHandle, void *param, bool transferDone, uint32_t tcds); - -/*! - * @brief Set EDMA config for FLEXIO MCULCD transfer. - * - * @param base pointer to FLEXIO_MCULCD_Type structure. - * @param handle pointer to flexio_mculcd_edma_handle_t structure to store the - * transfer state. - */ -static void FLEXIO_MCULCD_EDMAConfig(FLEXIO_MCULCD_Type *base, flexio_mculcd_edma_handle_t *handle); - -/*! - * @brief Convert the FlexIO shifter number to eDMA modulo. - * - * @param shifterNum The FlexIO shifter number. - * @param modulo The modulo number. - * @retval Get the modulo successfully. - * @retval Could not get the modulo for the shifter number. - */ -static bool FLEXIO_MCULCD_GetEDMAModulo(uint8_t shifterNum, edma_modulo_t *modulo); - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -static void FLEXIO_MCULCD_TxEDMACallback(edma_handle_t *DmaHandle, void *param, bool transferDone, uint32_t tcds) -{ - tcds = tcds; - flexio_mculcd_edma_handle_t *flexioLcdMcuHandle = (flexio_mculcd_edma_handle_t *)param; - FLEXIO_MCULCD_Type *flexioLcdMcuBase = flexioLcdMcuHandle->base; - - if (transferDone) - { - if (flexioLcdMcuHandle->remainingCount >= flexioLcdMcuHandle->minorLoopBytes) - { - FLEXIO_MCULCD_EDMAConfig(flexioLcdMcuBase, flexioLcdMcuHandle); - EDMA_StartTransfer(flexioLcdMcuHandle->txDmaHandle); - } - else - { - FLEXIO_MCULCD_EnableTxDMA(flexioLcdMcuBase, false); - - /* Now the data are in shifter, wait for the data send out from the shifter. */ - FLEXIO_MCULCD_WaitTransmitComplete(); - - /* Disable the TX shifter and the timer. */ - FLEXIO_MCULCD_ClearMultiBeatsWriteConfig(flexioLcdMcuBase); - - /* Send the remaining data. */ - if (0U != flexioLcdMcuHandle->remainingCount) - { - if ((uint32_t)kFLEXIO_MCULCD_StateWriteSameValue == flexioLcdMcuHandle->state) - { - FLEXIO_MCULCD_WriteSameValueBlocking(flexioLcdMcuBase, flexioLcdMcuHandle->dataAddrOrSameValue, - flexioLcdMcuHandle->remainingCount); - } - else - { - FLEXIO_MCULCD_WriteDataArrayBlocking(flexioLcdMcuBase, - (uint8_t *)flexioLcdMcuHandle->dataAddrOrSameValue, - flexioLcdMcuHandle->remainingCount); - } - } - - /* De-assert nCS. */ - FLEXIO_MCULCD_StopTransfer(flexioLcdMcuBase); - - /* Change the state. */ - flexioLcdMcuHandle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - flexioLcdMcuHandle->dataCount = 0; - flexioLcdMcuHandle->remainingCount = 0; - - /* Callback to inform upper layer. */ - if (NULL != flexioLcdMcuHandle->completionCallback) - { - flexioLcdMcuHandle->completionCallback(flexioLcdMcuBase, flexioLcdMcuHandle, kStatus_FLEXIO_MCULCD_Idle, - flexioLcdMcuHandle->userData); - } - } - } -} - -static void FLEXIO_MCULCD_RxEDMACallback(edma_handle_t *DmaHandle, void *param, bool transferDone, uint32_t tcds) -{ - tcds = tcds; - uint32_t i; - uint32_t rxBufAddr; - flexio_mculcd_edma_handle_t *flexioLcdMcuHandle = (flexio_mculcd_edma_handle_t *)param; - FLEXIO_MCULCD_Type *flexioLcdMcuBase = flexioLcdMcuHandle->base; - FLEXIO_Type *flexioBase = flexioLcdMcuBase->flexioBase; - - if (transferDone) - { - if (flexioLcdMcuHandle->remainingCount >= (2U * flexioLcdMcuHandle->minorLoopBytes)) - { - FLEXIO_MCULCD_EDMAConfig(flexioLcdMcuBase, flexioLcdMcuHandle); - EDMA_StartTransfer(flexioLcdMcuHandle->rxDmaHandle); - } - else - { - FLEXIO_MCULCD_EnableRxDMA(flexioLcdMcuBase, false); - - /* Wait the data saved to the shifter buffer. */ - while (0U == ((1UL << flexioLcdMcuBase->rxShifterEndIndex) & FLEXIO_GetShifterStatusFlags(flexioBase))) - { - } - - /* Disable the RX shifter and the timer. */ - FLEXIO_MCULCD_ClearMultiBeatsReadConfig(flexioLcdMcuBase); - - rxBufAddr = FLEXIO_MCULCD_GetRxDataRegisterAddress(flexioLcdMcuBase); - -/* Read out the data. */ -#if (defined(__CORTEX_M) && (__CORTEX_M == 0)) - /* Cortex M0 and M0+ only support aligned access. */ - for (i = 0; i < flexioLcdMcuHandle->rxShifterNum * 4; i++) - { - ((uint8_t *)(flexioLcdMcuHandle->dataAddrOrSameValue))[i] = ((volatile uint8_t *)rxBufAddr)[i]; - } -#else - for (i = 0; i < flexioLcdMcuHandle->rxShifterNum; i++) - { - ((uint32_t *)(flexioLcdMcuHandle->dataAddrOrSameValue))[i] = ((volatile uint32_t *)rxBufAddr)[i]; - } -#endif - flexioLcdMcuHandle->remainingCount -= flexioLcdMcuHandle->minorLoopBytes; - - if (0U != flexioLcdMcuHandle->remainingCount) - { - FLEXIO_MCULCD_ReadDataArrayBlocking( - flexioLcdMcuBase, - (uint8_t *)(flexioLcdMcuHandle->dataAddrOrSameValue + flexioLcdMcuHandle->minorLoopBytes), - flexioLcdMcuHandle->remainingCount); - } - - /* De-assert nCS. */ - FLEXIO_MCULCD_StopTransfer(flexioLcdMcuBase); - - /* Change the state. */ - flexioLcdMcuHandle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - flexioLcdMcuHandle->dataCount = 0; - flexioLcdMcuHandle->remainingCount = 0; - - /* Callback to inform upper layer. */ - if (NULL != flexioLcdMcuHandle->completionCallback) - { - flexioLcdMcuHandle->completionCallback(flexioLcdMcuBase, flexioLcdMcuHandle, kStatus_FLEXIO_MCULCD_Idle, - flexioLcdMcuHandle->userData); - } - } - } -} - -static void FLEXIO_MCULCD_EDMAConfig(FLEXIO_MCULCD_Type *base, flexio_mculcd_edma_handle_t *handle) -{ - edma_transfer_config_t xferConfig = {0}; - edma_transfer_size_t transferSize = kEDMA_TransferSize1Bytes; - int16_t offset; - uint32_t majorLoopCounts; - uint32_t transferCount; - -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - transferSize = kEDMA_TransferSize1Bytes; - offset = 1; -#else - transferSize = kEDMA_TransferSize2Bytes; - offset = 2; -#endif - - majorLoopCounts = handle->remainingCount / handle->minorLoopBytes; - - /* For reading, the last minor loop data is not tranfered by DMA. */ - if ((uint32_t)kFLEXIO_MCULCD_StateReadArray == handle->state) - { - majorLoopCounts--; - } - - if (majorLoopCounts > EDMA_MAX_MAJOR_COUNT) - { - majorLoopCounts = EDMA_MAX_MAJOR_COUNT; - } - - transferCount = majorLoopCounts * handle->minorLoopBytes; - - if ((uint32_t)kFLEXIO_MCULCD_StateReadArray == handle->state) - { - xferConfig.srcAddr = FLEXIO_MCULCD_GetRxDataRegisterAddress(base); - xferConfig.destAddr = handle->dataAddrOrSameValue; - xferConfig.srcTransferSize = kEDMA_TransferSize4Bytes; - xferConfig.destTransferSize = transferSize; - xferConfig.srcOffset = 4; - xferConfig.destOffset = offset; - xferConfig.minorLoopBytes = handle->minorLoopBytes; - xferConfig.majorLoopCounts = majorLoopCounts; - handle->remainingCount -= transferCount; - handle->dataAddrOrSameValue += transferCount; - (void)EDMA_SubmitTransfer(handle->rxDmaHandle, &xferConfig); - EDMA_SetModulo(handle->rxDmaHandle->base, handle->rxDmaHandle->channel, handle->rxEdmaModulo, - kEDMA_ModuloDisable); - } - else - { - if ((uint32_t)kFLEXIO_MCULCD_StateWriteArray == handle->state) - { - xferConfig.srcAddr = handle->dataAddrOrSameValue; - xferConfig.srcOffset = offset; - handle->dataAddrOrSameValue += transferCount; - } - else - { - xferConfig.srcAddr = (uint32_t)(&(handle->dataAddrOrSameValue)); - xferConfig.srcOffset = 0; - } - xferConfig.destAddr = FLEXIO_MCULCD_GetTxDataRegisterAddress(base); - xferConfig.srcTransferSize = transferSize; - xferConfig.destTransferSize = kEDMA_TransferSize4Bytes; - xferConfig.destOffset = 4; - xferConfig.minorLoopBytes = handle->minorLoopBytes; - xferConfig.majorLoopCounts = majorLoopCounts; - handle->remainingCount -= transferCount; - (void)EDMA_SubmitTransfer(handle->txDmaHandle, &xferConfig); - EDMA_SetModulo(handle->txDmaHandle->base, handle->txDmaHandle->channel, kEDMA_ModuloDisable, - handle->txEdmaModulo); - } -} - -static bool FLEXIO_MCULCD_GetEDMAModulo(uint8_t shifterNum, edma_modulo_t *modulo) -{ - bool ret = true; - - switch (shifterNum) - { - case 1U: - *modulo = kEDMA_Modulo4bytes; - break; - case 2U: - *modulo = kEDMA_Modulo8bytes; - break; - case 4U: - *modulo = kEDMA_Modulo16bytes; - break; - case 8U: - *modulo = kEDMA_Modulo32bytes; - break; - default: - ret = false; - break; - } - - return ret; -} - -/*! - * brief Initializes the FLEXO MCULCD master eDMA handle. - * - * This function initializes the FLEXO MCULCD master eDMA handle which can be - * used for other FLEXO MCULCD transactional APIs. For a specified FLEXO MCULCD - * instance, call this API once to get the initialized handle. - * - * param base Pointer to FLEXIO_MCULCD_Type structure. - * param handle Pointer to flexio_mculcd_edma_handle_t structure to store the - * transfer state. - * param callback MCULCD transfer complete callback, NULL means no callback. - * param userData callback function parameter. - * param txDmaHandle User requested eDMA handle for FlexIO MCULCD eDMA TX, - * the DMA request source of this handle should be the first of TX shifters. - * param rxDmaHandle User requested eDMA handle for FlexIO MCULCD eDMA RX, - * the DMA request source of this handle should be the last of RX shifters. - * retval kStatus_Success Successfully create the handle. - */ -status_t FLEXIO_MCULCD_TransferCreateHandleEDMA(FLEXIO_MCULCD_Type *base, - flexio_mculcd_edma_handle_t *handle, - flexio_mculcd_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *txDmaHandle, - edma_handle_t *rxDmaHandle) -{ - assert(NULL != handle); - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Initialize the state. */ - handle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - - /* Register callback and userData. */ - handle->completionCallback = callback; - handle->userData = userData; - - handle->base = base; - handle->txShifterNum = base->txShifterEndIndex - base->txShifterStartIndex + 1U; - handle->rxShifterNum = base->rxShifterEndIndex - base->rxShifterStartIndex + 1U; - - if (NULL != rxDmaHandle) - { - if (!FLEXIO_MCULCD_GetEDMAModulo(handle->rxShifterNum, &handle->rxEdmaModulo)) - { - return kStatus_InvalidArgument; - } - - handle->rxDmaHandle = rxDmaHandle; - EDMA_SetCallback(rxDmaHandle, FLEXIO_MCULCD_RxEDMACallback, handle); - } - - if (NULL != txDmaHandle) - { - if (!FLEXIO_MCULCD_GetEDMAModulo(handle->txShifterNum, &handle->txEdmaModulo)) - { - return kStatus_InvalidArgument; - } - - handle->txDmaHandle = txDmaHandle; - EDMA_SetCallback(txDmaHandle, FLEXIO_MCULCD_TxEDMACallback, handle); - } - - return kStatus_Success; -} - -/*! - * brief Performs a non-blocking FlexIO MCULCD transfer using eDMA. - * - * This function returns immediately after transfer initiates. To check whether - * the transfer is completed, user could: - * 1. Use the transfer completed callback; - * 2. Polling function ref FLEXIO_MCULCD_GetTransferCountEDMA - * - * param base pointer to FLEXIO_MCULCD_Type structure. - * param handle pointer to flexio_mculcd_edma_handle_t structure to store the - * transfer state. - * param xfer Pointer to FlexIO MCULCD transfer structure. - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_InvalidArgument Input argument is invalid. - * retval kStatus_FLEXIO_MCULCD_Busy FlexIO MCULCD is not idle, it is running another - * transfer. - */ -status_t FLEXIO_MCULCD_TransferEDMA(FLEXIO_MCULCD_Type *base, - flexio_mculcd_edma_handle_t *handle, - flexio_mculcd_transfer_t *xfer) -{ - assert(NULL != handle); - assert(NULL != xfer); - - /* - * The data transfer mechanism: - * - * Read: - * Assume the data length is Lr = (n1 * minorLoopBytes + n2), where - * n2 < minorLoopBytes. - * If (n1 <= 1), then all data are sent using blocking method. - * If (n1 > 1), then the beginning ((n1-1) * minorLoopBytes) are read - * using DMA, the left (minorLoopBytes + n2) are read using blocking method. - * - * Write: - * Assume the data length is Lw = (n1 * minorLoopBytes + n2), where - * n2 < minorLoopBytes. - * If (n1 = 0), then all data are sent using blocking method. - * If (n1 >= 1), then the beginning (n1 * minorLoopBytes) are sent - * using DMA, the left n2 are sent using blocking method. - */ - - /* Check if the device is busy. */ - if ((uint32_t)kFLEXIO_MCULCD_StateIdle != handle->state) - { - return kStatus_FLEXIO_MCULCD_Busy; - } - - /* Set the state in handle. */ - if (kFLEXIO_MCULCD_ReadArray == xfer->mode) - { - handle->state = (uint32_t)kFLEXIO_MCULCD_StateReadArray; - handle->minorLoopBytes = handle->rxShifterNum * 4UL; - } - else - { - handle->minorLoopBytes = handle->txShifterNum * 4UL; - - if (kFLEXIO_MCULCD_WriteArray == xfer->mode) - { - handle->state = (uint32_t)kFLEXIO_MCULCD_StateWriteArray; - } - else - { - handle->state = (uint32_t)kFLEXIO_MCULCD_StateWriteSameValue; - } - } - - /* - * For TX, if data is less than one minor loop, then use polling method. - * For RX, if data is less than two minor loop, then use polling method. - */ - if ((xfer->dataSize < handle->minorLoopBytes) || - ((kFLEXIO_MCULCD_ReadArray == xfer->mode) && (xfer->dataSize < 2U * (handle->minorLoopBytes)))) - { - FLEXIO_MCULCD_TransferBlocking(base, xfer); - - handle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - - /* Callback to inform upper layer. */ - if (NULL != handle->completionCallback) - { - handle->completionCallback(base, handle, kStatus_FLEXIO_MCULCD_Idle, handle->userData); - } - } - else - { - handle->dataCount = xfer->dataSize; - handle->remainingCount = xfer->dataSize; - handle->dataAddrOrSameValue = xfer->dataAddrOrSameValue; - - /* Setup DMA to transfer data. */ - /* Assert the nCS. */ - FLEXIO_MCULCD_StartTransfer(base); - - if (!xfer->dataOnly) - { - /* Send the command. */ - FLEXIO_MCULCD_WriteCommandBlocking(base, xfer->command); - } - - /* Setup the DMA configuration. */ - FLEXIO_MCULCD_EDMAConfig(base, handle); - - /* Start the transfer. */ - if (kFLEXIO_MCULCD_ReadArray == xfer->mode) - { - /* For 6800, assert the RDWR pin. */ - if (kFLEXIO_MCULCD_6800 == base->busType) - { - base->setRDWRPin(true); - } - FLEXIO_MCULCD_SetMultiBeatsReadConfig(base); - FLEXIO_MCULCD_EnableRxDMA(base, true); - EDMA_StartTransfer(handle->rxDmaHandle); - } - else - { - /* For 6800, de-assert the RDWR pin. */ - if (kFLEXIO_MCULCD_6800 == base->busType) - { - base->setRDWRPin(false); - } - FLEXIO_MCULCD_SetMultiBeatsWriteConfig(base); - FLEXIO_MCULCD_EnableTxDMA(base, true); - EDMA_StartTransfer(handle->txDmaHandle); - } - } - - return kStatus_Success; -} - -/*! - * brief Aborts a FlexIO MCULCD transfer using eDMA. - * - * param base pointer to FLEXIO_MCULCD_Type structure. - * param handle FlexIO MCULCD eDMA handle pointer. - */ -void FLEXIO_MCULCD_TransferAbortEDMA(FLEXIO_MCULCD_Type *base, flexio_mculcd_edma_handle_t *handle) -{ - assert(NULL != handle); - - /* Disable dma. */ - if (NULL != handle->txDmaHandle) - { - EDMA_AbortTransfer(handle->txDmaHandle); - } - if (NULL != handle->rxDmaHandle) - { - EDMA_AbortTransfer(handle->rxDmaHandle); - } - - /* Disable DMA enable bit. */ - FLEXIO_MCULCD_EnableTxDMA(handle->base, false); - FLEXIO_MCULCD_EnableRxDMA(handle->base, false); - - /* Set the handle state. */ - handle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - handle->dataCount = 0; -} - -/*! - * brief Gets the remaining bytes for FlexIO MCULCD eDMA transfer. - * - * param base pointer to FLEXIO_MCULCD_Type structure. - * param handle FlexIO MCULCD eDMA handle pointer. - * param count Number of count transferred so far by the eDMA transaction. - * retval kStatus_Success Get the transferred count Successfully. - * retval kStatus_NoTransferInProgress No transfer in process. - */ -status_t FLEXIO_MCULCD_TransferGetCountEDMA(FLEXIO_MCULCD_Type *base, - flexio_mculcd_edma_handle_t *handle, - size_t *count) -{ - assert(NULL != handle); - assert(NULL != count); - uint32_t state = handle->state; - - if ((uint32_t)kFLEXIO_MCULCD_StateIdle == state) - { - return kStatus_NoTransferInProgress; - } - else - { - *count = handle->dataCount - handle->remainingCount; - - if ((uint32_t)kFLEXIO_MCULCD_StateReadArray == state) - { - *count -= handle->minorLoopBytes * - EDMA_GetRemainingMajorLoopCount(handle->rxDmaHandle->base, handle->rxDmaHandle->channel); - } - else - { - *count -= handle->minorLoopBytes * - EDMA_GetRemainingMajorLoopCount(handle->txDmaHandle->base, handle->txDmaHandle->channel); - } - } - - return kStatus_Success; -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_mculcd_edma.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_mculcd_edma.h deleted file mode 100644 index 98da16eef92..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_mculcd_edma.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2020,2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_FLEXIO_MCULCD_EDMA_H_ -#define FSL_FLEXIO_MCULCD_EDMA_H_ - -#include "fsl_edma.h" -#include "fsl_flexio_mculcd.h" - -/*! - * @addtogroup flexio_edma_mculcd - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @{ */ -/*! @brief FlexIO MCULCD EDMA driver version. */ -#define FSL_FLEXIO_MCULCD_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 0, 5)) -/*! @} */ - -/*! @brief typedef for flexio_mculcd_edma_handle_t in advance. */ -typedef struct _flexio_mculcd_edma_handle flexio_mculcd_edma_handle_t; - -/*! @brief FlexIO MCULCD master callback for transfer complete. - * - * When transfer finished, the callback function is called and returns the - * @p status as kStatus_FLEXIO_MCULCD_Idle. - */ -typedef void (*flexio_mculcd_edma_transfer_callback_t)(FLEXIO_MCULCD_Type *base, - flexio_mculcd_edma_handle_t *handle, - status_t status, - void *userData); - -/*! @brief FlexIO MCULCD eDMA transfer handle, users should not touch the - * content of the handle.*/ -struct _flexio_mculcd_edma_handle -{ - FLEXIO_MCULCD_Type *base; /*!< Pointer to the FLEXIO_MCULCD_Type. */ - uint8_t txShifterNum; /*!< Number of shifters used for TX. */ - uint8_t rxShifterNum; /*!< Number of shifters used for RX. */ - uint32_t minorLoopBytes; /*!< eDMA transfer minor loop bytes. */ - edma_modulo_t txEdmaModulo; /*!< Modulo value for the FlexIO shifter buffer access. */ - edma_modulo_t rxEdmaModulo; /*!< Modulo value for the FlexIO shifter buffer access. */ - uint32_t dataAddrOrSameValue; /*!< When sending the same value for many times, - this is the value to send. When writing or - reading array, this is the address of the - data array. */ - size_t dataCount; /*!< Total count to be transferred. */ - volatile size_t remainingCount; /*!< Remaining count still not transfered. */ - volatile uint32_t state; /*!< FlexIO MCULCD driver internal state. */ - edma_handle_t *txDmaHandle; /*!< DMA handle for MCULCD TX */ - edma_handle_t *rxDmaHandle; /*!< DMA handle for MCULCD RX */ - flexio_mculcd_edma_transfer_callback_t completionCallback; /*!< Callback for MCULCD DMA transfer */ - void *userData; /*!< User Data for MCULCD DMA callback */ -}; - -/******************************************************************************* - * APIs - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name eDMA Transactional - * @{ - */ - -/*! - * @brief Initializes the FLEXO MCULCD master eDMA handle. - * - * This function initializes the FLEXO MCULCD master eDMA handle which can be - * used for other FLEXO MCULCD transactional APIs. For a specified FLEXO MCULCD - * instance, call this API once to get the initialized handle. - * - * @param base Pointer to FLEXIO_MCULCD_Type structure. - * @param handle Pointer to flexio_mculcd_edma_handle_t structure to store the - * transfer state. - * @param callback MCULCD transfer complete callback, NULL means no callback. - * @param userData callback function parameter. - * @param txDmaHandle User requested eDMA handle for FlexIO MCULCD eDMA TX, - * the DMA request source of this handle should be the first of TX shifters. - * @param rxDmaHandle User requested eDMA handle for FlexIO MCULCD eDMA RX, - * the DMA request source of this handle should be the last of RX shifters. - * @retval kStatus_Success Successfully create the handle. - */ -status_t FLEXIO_MCULCD_TransferCreateHandleEDMA(FLEXIO_MCULCD_Type *base, - flexio_mculcd_edma_handle_t *handle, - flexio_mculcd_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *txDmaHandle, - edma_handle_t *rxDmaHandle); - -/*! - * @brief Performs a non-blocking FlexIO MCULCD transfer using eDMA. - * - * This function returns immediately after transfer initiates. To check whether - * the transfer is completed, user could: - * 1. Use the transfer completed callback; - * 2. Polling function FLEXIO_MCULCD_GetTransferCountEDMA - * - * @param base pointer to FLEXIO_MCULCD_Type structure. - * @param handle pointer to flexio_mculcd_edma_handle_t structure to store the - * transfer state. - * @param xfer Pointer to FlexIO MCULCD transfer structure. - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_InvalidArgument Input argument is invalid. - * @retval kStatus_FLEXIO_MCULCD_Busy FlexIO MCULCD is not idle, it is running another - * transfer. - */ -status_t FLEXIO_MCULCD_TransferEDMA(FLEXIO_MCULCD_Type *base, - flexio_mculcd_edma_handle_t *handle, - flexio_mculcd_transfer_t *xfer); - -/*! - * @brief Aborts a FlexIO MCULCD transfer using eDMA. - * - * @param base pointer to FLEXIO_MCULCD_Type structure. - * @param handle FlexIO MCULCD eDMA handle pointer. - */ -void FLEXIO_MCULCD_TransferAbortEDMA(FLEXIO_MCULCD_Type *base, flexio_mculcd_edma_handle_t *handle); - -/*! - * @brief Gets the remaining bytes for FlexIO MCULCD eDMA transfer. - * - * @param base pointer to FLEXIO_MCULCD_Type structure. - * @param handle FlexIO MCULCD eDMA handle pointer. - * @param count Number of count transferred so far by the eDMA transaction. - * @retval kStatus_Success Get the transferred count Successfully. - * @retval kStatus_NoTransferInProgress No transfer in process. - */ -status_t FLEXIO_MCULCD_TransferGetCountEDMA(FLEXIO_MCULCD_Type *base, - flexio_mculcd_edma_handle_t *handle, - size_t *count); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ -#endif /* FSL_FLEXIO_MCULCD_EDMA_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_spi.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_spi.c deleted file mode 100644 index 96c9a7c0acc..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_spi.c +++ /dev/null @@ -1,1565 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020, 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio_spi.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio_spi" -#endif - -/*! @brief FLEXIO SPI transfer state, which is used for SPI transactiaonl APIs' internal state. */ -enum _flexio_spi_transfer_states -{ - kFLEXIO_SPI_Idle = 0x0U, /*!< Nothing in the transmitter/receiver's queue. */ - kFLEXIO_SPI_Busy, /*!< Transmiter/Receive's queue is not finished. */ -}; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Send a piece of data for SPI. - * - * This function computes the number of data to be written into D register or Tx FIFO, - * and write the data into it. At the same time, this function updates the values in - * master handle structure. - * - * @param base pointer to FLEXIO_SPI_Type structure - * @param handle Pointer to SPI master handle structure. - */ -static void FLEXIO_SPI_TransferSendTransaction(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle); - -/*! - * @brief Receive a piece of data for SPI master. - * - * This function computes the number of data to receive from D register or Rx FIFO, - * and write the data to destination address. At the same time, this function updates - * the values in master handle structure. - * - * @param base pointer to FLEXIO_SPI_Type structure - * @param handle Pointer to SPI master handle structure. - */ -static void FLEXIO_SPI_TransferReceiveTransaction(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle); - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Codes - ******************************************************************************/ - -static uint32_t FLEXIO_SPI_GetInstance(FLEXIO_SPI_Type *base) -{ - return FLEXIO_GetInstance(base->flexioBase); -} - -static void FLEXIO_SPI_TransferSendTransaction(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle) -{ - uint32_t tmpData = FLEXIO_SPI_DUMMYDATA; - - if (handle->txData != NULL) - { - /* Transmit data and update tx size/buff. */ - if (handle->bytePerFrame == 1U) - { - tmpData = (uint32_t) * (handle->txData); - handle->txData++; - } - else if (handle->bytePerFrame == 2U) - { - if (handle->direction == kFLEXIO_SPI_MsbFirst) - { - tmpData = (uint32_t)(handle->txData[0]) << 8U; - tmpData += (uint32_t)handle->txData[1]; - } - else - { - tmpData = (uint32_t)(handle->txData[1]) << 8U; - tmpData += (uint32_t)handle->txData[0]; - } - handle->txData += 2U; - } - else - { - if (handle->direction == kFLEXIO_SPI_MsbFirst) - { - tmpData = (uint32_t)(handle->txData[0]) << 24U; - tmpData += (uint32_t)(handle->txData[1]) << 16U; - tmpData += (uint32_t)(handle->txData[2]) << 8U; - tmpData += (uint32_t)handle->txData[3]; - } - else - { - tmpData = (uint32_t)(handle->txData[3]) << 24U; - tmpData += (uint32_t)(handle->txData[2]) << 16U; - tmpData += (uint32_t)(handle->txData[1]) << 8U; - tmpData += (uint32_t)handle->txData[0]; - } - handle->txData += 4U; - } - } - else - { - tmpData = FLEXIO_SPI_DUMMYDATA; - } - - handle->txRemainingBytes -= handle->bytePerFrame; - - FLEXIO_SPI_WriteData(base, handle->direction, tmpData); - - if (0U == handle->txRemainingBytes) - { - FLEXIO_SPI_DisableInterrupts(base, (uint32_t)kFLEXIO_SPI_TxEmptyInterruptEnable); - } -} - -static void FLEXIO_SPI_TransferReceiveTransaction(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle) -{ - uint32_t tmpData; - - tmpData = FLEXIO_SPI_ReadData(base, handle->direction); - - if (handle->rxData != NULL) - { - if (handle->bytePerFrame == 1U) - { - *handle->rxData = (uint8_t)tmpData; - } - else if (handle->bytePerFrame == 2U) - { - if (handle->direction == kFLEXIO_SPI_LsbFirst) - { - *handle->rxData = (uint8_t)(tmpData >> 8); - handle->rxData++; - *handle->rxData = (uint8_t)tmpData; - } - else - { - *handle->rxData = (uint8_t)tmpData; - handle->rxData++; - *handle->rxData = (uint8_t)(tmpData >> 8); - } - } - else - { - if (handle->direction == kFLEXIO_SPI_LsbFirst) - { - *handle->rxData = (uint8_t)(tmpData >> 24U); - handle->rxData++; - *handle->rxData = (uint8_t)(tmpData >> 16U); - handle->rxData++; - *handle->rxData = (uint8_t)(tmpData >> 8U); - handle->rxData++; - *handle->rxData = (uint8_t)tmpData; - } - else - { - *handle->rxData = (uint8_t)tmpData; - handle->rxData++; - *handle->rxData = (uint8_t)(tmpData >> 8U); - handle->rxData++; - *handle->rxData = (uint8_t)(tmpData >> 16U); - handle->rxData++; - *handle->rxData = (uint8_t)(tmpData >> 24U); - } - } - handle->rxData++; - } - handle->rxRemainingBytes -= handle->bytePerFrame; -} - -/*! - * brief Ungates the FlexIO clock, resets the FlexIO module, configures the FlexIO SPI master hardware, - * and configures the FlexIO SPI with FlexIO SPI master configuration. The - * configuration structure can be filled by the user, or be set with default values - * by the FLEXIO_SPI_MasterGetDefaultConfig(). - * - * note 1.FlexIO SPI master only support CPOL = 0, which means clock inactive low. - * 2.For FlexIO SPI master, the input valid time is 1.5 clock cycles, for slave the output valid time - * is 2.5 clock cycles. So if FlexIO SPI master communicates with other spi IPs, the maximum baud - * rate is FlexIO clock frequency divided by 2*2=4. If FlexIO SPI master communicates with FlexIO - * SPI slave, the maximum baud rate is FlexIO clock frequency divided by (1.5+2.5)*2=8. - * - * Example - code - FLEXIO_SPI_Type spiDev = { - .flexioBase = FLEXIO, - .SDOPinIndex = 0, - .SDIPinIndex = 1, - .SCKPinIndex = 2, - .CSnPinIndex = 3, - .shifterIndex = {0,1}, - .timerIndex = {0,1} - }; - flexio_spi_master_config_t config = { - .enableMaster = true, - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .baudRate_Bps = 500000, - .phase = kFLEXIO_SPI_ClockPhaseFirstEdge, - .direction = kFLEXIO_SPI_MsbFirst, - .dataMode = kFLEXIO_SPI_8BitMode - }; - FLEXIO_SPI_MasterInit(&spiDev, &config, srcClock_Hz); - endcode - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param masterConfig Pointer to the flexio_spi_master_config_t structure. - * param srcClock_Hz FlexIO source clock in Hz. -*/ -void FLEXIO_SPI_MasterInit(FLEXIO_SPI_Type *base, flexio_spi_master_config_t *masterConfig, uint32_t srcClock_Hz) -{ - assert(base != NULL); - assert(masterConfig != NULL); - - flexio_shifter_config_t shifterConfig; - flexio_timer_config_t timerConfig; - uint32_t ctrlReg = 0; - uint16_t timerDiv = 0; - uint16_t timerCmp = 0; - - /* Clear the shifterConfig & timerConfig struct. */ - (void)memset(&shifterConfig, 0, sizeof(shifterConfig)); - (void)memset(&timerConfig, 0, sizeof(timerConfig)); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate flexio clock. */ - CLOCK_EnableClock(s_flexioClocks[FLEXIO_SPI_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Configure FLEXIO SPI Master */ - ctrlReg = base->flexioBase->CTRL; - ctrlReg &= ~(FLEXIO_CTRL_DOZEN_MASK | FLEXIO_CTRL_DBGE_MASK | FLEXIO_CTRL_FASTACC_MASK | FLEXIO_CTRL_FLEXEN_MASK); - ctrlReg |= (FLEXIO_CTRL_DBGE(masterConfig->enableInDebug) | FLEXIO_CTRL_FASTACC(masterConfig->enableFastAccess) | - FLEXIO_CTRL_FLEXEN(masterConfig->enableMaster)); - if (!masterConfig->enableInDoze) - { - ctrlReg |= FLEXIO_CTRL_DOZEN_MASK; - } - - base->flexioBase->CTRL = ctrlReg; - - /* Do hardware configuration. */ - /* 1. Configure the shifter 0 for tx. */ - shifterConfig.timerSelect = base->timerIndex[0]; - shifterConfig.pinConfig = kFLEXIO_PinConfigOutput; - shifterConfig.pinSelect = base->SDOPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveHigh; - shifterConfig.shifterMode = kFLEXIO_ShifterModeTransmit; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - if (masterConfig->phase == kFLEXIO_SPI_ClockPhaseFirstEdge) - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnNegitive; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitDisable; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnEnable; - } - else - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitLow; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnShift; - } - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[0], &shifterConfig); - - /* 2. Configure the shifter 1 for rx. */ - shifterConfig.timerSelect = base->timerIndex[0]; - shifterConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - shifterConfig.pinSelect = base->SDIPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveHigh; - shifterConfig.shifterMode = kFLEXIO_ShifterModeReceive; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitDisable; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnEnable; - if (masterConfig->phase == kFLEXIO_SPI_ClockPhaseFirstEdge) - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive; - } - else - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnNegitive; - } - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[1], &shifterConfig); - - /*3. Configure the timer 0 for SCK. */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->shifterIndex[0]); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOutput; - timerConfig.pinSelect = base->SCKPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveHigh; - timerConfig.timerMode = kFLEXIO_TimerModeDual8BitBaudBit; - timerConfig.timerOutput = kFLEXIO_TimerOutputZeroNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput; - timerConfig.timerReset = kFLEXIO_TimerResetNever; - timerConfig.timerDisable = kFLEXIO_TimerDisableOnTimerCompare; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnTriggerHigh; - timerConfig.timerStop = kFLEXIO_TimerStopBitEnableOnTimerDisable; - timerConfig.timerStart = kFLEXIO_TimerStartBitEnabled; - /* Low 8-bits are used to configure baudrate. */ - timerDiv = (uint16_t)(srcClock_Hz / masterConfig->baudRate_Bps); - timerDiv = timerDiv / 2U - 1U; - /* High 8-bits are used to configure shift clock edges(transfer width). */ - timerCmp = ((uint16_t)masterConfig->dataMode * 2U - 1U) << 8U; - timerCmp |= timerDiv; - - timerConfig.timerCompare = timerCmp; - - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[0], &timerConfig); - - /* 4. Configure the timer 1 for CSn. */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_TIMn(base->timerIndex[0]); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveHigh; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOutput; - timerConfig.pinSelect = base->CSnPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveLow; - timerConfig.timerMode = kFLEXIO_TimerModeSingle16Bit; - timerConfig.timerOutput = kFLEXIO_TimerOutputOneNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput; - timerConfig.timerReset = kFLEXIO_TimerResetNever; - timerConfig.timerDisable = kFLEXIO_TimerDisableOnPreTimerDisable; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnPrevTimerEnable; - timerConfig.timerStop = kFLEXIO_TimerStopBitDisabled; - timerConfig.timerStart = kFLEXIO_TimerStartBitDisabled; - - timerConfig.timerCompare = 0xFFFFU; /* Never compare. */ - - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[1], &timerConfig); -} - -/*! - * brief Resets the FlexIO SPI timer and shifter config. - * - * param base Pointer to the FLEXIO_SPI_Type. - */ -void FLEXIO_SPI_MasterDeinit(FLEXIO_SPI_Type *base) -{ - base->flexioBase->SHIFTCFG[base->shifterIndex[0]] = 0; - base->flexioBase->SHIFTCTL[base->shifterIndex[0]] = 0; - base->flexioBase->SHIFTCFG[base->shifterIndex[1]] = 0; - base->flexioBase->SHIFTCTL[base->shifterIndex[1]] = 0; - base->flexioBase->TIMCFG[base->timerIndex[0]] = 0; - base->flexioBase->TIMCMP[base->timerIndex[0]] = 0; - base->flexioBase->TIMCTL[base->timerIndex[0]] = 0; - base->flexioBase->TIMCFG[base->timerIndex[1]] = 0; - base->flexioBase->TIMCMP[base->timerIndex[1]] = 0; - base->flexioBase->TIMCTL[base->timerIndex[1]] = 0; -} - -/*! - * brief Gets the default configuration to configure the FlexIO SPI master. The configuration - * can be used directly by calling the FLEXIO_SPI_MasterConfigure(). - * Example: - code - flexio_spi_master_config_t masterConfig; - FLEXIO_SPI_MasterGetDefaultConfig(&masterConfig); - endcode - * param masterConfig Pointer to the flexio_spi_master_config_t structure. -*/ -void FLEXIO_SPI_MasterGetDefaultConfig(flexio_spi_master_config_t *masterConfig) -{ - assert(masterConfig != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(masterConfig, 0, sizeof(*masterConfig)); - - masterConfig->enableMaster = true; - masterConfig->enableInDoze = false; - masterConfig->enableInDebug = true; - masterConfig->enableFastAccess = false; - /* Default baud rate 500kbps. */ - masterConfig->baudRate_Bps = 500000U; - /* Default CPHA = 0. */ - masterConfig->phase = kFLEXIO_SPI_ClockPhaseFirstEdge; - /* Default bit count at 8. */ - masterConfig->dataMode = kFLEXIO_SPI_8BitMode; -} - -/*! - * brief Ungates the FlexIO clock, resets the FlexIO module, configures the FlexIO SPI slave hardware - * configuration, and configures the FlexIO SPI with FlexIO SPI slave configuration. The - * configuration structure can be filled by the user, or be set with default values - * by the FLEXIO_SPI_SlaveGetDefaultConfig(). - * - * note 1.Only one timer is needed in the FlexIO SPI slave. As a result, the second timer index is ignored. - * 2.FlexIO SPI slave only support CPOL = 0, which means clock inactive low. - * 3.For FlexIO SPI master, the input valid time is 1.5 clock cycles, for slave the output valid time - * is 2.5 clock cycles. So if FlexIO SPI slave communicates with other spi IPs, the maximum baud - * rate is FlexIO clock frequency divided by 3*2=6. If FlexIO SPI slave communicates with FlexIO - * SPI master, the maximum baud rate is FlexIO clock frequency divided by (1.5+2.5)*2=8. - * Example - code - FLEXIO_SPI_Type spiDev = { - .flexioBase = FLEXIO, - .SDOPinIndex = 0, - .SDIPinIndex = 1, - .SCKPinIndex = 2, - .CSnPinIndex = 3, - .shifterIndex = {0,1}, - .timerIndex = {0} - }; - flexio_spi_slave_config_t config = { - .enableSlave = true, - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .phase = kFLEXIO_SPI_ClockPhaseFirstEdge, - .direction = kFLEXIO_SPI_MsbFirst, - .dataMode = kFLEXIO_SPI_8BitMode - }; - FLEXIO_SPI_SlaveInit(&spiDev, &config); - endcode - * param base Pointer to the FLEXIO_SPI_Type structure. - * param slaveConfig Pointer to the flexio_spi_slave_config_t structure. -*/ -void FLEXIO_SPI_SlaveInit(FLEXIO_SPI_Type *base, flexio_spi_slave_config_t *slaveConfig) -{ - assert((base != NULL) && (slaveConfig != NULL)); - - flexio_shifter_config_t shifterConfig; - flexio_timer_config_t timerConfig; - uint32_t ctrlReg = 0; - - /* Clear the shifterConfig & timerConfig struct. */ - (void)memset(&shifterConfig, 0, sizeof(shifterConfig)); - (void)memset(&timerConfig, 0, sizeof(timerConfig)); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate flexio clock. */ - CLOCK_EnableClock(s_flexioClocks[FLEXIO_SPI_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Configure FLEXIO SPI Slave */ - ctrlReg = base->flexioBase->CTRL; - ctrlReg &= ~(FLEXIO_CTRL_DOZEN_MASK | FLEXIO_CTRL_DBGE_MASK | FLEXIO_CTRL_FASTACC_MASK | FLEXIO_CTRL_FLEXEN_MASK); - ctrlReg |= (FLEXIO_CTRL_DBGE(slaveConfig->enableInDebug) | FLEXIO_CTRL_FASTACC(slaveConfig->enableFastAccess) | - FLEXIO_CTRL_FLEXEN(slaveConfig->enableSlave)); - if (!slaveConfig->enableInDoze) - { - ctrlReg |= FLEXIO_CTRL_DOZEN_MASK; - } - - base->flexioBase->CTRL = ctrlReg; - - /* Do hardware configuration. */ - /* 1. Configure the shifter 0 for tx. */ - shifterConfig.timerSelect = base->timerIndex[0]; - shifterConfig.pinConfig = kFLEXIO_PinConfigOutput; - shifterConfig.pinSelect = base->SDOPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveHigh; - shifterConfig.shifterMode = kFLEXIO_ShifterModeTransmit; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitDisable; - if (slaveConfig->phase == kFLEXIO_SPI_ClockPhaseFirstEdge) - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnNegitive; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnEnable; - } - else - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnShift; - } - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[0], &shifterConfig); - - /* 2. Configure the shifter 1 for rx. */ - shifterConfig.timerSelect = base->timerIndex[0]; - shifterConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - shifterConfig.pinSelect = base->SDIPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveHigh; - shifterConfig.shifterMode = kFLEXIO_ShifterModeReceive; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitDisable; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnEnable; - if (slaveConfig->phase == kFLEXIO_SPI_ClockPhaseFirstEdge) - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive; - } - else - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnNegitive; - } - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[1], &shifterConfig); - - /*3. Configure the timer 0 for shift clock. */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_PININPUT(base->CSnPinIndex); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - timerConfig.pinSelect = base->SCKPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveHigh; - timerConfig.timerMode = kFLEXIO_TimerModeSingle16Bit; - timerConfig.timerOutput = kFLEXIO_TimerOutputZeroNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnPinInputShiftPinInput; - timerConfig.timerReset = kFLEXIO_TimerResetNever; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnTriggerRisingEdge; - timerConfig.timerStop = kFLEXIO_TimerStopBitDisabled; - if (slaveConfig->phase == kFLEXIO_SPI_ClockPhaseFirstEdge) - { - timerConfig.timerDisable = kFLEXIO_TimerDisableOnTimerCompare; - timerConfig.timerStart = kFLEXIO_TimerStartBitDisabled; - } - else - { - timerConfig.timerDisable = kFLEXIO_TimerDisableOnTriggerFallingEdge; - timerConfig.timerStart = kFLEXIO_TimerStartBitEnabled; - } - - timerConfig.timerCompare = (uint32_t)slaveConfig->dataMode * 2U - 1U; - - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[0], &timerConfig); -} - -/*! - * brief Gates the FlexIO clock. - * - * param base Pointer to the FLEXIO_SPI_Type. - */ -void FLEXIO_SPI_SlaveDeinit(FLEXIO_SPI_Type *base) -{ - FLEXIO_SPI_MasterDeinit(base); -} - -/*! - * brief Gets the default configuration to configure the FlexIO SPI slave. The configuration - * can be used directly for calling the FLEXIO_SPI_SlaveConfigure(). - * Example: - code - flexio_spi_slave_config_t slaveConfig; - FLEXIO_SPI_SlaveGetDefaultConfig(&slaveConfig); - endcode - * param slaveConfig Pointer to the flexio_spi_slave_config_t structure. -*/ -void FLEXIO_SPI_SlaveGetDefaultConfig(flexio_spi_slave_config_t *slaveConfig) -{ - assert(slaveConfig != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(slaveConfig, 0, sizeof(*slaveConfig)); - - slaveConfig->enableSlave = true; - slaveConfig->enableInDoze = false; - slaveConfig->enableInDebug = true; - slaveConfig->enableFastAccess = false; - /* Default CPHA = 0. */ - slaveConfig->phase = kFLEXIO_SPI_ClockPhaseFirstEdge; - /* Default bit count at 8. */ - slaveConfig->dataMode = kFLEXIO_SPI_8BitMode; -} - -/*! - * brief Enables the FlexIO SPI interrupt. - * - * This function enables the FlexIO SPI interrupt. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param mask interrupt source. The parameter can be any combination of the following values: - * arg kFLEXIO_SPI_RxFullInterruptEnable - * arg kFLEXIO_SPI_TxEmptyInterruptEnable - */ -void FLEXIO_SPI_EnableInterrupts(FLEXIO_SPI_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_SPI_TxEmptyInterruptEnable) != 0U) - { - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_SPI_RxFullInterruptEnable) != 0U) - { - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Disables the FlexIO SPI interrupt. - * - * This function disables the FlexIO SPI interrupt. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param mask interrupt source The parameter can be any combination of the following values: - * arg kFLEXIO_SPI_RxFullInterruptEnable - * arg kFLEXIO_SPI_TxEmptyInterruptEnable - */ -void FLEXIO_SPI_DisableInterrupts(FLEXIO_SPI_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_SPI_TxEmptyInterruptEnable) != 0U) - { - FLEXIO_DisableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_SPI_RxFullInterruptEnable) != 0U) - { - FLEXIO_DisableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Enables/disables the FlexIO SPI transmit DMA. This function enables/disables the FlexIO SPI Tx DMA, - * which means that asserting the kFLEXIO_SPI_TxEmptyFlag does/doesn't trigger the DMA request. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param mask SPI DMA source. - * param enable True means enable DMA, false means disable DMA. - */ -void FLEXIO_SPI_EnableDMA(FLEXIO_SPI_Type *base, uint32_t mask, bool enable) -{ - if ((mask & (uint32_t)kFLEXIO_SPI_TxDmaEnable) != 0U) - { - FLEXIO_EnableShifterStatusDMA(base->flexioBase, 1UL << base->shifterIndex[0], enable); - } - - if ((mask & (uint32_t)kFLEXIO_SPI_RxDmaEnable) != 0U) - { - FLEXIO_EnableShifterStatusDMA(base->flexioBase, 1UL << base->shifterIndex[1], enable); - } -} - -/*! - * brief Gets FlexIO SPI status flags. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * return status flag; Use the status flag to AND the following flag mask and get the status. - * arg kFLEXIO_SPI_TxEmptyFlag - * arg kFLEXIO_SPI_RxEmptyFlag - */ - -uint32_t FLEXIO_SPI_GetStatusFlags(FLEXIO_SPI_Type *base) -{ - uint32_t shifterStatus = FLEXIO_GetShifterStatusFlags(base->flexioBase); - uint32_t status = 0; - - status = ((shifterStatus & (1UL << base->shifterIndex[0])) >> base->shifterIndex[0]); - status |= (((shifterStatus & (1UL << base->shifterIndex[1])) >> (base->shifterIndex[1])) << 1U); - - return status; -} - -/*! - * brief Clears FlexIO SPI status flags. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param mask status flag - * The parameter can be any combination of the following values: - * arg kFLEXIO_SPI_TxEmptyFlag - * arg kFLEXIO_SPI_RxEmptyFlag - */ - -void FLEXIO_SPI_ClearStatusFlags(FLEXIO_SPI_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag) != 0U) - { - FLEXIO_ClearShifterStatusFlags(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_SPI_RxBufferFullFlag) != 0U) - { - FLEXIO_ClearShifterStatusFlags(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Sets baud rate for the FlexIO SPI transfer, which is only used for the master. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param baudRate_Bps Baud Rate needed in Hz. - * param srcClockHz SPI source clock frequency in Hz. - */ -void FLEXIO_SPI_MasterSetBaudRate(FLEXIO_SPI_Type *base, uint32_t baudRate_Bps, uint32_t srcClockHz) -{ - uint16_t timerDiv = 0; - uint16_t timerCmp = 0; - FLEXIO_Type *flexioBase = base->flexioBase; - - /* Set TIMCMP[7:0] = (baud rate divider / 2) - 1.*/ - timerDiv = (uint16_t)(srcClockHz / baudRate_Bps); - timerDiv = timerDiv / 2U - 1U; - - timerCmp = (uint16_t)(flexioBase->TIMCMP[base->timerIndex[0]]); - timerCmp &= 0xFF00U; - timerCmp |= timerDiv; - - flexioBase->TIMCMP[base->timerIndex[0]] = timerCmp; -} - -/*! - * brief Sends a buffer of data bytes. - * - * note This function blocks using the polling method until all bytes have been sent. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param direction Shift direction of MSB first or LSB first. - * param buffer The data bytes to send. - * param size The number of data bytes to send. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_FLEXIO_SPI_Timeout The transfer timed out and was aborted. - */ -status_t FLEXIO_SPI_WriteBlocking(FLEXIO_SPI_Type *base, - flexio_spi_shift_direction_t direction, - const uint8_t *buffer, - size_t size) -{ - assert(buffer != NULL); - assert(size != 0U); - -#if SPI_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != size--) - { - /* Wait until data transfer complete. */ -#if SPI_RETRY_TIMES - waitTimes = SPI_RETRY_TIMES; - while ((0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag)) && - (0U != --waitTimes)) -#else - while (0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag)) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return kStatus_FLEXIO_SPI_Timeout; - } -#endif - FLEXIO_SPI_WriteData(base, direction, *buffer++); - } - - return kStatus_Success; -} - -/*! - * brief Receives a buffer of bytes. - * - * note This function blocks using the polling method until all bytes have been received. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param direction Shift direction of MSB first or LSB first. - * param buffer The buffer to store the received bytes. - * param size The number of data bytes to be received. - * param direction Shift direction of MSB first or LSB first. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_FLEXIO_SPI_Timeout The transfer timed out and was aborted. - */ -status_t FLEXIO_SPI_ReadBlocking(FLEXIO_SPI_Type *base, - flexio_spi_shift_direction_t direction, - uint8_t *buffer, - size_t size) -{ - assert(buffer != NULL); - assert(size != 0U); - -#if SPI_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != size--) - { - /* Wait until data transfer complete. */ -#if SPI_RETRY_TIMES - waitTimes = SPI_RETRY_TIMES; - while ((0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_RxBufferFullFlag)) && - (0U != --waitTimes)) -#else - while (0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_RxBufferFullFlag)) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return kStatus_FLEXIO_SPI_Timeout; - } -#endif - *buffer++ = (uint8_t)FLEXIO_SPI_ReadData(base, direction); - } - - return kStatus_Success; -} - -/*! - * brief Receives a buffer of bytes. - * - * note This function blocks via polling until all bytes have been received. - * - * param base pointer to FLEXIO_SPI_Type structure - * param xfer FlexIO SPI transfer structure, see #flexio_spi_transfer_t. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_FLEXIO_SPI_Timeout The transfer timed out and was aborted. - */ -status_t FLEXIO_SPI_MasterTransferBlocking(FLEXIO_SPI_Type *base, flexio_spi_transfer_t *xfer) -{ - flexio_spi_shift_direction_t direction; - uint8_t bytesPerFrame; - uint32_t dataMode = 0; - uint16_t timerCmp = (uint16_t)(base->flexioBase->TIMCMP[base->timerIndex[0]]); - uint32_t tmpData = FLEXIO_SPI_DUMMYDATA; - uint8_t dataFormat = FLEXIO_SPI_XFER_DATA_FORMAT(xfer->flags); -#if SPI_RETRY_TIMES - uint32_t waitTimes; -#endif - - timerCmp &= 0x00FFU; - - if ((xfer->flags & (uint8_t)kFLEXIO_SPI_csContinuous) != 0U) - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TSTOP_MASK) | - FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitDisabled); - } - else - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TSTOP_MASK) | - FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitEnableOnTimerDisable); - } - - /* Configure the values in handle. */ - switch (dataFormat) - { - case (uint8_t)kFLEXIO_SPI_8bitMsb: - dataMode = (8UL * 2UL - 1UL) << 8U; - bytesPerFrame = 1U; - direction = kFLEXIO_SPI_MsbFirst; - break; - - case (uint8_t)kFLEXIO_SPI_8bitLsb: - dataMode = (8UL * 2UL - 1UL) << 8U; - bytesPerFrame = 1U; - direction = kFLEXIO_SPI_LsbFirst; - break; - - case (uint8_t)kFLEXIO_SPI_16bitMsb: - dataMode = (16UL * 2UL - 1UL) << 8U; - bytesPerFrame = 2U; - direction = kFLEXIO_SPI_MsbFirst; - break; - - case (uint8_t)kFLEXIO_SPI_16bitLsb: - dataMode = (16UL * 2UL - 1UL) << 8U; - bytesPerFrame = 2U; - direction = kFLEXIO_SPI_LsbFirst; - break; - - case (uint8_t)kFLEXIO_SPI_32bitMsb: - dataMode = (32UL * 2UL - 1UL) << 8U; - bytesPerFrame = 4U; - direction = kFLEXIO_SPI_MsbFirst; - break; - - case (uint8_t)kFLEXIO_SPI_32bitLsb: - dataMode = (32UL * 2UL - 1UL) << 8U; - bytesPerFrame = 4U; - direction = kFLEXIO_SPI_LsbFirst; - break; - - default: - dataMode = (8UL * 2UL - 1UL) << 8U; - bytesPerFrame = 1U; - direction = kFLEXIO_SPI_MsbFirst; - assert(true); - break; - } - - dataMode |= timerCmp; - - /* Transfer size should be bytesPerFrame divisible. */ - if ((xfer->dataSize % bytesPerFrame) != 0U) - { - return kStatus_InvalidArgument; - } - - /* Configure transfer size. */ - base->flexioBase->TIMCMP[base->timerIndex[0]] = dataMode; - - while (xfer->dataSize != 0U) - { - /* Wait until data transfer complete. */ -#if SPI_RETRY_TIMES - waitTimes = SPI_RETRY_TIMES; - while ((0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag)) && - (0U != --waitTimes)) -#else - while (0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag)) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return kStatus_FLEXIO_SPI_Timeout; - } -#endif - if (xfer->txData != NULL) - { - /* Transmit data and update tx size/buff. */ - if (bytesPerFrame == 1U) - { - tmpData = (uint32_t) * (xfer->txData); - xfer->txData++; - } - else if (bytesPerFrame == 2U) - { - if (direction == kFLEXIO_SPI_MsbFirst) - { - tmpData = (uint32_t)(xfer->txData[0]) << 8U; - tmpData += (uint32_t)xfer->txData[1]; - } - else - { - tmpData = (uint32_t)(xfer->txData[1]) << 8U; - tmpData += (uint32_t)xfer->txData[0]; - } - xfer->txData += 2U; - } - else - { - if (direction == kFLEXIO_SPI_MsbFirst) - { - tmpData = (uint32_t)(xfer->txData[0]) << 24U; - tmpData += (uint32_t)(xfer->txData[1]) << 16U; - tmpData += (uint32_t)(xfer->txData[2]) << 8U; - tmpData += (uint32_t)xfer->txData[3]; - } - else - { - tmpData = (uint32_t)(xfer->txData[3]) << 24U; - tmpData += (uint32_t)(xfer->txData[2]) << 16U; - tmpData += (uint32_t)(xfer->txData[1]) << 8U; - tmpData += (uint32_t)xfer->txData[0]; - } - xfer->txData += 4U; - } - } - else - { - tmpData = FLEXIO_SPI_DUMMYDATA; - } - - xfer->dataSize -= bytesPerFrame; - - FLEXIO_SPI_WriteData(base, direction, tmpData); - -#if SPI_RETRY_TIMES - waitTimes = SPI_RETRY_TIMES; - while ((0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_RxBufferFullFlag)) && - (0U != --waitTimes)) -#else - while (0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_RxBufferFullFlag)) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return kStatus_FLEXIO_SPI_Timeout; - } -#endif - tmpData = FLEXIO_SPI_ReadData(base, direction); - - if (xfer->rxData != NULL) - { - if (bytesPerFrame == 1U) - { - *xfer->rxData = (uint8_t)tmpData; - } - else if (bytesPerFrame == 2U) - { - if (direction == kFLEXIO_SPI_LsbFirst) - { - *xfer->rxData = (uint8_t)(tmpData >> 8); - xfer->rxData++; - *xfer->rxData = (uint8_t)tmpData; - } - else - { - *xfer->rxData = (uint8_t)tmpData; - xfer->rxData++; - *xfer->rxData = (uint8_t)(tmpData >> 8); - } - } - else - { - if (direction == kFLEXIO_SPI_LsbFirst) - { - *xfer->rxData = (uint8_t)(tmpData >> 24U); - xfer->rxData++; - *xfer->rxData = (uint8_t)(tmpData >> 16U); - xfer->rxData++; - *xfer->rxData = (uint8_t)(tmpData >> 8U); - xfer->rxData++; - *xfer->rxData = (uint8_t)tmpData; - } - else - { - *xfer->rxData = (uint8_t)tmpData; - xfer->rxData++; - *xfer->rxData = (uint8_t)(tmpData >> 8U); - xfer->rxData++; - *xfer->rxData = (uint8_t)(tmpData >> 16U); - xfer->rxData++; - *xfer->rxData = (uint8_t)(tmpData >> 24U); - } - } - xfer->rxData++; - } - } - - return kStatus_Success; -} - -/*! - * brief Initializes the FlexIO SPI Master handle, which is used in transactional functions. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - * param callback The callback function. - * param userData The parameter of the callback function. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_SPI_MasterTransferCreateHandle(FLEXIO_SPI_Type *base, - flexio_spi_master_handle_t *handle, - flexio_spi_master_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - IRQn_Type flexio_irqs[] = FLEXIO_IRQS; - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Register callback and userData. */ - handle->callback = callback; - handle->userData = userData; - - /* Clear pending NVIC IRQ before enable NVIC IRQ. */ - NVIC_ClearPendingIRQ(flexio_irqs[FLEXIO_SPI_GetInstance(base)]); - /* Enable interrupt in NVIC. */ - (void)EnableIRQ(flexio_irqs[FLEXIO_SPI_GetInstance(base)]); - - /* Save the context in global variables to support the double weak mechanism. */ - return FLEXIO_RegisterHandleIRQ(base, handle, FLEXIO_SPI_MasterTransferHandleIRQ); -} - -/*! - * brief Master transfer data using IRQ. - * - * This function sends data using IRQ. This is a non-blocking function, which returns - * right away. When all data is sent out/received, the callback function is called. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - * param xfer FlexIO SPI transfer structure. See #flexio_spi_transfer_t. - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_InvalidArgument Input argument is invalid. - * retval kStatus_FLEXIO_SPI_Busy SPI is not idle, is running another transfer. - */ -status_t FLEXIO_SPI_MasterTransferNonBlocking(FLEXIO_SPI_Type *base, - flexio_spi_master_handle_t *handle, - flexio_spi_transfer_t *xfer) -{ - assert(handle != NULL); - assert(xfer != NULL); - - uint32_t dataMode = 0; - uint16_t timerCmp = (uint16_t)base->flexioBase->TIMCMP[base->timerIndex[0]]; - uint32_t tmpData = FLEXIO_SPI_DUMMYDATA; - uint8_t dataFormat = FLEXIO_SPI_XFER_DATA_FORMAT(xfer->flags); - - timerCmp &= 0x00FFU; - - /* Check if SPI is busy. */ - if (handle->state == (uint32_t)kFLEXIO_SPI_Busy) - { - return kStatus_FLEXIO_SPI_Busy; - } - - /* Check if the argument is legal. */ - if ((xfer->txData == NULL) && (xfer->rxData == NULL)) - { - return kStatus_InvalidArgument; - } - - /* Timer1 controls the CS signal which enables/disables(asserts/deasserts) when timer0 enable/disable. Timer0 - enables when tx shifter is written and disables when timer compare. The timer compare event causes the - transmit shift registers to load which generates a tx register empty event. Since when timer stop bit is - disabled, a timer enable condition can be detected in the same cycle as a timer disable condition, so if - software writes the tx register upon the detection of tx register empty event, the timer enable condition - is triggered again, then the CS signal can remain low until software no longer writes the tx register. */ - if ((xfer->flags & (uint8_t)kFLEXIO_SPI_csContinuous) != 0U) - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TSTOP_MASK) | - FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitDisabled); - } - else - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TSTOP_MASK) | - FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitEnableOnTimerDisable); - } - - /* Configure the values in handle */ - switch (dataFormat) - { - case (uint8_t)kFLEXIO_SPI_8bitMsb: - dataMode = (8UL * 2UL - 1UL) << 8U; - handle->bytePerFrame = 1U; - handle->direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_8bitLsb: - dataMode = (8UL * 2UL - 1UL) << 8U; - handle->bytePerFrame = 1U; - handle->direction = kFLEXIO_SPI_LsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_16bitMsb: - dataMode = (16UL * 2UL - 1UL) << 8U; - handle->bytePerFrame = 2U; - handle->direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_16bitLsb: - dataMode = (16UL * 2UL - 1UL) << 8U; - handle->bytePerFrame = 2U; - handle->direction = kFLEXIO_SPI_LsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_32bitMsb: - dataMode = (32UL * 2UL - 1UL) << 8U; - handle->bytePerFrame = 4U; - handle->direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_32bitLsb: - dataMode = (32UL * 2UL - 1UL) << 8U; - handle->bytePerFrame = 4U; - handle->direction = kFLEXIO_SPI_LsbFirst; - break; - default: - dataMode = (8UL * 2UL - 1UL) << 8U; - handle->bytePerFrame = 1U; - handle->direction = kFLEXIO_SPI_MsbFirst; - assert(true); - break; - } - - dataMode |= timerCmp; - - /* Transfer size should be bytesPerFrame divisible. */ - if ((xfer->dataSize % handle->bytePerFrame) != 0U) - { - return kStatus_InvalidArgument; - } - - /* Configure transfer size. */ - base->flexioBase->TIMCMP[base->timerIndex[0]] = dataMode; - - handle->state = (uint32_t)kFLEXIO_SPI_Busy; - handle->txData = xfer->txData; - handle->rxData = xfer->rxData; - handle->rxRemainingBytes = xfer->dataSize; - - /* Save total transfer size. */ - handle->transferSize = xfer->dataSize; - - /* Send first byte of data to trigger the rx interrupt. */ - if (handle->txData != NULL) - { - /* Transmit data and update tx size/buff. */ - if (handle->bytePerFrame == 1U) - { - tmpData = (uint32_t) * (handle->txData); - handle->txData++; - } - else if (handle->bytePerFrame == 2U) - { - if (handle->direction == kFLEXIO_SPI_MsbFirst) - { - tmpData = (uint32_t)(handle->txData[0]) << 8U; - tmpData += (uint32_t)handle->txData[1]; - } - else - { - tmpData = (uint32_t)(handle->txData[1]) << 8U; - tmpData += (uint32_t)handle->txData[0]; - } - handle->txData += 2U; - } - else - { - if (handle->direction == kFLEXIO_SPI_MsbFirst) - { - tmpData = (uint32_t)(handle->txData[0]) << 24U; - tmpData += (uint32_t)(handle->txData[1]) << 16U; - tmpData += (uint32_t)(handle->txData[2]) << 8U; - tmpData += (uint32_t)handle->txData[3]; - } - else - { - tmpData = (uint32_t)(handle->txData[3]) << 24U; - tmpData += (uint32_t)(handle->txData[2]) << 16U; - tmpData += (uint32_t)(handle->txData[1]) << 8U; - tmpData += (uint32_t)handle->txData[0]; - } - handle->txData += 4U; - } - } - else - { - tmpData = FLEXIO_SPI_DUMMYDATA; - } - - handle->txRemainingBytes = xfer->dataSize - handle->bytePerFrame; - - FLEXIO_SPI_WriteData(base, handle->direction, tmpData); - - /* Enable transmit and receive interrupt to handle rx. */ - FLEXIO_SPI_EnableInterrupts(base, (uint32_t)kFLEXIO_SPI_RxFullInterruptEnable); - - if ((xfer->flags & (uint8_t)kFLEXIO_SPI_csContinuous) != 0U) - { - FLEXIO_SPI_EnableInterrupts(base, (uint32_t)kFLEXIO_SPI_TxEmptyInterruptEnable); - } - - return kStatus_Success; -} - -/*! - * brief Gets the data transfer status which used IRQ. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - * param count Number of bytes transferred so far by the non-blocking transaction. - * retval kStatus_InvalidArgument count is Invalid. - * retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_SPI_MasterTransferGetCount(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Return remaing bytes in different cases. */ - if (handle->rxData != NULL) - { - *count = handle->transferSize - handle->rxRemainingBytes; - } - else - { - *count = handle->transferSize - handle->txRemainingBytes; - } - - return kStatus_Success; -} - -/*! - * brief Aborts the master data transfer, which used IRQ. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - */ -void FLEXIO_SPI_MasterTransferAbort(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle) -{ - assert(handle != NULL); - - FLEXIO_SPI_DisableInterrupts(base, (uint32_t)kFLEXIO_SPI_RxFullInterruptEnable); - FLEXIO_SPI_DisableInterrupts(base, (uint32_t)kFLEXIO_SPI_TxEmptyInterruptEnable); - - /* Transfer finished, set the state to idle. */ - handle->state = (uint32_t)kFLEXIO_SPI_Idle; - - /* Clear the internal state. */ - handle->rxRemainingBytes = 0; - handle->txRemainingBytes = 0; -} - -/*! - * brief FlexIO SPI master IRQ handler function. - * - * param spiType Pointer to the FLEXIO_SPI_Type structure. - * param spiHandle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - */ -void FLEXIO_SPI_MasterTransferHandleIRQ(void *spiType, void *spiHandle) -{ - assert(spiHandle != NULL); - - flexio_spi_master_handle_t *handle = (flexio_spi_master_handle_t *)spiHandle; - FLEXIO_SPI_Type *base; - uint32_t status; - - if (handle->state == (uint32_t)kFLEXIO_SPI_Idle) - { - return; - } - - base = (FLEXIO_SPI_Type *)spiType; - status = FLEXIO_SPI_GetStatusFlags(base); - - /* Receive interrupt. */ - if ((status & (uint32_t)kFLEXIO_SPI_RxBufferFullFlag) == 0U) - { - FLEXIO_SPI_TransferSendTransaction(base, handle); - return; - } - - /* Handle rx. */ - if (handle->rxRemainingBytes != 0U) - { - FLEXIO_SPI_TransferReceiveTransaction(base, handle); - } - - /* Handle tx. */ - if (((status & (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag) != 0U) && (handle->txRemainingBytes != 0U)) - { - FLEXIO_SPI_TransferSendTransaction(base, handle); - } - - /* All the transfer finished. */ - if ((handle->txRemainingBytes == 0U) && (handle->rxRemainingBytes == 0U)) - { - FLEXIO_SPI_MasterTransferAbort(base, handle); - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_FLEXIO_SPI_Idle, handle->userData); - } - } -} - -/*! - * brief Initializes the FlexIO SPI Slave handle, which is used in transactional functions. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param handle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - * param callback The callback function. - * param userData The parameter of the callback function. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_SPI_SlaveTransferCreateHandle(FLEXIO_SPI_Type *base, - flexio_spi_slave_handle_t *handle, - flexio_spi_slave_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - IRQn_Type flexio_irqs[] = FLEXIO_IRQS; - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Register callback and userData. */ - handle->callback = callback; - handle->userData = userData; - - /* Clear pending NVIC IRQ before enable NVIC IRQ. */ - NVIC_ClearPendingIRQ(flexio_irqs[FLEXIO_SPI_GetInstance(base)]); - /* Enable interrupt in NVIC. */ - (void)EnableIRQ(flexio_irqs[FLEXIO_SPI_GetInstance(base)]); - - /* Save the context in global variables to support the double weak mechanism. */ - return FLEXIO_RegisterHandleIRQ(base, handle, FLEXIO_SPI_SlaveTransferHandleIRQ); -} - -/*! - * brief Slave transfer data using IRQ. - * - * This function sends data using IRQ. This is a non-blocking function, which returns - * right away. When all data is sent out/received, the callback function is called. - * param handle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param xfer FlexIO SPI transfer structure. See #flexio_spi_transfer_t. - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_InvalidArgument Input argument is invalid. - * retval kStatus_FLEXIO_SPI_Busy SPI is not idle; it is running another transfer. - */ -status_t FLEXIO_SPI_SlaveTransferNonBlocking(FLEXIO_SPI_Type *base, - flexio_spi_slave_handle_t *handle, - flexio_spi_transfer_t *xfer) -{ - assert(handle != NULL); - assert(xfer != NULL); - - uint32_t dataMode = 0; - uint8_t dataFormat = FLEXIO_SPI_XFER_DATA_FORMAT(xfer->flags); - - /* Check if SPI is busy. */ - if (handle->state == (uint32_t)kFLEXIO_SPI_Busy) - { - return kStatus_FLEXIO_SPI_Busy; - } - - /* Check if the argument is legal. */ - if ((xfer->txData == NULL) && (xfer->rxData == NULL)) - { - return kStatus_InvalidArgument; - } - - /* SCK timer use CS pin as inverted trigger so timer should be disbaled on trigger falling edge(CS re-asserts). */ - /* However if CPHA is first edge mode, timer will restart each time right after timer compare event occur and - before CS pin re-asserts, which triggers another shifter load. To avoid this, when in CS dis-continuous mode, - timer should disable in timer compare rather than trigger falling edge(CS re-asserts), and in CS continuous mode, - tx/rx shifters should be flushed after transfer finishes and before next transfer starts. */ - FLEXIO_SPI_FlushShifters(base); - if ((xfer->flags & (uint8_t)kFLEXIO_SPI_csContinuous) != 0U) - { - base->flexioBase->TIMCFG[base->timerIndex[0]] |= FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTriggerFallingEdge); - } - else - { - if ((base->flexioBase->SHIFTCTL[base->shifterIndex[0]] & FLEXIO_SHIFTCTL_TIMPOL_MASK) == - FLEXIO_SHIFTCTL_TIMPOL(kFLEXIO_ShifterTimerPolarityOnNegitive)) - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TIMDIS_MASK) | - FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTimerCompare); - } - else - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TIMDIS_MASK) | - FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTriggerFallingEdge); - } - } - - /* Configure the values in handle */ - switch (dataFormat) - { - case (uint8_t)kFLEXIO_SPI_8bitMsb: - dataMode = 8U * 2U - 1U; - handle->bytePerFrame = 1U; - handle->direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_8bitLsb: - dataMode = 8U * 2U - 1U; - handle->bytePerFrame = 1U; - handle->direction = kFLEXIO_SPI_LsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_16bitMsb: - dataMode = 16U * 2U - 1U; - handle->bytePerFrame = 2U; - handle->direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_16bitLsb: - dataMode = 16U * 2U - 1U; - handle->bytePerFrame = 2U; - handle->direction = kFLEXIO_SPI_LsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_32bitMsb: - dataMode = 32UL * 2UL - 1UL; - handle->bytePerFrame = 4U; - handle->direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_32bitLsb: - dataMode = 32UL * 2UL - 1UL; - handle->bytePerFrame = 4U; - handle->direction = kFLEXIO_SPI_LsbFirst; - break; - default: - dataMode = 8UL * 2UL - 1UL; - handle->bytePerFrame = 1U; - handle->direction = kFLEXIO_SPI_MsbFirst; - assert(true); - break; - } - - /* Transfer size should be bytesPerFrame divisible. */ - if ((xfer->dataSize % handle->bytePerFrame) != 0U) - { - return kStatus_InvalidArgument; - } - - /* Configure transfer size. */ - base->flexioBase->TIMCMP[base->timerIndex[0]] = dataMode; - - handle->state = (uint32_t)kFLEXIO_SPI_Busy; - handle->txData = xfer->txData; - handle->rxData = xfer->rxData; - handle->txRemainingBytes = xfer->dataSize; - handle->rxRemainingBytes = xfer->dataSize; - - /* Save total transfer size. */ - handle->transferSize = xfer->dataSize; - - /* Enable transmit and receive interrupt to handle tx and rx. */ - FLEXIO_SPI_EnableInterrupts(base, (uint32_t)kFLEXIO_SPI_TxEmptyInterruptEnable); - FLEXIO_SPI_EnableInterrupts(base, (uint32_t)kFLEXIO_SPI_RxFullInterruptEnable); - - return kStatus_Success; -} - -/*! - * brief FlexIO SPI slave IRQ handler function. - * - * param spiType Pointer to the FLEXIO_SPI_Type structure. - * param spiHandle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - */ -void FLEXIO_SPI_SlaveTransferHandleIRQ(void *spiType, void *spiHandle) -{ - assert(spiHandle != NULL); - - flexio_spi_master_handle_t *handle = (flexio_spi_master_handle_t *)spiHandle; - FLEXIO_SPI_Type *base; - uint32_t status; - - if (handle->state == (uint32_t)kFLEXIO_SPI_Idle) - { - return; - } - - base = (FLEXIO_SPI_Type *)spiType; - status = FLEXIO_SPI_GetStatusFlags(base); - - /* Handle tx. */ - if (((status & (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag) != 0U) && (handle->txRemainingBytes != 0U)) - { - FLEXIO_SPI_TransferSendTransaction(base, handle); - } - - /* Handle rx. */ - if (((status & (uint32_t)kFLEXIO_SPI_RxBufferFullFlag) != 0U) && (handle->rxRemainingBytes != 0U)) - { - FLEXIO_SPI_TransferReceiveTransaction(base, handle); - } - - /* All the transfer finished. */ - if ((handle->txRemainingBytes == 0U) && (handle->rxRemainingBytes == 0U)) - { - FLEXIO_SPI_SlaveTransferAbort(base, handle); - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_FLEXIO_SPI_Idle, handle->userData); - } - } -} - -/*! - * brief Flush tx/rx shifters. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - */ -void FLEXIO_SPI_FlushShifters(FLEXIO_SPI_Type *base) -{ - /* Disable then re-enable to flush the tx shifter. */ - base->flexioBase->SHIFTCTL[base->shifterIndex[0]] &= ~FLEXIO_SHIFTCTL_SMOD_MASK; - base->flexioBase->SHIFTCTL[base->shifterIndex[0]] |= FLEXIO_SHIFTCTL_SMOD(kFLEXIO_ShifterModeTransmit); - /* Read to flush the rx shifter. */ - (void)base->flexioBase->SHIFTBUF[base->shifterIndex[1]]; -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_spi.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_spi.h deleted file mode 100644 index cae17a802c9..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_spi.h +++ /dev/null @@ -1,718 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020, 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_FLEXIO_SPI_H_ -#define FSL_FLEXIO_SPI_H_ - -#include "fsl_common.h" -#include "fsl_flexio.h" - -/*! - * @addtogroup flexio_spi - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief FlexIO SPI driver version. */ -#define FSL_FLEXIO_SPI_DRIVER_VERSION (MAKE_VERSION(2, 3, 4)) -/*! @} */ - -#ifndef FLEXIO_SPI_DUMMYDATA -/*! @brief FlexIO SPI dummy transfer data, the data is sent while txData is NULL. */ -#define FLEXIO_SPI_DUMMYDATA (0x00U) -#endif - -/*! @brief Retry times for waiting flag. */ -#ifndef SPI_RETRY_TIMES -#define SPI_RETRY_TIMES 0U /* Define to zero means keep waiting until the flag is assert/deassert. */ -#endif - -/*! @brief Get the transfer data format of width and bit order. */ -#define FLEXIO_SPI_XFER_DATA_FORMAT(flag) ((flag) & (0x7U)) - -/*! @brief Error codes for the FlexIO SPI driver. */ -enum -{ - kStatus_FLEXIO_SPI_Busy = MAKE_STATUS(kStatusGroup_FLEXIO_SPI, 1), /*!< FlexIO SPI is busy. */ - kStatus_FLEXIO_SPI_Idle = MAKE_STATUS(kStatusGroup_FLEXIO_SPI, 2), /*!< SPI is idle */ - kStatus_FLEXIO_SPI_Error = MAKE_STATUS(kStatusGroup_FLEXIO_SPI, 3), /*!< FlexIO SPI error. */ - kStatus_FLEXIO_SPI_Timeout = - MAKE_STATUS(kStatusGroup_FLEXIO_SPI, 4), /*!< FlexIO SPI timeout polling status flags. */ -}; - -/*! @brief FlexIO SPI clock phase configuration. */ -typedef enum _flexio_spi_clock_phase -{ - kFLEXIO_SPI_ClockPhaseFirstEdge = 0x0U, /*!< First edge on SPSCK occurs at the middle of the first - * cycle of a data transfer. */ - kFLEXIO_SPI_ClockPhaseSecondEdge = 0x1U, /*!< First edge on SPSCK occurs at the start of the - * first cycle of a data transfer. */ -} flexio_spi_clock_phase_t; - -/*! @brief FlexIO SPI data shifter direction options. */ -typedef enum _flexio_spi_shift_direction -{ - kFLEXIO_SPI_MsbFirst = 0, /*!< Data transfers start with most significant bit. */ - kFLEXIO_SPI_LsbFirst = 1, /*!< Data transfers start with least significant bit. */ -} flexio_spi_shift_direction_t; - -/*! @brief FlexIO SPI data length mode options. */ -typedef enum _flexio_spi_data_bitcount_mode -{ - kFLEXIO_SPI_8BitMode = 0x08U, /*!< 8-bit data transmission mode. */ - kFLEXIO_SPI_16BitMode = 0x10U, /*!< 16-bit data transmission mode. */ - kFLEXIO_SPI_32BitMode = 0x20U, /*!< 32-bit data transmission mode. */ -} flexio_spi_data_bitcount_mode_t; - -/*! @brief Define FlexIO SPI interrupt mask. */ -enum _flexio_spi_interrupt_enable -{ - kFLEXIO_SPI_TxEmptyInterruptEnable = 0x1U, /*!< Transmit buffer empty interrupt enable. */ - kFLEXIO_SPI_RxFullInterruptEnable = 0x2U, /*!< Receive buffer full interrupt enable. */ -}; - -/*! @brief Define FlexIO SPI status mask. */ -enum _flexio_spi_status_flags -{ - kFLEXIO_SPI_TxBufferEmptyFlag = 0x1U, /*!< Transmit buffer empty flag. */ - kFLEXIO_SPI_RxBufferFullFlag = 0x2U, /*!< Receive buffer full flag. */ -}; - -/*! @brief Define FlexIO SPI DMA mask. */ -enum _flexio_spi_dma_enable -{ - kFLEXIO_SPI_TxDmaEnable = 0x1U, /*!< Tx DMA request source */ - kFLEXIO_SPI_RxDmaEnable = 0x2U, /*!< Rx DMA request source */ - kFLEXIO_SPI_DmaAllEnable = 0x3U, /*!< All DMA request source*/ -}; - -/*! @brief Define FlexIO SPI transfer flags. - * @note Use kFLEXIO_SPI_csContinuous and one of the other flags to OR together to form the transfer flag. */ -enum _flexio_spi_transfer_flags -{ - kFLEXIO_SPI_8bitMsb = 0x0U, /*!< FlexIO SPI 8-bit MSB first */ - kFLEXIO_SPI_8bitLsb = 0x1U, /*!< FlexIO SPI 8-bit LSB first */ - kFLEXIO_SPI_16bitMsb = 0x2U, /*!< FlexIO SPI 16-bit MSB first */ - kFLEXIO_SPI_16bitLsb = 0x3U, /*!< FlexIO SPI 16-bit LSB first */ - kFLEXIO_SPI_32bitMsb = 0x4U, /*!< FlexIO SPI 32-bit MSB first */ - kFLEXIO_SPI_32bitLsb = 0x5U, /*!< FlexIO SPI 32-bit LSB first */ - kFLEXIO_SPI_csContinuous = 0x8U, /*!< Enable the CS signal continuous mode */ -}; - -/*! @brief Define FlexIO SPI access structure typedef. */ -typedef struct _flexio_spi_type -{ - FLEXIO_Type *flexioBase; /*!< FlexIO base pointer. */ - uint8_t SDOPinIndex; /*!< Pin select for data output. To set SDO pin in Hi-Z state, user needs to mux the pin as - GPIO input and disable all pull up/down in application. */ - uint8_t SDIPinIndex; /*!< Pin select for data input. */ - uint8_t SCKPinIndex; /*!< Pin select for clock. */ - uint8_t CSnPinIndex; /*!< Pin select for enable. */ - uint8_t shifterIndex[2]; /*!< Shifter index used in FlexIO SPI. */ - uint8_t timerIndex[2]; /*!< Timer index used in FlexIO SPI. */ -} FLEXIO_SPI_Type; - -/*! @brief Define FlexIO SPI master configuration structure. */ -typedef struct _flexio_spi_master_config -{ - bool enableMaster; /*!< Enable/disable FlexIO SPI master after configuration. */ - bool enableInDoze; /*!< Enable/disable FlexIO operation in doze mode. */ - bool enableInDebug; /*!< Enable/disable FlexIO operation in debug mode. */ - bool enableFastAccess; /*!< Enable/disable fast access to FlexIO registers, - fast access requires the FlexIO clock to be at least - twice the frequency of the bus clock. */ - uint32_t baudRate_Bps; /*!< Baud rate in Bps. */ - flexio_spi_clock_phase_t phase; /*!< Clock phase. */ - flexio_spi_data_bitcount_mode_t dataMode; /*!< 8bit or 16bit mode. */ -} flexio_spi_master_config_t; - -/*! @brief Define FlexIO SPI slave configuration structure. */ -typedef struct _flexio_spi_slave_config -{ - bool enableSlave; /*!< Enable/disable FlexIO SPI slave after configuration. */ - bool enableInDoze; /*!< Enable/disable FlexIO operation in doze mode. */ - bool enableInDebug; /*!< Enable/disable FlexIO operation in debug mode. */ - bool enableFastAccess; /*!< Enable/disable fast access to FlexIO registers, - fast access requires the FlexIO clock to be at least - twice the frequency of the bus clock. */ - flexio_spi_clock_phase_t phase; /*!< Clock phase. */ - flexio_spi_data_bitcount_mode_t dataMode; /*!< 8bit or 16bit mode. */ -} flexio_spi_slave_config_t; - -/*! @brief Define FlexIO SPI transfer structure. */ -typedef struct _flexio_spi_transfer -{ - const uint8_t *txData; /*!< Send buffer. */ - uint8_t *rxData; /*!< Receive buffer. */ - size_t dataSize; /*!< Transfer bytes. */ - uint8_t flags; /*!< FlexIO SPI control flag, MSB first or LSB first. */ -} flexio_spi_transfer_t; - -/*! @brief typedef for flexio_spi_master_handle_t in advance. */ -typedef struct _flexio_spi_master_handle flexio_spi_master_handle_t; - -/*! @brief Slave handle is the same with master handle. */ -typedef flexio_spi_master_handle_t flexio_spi_slave_handle_t; - -/*! @brief FlexIO SPI master callback for finished transmit */ -typedef void (*flexio_spi_master_transfer_callback_t)(FLEXIO_SPI_Type *base, - flexio_spi_master_handle_t *handle, - status_t status, - void *userData); - -/*! @brief FlexIO SPI slave callback for finished transmit */ -typedef void (*flexio_spi_slave_transfer_callback_t)(FLEXIO_SPI_Type *base, - flexio_spi_slave_handle_t *handle, - status_t status, - void *userData); - -/*! @brief Define FlexIO SPI handle structure. */ -struct _flexio_spi_master_handle -{ - const uint8_t *txData; /*!< Transfer buffer. */ - uint8_t *rxData; /*!< Receive buffer. */ - size_t transferSize; /*!< Total bytes to be transferred. */ - volatile size_t txRemainingBytes; /*!< Send data remaining in bytes. */ - volatile size_t rxRemainingBytes; /*!< Receive data remaining in bytes. */ - volatile uint32_t state; /*!< FlexIO SPI internal state. */ - uint8_t bytePerFrame; /*!< SPI mode, 2bytes or 1byte in a frame */ - flexio_spi_shift_direction_t direction; /*!< Shift direction. */ - flexio_spi_master_transfer_callback_t callback; /*!< FlexIO SPI callback. */ - void *userData; /*!< Callback parameter. */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus*/ - -/*! - * @name FlexIO SPI Configuration - * @{ - */ - -/*! - * @brief Ungates the FlexIO clock, resets the FlexIO module, configures the FlexIO SPI master hardware, - * and configures the FlexIO SPI with FlexIO SPI master configuration. The - * configuration structure can be filled by the user, or be set with default values - * by the FLEXIO_SPI_MasterGetDefaultConfig(). - * - * @note 1.FlexIO SPI master only support CPOL = 0, which means clock inactive low. - * 2.For FlexIO SPI master, the input valid time is 1.5 clock cycles, for slave the output valid time - * is 2.5 clock cycles. So if FlexIO SPI master communicates with other spi IPs, the maximum baud - * rate is FlexIO clock frequency divided by 2*2=4. If FlexIO SPI master communicates with FlexIO - * SPI slave, the maximum baud rate is FlexIO clock frequency divided by (1.5+2.5)*2=8. - * - * Example - @code - FLEXIO_SPI_Type spiDev = { - .flexioBase = FLEXIO, - .SDOPinIndex = 0, - .SDIPinIndex = 1, - .SCKPinIndex = 2, - .CSnPinIndex = 3, - .shifterIndex = {0,1}, - .timerIndex = {0,1} - }; - flexio_spi_master_config_t config = { - .enableMaster = true, - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .baudRate_Bps = 500000, - .phase = kFLEXIO_SPI_ClockPhaseFirstEdge, - .direction = kFLEXIO_SPI_MsbFirst, - .dataMode = kFLEXIO_SPI_8BitMode - }; - FLEXIO_SPI_MasterInit(&spiDev, &config, srcClock_Hz); - @endcode - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param masterConfig Pointer to the flexio_spi_master_config_t structure. - * @param srcClock_Hz FlexIO source clock in Hz. -*/ -void FLEXIO_SPI_MasterInit(FLEXIO_SPI_Type *base, flexio_spi_master_config_t *masterConfig, uint32_t srcClock_Hz); - -/*! - * @brief Resets the FlexIO SPI timer and shifter config. - * - * @param base Pointer to the FLEXIO_SPI_Type. - */ -void FLEXIO_SPI_MasterDeinit(FLEXIO_SPI_Type *base); - -/*! - * @brief Gets the default configuration to configure the FlexIO SPI master. The configuration - * can be used directly by calling the FLEXIO_SPI_MasterConfigure(). - * Example: - @code - flexio_spi_master_config_t masterConfig; - FLEXIO_SPI_MasterGetDefaultConfig(&masterConfig); - @endcode - * @param masterConfig Pointer to the flexio_spi_master_config_t structure. -*/ -void FLEXIO_SPI_MasterGetDefaultConfig(flexio_spi_master_config_t *masterConfig); - -/*! - * @brief Ungates the FlexIO clock, resets the FlexIO module, configures the FlexIO SPI slave hardware - * configuration, and configures the FlexIO SPI with FlexIO SPI slave configuration. The - * configuration structure can be filled by the user, or be set with default values - * by the FLEXIO_SPI_SlaveGetDefaultConfig(). - * - * @note 1.Only one timer is needed in the FlexIO SPI slave. As a result, the second timer index is ignored. - * 2.FlexIO SPI slave only support CPOL = 0, which means clock inactive low. - * 3.For FlexIO SPI master, the input valid time is 1.5 clock cycles, for slave the output valid time - * is 2.5 clock cycles. So if FlexIO SPI slave communicates with other spi IPs, the maximum baud - * rate is FlexIO clock frequency divided by 3*2=6. If FlexIO SPI slave communicates with FlexIO - * SPI master, the maximum baud rate is FlexIO clock frequency divided by (1.5+2.5)*2=8. - * Example - @code - FLEXIO_SPI_Type spiDev = { - .flexioBase = FLEXIO, - .SDOPinIndex = 0, - .SDIPinIndex = 1, - .SCKPinIndex = 2, - .CSnPinIndex = 3, - .shifterIndex = {0,1}, - .timerIndex = {0} - }; - flexio_spi_slave_config_t config = { - .enableSlave = true, - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .phase = kFLEXIO_SPI_ClockPhaseFirstEdge, - .direction = kFLEXIO_SPI_MsbFirst, - .dataMode = kFLEXIO_SPI_8BitMode - }; - FLEXIO_SPI_SlaveInit(&spiDev, &config); - @endcode - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param slaveConfig Pointer to the flexio_spi_slave_config_t structure. -*/ -void FLEXIO_SPI_SlaveInit(FLEXIO_SPI_Type *base, flexio_spi_slave_config_t *slaveConfig); - -/*! - * @brief Gates the FlexIO clock. - * - * @param base Pointer to the FLEXIO_SPI_Type. - */ -void FLEXIO_SPI_SlaveDeinit(FLEXIO_SPI_Type *base); - -/*! - * @brief Gets the default configuration to configure the FlexIO SPI slave. The configuration - * can be used directly for calling the FLEXIO_SPI_SlaveConfigure(). - * Example: - @code - flexio_spi_slave_config_t slaveConfig; - FLEXIO_SPI_SlaveGetDefaultConfig(&slaveConfig); - @endcode - * @param slaveConfig Pointer to the flexio_spi_slave_config_t structure. -*/ -void FLEXIO_SPI_SlaveGetDefaultConfig(flexio_spi_slave_config_t *slaveConfig); - -/*! @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets FlexIO SPI status flags. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @return status flag; Use the status flag to AND the following flag mask and get the status. - * @arg kFLEXIO_SPI_TxEmptyFlag - * @arg kFLEXIO_SPI_RxEmptyFlag - */ - -uint32_t FLEXIO_SPI_GetStatusFlags(FLEXIO_SPI_Type *base); - -/*! - * @brief Clears FlexIO SPI status flags. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param mask status flag - * The parameter can be any combination of the following values: - * @arg kFLEXIO_SPI_TxEmptyFlag - * @arg kFLEXIO_SPI_RxEmptyFlag - */ - -void FLEXIO_SPI_ClearStatusFlags(FLEXIO_SPI_Type *base, uint32_t mask); - -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables the FlexIO SPI interrupt. - * - * This function enables the FlexIO SPI interrupt. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param mask interrupt source. The parameter can be any combination of the following values: - * @arg kFLEXIO_SPI_RxFullInterruptEnable - * @arg kFLEXIO_SPI_TxEmptyInterruptEnable - */ -void FLEXIO_SPI_EnableInterrupts(FLEXIO_SPI_Type *base, uint32_t mask); - -/*! - * @brief Disables the FlexIO SPI interrupt. - * - * This function disables the FlexIO SPI interrupt. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param mask interrupt source The parameter can be any combination of the following values: - * @arg kFLEXIO_SPI_RxFullInterruptEnable - * @arg kFLEXIO_SPI_TxEmptyInterruptEnable - */ -void FLEXIO_SPI_DisableInterrupts(FLEXIO_SPI_Type *base, uint32_t mask); - -/*! @} */ - -/*! - * @name DMA Control - * @{ - */ - -/*! - * @brief Enables/disables the FlexIO SPI transmit DMA. This function enables/disables the FlexIO SPI Tx DMA, - * which means that asserting the kFLEXIO_SPI_TxEmptyFlag does/doesn't trigger the DMA request. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param mask SPI DMA source. - * @param enable True means enable DMA, false means disable DMA. - */ -void FLEXIO_SPI_EnableDMA(FLEXIO_SPI_Type *base, uint32_t mask, bool enable); - -/*! - * @brief Gets the FlexIO SPI transmit data register address for MSB first transfer. - * - * This function returns the SPI data register address, which is mainly used by DMA/eDMA. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param direction Shift direction of MSB first or LSB first. - * @return FlexIO SPI transmit data register address. - */ -static inline uint32_t FLEXIO_SPI_GetTxDataRegisterAddress(FLEXIO_SPI_Type *base, - flexio_spi_shift_direction_t direction) -{ - if (direction == kFLEXIO_SPI_MsbFirst) - { - return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBufferBitSwapped, - base->shifterIndex[0]) + - 3U; - } - else - { - return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBuffer, base->shifterIndex[0]); - } -} - -/*! - * @brief Gets the FlexIO SPI receive data register address for the MSB first transfer. - * - * This function returns the SPI data register address, which is mainly used by DMA/eDMA. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param direction Shift direction of MSB first or LSB first. - * @return FlexIO SPI receive data register address. - */ -static inline uint32_t FLEXIO_SPI_GetRxDataRegisterAddress(FLEXIO_SPI_Type *base, - flexio_spi_shift_direction_t direction) -{ - if (direction == kFLEXIO_SPI_MsbFirst) - { - return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBufferBitSwapped, base->shifterIndex[1]); - } - else - { - return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBuffer, base->shifterIndex[1]) + 3U; - } -} - -/*! @} */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Enables/disables the FlexIO SPI module operation. - * - * @param base Pointer to the FLEXIO_SPI_Type. - * @param enable True to enable, false does not have any effect. - */ -static inline void FLEXIO_SPI_Enable(FLEXIO_SPI_Type *base, bool enable) -{ - if (enable) - { - base->flexioBase->CTRL |= FLEXIO_CTRL_FLEXEN_MASK; - } -} - -/*! - * @brief Sets baud rate for the FlexIO SPI transfer, which is only used for the master. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param baudRate_Bps Baud Rate needed in Hz. - * @param srcClockHz SPI source clock frequency in Hz. - */ -void FLEXIO_SPI_MasterSetBaudRate(FLEXIO_SPI_Type *base, uint32_t baudRate_Bps, uint32_t srcClockHz); - -/*! - * @brief Writes one byte of data, which is sent using the MSB method. - * - * @note This is a non-blocking API, which returns directly after the data is put into the - * data register but the data transfer is not finished on the bus. Ensure that - * the TxEmptyFlag is asserted before calling this API. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param direction Shift direction of MSB first or LSB first. - * @param data 8/16/32 bit data. - */ -static inline void FLEXIO_SPI_WriteData(FLEXIO_SPI_Type *base, flexio_spi_shift_direction_t direction, uint32_t data) -{ - if (direction == kFLEXIO_SPI_MsbFirst) - { - base->flexioBase->SHIFTBUFBBS[base->shifterIndex[0]] = data; - } - else - { - base->flexioBase->SHIFTBUF[base->shifterIndex[0]] = data; - } -} - -/*! - * @brief Reads 8 bit/16 bit data. - * - * @note This is a non-blocking API, which returns directly after the data is read from the - * data register. Ensure that the RxFullFlag is asserted before calling this API. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param direction Shift direction of MSB first or LSB first. - * @return 8 bit/16 bit data received. - */ -static inline uint32_t FLEXIO_SPI_ReadData(FLEXIO_SPI_Type *base, flexio_spi_shift_direction_t direction) -{ - if (direction == kFLEXIO_SPI_MsbFirst) - { - return (uint32_t)(base->flexioBase->SHIFTBUFBIS[base->shifterIndex[1]]); - } - else - { - return (uint32_t)(base->flexioBase->SHIFTBUFBYS[base->shifterIndex[1]]); - } -} - -/*! - * @brief Sends a buffer of data bytes. - * - * @note This function blocks using the polling method until all bytes have been sent. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param direction Shift direction of MSB first or LSB first. - * @param buffer The data bytes to send. - * @param size The number of data bytes to send. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_FLEXIO_SPI_Timeout The transfer timed out and was aborted. - */ -status_t FLEXIO_SPI_WriteBlocking(FLEXIO_SPI_Type *base, - flexio_spi_shift_direction_t direction, - const uint8_t *buffer, - size_t size); - -/*! - * @brief Receives a buffer of bytes. - * - * @note This function blocks using the polling method until all bytes have been received. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param direction Shift direction of MSB first or LSB first. - * @param buffer The buffer to store the received bytes. - * @param size The number of data bytes to be received. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_FLEXIO_SPI_Timeout The transfer timed out and was aborted. - */ -status_t FLEXIO_SPI_ReadBlocking(FLEXIO_SPI_Type *base, - flexio_spi_shift_direction_t direction, - uint8_t *buffer, - size_t size); - -/*! - * @brief Receives a buffer of bytes. - * - * @note This function blocks via polling until all bytes have been received. - * - * @param base pointer to FLEXIO_SPI_Type structure - * @param xfer FlexIO SPI transfer structure, see #flexio_spi_transfer_t. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_FLEXIO_SPI_Timeout The transfer timed out and was aborted. - */ -status_t FLEXIO_SPI_MasterTransferBlocking(FLEXIO_SPI_Type *base, flexio_spi_transfer_t *xfer); - -/*! - * @brief Flush tx/rx shifters. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - */ -void FLEXIO_SPI_FlushShifters(FLEXIO_SPI_Type *base); -/*! @} */ - -/*Transactional APIs*/ - -/*! - * @name Transactional - * @{ - */ - -/*! - * @brief Initializes the FlexIO SPI Master handle, which is used in transactional functions. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - * @param callback The callback function. - * @param userData The parameter of the callback function. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_SPI_MasterTransferCreateHandle(FLEXIO_SPI_Type *base, - flexio_spi_master_handle_t *handle, - flexio_spi_master_transfer_callback_t callback, - void *userData); - -/*! - * @brief Master transfer data using IRQ. - * - * This function sends data using IRQ. This is a non-blocking function, which returns - * right away. When all data is sent out/received, the callback function is called. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - * @param xfer FlexIO SPI transfer structure. See #flexio_spi_transfer_t. - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_InvalidArgument Input argument is invalid. - * @retval kStatus_FLEXIO_SPI_Busy SPI is not idle, is running another transfer. - */ -status_t FLEXIO_SPI_MasterTransferNonBlocking(FLEXIO_SPI_Type *base, - flexio_spi_master_handle_t *handle, - flexio_spi_transfer_t *xfer); - -/*! - * @brief Aborts the master data transfer, which used IRQ. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - */ -void FLEXIO_SPI_MasterTransferAbort(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle); - -/*! - * @brief Gets the data transfer status which used IRQ. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - * @param count Number of bytes transferred so far by the non-blocking transaction. - * @retval kStatus_InvalidArgument count is Invalid. - * @retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_SPI_MasterTransferGetCount(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle, size_t *count); - -/*! - * @brief FlexIO SPI master IRQ handler function. - * - * @param spiType Pointer to the FLEXIO_SPI_Type structure. - * @param spiHandle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - */ -void FLEXIO_SPI_MasterTransferHandleIRQ(void *spiType, void *spiHandle); - -/*! - * @brief Initializes the FlexIO SPI Slave handle, which is used in transactional functions. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param handle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - * @param callback The callback function. - * @param userData The parameter of the callback function. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_SPI_SlaveTransferCreateHandle(FLEXIO_SPI_Type *base, - flexio_spi_slave_handle_t *handle, - flexio_spi_slave_transfer_callback_t callback, - void *userData); - -/*! - * @brief Slave transfer data using IRQ. - * - * This function sends data using IRQ. This is a non-blocking function, which returns - * right away. When all data is sent out/received, the callback function is called. - * @param handle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param xfer FlexIO SPI transfer structure. See #flexio_spi_transfer_t. - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_InvalidArgument Input argument is invalid. - * @retval kStatus_FLEXIO_SPI_Busy SPI is not idle; it is running another transfer. - */ -status_t FLEXIO_SPI_SlaveTransferNonBlocking(FLEXIO_SPI_Type *base, - flexio_spi_slave_handle_t *handle, - flexio_spi_transfer_t *xfer); - -/*! - * @brief Aborts the slave data transfer which used IRQ, share same API with master. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param handle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - */ -static inline void FLEXIO_SPI_SlaveTransferAbort(FLEXIO_SPI_Type *base, flexio_spi_slave_handle_t *handle) -{ - FLEXIO_SPI_MasterTransferAbort(base, handle); -} -/*! - * @brief Gets the data transfer status which used IRQ, share same API with master. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param handle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - * @param count Number of bytes transferred so far by the non-blocking transaction. - * @retval kStatus_InvalidArgument count is Invalid. - * @retval kStatus_Success Successfully return the count. - */ -static inline status_t FLEXIO_SPI_SlaveTransferGetCount(FLEXIO_SPI_Type *base, - flexio_spi_slave_handle_t *handle, - size_t *count) -{ - return FLEXIO_SPI_MasterTransferGetCount(base, handle, count); -} - -/*! - * @brief FlexIO SPI slave IRQ handler function. - * - * @param spiType Pointer to the FLEXIO_SPI_Type structure. - * @param spiHandle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - */ -void FLEXIO_SPI_SlaveTransferHandleIRQ(void *spiType, void *spiHandle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /*_cplusplus*/ -/*! @} */ - -#endif /*FSL_FLEXIO_SPI_H_*/ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_spi_edma.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_spi_edma.c deleted file mode 100644 index c1feba0f001..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_spi_edma.c +++ /dev/null @@ -1,565 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020, 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio_spi_edma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio_spi_edma" -#endif - -/*base, (uint32_t)kFLEXIO_SPI_TxDmaEnable, false); - - /* change the state */ - spiPrivateHandle->handle->txInProgress = false; - - /* All finished, call the callback */ - if ((spiPrivateHandle->handle->txInProgress == false) && (spiPrivateHandle->handle->rxInProgress == false)) - { - if (spiPrivateHandle->handle->callback != NULL) - { - (spiPrivateHandle->handle->callback)(spiPrivateHandle->base, spiPrivateHandle->handle, kStatus_Success, - spiPrivateHandle->handle->userData); - } - } - } -} - -static void FLEXIO_SPI_RxEDMACallback(edma_handle_t *handle, void *param, bool transferDone, uint32_t tcds) -{ - tcds = tcds; - flexio_spi_master_edma_private_handle_t *spiPrivateHandle = (flexio_spi_master_edma_private_handle_t *)param; - - if (transferDone) - { - /* Disable Rx dma */ - FLEXIO_SPI_EnableDMA(spiPrivateHandle->base, (uint32_t)kFLEXIO_SPI_RxDmaEnable, false); - - /* change the state */ - spiPrivateHandle->handle->rxInProgress = false; - - /* All finished, call the callback */ - if ((spiPrivateHandle->handle->txInProgress == false) && (spiPrivateHandle->handle->rxInProgress == false)) - { - if (spiPrivateHandle->handle->callback != NULL) - { - (spiPrivateHandle->handle->callback)(spiPrivateHandle->base, spiPrivateHandle->handle, kStatus_Success, - spiPrivateHandle->handle->userData); - } - } - } -} - -static status_t FLEXIO_SPI_EDMAConfig(FLEXIO_SPI_Type *base, - flexio_spi_master_edma_handle_t *handle, - flexio_spi_transfer_t *xfer) -{ - edma_transfer_config_t xferConfig = {0}; - flexio_spi_shift_direction_t direction = kFLEXIO_SPI_MsbFirst; - uint8_t bytesPerFrame; - uint8_t dataFormat = FLEXIO_SPI_XFER_DATA_FORMAT(xfer->flags); - - /* Configure the values in handle. */ - switch (dataFormat) - { - case (uint8_t)kFLEXIO_SPI_8bitMsb: - bytesPerFrame = 1U; - direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_8bitLsb: - bytesPerFrame = 1U; - direction = kFLEXIO_SPI_LsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_16bitMsb: - bytesPerFrame = 2U; - direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_16bitLsb: - bytesPerFrame = 2U; - direction = kFLEXIO_SPI_LsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_32bitMsb: - bytesPerFrame = 4U; - direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_32bitLsb: - bytesPerFrame = 4U; - direction = kFLEXIO_SPI_LsbFirst; - break; - default: - bytesPerFrame = 1U; - direction = kFLEXIO_SPI_MsbFirst; - assert(true); - break; - } - - /* Transfer size should be bytesPerFrame divisible. */ - if ((xfer->dataSize % bytesPerFrame) != 0U) - { - return kStatus_InvalidArgument; - } - - /* Save total transfer size. */ - handle->transferSize = xfer->dataSize; - - /* Configure tx transfer EDMA. */ - xferConfig.destAddr = FLEXIO_SPI_GetTxDataRegisterAddress(base, direction); - xferConfig.destOffset = 0; - if (bytesPerFrame == 1U) - { - xferConfig.srcTransferSize = kEDMA_TransferSize1Bytes; - xferConfig.destTransferSize = kEDMA_TransferSize1Bytes; - xferConfig.minorLoopBytes = 1U; - } - else if (bytesPerFrame == 2U) - { - if (direction == kFLEXIO_SPI_MsbFirst) - { - xferConfig.destAddr -= 1U; - } - xferConfig.srcTransferSize = kEDMA_TransferSize2Bytes; - xferConfig.destTransferSize = kEDMA_TransferSize2Bytes; - xferConfig.minorLoopBytes = 2U; - } - else - { - if (direction == kFLEXIO_SPI_MsbFirst) - { - xferConfig.destAddr -= 3U; - } - xferConfig.srcTransferSize = kEDMA_TransferSize4Bytes; - xferConfig.destTransferSize = kEDMA_TransferSize4Bytes; - xferConfig.minorLoopBytes = 4U; - } - - /* Configure DMA channel. */ - if (xfer->txData != NULL) - { - xferConfig.srcOffset = (int16_t)bytesPerFrame; - xferConfig.srcAddr = (uint32_t)(xfer->txData); - } - else - { - /* Disable the source increasement and source set to dummyData. */ - xferConfig.srcOffset = 0; - xferConfig.srcAddr = (uint32_t)(&s_dummyData); - } - - xferConfig.majorLoopCounts = (xfer->dataSize / xferConfig.minorLoopBytes); - - /* Store the initially configured eDMA minor byte transfer count into the FLEXIO SPI handle */ - handle->nbytes = (uint8_t)xferConfig.minorLoopBytes; - - if (handle->txHandle != NULL) - { - (void)EDMA_SubmitTransfer(handle->txHandle, &xferConfig); - } - - /* Configure rx transfer EDMA. */ - if (xfer->rxData != NULL) - { - xferConfig.srcAddr = FLEXIO_SPI_GetRxDataRegisterAddress(base, direction); - if (bytesPerFrame == 2U) - { - if (direction == kFLEXIO_SPI_LsbFirst) - { - xferConfig.srcAddr -= 1U; - } - } - else if (bytesPerFrame == 4U) - { - if (direction == kFLEXIO_SPI_LsbFirst) - { - xferConfig.srcAddr -= 3U; - } - } - else - { - } - xferConfig.srcOffset = 0; - xferConfig.destAddr = (uint32_t)(xfer->rxData); - xferConfig.destOffset = (int16_t)bytesPerFrame; - (void)EDMA_SubmitTransfer(handle->rxHandle, &xferConfig); - handle->rxInProgress = true; - FLEXIO_SPI_EnableDMA(base, (uint32_t)kFLEXIO_SPI_RxDmaEnable, true); - EDMA_StartTransfer(handle->rxHandle); - } - - /* Always start tx transfer. */ - if (handle->txHandle != NULL) - { - handle->txInProgress = true; - FLEXIO_SPI_EnableDMA(base, (uint32_t)kFLEXIO_SPI_TxDmaEnable, true); - EDMA_StartTransfer(handle->txHandle); - } - - return kStatus_Success; -} - -/*! - * brief Initializes the FlexIO SPI master eDMA handle. - * - * This function initializes the FlexIO SPI master eDMA handle which can be used for other FlexIO SPI master - * transactional - * APIs. - * For a specified FlexIO SPI instance, call this API once to get the initialized handle. - * - * param base Pointer to FLEXIO_SPI_Type structure. - * param handle Pointer to flexio_spi_master_edma_handle_t structure to store the transfer state. - * param callback SPI callback, NULL means no callback. - * param userData callback function parameter. - * param txHandle User requested eDMA handle for FlexIO SPI RX eDMA transfer. - * param rxHandle User requested eDMA handle for FlexIO SPI TX eDMA transfer. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO SPI eDMA type/handle table out of range. - */ -status_t FLEXIO_SPI_MasterTransferCreateHandleEDMA(FLEXIO_SPI_Type *base, - flexio_spi_master_edma_handle_t *handle, - flexio_spi_master_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *txHandle, - edma_handle_t *rxHandle) -{ - assert(handle != NULL); - - uint8_t index = 0; - - /* Find the an empty handle pointer to store the handle. */ - for (index = 0U; index < (uint8_t)FLEXIO_SPI_HANDLE_COUNT; index++) - { - if (s_edmaPrivateHandle[index].base == NULL) - { - s_edmaPrivateHandle[index].base = base; - s_edmaPrivateHandle[index].handle = handle; - break; - } - } - - if (index == (uint16_t)FLEXIO_SPI_HANDLE_COUNT) - { - return kStatus_OutOfRange; - } - - /* Set spi base to handle. */ - handle->txHandle = txHandle; - handle->rxHandle = rxHandle; - - /* Register callback and userData. */ - handle->callback = callback; - handle->userData = userData; - - /* Set SPI state to idle. */ - handle->txInProgress = false; - handle->rxInProgress = false; - - /* Install callback for Tx/Rx dma channel. */ - if (handle->txHandle != NULL) - { - EDMA_SetCallback(handle->txHandle, FLEXIO_SPI_TxEDMACallback, &s_edmaPrivateHandle[index]); - } - if (handle->rxHandle != NULL) - { - EDMA_SetCallback(handle->rxHandle, FLEXIO_SPI_RxEDMACallback, &s_edmaPrivateHandle[index]); - } - - return kStatus_Success; -} - -/*! - * brief Performs a non-blocking FlexIO SPI transfer using eDMA. - * - * note This interface returns immediately after transfer initiates. Call - * FLEXIO_SPI_MasterGetTransferCountEDMA to poll the transfer status and check - * whether the FlexIO SPI transfer is finished. - * - * param base Pointer to FLEXIO_SPI_Type structure. - * param handle Pointer to flexio_spi_master_edma_handle_t structure to store the transfer state. - * param xfer Pointer to FlexIO SPI transfer structure. - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_InvalidArgument Input argument is invalid. - * retval kStatus_FLEXIO_SPI_Busy FlexIO SPI is not idle, is running another transfer. - */ -status_t FLEXIO_SPI_MasterTransferEDMA(FLEXIO_SPI_Type *base, - flexio_spi_master_edma_handle_t *handle, - flexio_spi_transfer_t *xfer) -{ - assert(handle != NULL); - assert(xfer != NULL); - - uint32_t dataMode = 0; - uint16_t timerCmp = (uint16_t)base->flexioBase->TIMCMP[base->timerIndex[0]]; - uint8_t dataFormat = FLEXIO_SPI_XFER_DATA_FORMAT(xfer->flags); - - timerCmp &= 0x00FFU; - - /* Check if the device is busy. */ - if ((handle->txInProgress) || (handle->rxInProgress)) - { - return kStatus_FLEXIO_SPI_Busy; - } - - /* Check if input parameter invalid. */ - if (((xfer->txData == NULL) && (xfer->rxData == NULL)) || (xfer->dataSize == 0U)) - { - return kStatus_InvalidArgument; - } - - /* Timer1 controls the CS signal which enables/disables(asserts/deasserts) when timer0 enable/disable. Timer0 - enables when tx shifter is written and disables when timer compare. The timer compare event causes the - transmit shift registers to load which generates a tx register empty event. Since when timer stop bit is - disabled, a timer enable condition can be detected in the same cycle as a timer disable condition, so if - software writes the tx register upon the detection of tx register empty event, the timer enable condition - is triggered again, then the CS signal can remain low until software no longer writes the tx register. */ - if ((xfer->flags & (uint8_t)kFLEXIO_SPI_csContinuous) != 0U) - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TSTOP_MASK) | - FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitDisabled); - } - else - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TSTOP_MASK) | - FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitEnableOnTimerDisable); - } - - /* configure data mode. */ - if ((dataFormat == (uint8_t)kFLEXIO_SPI_8bitMsb) || (dataFormat == (uint8_t)kFLEXIO_SPI_8bitLsb)) - { - dataMode = (8UL * 2UL - 1UL) << 8U; - } - else if ((dataFormat == (uint8_t)kFLEXIO_SPI_16bitMsb) || (dataFormat == (uint8_t)kFLEXIO_SPI_16bitLsb)) - { - dataMode = (16UL * 2UL - 1UL) << 8U; - } - else if ((dataFormat == (uint8_t)kFLEXIO_SPI_32bitMsb) || (dataFormat == (uint8_t)kFLEXIO_SPI_32bitLsb)) - { - dataMode = (32UL * 2UL - 1UL) << 8U; - } - else - { - dataMode = (8UL * 2UL - 1UL) << 8U; - } - - dataMode |= timerCmp; - - base->flexioBase->TIMCMP[base->timerIndex[0]] = dataMode; - - return FLEXIO_SPI_EDMAConfig(base, handle, xfer); -} - -/*! - * brief Gets the remaining bytes for FlexIO SPI eDMA transfer. - * - * param base Pointer to FLEXIO_SPI_Type structure. - * param handle FlexIO SPI eDMA handle pointer. - * param count Number of bytes transferred so far by the non-blocking transaction. - */ -status_t FLEXIO_SPI_MasterTransferGetCountEDMA(FLEXIO_SPI_Type *base, - flexio_spi_master_edma_handle_t *handle, - size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - if (handle->rxInProgress) - { - *count = - (handle->transferSize - (uint32_t)handle->nbytes * EDMA_GetRemainingMajorLoopCount( - handle->rxHandle->base, handle->rxHandle->channel)); - } - else - { - *count = - (handle->transferSize - (uint32_t)handle->nbytes * EDMA_GetRemainingMajorLoopCount( - handle->txHandle->base, handle->txHandle->channel)); - } - - return kStatus_Success; -} - -/*! - * brief Aborts a FlexIO SPI transfer using eDMA. - * - * param base Pointer to FLEXIO_SPI_Type structure. - * param handle FlexIO SPI eDMA handle pointer. - */ -void FLEXIO_SPI_MasterTransferAbortEDMA(FLEXIO_SPI_Type *base, flexio_spi_master_edma_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable dma. */ - EDMA_AbortTransfer(handle->txHandle); - EDMA_AbortTransfer(handle->rxHandle); - - /* Disable DMA enable bit. */ - FLEXIO_SPI_EnableDMA(base, (uint32_t)kFLEXIO_SPI_DmaAllEnable, false); - - /* Set the handle state. */ - handle->txInProgress = false; - handle->rxInProgress = false; -} - -/*! - * brief Performs a non-blocking FlexIO SPI transfer using eDMA. - * - * note This interface returns immediately after transfer initiates. Call - * FLEXIO_SPI_SlaveGetTransferCountEDMA to poll the transfer status and - * check whether the FlexIO SPI transfer is finished. - * - * param base Pointer to FLEXIO_SPI_Type structure. - * param handle Pointer to flexio_spi_slave_edma_handle_t structure to store the transfer state. - * param xfer Pointer to FlexIO SPI transfer structure. - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_InvalidArgument Input argument is invalid. - * retval kStatus_FLEXIO_SPI_Busy FlexIO SPI is not idle, is running another transfer. - */ -status_t FLEXIO_SPI_SlaveTransferEDMA(FLEXIO_SPI_Type *base, - flexio_spi_slave_edma_handle_t *handle, - flexio_spi_transfer_t *xfer) -{ - assert(handle != NULL); - assert(xfer != NULL); - - uint32_t dataMode = 0U; - uint8_t dataFormat = FLEXIO_SPI_XFER_DATA_FORMAT(xfer->flags); - - /* Check if the device is busy. */ - if ((handle->txInProgress) || (handle->rxInProgress)) - { - return kStatus_FLEXIO_SPI_Busy; - } - - /* SCK timer use CS pin as inverted trigger so timer should be disbaled on trigger falling edge(CS re-asserts). */ - /* However if CPHA is first edge mode, timer will restart each time right after timer compare event occur and - before CS pin re-asserts, which triggers another shifter load. To avoid this, when in CS dis-continuous mode, - timer should disable in timer compare rather than trigger falling edge(CS re-asserts), and in CS continuous mode, - tx/rx shifters should be flushed after transfer finishes and before next transfer starts. */ - FLEXIO_SPI_FlushShifters(base); - if ((xfer->flags & (uint8_t)kFLEXIO_SPI_csContinuous) != 0U) - { - base->flexioBase->TIMCFG[base->timerIndex[0]] |= FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTriggerFallingEdge); - } - else - { - if ((base->flexioBase->SHIFTCTL[base->shifterIndex[0]] & FLEXIO_SHIFTCTL_TIMPOL_MASK) == - FLEXIO_SHIFTCTL_TIMPOL(kFLEXIO_ShifterTimerPolarityOnNegitive)) - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TIMDIS_MASK) | - FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTimerCompare); - } - else - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TIMDIS_MASK) | - FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTriggerFallingEdge); - } - } - - /* Check if input parameter invalid. */ - if (((xfer->txData == NULL) && (xfer->rxData == NULL)) || (xfer->dataSize == 0U)) - { - return kStatus_InvalidArgument; - } - - /* configure data mode. */ - if ((dataFormat == (uint8_t)kFLEXIO_SPI_8bitMsb) || (dataFormat == (uint8_t)kFLEXIO_SPI_8bitLsb)) - { - dataMode = 8U * 2U - 1U; - } - else if ((dataFormat == (uint8_t)kFLEXIO_SPI_16bitMsb) || (dataFormat == (uint8_t)kFLEXIO_SPI_16bitLsb)) - { - dataMode = 16U * 2U - 1U; - } - else if ((dataFormat == (uint8_t)kFLEXIO_SPI_32bitMsb) || (dataFormat == (uint8_t)kFLEXIO_SPI_32bitLsb)) - { - dataMode = 32UL * 2UL - 1UL; - } - else - { - dataMode = 8U * 2U - 1U; - } - - base->flexioBase->TIMCMP[base->timerIndex[0]] = dataMode; - - return FLEXIO_SPI_EDMAConfig(base, handle, xfer); -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_spi_edma.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_spi_edma.h deleted file mode 100644 index 7e98f199105..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_spi_edma.h +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020, 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_FLEXIO_SPI_EDMA_H_ -#define FSL_FLEXIO_SPI_EDMA_H_ - -#include "fsl_flexio_spi.h" -#include "fsl_edma.h" - -/*! - * @addtogroup flexio_edma_spi - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief FlexIO SPI EDMA driver version. */ -#define FSL_FLEXIO_SPI_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 3, 0)) -/*! @} */ - -/*! @brief typedef for flexio_spi_master_edma_handle_t in advance. */ -typedef struct _flexio_spi_master_edma_handle flexio_spi_master_edma_handle_t; - -/*! @brief Slave handle is the same with master handle. */ -typedef flexio_spi_master_edma_handle_t flexio_spi_slave_edma_handle_t; - -/*! @brief FlexIO SPI master callback for finished transmit */ -typedef void (*flexio_spi_master_edma_transfer_callback_t)(FLEXIO_SPI_Type *base, - flexio_spi_master_edma_handle_t *handle, - status_t status, - void *userData); - -/*! @brief FlexIO SPI slave callback for finished transmit */ -typedef void (*flexio_spi_slave_edma_transfer_callback_t)(FLEXIO_SPI_Type *base, - flexio_spi_slave_edma_handle_t *handle, - status_t status, - void *userData); - -/*! @brief FlexIO SPI eDMA transfer handle, users should not touch the content of the handle.*/ -struct _flexio_spi_master_edma_handle -{ - size_t transferSize; /*!< Total bytes to be transferred. */ - uint8_t nbytes; /*!< eDMA minor byte transfer count initially configured. */ - bool txInProgress; /*!< Send transfer in progress */ - bool rxInProgress; /*!< Receive transfer in progress */ - edma_handle_t *txHandle; /*!< DMA handler for SPI send */ - edma_handle_t *rxHandle; /*!< DMA handler for SPI receive */ - flexio_spi_master_edma_transfer_callback_t callback; /*!< Callback for SPI DMA transfer */ - void *userData; /*!< User Data for SPI DMA callback */ -}; - -/******************************************************************************* - * APIs - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name eDMA Transactional - * @{ - */ - -/*! - * @brief Initializes the FlexIO SPI master eDMA handle. - * - * This function initializes the FlexIO SPI master eDMA handle which can be used for other FlexIO SPI master - * transactional - * APIs. - * For a specified FlexIO SPI instance, call this API once to get the initialized handle. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle Pointer to flexio_spi_master_edma_handle_t structure to store the transfer state. - * @param callback SPI callback, NULL means no callback. - * @param userData callback function parameter. - * @param txHandle User requested eDMA handle for FlexIO SPI RX eDMA transfer. - * @param rxHandle User requested eDMA handle for FlexIO SPI TX eDMA transfer. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO SPI eDMA type/handle table out of range. - */ -status_t FLEXIO_SPI_MasterTransferCreateHandleEDMA(FLEXIO_SPI_Type *base, - flexio_spi_master_edma_handle_t *handle, - flexio_spi_master_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *txHandle, - edma_handle_t *rxHandle); - -/*! - * @brief Performs a non-blocking FlexIO SPI transfer using eDMA. - * - * @note This interface returns immediately after transfer initiates. Call - * FLEXIO_SPI_MasterGetTransferCountEDMA to poll the transfer status and check - * whether the FlexIO SPI transfer is finished. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle Pointer to flexio_spi_master_edma_handle_t structure to store the transfer state. - * @param xfer Pointer to FlexIO SPI transfer structure. - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_InvalidArgument Input argument is invalid. - * @retval kStatus_FLEXIO_SPI_Busy FlexIO SPI is not idle, is running another transfer. - */ -status_t FLEXIO_SPI_MasterTransferEDMA(FLEXIO_SPI_Type *base, - flexio_spi_master_edma_handle_t *handle, - flexio_spi_transfer_t *xfer); - -/*! - * @brief Aborts a FlexIO SPI transfer using eDMA. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle FlexIO SPI eDMA handle pointer. - */ -void FLEXIO_SPI_MasterTransferAbortEDMA(FLEXIO_SPI_Type *base, flexio_spi_master_edma_handle_t *handle); - -/*! - * @brief Gets the number of bytes transferred so far using FlexIO SPI master eDMA. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle FlexIO SPI eDMA handle pointer. - * @param count Number of bytes transferred so far by the non-blocking transaction. - */ -status_t FLEXIO_SPI_MasterTransferGetCountEDMA(FLEXIO_SPI_Type *base, - flexio_spi_master_edma_handle_t *handle, - size_t *count); - -/*! - * @brief Initializes the FlexIO SPI slave eDMA handle. - * - * This function initializes the FlexIO SPI slave eDMA handle. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle Pointer to flexio_spi_slave_edma_handle_t structure to store the transfer state. - * @param callback SPI callback, NULL means no callback. - * @param userData callback function parameter. - * @param txHandle User requested eDMA handle for FlexIO SPI TX eDMA transfer. - * @param rxHandle User requested eDMA handle for FlexIO SPI RX eDMA transfer. - */ -static inline void FLEXIO_SPI_SlaveTransferCreateHandleEDMA(FLEXIO_SPI_Type *base, - flexio_spi_slave_edma_handle_t *handle, - flexio_spi_slave_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *txHandle, - edma_handle_t *rxHandle) -{ - (void)FLEXIO_SPI_MasterTransferCreateHandleEDMA(base, handle, callback, userData, txHandle, rxHandle); -} - -/*! - * @brief Performs a non-blocking FlexIO SPI transfer using eDMA. - * - * @note This interface returns immediately after transfer initiates. Call - * FLEXIO_SPI_SlaveGetTransferCountEDMA to poll the transfer status and - * check whether the FlexIO SPI transfer is finished. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle Pointer to flexio_spi_slave_edma_handle_t structure to store the transfer state. - * @param xfer Pointer to FlexIO SPI transfer structure. - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_InvalidArgument Input argument is invalid. - * @retval kStatus_FLEXIO_SPI_Busy FlexIO SPI is not idle, is running another transfer. - */ -status_t FLEXIO_SPI_SlaveTransferEDMA(FLEXIO_SPI_Type *base, - flexio_spi_slave_edma_handle_t *handle, - flexio_spi_transfer_t *xfer); - -/*! - * @brief Aborts a FlexIO SPI transfer using eDMA. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle Pointer to flexio_spi_slave_edma_handle_t structure to store the transfer state. - */ -static inline void FLEXIO_SPI_SlaveTransferAbortEDMA(FLEXIO_SPI_Type *base, flexio_spi_slave_edma_handle_t *handle) -{ - FLEXIO_SPI_MasterTransferAbortEDMA(base, handle); -} - -/*! - * @brief Gets the number of bytes transferred so far using FlexIO SPI slave eDMA. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle FlexIO SPI eDMA handle pointer. - * @param count Number of bytes transferred so far by the non-blocking transaction. - */ -static inline status_t FLEXIO_SPI_SlaveTransferGetCountEDMA(FLEXIO_SPI_Type *base, - flexio_spi_slave_edma_handle_t *handle, - size_t *count) -{ - return FLEXIO_SPI_MasterTransferGetCountEDMA(base, handle, count); -} - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ -#endif diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_uart.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_uart.c deleted file mode 100644 index 13890caee7d..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_uart.c +++ /dev/null @@ -1,1023 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio_uart.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio_uart" -#endif - -/*flexioBase); -} - -static size_t FLEXIO_UART_TransferGetRxRingBufferLength(flexio_uart_handle_t *handle) -{ - size_t size; - uint16_t rxRingBufferHead = handle->rxRingBufferHead; - uint16_t rxRingBufferTail = handle->rxRingBufferTail; - - if (rxRingBufferTail > rxRingBufferHead) - { - size = (size_t)rxRingBufferHead + handle->rxRingBufferSize - (size_t)rxRingBufferTail; - } - else - { - size = (size_t)rxRingBufferHead - (size_t)rxRingBufferTail; - } - - return size; -} - -static bool FLEXIO_UART_TransferIsRxRingBufferFull(flexio_uart_handle_t *handle) -{ - bool full; - - if (FLEXIO_UART_TransferGetRxRingBufferLength(handle) == (handle->rxRingBufferSize - 1U)) - { - full = true; - } - else - { - full = false; - } - - return full; -} - -/*! - * brief Ungates the FlexIO clock, resets the FlexIO module, configures FlexIO UART - * hardware, and configures the FlexIO UART with FlexIO UART configuration. - * The configuration structure can be filled by the user or be set with - * default values by FLEXIO_UART_GetDefaultConfig(). - * - * Example - code - FLEXIO_UART_Type base = { - .flexioBase = FLEXIO, - .TxPinIndex = 0, - .RxPinIndex = 1, - .shifterIndex = {0,1}, - .timerIndex = {0,1} - }; - flexio_uart_config_t config = { - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .baudRate_Bps = 115200U, - .bitCountPerChar = 8 - }; - FLEXIO_UART_Init(base, &config, srcClock_Hz); - endcode - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param userConfig Pointer to the flexio_uart_config_t structure. - * param srcClock_Hz FlexIO source clock in Hz. - * retval kStatus_Success Configuration success. - * retval kStatus_FLEXIO_UART_BaudrateNotSupport Baudrate is not supported for current clock source frequency. -*/ -status_t FLEXIO_UART_Init(FLEXIO_UART_Type *base, const flexio_uart_config_t *userConfig, uint32_t srcClock_Hz) -{ - assert((base != NULL) && (userConfig != NULL)); - - flexio_shifter_config_t shifterConfig; - flexio_timer_config_t timerConfig; - uint32_t ctrlReg = 0; - uint16_t timerDiv = 0; - uint16_t timerCmp = 0; - uint32_t calculatedBaud; - uint32_t diff; - status_t result = kStatus_Success; - - /* Clear the shifterConfig & timerConfig struct. */ - (void)memset(&shifterConfig, 0, sizeof(shifterConfig)); - (void)memset(&timerConfig, 0, sizeof(timerConfig)); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate flexio clock. */ - CLOCK_EnableClock(s_flexioClocks[FLEXIO_UART_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Configure FLEXIO UART */ - ctrlReg = base->flexioBase->CTRL; - ctrlReg &= ~(FLEXIO_CTRL_DOZEN_MASK | FLEXIO_CTRL_DBGE_MASK | FLEXIO_CTRL_FASTACC_MASK | FLEXIO_CTRL_FLEXEN_MASK); - ctrlReg |= (FLEXIO_CTRL_DBGE(userConfig->enableInDebug) | FLEXIO_CTRL_FASTACC(userConfig->enableFastAccess) | - FLEXIO_CTRL_FLEXEN(userConfig->enableUart)); - if (!userConfig->enableInDoze) - { - ctrlReg |= FLEXIO_CTRL_DOZEN_MASK; - } - - base->flexioBase->CTRL = ctrlReg; - - /* Do hardware configuration. */ - /* 1. Configure the shifter 0 for tx. */ - shifterConfig.timerSelect = base->timerIndex[0]; - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive; - shifterConfig.pinConfig = kFLEXIO_PinConfigOutput; - shifterConfig.pinSelect = base->TxPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveHigh; - shifterConfig.shifterMode = kFLEXIO_ShifterModeTransmit; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitHigh; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitLow; - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[0], &shifterConfig); - - /*2. Configure the timer 0 for tx. */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->shifterIndex[0]); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - timerConfig.pinSelect = base->TxPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveHigh; - timerConfig.timerMode = kFLEXIO_TimerModeDual8BitBaudBit; - timerConfig.timerOutput = kFLEXIO_TimerOutputOneNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput; - timerConfig.timerReset = kFLEXIO_TimerResetNever; - timerConfig.timerDisable = kFLEXIO_TimerDisableOnTimerCompare; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnTriggerHigh; - timerConfig.timerStop = kFLEXIO_TimerStopBitEnableOnTimerDisable; - timerConfig.timerStart = kFLEXIO_TimerStartBitEnabled; - - timerDiv = (uint16_t)(srcClock_Hz / userConfig->baudRate_Bps); - timerDiv = timerDiv / 2U - 1U; - - if (timerDiv > 0xFFU) - { - /* Check whether the calculated timerDiv is within allowed range. */ - return kStatus_FLEXIO_UART_BaudrateNotSupport; - } - else - { - /* Check to see if actual baud rate is within 3% of desired baud rate - * based on the best calculated timerDiv value */ - calculatedBaud = srcClock_Hz / (((uint32_t)timerDiv + 1U) * 2U); - /* timerDiv cannot be larger than the ideal divider, so calculatedBaud is definitely larger - than configured baud */ - diff = calculatedBaud - userConfig->baudRate_Bps; - if (diff > ((userConfig->baudRate_Bps / 100U) * 3U)) - { - return kStatus_FLEXIO_UART_BaudrateNotSupport; - } - } - - timerCmp = ((uint16_t)userConfig->bitCountPerChar * 2U - 1U) << 8U; - timerCmp |= timerDiv; - - timerConfig.timerCompare = timerCmp; - - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[0], &timerConfig); - - /* 3. Configure the shifter 1 for rx. */ - shifterConfig.timerSelect = base->timerIndex[1]; - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnNegitive; - shifterConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - shifterConfig.pinSelect = base->RxPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveHigh; - shifterConfig.shifterMode = kFLEXIO_ShifterModeReceive; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitHigh; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitLow; - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[1], &shifterConfig); - - /* 4. Configure the timer 1 for rx. */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_PININPUT(base->RxPinIndex); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveHigh; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceExternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - timerConfig.pinSelect = base->RxPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveLow; - timerConfig.timerMode = kFLEXIO_TimerModeDual8BitBaudBit; - timerConfig.timerOutput = kFLEXIO_TimerOutputOneAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput; - timerConfig.timerReset = kFLEXIO_TimerResetOnTimerPinRisingEdge; - timerConfig.timerDisable = kFLEXIO_TimerDisableOnTimerCompare; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnPinRisingEdge; - timerConfig.timerStop = kFLEXIO_TimerStopBitEnableOnTimerDisable; - timerConfig.timerStart = kFLEXIO_TimerStartBitEnabled; - - timerConfig.timerCompare = timerCmp; - - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[1], &timerConfig); - - return result; -} - -/*! - * brief Resets the FlexIO UART shifter and timer config. - * - * note After calling this API, call the FLEXO_UART_Init to use the FlexIO UART module. - * - * param base Pointer to FLEXIO_UART_Type structure - */ -void FLEXIO_UART_Deinit(FLEXIO_UART_Type *base) -{ - base->flexioBase->SHIFTCFG[base->shifterIndex[0]] = 0; - base->flexioBase->SHIFTCTL[base->shifterIndex[0]] = 0; - base->flexioBase->SHIFTCFG[base->shifterIndex[1]] = 0; - base->flexioBase->SHIFTCTL[base->shifterIndex[1]] = 0; - base->flexioBase->TIMCFG[base->timerIndex[0]] = 0; - base->flexioBase->TIMCMP[base->timerIndex[0]] = 0; - base->flexioBase->TIMCTL[base->timerIndex[0]] = 0; - base->flexioBase->TIMCFG[base->timerIndex[1]] = 0; - base->flexioBase->TIMCMP[base->timerIndex[1]] = 0; - base->flexioBase->TIMCTL[base->timerIndex[1]] = 0; - /* Clear the shifter flag. */ - base->flexioBase->SHIFTSTAT = (1UL << base->shifterIndex[0]); - base->flexioBase->SHIFTSTAT = (1UL << base->shifterIndex[1]); - /* Clear the timer flag. */ - base->flexioBase->TIMSTAT = (1UL << base->timerIndex[0]); - base->flexioBase->TIMSTAT = (1UL << base->timerIndex[1]); -} - -/*! - * brief Gets the default configuration to configure the FlexIO UART. The configuration - * can be used directly for calling the FLEXIO_UART_Init(). - * Example: - code - flexio_uart_config_t config; - FLEXIO_UART_GetDefaultConfig(&userConfig); - endcode - * param userConfig Pointer to the flexio_uart_config_t structure. -*/ -void FLEXIO_UART_GetDefaultConfig(flexio_uart_config_t *userConfig) -{ - assert(userConfig != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(userConfig, 0, sizeof(*userConfig)); - - userConfig->enableUart = true; - userConfig->enableInDoze = false; - userConfig->enableInDebug = true; - userConfig->enableFastAccess = false; - /* Default baud rate 115200. */ - userConfig->baudRate_Bps = 115200U; - /* Default bit count at 8. */ - userConfig->bitCountPerChar = kFLEXIO_UART_8BitsPerChar; -} - -/*! - * brief Enables the FlexIO UART interrupt. - * - * This function enables the FlexIO UART interrupt. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param mask Interrupt source. - */ -void FLEXIO_UART_EnableInterrupts(FLEXIO_UART_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_UART_TxDataRegEmptyInterruptEnable) != 0U) - { - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable) != 0U) - { - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Disables the FlexIO UART interrupt. - * - * This function disables the FlexIO UART interrupt. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param mask Interrupt source. - */ -void FLEXIO_UART_DisableInterrupts(FLEXIO_UART_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_UART_TxDataRegEmptyInterruptEnable) != 0U) - { - FLEXIO_DisableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable) != 0U) - { - FLEXIO_DisableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Gets the FlexIO UART status flags. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * return FlexIO UART status flags. - */ - -uint32_t FLEXIO_UART_GetStatusFlags(FLEXIO_UART_Type *base) -{ - uint32_t status = 0U; - status = - ((FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0])) >> base->shifterIndex[0]); - status |= - (((FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[1])) >> (base->shifterIndex[1])) - << 1U); - status |= - (((FLEXIO_GetShifterErrorFlags(base->flexioBase) & (1UL << base->shifterIndex[1])) >> (base->shifterIndex[1])) - << 2U); - return status; -} - -/*! - * brief Gets the FlexIO UART status flags. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param mask Status flag. - * The parameter can be any combination of the following values: - * arg kFLEXIO_UART_TxDataRegEmptyFlag - * arg kFLEXIO_UART_RxEmptyFlag - * arg kFLEXIO_UART_RxOverRunFlag - */ - -void FLEXIO_UART_ClearStatusFlags(FLEXIO_UART_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_UART_TxDataRegEmptyFlag) != 0U) - { - FLEXIO_ClearShifterStatusFlags(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_UART_RxDataRegFullFlag) != 0U) - { - FLEXIO_ClearShifterStatusFlags(base->flexioBase, 1UL << base->shifterIndex[1]); - } - if ((mask & (uint32_t)kFLEXIO_UART_RxOverRunFlag) != 0U) - { - FLEXIO_ClearShifterErrorFlags(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Sends a buffer of data bytes. - * - * note This function blocks using the polling method until all bytes have been sent. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param txData The data bytes to send. - * param txSize The number of data bytes to send. - * retval kStatus_FLEXIO_UART_Timeout Transmission timed out and was aborted. - * retval kStatus_Success Successfully wrote all data. - */ -status_t FLEXIO_UART_WriteBlocking(FLEXIO_UART_Type *base, const uint8_t *txData, size_t txSize) -{ - assert(txData != NULL); - assert(txSize != 0U); -#if UART_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != txSize--) - { - /* Wait until data transfer complete. */ -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; - while ((0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) && - (0U != --waitTimes)) -#else - while (0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) -#endif - { - } -#if UART_RETRY_TIMES - if (0U == waitTimes) - { - return kStatus_FLEXIO_UART_Timeout; - } -#endif - - base->flexioBase->SHIFTBUF[base->shifterIndex[0]] = *txData++; - } - return kStatus_Success; -} - -/*! - * brief Receives a buffer of bytes. - * - * note This function blocks using the polling method until all bytes have been received. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param rxData The buffer to store the received bytes. - * param rxSize The number of data bytes to be received. - * retval kStatus_FLEXIO_UART_Timeout Transmission timed out and was aborted. - * retval kStatus_Success Successfully received all data. - */ -status_t FLEXIO_UART_ReadBlocking(FLEXIO_UART_Type *base, uint8_t *rxData, size_t rxSize) -{ - assert(rxData != NULL); - assert(rxSize != 0U); -#if UART_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != rxSize--) - { - /* Wait until data transfer complete. */ -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; - while ((0U == (FLEXIO_UART_GetStatusFlags(base) & (uint32_t)kFLEXIO_UART_RxDataRegFullFlag)) && - (0U != --waitTimes)) -#else - while (0U == (FLEXIO_UART_GetStatusFlags(base) & (uint32_t)kFLEXIO_UART_RxDataRegFullFlag)) -#endif - { - } -#if UART_RETRY_TIMES - if (0U == waitTimes) - { - return kStatus_FLEXIO_UART_Timeout; - } -#endif - - *rxData++ = (uint8_t)(base->flexioBase->SHIFTBUFBYS[base->shifterIndex[1]]); - } - return kStatus_Success; -} - -/*! - * brief Initializes the UART handle. - * - * This function initializes the FlexIO UART handle, which can be used for other FlexIO - * UART transactional APIs. Call this API once to get the - * initialized handle. - * - * The UART driver supports the "background" receiving, which means that users can set up - * a RX ring buffer optionally. Data received is stored into the ring buffer even when - * the user doesn't call the FLEXIO_UART_TransferReceiveNonBlocking() API. If there is already data - * received in the ring buffer, users can get the received data from the ring buffer - * directly. The ring buffer is disabled if passing NULL as p ringBuffer. - * - * param base to FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * param callback The callback function. - * param userData The parameter of the callback function. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_UART_TransferCreateHandle(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - flexio_uart_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - IRQn_Type flexio_irqs[] = FLEXIO_IRQS; - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Set the TX/RX state. */ - handle->rxState = (uint8_t)kFLEXIO_UART_RxIdle; - handle->txState = (uint8_t)kFLEXIO_UART_TxIdle; - - /* Set the callback and user data. */ - handle->callback = callback; - handle->userData = userData; - - /* Clear pending NVIC IRQ before enable NVIC IRQ. */ - NVIC_ClearPendingIRQ(flexio_irqs[FLEXIO_UART_GetInstance(base)]); - /* Enable interrupt in NVIC. */ - (void)EnableIRQ(flexio_irqs[FLEXIO_UART_GetInstance(base)]); - - /* Save the context in global variables to support the double weak mechanism. */ - return FLEXIO_RegisterHandleIRQ(base, handle, FLEXIO_UART_TransferHandleIRQ); -} - -/*! - * brief Sets up the RX ring buffer. - * - * This function sets up the RX ring buffer to a specific UART handle. - * - * When the RX ring buffer is used, data received is stored into the ring buffer even when - * the user doesn't call the UART_ReceiveNonBlocking() API. If there is already data received - * in the ring buffer, users can get the received data from the ring buffer directly. - * - * note When using the RX ring buffer, one byte is reserved for internal use. In other - * words, if p ringBufferSize is 32, only 31 bytes are used for saving data. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * param ringBuffer Start address of ring buffer for background receiving. Pass NULL to disable the ring buffer. - * param ringBufferSize Size of the ring buffer. - */ -void FLEXIO_UART_TransferStartRingBuffer(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - uint8_t *ringBuffer, - size_t ringBufferSize) -{ - assert(handle != NULL); - - /* Setup the ringbuffer address */ - if (ringBuffer != NULL) - { - handle->rxRingBuffer = ringBuffer; - handle->rxRingBufferSize = ringBufferSize; - handle->rxRingBufferHead = 0U; - handle->rxRingBufferTail = 0U; - - /* Enable the interrupt to accept the data when user need the ring buffer. */ - FLEXIO_UART_EnableInterrupts(base, (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable); - } -} - -/*! - * brief Aborts the background transfer and uninstalls the ring buffer. - * - * This function aborts the background transfer and uninstalls the ring buffer. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferStopRingBuffer(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle) -{ - assert(handle != NULL); - - if (handle->rxState == (uint8_t)kFLEXIO_UART_RxIdle) - { - FLEXIO_UART_DisableInterrupts(base, (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable); - } - - handle->rxRingBuffer = NULL; - handle->rxRingBufferSize = 0U; - handle->rxRingBufferHead = 0U; - handle->rxRingBufferTail = 0U; -} - -/*! - * brief Transmits a buffer of data using the interrupt method. - * - * This function sends data using an interrupt method. This is a non-blocking function, - * which returns directly without waiting for all data to be written to the TX register. When - * all data is written to the TX register in ISR, the FlexIO UART driver calls the callback - * function and passes the ref kStatus_FLEXIO_UART_TxIdle as status parameter. - * - * note The kStatus_FLEXIO_UART_TxIdle is passed to the upper layer when all data is written - * to the TX register. However, it does not ensure that all data is sent out. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * param xfer FlexIO UART transfer structure. See #flexio_uart_transfer_t. - * retval kStatus_Success Successfully starts the data transmission. - * retval kStatus_UART_TxBusy Previous transmission still not finished, data not written to the TX register. - */ -status_t FLEXIO_UART_TransferSendNonBlocking(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - flexio_uart_transfer_t *xfer) -{ - status_t status; - - /* Return error if xfer invalid. */ - if ((0U == xfer->dataSize) || (NULL == xfer->txData)) - { - return kStatus_InvalidArgument; - } - - /* Return error if current TX busy. */ - if ((uint8_t)kFLEXIO_UART_TxBusy == handle->txState) - { - status = kStatus_FLEXIO_UART_TxBusy; - } - else - { - handle->txData = xfer->txData; - handle->txDataSize = xfer->dataSize; - handle->txDataSizeAll = xfer->dataSize; - handle->txState = (uint8_t)kFLEXIO_UART_TxBusy; - - /* Enable transmiter interrupt. */ - FLEXIO_UART_EnableInterrupts(base, (uint32_t)kFLEXIO_UART_TxDataRegEmptyInterruptEnable); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Aborts the interrupt-driven data transmit. - * - * This function aborts the interrupt-driven data sending. Get the remainBytes to find out - * how many bytes are still not sent out. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferAbortSend(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle) -{ - /* Disable the transmitter and disable the interrupt. */ - FLEXIO_UART_DisableInterrupts(base, (uint32_t)kFLEXIO_UART_TxDataRegEmptyInterruptEnable); - - handle->txDataSize = 0U; - handle->txState = (uint8_t)kFLEXIO_UART_TxIdle; -} - -/*! - * brief Gets the number of bytes sent. - * - * This function gets the number of bytes sent driven by interrupt. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * param count Number of bytes sent so far by the non-blocking transaction. - * retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetSendCount(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - assert(count != NULL); - - if ((uint8_t)kFLEXIO_UART_TxIdle == handle->txState) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->txDataSizeAll - handle->txDataSize; - - return kStatus_Success; -} - -/*! - * brief Receives a buffer of data using the interrupt method. - * - * This function receives data using the interrupt method. This is a non-blocking function, - * which returns without waiting for all data to be received. - * If the RX ring buffer is used and not empty, the data in ring buffer is copied and - * the parameter p receivedBytes shows how many bytes are copied from the ring buffer. - * After copying, if the data in ring buffer is not enough to read, the receive - * request is saved by the UART driver. When new data arrives, the receive request - * is serviced first. When all data is received, the UART driver notifies the upper layer - * through a callback function and passes the status parameter ref kStatus_UART_RxIdle. - * For example, if the upper layer needs 10 bytes but there are only 5 bytes in the ring buffer, - * the 5 bytes are copied to xfer->data. This function returns with the - * parameter p receivedBytes set to 5. For the last 5 bytes, newly arrived data is - * saved from the xfer->data[5]. When 5 bytes are received, the UART driver notifies upper layer. - * If the RX ring buffer is not enabled, this function enables the RX and RX interrupt - * to receive data to xfer->data. When all data is received, the upper layer is notified. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * param xfer UART transfer structure. See #flexio_uart_transfer_t. - * param receivedBytes Bytes received from the ring buffer directly. - * retval kStatus_Success Successfully queue the transfer into the transmit queue. - * retval kStatus_FLEXIO_UART_RxBusy Previous receive request is not finished. - */ -status_t FLEXIO_UART_TransferReceiveNonBlocking(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - flexio_uart_transfer_t *xfer, - size_t *receivedBytes) -{ - uint32_t i; - status_t status; - /* How many bytes to copy from ring buffer to user memory. */ - size_t bytesToCopy = 0U; - /* How many bytes to receive. */ - size_t bytesToReceive; - /* How many bytes currently have received. */ - size_t bytesCurrentReceived; - - /* Return error if xfer invalid. */ - if ((0U == xfer->dataSize) || (NULL == xfer->rxData)) - { - return kStatus_InvalidArgument; - } - - /* How to get data: - 1. If RX ring buffer is not enabled, then save xfer->data and xfer->dataSize - to uart handle, enable interrupt to store received data to xfer->data. When - all data received, trigger callback. - 2. If RX ring buffer is enabled and not empty, get data from ring buffer first. - If there are enough data in ring buffer, copy them to xfer->data and return. - If there are not enough data in ring buffer, copy all of them to xfer->data, - save the xfer->data remained empty space to uart handle, receive data - to this empty space and trigger callback when finished. */ - - if ((uint8_t)kFLEXIO_UART_RxBusy == handle->rxState) - { - status = kStatus_FLEXIO_UART_RxBusy; - } - else - { - bytesToReceive = xfer->dataSize; - bytesCurrentReceived = 0U; - - /* If RX ring buffer is used. */ - if (handle->rxRingBuffer != NULL) - { - /* Disable FLEXIO_UART RX IRQ, protect ring buffer. */ - FLEXIO_UART_DisableInterrupts(base, (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable); - - /* How many bytes in RX ring buffer currently. */ - bytesToCopy = FLEXIO_UART_TransferGetRxRingBufferLength(handle); - - if (bytesToCopy != 0U) - { - bytesToCopy = MIN(bytesToReceive, bytesToCopy); - - bytesToReceive -= bytesToCopy; - - /* Copy data from ring buffer to user memory. */ - for (i = 0U; i < bytesToCopy; i++) - { - xfer->rxData[bytesCurrentReceived++] = handle->rxRingBuffer[handle->rxRingBufferTail]; - - /* Wrap to 0. Not use modulo (%) because it might be large and slow. */ - if ((uint32_t)handle->rxRingBufferTail + 1U == handle->rxRingBufferSize) - { - handle->rxRingBufferTail = 0U; - } - else - { - handle->rxRingBufferTail++; - } - } - } - - /* If ring buffer does not have enough data, still need to read more data. */ - if (bytesToReceive != 0U) - { - /* No data in ring buffer, save the request to UART handle. */ - handle->rxData = xfer->rxData + bytesCurrentReceived; - handle->rxDataSize = bytesToReceive; - handle->rxDataSizeAll = xfer->dataSize; - handle->rxState = (uint8_t)kFLEXIO_UART_RxBusy; - } - - /* Enable FLEXIO_UART RX IRQ if previously enabled. */ - FLEXIO_UART_EnableInterrupts(base, (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable); - - /* Call user callback since all data are received. */ - if (0U == bytesToReceive) - { - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_FLEXIO_UART_RxIdle, handle->userData); - } - } - } - /* Ring buffer not used. */ - else - { - handle->rxData = xfer->rxData + bytesCurrentReceived; - handle->rxDataSize = bytesToReceive; - handle->rxDataSizeAll = bytesToReceive; - handle->rxState = (uint8_t)kFLEXIO_UART_RxBusy; - - /* Enable RX interrupt. */ - FLEXIO_UART_EnableInterrupts(base, (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable); - } - - /* Return the how many bytes have read. */ - if (receivedBytes != NULL) - { - *receivedBytes = bytesCurrentReceived; - } - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Aborts the receive data which was using IRQ. - * - * This function aborts the receive data which was using IRQ. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferAbortReceive(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle) -{ - /* Only abort the receive to handle->rxData, the RX ring buffer is still working. */ - if (NULL == handle->rxRingBuffer) - { - /* Disable RX interrupt. */ - FLEXIO_UART_DisableInterrupts(base, (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable); - } - - handle->rxDataSize = 0U; - handle->rxState = (uint8_t)kFLEXIO_UART_RxIdle; -} - -/*! - * brief Gets the number of bytes received. - * - * This function gets the number of bytes received driven by interrupt. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * param count Number of bytes received so far by the non-blocking transaction. - * retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetReceiveCount(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - assert(count != NULL); - - if ((uint8_t)kFLEXIO_UART_RxIdle == handle->rxState) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->rxDataSizeAll - handle->rxDataSize; - - return kStatus_Success; -} - -/*! - * brief FlexIO UART IRQ handler function. - * - * This function processes the FlexIO UART transmit and receives the IRQ request. - * - * param uartType Pointer to the FLEXIO_UART_Type structure. - * param uartHandle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferHandleIRQ(void *uartType, void *uartHandle) -{ - uint8_t count = 1; - FLEXIO_UART_Type *base = (FLEXIO_UART_Type *)uartType; - flexio_uart_handle_t *handle = (flexio_uart_handle_t *)uartHandle; - uint16_t rxRingBufferHead; - - /* Read the status back. */ - uint32_t status = FLEXIO_UART_GetStatusFlags(base); - - /* If RX overrun. */ - if (((uint32_t)kFLEXIO_UART_RxOverRunFlag & status) != 0U) - { - /* Clear Overrun flag. */ - FLEXIO_UART_ClearStatusFlags(base, (uint32_t)kFLEXIO_UART_RxOverRunFlag); - - /* Trigger callback. */ - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_FLEXIO_UART_RxHardwareOverrun, handle->userData); - } - } - - /* Receive data register full */ - if ((((uint32_t)kFLEXIO_UART_RxDataRegFullFlag & status) != 0U) && - ((base->flexioBase->SHIFTSIEN & (1UL << base->shifterIndex[1])) != 0U)) - { - /* If handle->rxDataSize is not 0, first save data to handle->rxData. */ - if (handle->rxDataSize != 0U) - { - /* Using non block API to read the data from the registers. */ - FLEXIO_UART_ReadByte(base, handle->rxData); - handle->rxDataSize--; - handle->rxData++; - count--; - - /* If all the data required for upper layer is ready, trigger callback. */ - if (0U == handle->rxDataSize) - { - handle->rxState = (uint8_t)kFLEXIO_UART_RxIdle; - - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_FLEXIO_UART_RxIdle, handle->userData); - } - } - } - - if (handle->rxRingBuffer != NULL) - { - if (count != 0U) - { - /* If RX ring buffer is full, trigger callback to notify over run. */ - if (FLEXIO_UART_TransferIsRxRingBufferFull(handle)) - { - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_FLEXIO_UART_RxRingBufferOverrun, handle->userData); - } - } - - /* If ring buffer is still full after callback function, the oldest data is overridden. */ - if (FLEXIO_UART_TransferIsRxRingBufferFull(handle)) - { - /* Increase handle->rxRingBufferTail to make room for new data. */ - if ((uint32_t)handle->rxRingBufferTail + 1U == handle->rxRingBufferSize) - { - handle->rxRingBufferTail = 0U; - } - else - { - handle->rxRingBufferTail++; - } - } - - /* Read data. */ - rxRingBufferHead = handle->rxRingBufferHead; - handle->rxRingBuffer[rxRingBufferHead] = - (uint8_t)(base->flexioBase->SHIFTBUFBYS[base->shifterIndex[1]]); - - /* Increase handle->rxRingBufferHead. */ - if ((uint32_t)handle->rxRingBufferHead + 1U == handle->rxRingBufferSize) - { - handle->rxRingBufferHead = 0U; - } - else - { - handle->rxRingBufferHead++; - } - } - } - /* If no receive requst pending, stop RX interrupt. */ - else if (0U == handle->rxDataSize) - { - FLEXIO_UART_DisableInterrupts(base, (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable); - } - else - { - } - } - - /* Send data register empty and the interrupt is enabled. */ - if ((((uint32_t)kFLEXIO_UART_TxDataRegEmptyFlag & status) != 0U) && - ((base->flexioBase->SHIFTSIEN & (1UL << base->shifterIndex[0])) != 0U)) - { - if (handle->txDataSize != 0U) - { - /* Using non block API to write the data to the registers. */ - FLEXIO_UART_WriteByte(base, handle->txData); - handle->txData++; - handle->txDataSize--; - - /* If all the data are written to data register, TX finished. */ - if (0U == handle->txDataSize) - { - handle->txState = (uint8_t)kFLEXIO_UART_TxIdle; - - /* Disable TX register empty interrupt. */ - FLEXIO_UART_DisableInterrupts(base, (uint32_t)kFLEXIO_UART_TxDataRegEmptyInterruptEnable); - - /* Trigger callback. */ - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_FLEXIO_UART_TxIdle, handle->userData); - } - } - } - } -} - -/*! - * brief Flush tx/rx shifters. - * - * param base Pointer to the FLEXIO_UART_Type structure. - */ -void FLEXIO_UART_FlushShifters(FLEXIO_UART_Type *base) -{ - /* Disable then re-enable to flush the tx shifter. */ - base->flexioBase->SHIFTCTL[base->shifterIndex[0]] &= ~FLEXIO_SHIFTCTL_SMOD_MASK; - base->flexioBase->SHIFTCTL[base->shifterIndex[0]] |= FLEXIO_SHIFTCTL_SMOD(kFLEXIO_ShifterModeTransmit); - /* Read to flush the rx shifter. */ - (void)base->flexioBase->SHIFTBUF[base->shifterIndex[1]]; -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_uart.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_uart.h deleted file mode 100644 index d6f36bf3235..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_uart.h +++ /dev/null @@ -1,588 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_FLEXIO_UART_H_ -#define FSL_FLEXIO_UART_H_ - -#include "fsl_common.h" -#include "fsl_flexio.h" - -/*! - * @addtogroup flexio_uart - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief FlexIO UART driver version. */ -#define FSL_FLEXIO_UART_DRIVER_VERSION (MAKE_VERSION(2, 5, 0)) -/*! @} */ - -/*! @brief Retry times for waiting flag. */ -#ifndef UART_RETRY_TIMES -#define UART_RETRY_TIMES 0U /* Defining to zero means to keep waiting for the flag until it is assert/deassert. */ -#endif - -/*! @brief Error codes for the UART driver. */ -enum -{ - kStatus_FLEXIO_UART_TxBusy = MAKE_STATUS(kStatusGroup_FLEXIO_UART, 0), /*!< Transmitter is busy. */ - kStatus_FLEXIO_UART_RxBusy = MAKE_STATUS(kStatusGroup_FLEXIO_UART, 1), /*!< Receiver is busy. */ - kStatus_FLEXIO_UART_TxIdle = MAKE_STATUS(kStatusGroup_FLEXIO_UART, 2), /*!< UART transmitter is idle. */ - kStatus_FLEXIO_UART_RxIdle = MAKE_STATUS(kStatusGroup_FLEXIO_UART, 3), /*!< UART receiver is idle. */ - kStatus_FLEXIO_UART_ERROR = MAKE_STATUS(kStatusGroup_FLEXIO_UART, 4), /*!< ERROR happens on UART. */ - kStatus_FLEXIO_UART_RxRingBufferOverrun = - MAKE_STATUS(kStatusGroup_FLEXIO_UART, 5), /*!< UART RX software ring buffer overrun. */ - kStatus_FLEXIO_UART_RxHardwareOverrun = MAKE_STATUS(kStatusGroup_FLEXIO_UART, 6), /*!< UART RX receiver overrun. */ - kStatus_FLEXIO_UART_Timeout = MAKE_STATUS(kStatusGroup_FLEXIO_UART, 7), /*!< UART times out. */ - kStatus_FLEXIO_UART_BaudrateNotSupport = - MAKE_STATUS(kStatusGroup_FLEXIO_UART, 8) /*!< Baudrate is not supported in current clock source */ -}; - -/*! @brief FlexIO UART bit count per char. */ -typedef enum _flexio_uart_bit_count_per_char -{ - kFLEXIO_UART_7BitsPerChar = 7U, /*!< 7-bit data characters */ - kFLEXIO_UART_8BitsPerChar = 8U, /*!< 8-bit data characters */ - kFLEXIO_UART_9BitsPerChar = 9U, /*!< 9-bit data characters */ -} flexio_uart_bit_count_per_char_t; - -/*! @brief Define FlexIO UART interrupt mask. */ -enum _flexio_uart_interrupt_enable -{ - kFLEXIO_UART_TxDataRegEmptyInterruptEnable = 0x1U, /*!< Transmit buffer empty interrupt enable. */ - kFLEXIO_UART_RxDataRegFullInterruptEnable = 0x2U, /*!< Receive buffer full interrupt enable. */ -}; - -/*! @brief Define FlexIO UART status mask. */ -enum _flexio_uart_status_flags -{ - kFLEXIO_UART_TxDataRegEmptyFlag = 0x1U, /*!< Transmit buffer empty flag. */ - kFLEXIO_UART_RxDataRegFullFlag = 0x2U, /*!< Receive buffer full flag. */ - kFLEXIO_UART_RxOverRunFlag = 0x4U, /*!< Receive buffer over run flag. */ -}; - -/*! @brief Define FlexIO UART access structure typedef. */ -typedef struct _flexio_uart_type -{ - FLEXIO_Type *flexioBase; /*!< FlexIO base pointer. */ - uint8_t TxPinIndex; /*!< Pin select for UART_Tx. */ - uint8_t RxPinIndex; /*!< Pin select for UART_Rx. */ - uint8_t shifterIndex[2]; /*!< Shifter index used in FlexIO UART. */ - uint8_t timerIndex[2]; /*!< Timer index used in FlexIO UART. */ -} FLEXIO_UART_Type; - -/*! @brief Define FlexIO UART user configuration structure. */ -typedef struct _flexio_uart_config -{ - bool enableUart; /*!< Enable/disable FlexIO UART TX & RX. */ - bool enableInDoze; /*!< Enable/disable FlexIO operation in doze mode*/ - bool enableInDebug; /*!< Enable/disable FlexIO operation in debug mode*/ - bool enableFastAccess; /*!< Enable/disable fast access to FlexIO registers, - fast access requires the FlexIO clock to be at least - twice the frequency of the bus clock. */ - uint32_t baudRate_Bps; /*!< Baud rate in Bps. */ - flexio_uart_bit_count_per_char_t bitCountPerChar; /*!< number of bits, 7/8/9 -bit */ -} flexio_uart_config_t; - -/*! @brief Define FlexIO UART transfer structure. */ -typedef struct _flexio_uart_transfer -{ - /* - * Use separate TX and RX data pointer, because TX data is const data. - * The member data is kept for backward compatibility. - */ - union - { - uint8_t *data; /*!< The buffer of data to be transfer.*/ - uint8_t *rxData; /*!< The buffer to receive data. */ - const uint8_t *txData; /*!< The buffer of data to be sent. */ - }; - size_t dataSize; /*!< Transfer size*/ -} flexio_uart_transfer_t; - -/* Forward declaration of the handle typedef. */ -typedef struct _flexio_uart_handle flexio_uart_handle_t; - -/*! @brief FlexIO UART transfer callback function. */ -typedef void (*flexio_uart_transfer_callback_t)(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - status_t status, - void *userData); - -/*! @brief Define FLEXIO UART handle structure*/ -struct _flexio_uart_handle -{ - const uint8_t *volatile txData; /*!< Address of remaining data to send. */ - volatile size_t txDataSize; /*!< Size of the remaining data to send. */ - uint8_t *volatile rxData; /*!< Address of remaining data to receive. */ - volatile size_t rxDataSize; /*!< Size of the remaining data to receive. */ - size_t txDataSizeAll; /*!< Total bytes to be sent. */ - size_t rxDataSizeAll; /*!< Total bytes to be received. */ - - uint8_t *rxRingBuffer; /*!< Start address of the receiver ring buffer. */ - size_t rxRingBufferSize; /*!< Size of the ring buffer. */ - volatile uint16_t rxRingBufferHead; /*!< Index for the driver to store received data into ring buffer. */ - volatile uint16_t rxRingBufferTail; /*!< Index for the user to get data from the ring buffer. */ - - flexio_uart_transfer_callback_t callback; /*!< Callback function. */ - void *userData; /*!< UART callback function parameter.*/ - - volatile uint8_t txState; /*!< TX transfer state. */ - volatile uint8_t rxState; /*!< RX transfer state */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus*/ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Ungates the FlexIO clock, resets the FlexIO module, configures FlexIO UART - * hardware, and configures the FlexIO UART with FlexIO UART configuration. - * The configuration structure can be filled by the user or be set with - * default values by FLEXIO_UART_GetDefaultConfig(). - * - * Example - @code - FLEXIO_UART_Type base = { - .flexioBase = FLEXIO, - .TxPinIndex = 0, - .RxPinIndex = 1, - .shifterIndex = {0,1}, - .timerIndex = {0,1} - }; - flexio_uart_config_t config = { - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .baudRate_Bps = 115200U, - .bitCountPerChar = 8 - }; - FLEXIO_UART_Init(base, &config, srcClock_Hz); - @endcode - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param userConfig Pointer to the flexio_uart_config_t structure. - * @param srcClock_Hz FlexIO source clock in Hz. - * @retval kStatus_Success Configuration success. - * @retval kStatus_FLEXIO_UART_BaudrateNotSupport Baudrate is not supported for current clock source frequency. -*/ -status_t FLEXIO_UART_Init(FLEXIO_UART_Type *base, const flexio_uart_config_t *userConfig, uint32_t srcClock_Hz); - -/*! - * @brief Resets the FlexIO UART shifter and timer config. - * - * @note After calling this API, call the FLEXO_UART_Init to use the FlexIO UART module. - * - * @param base Pointer to FLEXIO_UART_Type structure - */ -void FLEXIO_UART_Deinit(FLEXIO_UART_Type *base); - -/*! - * @brief Gets the default configuration to configure the FlexIO UART. The configuration - * can be used directly for calling the FLEXIO_UART_Init(). - * Example: - @code - flexio_uart_config_t config; - FLEXIO_UART_GetDefaultConfig(&userConfig); - @endcode - * @param userConfig Pointer to the flexio_uart_config_t structure. -*/ -void FLEXIO_UART_GetDefaultConfig(flexio_uart_config_t *userConfig); - -/*! @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets the FlexIO UART status flags. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @return FlexIO UART status flags. - */ - -uint32_t FLEXIO_UART_GetStatusFlags(FLEXIO_UART_Type *base); - -/*! - * @brief Gets the FlexIO UART status flags. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param mask Status flag. - * The parameter can be any combination of the following values: - * @arg kFLEXIO_UART_TxDataRegEmptyFlag - * @arg kFLEXIO_UART_RxEmptyFlag - * @arg kFLEXIO_UART_RxOverRunFlag - */ - -void FLEXIO_UART_ClearStatusFlags(FLEXIO_UART_Type *base, uint32_t mask); - -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables the FlexIO UART interrupt. - * - * This function enables the FlexIO UART interrupt. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param mask Interrupt source. - */ -void FLEXIO_UART_EnableInterrupts(FLEXIO_UART_Type *base, uint32_t mask); - -/*! - * @brief Disables the FlexIO UART interrupt. - * - * This function disables the FlexIO UART interrupt. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param mask Interrupt source. - */ -void FLEXIO_UART_DisableInterrupts(FLEXIO_UART_Type *base, uint32_t mask); - -/*! @} */ - -/*! - * @name DMA Control - * @{ - */ - -/*! - * @brief Gets the FlexIO UARt transmit data register address. - * - * This function returns the UART data register address, which is mainly used by DMA/eDMA. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @return FlexIO UART transmit data register address. - */ -static inline uint32_t FLEXIO_UART_GetTxDataRegisterAddress(FLEXIO_UART_Type *base) -{ - return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBuffer, base->shifterIndex[0]); -} - -/*! - * @brief Gets the FlexIO UART receive data register address. - * - * This function returns the UART data register address, which is mainly used by DMA/eDMA. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @return FlexIO UART receive data register address. - */ -static inline uint32_t FLEXIO_UART_GetRxDataRegisterAddress(FLEXIO_UART_Type *base) -{ - return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBufferByteSwapped, base->shifterIndex[1]); -} - -/*! - * @brief Enables/disables the FlexIO UART transmit DMA. - * This function enables/disables the FlexIO UART Tx DMA, - * which means asserting the kFLEXIO_UART_TxDataRegEmptyFlag does/doesn't trigger the DMA request. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param enable True to enable, false to disable. - */ -static inline void FLEXIO_UART_EnableTxDMA(FLEXIO_UART_Type *base, bool enable) -{ - FLEXIO_EnableShifterStatusDMA(base->flexioBase, 1UL << base->shifterIndex[0], enable); -} - -/*! - * @brief Enables/disables the FlexIO UART receive DMA. - * This function enables/disables the FlexIO UART Rx DMA, - * which means asserting kFLEXIO_UART_RxDataRegFullFlag does/doesn't trigger the DMA request. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param enable True to enable, false to disable. - */ -static inline void FLEXIO_UART_EnableRxDMA(FLEXIO_UART_Type *base, bool enable) -{ - FLEXIO_EnableShifterStatusDMA(base->flexioBase, 1UL << base->shifterIndex[1], enable); -} - -/*! @} */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Enables/disables the FlexIO UART module operation. - * - * @param base Pointer to the FLEXIO_UART_Type. - * @param enable True to enable, false does not have any effect. - */ -static inline void FLEXIO_UART_Enable(FLEXIO_UART_Type *base, bool enable) -{ - if (enable) - { - base->flexioBase->CTRL |= FLEXIO_CTRL_FLEXEN_MASK; - } -} - -/*! - * @brief Writes one byte of data. - * - * @note This is a non-blocking API, which returns directly after the data is put into the - * data register. Ensure that the TxEmptyFlag is asserted before calling - * this API. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param buffer The data bytes to send. - */ -static inline void FLEXIO_UART_WriteByte(FLEXIO_UART_Type *base, const uint8_t *buffer) -{ - base->flexioBase->SHIFTBUF[base->shifterIndex[0]] = *buffer; -} - -/*! - * @brief Reads one byte of data. - * - * @note This is a non-blocking API, which returns directly after the data is read from the - * data register. Ensure that the RxFullFlag is asserted before calling this API. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param buffer The buffer to store the received bytes. - */ -static inline void FLEXIO_UART_ReadByte(FLEXIO_UART_Type *base, uint8_t *buffer) -{ - *buffer = (uint8_t)(base->flexioBase->SHIFTBUFBYS[base->shifterIndex[1]]); -} - -/*! - * @brief Sends a buffer of data bytes. - * - * @note This function blocks using the polling method until all bytes have been sent. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param txData The data bytes to send. - * @param txSize The number of data bytes to send. - * @retval kStatus_FLEXIO_UART_Timeout Transmission timed out and was aborted. - * @retval kStatus_Success Successfully wrote all data. - */ -status_t FLEXIO_UART_WriteBlocking(FLEXIO_UART_Type *base, const uint8_t *txData, size_t txSize); - -/*! - * @brief Receives a buffer of bytes. - * - * @note This function blocks using the polling method until all bytes have been received. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param rxData The buffer to store the received bytes. - * @param rxSize The number of data bytes to be received. - * @retval kStatus_FLEXIO_UART_Timeout Transmission timed out and was aborted. - * @retval kStatus_Success Successfully received all data. - */ -status_t FLEXIO_UART_ReadBlocking(FLEXIO_UART_Type *base, uint8_t *rxData, size_t rxSize); - -/*! @} */ - -/*! - * @name Transactional - * @{ - */ - -/*! - * @brief Initializes the UART handle. - * - * This function initializes the FlexIO UART handle, which can be used for other FlexIO - * UART transactional APIs. Call this API once to get the - * initialized handle. - * - * The UART driver supports the "background" receiving, which means that users can set up - * a RX ring buffer optionally. Data received is stored into the ring buffer even when - * the user doesn't call the FLEXIO_UART_TransferReceiveNonBlocking() API. If there is already data - * received in the ring buffer, users can get the received data from the ring buffer - * directly. The ring buffer is disabled if passing NULL as @p ringBuffer. - * - * @param base to FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * @param callback The callback function. - * @param userData The parameter of the callback function. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_UART_TransferCreateHandle(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - flexio_uart_transfer_callback_t callback, - void *userData); - -/*! - * @brief Sets up the RX ring buffer. - * - * This function sets up the RX ring buffer to a specific UART handle. - * - * When the RX ring buffer is used, data received is stored into the ring buffer even when - * the user doesn't call the UART_ReceiveNonBlocking() API. If there is already data received - * in the ring buffer, users can get the received data from the ring buffer directly. - * - * @note When using the RX ring buffer, one byte is reserved for internal use. In other - * words, if @p ringBufferSize is 32, only 31 bytes are used for saving data. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * @param ringBuffer Start address of ring buffer for background receiving. Pass NULL to disable the ring buffer. - * @param ringBufferSize Size of the ring buffer. - */ -void FLEXIO_UART_TransferStartRingBuffer(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - uint8_t *ringBuffer, - size_t ringBufferSize); - -/*! - * @brief Aborts the background transfer and uninstalls the ring buffer. - * - * This function aborts the background transfer and uninstalls the ring buffer. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferStopRingBuffer(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle); - -/*! - * @brief Transmits a buffer of data using the interrupt method. - * - * This function sends data using an interrupt method. This is a non-blocking function, - * which returns directly without waiting for all data to be written to the TX register. When - * all data is written to the TX register in ISR, the FlexIO UART driver calls the callback - * function and passes the @ref kStatus_FLEXIO_UART_TxIdle as status parameter. - * - * @note The kStatus_FLEXIO_UART_TxIdle is passed to the upper layer when all data is written - * to the TX register. However, it does not ensure that all data is sent out. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * @param xfer FlexIO UART transfer structure. See #flexio_uart_transfer_t. - * @retval kStatus_Success Successfully starts the data transmission. - * @retval kStatus_UART_TxBusy Previous transmission still not finished, data not written to the TX register. - */ -status_t FLEXIO_UART_TransferSendNonBlocking(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - flexio_uart_transfer_t *xfer); - -/*! - * @brief Aborts the interrupt-driven data transmit. - * - * This function aborts the interrupt-driven data sending. Get the remainBytes to find out - * how many bytes are still not sent out. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferAbortSend(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle); - -/*! - * @brief Gets the number of bytes sent. - * - * This function gets the number of bytes sent driven by interrupt. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * @param count Number of bytes sent so far by the non-blocking transaction. - * @retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * @retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetSendCount(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle, size_t *count); - -/*! - * @brief Receives a buffer of data using the interrupt method. - * - * This function receives data using the interrupt method. This is a non-blocking function, - * which returns without waiting for all data to be received. - * If the RX ring buffer is used and not empty, the data in ring buffer is copied and - * the parameter @p receivedBytes shows how many bytes are copied from the ring buffer. - * After copying, if the data in ring buffer is not enough to read, the receive - * request is saved by the UART driver. When new data arrives, the receive request - * is serviced first. When all data is received, the UART driver notifies the upper layer - * through a callback function and passes the status parameter kStatus_UART_RxIdle. - * For example, if the upper layer needs 10 bytes but there are only 5 bytes in the ring buffer, - * the 5 bytes are copied to xfer->data. This function returns with the - * parameter @p receivedBytes set to 5. For the last 5 bytes, newly arrived data is - * saved from the xfer->data[5]. When 5 bytes are received, the UART driver notifies upper layer. - * If the RX ring buffer is not enabled, this function enables the RX and RX interrupt - * to receive data to xfer->data. When all data is received, the upper layer is notified. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * @param xfer UART transfer structure. See #flexio_uart_transfer_t. - * @param receivedBytes Bytes received from the ring buffer directly. - * @retval kStatus_Success Successfully queue the transfer into the transmit queue. - * @retval kStatus_FLEXIO_UART_RxBusy Previous receive request is not finished. - */ -status_t FLEXIO_UART_TransferReceiveNonBlocking(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - flexio_uart_transfer_t *xfer, - size_t *receivedBytes); - -/*! - * @brief Aborts the receive data which was using IRQ. - * - * This function aborts the receive data which was using IRQ. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferAbortReceive(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle); - -/*! - * @brief Gets the number of bytes received. - * - * This function gets the number of bytes received driven by interrupt. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * @param count Number of bytes received so far by the non-blocking transaction. - * @retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * @retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetReceiveCount(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle, size_t *count); - -/*! - * @brief FlexIO UART IRQ handler function. - * - * This function processes the FlexIO UART transmit and receives the IRQ request. - * - * @param uartType Pointer to the FLEXIO_UART_Type structure. - * @param uartHandle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferHandleIRQ(void *uartType, void *uartHandle); - -/*! - * @brief Flush tx/rx shifters. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - */ -void FLEXIO_UART_FlushShifters(FLEXIO_UART_Type *base); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /*_cplusplus*/ -/*! @} */ - -#endif /*FSL_FLEXIO_UART_H_*/ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_uart_edma.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_uart_edma.c deleted file mode 100644 index f2502c9df20..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_uart_edma.c +++ /dev/null @@ -1,407 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio_uart_edma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio_uart_edma" -#endif - -/*handle != NULL); - - /* Avoid the warning for unused variables. */ - handle = handle; - tcds = tcds; - - if (transferDone) - { - FLEXIO_UART_TransferAbortSendEDMA(uartPrivateHandle->base, uartPrivateHandle->handle); - - if (uartPrivateHandle->handle->callback != NULL) - { - uartPrivateHandle->handle->callback(uartPrivateHandle->base, uartPrivateHandle->handle, - kStatus_FLEXIO_UART_TxIdle, uartPrivateHandle->handle->userData); - } - } -} - -static void FLEXIO_UART_TransferReceiveEDMACallback(edma_handle_t *handle, - void *param, - bool transferDone, - uint32_t tcds) -{ - flexio_uart_edma_private_handle_t *uartPrivateHandle = (flexio_uart_edma_private_handle_t *)param; - - assert(uartPrivateHandle->handle != NULL); - - /* Avoid the warning for unused variables. */ - handle = handle; - tcds = tcds; - - if (transferDone) - { - /* Disable transfer. */ - FLEXIO_UART_TransferAbortReceiveEDMA(uartPrivateHandle->base, uartPrivateHandle->handle); - - if (uartPrivateHandle->handle->callback != NULL) - { - uartPrivateHandle->handle->callback(uartPrivateHandle->base, uartPrivateHandle->handle, - kStatus_FLEXIO_UART_RxIdle, uartPrivateHandle->handle->userData); - } - } -} - -/*! - * brief Initializes the UART handle which is used in transactional functions. - * - * param base Pointer to FLEXIO_UART_Type. - * param handle Pointer to flexio_uart_edma_handle_t structure. - * param callback The callback function. - * param userData The parameter of the callback function. - * param rxEdmaHandle User requested DMA handle for RX DMA transfer. - * param txEdmaHandle User requested DMA handle for TX DMA transfer. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO SPI eDMA type/handle table out of range. - */ -status_t FLEXIO_UART_TransferCreateHandleEDMA(FLEXIO_UART_Type *base, - flexio_uart_edma_handle_t *handle, - flexio_uart_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *txEdmaHandle, - edma_handle_t *rxEdmaHandle) -{ - assert(handle != NULL); - - uint8_t index = 0U; - - /* Find the an empty handle pointer to store the handle. */ - for (index = 0U; index < (uint8_t)FLEXIO_UART_HANDLE_COUNT; index++) - { - if (s_edmaPrivateHandle[index].base == NULL) - { - s_edmaPrivateHandle[index].base = base; - s_edmaPrivateHandle[index].handle = handle; - break; - } - } - - if (index == (uint8_t)FLEXIO_UART_HANDLE_COUNT) - { - return kStatus_OutOfRange; - } - - (void)memset(handle, 0, sizeof(*handle)); - - handle->rxState = (uint8_t)kFLEXIO_UART_RxIdle; - handle->txState = (uint8_t)kFLEXIO_UART_TxIdle; - - handle->rxEdmaHandle = rxEdmaHandle; - handle->txEdmaHandle = txEdmaHandle; - - handle->callback = callback; - handle->userData = userData; - - /* Configure TX. */ - if (txEdmaHandle != NULL) - { - EDMA_SetCallback(handle->txEdmaHandle, FLEXIO_UART_TransferSendEDMACallback, &s_edmaPrivateHandle); - } - - /* Configure RX. */ - if (rxEdmaHandle != NULL) - { - EDMA_SetCallback(handle->rxEdmaHandle, FLEXIO_UART_TransferReceiveEDMACallback, &s_edmaPrivateHandle); - } - - return kStatus_Success; -} - -/*! - * brief Sends data using eDMA. - * - * This function sends data using eDMA. This is a non-blocking function, which returns - * right away. When all data is sent out, the send callback function is called. - * - * param base Pointer to FLEXIO_UART_Type - * param handle UART handle pointer. - * param xfer UART eDMA transfer structure, see #flexio_uart_transfer_t. - * retval kStatus_Success if succeed, others failed. - * retval kStatus_FLEXIO_UART_TxBusy Previous transfer on going. - */ -status_t FLEXIO_UART_TransferSendEDMA(FLEXIO_UART_Type *base, - flexio_uart_edma_handle_t *handle, - flexio_uart_transfer_t *xfer) -{ - assert(handle->txEdmaHandle != NULL); - - edma_transfer_config_t xferConfig; - status_t status; - - /* Return error if xfer invalid. */ - if ((0U == xfer->dataSize) || (NULL == xfer->data)) - { - return kStatus_InvalidArgument; - } - - /* If previous TX not finished. */ - if ((uint8_t)kFLEXIO_UART_TxBusy == handle->txState) - { - status = kStatus_FLEXIO_UART_TxBusy; - } - else - { - handle->txState = (uint8_t)kFLEXIO_UART_TxBusy; - handle->txDataSizeAll = xfer->dataSize; - - /* Prepare transfer. */ - EDMA_PrepareTransfer(&xferConfig, xfer->data, sizeof(uint8_t), - (uint32_t *)FLEXIO_UART_GetTxDataRegisterAddress(base), sizeof(uint8_t), sizeof(uint8_t), - xfer->dataSize, kEDMA_MemoryToPeripheral); - - /* Store the initially configured eDMA minor byte transfer count into the FLEXIO UART handle */ - handle->nbytes = 1U; - - /* Submit transfer. */ - (void)EDMA_SubmitTransfer(handle->txEdmaHandle, &xferConfig); - EDMA_StartTransfer(handle->txEdmaHandle); - - /* Enable UART TX EDMA. */ - FLEXIO_UART_EnableTxDMA(base, true); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Receives data using eDMA. - * - * This function receives data using eDMA. This is a non-blocking function, which returns - * right away. When all data is received, the receive callback function is called. - * - * param base Pointer to FLEXIO_UART_Type - * param handle Pointer to flexio_uart_edma_handle_t structure - * param xfer UART eDMA transfer structure, see #flexio_uart_transfer_t. - * retval kStatus_Success if succeed, others failed. - * retval kStatus_UART_RxBusy Previous transfer on going. - */ -status_t FLEXIO_UART_TransferReceiveEDMA(FLEXIO_UART_Type *base, - flexio_uart_edma_handle_t *handle, - flexio_uart_transfer_t *xfer) -{ - assert(handle->rxEdmaHandle != NULL); - - edma_transfer_config_t xferConfig; - status_t status; - - /* Return error if xfer invalid. */ - if ((0U == xfer->dataSize) || (NULL == xfer->data)) - { - return kStatus_InvalidArgument; - } - - /* If previous RX not finished. */ - if ((uint8_t)kFLEXIO_UART_RxBusy == handle->rxState) - { - status = kStatus_FLEXIO_UART_RxBusy; - } - else - { - handle->rxState = (uint8_t)kFLEXIO_UART_RxBusy; - handle->rxDataSizeAll = xfer->dataSize; - - /* Prepare transfer. */ - EDMA_PrepareTransfer(&xferConfig, (uint32_t *)FLEXIO_UART_GetRxDataRegisterAddress(base), sizeof(uint8_t), - xfer->data, sizeof(uint8_t), sizeof(uint8_t), xfer->dataSize, kEDMA_PeripheralToMemory); - - /* Store the initially configured eDMA minor byte transfer count into the FLEXIO UART handle */ - handle->nbytes = (uint8_t)sizeof(uint8_t); - - /* Submit transfer. */ - (void)EDMA_SubmitTransfer(handle->rxEdmaHandle, &xferConfig); - EDMA_StartTransfer(handle->rxEdmaHandle); - - /* Enable UART RX EDMA. */ - FLEXIO_UART_EnableRxDMA(base, true); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Aborts the sent data which using eDMA. - * - * This function aborts sent data which using eDMA. - * - * param base Pointer to FLEXIO_UART_Type - * param handle Pointer to flexio_uart_edma_handle_t structure - */ -void FLEXIO_UART_TransferAbortSendEDMA(FLEXIO_UART_Type *base, flexio_uart_edma_handle_t *handle) -{ - assert(handle->txEdmaHandle != NULL); - - /* Disable UART TX EDMA. */ - FLEXIO_UART_EnableTxDMA(base, false); - - /* Stop transfer. */ - EDMA_StopTransfer(handle->txEdmaHandle); - - handle->txState = (uint8_t)kFLEXIO_UART_TxIdle; -} - -/*! - * brief Aborts the receive data which using eDMA. - * - * This function aborts the receive data which using eDMA. - * - * param base Pointer to FLEXIO_UART_Type - * param handle Pointer to flexio_uart_edma_handle_t structure - */ -void FLEXIO_UART_TransferAbortReceiveEDMA(FLEXIO_UART_Type *base, flexio_uart_edma_handle_t *handle) -{ - assert(handle->rxEdmaHandle != NULL); - - /* Disable UART RX EDMA. */ - FLEXIO_UART_EnableRxDMA(base, false); - - /* Stop transfer. */ - EDMA_StopTransfer(handle->rxEdmaHandle); - - handle->rxState = (uint8_t)kFLEXIO_UART_RxIdle; -} - -/*! - * brief Gets the number of bytes received. - * - * This function gets the number of bytes received. - * - * param base Pointer to FLEXIO_UART_Type - * param handle Pointer to flexio_uart_edma_handle_t structure - * param count Number of bytes received so far by the non-blocking transaction. - * retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetReceiveCountEDMA(FLEXIO_UART_Type *base, - flexio_uart_edma_handle_t *handle, - size_t *count) -{ - assert(handle != NULL); - assert(handle->rxEdmaHandle != NULL); - assert(count != NULL); - - if ((uint8_t)kFLEXIO_UART_RxIdle == handle->rxState) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->rxDataSizeAll - - (uint32_t)handle->nbytes * - EDMA_GetRemainingMajorLoopCount(handle->rxEdmaHandle->base, handle->rxEdmaHandle->channel); - - return kStatus_Success; -} - -/*! - * brief Gets the number of bytes sent out. - * - * This function gets the number of bytes sent out. - * - * param base Pointer to FLEXIO_UART_Type - * param handle Pointer to flexio_uart_edma_handle_t structure - * param count Number of bytes sent so far by the non-blocking transaction. - * retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetSendCountEDMA(FLEXIO_UART_Type *base, flexio_uart_edma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - assert(handle->txEdmaHandle != NULL); - assert(count != NULL); - - if ((uint8_t)kFLEXIO_UART_TxIdle == handle->txState) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->txDataSizeAll - - (uint32_t)handle->nbytes * - EDMA_GetRemainingMajorLoopCount(handle->txEdmaHandle->base, handle->txEdmaHandle->channel); - - return kStatus_Success; -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_uart_edma.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_uart_edma.h deleted file mode 100644 index c8d0a04369b..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_flexio_uart_edma.h +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_FLEXIO_UART_EDMA_H_ -#define FSL_FLEXIO_UART_EDMA_H_ - -#include "fsl_flexio_uart.h" -#include "fsl_edma.h" - -/*! - * @addtogroup flexio_edma_uart - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief FlexIO UART EDMA driver version. */ -#define FSL_FLEXIO_UART_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 4, 1)) -/*! @} */ - -/* Forward declaration of the handle typedef. */ -typedef struct _flexio_uart_edma_handle flexio_uart_edma_handle_t; - -/*! @brief UART transfer callback function. */ -typedef void (*flexio_uart_edma_transfer_callback_t)(FLEXIO_UART_Type *base, - flexio_uart_edma_handle_t *handle, - status_t status, - void *userData); - -/*! - * @brief UART eDMA handle - */ -struct _flexio_uart_edma_handle -{ - flexio_uart_edma_transfer_callback_t callback; /*!< Callback function. */ - void *userData; /*!< UART callback function parameter.*/ - - size_t txDataSizeAll; /*!< Total bytes to be sent. */ - size_t rxDataSizeAll; /*!< Total bytes to be received. */ - - edma_handle_t *txEdmaHandle; /*!< The eDMA TX channel used. */ - edma_handle_t *rxEdmaHandle; /*!< The eDMA RX channel used. */ - - uint8_t nbytes; /*!< eDMA minor byte transfer count initially configured. */ - - volatile uint8_t txState; /*!< TX transfer state. */ - volatile uint8_t rxState; /*!< RX transfer state */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name eDMA transactional - * @{ - */ - -/*! - * @brief Initializes the UART handle which is used in transactional functions. - * - * @param base Pointer to FLEXIO_UART_Type. - * @param handle Pointer to flexio_uart_edma_handle_t structure. - * @param callback The callback function. - * @param userData The parameter of the callback function. - * @param rxEdmaHandle User requested DMA handle for RX DMA transfer. - * @param txEdmaHandle User requested DMA handle for TX DMA transfer. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO SPI eDMA type/handle table out of range. - */ -status_t FLEXIO_UART_TransferCreateHandleEDMA(FLEXIO_UART_Type *base, - flexio_uart_edma_handle_t *handle, - flexio_uart_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *txEdmaHandle, - edma_handle_t *rxEdmaHandle); - -/*! - * @brief Sends data using eDMA. - * - * This function sends data using eDMA. This is a non-blocking function, which returns - * right away. When all data is sent out, the send callback function is called. - * - * @param base Pointer to FLEXIO_UART_Type - * @param handle UART handle pointer. - * @param xfer UART eDMA transfer structure, see #flexio_uart_transfer_t. - * @retval kStatus_Success if succeed, others failed. - * @retval kStatus_FLEXIO_UART_TxBusy Previous transfer on going. - */ -status_t FLEXIO_UART_TransferSendEDMA(FLEXIO_UART_Type *base, - flexio_uart_edma_handle_t *handle, - flexio_uart_transfer_t *xfer); - -/*! - * @brief Receives data using eDMA. - * - * This function receives data using eDMA. This is a non-blocking function, which returns - * right away. When all data is received, the receive callback function is called. - * - * @param base Pointer to FLEXIO_UART_Type - * @param handle Pointer to flexio_uart_edma_handle_t structure - * @param xfer UART eDMA transfer structure, see #flexio_uart_transfer_t. - * @retval kStatus_Success if succeed, others failed. - * @retval kStatus_UART_RxBusy Previous transfer on going. - */ -status_t FLEXIO_UART_TransferReceiveEDMA(FLEXIO_UART_Type *base, - flexio_uart_edma_handle_t *handle, - flexio_uart_transfer_t *xfer); - -/*! - * @brief Aborts the sent data which using eDMA. - * - * This function aborts sent data which using eDMA. - * - * @param base Pointer to FLEXIO_UART_Type - * @param handle Pointer to flexio_uart_edma_handle_t structure - */ -void FLEXIO_UART_TransferAbortSendEDMA(FLEXIO_UART_Type *base, flexio_uart_edma_handle_t *handle); - -/*! - * @brief Aborts the receive data which using eDMA. - * - * This function aborts the receive data which using eDMA. - * - * @param base Pointer to FLEXIO_UART_Type - * @param handle Pointer to flexio_uart_edma_handle_t structure - */ -void FLEXIO_UART_TransferAbortReceiveEDMA(FLEXIO_UART_Type *base, flexio_uart_edma_handle_t *handle); - -/*! - * @brief Gets the number of bytes sent out. - * - * This function gets the number of bytes sent out. - * - * @param base Pointer to FLEXIO_UART_Type - * @param handle Pointer to flexio_uart_edma_handle_t structure - * @param count Number of bytes sent so far by the non-blocking transaction. - * @retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * @retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetSendCountEDMA(FLEXIO_UART_Type *base, flexio_uart_edma_handle_t *handle, size_t *count); - -/*! - * @brief Gets the number of bytes received. - * - * This function gets the number of bytes received. - * - * @param base Pointer to FLEXIO_UART_Type - * @param handle Pointer to flexio_uart_edma_handle_t structure - * @param count Number of bytes received so far by the non-blocking transaction. - * @retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * @retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetReceiveCountEDMA(FLEXIO_UART_Type *base, - flexio_uart_edma_handle_t *handle, - size_t *count); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_UART_EDMA_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_freqme.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_freqme.c deleted file mode 100644 index 459bbb6f3a0..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_freqme.c +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright 2021-2022 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_freqme.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpc_freqme" -#endif - -#if defined(FREQME_RSTS_N) -#define FREQME_RESETS_ARRAY FREQME_RSTS_N -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -static uint32_t FREQME_GetInstance(FREQME_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Array to map freqme instance number to base address. */ -static FREQME_Type *const s_freqmeBases[] = FREQME_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to FREQME clocks for each instance. */ -static const clock_ip_name_t s_freqmeClocks[] = FREQME_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(FREQME_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_freqmeResets[] = FREQME_RESETS_ARRAY; -#endif -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t FREQME_GetInstance(FREQME_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0U; instance < ARRAY_SIZE(s_freqmeBases); instance++) - { - if (s_freqmeBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_freqmeBases)); - - return instance; -} - -/*! - * brief Initialize freqme module, set operate mode, operate mode attribute and initialize measurement cycle. - * - * param base FREQME peripheral base address. - * param config The pointer to module basic configuration, please refer to freq_measure_config_t. - */ -void FREQME_Init(FREQME_Type *base, const freq_measure_config_t *config) -{ - assert(config); - - uint32_t tmp32 = 0UL; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable FREQME clock. */ - CLOCK_EnableClock(s_freqmeClocks[FREQME_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(FREQME_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_freqmeResets[FREQME_GetInstance(base)]); -#endif - - if (config->startMeasurement) - { - tmp32 |= FREQME_CTRL_W_MEASURE_IN_PROGRESS_MASK; - } - tmp32 |= FREQME_CTRL_W_CONTINUOUS_MODE_EN(config->enableContinuousMode) | - FREQME_CTRL_W_PULSE_MODE(config->operateMode); - if (config->operateMode == kFREQME_FreqMeasurementMode) - { - tmp32 |= FREQME_CTRL_W_REF_SCALE(config->operateModeAttribute.refClkScaleFactor); - } - else - { - tmp32 |= FREQME_CTRL_W_PULSE_POL(config->operateModeAttribute.pulsePolarity); - } - - base->CTRL_W = tmp32; -} - -/*! - * brief Get default configuration. - * - * code - * config->operateMode = kFREQME_FreqMeasurementMode; - * config->operateModeAttribute.refClkScaleFactor = 0U; - * config->enableContinuousMode = false; - * config->startMeasurement = false; - * endcode - * - * param config The pointer to module basic configuration, please refer to freq_measure_config_t. - */ -void FREQME_GetDefaultConfig(freq_measure_config_t *config) -{ - assert(config); - - (void)memset(config, 0, sizeof(*config)); - - config->operateMode = kFREQME_FreqMeasurementMode; - config->operateModeAttribute.refClkScaleFactor = 0U; - config->enableContinuousMode = false; - config->startMeasurement = false; -} - -/*! - * brief Calculate the frequency of selected target clock. - * - * note The formula: Ftarget = (RESULT - 2) * Freference / 2 ^ REF_SCALE. - * - * note This function only useful when the operate mode is selected as frequency measurement mode. - * - * param base FREQME peripheral base address. - * param refClkFrequency The frequency of reference clock. - * return The frequency of target clock, if the output result is 0, please check the module's operate mode. - */ -uint32_t FREQME_CalculateTargetClkFreq(FREQME_Type *base, uint32_t refClkFrequency) -{ - uint32_t measureResult = 0UL; - uint32_t targetFreq = 0UL; - uint64_t tmp64 = 0ULL; - - while ((base->CTRL_R & FREQME_CTRL_R_MEASURE_IN_PROGRESS_MASK) != 0UL) - { - } - - if (!FREQME_CheckOperateMode(base)) - { - measureResult = base->CTRL_R & FREQME_CTRL_R_RESULT_MASK; - tmp64 = ((uint64_t)measureResult - 2ULL) * (uint64_t)refClkFrequency; - targetFreq = (uint32_t)(tmp64 / (1ULL << (uint64_t)FREQME_GetReferenceClkScaleValue(base))); - } - - return targetFreq; -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_freqme.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_freqme.h deleted file mode 100644 index dd1ee29d668..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_freqme.h +++ /dev/null @@ -1,441 +0,0 @@ -/* - * Copyright 2021-2022 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_FREQME_H_ -#define FSL_FREQME_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup lpc_freqme - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief FREQME driver version 2.1.2. */ -#define FSL_FREQME_DRIVER_VERSION (MAKE_VERSION(2, 1, 2)) -/*! @} */ - -/*! - * @brief The enumeration of interrupt status flags. - * @anchor _freqme_interrupt_status_flags - */ -enum _freqme_interrupt_status_flags -{ - kFREQME_UnderflowInterruptStatusFlag = FREQME_CTRLSTAT_LT_MIN_STAT_MASK, /*!< Indicate the measurement is - just done and the result is less - than minimun value. */ - kFREQME_OverflowInterruptStatusFlag = FREQME_CTRLSTAT_GT_MAX_STAT_MASK, /*!< Indicate the measurement is - just done and the result is greater - than maximum value. */ - kFREQME_ReadyInterruptStatusFlag = FREQME_CTRLSTAT_RESULT_READY_STAT_MASK, /*!< Indicate the measurement is - just done and the result is ready to - read. */ - kFREQME_AllInterruptStatusFlags = FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_GT_MAX_STAT_MASK | - FREQME_CTRLSTAT_RESULT_READY_STAT_MASK, /*!< All interrupt - status flags. */ -}; - -/*! - * @brief The enumeration of interrupts, including underflow interrupt, overflow interrupt, - * and result ready interrupt. - * @anchor _freqme_interrupt_enable - */ -enum _freqme_interrupt_enable -{ - kFREQME_UnderflowInterruptEnable = FREQME_CTRL_W_LT_MIN_INT_EN_MASK, /*!< Enable interrupt when the result is - less than minimum value. */ - kFREQME_OverflowInterruptEnable = FREQME_CTRL_W_GT_MAX_INT_EN_MASK, /*!< Enable interrupt when the result is - greater than maximum value. */ - kFREQME_ReadyInterruptEnable = FREQME_CTRL_W_RESULT_READY_INT_EN_MASK, /*!< Enable interrupt when a - measurement completes and the result - is ready. */ -}; - -/*! - * @brief FREQME module operate mode enumeration, including frequency measurement mode - * and pulse width measurement mode. - */ -typedef enum _freqme_operate_mode -{ - kFREQME_FreqMeasurementMode = 0U, /*!< The module works in the frequency measurement mode. */ - kFREOME_PulseWidthMeasurementMode, /*!< The module works in the pulse width measurement mode. */ -} freqme_operate_mode_t; - -/*! - * @brief The enumeration of pulse polarity. - */ -typedef enum _freqme_pulse_polarity -{ - kFREQME_PulseHighPeriod = 0U, /*!< Select high period of the reference clock. */ - kFREQME_PulseLowPeriod, /*!< Select low period of the reference clock. */ -} freqme_pulse_polarity_t; - -/*! - * @brief The union of operate mode attribute. - * @note If the operate mode is selected as frequency measurement mode the member \b refClkScaleFactor should be used, - * if the operate mode is selected as pulse width measurement mode the member \b pulsePolarity should be used. - */ -typedef union _freqme_mode_attribute -{ - uint8_t refClkScaleFactor; /*!< Only useful in frequency measurement operate mode, - used to set the reference clock counter scaling factor. */ - freqme_pulse_polarity_t pulsePolarity; /*!< Only Useful in pulse width measurement operate mode, - used to set period polarity. */ -} freqme_mode_attribute_t; - -/*! - * @brief The structure of freqme module basic configuration, - * including operate mode, operate mode attribute and so on. - */ -typedef struct _freq_measure_config -{ - freqme_operate_mode_t operateMode; /*!< Select operate mode, please refer to @ref freqme_operate_mode_t. */ - freqme_mode_attribute_t operateModeAttribute; /*!< Used to set the attribute of the selected operate mode, if - the operate mode is selected as @ref kFREQME_FreqMeasurementMode - set freqme_mode_attribute_t::refClkScaleFactor, if operate mode is - selected as @ref kFREOME_PulseWidthMeasurementMode, please set - freqme_mode_attribute_t::pulsePolarity. */ - - bool enableContinuousMode; /*!< Enable/disable continuous mode, if continuous mode is enable, - the measurement is performed continuously and the result for the - last completed measurement is available in the result register. */ - bool startMeasurement; -} freq_measure_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Basic Control APIs - * @{ - */ -/*! - * @brief Initialize freqme module, set operate mode, operate mode attribute and initialize measurement cycle. - * - * @param base FREQME peripheral base address. - * @param config The pointer to module basic configuration, please refer to @ref freq_measure_config_t. - */ -void FREQME_Init(FREQME_Type *base, const freq_measure_config_t *config); - -/*! - * @brief Get default configuration. - * - * @code - * config->operateMode = kFREQME_FreqMeasurementMode; - * config->operateModeAttribute.refClkScaleFactor = 0U; - * config->enableContinuousMode = false; - * config->startMeasurement = false; - * @endcode - * - * @param config The pointer to module basic configuration, please refer to @ref freq_measure_config_t. - */ -void FREQME_GetDefaultConfig(freq_measure_config_t *config); - -/*! - * @brief Start frequency or pulse width measurement process. - * - * @param base FREQME peripheral base address. - */ -static inline void FREQME_StartMeasurementCycle(FREQME_Type *base) -{ - uint32_t tmp32; - - tmp32 = base->CTRLSTAT; - tmp32 &= ~(FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_MEASURE_IN_PROGRESS_MASK | - FREQME_CTRLSTAT_GT_MAX_STAT_MASK | FREQME_CTRLSTAT_RESULT_READY_STAT_MASK); - tmp32 |= FREQME_CTRL_W_MEASURE_IN_PROGRESS_MASK; - base->CTRL_W = tmp32; -} - -/*! - * @brief Force the termination of any measurement cycle currently in progress and resets RESULT or just reset - * RESULT if the module in idle state. - * - * @param base FREQME peripheral base address. - */ -static inline void FREQME_TerminateMeasurementCycle(FREQME_Type *base) -{ - uint32_t tmp32; - - tmp32 = base->CTRLSTAT; - tmp32 &= ~(FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_MEASURE_IN_PROGRESS_MASK | - FREQME_CTRLSTAT_GT_MAX_STAT_MASK | FREQME_CTRLSTAT_RESULT_READY_STAT_MASK); - base->CTRL_W = tmp32; -} - -/*! - * @brief Enable/disable Continuous mode. - * - * @param base FREQME peripheral base address. - * @param enable Used to enable/disable continuous mode, - * - \b true Enable Continuous mode. - * - \b false Disable Continuous mode. - */ -static inline void FREQME_EnableContinuousMode(FREQME_Type *base, bool enable) -{ - uint32_t tmp32; - - tmp32 = base->CTRLSTAT; - tmp32 &= ~(FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_CONTINUOUS_MODE_EN_MASK | - FREQME_CTRLSTAT_GT_MAX_STAT_MASK | FREQME_CTRLSTAT_RESULT_READY_STAT_MASK); - if (enable) - { - tmp32 |= FREQME_CTRL_W_CONTINUOUS_MODE_EN_MASK; - } - - base->CTRL_W = tmp32; -} - -/*! - * @brief Check whether continuous mode is enabled. - * - * @param base FREQME peripheral base address. - * @retval True Continuous mode is enabled, the measurement is performed continuously. - * @retval False Continuous mode is disabled. - */ -static inline bool FREQME_CheckContinuousMode(FREQME_Type *base) -{ - return (bool)((base->CTRLSTAT & FREQME_CTRLSTAT_CONTINUOUS_MODE_EN_MASK) != 0UL); -} - -/*! - * @brief Set operate mode of freqme module. - * - * @param base FREQME peripheral base address. - * @param operateMode The operate mode to be set, please refer to @ref freqme_operate_mode_t. - */ -static inline void FREQME_SetOperateMode(FREQME_Type *base, freqme_operate_mode_t operateMode) -{ - uint32_t tmp32; - - tmp32 = base->CTRLSTAT; - tmp32 &= ~(FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_PULSE_MODE_MASK | - FREQME_CTRLSTAT_GT_MAX_STAT_MASK | FREQME_CTRLSTAT_RESULT_READY_STAT_MASK); - if (operateMode == kFREOME_PulseWidthMeasurementMode) - { - tmp32 |= FREQME_CTRL_W_PULSE_MODE_MASK; - } - - base->CTRL_W = tmp32; -} - -/*! - * @brief Check module's operate mode. - * - * @param base FREQME peripheral base address. - * @retval True Pulse width measurement mode. - * @retval False Frequency measurement mode. - */ -static inline bool FREQME_CheckOperateMode(FREQME_Type *base) -{ - return (bool)((base->CTRLSTAT & FREQME_CTRLSTAT_PULSE_MODE_MASK) != 0UL); - -} - -/*! - * @brief Set the minimum expected value for the measurement result. - * - * @param base FREQME peripheral base address. - * @param minValue The minimum value to set, please note that this value is 31 bits width. - */ -static inline void FREQME_SetMinExpectedValue(FREQME_Type *base, uint32_t minValue) -{ - base->MIN = minValue; -} - -/*! - * @brief Set the maximum expected value for the measurement result. - * - * @param base FREQME peripheral base address. - * @param maxValue The maximum value to set, please note that this value is 31 bits width. - */ -static inline void FREQME_SetMaxExpectedValue(FREQME_Type *base, uint32_t maxValue) -{ - base->MAX = maxValue; -} - -/*! @} */ - -/*! - * @name Frequency Measurement Mode Control APIs - * @{ - */ - -/*! - * @brief Calculate the frequency of selected target clock。 - * - * @note The formula: Ftarget = (RESULT - 2) * Freference / 2 ^ REF_SCALE. - * - * @note This function only useful when the operate mode is selected as frequency measurement mode. - * - * @param base FREQME peripheral base address. - * @param refClkFrequency The frequency of reference clock. - * @return The frequency of target clock the unit is Hz, if the output result is 0, please check the module's - * operate mode. - */ -uint32_t FREQME_CalculateTargetClkFreq(FREQME_Type *base, uint32_t refClkFrequency); - -/*! - * @brief Get reference clock scaling factor. - * - * @param base FREQME peripheral base address. - * @return Reference clock scaling factor, the reference count cycle is 2 ^ ref_scale. - */ -static inline uint8_t FREQME_GetReferenceClkScaleValue(FREQME_Type *base) -{ - return (uint8_t)(base->CTRLSTAT & FREQME_CTRLSTAT_REF_SCALE_MASK); -} - -/*! @} */ - -/*! - * @name Pulse Width Measurement Mode Control APIs - * @{ - */ - -/*! - * @brief Set pulse polarity when operate mode is selected as Pulse Width Measurement mode. - * - * @param base FREQME peripheral base address. - * @param pulsePolarity The pulse polarity to be set, please refer to @ref freqme_pulse_polarity_t. - */ -static inline void FREQME_SetPulsePolarity(FREQME_Type *base, freqme_pulse_polarity_t pulsePolarity) -{ - uint32_t tmp32; - - tmp32 = base->CTRLSTAT; - tmp32 &= ~(FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_PULSE_POL_MASK | - FREQME_CTRLSTAT_GT_MAX_STAT_MASK | FREQME_CTRLSTAT_RESULT_READY_STAT_MASK); - - if (pulsePolarity != kFREQME_PulseHighPeriod) - { - tmp32 |= FREQME_CTRL_W_PULSE_POL_MASK; - } - - base->CTRL_W = tmp32; -} - -/*! - * @brief Check pulse polarity when the operate mode is selected as pulse width measurement mode. - * - * @param base FREQME peripheral base address. - * @retval True Low period. - * @retval False High period. - */ -static inline bool FREQME_CheckPulsePolarity(FREQME_Type *base) -{ - return (bool)((base->CTRLSTAT & FREQME_CTRLSTAT_PULSE_POL_MASK) != 0UL); -} - -/*! - * @brief Get measurement result, if operate mode is selected as pulse width measurement mode this function can - * be used to calculate pulse width. - * - * @note Pulse width = counter result / Frequency of target clock. - * - * @param base FREQME peripheral base address. - * @return Measurement result. - */ -static inline uint32_t FREQME_GetMeasurementResult(FREQME_Type *base) -{ - return base->CTRL_R & FREQME_CTRL_R_RESULT_MASK; -} - -/*! @} */ - -/*! - * @name Status Control APIs - * @{ - */ - -/*! - * @brief Get interrupt status flags, such as overflow interrupt status flag, - * underflow interrupt status flag, and so on. - * - * @param base FREQME peripheral base address. - * @return Current interrupt status flags, should be the OR'ed value of @ref _freqme_interrupt_status_flags. - */ -static inline uint32_t FREQME_GetInterruptStatusFlags(FREQME_Type *base) -{ - return (base->CTRLSTAT & (uint32_t)kFREQME_AllInterruptStatusFlags); -} - -/*! - * @brief Clear interrupt status flags. - * - * @param base FREQME peripheral base address. - * @param statusFlags The combination of interrupt status flags to clear, - * should be the OR'ed value of @ref _freqme_interrupt_status_flags. - */ -static inline void FREQME_ClearInterruptStatusFlags(FREQME_Type *base, uint32_t statusFlags) -{ - base->CTRLSTAT |= statusFlags; -} - -/*! @} */ - -/*! - * @name Interrupt Control APIs - * @{ - */ - -/*! - * @brief Enable interrupts, such as result ready interrupt, overflow interrupt and so on. - * - * @param base FREQME peripheral base address. - * @param masks The mask of interrupts to enable, should be the OR'ed value of @ref _freqme_interrupt_enable. - */ -static inline void FREQME_EnableInterrupts(FREQME_Type *base, uint32_t masks) -{ - uint32_t tmp32; - - tmp32 = base->CTRLSTAT; - tmp32 &= ~(FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_LT_MIN_INT_EN_MASK | - FREQME_CTRLSTAT_GT_MAX_STAT_MASK | FREQME_CTRLSTAT_GT_MAX_INT_EN_MASK | - FREQME_CTRLSTAT_RESULT_READY_INT_EN_MASK | FREQME_CTRLSTAT_RESULT_READY_STAT_MASK); - - tmp32 |= masks; - base->CTRL_W = tmp32; -} - -/*! - * @brief Disable interrupts, such as result ready interrupt, overflow interrupt and so on. - * - * @param base FREQME peripheral base address. - * @param masks The mask of interrupts to disable, should be the OR'ed value of @ref _freqme_interrupt_enable. - */ -static inline void FREQME_DisableInterrupts(FREQME_Type *base, uint32_t masks) -{ - uint32_t tmp32; - - tmp32 = base->CTRLSTAT; - tmp32 &= ~(FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_GT_MAX_STAT_MASK | - FREQME_CTRLSTAT_RESULT_READY_STAT_MASK | masks); - - base->CTRL_W = tmp32; -} - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ -#endif /* FSL_FREQME_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_glikey.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_glikey.c deleted file mode 100644 index ee585b8077d..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_glikey.c +++ /dev/null @@ -1,403 +0,0 @@ -/* - * Copyright 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_common.h" -#include "fsl_glikey.h" - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.glikey" -#endif - -#define GLIKEY_SFR_LOCK 0x05u -#define GLIKEY_SFR_UNLOCK 0x0Au - -/* Define to select between write to CTRL0_WR_0 or CTRL1_WR_1 */ -#define WR_EN0 (0x0Fu) -#define WR_EN1 (0xF0u) - -#define WR_EN0_VALUE_SHIFT (0u) -#define WR_EN1_VALUE_SHIFT (16u) - -#define CTRL_SEL_CODEWORD_SHIFT (24u) - -#define WR_0_INIT (0x2u) -#define WR_1_INIT (0x0u) - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -static inline void Glikey_Internal_Set_WR_0(GLIKEY_Type *base, uint32_t value); -static inline void Glikey_Internal_Set_WR_1(GLIKEY_Type *base, uint32_t value); -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * Weak implementation of GLIKEY IRQ, should be re-defined by user when using GLIKEY IRQ - -__WEAK void GLIKEY0_DriverIRQHandler(void) -{ - GLIKEY generates IRQ until corresponding bit in STATUS is cleared by calling - GLIKEY_ClearStatusFlags(); -} -*/ - -static inline void Glikey_Internal_Set_WR_0(GLIKEY_Type *base, uint32_t value) -{ - uint32_t ctrl0 = ((GLIKEY_Type *)base)->CTRL_0; - - /* Clear WR_0 */ - ctrl0 = ctrl0 & (~GLIKEY_CTRL_0_WR_EN_0_MASK); - - /* Assign value */ - ((GLIKEY_Type *)base)->CTRL_0 = ctrl0 | GLIKEY_CTRL_0_WR_EN_0(value); -} - -static inline void Glikey_Internal_Set_WR_1(GLIKEY_Type *base, uint32_t value) -{ - uint32_t ctrl1 = ((GLIKEY_Type *)base)->CTRL_1; - - /* Clear WR_1 */ - ctrl1 = ctrl1 & (~GLIKEY_CTRL_1_WR_EN_1_MASK); - - /* Assign value */ - ((GLIKEY_Type *)base)->CTRL_1 = ctrl1 | GLIKEY_CTRL_1_WR_EN_1(value); -} - -uint32_t GLIKEY_GetStatus(GLIKEY_Type *base) -{ - return ((GLIKEY_Type *)base)->STATUS; -} - -status_t GLIKEY_IsLocked(GLIKEY_Type *base) -{ - status_t retCode = GLIKEY_CheckLock(base); - if (kStatus_GLIKEY_NotLocked == retCode) - { - return kStatus_GLIKEY_NotLocked; - } - else - { - return kStatus_GLIKEY_Locked; - } -} - -status_t GLIKEY_CheckLock(GLIKEY_Type *base) -{ - uint32_t sfrLock = (((GLIKEY_Type *)base)->CTRL_1 & GLIKEY_CTRL_1_SFR_LOCK_MASK) >> GLIKEY_CTRL_1_SFR_LOCK_SHIFT; - - if (GLIKEY_SFR_UNLOCK != sfrLock) /* Locked */ - { - return kStatus_GLIKEY_LockedError; - } - - return kStatus_GLIKEY_NotLocked; -} - -#if defined(GLIKEY_VERSION_FSM_CONFIG) -status_t GLIKEY_GetVersion(GLIKEY_Type *base, uint32_t *result) -{ - *result = ((GLIKEY_Type *)base)->VERSION; - - return kStatus_Success; -} -#endif - -status_t GLIKEY_SyncReset(GLIKEY_Type *base) -{ - status_t retCode = GLIKEY_CheckLock(base); - if (kStatus_GLIKEY_NotLocked != retCode) - { - return retCode; - } - - /* Set CTRL_0.SFT_RST = 1 */ - ((GLIKEY_Type *)base)->CTRL_0 |= GLIKEY_CTRL_0_SFT_RST_MASK; - - return kStatus_Success; -} - -status_t GLIKEY_SetIntEnable(GLIKEY_Type *base, uint32_t value) -{ - status_t retCode = GLIKEY_CheckLock(base); - if (kStatus_GLIKEY_NotLocked != retCode) - { - return retCode; - } - - ((GLIKEY_Type *)base)->INTR_CTRL = GLIKEY_INTR_CTRL_INT_EN(value); - - return kStatus_Success; -} - -status_t GLIKEY_GetIntEnable(GLIKEY_Type *base, uint32_t *value) -{ - *value = ((GLIKEY_Type *)base)->INTR_CTRL & GLIKEY_INTR_CTRL_INT_EN_MASK; - - return kStatus_Success; -} - -status_t GLIKEY_ClearIntStatus(GLIKEY_Type *base) -{ - status_t retCode = GLIKEY_CheckLock(base); - if (kStatus_GLIKEY_NotLocked != retCode) - { - return retCode; - } - - ((GLIKEY_Type *)base)->INTR_CTRL |= GLIKEY_INTR_CTRL_INT_CLR_MASK; - - return kStatus_Success; -} - -status_t GLIKEY_SetIntStatus(GLIKEY_Type *base) -{ - status_t retCode = GLIKEY_CheckLock(base); - if (kStatus_GLIKEY_NotLocked != retCode) - { - return retCode; - } - - ((GLIKEY_Type *)base)->INTR_CTRL |= GLIKEY_INTR_CTRL_INT_SET_MASK; - - return kStatus_Success; -} - -status_t GLIKEY_Lock(GLIKEY_Type *base) -{ - /* Check if SFR_LOCK is locked */ - status_t retCode = GLIKEY_CheckLock(base); - if (kStatus_GLIKEY_NotLocked != retCode) /* Glikey is not locked -> lock */ - { - uint32_t ctrl1 = ((GLIKEY_Type *)base)->CTRL_1; - /* Clear SFR_LOCK */ - ctrl1 = ctrl1 & (~GLIKEY_CTRL_1_SFR_LOCK_MASK); - /* Lock Gliekey */ - ((GLIKEY_Type *)base)->CTRL_1 = ctrl1 | GLIKEY_CTRL_1_SFR_LOCK(GLIKEY_SFR_LOCK); - } - - return kStatus_Success; -} - -status_t GLIKEY_IsIndexLocked(GLIKEY_Type *base, uint32_t index) -{ - /* Set CTRL_1.READ_INDEX = index */ - uint32_t ctr1Val = ((GLIKEY_Type *)base)->CTRL_1; - /* Clear READ_INDEX */ - ctr1Val = ctr1Val & (~GLIKEY_CTRL_1_READ_INDEX_MASK); - /* Set index value */ - ((GLIKEY_Type *)base)->CTRL_1 = ctr1Val | GLIKEY_CTRL_1_READ_INDEX(index); - - /* Check ERROR_STATUS */ - if (0u != (GLIKEY_GetStatus(base) & GLIKEY_STATUS_ERROR_STATUS_MASK)) - { - return kStatus_Fail; - } - - /* Check if STATUS.LOCK_STATUS is 0 */ - if (0u == (GLIKEY_GetStatus(base) & GLIKEY_STATUS_LOCK_STATUS_MASK)) - { - return kStatus_GLIKEY_NotLocked; - } - else - { - return kStatus_GLIKEY_Locked; - } -} - -status_t GLIKEY_LockIndex(GLIKEY_Type *base) -{ - /* Check if Glikey SFR locked */ - status_t retCode = GLIKEY_CheckLock(base); - if (kStatus_GLIKEY_NotLocked != retCode) - { - return retCode; - } - - /* Check if FSM is in WR_EN state */ - uint32_t state = (GLIKEY_GetStatus(base) & GLIKEY_STATUS_FSM_STATE_MASK) >> GLIKEY_STATUS_FSM_STATE_SHIFT; - if (GLIKEY_FSM_WR_EN == state) - { - /* Set WR_EN0 = b11 */ - ((GLIKEY_Type *)base)->CTRL_0 |= GLIKEY_CTRL_0_WR_EN_0(0x3u); - return kStatus_GLIKEY_Locked; - } - else - { - return kStatus_GLIKEY_DisabledError; - } -} - -status_t GLIKEY_StartEnable(GLIKEY_Type *base, uint32_t index) -{ - /* Check if Glikey SFR locked */ - status_t retCode = GLIKEY_CheckLock(base); - if (kStatus_GLIKEY_NotLocked != retCode) - { - return retCode; - } - - /* Check if index is locked */ - retCode = GLIKEY_IsIndexLocked(base, index); - if (kStatus_GLIKEY_NotLocked != retCode) - { - return retCode; - } - - /* CTRL0 */ - uint32_t ctrl0 = ((GLIKEY_Type *)base)->CTRL_0; - /* Clear old index */ - ctrl0 = ctrl0 & (~GLIKEY_CTRL_0_WRITE_INDEX_MASK); - /* Clear old CTRL0.WR_EN_0 */ - ctrl0 = ctrl0 & (~GLIKEY_CTRL_0_WR_EN_0_MASK); - /* Set new index */ - ctrl0 |= GLIKEY_CTRL_0_WRITE_INDEX(index); - - /* Start the enable process by writting 0x01 to CTRL0.WR_EN_0 */ - ctrl0 = ctrl0 | ((uint32_t)0x01u << GLIKEY_CTRL_0_WR_EN_0_SHIFT); - - /* Write to CTRL0 (new index and WR_EN_0 = 0x01) */ - ((GLIKEY_Type *)base)->CTRL_0 = ctrl0; - - /* CTRL1 */ - uint32_t ctrl1 = ((GLIKEY_Type *)base)->CTRL_1; - /* Clear CTRL1.WR_EN_1 */ - ctrl1 &= ~GLIKEY_CTRL_1_WR_EN_1_MASK; - ((GLIKEY_Type*)base)->CTRL_1 = ctrl1; - - return kStatus_Success; -} - -status_t GLIKEY_ContinueEnable(GLIKEY_Type *base, uint32_t codeword) -{ - /* Check if Glikey SFR locked */ - status_t retCode = GLIKEY_CheckLock(base); - if (kStatus_GLIKEY_NotLocked != retCode) - { - return retCode; - } - - /* Set correctly we_en0 and wr_en1 according to codeword */ - /* Select between CTRL0/CTRL1 */ - if (WR_EN1 == (codeword >> CTRL_SEL_CODEWORD_SHIFT)) - { - Glikey_Internal_Set_WR_1(base, codeword >> WR_EN1_VALUE_SHIFT); - } - else if (WR_EN0 == (codeword >> CTRL_SEL_CODEWORD_SHIFT)) - { - Glikey_Internal_Set_WR_0(base, codeword >> WR_EN0_VALUE_SHIFT); - } - else - { - return kStatus_Fail; - } - - if (0u != (GLIKEY_GetStatus(base) & GLIKEY_STATUS_ERROR_STATUS_MASK)) - { - return kStatus_GLIKEY_DisabledError; - } - - /* Validate codeword - check if XXYZ^UUVW == 0xFFFF */ - if (0xFFFFu != (((codeword) ^ (codeword >> 16u)) & 0xFFFFu)) - { - return kStatus_Fail; - } - - return kStatus_Success; -} - -status_t GLIKEY_EndOperation(GLIKEY_Type *base) -{ - /* Check if Glikey SFR locked */ - status_t retCode = GLIKEY_CheckLock(base); - if (kStatus_GLIKEY_NotLocked != retCode) - { - return retCode; - } - - // check state - uint32_t state = (GLIKEY_GetStatus(base) & GLIKEY_STATUS_FSM_STATE_MASK) >> GLIKEY_STATUS_FSM_STATE_SHIFT; - - switch (state) - { - case GLIKEY_FSM_LOCKED: - { - /* If locked -> try to go to init with wr_en0 = WR_0_INIT (0x02); wr_en1 = WR_1_INIT (0x00) */ - Glikey_Internal_Set_WR_0(base, WR_0_INIT); - Glikey_Internal_Set_WR_1(base, WR_1_INIT); - - /* if still locked return locked - need to change index */ - if (GLIKEY_FSM_LOCKED == - (GLIKEY_GetStatus(base) & GLIKEY_STATUS_FSM_STATE_MASK) >> GLIKEY_STATUS_FSM_STATE_SHIFT) - { - return kStatus_GLIKEY_Locked; - } - - retCode = kStatus_Success; - break; - } - - case GLIKEY_FSM_SSR_RESET: - case GLIKEY_FSM_WR_EN: - { - /* If FSM in RESET -> wr_en0 = WR_0_INIT; wr_en1 = WR_1_INIT */ - /* If FSM in WR_EN -> wr_en0 = WR_0_INIT; wr_en1 = WR_1_INIT */ - Glikey_Internal_Set_WR_0(base, WR_0_INIT); - Glikey_Internal_Set_WR_1(base, WR_1_INIT); - - retCode = kStatus_Success; - break; - } - - default: - /* Disabled error */ - retCode = kStatus_GLIKEY_DisabledError; - break; - } - - return retCode; -} - -status_t GLIKEY_ResetIndex(GLIKEY_Type *base, uint32_t index) -{ - /* Check if Glikey SFR locked */ - status_t retCode = GLIKEY_CheckLock(base); - if (kStatus_GLIKEY_NotLocked != retCode) - { - return retCode; - } - - /* Check if index is locked */ - retCode = GLIKEY_IsIndexLocked(base, index); - if (kStatus_GLIKEY_NotLocked != retCode) - { - return retCode; - } - - /* Check if FSM is in INIT state */ - uint32_t state = (GLIKEY_GetStatus(base) & GLIKEY_STATUS_FSM_STATE_MASK) >> GLIKEY_STATUS_FSM_STATE_SHIFT; - if (GLIKEY_FSM_INIT == state) - { - /* CTRL0.WRITE_INDEX = index */ - uint32_t ctrl0 = ((GLIKEY_Type *)base)->CTRL_0; - /* Clear index */ - ctrl0 = ctrl0 & (~GLIKEY_CTRL_0_WRITE_INDEX_MASK); - /* Write new value */ - ((GLIKEY_Type *)base)->CTRL_0 = ctrl0 | GLIKEY_CTRL_0_WRITE_INDEX(index); - - return kStatus_Success; - } - else - { - return kStatus_GLIKEY_DisabledError; - } -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_glikey.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_glikey.h deleted file mode 100644 index 795d6d56ce9..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_glikey.h +++ /dev/null @@ -1,311 +0,0 @@ -/* - * Copyright 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef _FSL_GLIKEY_H_ -#define _FSL_GLIKEY_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup GLIKEY - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief Defines GLIKEY driver version 2.0.0. - * - * Change log: - * - Version 2.0.0 - * - Initial version - */ -#define FSL_GLIKEY_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) - -enum -{ - kStatus_GLIKEY_LockedError = - MAKE_STATUS(kStatusGroup_GLIKEY, 0x1u), /*!< GLIKEY status for locked SFR registers (unexpected) . */ - kStatus_GLIKEY_NotLocked = MAKE_STATUS(kStatusGroup_GLIKEY, 0x2u), /*!< GLIKEY status for unlocked SFR registers. */ - kStatus_GLIKEY_Locked = MAKE_STATUS(kStatusGroup_GLIKEY, 0x3u), /*!< GLIKEY status for locked SFR registers. */ - kStatus_GLIKEY_DisabledError = MAKE_STATUS(kStatusGroup_GLIKEY, 0x4u), /*!< GLIKEY status for disabled error. */ -}; - -/* [Design] - Value: XX YZ UU VW - - XX: F0: write to WR_EN1, 0F: do not write to WR_EN1 - - UU: F0: write to WR_EN0, 0F: do not write to WR_EN0 - - Y: equal to ^ W - - Z: value to write to WR_EN1 or equal to ~W - - V: equal to ^ Z - - W: value to write to WR_EN0 or equal to ~Z - Invariant: XXYZ ^ UUVW == 0xFFFF -*/ -#define GLIKEY_CODEWORD_STEP1 ((uint32_t)0xF0C10F3EU) /*< Codeword for transition from STEP1 --> STEP2 */ -#define GLIKEY_CODEWORD_STEP2 ((uint32_t)0x0F1DF0E2U) /*< Codeword for transition from STEP2 --> STEP3 */ -#define GLIKEY_CODEWORD_STEP3 ((uint32_t)0xF0B00F4FU) /*< Codeword for transition from STEP3 --> STEP4 */ -#define GLIKEY_CODEWORD_STEP4 ((uint32_t)0x0F4EF0B1U) /*< Codeword for transition from STEP4 --> STEP5 */ -#define GLIKEY_CODEWORD_STEP5 ((uint32_t)0xF0810F7EU) /*< Codeword for transition from STEP5 --> STEP6 */ -#define GLIKEY_CODEWORD_STEP6 ((uint32_t)0x0F5DF0A2U) /*< Codeword for transition from STEP6 --> STEP7 */ -#define GLIKEY_CODEWORD_STEP7 ((uint32_t)0xF0700F8FU) /*< Codeword for transition from STEP7 --> STEP8 */ -#define GLIKEY_CODEWORD_STEP_EN ((uint32_t)0x0FFFF000U) /*< Codeword for transition from STEP 4/8 --> WR_EN */ - -#define GLIKEY_FSM_WR_DIS 0x0Bu -#define GLIKEY_FSM_INIT 0x16u -#define GLIKEY_FSM_STEP1 0x2Cu -#define GLIKEY_FSM_STEP2 0x58u -#define GLIKEY_FSM_STEP3 0xB0u -#define GLIKEY_FSM_STEP4 0x160u -#define GLIKEY_FSM_LOCKED 0xC01u -#define GLIKEY_FSM_WR_EN 0x1802u -#define GLIKEY_FSM_SSR_RESET 0x1005u - -/*@}*/ - -/******************************************************************************* - * API - *******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name GLIKEY Functional Operation - * @{ - */ - -/*! - * @brief Retreives the current status of Glikey. - * - * @param[in] base The base address of the Glikey instance - * - * @return Glikey status information - */ -uint32_t GLIKEY_GetStatus(GLIKEY_Type *base); - -/*! - * @brief Get if Glikey is locked - * - * This operation returns the locking status of Glikey. - * - * @return Status - * @retval kStatus_GLIKEY_Locked if locked - * @retval kStatus_GLIKEY_NotLocked if unlocked - */ -status_t GLIKEY_IsLocked(GLIKEY_Type *base); - -/*! - * @brief Check if Glikey is locked - * - * This operation returns the locking status of Glikey. - * - * @return Status kStatus_Success if success - * @retval kStatus_GLIKEY_LockedError if locked - * @retval kStatus_GLIKEY_NotLocked if unlocked - */ -status_t GLIKEY_CheckLock(GLIKEY_Type *base); - -/*! - * @brief Retreives the version and configuration of Glikey. - * - * - * @param[in] base The base address of the Glikey instance - * @param[out] result Pointer which will be filled with the Glikey hardware version - * - * @return Status kStatus_Success if success - */ -status_t GLIKEY_GetVersion(GLIKEY_Type *base, uint32_t *result); - -/*! - * @brief Perform a synchronous reset of Glikey. - * - * This function performs a synchrounous reset of the Glikey. This results in: - * - Glikey will return to the INIT state, unless it is in the LOCK state - * - * @param[in] base The base address of the Glikey instance - * - * @return Status kStatus_Success if success - * Possible errors: kStatus_GLIKEY_LockedError - */ -status_t GLIKEY_SyncReset(GLIKEY_Type *base); - -/*! - * @brief Set interrupt enable flag of Glikey. - * - * @param[in] base The base address of the Glikey instance - * @param[in] value Value to set the interrupt enable flag to, see #[TODO: add reference to constants] - * - * @return Status kStatus_Success if success - * Possible errors: kStatus_GLIKEY_LockedError - */ -status_t GLIKEY_SetIntEnable(GLIKEY_Type *base, uint32_t value); - -/*! - * @brief Get interrupt enable flag of Glikey. - * - * @param[in] base The base address of the Glikey instance - * @param[out] value Pointer which will be filled with the interrupt enable status, see #[TODO: add reference to - * constants] - * - * @return Status kStatus_Success if success - */ -status_t GLIKEY_GetIntEnable(GLIKEY_Type *base, uint32_t *value); - -/*! - * @brief Clear the interrupt status flag of Glikey. - * - * @param[in] base The base address of the Glikey instance - * - * @return Status kStatus_Success if success - * Possible errors: kStatus_GLIKEY_LockedError - */ -status_t GLIKEY_ClearIntStatus(GLIKEY_Type *base); - -/*! - * @brief Set the interrupt status flag of Glikey. - * - * @param[in] base The base address of the Glikey instance - * - * @return Status kStatus_Success if success - * Possible errors: kStatus_GLIKEY_LockedError - */ -status_t GLIKEY_SetIntStatus(GLIKEY_Type *base); - -/*! - * @brief Lock Glikey SFR (Special Function Registers) interface - * - * This operation locks the Glikey SFR interface if it is not locked yet. - * - * @param[in] base The base address of the Glikey instance - * - * @return Status kStatus_Success if success - */ -status_t GLIKEY_Lock(GLIKEY_Type *base); - -/*! - * @brief Lock Glikey index - * - * This operation is used to lock a Glikey index. It can only be executed from the WR_EN state, - * executing it from any other state will result in Glikey entering WR_DIS state. When this happens - * Glikey requires a reset (synchrous or asynchronous) to go back to INIT state. - * If the Glikey SFR lock is active this operation will return an error. - * - * @param[in] base The base address of the Glikey instance - * - * @return Status kStatus_Success if success - * Possible errors: kStatus_GLIKEY_LockedError, kStatus_GLIKEY_DisabledError - */ -status_t GLIKEY_LockIndex(GLIKEY_Type *base); - -/*! - * @brief Check if Glikey index is locked - * - * This operation returns the locking status of Glikey index. - * - * @param[in] base The base address of the Glikey instance - * @param[in] index The index of the Glikey instance - * - * @return kStatus_GLIKEY_Locked if locked, kStatus_GLIKEY_NotLocked if unlocked - * Possible errors: kStatus_Fail - */ -status_t GLIKEY_IsIndexLocked(GLIKEY_Type *base, uint32_t index); - -/** - * @brief Start Glikey enable - * - * This operation is used to set a new index and start a the sequence to enable it. It needs to be - * started from the INIT state. If the new index is already locked Glikey will go to LOCKED state, - * otherwise it will go to STEP1 state. - * If this operation is used when Glikey is in any state other than INIT Glikey will go to WR_DIS - * state. It can only recover from this state through a reset (synchrounous or asyncrhonous). - * If the Glikey SFR lock is active this operation will return an error. - * - * @param[in] base The base address of the Glikey instance - * @param[in] index The index of the Glikey instance - * - * @return Status kStatus_Success if success - * Possible errors: kStatus_GLIKEY_LockedError, kStatus_Fail - */ -status_t GLIKEY_StartEnable(GLIKEY_Type *base, uint32_t index); - -/** - * @brief Continue Glikey enable - * - * This operation is used to progress through the different states of the state machine, starting - * from STEP1 until the state WR_EN is reached. Each next state of the state machine can only be - * reached by providing the right codeword to this function. If anything goes wrong the state machine - * will go to WR_DIS state and can only recover from it through a reset (synchrous or asynchronous). - * If the Glikey SFR lock is active this operation will return an error. - * - * @param[in] base The base address of the Glikey instance - * @param[in] codeword Encoded word for progressing to next FSM state (see GLIKEY_CODEWORD_STEPx/EN) - * - * @return Status kStatus_Success if success - * Possible errors: kStatus_GLIKEY_LockedError, kStatus_Fail, kStatus_GLIKEY_DisabledError - */ -/* [Design] - - Check if Glikey is locked - if ( GLIKEY_LOCKED == GLIKEY_GET_SFR_LOCK(base) ) return NXPCLGLIKEY_STATUS_LOCKED_ERROR - - Decode the codeword and write to Glikey CTRL[] - Write GLIKEY_CTRL(base, EnableSelect, EnableValue) - - Check if an error occured - - the only possible error here is FSM error which results in a transition to WR_DIS state - - alternatively this can be confirmed by checking FSM state value - - Only now we will check if the codeword itself is valid - - this is done in this order to assure that the state machine reaches WR_DIS state when needed - - check if XXYZ^UUVW == 0xFFFF and return kStatus_Fail when it fails - - Return kStatus_Success -*/ -status_t GLIKEY_ContinueEnable(GLIKEY_Type *base, uint32_t codeword); - -/** - * @brief End Glikey operation - * - * This operation is used to end a Glikey operation. It can only be executed from the WR_EN, LOCKED - * and RESET states. Executing it from any other state will result in Glikey entering WR_DIS state. - * When this happens Glikey requires a reset (synchrous or asynchronous) to go back to INIT state. - * After this operation Glikey will go to INIT state or stay in LOCKED state when the index was locked. - * If the Glikey SFR lock is active this operation will return an error. - * - * @return A code-flow protected error code (see @ref nxpCsslFlowProtection) - * - * @param[in] base The base address of the Glikey instance - * - * @return Status kStatus_Success if success, kStatus_GLIKEY_Locked if index is still locked - * Possible errors: kStatus_GLIKEY_LockedError, kStatus_GLIKEY_DisabledError - */ -status_t GLIKEY_EndOperation(GLIKEY_Type *base); - -/** - * @brief Reset Glikey index - * - * This operation is used to reset a Glikey index. It can only be executed from the INIT state, - * executing it from any other state will result in Glikey entering WR_DIS state. When this happens - * Glikey requires a reset (synchrous or asynchronous) to go back to INIT state. - * If the Glikey SFR lock is active or the index is locked this operation will return an error. - * - * @return A code-flow protected error code (see @ref nxpCsslFlowProtection) - * - * @return Status kStatus_Success if success, kStatus_GLIKEY_Locked if index is still locked - * Possible errors: kStatus_GLIKEY_LockedError, kStatus_GLIKEY_DisabledError - */ -status_t GLIKEY_ResetIndex(GLIKEY_Type *base, uint32_t index); - -/*! @}*/ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @}*/ /* end of group glikey */ - -#endif /* _FSL_GLIKEY_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_gpio.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_gpio.c deleted file mode 100644 index 3e32730d1cd..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_gpio.c +++ /dev/null @@ -1,444 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2019, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_gpio.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.gpio" -#endif - -#if defined(GPIO_RSTS) -#define GPIO_RESETS_ARRAY GPIO_RSTS -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ - -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -static PORT_Type *const s_portBases[] = PORT_BASE_PTRS; -static GPIO_Type *const s_gpioBases[] = GPIO_BASE_PTRS; -#else -#if defined(GPIO_RESETS_ARRAY) -static GPIO_Type *const s_gpioBases[] = GPIO_BASE_PTRS; -#endif -#endif - -#if defined(FSL_FEATURE_SOC_FGPIO_COUNT) && FSL_FEATURE_SOC_FGPIO_COUNT - -#if defined(FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL) && FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Array to map FGPIO instance number to clock name. */ -static const clock_ip_name_t s_fgpioClockName[] = FGPIO_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#endif /* FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL */ - -#endif /* FSL_FEATURE_SOC_FGPIO_COUNT */ - -#if defined(GPIO_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_gpioResets[] = GPIO_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -/*! - * @brief Gets the GPIO instance according to the GPIO base - * - * @param base GPIO peripheral base pointer(PTA, PTB, PTC, etc.) - * @retval GPIO instance - */ -static uint32_t GPIO_GetInstance(GPIO_Type *base); -#endif -/******************************************************************************* - * Code - ******************************************************************************/ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) || defined(GPIO_RESETS_ARRAY) -static uint32_t GPIO_GetInstance(GPIO_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_gpioBases); instance++) - { - if (s_gpioBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_gpioBases)); - - return instance; -} -#endif -/*! - * brief Initializes a GPIO pin used by the board. - * - * To initialize the GPIO, define a pin configuration, as either input or output, in the user file. - * Then, call the GPIO_PinInit() function. - * - * This is an example to define an input pin or an output pin configuration. - * code - * Define a digital input pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalInput, - * 0, - * } - * Define a digital output pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalOutput, - * 0, - * } - * endcode - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * param pin GPIO port pin number - * param config GPIO pin configuration pointer - */ -void GPIO_PinInit(GPIO_Type *base, uint32_t pin, const gpio_pin_config_t *config) -{ - assert(NULL != config); - -#if defined(GPIO_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_gpioResets[GPIO_GetInstance(base)]); -#endif - - if (config->pinDirection == kGPIO_DigitalInput) - { - base->PDDR &= GPIO_FIT_REG(~(1UL << pin)); - } - else - { - GPIO_PinWrite(base, pin, config->outputLogic); - base->PDDR |= GPIO_FIT_REG((1UL << pin)); - } -} - -#if defined(FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER) && FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER -void GPIO_GetVersionInfo(GPIO_Type *base, gpio_version_info_t *info) -{ - info->feature = (uint16_t)base->VERID; - info->minor = (uint8_t)(base->VERID >> GPIO_VERID_MINOR_SHIFT); - info->major = (uint8_t)(base->VERID >> GPIO_VERID_MAJOR_SHIFT); -} -#endif /* FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER */ - -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -/*! - * brief Reads the GPIO port interrupt status flag. - * - * If a pin is configured to generate the DMA request, the corresponding flag - * is cleared automatically at the completion of the requested DMA transfer. - * Otherwise, the flag remains set until a logic one is written to that flag. - * If configured for a level sensitive interrupt that remains asserted, the flag - * is set again immediately. - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * retval The current GPIO port interrupt status flag, for example, 0x00010001 means the - * pin 0 and 17 have the interrupt. - */ -uint32_t GPIO_PortGetInterruptFlags(GPIO_Type *base) -{ - uint8_t instance; - PORT_Type *portBase; - instance = (uint8_t)GPIO_GetInstance(base); - portBase = s_portBases[instance]; - return portBase->ISFR; -} -#else -/*! - * brief Read the GPIO interrupt status flags. - * - * param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on.) - * return The current GPIO's interrupt status flag. - * '1' means the related pin's flag is set, '0' means the related pin's flag not set. - * For example, the return value 0x00010001 means the pin 0 and 17 have the interrupt pending. - */ -uint32_t GPIO_GpioGetInterruptFlags(GPIO_Type *base) -{ - return base->ISFR[0]; -} -#if (defined(FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) && FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) -/*! - * brief Read the GPIO interrupt status flags based on selected interrupt channel(IRQS). - * param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on.) - * param channel '0' means selete interrupt channel 0, '1' means selete interrupt channel 1. - * - * return The current GPIO's interrupt status flag based on the selected interrupt channel. - * '1' means the related pin's flag is set, '0' means the related pin's flag not set. - * For example, the return value 0x00010001 means the pin 0 and 17 have the interrupt pending. - */ -uint32_t GPIO_GpioGetInterruptChannelFlags(GPIO_Type *base, uint32_t channel) -{ - assert(channel < 2U); - return base->ISFR[channel]; -} -#endif /* FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT */ -/*! - * brief Read individual pin's interrupt status flag. - * - * param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on) - * param pin GPIO specific pin number. - * return The current selected pin's interrupt status flag. - */ -uint8_t GPIO_PinGetInterruptFlag(GPIO_Type *base, uint32_t pin) -{ - return (uint8_t)((base->ICR[pin] & GPIO_ICR_ISF_MASK) >> GPIO_ICR_ISF_SHIFT); -} -#endif /* FSL_FEATURE_PORT_HAS_NO_INTERRUPT */ - -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -/*! - * brief Clears multiple GPIO pin interrupt status flags. - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * param mask GPIO pin number macro - */ -void GPIO_PortClearInterruptFlags(GPIO_Type *base, uint32_t mask) -{ - uint8_t instance; - PORT_Type *portBase; - instance = (uint8_t)GPIO_GetInstance(base); - portBase = s_portBases[instance]; - portBase->ISFR = mask; -} -#else -/*! - * brief Clears GPIO pin interrupt status flags. - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * param mask GPIO pin number macro - */ -void GPIO_GpioClearInterruptFlags(GPIO_Type *base, uint32_t mask) -{ - base->ISFR[0] = GPIO_FIT_REG(mask); -} -#if (defined(FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) && FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) -/*! - * brief Clears GPIO pin interrupt status flags based on selected interrupt channel(IRQS). - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * param mask GPIO pin number macro - * param channel '0' means selete interrupt channel 0, '1' means selete interrupt channel 1. - */ -void GPIO_GpioClearInterruptChannelFlags(GPIO_Type *base, uint32_t mask, uint32_t channel) -{ - assert(channel < 2U); - base->ISFR[channel] = GPIO_FIT_REG(mask); -} -#endif /* FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT */ -/*! - * brief Clear GPIO individual pin's interrupt status flag. - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on). - * param pin GPIO specific pin number. - */ -void GPIO_PinClearInterruptFlag(GPIO_Type *base, uint32_t pin) -{ - base->ICR[pin] |= GPIO_FIT_REG(GPIO_ICR_ISF(1U)); -} -#endif /* FSL_FEATURE_PORT_HAS_NO_INTERRUPT */ - -#if defined(FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER) && FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER -/*! - * brief The GPIO module supports a device-specific number of data ports, organized as 32-bit - * words/8-bit Bytes. Each 32-bit/8-bit data port includes a GACR register, which defines the byte-level - * attributes required for a successful access to the GPIO programming model. If the GPIO module's GACR register - * organized as 32-bit words, the attribute controls for the 4 data bytes in the GACR follow a standard little - * endian data convention. - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * param attribute GPIO checker attribute - */ -void GPIO_CheckAttributeBytes(GPIO_Type *base, gpio_checker_attribute_t attribute) -{ -#if defined(FSL_FEATURE_GPIO_REGISTERS_WIDTH) && (FSL_FEATURE_GPIO_REGISTERS_WIDTH == 8U) - base->GACR = ((uint8_t)attribute << GPIO_GACR_ACB_SHIFT); -#else - base->GACR = ((uint32_t)attribute << GPIO_GACR_ACB0_SHIFT) | ((uint32_t)attribute << GPIO_GACR_ACB1_SHIFT) | - ((uint32_t)attribute << GPIO_GACR_ACB2_SHIFT) | ((uint32_t)attribute << GPIO_GACR_ACB3_SHIFT); -#endif /* FSL_FEATURE_GPIO_REGISTERS_WIDTH */ -} -#endif - -#if defined(FSL_FEATURE_SOC_FGPIO_COUNT) && FSL_FEATURE_SOC_FGPIO_COUNT - -/******************************************************************************* - * Variables - ******************************************************************************/ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -static FGPIO_Type *const s_fgpioBases[] = FGPIO_BASE_PTRS; -#endif -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -/*! - * @brief Gets the FGPIO instance according to the GPIO base - * - * @param base FGPIO peripheral base pointer(PTA, PTB, PTC, etc.) - * @retval FGPIO instance - */ -static uint32_t FGPIO_GetInstance(FGPIO_Type *base); -#endif -/******************************************************************************* - * Code - ******************************************************************************/ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -static uint32_t FGPIO_GetInstance(FGPIO_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_fgpioBases); instance++) - { - if (s_fgpioBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_fgpioBases)); - - return instance; -} -#endif -#if defined(FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL) && FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL -/*! - * brief Initializes the FGPIO peripheral. - * - * This function ungates the FGPIO clock. - * - * param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - */ -void FGPIO_PortInit(FGPIO_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate FGPIO periphral clock */ - CLOCK_EnableClock(s_fgpioClockName[FGPIO_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} -#endif /* FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL */ - -/*! - * brief Initializes a FGPIO pin used by the board. - * - * To initialize the FGPIO driver, define a pin configuration, as either input or output, in the user file. - * Then, call the FGPIO_PinInit() function. - * - * This is an example to define an input pin or an output pin configuration: - * code - * Define a digital input pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalInput, - * 0, - * } - * Define a digital output pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalOutput, - * 0, - * } - * endcode - * - * param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * param pin FGPIO port pin number - * param config FGPIO pin configuration pointer - */ -void FGPIO_PinInit(FGPIO_Type *base, uint32_t pin, const gpio_pin_config_t *config) -{ - assert(NULL != config); - - if (config->pinDirection == kGPIO_DigitalInput) - { - base->PDDR &= ~(1UL << pin); - } - else - { - FGPIO_PinWrite(base, pin, config->outputLogic); - base->PDDR |= (1UL << pin); - } -} -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -/*! - * brief Reads the FGPIO port interrupt status flag. - * - * If a pin is configured to generate the DMA request, the corresponding flag - * is cleared automatically at the completion of the requested DMA transfer. - * Otherwise, the flag remains set until a logic one is written to that flag. - * If configured for a level-sensitive interrupt that remains asserted, the flag - * is set again immediately. - * - * param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * retval The current FGPIO port interrupt status flags, for example, 0x00010001 means the - * pin 0 and 17 have the interrupt. - */ -uint32_t FGPIO_PortGetInterruptFlags(FGPIO_Type *base) -{ - uint8_t instance; - instance = (uint8_t)FGPIO_GetInstance(base); - PORT_Type *portBase; - portBase = s_portBases[instance]; - return portBase->ISFR; -} - -/*! - * brief Clears the multiple FGPIO pin interrupt status flag. - * - * param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * param mask FGPIO pin number macro - */ -void FGPIO_PortClearInterruptFlags(FGPIO_Type *base, uint32_t mask) -{ - uint8_t instance; - instance = (uint8_t)FGPIO_GetInstance(base); - PORT_Type *portBase; - portBase = s_portBases[instance]; - portBase->ISFR = mask; -} -#endif -#if defined(FSL_FEATURE_FGPIO_HAS_ATTRIBUTE_CHECKER) && FSL_FEATURE_FGPIO_HAS_ATTRIBUTE_CHECKER -/*! - * brief The FGPIO module supports a device-specific number of data ports, organized as 32-bit - * words. Each 32-bit data port includes a GACR register, which defines the byte-level - * attributes required for a successful access to the GPIO programming model. The attribute controls for the 4 data - * bytes in the GACR follow a standard little endian - * data convention. - * - * param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * param attribute FGPIO checker attribute - */ -void FGPIO_CheckAttributeBytes(FGPIO_Type *base, gpio_checker_attribute_t attribute) -{ - base->GACR = ((uint32_t)attribute << FGPIO_GACR_ACB0_SHIFT) | ((uint32_t)attribute << FGPIO_GACR_ACB1_SHIFT) | - ((uint32_t)attribute << FGPIO_GACR_ACB2_SHIFT) | ((uint32_t)attribute << FGPIO_GACR_ACB3_SHIFT); -} -#endif - -#endif /* FSL_FEATURE_SOC_FGPIO_COUNT */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_gpio.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_gpio.h deleted file mode 100644 index a91fa403efd..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_gpio.h +++ /dev/null @@ -1,799 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_GPIO_H_ -#define FSL_GPIO_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup gpio - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief GPIO driver version. */ -#define FSL_GPIO_DRIVER_VERSION (MAKE_VERSION(2, 7, 3)) -/*! @} */ - -#if defined(FSL_FEATURE_GPIO_REGISTERS_WIDTH) && (FSL_FEATURE_GPIO_REGISTERS_WIDTH == 8U) -#define GPIO_FIT_REG(value) \ - ((uint8_t)(value)) /*!< For some platforms with 8-bit register width, cast the type to uint8_t */ -#else -#define GPIO_FIT_REG(value) ((uint32_t)(value)) -#endif /*FSL_FEATURE_GPIO_REGISTERS_WIDTH*/ - -/*! @brief GPIO direction definition */ -typedef enum _gpio_pin_direction -{ - kGPIO_DigitalInput = 0U, /*!< Set current pin as digital input*/ - kGPIO_DigitalOutput = 1U, /*!< Set current pin as digital output*/ -} gpio_pin_direction_t; - -#if defined(FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER) && FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER -/*! @brief GPIO checker attribute */ -typedef enum _gpio_checker_attribute -{ - kGPIO_UsernonsecureRWUsersecureRWPrivilegedsecureRW = - 0x00U, /*!< User nonsecure:Read+Write; User Secure:Read+Write; Privileged Secure:Read+Write */ - kGPIO_UsernonsecureRUsersecureRWPrivilegedsecureRW = - 0x01U, /*!< User nonsecure:Read; User Secure:Read+Write; Privileged Secure:Read+Write */ - kGPIO_UsernonsecureNUsersecureRWPrivilegedsecureRW = - 0x02U, /*!< User nonsecure:None; User Secure:Read+Write; Privileged Secure:Read+Write */ - kGPIO_UsernonsecureRUsersecureRPrivilegedsecureRW = - 0x03U, /*!< User nonsecure:Read; User Secure:Read; Privileged Secure:Read+Write */ - kGPIO_UsernonsecureNUsersecureRPrivilegedsecureRW = - 0x04U, /*!< User nonsecure:None; User Secure:Read; Privileged Secure:Read+Write */ - kGPIO_UsernonsecureNUsersecureNPrivilegedsecureRW = - 0x05U, /*!< User nonsecure:None; User Secure:None; Privileged Secure:Read+Write */ - kGPIO_UsernonsecureNUsersecureNPrivilegedsecureR = - 0x06U, /*!< User nonsecure:None; User Secure:None; Privileged Secure:Read */ - kGPIO_UsernonsecureNUsersecureNPrivilegedsecureN = - 0x07U, /*!< User nonsecure:None; User Secure:None; Privileged Secure:None */ - kGPIO_IgnoreAttributeCheck = 0x80U, /*!< Ignores the attribute check */ -} gpio_checker_attribute_t; -#endif - -/*! - * @brief The GPIO pin configuration structure. - * - * Each pin can only be configured as either an output pin or an input pin at a time. - * If configured as an input pin, leave the outputConfig unused. - * Note that in some use cases, the corresponding port property should be configured in advance - * with the PORT_SetPinConfig(). - */ -typedef struct _gpio_pin_config -{ - gpio_pin_direction_t pinDirection; /*!< GPIO direction, input or output */ - /* Output configurations; ignore if configured as an input pin */ - uint8_t outputLogic; /*!< Set a default output logic, which has no use in input */ -} gpio_pin_config_t; - -#if (defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) || \ - !(defined(FSL_FEATURE_SOC_PORT_COUNT)) -/*! @brief Configures the interrupt generation condition. */ -typedef enum _gpio_interrupt_config -{ - kGPIO_InterruptStatusFlagDisabled = 0x0U, /*!< Interrupt status flag is disabled. */ - kGPIO_DMARisingEdge = 0x1U, /*!< ISF flag and DMA request on rising edge. */ - kGPIO_DMAFallingEdge = 0x2U, /*!< ISF flag and DMA request on falling edge. */ - kGPIO_DMAEitherEdge = 0x3U, /*!< ISF flag and DMA request on either edge. */ - kGPIO_FlagRisingEdge = 0x05U, /*!< Flag sets on rising edge. */ - kGPIO_FlagFallingEdge = 0x06U, /*!< Flag sets on falling edge. */ - kGPIO_FlagEitherEdge = 0x07U, /*!< Flag sets on either edge. */ - kGPIO_InterruptLogicZero = 0x8U, /*!< Interrupt when logic zero. */ - kGPIO_InterruptRisingEdge = 0x9U, /*!< Interrupt on rising edge. */ - kGPIO_InterruptFallingEdge = 0xAU, /*!< Interrupt on falling edge. */ - kGPIO_InterruptEitherEdge = 0xBU, /*!< Interrupt on either edge. */ - kGPIO_InterruptLogicOne = 0xCU, /*!< Interrupt when logic one. */ - kGPIO_ActiveHighTriggerOutputEnable = 0xDU, /*!< Enable active high-trigger output. */ - kGPIO_ActiveLowTriggerOutputEnable = 0xEU, /*!< Enable active low-trigger output. */ -} gpio_interrupt_config_t; -#endif - -#if (defined(FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) && FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) -/*! @brief Configures the selection of interrupt/DMA request/trigger output. */ -typedef enum _gpio_interrupt_selection -{ - kGPIO_InterruptOutput0 = 0x0U, /*!< Interrupt/DMA request/trigger output 0. */ - kGPIO_InterruptOutput1 = 0x1U, /*!< Interrupt/DMA request/trigger output 1. */ -} gpio_interrupt_selection_t; -#endif /* FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT */ - -#if defined(FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER) && FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER -/*! @brief GPIO version information. */ -typedef struct _gpio_version_info -{ - uint16_t feature; /*!< Feature Specification Number. */ - uint8_t minor; /*!< Minor Version Number. */ - uint8_t major; /*!< Major Version Number. */ -} gpio_version_info_t; -#endif /* FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER */ - -#if defined(FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL) && FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL -/*! @brief GPIO pin and interrupt control. */ -typedef enum -{ - kGPIO_PinControlNonSecure = 0x01U, /*!< Pin Control Non-Secure. */ - kGPIO_InterruptControlNonSecure = 0x02U, /*!< Interrupt Control Non-Secure. */ - kGPIO_PinControlNonPrivilege = 0x04U, /*!< Pin Control Non-Privilege. */ - kGPIO_InterruptControlNonPrivilege = 0x08U, /*!< Interrupt Control Non-Privilege. */ -} gpio_pin_interrupt_control_t; -#endif /* FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL */ - -/*! @} */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @addtogroup gpio_driver - * @{ - */ - -/*! @name GPIO Configuration */ -/*! @{ */ - -/*! - * @brief Initializes a GPIO pin used by the board. - * - * To initialize the GPIO, define a pin configuration, as either input or output, in the user file. - * Then, call the GPIO_PinInit() function. - * - * This is an example to define an input pin or an output pin configuration. - * @code - * Define a digital input pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalInput, - * 0, - * } - * Define a digital output pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalOutput, - * 0, - * } - * @endcode - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param pin GPIO port pin number - * @param config GPIO pin configuration pointer - */ -void GPIO_PinInit(GPIO_Type *base, uint32_t pin, const gpio_pin_config_t *config); - -#if defined(FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER) && FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER -/*! - * @brief Get GPIO version information. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param info GPIO version information - */ -void GPIO_GetVersionInfo(GPIO_Type *base, gpio_version_info_t *info); -#endif /* FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER */ - -#if defined(FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL) && FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL -/*! - * @brief lock or unlock secure privilege. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask pin or interrupt macro - */ -static inline void GPIO_SecurePrivilegeLock(GPIO_Type *base, gpio_pin_interrupt_control_t mask) -{ - base->LOCK |= GPIO_FIT_REG(mask); -} - -/*! - * @brief Enable Pin Control Non-Secure. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_EnablePinControlNonSecure(GPIO_Type *base, uint32_t mask) -{ - base->PCNS |= GPIO_FIT_REG(mask); -} - -/*! - * @brief Disable Pin Control Non-Secure. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_DisablePinControlNonSecure(GPIO_Type *base, uint32_t mask) -{ - base->PCNS &= GPIO_FIT_REG(~mask); -} - -/*! - * @brief Enable Pin Control Non-Privilege. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_EnablePinControlNonPrivilege(GPIO_Type *base, uint32_t mask) -{ - base->PCNP |= GPIO_FIT_REG(mask); -} - -/*! - * @brief Disable Pin Control Non-Privilege. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_DisablePinControlNonPrivilege(GPIO_Type *base, uint32_t mask) -{ - base->PCNP &= GPIO_FIT_REG(~mask); -} - -/*! - * @brief Enable Interrupt Control Non-Secure. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_EnableInterruptControlNonSecure(GPIO_Type *base, uint32_t mask) -{ - base->ICNS |= GPIO_FIT_REG(mask); -} - -/*! - * @brief Disable Interrupt Control Non-Secure. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_DisableInterruptControlNonSecure(GPIO_Type *base, uint32_t mask) -{ - base->ICNS &= GPIO_FIT_REG(~mask); -} - -/*! - * @brief Enable Interrupt Control Non-Privilege. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_EnableInterruptControlNonPrivilege(GPIO_Type *base, uint32_t mask) -{ - base->ICNP |= GPIO_FIT_REG(mask); -} - -/*! - * @brief Disable Interrupt Control Non-Privilege. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_DisableInterruptControlNonPrivilege(GPIO_Type *base, uint32_t mask) -{ - base->ICNP &= GPIO_FIT_REG(~mask); -} -#endif /* FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL */ - -#if defined(FSL_FEATURE_GPIO_HAS_PORT_INPUT_CONTROL) && FSL_FEATURE_GPIO_HAS_PORT_INPUT_CONTROL -/*! - * @brief Enable port input. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_PortInputEnable(GPIO_Type *base, uint32_t mask) -{ - base->PIDR &= GPIO_FIT_REG(~mask); -} - -/*! - * @brief Disable port input. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_PortInputDisable(GPIO_Type *base, uint32_t mask) -{ - base->PIDR |= GPIO_FIT_REG(mask); -} -#endif /* FSL_FEATURE_GPIO_HAS_PORT_INPUT_CONTROL */ - -/*! @} */ - -/*! @name GPIO Output Operations */ -/*! @{ */ - -/*! - * @brief Sets the output level of the multiple GPIO pins to the logic 1 or 0. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param pin GPIO pin number - * @param output GPIO pin output logic level. - * - 0: corresponding pin output low-logic level. - * - 1: corresponding pin output high-logic level. - */ -static inline void GPIO_PinWrite(GPIO_Type *base, uint32_t pin, uint8_t output) -{ -#if !(defined(FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) && FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) - if (output == 0U) - { - base->PCOR = GPIO_FIT_REG(1UL << pin); - } - else - { - base->PSOR = GPIO_FIT_REG(1UL << pin); - } -#else - if (output == 0U) - { - base->PDOR |= GPIO_FIT_REG(1UL << pin); - } - else - { - base->PDOR &= ~GPIO_FIT_REG(1UL << pin); - } -#endif -} - -/*! - * @brief Sets the output level of the multiple GPIO pins to the logic 1. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_PortSet(GPIO_Type *base, uint32_t mask) -{ -#if !(defined(FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) && FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) - base->PSOR = GPIO_FIT_REG(mask); -#else - base->PDOR |= GPIO_FIT_REG(mask); -#endif -} - -/*! - * @brief Sets the output level of the multiple GPIO pins to the logic 0. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_PortClear(GPIO_Type *base, uint32_t mask) -{ -#if !(defined(FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) && FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) - base->PCOR = GPIO_FIT_REG(mask); -#else - base->PDOR &= ~GPIO_FIT_REG(mask); -#endif -} - -/*! - * @brief Reverses the current output logic of the multiple GPIO pins. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_PortToggle(GPIO_Type *base, uint32_t mask) -{ -#if !(defined(FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) && FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) - base->PTOR = GPIO_FIT_REG(mask); -#else - base->PDOR ^= GPIO_FIT_REG(mask); -#endif -} - -/*! @} */ - -/*! @name GPIO Input Operations */ -/*! @{ */ - -/*! - * @brief Reads the current input value of the GPIO port. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param pin GPIO pin number - * @retval GPIO port input value - * - 0: corresponding pin input low-logic level. - * - 1: corresponding pin input high-logic level. - */ -static inline uint32_t GPIO_PinRead(GPIO_Type *base, uint32_t pin) -{ - return (((uint32_t)(base->PDIR) >> pin) & 0x01UL); -} - -/*! @} */ - -/*! @name GPIO Interrupt */ -/*! @{ */ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -/*! - * @brief Reads the GPIO port interrupt status flag. - * - * If a pin is configured to generate the DMA request, the corresponding flag - * is cleared automatically at the completion of the requested DMA transfer. - * Otherwise, the flag remains set until a logic one is written to that flag. - * If configured for a level sensitive interrupt that remains asserted, the flag - * is set again immediately. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @retval The current GPIO port interrupt status flag, for example, 0x00010001 means the - * pin 0 and 17 have the interrupt. - */ -uint32_t GPIO_PortGetInterruptFlags(GPIO_Type *base); - -/*! - * @brief Clears multiple GPIO pin interrupt status flags. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -void GPIO_PortClearInterruptFlags(GPIO_Type *base, uint32_t mask); -#else -/*! - * @brief Configures the gpio pin interrupt/DMA request. - * - * @param base GPIO peripheral base pointer. - * @param pin GPIO pin number. - * @param config GPIO pin interrupt configuration. - * - #kGPIO_InterruptStatusFlagDisabled: Interrupt/DMA request disabled. - * - #kGPIO_DMARisingEdge : DMA request on rising edge(if the DMA requests exit). - * - #kGPIO_DMAFallingEdge: DMA request on falling edge(if the DMA requests exit). - * - #kGPIO_DMAEitherEdge : DMA request on either edge(if the DMA requests exit). - * - #kGPIO_FlagRisingEdge : Flag sets on rising edge(if the Flag states exit). - * - #kGPIO_FlagFallingEdge : Flag sets on falling edge(if the Flag states exit). - * - #kGPIO_FlagEitherEdge : Flag sets on either edge(if the Flag states exit). - * - #kGPIO_InterruptLogicZero : Interrupt when logic zero. - * - #kGPIO_InterruptRisingEdge : Interrupt on rising edge. - * - #kGPIO_InterruptFallingEdge: Interrupt on falling edge. - * - #kGPIO_InterruptEitherEdge : Interrupt on either edge. - * - #kGPIO_InterruptLogicOne : Interrupt when logic one. - * - #kGPIO_ActiveHighTriggerOutputEnable : Enable active high-trigger output (if the trigger states exit). - * - #kGPIO_ActiveLowTriggerOutputEnable : Enable active low-trigger output (if the trigger states exit). - */ -static inline void GPIO_SetPinInterruptConfig(GPIO_Type *base, uint32_t pin, gpio_interrupt_config_t config) -{ - assert(base); - - base->ICR[pin] = GPIO_FIT_REG((base->ICR[pin] & ~GPIO_ICR_IRQC_MASK) | GPIO_ICR_IRQC(config)); -} - -#if (defined(FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) && FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) -/*! - * @brief Configures the gpio pin interrupt/DMA request/trigger output channel selection. - * - * @param base GPIO peripheral base pointer. - * @param pin GPIO pin number. - * @param selection GPIO pin interrupt output selection. - * - #kGPIO_InterruptOutput0: Interrupt/DMA request/trigger output 0. - * - #kGPIO_InterruptOutput1 : Interrupt/DMA request/trigger output 1. - */ -static inline void GPIO_SetPinInterruptChannel(GPIO_Type *base, uint32_t pin, gpio_interrupt_selection_t selection) -{ - assert(base); - - base->ICR[pin] = GPIO_FIT_REG((base->ICR[pin] & ~GPIO_ICR_IRQS_MASK) | GPIO_ICR_IRQS(selection)); -} -#endif -/*! - * @brief Read the GPIO interrupt status flags. - * - * @param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on.) - * @return The current GPIO's interrupt status flag. - * '1' means the related pin's flag is set, '0' means the related pin's flag not set. - * For example, the return value 0x00010001 means the pin 0 and 17 have the interrupt pending. - */ -uint32_t GPIO_GpioGetInterruptFlags(GPIO_Type *base); -#if (defined(FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) && FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) -/*! - * @brief Read the GPIO interrupt status flags based on selected interrupt channel(IRQS). - * - * @param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on.) - * @param channel '0' means selete interrupt channel 0, '1' means selete interrupt channel 1. - * @return The current GPIO's interrupt status flag based on the selected interrupt channel. - * '1' means the related pin's flag is set, '0' means the related pin's flag not set. - * For example, the return value 0x00010001 means the pin 0 and 17 have the interrupt pending. - */ -uint32_t GPIO_GpioGetInterruptChannelFlags(GPIO_Type *base, uint32_t channel); -#endif -/*! - * @brief Read individual pin's interrupt status flag. - * - * @param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on) - * @param pin GPIO specific pin number. - * @return The current selected pin's interrupt status flag. - */ -uint8_t GPIO_PinGetInterruptFlag(GPIO_Type *base, uint32_t pin); - -/*! - * @brief Clears GPIO pin interrupt status flags. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -void GPIO_GpioClearInterruptFlags(GPIO_Type *base, uint32_t mask); -#if (defined(FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) && FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) -/*! - * @brief Clears GPIO pin interrupt status flags based on selected interrupt channel(IRQS). - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - * @param channel '0' means selete interrupt channel 0, '1' means selete interrupt channel 1. - */ -void GPIO_GpioClearInterruptChannelFlags(GPIO_Type *base, uint32_t mask, uint32_t channel); -#endif -/*! - * @brief Clear GPIO individual pin's interrupt status flag. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on). - * @param pin GPIO specific pin number. - */ -void GPIO_PinClearInterruptFlag(GPIO_Type *base, uint32_t pin); - -/*! - * @brief Reads the GPIO DMA request flags. - * The corresponding flag will be cleared automatically at the completion of the requested - * DMA transfer - */ -static inline uint32_t GPIO_GetPinsDMARequestFlags(GPIO_Type *base) -{ - assert(base); - return (base->ISFR[1]); -} - -/*! - * @brief Sets the GPIO interrupt configuration in PCR register for multiple pins. - * - * @param base GPIO peripheral base pointer. - * @param mask GPIO pin number macro. - * @param config GPIO pin interrupt configuration. - * - #kGPIO_InterruptStatusFlagDisabled: Interrupt disabled. - * - #kGPIO_DMARisingEdge : DMA request on rising edge(if the DMA requests exit). - * - #kGPIO_DMAFallingEdge: DMA request on falling edge(if the DMA requests exit). - * - #kGPIO_DMAEitherEdge : DMA request on either edge(if the DMA requests exit). - * - #kGPIO_FlagRisingEdge : Flag sets on rising edge(if the Flag states exit). - * - #kGPIO_FlagFallingEdge : Flag sets on falling edge(if the Flag states exit). - * - #kGPIO_FlagEitherEdge : Flag sets on either edge(if the Flag states exit). - * - #kGPIO_InterruptLogicZero : Interrupt when logic zero. - * - #kGPIO_InterruptRisingEdge : Interrupt on rising edge. - * - #kGPIO_InterruptFallingEdge: Interrupt on falling edge. - * - #kGPIO_InterruptEitherEdge : Interrupt on either edge. - * - #kGPIO_InterruptLogicOne : Interrupt when logic one. - * - #kGPIO_ActiveHighTriggerOutputEnable : Enable active high-trigger output (if the trigger states exit). - * - #kGPIO_ActiveLowTriggerOutputEnable : Enable active low-trigger output (if the trigger states exit).. - */ -static inline void GPIO_SetMultipleInterruptPinsConfig(GPIO_Type *base, uint32_t mask, gpio_interrupt_config_t config) -{ - assert(base); - - if (0UL != (mask & 0xffffUL)) - { - base->GICLR = GPIO_FIT_REG((GPIO_ICR_IRQC(config)) | (mask & 0xffffU)); - } - mask = mask >> 16U; - if (mask != 0UL) - { - base->GICHR = GPIO_FIT_REG((GPIO_ICR_IRQC(config)) | (mask & 0xffffU)); - } -} -#endif - -#if defined(FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER) && FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER -/*! - * brief The GPIO module supports a device-specific number of data ports, organized as 32-bit - * words/8-bit Bytes. Each 32-bit/8-bit data port includes a GACR register, which defines the byte-level - * attributes required for a successful access to the GPIO programming model. If the GPIO module's GACR register - * organized as 32-bit words, the attribute controls for the 4 data bytes in the GACR follow a standard little - * endian data convention. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param attribute GPIO checker attribute - */ -void GPIO_CheckAttributeBytes(GPIO_Type *base, gpio_checker_attribute_t attribute); -#endif - -/*! @} */ -/*! @} */ - -/*! - * @addtogroup fgpio_driver - * @{ - */ - -/* - * Introduces the FGPIO feature. - * - * The FGPIO features are only support on some Kinetis MCUs. The FGPIO registers are aliased to the IOPORT - * interface. Accesses via the IOPORT interface occur in parallel with any instruction fetches and - * complete in a single cycle. This aliased Fast GPIO memory map is called FGPIO. - */ - -#if defined(FSL_FEATURE_SOC_FGPIO_COUNT) && FSL_FEATURE_SOC_FGPIO_COUNT - -/*! @name FGPIO Configuration */ -/*! @{ */ - -#if defined(FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL) && FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL -/*! - * @brief Initializes the FGPIO peripheral. - * - * This function ungates the FGPIO clock. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - */ -void FGPIO_PortInit(FGPIO_Type *base); -#endif /* FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL */ - -/*! - * @brief Initializes a FGPIO pin used by the board. - * - * To initialize the FGPIO driver, define a pin configuration, as either input or output, in the user file. - * Then, call the FGPIO_PinInit() function. - * - * This is an example to define an input pin or an output pin configuration: - * @code - * Define a digital input pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalInput, - * 0, - * } - * Define a digital output pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalOutput, - * 0, - * } - * @endcode - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param pin FGPIO port pin number - * @param config FGPIO pin configuration pointer - */ -void FGPIO_PinInit(FGPIO_Type *base, uint32_t pin, const gpio_pin_config_t *config); - -/*! @} */ - -/*! @name FGPIO Output Operations */ -/*! @{ */ - -/*! - * @brief Sets the output level of the multiple FGPIO pins to the logic 1 or 0. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param pin FGPIO pin number - * @param output FGPIOpin output logic level. - * - 0: corresponding pin output low-logic level. - * - 1: corresponding pin output high-logic level. - */ -static inline void FGPIO_PinWrite(FGPIO_Type *base, uint32_t pin, uint8_t output) -{ - if (output == 0U) - { - base->PCOR = 1UL << pin; - } - else - { - base->PSOR = 1UL << pin; - } -} - -/*! - * @brief Sets the output level of the multiple FGPIO pins to the logic 1. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param mask FGPIO pin number macro - */ -static inline void FGPIO_PortSet(FGPIO_Type *base, uint32_t mask) -{ - base->PSOR = mask; -} - -/*! - * @brief Sets the output level of the multiple FGPIO pins to the logic 0. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param mask FGPIO pin number macro - */ -static inline void FGPIO_PortClear(FGPIO_Type *base, uint32_t mask) -{ - base->PCOR = mask; -} - -/*! - * @brief Reverses the current output logic of the multiple FGPIO pins. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param mask FGPIO pin number macro - */ -static inline void FGPIO_PortToggle(FGPIO_Type *base, uint32_t mask) -{ - base->PTOR = mask; -} -/*! @} */ - -/*! @name FGPIO Input Operations */ -/*! @{ */ - -/*! - * @brief Reads the current input value of the FGPIO port. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param pin FGPIO pin number - * @retval FGPIO port input value - * - 0: corresponding pin input low-logic level. - * - 1: corresponding pin input high-logic level. - */ -static inline uint32_t FGPIO_PinRead(FGPIO_Type *base, uint32_t pin) -{ - return (((base->PDIR) >> pin) & 0x01U); -} -/*! @} */ - -/*! @name FGPIO Interrupt */ -/*! @{ */ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) - -/*! - * @brief Reads the FGPIO port interrupt status flag. - * - * If a pin is configured to generate the DMA request, the corresponding flag - * is cleared automatically at the completion of the requested DMA transfer. - * Otherwise, the flag remains set until a logic one is written to that flag. - * If configured for a level-sensitive interrupt that remains asserted, the flag - * is set again immediately. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @retval The current FGPIO port interrupt status flags, for example, 0x00010001 means the - * pin 0 and 17 have the interrupt. - */ -uint32_t FGPIO_PortGetInterruptFlags(FGPIO_Type *base); - -/*! - * @brief Clears the multiple FGPIO pin interrupt status flag. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param mask FGPIO pin number macro - */ -void FGPIO_PortClearInterruptFlags(FGPIO_Type *base, uint32_t mask); -#endif -#if defined(FSL_FEATURE_FGPIO_HAS_ATTRIBUTE_CHECKER) && FSL_FEATURE_FGPIO_HAS_ATTRIBUTE_CHECKER -/*! - * @brief The FGPIO module supports a device-specific number of data ports, organized as 32-bit - * words. Each 32-bit data port includes a GACR register, which defines the byte-level - * attributes required for a successful access to the GPIO programming model. The attribute controls for the 4 data - * bytes in the GACR follow a standard little endian - * data convention. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param attribute FGPIO checker attribute - */ -void FGPIO_CheckAttributeBytes(FGPIO_Type *base, gpio_checker_attribute_t attribute); -#endif /* FSL_FEATURE_FGPIO_HAS_ATTRIBUTE_CHECKER */ - -/*! @} */ - -#endif /* FSL_FEATURE_SOC_FGPIO_COUNT */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ - -#endif /* FSL_GPIO_H_*/ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_i3c.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_i3c.c deleted file mode 100644 index dc10970b5af..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_i3c.c +++ /dev/null @@ -1,3572 +0,0 @@ -/* - * Copyright 2018-2024 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_i3c.h" -#if !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) -#include "fsl_reset.h" -#endif -#include -#include - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.i3c" -#endif - -#define I3C_BROADCASE_ADDR (0x7EU) - -#define NSEC_PER_SEC (1000000000UL) -#define FSL_I3C_ERROR_RATE_MAX (10U) -#define FSL_I3C_PPBAUD_DIV_MAX ((I3C_MCONFIG_PPBAUD_MASK >> I3C_MCONFIG_PPBAUD_SHIFT) + 1U) -#define FSL_I3C_ODBAUD_DIV_MAX ((I3C_MCONFIG_ODBAUD_MASK >> I3C_MCONFIG_ODBAUD_SHIFT) + 1U) -#define FSL_I3C_I2CBAUD_DIV_MAX (((I3C_MCONFIG_I2CBAUD_MASK >> I3C_MCONFIG_I2CBAUD_SHIFT) + 1U) / 2U) - -/*! @brief Common sets of flags used by the driver. */ -enum _i3c_flag_constants -{ - /*! All flags which are cleared by the driver upon starting a transfer. */ - kMasterClearFlags = kI3C_MasterSlaveStartFlag | kI3C_MasterControlDoneFlag | kI3C_MasterCompleteFlag | - kI3C_MasterArbitrationWonFlag | kI3C_MasterSlave2MasterFlag | kI3C_MasterErrorFlag, - - /*! IRQ sources enabled by the non-blocking transactional API. */ - kMasterIrqFlags = kI3C_MasterSlaveStartFlag | kI3C_MasterControlDoneFlag | kI3C_MasterCompleteFlag | - kI3C_MasterRxReadyFlag /* | kI3C_MasterTxReadyFlag */ | kI3C_MasterArbitrationWonFlag | - kI3C_MasterErrorFlag | kI3C_MasterSlave2MasterFlag, - - /*! Errors to check for. */ - kMasterErrorFlags = kI3C_MasterErrorNackFlag | kI3C_MasterErrorWriteAbortFlag | -#if !defined(FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) || (!FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) - kI3C_MasterErrorTermFlag | -#endif - kI3C_MasterErrorParityFlag | kI3C_MasterErrorCrcFlag | kI3C_MasterErrorReadFlag | - kI3C_MasterErrorWriteFlag | kI3C_MasterErrorMsgFlag | kI3C_MasterErrorInvalidReqFlag | - kI3C_MasterErrorTimeoutFlag, - /*! All flags which are cleared by the driver upon starting a transfer. */ - kSlaveClearFlags = kI3C_SlaveBusStartFlag | kI3C_SlaveMatchedFlag | kI3C_SlaveBusStopFlag, - - /*! IRQ sources enabled by the non-blocking transactional API. */ - kSlaveIrqFlags = kI3C_SlaveBusStartFlag | kI3C_SlaveMatchedFlag | kI3C_SlaveBusStopFlag | kI3C_SlaveRxReadyFlag | - kI3C_SlaveDynamicAddrChangedFlag | kI3C_SlaveReceivedCCCFlag | kI3C_SlaveErrorFlag | - kI3C_SlaveHDRCommandMatchFlag | kI3C_SlaveCCCHandledFlag | kI3C_SlaveEventSentFlag, - - /*! Errors to check for. */ - kSlaveErrorFlags = kI3C_SlaveErrorOverrunFlag | kI3C_SlaveErrorUnderrunFlag | kI3C_SlaveErrorUnderrunNakFlag | - kI3C_SlaveErrorTermFlag | kI3C_SlaveErrorInvalidStartFlag | kI3C_SlaveErrorSdrParityFlag | - kI3C_SlaveErrorHdrParityFlag | kI3C_SlaveErrorHdrCRCFlag | kI3C_SlaveErrorS0S1Flag | - kI3C_SlaveErrorOverreadFlag | kI3C_SlaveErrorOverwriteFlag, -}; - -/*! @brief States for the state machine used by transactional APIs. */ -enum _i3c_transfer_states -{ - kIdleState = 0, - kIBIWonState, - kSlaveStartState, - kSendCommandState, - kWaitRepeatedStartCompleteState, - kTransferDataState, - kStopState, - kWaitForCompletionState, -}; - -/*! - * @brief Used for conversion between `uint8_t*` and `uint32_t`. - */ -typedef union i3c_puint8_to_u32 -{ - uint8_t *puint8; - uint32_t u32; - const uint8_t *cpuint8; -} i3c_puint8_to_u32_t; - -/* - * MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - } - - return result; -} - -status_t I3C_MasterWaitForCtrlDone(I3C_Type *base, bool waitIdle) -{ - status_t result = kStatus_Success; - uint32_t status, errStatus; -#if I3C_RETRY_TIMES - uint32_t waitTimes = I3C_RETRY_TIMES; -#endif - -#if I3C_RETRY_TIMES - while ((result == kStatus_Success) && (--waitTimes)) -#else - while (result == kStatus_Success) -#endif - { - status = I3C_MasterGetStatusFlags(base); - errStatus = I3C_MasterGetErrorStatusFlags(base); - /* Check for error flags. */ - result = I3C_MasterCheckAndClearError(base, errStatus); - /* Check if the control finishes. */ - if (0UL != (status & (uint32_t)kI3C_MasterControlDoneFlag)) - { - I3C_MasterClearStatusFlags(base, (uint32_t)kI3C_MasterControlDoneFlag); - if (!waitIdle) - { - break; - } - } - /* kI3C_MasterControlDoneFlag only indicates ACK got, need to wait for SDA high. */ - if (waitIdle && I3C_MasterGetState(base) == kI3C_MasterStateIdle) - { - break; - } - } - -#if I3C_RETRY_TIMES - if (waitTimes == 0) - { - return kStatus_I3C_Timeout; - } -#endif - - return result; -} - -static status_t I3C_MasterWaitForTxReady(I3C_Type *base, uint8_t byteCounts) -{ - uint32_t errStatus; - status_t result; - size_t txCount; - size_t txFifoSize = - 2UL << ((base->SCAPABILITIES & I3C_SCAPABILITIES_FIFOTX_MASK) >> I3C_SCAPABILITIES_FIFOTX_SHIFT); - -#if I3C_RETRY_TIMES - uint32_t waitTimes = I3C_RETRY_TIMES; -#endif - do - { - /* Get the number of words in the tx fifo and compute empty slots. */ - I3C_MasterGetFifoCounts(base, NULL, &txCount); - txCount = txFifoSize - txCount; - - /* Check for error flags. */ - errStatus = I3C_MasterGetErrorStatusFlags(base); - result = I3C_MasterCheckAndClearError(base, errStatus); - if (kStatus_Success != result) - { - return result; - } -#if I3C_RETRY_TIMES - } while ((txCount < byteCounts) && (--waitTimes)); - - if (waitTimes == 0) - { - return kStatus_I3C_Timeout; - } -#else - } while (txCount < byteCounts); -#endif - - return kStatus_Success; -} - -static status_t I3C_MasterWaitForComplete(I3C_Type *base, bool waitIdle) -{ - uint32_t status, errStatus; - status_t result = kStatus_Success; -#if I3C_RETRY_TIMES - uint32_t waitTimes = I3C_RETRY_TIMES; -#endif - do - { - status = I3C_MasterGetStatusFlags(base); - errStatus = I3C_MasterGetErrorStatusFlags(base); - result = I3C_MasterCheckAndClearError(base, errStatus); -#if I3C_RETRY_TIMES - } while (((status & (uint32_t)kI3C_MasterCompleteFlag) != (uint32_t)kI3C_MasterCompleteFlag) && - (result == kStatus_Success) && --waitTimes); -#else - } while (((status & (uint32_t)kI3C_MasterCompleteFlag) != (uint32_t)kI3C_MasterCompleteFlag) && - (result == kStatus_Success)); -#endif - - I3C_MasterClearStatusFlags(base, (uint32_t)kI3C_MasterCompleteFlag); - -#if I3C_RETRY_TIMES - if (waitTimes == 0UL) - { - return kStatus_I3C_Timeout; - } -#endif - - if (waitIdle) - { -#if I3C_RETRY_TIMES - while ((I3C_MasterGetState(base) != kI3C_MasterStateIdle) && --waitTimes) -#else - while (I3C_MasterGetState(base) != kI3C_MasterStateIdle) -#endif - { - } - } - - return result; -} - -/*! - * @brief Convert provided flags to status code, and clear any errors if present. - * @param base The I3C peripheral base address. - * @param status Current status flags value that will be checked. - * @retval #kStatus_Success - * @retval #kStatus_I3C_OverrunError - * @retval #kStatus_I3C_UnderrunError - * @retval #kStatus_I3C_UnderrunNak - * @retval #kStatus_I3C_Term - * @retval #kStatus_I3C_InvalidStart - * @retval #kStatus_I3C_SdrParityError - * @retval #kStatus_I3C_HdrParityError - * @retval #kStatus_I3C_CrcError - * @retval #kStatus_I3C_S0S1Error - * @retval #kStatus_I3C_ReadFifoError - * @retval #kStatus_I3C_WriteFifoError - */ -status_t I3C_SlaveCheckAndClearError(I3C_Type *base, uint32_t status) -{ - status_t result = kStatus_Success; - - /* Check for error. These errors cause a stop to automatically be sent. We must */ - /* clear the errors before a new transfer can start. */ - status &= (uint32_t)kSlaveErrorFlags; - -#if defined(I3C_DMA_IGNORE_FIFO_ERROR) - status &= ~((uint32_t)kI3C_SlaveErrorUnderrunFlag | (uint32_t)kI3C_SlaveErrorOverwriteFlag); - I3C_SlaveClearErrorStatusFlags(base, - ((uint32_t)kI3C_SlaveErrorUnderrunFlag | (uint32_t)kI3C_SlaveErrorOverwriteFlag)); -#endif - - if (0UL != status) - { - /* Select the correct error code. Ordered by severity, with bus issues first. */ - if (0UL != (status & (uint32_t)kI3C_SlaveErrorOverrunFlag)) - { - result = kStatus_I3C_OverrunError; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorUnderrunFlag)) - { - result = kStatus_I3C_UnderrunError; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorUnderrunNakFlag)) - { - result = kStatus_I3C_UnderrunNak; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorTermFlag)) - { - result = kStatus_I3C_Term; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorInvalidStartFlag)) - { - result = kStatus_I3C_InvalidStart; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorSdrParityFlag)) - { - result = kStatus_I3C_SdrParityError; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorHdrParityFlag)) - { - result = kStatus_I3C_HdrParityError; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorHdrCRCFlag)) - { - result = kStatus_I3C_CrcError; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorS0S1Flag)) - { - result = kStatus_I3C_S0S1Error; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorOverreadFlag)) - { - result = kStatus_I3C_ReadFifoError; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorOverwriteFlag)) - { - result = kStatus_I3C_WriteFifoError; - } - else - { - assert(false); - } - - /* Clear the flags. */ - I3C_SlaveClearErrorStatusFlags(base, status); - - /* Reset fifos. These flags clear automatically. */ - base->SDATACTRL |= I3C_SDATACTRL_FLUSHTB_MASK | I3C_SDATACTRL_FLUSHFB_MASK; - } - - return result; -} - -static status_t I3C_SlaveWaitForTxReady(I3C_Type *base) -{ - uint32_t errStatus; - status_t result; - size_t txCount; - size_t txFifoSize = - 2UL << ((base->SCAPABILITIES & I3C_SCAPABILITIES_FIFOTX_MASK) >> I3C_SCAPABILITIES_FIFOTX_SHIFT); - -#if I3C_RETRY_TIMES - uint32_t waitTimes = I3C_RETRY_TIMES; -#endif - do - { - /* Get the number of words in the tx fifo and compute empty slots. */ - I3C_SlaveGetFifoCounts(base, NULL, &txCount); - txCount = txFifoSize - txCount; - - /* Check for error flags. */ - errStatus = I3C_SlaveGetErrorStatusFlags(base); - result = I3C_SlaveCheckAndClearError(base, errStatus); - if (kStatus_Success != result) - { - return result; - } -#if I3C_RETRY_TIMES - } while ((txCount == 0UL) && (--waitTimes)); - - if (waitTimes == 0) - { - return kStatus_I3C_Timeout; - } -#else - } while (txCount == 0UL); -#endif - - return kStatus_Success; -} - -static status_t I3C_MasterEmitStop(I3C_Type *base, bool waitIdle) -{ - status_t result = kStatus_Success; - - /* Return an error if the bus is not in transaction. */ - if (I3C_MasterGetState(base) != kI3C_MasterStateNormAct) - { - return kStatus_I3C_InvalidReq; - } - - /* Send the STOP signal */ - base->MCTRL = (base->MCTRL & ~(I3C_MCTRL_REQUEST_MASK | I3C_MCTRL_DIR_MASK | I3C_MCTRL_RDTERM_MASK)) | - I3C_MCTRL_REQUEST(kI3C_RequestEmitStop); - - /* Wait for the stop operation finishes. */ - /* Also check for errors while waiting. */ - result = I3C_MasterWaitForCtrlDone(base, waitIdle); - - return result; -} - -/*! - * brief I3C master get IBI Type. - * - * param base The I3C peripheral base address. - * param i3c_ibi_type_t Type of #i3c_ibi_type_t. - */ -i3c_ibi_type_t I3C_GetIBIType(I3C_Type *base) -{ - uint32_t ibiValue = (base->MSTATUS & I3C_MSTATUS_IBITYPE_MASK) >> I3C_MSTATUS_IBITYPE_SHIFT; - i3c_ibi_type_t ibiType = kI3C_IbiNormal; - - switch (ibiValue) - { - case 3L: - ibiType = kI3C_IbiHotJoin; - break; - case 2L: - ibiType = kI3C_IbiMasterRequest; - break; - default: - ibiType = kI3C_IbiNormal; - break; - } - - return ibiType; -} - -/*! - * @brief Make sure the bus isn't already busy. - * - * A busy bus is allowed if we are the one driving it. - * - * @param base The I3C peripheral base address. - * @retval #kStatus_Success - * @retval #kStatus_I3C_Busy - */ -/* Not static so it can be used from fsl_i3c_edma.c. */ -status_t I3C_CheckForBusyBus(I3C_Type *base) -{ - return (I3C_MasterGetBusIdleState(base) == true) ? kStatus_Success : kStatus_I3C_Busy; -} - -/* brief Provides a default configuration for the I3C peripheral. - * - */ -void I3C_GetDefaultConfig(i3c_config_t *config) -{ - assert(NULL != config); - - (void)memset(config, 0, sizeof(*config)); - - config->enableMaster = kI3C_MasterCapable; - config->disableTimeout = false; - config->hKeep = kI3C_MasterHighKeeperNone; - config->enableOpenDrainStop = true; - config->enableOpenDrainHigh = true; - config->baudRate_Hz.i2cBaud = 400000U; - config->baudRate_Hz.i3cPushPullBaud = 12500000U; - config->baudRate_Hz.i3cOpenDrainBaud = 2500000U; - config->masterDynamicAddress = 0x0AU; /* Default master dynamic address. */ -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - config->slowClock_Hz = 0; /* Not update the Soc default setting. */ -#endif - config->enableSlave = true; - config->vendorID = 0x11BU; -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) - config->enableRandomPart = false; -#endif - config->partNumber = 0; - config->dcr = 0; /* Generic device. */ - config->bcr = 0; /* BCR[7:6]: device role, I3C slave(2b'00), BCR[5]: SDR Only / SDR and HDR Capable, SDR and HDR - Capable(1b'1), BCR[4]: Bridge Identifier, Not a bridge device(1b'0), BCR[3]: Offline Capable, - device is offline capable(1b'1), BCR[2]: IBI Payload, No data byte following(1b'0), BCR[1]: IBI - Request Capable, capable(1b'1), BCR[0]: Max Data Speed Limitation, has limitation(1b'1). */ - config->hdrMode = (uint8_t)kI3C_HDRModeDDR; - config->nakAllRequest = false; - config->ignoreS0S1Error = false; - config->offline = false; - config->matchSlaveStartStop = false; - config->maxWriteLength = 256U; - config->maxReadLength = 256U; -} - -/*! - * @brief Initializes the I3C peripheral. - * - */ -void I3C_Init(I3C_Type *base, const i3c_config_t *config, uint32_t sourceClock_Hz) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) || \ - !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) - uint32_t instance = I3C_GetInstance(base); -#endif - uint32_t configValue; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate the clock. */ - CLOCK_EnableClock(kI3cClocks[instance]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) - /* Reset the I3C module */ - RESET_PeripheralReset(kI3cResets[instance]); -#endif - - if ((config->masterDynamicAddress != 0U) && (config->enableMaster == kI3C_MasterOn)) - { - base->MDYNADDR &= ~I3C_MDYNADDR_DADDR_MASK; - base->MDYNADDR |= I3C_MDYNADDR_DADDR(config->masterDynamicAddress) | I3C_MDYNADDR_DAVALID_MASK; - } - - base->MCONFIG = I3C_MCONFIG_MSTENA(config->enableMaster) | I3C_MCONFIG_DISTO(config->disableTimeout) | - I3C_MCONFIG_HKEEP(config->hKeep) | I3C_MCONFIG_ODSTOP(config->enableOpenDrainStop) | - I3C_MCONFIG_ODHPP(config->enableOpenDrainHigh); - -#if defined(FSL_FEATURE_I3C_HAS_START_SCL_DELAY) && FSL_FEATURE_I3C_HAS_START_SCL_DELAY - base->MCONFIG_EXT = I3C_MCONFIG_EXT_I3C_CAS_DEL(config->startSclDelay) | I3C_MCONFIG_EXT_I3C_CASR_DEL(config->restartSclDelay); -#endif - - I3C_MasterSetWatermarks(base, kI3C_TxTriggerUntilOneLessThanFull, kI3C_RxTriggerOnNotEmpty, true, true); - - I3C_MasterSetBaudRate(base, &config->baudRate_Hz, sourceClock_Hz); - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - assert((config->slowClock_Hz >= 1000000U) || (config->slowClock_Hz == 0U)); - - uint8_t matchCount; - /* Set as (slowClk(MHz) - 1) to generate 1us clock cycle. Controller uses it to count 100us timeout. Target uses it as IBI request to drive SDA low. - Note: Use BAMATCH = 1 to generate 1us clock cycle if slow clock is 1MHz. The value of 0 would not give a correct match indication. */ - if (config->slowClock_Hz != 0U) - { - matchCount = (uint8_t)(config->slowClock_Hz / 1000000UL) - 1U; - matchCount = (matchCount == 0U) ? 1U : matchCount; - } - else - { - /* BAMATCH has default value based on Soc default slow clock after reset, using this default value when slowClock_Hz is 0. */ - matchCount = (uint8_t)((base->SCONFIG & I3C_SCONFIG_BAMATCH_MASK) >> I3C_SCONFIG_BAMATCH_SHIFT); - } -#endif - - configValue = base->SCONFIG; - - configValue &= - ~(I3C_SCONFIG_SADDR_MASK | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - I3C_SCONFIG_BAMATCH_MASK | -#endif - I3C_SCONFIG_OFFLINE_MASK | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) - I3C_SCONFIG_IDRAND_MASK | -#endif -#if defined(FSL_FEATURE_I3C_HAS_HDROK) && FSL_FEATURE_I3C_HAS_HDROK - I3C_SCONFIG_HDROK_MASK | -#else - I3C_SCONFIG_DDROK_MASK | -#endif - I3C_SCONFIG_S0IGNORE_MASK | I3C_SCONFIG_MATCHSS_MASK | I3C_SCONFIG_NACK_MASK | I3C_SCONFIG_SLVENA_MASK); - - configValue |= I3C_SCONFIG_SADDR(config->staticAddr) | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - I3C_SCONFIG_BAMATCH(matchCount) | -#endif - I3C_SCONFIG_OFFLINE(config->offline) | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) - I3C_SCONFIG_IDRAND(config->enableRandomPart) | -#endif -#if defined(FSL_FEATURE_I3C_HAS_HDROK) && FSL_FEATURE_I3C_HAS_HDROK - I3C_SCONFIG_HDROK((0U != (config->hdrMode & (uint8_t)kI3C_HDRModeDDR)) ? 1U : 0U) | -#else - I3C_SCONFIG_DDROK((0U != (config->hdrMode & (uint8_t)kI3C_HDRModeDDR)) ? 1U : 0U) | -#endif - I3C_SCONFIG_S0IGNORE(config->ignoreS0S1Error) | I3C_SCONFIG_MATCHSS(config->matchSlaveStartStop) | - I3C_SCONFIG_NACK(config->nakAllRequest) | I3C_SCONFIG_SLVENA(config->enableSlave); - - base->SVENDORID &= ~I3C_SVENDORID_VID_MASK; - base->SVENDORID |= I3C_SVENDORID_VID(config->vendorID); - -#if defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND - base->SIDPARTNO = config->partNumber; -#else - if (!config->enableRandomPart) - { - base->SIDPARTNO = config->partNumber; - } -#endif - - base->SIDEXT &= ~(I3C_SIDEXT_BCR_MASK | I3C_SIDEXT_DCR_MASK); - base->SIDEXT |= I3C_SIDEXT_BCR(config->bcr) | I3C_SIDEXT_DCR(config->dcr); - - base->SMAXLIMITS &= ~(I3C_SMAXLIMITS_MAXRD_MASK | I3C_SMAXLIMITS_MAXWR_MASK); - base->SMAXLIMITS |= (I3C_SMAXLIMITS_MAXRD(config->maxReadLength) | I3C_SMAXLIMITS_MAXWR(config->maxWriteLength)); - - base->SCONFIG = configValue; -} - -/*! - * brief Provides a default configuration for the I3C master peripheral. - * - * This function provides the following default configuration for the I3C master peripheral: - * code - * masterConfig->enableMaster = kI3C_MasterOn; - * masterConfig->disableTimeout = false; - * masterConfig->hKeep = kI3C_MasterHighKeeperNone; - * masterConfig->enableOpenDrainStop = true; - * masterConfig->enableOpenDrainHigh = true; - * masterConfig->baudRate_Hz = 100000U; - * masterConfig->busType = kI3C_TypeI2C; - * endcode - * - * After calling this function, you can override any settings in order to customize the configuration, - * prior to initializing the master driver with I3C_MasterInit(). - * - * param[out] masterConfig User provided configuration structure for default values. Refer to #i3c_master_config_t. - */ -void I3C_MasterGetDefaultConfig(i3c_master_config_t *masterConfig) -{ - (void)memset(masterConfig, 0, sizeof(*masterConfig)); - - masterConfig->enableMaster = kI3C_MasterOn; - masterConfig->disableTimeout = false; - masterConfig->hKeep = kI3C_MasterHighKeeperNone; - masterConfig->enableOpenDrainStop = true; - masterConfig->enableOpenDrainHigh = true; - masterConfig->baudRate_Hz.i2cBaud = 400000U; - masterConfig->baudRate_Hz.i3cPushPullBaud = 12500000U; - masterConfig->baudRate_Hz.i3cOpenDrainBaud = 2500000U; -} - -/*! - * brief Initializes the I3C master peripheral. - * - * This function enables the peripheral clock and initializes the I3C master peripheral as described by the user - * provided configuration. A software reset is performed prior to configuration. - * - * param base The I3C peripheral base address. - * param masterConfig User provided peripheral configuration. Use I3C_MasterGetDefaultConfig() to get a set of - * defaults that you can override. - * param sourceClock_Hz Frequency in Hertz of the I3C functional clock. Used to calculate the baud rate divisors, - * filter widths, and timeout periods. - */ -void I3C_MasterInit(I3C_Type *base, const i3c_master_config_t *masterConfig, uint32_t sourceClock_Hz) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) || \ - !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) - uint32_t instance = I3C_GetInstance(base); -#endif - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate the clock. */ - CLOCK_EnableClock(kI3cClocks[instance]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) - /* Reset the I3C module */ - RESET_PeripheralReset(kI3cResets[instance]); -#endif - base->MCONFIG = I3C_MCONFIG_MSTENA(masterConfig->enableMaster) | I3C_MCONFIG_DISTO(masterConfig->disableTimeout) | - I3C_MCONFIG_HKEEP(masterConfig->hKeep) | I3C_MCONFIG_ODSTOP(masterConfig->enableOpenDrainStop) | - I3C_MCONFIG_ODHPP(masterConfig->enableOpenDrainHigh); - -#if defined(FSL_FEATURE_I3C_HAS_START_SCL_DELAY) && FSL_FEATURE_I3C_HAS_START_SCL_DELAY - base->MCONFIG_EXT = I3C_MCONFIG_EXT_I3C_CAS_DEL(masterConfig->startSclDelay) | I3C_MCONFIG_EXT_I3C_CASR_DEL(masterConfig->restartSclDelay); -#endif - - I3C_MasterSetWatermarks(base, kI3C_TxTriggerUntilOneLessThanFull, kI3C_RxTriggerOnNotEmpty, true, true); - - I3C_MasterSetBaudRate(base, &masterConfig->baudRate_Hz, sourceClock_Hz); - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - assert((masterConfig->slowClock_Hz >= 1000000U) || (masterConfig->slowClock_Hz == 0U)); - - uint32_t configValue; - uint8_t matchCount; - - /* BAMATCH has default value based on Soc default slow clock after reset, using this default value when slowClock_Hz is 0. */ - if (masterConfig->slowClock_Hz != 0U) - { - /* Set as (slowClk(MHz) - 1) to generate 1us clock cycle for 100us timeout. Note: Use BAMATCH = 1 to generate 1us clock cycle - if slow clock is 1MHz. The value of 0 would not give a correct match indication. */ - matchCount = (uint8_t)(masterConfig->slowClock_Hz / 1000000UL) - 1U; - matchCount = (matchCount == 0U) ? 1U : matchCount; - - configValue = base->SCONFIG & I3C_SCONFIG_BAMATCH_MASK; - configValue |= I3C_SCONFIG_BAMATCH(matchCount); - base->SCONFIG = configValue; - } -#endif -} - -/*! - * @brief Gets the I3C master state. - * - * @param base The I3C peripheral base address. - * @return I3C master state. - */ -i3c_master_state_t I3C_MasterGetState(I3C_Type *base) -{ - uint32_t masterState = (base->MSTATUS & I3C_MSTATUS_STATE_MASK) >> I3C_MSTATUS_STATE_SHIFT; - i3c_master_state_t returnCode; - - switch (masterState) - { - case (uint32_t)kI3C_MasterStateIdle: - returnCode = kI3C_MasterStateIdle; - break; - case (uint32_t)kI3C_MasterStateSlvReq: - returnCode = kI3C_MasterStateSlvReq; - break; - case (uint32_t)kI3C_MasterStateMsgSdr: - returnCode = kI3C_MasterStateMsgSdr; - break; - case (uint32_t)kI3C_MasterStateNormAct: - returnCode = kI3C_MasterStateNormAct; - break; - case (uint32_t)kI3C_MasterStateDdr: - returnCode = kI3C_MasterStateDdr; - break; - case (uint32_t)kI3C_MasterStateDaa: - returnCode = kI3C_MasterStateDaa; - break; - case (uint32_t)kI3C_MasterStateIbiAck: - returnCode = kI3C_MasterStateIbiAck; - break; - case (uint32_t)kI3C_MasterStateIbiRcv: - returnCode = kI3C_MasterStateIbiRcv; - break; - default: - returnCode = kI3C_MasterStateIdle; - break; - } - - return returnCode; -} - -/*! - * brief Deinitializes the I3C master peripheral. - * - * This function disables the I3C master peripheral and gates the clock. It also performs a software - * reset to restore the peripheral to reset conditions. - * - * param base The I3C peripheral base address. - */ -void I3C_MasterDeinit(I3C_Type *base) -{ - uint32_t idx = I3C_GetInstance(base); - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) - /* Reset the I3C module */ - RESET_PeripheralReset(kI3cResets[idx]); -#endif - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate clock. */ - CLOCK_DisableClock(kI3cClocks[idx]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Reset handle pointer. */ - s_i3cMasterHandle[idx] = NULL; -} - -static uint32_t I3C_CalcErrorRatio(uint32_t curFreq, uint32_t desiredFreq) -{ - if (curFreq > desiredFreq) - { - return (curFreq - desiredFreq) * 100UL / desiredFreq; - } - else - { - return (desiredFreq - curFreq) * 100UL / desiredFreq; - } -} - -/*! - * brief Sets the I3C bus frequency for master transactions. - * - * The I3C master is automatically disabled and re-enabled as necessary to configure the baud - * rate. Do not call this function during a transfer, or the transfer is aborted. - * - * param base The I3C peripheral base address. - * param baudRate_Hz Pointer to structure of requested bus frequency in Hertz. - * param sourceClock_Hz I3C functional clock frequency in Hertz. - */ -void I3C_MasterSetBaudRate(I3C_Type *base, const i3c_baudrate_hz_t *baudRate_Hz, uint32_t sourceClock_Hz) -{ - uint32_t div, freq; - uint32_t divEven, divOdd; - uint32_t ppBaud, odBaud, i2cBaud; - uint32_t errRate0, errRate1; - uint32_t i3cPPBaud_HZ = baudRate_Hz->i3cPushPullBaud; - uint32_t i3cPPBaudMax_HZ = i3cPPBaud_HZ / 10U + i3cPPBaud_HZ; /* max is 1.1*i3cPPBaud_HZ */ - uint32_t i3cODBaud_HZ = baudRate_Hz->i3cOpenDrainBaud; - uint32_t i3cODBaudMax_HZ = i3cODBaud_HZ / 10U + i3cODBaud_HZ; /* max is 1.1*i3cODBaud_HZ */ - uint32_t i2cBaud_HZ = baudRate_Hz->i2cBaud; - uint32_t i3cPPLow_Ns, i3cOdLow_Ns; - bool isODHigh = (0U != (base->MCONFIG & I3C_MCONFIG_ODHPP_MASK)) ? true : false; - - /* Find out the div to generate target freq */ - freq = sourceClock_Hz / 2UL; - /* ppFreq = FCLK / 2 / (PPBAUD + 1)), 0 <= PPBAUD <= 15 */ - /* We need PPBAUD generate 12.5MHz or so. */ - div = freq / i3cPPBaud_HZ; - div = (div == 0UL) ? 1UL : div; - if (freq / div > i3cPPBaudMax_HZ) - { - div++; - } - assert(div <= FSL_I3C_PPBAUD_DIV_MAX); - ppBaud = div - 1UL; - freq /= div; - - i3cPPLow_Ns = (uint32_t)(NSEC_PER_SEC / (2UL * freq)); - - /* We need ODBAUD generate 2.5MHz or so. */ - if (isODHigh) - { - /* odFreq = (2*freq) / (ODBAUD + 2), 1 <= ODBAUD <= 255 */ - div = (2UL * freq) / i3cODBaud_HZ; - div = div < 2UL ? 2UL : div; - if ((2UL * freq / div) > i3cODBaudMax_HZ) - { - div++; - } - odBaud = div - 2UL; - freq = (2UL * freq) / div; - } - else - { - /* odFreq = ppFreq / (ODBAUD + 1), 1 <= ODBAUD <= 255 */ - div = freq / i3cODBaud_HZ; - div = div < 1UL ? 1UL : div; - if (freq / div > i3cODBaudMax_HZ) - { - div++; - } - odBaud = div - 1UL; - freq /= div; - } - - i3cOdLow_Ns = (odBaud + 1UL) * i3cPPLow_Ns; - - /* i2cFreq = odFreq / (I2CBAUD + 1), 0 <= I2CBAUD <= 7 (I2CBAUD need << 1 in register) */ - /* i2cFreq = NSEC_PER_SEC / (I2CBAUD + 1)*i3cOdLow_Ns */ - divEven = (sourceClock_Hz / i2cBaud_HZ) / (2UL * (ppBaud + 1UL) * (odBaud + 1UL)); - divEven = divEven == 0UL ? 1UL : divEven; - errRate0 = I3C_CalcErrorRatio((uint32_t)(NSEC_PER_SEC / (2UL * divEven * i3cOdLow_Ns)), i2cBaud_HZ); - - divOdd = ((sourceClock_Hz / i2cBaud_HZ) / ((ppBaud + 1UL) * (odBaud + 1UL) - 1UL)) / 2UL; - divOdd = divOdd == 0UL ? 1UL : divOdd; - errRate1 = I3C_CalcErrorRatio((uint32_t)(NSEC_PER_SEC / ((2UL * divOdd + 1UL) * i3cOdLow_Ns)), i2cBaud_HZ); - - if (errRate0 < FSL_I3C_ERROR_RATE_MAX || errRate1 < FSL_I3C_ERROR_RATE_MAX) - { - /* Use this div */ - i2cBaud = errRate0 < errRate1 ? (divEven - 1UL) * 2UL : (divOdd - 1UL) * 2UL + 1UL; - } - else - { - /* Use div + 1, unless current freq is already lower than desired. */ - i2cBaud = freq / divEven < i2cBaud_HZ ? (divEven - 1UL) * 2UL : divEven * 2UL; - } - - base->MCONFIG = (base->MCONFIG & ~(I3C_MCONFIG_PPBAUD_MASK | I3C_MCONFIG_PPLOW_MASK | I3C_MCONFIG_ODBAUD_MASK | - I3C_MCONFIG_I2CBAUD_MASK)) | - I3C_MCONFIG_PPBAUD(ppBaud) | I3C_MCONFIG_ODBAUD(odBaud) | I3C_MCONFIG_I2CBAUD(i2cBaud); -} - -/*! - * brief Sends a START signal and slave address on the I2C/I3C bus, receive size is also specified - * in the call. - * This function is used to initiate a new master mode transfer. First, the bus state is checked to ensure - * that another master is not occupying the bus. Then a START signal is transmitted, followed by the - * 7-bit address specified in the a address parameter. Note that this function does not actually wait - * until the START and address are successfully sent on the bus before returning. - * - * param base The I3C peripheral base address. - * param type The bus type to use in this transaction. - * param address 7-bit slave device address, in bits [6:0]. - * param dir Master transfer direction, either #kI3C_Read or #kI3C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * param rxSize Read terminate size for the followed read transfer, limit to 255 bytes. - * retval #kStatus_Success START signal and address were successfully enqueued in the transmit FIFO. - * retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - */ -status_t I3C_MasterStartWithRxSize( - I3C_Type *base, i3c_bus_type_t type, uint8_t address, i3c_direction_t dir, uint8_t rxSize) -{ - i3c_master_state_t masterState = I3C_MasterGetState(base); - bool checkDdrState = (type == kI3C_TypeI3CDdr) ? (masterState != kI3C_MasterStateDdr) : true; - if ((masterState != kI3C_MasterStateIdle) && (masterState != kI3C_MasterStateNormAct) && checkDdrState) - { - return kStatus_I3C_Busy; - } - - return I3C_MasterRepeatedStartWithRxSize(base, type, address, dir, rxSize); -} - -/*! - * brief Sends a START signal and slave address on the I2C/I3C bus. - * - * This function is used to initiate a new master mode transfer. First, the bus state is checked to ensure - * that another master is not occupying the bus. Then a START signal is transmitted, followed by the - * 7-bit address specified in the a address parameter. Note that this function does not actually wait - * until the START and address are successfully sent on the bus before returning. - * - * param base The I3C peripheral base address. - * param type The bus type to use in this transaction. - * param address 7-bit slave device address, in bits [6:0]. - * param dir Master transfer direction, either #kI3C_Read or #kI3C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * retval #kStatus_Success START signal and address were successfully enqueued in the transmit FIFO. - * retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - */ -status_t I3C_MasterStart(I3C_Type *base, i3c_bus_type_t type, uint8_t address, i3c_direction_t dir) -{ - i3c_master_state_t masterState = I3C_MasterGetState(base); - bool checkDdrState = (type == kI3C_TypeI3CDdr) ? (masterState != kI3C_MasterStateDdr) : true; - if ((masterState != kI3C_MasterStateIdle) && (masterState != kI3C_MasterStateNormAct) && checkDdrState) - { - return kStatus_I3C_Busy; - } - - return I3C_MasterStartWithRxSize(base, type, address, dir, 0); -} - -/*! - * brief Sends a repeated START signal and slave address on the I2C/I3C bus, receive size is also specified - * in the call. - * - * This function is used to send a Repeated START signal when a transfer is already in progress. Like - * I3C_MasterStart(), it also sends the specified 7-bit address. Call this API also configures the read - * terminate size for the following read transfer. For example, set the rxSize = 2, the following read transfer - * will be terminated after two bytes of data received. Write transfer will not be affected by the rxSize - * configuration. - * - * note This function exists primarily to maintain compatible APIs between I3C and I2C drivers, - * as well as to better document the intent of code that uses these APIs. - * - * param base The I3C peripheral base address. - * param type The bus type to use in this transaction. - * param address 7-bit slave device address, in bits [6:0]. - * param dir Master transfer direction, either #kI3C_Read or #kI3C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * param rxSize Read terminate size for the followed read transfer, limit to 255 bytes. - * retval #kStatus_Success Repeated START signal and address were successfully enqueued in the transmit FIFO. - */ -status_t I3C_MasterRepeatedStartWithRxSize( - I3C_Type *base, i3c_bus_type_t type, uint8_t address, i3c_direction_t dir, uint8_t rxSize) -{ - uint32_t mctrlVal; - - /* Clear all flags. */ - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - -#if defined(FSL_FEATURE_I3C_HAS_ERRATA_051617) && (FSL_FEATURE_I3C_HAS_ERRATA_051617) - /* ERRATA051617: When used as I2C controller generates repeated START randomly before the STOP under PVT condition. - This issue is caused by a glitch at the output of an internal clock MUX. The glitch when generates acts as a clock - pulse which causes the SDA line to fall early during SCL high period and creates the unintended Repeated START before - actual STOP. */ - if (type == kI3C_TypeI2C) - { - base->MCONFIG |= I3C_MCONFIG_SKEW(1); - } - else - { - base->MCONFIG &= ~I3C_MCONFIG_SKEW_MASK; - } -#endif - - /* Issue start command. */ - mctrlVal = base->MCTRL; - mctrlVal &= ~(I3C_MCTRL_TYPE_MASK | I3C_MCTRL_REQUEST_MASK | I3C_MCTRL_DIR_MASK | I3C_MCTRL_ADDR_MASK | - I3C_MCTRL_RDTERM_MASK); - mctrlVal |= I3C_MCTRL_TYPE(type) | I3C_MCTRL_REQUEST(kI3C_RequestEmitStartAddr) | I3C_MCTRL_DIR(dir) | - I3C_MCTRL_ADDR(address) | I3C_MCTRL_RDTERM(rxSize); - - base->MCTRL = mctrlVal; - - return kStatus_Success; -} -/*! - * brief Sends a STOP signal on the I2C/I3C bus. - * - * This function does not return until the STOP signal is seen on the bus, or an error occurs. - * - * param base The I3C peripheral base address. - * retval #kStatus_Success The STOP signal was successfully sent on the bus and the transaction terminated. - * retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * retval #kStatus_I3C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_I3C_FifoError FIFO under run or overrun. - * retval #kStatus_I3C_ArbitrationLost Arbitration lost error. - * retval #kStatus_I3C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t I3C_MasterStop(I3C_Type *base) -{ - return I3C_MasterEmitStop(base, true); -} - -/*! - * brief I3C master emit request. - * - * param base The I3C peripheral base address. - * param masterReq I3C master request of type #i3c_bus_request_t - */ -void I3C_MasterEmitRequest(I3C_Type *base, i3c_bus_request_t masterReq) -{ - uint32_t mctrlReg = base->MCTRL; - - mctrlReg &= ~I3C_MCTRL_REQUEST_MASK; - - if (masterReq == kI3C_RequestProcessDAA) - { - mctrlReg &= ~I3C_MCTRL_TYPE_MASK; - } - - mctrlReg |= I3C_MCTRL_REQUEST(masterReq); - - base->MCTRL = mctrlReg; -} - -/*! - * brief I3C master register IBI rule. - * - * param base The I3C peripheral base address. - * param ibiRule Pointer to ibi rule description of type #i3c_register_ibi_addr_t - */ -void I3C_MasterRegisterIBI(I3C_Type *base, i3c_register_ibi_addr_t *ibiRule) -{ - assert(NULL != ibiRule); - uint32_t ruleValue = I3C_MIBIRULES_MSB0_MASK; - - for (uint32_t count = 0; count < ARRAY_SIZE(ibiRule->address); count++) - { - ruleValue |= ((uint32_t)ibiRule->address[count]) << (count * I3C_MIBIRULES_ADDR1_SHIFT); - } - - ruleValue &= ~I3C_MIBIRULES_NOBYTE_MASK; - - if (!ibiRule->ibiHasPayload) - { - ruleValue |= I3C_MIBIRULES_NOBYTE_MASK; - } - - base->MIBIRULES = ruleValue; -} - -/*! - * brief I3C master get IBI rule. - * - * param base The I3C peripheral base address. - * param ibiRule Pointer to store the read out ibi rule description. - */ -void I3C_MasterGetIBIRules(I3C_Type *base, i3c_register_ibi_addr_t *ibiRule) -{ - assert(NULL != ibiRule); - - uint32_t ruleValue = base->MIBIRULES; - - for (uint32_t count = 0; count < ARRAY_SIZE(ibiRule->address); count++) - { - ibiRule->address[count] = - (uint8_t)(ruleValue >> (count * I3C_MIBIRULES_ADDR1_SHIFT)) & I3C_MIBIRULES_ADDR0_MASK; - } - - ibiRule->ibiHasPayload = (0U == (ruleValue & I3C_MIBIRULES_NOBYTE_MASK)); -} - -/*! - * brief Performs a polling receive transfer on the I2C/I3C bus. - * - * param base The I3C peripheral base address. - * param rxBuff The pointer to the data to be transferred. - * param rxSize The length in bytes of the data to be transferred. - * param flags Bit mask of options for the transfer. See enumeration #_i3c_master_transfer_flags for available options. - * retval #kStatus_Success Data was received successfully. - * retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * retval #kStatus_I3C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_I3C_FifoError FIFO under run or overrun. - * retval #kStatus_I3C_ArbitrationLost Arbitration lost error. - * retval #kStatus_I3C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t I3C_MasterReceive(I3C_Type *base, void *rxBuff, size_t rxSize, uint32_t flags) -{ - status_t result = kStatus_Success; - bool isRxAutoTerm = ((flags & (uint32_t)kI3C_TransferRxAutoTermFlag) != 0UL); - bool completed = false; - uint32_t status; - uint8_t *buf; - - assert(NULL != rxBuff); - - /* Handle empty read. */ - if (rxSize == 0UL) - { - return kStatus_Success; - } - -#if I3C_RETRY_TIMES - uint32_t waitTimes = I3C_RETRY_TIMES; -#endif - - /* Receive data */ - buf = (uint8_t *)rxBuff; - - while ((rxSize != 0UL) || !completed) - { -#if I3C_RETRY_TIMES - if (--waitTimes == 0) - { - return kStatus_I3C_Timeout; - } -#endif - /* Check for errors. */ - result = I3C_MasterCheckAndClearError(base, I3C_MasterGetErrorStatusFlags(base)); - if (kStatus_Success != result) - { - return result; - } - - /* Check complete flag */ - if (!completed) - { - status = I3C_MasterGetStatusFlags(base) & (uint32_t)kI3C_MasterCompleteFlag; - if (0UL != status) - { - completed = true; - /* Clear complete flag */ - I3C_MasterClearStatusFlags(base, (uint32_t)kI3C_MasterCompleteFlag); - /* Send stop if needed */ - if ((flags & (uint32_t)kI3C_TransferNoStopFlag) == 0UL) - { - if (I3C_MasterGetState(base) == kI3C_MasterStateDdr) - { - I3C_MasterEmitRequest(base, kI3C_RequestForceExit); - result = I3C_MasterWaitForCtrlDone(base, false); - } - else - { - result = I3C_MasterEmitStop(base, false); - } - if (kStatus_Success != result) - { - return result; - } - } - } - } - - /* Check RX data */ - if ((0UL != rxSize) && (0UL != (base->MDATACTRL & I3C_MDATACTRL_RXCOUNT_MASK))) - { - *buf++ = (uint8_t)(base->MRDATAB & I3C_MRDATAB_VALUE_MASK); - rxSize--; - if ((flags & (uint32_t)kI3C_TransferDisableRxTermFlag) == 0UL) - { - if ((!isRxAutoTerm) && (rxSize == 1U)) - { - base->MCTRL |= I3C_MCTRL_RDTERM(1U); - } - } - } - } - - /* Wait idle if stop is sent. */ - if ((flags & (uint32_t)kI3C_TransferNoStopFlag) == 0UL) - { -#if I3C_RETRY_TIMES - while ((I3C_MasterGetState(base) != kI3C_MasterStateIdle) && --waitTimes) -#else - while (I3C_MasterGetState(base) != kI3C_MasterStateIdle) -#endif - { - } - } - return result; -} - -/*! - * brief Performs a polling send transfer on the I2C/I3C bus. - * - * Sends up to a txSize number of bytes to the previously addressed slave device. The slave may - * reply with a NAK to any byte in order to terminate the transfer early. If this happens, this - * function returns #kStatus_I3C_Nak. - * - * param base The I3C peripheral base address. - * param txBuff The pointer to the data to be transferred. - * param txSize The length in bytes of the data to be transferred. - * param flags Bit mask of options for the transfer. See enumeration #_i3c_master_transfer_flags for available options. - * retval #kStatus_Success Data was sent successfully. - * retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * retval #kStatus_I3C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_I3C_FifoError FIFO under run or over run. - * retval #kStatus_I3C_ArbitrationLost Arbitration lost error. - * retval #kStatus_I3C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t I3C_MasterSend(I3C_Type *base, const void *txBuff, size_t txSize, uint32_t flags) -{ - i3c_puint8_to_u32_t buf; - buf.cpuint8 = (const uint8_t *)((const void *)txBuff); - status_t result = kStatus_Success; - bool enableWord = ((flags & (uint32_t)kI3C_TransferWordsFlag) == (uint32_t)kI3C_TransferWordsFlag) ? true : false; - uint8_t byteCounts = enableWord ? 2U : 1U; - - assert(NULL != txBuff); - if (enableWord) - { - assert(txSize % 2UL == 0UL); - } - - /* Send data buffer */ - while (0UL != txSize) - { - /* Wait until there is room in the fifo. This also checks for errors. */ - result = I3C_MasterWaitForTxReady(base, byteCounts); - if (kStatus_Success != result) - { - return result; - } - - /* Write byte into I3C master data register. */ - if (txSize > byteCounts) - { - if (enableWord) - { - base->MWDATAH = (uint32_t)buf.cpuint8[1] << 8UL | (uint32_t)buf.cpuint8[0]; - } - else - { - base->MWDATAB = *buf.cpuint8; - } - } - else - { - if (enableWord) - { - base->MWDATAHE = (uint32_t)buf.cpuint8[1] << 8UL | (uint32_t)buf.cpuint8[0]; - } - else - { - base->MWDATABE = *buf.cpuint8; - } - } - - buf.u32 = buf.u32 + byteCounts; - txSize = txSize - byteCounts; - } - - result = I3C_MasterWaitForComplete(base, false); - if ((result == kStatus_Success) && ((flags & (uint32_t)kI3C_TransferNoStopFlag) == 0UL)) - { - if (I3C_MasterGetState(base) == kI3C_MasterStateDdr) - { - I3C_MasterEmitRequest(base, kI3C_RequestForceExit); - result = I3C_MasterWaitForCtrlDone(base, false); - } - else - { - result = I3C_MasterEmitStop(base, true); - } - } - - return result; -} - -/*! - * brief Performs a DAA in the i3c bus with specified temporary baud rate. - * - * param base The I3C peripheral base address. - * param addressList The pointer for address list which is used to do DAA. - * param count The address count in the address list. - * param daaBaudRate The temporary baud rate in DAA process, NULL for using initial setting. - * The initial setting is set back between the completion of the DAA and the return of this function. - * retval #kStatus_Success The transaction was started successfully. - * retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - * retval #kStatus_I3C_SlaveCountExceed The I3C slave count has exceed the definition in I3C_MAX_DEVCNT. - */ -status_t I3C_MasterProcessDAASpecifiedBaudrate(I3C_Type *base, - uint8_t *addressList, - uint32_t count, - i3c_master_daa_baudrate_t *daaBaudRate) -{ - assert(addressList != NULL); - assert(count != 0U); - - status_t result = kStatus_Success; - uint8_t rxBuffer[8] = {0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU}; - uint32_t masterConfig = 0; - uint32_t devCount = 0; - uint8_t rxSize = 0; - bool mctrlDone = false; - i3c_baudrate_hz_t baudRate_Hz; - uint32_t errStatus; - uint32_t status; - size_t rxCount; - - /* Return an error if the bus is already in use not by us. */ - result = I3C_CheckForBusyBus(base); - if (kStatus_Success != result) - { - return result; - } - - /* Clear all flags. */ - I3C_MasterClearErrorStatusFlags(base, (uint32_t)kMasterErrorFlags); - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - - /* Disable I3C IRQ sources while we configure stuff. */ - uint32_t enabledInts = I3C_MasterGetEnabledInterrupts(base); - I3C_MasterDisableInterrupts(base, enabledInts); - - /* Temporarily adjust baud rate before DAA. */ - if (daaBaudRate != NULL) - { - masterConfig = base->MCONFIG; - /* Set non-zero value for I2C baud rate which is useless here. */ - baudRate_Hz.i2cBaud = 1; - baudRate_Hz.i3cOpenDrainBaud = daaBaudRate->i3cOpenDrainBaud; - baudRate_Hz.i3cPushPullBaud = daaBaudRate->i3cPushPullBaud; - I3C_MasterSetBaudRate(base, &baudRate_Hz, daaBaudRate->sourceClock_Hz); - } - - /* Emit process DAA */ - I3C_MasterEmitRequest(base, kI3C_RequestProcessDAA); - - do - { - status = I3C_MasterGetStatusFlags(base); - - /* Check for error flags. */ - errStatus = I3C_MasterGetErrorStatusFlags(base); - result = I3C_MasterCheckAndClearError(base, errStatus); - if (kStatus_Success != result) - { - break; - } - - if ((!mctrlDone) || (rxSize < 8U)) - { - I3C_MasterGetFifoCounts(base, &rxCount, NULL); - - if (rxCount != 0U) - { - rxBuffer[rxSize++] = (uint8_t)(base->MRDATAB & I3C_MRDATAB_VALUE_MASK); - } - - if ((status & (uint32_t)kI3C_MasterControlDoneFlag) != 0U) - { - I3C_MasterClearStatusFlags(base, (uint32_t)kI3C_MasterControlDoneFlag); - mctrlDone = true; - } - } - else if ((I3C_MasterGetState(base) == kI3C_MasterStateDaa) && - (0UL != (I3C_MasterGetStatusFlags(base) & (uint32_t)kI3C_MasterBetweenFlag))) - { - if (((devCount + 1UL) > count) || ((devCount + 1UL) > I3C_MAX_DEVCNT)) - { - result = kStatus_I3C_SlaveCountExceed; - break; - } - - /* Assign the dynamic address from address list. */ - devList[devCount].dynamicAddr = *addressList++; - base->MWDATAB = devList[devCount].dynamicAddr; - - /* Emit process DAA again. */ - I3C_MasterEmitRequest(base, kI3C_RequestProcessDAA); - - devList[devCount].vendorID = (((uint16_t)rxBuffer[0] << 8U | (uint16_t)rxBuffer[1]) & 0xFFFEU) >> 1U; - devList[devCount].partNumber = ((uint32_t)rxBuffer[2] << 24U | (uint32_t)rxBuffer[3] << 16U | - (uint32_t)rxBuffer[4] << 8U | (uint32_t)rxBuffer[5]); - devList[devCount].bcr = rxBuffer[6]; - devList[devCount].dcr = rxBuffer[7]; - devCount++; - usedDevCount++; - - /* Ready to handle next device. */ - mctrlDone = false; - rxSize = 0; - } - else - { - /* Intentional empty */ - } - } while ((status & (uint32_t)kI3C_MasterCompleteFlag) != (uint32_t)kI3C_MasterCompleteFlag); - - /* Master stops DAA if slave device number exceeds the prepared address number. */ - if (result == kStatus_I3C_SlaveCountExceed) - { - /* Send the STOP signal */ - base->MCTRL = (base->MCTRL & ~(I3C_MCTRL_REQUEST_MASK | I3C_MCTRL_DIR_MASK | I3C_MCTRL_RDTERM_MASK)) | - I3C_MCTRL_REQUEST(kI3C_RequestEmitStop); - } - - /* Set back initial baud rate after DAA is over. */ - if (daaBaudRate != NULL) - { - base->MCONFIG = masterConfig; - } - - /* Clear all flags. */ - I3C_MasterClearErrorStatusFlags(base, (uint32_t)kMasterErrorFlags); - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - - /* Enable I3C IRQ sources while we configure stuff. */ - I3C_MasterEnableInterrupts(base, enabledInts); - - return result; -} - -/*! - * brief Get device information list after DAA process is done. - * - * param base The I3C peripheral base address. - * param[out] count The pointer to store the available device count. - * return Pointer to the i3c_device_info_t array. - */ -i3c_device_info_t *I3C_MasterGetDeviceListAfterDAA(I3C_Type *base, uint8_t *count) -{ - assert(NULL != count); - - *count = usedDevCount; - - return devList; -} - -/*! - * @brief introduce function I3C_MasterClearFlagsAndEnableIRQ. - * - * This function was used of Clear all flags and Enable I3C IRQ sources for @param *base. - * - * @param base The I3C peripheral base address. - */ -static void I3C_MasterClearFlagsAndEnableIRQ(I3C_Type *base) -{ - /* Clear all flags. */ - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - /* Enable I3C IRQ sources. */ - I3C_MasterEnableInterrupts(base, (uint32_t)kMasterIrqFlags); -} - -/*! - * @brief introduce function I3C_MasterTransferNoStartFlag. - * - * This function was used of Check if device request wins arbitration. - * - * @param base The I3C peripheral base address. - * @param transfer Pointer to the transfer structure. - * @retval #true if the device wins arbitration. - * @retval #false if the device not wins arbitration. - */ -static bool I3C_MasterTransferNoStartFlag(I3C_Type *base, i3c_master_transfer_t *transfer) -{ - /* Wait tx fifo empty. */ - size_t txCount = 0xFFUL; - - while (txCount != 0U) - { - I3C_MasterGetFifoCounts(base, NULL, &txCount); - } - - /* Check if device request wins arbitration. */ - if (0UL != (I3C_MasterGetStatusFlags(base) & (uint32_t)kI3C_MasterArbitrationWonFlag)) - { - I3C_MasterClearFlagsAndEnableIRQ(base); - return true; - } - return false; -} - -/*! - * brief Performs a master polling transfer on the I2C/I3C bus. - * - * note The API does not return until the transfer succeeds or fails due - * to error happens during transfer. - * - * param base The I3C peripheral base address. - * param transfer Pointer to the transfer structure. - * retval #kStatus_Success Data was received successfully. - * retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * retval #kStatus_I3C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_I3C_FifoError FIFO under run or overrun. - * retval #kStatus_I3C_ArbitrationLost Arbitration lost error. - * retval #kStatus_I3C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t I3C_MasterTransferBlocking(I3C_Type *base, i3c_master_transfer_t *transfer) -{ - assert(NULL != transfer); - assert(transfer->subaddressSize <= sizeof(transfer->subaddress)); - - status_t result = kStatus_Success; - i3c_direction_t direction = transfer->direction; - i3c_master_state_t masterState = I3C_MasterGetState(base); - bool checkDdrState = false; - i3c_rx_term_ops_t rxTermOps; - - /* Return an error if the bus is already in use not by us. */ - checkDdrState = (transfer->busType == kI3C_TypeI3CDdr) ? (masterState != kI3C_MasterStateDdr) : true; - - if ((masterState != kI3C_MasterStateIdle) && (masterState != kI3C_MasterStateNormAct) && checkDdrState) - { - return kStatus_I3C_Busy; - } - - /* Clear all flags. */ - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - /* Reset fifos. These flags clear automatically. */ - base->MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - - /* Disable I3C IRQ sources while we configure stuff. */ - I3C_MasterDisableInterrupts(base, (uint32_t)kMasterIrqFlags); - - if (transfer->busType != kI3C_TypeI3CDdr) - { - direction = (0UL != transfer->subaddressSize) ? kI3C_Write : transfer->direction; - } - - /* True: Set Rx termination bytes at start point, False: Set Rx termination one bytes in advance. */ - if ((transfer->flags & (uint32_t)kI3C_TransferDisableRxTermFlag) != 0U) - { - rxTermOps = kI3C_RxTermDisable; - } - else if (transfer->dataSize <= 255U) - { - rxTermOps = kI3C_RxAutoTerm; - } - else - { - rxTermOps = kI3C_RxTermLastByte; - } - - if (0UL != (transfer->flags & (uint32_t)kI3C_TransferStartWithBroadcastAddr)) - { - if (0UL != (transfer->flags & (uint32_t)kI3C_TransferNoStartFlag)) - { - return kStatus_InvalidArgument; - } - - if (0UL != (transfer->flags & (uint32_t)kI3C_TransferRepeatedStartFlag)) - { - return kStatus_InvalidArgument; - } - - /* Issue 0x7E as start. */ - result = I3C_MasterStart(base, transfer->busType, 0x7E, kI3C_Write); - if (result != kStatus_Success) - { - return result; - } - - result = I3C_MasterWaitForCtrlDone(base, false); - if (result != kStatus_Success) - { - return result; - } - } - - if (0UL == (transfer->flags & (uint32_t)kI3C_TransferNoStartFlag)) - { - if ((direction == kI3C_Read) && (rxTermOps == kI3C_RxAutoTerm)) - { - result = I3C_MasterStartWithRxSize(base, transfer->busType, transfer->slaveAddress, direction, - (uint8_t)transfer->dataSize); - } - else - { - result = I3C_MasterStart(base, transfer->busType, transfer->slaveAddress, direction); - } - if (result != kStatus_Success) - { - return result; - } - - result = I3C_MasterWaitForCtrlDone(base, false); - if (result != kStatus_Success) - { - return result; - } - - if (true == I3C_MasterTransferNoStartFlag(base, transfer)) - { - return kStatus_I3C_IBIWon; - } - } - else - { - if ((direction == kI3C_Read) && (rxTermOps != kI3C_RxTermDisable)) - { - /* Can't set Rx termination more than one bytes in advance without START. */ - rxTermOps = kI3C_RxTermLastByte; - } - } - - /* Subaddress, MSB first. */ - if (0U != transfer->subaddressSize) - { - uint32_t subaddressRemaining = transfer->subaddressSize; - while (0UL != subaddressRemaining--) - { - uint8_t subaddressByte = (uint8_t)((transfer->subaddress >> (8UL * subaddressRemaining)) & 0xFFUL); - - result = I3C_MasterWaitForTxReady(base, 1U); - - if ((0UL == subaddressRemaining) && ((transfer->direction == kI3C_Read) || (0UL == transfer->dataSize)) && - (transfer->busType != kI3C_TypeI3CDdr)) - { - base->MWDATABE = subaddressByte; - result = I3C_MasterWaitForComplete(base, false); - if (kStatus_Success != result) - { - if (result == kStatus_I3C_Nak) - { - (void)I3C_MasterEmitStop(base, true); - } - I3C_MasterClearFlagsAndEnableIRQ(base); - return result; - } - } - else - { - base->MWDATAB = subaddressByte; - } - } - /* Need to send repeated start if switching directions to read. */ - if ((transfer->busType != kI3C_TypeI3CDdr) && (0UL != transfer->dataSize) && (transfer->direction == kI3C_Read)) - { - if (rxTermOps == kI3C_RxAutoTerm) - { - result = I3C_MasterRepeatedStartWithRxSize(base, transfer->busType, transfer->slaveAddress, kI3C_Read, - (uint8_t)transfer->dataSize); - } - else - { - result = I3C_MasterRepeatedStart(base, transfer->busType, transfer->slaveAddress, kI3C_Read); - } - - if (kStatus_Success != result) - { - I3C_MasterClearFlagsAndEnableIRQ(base); - return result; - } - - result = I3C_MasterWaitForCtrlDone(base, false); - if (result != kStatus_Success) - { - return result; - } - } - } - - if (rxTermOps == kI3C_RxAutoTerm) - { - transfer->flags |= (uint32_t)kI3C_TransferRxAutoTermFlag; - } - else - { - transfer->flags &= ~(uint32_t)kI3C_TransferRxAutoTermFlag; - } - - /* Transmit data. */ - if ((transfer->direction == kI3C_Write) && (transfer->dataSize > 0UL)) - { - /* Send Data. */ - result = I3C_MasterSend(base, transfer->data, transfer->dataSize, transfer->flags); - } - /* Receive Data. */ - else if ((transfer->direction == kI3C_Read) && (transfer->dataSize > 0UL)) - { - result = I3C_MasterReceive(base, transfer->data, transfer->dataSize, transfer->flags); - } - else - { - if ((transfer->flags & (uint32_t)kI3C_TransferNoStopFlag) == 0UL) - { - result = I3C_MasterEmitStop(base, true); - } - } - - if (result == kStatus_I3C_Nak) - { - (void)I3C_MasterEmitStop(base, true); - } - - I3C_MasterClearFlagsAndEnableIRQ(base); - - return result; -} - -/*! - * brief Creates a new handle for the I3C master non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the I3C_MasterTransferAbort() API shall be called. - * - * - * note The function also enables the NVIC IRQ for the input I3C. Need to notice - * that on some SoCs the I3C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - * - * param base The I3C peripheral base address. - * param[out] handle Pointer to the I3C master driver handle. - * param callback User provided pointer to the asynchronous callback function. - * param userData User provided pointer to the application callback data. - */ -void I3C_MasterTransferCreateHandle(I3C_Type *base, - i3c_master_handle_t *handle, - const i3c_master_transfer_callback_t *callback, - void *userData) -{ - uint32_t instance; - - assert(NULL != handle); - - /* Clear out the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Look up instance number */ - instance = I3C_GetInstance(base); - - /* Save base and instance. */ - handle->callback = *callback; - handle->userData = userData; - - /* Save this handle for IRQ use. */ - s_i3cMasterHandle[instance] = handle; - - /* Set irq handler. */ - s_i3cMasterIsr = I3C_MasterTransferHandleIRQ; - - /* Clear all flags. */ - I3C_MasterClearErrorStatusFlags(base, (uint32_t)kMasterErrorFlags); - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - /* Reset fifos. These flags clear automatically. */ - base->MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - - /* Enable NVIC IRQ, this only enables the IRQ directly connected to the NVIC. - In some cases the I3C IRQ is configured through INTMUX, user needs to enable - INTMUX IRQ in application code. */ - (void)EnableIRQ(kI3cIrqs[instance]); - - /* Clear internal IRQ enables and enable NVIC IRQ. */ - I3C_MasterEnableInterrupts(base, (uint32_t)kMasterIrqFlags); -} - -static void I3C_TransferStateMachineIBIWonState(I3C_Type *base, - i3c_master_handle_t *handle, - i3c_master_state_machine_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - if (stateParams->masterState == kI3C_MasterStateIbiAck) - { - handle->ibiType = I3C_GetIBIType(base); - if (handle->callback.ibiCallback != NULL) - { - handle->callback.ibiCallback(base, handle, handle->ibiType, kI3C_IbiAckNackPending); - } - else - { - I3C_MasterEmitIBIResponse(base, kI3C_IbiRespNack); - } - } - - /* Make sure there is data in the rx fifo. */ - if (0UL != stateParams->rxCount) - { - if ((handle->ibiBuff == NULL) && (handle->callback.ibiCallback != NULL)) - { - handle->callback.ibiCallback(base, handle, kI3C_IbiNormal, kI3C_IbiDataBuffNeed); - } - uint8_t tempData = (uint8_t)base->MRDATAB; - if (handle->ibiBuff != NULL) - { - handle->ibiBuff[handle->ibiPayloadSize++] = tempData; - } - (stateParams->rxCount)--; - return; - } - else if (0UL != (stateParams->status & (uint32_t)kI3C_MasterCompleteFlag)) - { - handle->ibiType = I3C_GetIBIType(base); - handle->ibiAddress = I3C_GetIBIAddress(base); - stateParams->state_complete = true; - stateParams->result = kStatus_I3C_IBIWon; - } - else - { - stateParams->state_complete = true; - } -} - -static void I3C_TransferStateMachineSendCommandState(I3C_Type *base, - i3c_master_handle_t *handle, - i3c_master_state_machine_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - I3C_MasterEnableInterrupts(base, (uint32_t)kI3C_MasterTxReadyFlag); - /* Make sure there is room in the tx fifo for the next command. */ - if (0UL == (stateParams->txCount)--) - { - stateParams->state_complete = true; - return; - } - if (handle->transfer.subaddressSize > 1U) - { - handle->transfer.subaddressSize--; - base->MWDATAB = (uint8_t)((handle->transfer.subaddress) >> (8U * handle->transfer.subaddressSize)); - } - else if (handle->transfer.subaddressSize == 1U) - { - handle->transfer.subaddressSize--; - - if ((handle->transfer.direction == kI3C_Read) || (0UL == handle->transfer.dataSize)) - { - base->MWDATABE = (uint8_t)((handle->transfer.subaddress) >> (8U * handle->transfer.subaddressSize)); - - if (handle->transfer.busType != kI3C_TypeI3CDdr) - { - if (0UL == handle->transfer.dataSize) - { - handle->state = (uint8_t)kWaitForCompletionState; - } - else - { - /* xfer->dataSize != 0U, xfer->direction = kI3C_Read */ - handle->state = (uint8_t)kWaitRepeatedStartCompleteState; - } - } - else - { - handle->state = (uint8_t)kTransferDataState; - } - } - else - { - /* Next state, transfer data. */ - handle->state = (uint8_t)kTransferDataState; - base->MWDATAB = (uint8_t)((handle->transfer.subaddress) >> (8U * handle->transfer.subaddressSize)); - } - } - else - { - /* Eliminate misra 15.7*/ - } -} - -static void I3C_TransferStateMachineWaitRepeatedStartCompleteState(I3C_Type *base, - i3c_master_handle_t *handle, - i3c_master_state_machine_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - /* We stay in this state until the master complete. */ - if (0UL != (stateParams->status & (uint32_t)kI3C_MasterCompleteFlag)) - { - handle->state = (uint8_t)kTransferDataState; - I3C_MasterDisableInterrupts(base, (uint32_t)kI3C_MasterTxReadyFlag); - - if (handle->remainingBytes < 256U) - { - handle->rxTermOps = (handle->rxTermOps == kI3C_RxTermDisable) ? handle->rxTermOps : kI3C_RxAutoTerm; - stateParams->result = - I3C_MasterRepeatedStartWithRxSize(base, handle->transfer.busType, handle->transfer.slaveAddress, - kI3C_Read, (uint8_t)handle->remainingBytes); - } - else - { - stateParams->result = - I3C_MasterRepeatedStart(base, handle->transfer.busType, handle->transfer.slaveAddress, kI3C_Read); - } - } - - stateParams->state_complete = true; -} - -static void I3C_TransferStateMachineTransferDataState(I3C_Type *base, - i3c_master_handle_t *handle, - i3c_master_state_machine_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - - i3c_puint8_to_u32_t dataBuff; - if (handle->transfer.direction == kI3C_Write) - { - /* Make sure there is room in the tx fifo. */ - if (0UL == (stateParams->txCount)--) - { - stateParams->state_complete = true; - return; - } - - /* Put byte to send in fifo. */ - dataBuff.puint8 = (uint8_t *)handle->transfer.data; - if (handle->transfer.dataSize > 1U) - { - base->MWDATAB = *dataBuff.puint8; - } - else - { - base->MWDATABE = *dataBuff.puint8; - } - dataBuff.u32 = dataBuff.u32 + 1U; - (handle->transfer.dataSize)--; - handle->transfer.data = (void *)(dataBuff.puint8); - - /* Move to stop when the transfer is done. */ - if (--handle->remainingBytes == 0UL) - { - handle->state = (uint8_t)kWaitForCompletionState; - } - } - else - { - /* Make sure there is data in the rx fifo. */ - if (0UL == (stateParams->rxCount)--) - { - stateParams->state_complete = true; - return; - } - - /* Read byte from fifo. */ - dataBuff.puint8 = (uint8_t *)handle->transfer.data; - *dataBuff.puint8 = (uint8_t)base->MRDATAB; - dataBuff.u32 = dataBuff.u32 + 1U; - handle->transfer.data = (void *)(dataBuff.puint8); - - /* Move to stop when the transfer is done. */ - if (--handle->remainingBytes == 0UL) - { - handle->state = (uint8_t)kWaitForCompletionState; - } - - if ((handle->rxTermOps == kI3C_RxTermLastByte) && (handle->remainingBytes == 1UL)) - { - base->MCTRL |= I3C_MCTRL_RDTERM(1UL); - } - } -} - -static void I3C_TransferStateMachineWaitForCompletionState(i3c_master_handle_t *handle, - i3c_master_state_machine_param_t *stateParams) -{ - /* We stay in this state until the maste complete. */ - if (0UL != (stateParams->status & (uint32_t)kI3C_MasterCompleteFlag)) - { - handle->state = (uint8_t)kStopState; - } - else - { - stateParams->state_complete = true; - } -} - -static void I3C_TransferStateMachineStopState(I3C_Type *base, - i3c_master_handle_t *handle, - i3c_master_state_machine_param_t *stateParams) -{ - /* Only issue a stop transition if the caller requested it. */ - if (0UL == (handle->transfer.flags & (uint32_t)kI3C_TransferNoStopFlag)) - { - /* Make sure there is room in the tx fifo for the stop command. */ - if (0UL == (stateParams->txCount)--) - { - stateParams->state_complete = true; - return; - } - if (handle->transfer.busType == kI3C_TypeI3CDdr) - { - I3C_MasterEmitRequest(base, kI3C_RequestForceExit); - } - else - { - (void)I3C_MasterEmitStop(base, false); - } - } - stateParams->state_complete = true; -} - -static status_t I3C_RunTransferStateMachine(I3C_Type *base, i3c_master_handle_t *handle, bool *isDone) -{ - i3c_master_state_machine_param_t stateParams; - (void)memset(&stateParams, 0, sizeof(stateParams)); - - stateParams.result = kStatus_Success; - stateParams.state_complete = false; - - /* Set default isDone return value. */ - *isDone = false; - - uint32_t errStatus; - size_t txFifoSize = - 2UL << ((base->SCAPABILITIES & I3C_SCAPABILITIES_FIFOTX_MASK) >> I3C_SCAPABILITIES_FIFOTX_SHIFT); - - /* Check for errors. */ - stateParams.status = (uint32_t)I3C_MasterGetPendingInterrupts(base); - I3C_MasterClearStatusFlags(base, stateParams.status); - - stateParams.masterState = I3C_MasterGetState(base); - errStatus = I3C_MasterGetErrorStatusFlags(base); - stateParams.result = I3C_MasterCheckAndClearError(base, errStatus); - if (kStatus_Success != stateParams.result) - { - return stateParams.result; - } - - if (0UL != (stateParams.status & (uint32_t)kI3C_MasterSlave2MasterFlag)) - { - if (handle->callback.slave2Master != NULL) - { - handle->callback.slave2Master(base, handle->userData); - } - } - - if ((0UL != (stateParams.status & (uint32_t)kI3C_MasterSlaveStartFlag)) && - (handle->transfer.busType != kI3C_TypeI2C)) - { - handle->state = (uint8_t)kSlaveStartState; - } - - if ((stateParams.masterState == kI3C_MasterStateIbiRcv) || (stateParams.masterState == kI3C_MasterStateIbiAck)) - { - handle->state = (uint8_t)kIBIWonState; - } - - if (handle->state == (uint8_t)kIdleState) - { - return stateParams.result; - } - - /* Get fifo counts and compute room in tx fifo. */ - I3C_MasterGetFifoCounts(base, &stateParams.rxCount, &stateParams.txCount); - stateParams.txCount = txFifoSize - stateParams.txCount; - - while (!stateParams.state_complete) - { - /* Execute the state. */ - switch (handle->state) - { - case (uint8_t)kSlaveStartState: - /* Emit start + 0x7E */ - I3C_MasterEmitRequest(base, kI3C_RequestAutoIbi); - handle->state = (uint8_t)kIBIWonState; - stateParams.state_complete = true; - break; - - case (uint8_t)kIBIWonState: - I3C_TransferStateMachineIBIWonState(base, handle, &stateParams); - break; - - case (uint8_t)kSendCommandState: - I3C_TransferStateMachineSendCommandState(base, handle, &stateParams); - break; - - case (uint8_t)kWaitRepeatedStartCompleteState: - I3C_TransferStateMachineWaitRepeatedStartCompleteState(base, handle, &stateParams); - break; - - case (uint8_t)kTransferDataState: - I3C_TransferStateMachineTransferDataState(base, handle, &stateParams); - break; - - case (uint8_t)kWaitForCompletionState: - I3C_TransferStateMachineWaitForCompletionState(handle, &stateParams); - break; - - case (uint8_t)kStopState: - I3C_TransferStateMachineStopState(base, handle, &stateParams); - *isDone = true; - break; - - default: - assert(false); - break; - } - } - return stateParams.result; -} - -static status_t I3C_InitTransferStateMachine(I3C_Type *base, i3c_master_handle_t *handle) -{ - i3c_master_transfer_t *xfer = &handle->transfer; - status_t result = kStatus_Success; - i3c_direction_t direction = xfer->direction; - - if (xfer->busType != kI3C_TypeI3CDdr) - { - direction = (0UL != xfer->subaddressSize) ? kI3C_Write : xfer->direction; - } - - if (0UL != (xfer->flags & (uint32_t)kI3C_TransferStartWithBroadcastAddr)) - { - if (0UL != (xfer->flags & (uint32_t)kI3C_TransferNoStartFlag)) - { - return kStatus_InvalidArgument; - } - - if (0UL != (xfer->flags & (uint32_t)kI3C_TransferRepeatedStartFlag)) - { - return kStatus_InvalidArgument; - } - - /* Issue 0x7E as start. */ - result = I3C_MasterStart(base, xfer->busType, 0x7E, kI3C_Write); - if (result != kStatus_Success) - { - return result; - } - - result = I3C_MasterWaitForCtrlDone(base, false); - if (result != kStatus_Success) - { - return result; - } - } - - /* Handle no start option. */ - if (0U != (xfer->flags & (uint32_t)kI3C_TransferNoStartFlag)) - { - /* No need to send start flag, directly go to send command or data */ - if (xfer->subaddressSize > 0UL) - { - handle->state = (uint8_t)kSendCommandState; - } - else - { - if (direction == kI3C_Write) - { - /* Next state, send data. */ - handle->state = (uint8_t)kTransferDataState; - } - else - { - /* Only support write with no stop signal. */ - return kStatus_InvalidArgument; - } - } - I3C_MasterTransferHandleIRQ(base, handle); - return result; - } - /* If repeated start is requested, send repeated start. */ - else if (0U != (xfer->flags & (uint32_t)kI3C_TransferRepeatedStartFlag)) - { - result = I3C_MasterRepeatedStart(base, xfer->busType, xfer->slaveAddress, direction); - } - else /* For normal transfer, send start. */ - { - result = I3C_MasterStart(base, xfer->busType, xfer->slaveAddress, direction); - } - - if (xfer->subaddressSize > 0U) - { - handle->state = (uint8_t)kSendCommandState; - } - else if (xfer->dataSize != 0U) - { - handle->state = (uint8_t)kTransferDataState; - } - else - { - handle->state = (uint8_t)kStopState; - } - - if ((handle->remainingBytes < 256U) && (direction == kI3C_Read)) - { - handle->rxTermOps = (handle->rxTermOps == kI3C_RxTermDisable) ? handle->rxTermOps : kI3C_RxAutoTerm; - base->MCTRL |= I3C_MCTRL_RDTERM(handle->remainingBytes); - } - - return result; -} - -/*! - * brief Performs a non-blocking transaction on the I2C/I3C bus. - * - * param base The I3C peripheral base address. - * param handle Pointer to the I3C master driver handle. - * param transfer The pointer to the transfer descriptor. - * retval #kStatus_Success The transaction was started successfully. - * retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - */ -status_t I3C_MasterTransferNonBlocking(I3C_Type *base, i3c_master_handle_t *handle, i3c_master_transfer_t *transfer) -{ - assert(NULL != handle); - assert(NULL != transfer); - assert(transfer->subaddressSize <= sizeof(transfer->subaddress)); - i3c_master_state_t masterState = I3C_MasterGetState(base); - bool checkDdrState = false; - - /* Return busy if another transaction is in progress. */ - if (handle->state != (uint8_t)kIdleState) - { - return kStatus_I3C_Busy; - } - - /* Return an error if the bus is already in use not by us. */ - checkDdrState = (transfer->busType == kI3C_TypeI3CDdr) ? (masterState != kI3C_MasterStateDdr) : true; - if ((masterState != kI3C_MasterStateIdle) && (masterState != kI3C_MasterStateNormAct) && checkDdrState) - { - return kStatus_I3C_Busy; - } - - /* Disable I3C IRQ sources while we configure stuff. */ - I3C_MasterDisableInterrupts(base, (uint32_t)kMasterIrqFlags); - - /* Save transfer into handle. */ - handle->transfer = *transfer; - handle->remainingBytes = transfer->dataSize; - - /* Configure IBI response type. */ - base->MCTRL &= ~I3C_MCTRL_IBIRESP_MASK; - base->MCTRL |= I3C_MCTRL_IBIRESP(transfer->ibiResponse); - - /* Clear all flags. */ - I3C_MasterClearErrorStatusFlags(base, (uint32_t)kMasterErrorFlags); - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - /* Reset fifos. These flags clear automatically. */ - base->MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - - if ((transfer->flags & (uint32_t)kI3C_TransferDisableRxTermFlag) != 0U) - { - handle->rxTermOps = kI3C_RxTermDisable; - } - else if (transfer->dataSize <= 255U) - { - handle->rxTermOps = kI3C_RxAutoTerm; - } - else - { - handle->rxTermOps = kI3C_RxTermLastByte; - } - - /* Generate commands to send. */ - (void)I3C_InitTransferStateMachine(base, handle); - - /* Enable I3C internal IRQ sources. NVIC IRQ was enabled in CreateHandle() */ - I3C_MasterEnableInterrupts(base, (uint32_t)kMasterIrqFlags); - - if (transfer->direction == kI3C_Write) - { - I3C_MasterEnableInterrupts(base, (uint32_t)kI3C_MasterTxReadyFlag); - } - - return kStatus_Success; -} - -/*! - * brief Returns number of bytes transferred so far. - * param base The I3C peripheral base address. - * param handle Pointer to the I3C master driver handle. - * param[out] count Number of bytes transferred so far by the non-blocking transaction. - * retval #kStatus_Success - * retval #kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t I3C_MasterTransferGetCount(I3C_Type *base, i3c_master_handle_t *handle, size_t *count) -{ - assert(NULL != handle); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (handle->state == (uint8_t)kIdleState) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - uint8_t state; - uint32_t remainingBytes; - uint32_t dataSize; - - /* Cache some fields with IRQs disabled. This ensures all field values */ - /* are synchronized with each other during an ongoing transfer. */ - uint32_t irqs = I3C_MasterGetEnabledInterrupts(base); - I3C_MasterDisableInterrupts(base, irqs); - state = handle->state; - remainingBytes = handle->remainingBytes; - dataSize = handle->transfer.dataSize; - I3C_MasterEnableInterrupts(base, irqs); - - /* Get transfer count based on current transfer state. */ - switch (state) - { - case (uint8_t)kIdleState: - case (uint8_t)kSendCommandState: - *count = 0; - break; - - case (uint8_t)kTransferDataState: - *count = dataSize - remainingBytes; - break; - - case (uint8_t)kStopState: - case (uint8_t)kWaitForCompletionState: - default: - *count = dataSize; - break; - } - - return kStatus_Success; -} - -/*! - * brief Terminates a non-blocking I3C master transmission early. - * - * note It is not safe to call this function from an IRQ handler that has a higher priority than the - * I3C peripheral's IRQ priority. - * - * param base The I3C peripheral base address. - * param handle Pointer to the I3C master driver handle. - * retval #kStatus_Success A transaction was successfully aborted. - * retval #kStatus_I3C_Idle There is not a non-blocking transaction currently in progress. - */ -void I3C_MasterTransferAbort(I3C_Type *base, i3c_master_handle_t *handle) -{ - if (handle->state != (uint8_t)kIdleState) - { - /* Disable internal IRQ enables. */ - I3C_MasterDisableInterrupts(base, (uint32_t)kMasterIrqFlags); - - /* Reset fifos. These flags clear automatically. */ - base->MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - - /* Send a stop command to finalize the transfer. */ - (void)I3C_MasterStop(base); - - /* Reset handle. */ - handle->state = (uint8_t)kIdleState; - } -} - -/*! - * brief Reusable routine to handle master interrupts. - * note This function does not need to be called unless you are reimplementing the - * nonblocking API's interrupt handler routines to add special functionality. - * param base The I3C peripheral base address. - * param intHandle Pointer to the I3C master driver handle. - */ -void I3C_MasterTransferHandleIRQ(I3C_Type *base, void *intHandle) -{ - i3c_master_handle_t *handle = (i3c_master_handle_t *)intHandle; - status_t result; - bool isDone; - - /* Don't do anything if we don't have a valid handle. */ - if (NULL == handle) - { - return; - } - - result = I3C_RunTransferStateMachine(base, handle, &isDone); - - if (handle->state == (uint8_t)kIdleState) - { - I3C_MasterDisableInterrupts(base, (uint32_t)kI3C_MasterTxReadyFlag); - return; - } - - if (isDone || (result != kStatus_Success)) - { - /* XXX need to handle data that may be in rx fifo below watermark level? */ - - /* XXX handle error, terminate xfer */ - if ((result == kStatus_I3C_Nak) || (result == kStatus_I3C_IBIWon)) - { - (void)I3C_MasterEmitStop(base, false); - } - - /* Disable internal IRQ enables. */ - I3C_MasterDisableInterrupts(base, (uint32_t)kI3C_MasterTxReadyFlag); - - /* Set handle to idle state. */ - handle->state = (uint8_t)kIdleState; - - /* Invoke IBI user callback. */ - if ((result == kStatus_I3C_IBIWon) && (handle->callback.ibiCallback != NULL)) - { - handle->callback.ibiCallback(base, handle, handle->ibiType, kI3C_IbiReady); - handle->ibiPayloadSize = 0; - } - - /* Invoke callback. */ - if (NULL != handle->callback.transferComplete) - { - handle->callback.transferComplete(base, handle, result, handle->userData); - } - } -} - -/*! - * brief Provides a default configuration for the I3C slave peripheral. - * - * This function provides the following default configuration for the I3C slave peripheral: - * code - * slaveConfig->enableslave = true; - * endcode - * - * After calling this function, you can override any settings in order to customize the configuration, - * prior to initializing the slave driver with I3C_SlaveInit(). - * - * param[out] slaveConfig User provided configuration structure for default values. Refer to #i3c_slave_config_t. - */ -void I3C_SlaveGetDefaultConfig(i3c_slave_config_t *slaveConfig) -{ - assert(NULL != slaveConfig); - - (void)memset(slaveConfig, 0, sizeof(*slaveConfig)); - - slaveConfig->enableSlave = true; -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) && FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) - slaveConfig->isHotJoin = false; -#endif - slaveConfig->vendorID = 0x11BU; -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) - slaveConfig->enableRandomPart = false; -#endif - slaveConfig->partNumber = 0; - slaveConfig->dcr = 0; /* Generic device. */ - slaveConfig->bcr = - 0; /* BCR[7:6]: device role, I3C slave(2b'00), BCR[5]: SDR Only / SDR and HDR Capable, SDR and HDR - Capable(1b'1), BCR[4]: Bridge Identifier, Not a bridge device(1b'0), BCR[3]: Offline Capable, device is - offline capable(1b'1), BCR[2]: IBI Payload, No data byte following(1b'0), BCR[1]: IBI Request Capable, - capable(1b'1), BCR[0]: Max Data Speed Limitation, has limitation(1b'1). */ - slaveConfig->hdrMode = (uint8_t)kI3C_HDRModeDDR; - slaveConfig->nakAllRequest = false; - slaveConfig->ignoreS0S1Error = true; - slaveConfig->offline = false; - slaveConfig->matchSlaveStartStop = false; - slaveConfig->maxWriteLength = 256U; - slaveConfig->maxReadLength = 256U; -} - -/*! - * brief Initializes the I3C slave peripheral. - * - * This function enables the peripheral clock and initializes the I3C slave peripheral as described by the user - * provided configuration. - * - * param base The I3C peripheral base address. - * param slaveConfig User provided peripheral configuration. Use I3C_SlaveGetDefaultConfig() to get a set of - * defaults that you can override. - * param slowClock_Hz Frequency in Hertz of the I3C slow clock. Used to calculate the bus match condition values. - * If FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH defines as 1, this parameter is useless. - */ -void I3C_SlaveInit(I3C_Type *base, const i3c_slave_config_t *slaveConfig, uint32_t slowClock_Hz) -{ - assert(NULL != slaveConfig); - assert((slowClock_Hz >= 1000000U) || (slowClock_Hz == 0U)); - - uint32_t configValue; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) || \ - !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) - uint32_t instance = I3C_GetInstance(base); -#endif - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate the clock. */ - CLOCK_EnableClock(kI3cClocks[instance]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) - /* Reset the I3C module */ - RESET_PeripheralReset(kI3cResets[instance]); -#endif - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - uint8_t matchCount; - /* Set as (slowClk(MHz) - 1) to generate 1us clock cycle for IBI request to drive SDA low. Note: Use BAMATCH = 1 to - generate 1us clock cycle if slow clock is 1MHz. The value of 0 would not give a correct match indication. */ - if (slowClock_Hz != 0U) - { - matchCount = (uint8_t)(slowClock_Hz / 1000000UL) - 1U; - matchCount = (matchCount == 0U) ? 1U : matchCount; - } - else - { - /* BAMATCH has default value based on Soc default slow clock after reset, using this default value when slowClock_Hz is 0. */ - matchCount = (uint8_t)((base->SCONFIG & I3C_SCONFIG_BAMATCH_MASK) >> I3C_SCONFIG_BAMATCH_SHIFT); - } -#endif - - configValue = base->SCONFIG; - configValue &= - ~(I3C_SCONFIG_SADDR_MASK | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - I3C_SCONFIG_BAMATCH_MASK | -#endif - I3C_SCONFIG_OFFLINE_MASK | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) - I3C_SCONFIG_IDRAND_MASK | -#endif -#if defined(FSL_FEATURE_I3C_HAS_HDROK) && FSL_FEATURE_I3C_HAS_HDROK - I3C_SCONFIG_HDROK_MASK | -#else - I3C_SCONFIG_DDROK_MASK | -#endif - I3C_SCONFIG_S0IGNORE_MASK | I3C_SCONFIG_MATCHSS_MASK | I3C_SCONFIG_NACK_MASK | I3C_SCONFIG_SLVENA_MASK); - configValue |= I3C_SCONFIG_SADDR(slaveConfig->staticAddr) | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - I3C_SCONFIG_BAMATCH(matchCount) | -#endif - I3C_SCONFIG_OFFLINE(slaveConfig->offline) | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) - I3C_SCONFIG_IDRAND(slaveConfig->enableRandomPart) | -#endif -#if defined(FSL_FEATURE_I3C_HAS_HDROK) && FSL_FEATURE_I3C_HAS_HDROK - I3C_SCONFIG_HDROK((0U != (slaveConfig->hdrMode & (uint8_t)kI3C_HDRModeDDR)) ? 1U : 0U) | -#else - I3C_SCONFIG_DDROK((0U != (slaveConfig->hdrMode & (uint8_t)kI3C_HDRModeDDR)) ? 1U : 0U) | -#endif - I3C_SCONFIG_S0IGNORE(slaveConfig->ignoreS0S1Error) | - I3C_SCONFIG_MATCHSS(slaveConfig->matchSlaveStartStop) | - I3C_SCONFIG_NACK(slaveConfig->nakAllRequest) | I3C_SCONFIG_SLVENA(slaveConfig->enableSlave); - - base->SVENDORID &= ~I3C_SVENDORID_VID_MASK; - base->SVENDORID |= I3C_SVENDORID_VID(slaveConfig->vendorID); - -#if defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND - base->SIDPARTNO = slaveConfig->partNumber; -#else - if (!slaveConfig->enableRandomPart) - { - base->SIDPARTNO = slaveConfig->partNumber; - } -#endif - - base->SIDEXT &= ~(I3C_SIDEXT_BCR_MASK | I3C_SIDEXT_DCR_MASK); - base->SIDEXT |= I3C_SIDEXT_BCR(slaveConfig->bcr) | I3C_SIDEXT_DCR(slaveConfig->dcr); - - base->SMAXLIMITS &= ~(I3C_SMAXLIMITS_MAXRD_MASK | I3C_SMAXLIMITS_MAXWR_MASK); - base->SMAXLIMITS |= - (I3C_SMAXLIMITS_MAXRD(slaveConfig->maxReadLength) | I3C_SMAXLIMITS_MAXWR(slaveConfig->maxWriteLength)); - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) && FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) - if (slaveConfig->isHotJoin) - { - I3C_SlaveRequestEvent(base, kI3C_SlaveEventHotJoinReq); - } -#endif - base->SCONFIG = configValue; -} - -/*! - * brief Deinitializes the I3C master peripheral. - * - * This function disables the I3C master peripheral and gates the clock. It also performs a software - * reset to restore the peripheral to reset conditions. - * - * param base The I3C peripheral base address. - */ -void I3C_SlaveDeinit(I3C_Type *base) -{ - uint32_t idx = I3C_GetInstance(base); - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) - /* Reset the I3C module */ - RESET_PeripheralReset(kI3cResets[idx]); -#endif - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate clock. */ - CLOCK_DisableClock(kI3cClocks[idx]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Reset handle pointer */ - s_i3cSlaveHandle[idx] = NULL; -} - -/*! - * @brief Gets the I3C slave state. - * - * @param base The I3C peripheral base address. - * @return I3C slave activity state, refer #i3c_slave_activity_state_t. - */ -i3c_slave_activity_state_t I3C_SlaveGetActivityState(I3C_Type *base) -{ - uint8_t activeState = (uint8_t)((base->SSTATUS & I3C_SSTATUS_ACTSTATE_MASK) >> I3C_SSTATUS_ACTSTATE_SHIFT); - i3c_slave_activity_state_t returnCode; - switch (activeState) - { - case (uint8_t)kI3C_SlaveNoLatency: - returnCode = kI3C_SlaveNoLatency; - break; - case (uint8_t)kI3C_SlaveLatency1Ms: - returnCode = kI3C_SlaveLatency1Ms; - break; - case (uint8_t)kI3C_SlaveLatency100Ms: - returnCode = kI3C_SlaveLatency100Ms; - break; - case (uint8_t)kI3C_SlaveLatency10S: - returnCode = kI3C_SlaveLatency10S; - break; - default: - returnCode = kI3C_SlaveNoLatency; - break; - } - - return returnCode; -} - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) && FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) -/*! - * brief I3C slave request event. - * - * param base The I3C peripheral base address. - * param event I3C slave event of type #i3c_slave_event_t - * param data IBI data if In-band interrupt has data, only applicable for event type #kI3C_SlaveEventIBI - */ -void I3C_SlaveRequestEvent(I3C_Type *base, i3c_slave_event_t event) -{ - uint32_t ctrlValue = base->SCTRL; - - ctrlValue &= ~I3C_SCTRL_EVENT_MASK; - ctrlValue |= I3C_SCTRL_EVENT(event); - - base->SCTRL = ctrlValue; -} - -/*! - * brief I3C slave request event. - * deprecated Do not use this function. It has been superseded by @ref I3C_SlaveRequestIBIWithData. - * - * param base The I3C peripheral base address. - * param data IBI data - * param dataSize IBI data size. - */ -void I3C_SlaveRequestIBIWithSingleData(I3C_Type *base, uint8_t data, size_t dataSize) -{ - uint32_t ctrlValue = base->SCTRL; - - ctrlValue &= ~(I3C_SCTRL_EVENT_MASK | I3C_SCTRL_IBIDATA_MASK); - ctrlValue |= I3C_SCTRL_EVENT(1U) | I3C_SCTRL_IBIDATA(data); - - base->SCTRL = ctrlValue; -} - -/*! - * brief I3C slave request IBI event with data payload(mandatory and extended). - * - * param base The I3C peripheral base address. - * param data Pointer to IBI data to be sent in the request. - * param dataSize IBI data size. - */ -void I3C_SlaveRequestIBIWithData(I3C_Type *base, uint8_t *data, size_t dataSize) -{ - assert((dataSize > 0U) && (dataSize <= 8U)); - - uint32_t ctrlValue; - -#if (defined(I3C_IBIEXT1_MAX_MASK) && I3C_IBIEXT1_MAX_MASK) - if (dataSize > 1U) - { - ctrlValue = I3C_IBIEXT1_EXT1(data[1]); - if (dataSize > 2U) - { - ctrlValue |= I3C_IBIEXT1_EXT2(data[2]); - } - if (dataSize > 3U) - { - ctrlValue |= I3C_IBIEXT1_EXT3(data[3]); - } - ctrlValue |= I3C_IBIEXT1_CNT(dataSize - 1U); - base->IBIEXT1 = ctrlValue; - } - - if (dataSize > 4U) - { - ctrlValue = I3C_IBIEXT2_EXT4(data[4]); - if (dataSize > 5U) - { - ctrlValue |= I3C_IBIEXT2_EXT5(data[5]); - } - if (dataSize > 6U) - { - ctrlValue |= I3C_IBIEXT2_EXT6(data[6]); - } - if (dataSize > 7U) - { - ctrlValue |= I3C_IBIEXT2_EXT7(data[7]); - } - base->IBIEXT2 = ctrlValue; - } -#endif - - ctrlValue = base->SCTRL; -#if (defined(I3C_IBIEXT1_MAX_MASK) && I3C_IBIEXT1_MAX_MASK) - ctrlValue &= ~(I3C_SCTRL_EVENT_MASK | I3C_SCTRL_IBIDATA_MASK | I3C_SCTRL_EXTDATA_MASK); - ctrlValue |= I3C_SCTRL_EVENT(1U) | I3C_SCTRL_IBIDATA(data[0]) | I3C_SCTRL_EXTDATA(dataSize > 1U); -#else - ctrlValue &= ~(I3C_SCTRL_EVENT_MASK | I3C_SCTRL_IBIDATA_MASK); - ctrlValue |= I3C_SCTRL_EVENT(1U) | I3C_SCTRL_IBIDATA(data[0]); -#endif - base->SCTRL = ctrlValue; -} -#endif /* !(defined(FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) && FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) */ - -/*! - * brief Performs a polling send transfer on the I3C bus. - * - * param base The I3C peripheral base address. - * param txBuff The pointer to the data to be transferred. - * param txSize The length in bytes of the data to be transferred. - * return Error or success status returned by API. - */ -status_t I3C_SlaveSend(I3C_Type *base, const void *txBuff, size_t txSize) -{ - const uint8_t *buf = (const uint8_t *)((const void *)txBuff); - status_t result = kStatus_Success; - - assert(NULL != txBuff); - - /* Send data buffer */ - while (0UL != txSize--) - { - /* Wait until there is room in the fifo. This also checks for errors. */ - result = I3C_SlaveWaitForTxReady(base); - if (kStatus_Success != result) - { - return result; - } - - /* Write byte into I3C slave data register. */ - if (0UL != txSize) - { - base->SWDATAB = *buf++; - } - else - { - base->SWDATABE = *buf++; - } - } - - return result; -} - -/*! - * brief Performs a polling receive transfer on the I3C bus. - * - * param base The I3C peripheral base address. - * param rxBuff The pointer to the data to be transferred. - * param rxSize The length in bytes of the data to be transferred. - * return Error or success status returned by API. - */ -status_t I3C_SlaveReceive(I3C_Type *base, void *rxBuff, size_t rxSize) -{ - status_t result = kStatus_Success; - uint8_t *buf; - - assert(NULL != rxBuff); - - /* Handle empty read. */ - if (0UL == rxSize) - { - return kStatus_Success; - } - -#if I3C_RETRY_TIMES - uint32_t waitTimes = I3C_RETRY_TIMES; -#endif - - /* Receive data */ - buf = (uint8_t *)rxBuff; - while (0UL != rxSize) - { -#if I3C_RETRY_TIMES - if (--waitTimes == 0) - { - return kStatus_I3C_Timeout; - } -#endif - /* Check for errors. */ - result = I3C_SlaveCheckAndClearError(base, I3C_SlaveGetErrorStatusFlags(base)); - if (kStatus_Success != result) - { - return result; - } - - /* Check RX data */ - if (0UL != (base->SDATACTRL & I3C_SDATACTRL_RXCOUNT_MASK)) - { - *buf++ = (uint8_t)(base->SRDATAB & I3C_SRDATAB_DATA0_MASK); - rxSize--; - } - } - - return result; -} - -/*! - * brief Creates a new handle for the I3C slave non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the I3C_SlaveTransferAbort() API shall be called. - * - * note The function also enables the NVIC IRQ for the input I3C. Need to notice - * that on some SoCs the I3C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - - * param base The I3C peripheral base address. - * param[out] handle Pointer to the I3C slave driver handle. - * param callback User provided pointer to the asynchronous callback function. - * param userData User provided pointer to the application callback data. - */ -void I3C_SlaveTransferCreateHandle(I3C_Type *base, - i3c_slave_handle_t *handle, - i3c_slave_transfer_callback_t callback, - void *userData) -{ - uint32_t instance; - - assert(NULL != handle); - - /* Clear out the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Look up instance number */ - instance = I3C_GetInstance(base); - - /* Save base and instance. */ - handle->callback = callback; - handle->userData = userData; - - /* Save Tx FIFO Size. */ - handle->txFifoSize = - 2U << ((base->SCAPABILITIES & I3C_SCAPABILITIES_FIFOTX_MASK) >> I3C_SCAPABILITIES_FIFOTX_SHIFT); - - /* Save this handle for IRQ use. */ - s_i3cSlaveHandle[instance] = handle; - - /* Set irq handler. */ - s_i3cSlaveIsr = I3C_SlaveTransferHandleIRQ; - - /* Clear internal IRQ enables and enable NVIC IRQ. */ - I3C_SlaveDisableInterrupts(base, (uint32_t)kSlaveIrqFlags); - (void)EnableIRQ(kI3cIrqs[instance]); -} - -/*! - * brief Starts accepting slave transfers. - * - * Call this API after calling I2C_SlaveInit() and I3C_SlaveTransferCreateHandle() to start processing - * transactions driven by an I2C master. The slave monitors the I2C bus and pass events to the - * callback that was passed into the call to I3C_SlaveTransferCreateHandle(). The callback is always invoked - * from the interrupt context. - * - * The set of events received by the callback is customizable. To do so, set the a eventMask parameter to - * the OR'd combination of #i3c_slave_transfer_event_t enumerators for the events you wish to receive. - * The #kI3C_SlaveTransmitEvent and #kI3C_SlaveReceiveEvent events are always enabled and do not need - * to be included in the mask. Alternatively, you can pass 0 to get a default set of only the transmit and - * receive events that are always enabled. In addition, the #kI3C_SlaveAllEvents constant is provided as - * a convenient way to enable all events. - * - * param base The I3C peripheral base address. - * param handle Pointer to #i3c_slave_handle_t structure which stores the transfer state. - * param eventMask Bit mask formed by OR'ing together #i3c_slave_transfer_event_t enumerators to specify - * which events to send to the callback. Other accepted values are 0 to get a default set of - * only the transmit and receive events, and #kI3C_SlaveAllEvents to enable all events. - * - * retval #kStatus_Success Slave transfers were successfully started. - * retval #kStatus_I3C_Busy Slave transfers have already been started on this handle. - */ -status_t I3C_SlaveTransferNonBlocking(I3C_Type *base, i3c_slave_handle_t *handle, uint32_t eventMask) -{ - assert(NULL != handle); - - /* Return busy if another transaction is in progress. */ - if (handle->isBusy) - { - return kStatus_I3C_Busy; - } - - /* Disable I3C IRQ sources while we configure stuff. */ - I3C_SlaveDisableInterrupts(base, (uint32_t)kSlaveIrqFlags); - - /* Clear transfer in handle. */ - (void)memset(&handle->transfer, 0, sizeof(handle->transfer)); - - /* Set up event mask. tx and rx are always enabled. */ - handle->eventMask = eventMask | (uint32_t)kI3C_SlaveTransmitEvent | (uint32_t)kI3C_SlaveReceiveEvent; - - /* Clear all flags. */ - I3C_SlaveClearStatusFlags(base, (uint32_t)kSlaveClearFlags); - - /* Enable I3C internal IRQ sources. NVIC IRQ was enabled in CreateHandle() */ - I3C_SlaveEnableInterrupts(base, (uint32_t)kSlaveIrqFlags); - - return kStatus_Success; -} - -/*! - * brief Gets the slave transfer status during a non-blocking transfer. - * param base The I3C peripheral base address. - * param handle Pointer to i2c_slave_handle_t structure. - * param[out] count Pointer to a value to hold the number of bytes transferred. May be NULL if the count is not - * required. - * retval #kStatus_Success - * retval #kStatus_NoTransferInProgress - */ -status_t I3C_SlaveTransferGetCount(I3C_Type *base, i3c_slave_handle_t *handle, size_t *count) -{ - assert(NULL != handle); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (!handle->isBusy) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - /* For an active transfer, just return the count from the handle. */ - *count = handle->transferredCount; - - return kStatus_Success; -} - -/*! - * brief Aborts the slave non-blocking transfers. - * note This API could be called at any time to stop slave for handling the bus events. - * param base The I3C peripheral base address. - * param handle Pointer to #i3c_slave_handle_t structure which stores the transfer state. - * retval #kStatus_Success - * retval #kStatus_I3C_Idle - */ -void I3C_SlaveTransferAbort(I3C_Type *base, i3c_slave_handle_t *handle) -{ - assert(NULL != handle); - - /* Return idle if no transaction is in progress. */ - if (handle->isBusy) - { - /* Disable I3C IRQ sources. */ - I3C_SlaveDisableInterrupts(base, (uint32_t)kSlaveIrqFlags); - - /* Reset transfer info. */ - (void)memset(&handle->transfer, 0, sizeof(handle->transfer)); - - /* We're no longer busy. */ - handle->isBusy = false; - } -} - -static bool I3C_SlaveTransferHandleGetStatusFlags(I3C_Type *base, - i3c_slave_handle_t *handle, - i3c_slave_handleIrq_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - /* Check for a valid handle in case of a spurious interrupt. */ - uint32_t errFlags; - stateParams->flags = I3C_SlaveGetStatusFlags(base); - errFlags = I3C_SlaveGetErrorStatusFlags(base); - - stateParams->pendingInts = I3C_SlaveGetPendingInterrupts(base); - stateParams->enabledInts = I3C_SlaveGetEnabledInterrupts(base); - - if (0UL != (errFlags & (uint32_t)kSlaveErrorFlags)) - { - handle->transfer.event = (uint32_t)kI3C_SlaveCompletionEvent; - handle->transfer.completionStatus = I3C_SlaveCheckAndClearError(base, errFlags); - - if ((0UL != (handle->eventMask & (uint32_t)kI3C_SlaveCompletionEvent)) && (NULL != handle->callback)) - { - handle->callback(base, &handle->transfer, handle->userData); - } - return false; - } - return true; -} - -static void I3C_SlaveTransferHandleBusStart(I3C_Type *base, i3c_slave_transfer_t *xfer, uint32_t *pendingInts) -{ - base->SDATACTRL |= I3C_SDATACTRL_FLUSHTB_MASK; - xfer->txDataSize = 0; - I3C_SlaveEnableInterrupts(base, (uint32_t)kI3C_SlaveTxReadyFlag); - (*pendingInts) |= (uint32_t)kI3C_SlaveTxReadyFlag; -} - -static void I3C_SlaveTransferHandleEventSent(I3C_Type *base, i3c_slave_handle_t *handle, i3c_slave_transfer_t *xfer) -{ - xfer->event = (uint32_t)kI3C_SlaveRequestSentEvent; - if ((0UL != (handle->eventMask & xfer->event)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } -} - -static void I3C_SlaveTransferHandleReceivedCCC(I3C_Type *base, i3c_slave_handle_t *handle, i3c_slave_transfer_t *xfer) -{ - handle->isBusy = true; - xfer->event = (uint32_t)kI3C_SlaveReceivedCCCEvent; - if ((0UL != (handle->eventMask & xfer->event)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } -} - -static void I3C_SlaveTransferHandleBusStop(I3C_Type *base, - i3c_slave_handle_t *handle, - i3c_slave_handleIrq_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - I3C_SlaveDisableInterrupts(base, (uint32_t)kI3C_SlaveTxReadyFlag); - stateParams->pendingInts &= ~(uint32_t)kI3C_SlaveTxReadyFlag; - base->SDATACTRL |= I3C_SDATACTRL_FLUSHTB_MASK | I3C_SDATACTRL_FLUSHFB_MASK; - if (handle->isBusy) - { - handle->transfer.event = (uint32_t)kI3C_SlaveCompletionEvent; - handle->transfer.completionStatus = kStatus_Success; - handle->transfer.transferredCount = handle->transferredCount; - handle->isBusy = false; - - if (handle->wasTransmit) - { - /* Subtract one from the transmit count to offset the fact that I3C asserts the */ - /* tx flag before it sees the nack from the master-receiver, thus causing one more */ - /* count that the master actually receives. */ - --handle->transfer.transferredCount; - handle->wasTransmit = false; - } - - if ((0UL != (handle->eventMask & handle->transfer.event)) && (NULL != handle->callback)) - { - handle->callback(base, &handle->transfer, handle->userData); - } - - /* Clean up transfer info on completion, after the callback has been invoked. */ - (void)memset(&handle->transfer, 0, sizeof(handle->transfer)); - } -} - -static void I3C_SlaveTransferHandleMatched(I3C_Type *base, i3c_slave_handle_t *handle, i3c_slave_transfer_t *xfer) -{ - assert(NULL != base && NULL != handle && NULL != xfer); - xfer->event = (uint32_t)kI3C_SlaveAddressMatchEvent; - handle->isBusy = true; - if ((0UL != (handle->eventMask & (uint32_t)kI3C_SlaveAddressMatchEvent)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } -} - -static void I3C_SlaveTransferHandleTxReady(I3C_Type *base, - i3c_slave_handle_t *handle, - i3c_slave_handleIrq_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - handle->wasTransmit = true; - - /* If we're out of data, invoke callback to get more. */ - if ((NULL == handle->transfer.txData) || (0UL == handle->transfer.txDataSize)) - { - handle->transfer.event = (uint32_t)kI3C_SlaveTransmitEvent; - if (0UL != (stateParams->flags & (uint32_t)kI3C_SlaveBusHDRModeFlag)) - { - handle->transfer.event |= (uint32_t)kI3C_SlaveHDRCommandMatchEvent; - handle->isBusy = true; - } - if (NULL != handle->callback) - { - handle->callback(base, &handle->transfer, handle->userData); - } - - /* Clear the transferred count now that we have a new buffer. */ - handle->transferredCount = 0; - } - - if ((NULL == handle->transfer.txData) || (0UL == handle->transfer.txDataSize)) - { - I3C_SlaveDisableInterrupts(base, (uint32_t)kI3C_SlaveTxReadyFlag); - (stateParams->pendingInts) &= ~(uint32_t)kI3C_SlaveTxReadyFlag; - } - - /* Transmit a byte. */ - while ((handle->transfer.txDataSize != 0UL) && ((stateParams->txCount) != 0U)) - { - if (handle->transfer.txDataSize > 1UL) - { - base->SWDATAB = *handle->transfer.txData++; - } - else - { - base->SWDATABE = *handle->transfer.txData++; - I3C_SlaveDisableInterrupts(base, (uint32_t)kI3C_SlaveTxReadyFlag); - } - --(handle->transfer.txDataSize); - ++(handle->transferredCount); - (stateParams->txCount)--; - } -} - -static void I3C_SlaveTransferHandleRxReady(I3C_Type *base, - i3c_slave_handle_t *handle, - i3c_slave_handleIrq_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - /* If we're out of room in the buffer, invoke callback to get another. */ - if ((NULL == handle->transfer.rxData) || (0UL == handle->transfer.rxDataSize)) - { - handle->transfer.event = (uint32_t)kI3C_SlaveReceiveEvent; - if (0UL != (stateParams->flags & (uint32_t)kI3C_SlaveBusHDRModeFlag)) - { - handle->transfer.event |= (uint32_t)kI3C_SlaveHDRCommandMatchEvent; - handle->isBusy = true; - } - if (NULL != handle->callback) - { - handle->callback(base, &handle->transfer, handle->userData); - } - handle->transferredCount = 0; - } - /* Receive a byte. */ - while ((stateParams->rxCount != 0U) && ((handle->transfer.rxData != NULL) && (handle->transfer.rxDataSize != 0UL))) - { - *(handle->transfer.rxData++) = (uint8_t)base->SRDATAB; - --(handle->transfer.rxDataSize); - ++(handle->transferredCount); - (stateParams->rxCount)--; - } -} - -/*! - * brief Reusable routine to handle slave interrupts. - * note This function does not need to be called unless you are reimplementing the - * non blocking API's interrupt handler routines to add special functionality. - * param base The I3C peripheral base address. - * param intHandle Pointer to #i3c_slave_handle_t structure which stores the transfer state. - */ -void I3C_SlaveTransferHandleIRQ(I3C_Type *base, void *intHandle) -{ - i3c_slave_handleIrq_param_t stateParams; - - (void)memset(&stateParams, 0, sizeof(stateParams)); - i3c_slave_handle_t *handle = (i3c_slave_handle_t *)intHandle; - - /* Check for a valid handle in case of a spurious interrupt. */ - if (NULL == handle) - { - return; - } - - /* Get status flags. */ - if (false == I3C_SlaveTransferHandleGetStatusFlags(base, handle, &stateParams)) - { - return; - } - - /* Clear status flags. */ - I3C_SlaveClearStatusFlags(base, stateParams.flags); - - if (0UL != (stateParams.flags & (uint32_t)kI3C_SlaveBusStartFlag)) - { - I3C_SlaveTransferHandleBusStart(base, &handle->transfer, &stateParams.pendingInts); - } - - if (0UL != (stateParams.flags & (uint32_t)kI3C_SlaveEventSentFlag)) - { - I3C_SlaveTransferHandleEventSent(base, handle, &handle->transfer); - } - - if (0UL != (stateParams.flags & (uint32_t)kI3C_SlaveReceivedCCCFlag)) - { - I3C_SlaveTransferHandleReceivedCCC(base, handle, &handle->transfer); - } - - if (0UL != (stateParams.flags & (uint32_t)kI3C_SlaveMatchedFlag)) - { - I3C_SlaveTransferHandleMatched(base, handle, &handle->transfer); - } - - /* Get fifo counts and compute room in tx fifo. */ - I3C_SlaveGetFifoCounts(base, &stateParams.rxCount, &stateParams.txCount); - stateParams.txCount = handle->txFifoSize - stateParams.txCount; - - /* Handle transmit and receive. */ - if ((0UL != (stateParams.flags & (uint32_t)kI3C_SlaveTxReadyFlag)) && - (0UL != (stateParams.pendingInts & (uint32_t)kI3C_SlaveTxReadyFlag))) - { - I3C_SlaveTransferHandleTxReady(base, handle, &stateParams); - } - - if ((0UL != (stateParams.flags & (uint32_t)kI3C_SlaveRxReadyFlag)) && - (0UL != (stateParams.enabledInts & (uint32_t)kI3C_SlaveRxReadyFlag))) - { - I3C_SlaveTransferHandleRxReady(base, handle, &stateParams); - } - - /* Handle stop event. */ - if (0UL != (stateParams.flags & (uint32_t)kI3C_SlaveBusStopFlag)) - { - I3C_SlaveTransferHandleBusStop(base, handle, &stateParams); - } -} - -static void I3C_CommonIRQHandler(I3C_Type *base, uint32_t instance) -{ - /* Check for master IRQ. */ - if (((uint32_t)kI3C_MasterOn == (base->MCONFIG & I3C_MCONFIG_MSTENA_MASK)) && (NULL != s_i3cMasterIsr)) - { - /* Master mode. */ - s_i3cMasterIsr(base, s_i3cMasterHandle[instance]); - } - - /* Check for slave IRQ. */ - if ((I3C_SCONFIG_SLVENA_MASK == (base->SCONFIG & I3C_SCONFIG_SLVENA_MASK)) && (NULL != s_i3cSlaveIsr)) - { - /* Slave mode. */ - s_i3cSlaveIsr(base, s_i3cSlaveHandle[instance]); - } - SDK_ISR_EXIT_BARRIER; -} - -#if defined(I3C) -/* Implementation of I3C handler named in startup code. */ -void I3C0_DriverIRQHandler(void); -void I3C0_DriverIRQHandler(void) -{ - I3C_CommonIRQHandler(I3C, 0); -} -#endif - -#if defined(I3C0) -/* Implementation of I3C0 handler named in startup code. */ -void I3C0_DriverIRQHandler(void); -void I3C0_DriverIRQHandler(void) -{ - I3C_CommonIRQHandler(I3C0, 0); -} -#endif - -#if defined(I3C1) -/* Implementation of I3C1 handler named in startup code. */ -void I3C1_DriverIRQHandler(void); -void I3C1_DriverIRQHandler(void) -{ - I3C_CommonIRQHandler(I3C1, 1); -} -#endif - -#if defined(I3C2) -/* Implementation of I3C2 handler named in startup code. */ -void I3C2_DriverIRQHandler(void); -void I3C2_DriverIRQHandler(void) -{ - I3C_CommonIRQHandler(I3C2, 2); -} -#endif - -#if defined(I3C3) -/* Implementation of I3C3 handler named in startup code. */ -void I3C3_DriverIRQHandler(void); -void I3C3_DriverIRQHandler(void) -{ - I3C_CommonIRQHandler(I3C3, 3); -} -#endif diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_i3c.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_i3c.h deleted file mode 100644 index 2a3b5dae82f..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_i3c.h +++ /dev/null @@ -1,1899 +0,0 @@ -/* - * Copyright 2018-2024 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_I3C_H_ -#define FSL_I3C_H_ - -#include "fsl_common.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @addtogroup i3c - * @{ - */ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief I3C driver version */ -#define FSL_I3C_DRIVER_VERSION (MAKE_VERSION(2, 12, 0)) -/*! @} */ - -/*! @brief Timeout times for waiting flag. */ -#ifndef I3C_RETRY_TIMES -#define I3C_RETRY_TIMES 0U /* Define to zero means keep waiting until the flag is assert/deassert. */ -#endif - -#define I3C_MAX_DEVCNT 10U - -#ifndef I3C_IBI_BUFF_SIZE -#define I3C_IBI_BUFF_SIZE 10U -#endif - -/*! @brief I3C status return codes. */ -enum -{ - kStatus_I3C_Busy = MAKE_STATUS(kStatusGroup_I3C, 0), /*!< The master is already performing a transfer. */ - kStatus_I3C_Idle = MAKE_STATUS(kStatusGroup_I3C, 1), /*!< The slave driver is idle. */ - kStatus_I3C_Nak = MAKE_STATUS(kStatusGroup_I3C, 2), /*!< The slave device sent a NAK in response to an address. */ - kStatus_I3C_WriteAbort = - MAKE_STATUS(kStatusGroup_I3C, 3), /*!< The slave device sent a NAK in response to a write. */ - kStatus_I3C_Term = MAKE_STATUS(kStatusGroup_I3C, 4), /*!< The master terminates slave read. */ - kStatus_I3C_HdrParityError = MAKE_STATUS(kStatusGroup_I3C, 5), /*!< Parity error from DDR read. */ - kStatus_I3C_CrcError = MAKE_STATUS(kStatusGroup_I3C, 6), /*!< CRC error from DDR read. */ - kStatus_I3C_ReadFifoError = MAKE_STATUS(kStatusGroup_I3C, 7), /*!< Read from M/SRDATAB register when FIFO empty. */ - kStatus_I3C_WriteFifoError = MAKE_STATUS(kStatusGroup_I3C, 8), /*!< Write to M/SWDATAB register when FIFO full. */ - kStatus_I3C_MsgError = - MAKE_STATUS(kStatusGroup_I3C, 9), /*!< Message SDR/DDR mismatch or read/write message in wrong state */ - kStatus_I3C_InvalidReq = MAKE_STATUS(kStatusGroup_I3C, 10), /*!< Invalid use of request. */ - kStatus_I3C_Timeout = MAKE_STATUS(kStatusGroup_I3C, 11), /*!< The module has stalled too long in a frame. */ - kStatus_I3C_SlaveCountExceed = - MAKE_STATUS(kStatusGroup_I3C, 12), /*!< The I3C slave count has exceed the definition in I3C_MAX_DEVCNT. */ - kStatus_I3C_IBIWon = MAKE_STATUS( - kStatusGroup_I3C, 13), /*!< The I3C slave event IBI or MR or HJ won the arbitration on a header address. */ - kStatus_I3C_OverrunError = MAKE_STATUS(kStatusGroup_I3C, 14), /*!< Slave internal from-bus buffer/FIFO overrun. */ - kStatus_I3C_UnderrunError = MAKE_STATUS(kStatusGroup_I3C, 15), /*!< Slave internal to-bus buffer/FIFO underrun */ - kStatus_I3C_UnderrunNak = - MAKE_STATUS(kStatusGroup_I3C, 16), /*!< Slave internal from-bus buffer/FIFO underrun and NACK error */ - kStatus_I3C_InvalidStart = MAKE_STATUS(kStatusGroup_I3C, 17), /*!< Slave invalid start flag */ - kStatus_I3C_SdrParityError = MAKE_STATUS(kStatusGroup_I3C, 18), /*!< SDR parity error */ - kStatus_I3C_S0S1Error = MAKE_STATUS(kStatusGroup_I3C, 19), /*!< S0 or S1 error */ -}; - -/*! @brief I3C HDR modes. */ -typedef enum _i3c_hdr_mode -{ - kI3C_HDRModeNone = 0x00U, /* Do not support HDR mode. */ - kI3C_HDRModeDDR = 0x01U, /* HDR-DDR Mode. */ - kI3C_HDRModeTSP = 0x02U, /* HDR-TSP Mode. */ - kI3C_HDRModeTSL = 0x04U, /* HDR-TSL Mode. */ -} i3c_hdr_mode_t; - -/*! @brief I3C device information. */ -typedef struct _i3c_device_info -{ - uint8_t dynamicAddr; /*!< Device dynamic address. */ - uint8_t staticAddr; /*!< Static address. */ - uint8_t dcr; /*!< Device characteristics register information. */ - uint8_t bcr; /*!< Bus characteristics register information. */ - uint16_t vendorID; /*!< Device vendor ID(manufacture ID). */ - uint32_t partNumber; /*!< Device part number info */ - uint16_t maxReadLength; /*!< Maximum read length. */ - uint16_t maxWriteLength; /*!< Maximum write length. */ - uint8_t hdrMode; /*!< Support hdr mode, could be OR logic in i3c_hdr_mode. */ -} i3c_device_info_t; - -/*! @} */ - -/*! - * @addtogroup i3c_master_driver - * @{ - */ - -/*! - * @brief I3C master peripheral flags. - * - * The following status register flags can be cleared: - * - #kI3C_MasterSlaveStartFlag - * - #kI3C_MasterControlDoneFlag - * - #kI3C_MasterCompleteFlag - * - #kI3C_MasterArbitrationWonFlag - * - #kI3C_MasterSlave2MasterFlag - * - * All flags except #kI3C_MasterBetweenFlag and #kI3C_MasterNackDetectFlag can be enabled as - * interrupts. - * - * @note These enums are meant to be OR'd together to form a bit mask. - */ -enum _i3c_master_flags -{ - kI3C_MasterBetweenFlag = I3C_MSTATUS_BETWEEN_MASK, /*!< Between messages/DAAs flag */ - kI3C_MasterNackDetectFlag = I3C_MSTATUS_NACKED_MASK, /*!< NACK detected flag */ - kI3C_MasterSlaveStartFlag = I3C_MSTATUS_SLVSTART_MASK, /*!< Slave request start flag */ - kI3C_MasterControlDoneFlag = I3C_MSTATUS_MCTRLDONE_MASK, /*!< Master request complete flag */ - kI3C_MasterCompleteFlag = I3C_MSTATUS_COMPLETE_MASK, /*!< Transfer complete flag */ - kI3C_MasterRxReadyFlag = I3C_MSTATUS_RXPEND_MASK, /*!< Rx data ready in Rx buffer flag */ - kI3C_MasterTxReadyFlag = I3C_MSTATUS_TXNOTFULL_MASK, /*!< Tx buffer ready for Tx data flag */ - kI3C_MasterArbitrationWonFlag = I3C_MSTATUS_IBIWON_MASK, /*!< Header address won arbitration flag */ - kI3C_MasterErrorFlag = I3C_MSTATUS_ERRWARN_MASK, /*!< Error occurred flag */ - kI3C_MasterSlave2MasterFlag = I3C_MSTATUS_NOWMASTER_MASK, /*!< Switch from slave to master flag */ - kI3C_MasterClearFlags = kI3C_MasterSlaveStartFlag | kI3C_MasterControlDoneFlag | kI3C_MasterCompleteFlag | - kI3C_MasterArbitrationWonFlag | kI3C_MasterSlave2MasterFlag | kI3C_MasterErrorFlag, -}; - -/*! - * @brief I3C master error flags to indicate the causes. - * - * @note These enums are meant to be OR'd together to form a bit mask. - */ -enum _i3c_master_error_flags -{ - kI3C_MasterErrorNackFlag = I3C_MERRWARN_NACK_MASK, /*!< Slave NACKed the last address */ - kI3C_MasterErrorWriteAbortFlag = I3C_MERRWARN_WRABT_MASK, /*!< Slave NACKed the write data */ -#if !defined(FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) || (!FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) - kI3C_MasterErrorTermFlag = I3C_MERRWARN_TERM_MASK, /*!< Master terminates slave read */ -#endif - kI3C_MasterErrorParityFlag = I3C_MERRWARN_HPAR_MASK, /*!< Parity error from DDR read */ - kI3C_MasterErrorCrcFlag = I3C_MERRWARN_HCRC_MASK, /*!< CRC error from DDR read */ - kI3C_MasterErrorReadFlag = I3C_MERRWARN_OREAD_MASK, /*!< Read from MRDATAB register when FIFO empty */ - kI3C_MasterErrorWriteFlag = I3C_MERRWARN_OWRITE_MASK, /*!< Write to MWDATAB register when FIFO full */ - kI3C_MasterErrorMsgFlag = I3C_MERRWARN_MSGERR_MASK, /*!< Message SDR/DDR mismatch or - read/write message in wrong state */ - kI3C_MasterErrorInvalidReqFlag = I3C_MERRWARN_INVREQ_MASK, /*!< Invalid use of request */ - kI3C_MasterErrorTimeoutFlag = I3C_MERRWARN_TIMEOUT_MASK, /*!< The module has stalled too long in a frame */ - kI3C_MasterAllErrorFlags = kI3C_MasterErrorNackFlag | kI3C_MasterErrorWriteAbortFlag | -#if !defined(FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) || (!FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) - kI3C_MasterErrorTermFlag | -#endif - kI3C_MasterErrorParityFlag | kI3C_MasterErrorCrcFlag | kI3C_MasterErrorReadFlag | - kI3C_MasterErrorWriteFlag | kI3C_MasterErrorMsgFlag | kI3C_MasterErrorInvalidReqFlag | - kI3C_MasterErrorTimeoutFlag, /*!< All error flags */ -}; - -/*! @brief I3C working master state. */ -typedef enum _i3c_master_state -{ - kI3C_MasterStateIdle = 0U, /*!< Bus stopped. */ - kI3C_MasterStateSlvReq = 1U, /*!< Bus stopped but slave holding SDA low. */ - kI3C_MasterStateMsgSdr = 2U, /*!< In SDR Message mode from using MWMSG_SDR. */ - kI3C_MasterStateNormAct = 3U, /*!< In normal active SDR mode. */ - kI3C_MasterStateDdr = 4U, /*!< In DDR Message mode. */ - kI3C_MasterStateDaa = 5U, /*!< In ENTDAA mode. */ - kI3C_MasterStateIbiAck = 6U, /*!< Waiting on IBI ACK/NACK decision. */ - kI3C_MasterStateIbiRcv = 7U, /*!< receiving IBI. */ -} i3c_master_state_t; - -/*! @brief I3C master enable configuration. */ -typedef enum _i3c_master_enable -{ - kI3C_MasterOff = 0U, /*!< Master off. */ - kI3C_MasterOn = 1U, /*!< Master on. */ - kI3C_MasterCapable = 2U /*!< Master capable. */ -} i3c_master_enable_t; - -/*! @brief I3C high keeper configuration. */ -typedef enum _i3c_master_hkeep -{ - kI3C_MasterHighKeeperNone = 0U, /*!< Use PUR to hold SCL high. */ - kI3C_MasterHighKeeperWiredIn = 1U, /*!< Use pin_HK controls. */ - kI3C_MasterPassiveSDA = 2U, /*!< Hi-Z for Bus Free and hold SDA. */ - kI3C_MasterPassiveSDASCL = 3U /*!< Hi-Z both for Bus Free, and can Hi-Z SDA for hold. */ -} i3c_master_hkeep_t; - -/*! @brief Emits the requested operation when doing in pieces vs. by message. */ -typedef enum _i3c_bus_request -{ - kI3C_RequestNone = 0U, /*!< No request. */ - kI3C_RequestEmitStartAddr = 1U, /*!< Request to emit start and address on bus. */ - kI3C_RequestEmitStop = 2U, /*!< Request to emit stop on bus. */ - kI3C_RequestIbiAckNack = 3U, /*!< Manual IBI ACK or NACK. */ - kI3C_RequestProcessDAA = 4U, /*!< Process DAA. */ - kI3C_RequestForceExit = 6U, /*!< Request to force exit. */ - kI3C_RequestAutoIbi = 7U, /*!< Hold in stopped state, but Auto-emit START,7E. */ -} i3c_bus_request_t; - -/*! @brief Bus type with EmitStartAddr. */ -typedef enum _i3c_bus_type -{ - kI3C_TypeI3CSdr = 0U, /*!< SDR mode of I3C. */ - kI3C_TypeI2C = 1U, /*!< Standard i2c protocol. */ - kI3C_TypeI3CDdr = 2U, /*!< HDR-DDR mode of I3C. */ -} i3c_bus_type_t; - -/*! @brief IBI response. */ -typedef enum _i3c_ibi_response -{ - kI3C_IbiRespAck = 0U, /*!< ACK with no mandatory byte. */ - kI3C_IbiRespNack = 1U, /*!< NACK. */ - kI3C_IbiRespAckMandatory = 2U, /*!< ACK with mandatory byte. */ - kI3C_IbiRespManual = 3U, /*!< Reserved. */ -} i3c_ibi_response_t; - -/*! @brief IBI type. */ -typedef enum _i3c_ibi_type -{ - kI3C_IbiNormal = 0U, /*!< In-band interrupt. */ - kI3C_IbiHotJoin = 1U, /*!< slave hot join. */ - kI3C_IbiMasterRequest = 2U, /*!< slave master ship request. */ -} i3c_ibi_type_t; - -/*! @brief IBI state. */ -typedef enum _i3c_ibi_state -{ - kI3C_IbiReady = 0U, /*!< In-band interrupt ready state, ready for user to handle. */ - kI3C_IbiDataBuffNeed = 1U, /*!< In-band interrupt need data buffer for data receive. */ - kI3C_IbiAckNackPending = 2U, /*!< In-band interrupt Ack/Nack pending for decision. */ -} i3c_ibi_state_t; - -/*! @brief Direction of master and slave transfers. */ -typedef enum _i3c_direction -{ - kI3C_Write = 0U, /*!< Master transmit. */ - kI3C_Read = 1U /*!< Master receive. */ -} i3c_direction_t; - -/*! @brief Watermark of TX int/dma trigger level. */ -typedef enum _i3c_tx_trigger_level -{ - kI3C_TxTriggerOnEmpty = 0U, /*!< Trigger on empty. */ - kI3C_TxTriggerUntilOneQuarterOrLess = 1U, /*!< Trigger on 1/4 full or less. */ - kI3C_TxTriggerUntilOneHalfOrLess = 2U, /*!< Trigger on 1/2 full or less. */ - kI3C_TxTriggerUntilOneLessThanFull = 3U, /*!< Trigger on 1 less than full or less. */ -} i3c_tx_trigger_level_t; - -/*! @brief Watermark of RX int/dma trigger level. */ -typedef enum _i3c_rx_trigger_level -{ - kI3C_RxTriggerOnNotEmpty = 0U, /*!< Trigger on not empty. */ - kI3C_RxTriggerUntilOneQuarterOrMore = 1U, /*!< Trigger on 1/4 full or more. */ - kI3C_RxTriggerUntilOneHalfOrMore = 2U, /*!< Trigger on 1/2 full or more. */ - kI3C_RxTriggerUntilThreeQuarterOrMore = 3U, /*!< Trigger on 3/4 full or more. */ -} i3c_rx_trigger_level_t; - -/*! @brief I3C master read termination operations. */ -typedef enum _i3c_rx_term_ops -{ - kI3C_RxTermDisable = 0U, /*!< Master doesn't terminate read, used for CCC transfer. */ - kI3C_RxAutoTerm = 1U, /*!< Master auto terminate read after receiving specified bytes(<=255). */ - kI3C_RxTermLastByte = 2U, /*!< Master terminates read at any time after START, no length limitation. */ -} i3c_rx_term_ops_t; - -/*! @brief I3C start SCL delay options. */ -typedef enum _i3c_start_scl_delay -{ - kI3C_NoDelay = 0U, /*!< No delay. */ - kI3C_IncreaseSclHalfPeriod = 1U, /*!< Increases SCL clock period by 1/2. */ - kI3C_IncreaseSclOnePeriod = 2U, /*!< Increases SCL clock period by 1. */ - kI3C_IncreaseSclOneAndHalfPeriod = 3U, /*!< Increases SCL clock period by 1 1/2 */ -} i3c_start_scl_delay_t; - -/*! @brief Structure with setting master IBI rules and slave registry. */ -typedef struct _i3c_register_ibi_addr -{ - uint8_t address[5]; /*!< Address array for registry. */ - bool ibiHasPayload; /*!< Whether the address array has mandatory IBI byte. */ -} i3c_register_ibi_addr_t; - -/*! @brief Structure with I3C baudrate settings. */ -typedef struct _i3c_baudrate -{ - uint32_t i2cBaud; /*!< Desired I2C baud rate in Hertz. */ - uint32_t i3cPushPullBaud; /*!< Desired I3C push-pull baud rate in Hertz. */ - uint32_t i3cOpenDrainBaud; /*!< Desired I3C open-drain baud rate in Hertz. */ -} i3c_baudrate_hz_t; - -/*! @brief I3C DAA baud rate configuration. */ -typedef struct _i3c_master_daa_baudrate -{ - uint32_t sourceClock_Hz; /*!< FCLK, function clock in Hertz. */ - uint32_t i3cPushPullBaud; /*!< Desired I3C push-pull baud rate in Hertz. */ - uint32_t i3cOpenDrainBaud; /*!< Desired I3C open-drain baud rate in Hertz. */ -} i3c_master_daa_baudrate_t; - -/*! - * @brief Structure with settings to initialize the I3C master module. - * - * This structure holds configuration settings for the I3C peripheral. To initialize this - * structure to reasonable defaults, call the I3C_MasterGetDefaultConfig() function and - * pass a pointer to your configuration structure instance. - * - * The configuration structure can be made constant so it resides in flash. - */ -typedef struct _i3c_master_config -{ - i3c_master_enable_t enableMaster; /*!< Enable master mode. */ - bool disableTimeout; /*!< Whether to disable timeout to prevent the ERRWARN. */ - i3c_master_hkeep_t hKeep; /*!< High keeper mode setting. */ - bool enableOpenDrainStop; /*!< Whether to emit open-drain speed STOP. */ - bool enableOpenDrainHigh; /*!< Enable Open-Drain High to be 1 PPBAUD count for i3c messages, or 1 ODBAUD. */ - i3c_baudrate_hz_t baudRate_Hz; /*!< Desired baud rate settings. */ -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - uint32_t slowClock_Hz; /*!< Slow clock frequency. */ -#endif -#if defined(FSL_FEATURE_I3C_HAS_START_SCL_DELAY) && FSL_FEATURE_I3C_HAS_START_SCL_DELAY - i3c_start_scl_delay_t startSclDelay; /*!< I3C SCL delay after START. */ - i3c_start_scl_delay_t restartSclDelay; /*!< I3C SCL delay after Repeated START. */ -#endif -} i3c_master_config_t; - -/* Forward declaration of the transfer descriptor and handle typedefs. */ -typedef struct _i3c_master_transfer i3c_master_transfer_t; -typedef struct _i3c_master_handle i3c_master_handle_t; - -/*! @brief i3c master callback functions. */ -typedef struct _i3c_master_transfer_callback -{ - void (*slave2Master)(I3C_Type *base, void *userData); /*!< Transfer complete callback */ - void (*ibiCallback)(I3C_Type *base, - i3c_master_handle_t *handle, - i3c_ibi_type_t ibiType, - i3c_ibi_state_t ibiState); /*!< IBI event callback */ - void (*transferComplete)(I3C_Type *base, - i3c_master_handle_t *handle, - status_t completionStatus, - void *userData); /*!< Transfer complete callback */ -} i3c_master_transfer_callback_t; -/*! - * @brief Transfer option flags. - * - * @note These enumerations are intended to be OR'd together to form a bit mask of options for - * the #_i3c_master_transfer::flags field. - */ -enum _i3c_master_transfer_flags -{ - kI3C_TransferDefaultFlag = 0x00U, /*!< Transfer starts with a start signal, stops with a stop signal. */ - kI3C_TransferNoStartFlag = 0x01U, /*!< Don't send a start condition, address, and sub address */ - kI3C_TransferRepeatedStartFlag = 0x02U, /*!< Send a repeated start condition */ - kI3C_TransferNoStopFlag = 0x04U, /*!< Don't send a stop condition. */ - kI3C_TransferWordsFlag = 0x08U, /*!< Transfer in words, else transfer in bytes. */ - kI3C_TransferDisableRxTermFlag = 0x10U, /*!< Disable Rx termination. Note: It's for I3C CCC transfer. */ - kI3C_TransferRxAutoTermFlag = - 0x20U, /*!< Set Rx auto-termination. Note: It's adaptive based on Rx size(<=255 bytes) except in I3C_MasterReceive. */ - kI3C_TransferStartWithBroadcastAddr = 0x40U, /*!< Start transfer with 0x7E, then read/write data with device address. */ -}; - -/*! - * @brief Non-blocking transfer descriptor structure. - * - * This structure is used to pass transaction parameters to the I3C_MasterTransferNonBlocking() API. - */ -struct _i3c_master_transfer -{ - uint32_t flags; /*!< Bit mask of options for the transfer. See enumeration #_i3c_master_transfer_flags for available - options. Set to 0 or #kI3C_TransferDefaultFlag for normal transfers. */ - uint8_t slaveAddress; /*!< The 7-bit slave address. */ - i3c_direction_t direction; /*!< Either #kI3C_Read or #kI3C_Write. */ - uint32_t subaddress; /*!< Sub address. Transferred MSB first. */ - size_t subaddressSize; /*!< Length of sub address to send in bytes. Maximum size is 4 bytes. */ - void *data; /*!< Pointer to data to transfer. */ - size_t dataSize; /*!< Number of bytes to transfer. */ - i3c_bus_type_t busType; /*!< bus type. */ - i3c_ibi_response_t ibiResponse; /*!< ibi response during transfer. */ -}; - -/*! - * @brief Driver handle for master non-blocking APIs. - * @note The contents of this structure are private and subject to change. - */ -struct _i3c_master_handle -{ - uint8_t state; /*!< Transfer state machine current state. */ - uint32_t remainingBytes; /*!< Remaining byte count in current state. */ - i3c_rx_term_ops_t rxTermOps; /*!< Read termination operation. */ - i3c_master_transfer_t transfer; /*!< Copy of the current transfer info. */ - uint8_t ibiAddress; /*!< Slave address which request IBI. */ - uint8_t *ibiBuff; /*!< Pointer to IBI buffer to keep ibi bytes. */ - size_t ibiPayloadSize; /*!< IBI payload size. */ - i3c_ibi_type_t ibiType; /*!< IBI type. */ - i3c_master_transfer_callback_t callback; /*!< Callback functions pointer. */ - void *userData; /*!< Application data passed to callback. */ -}; - -/*! @brief Typedef for master interrupt handler. */ -typedef void (*i3c_master_isr_t)(I3C_Type *base, void *handle); - -/*! @} */ - -/*! - * @addtogroup i3c_slave_driver - * @{ - */ - -/*! - * @brief I3C slave peripheral flags. - * - * The following status register flags can be cleared: - * - #kI3C_SlaveBusStartFlag - * - #kI3C_SlaveMatchedFlag - * - #kI3C_SlaveBusStopFlag - * - * Only below flags can be enabled as interrupts. - * - #kI3C_SlaveBusStartFlag - * - #kI3C_SlaveMatchedFlag - * - #kI3C_SlaveBusStopFlag - * - #kI3C_SlaveRxReadyFlag - * - #kI3C_SlaveTxReadyFlag - * - #kI3C_SlaveDynamicAddrChangedFlag - * - #kI3C_SlaveReceivedCCCFlag - * - #kI3C_SlaveErrorFlag - * - #kI3C_SlaveHDRCommandMatchFlag - * - #kI3C_SlaveCCCHandledFlag - * - #kI3C_SlaveEventSentFlag - - * @note These enums are meant to be OR'd together to form a bit mask. - */ -enum _i3c_slave_flags -{ - kI3C_SlaveNotStopFlag = I3C_SSTATUS_STNOTSTOP_MASK, /*!< Slave status not stop flag */ - kI3C_SlaveMessageFlag = I3C_SSTATUS_STMSG_MASK, /*!< Slave status message, indicating slave is - listening to the bus traffic or responding */ - kI3C_SlaveRequiredReadFlag = I3C_SSTATUS_STREQRD_MASK, /*!< Slave status required, either is master doing SDR - read from slave, or is IBI pushing out. */ - kI3C_SlaveRequiredWriteFlag = I3C_SSTATUS_STREQWR_MASK, /*!< Slave status request write, master is doing SDR - write to slave, except slave in ENTDAA mode */ - kI3C_SlaveBusDAAFlag = I3C_SSTATUS_STDAA_MASK, /*!< I3C bus is in ENTDAA mode */ - kI3C_SlaveBusHDRModeFlag = I3C_SSTATUS_STHDR_MASK, /*!< I3C bus is in HDR mode */ - kI3C_SlaveBusStartFlag = I3C_SSTATUS_START_MASK, /*!< Start/Re-start event is seen since the bus was last cleared */ - kI3C_SlaveMatchedFlag = I3C_SSTATUS_MATCHED_MASK, /*!< Slave address(dynamic/static) matched since last cleared */ - kI3C_SlaveBusStopFlag = I3C_SSTATUS_STOP_MASK, /*!enableMaster = kI3C_MasterCapable; - * config->disableTimeout = false; - * config->hKeep = kI3C_MasterHighKeeperNone; - * config->enableOpenDrainStop = true; - * config->enableOpenDrainHigh = true; - * config->baudRate_Hz.i2cBaud = 400000U; - * config->baudRate_Hz.i3cPushPullBaud = 12500000U; - * config->baudRate_Hz.i3cOpenDrainBaud = 2500000U; - * config->masterDynamicAddress = 0x0AU; - * config->slowClock_Hz = 1000000U; - * config->enableSlave = true; - * config->vendorID = 0x11BU; - * config->enableRandomPart = false; - * config->partNumber = 0; - * config->dcr = 0; - * config->bcr = 0; - * config->hdrMode = (uint8_t)kI3C_HDRModeDDR; - * config->nakAllRequest = false; - * config->ignoreS0S1Error = false; - * config->offline = false; - * config->matchSlaveStartStop = false; - * @endcode - * - * After calling this function, you can override any settings in order to customize the configuration, - * prior to initializing the common I3C driver with I3C_Init(). - * - * @param[out] config User provided configuration structure for default values. Refer to #i3c_config_t. - */ -void I3C_GetDefaultConfig(i3c_config_t *config); - -/*! - * @brief Initializes the I3C peripheral. - * This function enables the peripheral clock and initializes the I3C peripheral as described by the user - * provided configuration. This will initialize both the master peripheral and slave peripheral so that I3C - * module could work as pure master, pure slave or secondary master, etc. - * A software reset is performed prior to configuration. - * - * @param base The I3C peripheral base address. - * @param config User provided peripheral configuration. Use I3C_GetDefaultConfig() to get a set of - * defaults that you can override. - * @param sourceClock_Hz Frequency in Hertz of the I3C functional clock. Used to calculate the baud rate divisors, - * filter widths, and timeout periods. - */ -void I3C_Init(I3C_Type *base, const i3c_config_t *config, uint32_t sourceClock_Hz); - -/*! @} */ - -/*! - * @addtogroup i3c_master_driver - * @{ - */ - -/*! @name Initialization and deinitialization */ -/*! @{ */ - -/*! - * @brief Provides a default configuration for the I3C master peripheral. - * - * This function provides the following default configuration for the I3C master peripheral: - * @code - * masterConfig->enableMaster = kI3C_MasterOn; - * masterConfig->disableTimeout = false; - * masterConfig->hKeep = kI3C_MasterHighKeeperNone; - * masterConfig->enableOpenDrainStop = true; - * masterConfig->enableOpenDrainHigh = true; - * masterConfig->baudRate_Hz = 100000U; - * masterConfig->busType = kI3C_TypeI2C; - * @endcode - * - * After calling this function, you can override any settings in order to customize the configuration, - * prior to initializing the master driver with I3C_MasterInit(). - * - * @param[out] masterConfig User provided configuration structure for default values. Refer to #i3c_master_config_t. - */ -void I3C_MasterGetDefaultConfig(i3c_master_config_t *masterConfig); - -/*! - * @brief Initializes the I3C master peripheral. - * - * This function enables the peripheral clock and initializes the I3C master peripheral as described by the user - * provided configuration. A software reset is performed prior to configuration. - * - * @param base The I3C peripheral base address. - * @param masterConfig User provided peripheral configuration. Use I3C_MasterGetDefaultConfig() to get a set of - * defaults that you can override. - * @param sourceClock_Hz Frequency in Hertz of the I3C functional clock. Used to calculate the baud rate divisors, - * filter widths, and timeout periods. - */ -void I3C_MasterInit(I3C_Type *base, const i3c_master_config_t *masterConfig, uint32_t sourceClock_Hz); - -/*! - * @brief Deinitializes the I3C master peripheral. - * - * This function disables the I3C master peripheral and gates the clock. It also performs a software - * reset to restore the peripheral to reset conditions. - * - * @param base The I3C peripheral base address. - */ -void I3C_MasterDeinit(I3C_Type *base); - -/* Not static so it can be used from fsl_i3c_dma.c. */ -status_t I3C_MasterCheckAndClearError(I3C_Type *base, uint32_t status); - -/* Not static so it can be used from fsl_i3c_dma.c. */ -status_t I3C_MasterWaitForCtrlDone(I3C_Type *base, bool waitIdle); - -/* Not static so it can be used from fsl_i3c_dma.c. */ -status_t I3C_CheckForBusyBus(I3C_Type *base); - -/*! - * @brief Set I3C module master mode. - * - * @param base The I3C peripheral base address. - * @param enable Enable master mode. - */ -static inline void I3C_MasterEnable(I3C_Type *base, i3c_master_enable_t enable) -{ - base->MCONFIG = (base->MCONFIG & ~I3C_MCONFIG_MSTENA_MASK) | I3C_MCONFIG_MSTENA(enable); -} - -/*! @} */ - -/*! @name Status */ -/*! @{ */ - -/*! - * @brief Gets the I3C master status flags. - * - * A bit mask with the state of all I3C master status flags is returned. For each flag, the corresponding bit - * in the return value is set if the flag is asserted. - * - * @param base The I3C peripheral base address. - * @return State of the status flags: - * - 1: related status flag is set. - * - 0: related status flag is not set. - * @see _i3c_master_flags - */ -static inline uint32_t I3C_MasterGetStatusFlags(I3C_Type *base) -{ - return base->MSTATUS & ~(I3C_MSTATUS_STATE_MASK | I3C_MSTATUS_IBITYPE_MASK); -} - -/*! - * @brief Clears the I3C master status flag state. - * - * The following status register flags can be cleared: - * - #kI3C_MasterSlaveStartFlag - * - #kI3C_MasterControlDoneFlag - * - #kI3C_MasterCompleteFlag - * - #kI3C_MasterArbitrationWonFlag - * - #kI3C_MasterSlave2MasterFlag - * - * Attempts to clear other flags has no effect. - * - * @param base The I3C peripheral base address. - * @param statusMask A bitmask of status flags that are to be cleared. The mask is composed of - * #_i3c_master_flags enumerators OR'd together. You may pass the result of a previous call to - * I3C_MasterGetStatusFlags(). - * @see _i3c_master_flags. - */ -static inline void I3C_MasterClearStatusFlags(I3C_Type *base, uint32_t statusMask) -{ - base->MSTATUS = statusMask; -} - -/*! - * @brief Gets the I3C master error status flags. - * - * A bit mask with the state of all I3C master error status flags is returned. For each flag, the corresponding bit - * in the return value is set if the flag is asserted. - * - * @param base The I3C peripheral base address. - * @return State of the error status flags: - * - 1: related status flag is set. - * - 0: related status flag is not set. - * @see _i3c_master_error_flags - */ -static inline uint32_t I3C_MasterGetErrorStatusFlags(I3C_Type *base) -{ - return base->MERRWARN; -} - -/*! - * @brief Clears the I3C master error status flag state. - * - * @param base The I3C peripheral base address. - * @param statusMask A bitmask of error status flags that are to be cleared. The mask is composed of - * #_i3c_master_error_flags enumerators OR'd together. You may pass the result of a previous call to - * I3C_MasterGetStatusFlags(). - * @see _i3c_master_error_flags. - */ -static inline void I3C_MasterClearErrorStatusFlags(I3C_Type *base, uint32_t statusMask) -{ - while ((base->MERRWARN & statusMask) != 0U) - { - base->MERRWARN = statusMask; - } -} - -/*! - * @brief Gets the I3C master state. - * - * @param base The I3C peripheral base address. - * @return I3C master state. - */ -i3c_master_state_t I3C_MasterGetState(I3C_Type *base); - -/*! @} */ - -/*! @name Interrupts */ -/*! @{ */ - -/*! - * @brief Enables the I3C master interrupt requests. - * - * All flags except #kI3C_MasterBetweenFlag and #kI3C_MasterNackDetectFlag can be enabled as - * interrupts. - * - * @param base The I3C peripheral base address. - * @param interruptMask Bit mask of interrupts to enable. See #_i3c_master_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void I3C_MasterEnableInterrupts(I3C_Type *base, uint32_t interruptMask) -{ - base->MINTSET |= interruptMask; -} - -/*! - * @brief Disables the I3C master interrupt requests. - * - * All flags except #kI3C_MasterBetweenFlag and #kI3C_MasterNackDetectFlag can be enabled as - * interrupts. - * - * @param base The I3C peripheral base address. - * @param interruptMask Bit mask of interrupts to disable. See #_i3c_master_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void I3C_MasterDisableInterrupts(I3C_Type *base, uint32_t interruptMask) -{ - base->MINTCLR = interruptMask; -} - -/*! - * @brief Returns the set of currently enabled I3C master interrupt requests. - * - * @param base The I3C peripheral base address. - * @return A bitmask composed of #_i3c_master_flags enumerators OR'd together to indicate the - * set of enabled interrupts. - */ -static inline uint32_t I3C_MasterGetEnabledInterrupts(I3C_Type *base) -{ - return base->MINTSET; -} - -/*! - * @brief Returns the set of pending I3C master interrupt requests. - * - * @param base The I3C peripheral base address. - * @return A bitmask composed of #_i3c_master_flags enumerators OR'd together to indicate the - * set of pending interrupts. - */ -static inline uint32_t I3C_MasterGetPendingInterrupts(I3C_Type *base) -{ - return base->MINTMASKED; -} - -/*! @} */ - -/*! @name DMA control */ -/*! @{ */ - -/*! - * @brief Enables or disables I3C master DMA requests. - * - * @param base The I3C peripheral base address. - * @param enableTx Enable flag for transmit DMA request. Pass true for enable, false for disable. - * @param enableRx Enable flag for receive DMA request. Pass true for enable, false for disable. - * @param width DMA read/write unit in bytes. - */ -static inline void I3C_MasterEnableDMA(I3C_Type *base, bool enableTx, bool enableRx, uint32_t width) -{ - assert(width <= 2U); - base->MDMACTRL = - I3C_MDMACTRL_DMAFB(enableRx ? 2U : 0U) | I3C_MDMACTRL_DMATB(enableTx ? 2U : 0U) | I3C_MDMACTRL_DMAWIDTH(width); -} - -/*! - * @brief Gets I3C master transmit data register address for DMA transfer. - * - * @param base The I3C peripheral base address. - * @param width DMA read/write unit in bytes. - * @return The I3C Master Transmit Data Register address. - */ -static inline uint32_t I3C_MasterGetTxFifoAddress(I3C_Type *base, uint32_t width) -{ - assert(width <= 2U); - return (uint32_t)((width == 2U) ? &base->MWDATAH : &base->MWDATAB); -} - -/*! - * @brief Gets I3C master receive data register address for DMA transfer. - * - * @param base The I3C peripheral base address. - * @param width DMA read/write unit in bytes. - * @return The I3C Master Receive Data Register address. - */ -static inline uint32_t I3C_MasterGetRxFifoAddress(I3C_Type *base, uint32_t width) -{ - assert(width <= 2U); - return (uint32_t)((width == 2U) ? &base->MRDATAH : &base->MRDATAB); -} - -/*! @} */ - -/*! @name FIFO control */ -/*! @{ */ - -/*! - * @brief Sets the watermarks for I3C master FIFOs. - * - * @param base The I3C peripheral base address. - * @param txLvl Transmit FIFO watermark level. The #kI3C_MasterTxReadyFlag flag is set whenever - * the number of words in the transmit FIFO reaches @a txLvl. - * @param rxLvl Receive FIFO watermark level. The #kI3C_MasterRxReadyFlag flag is set whenever - * the number of words in the receive FIFO reaches @a rxLvl. - * @param flushTx true if TX FIFO is to be cleared, otherwise TX FIFO remains unchanged. - * @param flushRx true if RX FIFO is to be cleared, otherwise RX FIFO remains unchanged. - */ -static inline void I3C_MasterSetWatermarks( - I3C_Type *base, i3c_tx_trigger_level_t txLvl, i3c_rx_trigger_level_t rxLvl, bool flushTx, bool flushRx) -{ - base->MDATACTRL = I3C_MDATACTRL_UNLOCK_MASK | I3C_MDATACTRL_TXTRIG(txLvl) | I3C_MDATACTRL_RXTRIG(rxLvl) | - (flushTx ? I3C_MDATACTRL_FLUSHTB_MASK : 0U) | (flushRx ? I3C_MDATACTRL_FLUSHFB_MASK : 0U); -} - -/*! - * @brief Gets the current number of bytes in the I3C master FIFOs. - * - * @param base The I3C peripheral base address. - * @param[out] txCount Pointer through which the current number of bytes in the transmit FIFO is returned. - * Pass NULL if this value is not required. - * @param[out] rxCount Pointer through which the current number of bytes in the receive FIFO is returned. - * Pass NULL if this value is not required. - */ -static inline void I3C_MasterGetFifoCounts(I3C_Type *base, size_t *rxCount, size_t *txCount) -{ - if (NULL != txCount) - { - *txCount = (base->MDATACTRL & I3C_MDATACTRL_TXCOUNT_MASK) >> I3C_MDATACTRL_TXCOUNT_SHIFT; - } - if (NULL != rxCount) - { - *rxCount = (base->MDATACTRL & I3C_MDATACTRL_RXCOUNT_MASK) >> I3C_MDATACTRL_RXCOUNT_SHIFT; - } -} - -/*! @} */ - -/*! @name Bus operations */ -/*! @{ */ - -/*! - * @brief Sets the I3C bus frequency for master transactions. - * - * The I3C master is automatically disabled and re-enabled as necessary to configure the baud - * rate. Do not call this function during a transfer, or the transfer is aborted. - * - * @param base The I3C peripheral base address. - * @param baudRate_Hz Pointer to structure of requested bus frequency in Hertz. - * @param sourceClock_Hz I3C functional clock frequency in Hertz. - */ -void I3C_MasterSetBaudRate(I3C_Type *base, const i3c_baudrate_hz_t *baudRate_Hz, uint32_t sourceClock_Hz); - -/*! - * @brief Returns whether the bus is idle. - * - * Requires the master mode to be enabled. - * - * @param base The I3C peripheral base address. - * @retval true Bus is busy. - * @retval false Bus is idle. - */ -static inline bool I3C_MasterGetBusIdleState(I3C_Type *base) -{ - return ((base->MSTATUS & I3C_MSTATUS_STATE_MASK) == (uint32_t)kI3C_MasterStateIdle ? true : false); -} - -/*! - * @brief Sends a START signal and slave address on the I2C/I3C bus, receive size is also specified - * in the call. - * - * This function is used to initiate a new master mode transfer. First, the bus state is checked to ensure - * that another master is not occupying the bus. Then a START signal is transmitted, followed by the - * 7-bit address specified in the a address parameter. Note that this function does not actually wait - * until the START and address are successfully sent on the bus before returning. - * - * @param base The I3C peripheral base address. - * @param type The bus type to use in this transaction. - * @param address 7-bit slave device address, in bits [6:0]. - * @param dir Master transfer direction, either #kI3C_Read or #kI3C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * @param rxSize Read terminate size for the followed read transfer, limit to 255 bytes. - * @retval #kStatus_Success START signal and address were successfully enqueued in the transmit FIFO. - * @retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - */ -status_t I3C_MasterStartWithRxSize( - I3C_Type *base, i3c_bus_type_t type, uint8_t address, i3c_direction_t dir, uint8_t rxSize); - -/*! - * @brief Sends a START signal and slave address on the I2C/I3C bus. - * - * This function is used to initiate a new master mode transfer. First, the bus state is checked to ensure - * that another master is not occupying the bus. Then a START signal is transmitted, followed by the - * 7-bit address specified in the @a address parameter. Note that this function does not actually wait - * until the START and address are successfully sent on the bus before returning. - * - * @param base The I3C peripheral base address. - * @param type The bus type to use in this transaction. - * @param address 7-bit slave device address, in bits [6:0]. - * @param dir Master transfer direction, either #kI3C_Read or #kI3C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * @retval #kStatus_Success START signal and address were successfully enqueued in the transmit FIFO. - * @retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - */ -status_t I3C_MasterStart(I3C_Type *base, i3c_bus_type_t type, uint8_t address, i3c_direction_t dir); - -/*! - * @brief Sends a repeated START signal and slave address on the I2C/I3C bus, receive size is also specified - * in the call. - * - * This function is used to send a Repeated START signal when a transfer is already in progress. Like - * I3C_MasterStart(), it also sends the specified 7-bit address. Call this API also configures the read - * terminate size for the following read transfer. For example, set the rxSize = 2, the following read transfer - * will be terminated after two bytes of data received. Write transfer will not be affected by the rxSize - * configuration. - * - * @note This function exists primarily to maintain compatible APIs between I3C and I2C drivers, - * as well as to better document the intent of code that uses these APIs. - * - * @param base The I3C peripheral base address. - * @param type The bus type to use in this transaction. - * @param address 7-bit slave device address, in bits [6:0]. - * @param dir Master transfer direction, either #kI3C_Read or #kI3C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * @param rxSize Read terminate size for the followed read transfer, limit to 255 bytes. - * @retval #kStatus_Success Repeated START signal and address were successfully enqueued in the transmit FIFO. - */ -status_t I3C_MasterRepeatedStartWithRxSize( - I3C_Type *base, i3c_bus_type_t type, uint8_t address, i3c_direction_t dir, uint8_t rxSize); - -/*! - * @brief Sends a repeated START signal and slave address on the I2C/I3C bus. - * - * This function is used to send a Repeated START signal when a transfer is already in progress. Like - * I3C_MasterStart(), it also sends the specified 7-bit address. - * - * @note This function exists primarily to maintain compatible APIs between I3C and I2C drivers, - * as well as to better document the intent of code that uses these APIs. - * - * @param base The I3C peripheral base address. - * @param type The bus type to use in this transaction. - * @param address 7-bit slave device address, in bits [6:0]. - * @param dir Master transfer direction, either #kI3C_Read or #kI3C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * @retval #kStatus_Success Repeated START signal and address were successfully enqueued in the transmit FIFO. - */ -static inline status_t I3C_MasterRepeatedStart(I3C_Type *base, - i3c_bus_type_t type, - uint8_t address, - i3c_direction_t dir) -{ - return I3C_MasterRepeatedStartWithRxSize(base, type, address, dir, 0); -} - -/*! - * @brief Performs a polling send transfer on the I2C/I3C bus. - * - * Sends up to @a txSize number of bytes to the previously addressed slave device. The slave may - * reply with a NAK to any byte in order to terminate the transfer early. If this happens, this - * function returns #kStatus_I3C_Nak. - * - * @param base The I3C peripheral base address. - * @param txBuff The pointer to the data to be transferred. - * @param txSize The length in bytes of the data to be transferred. - * @param flags Bit mask of options for the transfer. See enumeration #_i3c_master_transfer_flags for available options. - * @retval #kStatus_Success Data was sent successfully. - * @retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_I3C_Timeout The module has stalled too long in a frame. - * @retval #kStatus_I3C_Nak The slave device sent a NAK in response to an address. - * @retval #kStatus_I3C_WriteAbort The slave device sent a NAK in response to a write. - * @retval #kStatus_I3C_MsgError Message SDR/DDR mismatch or read/write message in wrong state. - * @retval #kStatus_I3C_WriteFifoError Write to M/SWDATAB register when FIFO full. - * @retval #kStatus_I3C_InvalidReq Invalid use of request. - */ -status_t I3C_MasterSend(I3C_Type *base, const void *txBuff, size_t txSize, uint32_t flags); - -/*! - * @brief Performs a polling receive transfer on the I2C/I3C bus. - * - * @param base The I3C peripheral base address. - * @param rxBuff The pointer to the data to be transferred. - * @param rxSize The length in bytes of the data to be transferred. - * @param flags Bit mask of options for the transfer. See enumeration #_i3c_master_transfer_flags for available options. - * @retval #kStatus_Success Data was received successfully. - * @retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_I3C_Timeout The module has stalled too long in a frame. - * @retval #kStatus_I3C_Term The master terminates slave read. - * @retval #kStatus_I3C_HdrParityError Parity error from DDR read. - * @retval #kStatus_I3C_CrcError CRC error from DDR read. - * @retval #kStatus_I3C_MsgError Message SDR/DDR mismatch or read/write message in wrong state. - * @retval #kStatus_I3C_ReadFifoError Read from M/SRDATAB register when FIFO empty. - * @retval #kStatus_I3C_InvalidReq Invalid use of request. - */ -status_t I3C_MasterReceive(I3C_Type *base, void *rxBuff, size_t rxSize, uint32_t flags); - -/*! - * @brief Sends a STOP signal on the I2C/I3C bus. - * - * This function does not return until the STOP signal is seen on the bus, or an error occurs. - * - * @param base The I3C peripheral base address. - * @retval #kStatus_Success The STOP signal was successfully sent on the bus and the transaction terminated. - * @retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_I3C_Timeout The module has stalled too long in a frame. - * @retval #kStatus_I3C_InvalidReq Invalid use of request. - */ -status_t I3C_MasterStop(I3C_Type *base); - -/*! - * @brief I3C master emit request. - * - * @param base The I3C peripheral base address. - * @param masterReq I3C master request of type #i3c_bus_request_t - */ -void I3C_MasterEmitRequest(I3C_Type *base, i3c_bus_request_t masterReq); - -/*! - * @brief I3C master emit request. - * - * @param base The I3C peripheral base address. - * @param ibiResponse I3C master emit IBI response of type #i3c_ibi_response_t - */ -static inline void I3C_MasterEmitIBIResponse(I3C_Type *base, i3c_ibi_response_t ibiResponse) -{ - uint32_t ctrlVal = base->MCTRL; - ctrlVal &= ~(I3C_MCTRL_IBIRESP_MASK | I3C_MCTRL_REQUEST_MASK); - ctrlVal |= I3C_MCTRL_IBIRESP((uint32_t)ibiResponse) | I3C_MCTRL_REQUEST(kI3C_RequestIbiAckNack); - base->MCTRL = ctrlVal; -} - -/*! - * @brief I3C master register IBI rule. - * - * @param base The I3C peripheral base address. - * @param ibiRule Pointer to ibi rule description of type #i3c_register_ibi_addr_t - */ -void I3C_MasterRegisterIBI(I3C_Type *base, i3c_register_ibi_addr_t *ibiRule); - -/*! - * @brief I3C master get IBI rule. - * - * @param base The I3C peripheral base address. - * @param ibiRule Pointer to store the read out ibi rule description. - */ -void I3C_MasterGetIBIRules(I3C_Type *base, i3c_register_ibi_addr_t *ibiRule); - -/*! - * @brief I3C master get IBI Type. - * - * @param base The I3C peripheral base address. - * @retval i3c_ibi_type_t Type of #i3c_ibi_type_t. - */ -i3c_ibi_type_t I3C_GetIBIType(I3C_Type *base); - -/*! - * @brief I3C master get IBI Address. - * - * @param base The I3C peripheral base address. - * @retval The 8-bit IBI address. - */ -static inline uint8_t I3C_GetIBIAddress(I3C_Type *base) -{ - return (uint8_t)((base->MSTATUS & I3C_MSTATUS_IBIADDR_MASK) >> I3C_MSTATUS_IBIADDR_SHIFT); -} - -/*! - * @brief Performs a DAA in the i3c bus with specified temporary baud rate. - * - * @param base The I3C peripheral base address. - * @param addressList The pointer for address list which is used to do DAA. - * @param count The address count in the address list. - * @param daaBaudRate The temporary baud rate in DAA process, NULL for using initial setting. - * The initial setting is set back between the completion of the DAA and the return of this function. - * @retval #kStatus_Success The transaction was started successfully. - * @retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - * @retval #kStatus_I3C_SlaveCountExceed The I3C slave count has exceed the definition in I3C_MAX_DEVCNT. - */ -status_t I3C_MasterProcessDAASpecifiedBaudrate(I3C_Type *base, - uint8_t *addressList, - uint32_t count, - i3c_master_daa_baudrate_t *daaBaudRate); - -/*! - * @brief Performs a DAA in the i3c bus. - * - * @param base The I3C peripheral base address. - * @param addressList The pointer for address list which is used to do DAA. - * @param count The address count in the address list. - * The initial setting is set back between the completion of the DAA and the return of this function. - * @retval #kStatus_Success The transaction was started successfully. - * @retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - * @retval #kStatus_I3C_SlaveCountExceed The I3C slave count has exceed the definition in I3C_MAX_DEVCNT. - */ -static inline status_t I3C_MasterProcessDAA(I3C_Type *base, uint8_t *addressList, uint32_t count) -{ - return I3C_MasterProcessDAASpecifiedBaudrate(base, addressList, count, NULL); -} - -/*! - * @brief Get device information list after DAA process is done. - * - * @param base The I3C peripheral base address. - * @param[out] count The pointer to store the available device count. - * @return Pointer to the i3c_device_info_t array. - */ -i3c_device_info_t *I3C_MasterGetDeviceListAfterDAA(I3C_Type *base, uint8_t *count); -/*! - * @brief Performs a master polling transfer on the I2C/I3C bus. - * - * @note The API does not return until the transfer succeeds or fails due - * to error happens during transfer. - * - * @param base The I3C peripheral base address. - * @param transfer Pointer to the transfer structure. - * @retval #kStatus_Success Data was received successfully. - * @retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_I3C_IBIWon The I3C slave event IBI or MR or HJ won the arbitration on a header address. - * @retval #kStatus_I3C_Timeout The module has stalled too long in a frame. - * @retval #kStatus_I3C_Nak The slave device sent a NAK in response to an address. - * @retval #kStatus_I3C_WriteAbort The slave device sent a NAK in response to a write. - * @retval #kStatus_I3C_Term The master terminates slave read. - * @retval #kStatus_I3C_HdrParityError Parity error from DDR read. - * @retval #kStatus_I3C_CrcError CRC error from DDR read. - * @retval #kStatus_I3C_MsgError Message SDR/DDR mismatch or read/write message in wrong state. - * @retval #kStatus_I3C_ReadFifoError Read from M/SRDATAB register when FIFO empty. - * @retval #kStatus_I3C_WriteFifoError Write to M/SWDATAB register when FIFO full. - * @retval #kStatus_I3C_InvalidReq Invalid use of request. - */ -status_t I3C_MasterTransferBlocking(I3C_Type *base, i3c_master_transfer_t *transfer); - -/*! @} */ - -/*! @name Non-blocking */ -/*! @{ */ - -/*! - * @brief Creates a new handle for the I3C master non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the I3C_MasterTransferAbort() API shall be called. - * - * - * @note The function also enables the NVIC IRQ for the input I3C. Need to notice - * that on some SoCs the I3C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - * - * @param base The I3C peripheral base address. - * @param[out] handle Pointer to the I3C master driver handle. - * @param callback User provided pointer to the asynchronous callback function. - * @param userData User provided pointer to the application callback data. - */ -void I3C_MasterTransferCreateHandle(I3C_Type *base, - i3c_master_handle_t *handle, - const i3c_master_transfer_callback_t *callback, - void *userData); - -/*! - * @brief Performs a non-blocking transaction on the I2C/I3C bus. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C master driver handle. - * @param transfer The pointer to the transfer descriptor. - * @retval #kStatus_Success The transaction was started successfully. - * @retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - */ -status_t I3C_MasterTransferNonBlocking(I3C_Type *base, i3c_master_handle_t *handle, i3c_master_transfer_t *transfer); - -/*! - * @brief Returns number of bytes transferred so far. - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C master driver handle. - * @param[out] count Number of bytes transferred so far by the non-blocking transaction. - * @retval #kStatus_Success - * @retval #kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t I3C_MasterTransferGetCount(I3C_Type *base, i3c_master_handle_t *handle, size_t *count); - -/*! - * @brief Terminates a non-blocking I3C master transmission early. - * - * @note It is not safe to call this function from an IRQ handler that has a higher priority than the - * I3C peripheral's IRQ priority. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C master driver handle. - * @retval #kStatus_Success A transaction was successfully aborted. - * @retval #kStatus_I3C_Idle There is not a non-blocking transaction currently in progress. - */ -void I3C_MasterTransferAbort(I3C_Type *base, i3c_master_handle_t *handle); - -/*! @} */ - -/*! @name IRQ handler */ -/*! @{ */ - -/*! - * @brief Reusable routine to handle master interrupts. - * @note This function does not need to be called unless you are reimplementing the - * nonblocking API's interrupt handler routines to add special functionality. - * @param base The I3C peripheral base address. - * @param intHandle Pointer to the I3C master driver handle. - */ -void I3C_MasterTransferHandleIRQ(I3C_Type *base, void *intHandle); - -/*! @} */ - -/*! @} */ - -/*! - * @addtogroup i3c_slave_driver - * @{ - */ - -/*! @name Initialization and deinitialization */ -/*! @{ */ - -/*! - * @brief Provides a default configuration for the I3C slave peripheral. - * - * This function provides the following default configuration for the I3C slave peripheral: - * @code - * slaveConfig->enableslave = true; - * @endcode - * - * After calling this function, you can override any settings in order to customize the configuration, - * prior to initializing the slave driver with I3C_SlaveInit(). - * - * @param[out] slaveConfig User provided configuration structure for default values. Refer to #i3c_slave_config_t. - */ -void I3C_SlaveGetDefaultConfig(i3c_slave_config_t *slaveConfig); - -/*! - * @brief Initializes the I3C slave peripheral. - * - * This function enables the peripheral clock and initializes the I3C slave peripheral as described by the user - * provided configuration. - * - * @param base The I3C peripheral base address. - * @param slaveConfig User provided peripheral configuration. Use I3C_SlaveGetDefaultConfig() to get a set of - * defaults that you can override. - * @param slowClock_Hz Frequency in Hertz of the I3C slow clock. Used to calculate the bus match condition values. - * If FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH defines as 1, this parameter is useless. - */ -void I3C_SlaveInit(I3C_Type *base, const i3c_slave_config_t *slaveConfig, uint32_t slowClock_Hz); - -/*! - * @brief Deinitializes the I3C slave peripheral. - * - * This function disables the I3C slave peripheral and gates the clock. - * - * @param base The I3C peripheral base address. - */ -void I3C_SlaveDeinit(I3C_Type *base); - -/*! - * @brief Enable/Disable Slave. - * - * @param base The I3C peripheral base address. - * @param isEnable Enable or disable. - */ -static inline void I3C_SlaveEnable(I3C_Type *base, bool isEnable) -{ - base->SCONFIG = (base->SCONFIG & ~I3C_SCONFIG_SLVENA_MASK) | I3C_SCONFIG_SLVENA(isEnable); -} - -/*! @} */ - -/*! @name Status */ -/*! @{ */ - -/*! - * @brief Gets the I3C slave status flags. - * - * A bit mask with the state of all I3C slave status flags is returned. For each flag, the corresponding bit - * in the return value is set if the flag is asserted. - * - * @param base The I3C peripheral base address. - * @return State of the status flags: - * - 1: related status flag is set. - * - 0: related status flag is not set. - * @see _i3c_slave_flags - */ -static inline uint32_t I3C_SlaveGetStatusFlags(I3C_Type *base) -{ - return base->SSTATUS & ~(I3C_SSTATUS_EVDET_MASK | I3C_SSTATUS_ACTSTATE_MASK | I3C_SSTATUS_TIMECTRL_MASK); -} - -/*! - * @brief Clears the I3C slave status flag state. - * - * The following status register flags can be cleared: - * - #kI3C_SlaveBusStartFlag - * - #kI3C_SlaveMatchedFlag - * - #kI3C_SlaveBusStopFlag - * - * Attempts to clear other flags has no effect. - * - * @param base The I3C peripheral base address. - * @param statusMask A bitmask of status flags that are to be cleared. The mask is composed of - * #_i3c_slave_flags enumerators OR'd together. You may pass the result of a previous call to - * I3C_SlaveGetStatusFlags(). - * @see _i3c_slave_flags. - */ -static inline void I3C_SlaveClearStatusFlags(I3C_Type *base, uint32_t statusMask) -{ - base->SSTATUS = statusMask; -} - -/*! - * @brief Gets the I3C slave error status flags. - * - * A bit mask with the state of all I3C slave error status flags is returned. For each flag, the corresponding bit - * in the return value is set if the flag is asserted. - * - * @param base The I3C peripheral base address. - * @return State of the error status flags: - * - 1: related status flag is set. - * - 0: related status flag is not set. - * @see _i3c_slave_error_flags - */ -static inline uint32_t I3C_SlaveGetErrorStatusFlags(I3C_Type *base) -{ - return base->SERRWARN; -} - -/*! - * @brief Clears the I3C slave error status flag state. - * - * @param base The I3C peripheral base address. - * @param statusMask A bitmask of error status flags that are to be cleared. The mask is composed of - * #_i3c_slave_error_flags enumerators OR'd together. You may pass the result of a previous call to - * I3C_SlaveGetErrorStatusFlags(). - * @see _i3c_slave_error_flags. - */ -static inline void I3C_SlaveClearErrorStatusFlags(I3C_Type *base, uint32_t statusMask) -{ - base->SERRWARN = statusMask; -} - -/*! - * @brief Gets the I3C slave state. - * - * @param base The I3C peripheral base address. - * @return I3C slave activity state, refer #i3c_slave_activity_state_t. - */ -i3c_slave_activity_state_t I3C_SlaveGetActivityState(I3C_Type *base); - -/* Not static so it can be used from fsl_i3c_dma.c. */ -status_t I3C_SlaveCheckAndClearError(I3C_Type *base, uint32_t status); -/*! @} */ - -/*! @name Interrupts */ -/*! @{ */ - -/*! - * @brief Enables the I3C slave interrupt requests. - * - * Only below flags can be enabled as interrupts. - * - #kI3C_SlaveBusStartFlag - * - #kI3C_SlaveMatchedFlag - * - #kI3C_SlaveBusStopFlag - * - #kI3C_SlaveRxReadyFlag - * - #kI3C_SlaveTxReadyFlag - * - #kI3C_SlaveDynamicAddrChangedFlag - * - #kI3C_SlaveReceivedCCCFlag - * - #kI3C_SlaveErrorFlag - * - #kI3C_SlaveHDRCommandMatchFlag - * - #kI3C_SlaveCCCHandledFlag - * - #kI3C_SlaveEventSentFlag - * - * @param base The I3C peripheral base address. - * @param interruptMask Bit mask of interrupts to enable. See #_i3c_slave_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void I3C_SlaveEnableInterrupts(I3C_Type *base, uint32_t interruptMask) -{ - base->SINTSET |= interruptMask; -} - -/*! - * @brief Disables the I3C slave interrupt requests. - * - * Only below flags can be disabled as interrupts. - * - #kI3C_SlaveBusStartFlag - * - #kI3C_SlaveMatchedFlag - * - #kI3C_SlaveBusStopFlag - * - #kI3C_SlaveRxReadyFlag - * - #kI3C_SlaveTxReadyFlag - * - #kI3C_SlaveDynamicAddrChangedFlag - * - #kI3C_SlaveReceivedCCCFlag - * - #kI3C_SlaveErrorFlag - * - #kI3C_SlaveHDRCommandMatchFlag - * - #kI3C_SlaveCCCHandledFlag - * - #kI3C_SlaveEventSentFlag - * - * @param base The I3C peripheral base address. - * @param interruptMask Bit mask of interrupts to disable. See #_i3c_slave_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void I3C_SlaveDisableInterrupts(I3C_Type *base, uint32_t interruptMask) -{ - base->SINTCLR = interruptMask; -} - -/*! - * @brief Returns the set of currently enabled I3C slave interrupt requests. - * - * @param base The I3C peripheral base address. - * @return A bitmask composed of #_i3c_slave_flags enumerators OR'd together to indicate the - * set of enabled interrupts. - */ -static inline uint32_t I3C_SlaveGetEnabledInterrupts(I3C_Type *base) -{ - return base->SINTSET; -} - -/*! - * @brief Returns the set of pending I3C slave interrupt requests. - * - * @param base The I3C peripheral base address. - * @return A bitmask composed of #_i3c_slave_flags enumerators OR'd together to indicate the - * set of pending interrupts. - */ -static inline uint32_t I3C_SlaveGetPendingInterrupts(I3C_Type *base) -{ - return base->SINTMASKED; -} - -/*! @} */ - -/*! @name DMA control */ -/*! @{ */ - -/*! - * @brief Enables or disables I3C slave DMA requests. - * - * @param base The I3C peripheral base address. - * @param enableTx Enable flag for transmit DMA request. Pass true for enable, false for disable. - * @param enableRx Enable flag for receive DMA request. Pass true for enable, false for disable. - * @param width DMA read/write unit in bytes. - */ -static inline void I3C_SlaveEnableDMA(I3C_Type *base, bool enableTx, bool enableRx, uint32_t width) -{ - assert(width <= 2U); - base->SDMACTRL = - I3C_SDMACTRL_DMAFB(enableRx ? 2U : 0U) | I3C_SDMACTRL_DMATB(enableTx ? 2U : 0U) | I3C_SDMACTRL_DMAWIDTH(width); -} - -/*! - * @brief Gets I3C slave transmit data register address for DMA transfer. - * - * @param base The I3C peripheral base address. - * @param width DMA read/write unit in bytes. - * @return The I3C Slave Transmit Data Register address. - */ -static inline uint32_t I3C_SlaveGetTxFifoAddress(I3C_Type *base, uint32_t width) -{ - assert(width <= 2U); - return (uint32_t)((width == 2U) ? &base->SWDATAH : &base->SWDATAB); -} - -/*! - * @brief Gets I3C slave receive data register address for DMA transfer. - * - * @param base The I3C peripheral base address. - * @param width DMA read/write unit in bytes. - * @return The I3C Slave Receive Data Register address. - */ -static inline uint32_t I3C_SlaveGetRxFifoAddress(I3C_Type *base, uint32_t width) -{ - assert(width <= 2U); - return (uint32_t)((width == 2U) ? &base->SRDATAH : &base->SRDATAB); -} - -/*! @} */ - -/*! @name FIFO control */ -/*! @{ */ - -/*! - * @brief Sets the watermarks for I3C slave FIFOs. - * - * @param base The I3C peripheral base address. - * @param txLvl Transmit FIFO watermark level. The #kI3C_SlaveTxReadyFlag flag is set whenever - * the number of words in the transmit FIFO reaches @a txLvl. - * @param rxLvl Receive FIFO watermark level. The #kI3C_SlaveRxReadyFlag flag is set whenever - * the number of words in the receive FIFO reaches @a rxLvl. - * @param flushTx true if TX FIFO is to be cleared, otherwise TX FIFO remains unchanged. - * @param flushRx true if RX FIFO is to be cleared, otherwise RX FIFO remains unchanged. - */ -static inline void I3C_SlaveSetWatermarks( - I3C_Type *base, i3c_tx_trigger_level_t txLvl, i3c_rx_trigger_level_t rxLvl, bool flushTx, bool flushRx) -{ - base->SDATACTRL = I3C_SDATACTRL_UNLOCK_MASK | I3C_SDATACTRL_TXTRIG(txLvl) | I3C_SDATACTRL_RXTRIG(rxLvl) | - (flushTx ? I3C_SDATACTRL_FLUSHTB_MASK : 0U) | (flushRx ? I3C_SDATACTRL_FLUSHFB_MASK : 0U); -} - -/*! - * @brief Gets the current number of bytes in the I3C slave FIFOs. - * - * @param base The I3C peripheral base address. - * @param[out] txCount Pointer through which the current number of bytes in the transmit FIFO is returned. - * Pass NULL if this value is not required. - * @param[out] rxCount Pointer through which the current number of bytes in the receive FIFO is returned. - * Pass NULL if this value is not required. - */ -static inline void I3C_SlaveGetFifoCounts(I3C_Type *base, size_t *rxCount, size_t *txCount) -{ - if (NULL != txCount) - { - *txCount = (base->SDATACTRL & I3C_SDATACTRL_TXCOUNT_MASK) >> I3C_SDATACTRL_TXCOUNT_SHIFT; - } - if (NULL != rxCount) - { - *rxCount = (base->SDATACTRL & I3C_SDATACTRL_RXCOUNT_MASK) >> I3C_SDATACTRL_RXCOUNT_SHIFT; - } -} - -/*! @} */ - -/*! @name Bus operations */ -/*! @{ */ - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) && FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) -/*! - * @brief I3C slave request event. - * - * @param base The I3C peripheral base address. - * @param event I3C slave event of type #i3c_slave_event_t - */ -void I3C_SlaveRequestEvent(I3C_Type *base, i3c_slave_event_t event); -#endif - -/*! - * @brief Performs a polling send transfer on the I3C bus. - * - * @param base The I3C peripheral base address. - * @param txBuff The pointer to the data to be transferred. - * @param txSize The length in bytes of the data to be transferred. - * @return Error or success status returned by API. - */ -status_t I3C_SlaveSend(I3C_Type *base, const void *txBuff, size_t txSize); - -/*! - * @brief Performs a polling receive transfer on the I3C bus. - * - * @param base The I3C peripheral base address. - * @param rxBuff The pointer to the data to be transferred. - * @param rxSize The length in bytes of the data to be transferred. - * @return Error or success status returned by API. - */ -status_t I3C_SlaveReceive(I3C_Type *base, void *rxBuff, size_t rxSize); - -/*! @} */ - -/*! @name Slave non-blocking */ -/*! @{ */ - -/*! - * @brief Creates a new handle for the I3C slave non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the I3C_SlaveTransferAbort() API shall be called. - * - * @note The function also enables the NVIC IRQ for the input I3C. Need to notice - * that on some SoCs the I3C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - - * @param base The I3C peripheral base address. - * @param[out] handle Pointer to the I3C slave driver handle. - * @param callback User provided pointer to the asynchronous callback function. - * @param userData User provided pointer to the application callback data. - */ -void I3C_SlaveTransferCreateHandle(I3C_Type *base, - i3c_slave_handle_t *handle, - i3c_slave_transfer_callback_t callback, - void *userData); - -/*! - * @brief Starts accepting slave transfers. - * - * Call this API after calling I2C_SlaveInit() and I3C_SlaveTransferCreateHandle() to start processing - * transactions driven by an I2C master. The slave monitors the I2C bus and pass events to the - * callback that was passed into the call to I3C_SlaveTransferCreateHandle(). The callback is always invoked - * from the interrupt context. - * - * The set of events received by the callback is customizable. To do so, set the @a eventMask parameter to - * the OR'd combination of #i3c_slave_transfer_event_t enumerators for the events you wish to receive. - * The #kI3C_SlaveTransmitEvent and #kI3C_SlaveReceiveEvent events are always enabled and do not need - * to be included in the mask. Alternatively, you can pass 0 to get a default set of only the transmit and - * receive events that are always enabled. In addition, the #kI3C_SlaveAllEvents constant is provided as - * a convenient way to enable all events. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to struct: _i3c_slave_handle structure which stores the transfer state. - * @param eventMask Bit mask formed by OR'ing together #i3c_slave_transfer_event_t enumerators to specify - * which events to send to the callback. Other accepted values are 0 to get a default set of - * only the transmit and receive events, and #kI3C_SlaveAllEvents to enable all events. - * - * @retval #kStatus_Success Slave transfers were successfully started. - * @retval #kStatus_I3C_Busy Slave transfers have already been started on this handle. - */ -status_t I3C_SlaveTransferNonBlocking(I3C_Type *base, i3c_slave_handle_t *handle, uint32_t eventMask); - -/*! - * @brief Gets the slave transfer status during a non-blocking transfer. - * @param base The I3C peripheral base address. - * @param handle Pointer to i2c_slave_handle_t structure. - * @param[out] count Pointer to a value to hold the number of bytes transferred. May be NULL if the count is not - * required. - * @retval #kStatus_Success - * @retval #kStatus_NoTransferInProgress - */ -status_t I3C_SlaveTransferGetCount(I3C_Type *base, i3c_slave_handle_t *handle, size_t *count); - -/*! - * @brief Aborts the slave non-blocking transfers. - * @note This API could be called at any time to stop slave for handling the bus events. - * @param base The I3C peripheral base address. - * @param handle Pointer to struct: _i3c_slave_handle structure which stores the transfer state. - * @retval #kStatus_Success - * @retval #kStatus_I3C_Idle - */ -void I3C_SlaveTransferAbort(I3C_Type *base, i3c_slave_handle_t *handle); - -/*! @} */ - -/*! @name Slave IRQ handler */ -/*! @{ */ - -/*! - * @brief Reusable routine to handle slave interrupts. - * @note This function does not need to be called unless you are reimplementing the - * non blocking API's interrupt handler routines to add special functionality. - * @param base The I3C peripheral base address. - * @param intHandle Pointer to struct: _i3c_slave_handle structure which stores the transfer state. - */ -void I3C_SlaveTransferHandleIRQ(I3C_Type *base, void *intHandle); - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) && FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) -/*! - * @brief I3C slave request IBI event with data payload(mandatory and extended). - * - * @param base The I3C peripheral base address. - * @param data Pointer to IBI data to be sent in the request. - * @param dataSize IBI data size. - */ -void I3C_SlaveRequestIBIWithData(I3C_Type *base, uint8_t *data, size_t dataSize); - -/*! - * @brief I3C slave request IBI event with single data. - * @deprecated Do not use this function. It has been superseded by @ref I3C_SlaveRequestIBIWithData. - * - * @param base The I3C peripheral base address. - * @param data IBI data to be sent in the request. - * @param dataSize IBI data size. - */ -void I3C_SlaveRequestIBIWithSingleData(I3C_Type *base, uint8_t data, size_t dataSize); -#endif /* !(defined(FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) && FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) */ - -/*! @} */ -/*! @} */ -#if defined(__cplusplus) -} -#endif - -#endif /* FSL_I3C_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_i3c_edma.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_i3c_edma.c deleted file mode 100644 index 7ff5e8a6d04..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_i3c_edma.c +++ /dev/null @@ -1,1057 +0,0 @@ -/* - * Copyright 2022-2023 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_i3c_edma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.i3c_edma" -#endif - -/*! @brief States for the state machine used by transactional APIs. */ -enum _i3c_edma_transfer_states -{ - kIdleState = 0, - kIBIWonState, - kSlaveStartState, - kSendCommandState, - kWaitRepeatedStartCompleteState, - kTransmitDataState, - kReceiveDataState, - kStopState, - kWaitForCompletionState, - kAddressMatchState, -}; - -/*! @brief Common sets of flags used by the driver. */ -enum _i3c_edma_flag_constants -{ - /*! All flags which are cleared by the driver upon starting a transfer. */ - kMasterClearFlags = kI3C_MasterSlaveStartFlag | kI3C_MasterControlDoneFlag | kI3C_MasterCompleteFlag | - kI3C_MasterArbitrationWonFlag | kI3C_MasterSlave2MasterFlag | kI3C_MasterErrorFlag, - - /*! IRQ sources enabled by the non-blocking transactional API. */ - kMasterDMAIrqFlags = kI3C_MasterSlaveStartFlag | kI3C_MasterControlDoneFlag | kI3C_MasterCompleteFlag | - kI3C_MasterArbitrationWonFlag | kI3C_MasterErrorFlag | kI3C_MasterSlave2MasterFlag, - - /*! Errors to check for. */ - kMasterErrorFlags = kI3C_MasterErrorNackFlag | kI3C_MasterErrorWriteAbortFlag | -#if !defined(FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) || (!FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) - kI3C_MasterErrorTermFlag | -#endif - kI3C_MasterErrorParityFlag | kI3C_MasterErrorCrcFlag | kI3C_MasterErrorReadFlag | - kI3C_MasterErrorWriteFlag | kI3C_MasterErrorMsgFlag | kI3C_MasterErrorInvalidReqFlag | - kI3C_MasterErrorTimeoutFlag, - /*! All flags which are cleared by the driver upon starting a transfer. */ - kSlaveClearFlags = kI3C_SlaveBusStartFlag | kI3C_SlaveMatchedFlag | kI3C_SlaveBusStopFlag, - - /*! IRQ sources enabled by the non-blocking transactional API. */ - kSlaveDMAIrqFlags = kI3C_SlaveBusStartFlag | kI3C_SlaveMatchedFlag | - kI3C_SlaveBusStopFlag | /*kI3C_SlaveRxReadyFlag |*/ - kI3C_SlaveDynamicAddrChangedFlag | kI3C_SlaveReceivedCCCFlag | kI3C_SlaveErrorFlag | - kI3C_SlaveHDRCommandMatchFlag | kI3C_SlaveCCCHandledFlag | kI3C_SlaveEventSentFlag, - - /*! Errors to check for. */ - kSlaveErrorFlags = kI3C_SlaveErrorOverrunFlag | kI3C_SlaveErrorUnderrunFlag | kI3C_SlaveErrorUnderrunNakFlag | - kI3C_SlaveErrorTermFlag | kI3C_SlaveErrorInvalidStartFlag | kI3C_SlaveErrorSdrParityFlag | - kI3C_SlaveErrorHdrParityFlag | kI3C_SlaveErrorHdrCRCFlag | kI3C_SlaveErrorS0S1Flag | - kI3C_SlaveErrorOverreadFlag | kI3C_SlaveErrorOverwriteFlag, -}; -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Array to map I3C instance number to base pointer. */ -static I3C_Type *const kI3cBases[] = I3C_BASE_PTRS; - -/*! @brief Array to store the END byte of I3C teransfer. */ -static uint8_t i3cEndByte[ARRAY_SIZE(kI3cBases)] = {0}; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -static void I3C_MasterRunEDMATransfer( - I3C_Type *base, i3c_master_edma_handle_t *handle, void *data, size_t dataSize, i3c_direction_t direction); - -/******************************************************************************* - * Code - ******************************************************************************/ -static void I3C_MasterTransferEDMACallbackRx(edma_handle_t *dmaHandle, void *param, bool transferDone, uint32_t tcds) -{ - i3c_master_edma_handle_t *i3cHandle = (i3c_master_edma_handle_t *)param; - - if (transferDone) - { - /* Terminate following data if present. */ - i3cHandle->base->MCTRL |= I3C_MCTRL_RDTERM(1U); - -#if defined(FSL_FEATURE_I3C_HAS_ERRATA_052086) && (FSL_FEATURE_I3C_HAS_ERRATA_052086) - if (i3cHandle->transfer.dataSize > 1U) - { - size_t rxCount; - /* Read out the last byte data. */ - do - { - I3C_MasterGetFifoCounts(i3cHandle->base, &rxCount, NULL); - } while (rxCount == 0U); - *(uint8_t *)((uint32_t)(uint32_t *)i3cHandle->transfer.data + i3cHandle->transfer.dataSize - 1U) = - (uint8_t)i3cHandle->base->MRDATAB; - } -#endif - - /* Disable I3C Rx DMA. */ - i3cHandle->base->MDATACTRL &= ~I3C_MDMACTRL_DMAFB_MASK; - } -} - -static void I3C_MasterTransferEDMACallbackTx(edma_handle_t *dmaHandle, void *param, bool transferDone, uint32_t tcds) -{ - i3c_master_edma_handle_t *i3cHandle = (i3c_master_edma_handle_t *)param; - uint32_t instance; - - if (transferDone) - { - /* Disable I3C Tx DMA. */ - i3cHandle->base->MDATACTRL &= ~I3C_MDMACTRL_DMATB_MASK; - - if (i3cHandle->transferCount != 1U) - { - instance = I3C_GetInstance(i3cHandle->base); - /* Ensure there's space in the Tx FIFO. */ - while ((i3cHandle->base->MDATACTRL & I3C_MDATACTRL_TXFULL_MASK) != 0U) - { - } - i3cHandle->base->MWDATABE = i3cEndByte[instance]; - } - } -} -/*! - * brief Prepares the transfer state machine and fills in the command buffer. - * param handle Master nonblocking driver handle. - */ -static status_t I3C_MasterInitTransferStateMachineEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle) -{ - i3c_master_transfer_t *xfer = &handle->transfer; - status_t result = kStatus_Success; - i3c_direction_t direction = xfer->direction; - - /* Calculate command count and put into command buffer. */ - handle->subaddressCount = 0U; - if (xfer->subaddressSize != 0U) - { - for (uint32_t i = xfer->subaddressSize; i > 0U; i--) - { - handle->subaddressBuffer[handle->subaddressCount++] = (uint8_t)((xfer->subaddress) >> (8U * (i - 1U))); - } - } - - /* Start condition shall be ommited, switch directly to next phase */ - if (xfer->dataSize == 0U) - { - handle->state = (uint8_t)kStopState; - } - - if (0UL != (xfer->flags & (uint32_t)kI3C_TransferStartWithBroadcastAddr)) - { - if (0UL != (xfer->flags & (uint32_t)kI3C_TransferNoStartFlag)) - { - return kStatus_InvalidArgument; - } - - if (0UL != (xfer->flags & (uint32_t)kI3C_TransferRepeatedStartFlag)) - { - return kStatus_InvalidArgument; - } - - /* Issue 0x7E as start. */ - result = I3C_MasterStart(base, xfer->busType, 0x7E, kI3C_Write); - if (result != kStatus_Success) - { - return result; - } - - result = I3C_MasterWaitForCtrlDone(base, false); - if (result != kStatus_Success) - { - return result; - } - } - - /* Handle no start option. */ - if (0U != (xfer->flags & (uint32_t)kI3C_TransferNoStartFlag)) - { - /* No need to send start flag, directly go to send command or data */ - if (xfer->subaddressSize > 0UL) - { - handle->state = (uint8_t)kSendCommandState; - } - else - { - if (direction == kI3C_Write) - { - /* Next state, send data. */ - handle->state = (uint8_t)kTransmitDataState; - } - else - { - /* Only support write with no stop signal. */ - return kStatus_InvalidArgument; - } - } - } - else - { - if (xfer->subaddressSize != 0U) - { - handle->state = (uint8_t)kSendCommandState; - } - else - { - if (handle->transfer.direction == kI3C_Write) - { - handle->state = (uint8_t)kTransmitDataState; - } - else if (handle->transfer.direction == kI3C_Read) - { - handle->state = (uint8_t)kReceiveDataState; - } - else - { - return kStatus_InvalidArgument; - } - } - - if (handle->transfer.direction == kI3C_Read) - { - I3C_MasterRunEDMATransfer(base, handle, xfer->data, xfer->dataSize, kI3C_Read); - } - - if (handle->state != (uint8_t)kStopState) - { - /* If repeated start is requested, send repeated start. */ - if (0U != (xfer->flags & (uint32_t)kI3C_TransferRepeatedStartFlag)) - { - result = I3C_MasterRepeatedStart(base, xfer->busType, xfer->slaveAddress, direction); - } - else /* For normal transfer, send start. */ - { - result = I3C_MasterStart(base, xfer->busType, xfer->slaveAddress, direction); - } - } - } - - I3C_MasterTransferEDMAHandleIRQ(base, handle); - return result; -} - -static void I3C_MasterRunEDMATransfer( - I3C_Type *base, i3c_master_edma_handle_t *handle, void *data, size_t dataSize, i3c_direction_t direction) -{ - bool isEnableTxDMA = false; - bool isEnableRxDMA = false; - edma_transfer_config_t xferConfig; - uint32_t instance; - uint32_t address; - uint32_t width; - - handle->transferCount = dataSize; - - switch (direction) - { - case kI3C_Write: - if (dataSize != 1U) - { - address = (uint32_t)&base->MWDATAB1; - /* Cause controller sends command and data with same interface, need special buffer to store the END byte. */ - instance = I3C_GetInstance(base); - i3cEndByte[instance] = *(uint8_t *)((uint32_t)(uint32_t *)data + dataSize - 1U); - dataSize--; - } - else - { - address = (uint32_t)&base->MWDATABE; - } - EDMA_PrepareTransfer(&xferConfig, data, sizeof(uint8_t), (uint32_t *)address, sizeof(uint8_t), 1, dataSize, - kEDMA_MemoryToPeripheral); - (void)EDMA_SubmitTransfer(handle->txDmaHandle, &xferConfig); - EDMA_StartTransfer(handle->txDmaHandle); - isEnableTxDMA = true; - width = 1U; - break; - - case kI3C_Read: -#if defined(FSL_FEATURE_I3C_HAS_ERRATA_052086) && (FSL_FEATURE_I3C_HAS_ERRATA_052086) - /* ERRATA052086: Soc integration issue results in target misses the last DMA request to copy the - last one byte from controler when transmission data size is > 1 byte. Resolution: Triggering DMA - interrupt one byte in advance, then receive the last one byte data after DMA transmission finishes. */ - if (dataSize > 1U) - { - dataSize--; - } -#endif - address = (uint32_t)&base->MRDATAB; - EDMA_PrepareTransfer(&xferConfig, (uint32_t *)address, sizeof(uint8_t), data, sizeof(uint8_t), 1, dataSize, - kEDMA_PeripheralToMemory); - (void)EDMA_SubmitTransfer(handle->rxDmaHandle, &xferConfig); - EDMA_StartTransfer(handle->rxDmaHandle); - isEnableRxDMA = true; - width = 1U; - break; - - default: - /* This should never happen */ - assert(false); - break; - } - - I3C_MasterEnableDMA(base, isEnableTxDMA, isEnableRxDMA, width); -} - -static status_t I3C_MasterRunTransferStateMachineEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle, bool *isDone) -{ - uint32_t status; - uint32_t errStatus; - status_t result = kStatus_Success; - i3c_master_transfer_t *xfer; - size_t rxCount = 0; - bool state_complete = false; - - /* Set default isDone return value. */ - *isDone = false; - - /* Check for errors. */ - status = (uint32_t)I3C_MasterGetPendingInterrupts(base); - I3C_MasterClearStatusFlags(base, status); - - i3c_master_state_t masterState = I3C_MasterGetState(base); - errStatus = I3C_MasterGetErrorStatusFlags(base); - result = I3C_MasterCheckAndClearError(base, errStatus); - if (kStatus_Success != result) - { - return result; - } - - if (0UL != (status & (uint32_t)kI3C_MasterSlave2MasterFlag)) - { - if (handle->callback.slave2Master != NULL) - { - handle->callback.slave2Master(base, handle->userData); - } - } - - if ((0UL != (status & (uint32_t)kI3C_MasterSlaveStartFlag)) && (handle->transfer.busType != kI3C_TypeI2C)) - { - handle->state = (uint8_t)kSlaveStartState; - } - - if ((masterState == kI3C_MasterStateIbiRcv) || (masterState == kI3C_MasterStateIbiAck)) - { - handle->state = (uint8_t)kIBIWonState; - } - - if (handle->state == (uint8_t)kIdleState) - { - return result; - } - - if (handle->state == (uint8_t)kIBIWonState) - { - /* Get fifo counts and compute room in tx fifo. */ - rxCount = (base->MDATACTRL & I3C_MDATACTRL_RXCOUNT_MASK) >> I3C_MDATACTRL_RXCOUNT_SHIFT; - } - - /* Get pointer to private data. */ - xfer = &handle->transfer; - - while (!state_complete) - { - /* Execute the state. */ - switch (handle->state) - { - case (uint8_t)kSlaveStartState: - /* Emit start + 0x7E */ - I3C_MasterEmitRequest(base, kI3C_RequestAutoIbi); - handle->state = (uint8_t)kIBIWonState; - state_complete = true; - break; - - case (uint8_t)kIBIWonState: - if (masterState == kI3C_MasterStateIbiAck) - { - handle->ibiType = I3C_GetIBIType(base); - if (handle->callback.ibiCallback != NULL) - { - handle->callback.ibiCallback(base, handle, handle->ibiType, kI3C_IbiAckNackPending); - } - else - { - I3C_MasterEmitIBIResponse(base, kI3C_IbiRespNack); - } - } - - /* Make sure there is data in the rx fifo. */ - if (0UL != rxCount) - { - if ((handle->ibiBuff == NULL) && (handle->callback.ibiCallback != NULL)) - { - handle->callback.ibiCallback(base, handle, kI3C_IbiNormal, kI3C_IbiDataBuffNeed); - } - uint8_t tempData = (uint8_t)base->MRDATAB; - if (handle->ibiBuff != NULL) - { - handle->ibiBuff[handle->ibiPayloadSize++] = tempData; - } - rxCount--; - break; - } - else if (0UL != (status & (uint32_t)kI3C_MasterCompleteFlag)) - { - handle->ibiType = I3C_GetIBIType(base); - handle->ibiAddress = I3C_GetIBIAddress(base); - state_complete = true; - result = kStatus_I3C_IBIWon; - } - else - { - state_complete = true; - } - break; - - case (uint8_t)kSendCommandState: - I3C_MasterRunEDMATransfer(base, handle, handle->subaddressBuffer, handle->subaddressCount, kI3C_Write); - - if ((xfer->direction == kI3C_Read) || (0UL == xfer->dataSize)) - { - if (0UL == xfer->dataSize) - { - handle->state = (uint8_t)kWaitForCompletionState; - } - else - { - /* xfer->dataSize != 0U, xfer->direction = kI3C_Read */ - handle->state = (uint8_t)kWaitRepeatedStartCompleteState; - } - } - else - { - /* Next state, transfer data. */ - handle->state = (uint8_t)kTransmitDataState; - } - - state_complete = true; - break; - - case (uint8_t)kWaitRepeatedStartCompleteState: - /* We stay in this state until the maste complete. */ - if (0UL != (status & (uint32_t)kI3C_MasterCompleteFlag)) - { - handle->state = (uint8_t)kReceiveDataState; - /* Send repeated start and slave address. */ - result = I3C_MasterRepeatedStart(base, xfer->busType, xfer->slaveAddress, kI3C_Read); - } - - state_complete = true; - break; - - case (uint8_t)kTransmitDataState: - I3C_MasterRunEDMATransfer(base, handle, xfer->data, xfer->dataSize, kI3C_Write); - handle->state = (uint8_t)kWaitForCompletionState; - - state_complete = true; - break; - - case (uint8_t)kReceiveDataState: - /* Do DMA read. */ - handle->state = (uint8_t)kWaitForCompletionState; - - state_complete = true; - break; - - case (uint8_t)kWaitForCompletionState: - /* We stay in this state until the maste complete. */ - if (0UL != (status & (uint32_t)kI3C_MasterCompleteFlag)) - { - handle->state = (uint8_t)kStopState; - } - else - { - state_complete = true; - } - break; - - case (uint8_t)kStopState: - /* Only issue a stop transition if the caller requested it. */ - if (0UL == (xfer->flags & (uint32_t)kI3C_TransferNoStopFlag)) - { - if (xfer->busType == kI3C_TypeI3CDdr) - { - I3C_MasterEmitRequest(base, kI3C_RequestForceExit); - } - else - { - I3C_MasterEmitRequest(base, kI3C_RequestEmitStop); - result = I3C_MasterWaitForCtrlDone(base, false); - } - } - *isDone = true; - state_complete = true; - break; - - default: - assert(false); - break; - } - } - return result; -} - -void I3C_MasterTransferCreateHandleEDMA(I3C_Type *base, - i3c_master_edma_handle_t *handle, - const i3c_master_edma_callback_t *callback, - void *userData, - edma_handle_t *rxDmaHandle, - edma_handle_t *txDmaHandle) -{ - uint32_t instance; - - assert(NULL != handle); - - /* Clear out the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Look up instance number */ - instance = I3C_GetInstance(base); - - handle->base = base; - handle->txDmaHandle = txDmaHandle; - handle->rxDmaHandle = rxDmaHandle; - handle->callback = *callback; - handle->userData = userData; - - /* Save this handle for IRQ use. */ - s_i3cMasterHandle[instance] = handle; - - /* Set irq handler. */ - s_i3cMasterIsr = I3C_MasterTransferEDMAHandleIRQ; - - EDMA_SetCallback(handle->rxDmaHandle, I3C_MasterTransferEDMACallbackRx, handle); - EDMA_SetCallback(handle->txDmaHandle, I3C_MasterTransferEDMACallbackTx, handle); - - /* Clear all flags. */ - I3C_MasterClearErrorStatusFlags(base, (uint32_t)kMasterErrorFlags); - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - /* Reset fifos. These flags clear automatically. */ - base->MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - - /* Enable NVIC IRQ, this only enables the IRQ directly connected to the NVIC. - In some cases the I3C IRQ is configured through INTMUX, user needs to enable - INTMUX IRQ in application code. */ - (void)EnableIRQ(kI3cIrqs[instance]); - - /* Clear internal IRQ enables and enable NVIC IRQ. */ - I3C_MasterEnableInterrupts(base, (uint32_t)kMasterDMAIrqFlags); -} - -/*! - * brief Performs a non-blocking DMA transaction on the I2C/I3C bus. - * - * param base The I3C peripheral base address. - * param handle Pointer to the I3C master driver handle. - * param transfer The pointer to the transfer descriptor. - * retval #kStatus_Success The transaction was started successfully. - * retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - */ -status_t I3C_MasterTransferEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle, i3c_master_transfer_t *transfer) -{ - assert(NULL != handle); - assert(NULL != transfer); - assert(transfer->subaddressSize <= sizeof(transfer->subaddress)); - i3c_master_state_t masterState = I3C_MasterGetState(base); - bool checkDdrState = false; - - /* Return busy if another transaction is in progress. */ - if (handle->state != (uint8_t)kIdleState) - { - return kStatus_I3C_Busy; - } - - /* Return an error if the bus is already in use not by us. */ - checkDdrState = (transfer->busType == kI3C_TypeI3CDdr) ? (masterState != kI3C_MasterStateDdr) : true; - if ((masterState != kI3C_MasterStateIdle) && (masterState != kI3C_MasterStateNormAct) && checkDdrState) - { - return kStatus_I3C_Busy; - } - - /* Disable I3C IRQ sources while we configure stuff. */ - I3C_MasterDisableInterrupts( - base, ((uint32_t)kMasterDMAIrqFlags | (uint32_t)kI3C_MasterRxReadyFlag | (uint32_t)kI3C_MasterTxReadyFlag)); - - /* Save transfer into handle. */ - handle->transfer = *transfer; - - /* Configure IBI response type. */ - base->MCTRL &= ~I3C_MCTRL_IBIRESP_MASK; - base->MCTRL |= I3C_MCTRL_IBIRESP(transfer->ibiResponse); - - /* Clear all flags. */ - I3C_MasterClearErrorStatusFlags(base, (uint32_t)kMasterErrorFlags); - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - /* Reset fifos. These flags clear automatically. */ - base->MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - - /* Generate commands to send. */ - (void)I3C_MasterInitTransferStateMachineEDMA(base, handle); - - /* Enable I3C internal IRQ sources. NVIC IRQ was enabled in CreateHandle() */ - I3C_MasterEnableInterrupts(base, (uint32_t)(kMasterDMAIrqFlags)); - - if (transfer->busType == kI3C_TypeI2C) - { - I3C_MasterDisableInterrupts(base, (uint32_t)kI3C_MasterSlaveStartFlag); - } - - return kStatus_Success; -} - -void I3C_MasterTransferEDMAHandleIRQ(I3C_Type *base, void *i3cHandle) -{ - i3c_master_edma_handle_t *handle = (i3c_master_edma_handle_t *)i3cHandle; - - bool isDone; - status_t result; - - /* Don't do anything if we don't have a valid handle. */ - if (NULL == handle) - { - return; - } - - result = I3C_MasterRunTransferStateMachineEDMA(base, handle, &isDone); - - if (handle->state == (uint8_t)kIdleState) - { - return; - } - - if (isDone || (result != kStatus_Success)) - { - /* XXX need to handle data that may be in rx fifo below watermark level? */ - - /* XXX handle error, terminate xfer */ - if ((result == kStatus_I3C_Nak) || (result == kStatus_I3C_IBIWon)) - { - I3C_MasterEmitRequest(base, kI3C_RequestEmitStop); - (void)I3C_MasterWaitForCtrlDone(base, false); - } - - /* Set handle to idle state. */ - handle->state = (uint8_t)kIdleState; - - /* Invoke IBI user callback. */ - if ((result == kStatus_I3C_IBIWon) && (handle->callback.ibiCallback != NULL)) - { - handle->callback.ibiCallback(base, handle, handle->ibiType, kI3C_IbiReady); - handle->ibiPayloadSize = 0; - } - - /* Invoke callback. */ - if (NULL != handle->callback.transferComplete) - { - handle->callback.transferComplete(base, handle, result, handle->userData); - } - } -} - -/*! - * brief Get master transfer status during a dma non-blocking transfer - * - * param base I3C peripheral base address - * param handle pointer to i2c_master_edma_handle_t structure - * param count Number of bytes transferred so far by the non-blocking transaction. - */ -status_t I3C_MasterTransferGetCountEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (handle->state == (uint8_t)kIdleState) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - /* There is no necessity to disable interrupts as we read a single integer value */ - i3c_direction_t dir = handle->transfer.direction; - - if (dir == kI3C_Read) - { - *count = handle->transferCount - - 1U * EDMA_GetRemainingMajorLoopCount(handle->rxDmaHandle->base, handle->rxDmaHandle->channel); - } - else - { - *count = handle->transferCount - - 1U * EDMA_GetRemainingMajorLoopCount(handle->txDmaHandle->base, handle->txDmaHandle->channel); - } - - return kStatus_Success; -} - -/*! - * brief Abort a master edma non-blocking transfer in a early time - * - * param base I3C peripheral base address - * param handle pointer to i2c_master_edma_handle_t structure - */ -void I3C_MasterTransferAbortEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle) -{ - if (handle->state != (uint8_t)kIdleState) - { - EDMA_AbortTransfer(handle->txDmaHandle); - EDMA_AbortTransfer(handle->rxDmaHandle); - - I3C_MasterEnableDMA(base, false, false, 0); - - /* Reset fifos. These flags clear automatically. */ - base->MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - - /* Send a stop command to finalize the transfer. */ - (void)I3C_MasterStop(base); - - /* Reset handle. */ - handle->state = (uint8_t)kIdleState; - } -} - -static void I3C_SlaveTransferEDMACallback(edma_handle_t *dmaHandle, void *param, bool transferDone, uint32_t tcds) -{ - i3c_slave_edma_handle_t *i3cHandle = (i3c_slave_edma_handle_t *)param; - - if (transferDone) - { - /* Simply disable dma enablement */ - if (i3cHandle->txDmaHandle == dmaHandle) - { - i3cHandle->base->SDMACTRL &= ~I3C_SDMACTRL_DMATB_MASK; - - if (i3cHandle->transfer.txDataSize > 1U) - { - /* Ensure there's space in the Tx FIFO. */ - while ((i3cHandle->base->SDATACTRL & I3C_SDATACTRL_TXFULL_MASK) != 0U) - { - } - /* Send the last byte. */ - i3cHandle->base->SWDATABE = *(uint8_t *)((uintptr_t)i3cHandle->transfer.txData + i3cHandle->transfer.txDataSize - 1U); - } - } - else - { -#if defined(FSL_FEATURE_I3C_HAS_ERRATA_052086) && (FSL_FEATURE_I3C_HAS_ERRATA_052086) - if (i3cHandle->transfer.rxDataSize > 1U) - { - size_t rxCount; - /* Read out the last byte data. */ - do - { - I3C_SlaveGetFifoCounts(i3cHandle->base, &rxCount, NULL); - } while (rxCount == 0U); - *(uint8_t *)((uintptr_t)i3cHandle->transfer.rxData + i3cHandle->transfer.rxDataSize - 1U) = - (uint8_t)i3cHandle->base->SRDATAB; - } -#endif - i3cHandle->base->SDMACTRL &= ~I3C_SDMACTRL_DMAFB_MASK; - } - } -} - -/*! - * brief Create a new handle for the I3C slave DMA APIs. - * - * The creation of a handle is for use with the DMA APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the I3C_SlaveTransferAbortDMA() API shall be called. - * - * For devices where the I3C send and receive DMA requests are OR'd together, the @a txDmaHandle - * parameter is ignored and may be set to NULL. - * - * param base The I3C peripheral base address. - * param handle Pointer to the I3C slave driver handle. - * param callback User provided pointer to the asynchronous callback function. - * param userData User provided pointer to the application callback data. - * param rxDmaHandle Handle for the DMA receive channel. Created by the user prior to calling this function. - * param txDmaHandle Handle for the DMA transmit channel. Created by the user prior to calling this function. - */ -void I3C_SlaveTransferCreateHandleEDMA(I3C_Type *base, - i3c_slave_edma_handle_t *handle, - i3c_slave_edma_callback_t callback, - void *userData, - edma_handle_t *rxDmaHandle, - edma_handle_t *txDmaHandle) -{ - uint32_t instance; - - assert(NULL != handle); - - /* Clear out the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Look up instance number */ - instance = I3C_GetInstance(base); - - handle->base = base; - handle->txDmaHandle = txDmaHandle; - handle->rxDmaHandle = rxDmaHandle; - handle->callback = callback; - handle->userData = userData; - - /* Save this handle for IRQ use. */ - s_i3cSlaveHandle[instance] = handle; - - /* Set irq handler. */ - s_i3cSlaveIsr = I3C_SlaveTransferEDMAHandleIRQ; - - EDMA_SetCallback(handle->rxDmaHandle, I3C_SlaveTransferEDMACallback, handle); - EDMA_SetCallback(handle->txDmaHandle, I3C_SlaveTransferEDMACallback, handle); - - /* Clear internal IRQ enables and enable NVIC IRQ. */ - I3C_SlaveDisableInterrupts(base, (uint32_t)kSlaveDMAIrqFlags); - - /* Enable NVIC IRQ, this only enables the IRQ directly connected to the NVIC. - In some cases the I3C IRQ is configured through INTMUX, user needs to enable - INTMUX IRQ in application code. */ - (void)EnableIRQ(kI3cIrqs[instance]); - - /* Enable IRQ. */ - I3C_SlaveEnableInterrupts(base, (uint32_t)kSlaveDMAIrqFlags); -} - -static void I3C_SlavePrepareTxEDMA(I3C_Type *base, i3c_slave_edma_handle_t *handle) -{ - edma_transfer_config_t txConfig; - uint32_t *txFifoBase; - i3c_slave_edma_transfer_t *xfer = &handle->transfer; - - if (xfer->txDataSize == 1U) - { - txFifoBase = (uint32_t *)(uintptr_t)&base->SWDATABE; - EDMA_PrepareTransfer(&txConfig, xfer->txData, 1, (void *)txFifoBase, 1, 1, xfer->txDataSize, - kEDMA_MemoryToPeripheral); - } - else - { - txFifoBase = (uint32_t *)(uintptr_t)&base->SWDATAB1; - EDMA_PrepareTransfer(&txConfig, xfer->txData, 1, (void *)txFifoBase, 1, 1, xfer->txDataSize - 1U, - kEDMA_MemoryToPeripheral); - } - - (void)EDMA_SubmitTransfer(handle->txDmaHandle, &txConfig); - EDMA_StartTransfer(handle->txDmaHandle); -} - -static void I3C_SlavePrepareRxEDMA(I3C_Type *base, i3c_slave_edma_handle_t *handle) -{ - uint32_t *rxFifoBase = (uint32_t *)(uintptr_t)&base->SRDATAB; - i3c_slave_edma_transfer_t *xfer = &handle->transfer; - size_t dataSize = xfer->rxDataSize; - edma_transfer_config_t rxConfig; - -#if defined(FSL_FEATURE_I3C_HAS_ERRATA_052086) && (FSL_FEATURE_I3C_HAS_ERRATA_052086) - /* ERRATA052086: Soc integration issue results in target misses the last DMA request to copy the - last one byte from controler when transmission data size is > 1 byte. Resolution: Triggering DMA - interrupt one byte in advance, then receive the last one byte data after DMA transmission finishes. */ - if (dataSize > 1U) - { - dataSize--; - } -#endif - - EDMA_PrepareTransfer(&rxConfig, (void *)rxFifoBase, 1, xfer->rxData, 1, 1, dataSize, - kEDMA_PeripheralToMemory); - (void)EDMA_SubmitTransfer(handle->rxDmaHandle, &rxConfig); - EDMA_StartTransfer(handle->rxDmaHandle); -} - -/*! - * brief Prepares for a non-blocking DMA-based transaction on the I3C bus. - * - * The API will do DMA configuration according to the input transfer descriptor, and the data will be transferred when - * there's bus master requesting transfer from/to this slave. So the timing of call to this API need be aligned - * with master application to ensure the transfer is executed as expected. - * Callback specified when the @a handle was created is invoked when the transaction has completed. - * - * param base The I3C peripheral base address. - * param handle Pointer to the I3C slave driver handle. - * param transfer The pointer to the transfer descriptor. - * param eventMask Bit mask formed by OR'ing together #i3c_slave_transfer_event_t enumerators to specify - * which events to send to the callback. The transmit and receive events is not allowed to be enabled. - * retval kStatus_Success The transaction was started successfully. - * retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or another DMA - * transaction is already in progress. - * retval #kStatus_Fail The transaction can't be set. - */ -status_t I3C_SlaveTransferEDMA(I3C_Type *base, - i3c_slave_edma_handle_t *handle, - i3c_slave_edma_transfer_t *transfer, - uint32_t eventMask) -{ - assert(NULL != handle); - assert(NULL != transfer); - - bool txDmaEn = false, rxDmaEn = false; - uint32_t width; - - if (handle->isBusy) - { - return kStatus_I3C_Busy; - } - /* Clear all flags. */ - I3C_SlaveClearErrorStatusFlags(base, (uint32_t)kSlaveErrorFlags); - I3C_SlaveClearStatusFlags(base, (uint32_t)kSlaveClearFlags); - /* Reset fifos. These flags clear automatically. */ - base->SDATACTRL |= I3C_SDATACTRL_FLUSHTB_MASK | I3C_SDATACTRL_FLUSHFB_MASK; - - handle->transfer = *transfer; - - /* Set up event mask. */ - handle->eventMask = eventMask; - - if ((transfer->txData != NULL) && (transfer->txDataSize != 0U)) - { - I3C_SlavePrepareTxEDMA(base, handle); - txDmaEn = true; - width = 1U; - } - - if ((transfer->rxData != NULL) && (transfer->rxDataSize != 0U)) - { - I3C_SlavePrepareRxEDMA(base, handle); - rxDmaEn = true; - width = 1U; - } - - if (txDmaEn || rxDmaEn) - { - I3C_SlaveEnableDMA(base, txDmaEn, rxDmaEn, width); - return kStatus_Success; - } - else - { - return kStatus_Fail; - } -} - -void I3C_SlaveTransferEDMAHandleIRQ(I3C_Type *base, void *i3cHandle) -{ - uint32_t flags; - uint32_t errFlags; - i3c_slave_edma_transfer_t *xfer; - - i3c_slave_edma_handle_t *handle = (i3c_slave_edma_handle_t *)i3cHandle; - /* Check for a valid handle in case of a spurious interrupt. */ - if (NULL == handle) - { - return; - } - - xfer = &handle->transfer; - - /* Get status flags. */ - flags = I3C_SlaveGetStatusFlags(base); - errFlags = I3C_SlaveGetErrorStatusFlags(base); - - /* Clear status flags. */ - I3C_SlaveClearStatusFlags(base, flags); - - if (0UL != (errFlags & (uint32_t)kSlaveErrorFlags)) - { - xfer->event = (uint32_t)kI3C_SlaveCompletionEvent; - xfer->completionStatus = I3C_SlaveCheckAndClearError(base, errFlags); - - if ((0UL != (handle->eventMask & (uint32_t)kI3C_SlaveCompletionEvent)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - return; - } - - if (0UL != (flags & (uint32_t)kI3C_SlaveEventSentFlag)) - { - xfer->event = (uint32_t)kI3C_SlaveRequestSentEvent; - if ((0UL != (handle->eventMask & xfer->event)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - } - - if (0UL != (flags & (uint32_t)kI3C_SlaveReceivedCCCFlag)) - { - handle->isBusy = true; - xfer->event = (uint32_t)kI3C_SlaveReceivedCCCEvent; - if ((0UL != (handle->eventMask & xfer->event)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - } - - if (0UL != (flags & (uint32_t)kI3C_SlaveBusStopFlag)) - { - if (handle->isBusy == true) - { - xfer->event = (uint32_t)kI3C_SlaveCompletionEvent; - xfer->completionStatus = kStatus_Success; - handle->isBusy = false; - - if ((0UL != (handle->eventMask & xfer->event)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - I3C_SlaveTransferAbortEDMA(base, handle); - } - else - { - return; - } - } - - if (0UL != (flags & (uint32_t)kI3C_SlaveMatchedFlag)) - { - xfer->event = (uint32_t)kI3C_SlaveAddressMatchEvent; - handle->isBusy = true; - if ((0UL != (handle->eventMask & (uint32_t)kI3C_SlaveAddressMatchEvent)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - } -} - -/*! - * brief Abort a slave dma non-blocking transfer in a early time - * - * param base I3C peripheral base address - * param handle pointer to i3c_slave_edma_handle_t structure - */ -void I3C_SlaveTransferAbortEDMA(I3C_Type *base, i3c_slave_edma_handle_t *handle) -{ - if (handle->isBusy != false) - { - EDMA_AbortTransfer(handle->txDmaHandle); - EDMA_AbortTransfer(handle->rxDmaHandle); - - I3C_SlaveEnableDMA(base, false, false, 0); - - /* Reset fifos. These flags clear automatically. */ - base->SDATACTRL |= I3C_SDATACTRL_FLUSHTB_MASK | I3C_SDATACTRL_FLUSHFB_MASK; - } -} \ No newline at end of file diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_i3c_edma.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_i3c_edma.h deleted file mode 100644 index 8396e350d35..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_i3c_edma.h +++ /dev/null @@ -1,279 +0,0 @@ -/* - * Copyright 2022-2023 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_I3C_EDMA_H_ -#define FSL_I3C_EDMA_H_ - -#include "fsl_i3c.h" -#include "fsl_edma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief I3C EDMA driver version. */ -#define FSL_I3C_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 2, 9)) -/*! @} */ - -/*! - * @addtogroup i3c_master_edma_driver - * @{ - */ - -/* Forward declaration of the transfer descriptor and handle typedefs. */ -typedef struct _i3c_master_edma_handle i3c_master_edma_handle_t; - -/*! @brief i3c master callback functions. */ -typedef struct _i3c_master_edma_callback -{ - void (*slave2Master)(I3C_Type *base, void *userData); /*!< Transfer complete callback */ - void (*ibiCallback)(I3C_Type *base, - i3c_master_edma_handle_t *handle, - i3c_ibi_type_t ibiType, - i3c_ibi_state_t ibiState); /*!< IBI event callback */ - void (*transferComplete)(I3C_Type *base, - i3c_master_edma_handle_t *handle, - status_t status, - void *userData); /*!< Transfer complete callback */ -} i3c_master_edma_callback_t; -/*! - * @brief Driver handle for master EDMA APIs. - * @note The contents of this structure are private and subject to change. - */ -struct _i3c_master_edma_handle -{ - I3C_Type *base; /*!< I3C base pointer. */ - uint8_t state; /*!< Transfer state machine current state. */ - uint32_t transferCount; /*!< Indicates progress of the transfer */ - uint8_t subaddressBuffer[4]; /*!< Saving subaddress command. */ - uint8_t subaddressCount; /*!< Saving command count. */ - i3c_master_transfer_t transfer; /*!< Copy of the current transfer info. */ - i3c_master_edma_callback_t callback; /*!< Callback function pointer. */ - void *userData; /*!< Application data passed to callback. */ - edma_handle_t *rxDmaHandle; /*!< Handle for receive DMA channel. */ - edma_handle_t *txDmaHandle; /*!< Handle for transmit DMA channel. */ - uint8_t ibiAddress; /*!< Slave address which request IBI. */ - uint8_t *ibiBuff; /*!< Pointer to IBI buffer to keep ibi bytes. */ - size_t ibiPayloadSize; /*!< IBI payload size. */ - i3c_ibi_type_t ibiType; /*!< IBI type. */ -}; - -/*! @} */ - -/*! - * @addtogroup i3c_slave_edma_driver - * @{ - */ -/* Forward declaration of the transfer descriptor and handle typedefs. */ -typedef struct _i3c_slave_edma_handle i3c_slave_edma_handle_t; - -/*! @brief I3C slave transfer structure */ -typedef struct _i3c_slave_edma_transfer -{ - uint32_t event; /*!< Reason the callback is being invoked. */ - uint8_t *txData; /*!< Transfer buffer */ - size_t txDataSize; /*!< Transfer size */ - uint8_t *rxData; /*!< Transfer buffer */ - size_t rxDataSize; /*!< Transfer size */ - status_t completionStatus; /*!< Success or error code describing how the transfer completed. Only applies for - #kI3C_SlaveCompletionEvent. */ -} i3c_slave_edma_transfer_t; - -/*! - * @brief Slave event callback function pointer type. - * - * This callback is used only for the slave DMA transfer API. - * - * @param base Base address for the I3C instance on which the event occurred. - * @param handle Pointer to slave DMA transfer handle. - * @param transfer Pointer to transfer descriptor containing values passed to and/or from the callback. - * @param userData Arbitrary pointer-sized value passed from the application. - */ -typedef void (*i3c_slave_edma_callback_t)(I3C_Type *base, i3c_slave_edma_transfer_t *transfer, void *userData); -/*! - * @brief I3C slave edma handle structure. - * @note The contents of this structure are private and subject to change. - */ -struct _i3c_slave_edma_handle -{ - I3C_Type *base; /*!< I3C base pointer. */ - i3c_slave_edma_transfer_t transfer; /*!< I3C slave transfer copy. */ - bool isBusy; /*!< Whether transfer is busy. */ - bool wasTransmit; /*!< Whether the last transfer was a transmit. */ - uint32_t eventMask; /*!< Mask of enabled events. */ - i3c_slave_edma_callback_t callback; /*!< Callback function called at transfer event. */ - edma_handle_t *rxDmaHandle; /*!< Handle for receive DMA channel. */ - edma_handle_t *txDmaHandle; /*!< Handle for transmit DMA channel. */ - void *userData; /*!< Callback parameter passed to callback. */ -}; -/*! @} */ -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @addtogroup i3c_master_edma_driver - * @{ - */ - -/*! @name Master DMA */ -/*! @{ */ - -/*! - * @brief Create a new handle for the I3C master DMA APIs. - * - * The creation of a handle is for use with the DMA APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the I3C_MasterTransferAbortDMA() API shall be called. - * - * For devices where the I3C send and receive DMA requests are OR'd together, the @a txDmaHandle - * parameter is ignored and may be set to NULL. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C master driver handle. - * @param callback User provided pointer to the asynchronous callback function. - * @param userData User provided pointer to the application callback data. - * @param rxDmaHandle Handle for the DMA receive channel. Created by the user prior to calling this function. - * @param txDmaHandle Handle for the DMA transmit channel. Created by the user prior to calling this function. - */ -void I3C_MasterTransferCreateHandleEDMA(I3C_Type *base, - i3c_master_edma_handle_t *handle, - const i3c_master_edma_callback_t *callback, - void *userData, - edma_handle_t *rxDmaHandle, - edma_handle_t *txDmaHandle); - -/*! - * @brief Performs a non-blocking DMA-based transaction on the I3C bus. - * - * The callback specified when the @a handle was created is invoked when the transaction has - * completed. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C master driver handle. - * @param transfer The pointer to the transfer descriptor. - * @retval kStatus_Success The transaction was started successfully. - * @retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or another DMA - * transaction is already in progress. - */ -status_t I3C_MasterTransferEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle, i3c_master_transfer_t *transfer); - -/*! - * @brief Returns number of bytes transferred so far. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C master driver handle. - * @param[out] count Number of bytes transferred so far by the non-blocking transaction. - * @retval kStatus_Success - * @retval kStatus_NoTransferInProgress There is not a DMA transaction currently in progress. - */ -status_t I3C_MasterTransferGetCountEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle, size_t *count); - -/*! - * @brief Terminates a non-blocking I3C master transmission early. - * - * @note It is not safe to call this function from an IRQ handler that has a higher priority than the - * DMA peripheral's IRQ priority. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C master driver handle. - */ -void I3C_MasterTransferAbortEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle); - -/*! - * @brief Reusable routine to handle master interrupts. - * @note This function does not need to be called unless you are reimplementing the - * nonblocking API's interrupt handler routines to add special functionality. - * @param base The I3C peripheral base address. - * @param i3cHandle Pointer to the I3C master DMA driver handle. - */ -void I3C_MasterTransferEDMAHandleIRQ(I3C_Type *base, void *i3cHandle); -/*! @} */ - -/*! @} */ - -/*! - * @addtogroup i3c_slave_edma_driver - * @{ - */ - -/*! @name Slave DMA */ -/*! @{ */ -/*! - * @brief Create a new handle for the I3C slave DMA APIs. - * - * The creation of a handle is for use with the DMA APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the I3C_SlaveTransferAbortDMA() API shall be called. - * - * For devices where the I3C send and receive DMA requests are OR'd together, the @a txDmaHandle - * parameter is ignored and may be set to NULL. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C slave driver handle. - * @param callback User provided pointer to the asynchronous callback function. - * @param userData User provided pointer to the application callback data. - * @param rxDmaHandle Handle for the DMA receive channel. Created by the user prior to calling this function. - * @param txDmaHandle Handle for the DMA transmit channel. Created by the user prior to calling this function. - */ -void I3C_SlaveTransferCreateHandleEDMA(I3C_Type *base, - i3c_slave_edma_handle_t *handle, - i3c_slave_edma_callback_t callback, - void *userData, - edma_handle_t *rxDmaHandle, - edma_handle_t *txDmaHandle); - -/*! - * @brief Prepares for a non-blocking DMA-based transaction on the I3C bus. - * - * The API will do DMA configuration according to the input transfer descriptor, and the data will be transferred when - * there's bus master requesting transfer from/to this slave. So the timing of call to this API need be aligned - * with master application to ensure the transfer is executed as expected. - * Callback specified when the @a handle was created is invoked when the transaction has completed. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C slave driver handle. - * @param transfer The pointer to the transfer descriptor. - * @param eventMask Bit mask formed by OR'ing together #i3c_slave_transfer_event_t enumerators to specify - * which events to send to the callback. The transmit and receive events is not allowed to be enabled. - * @retval kStatus_Success The transaction was started successfully. - * @retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or another DMA - * transaction is already in progress. - * @retval #kStatus_Fail The transaction can't be set. - */ -status_t I3C_SlaveTransferEDMA(I3C_Type *base, - i3c_slave_edma_handle_t *handle, - i3c_slave_edma_transfer_t *transfer, - uint32_t eventMask); -/*! - * @brief Abort a slave edma non-blocking transfer in a early time - * - * @param base I3C peripheral base address - * @param handle pointer to i3c_slave_edma_handle_t structure - */ -void I3C_SlaveTransferAbortEDMA(I3C_Type *base, i3c_slave_edma_handle_t *handle); - -/*! - * @brief Reusable routine to handle slave interrupts. - * @note This function does not need to be called unless you are reimplementing the - * nonblocking API's interrupt handler routines to add special functionality. - * @param base The I3C peripheral base address. - * @param i3cHandle Pointer to the I3C slave DMA driver handle. - */ -void I3C_SlaveTransferEDMAHandleIRQ(I3C_Type *base, void *i3cHandle); -/*! @} */ - -/*! @} */ -#if defined(__cplusplus) -} -#endif - -#endif /* FSL_I3C_EDMA_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_inputmux.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_inputmux.c deleted file mode 100644 index 1f2ce0bcd26..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_inputmux.c +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_inputmux.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.inputmux" -#endif - -#if defined(INPUTMUX_RSTS) -#define INPUTMUX_RESETS_ARRAY INPUTMUX_RSTS -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#if defined(INPUTMUX_RESETS_ARRAY) -/*! - * @brief Get instance number for INPUTMUX module. - * - * @param base INPUTMUX peripheral base address - */ -static uint32_t INPUTMUX_GetInstance(INPUTMUX_Type *base); -#endif -/******************************************************************************* - * Variables - ******************************************************************************/ -#if defined(INPUTMUX_RESETS_ARRAY) -/*! @brief Pointers to INPUTMUX bases for each instance. */ -static INPUTMUX_Type *const s_inputmuxBases[] = INPUTMUX_BASE_PTRS; - -/* Reset array */ -static const reset_ip_name_t s_inputmuxResets[] = INPUTMUX_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -#if defined(INPUTMUX_RESETS_ARRAY) -static uint32_t INPUTMUX_GetInstance(INPUTMUX_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_inputmuxBases); instance++) - { - if (s_inputmuxBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_inputmuxBases)); - - return instance; -} -#endif - -/*! - * brief Initialize INPUTMUX peripheral. - - * This function enables the INPUTMUX clock. - * - * param base Base address of the INPUTMUX peripheral. - * - * retval None. - */ -void INPUTMUX_Init(INPUTMUX_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#if defined(FSL_FEATURE_INPUTMUX_HAS_NO_INPUTMUX_CLOCK_SOURCE) && FSL_FEATURE_INPUTMUX_HAS_NO_INPUTMUX_CLOCK_SOURCE -#if (defined(FSL_FEATURE_SOC_SCT_COUNT) && (FSL_FEATURE_SOC_SCT_COUNT > 0)) - CLOCK_EnableClock(kCLOCK_Sct); -#endif /* FSL_FEATURE_SOC_SCT_COUNT */ - CLOCK_EnableClock(kCLOCK_Dma); -#else - CLOCK_EnableClock(kCLOCK_InputMux); -#endif /* FSL_FEATURE_INPUTMUX_HAS_NO_INPUTMUX_CLOCK_SOURCE */ -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(INPUTMUX_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_inputmuxResets[INPUTMUX_GetInstance(base)]); -#endif -} - -/*! - * brief Attaches a signal - * - * This function attaches multiplexed signals from INPUTMUX to target signals. - * For example, to attach GPIO PORT0 Pin 5 to PINT peripheral, do the following: - * code - * INPUTMUX_AttachSignal(INPUTMUX, 2, kINPUTMUX_GpioPort0Pin5ToPintsel); - * endcode - * In this example, INTMUX has 8 registers for PINT, PINT_SEL0~PINT_SEL7. - * With parameter p index specified as 2, this function configures register PINT_SEL2. - * - * param base Base address of the INPUTMUX peripheral. - * param index The serial number of destination register in the group of INPUTMUX registers with same name. - * param connection Applies signal from source signals collection to target signal. - * - * retval None. - */ -void INPUTMUX_AttachSignal(INPUTMUX_Type *base, uint32_t index, inputmux_connection_t connection) -{ - uint32_t pmux_id; - uint32_t output_id; - - /* extract pmux to be used */ - pmux_id = ((uint32_t)(connection)) >> PMUX_SHIFT; - /* extract function number */ - output_id = ((uint32_t)(connection)) & ((1UL << PMUX_SHIFT) - 1U); - /* programm signal */ - *(volatile uint32_t *)(((uint32_t)base) + pmux_id + (index * 4U)) = output_id; -} - -#if defined(FSL_FEATURE_INPUTMUX_HAS_SIGNAL_ENA) -/*! - * brief Enable/disable a signal - * - * This function gates the INPUTPMUX clock. - * - * param base Base address of the INPUTMUX peripheral. - * param signal Enable signal register id and bit offset. - * param enable Selects enable or disable. - * - * retval None. - */ -void INPUTMUX_EnableSignal(INPUTMUX_Type *base, inputmux_signal_t signal, bool enable) -{ - uint32_t ena_id; - uint32_t ena_id_mask = (1UL << (32U - ENA_SHIFT)) - 1U; - uint32_t bit_offset; - -#if defined(FSL_FEATURE_INPUTMUX_HAS_CHANNEL_MUX) && FSL_FEATURE_INPUTMUX_HAS_CHANNEL_MUX - uint32_t chmux_offset; - uint32_t chmux_value; - - /* Only enable need to update channel mux */ - if (enable && ((((uint32_t)signal) & (1UL << CHMUX_AVL_SHIFT)) != 0U)) - { - chmux_offset = (((uint32_t)signal) >> CHMUX_OFF_SHIFT) & ((1UL << (CHMUX_AVL_SHIFT - CHMUX_OFF_SHIFT)) - 1UL); - chmux_value = (((uint32_t)signal) >> CHMUX_VAL_SHIFT) & ((1UL << (CHMUX_OFF_SHIFT - CHMUX_VAL_SHIFT)) - 1UL); - *(volatile uint32_t *)(((uint32_t)base) + chmux_offset) = chmux_value; - } - ena_id_mask = (1UL << (CHMUX_VAL_SHIFT - ENA_SHIFT)) - 1U; -#endif - /* extract enable register to be used */ - ena_id = (((uint32_t)signal) >> ENA_SHIFT) & ena_id_mask; - /* extract enable bit offset */ - bit_offset = ((uint32_t)signal) & ((1UL << ENA_SHIFT) - 1U); - /* set signal */ - if (enable) - { - *(volatile uint32_t *)(((uint32_t)base) + ena_id) |= (1UL << bit_offset); - } - else - { - *(volatile uint32_t *)(((uint32_t)base) + ena_id) &= ~(1UL << bit_offset); - } -} -#endif - -/*! - * brief Deinitialize INPUTMUX peripheral. - - * This function disables the INPUTMUX clock. - * - * param base Base address of the INPUTMUX peripheral. - * - * retval None. - */ -void INPUTMUX_Deinit(INPUTMUX_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#if defined(FSL_FEATURE_INPUTMUX_HAS_NO_INPUTMUX_CLOCK_SOURCE) && FSL_FEATURE_INPUTMUX_HAS_NO_INPUTMUX_CLOCK_SOURCE -#if (defined(FSL_FEATURE_SOC_SCT_COUNT) && (FSL_FEATURE_SOC_SCT_COUNT > 0)) - CLOCK_DisableClock(kCLOCK_Sct); -#endif /* FSL_FEATURE_SOC_SCT_COUNT */ - CLOCK_DisableClock(kCLOCK_Dma); -#else - CLOCK_DisableClock(kCLOCK_InputMux); -#endif /* FSL_FEATURE_INPUTMUX_HAS_NO_INPUTMUX_CLOCK_SOURCE */ -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_inputmux.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_inputmux.h deleted file mode 100644 index a8d5db82ec7..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_inputmux.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_INPUTMUX_H_ -#define FSL_INPUTMUX_H_ - -#include "fsl_inputmux_connections.h" -#include "fsl_common.h" - -/*! - * @addtogroup inputmux_driver - * @{ - */ - -/*! @file */ -/*! @file fsl_inputmux_connections.h */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief Group interrupt driver version for SDK */ -#define FSL_INPUTMUX_DRIVER_VERSION (MAKE_VERSION(2, 0, 7)) -/*! @} */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#ifdef __cplusplus -extern "C" { -#endif - -/*! - * @brief Initialize INPUTMUX peripheral. - - * This function enables the INPUTMUX clock. - * - * @param base Base address of the INPUTMUX peripheral. - * - * @retval None. - */ -void INPUTMUX_Init(INPUTMUX_Type *base); - -/*! - * @brief Attaches a signal - * - * This function attaches multiplexed signals from INPUTMUX to target signals. - * For example, to attach GPIO PORT0 Pin 5 to PINT peripheral, do the following: - * @code - * INPUTMUX_AttachSignal(INPUTMUX, 2, kINPUTMUX_GpioPort0Pin5ToPintsel); - * @endcode - * In this example, INTMUX has 8 registers for PINT, PINT_SEL0~PINT_SEL7. - * With parameter @p index specified as 2, this function configures register PINT_SEL2. - * - * @param base Base address of the INPUTMUX peripheral. - * @param index The serial number of destination register in the group of INPUTMUX registers with same name. - * @param connection Applies signal from source signals collection to target signal. - * - * @retval None. - */ -void INPUTMUX_AttachSignal(INPUTMUX_Type *base, uint32_t index, inputmux_connection_t connection); - -#if defined(FSL_FEATURE_INPUTMUX_HAS_SIGNAL_ENA) -/*! - * @brief Enable/disable a signal - * - * This function gates the INPUTPMUX clock. - * - * @param base Base address of the INPUTMUX peripheral. - * @param signal Enable signal register id and bit offset. - * @param enable Selects enable or disable. - * - * @retval None. - */ -void INPUTMUX_EnableSignal(INPUTMUX_Type *base, inputmux_signal_t signal, bool enable); -#endif - -/*! - * @brief Deinitialize INPUTMUX peripheral. - - * This function disables the INPUTMUX clock. - * - * @param base Base address of the INPUTMUX peripheral. - * - * @retval None. - */ -void INPUTMUX_Deinit(INPUTMUX_Type *base); - -#ifdef __cplusplus -} -#endif - -/*! @} */ - -#endif /* FSL_INPUTMUX_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_inputmux_connections.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_inputmux_connections.h deleted file mode 100644 index 8086197ffff..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_inputmux_connections.h +++ /dev/null @@ -1,3635 +0,0 @@ -/* - * Copyright 2023 , NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _FSL_INPUTMUX_CONNECTIONS_ -#define _FSL_INPUTMUX_CONNECTIONS_ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.inputmux_connections" -#endif - -#define INPUTMUX_GpioPortPinToPintsel(port, pin) ((pin) + (PINTSEL_PMUX_ID << PMUX_SHIFT)) - -/*! - * @addtogroup inputmux_driver - * @{ - */ - -/*! - * @name Input multiplexing connections - * @{ - */ - -/*! @brief Periphinmux IDs */ -#define TIMER0CAPTSEL0 0x20U -#define TIMER0TRIGIN 0x30U -#define TIMER1CAPTSEL0 0x40U -#define TIMER1TRIGIN 0x50U -#define TIMER2CAPTSEL0 0x60U -#define TIMER2TRIGIN 0x70U -#define FREQMEAS_REF_REG 0x180U -#define FREQMEAS_TAR_REG 0x184U -#define TIMER3CAPTSEL0 0x1A0U -#define TIMER3TRIGIN 0x1B0U -#define TIMER4CAPTSEL0 0x1C0U -#define TIMER4TRIGIN 0x1D0U -#define AOI1_MUX_REG 0x200U -#define CMP0_TRIG_REG 0x260U -#define ADC0_TRIG0_REG 0x280U -#define ADC1_TRIG0_REG 0x2C0U -#define DAC0_TRIG0_REG 0x300U -#define QDC0_TRIG_REG 0x360U -#define QDC0_HOME_REG 0x364U -#define QDC0_INDEX_REG 0x368U -#define QDC0_PHASEB_REG 0x36CU -#define QDC0_PHASEA_REG 0x370U -#define QDC0_ICAP1_REG 0x374U -#define QDC1_TRIG_REG 0x380U -#define QDC1_HOME_REG 0x384U -#define QDC1_INDEX_REG 0x388U -#define QDC1_PHASEB_REG 0x38CU -#define QDC1_PHASEA_REG 0x390U -#define QDC1_ICAP1_REG 0x394U -#define FlexPWM0_SM0_EXTA0_REG 0x3A0U -#define FlexPWM0_SM0_EXTSYNC0_REG 0x3A4U -#define FlexPWM0_SM1_EXTA1_REG 0x3A8U -#define FlexPWM0_SM1_EXTSYNC1_REG 0x3ACU -#define FlexPWM0_SM2_EXTA2_REG 0x3B0U -#define FlexPWM0_SM2_EXTSYNC2_REG 0x3B4U -#define FlexPWM0_FAULT_REG 0x3C0U -#define FlexPWM0_FORCE_REG 0x3D0U -#define FlexPWM1_SM0_EXTA0_REG 0x3E0U -#define FlexPWM1_SM0_EXTSYNC0_REG 0x3E4U -#define FlexPWM1_SM1_EXTA1_REG 0x3E8U -#define FlexPWM1_SM1_EXTSYNC1_REG 0x3ECU -#define FlexPWM1_SM2_EXTA2_REG 0x3F0U -#define FlexPWM1_SM2_EXTSYNC2_REG 0x3F4U -#define FlexPWM1_FAULT_REG 0x400U -#define FlexPWM1_FORCE_REG 0x410U -#define PWM0_EXT_CLK_REG 0x420U -#define PWM1_EXT_CLK_REG 0x424U -#define AOI0_MUX_REG 0x440U -#define USBFS_TRIG_REG 0x480U -#define EXT_TRIG0_REG 0x4C0U -#define CMP1_TRIG_REG 0x4E0U -#define LPI2C2_TRIG_REG 0x540U -#define OPAMP0_TRIG_REG 0x580U -#define LPI2C0_TRIG_REG 0x5A0U -#define LPI2C1_TRIG_REG 0x5C0U -#define LPSPI0_TRIG_REG 0x5E0U -#define LPSPI1_TRIG_REG 0x600U -#define LPUART0_TRIG_REG 0x620U -#define LPUART1_TRIG_REG 0x640U -#define LPUART2_TRIG_REG 0x660U -#define LPUART3_TRIG_REG 0x680U -#define LPUART4_TRIG_REG 0x6A0U -#define FLEXIO_TRIG0_REG 0x6E0U -#define PMUX_SHIFT 20U - -typedef enum _inputmux_index_t -{ - kINPUTMUX_INDEX_CTIMER0CAPTSEL0 = 0U, - kINPUTMUX_INDEX_CTIMER0CAPTSEL1 = 1U, - kINPUTMUX_INDEX_CTIMER0CAPTSEL2 = 2U, - kINPUTMUX_INDEX_CTIMER0CAPTSEL3 = 3U, - kINPUTMUX_INDEX_CTIMER1CAPTSEL0 = 0U, - kINPUTMUX_INDEX_CTIMER1CAPTSEL1 = 1U, - kINPUTMUX_INDEX_CTIMER1CAPTSEL2 = 2U, - kINPUTMUX_INDEX_CTIMER1CAPTSEL3 = 3U, - kINPUTMUX_INDEX_CTIMER2CAPTSEL0 = 0U, - kINPUTMUX_INDEX_CTIMER2CAPTSEL1 = 1U, - kINPUTMUX_INDEX_CTIMER2CAPTSEL2 = 2U, - kINPUTMUX_INDEX_CTIMER2CAPTSEL3 = 3U, - kINPUTMUX_INDEX_ADC0_TRIGSEL0 = 0U, - kINPUTMUX_INDEX_ADC0_TRIGSEL1 = 1U, - kINPUTMUX_INDEX_ADC0_TRIGSEL2 = 2U, - kINPUTMUX_INDEX_ADC0_TRIGSEL3 = 3U, - kINPUTMUX_INDEX_QDC0_ICAPSEL0 = 0U, - kINPUTMUX_INDEX_QDC0_ICAPSEL1 = 1U, - kINPUTMUX_INDEX_QDC0_ICAPSEL2 = 2U, - kINPUTMUX_INDEX_FLEXPWM0_FAULTSEL0 = 0U, - kINPUTMUX_INDEX_FLEXPWM0_FAULTSEL1 = 1U, - kINPUTMUX_INDEX_FLEXPWM0_FAULTSEL2 = 2U, - kINPUTMUX_INDEX_FLEXPWM0_FAULTSEL3 = 3U, - kINPUTMUX_INDEX_AOI0_TRIGSEL0 = 0U, - kINPUTMUX_INDEX_AOI0_TRIGSEL1 = 1U, - kINPUTMUX_INDEX_AOI0_TRIGSEL2 = 2U, - kINPUTMUX_INDEX_AOI0_TRIGSEL3 = 3U, - kINPUTMUX_INDEX_AOI0_TRIGSEL4 = 4U, - kINPUTMUX_INDEX_AOI0_TRIGSEL5 = 5U, - kINPUTMUX_INDEX_AOI0_TRIGSEL6 = 6U, - kINPUTMUX_INDEX_AOI0_TRIGSEL7 = 7U, - kINPUTMUX_INDEX_AOI0_TRIGSEL8 = 8U, - kINPUTMUX_INDEX_AOI0_TRIGSEL9 = 9U, - kINPUTMUX_INDEX_AOI0_TRIGSEL10 = 10U, - kINPUTMUX_INDEX_AOI0_TRIGSEL11 = 11U, - kINPUTMUX_INDEX_AOI0_TRIGSEL12 = 12U, - kINPUTMUX_INDEX_AOI0_TRIGSEL13 = 13U, - kINPUTMUX_INDEX_AOI0_TRIGSEL14 = 14U, - kINPUTMUX_INDEX_AOI0_TRIGSEL15 = 15U, - kINPUTMUX_INDEX_EXT_TRIGSEL0 = 0U, - kINPUTMUX_INDEX_EXT_TRIGSEL1 = 1U, - kINPUTMUX_INDEX_EXT_TRIGSEL2 = 2U, - kINPUTMUX_INDEX_EXT_TRIGSEL3 = 3U, - kINPUTMUX_INDEX_EXT_TRIGSEL4 = 4U, - kINPUTMUX_INDEX_EXT_TRIGSEL6 = 6U, - kINPUTMUX_INDEX_EXT_TRIGSEL7 = 7U -} inputmux_index_t; - -/*! @brief INPUTMUX connections type */ -typedef enum _inputmux_connection_t -{ - /*!< TIMER0 CAPTSEL. */ - kINPUTMUX_CtimerInp0ToTimer0Captsel = 1U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer0Captsel = 2U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer0Captsel = 3U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer0Captsel = 4U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer0Captsel = 5U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer0Captsel = 6U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer0Captsel = 7U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer0Captsel = 8U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer0Captsel = 9U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer0Captsel = 10U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp10ToTimer0Captsel = 11U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp11ToTimer0Captsel = 12U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer0Captsel = 13U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer0Captsel = 14U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer0Captsel = 15U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer0Captsel = 16U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer0Captsel = 17U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer0Captsel = 18U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer0Captsel = 19U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer0Captsel = 20U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer0Captsel = 21U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToTimer0Captsel = 22U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToTimer0Captsel = 23U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToTimer0Captsel = 24U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToTimer0Captsel = 25U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToTimer0Captsel = 26U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToTimer0Captsel = 27U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToTimer0Captsel = 28U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToTimer0Captsel = 29U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer0Captsel = 30U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer0Captsel = 31U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToTimer0Captsel = 33U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToTimer0Captsel = 34U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToTimer0Captsel = 35U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToTimer0Captsel = 36U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToTimer0Captsel = 37U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToTimer0Captsel = 38U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToTimer0Captsel = 39U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToTimer0Captsel = 40U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToTimer0Captsel = 41U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToTimer0Captsel = 42U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToTimer0Captsel = 43U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToTimer0Captsel = 44U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToTimer0Captsel = 45U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToTimer0Captsel = 46U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c0MasterEndOfPacketToTimer0Captsel = 48U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c0SlaveEndOfPacketToTimer0Captsel = 49U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi0EndOfFrameToTimer0Captsel = 52U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi0ReceivedDataWordToTimer0Captsel = 53U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi1EndOfFrameToTimer0Captsel = 54U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi1ReceivedDataWordToTimer0Captsel = 55U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceivedDataWordToTimer0Captsel = 56U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart0TransmittedDataWordToTimer0Captsel = 57U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceiveLineIdleToTimer0Captsel = 58U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceivedDataWordToTimer0Captsel = 59U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart1TransmittedDataWordToTimer0Captsel = 60U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceiveLineIdleToTimer0Captsel = 61U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceivedDataWordToTimer0Captsel = 62U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart2TransmittedDataWordToTimer0Captsel = 63U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceiveLineIdleToTimer0Captsel = 64U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart3ReceivedDataWordToTimer0Captsel = 65U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart3TransmittedDataWordToTimer0Captsel = 66U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart3ReceiveLineIdleToTimer0Captsel = 67U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart4ReceivedDataWordToTimer0Captsel = 68U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart4TransmittedDataWordToTimer0Captsel = 69U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart4ReceiveLineIdleToTimer0Captsel = 70U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToTimer0Captsel = 71U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToTimer0Captsel = 72U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToTimer0Captsel = 73U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToTimer0Captsel = 74U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToTimer0Captsel = 75U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToTimer0Captsel = 76U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToTimer0Captsel = 77U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToTimer0Captsel = 78U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer3M1ToTimer0Captsel = 79U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToTimer0Captsel = 80U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToTimer0Captsel = 81U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToTimer0Captsel = 82U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToTimer0Captsel = 83U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToTimer0Captsel = 84U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag0ToTimer0Captsel = 85U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag1ToTimer0Captsel = 86U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag2ToTimer0Captsel = 87U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag3ToTimer0Captsel = 88U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatch0ToTimer0Captsel = 89U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToTimer0Captsel = 90U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToTimer0Captsel = 91U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToTimer0Captsel = 92U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c2MasterEndOfPacketToTimer0Captsel = 94U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c2SlaveEndOfPacketToTimer0Captsel = 95U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c3MasterEndOfPacketToTimer0Captsel = 96U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c3SlaveEndOfPacketToTimer0Captsel = 97U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - - /*!< Timer1 CAPTSEL. */ - kINPUTMUX_CtimerInp0ToTimer1Captsel = 1U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer1Captsel = 2U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer1Captsel = 3U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer1Captsel = 4U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer1Captsel = 5U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer1Captsel = 6U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer1Captsel = 7U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer1Captsel = 8U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer1Captsel = 9U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer1Captsel = 10U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp10ToTimer1Captsel = 11U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp11ToTimer1Captsel = 12U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer1Captsel = 13U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer1Captsel = 14U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer1Captsel = 15U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer1Captsel = 16U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer1Captsel = 17U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer1Captsel = 18U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer1Captsel = 19U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer1Captsel = 20U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer1Captsel = 21U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToTimer1Captsel = 22U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToTimer1Captsel = 23U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToTimer1Captsel = 24U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToTimer1Captsel = 25U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToTimer1Captsel = 26U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToTimer1Captsel = 27U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToTimer1Captsel = 28U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToTimer1Captsel = 29U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer1Captsel = 30U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer1Captsel = 31U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToTimer1Captsel = 33U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToTimer1Captsel = 34U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToTimer1Captsel = 35U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToTimer1Captsel = 36U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToTimer1Captsel = 37U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToTimer1Captsel = 38U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToTimer1Captsel = 39U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToTimer1Captsel = 40U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToTimer1Captsel = 41U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToTimer1Captsel = 42U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToTimer1Captsel = 43U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToTimer1Captsel = 44U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToTimer1Captsel = 45U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToTimer1Captsel = 46U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c0MasterEndOfPacketToTimer1Captsel = 48U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c0SlaveEndOfPacketToTimer1Captsel = 49U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi0EndOfFrameToTimer1Captsel = 52U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi0ReceivedDataWordToTimer1Captsel = 53U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi1EndOfFrameToTimer1Captsel = 54U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi1ReceivedDataWordToTimer1Captsel = 55U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceivedDataWordToTimer1Captsel = 56U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart0TransmittedDataWordToTimer1Captsel = 57U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceiveLineIdleToTimer1Captsel = 58U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceivedDataWordToTimer1Captsel = 59U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart1TransmittedDataWordToTimer1Captsel = 60U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceiveLineIdleToTimer1Captsel = 61U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceivedDataWordToTimer1Captsel = 62U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart2TransmittedDataWordToTimer1Captsel = 63U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceiveLineIdleToTimer1Captsel = 64U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart3ReceivedDataWordToTimer1Captsel = 65U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart3TransmittedDataWordToTimer1Captsel = 66U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart3ReceiveLineIdleToTimer1Captsel = 67U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart4ReceivedDataWordToTimer1Captsel = 68U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart4TransmittedDataWordToTimer1Captsel = 69U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart4ReceiveLineIdleToTimer1Captsel = 70U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToTimer1Captsel = 71U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToTimer1Captsel = 72U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToTimer1Captsel = 73U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToTimer1Captsel = 74U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToTimer1Captsel = 75U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToTimer1Captsel = 76U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToTimer1Captsel = 77U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToTimer1Captsel = 78U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer3M1ToTimer1Captsel = 79U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToTimer1Captsel = 80U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToTimer1Captsel = 81U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToTimer1Captsel = 82U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToTimer1Captsel = 83U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToTimer1Captsel = 84U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag0ToTimer1Captsel = 85U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag1ToTimer1Captsel = 86U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag2ToTimer1Captsel = 87U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag3ToTimer1Captsel = 88U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatch0ToTimer1Captsel = 89U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToTimer1Captsel = 90U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToTimer1Captsel = 91U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToTimer1Captsel = 92U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c2MasterEndOfPacketToTimer1Captsel = 94U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c2SlaveEndOfPacketToTimer1Captsel = 95U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c3MasterEndOfPacketToTimer1Captsel = 96U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c3SlaveEndOfPacketToTimer1Captsel = 97U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - - /*!< Timer2 CAPTSEL. */ - kINPUTMUX_CtimerInp0ToTimer2Captsel = 1U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer2Captsel = 2U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer2Captsel = 3U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer2Captsel = 4U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer2Captsel = 5U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer2Captsel = 6U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer2Captsel = 7U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer2Captsel = 8U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer2Captsel = 9U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer2Captsel = 10U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp10ToTimer2Captsel = 11U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp11ToTimer2Captsel = 12U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer2Captsel = 13U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer2Captsel = 14U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer2Captsel = 15U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer2Captsel = 16U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer2Captsel = 17U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer2Captsel = 18U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer2Captsel = 19U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer2Captsel = 20U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer2Captsel = 21U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToTimer2Captsel = 22U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToTimer2Captsel = 23U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToTimer2Captsel = 24U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToTimer2Captsel = 25U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToTimer2Captsel = 26U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToTimer2Captsel = 27U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToTimer2Captsel = 28U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToTimer2Captsel = 29U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer2Captsel = 30U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer2Captsel = 31U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToTimer2Captsel = 33U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToTimer2Captsel = 34U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToTimer2Captsel = 35U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToTimer2Captsel = 36U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToTimer2Captsel = 37U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToTimer2Captsel = 38U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToTimer2Captsel = 39U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToTimer2Captsel = 40U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToTimer2Captsel = 41U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToTimer2Captsel = 42U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToTimer2Captsel = 43U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToTimer2Captsel = 44U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToTimer2Captsel = 45U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToTimer2Captsel = 46U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c0MasterEndOfPacketToTimer2Captsel = 48U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c0SlaveEndOfPacketToTimer2Captsel = 49U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi0EndOfFrameToTimer2Captsel = 52U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi0ReceivedDataWordToTimer2Captsel = 53U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi1EndOfFrameToTimer2Captsel = 54U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi1ReceivedDataWordToTimer2Captsel = 55U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceivedDataWordToTimer2Captsel = 56U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart0TransmittedDataWordToTimer2Captsel = 57U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceiveLineIdleToTimer2Captsel = 58U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceivedDataWordToTimer2Captsel = 59U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart1TransmittedDataWordToTimer2Captsel = 60U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceiveLineIdleToTimer2Captsel = 61U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceivedDataWordToTimer2Captsel = 62U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart2TransmittedDataWordToTimer2Captsel = 63U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceiveLineIdleToTimer2Captsel = 64U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart3ReceivedDataWordToTimer2Captsel = 65U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart3TransmittedDataWordToTimer2Captsel = 66U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart3ReceiveLineIdleToTimer2Captsel = 67U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart4ReceivedDataWordToTimer2Captsel = 68U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart4TransmittedDataWordToTimer2Captsel = 69U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart4ReceiveLineIdleToTimer2Captsel = 70U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToTimer2Captsel = 71U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToTimer2Captsel = 72U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToTimer2Captsel = 73U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToTimer2Captsel = 74U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToTimer2Captsel = 75U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToTimer2Captsel = 76U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToTimer2Captsel = 77U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToTimer2Captsel = 78U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer3M1ToTimer2Captsel = 79U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToTimer2Captsel = 80U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToTimer2Captsel = 81U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToTimer2Captsel = 82U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToTimer2Captsel = 83U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToTimer2Captsel = 84U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag0ToTimer2Captsel = 85U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag1ToTimer2Captsel = 86U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag2ToTimer2Captsel = 87U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag3ToTimer2Captsel = 88U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatch0ToTimer2Captsel = 89U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToTimer2Captsel = 90U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToTimer2Captsel = 91U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToTimer2Captsel = 92U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c2MasterEndOfPacketToTimer2Captsel = 94U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c2SlaveEndOfPacketToTimer2Captsel = 95U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c3MasterEndOfPacketToTimer2Captsel = 96U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c3SlaveEndOfPacketToTimer2Captsel = 97U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - - /*!< Timer3 CAPTSEL. */ - kINPUTMUX_CtimerInp0ToTimer3Captsel = 1U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer3Captsel = 2U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer3Captsel = 3U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer3Captsel = 4U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer3Captsel = 5U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer3Captsel = 6U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer3Captsel = 7U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer3Captsel = 8U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer3Captsel = 9U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer3Captsel = 10U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp10ToTimer3Captsel = 11U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp11ToTimer3Captsel = 12U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer3Captsel = 13U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer3Captsel = 14U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer3Captsel = 15U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer3Captsel = 16U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer3Captsel = 17U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer3Captsel = 18U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer3Captsel = 19U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer3Captsel = 20U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer3Captsel = 21U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToTimer3Captsel = 22U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToTimer3Captsel = 23U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToTimer3Captsel = 24U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToTimer3Captsel = 25U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToTimer3Captsel = 26U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToTimer3Captsel = 27U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToTimer3Captsel = 28U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToTimer3Captsel = 29U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer3Captsel = 30U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer3Captsel = 31U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToTimer3Captsel = 33U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToTimer3Captsel = 34U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToTimer3Captsel = 35U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToTimer3Captsel = 36U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToTimer3Captsel = 37U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToTimer3Captsel = 38U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToTimer3Captsel = 39U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToTimer3Captsel = 40U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToTimer3Captsel = 41U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToTimer3Captsel = 42U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToTimer3Captsel = 43U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToTimer3Captsel = 44U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToTimer3Captsel = 45U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToTimer3Captsel = 46U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c0MasterEndOfPacketToTimer3Captsel = 48U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c0SlaveEndOfPacketToTimer3Captsel = 49U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi0EndOfFrameToTimer3Captsel = 52U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi0ReceivedDataWordToTimer3Captsel = 53U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi1EndOfFrameToTimer3Captsel = 54U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi1ReceivedDataWordToTimer3Captsel = 55U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceivedDataWordToTimer3Captsel = 56U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart0TransmittedDataWordToTimer3Captsel = 57U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceiveLineIdleToTimer3Captsel = 58U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceivedDataWordToTimer3Captsel = 59U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart1TransmittedDataWordToTimer3Captsel = 60U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceiveLineIdleToTimer3Captsel = 61U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceivedDataWordToTimer3Captsel = 62U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart2TransmittedDataWordToTimer3Captsel = 63U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceiveLineIdleToTimer3Captsel = 64U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart3ReceivedDataWordToTimer3Captsel = 65U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart3TransmittedDataWordToTimer3Captsel = 66U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart3ReceiveLineIdleToTimer3Captsel = 67U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart4ReceivedDataWordToTimer3Captsel = 68U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart4TransmittedDataWordToTimer3Captsel = 69U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart4ReceiveLineIdleToTimer3Captsel = 70U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToTimer3Captsel = 71U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToTimer3Captsel = 72U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToTimer3Captsel = 73U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToTimer3Captsel = 74U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToTimer3Captsel = 75U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToTimer3Captsel = 76U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToTimer3Captsel = 77U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToTimer3Captsel = 78U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToTimer3Captsel = 79U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToTimer3Captsel = 80U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToTimer3Captsel = 81U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToTimer3Captsel = 82U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToTimer3Captsel = 83U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToTimer3Captsel = 84U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag0ToTimer3Captsel = 85U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag1ToTimer3Captsel = 86U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag2ToTimer3Captsel = 87U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag3ToTimer3Captsel = 88U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatch0ToTimer3Captsel = 89U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToTimer3Captsel = 90U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToTimer3Captsel = 91U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToTimer3Captsel = 92U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c2MasterEndOfPacketToTimer3Captsel = 94U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c2SlaveEndOfPacketToTimer3Captsel = 95U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c3MasterEndOfPacketToTimer3Captsel = 96U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c3SlaveEndOfPacketToTimer3Captsel = 97U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - - /*!< Timer4 CAPTSEL. */ - kINPUTMUX_CtimerInp0ToTimer4Captsel = 1U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer4Captsel = 2U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer4Captsel = 3U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer4Captsel = 4U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer4Captsel = 5U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer4Captsel = 6U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer4Captsel = 7U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer4Captsel = 8U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer4Captsel = 9U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer4Captsel = 10U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp10ToTimer4Captsel = 11U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp11ToTimer4Captsel = 12U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer4Captsel = 13U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer4Captsel = 14U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer4Captsel = 15U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer4Captsel = 16U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer4Captsel = 17U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer4Captsel = 18U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer4Captsel = 19U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer4Captsel = 20U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer4Captsel = 21U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToTimer4Captsel = 22U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToTimer4Captsel = 23U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToTimer4Captsel = 24U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToTimer4Captsel = 25U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToTimer4Captsel = 26U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToTimer4Captsel = 27U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToTimer4Captsel = 28U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToTimer4Captsel = 29U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer4Captsel = 30U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer4Captsel = 31U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToTimer4Captsel = 33U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToTimer4Captsel = 34U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToTimer4Captsel = 35U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToTimer4Captsel = 36U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToTimer4Captsel = 37U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToTimer4Captsel = 38U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToTimer4Captsel = 39U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToTimer4Captsel = 40U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToTimer4Captsel = 41U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToTimer4Captsel = 42U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToTimer4Captsel = 43U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToTimer4Captsel = 44U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToTimer4Captsel = 45U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToTimer4Captsel = 46U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c0MasterEndOfPacketToTimer4Captsel = 48U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c0SlaveEndOfPacketToTimer4Captsel = 49U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi0EndOfFrameToTimer4Captsel = 52U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi0ReceivedDataWordToTimer4Captsel = 53U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi1EndOfFrameToTimer4Captsel = 54U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpspi1ReceivedDataWordToTimer4Captsel = 55U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceivedDataWordToTimer4Captsel = 56U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart0TransmittedDataWordToTimer4Captsel = 57U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceiveLineIdleToTimer4Captsel = 58U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceivedDataWordToTimer4Captsel = 59U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart1TransmittedDataWordToTimer4Captsel = 60U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceiveLineIdleToTimer4Captsel = 61U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceivedDataWordToTimer4Captsel = 62U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart2TransmittedDataWordToTimer4Captsel = 63U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceiveLineIdleToTimer4Captsel = 64U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart3ReceivedDataWordToTimer4Captsel = 65U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart3TransmittedDataWordToTimer4Captsel = 66U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart3ReceiveLineIdleToTimer4Captsel = 67U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart4ReceivedDataWordToTimer4Captsel = 68U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart4TransmittedDataWordToTimer4Captsel = 69U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpuart4ReceiveLineIdleToTimer4Captsel = 70U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToTimer4Captsel = 71U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToTimer4Captsel = 72U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToTimer4Captsel = 73U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToTimer4Captsel = 74U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToTimer4Captsel = 75U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToTimer4Captsel = 76U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToTimer4Captsel = 77U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToTimer4Captsel = 78U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToTimer4Captsel = 79U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToTimer4Captsel = 80U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToTimer4Captsel = 81U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer3M1ToTimer4Captsel = 82U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToTimer4Captsel = 83U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToTimer4Captsel = 84U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag0ToTimer4Captsel = 85U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag1ToTimer4Captsel = 86U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag2ToTimer4Captsel = 87U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag3ToTimer4Captsel = 88U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatch0ToTimer4Captsel = 89U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToTimer4Captsel = 90U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToTimer4Captsel = 91U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToTimer4Captsel = 92U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c2MasterEndOfPacketToTimer4Captsel = 94U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c2SlaveEndOfPacketToTimer4Captsel = 95U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c3MasterEndOfPacketToTimer4Captsel = 96U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Lpi2c3SlaveEndOfPacketToTimer4Captsel = 97U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - - /*!< TIMER0 Trigger. */ - kINPUTMUX_CtimerInp0ToTimer0Trigger = 1U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer0Trigger = 2U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer0Trigger = 3U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer0Trigger = 4U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer0Trigger = 5U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer0Trigger = 6U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer0Trigger = 7U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer0Trigger = 8U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer0Trigger = 9U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer0Trigger = 10U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp10ToTimer0Trigger = 11U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp11ToTimer0Trigger = 12U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer0Trigger = 13U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer0Trigger = 14U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer0Trigger = 15U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer0Trigger = 16U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer0Trigger = 17U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer0Trigger = 18U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer0Trigger = 19U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer0Trigger = 20U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer0Trigger = 21U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToTimer0Trigger = 22U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToTimer0Trigger = 23U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToTimer0Trigger = 24U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToTimer0Trigger = 25U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToTimer0Trigger = 26U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToTimer0Trigger = 27U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToTimer0Trigger = 28U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToTimer0Trigger = 29U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer0Trigger = 30U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer0Trigger = 31U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToTimer0Trigger = 33U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToTimer0Trigger = 34U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToTimer0Trigger = 35U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToTimer0Trigger = 36U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToTimer0Trigger = 37U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToTimer0Trigger = 38U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToTimer0Trigger = 39U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToTimer0Trigger = 40U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToTimer0Trigger = 41U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToTimer0Trigger = 42U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToTimer0Trigger = 43U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToTimer0Trigger = 44U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToTimer0Trigger = 45U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToTimer0Trigger = 46U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c0MasterEndOfPacketToTimer0Trigger = 48U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c0SlaveEndOfPacketToTimer0Trigger = 49U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi0EndOfFrameToTimer0Trigger = 52U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi0ReceivedDataWordToTimer0Trigger = 53U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi1EndOfFrameToTimer0Trigger = 54U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi1ReceivedDataWordToTimer0Trigger = 55U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceivedDataWordToTimer0Trigger = 56U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart0TransmittedDataWordToTimer0Trigger = 57U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceiveLineIdleToTimer0Trigger = 58U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceivedDataWordToTimer0Trigger = 59U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart1TransmittedDataWordToTimer0Trigger = 60U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceiveLineIdleToTimer0Trigger = 61U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceivedDataWordToTimer0Trigger = 62U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart2TransmittedDataWordToTimer0Trigger = 63U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceiveLineIdleToTimer0Trigger = 64U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart3ReceivedDataWordToTimer0Trigger = 65U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart3TransmittedDataWordToTimer0Trigger = 66U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart3ReceiveLineIdleToTimer0Trigger = 67U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart4ReceivedDataWordToTimer0Trigger = 68U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart4TransmittedDataWordToTimer0Trigger = 69U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart4ReceiveLineIdleToTimer0Trigger = 70U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToTimer0Trigger = 71U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToTimer0Trigger = 72U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToTimer0Trigger = 73U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToTimer0Trigger = 74U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToTimer0Trigger = 75U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToTimer0Trigger = 76U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToTimer0Trigger = 77U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToTimer0Trigger = 78U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer3M1ToTimer0Trigger = 79U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToTimer0Trigger = 80U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToTimer0Trigger = 81U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToTimer0Trigger = 82U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToTimer0Trigger = 83U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToTimer0Trigger = 84U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag0ToTimer0Trigger = 85U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag1ToTimer0Trigger = 86U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag2ToTimer0Trigger = 87U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag3ToTimer0Trigger = 88U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatch0ToTimer0Trigger = 89U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToTimer0Trigger = 90U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToTimer0Trigger = 91U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToTimer0Trigger = 92U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c2MasterEndOfPacketToTimer0Trigger = 94U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c2SlaveEndOfPacketToTimer0Trigger = 95U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c3MasterEndOfPacketToTimer0Trigger = 96U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c3SlaveEndOfPacketToTimer0Trigger = 97U + (TIMER0TRIGIN << PMUX_SHIFT), - - /*!< Timer1 Trigger. */ - kINPUTMUX_CtimerInp0ToTimer1Trigger = 1U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer1Trigger = 2U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer1Trigger = 3U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer1Trigger = 4U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer1Trigger = 5U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer1Trigger = 6U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer1Trigger = 7U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer1Trigger = 8U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer1Trigger = 9U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer1Trigger = 10U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp10ToTimer1Trigger = 11U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp11ToTimer1Trigger = 12U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer1Trigger = 13U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer1Trigger = 14U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer1Trigger = 15U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer1Trigger = 16U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer1Trigger = 17U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer1Trigger = 18U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer1Trigger = 19U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer1Trigger = 20U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer1Trigger = 21U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToTimer1Trigger = 22U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToTimer1Trigger = 23U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToTimer1Trigger = 24U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToTimer1Trigger = 25U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToTimer1Trigger = 26U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToTimer1Trigger = 27U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToTimer1Trigger = 28U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToTimer1Trigger = 29U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer1Trigger = 30U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer1Trigger = 31U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToTimer1Trigger = 33U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToTimer1Trigger = 34U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToTimer1Trigger = 35U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToTimer1Trigger = 36U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToTimer1Trigger = 37U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToTimer1Trigger = 38U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToTimer1Trigger = 39U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToTimer1Trigger = 40U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToTimer1Trigger = 41U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToTimer1Trigger = 42U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToTimer1Trigger = 43U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToTimer1Trigger = 44U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToTimer1Trigger = 45U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToTimer1Trigger = 46U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c0MasterEndOfPacketToTimer1Trigger = 48U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c0SlaveEndOfPacketToTimer1Trigger = 49U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi0EndOfFrameToTimer1Trigger = 52U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi0ReceivedDataWordToTimer1Trigger = 53U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi1EndOfFrameToTimer1Trigger = 54U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi1ReceivedDataWordToTimer1Trigger = 55U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceivedDataWordToTimer1Trigger = 56U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart0TransmittedDataWordToTimer1Trigger = 57U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceiveLineIdleToTimer1Trigger = 58U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceivedDataWordToTimer1Trigger = 59U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart1TransmittedDataWordToTimer1Trigger = 60U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceiveLineIdleToTimer1Trigger = 61U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceivedDataWordToTimer1Trigger = 62U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart2TransmittedDataWordToTimer1Trigger = 63U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceiveLineIdleToTimer1Trigger = 64U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart3ReceivedDataWordToTimer1Trigger = 65U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart3TransmittedDataWordToTimer1Trigger = 66U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart3ReceiveLineIdleToTimer1Trigger = 67U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart4ReceivedDataWordToTimer1Trigger = 68U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart4TransmittedDataWordToTimer1Trigger = 69U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart4ReceiveLineIdleToTimer1Trigger = 70U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToTimer1Trigger = 71U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToTimer1Trigger = 72U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToTimer1Trigger = 73U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToTimer1Trigger = 74U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToTimer1Trigger = 75U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToTimer1Trigger = 76U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToTimer1Trigger = 77U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToTimer1Trigger = 78U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer3M1ToTimer1Trigger = 79U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToTimer1Trigger = 80U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToTimer1Trigger = 81U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToTimer1Trigger = 82U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToTimer1Trigger = 83U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToTimer1Trigger = 84U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag0ToTimer1Trigger = 85U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag1ToTimer1Trigger = 86U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag2ToTimer1Trigger = 87U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag3ToTimer1Trigger = 88U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatch0ToTimer1Trigger = 89U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToTimer1Trigger = 90U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToTimer1Trigger = 91U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToTimer1Trigger = 92U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c2MasterEndOfPacketToTimer1Trigger = 94U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c2SlaveEndOfPacketToTimer1Trigger = 95U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c3MasterEndOfPacketToTimer1Trigger = 96U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c3SlaveEndOfPacketToTimer1Trigger = 97U + (TIMER1TRIGIN << PMUX_SHIFT), - - /*!< Timer2 Trigger. */ - kINPUTMUX_CtimerInp0ToTimer2Trigger = 1U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer2Trigger = 2U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer2Trigger = 3U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer2Trigger = 4U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer2Trigger = 5U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer2Trigger = 6U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer2Trigger = 7U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer2Trigger = 8U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer2Trigger = 9U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer2Trigger = 10U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp10ToTimer2Trigger = 11U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp11ToTimer2Trigger = 12U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer2Trigger = 13U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer2Trigger = 14U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer2Trigger = 15U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer2Trigger = 16U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer2Trigger = 17U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer2Trigger = 18U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer2Trigger = 19U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer2Trigger = 20U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer2Trigger = 21U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToTimer2Trigger = 22U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToTimer2Trigger = 23U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToTimer2Trigger = 24U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToTimer2Trigger = 25U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToTimer2Trigger = 26U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToTimer2Trigger = 27U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToTimer2Trigger = 28U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToTimer2Trigger = 29U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer2Trigger = 30U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer2Trigger = 31U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToTimer2Trigger = 33U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToTimer2Trigger = 34U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToTimer2Trigger = 35U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToTimer2Trigger = 36U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToTimer2Trigger = 37U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToTimer2Trigger = 38U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToTimer2Trigger = 39U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToTimer2Trigger = 40U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToTimer2Trigger = 41U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToTimer2Trigger = 42U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToTimer2Trigger = 43U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToTimer2Trigger = 44U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToTimer2Trigger = 45U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToTimer2Trigger = 46U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c0MasterEndOfPacketToTimer2Trigger = 48U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c0SlaveEndOfPacketToTimer2Trigger = 49U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi0EndOfFrameToTimer2Trigger = 52U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi0ReceivedDataWordToTimer2Trigger = 53U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi1EndOfFrameToTimer2Trigger = 54U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi1ReceivedDataWordToTimer2Trigger = 55U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceivedDataWordToTimer2Trigger = 56U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart0TransmittedDataWordToTimer2Trigger = 57U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceiveLineIdleToTimer2Trigger = 58U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceivedDataWordToTimer2Trigger = 59U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart1TransmittedDataWordToTimer2Trigger = 60U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceiveLineIdleToTimer2Trigger = 61U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceivedDataWordToTimer2Trigger = 62U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart2TransmittedDataWordToTimer2Trigger = 63U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceiveLineIdleToTimer2Trigger = 64U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart3ReceivedDataWordToTimer2Trigger = 65U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart3TransmittedDataWordToTimer2Trigger = 66U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart3ReceiveLineIdleToTimer2Trigger = 67U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart4ReceivedDataWordToTimer2Trigger = 68U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart4TransmittedDataWordToTimer2Trigger = 69U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart4ReceiveLineIdleToTimer2Trigger = 70U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToTimer2Trigger = 71U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToTimer2Trigger = 72U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToTimer2Trigger = 73U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToTimer2Trigger = 74U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToTimer2Trigger = 75U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToTimer2Trigger = 76U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToTimer2Trigger = 77U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToTimer2Trigger = 78U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer3M1ToTimer2Trigger = 79U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToTimer2Trigger = 80U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToTimer2Trigger = 81U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToTimer2Trigger = 82U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToTimer2Trigger = 83U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToTimer2Trigger = 84U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag0ToTimer2Trigger = 85U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag1ToTimer2Trigger = 86U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag2ToTimer2Trigger = 87U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag3ToTimer2Trigger = 88U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatch0ToTimer2Trigger = 89U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToTimer2Trigger = 90U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToTimer2Trigger = 91U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToTimer2Trigger = 92U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c2MasterEndOfPacketToTimer2Trigger = 94U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c2SlaveEndOfPacketToTimer2Trigger = 95U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c3MasterEndOfPacketToTimer2Trigger = 96U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c3SlaveEndOfPacketToTimer2Trigger = 97U + (TIMER2TRIGIN << PMUX_SHIFT), - - /*!< Timer3 Trigger. */ - kINPUTMUX_CtimerInp0ToTimer3Trigger = 1U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer3Trigger = 2U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer3Trigger = 3U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer3Trigger = 4U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer3Trigger = 5U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer3Trigger = 6U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer3Trigger = 7U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer3Trigger = 8U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer3Trigger = 9U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer3Trigger = 10U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp10ToTimer3Trigger = 11U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp11ToTimer3Trigger = 12U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer3Trigger = 13U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer3Trigger = 14U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer3Trigger = 15U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer3Trigger = 16U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer3Trigger = 17U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer3Trigger = 18U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer3Trigger = 19U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer3Trigger = 20U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer3Trigger = 21U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToTimer3Trigger = 22U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToTimer3Trigger = 23U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToTimer3Trigger = 24U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToTimer3Trigger = 25U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToTimer3Trigger = 26U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToTimer3Trigger = 27U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToTimer3Trigger = 28U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToTimer3Trigger = 29U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer3Trigger = 30U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer3Trigger = 31U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToTimer3Trigger = 33U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToTimer3Trigger = 34U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToTimer3Trigger = 35U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToTimer3Trigger = 36U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToTimer3Trigger = 37U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToTimer3Trigger = 38U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToTimer3Trigger = 39U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToTimer3Trigger = 40U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToTimer3Trigger = 41U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToTimer3Trigger = 42U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToTimer3Trigger = 43U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToTimer3Trigger = 44U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToTimer3Trigger = 45U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToTimer3Trigger = 46U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c0MasterEndOfPacketToTimer3Trigger = 48U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c0SlaveEndOfPacketToTimer3Trigger = 49U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi0EndOfFrameToTimer3Trigger = 52U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi0ReceivedDataWordToTimer3Trigger = 53U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi1EndOfFrameToTimer3Trigger = 54U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi1ReceivedDataWordToTimer3Trigger = 55U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceivedDataWordToTimer3Trigger = 56U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart0TransmittedDataWordToTimer3Trigger = 57U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceiveLineIdleToTimer3Trigger = 58U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceivedDataWordToTimer3Trigger = 59U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart1TransmittedDataWordToTimer3Trigger = 60U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceiveLineIdleToTimer3Trigger = 61U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceivedDataWordToTimer3Trigger = 62U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart2TransmittedDataWordToTimer3Trigger = 63U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceiveLineIdleToTimer3Trigger = 64U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart3ReceivedDataWordToTimer3Trigger = 65U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart3TransmittedDataWordToTimer3Trigger = 66U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart3ReceiveLineIdleToTimer3Trigger = 67U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart4ReceivedDataWordToTimer3Trigger = 68U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart4TransmittedDataWordToTimer3Trigger = 69U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart4ReceiveLineIdleToTimer3Trigger = 70U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToTimer3Trigger = 71U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToTimer3Trigger = 72U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToTimer3Trigger = 73U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToTimer3Trigger = 74U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToTimer3Trigger = 75U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToTimer3Trigger = 76U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToTimer3Trigger = 77U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToTimer3Trigger = 78U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToTimer3Trigger = 79U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToTimer3Trigger = 80U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToTimer3Trigger = 81U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToTimer3Trigger = 82U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToTimer3Trigger = 83U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToTimer3Trigger = 84U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag0ToTimer3Trigger = 85U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag1ToTimer3Trigger = 86U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag2ToTimer3Trigger = 87U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag3ToTimer3Trigger = 88U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatch0ToTimer3Trigger = 89U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToTimer3Trigger = 90U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToTimer3Trigger = 91U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToTimer3Trigger = 92U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c2MasterEndOfPacketToTimer3Trigger = 94U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c2SlaveEndOfPacketToTimer3Trigger = 95U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c3MasterEndOfPacketToTimer3Trigger = 96U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c3SlaveEndOfPacketToTimer3Trigger = 97U + (TIMER3TRIGIN << PMUX_SHIFT), - - /*!< Timer4 Trigger. */ - kINPUTMUX_CtimerInp0ToTimer4Trigger = 1U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer4Trigger = 2U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer4Trigger = 3U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer4Trigger = 4U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer4Trigger = 5U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer4Trigger = 6U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer4Trigger = 7U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer4Trigger = 8U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer4Trigger = 9U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer4Trigger = 10U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp10ToTimer4Trigger = 11U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp11ToTimer4Trigger = 12U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer4Trigger = 13U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer4Trigger = 14U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer4Trigger = 15U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer4Trigger = 16U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer4Trigger = 17U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer4Trigger = 18U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer4Trigger = 19U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer4Trigger = 20U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer4Trigger = 21U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToTimer4Trigger = 22U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToTimer4Trigger = 23U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToTimer4Trigger = 24U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToTimer4Trigger = 25U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToTimer4Trigger = 26U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToTimer4Trigger = 27U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToTimer4Trigger = 28U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToTimer4Trigger = 29U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer4Trigger = 30U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer4Trigger = 31U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToTimer4Trigger = 33U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToTimer4Trigger = 34U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToTimer4Trigger = 35U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToTimer4Trigger = 36U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToTimer4Trigger = 37U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToTimer4Trigger = 38U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToTimer4Trigger = 39U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToTimer4Trigger = 40U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToTimer4Trigger = 41U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToTimer4Trigger = 42U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToTimer4Trigger = 43U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToTimer4Trigger = 44U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToTimer4Trigger = 45U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToTimer4Trigger = 46U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c0MasterEndOfPacketToTimer4Trigger = 48U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c0SlaveEndOfPacketToTimer4Trigger = 49U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi0EndOfFrameToTimer4Trigger = 52U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi0ReceivedDataWordToTimer4Trigger = 53U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi1EndOfFrameToTimer4Trigger = 54U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpspi1ReceivedDataWordToTimer4Trigger = 55U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceivedDataWordToTimer4Trigger = 56U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart0TransmittedDataWordToTimer4Trigger = 57U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceiveLineIdleToTimer4Trigger = 58U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceivedDataWordToTimer4Trigger = 59U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart1TransmittedDataWordToTimer4Trigger = 60U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceiveLineIdleToTimer4Trigger = 61U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceivedDataWordToTimer4Trigger = 62U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart2TransmittedDataWordToTimer4Trigger = 63U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceiveLineIdleToTimer4Trigger = 64U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart3ReceivedDataWordToTimer4Trigger = 65U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart3TransmittedDataWordToTimer4Trigger = 66U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart3ReceiveLineIdleToTimer4Trigger = 67U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart4ReceivedDataWordToTimer4Trigger = 68U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart4TransmittedDataWordToTimer4Trigger = 69U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpuart4ReceiveLineIdleToTimer4Trigger = 70U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToTimer4Trigger = 71U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToTimer4Trigger = 72U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToTimer4Trigger = 73U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToTimer4Trigger = 74U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToTimer4Trigger = 75U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToTimer4Trigger = 76U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToTimer4Trigger = 77U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToTimer4Trigger = 78U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToTimer4Trigger = 79U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToTimer4Trigger = 80U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToTimer4Trigger = 81U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer3M1ToTimer4Trigger = 82U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToTimer4Trigger = 83U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToTimer4Trigger = 84U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag0ToTimer4Trigger = 85U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag1ToTimer4Trigger = 86U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag2ToTimer4Trigger = 87U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag3ToTimer4Trigger = 88U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatch0ToTimer4Trigger = 89U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToTimer4Trigger = 90U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToTimer4Trigger = 91U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToTimer4Trigger = 92U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c2MasterEndOfPacketToTimer4Trigger = 94U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c2SlaveEndOfPacketToTimer4Trigger = 95U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c3MasterEndOfPacketToTimer4Trigger = 96U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Lpi2c3SlaveEndOfPacketToTimer4Trigger = 97U + (TIMER4TRIGIN << PMUX_SHIFT), - - /*!< Selection for frequency measurement reference clock. */ - kINPUTMUX_ClkInToFreqmeasRef = 1U + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_FroOsc12MToFreqmeasRef = 2u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_FroHfDivToFreqmeasRef = 3u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_Clk16K1ToFreqmeasRef = 5u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_SlowClkToFreqmeasRef = 6u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_FreqmeClkIn0ToFreqmeasRef = 7u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_FreqmeClkIn1ToFreqmeasRef = 8u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToFreqmeasRef = 9u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToFreqmeasRef = 10u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToFreqmeasRef = 11u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToFreqmeasRef = 12u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToFreqmeasRef = 13u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToFreqmeasRef = 14u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToFreqmeasRef = 15u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToFreqmeasRef = 16u + (FREQMEAS_REF_REG << PMUX_SHIFT), - - /*!< Selection for frequency measurement target clock. */ - kINPUTMUX_ClkInToFreqmeasTar = 1U + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_FroOsc12MToFreqmeasTar = 2u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_FroHfDivToFreqmeasTar = 3u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_Clk16K1ToFreqmeasTar = 5u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_SlowClkToFreqmeasTar = 6u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_FreqmeClkIn0ToFreqmeasTar = 7u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_FreqmeClkIn1ToFreqmeasTar = 8u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToFreqmeasTar = 9u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToFreqmeasTar = 10u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToFreqmeasTar = 11u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToFreqmeasTar = 12u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToFreqmeasTar = 13u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToFreqmeasTar = 14u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToFreqmeasTar = 15u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToFreqmeasTar = 16u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - - /*!< Cmp0 Trigger. */ - kINPUTMUX_Aoi0Out0ToCmp0Trigger = 2U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToCmp0Trigger = 3U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToCmp0Trigger = 4U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToCmp0Trigger = 5U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToCmp0Trigger = 6U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M0ToCmp0Trigger = 8U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToCmp0Trigger = 9U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToCmp0Trigger = 10U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToCmp0Trigger = 11U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToCmp0Trigger = 12U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToCmp0Trigger = 13U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToCmp0Trigger = 14U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToCmp0Trigger = 16U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToCmp0Trigger = 17U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToCmp0Trigger = 18U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToCmp0Trigger = 19U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToCmp0Trigger = 20U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToCmp0Trigger = 21U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToCmp0Trigger = 22U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToCmp0Trigger = 25U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToCmp0Trigger = 26U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToCmp0Trigger = 27U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToCmp0Trigger = 28U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToCmp0Trigger = 29U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToCmp0Trigger = 30U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToCmp0Trigger = 31U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToCmp0Trigger = 32U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToCmp0Trigger = 33U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToCmp0Trigger = 34U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToCmp0Trigger = 39U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M1ToCmp0Trigger = 40U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToCmp0Trigger = 41U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToCmp0Trigger = 42U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatch0ToCmp0Trigger = 47U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToCmp0Trigger = 48U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig1ToCmp0Trigger = 49U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToCmp0Trigger = 50U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig1ToCmp0Trigger = 51U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToCmp0Trigger = 52U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig1ToCmp0Trigger = 53U + (CMP0_TRIG_REG << PMUX_SHIFT), - - /*!< Cmp1 Trigger. */ - kINPUTMUX_Aoi0Out0ToCmp1Trigger = 2U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToCmp1Trigger = 3U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToCmp1Trigger = 4U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToCmp1Trigger = 5U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToCmp1Trigger = 6U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M0ToCmp1Trigger = 8U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToCmp1Trigger = 9U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToCmp1Trigger = 10U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToCmp1Trigger = 11U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToCmp1Trigger = 12U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToCmp1Trigger = 13U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToCmp1Trigger = 14U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToCmp1Trigger = 16U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToCmp1Trigger = 17U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToCmp1Trigger = 18U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToCmp1Trigger = 19U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToCmp1Trigger = 20U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToCmp1Trigger = 21U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToCmp1Trigger = 22U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToCmp1Trigger = 25U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToCmp1Trigger = 26U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToCmp1Trigger = 27U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToCmp1Trigger = 28U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToCmp1Trigger = 29U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToCmp1Trigger = 30U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToCmp1Trigger = 31U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToCmp1Trigger = 32U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToCmp1Trigger = 33U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToCmp1Trigger = 34U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToCmp1Trigger = 39U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M1ToCmp1Trigger = 40U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToCmp1Trigger = 41U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToCmp1Trigger = 42U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatch0ToCmp1Trigger = 47U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToCmp1Trigger = 48U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig1ToCmp1Trigger = 49U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToCmp1Trigger = 50U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig1ToCmp1Trigger = 51U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToCmp1Trigger = 52U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig1ToCmp1Trigger = 53U + (CMP1_TRIG_REG << PMUX_SHIFT), - - /*!< Adc0 Trigger. */ - kINPUTMUX_ArmTxevToAdc0Trigger = 1U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToAdc0Trigger = 2U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToAdc0Trigger = 3U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToAdc0Trigger = 4U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToAdc0Trigger = 5U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToAdc0Trigger = 6U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToAdc0Trigger = 7U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M0ToAdc0Trigger = 9U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToAdc0Trigger = 10U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToAdc0Trigger = 11U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToAdc0Trigger = 12U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToAdc0Trigger = 13U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToAdc0Trigger = 14U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToAdc0Trigger = 15U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToAdc0Trigger = 17U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToAdc0Trigger = 18U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToAdc0Trigger = 19U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToAdc0Trigger = 20U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToAdc0Trigger = 21U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToAdc0Trigger = 22U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToAdc0Trigger = 23U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToAdc0Trigger = 26U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToAdc0Trigger = 27U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToAdc0Trigger = 28U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToAdc0Trigger = 29U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToAdc0Trigger = 30U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_WuuToAdc0Trigger = 31U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToAdc0Trigger = 33U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToAdc0Trigger = 34U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToAdc0Trigger = 35U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToAdc0Trigger = 36U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToAdc0Trigger = 37U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToAdc0Trigger = 38U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToAdc0Trigger = 39U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToAdc0Trigger = 40U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToAdc0Trigger = 41U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M1ToAdc0Trigger = 42U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToAdc0Trigger = 43U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToAdc0Trigger = 44U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh0ToAdc0Trigger = 45U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh1ToAdc0Trigger = 46U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh2ToAdc0Trigger = 47U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh3ToAdc0Trigger = 48U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatch0ToAdc0Trigger = 49U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToAdc0Trigger = 50U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig1ToAdc0Trigger = 51U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToAdc0Trigger = 52U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig1ToAdc0Trigger = 53U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToAdc0Trigger = 54U + (ADC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig1ToAdc0Trigger = 55U + (ADC0_TRIG0_REG << PMUX_SHIFT), - - /*!< Adc1 Trigger. */ - kINPUTMUX_ArmTxevToAdc1Trigger = 1U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToAdc1Trigger = 2U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToAdc1Trigger = 3U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToAdc1Trigger = 4U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToAdc1Trigger = 5U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToAdc1Trigger = 6U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToAdc1Trigger = 7U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M0ToAdc1Trigger = 9U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToAdc1Trigger = 10U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToAdc1Trigger = 11U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToAdc1Trigger = 12U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToAdc1Trigger = 13U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToAdc1Trigger = 14U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToAdc1Trigger = 15U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToAdc1Trigger = 17U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToAdc1Trigger = 18U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToAdc1Trigger = 19U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToAdc1Trigger = 20U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToAdc1Trigger = 21U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToAdc1Trigger = 22U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToAdc1Trigger = 23U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToAdc1Trigger = 26U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToAdc1Trigger = 27U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToAdc1Trigger = 28U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToAdc1Trigger = 29U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToAdc1Trigger = 30U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_WuuToAdc1Trigger = 31U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToAdc1Trigger = 33U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToAdc1Trigger = 34U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToAdc1Trigger = 35U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToAdc1Trigger = 36U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToAdc1Trigger = 37U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToAdc1Trigger = 38U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToAdc1Trigger = 39U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToAdc1Trigger = 40U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToAdc1Trigger = 41U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M1ToAdc1Trigger = 42U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToAdc1Trigger = 43U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToAdc1Trigger = 44U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh0ToAdc1Trigger = 45U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh1ToAdc1Trigger = 46U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh2ToAdc1Trigger = 47U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh3ToAdc1Trigger = 48U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatch0ToAdc1Trigger = 49U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToAdc1Trigger = 50U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig1ToAdc1Trigger = 51U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToAdc1Trigger = 52U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig1ToAdc1Trigger = 53U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToAdc1Trigger = 54U + (ADC1_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig1ToAdc1Trigger = 55U + (ADC1_TRIG0_REG << PMUX_SHIFT), - - /*!< Dac0 Trigger. */ - kINPUTMUX_ArmTxevToDac0Trigger = 1U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToDac0Trigger = 2U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToDac0Trigger = 3U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToDac0Trigger = 4U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToDac0Trigger = 5U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToDac0Trigger = 6U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToDac0Trigger = 7U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M0ToDac0Trigger = 9U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToDac0Trigger = 10U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToDac0Trigger = 11U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToDac0Trigger = 12U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToDac0Trigger = 13U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToDac0Trigger = 14U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToDac0Trigger = 15U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToDac0Trigger = 18U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToDac0Trigger = 19U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToDac0Trigger = 20U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToDac0Trigger = 21U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToDac0Trigger = 22U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToDac0Trigger = 23U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToDac0Trigger = 26U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToDac0Trigger = 27U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToDac0Trigger = 28U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToDac0Trigger = 29U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToDac0Trigger = 30U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_WuuToDac0Trigger = 31U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToDac0Trigger = 33U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToDac0Trigger = 34U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToDac0Trigger = 35U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToDac0Trigger = 36U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToDac0Trigger = 37U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToDac0Trigger = 38U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToDac0Trigger = 39U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToDac0Trigger = 40U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToDac0Trigger = 41U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M1ToDac0Trigger = 42U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToDac0Trigger = 43U + (DAC0_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToDac0Trigger = 44U + (DAC0_TRIG0_REG << PMUX_SHIFT), - - /*!< Qdc0 Trigger. */ - kINPUTMUX_ArmTxevToQdc0Trigger = 1U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToQdc0Trigger = 2U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToQdc0Trigger = 3U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToQdc0Trigger = 4U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToQdc0Trigger = 5U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc0Trigger = 6U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc0Trigger = 7U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToQdc0Trigger = 9U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc0Trigger = 10U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToQdc0Trigger = 11U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc0Trigger = 12U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToQdc0Trigger = 13U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc0Trigger = 14U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToQdc0Trigger = 16U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToQdc0Trigger = 17U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToQdc0Trigger = 18U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToQdc0Trigger = 19U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToQdc0Trigger = 20U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToQdc0Trigger = 21U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc0Trigger = 24U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc0Trigger = 25U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc0Trigger = 26U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc0Trigger = 27U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc0Trigger = 28U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc0Trigger = 29U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc0Trigger = 30U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc0Trigger = 31U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc0Trigger = 32U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc0Trigger = 33U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToQdc0Trigger = 34U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToQdc0Trigger = 35U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToQdc0Trigger = 36U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToQdc0Trigger = 37U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToQdc0Trigger = 38U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToQdc0Trigger = 39U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToQdc0Trigger = 40U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToQdc0Trigger = 41U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToQdc0Trigger = 42U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToQdc0Trigger = 43U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToQdc0Trigger = 44U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToQdc0Trigger = 49U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToQdc0Trigger = 50U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToQdc0Trigger = 51U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToQdc0Trigger = 52U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToQdc0Trigger = 62U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig1ToQdc0Trigger = 63U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToQdc0Trigger = 64U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig1ToQdc0Trigger = 65U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToQdc0Trigger = 66U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig1ToQdc0Trigger = 67U + (QDC0_TRIG_REG << PMUX_SHIFT), - - /*!< Qdc0 Home. */ - kINPUTMUX_ArmTxevToQdc0Home = 1U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToQdc0Home = 2U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToQdc0Home = 3U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToQdc0Home = 4U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToQdc0Home = 5U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc0Home = 6U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc0Home = 7U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToQdc0Home = 9U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc0Home = 10U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToQdc0Home = 11U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc0Home = 12U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToQdc0Home = 13U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc0Home = 14U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToQdc0Home = 16U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToQdc0Home = 17U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToQdc0Home = 18U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToQdc0Home = 19U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToQdc0Home = 20U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToQdc0Home = 21U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc0Home = 24U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc0Home = 25U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc0Home = 26U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc0Home = 27U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc0Home = 28U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc0Home = 29U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc0Home = 30U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc0Home = 31U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc0Home = 32U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc0Home = 33U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToQdc0Home = 34U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToQdc0Home = 35U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToQdc0Home = 36U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToQdc0Home = 37U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToQdc0Home = 38U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToQdc0Home = 39U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToQdc0Home = 40U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToQdc0Home = 41U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToQdc0Home = 42U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToQdc0Home = 43U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToQdc0Home = 44U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToQdc0Home = 49U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToQdc0Home = 50U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToQdc0Home = 51U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToQdc0Home = 52U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToQdc0Home = 62U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig1ToQdc0Home = 63U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToQdc0Home = 64U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig1ToQdc0Home = 65U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToQdc0Home = 66U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig1ToQdc0Home = 67U + (QDC0_HOME_REG << PMUX_SHIFT), - - /*!< Qdc0 Index. */ - kINPUTMUX_ArmTxevToQdc0Index = 1U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToQdc0Index = 2U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToQdc0Index = 3U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToQdc0Index = 4U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToQdc0Index = 5U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc0Index = 6U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc0Index = 7U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToQdc0Index = 9U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc0Index = 10U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToQdc0Index = 11U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc0Index = 12U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToQdc0Index = 13U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc0Index = 14U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToQdc0Index = 16U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToQdc0Index = 17U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToQdc0Index = 18U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToQdc0Index = 19U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToQdc0Index = 20U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToQdc0Index = 21U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc0Index = 24U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc0Index = 25U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc0Index = 26U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc0Index = 27U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc0Index = 28U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc0Index = 29U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc0Index = 30U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc0Index = 31U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc0Index = 32U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc0Index = 33U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToQdc0Index = 34U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToQdc0Index = 35U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToQdc0Index = 36U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToQdc0Index = 37U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToQdc0Index = 38U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToQdc0Index = 39U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToQdc0Index = 40U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToQdc0Index = 41U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToQdc0Index = 42U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToQdc0Index = 43U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToQdc0Index = 44U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToQdc0Index = 49U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToQdc0Index = 50U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToQdc0Index = 51U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToQdc0Index = 52U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToQdc0Index = 62U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig1ToQdc0Index = 63U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToQdc0Index = 64U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig1ToQdc0Index = 65U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToQdc0Index = 66U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig1ToQdc0Index = 67U + (QDC0_INDEX_REG << PMUX_SHIFT), - - /*!< Qdc0 Phaseb. */ - kINPUTMUX_ArmTxevToQdc0Phaseb = 1U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToQdc0Phaseb = 2U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToQdc0Phaseb = 3U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToQdc0Phaseb = 4U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToQdc0Phaseb = 5U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc0Phaseb = 6U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc0Phaseb = 7U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToQdc0Phaseb = 9U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc0Phaseb = 10U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToQdc0Phaseb = 11U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc0Phaseb = 12U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToQdc0Phaseb = 13U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc0Phaseb = 14U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToQdc0Phaseb = 16U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToQdc0Phaseb = 17U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToQdc0Phaseb = 18U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToQdc0Phaseb = 19U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToQdc0Phaseb = 20U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToQdc0Phaseb = 21U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc0Phaseb = 24U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc0Phaseb = 25U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc0Phaseb = 26U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc0Phaseb = 27U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc0Phaseb = 28U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc0Phaseb = 29U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc0Phaseb = 30U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc0Phaseb = 31U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc0Phaseb = 32U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc0Phaseb = 33U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToQdc0Phaseb = 34U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToQdc0Phaseb = 35U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToQdc0Phaseb = 36U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToQdc0Phaseb = 37U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToQdc0Phaseb = 38U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToQdc0Phaseb = 39U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToQdc0Phaseb = 40U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToQdc0Phaseb = 41U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToQdc0Phaseb = 42U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToQdc0Phaseb = 43U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToQdc0Phaseb = 44U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToQdc0Phaseb = 49U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToQdc0Phaseb = 50U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToQdc0Phaseb = 51U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToQdc0Phaseb = 52U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToQdc0Phaseb = 62U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig1ToQdc0Phaseb = 63U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToQdc0Phaseb = 64U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig1ToQdc0Phaseb = 65U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToQdc0Phaseb = 66U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig1ToQdc0Phaseb = 67U + (QDC0_PHASEB_REG << PMUX_SHIFT), - - /*!< Qdc0 Phasea. */ - kINPUTMUX_ArmTxevToQdc0Phasea = 1U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToQdc0Phasea = 2U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToQdc0Phasea = 3U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToQdc0Phasea = 4U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToQdc0Phasea = 5U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc0Phasea = 6U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc0Phasea = 7U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToQdc0Phasea = 9U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc0Phasea = 10U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToQdc0Phasea = 11U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc0Phasea = 12U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToQdc0Phasea = 13U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc0Phasea = 14U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToQdc0Phasea = 16U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToQdc0Phasea = 17U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToQdc0Phasea = 18U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToQdc0Phasea = 19U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToQdc0Phasea = 20U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToQdc0Phasea = 21U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc0Phasea = 24U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc0Phasea = 25U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc0Phasea = 26U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc0Phasea = 27U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc0Phasea = 28U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc0Phasea = 29U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc0Phasea = 30U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc0Phasea = 31U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc0Phasea = 32U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc0Phasea = 33U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToQdc0Phasea = 34U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToQdc0Phasea = 35U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToQdc0Phasea = 36U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToQdc0Phasea = 37U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToQdc0Phasea = 38U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToQdc0Phasea = 39U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToQdc0Phasea = 40U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToQdc0Phasea = 41U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToQdc0Phasea = 42U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToQdc0Phasea = 43U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToQdc0Phasea = 44U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToQdc0Phasea = 49U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToQdc0Phasea = 50U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToQdc0Phasea = 51U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToQdc0Phasea = 52U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToQdc0Phasea = 62U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig1ToQdc0Phasea = 63U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToQdc0Phasea = 64U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig1ToQdc0Phasea = 65U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToQdc0Phasea = 66U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig1ToQdc0Phasea = 67U + (QDC0_PHASEA_REG << PMUX_SHIFT), - - /*!< Qdc0 Icap1. */ - kINPUTMUX_ArmTxevToQdc0Icap1 = 1U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToQdc0Icap1 = 2U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToQdc0Icap1 = 3U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToQdc0Icap1 = 4U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToQdc0Icap1 = 5U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc0Icap1 = 6U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc0Icap1 = 7U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToQdc0Icap1 = 9U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc0Icap1 = 10U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToQdc0Icap1 = 11U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc0Icap1 = 12U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToQdc0Icap1 = 13U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc0Icap1 = 14U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToQdc0Icap1 = 16U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToQdc0Icap1 = 17U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToQdc0Icap1 = 18U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToQdc0Icap1 = 19U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToQdc0Icap1 = 20U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToQdc0Icap1 = 21U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc0Icap1 = 24U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc0Icap1 = 25U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc0Icap1 = 26U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc0Icap1 = 27U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc0Icap1 = 28U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc0Icap1 = 29U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc0Icap1 = 30U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc0Icap1 = 31U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc0Icap1 = 32U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc0Icap1 = 33U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToQdc0Icap1 = 34U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToQdc0Icap1 = 35U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToQdc0Icap1 = 36U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToQdc0Icap1 = 37U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToQdc0Icap1 = 38U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToQdc0Icap1 = 39U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToQdc0Icap1 = 40U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToQdc0Icap1 = 41U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToQdc0Icap1 = 42U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToQdc0Icap1 = 43U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToQdc0Icap1 = 44U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToQdc0Icap1 = 49U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToQdc0Icap1 = 50U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToQdc0Icap1 = 51U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToQdc0Icap1 = 52U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToQdc0Icap1 = 62U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig1ToQdc0Icap1 = 63U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToQdc0Icap1 = 64U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig1ToQdc0Icap1 = 65U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToQdc0Icap1 = 66U + (QDC0_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig1ToQdc0Icap1 = 67U + (QDC0_ICAP1_REG << PMUX_SHIFT), - - /*!< Qdc1 Trigger. */ - kINPUTMUX_ArmTxevToQdc1Trigger = 1U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToQdc1Trigger = 2U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToQdc1Trigger = 3U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToQdc1Trigger = 4U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToQdc1Trigger = 5U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc1Trigger = 6U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc1Trigger = 7U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToQdc1Trigger = 9U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc1Trigger = 10U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToQdc1Trigger = 11U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc1Trigger = 12U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToQdc1Trigger = 13U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc1Trigger = 14U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToQdc1Trigger = 16U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToQdc1Trigger = 17U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToQdc1Trigger = 18U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToQdc1Trigger = 19U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToQdc1Trigger = 20U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToQdc1Trigger = 21U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc1Trigger = 24U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc1Trigger = 25U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc1Trigger = 26U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc1Trigger = 27U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc1Trigger = 28U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc1Trigger = 29U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc1Trigger = 30U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc1Trigger = 31U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc1Trigger = 32U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc1Trigger = 33U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToQdc1Trigger = 34U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToQdc1Trigger = 35U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToQdc1Trigger = 36U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToQdc1Trigger = 37U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToQdc1Trigger = 38U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToQdc1Trigger = 39U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToQdc1Trigger = 40U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToQdc1Trigger = 41U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToQdc1Trigger = 42U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToQdc1Trigger = 43U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToQdc1Trigger = 44U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToQdc1Trigger = 49U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToQdc1Trigger = 50U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToQdc1Trigger = 51U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToQdc1Trigger = 52U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToQdc1Trigger = 62U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig1ToQdc1Trigger = 63U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToQdc1Trigger = 64U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig1ToQdc1Trigger = 65U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToQdc1Trigger = 66U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig1ToQdc1Trigger = 67U + (QDC1_TRIG_REG << PMUX_SHIFT), - - /*!< Qdc1 Home. */ - kINPUTMUX_ArmTxevToQdc1Home = 1U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToQdc1Home = 2U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToQdc1Home = 3U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToQdc1Home = 4U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToQdc1Home = 5U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc1Home = 6U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc1Home = 7U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToQdc1Home = 9U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc1Home = 10U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToQdc1Home = 11U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc1Home = 12U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToQdc1Home = 13U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc1Home = 14U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToQdc1Home = 16U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToQdc1Home = 17U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToQdc1Home = 18U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToQdc1Home = 19U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToQdc1Home = 20U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToQdc1Home = 21U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc1Home = 24U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc1Home = 25U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc1Home = 26U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc1Home = 27U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc1Home = 28U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc1Home = 29U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc1Home = 30U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc1Home = 31U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc1Home = 32U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc1Home = 33U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToQdc1Home = 34U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToQdc1Home = 35U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToQdc1Home = 36U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToQdc1Home = 37U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToQdc1Home = 38U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToQdc1Home = 39U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToQdc1Home = 40U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToQdc1Home = 41U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToQdc1Home = 42U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToQdc1Home = 43U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToQdc1Home = 44U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToQdc1Home = 49U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToQdc1Home = 50U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToQdc1Home = 51U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToQdc1Home = 52U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToQdc1Home = 62U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig1ToQdc1Home = 63U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToQdc1Home = 64U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig1ToQdc1Home = 65U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToQdc1Home = 66U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig1ToQdc1Home = 67U + (QDC1_HOME_REG << PMUX_SHIFT), - - /*!< Qdc1 Index. */ - kINPUTMUX_ArmTxevToQdc1Index = 1U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToQdc1Index = 2U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToQdc1Index = 3U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToQdc1Index = 4U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToQdc1Index = 5U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc1Index = 6U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc1Index = 7U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToQdc1Index = 9U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc1Index = 10U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToQdc1Index = 11U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc1Index = 12U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToQdc1Index = 13U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc1Index = 14U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToQdc1Index = 16U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToQdc1Index = 17U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToQdc1Index = 18U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToQdc1Index = 19U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToQdc1Index = 20U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToQdc1Index = 21U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc1Index = 24U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc1Index = 25U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc1Index = 26U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc1Index = 27U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc1Index = 28U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc1Index = 29U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc1Index = 30U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc1Index = 31U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc1Index = 32U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc1Index = 33U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToQdc1Index = 34U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToQdc1Index = 35U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToQdc1Index = 36U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToQdc1Index = 37U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToQdc1Index = 38U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToQdc1Index = 39U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToQdc1Index = 40U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToQdc1Index = 41U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToQdc1Index = 42U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToQdc1Index = 43U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToQdc1Index = 44U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToQdc1Index = 49U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToQdc1Index = 50U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToQdc1Index = 51U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToQdc1Index = 52U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToQdc1Index = 62U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig1ToQdc1Index = 63U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToQdc1Index = 64U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig1ToQdc1Index = 65U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToQdc1Index = 66U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig1ToQdc1Index = 67U + (QDC1_INDEX_REG << PMUX_SHIFT), - - /*!< Qdc1 Phaseb. */ - kINPUTMUX_ArmTxevToQdc1Phaseb = 1U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToQdc1Phaseb = 2U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToQdc1Phaseb = 3U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToQdc1Phaseb = 4U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToQdc1Phaseb = 5U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc1Phaseb = 6U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc1Phaseb = 7U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToQdc1Phaseb = 9U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc1Phaseb = 10U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToQdc1Phaseb = 11U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc1Phaseb = 12U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToQdc1Phaseb = 13U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc1Phaseb = 14U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToQdc1Phaseb = 16U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToQdc1Phaseb = 17U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToQdc1Phaseb = 18U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToQdc1Phaseb = 19U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToQdc1Phaseb = 20U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToQdc1Phaseb = 21U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc1Phaseb = 24U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc1Phaseb = 25U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc1Phaseb = 26U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc1Phaseb = 27U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc1Phaseb = 28U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc1Phaseb = 29U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc1Phaseb = 30U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc1Phaseb = 31U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc1Phaseb = 32U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc1Phaseb = 33U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToQdc1Phaseb = 34U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToQdc1Phaseb = 35U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToQdc1Phaseb = 36U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToQdc1Phaseb = 37U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToQdc1Phaseb = 38U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToQdc1Phaseb = 39U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToQdc1Phaseb = 40U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToQdc1Phaseb = 41U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToQdc1Phaseb = 42U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToQdc1Phaseb = 43U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToQdc1Phaseb = 44U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToQdc1Phaseb = 49U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToQdc1Phaseb = 50U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToQdc1Phaseb = 51U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToQdc1Phaseb = 52U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToQdc1Phaseb = 62U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig1ToQdc1Phaseb = 63U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToQdc1Phaseb = 64U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig1ToQdc1Phaseb = 65U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToQdc1Phaseb = 66U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig1ToQdc1Phaseb = 67U + (QDC1_PHASEB_REG << PMUX_SHIFT), - - /*!< Qdc1 Phasea. */ - kINPUTMUX_ArmTxevToQdc1Phasea = 1U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToQdc1Phasea = 2U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToQdc1Phasea = 3U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToQdc1Phasea = 4U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToQdc1Phasea = 5U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc1Phasea = 6U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc1Phasea = 7U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToQdc1Phasea = 9U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc1Phasea = 10U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToQdc1Phasea = 11U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc1Phasea = 12U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToQdc1Phasea = 13U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc1Phasea = 14U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToQdc1Phasea = 16U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToQdc1Phasea = 17U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToQdc1Phasea = 18U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToQdc1Phasea = 19U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToQdc1Phasea = 20U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToQdc1Phasea = 21U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc1Phasea = 24U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc1Phasea = 25U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc1Phasea = 26U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc1Phasea = 27U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc1Phasea = 28U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc1Phasea = 29U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc1Phasea = 30U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc1Phasea = 31U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc1Phasea = 32U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc1Phasea = 33U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToQdc1Phasea = 34U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToQdc1Phasea = 35U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToQdc1Phasea = 36U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToQdc1Phasea = 37U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToQdc1Phasea = 38U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToQdc1Phasea = 39U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToQdc1Phasea = 40U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToQdc1Phasea = 41U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToQdc1Phasea = 42U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToQdc1Phasea = 43U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToQdc1Phasea = 44U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToQdc1Phasea = 49U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToQdc1Phasea = 50U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToQdc1Phasea = 51U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToQdc1Phasea = 52U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToQdc1Phasea = 62U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig1ToQdc1Phasea = 63U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToQdc1Phasea = 64U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig1ToQdc1Phasea = 65U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToQdc1Phasea = 66U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig1ToQdc1Phasea = 67U + (QDC1_PHASEA_REG << PMUX_SHIFT), - - /*!< Qdc1 Icap1. */ - kINPUTMUX_ArmTxevToQdc1Icap1 = 1U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToQdc1Icap1 = 2U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToQdc1Icap1 = 3U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToQdc1Icap1 = 4U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToQdc1Icap1 = 5U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc1Icap1 = 6U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc1Icap1 = 7U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToQdc1Icap1 = 9U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc1Icap1 = 10U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToQdc1Icap1 = 11U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc1Icap1 = 12U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToQdc1Icap1 = 13U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc1Icap1 = 14U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToQdc1Icap1 = 16U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToQdc1Icap1 = 17U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToQdc1Icap1 = 18U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToQdc1Icap1 = 19U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToQdc1Icap1 = 20U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToQdc1Icap1 = 21U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc1Icap1 = 24U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc1Icap1 = 25U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc1Icap1 = 26U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc1Icap1 = 27U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc1Icap1 = 28U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc1Icap1 = 29U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc1Icap1 = 30U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc1Icap1 = 31U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc1Icap1 = 32U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc1Icap1 = 33U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToQdc1Icap1 = 34U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToQdc1Icap1 = 35U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToQdc1Icap1 = 36U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToQdc1Icap1 = 37U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToQdc1Icap1 = 38U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToQdc1Icap1 = 39U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToQdc1Icap1 = 40U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToQdc1Icap1 = 41U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToQdc1Icap1 = 42U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToQdc1Icap1 = 43U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToQdc1Icap1 = 44U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToQdc1Icap1 = 49U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToQdc1Icap1 = 50U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToQdc1Icap1 = 51U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToQdc1Icap1 = 52U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToQdc1Icap1 = 62U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig1ToQdc1Icap1 = 63U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToQdc1Icap1 = 64U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig1ToQdc1Icap1 = 65U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToQdc1Icap1 = 66U + (QDC1_ICAP1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig1ToQdc1Icap1 = 67U + (QDC1_ICAP1_REG << PMUX_SHIFT), - - /*!< FlexPWM0_SM0_EXTA0 input trigger connections. */ - kINPUTMUX_ArmTxevToFlexPwm0Sm0Exta0 = 1U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToFlexPwm0Sm0Exta0 = 2U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToFlexPwm0Sm0Exta0 = 3U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToFlexPwm0Sm0Exta0 = 4U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToFlexPwm0Sm0Exta0 = 5U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Sm0Exta0 = 6U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Sm0Exta0 = 7U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToFlexPwm0Sm0Exta0 = 9U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Sm0Exta0 = 10U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToFlexPwm0Sm0Exta0 = 11U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Sm0Exta0 = 12U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToFlexPwm0Sm0Exta0 = 13U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Sm0Exta0 = 14U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToFlexPwm0Sm0Exta0 = 15U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToFlexPwm0Sm0Exta0 = 16U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToFlexPwm0Sm0Exta0 = 17U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToFlexPwm0Sm0Exta0 = 18U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToFlexPwm0Sm0Exta0 = 19U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Sm0Exta0 = 20U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Sm0Exta0 = 21U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Sm0Exta0 = 22U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Sm0Exta0 = 23U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Sm0Exta0 = 24U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Sm0Exta0 = 25U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Sm0Exta0 = 26U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Sm0Exta0 = 27U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Sm0Exta0 = 28U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Sm0Exta0 = 29U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexPwm0Sm0Exta0 = 30U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexPwm0Sm0Exta0 = 31U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToFlexPwm0Sm0Exta0 = 32U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToFlexPwm0Sm0Exta0 = 33U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Sm0Exta0 = 34U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Sm0Exta0 = 35U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToFlexPwm0Sm0Exta0 = 36U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToFlexPwm0Sm0Exta0 = 37U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToFlexPwm0Sm0Exta0 = 38U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToFlexPwm0Sm0Exta0 = 39U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToFlexPwm0Sm0Exta0 = 40U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToFlexPwm0Sm0Exta0 = 45U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToFlexPwm0Sm0Exta0 = 46U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToFlexPwm0Sm0Exta0 = 47U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToFlexPwm0Sm0Exta0 = 48U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag0ToFlexPwm0Sm0Exta0 = 49U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag1ToFlexPwm0Sm0Exta0 = 50U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag2ToFlexPwm0Sm0Exta0 = 51U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag3ToFlexPwm0Sm0Exta0 = 52U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatch0ToFlexPwm0Sm0Exta0 = 53U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToFlexPwm0Sm0Exta0 = 54U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig1ToFlexPwm0Sm0Exta0 = 55U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToFlexPwm0Sm0Exta0 = 56U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig1ToFlexPwm0Sm0Exta0 = 57U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToFlexPwm0Sm0Exta0 = 58U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig1ToFlexPwm0Sm0Exta0 = 59U + (FlexPWM0_SM0_EXTA0_REG << PMUX_SHIFT), - - /*!< FlexPWM0_SM1_EXTA1 input trigger connections. */ - kINPUTMUX_ArmTxevToFlexPwm0Sm1Exta1 = 1U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToFlexPwm0Sm1Exta1 = 2U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToFlexPwm0Sm1Exta1 = 3U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToFlexPwm0Sm1Exta1 = 4U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToFlexPwm0Sm1Exta1 = 5U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Sm1Exta1 = 6U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Sm1Exta1 = 7U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToFlexPwm0Sm1Exta1 = 9U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Sm1Exta1 = 10U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToFlexPwm0Sm1Exta1 = 11U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Sm1Exta1 = 12U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToFlexPwm0Sm1Exta1 = 13U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Sm1Exta1 = 14U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToFlexPwm0Sm1Exta1 = 15U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToFlexPwm0Sm1Exta1 = 16U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToFlexPwm0Sm1Exta1 = 17U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToFlexPwm0Sm1Exta1 = 18U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToFlexPwm0Sm1Exta1 = 19U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Sm1Exta1 = 20U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Sm1Exta1 = 21U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Sm1Exta1 = 22U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Sm1Exta1 = 23U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Sm1Exta1 = 24U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Sm1Exta1 = 25U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Sm1Exta1 = 26U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Sm1Exta1 = 27U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Sm1Exta1 = 28U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Sm1Exta1 = 29U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexPwm0Sm1Exta1 = 30U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexPwm0Sm1Exta1 = 31U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToFlexPwm0Sm1Exta1 = 32U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToFlexPwm0Sm1Exta1 = 33U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Sm1Exta1 = 34U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Sm1Exta1 = 35U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToFlexPwm0Sm1Exta1 = 36U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToFlexPwm0Sm1Exta1 = 37U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToFlexPwm0Sm1Exta1 = 38U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToFlexPwm0Sm1Exta1 = 39U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToFlexPwm0Sm1Exta1 = 40U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToFlexPwm0Sm1Exta1 = 45U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToFlexPwm0Sm1Exta1 = 46U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToFlexPwm0Sm1Exta1 = 47U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToFlexPwm0Sm1Exta1 = 48U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag0ToFlexPwm0Sm1Exta1 = 49U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag1ToFlexPwm0Sm1Exta1 = 50U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag2ToFlexPwm0Sm1Exta1 = 51U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag3ToFlexPwm0Sm1Exta1 = 52U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatch0ToFlexPwm0Sm1Exta1 = 53U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToFlexPwm0Sm1Exta1 = 54U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig1ToFlexPwm0Sm1Exta1 = 55U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToFlexPwm0Sm1Exta1 = 56U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig1ToFlexPwm0Sm1Exta1 = 57U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToFlexPwm0Sm1Exta1 = 58U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig1ToFlexPwm0Sm1Exta1 = 59U + (FlexPWM0_SM1_EXTA1_REG << PMUX_SHIFT), - - /*!< FlexPWM0_SM2_EXTA2 input trigger connections. */ - kINPUTMUX_ArmTxevToFlexPwm0Sm2Exta2 = 1U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToFlexPwm0Sm2Exta2 = 2U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToFlexPwm0Sm2Exta2 = 3U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToFlexPwm0Sm2Exta2 = 4U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToFlexPwm0Sm2Exta2 = 5U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Sm2Exta2 = 6U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Sm2Exta2 = 7U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToFlexPwm0Sm2Exta2 = 9U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Sm2Exta2 = 10U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToFlexPwm0Sm2Exta2 = 11U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Sm2Exta2 = 12U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToFlexPwm0Sm2Exta2 = 13U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Sm2Exta2 = 14U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToFlexPwm0Sm2Exta2 = 15U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToFlexPwm0Sm2Exta2 = 16U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToFlexPwm0Sm2Exta2 = 17U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToFlexPwm0Sm2Exta2 = 18U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToFlexPwm0Sm2Exta2 = 19U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Sm2Exta2 = 20U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Sm2Exta2 = 21U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Sm2Exta2 = 22U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Sm2Exta2 = 23U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Sm2Exta2 = 24U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Sm2Exta2 = 25U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Sm2Exta2 = 26U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Sm2Exta2 = 27U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Sm2Exta2 = 28U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Sm2Exta2 = 29U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexPwm0Sm2Exta2 = 30U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexPwm0Sm2Exta2 = 31U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToFlexPwm0Sm2Exta2 = 32U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToFlexPwm0Sm2Exta2 = 33U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Sm2Exta2 = 34U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Sm2Exta2 = 35U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToFlexPwm0Sm2Exta2 = 36U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToFlexPwm0Sm2Exta2 = 37U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToFlexPwm0Sm2Exta2 = 38U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToFlexPwm0Sm2Exta2 = 39U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToFlexPwm0Sm2Exta2 = 40U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToFlexPwm0Sm2Exta2 = 45U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToFlexPwm0Sm2Exta2 = 46U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToFlexPwm0Sm2Exta2 = 47U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToFlexPwm0Sm2Exta2 = 48U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag0ToFlexPwm0Sm2Exta2 = 49U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag1ToFlexPwm0Sm2Exta2 = 50U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag2ToFlexPwm0Sm2Exta2 = 51U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag3ToFlexPwm0Sm2Exta2 = 52U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatch0ToFlexPwm0Sm2Exta2 = 53U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToFlexPwm0Sm2Exta2 = 54U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig1ToFlexPwm0Sm2Exta2 = 55U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToFlexPwm0Sm2Exta2 = 56U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig1ToFlexPwm0Sm2Exta2 = 57U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToFlexPwm0Sm2Exta2 = 58U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig1ToFlexPwm0Sm2Exta2 = 59U + (FlexPWM0_SM2_EXTA2_REG << PMUX_SHIFT), - - /*!< FlexPWM0_SM0_EXTSYNC0 input trigger connections. */ - kINPUTMUX_ArmTxevToFlexPwm0Sm0Extsync0 = 1U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToFlexPwm0Sm0Extsync0 = 2U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToFlexPwm0Sm0Extsync0 = 3U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToFlexPwm0Sm0Extsync0 = 4U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToFlexPwm0Sm0Extsync0 = 5U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Sm0Extsync0 = 6U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Sm0Extsync0 = 7U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToFlexPwm0Sm0Extsync0 = 9U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Sm0Extsync0 = 10U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToFlexPwm0Sm0Extsync0 = 11U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Sm0Extsync0 = 12U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToFlexPwm0Sm0Extsync0 = 13U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Sm0Extsync0 = 14U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToFlexPwm0Sm0Extsync0 = 15U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToFlexPwm0Sm0Extsync0 = 16U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToFlexPwm0Sm0Extsync0 = 17U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToFlexPwm0Sm0Extsync0 = 18U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToFlexPwm0Sm0Extsync0 = 19U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Sm0Extsync0 = 20U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Sm0Extsync0 = 21U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Sm0Extsync0 = 22U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Sm0Extsync0 = 23U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Sm0Extsync0 = 24U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Sm0Extsync0 = 25U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Sm0Extsync0 = 26U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Sm0Extsync0 = 27U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Sm0Extsync0 = 28U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Sm0Extsync0 = 29U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexPwm0Sm0Extsync0 = 30U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexPwm0Sm0Extsync0 = 31U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToFlexPwm0Sm0Extsync0 = 32U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToFlexPwm0Sm0Extsync0 = 33U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Sm0Extsync0 = 34U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Sm0Extsync0 = 35U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToFlexPwm0Sm0Extsync0 = 36U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToFlexPwm0Sm0Extsync0 = 37U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToFlexPwm0Sm0Extsync0 = 38U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToFlexPwm0Sm0Extsync0 = 39U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToFlexPwm0Sm0Extsync0 = 40U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToFlexPwm0Sm0Extsync0 = 45U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToFlexPwm0Sm0Extsync0 = 46U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToFlexPwm0Sm0Extsync0 = 47U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToFlexPwm0Sm0Extsync0 = 48U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag0ToFlexPwm0Sm0Extsync0 = 49U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag1ToFlexPwm0Sm0Extsync0 = 50U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag2ToFlexPwm0Sm0Extsync0 = 51U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag3ToFlexPwm0Sm0Extsync0 = 52U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatch0ToFlexPwm0Sm0Extsync0 = 53U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToFlexPwm0Sm0Extsync0 = 54U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig1ToFlexPwm0Sm0Extsync0 = 55U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToFlexPwm0Sm0Extsync0 = 56U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig1ToFlexPwm0Sm0Extsync0 = 57U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToFlexPwm0Sm0Extsync0 = 58U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig1ToFlexPwm0Sm0Extsync0 = 59U + (FlexPWM0_SM0_EXTSYNC0_REG << PMUX_SHIFT), - - /*!< FlexPWM0_SM1_EXTSYNC1 input trigger connections. */ - kINPUTMUX_ArmTxevToFlexPwm0Sm1Extsync1 = 1U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToFlexPwm0Sm1Extsync1 = 2U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToFlexPwm0Sm1Extsync1 = 3U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToFlexPwm0Sm1Extsync1 = 4U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToFlexPwm0Sm1Extsync1 = 5U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Sm1Extsync1 = 6U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Sm1Extsync1 = 7U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToFlexPwm0Sm1Extsync1 = 9U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Sm1Extsync1 = 10U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToFlexPwm0Sm1Extsync1 = 11U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Sm1Extsync1 = 12U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToFlexPwm0Sm1Extsync1 = 13U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Sm1Extsync1 = 14U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToFlexPwm0Sm1Extsync1 = 15U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToFlexPwm0Sm1Extsync1 = 16U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToFlexPwm0Sm1Extsync1 = 17U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToFlexPwm0Sm1Extsync1 = 18U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToFlexPwm0Sm1Extsync1 = 19U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Sm1Extsync1 = 20U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Sm1Extsync1 = 21U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Sm1Extsync1 = 22U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Sm1Extsync1 = 23U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Sm1Extsync1 = 24U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Sm1Extsync1 = 25U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Sm1Extsync1 = 26U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Sm1Extsync1 = 27U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Sm1Extsync1 = 28U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Sm1Extsync1 = 29U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexPwm0Sm1Extsync1 = 30U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexPwm0Sm1Extsync1 = 31U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToFlexPwm0Sm1Extsync1 = 32U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToFlexPwm0Sm1Extsync1 = 33U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Sm1Extsync1 = 34U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Sm1Extsync1 = 35U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToFlexPwm0Sm1Extsync1 = 36U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToFlexPwm0Sm1Extsync1 = 37U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToFlexPwm0Sm1Extsync1 = 38U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToFlexPwm0Sm1Extsync1 = 39U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToFlexPwm0Sm1Extsync1 = 40U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToFlexPwm0Sm1Extsync1 = 45U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToFlexPwm0Sm1Extsync1 = 46U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToFlexPwm0Sm1Extsync1 = 47U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToFlexPwm0Sm1Extsync1 = 48U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag0ToFlexPwm0Sm1Extsync1 = 49U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag1ToFlexPwm0Sm1Extsync1 = 50U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag2ToFlexPwm0Sm1Extsync1 = 51U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag3ToFlexPwm0Sm1Extsync1 = 52U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatch0ToFlexPwm0Sm1Extsync1 = 53U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToFlexPwm0Sm1Extsync1 = 54U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig1ToFlexPwm0Sm1Extsync1 = 55U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToFlexPwm0Sm1Extsync1 = 56U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig1ToFlexPwm0Sm1Extsync1 = 57U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToFlexPwm0Sm1Extsync1 = 58U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig1ToFlexPwm0Sm1Extsync1 = 59U + (FlexPWM0_SM1_EXTSYNC1_REG << PMUX_SHIFT), - - /*!< FlexPWM0_SM2_EXTSYNC2 input trigger connections. */ - kINPUTMUX_ArmTxevToFlexPwm0Sm2Extsync2 = 1U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToFlexPwm0Sm2Extsync2 = 2U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToFlexPwm0Sm2Extsync2 = 3U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToFlexPwm0Sm2Extsync2 = 4U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToFlexPwm0Sm2Extsync2 = 5U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Sm2Extsync2 = 6U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Sm2Extsync2 = 7U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToFlexPwm0Sm2Extsync2 = 9U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Sm2Extsync2 = 10U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToFlexPwm0Sm2Extsync2 = 11U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Sm2Extsync2 = 12U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToFlexPwm0Sm2Extsync2 = 13U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Sm2Extsync2 = 14U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToFlexPwm0Sm2Extsync2 = 15U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToFlexPwm0Sm2Extsync2 = 16U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToFlexPwm0Sm2Extsync2 = 17U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToFlexPwm0Sm2Extsync2 = 18U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToFlexPwm0Sm2Extsync2 = 19U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Sm2Extsync2 = 20U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Sm2Extsync2 = 21U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Sm2Extsync2 = 22U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Sm2Extsync2 = 23U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Sm2Extsync2 = 24U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Sm2Extsync2 = 25U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Sm2Extsync2 = 26U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Sm2Extsync2 = 27U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Sm2Extsync2 = 28U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Sm2Extsync2 = 29U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexPwm0Sm2Extsync2 = 30U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexPwm0Sm2Extsync2 = 31U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToFlexPwm0Sm2Extsync2 = 32U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToFlexPwm0Sm2Extsync2 = 33U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Sm2Extsync2 = 34U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Sm2Extsync2 = 35U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToFlexPwm0Sm2Extsync2 = 36U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToFlexPwm0Sm2Extsync2 = 37U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToFlexPwm0Sm2Extsync2 = 38U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToFlexPwm0Sm2Extsync2 = 39U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToFlexPwm0Sm2Extsync2 = 40U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToFlexPwm0Sm2Extsync2 = 45U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToFlexPwm0Sm2Extsync2 = 46U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToFlexPwm0Sm2Extsync2 = 47U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToFlexPwm0Sm2Extsync2 = 48U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag0ToFlexPwm0Sm2Extsync2 = 49U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag1ToFlexPwm0Sm2Extsync2 = 50U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag2ToFlexPwm0Sm2Extsync2 = 51U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag3ToFlexPwm0Sm2Extsync2 = 52U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatch0ToFlexPwm0Sm2Extsync2 = 53U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToFlexPwm0Sm2Extsync2 = 54U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig1ToFlexPwm0Sm2Extsync2 = 55U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToFlexPwm0Sm2Extsync2 = 56U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig1ToFlexPwm0Sm2Extsync2 = 57U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToFlexPwm0Sm2Extsync2 = 58U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig1ToFlexPwm0Sm2Extsync2 = 59U + (FlexPWM0_SM2_EXTSYNC2_REG << PMUX_SHIFT), - - /*!< FlexPWM0_FAULT input trigger connections. */ - kINPUTMUX_ArmTxevToFlexPwm0Fault = 1U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToFlexPwm0Fault = 2U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToFlexPwm0Fault = 3U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToFlexPwm0Fault = 4U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToFlexPwm0Fault = 5U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Fault = 6U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Fault = 7U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToFlexPwm0Fault = 9U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Fault = 10U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToFlexPwm0Fault = 11U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Fault = 12U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToFlexPwm0Fault = 13U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Fault = 14U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToFlexPwm0Fault = 15U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToFlexPwm0Fault = 16U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToFlexPwm0Fault = 17U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToFlexPwm0Fault = 18U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToFlexPwm0Fault = 19U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Fault = 20U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Fault = 21U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Fault = 22U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Fault = 23U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Fault = 24U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Fault = 25U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Fault = 26U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Fault = 27U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Fault = 28U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Fault = 29U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexPwm0Fault = 30U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexPwm0Fault = 31U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToFlexPwm0Fault = 32U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToFlexPwm0Fault = 33U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Fault = 34U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Fault = 35U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToFlexPwm0Fault = 36U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToFlexPwm0Fault = 37U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToFlexPwm0Fault = 38U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToFlexPwm0Fault = 39U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToFlexPwm0Fault = 40U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToFlexPwm0Fault = 45U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToFlexPwm0Fault = 46U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToFlexPwm0Fault = 47U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToFlexPwm0Fault = 48U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag0ToFlexPwm0Fault = 49U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag1ToFlexPwm0Fault = 50U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag2ToFlexPwm0Fault = 51U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag3ToFlexPwm0Fault = 52U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatch0ToFlexPwm0Fault = 53U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToFlexPwm0Fault = 54U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig1ToFlexPwm0Fault = 55U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToFlexPwm0Fault = 56U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig1ToFlexPwm0Fault = 57U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToFlexPwm0Fault = 58U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig1ToFlexPwm0Fault = 59U + (FlexPWM0_FAULT_REG << PMUX_SHIFT), - - /*!< FlexPWM0_FORCE input trigger connections. */ - kINPUTMUX_ArmTxevToFlexPwm0Force = 1U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToFlexPwm0Force = 2U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToFlexPwm0Force = 3U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToFlexPwm0Force = 4U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToFlexPwm0Force = 5U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Force = 6U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Force = 7U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToFlexPwm0Force = 9U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Force = 10U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToFlexPwm0Force = 11U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Force = 12U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToFlexPwm0Force = 13U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Force = 14U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToFlexPwm0Force = 15U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToFlexPwm0Force = 16U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToFlexPwm0Force = 17U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToFlexPwm0Force = 18U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToFlexPwm0Force = 19U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Force = 20U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Force = 21U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Force = 22U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Force = 23U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Force = 24U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Force = 25U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Force = 26U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Force = 27U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Force = 28U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Force = 29U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexPwm0Force = 30U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexPwm0Force = 31U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToFlexPwm0Force = 32U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToFlexPwm0Force = 33U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Force = 34U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Force = 35U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToFlexPwm0Force = 36U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToFlexPwm0Force = 37U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToFlexPwm0Force = 38U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToFlexPwm0Force = 39U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToFlexPwm0Force = 40U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToFlexPwm0Force = 45U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToFlexPwm0Force = 46U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToFlexPwm0Force = 47U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToFlexPwm0Force = 48U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag0ToFlexPwm0Force = 49U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag1ToFlexPwm0Force = 50U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag2ToFlexPwm0Force = 51U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag3ToFlexPwm0Force = 52U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatch0ToFlexPwm0Force = 53U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToFlexPwm0Force = 54U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig1ToFlexPwm0Force = 55U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToFlexPwm0Force = 56U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig1ToFlexPwm0Force = 57U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToFlexPwm0Force = 58U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig1ToFlexPwm0Force = 59U + (FlexPWM0_FORCE_REG << PMUX_SHIFT), - - /*!< FlexPWM1_SM0_EXTA0 input trigger connections. */ - kINPUTMUX_ArmTxevToFlexPwm1Sm0Exta0 = 1U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToFlexPwm1Sm0Exta0 = 2U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToFlexPwm1Sm0Exta0 = 3U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToFlexPwm1Sm0Exta0 = 4U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToFlexPwm1Sm0Exta0 = 5U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Sm0Exta0 = 6U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Sm0Exta0 = 7U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToFlexPwm1Sm0Exta0 = 9U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Sm0Exta0 = 10U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToFlexPwm1Sm0Exta0 = 11U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Sm0Exta0 = 12U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToFlexPwm1Sm0Exta0 = 13U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Sm0Exta0 = 14U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToFlexPwm1Sm0Exta0 = 15U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToFlexPwm1Sm0Exta0 = 16U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToFlexPwm1Sm0Exta0 = 17U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToFlexPwm1Sm0Exta0 = 18U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToFlexPwm1Sm0Exta0 = 19U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Sm0Exta0 = 20U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Sm0Exta0 = 21U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Sm0Exta0 = 22U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Sm0Exta0 = 23U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Sm0Exta0 = 24U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Sm0Exta0 = 25U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Sm0Exta0 = 26U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Sm0Exta0 = 27U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Sm0Exta0 = 28U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Sm0Exta0 = 29U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexPwm1Sm0Exta0 = 30U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexPwm1Sm0Exta0 = 31U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToFlexPwm1Sm0Exta0 = 32U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToFlexPwm1Sm0Exta0 = 33U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Sm0Exta0 = 34U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Sm0Exta0 = 35U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToFlexPwm1Sm0Exta0 = 36U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToFlexPwm1Sm0Exta0 = 37U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToFlexPwm1Sm0Exta0 = 38U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToFlexPwm1Sm0Exta0 = 39U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToFlexPwm1Sm0Exta0 = 40U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToFlexPwm1Sm0Exta0 = 45U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToFlexPwm1Sm0Exta0 = 46U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToFlexPwm1Sm0Exta0 = 47U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToFlexPwm1Sm0Exta0 = 48U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag0ToFlexPwm1Sm0Exta0 = 49U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag1ToFlexPwm1Sm0Exta0 = 50U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag2ToFlexPwm1Sm0Exta0 = 51U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag3ToFlexPwm1Sm0Exta0 = 52U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatch0ToFlexPwm1Sm0Exta0 = 53U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToFlexPwm1Sm0Exta0 = 54U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToFlexPwm1Sm0Exta0 = 55U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToFlexPwm1Sm0Exta0 = 56U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToFlexPwm1Sm0Exta0 = 57U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToFlexPwm1Sm0Exta0 = 58U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToFlexPwm1Sm0Exta0 = 59U + (FlexPWM1_SM0_EXTA0_REG << PMUX_SHIFT), - - /*!< FlexPWM1_SM1_EXTA1 input trigger connections. */ - kINPUTMUX_ArmTxevToFlexPwm1Sm1Exta1 = 1U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToFlexPwm1Sm1Exta1 = 2U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToFlexPwm1Sm1Exta1 = 3U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToFlexPwm1Sm1Exta1 = 4U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToFlexPwm1Sm1Exta1 = 5U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Sm1Exta1 = 6U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Sm1Exta1 = 7U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToFlexPwm1Sm1Exta1 = 9U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Sm1Exta1 = 10U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToFlexPwm1Sm1Exta1 = 11U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Sm1Exta1 = 12U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToFlexPwm1Sm1Exta1 = 13U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Sm1Exta1 = 14U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToFlexPwm1Sm1Exta1 = 15U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToFlexPwm1Sm1Exta1 = 16U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToFlexPwm1Sm1Exta1 = 17U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToFlexPwm1Sm1Exta1 = 18U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToFlexPwm1Sm1Exta1 = 19U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Sm1Exta1 = 20U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Sm1Exta1 = 21U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Sm1Exta1 = 22U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Sm1Exta1 = 23U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Sm1Exta1 = 24U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Sm1Exta1 = 25U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Sm1Exta1 = 26U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Sm1Exta1 = 27U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Sm1Exta1 = 28U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Sm1Exta1 = 29U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexPwm1Sm1Exta1 = 30U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexPwm1Sm1Exta1 = 31U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToFlexPwm1Sm1Exta1 = 32U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToFlexPwm1Sm1Exta1 = 33U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Sm1Exta1 = 34U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Sm1Exta1 = 35U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToFlexPwm1Sm1Exta1 = 36U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToFlexPwm1Sm1Exta1 = 37U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToFlexPwm1Sm1Exta1 = 38U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToFlexPwm1Sm1Exta1 = 39U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToFlexPwm1Sm1Exta1 = 40U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToFlexPwm1Sm1Exta1 = 45U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToFlexPwm1Sm1Exta1 = 46U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToFlexPwm1Sm1Exta1 = 47U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToFlexPwm1Sm1Exta1 = 48U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag0ToFlexPwm1Sm1Exta1 = 49U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag1ToFlexPwm1Sm1Exta1 = 50U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag2ToFlexPwm1Sm1Exta1 = 51U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag3ToFlexPwm1Sm1Exta1 = 52U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatch0ToFlexPwm1Sm1Exta1 = 53U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToFlexPwm1Sm1Exta1 = 54U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToFlexPwm1Sm1Exta1 = 55U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToFlexPwm1Sm1Exta1 = 56U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToFlexPwm1Sm1Exta1 = 57U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToFlexPwm1Sm1Exta1 = 58U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToFlexPwm1Sm1Exta1 = 59U + (FlexPWM1_SM1_EXTA1_REG << PMUX_SHIFT), - - /*!< FlexPWM1_SM2_EXTA2 input trigger connections. */ - kINPUTMUX_ArmTxevToFlexPwm1Sm2Exta2 = 1U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToFlexPwm1Sm2Exta2 = 2U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToFlexPwm1Sm2Exta2 = 3U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToFlexPwm1Sm2Exta2 = 4U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToFlexPwm1Sm2Exta2 = 5U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Sm2Exta2 = 6U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Sm2Exta2 = 7U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToFlexPwm1Sm2Exta2 = 9U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Sm2Exta2 = 10U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToFlexPwm1Sm2Exta2 = 11U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Sm2Exta2 = 12U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToFlexPwm1Sm2Exta2 = 13U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Sm2Exta2 = 14U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToFlexPwm1Sm2Exta2 = 15U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToFlexPwm1Sm2Exta2 = 16U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToFlexPwm1Sm2Exta2 = 17U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToFlexPwm1Sm2Exta2 = 18U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToFlexPwm1Sm2Exta2 = 19U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Sm2Exta2 = 20U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Sm2Exta2 = 21U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Sm2Exta2 = 22U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Sm2Exta2 = 23U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Sm2Exta2 = 24U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Sm2Exta2 = 25U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Sm2Exta2 = 26U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Sm2Exta2 = 27U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Sm2Exta2 = 28U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Sm2Exta2 = 29U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexPwm1Sm2Exta2 = 30U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexPwm1Sm2Exta2 = 31U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToFlexPwm1Sm2Exta2 = 32U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToFlexPwm1Sm2Exta2 = 33U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Sm2Exta2 = 34U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Sm2Exta2 = 35U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToFlexPwm1Sm2Exta2 = 36U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToFlexPwm1Sm2Exta2 = 37U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToFlexPwm1Sm2Exta2 = 38U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToFlexPwm1Sm2Exta2 = 39U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToFlexPwm1Sm2Exta2 = 40U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToFlexPwm1Sm2Exta2 = 45U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToFlexPwm1Sm2Exta2 = 46U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToFlexPwm1Sm2Exta2 = 47U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToFlexPwm1Sm2Exta2 = 48U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag0ToFlexPwm1Sm2Exta2 = 49U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag1ToFlexPwm1Sm2Exta2 = 50U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag2ToFlexPwm1Sm2Exta2 = 51U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag3ToFlexPwm1Sm2Exta2 = 52U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatch0ToFlexPwm1Sm2Exta2 = 53U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToFlexPwm1Sm2Exta2 = 54U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToFlexPwm1Sm2Exta2 = 55U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToFlexPwm1Sm2Exta2 = 56U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToFlexPwm1Sm2Exta2 = 57U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToFlexPwm1Sm2Exta2 = 58U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToFlexPwm1Sm2Exta2 = 59U + (FlexPWM1_SM2_EXTA2_REG << PMUX_SHIFT), - - /*!< FlexPWM1_SM0_EXTSYNC0 input trigger connections. */ - kINPUTMUX_ArmTxevToFlexPwm1Sm0Extsync0 = 1U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToFlexPwm1Sm0Extsync0 = 2U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToFlexPwm1Sm0Extsync0 = 3U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToFlexPwm1Sm0Extsync0 = 4U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToFlexPwm1Sm0Extsync0 = 5U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Sm0Extsync0 = 6U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Sm0Extsync0 = 7U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToFlexPwm1Sm0Extsync0 = 9U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Sm0Extsync0 = 10U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToFlexPwm1Sm0Extsync0 = 11U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Sm0Extsync0 = 12U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToFlexPwm1Sm0Extsync0 = 13U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Sm0Extsync0 = 14U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToFlexPwm1Sm0Extsync0 = 15U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToFlexPwm1Sm0Extsync0 = 16U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToFlexPwm1Sm0Extsync0 = 17U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToFlexPwm1Sm0Extsync0 = 18U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToFlexPwm1Sm0Extsync0 = 19U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Sm0Extsync0 = 20U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Sm0Extsync0 = 21U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Sm0Extsync0 = 22U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Sm0Extsync0 = 23U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Sm0Extsync0 = 24U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Sm0Extsync0 = 25U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Sm0Extsync0 = 26U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Sm0Extsync0 = 27U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Sm0Extsync0 = 28U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Sm0Extsync0 = 29U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexPwm1Sm0Extsync0 = 30U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexPwm1Sm0Extsync0 = 31U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToFlexPwm1Sm0Extsync0 = 32U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToFlexPwm1Sm0Extsync0 = 33U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Sm0Extsync0 = 34U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Sm0Extsync0 = 35U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToFlexPwm1Sm0Extsync0 = 36U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToFlexPwm1Sm0Extsync0 = 37U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToFlexPwm1Sm0Extsync0 = 38U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToFlexPwm1Sm0Extsync0 = 39U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToFlexPwm1Sm0Extsync0 = 40U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToFlexPwm1Sm0Extsync0 = 45U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToFlexPwm1Sm0Extsync0 = 46U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToFlexPwm1Sm0Extsync0 = 47U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToFlexPwm1Sm0Extsync0 = 48U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag0ToFlexPwm1Sm0Extsync0 = 49U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag1ToFlexPwm1Sm0Extsync0 = 50U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag2ToFlexPwm1Sm0Extsync0 = 51U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag3ToFlexPwm1Sm0Extsync0 = 52U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatch0ToFlexPwm1Sm0Extsync0 = 53U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToFlexPwm1Sm0Extsync0 = 54U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToFlexPwm1Sm0Extsync0 = 55U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToFlexPwm1Sm0Extsync0 = 56U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToFlexPwm1Sm0Extsync0 = 57U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToFlexPwm1Sm0Extsync0 = 58U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToFlexPwm1Sm0Extsync0 = 59U + (FlexPWM1_SM0_EXTSYNC0_REG << PMUX_SHIFT), - - /*!< FlexPWM1_SM1_EXTSYNC1 input trigger connections. */ - kINPUTMUX_ArmTxevToFlexPwm1Sm1Extsync1 = 1U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToFlexPwm1Sm1Extsync1 = 2U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToFlexPwm1Sm1Extsync1 = 3U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToFlexPwm1Sm1Extsync1 = 4U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToFlexPwm1Sm1Extsync1 = 5U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Sm1Extsync1 = 6U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Sm1Extsync1 = 7U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToFlexPwm1Sm1Extsync1 = 9U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Sm1Extsync1 = 10U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToFlexPwm1Sm1Extsync1 = 11U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Sm1Extsync1 = 12U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToFlexPwm1Sm1Extsync1 = 13U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Sm1Extsync1 = 14U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToFlexPwm1Sm1Extsync1 = 15U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToFlexPwm1Sm1Extsync1 = 16U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToFlexPwm1Sm1Extsync1 = 17U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToFlexPwm1Sm1Extsync1 = 18U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToFlexPwm1Sm1Extsync1 = 19U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Sm1Extsync1 = 20U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Sm1Extsync1 = 21U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Sm1Extsync1 = 22U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Sm1Extsync1 = 23U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Sm1Extsync1 = 24U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Sm1Extsync1 = 25U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Sm1Extsync1 = 26U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Sm1Extsync1 = 27U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Sm1Extsync1 = 28U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Sm1Extsync1 = 29U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexPwm1Sm1Extsync1 = 30U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexPwm1Sm1Extsync1 = 31U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToFlexPwm1Sm1Extsync1 = 32U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToFlexPwm1Sm1Extsync1 = 33U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Sm1Extsync1 = 34U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Sm1Extsync1 = 35U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToFlexPwm1Sm1Extsync1 = 36U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToFlexPwm1Sm1Extsync1 = 37U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToFlexPwm1Sm1Extsync1 = 38U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToFlexPwm1Sm1Extsync1 = 39U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToFlexPwm1Sm1Extsync1 = 40U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToFlexPwm1Sm1Extsync1 = 45U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToFlexPwm1Sm1Extsync1 = 46U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToFlexPwm1Sm1Extsync1 = 47U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToFlexPwm1Sm1Extsync1 = 48U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag0ToFlexPwm1Sm1Extsync1 = 49U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag1ToFlexPwm1Sm1Extsync1 = 50U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag2ToFlexPwm1Sm1Extsync1 = 51U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag3ToFlexPwm1Sm1Extsync1 = 52U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatch0ToFlexPwm1Sm1Extsync1 = 53U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToFlexPwm1Sm1Extsync1 = 54U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToFlexPwm1Sm1Extsync1 = 55U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToFlexPwm1Sm1Extsync1 = 56U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToFlexPwm1Sm1Extsync1 = 57U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToFlexPwm1Sm1Extsync1 = 58U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToFlexPwm1Sm1Extsync1 = 59U + (FlexPWM1_SM1_EXTSYNC1_REG << PMUX_SHIFT), - - /*!< FlexPWM1_SM2_EXTSYNC2 input trigger connections. */ - kINPUTMUX_ArmTxevToFlexPwm1Sm2Extsync2 = 1U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToFlexPwm1Sm2Extsync2 = 2U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToFlexPwm1Sm2Extsync2 = 3U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToFlexPwm1Sm2Extsync2 = 4U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToFlexPwm1Sm2Extsync2 = 5U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Sm2Extsync2 = 6U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Sm2Extsync2 = 7U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToFlexPwm1Sm2Extsync2 = 9U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Sm2Extsync2 = 10U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToFlexPwm1Sm2Extsync2 = 11U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Sm2Extsync2 = 12U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToFlexPwm1Sm2Extsync2 = 13U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Sm2Extsync2 = 14U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToFlexPwm1Sm2Extsync2 = 15U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToFlexPwm1Sm2Extsync2 = 16U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToFlexPwm1Sm2Extsync2 = 17U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToFlexPwm1Sm2Extsync2 = 18U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToFlexPwm1Sm2Extsync2 = 19U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Sm2Extsync2 = 20U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Sm2Extsync2 = 21U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Sm2Extsync2 = 22U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Sm2Extsync2 = 23U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Sm2Extsync2 = 24U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Sm2Extsync2 = 25U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Sm2Extsync2 = 26U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Sm2Extsync2 = 27U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Sm2Extsync2 = 28U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Sm2Extsync2 = 29U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexPwm1Sm2Extsync2 = 30U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexPwm1Sm2Extsync2 = 31U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToFlexPwm1Sm2Extsync2 = 32U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToFlexPwm1Sm2Extsync2 = 33U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Sm2Extsync2 = 34U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Sm2Extsync2 = 35U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToFlexPwm1Sm2Extsync2 = 36U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToFlexPwm1Sm2Extsync2 = 37U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToFlexPwm1Sm2Extsync2 = 38U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToFlexPwm1Sm2Extsync2 = 39U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToFlexPwm1Sm2Extsync2 = 40U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToFlexPwm1Sm2Extsync2 = 45U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToFlexPwm1Sm2Extsync2 = 46U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToFlexPwm1Sm2Extsync2 = 47U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToFlexPwm1Sm2Extsync2 = 48U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag0ToFlexPwm1Sm2Extsync2 = 49U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag1ToFlexPwm1Sm2Extsync2 = 50U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag2ToFlexPwm1Sm2Extsync2 = 51U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag3ToFlexPwm1Sm2Extsync2 = 52U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatch0ToFlexPwm1Sm2Extsync2 = 53U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToFlexPwm1Sm2Extsync2 = 54U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToFlexPwm1Sm2Extsync2 = 55U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToFlexPwm1Sm2Extsync2 = 56U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToFlexPwm1Sm2Extsync2 = 57U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToFlexPwm1Sm2Extsync2 = 58U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToFlexPwm1Sm2Extsync2 = 59U + (FlexPWM1_SM2_EXTSYNC2_REG << PMUX_SHIFT), - - /*!< FlexPWM1_FAULT input trigger connections. */ - kINPUTMUX_ArmTxevToFlexPwm1Fault = 1U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToFlexPwm1Fault = 2U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToFlexPwm1Fault = 3U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToFlexPwm1Fault = 4U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToFlexPwm1Fault = 5U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Fault = 6U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Fault = 7U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToFlexPwm1Fault = 9U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Fault = 10U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToFlexPwm1Fault = 11U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Fault = 12U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToFlexPwm1Fault = 13U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Fault = 14U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToFlexPwm1Fault = 15U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToFlexPwm1Fault = 16U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToFlexPwm1Fault = 17U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToFlexPwm1Fault = 18U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToFlexPwm1Fault = 19U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Fault = 20U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Fault = 21U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Fault = 22U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Fault = 23U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Fault = 24U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Fault = 25U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Fault = 26U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Fault = 27U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Fault = 28U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Fault = 29U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexPwm1Fault = 30U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexPwm1Fault = 31U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToFlexPwm1Fault = 32U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToFlexPwm1Fault = 33U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Fault = 34U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Fault = 35U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToFlexPwm1Fault = 36U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToFlexPwm1Fault = 37U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToFlexPwm1Fault = 38U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToFlexPwm1Fault = 39U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToFlexPwm1Fault = 40U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToFlexPwm1Fault = 45U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToFlexPwm1Fault = 46U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToFlexPwm1Fault = 47U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToFlexPwm1Fault = 48U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag0ToFlexPwm1Fault = 49U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag1ToFlexPwm1Fault = 50U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag2ToFlexPwm1Fault = 51U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag3ToFlexPwm1Fault = 52U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatch0ToFlexPwm1Fault = 53U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToFlexPwm1Fault = 54U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToFlexPwm1Fault = 55U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToFlexPwm1Fault = 56U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToFlexPwm1Fault = 57U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToFlexPwm1Fault = 58U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToFlexPwm1Fault = 59U + (FlexPWM1_FAULT_REG << PMUX_SHIFT), - - /*!< FlexPWM1_FORCE input trigger connections. */ - kINPUTMUX_ArmTxevToFlexPwm1Force = 1U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToFlexPwm1Force = 2U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToFlexPwm1Force = 3U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToFlexPwm1Force = 4U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToFlexPwm1Force = 5U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Force = 6U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Force = 7U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToFlexPwm1Force = 9U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Force = 10U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToFlexPwm1Force = 11U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Force = 12U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToFlexPwm1Force = 13U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Force = 14U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToFlexPwm1Force = 15U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToFlexPwm1Force = 16U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToFlexPwm1Force = 17U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToFlexPwm1Force = 18U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatch0ToFlexPwm1Force = 19U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Force = 20U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Force = 21U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Force = 22U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Force = 23U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Force = 24U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Force = 25U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Force = 26U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Force = 27U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Force = 28U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Force = 29U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexPwm1Force = 30U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexPwm1Force = 31U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToFlexPwm1Force = 32U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToFlexPwm1Force = 33U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Force = 34U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Force = 35U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToFlexPwm1Force = 36U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToFlexPwm1Force = 37U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToFlexPwm1Force = 38U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToFlexPwm1Force = 39U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToFlexPwm1Force = 40U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToFlexPwm1Force = 45U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToFlexPwm1Force = 46U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToFlexPwm1Force = 47U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToFlexPwm1Force = 48U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag0ToFlexPwm1Force = 49U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag1ToFlexPwm1Force = 50U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag2ToFlexPwm1Force = 51U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag3ToFlexPwm1Force = 52U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatch0ToFlexPwm1Force = 53U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToFlexPwm1Force = 54U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToFlexPwm1Force = 55U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToFlexPwm1Force = 56U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToFlexPwm1Force = 57U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToFlexPwm1Force = 58U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToFlexPwm1Force = 59U + (FlexPWM1_FORCE_REG << PMUX_SHIFT), - - /*!< PWM0 external clock trigger. */ - kINPUTMUX_Clk16K1ToPwm0ExtClk = 1U + (PWM0_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_ClkInToPwm0ExtClk = 2U + (PWM0_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToPwm0ExtClk = 3U + (PWM0_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToPwm0ExtClk = 4U + (PWM0_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_ExttrigIn0ToPwm0ExtClk = 5U + (PWM0_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_ExttrigIn7ToPwm0ExtClk = 6U + (PWM0_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToPwm0ExtClk = 7U + (PWM0_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToPwm0ExtClk = 8U + (PWM0_EXT_CLK_REG << PMUX_SHIFT), - - /*!< PWM1 external clock trigger. */ - kINPUTMUX_Clk16K1ToPwm1ExtClk = 1U + (PWM1_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_ClkInToPwm1ExtClk = 2U + (PWM1_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out0ToPwm1ExtClk = 3U + (PWM1_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToPwm1ExtClk = 4U + (PWM1_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_ExttrigIn0ToPwm1ExtClk = 5U + (PWM1_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_ExttrigIn7ToPwm1ExtClk = 6U + (PWM1_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToPwm1ExtClk = 7U + (PWM1_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToPwm1ExtClk = 8U + (PWM1_EXT_CLK_REG << PMUX_SHIFT), - - /*!< AOI0 trigger input connections. */ - kINPUTMUX_Adc0Tcomp0ToAoi0Mux = 1U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToAoi0Mux = 2U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToAoi0Mux = 3U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToAoi0Mux = 4U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToAoi0Mux = 5U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToAoi0Mux = 6U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M0ToAoi0Mux = 8U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToAoi0Mux = 9U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToAoi0Mux = 10U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToAoi0Mux = 11U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToAoi0Mux = 12U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToAoi0Mux = 13U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToAoi0Mux = 14U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToAoi0Mux = 15U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToAoi0Mux = 16U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToAoi0Mux = 17U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToAoi0Mux = 18U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToAoi0Mux = 19U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToAoi0Mux = 20U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToAoi0Mux = 22U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToAoi0Mux = 23U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToAoi0Mux = 24U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToAoi0Mux = 25U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatchToAoi0Mux = 26U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToAoi0Mux = 27U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToAoi0Mux = 28U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToAoi0Mux = 29U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToAoi0Mux = 30U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToAoi0Mux = 31U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToAoi0Mux = 32U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToAoi0Mux = 35U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToAoi0Mux = 36U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToAoi0Mux = 37U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToAoi0Mux = 38U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToAoi0Mux = 39U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToAoi0Mux = 40U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToAoi0Mux = 41U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToAoi0Mux = 42U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToAoi0Mux = 43U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToAoi0Mux = 44U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToAoi0Mux = 45U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToAoi0Mux = 46U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToAoi0Mux = 47U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToAoi0Mux = 48U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToAoi0Mux = 49U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToAoi0Mux = 50U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToAoi0Mux = 51U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToAoi0Mux = 52U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToAoi0Mux = 53U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToAoi0Mux = 54U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToAoi0Mux = 55U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToAoi0Mux = 56U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M1ToAoi0Mux = 57U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToAoi0Mux = 58U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToAoi0Mux = 59U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToAoi0Mux = 60U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToAoi0Mux = 61U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToAoi0Mux = 62U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToAoi0Mux = 63U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh0ToAoi0Mux = 64U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh1ToAoi0Mux = 65U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh2ToAoi0Mux = 66U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh3ToAoi0Mux = 67U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag0ToAoi0Mux = 68U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag1ToAoi0Mux = 69U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag2ToAoi0Mux = 70U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag3ToAoi0Mux = 71U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatchToAoi0Mux = 72U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToAoi0Mux = 73U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig1ToAoi0Mux = 74U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToAoi0Mux = 75U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig1ToAoi0Mux = 76U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToAoi0Mux = 77U + (AOI0_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig1ToAoi0Mux = 78U + (AOI0_MUX_REG << PMUX_SHIFT), - - /*!< AOI1 trigger input connections. */ - kINPUTMUX_Adc0Tcomp0ToAoi1Mux = 1U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToAoi1Mux = 2U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToAoi1Mux = 3U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToAoi1Mux = 4U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToAoi1Mux = 5U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToAoi1Mux = 6U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M0ToAoi1Mux = 8U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToAoi1Mux = 9U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToAoi1Mux = 10U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToAoi1Mux = 11U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToAoi1Mux = 12U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToAoi1Mux = 13U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToAoi1Mux = 14U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToAoi1Mux = 15U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToAoi1Mux = 16U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToAoi1Mux = 17U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToAoi1Mux = 18U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToAoi1Mux = 19U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToAoi1Mux = 20U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag0ToAoi1Mux = 22U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag1ToAoi1Mux = 23U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag2ToAoi1Mux = 24U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpFlag3ToAoi1Mux = 25U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0PosMatchToAoi1Mux = 26U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToAoi1Mux = 27U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToAoi1Mux = 28U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToAoi1Mux = 29U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToAoi1Mux = 30U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToAoi1Mux = 31U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToAoi1Mux = 32U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToAoi1Mux = 35U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToAoi1Mux = 36U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToAoi1Mux = 37U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToAoi1Mux = 38U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToAoi1Mux = 39U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToAoi1Mux = 40U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToAoi1Mux = 41U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToAoi1Mux = 42U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToAoi1Mux = 43U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToAoi1Mux = 44U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToAoi1Mux = 45U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToAoi1Mux = 46U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToAoi1Mux = 47U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToAoi1Mux = 48U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToAoi1Mux = 49U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToAoi1Mux = 50U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToAoi1Mux = 51U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToAoi1Mux = 52U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToAoi1Mux = 53U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToAoi1Mux = 54U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToAoi1Mux = 55U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToAoi1Mux = 56U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M1ToAoi1Mux = 57U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToAoi1Mux = 58U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToAoi1Mux = 59U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToAoi1Mux = 60U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToAoi1Mux = 61U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToAoi1Mux = 62U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToAoi1Mux = 63U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh0ToAoi1Mux = 64U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh1ToAoi1Mux = 65U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh2ToAoi1Mux = 66U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh3ToAoi1Mux = 67U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag0ToAoi1Mux = 68U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag1ToAoi1Mux = 69U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag2ToAoi1Mux = 70U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpFlag3ToAoi1Mux = 71U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1PosMatchToAoi1Mux = 72U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToAoi1Mux = 73U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig1ToAoi1Mux = 74U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToAoi1Mux = 75U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig1ToAoi1Mux = 76U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToAoi1Mux = 77U + (AOI1_MUX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig1ToAoi1Mux = 78U + (AOI1_MUX_REG << PMUX_SHIFT), - - /*!< USB-FS trigger input connections. */ - kINPUTMUX_Lpuart0TrgTxdataToUsbfsTrigger = 1U + (USBFS_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lpuart1TrgTxdataToUsbfsTrigger = 2U + (USBFS_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lpuart2TrgTxdataToUsbfsTrigger = 3U + (USBFS_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lpuart3TrgTxdataToUsbfsTrigger = 4U + (USBFS_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lpuart4TrgTxdataToUsbfsTrigger = 5U + (USBFS_TRIG_REG << PMUX_SHIFT), - - /*!< EXT trigger connections. */ - kINPUTMUX_Aoi0Out0ToExtTrigger = 2U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToExtTrigger = 3U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToExtTrigger = 4U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToExtTrigger = 5U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToExtTrigger = 6U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToExtTrigger = 7U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpuart0ToExtTrigger = 9U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpuart1ToExtTrigger = 10U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpuart2ToExtTrigger = 11U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpuart3ToExtTrigger = 12U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpuart4ToExtTrigger = 13U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToExtTrigger = 14U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToExtTrigger = 15U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToExtTrigger = 16U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToExtTrigger = 17U + (EXT_TRIG0_REG << PMUX_SHIFT), - - /*!< LPI2C0 trigger input connections. */ - kINPUTMUX_Aoi0Out0ToLpi2c0Trigger = 2U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToLpi2c0Trigger = 3U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToLpi2c0Trigger = 4U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToLpi2c0Trigger = 5U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToLpi2c0Trigger = 6U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToLpi2c0Trigger = 7U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M0ToLpi2c0Trigger = 9U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToLpi2c0Trigger = 10U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToLpi2c0Trigger = 11U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToLpi2c0Trigger = 12U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToLpi2c0Trigger = 13U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToLpi2c0Trigger = 14U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToLpi2c0Trigger = 15U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToLpi2c0Trigger = 17U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToLpi2c0Trigger = 18U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToLpi2c0Trigger = 19U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToLpi2c0Trigger = 20U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToLpi2c0Trigger = 21U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToLpi2c0Trigger = 22U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToLpi2c0Trigger = 23U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToLpi2c0Trigger = 24U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToLpi2c0Trigger = 25U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToLpi2c0Trigger = 26U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToLpi2c0Trigger = 27U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToLpi2c0Trigger = 28U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToLpi2c0Trigger = 29U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToLpi2c0Trigger = 30U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToLpi2c0Trigger = 31U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToLpi2c0Trigger = 32U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToLpi2c0Trigger = 33U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToLpi2c0Trigger = 34U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToLpi2c0Trigger = 35U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToLpi2c0Trigger = 36U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToLpi2c0Trigger = 37U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToLpi2c0Trigger = 38U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh0ToLpi2c0Trigger = 39U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh1ToLpi2c0Trigger = 40U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh2ToLpi2c0Trigger = 41U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh3ToLpi2c0Trigger = 42U + (LPI2C0_TRIG_REG << PMUX_SHIFT), - - /*!< LPI2C1 trigger input connections. */ - kINPUTMUX_Aoi0Out0ToLpi2c1Trigger = 2U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToLpi2c1Trigger = 3U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToLpi2c1Trigger = 4U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToLpi2c1Trigger = 5U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToLpi2c1Trigger = 6U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToLpi2c1Trigger = 7U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M0ToLpi2c1Trigger = 9U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToLpi2c1Trigger = 10U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToLpi2c1Trigger = 11U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToLpi2c1Trigger = 12U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToLpi2c1Trigger = 13U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToLpi2c1Trigger = 14U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToLpi2c1Trigger = 15U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToLpi2c1Trigger = 17U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToLpi2c1Trigger = 18U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToLpi2c1Trigger = 19U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToLpi2c1Trigger = 20U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToLpi2c1Trigger = 21U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToLpi2c1Trigger = 22U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToLpi2c1Trigger = 23U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToLpi2c1Trigger = 24U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToLpi2c1Trigger = 25U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToLpi2c1Trigger = 26U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToLpi2c1Trigger = 27U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToLpi2c1Trigger = 28U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToLpi2c1Trigger = 29U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToLpi2c1Trigger = 30U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToLpi2c1Trigger = 31U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToLpi2c1Trigger = 32U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToLpi2c1Trigger = 33U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToLpi2c1Trigger = 34U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToLpi2c1Trigger = 35U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToLpi2c1Trigger = 36U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToLpi2c1Trigger = 37U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToLpi2c1Trigger = 38U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh0ToLpi2c1Trigger = 39U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh1ToLpi2c1Trigger = 40U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh2ToLpi2c1Trigger = 41U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh3ToLpi2c1Trigger = 42U + (LPI2C1_TRIG_REG << PMUX_SHIFT), - - /*!< LPI2C2 trigger input connections. */ - kINPUTMUX_Aoi0Out0ToLpi2c2Trigger = 2U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToLpi2c2Trigger = 3U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToLpi2c2Trigger = 4U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToLpi2c2Trigger = 5U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToLpi2c2Trigger = 6U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToLpi2c2Trigger = 7U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M0ToLpi2c2Trigger = 9U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToLpi2c2Trigger = 10U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToLpi2c2Trigger = 11U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToLpi2c2Trigger = 12U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToLpi2c2Trigger = 13U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToLpi2c2Trigger = 14U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToLpi2c2Trigger = 15U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToLpi2c2Trigger = 17U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToLpi2c2Trigger = 18U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToLpi2c2Trigger = 19U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToLpi2c2Trigger = 20U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToLpi2c2Trigger = 21U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToLpi2c2Trigger = 22U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToLpi2c2Trigger = 23U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToLpi2c2Trigger = 24U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToLpi2c2Trigger = 25U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToLpi2c2Trigger = 26U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToLpi2c2Trigger = 27U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToLpi2c2Trigger = 28U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToLpi2c2Trigger = 29U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToLpi2c2Trigger = 30U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToLpi2c2Trigger = 31U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToLpi2c2Trigger = 32U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToLpi2c2Trigger = 33U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToLpi2c2Trigger = 34U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToLpi2c2Trigger = 35U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToLpi2c2Trigger = 36U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToLpi2c2Trigger = 37U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToLpi2c2Trigger = 38U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh0ToLpi2c2Trigger = 39U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh1ToLpi2c2Trigger = 40U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh2ToLpi2c2Trigger = 41U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh3ToLpi2c2Trigger = 42U + (LPI2C2_TRIG_REG << PMUX_SHIFT), - - /*!< LPSPI0 trigger input connections. */ - kINPUTMUX_Aoi0Out0ToLpspi0Trigger = 2U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToLpspi0Trigger = 3U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToLpspi0Trigger = 4U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToLpspi0Trigger = 5U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToLpspi0Trigger = 6U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToLpspi0Trigger = 7U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToLpspi0Trigger = 9U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToLpspi0Trigger = 10U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToLpspi0Trigger = 11U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToLpspi0Trigger = 12U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToLpspi0Trigger = 13U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToLpspi0Trigger = 14U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToLpspi0Trigger = 15U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToLpspi0Trigger = 17U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToLpspi0Trigger = 18U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToLpspi0Trigger = 19U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToLpspi0Trigger = 20U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToLpspi0Trigger = 21U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToLpspi0Trigger = 22U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToLpspi0Trigger = 23U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToLpspi0Trigger = 24U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToLpspi0Trigger = 25U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToLpspi0Trigger = 26U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToLpspi0Trigger = 27U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToLpspi0Trigger = 28U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToLpspi0Trigger = 29U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToLpspi0Trigger = 30U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToLpspi0Trigger = 31U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToLpspi0Trigger = 32U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToLpspi0Trigger = 33U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToLpspi0Trigger = 34U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToLpspi0Trigger = 35U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToLpspi0Trigger = 36U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToLpspi0Trigger = 37U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToLpspi0Trigger = 38U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh0ToLpspi0Trigger = 39U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh1ToLpspi0Trigger = 40U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh2ToLpspi0Trigger = 41U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh3ToLpspi0Trigger = 42U + (LPSPI0_TRIG_REG << PMUX_SHIFT), - - /*!< LPSPI1 trigger input connections. */ - kINPUTMUX_Aoi0Out0ToLpspi1Trigger = 2U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToLpspi1Trigger = 3U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToLpspi1Trigger = 4U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToLpspi1Trigger = 5U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToLpspi1Trigger = 6U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToLpspi1Trigger = 7U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToLpspi1Trigger = 9U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToLpspi1Trigger = 10U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToLpspi1Trigger = 11U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToLpspi1Trigger = 12U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToLpspi1Trigger = 13U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToLpspi1Trigger = 14U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToLpspi1Trigger = 15U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToLpspi1Trigger = 17U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToLpspi1Trigger = 18U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToLpspi1Trigger = 19U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToLpspi1Trigger = 20U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToLpspi1Trigger = 21U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToLpspi1Trigger = 22U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToLpspi1Trigger = 23U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToLpspi1Trigger = 24U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToLpspi1Trigger = 25U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToLpspi1Trigger = 26U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToLpspi1Trigger = 27U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToLpspi1Trigger = 28U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToLpspi1Trigger = 29U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToLpspi1Trigger = 30U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToLpspi1Trigger = 31U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToLpspi1Trigger = 32U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToLpspi1Trigger = 33U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToLpspi1Trigger = 34U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToLpspi1Trigger = 35U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToLpspi1Trigger = 36U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToLpspi1Trigger = 37U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToLpspi1Trigger = 38U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh0ToLpspi1Trigger = 39U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh1ToLpspi1Trigger = 40U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh2ToLpspi1Trigger = 41U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh3ToLpspi1Trigger = 42U + (LPSPI1_TRIG_REG << PMUX_SHIFT), - - /*!< LPUART0 trigger input connections. */ - kINPUTMUX_Aoi0Out0ToLpuart0Trigger = 2U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToLpuart0Trigger = 3U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToLpuart0Trigger = 4U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToLpuart0Trigger = 5U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToLpuart0Trigger = 6U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToLpuart0Trigger = 7U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToLpuart0Trigger = 9U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToLpuart0Trigger = 10U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToLpuart0Trigger = 11U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToLpuart0Trigger = 12U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToLpuart0Trigger = 13U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToLpuart0Trigger = 14U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToLpuart0Trigger = 15U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToLpuart0Trigger = 17U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToLpuart0Trigger = 18U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToLpuart0Trigger = 19U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToLpuart0Trigger = 20U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToLpuart0Trigger = 21U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToLpuart0Trigger = 22U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToLpuart0Trigger = 23U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToLpuart0Trigger = 24U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToLpuart0Trigger = 25U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToLpuart0Trigger = 26U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToLpuart0Trigger = 27U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToLpuart0Trigger = 28U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToLpuart0Trigger = 29U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToLpuart0Trigger = 30U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToLpuart0Trigger = 31U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToLpuart0Trigger = 32U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToLpuart0Trigger = 33U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToLpuart0Trigger = 34U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Usb0IppIndUartRxdUsbmuxToLpuart0Trigger = 35U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToLpuart0Trigger = 36U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToLpuart0Trigger = 37U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToLpuart0Trigger = 38U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToLpuart0Trigger = 39U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToLpuart0Trigger = 40U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToLpuart0Trigger = 41U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToLpuart0Trigger = 42U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToLpuart0Trigger = 43U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh0ToLpuart0Trigger = 44U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh1ToLpuart0Trigger = 45U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh2ToLpuart0Trigger = 46U + (LPUART0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh3ToLpuart0Trigger = 47U + (LPUART0_TRIG_REG << PMUX_SHIFT), - - /*!< LPUART1 trigger input connections. */ - kINPUTMUX_Aoi0Out0ToLpuart1Trigger = 2U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToLpuart1Trigger = 3U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToLpuart1Trigger = 4U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToLpuart1Trigger = 5U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToLpuart1Trigger = 6U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToLpuart1Trigger = 7U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToLpuart1Trigger = 9U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToLpuart1Trigger = 10U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToLpuart1Trigger = 11U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToLpuart1Trigger = 12U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToLpuart1Trigger = 13U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToLpuart1Trigger = 14U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToLpuart1Trigger = 15U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToLpuart1Trigger = 17U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToLpuart1Trigger = 18U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToLpuart1Trigger = 19U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToLpuart1Trigger = 20U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToLpuart1Trigger = 21U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToLpuart1Trigger = 22U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToLpuart1Trigger = 23U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToLpuart1Trigger = 24U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToLpuart1Trigger = 25U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToLpuart1Trigger = 26U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToLpuart1Trigger = 27U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToLpuart1Trigger = 28U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToLpuart1Trigger = 29U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToLpuart1Trigger = 30U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToLpuart1Trigger = 31U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToLpuart1Trigger = 32U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToLpuart1Trigger = 33U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToLpuart1Trigger = 34U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Usb0IppIndUartRxdUsbmuxToLpuart1Trigger = 35U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToLpuart1Trigger = 36U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToLpuart1Trigger = 37U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToLpuart1Trigger = 38U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToLpuart1Trigger = 39U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToLpuart1Trigger = 40U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToLpuart1Trigger = 41U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToLpuart1Trigger = 42U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToLpuart1Trigger = 43U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh0ToLpuart1Trigger = 44U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh1ToLpuart1Trigger = 45U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh2ToLpuart1Trigger = 46U + (LPUART1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh3ToLpuart1Trigger = 47U + (LPUART1_TRIG_REG << PMUX_SHIFT), - - /*!< LPUART2 trigger input connections. */ - kINPUTMUX_Aoi0Out0ToLpuart2Trigger = 2U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToLpuart2Trigger = 3U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToLpuart2Trigger = 4U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToLpuart2Trigger = 5U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToLpuart2Trigger = 6U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToLpuart2Trigger = 7U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToLpuart2Trigger = 9U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToLpuart2Trigger = 10U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToLpuart2Trigger = 11U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToLpuart2Trigger = 12U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToLpuart2Trigger = 13U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToLpuart2Trigger = 14U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToLpuart2Trigger = 15U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToLpuart2Trigger = 17U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToLpuart2Trigger = 18U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToLpuart2Trigger = 19U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToLpuart2Trigger = 20U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToLpuart2Trigger = 21U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToLpuart2Trigger = 22U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToLpuart2Trigger = 23U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToLpuart2Trigger = 24U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToLpuart2Trigger = 25U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToLpuart2Trigger = 26U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToLpuart2Trigger = 27U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToLpuart2Trigger = 28U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToLpuart2Trigger = 29U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToLpuart2Trigger = 30U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToLpuart2Trigger = 31U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToLpuart2Trigger = 32U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToLpuart2Trigger = 33U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToLpuart2Trigger = 34U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Usb0IppIndUartRxdUsbmuxToLpuart2Trigger = 35U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToLpuart2Trigger = 36U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToLpuart2Trigger = 37U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToLpuart2Trigger = 38U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToLpuart2Trigger = 39U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToLpuart2Trigger = 40U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToLpuart2Trigger = 41U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToLpuart2Trigger = 42U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToLpuart2Trigger = 43U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh0ToLpuart2Trigger = 44U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh1ToLpuart2Trigger = 45U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh2ToLpuart2Trigger = 46U + (LPUART2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh3ToLpuart2Trigger = 47U + (LPUART2_TRIG_REG << PMUX_SHIFT), - - /*!< LPUART3 trigger input connections. */ - kINPUTMUX_Aoi0Out0ToLpuart3Trigger = 2U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToLpuart3Trigger = 3U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToLpuart3Trigger = 4U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToLpuart3Trigger = 5U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToLpuart3Trigger = 6U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToLpuart3Trigger = 7U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToLpuart3Trigger = 9U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToLpuart3Trigger = 10U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToLpuart3Trigger = 11U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToLpuart3Trigger = 12U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToLpuart3Trigger = 13U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToLpuart3Trigger = 14U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToLpuart3Trigger = 15U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToLpuart3Trigger = 17U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToLpuart3Trigger = 18U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToLpuart3Trigger = 19U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToLpuart3Trigger = 20U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToLpuart3Trigger = 21U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToLpuart3Trigger = 22U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToLpuart3Trigger = 23U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToLpuart3Trigger = 24U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToLpuart3Trigger = 25U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToLpuart3Trigger = 26U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToLpuart3Trigger = 27U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToLpuart3Trigger = 28U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToLpuart3Trigger = 29U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToLpuart3Trigger = 30U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToLpuart3Trigger = 31U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToLpuart3Trigger = 32U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToLpuart3Trigger = 33U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToLpuart3Trigger = 34U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Usb0IppIndUartRxdUsbmuxToLpuart3Trigger = 35U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToLpuart3Trigger = 36U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToLpuart3Trigger = 37U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToLpuart3Trigger = 38U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToLpuart3Trigger = 39U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToLpuart3Trigger = 40U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToLpuart3Trigger = 41U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToLpuart3Trigger = 42U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToLpuart3Trigger = 43U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh0ToLpuart3Trigger = 44U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh1ToLpuart3Trigger = 45U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh2ToLpuart3Trigger = 46U + (LPUART3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh3ToLpuart3Trigger = 47U + (LPUART3_TRIG_REG << PMUX_SHIFT), - - /*!< LPUART4 trigger input connections. */ - kINPUTMUX_Aoi0Out0ToLpuart4Trigger = 2U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToLpuart4Trigger = 3U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToLpuart4Trigger = 4U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToLpuart4Trigger = 5U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToLpuart4Trigger = 6U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToLpuart4Trigger = 7U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToLpuart4Trigger = 9U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToLpuart4Trigger = 10U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToLpuart4Trigger = 11U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToLpuart4Trigger = 12U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToLpuart4Trigger = 13U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToLpuart4Trigger = 14U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToLpuart4Trigger = 15U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToLpuart4Trigger = 17U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToLpuart4Trigger = 18U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToLpuart4Trigger = 19U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToLpuart4Trigger = 20U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToLpuart4Trigger = 21U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToLpuart4Trigger = 22U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToLpuart4Trigger = 23U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToLpuart4Trigger = 24U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToLpuart4Trigger = 25U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToLpuart4Trigger = 26U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToLpuart4Trigger = 27U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToLpuart4Trigger = 28U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToLpuart4Trigger = 29U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToLpuart4Trigger = 30U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToLpuart4Trigger = 31U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToLpuart4Trigger = 32U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToLpuart4Trigger = 33U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToLpuart4Trigger = 34U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Usb0IppIndUartRxdUsbmuxToLpuart4Trigger = 35U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToLpuart4Trigger = 36U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToLpuart4Trigger = 37U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToLpuart4Trigger = 38U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToLpuart4Trigger = 39U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToLpuart4Trigger = 40U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToLpuart4Trigger = 41U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToLpuart4Trigger = 42U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToLpuart4Trigger = 43U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh0ToLpuart4Trigger = 44U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh1ToLpuart4Trigger = 45U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh2ToLpuart4Trigger = 46U + (LPUART4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh3ToLpuart4Trigger = 47U + (LPUART4_TRIG_REG << PMUX_SHIFT), - -/*!< Flexio trigger0 input connections. */ - kINPUTMUX_Aoi0Out0ToFlexioTrigger = 1U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToFlexioTrigger = 2U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToFlexioTrigger = 3U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToFlexioTrigger = 4U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexioTrigger = 5U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexioTrigger = 6U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexioTrigger = 7U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexioTrigger = 8U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexioTrigger = 9U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexioTrigger = 10U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToFlexioTrigger = 12U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M2ToFlexioTrigger = 13U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToFlexioTrigger = 14U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToFlexioTrigger = 15U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexioTrigger = 16U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToFlexioTrigger = 17U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToFlexioTrigger = 18U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToFlexioTrigger = 20U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToFlexioTrigger = 21U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToFlexioTrigger = 22U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexioTrigger = 24U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexioTrigger = 25U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexioTrigger = 26U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexioTrigger = 27U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexioTrigger = 28U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexioTrigger = 29U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexioTrigger = 30U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexioTrigger = 31U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToFlexioTrigger = 32U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexioTrigger = 33U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexioTrigger = 34U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToFlexioTrigger = 35U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_WuuToFlexioTrigger = 36U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToFlexioTrigger = 37U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpi2c0MasterEndOfPacketToFlexioTrigger = 38U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpi2c0SlaveEndOfPacketToFlexioTrigger = 39U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpi2c1MasterEndOfPacketToFlexioTrigger = 40U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpi2c1SlaveEndOfPacketToFlexioTrigger = 41U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpspi0EndOfFrameToFlexioTrigger = 42U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpspi0ReceivedDataWordToFlexioTrigger = 43U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpspi1EndOfFrameToFlexioTrigger = 44U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpspi1ReceivedDataWordToFlexioTrigger = 45U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceivedDataWordToFlexioTrigger = 46U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpuart0TransmittedDataWordToFlexioTrigger = 47U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpuart0ReceiveLineIdleToFlexioTrigger = 48U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceivedDataWordToFlexioTrigger = 49U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpuart1TransmittedDataWordToFlexioTrigger = 50U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpuart1ReceiveLineIdleToFlexioTrigger = 51U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceivedDataWordToFlexioTrigger = 52U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpuart2TransmittedDataWordToFlexioTrigger = 53U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpuart2ReceiveLineIdleToFlexioTrigger = 54U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpuart3ReceivedDataWordToFlexioTrigger = 55U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpuart3TransmittedDataWordToFlexioTrigger = 56U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpuart3ReceiveLineIdleToFlexioTrigger = 57U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpuart4ReceivedDataWordToFlexioTrigger = 58U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpuart4TransmittedDataWordToFlexioTrigger = 59U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpuart4ReceiveLineIdleToFlexioTrigger = 60U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToFlexioTrigger = 61U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToFlexioTrigger = 62U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToFlexioTrigger = 63U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToFlexioTrigger = 64U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexioTrigger = 65U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexioTrigger = 66U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexioTrigger = 67U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexioTrigger = 68U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToFlexioTrigger = 69U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToFlexioTrigger = 70U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToFlexioTrigger = 71U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToFlexioTrigger = 72U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToFlexioTrigger = 73U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToFlexioTrigger = 74U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToFlexioTrigger = 75U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpi2c2MasterEndOfPacketToFlexioTrigger = 77U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpi2c2SlaveEndOfPacketToFlexioTrigger = 78U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpi2c3MasterEndOfPacketToFlexioTrigger = 79U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpi2c3SlaveEndOfPacketToFlexioTrigger = 80U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - -/*!< Opamp0 trigger input connections. */ - kINPUTMUX_Aoi0Out0ToOpamp0Trigger = 2U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out1ToOpamp0Trigger = 3U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out2ToOpamp0Trigger = 4U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi0Out3ToOpamp0Trigger = 5U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToOpamp0Trigger = 6U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToOpamp0Trigger = 7U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M0ToOpamp0Trigger = 9U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToOpamp0Trigger = 10U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToOpamp0Trigger = 11U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToOpamp0Trigger = 12U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToOpamp0Trigger = 13U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToOpamp0Trigger = 14U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToOpamp0Trigger = 15U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig0ToOpamp0Trigger = 18U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm0OutTrig1ToOpamp0Trigger = 19U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig0ToOpamp0Trigger = 20U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm1OutTrig1ToOpamp0Trigger = 21U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig0ToOpamp0Trigger = 22U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0Sm2OutTrig1ToOpamp0Trigger = 23U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio0PinEventTrig0ToOpamp0Trigger = 26U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToOpamp0Trigger = 27U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToOpamp0Trigger = 28U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToOpamp0Trigger = 29U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio4PinEventTrig0ToOpamp0Trigger = 30U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToOpamp0Trigger = 31U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out0ToOpamp0Trigger = 33U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out1ToOpamp0Trigger = 34U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out2ToOpamp0Trigger = 35U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Aoi1Out3ToOpamp0Trigger = 36U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToOpamp0Trigger = 37U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToOpamp0Trigger = 38U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToOpamp0Trigger = 39U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToOpamp0Trigger = 40U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToOpamp0Trigger = 41U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M1ToOpamp0Trigger = 42U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToOpamp0Trigger = 43U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToOpamp0Trigger = 44U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh0ToOpamp0Trigger = 45U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh1ToOpamp0Trigger = 46U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh2ToOpamp0Trigger = 47U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh3ToOpamp0Trigger = 48U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig0ToOpamp0Trigger = 50U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm0OutTrig1ToOpamp0Trigger = 51U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig0ToOpamp0Trigger = 52U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm1OutTrig1ToOpamp0Trigger = 53U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig0ToOpamp0Trigger = 54U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1Sm2OutTrig1ToOpamp0Trigger = 55U + (OPAMP0_TRIG_REG << PMUX_SHIFT), -} inputmux_connection_t; - -/*@}*/ - -/*@}*/ - -#endif /* _FSL_INPUTMUX_CONNECTIONS_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpadc.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpadc.c deleted file mode 100644 index c22741c4f58..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpadc.c +++ /dev/null @@ -1,977 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpadc.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpadc" -#endif - -#ifndef ADC_VERID_DIFFEN_MASK -#define ADC_VERID_DIFFEN_MASK (0x2U) -#endif /* ADC_VERID_DIFFEN_MASK */ - -#ifndef ADC_VERID_NUM_SEC_MASK -#define ADC_VERID_NUM_SEC_MASK (0x800U) -#endif /* ADC_VERID_NUM_SEC_MASK */ - -#define ADC_CMDL_CHANNEL_MODE_MASK (0x60U) -#define ADC_CMDL_CHANNEL_MODE_SHIFT (5U) -#define ADC_CMDL_CHANNEL_MODE(x) \ - (((uint32_t)(((uint32_t)(x)) << ADC_CMDL_CHANNEL_MODE_SHIFT)) & ADC_CMDL_CHANNEL_MODE_MASK) - -#define GET_ADC_CFG_TPRICTRL_VALUE(val) (((uint32_t)val) & 0x3U) - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES -#define GET_ADC_CFG_TRES_VALUE(val) ((((uint32_t)val) & 0x4U) >> 2U) -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES */ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES -#define GET_ADC_CFG_TCMDRES_VALUE(val) ((((uint32_t)val) & 0x8U) >> 3U) -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES */ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI) && FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI -#define GET_ADC_CFG_HPT_EXDI_VALUE(val) ((((uint32_t)val) & 0x10U) >> 4U) -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI) && FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI */ - -#if defined(LPADC_RSTS) -#define LPADC_RESETS_ARRAY LPADC_RSTS -#elif defined(ADC_RSTS) -#define LPADC_RESETS_ARRAY ADC_RSTS -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Get instance number for LPADC module. - * - * @param base LPADC peripheral base address - */ -static uint32_t LPADC_GetInstance(ADC_Type *base); - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ -/*! - * @brief Get gain conversion result . - * - * @param gainAdjustment gain adjustment value. - */ -static uint32_t LPADC_GetGainConvResult(float gainAdjustment); -#endif /* defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ */ - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to LPADC bases for each instance. */ -static ADC_Type *const s_lpadcBases[] = ADC_BASE_PTRS; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to LPADC clocks for each instance. */ -static const clock_ip_name_t s_lpadcClocks[] = LPADC_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#if defined(LPADC_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_lpadcResets[] = LPADC_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t LPADC_GetInstance(ADC_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - /* - * $Branch Coverage Justification$ - * (instance >= ARRAY_SIZE(s_lpadcBases)) not covered. The peripheral base - * address is always valid and checked by assert. - */ - for (instance = 0; instance < ARRAY_SIZE(s_lpadcBases); instance++) - { - /* - * $Branch Coverage Justification$ - * (s_lpadcBases[instance] != base) not covered. The peripheral base - * address is always valid and checked by assert. - */ - if (s_lpadcBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_lpadcBases)); - - return instance; -} - -#if (defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) -/*! - * brief Get gain conversion Result . - * - * param gainAdjustment gain adjustment value. - */ -static uint32_t LPADC_GetGainConvResult(float gainAdjustment) -{ - uint16_t i = 0U; - uint32_t tmp32 = 0U; - uint32_t GCRa[17] = {0}; - uint32_t GCALR = 0U; - - for (i = 0x11U; i > 0U; i--) - { - tmp32 = (uint32_t)((gainAdjustment) / ((float)(1.0 / (double)(1U << (0x10U - (i - 1U)))))); - GCRa[i - 1U] = tmp32; - gainAdjustment = gainAdjustment - ((float)tmp32) * ((float)(1.0 / (double)(1U << (0x10U - (i - 1U))))); - } - /* Get GCALR value calculated */ - for (i = 0x11U; i > 0U; i--) - { - GCALR += GCRa[i - 1U] * ((uint32_t)(1UL << (uint32_t)(i - 1UL))); - } - - /* to return GCALR value calculated */ - return GCALR; -} -#endif /* defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ */ - -/*! - * brief Initializes the LPADC module. - * - * param base LPADC peripheral base address. - * param config Pointer to configuration structure. See "lpadc_config_t". - */ -void LPADC_Init(ADC_Type *base, const lpadc_config_t *config) -{ - /* Check if the pointer is available. */ - assert(config != NULL); - - uint32_t tmp32 = 0U; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock for LPADC instance. */ - (void)CLOCK_EnableClock(s_lpadcClocks[LPADC_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(LPADC_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_lpadcResets[LPADC_GetInstance(base)]); -#endif - - /* Reset the module. */ - LPADC_DoResetConfig(base); -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - LPADC_DoResetFIFO0(base); - LPADC_DoResetFIFO1(base); -#else - LPADC_DoResetFIFO(base); -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ - - /* Disable the module before setting configuration. */ - LPADC_Enable(base, false); - - /* Configure the module generally. */ - if (config->enableInDozeMode) - { - base->CTRL &= ~ADC_CTRL_DOZEN_MASK; - } - else - { - base->CTRL |= ADC_CTRL_DOZEN_MASK; - } - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS - /* Set calibration average mode. */ - base->CTRL |= ADC_CTRL_CAL_AVGS(config->conversionAverageMode); -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS */ - -/* ADCx_CFG. */ -#if defined(FSL_FEATURE_LPADC_HAS_CFG_ADCKEN) && FSL_FEATURE_LPADC_HAS_CFG_ADCKEN - if (config->enableInternalClock) - { - tmp32 |= ADC_CFG_ADCKEN_MASK; - } -#endif /* FSL_FEATURE_LPADC_HAS_CFG_ADCKEN */ -#if defined(FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG) && FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG - if (config->enableVref1LowVoltage) - { - tmp32 |= ADC_CFG_VREF1RNG_MASK; - } -#endif /* FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG */ - if (config->enableAnalogPreliminary) - { - tmp32 |= ADC_CFG_PWREN_MASK; - } - tmp32 |= (ADC_CFG_PUDLY(config->powerUpDelay) /* Power up delay. */ - | ADC_CFG_REFSEL(config->referenceVoltageSource) /* Reference voltage. */ -#if defined(FSL_FEATURE_LPADC_HAS_CFG_PWRSEL) && (FSL_FEATURE_LPADC_HAS_CFG_PWRSEL == 1U) - | ADC_CFG_PWRSEL(config->powerLevelMode) /* Power configuration. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_PWRSEL) && (FSL_FEATURE_LPADC_HAS_CFG_PWRSEL == 1U) */ - ); - - tmp32 |= ADC_CFG_TPRICTRL(GET_ADC_CFG_TPRICTRL_VALUE(config->triggerPriorityPolicy)); - -#if (defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES) - tmp32 |= ADC_CFG_TRES(GET_ADC_CFG_TRES_VALUE(config->triggerPriorityPolicy)); -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES */ - -#if (defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) - tmp32 |= ADC_CFG_TCMDRES(GET_ADC_CFG_TCMDRES_VALUE(config->triggerPriorityPolicy)); -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES */ - -#if (defined(FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI) && FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI) - tmp32 |= ADC_CFG_HPT_EXDI(GET_ADC_CFG_HPT_EXDI_VALUE(config->triggerPriorityPolicy)); -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI) && FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI */ - - base->CFG = tmp32; - - /* ADCx_PAUSE. */ - if (config->enableConvPause) - { - base->PAUSE = ADC_PAUSE_PAUSEEN_MASK | ADC_PAUSE_PAUSEDLY(config->convPauseDelay); - } - else - { - base->PAUSE = 0U; - } - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - /* ADCx_FCTRL0. */ - base->FCTRL[0] = ADC_FCTRL_FWMARK(config->FIFO0Watermark); - /* ADCx_FCTRL1. */ - base->FCTRL[1] = ADC_FCTRL_FWMARK(config->FIFO1Watermark); -#else - /* ADCx_FCTRL. */ - base->FCTRL = ADC_FCTRL_FWMARK(config->FIFOWatermark); -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ - - /* Enable the module after setting configuration. */ - LPADC_Enable(base, true); -} - -/*! - * brief Gets an available pre-defined settings for initial configuration. - * - * This function initializes the converter configuration structure with an available settings. The default values are: - * code - * config->enableInDozeMode = true; - * config->conversionAverageMode = kLPADC_ConversionAverage1; - * config->enableAnalogPreliminary = false; - * config->powerUpDelay = 0x80; - * config->referenceVoltageSource = kLPADC_ReferenceVoltageAlt1; - * config->powerLevelMode = kLPADC_PowerLevelAlt1; - * config->triggerPriorityPolicy = kLPADC_TriggerPriorityPreemptImmediately; - * config->enableConvPause = false; - * config->convPauseDelay = 0U; - * config->FIFO0Watermark = 0U; - * config->FIFO1Watermark = 0U; - * config->FIFOWatermark = 0U; - * endcode - * param config Pointer to configuration structure. - */ -void LPADC_GetDefaultConfig(lpadc_config_t *config) -{ - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_ADCKEN) && FSL_FEATURE_LPADC_HAS_CFG_ADCKEN - config->enableInternalClock = false; -#endif /* FSL_FEATURE_LPADC_HAS_CFG_ADCKEN */ -#if defined(FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG) && FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG - config->enableVref1LowVoltage = false; -#endif /* FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG */ - config->enableInDozeMode = true; -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS - /* Set calibration average mode. */ - config->conversionAverageMode = kLPADC_ConversionAverage1; -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS */ - config->enableAnalogPreliminary = false; - config->powerUpDelay = 0x80; - config->referenceVoltageSource = kLPADC_ReferenceVoltageAlt1; -#if defined(FSL_FEATURE_LPADC_HAS_CFG_PWRSEL) && (FSL_FEATURE_LPADC_HAS_CFG_PWRSEL == 1U) - config->powerLevelMode = kLPADC_PowerLevelAlt1; -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_PWRSEL) && (FSL_FEATURE_LPADC_HAS_CFG_PWRSEL == 1U) */ - config->triggerPriorityPolicy = kLPADC_TriggerPriorityPreemptImmediately; - config->enableConvPause = false; - config->convPauseDelay = 0U; -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - config->FIFO0Watermark = 0U; - config->FIFO1Watermark = 0U; -#else - config->FIFOWatermark = 0U; -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ -} - -/*! - * brief De-initializes the LPADC module. - * - * param base LPADC peripheral base address. - */ -void LPADC_Deinit(ADC_Type *base) -{ - /* Disable the module. */ - LPADC_Enable(base, false); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate the clock. */ - (void)CLOCK_DisableClock(s_lpadcClocks[LPADC_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) -/*! - * brief Get the result in conversion FIFOn. - * - * param base LPADC peripheral base address. - * param result Pointer to structure variable that keeps the conversion result in conversion FIFOn. - * param index Result FIFO index. - * - * return Status whether FIFOn entry is valid. - */ -bool LPADC_GetConvResult(ADC_Type *base, lpadc_conv_result_t *result, uint8_t index) -{ - assert(result != NULL); /* Check if the input pointer is available. */ - - uint32_t tmp32 = 0U; - - tmp32 = base->RESFIFO[index]; - - if (ADC_RESFIFO_VALID_MASK != (tmp32 & ADC_RESFIFO_VALID_MASK)) - { - return false; /* FIFO is empty. Discard any read from RESFIFO. */ - } - - result->commandIdSource = (tmp32 & ADC_RESFIFO_CMDSRC_MASK) >> ADC_RESFIFO_CMDSRC_SHIFT; - result->loopCountIndex = (tmp32 & ADC_RESFIFO_LOOPCNT_MASK) >> ADC_RESFIFO_LOOPCNT_SHIFT; - result->triggerIdSource = (tmp32 & ADC_RESFIFO_TSRC_MASK) >> ADC_RESFIFO_TSRC_SHIFT; - result->convValue = (uint16_t)(tmp32 & ADC_RESFIFO_D_MASK); - - return true; -} -/*! - * brief Get the result in conversion FIFOn using blocking method. - * - * param base LPADC peripheral base address. - * param result Pointer to structure variable that keeps the conversion result in conversion FIFOn. - * param index Result FIFO index. - */ -void LPADC_GetConvResultBlocking(ADC_Type *base, lpadc_conv_result_t *result, uint8_t index) -{ - assert(result != NULL); /* Check if the input pointer is available. */ - - uint32_t tmp32 = 0U; - - tmp32 = base->RESFIFO[index]; - - while (ADC_RESFIFO_VALID_MASK != (tmp32 & ADC_RESFIFO_VALID_MASK)) - { - tmp32 = base->RESFIFO[index]; - } - - result->commandIdSource = (tmp32 & ADC_RESFIFO_CMDSRC_MASK) >> ADC_RESFIFO_CMDSRC_SHIFT; - result->loopCountIndex = (tmp32 & ADC_RESFIFO_LOOPCNT_MASK) >> ADC_RESFIFO_LOOPCNT_SHIFT; - result->triggerIdSource = (tmp32 & ADC_RESFIFO_TSRC_MASK) >> ADC_RESFIFO_TSRC_SHIFT; - result->convValue = (uint16_t)(tmp32 & ADC_RESFIFO_D_MASK); -} -#else -/*! - * brief Get the result in conversion FIFO. - * - * param base LPADC peripheral base address. - * param result Pointer to structure variable that keeps the conversion result in conversion FIFO. - * - * return Status whether FIFO entry is valid. - */ -bool LPADC_GetConvResult(ADC_Type *base, lpadc_conv_result_t *result) -{ - assert(result != NULL); /* Check if the input pointer is available. */ - - uint32_t tmp32 = 0U; - - tmp32 = base->RESFIFO; - - if (ADC_RESFIFO_VALID_MASK != (tmp32 & ADC_RESFIFO_VALID_MASK)) - { - return false; /* FIFO is empty. Discard any read from RESFIFO. */ - } - - result->commandIdSource = (tmp32 & ADC_RESFIFO_CMDSRC_MASK) >> ADC_RESFIFO_CMDSRC_SHIFT; - result->loopCountIndex = (tmp32 & ADC_RESFIFO_LOOPCNT_MASK) >> ADC_RESFIFO_LOOPCNT_SHIFT; - result->triggerIdSource = (tmp32 & ADC_RESFIFO_TSRC_MASK) >> ADC_RESFIFO_TSRC_SHIFT; - result->convValue = (uint16_t)(tmp32 & ADC_RESFIFO_D_MASK); - - return true; -} -/*! - * @brief Get the result in conversion FIFO using blocking method. - * - * @param base LPADC peripheral base address. - * @param result Pointer to structure variable that keeps the conversion result in conversion FIFO. - */ -void LPADC_GetConvResultBlocking(ADC_Type *base, lpadc_conv_result_t *result) -{ - assert(result != NULL); /* Check if the input pointer is available. */ - - uint32_t tmp32 = 0U; - - tmp32 = base->RESFIFO; - - while (ADC_RESFIFO_VALID_MASK != (tmp32 & ADC_RESFIFO_VALID_MASK)) - { - tmp32 = base->RESFIFO; - } - - result->commandIdSource = (tmp32 & ADC_RESFIFO_CMDSRC_MASK) >> ADC_RESFIFO_CMDSRC_SHIFT; - result->loopCountIndex = (tmp32 & ADC_RESFIFO_LOOPCNT_MASK) >> ADC_RESFIFO_LOOPCNT_SHIFT; - result->triggerIdSource = (tmp32 & ADC_RESFIFO_TSRC_MASK) >> ADC_RESFIFO_TSRC_SHIFT; - result->convValue = (uint16_t)(tmp32 & ADC_RESFIFO_D_MASK); -} -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ - -/*! - * brief Configure the conversion trigger source. - * - * Each programmable trigger can launch the conversion command in command buffer. - * - * param base LPADC peripheral base address. - * param triggerId ID for each trigger. Typically, the available value range is from 0 to 3. - * param config Pointer to configuration structure. See to #lpadc_conv_trigger_config_t. - */ -void LPADC_SetConvTriggerConfig(ADC_Type *base, uint32_t triggerId, const lpadc_conv_trigger_config_t *config) -{ - assert(triggerId < ADC_TCTRL_COUNT); /* Check if the triggerId is available in this device. */ - assert(config != NULL); /* Check if the input pointer is available. */ - - uint32_t tmp32; - - tmp32 = ADC_TCTRL_TCMD(config->targetCommandId) /* Trigger command select. */ - | ADC_TCTRL_TDLY(config->delayPower) /* Trigger delay select. */ - | ADC_TCTRL_TPRI(config->priority) /* Trigger priority setting. */ -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - | ADC_TCTRL_FIFO_SEL_A(config->channelAFIFOSelect) -#if !(defined(FSL_FEATURE_LPADC_HAS_NO_TCTRL_FIFO_SEL_B) && FSL_FEATURE_LPADC_HAS_NO_TCTRL_FIFO_SEL_B) - | ADC_TCTRL_FIFO_SEL_B(config->channelBFIFOSelect) -#endif /* FSL_FEATURE_LPADC_HAS_NO_TCTRL_FIFO_SEL_B */ -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ - ; - if (config->enableHardwareTrigger) - { - tmp32 |= ADC_TCTRL_HTEN_MASK; - } - - base->TCTRL[triggerId] = tmp32; -} - -/*! - * brief Gets an available pre-defined settings for trigger's configuration. - * - * This function initializes the trigger's configuration structure with an available settings. The default values are: - * code - * config->targetCommandId = 0U; - * config->delayPower = 0U; - * config->priority = 0U; - * config->channelAFIFOSelect = 0U; - * config->channelBFIFOSelect = 0U; - * config->enableHardwareTrigger = false; - * endcode - * param config Pointer to configuration structure. - */ -void LPADC_GetDefaultConvTriggerConfig(lpadc_conv_trigger_config_t *config) -{ - assert(config != NULL); /* Check if the input pointer is available. */ - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->targetCommandId = 0U; - config->delayPower = 0U; - config->priority = 0U; -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - config->channelAFIFOSelect = 0U; - config->channelBFIFOSelect = 0U; -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ - config->enableHardwareTrigger = false; -} - -/*! - * brief Configure conversion command. - * - * note The number of compare value register on different chips is different, that is mean in some chips, some - * command buffers do not have the compare functionality. - * - * param base LPADC peripheral base address. - * param commandId ID for command in command buffer. Typically, the available value range is 1 - 15. - * param config Pointer to configuration structure. See to #lpadc_conv_command_config_t. - */ -void LPADC_SetConvCommandConfig(ADC_Type *base, uint32_t commandId, const lpadc_conv_command_config_t *config) -{ - assert(commandId < (ADC_CMDL_COUNT + 1U)); /* Check if the commandId is available on this device. */ - assert(config != NULL); /* Check if the input pointer is available. */ - - uint32_t tmp32 = 0; - - commandId--; /* The available command number are 1-15, while the index of register group are 0-14. */ - - /* ADCx_CMDL. */ - tmp32 = ADC_CMDL_ADCH(config->channelNumber); /* Channel number. */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTB_ADCH) && FSL_FEATURE_LPADC_HAS_CMDL_ALTB_ADCH - tmp32 |= ADC_CMDL_ALTB_ADCH(config->channelBNumber); /* Alternate channel B number. */ -#endif -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_CSCALE) && FSL_FEATURE_LPADC_HAS_CMDL_CSCALE - tmp32 |= ADC_CMDL_CSCALE(config->sampleScaleMode); /* Full/Part scale input voltage. */ -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_CSCALE */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE) && FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE - tmp32 |= ADC_CMDL_ALTB_CSCALE(config->channelBScaleMode); /* Alternate channel B full/Part scale input voltage. */ -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE */ - -#if !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_DIFF) && FSL_FEATURE_LPADC_HAS_CMDL_DIFF - assert(((config->sampleChannelMode >= kLPADC_SampleChannelDiffBothSideAB) && - (((base->VERID) & ADC_VERID_DIFFEN_MASK) != 0U)) || - (config->sampleChannelMode < kLPADC_SampleChannelDiffBothSideAB)); -#endif /* defined(FSL_FEATURE_LPADC_HAS_CMDL_DIFF) && FSL_FEATURE_LPADC_HAS_CMDL_DIFF */ - -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_CTYPE) && FSL_FEATURE_LPADC_HAS_CMDL_CTYPE - assert(((config->sampleChannelMode == kLPADC_SampleChannelDiffBothSide) && - (((base->VERID) & ADC_VERID_DIFFEN_MASK) != 0U)) || - ((config->sampleChannelMode == kLPADC_SampleChannelDualSingleEndBothSide) && - (((base->VERID) & ADC_VERID_NUM_SEC_MASK) != 0U)) || - (config->sampleChannelMode < kLPADC_SampleChannelDualSingleEndBothSide)); -#endif /* defined(FSL_FEATURE_LPADC_HAS_CMDL_CTYPE) && FSL_FEATURE_LPADC_HAS_CMDL_CTYPE */ -#endif /* !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) */ - - tmp32 |= ADC_CMDL_CHANNEL_MODE(config->sampleChannelMode); - -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_MODE) && FSL_FEATURE_LPADC_HAS_CMDL_MODE - tmp32 |= ADC_CMDL_MODE(config->conversionResolutionMode); -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_MODE */ - -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN) && FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN - /* Enable alternate channel B.*/ - if (config->enableChannelB) - { - tmp32 |= ADC_CMDL_ALTBEN_MASK; - } -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN */ - - base->CMD[commandId].CMDL = tmp32; - - /* ADCx_CMDH. */ - tmp32 = ADC_CMDH_NEXT(config->chainedNextCommandNumber) /* Next Command Select. */ - | ADC_CMDH_LOOP(config->loopCount) /* Loop Count Select. */ - | ADC_CMDH_AVGS(config->hardwareAverageMode) /* Hardware Average Select. */ - | ADC_CMDH_STS(config->sampleTimeMode) /* Sample Time Select. */ - | ADC_CMDH_CMPEN(config->hardwareCompareMode); /* Hardware compare enable. */ -#if (defined(FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG) && FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG) - if (config->enableWaitTrigger) - { - tmp32 |= ADC_CMDH_WAIT_TRIG_MASK; /* Wait trigger enable. */ - } -#endif /* FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG */ - - if (config->enableAutoChannelIncrement) - { - tmp32 |= ADC_CMDH_LWI_MASK; - } - base->CMD[commandId].CMDH = tmp32; - - /* Hardware compare settings. - * Not all Command Buffers have an associated Compare Value register. The compare function is only available on - * Command Buffers that have a corresponding Compare Value register. Therefore, assertion judgment needs to be - * made before setting the CV register. - */ - - if ((kLPADC_HardwareCompareDisabled != config->hardwareCompareMode) && (commandId < ADC_CV_COUNT)) - { - /* Set CV register. */ - base->CV[commandId] = (ADC_CV_CVH(config->hardwareCompareValueHigh) /* Compare value high. */ - | ADC_CV_CVL(config->hardwareCompareValueLow)); /* Compare value low. */ - } -} - -/*! - * brief Gets an available pre-defined settings for conversion command's configuration. - * - * This function initializes the conversion command's configuration structure with an available settings. The default - * values are: - * code - * config->sampleScaleMode = kLPADC_SampleFullScale; - * config->channelBScaleMode = kLPADC_SampleFullScale; - * config->sampleChannelMode = kLPADC_SampleChannelSingleEndSideA; - * config->channelNumber = 0U; - * config->channelBNumber = 0U; - * config->chainedNextCommandNumber = 0U; - * config->enableAutoChannelIncrement = false; - * config->loopCount = 0U; - * config->hardwareAverageMode = kLPADC_HardwareAverageCount1; - * config->sampleTimeMode = kLPADC_SampleTimeADCK3; - * config->hardwareCompareMode = kLPADC_HardwareCompareDisabled; - * config->hardwareCompareValueHigh = 0U; - * config->hardwareCompareValueLow = 0U; - * config->conversionResolutionMode = kLPADC_ConversionResolutionStandard; - * config->enableWaitTrigger = false; - * config->enableChannelB = false; - * endcode - * param config Pointer to configuration structure. - */ -void LPADC_GetDefaultConvCommandConfig(lpadc_conv_command_config_t *config) -{ - assert(config != NULL); /* Check if the input pointer is available. */ - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_CSCALE) && FSL_FEATURE_LPADC_HAS_CMDL_CSCALE - config->sampleScaleMode = kLPADC_SampleFullScale; -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_CSCALE */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE) && FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE - config->channelBScaleMode = kLPADC_SampleFullScale; -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE */ - config->sampleChannelMode = kLPADC_SampleChannelSingleEndSideA; - config->channelNumber = 0U; -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTB_ADCH) && FSL_FEATURE_LPADC_HAS_CMDL_ALTB_ADCH - config->channelBNumber = 0U; -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE */ - config->chainedNextCommandNumber = 0U; /* No next command defined. */ - config->enableAutoChannelIncrement = false; - config->loopCount = 0U; - config->hardwareAverageMode = kLPADC_HardwareAverageCount1; - config->sampleTimeMode = kLPADC_SampleTimeADCK3; - config->hardwareCompareMode = kLPADC_HardwareCompareDisabled; - config->hardwareCompareValueHigh = 0U; /* No used. */ - config->hardwareCompareValueLow = 0U; /* No used. */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_MODE) && FSL_FEATURE_LPADC_HAS_CMDL_MODE - config->conversionResolutionMode = kLPADC_ConversionResolutionStandard; -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_MODE */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG) && FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG - config->enableWaitTrigger = false; -#endif /* FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN) && FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN - config->enableChannelB = false; /* Enable alternate channel B.*/ -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN */ -} - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_CALOFS) && FSL_FEATURE_LPADC_HAS_CFG_CALOFS -/*! - * brief Enable the calibration function. - * - * When CALOFS is set, the ADC is configured to perform a calibration function anytime the ADC executes - * a conversion. Any channel selected is ignored and the value returned in the RESFIFO is a signed value - * between -31 and 31. -32 is not a valid and is never a returned value. Software should copy the lower 6- - * bits of the conversion result stored in the RESFIFO after a completed calibration conversion to the - * OFSTRIM field. The OFSTRIM field is used in normal operation for offset correction. - * - * param base LPADC peripheral base address. - * param enable switcher to the calibration function. - */ -void LPADC_EnableCalibration(ADC_Type *base, bool enable) -{ - LPADC_Enable(base, false); - if (enable) - { - base->CFG |= ADC_CFG_CALOFS_MASK; - } - else - { - base->CFG &= ~ADC_CFG_CALOFS_MASK; - } - LPADC_Enable(base, true); -} - -#if defined(FSL_FEATURE_LPADC_HAS_OFSTRIM) && FSL_FEATURE_LPADC_HAS_OFSTRIM -/*! - * brief Do auto calibration. - * - * Calibration function should be executed before using converter in application. It used the software trigger and a - * dummy conversion, get the offset and write them into the OFSTRIM register. It called some of functional API - * including: -LPADC_EnableCalibration(...) -LPADC_LPADC_SetOffsetValue(...) -LPADC_SetConvCommandConfig(...) - * -LPADC_SetConvTriggerConfig(...) - * - * param base LPADC peripheral base address. - */ -void LPADC_DoAutoCalibration(ADC_Type *base) -{ - assert(0u == LPADC_GetConvResultCount(base)); - - uint32_t mLpadcCMDL; - uint32_t mLpadcCMDH; - uint32_t mLpadcTrigger; - lpadc_conv_trigger_config_t mLpadcTriggerConfigStruct; - lpadc_conv_command_config_t mLpadcCommandConfigStruct; - lpadc_conv_result_t mLpadcResultConfigStruct; - - /* Enable the calibration function. */ - LPADC_EnableCalibration(base, true); - - /* Keep the CMD and TRG state here and restore it later if the calibration completes.*/ - mLpadcCMDL = base->CMD[0].CMDL; /* CMD1L. */ - mLpadcCMDH = base->CMD[0].CMDH; /* CMD1H. */ - mLpadcTrigger = base->TCTRL[0]; /* Trigger0. */ - - /* Set trigger0 configuration - for software trigger. */ - LPADC_GetDefaultConvTriggerConfig(&mLpadcTriggerConfigStruct); - mLpadcTriggerConfigStruct.targetCommandId = 1U; /* CMD1 is executed. */ - LPADC_SetConvTriggerConfig(base, 0U, &mLpadcTriggerConfigStruct); /* Configurate the trigger0. */ - - /* Set conversion CMD configuration. */ - LPADC_GetDefaultConvCommandConfig(&mLpadcCommandConfigStruct); - mLpadcCommandConfigStruct.hardwareAverageMode = kLPADC_HardwareAverageCount128; - LPADC_SetConvCommandConfig(base, 1U, &mLpadcCommandConfigStruct); /* Set CMD1 configuration. */ - - /* Do calibration. */ - LPADC_DoSoftwareTrigger(base, 1U); /* 1U is trigger0 mask. */ - while (!LPADC_GetConvResult(base, &mLpadcResultConfigStruct)) - { - } - /* The valid bits of data are bits 14:3 in the RESFIFO register. */ - LPADC_SetOffsetValue(base, (uint32_t)(mLpadcResultConfigStruct.convValue) >> 3UL); - /* Disable the calibration function. */ - LPADC_EnableCalibration(base, false); - - /* restore CMD and TRG registers. */ - base->CMD[0].CMDL = mLpadcCMDL; /* CMD1L. */ - base->CMD[0].CMDH = mLpadcCMDH; /* CMD1H. */ - base->TCTRL[0] = mLpadcTrigger; /* Trigger0. */ -} -#endif /* FSL_FEATURE_LPADC_HAS_OFSTRIM */ -#endif /* FSL_FEATURE_LPADC_HAS_CFG_CALOFS */ - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFS) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFS -/*! - * brief Do offset calibration. - * - * param base LPADC peripheral base address. - */ -void LPADC_DoOffsetCalibration(ADC_Type *base) -{ - LPADC_EnableOffsetCalibration(base, true); - while (ADC_STAT_CAL_RDY_MASK != (base->STAT & ADC_STAT_CAL_RDY_MASK)) - { - } -} - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ -/*! - * brief Do auto calibration. - * - * param base LPADC peripheral base address. - */ -void LPADC_DoAutoCalibration(ADC_Type *base) -{ - LPADC_PrepareAutoCalibration(base); - LPADC_FinishAutoCalibration(base); -} - -/*! - * brief Prepare auto calibration, LPADC_FinishAutoCalibration has to be called before using the LPADC. - * LPADC_DoAutoCalibration has been split in two API to avoid to be stuck too long in the function. - * - * param base LPADC peripheral base address. - */ -void LPADC_PrepareAutoCalibration(ADC_Type *base) -{ -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - assert((0U == LPADC_GetConvResultCount(base, 0)) && (0U == LPADC_GetConvResultCount(base, 1))); -#else /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 1)) */ - assert(LPADC_GetConvResultCount(base) == 0U); -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) */ - - /* Request gain calibration. */ - base->CTRL |= ADC_CTRL_CAL_REQ_MASK; -} - -/*! - * brief Finish auto calibration start with LPADC_PrepareAutoCalibration. - * - * param base LPADC peripheral base address. - */ -void LPADC_FinishAutoCalibration(ADC_Type *base) -{ -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE - int32_t GCCa; - int32_t GCCb; - float GCRa; - float GCRb; -#else - uint32_t GCCa; - float GCRa; -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - uint32_t GCCb; - float GCRb; -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE */ - - while ((ADC_GCC_RDY_MASK != (base->GCC[0] & ADC_GCC_RDY_MASK)) -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - || (ADC_GCC_RDY_MASK != (base->GCC[1] & ADC_GCC_RDY_MASK)) -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ - ) - { - } - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE - GCCa = (int32_t)(base->GCC[0] & ADC_GCC_GAIN_CAL_MASK); - GCCb = (int32_t)(base->GCC[1] & ADC_GCC_GAIN_CAL_MASK); - if (0U != ((base->GCC[0]) & 0x8000U)) - { - GCCa = GCCa - 0x10000; - GCRa = (float)((131072.0) / - (131072.0 - (double)GCCa)); /* Gain_CalA = (131072.0 / (131072-(ADC_GCC_GAIN_CAL(ADC->GCC[0]))*/ - base->GCR[0] = LPADC_GetGainConvResult(GCRa); /* write A side GCALR. */ - } - - if (0U != ((base->GCC[1]) & 0x8000U)) - { - GCCb = GCCb - 0x10000; - GCRb = (float)((131072.0) / - (131072.0 - (double)GCCb)); /* Gain_CalB = (131072.0 / (131072-(ADC_GCC_GAIN_CAL(ADC->GCC[1]))*/ - base->GCR[1] = LPADC_GetGainConvResult(GCRb); /* write B side GCALR. */ - } -#else - /* Calculate gain offset. */ - GCCa = (base->GCC[0] & ADC_GCC_GAIN_CAL_MASK); - GCRa = (float)((131072.0) / - (131072.0 - (double)GCCa)); /* Gain_CalA = (131072.0 / (131072-(ADC_GCC_GAIN_CAL(ADC->GCC[0]))*/ - base->GCR[0] = LPADC_GetGainConvResult(GCRa); /* write A side GCALR. */ - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - GCCb = (base->GCC[1] & ADC_GCC_GAIN_CAL_MASK); - GCRb = (float)((131072.0) / - (131072.0 - (double)GCCb)); /* Gain_CalB = (131072.0 / (131072-(ADC_GCC_GAIN_CAL(ADC->GCC[1]))*/ - base->GCR[1] = LPADC_GetGainConvResult(GCRb); /* write B side GCALR. */ -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE */ - /* Indicate the values are valid. */ - base->GCR[0] |= ADC_GCR_RDY_MASK; -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - base->GCR[1] |= ADC_GCR_RDY_MASK; -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ - - while (ADC_STAT_CAL_RDY_MASK != (base->STAT & ADC_STAT_CAL_RDY_MASK)) - { - } -} -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ */ - -/*! - * brief Get calibration value into the memory which is defined by invoker. - * - * note Please note the ADC will be disabled temporary. - * note This function should be used after finish calibration. - * - * param base LPADC peripheral base address. - * param ptrCalibrationValue Pointer to lpadc_calibration_value_t structure, this memory block should be always powered - * on even in low power modes. - */ -void LPADC_GetCalibrationValue(ADC_Type *base, lpadc_calibration_value_t *ptrCalibrationValue) -{ - assert(ptrCalibrationValue != NULL); - - bool adcEnabled = false; - - /* Check if ADC is enabled. */ - if ((base->CTRL & ADC_CTRL_ADCEN_MASK) != 0UL) - { - LPADC_Enable(base, false); - adcEnabled = true; - } - -#if (defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) - uint32_t i; - for (i = 0UL; i < 33UL; i++) - { -#if defined(ADC_CAL_GAR0_CAL_GAR_VAL_MASK) - ptrCalibrationValue->generalCalibrationValueA[i] = - (uint16_t)((*(((volatile uint32_t *)(&(base->CAL_GAR0))) + i)) & 0xFFFFU); -#if !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) - ptrCalibrationValue->generalCalibrationValueB[i] = - (uint16_t)((*(((volatile uint32_t *)(&(base->CAL_GBR0))) + i)) & 0xFFFFU); -#endif /* (defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) */ -#else - ptrCalibrationValue->generalCalibrationValueA[i] = - (uint16_t)((*(((volatile uint32_t *)(&(base->CAL_GAR[0]))) + i)) & 0xFFFFU); -#if !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) - ptrCalibrationValue->generalCalibrationValueB[i] = - (uint16_t)((*(((volatile uint32_t *)(&(base->CAL_GBR[0]))) + i)) & 0xFFFFU); -#endif /* (defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) */ - -#endif /* defined(ADC_CAL_GAR0_CAL_GAR_VAL_MASK) */ - } -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ */ - - ptrCalibrationValue->gainCalibrationResultA = (uint16_t)(base->GCR[0] & ADC_GCR_GCALR_MASK); -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - ptrCalibrationValue->gainCalibrationResultB = (uint16_t)(base->GCR[1] & ADC_GCR_GCALR_MASK); -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ - - if (adcEnabled) - { - LPADC_Enable(base, true); - } -} - -/*! - * brief Set calibration value into ADC calibration registers. - * - * note Please note the ADC will be disabled temporary. - * - * param base LPADC peripheral base address. - * param ptrCalibrationValue Pointer to lpadc_calibration_value_t structure which contains ADC's calibration value. - */ -void LPADC_SetCalibrationValue(ADC_Type *base, const lpadc_calibration_value_t *ptrCalibrationValue) -{ - assert(ptrCalibrationValue != NULL); - - bool adcEnabled = false; - - /* Check if ADC is enabled. */ - if ((base->CTRL & ADC_CTRL_ADCEN_MASK) != 0UL) - { - LPADC_Enable(base, false); - adcEnabled = true; - } - -#if (defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) - for (uint32_t i = 0UL; i < 33UL; i++) - { -#if defined(ADC_CAL_GAR0_CAL_GAR_VAL_MASK) - *(((volatile uint32_t *)(&(base->CAL_GAR0))) + i) = ptrCalibrationValue->generalCalibrationValueA[i]; -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - *(((volatile uint32_t *)(&(base->CAL_GBR0))) + i) = ptrCalibrationValue->generalCalibrationValueB[i]; -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ -#else - *(((volatile uint32_t *)(&(base->CAL_GAR[0]))) + i) = ptrCalibrationValue->generalCalibrationValueA[i]; -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - *(((volatile uint32_t *)(&(base->CAL_GBR[0]))) + i) = ptrCalibrationValue->generalCalibrationValueB[i]; -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ -#endif /* defined(ADC_CAL_GAR0_CAL_GAR_VAL_MASK) */ - } -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ */ - - base->GCR[0] = ADC_GCR_GCALR(ptrCalibrationValue->gainCalibrationResultA) | ADC_GCR_RDY_MASK; -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - base->GCR[1] = ADC_GCR_GCALR(ptrCalibrationValue->gainCalibrationResultB) | ADC_GCR_RDY_MASK; -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ - /* - * $Branch Coverage Justification$ - * while ((base->STAT & ADC_STAT_CAL_RDY_MASK) == ADC_STAT_CAL_RDY_MASK) not covered. Test unfeasible, - * the calibration ready state is too short not to catch. - */ - while (ADC_STAT_CAL_RDY_MASK != (base->STAT & ADC_STAT_CAL_RDY_MASK)) - { - } - - if (adcEnabled) - { - LPADC_Enable(base, true); - } -} - -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CALOFS */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpadc.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpadc.h deleted file mode 100644 index e0d2f4b6ee4..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpadc.h +++ /dev/null @@ -1,1529 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LPADC_H_ -#define FSL_LPADC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup lpadc - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief LPADC driver version 2.8.4. */ -#define FSL_LPADC_DRIVER_VERSION (MAKE_VERSION(2, 8, 4)) -/*! @} */ - -#if (defined(FSL_FEATURE_LPADC_OFSTRIM_COUNT) && (FSL_FEATURE_LPADC_OFSTRIM_COUNT == 1)) -#define ADC_OFSTRIM_OFSTRIM_MAX (ADC_OFSTRIM_OFSTRIM_MASK >> ADC_OFSTRIM_OFSTRIM_SHIFT) -#define ADC_OFSTRIM_OFSTRIM_SIGN ((ADC_OFSTRIM_OFSTRIM_MAX + 1U) >> 1U) - -#elif (defined(FSL_FEATURE_LPADC_OFSTRIM_COUNT) && (FSL_FEATURE_LPADC_OFSTRIM_COUNT == 2)) -#define ADC_OFSTRIM_OFSTRIM_A_MAX (ADC_OFSTRIM_OFSTRIM_A_MASK >> ADC_OFSTRIM_OFSTRIM_A_SHIFT) -#define ADC_OFSTRIM_OFSTRIM_B_MAX (ADC_OFSTRIM_OFSTRIM_B_MASK >> ADC_OFSTRIM_OFSTRIM_B_SHIFT) -#define ADC_OFSTRIM_OFSTRIM_A_SIGN ((ADC_OFSTRIM_OFSTRIM_A_MAX + 1U) >> 1U) -#define ADC_OFSTRIM_OFSTRIM_B_SIGN ((ADC_OFSTRIM_OFSTRIM_B_MAX + 1U) >> 1U) -#endif /* defined(FSL_FEATURE_LPADC_OFSTRIM_COUNT) */ - -/*! - * @brief Define the MACRO function to get command status from status value. - * - * The statusVal is the return value from LPADC_GetStatusFlags(). - */ -#define LPADC_GET_ACTIVE_COMMAND_STATUS(statusVal) ((statusVal & ADC_STAT_CMDACT_MASK) >> ADC_STAT_CMDACT_SHIFT) - -/*! - * @brief Define the MACRO function to get trigger status from status value. - * - * The statusVal is the return value from LPADC_GetStatusFlags(). - */ -#define LPADC_GET_ACTIVE_TRIGGER_STATUE(statusVal) ((statusVal & ADC_STAT_TRGACT_MASK) >> ADC_STAT_TRGACT_SHIFT) - -/* Map macros to the unified name. */ -#if !defined(ADC_STAT_FOF0_MASK) -#ifdef ADC_STAT_FOF_MASK -#define ADC_STAT_FOF0_MASK ADC_STAT_FOF_MASK -#else -#error "ADC_STAT_FOF0_MASK not defined" -#endif /* ifdef(ADC_STAT_FOF_MASK) */ -#endif /* !defined(ADC_STAT_FOF0_MASK) */ - -#if !defined(ADC_STAT_RDY0_MASK) -#ifdef ADC_STAT_RDY_MASK -#define ADC_STAT_RDY0_MASK ADC_STAT_RDY_MASK -#else -#error "ADC_STAT_RDY0_MASK not defined" -#endif /* ifdef ADC_STAT_RDY_MASK */ -#endif /* !defined(ADC_STAT_RDY0_MASK) */ - -#if !defined(ADC_IE_FOFIE0_MASK) -#ifdef ADC_IE_FOFIE_MASK -#define ADC_IE_FOFIE0_MASK ADC_IE_FOFIE_MASK -#else -#error "ADC_IE_FOFIE0_MASK not defined" -#endif /* ifdef ADC_IE_FOFIE_MASK */ -#endif /* !defined(ADC_IE_FOFIE0_MASK) */ - -#if !defined(ADC_IE_FWMIE0_MASK) -#ifdef ADC_IE_FWMIE_MASK -#define ADC_IE_FWMIE0_MASK ADC_IE_FWMIE_MASK -#else -#error "ADC_IE_FWMIE0_MASK not defined" -#endif /* ifdef ADC_IE_FWMIE_MASK */ -#endif /* !defined(ADC_IE_FWMIE0_MASK) */ - -/*! - * @brief Define hardware flags of the module. - */ -enum _lpadc_status_flags -{ - kLPADC_ResultFIFO0OverflowFlag = ADC_STAT_FOF0_MASK, /*!< Indicates that more data has been written to the Result - FIFO 0 than it can hold. */ - kLPADC_ResultFIFO0ReadyFlag = ADC_STAT_RDY0_MASK, /*!< Indicates when the number of valid datawords in the result - FIFO 0 is greater than the setting watermark level. */ - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - kLPADC_ResultFIFO1OverflowFlag = ADC_STAT_FOF1_MASK, /*!< Indicates that more data has been written to the Result - FIFO 1 than it can hold. */ - kLPADC_ResultFIFO1ReadyFlag = ADC_STAT_RDY1_MASK, /*!< Indicates when the number of valid datawords in the result - FIFO 1 is greater than the setting watermark level. */ -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ - -#if (defined(FSL_FEATURE_LPADC_HAS_STAT_TEXC_INT) && (FSL_FEATURE_LPADC_HAS_STAT_TEXC_INT == 1U)) - kLPADC_TriggerExceptionFlag = ADC_STAT_TEXC_INT_MASK, /*!< Indicates that a trigger exception event has occurred. */ -#endif /* (defined(FSL_FEATURE_LPADC_HAS_STAT_TEXC_INT) && (FSL_FEATURE_LPADC_HAS_STAT_TEXC_INT == 1U)) */ - -#if (defined(FSL_FEATURE_LPADC_HAS_STAT_TCOMP_INT) && (FSL_FEATURE_LPADC_HAS_STAT_TCOMP_INT == 1U)) - kLPADC_TriggerCompletionFlag = ADC_STAT_TCOMP_INT_MASK, /*!< Indicates that a trigger completion event has occurred. - */ -#endif /* (defined(FSL_FEATURE_LPADC_HAS_STAT_TCOMP_INT) && (FSL_FEATURE_LPADC_HAS_STAT_TCOMP_INT == 1U)) */ - -#if (defined(FSL_FEATURE_LPADC_HAS_STAT_CAL_RDY) && (FSL_FEATURE_LPADC_HAS_STAT_CAL_RDY == 1U)) - kLPADC_CalibrationReadyFlag = ADC_STAT_CAL_RDY_MASK, /*!< Indicates that the calibration process is done. */ -#endif /* (defined(FSL_FEATURE_LPADC_HAS_STAT_CAL_RDY) && (FSL_FEATURE_LPADC_HAS_STAT_CAL_RDY == 1U)) */ - -#if (defined(FSL_FEATURE_LPADC_HAS_STAT_ADC_ACTIVE) && (FSL_FEATURE_LPADC_HAS_STAT_ADC_ACTIVE == 1U)) - kLPADC_ActiveFlag = ADC_STAT_ADC_ACTIVE_MASK, /*!< Indicates that the ADC is in active state. */ -#endif /* (defined(FSL_FEATURE_LPADC_HAS_STAT_ADC_ACTIVE) && (FSL_FEATURE_LPADC_HAS_STAT_ADC_ACTIVE == 1U)) */ - - kLPADC_ResultFIFOOverflowFlag = kLPADC_ResultFIFO0OverflowFlag, /*!< To compilitable with old version, do not - recommend using this, please use @ref - kLPADC_ResultFIFO0OverflowFlag as instead. */ - - kLPADC_ResultFIFOReadyFlag = kLPADC_ResultFIFO0ReadyFlag, /*!< To compilitable with old version, do not - recommend using this, please use @ref - kLPADC_ResultFIFO0ReadyFlag as instead. */ -}; - -/*! - * @brief Define interrupt switchers of the module. - * - * Note: LPADC of different chips supports different number of trigger sources, - * please check the Reference Manual for details. - */ -enum _lpadc_interrupt_enable -{ - kLPADC_ResultFIFO0OverflowInterruptEnable = ADC_IE_FOFIE0_MASK, /*!< Configures ADC to generate overflow interrupt - requests when FOF0 flag is asserted. */ - kLPADC_FIFO0WatermarkInterruptEnable = ADC_IE_FWMIE0_MASK, /*!< Configures ADC to generate watermark interrupt - requests when RDY0 flag is asserted. */ - kLPADC_ResultFIFOOverflowInterruptEnable = kLPADC_ResultFIFO0OverflowInterruptEnable, /*!< To compilitable with old - version, do not recommend using this, - please use - #kLPADC_ResultFIFO0OverflowInterruptEnable - as instead. */ - kLPADC_FIFOWatermarkInterruptEnable = kLPADC_FIFO0WatermarkInterruptEnable, /*!< To compilitable with old version, - do not recommend using this, please - use - #kLPADC_FIFO0WatermarkInterruptEnable - as instead. */ - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - kLPADC_ResultFIFO1OverflowInterruptEnable = ADC_IE_FOFIE1_MASK, /*!< Configures ADC to generate overflow interrupt - requests when FOF1 flag is asserted. */ - kLPADC_FIFO1WatermarkInterruptEnable = ADC_IE_FWMIE1_MASK, /*!< Configures ADC to generate watermark interrupt - requests when RDY1 flag is asserted. */ -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ - -#if (defined(FSL_FEATURE_LPADC_HAS_IE_TEXC_IE) && (FSL_FEATURE_LPADC_HAS_IE_TEXC_IE == 1U)) - kLPADC_TriggerExceptionInterruptEnable = ADC_IE_TEXC_IE_MASK, /*!< Configures ADC to generate trigger exception - interrupt. */ -#endif /* (defined(FSL_FEATURE_LPADC_HAS_IE_TEXC_IE) && (FSL_FEATURE_LPADC_HAS_IE_TEXC_IE == 1U)) */ - -#if (defined(FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE) && (FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE == 1U)) - kLPADC_Trigger0CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 0UL), /*!< Configures ADC to generate interrupt - when trigger 0 completion. */ - kLPADC_Trigger1CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 1UL), /*!< Configures ADC to generate interrupt - when trigger 1 completion. */ - kLPADC_Trigger2CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 2UL), /*!< Configures ADC to generate interrupt - when trigger 2 completion. */ - kLPADC_Trigger3CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 3UL), /*!< Configures ADC to generate interrupt - when trigger 3 completion. */ - kLPADC_Trigger4CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 4UL), /*!< Configures ADC to generate interrupt - when trigger 4 completion. */ - kLPADC_Trigger5CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 5UL), /*!< Configures ADC to generate interrupt - when trigger 5 completion. */ - kLPADC_Trigger6CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 6UL), /*!< Configures ADC to generate interrupt - when trigger 6 completion. */ - kLPADC_Trigger7CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 7UL), /*!< Configures ADC to generate interrupt - when trigger 7 completion. */ - kLPADC_Trigger8CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 8UL), /*!< Configures ADC to generate interrupt - when trigger 8 completion. */ - kLPADC_Trigger9CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 9UL), /*!< Configures ADC to generate interrupt - when trigger 9 completion. */ - kLPADC_Trigger10CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 10UL), /*!< Configures ADC to generate interrupt - when trigger 10 completion. */ - kLPADC_Trigger11CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 11UL), /*!< Configures ADC to generate interrupt - when trigger 11 completion. */ - kLPADC_Trigger12CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 12UL), /*!< Configures ADC to generate interrupt - when trigger 12 completion. */ - kLPADC_Trigger13CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 13UL), /*!< Configures ADC to generate interrupt - when trigger 13 completion. */ - kLPADC_Trigger14CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 14UL), /*!< Configures ADC to generate interrupt - when trigger 14 completion. */ - kLPADC_Trigger15CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 15UL), /*!< Configures ADC to generate interrupt - when trigger 15 completion. */ -#endif /* #if (defined(FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE) && (FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE == 1U)) */ -}; - -#if (defined(FSL_FEATURE_LPADC_HAS_TSTAT) && (FSL_FEATURE_LPADC_HAS_TSTAT)) -/*! - * @brief The enumerator of lpadc trigger status flags, including interrupted flags and completed flags. - * - * Note: LPADC of different chips supports different number of trigger sources, - * please check the Reference Manual for details. - */ -enum _lpadc_trigger_status_flags -{ - kLPADC_Trigger0InterruptedFlag = 1UL << 0UL, /*!< Trigger 0 is interrupted by a high priority exception. */ - kLPADC_Trigger1InterruptedFlag = 1UL << 1UL, /*!< Trigger 1 is interrupted by a high priority exception. */ - kLPADC_Trigger2InterruptedFlag = 1UL << 2UL, /*!< Trigger 2 is interrupted by a high priority exception. */ - kLPADC_Trigger3InterruptedFlag = 1UL << 3UL, /*!< Trigger 3 is interrupted by a high priority exception. */ - kLPADC_Trigger4InterruptedFlag = 1UL << 4UL, /*!< Trigger 4 is interrupted by a high priority exception. */ - kLPADC_Trigger5InterruptedFlag = 1UL << 5UL, /*!< Trigger 5 is interrupted by a high priority exception. */ - kLPADC_Trigger6InterruptedFlag = 1UL << 6UL, /*!< Trigger 6 is interrupted by a high priority exception. */ - kLPADC_Trigger7InterruptedFlag = 1UL << 7UL, /*!< Trigger 7 is interrupted by a high priority exception. */ - kLPADC_Trigger8InterruptedFlag = 1UL << 8UL, /*!< Trigger 8 is interrupted by a high priority exception. */ - kLPADC_Trigger9InterruptedFlag = 1UL << 9UL, /*!< Trigger 9 is interrupted by a high priority exception. */ - kLPADC_Trigger10InterruptedFlag = 1UL << 10UL, /*!< Trigger 10 is interrupted by a high priority exception. */ - kLPADC_Trigger11InterruptedFlag = 1UL << 11UL, /*!< Trigger 11 is interrupted by a high priority exception. */ - kLPADC_Trigger12InterruptedFlag = 1UL << 12UL, /*!< Trigger 12 is interrupted by a high priority exception. */ - kLPADC_Trigger13InterruptedFlag = 1UL << 13UL, /*!< Trigger 13 is interrupted by a high priority exception. */ - kLPADC_Trigger14InterruptedFlag = 1UL << 14UL, /*!< Trigger 14 is interrupted by a high priority exception. */ - kLPADC_Trigger15InterruptedFlag = 1UL << 15UL, /*!< Trigger 15 is interrupted by a high priority exception. */ - - kLPADC_Trigger0CompletedFlag = 1UL << 16UL, /*!< Trigger 0 is completed and - trigger 0 has enabled completion interrupts. */ - kLPADC_Trigger1CompletedFlag = 1UL << 17UL, /*!< Trigger 1 is completed and - trigger 1 has enabled completion interrupts. */ - kLPADC_Trigger2CompletedFlag = 1UL << 18UL, /*!< Trigger 2 is completed and - trigger 2 has enabled completion interrupts. */ - kLPADC_Trigger3CompletedFlag = 1UL << 19UL, /*!< Trigger 3 is completed and - trigger 3 has enabled completion interrupts. */ - kLPADC_Trigger4CompletedFlag = 1UL << 20UL, /*!< Trigger 4 is completed and - trigger 4 has enabled completion interrupts. */ - kLPADC_Trigger5CompletedFlag = 1UL << 21UL, /*!< Trigger 5 is completed and - trigger 5 has enabled completion interrupts. */ - kLPADC_Trigger6CompletedFlag = 1UL << 22UL, /*!< Trigger 6 is completed and - trigger 6 has enabled completion interrupts. */ - kLPADC_Trigger7CompletedFlag = 1UL << 23UL, /*!< Trigger 7 is completed and - trigger 7 has enabled completion interrupts. */ - kLPADC_Trigger8CompletedFlag = 1UL << 24UL, /*!< Trigger 8 is completed and - trigger 8 has enabled completion interrupts. */ - kLPADC_Trigger9CompletedFlag = 1UL << 25UL, /*!< Trigger 9 is completed and - trigger 9 has enabled completion interrupts. */ - kLPADC_Trigger10CompletedFlag = 1UL << 26UL, /*!< Trigger 10 is completed and - trigger 10 has enabled completion interrupts. */ - kLPADC_Trigger11CompletedFlag = 1UL << 27UL, /*!< Trigger 11 is completed and - trigger 11 has enabled completion interrupts. */ - kLPADC_Trigger12CompletedFlag = 1UL << 28UL, /*!< Trigger 12 is completed and - trigger 12 has enabled completion interrupts. */ - kLPADC_Trigger13CompletedFlag = 1UL << 29UL, /*!< Trigger 13 is completed and - trigger 13 has enabled completion interrupts. */ - kLPADC_Trigger14CompletedFlag = 1UL << 30UL, /*!< Trigger 14 is completed and - trigger 14 has enabled completion interrupts. */ - kLPADC_Trigger15CompletedFlag = 1UL << 31UL, /*!< Trigger 15 is completed and - trigger 15 has enabled completion interrupts. */ -}; -#endif /* (defined(FSL_FEATURE_LPADC_HAS_TSTAT) && (FSL_FEATURE_LPADC_HAS_TSTAT)) */ - -/*! - * @brief Define enumeration of sample scale mode. - * - * The sample scale mode is used to reduce the selected ADC analog channel input voltage level by a factor. The maximum - * possible voltage on the ADC channel input should be considered when selecting a scale mode to ensure that the - * reducing factor always results voltage level at or below the VREFH reference. This reducing capability allows - * conversion of analog inputs higher than VREFH. A-side and B-side channel inputs are both scaled using the scale mode. - */ -typedef enum _lpadc_sample_scale_mode -{ - kLPADC_SamplePartScale = 0U, /*!< Use divided input voltage signal. - (For scale select,please refer to the reference manual). */ - kLPADC_SampleFullScale = 1U, /*!< Full scale (Factor of 1). */ -} lpadc_sample_scale_mode_t; - -/*! - * @brief Define enumeration of channel sample mode. - * - * The channel sample mode configures the channel with single-end/differential/dual-single-end, side A/B. - */ -typedef enum _lpadc_sample_channel_mode -{ - kLPADC_SampleChannelSingleEndSideA = 0x0U, /*!< Single-end mode, only A-side channel is converted. */ -#if !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) - kLPADC_SampleChannelSingleEndSideB = 0x1U, /*!< Single-end mode, only B-side channel is converted. */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_DIFF) && FSL_FEATURE_LPADC_HAS_CMDL_DIFF - kLPADC_SampleChannelDiffBothSideAB = 0x2U, /*!< Differential mode, the ADC result is (CHnA-CHnB). */ - kLPADC_SampleChannelDiffBothSideBA = 0x3U, /*!< Differential mode, the ADC result is (CHnB-CHnA). */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CMDL_DIFF) && FSL_FEATURE_LPADC_HAS_CMDL_DIFF */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_CTYPE) && FSL_FEATURE_LPADC_HAS_CMDL_CTYPE - kLPADC_SampleChannelDiffBothSide = 0x02U, /*!< Differential mode, the ADC result is (CHnA-CHnB). */ - kLPADC_SampleChannelDualSingleEndBothSide = 0x03U, /*!< Dual-Single-Ended Mode. Both A side and B side - channels are converted independently. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CMDL_CTYPE) && FSL_FEATURE_LPADC_HAS_CMDL_CTYPE */ -#endif /* !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) */ -} lpadc_sample_channel_mode_t; - -/*! - * @brief Define enumeration of hardware average selection. - * - * It Selects how many ADC conversions are averaged to create the ADC result. An internal storage buffer is used to - * capture temporary results while the averaging iterations are executed. - * - * @note Some enumerator values are not available on some devices, mainly depends on the size of AVGS field in CMDH - * register. - */ -typedef enum _lpadc_hardware_average_mode -{ - kLPADC_HardwareAverageCount1 = 0U, /*!< Single conversion. */ - kLPADC_HardwareAverageCount2 = 1U, /*!< 2 conversions averaged. */ - kLPADC_HardwareAverageCount4 = 2U, /*!< 4 conversions averaged. */ - kLPADC_HardwareAverageCount8 = 3U, /*!< 8 conversions averaged. */ - kLPADC_HardwareAverageCount16 = 4U, /*!< 16 conversions averaged. */ - kLPADC_HardwareAverageCount32 = 5U, /*!< 32 conversions averaged. */ - kLPADC_HardwareAverageCount64 = 6U, /*!< 64 conversions averaged. */ - kLPADC_HardwareAverageCount128 = 7U, /*!< 128 conversions averaged. */ -#if (defined(FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH) && \ - (FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH == 4U)) - kLPADC_HardwareAverageCount256 = 8U, /*!< 256 conversions averaged. */ - kLPADC_HardwareAverageCount512 = 9U, /*!< 512 conversions averaged. */ - kLPADC_HardwareAverageCount1024 = 10U, /*!< 1024 conversions averaged. */ -#endif /* (defined(FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH) && \ - (FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH == 4U))*/ -} lpadc_hardware_average_mode_t; - -/*! - * @brief Define enumeration of sample time selection. - * - * The shortest sample time maximizes conversion speed for lower impedance inputs. Extending sample time allows higher - * impedance inputs to be accurately sampled. Longer sample times can also be used to lower overall power consumption - * when command looping and sequencing is configured and high conversion rates are not required. - */ -typedef enum _lpadc_sample_time_mode -{ - kLPADC_SampleTimeADCK3 = 0U, /*!< 3 ADCK cycles total sample time. */ - kLPADC_SampleTimeADCK5 = 1U, /*!< 5 ADCK cycles total sample time. */ - kLPADC_SampleTimeADCK7 = 2U, /*!< 7 ADCK cycles total sample time. */ - kLPADC_SampleTimeADCK11 = 3U, /*!< 11 ADCK cycles total sample time. */ - kLPADC_SampleTimeADCK19 = 4U, /*!< 19 ADCK cycles total sample time. */ - kLPADC_SampleTimeADCK35 = 5U, /*!< 35 ADCK cycles total sample time. */ - kLPADC_SampleTimeADCK67 = 6U, /*!< 69 ADCK cycles total sample time. */ - kLPADC_SampleTimeADCK131 = 7U, /*!< 131 ADCK cycles total sample time. */ -} lpadc_sample_time_mode_t; - -/*! - * @brief Define enumeration of hardware compare mode. - * - * After an ADC channel input is sampled and converted and any averaging iterations are performed, this mode setting - * guides operation of the automatic compare function to optionally only store when the compare operation is true. - * When compare is enabled, the conversion result is compared to the compare values. - */ -typedef enum _lpadc_hardware_compare_mode -{ - kLPADC_HardwareCompareDisabled = 0U, /*!< Compare disabled. */ - kLPADC_HardwareCompareStoreOnTrue = 2U, /*!< Compare enabled. Store on true. */ - kLPADC_HardwareCompareRepeatUntilTrue = 3U, /*!< Compare enabled. Repeat channel acquisition until true. */ -} lpadc_hardware_compare_mode_t; - -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_MODE) && FSL_FEATURE_LPADC_HAS_CMDL_MODE -/*! - * @brief Define enumeration of conversion resolution mode. - * - * Configure the resolution bit in specific conversion type. For detailed resolution accuracy, see to - * #lpadc_sample_channel_mode_t - */ -typedef enum _lpadc_conversion_resolution_mode -{ - kLPADC_ConversionResolutionStandard = 0U, /*!< Standard resolution. Single-ended 12-bit conversion, Differential - 13-bit conversion with 2's complement output. */ - kLPADC_ConversionResolutionHigh = 1U, /*!< High resolution. Single-ended 16-bit conversion; Differential 16-bit - conversion with 2's complement output. */ -} lpadc_conversion_resolution_mode_t; -#endif /* defined(FSL_FEATURE_LPADC_HAS_CMDL_MODE) && FSL_FEATURE_LPADC_HAS_CMDL_MODE */ - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS -/*! - * @brief Define enumeration of conversion averages mode. - * - * Configure the converion average number for auto-calibration. - * @note Some enumerator values are not available on some devices, mainly depends on the size of CAL_AVGS field in CTRL - * register. - */ -typedef enum _lpadc_conversion_average_mode -{ - kLPADC_ConversionAverage1 = 0U, /*!< Single conversion. */ - kLPADC_ConversionAverage2 = 1U, /*!< 2 conversions averaged. */ - kLPADC_ConversionAverage4 = 2U, /*!< 4 conversions averaged. */ - kLPADC_ConversionAverage8 = 3U, /*!< 8 conversions averaged. */ - kLPADC_ConversionAverage16 = 4U, /*!< 16 conversions averaged. */ - kLPADC_ConversionAverage32 = 5U, /*!< 32 conversions averaged. */ - kLPADC_ConversionAverage64 = 6U, /*!< 64 conversions averaged. */ - kLPADC_ConversionAverage128 = 7U, /*!< 128 conversions averaged. */ -#if (defined(FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH) && \ - (FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH == 4U)) - kLPADC_ConversionAverage256 = 8U, /*!< 256 conversions averaged. */ - kLPADC_ConversionAverage512 = 9U, /*!< 512 conversions averaged. */ - kLPADC_ConversionAverage1024 = 10U, /*!< 1024 conversions averaged. */ -#endif /* (defined(FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH) && \ - (FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH == 4U))*/ -} lpadc_conversion_average_mode_t; -#endif /* defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS */ - -/*! - * @brief Define enumeration of reference voltage source. - * - * For detail information, need to check the SoC's specification. - */ -typedef enum _lpadc_reference_voltage_mode -{ - kLPADC_ReferenceVoltageAlt1 = 0U, /*!< Option 1 setting. */ - kLPADC_ReferenceVoltageAlt2 = 1U, /*!< Option 2 setting. */ - kLPADC_ReferenceVoltageAlt3 = 2U, /*!< Option 3 setting. */ -} lpadc_reference_voltage_source_t; - -/*! - * @brief Define enumeration of power configuration. - * - * Configures the ADC for power and performance. In the highest power setting the highest conversion rates will be - * possible. Refer to the device data sheet for power and performance capabilities for each setting. - */ -typedef enum _lpadc_power_level_mode -{ - kLPADC_PowerLevelAlt1 = 0U, /*!< Lowest power setting. */ - kLPADC_PowerLevelAlt2 = 1U, /*!< Next lowest power setting. */ - kLPADC_PowerLevelAlt3 = 2U, /*!< ... */ - kLPADC_PowerLevelAlt4 = 3U, /*!< Highest power setting. */ -} lpadc_power_level_mode_t; - -#if (defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE) -/*! - * @brief Define enumeration of offset calibration mode. - * - */ -typedef enum _lpadc_offset_calibration_mode -{ - kLPADC_OffsetCalibration12bitMode = 0U, /*!< 12 bit offset calibration mode. */ - kLPADC_OffsetCalibration16bitMode = 1U, /*!< 16 bit offset calibration mode. */ -} lpadc_offset_calibration_mode_t; -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE */ - -/*! - * @brief Define enumeration of trigger priority policy. - * - * This selection controls how higher priority triggers are handled. - * @note \b kLPADC_TriggerPriorityPreemptSubsequently is not available on some devices, mainly depends on the size of - * TPRICTRL field in CFG register. - */ -typedef enum _lpadc_trigger_priority_policy -{ - kLPADC_ConvPreemptImmediatelyNotAutoResumed = 0x0U, /*!< If a higher priority trigger is detected during command - processing, the current conversion is aborted and the new - command specified by the trigger is started, when higher - priority conversion finishes, the preempted conversion is not - automatically resumed or restarted. */ - kLPADC_ConvPreemptSoftlyNotAutoResumed = 0x1U, /*!< If a higher priority trigger is received during command - processing, the current conversion is completed (including averaging - iterations and compare function if enabled) and stored to the result - FIFO before the higher priority trigger/command is initiated, when - higher priority conversion finishes, the preempted conversion is not - resumed or restarted. */ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES - kLPADC_ConvPreemptImmediatelyAutoRestarted = 0x4U, /*!< If a higher priority trigger is detected during command - processing, the current conversion is aborted and the new - command specified by the trigger is started, when higher - priority conversion finishes, the preempted conversion will - automatically be restarted. */ - kLPADC_ConvPreemptSoftlyAutoRestarted = 0x5U, /*!< If a higher priority trigger is received during command - processing, the current conversion is completed (including averaging - iterations and compare function if enabled) and stored to the result - FIFO before the higher priority trigger/command is initiated, when - higher priority conversion finishes, the preempted conversion will - automatically be restarted. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES */ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES - kLPADC_ConvPreemptImmediatelyAutoResumed = 0xCU, /*!< If a higher priority trigger is detected during command - processing, the current conversion is aborted and the new - command specified by the trigger is started, when higher - priority conversion finishes, the preempted conversion will - automatically be resumed. */ - kLPADC_ConvPreemptSoftlyAutoResumed = 0xDU, /*!< If a higher priority trigger is received during command - processing, the current conversion is completed (including averaging - iterations and compare function if enabled) and stored to the result - FIFO before the higher priority trigger/command is initiated, when - higher priority conversion finishes, the preempted conversion will - be automatically be resumed. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES */ - - kLPADC_TriggerPriorityPreemptImmediately = - kLPADC_ConvPreemptImmediatelyNotAutoResumed, /*!< Legacy support is not recommended as it only ensures - compatibility with older versions. */ - kLPADC_TriggerPriorityPreemptSoftly = - kLPADC_ConvPreemptSoftlyNotAutoResumed, /*!< Legacy support is not recommended as it only ensures compatibility - with older versions. */ - -#if (defined(FSL_FEATURE_LPADC_CFG_TPRICTRL_BITFIELD_WIDTH) && (FSL_FEATURE_LPADC_CFG_TPRICTRL_BITFIELD_WIDTH == 2U)) - kLPADC_ConvPreemptSubsequentlyNotAutoResumed = 0x2U, /*!< If a higher priority trigger is received during command - processing, the current command will be completed (averaging, - looping, compare) before servicing the higher priority trigger, when - higher priority conversion finishes, the preempted conversion will - not automatically be restarted or resumed. */ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES - kLPADC_ConvPreemptSubsequentlyAutoRestarted = 0x6U, /*!< If a higher priority trigger is received during command - processing, the current command will be completed (averaging, - looping, compare) before servicing the higher priority trigger, when - higher priority conversion finishes, the preempted conversion will - be automatically restarted. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES */ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES - kLPADC_ConvPreemptSubsequentlyAutoResumed = 0xEU, /*!< If a higher priority trigger is received during command - processing, the current command will be completed (averaging, - looping, compare) before servicing the higher priority trigger, when - higher priority conversion finishes, the preempted conversion will - be automatically resumed. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES */ - - kLPADC_TriggerPriorityPreemptSubsequently = - kLPADC_ConvPreemptSubsequentlyNotAutoResumed, /*!< Legacy support is not recommended as it only ensures - compatibility with older versions. */ -#endif /* #if (defined(FSL_FEATURE_LPADC_CFG_TPRICTRL_BITFIELD_WIDTH) && \ - (FSL_FEATURE_LPADC_CFG_TPRICTRL_BITFIELD_WIDTH == 2U)) */ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI) && FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI - kLPADC_TriggerPriorityExceptionDisabled = 0x10U, /*!< High priority trigger exception disabled. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI) && FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI */ -} lpadc_trigger_priority_policy_t; - -#if ((defined(FSL_FEATURE_LPADC_HAS_CTRL_CALHS)) && FSL_FEATURE_LPADC_HAS_CTRL_CALHS) -/*! - * @brief Define enumeration of tune value. - */ -typedef enum _lpadc_tune_value -{ - kLPADC_TuneValue0 = 0U, /*!< Tune value 0. */ - kLPADC_TuneValue1 = 1U, /*!< Tune value 1. */ - kLPADC_TuneValue2 = 2U, /*!< Tune value 2. */ - kLPADC_TuneValue3 = 3U, /*!< Tune value 3. */ -} lpadc_tune_value_t; -#endif /* ((defined(FSL_FEATURE_LPADC_HAS_CTRL_CALHS)) && FSL_FEATURE_LPADC_HAS_CTRL_CALHS) */ - -/*! - * @brief LPADC global configuration. - * - * This structure would used to keep the settings for initialization. - */ -typedef struct -{ -#if defined(FSL_FEATURE_LPADC_HAS_CFG_ADCKEN) && FSL_FEATURE_LPADC_HAS_CFG_ADCKEN - bool enableInternalClock; /*!< Enables the internally generated clock source. The clock source is used in clock - selection logic at the chip level and is optionally used for the ADC clock source. */ -#endif /* FSL_FEATURE_LPADC_HAS_CFG_ADCKEN */ -#if defined(FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG) && FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG - bool enableVref1LowVoltage; /*!< If voltage reference option1 input is below 1.8V, it should be "true". - If voltage reference option1 input is above 1.8V, it should be "false". */ -#endif /* FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG */ - bool enableInDozeMode; /*!< Control system transition to Stop and Wait power modes while ADC is converting. When - enabled in Doze mode, immediate entries to Wait or Stop are allowed. When disabled, the - ADC will wait for the current averaging iteration/FIFO storage to complete before - acknowledging stop or wait mode entry. */ -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS - lpadc_conversion_average_mode_t conversionAverageMode; /*!< Auto-Calibration Averages. */ -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS */ - bool enableAnalogPreliminary; /*!< ADC analog circuits are pre-enabled and ready to execute conversions without - startup delays(at the cost of higher DC current consumption). */ - uint32_t powerUpDelay; /*!< When the analog circuits are not pre-enabled, the ADC analog circuits are only powered - while the ADC is active and there is a counted delay defined by this field after an - initial trigger transitions the ADC from its Idle state to allow time for the analog - circuits to stabilize. The startup delay count of (powerUpDelay * 4) ADCK cycles must - result in a longer delay than the analog startup time. */ - lpadc_reference_voltage_source_t referenceVoltageSource; /*!< Selects the voltage reference high used for - conversions.*/ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_PWRSEL) && (FSL_FEATURE_LPADC_HAS_CFG_PWRSEL == 1U) - lpadc_power_level_mode_t powerLevelMode; /*!< Power Configuration Selection. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_PWRSEL) && (FSL_FEATURE_LPADC_HAS_CFG_PWRSEL == 1U) */ - lpadc_trigger_priority_policy_t triggerPriorityPolicy; /*!< Control how higher priority triggers are handled, see to - lpadc_trigger_priority_policy_t. */ - bool enableConvPause; /*!< Enables the ADC pausing function. When enabled, a programmable delay is inserted during - command execution sequencing between LOOP iterations, between commands in a sequence, and - between conversions when command is executing in "Compare Until True" configuration. */ - uint32_t convPauseDelay; /*!< Controls the duration of pausing during command execution sequencing. The pause delay - is a count of (convPauseDelay*4) ADCK cycles. Only available when ADC pausing - function is enabled. The available value range is in 9-bit. */ -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - /* for FIFO0. */ - uint32_t FIFO0Watermark; /*!< FIFO0Watermark is a programmable threshold setting. When the number of datawords - stored in the ADC Result FIFO0 is greater than the value in this field, the ready flag - would be asserted to indicate stored data has reached the programmable threshold. */ - /* for FIFO1. */ - uint32_t FIFO1Watermark; /*!< FIFO1Watermark is a programmable threshold setting. When the number of datawords - stored in the ADC Result FIFO1 is greater than the value in this field, the ready flag - would be asserted to indicate stored data has reached the programmable threshold. */ -#else - /* for FIFO. */ - uint32_t FIFOWatermark; /*!< FIFOWatermark is a programmable threshold setting. When the number of datawords stored - in the ADC Result FIFO is greater than the value in this field, the ready flag would be - asserted to indicate stored data has reached the programmable threshold. */ -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ -#if (defined(FSL_FEATURE_LPADC_HAS_TSTAT) && (FSL_FEATURE_LPADC_HAS_TSTAT)) - -#endif /* FSL_FEATURE_LPADC_HAS_TSTAT */ -} lpadc_config_t; - -/*! - * @brief Define structure to keep the configuration for conversion command. - */ -typedef struct -{ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_CSCALE) && FSL_FEATURE_LPADC_HAS_CMDL_CSCALE - lpadc_sample_scale_mode_t sampleScaleMode; /*!< Sample scale mode. */ -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_CSCALE */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE) && FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE - lpadc_sample_scale_mode_t channelBScaleMode; /*!< Alternate channe B Scale mode. */ -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE */ - lpadc_sample_channel_mode_t sampleChannelMode; /*!< Channel sample mode. */ - uint32_t channelNumber; /*!< Channel number, select the channel or channel pair. */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTB_ADCH) && FSL_FEATURE_LPADC_HAS_CMDL_ALTB_ADCH - uint32_t channelBNumber; /*!< Alternate Channel B number, select the channel. */ -#endif - uint32_t chainedNextCommandNumber; /*!< Selects the next command to be executed after this command completes. - 1-15 is available, 0 is to terminate the chain after this command. */ - bool enableAutoChannelIncrement; /*!< Loop with increment: when disabled, the "loopCount" field selects the number - of times the selected channel is converted consecutively; when enabled, the - "loopCount" field defines how many consecutive channels are converted as part - of the command execution. */ - uint32_t loopCount; /*!< Selects how many times this command executes before finish and transition to the next - command or Idle state. Command executes LOOP+1 times. 0-15 is available. */ - lpadc_hardware_average_mode_t hardwareAverageMode; /*!< Hardware average selection. */ - lpadc_sample_time_mode_t sampleTimeMode; /*!< Sample time selection. */ - - lpadc_hardware_compare_mode_t hardwareCompareMode; /*!< Hardware compare selection. */ - uint32_t hardwareCompareValueHigh; /*!< Compare Value High. The available value range is in 16-bit. */ - uint32_t hardwareCompareValueLow; /*!< Compare Value Low. The available value range is in 16-bit. */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_MODE) && FSL_FEATURE_LPADC_HAS_CMDL_MODE - lpadc_conversion_resolution_mode_t conversionResolutionMode; /*!< Conversion resolution mode. */ -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_MODE */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG) && FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG - bool enableWaitTrigger; /*!< Wait for trigger assertion before execution: when disabled, this command will be - automatically executed; when enabled, the active trigger must be asserted again before - executing this command. */ -#endif /* FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN) && FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN - bool enableChannelB; /*! Enable alternate Channel B */ -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN */ -} lpadc_conv_command_config_t; - -/*! - * @brief Define structure to keep the configuration for conversion trigger. - */ -typedef struct -{ - uint32_t targetCommandId; /*!< Select the command from command buffer to execute upon detect of the associated - trigger event. */ - uint32_t delayPower; /*!< Select the trigger delay duration to wait at the start of servicing a trigger event. - When this field is clear, then no delay is incurred. When this field is set to a non-zero - value, the duration for the delay is 2^delayPower ADCK cycles. The available value range - is 4-bit. */ - uint32_t priority; /*!< Sets the priority of the associated trigger source. If two or more triggers have the same - priority level setting, the lower order trigger event has the higher priority. The lower - value for this field is for the higher priority, the available value range is 1-bit. */ -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - uint8_t channelAFIFOSelect; /* SAR Result Destination For Channel A. */ - uint8_t channelBFIFOSelect; /* SAR Result Destination For Channel B. */ -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ - bool enableHardwareTrigger; /*!< Enable hardware trigger source to initiate conversion on the rising edge of the - input trigger source or not. THe software trigger is always available. */ -} lpadc_conv_trigger_config_t; - -/*! - * @brief Define the structure to keep the conversion result. - */ -typedef struct -{ - uint32_t commandIdSource; /*!< Indicate the command buffer being executed that generated this result. */ - uint32_t loopCountIndex; /*!< Indicate the loop count value during command execution that generated this result. */ - uint32_t triggerIdSource; /*!< Indicate the trigger source that initiated a conversion and generated this result. */ - uint16_t convValue; /*!< Data result. */ -} lpadc_conv_result_t; - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFS) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFS -/*! - * @brief A structure of calibration value. - */ -typedef struct _lpadc_calibration_value -{ - /* gain calibration result. */ - uint16_t gainCalibrationResultA; -#if !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) - uint16_t gainCalibrationResultB; -#endif /* !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) */ -#if (defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) - /* general calibration value. */ - uint16_t generalCalibrationValueA[33U]; -#if !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) - uint16_t generalCalibrationValueB[33U]; -#endif /* !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) */ -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ */ -} lpadc_calibration_value_t; -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CALOFS */ - -#if defined(__cplusplus) -extern "C" { -#endif - -/******************************************************************************* - * API - ******************************************************************************/ -/*! - * @name Initialization & de-initialization. - * @{ - */ - -/*! - * @brief Initializes the LPADC module. - * - * @param base LPADC peripheral base address. - * @param config Pointer to configuration structure. See "lpadc_config_t". - */ -void LPADC_Init(ADC_Type *base, const lpadc_config_t *config); - -/*! - * @brief Gets an available pre-defined settings for initial configuration. - * - * This function initializes the converter configuration structure with an available settings. The default values are: - * @code - * config->enableInDozeMode = true; - * config->enableAnalogPreliminary = false; - * config->powerUpDelay = 0x80; - * config->referenceVoltageSource = kLPADC_ReferenceVoltageAlt1; - * config->powerLevelMode = kLPADC_PowerLevelAlt1; - * config->triggerPriorityPolicy = kLPADC_TriggerPriorityPreemptImmediately; - * config->enableConvPause = false; - * config->convPauseDelay = 0U; - * config->FIFOWatermark = 0U; - * @endcode - * @param config Pointer to configuration structure. - */ -void LPADC_GetDefaultConfig(lpadc_config_t *config); - -/*! - * @brief De-initializes the LPADC module. - * - * @param base LPADC peripheral base address. - */ -void LPADC_Deinit(ADC_Type *base); - -/*! - * @brief Switch on/off the LPADC module. - * - * @param base LPADC peripheral base address. - * @param enable switcher to the module. - */ -static inline void LPADC_Enable(ADC_Type *base, bool enable) -{ - if (enable) - { - base->CTRL |= ADC_CTRL_ADCEN_MASK; - } - else - { - base->CTRL &= ~ADC_CTRL_ADCEN_MASK; - } -} - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) -/*! - * @brief Do reset the conversion FIFO0. - * - * @param base LPADC peripheral base address. - */ -static inline void LPADC_DoResetFIFO0(ADC_Type *base) -{ - base->CTRL |= ADC_CTRL_RSTFIFO0_MASK; -} - -/*! - * @brief Do reset the conversion FIFO1. - * - * @param base LPADC peripheral base address. - */ -static inline void LPADC_DoResetFIFO1(ADC_Type *base) -{ - base->CTRL |= ADC_CTRL_RSTFIFO1_MASK; -} -#else - -#if defined(ADC_CTRL_RSTFIFO0_MASK) -#define ADC_CTRL_RSTFIFO_MASK ADC_CTRL_RSTFIFO0_MASK -#endif /* defined(ADC_CTRL_RSTFIFO0_MASK) */ -/*! - * @brief Do reset the conversion FIFO. - * - * @param base LPADC peripheral base address. - */ -static inline void LPADC_DoResetFIFO(ADC_Type *base) -{ - base->CTRL |= ADC_CTRL_RSTFIFO_MASK; -} -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ - -/*! - * @brief Do reset the module's configuration. - * - * Reset all ADC internal logic and registers, except the Control Register (ADCx_CTRL). - * - * @param base LPADC peripheral base address. - */ -static inline void LPADC_DoResetConfig(ADC_Type *base) -{ - base->CTRL |= ADC_CTRL_RST_MASK; - base->CTRL &= ~ADC_CTRL_RST_MASK; -} - -/*! @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Get status flags. - * - * @param base LPADC peripheral base address. - * @return status flags' mask. See to #_lpadc_status_flags. - */ -static inline uint32_t LPADC_GetStatusFlags(ADC_Type *base) -{ - return base->STAT; -} - -/*! - * @brief Clear status flags. - * - * Only the flags can be cleared by writing ADCx_STATUS register would be cleared by this API. - * - * @param base LPADC peripheral base address. - * @param mask Mask value for flags to be cleared. See to #_lpadc_status_flags. - */ -static inline void LPADC_ClearStatusFlags(ADC_Type *base, uint32_t mask) -{ - base->STAT = mask; -} - -#if (defined(FSL_FEATURE_LPADC_HAS_TSTAT) && FSL_FEATURE_LPADC_HAS_TSTAT) -/*! - * @brief Get trigger status flags to indicate which trigger sequences have been completed or interrupted by a high - * priority trigger exception. - * - * @param base LPADC peripheral base address. - * @return The OR'ed value of @ref _lpadc_trigger_status_flags. - */ -static inline uint32_t LPADC_GetTriggerStatusFlags(ADC_Type *base) -{ - return base->TSTAT; -} - -/*! - * @brief Clear trigger status flags. - * - * @param base LPADC peripheral base address. - * @param mask The mask of trigger status flags to be cleared, should be the - * OR'ed value of @ref _lpadc_trigger_status_flags. - */ -static inline void LPADC_ClearTriggerStatusFlags(ADC_Type *base, uint32_t mask) -{ - /* This assert used to avoid user use doesn't supported trigger sources. */ - assert(((mask & 0xFFFFU) == (mask & ADC_TSTAT_TEXC_NUM_MASK)) && - ((mask & 0xFFFF0000U) == (mask & ADC_TSTAT_TCOMP_FLAG_MASK))); - base->TSTAT = mask; -} -#endif /* (defined(FSL_FEATURE_LPADC_HAS_TSTAT) && FSL_FEATURE_LPADC_HAS_TSTAT) */ - -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enable interrupts. - * - * @param base LPADC peripheral base address. - * @param mask Mask value for interrupt events. See to #_lpadc_interrupt_enable. - */ -static inline void LPADC_EnableInterrupts(ADC_Type *base, uint32_t mask) -{ -#if (defined(FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE) && (FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE == 1U)) - /* This assert used to avoid user use doesn't supported trigger sources. */ - assert((mask <= 0xFFFFU) || ((mask & 0xFFFF0000U) == (mask & ADC_IE_TCOMP_IE_MASK))); -#endif /* #if (defined(FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE) && (FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE == 1U)) */ - base->IE |= mask; -} - -/*! - * @brief Disable interrupts. - * - * @param base LPADC peripheral base address. - * @param mask Mask value for interrupt events. See to #_lpadc_interrupt_enable. - */ -static inline void LPADC_DisableInterrupts(ADC_Type *base, uint32_t mask) -{ -#if (defined(FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE) && (FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE == 1U)) - /* This assert used to avoid user use doesn't supported trigger sources. */ - assert((mask <= 0xFFFFU) || ((mask & 0xFFFF0000U) == (mask & ADC_IE_TCOMP_IE_MASK))); -#endif /* #if (defined(FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE) && (FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE == 1U)) */ - base->IE &= ~mask; -} - -/*! - * @name DMA Control - * @{ - */ - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) -/*! - * @brief Switch on/off the DMA trigger for FIFO0 watermark event. - * - * @param base LPADC peripheral base address. - * @param enable Switcher to the event. - */ -static inline void LPADC_EnableFIFO0WatermarkDMA(ADC_Type *base, bool enable) -{ - if (enable) - { - base->DE |= ADC_DE_FWMDE0_MASK; - } - else - { - base->DE &= ~ADC_DE_FWMDE0_MASK; - } -} - -/*! - * @brief Switch on/off the DMA trigger for FIFO1 watermark event. - * - * @param base LPADC peripheral base address. - * @param enable Switcher to the event. - */ -static inline void LPADC_EnableFIFO1WatermarkDMA(ADC_Type *base, bool enable) -{ - if (enable) - { - base->DE |= ADC_DE_FWMDE1_MASK; - } - else - { - base->DE &= ~ADC_DE_FWMDE1_MASK; - } -} -#else -#if defined(ADC_DE_FWMDE0_MASK) -#define ADC_DE_FWMDE_MASK ADC_DE_FWMDE0_MASK -#endif /* defined(ADC_DE_FWMDE0_MASK) */ -/*! - * @brief Switch on/off the DMA trigger for FIFO watermark event. - * - * @param base LPADC peripheral base address. - * @param enable Switcher to the event. - */ -static inline void LPADC_EnableFIFOWatermarkDMA(ADC_Type *base, bool enable) -{ - if (enable) - { - base->DE |= ADC_DE_FWMDE_MASK; - } - else - { - base->DE &= ~ADC_DE_FWMDE_MASK; - } -} -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) */ -/*! @} */ - -/*! - * @name Trigger and conversion with FIFO. - * @{ - */ - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) -/*! - * @brief Get the count of result kept in conversion FIFOn. - * - * @param base LPADC peripheral base address. - * @param index Result FIFO index. - * @return The count of result kept in conversion FIFOn. - */ -static inline uint32_t LPADC_GetConvResultCount(ADC_Type *base, uint8_t index) -{ - return (ADC_FCTRL_FCOUNT_MASK & base->FCTRL[index]) >> ADC_FCTRL_FCOUNT_SHIFT; -} - -/*! - * @brief Get the result in conversion FIFOn. - * - * @param base LPADC peripheral base address. - * @param result Pointer to structure variable that keeps the conversion result in conversion FIFOn. - * @param index Result FIFO index. - * - * @return Status whether FIFOn entry is valid. - */ -bool LPADC_GetConvResult(ADC_Type *base, lpadc_conv_result_t *result, uint8_t index); - -/*! - * @brief Get the result in conversion FIFOn using blocking method. - * - * @param base LPADC peripheral base address. - * @param result Pointer to structure variable that keeps the conversion result in conversion FIFOn. - * @param index Result FIFO index. - */ -void LPADC_GetConvResultBlocking(ADC_Type *base, lpadc_conv_result_t *result, uint8_t index); -#else /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 1)) */ -/*! - * @brief Get the count of result kept in conversion FIFO. - * - * @param base LPADC peripheral base address. - * @return The count of result kept in conversion FIFO. - */ -static inline uint32_t LPADC_GetConvResultCount(ADC_Type *base) -{ - return (ADC_FCTRL_FCOUNT_MASK & base->FCTRL) >> ADC_FCTRL_FCOUNT_SHIFT; -} - -/*! - * @brief Get the result in conversion FIFO. - * - * @param base LPADC peripheral base address. - * @param result Pointer to structure variable that keeps the conversion result in conversion FIFO. - * - * @return Status whether FIFO entry is valid. - */ -bool LPADC_GetConvResult(ADC_Type *base, lpadc_conv_result_t *result); - -/*! - * @brief Get the result in conversion FIFO using blocking method. - * - * @param base LPADC peripheral base address. - * @param result Pointer to structure variable that keeps the conversion result in conversion FIFO. - */ -void LPADC_GetConvResultBlocking(ADC_Type *base, lpadc_conv_result_t *result); -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) */ - -/*! - * @brief Configure the conversion trigger source. - * - * Each programmable trigger can launch the conversion command in command buffer. - * - * @param base LPADC peripheral base address. - * @param triggerId ID for each trigger. Typically, the available value range is from 0. - * @param config Pointer to configuration structure. See to #lpadc_conv_trigger_config_t. - */ -void LPADC_SetConvTriggerConfig(ADC_Type *base, uint32_t triggerId, const lpadc_conv_trigger_config_t *config); - -/*! - * @brief Gets an available pre-defined settings for trigger's configuration. - * - * This function initializes the trigger's configuration structure with an available settings. The default values are: - * @code - * config->targetCommandId = 0U; - * config->delayPower = 0U; - * config->priority = 0U; - * config->channelAFIFOSelect = 0U; - * config->channelBFIFOSelect = 0U; - * config->enableHardwareTrigger = false; - * @endcode - * @param config Pointer to configuration structure. - */ -void LPADC_GetDefaultConvTriggerConfig(lpadc_conv_trigger_config_t *config); - -/*! - * @brief Do software trigger to conversion command. - * - * @param base LPADC peripheral base address. - * @param triggerIdMask Mask value for software trigger indexes, which count from zero. - */ -static inline void LPADC_DoSoftwareTrigger(ADC_Type *base, uint32_t triggerIdMask) -{ - /* Writes to ADCx_SWTRIG register are ignored while ADCx_CTRL[ADCEN] is clear. */ - base->SWTRIG = triggerIdMask; -} - -#if defined(FSL_FEATURE_LPADC_HAS_TCTRL_CMD_SEL) && FSL_FEATURE_LPADC_HAS_TCTRL_CMD_SEL -/*! - * @brief Enable hardware trigger command selection. - * - * This function will use the hardware trigger command from ADC_ETC.The trigger command is then defined - * by ADC hardware trigger command selection field in ADC_ETC- >TRIGx_CHAINy_z_n[CSEL]. - * - * @param base LPADC peripheral base address. - * @param triggerId ID for each trigger. Typically, the available value range is from 0. - * @param enable True to enable or flase to disable. - */ -static inline void LPADC_EnableHardwareTriggerCommandSelection(ADC_Type *base, uint32_t triggerId, bool enable) -{ - if (enable) - { - base->TCTRL[triggerId] |= ADC_TCTRL_CMD_SEL_MASK; - } - else - { - base->TCTRL[triggerId] &= ~ADC_TCTRL_CMD_SEL_MASK; - } -} -#endif /* defined(FSL_FEATURE_LPADC_HAS_TCTRL_CMD_SEL) && FSL_FEATURE_LPADC_HAS_TCTRL_CMD_SEL*/ - -/*! - * @brief Configure conversion command. - - * @note The number of compare value register on different chips is different, that is mean in some chips, some - * command buffers do not have the compare functionality. - * - * @param base LPADC peripheral base address. - * @param commandId ID for command in command buffer. Typically, the available value range is 1 - 15. - * @param config Pointer to configuration structure. See to #lpadc_conv_command_config_t. - */ -void LPADC_SetConvCommandConfig(ADC_Type *base, uint32_t commandId, const lpadc_conv_command_config_t *config); - -/*! - * @brief Gets an available pre-defined settings for conversion command's configuration. - * - * This function initializes the conversion command's configuration structure with an available settings. The default - * values are: - * @code - * config->sampleScaleMode = kLPADC_SampleFullScale; - * config->channelBScaleMode = kLPADC_SampleFullScale; - * config->sampleChannelMode = kLPADC_SampleChannelSingleEndSideA; - * config->channelNumber = 0U; - * config->channelBNumber = 0U; - * config->chainedNextCommandNumber = 0U; - * config->enableAutoChannelIncrement = false; - * config->loopCount = 0U; - * config->hardwareAverageMode = kLPADC_HardwareAverageCount1; - * config->sampleTimeMode = kLPADC_SampleTimeADCK3; - * config->hardwareCompareMode = kLPADC_HardwareCompareDisabled; - * config->hardwareCompareValueHigh = 0U; - * config->hardwareCompareValueLow = 0U; - * config->conversionResolutionMode = kLPADC_ConversionResolutionStandard; - * config->enableWaitTrigger = false; - * config->enableChannelB = false; - * @endcode - * @param config Pointer to configuration structure. - */ -void LPADC_GetDefaultConvCommandConfig(lpadc_conv_command_config_t *config); - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_CALOFS) && FSL_FEATURE_LPADC_HAS_CFG_CALOFS -/*! - * @brief Enable the calibration function. - * - * When CALOFS is set, the ADC is configured to perform a calibration function anytime the ADC executes - * a conversion. Any channel selected is ignored and the value returned in the RESFIFO is a signed value - * between -31 and 31. -32 is not a valid and is never a returned value. Software should copy the lower 6- - * bits of the conversion result stored in the RESFIFO after a completed calibration conversion to the - * OFSTRIM field. The OFSTRIM field is used in normal operation for offset correction. - * - * @param base LPADC peripheral base address. - * @param enable switcher to the calibration function. - */ -void LPADC_EnableCalibration(ADC_Type *base, bool enable); -#if defined(FSL_FEATURE_LPADC_HAS_OFSTRIM) && FSL_FEATURE_LPADC_HAS_OFSTRIM -/*! - * @brief Set proper offset value to trim ADC. - * - * To minimize the offset during normal operation, software should read the conversion result from - * the RESFIFO calibration operation and write the lower 6 bits to the OFSTRIM register. - * - * @param base LPADC peripheral base address. - * @param value Setting offset value. - */ -static inline void LPADC_SetOffsetValue(ADC_Type *base, uint32_t value) -{ - base->OFSTRIM = (value & ADC_OFSTRIM_OFSTRIM_MASK) >> ADC_OFSTRIM_OFSTRIM_SHIFT; -} - -/*! - * @brief Do auto calibration. - * - * Calibration function should be executed before using converter in application. It used the software trigger and a - * dummy conversion, get the offset and write them into the OFSTRIM register. It called some of functional API - * including: -LPADC_EnableCalibration(...) -LPADC_LPADC_SetOffsetValue(...) -LPADC_SetConvCommandConfig(...) - * -LPADC_SetConvTriggerConfig(...) - * - * @param base LPADC peripheral base address. - */ -void LPADC_DoAutoCalibration(ADC_Type *base); -#endif /* defined(FSL_FEATURE_LPADC_HAS_OFSTRIM) && FSL_FEATURE_LPADC_HAS_OFSTRIM */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_CALOFS) && FSL_FEATURE_LPADC_HAS_CFG_CALOFS */ - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFS) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFS -#if defined(FSL_FEATURE_LPADC_HAS_OFSTRIM) && FSL_FEATURE_LPADC_HAS_OFSTRIM -#if defined(FSL_FEATURE_LPADC_OFSTRIM_COUNT) && (FSL_FEATURE_LPADC_OFSTRIM_COUNT == 1U) -/*! - * @brief Set trim value for offset. - * - * @note For 16-bit conversions, each increment is 1/2 LSB resulting in a programmable offset range of -256 LSB to 255.5 - * LSB; For 12-bit conversions, each increment is 1/32 LSB resulting in a programmable offset range of -16 LSB to - * 15.96875 LSB. - * - * @param base LPADC peripheral base address. - * @param value Offset trim value, is a 10-bit signed value between -512 and 511. - */ -static inline void LPADC_SetOffsetValue(ADC_Type *base, int16_t value) -{ - base->OFSTRIM = ADC_OFSTRIM_OFSTRIM(value); -} - -/*! - * @brief Get trim value of offset. - * - * @param base LPADC peripheral base address. - * @param pValue Pointer to the variable in type of int16_t to store offset value. - */ -static inline void LPADC_GetOffsetValue(ADC_Type *base, int16_t *pValue) -{ - assert(pValue != NULL); - - uint16_t ofstrim = (uint16_t)((base->OFSTRIM & (ADC_OFSTRIM_OFSTRIM_MASK)) >> ADC_OFSTRIM_OFSTRIM_SHIFT); - - if ((ofstrim & ADC_OFSTRIM_OFSTRIM_SIGN) != 0U) - { - /* If the sign bit is set, then set the other MSB. */ - ofstrim |= (uint16_t)(~ADC_OFSTRIM_OFSTRIM_MAX); - } - - *pValue = (int16_t)ofstrim; -} -#elif (defined(FSL_FEATURE_LPADC_OFSTRIM_COUNT) && (FSL_FEATURE_LPADC_OFSTRIM_COUNT == 2U)) -/*! - * @brief Set proper offset value to trim ADC. - * - * Set the offset trim value for offset calibration manually. - * - * @param base LPADC peripheral base address. - * @param valueA Setting offset value A. - * @param valueB Setting offset value B. - * @note In normal adc sequence, the values are automatically calculated by LPADC_EnableOffsetCalibration. - */ -static inline void LPADC_SetOffsetValue(ADC_Type *base, int32_t valueA, int32_t valueB) -{ - base->OFSTRIM = ADC_OFSTRIM_OFSTRIM_A(valueA) | ADC_OFSTRIM_OFSTRIM_B(valueB); -} - -/*! - * @brief Get trim value of offset. - * - * @param base LPADC peripheral base address. - * @param pValueA Pointer to the variable in type of int32_t to store offset A value. - * @param pValueB Pointer to the variable in type of int32_t to store offset B value. - */ -static inline void LPADC_GetOffsetValue(ADC_Type *base, int32_t *pValueA, int32_t *pValueB) -{ - assert(pValueA != NULL); - assert(pValueB != NULL); - - uint32_t ofstrimA = (base->OFSTRIM & (ADC_OFSTRIM_OFSTRIM_A_MASK)) >> ADC_OFSTRIM_OFSTRIM_A_SHIFT; - uint32_t ofstrimB = (base->OFSTRIM & (ADC_OFSTRIM_OFSTRIM_B_MASK)) >> ADC_OFSTRIM_OFSTRIM_B_SHIFT; - - if ((ofstrimA & ADC_OFSTRIM_OFSTRIM_A_SIGN) != 0U) - { - /* If the sign bit is set, then set the other MSB. */ - ofstrimA |= (~ADC_OFSTRIM_OFSTRIM_A_MAX); - } - if ((ofstrimB & ADC_OFSTRIM_OFSTRIM_B_SIGN) != 0U) - { - /* If the sign bit is set, then set the other MSB. */ - ofstrimB |= (~ADC_OFSTRIM_OFSTRIM_B_MAX); - } - - *pValueA = (int32_t)ofstrimA; - *pValueB = (int32_t)ofstrimB; -} -#endif /* defined(FSL_FEATURE_LPADC_OFSTRIM_COUNT) */ -#else /* !(defined(FSL_FEATURE_LPADC_HAS_OFSTRIM) && FSL_FEATURE_LPADC_HAS_OFSTRIM) */ -/*! - * @brief Set proper offset value to trim 12 bit ADC conversion. - * - * Set the offset trim value for offset calibration manually. - * - * @param base LPADC peripheral base address. - * @param valueA Setting offset value A. - * @param valueB Setting offset value B. - * @note In normal adc sequence, the values are automatically calculated by LPADC_EnableOffsetCalibration. - */ -static inline void LPADC_SetOffset12BitValue(ADC_Type *base, uint32_t valueA, uint32_t valueB) -{ - base->OFSTRIM12 = ADC_OFSTRIM12_OFSTRIM_A(valueA) | ADC_OFSTRIM12_OFSTRIM_A(valueB); -} - -/*! - * @brief Set proper offset value to trim 16 bit ADC conversion. - * - * Set the offset trim value for offset calibration manually. - * - * @param base LPADC peripheral base address. - * @param valueA Setting offset value A. - * @param valueB Setting offset value B. - * @note In normal adc sequence, the values are automatically calculated by LPADC_EnableOffsetCalibration. - */ -static inline void LPADC_SetOffset16BitValue(ADC_Type *base, uint32_t valueA, uint32_t valueB) -{ - base->OFSTRIM16 = ADC_OFSTRIM16_OFSTRIM_A(valueA) | ADC_OFSTRIM16_OFSTRIM_B(valueB); -} -#endif /* FSL_FEATURE_LPADC_HAS_OFSTRIM */ - -/*! - * @brief Enable the offset calibration function. - * - * @param base LPADC peripheral base address. - * @param enable switcher to the calibration function. - */ -static inline void LPADC_EnableOffsetCalibration(ADC_Type *base, bool enable) -{ - if (enable) - { - base->CTRL |= ADC_CTRL_CALOFS_MASK; - } - else - { - base->CTRL &= ~ADC_CTRL_CALOFS_MASK; - } -} -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE -/*! - * @brief Set offset calibration mode. - * - * @param base LPADC peripheral base address. - * @param mode set offset calibration mode.see to #lpadc_offset_calibration_mode_t . - */ -static inline void LPADC_SetOffsetCalibrationMode(ADC_Type *base, lpadc_offset_calibration_mode_t mode) -{ - base->CTRL = (base->CTRL & ~ADC_CTRL_CALOFSMODE_MASK) | ADC_CTRL_CALOFSMODE(mode); -} - -#endif /* defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE */ - -/*! - * @brief Do offset calibration. - * - * @param base LPADC peripheral base address. - */ -void LPADC_DoOffsetCalibration(ADC_Type *base); - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ -/*! - * @brief Do auto calibration. - * - * @param base LPADC peripheral base address. - */ -void LPADC_DoAutoCalibration(ADC_Type *base); - -/*! - * @brief Prepare auto calibration, LPADC_FinishAutoCalibration has to be called before using the LPADC. - * LPADC_DoAutoCalibration has been split in two API to avoid to be stuck too long in the function. - * - * @param base LPADC peripheral base address. - */ -void LPADC_PrepareAutoCalibration(ADC_Type *base); - -/*! - * @brief Finish auto calibration start with LPADC_PrepareAutoCalibration. - * - * @param base LPADC peripheral base address. - */ -void LPADC_FinishAutoCalibration(ADC_Type *base); - -#endif /* defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ */ - -/*! - * @brief Get calibration value into the memory which is defined by invoker. - * - * @note Please note the ADC will be disabled temporary. - * @note This function should be used after finish calibration. - * - * @param base LPADC peripheral base address. - * @param ptrCalibrationValue Pointer to @ref lpadc_calibration_value_t structure, this memory block should be always - * powered on even in low power modes. - */ -void LPADC_GetCalibrationValue(ADC_Type *base, lpadc_calibration_value_t *ptrCalibrationValue); - -/*! - * @brief Set calibration value into ADC calibration registers. - * - * @note Please note the ADC will be disabled temporary. - * - * @param base LPADC peripheral base address. - * @param ptrCalibrationValue Pointer to @ref lpadc_calibration_value_t structure which contains ADC's calibration - * value. - */ -void LPADC_SetCalibrationValue(ADC_Type *base, const lpadc_calibration_value_t *ptrCalibrationValue); - -#endif /* defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFS) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFS */ - -#if ((defined(FSL_FEATURE_LPADC_HAS_CTRL_CALHS)) && FSL_FEATURE_LPADC_HAS_CTRL_CALHS) -/*! - * @brief Request high speed mode trim calculation. - * - * @param base LPADC peripheral base address. - */ -static inline void LPADC_RequestHighSpeedModeTrim(ADC_Type *base) -{ - base->CTRL |= ADC_CTRL_CALHS_MASK; -} - -/*! - * @brief Get high speed mode trim value, the result is a 5-bit signed value between -16 and 15. - * - * @note The high speed mode trim value is used to minimize offset for high speed conversion. - * - * @param base LPADC peripheral base address. - * @return The calculated high speed mode trim value. - */ -static inline int8_t LPADC_GetHighSpeedTrimValue(ADC_Type *base) -{ - return (int8_t)(base->HSTRIM); -} - -/*! - * @brief Set high speed mode trim value. - * - * @note If is possible to set the trim value manually, but it is recommended to use the LPADC_RequestHighSpeedModeTrim. - * - * @param base LPADC peripheral base address. - * @param trimValue The trim value to be set. - */ -static inline void LPADC_SetHighSpeedTrimValue(ADC_Type *base, int8_t trimValue) -{ - base->HSTRIM = ADC_HSTRIM_HSTRIM(trimValue); -} - -/*! - * @brief Enable/disable high speed conversion mode, if enabled conversions complete 2 or 3 ADCK cycles sooner compared - * to conversion cycle counts when high speed mode is disabled. - * - * @param base LPADC peripheral base address. - * @param enable Used to enable/disable high speed conversion mode: - * - \b true Enable high speed conversion mode; - * - \b false Disable high speed conversion mode. - */ -static inline void LPADC_EnableHighSpeedConversionMode(ADC_Type *base, bool enable) -{ - if (enable) - { - base->CFG2 |= ADC_CFG2_HS_MASK; - } - else - { - base->CFG2 &= ~ADC_CFG2_HS_MASK; - } -} - -/*! - * @brief Enable/disable an additional ADCK cycle to conversion. - * - * @param base LPADC peripheral base address. - * @param enable Used to enable/disable an additional ADCK cycle to conversion: - * - \b true Enable an additional ADCK cycle to conversion; - * - \b false Disable an additional ADCK cycle to conversion. - */ -static inline void LPADC_EnableExtraCycle(ADC_Type *base, bool enable) -{ - if (enable) - { - base->CFG2 |= ADC_CFG2_HSEXTRA_MASK; - } - else - { - base->CFG2 &= ~ADC_CFG2_HSEXTRA_MASK; - } -} - -/*! - * @brief Set tune value which provides some variability in how many cycles are needed to complete a conversion. - * - * @param base LPADC peripheral base address. - * @param tuneValue The tune value to be set, please refer to @ref lpadc_tune_value_t. - */ -static inline void LPADC_SetTuneValue(ADC_Type *base, lpadc_tune_value_t tuneValue) -{ - base->CFG2 = (base->CFG2 & ~ADC_CFG2_TUNE_MASK) | ADC_CFG2_TUNE(tuneValue); -} - -/*! - * @brief Get tune value which provides some variability in how many cycles are needed to complete a conversion. - * - * @param base LPADC peripheral base address. - * @return The tune value, please refer to @ref lpadc_tune_value_t. - */ -static inline lpadc_tune_value_t LPADC_GetTuneValue(ADC_Type *base) -{ - return (lpadc_tune_value_t)((base->CFG2 & ADC_CFG2_TUNE_MASK) >> ADC_CFG2_TUNE_SHIFT); -} -#endif /* ((defined(FSL_FEATURE_LPADC_HAS_CTRL_CALHS)) && FSL_FEATURE_LPADC_HAS_CTRL_CALHS) */ - -#if (defined(FSL_FEATURE_LPADC_HAS_CFG2_JLEFT) && FSL_FEATURE_LPADC_HAS_CFG2_JLEFT) -/*! - * @brief Enable/disable left-justify format in 12-bit single-end mode. - * - * @param base LPADC peripheral base address. - * @param enable Used to enable/disable left-justify format in 12-bit single-end mode: - * - \b true Enable left-justify format in 12-bit single-end mode; - * - \b false Disable left-justify format in 12-bit single-end mode. - */ -static inline void LPADC_EnableJustifiedLeft(ADC_Type *base, bool enable) -{ - if (enable) - { - base->CFG2 |= ADC_CFG2_JLEFT_MASK; - } - else - { - base->CFG2 &= ~ADC_CFG2_JLEFT_MASK; - } -} -#endif /* (defined(FSL_FEATURE_LPADC_HAS_CFG2_JLEFT) && FSL_FEATURE_LPADC_HAS_CFG2_JLEFT) */ - -/*! @} */ - -#if defined(__cplusplus) -} -#endif -/*! - * @} - */ -#endif /* FSL_LPADC_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpcmp.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpcmp.c deleted file mode 100644 index 4ed2d921db9..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpcmp.c +++ /dev/null @@ -1,372 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2019, 2023 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpcmp.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpcmp" -#endif - -#if defined(LPCMP_RSTS) -#define LPCMP_RESETS_ARRAY LPCMP_RSTS -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#if defined(LPCMP_CLOCKS) -/*! - * @brief Get instance number for LPCMP module. - * - * @param base LPCMP peripheral base address - */ -static uint32_t LPCMP_GetInstance(LPCMP_Type *base); -#endif /* LPCMP_CLOCKS */ - -/******************************************************************************* - * Variables - ******************************************************************************/ -#if defined(LPCMP_CLOCKS) -/*! @brief Pointers to LPCMP bases for each instance. */ -static LPCMP_Type *const s_lpcmpBases[] = LPCMP_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to LPCMP clocks for each instance. */ -static const clock_ip_name_t s_lpcmpClocks[] = LPCMP_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* LPCMP_CLOCKS */ - -#if defined(LPCMP_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_lpcmpResets[] = LPCMP_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Codes - ******************************************************************************/ -#if defined(LPCMP_CLOCKS) -static uint32_t LPCMP_GetInstance(LPCMP_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - /* - * $Branch Coverage Justification$ - * (instance >= ARRAY_SIZE(s_lpcmpBases)) not covered. The peripheral base - * address is always valid and checked by assert. - */ - for (instance = 0; instance < ARRAY_SIZE(s_lpcmpBases); instance++) - { - /* - * $Branch Coverage Justification$ - * (s_lpcmpBases[instance] != base) not covered. The peripheral base - * address is always valid and checked by assert. - */ - if (s_lpcmpBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_lpcmpBases)); - - return instance; -} -#endif /* LPCMP_CLOCKS */ - -/*! - * brief Initialize the LPCMP - * - * This function initializes the LPCMP module. The operations included are: - * - Enabling the clock for LPCMP module. - * - Configuring the comparator. - * - Enabling the LPCMP module. - * Note: For some devices, multiple LPCMP instance share the same clock gate. In this case, to enable the clock for - * any instance enables all the LPCMPs. Check the chip reference manual for the clock assignment of the LPCMP. - * - * param base LPCMP peripheral base address. - * param config Pointer to "lpcmp_config_t" structure. - */ -void LPCMP_Init(LPCMP_Type *base, const lpcmp_config_t *config) -{ - assert(config != NULL); - - uint32_t tmp32; - -#if defined(LPCMP_CLOCKS) -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock. */ - CLOCK_EnableClock(s_lpcmpClocks[LPCMP_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* LPCMP_CLOCKS */ - -#if defined(LPCMP_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_lpcmpResets[LPCMP_GetInstance(base)]); -#endif - - /* Configure. */ - LPCMP_Enable(base, false); - -#if !(defined(FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) && FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) - /* CCR0 register. */ -#if defined(FSL_FEATURE_LPCMP_INSTANCE_SUPPORT_CCR0_CMP_STOP_ENn) - if (1U == FSL_FEATURE_LPCMP_INSTANCE_SUPPORT_CCR0_CMP_STOP_ENn(base)) -#endif /* FSL_FEATURE_LPCMP_INSTANCE_SUPPORT_CCR0_CMP_STOP_ENn */ - { - if (config->enableStopMode) - { - base->CCR0 |= LPCMP_CCR0_CMP_STOP_EN_MASK; - } - else - { - base->CCR0 &= ~LPCMP_CCR0_CMP_STOP_EN_MASK; - } - } -#endif /* !(defined(FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) && FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) */ - - /* CCR1 register. */ - tmp32 = (base->CCR1 & (~(LPCMP_CCR1_COUT_PEN_MASK | LPCMP_CCR1_COUT_SEL_MASK | LPCMP_CCR1_COUT_INV_MASK -#if defined(FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL) && FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL - | LPCMP_CCR1_FUNC_CLK_SEL_MASK -#endif /* FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL */ - ))); - - if (config->enableOutputPin) - { - tmp32 |= LPCMP_CCR1_COUT_PEN_MASK; - } - if (config->useUnfilteredOutput) - { - tmp32 |= LPCMP_CCR1_COUT_SEL_MASK; - } - if (config->enableInvertOutput) - { - tmp32 |= LPCMP_CCR1_COUT_INV_MASK; - } -#if defined(FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL) && FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL - tmp32 |= LPCMP_CCR1_FUNC_CLK_SEL(config->functionalSourceClock); -#endif /* FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL */ - base->CCR1 = tmp32; - /* CCR2 register. */ - tmp32 = base->CCR2 & ~(LPCMP_CCR2_HYSTCTR_MASK | LPCMP_CCR2_CMP_NPMD_MASK | LPCMP_CCR2_CMP_HPMD_MASK); - tmp32 |= LPCMP_CCR2_HYSTCTR(config->hysteresisMode); - tmp32 |= ((uint32_t)(config->powerMode) << LPCMP_CCR2_CMP_HPMD_SHIFT); - base->CCR2 = tmp32; - - LPCMP_Enable(base, true); /* Enable the LPCMP module. */ -} - -/*! - * brief De-initializes the LPCMP module. - * - * This function de-initializes the LPCMP module. The operations included are: - * - Disabling the LPCMP module. - * - Disabling the clock for LPCMP module. - * - * This function disables the clock for the LPCMP. - * Note: For some devices, multiple LPCMP instance shares the same clock gate. In this case, before disabling the - * clock for the LPCMP, ensure that all the LPCMP instances are not used. - * - * param base LPCMP peripheral base address. - */ -void LPCMP_Deinit(LPCMP_Type *base) -{ - /* Disable the LPCMP module. */ - LPCMP_Enable(base, false); -#if defined(LPCMP_CLOCKS) -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable the clock. */ - CLOCK_DisableClock(s_lpcmpClocks[LPCMP_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* LPCMP_CLOCKS */ -} - -/*! - * brief Gets an available pre-defined settings for the comparator's configuration. - * - * This function initializes the comparator configuration structure to these default values: - * code - * config->enableStopMode = false; - * config->enableOutputPin = false; - * config->useUnfilteredOutput = false; - * config->enableInvertOutput = false; - * config->hysteresisMode = kLPCMP_HysteresisLevel0; - * config->powerMode = kLPCMP_LowSpeedPowerMode; - * config->functionalSourceClock = kLPCMP_FunctionalClockSource0; - * endcode - * param config Pointer to "lpcmp_config_t" structure. - */ -void LPCMP_GetDefaultConfig(lpcmp_config_t *config) -{ - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); -#if !(defined(FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) && FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) - config->enableStopMode = false; -#endif /* !(defined(FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) && FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) */ - config->enableOutputPin = false; - config->useUnfilteredOutput = false; - config->enableInvertOutput = false; - config->hysteresisMode = kLPCMP_HysteresisLevel0; - config->powerMode = kLPCMP_LowSpeedPowerMode; -#if defined(FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL) && FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL - config->functionalSourceClock = kLPCMP_FunctionalClockSource0; -#endif /* FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL */ -} - -/*! - * brief Select the input channels for LPCMP. This function determines which input - * is selected for the negative and positive mux. - * - * param base LPCMP peripheral base address. - * param positiveChannel Positive side input channel number. - * param negativeChannel Negative side input channel number. - */ -void LPCMP_SetInputChannels(LPCMP_Type *base, uint32_t positiveChannel, uint32_t negativeChannel) -{ - uint32_t tmp32; - - tmp32 = base->CCR2 & ~(LPCMP_CCR2_PSEL_MASK | LPCMP_CCR2_MSEL_MASK); - tmp32 |= LPCMP_CCR2_PSEL(positiveChannel) | LPCMP_CCR2_MSEL(negativeChannel); - base->CCR2 = tmp32; -} - -/*! - * brief Configures the filter. - * - * param base LPCMP peripheral base address. - * param config Pointer to "lpcmp_filter_config_t" structure. - */ -void LPCMP_SetFilterConfig(LPCMP_Type *base, const lpcmp_filter_config_t *config) -{ - assert(config != NULL); - - uint32_t tmp32; - - tmp32 = base->CCR1 & ~(LPCMP_CCR1_FILT_PER_MASK | LPCMP_CCR1_FILT_CNT_MASK | LPCMP_CCR1_SAMPLE_EN_MASK); - if (config->enableSample) - { - tmp32 |= LPCMP_CCR1_SAMPLE_EN_MASK; - } - tmp32 |= LPCMP_CCR1_FILT_PER(config->filterSamplePeriod) | LPCMP_CCR1_FILT_CNT(config->filterSampleCount); - base->CCR1 = tmp32; -} - -/*! - * brief Configure the internal DAC module. - * - * param base LPCMP peripheral base address. - * param config Pointer to "lpcmp_dac_config_t" structure. If config is "NULL", disable internal DAC. - */ -void LPCMP_SetDACConfig(LPCMP_Type *base, const lpcmp_dac_config_t *config) -{ - uint32_t tmp32; - if (config == NULL) - { - tmp32 = 0U; /* Disable internal DAC. */ - } - else - { - tmp32 = LPCMP_DCR_VRSEL(config->referenceVoltageSource) | LPCMP_DCR_DAC_DATA(config->DACValue); - if (config->enableLowPowerMode) - { - tmp32 |= LPCMP_DCR_DAC_HPMD_MASK; - } - tmp32 |= LPCMP_DCR_DAC_EN_MASK; - } - base->DCR = tmp32; -} - -#if defined(FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL) && FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL -/*! - * @brief Configure the window control, users can use this API to implement operations on the window, - * such as inverting the window signal, setting the window closing event(only valid in windowing mode), - * and setting the COUTA signal after the window is closed(only valid in windowing mode). - * - * @param base LPCMP peripheral base address. - * @param config Pointer "lpcmp_window_control_config_t" structure. - */ -void LPCMP_SetWindowControl(LPCMP_Type *base, const lpcmp_window_control_config_t *config) -{ - assert(config != NULL); - - uint32_t tmp32 = 0UL; - - tmp32 = (base->CCR1 & (~(LPCMP_CCR1_COUTA_CFG_MASK | LPCMP_CCR1_EVT_SEL_CFG_MASK | LPCMP_CCR1_WINDOW_INV_MASK))); - - if (config->enableInvertWindowSignal) - { - tmp32 |= LPCMP_CCR1_WINDOW_INV_MASK; - } - - /* Set COUT event, which can close the active window in window mode. */ - tmp32 |= LPCMP_CCR1_EVT_SEL_CFG(config->closeWindowEvent); - - /* Set the COUTA signal value when the window is closed. */ - tmp32 |= LPCMP_CCR1_COUTA_CFG(config->COUTASignal); - - base->CCR1 = tmp32; -} -#endif /* FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL */ - -#if defined(FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE) && FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE -/*! - * @brief Configure the roundrobin mode. - * - * @param base LPCMP peripheral base address. - * @param config Pointer "lpcmp_roundrobin_config_t" structure. - */ -void LPCMP_SetRoundRobinConfig(LPCMP_Type *base, const lpcmp_roundrobin_config_t *config) -{ - assert(config != NULL); - - uint32_t tmp32 = 0UL; - - /* LPCMPx_RRCR0 register, Configuration options for the round-robin operation. */ - tmp32 = (base->RRCR0 & - (~(LPCMP_RRCR0_RR_TRG_SEL_MASK | LPCMP_RRCR0_RR_NSAM_MASK | LPCMP_RRCR0_RR_CLK_SEL_MASK | - LPCMP_RRCR0_RR_INITMOD_MASK | LPCMP_RRCR0_RR_SAMPLE_CNT_MASK | LPCMP_RRCR0_RR_SAMPLE_THRESHOLD_MASK))); - - tmp32 |= - (LPCMP_RRCR0_RR_TRG_SEL(config->roundrobinTriggerSource) | LPCMP_RRCR0_RR_NSAM(config->sampleClockNumbers) | - LPCMP_RRCR0_RR_CLK_SEL(config->roundrobinClockSource) | LPCMP_RRCR0_RR_INITMOD(config->initDelayModules) | - LPCMP_RRCR0_RR_SAMPLE_CNT(config->channelSampleNumbers) | - LPCMP_RRCR0_RR_SAMPLE_THRESHOLD(config->sampleTimeThreshhold)); - - base->RRCR0 = tmp32; - - /* LPCMPx_RRCR1 register, Configure the fix port, fix channel and checker channel. */ - tmp32 = - (base->RRCR1 & (~(LPCMP_RRCR1_FIXP_MASK | LPCMP_RRCR1_FIXCH_MASK | (0xFFUL << LPCMP_RRCR1_RR_CH0EN_SHIFT)))); - tmp32 |= (LPCMP_RRCR1_FIXP(config->fixedMuxPort) | LPCMP_RRCR1_FIXCH(config->fixedChannel) | - ((uint32_t)(config->checkerChannelMask) << LPCMP_RRCR1_RR_CH0EN_SHIFT)); - - base->RRCR1 = tmp32; -} - -/*! - * brief Configure the roundrobin internal timer reload value. - * - * param base LPCMP peripheral base address. - * param value RoundRobin internal timer reload value, allowed range:0x0UL-0xFFFFFFFUL. - */ -void LPCMP_SetRoundRobinInternalTimer(LPCMP_Type *base, uint32_t value) -{ - uint32_t tmp32 = 0UL; - - tmp32 = (base->RRCR2 & (~LPCMP_RRCR2_RR_TIMER_RELOAD_MASK)); - tmp32 |= LPCMP_RRCR2_RR_TIMER_RELOAD(value); - - base->RRCR2 = tmp32; -} - -#endif /* FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpcmp.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpcmp.h deleted file mode 100644 index 5105c98fcc1..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpcmp.h +++ /dev/null @@ -1,585 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2020, 2023-2024 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_LPCMP_H_ -#define FSL_LPCMP_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup lpcmp - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/*! @name Driver version */ -/*! @{ */ -/*! @brief LPCMP driver version 2.1.3. */ -#define FSL_LPCMP_DRIVER_VERSION (MAKE_VERSION(2, 1, 3)) -/*! @} */ - -#define LPCMP_CCR1_COUTA_CFG_MASK (LPCMP_CCR1_COUTA_OWEN_MASK | LPCMP_CCR1_COUTA_OW_MASK) -#define LPCMP_CCR1_COUTA_CFG_SHIFT LPCMP_CCR1_COUTA_OWEN_SHIFT -#define LPCMP_CCR1_COUTA_CFG(x) \ - (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_COUTA_CFG_SHIFT)) & LPCMP_CCR1_COUTA_CFG_MASK) - -#define LPCMP_CCR1_EVT_SEL_CFG_MASK (LPCMP_CCR1_EVT_SEL_MASK | LPCMP_CCR1_WINDOW_CLS_MASK) -#define LPCMP_CCR1_EVT_SEL_CFG_SHIFT LPCMP_CCR1_WINDOW_CLS_SHIFT -#define LPCMP_CCR1_EVT_SEL_CFG(x) \ - (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_EVT_SEL_CFG_SHIFT)) & LPCMP_CCR1_EVT_SEL_CFG_MASK) - -/*! - * @brief LPCMP status falgs mask. - */ -enum _lpcmp_status_flags -{ - kLPCMP_OutputRisingEventFlag = LPCMP_CSR_CFR_MASK, /*!< Rising-edge on the comparison output has occurred. */ - kLPCMP_OutputFallingEventFlag = LPCMP_CSR_CFF_MASK, /*!< Falling-edge on the comparison output has occurred. */ -#if defined(FSL_FEATURE_LPCMP_HAS_CSR_RRF) && FSL_FEATURE_LPCMP_HAS_CSR_RRF - kLPCMP_OutputRoundRobinEventFlag = LPCMP_CSR_RRF_MASK, /*!< Detects when any channel's last comparison result is - different from the pre-set value in trigger mode. */ -#endif /* FSL_FEATURE_LPCMP_HAS_CSR_RRF */ - kLPCMP_OutputAssertEventFlag = LPCMP_CSR_COUT_MASK, /*!< Return the current value of the analog comparator output. - The flag does not support W1C. */ -}; - -/*! - * @brief LPCMP interrupt enable/disable mask. - */ -enum _lpcmp_interrupt_enable -{ - kLPCMP_OutputRisingInterruptEnable = LPCMP_IER_CFR_IE_MASK, /*!< Comparator interrupt enable rising. */ - kLPCMP_OutputFallingInterruptEnable = LPCMP_IER_CFF_IE_MASK, /*!< Comparator interrupt enable falling. */ -#if defined(FSL_FEATURE_LPCMP_HAS_IER_RRF_IE) && FSL_FEATURE_LPCMP_HAS_IER_RRF_IE - kLPCMP_RoundRobinInterruptEnable = LPCMP_IER_RRF_IE_MASK, /*!< Comparator round robin mode interrupt - occurred when the comparison result changes for a given channel. */ -#endif /* FSL_FEATURE_LPCMP_HAS_IER_RRF_IE */ -}; - -/*! - * @brief LPCMP hysteresis mode. See chip data sheet to get the actual hystersis - * value with each level - */ -typedef enum _lpcmp_hysteresis_mode -{ - kLPCMP_HysteresisLevel0 = 0U, /*!< The hard block output has level 0 hysteresis internally. */ - kLPCMP_HysteresisLevel1 = 1U, /*!< The hard block output has level 1 hysteresis internally. */ - kLPCMP_HysteresisLevel2 = 2U, /*!< The hard block output has level 2 hysteresis internally. */ - kLPCMP_HysteresisLevel3 = 3U, /*!< The hard block output has level 3 hysteresis internally. */ -} lpcmp_hysteresis_mode_t; - -/*! - * @brief LPCMP nano mode. - */ -typedef enum _lpcmp_power_mode -{ - kLPCMP_LowSpeedPowerMode = 0U, /*!< Low speed comparison mode is selected. */ - kLPCMP_HighSpeedPowerMode = 1U, /*!< High speed comparison mode is selected. */ - kLPCMP_NanoPowerMode = 2U, /*!< Nano power comparator is enabled. */ -} lpcmp_power_mode_t; - -/*! - * @brief Internal DAC reference voltage source. - */ -typedef enum _lpcmp_dac_reference_voltage_source -{ - kLPCMP_VrefSourceVin1 = 0U, /*!< vrefh_int is selected as resistor ladder network supply reference Vin. */ - kLPCMP_VrefSourceVin2 = 1U, /*!< vrefh_ext is selected as resistor ladder network supply reference Vin. */ -} lpcmp_dac_reference_voltage_source_t; - -#if defined(FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL) && FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL -/*! - * @brief LPCMP functional mode clock source selection. - * - * Note: In different devices, the functional mode clock source selection is different, - * please refer to specific device Reference Manual for details. - */ -typedef enum _lpcmp_functional_source_clock -{ - kLPCMP_FunctionalClockSource0 = 0U, /*!< Select functional mode clock source0. */ - kLPCMP_FunctionalClockSource1 = 1U, /*!< Select functional mode clock source1. */ - kLPCMP_FunctionalClockSource2 = 2U, /*!< Select functional mode clock source2. */ - kLPCMP_FunctionalClockSource3 = 3U, /*!< Select functional mode clock source3. */ -} lpcmp_functional_source_clock_t; -#endif /* FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL */ - -#if defined(FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL) && FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL -/*! - * @brief Set the COUTA signal value when the window is closed. - */ -typedef enum _lpcmp_couta_signal -{ - kLPCMP_COUTASignalNoSet = 0U, /*!< NO set the COUTA signal value when the window is closed. */ - kLPCMP_COUTASignalLow = 1U, /*!< Set COUTA signal low(0) when the window is closed. */ - kLPCMP_COUTASignalHigh = 3U, /*!< Set COUTA signal high(1) when the window is closed. */ -} lpcmp_couta_signal_t; - -/*! - * @brief Set COUT event, which can close the active window in window mode. - */ -typedef enum _lpcmp_close_window_event -{ - kLPCMP_CLoseWindowEventNoSet = 0U, /*!< No Set COUT event, which can close the active window in window mode. */ - kLPCMP_CloseWindowEventRisingEdge = 1U, /*!< Set rising edge COUT signal as COUT event. */ - kLPCMP_CloseWindowEventFallingEdge = 3U, /*!< Set falling edge COUT signal as COUT event. */ - kLPCMP_CLoseWindowEventBothEdge = 5U, /*!< Set both rising and falling edge COUT signal as COUT event. */ -} lpcmp_close_window_event_t; -#endif /* FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL */ - -#if defined(FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE) && FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE -/*! - * @brief LPCMP round robin mode fixed mux port. - */ -typedef enum _lpcmp_roundrobin_fixedmuxport -{ - kLPCMP_FixedPlusMuxPort = 0U, /*!< Fixed plus mux port. */ - kLPCMP_FixedMinusMuxPort = 1U, /*!< Fixed minus mux port. */ -} lpcmp_roundrobin_fixedmuxport_t; - -/*! - * @brief LPCMP round robin mode clock source selection. - * - * Note: In different devices,the round robin mode clock source selection is different, - * please refer to the specific device Reference Manual for details. - */ -typedef enum _lpcmp_roundrobin_clock_source -{ - kLPCMP_RoundRobinClockSource0 = 0U, /*!< Select roundrobin mode clock source0. */ - kLPCMP_RoundRobinClockSource1 = 1U, /*!< Select roundrobin mode clock source1. */ - kLPCMP_RoundRobinClockSource2 = 2U, /*!< Select roundrobin mode clock source2. */ - kLPCMP_RoundRobinClockSource3 = 3U, /*!< Select roundrobin mode clock source3. */ -} lpcmp_roundrobin_clock_source_t; - -/*! - * @brief LPCMP round robin mode trigger source. - */ -typedef enum _lpcmp_roundrobin_trigger_source -{ - kLPCMP_TriggerSourceExternally = 0U, /*!< Select external trigger source. */ - kLPCMP_TriggerSourceInternally = 1U, /*!< Select internal trigger source. */ -} lpcmp_roundrobin_trigger_source_t; -#endif /* FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE */ - -/*! - * @brief Configure the filter. - */ -typedef struct _lpcmp_filter_config -{ - bool enableSample; /*!< Decide whether to use the external SAMPLE as a sampling clock input. */ - uint8_t filterSampleCount; /*!< Filter Sample Count. Available range is 1-7; 0 disables the filter. */ - uint8_t filterSamplePeriod; /*!< Filter Sample Period. The divider to the bus clock. Available range is 0-255. The - sampling clock must be at least 4 times slower than the system clock to the comparator. - So if enableSample is "false", filterSamplePeriod should be set greater than 4.*/ -} lpcmp_filter_config_t; - -/*! - * @brief configure the internal DAC. - */ -typedef struct _lpcmp_dac_config -{ - bool enableLowPowerMode; /*!< Decide whether to enable DAC low power mode. */ - lpcmp_dac_reference_voltage_source_t referenceVoltageSource; /*!< Internal DAC supply voltage reference source. */ - uint8_t DACValue; /*!< Value for the DAC Output Voltage. Different devices has different available range, - for specific values, please refer to the reference manual.*/ -} lpcmp_dac_config_t; - -/*! - * @brief Configures the comparator. - */ -typedef struct _lpcmp_config -{ -#if !(defined(FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) && FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) - bool enableStopMode; /*!< Decide whether to enable the comparator when in STOP modes. */ -#endif /* !(defined(FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) && FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) */ - - bool enableOutputPin; /*!< Decide whether to enable the comparator is available in selected pin. */ - bool useUnfilteredOutput; /*!< Decide whether to use unfiltered output. */ - bool enableInvertOutput; /*!< Decide whether to inverts the comparator output. */ - lpcmp_hysteresis_mode_t hysteresisMode; /*!< LPCMP hysteresis mode. */ - lpcmp_power_mode_t powerMode; /*!< LPCMP power mode. */ -#if defined(FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL) && FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL - lpcmp_functional_source_clock_t functionalSourceClock; /*!< Select LPCMP functional mode clock source. */ -#endif /* FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL */ -} lpcmp_config_t; - -#if defined(FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL) && FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL -/*! - * @brief Configure the window mode control. - */ -typedef struct _lpcmp_window_control_config -{ - bool enableInvertWindowSignal; /*!< True: enable invert window signal, False: disable invert window signal. */ - lpcmp_couta_signal_t COUTASignal; /*!< Decide whether to define the COUTA signal value when the window is closed. */ - lpcmp_close_window_event_t closeWindowEvent; /*!< Decide whether to select COUT event signal edge defines - a COUT event to close window. */ -} lpcmp_window_control_config_t; -#endif /* FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL */ - -#if defined(FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE) && FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE -/*! - * @brief Configure the round robin mode. - */ -typedef struct _lpcmp_roundrobin_config -{ - uint8_t initDelayModules; /*!< Comparator and DAC initialization delay modulus, See Reference Manual and DataSheet - for specific value. */ - uint8_t sampleClockNumbers; /*!< Specify the number of the round robin clock cycles(0~3) to wait after scanning the - active channel before sampling the channel's comparison result. */ - uint8_t channelSampleNumbers; /*!< Specify the number of samples for one channel, note that channelSampleNumbers - must not smaller than sampleTimeThreshhold. */ - uint8_t sampleTimeThreshhold; /*!< Specify that for one channel, when (sampleTimeThreshhold + 1) sample results are - "1",the final result is "1", otherwise the final result is "0", note that the - sampleTimeThreshhold must not be larger than channelSampleNumbers. */ - lpcmp_roundrobin_clock_source_t roundrobinClockSource; /*!< Decide which clock source to - choose in round robin mode. */ - lpcmp_roundrobin_trigger_source_t roundrobinTriggerSource; /*!< Decide which trigger source to - choose in round robin mode. */ - lpcmp_roundrobin_fixedmuxport_t fixedMuxPort; /*!< Decide which mux port to choose as - fixed channel in round robin mode. */ - uint8_t fixedChannel; /*!< Indicate which channel of the fixed mux port is used in round robin mode. */ - uint8_t checkerChannelMask; /*!< Indicate which channel of the non-fixed mux port to check its voltage value in - round robin mode, for example, if checkerChannelMask set to 0x11U means select - channel 0 and channel 4 as checker channel.*/ -} lpcmp_roundrobin_config_t; -#endif /* FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and configuration - * @{ - */ - -/*! - * @brief Initialize the LPCMP - * - * This function initializes the LPCMP module. The operations included are: - * - Enabling the clock for LPCMP module. - * - Configuring the comparator. - * - Enabling the LPCMP module. - * Note: For some devices, multiple LPCMP instance share the same clock gate. In this case, to enable the clock for - * any instance enables all the LPCMPs. Check the chip reference manual for the clock assignment of the LPCMP. - * - * @param base LPCMP peripheral base address. - * @param config Pointer to "lpcmp_config_t" structure. - */ -void LPCMP_Init(LPCMP_Type *base, const lpcmp_config_t *config); - -/*! - * @brief De-initializes the LPCMP module. - * - * This function de-initializes the LPCMP module. The operations included are: - * - Disabling the LPCMP module. - * - Disabling the clock for LPCMP module. - * - * This function disables the clock for the LPCMP. - * Note: For some devices, multiple LPCMP instance shares the same clock gate. In this case, before disabling the - * clock for the LPCMP, ensure that all the LPCMP instances are not used. - * - * @param base LPCMP peripheral base address. - */ -void LPCMP_Deinit(LPCMP_Type *base); - -/*! - * @brief Gets an available pre-defined settings for the comparator's configuration. - * - * This function initializes the comparator configuration structure to these default values: - * @code - * config->enableStopMode = false; - * config->enableOutputPin = false; - * config->useUnfilteredOutput = false; - * config->enableInvertOutput = false; - * config->hysteresisMode = kLPCMP_HysteresisLevel0; - * config->powerMode = kLPCMP_LowSpeedPowerMode; - * config->functionalSourceClock = kLPCMP_FunctionalClockSource0; - * @endcode - * @param config Pointer to "lpcmp_config_t" structure. - */ -void LPCMP_GetDefaultConfig(lpcmp_config_t *config); - -/*! - * @brief Enable/Disable LPCMP module. - * - * @param base LPCMP peripheral base address. - * @param enable "true" means enable the module, and "false" means disable the module. - */ -static inline void LPCMP_Enable(LPCMP_Type *base, bool enable) -{ - if (enable) - { - base->CCR0 |= LPCMP_CCR0_CMP_EN_MASK; - } - else - { - base->CCR0 &= ~LPCMP_CCR0_CMP_EN_MASK; - } -} - -/*! - * @brief Select the input channels for LPCMP. This function determines which input - * is selected for the negative and positive mux. - * - * @param base LPCMP peripheral base address. - * @param positiveChannel Positive side input channel number. Available range is 0-7. - * @param negativeChannel Negative side input channel number. Available range is 0-7. - */ -void LPCMP_SetInputChannels(LPCMP_Type *base, uint32_t positiveChannel, uint32_t negativeChannel); - -/*! - * @brief Enables/disables the DMA request for rising/falling events. - * Normally, the LPCMP generates a CPU interrupt if there is a rising/falling event. When - * DMA support is enabled and the rising/falling interrupt is enabled , the rising/falling - * event forces a DMA transfer request rather than a CPU interrupt instead. - * - * @param base LPCMP peripheral base address. - * @param enable "true" means enable DMA support, and "false" means disable DMA support. - */ -static inline void LPCMP_EnableDMA(LPCMP_Type *base, bool enable) -{ - if (enable) - { - base->CCR1 |= LPCMP_CCR1_DMA_EN_MASK; - } - else - { - base->CCR1 &= ~LPCMP_CCR1_DMA_EN_MASK; - } -} - -/*! - * @brief Configures the filter. - * - * @param base LPCMP peripheral base address. - * @param config Pointer to "lpcmp_filter_config_t" structure. - */ -void LPCMP_SetFilterConfig(LPCMP_Type *base, const lpcmp_filter_config_t *config); - -/*! - * @brief Configure the internal DAC module. - * - * @param base LPCMP peripheral base address. - * @param config Pointer to "lpcmp_dac_config_t" structure. If config is "NULL", disable internal DAC. - */ -void LPCMP_SetDACConfig(LPCMP_Type *base, const lpcmp_dac_config_t *config); - -/*! - * @brief Enable the interrupts. - * - * @param base LPCMP peripheral base address. - * @param mask Mask value for interrupts. See "_lpcmp_interrupt_enable". - */ -static inline void LPCMP_EnableInterrupts(LPCMP_Type *base, uint32_t mask) -{ - base->IER |= mask; -} - -/*! - * @brief Disable the interrupts. - * - * @param base LPCMP peripheral base address. - * @param mask Mask value for interrupts. See "_lpcmp_interrupt_enable". - */ -static inline void LPCMP_DisableInterrupts(LPCMP_Type *base, uint32_t mask) -{ - base->IER &= ~mask; -} - -/*! - * @brief Get the LPCMP status flags. - * - * @param base LPCMP peripheral base address. - * - * @return Mask value for the asserted flags. See "_lpcmp_status_flags". - */ -static inline uint32_t LPCMP_GetStatusFlags(LPCMP_Type *base) -{ - return base->CSR; -} - -/*! - * @brief Clear the LPCMP status flags - * - * @param base LPCMP peripheral base address. - * @param mask Mask value for the flags. See "_lpcmp_status_flags". - */ -static inline void LPCMP_ClearStatusFlags(LPCMP_Type *base, uint32_t mask) -{ - base->CSR = mask; -} - -/*! @} */ - -/*! - * @name Window mode - * @{ - */ - -/*! - * @brief Enable/Disable window mode.When any windowed mode is active, COUTA is clocked by - * the bus clock whenever WINDOW = 1. The last latched value is held when WINDOW = 0. - * The optionally inverted comparator output COUT_RAW is sampled on every bus clock - * when WINDOW=1 to generate COUTA. - * - * @param base LPCMP peripheral base address. - * @param enable "true" means enable window mode, and "false" means disable window mode. - */ -static inline void LPCMP_EnableWindowMode(LPCMP_Type *base, bool enable) -{ - if (enable) - { - base->CCR1 |= LPCMP_CCR1_WINDOW_EN_MASK; - } - else - { - base->CCR1 &= ~LPCMP_CCR1_WINDOW_EN_MASK; - } -} - -#if defined(FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL) && FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL -/*! - * @brief Configure the window control, users can use this API to implement operations on the window, - * such as inverting the window signal, setting the window closing event(only valid in windowing mode), - * and setting the COUTA signal after the window is closed(only valid in windowing mode). - * - * @param base LPCMP peripheral base address. - * @param config Pointer "lpcmp_window_control_config_t" structure. - */ -void LPCMP_SetWindowControl(LPCMP_Type *base, const lpcmp_window_control_config_t *config); -#endif /* FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL */ - -/*! @} */ - -#if defined(FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE) && FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE -/*! - * @name RoundRobin mode - * @{ - */ - -/*! - * @brief Configure the roundrobin mode. - * - * @param base LPCMP peripheral base address. - * @param config Pointer "lpcmp_roundrobin_config_t" structure. - */ -void LPCMP_SetRoundRobinConfig(LPCMP_Type *base, const lpcmp_roundrobin_config_t *config); - -/*! - * brief Configure the roundrobin internal timer reload value. - * - * param base LPCMP peripheral base address. - * param value RoundRobin internal timer reload value, allowed range:0x0UL-0xFFFFFFFUL. - */ -void LPCMP_SetRoundRobinInternalTimer(LPCMP_Type *base, uint32_t value); - -/*! - * @brief Enable/Disable roundrobin mode. - * - * @param base LPCMP peripheral base address. - * @param enable "true" means enable roundrobin mode, and "false" means disable roundrobin mode. - */ -static inline void LPCMP_EnableRoundRobinMode(LPCMP_Type *base, bool enable) -{ - if (enable) - { - base->RRCR0 |= LPCMP_RRCR0_RR_EN_MASK; - } - else - { - base->RRCR0 &= ~LPCMP_RRCR0_RR_EN_MASK; - } -} - -/*! - * @brief Enable/Disable roundrobin internal timer, note that this function is only valid - * when using the internal trigger source. - * - * @param base LPCMP peripheral base address. - * @param enable "true" means enable roundrobin internal timer, and "false" means disable roundrobin internal timer. - */ -static inline void LPCMP_EnableRoundRobinInternalTimer(LPCMP_Type *base, bool enable) -{ - if (enable) - { - base->RRCR2 |= LPCMP_RRCR2_RR_TIMER_EN_MASK; - } - else - { - base->RRCR2 &= ~LPCMP_RRCR2_RR_TIMER_EN_MASK; - } -} - -/*! - * @brief Set preset value for all channels, users can set all channels' preset vaule through this API, - * for example, if the mask set to 0x03U means channel0 and channel2's preset value set to 1U and other - * channels' preset value set to 0U. - * - * @param base LPCMP peripheral base address. - * @param mask Mask of channel index. - */ -static inline void LPCMP_SetPreSetValue(LPCMP_Type *base, uint8_t mask) -{ - base->RRCSR = (uint32_t)mask; -} - -/*! - * @brief Get comparison results for all channels, users can get all channels' comparison - * results through this API. - * - * @param base LPCMP peripheral base address. - * @return return All channels' comparison result. - */ -static inline uint8_t LPCMP_GetComparisonResult(LPCMP_Type *base) -{ - return (uint8_t)base->RRCSR; -} - -/*! - * @brief Clear input changed flags for single channel or multiple channels, users can clear - * input changed flag of a single channel or multiple channels through this API, for example, - * if the mask set to 0x03U means clear channel0 and channel2's input changed flags. - * - * @param base LPCMP peripheral base address. - * @param mask Mask of channel index. - */ -static inline void LPCMP_ClearInputChangedFlags(LPCMP_Type *base, uint8_t mask) -{ - base->RRSR = (uint32_t)mask; -} - -/*! - * @brief Get input changed flags for all channels, Users can get all channels' input changed - * flags through this API. - * - * @param base LPCMP peripheral base address. - * @return return All channels' changed flag. - */ -static inline uint8_t LPCMP_GetInputChangedFlags(LPCMP_Type *base) -{ - return (uint8_t)base->RRSR; -} - -/*! @} */ - -#endif /* FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE */ - -#if defined(__cplusplus) -} -#endif - -/*! @} */ - -#endif /* FSL_LPCMP_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpi2c.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpi2c.c deleted file mode 100644 index 1c49f2e4a2d..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpi2c.c +++ /dev/null @@ -1,2715 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpi2c.h" -#include -#include - -/* - * $Coverage Justification Reference$ - * - * $Justification fsl_lpi2c_c_ref_1$ - * The default branch cannot be executed in any circumstances, it is only added to avoid MISRA violation. - * - * $Justification fsl_lpi2c_c_ref_2$ - * Two instances failed to simulate #kStatus_LPI2C_Busy. - * - * $Justification fsl_lpi2c_c_ref_3$ - * When the transmission is completed (remaining == 0), the SDF and RSF will be set, and the flags are get before - * that(get before set), it will be over when the next cycle occurs, the first condition cannot be verified, and the - * remaining will not be verified.(will improve) - * - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpi2c" -#endif - -#if defined(LPI2C_RSTS) -#define LPI2C_RESETS_ARRAY LPI2C_RSTS -#endif - -/*! @brief LPI2C master fifo commands. */ -enum -{ - kTxDataCmd = LPI2C_MTDR_CMD(0x0U), /*!< Transmit DATA[7:0] */ - kRxDataCmd = LPI2C_MTDR_CMD(0X1U), /*!< Receive (DATA[7:0] + 1) bytes */ - kStopCmd = LPI2C_MTDR_CMD(0x2U), /*!< Generate STOP condition */ - kStartCmd = LPI2C_MTDR_CMD(0x4U), /*!< Generate(repeated) START and transmit address in DATA[[7:0] */ -}; - -/*! - * @brief Default watermark values. - * - * The default watermarks are set to zero. - */ -enum -{ - kDefaultTxWatermark = 0, - kDefaultRxWatermark = 0, -}; - -/*! @brief States for the state machine used by transactional APIs. */ -enum -{ - kIdleState = 0, - kSendCommandState, - kIssueReadCommandState, - kTransferDataState, - kStopState, - kWaitForCompletionState, -}; - -/*! - * @brief Structure definition for variables that passed as parameters in LPI2C_RunTransferStateMachine. - * The structure is private. - */ -typedef struct _lpi2c_state_machine_param -{ - bool state_complete; /*!< status of complete */ - size_t rxCount; /*!< rx count */ - size_t txCount; /*!< tx count */ - uint32_t status; /*!< machine status */ -} lpi2c_state_machine_param_t; - -/*! @brief Typedef for slave interrupt handler. */ -typedef void (*lpi2c_slave_isr_t)(LPI2C_Type *base, lpi2c_slave_handle_t *handle); - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -static uint32_t LPI2C_GetCyclesForWidth( - uint32_t sourceClock_Hz, uint32_t width_ns, uint32_t minCycles, uint32_t maxCycles, uint32_t prescaler); - -static status_t LPI2C_MasterWaitForTxReady(LPI2C_Type *base); - -static status_t LPI2C_RunTransferStateMachine(LPI2C_Type *base, lpi2c_master_handle_t *handle, bool *isDone); - -static void LPI2C_InitTransferStateMachine(lpi2c_master_handle_t *handle); - -static status_t LPI2C_SlaveCheckAndClearError(LPI2C_Type *base, uint32_t flags); - -static void LPI2C_CommonIRQHandler(LPI2C_Type *base, uint32_t instance); - -/*! - * @brief introduce function LPI2C_TransferStateMachineSendCommandState. - * This function was deal with Send Command State. - * - * @param base The I2C peripheral base address. - * @param handle Master nonblocking driver handle. - * @param variable_set Pass the address of the parent function variable. - */ -static void LPI2C_TransferStateMachineSendCommand(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_state_machine_param_t *stateParams); - -/*! - * @brief introduce function LPI2C_TransferStateMachineIssueReadCommandState. - * This function was deal with Issue Read Command State. - * - * @param base The I2C peripheral base address. - * @param handle Master nonblocking driver handle. - * @param stateParams Pass the address of the parent function variable. - */ -static void LPI2C_TransferStateMachineReadCommand(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_state_machine_param_t *stateParams); - -/*! - * @brief introduce function LPI2C_TransferStateMachineTransferDataState. - * This function was deal with init Transfer Data State. - * - * @param base The I2C peripheral base address. - * @param handle Master nonblocking driver handle. - * @param stateParams Pass the address of the parent function variable. - */ -static void LPI2C_TransferStateMachineTransferData(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_state_machine_param_t *stateParams); - -/*! - * @brief introduce function LPI2C_TransferStateMachineStopState. - * This function was deal with Stop State. - * - * @param base The I2C peripheral base address. - * @param handle Master nonblocking driver handle. - * @param stateParams Pass the address of the parent function variable. - * @param[out] isDone Set to true if the transfer has completed. - */ -static void LPI2C_TransferStateMachineStopState(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_state_machine_param_t *stateParams, - bool *isDone); - -/*! - * @brief introduce function LPI2C_TransferStateMachineWaitState. - * This function was deal with Wait For Completion State. - * - * @param base The I2C peripheral base address. - * @param handle Master nonblocking driver handle. - * @param stateParams Pass the address of the parent function variable. - * @param[out] isDone Set to true if the transfer has completed. - */ -static void LPI2C_TransferStateMachineWaitState(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_state_machine_param_t *stateParams, - bool *isDone); - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/*! @brief Array to map LPI2C instance number to base pointer. */ -static LPI2C_Type *const kLpi2cBases[] = LPI2C_BASE_PTRS; - -/*! @brief Array to map LPI2C instance number to IRQ number, used internally for LPI2C master interrupt and EDMA -transactional APIs. */ -IRQn_Type const kLpi2cIrqs[] = LPI2C_IRQS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Array to map LPI2C instance number to clock gate enum. */ -static clock_ip_name_t const kLpi2cClocks[] = LPI2C_CLOCKS; - -#if defined(LPI2C_PERIPH_CLOCKS) -/*! @brief Array to map LPI2C instance number to pheripheral clock gate enum. */ -static const clock_ip_name_t kLpi2cPeriphClocks[] = LPI2C_PERIPH_CLOCKS; -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/*! @brief Pointer to master IRQ handler for each instance, used internally for LPI2C master interrupt and EDMA -transactional APIs. */ -lpi2c_master_isr_t s_lpi2cMasterIsr; - -/*! @brief Pointers to master handles for each instance, used internally for LPI2C master interrupt and EDMA -transactional APIs. */ -void *s_lpi2cMasterHandle[ARRAY_SIZE(kLpi2cBases)]; - -/*! @brief Pointer to slave IRQ handler for each instance. */ -static lpi2c_slave_isr_t s_lpi2cSlaveIsr; - -/*! @brief Pointers to slave handles for each instance. */ -static lpi2c_slave_handle_t *s_lpi2cSlaveHandle[ARRAY_SIZE(kLpi2cBases)]; - -#if defined(LPI2C_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_lpi2cResets[] = LPI2C_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Returns an instance number given a base address. - * - * If an invalid base address is passed, debug builds will assert. Release builds will just return - * instance number 0. - * - * param base The LPI2C peripheral base address. - * return LPI2C instance number starting from 0. - */ -uint32_t LPI2C_GetInstance(LPI2C_Type *base) -{ - uint32_t instance; - for (instance = 0U; instance < ARRAY_SIZE(kLpi2cBases); ++instance) - { - if (kLpi2cBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(kLpi2cBases)); - return instance; -} - -/*! - * @brief Computes a cycle count for a given time in nanoseconds. - * @param sourceClock_Hz LPI2C functional clock frequency in Hertz. - * @param width_ns Desired with in nanoseconds. - * @param minCycles Minimum cycle count. - * @param maxCycles Maximum cycle count. - * @param prescaler LPI2C prescaler setting. If the cycle period is not affected by the prescaler value, set it to 0. - */ -static uint32_t LPI2C_GetCyclesForWidth( - uint32_t sourceClock_Hz, uint32_t width_ns, uint32_t minCycles, uint32_t maxCycles, uint32_t prescaler) -{ - assert(sourceClock_Hz > 0U); - - uint32_t divider = 1U; - - while (prescaler != 0U) - { - divider *= 2U; - prescaler--; - } - - uint32_t busCycle_ns = 1000000U / (sourceClock_Hz / divider / 1000U); - /* Calculate the cycle count, round up the calculated value. */ - uint32_t cycles = (width_ns * 10U / busCycle_ns + 5U) / 10U; - - /* If the calculated value is smaller than the minimum value, use the minimum value */ - if (cycles < minCycles) - { - cycles = minCycles; - } - /* If the calculated value is larger than the maximum value, use the maxmum value */ - if (cycles > maxCycles) - { - cycles = maxCycles; - } - - return cycles; -} - -/*! - * brief Convert provided flags to status code, and clear any errors if present. - * param base The LPI2C peripheral base address. - * param status Current status flags value that will be checked. - * retval #kStatus_Success - * retval #kStatus_LPI2C_PinLowTimeout - * retval #kStatus_LPI2C_ArbitrationLost - * retval #kStatus_LPI2C_Nak - * retval #kStatus_LPI2C_FifoError - */ -status_t LPI2C_MasterCheckAndClearError(LPI2C_Type *base, uint32_t status) -{ - status_t result = kStatus_Success; - - /* Check for error. These errors cause a stop to automatically be sent. We must */ - /* clear the errors before a new transfer can start. */ - status &= (uint32_t)kLPI2C_MasterErrorFlags; - if (0U != status) - { - /* Select the correct error code. Ordered by severity, with bus issues first. */ - if (0U != (status & (uint32_t)kLPI2C_MasterPinLowTimeoutFlag)) - { - result = kStatus_LPI2C_PinLowTimeout; - } - else if (0U != (status & (uint32_t)kLPI2C_MasterArbitrationLostFlag)) - { - result = kStatus_LPI2C_ArbitrationLost; - } - else if (0U != (status & (uint32_t)kLPI2C_MasterNackDetectFlag)) - { - result = kStatus_LPI2C_Nak; - } - /* - * $Branch Coverage Justification$ - * Before that, the state was stripped of other attributes, and it only contained the four brother flags.(will - * improve) - */ - else if (0U != (status & (uint32_t)kLPI2C_MasterFifoErrFlag)) - { - result = kStatus_LPI2C_FifoError; - } - else - { - ; /* Intentional empty */ - } - - /* Clear the flags. */ - LPI2C_MasterClearStatusFlags(base, status); - - if (((base->MCFGR1 & LPI2C_MCFGR1_IGNACK_MASK) != 0x00U) && (result == kStatus_LPI2C_Nak)) - { - /* ERR051119: If IGNACK was set and nak detect , we will ignore the Nak status */ - result = kStatus_Success; - } - else - { - /* Reset fifos. These flags clear automatically.*/ - base->MCR |= LPI2C_MCR_RRF_MASK | LPI2C_MCR_RTF_MASK; - } - } - else - { - ; /* Intentional empty */ - } - - return result; -} - -/*! - * @brief Wait until there is room in the tx fifo. - * @param base The LPI2C peripheral base address. - * @retval #kStatus_Success - * @retval #kStatus_LPI2C_PinLowTimeout - * @retval #kStatus_LPI2C_ArbitrationLost - * @retval #kStatus_LPI2C_Nak - * @retval #kStatus_LPI2C_FifoError - */ -static status_t LPI2C_MasterWaitForTxReady(LPI2C_Type *base) -{ - status_t result = kStatus_Success; - uint32_t status; - size_t txCount; - size_t txFifoSize = (size_t)FSL_FEATURE_LPI2C_FIFO_SIZEn(base); - -#if I2C_RETRY_TIMES != 0U - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - do - { - /* Get the number of words in the tx fifo and compute empty slots. */ - LPI2C_MasterGetFifoCounts(base, NULL, &txCount); - txCount = txFifoSize - txCount; - - /* Check for error flags. */ - status = LPI2C_MasterGetStatusFlags(base); - result = LPI2C_MasterCheckAndClearError(base, status); - if (kStatus_Success != result) - { - break; - } -#if I2C_RETRY_TIMES != 0U - waitTimes--; - } while ((0U == txCount) && (0U != waitTimes)); - - if (0U == waitTimes) - { - result = kStatus_LPI2C_Timeout; - } -#else - } while (0U == txCount); -#endif - - return result; -} - -/*! - * brief Make sure the bus isn't already busy. - * - * A busy bus is allowed if we are the one driving it. - * - * param base The LPI2C peripheral base address. - * retval #kStatus_Success - * retval #kStatus_LPI2C_Busy - */ -/* Not static so it can be used from fsl_lpi2c_edma.c. */ -status_t LPI2C_CheckForBusyBus(LPI2C_Type *base) -{ - status_t ret = kStatus_Success; - - uint32_t status = LPI2C_MasterGetStatusFlags(base); - /* - * $Branch Coverage Justification$ - * $ref fsl_lpi2c_c_ref_2$ - */ - if ((0U != (status & (uint32_t)kLPI2C_MasterBusBusyFlag)) && (0U == (status & (uint32_t)kLPI2C_MasterBusyFlag))) - { - ret = kStatus_LPI2C_Busy; - } - - return ret; -} - -/*! - * brief Provides a default configuration for the LPI2C master peripheral. - * - * This function provides the following default configuration for the LPI2C master peripheral: - * code - * masterConfig->enableMaster = true; - * masterConfig->debugEnable = false; - * masterConfig->ignoreAck = false; - * masterConfig->pinConfig = kLPI2C_2PinOpenDrain; - * masterConfig->baudRate_Hz = 100000U; - * masterConfig->busIdleTimeout_ns = 0U; - * masterConfig->pinLowTimeout_ns = 0U; - * masterConfig->sdaGlitchFilterWidth_ns = 0U; - * masterConfig->sclGlitchFilterWidth_ns = 0U; - * masterConfig->hostRequest.enable = false; - * masterConfig->hostRequest.source = kLPI2C_HostRequestExternalPin; - * masterConfig->hostRequest.polarity = kLPI2C_HostRequestPinActiveHigh; - * endcode - * - * After calling this function, you can override any settings in order to customize the configuration, - * prior to initializing the master driver with LPI2C_MasterInit(). - * - * param[out] masterConfig User provided configuration structure for default values. Refer to #lpi2c_master_config_t. - */ -void LPI2C_MasterGetDefaultConfig(lpi2c_master_config_t *masterConfig) -{ - /* Initializes the configure structure to zero. */ - (void)memset(masterConfig, 0, sizeof(*masterConfig)); - - masterConfig->enableMaster = true; - masterConfig->debugEnable = false; - masterConfig->enableDoze = true; - masterConfig->ignoreAck = false; - masterConfig->pinConfig = kLPI2C_2PinOpenDrain; - masterConfig->baudRate_Hz = 100000U; - masterConfig->busIdleTimeout_ns = 0U; /* Set to 0 to disable the function */ - masterConfig->pinLowTimeout_ns = 0U; /* Set to 0 to disable the function */ - masterConfig->sdaGlitchFilterWidth_ns = 0U; /* Set to 0 to disable the function */ - masterConfig->sclGlitchFilterWidth_ns = 0U; /* Set to 0 to disable the function */ - masterConfig->hostRequest.enable = false; - masterConfig->hostRequest.source = kLPI2C_HostRequestExternalPin; - masterConfig->hostRequest.polarity = kLPI2C_HostRequestPinActiveHigh; -} - -/*! - * brief Initializes the LPI2C master peripheral. - * - * This function enables the peripheral clock and initializes the LPI2C master peripheral as described by the user - * provided configuration. A software reset is performed prior to configuration. - * - * param base The LPI2C peripheral base address. - * param masterConfig User provided peripheral configuration. Use LPI2C_MasterGetDefaultConfig() to get a set of - * defaults - * that you can override. - * param sourceClock_Hz Frequency in Hertz of the LPI2C functional clock. Used to calculate the baud rate divisors, - * filter widths, and timeout periods. - */ -void LPI2C_MasterInit(LPI2C_Type *base, const lpi2c_master_config_t *masterConfig, uint32_t sourceClock_Hz) -{ - uint32_t prescaler; - uint32_t cycles; - uint32_t cfgr2; - uint32_t value; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - - uint32_t instance = LPI2C_GetInstance(base); - - /* Ungate the clock. */ - (void)CLOCK_EnableClock(kLpi2cClocks[instance]); -#if defined(LPI2C_PERIPH_CLOCKS) - /* Ungate the functional clock in initialize function. */ - CLOCK_EnableClock(kLpi2cPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(LPI2C_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_lpi2cResets[LPI2C_GetInstance(base)]); -#endif - - /* Reset peripheral before configuring it. */ - LPI2C_MasterReset(base); - - /* Doze bit: 0 is enable, 1 is disable */ - base->MCR = LPI2C_MCR_DBGEN(masterConfig->debugEnable) | LPI2C_MCR_DOZEN(!(masterConfig->enableDoze)); - - /* host request */ - value = base->MCFGR0; - value &= (~(LPI2C_MCFGR0_HREN_MASK | LPI2C_MCFGR0_HRPOL_MASK | LPI2C_MCFGR0_HRSEL_MASK)); - value |= LPI2C_MCFGR0_HREN(masterConfig->hostRequest.enable) | - LPI2C_MCFGR0_HRPOL(masterConfig->hostRequest.polarity) | - LPI2C_MCFGR0_HRSEL(masterConfig->hostRequest.source); - base->MCFGR0 = value; - - /* pin config and ignore ack */ - value = base->MCFGR1; - value &= ~(LPI2C_MCFGR1_PINCFG_MASK | LPI2C_MCFGR1_IGNACK_MASK); - value |= LPI2C_MCFGR1_PINCFG(masterConfig->pinConfig); - value |= LPI2C_MCFGR1_IGNACK(masterConfig->ignoreAck); - base->MCFGR1 = value; - - LPI2C_MasterSetWatermarks(base, (size_t)kDefaultTxWatermark, (size_t)kDefaultRxWatermark); - - /* Configure glitch filters. */ - cfgr2 = base->MCFGR2; - if (0U != (masterConfig->sdaGlitchFilterWidth_ns)) - { - /* Calculate SDA filter width. The width is equal to FILTSDA cycles of functional clock. - And set FILTSDA to 0 disables the fileter, so the min value is 1. */ - cycles = LPI2C_GetCyclesForWidth(sourceClock_Hz, masterConfig->sdaGlitchFilterWidth_ns, 1U, - (LPI2C_MCFGR2_FILTSDA_MASK >> LPI2C_MCFGR2_FILTSDA_SHIFT), 0U); - cfgr2 &= ~LPI2C_MCFGR2_FILTSDA_MASK; - cfgr2 |= LPI2C_MCFGR2_FILTSDA(cycles); - } - if (0U != masterConfig->sclGlitchFilterWidth_ns) - { - /* Calculate SDL filter width. The width is equal to FILTSCL cycles of functional clock. - And set FILTSCL to 0 disables the fileter, so the min value is 1. */ - cycles = LPI2C_GetCyclesForWidth(sourceClock_Hz, masterConfig->sclGlitchFilterWidth_ns, 1U, - (LPI2C_MCFGR2_FILTSCL_MASK >> LPI2C_MCFGR2_FILTSCL_SHIFT), 0U); - cfgr2 &= ~LPI2C_MCFGR2_FILTSCL_MASK; - cfgr2 |= LPI2C_MCFGR2_FILTSCL(cycles); - } - base->MCFGR2 = cfgr2; - - /* Configure baudrate after the SDA/SCL glitch filter setting, - since the baudrate calculation needs them as parameter. */ - LPI2C_MasterSetBaudRate(base, sourceClock_Hz, masterConfig->baudRate_Hz); - - /* Configure bus idle and pin low timeouts after baudrate setting, - since the timeout calculation needs prescaler as parameter. */ - prescaler = (base->MCFGR1 & LPI2C_MCFGR1_PRESCALE_MASK) >> LPI2C_MCFGR1_PRESCALE_SHIFT; - - if (0U != (masterConfig->busIdleTimeout_ns)) - { - /* Calculate bus idle timeout value. The value is equal to BUSIDLE cycles of functional clock divided by - prescaler. And set BUSIDLE to 0 disables the fileter, so the min value is 1. */ - cycles = LPI2C_GetCyclesForWidth(sourceClock_Hz, masterConfig->busIdleTimeout_ns, 1U, - (LPI2C_MCFGR2_BUSIDLE_MASK >> LPI2C_MCFGR2_BUSIDLE_SHIFT), prescaler); - base->MCFGR2 = (base->MCFGR2 & (~LPI2C_MCFGR2_BUSIDLE_MASK)) | LPI2C_MCFGR2_BUSIDLE(cycles); - } - if (0U != masterConfig->pinLowTimeout_ns) - { - /* Calculate bus pin low timeout value. The value is equal to PINLOW cycles of functional clock divided by - prescaler. And set PINLOW to 0 disables the fileter, so the min value is 1. */ - cycles = LPI2C_GetCyclesForWidth(sourceClock_Hz, masterConfig->pinLowTimeout_ns / 256U, 1U, - (LPI2C_MCFGR2_BUSIDLE_MASK >> LPI2C_MCFGR2_BUSIDLE_SHIFT), prescaler); - base->MCFGR3 = (base->MCFGR3 & ~LPI2C_MCFGR3_PINLOW_MASK) | LPI2C_MCFGR3_PINLOW(cycles); - } - - LPI2C_MasterEnable(base, masterConfig->enableMaster); -} - -/*! - * brief Deinitializes the LPI2C master peripheral. - * - * This function disables the LPI2C master peripheral and gates the clock. It also performs a software - * reset to restore the peripheral to reset conditions. - * - * param base The LPI2C peripheral base address. - */ -void LPI2C_MasterDeinit(LPI2C_Type *base) -{ - /* Restore to reset state. */ - LPI2C_MasterReset(base); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - - uint32_t instance = LPI2C_GetInstance(base); - - /* Gate clock. */ - (void)CLOCK_DisableClock(kLpi2cClocks[instance]); -#if defined(LPI2C_PERIPH_CLOCKS) - /* Gate the functional clock. */ - CLOCK_DisableClock(kLpi2cPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Configures LPI2C master data match feature. - * - * param base The LPI2C peripheral base address. - * param matchConfig Settings for the data match feature. - */ -void LPI2C_MasterConfigureDataMatch(LPI2C_Type *base, const lpi2c_data_match_config_t *matchConfig) -{ - /* Disable master mode. */ - bool wasEnabled = (0U != ((base->MCR & LPI2C_MCR_MEN_MASK) >> LPI2C_MCR_MEN_SHIFT)); - LPI2C_MasterEnable(base, false); - - base->MCFGR1 = (base->MCFGR1 & ~LPI2C_MCFGR1_MATCFG_MASK) | LPI2C_MCFGR1_MATCFG(matchConfig->matchMode); - base->MCFGR0 = (base->MCFGR0 & ~LPI2C_MCFGR0_RDMO_MASK) | LPI2C_MCFGR0_RDMO(matchConfig->rxDataMatchOnly); - base->MDMR = LPI2C_MDMR_MATCH0(matchConfig->match0) | LPI2C_MDMR_MATCH1(matchConfig->match1); - - /* Restore master mode. */ - if (wasEnabled) - { - LPI2C_MasterEnable(base, true); - } -} - -/*! - * brief Sets the I2C bus frequency for master transactions. - * - * The LPI2C master is automatically disabled and re-enabled as necessary to configure the baud - * rate. Do not call this function during a transfer, or the transfer is aborted. - * - * note Please note that the second parameter is the clock frequency of LPI2C module, the third - * parameter means user configured bus baudrate, this implementation is different from other I2C drivers - * which use baudrate configuration as second parameter and source clock frequency as third parameter. - * - * param base The LPI2C peripheral base address. - * param sourceClock_Hz LPI2C functional clock frequency in Hertz. - * param baudRate_Hz Requested bus frequency in Hertz. - */ -void LPI2C_MasterSetBaudRate(LPI2C_Type *base, uint32_t sourceClock_Hz, uint32_t baudRate_Hz) -{ - bool wasEnabled; - uint8_t filtScl = (uint8_t)((base->MCFGR2 & LPI2C_MCFGR2_FILTSCL_MASK) >> LPI2C_MCFGR2_FILTSCL_SHIFT); - - uint8_t divider = 1U; - uint8_t bestDivider = 1U; - uint8_t prescale = 0U; - uint8_t bestPre = 0U; - - uint8_t clkCycle; - uint8_t bestclkCycle = 0U; - - uint32_t absError = 0U; - uint32_t bestError = 0xffffffffu; - uint32_t computedRate; - - uint32_t tmpReg = 0U; - - /* Disable master mode. */ - wasEnabled = (0U != ((base->MCR & LPI2C_MCR_MEN_MASK) >> LPI2C_MCR_MEN_SHIFT)); - LPI2C_MasterEnable(base, false); - - /* Baud rate = (sourceClock_Hz / 2 ^ prescale) / (CLKLO + 1 + CLKHI + 1 + SCL_LATENCY) - * SCL_LATENCY = ROUNDDOWN((2 + FILTSCL) / (2 ^ prescale)) - */ - for (prescale = 0U; prescale <= 7U; prescale++) - { - /* Calculate the clkCycle, clkCycle = CLKLO + CLKHI, divider = 2 ^ prescale */ - clkCycle = (uint8_t)((10U * sourceClock_Hz / divider / baudRate_Hz + 5U) / 10U - (2U + filtScl) / divider - 2U); - /* According to register description, The max value for CLKLO and CLKHI is 63. - however to meet the I2C specification of tBUF, CLKHI should be less than - clkCycle - 0.52 x sourceClock_Hz / baudRate_Hz / divider + 1U. Refer to the comment of the tmpHigh's - calculation for details. So we have: - CLKHI < clkCycle - 0.52 x sourceClock_Hz / baudRate_Hz / divider + 1U, - clkCycle = CLKHI + CLKLO and - sourceClock_Hz / baudRate_Hz / divider = clkCycle + 2 + ROUNDDOWN((2 + FILTSCL) / divider), - we can come up with: CLKHI < 0.92 x CLKLO - ROUNDDOWN(2 + FILTSCL) / divider - so the max boundary of CLKHI should be 0.92 x 63 - ROUNDDOWN(2 + FILTSCL) / divider, - and the max boundary of clkCycle is 1.92 x 63 - ROUNDDOWN(2 + FILTSCL) / divider. */ - if (clkCycle > (120U - (2U + filtScl) / divider)) - { - divider *= 2U; - continue; - } - /* Calculate the computed baudrate and compare it with the desired baudrate */ - computedRate = (sourceClock_Hz / (uint32_t)divider) / - ((uint32_t)clkCycle + 2U + (2U + (uint32_t)filtScl) / (uint32_t)divider); - absError = baudRate_Hz > computedRate ? baudRate_Hz - computedRate : computedRate - baudRate_Hz; - if (absError < bestError) - { - bestPre = prescale; - bestDivider = divider; - bestclkCycle = clkCycle; - bestError = absError; - - /* If the error is 0, then we can stop searching because we won't find a better match. */ - if (absError == 0U) - { - break; - } - } - divider *= 2U; - } - - /* SCL low time tLO should be larger than or equal to SCL high time tHI: - tLO = ((CLKLO + 1) x (2 ^ PRESCALE)) >= tHI = ((CLKHI + 1 + SCL_LATENCY) x (2 ^ PRESCALE)), - which is CLKLO >= CLKHI + (2U + filtScl) / bestDivider. - Also since bestclkCycle = CLKLO + CLKHI, bestDivider = 2 ^ PRESCALE - which makes CLKHI <= (bestclkCycle - (2U + filtScl) / bestDivider) / 2U. - - The max tBUF should be at least 0.52 times of the SCL clock cycle: - tBUF = ((CLKLO + 1) x (2 ^ PRESCALE) / sourceClock_Hz) > (0.52 / baudRate_Hz), - plus bestDivider = 2 ^ PRESCALE, bestclkCycle = CLKLO + CLKHI we can come up with - CLKHI <= (bestclkCycle - 0.52 x sourceClock_Hz / baudRate_Hz / bestDivider + 1U). - In this case to get a safe CLKHI calculation, we can assume: - */ - uint8_t tmpHigh = (bestclkCycle - (2U + filtScl) / bestDivider) / 2U; - while (tmpHigh > (bestclkCycle - 52U * sourceClock_Hz / baudRate_Hz / bestDivider / 100U + 1U)) - { - tmpHigh = tmpHigh - 1U; - } - - /* Calculate DATAVD and SETHOLD. - To meet the timing requirement of I2C spec for standard mode, fast mode and fast mode plus: */ - /* The min tHD:STA/tSU:STA/tSU:STO should be at least 0.4 times of the SCL clock cycle, use 0.5 to be safe: - tHD:STA = ((SETHOLD + 1) x (2 ^ PRESCALE) / sourceClock_Hz) > (0.5 / baudRate_Hz), bestDivider = 2 ^ PRESCALE */ - uint8_t tmpHold = (uint8_t)(sourceClock_Hz / baudRate_Hz / bestDivider / 2U) - 1U; - - /* The max tVD:DAT/tVD:ACK/tHD:DAT should be at most 0.345 times of the SCL clock cycle, use 0.25 to be safe: - tVD:DAT = ((DATAVD + 1) x (2 ^ PRESCALE) / sourceClock_Hz) < (0.25 / baudRate_Hz), bestDivider = 2 ^ PRESCALE */ - uint8_t tmpDataVd = (uint8_t)(sourceClock_Hz / baudRate_Hz / bestDivider / 4U) - 1U; - - /* The min tSU:DAT should be at least 0.05 times of the SCL clock cycle: - tSU:DAT = ((2 + FILTSDA + 2 ^ PRESCALE) / sourceClock_Hz) >= (0.05 / baud), - plus bestDivider = 2 ^ PRESCALE, we can come up with: - FILTSDA >= (0.05 x sourceClock_Hz / baudRate_Hz - bestDivider - 2) */ - if ((sourceClock_Hz / baudRate_Hz / 20U) > (bestDivider + 2U)) - { - /* Read out the FILTSDA configuration, if it is smaller than expected, change the setting. */ - uint8_t filtSda = (uint8_t)((base->MCFGR2 & LPI2C_MCFGR2_FILTSDA_MASK) >> LPI2C_MCFGR2_FILTSDA_SHIFT); - if (filtSda < (sourceClock_Hz / baudRate_Hz / 20U - bestDivider - 2U)) - { - filtSda = (uint8_t)(sourceClock_Hz / baudRate_Hz / 20U) - bestDivider - 2U; - } - base->MCFGR2 = (base->MCFGR2 & ~LPI2C_MCFGR2_FILTSDA_MASK) | LPI2C_MCFGR2_FILTSDA(filtSda); - } - - /* Set CLKHI, CLKLO, SETHOLD, DATAVD value. */ - tmpReg = LPI2C_MCCR0_CLKHI((uint32_t)tmpHigh) | - LPI2C_MCCR0_CLKLO((uint32_t)((uint32_t)bestclkCycle - (uint32_t)tmpHigh)) | - LPI2C_MCCR0_SETHOLD((uint32_t)tmpHold) | LPI2C_MCCR0_DATAVD((uint32_t)tmpDataVd); - base->MCCR0 = tmpReg; - - /* Set PRESCALE value. */ - base->MCFGR1 = (base->MCFGR1 & ~LPI2C_MCFGR1_PRESCALE_MASK) | LPI2C_MCFGR1_PRESCALE(bestPre); - - /* Restore master mode. */ - if (wasEnabled) - { - LPI2C_MasterEnable(base, true); - } -} - -/*! - * brief Sends a START signal and slave address on the I2C bus. - * - * This function is used to initiate a new master mode transfer. First, the bus state is checked to ensure - * that another master is not occupying the bus. Then a START signal is transmitted, followed by the - * 7-bit address specified in the a address parameter. Note that this function does not actually wait - * until the START and address are successfully sent on the bus before returning. - * - * param base The LPI2C peripheral base address. - * param address 7-bit slave device address, in bits [6:0]. - * param dir Master transfer direction, either #kLPI2C_Read or #kLPI2C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * retval #kStatus_Success START signal and address were successfully enqueued in the transmit FIFO. - * retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - */ -status_t LPI2C_MasterStart(LPI2C_Type *base, uint8_t address, lpi2c_direction_t dir) -{ - /* Return an error if the bus is already in use not by us. */ - status_t result = LPI2C_CheckForBusyBus(base); - /* - * $Branch Coverage Justification$ - * $ref fsl_lpi2c_c_ref_2$ - */ - if (kStatus_Success == result) - { - /* Clear all flags. */ - LPI2C_MasterClearStatusFlags(base, (uint32_t)kLPI2C_MasterClearFlags); - - /* Turn off auto-stop option. */ - base->MCFGR1 &= ~LPI2C_MCFGR1_AUTOSTOP_MASK; - - /* Wait until there is room in the fifo. */ - result = LPI2C_MasterWaitForTxReady(base); - if (kStatus_Success == result) - { - /* Issue start command. */ - base->MTDR = (uint32_t)kStartCmd | (((uint32_t)address << 1U) | (uint32_t)dir); - } - } - - return result; -} - -/*! - * brief Sends a STOP signal on the I2C bus. - * - * This function does not return until the STOP signal is seen on the bus, or an error occurs. - * - * param base The LPI2C peripheral base address. - * retval #kStatus_Success The STOP signal was successfully sent on the bus and the transaction terminated. - * retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_LPI2C_FifoError FIFO under run or overrun. - * retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterStop(LPI2C_Type *base) -{ - /* Wait until there is room in the fifo. */ - status_t result = LPI2C_MasterWaitForTxReady(base); - if (kStatus_Success == result) - { - /* Send the STOP signal */ - base->MTDR = (uint32_t)kStopCmd; - - /* Wait for the stop detected flag to set, indicating the transfer has completed on the bus. */ - /* Also check for errors while waiting. */ -#if I2C_RETRY_TIMES != 0U - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - -#if I2C_RETRY_TIMES != 0U - while ((result == kStatus_Success) && (0U != waitTimes)) - { - waitTimes--; -#else - while (result == kStatus_Success) - { -#endif - uint32_t status = LPI2C_MasterGetStatusFlags(base); - - /* Check for error flags. */ - result = LPI2C_MasterCheckAndClearError(base, status); - - /* Check if the stop was sent successfully. */ - if ((0U != (status & (uint32_t)kLPI2C_MasterStopDetectFlag)) && - (0U != (status & (uint32_t)kLPI2C_MasterTxReadyFlag))) - { - LPI2C_MasterClearStatusFlags(base, (uint32_t)kLPI2C_MasterStopDetectFlag); - break; - } - } - -#if I2C_RETRY_TIMES != 0U - if (0U == waitTimes) - { - result = kStatus_LPI2C_Timeout; - } -#endif - } - - return result; -} - -/*! - * brief Performs a polling receive transfer on the I2C bus. - * - * param base The LPI2C peripheral base address. - * param rxBuff The pointer to the data to be transferred. - * param rxSize The length in bytes of the data to be transferred. - * retval #kStatus_Success Data was received successfully. - * retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_LPI2C_FifoError FIFO under run or overrun. - * retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterReceive(LPI2C_Type *base, void *rxBuff, size_t rxSize) -{ - assert(NULL != rxBuff); - - status_t result = kStatus_Success; - uint8_t *buf; - size_t tmpRxSize = rxSize; -#if I2C_RETRY_TIMES != 0U - uint32_t waitTimes; -#endif - - /* Check transfer data size. */ - if (rxSize > ((size_t)256 * (size_t)FSL_FEATURE_LPI2C_FIFO_SIZEn(base))) - { - return kStatus_InvalidArgument; - } - - /* Handle empty read. */ - if (rxSize != 0U) - { - /* Wait until there is room in the command fifo. */ - result = LPI2C_MasterWaitForTxReady(base); - if (kStatus_Success == result) - { - /* Issue command to receive data. A single write to MTDR can issue read operation of 0xFFU + 1 byte of data - at most, so when the rxSize is larger than 0x100U, push multiple read commands to MTDR until rxSize is - reached. */ - while (tmpRxSize != 0U) - { - if (tmpRxSize > 256U) - { - base->MTDR = (uint32_t)(kRxDataCmd) | (uint32_t)LPI2C_MTDR_DATA(0xFFU); - tmpRxSize -= 256U; - } - else - { - base->MTDR = (uint32_t)(kRxDataCmd) | (uint32_t)LPI2C_MTDR_DATA(tmpRxSize - 1U); - tmpRxSize = 0U; - } - } - - /* Receive data */ - buf = (uint8_t *)rxBuff; - while (0U != (rxSize--)) - { -#if I2C_RETRY_TIMES != 0U - waitTimes = I2C_RETRY_TIMES; -#endif - /* Read LPI2C receive fifo register. The register includes a flag to indicate whether */ - /* the FIFO is empty, so we can both get the data and check if we need to keep reading */ - /* using a single register read. */ - uint32_t value = 0U; - do - { - /* Check for errors. */ - result = LPI2C_MasterCheckAndClearError(base, LPI2C_MasterGetStatusFlags(base)); - if (kStatus_Success != result) - { - break; - } - - value = base->MRDR; -#if I2C_RETRY_TIMES != 0U - waitTimes--; - } while ((0U != (value & LPI2C_MRDR_RXEMPTY_MASK)) && (0U != waitTimes)); - if (0U == waitTimes) - { - result = kStatus_LPI2C_Timeout; - } -#else - } while (0U != (value & LPI2C_MRDR_RXEMPTY_MASK)); -#endif - if ((status_t)kStatus_Success != result) - { - break; - } - - *buf++ = (uint8_t)(value & LPI2C_MRDR_DATA_MASK); - } - } - } - - return result; -} - -/*! - * brief Performs a polling send transfer on the I2C bus. - * - * Sends up to a txSize number of bytes to the previously addressed slave device. The slave may - * reply with a NAK to any byte in order to terminate the transfer early. If this happens, this - * function returns #kStatus_LPI2C_Nak. - * - * param base The LPI2C peripheral base address. - * param txBuff The pointer to the data to be transferred. - * param txSize The length in bytes of the data to be transferred. - * retval #kStatus_Success Data was sent successfully. - * retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_LPI2C_FifoError FIFO under run or over run. - * retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterSend(LPI2C_Type *base, void *txBuff, size_t txSize) -{ - status_t result = kStatus_Success; - uint8_t *buf = (uint8_t *)txBuff; - - assert(NULL != txBuff); - - /* Send data buffer */ - while (0U != (txSize--)) - { - /* Wait until there is room in the fifo. This also checks for errors. */ - result = LPI2C_MasterWaitForTxReady(base); - if (kStatus_Success != result) - { - break; - } - - /* Write byte into LPI2C master data register. */ - base->MTDR = *buf++; - } - - return result; -} - -/*! - * brief Performs a master polling transfer on the I2C bus. - * - * note The API does not return until the transfer succeeds or fails due - * to error happens during transfer. - * - * param base The LPI2C peripheral base address. - * param transfer Pointer to the transfer structure. - * retval #kStatus_Success Data was received successfully. - * retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_LPI2C_FifoError FIFO under run or overrun. - * retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterTransferBlocking(LPI2C_Type *base, lpi2c_master_transfer_t *transfer) -{ - assert(NULL != transfer); - assert(transfer->subaddressSize <= sizeof(transfer->subaddress)); - - status_t result = kStatus_Success; - uint16_t commandBuffer[7]; - uint32_t cmdCount = 0U; - - /* Check transfer data size in read operation. */ - if ((transfer->direction == kLPI2C_Read) && - (transfer->dataSize > ((size_t)256 * (size_t)FSL_FEATURE_LPI2C_FIFO_SIZEn(base)))) - { - return kStatus_InvalidArgument; - } - - /* Enable the master function and disable the slave function. */ - LPI2C_MasterEnable(base, true); - LPI2C_SlaveEnable(base, false); - - /* Return an error if the bus is already in use not by us. */ - result = LPI2C_CheckForBusyBus(base); - /* - * $Branch Coverage Justification$ - * $ref fsl_lpi2c_c_ref_2$ - */ - if (kStatus_Success == result) - { - /* Clear all flags. */ - LPI2C_MasterClearStatusFlags(base, (uint32_t)kLPI2C_MasterClearFlags); - - /* Turn off auto-stop option. */ - base->MCFGR1 &= ~LPI2C_MCFGR1_AUTOSTOP_MASK; - - lpi2c_direction_t direction = (0U != transfer->subaddressSize) ? kLPI2C_Write : transfer->direction; - if (0U == (transfer->flags & (uint32_t)kLPI2C_TransferNoStartFlag)) - { - commandBuffer[cmdCount++] = - (uint16_t)kStartCmd | - (uint16_t)((uint16_t)((uint16_t)transfer->slaveAddress << 1U) | (uint16_t)direction); - } - - /* Subaddress, MSB first. */ - if (0U != transfer->subaddressSize) - { - uint32_t subaddressRemaining = transfer->subaddressSize; - while (0U != subaddressRemaining--) - { - uint8_t subaddressByte = (uint8_t)((transfer->subaddress >> (8U * subaddressRemaining)) & 0xffU); - commandBuffer[cmdCount++] = subaddressByte; - } - } - - /* Reads need special handling. */ - if ((0U != transfer->dataSize) && (transfer->direction == kLPI2C_Read)) - { - /* Need to send repeated start if switching directions to read. */ - if (direction == kLPI2C_Write) - { - commandBuffer[cmdCount++] = - (uint16_t)kStartCmd | - (uint16_t)((uint16_t)((uint16_t)transfer->slaveAddress << 1U) | (uint16_t)kLPI2C_Read); - } - } - - /* Send command buffer */ - uint32_t index = 0U; - while (0U != cmdCount--) - { - /* Wait until there is room in the fifo. This also checks for errors. */ - result = LPI2C_MasterWaitForTxReady(base); - if (kStatus_Success != result) - { - break; - } - - /* Write byte into LPI2C master data register. */ - base->MTDR = commandBuffer[index]; - index++; - } - - if (kStatus_Success == result) - { - /* Transmit data. */ - if ((transfer->direction == kLPI2C_Write) && (transfer->dataSize > 0U)) - { - /* Send Data. */ - result = LPI2C_MasterSend(base, transfer->data, transfer->dataSize); - } - - /* Receive Data. */ - if ((transfer->direction == kLPI2C_Read) && (transfer->dataSize > 0U)) - { - result = LPI2C_MasterReceive(base, transfer->data, transfer->dataSize); - } - /* - * $Branch Coverage Justification$ - * Errors cannot be simulated by software during transmission.(will improve) - */ - if (kStatus_Success == result) - { - if ((transfer->flags & (uint32_t)kLPI2C_TransferNoStopFlag) == 0U) - { - result = LPI2C_MasterStop(base); - } - } - } - - /* Transmit fail */ - if (kStatus_Success != result) - { - if ((transfer->flags & (uint32_t)kLPI2C_TransferNoStopFlag) == 0U) - { - (void)LPI2C_MasterStop(base); - } - } - } - - return result; -} - -/*! - * brief Creates a new handle for the LPI2C master non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the LPI2C_MasterTransferAbort() API shall be called. - * - * - * note The function also enables the NVIC IRQ for the input LPI2C. Need to notice - * that on some SoCs the LPI2C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - * - * param base The LPI2C peripheral base address. - * param[out] handle Pointer to the LPI2C master driver handle. - * param callback User provided pointer to the asynchronous callback function. - * param userData User provided pointer to the application callback data. - */ -void LPI2C_MasterTransferCreateHandle(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_master_transfer_callback_t callback, - void *userData) -{ - uint32_t instance; - - assert(NULL != handle); - - /* Clear out the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Look up instance number */ - instance = LPI2C_GetInstance(base); - - /* Save base and instance. */ - handle->completionCallback = callback; - handle->userData = userData; - - /* Save this handle for IRQ use. */ - s_lpi2cMasterHandle[instance] = handle; - - /* Set irq handler. */ - s_lpi2cMasterIsr = LPI2C_MasterTransferHandleIRQ; - - /* Clear internal IRQ enables and enable NVIC IRQ. */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - - /* Enable NVIC IRQ, this only enables the IRQ directly connected to the NVIC. - In some cases the LPI2C IRQ is configured through INTMUX, user needs to enable - INTMUX IRQ in application code. */ - (void)EnableIRQ(kLpi2cIrqs[instance]); -} - -static void LPI2C_TransferStateMachineSendCommand(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_state_machine_param_t *stateParams) -{ - assert(stateParams != NULL); - uint16_t sendval; - - /* Make sure there is room in the tx fifo for the next command. */ - if (0U == (stateParams->txCount)--) - { - stateParams->state_complete = true; - return; - } - - /* Issue command. buf is a uint8_t* pointing at the uint16 command array. */ - sendval = ((uint16_t)handle->buf[0]) | (((uint16_t)handle->buf[1]) << 8U); - base->MTDR = sendval; - handle->buf++; - handle->buf++; - - /* Count down until all commands are sent. */ - if (--handle->remainingBytes == 0U) - { - /* Choose next state and set up buffer pointer and count. */ - if (0U != handle->transfer.dataSize) - { - /* Either a send or receive transfer is next. */ - handle->state = (uint8_t)kTransferDataState; - handle->buf = (uint8_t *)handle->transfer.data; - handle->remainingBytes = (uint16_t)handle->transfer.dataSize; - if (handle->transfer.direction == kLPI2C_Read) - { - /* Disable TX interrupt */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterTxReadyFlag); - /* Issue command to receive data. A single write to MTDR can issue read operation of - 0xFFU + 1 byte of data at most, so when the dataSize is larger than 0x100U, push - multiple read commands to MTDR until dataSize is reached. */ - size_t tmpRxSize = handle->transfer.dataSize; - while (tmpRxSize != 0U) - { - LPI2C_MasterGetFifoCounts(base, NULL, &stateParams->txCount); - /* - * $Branch Coverage Justification$ - * The transmission commands will not exceed FIFO SIZE.(will improve) - */ - while ((size_t)FSL_FEATURE_LPI2C_FIFO_SIZEn(base) == stateParams->txCount) - { - LPI2C_MasterGetFifoCounts(base, NULL, &stateParams->txCount); - } - - if (tmpRxSize > 256U) - { - base->MTDR = (uint32_t)(kRxDataCmd) | (uint32_t)LPI2C_MTDR_DATA(0xFFU); - tmpRxSize -= 256U; - } - else - { - base->MTDR = (uint32_t)(kRxDataCmd) | (uint32_t)LPI2C_MTDR_DATA(tmpRxSize - 1U); - tmpRxSize = 0U; - } - } - } - } - else - { - /* No transfer, so move to stop state. */ - handle->state = (uint8_t)kStopState; - } - } -} - -static void LPI2C_TransferStateMachineReadCommand(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_state_machine_param_t *stateParams) -{ - assert(stateParams != NULL); - - /* Make sure there is room in the tx fifo for the read command. */ - if (0U == (stateParams->txCount)--) - { - stateParams->state_complete = true; - return; - } - - base->MTDR = (uint32_t)kRxDataCmd | LPI2C_MTDR_DATA(handle->transfer.dataSize - 1U); - - /* Move to transfer state. */ - handle->state = (uint8_t)kTransferDataState; - if (handle->transfer.direction == kLPI2C_Read) - { - /* Disable TX interrupt */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterTxReadyFlag); - } -} - -static void LPI2C_TransferStateMachineTransferData(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_state_machine_param_t *stateParams) -{ - assert(stateParams != NULL); - - if (handle->transfer.direction == kLPI2C_Write) - { - /* Make sure there is room in the tx fifo. */ - if (0U == stateParams->txCount--) - { - stateParams->state_complete = true; - return; - } - - /* Put byte to send in fifo. */ - base->MTDR = *(handle->buf)++; - } - else - { - /* XXX handle receive sizes > 256, use kIssueReadCommandState */ - /* Make sure there is data in the rx fifo. */ - if (0U == stateParams->rxCount--) - { - stateParams->state_complete = true; - return; - } - - /* Read byte from fifo. */ - *(handle->buf)++ = (uint8_t)(base->MRDR & LPI2C_MRDR_DATA_MASK); - } - - /* Move to stop when the transfer is done. */ - if (--handle->remainingBytes == 0U) - { - if (handle->transfer.direction == kLPI2C_Write) - { - stateParams->state_complete = true; - } - handle->state = (uint8_t)kStopState; - } -} - -static void LPI2C_TransferStateMachineStopState(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_state_machine_param_t *stateParams, - bool *isDone) -{ - assert(stateParams != NULL); - - /* Only issue a stop transition if the caller requested it. */ - if ((handle->transfer.flags & (uint32_t)kLPI2C_TransferNoStopFlag) == 0U) - { - /* Make sure there is room in the tx fifo for the stop command. */ - if (0U == (stateParams->txCount)--) - { - stateParams->state_complete = true; - return; - } - - base->MTDR = (uint32_t)kStopCmd; - } - else - { - /* If all data is read and no stop flag is required to send, we are done. */ - if (handle->transfer.direction == kLPI2C_Read) - { - *isDone = true; - } - stateParams->state_complete = true; - } - handle->state = (uint8_t)kWaitForCompletionState; -} - -static void LPI2C_TransferStateMachineWaitState(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_state_machine_param_t *stateParams, - bool *isDone) -{ - assert(stateParams != NULL); - - if ((handle->transfer.flags & (uint32_t)kLPI2C_TransferNoStopFlag) == 0U) - { - /* We stay in this state until the stop state is detected. */ - if (0U != ((stateParams->status) & (uint32_t)kLPI2C_MasterStopDetectFlag)) - { - *isDone = true; - } - } - else - { - /* If all data is pushed to FIFO and no stop flag is required to send, we need to make sure they - are all send out to bus. */ - if ((handle->transfer.direction == kLPI2C_Write) && ((base->MFSR & LPI2C_MFSR_TXCOUNT_MASK) == 0U)) - { - /* We stay in this state until the data is sent out to bus. */ - *isDone = true; - } - } - stateParams->state_complete = true; -} - -/*! - * @brief Execute states until FIFOs are exhausted. - * @param handle Master nonblocking driver handle. - * @param[out] isDone Set to true if the transfer has completed. - * @retval #kStatus_Success - * @retval #kStatus_LPI2C_PinLowTimeout - * @retval #kStatus_LPI2C_ArbitrationLost - * @retval #kStatus_LPI2C_Nak - * @retval #kStatus_LPI2C_FifoError - */ -static status_t LPI2C_RunTransferStateMachine(LPI2C_Type *base, lpi2c_master_handle_t *handle, bool *isDone) -{ - assert(NULL != base && NULL != handle && NULL != isDone); - - status_t result = kStatus_Success; - lpi2c_state_machine_param_t stateParams; - (void)memset(&stateParams, 0, sizeof(stateParams)); - - stateParams.state_complete = false; - - /* Set default isDone return value. */ - *isDone = false; - - /* Check for errors. */ - stateParams.status = LPI2C_MasterGetStatusFlags(base); - - /* Get fifo counts. */ - LPI2C_MasterGetFifoCounts(base, &stateParams.rxCount, &stateParams.txCount); - - /* For the last byte, nack flag is expected. - Do not check and clear kLPI2C_MasterNackDetectFlag for the last byte, - in case FIFO is emptied when stop command has not been sent. */ - if (handle->remainingBytes == 0U) - { - /* When data size is not zero which means it is not only one byte of address is sent, and */ - /* when the txfifo is empty, or have one byte which is the stop command, then the nack status can be ignored. */ - if (((handle->transfer).dataSize != 0U) && - ((stateParams.txCount == 0U) || - (((stateParams.txCount) == 1U) && (handle->state == (uint8_t)kWaitForCompletionState) && - (((handle->transfer).flags & (uint32_t)kLPI2C_TransferNoStopFlag) == 0U)))) - { - (stateParams.status) &= ~(uint32_t)kLPI2C_MasterNackDetectFlag; - } - } - - result = LPI2C_MasterCheckAndClearError(base, stateParams.status); - - if (kStatus_Success == result) - { - /* Compute room in tx fifo */ - stateParams.txCount = (size_t)FSL_FEATURE_LPI2C_FIFO_SIZEn(base) - stateParams.txCount; - - while (!stateParams.state_complete) - { - /* Execute the state. */ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpi2c_c_ref_1$ - */ - switch (handle->state) - { - case (uint8_t)kSendCommandState: - LPI2C_TransferStateMachineSendCommand(base, handle, &stateParams); - break; - - case (uint8_t)kIssueReadCommandState: - LPI2C_TransferStateMachineReadCommand(base, handle, &stateParams); - break; - - case (uint8_t)kTransferDataState: - LPI2C_TransferStateMachineTransferData(base, handle, &stateParams); - break; - - case (uint8_t)kStopState: - LPI2C_TransferStateMachineStopState(base, handle, &stateParams, isDone); - break; - - case (uint8_t)kWaitForCompletionState: - LPI2C_TransferStateMachineWaitState(base, handle, &stateParams, isDone); - break; - default: - assert(false); - break; - } - } - } - return result; -} - -/*! - * @brief Prepares the transfer state machine and fills in the command buffer. - * @param handle Master nonblocking driver handle. - */ -static void LPI2C_InitTransferStateMachine(lpi2c_master_handle_t *handle) -{ - lpi2c_master_transfer_t *xfer = &handle->transfer; - - /* Handle no start option. */ - if (0U != (xfer->flags & (uint32_t)kLPI2C_TransferNoStartFlag)) - { - if (xfer->direction == kLPI2C_Read) - { - /* Need to issue read command first. */ - handle->state = (uint8_t)kIssueReadCommandState; - } - else - { - /* Start immediately in the data transfer state. */ - handle->state = (uint8_t)kTransferDataState; - } - - handle->buf = (uint8_t *)xfer->data; - handle->remainingBytes = (uint16_t)xfer->dataSize; - } - else - { - uint16_t *cmd = (uint16_t *)&handle->commandBuffer; - uint32_t cmdCount = 0U; - - /* Initial direction depends on whether a subaddress was provided, and of course the actual */ - /* data transfer direction. */ - lpi2c_direction_t direction = (0U != xfer->subaddressSize) ? kLPI2C_Write : xfer->direction; - - /* Start command. */ - cmd[cmdCount++] = - (uint16_t)kStartCmd | (uint16_t)((uint16_t)((uint16_t)xfer->slaveAddress << 1U) | (uint16_t)direction); - - /* Subaddress, MSB first. */ - if (0U != xfer->subaddressSize) - { - uint32_t subaddressRemaining = xfer->subaddressSize; - while (0U != (subaddressRemaining--)) - { - uint8_t subaddressByte = (uint8_t)((xfer->subaddress >> (8U * subaddressRemaining)) & 0xffU); - cmd[cmdCount++] = subaddressByte; - } - } - - /* Reads need special handling. */ - if ((0U != xfer->dataSize) && (xfer->direction == kLPI2C_Read)) - { - /* Need to send repeated start if switching directions to read. */ - if (direction == kLPI2C_Write) - { - cmd[cmdCount++] = (uint16_t)kStartCmd | - (uint16_t)((uint16_t)((uint16_t)xfer->slaveAddress << 1U) | (uint16_t)kLPI2C_Read); - } - } - - /* Set up state machine for transferring the commands. */ - handle->state = (uint8_t)kSendCommandState; - handle->remainingBytes = (uint16_t)cmdCount; - handle->buf = (uint8_t *)&handle->commandBuffer; - } -} - -/*! - * brief Performs a non-blocking transaction on the I2C bus. - * - * param base The LPI2C peripheral base address. - * param handle Pointer to the LPI2C master driver handle. - * param transfer The pointer to the transfer descriptor. - * retval #kStatus_Success The transaction was started successfully. - * retval #kStatus_LPI2C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - */ -status_t LPI2C_MasterTransferNonBlocking(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_master_transfer_t *transfer) -{ - assert(NULL != handle); - assert(NULL != transfer); - assert(transfer->subaddressSize <= sizeof(transfer->subaddress)); - - status_t result; - - /* Check transfer data size in read operation. */ - if ((transfer->direction == kLPI2C_Read) && - (transfer->dataSize > (256U * (uint32_t)FSL_FEATURE_LPI2C_FIFO_SIZEn(base)))) - { - return kStatus_InvalidArgument; - } - - /* Return busy if another transaction is in progress. */ - if (handle->state != (uint8_t)kIdleState) - { - result = kStatus_LPI2C_Busy; - } - else - { - result = LPI2C_CheckForBusyBus(base); - } - - if ((status_t)kStatus_Success == result) - { - /* Enable the master function and disable the slave function. */ - LPI2C_MasterEnable(base, true); - LPI2C_SlaveEnable(base, false); - - /* Disable LPI2C IRQ sources while we configure stuff. */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - - /* Reset FIFO in case there are data. */ - base->MCR |= LPI2C_MCR_RRF_MASK | LPI2C_MCR_RTF_MASK; - - /* Save transfer into handle. */ - handle->transfer = *transfer; - - /* Generate commands to send. */ - LPI2C_InitTransferStateMachine(handle); - - /* Clear all flags. */ - LPI2C_MasterClearStatusFlags(base, (uint32_t)kLPI2C_MasterClearFlags); - - /* Turn off auto-stop option. */ - base->MCFGR1 &= ~LPI2C_MCFGR1_AUTOSTOP_MASK; - - /* Enable LPI2C internal IRQ sources. NVIC IRQ was enabled in CreateHandle() */ - LPI2C_MasterEnableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - } - - return result; -} - -/*! - * brief Returns number of bytes transferred so far. - * param base The LPI2C peripheral base address. - * param handle Pointer to the LPI2C master driver handle. - * param[out] count Number of bytes transferred so far by the non-blocking transaction. - * retval #kStatus_Success - * retval #kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t LPI2C_MasterTransferGetCount(LPI2C_Type *base, lpi2c_master_handle_t *handle, size_t *count) -{ - status_t result = kStatus_Success; - - assert(NULL != handle); - - if (NULL == count) - { - result = kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - else if (handle->state == (uint8_t)kIdleState) - { - *count = 0; - result = kStatus_NoTransferInProgress; - } - else - { - uint8_t state; - uint16_t remainingBytes; - uint32_t dataSize; - - /* Cache some fields with IRQs disabled. This ensures all field values */ - /* are synchronized with each other during an ongoing transfer. */ - uint32_t irqs = LPI2C_MasterGetEnabledInterrupts(base); - LPI2C_MasterDisableInterrupts(base, irqs); - state = handle->state; - remainingBytes = handle->remainingBytes; - dataSize = handle->transfer.dataSize; - LPI2C_MasterEnableInterrupts(base, irqs); - - /* Get transfer count based on current transfer state. */ - switch (state) - { - case (uint8_t)kIdleState: - case (uint8_t)kSendCommandState: - case (uint8_t) - kIssueReadCommandState: /* XXX return correct value for this state when >256 reads are supported */ - *count = 0; - break; - - case (uint8_t)kTransferDataState: - *count = dataSize - remainingBytes; - break; - - case (uint8_t)kStopState: - case (uint8_t)kWaitForCompletionState: - default: - *count = dataSize; - break; - } - } - - return result; -} - -/*! - * brief Terminates a non-blocking LPI2C master transmission early. - * - * note It is not safe to call this function from an IRQ handler that has a higher priority than the - * LPI2C peripheral's IRQ priority. - * - * param base The LPI2C peripheral base address. - * param handle Pointer to the LPI2C master driver handle. - */ -void LPI2C_MasterTransferAbort(LPI2C_Type *base, lpi2c_master_handle_t *handle) -{ - if (handle->state != (uint8_t)kIdleState) - { - /* Disable internal IRQ enables. */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - - /* Reset fifos. */ - base->MCR |= LPI2C_MCR_RRF_MASK | LPI2C_MCR_RTF_MASK; - - /* If master is still busy and has not send out stop signal yet. */ - if ((LPI2C_MasterGetStatusFlags(base) & ((uint32_t)kLPI2C_MasterStopDetectFlag | - (uint32_t)kLPI2C_MasterBusyFlag)) == (uint32_t)kLPI2C_MasterBusyFlag) - { - /* Send a stop command to finalize the transfer. */ - base->MTDR = (uint32_t)kStopCmd; - } - - /* Reset handle. */ - handle->state = (uint8_t)kIdleState; - } -} - -/*! - * brief Reusable routine to handle master interrupts. - * note This function does not need to be called unless you are reimplementing the - * nonblocking API's interrupt handler routines to add special functionality. - * param base The LPI2C peripheral base address. - * param lpi2cMasterHandle Pointer to the LPI2C master driver handle. - */ -void LPI2C_MasterTransferHandleIRQ(LPI2C_Type *base, void *lpi2cMasterHandle) -{ - assert(lpi2cMasterHandle != NULL); - - lpi2c_master_handle_t *handle = (lpi2c_master_handle_t *)lpi2cMasterHandle; - bool isDone = false; - status_t result; - - /* Don't do anything if we don't have a valid handle. */ - if (NULL != handle) - { - if (handle->state != (uint8_t)kIdleState) - { - result = LPI2C_RunTransferStateMachine(base, handle, &isDone); - - if ((result != kStatus_Success) || isDone) - { - /* Handle error, terminate xfer */ - if (result != kStatus_Success) - { - LPI2C_MasterTransferAbort(base, handle); - } - - /* Disable internal IRQ enables. */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - - /* Set handle to idle state. */ - handle->state = (uint8_t)kIdleState; - - /* Invoke callback. */ - if (NULL != handle->completionCallback) - { - handle->completionCallback(base, handle, result, handle->userData); - } - } - } - } -} - -/*! - * brief Provides a default configuration for the LPI2C slave peripheral. - * - * This function provides the following default configuration for the LPI2C slave peripheral: - * code - * slaveConfig->enableSlave = true; - * slaveConfig->address0 = 0U; - * slaveConfig->address1 = 0U; - * slaveConfig->addressMatchMode = kLPI2C_MatchAddress0; - * slaveConfig->filterDozeEnable = true; - * slaveConfig->filterEnable = true; - * slaveConfig->enableGeneralCall = false; - * slaveConfig->sclStall.enableAck = false; - * slaveConfig->sclStall.enableTx = true; - * slaveConfig->sclStall.enableRx = true; - * slaveConfig->sclStall.enableAddress = true; - * slaveConfig->ignoreAck = false; - * slaveConfig->enableReceivedAddressRead = false; - * slaveConfig->sdaGlitchFilterWidth_ns = 0; - * slaveConfig->sclGlitchFilterWidth_ns = 0; - * slaveConfig->dataValidDelay_ns = 0; - * slaveConfig->clockHoldTime_ns = 0; - * endcode - * - * After calling this function, override any settings to customize the configuration, - * prior to initializing the master driver with LPI2C_SlaveInit(). Be sure to override at least the a - * address0 member of the configuration structure with the desired slave address. - * - * param[out] slaveConfig User provided configuration structure that is set to default values. Refer to - * #lpi2c_slave_config_t. - */ -void LPI2C_SlaveGetDefaultConfig(lpi2c_slave_config_t *slaveConfig) -{ - /* Initializes the configure structure to zero. */ - (void)memset(slaveConfig, 0, sizeof(*slaveConfig)); - - slaveConfig->enableSlave = true; - slaveConfig->address0 = 0U; - slaveConfig->address1 = 0U; - slaveConfig->addressMatchMode = kLPI2C_MatchAddress0; - slaveConfig->filterDozeEnable = true; - slaveConfig->filterEnable = true; - slaveConfig->enableGeneralCall = false; - slaveConfig->sclStall.enableAck = false; - slaveConfig->sclStall.enableTx = true; - slaveConfig->sclStall.enableRx = true; - slaveConfig->sclStall.enableAddress = false; - slaveConfig->ignoreAck = false; - slaveConfig->enableReceivedAddressRead = false; - slaveConfig->sdaGlitchFilterWidth_ns = 0U; /* Set to 0 to disable the function */ - slaveConfig->sclGlitchFilterWidth_ns = 0U; /* Set to 0 to disable the function */ - slaveConfig->dataValidDelay_ns = 0U; - /* When enabling the slave tx SCL stall, set the default clock hold time to 250ns according - to I2C spec for standard mode baudrate(100k). User can manually change it to 100ns or 50ns - for fast-mode(400k) or fast-mode+(1m). */ - slaveConfig->clockHoldTime_ns = 250U; -} - -/*! - * brief Initializes the LPI2C slave peripheral. - * - * This function enables the peripheral clock and initializes the LPI2C slave peripheral as described by the user - * provided configuration. - * - * param base The LPI2C peripheral base address. - * param slaveConfig User provided peripheral configuration. Use LPI2C_SlaveGetDefaultConfig() to get a set of defaults - * that you can override. - * param sourceClock_Hz Frequency in Hertz of the LPI2C functional clock. Used to calculate the filter widths, - * data valid delay, and clock hold time. - */ -void LPI2C_SlaveInit(LPI2C_Type *base, const lpi2c_slave_config_t *slaveConfig, uint32_t sourceClock_Hz) -{ - uint32_t tmpReg; - uint32_t tmpCycle; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - - uint32_t instance = LPI2C_GetInstance(base); - - /* Ungate the clock. */ - (void)CLOCK_EnableClock(kLpi2cClocks[instance]); -#if defined(LPI2C_PERIPH_CLOCKS) - /* Ungate the functional clock in initialize function. */ - CLOCK_EnableClock(kLpi2cPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(LPI2C_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_lpi2cResets[LPI2C_GetInstance(base)]); -#endif - - /* Restore to reset conditions. */ - LPI2C_SlaveReset(base); - - /* Configure peripheral. */ - base->SAMR = LPI2C_SAMR_ADDR0(slaveConfig->address0) | LPI2C_SAMR_ADDR1(slaveConfig->address1); - - base->SCFGR1 = - LPI2C_SCFGR1_ADDRCFG(slaveConfig->addressMatchMode) | LPI2C_SCFGR1_IGNACK(slaveConfig->ignoreAck) | - LPI2C_SCFGR1_RXCFG(slaveConfig->enableReceivedAddressRead) | LPI2C_SCFGR1_GCEN(slaveConfig->enableGeneralCall) | - LPI2C_SCFGR1_ACKSTALL(slaveConfig->sclStall.enableAck) | LPI2C_SCFGR1_TXDSTALL(slaveConfig->sclStall.enableTx) | - LPI2C_SCFGR1_RXSTALL(slaveConfig->sclStall.enableRx) | - LPI2C_SCFGR1_ADRSTALL(slaveConfig->sclStall.enableAddress); - - /* Calculate SDA filter width. The width is equal to FILTSDA+3 cycles of functional clock. - And set FILTSDA to 0 disables the fileter, so the min value is 4. */ - tmpReg = LPI2C_SCFGR2_FILTSDA( - LPI2C_GetCyclesForWidth(sourceClock_Hz, slaveConfig->sdaGlitchFilterWidth_ns, 4U, - (LPI2C_SCFGR2_FILTSDA_MASK >> LPI2C_SCFGR2_FILTSDA_SHIFT) + 3U, 0U) - - 3U); - - /* Calculate SDL filter width. The width is equal to FILTSCL+3 cycles of functional clock. - And set FILTSCL to 0 disables the fileter, so the min value is 4. */ - tmpCycle = LPI2C_GetCyclesForWidth(sourceClock_Hz, slaveConfig->sclGlitchFilterWidth_ns, 4U, - (LPI2C_SCFGR2_FILTSCL_MASK >> LPI2C_SCFGR2_FILTSCL_SHIFT) + 3U, 0U); - tmpReg |= LPI2C_SCFGR2_FILTSCL(tmpCycle - 3U); - - /* Calculate data valid time. The time is equal to FILTSCL+DATAVD+3 cycles of functional clock. - So the min value is FILTSCL+3. */ - tmpReg |= LPI2C_SCFGR2_DATAVD( - LPI2C_GetCyclesForWidth(sourceClock_Hz, slaveConfig->dataValidDelay_ns, tmpCycle, - tmpCycle + (LPI2C_SCFGR2_DATAVD_MASK >> LPI2C_SCFGR2_DATAVD_SHIFT), 0U) - - tmpCycle); - - /* Calculate clock hold time. The time is equal to CLKHOLD+3 cycles of functional clock. - So the min value is 3. */ - base->SCFGR2 = - tmpReg | LPI2C_SCFGR2_CLKHOLD( - LPI2C_GetCyclesForWidth(sourceClock_Hz, slaveConfig->clockHoldTime_ns, 3U, - (LPI2C_SCFGR2_CLKHOLD_MASK >> LPI2C_SCFGR2_CLKHOLD_SHIFT) + 3U, 0U) - - 3U); - - /* Save SCR to last so we don't enable slave until it is configured */ - base->SCR = LPI2C_SCR_FILTDZ(!slaveConfig->filterDozeEnable) | LPI2C_SCR_FILTEN(slaveConfig->filterEnable) | - LPI2C_SCR_SEN(slaveConfig->enableSlave); -} - -/*! - * brief Deinitializes the LPI2C slave peripheral. - * - * This function disables the LPI2C slave peripheral and gates the clock. It also performs a software - * reset to restore the peripheral to reset conditions. - * - * param base The LPI2C peripheral base address. - */ -void LPI2C_SlaveDeinit(LPI2C_Type *base) -{ - LPI2C_SlaveReset(base); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - - uint32_t instance = LPI2C_GetInstance(base); - - /* Gate the clock. */ - (void)CLOCK_DisableClock(kLpi2cClocks[instance]); - -#if defined(LPI2C_PERIPH_CLOCKS) - /* Gate the functional clock. */ - CLOCK_DisableClock(kLpi2cPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * @brief Convert provided flags to status code, and clear any errors if present. - * @param base The LPI2C peripheral base address. - * @param status Current status flags value that will be checked. - * @retval #kStatus_Success - * @retval #kStatus_LPI2C_BitError - * @retval #kStatus_LPI2C_FifoError - */ -static status_t LPI2C_SlaveCheckAndClearError(LPI2C_Type *base, uint32_t flags) -{ - status_t result = kStatus_Success; - - flags &= (uint32_t)kLPI2C_SlaveErrorFlags; - if (0U != flags) - { - /* - * $Branch Coverage Justification$ - * It is hard to simulate bitError in automation test environment, need interference on bus.(will improve) - */ - if (0U != (flags & (uint32_t)kLPI2C_SlaveBitErrFlag)) - { - result = kStatus_LPI2C_BitError; - } - else if (0U != (flags & (uint32_t)kLPI2C_SlaveFifoErrFlag)) - { - result = kStatus_LPI2C_FifoError; - } - else - { - ; /* Intentional empty */ - } - - /* Clear the errors. */ - LPI2C_SlaveClearStatusFlags(base, flags); - } - else - { - ; /* Intentional empty */ - } - - return result; -} - -/*! - * brief Performs a polling send transfer on the I2C bus. - * - * param base The LPI2C peripheral base address. - * param txBuff The pointer to the data to be transferred. - * param txSize The length in bytes of the data to be transferred. - * param[out] actualTxSize - * return Error or success status returned by API. - */ -status_t LPI2C_SlaveSend(LPI2C_Type *base, void *txBuff, size_t txSize, size_t *actualTxSize) -{ - status_t result = kStatus_Success; - uint8_t *buf = (uint8_t *)txBuff; - size_t remaining = txSize; - - assert(NULL != txBuff); - -#if I2C_RETRY_TIMES != 0U - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - - /* Clear stop flag. */ - LPI2C_SlaveClearStatusFlags(base, - (uint32_t)kLPI2C_SlaveStopDetectFlag | (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag); - - while (0U != remaining) - { - uint32_t flags; - - /* Wait until we can transmit. */ - do - { - /* Check for errors */ - flags = LPI2C_SlaveGetStatusFlags(base); - result = LPI2C_SlaveCheckAndClearError(base, flags); - if (kStatus_Success != result) - { - if (NULL != actualTxSize) - { - *actualTxSize = txSize - remaining; - } - break; - } -#if I2C_RETRY_TIMES != 0U - waitTimes--; - } while ((0U == (flags & ((uint32_t)kLPI2C_SlaveTxReadyFlag | (uint32_t)kLPI2C_SlaveStopDetectFlag | - (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag))) && - (0U != waitTimes)); - if (0U == waitTimes) - { - result = kStatus_LPI2C_Timeout; - } -#else - } while (0U == (flags & ((uint32_t)kLPI2C_SlaveTxReadyFlag | (uint32_t)kLPI2C_SlaveStopDetectFlag | - (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag))); -#endif - - if (kStatus_Success != result) - { - break; - } - - /* Send a byte. */ - if (0U != (flags & (uint32_t)kLPI2C_SlaveTxReadyFlag)) - { - base->STDR = *buf++; - --remaining; - } - - /* Exit loop if we see a stop or restart in transfer*/ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpi2c_c_ref_3$ - */ - if ((0U != (flags & ((uint32_t)kLPI2C_SlaveStopDetectFlag | (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag))) && - (remaining != 0U)) - { - LPI2C_SlaveClearStatusFlags( - base, (uint32_t)kLPI2C_SlaveStopDetectFlag | (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag); - break; - } - } - - if (NULL != actualTxSize) - { - *actualTxSize = txSize - remaining; - } - - return result; -} - -/*! - * brief Performs a polling receive transfer on the I2C bus. - * - * param base The LPI2C peripheral base address. - * param rxBuff The pointer to the data to be transferred. - * param rxSize The length in bytes of the data to be transferred. - * param[out] actualRxSize - * return Error or success status returned by API. - */ -status_t LPI2C_SlaveReceive(LPI2C_Type *base, void *rxBuff, size_t rxSize, size_t *actualRxSize) -{ - status_t result = kStatus_Success; - uint8_t *buf = (uint8_t *)rxBuff; - size_t remaining = rxSize; - - assert(NULL != rxBuff); - -#if I2C_RETRY_TIMES != 0U - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - - /* Clear stop flag. */ - LPI2C_SlaveClearStatusFlags(base, - (uint32_t)kLPI2C_SlaveStopDetectFlag | (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag); - - while (0U != remaining) - { - uint32_t flags; - - /* Wait until we can receive. */ - do - { - /* Check for errors */ - flags = LPI2C_SlaveGetStatusFlags(base); - result = LPI2C_SlaveCheckAndClearError(base, flags); - if (kStatus_Success != result) - { - if (NULL != actualRxSize) - { - *actualRxSize = rxSize - remaining; - } - break; - } -#if I2C_RETRY_TIMES != 0U - waitTimes--; - } while ((0U == (flags & ((uint32_t)kLPI2C_SlaveRxReadyFlag | (uint32_t)kLPI2C_SlaveStopDetectFlag | - (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag))) && - (0U != waitTimes)); - if (0U == waitTimes) - { - result = kStatus_LPI2C_Timeout; - } -#else - } while (0U == (flags & ((uint32_t)kLPI2C_SlaveRxReadyFlag | (uint32_t)kLPI2C_SlaveStopDetectFlag | - (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag))); -#endif - - if ((status_t)kStatus_Success != result) - { - break; - } - - /* Receive a byte. */ - if (0U != (flags & (uint32_t)kLPI2C_SlaveRxReadyFlag)) - { - *buf++ = (uint8_t)(base->SRDR & LPI2C_SRDR_DATA_MASK); - --remaining; - } - - /* Exit loop if we see a stop or restart */ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpi2c_c_ref_3$ - */ - if ((0U != (flags & ((uint32_t)kLPI2C_SlaveStopDetectFlag | (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag))) && - (remaining != 0U)) - { - LPI2C_SlaveClearStatusFlags( - base, (uint32_t)kLPI2C_SlaveStopDetectFlag | (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag); - break; - } - } - - if (NULL != actualRxSize) - { - *actualRxSize = rxSize - remaining; - } - - return result; -} - -/*! - * brief Creates a new handle for the LPI2C slave non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the LPI2C_SlaveTransferAbort() API shall be called. - * - * note The function also enables the NVIC IRQ for the input LPI2C. Need to notice - * that on some SoCs the LPI2C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - - * param base The LPI2C peripheral base address. - * param[out] handle Pointer to the LPI2C slave driver handle. - * param callback User provided pointer to the asynchronous callback function. - * param userData User provided pointer to the application callback data. - */ -void LPI2C_SlaveTransferCreateHandle(LPI2C_Type *base, - lpi2c_slave_handle_t *handle, - lpi2c_slave_transfer_callback_t callback, - void *userData) -{ - uint32_t instance; - - assert(NULL != handle); - - /* Clear out the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Look up instance number */ - instance = LPI2C_GetInstance(base); - - /* Save base and instance. */ - handle->callback = callback; - handle->userData = userData; - - /* Save this handle for IRQ use. */ - s_lpi2cSlaveHandle[instance] = handle; - - /* Set irq handler. */ - s_lpi2cSlaveIsr = LPI2C_SlaveTransferHandleIRQ; - - /* Clear internal IRQ enables and enable NVIC IRQ. */ - LPI2C_SlaveDisableInterrupts(base, (uint32_t)kLPI2C_SlaveIrqFlags); - (void)EnableIRQ(kLpi2cIrqs[instance]); - - /* Nack by default. */ - base->STAR = LPI2C_STAR_TXNACK_MASK; -} - -/*! - * brief Starts accepting slave transfers. - * - * Call this API after calling I2C_SlaveInit() and LPI2C_SlaveTransferCreateHandle() to start processing - * transactions driven by an I2C master. The slave monitors the I2C bus and pass events to the - * callback that was passed into the call to LPI2C_SlaveTransferCreateHandle(). The callback is always invoked - * from the interrupt context. - * - * The set of events received by the callback is customizable. To do so, set the a eventMask parameter to - * the OR'd combination of #lpi2c_slave_transfer_event_t enumerators for the events you wish to receive. - * The #kLPI2C_SlaveTransmitEvent and #kLPI2C_SlaveReceiveEvent events are always enabled and do not need - * to be included in the mask. Alternatively, you can pass 0 to get a default set of only the transmit and - * receive events that are always enabled. In addition, the #kLPI2C_SlaveAllEvents constant is provided as - * a convenient way to enable all events. - * - * param base The LPI2C peripheral base address. - * param handle Pointer to #lpi2c_slave_handle_t structure which stores the transfer state. - * param eventMask Bit mask formed by OR'ing together #lpi2c_slave_transfer_event_t enumerators to specify - * which events to send to the callback. Other accepted values are 0 to get a default set of - * only the transmit and receive events, and #kLPI2C_SlaveAllEvents to enable all events. - * - * retval #kStatus_Success Slave transfers were successfully started. - * retval #kStatus_LPI2C_Busy Slave transfers have already been started on this handle. - */ -status_t LPI2C_SlaveTransferNonBlocking(LPI2C_Type *base, lpi2c_slave_handle_t *handle, uint32_t eventMask) -{ - status_t result = kStatus_Success; - - assert(NULL != handle); - - /* Return busy if another transaction is in progress. */ - if (handle->isBusy) - { - result = kStatus_LPI2C_Busy; - } - else - { - /* Enable the slave function and disable the master function. */ - LPI2C_MasterEnable(base, false); - LPI2C_SlaveEnable(base, true); - /* Return an error if the bus is already in use not by us. */ - uint32_t status = LPI2C_SlaveGetStatusFlags(base); - /* - * $Branch Coverage Justification$ - * $ref fsl_lpi2c_c_ref_2$ - */ - if ((0U != (status & (uint32_t)kLPI2C_SlaveBusBusyFlag)) && (0U == (status & (uint32_t)kLPI2C_SlaveBusyFlag))) - { - result = kStatus_LPI2C_Busy; - } - } - - if ((status_t)kStatus_Success == result) - { - /* Disable LPI2C IRQ sources while we configure stuff. */ - LPI2C_SlaveDisableInterrupts(base, (uint32_t)kLPI2C_SlaveIrqFlags); - - /* Clear transfer in handle. */ - (void)memset(&handle->transfer, 0, sizeof(handle->transfer)); - - /* Record that we're busy. */ - handle->isBusy = true; - - /* Set up event mask. tx and rx are always enabled. */ - handle->eventMask = eventMask | (uint32_t)kLPI2C_SlaveTransmitEvent | (uint32_t)kLPI2C_SlaveReceiveEvent; - - /* Ack by default. */ - base->STAR = 0U; - - /* Clear all flags. */ - LPI2C_SlaveClearStatusFlags(base, (uint32_t)kLPI2C_SlaveClearFlags); - - /* Enable LPI2C internal IRQ sources. NVIC IRQ was enabled in CreateHandle() */ - LPI2C_SlaveEnableInterrupts(base, (uint32_t)kLPI2C_SlaveIrqFlags); - } - - return result; -} - -/*! - * brief Gets the slave transfer status during a non-blocking transfer. - * param base The LPI2C peripheral base address. - * param handle Pointer to i2c_slave_handle_t structure. - * param[out] count Pointer to a value to hold the number of bytes transferred. May be NULL if the count is not - * required. - * retval #kStatus_Success - * retval #kStatus_NoTransferInProgress - */ -status_t LPI2C_SlaveTransferGetCount(LPI2C_Type *base, lpi2c_slave_handle_t *handle, size_t *count) -{ - status_t status = kStatus_Success; - - assert(NULL != handle); - - if (count == NULL) - { - status = kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - else if (!handle->isBusy) - { - *count = 0; - status = kStatus_NoTransferInProgress; - } - - /* For an active transfer, just return the count from the handle. */ - else - { - *count = handle->transferredCount; - } - - return status; -} - -/*! - * brief Aborts the slave non-blocking transfers. - * note This API could be called at any time to stop slave for handling the bus events. - * param base The LPI2C peripheral base address. - * param handle Pointer to #lpi2c_slave_handle_t structure which stores the transfer state. - */ -void LPI2C_SlaveTransferAbort(LPI2C_Type *base, lpi2c_slave_handle_t *handle) -{ - assert(NULL != handle); - - /* Return idle if no transaction is in progress. */ - if (handle->isBusy) - { - /* Disable LPI2C IRQ sources. */ - LPI2C_SlaveDisableInterrupts(base, (uint32_t)kLPI2C_SlaveIrqFlags); - - /* Nack by default. */ - base->STAR = LPI2C_STAR_TXNACK_MASK; - - /* Reset transfer info. */ - (void)memset(&handle->transfer, 0, sizeof(handle->transfer)); - - /* We're no longer busy. */ - handle->isBusy = false; - } -} - -/*! - * brief Reusable routine to handle slave interrupts. - * note This function does not need to be called unless you are reimplementing the - * non blocking API's interrupt handler routines to add special functionality. - * param base The LPI2C peripheral base address. - * param handle Pointer to #lpi2c_slave_handle_t structure which stores the transfer state. - */ -void LPI2C_SlaveTransferHandleIRQ(LPI2C_Type *base, lpi2c_slave_handle_t *handle) -{ - uint32_t flags; - lpi2c_slave_transfer_t *xfer; - - /* Check for a valid handle in case of a spurious interrupt. */ - if (NULL != handle) - { - xfer = &handle->transfer; - - /* Get status flags. */ - flags = LPI2C_SlaveGetStatusFlags(base); - - if (0U != (flags & ((uint32_t)kLPI2C_SlaveBitErrFlag | (uint32_t)kLPI2C_SlaveFifoErrFlag))) - { - xfer->event = kLPI2C_SlaveCompletionEvent; - xfer->completionStatus = LPI2C_SlaveCheckAndClearError(base, flags); - - if ((0U != (handle->eventMask & (uint32_t)kLPI2C_SlaveCompletionEvent)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - } - else - { - if (0U != - (flags & (((uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag) | ((uint32_t)kLPI2C_SlaveStopDetectFlag)))) - { - xfer->event = (0U != (flags & (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag)) ? - kLPI2C_SlaveRepeatedStartEvent : - kLPI2C_SlaveCompletionEvent; - xfer->receivedAddress = 0U; - xfer->completionStatus = kStatus_Success; - xfer->transferredCount = handle->transferredCount; - - if (xfer->event == kLPI2C_SlaveCompletionEvent) - { - handle->isBusy = false; - } - - if (handle->wasTransmit) - { - /* Subtract one from the transmit count to offset the fact that LPI2C asserts the */ - /* tx flag before it sees the nack from the master-receiver, thus causing one more */ - /* count that the master actually receives. */ - --xfer->transferredCount; - handle->wasTransmit = false; - } - - /* Clear the flag. */ - LPI2C_SlaveClearStatusFlags(base, flags & ((uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag | - (uint32_t)kLPI2C_SlaveStopDetectFlag)); - - /* Revert to sending an Ack by default, in case we sent a Nack for receive. */ - base->STAR = 0U; - - if ((0U != (handle->eventMask & (uint32_t)xfer->event)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - - if (0U != (flags & (uint32_t)kLPI2C_SlaveStopDetectFlag)) - { - /* Clean up transfer info on completion, after the callback has been invoked. */ - (void)memset(&handle->transfer, 0, sizeof(handle->transfer)); - } - } - if (0U != (flags & (uint32_t)kLPI2C_SlaveAddressValidFlag)) - { - xfer->event = kLPI2C_SlaveAddressMatchEvent; - xfer->receivedAddress = (uint8_t)(base->SASR & LPI2C_SASR_RADDR_MASK); - - /* Update handle status to busy because slave is addressed. */ - handle->isBusy = true; - if ((0U != (handle->eventMask & (uint32_t)kLPI2C_SlaveAddressMatchEvent)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - } - if (0U != (flags & (uint32_t)kLPI2C_SlaveTransmitAckFlag)) - { - xfer->event = kLPI2C_SlaveTransmitAckEvent; - - if ((0U != (handle->eventMask & (uint32_t)kLPI2C_SlaveTransmitAckEvent)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - } - - /* Handle transmit and receive. */ - if (0U != (flags & (uint32_t)kLPI2C_SlaveTxReadyFlag)) - { - handle->wasTransmit = true; - - /* If we're out of data, invoke callback to get more. */ - if ((NULL == xfer->data) || (0U == xfer->dataSize)) - { - xfer->event = kLPI2C_SlaveTransmitEvent; - if (NULL != handle->callback) - { - handle->callback(base, xfer, handle->userData); - } - - /* Clear the transferred count now that we have a new buffer. */ - handle->transferredCount = 0U; - } - - /* Transmit a byte. */ - if ((NULL != xfer->data) && (0U != xfer->dataSize)) - { - base->STDR = *xfer->data++; - --xfer->dataSize; - ++handle->transferredCount; - } - } - if (0U != (flags & (uint32_t)kLPI2C_SlaveRxReadyFlag)) - { - /* If we're out of room in the buffer, invoke callback to get another. */ - if ((NULL == xfer->data) || (0U == xfer->dataSize)) - { - xfer->event = kLPI2C_SlaveReceiveEvent; - if (NULL != handle->callback) - { - handle->callback(base, xfer, handle->userData); - } - - /* Clear the transferred count now that we have a new buffer. */ - handle->transferredCount = 0U; - } - - /* Receive a byte. */ - if ((NULL != xfer->data) && (0U != xfer->dataSize)) - { - *xfer->data++ = (uint8_t)base->SRDR; - --xfer->dataSize; - ++handle->transferredCount; - } - else - { - /* We don't have any room to receive more data, so send a nack. */ - base->STAR = LPI2C_STAR_TXNACK_MASK; - } - } - } - } -} - -#if !(defined(FSL_FEATURE_I2C_HAS_NO_IRQ) && FSL_FEATURE_I2C_HAS_NO_IRQ) -/*! - * @brief Shared IRQ handler that can call both master and slave ISRs. - * - * The master and slave ISRs are called through function pointers in order to decouple - * this code from the ISR functions. Without this, the linker would always pull in both - * ISRs and every function they call, even if only the functional API was used. - * - * @param base The LPI2C peripheral base address. - * @param instance The LPI2C peripheral instance number. - */ -static void LPI2C_CommonIRQHandler(LPI2C_Type *base, uint32_t instance) -{ - /* Check for master IRQ. */ - if ((0U != (base->MCR & LPI2C_MCR_MEN_MASK)) && (NULL != s_lpi2cMasterIsr)) - { - /* Master mode. */ - s_lpi2cMasterIsr(base, s_lpi2cMasterHandle[instance]); - } - - /* Check for slave IRQ. */ - if ((0U != (base->SCR & LPI2C_SCR_SEN_MASK)) && (NULL != s_lpi2cSlaveIsr)) - { - /* Slave mode. */ - s_lpi2cSlaveIsr(base, s_lpi2cSlaveHandle[instance]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(LPI2C0) -/* Implementation of LPI2C0 handler named in startup code. */ -void LPI2C0_DriverIRQHandler(void); -void LPI2C0_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(LPI2C0, 0U); -} -#endif - -#if defined(LPI2C1) -/* Implementation of LPI2C1 handler named in startup code. */ -void LPI2C1_DriverIRQHandler(void); -void LPI2C1_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(LPI2C1, 1U); -} -#endif - -#if defined(LPI2C2) -/* Implementation of LPI2C2 handler named in startup code. */ -void LPI2C2_DriverIRQHandler(void); -void LPI2C2_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(LPI2C2, 2U); -} -#endif - -#if defined(LPI2C3) -/* Implementation of LPI2C3 handler named in startup code. */ -void LPI2C3_DriverIRQHandler(void); -void LPI2C3_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(LPI2C3, 3U); -} -#endif - -#if defined(LPI2C4) -/* Implementation of LPI2C4 handler named in startup code. */ -void LPI2C4_DriverIRQHandler(void); -void LPI2C4_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(LPI2C4, 4U); -} -#endif - -#if defined(LPI2C5) -/* Implementation of LPI2C5 handler named in startup code. */ -void LPI2C5_DriverIRQHandler(void); -void LPI2C5_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(LPI2C5, 5U); -} -#endif - -#if defined(LPI2C6) -/* Implementation of LPI2C6 handler named in startup code. */ -void LPI2C6_DriverIRQHandler(void); -void LPI2C6_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(LPI2C6, 6U); -} -#endif - -#if defined(LPI2C7) -/* Implementation of LPI2C7 handler named in startup code. */ -void LPI2C7_DriverIRQHandler(void); -void LPI2C7_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(LPI2C7, 7U); -} -#endif - -#if defined(LPI2C8) -/* Implementation of LPI2C8 handler named in startup code. */ -void LPI2C8_DriverIRQHandler(void); -void LPI2C8_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(LPI2C8, 8U); -} -#endif - -#if defined(CM4_0__LPI2C) -/* Implementation of CM4_0__LPI2C handler named in startup code. */ -void M4_0_LPI2C_DriverIRQHandler(void); -void M4_0_LPI2C_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(CM4_0__LPI2C, LPI2C_GetInstance(CM4_0__LPI2C)); -} -#endif - -#if defined(CM4__LPI2C) -/* Implementation of CM4__LPI2C handler named in startup code. */ -void M4_LPI2C_DriverIRQHandler(void); -void M4_LPI2C_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(CM4__LPI2C, LPI2C_GetInstance(CM4__LPI2C)); -} -#endif - -#if defined(CM4_1__LPI2C) -/* Implementation of CM4_1__LPI2C handler named in startup code. */ -void M4_1_LPI2C_DriverIRQHandler(void); -void M4_1_LPI2C_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(CM4_1__LPI2C, LPI2C_GetInstance(CM4_1__LPI2C)); -} -#endif - -#if defined(DMA__LPI2C0) -/* Implementation of DMA__LPI2C0 handler named in startup code. */ -void DMA_I2C0_INT_DriverIRQHandler(void); -void DMA_I2C0_INT_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(DMA__LPI2C0, LPI2C_GetInstance(DMA__LPI2C0)); -} -#endif - -#if defined(DMA__LPI2C1) -/* Implementation of DMA__LPI2C1 handler named in startup code. */ -void DMA_I2C1_INT_DriverIRQHandler(void); -void DMA_I2C1_INT_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(DMA__LPI2C1, LPI2C_GetInstance(DMA__LPI2C1)); -} -#endif - -#if defined(DMA__LPI2C2) -/* Implementation of DMA__LPI2C2 handler named in startup code. */ -void DMA_I2C2_INT_DriverIRQHandler(void); -void DMA_I2C2_INT_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(DMA__LPI2C2, LPI2C_GetInstance(DMA__LPI2C2)); -} -#endif - -#if defined(DMA__LPI2C3) -/* Implementation of DMA__LPI2C3 handler named in startup code. */ -void DMA_I2C3_INT_DriverIRQHandler(void); -void DMA_I2C3_INT_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(DMA__LPI2C3, LPI2C_GetInstance(DMA__LPI2C3)); -} -#endif - -#if defined(DMA__LPI2C4) -/* Implementation of DMA__LPI2C3 handler named in startup code. */ -void DMA_I2C4_INT_DriverIRQHandler(void); -void DMA_I2C4_INT_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(DMA__LPI2C4, LPI2C_GetInstance(DMA__LPI2C4)); -} -#endif - -#if defined(ADMA__LPI2C0) -/* Implementation of DMA__LPI2C0 handler named in startup code. */ -void ADMA_I2C0_INT_DriverIRQHandler(void); -void ADMA_I2C0_INT_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(ADMA__LPI2C0, LPI2C_GetInstance(ADMA__LPI2C0)); -} -#endif - -#if defined(ADMA__LPI2C1) -/* Implementation of DMA__LPI2C1 handler named in startup code. */ -void ADMA_I2C1_INT_DriverIRQHandler(void); -void ADMA_I2C1_INT_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(ADMA__LPI2C1, LPI2C_GetInstance(ADMA__LPI2C1)); -} -#endif - -#if defined(ADMA__LPI2C2) -/* Implementation of DMA__LPI2C2 handler named in startup code. */ -void ADMA_I2C2_INT_DriverIRQHandler(void); -void ADMA_I2C2_INT_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(ADMA__LPI2C2, LPI2C_GetInstance(ADMA__LPI2C2)); -} -#endif - -#if defined(ADMA__LPI2C3) -/* Implementation of DMA__LPI2C3 handler named in startup code. */ -void ADMA_I2C3_INT_DriverIRQHandler(void); -void ADMA_I2C3_INT_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(ADMA__LPI2C3, LPI2C_GetInstance(ADMA__LPI2C3)); -} -#endif - -#if defined(ADMA__LPI2C4) -/* Implementation of DMA__LPI2C3 handler named in startup code. */ -void ADMA_I2C4_INT_DriverIRQHandler(void); -void ADMA_I2C4_INT_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(ADMA__LPI2C4, LPI2C_GetInstance(ADMA__LPI2C4)); -} -#endif diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpi2c.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpi2c.h deleted file mode 100644 index 390bcc5a743..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpi2c.h +++ /dev/null @@ -1,1389 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LPI2C_H_ -#define FSL_LPI2C_H_ - -#include -#include "fsl_device_registers.h" -#include "fsl_common.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @addtogroup lpi2c - * @{ - */ - -/*! - * @name Driver version - * @{ - */ -/*! @brief LPI2C driver version. */ -#define FSL_LPI2C_DRIVER_VERSION (MAKE_VERSION(2, 5, 4)) -/*! @} */ - -/*! @brief Retry times for waiting flag. */ -#ifndef I2C_RETRY_TIMES -#define I2C_RETRY_TIMES 0U /* Define to zero means keep waiting until the flag is assert/deassert. */ -#endif - -/*! @brief LPI2C status return codes. */ -enum -{ - kStatus_LPI2C_Busy = MAKE_STATUS(kStatusGroup_LPI2C, 0), /*!< The master is already performing a transfer. */ - kStatus_LPI2C_Idle = MAKE_STATUS(kStatusGroup_LPI2C, 1), /*!< The slave driver is idle. */ - kStatus_LPI2C_Nak = MAKE_STATUS(kStatusGroup_LPI2C, 2), /*!< The slave device sent a NAK in response to a byte. */ - kStatus_LPI2C_FifoError = MAKE_STATUS(kStatusGroup_LPI2C, 3), /*!< FIFO under run or overrun. */ - kStatus_LPI2C_BitError = MAKE_STATUS(kStatusGroup_LPI2C, 4), /*!< Transferred bit was not seen on the bus. */ - kStatus_LPI2C_ArbitrationLost = MAKE_STATUS(kStatusGroup_LPI2C, 5), /*!< Arbitration lost error. */ - kStatus_LPI2C_PinLowTimeout = - MAKE_STATUS(kStatusGroup_LPI2C, 6), /*!< SCL or SDA were held low longer than the timeout. */ - kStatus_LPI2C_NoTransferInProgress = - MAKE_STATUS(kStatusGroup_LPI2C, 7), /*!< Attempt to abort a transfer when one is not in progress. */ - kStatus_LPI2C_DmaRequestFail = MAKE_STATUS(kStatusGroup_LPI2C, 8), /*!< DMA request failed. */ - kStatus_LPI2C_Timeout = MAKE_STATUS(kStatusGroup_LPI2C, 9), /*!< Timeout polling status flags. */ -}; - -/*! - * @addtogroup lpi2c_master_driver - * @{ - */ - -/*! - * @brief LPI2C master peripheral flags. - * - * The following status register flags can be cleared: - * - #kLPI2C_MasterEndOfPacketFlag - * - #kLPI2C_MasterStopDetectFlag - * - #kLPI2C_MasterNackDetectFlag - * - #kLPI2C_MasterArbitrationLostFlag - * - #kLPI2C_MasterFifoErrFlag - * - #kLPI2C_MasterPinLowTimeoutFlag - * - #kLPI2C_MasterDataMatchFlag - * - * All flags except #kLPI2C_MasterBusyFlag and #kLPI2C_MasterBusBusyFlag can be enabled as - * interrupts. - * - * @note These enums are meant to be OR'd together to form a bit mask. - */ -enum _lpi2c_master_flags -{ - kLPI2C_MasterTxReadyFlag = LPI2C_MSR_TDF_MASK, /*!< Transmit data flag */ - kLPI2C_MasterRxReadyFlag = LPI2C_MSR_RDF_MASK, /*!< Receive data flag */ - kLPI2C_MasterEndOfPacketFlag = LPI2C_MSR_EPF_MASK, /*!< End Packet flag */ - kLPI2C_MasterStopDetectFlag = LPI2C_MSR_SDF_MASK, /*!< Stop detect flag */ - kLPI2C_MasterNackDetectFlag = LPI2C_MSR_NDF_MASK, /*!< NACK detect flag */ - kLPI2C_MasterArbitrationLostFlag = LPI2C_MSR_ALF_MASK, /*!< Arbitration lost flag */ - kLPI2C_MasterFifoErrFlag = LPI2C_MSR_FEF_MASK, /*!< FIFO error flag */ - kLPI2C_MasterPinLowTimeoutFlag = LPI2C_MSR_PLTF_MASK, /*!< Pin low timeout flag */ - kLPI2C_MasterDataMatchFlag = LPI2C_MSR_DMF_MASK, /*!< Data match flag */ - kLPI2C_MasterBusyFlag = LPI2C_MSR_MBF_MASK, /*!< Master busy flag */ - kLPI2C_MasterBusBusyFlag = LPI2C_MSR_BBF_MASK, /*!< Bus busy flag */ - - /*! All flags which are cleared by the driver upon starting a transfer. */ - kLPI2C_MasterClearFlags = kLPI2C_MasterEndOfPacketFlag | kLPI2C_MasterStopDetectFlag | kLPI2C_MasterNackDetectFlag | - kLPI2C_MasterArbitrationLostFlag | kLPI2C_MasterFifoErrFlag | - kLPI2C_MasterPinLowTimeoutFlag | kLPI2C_MasterDataMatchFlag, - /*! IRQ sources enabled by the non-blocking transactional API. */ - kLPI2C_MasterIrqFlags = kLPI2C_MasterArbitrationLostFlag | kLPI2C_MasterTxReadyFlag | kLPI2C_MasterRxReadyFlag | - kLPI2C_MasterStopDetectFlag | kLPI2C_MasterNackDetectFlag | kLPI2C_MasterPinLowTimeoutFlag | - kLPI2C_MasterFifoErrFlag, - /*! Errors to check for. */ - kLPI2C_MasterErrorFlags = kLPI2C_MasterNackDetectFlag | kLPI2C_MasterArbitrationLostFlag | - kLPI2C_MasterFifoErrFlag | kLPI2C_MasterPinLowTimeoutFlag -}; - -/*! @brief Direction of master and slave transfers. */ -typedef enum _lpi2c_direction -{ - kLPI2C_Write = 0U, /*!< Master transmit. */ - kLPI2C_Read = 1U /*!< Master receive. */ -} lpi2c_direction_t; - -/*! @brief LPI2C pin configuration. */ -typedef enum _lpi2c_master_pin_config -{ - kLPI2C_2PinOpenDrain = 0x0U, /*!< LPI2C Configured for 2-pin open drain mode */ - kLPI2C_2PinOutputOnly = 0x1U, /*!< LPI2C Configured for 2-pin output only mode (ultra-fast mode) */ - kLPI2C_2PinPushPull = 0x2U, /*!< LPI2C Configured for 2-pin push-pull mode */ - kLPI2C_4PinPushPull = 0x3U, /*!< LPI2C Configured for 4-pin push-pull mode */ - kLPI2C_2PinOpenDrainWithSeparateSlave = - 0x4U, /*!< LPI2C Configured for 2-pin open drain mode with separate LPI2C slave */ - kLPI2C_2PinOutputOnlyWithSeparateSlave = - 0x5U, /*!< LPI2C Configured for 2-pin output only mode(ultra-fast mode) with separate LPI2C slave */ - kLPI2C_2PinPushPullWithSeparateSlave = - 0x6U, /*!< LPI2C Configured for 2-pin push-pull mode with separate LPI2C slave */ - kLPI2C_4PinPushPullWithInvertedOutput = 0x7U /*!< LPI2C Configured for 4-pin push-pull mode(inverted outputs) */ -} lpi2c_master_pin_config_t; - -/*! @brief LPI2C master host request selection. */ -typedef enum _lpi2c_host_request_source -{ - kLPI2C_HostRequestExternalPin = 0x0U, /*!< Select the LPI2C_HREQ pin as the host request input */ - kLPI2C_HostRequestInputTrigger = 0x1U, /*!< Select the input trigger as the host request input */ -} lpi2c_host_request_source_t; - -/*! @brief LPI2C master host request pin polarity configuration. */ -typedef enum _lpi2c_host_request_polarity -{ - kLPI2C_HostRequestPinActiveLow = 0x0U, /*!< Configure the LPI2C_HREQ pin active low */ - kLPI2C_HostRequestPinActiveHigh = 0x1U /*!< Configure the LPI2C_HREQ pin active high */ -} lpi2c_host_request_polarity_t; - -/*! - * @brief Structure with settings to initialize the LPI2C master module. - * - * This structure holds configuration settings for the LPI2C peripheral. To initialize this - * structure to reasonable defaults, call the LPI2C_MasterGetDefaultConfig() function and - * pass a pointer to your configuration structure instance. - * - * The configuration structure can be made constant so it resides in flash. - */ -typedef struct _lpi2c_master_config -{ - bool enableMaster; /*!< Whether to enable master mode. */ - bool enableDoze; /*!< Whether master is enabled in doze mode. */ - bool debugEnable; /*!< Enable transfers to continue when halted in debug mode. */ - bool ignoreAck; /*!< Whether to ignore ACK/NACK. */ - lpi2c_master_pin_config_t pinConfig; /*!< The pin configuration option. */ - uint32_t baudRate_Hz; /*!< Desired baud rate in Hertz. */ - uint32_t busIdleTimeout_ns; /*!< Bus idle timeout in nanoseconds. Set to 0 to disable. */ - uint32_t pinLowTimeout_ns; /*!< Pin low timeout in nanoseconds. Set to 0 to disable. */ - uint8_t sdaGlitchFilterWidth_ns; /*!< Width in nanoseconds of glitch filter on SDA pin. Set to 0 to disable. */ - uint8_t sclGlitchFilterWidth_ns; /*!< Width in nanoseconds of glitch filter on SCL pin. Set to 0 to disable. */ - struct - { - bool enable; /*!< Enable host request. */ - lpi2c_host_request_source_t source; /*!< Host request source. */ - lpi2c_host_request_polarity_t polarity; /*!< Host request pin polarity. */ - } hostRequest; /*!< Host request options. */ -} lpi2c_master_config_t; - -/*! @brief LPI2C master data match configuration modes. */ -typedef enum _lpi2c_data_match_config_mode -{ - kLPI2C_MatchDisabled = 0x0U, /*!< LPI2C Match Disabled */ - kLPI2C_1stWordEqualsM0OrM1 = 0x2U, /*!< LPI2C Match Enabled and 1st data word equals MATCH0 OR MATCH1 */ - kLPI2C_AnyWordEqualsM0OrM1 = 0x3U, /*!< LPI2C Match Enabled and any data word equals MATCH0 OR MATCH1 */ - kLPI2C_1stWordEqualsM0And2ndWordEqualsM1 = - 0x4U, /*!< LPI2C Match Enabled and 1st data word equals MATCH0, 2nd data equals MATCH1 */ - kLPI2C_AnyWordEqualsM0AndNextWordEqualsM1 = - 0x5U, /*!< LPI2C Match Enabled and any data word equals MATCH0, next data equals MATCH1 */ - kLPI2C_1stWordAndM1EqualsM0AndM1 = - 0x6U, /*!< LPI2C Match Enabled and 1st data word and MATCH0 equals MATCH0 and MATCH1 */ - kLPI2C_AnyWordAndM1EqualsM0AndM1 = - 0x7U /*!< LPI2C Match Enabled and any data word and MATCH0 equals MATCH0 and MATCH1 */ -} lpi2c_data_match_config_mode_t; - -/*! @brief LPI2C master data match configuration structure. */ -typedef struct _lpi2c_match_config -{ - lpi2c_data_match_config_mode_t matchMode; /*!< Data match configuration setting. */ - bool rxDataMatchOnly; /*!< When set to true, received data is ignored until a successful match. */ - uint32_t match0; /*!< Match value 0. */ - uint32_t match1; /*!< Match value 1. */ -} lpi2c_data_match_config_t; - -/* Forward declaration of the transfer descriptor and handle typedefs. */ -/*! @brief LPI2C master descriptor of the transfer. */ -typedef struct _lpi2c_master_transfer lpi2c_master_transfer_t; -/*! @brief LPI2C master handle of the transfer. */ -typedef struct _lpi2c_master_handle lpi2c_master_handle_t; - -/*! - * @brief Master completion callback function pointer type. - * - * This callback is used only for the non-blocking master transfer API. Specify the callback you wish to use - * in the call to LPI2C_MasterTransferCreateHandle(). - * - * @param base The LPI2C peripheral base address. - * @param handle Pointer to the LPI2C master driver handle. - * @param completionStatus Either kStatus_Success or an error code describing how the transfer completed. - * @param userData Arbitrary pointer-sized value passed from the application. - */ -typedef void (*lpi2c_master_transfer_callback_t)(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - status_t completionStatus, - void *userData); - -/*! - * @brief Transfer option flags. - * - * @note These enumerations are intended to be OR'd together to form a bit mask of options for - * the #_lpi2c_master_transfer::flags field. - */ -enum _lpi2c_master_transfer_flags -{ - kLPI2C_TransferDefaultFlag = 0x00U, /*!< Transfer starts with a start signal, stops with a stop signal. */ - kLPI2C_TransferNoStartFlag = 0x01U, /*!< Don't send a start condition, address, and sub address */ - kLPI2C_TransferRepeatedStartFlag = 0x02U, /*!< Send a repeated start condition */ - kLPI2C_TransferNoStopFlag = 0x04U, /*!< Don't send a stop condition. */ -}; - -/*! - * @brief Non-blocking transfer descriptor structure. - * - * This structure is used to pass transaction parameters to the LPI2C_MasterTransferNonBlocking() API. - */ -struct _lpi2c_master_transfer -{ - uint32_t flags; /*!< Bit mask of options for the transfer. See enumeration #_lpi2c_master_transfer_flags for - available options. Set to 0 or #kLPI2C_TransferDefaultFlag for normal transfers. */ - uint16_t slaveAddress; /*!< The 7-bit slave address. */ - lpi2c_direction_t direction; /*!< Either #kLPI2C_Read or #kLPI2C_Write. */ - uint32_t subaddress; /*!< Sub address. Transferred MSB first. */ - size_t subaddressSize; /*!< Length of sub address to send in bytes. Maximum size is 4 bytes. */ - void *data; /*!< Pointer to data to transfer. */ - size_t dataSize; /*!< Number of bytes to transfer. */ -}; - -/*! - * @brief Driver handle for master non-blocking APIs. - * @note The contents of this structure are private and subject to change. - */ -struct _lpi2c_master_handle -{ - uint8_t state; /*!< Transfer state machine current state. */ - uint16_t remainingBytes; /*!< Remaining byte count in current state. */ - uint8_t *buf; /*!< Buffer pointer for current state. */ - uint16_t commandBuffer[6]; /*!< LPI2C command sequence. When all 6 command words are used: - Start&addr&write[1 word] + subaddr[4 words] + restart&addr&read[1 word] */ - lpi2c_master_transfer_t transfer; /*!< Copy of the current transfer info. */ - lpi2c_master_transfer_callback_t completionCallback; /*!< Callback function pointer. */ - void *userData; /*!< Application data passed to callback. */ -}; - -/*! @brief Typedef for master interrupt handler, used internally for LPI2C master interrupt and EDMA transactional APIs. - */ -typedef void (*lpi2c_master_isr_t)(LPI2C_Type *base, void *handle); - -/*! @} */ - -/*! - * @addtogroup lpi2c_slave_driver - * @{ - */ - -/*! - * @brief LPI2C slave peripheral flags. - * - * The following status register flags can be cleared: - * - #kLPI2C_SlaveRepeatedStartDetectFlag - * - #kLPI2C_SlaveStopDetectFlag - * - #kLPI2C_SlaveBitErrFlag - * - #kLPI2C_SlaveFifoErrFlag - * - * All flags except #kLPI2C_SlaveBusyFlag and #kLPI2C_SlaveBusBusyFlag can be enabled as - * interrupts. - * - * @note These enumerations are meant to be OR'd together to form a bit mask. - */ -enum _lpi2c_slave_flags -{ - kLPI2C_SlaveTxReadyFlag = LPI2C_SSR_TDF_MASK, /*!< Transmit data flag */ - kLPI2C_SlaveRxReadyFlag = LPI2C_SSR_RDF_MASK, /*!< Receive data flag */ - kLPI2C_SlaveAddressValidFlag = LPI2C_SSR_AVF_MASK, /*!< Address valid flag */ - kLPI2C_SlaveTransmitAckFlag = LPI2C_SSR_TAF_MASK, /*!< Transmit ACK flag */ - kLPI2C_SlaveRepeatedStartDetectFlag = LPI2C_SSR_RSF_MASK, /*!< Repeated start detect flag */ - kLPI2C_SlaveStopDetectFlag = LPI2C_SSR_SDF_MASK, /*!< Stop detect flag */ - kLPI2C_SlaveBitErrFlag = LPI2C_SSR_BEF_MASK, /*!< Bit error flag */ - kLPI2C_SlaveFifoErrFlag = LPI2C_SSR_FEF_MASK, /*!< FIFO error flag */ - kLPI2C_SlaveAddressMatch0Flag = LPI2C_SSR_AM0F_MASK, /*!< Address match 0 flag */ - kLPI2C_SlaveAddressMatch1Flag = LPI2C_SSR_AM1F_MASK, /*!< Address match 1 flag */ - kLPI2C_SlaveGeneralCallFlag = LPI2C_SSR_GCF_MASK, /*!< General call flag */ - kLPI2C_SlaveBusyFlag = LPI2C_SSR_SBF_MASK, /*!< Master busy flag */ - kLPI2C_SlaveBusBusyFlag = LPI2C_SSR_BBF_MASK, /*!< Bus busy flag */ - /*! All flags which are cleared by the driver upon starting a transfer. */ - kLPI2C_SlaveClearFlags = kLPI2C_SlaveRepeatedStartDetectFlag | kLPI2C_SlaveStopDetectFlag | kLPI2C_SlaveBitErrFlag | - kLPI2C_SlaveFifoErrFlag, - /*! IRQ sources enabled by the non-blocking transactional API. */ - kLPI2C_SlaveIrqFlags = kLPI2C_SlaveTxReadyFlag | kLPI2C_SlaveRxReadyFlag | kLPI2C_SlaveStopDetectFlag | - kLPI2C_SlaveRepeatedStartDetectFlag | kLPI2C_SlaveFifoErrFlag | kLPI2C_SlaveBitErrFlag | - kLPI2C_SlaveTransmitAckFlag | kLPI2C_SlaveAddressValidFlag, - /*! Errors to check for. */ - kLPI2C_SlaveErrorFlags = kLPI2C_SlaveFifoErrFlag | kLPI2C_SlaveBitErrFlag -}; - -/*! @brief LPI2C slave address match options. */ -typedef enum _lpi2c_slave_address_match -{ - kLPI2C_MatchAddress0 = 0U, /*!< Match only address 0. */ - kLPI2C_MatchAddress0OrAddress1 = 2U, /*!< Match either address 0 or address 1. */ - kLPI2C_MatchAddress0ThroughAddress1 = 6U, /*!< Match a range of slave addresses from address 0 through address 1. */ -} lpi2c_slave_address_match_t; - -/*! - * @brief Structure with settings to initialize the LPI2C slave module. - * - * This structure holds configuration settings for the LPI2C slave peripheral. To initialize this - * structure to reasonable defaults, call the LPI2C_SlaveGetDefaultConfig() function and - * pass a pointer to your configuration structure instance. - * - * The configuration structure can be made constant so it resides in flash. - */ -typedef struct _lpi2c_slave_config -{ - bool enableSlave; /*!< Enable slave mode. */ - uint8_t address0; /*!< Slave's 7-bit address. */ - uint8_t address1; /*!< Alternate slave 7-bit address. */ - lpi2c_slave_address_match_t addressMatchMode; /*!< Address matching options. */ - bool filterDozeEnable; /*!< Enable digital glitch filter in doze mode. */ - bool filterEnable; /*!< Enable digital glitch filter. */ - bool enableGeneralCall; /*!< Enable general call address matching. */ - struct - { - bool enableAck; /*!< Enables SCL clock stretching during slave-transmit address byte(s) - and slave-receiver address and data byte(s) to allow software to - write the Transmit ACK Register before the ACK or NACK is transmitted. - Clock stretching occurs when transmitting the 9th bit. When - enableAckSCLStall is enabled, there is no need to set either - enableRxDataSCLStall or enableAddressSCLStall. */ - bool enableTx; /*!< Enables SCL clock stretching when the transmit data flag is set - during a slave-transmit transfer. */ - bool enableRx; /*!< Enables SCL clock stretching when receive data flag is set during - a slave-receive transfer. */ - bool enableAddress; /*!< Enables SCL clock stretching when the address valid flag is asserted. */ - } sclStall; /*!< SCL stall enable options. */ - bool ignoreAck; /*!< Continue transfers after a NACK is detected. */ - bool enableReceivedAddressRead; /*!< Enable reading the address received address as the first byte of data. */ - uint32_t sdaGlitchFilterWidth_ns; /*!< Width in nanoseconds of the digital filter on the SDA signal. Set to 0 to - disable. */ - uint32_t sclGlitchFilterWidth_ns; /*!< Width in nanoseconds of the digital filter on the SCL signal. Set to 0 to - disable. */ - uint32_t dataValidDelay_ns; /*!< Width in nanoseconds of the data valid delay. */ - uint32_t clockHoldTime_ns; /*!< Width in nanoseconds of the clock hold time. */ -} lpi2c_slave_config_t; - -/*! - * @brief Set of events sent to the callback for non blocking slave transfers. - * - * These event enumerations are used for two related purposes. First, a bit mask created by OR'ing together - * events is passed to LPI2C_SlaveTransferNonBlocking() in order to specify which events to enable. - * Then, when the slave callback is invoked, it is passed the current event through its @a transfer - * parameter. - * - * @note These enumerations are meant to be OR'd together to form a bit mask of events. - */ -typedef enum _lpi2c_slave_transfer_event -{ - kLPI2C_SlaveAddressMatchEvent = 0x01U, /*!< Received the slave address after a start or repeated start. */ - kLPI2C_SlaveTransmitEvent = 0x02U, /*!< Callback is requested to provide data to transmit - (slave-transmitter role). */ - kLPI2C_SlaveReceiveEvent = 0x04U, /*!< Callback is requested to provide a buffer in which to place received - data (slave-receiver role). */ - kLPI2C_SlaveTransmitAckEvent = 0x08U, /*!< Callback needs to either transmit an ACK or NACK. */ - kLPI2C_SlaveRepeatedStartEvent = 0x10U, /*!< A repeated start was detected. */ - kLPI2C_SlaveCompletionEvent = 0x20U, /*!< A stop was detected, completing the transfer. */ - - /*! Bit mask of all available events. */ - kLPI2C_SlaveAllEvents = kLPI2C_SlaveAddressMatchEvent | kLPI2C_SlaveTransmitEvent | kLPI2C_SlaveReceiveEvent | - kLPI2C_SlaveTransmitAckEvent | kLPI2C_SlaveRepeatedStartEvent | kLPI2C_SlaveCompletionEvent, -} lpi2c_slave_transfer_event_t; - -/*! @brief LPI2C slave transfer structure */ -typedef struct _lpi2c_slave_transfer -{ - lpi2c_slave_transfer_event_t event; /*!< Reason the callback is being invoked. */ - uint8_t receivedAddress; /*!< Matching address send by master. */ - uint8_t *data; /*!< Transfer buffer */ - size_t dataSize; /*!< Transfer size */ - status_t completionStatus; /*!< Success or error code describing how the transfer completed. Only applies for - #kLPI2C_SlaveCompletionEvent. */ - size_t transferredCount; /*!< Number of bytes actually transferred since start or last repeated start. */ -} lpi2c_slave_transfer_t; - -/* Forward declaration. */ -/*! @brief LPI2C slave handle structure. */ -typedef struct _lpi2c_slave_handle lpi2c_slave_handle_t; - -/*! - * @brief Slave event callback function pointer type. - * - * This callback is used only for the slave non-blocking transfer API. To install a callback, - * use the LPI2C_SlaveSetCallback() function after you have created a handle. - * - * @param base Base address for the LPI2C instance on which the event occurred. - * @param transfer Pointer to transfer descriptor containing values passed to and/or from the callback. - * @param userData Arbitrary pointer-sized value passed from the application. - */ -typedef void (*lpi2c_slave_transfer_callback_t)(LPI2C_Type *base, lpi2c_slave_transfer_t *transfer, void *userData); - -/*! - * @brief LPI2C slave handle structure. - * @note The contents of this structure are private and subject to change. - */ -struct _lpi2c_slave_handle -{ - lpi2c_slave_transfer_t transfer; /*!< LPI2C slave transfer copy. */ - bool isBusy; /*!< Whether transfer is busy. */ - bool wasTransmit; /*!< Whether the last transfer was a transmit. */ - uint32_t eventMask; /*!< Mask of enabled events. */ - uint32_t transferredCount; /*!< Count of bytes transferred. */ - lpi2c_slave_transfer_callback_t callback; /*!< Callback function called at transfer event. */ - void *userData; /*!< Callback parameter passed to callback. */ -}; - -/*! @} */ - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! Array to map LPI2C instance number to IRQ number, used internally for LPI2C master interrupt and EDMA transactional -APIs. */ -extern IRQn_Type const kLpi2cIrqs[]; - -/*! Pointer to master IRQ handler for each instance, used internally for LPI2C master interrupt and EDMA transactional -APIs. */ -extern lpi2c_master_isr_t s_lpi2cMasterIsr; - -/*! Pointers to master handles for each instance, used internally for LPI2C master interrupt and EDMA transactional -APIs. */ -extern void *s_lpi2cMasterHandle[]; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @brief Returns an instance number given a base address. - * - * If an invalid base address is passed, debug builds will assert. Release builds will just return - * instance number 0. - * - * @param base The LPI2C peripheral base address. - * @return LPI2C instance number starting from 0. - */ -uint32_t LPI2C_GetInstance(LPI2C_Type *base); - -/*! - * @addtogroup lpi2c_master_driver - * @{ - */ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Provides a default configuration for the LPI2C master peripheral. - * - * This function provides the following default configuration for the LPI2C master peripheral: - * @code - * masterConfig->enableMaster = true; - * masterConfig->debugEnable = false; - * masterConfig->ignoreAck = false; - * masterConfig->pinConfig = kLPI2C_2PinOpenDrain; - * masterConfig->baudRate_Hz = 100000U; - * masterConfig->busIdleTimeout_ns = 0; - * masterConfig->pinLowTimeout_ns = 0; - * masterConfig->sdaGlitchFilterWidth_ns = 0; - * masterConfig->sclGlitchFilterWidth_ns = 0; - * masterConfig->hostRequest.enable = false; - * masterConfig->hostRequest.source = kLPI2C_HostRequestExternalPin; - * masterConfig->hostRequest.polarity = kLPI2C_HostRequestPinActiveHigh; - * @endcode - * - * After calling this function, you can override any settings in order to customize the configuration, - * prior to initializing the master driver with LPI2C_MasterInit(). - * - * @param[out] masterConfig User provided configuration structure for default values. Refer to #lpi2c_master_config_t. - */ -void LPI2C_MasterGetDefaultConfig(lpi2c_master_config_t *masterConfig); - -/*! - * @brief Initializes the LPI2C master peripheral. - * - * This function enables the peripheral clock and initializes the LPI2C master peripheral as described by the user - * provided configuration. A software reset is performed prior to configuration. - * - * @param base The LPI2C peripheral base address. - * @param masterConfig User provided peripheral configuration. Use LPI2C_MasterGetDefaultConfig() to get a set of - * defaults - * that you can override. - * @param sourceClock_Hz Frequency in Hertz of the LPI2C functional clock. Used to calculate the baud rate divisors, - * filter widths, and timeout periods. - */ -void LPI2C_MasterInit(LPI2C_Type *base, const lpi2c_master_config_t *masterConfig, uint32_t sourceClock_Hz); - -/*! - * @brief Deinitializes the LPI2C master peripheral. - * - * This function disables the LPI2C master peripheral and gates the clock. It also performs a software - * reset to restore the peripheral to reset conditions. - * - * @param base The LPI2C peripheral base address. - */ -void LPI2C_MasterDeinit(LPI2C_Type *base); - -/*! - * @brief Configures LPI2C master data match feature. - * - * @param base The LPI2C peripheral base address. - * @param matchConfig Settings for the data match feature. - */ -void LPI2C_MasterConfigureDataMatch(LPI2C_Type *base, const lpi2c_data_match_config_t *matchConfig); - -/*! - * @brief Convert provided flags to status code, and clear any errors if present. - * @param base The LPI2C peripheral base address. - * @param status Current status flags value that will be checked. - * @retval #kStatus_Success - * @retval #kStatus_LPI2C_PinLowTimeout - * @retval #kStatus_LPI2C_ArbitrationLost - * @retval #kStatus_LPI2C_Nak - * @retval #kStatus_LPI2C_FifoError - */ -/* Not static so it can be used from fsl_lpi2c_edma.c. */ -status_t LPI2C_MasterCheckAndClearError(LPI2C_Type *base, uint32_t status); - -/*! - * @brief Make sure the bus isn't already busy. - * - * A busy bus is allowed if we are the one driving it. - * - * @param base The LPI2C peripheral base address. - * @retval #kStatus_Success - * @retval #kStatus_LPI2C_Busy - */ -/* Not static so it can be used from fsl_lpi2c_edma.c. */ -status_t LPI2C_CheckForBusyBus(LPI2C_Type *base); - -/*! - * @brief Performs a software reset. - * - * Restores the LPI2C master peripheral to reset conditions. - * - * @param base The LPI2C peripheral base address. - */ -static inline void LPI2C_MasterReset(LPI2C_Type *base) -{ - base->MCR = LPI2C_MCR_RST_MASK; - base->MCR = 0; -} - -/*! - * @brief Enables or disables the LPI2C module as master. - * - * @param base The LPI2C peripheral base address. - * @param enable Pass true to enable or false to disable the specified LPI2C as master. - */ -static inline void LPI2C_MasterEnable(LPI2C_Type *base, bool enable) -{ - base->MCR = (base->MCR & ~LPI2C_MCR_MEN_MASK) | LPI2C_MCR_MEN(enable); -} - -/*! @}*/ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets the LPI2C master status flags. - * - * A bit mask with the state of all LPI2C master status flags is returned. For each flag, the corresponding bit - * in the return value is set if the flag is asserted. - * - * @param base The LPI2C peripheral base address. - * @return State of the status flags: - * - 1: related status flag is set. - * - 0: related status flag is not set. - * @see _lpi2c_master_flags - */ -static inline uint32_t LPI2C_MasterGetStatusFlags(LPI2C_Type *base) -{ - return base->MSR; -} - -/*! - * @brief Clears the LPI2C master status flag state. - * - * The following status register flags can be cleared: - * - #kLPI2C_MasterEndOfPacketFlag - * - #kLPI2C_MasterStopDetectFlag - * - #kLPI2C_MasterNackDetectFlag - * - #kLPI2C_MasterArbitrationLostFlag - * - #kLPI2C_MasterFifoErrFlag - * - #kLPI2C_MasterPinLowTimeoutFlag - * - #kLPI2C_MasterDataMatchFlag - * - * Attempts to clear other flags has no effect. - * - * @param base The LPI2C peripheral base address. - * @param statusMask A bitmask of status flags that are to be cleared. The mask is composed of - * _lpi2c_master_flags enumerators OR'd together. You may pass the result of a previous call to - * LPI2C_MasterGetStatusFlags(). - * @see _lpi2c_master_flags. - */ -static inline void LPI2C_MasterClearStatusFlags(LPI2C_Type *base, uint32_t statusMask) -{ - base->MSR = statusMask; -} - -/*! @}*/ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables the LPI2C master interrupt requests. - * - * All flags except #kLPI2C_MasterBusyFlag and #kLPI2C_MasterBusBusyFlag can be enabled as - * interrupts. - * - * @param base The LPI2C peripheral base address. - * @param interruptMask Bit mask of interrupts to enable. See _lpi2c_master_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void LPI2C_MasterEnableInterrupts(LPI2C_Type *base, uint32_t interruptMask) -{ - base->MIER |= interruptMask; -} - -/*! - * @brief Disables the LPI2C master interrupt requests. - * - * All flags except #kLPI2C_MasterBusyFlag and #kLPI2C_MasterBusBusyFlag can be enabled as - * interrupts. - * - * @param base The LPI2C peripheral base address. - * @param interruptMask Bit mask of interrupts to disable. See _lpi2c_master_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void LPI2C_MasterDisableInterrupts(LPI2C_Type *base, uint32_t interruptMask) -{ - base->MIER &= ~interruptMask; -} - -/*! - * @brief Returns the set of currently enabled LPI2C master interrupt requests. - * - * @param base The LPI2C peripheral base address. - * @return A bitmask composed of _lpi2c_master_flags enumerators OR'd together to indicate the - * set of enabled interrupts. - */ -static inline uint32_t LPI2C_MasterGetEnabledInterrupts(LPI2C_Type *base) -{ - return base->MIER; -} - -/*! @}*/ - -/*! - * @name DMA control - * @{ - */ - -/*! - * @brief Enables or disables LPI2C master DMA requests. - * - * @param base The LPI2C peripheral base address. - * @param enableTx Enable flag for transmit DMA request. Pass true for enable, false for disable. - * @param enableRx Enable flag for receive DMA request. Pass true for enable, false for disable. - */ -static inline void LPI2C_MasterEnableDMA(LPI2C_Type *base, bool enableTx, bool enableRx) -{ - base->MDER = LPI2C_MDER_TDDE(enableTx) | LPI2C_MDER_RDDE(enableRx); -} - -/*! - * @brief Gets LPI2C master transmit data register address for DMA transfer. - * - * @param base The LPI2C peripheral base address. - * @return The LPI2C Master Transmit Data Register address. - */ -static inline uint32_t LPI2C_MasterGetTxFifoAddress(LPI2C_Type *base) -{ - return (uint32_t)(uintptr_t)&base->MTDR; -} - -/*! - * @brief Gets LPI2C master receive data register address for DMA transfer. - * - * @param base The LPI2C peripheral base address. - * @return The LPI2C Master Receive Data Register address. - */ -static inline uint32_t LPI2C_MasterGetRxFifoAddress(LPI2C_Type *base) -{ - return (uint32_t)(uintptr_t)&base->MRDR; -} - -/*! @}*/ - -/*! - * @name FIFO control - * @{ - */ - -/*! - * @brief Sets the watermarks for LPI2C master FIFOs. - * - * @param base The LPI2C peripheral base address. - * @param txWords Transmit FIFO watermark value in words. The #kLPI2C_MasterTxReadyFlag flag is set whenever - * the number of words in the transmit FIFO is equal or less than @a txWords. Writing a value equal or - * greater than the FIFO size is truncated. - * @param rxWords Receive FIFO watermark value in words. The #kLPI2C_MasterRxReadyFlag flag is set whenever - * the number of words in the receive FIFO is greater than @a rxWords. Writing a value equal or greater - * than the FIFO size is truncated. - */ -static inline void LPI2C_MasterSetWatermarks(LPI2C_Type *base, size_t txWords, size_t rxWords) -{ - base->MFCR = LPI2C_MFCR_TXWATER(txWords) | LPI2C_MFCR_RXWATER(rxWords); -} - -/*! - * @brief Gets the current number of words in the LPI2C master FIFOs. - * - * @param base The LPI2C peripheral base address. - * @param[out] txCount Pointer through which the current number of words in the transmit FIFO is returned. - * Pass NULL if this value is not required. - * @param[out] rxCount Pointer through which the current number of words in the receive FIFO is returned. - * Pass NULL if this value is not required. - */ -static inline void LPI2C_MasterGetFifoCounts(LPI2C_Type *base, size_t *rxCount, size_t *txCount) -{ - if (NULL != txCount) - { - *txCount = (base->MFSR & LPI2C_MFSR_TXCOUNT_MASK) >> LPI2C_MFSR_TXCOUNT_SHIFT; - } - if (NULL != rxCount) - { - *rxCount = (base->MFSR & LPI2C_MFSR_RXCOUNT_MASK) >> LPI2C_MFSR_RXCOUNT_SHIFT; - } -} - -/*! @}*/ - -/*! - * @name Bus operations - * @{ - */ - -/*! - * @brief Sets the I2C bus frequency for master transactions. - * - * The LPI2C master is automatically disabled and re-enabled as necessary to configure the baud - * rate. Do not call this function during a transfer, or the transfer is aborted. - * - * @note Please note that the second parameter is the clock frequency of LPI2C module, the third - * parameter means user configured bus baudrate, this implementation is different from other I2C drivers - * which use baudrate configuration as second parameter and source clock frequency as third parameter. - * - * @param base The LPI2C peripheral base address. - * @param sourceClock_Hz LPI2C functional clock frequency in Hertz. - * @param baudRate_Hz Requested bus frequency in Hertz. - */ -void LPI2C_MasterSetBaudRate(LPI2C_Type *base, uint32_t sourceClock_Hz, uint32_t baudRate_Hz); - -/*! - * @brief Returns whether the bus is idle. - * - * Requires the master mode to be enabled. - * - * @param base The LPI2C peripheral base address. - * @retval true Bus is busy. - * @retval false Bus is idle. - */ -static inline bool LPI2C_MasterGetBusIdleState(LPI2C_Type *base) -{ - return ((base->MSR & LPI2C_MSR_BBF_MASK) >> LPI2C_MSR_BBF_SHIFT) == 1U ? true : false; -} - -/*! - * @brief Sends a START signal and slave address on the I2C bus. - * - * This function is used to initiate a new master mode transfer. First, the bus state is checked to ensure - * that another master is not occupying the bus. Then a START signal is transmitted, followed by the - * 7-bit address specified in the @a address parameter. Note that this function does not actually wait - * until the START and address are successfully sent on the bus before returning. - * - * @param base The LPI2C peripheral base address. - * @param address 7-bit slave device address, in bits [6:0]. - * @param dir Master transfer direction, either #kLPI2C_Read or #kLPI2C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * @retval kStatus_Success START signal and address were successfully enqueued in the transmit FIFO. - * @retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - */ -status_t LPI2C_MasterStart(LPI2C_Type *base, uint8_t address, lpi2c_direction_t dir); - -/*! - * @brief Sends a repeated START signal and slave address on the I2C bus. - * - * This function is used to send a Repeated START signal when a transfer is already in progress. Like - * LPI2C_MasterStart(), it also sends the specified 7-bit address. - * - * @note This function exists primarily to maintain compatible APIs between LPI2C and I2C drivers, - * as well as to better document the intent of code that uses these APIs. - * - * @param base The LPI2C peripheral base address. - * @param address 7-bit slave device address, in bits [6:0]. - * @param dir Master transfer direction, either #kLPI2C_Read or #kLPI2C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * @retval kStatus_Success Repeated START signal and address were successfully enqueued in the transmit FIFO. - * @retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - */ -static inline status_t LPI2C_MasterRepeatedStart(LPI2C_Type *base, uint8_t address, lpi2c_direction_t dir) -{ - return LPI2C_MasterStart(base, address, dir); -} - -/*! - * @brief Performs a polling send transfer on the I2C bus. - * - * Sends up to @a txSize number of bytes to the previously addressed slave device. The slave may - * reply with a NAK to any byte in order to terminate the transfer early. If this happens, this - * function returns #kStatus_LPI2C_Nak. - * - * @param base The LPI2C peripheral base address. - * @param txBuff The pointer to the data to be transferred. - * @param txSize The length in bytes of the data to be transferred. - * @retval kStatus_Success Data was sent successfully. - * @retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * @retval #kStatus_LPI2C_FifoError FIFO under run or over run. - * @retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * @retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterSend(LPI2C_Type *base, void *txBuff, size_t txSize); - -/*! - * @brief Performs a polling receive transfer on the I2C bus. - * - * @param base The LPI2C peripheral base address. - * @param rxBuff The pointer to the data to be transferred. - * @param rxSize The length in bytes of the data to be transferred. - * @retval kStatus_Success Data was received successfully. - * @retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * @retval #kStatus_LPI2C_FifoError FIFO under run or overrun. - * @retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * @retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterReceive(LPI2C_Type *base, void *rxBuff, size_t rxSize); - -/*! - * @brief Sends a STOP signal on the I2C bus. - * - * This function does not return until the STOP signal is seen on the bus, or an error occurs. - * - * @param base The LPI2C peripheral base address. - * @retval kStatus_Success The STOP signal was successfully sent on the bus and the transaction terminated. - * @retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * @retval #kStatus_LPI2C_FifoError FIFO under run or overrun. - * @retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * @retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterStop(LPI2C_Type *base); - -/*! - * @brief Performs a master polling transfer on the I2C bus. - * - * @note The API does not return until the transfer succeeds or fails due - * to error happens during transfer. - * - * @param base The LPI2C peripheral base address. - * @param transfer Pointer to the transfer structure. - * @retval kStatus_Success Data was received successfully. - * @retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * @retval #kStatus_LPI2C_FifoError FIFO under run or overrun. - * @retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * @retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterTransferBlocking(LPI2C_Type *base, lpi2c_master_transfer_t *transfer); - -/*! @}*/ - -/*! - * @name Non-blocking - * @{ - */ - -/*! - * @brief Creates a new handle for the LPI2C master non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the LPI2C_MasterTransferAbort() API shall be called. - * - * - * @note The function also enables the NVIC IRQ for the input LPI2C. Need to notice - * that on some SoCs the LPI2C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - * - * @param base The LPI2C peripheral base address. - * @param[out] handle Pointer to the LPI2C master driver handle. - * @param callback User provided pointer to the asynchronous callback function. - * @param userData User provided pointer to the application callback data. - */ -void LPI2C_MasterTransferCreateHandle(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_master_transfer_callback_t callback, - void *userData); - -/*! - * @brief Performs a non-blocking transaction on the I2C bus. - * - * @param base The LPI2C peripheral base address. - * @param handle Pointer to the LPI2C master driver handle. - * @param transfer The pointer to the transfer descriptor. - * @retval kStatus_Success The transaction was started successfully. - * @retval #kStatus_LPI2C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - */ -status_t LPI2C_MasterTransferNonBlocking(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_master_transfer_t *transfer); - -/*! - * @brief Returns number of bytes transferred so far. - * @param base The LPI2C peripheral base address. - * @param handle Pointer to the LPI2C master driver handle. - * @param[out] count Number of bytes transferred so far by the non-blocking transaction. - * @retval kStatus_Success - * @retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t LPI2C_MasterTransferGetCount(LPI2C_Type *base, lpi2c_master_handle_t *handle, size_t *count); - -/*! - * @brief Terminates a non-blocking LPI2C master transmission early. - * - * @note It is not safe to call this function from an IRQ handler that has a higher priority than the - * LPI2C peripheral's IRQ priority. - * - * @param base The LPI2C peripheral base address. - * @param handle Pointer to the LPI2C master driver handle. - */ -void LPI2C_MasterTransferAbort(LPI2C_Type *base, lpi2c_master_handle_t *handle); - -/*! @}*/ - -/*! - * @name IRQ handler - * @{ - */ - -/*! - * @brief Reusable routine to handle master interrupts. - * @note This function does not need to be called unless you are reimplementing the - * nonblocking API's interrupt handler routines to add special functionality. - * @param base The LPI2C peripheral base address. - * @param lpi2cMasterHandle Pointer to the LPI2C master driver handle. - */ -void LPI2C_MasterTransferHandleIRQ(LPI2C_Type *base, void *lpi2cMasterHandle); - -/*! @}*/ - -/*! @} */ - -/*! - * @addtogroup lpi2c_slave_driver - * @{ - */ - -/*! - * @name Slave initialization and deinitialization - * @{ - */ - -/*! - * @brief Provides a default configuration for the LPI2C slave peripheral. - * - * This function provides the following default configuration for the LPI2C slave peripheral: - * @code - * slaveConfig->enableSlave = true; - * slaveConfig->address0 = 0U; - * slaveConfig->address1 = 0U; - * slaveConfig->addressMatchMode = kLPI2C_MatchAddress0; - * slaveConfig->filterDozeEnable = true; - * slaveConfig->filterEnable = true; - * slaveConfig->enableGeneralCall = false; - * slaveConfig->sclStall.enableAck = false; - * slaveConfig->sclStall.enableTx = true; - * slaveConfig->sclStall.enableRx = true; - * slaveConfig->sclStall.enableAddress = true; - * slaveConfig->ignoreAck = false; - * slaveConfig->enableReceivedAddressRead = false; - * slaveConfig->sdaGlitchFilterWidth_ns = 0; - * slaveConfig->sclGlitchFilterWidth_ns = 0; - * slaveConfig->dataValidDelay_ns = 0; - * slaveConfig->clockHoldTime_ns = 0; - * @endcode - * - * After calling this function, override any settings to customize the configuration, - * prior to initializing the master driver with LPI2C_SlaveInit(). Be sure to override at least the @a - * address0 member of the configuration structure with the desired slave address. - * - * @param[out] slaveConfig User provided configuration structure that is set to default values. Refer to - * #lpi2c_slave_config_t. - */ -void LPI2C_SlaveGetDefaultConfig(lpi2c_slave_config_t *slaveConfig); - -/*! - * @brief Initializes the LPI2C slave peripheral. - * - * This function enables the peripheral clock and initializes the LPI2C slave peripheral as described by the user - * provided configuration. - * - * @param base The LPI2C peripheral base address. - * @param slaveConfig User provided peripheral configuration. Use LPI2C_SlaveGetDefaultConfig() to get a set of defaults - * that you can override. - * @param sourceClock_Hz Frequency in Hertz of the LPI2C functional clock. Used to calculate the filter widths, - * data valid delay, and clock hold time. - */ -void LPI2C_SlaveInit(LPI2C_Type *base, const lpi2c_slave_config_t *slaveConfig, uint32_t sourceClock_Hz); - -/*! - * @brief Deinitializes the LPI2C slave peripheral. - * - * This function disables the LPI2C slave peripheral and gates the clock. It also performs a software - * reset to restore the peripheral to reset conditions. - * - * @param base The LPI2C peripheral base address. - */ -void LPI2C_SlaveDeinit(LPI2C_Type *base); - -/*! - * @brief Performs a software reset of the LPI2C slave peripheral. - * - * @param base The LPI2C peripheral base address. - */ -static inline void LPI2C_SlaveReset(LPI2C_Type *base) -{ - base->SCR = LPI2C_SCR_RST_MASK; - base->SCR = 0; -} - -/*! - * @brief Enables or disables the LPI2C module as slave. - * - * @param base The LPI2C peripheral base address. - * @param enable Pass true to enable or false to disable the specified LPI2C as slave. - */ -static inline void LPI2C_SlaveEnable(LPI2C_Type *base, bool enable) -{ - base->SCR = (base->SCR & ~LPI2C_SCR_SEN_MASK) | LPI2C_SCR_SEN(enable); -} - -/*! @}*/ - -/*! - * @name Slave status - * @{ - */ - -/*! - * @brief Gets the LPI2C slave status flags. - * - * A bit mask with the state of all LPI2C slave status flags is returned. For each flag, the corresponding bit - * in the return value is set if the flag is asserted. - * - * @param base The LPI2C peripheral base address. - * @return State of the status flags: - * - 1: related status flag is set. - * - 0: related status flag is not set. - * @see _lpi2c_slave_flags - */ -static inline uint32_t LPI2C_SlaveGetStatusFlags(LPI2C_Type *base) -{ - return base->SSR; -} - -/*! - * @brief Clears the LPI2C status flag state. - * - * The following status register flags can be cleared: - * - #kLPI2C_SlaveRepeatedStartDetectFlag - * - #kLPI2C_SlaveStopDetectFlag - * - #kLPI2C_SlaveBitErrFlag - * - #kLPI2C_SlaveFifoErrFlag - * - * Attempts to clear other flags has no effect. - * - * @param base The LPI2C peripheral base address. - * @param statusMask A bitmask of status flags that are to be cleared. The mask is composed of - * #_lpi2c_slave_flags enumerators OR'd together. You may pass the result of a previous call to - * LPI2C_SlaveGetStatusFlags(). - * @see _lpi2c_slave_flags. - */ -static inline void LPI2C_SlaveClearStatusFlags(LPI2C_Type *base, uint32_t statusMask) -{ - base->SSR = statusMask; -} -/*! @}*/ - -/*! - * @name Slave interrupts - * @{ - */ - -/*! - * @brief Enables the LPI2C slave interrupt requests. - * - * All flags except #kLPI2C_SlaveBusyFlag and #kLPI2C_SlaveBusBusyFlag can be enabled as - * interrupts. - * - * @param base The LPI2C peripheral base address. - * @param interruptMask Bit mask of interrupts to enable. See #_lpi2c_slave_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void LPI2C_SlaveEnableInterrupts(LPI2C_Type *base, uint32_t interruptMask) -{ - base->SIER |= interruptMask; -} - -/*! - * @brief Disables the LPI2C slave interrupt requests. - * - * All flags except #kLPI2C_SlaveBusyFlag and #kLPI2C_SlaveBusBusyFlag can be enabled as - * interrupts. - * - * @param base The LPI2C peripheral base address. - * @param interruptMask Bit mask of interrupts to disable. See #_lpi2c_slave_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void LPI2C_SlaveDisableInterrupts(LPI2C_Type *base, uint32_t interruptMask) -{ - base->SIER &= ~interruptMask; -} - -/*! - * @brief Returns the set of currently enabled LPI2C slave interrupt requests. - * @param base The LPI2C peripheral base address. - * @return A bitmask composed of #_lpi2c_slave_flags enumerators OR'd together to indicate the - * set of enabled interrupts. - */ -static inline uint32_t LPI2C_SlaveGetEnabledInterrupts(LPI2C_Type *base) -{ - return base->SIER; -} - -/*! @}*/ - -/*! - * @name Slave DMA control - * @{ - */ - -/*! - * @brief Enables or disables the LPI2C slave peripheral DMA requests. - * - * @param base The LPI2C peripheral base address. - * @param enableAddressValid Enable flag for the address valid DMA request. Pass true for enable, false for disable. - * The address valid DMA request is shared with the receive data DMA request. - * @param enableRx Enable flag for the receive data DMA request. Pass true for enable, false for disable. - * @param enableTx Enable flag for the transmit data DMA request. Pass true for enable, false for disable. - */ -static inline void LPI2C_SlaveEnableDMA(LPI2C_Type *base, bool enableAddressValid, bool enableRx, bool enableTx) -{ - base->SDER = (base->SDER & ~(LPI2C_SDER_AVDE_MASK | LPI2C_SDER_RDDE_MASK | LPI2C_SDER_TDDE_MASK)) | - LPI2C_SDER_AVDE(enableAddressValid) | LPI2C_SDER_RDDE(enableRx) | LPI2C_SDER_TDDE(enableTx); -} - -/*! @}*/ - -/*! - * @name Slave bus operations - * @{ - */ - -/*! - * @brief Returns whether the bus is idle. - * - * Requires the slave mode to be enabled. - * - * @param base The LPI2C peripheral base address. - * @retval true Bus is busy. - * @retval false Bus is idle. - */ -static inline bool LPI2C_SlaveGetBusIdleState(LPI2C_Type *base) -{ - return ((base->SSR & LPI2C_SSR_BBF_MASK) >> LPI2C_SSR_BBF_SHIFT) == 1U ? true : false; -} - -/*! - * @brief Transmits either an ACK or NAK on the I2C bus in response to a byte from the master. - * - * Use this function to send an ACK or NAK when the #kLPI2C_SlaveTransmitAckFlag is asserted. This - * only happens if you enable the sclStall.enableAck field of the ::lpi2c_slave_config_t configuration - * structure used to initialize the slave peripheral. - * - * @param base The LPI2C peripheral base address. - * @param ackOrNack Pass true for an ACK or false for a NAK. - */ -static inline void LPI2C_SlaveTransmitAck(LPI2C_Type *base, bool ackOrNack) -{ - base->STAR = LPI2C_STAR_TXNACK(!ackOrNack); -} - -/*! - * @brief Enables or disables ACKSTALL. - * - * When enables ACKSTALL, software can transmit either an ACK or NAK on the I2C bus in response to - * a byte from the master. - * - * @param base The LPI2C peripheral base address. - * @param enable True will enable ACKSTALL,false will disable ACKSTALL. - */ -static inline void LPI2C_SlaveEnableAckStall(LPI2C_Type *base, bool enable) -{ - if (enable) - { - base->SCFGR1 |= LPI2C_SCFGR1_ACKSTALL_MASK; - } - else - { - base->SCFGR1 &= ~LPI2C_SCFGR1_ACKSTALL_MASK; - } -} - -/*! - * @brief Returns the slave address sent by the I2C master. - * - * This function should only be called if the #kLPI2C_SlaveAddressValidFlag is asserted. - * - * @param base The LPI2C peripheral base address. - * @return The 8-bit address matched by the LPI2C slave. Bit 0 contains the R/w direction bit, and - * the 7-bit slave address is in the upper 7 bits. - */ -static inline uint32_t LPI2C_SlaveGetReceivedAddress(LPI2C_Type *base) -{ - return base->SASR & LPI2C_SASR_RADDR_MASK; -} - -/*! - * @brief Performs a polling send transfer on the I2C bus. - * - * @param base The LPI2C peripheral base address. - * @param txBuff The pointer to the data to be transferred. - * @param txSize The length in bytes of the data to be transferred. - * @param[out] actualTxSize - * @return Error or success status returned by API. - */ -status_t LPI2C_SlaveSend(LPI2C_Type *base, void *txBuff, size_t txSize, size_t *actualTxSize); - -/*! - * @brief Performs a polling receive transfer on the I2C bus. - * - * @param base The LPI2C peripheral base address. - * @param rxBuff The pointer to the data to be transferred. - * @param rxSize The length in bytes of the data to be transferred. - * @param[out] actualRxSize - * @return Error or success status returned by API. - */ -status_t LPI2C_SlaveReceive(LPI2C_Type *base, void *rxBuff, size_t rxSize, size_t *actualRxSize); - -/*! @}*/ - -/*! - * @name Slave non-blocking - * @{ - */ - -/*! - * @brief Creates a new handle for the LPI2C slave non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the LPI2C_SlaveTransferAbort() API shall be called. - * - * @note The function also enables the NVIC IRQ for the input LPI2C. Need to notice - * that on some SoCs the LPI2C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - - * @param base The LPI2C peripheral base address. - * @param[out] handle Pointer to the LPI2C slave driver handle. - * @param callback User provided pointer to the asynchronous callback function. - * @param userData User provided pointer to the application callback data. - */ -void LPI2C_SlaveTransferCreateHandle(LPI2C_Type *base, - lpi2c_slave_handle_t *handle, - lpi2c_slave_transfer_callback_t callback, - void *userData); - -/*! - * @brief Starts accepting slave transfers. - * - * Call this API after calling I2C_SlaveInit() and LPI2C_SlaveTransferCreateHandle() to start processing - * transactions driven by an I2C master. The slave monitors the I2C bus and pass events to the - * callback that was passed into the call to LPI2C_SlaveTransferCreateHandle(). The callback is always invoked - * from the interrupt context. - * - * The set of events received by the callback is customizable. To do so, set the @a eventMask parameter to - * the OR'd combination of #lpi2c_slave_transfer_event_t enumerators for the events you wish to receive. - * The #kLPI2C_SlaveTransmitEvent and #kLPI2C_SlaveReceiveEvent events are always enabled and do not need - * to be included in the mask. Alternatively, you can pass 0 to get a default set of only the transmit and - * receive events that are always enabled. In addition, the #kLPI2C_SlaveAllEvents constant is provided as - * a convenient way to enable all events. - * - * @param base The LPI2C peripheral base address. - * @param handle Pointer to lpi2c_slave_handle_t structure which stores the transfer state. - * @param eventMask Bit mask formed by OR'ing together #lpi2c_slave_transfer_event_t enumerators to specify - * which events to send to the callback. Other accepted values are 0 to get a default set of - * only the transmit and receive events, and #kLPI2C_SlaveAllEvents to enable all events. - * - * @retval kStatus_Success Slave transfers were successfully started. - * @retval #kStatus_LPI2C_Busy Slave transfers have already been started on this handle. - */ -status_t LPI2C_SlaveTransferNonBlocking(LPI2C_Type *base, lpi2c_slave_handle_t *handle, uint32_t eventMask); - -/*! - * @brief Gets the slave transfer status during a non-blocking transfer. - * @param base The LPI2C peripheral base address. - * @param handle Pointer to i2c_slave_handle_t structure. - * @param[out] count Pointer to a value to hold the number of bytes transferred. May be NULL if the count is not - * required. - * @retval kStatus_Success - * @retval kStatus_NoTransferInProgress - */ -status_t LPI2C_SlaveTransferGetCount(LPI2C_Type *base, lpi2c_slave_handle_t *handle, size_t *count); - -/*! - * @brief Aborts the slave non-blocking transfers. - * @note This API could be called at any time to stop slave for handling the bus events. - * @param base The LPI2C peripheral base address. - * @param handle Pointer to lpi2c_slave_handle_t structure which stores the transfer state. - */ -void LPI2C_SlaveTransferAbort(LPI2C_Type *base, lpi2c_slave_handle_t *handle); - -/*! @}*/ - -/*! - * @name Slave IRQ handler - * @{ - */ - -/*! - * @brief Reusable routine to handle slave interrupts. - * @note This function does not need to be called unless you are reimplementing the - * non blocking API's interrupt handler routines to add special functionality. - * @param base The LPI2C peripheral base address. - * @param handle Pointer to lpi2c_slave_handle_t structure which stores the transfer state. - */ -void LPI2C_SlaveTransferHandleIRQ(LPI2C_Type *base, lpi2c_slave_handle_t *handle); - -/*! @}*/ - -/*! @} */ - -#if defined(__cplusplus) -} -#endif -/*! @} */ -#endif /* FSL_LPI2C_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpi2c_edma.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpi2c_edma.c deleted file mode 100644 index 9c57f55006b..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpi2c_edma.c +++ /dev/null @@ -1,659 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpi2c_edma.h" -#include -#include - -/* - * $Coverage Justification Reference$ - * - * $Justification fsl_lpi2c_edma_c_ref_1$ - * Need multiple master and slave modules on bus to simulate the true branch - * - * $Justification fsl_lpi2c_edma_c_ref_2$ - * FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(X) is a constant. - * - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpi2c_edma" -#endif - -/* @brief Mask to align an address to edma_tcd_t size. */ -#define ALIGN_TCD_SIZE_MASK (sizeof(edma_tcd_t) - 1U) - -/* ! @brief LPI2C master fifo commands. */ -enum _lpi2c_master_fifo_cmd -{ - kTxDataCmd = LPI2C_MTDR_CMD(0x0U), /*!< Transmit DATA[7:0] */ - kRxDataCmd = LPI2C_MTDR_CMD(0X1U), /*!< Receive (DATA[7:0] + 1) bytes */ - kStopCmd = LPI2C_MTDR_CMD(0x2U), /*!< Generate STOP condition */ - kStartCmd = LPI2C_MTDR_CMD(0x4U), /*!< Generate(repeated) START and transmit address in DATA[[7:0] */ -}; - -/*! @brief States for the state machine used by transactional APIs. */ -enum _lpi2c_transfer_states -{ - kIdleState = 0, - kSendCommandState, - kIssueReadCommandState, - kTransferDataState, - kStopState, - kWaitForCompletionState, -}; - -/*! @brief Typedef for interrupt handler. */ -typedef void (*lpi2c_isr_t)(LPI2C_Type *base, void *handle); - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Prepares the command buffer with the sequence of commands needed to send the requested transaction. - * @param handle Master DMA driver handle. - * @return Number of command words. - */ -static uint32_t LPI2C_GenerateCommands(lpi2c_master_edma_handle_t *handle); - -/*! - * @brief DMA completion callback. - * @param dmaHandle DMA channel handle for the channel that completed. - * @param userData User data associated with the channel handle. For this callback, the user data is the - * LPI2C DMA driver handle. - * @param isTransferDone Whether the DMA transfer has completed. - * @param tcds Number of TCDs that completed. - */ -static void LPI2C_MasterEDMACallback(edma_handle_t *dmaHandle, void *userData, bool isTransferDone, uint32_t tcds); - -/*! - * @brief LPI2C master edma transfer IRQ handle routine. - * - * This API handles the LPI2C bus error status and invoke callback if needed. - * - * @param base The LPI2C peripheral base address. - * @param lpi2cMasterEdmaHandle Pointer to the LPI2C master edma handle. - */ -static void LPI2C_MasterTransferEdmaHandleIRQ(LPI2C_Type *base, void *lpi2cMasterEdmaHandle); -/******************************************************************************* - * Variables - ******************************************************************************/ - -static uint32_t lpi2c_edma_RecSetting = 0x02; - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Create a new handle for the LPI2C master DMA APIs. - * - * The creation of a handle is for use with the DMA APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the LPI2C_MasterTransferAbortEDMA() API shall be called. - * - * For devices where the LPI2C send and receive DMA requests are OR'd together, the a txDmaHandle - * parameter is ignored and may be set to NULL. - * - * param base The LPI2C peripheral base address. - * param[out] handle Pointer to the LPI2C master driver handle. - * param rxDmaHandle Handle for the eDMA receive channel. Created by the user prior to calling this function. - * param txDmaHandle Handle for the eDMA transmit channel. Created by the user prior to calling this function. - * param callback User provided pointer to the asynchronous callback function. - * param userData User provided pointer to the application callback data. - */ -void LPI2C_MasterCreateEDMAHandle(LPI2C_Type *base, - lpi2c_master_edma_handle_t *handle, - edma_handle_t *rxDmaHandle, - edma_handle_t *txDmaHandle, - lpi2c_master_edma_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - assert(rxDmaHandle != NULL); - assert(txDmaHandle != NULL); - - /* Look up instance number */ - uint32_t instance = LPI2C_GetInstance(base); - - /* Clear out the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Set up the handle. For combined rx/tx DMA requests, the tx channel handle is set to the rx handle */ - /* in order to make the transfer API code simpler. */ - handle->base = base; - handle->completionCallback = callback; - handle->userData = userData; - handle->rx = rxDmaHandle; - handle->tx = (FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base) > 0) ? txDmaHandle : rxDmaHandle; - - /* Save the handle in global variables to support the double weak mechanism. */ - s_lpi2cMasterHandle[instance] = handle; - - /* Set LPI2C_MasterTransferEdmaHandleIRQ as LPI2C DMA IRQ handler */ - s_lpi2cMasterIsr = LPI2C_MasterTransferEdmaHandleIRQ; - - /* Enable interrupt in NVIC. */ - (void)EnableIRQ(kLpi2cIrqs[instance]); - - /* Set DMA channel completion callbacks. */ - EDMA_SetCallback(handle->rx, LPI2C_MasterEDMACallback, handle); - if (FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base) != 0) - { - EDMA_SetCallback(handle->tx, LPI2C_MasterEDMACallback, handle); - } -} - -static uint32_t LPI2C_GenerateCommands(lpi2c_master_edma_handle_t *handle) -{ - lpi2c_master_transfer_t *xfer = &handle->transfer; - uint16_t *cmd = (uint16_t *)&handle->commandBuffer; - uint32_t cmdCount = 0; - - /* Handle no start option. */ - if ((xfer->flags & (uint32_t)kLPI2C_TransferNoStartFlag) != 0U) - { - if (xfer->direction == kLPI2C_Read) - { - /* Need to issue read command first. */ - cmd[cmdCount++] = (uint16_t)kRxDataCmd | (uint16_t)LPI2C_MTDR_DATA(xfer->dataSize - 1U); - } - } - else - { - /* - * Initial direction depends on whether a subaddress was provided, and of course the actual - * data transfer direction. - */ - lpi2c_direction_t direction = (xfer->subaddressSize != 0U) ? kLPI2C_Write : xfer->direction; - - /* Start command. */ - cmd[cmdCount++] = - (uint16_t)kStartCmd | (uint16_t)((uint16_t)((uint16_t)xfer->slaveAddress << 1U) | (uint16_t)direction); - - /* Subaddress, MSB first. */ - if (xfer->subaddressSize != 0U) - { - uint32_t subaddressRemaining = xfer->subaddressSize; - while (0U != subaddressRemaining--) - { - uint8_t subaddressByte = (uint8_t)(xfer->subaddress >> (8U * subaddressRemaining)) & 0xffU; - cmd[cmdCount++] = subaddressByte; - } - } - - /* Reads need special handling because we have to issue a read command and maybe a repeated start. */ - if ((xfer->dataSize != 0U) && (xfer->direction == kLPI2C_Read)) - { - /* Need to send repeated start if switching directions to read. */ - if (direction == kLPI2C_Write) - { - cmd[cmdCount++] = (uint16_t)kStartCmd | - (uint16_t)((uint16_t)((uint16_t)xfer->slaveAddress << 1U) | (uint16_t)kLPI2C_Read); - } - - /* Read command. A single write to MTDR can issue read operation of 0xFFU + 1 byte of data at most, so when - the dataSize is larger than 0x100U, push multiple read commands to MTDR until dataSize is reached. */ - size_t tmpRxSize = xfer->dataSize; - while (tmpRxSize != 0U) - { - if (tmpRxSize > 256U) - { - cmd[cmdCount++] = (uint16_t)kRxDataCmd | (uint16_t)LPI2C_MTDR_DATA(0xFFU); - tmpRxSize -= 256U; - } - else - { - cmd[cmdCount++] = (uint16_t)kRxDataCmd | (uint16_t)LPI2C_MTDR_DATA(tmpRxSize - 1U); - tmpRxSize = 0U; - } - } - } - } - - return cmdCount; -} - -/*! - * brief Performs a non-blocking DMA-based transaction on the I2C bus. - * - * The callback specified when the a handle was created is invoked when the transaction has - * completed. - * - * param base The LPI2C peripheral base address. - * param handle Pointer to the LPI2C master driver handle. - * param transfer The pointer to the transfer descriptor. - * retval #kStatus_Success The transaction was started successfully. - * retval #kStatus_LPI2C_Busy Either another master is currently utilizing the bus, or another DMA - * transaction is already in progress. - */ -status_t LPI2C_MasterTransferEDMA(LPI2C_Type *base, - lpi2c_master_edma_handle_t *handle, - lpi2c_master_transfer_t *transfer) -{ - status_t result; - - assert(handle != NULL); - assert(transfer != NULL); - assert(transfer->subaddressSize <= sizeof(transfer->subaddress)); - - /* Check transfer data size in read operation. */ - /* A single write to MTDR can issue read operation of 0xFFU + 1 byte of data at most, so when the dataSize is larger - than 0x100U, push multiple read commands to MTDR until dataSize is reached. LPI2C edma transfer uses linked - descriptor to transfer command and data, the command buffer is stored in handle. Allocate 4 command words to - carry read command which can cover nearly all use cases. */ - if ((transfer->direction == kLPI2C_Read) && (transfer->dataSize > (256U * 4U))) - { - return kStatus_InvalidArgument; - } - - /* Return busy if another transaction is in progress. */ - if (handle->isBusy) - { - return kStatus_LPI2C_Busy; - } - - /* Enable the master function and disable the slave function. */ - LPI2C_MasterEnable(base, true); - LPI2C_SlaveEnable(base, false); - - /* Return an error if the bus is already in use not by us. */ - result = LPI2C_CheckForBusyBus(base); - /* - * $Branch Coverage Justification$ - * $ref fsl_lpi2c_edma_c_ref_1$ - */ - if (result != kStatus_Success) - { - return result; - } - - /* We're now busy. */ - handle->isBusy = true; - - /* Disable LPI2C IRQ and DMA sources while we configure stuff. */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - LPI2C_MasterEnableDMA(base, false, false); - - /* Clear all flags. */ - LPI2C_MasterClearStatusFlags(base, (uint32_t)kLPI2C_MasterClearFlags); - - /* Save transfer into handle. */ - handle->transfer = *transfer; - - /* Generate commands to send. */ - uint32_t commandCount = LPI2C_GenerateCommands(handle); - - /* If the user is transmitting no data with no start or stop, then just go ahead and invoke the callback. */ - if ((0U == commandCount) && (transfer->dataSize == 0U)) - { - if (handle->completionCallback != NULL) - { - handle->completionCallback(base, handle, kStatus_Success, handle->userData); - } - return kStatus_Success; - } - - /* Reset DMA channels. */ - EDMA_ResetChannel(handle->rx->base, handle->rx->channel); - if (FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base) != 0) - { - EDMA_ResetChannel(handle->tx->base, handle->tx->channel); - } - - /* Get a 32-byte aligned TCD pointer. */ - edma_tcd_t *tcd = (edma_tcd_t *)((uint32_t)(&handle->tcds[1]) & (~ALIGN_TCD_SIZE_MASK)); - - bool hasSendData = (transfer->direction == kLPI2C_Write) && (transfer->dataSize != 0U); - bool hasReceiveData = (transfer->direction == kLPI2C_Read) && (transfer->dataSize != 0U); - - edma_transfer_config_t transferConfig = {0}; - edma_tcd_t *linkTcd = NULL; - - /* Set up data transmit. */ - if (hasSendData) - { - uint32_t *srcAddr = (uint32_t *)transfer->data; - transferConfig.srcAddr = (uint32_t)srcAddr; - transferConfig.destAddr = (uint32_t)LPI2C_MasterGetTxFifoAddress(base); - transferConfig.srcTransferSize = kEDMA_TransferSize1Bytes; - transferConfig.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfig.srcOffset = (int16_t)sizeof(uint8_t); - transferConfig.destOffset = 0; - transferConfig.minorLoopBytes = sizeof(uint8_t); /* TODO optimize to fill fifo */ - transferConfig.majorLoopCounts = transfer->dataSize; - - /* Store the initially configured eDMA minor byte transfer count into the LPI2C handle */ - handle->nbytes = (uint8_t)transferConfig.minorLoopBytes; - - if (commandCount != 0U) - { -#if defined FSL_EDMA_DRIVER_EDMA4 && FSL_EDMA_DRIVER_EDMA4 - /* Create a software TCD, which will be chained after the commands. */ - EDMA_TcdResetExt(handle->tx->base, tcd); - EDMA_TcdSetTransferConfigExt(handle->tx->base, tcd, &transferConfig, NULL); - EDMA_TcdEnableInterruptsExt(handle->tx->base, tcd, (uint32_t)kEDMA_MajorInterruptEnable); -#else - /* Create a software TCD, which will be chained after the commands. */ - EDMA_TcdReset(tcd); - EDMA_TcdSetTransferConfig(tcd, &transferConfig, NULL); - EDMA_TcdEnableInterrupts(tcd, (uint32_t)kEDMA_MajorInterruptEnable); -#endif - linkTcd = tcd; - } - else - { - /* User is only transmitting data with no required commands, so this transfer can stand alone. */ - EDMA_SetTransferConfig(handle->tx->base, handle->tx->channel, &transferConfig, NULL); - EDMA_EnableChannelInterrupts(handle->tx->base, handle->tx->channel, (uint32_t)kEDMA_MajorInterruptEnable); - } - } - else if (hasReceiveData) - { - uint32_t *srcAddr = (uint32_t *)transfer->data; - /* Set up data receive. */ - transferConfig.srcAddr = (uint32_t)LPI2C_MasterGetRxFifoAddress(base); - transferConfig.destAddr = (uint32_t)srcAddr; - transferConfig.srcTransferSize = kEDMA_TransferSize1Bytes; - transferConfig.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfig.srcOffset = 0; - transferConfig.destOffset = (int16_t)sizeof(uint8_t); - transferConfig.minorLoopBytes = sizeof(uint8_t); /* TODO optimize to empty fifo */ - transferConfig.majorLoopCounts = transfer->dataSize; - - /* Store the initially configured eDMA minor byte transfer count into the LPI2C handle */ - handle->nbytes = (uint8_t)transferConfig.minorLoopBytes; - - if ((FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base) != 0) || (0U == commandCount)) - { - /* We can put this receive transfer on its own DMA channel. */ - EDMA_SetTransferConfig(handle->rx->base, handle->rx->channel, &transferConfig, NULL); - EDMA_EnableChannelInterrupts(handle->rx->base, handle->rx->channel, (uint32_t)kEDMA_MajorInterruptEnable); - } - else - { - /* For shared rx/tx DMA requests, when there are commands, create a software TCD of - enabling rx dma and disabling tx dma, which will be chained onto the commands transfer, - and create another software TCD of transfering data and chain it onto the last TCD. - Notice that in this situation assume tx/rx uses same channel */ -#if defined FSL_EDMA_DRIVER_EDMA4 && FSL_EDMA_DRIVER_EDMA4 - EDMA_TcdResetExt(handle->rx->base, tcd); - EDMA_TcdSetTransferConfigExt(handle->rx->base, tcd, &transferConfig, NULL); - EDMA_TcdEnableInterruptsExt(handle->rx->base, tcd, (uint32_t)kEDMA_MajorInterruptEnable); -#else - EDMA_TcdReset(tcd); - EDMA_TcdSetTransferConfig(tcd, &transferConfig, NULL); - EDMA_TcdEnableInterrupts(tcd, (uint32_t)kEDMA_MajorInterruptEnable); -#endif - - transferConfig.srcAddr = (uint32_t)&lpi2c_edma_RecSetting; - transferConfig.destAddr = (uint32_t) & (base->MDER); - transferConfig.srcTransferSize = kEDMA_TransferSize1Bytes; - transferConfig.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfig.srcOffset = 0; - transferConfig.destOffset = (int16_t)sizeof(uint8_t); - transferConfig.minorLoopBytes = sizeof(uint8_t); - transferConfig.majorLoopCounts = 1; - - edma_tcd_t *tcdSetRxClearTxDMA = (edma_tcd_t *)((uint32_t)(&handle->tcds[2]) & (~ALIGN_TCD_SIZE_MASK)); -#if defined FSL_EDMA_DRIVER_EDMA4 && FSL_EDMA_DRIVER_EDMA4 - EDMA_TcdResetExt(handle->rx->base, tcdSetRxClearTxDMA); - EDMA_TcdSetTransferConfigExt(handle->rx->base, tcdSetRxClearTxDMA, &transferConfig, tcd); -#else - EDMA_TcdReset(tcdSetRxClearTxDMA); - EDMA_TcdSetTransferConfig(tcdSetRxClearTxDMA, &transferConfig, tcd); -#endif - linkTcd = tcdSetRxClearTxDMA; - } - } - else - { - /* No data to send */ - } - - /* Set up commands transfer. */ - if (commandCount != 0U) - { - transferConfig.srcAddr = (uint32_t)handle->commandBuffer; - transferConfig.destAddr = (uint32_t)LPI2C_MasterGetTxFifoAddress(base); - transferConfig.srcTransferSize = kEDMA_TransferSize2Bytes; - transferConfig.destTransferSize = kEDMA_TransferSize2Bytes; - transferConfig.srcOffset = (int16_t)sizeof(uint16_t); - transferConfig.destOffset = 0; - transferConfig.minorLoopBytes = sizeof(uint16_t); /* TODO optimize to fill fifo */ - transferConfig.majorLoopCounts = commandCount; - - EDMA_SetTransferConfig(handle->tx->base, handle->tx->channel, &transferConfig, linkTcd); - } - - /* Start DMA transfer. */ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpi2c_edma_c_ref_2$ - */ - if (hasReceiveData || (0 == FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base))) - { - EDMA_StartTransfer(handle->rx); - } - /* - * $Branch Coverage Justification$ - * $ref fsl_lpi2c_edma_c_ref_2$ - */ - if ((hasSendData || (commandCount != 0U)) && (FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base) != 0)) - { - EDMA_StartTransfer(handle->tx); - } - - /* Enable DMA in both directions. This actually kicks of the transfer. */ - LPI2C_MasterEnableDMA(base, true, true); - - /* Enable all LPI2C master interrupts */ - LPI2C_MasterEnableInterrupts(base, - (uint32_t)kLPI2C_MasterArbitrationLostFlag | (uint32_t)kLPI2C_MasterNackDetectFlag | - (uint32_t)kLPI2C_MasterPinLowTimeoutFlag | (uint32_t)kLPI2C_MasterFifoErrFlag); - - return result; -} - -/*! - * brief Returns number of bytes transferred so far. - * - * param base The LPI2C peripheral base address. - * param handle Pointer to the LPI2C master driver handle. - * param[out] count Number of bytes transferred so far by the non-blocking transaction. - * retval #kStatus_Success - * retval #kStatus_NoTransferInProgress There is not a DMA transaction currently in progress. - */ -status_t LPI2C_MasterTransferGetCountEDMA(LPI2C_Type *base, lpi2c_master_edma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (!handle->isBusy) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - uint32_t remaining = handle->transfer.dataSize; - - /* If the DMA is still on a commands transfer that chains to the actual data transfer, */ - /* we do nothing and return the number of transferred bytes as zero. */ - if (EDMA_GetNextTCDAddress(handle->tx) == 0U) - { - if (handle->transfer.direction == kLPI2C_Write) - { - remaining = - (uint32_t)handle->nbytes * EDMA_GetRemainingMajorLoopCount(handle->tx->base, handle->tx->channel); - } - else - { - remaining = - (uint32_t)handle->nbytes * EDMA_GetRemainingMajorLoopCount(handle->rx->base, handle->rx->channel); - } - } - - *count = handle->transfer.dataSize - remaining; - - return kStatus_Success; -} - -/*! - * brief Terminates a non-blocking LPI2C master transmission early. - * - * note It is not safe to call this function from an IRQ handler that has a higher priority than the - * eDMA peripheral's IRQ priority. - * - * param base The LPI2C peripheral base address. - * param handle Pointer to the LPI2C master driver handle. - * retval #kStatus_Success A transaction was successfully aborted. - * retval #kStatus_LPI2C_Idle There is not a DMA transaction currently in progress. - */ -status_t LPI2C_MasterTransferAbortEDMA(LPI2C_Type *base, lpi2c_master_edma_handle_t *handle) -{ - /* Catch when there is not an active transfer. */ - if (!handle->isBusy) - { - return kStatus_LPI2C_Idle; - } - - /* Terminate DMA transfers. */ - EDMA_AbortTransfer(handle->rx); - if (FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base) != 0) - { - EDMA_AbortTransfer(handle->tx); - } - - /* Reset fifos. */ - base->MCR |= LPI2C_MCR_RRF_MASK | LPI2C_MCR_RTF_MASK; - - /* Disable LPI2C interrupts. */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - - /* If master is still busy and has not send out stop signal yet. */ - if ((LPI2C_MasterGetStatusFlags(base) & - ((uint32_t)kLPI2C_MasterStopDetectFlag | (uint32_t)kLPI2C_MasterBusyFlag)) == (uint32_t)kLPI2C_MasterBusyFlag) - { - /* Send a stop command to finalize the transfer. */ - base->MTDR = (uint32_t)kStopCmd; - } - - /* Reset handle. */ - handle->isBusy = false; - - return kStatus_Success; -} - -static void LPI2C_MasterEDMACallback(edma_handle_t *dmaHandle, void *userData, bool isTransferDone, uint32_t tcds) -{ - lpi2c_master_edma_handle_t *handle = (lpi2c_master_edma_handle_t *)userData; - - if (NULL == handle) - { - return; - } - - /* Check for errors. */ - status_t result = LPI2C_MasterCheckAndClearError(handle->base, LPI2C_MasterGetStatusFlags(handle->base)); - - /* Done with this transaction. */ - handle->isBusy = false; - - if (0U == (handle->transfer.flags & (uint32_t)kLPI2C_TransferNoStopFlag)) - { - /* Send a stop command to finalize the transfer. */ - handle->base->MTDR = (uint32_t)kStopCmd; - } - - /* Invoke callback. */ - if (handle->completionCallback != NULL) - { - handle->completionCallback(handle->base, handle, result, handle->userData); - } -} - -static void LPI2C_MasterTransferEdmaHandleIRQ(LPI2C_Type *base, void *lpi2cMasterEdmaHandle) -{ - assert(lpi2cMasterEdmaHandle != NULL); - - lpi2c_master_edma_handle_t *handle = (lpi2c_master_edma_handle_t *)lpi2cMasterEdmaHandle; - uint32_t status = LPI2C_MasterGetStatusFlags(base); - status_t result = kStatus_Success; - - /* Terminate DMA transfers. */ - EDMA_AbortTransfer(handle->rx); - if (FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base) != 0) - { - EDMA_AbortTransfer(handle->tx); - } - - /* Done with this transaction. */ - handle->isBusy = false; - - /* Disable LPI2C interrupts. */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - - /* Check error status */ - if (0U != (status & (uint32_t)kLPI2C_MasterPinLowTimeoutFlag)) - { - result = kStatus_LPI2C_PinLowTimeout; - } - /* - * $Branch Coverage Justification$ - * $ref fsl_lpi2c_edma_c_ref_1$ - */ - else if (0U != (status & (uint32_t)kLPI2C_MasterArbitrationLostFlag)) - { - result = kStatus_LPI2C_ArbitrationLost; - } - else if (0U != (status & (uint32_t)kLPI2C_MasterNackDetectFlag)) - { - result = kStatus_LPI2C_Nak; - } - else if (0U != (status & (uint32_t)kLPI2C_MasterFifoErrFlag)) - { - result = kStatus_LPI2C_FifoError; - } - else - { - ; /* Intentional empty */ - } - - /* Clear error status. */ - (void)LPI2C_MasterCheckAndClearError(base, status); - - /* Send stop flag if needed */ - if (0U == (handle->transfer.flags & (uint32_t)kLPI2C_TransferNoStopFlag)) - { - status = LPI2C_MasterGetStatusFlags(base); - /* If bus is still busy and the master has not generate stop flag */ - if ((status & ((uint32_t)kLPI2C_MasterBusBusyFlag | (uint32_t)kLPI2C_MasterStopDetectFlag)) == - (uint32_t)kLPI2C_MasterBusBusyFlag) - { - /* Send a stop command to finalize the transfer. */ - handle->base->MTDR = (uint32_t)kStopCmd; - } - } - - /* Invoke callback. */ - if (handle->completionCallback != NULL) - { - handle->completionCallback(base, handle, result, handle->userData); - } -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpi2c_edma.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpi2c_edma.h deleted file mode 100644 index 66da36b866d..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpi2c_edma.h +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LPI2C_EDMA_H_ -#define FSL_LPI2C_EDMA_H_ - -#include "fsl_lpi2c.h" -#include "fsl_edma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @name Driver version - * @{ - */ -/*! @brief LPI2C EDMA driver version. */ -#define FSL_LPI2C_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 4, 2)) -/*! @} */ - -/*! - * @addtogroup lpi2c_master_edma_driver - * @{ - */ - -/* Forward declaration of the transfer descriptor and handle typedefs. */ -/*! @brief LPI2C master EDMA handle of the transfer. */ -typedef struct _lpi2c_master_edma_handle lpi2c_master_edma_handle_t; - -/*! - * @brief Master DMA completion callback function pointer type. - * - * This callback is used only for the non-blocking master transfer API. Specify the callback you wish to use - * in the call to LPI2C_MasterCreateEDMAHandle(). - * - * @param base The LPI2C peripheral base address. - * @param handle Handle associated with the completed transfer. - * @param completionStatus Either kStatus_Success or an error code describing how the transfer completed. - * @param userData Arbitrary pointer-sized value passed from the application. - */ -typedef void (*lpi2c_master_edma_transfer_callback_t)(LPI2C_Type *base, - lpi2c_master_edma_handle_t *handle, - status_t completionStatus, - void *userData); - -/*! - * @brief Driver handle for master DMA APIs. - * @note The contents of this structure are private and subject to change. - */ -struct _lpi2c_master_edma_handle -{ - LPI2C_Type *base; /*!< LPI2C base pointer. */ - bool isBusy; /*!< Transfer state machine current state. */ - uint8_t nbytes; /*!< eDMA minor byte transfer count initially configured. */ - uint16_t commandBuffer[10]; /*!< LPI2C command sequence. When all 10 command words are used: - Start&addr&write[1 word] + subaddr[4 words] + restart&addr&read[1 word] + receive&Size[4 words] */ - lpi2c_master_transfer_t transfer; /*!< Copy of the current transfer info. */ - lpi2c_master_edma_transfer_callback_t completionCallback; /*!< Callback function pointer. */ - void *userData; /*!< Application data passed to callback. */ - edma_handle_t *rx; /*!< Handle for receive DMA channel. */ - edma_handle_t *tx; /*!< Handle for transmit DMA channel. */ - edma_tcd_t tcds[3]; /*!< Software TCD. Three are allocated to provide enough room to align to 32-bytes. */ -}; - -/*! @} */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @addtogroup lpi2c_master_edma_driver - * @{ - */ - -/*! - * @name Master DMA - * @{ - */ - -/*! - * @brief Create a new handle for the LPI2C master DMA APIs. - * - * The creation of a handle is for use with the DMA APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the LPI2C_MasterTransferAbortEDMA() API shall be called. - * - * For devices where the LPI2C send and receive DMA requests are OR'd together, the @a txDmaHandle - * parameter is ignored and may be set to NULL. - * - * @param base The LPI2C peripheral base address. - * @param[out] handle Pointer to the LPI2C master driver handle. - * @param rxDmaHandle Handle for the eDMA receive channel. Created by the user prior to calling this function. - * @param txDmaHandle Handle for the eDMA transmit channel. Created by the user prior to calling this function. - * @param callback User provided pointer to the asynchronous callback function. - * @param userData User provided pointer to the application callback data. - */ -void LPI2C_MasterCreateEDMAHandle(LPI2C_Type *base, - lpi2c_master_edma_handle_t *handle, - edma_handle_t *rxDmaHandle, - edma_handle_t *txDmaHandle, - lpi2c_master_edma_transfer_callback_t callback, - void *userData); - -/*! - * @brief Performs a non-blocking DMA-based transaction on the I2C bus. - * - * The callback specified when the @a handle was created is invoked when the transaction has - * completed. - * - * @param base The LPI2C peripheral base address. - * @param handle Pointer to the LPI2C master driver handle. - * @param transfer The pointer to the transfer descriptor. - * @retval kStatus_Success The transaction was started successfully. - * @retval #kStatus_LPI2C_Busy Either another master is currently utilizing the bus, or another DMA - * transaction is already in progress. - */ -status_t LPI2C_MasterTransferEDMA(LPI2C_Type *base, - lpi2c_master_edma_handle_t *handle, - lpi2c_master_transfer_t *transfer); - -/*! - * @brief Returns number of bytes transferred so far. - * - * @param base The LPI2C peripheral base address. - * @param handle Pointer to the LPI2C master driver handle. - * @param[out] count Number of bytes transferred so far by the non-blocking transaction. - * @retval kStatus_Success - * @retval kStatus_NoTransferInProgress There is not a DMA transaction currently in progress. - */ -status_t LPI2C_MasterTransferGetCountEDMA(LPI2C_Type *base, lpi2c_master_edma_handle_t *handle, size_t *count); - -/*! - * @brief Terminates a non-blocking LPI2C master transmission early. - * - * @note It is not safe to call this function from an IRQ handler that has a higher priority than the - * eDMA peripheral's IRQ priority. - * - * @param base The LPI2C peripheral base address. - * @param handle Pointer to the LPI2C master driver handle. - * @retval kStatus_Success A transaction was successfully aborted. - * @retval #kStatus_LPI2C_Idle There is not a DMA transaction currently in progress. - */ -status_t LPI2C_MasterTransferAbortEDMA(LPI2C_Type *base, lpi2c_master_edma_handle_t *handle); - -/*! @} */ - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -#endif /* FSL_LPI2C_EDMA_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpspi.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpspi.c deleted file mode 100644 index edf955ea255..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpspi.c +++ /dev/null @@ -1,2604 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022, 2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpspi.h" -/* - * $Coverage Justification Reference$ - * - * $Justification fsl_lpspi_c_ref_1$ - * The default branch cannot be executed in any circumstances, it is only added to avoid MISRA violation. - * - * $Justification fsl_lpspi_c_ref_2$ - * The FIFO was emptied before the check and there was no writing after the FIFO was emptied, so the obtained FIFO count - * is 0, and the #kStatus_LPSPI_Timeout cannot be obtained.(will improve) - * - * $Justification fsl_lpspi_c_ref_3$ - * The fifosize is determined by the hardware. - * - * $Justification fsl_lpspi_c_ref_4$ - * If an interrupt is generated by this error, the corresponding interrupt bit must be set.(will improve) - * - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpspi" -#endif - -#if defined(LPSPI_RSTS) -#define LPSPI_RESETS_ARRAY LPSPI_RSTS -#endif - -/*! - * @brief Default watermark values. - * - * The default watermarks are set to zero. - */ -enum _lpspi_default_watermarks -{ - kLpspiDefaultTxWatermark = 0, - kLpspiDefaultRxWatermark = 0, -}; - -/* - * CR |= LPSPI_CR_RRF_MASK | LPSPI_CR_RTF_MASK; - base->IER = 0U; - base->CR = 0U; - - /* Disable LPSPI first */ - LPSPI_Enable(base, false); - - /* Set LPSPI to master */ - LPSPI_SetMasterSlaveMode(base, kLPSPI_Master); - - /* Set specific PCS to active high or low */ - LPSPI_SetOnePcsPolarity(base, masterConfig->whichPcs, masterConfig->pcsActiveHighOrLow); - - /* Set Configuration Register 1 related setting.*/ - base->CFGR1 = (base->CFGR1 & ~(LPSPI_CFGR1_OUTCFG_MASK | LPSPI_CFGR1_PINCFG_MASK | LPSPI_CFGR1_NOSTALL_MASK | - LPSPI_CFGR1_SAMPLE_MASK)) | - LPSPI_CFGR1_OUTCFG(masterConfig->dataOutConfig) | LPSPI_CFGR1_PINCFG(masterConfig->pinCfg) | -#if !(defined(FSL_FEATURE_LPSPI_HAS_NO_PCSCFG) && FSL_FEATURE_LPSPI_HAS_NO_PCSCFG) - LPSPI_CFGR1_PCSCFG(masterConfig->pcsFunc) | -#endif - LPSPI_CFGR1_NOSTALL(0) | LPSPI_CFGR1_SAMPLE((uint32_t)masterConfig->enableInputDelay); - - if ((masterConfig->pinCfg == kLPSPI_SdiInSdiOut) || (masterConfig->pinCfg == kLPSPI_SdoInSdoOut)) - { - base->CFGR1 |= LPSPI_CFGR1_OUTCFG_MASK; - } - /* Set baudrate and delay times*/ - (void)LPSPI_MasterSetBaudRate(base, masterConfig->baudRate, srcClock_Hz, &tcrPrescaleValue); - - /* Set default watermarks */ - LPSPI_SetFifoWatermarks(base, (uint32_t)kLpspiDefaultTxWatermark, (uint32_t)kLpspiDefaultRxWatermark); - - /* Set Transmit Command Register*/ - base->TCR = LPSPI_TCR_CPOL(masterConfig->cpol) | LPSPI_TCR_CPHA(masterConfig->cpha) | - LPSPI_TCR_LSBF(masterConfig->direction) | LPSPI_TCR_FRAMESZ(masterConfig->bitsPerFrame - 1U) | - LPSPI_TCR_PRESCALE(tcrPrescaleValue) | LPSPI_TCR_PCS(masterConfig->whichPcs); - - LPSPI_Enable(base, true); - - (void)LPSPI_MasterSetDelayTimes(base, masterConfig->pcsToSckDelayInNanoSec, kLPSPI_PcsToSck, srcClock_Hz); - (void)LPSPI_MasterSetDelayTimes(base, masterConfig->lastSckToPcsDelayInNanoSec, kLPSPI_LastSckToPcs, srcClock_Hz); - (void)LPSPI_MasterSetDelayTimes(base, masterConfig->betweenTransferDelayInNanoSec, kLPSPI_BetweenTransfer, - srcClock_Hz); - - LPSPI_SetDummyData(base, LPSPI_DUMMY_DATA); -} - -/*! - * brief Sets the lpspi_master_config_t structure to default values. - * - * This API initializes the configuration structure for LPSPI_MasterInit(). - * The initialized structure can remain unchanged in LPSPI_MasterInit(), or can be modified - * before calling the LPSPI_MasterInit(). - * Example: - * code - * lpspi_master_config_t masterConfig; - * LPSPI_MasterGetDefaultConfig(&masterConfig); - * endcode - * param masterConfig pointer to lpspi_master_config_t structure - */ -void LPSPI_MasterGetDefaultConfig(lpspi_master_config_t *masterConfig) -{ - assert(masterConfig != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(masterConfig, 0, sizeof(*masterConfig)); - - masterConfig->baudRate = 500000; - masterConfig->bitsPerFrame = 8; - masterConfig->cpol = kLPSPI_ClockPolarityActiveHigh; - masterConfig->cpha = kLPSPI_ClockPhaseFirstEdge; - masterConfig->direction = kLPSPI_MsbFirst; -#if !(defined(FSL_FEATURE_LPSPI_HAS_NO_PCSCFG) && FSL_FEATURE_LPSPI_HAS_NO_PCSCFG) - masterConfig->pcsFunc = kLPSPI_PcsAsCs; -#endif - - masterConfig->pcsToSckDelayInNanoSec = (1000000000U / masterConfig->baudRate) / 2U; - masterConfig->lastSckToPcsDelayInNanoSec = (1000000000U / masterConfig->baudRate) / 2U; - masterConfig->betweenTransferDelayInNanoSec = (1000000000U / masterConfig->baudRate) / 2U; - - masterConfig->whichPcs = kLPSPI_Pcs0; - masterConfig->pcsActiveHighOrLow = kLPSPI_PcsActiveLow; - - masterConfig->pinCfg = kLPSPI_SdiInSdoOut; - masterConfig->dataOutConfig = kLpspiDataOutRetained; - - masterConfig->enableInputDelay = false; -} - -/*! - * brief LPSPI slave configuration. - * - * param base LPSPI peripheral address. - * param slaveConfig Pointer to a structure lpspi_slave_config_t. - */ -void LPSPI_SlaveInit(LPSPI_Type *base, const lpspi_slave_config_t *slaveConfig) -{ - assert(slaveConfig != NULL); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - - uint32_t instance = LPSPI_GetInstance(base); - /* Enable LPSPI clock */ - (void)CLOCK_EnableClock(s_lpspiClocks[instance]); - -#if defined(LPSPI_PERIPH_CLOCKS) - (void)CLOCK_EnableClock(s_LpspiPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(LPSPI_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_lpspiResets[LPSPI_GetInstance(base)]); -#endif - - LPSPI_SetMasterSlaveMode(base, kLPSPI_Slave); - - LPSPI_SetOnePcsPolarity(base, slaveConfig->whichPcs, slaveConfig->pcsActiveHighOrLow); - - base->CFGR1 = (base->CFGR1 & ~(LPSPI_CFGR1_OUTCFG_MASK | LPSPI_CFGR1_PINCFG_MASK)) | - LPSPI_CFGR1_OUTCFG(slaveConfig->dataOutConfig) | LPSPI_CFGR1_PINCFG(slaveConfig->pinCfg); - - if ((slaveConfig->pinCfg == kLPSPI_SdiInSdiOut) || (slaveConfig->pinCfg == kLPSPI_SdoInSdoOut)) - { - base->CFGR1 |= LPSPI_CFGR1_OUTCFG_MASK; - } - - LPSPI_SetFifoWatermarks(base, (uint32_t)kLpspiDefaultTxWatermark, (uint32_t)kLpspiDefaultRxWatermark); - - base->TCR = LPSPI_TCR_CPOL(slaveConfig->cpol) | LPSPI_TCR_CPHA(slaveConfig->cpha) | - LPSPI_TCR_LSBF(slaveConfig->direction) | LPSPI_TCR_FRAMESZ(slaveConfig->bitsPerFrame - 1U); - - /* This operation will set the dummy data for edma transfer, no effect in interrupt way. */ - LPSPI_SetDummyData(base, LPSPI_DUMMY_DATA); - - LPSPI_Enable(base, true); -} - -/*! - * brief Sets the lpspi_slave_config_t structure to default values. - * - * This API initializes the configuration structure for LPSPI_SlaveInit(). - * The initialized structure can remain unchanged in LPSPI_SlaveInit() or can be modified - * before calling the LPSPI_SlaveInit(). - * Example: - * code - * lpspi_slave_config_t slaveConfig; - * LPSPI_SlaveGetDefaultConfig(&slaveConfig); - * endcode - * param slaveConfig pointer to lpspi_slave_config_t structure. - */ -void LPSPI_SlaveGetDefaultConfig(lpspi_slave_config_t *slaveConfig) -{ - assert(slaveConfig != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(slaveConfig, 0, sizeof(*slaveConfig)); - - slaveConfig->bitsPerFrame = 8; /*!< Bits per frame, minimum 8, maximum 4096.*/ - slaveConfig->cpol = kLPSPI_ClockPolarityActiveHigh; /*!< Clock polarity. */ - slaveConfig->cpha = kLPSPI_ClockPhaseFirstEdge; /*!< Clock phase. */ - slaveConfig->direction = kLPSPI_MsbFirst; /*!< MSB or LSB data shift direction. */ - - slaveConfig->whichPcs = kLPSPI_Pcs0; /*!< Desired Peripheral Chip Select (pcs) */ - slaveConfig->pcsActiveHighOrLow = kLPSPI_PcsActiveLow; /*!< Desired PCS active high or low */ - - slaveConfig->pinCfg = kLPSPI_SdiInSdoOut; - slaveConfig->dataOutConfig = kLpspiDataOutRetained; -} - -/*! - * brief Restores the LPSPI peripheral to reset state. Note that this function - * sets all registers to reset state. As a result, the LPSPI module can't work after calling - * this API. - * param base LPSPI peripheral address. - */ -void LPSPI_Reset(LPSPI_Type *base) -{ - /* Reset all internal logic and registers, except the Control Register. Remains set until cleared by software.*/ - base->CR |= LPSPI_CR_RST_MASK; - - /* Software reset doesn't reset the CR, so manual reset the FIFOs */ - base->CR |= LPSPI_CR_RRF_MASK | LPSPI_CR_RTF_MASK; - - /* Master logic is not reset and module is disabled.*/ - base->CR = 0x00U; -} - -/*! - * brief De-initializes the LPSPI peripheral. Call this API to disable the LPSPI clock. - * param base LPSPI peripheral address. - */ -void LPSPI_Deinit(LPSPI_Type *base) -{ - /* Reset to default value */ - LPSPI_Reset(base); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - - uint32_t instance = LPSPI_GetInstance(base); - /* Enable LPSPI clock */ - (void)CLOCK_DisableClock(s_lpspiClocks[instance]); - -#if defined(LPSPI_PERIPH_CLOCKS) - (void)CLOCK_DisableClock(s_LpspiPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -static void LPSPI_SetOnePcsPolarity(LPSPI_Type *base, - lpspi_which_pcs_t pcs, - lpspi_pcs_polarity_config_t activeLowOrHigh) -{ - uint32_t cfgr1Value = 0; - /* Clear the PCS polarity bit */ - cfgr1Value = base->CFGR1 & ~(1UL << (LPSPI_CFGR1_PCSPOL_SHIFT + (uint32_t)pcs)); - - /* Configure the PCS polarity bit according to the activeLowOrHigh setting */ - base->CFGR1 = cfgr1Value | ((uint32_t)activeLowOrHigh << (LPSPI_CFGR1_PCSPOL_SHIFT + (uint32_t)pcs)); -} - -/*! - * brief Sets the LPSPI baud rate in bits per second. - * - * This function takes in the desired bitsPerSec (baud rate) and calculates the nearest - * possible baud rate without exceeding the desired baud rate and returns the - * calculated baud rate in bits-per-second. It requires the caller to provide - * the frequency of the module source clock (in Hertz). Note that the baud rate - * does not go into effect until the Transmit Control Register (TCR) is programmed - * with the prescale value. Hence, this function returns the prescale tcrPrescaleValue - * parameter for later programming in the TCR. The higher level - * peripheral driver should alert the user of an out of range baud rate input. - * - * Note that the LPSPI module must first be disabled before configuring this. - * Note that the LPSPI module must be configured for master mode before configuring this. - * - * param base LPSPI peripheral address. - * param baudRate_Bps The desired baud rate in bits per second. - * param srcClock_Hz Module source input clock in Hertz. - * param tcrPrescaleValue The TCR prescale value needed to program the TCR. - * return The actual calculated baud rate. This function may also return a "0" if the - * LPSPI is not configured for master mode or if the LPSPI module is not disabled. - */ - -uint32_t LPSPI_MasterSetBaudRate(LPSPI_Type *base, - uint32_t baudRate_Bps, - uint32_t srcClock_Hz, - uint32_t *tcrPrescaleValue) -{ - assert(tcrPrescaleValue != NULL); - - /* For master mode configuration only, if slave mode detected, return 0. - * Also, the LPSPI module needs to be disabled first, if enabled, return 0 - */ - if ((!LPSPI_IsMaster(base)) || ((base->CR & LPSPI_CR_MEN_MASK) != 0U)) - { - return 0U; - } - - uint32_t prescaler, bestPrescaler; - uint32_t scaler, bestScaler; - uint32_t realBaudrate, bestBaudrate; - uint32_t diff, min_diff; - uint32_t desiredBaudrate = baudRate_Bps; - - /* find combination of prescaler and scaler resulting in baudrate closest to the - * requested value - */ - min_diff = 0xFFFFFFFFU; - - /* Set to maximum divisor value bit settings so that if baud rate passed in is less - * than the minimum possible baud rate, then the SPI will be configured to the lowest - * possible baud rate - */ - bestPrescaler = 7; - bestScaler = 255; - - bestBaudrate = 0; /* required to avoid compilation warning */ - - /* In all for loops, if min_diff = 0, the exit for loop*/ - for (prescaler = 0U; prescaler < 8U; prescaler++) - { - if (min_diff == 0U) - { - break; - } - for (scaler = 0U; scaler < 256U; scaler++) - { - if (min_diff == 0U) - { - break; - } - realBaudrate = (srcClock_Hz / (s_baudratePrescaler[prescaler] * (scaler + 2U))); - - /* calculate the baud rate difference based on the conditional statement - * that states that the calculated baud rate must not exceed the desired baud rate - */ - if (desiredBaudrate >= realBaudrate) - { - diff = desiredBaudrate - realBaudrate; - if (min_diff > diff) - { - /* a better match found */ - min_diff = diff; - bestPrescaler = prescaler; - bestScaler = scaler; - bestBaudrate = realBaudrate; - } - } - } - } - - /* Write the best baud rate scalar to the CCR. - * Note, no need to check for error since we've already checked to make sure the module is - * disabled and in master mode. Also, there is a limit on the maximum divider so we will not - * exceed this. - */ -#if defined(FSL_FEATURE_LPSPI_HAS_CCR1) && FSL_FEATURE_LPSPI_HAS_CCR1 - /* When CCR1 is present, the CCR[DBT] and CCR[SCKDIV] is write only, all read will return 0 - The real DBT and SCKDIV can be obtained in CCR1, CCR[DBT]=CCR1[SCKSCK] and CCR[SCKDIV]=CCR1[SCKHLD]+CCR1[SCKSET] - So when changing either CCR[DBT] or CCR[SCKDIV] make sure the other value is not overwritten by 0 */ - base->CCR = base->CCR | LPSPI_CCR_DBT((base->CCR1 & LPSPI_CCR1_SCKSCK_MASK) >> LPSPI_CCR1_SCKSCK_SHIFT) | - LPSPI_CCR_SCKDIV(bestScaler); -#else - base->CCR = (base->CCR & ~LPSPI_CCR_SCKDIV_MASK) | LPSPI_CCR_SCKDIV(bestScaler); -#endif /* FSL_FEATURE_LPSPI_HAS_CCR1 */ - - /* return the best prescaler value for user to use later */ - *tcrPrescaleValue = bestPrescaler; - - /* return the actual calculated baud rate */ - return bestBaudrate; -} - -/*! - * brief Manually configures a specific LPSPI delay parameter (module must be disabled to - * change the delay values). - * - * This function configures the following: - * SCK to PCS delay, or - * PCS to SCK delay, or - * The configurations must occur between the transfer delay. - * - * The delay names are available in type lpspi_delay_type_t. - * - * The user passes the desired delay along with the delay value. - * This allows the user to directly set the delay values if they have - * pre-calculated them or if they simply wish to manually increment the value. - * - * Note that the LPSPI module must first be disabled before configuring this. - * Note that the LPSPI module must be configured for master mode before configuring this. - * - * param base LPSPI peripheral address. - * param scaler The 8-bit delay value 0x00 to 0xFF (255). - * param whichDelay The desired delay to configure, must be of type lpspi_delay_type_t. - */ -void LPSPI_MasterSetDelayScaler(LPSPI_Type *base, uint32_t scaler, lpspi_delay_type_t whichDelay) -{ - /*These settings are only relevant in master mode */ -#if defined(FSL_FEATURE_LPSPI_HAS_CCR1) && FSL_FEATURE_LPSPI_HAS_CCR1 - /* When CCR1 is present, the CCR[DBT] and CCR[SCKDIV] is write only, all read will return 0 - The real DBT and SCKDIV can be obtained in CCR1, CCR[DBT]=CCR1[SCKSCK] and CCR[SCKDIV]=CCR1[SCKHLD]+CCR1[SCKSET] - So when changing either CCR[DBT] or CCR[SCKDIV] make sure the other value is not overwritten by 0 */ - uint32_t dbt = (base->CCR1 & LPSPI_CCR1_SCKSCK_MASK) >> LPSPI_CCR1_SCKSCK_SHIFT; - uint32_t sckdiv = (base->CCR1 & LPSPI_CCR1_SCKHLD_MASK) >> LPSPI_CCR1_SCKHLD_SHIFT; - sckdiv += (base->CCR1 & LPSPI_CCR1_SCKSET_MASK) >> LPSPI_CCR1_SCKSET_SHIFT; - switch (whichDelay) - { - case kLPSPI_PcsToSck: - base->CCR = (base->CCR & (~LPSPI_CCR_PCSSCK_MASK)) | LPSPI_CCR_PCSSCK(scaler) | LPSPI_CCR_DBT(dbt) | - LPSPI_CCR_SCKDIV(sckdiv); - - break; - case kLPSPI_LastSckToPcs: - base->CCR = (base->CCR & (~LPSPI_CCR_SCKPCS_MASK)) | LPSPI_CCR_SCKPCS(scaler) | LPSPI_CCR_DBT(dbt) | - LPSPI_CCR_SCKDIV(sckdiv); - - break; - case kLPSPI_BetweenTransfer: - base->CCR = base->CCR | LPSPI_CCR_DBT(scaler) | LPSPI_CCR_SCKDIV(sckdiv); -#else - switch (whichDelay) - { - case kLPSPI_PcsToSck: - base->CCR = (base->CCR & (~LPSPI_CCR_PCSSCK_MASK)) | LPSPI_CCR_PCSSCK(scaler); - - break; - case kLPSPI_LastSckToPcs: - base->CCR = (base->CCR & (~LPSPI_CCR_SCKPCS_MASK)) | LPSPI_CCR_SCKPCS(scaler); - - break; - case kLPSPI_BetweenTransfer: - base->CCR = (base->CCR & (~LPSPI_CCR_DBT_MASK)) | LPSPI_CCR_DBT(scaler); -#endif /* FSL_FEATURE_LPSPI_HAS_CCR1 */ - break; - default: - assert(false); - break; - } -} - -/*! - * brief Calculates the delay based on the desired delay input in nanoseconds (module must be - * disabled to change the delay values). - * - * This function calculates the values for the following: - * SCK to PCS delay, or - * PCS to SCK delay, or - * The configurations must occur between the transfer delay. - * - * The delay names are available in type lpspi_delay_type_t. - * - * The user passes the desired delay and the desired delay value in - * nano-seconds. The function calculates the value needed for the desired delay parameter - * and returns the actual calculated delay because an exact delay match may not be possible. In this - * case, the closest match is calculated without going below the desired delay value input. - * It is possible to input a very large delay value that exceeds the capability of the part, in - * which case the maximum supported delay is returned. It is up to the higher level - * peripheral driver to alert the user of an out of range delay input. - * - * Note that the LPSPI module must be configured for master mode before configuring this. And note that - * the delayTime = LPSPI_clockSource / (PRESCALE * Delay_scaler). - * - * param base LPSPI peripheral address. - * param delayTimeInNanoSec The desired delay value in nano-seconds. - * param whichDelay The desired delay to configuration, which must be of type lpspi_delay_type_t. - * param srcClock_Hz Module source input clock in Hertz. - * return actual Calculated delay value in nano-seconds. - */ -uint32_t LPSPI_MasterSetDelayTimes(LPSPI_Type *base, - uint32_t delayTimeInNanoSec, - lpspi_delay_type_t whichDelay, - uint32_t srcClock_Hz) -{ - uint64_t realDelay, bestDelay; - uint32_t scaler, bestScaler; - uint32_t diff, min_diff; - uint64_t initialDelayNanoSec; - uint32_t clockDividedPrescaler; - - /* For delay between transfer, an additional scaler value is needed */ - uint32_t additionalScaler = 0; - - /*As the RM note, the LPSPI baud rate clock is itself divided by the PRESCALE setting, which can vary between - * transfers.*/ - clockDividedPrescaler = - srcClock_Hz / s_baudratePrescaler[(base->TCR & LPSPI_TCR_PRESCALE_MASK) >> LPSPI_TCR_PRESCALE_SHIFT]; - - /* Find combination of prescaler and scaler resulting in the delay closest to the requested value.*/ - min_diff = 0xFFFFFFFFU; - - /* Initialize scaler to max value to generate the max delay */ - bestScaler = 0xFFU; - - /* Calculate the initial (min) delay and maximum possible delay based on the specific delay as - * the delay divisors are slightly different based on which delay we are configuring. - */ - if (whichDelay == kLPSPI_BetweenTransfer) - { - /* First calculate the initial, default delay, note min delay is 2 clock cycles. Due to large size of - calculated values (uint64_t), we need to break up the calculation into several steps to ensure - accurate calculated results - */ - initialDelayNanoSec = 1000000000U; - initialDelayNanoSec *= 2U; - initialDelayNanoSec /= clockDividedPrescaler; - - /* Calculate the maximum delay */ - bestDelay = 1000000000U; - bestDelay *= 257U; /* based on DBT+2, or 255 + 2 */ - bestDelay /= clockDividedPrescaler; - - additionalScaler = 1U; - } - else - { - /* First calculate the initial, default delay, min delay is 1 clock cycle. Due to large size of calculated - values (uint64_t), we need to break up the calculation into several steps to ensure accurate calculated - results. - */ - initialDelayNanoSec = 1000000000U; - initialDelayNanoSec /= clockDividedPrescaler; - - /* Calculate the maximum delay */ - bestDelay = 1000000000U; - bestDelay *= 256U; /* based on SCKPCS+1 or PCSSCK+1, or 255 + 1 */ - bestDelay /= clockDividedPrescaler; - - additionalScaler = 0U; - } - - /* If the initial, default delay is already greater than the desired delay, then - * set the delay to their initial value (0) and return the delay. In other words, - * there is no way to decrease the delay value further. - */ - if (initialDelayNanoSec >= delayTimeInNanoSec) - { - LPSPI_MasterSetDelayScaler(base, 0, whichDelay); - return (uint32_t)initialDelayNanoSec; - } - - /* If min_diff = 0, the exit for loop */ - for (scaler = 0U; scaler < 256U; scaler++) - { - if (min_diff == 0U) - { - break; - } - /* Calculate the real delay value as we cycle through the scaler values. - Due to large size of calculated values (uint64_t), we need to break up the - calculation into several steps to ensure accurate calculated results - */ - realDelay = 1000000000U; - realDelay *= ((uint64_t)scaler + 1UL + (uint64_t)additionalScaler); - realDelay /= clockDividedPrescaler; - - /* calculate the delay difference based on the conditional statement - * that states that the calculated delay must not be less then the desired delay - */ - if (realDelay >= delayTimeInNanoSec) - { - diff = (uint32_t)(realDelay - (uint64_t)delayTimeInNanoSec); - if (min_diff > diff) - { - /* a better match found */ - min_diff = diff; - bestScaler = scaler; - bestDelay = realDelay; - } - } - } - - /* write the best scaler value for the delay */ - LPSPI_MasterSetDelayScaler(base, bestScaler, whichDelay); - - /* return the actual calculated delay value (in ns) */ - return (uint32_t)bestDelay; -} - -/*Transactional APIs -- Master*/ - -/*! - * brief Initializes the LPSPI master handle. - * - * This function initializes the LPSPI handle, which can be used for other LPSPI transactional APIs. Usually, for a - * specified LPSPI instance, call this API once to get the initialized handle. - - * param base LPSPI peripheral address. - * param handle LPSPI handle pointer to lpspi_master_handle_t. - * param callback DSPI callback. - * param userData callback function parameter. - */ -void LPSPI_MasterTransferCreateHandle(LPSPI_Type *base, - lpspi_master_handle_t *handle, - lpspi_master_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - s_lpspiHandle[LPSPI_GetInstance(base)] = handle; - - /* Set irq handler. */ - s_lpspiMasterIsr = LPSPI_MasterTransferHandleIRQ; - - handle->callback = callback; - handle->userData = userData; -} - -/*! - * brief Check the argument for transfer . - * - * param base LPSPI peripheral address. - * param transfer the transfer struct to be used. - * param isEdma True to check for EDMA transfer, false to check interrupt non-blocking transfer - * return Return true for right and false for wrong. - */ -bool LPSPI_CheckTransferArgument(LPSPI_Type *base, lpspi_transfer_t *transfer, bool isEdma) -{ - assert(transfer != NULL); - uint32_t bitsPerFrame = ((base->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT) + 1U; - uint32_t bytesPerFrame = (bitsPerFrame + 7U) / 8U; - uint32_t temp = (base->CFGR1 & LPSPI_CFGR1_PINCFG_MASK); - /* If the transfer count is zero, then return immediately.*/ - if (transfer->dataSize == 0U) - { - return false; - } - - /* If both send buffer and receive buffer is null */ - if ((NULL == (transfer->txData)) && (NULL == (transfer->rxData))) - { - return false; - } - - /*The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4 . - *For bytesPerFrame greater than 4 situation: - *the transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not integer multiples of 4 , - *otherwise , the transfer data size can be integer multiples of bytesPerFrame. - */ - if (bytesPerFrame <= 4U) - { - if ((transfer->dataSize % bytesPerFrame) != 0U) - { - return false; - } - } - else - { - if ((bytesPerFrame % 4U) != 0U) - { - if (transfer->dataSize != bytesPerFrame) - { - return false; - } - } - else - { - if ((transfer->dataSize % bytesPerFrame) != 0U) - { - return false; - } - } - } - - /* Check if using 3-wire mode and the txData is NULL, set the output pin to tristated. */ - if ((temp == LPSPI_CFGR1_PINCFG(kLPSPI_SdiInSdiOut)) || (temp == LPSPI_CFGR1_PINCFG(kLPSPI_SdoInSdoOut))) - { - /* The 3-wire mode can't send and receive data at the same time. */ - if ((transfer->txData != NULL) && (transfer->rxData != NULL)) - { - return false; - } - } - - if (isEdma && ((bytesPerFrame % 4U) == 3U)) - { - return false; - } - - return true; -} - -static bool LPSPI_MasterTransferWriteAllTxData(LPSPI_Type *base, - lpspi_transfer_t *transfer, - lpspi_transfer_blocking_param_t *stateParams) -{ - uint8_t dummyData = g_lpspiDummyData[LPSPI_GetInstance(base)]; - uint32_t bytesPerFrame = ((base->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT) / 8U + 1U; - uint32_t txRemainingByteCount = transfer->dataSize; - bool isByteSwap = ((transfer->configFlags & (uint32_t)kLPSPI_MasterByteSwap) != 0U); - uint32_t wordToSend = - ((uint32_t)dummyData) | ((uint32_t)dummyData << 8) | ((uint32_t)dummyData << 16) | ((uint32_t)dummyData << 24); - uint32_t rxFifoMaxBytes = MIN(bytesPerFrame, 4U) * LPSPI_GetRxFifoSize(base); - uint32_t readData; - uint8_t fifo_size = LPSPI_GetRxFifoSize(base); - /*Write the TX data until txRemainingByteCount is equal to 0 */ - while (txRemainingByteCount > 0U) - { - if (txRemainingByteCount < (stateParams->bytesEachWrite)) - { - (stateParams->bytesEachWrite) = (uint8_t)txRemainingByteCount; - } - - /*Wait until TX FIFO is not full*/ -#if SPI_RETRY_TIMES - uint32_t waitTimes = SPI_RETRY_TIMES; - while ((LPSPI_GetTxFifoCount(base) == fifo_size) && ((--waitTimes) != 0U)) -#else - while (LPSPI_GetTxFifoCount(base) == fifo_size) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return false; - } -#endif - - /* To prevent rxfifo overflow, ensure transmitting and receiving are executed in parallel */ - if (((NULL == (stateParams->rxData)) || - ((stateParams->rxRemainingByteCount) - txRemainingByteCount) < rxFifoMaxBytes)) - { - if (stateParams->isTxMask) - { - /* When TCR[TXMSK]=1, transfer is initiate by writting a new command word to TCR. TCR[TXMSK] is cleared - by hardware every time when TCR[FRAMESZ] bit of data is transfered. - In this case TCR[TXMSK] should be set to initiate each transfer. */ - base->TCR |= LPSPI_TCR_TXMSK_MASK; - if (stateParams->isPcsContinuous && (txRemainingByteCount == bytesPerFrame)) - { - /* For the last piece of frame size of data, if is PCS continous mode(TCR[CONT]), TCR[CONTC] should - * be cleared to de-assert the PCS. Be sure to clear the TXMSK as well otherwise another FRAMESZ - * of data will be received. */ - base->TCR &= ~(LPSPI_TCR_CONTC_MASK | LPSPI_TCR_CONT_MASK | LPSPI_TCR_TXMSK_MASK); - } - else - { - if (!LPSPI_WaitTxFifoEmpty(base)) - { - return false; - } - } - txRemainingByteCount -= bytesPerFrame; - } - else - { - if ((stateParams->txData) != NULL) - { - if (stateParams->bytesEachWrite != 1U) - { - wordToSend = - LPSPI_CombineWriteData((stateParams->txData), (stateParams->bytesEachWrite), isByteSwap); - (stateParams->txData) += (stateParams->bytesEachWrite); - } - else - { - wordToSend = *(stateParams->txData); - (stateParams->txData) += 1U; - } - } - /* Otherwise push data to tx FIFO to initiate transfer */ - LPSPI_WriteData(base, wordToSend); - txRemainingByteCount -= (stateParams->bytesEachWrite); - } - } - - /* Check whether there is RX data in RX FIFO . Read out the RX data so that the RX FIFO would not overrun. */ - /* - * $Branch Coverage Justification$ - * Data will be transferred in the inner loop until complete, after which the interrupt will end.(will improve) - */ - if (((stateParams->rxData) != NULL) && ((stateParams->rxRemainingByteCount) != 0U)) - { - /* To ensure parallel execution in 3-wire mode, after writting 1 to TXMSK to generate clock of - bytesPerFrame's data wait until bytesPerFrame's data is received. */ - while ((stateParams->isTxMask) && (LPSPI_GetRxFifoCount(base) == 0U)) - { - } -#if SPI_RETRY_TIMES - uint32_t waitTimes = SPI_RETRY_TIMES; - while ((LPSPI_GetRxFifoCount(base) != 0U) && (--waitTimes != 0U)) -#else - while (LPSPI_GetRxFifoCount(base) != 0U) -#endif - { - readData = LPSPI_ReadData(base); - /* - * $Branch Coverage Justification$ - * rxRemainingByteCount must be an integer multiple of bytesEachRead, otherwise it cannot pass the check - * of #LPSPI_CheckTransferArgument,so it doesn't happen here.(will improve) - */ - if ((stateParams->rxRemainingByteCount) < (stateParams->bytesEachRead)) - { - (stateParams->bytesEachRead) = (uint8_t)(stateParams->rxRemainingByteCount); - } - - LPSPI_SeparateReadData((stateParams->rxData), readData, (stateParams->bytesEachRead), isByteSwap); - (stateParams->rxData) += (stateParams->bytesEachRead); - - (stateParams->rxRemainingByteCount) -= (stateParams->bytesEachRead); - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return false; - } -#endif - } - } - return true; -} - -static bool LPSPI_MasterTransferClearTCR(LPSPI_Type *base, lpspi_transfer_blocking_param_t *stateParams) -{ -#if SPI_RETRY_TIMES - uint32_t waitTimes = SPI_RETRY_TIMES; - while ((LPSPI_GetTxFifoCount(base) == LPSPI_GetRxFifoSize(base)) && (--waitTimes != 0U)) -#else - while (LPSPI_GetTxFifoCount(base) == LPSPI_GetRxFifoSize(base)) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return false; - } -#endif - base->TCR = (base->TCR & ~(LPSPI_TCR_CONTC_MASK | LPSPI_TCR_CONT_MASK)); - - return true; -} - -static bool LPSPI_MasterTransferReadDataInFifo(LPSPI_Type *base, - lpspi_transfer_t *transfer, - lpspi_transfer_blocking_param_t *stateParams) -{ - uint32_t readData; - bool isByteSwap = ((transfer->configFlags & (uint32_t)kLPSPI_MasterByteSwap) != 0U); - while ((stateParams->rxRemainingByteCount) > 0U) - { -#if SPI_RETRY_TIMES - uint32_t waitTimes = SPI_RETRY_TIMES; - while ((LPSPI_GetRxFifoCount(base) != 0U) && (--waitTimes != 0U)) -#else - while (LPSPI_GetRxFifoCount(base) != 0U) -#endif - { - readData = LPSPI_ReadData(base); - - if ((stateParams->rxRemainingByteCount) < (stateParams->bytesEachRead)) - { - (stateParams->bytesEachRead) = (uint8_t)(stateParams->rxRemainingByteCount); - } - - LPSPI_SeparateReadData((stateParams->rxData), readData, (stateParams->bytesEachRead), isByteSwap); - (stateParams->rxData) += (stateParams->bytesEachRead); - - (stateParams->rxRemainingByteCount) -= (stateParams->bytesEachRead); - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return false; - } -#endif - } - - return true; -} - -static bool LPSPI_MasterTransferReadDataInFifoNoBuf(LPSPI_Type *base, lpspi_transfer_blocking_param_t *stateParams) -{ -#if SPI_RETRY_TIMES - uint32_t waitTimes = SPI_RETRY_TIMES; - while (((LPSPI_GetStatusFlags(base) & (uint32_t)kLPSPI_TransferCompleteFlag) == 0U) && (--waitTimes != 0U)) -#else - while ((LPSPI_GetStatusFlags(base) & (uint32_t)kLPSPI_TransferCompleteFlag) == 0U) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return false; - } -#endif - return true; -} - -/*! - * brief LPSPI master transfer data using a polling method. - * - * This function transfers data using a polling method. This is a blocking function, which does not return until all - * transfers have been completed. - * - * Note: - * The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not integer multiples of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * param base LPSPI peripheral address. - * param transfer pointer to lpspi_transfer_t structure. - * return status of status_t. - */ -status_t LPSPI_MasterTransferBlocking(LPSPI_Type *base, lpspi_transfer_t *transfer) -{ - assert(transfer != NULL); - - /* Check that LPSPI is not busy.*/ - /* - * $Branch Coverage Justification$ - * MBF state setting and clearing is done by hardware, the state is too fast to be overwritten.(will improve) - */ - if ((LPSPI_GetStatusFlags(base) & (uint32_t)kLPSPI_ModuleBusyFlag) != 0U) - { - return kStatus_LPSPI_Busy; - } - LPSPI_Enable(base, false); - /* Check arguements */ - if (!LPSPI_CheckTransferArgument(base, transfer, false)) - { - return kStatus_InvalidArgument; - } - - LPSPI_FlushFifo(base, true, true); - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_AllStatusFlag); - - /* Variables */ - uint32_t whichPcs = (transfer->configFlags & LPSPI_MASTER_PCS_MASK) >> LPSPI_MASTER_PCS_SHIFT; -#if !(defined(FSL_FEATURE_LPSPI_HAS_NO_MULTI_WIDTH) && FSL_FEATURE_LPSPI_HAS_NO_MULTI_WIDTH) - uint32_t width = (transfer->configFlags & LPSPI_MASTER_WIDTH_MASK) >> LPSPI_MASTER_WIDTH_SHIFT; -#endif - uint32_t temp = (base->CFGR1 & LPSPI_CFGR1_PINCFG_MASK); - lpspi_transfer_blocking_param_t stateParams; - (void)memset(&stateParams, 0, sizeof(stateParams)); - - stateParams.txData = transfer->txData; - stateParams.rxData = transfer->rxData; - stateParams.isTxMask = false; - stateParams.rxRemainingByteCount = transfer->dataSize; - /*The TX and RX FIFO sizes are always the same*/ - uint32_t bytesPerFrame = ((base->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT) / 8U + 1U; - /* No need to configure PCS continous if the transfer byte count is smaller than frame size */ - stateParams.isPcsContinuous = (((transfer->configFlags & (uint32_t)kLPSPI_MasterPcsContinuous) != 0U) && - (bytesPerFrame < transfer->dataSize)); - - /* Mask tx data in half duplex mode */ - if (((temp == LPSPI_CFGR1_PINCFG(kLPSPI_SdiInSdiOut)) || (temp == LPSPI_CFGR1_PINCFG(kLPSPI_SdoInSdoOut))) && - (stateParams.txData == NULL)) - { - stateParams.isTxMask = true; - } - - base->CFGR1 &= (~LPSPI_CFGR1_NOSTALL_MASK); - LPSPI_Enable(base, true); - - /* Configure transfer control register. */ - base->TCR = (base->TCR & ~(LPSPI_TCR_CONT_MASK | LPSPI_TCR_CONTC_MASK | LPSPI_TCR_RXMSK_MASK | - LPSPI_TCR_TXMSK_MASK | LPSPI_TCR_PCS_MASK)) | -#if !(defined(FSL_FEATURE_LPSPI_HAS_NO_MULTI_WIDTH) && FSL_FEATURE_LPSPI_HAS_NO_MULTI_WIDTH) - LPSPI_TCR_WIDTH(width) | -#endif - LPSPI_TCR_PCS(whichPcs); - /*TCR is also shared the FIFO, so wait for TCR written.*/ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_c_ref_2$ - */ - if (!LPSPI_WaitTxFifoEmpty(base)) - { - return kStatus_LPSPI_Timeout; - } - - /* PCS should be configured separately from the other bits, otherwise it will not take effect. */ - base->TCR |= LPSPI_TCR_CONT(stateParams.isPcsContinuous) | LPSPI_TCR_CONTC(stateParams.isPcsContinuous) | - LPSPI_TCR_RXMSK(NULL == stateParams.rxData); - - /*TCR is also shared the FIFO, so wait for TCR written.*/ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_c_ref_2$ - */ - if (!LPSPI_WaitTxFifoEmpty(base)) - { - return kStatus_LPSPI_Timeout; - } - - if (bytesPerFrame <= 4U) - { - stateParams.bytesEachWrite = (uint8_t)bytesPerFrame; - stateParams.bytesEachRead = (uint8_t)bytesPerFrame; - } - else - { - stateParams.bytesEachWrite = 4U; - stateParams.bytesEachRead = 4U; - } - - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_c_ref_2$ - */ - if (false == LPSPI_MasterTransferWriteAllTxData(base, transfer, &stateParams)) - { - return kStatus_LPSPI_Timeout; - } - - if (stateParams.isPcsContinuous && !stateParams.isTxMask) - { - /* In PCS continous mode(TCR[CONT]), after write all the data in TX FIFO, TCR[CONTC] and TCR[CONT] should be - cleared to de-assert the PCS. Note that TCR register also use the TX FIFO. Also CONTC should be cleared when - tx is not masked, otherwise written to TCR register with TXMSK bit set will initiate a new transfer. */ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_c_ref_2$ - */ - if (false == LPSPI_MasterTransferClearTCR(base, &stateParams)) - { - return kStatus_LPSPI_Timeout; - } - } - - /*Read out the RX data in FIFO*/ - if (stateParams.rxData != NULL) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_c_ref_2$ - */ - if (false == LPSPI_MasterTransferReadDataInFifo(base, transfer, &stateParams)) - { - return kStatus_LPSPI_Timeout; - } - } - else - { - /* If no RX buffer, then transfer is not complete until transfer complete flag sets */ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_c_ref_2$ - */ - if (false == LPSPI_MasterTransferReadDataInFifoNoBuf(base, &stateParams)) - { - return kStatus_LPSPI_Timeout; - } - } - - return kStatus_Success; -} - -/*! - * brief LPSPI master transfer data using an interrupt method. - * - * This function transfers data using an interrupt method. This is a non-blocking function, which returns right away. - * When all data is transferred, the callback function is called. - * - * Note: - * The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not integer multiples of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * param base LPSPI peripheral address. - * param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - * param transfer pointer to lpspi_transfer_t structure. - * return status of status_t. - */ -status_t LPSPI_MasterTransferNonBlocking(LPSPI_Type *base, lpspi_master_handle_t *handle, lpspi_transfer_t *transfer) -{ - assert(handle != NULL); - assert(transfer != NULL); - - /* Check that we're not busy.*/ - if (handle->state == (uint8_t)kLPSPI_Busy) - { - return kStatus_LPSPI_Busy; - } - - LPSPI_Enable(base, false); - /* Check arguements */ - if (!LPSPI_CheckTransferArgument(base, transfer, false)) - { - return kStatus_InvalidArgument; - } - - /* Flush FIFO, clear status, disable all the interrupts. */ - LPSPI_FlushFifo(base, true, true); - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_AllStatusFlag); - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_AllInterruptEnable); - - /* Variables */ - bool isRxMask = false; - handle->isTxMask = false; - uint8_t txWatermark; - uint8_t dummyData = g_lpspiDummyData[LPSPI_GetInstance(base)]; - uint32_t tmpTimes; - uint32_t whichPcs = (transfer->configFlags & LPSPI_MASTER_PCS_MASK) >> LPSPI_MASTER_PCS_SHIFT; - uint32_t temp = (base->CFGR1 & LPSPI_CFGR1_PINCFG_MASK); - - /* Assign the original value for members of transfer handle. */ - handle->state = (uint8_t)kLPSPI_Busy; - handle->txData = transfer->txData; - handle->rxData = transfer->rxData; - handle->txRemainingByteCount = transfer->dataSize; - handle->rxRemainingByteCount = transfer->dataSize; - handle->totalByteCount = transfer->dataSize; - handle->writeTcrInIsr = false; - handle->bytesPerFrame = (uint16_t)((base->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT) / 8U + 1U; - /* No need to configure PCS continous if the transfer byte count is smaller than frame size */ - bool isPcsContinuous = (((transfer->configFlags & (uint32_t)kLPSPI_MasterPcsContinuous) != 0U) && - (transfer->dataSize > handle->bytesPerFrame)); - handle->writeRegRemainingTimes = - (transfer->dataSize / (uint32_t)handle->bytesPerFrame) * (((uint32_t)handle->bytesPerFrame + 3U) / 4U); - handle->readRegRemainingTimes = handle->writeRegRemainingTimes; - handle->txBuffIfNull = - ((uint32_t)dummyData) | ((uint32_t)dummyData << 8) | ((uint32_t)dummyData << 16) | ((uint32_t)dummyData << 24); - /*The TX and RX FIFO sizes are always the same*/ - handle->fifoSize = LPSPI_GetRxFifoSize(base); - handle->isPcsContinuous = isPcsContinuous; - handle->isByteSwap = ((transfer->configFlags & (uint32_t)kLPSPI_MasterByteSwap) != 0U); - /*Calculate the bytes for write/read the TX/RX register each time*/ - if (handle->bytesPerFrame <= 4U) - { - handle->bytesEachWrite = (uint8_t)handle->bytesPerFrame; - handle->bytesEachRead = (uint8_t)handle->bytesPerFrame; - } - else - { - handle->bytesEachWrite = 4U; - handle->bytesEachRead = 4U; - } - - /*Set the RX and TX watermarks to reduce the ISR times.*/ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_c_ref_3$ - */ - if (handle->fifoSize > 1U) - { - txWatermark = 1U; - handle->rxWatermark = handle->fifoSize - 2U; - } - else - { - txWatermark = 0U; - handle->rxWatermark = 0U; - } - LPSPI_SetFifoWatermarks(base, txWatermark, handle->rxWatermark); - - /* If there is no rxData, mask the receive data so that receive data is not stored in receive FIFO. */ - if (handle->rxData == NULL) - { - isRxMask = true; - handle->rxRemainingByteCount = 0; - } - - /* Mask tx data in half duplex mode since the tx/rx share the same pin, so that the data received from slave is not - * interfered. */ - if (((temp == LPSPI_CFGR1_PINCFG(kLPSPI_SdiInSdiOut)) || (temp == LPSPI_CFGR1_PINCFG(kLPSPI_SdoInSdoOut))) && - (handle->txData == NULL)) - { - handle->isTxMask = true; - } - - /*Transfers will stall when transmit FIFO is empty or receive FIFO is full. */ - base->CFGR1 &= (~LPSPI_CFGR1_NOSTALL_MASK); - - /* Enable module for following configuration of TCR to take effect. */ - LPSPI_Enable(base, true); - - /* Configure transfer control register. */ - base->TCR = (base->TCR & ~(LPSPI_TCR_CONT_MASK | LPSPI_TCR_CONTC_MASK | LPSPI_TCR_RXMSK_MASK | - LPSPI_TCR_TXMSK_MASK | LPSPI_TCR_PCS_MASK)) | - LPSPI_TCR_PCS(whichPcs); - - /*TCR is also shared the FIFO , so wait for TCR written.*/ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_c_ref_2$ - */ - if (!LPSPI_WaitTxFifoEmpty(base)) - { - return kStatus_LPSPI_Timeout; - } - - /* PCS should be configured separately from the other bits, otherwise it will not take effect. */ - base->TCR |= LPSPI_TCR_CONT(isPcsContinuous) | LPSPI_TCR_CONTC(isPcsContinuous) | LPSPI_TCR_RXMSK(isRxMask); - - /* Enable the NVIC for LPSPI peripheral. Note that below code is useless if the LPSPI interrupt is in INTMUX , - * and you should also enable the INTMUX interupt in your application. - */ - (void)EnableIRQ(s_lpspiIRQ[LPSPI_GetInstance(base)]); - - /*TCR is also shared the FIFO , so wait for TCR written.*/ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_c_ref_2$ - */ - if (!LPSPI_WaitTxFifoEmpty(base)) - { - return kStatus_LPSPI_Timeout; - } - - if (handle->isTxMask) - { - /* When TCR[TXMSK]=1, transfer is initiate by writting a new command word to TCR. TCR[TXMSK] is cleared by - hardware every time when TCR[FRAMESZ] bit of data is transfered. In this case TCR[TXMSK] should be set to - initiate each transfer. */ - - base->TCR |= LPSPI_TCR_TXMSK_MASK; - handle->txRemainingByteCount -= (uint32_t)handle->bytesPerFrame; - if (!LPSPI_WaitTxFifoEmpty(base)) - { - return kStatus_LPSPI_Timeout; - } - } - else - { - /* Fill up the TX data in FIFO to initiate transfer */ - LPSPI_MasterTransferFillUpTxFifo(base, handle); - } - - /* Since SPI is a synchronous interface, we only need to enable the RX interrupt if there is RX data. - * The IRQ handler will get the status of RX and TX interrupt flags. - */ - if (handle->rxData != NULL) - { - if (handle->isTxMask) - { - /* if tx data is masked, transfer is initiated by writing 1 to TCR[TXMSK] and TCR[FRMESZ] bits of data is - read. If rx water mark is set larger than TCR[FRMESZ], rx interrupt will not be generated. Lower the rx - water mark setting */ - if ((handle->bytesPerFrame / 4U) < (uint16_t)handle->rxWatermark) - { - handle->rxWatermark = - (uint8_t)(handle->bytesPerFrame / 4U) > 0U ? (uint8_t)(handle->bytesPerFrame / 4U - 1U) : 0U; - base->FCR = (base->FCR & (~LPSPI_FCR_RXWATER_MASK)) | LPSPI_FCR_RXWATER(handle->rxWatermark); - } - } - else - { - /*Set rxWatermark to (readRegRemainingTimes-1) if readRegRemainingTimes less than rxWatermark. Otherwise - *there is not RX interrupt for the last datas because the RX count is not greater than rxWatermark. - */ - tmpTimes = handle->readRegRemainingTimes; - if (tmpTimes <= handle->rxWatermark) - { - base->FCR = (base->FCR & (~LPSPI_FCR_RXWATER_MASK)) | LPSPI_FCR_RXWATER(tmpTimes - 1U); - } - } - - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_RxInterruptEnable); - } - else - { - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_TxInterruptEnable); - } - - return kStatus_Success; -} - -static void LPSPI_MasterTransferFillUpTxFifo(LPSPI_Type *base, lpspi_master_handle_t *handle) -{ - assert(handle != NULL); - - uint32_t wordToSend = 0; - uint8_t fifoSize = handle->fifoSize; - uint32_t writeRegRemainingTimes = handle->writeRegRemainingTimes; - uint32_t readRegRemainingTimes = handle->readRegRemainingTimes; - size_t txRemainingByteCount = handle->txRemainingByteCount; - uint8_t bytesEachWrite = handle->bytesEachWrite; - bool isByteSwap = handle->isByteSwap; - - /* Make sure the difference in remaining TX and RX byte counts does not exceed FIFO depth - * and that the number of TX FIFO entries does not exceed the FIFO depth. - * But no need to make the protection if there is no rxData. - */ - while ((LPSPI_GetTxFifoCount(base) < fifoSize) && - (((readRegRemainingTimes - writeRegRemainingTimes) < (uint32_t)fifoSize) || (handle->rxData == NULL))) - { - if (txRemainingByteCount < (size_t)bytesEachWrite) - { - handle->bytesEachWrite = (uint8_t)txRemainingByteCount; - bytesEachWrite = handle->bytesEachWrite; - } - - if (handle->txData != NULL) - { - wordToSend = LPSPI_CombineWriteData(handle->txData, bytesEachWrite, isByteSwap); - handle->txData += bytesEachWrite; - } - else - { - wordToSend = handle->txBuffIfNull; - } - - /*Write the word to TX register*/ - LPSPI_WriteData(base, wordToSend); - - /*Decrease the write TX register times.*/ - --handle->writeRegRemainingTimes; - writeRegRemainingTimes = handle->writeRegRemainingTimes; - - /*Decrease the remaining TX byte count.*/ - handle->txRemainingByteCount -= (size_t)bytesEachWrite; - txRemainingByteCount = handle->txRemainingByteCount; - - if (handle->txRemainingByteCount == 0U) - { - /* If PCS is continuous, update TCR to de-assert PCS */ - if (handle->isPcsContinuous) - { - /* Only write to the TCR if the FIFO has room */ - if (LPSPI_GetTxFifoCount(base) < fifoSize) - { - base->TCR = (base->TCR & ~(LPSPI_TCR_CONTC_MASK)); - handle->writeTcrInIsr = false; - } - /* Else, set a global flag to tell the ISR to do write to the TCR */ - else - { - handle->writeTcrInIsr = true; - } - } - break; - } - } -} - -static void LPSPI_MasterTransferComplete(LPSPI_Type *base, lpspi_master_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable interrupt requests*/ - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_AllInterruptEnable); - - handle->state = (uint8_t)kLPSPI_Idle; - - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_Success, handle->userData); - } -} - -/*! - * brief Gets the master transfer remaining bytes. - * - * This function gets the master transfer remaining bytes. - * - * param base LPSPI peripheral address. - * param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - * param count Number of bytes transferred so far by the non-blocking transaction. - * return status of status_t. - */ -status_t LPSPI_MasterTransferGetCount(LPSPI_Type *base, lpspi_master_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (handle->state != (uint8_t)kLPSPI_Busy) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - size_t remainingByte; - - if (handle->rxData != NULL) - { - remainingByte = handle->rxRemainingByteCount; - } - else - { - remainingByte = handle->txRemainingByteCount; - } - - *count = handle->totalByteCount - remainingByte; - - return kStatus_Success; -} - -/*! - * brief LPSPI master abort transfer which uses an interrupt method. - * - * This function aborts a transfer which uses an interrupt method. - * - * param base LPSPI peripheral address. - * param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - */ -void LPSPI_MasterTransferAbort(LPSPI_Type *base, lpspi_master_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable interrupt requests*/ - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_AllInterruptEnable); - - LPSPI_Reset(base); - - handle->state = (uint8_t)kLPSPI_Idle; - handle->txRemainingByteCount = 0; - handle->rxRemainingByteCount = 0; -} - -/*! - * brief LPSPI Master IRQ handler function. - * - * This function processes the LPSPI transmit and receive IRQ. - * - * param base LPSPI peripheral address. - * param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - */ -void LPSPI_MasterTransferHandleIRQ(LPSPI_Type *base, lpspi_master_handle_t *handle) -{ - assert(handle != NULL); - - uint32_t readData; - uint8_t bytesEachRead = handle->bytesEachRead; - bool isByteSwap = handle->isByteSwap; - uint32_t readRegRemainingTimes = handle->readRegRemainingTimes; - - if (handle->rxData != NULL) - { - if (handle->rxRemainingByteCount != 0U) - { - /* First, disable the interrupts to avoid potentially triggering another interrupt - * while reading out the RX FIFO as more data may be coming into the RX FIFO. We'll - * re-enable the interrupts based on the LPSPI state after reading out the FIFO. - */ - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_RxInterruptEnable); - - /* - * $Branch Coverage Justification$ - * If the remaining number is 0, the FIFO must be 0, and the condition after will not be judged.(will - * improve) - */ - while ((LPSPI_GetRxFifoCount(base) != 0U) && (handle->rxRemainingByteCount != 0U)) - { - /*Read out the data*/ - readData = LPSPI_ReadData(base); - - /*Decrease the read RX register times.*/ - --handle->readRegRemainingTimes; - readRegRemainingTimes = handle->readRegRemainingTimes; - - if (handle->rxRemainingByteCount < (size_t)bytesEachRead) - { - handle->bytesEachRead = (uint8_t)(handle->rxRemainingByteCount); - bytesEachRead = handle->bytesEachRead; - } - - LPSPI_SeparateReadData(handle->rxData, readData, bytesEachRead, isByteSwap); - handle->rxData += bytesEachRead; - - /*Decrease the remaining RX byte count.*/ - handle->rxRemainingByteCount -= (size_t)bytesEachRead; - } - - /* Re-enable the interrupts only if rxCount indicates there is more data to receive, - * else we may get a spurious interrupt. - * */ - if (handle->rxRemainingByteCount != 0U) - { - /* Set the TDF and RDF interrupt enables simultaneously to avoid race conditions */ - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_RxInterruptEnable); - } - } - - /*Set rxWatermark to (readRegRemainingTimes-1) if readRegRemainingTimes less than rxWatermark. Otherwise there - *is not RX interrupt for the last datas because the RX count is not greater than rxWatermark. - */ - if (readRegRemainingTimes <= (uint32_t)handle->rxWatermark) - { - base->FCR = (base->FCR & (~LPSPI_FCR_RXWATER_MASK)) | - LPSPI_FCR_RXWATER((readRegRemainingTimes > 1U) ? (readRegRemainingTimes - 1U) : (0U)); - } - } - - if (handle->txRemainingByteCount != 0U) - { - if (handle->isTxMask) - { - /* When TCR[TXMSK]=1, transfer is initiate by writting a new command word to TCR. TCR[TXMSK] is cleared by - hardware every time when TCR[FRAMESZ] bit of data is transfered. - In this case TCR[TXMSK] should be set to initiate each transfer. */ - base->TCR |= LPSPI_TCR_TXMSK_MASK; - if ((handle->txRemainingByteCount == (uint32_t)handle->bytesPerFrame) && (handle->isPcsContinuous)) - { - /* For the last piece of frame size of data, if is PCS continous mode(TCR[CONT]), TCR[CONTC] should - * be cleared to de-assert the PCS. Be sure to clear the TXMSK as well otherwise another FRAMESZ - * of data will be received. */ - base->TCR &= ~(LPSPI_TCR_CONTC_MASK | LPSPI_TCR_CONT_MASK | LPSPI_TCR_TXMSK_MASK); - } - else - { - if (!LPSPI_WaitTxFifoEmpty(base)) - { - return; - } - } - handle->txRemainingByteCount -= (uint32_t)handle->bytesPerFrame; - } - else - { - LPSPI_MasterTransferFillUpTxFifo(base, handle); - } - } - else - { - if ((LPSPI_GetTxFifoCount(base) < (handle->fifoSize))) - { - if ((handle->isPcsContinuous) && (handle->writeTcrInIsr) && (!handle->isTxMask)) - { - base->TCR = (base->TCR & ~(LPSPI_TCR_CONTC_MASK)); - handle->writeTcrInIsr = false; - } - } - } - - if ((handle->txRemainingByteCount == 0U) && (handle->rxRemainingByteCount == 0U) && (!handle->writeTcrInIsr)) - { - /* If no RX buffer, then transfer is not complete until transfer complete flag sets */ - if (handle->rxData == NULL) - { - if ((LPSPI_GetStatusFlags(base) & (uint32_t)kLPSPI_TransferCompleteFlag) != 0U) - { - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_TransferCompleteFlag); - /* Complete the transfer and disable the interrupts */ - LPSPI_MasterTransferComplete(base, handle); - } - else - { - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_TransferCompleteInterruptEnable); - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_TxInterruptEnable | (uint32_t)kLPSPI_RxInterruptEnable); - } - } - else - { - /* Complete the transfer and disable the interrupts */ - LPSPI_MasterTransferComplete(base, handle); - } - } -} - -/*Transactional APIs -- Slave*/ -/*! - * brief Initializes the LPSPI slave handle. - * - * This function initializes the LPSPI handle, which can be used for other LPSPI transactional APIs. Usually, for a - * specified LPSPI instance, call this API once to get the initialized handle. - * - * param base LPSPI peripheral address. - * param handle LPSPI handle pointer to lpspi_slave_handle_t. - * param callback DSPI callback. - * param userData callback function parameter. - */ -void LPSPI_SlaveTransferCreateHandle(LPSPI_Type *base, - lpspi_slave_handle_t *handle, - lpspi_slave_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - s_lpspiHandle[LPSPI_GetInstance(base)] = handle; - - /* Set irq handler. */ - s_lpspiSlaveIsr = LPSPI_SlaveTransferHandleIRQ; - - handle->callback = callback; - handle->userData = userData; -} - -/*! - * brief LPSPI slave transfer data using an interrupt method. - * - * This function transfer data using an interrupt method. This is a non-blocking function, which returns right away. - * When all data is transferred, the callback function is called. - * - * Note: - * The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not an integer multiple of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * param base LPSPI peripheral address. - * param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - * param transfer pointer to lpspi_transfer_t structure. - * return status of status_t. - */ -status_t LPSPI_SlaveTransferNonBlocking(LPSPI_Type *base, lpspi_slave_handle_t *handle, lpspi_transfer_t *transfer) -{ - assert(handle != NULL); - assert(transfer != NULL); - - /* Check that we're not busy.*/ - if (handle->state == (uint8_t)kLPSPI_Busy) - { - return kStatus_LPSPI_Busy; - } - LPSPI_Enable(base, false); - /* Check arguements */ - if (!LPSPI_CheckTransferArgument(base, transfer, false)) - { - return kStatus_InvalidArgument; - } - - /* Flush FIFO, clear status, disable all the inerrupts. */ - LPSPI_FlushFifo(base, true, true); - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_AllStatusFlag); - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_AllInterruptEnable); - - /* Variables */ - bool isRxMask = false; - bool isTxMask = false; - uint8_t txWatermark; - uint32_t readRegRemainingTimes; - uint32_t whichPcs = (transfer->configFlags & LPSPI_SLAVE_PCS_MASK) >> LPSPI_SLAVE_PCS_SHIFT; - uint32_t bytesPerFrame = ((base->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT) / 8U + 1U; - - /* Assign the original value for members of transfer handle. */ - handle->state = (uint8_t)kLPSPI_Busy; - handle->txData = transfer->txData; - handle->rxData = transfer->rxData; - handle->txRemainingByteCount = transfer->dataSize; - handle->rxRemainingByteCount = transfer->dataSize; - handle->totalByteCount = transfer->dataSize; - handle->writeRegRemainingTimes = (transfer->dataSize / bytesPerFrame) * ((bytesPerFrame + 3U) / 4U); - handle->readRegRemainingTimes = handle->writeRegRemainingTimes; - /*The TX and RX FIFO sizes are always the same*/ - handle->fifoSize = LPSPI_GetRxFifoSize(base); - handle->isByteSwap = ((transfer->configFlags & (uint32_t)kLPSPI_SlaveByteSwap) != 0U); - /*Calculate the bytes for write/read the TX/RX register each time*/ - if (bytesPerFrame <= 4U) - { - handle->bytesEachWrite = (uint8_t)bytesPerFrame; - handle->bytesEachRead = (uint8_t)bytesPerFrame; - } - else - { - handle->bytesEachWrite = 4U; - handle->bytesEachRead = 4U; - } - /* Set proper RX and TX watermarks to reduce the ISR response times. */ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_c_ref_3$ - */ - if (handle->fifoSize > 1U) - { - txWatermark = 1U; - handle->rxWatermark = handle->fifoSize / 2U; - } - else - { - txWatermark = 0U; - handle->rxWatermark = 0U; - } - LPSPI_SetFifoWatermarks(base, txWatermark, handle->rxWatermark); - - /* If there is no rxData, mask the receive data so that receive data is not stored in receive FIFO. */ - if (handle->rxData == NULL) - { - isRxMask = true; - handle->rxRemainingByteCount = 0U; - } - /* If there is no txData, mask the transmit data so that no data is loaded from transmit FIFO and output pin - * is tristated. */ - if (handle->txData == NULL) - { - isTxMask = true; - handle->txRemainingByteCount = 0U; - } - - /* Enable module for following configuration of TCR to take effect. */ - LPSPI_Enable(base, true); - - base->TCR = (base->TCR & ~(LPSPI_TCR_CONT_MASK | LPSPI_TCR_CONTC_MASK | LPSPI_TCR_RXMSK_MASK | - LPSPI_TCR_TXMSK_MASK | LPSPI_TCR_PCS_MASK)) | - LPSPI_TCR_RXMSK(isRxMask) | LPSPI_TCR_TXMSK(isTxMask) | LPSPI_TCR_PCS(whichPcs); - - /* Enable the NVIC for LPSPI peripheral. Note that below code is useless if the LPSPI interrupt is in INTMUX , - * and you should also enable the INTMUX interupt in your application. - */ - (void)EnableIRQ(s_lpspiIRQ[LPSPI_GetInstance(base)]); - - /*TCR is also shared the FIFO, so wait for TCR written.*/ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_c_ref_3$ - */ - if (!LPSPI_WaitTxFifoEmpty(base)) - { - return kStatus_LPSPI_Timeout; - } - - /* Fill up the TX data in FIFO */ - if (handle->txData != NULL) - { - LPSPI_SlaveTransferFillUpTxFifo(base, handle); - } - - /* Since SPI is a synchronous interface, we only need to enable the RX interrupt if there is RX data. - * The IRQ handler will get the status of RX and TX interrupt flags. - */ - if (handle->rxData != NULL) - { - /*Set rxWatermark to (readRegRemainingTimes-1) if readRegRemainingTimes less than rxWatermark. Otherwise there - *is not RX interrupt for the last datas because the RX count is not greater than rxWatermark. - */ - readRegRemainingTimes = handle->readRegRemainingTimes; - if (readRegRemainingTimes <= (uint32_t)handle->rxWatermark) - { - base->FCR = (base->FCR & (~LPSPI_FCR_RXWATER_MASK)) | LPSPI_FCR_RXWATER(readRegRemainingTimes - 1U); - } - - /* RX request and FIFO overflow request enable */ - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_RxInterruptEnable | (uint32_t)kLPSPI_ReceiveErrorInterruptEnable); - } - else - { - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_TxInterruptEnable); - } - - if (handle->txData != NULL) - { - /* TX FIFO underflow request enable */ - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_TransmitErrorInterruptEnable); - } - - return kStatus_Success; -} - -static void LPSPI_SlaveTransferFillUpTxFifo(LPSPI_Type *base, lpspi_slave_handle_t *handle) -{ - assert(handle != NULL); - - uint32_t wordToSend = 0U; - uint8_t bytesEachWrite = handle->bytesEachWrite; - bool isByteSwap = handle->isByteSwap; - - while (LPSPI_GetTxFifoCount(base) < (handle->fifoSize)) - { - if (handle->txRemainingByteCount < (size_t)bytesEachWrite) - { - handle->bytesEachWrite = (uint8_t)handle->txRemainingByteCount; - bytesEachWrite = handle->bytesEachWrite; - } - - wordToSend = LPSPI_CombineWriteData(handle->txData, bytesEachWrite, isByteSwap); - handle->txData += bytesEachWrite; - - /*Decrease the remaining TX byte count.*/ - handle->txRemainingByteCount -= (size_t)bytesEachWrite; - - /*Write the word to TX register*/ - LPSPI_WriteData(base, wordToSend); - - if (handle->txRemainingByteCount == 0U) - { - break; - } - } -} - -static void LPSPI_SlaveTransferComplete(LPSPI_Type *base, lpspi_slave_handle_t *handle) -{ - assert(handle != NULL); - - status_t status = kStatus_Success; - - /* Disable interrupt requests*/ - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_AllInterruptEnable); - - if (handle->state == (uint8_t)kLPSPI_Error) - { - status = kStatus_LPSPI_Error; - } - else - { - status = kStatus_Success; - } - - handle->state = (uint8_t)kLPSPI_Idle; - - if (handle->callback != NULL) - { - handle->callback(base, handle, status, handle->userData); - } -} - -/*! - * brief Gets the slave transfer remaining bytes. - * - * This function gets the slave transfer remaining bytes. - * - * param base LPSPI peripheral address. - * param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - * param count Number of bytes transferred so far by the non-blocking transaction. - * return status of status_t. - */ -status_t LPSPI_SlaveTransferGetCount(LPSPI_Type *base, lpspi_slave_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (handle->state != (uint8_t)kLPSPI_Busy) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - size_t remainingByte; - - if (handle->rxData != NULL) - { - remainingByte = handle->rxRemainingByteCount; - } - else - { - remainingByte = handle->txRemainingByteCount; - } - - *count = handle->totalByteCount - remainingByte; - - return kStatus_Success; -} - -/*! - * brief LPSPI slave aborts a transfer which uses an interrupt method. - * - * This function aborts a transfer which uses an interrupt method. - * - * param base LPSPI peripheral address. - * param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - */ -void LPSPI_SlaveTransferAbort(LPSPI_Type *base, lpspi_slave_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable interrupt requests*/ - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_TxInterruptEnable | (uint32_t)kLPSPI_RxInterruptEnable); - - LPSPI_Reset(base); - - handle->state = (uint8_t)kLPSPI_Idle; - handle->txRemainingByteCount = 0U; - handle->rxRemainingByteCount = 0U; -} - -/*! - * brief LPSPI Slave IRQ handler function. - * - * This function processes the LPSPI transmit and receives an IRQ. - * - * param base LPSPI peripheral address. - * param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - */ -void LPSPI_SlaveTransferHandleIRQ(LPSPI_Type *base, lpspi_slave_handle_t *handle) -{ - assert(handle != NULL); - - uint32_t readData; /* variable to store word read from RX FIFO */ - uint8_t bytesEachRead = handle->bytesEachRead; - bool isByteSwap = handle->isByteSwap; - uint32_t readRegRemainingTimes; - - if (handle->rxData != NULL) - { - if (handle->rxRemainingByteCount > 0U) - { - while (LPSPI_GetRxFifoCount(base) != 0U) - { - /*Read out the data*/ - readData = LPSPI_ReadData(base); - - /*Decrease the read RX register times.*/ - --handle->readRegRemainingTimes; - - if (handle->rxRemainingByteCount < (size_t)bytesEachRead) - { - handle->bytesEachRead = (uint8_t)handle->rxRemainingByteCount; - bytesEachRead = handle->bytesEachRead; - } - - LPSPI_SeparateReadData(handle->rxData, readData, bytesEachRead, isByteSwap); - handle->rxData += bytesEachRead; - - /*Decrease the remaining RX byte count.*/ - handle->rxRemainingByteCount -= (size_t)bytesEachRead; - - if ((handle->txRemainingByteCount > 0U) && (handle->txData != NULL)) - { - LPSPI_SlaveTransferFillUpTxFifo(base, handle); - } - - if (handle->rxRemainingByteCount == 0U) - { - break; - } - } - } - - /*Set rxWatermark to (readRegRemainingTimes-1) if readRegRemainingTimes less than rxWatermark. Otherwise there - *is not RX interrupt for the last datas because the RX count is not greater than rxWatermark. - */ - readRegRemainingTimes = handle->readRegRemainingTimes; - if (readRegRemainingTimes <= (uint32_t)handle->rxWatermark) - { - base->FCR = (base->FCR & (~LPSPI_FCR_RXWATER_MASK)) | - LPSPI_FCR_RXWATER((readRegRemainingTimes > 1U) ? (readRegRemainingTimes - 1U) : (0U)); - } - } - if ((handle->rxData == NULL) && (handle->txRemainingByteCount != 0U) && (handle->txData != NULL)) - { - LPSPI_SlaveTransferFillUpTxFifo(base, handle); - } - - if ((handle->txRemainingByteCount == 0U) && (handle->rxRemainingByteCount == 0U)) - { - /* If no RX buffer, then transfer is not complete until transfer complete flag sets and the TX FIFO empty*/ - if (handle->rxData == NULL) - { - if (((LPSPI_GetStatusFlags(base) & (uint32_t)kLPSPI_FrameCompleteFlag) != 0U) && - (LPSPI_GetTxFifoCount(base) == 0U)) - { - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_FrameCompleteFlag); - /* Complete the transfer and disable the interrupts */ - LPSPI_SlaveTransferComplete(base, handle); - } - else - { - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_FrameCompleteFlag); - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_FrameCompleteInterruptEnable); - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_TxInterruptEnable | (uint32_t)kLPSPI_RxInterruptEnable); - } - } - else - { - /* Complete the transfer and disable the interrupts */ - LPSPI_SlaveTransferComplete(base, handle); - } - } - - /* Catch tx fifo underflow conditions, service only if tx under flow interrupt enabled */ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_c_ref_4$ - */ - if (((LPSPI_GetStatusFlags(base) & (uint32_t)kLPSPI_TransmitErrorFlag) != 0U) && - ((base->IER & LPSPI_IER_TEIE_MASK) != 0U)) - { - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_TransmitErrorFlag); - /* Change state to error and clear flag */ - if (handle->txData != NULL) - { - handle->state = (uint8_t)kLPSPI_Error; - } - handle->errorCount++; - /* ERR051588: Clear FIFO after underrun occurs */ - LPSPI_FlushFifo(base, true, false); - } - /* Catch rx fifo overflow conditions, service only if rx over flow interrupt enabled */ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_c_ref_4$ - */ - if (((LPSPI_GetStatusFlags(base) & (uint32_t)kLPSPI_ReceiveErrorFlag) != 0U) && - ((base->IER & LPSPI_IER_REIE_MASK) != 0U)) - { - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_ReceiveErrorFlag); - /* Change state to error and clear flag */ - /* - * $Branch Coverage Justification$ - * This error happens on receive, so rxData won't be empty.(will improve) - */ - if (handle->rxData != NULL) - { - handle->state = (uint8_t)kLPSPI_Error; - } - handle->errorCount++; - } -} - -static uint32_t LPSPI_CombineWriteData(const uint8_t *txData, uint8_t bytesEachWrite, bool isByteSwap) -{ - assert(txData != NULL); - - uint32_t wordToSend = 0U; - - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_c_ref_1$ - */ - switch (bytesEachWrite) - { - case 1: - wordToSend = *txData; - ++txData; - break; - - case 2: - if (!isByteSwap) - { - wordToSend = *txData; - ++txData; - wordToSend |= (unsigned)(*txData) << 8U; - ++txData; - } - else - { - wordToSend = (unsigned)(*txData) << 8U; - ++txData; - wordToSend |= *txData; - ++txData; - } - - break; - - case 3: - if (!isByteSwap) - { - wordToSend = *txData; - ++txData; - wordToSend |= (unsigned)(*txData) << 8U; - ++txData; - wordToSend |= (unsigned)(*txData) << 16U; - ++txData; - } - else - { - wordToSend = (unsigned)(*txData) << 16U; - ++txData; - wordToSend |= (unsigned)(*txData) << 8U; - ++txData; - wordToSend |= *txData; - ++txData; - } - break; - - case 4: - if (!isByteSwap) - { - wordToSend = *txData; - ++txData; - wordToSend |= (unsigned)(*txData) << 8U; - ++txData; - wordToSend |= (unsigned)(*txData) << 16U; - ++txData; - wordToSend |= (unsigned)(*txData) << 24U; - ++txData; - } - else - { - wordToSend = (unsigned)(*txData) << 24U; - ++txData; - wordToSend |= (unsigned)(*txData) << 16U; - ++txData; - wordToSend |= (unsigned)(*txData) << 8U; - ++txData; - wordToSend |= *txData; - ++txData; - } - break; - - default: - assert(false); - break; - } - return wordToSend; -} - -static void LPSPI_SeparateReadData(uint8_t *rxData, uint32_t readData, uint8_t bytesEachRead, bool isByteSwap) -{ - assert(rxData != NULL); - - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_c_ref_1$ - */ - switch (bytesEachRead) - { - case 1: - *rxData = (uint8_t)readData; - ++rxData; - break; - - case 2: - if (!isByteSwap) - { - *rxData = (uint8_t)readData; - ++rxData; - *rxData = (uint8_t)(readData >> 8); - ++rxData; - } - else - { - *rxData = (uint8_t)(readData >> 8); - ++rxData; - *rxData = (uint8_t)readData; - ++rxData; - } - break; - - case 3: - if (!isByteSwap) - { - *rxData = (uint8_t)readData; - ++rxData; - *rxData = (uint8_t)(readData >> 8); - ++rxData; - *rxData = (uint8_t)(readData >> 16); - ++rxData; - } - else - { - *rxData = (uint8_t)(readData >> 16); - ++rxData; - *rxData = (uint8_t)(readData >> 8); - ++rxData; - *rxData = (uint8_t)readData; - ++rxData; - } - break; - - case 4: - if (!isByteSwap) - { - *rxData = (uint8_t)readData; - ++rxData; - *rxData = (uint8_t)(readData >> 8); - ++rxData; - *rxData = (uint8_t)(readData >> 16); - ++rxData; - *rxData = (uint8_t)(readData >> 24); - ++rxData; - } - else - { - *rxData = (uint8_t)(readData >> 24); - ++rxData; - *rxData = (uint8_t)(readData >> 16); - ++rxData; - *rxData = (uint8_t)(readData >> 8); - ++rxData; - *rxData = (uint8_t)readData; - ++rxData; - } - break; - - default: - assert(false); - break; - } -} - -/*! - * brief Wait for tx FIFO to be empty. - * Wait the tx fifo empty when set TCR register - * param base LPSPI peripheral address. - * return true for the tx FIFO is ready, false is not. - */ -bool LPSPI_WaitTxFifoEmpty(LPSPI_Type *base) -{ -#if SPI_RETRY_TIMES - uint32_t waitTimes = SPI_RETRY_TIMES; - while (((uint8_t)LPSPI_GetTxFifoCount(base) != 0U) && (--waitTimes != 0U)) -#else - while ((uint8_t)LPSPI_GetTxFifoCount(base) != 0U) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return false; - } -#endif - return true; -} - -static void LPSPI_CommonIRQHandler(LPSPI_Type *base, void *param) -{ - if (LPSPI_IsMaster(base)) - { - s_lpspiMasterIsr(base, (lpspi_master_handle_t *)param); - } - else - { - s_lpspiSlaveIsr(base, (lpspi_slave_handle_t *)param); - } - SDK_ISR_EXIT_BARRIER; -} - -#if defined(LPSPI0) -void LPSPI0_DriverIRQHandler(void); -void LPSPI0_DriverIRQHandler(void) -{ - assert(s_lpspiHandle[0] != NULL); - LPSPI_CommonIRQHandler(LPSPI0, s_lpspiHandle[0]); -} -#endif - -#if defined(LPSPI1) -void LPSPI1_DriverIRQHandler(void); -void LPSPI1_DriverIRQHandler(void) -{ - assert(s_lpspiHandle[1] != NULL); - LPSPI_CommonIRQHandler(LPSPI1, s_lpspiHandle[1]); -} -#endif - -#if defined(LPSPI2) -void LPSPI2_DriverIRQHandler(void); -void LPSPI2_DriverIRQHandler(void) -{ - assert(s_lpspiHandle[2] != NULL); - LPSPI_CommonIRQHandler(LPSPI2, s_lpspiHandle[2]); -} -#endif - -#if defined(LPSPI3) -void LPSPI3_DriverIRQHandler(void); -void LPSPI3_DriverIRQHandler(void) -{ - assert(s_lpspiHandle[3] != NULL); - LPSPI_CommonIRQHandler(LPSPI3, s_lpspiHandle[3]); -} -#endif - -#if defined(LPSPI4) -void LPSPI4_DriverIRQHandler(void); -void LPSPI4_DriverIRQHandler(void) -{ - assert(s_lpspiHandle[4] != NULL); - LPSPI_CommonIRQHandler(LPSPI4, s_lpspiHandle[4]); -} -#endif - -#if defined(LPSPI5) -void LPSPI5_DriverIRQHandler(void); -void LPSPI5_DriverIRQHandler(void) -{ - assert(s_lpspiHandle[5] != NULL); - LPSPI_CommonIRQHandler(LPSPI5, s_lpspiHandle[5]); -} -#endif - -#if defined(LPSPI6) -void LPSPI6_DriverIRQHandler(void); -void LPSPI6_DriverIRQHandler(void) -{ - assert(s_lpspiHandle[6] != NULL); - LPSPI_CommonIRQHandler(LPSPI6, s_lpspiHandle[6]); -} -#endif - -#if defined(DMA__LPSPI0) -void DMA_SPI0_INT_DriverIRQHandler(void); -void DMA_SPI0_INT_DriverIRQHandler(void) -{ - assert(s_lpspiHandle[LPSPI_GetInstance(DMA__LPSPI0)] != NULL); - LPSPI_CommonIRQHandler(DMA__LPSPI0, s_lpspiHandle[LPSPI_GetInstance(DMA__LPSPI0)]); -} -#endif - -#if defined(DMA__LPSPI1) -void DMA_SPI1_INT_DriverIRQHandler(void); -void DMA_SPI1_INT_DriverIRQHandler(void) -{ - assert(s_lpspiHandle[LPSPI_GetInstance(DMA__LPSPI1)] != NULL); - LPSPI_CommonIRQHandler(DMA__LPSPI1, s_lpspiHandle[LPSPI_GetInstance(DMA__LPSPI1)]); -} -#endif -#if defined(DMA__LPSPI2) -void DMA_SPI2_INT_DriverIRQHandler(void); -void DMA_SPI2_INT_DriverIRQHandler(void) -{ - assert(s_lpspiHandle[LPSPI_GetInstance(DMA__LPSPI2)] != NULL); - LPSPI_CommonIRQHandler(DMA__LPSPI2, s_lpspiHandle[LPSPI_GetInstance(DMA__LPSPI2)]); -} -#endif - -#if defined(DMA__LPSPI3) -void DMA_SPI3_INT_DriverIRQHandler(void); -void DMA_SPI3_INT_DriverIRQHandler(void) -{ - assert(s_lpspiHandle[LPSPI_GetInstance(DMA__LPSPI3)] != NULL); - LPSPI_CommonIRQHandler(DMA__LPSPI3, s_lpspiHandle[LPSPI_GetInstance(DMA__LPSPI3)]); -} -#endif - -#if defined(ADMA__LPSPI0) -void ADMA_SPI0_INT_DriverIRQHandler(void); -void ADMA_SPI0_INT_DriverIRQHandler(void) -{ - assert(s_lpspiHandle[LPSPI_GetInstance(ADMA__LPSPI0)] != NULL); - LPSPI_CommonIRQHandler(ADMA__LPSPI0, s_lpspiHandle[LPSPI_GetInstance(ADMA__LPSPI0)]); -} -#endif - -#if defined(ADMA__LPSPI1) -void ADMA_SPI1_INT_DriverIRQHandler(void); -void ADMA_SPI1_INT_DriverIRQHandler(void) -{ - assert(s_lpspiHandle[LPSPI_GetInstance(ADMA__LPSPI1)] != NULL); - LPSPI_CommonIRQHandler(ADMA__LPSPI1, s_lpspiHandle[LPSPI_GetInstance(ADMA__LPSPI1)]); -} -#endif -#if defined(ADMA__LPSPI2) -void ADMA_SPI2_INT_DriverIRQHandler(void); -void ADMA_SPI2_INT_DriverIRQHandler(void) -{ - assert(s_lpspiHandle[LPSPI_GetInstance(ADMA__LPSPI2)] != NULL); - LPSPI_CommonIRQHandler(ADMA__LPSPI2, s_lpspiHandle[LPSPI_GetInstance(ADMA__LPSPI2)]); -} -#endif - -#if defined(ADMA__LPSPI3) -void ADMA_SPI3_INT_DriverIRQHandler(void); -void ADMA_SPI3_INT_DriverIRQHandler(void) -{ - assert(s_lpspiHandle[LPSPI_GetInstance(ADMA__LPSPI3)] != NULL); - LPSPI_CommonIRQHandler(ADMA__LPSPI3, s_lpspiHandle[LPSPI_GetInstance(ADMA__LPSPI3)]); -} -#endif diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpspi.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpspi.h deleted file mode 100644 index 517179054aa..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpspi.h +++ /dev/null @@ -1,1231 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2023, 2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LPSPI_H_ -#define FSL_LPSPI_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup lpspi_driver - * @{ - */ - -/********************************************************************************************************************** - * Definitions - *********************************************************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief LPSPI driver version. */ -#define FSL_LPSPI_DRIVER_VERSION (MAKE_VERSION(2, 6, 8)) -/*! @} */ - -#ifndef LPSPI_DUMMY_DATA -/*! @brief LPSPI dummy data if no Tx data.*/ -#define LPSPI_DUMMY_DATA (0x00U) /*!< Dummy data used for tx if there is not txData. */ -#endif - -/*! @brief Retry times for waiting flag. */ -#ifndef SPI_RETRY_TIMES -#define SPI_RETRY_TIMES 0U /* Define to zero means keep waiting until the flag is assert/deassert. */ -#endif - -/*! @brief Global variable for dummy data value setting. */ -extern volatile uint8_t g_lpspiDummyData[]; - -/*! @brief Status for the LPSPI driver.*/ -enum -{ - kStatus_LPSPI_Busy = MAKE_STATUS(kStatusGroup_LPSPI, 0), /*!< LPSPI transfer is busy.*/ - kStatus_LPSPI_Error = MAKE_STATUS(kStatusGroup_LPSPI, 1), /*!< LPSPI driver error. */ - kStatus_LPSPI_Idle = MAKE_STATUS(kStatusGroup_LPSPI, 2), /*!< LPSPI is idle.*/ - kStatus_LPSPI_OutOfRange = MAKE_STATUS(kStatusGroup_LPSPI, 3), /*!< LPSPI transfer out Of range. */ - kStatus_LPSPI_Timeout = MAKE_STATUS(kStatusGroup_LPSPI, 4) /*!< LPSPI timeout polling status flags. */ -}; - -/*! @brief LPSPI status flags in SPIx_SR register.*/ -enum _lpspi_flags -{ - kLPSPI_TxDataRequestFlag = LPSPI_SR_TDF_MASK, /*!< Transmit data flag */ - kLPSPI_RxDataReadyFlag = LPSPI_SR_RDF_MASK, /*!< Receive data flag */ - kLPSPI_WordCompleteFlag = LPSPI_SR_WCF_MASK, /*!< Word Complete flag */ - kLPSPI_FrameCompleteFlag = LPSPI_SR_FCF_MASK, /*!< Frame Complete flag */ - kLPSPI_TransferCompleteFlag = LPSPI_SR_TCF_MASK, /*!< Transfer Complete flag */ - kLPSPI_TransmitErrorFlag = LPSPI_SR_TEF_MASK, /*!< Transmit Error flag (FIFO underrun) */ - kLPSPI_ReceiveErrorFlag = LPSPI_SR_REF_MASK, /*!< Receive Error flag (FIFO overrun) */ - kLPSPI_DataMatchFlag = LPSPI_SR_DMF_MASK, /*!< Data Match flag */ - kLPSPI_ModuleBusyFlag = LPSPI_SR_MBF_MASK, /*!< Module Busy flag */ - kLPSPI_AllStatusFlag = (LPSPI_SR_TDF_MASK | LPSPI_SR_RDF_MASK | LPSPI_SR_WCF_MASK | LPSPI_SR_FCF_MASK | - LPSPI_SR_TCF_MASK | LPSPI_SR_TEF_MASK | LPSPI_SR_REF_MASK | LPSPI_SR_DMF_MASK | - LPSPI_SR_MBF_MASK) /*!< Used for clearing all w1c status flags */ -}; - -/*! @brief LPSPI interrupt source.*/ -enum _lpspi_interrupt_enable -{ - kLPSPI_TxInterruptEnable = LPSPI_IER_TDIE_MASK, /*!< Transmit data interrupt enable */ - kLPSPI_RxInterruptEnable = LPSPI_IER_RDIE_MASK, /*!< Receive data interrupt enable */ - kLPSPI_WordCompleteInterruptEnable = LPSPI_IER_WCIE_MASK, /*!< Word complete interrupt enable */ - kLPSPI_FrameCompleteInterruptEnable = LPSPI_IER_FCIE_MASK, /*!< Frame complete interrupt enable */ - kLPSPI_TransferCompleteInterruptEnable = LPSPI_IER_TCIE_MASK, /*!< Transfer complete interrupt enable */ - kLPSPI_TransmitErrorInterruptEnable = LPSPI_IER_TEIE_MASK, /*!< Transmit error interrupt enable(FIFO underrun)*/ - kLPSPI_ReceiveErrorInterruptEnable = LPSPI_IER_REIE_MASK, /*!< Receive Error interrupt enable (FIFO overrun) */ - kLPSPI_DataMatchInterruptEnable = LPSPI_IER_DMIE_MASK, /*!< Data Match interrupt enable */ - kLPSPI_AllInterruptEnable = - (LPSPI_IER_TDIE_MASK | LPSPI_IER_RDIE_MASK | LPSPI_IER_WCIE_MASK | LPSPI_IER_FCIE_MASK | LPSPI_IER_TCIE_MASK | - LPSPI_IER_TEIE_MASK | LPSPI_IER_REIE_MASK | LPSPI_IER_DMIE_MASK) /*!< All above interrupts enable.*/ -}; - -/*! @brief LPSPI DMA source.*/ -enum _lpspi_dma_enable -{ - kLPSPI_TxDmaEnable = LPSPI_DER_TDDE_MASK, /*!< Transmit data DMA enable */ - kLPSPI_RxDmaEnable = LPSPI_DER_RDDE_MASK /*!< Receive data DMA enable */ -}; - -/*! @brief LPSPI master or slave mode configuration.*/ -typedef enum _lpspi_master_slave_mode -{ - kLPSPI_Master = 1U, /*!< LPSPI peripheral operates in master mode.*/ - kLPSPI_Slave = 0U /*!< LPSPI peripheral operates in slave mode.*/ -} lpspi_master_slave_mode_t; - -/*! @brief LPSPI Peripheral Chip Select (PCS) configuration (which PCS to configure).*/ -typedef enum _lpspi_which_pcs_config -{ - kLPSPI_Pcs0 = 0U, /*!< PCS[0] */ - kLPSPI_Pcs1 = 1U, /*!< PCS[1] */ - kLPSPI_Pcs2 = 2U, /*!< PCS[2] */ - kLPSPI_Pcs3 = 3U /*!< PCS[3] */ -} lpspi_which_pcs_t; - -/*! @brief LPSPI Peripheral Chip Select (PCS) Polarity configuration.*/ -typedef enum _lpspi_pcs_polarity_config -{ - kLPSPI_PcsActiveHigh = 1U, /*!< PCS Active High (idles low) */ - kLPSPI_PcsActiveLow = 0U /*!< PCS Active Low (idles high) */ -} lpspi_pcs_polarity_config_t; - -/*! @brief LPSPI Peripheral Chip Select (PCS) Polarity.*/ -enum _lpspi_pcs_polarity -{ - kLPSPI_Pcs0ActiveLow = 1U << 0, /*!< Pcs0 Active Low (idles high). */ - kLPSPI_Pcs1ActiveLow = 1U << 1, /*!< Pcs1 Active Low (idles high). */ - kLPSPI_Pcs2ActiveLow = 1U << 2, /*!< Pcs2 Active Low (idles high). */ - kLPSPI_Pcs3ActiveLow = 1U << 3, /*!< Pcs3 Active Low (idles high). */ - kLPSPI_PcsAllActiveLow = 0xFU /*!< Pcs0 to Pcs5 Active Low (idles high). */ -}; - -/*! @brief LPSPI clock polarity configuration.*/ -typedef enum _lpspi_clock_polarity -{ - kLPSPI_ClockPolarityActiveHigh = 0U, /*!< CPOL=0. Active-high LPSPI clock (idles low)*/ - kLPSPI_ClockPolarityActiveLow = 1U /*!< CPOL=1. Active-low LPSPI clock (idles high)*/ -} lpspi_clock_polarity_t; - -/*! @brief LPSPI clock phase configuration.*/ -typedef enum _lpspi_clock_phase -{ - kLPSPI_ClockPhaseFirstEdge = 0U, /*!< CPHA=0. Data is captured on the leading edge of the SCK and changed on the - following edge.*/ - kLPSPI_ClockPhaseSecondEdge = 1U /*!< CPHA=1. Data is changed on the leading edge of the SCK and captured on the - following edge.*/ -} lpspi_clock_phase_t; - -/*! @brief LPSPI data shifter direction options.*/ -typedef enum _lpspi_shift_direction -{ - kLPSPI_MsbFirst = 0U, /*!< Data transfers start with most significant bit.*/ - kLPSPI_LsbFirst = 1U /*!< Data transfers start with least significant bit.*/ -} lpspi_shift_direction_t; - -/*! @brief LPSPI Host Request select configuration. */ -typedef enum _lpspi_host_request_select -{ - kLPSPI_HostReqExtPin = 0U, /*!< Host Request is an ext pin. */ - kLPSPI_HostReqInternalTrigger = 1U /*!< Host Request is an internal trigger. */ -} lpspi_host_request_select_t; - -/*! @brief LPSPI Match configuration options. */ -typedef enum _lpspi_match_config -{ - kLPSI_MatchDisabled = 0x0U, /*!< LPSPI Match Disabled. */ - kLPSI_1stWordEqualsM0orM1 = 0x2U, /*!< LPSPI Match Enabled. */ - kLPSI_AnyWordEqualsM0orM1 = 0x3U, /*!< LPSPI Match Enabled. */ - kLPSI_1stWordEqualsM0and2ndWordEqualsM1 = 0x4U, /*!< LPSPI Match Enabled. */ - kLPSI_AnyWordEqualsM0andNxtWordEqualsM1 = 0x5U, /*!< LPSPI Match Enabled. */ - kLPSI_1stWordAndM1EqualsM0andM1 = 0x6U, /*!< LPSPI Match Enabled. */ - kLPSI_AnyWordAndM1EqualsM0andM1 = 0x7U, /*!< LPSPI Match Enabled. */ -} lpspi_match_config_t; - -/*! @brief LPSPI pin (SDO and SDI) configuration. */ -typedef enum _lpspi_pin_config -{ - kLPSPI_SdiInSdoOut = 0U, /*!< LPSPI SDI input, SDO output. */ - kLPSPI_SdiInSdiOut = 1U, /*!< LPSPI SDI input, SDI output. */ - kLPSPI_SdoInSdoOut = 2U, /*!< LPSPI SDO input, SDO output. */ - kLPSPI_SdoInSdiOut = 3U /*!< LPSPI SDO input, SDI output. */ -} lpspi_pin_config_t; - -/*! @brief LPSPI data output configuration. */ -typedef enum _lpspi_data_out_config -{ - kLpspiDataOutRetained = 0U, /*!< Data out retains last value when chip select is de-asserted */ - kLpspiDataOutTristate = 1U /*!< Data out is tristated when chip select is de-asserted */ -} lpspi_data_out_config_t; - -#if !(defined(FSL_FEATURE_LPSPI_HAS_NO_PCSCFG) && FSL_FEATURE_LPSPI_HAS_NO_PCSCFG) -/*! @brief LPSPI cs function configuration. */ -typedef enum _lpspi_pcs_function_config -{ - kLPSPI_PcsAsCs = 0U, /*!< PCS pin select as cs function */ - kLPSPI_PcsAsData = 1U, /*!< PCS pin select as date function */ -} lpspi_pcs_function_config_t; -#endif - -/*! @brief LPSPI transfer width configuration. */ -typedef enum _lpspi_transfer_width -{ - kLPSPI_SingleBitXfer = 0U, /*!< 1-bit shift at a time, data out on SDO, in on SDI (normal mode) */ - kLPSPI_TwoBitXfer = 1U, /*!< 2-bits shift out on SDO/SDI and in on SDO/SDI */ - kLPSPI_FourBitXfer = 2U /*!< 4-bits shift out on SDO/SDI/PCS[3:2] and in on SDO/SDI/PCS[3:2] */ -} lpspi_transfer_width_t; - -/*! @brief LPSPI delay type selection.*/ -typedef enum _lpspi_delay_type -{ - kLPSPI_PcsToSck = 1U, /*!< PCS-to-SCK delay. */ - kLPSPI_LastSckToPcs, /*!< Last SCK edge to PCS delay. */ - kLPSPI_BetweenTransfer /*!< Delay between transfers. */ -} lpspi_delay_type_t; - -#define LPSPI_MASTER_PCS_SHIFT (4U) /*!< LPSPI master PCS shift macro , internal used. */ -#define LPSPI_MASTER_PCS_MASK (0xF0U) /*!< LPSPI master PCS shift macro , internal used. */ -#if !(defined(FSL_FEATURE_LPSPI_HAS_NO_MULTI_WIDTH) && FSL_FEATURE_LPSPI_HAS_NO_MULTI_WIDTH) -#define LPSPI_MASTER_WIDTH_SHIFT (16U) /*!< LPSPI master width shift macro, internal used */ -#define LPSPI_MASTER_WIDTH_MASK (0x30000U) /*!< LPSPI master width shift mask, internal used */ -#endif - -/*! @brief Use this enumeration for LPSPI master transfer configFlags. */ -enum _lpspi_transfer_config_flag_for_master -{ - kLPSPI_MasterPcs0 = 0U << LPSPI_MASTER_PCS_SHIFT, /*!< LPSPI master transfer use PCS0 signal */ - kLPSPI_MasterPcs1 = 1U << LPSPI_MASTER_PCS_SHIFT, /*!< LPSPI master transfer use PCS1 signal */ - kLPSPI_MasterPcs2 = 2U << LPSPI_MASTER_PCS_SHIFT, /*!< LPSPI master transfer use PCS2 signal */ - kLPSPI_MasterPcs3 = 3U << LPSPI_MASTER_PCS_SHIFT, /*!< LPSPI master transfer use PCS3 signal */ -#if !(defined(FSL_FEATURE_LPSPI_HAS_NO_MULTI_WIDTH) && FSL_FEATURE_LPSPI_HAS_NO_MULTI_WIDTH) - kLPSPI_MasterWidth1 = 0U << LPSPI_MASTER_WIDTH_SHIFT, /*!< LPSPI master transfer 1bit */ - kLPSPI_MasterWidth2 = 1U << LPSPI_MASTER_WIDTH_SHIFT, /*!< LPSPI master transfer 2bit */ - kLPSPI_MasterWidth4 = 2U << LPSPI_MASTER_WIDTH_SHIFT, /*!< LPSPI master transfer 4bit */ -#endif - - kLPSPI_MasterPcsContinuous = 1U << 20, /*!< Is PCS signal continuous */ - - kLPSPI_MasterByteSwap = - 1U << 22 /*!< Is master swap the byte. - * For example, when want to send data 1 2 3 4 5 6 7 8 (suppose you set - * lpspi_shift_direction_t to MSB). - * 1. If you set bitPerFrame = 8 , no matter the kLPSPI_MasterByteSwapyou flag is used - * or not, the waveform is 1 2 3 4 5 6 7 8. - * 2. If you set bitPerFrame = 16 : - * (1) the waveform is 2 1 4 3 6 5 8 7 if you do not use the kLPSPI_MasterByteSwap flag. - * (2) the waveform is 1 2 3 4 5 6 7 8 if you use the kLPSPI_MasterByteSwap flag. - * 3. If you set bitPerFrame = 32 : - * (1) the waveform is 4 3 2 1 8 7 6 5 if you do not use the kLPSPI_MasterByteSwap flag. - * (2) the waveform is 1 2 3 4 5 6 7 8 if you use the kLPSPI_MasterByteSwap flag. - */ -}; - -#define LPSPI_SLAVE_PCS_SHIFT (4U) /*!< LPSPI slave PCS shift macro , internal used. */ -#define LPSPI_SLAVE_PCS_MASK (0xF0U) /*!< LPSPI slave PCS shift macro , internal used. */ - -/*! @brief Use this enumeration for LPSPI slave transfer configFlags. */ -enum _lpspi_transfer_config_flag_for_slave -{ - kLPSPI_SlavePcs0 = 0U << LPSPI_SLAVE_PCS_SHIFT, /*!< LPSPI slave transfer use PCS0 signal */ - kLPSPI_SlavePcs1 = 1U << LPSPI_SLAVE_PCS_SHIFT, /*!< LPSPI slave transfer use PCS1 signal */ - kLPSPI_SlavePcs2 = 2U << LPSPI_SLAVE_PCS_SHIFT, /*!< LPSPI slave transfer use PCS2 signal */ - kLPSPI_SlavePcs3 = 3U << LPSPI_SLAVE_PCS_SHIFT, /*!< LPSPI slave transfer use PCS3 signal */ - - kLPSPI_SlaveByteSwap = - 1U << 22 /*!< Is slave swap the byte. - * For example, when want to send data 1 2 3 4 5 6 7 8 (suppose you set - * lpspi_shift_direction_t to MSB). - * 1. If you set bitPerFrame = 8 , no matter the kLPSPI_SlaveByteSwap flag is used - * or not, the waveform is 1 2 3 4 5 6 7 8. - * 2. If you set bitPerFrame = 16 : - * (1) the waveform is 2 1 4 3 6 5 8 7 if you do not use the kLPSPI_SlaveByteSwap flag. - * (2) the waveform is 1 2 3 4 5 6 7 8 if you use the kLPSPI_SlaveByteSwap flag. - * 3. If you set bitPerFrame = 32 : - * (1) the waveform is 4 3 2 1 8 7 6 5 if you do not use the kLPSPI_SlaveByteSwap flag. - * (2) the waveform is 1 2 3 4 5 6 7 8 if you use the kLPSPI_SlaveByteSwap flag. - */ -}; - -/*! @brief LPSPI transfer state, which is used for LPSPI transactional API state machine. */ -enum _lpspi_transfer_state -{ - kLPSPI_Idle = 0x0U, /*!< Nothing in the transmitter/receiver. */ - kLPSPI_Busy, /*!< Transfer queue is not finished. */ - kLPSPI_Error /*!< Transfer error. */ -}; - -/*! @brief LPSPI master configuration structure.*/ -typedef struct _lpspi_master_config -{ - uint32_t baudRate; /*!< Baud Rate for LPSPI. */ - uint32_t bitsPerFrame; /*!< Bits per frame, minimum 8, maximum 4096.*/ - lpspi_clock_polarity_t cpol; /*!< Clock polarity. */ - lpspi_clock_phase_t cpha; /*!< Clock phase. */ - lpspi_shift_direction_t direction; /*!< MSB or LSB data shift direction. */ - - uint32_t pcsToSckDelayInNanoSec; /*!< PCS to SCK delay time in nanoseconds, setting to 0 sets the minimum delay. - It sets the boundary value if out of range.*/ - uint32_t lastSckToPcsDelayInNanoSec; /*!< Last SCK to PCS delay time in nanoseconds, setting to 0 sets the minimum - delay. It sets the boundary value if out of range.*/ - uint32_t betweenTransferDelayInNanoSec; /*!< After the SCK delay time with nanoseconds, setting to 0 sets the - minimum delay. It sets the boundary value if out of range.*/ - - lpspi_which_pcs_t whichPcs; /*!< Desired Peripheral Chip Select (PCS). */ - lpspi_pcs_polarity_config_t pcsActiveHighOrLow; /*!< Desired PCS active high or low */ - - lpspi_pin_config_t pinCfg; /*!< Configures which pins are used for input and output data - *during single bit transfers.*/ - -#if !(defined(FSL_FEATURE_LPSPI_HAS_NO_PCSCFG) && FSL_FEATURE_LPSPI_HAS_NO_PCSCFG) - lpspi_pcs_function_config_t pcsFunc; /*!< Configures cs pins function.*/ -#endif - lpspi_data_out_config_t dataOutConfig; /*!< Configures if the output data is tristated - * between accesses (LPSPI_PCS is negated). */ - bool enableInputDelay; /*!< Enable master to sample the input data on a delayed SCK. This can help improve slave - setup time. Refer to device data sheet for specific time length. */ -} lpspi_master_config_t; - -/*! @brief LPSPI slave configuration structure.*/ -typedef struct _lpspi_slave_config -{ - uint32_t bitsPerFrame; /*!< Bits per frame, minimum 8, maximum 4096.*/ - lpspi_clock_polarity_t cpol; /*!< Clock polarity. */ - lpspi_clock_phase_t cpha; /*!< Clock phase. */ - lpspi_shift_direction_t direction; /*!< MSB or LSB data shift direction. */ - - lpspi_which_pcs_t whichPcs; /*!< Desired Peripheral Chip Select (pcs) */ - lpspi_pcs_polarity_config_t pcsActiveHighOrLow; /*!< Desired PCS active high or low */ - - lpspi_pin_config_t pinCfg; /*!< Configures which pins are used for input and output data - *during single bit transfers.*/ - - lpspi_data_out_config_t dataOutConfig; /*!< Configures if the output data is tristated - * between accesses (LPSPI_PCS is negated). */ -} lpspi_slave_config_t; - -/*! - * @brief Forward declaration of the _lpspi_master_handle typedefs. - */ -typedef struct _lpspi_master_handle lpspi_master_handle_t; - -/*! - * @brief Forward declaration of the _lpspi_slave_handle typedefs. - */ -typedef struct _lpspi_slave_handle lpspi_slave_handle_t; - -/*! - * @brief Master completion callback function pointer type. - * - * @param base LPSPI peripheral address. - * @param handle Pointer to the handle for the LPSPI master. - * @param status Success or error code describing whether the transfer is completed. - * @param userData Arbitrary pointer-dataSized value passed from the application. - */ -typedef void (*lpspi_master_transfer_callback_t)(LPSPI_Type *base, - lpspi_master_handle_t *handle, - status_t status, - void *userData); - -/*! - * @brief Slave completion callback function pointer type. - * - * @param base LPSPI peripheral address. - * @param handle Pointer to the handle for the LPSPI slave. - * @param status Success or error code describing whether the transfer is completed. - * @param userData Arbitrary pointer-dataSized value passed from the application. - */ -typedef void (*lpspi_slave_transfer_callback_t)(LPSPI_Type *base, - lpspi_slave_handle_t *handle, - status_t status, - void *userData); - -/*! @brief LPSPI master/slave transfer structure.*/ -typedef struct _lpspi_transfer -{ - const uint8_t *txData; /*!< Send buffer. */ - uint8_t *rxData; /*!< Receive buffer. */ - volatile size_t dataSize; /*!< Transfer bytes. */ - - uint32_t configFlags; /*!< Transfer transfer configuration flags. Set from _lpspi_transfer_config_flag_for_master if - the transfer is used for master or _lpspi_transfer_config_flag_for_slave enumeration if the - transfer is used for slave.*/ -} lpspi_transfer_t; - -/*! @brief LPSPI master transfer handle structure used for transactional API. */ -struct _lpspi_master_handle -{ - volatile bool isPcsContinuous; /*!< Is PCS continuous in transfer. */ - volatile bool writeTcrInIsr; /*!< A flag that whether should write TCR in ISR. */ - - volatile bool isByteSwap; /*!< A flag that whether should byte swap. */ - volatile bool isTxMask; /*!< A flag that whether TCR[TXMSK] is set. */ - volatile uint16_t bytesPerFrame; /*!< Number of bytes in each frame */ - - volatile uint8_t fifoSize; /*!< FIFO dataSize. */ - - volatile uint8_t rxWatermark; /*!< Rx watermark. */ - - volatile uint8_t bytesEachWrite; /*!< Bytes for each write TDR. */ - volatile uint8_t bytesEachRead; /*!< Bytes for each read RDR. */ - - const uint8_t *volatile txData; /*!< Send buffer. */ - uint8_t *volatile rxData; /*!< Receive buffer. */ - volatile size_t txRemainingByteCount; /*!< Number of bytes remaining to send.*/ - volatile size_t rxRemainingByteCount; /*!< Number of bytes remaining to receive.*/ - - volatile uint32_t writeRegRemainingTimes; /*!< Write TDR register remaining times. */ - volatile uint32_t readRegRemainingTimes; /*!< Read RDR register remaining times. */ - - uint32_t totalByteCount; /*!< Number of transfer bytes*/ - - uint32_t txBuffIfNull; /*!< Used if the txData is NULL. */ - - volatile uint8_t state; /*!< LPSPI transfer state , _lpspi_transfer_state.*/ - - lpspi_master_transfer_callback_t callback; /*!< Completion callback. */ - void *userData; /*!< Callback user data. */ -}; - -/*! @brief LPSPI slave transfer handle structure used for transactional API. */ -struct _lpspi_slave_handle -{ - volatile bool isByteSwap; /*!< A flag that whether should byte swap. */ - - volatile uint8_t fifoSize; /*!< FIFO dataSize. */ - - volatile uint8_t rxWatermark; /*!< Rx watermark. */ - - volatile uint8_t bytesEachWrite; /*!< Bytes for each write TDR. */ - volatile uint8_t bytesEachRead; /*!< Bytes for each read RDR. */ - - const uint8_t *volatile txData; /*!< Send buffer. */ - uint8_t *volatile rxData; /*!< Receive buffer. */ - - volatile size_t txRemainingByteCount; /*!< Number of bytes remaining to send.*/ - volatile size_t rxRemainingByteCount; /*!< Number of bytes remaining to receive.*/ - - volatile uint32_t writeRegRemainingTimes; /*!< Write TDR register remaining times. */ - volatile uint32_t readRegRemainingTimes; /*!< Read RDR register remaining times. */ - - uint32_t totalByteCount; /*!< Number of transfer bytes*/ - - volatile uint8_t state; /*!< LPSPI transfer state , _lpspi_transfer_state.*/ - - volatile uint32_t errorCount; /*!< Error count for slave transfer.*/ - - lpspi_slave_transfer_callback_t callback; /*!< Completion callback. */ - void *userData; /*!< Callback user data. */ -}; - -/********************************************************************************************************************** - * API - *********************************************************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus*/ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Initializes the LPSPI master. - * - * @param base LPSPI peripheral address. - * @param masterConfig Pointer to structure lpspi_master_config_t. - * @param srcClock_Hz Module source input clock in Hertz - */ -void LPSPI_MasterInit(LPSPI_Type *base, const lpspi_master_config_t *masterConfig, uint32_t srcClock_Hz); - -/*! - * @brief Sets the lpspi_master_config_t structure to default values. - * - * This API initializes the configuration structure for LPSPI_MasterInit(). - * The initialized structure can remain unchanged in LPSPI_MasterInit(), or can be modified - * before calling the LPSPI_MasterInit(). - * Example: - * @code - * lpspi_master_config_t masterConfig; - * LPSPI_MasterGetDefaultConfig(&masterConfig); - * @endcode - * @param masterConfig pointer to lpspi_master_config_t structure - */ -void LPSPI_MasterGetDefaultConfig(lpspi_master_config_t *masterConfig); - -/*! - * @brief LPSPI slave configuration. - * - * @param base LPSPI peripheral address. - * @param slaveConfig Pointer to a structure lpspi_slave_config_t. - */ -void LPSPI_SlaveInit(LPSPI_Type *base, const lpspi_slave_config_t *slaveConfig); - -/*! - * @brief Sets the lpspi_slave_config_t structure to default values. - * - * This API initializes the configuration structure for LPSPI_SlaveInit(). - * The initialized structure can remain unchanged in LPSPI_SlaveInit() or can be modified - * before calling the LPSPI_SlaveInit(). - * Example: - * @code - * lpspi_slave_config_t slaveConfig; - * LPSPI_SlaveGetDefaultConfig(&slaveConfig); - * @endcode - * @param slaveConfig pointer to lpspi_slave_config_t structure. - */ -void LPSPI_SlaveGetDefaultConfig(lpspi_slave_config_t *slaveConfig); - -/*! - * @brief De-initializes the LPSPI peripheral. Call this API to disable the LPSPI clock. - * @param base LPSPI peripheral address. - */ -void LPSPI_Deinit(LPSPI_Type *base); - -/*! - * @brief Restores the LPSPI peripheral to reset state. Note that this function - * sets all registers to reset state. As a result, the LPSPI module can't work after calling - * this API. - * @param base LPSPI peripheral address. - */ -void LPSPI_Reset(LPSPI_Type *base); - -/*! - * @brief Get the LPSPI instance from peripheral base address. - * - * @param base LPSPI peripheral base address. - * @return LPSPI instance. - */ -uint32_t LPSPI_GetInstance(LPSPI_Type *base); - -/*! - * @brief Enables the LPSPI peripheral and sets the MCR MDIS to 0. - * - * @param base LPSPI peripheral address. - * @param enable Pass true to enable module, false to disable module. - */ -static inline void LPSPI_Enable(LPSPI_Type *base, bool enable) -{ - if (enable) - { - base->CR |= LPSPI_CR_MEN_MASK; - } - else - { - base->CR &= ~LPSPI_CR_MEN_MASK; - } -#if defined(FSL_FEATURE_LPSPI_HAS_ERRATA_051472) && FSL_FEATURE_LPSPI_HAS_ERRATA_051472 - /* ERRATA051472: The SR[REF] would assert if software disables the LPSPI module - after receiving some data and then enabled the LPSPI again without performing a software reset. - Clear SR[REF] flag after LPSPI module enabled*/ - if ((base->SR & (uint32_t)kLPSPI_ReceiveErrorFlag) != 0U) - { - base->SR = (uint32_t)kLPSPI_ReceiveErrorFlag; - } -#endif -} - -/*! - *@} - */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets the LPSPI status flag state. - * @param base LPSPI peripheral address. - * @return The LPSPI status(in SR register). - */ -static inline uint32_t LPSPI_GetStatusFlags(LPSPI_Type *base) -{ - return (base->SR); -} - -/*! - * @brief Gets the LPSPI Tx FIFO size. - * @param base LPSPI peripheral address. - * @return The LPSPI Tx FIFO size. - */ -static inline uint8_t LPSPI_GetTxFifoSize(LPSPI_Type *base) -{ - return (1U << ((base->PARAM & LPSPI_PARAM_TXFIFO_MASK) >> LPSPI_PARAM_TXFIFO_SHIFT)); -} - -/*! - * @brief Gets the LPSPI Rx FIFO size. - * @param base LPSPI peripheral address. - * @return The LPSPI Rx FIFO size. - */ -static inline uint8_t LPSPI_GetRxFifoSize(LPSPI_Type *base) -{ - return (1U << ((base->PARAM & LPSPI_PARAM_RXFIFO_MASK) >> LPSPI_PARAM_RXFIFO_SHIFT)); -} - -/*! - * @brief Gets the LPSPI Tx FIFO count. - * @param base LPSPI peripheral address. - * @return The number of words in the transmit FIFO. - */ -static inline uint32_t LPSPI_GetTxFifoCount(LPSPI_Type *base) -{ - return ((base->FSR & LPSPI_FSR_TXCOUNT_MASK) >> LPSPI_FSR_TXCOUNT_SHIFT); -} - -/*! - * @brief Gets the LPSPI Rx FIFO count. - * @param base LPSPI peripheral address. - * @return The number of words in the receive FIFO. - */ -static inline uint32_t LPSPI_GetRxFifoCount(LPSPI_Type *base) -{ - return ((base->FSR & LPSPI_FSR_RXCOUNT_MASK) >> LPSPI_FSR_RXCOUNT_SHIFT); -} - -/*! - * @brief Clears the LPSPI status flag. - * - * This function clears the desired status bit by using a write-1-to-clear. The user passes in the base and the - * desired status flag bit to clear. The list of status flags is defined in the _lpspi_flags. - * Example usage: - * @code - * LPSPI_ClearStatusFlags(base, kLPSPI_TxDataRequestFlag|kLPSPI_RxDataReadyFlag); - * @endcode - * - * @param base LPSPI peripheral address. - * @param statusFlags The status flag used from type _lpspi_flags. - */ -static inline void LPSPI_ClearStatusFlags(LPSPI_Type *base, uint32_t statusFlags) -{ - base->SR = statusFlags; /*!< The status flags are cleared by writing 1 (w1c).*/ -} - -/*! - *@} - */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables the LPSPI interrupts. - * - * This function configures the various interrupt masks of the LPSPI. The parameters are base and an interrupt mask. - * Note that, for Tx fill and Rx FIFO drain requests, enabling the interrupt request disables the DMA request. - * - * @code - * LPSPI_EnableInterrupts(base, kLPSPI_TxInterruptEnable | kLPSPI_RxInterruptEnable ); - * @endcode - * - * @param base LPSPI peripheral address. - * @param mask The interrupt mask; Use the enum _lpspi_interrupt_enable. - */ -static inline void LPSPI_EnableInterrupts(LPSPI_Type *base, uint32_t mask) -{ - base->IER |= mask; -} - -/*! - * @brief Disables the LPSPI interrupts. - * - * @code - * LPSPI_DisableInterrupts(base, kLPSPI_TxInterruptEnable | kLPSPI_RxInterruptEnable ); - * @endcode - * - * @param base LPSPI peripheral address. - * @param mask The interrupt mask; Use the enum _lpspi_interrupt_enable. - */ -static inline void LPSPI_DisableInterrupts(LPSPI_Type *base, uint32_t mask) -{ - base->IER &= ~mask; -} - -/*! - *@} - */ - -/*! - * @name DMA Control - * @{ - */ - -/*! - * @brief Enables the LPSPI DMA request. - * - * This function configures the Rx and Tx DMA mask of the LPSPI. The parameters are base and a DMA mask. - * @code - * LPSPI_EnableDMA(base, kLPSPI_TxDmaEnable | kLPSPI_RxDmaEnable); - * @endcode - * - * @param base LPSPI peripheral address. - * @param mask The interrupt mask; Use the enum _lpspi_dma_enable. - */ -static inline void LPSPI_EnableDMA(LPSPI_Type *base, uint32_t mask) -{ - base->DER |= mask; -} - -/*! - * @brief Disables the LPSPI DMA request. - * - * This function configures the Rx and Tx DMA mask of the LPSPI. The parameters are base and a DMA mask. - * @code - * SPI_DisableDMA(base, kLPSPI_TxDmaEnable | kLPSPI_RxDmaEnable); - * @endcode - * - * @param base LPSPI peripheral address. - * @param mask The interrupt mask; Use the enum _lpspi_dma_enable. - */ -static inline void LPSPI_DisableDMA(LPSPI_Type *base, uint32_t mask) -{ - base->DER &= ~mask; -} - -/*! - * @brief Gets the LPSPI Transmit Data Register address for a DMA operation. - * - * This function gets the LPSPI Transmit Data Register address because this value is needed - * for the DMA operation. - * This function can be used for either master or slave mode. - * - * @param base LPSPI peripheral address. - * @return The LPSPI Transmit Data Register address. - */ -static inline uint32_t LPSPI_GetTxRegisterAddress(LPSPI_Type *base) -{ - return (uint32_t) & (base->TDR); -} - -/*! - * @brief Gets the LPSPI Receive Data Register address for a DMA operation. - * - * This function gets the LPSPI Receive Data Register address because this value is needed - * for the DMA operation. - * This function can be used for either master or slave mode. - * - * @param base LPSPI peripheral address. - * @return The LPSPI Receive Data Register address. - */ -static inline uint32_t LPSPI_GetRxRegisterAddress(LPSPI_Type *base) -{ - return (uint32_t) & (base->RDR); -} - -/*! - *@} - */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Check the argument for transfer . - * - * @param base LPSPI peripheral address. - * @param transfer the transfer struct to be used. - * @param isEdma True to check for EDMA transfer, false to check interrupt non-blocking transfer - * @return Return true for right and false for wrong. - */ -bool LPSPI_CheckTransferArgument(LPSPI_Type *base, lpspi_transfer_t *transfer, bool isEdma); - -/*! - * @brief Configures the LPSPI for either master or slave. - * - * Note that the CFGR1 should only be written when the LPSPI is disabled (LPSPIx_CR_MEN = 0). - * - * @param base LPSPI peripheral address. - * @param mode Mode setting (master or slave) of type lpspi_master_slave_mode_t. - */ -static inline void LPSPI_SetMasterSlaveMode(LPSPI_Type *base, lpspi_master_slave_mode_t mode) -{ - base->CFGR1 = (base->CFGR1 & (~LPSPI_CFGR1_MASTER_MASK)) | LPSPI_CFGR1_MASTER(mode); -} - -/*! - * @brief Configures the peripheral chip select used for the transfer. - * - * @param base LPSPI peripheral address. - * @param select LPSPI Peripheral Chip Select (PCS) configuration. - */ -static inline void LPSPI_SelectTransferPCS(LPSPI_Type *base, lpspi_which_pcs_t select) -{ - base->TCR = (base->TCR & (~LPSPI_TCR_PCS_MASK)) | LPSPI_TCR_PCS((uint8_t)select); -} - -/*! - * @brief Set the PCS signal to continuous or uncontinuous mode. - * - * @note In master mode, continuous transfer will keep the PCS asserted at the end of the frame size, until a command - * word is received that starts a new frame. So PCS must be set back to uncontinuous when transfer finishes. - * In slave mode, when continuous transfer is enabled, the LPSPI will only transmit the first frame size bits, after - * that the LPSPI will transmit received data back (assuming a 32-bit shift register). - * - * @param base LPSPI peripheral address. - * @param IsContinous True to set the transfer PCS to continuous mode, false to set to uncontinuous mode. - */ -static inline void LPSPI_SetPCSContinous(LPSPI_Type *base, bool IsContinous) -{ - if (IsContinous) - { - base->TCR |= LPSPI_TCR_CONT_MASK; - } - else - { - base->TCR &= ~LPSPI_TCR_CONT_MASK; - } -} - -/*! - * @brief Returns whether the LPSPI module is in master mode. - * - * @param base LPSPI peripheral address. - * @return Returns true if the module is in master mode or false if the module is in slave mode. - */ -static inline bool LPSPI_IsMaster(LPSPI_Type *base) -{ - return (bool)((base->CFGR1) & LPSPI_CFGR1_MASTER_MASK); -} - -/*! - * @brief Flushes the LPSPI FIFOs. - * - * @param base LPSPI peripheral address. - * @param flushTxFifo Flushes (true) the Tx FIFO, else do not flush (false) the Tx FIFO. - * @param flushRxFifo Flushes (true) the Rx FIFO, else do not flush (false) the Rx FIFO. - */ -static inline void LPSPI_FlushFifo(LPSPI_Type *base, bool flushTxFifo, bool flushRxFifo) -{ -#if defined(FSL_FEATURE_LPSPI_HAS_ERRATA_050456) && FSL_FEATURE_LPSPI_HAS_ERRATA_050456 - /* - * Resetting the FIFO using CR[RTF] and CR[RRF] does not clear the FIFO pointers completely. - * Workaround by reseting the entire module using CR[RST] bit. - */ - - (void)flushTxFifo; - (void)flushRxFifo; - - /* Save current state before resetting */ - bool enabled = base->CR & LPSPI_CR_MEN_MASK; - uint32_t cfgr1 = base->CFGR1; - uint32_t ccr = base->CCR; - uint32_t ccr1 = base->CCR1; - - /* To read the current state of the existing command word, LPSPI must be enabled */ - LPSPI_Enable(base, true); - uint32_t tcr = base->TCR; - - /* Reset all internal logic and registers. Bit remains set until cleared by software */ - LPSPI_Enable(base, false); - base->CR |= LPSPI_CR_RST_MASK; - base->CR &= ~LPSPI_CR_RST_MASK; - - /* Restore saved registers */ - base->CFGR1 = cfgr1; - base->CCR = ccr; - base->CCR1 = ccr1; - base->TCR = tcr; - - LPSPI_Enable(base, enabled); -#else - base->CR |= ((uint32_t)flushTxFifo << LPSPI_CR_RTF_SHIFT) | ((uint32_t)flushRxFifo << LPSPI_CR_RRF_SHIFT); -#endif -} - -/*! - * @brief Sets the transmit and receive FIFO watermark values. - * - * This function allows the user to set the receive and transmit FIFO watermarks. The function - * does not compare the watermark settings to the FIFO size. The FIFO watermark should not be - * equal to or greater than the FIFO size. It is up to the higher level driver to make this check. - * - * @param base LPSPI peripheral address. - * @param txWater The TX FIFO watermark value. Writing a value equal or greater than the FIFO size is truncated. - * @param rxWater The RX FIFO watermark value. Writing a value equal or greater than the FIFO size is truncated. - */ -static inline void LPSPI_SetFifoWatermarks(LPSPI_Type *base, uint32_t txWater, uint32_t rxWater) -{ - base->FCR = LPSPI_FCR_TXWATER(txWater) | LPSPI_FCR_RXWATER(rxWater); -} - -/*! - * @brief Configures all LPSPI peripheral chip select polarities simultaneously. - * - * Note that the CFGR1 should only be written when the LPSPI is disabled (LPSPIx_CR_MEN = 0). - * - * This is an example: PCS0 and PCS1 set to active low and other PCSs set to active high. Note that the number of - * PCS is device-specific. - * @code - * LPSPI_SetAllPcsPolarity(base, kLPSPI_Pcs0ActiveLow | kLPSPI_Pcs1ActiveLow); - * @endcode - * - * @param base LPSPI peripheral address. - * @param mask The PCS polarity mask; Use the enum _lpspi_pcs_polarity. - */ -static inline void LPSPI_SetAllPcsPolarity(LPSPI_Type *base, uint32_t mask) -{ - base->CFGR1 = (base->CFGR1 & ~LPSPI_CFGR1_PCSPOL_MASK) | LPSPI_CFGR1_PCSPOL(~mask); -} - -/*! - * @brief Configures the frame size. - * - * The minimum frame size is 8-bits and the maximum frame size is 4096-bits. If the frame size is less than or equal - * to 32-bits, the word size and frame size are identical. If the frame size is greater than 32-bits, the word - * size is 32-bits for each word except the last (the last word contains the remainder bits if the frame size is not - * divisible by 32). The minimum word size is 2-bits. A frame size of 33-bits (or similar) is not supported. - * - * Note 1: The transmit command register should be initialized before enabling the LPSPI in slave mode, although - * the command register does not update until after the LPSPI is enabled. After it is enabled, the transmit command - * register - * should only be changed if the LPSPI is idle. - * - * Note 2: The transmit and command FIFO is a combined FIFO that includes both transmit data and command words. That - * means the TCR register should be written to when the Tx FIFO is not full. - * - * @param base LPSPI peripheral address. - * @param frameSize The frame size in number of bits. - */ -static inline void LPSPI_SetFrameSize(LPSPI_Type *base, uint32_t frameSize) -{ - base->TCR = (base->TCR & ~LPSPI_TCR_FRAMESZ_MASK) | LPSPI_TCR_FRAMESZ(frameSize - 1U); -} - -/*! - * @brief Sets the LPSPI baud rate in bits per second. - * - * This function takes in the desired bitsPerSec (baud rate) and calculates the nearest - * possible baud rate without exceeding the desired baud rate and returns the - * calculated baud rate in bits-per-second. It requires the caller to provide - * the frequency of the module source clock (in Hertz). Note that the baud rate - * does not go into effect until the Transmit Control Register (TCR) is programmed - * with the prescale value. Hence, this function returns the prescale tcrPrescaleValue - * parameter for later programming in the TCR. The higher level - * peripheral driver should alert the user of an out of range baud rate input. - * - * Note that the LPSPI module must first be disabled before configuring this. - * Note that the LPSPI module must be configured for master mode before configuring this. - * - * @param base LPSPI peripheral address. - * @param baudRate_Bps The desired baud rate in bits per second. - * @param srcClock_Hz Module source input clock in Hertz. - * @param tcrPrescaleValue The TCR prescale value needed to program the TCR. - * @return The actual calculated baud rate. This function may also return a "0" if the - * LPSPI is not configured for master mode or if the LPSPI module is not disabled. - */ - -uint32_t LPSPI_MasterSetBaudRate(LPSPI_Type *base, - uint32_t baudRate_Bps, - uint32_t srcClock_Hz, - uint32_t *tcrPrescaleValue); - -/*! - * @brief Manually configures a specific LPSPI delay parameter (module must be disabled to - * change the delay values). - * - * This function configures the following: - * SCK to PCS delay, or - * PCS to SCK delay, or - * The configurations must occur between the transfer delay. - * - * The delay names are available in type lpspi_delay_type_t. - * - * The user passes the desired delay along with the delay value. - * This allows the user to directly set the delay values if they have - * pre-calculated them or if they simply wish to manually increment the value. - * - * Note that the LPSPI module must first be disabled before configuring this. - * Note that the LPSPI module must be configured for master mode before configuring this. - * - * @param base LPSPI peripheral address. - * @param scaler The 8-bit delay value 0x00 to 0xFF (255). - * @param whichDelay The desired delay to configure, must be of type lpspi_delay_type_t. - */ -void LPSPI_MasterSetDelayScaler(LPSPI_Type *base, uint32_t scaler, lpspi_delay_type_t whichDelay); - -/*! - * @brief Calculates the delay based on the desired delay input in nanoseconds (module must be - * disabled to change the delay values). - * - * This function calculates the values for the following: - * SCK to PCS delay, or - * PCS to SCK delay, or - * The configurations must occur between the transfer delay. - * - * The delay names are available in type lpspi_delay_type_t. - * - * The user passes the desired delay and the desired delay value in - * nano-seconds. The function calculates the value needed for the desired delay parameter - * and returns the actual calculated delay because an exact delay match may not be possible. In this - * case, the closest match is calculated without going below the desired delay value input. - * It is possible to input a very large delay value that exceeds the capability of the part, in - * which case the maximum supported delay is returned. It is up to the higher level - * peripheral driver to alert the user of an out of range delay input. - * - * Note that the LPSPI module must be configured for master mode before configuring this. And note that - * the delayTime = LPSPI_clockSource / (PRESCALE * Delay_scaler). - * - * @param base LPSPI peripheral address. - * @param delayTimeInNanoSec The desired delay value in nano-seconds. - * @param whichDelay The desired delay to configuration, which must be of type lpspi_delay_type_t. - * @param srcClock_Hz Module source input clock in Hertz. - * @return actual Calculated delay value in nano-seconds. - */ -uint32_t LPSPI_MasterSetDelayTimes(LPSPI_Type *base, - uint32_t delayTimeInNanoSec, - lpspi_delay_type_t whichDelay, - uint32_t srcClock_Hz); - -/*! - * @brief Writes data into the transmit data buffer. - * - * This function writes data passed in by the user to the Transmit Data Register (TDR). - * The user can pass up to 32-bits of data to load into the TDR. If the frame size exceeds 32-bits, - * the user has to manage sending the data one 32-bit word at a time. - * Any writes to the TDR result in an immediate push to the transmit FIFO. - * This function can be used for either master or slave modes. - * - * @param base LPSPI peripheral address. - * @param data The data word to be sent. - */ -static inline void LPSPI_WriteData(LPSPI_Type *base, uint32_t data) -{ - base->TDR = data; -} - -/*! - * @brief Reads data from the data buffer. - * - * This function reads the data from the Receive Data Register (RDR). - * This function can be used for either master or slave mode. - * - * @param base LPSPI peripheral address. - * @return The data read from the data buffer. - */ -static inline uint32_t LPSPI_ReadData(LPSPI_Type *base) -{ - return (base->RDR); -} - -/*! - * @brief Set up the dummy data. - * - * @param base LPSPI peripheral address. - * @param dummyData Data to be transferred when tx buffer is NULL. - * Note: - * This API has no effect when LPSPI in slave interrupt mode, because driver - * will set the TXMSK bit to 1 if txData is NULL, no data is loaded from transmit - * FIFO and output pin is tristated. - */ -void LPSPI_SetDummyData(LPSPI_Type *base, uint8_t dummyData); - -/*! - *@} - */ - -/*! - * @name Transactional - * @{ - */ -/*Transactional APIs*/ - -/*! - * @brief Initializes the LPSPI master handle. - * - * This function initializes the LPSPI handle, which can be used for other LPSPI transactional APIs. Usually, for a - * specified LPSPI instance, call this API once to get the initialized handle. - - * @param base LPSPI peripheral address. - * @param handle LPSPI handle pointer to lpspi_master_handle_t. - * @param callback DSPI callback. - * @param userData callback function parameter. - */ -void LPSPI_MasterTransferCreateHandle(LPSPI_Type *base, - lpspi_master_handle_t *handle, - lpspi_master_transfer_callback_t callback, - void *userData); - -/*! - * @brief LPSPI master transfer data using a polling method. - * - * This function transfers data using a polling method. This is a blocking function, which does not return until all - * transfers have been - * completed. - * - * Note: - * The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not integer multiples of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * @param base LPSPI peripheral address. - * @param transfer pointer to lpspi_transfer_t structure. - * @return status of status_t. - */ -status_t LPSPI_MasterTransferBlocking(LPSPI_Type *base, lpspi_transfer_t *transfer); - -/*! - * @brief LPSPI master transfer data using an interrupt method. - * - * This function transfers data using an interrupt method. This is a non-blocking function, which returns right away. - * When all data is transferred, the callback function is called. - * - * Note: - * The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not integer multiples of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * @param base LPSPI peripheral address. - * @param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - * @param transfer pointer to lpspi_transfer_t structure. - * @return status of status_t. - */ -status_t LPSPI_MasterTransferNonBlocking(LPSPI_Type *base, lpspi_master_handle_t *handle, lpspi_transfer_t *transfer); - -/*! - * @brief Gets the master transfer remaining bytes. - * - * This function gets the master transfer remaining bytes. - * - * @param base LPSPI peripheral address. - * @param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - * @param count Number of bytes transferred so far by the non-blocking transaction. - * @return status of status_t. - */ -status_t LPSPI_MasterTransferGetCount(LPSPI_Type *base, lpspi_master_handle_t *handle, size_t *count); - -/*! - * @brief LPSPI master abort transfer which uses an interrupt method. - * - * This function aborts a transfer which uses an interrupt method. - * - * @param base LPSPI peripheral address. - * @param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - */ -void LPSPI_MasterTransferAbort(LPSPI_Type *base, lpspi_master_handle_t *handle); - -/*! - * @brief LPSPI Master IRQ handler function. - * - * This function processes the LPSPI transmit and receive IRQ. - * - * @param base LPSPI peripheral address. - * @param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - */ -void LPSPI_MasterTransferHandleIRQ(LPSPI_Type *base, lpspi_master_handle_t *handle); - -/*! - * @brief Initializes the LPSPI slave handle. - * - * This function initializes the LPSPI handle, which can be used for other LPSPI transactional APIs. Usually, for a - * specified LPSPI instance, call this API once to get the initialized handle. - * - * @param base LPSPI peripheral address. - * @param handle LPSPI handle pointer to lpspi_slave_handle_t. - * @param callback DSPI callback. - * @param userData callback function parameter. - */ -void LPSPI_SlaveTransferCreateHandle(LPSPI_Type *base, - lpspi_slave_handle_t *handle, - lpspi_slave_transfer_callback_t callback, - void *userData); - -/*! - * @brief LPSPI slave transfer data using an interrupt method. - * - * This function transfer data using an interrupt method. This is a non-blocking function, which returns right away. - * When all data is transferred, the callback function is called. - * - * Note: - * The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not an integer multiple of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * @param base LPSPI peripheral address. - * @param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - * @param transfer pointer to lpspi_transfer_t structure. - * @return status of status_t. - */ -status_t LPSPI_SlaveTransferNonBlocking(LPSPI_Type *base, lpspi_slave_handle_t *handle, lpspi_transfer_t *transfer); - -/*! - * @brief Gets the slave transfer remaining bytes. - * - * This function gets the slave transfer remaining bytes. - * - * @param base LPSPI peripheral address. - * @param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - * @param count Number of bytes transferred so far by the non-blocking transaction. - * @return status of status_t. - */ -status_t LPSPI_SlaveTransferGetCount(LPSPI_Type *base, lpspi_slave_handle_t *handle, size_t *count); - -/*! - * @brief LPSPI slave aborts a transfer which uses an interrupt method. - * - * This function aborts a transfer which uses an interrupt method. - * - * @param base LPSPI peripheral address. - * @param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - */ -void LPSPI_SlaveTransferAbort(LPSPI_Type *base, lpspi_slave_handle_t *handle); - -/*! - * @brief LPSPI Slave IRQ handler function. - * - * This function processes the LPSPI transmit and receives an IRQ. - * - * @param base LPSPI peripheral address. - * @param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - */ -void LPSPI_SlaveTransferHandleIRQ(LPSPI_Type *base, lpspi_slave_handle_t *handle); - -/*! - * @brief Wait for tx FIFO to be empty. - * - * This function wait the tx fifo empty - * - * @param base LPSPI peripheral address. - * @return true for the tx FIFO is ready, false is not. - */ -bool LPSPI_WaitTxFifoEmpty(LPSPI_Type *base); - -/*! - *@} - */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /*FSL_LPSPI_H_*/ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpspi_edma.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpspi_edma.c deleted file mode 100644 index 1b2af7d90f8..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpspi_edma.c +++ /dev/null @@ -1,1324 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpspi_edma.h" - -/* - * $Coverage Justification Reference$ - * - * $Justification fsl_lpspi_edma_c_ref_1$ - * The default branch cannot be executed in any circumstances, it is only added to avoid MISRA violation. - * - */ -/*********************************************************************************************************************** - * Definitions - ***********************************************************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpspi_edma" -#endif - -/*! - * @brief Structure definition for dspi_master_edma_private_handle_t. The structure is private. - */ -typedef struct _lpspi_master_edma_private_handle -{ - LPSPI_Type *base; /*!< LPSPI peripheral base address. */ - lpspi_master_edma_handle_t *handle; /*!< lpspi_master_edma_handle_t handle */ -} lpspi_master_edma_private_handle_t; - -/*! - * @brief Structure definition for dspi_slave_edma_private_handle_t. The structure is private. - */ -typedef struct _lpspi_slave_edma_private_handle -{ - LPSPI_Type *base; /*!< LPSPI peripheral base address. */ - lpspi_slave_edma_handle_t *handle; /*!< lpspi_slave_edma_handle_t handle */ -} lpspi_slave_edma_private_handle_t; - -/*********************************************************************************************************************** - * Prototypes - ***********************************************************************************************************************/ - -/*! - * @brief EDMA_LpspiMasterCallback after the LPSPI master transfer completed by using EDMA. - * This is not a public API. - */ -static void EDMA_LpspiMasterCallback(edma_handle_t *edmaHandle, - void *g_lpspiEdmaPrivateHandle, - bool transferDone, - uint32_t tcds); - -/*! - * @brief EDMA_LpspiSlaveCallback after the LPSPI slave transfer completed by using EDMA. - * This is not a public API. - */ -static void EDMA_LpspiSlaveCallback(edma_handle_t *edmaHandle, - void *g_lpspiEdmaPrivateHandle, - bool transferDone, - uint32_t tcds); - -static void LPSPI_SeparateEdmaReadData(uint8_t *rxData, uint32_t readData, uint32_t bytesEachRead, bool isByteSwap); - -/*********************************************************************************************************************** - * Variables - ***********************************************************************************************************************/ -/*! @brief Pointers to lpspi bases for each instance. */ -static LPSPI_Type *const s_lpspiBases[] = LPSPI_BASE_PTRS; - -/*! @brief Pointers to lpspi edma handles for each instance. */ -static lpspi_master_edma_private_handle_t s_lpspiMasterEdmaPrivateHandle[ARRAY_SIZE(s_lpspiBases)]; -static lpspi_slave_edma_private_handle_t s_lpspiSlaveEdmaPrivateHandle[ARRAY_SIZE(s_lpspiBases)]; - -/*********************************************************************************************************************** - * Code - ***********************************************************************************************************************/ -static void LPSPI_SeparateEdmaReadData(uint8_t *rxData, uint32_t readData, uint32_t bytesEachRead, bool isByteSwap) -{ - assert(rxData != NULL); - - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_edma_c_ref_1$ - */ - switch (bytesEachRead) - { - case 1: - if (!isByteSwap) - { - *rxData = (uint8_t)readData; - ++rxData; - } - else - { - *rxData = (uint8_t)(readData >> 24); - ++rxData; - } - break; - - case 2: - if (!isByteSwap) - { - *rxData = (uint8_t)readData; - ++rxData; - *rxData = (uint8_t)(readData >> 8); - ++rxData; - } - else - { - *rxData = (uint8_t)(readData >> 16); - ++rxData; - *rxData = (uint8_t)(readData >> 24); - ++rxData; - } - break; - - case 4: - - *rxData = (uint8_t)readData; - ++rxData; - *rxData = (uint8_t)(readData >> 8); - ++rxData; - *rxData = (uint8_t)(readData >> 16); - ++rxData; - *rxData = (uint8_t)(readData >> 24); - ++rxData; - - break; - - default: - assert(false); - break; - } -} - -/*! - * brief Initializes the LPSPI master eDMA handle. - * - * This function initializes the LPSPI eDMA handle which can be used for other LPSPI transactional APIs. Usually, for a - * specified LPSPI instance, call this API once to get the initialized handle. - * - * Note that the LPSPI eDMA has a separated (Rx and Rx as two sources) or shared (Rx and Tx are the same source) DMA - * request source. - * (1) For a separated DMA request source, enable and set the Rx DMAMUX source for edmaRxRegToRxDataHandle and - * Tx DMAMUX source for edmaIntermediaryToTxRegHandle. - * (2) For a shared DMA request source, enable and set the Rx/Rx DMAMUX source for edmaRxRegToRxDataHandle. - * - * param base LPSPI peripheral base address. - * param handle LPSPI handle pointer to lpspi_master_edma_handle_t. - * param callback LPSPI callback. - * param userData callback function parameter. - * param edmaRxRegToRxDataHandle edmaRxRegToRxDataHandle pointer to edma_handle_t. - * param edmaTxDataToTxRegHandle edmaTxDataToTxRegHandle pointer to edma_handle_t. - */ -void LPSPI_MasterTransferCreateHandleEDMA(LPSPI_Type *base, - lpspi_master_edma_handle_t *handle, - lpspi_master_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *edmaRxRegToRxDataHandle, - edma_handle_t *edmaTxDataToTxRegHandle) -{ - assert(handle != NULL); - assert(edmaRxRegToRxDataHandle != NULL); - assert(edmaTxDataToTxRegHandle != NULL); - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - uint32_t instance = LPSPI_GetInstance(base); - - s_lpspiMasterEdmaPrivateHandle[instance].base = base; - s_lpspiMasterEdmaPrivateHandle[instance].handle = handle; - - handle->callback = callback; - handle->userData = userData; - handle->dataBytesEveryTime = DMA_MAX_TRANSFER_COUNT; - - handle->edmaRxRegToRxDataHandle = edmaRxRegToRxDataHandle; - handle->edmaTxDataToTxRegHandle = edmaTxDataToTxRegHandle; -} - -static void LPSPI_PrepareTransferEDMA(LPSPI_Type *base) -{ - /* Flush FIFO, clear status, disable all the inerrupts and DMA requests. */ - LPSPI_FlushFifo(base, true, true); - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_AllStatusFlag); - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_AllInterruptEnable); - LPSPI_DisableDMA(base, (uint32_t)kLPSPI_RxDmaEnable | (uint32_t)kLPSPI_TxDmaEnable); -} - -/*! - * brief LPSPI master config transfer parameter using eDMA. - * - * This function is preparing to transfer data using eDMA. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_master_edma_handle_t structure which stores the transfer state. - * param configFlags transfer configuration flags. ref _lpspi_transfer_config_flag_for_master. - * return Indicates whether LPSPI master transfer was successful or not. - * retval kStatus_Success Execution successfully. - * retval kStatus_LPSPI_Busy The LPSPI device is busy. - */ -status_t LPSPI_MasterTransferPrepareEDMALite(LPSPI_Type *base, lpspi_master_edma_handle_t *handle, uint32_t configFlags) -{ - assert(handle != NULL); - - /* Check that we're not busy.*/ - if (handle->state == (uint8_t)kLPSPI_Busy) - { - return kStatus_LPSPI_Busy; - } - - /* Disable module before configuration */ - LPSPI_Enable(base, false); - - LPSPI_PrepareTransferEDMA(base); - - bool isByteSwap = ((configFlags & (uint32_t)kLPSPI_MasterByteSwap) != 0U); - bool isPcsContinuous = ((configFlags & (uint32_t)kLPSPI_MasterPcsContinuous) != 0U); - uint32_t instance = LPSPI_GetInstance(base); - uint8_t dummyData = g_lpspiDummyData[instance]; - /*Used for byte swap*/ - uint32_t whichPcs = (configFlags & LPSPI_MASTER_PCS_MASK) >> LPSPI_MASTER_PCS_SHIFT; - uint32_t bytesPerFrame = ((base->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT) / 8U + 1U; - - handle->txBuffIfNull = - ((uint32_t)dummyData) | ((uint32_t)dummyData << 8) | ((uint32_t)dummyData << 16) | ((uint32_t)dummyData << 24); - /*The TX and RX FIFO sizes are always the same*/ - handle->fifoSize = LPSPI_GetRxFifoSize(base); - handle->isPcsContinuous = isPcsContinuous; - handle->isByteSwap = isByteSwap; - handle->isThereExtraRxBytes = false; - - /*Because DMA is fast enough , so set the RX and TX watermarks to 0 .*/ - LPSPI_SetFifoWatermarks(base, 0U, 0U); - - /* Transfers will stall when transmit FIFO is empty or receive FIFO is full. */ - base->CFGR1 &= (~LPSPI_CFGR1_NOSTALL_MASK); - - /* Enable module for following configuration of TCR to take effect. */ - LPSPI_Enable(base, true); - - /* For DMA transfer , we'd better not masked the transmit data and receive data in TCR since the transfer flow is - * hard to controlled by software. */ - base->TCR = (base->TCR & ~(LPSPI_TCR_CONT_MASK | LPSPI_TCR_CONTC_MASK | LPSPI_TCR_BYSW_MASK | LPSPI_TCR_PCS_MASK)) | - LPSPI_TCR_CONT(isPcsContinuous) | LPSPI_TCR_BYSW(isByteSwap) | LPSPI_TCR_PCS(whichPcs); - /*Calculate the bytes for write/read the TX/RX register each time*/ - if (bytesPerFrame <= 4U) - { - handle->bytesEachWrite = (uint8_t)bytesPerFrame; - handle->bytesEachRead = (uint8_t)bytesPerFrame; - handle->bytesLastRead = (uint8_t)bytesPerFrame; - } - else - { - handle->bytesEachWrite = 4U; - handle->bytesEachRead = 4U; - - handle->bytesLastRead = 4U; - } - return kStatus_Success; -} - -/*! - * brief LPSPI master transfer data using eDMA without configs. - * - * This function transfers data using eDMA. This is a non-blocking function, which returns right away. When all data - * is transferred, the callback function is called. - * - * Note: - * This API is only for transfer through DMA without configuration. - * Before calling this API, you must call LPSPI_MasterTransferPrepareEDMALite to configure it once. - * The transfer data size should be an integer multiple of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not an integer multiple of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_master_edma_handle_t structure which stores the transfer state. - * param transfer pointer to lpspi_transfer_t structure, config field is not working. - * return Indicates whether LPSPI master transfer was successful or not. - * retval kStatus_Success Execution successfully. - * retval kStatus_LPSPI_Busy The LPSPI device is busy. - * retval kStatus_InvalidArgument The transfer structure is invalid. - */ -status_t LPSPI_MasterTransferEDMALite(LPSPI_Type *base, lpspi_master_edma_handle_t *handle, lpspi_transfer_t *transfer) -{ - assert(handle != NULL); - assert(transfer != NULL); - - /* Check that we're not busy.*/ - if (handle->state == (uint8_t)kLPSPI_Busy) - { - return kStatus_LPSPI_Busy; - } - - /* Check arguements */ - if (!LPSPI_CheckTransferArgument(base, transfer, true)) - { - return kStatus_InvalidArgument; - } - - /* Variables */ - uint32_t firstTimeDataSize = 0; - bool isThereExtraTxBytes = false; - uint8_t bytesLastWrite = 0; - uint32_t instance = LPSPI_GetInstance(base); - /*Used for byte swap*/ - uint32_t addrOffset = 0; - uint32_t rxAddr = LPSPI_GetRxRegisterAddress(base); - uint32_t txAddr = LPSPI_GetTxRegisterAddress(base); - uint32_t bytesPerFrame = ((base->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT) / 8U + 1U; - edma_transfer_config_t transferConfigRx = {0}; - edma_transfer_config_t transferConfigTx = {0}; - edma_tcd_t *softwareTCD_pcsContinuous = (edma_tcd_t *)((uint32_t)(&handle->lpspiSoftwareTCD[2]) & (~0x1FU)); - edma_tcd_t *softwareTCD_extraBytes = (edma_tcd_t *)((uint32_t)(&handle->lpspiSoftwareTCD[1]) & (~0x1FU)); - - if (transfer->dataSize <= bytesPerFrame) - { - /* Once dma transfer*/ - firstTimeDataSize = transfer->dataSize; - handle->isMultiDMATransmit = false; - } - else if (transfer->dataSize > handle->dataBytesEveryTime) - { - /* More dma transfer*/ - firstTimeDataSize = handle->dataBytesEveryTime; - handle->isMultiDMATransmit = true; - if (transfer->dataSize % handle->dataBytesEveryTime != 0U) - { - handle->lastTimeDataBytes = transfer->dataSize % handle->dataBytesEveryTime; - } - else - { - handle->lastTimeDataBytes = handle->dataBytesEveryTime; - } - - handle->dmaTransmitTime = - (uint8_t)((transfer->dataSize + handle->dataBytesEveryTime - 1U) / handle->dataBytesEveryTime); - } - else - { - /* Once dma transfer*/ - firstTimeDataSize = transfer->dataSize; - handle->isMultiDMATransmit = false; - } - handle->state = (uint8_t)kLPSPI_Busy; - handle->txData = transfer->txData; - handle->rxData = transfer->rxData; - handle->txRemainingByteCount = firstTimeDataSize; - handle->rxRemainingByteCount = firstTimeDataSize; - handle->totalByteCount = firstTimeDataSize; - handle->writeRegRemainingTimes = (firstTimeDataSize / bytesPerFrame) * ((bytesPerFrame + 3U) / 4U); - handle->readRegRemainingTimes = handle->writeRegRemainingTimes; - - handle->isThereExtraRxBytes = false; - - /*Calculate the bytes for write/read the TX/RX register each time*/ - if (bytesPerFrame > 4U) - { - if ((transfer->dataSize % 4U) != 0U) - { - bytesLastWrite = (uint8_t)(transfer->dataSize % 4U); - handle->bytesLastRead = bytesLastWrite; - - isThereExtraTxBytes = true; - - --handle->writeRegRemainingTimes; - - --handle->readRegRemainingTimes; - handle->isThereExtraRxBytes = true; - } - } - - EDMA_SetCallback(handle->edmaRxRegToRxDataHandle, EDMA_LpspiMasterCallback, - &s_lpspiMasterEdmaPrivateHandle[instance]); - - /* Configure rx EDMA transfer */ - EDMA_ResetChannel(handle->edmaRxRegToRxDataHandle->base, handle->edmaRxRegToRxDataHandle->channel); - - if (handle->rxData != NULL) - { - transferConfigRx.destAddr = (uint32_t) & (handle->rxData[0]); - transferConfigRx.destOffset = 1; - } - else - { - transferConfigRx.destAddr = (uint32_t) & (handle->rxBuffIfNull); - transferConfigRx.destOffset = 0; - } - transferConfigRx.destTransferSize = kEDMA_TransferSize1Bytes; - - addrOffset = 0; - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_edma_c_ref_1$ - */ - switch (handle->bytesEachRead) - { - case (1U): - transferConfigRx.srcTransferSize = kEDMA_TransferSize1Bytes; - transferConfigRx.minorLoopBytes = 1; - if (handle->isByteSwap) - { - addrOffset = 3; - } - break; - - case (2U): - transferConfigRx.srcTransferSize = kEDMA_TransferSize2Bytes; - transferConfigRx.minorLoopBytes = 2; - if (handle->isByteSwap) - { - addrOffset = 2; - } - break; - - case (4U): - transferConfigRx.srcTransferSize = kEDMA_TransferSize4Bytes; - transferConfigRx.minorLoopBytes = 4; - break; - - default: - transferConfigRx.srcTransferSize = kEDMA_TransferSize1Bytes; - transferConfigRx.minorLoopBytes = 1; - assert(false); - break; - } - - transferConfigRx.srcAddr = (uint32_t)rxAddr + addrOffset; - transferConfigRx.srcOffset = 0; - - transferConfigRx.majorLoopCounts = handle->readRegRemainingTimes; - - /* Store the initially configured eDMA minor byte transfer count into the LPSPI handle */ - handle->nbytes = (uint8_t)transferConfigRx.minorLoopBytes; - - EDMA_SetTransferConfig(handle->edmaRxRegToRxDataHandle->base, handle->edmaRxRegToRxDataHandle->channel, - &transferConfigRx, NULL); - EDMA_EnableChannelInterrupts(handle->edmaRxRegToRxDataHandle->base, handle->edmaRxRegToRxDataHandle->channel, - (uint32_t)kEDMA_MajorInterruptEnable); - - /* Configure tx EDMA transfer */ - EDMA_ResetChannel(handle->edmaTxDataToTxRegHandle->base, handle->edmaTxDataToTxRegHandle->channel); - - if (isThereExtraTxBytes) - { - if (handle->txData != NULL) - { - transferConfigTx.srcAddr = (uint32_t) & (transfer->txData[transfer->dataSize - bytesLastWrite]); - transferConfigTx.srcOffset = 1; - } - else - { - transferConfigTx.srcAddr = (uint32_t)(&handle->txBuffIfNull); - transferConfigTx.srcOffset = 0; - } - - transferConfigTx.destOffset = 0; - - transferConfigTx.srcTransferSize = kEDMA_TransferSize1Bytes; - - addrOffset = 0; - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_edma_c_ref_1$ - */ - switch (bytesLastWrite) - { - case (1U): - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - if (handle->isByteSwap) - { - addrOffset = 3; - } - break; - - case (2U): - transferConfigTx.destTransferSize = kEDMA_TransferSize2Bytes; - transferConfigTx.minorLoopBytes = 2; - if (handle->isByteSwap) - { - addrOffset = 2; - } - break; - - default: - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - assert(false); - break; - } - - transferConfigTx.destAddr = (uint32_t)txAddr + addrOffset; - transferConfigTx.majorLoopCounts = 1; - -#if defined FSL_EDMA_DRIVER_EDMA4 && FSL_EDMA_DRIVER_EDMA4 - EDMA_TcdResetExt(handle->edmaRxRegToRxDataHandle->base, softwareTCD_extraBytes); - if (handle->isPcsContinuous) - { - EDMA_TcdSetTransferConfigExt(handle->edmaRxRegToRxDataHandle->base, softwareTCD_extraBytes, - &transferConfigTx, softwareTCD_pcsContinuous); - } - else - { - EDMA_TcdSetTransferConfigExt(handle->edmaRxRegToRxDataHandle->base, softwareTCD_extraBytes, - &transferConfigTx, NULL); - } -#else - EDMA_TcdReset(softwareTCD_extraBytes); - if (handle->isPcsContinuous) - { - EDMA_TcdSetTransferConfig(softwareTCD_extraBytes, &transferConfigTx, softwareTCD_pcsContinuous); - } - else - { - EDMA_TcdSetTransferConfig(softwareTCD_extraBytes, &transferConfigTx, NULL); - } -#endif - } - - if (handle->isPcsContinuous) - { - /* Set continue incase of twice call transfer. */ - LPSPI_SetPCSContinous(base, true); - handle->transmitCommand = base->TCR & ~(LPSPI_TCR_CONTC_MASK | LPSPI_TCR_CONT_MASK); - transferConfigTx.srcAddr = (uint32_t) & (handle->transmitCommand); - transferConfigTx.srcOffset = 0; - - transferConfigTx.destAddr = (uint32_t) & (base->TCR); - transferConfigTx.destOffset = 0; - - transferConfigTx.srcTransferSize = kEDMA_TransferSize4Bytes; - transferConfigTx.destTransferSize = kEDMA_TransferSize4Bytes; - transferConfigTx.minorLoopBytes = 4; - transferConfigTx.majorLoopCounts = 1; - -#if defined FSL_EDMA_DRIVER_EDMA4 && FSL_EDMA_DRIVER_EDMA4 - EDMA_TcdResetExt(handle->edmaRxRegToRxDataHandle->base, softwareTCD_pcsContinuous); - EDMA_TcdSetTransferConfigExt(handle->edmaRxRegToRxDataHandle->base, softwareTCD_pcsContinuous, - &transferConfigTx, NULL); -#else - EDMA_TcdReset(softwareTCD_pcsContinuous); - EDMA_TcdSetTransferConfig(softwareTCD_pcsContinuous, &transferConfigTx, NULL); -#endif - } - - if (handle->txData != NULL) - { - transferConfigTx.srcAddr = (uint32_t)(handle->txData); - transferConfigTx.srcOffset = 1; - } - else - { - transferConfigTx.srcAddr = (uint32_t)(&handle->txBuffIfNull); - transferConfigTx.srcOffset = 0; - } - - transferConfigTx.destOffset = 0; - - transferConfigTx.srcTransferSize = kEDMA_TransferSize1Bytes; - - addrOffset = 0U; - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_edma_c_ref_1$ - */ - switch (handle->bytesEachRead) - { - case (1U): - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - if (handle->isByteSwap) - { - addrOffset = 3; - } - break; - - case (2U): - transferConfigTx.destTransferSize = kEDMA_TransferSize2Bytes; - transferConfigTx.minorLoopBytes = 2; - - if (handle->isByteSwap) - { - addrOffset = 2; - } - break; - - case (4U): - transferConfigTx.destTransferSize = kEDMA_TransferSize4Bytes; - transferConfigTx.minorLoopBytes = 4; - break; - - default: - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - assert(false); - break; - } - - transferConfigTx.destAddr = (uint32_t)txAddr + addrOffset; - - transferConfigTx.majorLoopCounts = handle->writeRegRemainingTimes; - - if (isThereExtraTxBytes) - { - handle->lastTimeTCD = softwareTCD_extraBytes; - } - else if (handle->isPcsContinuous) - { - handle->lastTimeTCD = softwareTCD_pcsContinuous; - } - else - { - handle->lastTimeTCD = NULL; - } - - if (handle->isMultiDMATransmit) - { - transferConfigTx.majorLoopCounts = handle->dataBytesEveryTime; - if (handle->isPcsContinuous) - { - /* Pcs-continue mode is not supported in Multi DMA. - Please use no-continue mode and use GPIO control CS pin*/ - LPSPI_SetPCSContinous(base, false); - assert(false); - } - - EDMA_SetTransferConfig(handle->edmaTxDataToTxRegHandle->base, handle->edmaTxDataToTxRegHandle->channel, - &transferConfigTx, NULL); - (void)memcpy(&handle->transferConfigTx, &transferConfigTx, sizeof(edma_transfer_config_t)); - (void)memcpy(&handle->transferConfigRx, &transferConfigRx, sizeof(edma_transfer_config_t)); - } - else - { - transferConfigTx.majorLoopCounts = handle->writeRegRemainingTimes; - EDMA_SetTransferConfig(handle->edmaTxDataToTxRegHandle->base, handle->edmaTxDataToTxRegHandle->channel, - &transferConfigTx, handle->lastTimeTCD); - } - EDMA_StartTransfer(handle->edmaTxDataToTxRegHandle); - EDMA_StartTransfer(handle->edmaRxRegToRxDataHandle); - LPSPI_EnableDMA(base, (uint32_t)kLPSPI_RxDmaEnable | (uint32_t)kLPSPI_TxDmaEnable); - - return kStatus_Success; -} - -/*! - * brief LPSPI master transfer data using eDMA. - * - * This function transfers data using eDMA. This is a non-blocking function, which returns right away. When all data - * is transferred, the callback function is called. - * - * Note: - * The transfer data size should be an integer multiple of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not an integer multiple of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_master_edma_handle_t structure which stores the transfer state. - * param transfer pointer to lpspi_transfer_t structure. - * return status of status_t. - */ -status_t LPSPI_MasterTransferEDMA(LPSPI_Type *base, lpspi_master_edma_handle_t *handle, lpspi_transfer_t *transfer) -{ - status_t status = kStatus_Fail; - status = LPSPI_MasterTransferPrepareEDMALite(base, handle, transfer->configFlags); - if (kStatus_Success != status) - { - return status; - } - return LPSPI_MasterTransferEDMALite(base, handle, transfer); -} - -static void EDMA_LpspiMasterCallback(edma_handle_t *edmaHandle, - void *g_lpspiEdmaPrivateHandle, - bool transferDone, - uint32_t tcds) -{ - assert(edmaHandle != NULL); - assert(g_lpspiEdmaPrivateHandle != NULL); - - uint32_t readData; - status_t callbackStatus = kStatus_Success; - lpspi_master_edma_private_handle_t *lpspiEdmaPrivateHandle; - lpspi_master_edma_handle_t *lpspiEdmaHandle; - lpspiEdmaPrivateHandle = (lpspi_master_edma_private_handle_t *)g_lpspiEdmaPrivateHandle; - - lpspiEdmaHandle = lpspiEdmaPrivateHandle->handle; - size_t rxRemainingByteCount = lpspiEdmaHandle->rxRemainingByteCount; - uint8_t bytesLastRead = lpspiEdmaHandle->bytesLastRead; - bool isByteSwap = lpspiEdmaHandle->isByteSwap; - - bool lpspitxDmaUpdate = false; - bool lpspirxDmaUpdate = false; - - LPSPI_DisableDMA(lpspiEdmaPrivateHandle->base, (uint32_t)kLPSPI_TxDmaEnable | (uint32_t)kLPSPI_RxDmaEnable); - - if (!transferDone) - { - callbackStatus = kStatus_LPSPI_Error; - } - else - { - if (lpspiEdmaHandle->isMultiDMATransmit) - { - /* multi DMA transmit */ - lpspiEdmaHandle->dmaTransmitTime--; - if (lpspiEdmaHandle->dmaTransmitTime >= 1U) - { - if (lpspiEdmaHandle->txData != NULL) - { - lpspitxDmaUpdate = true; - lpspiEdmaHandle->transferConfigTx.srcAddr += lpspiEdmaHandle->dataBytesEveryTime; - } - if (lpspiEdmaHandle->rxData != NULL) - { - lpspirxDmaUpdate = true; - lpspiEdmaHandle->transferConfigRx.destAddr += lpspiEdmaHandle->dataBytesEveryTime; - } - /* The last time - 1 time, need check the lastTime data bytes */ - if (lpspiEdmaHandle->dmaTransmitTime == 1U) - { - if (lpspiEdmaHandle->lastTimeDataBytes != lpspiEdmaHandle->dataBytesEveryTime) - { - /* Need update count if last time count is not dataBytesEveryTime*/ - lpspiEdmaHandle->transferConfigTx.majorLoopCounts = lpspiEdmaHandle->lastTimeDataBytes; - lpspiEdmaHandle->transferConfigRx.majorLoopCounts = lpspiEdmaHandle->lastTimeDataBytes; - lpspitxDmaUpdate = true; - lpspirxDmaUpdate = true; - } - } - /* Update RX channel first */ - if (lpspirxDmaUpdate) - { - EDMA_SetTransferConfig(lpspiEdmaHandle->edmaRxRegToRxDataHandle->base, - lpspiEdmaHandle->edmaRxRegToRxDataHandle->channel, - &lpspiEdmaHandle->transferConfigRx, NULL); - } - EDMA_StartTransfer(lpspiEdmaHandle->edmaRxRegToRxDataHandle); - /* Update TX channel */ - if (lpspitxDmaUpdate) - { - EDMA_SetTransferConfig(lpspiEdmaHandle->edmaTxDataToTxRegHandle->base, - lpspiEdmaHandle->edmaTxDataToTxRegHandle->channel, - &lpspiEdmaHandle->transferConfigTx, NULL); - } - EDMA_StartTransfer(lpspiEdmaHandle->edmaTxDataToTxRegHandle); - - LPSPI_EnableDMA(lpspiEdmaPrivateHandle->base, - (uint32_t)kLPSPI_TxDmaEnable | (uint32_t)kLPSPI_RxDmaEnable); - /* Continue DMA transmit*/ - return; - } - else - { - /* Transmit complete */ - } - } - else - { - /* Once DMA transfer */ - if (lpspiEdmaPrivateHandle->handle->isThereExtraRxBytes) - { - while (LPSPI_GetRxFifoCount(lpspiEdmaPrivateHandle->base) == 0U) - { - } - readData = LPSPI_ReadData(lpspiEdmaPrivateHandle->base); - if (lpspiEdmaPrivateHandle->handle->rxData != NULL) - { - LPSPI_SeparateEdmaReadData( - &(lpspiEdmaPrivateHandle->handle->rxData[rxRemainingByteCount - bytesLastRead]), readData, - bytesLastRead, isByteSwap); - } - } - /* Transmit complete */ - } - } - - lpspiEdmaPrivateHandle->handle->state = (uint8_t)kLPSPI_Idle; - - if (lpspiEdmaPrivateHandle->handle->callback != NULL) - { - lpspiEdmaPrivateHandle->handle->callback(lpspiEdmaPrivateHandle->base, lpspiEdmaPrivateHandle->handle, - callbackStatus, lpspiEdmaPrivateHandle->handle->userData); - } -} - -/*! - * brief LPSPI master aborts a transfer which is using eDMA. - * - * This function aborts a transfer which is using eDMA. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_master_edma_handle_t structure which stores the transfer state. - */ -void LPSPI_MasterTransferAbortEDMA(LPSPI_Type *base, lpspi_master_edma_handle_t *handle) -{ - assert(handle != NULL); - - LPSPI_DisableDMA(base, (uint32_t)kLPSPI_RxDmaEnable | (uint32_t)kLPSPI_TxDmaEnable); - - EDMA_AbortTransfer(handle->edmaRxRegToRxDataHandle); - EDMA_AbortTransfer(handle->edmaTxDataToTxRegHandle); - - handle->state = (uint8_t)kLPSPI_Idle; -} - -/*! - * brief Gets the master eDMA transfer remaining bytes. - * - * This function gets the master eDMA transfer remaining bytes. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_master_edma_handle_t structure which stores the transfer state. - * param count Number of bytes transferred so far by the EDMA transaction. - * return status of status_t. - */ -status_t LPSPI_MasterTransferGetCountEDMA(LPSPI_Type *base, lpspi_master_edma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (handle->state != (uint8_t)kLPSPI_Busy) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - size_t remainingByte; - - remainingByte = - (uint32_t)handle->nbytes * EDMA_GetRemainingMajorLoopCount(handle->edmaRxRegToRxDataHandle->base, - handle->edmaRxRegToRxDataHandle->channel); - - *count = handle->totalByteCount - remainingByte; - - return kStatus_Success; -} - -/*! - * brief Initializes the LPSPI slave eDMA handle. - * - * This function initializes the LPSPI eDMA handle which can be used for other LPSPI transactional APIs. Usually, for a - * specified LPSPI instance, call this API once to get the initialized handle. - * - * Note that LPSPI eDMA has a separated (Rx and Tx as two sources) or shared (Rx and Tx as the same source) DMA request - * source. - * - * (1) For a separated DMA request source, enable and set the Rx DMAMUX source for edmaRxRegToRxDataHandle and - * Tx DMAMUX source for edmaTxDataToTxRegHandle. - * (2) For a shared DMA request source, enable and set the Rx/Rx DMAMUX source for edmaRxRegToRxDataHandle . - * - * param base LPSPI peripheral base address. - * param handle LPSPI handle pointer to lpspi_slave_edma_handle_t. - * param callback LPSPI callback. - * param userData callback function parameter. - * param edmaRxRegToRxDataHandle edmaRxRegToRxDataHandle pointer to edma_handle_t. - * param edmaTxDataToTxRegHandle edmaTxDataToTxRegHandle pointer to edma_handle_t. - */ -void LPSPI_SlaveTransferCreateHandleEDMA(LPSPI_Type *base, - lpspi_slave_edma_handle_t *handle, - lpspi_slave_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *edmaRxRegToRxDataHandle, - edma_handle_t *edmaTxDataToTxRegHandle) -{ - assert(handle != NULL); - assert(edmaRxRegToRxDataHandle != NULL); - assert(edmaTxDataToTxRegHandle != NULL); - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - uint32_t instance = LPSPI_GetInstance(base); - - s_lpspiSlaveEdmaPrivateHandle[instance].base = base; - s_lpspiSlaveEdmaPrivateHandle[instance].handle = handle; - - handle->callback = callback; - handle->userData = userData; - - handle->edmaRxRegToRxDataHandle = edmaRxRegToRxDataHandle; - handle->edmaTxDataToTxRegHandle = edmaTxDataToTxRegHandle; -} - -/*! - * brief LPSPI slave transfers data using eDMA. - * - * This function transfers data using eDMA. This is a non-blocking function, which return right away. When all data - * is transferred, the callback function is called. - * - * Note: - * The transfer data size should be an integer multiple of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not an integer multiple of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_slave_edma_handle_t structure which stores the transfer state. - * param transfer pointer to lpspi_transfer_t structure. - * return status of status_t. - */ -status_t LPSPI_SlaveTransferEDMA(LPSPI_Type *base, lpspi_slave_edma_handle_t *handle, lpspi_transfer_t *transfer) -{ - assert(handle != NULL); - assert(transfer != NULL); - - /* Check that we're not busy.*/ - if (handle->state == (uint8_t)kLPSPI_Busy) - { - return kStatus_LPSPI_Busy; - } - /* Disable module before configuration. */ - LPSPI_Enable(base, false); - /* Check arguements, also dma transfer can not support 3 bytes */ - if (!LPSPI_CheckTransferArgument(base, transfer, true)) - { - return kStatus_InvalidArgument; - } - - LPSPI_PrepareTransferEDMA(base); - - /* Variables */ - bool isThereExtraTxBytes = false; - bool isByteSwap = ((transfer->configFlags & (uint32_t)kLPSPI_MasterByteSwap) != 0U); - uint8_t bytesLastWrite = 0; - uint8_t dummyData = g_lpspiDummyData[LPSPI_GetInstance(base)]; - uint32_t mask = (uint32_t)kLPSPI_RxDmaEnable; - - /* Used for byte swap */ - uint32_t addrOffset = 0; - uint32_t instance = LPSPI_GetInstance(base); - uint32_t rxAddr = LPSPI_GetRxRegisterAddress(base); - uint32_t txAddr = LPSPI_GetTxRegisterAddress(base); - uint32_t whichPcs = (transfer->configFlags & LPSPI_MASTER_PCS_MASK) >> LPSPI_MASTER_PCS_SHIFT; - uint32_t bytesPerFrame = ((base->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT) / 8U + 1U; - edma_transfer_config_t transferConfigRx = {0}; - edma_transfer_config_t transferConfigTx = {0}; - edma_tcd_t *softwareTCD_extraBytes = (edma_tcd_t *)((uint32_t)(&handle->lpspiSoftwareTCD[1]) & (~0x1FU)); - - /* Assign the original value for members of transfer handle. */ - handle->state = (uint8_t)kLPSPI_Busy; - handle->txData = transfer->txData; - handle->rxData = transfer->rxData; - handle->txRemainingByteCount = transfer->dataSize; - handle->rxRemainingByteCount = transfer->dataSize; - handle->totalByteCount = transfer->dataSize; - handle->writeRegRemainingTimes = (transfer->dataSize / bytesPerFrame) * ((bytesPerFrame + 3U) / 4U); - handle->readRegRemainingTimes = handle->writeRegRemainingTimes; - handle->txBuffIfNull = - ((uint32_t)dummyData) | ((uint32_t)dummyData << 8) | ((uint32_t)dummyData << 16) | ((uint32_t)dummyData << 24); - /*The TX and RX FIFO sizes are always the same*/ - handle->fifoSize = LPSPI_GetRxFifoSize(base); - handle->isByteSwap = isByteSwap; - handle->isThereExtraRxBytes = false; - - /* Because DMA is fast enough, set the RX and TX watermarks to 0. */ - LPSPI_SetFifoWatermarks(base, 0U, 0U); - - /* Transfers will stall when transmit FIFO is empty or receive FIFO is full. */ - base->CFGR1 &= (~LPSPI_CFGR1_NOSTALL_MASK); - - /* Enable module for following configuration of TCR to take effect. */ - LPSPI_Enable(base, true); - - /* For DMA transfer, mask the transmit data if the tx data is null, for rx the receive data should not be masked at - any time since we use rx dma transfer finish cllback to indicate transfer finish. */ - base->TCR = - (base->TCR & ~(LPSPI_TCR_CONT_MASK | LPSPI_TCR_CONTC_MASK | LPSPI_TCR_BYSW_MASK | LPSPI_TCR_TXMSK_MASK)) | - LPSPI_TCR_TXMSK(transfer->txData == NULL) | LPSPI_TCR_BYSW(isByteSwap) | LPSPI_TCR_PCS(whichPcs); - - if (transfer->txData == NULL) - { - if (!LPSPI_WaitTxFifoEmpty(base)) - { - return kStatus_LPSPI_Error; - } - } - - /*Calculate the bytes for write/read the TX/RX register each time*/ - if (bytesPerFrame <= 4U) - { - handle->bytesEachWrite = (uint8_t)bytesPerFrame; - handle->bytesEachRead = (uint8_t)bytesPerFrame; - - handle->bytesLastRead = (uint8_t)bytesPerFrame; - } - else - { - handle->bytesEachWrite = 4U; - handle->bytesEachRead = 4U; - - handle->bytesLastRead = 4U; - - if ((transfer->dataSize % 4U) != 0U) - { - bytesLastWrite = (uint8_t)(transfer->dataSize % 4U); - handle->bytesLastRead = bytesLastWrite; - - isThereExtraTxBytes = true; - --handle->writeRegRemainingTimes; - - handle->isThereExtraRxBytes = true; - --handle->readRegRemainingTimes; - } - } - - EDMA_SetCallback(handle->edmaRxRegToRxDataHandle, EDMA_LpspiSlaveCallback, - &s_lpspiSlaveEdmaPrivateHandle[instance]); - - /*Rx*/ - /* - * $Branch Coverage Justification$ - * LPSPI_CheckTransferArgument will check parameters, here readRegRemainingTimes cannot be 0. - */ - if (handle->readRegRemainingTimes > 0U) - { - EDMA_ResetChannel(handle->edmaRxRegToRxDataHandle->base, handle->edmaRxRegToRxDataHandle->channel); - - if (handle->rxData != NULL) - { - transferConfigRx.destAddr = (uint32_t) & (handle->rxData[0]); - transferConfigRx.destOffset = 1; - } - else - { - transferConfigRx.destAddr = (uint32_t) & (handle->rxBuffIfNull); - transferConfigRx.destOffset = 0; - } - transferConfigRx.destTransferSize = kEDMA_TransferSize1Bytes; - - addrOffset = 0; - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_edma_c_ref_1$ - */ - switch (handle->bytesEachRead) - { - case (1U): - transferConfigRx.srcTransferSize = kEDMA_TransferSize1Bytes; - transferConfigRx.minorLoopBytes = 1; - if (handle->isByteSwap) - { - addrOffset = 3; - } - break; - - case (2U): - transferConfigRx.srcTransferSize = kEDMA_TransferSize2Bytes; - transferConfigRx.minorLoopBytes = 2; - if (handle->isByteSwap) - { - addrOffset = 2; - } - break; - - case (4U): - transferConfigRx.srcTransferSize = kEDMA_TransferSize4Bytes; - transferConfigRx.minorLoopBytes = 4; - break; - - default: - transferConfigRx.srcTransferSize = kEDMA_TransferSize1Bytes; - transferConfigRx.minorLoopBytes = 1; - assert(false); - break; - } - - transferConfigRx.srcAddr = (uint32_t)rxAddr + addrOffset; - transferConfigRx.srcOffset = 0; - - transferConfigRx.majorLoopCounts = handle->readRegRemainingTimes; - - /* Store the initially configured eDMA minor byte transfer count into the DSPI handle */ - handle->nbytes = (uint8_t)transferConfigRx.minorLoopBytes; - - EDMA_SetTransferConfig(handle->edmaRxRegToRxDataHandle->base, handle->edmaRxRegToRxDataHandle->channel, - &transferConfigRx, NULL); - EDMA_EnableChannelInterrupts(handle->edmaRxRegToRxDataHandle->base, handle->edmaRxRegToRxDataHandle->channel, - (uint32_t)kEDMA_MajorInterruptEnable); - EDMA_StartTransfer(handle->edmaRxRegToRxDataHandle); - } - - /*Tx*/ - if (handle->txData != NULL) - { - EDMA_ResetChannel(handle->edmaTxDataToTxRegHandle->base, handle->edmaTxDataToTxRegHandle->channel); - if (isThereExtraTxBytes) - { - transferConfigTx.srcAddr = (uint32_t) & (transfer->txData[transfer->dataSize - bytesLastWrite]); - transferConfigTx.srcOffset = 1; - transferConfigTx.destOffset = 0; - transferConfigTx.srcTransferSize = kEDMA_TransferSize1Bytes; - addrOffset = 0; - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_edma_c_ref_1$ - */ - switch (bytesLastWrite) - { - case (1U): - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - if (handle->isByteSwap) - { - addrOffset = 3; - } - break; - - case (2U): - transferConfigTx.destTransferSize = kEDMA_TransferSize2Bytes; - transferConfigTx.minorLoopBytes = 2; - if (handle->isByteSwap) - { - addrOffset = 2; - } - break; - - default: - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - assert(false); - break; - } - - transferConfigTx.destAddr = (uint32_t)txAddr + addrOffset; - transferConfigTx.majorLoopCounts = 1; - -#if defined FSL_EDMA_DRIVER_EDMA4 && FSL_EDMA_DRIVER_EDMA4 - EDMA_TcdResetExt(handle->edmaRxRegToRxDataHandle->base, softwareTCD_extraBytes); - EDMA_TcdSetTransferConfigExt(handle->edmaRxRegToRxDataHandle->base, softwareTCD_extraBytes, - &transferConfigTx, NULL); -#else - EDMA_TcdReset(softwareTCD_extraBytes); - EDMA_TcdSetTransferConfig(softwareTCD_extraBytes, &transferConfigTx, NULL); -#endif - } - - transferConfigTx.srcAddr = (uint32_t)(handle->txData); - transferConfigTx.srcOffset = 1; - transferConfigTx.destOffset = 0; - transferConfigTx.srcTransferSize = kEDMA_TransferSize1Bytes; - addrOffset = 0; - /* - * $Branch Coverage Justification$ - * $ref fsl_lpspi_edma_c_ref_1$ - */ - switch (handle->bytesEachRead) - { - case (1U): - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - if (handle->isByteSwap) - { - addrOffset = 3; - } - break; - - case (2U): - transferConfigTx.destTransferSize = kEDMA_TransferSize2Bytes; - transferConfigTx.minorLoopBytes = 2; - - if (handle->isByteSwap) - { - addrOffset = 2; - } - break; - - case (4U): - transferConfigTx.destTransferSize = kEDMA_TransferSize4Bytes; - transferConfigTx.minorLoopBytes = 4; - break; - - default: - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - assert(false); - break; - } - - transferConfigTx.destAddr = (uint32_t)txAddr + addrOffset; - transferConfigTx.majorLoopCounts = handle->writeRegRemainingTimes; - - if (isThereExtraTxBytes) - { - EDMA_SetTransferConfig(handle->edmaTxDataToTxRegHandle->base, handle->edmaTxDataToTxRegHandle->channel, - &transferConfigTx, softwareTCD_extraBytes); - } - else - { - EDMA_SetTransferConfig(handle->edmaTxDataToTxRegHandle->base, handle->edmaTxDataToTxRegHandle->channel, - &transferConfigTx, NULL); - } - EDMA_StartTransfer(handle->edmaTxDataToTxRegHandle); - mask |= (uint32_t)kLPSPI_TxDmaEnable; - } - - LPSPI_EnableDMA(base, mask); - - return kStatus_Success; -} - -static void EDMA_LpspiSlaveCallback(edma_handle_t *edmaHandle, - void *g_lpspiEdmaPrivateHandle, - bool transferDone, - uint32_t tcds) -{ - assert(edmaHandle != NULL); - assert(g_lpspiEdmaPrivateHandle != NULL); - - uint32_t readData; - status_t callbackStatus = kStatus_Success; - - lpspi_slave_edma_private_handle_t *lpspiEdmaPrivateHandle; - - lpspiEdmaPrivateHandle = (lpspi_slave_edma_private_handle_t *)g_lpspiEdmaPrivateHandle; - - size_t rxRemainingByteCount = lpspiEdmaPrivateHandle->handle->rxRemainingByteCount; - uint8_t bytesLastRead = lpspiEdmaPrivateHandle->handle->bytesLastRead; - bool isByteSwap = lpspiEdmaPrivateHandle->handle->isByteSwap; - - LPSPI_DisableDMA(lpspiEdmaPrivateHandle->base, (uint32_t)kLPSPI_TxDmaEnable | (uint32_t)kLPSPI_RxDmaEnable); - - if (!transferDone) - { - callbackStatus = kStatus_LPSPI_Error; - } - - /* - * $Branch Coverage Justification$ - * When there are extra bytes, the slave will not receive the extra bytes,The while here will not stop.(will - * improve) - */ - if (lpspiEdmaPrivateHandle->handle->isThereExtraRxBytes) - { - while (LPSPI_GetRxFifoCount(lpspiEdmaPrivateHandle->base) == 0U) - { - } - readData = LPSPI_ReadData(lpspiEdmaPrivateHandle->base); - - if (lpspiEdmaPrivateHandle->handle->rxData != NULL) - { - LPSPI_SeparateEdmaReadData(&(lpspiEdmaPrivateHandle->handle->rxData[rxRemainingByteCount - bytesLastRead]), - readData, bytesLastRead, isByteSwap); - } - } - - lpspiEdmaPrivateHandle->handle->state = (uint8_t)kLPSPI_Idle; - - if (lpspiEdmaPrivateHandle->handle->callback != NULL) - { - lpspiEdmaPrivateHandle->handle->callback(lpspiEdmaPrivateHandle->base, lpspiEdmaPrivateHandle->handle, - callbackStatus, lpspiEdmaPrivateHandle->handle->userData); - } -} - -/*! - * brief LPSPI slave aborts a transfer which is using eDMA. - * - * This function aborts a transfer which is using eDMA. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_slave_edma_handle_t structure which stores the transfer state. - */ -void LPSPI_SlaveTransferAbortEDMA(LPSPI_Type *base, lpspi_slave_edma_handle_t *handle) -{ - assert(handle != NULL); - - LPSPI_DisableDMA(base, (uint32_t)kLPSPI_RxDmaEnable | (uint32_t)kLPSPI_TxDmaEnable); - - EDMA_AbortTransfer(handle->edmaRxRegToRxDataHandle); - EDMA_AbortTransfer(handle->edmaTxDataToTxRegHandle); - - handle->state = (uint8_t)kLPSPI_Idle; -} - -/*! - * brief Gets the slave eDMA transfer remaining bytes. - * - * This function gets the slave eDMA transfer remaining bytes. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_slave_edma_handle_t structure which stores the transfer state. - * param count Number of bytes transferred so far by the eDMA transaction. - * return status of status_t. - */ -status_t LPSPI_SlaveTransferGetCountEDMA(LPSPI_Type *base, lpspi_slave_edma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (handle->state != (uint8_t)kLPSPI_Busy) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - size_t remainingByte; - - remainingByte = - (uint32_t)handle->nbytes * EDMA_GetRemainingMajorLoopCount(handle->edmaRxRegToRxDataHandle->base, - handle->edmaRxRegToRxDataHandle->channel); - - *count = handle->totalByteCount - remainingByte; - - return kStatus_Success; -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpspi_edma.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpspi_edma.h deleted file mode 100644 index 9e193393d67..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpspi_edma.h +++ /dev/null @@ -1,353 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LPSPI_EDMA_H_ -#define FSL_LPSPI_EDMA_H_ - -#include "fsl_lpspi.h" -#include "fsl_edma.h" - -/*! - * @addtogroup lpspi_edma_driver - * @{ - */ - -/*********************************************************************************************************************** - * Definitions - **********************************************************************************************************************/ -/*! @name Driver version */ -/*! @{ */ -/*! @brief LPSPI EDMA driver version. */ -#define FSL_LPSPI_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 4, 4)) - -/*! @brief DMA max transfer size */ -#define DMA_MAX_TRANSFER_COUNT 0x7FFFU -/*! @} */ - -/*! - * @brief Forward declaration of the _lpspi_master_edma_handle typedefs. - */ -typedef struct _lpspi_master_edma_handle lpspi_master_edma_handle_t; - -/*! - * @brief Forward declaration of the _lpspi_slave_edma_handle typedefs. - */ -typedef struct _lpspi_slave_edma_handle lpspi_slave_edma_handle_t; - -/*! - * @brief Completion callback function pointer type. - * - * @param base LPSPI peripheral base address. - * @param handle Pointer to the handle for the LPSPI master. - * @param status Success or error code describing whether the transfer completed. - * @param userData Arbitrary pointer-dataSized value passed from the application. - */ -typedef void (*lpspi_master_edma_transfer_callback_t)(LPSPI_Type *base, - lpspi_master_edma_handle_t *handle, - status_t status, - void *userData); -/*! - * @brief Completion callback function pointer type. - * - * @param base LPSPI peripheral base address. - * @param handle Pointer to the handle for the LPSPI slave. - * @param status Success or error code describing whether the transfer completed. - * @param userData Arbitrary pointer-dataSized value passed from the application. - */ -typedef void (*lpspi_slave_edma_transfer_callback_t)(LPSPI_Type *base, - lpspi_slave_edma_handle_t *handle, - status_t status, - void *userData); - -/*! @brief LPSPI master eDMA transfer handle structure used for transactional API. */ -struct _lpspi_master_edma_handle -{ - volatile bool isPcsContinuous; /*!< Is PCS continuous in transfer. */ - - volatile bool isByteSwap; /*!< A flag that whether should byte swap. */ - - volatile uint8_t fifoSize; /*!< FIFO dataSize. */ - - volatile uint8_t rxWatermark; /*!< Rx watermark. */ - - volatile uint8_t bytesEachWrite; /*!< Bytes for each write TDR. */ - volatile uint8_t bytesEachRead; /*!< Bytes for each read RDR. */ - - volatile uint8_t bytesLastRead; /*!< Bytes for last read RDR. */ - volatile bool isThereExtraRxBytes; /*!< Is there extra RX byte. */ - - const uint8_t *volatile txData; /*!< Send buffer. */ - uint8_t *volatile rxData; /*!< Receive buffer. */ - volatile size_t txRemainingByteCount; /*!< Number of bytes remaining to send.*/ - volatile size_t rxRemainingByteCount; /*!< Number of bytes remaining to receive.*/ - - volatile uint32_t writeRegRemainingTimes; /*!< Write TDR register remaining times. */ - volatile uint32_t readRegRemainingTimes; /*!< Read RDR register remaining times. */ - - uint32_t totalByteCount; /*!< Number of transfer bytes*/ - - edma_tcd_t *lastTimeTCD; /*!< Pointer to the lastTime TCD*/ - bool isMultiDMATransmit; /*!< Is there multi DMA transmit*/ - volatile uint8_t dmaTransmitTime; /*!< DMA Transfer times. */ - uint32_t lastTimeDataBytes; /*!< DMA transmit last Time data Bytes */ - - uint32_t dataBytesEveryTime; /*!< Bytes in a time for DMA transfer, default is DMA_MAX_TRANSFER_COUNT */ - - edma_transfer_config_t transferConfigRx; /*!< Config of DMA rx channel.*/ - edma_transfer_config_t transferConfigTx; /*!< Config of DMA tx channel.*/ - uint32_t txBuffIfNull; /*!< Used if there is not txData for DMA purpose.*/ - uint32_t rxBuffIfNull; /*!< Used if there is not rxData for DMA purpose.*/ - - uint32_t transmitCommand; /*!< Used to write TCR for DMA purpose.*/ - - volatile uint8_t state; /*!< LPSPI transfer state , _lpspi_transfer_state.*/ - - uint8_t nbytes; /*!< eDMA minor byte transfer count initially configured. */ - - lpspi_master_edma_transfer_callback_t callback; /*!< Completion callback. */ - void *userData; /*!< Callback user data. */ - - edma_handle_t *edmaRxRegToRxDataHandle; /*!CSR = (LPTMR_CSR_TMS(config->timerMode) | LPTMR_CSR_TFC(config->enableFreeRunning) | - LPTMR_CSR_TPP(config->pinPolarity) | LPTMR_CSR_TPS(config->pinSelect)); - - /* Configure the prescale value and clock source */ - base->PSR = (LPTMR_PSR_PRESCALE(config->value) | LPTMR_PSR_PBYP(config->bypassPrescaler) | - LPTMR_PSR_PCS(config->prescalerClockSource)); -} - -/*! - * brief Gates the LPTMR clock. - * - * param base LPTMR peripheral base address - */ -void LPTMR_Deinit(LPTMR_Type *base) -{ - /* Disable the LPTMR and reset the internal logic */ - base->CSR &= ~LPTMR_CSR_TEN_MASK; - -#if defined(LPTMR_CLOCKS) -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - - uint32_t instance = LPTMR_GetInstance(base); - - /* Gate the LPTMR clock*/ - CLOCK_DisableClock(s_lptmrClocks[instance]); -#if defined(LPTMR_PERIPH_CLOCKS) - CLOCK_DisableClock(s_lptmrPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* LPTMR_CLOCKS */ -} - -/*! - * brief Fills in the LPTMR configuration structure with default settings. - * - * The default values are as follows. - * code - * config->timerMode = kLPTMR_TimerModeTimeCounter; - * config->pinSelect = kLPTMR_PinSelectInput_0; - * config->pinPolarity = kLPTMR_PinPolarityActiveHigh; - * config->enableFreeRunning = false; - * config->bypassPrescaler = true; - * config->prescalerClockSource = kLPTMR_PrescalerClock_1; - * config->value = kLPTMR_Prescale_Glitch_0; - * endcode - * param config A pointer to the LPTMR configuration structure. - */ -void LPTMR_GetDefaultConfig(lptmr_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - /* Use time counter mode */ - config->timerMode = kLPTMR_TimerModeTimeCounter; - /* Use input 0 as source in pulse counter mode */ - config->pinSelect = kLPTMR_PinSelectInput_0; - /* Pulse input pin polarity is active-high */ - config->pinPolarity = kLPTMR_PinPolarityActiveHigh; - /* Counter resets whenever TCF flag is set */ - config->enableFreeRunning = false; - /* Bypass the prescaler */ - config->bypassPrescaler = true; - /* LPTMR clock source */ -#if !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT) - config->prescalerClockSource = kLPTMR_PrescalerClock_1; -#elif !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_0_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_0_SUPPORT) - config->prescalerClockSource = kLPTMR_PrescalerClock_0; -#elif !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_2_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_2_SUPPORT) - config->prescalerClockSource = kLPTMR_PrescalerClock_2; -#elif !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_3_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_3_SUPPORT) - config->prescalerClockSource = kLPTMR_PrescalerClock_3; -#else -#error No valid source -#endif - - /* Divide the prescaler clock by 2 */ - config->value = kLPTMR_Prescale_Glitch_0; -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lptmr.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lptmr.h deleted file mode 100644 index b8e473120c5..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lptmr.h +++ /dev/null @@ -1,384 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2017, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LPTMR_H_ -#define FSL_LPTMR_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup lptmr - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! Driver Version */ -#define FSL_LPTMR_DRIVER_VERSION (MAKE_VERSION(2, 2, 0)) -/*! @} */ - -/*! @brief LPTMR pin selection used in pulse counter mode.*/ -typedef enum _lptmr_pin_select -{ - kLPTMR_PinSelectInput_0 = 0x0U, /*!< Pulse counter input 0 is selected */ - kLPTMR_PinSelectInput_1 = 0x1U, /*!< Pulse counter input 1 is selected */ - kLPTMR_PinSelectInput_2 = 0x2U, /*!< Pulse counter input 2 is selected */ - kLPTMR_PinSelectInput_3 = 0x3U /*!< Pulse counter input 3 is selected */ -} lptmr_pin_select_t; - -/*! @brief LPTMR pin polarity used in pulse counter mode.*/ -typedef enum _lptmr_pin_polarity -{ - kLPTMR_PinPolarityActiveHigh = 0x0U, /*!< Pulse Counter input source is active-high */ - kLPTMR_PinPolarityActiveLow = 0x1U /*!< Pulse Counter input source is active-low */ -} lptmr_pin_polarity_t; - -/*! @brief LPTMR timer mode selection.*/ -typedef enum _lptmr_timer_mode -{ - kLPTMR_TimerModeTimeCounter = 0x0U, /*!< Time Counter mode */ - kLPTMR_TimerModePulseCounter = 0x1U /*!< Pulse Counter mode */ -} lptmr_timer_mode_t; - -/*! @brief LPTMR prescaler/glitch filter values*/ -typedef enum _lptmr_prescaler_glitch_value -{ - kLPTMR_Prescale_Glitch_0 = 0x0U, /*!< Prescaler divide 2, glitch filter does not support this setting */ - kLPTMR_Prescale_Glitch_1 = 0x1U, /*!< Prescaler divide 4, glitch filter 2 */ - kLPTMR_Prescale_Glitch_2 = 0x2U, /*!< Prescaler divide 8, glitch filter 4 */ - kLPTMR_Prescale_Glitch_3 = 0x3U, /*!< Prescaler divide 16, glitch filter 8 */ - kLPTMR_Prescale_Glitch_4 = 0x4U, /*!< Prescaler divide 32, glitch filter 16 */ - kLPTMR_Prescale_Glitch_5 = 0x5U, /*!< Prescaler divide 64, glitch filter 32 */ - kLPTMR_Prescale_Glitch_6 = 0x6U, /*!< Prescaler divide 128, glitch filter 64 */ - kLPTMR_Prescale_Glitch_7 = 0x7U, /*!< Prescaler divide 256, glitch filter 128 */ - kLPTMR_Prescale_Glitch_8 = 0x8U, /*!< Prescaler divide 512, glitch filter 256 */ - kLPTMR_Prescale_Glitch_9 = 0x9U, /*!< Prescaler divide 1024, glitch filter 512*/ - kLPTMR_Prescale_Glitch_10 = 0xAU, /*!< Prescaler divide 2048 glitch filter 1024 */ - kLPTMR_Prescale_Glitch_11 = 0xBU, /*!< Prescaler divide 4096, glitch filter 2048 */ - kLPTMR_Prescale_Glitch_12 = 0xCU, /*!< Prescaler divide 8192, glitch filter 4096 */ - kLPTMR_Prescale_Glitch_13 = 0xDU, /*!< Prescaler divide 16384, glitch filter 8192 */ - kLPTMR_Prescale_Glitch_14 = 0xEU, /*!< Prescaler divide 32768, glitch filter 16384 */ - kLPTMR_Prescale_Glitch_15 = 0xFU /*!< Prescaler divide 65536, glitch filter 32768 */ -} lptmr_prescaler_glitch_value_t; - -/*! - * @brief LPTMR prescaler/glitch filter clock select. - * @note Clock connections are SoC-specific - */ -typedef enum _lptmr_prescaler_clock_select -{ -#if !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_0_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_0_SUPPORT) - kLPTMR_PrescalerClock_0 = 0x0U, /*!< Prescaler/glitch filter clock 0 selected. */ -#endif - -#if !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT) - kLPTMR_PrescalerClock_1 = 0x1U, /*!< Prescaler/glitch filter clock 1 selected. */ -#endif /* FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT */ - -#if !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_2_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_2_SUPPORT) - kLPTMR_PrescalerClock_2 = 0x2U, /*!< Prescaler/glitch filter clock 2 selected. */ -#endif - -#if !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_3_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_3_SUPPORT) - kLPTMR_PrescalerClock_3 = 0x3U, /*!< Prescaler/glitch filter clock 3 selected. */ -#endif /* FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_3_SUPPORT */ -} lptmr_prescaler_clock_select_t; - -/*! @brief List of the LPTMR interrupts */ -typedef enum _lptmr_interrupt_enable -{ - kLPTMR_TimerInterruptEnable = LPTMR_CSR_TIE_MASK, /*!< Timer interrupt enable */ -} lptmr_interrupt_enable_t; - -/*! @brief List of the LPTMR status flags */ -typedef enum _lptmr_status_flags -{ - kLPTMR_TimerCompareFlag = LPTMR_CSR_TCF_MASK, /*!< Timer compare flag */ -} lptmr_status_flags_t; - -/*! - * @brief LPTMR config structure - * - * This structure holds the configuration settings for the LPTMR peripheral. To initialize this - * structure to reasonable defaults, call the LPTMR_GetDefaultConfig() function and pass a - * pointer to your configuration structure instance. - * - * The configuration struct can be made constant so it resides in flash. - */ -typedef struct _lptmr_config -{ - lptmr_timer_mode_t timerMode; /*!< Time counter mode or pulse counter mode */ - lptmr_pin_select_t pinSelect; /*!< LPTMR pulse input pin select; used only in pulse counter mode */ - lptmr_pin_polarity_t pinPolarity; /*!< LPTMR pulse input pin polarity; used only in pulse counter mode */ - bool enableFreeRunning; /*!< True: enable free running, counter is reset on overflow - False: counter is reset when the compare flag is set */ - bool bypassPrescaler; /*!< True: bypass prescaler; false: use clock from prescaler */ - lptmr_prescaler_clock_select_t prescalerClockSource; /*!< LPTMR clock source */ - lptmr_prescaler_glitch_value_t value; /*!< Prescaler or glitch filter value */ -} lptmr_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Ungates the LPTMR clock and configures the peripheral for a basic operation. - * - * @note This API should be called at the beginning of the application using the LPTMR driver. - * - * @param base LPTMR peripheral base address - * @param config A pointer to the LPTMR configuration structure. - */ -void LPTMR_Init(LPTMR_Type *base, const lptmr_config_t *config); - -/*! - * @brief Gates the LPTMR clock. - * - * @param base LPTMR peripheral base address - */ -void LPTMR_Deinit(LPTMR_Type *base); - -/*! - * @brief Fills in the LPTMR configuration structure with default settings. - * - * The default values are as follows. - * @code - * config->timerMode = kLPTMR_TimerModeTimeCounter; - * config->pinSelect = kLPTMR_PinSelectInput_0; - * config->pinPolarity = kLPTMR_PinPolarityActiveHigh; - * config->enableFreeRunning = false; - * config->bypassPrescaler = true; - * config->prescalerClockSource = kLPTMR_PrescalerClock_1; - * config->value = kLPTMR_Prescale_Glitch_0; - * @endcode - * @param config A pointer to the LPTMR configuration structure. - */ -void LPTMR_GetDefaultConfig(lptmr_config_t *config); - -/*! @}*/ - -/*! - * @name Interrupt Interface - * @{ - */ - -/*! - * @brief Enables the selected LPTMR interrupts. - * - * @param base LPTMR peripheral base address - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::lptmr_interrupt_enable_t - */ -static inline void LPTMR_EnableInterrupts(LPTMR_Type *base, uint32_t mask) -{ - uint32_t reg = base->CSR; - - /* Clear the TCF bit so that we don't clear this w1c bit when writing back */ - reg &= ~(LPTMR_CSR_TCF_MASK); - reg |= mask; - base->CSR = reg; -} - -/*! - * @brief Disables the selected LPTMR interrupts. - * - * @param base LPTMR peripheral base address - * @param mask The interrupts to disable. This is a logical OR of members of the - * enumeration ::lptmr_interrupt_enable_t. - */ -static inline void LPTMR_DisableInterrupts(LPTMR_Type *base, uint32_t mask) -{ - uint32_t reg = base->CSR; - - /* Clear the TCF bit so that we don't clear this w1c bit when writing back */ - reg &= ~(LPTMR_CSR_TCF_MASK); - reg &= ~mask; - base->CSR = reg; -} - -/*! - * @brief Gets the enabled LPTMR interrupts. - * - * @param base LPTMR peripheral base address - * - * @return The enabled interrupts. This is the logical OR of members of the - * enumeration ::lptmr_interrupt_enable_t - */ -static inline uint32_t LPTMR_GetEnabledInterrupts(LPTMR_Type *base) -{ - return (base->CSR & LPTMR_CSR_TIE_MASK); -} - -/*! @}*/ - -#if defined(FSL_FEATURE_LPTMR_HAS_CSR_TDRE) && (FSL_FEATURE_LPTMR_HAS_CSR_TDRE) -/*! - * @brief Enable or disable timer DMA request - * - * @param base base LPTMR peripheral base address - * @param enable Switcher of timer DMA feature. "true" means to enable, "false" means to disable. - */ -static inline void LPTMR_EnableTimerDMA(LPTMR_Type *base, bool enable) -{ - if (enable) - { - base->CSR |= LPTMR_CSR_TDRE_MASK; - } - else - { - base->CSR &= ~(LPTMR_CSR_TDRE_MASK); - } -} -#endif /* FSL_FEATURE_LPTMR_HAS_CSR_TDRE */ - -/*! - * @name Status Interface - * @{ - */ - -/*! - * @brief Gets the LPTMR status flags. - * - * @param base LPTMR peripheral base address - * - * @return The status flags. This is the logical OR of members of the - * enumeration ::lptmr_status_flags_t - */ -static inline uint32_t LPTMR_GetStatusFlags(LPTMR_Type *base) -{ - return (base->CSR & LPTMR_CSR_TCF_MASK); -} - -/*! - * @brief Clears the LPTMR status flags. - * - * @param base LPTMR peripheral base address - * @param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::lptmr_status_flags_t. - */ -static inline void LPTMR_ClearStatusFlags(LPTMR_Type *base, uint32_t mask) -{ - base->CSR |= mask; -} - -/*! @}*/ - -/*! - * @name Read and write the timer period - * @{ - */ - -/*! - * @brief Sets the timer period in units of count. - * - * Timers counts from 0 until it equals the count value set here. The count value is written to - * the CMR register. - * - * @note - * 1. The TCF flag is set with the CNR equals the count provided here and then increments. - * 2. Call the utility macros provided in the fsl_common.h to convert to ticks. - * - * @param base LPTMR peripheral base address - * @param ticks A timer period in units of ticks, which should be equal or greater than 1. - */ -static inline void LPTMR_SetTimerPeriod(LPTMR_Type *base, uint32_t ticks) -{ - assert(ticks > 0U); - base->CMR = LPTMR_CMR_COMPARE(ticks - 1U); -} - -/*! - * @brief Reads the current timer counting value. - * - * This function returns the real-time timer counting value in a range from 0 to a - * timer period. - * - * @note Call the utility macros provided in the fsl_common.h to convert ticks to usec or msec. - * - * @param base LPTMR peripheral base address - * - * @return The current counter value in ticks - */ -static inline uint32_t LPTMR_GetCurrentTimerCount(LPTMR_Type *base) -{ - /* Must first write any value to the CNR. This synchronizes and registers the current value - * of the CNR into a temporary register which can then be read - */ - base->CNR = 0U; - return (uint32_t)((base->CNR & LPTMR_CNR_COUNTER_MASK) >> LPTMR_CNR_COUNTER_SHIFT); -} - -/*! @}*/ - -/*! - * @name Timer Start and Stop - * @{ - */ - -/*! - * @brief Starts the timer. - * - * After calling this function, the timer counts up to the CMR register value. - * Each time the timer reaches the CMR value and then increments, it generates a - * trigger pulse and sets the timeout interrupt flag. An interrupt is also - * triggered if the timer interrupt is enabled. - * - * @param base LPTMR peripheral base address - */ -static inline void LPTMR_StartTimer(LPTMR_Type *base) -{ - uint32_t reg = base->CSR; - - /* Clear the TCF bit to avoid clearing the w1c bit when writing back. */ - reg &= ~(LPTMR_CSR_TCF_MASK); - reg |= LPTMR_CSR_TEN_MASK; - base->CSR = reg; -} - -/*! - * @brief Stops the timer. - * - * This function stops the timer and resets the timer's counter register. - * - * @param base LPTMR peripheral base address - */ -static inline void LPTMR_StopTimer(LPTMR_Type *base) -{ - uint32_t reg = base->CSR; - - /* Clear the TCF bit to avoid clearing the w1c bit when writing back. */ - reg &= ~(LPTMR_CSR_TCF_MASK); - reg &= ~LPTMR_CSR_TEN_MASK; - base->CSR = reg; -} - -/*! @}*/ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_LPTMR_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpuart.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpuart.c deleted file mode 100644 index 5e8de5a894b..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpuart.c +++ /dev/null @@ -1,2742 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpuart.h" - -/* - * $Coverage Justification Reference$ - * - * $Justification fsl_lpuart_c_ref_1$ - * (osr > 3) (false) can't be not covered, because osr(osrTemp) is increased from 4U. - * - * $Justification fsl_lpuart_c_ref_2$ - * The flag is cleared successfully during test. - */ -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpuart" -#endif - -/* LPUART transfer state. */ -enum -{ - kLPUART_TxIdle, /*!< TX idle. */ - kLPUART_TxBusy, /*!< TX busy. */ - kLPUART_RxIdle, /*!< RX idle. */ - kLPUART_RxBusy /*!< RX busy. */ -}; - -#if defined(LPUART_RSTS) -#define LPUART_RESETS_ARRAY LPUART_RSTS -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Check whether the RX ring buffer is full. - * - * @userData handle LPUART handle pointer. - * @retval true RX ring buffer is full. - * @retval false RX ring buffer is not full. - */ -static bool LPUART_TransferIsRxRingBufferFull(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief Write to TX register using non-blocking method. - * - * This function writes data to the TX register directly, upper layer must make - * sure the TX register is empty or TX FIFO has empty room before calling this function. - * - * @note This function does not check whether all the data has been sent out to bus, - * so before disable TX, check kLPUART_TransmissionCompleteFlag to ensure the TX is - * finished. - * - * @param base LPUART peripheral base address. - * @param data Start address of the data to write. - * @param length Size of the buffer to be sent. - */ -static void LPUART_WriteNonBlocking(LPUART_Type *base, const uint8_t *data, size_t length); -/*! - * @brief Write to TX register using non-blocking method in 9bit or 10bit mode. - * - * The 10bit of data will be writen to TX register DATA. - * Please make sure data 10bit is valid and other bit is 0. - * - * @note This function only support 9bit or 10bit transfer. - * - * @param base LPUART peripheral base address. - * @param data Start address of the data to write. - * @param length Size of the buffer to be sent. - */ -static void LPUART_WriteNonBlocking16bit(LPUART_Type *base, const uint16_t *data, size_t length); - -/*! - * @brief Read RX register using non-blocking method. - * - * This function reads data from the TX register directly, upper layer must make - * sure the RX register is full or TX FIFO has data before calling this function. - * - * @param base LPUART peripheral base address. - * @param data Start address of the buffer to store the received data. - * @param length Size of the buffer. - */ -static void LPUART_ReadNonBlocking(LPUART_Type *base, uint8_t *data, size_t length); -/*! - * @brief Read RX register using non-blocking method in 9bit or 10bit mode. - * - * This function reads 10bit data from the RX register directly and stores to 16bit data. - * - * @note This function only support 9bit or 10bit transfer. - * - * @param base LPUART peripheral base address. - * @param data Start address of the buffer to store the received data. - * @param length Size of the buffer. - */ -static void LPUART_ReadNonBlocking16bit(LPUART_Type *base, uint16_t *data, size_t length); -/*! - * @brief LPUART_TransferHandleIDLEIsReady handle function. - * This function handles when IDLE is ready. - * - * @param base LPUART peripheral base address. - * @param irqHandle LPUART handle pointer. - */ -static void LPUART_TransferHandleIDLEReady(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief LPUART_TransferHandleReceiveDataIsFull handle function. - * This function handles when receive data is full. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - */ -static void LPUART_TransferHandleReceiveDataFull(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief LPUART_TransferHandleSendDataIsEmpty handle function. - * This function handles when send data is empty. - * - * @param base LPUART peripheral base address. - * @param irqHandle LPUART handle pointer. - */ -static void LPUART_TransferHandleSendDataEmpty(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief LPUART_TransferHandleTransmissionIsComplete handle function. - * This function handles Transmission complete and the interrupt is enabled. - * - * @param base LPUART peripheral base address. - * @param irqHandle LPUART handle pointer. - */ -static void LPUART_TransferHandleTransmissionComplete(LPUART_Type *base, lpuart_handle_t *handle); - -/******************************************************************************* - * Variables - ******************************************************************************/ -#if defined(LPUART_BASE_PTRS_NS) -static LPUART_Type *const s_lpuartBases_ns[] = LPUART_BASE_PTRS_NS; -#endif -/* Array of LPUART peripheral base address. */ -static LPUART_Type *const s_lpuartBases[] = LPUART_BASE_PTRS; -/* Array of LPUART handle. */ -void *s_lpuartHandle[ARRAY_SIZE(s_lpuartBases)]; -/* Array of LPUART IRQ number. */ -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -static const IRQn_Type s_lpuartRxIRQ[] = LPUART_RX_IRQS; -const IRQn_Type s_lpuartTxIRQ[] = LPUART_TX_IRQS; -#else -const IRQn_Type s_lpuartIRQ[] = LPUART_RX_TX_IRQS; -#endif -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/* Array of LPUART clock name. */ -static const clock_ip_name_t s_lpuartClock[] = LPUART_CLOCKS; - -#if defined(LPUART_PERIPH_CLOCKS) -/* Array of LPUART functional clock name. */ -static const clock_ip_name_t s_lpuartPeriphClocks[] = LPUART_PERIPH_CLOCKS; -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/* LPUART ISR for transactional APIs. */ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -lpuart_isr_t s_lpuartIsr[ARRAY_SIZE(s_lpuartBases)] = {[0 ...(ARRAY_SIZE(s_lpuartBases) - 1)] = - (lpuart_isr_t)DefaultISR}; -#else -lpuart_isr_t s_lpuartIsr[ARRAY_SIZE(s_lpuartBases)]; -#endif - -#if defined(LPUART_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_lpuartResets[] = LPUART_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -/*! - * brief Get the LPUART instance from peripheral base address. - * - * param base LPUART peripheral base address. - * return LPUART instance. - */ -uint32_t LPUART_GetInstance(LPUART_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0U; instance < ARRAY_SIZE(s_lpuartBases); instance++) - { - if (s_lpuartBases[instance] == base) - { - return instance; - } - } -#if defined(LPUART_BASE_PTRS_NS) - /* Find the instance index from base address mappings. */ - for (instance = 0U; instance < ARRAY_SIZE(s_lpuartBases_ns); instance++) - { - if (s_lpuartBases_ns[instance] == base) - { - return instance; - } - } - assert(instance < ARRAY_SIZE(s_lpuartBases_ns)); -#else - assert(instance < ARRAY_SIZE(s_lpuartBases)); -#endif - - return instance; -} - -/*! - * brief Get the length of received data in RX ring buffer. - * - * userData handle LPUART handle pointer. - * return Length of received data in RX ring buffer. - */ -size_t LPUART_TransferGetRxRingBufferLength(LPUART_Type *base, lpuart_handle_t *handle) -{ - assert(NULL != handle); - - size_t size; - size_t tmpRxRingBufferSize = handle->rxRingBufferSize; - uint16_t tmpRxRingBufferTail = handle->rxRingBufferTail; - uint16_t tmpRxRingBufferHead = handle->rxRingBufferHead; - - if (tmpRxRingBufferTail > tmpRxRingBufferHead) - { - size = ((size_t)tmpRxRingBufferHead + tmpRxRingBufferSize - (size_t)tmpRxRingBufferTail); - } - else - { - size = ((size_t)tmpRxRingBufferHead - (size_t)tmpRxRingBufferTail); - } - - return size; -} - -static bool LPUART_TransferIsRxRingBufferFull(LPUART_Type *base, lpuart_handle_t *handle) -{ - assert(NULL != handle); - - bool full; - - if (LPUART_TransferGetRxRingBufferLength(base, handle) == (handle->rxRingBufferSize - 1U)) - { - full = true; - } - else - { - full = false; - } - return full; -} - -static void LPUART_WriteNonBlocking(LPUART_Type *base, const uint8_t *data, size_t length) -{ - assert(NULL != data); - - size_t i; - - /* The Non Blocking write data API assume user have ensured there is enough space in - peripheral to write. */ - for (i = 0; i < length; i++) - { - base->DATA = data[i]; - } -} -static void LPUART_WriteNonBlocking16bit(LPUART_Type *base, const uint16_t *data, size_t length) -{ - assert(NULL != data); - - size_t i; - - /* The Non Blocking write data API assume user have ensured there is enough space in - peripheral to write. */ - for (i = 0; i < length; i++) - { - base->DATA = data[i]; - } -} - -static void LPUART_ReadNonBlocking(LPUART_Type *base, uint8_t *data, size_t length) -{ - assert(NULL != data); - - size_t i; -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - uint32_t ctrl = base->CTRL; - bool isSevenDataBits = (((ctrl & LPUART_CTRL_M7_MASK) != 0U) || - (((ctrl & LPUART_CTRL_M_MASK) == 0U) && ((ctrl & LPUART_CTRL_PE_MASK) != 0U))); -#endif - - /* The Non Blocking read data API assume user have ensured there is enough space in - peripheral to write. */ - for (i = 0; i < length; i++) - { -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - if (isSevenDataBits) - { - data[i] = (uint8_t)(base->DATA & 0x7FU); - } - else - { - data[i] = (uint8_t)base->DATA; - } -#else - data[i] = (uint8_t)(base->DATA); -#endif - } -} - -static void LPUART_ReadNonBlocking16bit(LPUART_Type *base, uint16_t *data, size_t length) -{ - assert(NULL != data); - - size_t i; - /* The Non Blocking read data API assume user have ensured there is enough space in - peripheral to write. */ - for (i = 0; i < length; i++) - { - data[i] = (uint16_t)(base->DATA & 0x03FFU); - } -} - -/*! - * brief Initializes an LPUART instance with the user configuration structure and the peripheral clock. - * - * This function configures the LPUART module with user-defined settings. Call the LPUART_GetDefaultConfig() function - * to configure the configuration structure and get the default configuration. - * The example below shows how to use this API to configure the LPUART. - * code - * lpuart_config_t lpuartConfig; - * lpuartConfig.baudRate_Bps = 115200U; - * lpuartConfig.parityMode = kLPUART_ParityDisabled; - * lpuartConfig.dataBitsCount = kLPUART_EightDataBits; - * lpuartConfig.isMsb = false; - * lpuartConfig.stopBitCount = kLPUART_OneStopBit; - * lpuartConfig.txFifoWatermark = 0; - * lpuartConfig.rxFifoWatermark = 1; - * LPUART_Init(LPUART1, &lpuartConfig, 20000000U); - * endcode - * - * param base LPUART peripheral base address. - * param config Pointer to a user-defined configuration structure. - * param srcClock_Hz LPUART clock source frequency in HZ. - * retval kStatus_LPUART_BaudrateNotSupport Baudrate is not support in current clock source. - * retval kStatus_Success LPUART initialize succeed - */ -status_t LPUART_Init(LPUART_Type *base, const lpuart_config_t *config, uint32_t srcClock_Hz) -{ - assert(NULL != config); - assert(0U < config->baudRate_Bps); -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - assert((uint8_t)FSL_FEATURE_LPUART_FIFO_SIZEn(base) > config->txFifoWatermark); - assert((uint8_t)FSL_FEATURE_LPUART_FIFO_SIZEn(base) > config->rxFifoWatermark); -#endif - - status_t status = kStatus_Success; - uint32_t temp; - uint16_t sbr, sbrTemp; - uint8_t osr, osrTemp; - uint32_t tempDiff, calculatedBaud, baudDiff; - - /* This LPUART instantiation uses a slightly different baud rate calculation - * The idea is to use the best OSR (over-sampling rate) possible - * Note, OSR is typically hard-set to 16 in other LPUART instantiations - * loop to find the best OSR value possible, one that generates minimum baudDiff - * iterate through the rest of the supported values of OSR */ - - baudDiff = config->baudRate_Bps; - osr = 0U; - sbr = 0U; - for (osrTemp = 4U; osrTemp <= 32U; osrTemp++) - { - /* calculate the temporary sbr value */ - sbrTemp = (uint16_t)((srcClock_Hz * 2U / (config->baudRate_Bps * (uint32_t)osrTemp) + 1U) / 2U); - /*set sbrTemp to 1 if the sourceClockInHz can not satisfy the desired baud rate*/ - if (sbrTemp == 0U) - { - sbrTemp = 1U; - } - else if (sbrTemp > LPUART_BAUD_SBR_MASK) - { - sbrTemp = LPUART_BAUD_SBR_MASK; - } - else - { - /* Avoid MISRA 15.7 */ - } - /* Calculate the baud rate based on the temporary OSR and SBR values */ - calculatedBaud = (srcClock_Hz / ((uint32_t)osrTemp * (uint32_t)sbrTemp)); - tempDiff = calculatedBaud > config->baudRate_Bps ? (calculatedBaud - config->baudRate_Bps) : - (config->baudRate_Bps - calculatedBaud); - - if (tempDiff <= baudDiff) - { - baudDiff = tempDiff; - osr = osrTemp; /* update and store the best OSR value calculated */ - sbr = sbrTemp; /* update store the best SBR value calculated */ - } - } - - /* Check to see if actual baud rate is within 3% of desired baud rate - * based on the best calculate OSR value */ - if (baudDiff > ((config->baudRate_Bps / 100U) * 3U)) - { - /* Unacceptable baud rate difference of more than 3%*/ - status = kStatus_LPUART_BaudrateNotSupport; - } - else - { -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - - uint32_t instance = LPUART_GetInstance(base); - - /* Enable lpuart clock */ - (void)CLOCK_EnableClock(s_lpuartClock[instance]); -#if defined(LPUART_PERIPH_CLOCKS) - (void)CLOCK_EnableClock(s_lpuartPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(LPUART_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_lpuartResets[LPUART_GetInstance(base)]); -#endif - -#if defined(FSL_FEATURE_LPUART_HAS_GLOBAL) && FSL_FEATURE_LPUART_HAS_GLOBAL - /*Reset all internal logic and registers, except the Global Register */ - LPUART_SoftwareReset(base); -#else - /* Disable LPUART TX RX before setting. */ - base->CTRL &= ~(LPUART_CTRL_TE_MASK | LPUART_CTRL_RE_MASK); -#endif - - temp = base->BAUD; - - /* Acceptable baud rate, check if OSR is between 4x and 7x oversampling. - * If so, then "BOTHEDGE" sampling must be turned on */ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_1$ - */ - if ((osr > 3U) && (osr < 8U)) - { - temp |= LPUART_BAUD_BOTHEDGE_MASK; - } - - /* program the osr value (bit value is one less than actual value) */ - temp &= ~LPUART_BAUD_OSR_MASK; - temp |= LPUART_BAUD_OSR((uint32_t)osr - 1UL); - - /* write the sbr value to the BAUD registers */ - temp &= ~LPUART_BAUD_SBR_MASK; - base->BAUD = temp | LPUART_BAUD_SBR(sbr); - - /* Set bit count and parity mode. */ - base->BAUD &= ~LPUART_BAUD_M10_MASK; - - temp = base->CTRL & ~(LPUART_CTRL_PE_MASK | LPUART_CTRL_PT_MASK | LPUART_CTRL_M_MASK | LPUART_CTRL_ILT_MASK | - LPUART_CTRL_IDLECFG_MASK); - - temp |= (uint8_t)config->parityMode | LPUART_CTRL_IDLECFG(config->rxIdleConfig) | - LPUART_CTRL_ILT(config->rxIdleType); - -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - if (kLPUART_SevenDataBits == config->dataBitsCount) - { - if (kLPUART_ParityDisabled != config->parityMode) - { - temp &= ~LPUART_CTRL_M7_MASK; /* Seven data bits and one parity bit */ - } - else - { - temp |= LPUART_CTRL_M7_MASK; - } - } - else -#endif - { - if (kLPUART_ParityDisabled != config->parityMode) - { - temp |= LPUART_CTRL_M_MASK; /* Eight data bits and one parity bit */ - } - } - - base->CTRL = temp; - -#if defined(FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT) && FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT - /* set stop bit per char */ - temp = base->BAUD & ~LPUART_BAUD_SBNS_MASK; - base->BAUD = temp | LPUART_BAUD_SBNS((uint8_t)config->stopBitCount); -#endif - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Set tx/rx WATER watermark - Note: - Take care of the RX FIFO, RX interrupt request only assert when received bytes - equal or more than RX water mark, there is potential issue if RX water - mark larger than 1. - For example, if RX FIFO water mark is 2, upper layer needs 5 bytes and - 5 bytes are received. the last byte will be saved in FIFO but not trigger - RX interrupt because the water mark is 2. - */ - base->WATER = (((uint32_t)(config->rxFifoWatermark) << 16U) | config->txFifoWatermark); - - /* Enable tx/rx FIFO */ - base->FIFO |= (LPUART_FIFO_TXFE_MASK | LPUART_FIFO_RXFE_MASK); - - /* Flush FIFO */ - base->FIFO |= (LPUART_FIFO_TXFLUSH_MASK | LPUART_FIFO_RXFLUSH_MASK); -#endif - - /* Clear all status flags */ - temp = (LPUART_STAT_RXEDGIF_MASK | LPUART_STAT_IDLE_MASK | LPUART_STAT_OR_MASK | LPUART_STAT_NF_MASK | - LPUART_STAT_FE_MASK | LPUART_STAT_PF_MASK); - -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - temp |= LPUART_STAT_LBKDIF_MASK; -#endif - -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - temp |= (LPUART_STAT_MA1F_MASK | LPUART_STAT_MA2F_MASK); -#endif - -#if defined(FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT) && FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT - /* Set the CTS configuration/TX CTS source. */ - base->MODIR |= LPUART_MODIR_TXCTSC(config->txCtsConfig) | LPUART_MODIR_TXCTSSRC(config->txCtsSource); - if (true == config->enableRxRTS) - { - /* Enable the receiver RTS(request-to-send) function. */ - base->MODIR |= LPUART_MODIR_RXRTSE_MASK; - } - if (true == config->enableTxCTS) - { - /* Enable the CTS(clear-to-send) function. */ - base->MODIR |= LPUART_MODIR_TXCTSE_MASK; - } -#endif - - /* Set data bits order. */ - if (true == config->isMsb) - { - temp |= LPUART_STAT_MSBF_MASK; - } - else - { - temp &= ~LPUART_STAT_MSBF_MASK; - } - - base->STAT |= temp; - - /* Enable TX/RX base on configure structure. */ - temp = base->CTRL; - if (true == config->enableTx) - { - temp |= LPUART_CTRL_TE_MASK; - } - - if (true == config->enableRx) - { - temp |= LPUART_CTRL_RE_MASK; - } - - base->CTRL = temp; - } - - return status; -} -/*! - * brief Deinitializes a LPUART instance. - * - * This function waits for transmit to complete, disables TX and RX, and disables the LPUART clock. - * - * param base LPUART peripheral base address. - */ -void LPUART_Deinit(LPUART_Type *base) -{ - uint32_t temp; - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Wait tx FIFO send out*/ - while (0U != ((base->WATER & LPUART_WATER_TXCOUNT_MASK) >> LPUART_WATER_TXWATER_SHIFT)) - { - } -#endif - /* Wait last char shift out */ - while (0U == (base->STAT & LPUART_STAT_TC_MASK)) - { - } - - /* Clear all status flags */ - temp = (LPUART_STAT_RXEDGIF_MASK | LPUART_STAT_IDLE_MASK | LPUART_STAT_OR_MASK | LPUART_STAT_NF_MASK | - LPUART_STAT_FE_MASK | LPUART_STAT_PF_MASK); - -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - temp |= LPUART_STAT_LBKDIF_MASK; -#endif - -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - temp |= (LPUART_STAT_MA1F_MASK | LPUART_STAT_MA2F_MASK); -#endif - - base->STAT |= temp; - - /* Disable the module. */ - base->CTRL = 0U; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - uint32_t instance = LPUART_GetInstance(base); - - /* Disable lpuart clock */ - (void)CLOCK_DisableClock(s_lpuartClock[instance]); - -#if defined(LPUART_PERIPH_CLOCKS) - (void)CLOCK_DisableClock(s_lpuartPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Gets the default configuration structure. - * - * This function initializes the LPUART configuration structure to a default value. The default - * values are: - * lpuartConfig->baudRate_Bps = 115200U; - * lpuartConfig->parityMode = kLPUART_ParityDisabled; - * lpuartConfig->dataBitsCount = kLPUART_EightDataBits; - * lpuartConfig->isMsb = false; - * lpuartConfig->stopBitCount = kLPUART_OneStopBit; - * lpuartConfig->txFifoWatermark = 0; - * lpuartConfig->rxFifoWatermark = 1; - * lpuartConfig->rxIdleType = kLPUART_IdleTypeStartBit; - * lpuartConfig->rxIdleConfig = kLPUART_IdleCharacter1; - * lpuartConfig->enableTx = false; - * lpuartConfig->enableRx = false; - * - * param config Pointer to a configuration structure. - */ -void LPUART_GetDefaultConfig(lpuart_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->baudRate_Bps = 115200U; - config->parityMode = kLPUART_ParityDisabled; - config->dataBitsCount = kLPUART_EightDataBits; - config->isMsb = false; -#if defined(FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT) && FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT - config->stopBitCount = kLPUART_OneStopBit; -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - config->txFifoWatermark = 0U; - config->rxFifoWatermark = 0U; -#endif -#if defined(FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT) && FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT - config->enableRxRTS = false; - config->enableTxCTS = false; - config->txCtsConfig = kLPUART_CtsSampleAtStart; - config->txCtsSource = kLPUART_CtsSourcePin; -#endif - config->rxIdleType = kLPUART_IdleTypeStartBit; - config->rxIdleConfig = kLPUART_IdleCharacter1; - config->enableTx = false; - config->enableRx = false; -} - -/*! - * brief Sets the LPUART instance baudrate. - * - * This function configures the LPUART module baudrate. This function is used to update - * the LPUART module baudrate after the LPUART module is initialized by the LPUART_Init. - * code - * LPUART_SetBaudRate(LPUART1, 115200U, 20000000U); - * endcode - * - * param base LPUART peripheral base address. - * param baudRate_Bps LPUART baudrate to be set. - * param srcClock_Hz LPUART clock source frequency in HZ. - * retval kStatus_LPUART_BaudrateNotSupport Baudrate is not supported in the current clock source. - * retval kStatus_Success Set baudrate succeeded. - */ -status_t LPUART_SetBaudRate(LPUART_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz) -{ - assert(0U < baudRate_Bps); - - status_t status = kStatus_Success; - uint32_t temp, oldCtrl; - uint16_t sbr, sbrTemp; - uint8_t osr, osrTemp; - uint32_t tempDiff, calculatedBaud, baudDiff; - - /* This LPUART instantiation uses a slightly different baud rate calculation - * The idea is to use the best OSR (over-sampling rate) possible - * Note, OSR is typically hard-set to 16 in other LPUART instantiations - * loop to find the best OSR value possible, one that generates minimum baudDiff - * iterate through the rest of the supported values of OSR */ - - baudDiff = baudRate_Bps; - osr = 0U; - sbr = 0U; - for (osrTemp = 4U; osrTemp <= 32U; osrTemp++) - { - /* calculate the temporary sbr value */ - sbrTemp = (uint16_t)((srcClock_Hz * 2U / (baudRate_Bps * (uint32_t)osrTemp) + 1U) / 2U); - /*set sbrTemp to 1 if the sourceClockInHz can not satisfy the desired baud rate*/ - if (sbrTemp == 0U) - { - sbrTemp = 1U; - } - else if (sbrTemp > LPUART_BAUD_SBR_MASK) - { - sbrTemp = LPUART_BAUD_SBR_MASK; - } - else - { - /* Avoid MISRA 15.7 */ - } - /* Calculate the baud rate based on the temporary OSR and SBR values */ - calculatedBaud = srcClock_Hz / ((uint32_t)osrTemp * (uint32_t)sbrTemp); - - tempDiff = calculatedBaud > baudRate_Bps ? (calculatedBaud - baudRate_Bps) : (baudRate_Bps - calculatedBaud); - - if (tempDiff <= baudDiff) - { - baudDiff = tempDiff; - osr = osrTemp; /* update and store the best OSR value calculated */ - sbr = sbrTemp; /* update store the best SBR value calculated */ - } - } - - /* Check to see if actual baud rate is within 3% of desired baud rate - * based on the best calculate OSR value */ - if (baudDiff < (uint32_t)((baudRate_Bps / 100U) * 3U)) - { - /* Store CTRL before disable Tx and Rx */ - oldCtrl = base->CTRL; - - /* Disable LPUART TX RX before setting. */ - base->CTRL &= ~(LPUART_CTRL_TE_MASK | LPUART_CTRL_RE_MASK); - - temp = base->BAUD; - - /* Acceptable baud rate, check if OSR is between 4x and 7x oversampling. - * If so, then "BOTHEDGE" sampling must be turned on */ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_1$ - */ - if ((osr > 3U) && (osr < 8U)) - { - temp |= LPUART_BAUD_BOTHEDGE_MASK; - } - - /* program the osr value (bit value is one less than actual value) */ - temp &= ~LPUART_BAUD_OSR_MASK; - temp |= LPUART_BAUD_OSR((uint32_t)osr - 1UL); - - /* write the sbr value to the BAUD registers */ - temp &= ~LPUART_BAUD_SBR_MASK; - base->BAUD = temp | LPUART_BAUD_SBR(sbr); - - /* Restore CTRL. */ - base->CTRL = oldCtrl; - } - else - { - /* Unacceptable baud rate difference of more than 3%*/ - status = kStatus_LPUART_BaudrateNotSupport; - } - - return status; -} - -/*! - * brief Enable 9-bit data mode for LPUART. - * - * This function set the 9-bit mode for LPUART module. The 9th bit is not used for parity thus can be modified by user. - * - * param base LPUART peripheral base address. - * param enable true to enable, flase to disable. - */ -void LPUART_Enable9bitMode(LPUART_Type *base, bool enable) -{ - assert(base != NULL); - - uint32_t temp = 0U; - - if (enable) - { - /* Set LPUART_CTRL_M for 9-bit mode, clear LPUART_CTRL_PE to disable parity. */ - temp = base->CTRL & ~((uint32_t)LPUART_CTRL_PE_MASK | (uint32_t)LPUART_CTRL_M_MASK); - temp |= (uint32_t)LPUART_CTRL_M_MASK; - base->CTRL = temp; - } - else - { - /* Clear LPUART_CTRL_M. */ - base->CTRL &= ~(uint32_t)LPUART_CTRL_M_MASK; - } -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - /* Clear LPUART_CTRL_M7 to disable 7-bit mode. */ - base->CTRL &= ~(uint32_t)LPUART_CTRL_M7_MASK; -#endif -#if defined(FSL_FEATURE_LPUART_HAS_10BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_10BIT_DATA_SUPPORT - /* Clear LPUART_BAUD_M10 to disable 10-bit mode. */ - base->BAUD &= ~(uint32_t)LPUART_BAUD_M10_MASK; -#endif -} - -/*! - * brief Transmit an address frame in 9-bit data mode. - * - * param base LPUART peripheral base address. - * param address LPUART slave address. - */ -void LPUART_SendAddress(LPUART_Type *base, uint8_t address) -{ - assert(base != NULL); - - uint32_t temp = base->DATA & 0xFFFFFC00UL; - temp |= ((uint32_t)address | (1UL << LPUART_DATA_R8T8_SHIFT)); - base->DATA = temp; -} - -/*! - * brief Enables LPUART interrupts according to a provided mask. - * - * This function enables the LPUART interrupts according to a provided mask. The mask - * is a logical OR of enumeration members. See the ref _lpuart_interrupt_enable. - * This examples shows how to enable TX empty interrupt and RX full interrupt: - * code - * LPUART_EnableInterrupts(LPUART1,kLPUART_TxDataRegEmptyInterruptEnable | kLPUART_RxDataRegFullInterruptEnable); - * endcode - * - * param base LPUART peripheral base address. - * param mask The interrupts to enable. Logical OR of ref _lpuart_interrupt_enable. - */ -void LPUART_EnableInterrupts(LPUART_Type *base, uint32_t mask) -{ - uint32_t s_atomicOldInt; - /* Only consider the real interrupt enable bits. */ - mask &= (uint32_t)kLPUART_AllInterruptEnable; - - /* Check int enable bits in base->BAUD */ - uint32_t baudRegMask = 0UL; -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - baudRegMask |= ((mask << 8U) & LPUART_BAUD_LBKDIE_MASK); - /* Clear bit 7 from mask */ - mask &= ~(uint32_t)kLPUART_LinBreakInterruptEnable; -#endif - baudRegMask |= ((mask << 8U) & LPUART_BAUD_RXEDGIE_MASK); - /* Clear bit 6 from mask */ - mask &= ~(uint32_t)kLPUART_RxActiveEdgeInterruptEnable; - - s_atomicOldInt = DisableGlobalIRQ(); - base->BAUD |= baudRegMask; - EnableGlobalIRQ(s_atomicOldInt); - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Check int enable bits in base->FIFO */ - - s_atomicOldInt = DisableGlobalIRQ(); - base->FIFO = (base->FIFO & ~(LPUART_FIFO_TXOF_MASK | LPUART_FIFO_RXUF_MASK)) | - (mask & (LPUART_FIFO_TXOFE_MASK | LPUART_FIFO_RXUFE_MASK)); - EnableGlobalIRQ(s_atomicOldInt); - - /* Clear bit 9 and bit 8 from mask */ - mask &= ~((uint32_t)kLPUART_TxFifoOverflowInterruptEnable | (uint32_t)kLPUART_RxFifoUnderflowInterruptEnable); -#endif - - /* Set int enable bits in base->CTRL */ - s_atomicOldInt = DisableGlobalIRQ(); - base->CTRL |= mask; - EnableGlobalIRQ(s_atomicOldInt); -} - -/*! - * brief Disables LPUART interrupts according to a provided mask. - * - * This function disables the LPUART interrupts according to a provided mask. The mask - * is a logical OR of enumeration members. See ref _lpuart_interrupt_enable. - * This example shows how to disable the TX empty interrupt and RX full interrupt: - * code - * LPUART_DisableInterrupts(LPUART1,kLPUART_TxDataRegEmptyInterruptEnable | kLPUART_RxDataRegFullInterruptEnable); - * endcode - * - * param base LPUART peripheral base address. - * param mask The interrupts to disable. Logical OR of ref _lpuart_interrupt_enable. - */ -void LPUART_DisableInterrupts(LPUART_Type *base, uint32_t mask) -{ - uint32_t s_atomicOldInt; - /* Only consider the real interrupt enable bits. */ - mask &= (uint32_t)kLPUART_AllInterruptEnable; - - /* Clear int enable bits in base->BAUD */ - uint32_t baudRegMask = 0UL; -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - baudRegMask |= ((mask << 8U) & LPUART_BAUD_LBKDIE_MASK); - /* Clear bit 7 from mask */ - mask &= ~(uint32_t)kLPUART_LinBreakInterruptEnable; -#endif - baudRegMask |= ((mask << 8U) & LPUART_BAUD_RXEDGIE_MASK); - /* Clear bit 6 from mask */ - mask &= ~(uint32_t)kLPUART_RxActiveEdgeInterruptEnable; - - s_atomicOldInt = DisableGlobalIRQ(); - base->BAUD &= ~baudRegMask; - EnableGlobalIRQ(s_atomicOldInt); - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Clear int enable bits in base->FIFO */ - - s_atomicOldInt = DisableGlobalIRQ(); - base->FIFO = (base->FIFO & ~(LPUART_FIFO_TXOF_MASK | LPUART_FIFO_RXUF_MASK)) & - ~(mask & (LPUART_FIFO_TXOFE_MASK | LPUART_FIFO_RXUFE_MASK)); - EnableGlobalIRQ(s_atomicOldInt); - /* Clear bit 9 and bit 8 from mask */ - mask &= ~((uint32_t)kLPUART_TxFifoOverflowInterruptEnable | (uint32_t)kLPUART_RxFifoUnderflowInterruptEnable); -#endif - - /* Clear int enable bits in base->CTRL */ - s_atomicOldInt = DisableGlobalIRQ(); - base->CTRL &= ~mask; - EnableGlobalIRQ(s_atomicOldInt); -} - -/*! - * brief Gets enabled LPUART interrupts. - * - * This function gets the enabled LPUART interrupts. The enabled interrupts are returned - * as the logical OR value of the enumerators ref _lpuart_interrupt_enable. To check - * a specific interrupt enable status, compare the return value with enumerators - * in ref _lpuart_interrupt_enable. - * For example, to check whether the TX empty interrupt is enabled: - * code - * uint32_t enabledInterrupts = LPUART_GetEnabledInterrupts(LPUART1); - * - * if (kLPUART_TxDataRegEmptyInterruptEnable & enabledInterrupts) - * { - * ... - * } - * endcode - * - * param base LPUART peripheral base address. - * return LPUART interrupt flags which are logical OR of the enumerators in ref _lpuart_interrupt_enable. - */ -uint32_t LPUART_GetEnabledInterrupts(LPUART_Type *base) -{ - /* Check int enable bits in base->CTRL */ - uint32_t temp = (uint32_t)(base->CTRL & (uint32_t)kLPUART_AllInterruptEnable); - - /* Check int enable bits in base->BAUD */ - temp = (temp & ~(uint32_t)kLPUART_RxActiveEdgeInterruptEnable) | ((base->BAUD & LPUART_BAUD_RXEDGIE_MASK) >> 8U); -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - temp = (temp & ~(uint32_t)kLPUART_LinBreakInterruptEnable) | ((base->BAUD & LPUART_BAUD_LBKDIE_MASK) >> 8U); -#endif - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Check int enable bits in base->FIFO */ - temp = - (temp & ~((uint32_t)kLPUART_TxFifoOverflowInterruptEnable | (uint32_t)kLPUART_RxFifoUnderflowInterruptEnable)) | - (base->FIFO & (LPUART_FIFO_TXOFE_MASK | LPUART_FIFO_RXUFE_MASK)); -#endif - - return temp; -} - -/*! - * brief Gets LPUART status flags. - * - * This function gets all LPUART status flags. The flags are returned as the logical - * OR value of the enumerators ref _lpuart_flags. To check for a specific status, - * compare the return value with enumerators in the ref _lpuart_flags. - * For example, to check whether the TX is empty: - * code - * if (kLPUART_TxDataRegEmptyFlag & LPUART_GetStatusFlags(LPUART1)) - * { - * ... - * } - * endcode - * - * param base LPUART peripheral base address. - * return LPUART status flags which are ORed by the enumerators in the _lpuart_flags. - */ -uint32_t LPUART_GetStatusFlags(LPUART_Type *base) -{ - uint32_t temp; - temp = base->STAT; -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - temp |= (base->FIFO & - (LPUART_FIFO_TXEMPT_MASK | LPUART_FIFO_RXEMPT_MASK | LPUART_FIFO_TXOF_MASK | LPUART_FIFO_RXUF_MASK)) >> - 16U; -#endif - /* Only keeps the status bits */ - temp &= (uint32_t)kLPUART_AllFlags; - return temp; -} - -/*! - * brief Clears status flags with a provided mask. - * - * This function clears LPUART status flags with a provided mask. Automatically cleared flags - * can't be cleared by this function. - * Flags that can only cleared or set by hardware are: - * kLPUART_TxDataRegEmptyFlag, kLPUART_TransmissionCompleteFlag, kLPUART_RxDataRegFullFlag, - * kLPUART_RxActiveFlag, kLPUART_NoiseErrorFlag, kLPUART_ParityErrorFlag, - * kLPUART_TxFifoEmptyFlag,kLPUART_RxFifoEmptyFlag - * Note: This API should be called when the Tx/Rx is idle, otherwise it takes no effects. - * - * param base LPUART peripheral base address. - * param mask the status flags to be cleared. The user can use the enumerators in the - * _lpuart_status_flag_t to do the OR operation and get the mask. - * return 0 succeed, others failed. - * retval kStatus_LPUART_FlagCannotClearManually The flag can't be cleared by this function but - * it is cleared automatically by hardware. - * retval kStatus_Success Status in the mask are cleared. - */ -status_t LPUART_ClearStatusFlags(LPUART_Type *base, uint32_t mask) -{ - uint32_t temp; - status_t status; - - /* Only deal with the clearable flags */ - mask &= (uint32_t)kLPUART_AllClearFlags; -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Status bits in FIFO register */ - if ((mask & ((uint32_t)kLPUART_TxFifoOverflowFlag | (uint32_t)kLPUART_RxFifoUnderflowFlag)) != 0U) - { - /* Get the FIFO register value and mask the rx/tx FIFO flush bits and the status bits that can be W1C in case - they are written 1 accidentally. */ - temp = (uint32_t)base->FIFO; - temp &= (uint32_t)(~(LPUART_FIFO_TXFLUSH_MASK | LPUART_FIFO_RXFLUSH_MASK | LPUART_FIFO_TXOF_MASK | - LPUART_FIFO_RXUF_MASK)); - temp |= (mask << 16U) & (LPUART_FIFO_TXOF_MASK | LPUART_FIFO_RXUF_MASK); - base->FIFO = temp; - } -#endif - /* Status bits in STAT register */ - /* First get the STAT register value and mask all the bits that not represent status, then OR with the status bit - * that is to be W1C */ - temp = (base->STAT & 0x3E000000UL) | mask; - base->STAT = temp; - /* If some flags still pending. */ - if (0U != (mask & LPUART_GetStatusFlags(base))) - { - status = kStatus_LPUART_FlagCannotClearManually; - } - else - { - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Writes to the transmitter register using a blocking method. - * - * This function polls the transmitter register, first waits for the register to be empty or TX FIFO to have room, - * and writes data to the transmitter buffer, then waits for the data to be sent out to bus. - * - * param base LPUART peripheral base address. - * param data Start address of the data to write. - * param length Size of the data to write. - * retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * retval kStatus_Success Successfully wrote all data. - */ -status_t LPUART_WriteBlocking(LPUART_Type *base, const uint8_t *data, size_t length) -{ - assert(NULL != data); - - const uint8_t *dataAddress = data; - size_t transferSize = length; - -#if UART_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != transferSize) - { -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; - while ((0U == (base->STAT & LPUART_STAT_TDRE_MASK)) && (0U != --waitTimes)) -#else - while (0U == (base->STAT & LPUART_STAT_TDRE_MASK)) -#endif - { - } -#if UART_RETRY_TIMES - if (0U == waitTimes) - { - return kStatus_LPUART_Timeout; - } -#endif - base->DATA = *(dataAddress); - dataAddress++; - transferSize--; - } - /* Ensure all the data in the transmit buffer are sent out to bus. */ -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; - while ((0U == (base->STAT & LPUART_STAT_TC_MASK)) && (0U != --waitTimes)) -#else - while (0U == (base->STAT & LPUART_STAT_TC_MASK)) -#endif - { - } -#if UART_RETRY_TIMES - if (0U == waitTimes) - { - return kStatus_LPUART_Timeout; - } -#endif - return kStatus_Success; -} -/*! - * brief Writes to the transmitter register using a blocking method in 9bit or 10bit mode. - * - * note This function only support 9bit or 10bit transfer. - * Please make sure only 10bit of data is valid and other bits are 0. - * - * param base LPUART peripheral base address. - * param data Start address of the data to write. - * param length Size of the data to write. - * retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * retval kStatus_Success Successfully wrote all data. - */ -status_t LPUART_WriteBlocking16bit(LPUART_Type *base, const uint16_t *data, size_t length) -{ - assert(NULL != data); - - const uint16_t *dataAddress = data; - size_t transferSize = length; - -#if UART_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != transferSize) - { -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; - while ((0U == (base->STAT & LPUART_STAT_TDRE_MASK)) && (0U != --waitTimes)) -#else - while (0U == (base->STAT & LPUART_STAT_TDRE_MASK)) -#endif - { - } -#if UART_RETRY_TIMES - if (0U == waitTimes) - { - return kStatus_LPUART_Timeout; - } -#endif - base->DATA = *(dataAddress); - dataAddress++; - transferSize--; - } - /* Ensure all the data in the transmit buffer are sent out to bus. */ -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; - while ((0U == (base->STAT & LPUART_STAT_TC_MASK)) && (0U != --waitTimes)) -#else - while (0U == (base->STAT & LPUART_STAT_TC_MASK)) -#endif - { - } -#if UART_RETRY_TIMES - if (0U == waitTimes) - { - return kStatus_LPUART_Timeout; - } -#endif - return kStatus_Success; -} - -/*! - * brief Reads the receiver data register using a blocking method. - * - * This function polls the receiver register, waits for the receiver register full or receiver FIFO - * has data, and reads data from the TX register. - * - * param base LPUART peripheral base address. - * param data Start address of the buffer to store the received data. - * param length Size of the buffer. - * retval kStatus_LPUART_RxHardwareOverrun Receiver overrun happened while receiving data. - * retval kStatus_LPUART_NoiseError Noise error happened while receiving data. - * retval kStatus_LPUART_FramingError Framing error happened while receiving data. - * retval kStatus_LPUART_ParityError Parity error happened while receiving data. - * retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * retval kStatus_Success Successfully received all data. - */ -status_t LPUART_ReadBlocking(LPUART_Type *base, uint8_t *data, size_t length) -{ - assert(NULL != data); - - status_t status = kStatus_Success; - uint32_t statusFlag; - uint8_t *dataAddress = data; - -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - uint32_t ctrl = base->CTRL; - bool isSevenDataBits = (((ctrl & LPUART_CTRL_M7_MASK) != 0U) || - (((ctrl & LPUART_CTRL_M_MASK) == 0U) && ((ctrl & LPUART_CTRL_PE_MASK) != 0U))); -#endif - -#if UART_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != (length--)) - { -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - while (0U == ((base->WATER & LPUART_WATER_RXCOUNT_MASK) >> LPUART_WATER_RXCOUNT_SHIFT)) -#else - while (0U == (base->STAT & LPUART_STAT_RDRF_MASK)) -#endif - { -#if UART_RETRY_TIMES - if (0U == --waitTimes) - { - status = kStatus_LPUART_Timeout; - break; - } -#endif - statusFlag = LPUART_GetStatusFlags(base); - - if (0U != (statusFlag & (uint32_t)kLPUART_RxOverrunFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_RxOverrunFlag)) ? - (kStatus_LPUART_RxHardwareOverrun) : - (kStatus_LPUART_FlagCannotClearManually)); - /* Other error flags(FE, NF, and PF) are prevented from setting once OR is set, no need to check other - * error flags*/ - break; - } - - if (0U != (statusFlag & (uint32_t)kLPUART_ParityErrorFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_ParityErrorFlag)) ? - (kStatus_LPUART_ParityError) : - (kStatus_LPUART_FlagCannotClearManually)); - } - - if (0U != (statusFlag & (uint32_t)kLPUART_FramingErrorFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_FramingErrorFlag)) ? - (kStatus_LPUART_FramingError) : - (kStatus_LPUART_FlagCannotClearManually)); - } - - if (0U != (statusFlag & (uint32_t)kLPUART_NoiseErrorFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_NoiseErrorFlag)) ? - (kStatus_LPUART_NoiseError) : - (kStatus_LPUART_FlagCannotClearManually)); - } - if (kStatus_Success != status) - { - break; - } - } - - if (kStatus_Success == status) - { -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - if (isSevenDataBits) - { - *(dataAddress) = (uint8_t)(base->DATA & 0x7FU); - dataAddress++; - } - else - { - *(dataAddress) = (uint8_t)base->DATA; - dataAddress++; - } -#else - *(dataAddress) = (uint8_t)base->DATA; - dataAddress++; -#endif - } - else - { - break; - } - } - - return status; -} -/*! - * brief Reads the receiver data register in 9bit or 10bit mode. - * - * note This function only support 9bit or 10bit transfer. - * - * param base LPUART peripheral base address. - * param data Start address of the buffer to store the received data by 16bit, only 10bit is valid. - * param length Size of the buffer. - * retval kStatus_LPUART_RxHardwareOverrun Receiver overrun happened while receiving data. - * retval kStatus_LPUART_NoiseError Noise error happened while receiving data. - * retval kStatus_LPUART_FramingError Framing error happened while receiving data. - * retval kStatus_LPUART_ParityError Parity error happened while receiving data. - * retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * retval kStatus_Success Successfully received all data. - */ -status_t LPUART_ReadBlocking16bit(LPUART_Type *base, uint16_t *data, size_t length) -{ - assert(NULL != data); - - status_t status = kStatus_Success; - uint32_t statusFlag; - uint16_t *dataAddress = data; - -#if UART_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != (length--)) - { -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - while (0U == ((base->WATER & LPUART_WATER_RXCOUNT_MASK) >> LPUART_WATER_RXCOUNT_SHIFT)) -#else - while (0U == (base->STAT & LPUART_STAT_RDRF_MASK)) -#endif - { -#if UART_RETRY_TIMES - if (0U == --waitTimes) - { - status = kStatus_LPUART_Timeout; - break; - } -#endif - statusFlag = LPUART_GetStatusFlags(base); - - if (0U != (statusFlag & (uint32_t)kLPUART_RxOverrunFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_RxOverrunFlag)) ? - (kStatus_LPUART_RxHardwareOverrun) : - (kStatus_LPUART_FlagCannotClearManually)); - /* Other error flags(FE, NF, and PF) are prevented from setting once OR is set, no need to check other - * error flags*/ - break; - } - - if (0U != (statusFlag & (uint32_t)kLPUART_ParityErrorFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_ParityErrorFlag)) ? - (kStatus_LPUART_ParityError) : - (kStatus_LPUART_FlagCannotClearManually)); - } - - if (0U != (statusFlag & (uint32_t)kLPUART_FramingErrorFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_FramingErrorFlag)) ? - (kStatus_LPUART_FramingError) : - (kStatus_LPUART_FlagCannotClearManually)); - } - - if (0U != (statusFlag & (uint32_t)kLPUART_NoiseErrorFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_NoiseErrorFlag)) ? - (kStatus_LPUART_NoiseError) : - (kStatus_LPUART_FlagCannotClearManually)); - } - if (kStatus_Success != status) - { - break; - } - } - if (kStatus_Success == status) - { - *(dataAddress) = (uint16_t)(base->DATA & 0x03FFU); - dataAddress++; - } - else - { - break; - } - } - - return status; -} - -/*! - * brief Initializes the LPUART handle. - * - * This function initializes the LPUART handle, which can be used for other LPUART - * transactional APIs. Usually, for a specified LPUART instance, - * call this API once to get the initialized handle. - * - * The LPUART driver supports the "background" receiving, which means that user can set up - * an RX ring buffer optionally. Data received is stored into the ring buffer even when the - * user doesn't call the LPUART_TransferReceiveNonBlocking() API. If there is already data received - * in the ring buffer, the user can get the received data from the ring buffer directly. - * The ring buffer is disabled if passing NULL as p ringBuffer. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param callback Callback function. - * param userData User data. - */ -void LPUART_TransferCreateHandle(LPUART_Type *base, - lpuart_handle_t *handle, - lpuart_transfer_callback_t callback, - void *userData) -{ - assert(NULL != handle); - - uint32_t instance; - -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - uint32_t ctrl = base->CTRL; - bool isSevenDataBits = (((ctrl & LPUART_CTRL_M7_MASK) != 0U) || - (((ctrl & LPUART_CTRL_M_MASK) == 0U) && ((ctrl & LPUART_CTRL_PE_MASK) != 0U))); -#endif - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(lpuart_handle_t)); - - /* Set the TX/RX state. */ - handle->rxState = (uint8_t)kLPUART_RxIdle; - handle->txState = (uint8_t)kLPUART_TxIdle; - - /* Set the callback and user data. */ - handle->callback = callback; - handle->userData = userData; - -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - /* Initial seven data bits flag */ - handle->isSevenDataBits = isSevenDataBits; -#endif - handle->is16bitData = false; - - /* Get instance from peripheral base address. */ - instance = LPUART_GetInstance(base); - - /* Save the handle in global variables to support the double weak mechanism. */ - s_lpuartHandle[instance] = handle; - - s_lpuartIsr[instance] = LPUART_TransferHandleIRQ; - -/* Enable interrupt in NVIC. */ -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ - (void)EnableIRQ(s_lpuartRxIRQ[instance]); - (void)EnableIRQ(s_lpuartTxIRQ[instance]); -#else - (void)EnableIRQ(s_lpuartIRQ[instance]); -#endif -} - -/*! - * brief Sets up the RX ring buffer. - * - * This function sets up the RX ring buffer to a specific UART handle. - * - * When the RX ring buffer is used, data received is stored into the ring buffer even when - * the user doesn't call the UART_TransferReceiveNonBlocking() API. If there is already data received - * in the ring buffer, the user can get the received data from the ring buffer directly. - * - * note When using RX ring buffer, one byte is reserved for internal use. In other - * words, if p ringBufferSize is 32, then only 31 bytes are used for saving data. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param ringBuffer Start address of ring buffer for background receiving. Pass NULL to disable the ring buffer. - * param ringBufferSize size of the ring buffer. - */ -void LPUART_TransferStartRingBuffer(LPUART_Type *base, - lpuart_handle_t *handle, - uint8_t *ringBuffer, - size_t ringBufferSize) -{ - assert(NULL != handle); - assert(NULL != ringBuffer); - - /* Setup the ring buffer address */ - handle->rxRingBuffer = ringBuffer; - if (!handle->is16bitData) - { - handle->rxRingBufferSize = ringBufferSize; - } - else - { - handle->rxRingBufferSize = ringBufferSize / 2U; - } - handle->rxRingBufferHead = 0U; - handle->rxRingBufferTail = 0U; - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. */ - uint32_t irqMask = DisableGlobalIRQ(); - /* Enable the interrupt to accept the data when user need the ring buffer. */ - base->CTRL |= (uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); -} - -/*! - * brief Aborts the background transfer and uninstalls the ring buffer. - * - * This function aborts the background transfer and uninstalls the ring buffer. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - */ -void LPUART_TransferStopRingBuffer(LPUART_Type *base, lpuart_handle_t *handle) -{ - assert(NULL != handle); - - if (handle->rxState == (uint8_t)kLPUART_RxIdle) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. - */ - uint32_t irqMask = DisableGlobalIRQ(); - base->CTRL &= ~(uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); - } - - handle->rxRingBuffer = NULL; - handle->rxRingBufferSize = 0U; - handle->rxRingBufferHead = 0U; - handle->rxRingBufferTail = 0U; -} - -/*! - * brief Transmits a buffer of data using the interrupt method. - * - * This function send data using an interrupt method. This is a non-blocking function, which - * returns directly without waiting for all data written to the transmitter register. When - * all data is written to the TX register in the ISR, the LPUART driver calls the callback - * function and passes the ref kStatus_LPUART_TxIdle as status parameter. - * - * note The kStatus_LPUART_TxIdle is passed to the upper layer when all data are written - * to the TX register. However, there is no check to ensure that all the data sent out. Before disabling the TX, - * check the kLPUART_TransmissionCompleteFlag to ensure that the transmit is finished. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param xfer LPUART transfer structure, see #lpuart_transfer_t. - * retval kStatus_Success Successfully start the data transmission. - * retval kStatus_LPUART_TxBusy Previous transmission still not finished, data not all written to the TX register. - * retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_TransferSendNonBlocking(LPUART_Type *base, lpuart_handle_t *handle, lpuart_transfer_t *xfer) -{ - assert(NULL != handle); - assert(NULL != xfer); - assert(NULL != xfer->txData); - assert(0U != xfer->dataSize); - - status_t status; - - /* Return error if current TX busy. */ - if ((uint8_t)kLPUART_TxBusy == handle->txState) - { - status = kStatus_LPUART_TxBusy; - } - else - { - if (!handle->is16bitData) - { - handle->txData = xfer->txData; - } - else - { - handle->txData16 = xfer->txData16; - } - handle->txDataSize = xfer->dataSize; - handle->txDataSizeAll = xfer->dataSize; - handle->txState = (uint8_t)kLPUART_TxBusy; - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. - */ - uint32_t irqMask = DisableGlobalIRQ(); - /* Enable transmitter interrupt. */ - base->CTRL |= (uint32_t)LPUART_CTRL_TIE_MASK; - EnableGlobalIRQ(irqMask); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Aborts the interrupt-driven data transmit. - * - * This function aborts the interrupt driven data sending. The user can get the remainBtyes to find out - * how many bytes are not sent out. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - */ -void LPUART_TransferAbortSend(LPUART_Type *base, lpuart_handle_t *handle) -{ - assert(NULL != handle); - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. */ - uint32_t irqMask = DisableGlobalIRQ(); - base->CTRL &= ~(uint32_t)(LPUART_CTRL_TIE_MASK | LPUART_CTRL_TCIE_MASK); - EnableGlobalIRQ(irqMask); - - handle->txDataSize = 0; - handle->txState = (uint8_t)kLPUART_TxIdle; -} - -/*! - * brief Gets the number of bytes that have been sent out to bus. - * - * This function gets the number of bytes that have been sent out to bus by an interrupt method. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param count Send bytes count. - * retval kStatus_NoTransferInProgress No send in progress. - * retval kStatus_InvalidArgument Parameter is invalid. - * retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetSendCount(LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count) -{ - assert(NULL != handle); - assert(NULL != count); - - status_t status = kStatus_Success; - size_t tmptxDataSize = handle->txDataSize; - - if ((uint8_t)kLPUART_TxIdle == handle->txState) - { - status = kStatus_NoTransferInProgress; - } - else - { -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - *count = handle->txDataSizeAll - tmptxDataSize - - ((base->WATER & LPUART_WATER_TXCOUNT_MASK) >> LPUART_WATER_TXCOUNT_SHIFT); -#else - if ((base->STAT & (uint32_t)kLPUART_TxDataRegEmptyFlag) != 0U) - { - *count = handle->txDataSizeAll - tmptxDataSize; - } - else - { - *count = handle->txDataSizeAll - tmptxDataSize - 1U; - } -#endif - } - - return status; -} - -/*! - * brief Receives a buffer of data using the interrupt method. - * - * This function receives data using an interrupt method. This is a non-blocking function - * which returns without waiting to ensure that all data are received. - * If the RX ring buffer is used and not empty, the data in the ring buffer is copied and - * the parameter p receivedBytes shows how many bytes are copied from the ring buffer. - * After copying, if the data in the ring buffer is not enough for read, the receive - * request is saved by the LPUART driver. When the new data arrives, the receive request - * is serviced first. When all data is received, the LPUART driver notifies the upper layer - * through a callback function and passes a status parameter ref kStatus_UART_RxIdle. - * For example, the upper layer needs 10 bytes but there are only 5 bytes in ring buffer. - * The 5 bytes are copied to xfer->data, which returns with the - * parameter p receivedBytes set to 5. For the remaining 5 bytes, the newly arrived data is - * saved from xfer->data[5]. When 5 bytes are received, the LPUART driver notifies the upper layer. - * If the RX ring buffer is not enabled, this function enables the RX and RX interrupt - * to receive data to xfer->data. When all data is received, the upper layer is notified. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param xfer LPUART transfer structure, see #uart_transfer_t. - * param receivedBytes Bytes received from the ring buffer directly. - * retval kStatus_Success Successfully queue the transfer into the transmit queue. - * retval kStatus_LPUART_RxBusy Previous receive request is not finished. - * retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_TransferReceiveNonBlocking(LPUART_Type *base, - lpuart_handle_t *handle, - lpuart_transfer_t *xfer, - size_t *receivedBytes) -{ - assert(NULL != handle); - assert(NULL != xfer); - assert(NULL != xfer->rxData); - assert(0U != xfer->dataSize); - - uint32_t i; - status_t status; - uint32_t irqMask; - /* How many bytes to copy from ring buffer to user memory. */ - size_t bytesToCopy = 0U; - /* How many bytes to receive. */ - size_t bytesToReceive; - /* How many bytes currently have received. */ - size_t bytesCurrentReceived; - - /* How to get data: - 1. If RX ring buffer is not enabled, then save xfer->data and xfer->dataSize - to lpuart handle, enable interrupt to store received data to xfer->data. When - all data received, trigger callback. - 2. If RX ring buffer is enabled and not empty, get data from ring buffer first. - If there are enough data in ring buffer, copy them to xfer->data and return. - If there are not enough data in ring buffer, copy all of them to xfer->data, - save the xfer->data remained empty space to lpuart handle, receive data - to this empty space and trigger callback when finished. */ - - if ((uint8_t)kLPUART_RxBusy == handle->rxState) - { - status = kStatus_LPUART_RxBusy; - } - else - { - bytesToReceive = xfer->dataSize; - bytesCurrentReceived = 0; - - /* If RX ring buffer is used. */ - if (NULL != handle->rxRingBuffer) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - /* Disable LPUART RX IRQ, protect ring buffer. */ - base->CTRL &= ~(uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); - - /* How many bytes in RX ring buffer currently. */ - bytesToCopy = LPUART_TransferGetRxRingBufferLength(base, handle); - - if (0U != bytesToCopy) - { - bytesToCopy = MIN(bytesToReceive, bytesToCopy); - - bytesToReceive -= bytesToCopy; - - /* Copy data from ring buffer to user memory. */ - for (i = 0U; i < bytesToCopy; i++) - { - if (!handle->is16bitData) - { - xfer->rxData[bytesCurrentReceived] = handle->rxRingBuffer[handle->rxRingBufferTail]; - } - else - { - xfer->rxData16[bytesCurrentReceived] = handle->rxRingBuffer16[handle->rxRingBufferTail]; - } - bytesCurrentReceived++; - - /* Wrap to 0. Not use modulo (%) because it might be large and slow. */ - if (((uint32_t)handle->rxRingBufferTail + 1U) == handle->rxRingBufferSize) - { - handle->rxRingBufferTail = 0U; - } - else - { - handle->rxRingBufferTail++; - } - } - } - - /* If ring buffer does not have enough data, still need to read more data. */ - if (0U != bytesToReceive) - { - /* No data in ring buffer, save the request to LPUART handle. */ - - if (!handle->is16bitData) - { - handle->rxData = &xfer->rxData[bytesCurrentReceived]; - } - else - { - handle->rxData16 = &xfer->rxData16[bytesCurrentReceived]; - } - handle->rxDataSize = bytesToReceive; - handle->rxDataSizeAll = xfer->dataSize; - handle->rxState = (uint8_t)kLPUART_RxBusy; - } - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - /* Re-enable LPUART RX IRQ. */ - base->CTRL |= (uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); - - /* Call user callback since all data are received. */ - if (0U == bytesToReceive) - { - if (NULL != handle->callback) - { - handle->callback(base, handle, kStatus_LPUART_RxIdle, handle->userData); - } - } - } - /* Ring buffer not used. */ - else - { - if (!handle->is16bitData) - { - handle->rxData = &xfer->rxData[bytesCurrentReceived]; - } - else - { - handle->rxData16 = &xfer->rxData16[bytesCurrentReceived]; - } - handle->rxDataSize = bytesToReceive; - handle->rxDataSizeAll = bytesToReceive; - handle->rxState = (uint8_t)kLPUART_RxBusy; - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - /* Enable RX interrupt. */ - base->CTRL |= (uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ILIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); - } - - /* Return the how many bytes have read. */ - if (NULL != receivedBytes) - { - *receivedBytes = bytesCurrentReceived; - } - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Aborts the interrupt-driven data receiving. - * - * This function aborts the interrupt-driven data receiving. The user can get the remainBytes to find out - * how many bytes not received yet. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - */ -void LPUART_TransferAbortReceive(LPUART_Type *base, lpuart_handle_t *handle) -{ - assert(NULL != handle); - - /* Only abort the receive to handle->rxData, the RX ring buffer is still working. */ - if (NULL == handle->rxRingBuffer) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. - */ - uint32_t irqMask = DisableGlobalIRQ(); - /* Disable RX interrupt. */ - base->CTRL &= ~(uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ILIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); - } - - handle->rxDataSize = 0U; - handle->rxState = (uint8_t)kLPUART_RxIdle; -} - -/*! - * brief Gets the number of bytes that have been received. - * - * This function gets the number of bytes that have been received. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param count Receive bytes count. - * retval kStatus_NoTransferInProgress No receive in progress. - * retval kStatus_InvalidArgument Parameter is invalid. - * retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetReceiveCount(LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count) -{ - assert(NULL != handle); - assert(NULL != count); - - status_t status = kStatus_Success; - size_t tmprxDataSize = handle->rxDataSize; - - if ((uint8_t)kLPUART_RxIdle == handle->rxState) - { - status = kStatus_NoTransferInProgress; - } - else - { - *count = handle->rxDataSizeAll - tmprxDataSize; - } - - return status; -} - -static void LPUART_TransferHandleIDLEReady(LPUART_Type *base, lpuart_handle_t *handle) -{ - uint32_t irqMask; -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - uint8_t count; - uint8_t tempCount; - count = ((uint8_t)((base->WATER & LPUART_WATER_RXCOUNT_MASK) >> LPUART_WATER_RXCOUNT_SHIFT)); - - while ((0U != handle->rxDataSize) && (0U != count)) - { - tempCount = (uint8_t)MIN(handle->rxDataSize, count); - /* Using non block API to read the data from the registers. */ - if (!handle->is16bitData) - { - LPUART_ReadNonBlocking(base, handle->rxData, tempCount); - handle->rxData = &handle->rxData[tempCount]; - } - else - { - LPUART_ReadNonBlocking16bit(base, handle->rxData16, tempCount); - handle->rxData16 = &handle->rxData16[tempCount]; - } - handle->rxDataSize -= tempCount; - count -= tempCount; - - /* If rxDataSize is 0, invoke rx idle callback.*/ - if (0U == (handle->rxDataSize)) - { - handle->rxState = (uint8_t)kLPUART_RxIdle; - - if (NULL != handle->callback) - { - handle->callback(base, handle, kStatus_LPUART_RxIdle, handle->userData); - } - } - } -#endif - /* Clear IDLE flag.*/ - base->STAT = ((base->STAT & 0x3FE00000U) | LPUART_STAT_IDLE_MASK); - - /* If rxDataSize is 0, disable rx ready, overrun and idle line interrupt.*/ - if (0U == handle->rxDataSize) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - base->CTRL &= ~(uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ILIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); - } - /* Invoke callback if callback is not NULL and rxDataSize is not 0. */ - else if (NULL != handle->callback) - { - handle->callback(base, handle, kStatus_LPUART_IdleLineDetected, handle->userData); - } - else - { - /* Avoid MISRA 15.7 */ - } -} - -static void LPUART_TransferHandleReceiveDataFull(LPUART_Type *base, lpuart_handle_t *handle) -{ - uint8_t count; - uint8_t tempCount; - uint16_t tpmRxRingBufferHead; - uint32_t tpmData; - uint32_t irqMask; - - /* Get the size that can be stored into buffer for this interrupt. */ -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - count = ((uint8_t)((base->WATER & LPUART_WATER_RXCOUNT_MASK) >> LPUART_WATER_RXCOUNT_SHIFT)); -#else - count = 1; -#endif - - /* If handle->rxDataSize is not 0, first save data to handle->rxData. */ - while ((0U != handle->rxDataSize) && (0U != count)) - { -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - tempCount = (uint8_t)MIN(handle->rxDataSize, count); -#else - tempCount = 1; -#endif - - /* Using non block API to read the data from the registers. */ - if (!handle->is16bitData) - { - LPUART_ReadNonBlocking(base, handle->rxData, tempCount); - handle->rxData = &handle->rxData[tempCount]; - } - else - { - LPUART_ReadNonBlocking16bit(base, handle->rxData16, tempCount); - handle->rxData16 = &handle->rxData16[tempCount]; - } - handle->rxDataSize -= tempCount; - count -= tempCount; - - /* If all the data required for upper layer is ready, trigger callback. */ - if (0U == handle->rxDataSize) - { - handle->rxState = (uint8_t)kLPUART_RxIdle; - - if (NULL != handle->callback) - { - handle->callback(base, handle, kStatus_LPUART_RxIdle, handle->userData); - } - } - } - - /* If use RX ring buffer, receive data to ring buffer. */ - if (NULL != handle->rxRingBuffer) - { - while (0U != count--) - { - /* If RX ring buffer is full, trigger callback to notify over run. */ - if (LPUART_TransferIsRxRingBufferFull(base, handle)) - { - if (NULL != handle->callback) - { - handle->callback(base, handle, kStatus_LPUART_RxRingBufferOverrun, handle->userData); - } - } - - /* If ring buffer is still full after callback function, the oldest data is overridden. */ - if (LPUART_TransferIsRxRingBufferFull(base, handle)) - { - /* Increase handle->rxRingBufferTail to make room for new data. */ - if (((uint32_t)handle->rxRingBufferTail + 1U) == handle->rxRingBufferSize) - { - handle->rxRingBufferTail = 0U; - } - else - { - handle->rxRingBufferTail++; - } - } - - /* Read data. */ - tpmRxRingBufferHead = handle->rxRingBufferHead; - tpmData = base->DATA; -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - if (handle->isSevenDataBits) - { - handle->rxRingBuffer[tpmRxRingBufferHead] = (uint8_t)(tpmData & 0x7FU); - } - else - { - if (!handle->is16bitData) - { - handle->rxRingBuffer[tpmRxRingBufferHead] = (uint8_t)tpmData; - } - else - { - handle->rxRingBuffer16[tpmRxRingBufferHead] = (uint16_t)(tpmData & 0x3FFU); - } - } -#else - if (!handle->is16bitData) - { - handle->rxRingBuffer[tpmRxRingBufferHead] = (uint8_t)tpmData; - } - else - { - handle->rxRingBuffer16[tpmRxRingBufferHead] = (uint16_t)(tpmData & 0x3FFU); - } -#endif - - /* Increase handle->rxRingBufferHead. */ - if (((uint32_t)handle->rxRingBufferHead + 1U) == handle->rxRingBufferSize) - { - handle->rxRingBufferHead = 0U; - } - else - { - handle->rxRingBufferHead++; - } - } - } - /* If no receive requst pending, stop RX interrupt. */ - else if (0U == handle->rxDataSize) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - base->CTRL &= ~(uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ORIE_MASK | LPUART_CTRL_ILIE_MASK); - EnableGlobalIRQ(irqMask); - } - else - { - /* Avoid MISRA C-2012 15.7 voiation */ - return; - } -} - -static void LPUART_TransferHandleSendDataEmpty(LPUART_Type *base, lpuart_handle_t *handle) -{ - uint8_t count; - uint8_t tempCount; - uint32_t irqMask; -/* Get the bytes that available at this moment. */ -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - count = (uint8_t)FSL_FEATURE_LPUART_FIFO_SIZEn(base) - - (uint8_t)((base->WATER & LPUART_WATER_TXCOUNT_MASK) >> LPUART_WATER_TXCOUNT_SHIFT); -#else - count = 1; -#endif - - while ((0U != handle->txDataSize) && (0U != count)) - { -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - tempCount = (uint8_t)MIN(handle->txDataSize, count); -#else - tempCount = 1; -#endif - - /* Using non block API to write the data to the registers. */ - if (!handle->is16bitData) - { - LPUART_WriteNonBlocking(base, handle->txData, tempCount); - handle->txData = &handle->txData[tempCount]; - } - else - { - LPUART_WriteNonBlocking16bit(base, handle->txData16, tempCount); - handle->txData16 = &handle->txData16[tempCount]; - } - handle->txDataSize -= tempCount; - count -= tempCount; - - /* If all the data are written to data register, notify user with the callback, then TX finished. */ - if (0U == handle->txDataSize) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - /* Disable TX register empty interrupt and enable transmission completion interrupt. */ - base->CTRL = (base->CTRL & ~LPUART_CTRL_TIE_MASK) | LPUART_CTRL_TCIE_MASK; - EnableGlobalIRQ(irqMask); - } - } -} - -static void LPUART_TransferHandleTransmissionComplete(LPUART_Type *base, lpuart_handle_t *handle) -{ - uint32_t irqMask; - /* Set txState to idle only when all data has been sent out to bus. */ - handle->txState = (uint8_t)kLPUART_TxIdle; - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. - */ - irqMask = DisableGlobalIRQ(); - /* Disable transmission complete interrupt. */ - base->CTRL &= ~(uint32_t)LPUART_CTRL_TCIE_MASK; - EnableGlobalIRQ(irqMask); - - /* Trigger callback. */ - if (NULL != handle->callback) - { - handle->callback(base, handle, kStatus_LPUART_TxIdle, handle->userData); - } -} - -/*! - * brief LPUART IRQ handle function. - * - * This function handles the LPUART transmit and receive IRQ request. - * - * param base LPUART peripheral base address. - * param irqHandle LPUART handle pointer. - */ -void LPUART_TransferHandleIRQ(LPUART_Type *base, void *irqHandle) -{ - assert(NULL != irqHandle); - - uint32_t status = LPUART_GetStatusFlags(base); - uint32_t enabledInterrupts = LPUART_GetEnabledInterrupts(base); - - lpuart_handle_t *handle = (lpuart_handle_t *)irqHandle; - - /* If RX overrun. */ - if ((uint32_t)kLPUART_RxOverrunFlag == ((uint32_t)kLPUART_RxOverrunFlag & status)) - { - /* Clear overrun flag, otherwise the RX does not work. */ - base->STAT = ((base->STAT & 0x3FE00000U) | LPUART_STAT_OR_MASK); - - /* Trigger callback. */ - if (NULL != (handle->callback)) - { - handle->callback(base, handle, kStatus_LPUART_RxHardwareOverrun, handle->userData); - } - } - - /* If IDLE flag is set and the IDLE interrupt is enabled. */ - if ((0U != ((uint32_t)kLPUART_IdleLineFlag & status)) && - (0U != ((uint32_t)kLPUART_IdleLineInterruptEnable & enabledInterrupts))) - { - LPUART_TransferHandleIDLEReady(base, handle); - } - /* Receive data register full */ - if ((0U != ((uint32_t)kLPUART_RxDataRegFullFlag & status)) && - (0U != ((uint32_t)kLPUART_RxDataRegFullInterruptEnable & enabledInterrupts))) - { - LPUART_TransferHandleReceiveDataFull(base, handle); - } - - /* Send data register empty and the interrupt is enabled. */ - if ((0U != ((uint32_t)kLPUART_TxDataRegEmptyFlag & status)) && - (0U != ((uint32_t)kLPUART_TxDataRegEmptyInterruptEnable & enabledInterrupts))) - { - LPUART_TransferHandleSendDataEmpty(base, handle); - } - - /* Transmission complete and the interrupt is enabled. */ - if ((0U != ((uint32_t)kLPUART_TransmissionCompleteFlag & status)) && - (0U != ((uint32_t)kLPUART_TransmissionCompleteInterruptEnable & enabledInterrupts))) - { - LPUART_TransferHandleTransmissionComplete(base, handle); - } -} - -/*! - * brief LPUART Error IRQ handle function. - * - * This function handles the LPUART error IRQ request. - * - * param base LPUART peripheral base address. - * param irqHandle LPUART handle pointer. - */ -void LPUART_TransferHandleErrorIRQ(LPUART_Type *base, void *irqHandle) -{ - /* To be implemented by User. */ -} -#if defined(FSL_FEATURE_LPUART_HAS_SHARED_IRQ0_IRQ1) && FSL_FEATURE_LPUART_HAS_SHARED_IRQ0_IRQ1 -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART0_LPUART1_RX_DriverIRQHandler(void); -void LPUART0_LPUART1_RX_DriverIRQHandler(void) -{ - /* If handle is registered, treat the transfer function is enabled. */ - if (NULL != s_lpuartHandle[0]) - { - s_lpuartIsr[0](LPUART0, s_lpuartHandle[0]); - } - if (NULL != s_lpuartHandle[1]) - { - s_lpuartIsr[1](LPUART1, s_lpuartHandle[1]); - } - SDK_ISR_EXIT_BARRIER; -} -void LPUART0_LPUART1_TX_DriverIRQHandler(void); -void LPUART0_LPUART1_TX_DriverIRQHandler(void) -{ - /* If handle is registered, treat the transfer function is enabled. */ - if (NULL != s_lpuartHandle[0]) - { - s_lpuartIsr[0](LPUART0, s_lpuartHandle[0]); - } - if (NULL != s_lpuartHandle[1]) - { - s_lpuartIsr[1](LPUART1, s_lpuartHandle[1]); - } - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART0_LPUART1_DriverIRQHandler(void); -void LPUART0_LPUART1_DriverIRQHandler(void) -{ - /* If handle is registered, treat the transfer function is enabled. */ - if (NULL != s_lpuartHandle[0]) - { - s_lpuartIsr[0](LPUART0, s_lpuartHandle[0]); - } - if (NULL != s_lpuartHandle[1]) - { - s_lpuartIsr[1](LPUART1, s_lpuartHandle[1]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART0) -#if !(defined(FSL_FEATURE_LPUART_HAS_SHARED_IRQ0_IRQ1) && FSL_FEATURE_LPUART_HAS_SHARED_IRQ0_IRQ1) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART0_TX_DriverIRQHandler(void); -void LPUART0_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[0](LPUART0, s_lpuartHandle[0]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART0_RX_DriverIRQHandler(void); -void LPUART0_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[0](LPUART0, s_lpuartHandle[0]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART0_DriverIRQHandler(void); -void LPUART0_DriverIRQHandler(void) -{ - s_lpuartIsr[0](LPUART0, s_lpuartHandle[0]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif -#endif - -#if defined(LPUART1) -#if !(defined(FSL_FEATURE_LPUART_HAS_SHARED_IRQ0_IRQ1) && FSL_FEATURE_LPUART_HAS_SHARED_IRQ0_IRQ1) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART1_TX_DriverIRQHandler(void); -void LPUART1_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[1](LPUART1, s_lpuartHandle[1]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART1_RX_DriverIRQHandler(void); -void LPUART1_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[1](LPUART1, s_lpuartHandle[1]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART1_DriverIRQHandler(void); -void LPUART1_DriverIRQHandler(void) -{ - s_lpuartIsr[1](LPUART1, s_lpuartHandle[1]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif -#endif - -#if defined(LPUART2) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART2_TX_DriverIRQHandler(void); -void LPUART2_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[2](LPUART2, s_lpuartHandle[2]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART2_RX_DriverIRQHandler(void); -void LPUART2_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[2](LPUART2, s_lpuartHandle[2]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART2_DriverIRQHandler(void); -void LPUART2_DriverIRQHandler(void) -{ - s_lpuartIsr[2](LPUART2, s_lpuartHandle[2]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART3) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART3_TX_DriverIRQHandler(void); -void LPUART3_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[3](LPUART3, s_lpuartHandle[3]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART3_RX_DriverIRQHandler(void); -void LPUART3_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[3](LPUART3, s_lpuartHandle[3]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART3_DriverIRQHandler(void); -void LPUART3_DriverIRQHandler(void) -{ - s_lpuartIsr[3](LPUART3, s_lpuartHandle[3]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART4) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART4_TX_DriverIRQHandler(void); -void LPUART4_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[4](LPUART4, s_lpuartHandle[4]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART4_RX_DriverIRQHandler(void); -void LPUART4_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[4](LPUART4, s_lpuartHandle[4]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART4_DriverIRQHandler(void); -void LPUART4_DriverIRQHandler(void) -{ - s_lpuartIsr[4](LPUART4, s_lpuartHandle[4]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART5) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART5_TX_DriverIRQHandler(void); -void LPUART5_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[5](LPUART5, s_lpuartHandle[5]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART5_RX_DriverIRQHandler(void); -void LPUART5_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[5](LPUART5, s_lpuartHandle[5]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART5_DriverIRQHandler(void); -void LPUART5_DriverIRQHandler(void) -{ - s_lpuartIsr[5](LPUART5, s_lpuartHandle[5]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART6) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART6_TX_DriverIRQHandler(void); -void LPUART6_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[6](LPUART6, s_lpuartHandle[6]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART6_RX_DriverIRQHandler(void); -void LPUART6_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[6](LPUART6, s_lpuartHandle[6]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART6_DriverIRQHandler(void); -void LPUART6_DriverIRQHandler(void) -{ - s_lpuartIsr[6](LPUART6, s_lpuartHandle[6]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART7) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART7_TX_DriverIRQHandler(void); -void LPUART7_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[7](LPUART7, s_lpuartHandle[7]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART7_RX_DriverIRQHandler(void); -void LPUART7_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[7](LPUART7, s_lpuartHandle[7]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART7_DriverIRQHandler(void); -void LPUART7_DriverIRQHandler(void) -{ - s_lpuartIsr[7](LPUART7, s_lpuartHandle[7]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART8) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART8_TX_DriverIRQHandler(void); -void LPUART8_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[8](LPUART8, s_lpuartHandle[8]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART8_RX_DriverIRQHandler(void); -void LPUART8_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[8](LPUART8, s_lpuartHandle[8]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART8_DriverIRQHandler(void); -void LPUART8_DriverIRQHandler(void) -{ - s_lpuartIsr[8](LPUART8, s_lpuartHandle[8]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART9) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART9_TX_DriverIRQHandler(void); -void LPUART9_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[9](LPUART9, s_lpuartHandle[9]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART9_RX_DriverIRQHandler(void); -void LPUART9_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[9](LPUART9, s_lpuartHandle[9]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART9_DriverIRQHandler(void); -void LPUART9_DriverIRQHandler(void) -{ - s_lpuartIsr[9](LPUART9, s_lpuartHandle[9]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART10) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART10_TX_DriverIRQHandler(void); -void LPUART10_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[10](LPUART10, s_lpuartHandle[10]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART10_RX_DriverIRQHandler(void); -void LPUART10_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[10](LPUART10, s_lpuartHandle[10]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART10_DriverIRQHandler(void); -void LPUART10_DriverIRQHandler(void) -{ - s_lpuartIsr[10](LPUART10, s_lpuartHandle[10]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART11) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART11_TX_DriverIRQHandler(void); -void LPUART11_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[11](LPUART11, s_lpuartHandle[11]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART11_RX_DriverIRQHandler(void); -void LPUART11_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[11](LPUART11, s_lpuartHandle[11]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART11_DriverIRQHandler(void); -void LPUART11_DriverIRQHandler(void) -{ - s_lpuartIsr[11](LPUART11, s_lpuartHandle[11]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART12) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART12_TX_DriverIRQHandler(void); -void LPUART12_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[12](LPUART12, s_lpuartHandle[12]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART12_RX_DriverIRQHandler(void); -void LPUART12_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[12](LPUART12, s_lpuartHandle[12]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART12_DriverIRQHandler(void); -void LPUART12_DriverIRQHandler(void) -{ - s_lpuartIsr[12](LPUART12, s_lpuartHandle[12]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(CM4_0__LPUART) -void M4_0_LPUART_DriverIRQHandler(void); -void M4_0_LPUART_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(CM4_0__LPUART)](CM4_0__LPUART, s_lpuartHandle[LPUART_GetInstance(CM4_0__LPUART)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CM4_1__LPUART) -void M4_1_LPUART_DriverIRQHandler(void); -void M4_1_LPUART_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(CM4_1__LPUART)](CM4_1__LPUART, s_lpuartHandle[LPUART_GetInstance(CM4_1__LPUART)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CM4__LPUART) -void M4_LPUART_DriverIRQHandler(void); -void M4_LPUART_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(CM4__LPUART)](CM4__LPUART, s_lpuartHandle[LPUART_GetInstance(CM4__LPUART)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(DMA__LPUART0) -void DMA_UART0_INT_DriverIRQHandler(void); -void DMA_UART0_INT_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(DMA__LPUART0)](DMA__LPUART0, s_lpuartHandle[LPUART_GetInstance(DMA__LPUART0)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(DMA__LPUART1) -void DMA_UART1_INT_DriverIRQHandler(void); -void DMA_UART1_INT_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(DMA__LPUART1)](DMA__LPUART1, s_lpuartHandle[LPUART_GetInstance(DMA__LPUART1)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(DMA__LPUART2) -void DMA_UART2_INT_DriverIRQHandler(void); -void DMA_UART2_INT_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(DMA__LPUART2)](DMA__LPUART2, s_lpuartHandle[LPUART_GetInstance(DMA__LPUART2)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(DMA__LPUART3) -void DMA_UART3_INT_DriverIRQHandler(void); -void DMA_UART3_INT_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(DMA__LPUART3)](DMA__LPUART3, s_lpuartHandle[LPUART_GetInstance(DMA__LPUART3)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(DMA__LPUART4) -void DMA_UART4_INT_DriverIRQHandler(void); -void DMA_UART4_INT_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(DMA__LPUART4)](DMA__LPUART4, s_lpuartHandle[LPUART_GetInstance(DMA__LPUART4)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(ADMA__LPUART0) -void ADMA_UART0_INT_DriverIRQHandler(void); -void ADMA_UART0_INT_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(ADMA__LPUART0)](ADMA__LPUART0, s_lpuartHandle[LPUART_GetInstance(ADMA__LPUART0)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(ADMA__LPUART1) -void ADMA_UART1_INT_DriverIRQHandler(void); -void ADMA_UART1_INT_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(ADMA__LPUART1)](ADMA__LPUART1, s_lpuartHandle[LPUART_GetInstance(ADMA__LPUART1)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(ADMA__LPUART2) -void ADMA_UART2_INT_DriverIRQHandler(void); -void ADMA_UART2_INT_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(ADMA__LPUART2)](ADMA__LPUART2, s_lpuartHandle[LPUART_GetInstance(ADMA__LPUART2)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(ADMA__LPUART3) -void ADMA_UART3_INT_DriverIRQHandler(void); -void ADMA_UART3_INT_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(ADMA__LPUART3)](ADMA__LPUART3, s_lpuartHandle[LPUART_GetInstance(ADMA__LPUART3)]); - SDK_ISR_EXIT_BARRIER; -} -#endif diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpuart.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpuart.h deleted file mode 100644 index 13ea2365f63..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpuart.h +++ /dev/null @@ -1,1128 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LPUART_H_ -#define FSL_LPUART_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup lpuart_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief LPUART driver version. */ -#define FSL_LPUART_DRIVER_VERSION (MAKE_VERSION(2, 8, 2)) -/*! @} */ - -/*! @brief Retry times for waiting flag. */ -#ifndef UART_RETRY_TIMES -#define UART_RETRY_TIMES 0U /* Defining to zero means to keep waiting for the flag until it is assert/deassert. */ -#endif - -/*! @brief Error codes for the LPUART driver. */ -enum -{ - kStatus_LPUART_TxBusy = MAKE_STATUS(kStatusGroup_LPUART, 0), /*!< TX busy */ - kStatus_LPUART_RxBusy = MAKE_STATUS(kStatusGroup_LPUART, 1), /*!< RX busy */ - kStatus_LPUART_TxIdle = MAKE_STATUS(kStatusGroup_LPUART, 2), /*!< LPUART transmitter is idle. */ - kStatus_LPUART_RxIdle = MAKE_STATUS(kStatusGroup_LPUART, 3), /*!< LPUART receiver is idle. */ - kStatus_LPUART_TxWatermarkTooLarge = MAKE_STATUS(kStatusGroup_LPUART, 4), /*!< TX FIFO watermark too large */ - kStatus_LPUART_RxWatermarkTooLarge = MAKE_STATUS(kStatusGroup_LPUART, 5), /*!< RX FIFO watermark too large */ - kStatus_LPUART_FlagCannotClearManually = MAKE_STATUS(kStatusGroup_LPUART, 6), /*!< Some flag can't manually clear */ - kStatus_LPUART_Error = MAKE_STATUS(kStatusGroup_LPUART, 7), /*!< Error happens on LPUART. */ - kStatus_LPUART_RxRingBufferOverrun = - MAKE_STATUS(kStatusGroup_LPUART, 8), /*!< LPUART RX software ring buffer overrun. */ - kStatus_LPUART_RxHardwareOverrun = MAKE_STATUS(kStatusGroup_LPUART, 9), /*!< LPUART RX receiver overrun. */ - kStatus_LPUART_NoiseError = MAKE_STATUS(kStatusGroup_LPUART, 10), /*!< LPUART noise error. */ - kStatus_LPUART_FramingError = MAKE_STATUS(kStatusGroup_LPUART, 11), /*!< LPUART framing error. */ - kStatus_LPUART_ParityError = MAKE_STATUS(kStatusGroup_LPUART, 12), /*!< LPUART parity error. */ - kStatus_LPUART_BaudrateNotSupport = - MAKE_STATUS(kStatusGroup_LPUART, 13), /*!< Baudrate is not support in current clock source */ - kStatus_LPUART_IdleLineDetected = MAKE_STATUS(kStatusGroup_LPUART, 14), /*!< IDLE flag. */ - kStatus_LPUART_Timeout = MAKE_STATUS(kStatusGroup_LPUART, 15), /*!< LPUART times out. */ -}; - -/*! @brief LPUART parity mode. */ -typedef enum _lpuart_parity_mode -{ - kLPUART_ParityDisabled = 0x0U, /*!< Parity disabled */ - kLPUART_ParityEven = 0x2U, /*!< Parity enabled, type even, bit setting: PE|PT = 10 */ - kLPUART_ParityOdd = 0x3U, /*!< Parity enabled, type odd, bit setting: PE|PT = 11 */ -} lpuart_parity_mode_t; - -/*! @brief LPUART data bits count. */ -typedef enum _lpuart_data_bits -{ - kLPUART_EightDataBits = 0x0U, /*!< Eight data bit */ -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - kLPUART_SevenDataBits = 0x1U, /*!< Seven data bit */ -#endif -} lpuart_data_bits_t; - -/*! @brief LPUART stop bit count. */ -typedef enum _lpuart_stop_bit_count -{ - kLPUART_OneStopBit = 0U, /*!< One stop bit */ - kLPUART_TwoStopBit = 1U, /*!< Two stop bits */ -} lpuart_stop_bit_count_t; - -#if defined(FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT) && FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT -/*! @brief LPUART transmit CTS source. */ -typedef enum _lpuart_transmit_cts_source -{ - kLPUART_CtsSourcePin = 0U, /*!< CTS resource is the LPUART_CTS pin. */ - kLPUART_CtsSourceMatchResult = 1U, /*!< CTS resource is the match result. */ -} lpuart_transmit_cts_source_t; - -/*! @brief LPUART transmit CTS configure. */ -typedef enum _lpuart_transmit_cts_config -{ - kLPUART_CtsSampleAtStart = 0U, /*!< CTS input is sampled at the start of each character. */ - kLPUART_CtsSampleAtIdle = 1U, /*!< CTS input is sampled when the transmitter is idle */ -} lpuart_transmit_cts_config_t; -#endif - -/*! @brief LPUART idle flag type defines when the receiver starts counting. */ -typedef enum _lpuart_idle_type_select -{ - kLPUART_IdleTypeStartBit = 0U, /*!< Start counting after a valid start bit. */ - kLPUART_IdleTypeStopBit = 1U, /*!< Start counting after a stop bit. */ -} lpuart_idle_type_select_t; - -/*! @brief LPUART idle detected configuration. - * This structure defines the number of idle characters that must be received before - * the IDLE flag is set. - */ -typedef enum _lpuart_idle_config -{ - kLPUART_IdleCharacter1 = 0U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter2 = 1U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter4 = 2U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter8 = 3U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter16 = 4U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter32 = 5U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter64 = 6U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter128 = 7U, /*!< the number of idle characters. */ -} lpuart_idle_config_t; - -/*! - * @brief LPUART interrupt configuration structure, default settings all disabled. - * - * This structure contains the settings for all LPUART interrupt configurations. - */ -enum _lpuart_interrupt_enable -{ -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - kLPUART_LinBreakInterruptEnable = (LPUART_BAUD_LBKDIE_MASK >> 8U), /*!< LIN break detect. bit 7 */ -#endif - kLPUART_RxActiveEdgeInterruptEnable = (LPUART_BAUD_RXEDGIE_MASK >> 8U), /*!< Receive Active Edge. bit 6 */ - kLPUART_TxDataRegEmptyInterruptEnable = (LPUART_CTRL_TIE_MASK), /*!< Transmit data register empty. bit 23 */ - kLPUART_TransmissionCompleteInterruptEnable = (LPUART_CTRL_TCIE_MASK), /*!< Transmission complete. bit 22 */ - kLPUART_RxDataRegFullInterruptEnable = (LPUART_CTRL_RIE_MASK), /*!< Receiver data register full. bit 21 */ - kLPUART_IdleLineInterruptEnable = (LPUART_CTRL_ILIE_MASK), /*!< Idle line. bit 20 */ - kLPUART_RxOverrunInterruptEnable = (LPUART_CTRL_ORIE_MASK), /*!< Receiver Overrun. bit 27 */ - kLPUART_NoiseErrorInterruptEnable = (LPUART_CTRL_NEIE_MASK), /*!< Noise error flag. bit 26 */ - kLPUART_FramingErrorInterruptEnable = (LPUART_CTRL_FEIE_MASK), /*!< Framing error flag. bit 25 */ - kLPUART_ParityErrorInterruptEnable = (LPUART_CTRL_PEIE_MASK), /*!< Parity error flag. bit 24 */ -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - kLPUART_Match1InterruptEnable = (LPUART_CTRL_MA1IE_MASK), /*!< Parity error flag. bit 15 */ - kLPUART_Match2InterruptEnable = (LPUART_CTRL_MA2IE_MASK), /*!< Parity error flag. bit 14 */ -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - kLPUART_TxFifoOverflowInterruptEnable = (LPUART_FIFO_TXOFE_MASK), /*!< Transmit FIFO Overflow. bit 9 */ - kLPUART_RxFifoUnderflowInterruptEnable = (LPUART_FIFO_RXUFE_MASK), /*!< Receive FIFO Underflow. bit 8 */ -#endif - - kLPUART_AllInterruptEnable = kLPUART_RxActiveEdgeInterruptEnable | kLPUART_TxDataRegEmptyInterruptEnable | - kLPUART_TransmissionCompleteInterruptEnable | kLPUART_RxDataRegFullInterruptEnable | - kLPUART_IdleLineInterruptEnable | kLPUART_RxOverrunInterruptEnable | - kLPUART_NoiseErrorInterruptEnable | kLPUART_FramingErrorInterruptEnable | - kLPUART_ParityErrorInterruptEnable -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - | kLPUART_LinBreakInterruptEnable -#endif -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - | kLPUART_Match1InterruptEnable | kLPUART_Match2InterruptEnable -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - | kLPUART_TxFifoOverflowInterruptEnable | kLPUART_RxFifoUnderflowInterruptEnable -#endif - , -}; - -/*! - * @brief LPUART status flags. - * - * This provides constants for the LPUART status flags for use in the LPUART functions. - */ -enum _lpuart_flags -{ - kLPUART_TxDataRegEmptyFlag = - (LPUART_STAT_TDRE_MASK), /*!< Transmit data register empty flag, sets when transmit buffer is empty. bit 23 */ - kLPUART_TransmissionCompleteFlag = - (LPUART_STAT_TC_MASK), /*!< Transmission complete flag, sets when transmission activity complete. bit 22 */ - kLPUART_RxDataRegFullFlag = (LPUART_STAT_RDRF_MASK), /*!< Receive data register full flag, sets when the receive - data buffer is full. bit 21 */ - kLPUART_IdleLineFlag = (LPUART_STAT_IDLE_MASK), /*!< Idle line detect flag, sets when idle line detected. bit 20 */ - kLPUART_RxOverrunFlag = (LPUART_STAT_OR_MASK), /*!< Receive Overrun, sets when new data is received before data is - read from receive register. bit 19 */ - kLPUART_NoiseErrorFlag = (LPUART_STAT_NF_MASK), /*!< Receive takes 3 samples of each received bit. If any of these - samples differ, noise flag sets. bit 18 */ - kLPUART_FramingErrorFlag = - (LPUART_STAT_FE_MASK), /*!< Frame error flag, sets if logic 0 was detected where stop bit expected. bit 17 */ - kLPUART_ParityErrorFlag = (LPUART_STAT_PF_MASK), /*!< If parity enabled, sets upon parity error detection. bit 16 */ -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - kLPUART_LinBreakFlag = (LPUART_STAT_LBKDIF_MASK), /*!< LIN break detect interrupt flag, sets when LIN break - char detected and LIN circuit enabled. bit 31 */ -#endif - kLPUART_RxActiveEdgeFlag = (LPUART_STAT_RXEDGIF_MASK), /*!< Receive pin active edge interrupt flag, sets when active - edge detected. bit 30 */ - kLPUART_RxActiveFlag = - (LPUART_STAT_RAF_MASK), /*!< Receiver Active Flag (RAF), sets at beginning of valid start. bit 24 */ -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - kLPUART_DataMatch1Flag = - LPUART_STAT_MA1F_MASK, /*!< The next character to be read from LPUART_DATA matches MA1. bit 15 */ - kLPUART_DataMatch2Flag = - LPUART_STAT_MA2F_MASK, /*!< The next character to be read from LPUART_DATA matches MA2. bit 14 */ -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - kLPUART_TxFifoEmptyFlag = - (LPUART_FIFO_TXEMPT_MASK >> 16), /*!< TXEMPT bit, sets if transmit buffer is empty. bit 7 */ - kLPUART_RxFifoEmptyFlag = - (LPUART_FIFO_RXEMPT_MASK >> 16), /*!< RXEMPT bit, sets if receive buffer is empty. bit 6 */ - kLPUART_TxFifoOverflowFlag = - (LPUART_FIFO_TXOF_MASK >> 16), /*!< TXOF bit, sets if transmit buffer overflow occurred. bit 1 */ - kLPUART_RxFifoUnderflowFlag = - (LPUART_FIFO_RXUF_MASK >> 16), /*!< RXUF bit, sets if receive buffer underflow occurred. bit 0 */ -#endif - - kLPUART_AllClearFlags = kLPUART_RxActiveEdgeFlag | kLPUART_IdleLineFlag | kLPUART_RxOverrunFlag | - kLPUART_NoiseErrorFlag | kLPUART_FramingErrorFlag | kLPUART_ParityErrorFlag -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - | kLPUART_DataMatch1Flag | kLPUART_DataMatch2Flag -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - | kLPUART_TxFifoOverflowFlag | kLPUART_RxFifoUnderflowFlag -#endif -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - | kLPUART_LinBreakFlag -#endif - , - - kLPUART_AllFlags = - kLPUART_RxActiveEdgeFlag | kLPUART_IdleLineFlag | kLPUART_RxOverrunFlag | kLPUART_TxDataRegEmptyFlag | - kLPUART_TransmissionCompleteFlag | kLPUART_RxDataRegFullFlag | kLPUART_RxActiveFlag | kLPUART_NoiseErrorFlag | - kLPUART_FramingErrorFlag | kLPUART_ParityErrorFlag -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - | kLPUART_DataMatch1Flag | kLPUART_DataMatch2Flag -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - | kLPUART_TxFifoOverflowFlag | kLPUART_RxFifoUnderflowFlag | kLPUART_TxFifoEmptyFlag | kLPUART_RxFifoEmptyFlag -#endif -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - | kLPUART_LinBreakFlag -#endif - , -}; - -/*! @brief LPUART configuration structure. */ -typedef struct _lpuart_config -{ - uint32_t baudRate_Bps; /*!< LPUART baud rate */ - lpuart_parity_mode_t parityMode; /*!< Parity mode, disabled (default), even, odd */ - lpuart_data_bits_t dataBitsCount; /*!< Data bits count, eight (default), seven */ - bool isMsb; /*!< Data bits order, LSB (default), MSB */ -#if defined(FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT) && FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT - lpuart_stop_bit_count_t stopBitCount; /*!< Number of stop bits, 1 stop bit (default) or 2 stop bits */ -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - uint8_t txFifoWatermark; /*!< TX FIFO watermark */ - uint8_t rxFifoWatermark; /*!< RX FIFO watermark */ -#endif -#if defined(FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT) && FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT - bool enableRxRTS; /*!< RX RTS enable */ - bool enableTxCTS; /*!< TX CTS enable */ - lpuart_transmit_cts_source_t txCtsSource; /*!< TX CTS source */ - lpuart_transmit_cts_config_t txCtsConfig; /*!< TX CTS configure */ -#endif - lpuart_idle_type_select_t rxIdleType; /*!< RX IDLE type. */ - lpuart_idle_config_t rxIdleConfig; /*!< RX IDLE configuration. */ - bool enableTx; /*!< Enable TX */ - bool enableRx; /*!< Enable RX */ -} lpuart_config_t; - -/*! @brief LPUART transfer structure. */ -typedef struct _lpuart_transfer -{ - /* - * Use separate TX and RX data pointer, because TX data is const data. - * The member data is kept for backward compatibility. - */ - union - { - uint8_t *data; /*!< The buffer of data to be transfer.*/ - uint8_t *rxData; /*!< The buffer to receive data. */ - uint16_t *rxData16; /*!< The buffer to receive data. */ - const uint8_t *txData; /*!< The buffer of data to be sent. */ - const uint16_t *txData16; /*!< The buffer of data to be sent. */ - }; - size_t dataSize; /*!< The byte count to be transfer. */ -} lpuart_transfer_t; - -/* Forward declaration of the handle typedef. */ -typedef struct _lpuart_handle lpuart_handle_t; - -/*! @brief LPUART transfer callback function. */ -typedef void (*lpuart_transfer_callback_t)(LPUART_Type *base, lpuart_handle_t *handle, status_t status, void *userData); - -/*! @brief LPUART handle structure. */ -struct _lpuart_handle -{ - union - { - const uint8_t *volatile txData; /*!< Address of remaining data to send. */ - const uint16_t *volatile txData16; /*!< Address of remaining data to send. */ - }; - volatile size_t txDataSize; /*!< Size of the remaining data to send. */ - size_t txDataSizeAll; /*!< Size of the data to send out. */ - union - { - uint8_t *volatile rxData; /*!< Address of remaining data to receive. */ - uint16_t *volatile rxData16; /*!< Address of remaining data to receive. */ - }; - volatile size_t rxDataSize; /*!< Size of the remaining data to receive. */ - size_t rxDataSizeAll; /*!< Size of the data to receive. */ - - union - { - uint8_t *rxRingBuffer; /*!< Start address of the receiver ring buffer. */ - uint16_t *rxRingBuffer16; /*!< Start address of the receiver ring buffer. */ - }; - size_t rxRingBufferSize; /*!< Size of the ring buffer. */ - volatile uint16_t rxRingBufferHead; /*!< Index for the driver to store received data into ring buffer. */ - volatile uint16_t rxRingBufferTail; /*!< Index for the user to get data from the ring buffer. */ - - lpuart_transfer_callback_t callback; /*!< Callback function. */ - void *userData; /*!< LPUART callback function parameter.*/ - - volatile uint8_t txState; /*!< TX transfer state. */ - volatile uint8_t rxState; /*!< RX transfer state. */ - -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - bool isSevenDataBits; /*!< Seven data bits flag. */ -#endif - bool is16bitData; /*!< 16bit data bits flag, only used for 9bit or 10bit data */ -}; - -/* Typedef for interrupt handler. */ -typedef void (*lpuart_isr_t)(LPUART_Type *base, void *handle); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/* Array of LPUART handle. */ -extern void *s_lpuartHandle[]; - -/* Array of LPUART IRQ number. */ -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -extern const IRQn_Type s_lpuartTxIRQ[]; -#else -extern const IRQn_Type s_lpuartIRQ[]; -#endif - -/* LPUART ISR for transactional APIs. */ -extern lpuart_isr_t s_lpuartIsr[]; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* _cplusplus */ - -#if defined(FSL_FEATURE_LPUART_HAS_GLOBAL) && FSL_FEATURE_LPUART_HAS_GLOBAL - -/*! - * @name Software Reset - * @{ - */ - -/*! - * @brief Resets the LPUART using software. - * - * This function resets all internal logic and registers except the Global Register. - * Remains set until cleared by software. - * - * @param base LPUART peripheral base address. - */ -static inline void LPUART_SoftwareReset(LPUART_Type *base) -{ - base->GLOBAL |= LPUART_GLOBAL_RST_MASK; - base->GLOBAL &= ~LPUART_GLOBAL_RST_MASK; -} -/*! @} */ -#endif /*FSL_FEATURE_LPUART_HAS_GLOBAL*/ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Initializes an LPUART instance with the user configuration structure and the peripheral clock. - * - * This function configures the LPUART module with user-defined settings. Call the LPUART_GetDefaultConfig() function - * to configure the configuration structure and get the default configuration. - * The example below shows how to use this API to configure the LPUART. - * @code - * lpuart_config_t lpuartConfig; - * lpuartConfig.baudRate_Bps = 115200U; - * lpuartConfig.parityMode = kLPUART_ParityDisabled; - * lpuartConfig.dataBitsCount = kLPUART_EightDataBits; - * lpuartConfig.isMsb = false; - * lpuartConfig.stopBitCount = kLPUART_OneStopBit; - * lpuartConfig.txFifoWatermark = 0; - * lpuartConfig.rxFifoWatermark = 1; - * LPUART_Init(LPUART1, &lpuartConfig, 20000000U); - * @endcode - * - * @param base LPUART peripheral base address. - * @param config Pointer to a user-defined configuration structure. - * @param srcClock_Hz LPUART clock source frequency in HZ. - * @retval kStatus_LPUART_BaudrateNotSupport Baudrate is not support in current clock source. - * @retval kStatus_Success LPUART initialize succeed - */ -status_t LPUART_Init(LPUART_Type *base, const lpuart_config_t *config, uint32_t srcClock_Hz); - -/*! - * @brief Deinitializes a LPUART instance. - * - * This function waits for transmit to complete, disables TX and RX, and disables the LPUART clock. - * - * @param base LPUART peripheral base address. - */ -void LPUART_Deinit(LPUART_Type *base); - -/*! - * @brief Gets the default configuration structure. - * - * This function initializes the LPUART configuration structure to a default value. The default - * values are: - * lpuartConfig->baudRate_Bps = 115200U; - * lpuartConfig->parityMode = kLPUART_ParityDisabled; - * lpuartConfig->dataBitsCount = kLPUART_EightDataBits; - * lpuartConfig->isMsb = false; - * lpuartConfig->stopBitCount = kLPUART_OneStopBit; - * lpuartConfig->txFifoWatermark = 0; - * lpuartConfig->rxFifoWatermark = 1; - * lpuartConfig->rxIdleType = kLPUART_IdleTypeStartBit; - * lpuartConfig->rxIdleConfig = kLPUART_IdleCharacter1; - * lpuartConfig->enableTx = false; - * lpuartConfig->enableRx = false; - * - * @param config Pointer to a configuration structure. - */ -void LPUART_GetDefaultConfig(lpuart_config_t *config); -/*! @} */ - -/*! - * @name Module configuration - * @{ - */ -/*! - * @brief Sets the LPUART instance baudrate. - * - * This function configures the LPUART module baudrate. This function is used to update - * the LPUART module baudrate after the LPUART module is initialized by the LPUART_Init. - * @code - * LPUART_SetBaudRate(LPUART1, 115200U, 20000000U); - * @endcode - * - * @param base LPUART peripheral base address. - * @param baudRate_Bps LPUART baudrate to be set. - * @param srcClock_Hz LPUART clock source frequency in HZ. - * @retval kStatus_LPUART_BaudrateNotSupport Baudrate is not supported in the current clock source. - * @retval kStatus_Success Set baudrate succeeded. - */ -status_t LPUART_SetBaudRate(LPUART_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz); - -/*! - * @brief Enable 9-bit data mode for LPUART. - * - * This function set the 9-bit mode for LPUART module. The 9th bit is not used for parity thus can be modified by user. - * - * @param base LPUART peripheral base address. - * @param enable true to enable, flase to disable. - */ -void LPUART_Enable9bitMode(LPUART_Type *base, bool enable); - -/*! - * @brief Set the LPUART address. - * - * This function configures the address for LPUART module that works as slave in 9-bit data mode. One or two address - * fields can be configured. When the address field's match enable bit is set, the frame it receices with MSB being - * 1 is considered as an address frame, otherwise it is considered as data frame. Once the address frame matches one - * of slave's own addresses, this slave is addressed. This address frame and its following data frames are stored in - * the receive buffer, otherwise the frames will be discarded. To un-address a slave, just send an address frame with - * unmatched address. - * - * @note Any LPUART instance joined in the multi-slave system can work as slave. The position of the address mark is the - * same as the parity bit when parity is enabled for 8 bit and 9 bit data formats. - * - * @param base LPUART peripheral base address. - * @param address1 LPUART slave address1. - * @param address2 LPUART slave address2. - */ -static inline void LPUART_SetMatchAddress(LPUART_Type *base, uint16_t address1, uint16_t address2) -{ - /* Configure match address. */ - uint32_t address = ((uint32_t)address2 << 16U) | (uint32_t)address1 | 0x1000100UL; - base->MATCH = address; -} - -/*! - * @brief Enable the LPUART match address feature. - * - * @param base LPUART peripheral base address. - * @param match1 true to enable match address1, false to disable. - * @param match2 true to enable match address2, false to disable. - */ -static inline void LPUART_EnableMatchAddress(LPUART_Type *base, bool match1, bool match2) -{ - /* Configure match address1 enable bit. */ - if (match1) - { - base->BAUD |= (uint32_t)LPUART_BAUD_MAEN1_MASK; - } - else - { - base->BAUD &= ~(uint32_t)LPUART_BAUD_MAEN1_MASK; - } - /* Configure match address2 enable bit. */ - if (match2) - { - base->BAUD |= (uint32_t)LPUART_BAUD_MAEN2_MASK; - } - else - { - base->BAUD &= ~(uint32_t)LPUART_BAUD_MAEN2_MASK; - } -} - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO -/*! - * @brief Sets the rx FIFO watermark. - * - * @param base LPUART peripheral base address. - * @param water Rx FIFO watermark. - */ -static inline void LPUART_SetRxFifoWatermark(LPUART_Type *base, uint8_t water) -{ - assert((uint8_t)FSL_FEATURE_LPUART_FIFO_SIZEn(base) > water); - base->WATER = (base->WATER & ~LPUART_WATER_RXWATER_MASK) | LPUART_WATER_RXWATER(water); -} - -/*! - * @brief Sets the tx FIFO watermark. - * - * @param base LPUART peripheral base address. - * @param water Tx FIFO watermark. - */ -static inline void LPUART_SetTxFifoWatermark(LPUART_Type *base, uint8_t water) -{ - assert((uint8_t)FSL_FEATURE_LPUART_FIFO_SIZEn(base) > water); - base->WATER = (base->WATER & ~LPUART_WATER_TXWATER_MASK) | LPUART_WATER_TXWATER(water); -} -#endif - -/*! - * @brief Sets the LPUART using 16bit transmit, only for 9bit or 10bit mode. - * - * This function Enable 16bit Data transmit in lpuart_handle_t. - * - * @param handle LPUART handle pointer. - * @param enable true to enable, false to disable. - */ -static inline void LPUART_TransferEnable16Bit(lpuart_handle_t *handle, bool enable) -{ - handle->is16bitData = enable; -} -/*! @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets LPUART status flags. - * - * This function gets all LPUART status flags. The flags are returned as the logical - * OR value of the enumerators @ref _lpuart_flags. To check for a specific status, - * compare the return value with enumerators in the @ref _lpuart_flags. - * For example, to check whether the TX is empty: - * @code - * if (kLPUART_TxDataRegEmptyFlag & LPUART_GetStatusFlags(LPUART1)) - * { - * ... - * } - * @endcode - * - * @param base LPUART peripheral base address. - * @return LPUART status flags which are ORed by the enumerators in the _lpuart_flags. - */ -uint32_t LPUART_GetStatusFlags(LPUART_Type *base); - -/*! - * @brief Clears status flags with a provided mask. - * - * This function clears LPUART status flags with a provided mask. Automatically cleared flags - * can't be cleared by this function. - * Flags that can only cleared or set by hardware are: - * kLPUART_TxDataRegEmptyFlag, kLPUART_TransmissionCompleteFlag, kLPUART_RxDataRegFullFlag, - * kLPUART_RxActiveFlag, kLPUART_NoiseErrorFlag, kLPUART_ParityErrorFlag, - * kLPUART_TxFifoEmptyFlag,kLPUART_RxFifoEmptyFlag - * Note: This API should be called when the Tx/Rx is idle, otherwise it takes no effects. - * - * @param base LPUART peripheral base address. - * @param mask the status flags to be cleared. The user can use the enumerators in the - * _lpuart_status_flag_t to do the OR operation and get the mask. - * @return 0 succeed, others failed. - * @retval kStatus_LPUART_FlagCannotClearManually The flag can't be cleared by this function but - * it is cleared automatically by hardware. - * @retval kStatus_Success Status in the mask are cleared. - */ -status_t LPUART_ClearStatusFlags(LPUART_Type *base, uint32_t mask); -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables LPUART interrupts according to a provided mask. - * - * This function enables the LPUART interrupts according to a provided mask. The mask - * is a logical OR of enumeration members. See the @ref _lpuart_interrupt_enable. - * This examples shows how to enable TX empty interrupt and RX full interrupt: - * @code - * LPUART_EnableInterrupts(LPUART1,kLPUART_TxDataRegEmptyInterruptEnable | kLPUART_RxDataRegFullInterruptEnable); - * @endcode - * - * @param base LPUART peripheral base address. - * @param mask The interrupts to enable. Logical OR of @ref _lpuart_interrupt_enable. - */ -void LPUART_EnableInterrupts(LPUART_Type *base, uint32_t mask); - -/*! - * @brief Disables LPUART interrupts according to a provided mask. - * - * This function disables the LPUART interrupts according to a provided mask. The mask - * is a logical OR of enumeration members. See @ref _lpuart_interrupt_enable. - * This example shows how to disable the TX empty interrupt and RX full interrupt: - * @code - * LPUART_DisableInterrupts(LPUART1,kLPUART_TxDataRegEmptyInterruptEnable | kLPUART_RxDataRegFullInterruptEnable); - * @endcode - * - * @param base LPUART peripheral base address. - * @param mask The interrupts to disable. Logical OR of @ref _lpuart_interrupt_enable. - */ -void LPUART_DisableInterrupts(LPUART_Type *base, uint32_t mask); - -/*! - * @brief Gets enabled LPUART interrupts. - * - * This function gets the enabled LPUART interrupts. The enabled interrupts are returned - * as the logical OR value of the enumerators @ref _lpuart_interrupt_enable. To check - * a specific interrupt enable status, compare the return value with enumerators - * in @ref _lpuart_interrupt_enable. - * For example, to check whether the TX empty interrupt is enabled: - * @code - * uint32_t enabledInterrupts = LPUART_GetEnabledInterrupts(LPUART1); - * - * if (kLPUART_TxDataRegEmptyInterruptEnable & enabledInterrupts) - * { - * ... - * } - * @endcode - * - * @param base LPUART peripheral base address. - * @return LPUART interrupt flags which are logical OR of the enumerators in @ref _lpuart_interrupt_enable. - */ -uint32_t LPUART_GetEnabledInterrupts(LPUART_Type *base); -/*! @} */ - -#if defined(FSL_FEATURE_LPUART_HAS_DMA_ENABLE) && FSL_FEATURE_LPUART_HAS_DMA_ENABLE -/*! - * @name DMA Configuration - * @{ - */ -/*! - * @brief Gets the LPUART data register address. - * - * This function returns the LPUART data register address, which is mainly used by the DMA/eDMA. - * - * @param base LPUART peripheral base address. - * @return LPUART data register addresses which are used both by the transmitter and receiver. - */ -static inline uintptr_t LPUART_GetDataRegisterAddress(LPUART_Type *base) -{ - return (uintptr_t) & (base->DATA); -} - -/*! - * @brief Enables or disables the LPUART transmitter DMA request. - * - * This function enables or disables the transmit data register empty flag, STAT[TDRE], to generate DMA requests. - * - * @param base LPUART peripheral base address. - * @param enable True to enable, false to disable. - */ -static inline void LPUART_EnableTxDMA(LPUART_Type *base, bool enable) -{ - if (enable) - { - base->BAUD |= LPUART_BAUD_TDMAE_MASK; - } - else - { - base->BAUD &= ~LPUART_BAUD_TDMAE_MASK; - } -} - -/*! - * @brief Enables or disables the LPUART receiver DMA. - * - * This function enables or disables the receiver data register full flag, STAT[RDRF], to generate DMA requests. - * - * @param base LPUART peripheral base address. - * @param enable True to enable, false to disable. - */ -static inline void LPUART_EnableRxDMA(LPUART_Type *base, bool enable) -{ - if (enable) - { - base->BAUD |= LPUART_BAUD_RDMAE_MASK; - } - else - { - base->BAUD &= ~LPUART_BAUD_RDMAE_MASK; - } -} -/*! @} */ -#endif /* FSL_FEATURE_LPUART_HAS_DMA_ENABLE */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Get the LPUART instance from peripheral base address. - * - * @param base LPUART peripheral base address. - * @return LPUART instance. - */ -uint32_t LPUART_GetInstance(LPUART_Type *base); - -/*! - * @brief Enables or disables the LPUART transmitter. - * - * This function enables or disables the LPUART transmitter. - * - * @param base LPUART peripheral base address. - * @param enable True to enable, false to disable. - */ -static inline void LPUART_EnableTx(LPUART_Type *base, bool enable) -{ - if (enable) - { - base->CTRL |= LPUART_CTRL_TE_MASK; - } - else - { - base->CTRL &= ~LPUART_CTRL_TE_MASK; - } -} - -/*! - * @brief Enables or disables the LPUART receiver. - * - * This function enables or disables the LPUART receiver. - * - * @param base LPUART peripheral base address. - * @param enable True to enable, false to disable. - */ -static inline void LPUART_EnableRx(LPUART_Type *base, bool enable) -{ - if (enable) - { - base->CTRL |= LPUART_CTRL_RE_MASK; - } - else - { - base->CTRL &= ~LPUART_CTRL_RE_MASK; - } -} - -/*! - * @brief Writes to the transmitter register. - * - * This function writes data to the transmitter register directly. The upper layer must - * ensure that the TX register is empty or that the TX FIFO has room before calling this function. - * - * @param base LPUART peripheral base address. - * @param data Data write to the TX register. - */ -static inline void LPUART_WriteByte(LPUART_Type *base, uint8_t data) -{ - base->DATA = data; -} - -/*! - * @brief Reads the receiver register. - * - * This function reads data from the receiver register directly. The upper layer must - * ensure that the receiver register is full or that the RX FIFO has data before calling this function. - * - * @param base LPUART peripheral base address. - * @return Data read from data register. - */ -static inline uint8_t LPUART_ReadByte(LPUART_Type *base) -{ -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - uint32_t ctrl = base->CTRL; - uint8_t result; - /* - * $Branch Coverage Justification$ - * (ctrl & LPUART_CTRL_M7_MASK) == 0U) false is not covered. - * If ctrl & LPUART_CTRL_M7_MASK is 0, it can't be !0 in next judge. - */ - bool isSevenDataBits = (((ctrl & LPUART_CTRL_M7_MASK) != 0U) || - (((ctrl & LPUART_CTRL_M7_MASK) == 0U) && ((ctrl & LPUART_CTRL_M_MASK) == 0U) && - ((ctrl & LPUART_CTRL_PE_MASK) != 0U))); - - if (isSevenDataBits) - { - result = (uint8_t)(base->DATA & 0x7FU); - } - else - { - result = (uint8_t)base->DATA; - } - - return result; -#else - return (uint8_t)(base->DATA); -#endif -} - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO -/*! - * @brief Gets the rx FIFO data count. - * - * @param base LPUART peripheral base address. - * @return rx FIFO data count. - */ -static inline uint8_t LPUART_GetRxFifoCount(LPUART_Type *base) -{ - return (uint8_t)((base->WATER & LPUART_WATER_RXCOUNT_MASK) >> LPUART_WATER_RXCOUNT_SHIFT); -} - -/*! - * @brief Gets the tx FIFO data count. - * - * @param base LPUART peripheral base address. - * @return tx FIFO data count. - */ -static inline uint8_t LPUART_GetTxFifoCount(LPUART_Type *base) -{ - return (uint8_t)((base->WATER & LPUART_WATER_TXCOUNT_MASK) >> LPUART_WATER_TXCOUNT_SHIFT); -} -#endif - -/*! - * @brief Transmit an address frame in 9-bit data mode. - * - * @param base LPUART peripheral base address. - * @param address LPUART slave address. - */ -void LPUART_SendAddress(LPUART_Type *base, uint8_t address); - -/*! - * @brief Writes to the transmitter register using a blocking method. - * - * This function polls the transmitter register, first waits for the register to be empty or TX FIFO to have room, - * and writes data to the transmitter buffer, then waits for the dat to be sent out to the bus. - * - * @param base LPUART peripheral base address. - * @param data Start address of the data to write. - * @param length Size of the data to write. - * @retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * @retval kStatus_Success Successfully wrote all data. - */ -status_t LPUART_WriteBlocking(LPUART_Type *base, const uint8_t *data, size_t length); - -/*! - * @brief Writes to the transmitter register using a blocking method in 9bit or 10bit mode. - * - * @note This function only support 9bit or 10bit transfer. - * Please make sure only 10bit of data is valid and other bits are 0. - * - * @param base LPUART peripheral base address. - * @param data Start address of the data to write. - * @param length Size of the data to write. - * @retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * @retval kStatus_Success Successfully wrote all data. - */ -status_t LPUART_WriteBlocking16bit(LPUART_Type *base, const uint16_t *data, size_t length); - -/*! - * @brief Reads the receiver data register using a blocking method. - * - * This function polls the receiver register, waits for the receiver register full or receiver FIFO - * has data, and reads data from the TX register. - * - * @param base LPUART peripheral base address. - * @param data Start address of the buffer to store the received data. - * @param length Size of the buffer. - * @retval kStatus_LPUART_RxHardwareOverrun Receiver overrun happened while receiving data. - * @retval kStatus_LPUART_NoiseError Noise error happened while receiving data. - * @retval kStatus_LPUART_FramingError Framing error happened while receiving data. - * @retval kStatus_LPUART_ParityError Parity error happened while receiving data. - * @retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * @retval kStatus_Success Successfully received all data. - */ -status_t LPUART_ReadBlocking(LPUART_Type *base, uint8_t *data, size_t length); - -/*! - * @brief Reads the receiver data register in 9bit or 10bit mode. - * - * @note This function only support 9bit or 10bit transfer. - * - * @param base LPUART peripheral base address. - * @param data Start address of the buffer to store the received data by 16bit, only 10bit is valid. - * @param length Size of the buffer. - * @retval kStatus_LPUART_RxHardwareOverrun Receiver overrun happened while receiving data. - * @retval kStatus_LPUART_NoiseError Noise error happened while receiving data. - * @retval kStatus_LPUART_FramingError Framing error happened while receiving data. - * @retval kStatus_LPUART_ParityError Parity error happened while receiving data. - * @retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * @retval kStatus_Success Successfully received all data. - */ -status_t LPUART_ReadBlocking16bit(LPUART_Type *base, uint16_t *data, size_t length); - -/*! @} */ - -/*! - * @name Transactional - * @{ - */ - -/*! - * @brief Initializes the LPUART handle. - * - * This function initializes the LPUART handle, which can be used for other LPUART - * transactional APIs. Usually, for a specified LPUART instance, - * call this API once to get the initialized handle. - * - * The LPUART driver supports the "background" receiving, which means that user can set up - * an RX ring buffer optionally. Data received is stored into the ring buffer even when the - * user doesn't call the LPUART_TransferReceiveNonBlocking() API. If there is already data received - * in the ring buffer, the user can get the received data from the ring buffer directly. - * The ring buffer is disabled if passing NULL as @p ringBuffer. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param callback Callback function. - * @param userData User data. - */ -void LPUART_TransferCreateHandle(LPUART_Type *base, - lpuart_handle_t *handle, - lpuart_transfer_callback_t callback, - void *userData); -/*! - * @brief Transmits a buffer of data using the interrupt method. - * - * This function send data using an interrupt method. This is a non-blocking function, which - * returns directly without waiting for all data written to the transmitter register. When - * all data is written to the TX register in the ISR, the LPUART driver calls the callback - * function and passes the @ref kStatus_LPUART_TxIdle as status parameter. - * - * @note The kStatus_LPUART_TxIdle is passed to the upper layer when all data are written - * to the TX register. However, there is no check to ensure that all the data sent out. Before disabling the TX, - * check the kLPUART_TransmissionCompleteFlag to ensure that the transmit is finished. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param xfer LPUART transfer structure, see #lpuart_transfer_t. - * @retval kStatus_Success Successfully start the data transmission. - * @retval kStatus_LPUART_TxBusy Previous transmission still not finished, data not all written to the TX register. - * @retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_TransferSendNonBlocking(LPUART_Type *base, lpuart_handle_t *handle, lpuart_transfer_t *xfer); - -/*! - * @brief Sets up the RX ring buffer. - * - * This function sets up the RX ring buffer to a specific UART handle. - * - * When the RX ring buffer is used, data received is stored into the ring buffer even when - * the user doesn't call the UART_TransferReceiveNonBlocking() API. If there is already data received - * in the ring buffer, the user can get the received data from the ring buffer directly. - * - * @note When using RX ring buffer, one byte is reserved for internal use. In other - * words, if @p ringBufferSize is 32, then only 31 bytes are used for saving data. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param ringBuffer Start address of ring buffer for background receiving. Pass NULL to disable the ring buffer. - * @param ringBufferSize size of the ring buffer. - */ -void LPUART_TransferStartRingBuffer(LPUART_Type *base, - lpuart_handle_t *handle, - uint8_t *ringBuffer, - size_t ringBufferSize); - -/*! - * @brief Aborts the background transfer and uninstalls the ring buffer. - * - * This function aborts the background transfer and uninstalls the ring buffer. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - */ -void LPUART_TransferStopRingBuffer(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief Get the length of received data in RX ring buffer. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @return Length of received data in RX ring buffer. - */ -size_t LPUART_TransferGetRxRingBufferLength(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief Aborts the interrupt-driven data transmit. - * - * This function aborts the interrupt driven data sending. The user can get the remainBtyes to find out - * how many bytes are not sent out. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - */ -void LPUART_TransferAbortSend(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief Gets the number of bytes that have been sent out to bus. - * - * This function gets the number of bytes that have been sent out to bus by an interrupt method. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param count Send bytes count. - * @retval kStatus_NoTransferInProgress No send in progress. - * @retval kStatus_InvalidArgument Parameter is invalid. - * @retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetSendCount(LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count); - -/*! - * @brief Receives a buffer of data using the interrupt method. - * - * This function receives data using an interrupt method. This is a non-blocking function - * which returns without waiting to ensure that all data are received. - * If the RX ring buffer is used and not empty, the data in the ring buffer is copied and - * the parameter @p receivedBytes shows how many bytes are copied from the ring buffer. - * After copying, if the data in the ring buffer is not enough for read, the receive - * request is saved by the LPUART driver. When the new data arrives, the receive request - * is serviced first. When all data is received, the LPUART driver notifies the upper layer - * through a callback function and passes a status parameter kStatus_UART_RxIdle. - * For example, the upper layer needs 10 bytes but there are only 5 bytes in ring buffer. - * The 5 bytes are copied to xfer->data, which returns with the - * parameter @p receivedBytes set to 5. For the remaining 5 bytes, the newly arrived data is - * saved from xfer->data[5]. When 5 bytes are received, the LPUART driver notifies the upper layer. - * If the RX ring buffer is not enabled, this function enables the RX and RX interrupt - * to receive data to xfer->data. When all data is received, the upper layer is notified. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param xfer LPUART transfer structure, see uart_transfer_t. - * @param receivedBytes Bytes received from the ring buffer directly. - * @retval kStatus_Success Successfully queue the transfer into the transmit queue. - * @retval kStatus_LPUART_RxBusy Previous receive request is not finished. - * @retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_TransferReceiveNonBlocking(LPUART_Type *base, - lpuart_handle_t *handle, - lpuart_transfer_t *xfer, - size_t *receivedBytes); - -/*! - * @brief Aborts the interrupt-driven data receiving. - * - * This function aborts the interrupt-driven data receiving. The user can get the remainBytes to find out - * how many bytes not received yet. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - */ -void LPUART_TransferAbortReceive(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief Gets the number of bytes that have been received. - * - * This function gets the number of bytes that have been received. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param count Receive bytes count. - * @retval kStatus_NoTransferInProgress No receive in progress. - * @retval kStatus_InvalidArgument Parameter is invalid. - * @retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetReceiveCount(LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count); - -/*! - * @brief LPUART IRQ handle function. - * - * This function handles the LPUART transmit and receive IRQ request. - * - * @param base LPUART peripheral base address. - * @param irqHandle LPUART handle pointer. - */ -void LPUART_TransferHandleIRQ(LPUART_Type *base, void *irqHandle); - -/*! - * @brief LPUART Error IRQ handle function. - * - * This function handles the LPUART error IRQ request. - * - * @param base LPUART peripheral base address. - * @param irqHandle LPUART handle pointer. - */ -void LPUART_TransferHandleErrorIRQ(LPUART_Type *base, void *irqHandle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_LPUART_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpuart_edma.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpuart_edma.c deleted file mode 100644 index 79196d9c653..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpuart_edma.c +++ /dev/null @@ -1,522 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpuart_edma.h" -/* - * $Coverage Justification Reference$ - * - * $Justification fsl_lpuart_edma_c_ref_1$ - * The EDMA handle is only used by the LPUART EDMA driver, with the LPUART EDMA driver workflow, - * the callback is only called when EDMA transfer done. - * - * $Justification fsl_lpuart_edma_c_ref_2$ - * This function only handles the kLPUART_TransmissionCompleteFlag event. - * - */ -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpuart_edma" -#endif - -/*base, false); - - /* Stop transfer. */ - EDMA_AbortTransfer(handle); - - /* Enable tx complete interrupt */ - LPUART_EnableInterrupts(lpuartPrivateHandle->base, (uint32_t)kLPUART_TransmissionCompleteInterruptEnable); - } -} - -static void LPUART_ReceiveEDMACallback(edma_handle_t *handle, void *param, bool transferDone, uint32_t tcds) -{ - assert(NULL != param); - - lpuart_edma_private_handle_t *lpuartPrivateHandle = (lpuart_edma_private_handle_t *)param; - - /* Avoid warning for unused parameters. */ - handle = handle; - tcds = tcds; - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_edma_c_ref_1$ - */ - if (transferDone) - { - /* Disable transfer. */ - LPUART_TransferAbortReceiveEDMA(lpuartPrivateHandle->base, lpuartPrivateHandle->handle); - - if (NULL != lpuartPrivateHandle->handle->callback) - { - lpuartPrivateHandle->handle->callback(lpuartPrivateHandle->base, lpuartPrivateHandle->handle, - kStatus_LPUART_RxIdle, lpuartPrivateHandle->handle->userData); - } - } -} - -/*! - * brief Initializes the LPUART handle which is used in transactional functions. - * - * note This function disables all LPUART interrupts. - * - * param base LPUART peripheral base address. - * param handle Pointer to lpuart_edma_handle_t structure. - * param callback Callback function. - * param userData User data. - * param txEdmaHandle User requested DMA handle for TX DMA transfer. - * param rxEdmaHandle User requested DMA handle for RX DMA transfer. - */ -void LPUART_TransferCreateHandleEDMA(LPUART_Type *base, - lpuart_edma_handle_t *handle, - lpuart_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *txEdmaHandle, - edma_handle_t *rxEdmaHandle) -{ - assert(NULL != handle); - - uint32_t instance = LPUART_GetInstance(base); - - s_lpuartEdmaPrivateHandle[instance].base = base; - s_lpuartEdmaPrivateHandle[instance].handle = handle; - - (void)memset(handle, 0, sizeof(*handle)); - - handle->rxState = (uint8_t)kLPUART_RxIdle; - handle->txState = (uint8_t)kLPUART_TxIdle; - - handle->rxEdmaHandle = rxEdmaHandle; - handle->txEdmaHandle = txEdmaHandle; - - handle->callback = callback; - handle->userData = userData; - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Note: - Take care of the RX FIFO, EDMA request only assert when received bytes - equal or more than RX water mark, there is potential issue if RX water - mark larger than 1. - For example, if RX FIFO water mark is 2, upper layer needs 5 bytes and - 5 bytes are received. the last byte will be saved in FIFO but not trigger - EDMA transfer because the water mark is 2. - */ - if (NULL != rxEdmaHandle) - { - base->WATER &= (~LPUART_WATER_RXWATER_MASK); - } -#endif - - /* Save the handle in global variables to support the double weak mechanism. */ - s_lpuartHandle[instance] = handle; - /* Set LPUART_TransferEdmaHandleIRQ as DMA IRQ handler */ - s_lpuartIsr[instance] = LPUART_TransferEdmaHandleIRQ; - /* Disable all LPUART internal interrupts */ - LPUART_DisableInterrupts(base, (uint32_t)kLPUART_AllInterruptEnable); - /* Enable interrupt in NVIC. */ -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ - (void)EnableIRQ(s_lpuartTxIRQ[instance]); -#else - (void)EnableIRQ(s_lpuartIRQ[instance]); -#endif - - /* Configure TX. */ - if (NULL != txEdmaHandle) - { - EDMA_SetCallback(handle->txEdmaHandle, LPUART_SendEDMACallback, &s_lpuartEdmaPrivateHandle[instance]); - } - - /* Configure RX. */ - if (NULL != rxEdmaHandle) - { - EDMA_SetCallback(handle->rxEdmaHandle, LPUART_ReceiveEDMACallback, &s_lpuartEdmaPrivateHandle[instance]); - } -} - -/*! - * brief Sends data using eDMA. - * - * This function sends data using eDMA. This is a non-blocking function, which returns - * right away. When all data is sent, the send callback function is called. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param xfer LPUART eDMA transfer structure. See #lpuart_transfer_t. - * retval kStatus_Success if succeed, others failed. - * retval kStatus_LPUART_TxBusy Previous transfer on going. - * retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_SendEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, lpuart_transfer_t *xfer) -{ - assert(NULL != handle); - assert(NULL != handle->txEdmaHandle); - assert(NULL != xfer); - assert(NULL != xfer->data); - assert(0U != xfer->dataSize); - - edma_transfer_config_t xferConfig; - status_t status; - - /* If previous TX not finished. */ - if ((uint8_t)kLPUART_TxBusy == handle->txState) - { - status = kStatus_LPUART_TxBusy; - } - else - { - handle->txState = (uint8_t)kLPUART_TxBusy; - handle->txDataSizeAll = xfer->dataSize; - - /* Prepare transfer. */ - EDMA_PrepareTransfer(&xferConfig, xfer->data, sizeof(uint8_t), - (void *)(uint32_t *)LPUART_GetDataRegisterAddress(base), sizeof(uint8_t), sizeof(uint8_t), - xfer->dataSize, kEDMA_MemoryToPeripheral); - - /* Store the initially configured eDMA minor byte transfer count into the LPUART handle */ - handle->nbytes = (uint8_t)sizeof(uint8_t); - - /* Submit transfer. */ - if (kStatus_Success != - EDMA_SubmitTransfer(handle->txEdmaHandle, (const edma_transfer_config_t *)(uint32_t)&xferConfig)) - { - return kStatus_Fail; - } - EDMA_StartTransfer(handle->txEdmaHandle); - - /* Enable LPUART TX EDMA. */ - LPUART_EnableTxDMA(base, true); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Receives data using eDMA. - * - * This function receives data using eDMA. This is non-blocking function, which returns - * right away. When all data is received, the receive callback function is called. - * - * param base LPUART peripheral base address. - * param handle Pointer to lpuart_edma_handle_t structure. - * param xfer LPUART eDMA transfer structure, see #lpuart_transfer_t. - * retval kStatus_Success if succeed, others fail. - * retval kStatus_LPUART_RxBusy Previous transfer ongoing. - * retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_ReceiveEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, lpuart_transfer_t *xfer) -{ - assert(NULL != handle); - assert(NULL != handle->rxEdmaHandle); - assert(NULL != xfer); - assert(NULL != xfer->data); - assert(0U != xfer->dataSize); - - edma_transfer_config_t xferConfig; - status_t status; - - /* If previous RX not finished. */ - if ((uint8_t)kLPUART_RxBusy == handle->rxState) - { - status = kStatus_LPUART_RxBusy; - } - else - { - handle->rxState = (uint8_t)kLPUART_RxBusy; - handle->rxDataSizeAll = xfer->dataSize; - - /* Prepare transfer. */ - EDMA_PrepareTransfer(&xferConfig, (void *)(uint32_t *)LPUART_GetDataRegisterAddress(base), sizeof(uint8_t), - xfer->data, sizeof(uint8_t), sizeof(uint8_t), xfer->dataSize, kEDMA_PeripheralToMemory); - - /* Store the initially configured eDMA minor byte transfer count into the LPUART handle */ - handle->nbytes = (uint8_t)sizeof(uint8_t); - - /* Submit transfer. */ - if (kStatus_Success != - EDMA_SubmitTransfer(handle->rxEdmaHandle, (const edma_transfer_config_t *)(uint32_t)&xferConfig)) - { - return kStatus_Fail; - } - EDMA_StartTransfer(handle->rxEdmaHandle); - - /* Enable LPUART RX EDMA. */ - LPUART_EnableRxDMA(base, true); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Aborts the sent data using eDMA. - * - * This function aborts the sent data using eDMA. - * - * param base LPUART peripheral base address. - * param handle Pointer to lpuart_edma_handle_t structure. - */ -void LPUART_TransferAbortSendEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle) -{ - assert(NULL != handle); - assert(NULL != handle->txEdmaHandle); - - /* Disable LPUART TX EDMA. */ - LPUART_EnableTxDMA(base, false); - - /* Stop transfer. */ - EDMA_AbortTransfer(handle->txEdmaHandle); - - handle->txState = (uint8_t)kLPUART_TxIdle; -} - -/*! - * brief Aborts the received data using eDMA. - * - * This function aborts the received data using eDMA. - * - * param base LPUART peripheral base address. - * param handle Pointer to lpuart_edma_handle_t structure. - */ -void LPUART_TransferAbortReceiveEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle) -{ - assert(NULL != handle); - assert(NULL != handle->rxEdmaHandle); - - /* Disable LPUART RX EDMA. */ - LPUART_EnableRxDMA(base, false); - - /* Stop transfer. */ - EDMA_AbortTransfer(handle->rxEdmaHandle); - - handle->rxState = (uint8_t)kLPUART_RxIdle; -} - -/*! - * brief Gets the number of received bytes. - * - * This function gets the number of received bytes. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param count Receive bytes count. - * retval kStatus_NoTransferInProgress No receive in progress. - * retval kStatus_InvalidArgument Parameter is invalid. - * retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetReceiveCountEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, uint32_t *count) -{ - assert(NULL != handle); - assert(NULL != handle->rxEdmaHandle); - assert(NULL != count); - - if ((uint8_t)kLPUART_RxIdle == handle->rxState) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->rxDataSizeAll - - ((uint32_t)handle->nbytes * - EDMA_GetRemainingMajorLoopCount(handle->rxEdmaHandle->base, handle->rxEdmaHandle->channel)); - - return kStatus_Success; -} - -/*! - * brief Gets the number of bytes written to the LPUART TX register. - * - * This function gets the number of bytes written to the LPUART TX - * register by DMA. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param count Send bytes count. - * retval kStatus_NoTransferInProgress No send in progress. - * retval kStatus_InvalidArgument Parameter is invalid. - * retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetSendCountEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, uint32_t *count) -{ - assert(NULL != handle); - assert(NULL != handle->txEdmaHandle); - assert(NULL != count); - - if ((uint8_t)kLPUART_TxIdle == handle->txState) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->txDataSizeAll - - ((uint32_t)handle->nbytes * - EDMA_GetRemainingMajorLoopCount(handle->txEdmaHandle->base, handle->txEdmaHandle->channel)); - - return kStatus_Success; -} - -/*! - * brief LPUART eDMA IRQ handle function. - * - * This function handles the LPUART tx complete IRQ request and invoke user callback. - * It is not set to static so that it can be used in user application. - * note This function is used as default IRQ handler by double weak mechanism. - * If user's specific IRQ handler is implemented, make sure this function is invoked in the handler. - * - * param base LPUART peripheral base address. - * param lpuartEdmaHandle LPUART handle pointer. - */ -void LPUART_TransferEdmaHandleIRQ(LPUART_Type *base, void *lpuartEdmaHandle) -{ - assert(lpuartEdmaHandle != NULL); - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_edma_c_ref_2$ - */ - if (((uint32_t)kLPUART_TransmissionCompleteFlag & LPUART_GetStatusFlags(base)) != 0U) - { - lpuart_edma_handle_t *handle = (lpuart_edma_handle_t *)lpuartEdmaHandle; - - /* Disable tx complete interrupt */ - LPUART_DisableInterrupts(base, (uint32_t)kLPUART_TransmissionCompleteInterruptEnable); - - handle->txState = (uint8_t)kLPUART_TxIdle; - - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_LPUART_TxIdle, handle->userData); - } - } -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpuart_edma.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpuart_edma.h deleted file mode 100644 index 1190ed36e86..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_lpuart_edma.h +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LPUART_EDMA_H_ -#define FSL_LPUART_EDMA_H_ - -#include "fsl_lpuart.h" -#include "fsl_edma.h" - -/*! - * @addtogroup lpuart_edma_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief LPUART EDMA driver version. */ -#define FSL_LPUART_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 6, 0)) -/*! @} */ - -/* Forward declaration of the handle typedef. */ -typedef struct _lpuart_edma_handle lpuart_edma_handle_t; - -/*! @brief LPUART transfer callback function. */ -typedef void (*lpuart_edma_transfer_callback_t)(LPUART_Type *base, - lpuart_edma_handle_t *handle, - status_t status, - void *userData); - -/*! - * @brief LPUART eDMA handle - */ -struct _lpuart_edma_handle -{ - lpuart_edma_transfer_callback_t callback; /*!< Callback function. */ - void *userData; /*!< LPUART callback function parameter.*/ - size_t rxDataSizeAll; /*!< Size of the data to receive. */ - size_t txDataSizeAll; /*!< Size of the data to send out. */ - - edma_handle_t *txEdmaHandle; /*!< The eDMA TX channel used. */ - edma_handle_t *rxEdmaHandle; /*!< The eDMA RX channel used. */ - - uint8_t nbytes; /*!< eDMA minor byte transfer count initially configured. */ - - volatile uint8_t txState; /*!< TX transfer state. */ - volatile uint8_t rxState; /*!< RX transfer state */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name eDMA transactional - * @{ - */ - -/*! - * @brief Initializes the LPUART handle which is used in transactional functions. - * - * @note This function disables all LPUART interrupts. - * - * @param base LPUART peripheral base address. - * @param handle Pointer to lpuart_edma_handle_t structure. - * @param callback Callback function. - * @param userData User data. - * @param txEdmaHandle User requested DMA handle for TX DMA transfer. - * @param rxEdmaHandle User requested DMA handle for RX DMA transfer. - */ -void LPUART_TransferCreateHandleEDMA(LPUART_Type *base, - lpuart_edma_handle_t *handle, - lpuart_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *txEdmaHandle, - edma_handle_t *rxEdmaHandle); - -/*! - * @brief Sends data using eDMA. - * - * This function sends data using eDMA. This is a non-blocking function, which returns - * right away. When all data is sent, the send callback function is called. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param xfer LPUART eDMA transfer structure. See #lpuart_transfer_t. - * @retval kStatus_Success if succeed, others failed. - * @retval kStatus_LPUART_TxBusy Previous transfer on going. - * @retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_SendEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, lpuart_transfer_t *xfer); - -/*! - * @brief Receives data using eDMA. - * - * This function receives data using eDMA. This is non-blocking function, which returns - * right away. When all data is received, the receive callback function is called. - * - * @param base LPUART peripheral base address. - * @param handle Pointer to lpuart_edma_handle_t structure. - * @param xfer LPUART eDMA transfer structure, see #lpuart_transfer_t. - * @retval kStatus_Success if succeed, others fail. - * @retval kStatus_LPUART_RxBusy Previous transfer ongoing. - * @retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_ReceiveEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, lpuart_transfer_t *xfer); - -/*! - * @brief Aborts the sent data using eDMA. - * - * This function aborts the sent data using eDMA. - * - * @param base LPUART peripheral base address. - * @param handle Pointer to lpuart_edma_handle_t structure. - */ -void LPUART_TransferAbortSendEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle); - -/*! - * @brief Aborts the received data using eDMA. - * - * This function aborts the received data using eDMA. - * - * @param base LPUART peripheral base address. - * @param handle Pointer to lpuart_edma_handle_t structure. - */ -void LPUART_TransferAbortReceiveEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle); - -/*! - * @brief Gets the number of bytes written to the LPUART TX register. - * - * This function gets the number of bytes written to the LPUART TX - * register by DMA. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param count Send bytes count. - * @retval kStatus_NoTransferInProgress No send in progress. - * @retval kStatus_InvalidArgument Parameter is invalid. - * @retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetSendCountEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, uint32_t *count); - -/*! - * @brief Gets the number of received bytes. - * - * This function gets the number of received bytes. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param count Receive bytes count. - * @retval kStatus_NoTransferInProgress No receive in progress. - * @retval kStatus_InvalidArgument Parameter is invalid. - * @retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetReceiveCountEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, uint32_t *count); - -/*! - * @brief LPUART eDMA IRQ handle function. - * - * This function handles the LPUART tx complete IRQ request and invoke user callback. - * It is not set to static so that it can be used in user application. - * @note This function is used as default IRQ handler by double weak mechanism. - * If user's specific IRQ handler is implemented, make sure this function is invoked in the handler. - * - * @param base LPUART peripheral base address. - * @param lpuartEdmaHandle LPUART handle pointer. - */ -void LPUART_TransferEdmaHandleIRQ(LPUART_Type *base, void *lpuartEdmaHandle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_LPUART_EDMA_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_opamp.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_opamp.c deleted file mode 100644 index f75075d3ec4..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_opamp.c +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Copyright 2021-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_opamp.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.opamp" -#endif - -#if defined(OPAMP_RSTS) -#define OPAMP_RESETS_ARRAY OPAMP_RSTS -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -static uint32_t OPAMP_GetInstance(OPAMP_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ -static OPAMP_Type *const s_opampBases[] = OPAMP_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to OPAMP clocks for each instance. */ -static const clock_ip_name_t s_opampClocks[] = OPAMP_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(OPAMP_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_opampResets[] = OPAMP_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ - -static uint32_t OPAMP_GetInstance(OPAMP_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0UL; instance < ARRAY_SIZE(s_opampBases); instance++) - { - if (s_opampBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_opampBases)); - - return instance; -} - -/*! - * brief Initialize OPAMP instance. - * - * param base OPAMP peripheral base address. - * param config The pointer to opamp_config_t. - */ -void OPAMP_Init(OPAMP_Type *base, const opamp_config_t *config) -{ - assert(config != NULL); - - uint32_t tmp32 = 0U; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock. */ - CLOCK_EnableClock(s_opampClocks[OPAMP_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(OPAMP_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_opampResets[OPAMP_GetInstance(base)]); -#endif - - tmp32 = OPAMP_OPAMP_CTR_EN(config->enable) | OPAMP_OPAMP_CTR_MODE(config->mode) | - OPAMP_OPAMP_CTR_BIASC(config->trimOption) | OPAMP_OPAMP_CTR_INTREF(config->intRefVoltage) | - OPAMP_OPAMP_CTR_PREF(config->posRefVoltage) | -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_OUTSW) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_OUTSW - OPAMP_OPAMP_CTR_OUTSW(config->enableOutputSwitch) | -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_OUTSW */ -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW1) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW1 - OPAMP_OPAMP_CTR_ADCSW1(config->enablePosADCSw1) | -#else - OPAMP_OPAMP_CTR_ADCSW(config->enablePosADCSw) | -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW1 */ -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW2) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW2 - OPAMP_OPAMP_CTR_ADCSW2(config->enablePosADCSw2) | -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW2 */ -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_INPSEL) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_INPSEL - OPAMP_OPAMP_CTR_INPSEL(config->PosInputChannelSelection) | -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_INPSEL */ -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_TRIGMD) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_TRIGMD - OPAMP_OPAMP_CTR_TRIGMD(config->enableTriggerMode) | -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_TRIGMD */ - OPAMP_OPAMP_CTR_NGAIN(config->negGain); - base->OPAMP_CTR = tmp32; -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_BUFEN) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_BUFEN - if (config->enableRefBuffer) - { - assert((uint32_t)(config->posGain) <= 7UL); - base->OPAMP_CTR |= OPAMP_OPAMP_CTR_PGAIN(config->posGain) | OPAMP_OPAMP_CTR_BUFEN_MASK; - } - else - { - if ((uint32_t)(config->posGain) > 7UL) - { - base->OPAMP_CTR |= OPAMP_OPAMP_CTR_PGAIN((uint32_t)(config->posGain) - 7UL); - } - else - { - assert((uint32_t)(config->posGain) == 0UL); - base->OPAMP_CTR |= OPAMP_OPAMP_CTR_PGAIN(config->posGain); - } - } -#else - base->OPAMP_CTR |= OPAMP_OPAMP_CTR_PGAIN(config->posGain); -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_TRIGMD */ -} - -/*! - * brief De-initialize OPAMP instance. - * - * param base OPAMP peripheral base address. - */ -void OPAMP_Deinit(OPAMP_Type *base) -{ - /* Disable OPAMP instance. */ - base->OPAMP_CTR &= ~OPAMP_OPAMP_CTR_EN_MASK; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable the clock. */ - CLOCK_DisableClock(s_opampClocks[OPAMP_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Get default configuration of OPAMP. - * - * code - * config->enable = false; - * config->mode = kOPAMP_LowNoiseMode; - * config->trimOption = kOPAMP_TrimOptionDefault; - * config->intRefVoltage = kOPAMP_IntRefVoltVddaDiv2; - * config->enablePosADCSw = false; - * config->posRefVoltage = kOPAMP_PosRefVoltVrefh3; - * config->posGain = kOPAMP_PosGainReserved; - * config->negGain = kOPAMP_NegGainBufferMode; - * endcode - * - * param config The pointer to opamp_config_t. - */ -void OPAMP_GetDefaultConfig(opamp_config_t *config) -{ - assert(config != NULL); - - config->enable = false; - config->mode = kOPAMP_LowNoiseMode; - config->trimOption = kOPAMP_TrimOptionDefault; - config->intRefVoltage = kOPAMP_IntRefVoltVddaDiv2; - config->posRefVoltage = kOPAMP_PosRefVoltVrefh3; - config->posGain = kOPAMP_PosGainReserved; - config->negGain = kOPAMP_NegGainBufferMode; -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_OUTSW) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_OUTSW - config->enableOutputSwitch = true; -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_OUTSW */ -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW1) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW1 - config->enablePosADCSw1 = false; -#else - config->enablePosADCSw = false; -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW1 */ -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW2) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW2 - config->enablePosADCSw2 = false; -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW2 */ -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_BUFEN) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_BUFEN - config->enableRefBuffer = false; -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_BUFEN */ -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_INPSEL) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_INPSEL - config->PosInputChannelSelection = kOPAMP_PosInputChannel0; -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_INPSEL */ -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_TRIGMD) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_TRIGMD - config->enableTriggerMode = false; -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_TRIGMD */ -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_opamp.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_opamp.h deleted file mode 100644 index c9767193d0b..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_opamp.h +++ /dev/null @@ -1,301 +0,0 @@ -/* - * Copyright 2021-2022, 2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_OPAMP_H_ -#define FSL_OPAMP_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup opamp - * @{ - */ - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief OPAMP driver version. */ -#define FSL_OPAMP_DRIVER_VERSION (MAKE_VERSION(2, 2, 0)) -/*! @} */ - -/*! - * @brief The enumeration of OPAMP mode, including low noise mode and high speed mode. - */ -typedef enum _opamp_mode -{ - kOPAMP_LowNoiseMode = 0U, /*!< Set opamp mode as low noise mode. */ - kOPAMP_HighSpeedMode, /*!< Set opamp mode as high speed mode. */ -} opamp_mode_t; - -/*! - * @brief The enumeration of bias current trim option. - */ -typedef enum _opamp_bias_current_trim_option -{ - kOPAMP_TrimOptionDefault = 0U, /*!< Default Bias current trim option. */ - kOPAMP_TrimOptionIncreaseCurrent, /*!< Trim option selected as increase current. */ - kOPAMP_TrimOptionDecreaseCurrent, /*!< Trim option selected as decrease current. */ - kOPAMP_TrimOptionFurtherDecreaseCurrent, /*!< Trim option selected as further decrease current. */ -} opamp_bias_current_trim_option_t; - -/*! - * @brief The enumeration of internal reference voltage. - */ -typedef enum _opamp_internal_ref_voltage -{ - kOPAMP_IntRefVoltVddaDiv2 = 0U, /*!< Internal reference voltage selected as Vdda/2. */ - kOPAMP_IntRefVoltVdda3V, /*!< Internal reference voltage selected as Vdda_3V. */ - kOPAMP_IntRefVoltVssa3V, /*!< Internal reference voltage selected as Vssa_3V. */ - kOPAMP_IntRefVoltNotAllowed, /*!< Internal reference voltage not allowed. */ -} opamp_internal_ref_voltage_t; - -/*! - * @brief The enumeration of positive reference voltage(please refer to manual use). - */ -typedef enum _opamp_positive_ref_voltage -{ - kOPAMP_PosRefVoltVrefh3 = 0U, /*!< Positive part reference voltage select Vrefh3, connected from DAC output. */ - kOPAMP_PosRefVoltVrefh0 = 1U, /*!< Positive part reference voltage select Vrefh0, connected from VDDA supply. */ - kOPAMP_PosRefVoltVrefh1 = 2U, /*!< Positive part reference voltage select Vrefh1, - connected from Voltage reference output. */ - kOPAMP_PosRefVoltVrefh4 = 3U, /*!< Positive part reference voltage select 520mv or reserved.*/ -} opamp_positive_ref_voltage_t; - -/*! - * @brief The enumeration of positive programmable gain (please refer to manual use). - */ -typedef enum _opamp_positive_gain -{ - kOPAMP_PosGainReserved = 0U, /*!< Positive Gain reserved. */ - kOPAMP_PosGainNonInvert1X = 1U, /*!< Positive non-inverting gain application 1X. */ - kOPAMP_PosGainNonInvert2X = 2U, /*!< Positive non-inverting gain application 2X. */ - kOPAMP_PosGainNonInvert4X = 3U, /*!< Positive non-inverting gain application 4X. */ - kOPAMP_PosGainNonInvert8X = 4U, /*!< Positive non-inverting gain application 8X. */ - kOPAMP_PosGainNonInvert16X = 5U, /*!< Positive non-inverting gain application 16X. */ - kOPAMP_PosGainNonInvert33X = 6U, /*!< Positive non-inverting gain application 33X. */ - kOPAMP_PosGainNonInvert64X = 7U, /*!< Positive non-inverting gain application 64X. */ -#if defined(FSL_FEATURE_OPAMP_HAS_SUPPORT_REFERENCE_BUFFER) && FSL_FEATURE_OPAMP_HAS_SUPPORT_REFERENCE_BUFFER - /* The following gain selections are for basic OPAMP only, and signal inputs are - supported on the non-inverting and inverting terminals.*/ - kOPAMP_PosGainNonInvertDisableBuffer2X = 8U, /*!< Positive non-inverting gain application 2X. */ - kOPAMP_PosGainNonInvertDisableBuffer3X = 9U, /*!< Positive non-inverting gain application 3X. */ - kOPAMP_PosGainNonInvertDisableBuffer5X = 10U, /*!< Positive non-inverting gain application 5X. */ - kOPAMP_PosGainNonInvertDisableBuffer9X = 11U, /*!< Positive non-inverting gain application 9X. */ - kOPAMP_PosGainNonInvertDisableBuffer17X = 12U, /*!< Positive non-inverting gain application 17X. */ - kOPAMP_PosGainNonInvertDisableBuffer34X = 13U, /*!< Positive non-inverting gain application 34X. */ - kOPAMP_PosGainNonInvertDisableBuffer65X = 14U, /*!< Positive non-inverting gain application 65X. */ -#endif /* FSL_FEATURE_OPAMP_HAS_SUPPORT_REFERENCE_BUFFER */ -} opamp_positive_gain_t; - -/*! - * @brief The enumeration of negative programmable gain. - */ -typedef enum _opamp_negative_gain -{ - kOPAMP_NegGainBufferMode = 0U, /*!< Negative Buffer Mode. */ - kOPAMP_NegGainInvert1X, /*!< Negative inverting gain application -1X. */ - kOPAMP_NegGainInvert2X, /*!< Negative inverting gain application -2X. */ - kOPAMP_NegGainInvert4X, /*!< Negative inverting gain application -4X. */ - kOPAMP_NegGainInvert8X, /*!< Negative inverting gain application -8X. */ - kOPAMP_NegGainInvert16X, /*!< Negative inverting gain application -16X. */ - kOPAMP_NegGainInvert33X, /*!< Negative inverting gain application -33X. */ - kOPAMP_NegGainInvert64X, /*!< Negative inverting gain application -64X. */ -} opamp_negative_gain_t; - -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_INPSEL) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_INPSEL -/*! - * @brief The enumeration of positive input channel selection. - */ -typedef enum _opamp_positive_input_channel_selection -{ - kOPAMP_PosInputChannel0 = 0U, /*!< When OPAMP not in trigger mode, select positive input 0 (INP0).*/ - kOPAMP_PosInputChannel1 = 1U, /*!< When OPAMP not in trigger mode, select positive input 1 (INP1).*/ -} opamp_positive_input_channel_selection_t; -#endif -/*! - * @brief OPAMP configuraion, including mode, internal reference voltage, positive gain, negative gain and so on. - */ -typedef struct _opamp_config -{ - bool enable; /*!< Enable/disable OPAMP. */ - opamp_mode_t mode; /*!< Opamp mode, available values are @ref kOPAMP_LowNoiseMode and @ref kOPAMP_HighSpeedMode. */ - opamp_bias_current_trim_option_t trimOption; /*!< Bias current trim option, please refer to - @ref opamp_bias_current_trim_option_t. */ - opamp_internal_ref_voltage_t intRefVoltage; /*!< Internal reference voltage, please refer to - @ref opamp_internal_ref_voltage_t. */ - opamp_positive_ref_voltage_t posRefVoltage; /*!< Positive part reference voltage, please refer - to @ref opamp_positive_ref_voltage_t. */ - /* Positive part configuration. */ - opamp_positive_gain_t posGain; /*!< Positive part programmable gain, please refer - to @ref opamp_positive_gain_t. */ - /* Negative part configuration. */ - opamp_negative_gain_t negGain; /*!< Negative part programmable gain, please refer - to @ref opamp_negative_gain_t. */ -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_OUTSW) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_OUTSW - bool enableOutputSwitch; /*!< OPAMP out to negative gain resistor ladder switch.*/ -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_OUTSW */ -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW1) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW1 - bool enablePosADCSw1; /*!< Positive part reference voltage switch to ADC channel or not. - - \b true Positive part reference voltage switch to ADC channel. - - \b false Positive part reference voltage do not switch to ADC channel. */ -#else - bool enablePosADCSw; /*!< Positive part reference voltage switch to ADC channel or not. - - \b true Positive part reference voltage switch to ADC channel. - - \b false Positive part reference voltage do not switch to ADC channel. */ -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW1 */ -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW2) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW2 - bool enablePosADCSw2; /*!< Positive part reference voltage switch to ADC channel or not. - - \b true Positive part reference voltage switch to ADC channel. - - \b false Positive part reference voltage do not switch to ADC channel. */ -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW2 */ -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_BUFEN) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_BUFEN - bool enableRefBuffer; /*!< Reference buffer enable.*/ -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_BUFEN */ -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_INPSEL) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_INPSEL - opamp_positive_input_channel_selection_t PosInputChannelSelection; /*!< Positive Input Channel Selection*/ -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_INPSEL */ -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_TRIGMD) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_TRIGMD - bool enableTriggerMode; /*!< Trigger Mode Enable.*/ -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_TRIGMD */ -} opamp_config_t; - -/******************************************************************************* - * API - *******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Initialize OPAMP instance. - * - * @param base OPAMP peripheral base address. - * @param config The pointer to @ref opamp_config_t. - */ -void OPAMP_Init(OPAMP_Type *base, const opamp_config_t *config); - -/*! - * @brief De-initialize OPAMP instance. - * - * @param base OPAMP peripheral base address. - */ -void OPAMP_Deinit(OPAMP_Type *base); - -/*! - * @brief Get default configuration of OPAMP. - * - * @code - * config->enable = false; - * config->mode = kOPAMP_LowNoiseMode; - * config->trimOption = kOPAMP_TrimOptionDefault; - * config->intRefVoltage = kOPAMP_IntRefVoltVddaDiv2; - * config->enablePosADCSw = false; - * config->posRefVoltage = kOPAMP_PosRefVoltVrefh3; - * config->posGain = kOPAMP_PosGainReserved; - * config->negGain = kOPAMP_NegGainBufferMode; - * @endcode - * - * @param config The pointer to @ref opamp_config_t. - */ -void OPAMP_GetDefaultConfig(opamp_config_t *config); - -/*! @} */ - -/*! - * @name Positive port gain and negative gain configuration. - * @{ - */ -/*! - * @brief Configure OPAMP positive port gain. - * - * @param base OPAMP peripheral base address. - * @param option OPAMP positive port gain. - */ -static inline void OPAMP_DoPosGainConfig(OPAMP_Type *base, opamp_positive_gain_t option) -{ - base->OPAMP_CTR = (((base->OPAMP_CTR) & (~OPAMP_OPAMP_CTR_PGAIN_MASK)) | OPAMP_OPAMP_CTR_PGAIN(option)); -} - -/*! - * @brief Configure OPAMP negative port gain. - * - * @param base OPAMP peripheral base address. - * @param option OPAMP negative port gain. - */ -static inline void OPAMP_DoNegGainConfig(OPAMP_Type *base, opamp_negative_gain_t option) -{ - base->OPAMP_CTR = (((base->OPAMP_CTR) & (~OPAMP_OPAMP_CTR_NGAIN_MASK)) | OPAMP_OPAMP_CTR_NGAIN(option)); -} -/*! @} */ - -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_BUFEN) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_BUFEN -/*! - * @name Reference Buffer Control Interface - * @{ - */ - -/*! - * @brief Enable reference buffer. - * - * @param base OPAMP peripheral base address. - * @param enable true to enable and false to disable. - */ -static inline void OPAMP_EnableRefBuffer(OPAMP_Type *base, bool enable) -{ - if (enable) - { - base->OPAMP_CTR |= OPAMP_OPAMP_CTR_BUFEN_MASK; - } - else - { - base->OPAMP_CTR &= ~(uint32_t)OPAMP_OPAMP_CTR_BUFEN_MASK; - } -} -/*! @} */ -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_BUFEN */ - -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_TRIGMD) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_TRIGMD -/*! - * @name Trigger Mode Control Interface - * @{ - */ - -/*! - * @brief Enable OPAMP trigger mode. - * - * @param base OPAMP peripheral base address. - * @param enable true to enable and false to disable. - */ -static inline void OPAMP_EnableTriggerMode(OPAMP_Type *base, bool enable) -{ - if (enable) - { - base->OPAMP_CTR |= OPAMP_OPAMP_CTR_TRIGMD_MASK; - } - else - { - base->OPAMP_CTR &= ~(uint32_t)OPAMP_OPAMP_CTR_TRIGMD_MASK; - } -} -/*! @} */ -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_TRIGMD */ - -#if defined(__cplusplus) -} -#endif - -/*! @} */ - -#endif /* FSL_OPAMP_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_ostimer.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_ostimer.c deleted file mode 100644 index d978556afbc..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_ostimer.c +++ /dev/null @@ -1,384 +0,0 @@ -/* - * Copyright 2018-2021, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_ostimer.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.ostimer" -#endif - -#if defined(OSTIMER_RSTS) -#define OSTIMER_RESETS_ARRAY OSTIMER_RSTS -#endif - -/* Typedef for interrupt handler. */ -typedef void (*ostimer_isr_t)(OSTIMER_Type *base, ostimer_callback_t cb); - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Gets the instance from the base address - * - * @param base OSTIMER peripheral base address - * - * @return The OSTIMER instance - */ -static uint32_t OSTIMER_GetInstance(OSTIMER_Type *base); - -#if (defined(FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) && FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) -/* @brief Translate the value from gray-code to decimal by the Code Gray in SYSCTL. - * - * @param gray The gray value input. - * - * @return the decimal value. - */ -static uint64_t OSTIMER_GrayToDecimalbyCodeGray(uint64_t gray); -#endif /* FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY. */ - -/******************************************************************************* - * Variables - ******************************************************************************/ -/* Array of OSTIMER handle. */ -static ostimer_callback_t s_ostimerHandle[FSL_FEATURE_SOC_OSTIMER_COUNT]; -/* Array of OSTIMER peripheral base address. */ -static OSTIMER_Type *const s_ostimerBases[] = OSTIMER_BASE_PTRS; -/* Array of OSTIMER IRQ number. */ -static const IRQn_Type s_ostimerIRQ[] = OSTIMER_IRQS; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/* Array of OSTIMER clock name. */ -static const clock_ip_name_t s_ostimerClock[] = OSTIMER_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/* OSTIMER ISR for transactional APIs. */ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -static ostimer_isr_t s_ostimerIsr = (ostimer_isr_t)DefaultISR; -#else -static ostimer_isr_t s_ostimerIsr; -#endif - -#if defined(OSTIMER_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_ostimerResets[] = OSTIMER_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ - -/* @brief Function for getting the instance number of OS timer. */ -static uint32_t OSTIMER_GetInstance(OSTIMER_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_ostimerBases); instance++) - { - if (s_ostimerBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_ostimerBases)); - - return instance; -} - -#if (defined(FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) && FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) -/* @brief Translate the value from gray-code to decimal by the Code Gray in SYSCTL. - * - * @param gray The gray value input. - * - * @return the decimal value. - */ -static uint64_t OSTIMER_GrayToDecimalbyCodeGray(uint64_t gray) -{ - uint64_t decOut; - - SYSCTL->CODE_GRAY_LSB = (uint32_t)(gray & 0xFFFFFFFFU); - SYSCTL->CODE_GRAY_MSB = (uint32_t)((gray >> 32U) & 0x3FFU); // limit to 42bits as OSevent timer - __NOP(); - decOut = ((uint64_t)(SYSCTL->CODE_BIN_MSB) & 0x3FFU) << 32U; - decOut |= (uint64_t)(SYSCTL->CODE_BIN_LSB); - - return decOut; -} -#endif /* FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY. */ - -/* @brief Translate the value from gray-code to decimal. */ -/* - * @param gray The gray value input. - * - * @return the decimal value. - */ -uint64_t OSTIMER_GrayToDecimal(uint64_t gray) -{ -#if (defined(FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) && FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) - return OSTIMER_GrayToDecimalbyCodeGray(gray); -#else - uint64_t temp = gray; - while (temp != 0U) - { - temp >>= 1U; - gray ^= temp; - } - - return gray; -#endif /* FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY. */ -} - -/* @brief Enable the OSTIMER interrupt. - * - * After calling this function, the OSTIMER driver will enable/disable the IRQ and module interrupt enablement. - * - * @param base OSTIMER peripheral base address. - * @param enable enable/disable the IRQ and module interrupt enablement. - * - true: Disable the IRQ and module interrupt enablement. - * - false: Disable the IRQ and module interrupt enablement. - * @return none - */ -static void OSTIMER_EnableInterrupt(OSTIMER_Type *base, bool enable) -{ - assert(NULL != base); - - if (enable) - { - /* Enable the IRQ and module interrupt enablement. */ - (void)EnableIRQ(s_ostimerIRQ[OSTIMER_GetInstance(base)]); - base->OSEVENT_CTRL |= OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_MASK; - } - else - { - /* Clear interrupt flag, disable the IRQ and module interrupt enablement. */ - (void)DisableIRQ(s_ostimerIRQ[OSTIMER_GetInstance(base)]); - base->OSEVENT_CTRL &= ~OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_MASK; /* Clear interrupt flag by writing 1. */ - } -} - -/*! - * @brief Initializes an OSTIMER by turning it's clock on. - * - */ -void OSTIMER_Init(OSTIMER_Type *base) -{ - assert(NULL != base); - - uint32_t instance = OSTIMER_GetInstance(base); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#if !(defined(FSL_FEATURE_PMC_HAS_NO_OSTIMER_REG) && FSL_FEATURE_PMC_HAS_NO_OSTIMER_REG) - /* Enable the OSTIMER 32k clock in PMC module. */ - CLOCK_EnableOstimer32kClock(); -#endif - /* Enable clock for OSTIMER. */ - CLOCK_EnableClock(s_ostimerClock[instance]); -#if (defined(FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) && FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) - CLOCK_EnableClock(kCLOCK_Sysctl); -#endif /* FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY. */ -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(OSTIMER_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_ostimerResets[OSTIMER_GetInstance(base)]); -#endif -} - -/*! - * @brief Deinitializes a OSTIMER instance. - * - * This function shuts down OSTIMER clock - * - * @param base OSTIMER peripheral base address. - */ -void OSTIMER_Deinit(OSTIMER_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable clock for OSTIMER. */ - CLOCK_DisableClock(s_ostimerClock[OSTIMER_GetInstance(base)]); -#if (defined(FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) && FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) - CLOCK_DisableClock(kCLOCK_Sysctl); -#endif /* FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY. */ -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * @brief Get OSTIMER status Flags. - * - * This returns the status flag. - * Currently, only match interrupt flag can be got. - * - * @param base OSTIMER peripheral base address. - * @return status register value - */ -uint32_t OSTIMER_GetStatusFlags(OSTIMER_Type *base) -{ - return base->OSEVENT_CTRL & OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG_MASK; -} - -/*! - * @brief Clear Status Interrupt Flags. - * - * This clears intr status flag. - * Currently, only match interrupt flag can be cleared. - * - * @param base OSTIMER peripheral base address. - * @param mask Clear bit mask. - * @return none - */ -void OSTIMER_ClearStatusFlags(OSTIMER_Type *base, uint32_t mask) -{ - base->OSEVENT_CTRL |= mask; -} - -/*! - * @brief Set the match raw value for OSTIMER. - * - * This function will set a match value for OSTIMER with an optional callback. And this callback - * will be called while the data in dedicated pair match register is equals to the value of central EVTIMER. - * Please note that, the data format is gray-code, if decimal data was desired, please using OSTIMER_SetMatchValue(). - * - * @param base OSTIMER peripheral base address. - * @param count OSTIMER timer match value.(Value is gray-code format) - * - * @param cb OSTIMER callback (can be left as NULL if none, otherwise should be a void func(void)). - * @retval kStatus_Success - Set match raw value and enable interrupt Successfully. - * @retval kStatus_Fail - Set match raw value fail. - */ -status_t OSTIMER_SetMatchRawValue(OSTIMER_Type *base, uint64_t count, ostimer_callback_t cb) -{ -#ifdef OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK - uint64_t decValueTimer; -#endif - status_t status; - uint64_t tmp = count; - uint32_t instance = OSTIMER_GetInstance(base); - - /* Clear interrupt flag, disable the IRQ and module interrupt enablement. */ - OSTIMER_EnableInterrupt(base, false); - - s_ostimerIsr = OSTIMER_HandleIRQ; - s_ostimerHandle[instance] = cb; - - /* Set the match value. */ - base->MATCH_L = (uint32_t)tmp; - base->MATCH_H = (uint32_t)(tmp >> 32U); - -#ifdef OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK - /* Workaround-2019-12-30: - * Since OSTimer's counter register is Gray-encoded, it would cost more time to write register. When EVTimer Match - * Write Ready bit is low, which means the previous match value has been updated successfully by that time, it is - * safe to reload (write) the Match Registers. Even if there is the RM comment that "In typical applications, it - * should not be necessary to test this bit", but we found the interruption would not be reported when the delta - * timer user added is smaller(IE: RT595 11us in 1MHz typical application) in release version." To prevent such - * issue from happening, we'd better wait for the match value to update successfully before enabling IRQ. - */ - while (0U != (base->OSEVENT_CTRL & OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK)) - { - } - - /* After the WR_RDY bit became low, we need to check whether current time goes ahead of the match value we set. - * (1) If current timer value has gone ahead of the match value, the interrupt will not be reported before 64-bit - * timer value over flow. We need to check whether the interrupt flag has been set or not: if yes, we will enable - * interrupt and return success; if not, we will return fail directly. - * (2) If current timer value has not gone ahead of match value, we will enable interrupt and return success. - */ - decValueTimer = OSTIMER_GetCurrentTimerValue(base); - if ((decValueTimer >= OSTIMER_GrayToDecimal(tmp)) && - (0U == (base->OSEVENT_CTRL & (uint32_t)kOSTIMER_MatchInterruptFlag))) - { - status = kStatus_Fail; - } - else -#endif /* #ifdef OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK */ - { - /* Enable the module interrupt enablement. */ - OSTIMER_EnableInterrupt(base, true); - status = kStatus_Success; - } - - return status; -} - -/*! - * @brief Set the match value for OSTIMER. - * - * This function will set a match value for OSTIMER with an optional callback. And this callback - * will be called while the data in dedicated pair match register is equals to the value of central EVTIMER. - * - * @param base OSTIMER peripheral base address. - * @param count OSTIMER timer match value.(Value is decimal format, and this value will be translate to Gray code in - * API. ) - * @param cb OSTIMER callback (can be left as NULL if none, otherwise should be a void func(void)). - * @retval kStatus_Success - Set match value and enable interrupt Successfully. - * @retval kStatus_Fail - Set match value fail. - */ -status_t OSTIMER_SetMatchValue(OSTIMER_Type *base, uint64_t count, ostimer_callback_t cb) -{ - uint64_t tmp = OSTIMER_DecimalToGray(count); - - return OSTIMER_SetMatchRawValue(base, tmp, cb); -} - -/*! - * @brief Get current timer count value from OSTIMER. - * - * This function will get a decimal timer count value. - * The RAW value of timer count is gray code format, will be translated to decimal data internally. - * - * @param base OSTIMER peripheral base address. - * @return Value of OSTIMER which will formated to decimal value. - */ -uint64_t OSTIMER_GetCurrentTimerValue(OSTIMER_Type *base) -{ - uint64_t tmp = 0U; - - tmp = OSTIMER_GetCurrentTimerRawValue(base); - - return OSTIMER_GrayToDecimal(tmp); -} - -/*! - * @brief Get the capture value from OSTIMER. - * - * This function will get a capture decimal-value from OSTIMER. - * The RAW value of timer capture is gray code format, will be translated to decimal data internally. - * - * @param base OSTIMER peripheral base address. - * @return Value of capture register, data format is decimal. - */ -uint64_t OSTIMER_GetCaptureValue(OSTIMER_Type *base) -{ - uint64_t tmp = 0U; - - tmp = OSTIMER_GetCaptureRawValue(base); - - return OSTIMER_GrayToDecimal(tmp); -} - -void OSTIMER_HandleIRQ(OSTIMER_Type *base, ostimer_callback_t cb) -{ - /* Clear interrupt flag, disable the IRQ and module interrupt enablement. */ - OSTIMER_EnableInterrupt(base, false); - - if (cb != NULL) - { - cb(); - } -} - -void OS_EVENT_DriverIRQHandler(void); -void OS_EVENT_DriverIRQHandler(void) -{ - s_ostimerIsr(s_ostimerBases[0], s_ostimerHandle[0]); - SDK_ISR_EXIT_BARRIER; -} - diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_ostimer.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_ostimer.h deleted file mode 100644 index 51b1f45503f..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_ostimer.h +++ /dev/null @@ -1,273 +0,0 @@ -/* - * Copyright 2018-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_OSTIMER_H_ -#define FSL_OSTIMER_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup ostimer - * @{ - */ - -/*! @file*/ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief OSTIMER driver version. */ -#define FSL_OSTIMER_DRIVER_VERSION (MAKE_VERSION(2, 2, 2)) -/*! @} */ - -/*! - * @brief OSTIMER status flags. - */ -enum _ostimer_flags -{ - kOSTIMER_MatchInterruptFlag = (OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG_MASK), /*!< Match interrupt flag bit, sets if - the match value was reached. */ -}; - -/*! @brief ostimer callback function. */ -typedef void (*ostimer_callback_t)(void); - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* _cplusplus */ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Initializes an OSTIMER by turning its bus clock on - * - */ -void OSTIMER_Init(OSTIMER_Type *base); - -/*! - * @brief Deinitializes a OSTIMER instance. - * - * This function shuts down OSTIMER bus clock - * - * @param base OSTIMER peripheral base address. - */ -void OSTIMER_Deinit(OSTIMER_Type *base); - -/*! - * @brief Translate the value from gray-code to decimal. - * - * @param gray The gray value input. - * @return The decimal value. - */ -uint64_t OSTIMER_GrayToDecimal(uint64_t gray); - -/*! - * @brief Translate the value from decimal to gray-code. - * - * @param dec The decimal value. - * @return The gray code of the input value. - */ -static inline uint64_t OSTIMER_DecimalToGray(uint64_t dec) -{ - return (dec ^ (dec >> 1U)); -} - -/*! - * @brief Get OSTIMER status Flags. - * - * This returns the status flag. - * Currently, only match interrupt flag can be got. - * - * @param base OSTIMER peripheral base address. - * @return status register value - */ -uint32_t OSTIMER_GetStatusFlags(OSTIMER_Type *base); - -/*! - * @brief Clear Status Interrupt Flags. - * - * This clears intrrupt status flag. - * Currently, only match interrupt flag can be cleared. - * - * @param base OSTIMER peripheral base address. - * @param mask Clear bit mask. - * @return none - */ -void OSTIMER_ClearStatusFlags(OSTIMER_Type *base, uint32_t mask); - -/*! - * @brief Set the match raw value for OSTIMER. - * - * This function will set a match value for OSTIMER with an optional callback. And this callback - * will be called while the data in dedicated pair match register is equals to the value of central EVTIMER. - * Please note that, the data format is gray-code, if decimal data was desired, please using OSTIMER_SetMatchValue(). - * - * @param base OSTIMER peripheral base address. - * @param count OSTIMER timer match value.(Value is gray-code format) - * - * @param cb OSTIMER callback (can be left as NULL if none, otherwise should be a void func(void)). - * @retval kStatus_Success - Set match raw value and enable interrupt Successfully. - * @retval kStatus_Fail - Set match raw value fail. - */ -status_t OSTIMER_SetMatchRawValue(OSTIMER_Type *base, uint64_t count, ostimer_callback_t cb); - -/*! - * @brief Set the match value for OSTIMER. - * - * This function will set a match value for OSTIMER with an optional callback. And this callback - * will be called while the data in dedicated pair match register is equals to the value of central OS TIMER. - * - * @param base OSTIMER peripheral base address. - * @param count OSTIMER timer match value.(Value is decimal format, and this value will be translate to Gray code - * internally.) - * - * @param cb OSTIMER callback (can be left as NULL if none, otherwise should be a void func(void)). - * @retval kStatus_Success - Set match value and enable interrupt Successfully. - * @retval kStatus_Fail - Set match value fail. - */ -status_t OSTIMER_SetMatchValue(OSTIMER_Type *base, uint64_t count, ostimer_callback_t cb); - -/*! - * @brief Set value to OSTIMER MATCH register directly. - * - * This function writes the input value to OSTIMER MATCH register directly, - * it does not touch any other registers. Note that, the data format is - * gray-code. The function @ref OSTIMER_DecimalToGray could convert decimal - * value to gray code. - * - * @param base OSTIMER peripheral base address. - * @param value OSTIMER timer match value (Value is gray-code format). - */ -static inline void OSTIMER_SetMatchRegister(OSTIMER_Type *base, uint64_t value) -{ -#ifdef OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK - /* Wait for MATCH register ready for write. */ - while (0U != (base->OSEVENT_CTRL & OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK)) - { - } -#endif - - base->MATCH_L = (uint32_t)value; - base->MATCH_H = (uint32_t)(value >> 32U); -} - -/*! - * @brief Enable the OSTIMER counter match interrupt. - * - * Enable the timer counter match interrupt. The interrupt happens when OSTIMER - * counter matches the value in MATCH registers. - * - * @param base OSTIMER peripheral base address. - */ -static inline void OSTIMER_EnableMatchInterrupt(OSTIMER_Type *base) -{ - base->OSEVENT_CTRL |= OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_MASK; -} - -/*! - * @brief Disable the OSTIMER counter match interrupt. - * - * Disable the timer counter match interrupt. The interrupt happens when OSTIMER - * counter matches the value in MATCH registers. - * - * @param base OSTIMER peripheral base address. - */ -static inline void OSTIMER_DisableMatchInterrupt(OSTIMER_Type *base) -{ - base->OSEVENT_CTRL &= ~OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_MASK; -} - -/*! - * @brief Get current timer raw count value from OSTIMER. - * - * This function will get a gray code type timer count value from OS timer register. - * The raw value of timer count is gray code format. - * - * @param base OSTIMER peripheral base address. - * @return Raw value of OSTIMER, gray code format. - */ -static inline uint64_t OSTIMER_GetCurrentTimerRawValue(OSTIMER_Type *base) -{ - uint64_t tmp = 0U; - - tmp = base->EVTIMERL; - tmp |= (uint64_t)(base->EVTIMERH) << 32U; - - return tmp; -} - -/*! - * @brief Get current timer count value from OSTIMER. - * - * This function will get a decimal timer count value. - * The RAW value of timer count is gray code format, will be translated to decimal data internally. - * - * @param base OSTIMER peripheral base address. - * @return Value of OSTIMER which will be formated to decimal value. - */ -uint64_t OSTIMER_GetCurrentTimerValue(OSTIMER_Type *base); - -/*! - * @brief Get the capture value from OSTIMER. - * - * This function will get a captured gray-code value from OSTIMER. - * The Raw value of timer capture is gray code format. - * - * @param base OSTIMER peripheral base address. - * @return Raw value of capture register, data format is gray code. - */ -static inline uint64_t OSTIMER_GetCaptureRawValue(OSTIMER_Type *base) -{ - uint64_t tmp = 0U; - - tmp = base->CAPTURE_L; - tmp |= (uint64_t)(base->CAPTURE_H) << 32U; - - return tmp; -} - -/*! - * @brief Get the capture value from OSTIMER. - * - * This function will get a capture decimal-value from OSTIMER. - * The RAW value of timer capture is gray code format, will be translated to decimal data internally. - * - * @param base OSTIMER peripheral base address. - * @return Value of capture register, data format is decimal. - */ -uint64_t OSTIMER_GetCaptureValue(OSTIMER_Type *base); - -/*! - * @brief OS timer interrupt Service Handler. - * - * This function handles the interrupt and refers to the callback array in the driver to callback user (as per request - * in OSTIMER_SetMatchValue()). - * if no user callback is scheduled, the interrupt will simply be cleared. - * - * @param base OS timer peripheral base address. - * @param cb callback scheduled for this instance of OS timer - * @return none - */ -void OSTIMER_HandleIRQ(OSTIMER_Type *base, ostimer_callback_t cb); -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_OSTIMER_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_port.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_port.h deleted file mode 100644 index 8eb512969d8..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_port.h +++ /dev/null @@ -1,684 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022, 2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_PORT_H_ -#define FSL_PORT_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup port - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.port" -#endif - -/*! @name Driver version */ -/*! @{ */ -/*! @brief PORT driver version. */ -#define FSL_PORT_DRIVER_VERSION (MAKE_VERSION(2, 5, 0)) -/*! @} */ - -#if defined(FSL_FEATURE_PORT_HAS_PULL_ENABLE) && FSL_FEATURE_PORT_HAS_PULL_ENABLE -/*! @brief Internal resistor pull feature selection */ -enum _port_pull -{ - kPORT_PullDisable = 0U, /*!< Internal pull-up/down resistor is disabled. */ - kPORT_PullDown = 2U, /*!< Internal pull-down resistor is enabled. */ - kPORT_PullUp = 3U, /*!< Internal pull-up resistor is enabled. */ -}; -#endif /* FSL_FEATURE_PORT_HAS_PULL_ENABLE */ - -#if defined(FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE) && FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE -/*! @brief Internal resistor pull value selection */ -enum _port_pull_value -{ - kPORT_LowPullResistor = 0U, /*!< Low internal pull resistor value is selected. */ - kPORT_HighPullResistor = 1U, /*!< High internal pull resistor value is selected. */ -}; -#endif /* FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE */ - -#if defined(FSL_FEATURE_PORT_HAS_SLEW_RATE) && FSL_FEATURE_PORT_HAS_SLEW_RATE -/*! @brief Slew rate selection */ -enum _port_slew_rate -{ - kPORT_FastSlewRate = 0U, /*!< Fast slew rate is configured. */ - kPORT_SlowSlewRate = 1U, /*!< Slow slew rate is configured. */ -}; -#endif /* FSL_FEATURE_PORT_HAS_SLEW_RATE */ - -#if defined(FSL_FEATURE_PORT_HAS_OPEN_DRAIN) && FSL_FEATURE_PORT_HAS_OPEN_DRAIN -/*! @brief Open Drain feature enable/disable */ -enum _port_open_drain_enable -{ - kPORT_OpenDrainDisable = 0U, /*!< Open drain output is disabled. */ - kPORT_OpenDrainEnable = 1U, /*!< Open drain output is enabled. */ -}; -#endif /* FSL_FEATURE_PORT_HAS_OPEN_DRAIN */ - -#if defined(FSL_FEATURE_PORT_HAS_PASSIVE_FILTER) && FSL_FEATURE_PORT_HAS_PASSIVE_FILTER -/*! @brief Passive filter feature enable/disable */ -enum _port_passive_filter_enable -{ - kPORT_PassiveFilterDisable = 0U, /*!< Passive input filter is disabled. */ - kPORT_PassiveFilterEnable = 1U, /*!< Passive input filter is enabled. */ -}; -#endif - -#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH -/*! @brief Configures the drive strength. */ -enum _port_drive_strength -{ - kPORT_LowDriveStrength = 0U, /*!< Low-drive strength is configured. */ - kPORT_HighDriveStrength = 1U, /*!< High-drive strength is configured. */ -}; -#endif /* FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH */ - -#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1 -/*! @brief Configures the drive strength1. */ -enum _port_drive_strength1 -{ - kPORT_NormalDriveStrength = 0U, /*!< Normal drive strength */ - kPORT_DoubleDriveStrength = 1U, /*!< Double drive strength */ -}; -#endif /* FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1 */ - -#if defined(FSL_FEATURE_PORT_HAS_INPUT_BUFFER) && FSL_FEATURE_PORT_HAS_INPUT_BUFFER -/*! @brief input buffer disable/enable. */ -enum _port_input_buffer -{ - kPORT_InputBufferDisable = 0U, /*!< Digital input is disabled */ - kPORT_InputBufferEnable = 1U, /*!< Digital input is enabled */ -}; -#endif /* FSL_FEATURE_PORT_HAS_INPUT_BUFFER */ - -#if defined(FSL_FEATURE_PORT_HAS_INVERT_INPUT) && FSL_FEATURE_PORT_HAS_INVERT_INPUT -/*! @brief Digital input is not inverted or it is inverted. */ -enum _port_invet_input -{ - kPORT_InputNormal = 0U, /*!< Digital input is not inverted */ - kPORT_InputInvert = 1U, /*!< Digital input is inverted */ -}; -#endif /* FSL_FEATURE_PORT_HAS_INVERT_INPUT */ - -#if defined(FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK) && FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK -/*! @brief Unlock/lock the pin control register field[15:0] */ -enum _port_lock_register -{ - kPORT_UnlockRegister = 0U, /*!< Pin Control Register fields [15:0] are not locked. */ - kPORT_LockRegister = 1U, /*!< Pin Control Register fields [15:0] are locked. */ -}; -#endif /* FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK */ - -#if defined(FSL_FEATURE_PORT_PCR_MUX_WIDTH) && FSL_FEATURE_PORT_PCR_MUX_WIDTH -/*! @brief Pin mux selection */ -typedef enum _port_mux -{ -#if defined(FSL_FEATURE_PORT_PCR_MUX_GPIO) && (FSL_FEATURE_PORT_PCR_MUX_GPIO == 0) - kPORT_MuxAsGpio = 0U, /*!< Corresponding pin is configured as GPIO. */ -#else - kPORT_PinDisabledOrAnalog = 0U, /*!< Corresponding pin is disabled, but is used as an analog pin. */ - kPORT_MuxAsGpio = 1U, /*!< Corresponding pin is configured as GPIO. */ -#endif - kPORT_MuxAlt0 = 0U, /*!< Chip-specific */ - kPORT_MuxAlt1 = 1U, /*!< Chip-specific */ - kPORT_MuxAlt2 = 2U, /*!< Chip-specific */ - kPORT_MuxAlt3 = 3U, /*!< Chip-specific */ - kPORT_MuxAlt4 = 4U, /*!< Chip-specific */ - kPORT_MuxAlt5 = 5U, /*!< Chip-specific */ - kPORT_MuxAlt6 = 6U, /*!< Chip-specific */ - kPORT_MuxAlt7 = 7U, /*!< Chip-specific */ - kPORT_MuxAlt8 = 8U, /*!< Chip-specific */ - kPORT_MuxAlt9 = 9U, /*!< Chip-specific */ - kPORT_MuxAlt10 = 10U, /*!< Chip-specific */ - kPORT_MuxAlt11 = 11U, /*!< Chip-specific */ - kPORT_MuxAlt12 = 12U, /*!< Chip-specific */ - kPORT_MuxAlt13 = 13U, /*!< Chip-specific */ - kPORT_MuxAlt14 = 14U, /*!< Chip-specific */ - kPORT_MuxAlt15 = 15U, /*!< Chip-specific */ -} port_mux_t; -#endif /* FSL_FEATURE_PORT_PCR_MUX_WIDTH */ - -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) -/*! @brief Configures the interrupt generation condition. */ -typedef enum _port_interrupt -{ - kPORT_InterruptOrDMADisabled = 0x0U, /*!< Interrupt/DMA request is disabled. */ -#if defined(FSL_FEATURE_PORT_HAS_DMA_REQUEST) && FSL_FEATURE_PORT_HAS_DMA_REQUEST || defined(DOXYGEN_OUTPUT) - kPORT_DMARisingEdge = 0x1U, /*!< DMA request on rising edge. */ - kPORT_DMAFallingEdge = 0x2U, /*!< DMA request on falling edge. */ - kPORT_DMAEitherEdge = 0x3U, /*!< DMA request on either edge. */ -#endif -#if defined(FSL_FEATURE_PORT_HAS_IRQC_FLAG) && FSL_FEATURE_PORT_HAS_IRQC_FLAG || defined(DOXYGEN_OUTPUT) - kPORT_FlagRisingEdge = 0x05U, /*!< Flag sets on rising edge. */ - kPORT_FlagFallingEdge = 0x06U, /*!< Flag sets on falling edge. */ - kPORT_FlagEitherEdge = 0x07U, /*!< Flag sets on either edge. */ -#endif - kPORT_InterruptLogicZero = 0x8U, /*!< Interrupt when logic zero. */ - kPORT_InterruptRisingEdge = 0x9U, /*!< Interrupt on rising edge. */ - kPORT_InterruptFallingEdge = 0xAU, /*!< Interrupt on falling edge. */ - kPORT_InterruptEitherEdge = 0xBU, /*!< Interrupt on either edge. */ - kPORT_InterruptLogicOne = 0xCU, /*!< Interrupt when logic one. */ -#if defined(FSL_FEATURE_PORT_HAS_IRQC_TRIGGER) && FSL_FEATURE_PORT_HAS_IRQC_TRIGGER || defined(DOXYGEN_OUTPUT) - kPORT_ActiveHighTriggerOutputEnable = 0xDU, /*!< Enable active high-trigger output. */ - kPORT_ActiveLowTriggerOutputEnable = 0xEU, /*!< Enable active low-trigger output. */ -#endif -} port_interrupt_t; -#endif - -#if defined(FSL_FEATURE_PORT_HAS_DIGITAL_FILTER) && FSL_FEATURE_PORT_HAS_DIGITAL_FILTER -/*! @brief Digital filter clock source selection */ -typedef enum _port_digital_filter_clock_source -{ - kPORT_BusClock = 0U, /*!< Digital filters are clocked by the bus clock. */ - kPORT_LpoClock = 1U, /*!< Digital filters are clocked by the 1 kHz LPO clock. */ -} port_digital_filter_clock_source_t; - -/*! @brief PORT digital filter feature configuration definition */ -typedef struct _port_digital_filter_config -{ - uint32_t digitalFilterWidth; /*!< Set digital filter width */ - port_digital_filter_clock_source_t clockSource; /*!< Set digital filter clockSource */ -} port_digital_filter_config_t; -#endif /* FSL_FEATURE_PORT_HAS_DIGITAL_FILTER */ - -#if defined(FSL_FEATURE_PORT_PCR_MUX_WIDTH) && FSL_FEATURE_PORT_PCR_MUX_WIDTH -/*! @brief PORT pin configuration structure */ -typedef struct _port_pin_config -{ -#if defined(FSL_FEATURE_PORT_HAS_PULL_ENABLE) && FSL_FEATURE_PORT_HAS_PULL_ENABLE - uint16_t pullSelect : 2; /*!< No-pull/pull-down/pull-up select */ -#else - uint16_t : 2; -#endif /* FSL_FEATURE_PORT_HAS_PULL_ENABLE */ - -#if defined(FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE) && FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE - uint16_t pullValueSelect : 1; /*!< Pull value select */ -#endif /* FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE */ - -#if defined(FSL_FEATURE_PORT_HAS_SLEW_RATE) && FSL_FEATURE_PORT_HAS_SLEW_RATE - uint16_t slewRate : 1; /*!< Fast/slow slew rate Configure */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_SLEW_RATE */ - -#if !(defined(FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE) && FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE) - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE */ - -#if defined(FSL_FEATURE_PORT_HAS_PASSIVE_FILTER) && FSL_FEATURE_PORT_HAS_PASSIVE_FILTER - uint16_t passiveFilterEnable : 1; /*!< Passive filter enable/disable */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_PASSIVE_FILTER */ - -#if defined(FSL_FEATURE_PORT_HAS_OPEN_DRAIN) && FSL_FEATURE_PORT_HAS_OPEN_DRAIN - uint16_t openDrainEnable : 1; /*!< Open drain enable/disable */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_OPEN_DRAIN */ - -#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH - uint16_t driveStrength : 1; /*!< Fast/slow drive strength configure */ -#else - uint16_t : 1; -#endif - -#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1 - uint16_t driveStrength1 : 1; /*!< Normal/Double drive strength enable/disable */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1 */ - -#if defined(FSL_FEATURE_PORT_PCR_MUX_WIDTH) && (FSL_FEATURE_PORT_PCR_MUX_WIDTH == 3) - uint16_t mux : 3; /*!< Pin mux Configure */ - uint16_t : 1; -#elif defined(FSL_FEATURE_PORT_PCR_MUX_WIDTH) && (FSL_FEATURE_PORT_PCR_MUX_WIDTH == 4) - uint16_t mux : 4; /*!< Pin mux Configure */ -#else - uint16_t : 4; -#endif - -#if defined(FSL_FEATURE_PORT_HAS_INPUT_BUFFER) && FSL_FEATURE_PORT_HAS_INPUT_BUFFER - uint16_t inputBuffer : 1; /*!< Input Buffer Configure */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_INPUT_BUFFER */ - -#if defined(FSL_FEATURE_PORT_HAS_INVERT_INPUT) && FSL_FEATURE_PORT_HAS_INVERT_INPUT - uint16_t invertInput : 1; /*!< Invert Input Configure */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_INVERT_INPUT */ - - uint16_t : 1; - -#if defined(FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK) && FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK - uint16_t lockRegister : 1; /*!< Lock/unlock the PCR field[15:0] */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK */ -} port_pin_config_t; -#endif /* FSL_FEATURE_PORT_PCR_MUX_WIDTH */ - -#if defined(FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER) && FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER -/*! @brief PORT version information. */ -typedef struct _port_version_info -{ - uint16_t feature; /*!< Feature Specification Number. */ - uint8_t minor; /*!< Minor Version Number. */ - uint8_t major; /*!< Major Version Number. */ -} port_version_info_t; -#endif /* FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER */ - -#if defined(FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE) && FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE -/*! @brief PORT voltage range. */ -typedef enum _port_voltage_range -{ - kPORT_VoltageRange1Dot71V_3Dot6V = 0x0U, /*!< Port voltage range is 1.71 V - 3.6 V. */ - kPORT_VoltageRange2Dot70V_3Dot6V = 0x1U, /*!< Port voltage range is 2.70 V - 3.6 V. */ -} port_voltage_range_t; -#endif /* FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! @name Configuration */ -/*! @{ */ - -#if defined(FSL_FEATURE_PORT_PCR_MUX_WIDTH) && FSL_FEATURE_PORT_PCR_MUX_WIDTH - -#if defined(FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER) && FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER -/*! - * @brief Get PORT version information. - * - * @param base PORT peripheral base pointer - * @param info PORT version information - */ -static inline void PORT_GetVersionInfo(PORT_Type *base, port_version_info_t *info) -{ - uint32_t verid = base->VERID; - info->feature = (uint16_t)verid; - info->minor = (uint8_t)(verid >> PORT_VERID_MINOR_SHIFT); - info->major = (uint8_t)(verid >> PORT_VERID_MAJOR_SHIFT); -} -#endif /* FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER */ - -#if defined(FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE) && FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE -/*! - * @brief Get PORT version information. - * - * @note : PORTA_CONFIG[RANGE] controls the voltage ranges of Port A, B, and C. Read or write PORTB_CONFIG[RANGE] and - * PORTC_CONFIG[RANGE] does not take effect. - * - * @param base PORT peripheral base pointer - * @param range port voltage range - */ -static inline void PORT_SecletPortVoltageRange(PORT_Type *base, port_voltage_range_t range) -{ - base->CONFIG = (uint32_t)range; -} -#endif /* FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE */ - -/*! - * @brief Sets the port PCR register. - * - * This is an example to define an input pin or output pin PCR configuration. - * @code - * // Define a digital input pin PCR configuration - * port_pin_config_t config = { - * kPORT_PullUp, - * kPORT_FastSlewRate, - * kPORT_PassiveFilterDisable, - * kPORT_OpenDrainDisable, - * kPORT_LowDriveStrength, - * kPORT_MuxAsGpio, - * kPORT_UnLockRegister, - * }; - * @endcode - * - * @param base PORT peripheral base pointer. - * @param pin PORT pin number. - * @param config PORT PCR register configuration structure. - */ -static inline void PORT_SetPinConfig(PORT_Type *base, uint32_t pin, const port_pin_config_t *config) -{ - assert(config); - uint32_t addr = (uint32_t)&base->PCR[pin]; - *(volatile uint16_t *)(addr) = *((const uint16_t *)(const void *)config); -} - -/*! - * @brief Sets the port PCR register for multiple pins. - * - * This is an example to define input pins or output pins PCR configuration. - * @code - * Define a digital input pin PCR configuration - * port_pin_config_t config = { - * kPORT_PullUp , - * kPORT_PullEnable, - * kPORT_FastSlewRate, - * kPORT_PassiveFilterDisable, - * kPORT_OpenDrainDisable, - * kPORT_LowDriveStrength, - * kPORT_MuxAsGpio, - * kPORT_UnlockRegister, - * }; - * @endcode - * - * @param base PORT peripheral base pointer. - * @param mask PORT pin number macro. - * @param config PORT PCR register configuration structure. - */ -static inline void PORT_SetMultiplePinsConfig(PORT_Type *base, uint32_t mask, const port_pin_config_t *config) -{ - assert(config); - - uint16_t pcrl = *((const uint16_t *)(const void *)config); - - if (0U != (mask & 0xffffU)) - { - base->GPCLR = ((mask & 0xffffU) << 16) | pcrl; - } - if (0U != (mask >> 16)) - { - base->GPCHR = (mask & 0xffff0000U) | pcrl; - } -} - -#if defined(FSL_FEATURE_PORT_HAS_MULTIPLE_IRQ_CONFIG) && FSL_FEATURE_PORT_HAS_MULTIPLE_IRQ_CONFIG -/*! - * @brief Sets the port interrupt configuration in PCR register for multiple pins. - * - * @param base PORT peripheral base pointer. - * @param mask PORT pin number macro. - * @param config PORT pin interrupt configuration. - * - #kPORT_InterruptOrDMADisabled: Interrupt/DMA request disabled. - * - #kPORT_DMARisingEdge : DMA request on rising edge(if the DMA requests exit). - * - #kPORT_DMAFallingEdge: DMA request on falling edge(if the DMA requests exit). - * - #kPORT_DMAEitherEdge : DMA request on either edge(if the DMA requests exit). - * - #kPORT_FlagRisingEdge : Flag sets on rising edge(if the Flag states exit). - * - #kPORT_FlagFallingEdge : Flag sets on falling edge(if the Flag states exit). - * - #kPORT_FlagEitherEdge : Flag sets on either edge(if the Flag states exit). - * - #kPORT_InterruptLogicZero : Interrupt when logic zero. - * - #kPORT_InterruptRisingEdge : Interrupt on rising edge. - * - #kPORT_InterruptFallingEdge: Interrupt on falling edge. - * - #kPORT_InterruptEitherEdge : Interrupt on either edge. - * - #kPORT_InterruptLogicOne : Interrupt when logic one. - * - #kPORT_ActiveHighTriggerOutputEnable : Enable active high-trigger output (if the trigger states exit). - * - #kPORT_ActiveLowTriggerOutputEnable : Enable active low-trigger output (if the trigger states exit).. - */ -static inline void PORT_SetMultipleInterruptPinsConfig(PORT_Type *base, uint32_t mask, port_interrupt_t config) -{ - assert(config); - - if (0U != ((uint32_t)mask & 0xffffU)) - { - base->GICLR = ((uint32_t)config << 16U) | ((uint32_t)mask & 0xffffU); - } - mask = mask >> 16; - if (0U != mask) - { - base->GICHR = ((uint32_t)config << 16U) | ((uint32_t)mask & 0xffffU); - } -} -#endif - -/*! - * @brief Configures the pin muxing. - * - * @param base PORT peripheral base pointer. - * @param pin PORT pin number. - * @param mux pin muxing slot selection. - * - #kPORT_PinDisabledOrAnalog: Pin disabled or work in analog function. - * - #kPORT_MuxAsGpio : Set as GPIO. - * - #kPORT_MuxAlt2 : chip-specific. - * - #kPORT_MuxAlt3 : chip-specific. - * - #kPORT_MuxAlt4 : chip-specific. - * - #kPORT_MuxAlt5 : chip-specific. - * - #kPORT_MuxAlt6 : chip-specific. - * - #kPORT_MuxAlt7 : chip-specific. - * @note : This function is NOT recommended to use together with the PORT_SetPinsConfig, because - * the PORT_SetPinsConfig need to configure the pin mux anyway (Otherwise the pin mux is - * reset to zero : kPORT_PinDisabledOrAnalog). - * This function is recommended to use to reset the pin mux - * - */ -static inline void PORT_SetPinMux(PORT_Type *base, uint32_t pin, port_mux_t mux) -{ - base->PCR[pin] = (base->PCR[pin] & ~PORT_PCR_MUX_MASK) | PORT_PCR_MUX(mux); -} -#endif /* FSL_FEATURE_PORT_PCR_MUX_WIDTH */ - -#if defined(FSL_FEATURE_PORT_HAS_DIGITAL_FILTER) && FSL_FEATURE_PORT_HAS_DIGITAL_FILTER - -/*! - * @brief Enables the digital filter in one port, each bit of the 32-bit register represents one pin. - * - * @param base PORT peripheral base pointer. - * @param mask PORT pin number macro. - * @param enable PORT digital filter configuration. - */ -static inline void PORT_EnablePinsDigitalFilter(PORT_Type *base, uint32_t mask, bool enable) -{ - if (enable == true) - { - base->DFER |= mask; - } - else - { - base->DFER &= ~mask; - } -} - -/*! - * @brief Sets the digital filter in one port, each bit of the 32-bit register represents one pin. - * - * @param base PORT peripheral base pointer. - * @param config PORT digital filter configuration structure. - */ -static inline void PORT_SetDigitalFilterConfig(PORT_Type *base, const port_digital_filter_config_t *config) -{ - assert(config); - - base->DFCR = PORT_DFCR_CS(config->clockSource); - base->DFWR = PORT_DFWR_FILT(config->digitalFilterWidth); -} - -#endif /* FSL_FEATURE_PORT_HAS_DIGITAL_FILTER */ -/*! @} */ - -/*! @name Interrupt */ -/*! @{ */ - -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) -/*! - * @brief Configures the port pin interrupt/DMA request. - * - * @param base PORT peripheral base pointer. - * @param pin PORT pin number. - * @param config PORT pin interrupt configuration. - * - #kPORT_InterruptOrDMADisabled: Interrupt/DMA request disabled. - * - #kPORT_DMARisingEdge : DMA request on rising edge(if the DMA requests exit). - * - #kPORT_DMAFallingEdge: DMA request on falling edge(if the DMA requests exit). - * - #kPORT_DMAEitherEdge : DMA request on either edge(if the DMA requests exit). - * - #kPORT_FlagRisingEdge : Flag sets on rising edge(if the Flag states exit). - * - #kPORT_FlagFallingEdge : Flag sets on falling edge(if the Flag states exit). - * - #kPORT_FlagEitherEdge : Flag sets on either edge(if the Flag states exit). - * - #kPORT_InterruptLogicZero : Interrupt when logic zero. - * - #kPORT_InterruptRisingEdge : Interrupt on rising edge. - * - #kPORT_InterruptFallingEdge: Interrupt on falling edge. - * - #kPORT_InterruptEitherEdge : Interrupt on either edge. - * - #kPORT_InterruptLogicOne : Interrupt when logic one. - * - #kPORT_ActiveHighTriggerOutputEnable : Enable active high-trigger output (if the trigger states exit). - * - #kPORT_ActiveLowTriggerOutputEnable : Enable active low-trigger output (if the trigger states exit). - */ -static inline void PORT_SetPinInterruptConfig(PORT_Type *base, uint32_t pin, port_interrupt_t config) -{ - base->PCR[pin] = (base->PCR[pin] & ~PORT_PCR_IRQC_MASK) | PORT_PCR_IRQC(config); -} -#endif - -#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH -/*! - * @brief Configures the port pin drive strength. - * - * @param base PORT peripheral base pointer. - * @param pin PORT pin number. - * @param strength PORT pin drive strength - * - #kPORT_LowDriveStrength = 0U - Low-drive strength is configured. - * - #kPORT_HighDriveStrength = 1U - High-drive strength is configured. - */ -static inline void PORT_SetPinDriveStrength(PORT_Type *base, uint32_t pin, uint8_t strength) -{ - base->PCR[pin] = (base->PCR[pin] & ~PORT_PCR_DSE_MASK) | PORT_PCR_DSE(strength); -} -#endif - -#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1 -/*! - * @brief Enables the port pin double drive strength. - * - * @param base PORT peripheral base pointer. - * @param pin PORT pin number. - * @param enable PORT pin drive strength configuration. - */ -static inline void PORT_EnablePinDoubleDriveStrength(PORT_Type *base, uint32_t pin, bool enable) -{ - base->PCR[pin] = (base->PCR[pin] & ~PORT_PCR_DSE1_MASK) | PORT_PCR_DSE1(enable); -} -#endif - -#if defined(FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE) && FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE -/*! - * @brief Configures the port pin pull value. - * - * @param base PORT peripheral base pointer. - * @param pin PORT pin number. - * @param value PORT pin pull value - * - #kPORT_LowPullResistor = 0U - Low internal pull resistor value is selected. - * - #kPORT_HighPullResistor = 1U - High internal pull resistor value is selected. - */ -static inline void PORT_SetPinPullValue(PORT_Type *base, uint32_t pin, uint8_t value) -{ - base->PCR[pin] = (base->PCR[pin] & ~PORT_PCR_PV_MASK) | PORT_PCR_PV(value); -} -#endif /* FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE */ - -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) -/*! - * @brief Reads the whole port status flag. - * - * If a pin is configured to generate the DMA request, the corresponding flag - * is cleared automatically at the completion of the requested DMA transfer. - * Otherwise, the flag remains set until a logic one is written to that flag. - * If configured for a level sensitive interrupt that remains asserted, the flag - * is set again immediately. - * - * @param base PORT peripheral base pointer. - * @return Current port interrupt status flags, for example, 0x00010001 means the - * pin 0 and 16 have the interrupt. - */ -static inline uint32_t PORT_GetPinsInterruptFlags(PORT_Type *base) -{ - return base->ISFR; -} - -/*! - * @brief Clears the multiple pin interrupt status flag. - * - * @param base PORT peripheral base pointer. - * @param mask PORT pin number macro. - */ -static inline void PORT_ClearPinsInterruptFlags(PORT_Type *base, uint32_t mask) -{ - base->ISFR = mask; -} -#endif - -#if defined(FSL_FEATURE_PORT_SUPPORT_EFT) && FSL_FEATURE_PORT_SUPPORT_EFT -/*! - * @brief Get EFT detect flags. - * - * @param base PORT peripheral base pointer - * @return EFT detect flags - */ -static inline uint32_t PORT_GetEFTDetectFlags(PORT_Type *base) -{ - return base->EDFR; -} - -/*! - * @brief Enable EFT detect interrupts. - * - * @param base PORT peripheral base pointer - * @param interrupt EFT detect interrupt - */ -static inline void PORT_EnableEFTDetectInterrupts(PORT_Type *base, uint32_t interrupt) -{ - base->EDIER |= interrupt; -} - -/*! - * @brief Disable EFT detect interrupts. - * - * @param base PORT peripheral base pointer - * @param interrupt EFT detect interrupt - */ -static inline void PORT_DisableEFTDetectInterrupts(PORT_Type *base, uint32_t interrupt) -{ - base->EDIER &= ~interrupt; -} - -/*! - * @brief Clear all low EFT detector. - * - * @note : Port B and Port C pins share the same EFT detector clear control from PORTC_EDCR register. Any write to the - * PORTB_EDCR does not take effect. - * @param base PORT peripheral base pointer - * @param interrupt EFT detect interrupt - */ -static inline void PORT_ClearAllLowEFTDetectors(PORT_Type *base) -{ - base->EDCR |= PORT_EDCR_EDLC_MASK; - base->EDCR &= ~PORT_EDCR_EDLC_MASK; -} - -/*! - * @brief Clear all high EFT detector. - * - * @param base PORT peripheral base pointer - * @param interrupt EFT detect interrupt - */ -static inline void PORT_ClearAllHighEFTDetectors(PORT_Type *base) -{ - base->EDCR |= PORT_EDCR_EDHC_MASK; - base->EDCR &= ~PORT_EDCR_EDHC_MASK; -} -#endif /* FSL_FEATURE_PORT_SUPPORT_EFT */ - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_PORT_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_pwm.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_pwm.c deleted file mode 100644 index 7fe51bcc779..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_pwm.c +++ /dev/null @@ -1,1491 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_pwm.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.pwm" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Get the instance from the base address - * - * @param base PWM peripheral base address - * - * @return The PWM module instance - */ -static uint32_t PWM_GetInstance(PWM_Type *base); - -#if defined(PWM_RSTS) -#define PWM_RESETS_ARRAY PWM_RSTS -#elif defined(FLEXPWM_RSTS) -#define PWM_RESETS_ARRAY FLEXPWM_RSTS -#elif defined(FLEXPWM_RSTS_N) -#define PWM_RESETS_ARRAY FLEXPWM_RSTS_N -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to PWM bases for each instance. */ -static PWM_Type *const s_pwmBases[] = PWM_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to PWM clocks for each PWM submodule. */ -static const clock_ip_name_t s_pwmClocks[][FSL_FEATURE_PWM_SUBMODULE_COUNT] = PWM_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(PWM_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_pwmResets[] = PWM_RESETS_ARRAY; -#endif - -/*! @brief Temporary PWM duty cycle. */ -static uint8_t s_pwmGetPwmDutyCycle[FSL_FEATURE_PWM_SUBMODULE_COUNT][PWM_SUBMODULE_CHANNEL] = {{0}}; - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Complement the variable of type uint16_t as needed - * - * This function can complement the variable of type uint16_t as needed.For example, - * need to ask for the opposite of a positive integer. - * - * param value Parameters of type uint16_t - */ -static inline uint16_t PWM_GetComplementU16(uint16_t value) -{ - return (~value + 1U); -} - -static inline uint16_t dutyCycleToReloadValue(uint8_t dutyCyclePercent) -{ - /* Rounding calculations to improve the accuracy of reloadValue */ - return ((65535U * dutyCyclePercent) + 50U) / 100U; -} - -static uint32_t PWM_GetInstance(PWM_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_pwmBases); instance++) - { - if (s_pwmBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_pwmBases)); - - return instance; -} - -/*! - * brief Set register about period on one PWM submodule. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param mode PWM operation mode, options available in enumeration ::pwm_mode_t - * param pulseCnt PWM period, value should be between 0 to 65535 - */ -static void PWM_SetPeriodRegister(PWM_Type *base, pwm_submodule_t subModule, pwm_mode_t mode, uint16_t pulseCnt) -{ - uint16_t modulo = 0; - - switch (mode) - { - case kPWM_SignedCenterAligned: - /* Setup the PWM period for a signed center aligned signal */ - modulo = (pulseCnt >> 1U); - /* Indicates the start of the PWM period */ - base->SM[subModule].INIT = PWM_GetComplementU16(modulo); - /* Indicates the center value */ - base->SM[subModule].VAL0 = 0; - /* Indicates the end of the PWM period */ - /* The change during the end to start of the PWM period requires a count time */ - base->SM[subModule].VAL1 = modulo - 1U; - break; - case kPWM_CenterAligned: - /* Setup the PWM period for an unsigned center aligned signal */ - /* Indicates the start of the PWM period */ - base->SM[subModule].INIT = 0; - /* Indicates the center value */ - base->SM[subModule].VAL0 = (pulseCnt / 2U); - /* Indicates the end of the PWM period */ - /* The change during the end to start of the PWM period requires a count time */ - base->SM[subModule].VAL1 = pulseCnt - 1U; - break; - case kPWM_SignedEdgeAligned: - /* Setup the PWM period for a signed edge aligned signal */ - modulo = (pulseCnt >> 1U); - /* Indicates the start of the PWM period */ - base->SM[subModule].INIT = PWM_GetComplementU16(modulo); - /* Indicates the center value */ - base->SM[subModule].VAL0 = 0; - /* Indicates the end of the PWM period */ - /* The change during the end to start of the PWM period requires a count time */ - base->SM[subModule].VAL1 = modulo - 1U; - break; - case kPWM_EdgeAligned: - /* Setup the PWM period for a unsigned edge aligned signal */ - /* Indicates the start of the PWM period */ - base->SM[subModule].INIT = 0; - /* Indicates the center value */ - base->SM[subModule].VAL0 = (pulseCnt / 2U); - /* Indicates the end of the PWM period */ - /* The change during the end to start of the PWM period requires a count time */ - base->SM[subModule].VAL1 = pulseCnt - 1U; - break; - default: - assert(false); - break; - } -} - -/*! - * brief Set register about dutycycle on one PWM submodule. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmSignal Signal (PWM A or PWM B) to update - * param mode PWM operation mode, options available in enumeration ::pwm_mode_t - * param pulseCnt PWM period, value should be between 0 to 65535 - * param dutyCycle New PWM pulse width, value should be between 0 to 65535 - */ -static void PWM_SetDutycycleRegister(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmSignal, - pwm_mode_t mode, - uint16_t pulseCnt, - uint16_t pwmHighPulse) -{ - uint16_t modulo = 0; - - switch (mode) - { - case kPWM_SignedCenterAligned: - /* Setup the PWM dutycycle for a signed center aligned signal */ - if (pwmSignal == kPWM_PwmA) - { - base->SM[subModule].VAL2 = PWM_GetComplementU16(pwmHighPulse / 2U); - base->SM[subModule].VAL3 = (pwmHighPulse / 2U); - } - else if (pwmSignal == kPWM_PwmB) - { - base->SM[subModule].VAL4 = PWM_GetComplementU16(pwmHighPulse / 2U); - base->SM[subModule].VAL5 = (pwmHighPulse / 2U); - } - else - { - ; /* Intentional empty */ - } - break; - case kPWM_CenterAligned: - /* Setup the PWM dutycycle for an unsigned center aligned signal */ - if (pwmSignal == kPWM_PwmA) - { - base->SM[subModule].VAL2 = ((pulseCnt - pwmHighPulse) / 2U); - base->SM[subModule].VAL3 = ((pulseCnt + pwmHighPulse) / 2U); - } - else if (pwmSignal == kPWM_PwmB) - { - base->SM[subModule].VAL4 = ((pulseCnt - pwmHighPulse) / 2U); - base->SM[subModule].VAL5 = ((pulseCnt + pwmHighPulse) / 2U); - } - else - { - ; /* Intentional empty */ - } - break; - case kPWM_SignedEdgeAligned: - modulo = (pulseCnt >> 1U); - - /* Setup the PWM dutycycle for a signed edge aligned signal */ - if (pwmSignal == kPWM_PwmA) - { - base->SM[subModule].VAL2 = PWM_GetComplementU16(modulo); - base->SM[subModule].VAL3 = PWM_GetComplementU16(modulo) + pwmHighPulse; - } - else if (pwmSignal == kPWM_PwmB) - { - base->SM[subModule].VAL4 = PWM_GetComplementU16(modulo); - base->SM[subModule].VAL5 = PWM_GetComplementU16(modulo) + pwmHighPulse; - } - else - { - ; /* Intentional empty */ - } - break; - case kPWM_EdgeAligned: - /* Setup the PWM dutycycle for a unsigned edge aligned signal */ - if (pwmSignal == kPWM_PwmA) - { - base->SM[subModule].VAL2 = 0; - base->SM[subModule].VAL3 = pwmHighPulse; - } - else if (pwmSignal == kPWM_PwmB) - { - base->SM[subModule].VAL4 = 0; - base->SM[subModule].VAL5 = pwmHighPulse; - } - else - { - ; /* Intentional empty */ - } - break; - default: - assert(false); - break; - } -} - -/*! - * brief Ungates the PWM submodule clock and configures the peripheral for basic operation. - * - * note This API should be called at the beginning of the application using the PWM driver. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param config Pointer to user's PWM config structure. - * - * return kStatus_Success means success; else failed. - */ -status_t PWM_Init(PWM_Type *base, pwm_submodule_t subModule, const pwm_config_t *config) -{ - assert(config); - - uint16_t reg; - - /* Source clock for submodule 0 cannot be itself */ - if ((config->clockSource == kPWM_Submodule0Clock) && (subModule == kPWM_Module_0)) - { - return kStatus_Fail; - } - - /* Reload source select clock for submodule 0 cannot be master reload */ - if ((config->reloadSelect == kPWM_MasterReload) && (subModule == kPWM_Module_0)) - { - return kStatus_Fail; - } - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate the PWM submodule clock*/ - CLOCK_EnableClock(s_pwmClocks[PWM_GetInstance(base)][subModule]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(PWM_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_pwmResets[PWM_GetInstance(base)]); -#endif - - /* Clear the fault status flags */ - base->FSTS |= PWM_FSTS_FFLAG_MASK; - - reg = base->SM[subModule].CTRL2; - - /* Setup the submodule clock-source, control source of the INIT signal, - * source of the force output signal, operation in debug & wait modes and reload source select - */ - reg &= - ~(uint16_t)(PWM_CTRL2_CLK_SEL_MASK | PWM_CTRL2_FORCE_SEL_MASK | PWM_CTRL2_INIT_SEL_MASK | PWM_CTRL2_INDEP_MASK | -#if !defined(FSL_FEATURE_PWM_HAS_NO_WAITEN) || (!FSL_FEATURE_PWM_HAS_NO_WAITEN) - PWM_CTRL2_WAITEN_MASK | -#endif /* FSL_FEATURE_PWM_HAS_NO_WAITEN */ - PWM_CTRL2_DBGEN_MASK | PWM_CTRL2_RELOAD_SEL_MASK); - reg |= (PWM_CTRL2_CLK_SEL(config->clockSource) | PWM_CTRL2_FORCE_SEL(config->forceTrigger) | - PWM_CTRL2_INIT_SEL(config->initializationControl) | PWM_CTRL2_DBGEN(config->enableDebugMode) | -#if !defined(FSL_FEATURE_PWM_HAS_NO_WAITEN) || (!FSL_FEATURE_PWM_HAS_NO_WAITEN) - PWM_CTRL2_WAITEN(config->enableWait) | -#endif /* FSL_FEATURE_PWM_HAS_NO_WAITEN */ - PWM_CTRL2_RELOAD_SEL(config->reloadSelect)); - - /* Setup PWM A & B to be independent or a complementary-pair */ - switch (config->pairOperation) - { - case kPWM_Independent: - reg |= PWM_CTRL2_INDEP_MASK; - break; - case kPWM_ComplementaryPwmA: - base->MCTRL &= ~((uint16_t)1U << (PWM_MCTRL_IPOL_SHIFT + (uint16_t)subModule)); - break; - case kPWM_ComplementaryPwmB: - base->MCTRL |= ((uint16_t)1U << (PWM_MCTRL_IPOL_SHIFT + (uint16_t)subModule)); - break; - default: - assert(false); - break; - } - base->SM[subModule].CTRL2 = reg; - - reg = base->SM[subModule].CTRL; - - /* Setup the clock prescale, load mode and frequency */ - reg &= ~(uint16_t)(PWM_CTRL_PRSC_MASK | PWM_CTRL_LDFQ_MASK | PWM_CTRL_LDMOD_MASK); - reg |= (PWM_CTRL_PRSC(config->prescale) | PWM_CTRL_LDFQ(config->reloadFrequency)); - - /* Setup register reload logic */ - switch (config->reloadLogic) - { - case kPWM_ReloadImmediate: - reg |= PWM_CTRL_LDMOD_MASK; - break; - case kPWM_ReloadPwmHalfCycle: - reg |= PWM_CTRL_HALF_MASK; - reg &= (uint16_t)(~PWM_CTRL_FULL_MASK); - break; - case kPWM_ReloadPwmFullCycle: - reg &= (uint16_t)(~PWM_CTRL_HALF_MASK); - reg |= PWM_CTRL_FULL_MASK; - break; - case kPWM_ReloadPwmHalfAndFullCycle: - reg |= PWM_CTRL_HALF_MASK; - reg |= PWM_CTRL_FULL_MASK; - break; - default: - assert(false); - break; - } - base->SM[subModule].CTRL = reg; - - /* Set PWM output normal */ -#if defined(PWM_MASK_UPDATE_MASK) - base->MASK &= (uint16_t)(~(uint16_t)(PWM_MASK_MASKX_MASK | PWM_MASK_MASKA_MASK | PWM_MASK_MASKB_MASK | - PWM_MASK_UPDATE_MASK_MASK)); -#else - base->MASK &= ~(uint16_t)(PWM_MASK_MASKX_MASK | PWM_MASK_MASKA_MASK | PWM_MASK_MASKB_MASK); -#endif - - base->DTSRCSEL = 0U; - - /* Issue a Force trigger event when configured to trigger locally */ - if (config->forceTrigger == kPWM_Force_Local) - { - base->SM[subModule].CTRL2 |= PWM_CTRL2_FORCE(1U); - } - - return kStatus_Success; -} - -/*! - * brief Gate the PWM submodule clock - * - * param base PWM peripheral base address - * param subModule PWM submodule to deinitialize - */ -void PWM_Deinit(PWM_Type *base, pwm_submodule_t subModule) -{ - /* Stop the submodule */ - base->MCTRL &= ~((uint16_t)1U << (PWM_MCTRL_RUN_SHIFT + (uint16_t)subModule)); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate the PWM submodule clock*/ - CLOCK_DisableClock(s_pwmClocks[PWM_GetInstance(base)][subModule]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Fill in the PWM config struct with the default settings - * - * The default values are: - * code - * config->enableDebugMode = false; - * config->enableWait = false; - * config->reloadSelect = kPWM_LocalReload; - * config->clockSource = kPWM_BusClock; - * config->prescale = kPWM_Prescale_Divide_1; - * config->initializationControl = kPWM_Initialize_LocalSync; - * config->forceTrigger = kPWM_Force_Local; - * config->reloadFrequency = kPWM_LoadEveryOportunity; - * config->reloadLogic = kPWM_ReloadImmediate; - * config->pairOperation = kPWM_Independent; - * endcode - * param config Pointer to user's PWM config structure. - */ -void PWM_GetDefaultConfig(pwm_config_t *config) -{ - assert(config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - /* PWM is paused in debug mode */ - config->enableDebugMode = false; - /* PWM is paused in wait mode */ -#if !defined(FSL_FEATURE_PWM_HAS_NO_WAITEN) || (!FSL_FEATURE_PWM_HAS_NO_WAITEN) - config->enableWait = false; -#endif /* FSL_FEATURE_PWM_HAS_NO_WAITEN */ - /* PWM module uses the local reload signal to reload registers */ - config->reloadSelect = kPWM_LocalReload; - /* Use the IP Bus clock as source clock for the PWM submodule */ - config->clockSource = kPWM_BusClock; - /* Clock source prescale is set to divide by 1*/ - config->prescale = kPWM_Prescale_Divide_1; - /* Local sync causes initialization */ - config->initializationControl = kPWM_Initialize_LocalSync; - /* The local force signal, CTRL2[FORCE], from the submodule is used to force updates */ - config->forceTrigger = kPWM_Force_Local; - /* PWM reload frequency, reload opportunity is PWM half cycle or full cycle. - * This field is not used in Immediate reload mode - */ - config->reloadFrequency = kPWM_LoadEveryOportunity; - /* Buffered-registers get loaded with new values as soon as LDOK bit is set */ - config->reloadLogic = kPWM_ReloadImmediate; - /* PWM A & PWM B operate as 2 independent channels */ - config->pairOperation = kPWM_Independent; -} - -/*! - * brief Sets up the PWM signals for a PWM submodule. - * - * The function initializes the submodule according to the parameters passed in by the user. The function - * also sets up the value compare registers to match the PWM signal requirements. - * If the dead time insertion logic is enabled, the pulse period is reduced by the - * dead time period specified by the user. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param chnlParams Array of PWM channel parameters to configure the channel(s), PWMX submodule is not supported. - * param numOfChnls Number of channels to configure, this should be the size of the array passed in. - * Array size should not be more than 2 as each submodule has 2 pins to output PWM - * param mode PWM operation mode, options available in enumeration ::pwm_mode_t - * param pwmFreq_Hz PWM signal frequency in Hz - * param srcClock_Hz PWM source clock of correspond submodule in Hz. If source clock of submodule1,2,3 is from - * submodule0 AUX_CLK, its source clock is submodule0 source clock divided with submodule0 - * prescaler value instead of submodule0 source clock. - * - * return Returns kStatusFail if there was error setting up the signal; kStatusSuccess otherwise - */ -status_t PWM_SetupPwm(PWM_Type *base, - pwm_submodule_t subModule, - const pwm_signal_param_t *chnlParams, - uint8_t numOfChnls, - pwm_mode_t mode, - uint32_t pwmFreq_Hz, - uint32_t srcClock_Hz) -{ - assert(chnlParams); - assert(pwmFreq_Hz); - assert(numOfChnls); - assert(srcClock_Hz); - - uint32_t pwmClock; - uint16_t pulseCnt = 0, pwmHighPulse = 0; - uint8_t i, polarityShift = 0, outputEnableShift = 0; - - for (i = 0; i < numOfChnls; i++) - { - if (chnlParams[i].pwmChannel == kPWM_PwmX) - { - /* PWMX configuration is not supported yet */ - return kStatus_Fail; - } - } - - /* Divide the clock by the prescale value */ - pwmClock = (srcClock_Hz / (1UL << ((base->SM[subModule].CTRL & PWM_CTRL_PRSC_MASK) >> PWM_CTRL_PRSC_SHIFT))); - pulseCnt = (uint16_t)(pwmClock / pwmFreq_Hz); - - /* Setup each PWM channel */ - for (i = 0; i < numOfChnls; i++) - { - /* Calculate pulse width */ - pwmHighPulse = (pulseCnt * chnlParams->dutyCyclePercent) / 100U; - - /* Setup the different match registers to generate the PWM signal */ - if (i == 0U) - { - /* Update register about period */ - PWM_SetPeriodRegister(base, subModule, mode, pulseCnt); - } - - /* Update register about dutycycle */ - PWM_SetDutycycleRegister(base, subModule, chnlParams->pwmChannel, mode, pulseCnt, pwmHighPulse); - - /* Setup register shift values based on the channel being configured. - * Also setup the deadtime value - */ - if (chnlParams->pwmChannel == kPWM_PwmA) - { - polarityShift = PWM_OCTRL_POLA_SHIFT; - outputEnableShift = PWM_OUTEN_PWMA_EN_SHIFT; - base->SM[subModule].DTCNT0 = PWM_DTCNT0_DTCNT0(chnlParams->deadtimeValue); - } - else - { - polarityShift = PWM_OCTRL_POLB_SHIFT; - outputEnableShift = PWM_OUTEN_PWMB_EN_SHIFT; - base->SM[subModule].DTCNT1 = PWM_DTCNT1_DTCNT1(chnlParams->deadtimeValue); - } - - /* Set PWM output fault status */ - switch (chnlParams->pwmChannel) - { - case kPWM_PwmA: - base->SM[subModule].OCTRL &= ~((uint16_t)PWM_OCTRL_PWMAFS_MASK); - base->SM[subModule].OCTRL |= (((uint16_t)(chnlParams->faultState) << (uint16_t)PWM_OCTRL_PWMAFS_SHIFT) & - (uint16_t)PWM_OCTRL_PWMAFS_MASK); - break; - case kPWM_PwmB: - base->SM[subModule].OCTRL &= ~((uint16_t)PWM_OCTRL_PWMBFS_MASK); - base->SM[subModule].OCTRL |= (((uint16_t)(chnlParams->faultState) << (uint16_t)PWM_OCTRL_PWMBFS_SHIFT) & - (uint16_t)PWM_OCTRL_PWMBFS_MASK); - break; - default: - assert(false); - break; - } - - /* Setup signal active level */ - if ((bool)chnlParams->level == kPWM_HighTrue) - { - base->SM[subModule].OCTRL &= ~((uint16_t)1U << (uint16_t)polarityShift); - } - else - { - base->SM[subModule].OCTRL |= ((uint16_t)1U << (uint16_t)polarityShift); - } - if (chnlParams->pwmchannelenable) - { - /* Enable PWM output */ - base->OUTEN |= ((uint16_t)1U << ((uint16_t)outputEnableShift + (uint16_t)subModule)); - } - - /* Get the pwm duty cycle */ - s_pwmGetPwmDutyCycle[subModule][chnlParams->pwmChannel] = chnlParams->dutyCyclePercent; - - /* Get the next channel parameters */ - chnlParams++; - } - - return kStatus_Success; -} - -/*! - * brief Set PWM phase shift for PWM channel running on channel PWM_A, PWM_B which with 50% duty cycle. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmChannel PWM channel to configure - * param pwmFreq_Hz PWM signal frequency in Hz - * param srcClock_Hz PWM main counter clock in Hz. - * param shiftvalue Phase shift value, range in 0 ~ 50 - * param doSync true: Set LDOK bit for the submodule list; - * false: LDOK bit don't set, need to call PWM_SetPwmLdok to sync update. - * - * return Returns kStatus_Fail if there was error setting up the signal; kStatus_Success otherwise - */ -status_t PWM_SetupPwmPhaseShift(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - uint32_t pwmFreq_Hz, - uint32_t srcClock_Hz, - uint8_t shiftvalue, - bool doSync) -{ - assert(pwmFreq_Hz != 0U); - assert(srcClock_Hz != 0U); - assert(shiftvalue <= 50U); - - uint32_t pwmClock; - uint16_t pulseCnt = 0, pwmHighPulse = 0; - uint16_t modulo = 0; - uint16_t shift = 0; - - if (pwmChannel != kPWM_PwmX) - { - /* Divide the clock by the prescale value */ - pwmClock = (srcClock_Hz / (1UL << ((base->SM[subModule].CTRL & PWM_CTRL_PRSC_MASK) >> PWM_CTRL_PRSC_SHIFT))); - pulseCnt = (uint16_t)(pwmClock / pwmFreq_Hz); - - /* Clear LDOK bit if it is set */ - if (0U != (base->MCTRL & PWM_MCTRL_LDOK(1UL << (uint8_t)subModule))) - { - base->MCTRL |= PWM_MCTRL_CLDOK(1UL << (uint8_t)subModule); - } - - modulo = (pulseCnt >> 1U); - /* Indicates the start of the PWM period */ - base->SM[subModule].INIT = PWM_GetComplementU16(modulo); - /* Indicates the center value */ - base->SM[subModule].VAL0 = 0; - /* Indicates the end of the PWM period */ - /* The change during the end to start of the PWM period requires a count time */ - base->SM[subModule].VAL1 = modulo - 1U; - - /* Immediately upon when MCTRL[LDOK] being set */ - base->SM[subModule].CTRL |= PWM_CTRL_LDMOD_MASK; - - /* phase shift value */ - shift = (pulseCnt * shiftvalue) / 100U; - - /* duty cycle 50% */ - pwmHighPulse = pulseCnt / 2U; - - if (pwmChannel == kPWM_PwmA) - { - base->SM[subModule].VAL2 = PWM_GetComplementU16(modulo) + shift; - base->SM[subModule].VAL3 = PWM_GetComplementU16(modulo) + pwmHighPulse + shift - 1U; - } - else if (pwmChannel == kPWM_PwmB) - { - base->SM[subModule].VAL4 = PWM_GetComplementU16(modulo) + shift; - base->SM[subModule].VAL5 = PWM_GetComplementU16(modulo) + pwmHighPulse + shift - 1U; - } - else - { - return kStatus_Fail; - } - - if (doSync) - { - /* Set LDOK bit to load VALx bit */ - base->MCTRL |= PWM_MCTRL_LDOK(1UL << (uint8_t)subModule); - } - } - else - { - return kStatus_Fail; - } - - return kStatus_Success; -} - -/*! - * brief Updates the PWM signal's dutycycle. - * - * The function updates the PWM dutycyle to the new value that is passed in. - * If the dead time insertion logic is enabled then the pulse period is reduced by the - * dead time period specified by the user. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmSignal Signal (PWM A or PWM B) to update - * param currPwmMode The current PWM mode set during PWM setup - * param dutyCyclePercent New PWM pulse width, value should be between 0 to 100 - * 0=inactive signal(0% duty cycle)... - * 100=active signal (100% duty cycle) - */ -void PWM_UpdatePwmDutycycle(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmSignal, - pwm_mode_t currPwmMode, - uint8_t dutyCyclePercent) -{ - assert(dutyCyclePercent <= 100U); - assert(pwmSignal != kPWM_PwmX); - uint16_t reloadValue = dutyCycleToReloadValue(dutyCyclePercent); - - PWM_UpdatePwmDutycycleHighAccuracy(base, subModule, pwmSignal, currPwmMode, reloadValue); -} - -/*! - * brief Updates the PWM signal's dutycycle with 16-bit accuracy. - * - * The function updates the PWM dutycyle to the new value that is passed in. - * If the dead time insertion logic is enabled then the pulse period is reduced by the - * dead time period specified by the user. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmSignal Signal (PWM A or PWM B) to update - * param currPwmMode The current PWM mode set during PWM setup - * param dutyCycle New PWM pulse width, value should be between 0 to 65535 - * 0=inactive signal(0% duty cycle)... - * 65535=active signal (100% duty cycle) - */ -void PWM_UpdatePwmDutycycleHighAccuracy( - PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmSignal, pwm_mode_t currPwmMode, uint16_t dutyCycle) -{ - assert(pwmSignal != kPWM_PwmX); - uint16_t pulseCnt = 0, pwmHighPulse = 0; - uint16_t modulo = 0; - - switch (currPwmMode) - { - case kPWM_SignedCenterAligned: - modulo = base->SM[subModule].VAL1 + 1U; - pulseCnt = modulo * 2U; - /* Calculate pulse width */ - pwmHighPulse = (pulseCnt * dutyCycle) / 65535U; - break; - case kPWM_CenterAligned: - pulseCnt = base->SM[subModule].VAL1 + 1U; - /* Calculate pulse width */ - pwmHighPulse = (pulseCnt * dutyCycle) / 65535U; - break; - case kPWM_SignedEdgeAligned: - modulo = base->SM[subModule].VAL1 + 1U; - pulseCnt = modulo * 2U; - /* Calculate pulse width */ - pwmHighPulse = (pulseCnt * dutyCycle) / 65535U; - break; - case kPWM_EdgeAligned: - pulseCnt = base->SM[subModule].VAL1 + 1U; - /* Calculate pulse width */ - pwmHighPulse = (pulseCnt * dutyCycle) / 65535U; - break; - default: - assert(false); - break; - } - - /* Update register about dutycycle */ - if (kPWM_PwmA == pwmSignal) - { - PWM_SetDutycycleRegister(base, subModule, kPWM_PwmA, currPwmMode, pulseCnt, pwmHighPulse); - } - else if (kPWM_PwmB == pwmSignal) - { - PWM_SetDutycycleRegister(base, subModule, kPWM_PwmB, currPwmMode, pulseCnt, pwmHighPulse); - } - else - { - ; /* Intentional empty */ - } - - if (kPWM_PwmX != pwmSignal) - { - /* Get the pwm duty cycle */ - s_pwmGetPwmDutyCycle[subModule][pwmSignal] = (uint8_t)(dutyCycle * 100U / 65535U); - } -} - -/*! - * brief Update the PWM signal's period and dutycycle for a PWM submodule. - * - * The function updates PWM signal period generated by a specific submodule according to the parameters - * passed in by the user. This function can also set dutycycle weather you want to keep original dutycycle - * or update new dutycycle. Call this function in local sync control mode because PWM period is depended by - * INIT and VAL1 register of each submodule. In master sync initialization control mode, call this function - * to update INIT and VAL1 register of all submodule because PWM period is depended by INIT and VAL1 register - * in submodule0. If the dead time insertion logic is enabled, the pulse period is reduced by the dead time - * period specified by the user. PWM signal will not be generated if its period is less than dead time duration. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmSignal Signal (PWM A or PWM B) to update - * param currPwmMode The current PWM mode set during PWM setup, options available in enumeration ::pwm_mode_t - * param pulseCnt New PWM period, value should be between 0 to 65535 - * 0=minimum PWM period... - * 65535=maximum PWM period - * param dutyCycle New PWM pulse width of channel, value should be between 0 to 65535 - * 0=inactive signal(0% duty cycle)... - * 65535=active signal (100% duty cycle) - * You can keep original dutycycle or update new dutycycle - */ -void PWM_UpdatePwmPeriodAndDutycycle(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmSignal, - pwm_mode_t currPwmMode, - uint16_t pulseCnt, - uint16_t dutyCycle) -{ - uint16_t pwmHighPulse = 0; - - assert(pwmSignal != kPWM_PwmX); - - /* Calculate pulse width */ - pwmHighPulse = (pulseCnt * dutyCycle) / 65535U; - - /* Update register about period */ - PWM_SetPeriodRegister(base, subModule, currPwmMode, pulseCnt); - - /* Update register about dutycycle */ - PWM_SetDutycycleRegister(base, subModule, pwmSignal, currPwmMode, pulseCnt, pwmHighPulse); - - /* Get the pwm duty cycle */ - s_pwmGetPwmDutyCycle[subModule][pwmSignal] = (uint8_t)((dutyCycle * 100U) / 65535U); -} - -/*! - * brief Sets up the PWM input capture - * - * Each PWM submodule has 3 pins that can be configured for use as input capture pins. This function - * sets up the capture parameters for each pin and enables the pin for input capture operation. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmChannel Channel in the submodule to setup - * param inputCaptureParams Parameters passed in to set up the input pin - */ -void PWM_SetupInputCapture(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - const pwm_input_capture_param_t *inputCaptureParams) -{ - uint16_t reg = 0; - switch (pwmChannel) - { -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA - case kPWM_PwmA: - /* Setup the capture paramters for PWM A pin */ - reg = (PWM_CAPTCTRLA_INP_SELA(inputCaptureParams->captureInputSel) | - PWM_CAPTCTRLA_EDGA0(inputCaptureParams->edge0) | PWM_CAPTCTRLA_EDGA1(inputCaptureParams->edge1) | - PWM_CAPTCTRLA_ONESHOTA(inputCaptureParams->enableOneShotCapture) | - PWM_CAPTCTRLA_CFAWM(inputCaptureParams->fifoWatermark)); - /* Enable the edge counter if using the output edge counter */ - if (inputCaptureParams->captureInputSel) - { - reg |= PWM_CAPTCTRLA_EDGCNTA_EN_MASK; - } - /* Enable input capture operation */ - reg |= PWM_CAPTCTRLA_ARMA_MASK; - - base->SM[subModule].CAPTCTRLA = reg; - - /* Setup the compare value when using the edge counter as source */ - base->SM[subModule].CAPTCOMPA = PWM_CAPTCOMPA_EDGCMPA(inputCaptureParams->edgeCompareValue); - /* Setup PWM A pin for input capture */ - base->OUTEN &= ~((uint16_t)1U << (PWM_OUTEN_PWMA_EN_SHIFT + (uint16_t)subModule)); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB - case kPWM_PwmB: - /* Setup the capture paramters for PWM B pin */ - reg = (PWM_CAPTCTRLB_INP_SELB(inputCaptureParams->captureInputSel) | - PWM_CAPTCTRLB_EDGB0(inputCaptureParams->edge0) | PWM_CAPTCTRLB_EDGB1(inputCaptureParams->edge1) | - PWM_CAPTCTRLB_ONESHOTB(inputCaptureParams->enableOneShotCapture) | - PWM_CAPTCTRLB_CFBWM(inputCaptureParams->fifoWatermark)); - /* Enable the edge counter if using the output edge counter */ - if (inputCaptureParams->captureInputSel) - { - reg |= PWM_CAPTCTRLB_EDGCNTB_EN_MASK; - } - /* Enable input capture operation */ - reg |= PWM_CAPTCTRLB_ARMB_MASK; - - base->SM[subModule].CAPTCTRLB = reg; - - /* Setup the compare value when using the edge counter as source */ - base->SM[subModule].CAPTCOMPB = PWM_CAPTCOMPB_EDGCMPB(inputCaptureParams->edgeCompareValue); - /* Setup PWM B pin for input capture */ - base->OUTEN &= ~((uint16_t)1U << (PWM_OUTEN_PWMB_EN_SHIFT + (uint16_t)subModule)); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX - case kPWM_PwmX: - reg = (PWM_CAPTCTRLX_INP_SELX(inputCaptureParams->captureInputSel) | - PWM_CAPTCTRLX_EDGX0(inputCaptureParams->edge0) | PWM_CAPTCTRLX_EDGX1(inputCaptureParams->edge1) | - PWM_CAPTCTRLX_ONESHOTX(inputCaptureParams->enableOneShotCapture) | - PWM_CAPTCTRLX_CFXWM(inputCaptureParams->fifoWatermark)); - /* Enable the edge counter if using the output edge counter */ - if (inputCaptureParams->captureInputSel) - { - reg |= PWM_CAPTCTRLX_EDGCNTX_EN_MASK; - } - /* Enable input capture operation */ - reg |= PWM_CAPTCTRLX_ARMX_MASK; - - base->SM[subModule].CAPTCTRLX = reg; - - /* Setup the compare value when using the edge counter as source */ - base->SM[subModule].CAPTCOMPX = PWM_CAPTCOMPX_EDGCMPX(inputCaptureParams->edgeCompareValue); - /* Setup PWM X pin for input capture */ - base->OUTEN &= ~((uint16_t)1U << (PWM_OUTEN_PWMX_EN_SHIFT + (uint16_t)subModule)); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX */ - default: - assert(false); - break; - } -} - -/*! - * @brief Sets up the PWM fault input filter. - * - * @param base PWM peripheral base address - * @param faultInputFilterParams Parameters passed in to set up the fault input filter. - */ -void PWM_SetupFaultInputFilter(PWM_Type *base, const pwm_fault_input_filter_param_t *faultInputFilterParams) -{ - assert(NULL != faultInputFilterParams); - - /* When changing values for fault period from a non-zero value, first write a value of 0 to clear the filter. */ - if (0U != (base->FFILT & PWM_FFILT_FILT_PER_MASK)) - { - base->FFILT &= ~(uint16_t)(PWM_FFILT_FILT_PER_MASK); - } - - base->FFILT = (uint16_t)(PWM_FFILT_FILT_PER(faultInputFilterParams->faultFilterPeriod) | - PWM_FFILT_FILT_CNT(faultInputFilterParams->faultFilterCount) | - PWM_FFILT_GSTR(faultInputFilterParams->faultGlitchStretch ? 1U : 0U)); -} - -/*! - * brief Sets up the PWM fault protection. - * - * PWM has 4 fault inputs. - * - * param base PWM peripheral base address - * param faultNum PWM fault to configure. - * param faultParams Pointer to the PWM fault config structure - */ -void PWM_SetupFaults(PWM_Type *base, pwm_fault_input_t faultNum, const pwm_fault_param_t *faultParams) -{ - assert(faultParams); - uint16_t reg; - - reg = base->FCTRL; - /* Set the faults level-settting */ - if (faultParams->faultLevel) - { - reg |= ((uint16_t)1U << (PWM_FCTRL_FLVL_SHIFT + (uint16_t)faultNum)); - } - else - { - reg &= ~((uint16_t)1U << (PWM_FCTRL_FLVL_SHIFT + (uint16_t)faultNum)); - } - /* Set the fault clearing mode */ - if ((uint16_t)faultParams->faultClearingMode != 0U) - { - /* Use manual fault clearing */ - reg &= ~((uint16_t)1U << (PWM_FCTRL_FAUTO_SHIFT + (uint16_t)faultNum)); - if (faultParams->faultClearingMode == kPWM_ManualSafety) - { - /* Use manual fault clearing with safety mode enabled */ - reg |= ((uint16_t)1U << (PWM_FCTRL_FSAFE_SHIFT + (uint16_t)faultNum)); - } - else - { - /* Use manual fault clearing with safety mode disabled */ - reg &= ~((uint16_t)1U << (PWM_FCTRL_FSAFE_SHIFT + (uint16_t)faultNum)); - } - } - else - { - /* Use automatic fault clearing */ - reg |= ((uint16_t)1U << (PWM_FCTRL_FAUTO_SHIFT + (uint16_t)faultNum)); - } - base->FCTRL = reg; - - /* Set the combinational path option */ - if (faultParams->enableCombinationalPath) - { - /* Combinational path from the fault input to the PWM output is available */ - base->FCTRL2 &= ~((uint16_t)1U << (uint16_t)faultNum); - } - else - { - /* No combinational path available, only fault filter & latch signal can disable PWM output */ - base->FCTRL2 |= ((uint16_t)1U << (uint16_t)faultNum); - } - - /* Initially clear both recovery modes */ - reg = base->FSTS; - reg &= ~(((uint16_t)1U << (PWM_FSTS_FFULL_SHIFT + (uint16_t)faultNum)) | - ((uint16_t)1U << (PWM_FSTS_FHALF_SHIFT + (uint16_t)faultNum))); - /* Setup fault recovery */ - switch (faultParams->recoverMode) - { - case kPWM_NoRecovery: - break; - case kPWM_RecoverHalfCycle: - reg |= ((uint16_t)1U << (PWM_FSTS_FHALF_SHIFT + (uint16_t)faultNum)); - break; - case kPWM_RecoverFullCycle: - reg |= ((uint16_t)1U << (PWM_FSTS_FFULL_SHIFT + (uint16_t)faultNum)); - break; - case kPWM_RecoverHalfAndFullCycle: - reg |= ((uint16_t)1U << (PWM_FSTS_FHALF_SHIFT + (uint16_t)faultNum)); - reg |= ((uint16_t)1U << (PWM_FSTS_FFULL_SHIFT + (uint16_t)faultNum)); - break; - default: - assert(false); - break; - } - base->FSTS = reg; -} - -/*! - * brief Fill in the PWM fault config struct with the default settings - * - * The default values are: - * code - * config->faultClearingMode = kPWM_Automatic; - * config->faultLevel = false; - * config->enableCombinationalPath = true; - * config->recoverMode = kPWM_NoRecovery; - * endcode - * param config Pointer to user's PWM fault config structure. - */ -void PWM_FaultDefaultConfig(pwm_fault_param_t *config) -{ - assert(config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - /* PWM uses automatic fault clear mode */ - config->faultClearingMode = kPWM_Automatic; - /* PWM fault level is set to logic 0 */ - config->faultLevel = false; - /* Combinational Path from fault input is enabled */ - config->enableCombinationalPath = true; - /* PWM output will stay inactive when recovering from a fault */ - config->recoverMode = kPWM_NoRecovery; -} - -/*! - * brief Selects the signal to output on a PWM pin when a FORCE_OUT signal is asserted. - * - * The user specifies which channel to configure by supplying the submodule number and whether - * to modify PWM A or PWM B within that submodule. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmChannel Channel to configure - * param mode Signal to output when a FORCE_OUT is triggered - */ -void PWM_SetupForceSignal(PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmChannel, pwm_force_signal_t mode) - -{ - uint16_t shift; - uint16_t reg; - - /* DTSRCSEL register has 4 bits per submodule; 2 bits for PWM A and 2 bits for PWM B */ - shift = ((uint16_t)subModule * 4U) + ((uint16_t)pwmChannel * 2U); - - /* Setup the signal to be passed upon occurrence of a FORCE_OUT signal */ - reg = base->DTSRCSEL; - reg &= ~((uint16_t)0x3U << shift); - reg |= (uint16_t)((uint16_t)mode << shift); - base->DTSRCSEL = reg; -} - -/*! - * brief Enables the selected PWM interrupts - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::pwm_interrupt_enable_t - */ -void PWM_EnableInterrupts(PWM_Type *base, pwm_submodule_t subModule, uint32_t mask) -{ - /* Upper 16 bits are for related to the submodule */ - base->SM[subModule].INTEN |= ((uint16_t)mask & 0xFFFFU); - /* Fault related interrupts */ - base->FCTRL |= ((uint16_t)(mask >> 16U) & PWM_FCTRL_FIE_MASK); -} - -/*! - * brief Disables the selected PWM interrupts - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::pwm_interrupt_enable_t - */ -void PWM_DisableInterrupts(PWM_Type *base, pwm_submodule_t subModule, uint32_t mask) -{ - base->SM[subModule].INTEN &= ~((uint16_t)mask & 0xFFFFU); - base->FCTRL &= ~((uint16_t)(mask >> 16U) & PWM_FCTRL_FIE_MASK); -} - -/*! - * brief Gets the enabled PWM interrupts - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * - * return The enabled interrupts. This is the logical OR of members of the - * enumeration ::pwm_interrupt_enable_t - */ -uint32_t PWM_GetEnabledInterrupts(PWM_Type *base, pwm_submodule_t subModule) -{ - uint32_t enabledInterrupts; - - enabledInterrupts = base->SM[subModule].INTEN; - enabledInterrupts |= (((uint32_t)base->FCTRL & PWM_FCTRL_FIE_MASK) << 16UL); - return enabledInterrupts; -} - -/*! - * brief Gets the PWM status flags - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * - * return The status flags. This is the logical OR of members of the - * enumeration ::pwm_status_flags_t - */ -uint32_t PWM_GetStatusFlags(PWM_Type *base, pwm_submodule_t subModule) -{ - uint32_t statusFlags; - - statusFlags = base->SM[subModule].STS; - statusFlags |= (((uint32_t)base->FSTS & PWM_FSTS_FFLAG_MASK) << 16UL); - - return statusFlags; -} - -/*! - * brief Clears the PWM status flags - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::pwm_status_flags_t - */ -void PWM_ClearStatusFlags(PWM_Type *base, pwm_submodule_t subModule, uint32_t mask) -{ - uint16_t reg; - - base->SM[subModule].STS = ((uint16_t)mask & 0xFFFFU); - reg = base->FSTS; - /* Clear the fault flags and set only the ones we wish to clear as the fault flags are cleared - * by writing a login one - */ - reg &= ~(uint16_t)(PWM_FSTS_FFLAG_MASK); - reg |= (uint16_t)((mask >> 16U) & PWM_FSTS_FFLAG_MASK); - base->FSTS = reg; -} - -/*! - * brief Set PWM output in idle status (high or low). - * - * note This API should call after PWM_SetupPwm() APIs, and PWMX submodule is not supported. - * - * param base PWM peripheral base address - * param pwmChannel PWM channel to configure - * param subModule PWM submodule to configure - * param idleStatus True: PWM output is high in idle status; false: PWM output is low in idle status. - * - * return kStatus_Fail if there was error setting up the signal; kStatus_Success if set output idle success - */ -status_t PWM_SetOutputToIdle(PWM_Type *base, pwm_channels_t pwmChannel, pwm_submodule_t subModule, bool idleStatus) -{ - uint16_t valOn = 0, valOff = 0; - uint16_t ldmod; - - /* Clear LDOK bit if it is set */ - if (0U != (base->MCTRL & PWM_MCTRL_LDOK(1UL << (uint8_t)subModule))) - { - base->MCTRL |= PWM_MCTRL_CLDOK(1UL << (uint8_t)subModule); - } - - valOff = base->SM[subModule].INIT; - valOn = base->SM[subModule].VAL1 + 0x1U; - - if ((valOff + 1U) == valOn) - { - return kStatus_Fail; - } - - /* Should not PWM_X channel */ - if (kPWM_PwmA == pwmChannel) - { - if (0U != (base->SM[subModule].OCTRL & PWM_OCTRL_POLA_MASK)) - { - if (!idleStatus) - { - valOn = base->SM[subModule].INIT; - valOff = base->SM[subModule].VAL1 + 0x1U; - } - } - else - { - if (idleStatus) - { - valOn = base->SM[subModule].INIT; - valOff = base->SM[subModule].VAL1 + 0x1U; - } - } - base->SM[subModule].VAL2 = valOn; - base->SM[subModule].VAL3 = valOff; - } - else if (kPWM_PwmB == pwmChannel) - { - if (0U != (base->SM[subModule].OCTRL & PWM_OCTRL_POLB_MASK)) - { - if (!idleStatus) - { - valOn = base->SM[subModule].INIT; - valOff = base->SM[subModule].VAL1 + 0x1U; - } - } - else - { - if (idleStatus) - { - valOn = base->SM[subModule].INIT; - valOff = base->SM[subModule].VAL1 + 0x1U; - } - } - base->SM[subModule].VAL4 = valOn; - base->SM[subModule].VAL5 = valOff; - } - else - { - return kStatus_Fail; - } - - /* Record Load mode */ - ldmod = base->SM[subModule].CTRL; - /* Set Load mode to make Buffered registers take effect immediately when LDOK bit set */ - base->SM[subModule].CTRL |= PWM_CTRL_LDMOD_MASK; - /* Set LDOK bit to load buffer registers */ - base->MCTRL |= PWM_MCTRL_LDOK(1UL << (uint8_t)subModule); - /* Restore Load mode */ - base->SM[subModule].CTRL = ldmod; - - /* Get pwm duty cycle */ - s_pwmGetPwmDutyCycle[subModule][pwmChannel] = 0x0U; - - return kStatus_Success; -} - -/*! - * brief Get the dutycycle value. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmChannel PWM channel to configure - * - * return Current channel dutycycle value. - */ -uint8_t PWM_GetPwmChannelState(PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmChannel) -{ - return s_pwmGetPwmDutyCycle[subModule][pwmChannel]; -} - -/*! - * brief Set the pwm submodule prescaler. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param prescaler Set prescaler value - */ -void PWM_SetClockMode(PWM_Type *base, pwm_submodule_t subModule, pwm_clock_prescale_t prescaler) -{ - uint16_t reg = base->SM[subModule].CTRL; - - /* Clear LDOK bit if it is set */ - if (0U != (base->MCTRL & PWM_MCTRL_LDOK(1UL << (uint8_t)subModule))) - { - base->MCTRL |= PWM_MCTRL_CLDOK(1UL << (uint8_t)subModule); - } - /* Set submodule prescaler. */ - reg &= ~(uint16_t)PWM_CTRL_PRSC_MASK; - reg |= PWM_CTRL_PRSC(prescaler); - base->SM[subModule].CTRL = reg; - /* Set Load mode to make Buffered registers take effect immediately when LDOK bit set */ - base->SM[subModule].CTRL |= PWM_CTRL_LDMOD_MASK; - /* Set LDOK bit to load buffer registers */ - base->MCTRL |= PWM_MCTRL_LDOK(1UL << (uint8_t)subModule); - /* Restore Load mode */ - base->SM[subModule].CTRL = reg; -} - -/*! - * brief This function enables-disables the forcing of the output of a given eFlexPwm channel to logic 0. - * - * param base PWM peripheral base address - * param pwmChannel PWM channel to configure - * param subModule PWM submodule to configure - * param forcetozero True: Enable the pwm force output to zero; False: Disable the pwm output resumes normal - * function. - */ -void PWM_SetPwmForceOutputToZero(PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmChannel, bool forcetozero) -{ -#if !defined(PWM_MASK_UPDATE_MASK) - uint16_t reg = base->SM[subModule].CTRL2; -#endif - uint16_t mask; - - if (kPWM_PwmA == pwmChannel) - { - mask = PWM_MASK_MASKA(0x01UL << (uint8_t)subModule); - } - else if (kPWM_PwmB == pwmChannel) - { - mask = PWM_MASK_MASKB(0x01UL << (uint8_t)subModule); - } - else - { - mask = PWM_MASK_MASKX(0x01UL << (uint8_t)subModule); - } - - if (forcetozero) - { - /* Disables the channel output, forcing output level to 0 */ - base->MASK |= mask; - } - else - { - /* Enables the channel output */ - base->MASK &= ~mask; - } - -#if defined(PWM_MASK_UPDATE_MASK) - /* Update output mask bits immediately with UPDATE_MASK bit */ - base->MASK |= PWM_MASK_UPDATE_MASK(0x01UL << (uint8_t)subModule); -#else - /* Select local force signal */ - base->SM[subModule].CTRL2 &= ~(uint16_t)PWM_CTRL2_FORCE_SEL_MASK; - /* Issue a local Force trigger event */ - base->SM[subModule].CTRL2 |= PWM_CTRL2_FORCE_MASK; - /* Restore the source of FORCE OUTPUT signal */ - base->SM[subModule].CTRL2 = reg; -#endif -} - -/*! - * brief This function set the output state of the PWM pin as requested for the current cycle. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmChannel PWM channel to configure - * param outputstate Set pwm output state, see @ref pwm_output_state_t. - */ -void PWM_SetChannelOutput(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - pwm_output_state_t outputstate) -{ - uint16_t mask, swcout, sourceShift; - uint16_t reg = base->SM[subModule].CTRL2; - - if (kPWM_PwmA == pwmChannel) - { - mask = PWM_MASK_MASKA(0x01UL << (uint8_t)subModule); - swcout = (uint16_t)PWM_SWCOUT_SM0OUT23_MASK << ((uint8_t)subModule * 2U); - sourceShift = PWM_DTSRCSEL_SM0SEL23_SHIFT + ((uint16_t)subModule * 4U); - } - else if (kPWM_PwmB == pwmChannel) - { - mask = PWM_MASK_MASKB(0x01UL << (uint8_t)subModule); - swcout = (uint16_t)PWM_SWCOUT_SM0OUT45_MASK << ((uint8_t)subModule * 2U); - sourceShift = PWM_DTSRCSEL_SM0SEL45_SHIFT + ((uint16_t)subModule * 4U); - } - else - { - mask = PWM_MASK_MASKX(0x01UL << (uint8_t)subModule); - swcout = 0U; - sourceShift = 0U; - } - - if (kPWM_MaskState == outputstate) - { - /* Disables the channel output, forcing output level to 0 */ - base->MASK |= mask; - } - else - { - /* Enables the channel output first */ - base->MASK &= ~mask; - /* PwmX only support MASK mode */ - if (kPWM_PwmX != pwmChannel) - { - if (kPWM_HighState == outputstate) - { - base->SWCOUT |= swcout; - base->DTSRCSEL = - (base->DTSRCSEL & ~(uint16_t)(0x3UL << sourceShift)) | (uint16_t)(0x2UL << sourceShift); - } - else if (kPWM_LowState == outputstate) - { - base->SWCOUT &= ~swcout; - base->DTSRCSEL = - (base->DTSRCSEL & ~(uint16_t)(0x3UL << sourceShift)) | (uint16_t)(0x2UL << sourceShift); - } - else if (kPWM_NormalState == outputstate) - { - base->DTSRCSEL &= ~(uint16_t)(0x3UL << sourceShift); - } - else - { - base->DTSRCSEL = - (base->DTSRCSEL & ~(uint16_t)(0x3UL << sourceShift)) | (uint16_t)(0x1UL << sourceShift); - } - } - } - - /* Select local force signal */ - base->SM[subModule].CTRL2 &= ~(uint16_t)PWM_CTRL2_FORCE_SEL_MASK; - /* Issue a local Force trigger event */ - base->SM[subModule].CTRL2 |= PWM_CTRL2_FORCE_MASK; - /* Restore the source of FORCE OUTPUT signal */ - base->SM[subModule].CTRL2 = reg; -} - -#if defined(FSL_FEATURE_PWM_HAS_PHASE_DELAY) && FSL_FEATURE_PWM_HAS_PHASE_DELAY -/*! - * brief This function set the phase delay from the master sync signal of submodule 0. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmChannel PWM channel to configure - * param delayCycles Number of cycles delayed from submodule 0. - * - * return kStatus_Fail if the number of delay cycles is set larger than the period defined in submodule 0; - * kStatus_Success if set phase delay success - */ -status_t PWM_SetPhaseDelay(PWM_Type *base, pwm_channels_t pwmChannel, pwm_submodule_t subModule, uint16_t delayCycles) -{ - assert(subModule != kPWM_Module_0); - uint16_t reg = base->SM[subModule].CTRL2; - - /* Clear LDOK bit if it is set */ - if (0U != (base->MCTRL & PWM_MCTRL_LDOK(1UL << (uint8_t)subModule))) - { - base->MCTRL |= PWM_MCTRL_CLDOK(1UL << (uint8_t)subModule); - } - - if (base->SM[kPWM_Module_0].VAL1 < delayCycles) - { - return kStatus_Fail; - } - else - { - /* - * ERR051989: When the value of the phase delay register SMxPHASEDLY is reduced from a - * non-zero value to 0 and submodule x reload source is from submodule0, the submodule - * x may output an unexpected wide PWM pulse. The workaround is set SMxPHASEDLY=1, - * SMxINIT=SM0INIT-1, SMxVALy=SM0VALy-1 (x=1,2,3, y=0,1,2,3,4,5). - */ -#if defined(FSL_FEATURE_PWM_HAS_ERRATA_51989) && FSL_FEATURE_PWM_HAS_ERRATA_51989 - if (delayCycles == 0 && - ((base->SM[subModule].CTRL2 & PWM_CTRL2_RELOAD_SEL_MASK) >> PWM_CTRL2_RELOAD_SEL_SHIFT) == 1U) - { - base->SM[subModule].PHASEDLY = 1U; - base->SM[subModule].INIT = base->SM[0].INIT - 1U; - base->SM[subModule].VAL0 = base->SM[0].VAL0 - 1U; - base->SM[subModule].VAL1 = base->SM[0].VAL1 - 1U; - base->SM[subModule].VAL2 = base->SM[0].VAL2 - 1U; - base->SM[subModule].VAL3 = base->SM[0].VAL3 - 1U; - base->SM[subModule].VAL4 = base->SM[0].VAL4 - 1U; - base->SM[subModule].VAL5 = base->SM[0].VAL5 - 1U; - } - else - { - base->SM[subModule].PHASEDLY = delayCycles; - } -#else - base->SM[subModule].PHASEDLY = delayCycles; -#endif - } - - /* Select the master sync signal as the source for initialization */ - reg = (reg & ~(uint16_t)PWM_CTRL2_INIT_SEL_MASK) | PWM_CTRL2_INIT_SEL(2); - /* Set Load mode to make Buffered registers take effect immediately when LDOK bit set */ - base->SM[subModule].CTRL |= PWM_CTRL_LDMOD_MASK; - /* Set LDOK bit to load buffer registers */ - base->MCTRL |= PWM_MCTRL_LDOK(1UL << (uint8_t)subModule); - /* Restore the source of phase delay register intialization */ - base->SM[subModule].CTRL2 = reg; - return kStatus_Success; -} -#endif /* FSL_FEATURE_PWM_HAS_PHASE_DELAY */ \ No newline at end of file diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_pwm.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_pwm.h deleted file mode 100644 index 9e0b12ba654..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_pwm.h +++ /dev/null @@ -1,1372 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_PWM_H_ -#define FSL_PWM_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup pwm_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/*! @name Driver version */ -/*! @{ */ -#define FSL_PWM_DRIVER_VERSION (MAKE_VERSION(2, 8, 4)) /*!< Version 2.8.4 */ -/*! @} */ - -/*! Number of bits per submodule for software output control */ -#define PWM_SUBMODULE_SWCONTROL_WIDTH 2 -/*! Because setting the pwm duty cycle doesn't support PWMX, getting the pwm duty cycle also doesn't support PWMX. */ -#define PWM_SUBMODULE_CHANNEL 2 - -/*! @brief List of PWM submodules */ -typedef enum _pwm_submodule -{ - kPWM_Module_0 = 0U, /*!< Submodule 0 */ - kPWM_Module_1, /*!< Submodule 1 */ - kPWM_Module_2, /*!< Submodule 2 */ -#if defined(FSL_FEATURE_PWM_SUBMODULE_COUNT) && (FSL_FEATURE_PWM_SUBMODULE_COUNT > 3U) - kPWM_Module_3 /*!< Submodule 3 */ -#endif /* FSL_FEATURE_PWM_SUBMODULE_COUNT */ -} pwm_submodule_t; - -/*! @brief List of PWM channels in each module */ -typedef enum _pwm_channels -{ - kPWM_PwmB = 0U, - kPWM_PwmA, - kPWM_PwmX -} pwm_channels_t; - -/*! @brief List of PWM value registers */ -typedef enum _pwm_value_register -{ - kPWM_ValueRegister_0 = 0U, /*!< PWM Value0 register */ - kPWM_ValueRegister_1, /*!< PWM Value1 register */ - kPWM_ValueRegister_2, /*!< PWM Value2 register */ - kPWM_ValueRegister_3, /*!< PWM Value3 register */ - kPWM_ValueRegister_4, /*!< PWM Value4 register */ - kPWM_ValueRegister_5 /*!< PWM Value5 register */ -} pwm_value_register_t; - -/*! @brief List of PWM value registers mask */ -enum _pwm_value_register_mask -{ - kPWM_ValueRegisterMask_0 = (1U << 0), /*!< PWM Value0 register mask */ - kPWM_ValueRegisterMask_1 = (1U << 1), /*!< PWM Value1 register mask */ - kPWM_ValueRegisterMask_2 = (1U << 2), /*!< PWM Value2 register mask */ - kPWM_ValueRegisterMask_3 = (1U << 3), /*!< PWM Value3 register mask */ - kPWM_ValueRegisterMask_4 = (1U << 4), /*!< PWM Value4 register mask */ - kPWM_ValueRegisterMask_5 = (1U << 5) /*!< PWM Value5 register mask */ -}; - -/*! @brief PWM clock source selection.*/ -typedef enum _pwm_clock_source -{ - kPWM_BusClock = 0U, /*!< The IPBus clock is used as the clock */ - kPWM_ExternalClock, /*!< EXT_CLK is used as the clock */ - kPWM_Submodule0Clock /*!< Clock of the submodule 0 (AUX_CLK) is used as the source clock */ -} pwm_clock_source_t; - -/*! @brief PWM prescaler factor selection for clock source*/ -typedef enum _pwm_clock_prescale -{ - kPWM_Prescale_Divide_1 = 0U, /*!< PWM clock frequency = fclk/1 */ - kPWM_Prescale_Divide_2, /*!< PWM clock frequency = fclk/2 */ - kPWM_Prescale_Divide_4, /*!< PWM clock frequency = fclk/4 */ - kPWM_Prescale_Divide_8, /*!< PWM clock frequency = fclk/8 */ - kPWM_Prescale_Divide_16, /*!< PWM clock frequency = fclk/16 */ - kPWM_Prescale_Divide_32, /*!< PWM clock frequency = fclk/32 */ - kPWM_Prescale_Divide_64, /*!< PWM clock frequency = fclk/64 */ - kPWM_Prescale_Divide_128 /*!< PWM clock frequency = fclk/128 */ -} pwm_clock_prescale_t; - -/*! @brief Options that can trigger a PWM FORCE_OUT */ -typedef enum _pwm_force_output_trigger -{ - kPWM_Force_Local = 0U, /*!< The local force signal, CTRL2[FORCE], from the submodule is used to force updates */ - kPWM_Force_Master, /*!< The master force signal from submodule 0 is used to force updates */ - kPWM_Force_LocalReload, /*!< The local reload signal from this submodule is used to force updates without regard to - the state of LDOK */ - kPWM_Force_MasterReload, /*!< The master reload signal from submodule 0 is used to force updates if LDOK is set */ - kPWM_Force_LocalSync, /*!< The local sync signal from this submodule is used to force updates */ - kPWM_Force_MasterSync, /*!< The master sync signal from submodule0 is used to force updates */ - kPWM_Force_External, /*!< The external force signal, EXT_FORCE, from outside the PWM module causes updates */ - kPWM_Force_ExternalSync /*!< The external sync signal, EXT_SYNC, from outside the PWM module causes updates */ -} pwm_force_output_trigger_t; - -/*! @brief PWM channel output status */ -typedef enum _pwm_output_state -{ - kPWM_HighState = 0, /*!< The output state of PWM channel is high */ - kPWM_LowState, /*!< The output state of PWM channel is low */ - kPWM_NormalState, /*!< The output state of PWM channel is normal */ - kPWM_InvertState, /*!< The output state of PWM channel is invert */ - kPWM_MaskState /*!< The output state of PWM channel is mask */ -} pwm_output_state_t; - -/*! @brief PWM counter initialization options */ -typedef enum _pwm_init_source -{ - kPWM_Initialize_LocalSync = 0U, /*!< Local sync causes initialization */ - kPWM_Initialize_MasterReload, /*!< Master reload from submodule 0 causes initialization */ - kPWM_Initialize_MasterSync, /*!< Master sync from submodule 0 causes initialization */ - kPWM_Initialize_ExtSync /*!< EXT_SYNC causes initialization */ -} pwm_init_source_t; - -/*! @brief PWM load frequency selection */ -typedef enum _pwm_load_frequency -{ - kPWM_LoadEveryOportunity = 0U, /*!< Every PWM opportunity */ - kPWM_LoadEvery2Oportunity, /*!< Every 2 PWM opportunities */ - kPWM_LoadEvery3Oportunity, /*!< Every 3 PWM opportunities */ - kPWM_LoadEvery4Oportunity, /*!< Every 4 PWM opportunities */ - kPWM_LoadEvery5Oportunity, /*!< Every 5 PWM opportunities */ - kPWM_LoadEvery6Oportunity, /*!< Every 6 PWM opportunities */ - kPWM_LoadEvery7Oportunity, /*!< Every 7 PWM opportunities */ - kPWM_LoadEvery8Oportunity, /*!< Every 8 PWM opportunities */ - kPWM_LoadEvery9Oportunity, /*!< Every 9 PWM opportunities */ - kPWM_LoadEvery10Oportunity, /*!< Every 10 PWM opportunities */ - kPWM_LoadEvery11Oportunity, /*!< Every 11 PWM opportunities */ - kPWM_LoadEvery12Oportunity, /*!< Every 12 PWM opportunities */ - kPWM_LoadEvery13Oportunity, /*!< Every 13 PWM opportunities */ - kPWM_LoadEvery14Oportunity, /*!< Every 14 PWM opportunities */ - kPWM_LoadEvery15Oportunity, /*!< Every 15 PWM opportunities */ - kPWM_LoadEvery16Oportunity /*!< Every 16 PWM opportunities */ -} pwm_load_frequency_t; - -/*! @brief List of PWM fault selections */ -typedef enum _pwm_fault_input -{ - kPWM_Fault_0 = 0U, /*!< Fault 0 input pin */ - kPWM_Fault_1, /*!< Fault 1 input pin */ - kPWM_Fault_2, /*!< Fault 2 input pin */ - kPWM_Fault_3 /*!< Fault 3 input pin */ -} pwm_fault_input_t; - -/*! @brief List of PWM fault disable mapping selections */ -typedef enum _pwm_fault_disable -{ - kPWM_FaultDisable_0 = (1U << 0), /*!< Fault 0 disable mapping */ - kPWM_FaultDisable_1 = (1U << 1), /*!< Fault 1 disable mapping */ - kPWM_FaultDisable_2 = (1U << 2), /*!< Fault 2 disable mapping */ - kPWM_FaultDisable_3 = (1U << 3) /*!< Fault 3 disable mapping */ -} pwm_fault_disable_t; - -/*! @brief List of PWM fault channels */ -typedef enum _pwm_fault_channels -{ - kPWM_faultchannel_0 = 0U, - kPWM_faultchannel_1 -} pwm_fault_channels_t; - -/*! @brief PWM capture edge select */ -typedef enum _pwm_input_capture_edge -{ - kPWM_Disable = 0U, /*!< Disabled */ - kPWM_FallingEdge, /*!< Capture on falling edge only */ - kPWM_RisingEdge, /*!< Capture on rising edge only */ - kPWM_RiseAndFallEdge /*!< Capture on rising or falling edge */ -} pwm_input_capture_edge_t; - -/*! @brief PWM output options when a FORCE_OUT signal is asserted */ -typedef enum _pwm_force_signal -{ - kPWM_UsePwm = 0U, /*!< Generated PWM signal is used by the deadtime logic.*/ - kPWM_InvertedPwm, /*!< Inverted PWM signal is used by the deadtime logic.*/ - kPWM_SoftwareControl, /*!< Software controlled value is used by the deadtime logic. */ - kPWM_UseExternal /*!< PWM_EXTA signal is used by the deadtime logic. */ -} pwm_force_signal_t; - -/*! @brief Options available for the PWM A & B pair operation */ -typedef enum _pwm_chnl_pair_operation -{ - kPWM_Independent = 0U, /*!< PWM A & PWM B operate as 2 independent channels */ - kPWM_ComplementaryPwmA, /*!< PWM A & PWM B are complementary channels, PWM A generates the signal */ - kPWM_ComplementaryPwmB /*!< PWM A & PWM B are complementary channels, PWM B generates the signal */ -} pwm_chnl_pair_operation_t; - -/*! @brief Options available on how to load the buffered-registers with new values */ -typedef enum _pwm_register_reload -{ - kPWM_ReloadImmediate = 0U, /*!< Buffered-registers get loaded with new values as soon as LDOK bit is set */ - kPWM_ReloadPwmHalfCycle, /*!< Registers loaded on a PWM half cycle */ - kPWM_ReloadPwmFullCycle, /*!< Registers loaded on a PWM full cycle */ - kPWM_ReloadPwmHalfAndFullCycle /*!< Registers loaded on a PWM half & full cycle */ -} pwm_register_reload_t; - -/*! @brief Options available on how to re-enable the PWM output when recovering from a fault */ -typedef enum _pwm_fault_recovery_mode -{ - kPWM_NoRecovery = 0U, /*!< PWM output will stay inactive */ - kPWM_RecoverHalfCycle, /*!< PWM output re-enabled at the first half cycle */ - kPWM_RecoverFullCycle, /*!< PWM output re-enabled at the first full cycle */ - kPWM_RecoverHalfAndFullCycle /*!< PWM output re-enabled at the first half or full cycle */ -} pwm_fault_recovery_mode_t; - -/*! @brief List of PWM interrupt options */ -typedef enum _pwm_interrupt_enable -{ - kPWM_CompareVal0InterruptEnable = (1U << 0), /*!< PWM VAL0 compare interrupt */ - kPWM_CompareVal1InterruptEnable = (1U << 1), /*!< PWM VAL1 compare interrupt */ - kPWM_CompareVal2InterruptEnable = (1U << 2), /*!< PWM VAL2 compare interrupt */ - kPWM_CompareVal3InterruptEnable = (1U << 3), /*!< PWM VAL3 compare interrupt */ - kPWM_CompareVal4InterruptEnable = (1U << 4), /*!< PWM VAL4 compare interrupt */ - kPWM_CompareVal5InterruptEnable = (1U << 5), /*!< PWM VAL5 compare interrupt */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX - kPWM_CaptureX0InterruptEnable = (1U << 6), /*!< PWM capture X0 interrupt */ - kPWM_CaptureX1InterruptEnable = (1U << 7), /*!< PWM capture X1 interrupt */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB - kPWM_CaptureB0InterruptEnable = (1U << 8), /*!< PWM capture B0 interrupt */ - kPWM_CaptureB1InterruptEnable = (1U << 9), /*!< PWM capture B1 interrupt */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA - kPWM_CaptureA0InterruptEnable = (1U << 10), /*!< PWM capture A0 interrupt */ - kPWM_CaptureA1InterruptEnable = (1U << 11), /*!< PWM capture A1 interrupt */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA */ - kPWM_ReloadInterruptEnable = (1U << 12), /*!< PWM reload interrupt */ - kPWM_ReloadErrorInterruptEnable = (1U << 13), /*!< PWM reload error interrupt */ - kPWM_Fault0InterruptEnable = (1U << 16), /*!< PWM fault 0 interrupt */ - kPWM_Fault1InterruptEnable = (1U << 17), /*!< PWM fault 1 interrupt */ - kPWM_Fault2InterruptEnable = (1U << 18), /*!< PWM fault 2 interrupt */ - kPWM_Fault3InterruptEnable = (1U << 19) /*!< PWM fault 3 interrupt */ -} pwm_interrupt_enable_t; - -/*! @brief List of PWM status flags */ -typedef enum _pwm_status_flags -{ - kPWM_CompareVal0Flag = (1U << 0), /*!< PWM VAL0 compare flag */ - kPWM_CompareVal1Flag = (1U << 1), /*!< PWM VAL1 compare flag */ - kPWM_CompareVal2Flag = (1U << 2), /*!< PWM VAL2 compare flag */ - kPWM_CompareVal3Flag = (1U << 3), /*!< PWM VAL3 compare flag */ - kPWM_CompareVal4Flag = (1U << 4), /*!< PWM VAL4 compare flag */ - kPWM_CompareVal5Flag = (1U << 5), /*!< PWM VAL5 compare flag */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX - kPWM_CaptureX0Flag = (1U << 6), /*!< PWM capture X0 flag */ - kPWM_CaptureX1Flag = (1U << 7), /*!< PWM capture X1 flag */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB - kPWM_CaptureB0Flag = (1U << 8), /*!< PWM capture B0 flag */ - kPWM_CaptureB1Flag = (1U << 9), /*!< PWM capture B1 flag */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA - kPWM_CaptureA0Flag = (1U << 10), /*!< PWM capture A0 flag */ - kPWM_CaptureA1Flag = (1U << 11), /*!< PWM capture A1 flag */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA */ - kPWM_ReloadFlag = (1U << 12), /*!< PWM reload flag */ - kPWM_ReloadErrorFlag = (1U << 13), /*!< PWM reload error flag */ - kPWM_RegUpdatedFlag = (1U << 14), /*!< PWM registers updated flag */ - kPWM_Fault0Flag = (1U << 16), /*!< PWM fault 0 flag */ - kPWM_Fault1Flag = (1U << 17), /*!< PWM fault 1 flag */ - kPWM_Fault2Flag = (1U << 18), /*!< PWM fault 2 flag */ - kPWM_Fault3Flag = (1U << 19) /*!< PWM fault 3 flag */ -} pwm_status_flags_t; - -/*! @brief List of PWM DMA options */ -typedef enum _pwm_dma_enable -{ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX - kPWM_CaptureX0DMAEnable = (1U << 0), /*!< PWM capture X0 DMA */ - kPWM_CaptureX1DMAEnable = (1U << 1), /*!< PWM capture X1 DMA */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB - kPWM_CaptureB0DMAEnable = (1U << 2), /*!< PWM capture B0 DMA */ - kPWM_CaptureB1DMAEnable = (1U << 3), /*!< PWM capture B1 DMA */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA - kPWM_CaptureA0DMAEnable = (1U << 4), /*!< PWM capture A0 DMA */ - kPWM_CaptureA1DMAEnable = (1U << 5) /*!< PWM capture A1 DMA */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA */ -} pwm_dma_enable_t; - -/*! @brief List of PWM capture DMA enable source select */ -typedef enum _pwm_dma_source_select -{ - kPWM_DMARequestDisable = 0U, /*!< Read DMA requests disabled */ - kPWM_DMAWatermarksEnable, /*!< Exceeding a FIFO watermark sets the DMA read request */ - kPWM_DMALocalSync, /*!< A local sync (VAL1 matches counter) sets the read DMA request */ - kPWM_DMALocalReload /*!< A local reload (STS[RF] being set) sets the read DMA request */ -} pwm_dma_source_select_t; - -/*! @brief PWM FIFO Watermark AND Control */ -typedef enum _pwm_watermark_control -{ - kPWM_FIFOWatermarksOR = 0U, /*!< Selected FIFO watermarks are OR'ed together */ - kPWM_FIFOWatermarksAND /*!< Selected FIFO watermarks are AND'ed together */ -} pwm_watermark_control_t; - -/*! @brief PWM operation mode */ -typedef enum _pwm_mode -{ - kPWM_SignedCenterAligned = 0U, /*!< Signed center-aligned */ - kPWM_CenterAligned, /*!< Unsigned cente-aligned */ - kPWM_SignedEdgeAligned, /*!< Signed edge-aligned */ - kPWM_EdgeAligned /*!< Unsigned edge-aligned */ -} pwm_mode_t; - -/*! @brief PWM output pulse mode, high-true or low-true */ -typedef enum _pwm_level_select -{ - kPWM_HighTrue = 0U, /*!< High level represents "on" or "active" state */ - kPWM_LowTrue /*!< Low level represents "on" or "active" state */ -} pwm_level_select_t; - -/*! @brief PWM output fault status */ -typedef enum _pwm_fault_state -{ - kPWM_PwmFaultState0 = - 0U, /*!< Output is forced to logic 0 state prior to consideration of output polarity control. */ - kPWM_PwmFaultState1, /*!< Output is forced to logic 1 state prior to consideration of output polarity control. */ - kPWM_PwmFaultState2, /*!< Output is tristated. */ - kPWM_PwmFaultState3 /*!< Output is tristated. */ -} pwm_fault_state_t; - -/*! @brief PWM reload source select */ -typedef enum _pwm_reload_source_select -{ - kPWM_LocalReload = 0U, /*!< The local reload signal is used to reload registers */ - kPWM_MasterReload /*!< The master reload signal (from submodule 0) is used to reload */ -} pwm_reload_source_select_t; - -/*! @brief PWM fault clearing options */ -typedef enum _pwm_fault_clear -{ - kPWM_Automatic = 0U, /*!< Automatic fault clearing */ - kPWM_ManualNormal, /*!< Manual fault clearing with no fault safety mode */ - kPWM_ManualSafety /*!< Manual fault clearing with fault safety mode */ -} pwm_fault_clear_t; - -/*! @brief Options for submodule master control operation */ -typedef enum _pwm_module_control -{ - kPWM_Control_Module_0 = (1U << 0), /*!< Control submodule 0's start/stop,buffer reload operation */ - kPWM_Control_Module_1 = (1U << 1), /*!< Control submodule 1's start/stop,buffer reload operation */ - kPWM_Control_Module_2 = (1U << 2), /*!< Control submodule 2's start/stop,buffer reload operation */ - kPWM_Control_Module_3 = (1U << 3) /*!< Control submodule 3's start/stop,buffer reload operation */ -} pwm_module_control_t; - -/*! @brief Structure for the user to define the PWM signal characteristics */ -typedef struct _pwm_signal_param -{ - pwm_channels_t pwmChannel; /*!< PWM channel being configured; PWM A or PWM B */ - uint8_t dutyCyclePercent; /*!< PWM pulse width, value should be between 0 to 100 - 0=inactive signal(0% duty cycle)... - 100=always active signal (100% duty cycle)*/ - pwm_level_select_t level; /*!< PWM output active level select */ - uint16_t deadtimeValue; /*!< The deadtime value; only used if channel pair is operating in complementary mode */ - pwm_fault_state_t faultState; /*!< PWM output fault status */ - bool pwmchannelenable; /*!< Enable PWM output */ -} pwm_signal_param_t; - -/*! - * @brief PWM config structure - * - * This structure holds the configuration settings for the PWM peripheral. To initialize this - * structure to reasonable defaults, call the PWM_GetDefaultConfig() function and pass a - * pointer to your config structure instance. - * - * The config struct can be made const so it resides in flash - */ -typedef struct _pwm_config -{ - bool enableDebugMode; /*!< true: PWM continues to run in debug mode; - false: PWM is paused in debug mode */ -#if !defined(FSL_FEATURE_PWM_HAS_NO_WAITEN) || (!FSL_FEATURE_PWM_HAS_NO_WAITEN) - bool enableWait; /*!< true: PWM continues to run in WAIT mode; - false: PWM is paused in WAIT mode */ -#endif /* FSL_FEATURE_PWM_HAS_NO_WAITEN */ - pwm_init_source_t initializationControl; /*!< Option to initialize the counter */ - pwm_clock_source_t clockSource; /*!< Clock source for the counter */ - pwm_clock_prescale_t prescale; /*!< Pre-scaler to divide down the clock */ - pwm_chnl_pair_operation_t pairOperation; /*!< Channel pair in indepedent or complementary mode */ - pwm_register_reload_t reloadLogic; /*!< PWM Reload logic setup */ - pwm_reload_source_select_t reloadSelect; /*!< Reload source select */ - pwm_load_frequency_t reloadFrequency; /*!< Specifies when to reload, used when user's choice - is not immediate reload */ - pwm_force_output_trigger_t forceTrigger; /*!< Specify which signal will trigger a FORCE_OUT */ -} pwm_config_t; - -/*! @brief Structure for the user to configure the fault input filter. */ -typedef struct _pwm_fault_input_filter_param -{ - uint8_t faultFilterCount; /*!< Fault filter count */ - uint8_t faultFilterPeriod; /*!< Fault filter period;value of 0 will bypass the filter */ - bool faultGlitchStretch; /*!< Fault Glitch Stretch Enable: A logic 1 means that input - fault signals will be stretched to at least 2 IPBus clock cycles */ -} pwm_fault_input_filter_param_t; - -/*! @brief Structure is used to hold the parameters to configure a PWM fault */ -typedef struct _pwm_fault_param -{ - pwm_fault_clear_t faultClearingMode; /*!< Fault clearing mode to use */ - bool faultLevel; /*!< true: Logic 1 indicates fault; - false: Logic 0 indicates fault */ - bool enableCombinationalPath; /*!< true: Combinational Path from fault input is enabled; - false: No combination path is available */ - pwm_fault_recovery_mode_t recoverMode; /*!< Specify when to re-enable the PWM output */ -} pwm_fault_param_t; - -/*! - * @brief Structure is used to hold parameters to configure the capture capability of a signal pin - */ -typedef struct _pwm_input_capture_param -{ - bool captureInputSel; /*!< true: Use the edge counter signal as source - false: Use the raw input signal from the pin as source */ - uint8_t edgeCompareValue; /*!< Compare value, used only if edge counter is used as source */ - pwm_input_capture_edge_t edge0; /*!< Specify which edge causes a capture for input circuitry 0 */ - pwm_input_capture_edge_t edge1; /*!< Specify which edge causes a capture for input circuitry 1 */ - bool enableOneShotCapture; /*!< true: Use one-shot capture mode; - false: Use free-running capture mode */ - uint8_t fifoWatermark; /*!< Watermark level for capture FIFO. The capture flags in - the status register will set if the word count in the FIFO - is greater than this watermark level */ -} pwm_input_capture_param_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Ungates the PWM submodule clock and configures the peripheral for basic operation. - * - * @note This API should be called at the beginning of the application using the PWM driver. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param config Pointer to user's PWM config structure. - * - * @return kStatus_Success means success; else failed. - */ -status_t PWM_Init(PWM_Type *base, pwm_submodule_t subModule, const pwm_config_t *config); - -/*! - * @brief Gate the PWM submodule clock - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to deinitialize - */ -void PWM_Deinit(PWM_Type *base, pwm_submodule_t subModule); - -/*! - * @brief Fill in the PWM config struct with the default settings - * - * The default values are: - * @code - * config->enableDebugMode = false; - * config->enableWait = false; - * config->reloadSelect = kPWM_LocalReload; - * config->clockSource = kPWM_BusClock; - * config->prescale = kPWM_Prescale_Divide_1; - * config->initializationControl = kPWM_Initialize_LocalSync; - * config->forceTrigger = kPWM_Force_Local; - * config->reloadFrequency = kPWM_LoadEveryOportunity; - * config->reloadLogic = kPWM_ReloadImmediate; - * config->pairOperation = kPWM_Independent; - * @endcode - * @param config Pointer to user's PWM config structure. - */ -void PWM_GetDefaultConfig(pwm_config_t *config); - -/*! @}*/ - -/*! - * @name Module PWM output - * @{ - */ -/*! - * @brief Sets up the PWM signals for a PWM submodule. - * - * The function initializes the submodule according to the parameters passed in by the user. The function - * also sets up the value compare registers to match the PWM signal requirements. - * If the dead time insertion logic is enabled, the pulse period is reduced by the - * dead time period specified by the user. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param chnlParams Array of PWM channel parameters to configure the channel(s), PWMX submodule is not supported. - * @param numOfChnls Number of channels to configure, this should be the size of the array passed in. - * Array size should not be more than 2 as each submodule has 2 pins to output PWM - * @param mode PWM operation mode, options available in enumeration ::pwm_mode_t - * @param pwmFreq_Hz PWM signal frequency in Hz - * @param srcClock_Hz PWM source clock of correspond submodule in Hz. If source clock of submodule1,2,3 is from - * submodule0 AUX_CLK, its source clock is submodule0 source clock divided with submodule0 - * prescaler value instead of submodule0 source clock. - * - * @return Returns kStatus_Fail if there was error setting up the signal; kStatus_Success otherwise - */ -status_t PWM_SetupPwm(PWM_Type *base, - pwm_submodule_t subModule, - const pwm_signal_param_t *chnlParams, - uint8_t numOfChnls, - pwm_mode_t mode, - uint32_t pwmFreq_Hz, - uint32_t srcClock_Hz); - -/*! - * @brief Set PWM phase shift for PWM channel running on channel PWM_A, PWM_B which with 50% duty cycle. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel PWM channel to configure - * @param pwmFreq_Hz PWM signal frequency in Hz - * @param srcClock_Hz PWM main counter clock in Hz. - * @param shiftvalue Phase shift value, range in 0 ~ 50 - * @param doSync true: Set LDOK bit for the submodule list; - * false: LDOK bit don't set, need to call PWM_SetPwmLdok to sync update. - * - * @return Returns kStatus_Fail if there was error setting up the signal; kStatus_Success otherwise - */ -status_t PWM_SetupPwmPhaseShift(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - uint32_t pwmFreq_Hz, - uint32_t srcClock_Hz, - uint8_t shiftvalue, - bool doSync); - -/*! - * @brief Updates the PWM signal's dutycycle. - * - * The function updates the PWM dutycyle to the new value that is passed in. - * If the dead time insertion logic is enabled then the pulse period is reduced by the - * dead time period specified by the user. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmSignal Signal (PWM A or PWM B) to update - * @param currPwmMode The current PWM mode set during PWM setup - * @param dutyCyclePercent New PWM pulse width, value should be between 0 to 100 - * 0=inactive signal(0% duty cycle)... - * 100=active signal (100% duty cycle) - */ -void PWM_UpdatePwmDutycycle(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmSignal, - pwm_mode_t currPwmMode, - uint8_t dutyCyclePercent); - -/*! - * @brief Updates the PWM signal's dutycycle with 16-bit accuracy. - * - * The function updates the PWM dutycyle to the new value that is passed in. - * If the dead time insertion logic is enabled then the pulse period is reduced by the - * dead time period specified by the user. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmSignal Signal (PWM A or PWM B) to update - * @param currPwmMode The current PWM mode set during PWM setup - * @param dutyCycle New PWM pulse width, value should be between 0 to 65535 - * 0=inactive signal(0% duty cycle)... - * 65535=active signal (100% duty cycle) - */ -void PWM_UpdatePwmDutycycleHighAccuracy( - PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmSignal, pwm_mode_t currPwmMode, uint16_t dutyCycle); - -/*! - * @brief Update the PWM signal's period and dutycycle for a PWM submodule. - * - * The function updates PWM signal period generated by a specific submodule according to the parameters - * passed in by the user. This function can also set dutycycle weather you want to keep original dutycycle - * or update new dutycycle. Call this function in local sync control mode because PWM period is depended by - * INIT and VAL1 register of each submodule. In master sync initialization control mode, call this function - * to update INIT and VAL1 register of all submodule because PWM period is depended by INIT and VAL1 register - * in submodule0. If the dead time insertion logic is enabled, the pulse period is reduced by the dead time - * period specified by the user. PWM signal will not be generated if its period is less than dead time duration. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmSignal Signal (PWM A or PWM B) to update - * @param currPwmMode The current PWM mode set during PWM setup, options available in enumeration ::pwm_mode_t - * @param pulseCnt New PWM period, value should be between 0 to 65535 - * 0=minimum PWM period... - * 65535=maximum PWM period - * @param dutyCycle New PWM pulse width of channel, value should be between 0 to 65535 - * 0=inactive signal(0% duty cycle)... - * 65535=active signal (100% duty cycle) - * You can keep original duty cycle or update new duty cycle - */ -void PWM_UpdatePwmPeriodAndDutycycle(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmSignal, - pwm_mode_t currPwmMode, - uint16_t pulseCnt, - uint16_t dutyCycle); - -/*! @}*/ - -/*! - * @brief Sets up the PWM input capture - * - * Each PWM submodule has 3 pins that can be configured for use as input capture pins. This function - * sets up the capture parameters for each pin and enables the pin for input capture operation. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel Channel in the submodule to setup - * @param inputCaptureParams Parameters passed in to set up the input pin - */ -void PWM_SetupInputCapture(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - const pwm_input_capture_param_t *inputCaptureParams); - -/*! - * @brief Sets up the PWM fault input filter. - * - * @param base PWM peripheral base address - * @param faultInputFilterParams Parameters passed in to set up the fault input filter. - */ -void PWM_SetupFaultInputFilter(PWM_Type *base, const pwm_fault_input_filter_param_t *faultInputFilterParams); - -/*! - * @brief Sets up the PWM fault protection. - * - * PWM has 4 fault inputs. - * - * @param base PWM peripheral base address - * @param faultNum PWM fault to configure. - * @param faultParams Pointer to the PWM fault config structure - */ -void PWM_SetupFaults(PWM_Type *base, pwm_fault_input_t faultNum, const pwm_fault_param_t *faultParams); - -/*! - * @brief Fill in the PWM fault config struct with the default settings - * - * The default values are: - * @code - * config->faultClearingMode = kPWM_Automatic; - * config->faultLevel = false; - * config->enableCombinationalPath = true; - * config->recoverMode = kPWM_NoRecovery; - * @endcode - * @param config Pointer to user's PWM fault config structure. - */ -void PWM_FaultDefaultConfig(pwm_fault_param_t *config); - -/*! - * @brief Selects the signal to output on a PWM pin when a FORCE_OUT signal is asserted. - * - * The user specifies which channel to configure by supplying the submodule number and whether - * to modify PWM A or PWM B within that submodule. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel Channel to configure - * @param mode Signal to output when a FORCE_OUT is triggered - */ -void PWM_SetupForceSignal(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - pwm_force_signal_t mode); - -/*! - * @name Interrupts Interface - * @{ - */ - -/*! - * @brief Enables the selected PWM interrupts - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::pwm_interrupt_enable_t - */ -void PWM_EnableInterrupts(PWM_Type *base, pwm_submodule_t subModule, uint32_t mask); - -/*! - * @brief Disables the selected PWM interrupts - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::pwm_interrupt_enable_t - */ -void PWM_DisableInterrupts(PWM_Type *base, pwm_submodule_t subModule, uint32_t mask); - -/*! - * @brief Gets the enabled PWM interrupts - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * - * @return The enabled interrupts. This is the logical OR of members of the - * enumeration ::pwm_interrupt_enable_t - */ -uint32_t PWM_GetEnabledInterrupts(PWM_Type *base, pwm_submodule_t subModule); - -/*! @}*/ - -/*! - * @name DMA Interface - * @{ - */ - -/*! - * @brief Capture DMA Enable Source Select. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwm_watermark_control PWM FIFO watermark and control - */ -static inline void PWM_DMAFIFOWatermarkControl(PWM_Type *base, - pwm_submodule_t subModule, - pwm_watermark_control_t pwm_watermark_control) -{ - uint16_t reg = base->SM[subModule].DMAEN; - if (pwm_watermark_control == kPWM_FIFOWatermarksOR) - { - reg &= ~((uint16_t)PWM_DMAEN_FAND_MASK); - } - else - { - reg |= ((uint16_t)PWM_DMAEN_FAND_MASK); - } - base->SM[subModule].DMAEN = reg; -} - -/*! - * @brief Capture DMA Enable Source Select. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwm_dma_source_select PWM capture DMA enable source select - */ -static inline void PWM_DMACaptureSourceSelect(PWM_Type *base, - pwm_submodule_t subModule, - pwm_dma_source_select_t pwm_dma_source_select) -{ - uint16_t reg = base->SM[subModule].DMAEN; - - reg &= ~((uint16_t)PWM_DMAEN_CAPTDE_MASK); - reg |= (((uint16_t)pwm_dma_source_select << (uint16_t)PWM_DMAEN_CAPTDE_SHIFT) & (uint16_t)PWM_DMAEN_CAPTDE_MASK); - - base->SM[subModule].DMAEN = reg; -} - -/*! - * @brief Enables or disables the selected PWM DMA Capture read request. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param mask The DMA to enable or disable. This is a logical OR of members of the - * enumeration ::pwm_dma_enable_t - * @param activate true: Enable DMA read request; false: Disable DMA read request - */ -static inline void PWM_EnableDMACapture(PWM_Type *base, pwm_submodule_t subModule, uint16_t mask, bool activate) -{ - uint16_t reg = base->SM[subModule].DMAEN; - if (activate) - { - reg |= (uint16_t)(mask); - } - else - { - reg &= ~((uint16_t)(mask)); - } - base->SM[subModule].DMAEN = reg; -} - -/*! - * @brief Enables or disables the PWM DMA write request. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param activate true: Enable DMA write request; false: Disable DMA write request - */ -static inline void PWM_EnableDMAWrite(PWM_Type *base, pwm_submodule_t subModule, bool activate) -{ - uint16_t reg = base->SM[subModule].DMAEN; - if (activate) - { - reg |= ((uint16_t)PWM_DMAEN_VALDE_MASK); - } - else - { - reg &= ~((uint16_t)PWM_DMAEN_VALDE_MASK); - } - base->SM[subModule].DMAEN = reg; -} - -/*! @}*/ - -/*! - * @name Status Interface - * @{ - */ - -/*! - * @brief Gets the PWM status flags - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * - * @return The status flags. This is the logical OR of members of the - * enumeration ::pwm_status_flags_t - */ -uint32_t PWM_GetStatusFlags(PWM_Type *base, pwm_submodule_t subModule); - -/*! - * @brief Clears the PWM status flags - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::pwm_status_flags_t - */ -void PWM_ClearStatusFlags(PWM_Type *base, pwm_submodule_t subModule, uint32_t mask); - -/*! @}*/ - -/*! - * @name Timer Start and Stop - * @{ - */ - -/*! - * @brief Starts the PWM counter for a single or multiple submodules. - * - * Sets the Run bit which enables the clocks to the PWM submodule. This function can start multiple - * submodules at the same time. - * - * @param base PWM peripheral base address - * @param subModulesToStart PWM submodules to start. This is a logical OR of members of the - * enumeration ::pwm_module_control_t - */ -static inline void PWM_StartTimer(PWM_Type *base, uint8_t subModulesToStart) -{ - base->MCTRL |= PWM_MCTRL_RUN(subModulesToStart); -} - -/*! - * @brief Stops the PWM counter for a single or multiple submodules. - * - * Clears the Run bit which resets the submodule's counter. This function can stop multiple - * submodules at the same time. - * - * @param base PWM peripheral base address - * @param subModulesToStop PWM submodules to stop. This is a logical OR of members of the - * enumeration ::pwm_module_control_t - */ -static inline void PWM_StopTimer(PWM_Type *base, uint8_t subModulesToStop) -{ - base->MCTRL &= ~(PWM_MCTRL_RUN(subModulesToStop)); -} - -/*! @}*/ - -/*! - * @brief Set the PWM VALx registers. - * - * This function allows the user to write value into VAL registers directly. And it will destroying the PWM clock period - * set by the PWM_SetupPwm()/PWM_SetupPwmPhaseShift() functions. - * Due to VALx registers are bufferd, the new value will not active uless call PWM_SetPwmLdok() and the reload point is - * reached. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param valueRegister VALx register that will be writen new value - * @param value Value that will been write into VALx register - */ -static inline void PWM_SetVALxValue(PWM_Type *base, - pwm_submodule_t subModule, - pwm_value_register_t valueRegister, - uint16_t value) -{ - switch (valueRegister) - { - case kPWM_ValueRegister_0: - base->SM[subModule].VAL0 = value; - break; - case kPWM_ValueRegister_1: - base->SM[subModule].VAL1 = value; - break; - case kPWM_ValueRegister_2: - base->SM[subModule].VAL2 = value; - break; - case kPWM_ValueRegister_3: - base->SM[subModule].VAL3 = value; - break; - case kPWM_ValueRegister_4: - base->SM[subModule].VAL4 = value; - break; - case kPWM_ValueRegister_5: - base->SM[subModule].VAL5 = value; - break; - default: - assert(false); - break; - } -} - -/*! - * @brief Get the PWM VALx registers. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param valueRegister VALx register that will be read value - * @return The VALx register value - */ -static inline uint16_t PWM_GetVALxValue(PWM_Type *base, pwm_submodule_t subModule, pwm_value_register_t valueRegister) -{ - uint16_t temp = 0U; - - switch (valueRegister) - { - case kPWM_ValueRegister_0: - temp = base->SM[subModule].VAL0; - break; - case kPWM_ValueRegister_1: - temp = base->SM[subModule].VAL1; - break; - case kPWM_ValueRegister_2: - temp = base->SM[subModule].VAL2; - break; - case kPWM_ValueRegister_3: - temp = base->SM[subModule].VAL3; - break; - case kPWM_ValueRegister_4: - temp = base->SM[subModule].VAL4; - break; - case kPWM_ValueRegister_5: - temp = base->SM[subModule].VAL5; - break; - default: - assert(false); - break; - } - - return temp; -} - -/*! - * @brief Enables or disables the PWM output trigger. - * - * This function allows the user to enable or disable the PWM trigger. The PWM has 2 triggers. Trigger 0 - * is activated when the counter matches VAL 0, VAL 2, or VAL 4 register. Trigger 1 is activated - * when the counter matches VAL 1, VAL 3, or VAL 5 register. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param valueRegister Value register that will activate the trigger - * @param activate true: Enable the trigger; false: Disable the trigger - */ -static inline void PWM_OutputTriggerEnable(PWM_Type *base, - pwm_submodule_t subModule, - pwm_value_register_t valueRegister, - bool activate) -{ - if (activate) - { - base->SM[subModule].TCTRL |= ((uint16_t)1U << (uint16_t)valueRegister); - } - else - { - base->SM[subModule].TCTRL &= ~((uint16_t)1U << (uint16_t)valueRegister); - } -} - -/*! - * @brief Enables the PWM output trigger. - * - * This function allows the user to enable one or more (VAL0-5) PWM trigger. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param valueRegisterMask Value register mask that will activate one or more (VAL0-5) trigger - * enumeration ::_pwm_value_register_mask - */ -static inline void PWM_ActivateOutputTrigger(PWM_Type *base, pwm_submodule_t subModule, uint16_t valueRegisterMask) -{ - base->SM[subModule].TCTRL |= (PWM_TCTRL_OUT_TRIG_EN_MASK & (valueRegisterMask)); -} - -/*! - * @brief Disables the PWM output trigger. - * - * This function allows the user to disables one or more (VAL0-5) PWM trigger. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param valueRegisterMask Value register mask that will Deactivate one or more (VAL0-5) trigger - * enumeration ::_pwm_value_register_mask - */ -static inline void PWM_DeactivateOutputTrigger(PWM_Type *base, pwm_submodule_t subModule, uint16_t valueRegisterMask) -{ - base->SM[subModule].TCTRL &= ~(PWM_TCTRL_OUT_TRIG_EN_MASK & (valueRegisterMask)); -} - -/*! - * @brief Sets the software control output for a pin to high or low. - * - * The user specifies which channel to modify by supplying the submodule number and whether - * to modify PWM A or PWM B within that submodule. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel Channel to configure - * @param value true: Supply a logic 1, false: Supply a logic 0. - */ -static inline void PWM_SetupSwCtrlOut(PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmChannel, bool value) -{ - if (value) - { - base->SWCOUT |= - ((uint16_t)1U << (((uint16_t)subModule * (uint16_t)PWM_SUBMODULE_SWCONTROL_WIDTH) + (uint16_t)pwmChannel)); - } - else - { - base->SWCOUT &= - ~((uint16_t)1U << (((uint16_t)subModule * (uint16_t)PWM_SUBMODULE_SWCONTROL_WIDTH) + (uint16_t)pwmChannel)); - } -} - -/*! - * @brief Sets or clears the PWM LDOK bit on a single or multiple submodules - * - * Set LDOK bit to load buffered values into CTRL[PRSC] and the INIT, FRACVAL and VAL registers. The - * values are loaded immediately if kPWM_ReloadImmediate option was choosen during config. Else the - * values are loaded at the next PWM reload point. - * This function can issue the load command to multiple submodules at the same time. - * - * @param base PWM peripheral base address - * @param subModulesToUpdate PWM submodules to update with buffered values. This is a logical OR of - * members of the enumeration ::pwm_module_control_t - * @param value true: Set LDOK bit for the submodule list; false: Clear LDOK bit - */ -static inline void PWM_SetPwmLdok(PWM_Type *base, uint8_t subModulesToUpdate, bool value) -{ - if (value) - { - base->MCTRL |= PWM_MCTRL_LDOK(subModulesToUpdate); - } - else - { - base->MCTRL |= PWM_MCTRL_CLDOK(subModulesToUpdate); - } -} - -/*! - * @brief Set PWM output fault status - * - * These bits determine the fault state for the PWM_A output in fault conditions - * and STOP mode. It may also define the output state in WAIT and DEBUG modes - * depending on the settings of CTRL2[WAITEN] and CTRL2[DBGEN]. - * This function can update PWM output fault status. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel Channel to configure - * @param faultState PWM output fault status - */ -static inline void PWM_SetPwmFaultState(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - pwm_fault_state_t faultState) -{ - uint16_t reg = base->SM[subModule].OCTRL; - switch (pwmChannel) - { - case kPWM_PwmA: - reg &= ~((uint16_t)PWM_OCTRL_PWMAFS_MASK); - reg |= (((uint16_t)faultState << (uint16_t)PWM_OCTRL_PWMAFS_SHIFT) & (uint16_t)PWM_OCTRL_PWMAFS_MASK); - break; - case kPWM_PwmB: - reg &= ~((uint16_t)PWM_OCTRL_PWMBFS_MASK); - reg |= (((uint16_t)faultState << (uint16_t)PWM_OCTRL_PWMBFS_SHIFT) & (uint16_t)PWM_OCTRL_PWMBFS_MASK); - break; - case kPWM_PwmX: - reg &= ~((uint16_t)PWM_OCTRL_PWMXFS_MASK); - reg |= (((uint16_t)faultState << (uint16_t)PWM_OCTRL_PWMXFS_SHIFT) & (uint16_t)PWM_OCTRL_PWMXFS_MASK); - break; - default: - assert(false); - break; - } - base->SM[subModule].OCTRL = reg; -} - -/*! - * @brief Set PWM fault disable mapping - * - * Each of the four bits of this read/write field is one-to-one associated - * with the four FAULTx inputs of fault channel 0/1. The PWM output will be turned - * off if there is a logic 1 on an FAULTx input and a 1 in the corresponding - * bit of this field. A reset sets all bits in this field. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel PWM channel to configure - * @param pwm_fault_channels PWM fault channel to configure - * @param value Fault disable mapping mask value - * enumeration ::pwm_fault_disable_t - */ -static inline void PWM_SetupFaultDisableMap(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - pwm_fault_channels_t pwm_fault_channels, - uint16_t value) -{ - uint16_t reg = base->SM[subModule].DISMAP[pwm_fault_channels]; - switch (pwmChannel) - { - case kPWM_PwmA: - reg &= ~((uint16_t)PWM_DISMAP_DIS0A_MASK); - reg |= (((uint16_t)(value) << (uint16_t)PWM_DISMAP_DIS0A_SHIFT) & (uint16_t)PWM_DISMAP_DIS0A_MASK); - break; - case kPWM_PwmB: - reg &= ~((uint16_t)PWM_DISMAP_DIS0B_MASK); - reg |= (((uint16_t)(value) << (uint16_t)PWM_DISMAP_DIS0B_SHIFT) & (uint16_t)PWM_DISMAP_DIS0B_MASK); - break; - case kPWM_PwmX: - reg &= ~((uint16_t)PWM_DISMAP_DIS0X_MASK); - reg |= (((uint16_t)(value) << (uint16_t)PWM_DISMAP_DIS0X_SHIFT) & (uint16_t)PWM_DISMAP_DIS0X_MASK); - break; - default: - assert(false); - break; - } - base->SM[subModule].DISMAP[pwm_fault_channels] = reg; -} - -/*! - * @brief Set PWM output enable - * - * This feature allows the user to enable the PWM Output. - * - * @param base PWM peripheral base address - * @param pwmChannel PWM channel to configure - * @param subModule PWM submodule to configure - */ -static inline void PWM_OutputEnable(PWM_Type *base, pwm_channels_t pwmChannel, pwm_submodule_t subModule) -{ - /* Set PWM output */ - switch (pwmChannel) - { - case kPWM_PwmA: - base->OUTEN |= ((uint16_t)1U << ((uint16_t)PWM_OUTEN_PWMA_EN_SHIFT + (uint16_t)subModule)); - break; - case kPWM_PwmB: - base->OUTEN |= ((uint16_t)1U << ((uint16_t)PWM_OUTEN_PWMB_EN_SHIFT + (uint16_t)subModule)); - break; - case kPWM_PwmX: - base->OUTEN |= ((uint16_t)1U << ((uint16_t)PWM_OUTEN_PWMX_EN_SHIFT + (uint16_t)subModule)); - break; - default: - assert(false); - break; - } -} - -/*! - * @brief Set PWM output disable - * - *This feature allows the user to disable the PWM output. - * - * @param base PWM peripheral base address - * @param pwmChannel PWM channel to configure - * @param subModule PWM submodule to configure - */ -static inline void PWM_OutputDisable(PWM_Type *base, pwm_channels_t pwmChannel, pwm_submodule_t subModule) -{ - switch (pwmChannel) - { - case kPWM_PwmA: - base->OUTEN &= ~((uint16_t)1U << ((uint16_t)PWM_OUTEN_PWMA_EN_SHIFT + (uint16_t)subModule)); - break; - case kPWM_PwmB: - base->OUTEN &= ~((uint16_t)1U << ((uint16_t)PWM_OUTEN_PWMB_EN_SHIFT + (uint16_t)subModule)); - break; - case kPWM_PwmX: - base->OUTEN &= ~((uint16_t)1U << ((uint16_t)PWM_OUTEN_PWMX_EN_SHIFT + (uint16_t)subModule)); - break; - default: - assert(false); - break; - } -} - -/*! - * @brief Get the dutycycle value. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel PWM channel to configure - * - * @return Current channel dutycycle value. - */ -uint8_t PWM_GetPwmChannelState(PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmChannel); - -/*! - * @brief Set PWM output in idle status (high or low). - * - * @note This API should call after PWM_SetupPwm() APIs, and PWMX submodule is not supported. - * - * @param base PWM peripheral base address - * @param pwmChannel PWM channel to configure - * @param subModule PWM submodule to configure - * @param idleStatus True: PWM output is high in idle status; false: PWM output is low in idle status. - * - * @return kStatus_Fail if there was error setting up the signal; kStatus_Success if set output idle success - */ -status_t PWM_SetOutputToIdle(PWM_Type *base, pwm_channels_t pwmChannel, pwm_submodule_t subModule, bool idleStatus); - -/*! - * @brief Set the pwm submodule prescaler. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param prescaler Set prescaler value - */ -void PWM_SetClockMode(PWM_Type *base, pwm_submodule_t subModule, pwm_clock_prescale_t prescaler); - -/*! - * @brief This function enables-disables the forcing of the output of a given eFlexPwm channel to logic 0. - * - * @param base PWM peripheral base address - * @param pwmChannel PWM channel to configure - * @param subModule PWM submodule to configure - * @param forcetozero True: Enable the pwm force output to zero; False: Disable the pwm output resumes normal - * function. - */ -void PWM_SetPwmForceOutputToZero(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - bool forcetozero); - -/*! - * @brief This function set the output state of the PWM pin as requested for the current cycle. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel PWM channel to configure - * @param outputstate Set pwm output state, see @ref pwm_output_state_t. - */ -void PWM_SetChannelOutput(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - pwm_output_state_t outputstate); - -#if defined(FSL_FEATURE_PWM_HAS_PHASE_DELAY) && FSL_FEATURE_PWM_HAS_PHASE_DELAY -/*! - * @brief This function set the phase delay from the master sync signal of submodule 0. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel PWM channel to configure - * @param delayCycles Number of cycles delayed from submodule 0. - * - * @return kStatus_Fail if the number of delay cycles is set larger than the period defined in submodule 0; - * kStatus_Success if set phase delay success - */ -status_t PWM_SetPhaseDelay(PWM_Type *base, pwm_channels_t pwmChannel, pwm_submodule_t subModule, uint16_t delayCycles); -#endif - -#if defined(FSL_FEATURE_PWM_HAS_INPUT_FILTER_CAPTURE) && FSL_FEATURE_PWM_HAS_INPUT_FILTER_CAPTURE -/*! - * @brief This function set the number of consecutive samples that must agree prior to the input filter. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel PWM channel to configure - * @param filterSampleCount Number of consecutive samples. - */ -static inline void PWM_SetFilterSampleCount(PWM_Type *base, - pwm_channels_t pwmChannel, - pwm_submodule_t subModule, - uint8_t filterSampleCount) -{ - switch(pwmChannel) - { -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA - case kPWM_PwmA: - base->SM[subModule].CAPTFILTA &= ~((uint16_t)PWM_CAPTFILTA_CAPTA_FILT_CNT_MASK); - base->SM[subModule].CAPTFILTA |= PWM_CAPTFILTA_CAPTA_FILT_CNT(filterSampleCount); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB - case kPWM_PwmB: - base->SM[subModule].CAPTFILTB &= ~((uint16_t)PWM_CAPTFILTB_CAPTB_FILT_CNT_MASK); - base->SM[subModule].CAPTFILTB |= PWM_CAPTFILTB_CAPTB_FILT_CNT(filterSampleCount); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX - case kPWM_PwmX: - base->SM[subModule].CAPTFILTX &= ~((uint16_t)PWM_CAPTFILTX_CAPTX_FILT_CNT_MASK); - base->SM[subModule].CAPTFILTX |= PWM_CAPTFILTX_CAPTX_FILT_CNT(filterSampleCount); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX */ - default: - assert(false); - break; - } -} - -/*! - * @brief This function set the sampling period of the fault pin input filter. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel PWM channel to configure - * @param filterSamplePeriod Sampling period of input filter. - */ -static inline void PWM_SetFilterSamplePeriod(PWM_Type *base, - pwm_channels_t pwmChannel, - pwm_submodule_t subModule, - uint8_t filterSamplePeriod) -{ - switch(pwmChannel) - { -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA - case kPWM_PwmA: - base->SM[subModule].CAPTFILTA &= ~((uint16_t)PWM_CAPTFILTA_CAPTA_FILT_PER_MASK); - base->SM[subModule].CAPTFILTA |= PWM_CAPTFILTA_CAPTA_FILT_PER(filterSamplePeriod); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB - case kPWM_PwmB: - base->SM[subModule].CAPTFILTB &= ~((uint16_t)PWM_CAPTFILTB_CAPTB_FILT_PER_MASK); - base->SM[subModule].CAPTFILTB |= PWM_CAPTFILTB_CAPTB_FILT_PER(filterSamplePeriod); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX - case kPWM_PwmX: - base->SM[subModule].CAPTFILTX &= ~((uint16_t)PWM_CAPTFILTX_CAPTX_FILT_PER_MASK); - base->SM[subModule].CAPTFILTX |= PWM_CAPTFILTX_CAPTX_FILT_PER(filterSamplePeriod); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX */ - default: - assert(false); - break; - } -} -#endif - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_PWM_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_reset.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_reset.c deleted file mode 100644 index 1b49d0edab8..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_reset.c +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright 2023, NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_common.h" -#include "fsl_reset.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.reset" -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#define GET_REG_INDEX(x) ((uint32_t)(((uint32_t)(x) & 0xFF00U) >> 8)) -#define GET_BIT_INDEX(x) ((uint32_t)((uint32_t)(x) & 0x00FFU)) - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Assert reset to peripheral. - * - * Asserts reset signal to specified peripheral module. - * - * param peripheral Assert reset to this peripheral. The enum argument contains encoding of reset register - * and reset bit position in the reset register. - */ -void RESET_SetPeripheralReset(reset_ip_name_t peripheral) -{ - uint32_t regIndex = GET_REG_INDEX(peripheral); - uint32_t bitPos = GET_BIT_INDEX(peripheral); - uint32_t bitMask = 1UL << bitPos; - volatile uint32_t *pResetCtrl = &(MRCC0->MRCC_GLB_RST0); - - if (peripheral == NotAvail_RSTn) - { - return; - } - - assert(bitPos < 32u); - assert(regIndex < 2u); - - /* Unlock clock configuration */ - SYSCON->CLKUNLOCK &= ~SYSCON_CLKUNLOCK_UNLOCK_MASK; - - /* reset register is in MRCC */ - /* set bit */ - if (regIndex == 0U) - { - MRCC0->MRCC_GLB_RST0_SET = bitMask; - pResetCtrl = &(MRCC0->MRCC_GLB_RST0); - } - else if (regIndex == 1U) - { - MRCC0->MRCC_GLB_RST1_SET = bitMask; - pResetCtrl = &(MRCC0->MRCC_GLB_RST1); - } - else - { - /* Added comments to prevent the violation of MISRA C-2012 rule 15.7 */ - } - /* wait until it reads 0b1 */ - while (0u == ((*pResetCtrl) & bitMask)) - { - } - - /* Freeze clock configuration */ - SYSCON->CLKUNLOCK |= SYSCON_CLKUNLOCK_UNLOCK_MASK; -} - -/*! - * brief Clear reset to peripheral. - * - * Clears reset signal to specified peripheral module, allows it to operate. - * - * param peripheral Clear reset to this peripheral. The enum argument contains encoding of reset register - * and reset bit position in the reset register. - */ -void RESET_ClearPeripheralReset(reset_ip_name_t peripheral) -{ - uint32_t regIndex = GET_REG_INDEX(peripheral); - uint32_t bitPos = GET_BIT_INDEX(peripheral); - uint32_t bitMask = 1UL << bitPos; - volatile uint32_t *pResetCtrl = &(MRCC0->MRCC_GLB_RST0); - - assert(bitPos < 32u); - - /* Unlock clock configuration */ - SYSCON->CLKUNLOCK &= ~SYSCON_CLKUNLOCK_UNLOCK_MASK; - - /* reset register is in MRCC */ - /* clear bit */ - if (regIndex == 0U) - { - MRCC0->MRCC_GLB_RST0_CLR = bitMask; - pResetCtrl = &(MRCC0->MRCC_GLB_RST0); - } - else if (regIndex == 1U) - { - MRCC0->MRCC_GLB_RST1_CLR = bitMask; - pResetCtrl = &(MRCC0->MRCC_GLB_RST1); - } - else - { - /* Added comments to prevent the violation of MISRA C-2012 rule 15.7 */ - } - /* wait until it reads 0b0 */ - while (bitMask == ((*pResetCtrl) & bitMask)) - { - } - - /* Freeze clock configuration */ - SYSCON->CLKUNLOCK |= SYSCON_CLKUNLOCK_UNLOCK_MASK; -} - -/*! - * brief Reset peripheral module. - * - * Reset peripheral module. - * - * param peripheral Peripheral to reset. The enum argument contains encoding of reset register - * and reset bit position in the reset register. - */ -void RESET_PeripheralReset(reset_ip_name_t peripheral) -{ - RESET_ClearPeripheralReset(peripheral); - RESET_SetPeripheralReset(peripheral); -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_reset.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_reset.h deleted file mode 100644 index 29a31915036..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_reset.h +++ /dev/null @@ -1,251 +0,0 @@ -/* - * Copyright 2023, NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _FSL_RESET_H_ -#define _FSL_RESET_H_ - -#include -#include -#include -#include -#include "fsl_device_registers.h" - -/*! - * @addtogroup reset - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief reset driver version 2.4.0 */ -#define FSL_RESET_DRIVER_VERSION (MAKE_VERSION(2, 4, 0)) -/*@}*/ - -/*! - * @brief Enumeration for peripheral reset control bits - * - * Defines the enumeration for peripheral reset control bits in PRESETCTRL/ASYNCPRESETCTRL registers - */ -typedef enum _SYSCON_RSTn -{ - kINPUTMUX0_RST_SHIFT_RSTn = (0U | (0U)), /*!< INPUTMUX0 reset control */ - kI3C0_RST_SHIFT_RSTn = (0U | (1U)), /*!< I3C0 reset control */ - kCTIMER0_RST_SHIFT_RSTn = (0U | (2U)), /*!< CTIMER0 reset control */ - kCTIMER1_RST_SHIFT_RSTn = (0U | (3U)), /*!< CTIMER1 reset control */ - kCTIMER2_RST_SHIFT_RSTn = (0U | (4U)), /*!< CTIMER2 reset control */ - kCTIMER3_RST_SHIFT_RSTn = (0U | (5U)), /*!< CTIMER3 reset control */ - kCTIMER4_RST_SHIFT_RSTn = (0U | (6U)), /*!< CTIMER4 reset control */ - kFREQME_RST_SHIFT_RSTn = (0U | (7U)), /*!< FREQME reset control */ - kUTICK0_RST_SHIFT_RSTn = (0U | (8U)), /*!< UTICK0 reset control */ - kDMA_RST_SHIFT_RSTn = (0U | (10U)), /*!< DMA reset control */ - kAOI0_RST_SHIFT_RSTn = (0U | (11U)), /*!< AOI0 reset control */ - kCRC0_RST_SHIFT_RSTn = (0U | (12U)), /*!< CRC0 reset control */ - kEIM0_RST_SHIFT_RSTn = (0U | (13U)), /*!< EIM0 reset control */ - kERM0_RST_SHIFT_RSTn = (0U | (14U)), /*!< ERM0 reset control */ - kAOI1_RST_SHIFT_RSTn = (0U | (16U)), /*!< AOI1 reset control */ - kFLEXIO0_RST_SHIFT_RSTn = (0U | (17U)), /*!< FLEXIO0 reset control */ - kLPI2C0_RST_SHIFT_RSTn = (0U | (18U)), /*!< LPI2C0 reset control */ - kLPI2C1_RST_SHIFT_RSTn = (0U | (19U)), /*!< LPI2C1 reset control */ - kLPSPI0_RST_SHIFT_RSTn = (0U | (20U)), /*!< LPSPI0 reset control */ - kLPSPI1_RST_SHIFT_RSTn = (0U | (21U)), /*!< LPSPI1 reset control */ - kLPUART0_RST_SHIFT_RSTn = (0U | (22U)), /*!< LPUART0 reset control */ - kLPUART1_RST_SHIFT_RSTn = (0U | (23U)), /*!< LPUART1 reset control */ - kLPUART2_RST_SHIFT_RSTn = (0U | (24U)), /*!< LPUART2 reset control */ - kLPUART3_RST_SHIFT_RSTn = (0U | (25U)), /*!< LPUART3 reset control */ - kLPUART4_RST_SHIFT_RSTn = (0U | (26U)), /*!< LPUART4 reset control */ - kUSB0_RST_SHIFT_RSTn = (0U | (27U)), /*!< USB0 reset control */ - kQDC0_RST_SHIFT_RSTn = (0U | (28U)), /*!< QDC0 reset control */ - kQDC1_RST_SHIFT_RSTn = (0U | (29U)), /*!< QDC1 reset control */ - kFLEXPWM0_RST_SHIFT_RSTn = (0U | (30U)), /*!< FLEXPWM0 reset control */ - kFLEXPWM1_RST_SHIFT_RSTn = (0U | (31U)), /*!< FLEXPWM1 reset control */ - kOSTIMER0_RST_SHIFT_RSTn = ((1U << 8U) | (0U)), /*!< OSTIMER0 reset control */ - kADC0_RST_SHIFT_RSTn = ((1U << 8U) | (1U)), /*!< ADC0 reset control */ - kADC1_RST_SHIFT_RSTn = ((1U << 8U) | (2U)), /*!< ADC1 reset control */ - kCMP1_RST_SHIFT_RSTn = ((1U << 8U) | (4U)), /*!< CMP1 reset control */ - kDAC0_RST_SHIFT_RSTn = ((1U << 8U) | (5U)), /*!< DAC0 reset control */ - kOPAMP0_RST_SHIFT_RSTn = ((1U << 8U) | (6U)), /*!< OPAMP0 reset control */ - kPORT0_RST_SHIFT_RSTn = ((1U << 8U) | (7U)), /*!< PORT0 reset control */ - kPORT1_RST_SHIFT_RSTn = ((1U << 8U) | (8U)), /*!< PORT1 reset control */ - kPORT2_RST_SHIFT_RSTn = ((1U << 8U) | (9U)), /*!< PORT2 reset control */ - kPORT3_RST_SHIFT_RSTn = ((1U << 8U) | (10U)), /*!< PORT3 reset control */ - kPORT4_RST_SHIFT_RSTn = ((1U << 8U) | (11U)), /*!< PORT4 reset control */ - kFLEXCAN0_RST_SHIFT_RSTn = ((1U << 8U) | (12U)), /*!< FLEXCAN0 reset control */ - kLPI2C2_RST_SHIFT_RSTn = ((1U << 8U) | (13U)), /*!< LPI2C2 reset control */ - kLPI2C3_RST_SHIFT_RSTn = ((1U << 8U) | (14U)), /*!< LPI2C3 reset control */ - kGPIO0_RST_SHIFT_RSTn = ((1U << 8U) | (20U)), /*!< GPIO0 reset control */ - kGPIO1_RST_SHIFT_RSTn = ((1U << 8U) | (21U)), /*!< GPIO1 reset control */ - kGPIO2_RST_SHIFT_RSTn = ((1U << 8U) | (22U)), /*!< GPIO2 reset control */ - kGPIO3_RST_SHIFT_RSTn = ((1U << 8U) | (23U)), /*!< GPIO3 reset control */ - kGPIO4_RST_SHIFT_RSTn = ((1U << 8U) | (24U)), /*!< GPIO4 reset control */ - NotAvail_RSTn = (0xFFFFU), /*!< No reset control */ -} SYSCON_RSTn_t; - -/** Array initializers with peripheral reset bits **/ -#define AOI_RSTS \ - { \ - kAOI0_RST_SHIFT_RSTn, kAOI1_RST_SHIFT_RSTn \ - } /* Reset bits for ADC peripheral */ -#define ADC_RSTS \ - { \ - kADC0_RST_SHIFT_RSTn, kADC1_RST_SHIFT_RSTn \ - } /* Reset bits for ADC peripheral */ -#define CRC_RSTS \ - { \ - kCRC0_RST_SHIFT_RSTn \ - } /* Reset bits for CRC peripheral */ -#define CTIMER_RSTS \ - { \ - kCTIMER0_RST_SHIFT_RSTn, kCTIMER1_RST_SHIFT_RSTn, kCTIMER2_RST_SHIFT_RSTn, kCTIMER3_RST_SHIFT_RSTn, \ - kCTIMER4_RST_SHIFT_RSTn \ - } /* Reset bits for CTIMER peripheral */ -#define DAC_RSTS_N \ - { \ - kDAC0_RST_SHIFT_RSTn \ - } /* Reset bits for DAC peripheral */ -#define DMA_RSTS_N \ - { \ - kDMA_RST_SHIFT_RSTn \ - } /* Reset bits for DMA peripheral */ -#define EIM_RSTS_N \ - { \ - kEIM0_RST_SHIFT_RSTn \ - } /* Reset bits for EIM peripheral */ -#define ERM_RSTS_N \ - { \ - kERM0_RST_SHIFT_RSTn \ - } /* Reset bits for ERM peripheral */ -#define FLEXCAN_RSTS_N \ - { \ - kFLEXCAN0_RST_SHIFT_RSTn \ - } /* Reset bits for FLEXCAN peripheral */ -#define FLEXIO_RSTS_N \ - { \ - kFLEXIO0_RST_SHIFT_RSTn \ - } /* Reset bits for FLEXIO peripheral */ -#define FLEXPWM_RSTS_N \ - { \ - kFLEXPWM0_RST_SHIFT_RSTn, kFLEXPWM1_RST_SHIFT_RSTn \ - } /* Reset bits for FLEXPWM peripheral */ -#define FREQME_RSTS_N \ - { \ - kFREQME_RST_SHIFT_RSTn \ - } /* Reset bits for FREQME peripheral */ -#define GPIO_RSTS_N \ - { \ - kGPIO0_RST_SHIFT_RSTn, kGPIO1_RST_SHIFT_RSTn, kGPIO2_RST_SHIFT_RSTn, kGPIO3_RST_SHIFT_RSTn, \ - kGPIO4_RST_SHIFT_RSTn \ - } /* Reset bits for GPIO peripheral */ -#define I3C_RSTS \ - { \ - kI3C0_RST_SHIFT_RSTn \ - } /* Reset bits for I3C peripheral */ -#define INPUTMUX_RSTS \ - { \ - kINPUTMUX0_RST_SHIFT_RSTn \ - } /* Reset bits for INPUTMUX peripheral */ -#define LPUART_RSTS \ - { \ - kLPUART0_RST_SHIFT_RSTn, kLPUART1_RST_SHIFT_RSTn, kLPUART2_RST_SHIFT_RSTn, kLPUART3_RST_SHIFT_RSTn, \ - kLPUART4_RST_SHIFT_RSTn \ - } /* Reset bits for LPUART peripheral */ -#define LPSPI_RSTS \ - { \ - kLPSPI0_RST_SHIFT_RSTn, kLPSPI1_RST_SHIFT_RSTn \ - } /* Reset bits for LPSPI peripheral */ -#define LPI2C_RSTS \ - { \ - kLPI2C0_RST_SHIFT_RSTn, kLPI2C1_RST_SHIFT_RSTn, kLPI2C2_RST_SHIFT_RSTn, kLPI2C3_RST_SHIFT_RSTn \ - } /* Reset bits for LPI2C peripheral */ -#define LPCMP_RSTS \ - { \ - NotAvail_RSTn, kCMP1_RST_SHIFT_RSTn \ - } /* Reset bits for LPCMP peripheral */ -#define OPAMP_RSTS \ - { \ - kOPAMP0_RST_SHIFT_RSTn \ - } /* Reset bits for OPAMP peripheral */ -#define OSTIMER_RSTS \ - { \ - kOSTIMER0_RST_SHIFT_RSTn \ - } /* Reset bits for OSTIMER peripheral */ -#define PORT_RSTS_N \ - { \ - kPORT0_RST_SHIFT_RSTn, kPORT1_RST_SHIFT_RSTn, kPORT2_RST_SHIFT_RSTn, kPORT3_RST_SHIFT_RSTn, \ - kPORT4_RST_SHIFT_RSTn \ - } /* Reset bits for PORT peripheral */ -#define EQDC_RSTS \ - { \ - kQDC0_RST_SHIFT_RSTn, kQDC1_RST_SHIFT_RSTn \ - } /* Reset bits for EQDC peripheral */ -#define UTICK_RSTS \ - { \ - kUTICK0_RST_SHIFT_RSTn \ - } /* Reset bits for UTICK peripheral */ - -typedef SYSCON_RSTn_t reset_ip_name_t; - -/******************************************************************************* - * API - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @brief Assert reset to peripheral. - * - * Asserts reset signal to specified peripheral module. - * - * @param peripheral Assert reset to this peripheral. The enum argument contains encoding of reset register - * and reset bit position in the reset register. - */ -void RESET_SetPeripheralReset(reset_ip_name_t peripheral); - -/*! - * @brief Clear reset to peripheral. - * - * Clears reset signal to specified peripheral module, allows it to operate. - * - * @param peripheral Clear reset to this peripheral. The enum argument contains encoding of reset register - * and reset bit position in the reset register. - */ -void RESET_ClearPeripheralReset(reset_ip_name_t peripheral); - -/*! - * @brief Reset peripheral module. - * - * Reset peripheral module. - * - * @param peripheral Peripheral to reset. The enum argument contains encoding of reset register - * and reset bit position in the reset register. - */ -void RESET_PeripheralReset(reset_ip_name_t peripheral); - -/*! - * @brief Release peripheral module. - * - * Release peripheral module. - * - * @param peripheral Peripheral to release. The enum argument contains encoding of reset register - * and reset bit position in the reset register. - */ -static inline void RESET_ReleasePeripheralReset(reset_ip_name_t peripheral) -{ - RESET_SetPeripheralReset(peripheral); -} - -#if defined(__cplusplus) -} -#endif - -/*! @} */ - -#endif /* _FSL_RESET_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_romapi.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_romapi.h deleted file mode 100644 index 1f2f64f424f..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_romapi.h +++ /dev/null @@ -1,507 +0,0 @@ -/* - * Copyright 2023, NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_ROMAPI_H_ -#define FSL_ROMAPI_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup romapi - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.romapi" -#endif - -/*! @name Driver version */ -/*@{*/ - -/*! @brief romapi driver version 2.0.0. */ -#define FSL_ROMAPI_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) -/*@}*/ - -/*! - * @name Flash status - * @{ - */ -/*! @brief Flash driver status group. */ -#if defined(kStatusGroup_FlashDriver) -#define kStatusGroupGeneric kStatusGroup_Generic -#define kStatusGroupFlashDriver kStatusGroup_FlashDriver -#elif defined(kStatusGroup_FLASHIAP) -#define kStatusGroupGeneric kStatusGroup_Generic -#define kStatusGroupFlashDriver kStatusGroup_FLASH -#else -#define kStatusGroupGeneric 0 -#define kStatusGroupFlashDriver 1 -#endif - -/*! @brief Constructs a status code value from a group and a code number. */ -#if !defined(MAKE_STATUS) -#define MAKE_STATUS(group, code) ((((group) * 100) + (code))) -#endif - -/*! - * @brief Flash driver status codes. - */ -enum -{ - kStatus_FLASH_Success = MAKE_STATUS(kStatusGroupGeneric, 0), /*!< API is executed successfully*/ - kStatus_FLASH_InvalidArgument = MAKE_STATUS(kStatusGroupGeneric, 4), /*!< Invalid argument*/ - kStatus_FLASH_SizeError = MAKE_STATUS(kStatusGroupFlashDriver, 0), /*!< Error size*/ - kStatus_FLASH_AlignmentError = - MAKE_STATUS(kStatusGroupFlashDriver, 1), /*!< Parameter is not aligned with the specified baseline*/ - kStatus_FLASH_AddressError = MAKE_STATUS(kStatusGroupFlashDriver, 2), /*!< Address is out of range */ - kStatus_FLASH_AccessError = - MAKE_STATUS(kStatusGroupFlashDriver, 3), /*!< Invalid instruction codes and out-of bound addresses */ - kStatus_FLASH_ProtectionViolation = MAKE_STATUS( - kStatusGroupFlashDriver, 4), /*!< The program/erase operation is requested to execute on protected areas */ - kStatus_FLASH_CommandFailure = - MAKE_STATUS(kStatusGroupFlashDriver, 5), /*!< Run-time error during command execution. */ - kStatus_FLASH_UnknownProperty = MAKE_STATUS(kStatusGroupFlashDriver, 6), /*!< Unknown property.*/ - kStatus_FLASH_EraseKeyError = MAKE_STATUS(kStatusGroupFlashDriver, 7) /*!< API erase key is invalid.*/ -}; -/*@}*/ - -/*! - * @brief Enumeration for various flash properties. - */ -typedef enum _flash_property_tag -{ - kFLASH_PropertyPflashSectorSize = 0x00U, /*!< Pflash sector size property.*/ - kFLASH_PropertyPflashTotalSize = 0x01U, /*!< Pflash total size property.*/ - kFLASH_PropertyPflashBlockSize = 0x02U, /*!< Pflash block size property.*/ - kFLASH_PropertyPflashBlockCount = 0x03U, /*!< Pflash block count property.*/ - kFLASH_PropertyPflashBlockBaseAddr = 0x04U, /*!< Pflash block base address property.*/ - kFLASH_PropertyPflashPageSize = 0x30U, /*!< Pflash page size property.*/ - kFLASH_PropertyPflashSystemFreq = 0x31U, /*!< System Frequency property.*/ - kFLASH_PropertyFfrSectorSize = 0x40U, /*!< FFR sector size property.*/ - kFLASH_PropertyFfrTotalSize = 0x41U, /*!< FFR total size property.*/ - kFLASH_PropertyFfrBlockBaseAddr = 0x42U, /*!< FFR block base address property.*/ - kFLASH_PropertyFfrPageSize = 0x43U, /*!< FFR page size property.*/ -} flash_property_tag_t; - -/*! @brief Flash controller paramter config. */ -typedef struct _flash_ffr_config -{ - uint32_t ffrBlockBase; - uint32_t ffrTotalSize; - uint32_t ffrPageSize; - uint32_t sectorSize; - uint32_t cfpaPageVersion; - uint32_t cfpaPageOffset; -} flash_ffr_config_t; - -/*! @brief Flash driver state information. - * - * An instance of this structure is allocated by the user of the flash driver and - * passed into each of the driver APIs. - */ -typedef struct _flash_config -{ - uint32_t PFlashBlockBase; /*!< A base address of the first PFlash block */ - uint32_t PFlashTotalSize; /*!< The size of the combined PFlash block. */ - uint32_t PFlashBlockCount; /*!< A number of PFlash blocks. */ - uint32_t PFlashPageSize; /*!< The size in bytes of a page of PFlash. */ - uint32_t PFlashSectorSize; /*!< The size in bytes of a sector of PFlash. */ - flash_ffr_config_t ffrConfig; -} flash_config_t; - -/*! @brief Interface for the flash driver. */ -typedef struct _flash_driver_interface -{ - /* Flash driver */ - status_t (*flash_init)(flash_config_t *config); - status_t (*flash_erase_sector)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes, uint32_t key); - status_t (*flash_program_phrase)(flash_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes); - status_t (*flash_program_page)(flash_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes); - status_t (*flash_verify_program)(flash_config_t *config, - uint32_t start, - uint32_t lengthInBytes, - const uint8_t *expectedData, - uint32_t *failedAddress, - uint32_t *failedData); - status_t (*flash_verify_erase_phrase)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes); - status_t (*flash_verify_erase_page)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes); - status_t (*flash_verify_erase_sector)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes); - status_t (*flash_get_property)(flash_config_t *config, flash_property_tag_t whichProperty, uint32_t *value); - /* IFR driver */ - status_t (*ifr_verify_erase_phrase)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes); - status_t (*ifr_verify_erase_page)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes); - status_t (*ifr_verify_erase_sector)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes); - status_t (*flash_read)(flash_config_t *config, uint32_t start, uint8_t *dest, uint32_t lengthInBytes); - /* version */ - uint32_t version; -} flash_driver_interface_t; - -/*! @brief Constructs the four character code for the Flash driver API key. */ -#if !defined(FOUR_CHAR_CODE) -#define FOUR_CHAR_CODE(a, b, c, d) (((d) << 24) | ((c) << 16) | ((b) << 8) | ((a))) -#endif - -/*! - * @brief Enumeration for Flash driver API keys. - * - * @note The resulting value is built with a byte order such that the string - * being readable in expected order when viewed in a hex editor, if the value - * is treated as a 32-bit little endian value. - */ -enum _flash_driver_api_keys -{ - kFLASH_ApiEraseKey = FOUR_CHAR_CODE('l', 'f', 'e', 'k') /*!< Key value used to validate all flash erase APIs.*/ -}; - -/* API prototype fields definition. -| 31 : 24 | 23 : 20 | 19 : 16 | 15 : 12 | 11 : 8 | 7 : 0 | -| Tag | Boot mode | bootloader periphal| Instance | Image Index| Reserved | -| | | | Used For Boot mode 0| | | -| | 0: Passive mode | 0 - Auto detection | | | | -| | 1: ISP mode | 1 - USB-HID | | | | -| | | 2 - UART | | | | -| | | 3 - SPI | | | | -| | | 4 - I2C | | | | -| | | 5 - CAN | | | | -*/ -typedef struct -{ - union - { - struct - { - uint32_t reserved : 8; - uint32_t boot_image_index : 4; - uint32_t instance : 4; - uint32_t boot_interface : 4; - uint32_t mode : 4; - uint32_t tag : 8; - } B; - uint32_t U; - } option; -} user_app_boot_invoke_option_t; - -/*! @brief Root of the bootloader API tree. - * - * An instance of this struct resides in read-only memory in the bootloader. It - * provides a user application access to APIs exported by the bootloader. - * - */ -typedef struct _bootloader_tree -{ - void (*run_bootloader)(void *arg); /*!< Function to start the bootloader executing. */ - const flash_driver_interface_t *flash_driver; /*!< Internal Flash driver API. */ - void (*jump)(void *arg); -} bootloader_tree_t; - -/** ROM API base address */ -#define ROM_API_BASE (0x03003fe0u) -/** ROM API base pointer */ -#define ROM_API ((bootloader_tree_t *)ROM_API_BASE) -/** FLASH API base pointer */ -#define FLASH_API (ROM_API->flash_driver) - -/*! - * @name Flash API - * @{ - */ - -/*! - * @brief Initializes the global flash properties structure members - * - * This function checks and initializes the Flash module for the other Flash APIs. - * - * @param config Pointer to the storage for the driver runtime state. - * - */ -static inline status_t FLASH_Init(flash_config_t *config) -{ - return FLASH_API->flash_init(config); -} - -/*! - * @brief Erases the flash sectors encompassed by parameters passed into function - * - * This function erases the appropriate number of flash sectors based on the - * desired start address and length. - * - * @param config The pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be erased. - * NOTE: The start address need to be 4 Bytes-aligned. - * - * @param lengthInBytes The length, given in bytes need be 4 Bytes-aligned. - * - * @param key The value used to validate all flash erase APIs. - * - */ -static inline status_t FLASH_EraseSector(flash_config_t *config, uint32_t start, uint32_t lengthInBytes, uint32_t key) -{ - return FLASH_API->flash_erase_sector(config, start, lengthInBytes, key); -} - -/*! - * @brief Programs flash phrases with data at locations passed in through parameters - * - * This function programs the flash memory with the desired data for a given - * flash area as determined by the start address and the length. - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be programmed. Must be - * word-aligned. - * @param src A pointer to the source buffer of data that is to be programmed - * into the flash. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be programmed. Must be word-aligned. - * - */ -static inline status_t FLASH_ProgramPhrase(flash_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes) -{ - return FLASH_API->flash_program_phrase(config, start, src, lengthInBytes); -} - -/*! - * @brief Programs flash page with data at locations passed in through parameters - * - * This function programs the flash memory with the desired data for a given - * flash area as determined by the start address and the length. - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be programmed. Must be - * word-aligned. - * @param src A pointer to the source buffer of data that is to be programmed - * into the flash. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be programmed. Must be word-aligned. - * - */ -static inline status_t FLASH_ProgramPage(flash_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes) -{ - return FLASH_API->flash_program_page(config, start, src, lengthInBytes); -} - -/*! - * @brief Verifies programming of the desired flash area - * - * This function verifies the data programed in the flash memory using the - * Flash Program Check Command and compares it to the expected data for a given - * flash area as determined by the start address and length. - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be verified. Must be word-aligned. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be verified. Must be word-aligned. - * @param expectedData A pointer to the expected data that is to be - * verified against. - * @param failedAddress A pointer to the returned failing address. - * @param failedData A pointer to the returned failing data. Some derivatives do - * not include failed data as part of the FCCOBx registers. In this - * case, zeros are returned upon failure. - * - */ -static inline status_t FLASH_VerifyProgram(flash_config_t *config, - uint32_t start, - uint32_t lengthInBytes, - const uint8_t *expectedData, - uint32_t *failedAddress, - uint32_t *failedData) -{ - return FLASH_API->flash_verify_program(config, start, lengthInBytes, expectedData, failedAddress, failedData); -} - -/*! - * @brief Verify that the flash phrases are erased - * - * This function checks the appropriate number of flash sectors based on - * the desired start address and length to check whether the flash is erased - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be verified. - * The start address does not need to be sector-aligned but must be word-aligned. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be verified. Must be word-aligned. - * - */ -static inline status_t FLASH_VerifyErasePhrase(flash_config_t *config, uint32_t start, uint32_t lengthInBytes) -{ - return FLASH_API->flash_verify_erase_phrase(config, start, lengthInBytes); -} - -/*! - * @brief Verify that the flash pages are erased - * - * This function checks the appropriate number of flash sectors based on - * the desired start address and length to check whether the flash is erased - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be verified. - * The start address does not need to be sector-aligned but must be word-aligned. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be verified. Must be word-aligned. - * - */ -static inline status_t FLASH_VerifyErasePage(flash_config_t *config, uint32_t start, uint32_t lengthInBytes) -{ - return FLASH_API->flash_verify_erase_page(config, start, lengthInBytes); -} - -/*! - * @brief Verify that the flash sectors are erased - * - * This function checks the appropriate number of flash sectors based on - * the desired start address and length to check whether the flash is erased - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be verified. - * The start address does not need to be sector-aligned but must be word-aligned. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be verified. Must be word-aligned. - * - */ -static inline status_t FLASH_VerifyEraseSector(flash_config_t *config, uint32_t start, uint32_t lengthInBytes) -{ - return FLASH_API->flash_verify_erase_sector(config, start, lengthInBytes); -} - -/*! - * @brief Returns the desired flash property - * - * @param config A pointer to the storage for the driver runtime state. - * @param whichProperty The desired property from the list of properties in - * enum flash_property_tag_t - * @param value A pointer to the value returned for the desired flash property. - * - */ -static inline status_t FLASH_GetProperty(flash_config_t *config, flash_property_tag_t whichProperty, uint32_t *value) -{ - return FLASH_API->flash_get_property(config, whichProperty, value); -} - -/*! - * @brief Verify that the IFR0 phrases are erased - * - * This function checks the appropriate number of flash sectors based on - * the desired start address and length to check whether the flash is erased - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be verified. - * The start address does not need to be sector-aligned but must be word-aligned. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be verified. Must be word-aligned. - * - */ -static inline status_t IFR_VerifyErasePhrase(flash_config_t *config, uint32_t start, uint32_t lengthInBytes) -{ - return FLASH_API->ifr_verify_erase_phrase(config, start, lengthInBytes); -} - -/*! - * @brief Verify that the IFR0 pages are erased - * - * This function checks the appropriate number of flash sectors based on - * the desired start address and length to check whether the flash is erased - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be verified. - * The start address does not need to be sector-aligned but must be word-aligned. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be verified. Must be word-aligned. - * - */ -static inline status_t IFR_VerifyErasePage(flash_config_t *config, uint32_t start, uint32_t lengthInBytes) -{ - return FLASH_API->ifr_verify_erase_page(config, start, lengthInBytes); -} - -/*! - * @brief Verify that the IFR0 sectors are erased - * - * This function checks the appropriate number of flash sectors based on - * the desired start address and length to check whether the flash is erased - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be verified. - * The start address does not need to be sector-aligned but must be word-aligned. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be verified. Must be word-aligned. - * - */ -static inline status_t IFR_VerifyEraseSector(flash_config_t *config, uint32_t start, uint32_t lengthInBytes) -{ - return FLASH_API->ifr_verify_erase_sector(config, start, lengthInBytes); -} - -/*! - * @brief Reads flash at locations passed in through parameters - * - * This function read the flash memory from a given flash area as determined - * by the start address and the length. - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be read. - * @param dest A pointer to the dest buffer of data that is to be read - * from the flash. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be read. - * - */ -static inline status_t FLASH_Read(flash_config_t *config, uint32_t start, uint8_t *dest, uint32_t lengthInBytes) -{ - return FLASH_API->flash_read(config, start, dest, lengthInBytes); -} - -/*! - * @brief Get ROM API version. - * - * This function read the ROM API version. - * - */ -static inline uint32_t ROMAPI_GetVersion(void) -{ - return FLASH_API->version; -} - -/*! - * @brief Run the Bootloader API to force into the ISP mode base on the user arg - * - * @param arg Indicates API prototype fields definition. - * Refer to the above #user_app_boot_invoke_option_t structure - */ -static inline void ROMAPI_RunBootloader(void *arg) -{ - ROM_API->run_bootloader(arg); -} - -/*! - * @brief Get the UUID - * - * @param uuid UUID data array - * - */ -static inline void ROMAPI_GetUUID(uint8_t *uuid) -{ -#define MCXA_UUID_ADDR (0x01100800U) -#define MCXA_UUID_SIZE (16U) - - uint8_t *p = (uint8_t *)MCXA_UUID_ADDR; - for (uint8_t i = 0; i < MCXA_UUID_SIZE; i++) - { - *uuid = *p; - uuid++; - p++; - } -} - -/* @} */ - -/*! @} */ - -#endif /* FSL_ROMAPI_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_spc.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_spc.c deleted file mode 100644 index c6a9b293262..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_spc.c +++ /dev/null @@ -1,1680 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_spc.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.mcx_spc" -#endif - -/* - * $Coverage Justification Reference$ - * - * $Justification spc_c_ref_1$ - * The SPC busy status flag is too short to get coverage data. - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Gets selected power domain's requested low power mode. - * - * param base SPC peripheral base address. - * param powerDomainId Power Domain Id, please refer to spc_power_domain_id_t. - * - * return The selected power domain's requested low power mode, please refer to spc_power_domain_low_power_mode_t. - */ -spc_power_domain_low_power_mode_t SPC_GetPowerDomainLowPowerMode(SPC_Type *base, spc_power_domain_id_t powerDomainId) -{ - assert((uint8_t)powerDomainId < SPC_PD_STATUS_COUNT); - - uint32_t val; - - val = ((base->PD_STATUS[(uint8_t)powerDomainId] & SPC_PD_STATUS_LP_MODE_MASK) >> SPC_PD_STATUS_LP_MODE_SHIFT); - return (spc_power_domain_low_power_mode_t)val; -} - -/*! - * brief Gets Isolation status for each power domains. - * - * This function gets the status which indicates whether certain - * peripheral and the IO pads are in a latched state as a result - * of having been in POWERDOWN mode. - * - * param base SPC peripheral base address. - * return Current isolation status for each power domains. - */ -uint8_t SPC_GetPeriphIOIsolationStatus(SPC_Type *base) -{ - uint32_t reg; - - reg = base->SC; - return (uint8_t)((reg & SPC_SC_ISO_CLR_MASK) >> SPC_SC_ISO_CLR_SHIFT); -} - -/*! - * brief Configs Low power request output pin. - * - * This function configs the low power request output pin - * - * param base SPC peripheral base address. - * param config Pointer the spc_LowPower_Request_config_t structure. - */ -void SPC_SetLowPowerRequestConfig(SPC_Type *base, const spc_lowpower_request_config_t *config) -{ - assert(config != NULL); - - uint32_t reg; - - reg = base->LPREQ_CFG; - reg &= ~(SPC_LPREQ_CFG_LPREQOE_MASK | SPC_LPREQ_CFG_LPREQPOL_MASK | SPC_LPREQ_CFG_LPREQOV_MASK); - - if (config->enable) - { - reg |= SPC_LPREQ_CFG_LPREQOE_MASK | SPC_LPREQ_CFG_LPREQPOL((uint8_t)(config->polarity)) | - SPC_LPREQ_CFG_LPREQOV((uint8_t)(config->override)); - } - else - { - reg &= ~SPC_LPREQ_CFG_LPREQOE_MASK; - } - - base->LPREQ_CFG = reg; -} - -#if !(defined(FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) && FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) -/*! - * brief Configures VDD Core Glitch detector, including ripple counter selection, timeout value and so on. - * - * param base SPC peripheral base address. - * param config Pointer to the structure in type of spc_vdd_core_glitch_detector_config_t. - */ -void SPC_ConfigVddCoreGlitchDetector(SPC_Type *base, const spc_vdd_core_glitch_detector_config_t *config) -{ - assert(config != NULL); - - uint32_t reg; - - reg = (base->VDD_CORE_GLITCH_DETECT_SC) & - ~(SPC_VDD_CORE_GLITCH_DETECT_SC_CNT_SELECT_MASK | SPC_VDD_CORE_GLITCH_DETECT_SC_TIMEOUT_MASK | - SPC_VDD_CORE_GLITCH_DETECT_SC_RE_MASK | SPC_VDD_CORE_GLITCH_DETECT_SC_IE_MASK); - - reg |= SPC_VDD_CORE_GLITCH_DETECT_SC_CNT_SELECT(config->rippleCounterSelect) | - SPC_VDD_CORE_GLITCH_DETECT_SC_TIMEOUT(config->resetTimeoutValue) | - SPC_VDD_CORE_GLITCH_DETECT_SC_RE(config->enableReset) | - SPC_VDD_CORE_GLITCH_DETECT_SC_IE(config->enableInterrupt); - - base->VDD_CORE_GLITCH_DETECT_SC = reg; -} -#endif - -/*! - * brief Set SRAM operate voltage. - * - * param base SPC peripheral base address. - * param config The pointer to spc_sram_voltage_config_t, specifies the configuration of sram voltage. - */ -void SPC_SetSRAMOperateVoltage(SPC_Type *base, const spc_sram_voltage_config_t *config) -{ - assert(config != NULL); - - uint32_t reg = 0UL; - - reg |= SPC_SRAMCTL_VSM(config->operateVoltage); - - base->SRAMCTL = reg; - - if (config->requestVoltageUpdate) - { - base->SRAMCTL |= SPC_SRAMCTL_REQ_MASK; - while ((base->SRAMCTL & SPC_SRAMCTL_ACK_MASK) == 0UL) - { - /* Wait until acknowledged */ - ; - } - base->SRAMCTL &= ~SPC_SRAMCTL_REQ_MASK; - } -} - -/*! - * brief Configs Bandgap mode in Active mode. - * - * @note To disable bandgap in Active mode: - * 1. Disable all LVD's and HVD's in active mode; - * 2. Disable Glitch detect; - * 3. Configrue LDO's and DCDC to low drive strength in active mode; - * 4. Invoke this function to disable bandgap in active mode; - * otherwise the error status will be reported. - * - * @note Some other system resources(such as PLL, CMP) require bandgap to be enabled, to disable bandgap please - * take care of other system resources. - * - * param base SPC peripheral base address. - * param mode The Bandgap mode be selected. - * - * retval kStatus_SPC_BandgapModeWrong The Bandgap can not be disabled in active mode. - * retval kStatus_Success Config Bandgap mode in Active power mode successful. - */ -status_t SPC_SetActiveModeBandgapModeConfig(SPC_Type *base, spc_bandgap_mode_t mode) -{ - uint32_t reg; - uint32_t state; - - reg = base->ACTIVE_CFG; - - if (mode == kSPC_BandgapDisabled) - { - state = SPC_GetActiveModeVoltageDetectStatus(base); - - /* If any of the LVD/HVDs are kept enabled, bandgap mode must be enabled with buffer disabled. */ - if (state != 0UL) - { - return kStatus_SPC_BandgapModeWrong; - } - - /* The bandgap mode must be enabled if any regulators' drive strength set as Normal. */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - if ((base->ACTIVE_CFG & SPC_ACTIVE_CFG_SYSLDO_VDD_DS_MASK) == - SPC_ACTIVE_CFG_SYSLDO_VDD_DS(kSPC_SysLDO_NormalDriveStrength)) - { - return kStatus_SPC_BandgapModeWrong; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - if ((base->ACTIVE_CFG & SPC_ACTIVE_CFG_DCDC_VDD_DS_MASK) == SPC_ACTIVE_CFG_DCDC_VDD_DS(kSPC_DCDC_NormalVoltage)) - { - return kStatus_SPC_BandgapModeWrong; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -#if !(defined(FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) && FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) - /* state of GLITCH_DETECT_DISABLE will be ignored if bandgap is disabled. */ - if ((base->ACTIVE_CFG & SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE_MASK) == 0UL) - { - return kStatus_SPC_BandgapModeWrong; - } -#endif -#if defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS - if ((base->ACTIVE_CFG & SPC_ACTIVE_CFG_CORELDO_VDD_DS_MASK) == - SPC_ACTIVE_CFG_CORELDO_VDD_DS(kSPC_CoreLDO_NormalDriveStrength)) - { - return kStatus_SPC_BandgapModeWrong; - } -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - } - - reg &= ~SPC_ACTIVE_CFG_BGMODE_MASK; - reg |= SPC_ACTIVE_CFG_BGMODE(mode); - - base->ACTIVE_CFG = reg; - - return kStatus_Success; -} - -/*! - * brief Configs Bandgap mode in Low Power mode. - * - * @note To disable Bandgap in Low-power mode: - * 1. Disable all LVD's ad HVD's in low power mode; - * 2. Disable Glitch detect in low power mode; - * 3. Configure LDO's and DCDC to low drive strength in low power mode; - * 4. Disable bandgap in low power mode; - * Otherwise, the error status will be reported. - * - * @note Some other system resources(such as PLL, CMP) require bandgap to be enabled, to disable bandgap please - * take care of other system resources. - * - * param base SPC peripheral base address. - * param mode The Bandgap mode be selected. - * - * retval kStatus_SPC_BandgapModeWrong The bandgap mode setting in Low Power mode is wrong. - * retval kStatus_Success Config Bandgap mode in Low Power power mode successful. - */ -status_t SPC_SetLowPowerModeBandgapmodeConfig(SPC_Type *base, spc_bandgap_mode_t mode) -{ - uint32_t reg; - uint32_t state; - - reg = base->LP_CFG; - - if (mode == kSPC_BandgapDisabled) - { - state = (uint32_t)SPC_GetLowPowerModeVoltageDetectStatus(base); - - /* If any of the LVD/HVDs are kept enabled, bandgap mode must be enabled with buffer disabled. */ - if (state != 0UL) - { - return kStatus_SPC_BandgapModeWrong; - } - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - if ((base->LP_CFG & SPC_LP_CFG_DCDC_VDD_DS_MASK) == SPC_LP_CFG_DCDC_VDD_DS(kSPC_DCDC_NormalDriveStrength)) - { - return kStatus_SPC_BandgapModeWrong; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - if ((base->LP_CFG & SPC_LP_CFG_SYSLDO_VDD_DS_MASK) == SPC_LP_CFG_SYSLDO_VDD_DS(kSPC_SysLDO_NormalDriveStrength)) - { - return kStatus_SPC_BandgapModeWrong; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - - if ((base->LP_CFG & SPC_LP_CFG_CORELDO_VDD_DS_MASK) == - SPC_LP_CFG_CORELDO_VDD_DS(kSPC_CoreLDO_NormalDriveStrength)) - { - return kStatus_SPC_BandgapModeWrong; - } - -#if !(defined(FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) && FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) - /* state of GLITCH_DETECT_DISABLE will be ignored if bandgap is disabled. */ - if ((base->LP_CFG & SPC_LP_CFG_GLITCH_DETECT_DISABLE_MASK) == 0UL) - { - return kStatus_SPC_BandgapModeWrong; - } -#endif - } - - reg &= ~SPC_LP_CFG_BGMODE_MASK; - reg |= SPC_LP_CFG_BGMODE(mode); - base->LP_CFG = reg; - - return kStatus_Success; -} - -/*! - * brief Configs CORE voltage detect options. - * - * This function configs CORE voltage detect options. - * Note: Setting both the voltage detect interrupt and reset - * enable will cause interrupt to be generated on exit from reset. - * If those conditioned is not desired, interrupt/reset only one is enabled. - * - * param base SPC peripheral base address. - * param config Pointer to spc_core_voltage_detect_config_t structure. - */ -void SPC_SetCoreVoltageDetectConfig(SPC_Type *base, const spc_core_voltage_detect_config_t *config) -{ - assert(config != NULL); - - uint32_t reg = 0UL; - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) - reg |= (config->option.HVDInterruptEnable) ? SPC_VD_CORE_CFG_HVDIE(1U) : SPC_VD_CORE_CFG_HVDIE(0U); - reg |= (config->option.HVDResetEnable) ? SPC_VD_CORE_CFG_HVDRE(1U) : SPC_VD_CORE_CFG_HVDRE(0U); -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD */ - reg |= (config->option.LVDInterruptEnable) ? SPC_VD_CORE_CFG_LVDIE(1U) : SPC_VD_CORE_CFG_LVDIE(0U); - reg |= (config->option.LVDResetEnable) ? SPC_VD_CORE_CFG_LVDRE(1U) : SPC_VD_CORE_CFG_LVDRE(0U); - - base->VD_CORE_CFG = reg; -} - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) -/*! - * brief Enables the Core High Voltage Detector in Active mode. - * - * note If the CORE_LDO high voltage detect is enabled in Active mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low. - * - * param base SPC peripheral base address. - * param enable Enable/Disable Core HVD. - * true - Enable Core High voltage detector in active mode. - * false - Disable Core High voltage detector in active mode. - * - * retval kStatus_Success Enable Core High Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeCoreHighVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_CORE_HVDE_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_CORE_HVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the Core High Voltage Detector in Low Power mode. - * - * note If the CORE_LDO high voltage detect is enabled in Low Power mode, - * please note that the bandgap must be enabled and the drive strength of each regulator - * must not set to low in low power mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable Core HVD. - * true - Enable Core High voltage detector in low power mode. - * false - Disable Core High voltage detector in low power mode. - * - * retval kStatus_Success Enable Core High Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeCoreHighVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_CORE_HVDE_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_CORE_HVDE_MASK; - } - - return status; -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD */ - -/*! - * brief Enables the Core VDD Low Voltage Detector in Active mode. - * - * note If the Core VDD high voltage detect is enabled in Active mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low. - * - * param base SPC peripheral base address. - * param enable Enable/Disable Core LVD. - * true - Enable Core Low voltage detector in active mode. - * false - Disable Core Low voltage detector in active mode. - * - * retval kStatus_Success Enable Core Low Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeCoreLowVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_CORE_LVDE_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_CORE_LVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the Core Low Voltage Detector in Low Power mode. - * - * note If the Core VDD low voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Low Power mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable Core HVD. - * true - Enable Core Low voltage detector in low power mode. - * false - Disable Core Low voltage detector in low power mode. - * - * retval kStatus_Success Enable Core Low Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeCoreLowVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_CORE_LVDE_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_CORE_LVDE_MASK; - } - - return status; -} - -/*! - * brief Set system VDD Low-voltage level selection. - * - * This function selects the system VDD low-voltage level. Changing system VDD low-voltage level - * must be done after disabling the System VDD low voltage reset and interrupt. - * - * @deprecated In latest RM, reserved for all devices, will removed in next release. - * - * param base SPC peripheral base address. - * param level System VDD Low-Voltage level selection. See @ref spc_low_voltage_level_select_t for details. - */ -void SPC_SetSystemVDDLowVoltageLevel(SPC_Type *base, spc_low_voltage_level_select_t level) -{ - (void)level; - (void)base; - - /* - uint32_t reg; - - reg = base->VD_SYS_CFG; - - base->VD_SYS_CFG &= ~(SPC_VD_SYS_CFG_LVDRE_MASK | SPC_VD_SYS_CFG_LVDIE_MASK); - reg |= SPC_VD_SYS_CFG_LVSEL(level); - - base->VD_SYS_CFG = reg; */ -} - -/*! - * brief Configs SYS VDD voltage detect options. - * - * This function config SYS voltage detect options. - * Note: Setting both the voltage detect interrupt and reset - * enable will cause interrupt to be generated on exit from reset. - * If those conditioned is not desired, interrupt/reset only one is enabled. - * - * param base SPC peripheral base address. - * param config Pointer to spc_system_voltage_detect_config_t structure. - */ -void SPC_SetSystemVoltageDetectConfig(SPC_Type *base, const spc_system_voltage_detect_config_t *config) -{ - assert(config != NULL); - - uint32_t reg = 0UL; - - reg |= (config->option.HVDInterruptEnable) ? SPC_VD_SYS_CFG_HVDIE(1U) : SPC_VD_SYS_CFG_HVDIE(0U); - reg |= (config->option.LVDInterruptEnable) ? SPC_VD_SYS_CFG_LVDIE(1U) : SPC_VD_SYS_CFG_LVDIE(0U); - reg |= (config->option.HVDResetEnable) ? SPC_VD_SYS_CFG_HVDRE(1U) : SPC_VD_SYS_CFG_HVDRE(0U); - reg |= (config->option.LVDResetEnable) ? SPC_VD_SYS_CFG_LVDRE(1U) : SPC_VD_SYS_CFG_LVDRE(0U); - - base->VD_SYS_CFG = reg; - - (void)(config->level); - /* SPC_SetSystemVDDLowVoltageLevel(base, config->level); */ -} - -/*! - * brief Enables the System VDD High Voltage Detector in Active mode. - * - * note If the System_LDO high voltage detect is enabled in Active mode, - * please note that the bandgap must be enabled and the drive strength of - * each regulator must not set to low in Active mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable System HVD. - * true - Enable System High voltage detector in active mode. - * false - Disable System High voltage detector in active mode. - * - * retval kStatus_Success Enable System High Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeSystemHighVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_SYS_HVDE_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_SYS_HVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the System VDD Low Voltage Detector in Active mode. - * - * note If the System_LDO low voltage detect is enabled in Active mode, - * please note that the bandgap must be enabled and the drive strength of each - * regulator must not set to low in Active mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable System LVD. - * true - Enable System Low voltage detector in active mode. - * false - Disable System Low voltage detector in active mode. - * - * retval kStatus_Success Enable the System Low Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeSystemLowVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_SYS_LVDE_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_SYS_LVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the System VDD High Voltage Detector in Low Power mode. - * - * note If the System_LDO high voltage detect is enabled in low power mode, - * please note that the bandgap must be enabled and the drive strength of each - * regulator must not set to low in low power mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable System HVD. - * true - Enable System High voltage detector in low power mode. - * false - Disable System High voltage detector in low power mode. - * - * retval kStatus_Success Enable System High Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeSystemHighVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_SYS_HVDE_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_SYS_HVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the System VDD Low Voltage Detector in Low Power mode. - * - * note If the System_LDO low voltage detect is enabled in Low Power mode, - * please note that the bandgap must be enabled and the drive strength of each - * regulator must not set to low in Low Power mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable System HVD. - * true - Enable System Low voltage detector in low power mode. - * false - Disable System Low voltage detector in low power mode. - * - * retval kStatus_Success Enable System Low Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeSystemLowVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_SYS_LVDE_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_SYS_LVDE_MASK; - } - - return status; -} - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) && FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) -/*! - * brief Set IO VDD Low-Voltage level selection. - * - * This function selects the IO VDD Low-voltage level. Changing IO VDD low-voltage level - * must be done after disabling the IO VDD low voltage reset and interrupt. - * - * param base SPC peripheral base address. - * param level IO VDD Low-voltage level selection. - */ -void SPC_SetIOVDDLowVoltageLevel(SPC_Type *base, spc_low_voltage_level_select_t level) -{ - uint32_t reg; - - reg = base->VD_IO_CFG; - - base->VD_IO_CFG &= ~(SPC_VD_IO_CFG_LVDRE_MASK | SPC_VD_IO_CFG_LVDIE_MASK | SPC_VD_IO_CFG_LVSEL_MASK); - reg |= SPC_VD_IO_CFG_LVSEL(level); - - base->VD_IO_CFG = reg; -} - -/*! - * brief Configs IO VDD voltage detect options. - * - * This function config IO voltage detect options. - * Note: Setting both the voltage detect interrupt and reset - * enable will cause interrupt to be generated on exit from reset. - * If those conditioned is not desired, interrupt/reset so only one is enabled. - * - * param base SPC peripheral base address. - * param config Pointer to spc_IO_voltage_detect_config_t structure. - */ -void SPC_SetIOVoltageDetectConfig(SPC_Type *base, const spc_io_voltage_detect_config_t *config) -{ - assert(config != NULL); - - uint32_t reg = 0UL; - - /* Set trip voltage level. */ - SPC_SetIOVDDLowVoltageLevel(base, config->level); - - reg = base->VD_IO_CFG; - reg &= ~(SPC_VD_IO_CFG_LVDRE_MASK | SPC_VD_IO_CFG_LVDIE_MASK | SPC_VD_IO_CFG_HVDRE_MASK | SPC_VD_IO_CFG_HVDIE_MASK); - - reg |= (config->option.HVDInterruptEnable) ? SPC_VD_IO_CFG_HVDIE(1U) : SPC_VD_IO_CFG_HVDIE(0U); - reg |= (config->option.LVDInterruptEnable) ? SPC_VD_IO_CFG_LVDIE(1U) : SPC_VD_IO_CFG_LVDIE(0U); - reg |= (config->option.HVDResetEnable) ? SPC_VD_IO_CFG_HVDRE(1U) : SPC_VD_IO_CFG_HVDRE(0U); - reg |= (config->option.LVDResetEnable) ? SPC_VD_IO_CFG_LVDRE(1U) : SPC_VD_IO_CFG_LVDRE(0U); - - base->VD_IO_CFG = reg; -} - -/*! - * brief Enables the IO VDD High Voltage Detector in Active mode. - * - * note If the IO high voltage detect is enabled in Active mode, - * please note that the bandgap must be enabled and the drive strength - * of each regulator must not set to low in Active mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable IO HVD. - * true - Enable IO High voltage detector in active mode. - * false - Disable IO High voltage detector in active mode. - * - * retval kStatus_Success Enable IO High Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeIOHighVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_IO_HVDE_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_IO_HVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the IO VDD Low Voltage Detector in Active mode. - * - * note If the IO low voltage detect is enabled in Active mode, - * please note that the bandgap must be enabled and the drive strength - * of each regulator must not set to low in Active mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable IO LVD. - * true - Enable IO Low voltage detector in active mode. - * false - Disable IO Low voltage detector in active mode. - * - * retval kStatus_Success Enable IO Low Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeIOLowVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_IO_LVDE_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_IO_LVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the IO VDD High Voltage Detector in Low Power mode. - * - * note If the IO high voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Low Power mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable IO HVD. - * true - Enable IO High voltage detector in low power mode. - * false - Disable IO High voltage detector in low power mode. - * - * retval kStatus_Success Enable IO High Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeIOHighVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_IO_HVDE_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_IO_HVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the IO VDD Low Voltage Detector in Low Power mode. - * - * note If the IO low voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Low Power mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable IO HVD. - * true - Enable IO Low voltage detector in low power mode. - * false - Disable IO Low voltage detector in low power mode. - * - * retval kStatus_Success Enable IO Low Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeIOLowVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_IO_LVDE_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_IO_LVDE_MASK; - } - - return status; -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD */ - -/*! - * brief Configs external voltage domains - * - * This function configs external voltage domains isolation. - * - * param base SPC peripheral base address. - * param lowPowerIsoMask The mask of external domains isolate enable during low power mode. - * param IsoMask The mask of external domains isolate. - */ -void SPC_SetExternalVoltageDomainsConfig(SPC_Type *base, uint8_t lowPowerIsoMask, uint8_t IsoMask) -{ - uint32_t reg = 0UL; - - reg |= SPC_EVD_CFG_REG_EVDISO(IsoMask) | SPC_EVD_CFG_REG_EVDLPISO(lowPowerIsoMask); - base->EVD_CFG = reg; -} - -/*! - * brief Configs Core LDO Regulator in Active mode. - * - * @note The bandgap must be enabled before invoking this function. - * @note To set Core LDO as low drive strength, all HVDs/LVDs must be disabled previously. - * - * param base SPC peripheral base address. - * param option Pointer to the spc_active_mode_Core_LDO_option_t structure. - * - * retval kStatus_Success Config Core LDO regulator in Active power mode successful. - * retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * retval kStatus_SPC_BandgapModeWrong Bandgap should be enabled before invoking this function. - * retval kStatus_SPC_CORELDOLowDriveStrengthIgnore To set Core LDO as low drive strength, - * all LVDs/HVDs must be disabled before invoking this function. - */ -status_t SPC_SetActiveModeCoreLDORegulatorConfig(SPC_Type *base, const spc_active_mode_core_ldo_option_t *option) -{ - assert(option != NULL); - - if ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - return kStatus_SPC_Busy; - } - - /* Check input parameters. */ - /* 1. Bandgap must not be disabled. */ - if (SPC_GetActiveModeBandgapMode(base) == kSPC_BandgapDisabled) - { - return kStatus_SPC_BandgapModeWrong; - } - - /* 2. To set to low drive strength, all LVDs/HVDs must be disabled previously. */ - if ((SPC_GetActiveModeVoltageDetectStatus(base) != 0UL) && - (option->CoreLDODriveStrength == kSPC_CoreLDO_LowDriveStrength)) - { - return kStatus_SPC_CORELDOLowDriveStrengthIgnore; - } - - if ((uint8_t)SPC_GetActiveModeCoreLDOVDDVoltageLevel(base) != (uint8_t)(option->CoreLDOVoltage)) - { -#if defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS - (void)SPC_SetActiveModeCoreLDORegulatorDriveStrength(base, kSPC_CoreLDO_NormalDriveStrength); -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - (void)SPC_SetActiveModeCoreLDORegulatorVoltageLevel(base, option->CoreLDOVoltage); - } - -#if defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS - (void)SPC_SetActiveModeCoreLDORegulatorDriveStrength(base, option->CoreLDODriveStrength); -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - - return kStatus_Success; -} - -/*! - * brief Set Core LDO VDD Regulator Voltage level in Active mode. - * - * @note In active mode, the Core LDO voltage level should only be changed when the - * Core LDO is in normal drive strength. - * - * @note Update Core LDO voltage level will set Busy flag, - * this function return only when busy flag is cleared by hardware - * - * param base SPC peripheral base address. - * param voltageLevel Specify the voltage level of CORE LDO Regulator in Active mode, please - refer to @ref spc_core_ldo_voltage_level_t. - * - * retval kStatus_SPC_CORELDOVoltageSetFail Core LDO voltage level should only be - * changed when the CORE_LDO is in normal drive strength. - * retval kStatus_Success Set Core LDO regulator voltage level in Active power mode successful. - */ -status_t SPC_SetActiveModeCoreLDORegulatorVoltageLevel(SPC_Type *base, spc_core_ldo_voltage_level_t voltageLevel) -{ - if ((uint8_t)voltageLevel != (uint8_t)SPC_GetActiveModeCoreLDOVDDVoltageLevel(base)) - { -#if (defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) - if (SPC_GetActiveModeCoreLDODriveStrength(base) != kSPC_CoreLDO_NormalDriveStrength) - { - return kStatus_SPC_CORELDOVoltageSetFail; - } -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - - base->ACTIVE_CFG = - ((base->ACTIVE_CFG & ~SPC_ACTIVE_CFG_CORELDO_VDD_LVL_MASK) | SPC_ACTIVE_CFG_CORELDO_VDD_LVL(voltageLevel)); - - /* - * $Branch Coverage Justification$ - * $ref spc_c_ref_1$. - */ - while ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - } - } - return kStatus_Success; -} - -#if defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS -/*! - * brief Set Core LDO VDD Regulator Drive Strength in Active mode. - * - * param base SPC peripheral base address. - * param driveStrength Specify the drive strength of CORE LDO Regulator in Active mode, please - refer to @ref spc_core_ldo_drive_strength_t. - * - * retval #kStatus_Success Set Core LDO regulator drive strength in Active power mode successful. - * retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore If any voltage detect enabled, - core_ldo's drive strength can not set to low. - * retval #kStatus_SPC_BandgapModeWrong The selected bandgap mode is not allowed. - */ -status_t SPC_SetActiveModeCoreLDORegulatorDriveStrength(SPC_Type *base, spc_core_ldo_drive_strength_t driveStrength) -{ - if (driveStrength == kSPC_CoreLDO_LowDriveStrength) - { - /* If any voltage detect feature is enabled in Active mode, then CORE_LDO's drive strength must not set to low. - */ - if (SPC_GetActiveModeVoltageDetectStatus(base) != 0UL) - { - return kStatus_SPC_CORELDOLowDriveStrengthIgnore; - } - } - - if (driveStrength == kSPC_CoreLDO_NormalDriveStrength) - { - /* If specify normal drive strength, bandgap must not be disabled. */ - if (SPC_GetActiveModeBandgapMode(base) == kSPC_BandgapDisabled) - { - return kStatus_SPC_BandgapModeWrong; - } - } - - base->ACTIVE_CFG = - ((base->ACTIVE_CFG & ~SPC_ACTIVE_CFG_CORELDO_VDD_DS_MASK) | SPC_ACTIVE_CFG_CORELDO_VDD_DS(driveStrength)); - - return kStatus_Success; -} -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - -/*! - * brief Configs CORE LDO Regulator in low power mode - * - * This function configs CORE LDO Regulator in Low Power mode. - * If CORE LDO VDD Drive Strength is set to Normal, the CORE LDO VDD regulator voltage - * level in Active mode must be equal to the voltage level in Low power mode. And the Bandgap - * must be programmed to select bandgap enabled. - * Core VDD voltage levels for the Core LDO low power regulator can only be changed when the CORE - * LDO Drive Strength is set as Normal. - * - * param base SPC peripheral base address. - * param option Pointer to the spc_lowpower_mode_Core_LDO_option_t structure. - * retval kStatus_Success Config Core LDO regulator in power mode successfully. - * retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * retval kStatus_SPC_CORELDOLowDriveStrengthIgnore HVDs/LVDs are not disabled before invoking this function. - * retval kStatus_SPC_BandgapModeWrong The bandgap is not enabled before invoking this function. - */ -status_t SPC_SetLowPowerModeCoreLDORegulatorConfig(SPC_Type *base, const spc_lowpower_mode_core_ldo_option_t *option) -{ - status_t status = kStatus_Success; - - if ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - /* - * $Line Coverage Justification$ - * $ref spc_c_ref_1$. - */ - return kStatus_SPC_Busy; - } - - status = SPC_SetLowPowerModeCoreLDORegulatorDriveStrength(base, option->CoreLDODriveStrength); - if (status == kStatus_Success) - { - (void)SPC_SetLowPowerModeCoreLDORegulatorVoltageLevel(base, option->CoreLDOVoltage); - } - - return status; -} - -/*! - * brief Set Core LDO VDD Regulator Voltage level in Low power mode. - * - * @note If Core LDO's drive strengths are same in active and low power mode, the Core LDO's voltage must be set to the - * same value in active and low power mode. Application should take care of this limitation. - * - * @note Some devices require Core LDO and DCDC have the same voltage level even if Core LDO is off. Application should - * take care of this limitation. - * - * param base SPC peripheral base address. - * param voltageLevel Voltage level of CORE LDO Regulator in Low power mode, please - refer to @ref spc_core_ldo_voltage_level_t. - * - * retval #kStatus_SPC_Busy The SPC instance is busy to execute other operation. - * retval #kStatus_Success Set Core LDO regulator voltage level in Low power mode successful. - */ -status_t SPC_SetLowPowerModeCoreLDORegulatorVoltageLevel(SPC_Type *base, spc_core_ldo_voltage_level_t voltageLevel) -{ - if ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - /* - * $Line Coverage Justification$ - * $ref spc_c_ref_1$. - */ - return kStatus_SPC_Busy; - } - - base->LP_CFG = ((base->LP_CFG & ~SPC_LP_CFG_CORELDO_VDD_LVL_MASK) | SPC_LP_CFG_CORELDO_VDD_LVL(voltageLevel)); - - /* - * $Branch Coverage Justification$ - * $ref spc_c_ref_1$. - */ - while ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - } - - return kStatus_Success; -} - -/*! - * brief Set Core LDO VDD Regulator Drive Strength in Low power mode. - * - * param base SPC peripheral base address. - * param driveStrength Specify drive strength of CORE LDO in low power mode. - * - * retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore Some voltage detect enabled, CORE LDO's drive strength can not set - * as low. - * retval #kStatus_Success Set Core LDO regulator drive strength in Low power mode successful. - * retval #kStatus_SPC_BandgapModeWrong Bandgap is disabled when attempt to set CORE LDO work as normal drive strength. - */ -status_t SPC_SetLowPowerModeCoreLDORegulatorDriveStrength(SPC_Type *base, spc_core_ldo_drive_strength_t driveStrength) -{ - if (driveStrength == kSPC_CoreLDO_LowDriveStrength) - { - /* If any voltage detect feature is enabled in Low Power mode, then CORE_LDO's drive strength must not set to - * low. - */ - if (SPC_GetLowPowerModeVoltageDetectStatus(base) != 0UL) - { - return kStatus_SPC_CORELDOLowDriveStrengthIgnore; - } - } - else - { - /* To specify normal drive strength, the bandgap must be enabled in low power mode. */ - if (SPC_GetLowPowerModeBandgapMode(base) == kSPC_BandgapDisabled) - { - return kStatus_SPC_BandgapModeWrong; - } - } - - base->LP_CFG = ((base->LP_CFG & ~SPC_LP_CFG_CORELDO_VDD_DS_MASK) | SPC_LP_CFG_CORELDO_VDD_DS(driveStrength)); - - return kStatus_Success; -} - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) -/*! - * brief Configs System LDO VDD Regulator in Active mode. - * - * This function configs System LDO VDD Regulator in Active mode. - * If System LDO VDD Drive Strength is set to Normal, the Bandgap mode in Active mode must be programmed - * to a value that enable the bandgap. - * If any voltage detects are kept enabled, configuration to set System LDO VDD drive strength to low will - * be ignored. - * If select System LDO VDD Regulator voltage level to Over Drive Voltage, the Drive Strength of System LDO VDD - * Regulator must be set to Normal otherwise the regulator Drive Strength will be forced to Normal. - * If select System LDO VDD Regulator voltage level to Over Drive Voltage, the High voltage detect must be disabled. - * Otherwise it will be fail to regulator to Over Drive Voltage. - * - * param base SPC peripheral base address. - * param option Pointer to the spc_active_mode_Sys_LDO_option_t structure. - * retval kStatus_Success Config System LDO regulator in Active power mode successful. - * retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * retval kStatus_SPC_BandgapModeWrong The bandgap is not enabled before invoking this function. - * retval kStatus_SPC_SYSLDOOverDriveVoltageFail HVD of System VDD is not disable before setting to Over Drive voltage. - * retval kStatus_SPC_SYSLDOLowDriveStrengthIgnore Set System LDO VDD regulator's driver strength to Low will be - * ignored. - */ -status_t SPC_SetActiveModeSystemLDORegulatorConfig(SPC_Type *base, const spc_active_mode_sys_ldo_option_t *option) -{ - assert(option != NULL); - - if ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - /* - * $Line Coverage Justification$ - * $ref spc_c_ref_1$. - */ - return kStatus_SPC_Busy; - } - - /* Check input parameters before setting registers. */ - /* 1. To set to low DS, all LVDs/HVDs must be disabled previously. */ - if ((SPC_GetActiveModeVoltageDetectStatus(base) != 0UL) && - (option->SysLDODriveStrength == kSPC_SysLDO_LowDriveStrength)) - { - return kStatus_SPC_SYSLDOLowDriveStrengthIgnore; - } - /* 2. If specify normal drive strength, bandgap must not be disabled. */ - if ((SPC_GetActiveModeBandgapMode(base) == kSPC_BandgapDisabled) && - (option->SysLDODriveStrength == kSPC_SysLDO_NormalDriveStrength)) - { - return kStatus_SPC_BandgapModeWrong; - } - - /* 3. Must disable system LDO high voltage detector before specifing overdrive voltage. */ - if ((option->SysLDOVoltage == kSPC_SysLDO_OverDriveVoltage) && - ((SPC_GetActiveModeVoltageDetectStatus(base) & SPC_ACTIVE_CFG_SYS_HVDE_MASK) != 0UL)) - { - return kStatus_SPC_SYSLDOOverDriveVoltageFail; - } - - (void)SPC_SetActiveModeSystemLDORegulatorDriveStrength(base, option->SysLDODriveStrength); - (void)SPC_SetActiveModeSystemLDORegulatorVoltageLevel(base, option->SysLDOVoltage); - - return kStatus_Success; -} - -/*! - * brief Set System LDO Regulator voltage level in Active mode. - * - * @note The system LDO regulator can only operate at the overdrive voltage level for a limited amount of time for the - * life of chip. - * - * param base SPC peripheral base address. - * param voltageLevel Specify the voltage level of System LDO Regulator in Active mode. - * - * retval #kStatus_Success Set System LDO Regulator voltage level in Active mode successfully. - * retval #kStatus_SPC_SYSLDOOverDriveVoltageFail Must disable system LDO high voltage detector before specifing - * overdrive voltage. - */ -status_t SPC_SetActiveModeSystemLDORegulatorVoltageLevel(SPC_Type *base, spc_sys_ldo_voltage_level_t voltageLevel) -{ - if (voltageLevel == kSPC_SysLDO_OverDriveVoltage) - { - /* Must disable system LDO high voltage detector before specifing overdrive voltage. */ - if ((SPC_GetActiveModeVoltageDetectStatus(base) & SPC_ACTIVE_CFG_SYS_HVDE_MASK) != 0UL) - { - return kStatus_SPC_SYSLDOOverDriveVoltageFail; - } - } - - base->ACTIVE_CFG = - (base->ACTIVE_CFG & ~SPC_ACTIVE_CFG_SYSLDO_VDD_LVL_MASK) | SPC_ACTIVE_CFG_SYSLDO_VDD_LVL(voltageLevel); - - return kStatus_Success; -} - -/*! - * brief Set System LDO Regulator Drive Strength in Active mode. - * - * param base SPC peripheral base address. - * param driveStrength Specify the drive strength of System LDO Regulator in Active mode. - * - * retval #kStatus_Success Set System LDO Regulator drive strength in Active mode successfully. - * retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Attempt to specify low drive strength is ignored due to any - voltage detect feature is enabled in active mode. - * retval #kStatus_SPC_BandgapModeWrong Bandgap mode in Active mode must be programmed to a value that enables - the bandgap if attempt to specify normal drive strength. - */ -status_t SPC_SetActiveModeSystemLDORegulatorDriveStrength(SPC_Type *base, spc_sys_ldo_drive_strength_t driveStrength) -{ - if (driveStrength == kSPC_SysLDO_LowDriveStrength) - { - /* If enabled any LVDs or HVDs, SPC will ignore the attempt to specify low drive strength. */ - if (SPC_GetActiveModeVoltageDetectStatus(base) != 0UL) - { - return kStatus_SPC_SYSLDOLowDriveStrengthIgnore; - } - } - - if (driveStrength == kSPC_SysLDO_NormalDriveStrength) - { - /* If specify normal drive strength, bandgap must not be disabled. */ - if (SPC_GetActiveModeBandgapMode(base) == kSPC_BandgapDisabled) - { - return kStatus_SPC_BandgapModeWrong; - } - } - - base->ACTIVE_CFG = - (base->ACTIVE_CFG & ~SPC_ACTIVE_CFG_SYSLDO_VDD_DS_MASK) | SPC_ACTIVE_CFG_SYSLDO_VDD_DS(driveStrength); - - return kStatus_Success; -} - -/*! - * brief Configs System LDO regulator in low power modes. - * - * This function configs System LDO regulator in low power modes. - * If System LDO VDD Regulator Drive strength is set to normal, bandgap mode in low power - * mode must be programmed to a value that enables the Bandgap. - * If any High voltage detectors or Low Voltage detectors are kept enabled, configuration - * to set System LDO Regulator drive strength as Low will be ignored. - * - * param base SPC peripheral base address. - * param option Pointer to spc_lowpower_mode_Sys_LDO_option_t structure. - * - * retval kStatus_Success Config System LDO regulator in Low Power Mode successfully. - * retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * retval kStatus_SPC_BandgapModeWrong The bandgap mode setting in Low Power Mode is wrong. - * retval kStatus_SPC_SYSLDOLowDriveStrengthIgnore Set driver strength to low will be ignored. - */ -status_t SPC_SetLowPowerModeSystemLDORegulatorConfig(SPC_Type *base, const spc_lowpower_mode_sys_ldo_option_t *option) -{ - status_t status; - - if ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - /* - * $Line Coverage Justification$ - * $ref spc_c_ref_1$. - */ - return kStatus_SPC_Busy; - } - - status = SPC_SetLowPowerModeSystemLDORegulatorDriveStrength(base, option->SysLDODriveStrength); - - return status; -} - -/*! - * brief Set System LDO Regulator drive strength in Low Power Mode. - * - * param base SPC peripheral base address. - * param driveStrength Specify the drive strength of System LDO Regulator in Low Power Mode. - * - * retval #kStatus_Success Set System LDO Regulator drive strength in Low Power Mode successfully. - * retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Attempt to specify low drive strength is ignored due to any - voltage detect feature is enabled in low power mode. - * retval #kStatus_SPC_BandgapModeWrong Bandgap mode in low power mode must be programmed to a value that enables - the bandgap if attempt to specify normal drive strength. - */ -status_t SPC_SetLowPowerModeSystemLDORegulatorDriveStrength(SPC_Type *base, spc_sys_ldo_drive_strength_t driveStrength) -{ - if (driveStrength == kSPC_SysLDO_LowDriveStrength) - { - /* If enabled any LVDs or HVDs, SPC will ignore the attempt to specify low drive strength. */ - if (SPC_GetLowPowerModeVoltageDetectStatus(base) != 0UL) - { - return kStatus_SPC_SYSLDOLowDriveStrengthIgnore; - } - } - else - { - /* If specify normal drive strength, bandgap must not be disabled. */ - if (SPC_GetLowPowerModeBandgapMode(base) == kSPC_BandgapDisabled) - { - return kStatus_SPC_BandgapModeWrong; - } - } - - base->LP_CFG = (base->LP_CFG & ~SPC_LP_CFG_SYSLDO_VDD_DS_MASK) | SPC_LP_CFG_SYSLDO_VDD_DS(driveStrength); - - return kStatus_Success; -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) -/*! - * brief Configs DCDC VDD Regulator in Active mode. - * - * note When changing the DCDC output voltage level, take care to change the CORE LDO voltage level. - * - * param base SPC peripheral base address. - * param option Pointer to the spc_active_mode_DCDC_option_t structure. - * - * retval kStatus_Success Config DCDC regulator in Active power mode successful. - * retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * retval kStatus_SPC_BandgapModeWrong The bandgap mode setting in Active mode is wrong. - */ -status_t SPC_SetActiveModeDCDCRegulatorConfig(SPC_Type *base, const spc_active_mode_dcdc_option_t *option) -{ - assert(option != NULL); - status_t status = kStatus_Success; - - if ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - /* - * $Line Coverage Justification$ - * $ref spc_c_ref_1$. - */ - return kStatus_SPC_Busy; - } - - status = SPC_SetActiveModeDCDCRegulatorDriveStrength(base, option->DCDCDriveStrength); - - if (status == kStatus_Success) - { - SPC_SetActiveModeDCDCRegulatorVoltageLevel(base, option->DCDCVoltage); - } - - /* - * $Branch Coverage Justification$ - * $ref spc_c_ref_1$. - */ - while ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - } - - return status; -} - -/*! - * brief Set DCDC VDD Regulator drive strength in Active mode. - * - * note To set DCDC drive strength as Normal, the bandgap must be enabled. - * - * param base SPC peripheral base address. - * param driveStrength Specify the DCDC VDD regulator drive strength, please refer to @ref spc_dcdc_drive_strength_t. - * - * retval #kStatus_Success Set DCDC VDD Regulator drive strength in Active mode successfully. - * retval #kStatus_SPC_BandgapModeWrong Set DCDC VDD Regulator drive strength to Normal, the Bandgap must be enabled. - */ -status_t SPC_SetActiveModeDCDCRegulatorDriveStrength(SPC_Type *base, spc_dcdc_drive_strength_t driveStrength) -{ - if (driveStrength == kSPC_DCDC_NormalDriveStrength) - { - /* If specify normal drive strength, bandgap must not be disabled. */ - if (SPC_GetActiveModeBandgapMode(base) == kSPC_BandgapDisabled) - { - return kStatus_SPC_BandgapModeWrong; - } - } - - base->ACTIVE_CFG = - ((base->ACTIVE_CFG) & (~SPC_ACTIVE_CFG_DCDC_VDD_DS_MASK)) | SPC_ACTIVE_CFG_DCDC_VDD_DS(driveStrength); - - return kStatus_Success; -} - -/*! - * brief Configs DCDC VDD Regulator in Low power modes. - * - * If DCDC VDD Drive Strength is set to Normal, the Bandgap mode in Low Power mode must be programmed - * to a value that enables the Bandgap. - * In Deep Power Down mode, DCDC regulator is always turned off. - * - * param base SPC peripheral base address. - * param option Pointer to the spc_lowpower_mode_DCDC_option_t structure. - * - * retval kStatus_Success Config DCDC regulator in low power mode successfully. - * retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * retval kStatus_SPC_BandgapModeWrong The bandgap should be enabled before invoking this function. - */ -status_t SPC_SetLowPowerModeDCDCRegulatorConfig(SPC_Type *base, const spc_lowpower_mode_dcdc_option_t *option) -{ - if ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - /* - * $Line Coverage Justification$ - * $ref spc_c_ref_1$. - */ - return kStatus_SPC_Busy; - } - - /* Check input parameter before setting registers. */ - if ((option->DCDCDriveStrength == kSPC_DCDC_NormalDriveStrength) && - (SPC_GetLowPowerModeBandgapMode(base) == kSPC_BandgapDisabled)) - { - return kStatus_SPC_BandgapModeWrong; - } - - /* - 1. Configure to desired voltage level. - 2. Change to low drive strength. - 3. Configure same voltage level in active mode. - */ - SPC_SetLowPowerModeDCDCRegulatorVoltageLevel(base, option->DCDCVoltage); - - /* Change to desired drive strength. */ - if (option->DCDCDriveStrength != kSPC_DCDC_LowDriveStrength) - { - (void)SPC_SetLowPowerModeDCDCRegulatorDriveStrength(base, option->DCDCDriveStrength); - } - - /* - * $Branch Coverage Justification$ - * $ref spc_c_ref_1$. - */ - while ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - } - - return kStatus_Success; -} - -/*! - * brief Set DCDC VDD Regulator drive strength in Low power mode. - * - * param base SPC peripheral base address. - * param driveStrength Specify the DCDC VDD Regulator drive strength, please refer to @ref spc_dcdc_drive_strength_t. - * - * retval #kStatus_Success Set DCDC VDD Regulator drive strength in Low power mode successfully. - * retval #kStatus_SPC_BandgapModeWrong Set DCDC VDD Regulator drive strength to Normal, the Bandgap must be enabled. - */ -status_t SPC_SetLowPowerModeDCDCRegulatorDriveStrength(SPC_Type *base, spc_dcdc_drive_strength_t driveStrength) -{ - if (driveStrength == kSPC_DCDC_NormalDriveStrength) - { - /* If specify normal drive strength, bandgap must not be disabled. */ - if (SPC_GetLowPowerModeBandgapMode(base) == kSPC_BandgapDisabled) - { - return kStatus_SPC_BandgapModeWrong; - } - } - - base->LP_CFG = ((base->LP_CFG) & (~SPC_LP_CFG_DCDC_VDD_DS_MASK)) | SPC_LP_CFG_DCDC_VDD_DS(driveStrength); - - return kStatus_Success; -} - -/*! - * brief Config DCDC Burst options - * - * param base SPC peripheral base address. - * param config Pointer to spc_DCDC_burst_config_t structure. - */ -void SPC_SetDCDCBurstConfig(SPC_Type *base, spc_dcdc_burst_config_t *config) -{ - assert(config != NULL); - uint32_t reg; - reg = base->DCDC_CFG; - reg &= ~(SPC_DCDC_CFG_FREQ_CNTRL_MASK | SPC_DCDC_CFG_FREQ_CNTRL_ON_MASK); - reg |= SPC_DCDC_CFG_FREQ_CNTRL(config->freq); - reg |= config->stabilizeBurstFreq ? SPC_DCDC_CFG_FREQ_CNTRL_ON(1U) : SPC_DCDC_CFG_FREQ_CNTRL_ON(0U); - base->DCDC_CFG = reg; - - /* Blocking until previous DCDC burst completed. */ - while ((base->DCDC_BURST_CFG & SPC_DCDC_BURST_CFG_BURST_ACK_MASK) == 0UL) - { - } - - if ((config->sofwareBurstRequest) || (config->externalBurstRequest)) - { - /* Clear DCDC burst acknowledge flag. */ - base->DCDC_BURST_CFG |= SPC_DCDC_BURST_CFG_BURST_ACK_MASK; - } - base->DCDC_BURST_CFG |= SPC_DCDC_BURST_CFG_EXT_BURST_EN(config->externalBurstRequest); - - if (config->sofwareBurstRequest) - { - base->DCDC_BURST_CFG |= SPC_DCDC_BURST_CFG_BURST_REQ_MASK; - } -} - -/*! - * brief Set the count value of the reference clock. - * - * This function set the count value of the reference clock to control the frequency - * of dcdc refresh when dcdc is configured in Pulse Refresh mode. - * - * param base SPC peripheral base address. - * param count The count value, 16 bit width. - */ -void SPC_SetDCDCRefreshCount(SPC_Type *base, uint16_t count) -{ - uint32_t reg; - - reg = base->DCDC_BURST_CFG; - reg &= ~SPC_DCDC_BURST_CFG_PULSE_REFRESH_CNT_MASK; - reg |= SPC_DCDC_BURST_CFG_PULSE_REFRESH_CNT(count); - - base->DCDC_BURST_CFG = reg; -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -/*! - * brief Configs all settings of regulators in Active mode at a time. - * - * @note This function is used to overwrite all settings of regulators(including bandgap mode, regulators' - * drive strength and voltage level) in active mode at a time. - * - * @note Enable/disable LVDs/HVDs before invoking this function. - * - * @note This function will check input parameters based on hardware restrictions before setting registers, if input - * parameters do not satisfy hardware restrictions the specific error will be reported. - * - * - * @note Some hardware restrictions not covered, application should be aware of this and follow this hardware - * restrictions otherwise some unkown issue may occur: - * 1. If Core LDO's drive strength are set to same value in both Active mode and low power mode, - * the voltage level should also set to same value. - * 2. When switching Core LDO's drive strength from low to normal, ensure the LDO_CORE high voltage level is set - * to same level that was set prior to switching to the LDO_CORE drive strength. Otherwise, if the LVDs are - * enabled, an unexpected LVD can occur. - * - * @note If this function can not satisfy some tricky settings, please invoke other low-level functions. - * - * param base SPC peripheral base address. - * param config Pointer to spc_active_mode_regulators_config_t structure. - * retval kStatus_Success Config regulators in Active power mode successful. - * retval kStatus_SPC_BandgapModeWrong The bandgap mode setting in Active mode is wrong. - * retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * retval kStatus_SPC_CORELDOVoltageWrong The selected voltage level in active mode is not allowed. - * retval kStatus_SPC_SYSLDOOverDriveVoltageFail Fail to regulator to Over Drive Voltage. - * retval kStatus_SPC_SYSLDOLowDriveStrengthIgnore Set driver strength to Low will be ignored. - * retval kStatus_SPC_DCDCLowDriveStrengthIgnore Set driver strength to Low will be ignored. - */ -status_t SPC_SetActiveModeRegulatorsConfig(SPC_Type *base, const spc_active_mode_regulators_config_t *config) -{ - assert(config != NULL); - - uint32_t activeModeVDValue = SPC_GetActiveModeVoltageDetectStatus(base); - - /* Check input parameters */ - /* 1. Bandgap should not be disabled if any of regulator in normal drive strength or - if any of LVDs/HVDs are enabled or if VDD CORE glitch detect are enabled. */ - if ((config->bandgapMode == kSPC_BandgapDisabled) && - ((activeModeVDValue != 0UL) -#if !(defined(FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) && FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) - || (SPC_CheckActiveModeVddCoreGlitchDetectEnabled(base) == true) -#endif /* FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - || (config->DCDCOption.DCDCDriveStrength == kSPC_DCDC_NormalDriveStrength) -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - || (config->SysLDOOption.SysLDODriveStrength == kSPC_SysLDO_NormalDriveStrength) -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ -#if (defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) - || (config->CoreLDOOption.CoreLDODriveStrength == kSPC_CoreLDO_NormalDriveStrength) -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - )) - { - return kStatus_SPC_BandgapModeWrong; - } - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - /* 2. Must disable system LDO high voltage detector before specifing SysLDO to overdrive voltage */ - if (((activeModeVDValue & SPC_ACTIVE_CFG_SYS_HVDE_MASK) != 0UL) && - (config->SysLDOOption.SysLDOVoltage == kSPC_SysLDO_OverDriveVoltage)) - { - return kStatus_SPC_SYSLDOOverDriveVoltageFail; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - /* 3. To set System LDO's drive strength to low, all LVDs and HVDs must be disabled. */ - if ((activeModeVDValue != 0UL) && (config->SysLDOOption.SysLDODriveStrength == kSPC_SysLDO_LowDriveStrength)) - { - return kStatus_SPC_SYSLDOLowDriveStrengthIgnore; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) - /* 4. To set Core LDO's drive strength to low, all LVDs and HVDs must be disabled. */ - if ((activeModeVDValue != 0UL) && (config->CoreLDOOption.CoreLDODriveStrength == kSPC_CoreLDO_LowDriveStrength)) - { - return kStatus_SPC_CORELDOLowDriveStrengthIgnore; - } -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - /* 5. Core LDO and DCDC should have same voltage level. */ - if ((uint8_t)config->DCDCOption.DCDCVoltage != (uint8_t)config->CoreLDOOption.CoreLDOVoltage) - { - return kStatus_SPC_CORELDOVoltageWrong; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - - if ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - return kStatus_SPC_Busy; - } - - base->ACTIVE_CFG = - ((base->ACTIVE_CFG) & ~(SPC_ACTIVE_CFG_BGMODE_MASK)) | SPC_ACTIVE_CFG_BGMODE(config->bandgapMode); -#if (defined(FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) - SPC_EnableActiveModeCMPBandgapBuffer(base, config->lpBuff); -#endif /* FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - (void)SPC_SetActiveModeSystemLDORegulatorConfig(base, &config->SysLDOOption); -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - (void)SPC_SetActiveModeDCDCRegulatorConfig(base, &config->DCDCOption); -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - - (void)SPC_SetActiveModeCoreLDORegulatorConfig(base, &config->CoreLDOOption); - - return kStatus_Success; -} - -/*! - * brief Configs regulators in Low Power mode. - * - * This function provides the method to config all on-chip regulators in Low Power mode. - * - * param base SPC peripheral base address. - * param config Pointer to spc_lowpower_mode_regulators_config_t structure. - * retval #kStatus_Success Config regulators in Low power mode successful. - * retval #kStatus_SPC_BandgapModeWrong The bandgap should not be disabled based on input settings. - * retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore Set driver strength to low will be ignored. - * retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Set driver strength to low will be ignored. - * retval #kStatus_SPC_CORELDOVoltageWrong Core LDO and System LDO do not have same voltage level. - */ -status_t SPC_SetLowPowerModeRegulatorsConfig(SPC_Type *base, const spc_lowpower_mode_regulators_config_t *config) -{ - assert(config != NULL); - uint32_t lpModeVDValue = SPC_GetLowPowerModeVoltageDetectStatus(base); - - /* Check input parameters */ - /* 1. Bandgap should not be disabled if any of regulator in normal drive strength or - if any of LVDs/HVDs are enabled or if VDD CORE glitch detect are enabled. */ - if ((config->bandgapMode == kSPC_BandgapDisabled) && - ((lpModeVDValue != 0UL) -#if !(defined(FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) && FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) - || (SPC_CheckLowPowerModeVddCoreGlitchDetectEnabled(base) == true) -#endif /* FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - || (config->DCDCOption.DCDCDriveStrength == kSPC_DCDC_NormalDriveStrength) -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - || (config->SysLDOOption.SysLDODriveStrength == kSPC_SysLDO_NormalDriveStrength) -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ -#if (defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) - || (config->CoreLDOOption.CoreLDODriveStrength == kSPC_CoreLDO_NormalDriveStrength) -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - )) - { - return kStatus_SPC_BandgapModeWrong; - } - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - /* 2. To set System LDO's drive strength to low, all LVDs and HVDs must be disabled. */ - if ((lpModeVDValue != 0UL) && (config->SysLDOOption.SysLDODriveStrength == kSPC_SysLDO_LowDriveStrength)) - { - return kStatus_SPC_SYSLDOLowDriveStrengthIgnore; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) - /* 3. To set Core LDO's drive strength to low, all LVDs and HVDs must be disabled. */ - if ((lpModeVDValue != 0UL) && (config->CoreLDOOption.CoreLDODriveStrength == kSPC_CoreLDO_LowDriveStrength)) - { - return kStatus_SPC_CORELDOLowDriveStrengthIgnore; - } -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - /* 5. Core LDO and DCDC should have same voltage level. */ - if ((uint8_t)config->DCDCOption.DCDCVoltage != (uint8_t)config->CoreLDOOption.CoreLDOVoltage) - { - return kStatus_SPC_CORELDOVoltageWrong; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - base->LP_CFG = ((base->LP_CFG) & ~(SPC_LP_CFG_BGMODE_MASK)) | SPC_LP_CFG_BGMODE(config->bandgapMode); -#if (defined(FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) - SPC_EnableLowPowerModeCMPBandgapBuffer(base, config->lpBuff); -#endif /* FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT) - SPC_EnableLowPowerModeCoreVDDInternalVoltageScaling(base, config->CoreIVS); -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT */ - SPC_EnableLowPowerModeLowPowerIREF(base, config->lpIREF); - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - (void)SPC_SetLowPowerModeSystemLDORegulatorConfig(base, &config->SysLDOOption); -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - (void)SPC_SetLowPowerModeDCDCRegulatorConfig(base, &config->DCDCOption); -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - - (void)SPC_SetLowPowerModeCoreLDORegulatorConfig(base, &config->CoreLDOOption); - - return kStatus_Success; -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_spc.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_spc.h deleted file mode 100644 index 52cb71c24db..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_spc.h +++ /dev/null @@ -1,2433 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_SPC_H_ -#define FSL_SPC_H_ -#include "fsl_common.h" - -/*! - * @addtogroup mcx_spc - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief SPC driver version 2.4.2. */ -#define FSL_SPC_DRIVER_VERSION (MAKE_VERSION(2, 4, 2)) -/*! @} */ - -#define SPC_EVD_CFG_REG_EVDISO_SHIFT 0UL -#define SPC_EVD_CFG_REG_EVDLPISO_SHIFT 8UL -#define SPC_EVD_CFG_REG_EVDSTAT_SHIFT 16UL - -#define SPC_EVD_CFG_REG_EVDISO(x) ((uint32_t)(x) << SPC_EVD_CFG_REG_EVDISO_SHIFT) -#define SPC_EVD_CFG_REG_EVDLPISO(x) ((uint32_t)(x) << SPC_EVD_CFG_REG_EVDLPISO_SHIFT) -#define SPC_EVD_CFG_REG_EVDSTAT(x) ((uint32_t)(x) << SPC_EVD_CFG_REG_EVDSTAT_SHIFT) - -#if (defined(SPC_GLITCH_DETECT_SC_CNT_SELECT_MASK)) -#define VDD_CORE_GLITCH_DETECT_SC GLITCH_DETECT_SC -#define SPC_VDD_CORE_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG_MASK SPC_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG_MASK -#define SPC_VDD_CORE_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG SPC_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG -#define SPC_VDD_CORE_GLITCH_DETECT_SC_LOCK_MASK SPC_GLITCH_DETECT_SC_LOCK_MASK -#define SPC_VDD_CORE_GLITCH_DETECT_SC_CNT_SELECT_MASK SPC_GLITCH_DETECT_SC_CNT_SELECT_MASK -#define SPC_VDD_CORE_GLITCH_DETECT_SC_CNT_SELECT SPC_GLITCH_DETECT_SC_CNT_SELECT -#define SPC_VDD_CORE_GLITCH_DETECT_SC_RE_MASK SPC_GLITCH_DETECT_SC_RE_MASK -#define SPC_VDD_CORE_GLITCH_DETECT_SC_RE SPC_GLITCH_DETECT_SC_RE -#define SPC_VDD_CORE_GLITCH_DETECT_SC_TIMEOUT_MASK SPC_GLITCH_DETECT_SC_TIMEOUT_MASK -#define SPC_VDD_CORE_GLITCH_DETECT_SC_TIMEOUT SPC_GLITCH_DETECT_SC_TIMEOUT -#define SPC_VDD_CORE_GLITCH_DETECT_SC_IE_MASK SPC_GLITCH_DETECT_SC_IE_MASK -#define SPC_VDD_CORE_GLITCH_DETECT_SC_IE SPC_GLITCH_DETECT_SC_IE -#endif - -/*! - * @brief SPC status enumeration. - * - * @note Some device(such as MCXA family) do not equip DCDC or System LDO, please refer to the reference manual - * to check. - */ -enum -{ - kStatus_SPC_Busy = MAKE_STATUS(kStatusGroup_SPC, 0U), /*!< The SPC instance is busy executing any - type of power mode transition. */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - kStatus_SPC_DCDCLowDriveStrengthIgnore = MAKE_STATUS(kStatusGroup_SPC, 1U), /*!< DCDC Low drive strength setting be - ignored for LVD/HVD enabled. */ - kStatus_SPC_DCDCPulseRefreshModeIgnore = MAKE_STATUS(kStatusGroup_SPC, 2U), /*!< DCDC Pulse Refresh Mode drive - strength setting be ignored for LVD/HVD enabled. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - kStatus_SPC_SYSLDOOverDriveVoltageFail = MAKE_STATUS(kStatusGroup_SPC, 3U), /*!< SYS LDO regulate to Over drive - voltage failed for SYS LDO HVD must be disabled. */ - kStatus_SPC_SYSLDOLowDriveStrengthIgnore = MAKE_STATUS(kStatusGroup_SPC, 4U), /*!< SYS LDO Low driver strength - setting be ignored for LDO LVD/HVD enabled. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - kStatus_SPC_CORELDOLowDriveStrengthIgnore = MAKE_STATUS(kStatusGroup_SPC, 5U), /*!< CORE LDO Low driver strength - setting be ignored for LDO LVD/HVD enabled. */ - kStatus_SPC_CORELDOVoltageWrong = MAKE_STATUS(kStatusGroup_SPC, 7U), /*!< Core LDO voltage is wrong. */ - kStatus_SPC_CORELDOVoltageSetFail = MAKE_STATUS(kStatusGroup_SPC, 8U), /*!< Core LDO voltage set fail. */ - kStatus_SPC_BandgapModeWrong = MAKE_STATUS(kStatusGroup_SPC, 6U), /*!< Selected Bandgap Mode wrong. */ -}; - -/*! - * @brief Voltage Detect Status Flags. - */ -enum _spc_voltage_detect_flags -{ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) && FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) - kSPC_IOVDDHighVoltageDetectFlag = SPC_VD_STAT_IOVDD_HVDF_MASK, /*!< IO VDD High-Voltage detect flag. */ - kSPC_IOVDDLowVoltageDetectFlag = SPC_VD_STAT_IOVDD_LVDF_MASK, /*!< IO VDD Low-Voltage detect flag. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD */ - kSPC_SystemVDDHighVoltageDetectFlag = SPC_VD_STAT_SYSVDD_HVDF_MASK, /*!< System VDD High-Voltage detect flag. */ - kSPC_SystemVDDLowVoltageDetectFlag = SPC_VD_STAT_SYSVDD_LVDF_MASK, /*!< System VDD Low-Voltage detect flag. */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) - kSPC_CoreVDDHighVoltageDetectFlag = SPC_VD_STAT_COREVDD_HVDF_MASK, /*!< Core VDD High-Voltage detect flag. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD */ - kSPC_CoreVDDLowVoltageDetectFlag = SPC_VD_STAT_COREVDD_LVDF_MASK, /*!< Core VDD Low-Voltage detect flag. */ -}; - -/*! - * @brief SPC power domain isolation status. - * @note Some devices(such as MCXA family) do not contain WAKE Power Domain, please refer to the reference manual to - * check. - */ -enum _spc_power_domains -{ - kSPC_MAINPowerDomainRetain = 1UL << 16U, /*!< Peripherals and IO pads retain in MAIN Power Domain. */ - kSPC_WAKEPowerDomainRetain = 1UL << 17U, /*!< Peripherals and IO pads retain in WAKE Power Domain. */ -}; - -/*! - * @brief The enumeration of all analog module that can be controlled by SPC in active or low-power modes. - * @anchor spc_analog_module_control - */ -enum _spc_analog_module_control -{ - kSPC_controlVref = 1UL << 0UL, /*!< Enable/disable VREF in active or low-power modes. */ - kSPC_controlUsb3vDet = 1UL << 1UL, /*!< Enable/disable USB3V_Det in active or low-power modes. */ - kSPC_controlDac0 = 1UL << 4UL, /*!< Enable/disable DAC0 in active or low-power modes. */ - kSPC_controlDac1 = 1UL << 5UL, /*!< Enable/disable DAC1 in active or low-power modes. */ - kSPC_controlDac2 = 1UL << 6UL, /*!< Enable/disable DAC2 in active or low-power modes. */ - kSPC_controlOpamp0 = 1UL << 8UL, /*!< Enable/disable OPAMP0 in active or low-power modes. */ - kSPC_controlOpamp1 = 1UL << 9UL, /*!< Enable/disable OPAMP1 in active or low-power modes. */ - kSPC_controlOpamp2 = 1UL << 10UL, /*!< Enable/disable OPAMP2 in active or low-power modes. */ - kSPC_controlCmp0 = 1UL << 16UL, /*!< Enable/disable CMP0 in active or low-power modes. */ - kSPC_controlCmp1 = 1UL << 17UL, /*!< Enable/disable CMP1 in active or low-power modes. */ - kSPC_controlCmp2 = 1UL << 18UL, /*!< Enable/disable CMP2 in active or low-power modes. */ - kSPC_controlCmp0Dac = 1UL << 20UL, /*!< Enable/disable CMP0_DAC in active or low-power modes. */ - kSPC_controlCmp1Dac = 1UL << 21UL, /*!< Enable/disable CMP1_DAC in active or low-power modes. */ - kSPC_controlCmp2Dac = 1UL << 22UL, /*!< Enable/disable CMP2_DAC in active or low-power modes. */ - kSPC_controlAllModules = 0x770773UL, /*!< Enable/disable all modules in active or low-power modes. */ -}; - -/*! - * @brief The enumeration of spc power domain, the connected power domain is chip specfic, please refer to chip's RM - * for details. - */ -typedef enum _spc_power_domain_id -{ - kSPC_PowerDomain0 = 0U, /*!< Power domain0, the connected power domain is chip specific. */ - kSPC_PowerDomain1 = 1U, /*!< Power domain1, the connected power domain is chip specific. */ -} spc_power_domain_id_t; - -/*! - * @brief The enumeration of Power domain's low power mode. - */ -typedef enum _spc_power_domain_low_power_mode -{ - kSPC_SleepWithSYSClockRunning = 0U, /*!< Power domain request SLEEP mode with SYS clock running. */ - kSPC_DeepSleepWithSysClockOff = 1U, /*!< Power domain request deep sleep mode with system clock off. */ - kSPC_PowerDownWithSysClockOff = 2U, /*!< Power domain request power down mode with system clock off. */ - kSPC_DeepPowerDownWithSysClockOff = 4U, /*!< Power domain request deep power down mode with system clock off. */ -} spc_power_domain_low_power_mode_t; - -/*! - * @brief SPC low power request output pin polarity. - */ -typedef enum _spc_lowPower_request_pin_polarity -{ - kSPC_HighTruePolarity = 0x0U, /*!< Control the High Polarity of the Low Power Reqest Pin. */ - kSPC_LowTruePolarity = 0x1U, /*!< Control the Low Polarity of the Low Power Reqest Pin. */ -} spc_lowpower_request_pin_polarity_t; - -/*! - * @brief SPC low power request output override. - */ -typedef enum _spc_lowPower_request_output_override -{ - kSPC_LowPowerRequestNotForced = 0x0U, /*!< Not Forced. */ - kSPC_LowPowerRequestReserved = 0x1U, /*!< Reserved. */ - kSPC_LowPowerRequestForcedLow = 0x2U, /*!< Forced Low (Ignore LowPower request output polarity setting.) */ - kSPC_LowPowerRequestForcedHigh = 0x3U, /*!< Forced High (Ignore LowPower request output polarity setting.) */ -} spc_lowpower_request_output_override_t; - -/*! - * @brief SPC Bandgap mode enumeration in Active mode or Low Power mode. - */ -typedef enum _spc_bandgap_mode -{ - kSPC_BandgapDisabled = 0x0U, /*!< Bandgap disabled. */ - kSPC_BandgapEnabledBufferDisabled = 0x1U, /*!< Bandgap enabled with Buffer disabled. */ - kSPC_BandgapEnabledBufferEnabled = 0x2U, /*!< Bandgap enabled with Buffer enabled. */ - kSPC_BandgapReserved = 0x3U, /*!< Reserved. */ -} spc_bandgap_mode_t; - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) -/*! - * @brief DCDC regulator voltage level enumeration in Active mode or Low Power Mode. - * - * @note #kSPC_DCDC_RetentionVoltage not supported for all power modes. - */ -typedef enum _spc_dcdc_voltage_level -{ - kSPC_DCDC_RetentionVoltage = 0x0U, /*!< DCDC_CORE Regulator regulate to retention - Voltage(Only supportedin low power modes) */ - kSPC_DCDC_MidVoltage = 0x1U, /*!< DCDC_CORE Regulator regulate to Mid Voltage(1.0V). */ - kSPC_DCDC_NormalVoltage = 0x2U, /*!< DCDC_CORE Regulator regulate to Normal Voltage(1.1V). */ - kSPC_DCDC_OverdriveVoltage = 0x3U, /*!< DCDC_CORE Regulator regulate to Safe-Mode Voltage(1.2V). */ -} spc_dcdc_voltage_level_t; - -/*! - * @brief DCDC regulator Drive Strength enumeration in Active mode or Low Power Mode. - * - * @note Different drive strength differ in these DCDC characterstics: - * Maximum load current - * Quiescent current - * Transient response. - */ -typedef enum _spc_dcdc_drive_strength -{ - kSPC_DCDC_PulseRefreshMode = 0x0U, /*!< DCDC_CORE Regulator Drive Strength set to Pulse Refresh Mode, - * This enum member is only useful for Low Power Mode config, please - * note that pluse refresh mode is invalid in SLEEP mode. - */ - kSPC_DCDC_LowDriveStrength = 0x1U, /*!< DCDC_CORE regulator Drive Strength set to low. */ - kSPC_DCDC_NormalDriveStrength = 0x2U, /*!< DCDC_CORE regulator Drive Strength set to Normal. */ -} spc_dcdc_drive_strength_t; -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) -/*! - * @brief SYS LDO regulator voltage level enumeration in Active mode. - */ -typedef enum _spc_sys_ldo_voltage_level -{ - kSPC_SysLDO_NormalVoltage = 0x0U, /*!< SYS LDO VDD Regulator regulate to Normal Voltage(1.8V). */ - kSPC_SysLDO_OverDriveVoltage = 0x1U, /*!< SYS LDO VDD Regulator regulate to Over Drive Voltage(2.5V). */ -} spc_sys_ldo_voltage_level_t; - -/*! - * @brief SYS LDO regulator Drive Strength enumeration in Active mode or Low Power mode. - */ -typedef enum _spc_sys_ldo_drive_strength -{ - kSPC_SysLDO_LowDriveStrength = 0x0U, /*!< SYS LDO VDD regulator Drive Strength set to low. */ - kSPC_SysLDO_NormalDriveStrength = 0x1U, /*!< SYS LDO VDD regulator Drive Strength set to Normal. */ -} spc_sys_ldo_drive_strength_t; -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -/*! - * @brief Core LDO regulator voltage level enumeration in Active mode or Low Power mode. - */ -typedef enum _spc_core_ldo_voltage_level -{ - kSPC_CoreLDO_UnderDriveVoltage = 0x0U, /*!< @deprecated, to align with description of latest RM, please use - #kSPC_Core_LDO_RetentionVoltage as instead. */ - kSPC_Core_LDO_RetentionVoltage = 0x0U, /*!< Core LDO VDD regulator regulate to retention voltage, please note that - only useful in low power modes and not all devices support this options - please refer to devices' RM for details. */ - kSPC_CoreLDO_MidDriveVoltage = 0x1U, /*!< Core LDO VDD regulator regulate to Mid Drive Voltage. */ - kSPC_CoreLDO_NormalVoltage = 0x2U, /*!< Core LDO VDD regulator regulate to Normal Voltage. */ - kSPC_CoreLDO_OverDriveVoltage = 0x3U, /*!< Core LDO VDD regulator regulate to overdrive Voltage. */ -} spc_core_ldo_voltage_level_t; - -/*! - * @brief CORE LDO VDD regulator Drive Strength enumeration in Low Power mode. - */ -typedef enum _spc_core_ldo_drive_strength -{ - kSPC_CoreLDO_LowDriveStrength = 0x0U, /*!< Core LDO VDD regulator Drive Strength set to low. */ - kSPC_CoreLDO_NormalDriveStrength = 0x1U, /*!< Core LDO VDD regulator Drive Strength set to Normal. */ -} spc_core_ldo_drive_strength_t; - -/*! - * @brief IO VDD Low-Voltage Level Select. - */ -typedef enum _spc_low_voltage_level_select -{ - kSPC_LowVoltageNormalLevel = 0x0U, /*!< @deprecated, please use kSPC_LowVoltageHighRange as instead. */ - kSPC_LowVoltageSafeLevel = 0x1U, /*!< @deprecated, please use kSPC_LowVoltageLowRange as instead. */ - - kSPC_LowVoltageHighRange = 0x0U, /*!< High range LVD threshold. */ - kSPC_LowVoltageLowRange = 0x1U, /*!< Low range LVD threshold. */ -} spc_low_voltage_level_select_t; - -#if !(defined(FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) && FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) -/*! - * @brief Used to select output of 4-bit ripple counter is used to monitor a glitch on VDD core. - */ -typedef enum _spc_vdd_core_glitch_ripple_counter_select -{ - kSPC_selectBit0Of4bitRippleCounter = 0x0U, /*!< Select bit-0 of 4-bit Ripple Counter - to detect glitch on VDD Core. */ - kSPC_selectBit1Of4bitRippleCounter = 0x1U, /*!< Select bit-1 of 4-bit Ripple Counter - to detect glitch on VDD Core. */ - kSPC_selectBit2Of4bitRippleCounter = 0x2U, /*!< Select bit-2 of 4-bit Ripple Counter - to detect glitch on VDD Core. */ - kSPC_selectBit3Of4bitRippleCounter = 0x3U, /*!< Select bit-3 of 4-bit Ripple Counter - to detect glitch on VDD Core. */ -} spc_vdd_core_glitch_ripple_counter_select_t; -#endif - -/*! - * @brief The list of the operating voltage for the SRAM's read/write timing margin. - */ -typedef enum _spc_sram_operate_voltage -{ - kSPC_sramOperateAt1P0V = 0x1U, /*!< SRAM configured for 1.0V operation. */ - kSPC_sramOperateAt1P1V = 0x2U, /*!< SRAM configured for 1.1V operation. */ - kSPC_sramOperateAt1P2V = 0x3U, /*!< SRAM configured for 1.2V operation. */ -} spc_sram_operate_voltage_t; - -#if !(defined(FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) && FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) -/*! - * @brief The configuration of VDD Core glitch detector. - */ -typedef struct _spc_vdd_core_glitch_detector_config -{ - spc_vdd_core_glitch_ripple_counter_select_t rippleCounterSelect; /*!< Used to set ripple counter. */ - uint8_t resetTimeoutValue; /*!< The timeout value used to reset glitch detect/compare logic after an initial - glitch is detected. */ - bool enableReset; /*!< Used to enable/disable POR/LVD reset that caused by CORE VDD glitch detect error. */ - bool enableInterrupt; /*!< Used to enable/disable hardware interrupt if CORE VDD glitch detect error. */ -} spc_vdd_core_glitch_detector_config_t; -#endif - -typedef struct _spc_sram_voltage_config -{ - spc_sram_operate_voltage_t operateVoltage; /*!< Specifies the operating voltage for the SRAM's - read/write timing margin. */ - bool requestVoltageUpdate; /*!< Used to control whether request an SRAM trim value change. */ -} spc_sram_voltage_config_t; - -/*! - * @brief Low Power Request output pin configuration. - */ -typedef struct _spc_lowpower_request_config -{ - bool enable; /*!< Low Power Request Output enable. */ - spc_lowpower_request_pin_polarity_t polarity; /*!< Low Power Request Output pin polarity select. */ - spc_lowpower_request_output_override_t override; /*!< Low Power Request Output Override. */ -} spc_lowpower_request_config_t; - -/*! - * @brief Core LDO regulator options in Active mode. - */ -typedef struct _spc_active_mode_core_ldo_option -{ - spc_core_ldo_voltage_level_t CoreLDOVoltage; /*!< Core LDO Regulator Voltage Level selection in Active mode. */ -#if defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS - spc_core_ldo_drive_strength_t CoreLDODriveStrength; /*!< Core LDO Regulator Drive Strength - selection in Active mode */ -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ -} spc_active_mode_core_ldo_option_t; - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) -/*! - * @brief System LDO regulator options in Active mode. - */ -typedef struct _spc_active_mode_sys_ldo_option -{ - spc_sys_ldo_voltage_level_t SysLDOVoltage; /*!< System LDO Regulator Voltage Level selection in Active mode. */ - spc_sys_ldo_drive_strength_t SysLDODriveStrength; /*!< System LDO Regulator Drive Strength - selection in Active mode. */ -} spc_active_mode_sys_ldo_option_t; -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) -/*! - * @brief DCDC regulator options in Active mode. - */ -typedef struct _spc_active_mode_dcdc_option -{ - spc_dcdc_voltage_level_t DCDCVoltage; /*!< DCDC Regulator Voltage Level selection in Active mode. */ - spc_dcdc_drive_strength_t DCDCDriveStrength; /*!< DCDC_CORE Regulator Drive Strength selection in Active mode. */ -} spc_active_mode_dcdc_option_t; -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -/*! - * @brief Core LDO regulator options in Low Power mode. - */ -typedef struct _spc_lowpower_mode_core_ldo_option -{ - spc_core_ldo_voltage_level_t CoreLDOVoltage; /*!< Core LDO Regulator Voltage Level selection in Low Power mode. */ - spc_core_ldo_drive_strength_t CoreLDODriveStrength; /*!< Core LDO Regulator Drive Strength - selection in Low Power mode */ -} spc_lowpower_mode_core_ldo_option_t; - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) -/*! - * @brief System LDO regulator options in Low Power mode. - */ -typedef struct _spc_lowpower_mode_sys_ldo_option -{ - spc_sys_ldo_drive_strength_t SysLDODriveStrength; /*!< System LDO Regulator Drive Strength - selection in Low Power mode. */ -} spc_lowpower_mode_sys_ldo_option_t; -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) -/*! - * @brief DCDC regulator options in Low Power mode. - */ -typedef struct _spc_lowpower_mode_dcdc_option -{ - spc_dcdc_voltage_level_t DCDCVoltage; /*!< DCDC Regulator Voltage Level selection in Low Power mode. */ - spc_dcdc_drive_strength_t DCDCDriveStrength; /*!< DCDC_CORE Regulator Drive Strength selection in Low Power mode. */ -} spc_lowpower_mode_dcdc_option_t; - -/*! - * @brief DCDC Burst configuration. - * @deprecated Do not recommend to use this structure. - */ -typedef struct _spc_dcdc_burst_config -{ - bool sofwareBurstRequest; /*!< Enable/Disable DCDC Software Burst Request. */ - bool externalBurstRequest; /*!< Enable/Disable DCDC External Burst Request. */ - bool stabilizeBurstFreq; /*!< Enable/Disable DCDC frequency stabilization. */ - uint8_t freq; /*!< The frequency of the current burst. */ -} spc_dcdc_burst_config_t; -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -/*! - * @brief CORE/SYS/IO VDD Voltage Detect options. - */ -typedef struct _spc_voltage_detect_option -{ - bool HVDInterruptEnable; /*!< CORE/SYS/IO VDD High Voltage Detect interrupt enable. */ - bool HVDResetEnable; /*!< CORE/SYS/IO VDD High Voltage Detect reset enable. */ - bool LVDInterruptEnable; /*!< CORE/SYS/IO VDD Low Voltage Detect interrupt enable. */ - bool LVDResetEnable; /*!< CORE/SYS/IO VDD Low Voltage Detect reset enable. */ -} spc_voltage_detect_option_t; - -/*! - * @brief Core Voltage Detect configuration. - */ -typedef struct _spc_core_voltage_detect_config -{ - spc_voltage_detect_option_t option; /*!< Core VDD Voltage Detect option. */ -} spc_core_voltage_detect_config_t; - -/*! - * @brief System Voltage Detect Configuration. - */ -typedef struct _spc_system_voltage_detect_config -{ - spc_voltage_detect_option_t option; /*!< System VDD Voltage Detect option. */ - spc_low_voltage_level_select_t level; /*!< @deprecated, reserved for all devices, will removed in next release. */ -} spc_system_voltage_detect_config_t; - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) && FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) -/*! - * @brief IO Voltage Detect Configuration. - */ -typedef struct _spc_io_voltage_detect_config -{ - spc_voltage_detect_option_t option; /*!< IO VDD Voltage Detect option. */ - spc_low_voltage_level_select_t level; /*!< IO VDD Low-voltage level selection. */ -} spc_io_voltage_detect_config_t; -#endif /* FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD */ - -/*! - * @brief Active mode configuration. - */ -typedef struct _spc_active_mode_regulators_config -{ - spc_bandgap_mode_t bandgapMode; /*!< Specify bandgap mode in active mode. */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) - bool lpBuff; /*!< Enable/disable CMP bandgap buffer. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - spc_active_mode_dcdc_option_t DCDCOption; /*!< Specify DCDC configurations in active mode. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - spc_active_mode_sys_ldo_option_t SysLDOOption; /*!< Specify System LDO configurations in active mode. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - - spc_active_mode_core_ldo_option_t CoreLDOOption; /*!< Specify Core LDO configurations in active mode. */ -} spc_active_mode_regulators_config_t; - -/*! - * @brief Low Power Mode configuration. - */ -typedef struct _spc_lowpower_mode_regulators_config -{ - bool lpIREF; /*!< Enable/disable low power IREF in low power modes. */ - spc_bandgap_mode_t bandgapMode; /*!< Specify bandgap mode in low power modes. */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) - bool lpBuff; /*!< Enable/disable CMP bandgap buffer in low power modes. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT) - bool CoreIVS; /*!< Enable/disable CORE VDD internal voltage scaling. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - spc_lowpower_mode_dcdc_option_t DCDCOption; /*!< Specify DCDC configurations in low power modes. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - spc_lowpower_mode_sys_ldo_option_t SysLDOOption; /*!< Specify system LDO configurations in low power modes. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - - spc_lowpower_mode_core_ldo_option_t CoreLDOOption; /*!< Specify core LDO configurations in low power modes. */ -} spc_lowpower_mode_regulators_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name SPC Status - * @{ - */ -/*! - * @brief Gets Isolation status for each power domains. - * - * This function gets the status which indicates whether certain - * peripheral and the IO pads are in a latched state as a result - * of having been in POWERDOWN mode. - * - * @param base SPC peripheral base address. - * @return Current isolation status for each power domains. See @ref _spc_power_domains for details. - */ -uint8_t SPC_GetPeriphIOIsolationStatus(SPC_Type *base); - -/*! - * @brief Clears peripherals and I/O pads isolation flags for each power domains. - * - * This function clears peripherals and I/O pads isolation flags for each power domains. - * After recovering from the POWERDOWN mode, user must invoke this function to release the - * I/O pads and certain peripherals to their normal run mode state. Before invoking this - * function, user must restore chip configuration in particular pin configuration for enabled - * WUU wakeup pins. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_ClearPeriphIOIsolationFlag(SPC_Type *base) -{ - base->SC |= SPC_SC_ISO_CLR_MASK; -} - -/*! - * @brief Gets SPC busy status flag. - * - * This function gets SPC busy status flag. When SPC executing any type of power mode - * transition in ACTIVE mode or any of the SOC low power mode, the SPC busy status flag is set - * and this function returns true. When changing CORE LDO voltage level and DCDC voltage level - * in ACTIVE mode, the SPC busy status flag is set and this function return true. - * - * @param base SPC peripheral base address. - * @return Ack busy flag. - * true - SPC is busy. - * false - SPC is not busy. - */ -static inline bool SPC_GetBusyStatusFlag(SPC_Type *base) -{ - return ((base->SC & SPC_SC_BUSY_MASK) != 0UL); -} - -/*! - * @brief Checks system low power request. - * - * @note Only when all power domains request low power mode entry, the result of this function is true. That means when - * all power domains request low power mode entry, the SPC regulators will be controlled by LP_CFG register. - * - * @param base SPC peripheral base address. - * @return The system low power request check result. - * - \b true All power domains have requested low power mode and SPC has entered a low power state and power mode - * configuration are based on the LP_CFG configuration register. - * - \b false SPC in active mode and ACTIVE_CFG register control system power supply. - */ -static inline bool SPC_CheckLowPowerReqest(SPC_Type *base) -{ - return ((base->SC & SPC_SC_SPC_LP_REQ_MASK) == SPC_SC_SPC_LP_REQ_MASK); -} - -/*! - * @brief Clears system low power request, set SPC in active mode. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_ClearLowPowerRequest(SPC_Type *base) -{ - base->SC |= SPC_SC_SPC_LP_REQ_MASK; -} - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SWITCH_STATE_BIT) && FSL_FEATURE_MCX_SPC_HAS_SWITCH_STATE_BIT) -/*! - * @brief Checks whether the power switch is on. - * - * @param base SPC peripheral base address. - * - * @retval true The power switch is on. - * @retval false The power switch is off. - */ -static inline bool SPC_CheckSwitchState(SPC_Type *base) -{ - return ((base->SC & SPC_SC_SWITCH_STATE_MASK) != 0UL); -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_SWITCH_STATE_BIT */ - -/*! - * @brief Gets selected power domain's requested low power mode. - * - * @param base SPC peripheral base address. - * @param powerDomainId Power Domain Id, please refer to @ref spc_power_domain_id_t. - * - * @return The selected power domain's requested low power mode, please refer to @ref spc_power_domain_low_power_mode_t. - */ -spc_power_domain_low_power_mode_t SPC_GetPowerDomainLowPowerMode(SPC_Type *base, spc_power_domain_id_t powerDomainId); - -/*! - * @brief Checks power domain's low power request. - * - * @param base SPC peripheral base address. - * @param powerDomainId Power Domain Id, please refer to @ref spc_power_domain_id_t. - * @return The result of power domain's low power request. - * - \b true The selected power domain requests low power mode entry. - * - \b false The selected power domain does not request low power mode entry. - */ -static inline bool SPC_CheckPowerDomainLowPowerRequest(SPC_Type *base, spc_power_domain_id_t powerDomainId) -{ - assert((uint8_t)powerDomainId < SPC_PD_STATUS_COUNT); - return ((base->PD_STATUS[(uint8_t)powerDomainId] & SPC_PD_STATUS_PWR_REQ_STATUS_MASK) == - SPC_PD_STATUS_PWR_REQ_STATUS_MASK); -} - -/*! - * @brief Clears selected power domain's low power request flag. - * - * @param base SPC peripheral base address. - * @param powerDomainId Power Domain Id, please refer to @ref spc_power_domain_id_t. - */ -static inline void SPC_ClearPowerDomainLowPowerRequestFlag(SPC_Type *base, spc_power_domain_id_t powerDomainId) -{ - assert((uint8_t)powerDomainId < SPC_PD_STATUS_COUNT); - base->PD_STATUS[(uint8_t)powerDomainId] |= SPC_PD_STATUS_PD_LP_REQ_MASK; -} - -/*! @} */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SRAMRETLDO_REG) && FSL_FEATURE_MCX_SPC_HAS_SRAMRETLDO_REG) -/*! - * @name SRAM Retention LDO Control APIs - * @{ - */ - -/*! - * @brief Trims SRAM retention regulator reference voltage, trim step is 12 mV, range is around 0.48V to 0.85V. - * - * @param base SPC peripheral base address. - * @param trimValue Reference voltage trim value. - */ -static inline void SPC_TrimSRAMLdoRefVoltage(SPC_Type *base, uint8_t trimValue) -{ - base->SRAMRETLDO_REFTRIM = - ((base->SRAMRETLDO_REFTRIM & ~SPC_SRAMRETLDO_REFTRIM_REFTRIM_MASK) | SPC_SRAMRETLDO_REFTRIM_REFTRIM(trimValue)); -} - -/*! - * @brief Enables/disables SRAM retention LDO. - * - * @param base SPC peripheral base address. - * @param enable Used to enable/disable SRAM LDO : - * - \b true Enable SRAM LDO; - * - \b false Disable SRAM LDO. - */ -static inline void SPC_EnableSRAMLdo(SPC_Type *base, bool enable) -{ - if (enable) - { - base->SRAMRETLDO_CNTRL |= SPC_SRAMRETLDO_CNTRL_SRAMLDO_ON_MASK; - } - else - { - base->SRAMRETLDO_CNTRL &= ~SPC_SRAMRETLDO_CNTRL_SRAMLDO_ON_MASK; - } -} - -/*! - * @brief - * - * @todo Need to check. - * - * @param base SPC peripheral base address. - * @param mask The OR'ed value of SRAM Array. - */ -static inline void SPC_RetainSRAMArray(SPC_Type *base, uint8_t mask) -{ - base->SRAMRETLDO_CNTRL |= SPC_SRAMRETLDO_CNTRL_SRAM_RET_EN(mask); -} - -/*! @} */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_SRAMRETLDO_REG */ - -/*! - * @name Low Power Request configuration - * @{ - */ -/*! - * @brief Configs Low power request output pin. - * - * This function config the low power request output pin - * - * @param base SPC peripheral base address. - * @param config Pointer the @ref spc_lowpower_request_config_t structure. - */ -void SPC_SetLowPowerRequestConfig(SPC_Type *base, const spc_lowpower_request_config_t *config); - -/*! @} */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_CFG_REG) && FSL_FEATURE_MCX_SPC_HAS_CFG_REG) -/*! - * @name Integrated Power Switch Control APIs - * @{ - */ - -/*! - * @brief Enables/disables the integrated power switch manually. - * - * @param base SPC peripheral base address. - * @param enable Used to enable/disable the integrated power switch: - * - \b true Enable the integrated power switch; - * - \b false Disable the integrated power switch. - */ -static inline void SPC_EnableIntegratedPowerSwitchManually(SPC_Type *base, bool enable) -{ - if (enable) - { - base->CFG |= (SPC_CFG_INTG_PWSWTCH_SLEEP_ACTIVE_EN_MASK | SPC_CFG_INTG_PWSWTCH_WKUP_ACTIVE_EN_MASK); - } - else - { - base->CFG &= ~(SPC_CFG_INTG_PWSWTCH_SLEEP_ACTIVE_EN_MASK | SPC_CFG_INTG_PWSWTCH_WKUP_ACTIVE_EN_MASK); - } -} - -/*! - * @brief Enables/disables the integrated power switch automatically. - * - * To gate the integrated power switch when chip enter low power modes, and ungate the switch after wake-up from low - * power modes: - * @code - * SPC_EnableIntegratedPowerSwitchAutomatically(SPC, true, true); - * @endcode - * - * @param base SPC peripheral base address. - * @param sleepGate Enable the integrated power switch when chip enter low power modes: - * - \b true SPC asserts an output pin at low-power entry to power-gate the switch; - * - \b false SPC does not assert an output pin at low-power entry to power-gate the switch. - * @param wakeupUngate Enables the switch after wake-up from low power modes: - * - \b true SPC asserts an output pin at low-power exit to power-ungate the switch; - * - \b false SPC does not assert an output pin at low-power exit to power-ungate the switch. - */ -static inline void SPC_EnableIntegratedPowerSwitchAutomatically(SPC_Type *base, bool sleepGate, bool wakeupUngate) -{ - uint32_t tmp32 = ((base->CFG) & ~(SPC_CFG_INTG_PWSWTCH_SLEEP_EN_MASK | SPC_CFG_INTG_PWSWTCH_WKUP_EN_MASK)); - - tmp32 |= SPC_CFG_INTG_PWSWTCH_SLEEP_EN(sleepGate) | SPC_CFG_INTG_PWSWTCH_WKUP_EN(wakeupUngate); - - base->CFG = tmp32; -} - -/*! @} */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_CFG_REG */ - -#if !(defined(FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) && FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) -/*! - * @name VDD Core Glitch Detector Control APIs - * @{ - */ - -/*! - * @brief Configures VDD Core Glitch detector, including ripple counter selection, timeout value and so on. - * - * @param base SPC peripheral base address. - * @param config Pointer to the structure in type of @ref spc_vdd_core_glitch_detector_config_t. - */ -void SPC_ConfigVddCoreGlitchDetector(SPC_Type *base, const spc_vdd_core_glitch_detector_config_t *config); - -/*! - * @brief Checks selected 4-bit glitch ripple counter's output. - * - * @param base SPC peripheral base address. - * @param rippleCounter The ripple counter to check, please refer to @ref spc_vdd_core_glitch_ripple_counter_select_t. - * - * @retval true The selected ripple counter output is 1, will generate interrupt or reset based on settings. - * @retval false The selected ripple counter output is 0. - */ - -static inline bool SPC_CheckGlitchRippleCounterOutput(SPC_Type *base, - spc_vdd_core_glitch_ripple_counter_select_t rippleCounter) -{ - return ((base->VDD_CORE_GLITCH_DETECT_SC & SPC_VDD_CORE_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG_MASK) == - SPC_VDD_CORE_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG(1UL << (uint32_t)(rippleCounter))); -} - -/*! - * @brief Clears output of selected glitch ripple counter. - * - * @param base SPC peripheral base address. - * @param rippleCounter The ripple counter to check, please refer to @ref spc_vdd_core_glitch_ripple_counter_select_t. - */ -static inline void SPC_ClearGlitchRippleCounterOutput(SPC_Type *base, - spc_vdd_core_glitch_ripple_counter_select_t rippleCounter) -{ - base->VDD_CORE_GLITCH_DETECT_SC |= - SPC_VDD_CORE_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG(1UL << (uint32_t)(rippleCounter)); -} - -/*! - * @brief After invoking this function, writes to SPC_VDD_CORE_GLITCH_DETECT_SC[RE] register are ignored. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_LockVddCoreVoltageGlitchDetectResetControl(SPC_Type *base) -{ - base->VDD_CORE_GLITCH_DETECT_SC |= SPC_VDD_CORE_GLITCH_DETECT_SC_LOCK_MASK; -} - -/*! - * @brief After invoking this function, writes to SPC_VDD_CORE_GLITCH_DETECT_SC[RE] register are allowed. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_UnlockVddCoreVoltageGlitchDetectResetControl(SPC_Type *base) -{ - base->VDD_CORE_GLITCH_DETECT_SC &= ~SPC_VDD_CORE_GLITCH_DETECT_SC_LOCK_MASK; -} - -/*! - * @brief Checks if SPC_VDD_CORE_GLITCH_DETECT_SC[RE] register is writable. - * - * @param base SPC peripheral base address. - * - * @retval true SPC_VDD_CORE_GLITCH_DETECT_SC[RE] register is writable. - * @retval false SPC_VDD_CORE_GLITCH_DETECT_SC[RE] register is not writable. - */ -static inline bool SPC_CheckVddCoreVoltageGlitchResetControlState(SPC_Type *base) -{ - return ((base->VDD_CORE_GLITCH_DETECT_SC & SPC_VDD_CORE_GLITCH_DETECT_SC_LOCK_MASK) != 0UL); -} - -/*! @} */ -#endif - -/*! - * @name SRAM Control APIs - * @{ - */ - -/*! - * @brief Set SRAM operate voltage. - * - * @param base SPC peripheral base address. - * @param config The pointer to @ref spc_sram_voltage_config_t, specifies the configuration of sram voltage. - */ -void SPC_SetSRAMOperateVoltage(SPC_Type *base, const spc_sram_voltage_config_t *config); - -/*! @} */ - -/*! - * @name Active Mode configuration - * @{ - */ - -/*! - * @brief Gets the Bandgap mode in Active mode. - * - * @param base SPC peripheral base address. - * @return Bandgap mode in the type of @ref spc_bandgap_mode_t enumeration. - */ -static inline spc_bandgap_mode_t SPC_GetActiveModeBandgapMode(SPC_Type *base) -{ - return (spc_bandgap_mode_t)(uint32_t)((base->ACTIVE_CFG & SPC_ACTIVE_CFG_BGMODE_MASK) >> - SPC_ACTIVE_CFG_BGMODE_SHIFT); -} - -/*! - * @brief Gets all voltage detectors status in Active mode. - * - * @param base SPC peripheral base address. - * @return All voltage detectors status in Active mode. - */ -static inline uint32_t SPC_GetActiveModeVoltageDetectStatus(SPC_Type *base) -{ - uint32_t state; - state = base->ACTIVE_CFG & - ( -#if (defined(FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) && FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) - SPC_ACTIVE_CFG_IO_HVDE_MASK | SPC_ACTIVE_CFG_IO_LVDE_MASK | - -#endif /* FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD */ - SPC_ACTIVE_CFG_SYS_HVDE_MASK | SPC_ACTIVE_CFG_SYS_LVDE_MASK | SPC_ACTIVE_CFG_CORE_LVDE_MASK - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) - | SPC_ACTIVE_CFG_CORE_HVDE_MASK - -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD */ - ); - return state; -} - -/*! - * @brief Configs Bandgap mode in Active mode. - * - * @note To disable bandgap in Active mode: - * 1. Disable all LVD's and HVD's in active mode; - * 2. Disable Glitch detect; - * 3. Configrue LDO's and DCDC to low drive strength in active mode; - * 4. Invoke this function to disable bandgap in active mode; - * otherwise the error status will be reported. - * - * @note Some other system resources(such as PLL, CMP) require bandgap to be enabled, to disable bandgap please - * take care of other system resources. - * - * @param base SPC peripheral base address. - * @param mode The Bandgap mode be selected. - * - * @retval #kStatus_SPC_BandgapModeWrong The Bandgap can not be disabled in active mode. - * @retval #kStatus_Success Config Bandgap mode in Active power mode successful. - */ -status_t SPC_SetActiveModeBandgapModeConfig(SPC_Type *base, spc_bandgap_mode_t mode); - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) -/*! - * @brief Enables/Disable the CMP Bandgap Buffer in Active mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable CMP Bandgap buffer. - * true - Enable Buffer Stored Reference voltage to CMP. - * false - Disable Buffer Stored Reference voltage to CMP. - */ -static inline void SPC_EnableActiveModeCMPBandgapBuffer(SPC_Type *base, bool enable) -{ - if (enable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_LPBUFF_EN_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_LPBUFF_EN_MASK; - } -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT */ - -/*! - * @brief Sets the delay when the regulators change voltage level in Active mode. - * - * @param base SPC peripheral base address. - * @param delay The number of SPC timer clock cycles. - */ -static inline void SPC_SetActiveModeVoltageTrimDelay(SPC_Type *base, uint16_t delay) -{ - base->ACTIVE_VDELAY = SPC_ACTIVE_VDELAY_ACTIVE_VDELAY(delay); -} - -/*! - * @brief Configs all settings of regulators in Active mode at a time. - * - * @note This function is used to overwrite all settings of regulators(including bandgap mode, regulators' - * drive strength and voltage level) in active mode at a time. - * - * @note Enable/disable LVDs/HVDs before invoking this function. - * - * @note This function will check input parameters based on hardware restrictions before setting registers, if input - * parameters do not satisfy hardware restrictions the specific error will be reported. - * - * - * @note Some hardware restrictions not covered, application should be aware of this and follow this hardware - * restrictions otherwise some unkown issue may occur: - * 1. If Core LDO's drive strength are set to same value in both Active mode and low power mode, - * the voltage level should also set to same value. - * 2. When switching Core LDO's drive strength from low to normal, ensure the LDO_CORE high voltage level is set - * to same level that was set prior to switching to the LDO_CORE drive strength. Otherwise, if the LVDs are - * enabled, an unexpected LVD can occur. - * - * @note If this function can not satisfy some tricky settings, please invoke other APIs in low-level function group. - * - * @param base SPC peripheral base address. - * @param config Pointer to spc_active_mode_regulators_config_t structure. - * - * @retval #kStatus_Success Config regulators in Active power mode successful. - * @retval #kStatus_SPC_BandgapModeWrong Based on input setting, bandgap can not be disabled. - * @retval #kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * @retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore Any of LVDs/HVDs kept enabled before invoking this function. - * @retval #kStatus_SPC_SYSLDOOverDriveVoltageFail Fail to regulator to Over Drive Voltage due to - * System VDD HVD is not disabled. - * @retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Any of LVDs/HVDs kept enabled before invoking this function. - * @retval #kStatus_SPC_CORELDOVoltageWrong Core LDO and System LDO do not have same voltage level. - */ -status_t SPC_SetActiveModeRegulatorsConfig(SPC_Type *base, const spc_active_mode_regulators_config_t *config); - -#if !(defined(FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) && FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) -/*! - * @brief Disables/Enables VDD Core Glitch Detect in Active mode. - * - * @note State of glitch detect disable feature will be ignored if bandgap is disabled and - * glitch detect hardware will be forced to OFF state. - * - * @param base SPC peripheral base address. - * @param disable Used to disable/enable VDD Core Glitch detect feature. - * - \b true Disable VDD Core Low Voltage detect; - * - \b false Enable VDD Core Low Voltage detect. - */ -static inline void SPC_DisableActiveModeVddCoreGlitchDetect(SPC_Type *base, bool disable) -{ - if (disable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE_MASK; - } -} - -/*! - * @brief Check if Glitch detect hardware is enabled in active mode. - * - * @param base SPC peripheral base address. - * @return Indicate if Glitch detector is enabled. - */ -static inline bool SPC_CheckActiveModeVddCoreGlitchDetectEnabled(SPC_Type *base) -{ - if ((base->ACTIVE_CFG & SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE_MASK) == 0UL) - { - return true; - } - else - { - return false; - } -} - -#endif /* FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT */ - -/*! - * @brief Enables analog modules in active mode. - * - * @param base SPC peripheral base address. - * @param maskValue The mask of analog modules to enable in active mode, should be the OR'ed value - * of @ref spc_analog_module_control. - */ -static inline void SPC_EnableActiveModeAnalogModules(SPC_Type *base, uint32_t maskValue) -{ - base->ACTIVE_CFG1 |= SPC_ACTIVE_CFG1_SOC_CNTRL(maskValue); -} - -/*! - * @brief Disables analog modules in active mode. - * - * @param base SPC peripheral base address. - * @param maskValue The mask of analog modules to disable in active mode, should be the OR'ed value - * of @ref spc_analog_module_control. - */ -static inline void SPC_DisableActiveModeAnalogModules(SPC_Type *base, uint32_t maskValue) -{ - base->ACTIVE_CFG1 &= ~SPC_ACTIVE_CFG1_SOC_CNTRL(maskValue); -} - -/*! - * @brief Gets enabled analog modules that enabled in active mode. - * - * @param base SPC peripheral base address. - * - * @return The mask of enabled analog modules that enabled in active mode. - */ -static inline uint32_t SPC_GetActiveModeEnabledAnalogModules(SPC_Type *base) -{ - return base->ACTIVE_CFG1; -} - -/*! @} */ - -/*! - * @name Low Power mode configuration - * @{ - */ - -/*! - * @brief Gets the Bandgap mode in Low Power mode. - * - * @param base SPC peripheral base address. - * @return Bandgap mode in the type of @ref spc_bandgap_mode_t enumeration. - */ -static inline spc_bandgap_mode_t SPC_GetLowPowerModeBandgapMode(SPC_Type *base) -{ - return (spc_bandgap_mode_t)(uint32_t)((base->LP_CFG & SPC_LP_CFG_BGMODE_MASK) >> SPC_LP_CFG_BGMODE_SHIFT); -} - -/*! - * @brief Gets the status of all voltage detectors in Low Power mode. - * - * @param base SPC peripheral base address. - * @return The status of all voltage detectors in low power mode. - */ -static inline uint32_t SPC_GetLowPowerModeVoltageDetectStatus(SPC_Type *base) -{ - uint32_t state; - state = base->LP_CFG & ( -#if (defined(FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) && FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) - SPC_LP_CFG_IO_HVDE_MASK | SPC_LP_CFG_IO_LVDE_MASK | - -#endif /* FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD */ - SPC_LP_CFG_SYS_HVDE_MASK | SPC_LP_CFG_SYS_LVDE_MASK | SPC_LP_CFG_CORE_LVDE_MASK - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) - | SPC_LP_CFG_CORE_HVDE_MASK - -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD */ - ); - return state; -} - -/*! - * @brief Enables/Disables Low Power IREF in low power modes. - * - * This function enables/disables Low Power IREF. Low Power IREF can only get - * disabled in Deep power down mode. In other low power modes, the Low Power IREF - * is always enabled. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable Low Power IREF. - * true - Enable Low Power IREF for Low Power modes. - * false - Disable Low Power IREF for Deep Power Down mode. - */ -static inline void SPC_EnableLowPowerModeLowPowerIREF(SPC_Type *base, bool enable) -{ - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_LP_IREFEN_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_LP_IREFEN_MASK; - } -} - -/*! - * @brief Configs Bandgap mode in Low Power mode. - * - * @note To disable Bandgap in Low-power mode: - * 1. Disable all LVD's ad HVD's in low power mode; - * 2. Disable Glitch detect in low power mode; - * 3. Configure LDO's and DCDC to low drive strength in low power mode; - * 4. Disable bandgap in low power mode; - * Otherwise, the error status will be reported. - * - * @note Some other system resources(such as PLL, CMP) require bandgap to be enabled, to disable bandgap please - * take care of other system resources. - * - * @param base SPC peripheral base address. - * @param mode The Bandgap mode be selected. - * - * @retval #kStatus_SPC_BandgapModeWrong The bandgap mode setting in Low Power mode is wrong. - * @retval #kStatus_Success Config Bandgap mode in Low Power power mode successful. - */ -status_t SPC_SetLowPowerModeBandgapmodeConfig(SPC_Type *base, spc_bandgap_mode_t mode); - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SRAMLDO_DPD_ON_BIT) && FSL_FEATURE_MCX_SPC_HAS_SRAMLDO_DPD_ON_BIT) -/*! - * @brief Enables/disables SRAM_LDO deep power low power IREF. - * - * @param base SPC peripheral base address. - * @param enable Used to enable/disable low power IREF : - * - \b true: Low Power IREF is enabled ; - * - \b false: Low Power IREF is disabled for power saving. - */ -static inline void SPC_EnableSRAMLdOLowPowerModeIREF(SPC_Type *base, bool enable) -{ - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_SRAMLDO_DPD_ON_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_SRAMLDO_DPD_ON_MASK; - } -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_SRAMLDO_DPD_ON_BIT */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) -/*! - * @brief Enables/Disables CMP Bandgap Buffer. - * - * This function gates CMP bandgap buffer. CMP bandgap buffer is automatically disabled and turned off - * in Deep Power Down mode. - * - * @deprecated No longer used, please use SPC_EnableLowPowerModeCMPBandgapBuffer as instead. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable CMP Bandgap buffer. - * true - Enable Buffer Stored Reference Voltage to CMP. - * false - Disable Buffer Stored Reference Voltage to CMP. - */ -static inline void SPC_EnableLowPowerModeCMPBandgapBufferMode(SPC_Type *base, bool enable) -{ - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_LPBUFF_EN_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_LPBUFF_EN_MASK; - } -} - -/*! - * @brief Enables/Disables CMP Bandgap Buffer. - * - * This function gates CMP bandgap buffer. CMP bandgap buffer is automatically disabled and turned off - * in Deep Power Down mode. - * - * @deprecated No longer used. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable CMP Bandgap buffer. - * true - Enable Buffer Stored Reference Voltage to CMP. - * false - Disable Buffer Stored Reference Voltage to CMP. - */ -static inline void SPC_EnableLowPowerModeCMPBandgapBuffer(SPC_Type *base, bool enable) -{ - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_LPBUFF_EN_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_LPBUFF_EN_MASK; - } -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT) -/*! - * @brief Enables/Disables CORE VDD IVS(Internal Voltage Scaling) in power down modes. - * - * This function gates CORE VDD IVS. When enabled, the IVS regulator will scale the - * external input CORE VDD to a lower voltage level to reduce internal leakage. - * IVS is invalid in Sleep or Deep power down mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable IVS. - * true - enable CORE VDD IVS in Power Down mode. - * false - disable CORE VDD IVS in Power Down mode. - */ -static inline void SPC_EnableLowPowerModeCoreVDDInternalVoltageScaling(SPC_Type *base, bool enable) -{ - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_COREVDD_IVS_EN_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_COREVDD_IVS_EN_MASK; - } -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT */ - -/*! - * @brief Sets the delay when exit the low power modes. - * - * @param base SPC peripheral base address. - * @param delay The number of SPC timer clock cycles that the SPC waits on exit from low power modes. - */ -static inline void SPC_SetLowPowerWakeUpDelay(SPC_Type *base, uint16_t delay) -{ - base->LPWKUP_DELAY = SPC_LPWKUP_DELAY_LPWKUP_DELAY(delay); -} - -/*! - * @brief Configs all settings of regulators in Low power mode at a time. - * - * @note This function is used to overwrite all settings of regulators(including bandgap mode, regulators' - * drive strength and voltage level) in low power mode at a time. - * - * @note Enable/disable LVDs/HVDs before invoking this function. - * - * @note This function will check input parameters based on hardware restrictions before setting registers, if input - * parameters do not satisfy hardware restrictions the specific error will be reported. - * - * @note Some hardware restrictions not covered, application should be aware of this and follow this hardware - * restrictions otherwise some unkown issue may occur: - * 1. If Core LDO's drive strength are set to same value in both Active mode and low power mode, - * the voltage level should also set to same value. - * 2. When switching Core LDO's drive strength from low to normal, ensure the LDO_CORE high voltage level is set - * to same level that was set prior to switching to the LDO_CORE drive strength. Otherwise, if the LVDs are - * enabled, an unexpected LVD can occur. - * - * @note If this function can not satisfy some tricky settings, please invoke other APIs in low-level function group. - * - * @param base SPC peripheral base address. - * @param config Pointer to spc_lowpower_mode_regulators_config_t structure. - * @retval #kStatus_Success Config regulators in Low power mode successful. - * @retval #kStatus_SPC_BandgapModeWrong The bandgap should not be disabled based on input settings. - * @retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore Set driver strength to low will be ignored. - * @retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Set driver strength to low will be ignored. - * @retval #kStatus_SPC_CORELDOVoltageWrong Core LDO and System LDO do not have same voltage level. - */ -status_t SPC_SetLowPowerModeRegulatorsConfig(SPC_Type *base, const spc_lowpower_mode_regulators_config_t *config); - -#if !(defined(FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) && FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) -/*! - * @brief Disable/Enable VDD Core Glitch Detect in low power mode. - * - * @note State of glitch detect disable feature will be ignored if bandgap is disabled and - * glitch detect hardware will be forced to OFF state. - * - * @param base SPC peripheral base address. - * @param disable Used to disable/enable VDD Core Glitch detect feature. - * - \b true Disable VDD Core Low Voltage detect; - * - \b false Enable VDD Core Low Voltage detect. - */ -static inline void SPC_DisableLowPowerModeVddCoreGlitchDetect(SPC_Type *base, bool disable) -{ - if (disable) - { - base->LP_CFG |= SPC_LP_CFG_GLITCH_DETECT_DISABLE_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_GLITCH_DETECT_DISABLE_MASK; - } -} - -/*! - * @brief Check if Glitch detect hardware is enabled in low power mode. - * - * @param base SPC peripheral base address. - * @return Indicate if Glitch detector is enabled. - */ -static inline bool SPC_CheckLowPowerModeVddCoreGlitchDetectEnabled(SPC_Type *base) -{ - if ((base->LP_CFG & SPC_LP_CFG_GLITCH_DETECT_DISABLE_MASK) == 0UL) - { - return true; - } - else - { - return false; - } -} -#endif - -/*! - * @brief Enables analog modules in low power modes. - * - * @param base SPC peripheral base address. - * @param maskValue The mask of analog modules to enable in low power modes, should be OR'ed value - of @ref spc_analog_module_control. - */ -static inline void SPC_EnableLowPowerModeAnalogModules(SPC_Type *base, uint32_t maskValue) -{ - base->LP_CFG1 |= SPC_LP_CFG1_SOC_CNTRL(maskValue); -} - -/*! - * @brief Disables analog modules in low power modes. - * - * @param base SPC peripheral base address. - * @param maskValue The mask of analog modules to disable in low power modes, should be OR'ed value - of @ref spc_analog_module_control. - */ -static inline void SPC_DisableLowPowerModeAnalogModules(SPC_Type *base, uint32_t maskValue) -{ - base->LP_CFG1 &= ~SPC_LP_CFG1_SOC_CNTRL(maskValue); -} - -/*! - * @brief Gets enabled analog modules that enabled in low power modes. - * - * @param base SPC peripheral base address. - * - * @return The mask of enabled analog modules that enabled in low power modes. - */ -static inline uint32_t SPC_GetLowPowerModeEnabledAnalogModules(SPC_Type *base) -{ - return base->LP_CFG1; -} - -/*! @} */ - -/*! - * @name Voltage Detect Status - * @{ - */ -/*! - * @brief Get Voltage Detect Status Flags. - * - * @param base SPC peripheral base address. - * @return Voltage Detect Status Flags. See @ref _spc_voltage_detect_flags for details. - */ -static inline uint8_t SPC_GetVoltageDetectStatusFlag(SPC_Type *base) -{ - return (uint8_t)(base->VD_STAT); -} - -/*! - * @brief Clear Voltage Detect Status Flags. - * - * @param base SPC peripheral base address. - * @param mask The mask of the voltage detect status flags. See @ref _spc_voltage_detect_flags for details. - */ -static inline void SPC_ClearVoltageDetectStatusFlag(SPC_Type *base, uint8_t mask) -{ - base->VD_STAT |= mask; -} - -/*! @} */ - -/*! - * @name Voltage Detect configuration for Core voltage domain. - * @{ - */ - -/*! - * @brief Configs CORE voltage detect options. - * - * @note: Setting both the voltage detect interrupt and reset - * enable will cause interrupt to be generated on exit from reset. - * If those conditioned is not desired, interrupt/reset so only one is enabled. - * - * @param base SPC peripheral base address. - * @param config Pointer to spc_core_voltage_detect_config_t structure. - */ -void SPC_SetCoreVoltageDetectConfig(SPC_Type *base, const spc_core_voltage_detect_config_t *config); - -/*! - * @brief Locks Core voltage detect reset setting. - * - * This function locks core voltage detect reset setting. After invoking this function - * any configuration of Core voltage detect reset will be ignored. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_LockCoreVoltageDetectResetSetting(SPC_Type *base) -{ - base->VD_CORE_CFG |= SPC_VD_CORE_CFG_LOCK_MASK; -} - -/*! - * @brief Unlocks Core voltage detect reset setting. - * - * This function unlocks core voltage detect reset setting. If locks the Core - * voltage detect reset setting, invoking this function to unlock. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_UnlockCoreVoltageDetectResetSetting(SPC_Type *base) -{ - base->VD_CORE_CFG &= ~SPC_VD_CORE_CFG_LOCK_MASK; -} - -/*! - * @brief Enables/Disables the Core Low Voltage Detector in Active mode. - * - * @note If the CORE_LDO low voltage detect is enabled in Active mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable Core LVD. - * true - Enable Core Low voltage detector in active mode. - * false - Disable Core Low voltage detector in active mode. - * - * @retval #kStatus_Success Enable/Disable Core Low Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeCoreLowVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disables the Core Low Voltage Detector in Low Power mode. - * - * This function enables/disables the Core Low Voltage Detector. - * If enabled the Core Low Voltage detector. The Bandgap mode in - * low power mode must be programmed so that Bandgap is enabled. - * - * @note If the CORE_LDO low voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Low Power mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable Core HVD. - * true - Enable Core Low voltage detector in low power mode. - * false - Disable Core Low voltage detector in low power mode. - * - * @retval #kStatus_Success Enable/Disable Core Low Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeCoreLowVoltageDetect(SPC_Type *base, bool enable); - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) -/*! - * @brief Enables/Disables the Core High Voltage Detector in Active mode. - * - * @note If the CORE_LDO high voltage detect is enabled in Active mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable Core HVD. - * true - Enable Core High voltage detector in active mode. - * false - Disable Core High voltage detector in active mode. - * - * @retval #kStatus_Success Enable/Disable Core High Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeCoreHighVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disables the Core High Voltage Detector in Low Power mode. - * - * This function enables/disables the Core High Voltage Detector. - * If enabled the Core High Voltage detector. The Bandgap mode in - * low power mode must be programmed so that Bandgap is enabled. - * - * @note If the CORE_LDO high voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in low power mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable Core HVD. - * true - Enable Core High voltage detector in low power mode. - * false - Disable Core High voltage detector in low power mode. - * - * @retval #kStatus_Success Enable/Disable Core High Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeCoreHighVoltageDetect(SPC_Type *base, bool enable); -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD */ - -/*! @} */ - -/*! - * @name Voltage detect configuration for System Voltage domain - * @{ - */ -/*! - * @brief Set system VDD Low-voltage level selection. - * - * This function selects the system VDD low-voltage level. Changing system VDD low-voltage level - * must be done after disabling the System VDD low voltage reset and interrupt. - * - * @deprecated In latest RM, reserved for all devices, will removed in next release. - * - * @param base SPC peripheral base address. - * @param level System VDD Low-Voltage level selection. - */ -void SPC_SetSystemVDDLowVoltageLevel(SPC_Type *base, spc_low_voltage_level_select_t level); - -/*! - * @brief Configs SYS voltage detect options. - * - * This function config SYS voltage detect options. - * @note: Setting both the voltage detect interrupt and reset - * enable will cause interrupt to be generated on exit from reset. - * If those conditioned is not desired, interrupt/reset so only one is enabled. - * - * @param base SPC peripheral base address. - * @param config Pointer to spc_system_voltage_detect_config_t structure. - */ -void SPC_SetSystemVoltageDetectConfig(SPC_Type *base, const spc_system_voltage_detect_config_t *config); - -/*! - * @brief Lock System voltage detect reset setting. - * - * This function locks system voltage detect reset setting. After invoking this function - * any configuration of System Voltage detect reset will be ignored. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_LockSystemVoltageDetectResetSetting(SPC_Type *base) -{ - base->VD_SYS_CFG |= SPC_VD_SYS_CFG_LOCK_MASK; -} - -/*! - * @brief Unlock System voltage detect reset setting. - * - * This function unlocks system voltage detect reset setting. If locks the System - * voltage detect reset setting, invoking this function to unlock. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_UnlockSystemVoltageDetectResetSetting(SPC_Type *base) -{ - base->VD_SYS_CFG &= ~SPC_VD_SYS_CFG_LOCK_MASK; -} - -/*! - * @brief Enables/Disables the System High Voltage Detector in Active mode. - * - * @note If the System_LDO high voltage detect is enabled in Active mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Active mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable System HVD. - * true - Enable System High voltage detector in active mode. - * false - Disable System High voltage detector in active mode. - * - * @retval #kStatus_Success Enable/Disable System High Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeSystemHighVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disable the System Low Voltage Detector in Active mode. - * - * @note If the System_LDO low voltage detect is enabled in Active mode, - * please note that the bandgap must be enabled and the drive strength of each - * regulator must not set to low in Active mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable System LVD. - * true - Enable System Low voltage detector in active mode. - * false - Disable System Low voltage detector in active mode. - * - * @retval #kStatus_Success Enable/Disable the System Low Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeSystemLowVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disables the System High Voltage Detector in Low Power mode. - * - * @note If the System_LDO high voltage detect is enabled in Low Power mode, please note - * that the bandgap must be enabled and the drive strength of each regulator must - * not set to low in Low Power mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable System HVD. - * true - Enable System High voltage detector in low power mode. - * false - Disable System High voltage detector in low power mode. - * - * @retval #kStatus_Success Enable/Disable System High Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeSystemHighVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disables the System Low Voltage Detector in Low Power mode. - * - * @note If the System_LDO low voltage detect is enabled in Low Power mode, - * please note that the bandgap must be enabled and the drive strength of each - * regulator must not set to low in Low Power mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable System HVD. - * true - Enable System Low voltage detector in low power mode. - * false - Disable System Low voltage detector in low power mode. - * - * @retval #kStatus_Success Enables System Low Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeSystemLowVoltageDetect(SPC_Type *base, bool enable); - -/*! @} */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) && FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) -/*! - * @name Voltage detect configuration for IO voltage domain - * @{ - */ -/*! - * @brief Set IO VDD Low-Voltage level selection. - * - * This function selects the IO VDD Low-voltage level. Changing IO VDD low-voltage level - * must be done after disabling the IO VDD low voltage reset and interrupt. - * - * @param base SPC peripheral base address. - * @param level IO VDD Low-voltage level selection. - */ -void SPC_SetIOVDDLowVoltageLevel(SPC_Type *base, spc_low_voltage_level_select_t level); - -/*! - * @brief Configs IO voltage detect options. - * - * This function config IO voltage detect options. - * @note: Setting both the voltage detect interrupt and reset - * enable will cause interrupt to be generated on exit from reset. - * If those conditioned is not desired, interrupt/reset so only one is enabled. - * - * @param base SPC peripheral base address. - * @param config Pointer to spc_voltage_detect_config_t structure. - */ -void SPC_SetIOVoltageDetectConfig(SPC_Type *base, const spc_io_voltage_detect_config_t *config); - -/*! - * @brief Lock IO Voltage detect reset setting. - * - * This function locks IO voltage detect reset setting. After invoking this function - * any configuration of system voltage detect reset will be ignored. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_LockIOVoltageDetectResetSetting(SPC_Type *base) -{ - base->VD_IO_CFG |= SPC_VD_IO_CFG_LOCK_MASK; -} - -/*! - * @brief Unlock IO voltage detect reset setting. - * - * This function unlocks IO voltage detect reset setting. If locks the IO - * voltage detect reset setting, invoking this function to unlock. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_UnlockIOVoltageDetectResetSetting(SPC_Type *base) -{ - base->VD_IO_CFG &= ~SPC_VD_IO_CFG_LOCK_MASK; -} - -/*! - * @brief Enables/Disables the IO High Voltage Detector in Active mode. - * - * @note If the IO high voltage detect is enabled in Active mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Active mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable IO HVD. - * true - Enable IO High voltage detector in active mode. - * false - Disable IO High voltage detector in active mode. - * - * @retval #kStatus_Success Enable/Disable IO High Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeIOHighVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disables the IO Low Voltage Detector in Active mode. - * - * @note If the IO low voltage detect is enabled in Active mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Active mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable IO LVD. - * true - Enable IO Low voltage detector in active mode. - * false - Disable IO Low voltage detector in active mode. - * - * @retval #kStatus_Success Enable IO Low Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeIOLowVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disables the IO High Voltage Detector in Low Power mode. - * - * @note If the IO high voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Low Power mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable IO HVD. - * true - Enable IO High voltage detector in low power mode. - * false - Disable IO High voltage detector in low power mode. - * - * @retval #kStatus_Success Enable IO High Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeIOHighVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disables the IO Low Voltage Detector in Low Power mode. - * - * @note If the IO low voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Low Power mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable IO LVD. - * true - Enable IO Low voltage detector in low power mode. - * false - Disable IO Low voltage detector in low power mode. - * - * @retval #kStatus_Success Enable/Disable IO Low Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeIOLowVoltageDetect(SPC_Type *base, bool enable); - -/*! @} */ - -#endif /* FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD */ - -/*! - * @name External Voltage domains configuration - * @{ - */ -/*! - * @brief Configs external voltage domains - * - * This function configs external voltage domains isolation. - * - * @param base SPC peripheral base address. - * @param lowPowerIsoMask The mask of external domains isolate enable during low power mode. Please read the Reference - * Manual for the Bitmap. - * @param IsoMask The mask of external domains isolate. Please read the Reference Manual for the Bitmap. - */ -void SPC_SetExternalVoltageDomainsConfig(SPC_Type *base, uint8_t lowPowerIsoMask, uint8_t IsoMask); - -/*! - * @brief Gets External Domains status. - * - * @param base SPC peripheral base address. - * @return The status of each external domain. - */ -static inline uint8_t SPC_GetExternalDomainsStatus(SPC_Type *base) -{ - return (uint8_t)(base->EVD_CFG >> SPC_EVD_CFG_REG_EVDSTAT_SHIFT); -} - -/*! @} */ - -/*! - * @name Low Level APIs To Set CORE LDO Regulator - * @{ - */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_CNTRL_REG) && FSL_FEATURE_MCX_SPC_HAS_CNTRL_REG) -/*! - * @brief Enable/Disable Core LDO regulator. - * - * @note The CORE LDO enable bit is write-once. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable CORE LDO Regulator. - * true - Enable CORE LDO Regulator. - * false - Disable CORE LDO Regulator. - */ -static inline void SPC_EnableCoreLDORegulator(SPC_Type *base, bool enable) -{ - if (enable) - { - base->CNTRL |= SPC_CNTRL_CORELDO_EN_MASK; - } - else - { - /* - * $Branch Coverage Justification$ - * If CORE_LDO is disabled, all RAMs data will powered off. - */ - base->CNTRL &= ~SPC_CNTRL_CORELDO_EN_MASK; - } -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_CNTRL_REG */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DPDOWN_PULLDOWN_DISABLE_BIT) && \ - FSL_FEATURE_MCX_SPC_HAS_DPDOWN_PULLDOWN_DISABLE_BIT) -/*! - * @brief Enable/Disable the CORE LDO Regulator pull down in Deep Power Down. - * - * @note This function only useful when enabled the CORE LDO Regulator. - * - * @param base SPC peripheral base address. - * @param pulldown Enable/Disable CORE LDO pulldown in Deep Power Down mode. - * true - CORE LDO Regulator will discharge in Deep Power Down mode. - * false - CORE LDO Regulator will not discharge in Deep Power Down mode. - */ -static inline void SPC_PullDownCoreLDORegulator(SPC_Type *base, bool pulldown) -{ - if (pulldown) - { - base->CORELDO_CFG &= ~SPC_CORELDO_CFG_DPDOWN_PULLDOWN_DISABLE_MASK; - } - else - { - base->CORELDO_CFG |= SPC_CORELDO_CFG_DPDOWN_PULLDOWN_DISABLE_MASK; - } -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_DPDOWN_PULLDOWN_DISABLE_BIT */ - -/*! - * @brief Configs Core LDO Regulator in Active mode. - * - * @note The bandgap must be enabled before invoking this function. - * @note To set Core LDO as low drive strength, all HVDs/LVDs must be disabled previously. - * - * @param base SPC peripheral base address. - * @param option Pointer to the spc_active_mode_core_ldo_option_t structure. - * - * @retval kStatus_Success Config Core LDO regulator in Active power mode successful. - * @retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * @retval kStatus_SPC_BandgapModeWrong Bandgap should be enabled before invoking this function. - * @retval kStatus_SPC_CORELDOLowDriveStrengthIgnore To set Core LDO as low drive strength, - * all LVDs/HVDs must be disabled before invoking this function. - */ -status_t SPC_SetActiveModeCoreLDORegulatorConfig(SPC_Type *base, const spc_active_mode_core_ldo_option_t *option); - -/*! - * @brief Set Core LDO Regulator Voltage level in Active mode. - * - * @param base SPC peripheral base address. - * @param voltageLevel Specify the voltage level of CORE LDO Regulator in Active mode, please - refer to @ref spc_core_ldo_voltage_level_t. - * - * @note In active mode, the Core LDO voltage level should only be changed when the - * Core LDO is in normal drive strength. - * - * @note Update Core LDO voltage level will set Busy flag, - * this function return only when busy flag is cleared by hardware - * - * @retval kStatus_SPC_CORELDOVoltageSetFail The drive strength of Core LDO is not normal. - * @retval kStatus_Success Set Core LDO regulator voltage level in Active power mode successful. - */ -status_t SPC_SetActiveModeCoreLDORegulatorVoltageLevel(SPC_Type *base, spc_core_ldo_voltage_level_t voltageLevel); - -/*! - * @brief Gets CORE LDO Regulator Voltage level. - * - * This function returns the voltage level of CORE LDO Regulator in Active mode. - * - * @param base SPC peripheral base address. - * @return Voltage level of CORE LDO in type of @ref spc_core_ldo_voltage_level_t enumeration. - */ -static inline spc_core_ldo_voltage_level_t SPC_GetActiveModeCoreLDOVDDVoltageLevel(SPC_Type *base) -{ - return (spc_core_ldo_voltage_level_t)(uint32_t)((base->ACTIVE_CFG & SPC_ACTIVE_CFG_CORELDO_VDD_LVL_MASK) >> - SPC_ACTIVE_CFG_CORELDO_VDD_LVL_SHIFT); -} - -#if (defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) -/*! - * @brief Set Core LDO VDD Regulator Drive Strength in Active mode. - * - * @param base SPC peripheral base address. - * @param driveStrength Specify the drive strength of CORE LDO Regulator in Active mode, please - refer to @ref spc_core_ldo_drive_strength_t. - * - * @retval #kStatus_Success Set Core LDO regulator drive strength in Active power mode successful. - * @retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore If any voltage detect enabled, - core_ldo's drive strength can not set to low. - * @retval #kStatus_SPC_BandgapModeWrong The selected bandgap mode is not allowed. - */ -status_t SPC_SetActiveModeCoreLDORegulatorDriveStrength(SPC_Type *base, spc_core_ldo_drive_strength_t driveStrength); - -/*! - * @brief Gets CORE LDO VDD Regulator Drive Strength in Active mode. - * - * @param base SPC peripheral base address. - * @return Drive Strength of CORE LDO regulator in Active mode, please refer to @ref spc_core_ldo_drive_strength_t. - */ -static inline spc_core_ldo_drive_strength_t SPC_GetActiveModeCoreLDODriveStrength(SPC_Type *base) -{ - return (spc_core_ldo_drive_strength_t)(uint32_t)((base->ACTIVE_CFG & SPC_ACTIVE_CFG_CORELDO_VDD_DS_MASK) >> - SPC_ACTIVE_CFG_CORELDO_VDD_DS_SHIFT); -} -#endif /* defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - -/*! - * @brief Configs CORE LDO Regulator in low power mode - * - * This function configs CORE LDO Regulator in Low Power mode. - * If CORE LDO VDD Drive Strength is set to Normal, the CORE LDO VDD regulator voltage - * level in Active mode must be equal to the voltage level in Low power mode. And the Bandgap - * must be programmed to select bandgap enabled. - * Core VDD voltage levels for the Core LDO low power regulator can only be changed when the CORE - * LDO Drive Strength set as Normal. - * - * @param base SPC peripheral base address. - * @param option Pointer to the spc_lowpower_mode_core_ldo_option_t structure. - * - * @retval #kStatus_Success Config Core LDO regulator in power mode successfully. - * @retval #kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * @retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore Set driver strength to low will be ignored. - * @retval #kStatus_SPC_CORELDOVoltageSetFail. Fail to change Core LDO voltage level. - */ -status_t SPC_SetLowPowerModeCoreLDORegulatorConfig(SPC_Type *base, const spc_lowpower_mode_core_ldo_option_t *option); - -/*! - * @brief Set Core LDO VDD Regulator Voltage level in Low power mode. - * - * @note If CORE LDO's drive strength is set to Normal, the CORE LDO VDD regulator voltage in active mode and low power - * mode must be same. - * @note Voltage level for the CORE LDO in low power mode can only be changed when the CORE LDO Drive Strength set as - * Normal. - * - * @param base SPC peripheral base address. - * @param voltageLevel Voltage level of CORE LDO Regulator in Low power mode, please - refer to @ref spc_core_ldo_voltage_level_t. - * - * @retval #kStatus_SPC_CORELDOVoltageWrong Voltage level in active mode and low power mode is not same. - * @retval #kStatus_Success Set Core LDO regulator voltage level in Low power mode successful. - * @retval #kStatus_SPC_CORELDOVoltageSetFail Fail to update voltage level because drive strength is incorrect. - */ -status_t SPC_SetLowPowerModeCoreLDORegulatorVoltageLevel(SPC_Type *base, spc_core_ldo_voltage_level_t voltageLevel); - -/*! - * @brief Gets the CORE LDO VDD Regulator Voltage Level for Low Power modes. - * - * @param base SPC peripheral base address. - * @return The CORE LDO VDD Regulator's voltage level. - */ -static inline spc_core_ldo_voltage_level_t SPC_GetLowPowerCoreLDOVDDVoltageLevel(SPC_Type *base) -{ - return ((spc_core_ldo_voltage_level_t)(uint32_t)((base->LP_CFG & SPC_LP_CFG_CORELDO_VDD_LVL_MASK) >> - SPC_LP_CFG_CORELDO_VDD_LVL_SHIFT)); -} - -/*! - * @brief Set Core LDO VDD Regulator Drive Strength in Low power mode. - * - * @param base SPC peripheral base address. - * @param driveStrength Specify drive strength of CORE LDO in low power mode. - * - * @retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore Some voltage detect enabled, CORE LDO's drive strength can not set - * as low. - * @retval #kStatus_Success Set Core LDO regulator drive strength in Low power mode successful. - * @retval #kStatus_SPC_BandgapModeWrong Bandgap is disabled when attempt to set CORE LDO work as normal drive strength. - */ -status_t SPC_SetLowPowerModeCoreLDORegulatorDriveStrength(SPC_Type *base, spc_core_ldo_drive_strength_t driveStrength); - -/*! - * @brief Gets CORE LDO VDD Drive Strength for Low Power modes. - * - * @param base SPC peripheral base address. - * @return The CORE LDO's VDD Drive Strength. - */ -static inline spc_core_ldo_drive_strength_t SPC_GetLowPowerCoreLDOVDDDriveStrength(SPC_Type *base) -{ - return (spc_core_ldo_drive_strength_t)(uint32_t)((base->LP_CFG & SPC_LP_CFG_CORELDO_VDD_DS_MASK) >> - SPC_LP_CFG_CORELDO_VDD_DS_SHIFT); -} - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) -/*! - * @name Low Level APIs To Set System LDO Regulator - * @{ - */ - -/*! - * @brief Enable/Disable System LDO regulator. - * - * @note The SYSTEM LDO enable bit is write-once. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable System LDO Regulator. - * true - Enable System LDO Regulator. - * false - Disable System LDO Regulator. - */ -static inline void SPC_EnableSystemLDORegulator(SPC_Type *base, bool enable) -{ - if (enable) - { - base->CNTRL |= SPC_CNTRL_SYSLDO_EN_MASK; - } - else - { - /* - * $Branch Coverage Justification$ - * If SYSTEM_LDO is disabled, may cause some unexpected issues. - */ - base->CNTRL &= ~SPC_CNTRL_SYSLDO_EN_MASK; - } -} - -/*! - * @brief Enable/Disable current sink feature of System LDO Regulator. - * - * @param base SPC peripheral base address. - * @param sink Enable/Disable current sink feature. - * true - Enable current sink feature of System LDO Regulator. - * false - Disable current sink feature of System LDO Regulator. - */ -static inline void SPC_EnableSystemLDOSinkFeature(SPC_Type *base, bool sink) -{ - if (sink) - { - base->SYSLDO_CFG |= SPC_SYSLDO_CFG_ISINKEN_MASK; - } - else - { - base->SYSLDO_CFG &= ~SPC_SYSLDO_CFG_ISINKEN_MASK; - } -} - -/*! - * @brief Configs System LDO VDD Regulator in Active mode. - * - * @note If System LDO VDD Drive Strength is set to Normal, the Bandgap mode in Active mode must be programmed - * to a value that enables the bandgap. - * @note If any voltage detects are kept enabled, configuration to set System LDO VDD drive strength to low will - * be ignored. - * @note If select System LDO VDD Regulator voltage level to Over Drive Voltage, the Drive Strength of System LDO VDD - * Regulator must be set to Normal otherwise the regulator Drive Strength will be forced to Normal. - * @note If select System LDO VDD Regulator voltage level to Over Drive Voltage, the High voltage detect must be - * disabled. Otherwise it will be fail to regulator to Over Drive Voltage. - * - * @param base SPC peripheral base address. - * @param option Pointer to the spc_active_mode_sys_ldo_option_t structure. - * - * @retval #kStatus_Success Config System LDO regulator in Active power mode successful. - * @retval #kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * @retval #kStatus_SPC_BandgapModeWrong The bandgap is not enabled before invoking this function. - * @retval #kStatus_SPC_SYSLDOOverDriveVoltageFail HVD of System VDD is not disable before setting to Over Drive - * voltage. - * @retval kStatus_SPC_SYSLDOLowDriveStrengthIgnore Set System LDO VDD regulator's driver strength to Low will be - * ignored. - */ -status_t SPC_SetActiveModeSystemLDORegulatorConfig(SPC_Type *base, const spc_active_mode_sys_ldo_option_t *option); - -/*! - * @brief Set System LDO Regulator voltage level in Active mode. - * - * @note The system LDO regulator can only operate at the overdrive voltage level for a limited amount of time for the - * life of chip. - * - * @param base SPC peripheral base address. - * @param voltageLevel Specify the voltage level of System LDO Regulator in Active mode. - * - * @retval #kStatus_Success Set System LDO Regulator voltage level in Active mode successfully. - * @retval #kStatus_SPC_SYSLDOOverDriveVoltageFail Must disable system LDO high voltage detector before specifing - * overdrive voltage. - */ -status_t SPC_SetActiveModeSystemLDORegulatorVoltageLevel(SPC_Type *base, spc_sys_ldo_voltage_level_t voltageLevel); - -/*! - * @brief Get System LDO Regulator voltage level in Active mode. - * - * @param base SPC peripheral base address. - * @return System LDO Regulator voltage level in Active mode, please refer to @ref spc_sys_ldo_voltage_level_t. - */ -static inline spc_sys_ldo_voltage_level_t SPC_GetActiveModeSystemLDORegulatorVoltageLevel(SPC_Type *base) -{ - return (spc_sys_ldo_voltage_level_t)(uint32_t)((base->ACTIVE_CFG & SPC_ACTIVE_CFG_SYSLDO_VDD_LVL_MASK) >> - SPC_ACTIVE_CFG_SYSLDO_VDD_LVL_SHIFT); -} - -/*! - * @brief Set System LDO Regulator Drive Strength in Active mode. - * - * @param base SPC peripheral base address. - * @param driveStrength Specify the drive strength of System LDO Regulator in Active mode. - * - * @retval #kStatus_Success Set System LDO Regulator drive strength in Active mode successfully. - * @retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Attempt to specify low drive strength is ignored due to any - voltage detect feature is enabled in active mode. - * @retval #kStatus_SPC_BandgapModeWrong Bandgap mode in Active mode must be programmed to a value that enables - the bandgap if attempt to specify normal drive strength. - */ -status_t SPC_SetActiveModeSystemLDORegulatorDriveStrength(SPC_Type *base, spc_sys_ldo_drive_strength_t driveStrength); - -/*! - * @brief Get System LDO Regulator Drive Strength in Active mode. - * - * @param base SPC peripheral base address. - * @return System LDO regulator drive strength in Active mode, please refer to @ref spc_sys_ldo_drive_strength_t. - */ -static inline spc_sys_ldo_drive_strength_t SPC_GetActiveModeSystemLDORegulatorDriveStrength(SPC_Type *base) -{ - return (spc_sys_ldo_drive_strength_t)(uint32_t)((base->ACTIVE_CFG & SPC_ACTIVE_CFG_SYSLDO_VDD_DS_MASK) >> - SPC_ACTIVE_CFG_SYSLDO_VDD_DS_SHIFT); -} - -/*! - * @brief Configs System LDO regulator in low power modes. - * - * This function configs System LDO regulator in low power modes. - * If System LDO VDD Regulator Drive strength is set to normal, bandgap mode in low power - * mode must be programmed to a value that enables the Bandgap. - * If any High voltage detectors or Low Voltage detectors are kept enabled, configuration - * to set System LDO Regulator drive strength as Low will be ignored. - * - * @param base SPC peripheral base address. - * @param option Pointer to spc_lowpower_mode_sys_ldo_option_t structure. - * - * @retval #kStatus_Success Config System LDO regulator in Low Power Mode successfully. - * @retval #kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * @retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Set driver strength to low will be ignored. - */ -status_t SPC_SetLowPowerModeSystemLDORegulatorConfig(SPC_Type *base, const spc_lowpower_mode_sys_ldo_option_t *option); - -/*! - * @brief Set System LDO Regulator drive strength in Low Power Mode. - * - * @param base SPC peripheral base address. - * @param driveStrength Specify the drive strength of System LDO Regulator in Low Power Mode. - * - * @retval #kStatus_Success Set System LDO Regulator drive strength in Low Power Mode successfully. - * @retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Attempt to specify low drive strength is ignored due to any - voltage detect feature is enabled in low power mode. - * @retval #kStatus_SPC_BandgapModeWrong Bandgap mode in low power mode must be programmed to a value that enables - the bandgap if attempt to specify normal drive strength. - */ -status_t SPC_SetLowPowerModeSystemLDORegulatorDriveStrength(SPC_Type *base, spc_sys_ldo_drive_strength_t driveStrength); - -/*! - * @brief Get System LDO Regulator drive strength in Low Power Mode. - * - * @param base SPC peripheral base address. - * @return System LDO regulator drive strength in Low Power Mode, please refer to @ref spc_sys_ldo_drive_strength_t. - */ -static inline spc_sys_ldo_drive_strength_t SPC_GetLowPowerModeSystemLDORegulatorDriveStrength(SPC_Type *base) -{ - return (spc_sys_ldo_drive_strength_t)(uint32_t)((base->LP_CFG & SPC_LP_CFG_SYSLDO_VDD_DS_MASK) >> - SPC_LP_CFG_SYSLDO_VDD_DS_SHIFT); -} -/*! @} */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) -/*! - * @name Low Level APIs To Set DCDC Regulator - * @{ - */ - -/*! - * @brief Enable/Disable DCDC Regulator. - * - * @note The DCDC enable bit is write-once, settings only reset after a POR, LVD, or HVD event. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable DCDC Regulator. - * true - Enable DCDC Regulator. - * false - Disable DCDC Regulator. - */ -static inline void SPC_EnableDCDCRegulator(SPC_Type *base, bool enable) -{ - if (enable) - { - base->CNTRL |= SPC_CNTRL_DCDC_EN_MASK; - } - else - { - /* - * $Branch Coverage Justification$ - * If DCDC is disabled, all RAMs data will powered off. - */ - base->CNTRL &= ~SPC_CNTRL_DCDC_EN_MASK; - } -} - -/*! - * @brief Config DCDC Burst options - * - * @param base SPC peripheral base address. - * @param config Pointer to spc_dcdc_burst_config_t structure. - */ -void SPC_SetDCDCBurstConfig(SPC_Type *base, spc_dcdc_burst_config_t *config); - -/*! - * @brief Trigger a software burst request to DCDC. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_TriggerDCDCBurstRequest(SPC_Type *base) -{ - /* Blocking until previous DCDC burst completed. */ - while ((base->DCDC_BURST_CFG & SPC_DCDC_BURST_CFG_BURST_ACK_MASK) == 0UL) - { - } - - base->DCDC_BURST_CFG |= SPC_DCDC_BURST_CFG_BURST_REQ_MASK; -} - -/*! - * @brief Check if burst acknowlege flag is asserted. - * - * @param base SPC peripheral base address. - * - * @retval false DCDC burst not complete. - * @retval true DCDC burst complete. - */ -static inline bool SPC_CheckDCDCBurstAck(SPC_Type *base) -{ - return ((base->DCDC_BURST_CFG & SPC_DCDC_BURST_CFG_BURST_ACK_MASK) != 0UL); -} - -/*! - * @brief Clear DCDC busrt acknowledge flag. - * - * @param base SPC periphral base address. - */ -static inline void SPC_ClearDCDCBurstAckFlag(SPC_Type *base) -{ - base->DCDC_BURST_CFG |= SPC_DCDC_BURST_CFG_BURST_ACK_MASK; -} - -/*! - * @brief Set the count value of the reference clock to configure the period of DCDC not active. - * - * @note This function is only useful when DCDC's drive strength is set as pulse refresh. - * @note The pulse duration(time between on and off) is: reference clock period * (count + 2). - * - * @param base SPC peripheral base address. - * @param count The count value, 16 bit width. - */ -void SPC_SetDCDCRefreshCount(SPC_Type *base, uint16_t count); - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC_CFG_BLEED_EN) && FSL_FEATURE_MCX_SPC_HAS_DCDC_CFG_BLEED_EN) -/*! - * @brief Enable a bleed resistor to discharge DCDC output when DCDC is disabled. - * - * @param base SPC peripheral base address. - * @param enable Used to enable/disable bleed resistor. - */ -static inline void SPC_EnableDCDCBleedResistor(SPC_Type *base, bool enable) -{ - if (enable) - { - base->DCDC_CFG |= SPC_DCDC_CFG_BLEED_EN_MASK; - } - else - { - base->DCDC_CFG &= ~SPC_DCDC_CFG_BLEED_EN_MASK; - } -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC_CFG_BLEED_EN */ - -/*! - * @brief Configs DCDC_CORE Regulator in Active mode. - * - * @note When changing the DCDC output voltage level, take care to change the CORE LDO voltage level. - * - * @param base SPC peripheral base address. - * @param option Pointer to the spc_active_mode_dcdc_option_t structure. - * - * @retval #kStatus_Success Config DCDC regulator in Active power mode successful. - * @retval #kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * @retval #kStatus_SPC_BandgapModeWrong Set DCDC_CORE Regulator drive strength to Normal, the Bandgap must be enabled. - */ -status_t SPC_SetActiveModeDCDCRegulatorConfig(SPC_Type *base, const spc_active_mode_dcdc_option_t *option); - -/*! - * @brief Set DCDC_CORE Regulator voltage level in Active mode. - * - * @note When changing the DCDC output voltage level, take care to change the CORE LDO voltage level. - * - * @param base SPC peripheral base address. - * @param voltageLevel Specify the DCDC_CORE Regulator voltage level, please refer to @ref spc_dcdc_voltage_level_t. - */ -static inline void SPC_SetActiveModeDCDCRegulatorVoltageLevel(SPC_Type *base, spc_dcdc_voltage_level_t voltageLevel) -{ - base->ACTIVE_CFG = - (base->ACTIVE_CFG & (~SPC_ACTIVE_CFG_DCDC_VDD_LVL_MASK)) | SPC_ACTIVE_CFG_DCDC_VDD_LVL(voltageLevel); -} - -/*! - * @brief Get DCDC_CORE Regulator voltage level in Active mode. - * - * @param base SPC peripheral base address. - * @return DCDC_CORE Regulator voltage level, please refer to @ref spc_dcdc_voltage_level_t. - */ -static inline spc_dcdc_voltage_level_t SPC_GetActiveModeDCDCRegulatorVoltageLevel(SPC_Type *base) -{ - return (spc_dcdc_voltage_level_t)((uint32_t)((base->ACTIVE_CFG & SPC_ACTIVE_CFG_DCDC_VDD_LVL_MASK) >> - SPC_ACTIVE_CFG_DCDC_VDD_LVL_SHIFT)); -} - -/*! - * @brief Set DCDC_CORE Regulator drive strength in Active mode. - * - * @note To set DCDC drive strength as Normal, the bandgap must be enabled. - * - * @param base SPC peripheral base address. - * @param driveStrength Specify the DCDC_CORE regulator drive strength, please refer to @ref spc_dcdc_drive_strength_t. - * - * @retval #kStatus_Success Set DCDC_CORE Regulator drive strength in Active mode successfully. - * @retval #kStatus_SPC_BandgapModeWrong Set DCDC_CORE Regulator drive strength to Normal, the Bandgap must be enabled. - */ -status_t SPC_SetActiveModeDCDCRegulatorDriveStrength(SPC_Type *base, spc_dcdc_drive_strength_t driveStrength); - -/*! - * @brief Get DCDC_CORE Regulator drive strength in Active mode. - * - * @param base SPC peripheral base address. - * @return DCDC_CORE Regulator drive strength, please refer to @ref spc_dcdc_drive_strength_t. - */ -static inline spc_dcdc_drive_strength_t SPC_GetActiveModeDCDCRegulatorDriveStrength(SPC_Type *base) -{ - return (spc_dcdc_drive_strength_t)((uint32_t)((base->ACTIVE_CFG & SPC_ACTIVE_CFG_DCDC_VDD_DS_MASK) >> - SPC_ACTIVE_CFG_DCDC_VDD_DS_SHIFT)); -} - -/*! - * @brief Configs DCDC_CORE Regulator in Low power modes. - * - * @note If DCDC_CORE Drive Strength is set to Normal, the Bandgap mode in Low Power mode must be programmed - * to a value that enables the Bandgap. - * @note In Deep Power Down mode, DCDC regulator is always turned off. - * - * @param base SPC peripheral base address. - * @param option Pointer to the spc_lowpower_mode_dcdc_option_t structure. - * - * @retval #kStatus_Success Config DCDC regulator in low power mode successfully. - * @retval #kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * @retval #kStatus_SPC_BandgapModeWrong The bandgap mode setting in Low Power mode is wrong. - */ -status_t SPC_SetLowPowerModeDCDCRegulatorConfig(SPC_Type *base, const spc_lowpower_mode_dcdc_option_t *option); - -/*! - * @brief Set DCDC_CORE Regulator drive strength in Low power mode. - * - * @note To set drive strength as normal, the bandgap must be enabled. - * - * @param base SPC peripheral base address. - * @param driveStrength Specify the DCDC_CORE Regulator drive strength, please refer to @ref spc_dcdc_drive_strength_t. - * - * @retval #kStatus_Success Set DCDC_CORE Regulator drive strength in Low power mode successfully. - * @retval #kStatus_SPC_BandgapModeWrong Set DCDC_CORE Regulator drive strength to Normal, the Bandgap must be enabled. - */ -status_t SPC_SetLowPowerModeDCDCRegulatorDriveStrength(SPC_Type *base, spc_dcdc_drive_strength_t driveStrength); - -/*! - * @brief Get DCDC_CORE Regulator drive strength in Low power mode. - * - * @param base SPC peripheral base address. - * @return DCDC_CORE Regulator drive strength, please refer to @ref spc_dcdc_drive_strength_t. - */ -static inline spc_dcdc_drive_strength_t SPC_GetLowPowerModeDCDCRegulatorDriveStrength(SPC_Type *base) -{ - return (spc_dcdc_drive_strength_t)((uint32_t)((base->LP_CFG & SPC_LP_CFG_DCDC_VDD_DS_MASK) >> - SPC_LP_CFG_DCDC_VDD_DS_SHIFT)); -} - -/*! - * @brief Set DCDC_CORE Regulator voltage level in Low power mode. - * - * @note To change DCDC level in Low-Power mode: - * 1. Configure LP_CFG[DCDC_VDD_LVL] to desired level; - * 2. Configure LP_CFG[DCDC_VDD_DS] to low driver strength; - * 3. Configure ACTIVE_CFG[DCDC_VDD_LVL] to same level programmed in #1. - * - * @note After invoking this function, the voltage level in active mode(wakeup from low power modes) also changed, - * if it is necessary, please invoke SPC_SetActiveModeDCDCRegulatorVoltageLevel() to change to desried voltage level. - * - * @param base SPC peripheral base address. - * @param voltageLevel Specify the DCDC_CORE Regulator voltage level, please refer to @ref spc_dcdc_voltage_level_t. - */ -static inline void SPC_SetLowPowerModeDCDCRegulatorVoltageLevel(SPC_Type *base, spc_dcdc_voltage_level_t voltageLevel) -{ - base->LP_CFG = (base->LP_CFG & (~SPC_LP_CFG_DCDC_VDD_LVL_MASK)) | SPC_LP_CFG_DCDC_VDD_LVL(voltageLevel); - (void)SPC_SetLowPowerModeDCDCRegulatorDriveStrength(base, kSPC_DCDC_LowDriveStrength); - SPC_SetActiveModeDCDCRegulatorVoltageLevel(base, voltageLevel); -} - -/*! - * @brief Get DCDC_CORE Regulator voltage level in Low power mode. - * - * @param base SPC peripheral base address. - * @return DCDC_CORE Regulator voltage level, please refer to @ref spc_dcdc_voltage_level_t. - */ -static inline spc_dcdc_voltage_level_t SPC_GetLowPowerModeDCDCRegulatorVoltageLevel(SPC_Type *base) -{ - return (spc_dcdc_voltage_level_t)((uint32_t)((base->LP_CFG & SPC_LP_CFG_DCDC_VDD_LVL_MASK) >> - SPC_LP_CFG_DCDC_VDD_LVL_SHIFT)); -} - -/*! @} */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @} */ - -#endif /* FSL_SPC_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_trdc.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_trdc.c deleted file mode 100644 index b94abe1afbc..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_trdc.c +++ /dev/null @@ -1,854 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_trdc.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.trdc1" -#endif - -/* The memory increment definition in byte of MBC and MRC configuration registers */ -#define TRDC_MRC_DOMAIN_INCREMENT 0x100UL -#define TRDC_MBC_DOMAIN_INCREMENT 0x200UL -/* In latest TRDC register definition this macro has been removed from device header file. Add this for backward - * compatability. */ -#ifndef TRDC_MBC_NSE_BLK_CLR_ALL_DID_SEL -#define TRDC_MBC_NSE_BLK_CLR_ALL_DID_SEL(x) ((uint32_t)(((uint32_t)(x)) << TRDC_MBC_NSE_BLK_CLR_ALL_DID_SEL0_SHIFT)) -#endif -/* Get the memory increment in for each slave inside MBC */ -#define TRDC_MBC_SLAVE_INCREMENT(x) \ - (((x) == 0U) ? (0U) : (((x) == 1U) ? (0x140UL) : (((x) == 2U) ? (0x168UL) : (0x190UL)))) - -typedef union -{ -#if defined(FSL_FEATURE_TRDC_HAS_DOMAIN_ASSIGNMENT) && FSL_FEATURE_TRDC_HAS_DOMAIN_ASSIGNMENT - trdc_processor_domain_assignment_t _processor_domain_assignment; - trdc_non_processor_domain_assignment_t _non_processor_domain_assignment; - trdc_pid_config_t _pid_config; -#endif -#if defined(FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG) && FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG - trdc_idau_config_t _idau_config; -#endif -#if (defined(FSL_FEATURE_TRDC_HAS_MBC) && FSL_FEATURE_TRDC_HAS_MBC) || \ - (defined(FSL_FEATURE_TRDC_HAS_MRC) && FSL_FEATURE_TRDC_HAS_MRC) - trdc_memory_access_control_config_t _memory_access_control; -#endif -#if defined(FSL_FEATURE_TRDC_HAS_MBC) && FSL_FEATURE_TRDC_HAS_MBC - trdc_mbc_memory_block_config_t _mbc_memory_blk; - trdc_mbc_nse_update_config_t _mbc_nse_update; -#endif - uint32_t _u32; -} trdc_reg32_convert_t; - -/******************************************************************************* - * Variables - ******************************************************************************/ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/******************************************************************************* - * Code - ******************************************************************************/ -#if defined(FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG) && FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG -/*! - * brief Gets the TRDC hardware configuration. - * - * This function gets the TRDC hardware configurations, including number of bus - * masters, number of domains, number of MRCs and number of PACs. - * - * param base TRDC peripheral base address. - * param config Pointer to the structure to get the configuration. - */ -void TRDC_GetHardwareConfig(TRDC_Type *base, trdc_hardware_config_t *config) -{ - assert(NULL != config); - - config->masterNumber = - (uint8_t)((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NMSTR_MASK) >> TRDC_TRDC_HWCFG0_NMSTR_SHIFT); - config->domainNumber = - (uint8_t)((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NDID_MASK) >> TRDC_TRDC_HWCFG0_NDID_SHIFT); - config->mbcNumber = - (uint8_t)((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NMBC_MASK) >> TRDC_TRDC_HWCFG0_NMBC_SHIFT); - config->mrcNumber = - (uint8_t)((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NMRC_MASK) >> TRDC_TRDC_HWCFG0_NMRC_SHIFT); -} -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_MBC) && FSL_FEATURE_TRDC_HAS_MBC -/*! - * brief Gets the hardware configuration of the one of two slave memories within each MBC(memory block checker). - * - * param base TRDC peripheral base address. - * param config Pointer to the structure to get the configuration. - * param mbcIdx MBC number. - * param slvIdx Slave number. - */ -void TRDC_GetMbcHardwareConfig(TRDC_Type *base, - trdc_slave_memory_hardware_config_t *config, - uint8_t mbcIdx, - uint8_t slvIdx) -{ - assert(NULL != config); -#if defined(TRDC_MBC_COUNT) && TRDC_MBC_COUNT - assert(mbcIdx < (uint8_t)TRDC_MBC_COUNT); -#else - assert(mbcIdx < (uint8_t)((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NMBC_MASK) >> - TRDC_TRDC_HWCFG0_NMBC_SHIFT)); -#endif - assert(slvIdx < 4U); - - config->blockNum = TRDC_MBC_BASE(base, mbcIdx)->MBC_MEM_GLBCFG[slvIdx] & TRDC_MBC_MEM_GLBCFG_NBLKS_MASK; - config->blockSize = (TRDC_MBC_BASE(base, mbcIdx)->MBC_MEM_GLBCFG[slvIdx] & TRDC_MBC_MEM_GLBCFG_SIZE_LOG2_MASK) >> - TRDC_MBC_MEM_GLBCFG_SIZE_LOG2_SHIFT; -} -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_DOMAIN_ASSIGNMENT) && FSL_FEATURE_TRDC_HAS_DOMAIN_ASSIGNMENT -/*! - * brief Gets the default master domain assignment for the processor bus master. - * - * This function gets the default master domain assignment for the processor bus master. - * It should only be used for the processor bus masters, such as CORE0. This function - * sets the assignment as follows: - * - * code - * assignment->domainId = 0U; - * assignment->domainIdSelect = kTRDC_DidMda; - * assignment->lock = 0U; - * endcode - * - * param domainAssignment Pointer to the assignment structure. - */ -void TRDC_GetDefaultProcessorDomainAssignment(trdc_processor_domain_assignment_t *domainAssignment) -{ - assert(NULL != domainAssignment); - - /* Initializes the configure structure to zero. */ - (void)memset(domainAssignment, 0, sizeof(*domainAssignment)); -} - -/*! - * brief Gets the default master domain assignment for non-processor bus master. - * - * This function gets the default master domain assignment for non-processor bus master. - * It should only be used for the non-processor bus masters, such as DMA. This function - * sets the assignment as follows: - * - * code - * assignment->domainId = 0U; - * assignment->privilegeAttr = kTRDC_ForceUser; - * assignment->secureAttr = kTRDC_ForceSecure; - * assignment->bypassDomainId = 0U; - * assignment->lock = 0U; - * endcode - * - * param domainAssignment Pointer to the assignment structure. - */ -void TRDC_GetDefaultNonProcessorDomainAssignment(trdc_non_processor_domain_assignment_t *domainAssignment) -{ - assert(NULL != domainAssignment); - - /* Initializes the configure structure to zero. */ - (void)memset(domainAssignment, 0, sizeof(*domainAssignment)); -} - -/*! - * brief Sets the processor bus master domain assignment. - * - * This function sets the processor master domain assignment as valid. - * One bus master might have multiple domain assignment registers. The parameter - * \p assignIndex specifies which assignment register to set. - * - * Example: Set domain assignment for core 0. - * - * code - * trdc_processor_domain_assignment_t processorAssignment; - * - * TRDC_GetDefaultProcessorDomainAssignment(&processorAssignment); - * - * processorAssignment.domainId = 0; - * processorAssignment.xxx = xxx; - * TRDC_SetMasterDomainAssignment(TRDC, 1, &processorAssignment); - * endcode - * - * param base TRDC peripheral base address. - * param master Which master to configure, refer to trdcx_master_t in processor header file, x is trdc instance. - * param regNum Which register to configure, processor master can have more than one register for the MDAC - * configuration. param domainAssignment Pointer to the assignment structure. - */ -void TRDC_SetProcessorDomainAssignment(TRDC_Type *base, - uint8_t master, - uint8_t regNum, - const trdc_processor_domain_assignment_t *domainAssignment) -{ - /* Make sure the master number does not exceed the max master count. */ - assert(master < - ((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NMSTR_MASK) >> TRDC_TRDC_HWCFG0_NMSTR_SHIFT)); - /* Make sure the master is a processor master. */ - assert(0U == (TRDC_GENERAL_BASE(base)->DACFG[master] & TRDC_DACFG_NCM_MASK)); - assert(NULL != domainAssignment); - assert(domainAssignment->domainId < - ((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NDID_MASK) >> TRDC_TRDC_HWCFG0_NDID_SHIFT)); - - trdc_reg32_convert_t pid; - pid._processor_domain_assignment = *domainAssignment; - TRDC_DOMAIN_ASSIGNMENT_BASE(base)->MDA_DFMT0[master].MDA_W_DFMT0[regNum] = pid._u32 | TRDC_MDA_W_DFMT0_VLD_MASK; -} - -/*! - * brief Sets the non-processor bus master domain assignment. - * - * This function sets the non-processor master domain assignment as valid. - * One bus master might have multiple domain assignment registers. The parameter - * \p assignIndex specifies which assignment register to set. - * - * Example: Set domain assignment for DMA0. - * code - * trdc_non_processor_domain_assignment_t nonProcessorAssignment; - * - * TRDC_GetDefaultNonProcessorDomainAssignment(&nonProcessorAssignment); - * nonProcessorAssignment.domainId = 1; - * nonProcessorAssignment.xxx = xxx; - * - * TRDC_SetMasterDomainAssignment(TRDC, kTrdcMasterDma0, 0U, &nonProcessorAssignment); - * endcode - * - * param base TRDC peripheral base address. - * param master Which master to configure, refer to trdc_master_t in processor header file. - * param domainAssignment Pointer to the assignment structure. - */ -void TRDC_SetNonProcessorDomainAssignment(TRDC_Type *base, - uint8_t master, - const trdc_non_processor_domain_assignment_t *domainAssignment) -{ - /* The master number should be less than the master count. */ - assert(master < - ((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NMSTR_MASK) >> TRDC_TRDC_HWCFG0_NMSTR_SHIFT)); - /* Make sure the master is a non-CPU/non-processor master */ - assert(0U != (TRDC_GENERAL_BASE(base)->DACFG[master] & TRDC_DACFG_NCM_MASK)); - assert(NULL != domainAssignment); - assert(domainAssignment->domainId < - ((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NDID_MASK) >> TRDC_TRDC_HWCFG0_NDID_SHIFT)); - - trdc_reg32_convert_t pid; - pid._non_processor_domain_assignment = *domainAssignment; - - TRDC_DOMAIN_ASSIGNMENT_BASE(base)->MDA_DFMT1[master].MDA_W_DFMT1[0] = pid._u32 | TRDC_MDA_W_DFMT1_VLD_MASK; -} - -/*! - * brief Sets the current Process identifier(PID) for processor core. - * - * Each processor has a corresponding process identifier (PID) which can be used to group tasks into different domains. - * Secure privileged software saves and restores the PID as part of any context switch. - * This data structure defines an array of 32-bit values, one per MDA module, that define the PID. Since this register - * resource is only applicable to processor cores, the data structure is typically sparsely populated. The HWCFG[2-3] - * registers provide a bitmap of the implemented PIDn registers. This data structure is indexed using the corresponding - * MDA instance number. Depending on the operating clock domain of each DAC instance, there may be optional information - * stored in the corresponding PIDm register to properly implement the LK2 = 2 functionality. - * - * param base TRDC peripheral base address. - * param master Which processor master to configure, refer to trdc_master_t in processor header file. - * param pidConfig Pointer to the configuration structure. - */ -void TRDC_SetPid(TRDC_Type *base, uint8_t master, const trdc_pid_config_t *pidConfig) -{ - assert(pidConfig != NULL); - /* The master number should be less than the master count. */ - assert(master < - ((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NMSTR_MASK) >> TRDC_TRDC_HWCFG0_NMSTR_SHIFT)); - /* This master has to be a processor master. */ - assert((TRDC_GENERAL_BASE(base)->DACFG[master] & TRDC_DACFG_NCM_MASK) == 0U); - - trdc_reg32_convert_t pid; - pid._pid_config = *pidConfig; - TRDC_DOMAIN_ASSIGNMENT_BASE(base)->PID[master] = pid._u32; -} -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG) && FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG -/*! - * brief Gets the default IDAU(Implementation-Defined Attribution Unit) configuration. - * - * code - * config->lockSecureVTOR = false; - * config->lockNonsecureVTOR = false; - * config->lockSecureMPU = false; - * config->lockNonsecureMPU = false; - * config->lockSAU = false; - * endcode - * - * param domainAssignment Pointer to the configuration structure. - */ -void TRDC_GetDefaultIDAUConfig(trdc_idau_config_t *idauConfiguration) -{ - assert(NULL != idauConfiguration); - - /* Initializes the configure structure to zero. */ - (void)memset(idauConfiguration, 0, sizeof(*idauConfiguration)); -} - -/*! - * brief Sets the IDAU(Implementation-Defined Attribution Unit) control configuration. - * - * Example: Lock the secure and non-secure MPU registers. - * - * code - * trdc_idau_config_t idauConfiguration; - * - * TRDC_GetDefaultIDAUConfig(&idauConfiguration); - * - * idauConfiguration.lockSecureMPU = true; - * idauConfiguration.lockNonsecureMPU = true; - * TRDC_SetIDAU(TRDC, &idauConfiguration); - * endcode - * - * param base TRDC peripheral base address. - * param domainAssignment Pointer to the configuration structure. - */ -void TRDC_SetIDAU(TRDC_Type *base, const trdc_idau_config_t *idauConfiguration) -{ - assert(NULL != idauConfiguration); - - trdc_reg32_convert_t pid; - pid._idau_config = *idauConfiguration; - - TRDC_GENERAL_BASE(base)->TRDC_IDAU_CR = pid._u32 | TRDC_TRDC_IDAU_CR_VLD_MASK; -} -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_FLW) && FSL_FEATURE_TRDC_HAS_FLW -/*! - * brief Gets the default FLW(Flsh Logical Window) configuration. - * - * code - * config->blockCount = false; - * config->arrayBaseAddr = false; - * config->lock = false; - * config->enable = false; - * endcode - * - * param flwConfiguration Pointer to the configuration structure. - */ -void TRDC_GetDefaultFlashLogicalWindowConfig(trdc_flw_config_t *flwConfiguration) -{ - assert(NULL != flwConfiguration); - - /* Initializes the configure structure to zero. */ - (void)memset(flwConfiguration, 0, sizeof(*flwConfiguration)); - - flwConfiguration->enable = 0x1UL; -} - -/*! - * brief Sets the FLW function's configuration. - * - * code - * trdc_flw_config_t flwConfiguration; - * - * TRDC_GetDefaultIDAUConfig(&flwConfiguration); - * - * flwConfiguration.blockCount = 32U; - * flwConfiguration.arrayBaseAddr = 0xXXXXXXXX; - * TRDC_SetIDAU(TRDC, &flwConfiguration); - * endcode - * - * param base TRDC peripheral base address. - * param flwConfiguration Pointer to the configuration structure. - */ -void TRDC_SetFlashLogicalWindow(TRDC_Type *base, const trdc_flw_config_t *flwConfiguration) -{ - assert(NULL != flwConfiguration); - - TRDC_FLW_BASE(base)->TRDC_FLW_ABASE = flwConfiguration->arrayBaseAddr; - TRDC_FLW_BASE(base)->TRDC_FLW_BCNT = flwConfiguration->blockCount; - TRDC_FLW_BASE(base)->TRDC_FLW_CTL = - TRDC_TRDC_FLW_CTL_V(flwConfiguration->enable) | TRDC_TRDC_FLW_CTL_LK(flwConfiguration->lock); -} -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_DOMAIN_ERROR) && FSL_FEATURE_TRDC_HAS_DOMAIN_ERROR -#if (((__CORTEX_M == 0U) && (defined(__ICCARM__))) || (defined(__XTENSA__))) -/*! - * @brief Count the leading zeros. - * - * Count the leading zeros of an 32-bit data. This function is only defined - * for CM0 and CM0+ for IAR, because other cortex series have the clz instruction, - * KEIL and ARMGCC have toolchain build in function for this purpose. - * - * @param data The data to process. - * @return Count of the leading zeros. - */ -static uint8_t TRDC_CountLeadingZeros(uint32_t data) -{ - uint8_t count = 0U; - uint32_t mask = 0x80000000U; - - while ((data & mask) == 0U) - { - count++; - mask >>= 1U; - } - - return count; -} -#endif -#endif - -/*! - * brief Initializes the TRDC module. - * - * This function enables the TRDC clock. - * - * param base TRDC peripheral base address. - */ -void TRDC_Init(TRDC_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief De-initializes the TRDC module. - * - * This function disables the TRDC clock. - * - * param base TRDC peripheral base address. - */ -void TRDC_Deinit(TRDC_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -#if defined(FSL_FEATURE_TRDC_HAS_DOMAIN_ERROR) && FSL_FEATURE_TRDC_HAS_DOMAIN_ERROR -/*! - * brief Gets and clears the first domain error of the current domain. - * - * This function gets the first access violation information for the current domain - * and clears the pending flag. There might be multiple access violations pending - * for the current domain. This function only processes the first error. - * - * param base TRDC peripheral base address. - * param error Pointer to the error information. - * return If the access violation is captured, this function returns the kStatus_Success. - * The error information can be obtained from the parameter error. If no - * access violation is captured, this function returns the kStatus_NoData. - */ -status_t TRDC_GetAndClearFirstDomainError(TRDC_Type *base, trdc_domain_error_t *error) -{ - return TRDC_GetAndClearFirstSpecificDomainError(base, error, TRDC_GetCurrentMasterDomainId(base)); -} - -/*! - * brief Gets and clears the first domain error of the specific domain. - * - * This function gets the first access violation information for the specific domain - * and clears the pending flag. There might be multiple access violations pending - * for the current domain. This function only processes the first error. - * - * param base TRDC peripheral base address. - * param error Pointer to the error information. - * param domainId The error of which domain to get and clear. - * return If the access violation is captured, this function returns the kStatus_Success. - * The error information can be obtained from the parameter error. If no - * access violation is captured, this function returns the kStatus_NoData. - */ -status_t TRDC_GetAndClearFirstSpecificDomainError(TRDC_Type *base, trdc_domain_error_t *error, uint8_t domainId) -{ - assert(NULL != error); - - status_t status; - uint8_t errorIndex; /* The index of first domain error. */ - uint32_t errorBitMap; /* Domain error location bit map. */ - uint32_t regW1; /* To save TRDC_DERR_W1. */ - - /* Get the error bitmap. */ - errorBitMap = TRDC_DOMAIN_ERROR_BASE(base)->TRDC_DERRLOC[domainId]; - - if (0U == errorBitMap) /* No error captured. */ - { - status = kStatus_NoData; - } - else - { - /* Get the first error controller index. */ -#if (((__CORTEX_M == 0U) && (defined(__ICCARM__))) || (defined(__XTENSA__))) - errorIndex = 31U - TRDC_CountLeadingZeros(errorBitMap); -#else - errorIndex = 31U - __CLZ(errorBitMap); -#endif - - /* Must write TRDC_FDID[TRDC_FDID] with the domain ID before reading the Domain Error registers. */ - TRDC_DOMAIN_ERROR_BASE(base)->TRDC_FDID = TRDC_TRDC_FDID_FDID(domainId); - - /* Initializes the error structure to zero. */ - (void)memset(error, 0, sizeof(*error)); - - if (errorIndex > 15U) - { - /* Error in Memory Region Checker (MRC) */ - errorIndex -= 12U; - error->controller = (trdc_controller_t)errorIndex; - errorIndex -= 4U; - - /* Get the error information. */ - regW1 = TRDC_DOMAIN_ERROR_BASE(base)->MRC_DERR[errorIndex].W1; - error->address = TRDC_DOMAIN_ERROR_BASE(base)->MRC_DERR[errorIndex].W0; - /* Clear error pending. */ - TRDC_DOMAIN_ERROR_BASE(base)->MRC_DERR[errorIndex].W3 = TRDC_W3_RECR(0x01U); - } - else - { - /* Error in Memory Block Controller (MBC) */ - error->slaveMemoryIdx = errorIndex % 4U; - errorIndex /= 4U; - error->controller = (trdc_controller_t)errorIndex; - - /* Check if the MBC error index exceeds the module's max MBC index to avoid overrun access. */ - if (errorIndex >= - ((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NMBC_MASK) >> TRDC_TRDC_HWCFG0_NMBC_SHIFT)) - { - return kStatus_Fail; - } - - error->controller = (trdc_controller_t)errorIndex; - - /* Get the error information. */ - regW1 = TRDC_DOMAIN_ERROR_BASE(base)->MBC_DERR[errorIndex].W1; - error->address = TRDC_DOMAIN_ERROR_BASE(base)->MBC_DERR[errorIndex].W0; - /* Clear error pending. */ - TRDC_DOMAIN_ERROR_BASE(base)->MBC_DERR[errorIndex].W3 = TRDC_W3_RECR(0x01U); - } - - uint8_t tempVal = 0U; - error->domainId = (uint8_t)((regW1 & TRDC_W1_EDID_MASK) >> TRDC_W1_EDID_MASK); - tempVal = (uint8_t)((regW1 & TRDC_W1_EATR_MASK) >> TRDC_W1_EATR_SHIFT); - error->errorAttr = (trdc_error_attr_t)tempVal; - tempVal = (uint8_t)((regW1 & TRDC_W1_ERW_MASK) >> TRDC_W1_ERW_SHIFT); - error->errorType = (trdc_error_type_t)tempVal; - error->errorPort = (uint8_t)((regW1 & TRDC_W1_EPORT_MASK) >> TRDC_W1_EPORT_SHIFT); - tempVal = (uint8_t)((regW1 & TRDC_W1_EST_MASK) >> TRDC_W1_EST_SHIFT); - error->errorState = (trdc_error_state_t)tempVal; - - status = kStatus_Success; - } - - return status; -} -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_MRC) && FSL_FEATURE_TRDC_HAS_MRC -/*! - * brief Sets the memory access configuration for one of the access control register of one MRC. - * - * Example: Enable the secure operations and lock the configuration for MRC0 region 1. - * - * code - * trdc_memory_access_control_config_t config; - * - * config.securePrivX = true; - * config.securePrivW = true; - * config.securePrivR = true; - * config.lock = true; - * TRDC_SetMrcMemoryAccess(TRDC, &config, 0, 1); - * endcode - * - * param base TRDC peripheral base address. - * param config Pointer to the configuration structure. - * param mrcIdx MRC index. - * param regIdx Register number. - */ -void TRDC_MrcSetMemoryAccessConfig(TRDC_Type *base, - const trdc_memory_access_control_config_t *config, - uint8_t mrcIdx, - uint8_t regIdx) -{ - assert(NULL != base); - assert(NULL != config); - - trdc_reg32_convert_t pid; - - pid._memory_access_control = *config; - TRDC_MRC_BASE(base, mrcIdx)->MRC_GLBAC[regIdx] = pid._u32; -} - -/*! - * brief Enables the update of the selected domians. - * - * After the domians' update are enabled, their regions' NSE bits can be set or clear. - * - * param base TRDC peripheral base address. - * param mrcIdx MRC index. - * param domianMask Bit mask of the domains to be enabled. - * param enable True to enable, false to disable. - */ -void TRDC_MrcEnableDomainNseUpdate(TRDC_Type *base, uint8_t mrcIdx, uint16_t domianMask, bool enable) -{ - assert(NULL != base); - - if (enable) - { - TRDC_MRC_BASE(base, mrcIdx)->MRC_NSE_RGN_INDIRECT |= ((uint32_t)domianMask << 16U); - } - else - { - TRDC_MRC_BASE(base, mrcIdx)->MRC_NSE_RGN_INDIRECT &= ~((uint32_t)domianMask << 16U); - } -} - -/*! - * brief Sets the NSE bits of the selected regions for domains. - * - * This function sets the NSE bits for the selected regions for the domains whose update are enabled. - * - * param base TRDC peripheral base address. - * param mrcIdx MRC index. - * param regionMask Bit mask of the regions whose NSE bits to set. - */ -void TRDC_MrcRegionNseSet(TRDC_Type *base, uint8_t mrcIdx, uint16_t regionMask) -{ - assert(NULL != base); - - TRDC_MRC_BASE(base, mrcIdx)->MRC_NSE_RGN_SET = ((uint32_t)regionMask); -} - -/*! - * brief Clears the NSE bits of the selected regions for domains. - * - * This function clears the NSE bits for the selected regions for the domains whose update are enabled. - * - * param base TRDC peripheral base address. - * param mrcIdx MRC index. - * param regionMask Bit mask of the regions whose NSE bits to clear. - */ -void TRDC_MrcRegionNseClear(TRDC_Type *base, uint8_t mrcIdx, uint16_t regionMask) -{ - assert(NULL != base); - - TRDC_MRC_BASE(base, mrcIdx)->MRC_NSE_RGN_CLR = ((uint32_t)regionMask); -} - -/*! - * brief Clears the NSE bits for all the regions of the selected domains. - * - * This function clears the NSE bits for all regions of selected domains whose update are enabled. - * - * param base TRDC peripheral base address. - * param mrcIdx MRC index. - * param domainMask Bit mask of the domians whose NSE bits to clear. - */ -void TRDC_MrcDomainNseClear(TRDC_Type *base, uint8_t mrcIdx, uint16_t domainMask) -{ - assert(NULL != base); - - uint8_t domainCount = - (uint8_t)((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NDID_MASK) >> TRDC_TRDC_HWCFG0_NDID_SHIFT); - uint8_t maxDomainId = 0U; - uint16_t tmpDomainMask = domainMask; - - while (tmpDomainMask != 0U) - { - tmpDomainMask >>= 1U; - maxDomainId++; - } - - /* Check whether the domain mask contains invalid domain. */ - if (maxDomainId > domainCount) - { - assert(false); - } - - TRDC_MRC_BASE(base, mrcIdx)->MRC_NSE_RGN_CLR_ALL = ((uint32_t)domainMask << 16U); -} - -/*! - * brief Sets the configuration for one of the region descriptor per domain per MRC instnce. - * - * This function sets the configuration for one of the region descriptor, including the start - * and end address of the region, memory access control policy and valid. - * - * param base TRDC peripheral base address. - * param config Pointer to region descriptor configuration structure. - */ -void TRDC_MrcSetRegionDescriptorConfig(TRDC_Type *base, const trdc_mrc_region_descriptor_config_t *config) -{ - assert(NULL != base); - - uint32_t regAddr = (uint32_t) & (TRDC_MRC_BASE(base, config->mrcIdx)->MRC_DOM0_RGD_W[config->regionIdx][0]); - - regAddr += TRDC_MRC_DOMAIN_INCREMENT * config->domainIdx; - - /* Set configuration for word 0 */ - uint32_t data = TRDC_MRC_DOM0_RGD_W_MRACSEL(config->memoryAccessControlSelect) | - ((config->startAddr) & ~(TRDC_MRC_DOM0_RGD_W_MRACSEL_MASK)); - *(uint32_t *)regAddr = data; - - /* Set configuration for word 1 */ - regAddr += 4U; - data = TRDC_MRC_DOM0_RGD_W_VLD(config->valid) | TRDC_MRC_DOM0_RGD_W_NSE(config->nseEnable) | - ((config->endAddr) & ~(TRDC_MRC_DOM0_RGD_W_VLD_MASK | TRDC_MRC_DOM0_RGD_W_NSE_MASK)); - *(uint32_t *)regAddr = data; -} -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_MBC) && FSL_FEATURE_TRDC_HAS_MBC -/*! - * brief Sets the NSR update configuration for one of the MBC instance. - * - * After set the NSE configuration, the configured memory area can be updateby NSE set/clear. - * - * param base TRDC peripheral base address. - * param config Pointer to NSE update configuration structure. - * param mbcIdx MBC index. - */ -void TRDC_MbcSetNseUpdateConfig(TRDC_Type *base, const trdc_mbc_nse_update_config_t *config, uint8_t mbcIdx) -{ - assert(base != NULL); - - trdc_reg32_convert_t pid; - - pid._mbc_nse_update = *config; - TRDC_MBC_BASE(base, mbcIdx)->MBC_NSE_BLK_INDEX = pid._u32; -} - -/*! - * brief Sets the NSE bits of the selected configuration words according to NSE update configuration. - * - * This function sets the NSE bits of the word for the configured regio, memory. - * - * param base TRDC peripheral base address. - * param mbcIdx MBC index. - * param bitMask Mask of the bits whose NSE bits to set. - */ -void TRDC_MbcWordNseSet(TRDC_Type *base, uint8_t mbcIdx, uint32_t bitMask) -{ - assert(NULL != base); - - TRDC_MBC_BASE(base, mbcIdx)->MBC_NSE_BLK_SET = ((uint32_t)bitMask); -} - -/*! - * brief Clears the NSE bits of the selected configuration words according to NSE update configuration. - * - * This function sets the NSE bits of the word for the configured regio, memory. - * - * param base TRDC peripheral base address. - * param mbcIdx MBC index. - * param bitMask Mask of the bits whose NSE bits to clear. - */ -void TRDC_MbcWordNseClear(TRDC_Type *base, uint8_t mbcIdx, uint32_t bitMask) -{ - assert(NULL != base); - - TRDC_MBC_BASE(base, mbcIdx)->MBC_NSE_BLK_CLR = ((uint32_t)bitMask); -} - -/*! - * brief Clears all configuration words' NSE bits of the selected domain and memory. - * - * param base TRDC peripheral base address. - * param mbcIdx MBC index. - * param domainMask Mask of the domains whose NSE bits to clear, 0b110 means clear domain 1&2. - * param slaveMask Mask of the slaves whose NSE bits to clear, 0x11 means clear all slave 0&1's NSE bits. - */ -void TRDC_MbcNseClearAll(TRDC_Type *base, uint8_t mbcIdx, uint16_t domainMask, uint8_t slave) -{ - assert(NULL != base); - -#if defined(FSL_FEATURE_TRDC_DOMAIN_COUNT) && FSL_FEATURE_TRDC_DOMAIN_COUNT - uint8_t dmainCount = FSL_FEATURE_TRDC_DOMAIN_COUNT; -#else - uint8_t dmainCount = - (uint8_t)((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NDID_MASK) >> TRDC_TRDC_HWCFG0_NDID_SHIFT); -#endif - uint8_t maxDomainId = 0U; - uint16_t tmpDomainMask = domainMask; - - while (tmpDomainMask != 0U) - { - tmpDomainMask >>= 1U; - maxDomainId++; - } - - if (maxDomainId > dmainCount) - { - assert(false); - } - - TRDC_MBC_BASE(base, mbcIdx)->MBC_NSE_BLK_CLR_ALL = - TRDC_MBC_NSE_BLK_CLR_ALL_DID_SEL(domainMask) | TRDC_MBC_NSE_BLK_CLR_ALL_MEMSEL(slave); -} - -/*! - * brief Sets the memory access configuration for one of the region descriptor of one MBC. - * - * Example: Enable the secure operations and lock the configuration for MRC0 region 1. - * - * code - * trdc_memory_access_control_config_t config; - * - * config.securePrivX = true; - * config.securePrivW = true; - * config.securePrivR = true; - * config.lock = true; - * TRDC_SetMbcMemoryAccess(TRDC, &config, 0, 1); - * endcode - * - * param base TRDC peripheral base address. - * param config Pointer to the configuration structure. - * param mbcIdx MBC index. - * param rgdIdx Region descriptor number. - */ -void TRDC_MbcSetMemoryAccessConfig(TRDC_Type *base, - const trdc_memory_access_control_config_t *config, - uint8_t mbcIdx, - uint8_t rgdIdx) -{ - assert(NULL != base); - assert(NULL != config); - - trdc_reg32_convert_t pid; - - pid._memory_access_control = *config; - TRDC_MBC_BASE(base, mbcIdx)->MBC_MEMN_GLBAC[rgdIdx] = pid._u32; -} - -/*! - * brief Sets the configuration for one of the memory block per domain per MBC instnce. - * - * This function sets the configuration for one of the memory block, including the memory access - * control policy and nse enable. - * - * param base TRDC peripheral base address. - * param config Pointer to memory block configuration structure. - */ -void TRDC_MbcSetMemoryBlockConfig(TRDC_Type *base, const trdc_mbc_memory_block_config_t *config) -{ - assert(NULL != base); - - uint32_t shift = 4UL * (config->memoryBlockIdx % 8UL); - uint32_t regAddr = (uint32_t) & (TRDC_MBC_BASE(base, config->mbcIdx)->MBC_DOM0_MEM0_BLK_CFG_W[0]); - uint32_t configWord = 0U; - trdc_reg32_convert_t pid; - - pid._mbc_memory_blk = *config; - configWord = (pid._u32 & 0xFU) << shift; - - regAddr += (TRDC_MBC_DOMAIN_INCREMENT * config->domainIdx + TRDC_MBC_SLAVE_INCREMENT(config->slaveMemoryIdx)) + - ((uint32_t)config->memoryBlockIdx / 8U) * sizeof(uint32_t); - configWord = configWord | (*(uint32_t *)regAddr & ~(0xFUL << shift)); - *(uint32_t *)regAddr = configWord; -} -#endif diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_trdc.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_trdc.h deleted file mode 100644 index 68d29530882..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_trdc.h +++ /dev/null @@ -1,1131 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_TRDC_H_ -#define FSL_TRDC_H_ - -#include "fsl_common.h" -#include "fsl_trdc_core.h" - -/*! - * @addtogroup trdc - * @{ - */ - -/****************************************************************************** - * Definitions - *****************************************************************************/ -#define FSL_TRDC_DRIVER_VERSION (MAKE_VERSION(2, 2, 1)) - -#if defined(FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG) && FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG -/* Hardware configuration definitions */ -/*! - * @brief TRDC hardware configuration. - */ -typedef struct _trdc_hardware_config -{ - uint8_t masterNumber; /*!< Number of bus masters. */ - uint8_t domainNumber; /*!< Number of domains. */ - uint8_t mbcNumber; /*!< Number of MBCs. */ - uint8_t mrcNumber; /*!< Number of MRCs. */ -} trdc_hardware_config_t; -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_MBC) && FSL_FEATURE_TRDC_HAS_MBC -/*! - * @brief Hardware configuration of the two slave memories within each MBC(memory block checker). - */ -typedef struct _trdc_slave_memory_hardware_config -{ - uint32_t blockNum; /*!< Number of blocks. */ - uint32_t blockSize; /*!< Block size. */ -} trdc_slave_memory_hardware_config_t; -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_DOMAIN_ASSIGNMENT) && FSL_FEATURE_TRDC_HAS_DOMAIN_ASSIGNMENT -/* Master domain assignment definitions */ -/*! - * @brief TRDC domain ID select method, the register bit TRDC_MDA_W0_0_DFMT0[DIDS], used for - * domain hit evaluation. - */ -typedef enum _trdc_did_sel -{ - kTRDC_DidMda, /*!< Use MDAn[2:0] as DID. */ - kTRDC_DidInput, /*!< Use the input DID (DID_in) as DID. */ - kTRDC_DidMdaAndInput, /*!< Use MDAn[2] concatenated with DID_in[1:0] as DID. */ - kTRDC_DidReserved /*!< Reserved. */ -} trdc_did_sel_t; - -/*! - * @brief TRDC secure attribute, the register bit TRDC_MDA_W0_0_DFMT0[SA], used for - * bus master domain assignment. - */ -typedef enum _trdc_secure_attr -{ - kTRDC_ForceSecure, /*!< Force the bus attribute for this master to secure. */ - kTRDC_ForceNonSecure, /*!< Force the bus attribute for this master to non-secure. */ - kTRDC_MasterSecure, /*!< Use the bus master's secure/nonsecure attribute directly. */ - kTRDC_MasterSecure1, /*!< Use the bus master's secure/nonsecure attribute directly. */ -} trdc_secure_attr_t; - -/*! - * @brief The configuration of domain hit evaluation of PID. - */ -typedef enum _trdc_pid_domain_hit_config -{ - kTRDC_pidDomainHitNone0, /*!< No PID is included in the domain hit evaluation. */ - kTRDC_pidDomainHitNone1, /*!< No PID is included in the domain hit evaluation. */ - kTRDC_pidDomainHitInclusive, /*!< The PID is included in the domain hit evaluation when (PID & ~PIDM). */ - kTRDC_pidDomainHitExclusive, /*!< The PID is included in the domain hit evaluation when ~(PID & ~PIDM). */ -} trdc_pid_domain_hit_config_t; - -/*! - * @brief Domain assignment for the processor bus master. - */ -typedef struct _trdc_processor_domain_assignment -{ - uint32_t domainId : 4U; /*!< Domain ID. */ - uint32_t domainIdSelect : 2U; /*!< Domain ID select method, see @ref trdc_did_sel_t. */ - uint32_t pidDomainHitConfig : 2U; /*!< The configuration of the domain hit evaluation for PID, see @ref - trdc_pid_domain_hit_config_t. */ - uint32_t pidMask : 6U; /*!< The mask combined with PID, so multiple PID can be included as part of the domain hit - determination. Set to 0 to disable. */ - uint32_t secureAttr : 2U; /*!< Secure attribute, see @ref trdc_secure_attr_t. */ - uint32_t pid : 6U; /*!< The process identifier, combined with pidMask to form the domain hit determination. */ - uint32_t : 8U; /*!< Reserved. */ - uint32_t lock : 1U; /*!< Lock the register. */ - uint32_t : 1U; /*!< Reserved. */ -} trdc_processor_domain_assignment_t; - -/*! - * @brief TRDC privileged attribute, the register bit TRDC_MDA_W0_x_DFMT1[PA], used for non-processor - * bus master domain assignment. - */ -typedef enum _trdc_privilege_attr -{ - kTRDC_ForceUser, /*!< Force the bus attribute for this master to user. */ - kTRDC_ForcePrivilege, /*!< Force the bus attribute for this master to privileged. */ - kTRDC_MasterPrivilege, /*!< Use the bus master's attribute directly. */ - kTRDC_MasterPrivilege1, /*!< Use the bus master's attribute directly. */ -} trdc_privilege_attr_t; - -/*! - * @brief Domain assignment for the non-processor bus master. - */ -typedef struct _trdc_non_processor_domain_assignment -{ - uint32_t domainId : 4U; /*!< Domain ID. */ - uint32_t privilegeAttr : 2U; /*!< Privileged attribute, see @ref trdc_privilege_attr_t. */ - uint32_t secureAttr : 2U; /*!< Secure attribute, see @ref trdc_secure_attr_t. */ - uint32_t bypassDomainId : 1U; /*!< Bypass domain ID. */ - uint32_t : 21U; /*!< Reserved. */ - uint32_t lock : 1U; /*!< Lock the register. */ - uint32_t : 1U; /*!< Reserved. */ -} trdc_non_processor_domain_assignment_t; - -/*! - * @brief PID lock configuration. - */ -typedef enum _trdc_pid_lock -{ - kTRDC_PidUnlocked0, /*!< The PID value can be updated by any secure priviledged write. */ - kTRDC_PidUnlocked1, /*!< The PID value can be updated by any secure priviledged write. */ - kTRDC_PidUnlocked2, /*!< The PID value can be updated by any secure priviledged write from the bus master that first - configured this register. */ - kTRDC_PidLocked, /*!< The PID value is locked until next reset. */ -} trdc_pid_lock_t; - -/*! - * @brief Process identifier(PID) configuration for processor cores. - */ -typedef struct _trdc_pid_config -{ - uint32_t pid : 6U; /*!< The process identifier of the executing task. The highest bit can be used to define - secure/nonsecure attribute of the task. */ - uint32_t : 23U; /*!< Reserved. */ - uint32_t lock : 2U; /*!< How to lock the register, see @ref trdc_pid_lock_t. */ - uint32_t : 1U; /*!< Reserved. */ -} trdc_pid_config_t; -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG) && FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG -/* TZ-M congiguration definitions */ -/*! - * @brief IDAU(Implementation-Defined Attribution Unit) configuration for TZ-M function control. - */ -typedef struct _trdc_idau_config -{ - uint32_t : 8U; /*!< Reserved. */ - uint32_t lockSecureVTOR : 1U; /*!< Disable writes to secure VTOR(Vector Table Offset Register). */ - uint32_t lockNonsecureVTOR : 1U; /*!< Disable writes to non-secure VTOR, Application interrupt and Reset Control - Registers. */ - uint32_t lockSecureMPU : 1U; /*!< Disable writes to secure MPU(Memory Protection Unit) from software or from a debug - agent connected to the processor in Secure state. */ - uint32_t lockNonsecureMPU : 1U; /*!< Disable writes to non-secure MPU(Memory Protection Unit) from software or from - a debug agent connected to the processor. */ - uint32_t lockSAU : 1U; /*!< Disable writes to SAU(Security Attribution Unit) registers. */ - uint32_t : 19U; /*!< Reserved. */ -} trdc_idau_config_t; - -/* FLW(Flash Logical Window) configuration definitions */ -/*! - * @brief FLW(Flash Logical Window) configuration. - */ -typedef struct _trdc_flw_config -{ - uint16_t blockCount; /*!< Block count of the Flash Logic Window in 32KByte blocks. */ - uint32_t arrayBaseAddr; /*!< Flash array base address of the Flash Logical Window. */ - bool lock; /*!< Disable writes to FLW registers. */ - bool enable; /*!< Enable FLW function. */ -} trdc_flw_config_t; -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_DOMAIN_ERROR) && FSL_FEATURE_TRDC_HAS_DOMAIN_ERROR -/* Domain error check and clear definitions */ -/*! - * @brief TRDC controller definition for domain error check. Each TRDC instance may have different - * MRC or MBC count, call TRDC_GetHardwareConfig to get the actual count. - */ -typedef enum _trdc_controller -{ - kTRDC_MemBlockController0 = 0U, /*!< Memory block checker 0. */ - kTRDC_MemBlockController1 = 1U, /*!< Memory block checker 1. */ - kTRDC_MemBlockController2 = 2U, /*!< Memory block checker 2. */ - kTRDC_MemBlockController3 = 3U, /*!< Memory block checker 3. */ - kTRDC_MemRegionChecker0 = 4U, /*!< Memory region checker 0. */ - kTRDC_MemRegionChecker1 = 5U, /*!< Memory region checker 1. */ - kTRDC_MemRegionChecker2 = 6U, /*!< Memory region checker 2. */ - kTRDC_MemRegionChecker3 = 7U, /*!< Memory region checker 3. */ - kTRDC_MemRegionChecker4 = 8U, /*!< Memory region checker 4. */ - kTRDC_MemRegionChecker5 = 9U, /*!< Memory region checker 5. */ - kTRDC_MemRegionChecker6 = 10U, /*!< Memory region checker 6. */ -} trdc_controller_t; - -/*! - * @brief TRDC domain error state definition TRDC_MBCn_DERR_W1[EST] or TRDC_MRCn_DERR_W1[EST]. - */ -typedef enum _trdc_error_state -{ - kTRDC_ErrorStateNone = 0x00U, /*!< No access violation detected. */ - kTRDC_ErrorStateNone1 = 0x01U, /*!< No access violation detected. */ - kTRDC_ErrorStateSingle = 0x02U, /*!< Single access violation detected. */ - kTRDC_ErrorStateMulti = 0x03U /*!< Multiple access violation detected. */ -} trdc_error_state_t; - -/*! - * @brief TRDC domain error attribute definition TRDC_MBCn_DERR_W1[EATR] or TRDC_MRCn_DERR_W1[EATR]. - */ -typedef enum _trdc_error_attr -{ - kTRDC_ErrorSecureUserInst = 0x00U, /*!< Secure user mode, instruction fetch access. */ - kTRDC_ErrorSecureUserData = 0x01U, /*!< Secure user mode, data access. */ - kTRDC_ErrorSecurePrivilegeInst = 0x02U, /*!< Secure privileged mode, instruction fetch access. */ - kTRDC_ErrorSecurePrivilegeData = 0x03U, /*!< Secure privileged mode, data access. */ - kTRDC_ErrorNonSecureUserInst = 0x04U, /*!< NonSecure user mode, instruction fetch access. */ - kTRDC_ErrorNonSecureUserData = 0x05U, /*!< NonSecure user mode, data access. */ - kTRDC_ErrorNonSecurePrivilegeInst = 0x06U, /*!< NonSecure privileged mode, instruction fetch access. */ - kTRDC_ErrorNonSecurePrivilegeData = 0x07U /*!< NonSecure privileged mode, data access. */ -} trdc_error_attr_t; - -/*! - * @brief TRDC domain error access type definition TRDC_DERR_W1_n[ERW]. - */ -typedef enum _trdc_error_type -{ - kTRDC_ErrorTypeRead = 0x00U, /*!< Error occurs on read reference. */ - kTRDC_ErrorTypeWrite = 0x01U /*!< Error occurs on write reference. */ -} trdc_error_type_t; - -/*! - * @brief TRDC domain error definition. - */ -typedef struct _trdc_domain_error -{ - trdc_controller_t controller; /*!< Which controller captured access violation. */ - uint32_t address; /*!< Access address that generated access violation. */ - trdc_error_state_t errorState; /*!< Error state. */ - trdc_error_attr_t errorAttr; /*!< Error attribute. */ - trdc_error_type_t errorType; /*!< Error type. */ - uint8_t errorPort; /*!< Error port. */ - uint8_t domainId; /*!< Domain ID. */ - uint8_t slaveMemoryIdx; /*!< The slave memory index. Only apply when violation in MBC. */ -} trdc_domain_error_t; -#endif - -#if (defined(FSL_FEATURE_TRDC_HAS_MBC) && FSL_FEATURE_TRDC_HAS_MBC) || \ - (defined(FSL_FEATURE_TRDC_HAS_MRC) && FSL_FEATURE_TRDC_HAS_MRC) -/* Common definitions for MBC/MRC configuration */ -/*! - * @brief Memory access control configuration for MBC/MRC. - */ -typedef struct _trdc_memory_access_control_config -{ - uint32_t nonsecureUsrX : 1U; /*!< Allow nonsecure user execute access. */ - uint32_t nonsecureUsrW : 1U; /*!< Allow nonsecure user write access. */ - uint32_t nonsecureUsrR : 1U; /*!< Allow nonsecure user read access. */ - uint32_t : 1U; /*!< Reserved. */ - uint32_t nonsecurePrivX : 1U; /*!< Allow nonsecure privilege execute access. */ - uint32_t nonsecurePrivW : 1U; /*!< Allow nonsecure privilege write access. */ - uint32_t nonsecurePrivR : 1U; /*!< Allow nonsecure privilege read access. */ - uint32_t : 1U; /*!< Reserved. */ - uint32_t secureUsrX : 1U; /*!< Allow secure user execute access. */ - uint32_t secureUsrW : 1U; /*!< Allow secure user write access. */ - uint32_t secureUsrR : 1U; /*!< Allow secure user read access. */ - uint32_t : 1U; /*!< Reserved. */ - uint32_t securePrivX : 1U; /*!< Allownsecure privilege execute access. */ - uint32_t securePrivW : 1U; /*!< Allownsecure privilege write access. */ - uint32_t securePrivR : 1U; /*!< Allownsecure privilege read access. */ - uint32_t : 16U; /*!< Reserved. */ - uint32_t lock : 1U; /*!< Lock the configuration until next reset, only apply to access control register 0. */ -} trdc_memory_access_control_config_t; -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_MRC) && FSL_FEATURE_TRDC_HAS_MRC -/*! @brief The region descriptor enumeration, used to form a mask to set/clear the NSE bits for one or several regions. - */ -enum _trdc_region_descriptor -{ - kTRDC_RegionDescriptor0 = (1U << 0U), /*!< Region descriptor 0. */ - kTRDC_RegionDescriptor1 = (1U << 1U), /*!< Region descriptor 1. */ - kTRDC_RegionDescriptor2 = (1U << 2U), /*!< Region descriptor 2. */ - kTRDC_RegionDescriptor3 = (1U << 3U), /*!< Region descriptor 3. */ - kTRDC_RegionDescriptor4 = (1U << 4U), /*!< Region descriptor 4. */ - kTRDC_RegionDescriptor5 = (1U << 5U), /*!< Region descriptor 5. */ - kTRDC_RegionDescriptor6 = (1U << 6U), /*!< Region descriptor 6. */ - kTRDC_RegionDescriptor7 = (1U << 7U), /*!< Region descriptor 7. */ - kTRDC_RegionDescriptor8 = (1U << 8U), /*!< Region descriptor 8. */ - kTRDC_RegionDescriptor9 = (1U << 9U), /*!< Region descriptor 9. */ - kTRDC_RegionDescriptor10 = (1U << 10U), /*!< Region descriptor 10. */ - kTRDC_RegionDescriptor11 = (1U << 11U), /*!< Region descriptor 11. */ - kTRDC_RegionDescriptor12 = (1U << 12U), /*!< Region descriptor 12. */ - kTRDC_RegionDescriptor13 = (1U << 13U), /*!< Region descriptor 13. */ - kTRDC_RegionDescriptor14 = (1U << 14U), /*!< Region descriptor 14. */ - kTRDC_RegionDescriptor15 = (1U << 15U), /*!< Region descriptor 15. */ -}; - -/* MRC configuration definitions */ -/*! @brief The MRC domain enumeration, used to form a mask to enable/disable the update or clear all NSE bits of one or - * several domains. */ -enum _trdc_MRC_domain -{ - kTRDC_MrcDomain0 = (1U << 0U), /*!< Domain 0. */ - kTRDC_MrcDomain1 = (1U << 1U), /*!< Domain 1. */ - kTRDC_MrcDomain2 = (1U << 2U), /*!< Domain 2. */ - kTRDC_MrcDomain3 = (1U << 3U), /*!< Domain 3. */ - kTRDC_MrcDomain4 = (1U << 4U), /*!< Domain 4. */ - kTRDC_MrcDomain5 = (1U << 5U), /*!< Domain 5. */ - kTRDC_MrcDomain6 = (1U << 6U), /*!< Domain 6. */ - kTRDC_MrcDomain7 = (1U << 7U), /*!< Domain 7. */ - kTRDC_MrcDomain8 = (1U << 8U), /*!< Domain 8. */ - kTRDC_MrcDomain9 = (1U << 9U), /*!< Domain 9. */ - kTRDC_MrcDomain10 = (1U << 10U), /*!< Domain 10. */ - kTRDC_MrcDomain11 = (1U << 11U), /*!< Domain 11. */ - kTRDC_MrcDomain12 = (1U << 12U), /*!< Domain 12. */ - kTRDC_MrcDomain13 = (1U << 13U), /*!< Domain 13. */ - kTRDC_MrcDomain14 = (1U << 14U), /*!< Domain 14. */ - kTRDC_MrcDomain15 = (1U << 15U), /*!< Domain 15. */ -}; - -/*! - * @brief The configuration of each region descriptor per domain per MRC instance. - */ -typedef struct _trdc_mrc_region_descriptor_config -{ - uint8_t memoryAccessControlSelect; /*!< Select one of the 8 access control policies for this region, for - access cotrol policies see @ref trdc_memory_access_control_config_t. */ - uint32_t startAddr; /*!< Physical start address. */ - bool valid; /*!< Lock the register. */ - bool nseEnable; /*!< Enable non-secure accesses and disable secure accesses. */ - uint32_t endAddr; /*!< Physical start address. */ - uint8_t mrcIdx; /*!< The index of the MRC for this configuration to take effect. */ - uint8_t domainIdx; /*!< The index of the domain for this configuration to take effect. */ - uint8_t regionIdx; /*!< The index of the region for this configuration to take effect. */ -} trdc_mrc_region_descriptor_config_t; -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_MBC) && FSL_FEATURE_TRDC_HAS_MBC -/* MBC configuration definitions */ -/*! - * @brief The configuration of MBC NSE update. - */ -#if defined(FSL_FEATURE_TRDC_DOMAIN_COUNT) && (FSL_FEATURE_TRDC_DOMAIN_COUNT > 0x8U) -typedef struct _trdc_mbc_nse_update_config -{ - uint32_t autoIncrement : 1U; /*!< Whether to increment the word index after current word is updated using this - configuration. */ - uint32_t : 1U; /*!< Reserved. */ - uint32_t wordIdx : 4U; /*!< MBC configuration word index to be updated. */ - uint32_t : 2U; /*!< Reserved. */ - uint32_t memorySelect : 4U; /*!< Bit mask of the selected memory to be updated. @ref _trdc_MBC_memory. */ - uint32_t : 4U; /*!< Reserved. */ - uint32_t domianSelect : 16U; /*!< Bit mask of the selected domain to be updated. @ref _trdc_MBC_domain. */ -} trdc_mbc_nse_update_config_t; -#else -typedef struct _trdc_mbc_nse_update_config -{ - uint32_t : 2U; /*!< Reserved. */ - uint32_t wordIdx : 4U; /*!< MBC configuration word index to be updated. */ - uint32_t : 2U; /*!< Reserved. */ - uint32_t memorySelect : 4U; /*!< Bit mask of the selected memory to be updated. @ref _trdc_MBC_memory. */ - uint32_t : 4U; /*!< Reserved. */ - uint32_t domianSelect : 8U; /*!< Bit mask of the selected domain to be updated. @ref _trdc_MBC_domain. */ - uint32_t : 7U; /*!< Reserved. */ - uint32_t autoIncrement : 1U; /*!< Whether to increment the word index after current word is updated using this - configuration. */ -} trdc_mbc_nse_update_config_t; -#endif - -/*! @brief The MBC domain enumeration, used to form a mask to enable/disable the update or clear NSE bits of one or - * several domains. */ -enum _trdc_MBC_domain -{ - kTRDC_MbcDomain0 = (1U << 0U), /*!< Domain 0. */ - kTRDC_MbcDomain1 = (1U << 1U), /*!< Domain 1. */ - kTRDC_MbcDomain2 = (1U << 2U), /*!< Domain 2. */ - kTRDC_MbcDomain3 = (1U << 3U), /*!< Domain 3. */ - kTRDC_MbcDomain4 = (1U << 4U), /*!< Domain 4. */ - kTRDC_MbcDomain5 = (1U << 5U), /*!< Domain 5. */ - kTRDC_MbcDomain6 = (1U << 6U), /*!< Domain 6. */ - kTRDC_MbcDomain7 = (1U << 7U), /*!< Domain 7. */ -}; - -/*! @brief The MBC slave memory enumeration, used to form a mask to enable/disable the update or clear NSE bits of one - * or several memory block. */ -enum _trdc_MBC_memory -{ - kTRDC_MbcSlaveMemory0 = (1U << 0U), /*!< Memory 0. */ - kTRDC_MbcSlaveMemory1 = (1U << 1U), /*!< Memory 1. */ - kTRDC_MbcSlaveMemory2 = (1U << 2U), /*!< Memory 2. */ - kTRDC_MbcSlaveMemory3 = (1U << 3U), /*!< Memory 3. */ -}; - -/*! @brief The MBC bit enumeration, used to form a mask to set/clear configured words' NSE. */ -enum _trdc_MBC_bit -{ - kTRDC_MbcBit0 = (1U << 0U), /*!< Bit 0. */ - kTRDC_MbcBit1 = (1U << 1U), /*!< Bit 1. */ - kTRDC_MbcBit2 = (1U << 2U), /*!< Bit 2. */ - kTRDC_MbcBit3 = (1U << 3U), /*!< Bit 3. */ - kTRDC_MbcBit4 = (1U << 4U), /*!< Bit 4. */ - kTRDC_MbcBit5 = (1U << 5U), /*!< Bit 5. */ - kTRDC_MbcBit6 = (1U << 6U), /*!< Bit 6. */ - kTRDC_MbcBit7 = (1U << 7U), /*!< Bit 7. */ - kTRDC_MbcBit8 = (1U << 8U), /*!< Bit 8. */ - kTRDC_MbcBit9 = (1U << 9U), /*!< Bit 9. */ - kTRDC_MbcBit10 = (1U << 10U), /*!< Bit 10. */ - kTRDC_MbcBit11 = (1U << 11U), /*!< Bit 11. */ - kTRDC_MbcBit12 = (1U << 12U), /*!< Bit 12. */ - kTRDC_MbcBit13 = (1U << 13U), /*!< Bit 13. */ - kTRDC_MbcBit14 = (1U << 14U), /*!< Bit 14. */ - kTRDC_MbcBit15 = (1U << 15U), /*!< Bit 15. */ - kTRDC_MbcBit16 = (1U << 16U), /*!< Bit 16. */ - kTRDC_MbcBit17 = (1U << 17U), /*!< Bit 17. */ - kTRDC_MbcBit18 = (1U << 18U), /*!< Bit 18. */ - kTRDC_MbcBit19 = (1U << 19U), /*!< Bit 19. */ - kTRDC_MbcBit20 = (1U << 20U), /*!< Bit 20. */ - kTRDC_MbcBit21 = (1U << 21U), /*!< Bit 21. */ - kTRDC_MbcBit22 = (1U << 22U), /*!< Bit 22. */ - kTRDC_MbcBit23 = (1U << 23U), /*!< Bit 23. */ - kTRDC_MbcBit24 = (1U << 24U), /*!< Bit 24. */ - kTRDC_MbcBit25 = (1U << 25U), /*!< Bit 25. */ - kTRDC_MbcBit26 = (1U << 26U), /*!< Bit 26. */ - kTRDC_MbcBit27 = (1U << 27U), /*!< Bit 27. */ - kTRDC_MbcBit28 = (1U << 28U), /*!< Bit 28. */ - kTRDC_MbcBit29 = (1U << 29U), /*!< Bit 29. */ - kTRDC_MbcBit30 = (1U << 30U), /*!< Bit 30. */ - kTRDC_MbcBit31 = (1U << 31U), /*!< Bit 31. */ -}; - -/*! - * @brief The configuration of each memory block per domain per MBC instance. - */ -typedef struct _trdc_mbc_memory_block_config -{ - uint32_t memoryAccessControlSelect : 3U; /*!< Select one of the 8 access control policies for this memory block, for - access cotrol policies see @ref trdc_memory_access_control_config_t. */ - uint32_t nseEnable : 1U; /*!< Enable non-secure accesses and disable secure accesses. */ - uint32_t mbcIdx : 4U; /*!< The index of the MBC for this configuration to take effect. */ - uint32_t domainIdx : 8U; /*!< The index of the domain for this configuration to take effect. */ - uint32_t slaveMemoryIdx : 8U; /*!< The index of the slave memory for this configuration to take effect. */ - uint32_t memoryBlockIdx : 8U; /*!< The index of the memory block for this configuration to take effect. */ -} trdc_mbc_memory_block_config_t; -#endif - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ -/*! - * @brief Initializes the TRDC module. - * - * This function enables the TRDC clock. - * - * @param base TRDC peripheral base address. - */ -void TRDC_Init(TRDC_Type *base); - -/*! - * @brief De-initializes the TRDC module. - * - * This function disables the TRDC clock. - * - * @param base TRDC peripheral base address. - */ -void TRDC_Deinit(TRDC_Type *base); -/*! @} */ - -#if defined(FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG) && FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG -/*! - * @name Hardware configuration - * @{ - */ -/*! - * @brief Gets the domain ID of the current bus master. - * - * @param base TRDC peripheral base address. - * @return Domain ID of current bus master. - */ -static inline uint8_t TRDC_GetCurrentMasterDomainId(TRDC_Type *base) -{ - return (uint8_t)((TRDC_GENERAL_BASE(base)->TRDC_HWCFG1 & TRDC_TRDC_HWCFG1_DID_MASK) >> TRDC_TRDC_HWCFG1_DID_SHIFT); -} - -/*! - * @brief Gets the TRDC hardware configuration. - * - * This function gets the TRDC hardware configurations, including number of bus - * masters, number of domains, number of MRCs and number of PACs. - * - * @param base TRDC peripheral base address. - * @param config Pointer to the structure to get the configuration. - */ -void TRDC_GetHardwareConfig(TRDC_Type *base, trdc_hardware_config_t *config); -/*! @} */ -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_DOMAIN_ASSIGNMENT) && FSL_FEATURE_TRDC_HAS_DOMAIN_ASSIGNMENT -/*! - * @name Master domain assignment - * @{ - */ -/*! - * @brief Sets the TRDC DAC(Domain Assignment Controllers) global valid. - * - * Once enabled, it will remain enabled until next reset. - * - * @param base TRDC peripheral base address. - */ -static inline void TRDC_SetDacGlobalValid(TRDC_Type *base) -{ - TRDC_GENERAL_BASE(base)->TRDC_CR |= TRDC_TRDC_CR_GVLDM_MASK; -} - -/*! - * @brief Locks the bus master domain assignment register. - * - * This function locks the master domain assignment. After it is locked, the register can't be changed - * until next reset. - * - * @param base TRDC peripheral base address. - * @param master Which master to configure, refer to trdcx_master_t in processor header file, x is trdc instance. - * @param regNum Which register to configure, processor master can have more than one register for the MDAC - configuration. - * @param assignIndex Which assignment register to lock. - */ -static inline void TRDC_LockMasterDomainAssignment(TRDC_Type *base, uint8_t master, uint8_t regNum) -{ - /* Make sure in the master range. */ - assert((uint32_t)master < - ((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NMSTR_MASK) >> TRDC_TRDC_HWCFG0_NMSTR_SHIFT)); - if (0U == (TRDC_GENERAL_BASE(base)->DACFG[master] & TRDC_DACFG_NCM_MASK)) - { - TRDC_DOMAIN_ASSIGNMENT_BASE(base)->MDA_DFMT0[master].MDA_W_DFMT0[regNum] |= TRDC_MDA_W_DFMT0_LK1_MASK; - } - else - { - TRDC_DOMAIN_ASSIGNMENT_BASE(base)->MDA_DFMT1[master].MDA_W_DFMT1[0] |= TRDC_MDA_W_DFMT1_LK1_MASK; - } -} - -/*! - * @brief Sets the master domain assignment as valid or invalid. - * - * This function sets the master domain assignment as valid or invalid. - * - * @param base TRDC peripheral base address. - * @param master Which master to configure. - * @param regNum Which register to configure, processor master can have more than one register for the MDAC - * configuration. - * @param assignIndex Index for the domain assignment register. - * @param valid True to set valid, false to set invalid. - */ -static inline void TRDC_SetMasterDomainAssignmentValid(TRDC_Type *base, uint8_t master, uint8_t regNum, bool valid) -{ - /* Make sure in the master range. */ - assert((uint32_t)master < - ((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NMSTR_MASK) >> TRDC_TRDC_HWCFG0_NMSTR_SHIFT)); - if (valid) - { - if (0U == (TRDC_GENERAL_BASE(base)->DACFG[master] & TRDC_DACFG_NCM_MASK)) - { - TRDC_DOMAIN_ASSIGNMENT_BASE(base)->MDA_DFMT0[master].MDA_W_DFMT0[regNum] |= TRDC_MDA_W_DFMT0_VLD_MASK; - } - else - { - TRDC_DOMAIN_ASSIGNMENT_BASE(base)->MDA_DFMT1[master].MDA_W_DFMT1[0] |= TRDC_MDA_W_DFMT1_VLD_MASK; - } - } - else - { - if (0U == (TRDC_GENERAL_BASE(base)->DACFG[master] & TRDC_DACFG_NCM_MASK)) - { - TRDC_DOMAIN_ASSIGNMENT_BASE(base)->MDA_DFMT0[master].MDA_W_DFMT0[regNum] &= ~TRDC_MDA_W_DFMT0_VLD_MASK; - } - else - { - TRDC_DOMAIN_ASSIGNMENT_BASE(base)->MDA_DFMT1[master].MDA_W_DFMT1[0] &= ~TRDC_MDA_W_DFMT1_VLD_MASK; - } - } -} - -/*! - * @brief Gets the default master domain assignment for the processor bus master. - * - * This function gets the default master domain assignment for the processor bus master. - * It should only be used for the processor bus masters, such as CORE0. This function - * sets the assignment as follows: - * - * @code - * assignment->domainId = 0U; - * assignment->domainIdSelect = kTRDC_DidMda; - * assignment->lock = 0U; - * @endcode - * - * @param domainAssignment Pointer to the assignment structure. - */ -void TRDC_GetDefaultProcessorDomainAssignment(trdc_processor_domain_assignment_t *domainAssignment); - -/*! - * @brief Gets the default master domain assignment for non-processor bus master. - * - * This function gets the default master domain assignment for non-processor bus master. - * It should only be used for the non-processor bus masters, such as DMA. This function - * sets the assignment as follows: - * - * @code - * assignment->domainId = 0U; - * assignment->privilegeAttr = kTRDC_ForceUser; - * assignment->secureAttr = kTRDC_ForceSecure; - * assignment->bypassDomainId = 0U; - * assignment->lock = 0U; - * @endcode - * - * @param domainAssignment Pointer to the assignment structure. - */ -void TRDC_GetDefaultNonProcessorDomainAssignment(trdc_non_processor_domain_assignment_t *domainAssignment); - -/*! - * @brief Sets the processor bus master domain assignment. - * - * This function sets the processor master domain assignment as valid. - * One bus master might have multiple domain assignment registers. The parameter - * \p assignIndex specifies which assignment register to set. - * - * Example: Set domain assignment for core 0. - * - * @code - * trdc_processor_domain_assignment_t processorAssignment; - * - * TRDC_GetDefaultProcessorDomainAssignment(&processorAssignment); - * - * processorAssignment.domainId = 0; - * processorAssignment.xxx = xxx; - * TRDC_SetMasterDomainAssignment(TRDC, &processorAssignment); - * @endcode - * - * @param base TRDC peripheral base address. - * @param master Which master to configure, refer to trdc_master_t in processor header file. - * @param regNum Which register to configure, processor master can have more than one register for the MDAC - * configuration. - * @param domainAssignment Pointer to the assignment structure. - */ -void TRDC_SetProcessorDomainAssignment(TRDC_Type *base, - uint8_t master, - uint8_t regNum, - const trdc_processor_domain_assignment_t *domainAssignment); - -/*! - * @brief Sets the non-processor bus master domain assignment. - * - * This function sets the non-processor master domain assignment as valid. - * One bus master might have multiple domain assignment registers. The parameter - * \p assignIndex specifies which assignment register to set. - * - * Example: Set domain assignment for DMA0. - * @code - * trdc_non_processor_domain_assignment_t nonProcessorAssignment; - * - * TRDC_GetDefaultNonProcessorDomainAssignment(&nonProcessorAssignment); - * nonProcessorAssignment.domainId = 1; - * nonProcessorAssignment.xxx = xxx; - * - * TRDC_SetMasterDomainAssignment(TRDC, kTrdcMasterDma0, 0U, &nonProcessorAssignment); - * @endcode - * - * @param base TRDC peripheral base address. - * @param master Which master to configure, refer to trdc_master_t in processor header file. - * @param domainAssignment Pointer to the assignment structure. - */ -void TRDC_SetNonProcessorDomainAssignment(TRDC_Type *base, - uint8_t master, - const trdc_non_processor_domain_assignment_t *domainAssignment); - -/*! - * @brief Gets the bit map of the bus master(s) that is(are) sourcing a PID register. - * - * This function sets the non-processor master domain assignment as valid. - * - * @param base TRDC peripheral base address. - * @return the bit map of the master(s). Bit 1 sets indicates bus master 1. - */ -static inline uint64_t TRDC_GetActiveMasterPidMap(TRDC_Type *base) -{ - return ((uint64_t)TRDC_GENERAL_BASE(base)->TRDC_HWCFG3 << 32U) | (uint64_t)TRDC_GENERAL_BASE(base)->TRDC_HWCFG2; -} - -/*! - * @brief Sets the current Process identifier(PID) for processor core. - * - * Each processor has a corresponding process identifier (PID) which can be used to group tasks into different domains. - * Secure privileged software saves and restores the PID as part of any context switch. - * This data structure defines an array of 32-bit values, one per MDA module, that define the PID. Since this register - * resource is only applicable to processor cores, the data structure is typically sparsely populated. The HWCFG[2-3] - * registers provide a bitmap of the implemented PIDn registers. This data structure is indexed using the corresponding - * MDA instance number. Depending on the operating clock domain of each DAC instance, there may be optional information - * stored in the corresponding PIDm register to properly implement the LK2 = 2 functionality. - * - * @param base TRDC peripheral base address. - * @param master Which processor master to configure, refer to trdc_master_t in processor header file. - * @param pidConfig Pointer to the configuration structure. - */ -void TRDC_SetPid(TRDC_Type *base, uint8_t master, const trdc_pid_config_t *pidConfig); -/*! @} */ -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG) && FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG -/*! - * @name TZ-M congiguration - * @{ - */ -/*! - * @brief Gets the default IDAU(Implementation-Defined Attribution Unit) configuration. - * - * @code - * config->lockSecureVTOR = false; - * config->lockNonsecureVTOR = false; - * config->lockSecureMPU = false; - * config->lockNonsecureMPU = false; - * config->lockSAU = false; - * @endcode - * - * @param domainAssignment Pointer to the configuration structure. - */ -void TRDC_GetDefaultIDAUConfig(trdc_idau_config_t *idauConfiguration); - -/*! - * @brief Sets the IDAU(Implementation-Defined Attribution Unit) control configuration. - * - * Example: Lock the secure and non-secure MPU registers. - * - * @code - * trdc_idau_config_t idauConfiguration; - * - * TRDC_GetDefaultIDAUConfig(&idauConfiguration); - * - * idauConfiguration.lockSecureMPU = true; - * idauConfiguration.lockNonsecureMPU = true; - * TRDC_SetIDAU(TRDC, &idauConfiguration); - * @endcode - * - * @param base TRDC peripheral base address. - * @param domainAssignment Pointer to the configuration structure. - */ -void TRDC_SetIDAU(TRDC_Type *base, const trdc_idau_config_t *idauConfiguration); -/*! @} */ -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_FLW) && FSL_FEATURE_TRDC_HAS_FLW -/*! - * @name FLW(Flash Logical Window) configuration - * @{ - */ -/*! - * @brief Enables/disables the FLW(flash logical window) function. - * - * @param base TRDC peripheral base address. - * @param enable True to enable, false to disable. - */ -static inline void TRDC_EnableFlashLogicalWindow(TRDC_Type *base, bool enable) -{ - if (enable) - { - TRDC_FLW_BASE(base)->TRDC_FLW_CTL |= TRDC_TRDC_FLW_CTL_V_MASK; - } - else - { - TRDC_FLW_BASE(base)->TRDC_FLW_CTL &= ~TRDC_TRDC_FLW_CTL_V_MASK; - } -} - -/*! - * @brief Locks FLW registers. Once locked the registers can noy be updated until next reset. - * - * @param base TRDC peripheral base address. - */ -static inline void TRDC_LockFlashLogicalWindow(TRDC_Type *base) -{ - TRDC_FLW_BASE(base)->TRDC_FLW_CTL |= TRDC_TRDC_FLW_CTL_LK_MASK; -} - -/*! - * @brief Gets the FLW physical base address. - * - * @param base TRDC peripheral base address. - * @return Physical address of the FLW function. - */ -static inline uint32_t TRDC_GetFlashLogicalWindowPbase(TRDC_Type *base) -{ - return TRDC_FLW_BASE(base)->TRDC_FLW_PBASE; -} - -/*! - * @brief Sets the FLW size. - * - * @param base TRDC peripheral base address. - * @param size Size of the FLW in unit of 32k bytes. - */ -static inline void TRDC_GetSetFlashLogicalWindowSize(TRDC_Type *base, uint16_t size) -{ - TRDC_FLW_BASE(base)->TRDC_FLW_BCNT = size; -} - -/*! - * @brief Gets the default FLW(Flsh Logical Window) configuration. - * - * @code - * config->blockCount = false; - * config->arrayBaseAddr = false; - * config->lock = false; - * config->enable = false; - * @endcode - * - * @param flwConfiguration Pointer to the configuration structure. - */ -void TRDC_GetDefaultFlashLogicalWindowConfig(trdc_flw_config_t *flwConfiguration); - -/*! - * @brief Sets the FLW function's configuration. - * - * @code - * trdc_flw_config_t flwConfiguration; - * - * TRDC_GetDefaultIDAUConfig(&flwConfiguration); - * - * flwConfiguration.blockCount = 32U; - * flwConfiguration.arrayBaseAddr = 0xXXXXXXXX; - * TRDC_SetIDAU(TRDC, &flwConfiguration); - * @endcode - * - * @param base TRDC peripheral base address. - * @param flwConfiguration Pointer to the configuration structure. - */ -void TRDC_SetFlashLogicalWindow(TRDC_Type *base, const trdc_flw_config_t *flwConfiguration); -/*! @} */ -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_DOMAIN_ERROR) && FSL_FEATURE_TRDC_HAS_DOMAIN_ERROR -/*! - * @name Domain error check and clear - * @{ - */ -/*! - * @brief Gets and clears the first domain error of the current domain. - * - * This function gets the first access violation information for the current domain - * and clears the pending flag. There might be multiple access violations pending - * for the current domain. This function only processes the first error. - * - * @param base TRDC peripheral base address. - * @param error Pointer to the error information. - * @return If the access violation is captured, this function returns the kStatus_Success. - * The error information can be obtained from the parameter error. If no - * access violation is captured, this function returns the kStatus_NoData. - */ -status_t TRDC_GetAndClearFirstDomainError(TRDC_Type *base, trdc_domain_error_t *error); - -/*! - * @brief Gets and clears the first domain error of the specific domain. - * - * This function gets the first access violation information for the specific domain - * and clears the pending flag. There might be multiple access violations pending - * for the current domain. This function only processes the first error. - * - * @param base TRDC peripheral base address. - * @param error Pointer to the error information. - * @param domainId The error of which domain to get and clear. - * @return If the access violation is captured, this function returns the kStatus_Success. - * The error information can be obtained from the parameter error. If no - * access violation is captured, this function returns the kStatus_NoData. - */ -status_t TRDC_GetAndClearFirstSpecificDomainError(TRDC_Type *base, trdc_domain_error_t *error, uint8_t domainId); -/*! @} */ -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_MRC) && FSL_FEATURE_TRDC_HAS_MRC -/*! - * @name MRC configuration - * @{ - */ -#if defined(FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG) && FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG -/*! - * @brief Sets the TRDC MRC(Memory Region Checkers) global valid. - * - * Once enabled, it will remain enabled until next reset. - * - * @param base TRDC peripheral base address. - */ -static inline void TRDC_SetMrcGlobalValid(TRDC_Type *base) -{ - TRDC_GENERAL_BASE(base)->TRDC_CR |= TRDC_TRDC_CR_GVLDR_MASK; -} -#endif - -/*! - * @brief Gets the TRDC MRC(Memory Region Checkers) region number valid. - * - * @param base TRDC peripheral base address. - * @return the region number of the given MRC instance - */ -static inline uint8_t TRDC_GetMrcRegionNumber(TRDC_Type *base, uint8_t mrcIdx) -{ - return (uint8_t)((TRDC_MRC_BASE(base, mrcIdx)->MRC_GLBCFG & TRDC_MRC_GLBCFG_NRGNS_MASK) >> - TRDC_MRC_GLBCFG_NRGNS_SHIFT); -} - -/*! - * @brief Sets the memory access configuration for one of the access control register of one MRC. - * - * Example: Enable the secure operations and lock the configuration for MRC0 region 1. - * - * @code - * trdc_memory_access_control_config_t config; - * - * config.securePrivX = true; - * config.securePrivW = true; - * config.securePrivR = true; - * config.lock = true; - * TRDC_SetMrcMemoryAccess(TRDC, &config, 0, 1); - * @endcode - * - * @param base TRDC peripheral base address. - * @param config Pointer to the configuration structure. - * @param mrcIdx MRC index. - * @param regIdx Register number. - */ -void TRDC_MrcSetMemoryAccessConfig(TRDC_Type *base, - const trdc_memory_access_control_config_t *config, - uint8_t mrcIdx, - uint8_t regIdx); - -/*! - * @brief Enables the update of the selected domians. - * - * After the domians' update are enabled, their regions' NSE bits can be set or clear. - * - * @param base TRDC peripheral base address. - * @param mrcIdx MRC index. - * @param domianMask Bit mask of the domains to be enabled. - * @param enable True to enable, false to disable. - */ -void TRDC_MrcEnableDomainNseUpdate(TRDC_Type *base, uint8_t mrcIdx, uint16_t domianMask, bool enable); - -/*! - * @brief Sets the NSE bits of the selected regions for domains. - * - * This function sets the NSE bits for the selected regions for the domains whose update are enabled. - * - * @param base TRDC peripheral base address. - * @param mrcIdx MRC index. - * @param regionMask Bit mask of the regions whose NSE bits to set. - */ -void TRDC_MrcRegionNseSet(TRDC_Type *base, uint8_t mrcIdx, uint16_t regionMask); - -/*! - * @brief Clears the NSE bits of the selected regions for domains. - * - * This function clears the NSE bits for the selected regions for the domains whose update are enabled. - * - * @param base TRDC peripheral base address. - * @param mrcIdx MRC index. - * @param regionMask Bit mask of the regions whose NSE bits to clear. - */ -void TRDC_MrcRegionNseClear(TRDC_Type *base, uint8_t mrcIdx, uint16_t regionMask); - -/*! - * @brief Clears the NSE bits for all the regions of the selected domains. - * - * This function clears the NSE bits for all regions of selected domains whose update are enabled. - * - * @param base TRDC peripheral base address. - * @param mrcIdx MRC index. - * @param domainMask Bit mask of the domians whose NSE bits to clear. - */ -void TRDC_MrcDomainNseClear(TRDC_Type *base, uint8_t mrcIdx, uint16_t domainMask); - -/*! - * @brief Sets the configuration for one of the region descriptor per domain per MRC instnce. - * - * This function sets the configuration for one of the region descriptor, including the start - * and end address of the region, memory access control policy and valid. - * - * @param base TRDC peripheral base address. - * @param config Pointer to region descriptor configuration structure. - */ -void TRDC_MrcSetRegionDescriptorConfig(TRDC_Type *base, const trdc_mrc_region_descriptor_config_t *config); -/*! @} */ -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_MBC) && FSL_FEATURE_TRDC_HAS_MBC -/*! - * @name MBC configuration - * @{ - */ -#if defined(FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG) && FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG -/*! - * @brief Sets the TRDC MBC(Memory Block Checkers) global valid. - * - * Once enabled, it will remain enabled until next reset. - * - * @param base TRDC peripheral base address. - */ -static inline void TRDC_SetMbcGlobalValid(TRDC_Type *base) -{ - TRDC_GENERAL_BASE(base)->TRDC_CR |= TRDC_TRDC_CR_GVLDB_MASK; -} -#endif - -/*! - * @brief Gets the hardware configuration of the one of two slave memories within each MBC(memory block checker). - * - * @param base TRDC peripheral base address. - * @param config Pointer to the structure to get the configuration. - * @param mbcIdx MBC number. - * @param slvIdx Slave number. - */ -void TRDC_GetMbcHardwareConfig(TRDC_Type *base, - trdc_slave_memory_hardware_config_t *config, - uint8_t mbcIdx, - uint8_t slvIdx); - -/*! - * @brief Sets the NSR update configuration for one of the MBC instance. - * - * After set the NSE configuration, the configured memory area can be updateby NSE set/clear. - * - * @param base TRDC peripheral base address. - * @param config Pointer to NSE update configuration structure. - * @param mbcIdx MBC index. - */ -void TRDC_MbcSetNseUpdateConfig(TRDC_Type *base, const trdc_mbc_nse_update_config_t *config, uint8_t mbcIdx); - -/*! - * @brief Sets the NSE bits of the selected configuration words according to NSE update configuration. - * - * This function sets the NSE bits of the word for the configured regio, memory. - * - * @param base TRDC peripheral base address. - * @param mbcIdx MBC index. - * @param bitMask Mask of the bits whose NSE bits to set. - */ -void TRDC_MbcWordNseSet(TRDC_Type *base, uint8_t mbcIdx, uint32_t bitMask); - -/*! - * @brief Clears the NSE bits of the selected configuration words according to NSE update configuration. - * - * This function sets the NSE bits of the word for the configured regio, memory. - * - * @param base TRDC peripheral base address. - * @param mbcIdx MBC index. - * @param bitMask Mask of the bits whose NSE bits to clear. - */ -void TRDC_MbcWordNseClear(TRDC_Type *base, uint8_t mbcIdx, uint32_t bitMask); - -/*! - * @brief Clears all configuration words' NSE bits of the selected domain and memory. - * - * @param base TRDC peripheral base address. - * @param mbcIdx MBC index. - * @param domainMask Mask of the domains whose NSE bits to clear, 0b110 means clear domain 1&2. - * @param slaveMask Mask of the slaves whose NSE bits to clear, 0x11 means clear all slave 0&1's NSE bits. - */ -void TRDC_MbcNseClearAll(TRDC_Type *base, uint8_t mbcIdx, uint16_t domainMask, uint8_t slave); - -/*! - * @brief Sets the memory access configuration for one of the region descriptor of one MBC. - * - * Example: Enable the secure operations and lock the configuration for MRC0 region 1. - * - * @code - * trdc_memory_access_control_config_t config; - * - * config.securePrivX = true; - * config.securePrivW = true; - * config.securePrivR = true; - * config.lock = true; - * TRDC_SetMbcMemoryAccess(TRDC, &config, 0, 1); - * @endcode - * - * @param base TRDC peripheral base address. - * @param config Pointer to the configuration structure. - * @param mbcIdx MBC index. - * @param rgdIdx Region descriptor number. - */ -void TRDC_MbcSetMemoryAccessConfig(TRDC_Type *base, - const trdc_memory_access_control_config_t *config, - uint8_t mbcIdx, - uint8_t rgdIdx); - -/*! - * @brief Sets the configuration for one of the memory block per domain per MBC instnce. - * - * This function sets the configuration for one of the memory block, including the memory access - * control policy and nse enable. - * - * @param base TRDC peripheral base address. - * @param config Pointer to memory block configuration structure. - */ -void TRDC_MbcSetMemoryBlockConfig(TRDC_Type *base, const trdc_mbc_memory_block_config_t *config); -/*! @} */ -#endif - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ - -#endif /* FSL_TRDC_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_trdc_core.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_trdc_core.h deleted file mode 100644 index 8c3e2a9b508..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_trdc_core.h +++ /dev/null @@ -1,489 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_TRDC_CORE_H_ -#define FSL_TRDC_CORE_H_ - -#include "fsl_trdc_soc.h" - -/*! - * @addtogroup trdc_core - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/*!@brief TRDC general configuration register definition. */ -typedef struct _TRDC_General_Type -{ - __IO uint32_t TRDC_CR; /**< TRDC Register, offset: 0x0 */ - uint8_t RESERVED_0[236]; - __I uint32_t TRDC_HWCFG0; /**< TRDC Hardware Configuration Register 0, offset: 0xF0 */ - __I uint32_t TRDC_HWCFG1; /**< TRDC Hardware Configuration Register 1, offset: 0xF4 */ - __I uint32_t TRDC_HWCFG2; /**< TRDC Hardware Configuration Register 2, offset: 0xF8 */ - __I uint32_t TRDC_HWCFG3; /**< TRDC Hardware Configuration Register 3, offset: 0xFC */ - __I uint8_t DACFG[8]; /**< Domain Assignment Configuration Register, array offset: 0x100, array step: 0x1 */ - uint8_t RESERVED_1[184]; - __IO uint32_t TRDC_IDAU_CR; /**< TRDC IDAU Control Register, offset: 0x1C0 */ -} TRDC_General_Type; - -/*!@brief TRDC flash logical control register definition. */ -typedef struct _TRDC_FLW_Type -{ - __IO uint32_t TRDC_FLW_CTL; /**< TRDC FLW Control, offset: 0x1E0 */ - __I uint32_t TRDC_FLW_PBASE; /**< TRDC FLW Physical Base, offset: 0x1E4 */ - __IO uint32_t TRDC_FLW_ABASE; /**< TRDC FLW Array Base, offset: 0x1E8 */ - __IO uint32_t TRDC_FLW_BCNT; /**< TRDC FLW Block Count, offset: 0x1EC */ -} TRDC_FLW_Type; - -/*!@brief TRDC domain error register definition. */ -typedef struct _TRDC_DomainError_Type -{ - __IO uint32_t TRDC_FDID; /**< TRDC Fault Domain ID, offset: 0x1FC */ - __I uint32_t TRDC_DERRLOC[16]; /**< TRDC Domain Error Location Register, array offset: 0x200, array step: 0x4 */ - uint8_t RESERVED_4[448]; - struct - { /* offset: 0x400, array step: 0x10 */ - __I uint32_t W0; /**< MBC Domain Error Word0 Register, array offset: 0x400, array step: 0x10 */ - __I uint32_t W1; /**< MBC Domain Error Word1 Register, array offset: 0x404, array step: 0x10 */ - uint8_t RESERVED_0[4]; - __O uint32_t W3; /**< MBC Domain Error Word3 Register, array offset: 0x40C, array step: 0x10 */ - } MBC_DERR[8]; - struct - { /* offset: 0x480, array step: 0x10 */ - __I uint32_t W0; /**< MRC Domain Error Word0 Register, array offset: 0x480, array step: 0x10 */ - __I uint32_t W1; /**< MRC Domain Error Word1 Register, array offset: 0x484, array step: 0x10 */ - uint8_t RESERVED_0[4]; - __O uint32_t W3; /**< MRC Domain Error Word3 Register, array offset: 0x48C, array step: 0x10 */ - } MRC_DERR[8]; -} TRDC_DomainError_Type; - -/*!@brief TRDC master domain assignment register definition. */ -typedef struct _TRDC_DomainAssignment_Type -{ - __IO uint32_t PID[8]; /**< Process Identifier, array offset: 0x700, array step: 0x4 */ - uint8_t RESERVED_7[224]; - union - { - struct - { /* offset: 0x800, array step: 0x20 */ - __IO uint32_t MDA_W_DFMT0[8]; /**< DAC Master Domain Assignment Register, array offset: 0x800, array step: - index*0x20, index2*0x4 */ - } MDA_DFMT0[8]; - struct - { /* offset: 0x800, array step: 0x20 */ - __IO uint32_t MDA_W_DFMT1[1]; /**< DAC Master Domain Assignment Register, array offset: 0x800, array step: - index*0x20, index2*0x4 */ - uint8_t RESERVED_0[28]; - } MDA_DFMT1[8]; - }; -} TRDC_DomainAssignment_Type; - -/*!@brief TRDC MBC control register definition. */ -typedef struct _TRDC_MBC_Type -{ - __I uint32_t MBC_MEM_GLBCFG[4]; /**< MBC Global Configuration Register, array offset: 0x10000, array step: - index*0x2000, index2*0x4 */ - __IO uint32_t MBC_NSE_BLK_INDEX; /**< MBC NonSecure Enable Block Index, array offset: 0x10010, array step: 0x2000 */ - __O uint32_t MBC_NSE_BLK_SET; /**< MBC NonSecure Enable Block Set, array offset: 0x10014, array step: 0x2000 */ - __O uint32_t MBC_NSE_BLK_CLR; /**< MBC NonSecure Enable Block Clear, array offset: 0x10018, array step: 0x2000 */ - __O uint32_t - MBC_NSE_BLK_CLR_ALL; /**< MBC NonSecure Enable Block Clear All, array offset: 0x1001C, array step: 0x2000 */ - __IO uint32_t MBC_MEMN_GLBAC[8]; /**< MBC Global Access Control, array offset: 0x10020, array step: index*0x2000, - index2*0x4 */ - __IO uint32_t MBC_DOM0_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x10040, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM0_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10140, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM0_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10180, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM0_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x101A0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM0_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x101A8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM0_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x101C8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM0_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x101D0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM0_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x101F0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_0[72]; - __IO uint32_t MBC_DOM1_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x10240, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM1_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10340, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM1_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10380, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM1_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x103A0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM1_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x103A8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM1_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x103C8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM1_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x103D0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM1_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x103F0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_1[72]; - __IO uint32_t MBC_DOM2_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x10440, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM2_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10540, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM2_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10580, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM2_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x105A0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM2_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x105A8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM2_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x105C8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM2_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x105D0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM2_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x105F0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_2[72]; - __IO uint32_t MBC_DOM3_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x10640, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM3_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10740, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM3_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10780, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM3_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x107A0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM3_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x107A8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM3_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x107C8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM3_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x107D0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM3_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x107F0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_3[72]; - __IO uint32_t MBC_DOM4_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x10840, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM4_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10940, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM4_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10980, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM4_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x109A0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM4_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x109A8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM4_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x109C8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM4_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x109D0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM4_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x109F0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_4[72]; - __IO uint32_t MBC_DOM5_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x10A40, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM5_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10B40, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM5_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10B80, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM5_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10BA0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM5_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10BA8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM5_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10BC8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM5_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10BD0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM5_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10BF0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_5[72]; - __IO uint32_t MBC_DOM6_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x10C40, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM6_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10D40, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM6_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10D80, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM6_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10DA0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM6_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10DA8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM6_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10DC8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM6_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10DD0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM6_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10DF0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_7[72]; - __IO uint32_t MBC_DOM7_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x10E40, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM7_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10F40, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM7_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10F80, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM7_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10FA0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM7_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10FA8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM7_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10FC8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM7_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10FD0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM7_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10FF0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_8[72]; - __IO uint32_t MBC_DOM8_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x11040, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM8_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11140, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM8_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11180, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM8_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x111A0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM8_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x111A8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM8_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x111C8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM8_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x111D0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM8_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x111F0, array - step: index*0x2000, index2*0x4 */ - - __IO uint32_t MBC_DOM9_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x11240, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM9_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11340, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM9_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11380, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM9_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x113A0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM9_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x113A8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM9_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x113C8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM9_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x113D0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM9_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x113F0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_9[72]; - __IO uint32_t MBC_DOM10_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x11440, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM10_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11540, - array step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM10_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11580, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM10_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x115A0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM10_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x115A8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM10_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x115C8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM10_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x115D0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM10_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x115F0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_10[72]; - __IO uint32_t MBC_DOM11_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x11640, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM11_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11740, - array step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM11_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11780, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM11_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x117A0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM11_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x117A8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM11_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x117C8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM11_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x117D0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM11_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x117F0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_11[72]; - __IO uint32_t MBC_DOM12_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x11840, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM12_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11940, - array step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM12_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11980, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM12_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x119A0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM12_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x119A8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM12_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x119C8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM12_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x119D0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM12_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x119F0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_12[72]; - __IO uint32_t MBC_DOM13_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x11A40, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM13_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11B40, - array step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM13_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11B80, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM13_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11BA0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM13_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11BA8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM13_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11BC8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM13_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11BD0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM13_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11BF0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_13[72]; - __IO uint32_t MBC_DOM14_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x11C40, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM14_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11D40, - array step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM14_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11D80, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM14_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11DA0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM14_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11DA8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM14_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11DC8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM14_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11DD0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM14_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11DF0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_14[72]; - __IO uint32_t MBC_DOM15_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x11E40, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM15_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11F40, - array step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM15_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11F80, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM15_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11FA0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM15_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11FA8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM15_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11FC8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM15_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11FD0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM15_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11FF0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_15[8]; -} TRDC_MBC_Type; - -/*!@brief TRDC MRC control register definition. MRC_DOM0_RGD_W[region][word] */ -typedef struct _TRDC_MRC_Type -{ - __I uint32_t MRC_GLBCFG; /**< MRC Global Configuration Register, array offset: 0x14000, array step: 0x1000 */ - uint8_t RESERVED_0[12]; - __IO uint32_t - MRC_NSE_RGN_INDIRECT; /**< MRC NonSecure Enable Region Indirect, array offset: 0x14010, array step: 0x1000 */ - __O uint32_t MRC_NSE_RGN_SET; /**< MRC NonSecure Enable Region Set, array offset: 0x14014, array step: 0x1000 */ - __O uint32_t MRC_NSE_RGN_CLR; /**< MRC NonSecure Enable Region Clear, array offset: 0x14018, array step: 0x1000 */ - __O uint32_t - MRC_NSE_RGN_CLR_ALL; /**< MRC NonSecure Enable Region Clear All, array offset: 0x1401C, array step: 0x1000 */ - __IO uint32_t - MRC_GLBAC[8]; /**< MRC Global Access Control, array offset: 0x14020, array step: index*0x1000, index2*0x4 */ - __IO uint32_t MRC_DOM0_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14040, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM0_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x140C0, array step: 0x1000 */ - uint8_t RESERVED_1[124]; - __IO uint32_t MRC_DOM1_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14140, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM1_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x141C0, array step: 0x1000 */ - uint8_t RESERVED_2[124]; - __IO uint32_t MRC_DOM2_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14240, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM2_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x142C0, array step: 0x1000 */ - uint8_t RESERVED_3[124]; - __IO uint32_t MRC_DOM3_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14340, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM3_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x143C0, array step: 0x1000 */ - uint8_t RESERVED_4[124]; - __IO uint32_t MRC_DOM4_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14440, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM4_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x144C0, array step: 0x1000 */ - uint8_t RESERVED_5[124]; - __IO uint32_t MRC_DOM5_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14540, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM5_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x145C0, array step: 0x1000 */ - uint8_t RESERVED_6[124]; - __IO uint32_t MRC_DOM6_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14640, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM6_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x146C0, array step: 0x1000 */ - uint8_t RESERVED_7[124]; - __IO uint32_t MRC_DOM7_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14740, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM7_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x147C0, array step: 0x1000 */ - uint8_t RESERVED_8[124]; - __IO uint32_t MRC_DOM8_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14840, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM8_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x148C0, array step: 0x1000 */ - uint8_t RESERVED_9[124]; - __IO uint32_t MRC_DOM9_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14940, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM9_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x149C0, array step: 0x1000 */ - uint8_t RESERVED_10[124]; - __IO uint32_t MRC_DOM10_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14A40, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM10_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x14AC0, array step: 0x1000 */ - uint8_t RESERVED_11[124]; - __IO uint32_t MRC_DOM11_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14B40, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM11_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x14BC0, array step: 0x1000 */ - uint8_t RESERVED_12[124]; - __IO uint32_t MRC_DOM12_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14C40, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM12_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x14CC0, array step: 0x1000 */ - uint8_t RESERVED_13[124]; - __IO uint32_t MRC_DOM13_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14D40, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM13_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x14DC0, array step: 0x1000 */ - uint8_t RESERVED_14[124]; - __IO uint32_t MRC_DOM14_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14E40, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM14_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x14EC0, array step: 0x1000 */ - uint8_t RESERVED_15[124]; - __IO uint32_t MRC_DOM15_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14F40, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM15_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x14FC0, array step: 0x1000 */ -} TRDC_MRC_Type; - -/*!@brief TRDC base address convert macro */ -#define TRDC_GENERAL_BASE(base) ((TRDC_General_Type *)((base))) -#define TRDC_FLW_BASE(base) ((TRDC_FLW_Type *)(((uint32_t)(uintptr_t)(base) + (uint32_t)TRDC_FLW_OFFSET))) -#define TRDC_DOMAIN_ERROR_BASE(base) ((TRDC_DomainError_Type *)(((uint32_t)(uintptr_t)(base) + (uint32_t)TRDC_DOMAIN_ERROR_OFFSET))) -#define TRDC_DOMAIN_ASSIGNMENT_BASE(base) \ - ((TRDC_DomainAssignment_Type *)(((uint32_t)(uintptr_t)(base) + (uint32_t)TRDC_DOMAIN_ASSIGNMENT_OFFSET))) -#define TRDC_MBC_BASE(base, instance) \ - ((TRDC_MBC_Type *)((uint32_t)(uintptr_t)(base) + (uint32_t)TRDC_MBC_OFFSET(base) + (instance) * (uint32_t)TRDC_MBC_ARRAY_STEP)) -#define TRDC_MRC_BASE(base, instance) \ - ((TRDC_MRC_Type *)((uint32_t)(uintptr_t)(base) + (uint32_t)TRDC_MRC_OFFSET(base) + (instance) * (uint32_t)TRDC_MRC_ARRAY_STEP)) - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif - -/*! - * @} - */ - -#endif /* FSL_TRDC_CORE_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_trdc_soc.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_trdc_soc.h deleted file mode 100644 index 978a2ef2200..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_trdc_soc.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2024 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef _FSL_TRDC_SOC_H_ -#define _FSL_TRDC_SOC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup trdc_soc - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - /* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.trdc_soc" -#endif - -/*! @name Driver version */ -/*@{*/ -/*! @brief Driver version 2.0.0. */ -#define FSL_TRDC_SOC_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) -/*@}*/ - -#define TRDC_MBC_MEM_GLBCFG_NBLKS_MASK 0x000003FFUL -#define TRDC_MBC_MEM_GLBCFG_SIZE_LOG2_MASK 0x001F0000UL -#define TRDC_MBC_MEM_GLBCFG_SIZE_LOG2_SHIFT 16U -#define TRDC_MBC_NSE_BLK_CLR_ALL_MEMSEL(x) (((uint32_t)(x) & 0xFUL) << 8U) -#define TRDC_MBC_NSE_BLK_CLR_ALL_DID_SEL(x) (((uint32_t)(x) & 0x1UL) << 16U) - -/*!@brief TRDC feature */ -#define FSL_FEATURE_TRDC_DOMAIN_COUNT 1 - -/*!@brief TRDC base address convert macro */ -#define TRDC_MBC_COUNT 1 -#define TRDC_MBC_OFFSET(x) 0x0000 /* MBC register offset in TRDC_Type structure. */ -#define TRDC_MBC_ARRAY_STEP 0U /* Offset between two MBC control block, useless if there is only one. */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif - -/*! - * @} - */ - -#endif /* _FSL_TRDC_SOC_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_utick.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_utick.c deleted file mode 100644 index 0eea419cd34..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_utick.c +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2019, 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_utick.h" -#if !(defined(FSL_FEATURE_UTICK_HAS_NO_PDCFG) && FSL_FEATURE_UTICK_HAS_NO_PDCFG) -#include "fsl_power.h" -#endif -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.utick" -#endif - -/* Typedef for interrupt handler. */ -typedef void (*utick_isr_t)(UTICK_Type *base, utick_callback_t cb); - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Gets the instance from the base address - * - * @param base UTICK peripheral base address - * - * @return The UTICK instance - */ -static uint32_t UTICK_GetInstance(UTICK_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/* Array of UTICK handle. */ -static utick_callback_t s_utickHandle[FSL_FEATURE_SOC_UTICK_COUNT]; -/* Array of UTICK peripheral base address. */ -static UTICK_Type *const s_utickBases[] = UTICK_BASE_PTRS; -/* Array of UTICK IRQ number. */ -static const IRQn_Type s_utickIRQ[] = UTICK_IRQS; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/* Array of UTICK clock name. */ -static const clock_ip_name_t s_utickClock[] = UTICK_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_FEATURE_UTICK_HAS_NO_RESET) && FSL_FEATURE_UTICK_HAS_NO_RESET) -/*! @brief Pointers to UTICK resets for each instance. */ -static const reset_ip_name_t s_utickResets[] = UTICK_RSTS; -#endif - -/* UTICK ISR for transactional APIs. */ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -static utick_isr_t s_utickIsr = (utick_isr_t)DefaultISR; -#else -static utick_isr_t s_utickIsr; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t UTICK_GetInstance(UTICK_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_utickBases); instance++) - { - if (s_utickBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_utickBases)); - - return instance; -} - -/*! - * brief Starts UTICK. - * - * This function starts a repeat/onetime countdown with an optional callback - * - * param base UTICK peripheral base address. - * param mode UTICK timer mode (ie kUTICK_onetime or kUTICK_repeat) - * param count UTICK timer mode (ie kUTICK_onetime or kUTICK_repeat) - * param cb UTICK callback (can be left as NULL if none, otherwise should be a void func(void)) - * return none - */ -void UTICK_SetTick(UTICK_Type *base, utick_mode_t mode, uint32_t count, utick_callback_t cb) -{ - uint32_t instance; - - /* Get instance from peripheral base address. */ - instance = UTICK_GetInstance(base); - - /* Save the handle in global variables to support the double weak mechanism. */ - s_utickHandle[instance] = cb; -#if ((defined(FSL_FEATURE_SOC_SYSCON_COUNT) && (FSL_FEATURE_SOC_SYSCON_COUNT > 0)) && \ - !(defined(FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS) && FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS)) - EnableDeepSleepIRQ(s_utickIRQ[instance]); -#else - (void)EnableIRQ(s_utickIRQ[instance]); -#endif /* FSL_FEATURE_SOC_SYSCON_COUNT && !FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS */ - base->CTRL = count | UTICK_CTRL_REPEAT(mode); -} - -/*! - * brief Initializes an UTICK by turning its bus clock on - * - */ -void UTICK_Init(UTICK_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable utick clock */ - CLOCK_EnableClock(s_utickClock[UTICK_GetInstance(base)]); -#endif - -#if !(defined(FSL_FEATURE_UTICK_HAS_NO_RESET) && FSL_FEATURE_UTICK_HAS_NO_RESET) - RESET_PeripheralReset(s_utickResets[UTICK_GetInstance(base)]); -#endif - -#if !(defined(FSL_FEATURE_UTICK_HAS_NO_PDCFG) && FSL_FEATURE_UTICK_HAS_NO_PDCFG) - /* Power up Watchdog oscillator*/ - POWER_DisablePD(kPDRUNCFG_PD_WDT_OSC); -#endif - - s_utickIsr = UTICK_HandleIRQ; -} - -/*! - * brief Deinitializes a UTICK instance. - * - * This function shuts down Utick bus clock - * - * param base UTICK peripheral base address. - */ -void UTICK_Deinit(UTICK_Type *base) -{ - /* Turn off utick */ - base->CTRL = 0; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable utick clock */ - CLOCK_DisableClock(s_utickClock[UTICK_GetInstance(base)]); -#endif -} - -/*! - * brief Get Status Flags. - * - * This returns the status flag - * - * param base UTICK peripheral base address. - * return status register value - */ -uint32_t UTICK_GetStatusFlags(UTICK_Type *base) -{ - return (base->STAT); -} - -/*! - * brief Clear Status Interrupt Flags. - * - * This clears intr status flag - * - * param base UTICK peripheral base address. - * return none - */ -void UTICK_ClearStatusFlags(UTICK_Type *base) -{ - base->STAT = UTICK_STAT_INTR_MASK; -} - -/*! - * brief UTICK Interrupt Service Handler. - * - * This function handles the interrupt and refers to the callback array in the driver to callback user (as per request - * in UTICK_SetTick()). - * if no user callback is scheduled, the interrupt will simply be cleared. - * - * param base UTICK peripheral base address. - * param cb callback scheduled for this instance of UTICK - * return none - */ -void UTICK_HandleIRQ(UTICK_Type *base, utick_callback_t cb) -{ - UTICK_ClearStatusFlags(base); - if (cb != NULL) - { - cb(); - } -} - -#if defined(UTICK0) -void UTICK0_DriverIRQHandler(void); -void UTICK0_DriverIRQHandler(void) -{ - s_utickIsr(UTICK0, s_utickHandle[0]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#if defined(UTICK1) -void UTICK1_DriverIRQHandler(void); -void UTICK1_DriverIRQHandler(void) -{ - s_utickIsr(UTICK1, s_utickHandle[1]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#if defined(UTICK2) -void UTICK2_DriverIRQHandler(void); -void UTICK2_DriverIRQHandler(void) -{ - s_utickIsr(UTICK2, s_utickHandle[2]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#if defined(UTICK) -void UTICK_DriverIRQHandler(void); -void UTICK_DriverIRQHandler(void) -{ - s_utickIsr(UTICK, s_utickHandle[0]); - SDK_ISR_EXIT_BARRIER; -} -#endif diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_utick.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_utick.h deleted file mode 100644 index a3b734eae47..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_utick.h +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2019, 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_UTICK_H_ -#define FSL_UTICK_H_ - -#include "fsl_common.h" -/*! - * @addtogroup utick - * @{ - */ - -/*! @file*/ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief UTICK driver version 2.0.5. */ -#define FSL_UTICK_DRIVER_VERSION (MAKE_VERSION(2, 0, 5)) -/*! @} */ - -/*! @brief UTICK timer operational mode. */ -typedef enum _utick_mode -{ - kUTICK_Onetime = 0x0U, /*!< Trigger once*/ - kUTICK_Repeat = 0x1U, /*!< Trigger repeatedly */ -} utick_mode_t; - -/*! @brief UTICK callback function. */ -typedef void (*utick_callback_t)(void); - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* _cplusplus */ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Initializes an UTICK by turning its bus clock on - * - */ -void UTICK_Init(UTICK_Type *base); - -/*! - * @brief Deinitializes a UTICK instance. - * - * This function shuts down Utick bus clock - * - * @param base UTICK peripheral base address. - */ -void UTICK_Deinit(UTICK_Type *base); -/*! - * @brief Get Status Flags. - * - * This returns the status flag - * - * @param base UTICK peripheral base address. - * @return status register value - */ -uint32_t UTICK_GetStatusFlags(UTICK_Type *base); -/*! - * @brief Clear Status Interrupt Flags. - * - * This clears intr status flag - * - * @param base UTICK peripheral base address. - * @return none - */ -void UTICK_ClearStatusFlags(UTICK_Type *base); - -/*! - * @brief Starts UTICK. - * - * This function starts a repeat/onetime countdown with an optional callback - * - * @param base UTICK peripheral base address. - * @param mode UTICK timer mode (ie kUTICK_onetime or kUTICK_repeat) - * @param count UTICK timer mode (ie kUTICK_onetime or kUTICK_repeat) - * @param cb UTICK callback (can be left as NULL if none, otherwise should be a void func(void)) - * @return none - */ -void UTICK_SetTick(UTICK_Type *base, utick_mode_t mode, uint32_t count, utick_callback_t cb); -/*! - * @brief UTICK Interrupt Service Handler. - * - * This function handles the interrupt and refers to the callback array in the driver to callback user (as per request - * in UTICK_SetTick()). - * if no user callback is scheduled, the interrupt will simply be cleared. - * - * @param base UTICK peripheral base address. - * @param cb callback scheduled for this instance of UTICK - * @return none - */ -void UTICK_HandleIRQ(UTICK_Type *base, utick_callback_t cb); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_UTICK_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_vbat.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_vbat.c deleted file mode 100644 index 60f97571576..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_vbat.c +++ /dev/null @@ -1,498 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_vbat.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.mcx_vbat" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Configure internal 16kHz free running oscillator, including enabel FRO16k, gate FRO16k output. - * - * param base VBAT peripheral base address. - * param config Pointer to vbat_fro16k_config_t structure. - */ -void VBAT_ConfigFRO16k(VBAT_Type *base, const vbat_fro16k_config_t *config) -{ - assert(config != NULL); - - VBAT_EnableFRO16k(base, config->enableFRO16k); - VBAT_UngateFRO16k(base, config->enabledConnectionsMask); -} - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG) -/*! - * brief Set 32k crystal oscillator mode and load capacitance for the XTAL/EXTAL pin. - * - * param base VBAT peripheral base address. - * param operateMode Specify the crystal oscillator mode, please refer to vbat_osc32k_operate_mode_t. - * param xtalCap Specify the internal capacitance for the XTAL pin from the capacitor bank. - * param extalCap Specify the internal capacitance for the EXTAL pin from the capacitor bank. - * - * retval kStatus_VBAT_WrongCapacitanceValue The load capacitance value to set is not align with operate mode's - * requirements. - * retval kStatus_Success Success to set operate mode and load capacitance. - */ -status_t VBAT_SetCrystalOsc32kModeAndLoadCapacitance(VBAT_Type *base, - vbat_osc32k_operate_mode_t operateMode, - vbat_osc32k_load_capacitance_select_t xtalCap, - vbat_osc32k_load_capacitance_select_t extalCap) -{ - if (operateMode == kVBAT_Osc32kEnabledToTransconductanceMode) - { - if (((uint8_t)extalCap & 0x1U) == 0U) - { - return kStatus_VBAT_WrongCapacitanceValue; - } - } - - if (operateMode == kVBAT_Osc32kEnabledToLowPowerSwitchedMode) - { - if ((extalCap != kVBAT_Osc32kCrystalLoadCap0pF) && (xtalCap != kVBAT_Osc32kCrystalLoadCap0pF)) - { - return kStatus_VBAT_WrongCapacitanceValue; - } - } - - if (operateMode == kVBAT_Osc32kEnabledToLowPowerBackupMode) - { - if (((uint8_t)extalCap & 0x1U) != 0U) - { - return kStatus_VBAT_WrongCapacitanceValue; - } - } - - if ((xtalCap != kVBAT_Osc32kCrystalLoadCapBankDisabled) && (extalCap != kVBAT_Osc32kCrystalLoadCapBankDisabled)) - { - base->OSCCTLA |= VBAT_OSCCTLA_CAP_SEL_EN_MASK; - base->OSCCTLB &= ~VBAT_OSCCTLA_CAP_SEL_EN_MASK; - base->OSCCTLA = ((base->OSCCTLA & ~(VBAT_OSCCTLA_EXTAL_CAP_SEL_MASK | VBAT_OSCCTLA_XTAL_CAP_SEL_MASK)) | - (VBAT_OSCCTLA_XTAL_CAP_SEL(xtalCap) | VBAT_OSCCTLA_EXTAL_CAP_SEL(extalCap))); - base->OSCCTLB = ((base->OSCCTLB & ~(VBAT_OSCCTLA_EXTAL_CAP_SEL_MASK | VBAT_OSCCTLA_XTAL_CAP_SEL_MASK)) | - VBAT_OSCCTLA_XTAL_CAP_SEL(~(uint32_t)xtalCap) | VBAT_OSCCTLA_EXTAL_CAP_SEL(~(uint32_t)extalCap)); - } - - base->OSCCTLA = (((base->OSCCTLA & ~VBAT_OSCCTLA_MODE_EN_MASK)) | VBAT_OSCCTLA_MODE_EN(operateMode)); - base->OSCCTLB = ((base->OSCCTLB & ~VBAT_OSCCTLA_MODE_EN_MASK) | VBAT_OSCCTLA_MODE_EN(~(uint32_t)operateMode)); - - return kStatus_Success; -} -#endif /* FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG) -/*! - * brief Enable/disable Bandgap. - * - * note The FRO16K must be enabled before enableing the bandgap. - * note This setting can be locked by VBAT_LockRamLdoSettings() function. - * - * param base VBAT peripheral base address. - * param enable Used to enable/disable bandgap. - * - \b true Enable the bandgap. - * - \b false Disable the bandgap. - * - * retval kStatus_Success Success to enable/disable the bandgap. - * retval kStatus_VBAT_Fro16kNotEnabled Fail to enable the bandgap due to FRO16k is not enabled previously. - */ -status_t VBAT_EnableBandgap(VBAT_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - if (VBAT_CheckFRO16kEnabled(base)) - { - base->LDOCTLA |= VBAT_LDOCTLA_BG_EN_MASK; - base->LDOCTLB &= ~VBAT_LDOCTLA_BG_EN_MASK; - } - else - { - /* FRO16K must be enabled before enabling the Bandgap. */ - status = kStatus_VBAT_Fro16kNotEnabled; - } - } - else - { - base->LDOCTLA &= ~VBAT_LDOCTLA_BG_EN_MASK; - base->LDOCTLB |= VBAT_LDOCTLA_BG_EN_MASK; - } - - return status; -} - -/*! - * brief Enable/disable Backup RAM Regulator(RAM_LDO). - * - * note This setting can be locked by VBAT_LockRamLdoSettings() function. - * - * param base VBAT peripheral base address. - * param enable Used to enable/disable RAM_LDO. - * - \b true Enable backup SRAM regulator. - * - \b false Disable backup SRAM regulator. - * - * retval kStatusSuccess Success to enable/disable backup SRAM regulator. - * retval kStatus_VBAT_Fro16kNotEnabled Fail to enable backup SRAM regulator due to FRO16k is not enabled previously. - * retval kStatus_VBAT_BandgapNotEnabled Fail to enable backup SRAM regulator due to the bandgap is not enabled - * previously. - */ -status_t VBAT_EnableBackupSRAMRegulator(VBAT_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - if (VBAT_CheckFRO16kEnabled(base)) - { - if (VBAT_CheckBandgapEnabled(base)) - { - base->LDOCTLA |= VBAT_LDOCTLA_LDO_EN_MASK; - base->LDOCTLB &= ~VBAT_LDOCTLA_LDO_EN_MASK; - /* Polling until LDO is enabled. */ - while ((base->STATUSA & VBAT_STATUSA_LDO_RDY_MASK) == 0UL) - { - } - } - else - { - /* The bandgap must be enabled previously. */ - status = kStatus_VBAT_BandgapNotEnabled; - } - } - else - { - /* FRO16k must be enabled previously. */ - status = kStatus_VBAT_Fro16kNotEnabled; - } - } - else - { - base->LDOCTLA &= ~VBAT_LDOCTLA_LDO_EN_MASK; - base->LDOCTLB |= VBAT_LDOCTLA_LDO_EN_MASK; - } - - return status; -} - -/*! - * brief Switch the SRAM to be powered by VBAT. - * - * param base VBAT peripheral base address. - * - * retval kStatusSuccess Success to Switch SRAM powered by VBAT. - * retval kStatus_VBAT_Fro16kNotEnabled Fail to switch SRAM powered by VBAT due to FRO16K not enabled previously. - */ -status_t VBAT_SwitchSRAMPowerByLDOSRAM(VBAT_Type *base) -{ - status_t status = kStatus_Success; - - status = VBAT_EnableBandgap(base, true); - - if (status == kStatus_Success) - { - VBAT_EnableBandgapRefreshMode(base, true); - (void)VBAT_EnableBackupSRAMRegulator(base, true); - - /* Isolate the SRAM array */ - base->LDORAMC |= VBAT_LDORAMC_ISO_MASK; - /* Switch the supply to VBAT LDO. */ - base->LDORAMC |= VBAT_LDORAMC_SWI_MASK; - } - - return status; -} -#endif /* FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) && FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) -/*! - * brief Enable/disable Bandgap timer. - * - * note The bandgap timer is available when the bandgap is enabled and are clocked by the FRO16k. - * - * param base VBAT peripheral base address. - * param enable Used to enable/disable bandgap timer. - * param timerIdMask The mask of bandgap timer Id, should be the OR'ed value of vbat_bandgap_timer_id_t. - * - * retval kStatus_Success Success to enable/disable selected bandgap timer. - * retval kStatus_VBAT_Fro16kNotEnabled Fail to enable/disable selected bandgap timer due to FRO16k not enabled - * previously. retval kStatus_VBAT_BandgapNotEnabled Fail to enable/disable selected bandgap timer due to bandgap not - * enabled previously. - */ -status_t VBAT_EnableBandgapTimer(VBAT_Type *base, bool enable, uint8_t timerIdMask) -{ - status_t status = kStatus_Success; - - if (enable) - { - if (VBAT_CheckFRO16kEnabled(base)) - { - if (VBAT_CheckBandgapEnabled(base)) - { - if ((timerIdMask & (uint8_t)kVBAT_BandgapTimer0) != 0U) - { - base->LDOTIMER0 |= VBAT_LDOTIMER0_TIMEN_MASK; - } - - if ((timerIdMask & (uint8_t)kVBAT_BandgapTimer1) != 0U) - { - base->LDOTIMER1 |= VBAT_LDOTIMER1_TIMEN_MASK; - } - } - else - { - /* Bandgap must be enabled previously. */ - status = kStatus_VBAT_BandgapNotEnabled; - } - } - else - { - /* FRO16K must be enabled previously. */ - status = kStatus_VBAT_Fro16kNotEnabled; - } - } - else - { - if ((timerIdMask & (uint8_t)kVBAT_BandgapTimer0) != 0U) - { - base->LDOTIMER0 &= ~VBAT_LDOTIMER0_TIMEN_MASK; - } - - if ((timerIdMask & (uint8_t)kVBAT_BandgapTimer1) != 0U) - { - base->LDOTIMER1 &= ~VBAT_LDOTIMER1_TIMEN_MASK; - } - } - - return status; -} - -/*! - * brief Set bandgap timer0 timeout value. - * - * param base VBAT peripheral base address. - * param timeoutPeriod Bandgap timer timeout value, please refer to vbat_bandgap_timer0_timeout_period_t. - */ -void VBAT_SetBandgapTimer0TimeoutValue(VBAT_Type *base, vbat_bandgap_timer0_timeout_period_t timeoutPeriod) -{ - bool timerEnabled = false; - - timerEnabled = ((base->LDOTIMER0 & VBAT_LDOTIMER0_TIMEN_MASK) != 0UL) ? true : false; - - if (timerEnabled) - { - base->LDOTIMER0 &= ~VBAT_LDOTIMER0_TIMEN_MASK; - } - - base->LDOTIMER0 = ((base->LDOTIMER0 & (~VBAT_LDOTIMER0_TIMCFG_MASK)) | VBAT_LDOTIMER0_TIMCFG(timeoutPeriod)); - - if (timerEnabled) - { - base->LDOTIMER0 |= VBAT_LDOTIMER0_TIMEN_MASK; - } -} - -/*! - * brief Set bandgap timer1 timeout value. - * - * note The timeout value can only be changed when the timer is disabled. - * - * param base VBAT peripheral base address. - * param timeoutPeriod The bandgap timerout 1 period, in number of seconds, ranging from 0 to 65535s. - */ -void VBAT_SetBandgapTimer1TimeoutValue(VBAT_Type *base, uint32_t timeoutPeriod) -{ - bool timerEnabled = false; - - timerEnabled = ((base->LDOTIMER1 & VBAT_LDOTIMER1_TIMEN_MASK) != 0UL) ? true : false; - - if (timerEnabled) - { - base->LDOTIMER1 &= ~VBAT_LDOTIMER1_TIMEN_MASK; - } - - base->LDOTIMER1 = ((base->LDOTIMER1 & (~VBAT_LDOTIMER1_TIMCFG_MASK)) | VBAT_LDOTIMER1_TIMCFG(timeoutPeriod)); - - if (timerEnabled) - { - base->LDOTIMER1 |= VBAT_LDOTIMER1_TIMEN_MASK; - } -} -#endif /* FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) && FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) -/*! - * brief Initializes the VBAT clock monitor, enable clock monitor and set the clock monitor configuration. - * - * note Both FRO16K and OSC32K should be enabled and stable before invoking this function. - * - * param base VBAT peripheral base address. - * param config Pointer to vbat_clock_monitor_config_t structure. - * - * retval kStatus_Success Clock monitor is initialized successfully. - * retval kStatus_VBAT_Fro16kNotEnabled FRO16K is not enabled. - * retval kStatus_VBAT_Osc32kNotReady OSC32K is not ready. - * retval kStatus_VBAT_ClockMonitorLocked Clock monitor is locked. - */ -status_t VBAT_InitClockMonitor(VBAT_Type *base, const vbat_clock_monitor_config_t *config) -{ - assert(config != NULL); - - status_t status = kStatus_Success; - - if (VBAT_CheckFRO16kEnabled(base)) - { - if ((VBAT_GetStatusFlags(base) & kVBAT_StatusFlagOsc32kReady) != 0UL) - { - if (VBAT_CheckClockMonitorControlLocked(base)) - { - status = kStatus_VBAT_ClockMonitorLocked; - } - else - { - /* Disable clock monitor before configuring clock monitor. */ - VBAT_EnableClockMonitor(base, false); - /* Set clock monitor divide trim value. */ - VBAT_SetClockMonitorDivideTrim(base, config->divideTrim); - /* Set clock monitor frequency trim value. */ - VBAT_SetClockMonitorFrequencyTrim(base, config->freqTrim); - /* Enable clock monitor. */ - VBAT_EnableClockMonitor(base, true); - - if (config->lock) - { - VBAT_LockClockMonitorControl(base); - } - } - } - else - { - status = kStatus_VBAT_OSC32KNotReady; - } - } - else - { - status = kStatus_VBAT_Fro16kNotEnabled; - } - - return status; -} - -/*! - * brief Deinitialize the VBAT clock monitor. - * - * param base VBAT peripheral base address. - * - * retval kStatus_Success Clock monitor is de-initialized successfully. - * retval kStatus_VBAT_ClockMonitorLocked Control of Clock monitor is locked. - */ -status_t VBAT_DeinitMonitor(VBAT_Type *base) -{ - if (VBAT_CheckClockMonitorControlLocked(base)) - { - return kStatus_VBAT_ClockMonitorLocked; - } - - VBAT_EnableClockMonitor(base, false); - - return kStatus_Success; -} -#endif /* FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) && FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) -/*! - * brief Initialize tamper control. - * - * note Both FRO16K and bandgap should be enabled before calling this function. - * - * param base VBAT peripheral base address. - * param config Pointer to vbat_tamper_config_t structure. - * - * retval kStatus_Success Tamper is initialized successfully. - * retval kStatus_VBAT_TamperLocked Tamper control is locked. - * retval kStatus_VBAT_BandgapNotEnabled Bandgap is not enabled. - * retval kStatus_VBAT_Fro16kNotEnabled FRO 16K is not enabled. - */ -status_t VBAT_InitTamper(VBAT_Type *base, const vbat_tamper_config_t *config) -{ - assert(config != NULL); - - status_t status = kStatus_Success; - - if (VBAT_CheckFRO16kEnabled(base)) - { - if (VBAT_CheckBandgapEnabled(base)) - { - if (VBAT_CheckTamperControlLocked(base)) - { - return kStatus_VBAT_TamperLocked; - } - else - { - base->TAMCTLA = ((base->TAMCTLA & (~VBAT_TAMCTLA_VOLT_EN_MASK | VBAT_TAMCTLA_TEMP_EN_MASK)) | - VBAT_TAMCTLA_VOLT_EN(config->enableVoltageDetect) | - VBAT_TAMCTLA_TEMP_EN(config->enableTemperatureDetect)); - base->TAMCTLB = ((base->TAMCTLB & (~VBAT_TAMCTLA_VOLT_EN_MASK | VBAT_TAMCTLA_TEMP_EN_MASK)) | - VBAT_TAMCTLA_VOLT_EN((config->enableVoltageDetect) ? 0U : 1U) | - VBAT_TAMCTLA_TEMP_EN((config->enableTemperatureDetect) ? 0U : 1U)); - - if (config->lock) - { - VBAT_LockTamperControl(base); - } - } - } - else - { - status = kStatus_VBAT_BandgapNotEnabled; - } - } - else - { - status = kStatus_VBAT_Fro16kNotEnabled; - } - - return status; -} - -/*! - * brief De-initialize tamper control. - * - * param base VBAT peripheral base address. - * - * retval kStatus_Success Tamper is de-initialized successfully. - * retval kStatus_VBAT_TamperLocked Tamper control is locked. - */ -status_t VBAT_DeinitTamper(VBAT_Type *base) -{ - if (VBAT_CheckTamperControlLocked(base)) - { - return kStatus_VBAT_TamperLocked; - } - - base->TAMCTLA &= ~(VBAT_TAMCTLA_VOLT_EN_MASK | VBAT_TAMCTLA_TEMP_EN_MASK); - base->TAMCTLB |= (VBAT_TAMCTLA_VOLT_EN_MASK | VBAT_TAMCTLA_TEMP_EN_MASK); - - return kStatus_Success; -} -#endif /* FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_vbat.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_vbat.h deleted file mode 100644 index 5858b005eb9..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_vbat.h +++ /dev/null @@ -1,1386 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_VBAT_H_ -#define FSL_VBAT_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup mcx_vbat - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief VBAT driver version 2.3.1. */ -#define FSL_VBAT_DRIVER_VERSION (MAKE_VERSION(2, 3, 1)) -/*@}*/ - -#if !defined(VBAT_LDORAMC_RET_MASK) -#define VBAT_LDORAMC_RET_MASK (0xF00U) -#define VBAT_LDORAMC_RET_SHIFT (8U) -#define VBAT_LDORAMC_RET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDORAMC_RET_SHIFT)) & VBAT_LDORAMC_RET_MASK) -#endif - -/*! - * @brief The enumeration of VBAT module status. - */ -enum -{ - kStatus_VBAT_Fro16kNotEnabled = MAKE_STATUS(kStatusGroup_VBAT, 0), /*!< Internal 16kHz free running - oscillator not enabled. */ - kStatus_VBAT_BandgapNotEnabled = MAKE_STATUS(kStatusGroup_VBAT, 1), /*!< Bandgap not enabled. */ - kStatus_VBAT_WrongCapacitanceValue = MAKE_STATUS(kStatusGroup_VBAT, 2), /*!< Wrong capacitance for - selected oscillator mode. */ - kStatus_VBAT_ClockMonitorLocked = MAKE_STATUS(kStatusGroup_VBAT, 3), /*!< Clock monitor locked. */ - kStatus_VBAT_OSC32KNotReady = MAKE_STATUS(kStatusGroup_VBAT, 4), /*!< OSC32K not ready. */ - kStatus_VBAT_LDONotReady = MAKE_STATUS(kStatusGroup_VBAT, 5), /*!< LDO not ready. */ - kStatus_VBAT_TamperLocked = MAKE_STATUS(kStatusGroup_VBAT, 6), /*!< Tamper locked. */ -}; - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_STATUS_REG) && FSL_FEATURE_MCX_VBAT_HAS_STATUS_REG) -/*! - * @brief The enumeration of VBAT status flags. - * - * @anchor vbat_status_flag_t - */ -enum _vbat_status_flag -{ - kVBAT_StatusFlagPORDetect = VBAT_STATUSA_POR_DET_MASK, /*!< VBAT domain has been reset */ - kVBAT_StatusFlagWakeupPin = VBAT_STATUSA_WAKEUP_FLAG_MASK, /*!< A falling edge is detected on the wakeup pin. */ - kVBAT_StatusFlagBandgapTimer0 = VBAT_STATUSA_TIMER0_FLAG_MASK, /*!< Bandgap Timer0 period reached. */ - kVBAT_StatusFlagBandgapTimer1 = VBAT_STATUSA_TIMER1_FLAG_MASK, /*!< Bandgap Timer1 period reached. */ - kVBAT_StatusFlagLdoReady = VBAT_STATUSA_LDO_RDY_MASK, /*!< LDO is enabled and ready. */ - kVBAT_StatusFlagOsc32kReady = VBAT_STATUSA_OSC_RDY_MASK, /*!< OSC32k is enabled and clock is ready. */ -#if defined(VBAT_STATUSA_CLOCK_DET_MASK) - kVBAT_StatusFlagClockDetect = VBAT_STATUSA_CLOCK_DET_MASK, /*!< The clock monitor has detected an error. */ -#endif /* VBAT_STATUSA_CLOCK_DET_MASK */ - kVBAT_StatusFlagConfigDetect = VBAT_STATUSA_CONFIG_DET_MASK, /*!< Configuration error detected. */ -#if defined(VBAT_STATUSA_VOLT_DET_MASK) - kVBAT_StatusFlagVoltageDetect = VBAT_STATUSA_VOLT_DET_MASK, /*!< Voltage monitor has detected - an error with VBAT supply. */ -#endif /* VBAT_STATUSA_VOLT_DET_MASK */ -#if defined(VBAT_STATUSA_TEMP_DET_MASK) - kVBAT_StatusFlagTemperatureDetect = VBAT_STATUSA_TEMP_DET_MASK, /*!< Temperature monitor has detected an error. */ -#endif /* VBAT_STATUSA_TEMP_DET_MASK */ -#if defined(VBAT_STATUSA_SEC0_DET_MASK) - kVBAT_StatusFlagSec0Detect = VBAT_STATUSA_SEC0_DET_MASK, /*!< Security input 0 has detected an error. */ -#endif /* VBAT_STATUSA_SEC0_DET_MASK */ - kVBAT_StatusFlagInterrupt0Detect = VBAT_STATUSA_IRQ0_DET_MASK, /*!< Interrupt 0 asserted. */ - kVBAT_StatusFlagInterrupt1Detect = VBAT_STATUSA_IRQ1_DET_MASK, /*!< Interrupt 1 asserted. */ - kVBAT_StatusFlagInterrupt2Detect = VBAT_STATUSA_IRQ2_DET_MASK, /*!< Interrupt 2 asserted. */ - kVBAT_StatusFlagInterrupt3Detect = VBAT_STATUSA_IRQ3_DET_MASK, /*!< Interrupt 2 asserted. */ -}; - -/*! - * @brief The enumeration of VBAT interrupt enable. - * - * @anchor vbat_interrupt_enable_t - */ -enum _vbat_interrupt_enable -{ - kVBAT_InterruptEnablePORDetect = VBAT_IRQENA_POR_DET_MASK, /*!< Enable POR detect interrupt. */ - kVBAT_InterruptEnableWakeupPin = VBAT_IRQENA_WAKEUP_FLAG_MASK, /*!< Enable the interrupt when a falling edge is - detected on the wakeup pin. */ - kVBAT_InterruptEnableBandgapTimer0 = VBAT_IRQENA_TIMER0_FLAG_MASK, /*!< Enable the interrupt if Bandgap - Timer0 period reached. */ - kVBAT_InterruptEnableBandgapTimer1 = VBAT_IRQENA_TIMER1_FLAG_MASK, /*!< Enable the interrupt if Bandgap - Timer1 period reached. */ - kVBAT_InterruptEnableLdoReady = VBAT_IRQENA_LDO_RDY_MASK, /*!< Enable LDO ready interrupt. */ - kVBAT_InterruptEnableOsc32kReady = VBAT_IRQENA_OSC_RDY_MASK, /*!< Enable OSC32K ready interrupt. */ -#if defined(VBAT_IRQENA_CLOCK_DET_MASK) - kVBAT_InterruptEnableClockDetect = VBAT_IRQENA_CLOCK_DET_MASK, /*!< Enable clock monitor detect interrupt. */ -#endif /* VBAT_IRQENA_CLOCK_DET_MASK */ - kVBAT_InterruptEnableConfigDetect = - VBAT_IRQENA_CONFIG_DET_MASK, /*!< Enable configuration error detected interrupt. */ -#if defined(VBAT_IRQENA_VOLT_DET_MASK) - kVBAT_InterruptEnableVoltageDetect = VBAT_IRQENA_VOLT_DET_MASK, /*!< Enable voltage monitor detect interrupt. */ -#endif /* VBAT_IRQENA_VOLT_DET_MASK */ -#if defined(VBAT_IRQENA_TEMP_DET_MASK) - kVBAT_InterruptEnableTemperatureDetect = VBAT_IRQENA_TEMP_DET_MASK, /*!< Enable temperature monitor detect - interrupt. */ -#endif /* VBAT_IRQENA_TEMP_DET_MASK */ -#if defined(VBAT_IRQENA_SEC0_DET_MASK) - kVBAT_InterruptEnableSec0Detect = VBAT_IRQENA_SEC0_DET_MASK, /*!< Enable security input 0 detect interrupt. */ -#endif /* VBAT_IRQENA_SEC0_DET_MASK */ - kVBAT_InterruptEnableInterrupt0 = VBAT_IRQENA_IRQ0_DET_MASK, /*!< Enable the interrupt0. */ - kVBAT_InterruptEnableInterrupt1 = VBAT_IRQENA_IRQ1_DET_MASK, /*!< Enable the interrupt1. */ - kVBAT_InterruptEnableInterrupt2 = VBAT_IRQENA_IRQ2_DET_MASK, /*!< Enable the interrupt2. */ - kVBAT_InterruptEnableInterrupt3 = VBAT_IRQENA_IRQ3_DET_MASK, /*!< Enable the interrupt3. */ - - kVBAT_AllInterruptsEnable = - (VBAT_IRQENA_POR_DET_MASK | VBAT_IRQENA_WAKEUP_FLAG_MASK | VBAT_IRQENA_TIMER0_FLAG_MASK | - VBAT_IRQENA_TIMER1_FLAG_MASK | VBAT_IRQENA_LDO_RDY_MASK | VBAT_IRQENA_OSC_RDY_MASK | - VBAT_IRQENA_CONFIG_DET_MASK | VBAT_IRQENA_IRQ0_DET_MASK | VBAT_IRQENA_IRQ1_DET_MASK | - VBAT_IRQENA_IRQ2_DET_MASK | VBAT_IRQENA_IRQ3_DET_MASK), /*!< Enable all interrupts. */ -}; - -/*! - * @brief The enumeration of VBAT wakeup enable. - * - * @anchor vbat_wakeup_enable_t - */ -enum _vbat_wakeup_enable -{ - kVBAT_WakeupEnablePORDetect = VBAT_WAKENA_POR_DET_MASK, /*!< Enable POR detect wakeup. */ - kVBAT_WakeupEnableWakeupPin = VBAT_WAKENA_WAKEUP_FLAG_MASK, /*!< Enable wakeup feature when a falling edge is - detected on the wakeup pin. */ - kVBAT_WakeupEnableBandgapTimer0 = VBAT_WAKENA_TIMER0_FLAG_MASK, /*!< Enable wakeup feature when bandgap - timer0 period reached. */ - kVBAT_WakeupEnableBandgapTimer1 = VBAT_WAKENA_TIMER1_FLAG_MASK, /*!< Enable wakeup feature when bandgap - timer1 period reached. */ - kVBAT_WakeupEnableLdoReady = VBAT_WAKENA_LDO_RDY_MASK, /*!< Enable wakeup when LDO ready. */ - kVBAT_WakeupEnableOsc32kReady = VBAT_WAKENA_OSC_RDY_MASK, /*!< Enable wakeup when OSC32k ready. */ -#if defined(VBAT_WAKENA_CLOCK_DET_MASK) - kVBAT_WakeupEnableClockDetect = - VBAT_WAKENA_CLOCK_DET_MASK, /*!< Enable wakeup when clock monitor detect an error. */ -#endif /* VBAT_WAKENA_CLOCK_DET_MASK */ - kVBAT_WakeupEnableConfigDetect = VBAT_WAKENA_CONFIG_DET_MASK, /*!< Enable wakeup when - configuration error detected. */ -#if defined(VBAT_WAKENA_VOLT_DET_MASK) - kVBAT_WakeupEnableVoltageDetect = VBAT_WAKENA_VOLT_DET_MASK, /*!< Enable wakeup when voltage monitor detect an - error. */ -#endif /* VBAT_WAKENA_VOLT_DET_MASK */ -#if defined(VBAT_WAKENA_TEMP_DET_MASK) - kVBAT_WakeupEnableTemperatureDetect = VBAT_WAKENA_TEMP_DET_MASK, /*!< Enable wakeup when temperature monitor - detect an error. */ -#endif /* VBAT_WAKENA_TEMP_DET_MASK */ -#if defined(VBAT_WAKENA_SEC0_DET_MASK) - kVBAT_WakeupEnableSec0Detect = VBAT_WAKENA_SEC0_DET_MASK, /*!< Enable wakeup when security input 0 detect an - error. */ -#endif /* VBAT_WAKENA_SEC0_DET_MASK */ - kVBAT_WakeupEnableInterrupt0 = VBAT_WAKENA_IRQ0_DET_MASK, /*!< Enable wakeup when interrupt0 asserted. */ - kVBAT_WakeupEnableInterrupt1 = VBAT_WAKENA_IRQ1_DET_MASK, /*!< Enable wakeup when interrupt1 asserted. */ - kVBAT_WakeupEnableInterrupt2 = VBAT_WAKENA_IRQ2_DET_MASK, /*!< Enable wakeup when interrupt2 asserted. */ - kVBAT_WakeupEnableInterrupt3 = VBAT_WAKENA_IRQ3_DET_MASK, /*!< Enable wakeup when interrupt3 asserted. */ - - kVBAT_AllWakeupsEnable = (VBAT_WAKENA_POR_DET_MASK | VBAT_WAKENA_WAKEUP_FLAG_MASK | VBAT_WAKENA_TIMER0_FLAG_MASK | - VBAT_WAKENA_TIMER1_FLAG_MASK | VBAT_WAKENA_LDO_RDY_MASK | VBAT_WAKENA_OSC_RDY_MASK | - VBAT_WAKENA_CONFIG_DET_MASK | VBAT_WAKENA_IRQ0_DET_MASK | VBAT_WAKENA_IRQ1_DET_MASK | - VBAT_WAKENA_IRQ2_DET_MASK | VBAT_WAKENA_IRQ3_DET_MASK - -#if defined(VBAT_WAKENA_CLOCK_DET_MASK) - | VBAT_WAKENA_CLOCK_DET_MASK - -#endif /* VBAT_WAKENA_CLOCK_DET_MASK */ -#if defined(VBAT_WAKENA_VOLT_DET_MASK) - | VBAT_WAKENA_VOLT_DET_MASK - -#endif /* VBAT_WAKENA_VOLT_DET_MASK */ -#if defined(VBAT_WAKENA_TEMP_DET_MASK) - | VBAT_WAKENA_TEMP_DET_MASK - -#endif /* VBAT_WAKENA_TEMP_DET_MASK */ -#if defined(VBAT_WAKENA_SEC0_DET_MASK) - | VBAT_WAKENA_SEC0_DET_MASK - -#endif /* VBAT_WAKENA_SEC0_DET_MASK */ - ), /*!< Enable all wakeup. */ -}; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_STATUS_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) && FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) -/*! - * @brief The enumeration of VBAT tamper enable. - */ -enum _vbat_tamper_enable -{ - kVBAT_TamperEnablePOR = VBAT_TAMPERA_POR_DET_MASK, /*!< Enable tamper if POR asserted in STATUS register. */ - kVBAT_TamperEnableClockDetect = VBAT_TAMPERA_CLOCK_DET_MASK, /*!< Enable tamper if clock monitor detect an error. */ - kVBAT_TamperEnableConfigDetect = - VBAT_TAMPERA_CONFIG_DET_MASK, /*!< Enable tamper if configuration error detected. */ - kVBAT_TamperEnableVoltageDetect = VBAT_TAMPERA_VOLT_DET_MASK, /*!< Enable tamper if voltage monitor detect an - error. */ - kVBAT_TamperEnableTemperatureDetect = VBAT_TAMPERA_TEMP_DET_MASK, /*!< Enable tamper if temperature monitor - detect an error. */ - kVBAT_TamperEnableSec0Detect = VBAT_TAMPERA_SEC0_DET_MASK, /*!< Enable tamper if security input 0 detect an - error. */ -}; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) && FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) -/*! - * @brief The enumeration of bandgap timer id, VBAT support two bandgap timers. - * - * @anchor vbat_bandgap_timer_id_t - */ -enum _vbat_bandgap_timer_id -{ - kVBAT_BandgapTimer0 = 1U << 0U, /*!< Bandgap Timer0. */ - kVBAT_BandgapTimer1 = 1U << 1U, /*!< Bandgap Timer1. */ -}; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER */ - -/*! - * @brief The enumeration of connections for OSC32K/FRO32K output clock to other modules. - * - * @anchor vbat_clock_enable_t - */ -enum _vbat_clock_enable -{ - kVBAT_EnableClockToDomain0 = 1U << 0U, /*!< Enable clock to power domain0. */ - kVBAT_EnableClockToDomain1 = 1U << 1U, /*!< Enable clock to power domain1. */ - kVBAT_EnableClockToDomain2 = 1U << 2U, /*!< Enable clock to power domain2. */ - kVBAT_EnableClockToDomain3 = 1U << 3U, /*!< Enable clock to power domain3. */ -}; -#define kVBAT_EnableClockToVddBat kVBAT_EnableClockToDomain0 -#define kVBAT_EnableClockToVddSys kVBAT_EnableClockToDomain1 -#define kVBAT_EnableClockToVddWake kVBAT_EnableClockToDomain2 -#define kVBAT_EnableClockToVddMain kVBAT_EnableClockToDomain3 - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG) -/*! - * @brief The enumeration of SRAM arrays that controlled by VBAT. - * @anchor vbat_ram_array_t - */ -enum _vbat_ram_array -{ - kVBAT_SramArray0 = 1U << 0U, /*!< Specify SRAM array0 that controlled by VBAT. */ - kVBAT_SramArray1 = 1U << 1U, /*!< Specify SRAM array1 that controlled by VBAT. */ - kVBAT_SramArray2 = 1U << 2U, /*!< Specify SRAM array2 that controlled by VBAT. */ - kVBAT_SramArray3 = 1U << 3U, /*!< Specify SRAM array3 that controlled by VBAT. */ -}; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG */ - -/*! - * @brief The enumeration of bandgap refresh period. - */ -typedef enum _vbat_bandgap_refresh_period -{ - kVBAT_BandgapRefresh7P8125ms = 0U, /*!< Bandgap refresh every 7.8125ms. */ - kVBAT_BandgapRefresh15P625ms = 1U, /*!< Bandgap refresh every 15.625ms. */ - kVBAT_BandgapRefresh31P25ms = 2U, /*!< Bandgap refresh every 31.25ms. */ - kVBAT_BandgapRefresh62P5ms = 3U, /*!< Bandgap refresh every 62.5ms. */ -} vbat_bandgap_refresh_period_t; - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) && FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) -/*! - * @brief The enumeration of bandgap timer0 timeout period. - */ -typedef enum _vbat_bandgap_timer0_timeout_period -{ - kVBAT_BangapTimer0Timeout1s = 0U, /*!< Bandgap timer0 timerout every 1s. */ - kVBAT_BangapTimer0Timeout500ms = 1U, /*!< Bandgap timer0 timerout every 500ms. */ - kVBAT_BangapTimer0Timeout250ms = 2U, /*!< Bandgap timer0 timerout every 250ms. */ - kVBAT_BangapTimer0Timeout125ms = 3U, /*!< Bandgap timer0 timerout every 125ms. */ - kVBAT_BangapTimer0Timeout62P5ms = 4U, /*!< Bandgap timer0 timerout every 62.5ms. */ - kVBAT_BangapTimer0Timeout31P25ms = 5U, /*!< Bandgap timer0 timerout every 31.25ms. */ -} vbat_bandgap_timer0_timeout_period_t; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG) -/*! - * @brief The enumeration of osc32k operate mode, including Bypass mode, low power switched mode and so on. - */ -typedef enum _vbat_osc32k_operate_mode -{ - kVBAT_Osc32kEnabledToTransconductanceMode = 0U, /*!< Set to transconductance mode. */ - kVBAT_Osc32kEnabledToLowPowerBackupMode = 1U, /*!< Set to low power backup mode. */ - kVBAT_Osc32kEnabledToLowPowerSwitchedMode = 2U, /*!< Set to low power switched mode. */ -} vbat_osc32k_operate_mode_t; - -/*! - * @brief The enumeration of OSC32K load capacitance. - */ -typedef enum _vbat_osc32k_load_capacitance_select -{ - kVBAT_Osc32kCrystalLoadCap0pF = - 0U, /*!< Internal capacitance bank is enabled, set the internal capacitance to 0 pF. */ - kVBAT_Osc32kCrystalLoadCap2pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 2 pF. */ - kVBAT_Osc32kCrystalLoadCap4pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 4 pF. */ - kVBAT_Osc32kCrystalLoadCap6pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 6 pF. */ - kVBAT_Osc32kCrystalLoadCap8pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 8 pF. */ - kVBAT_Osc32kCrystalLoadCap10pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 10 pF. */ - kVBAT_Osc32kCrystalLoadCap12pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 12 pF. */ - kVBAT_Osc32kCrystalLoadCap14pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 14 pF. */ - kVBAT_Osc32kCrystalLoadCap16pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 16 pF. */ - kVBAT_Osc32kCrystalLoadCap18pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 18 pF. */ - kVBAT_Osc32kCrystalLoadCap20pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 20 pF. */ - kVBAT_Osc32kCrystalLoadCap22pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 22 pF. */ - kVBAT_Osc32kCrystalLoadCap24pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 24 pF. */ - kVBAT_Osc32kCrystalLoadCap26pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 26 pF. */ - kVBAT_Osc32kCrystalLoadCap28pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 28 pF. */ - kVBAT_Osc32kCrystalLoadCap30pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 30 pF. */ - kVBAT_Osc32kCrystalLoadCapBankDisabled = 0xF0U, /*!< Internal capacitance bank is disabled. */ -} vbat_osc32k_load_capacitance_select_t; - -/*! - * @brief The enumeration of start-up time of the oscillator. - */ -typedef enum _vbat_osc32k_start_up_time -{ - kVBAT_Osc32kStartUpTime8Sec = 0U, /*!< Configure the start-up time as 8 seconds. */ - kVBAT_Osc32kStartUpTime4Sec, /*!< Configure the start-up time as 4 seconds. */ - kVBAT_Osc32kStartUpTime2Sec, /*!< Configure the start-up time as 2 seconds. */ - kVBAT_Osc32kStartUpTime1Sec, /*!< Configure the start-up time as 1 seconds. */ - kVBAT_Osc32kStartUpTime0P5Sec, /*!< Configure the start-up time as 0.5 seconds. */ - kVBAT_Osc32kStartUpTime0P25Sec, /*!< Configure the start-up time as 0.25 seconds. */ - kVBAT_Osc32kStartUpTime0P125Sec, /*!< Configure the start-up time as 0.125 seconds. */ - kVBAT_Osc32kStartUpTime0P5MSec, /*!< Configure the start-up time as 0.5 milliseconds. */ -} vbat_osc32k_start_up_time_t; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_SWICTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_SWICTL_REG) -/*! - * @brief The enumeration of VBAT module supplies. - */ -typedef enum _vbat_internal_module_supply -{ - kVBAT_ModuleSuppliedByVddBat = 0U, /*!< VDD_BAT supplies VBAT modules. */ - kVBAT_ModuleSuppliedByVddSys = 1U, /*!< VDD_SYS supplies VBAT modules. */ -} vbat_internal_module_supply_t; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_SWICTL_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) && FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) -/*! - * @brief The enumeration of VBAT clock monitor divide trim value - */ -typedef enum _vbat_clock_monitor_divide_trim -{ - kVBAT_ClockMonitorOperateAt1kHz = 0U, /*!< Clock monitor operates at 1 kHz. */ - kVBAT_ClockMonitorOperateAt64Hz = 1U, /*!< Clock monitor operates at 64 Hz. */ -} vbat_clock_monitor_divide_trim_t; - -/*! - * @brief The enumeration of VBAT clock monitor frequency trim value used to adjust the clock monitor assert. - */ -typedef enum _vbat_clock_monitor_freq_trim -{ - kVBAT_ClockMonitorAssert2Cycle = 0U, /*!< Clock monitor assert 2 cycles after expected edge. */ - kVBAT_ClockMonitorAssert4Cycle = 1U, /*!< Clock monitor assert 4 cycles after expected edge. */ - kVBAT_ClockMonitorAssert6Cycle = 2U, /*!< Clock monitor assert 8 cycles after expected edge. */ - kVBAT_ClockMonitorAssert8Cycle = 3U, /*!< Clock monitor assert 8 cycles after expected edge. */ -} vbat_clock_monitor_freq_trim_t; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG */ - -/*! - * @brief The structure of internal 16kHz free running oscillator attributes. - */ -typedef struct _vbat_fro16k_config -{ - bool enableFRO16k; /*!< Enable/disable internal 16kHz free running oscillator. */ - uint8_t enabledConnectionsMask; /*!< The mask of connected modules to enable FRO16k clock output. */ -} vbat_fro16k_config_t; - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) && FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) -/*! - * @brief The structure of internal clock monitor, including divide trim and frequency trim. - */ -typedef struct _vbat_clock_monitor_config -{ - vbat_clock_monitor_divide_trim_t divideTrim : 1U; /* !< Divide trim value, please - refer to @ref vbat_clock_monitor_divide_trim_t */ - vbat_clock_monitor_freq_trim_t freqTrim : 2U; /*!< Frequency trim value used to adjust the clock monitor - assert, please refer to @ref vbat_clock_monitor_freq_trim_t. */ - bool lock : 1U; /*!< Lock the clock monitor control after enabled. */ -} vbat_clock_monitor_config_t; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) && FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) -/*! - * @brief The structure of Tamper configuration. - */ -typedef struct _vbat_tamper_config -{ - bool enableVoltageDetect : 1U; /*!< Enable/disable voltage detection. */ - bool enableTemperatureDetect : 1U; /*!< Enable/disable temperature detection. */ - bool lock : 1U; /*!< Lock the tamper control after enabled. */ -} vbat_tamper_config_t; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name FRO16K Control Interfaces - * @{ - */ - -/*! - * @brief Configure internal 16kHz free running oscillator, including enabel FRO16k, gate FRO16k output. - * - * @param base VBAT peripheral base address. - * @param config Pointer to @ref vbat_fro16k_config_t structure. - */ -void VBAT_ConfigFRO16k(VBAT_Type *base, const vbat_fro16k_config_t *config); - -/*! - * @brief Enable/disable internal 16kHz free running oscillator. - * - * @param base VBAT peripheral base address. - * @param enable Used to enable/disable 16kHz FRO. - * - \b true Enable internal 16kHz free running oscillator. - * - \b false Disable internal 16kHz free running oscillator. - */ -static inline void VBAT_EnableFRO16k(VBAT_Type *base, bool enable) -{ - if (enable) - { - base->FROCTLA |= VBAT_FROCTLA_FRO_EN_MASK; -#if (defined(VBAT_FROCTLB_INVERSE_MASK)) - base->FROCTLB &= ~VBAT_FROCTLB_INVERSE_MASK; -#endif /* VBAT_FROCTLB_INVERSE_MASK */ - } - else - { - base->FROCTLA &= ~VBAT_FROCTLA_FRO_EN_MASK; -#if (defined(VBAT_FROCTLB_INVERSE_MASK)) - base->FROCTLB |= VBAT_FROCTLB_INVERSE_MASK; -#endif /* VBAT_FROCTLB_INVERSE_MASK */ - } -} - -/*! - * @brief Check if internal 16kHz free running oscillator is enabled. - * - * @param base VBAT peripheral base address. - * - * @retval true The internal 16kHz Free running oscillator is enabled. - * @retval false The internal 16kHz Free running oscillator is enabled. - */ -static inline bool VBAT_CheckFRO16kEnabled(VBAT_Type *base) -{ - return (bool)((base->FROCTLA & VBAT_FROCTLA_FRO_EN_MASK) == VBAT_FROCTLA_FRO_EN_MASK); -} - -/*! - * @brief Enable FRO16kHz output clock to selected modules. - * - * @param base VBAT peripheral base address. - * @param connectionsMask The mask of modules that FRO16k is connected, should be the OR'ed - * value of @ref vbat_clock_enable_t. - */ -static inline void VBAT_UngateFRO16k(VBAT_Type *base, uint8_t connectionsMask) -{ - base->FROCLKE |= VBAT_FROCLKE_CLKE(connectionsMask); -} - -/*! - * @brief Disable FRO16kHz output clock to selected modules. - * - * @param base VBAT peripheral base address. - * @param connectionsMask The OR'ed value of @ref vbat_clock_enable_t. - */ -static inline void VBAT_GateFRO16k(VBAT_Type *base, uint8_t connectionsMask) -{ - base->FROCLKE &= ~VBAT_FROCLKE_CLKE(connectionsMask); -} - -/*! - * @brief Lock settings of internal 16kHz free running oscillator, please note that if locked 16kHz FRO's settings can - * not be updated until the next POR. - * - * @note Please note that the operation to ungate/gate FRO 16kHz output clock can not be locked by this function. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_LockFRO16kSettings(VBAT_Type *base) -{ - base->FROLCKA |= VBAT_FROLCKA_LOCK_MASK; -#if (defined(VBAT_FROLCKB_LOCK_MASK)) - base->FROLCKB &= ~VBAT_FROLCKB_LOCK_MASK; -#endif /* VBAT_FROLCKB_LOCK_MASK */ -} - -/*! - * @brief Check if FRO16K settings are locked. - * - * @param base VBAT peripheral base address. - * - * @return @c true in case of FRO16k settings are locked, @c false in case of FRO16k settings are not locked. - */ -static inline bool VBAT_CheckFRO16kSettingsLocked(VBAT_Type *base) -{ - return ((base->FROLCKA & VBAT_FROLCKA_LOCK_MASK) != 0UL); -} - -/*! @} */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG) -/*! - * @name OSC32K Control Interfaces - * @{ - */ - -/*! - * @brief Enable/disable 32K Crystal Oscillator. - * - * @param base VBAT peripheral base address. - * @param enable Used to enable/disable 32k Crystal Oscillator: - * - \b true Enable crystal oscillator and polling status register to check clock is ready. - * - \b false Disable crystal oscillator. - */ -static inline void VBAT_EnableCrystalOsc32k(VBAT_Type *base, bool enable) -{ - if (enable) - { - base->OSCCTLA |= VBAT_OSCCTLA_OSC_EN_MASK; - base->OSCCTLB &= ~VBAT_OSCCTLA_OSC_EN_MASK; - - /* Polling status register to check clock is ready. */ - while ((base->STATUSA & VBAT_STATUSA_OSC_RDY_MASK) == 0UL) - {} - } - else - { - base->OSCCTLA &= ~VBAT_OSCCTLA_OSC_EN_MASK; - base->OSCCTLB |= VBAT_OSCCTLA_OSC_EN_MASK; - } -} - -/*! - * @brief Bypass 32k crystal oscillator, the clock is still output by oscillator but this clock is the same as clock - * provided on EXTAL pin. - * - * @note In bypass mode, oscillator must be enabled; To exit bypass mode, oscillator must be disabled. - * - * @param base VBAT peripheral base address. - * @param enableBypass Used to enter/exit bypass mode: - * - \b true Enter into bypass mode; - * - \b false Exit bypass mode. - */ -static inline void VBAT_BypassCrystalOsc32k(VBAT_Type *base, bool enableBypass) -{ - if (enableBypass) - { - base->OSCCTLA |= (VBAT_OSCCTLA_OSC_EN_MASK | VBAT_OSCCTLA_OSC_BYP_EN_MASK); - base->OSCCTLB &= ~(VBAT_OSCCTLA_OSC_EN_MASK | VBAT_OSCCTLA_OSC_BYP_EN_MASK); - } - else - { - base->OSCCTLA &= ~(VBAT_OSCCTLA_OSC_EN_MASK | VBAT_OSCCTLA_OSC_BYP_EN_MASK); - base->OSCCTLB |= (VBAT_OSCCTLA_OSC_EN_MASK | VBAT_OSCCTLA_OSC_BYP_EN_MASK); - } -} - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_OSCCTLA_FINE_AMP_GAIN_BIT) && FSL_FEATURE_MCX_VBAT_HAS_OSCCTLA_FINE_AMP_GAIN_BIT) -/*! - * @brief Adjust 32k crystal oscillator amplifier gain. - * - * @param base VBAT peripheral base address. - * @param coarse Specify amplifier coarse trim value. - * @param fine Specify amplifier fine trim value. - */ -static inline void VBAT_AdjustCrystalOsc32kAmplifierGain(VBAT_Type *base, uint8_t coarse, uint8_t fine) -{ - base->OSCCTLA = ((base->OSCCTLA & ~(VBAT_OSCCTLA_COARSE_AMP_GAIN_MASK | VBAT_OSCCTLA_FINE_AMP_GAIN_MASK)) | - (VBAT_OSCCTLA_COARSE_AMP_GAIN(coarse) | VBAT_OSCCTLA_FINE_AMP_GAIN(fine))); - base->OSCCTLB = ((base->OSCCTLB & ~(VBAT_OSCCTLA_COARSE_AMP_GAIN_MASK | VBAT_OSCCTLA_FINE_AMP_GAIN_MASK)) | - (VBAT_OSCCTLA_COARSE_AMP_GAIN(~coarse) | VBAT_OSCCTLA_FINE_AMP_GAIN(~fine))); -} -#else -/*! - * @brief Adjust 32k crystal oscillator amplifier gain. - * - * @param base VBAT peripheral base address. - * @param coarse Specify amplifier coarse trim value. - */ -static inline void VBAT_AdjustCrystalOsc32kAmplifierGain(VBAT_Type *base, uint8_t coarse) -{ - base->OSCCTLA = (base->OSCCTLA & ~VBAT_OSCCTLA_COARSE_AMP_GAIN_MASK) | (VBAT_OSCCTLA_COARSE_AMP_GAIN(coarse)); - base->OSCCTLB = (base->OSCCTLB & ~VBAT_OSCCTLA_COARSE_AMP_GAIN_MASK) | (VBAT_OSCCTLA_COARSE_AMP_GAIN(~(uint32_t)coarse)); -} - -#endif /* */ - -/*! - * @brief Set 32k crystal oscillator mode and load capacitance for the XTAL/EXTAL pin. - * - * @param base VBAT peripheral base address. - * @param operateMode Specify the crystal oscillator mode, please refer to @ref vbat_osc32k_operate_mode_t. - * @param xtalCap Specify the internal capacitance for the XTAL pin from the capacitor bank. - * @param extalCap Specify the internal capacitance for the EXTAL pin from the capacitor bank. - * - * @retval kStatus_VBAT_WrongCapacitanceValue The load capacitance value to set is not align with operate mode's - * requirements. - * @retval kStatus_Success Success to set operate mode and load capacitance. - */ -status_t VBAT_SetCrystalOsc32kModeAndLoadCapacitance(VBAT_Type *base, - vbat_osc32k_operate_mode_t operateMode, - vbat_osc32k_load_capacitance_select_t xtalCap, - vbat_osc32k_load_capacitance_select_t extalCap); - -/*! - * @brief Trim 32k crystal oscillator startup time. - * - * @param base VBAT peripheral base address. - * @param startupTime Specify the startup time of the oscillator. - */ -static inline void VBAT_TrimCrystalOsc32kStartupTime(VBAT_Type *base, vbat_osc32k_start_up_time_t startupTime) -{ - base->OSCCFGA = ((base->OSCCFGA & ~(VBAT_OSCCFGA_INIT_TRIM_MASK)) | VBAT_OSCCFGA_INIT_TRIM(startupTime)); - base->OSCCFGB = ((base->OSCCFGB & ~(VBAT_OSCCFGA_INIT_TRIM_MASK)) | VBAT_OSCCFGA_INIT_TRIM(~((uint32_t)startupTime))); -} - -/*! - * @brief Set crystal oscillator comparator trim value when oscillator is set as low power switch mode. - * - * @param base VBAT peripheral base address. - * @param comparatorTrimValue Comparator trim value, ranges from 0 to 7. - */ -static inline void VBAT_SetOsc32kSwitchModeComparatorTrimValue(VBAT_Type *base, uint8_t comparatorTrimValue) -{ - base->OSCCFGA = ((base->OSCCFGA & ~VBAT_OSCCFGA_CMP_TRIM_MASK) | VBAT_OSCCFGA_CMP_TRIM(comparatorTrimValue)); - base->OSCCFGB = ((base->OSCCFGB & ~VBAT_OSCCFGA_CMP_TRIM_MASK) | VBAT_OSCCFGA_CMP_TRIM(~((uint32_t)comparatorTrimValue))); -} - -/*! - * @brief Set crystal oscillator delay trim value when oscillator is set as low power switch mode. - * - * @param base VBAT peripheral base address. - * @param delayTrimValue Delay trim value, ranges from 0 to 15. - */ -static inline void VBAT_SetOsc32kSwitchModeDelayTrimValue(VBAT_Type *base, uint8_t delayTrimValue) -{ - base->OSCCFGA = ((base->OSCCFGA & ~VBAT_OSCCFGA_DLY_TRIM_MASK) | VBAT_OSCCFGA_DLY_TRIM(delayTrimValue)); - base->OSCCFGB = ((base->OSCCFGB & ~VBAT_OSCCFGA_DLY_TRIM_MASK) | VBAT_OSCCFGA_DLY_TRIM(~((uint32_t)delayTrimValue))); -} - -/*! - * @brief Set crystal oscillator capacitor trim value when oscillator is set as low power switch mode. - * - * @param base VBAT peripheral base address. - * @param capacitorTrimValue Capacitor value to trim, ranges from 0 to 3. - */ -static inline void VBAT_SetOsc32kSwitchModeCapacitorTrimValue(VBAT_Type *base, uint8_t capacitorTrimValue) -{ - base->OSCCFGA = ((base->OSCCFGA & ~VBAT_OSCCFGA_CAP_TRIM_MASK) | VBAT_OSCCFGA_CAP_TRIM(capacitorTrimValue)); - base->OSCCFGB = ((base->OSCCFGB & ~VBAT_OSCCFGA_CAP_TRIM_MASK) | VBAT_OSCCFGA_CAP_TRIM(~((uint32_t)capacitorTrimValue))); -} - -/*! - * @brief Lock Osc32k settings, after locked all writes to the Oscillator registers are blocked. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_LookOsc32kSettings(VBAT_Type *base) -{ - base->OSCLCKA |= VBAT_OSCLCKA_LOCK_MASK; - base->OSCLCKB &= ~VBAT_OSCLCKB_LOCK_MASK; -} - -/*! - * @brief Unlock Osc32k settings. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_UnlockOsc32kSettings(VBAT_Type *base) -{ - base->OSCLCKA &= ~VBAT_OSCLCKA_LOCK_MASK; - base->OSCLCKB |= VBAT_OSCLCKB_LOCK_MASK; -} - -/*! - * @brief Check if osc32k settings are locked. - * - * @param base VBAT peripheral base address. - * @return \c true in case of osc32k settings are locked, \c false in case of osc32k settings are not locked. - */ -static inline bool VBAT_CheckOsc32kSettingsLocked(VBAT_Type *base) -{ - return ((base->OSCLCKA & VBAT_OSCLCKA_LOCK_MASK) != 0UL); -} - -/*! - * @brief Enable OSC32k output clock to selected modules. - * - * @param base VBAT peripheral base address. - * @param connectionsMask The OR'ed value of @ref vbat_clock_enable_t. - */ -static inline void VBAT_UngateOsc32k(VBAT_Type *base, uint8_t connectionsMask) -{ - base->OSCCLKE |= VBAT_OSCCLKE_CLKE(connectionsMask); -} - -/*! - * @brief Disable OSC32k output clock to selected modules. - * - * @param base VBAT peripheral base address. - * @param connectionsMask The OR'ed value of @ref vbat_clock_enable_t. - */ -static inline void VBAT_GateOsc32k(VBAT_Type *base, uint8_t connectionsMask) -{ - base->OSCCLKE &= ~VBAT_OSCCLKE_CLKE(connectionsMask); -} - -/*! @} */ -#endif /* FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG) -/*! - * @name RAM_LDO Control Interfaces - * @{ - */ - -/*! - * @brief Enable/disable Bandgap. - * - * @note The FRO16K must be enabled before enabling the bandgap. - * @note This setting can be locked by VBAT_LockRamLdoSettings() function. - * - * @param base VBAT peripheral base address. - * @param enable Used to enable/disable bandgap. - * - \b true Enable the bandgap. - * - \b false Disable the bandgap. - * - * @retval kStatus_Success Success to enable/disable the bandgap. - * @retval kStatus_VBAT_Fro16kNotEnabled Fail to enable the bandgap due to FRO16k is not enabled previously. - */ -status_t VBAT_EnableBandgap(VBAT_Type *base, bool enable); - -/*! - * @brief Check if bandgap is enabled. - * - * @param base VBAT peripheral base address. - * - * @retval true The bandgap is enabled. - * @retval false The bandgap is disabled. - */ -static inline bool VBAT_CheckBandgapEnabled(VBAT_Type *base) -{ - return (bool)((base->LDOCTLA & VBAT_LDOCTLA_BG_EN_MASK) == VBAT_LDOCTLA_BG_EN_MASK); -} - -/*! - * @brief Enable/disable bandgap low power refresh mode. - * - * @note For lowest power consumption, refresh mode must be enabled. - * @note This setting can be locked by VBAT_LockRamLdoSettings() function. - * - * @param base VBAT peripheral base address. - * @param enableRefreshMode Used to enable/disable bandgap low power refresh mode. - * - \b true Enable bandgap low power refresh mode. - * - \b false Disable bandgap low power refresh mode. - */ -static inline void VBAT_EnableBandgapRefreshMode(VBAT_Type *base, bool enableRefreshMode) -{ - if (enableRefreshMode) - { - base->LDOCTLA |= VBAT_LDOCTLA_REFRESH_EN_MASK; - base->LDOCTLB &= ~VBAT_LDOCTLA_REFRESH_EN_MASK; - } - else - { - base->LDOCTLA &= ~VBAT_LDOCTLA_REFRESH_EN_MASK; - base->LDOCTLB |= VBAT_LDOCTLA_REFRESH_EN_MASK; - } -} - -/*! - * @brief Enable/disable Backup RAM Regulator(RAM_LDO). - * - * @note This setting can be locked by VBAT_LockRamLdoSettings() function. - * - * @param base VBAT peripheral base address. - * @param enable Used to enable/disable RAM_LDO. - * - \b true Enable backup SRAM regulator. - * - \b false Disable backup SRAM regulator. - * - * @retval kStatusSuccess Success to enable/disable backup SRAM regulator. - * @retval kStatus_VBAT_Fro16kNotEnabled Fail to enable backup SRAM regulator due to FRO16k is not enabled previously. - * @retval kStatus_VBAT_BandgapNotEnabled Fail to enable backup SRAM regulator due to the bandgap is not enabled - * previously. - */ -status_t VBAT_EnableBackupSRAMRegulator(VBAT_Type *base, bool enable); - -/*! - * @brief Lock settings of RAM_LDO, please note that if locked then RAM_LDO's settings - * can not be updated until the next POR. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_LockRamLdoSettings(VBAT_Type *base) -{ - base->LDOLCKA |= VBAT_LDOLCKA_LOCK_MASK; - base->LDOLCKB &= ~VBAT_LDOLCKA_LOCK_MASK; -} - -/*! - * @brief Check if RAM_LDO settings is locked. - * - * @param base VBAT peripheral base address. - * @return @c true in case of RAM_LDO settings are locked, @c false in case of RAM_LDO settings are unlocked. - */ -static inline bool VBAT_CheckRamLdoSettingsLocked(VBAT_Type *base) -{ - return ((base->LDOLCKA & VBAT_LDOLCKA_LOCK_MASK) != 0UL); -} - -/*! - * @brief Switch the SRAM to be powered by LDO_RAM. - * - * @note This function can be used to switch the SRAM to the VBAT retention supply at any time, but please note that the - * SRAM must not be accessed during this time. - * @note Invoke this function to switch power supply before switching off external power. - * @note RAM_LDO must be enabled before invoking this function. - * @note To access the SRAM arrays retained by the LDO_RAM, please invoke VBAT_SwitchSRAMPowerBySocSupply(), after - * external power is switched back on. - * - * @param base VBAT peripheral base address. - * - * @retval kStatusSuccess Success to Switch SRAM powered by VBAT. - * @retval kStatus_VBAT_Fro16kNotEnabled Fail to switch SRAM powered by VBAT due to FRO16K not enabled previously. - */ -status_t VBAT_SwitchSRAMPowerByLDOSRAM(VBAT_Type *base); - -/*! - * @brief Switch the RAM to be powered by Soc Supply in software mode. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_SwitchSRAMPowerBySocSupply(VBAT_Type *base) -{ - base->LDORAMC &= ~VBAT_LDORAMC_SWI_MASK; - base->LDORAMC &= ~VBAT_LDORAMC_ISO_MASK; -} - -/*! - * @brief Power off selected SRAM array in low power modes. - * - * @param base VBAT peripheral base address. - * @param sramMask The mask of SRAM array to power off, should be the OR'ed value of @ref vbat_ram_array_t. - */ -static inline void VBAT_PowerOffSRAMsInLowPowerModes(VBAT_Type *base, uint8_t sramMask) -{ - base->LDORAMC |= (uint32_t)VBAT_LDORAMC_RET(sramMask); -} - -/*! - * @brief Retain selected SRAM array in low power modes. - * - * @param base VBAT peripheral base address. - * @param sramMask The mask of SRAM array to retain, should be the OR'ed value of @ref vbat_ram_array_t. - */ -static inline void VBAT_RetainSRAMsInLowPowerModes(VBAT_Type *base, uint8_t sramMask) -{ - base->LDORAMC &= ~(uint32_t)VBAT_LDORAMC_RET(sramMask); -} - -/*! - * @brief Enable/disable SRAM isolation. - * - * @param base VBAT peripheral base address. - * @param enable Used to enable/disable SRAM violation. - * - \b true SRAM will be isolated. - * - \b false SRAM state follows the SoC power modes. - */ -static inline void VBAT_EnableSRAMIsolation(VBAT_Type *base, bool enable) -{ - if (enable) - { - base->LDORAMC |= VBAT_LDORAMC_ISO_MASK; - } - else - { - base->LDORAMC &= ~VBAT_LDORAMC_ISO_MASK; - } -} - -/*! @} */ -#endif /* FSL_FEATURE_MCX_VBAT_HAS_RAM_LDO */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) && FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) -/*! @name Bandgap Timer Control Interfaces - * @{ - */ - -/*! - * @brief Enable/disable Bandgap timer. - * - * @note The bandgap timer is available when the bandgap is enabled and are clocked by the FRO16k. - * - * @param base VBAT peripheral base address. - * @param enable Used to enable/disable bandgap timer. - * @param timerIdMask The mask of bandgap timer Id, should be the OR'ed value of @ref vbat_bandgap_timer_id_t. - * - * @retval kStatus_Success Success to enable/disable selected bandgap timer. - * @retval kStatus_VBAT_Fro16kNotEnabled Fail to enable/disable selected bandgap timer due to FRO16k not enabled - * previously. - * @retval kStatus_VBAT_BandgapNotEnabled Fail to enable/disable selected bandgap timer due to bandgap not enabled - * previously. - */ -status_t VBAT_EnableBandgapTimer(VBAT_Type *base, bool enable, uint8_t timerIdMask); - -/*! - * @brief Set bandgap timer0 timeout value. - * - * @note The timeout value can only be changed when the timer is disabled. - * - * @param base VBAT peripheral base address. - * @param timeoutPeriod Bandgap timer timeout value, please refer to @ref vbat_bandgap_timer0_timeout_period_t. - */ -void VBAT_SetBandgapTimer0TimeoutValue(VBAT_Type *base, vbat_bandgap_timer0_timeout_period_t timeoutPeriod); - -/*! - * @brief Set bandgap timer1 timeout value. - * - * @note The timeout value can only be changed when the timer is disabled. - * - * @param base VBAT peripheral base address. - * @param timeoutPeriod The bandgap timerout 1 period, in number of seconds, ranging from 0 to 65535s. - */ -void VBAT_SetBandgapTimer1TimeoutValue(VBAT_Type *base, uint32_t timeoutPeriod); - -/*! @} */ -#endif /* FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_SWICTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_SWICTL_REG) -/*! @name Switch Control Interfaces - * @{ - */ - -/*! - * @brief Control the VBAT internal switch in active mode, VBAT modules can be suppiled by VDD_BAT and VDD_SYS. - * - * @param base VBAT peripheral base address. - * @param supply Used to control the VBAT internal switch. - */ -static inline void VBAT_SwitchVBATModuleSupplyActiveMode(VBAT_Type *base, vbat_internal_module_supply_t supply) -{ - if (supply == kVBAT_ModuleSuppliedByVddBat) - { - base->SWICTLA &= ~VBAT_SWICTLA_SWI_EN_MASK; - base->SWICTLB |= VBAT_SWICTLA_SWI_EN_MASK; - } - else - { - base->SWICTLA |= VBAT_SWICTLA_SWI_EN_MASK; - base->SWICTLB &= ~VBAT_SWICTLA_SWI_EN_MASK; - } -} - -/*! - * @brief Get VBAT module supply in active mode. - * - * @param base VBAT peripheral base address. - * @return VDD_SYS supplies VBAT modules or VDD_BAT supplies VBAT modules, in type of @ref - * vbat_internal_module_supply_t. - */ -static inline vbat_internal_module_supply_t VBAT_GetVBATModuleSupply(VBAT_Type *base) -{ - return (vbat_internal_module_supply_t)(uint8_t)(base->SWICTLA & VBAT_SWICTLA_SWI_EN_MASK); -} - -/*! - * @brief Control the VBAT internal switch in low power modes. - * - * @note If VBAT modules are supplied by VDD_SYS in low power modes, VBAT module will also supplied by VDD_SYS in active - * mode. - * - * @param base VBAT peripheral base address. - * @param supply Used to specify which voltage input supply VBAT modules in low power mode. - */ -static inline void VBAT_SwitchVBATModuleSupplyLowPowerMode(VBAT_Type *base, vbat_internal_module_supply_t supply) -{ - if (supply == kVBAT_ModuleSuppliedByVddBat) - { - base->SWICTLA &= ~VBAT_SWICTLA_LP_EN_MASK; - base->SWICTLB |= VBAT_SWICTLA_LP_EN_MASK; - } - else - { - base->SWICTLA |= VBAT_SWICTLA_SWI_EN_MASK; - base->SWICTLB &= ~VBAT_SWICTLA_SWI_EN_MASK; - base->SWICTLA |= VBAT_SWICTLA_LP_EN_MASK; - base->SWICTLB &= ~VBAT_SWICTLA_LP_EN_MASK; - } -} - -/*! - * @brief Lock switch control, if locked all writes to the switch registers will be blocked. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_LockSwitchControl(VBAT_Type *base) -{ - base->SWILCKA |= VBAT_SWILCKA_LOCK_MASK; - base->SWILCKB &= ~VBAT_SWILCKB_LOCK_MASK; -} - -/*! - * @brief Unlock switch control. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_UnlockSwitchControl(VBAT_Type *base) -{ - base->SWILCKA &= ~VBAT_SWILCKA_LOCK_MASK; - base->SWILCKB |= VBAT_SWILCKB_LOCK_MASK; -} - -/*! - * @brief Check if switch control is locked. - * - * @param base VBAT peripheral base address. - * - * @retval false switch control is not locked. - * @retval true switch control is locked, any writes to related registers are blocked. - */ -static inline bool VBAT_CheckSwitchControlLocked(VBAT_Type *base) -{ - return ((base->SWILCKA & VBAT_SWILCKA_LOCK_MASK) != 0UL); -} - -/*! @} */ -#endif /* FSL_FEATURE_MCX_VBAT_HAS_SWICTL_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) && FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) -/*! - * @name Clock Monitor Interfaces - * @{ - */ - -/*! - * @brief Initialize the VBAT clock monitor, enable clock monitor and set the clock monitor configuration. - * - * @note Both FRO16K and OSC32K should be enabled and stable before invoking this function. - * - * @param base VBAT peripheral base address. - * @param config Pointer to @ref vbat_clock_monitor_config_t structure. - * - * @retval kStatus_Success Clock monitor is initialized successfully. - * @retval kStatus_VBAT_Fro16kNotEnabled FRO16K is not enabled. - * @retval kStatus_VBAT_Osc32kNotReady OSC32K is not ready. - * @retval kStatus_VBAT_ClockMonitorLocked Clock monitor is locked. - */ -status_t VBAT_InitClockMonitor(VBAT_Type *base, const vbat_clock_monitor_config_t *config); - -/*! - * @brief Deinitialize the VBAT clock monitor. - * - * @param base VBAT peripheral base address. - * - * @retval kStatus_Success Clock monitor is de-initialized successfully. - * @retval kStatus_VBAT_ClockMonitorLocked Control of Clock monitor is locked. - */ -status_t VBAT_DeinitMonitor(VBAT_Type *base); - -/*! - * @brief Enable/disable clock monitor. - * - * @param base VBAT peripheral base address. - * @param enable Switcher to enable/disable clock monitor: - * - true: enable clock monitor; - * - false: disable clock monitor. - */ -static inline void VBAT_EnableClockMonitor(VBAT_Type *base, bool enable) -{ - if (enable) - { - base->MONCTLA |= VBAT_MONCTLA_MON_EN_MASK; - base->MONCTLB &= ~VBAT_MONCTLA_MON_EN_MASK; - } - else - { - base->MONCTLA &= ~VBAT_MONCTLA_MON_EN_MASK; - base->MONCTLB |= VBAT_MONCTLA_MON_EN_MASK; - } -} - -/*! - * @brief Set clock monitor's divide trim, avaiable value is #kVBAT_ClockMonitorOperateAt1kHz and - * #kVBAT_ClockMonitorOperateAt64Hz - * - * @param base VBAT peripheral base address. - * @param divideTrim Specify divide trim value, please refer to @ref vbat_clock_monitor_divide_trim_t. - */ -static inline void VBAT_SetClockMonitorDivideTrim(VBAT_Type *base, vbat_clock_monitor_divide_trim_t divideTrim) -{ - base->MONCFGA = (base->MONCFGA & ~VBAT_MONCFGA_DIVIDE_TRIM_MASK) | VBAT_MONCFGA_DIVIDE_TRIM(divideTrim); - base->MONCFGB = (base->MONCFGB & ~VBAT_MONCFGA_DIVIDE_TRIM_MASK) | VBAT_MONCFGA_DIVIDE_TRIM(~divideTrim); -} - -/*! - * @brief Set clock monitor's frequency trim, avaiable value is #kVBAT_ClockMonitorAssert2Cycle, - * #kVBAT_ClockMonitorAssert4Cycle, #kVBAT_ClockMonitorAssert6Cycle and #kVBAT_ClockMonitorAssert8Cycle. - * - * @param base VBAT peripheral base address. - * @param freqTrim Specify frequency trim value, please refer to @ref vbat_clock_monitor_freq_trim_t. - */ -static inline void VBAT_SetClockMonitorFrequencyTrim(VBAT_Type *base, vbat_clock_monitor_freq_trim_t freqTrim) -{ - base->MONCFGA = (base->MONCFGA & ~VBAT_MONCFGA_FREQ_TRIM_MASK) | VBAT_MONCFGA_FREQ_TRIM(freqTrim); - base->MONCFGB = (base->MONCFGB & ~VBAT_MONCFGA_FREQ_TRIM_MASK) | VBAT_MONCFGA_FREQ_TRIM(~freqTrim); -} - -/*! - * @brief Lock clock monitor enable/disable control. - * - * @note If locked, it is not allowed to change clock monitor enable/disable control. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_LockClockMonitorControl(VBAT_Type *base) -{ - base->MONLCKA |= VBAT_MONLCKA_LOCK_MASK; - base->MONLCKB &= ~VBAT_MONLCKA_LOCK_MASK; -} - -/*! - * @brief Unlock clock monitor enable/disable control. - * - * @param base VBTA peripheral base address. - */ -static inline void VBAT_UnlockClockMonitorControl(VBAT_Type *base) -{ - base->MONLCKA &= ~VBAT_MONLCKA_LOCK_MASK; - base->MONLCKB |= VBAT_MONLCKA_LOCK_MASK; -} - -/*! - * @brief Check if clock monitor enable/disable control is locked. - * - * @note If locked, it is not allowed to change clock monitor enable/disable control. - * - * @param base VBAT peripheral base address. - * - * @retval false clock monitor enable/disable control is not locked. - * @retval true clock monitor enable/disable control is locked, any writes to related registers are blocked. - */ -static inline bool VBAT_CheckClockMonitorControlLocked(VBAT_Type *base) -{ - return ((base->MONLCKA & VBAT_MONLCKA_LOCK_MASK) != 0UL); -} - -/*! @} */ -#endif /* FSL_FEATURE_VBAT_HAS_CLOCK_MONITOR */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) && FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) -/*! @name Tamper Control Interfaces - * - */ - -/*! - * @brief Initialize tamper control. - * - * @note Both FRO16K and bandgap should be enabled before calling this function. - * - * @param base VBAT peripheral base address. - * @param config Pointer to @ref vbat_tamper_config_t structure. - * - * @retval kStatus_Success Tamper is initialized successfully. - * @retval kStatus_VBAT_TamperLocked Tamper control is locked. - * @retval kStatus_VBAT_BandgapNotEnabled Bandgap is not enabled. - * @retval kStatus_VBAT_Fro16kNotEnabled FRO 16K is not enabled. - */ -status_t VBAT_InitTamper(VBAT_Type *base, const vbat_tamper_config_t *config); - -/*! - * @brief De-initialize tamper control. - * - * @param base VBAT peripheral base address. - * - * @retval kStatus_Success Tamper is de-initialized successfully. - * @retval kStatus_VBAT_TamperLocked Tamper control is locked. - */ -status_t VBAT_DeinitTamper(VBAT_Type *base); - -/*! - * @brief Enable tampers for VBAT. - * - * @param base VBAT peripheral base address. - * @param tamperEnableMask Mask of tamper to be enabled, should be the OR'ed value of @ref _vbat_tamper_enable. - */ -static inline void VBAT_EnableTamper(VBAT_Type *base, uint32_t tamperEnableMask) -{ - base->TAMPERA |= tamperEnableMask; - base->TAMPERB &= ~tamperEnableMask; -} - -/*! - * @brief Disable tampers for VBAT. - * - * @param base VBAT peripheral base address. - * @param tamperEnableMask Mask of tamper to be disabled, should be the OR'ed value of @ref _vbat_tamper_enable. - */ -static inline void VBAT_DisableTamper(VBAT_Type *base, uint32_t tamperEnableMask) -{ - base->TAMPERA &= ~tamperEnableMask; - base->TAMPERB |= tamperEnableMask; -} - -/*! - * @brief Get tamper enable information. - * - * @param base VBAT peripheral base address. - * - * @return Mask of tamper enable information, should be the OR'ed value of @ref _vbat_tamper_enable. - */ -static inline uint32_t VBAT_GetTamperEnableInfo(VBAT_Type *base) -{ - return base->TAMPERA; -} - -/*! - * @brief Lock tamper control, if locked, it is not allowed to change tamper control. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_LockTamperControl(VBAT_Type *base) -{ - base->TAMLCKA |= VBAT_TAMLCKA_LOCK_MASK; - base->TAMLCKB &= ~VBAT_TAMLCKA_LOCK_MASK; -} - -/*! - * @brief Unlock tamper control. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_UnlockTamperControl(VBAT_Type *base) -{ - base->TAMLCKA &= ~VBAT_TAMLCKA_LOCK_MASK; - base->TAMLCKB |= VBAT_TAMLCKA_LOCK_MASK; -} - -/*! - * @brief Check if tamper control is locked. - * - * @param base VBAT peripheral base address. - * - * @retval false Tamper control is not locked. - * @retval true Tamper control is locked, any writes to related registers are blocked. - */ -static inline bool VBAT_CheckTamperControlLocked(VBAT_Type *base) -{ - return ((base->TAMLCKA & VBAT_TAMLCKA_LOCK_MASK) != 0UL); -} - -/*! @} */ -#endif /* FSL_FEATURE_VBAT_HAS_TAMPER */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_STATUS_REG) && FSL_FEATURE_MCX_VBAT_HAS_STATUS_REG) -/*! @name Status, Interrupt, Wakeup Control Interfaces - * @{ - */ - -/*! - * @brief Get VBAT status flags - * - * @param base VBAT peripheral base address. - * @return The asserted status flags, should be the OR'ed value of @ref vbat_status_flag_t. - */ -static inline uint32_t VBAT_GetStatusFlags(VBAT_Type *base) -{ - return (uint32_t)(base->STATUSA); -} - -/*! - * @brief Clear VBAT status flags. - * - * @param base VBAT peripheral base address. - * @param mask The mask of status flags to be cleared, should be the OR'ed value of @ref vbat_status_flag_t except - * @ref kVBAT_StatusFlagLdoReady, @ref kVBAT_StatusFlagOsc32kReady, @ref kVBAT_StatusFlagInterrupt0Detect, - * @ref kVBAT_StatusFlagInterrupt1Detect, @ref kVBAT_StatusFlagInterrupt2Detect, - * @ref kVBAT_StatusFlagInterrupt3Detect. - */ -static inline void VBAT_ClearStatusFlags(VBAT_Type *base, uint32_t mask) -{ - base->STATUSA = mask; - base->STATUSB = ~mask; -} - -/*! - * @brief Enable interrupts for the VBAT module, such as POR detect interrupt, Wakeup Pin interrupt and so on. - * - * @param base VBAT peripheral base address. - * @param mask The mask of interrupts to be enabled, should be the OR'ed value of @ref vbat_interrupt_enable_t. - */ -static inline void VBAT_EnableInterrupts(VBAT_Type *base, uint32_t mask) -{ - base->IRQENA |= mask; - base->IRQENB &= (uint32_t)~mask; -} - -/*! - * @brief Disable interrupts for the VBAT module, such as POR detect interrupt, wakeup pin interrupt and so on. - * - * @param base VBAT peripheral base address. - * @param mask The mask of interrupts to be disabled, should be the OR'ed value of @ref vbat_interrupt_enable_t. - */ -static inline void VBAT_DisableInterrupts(VBAT_Type *base, uint32_t mask) -{ - base->IRQENA &= ~mask; - base->IRQENB |= mask; -} - -/*! - * @brief Enable wakeup for the VBAT module, such as POR detect wakeup, wakeup pin wakeup and so on. - * - * @param base VBAT peripheral base address. - * @param mask The mask of enumerators in @ref vbat_wakeup_enable_t. - */ -static inline void VBAT_EnableWakeup(VBAT_Type *base, uint32_t mask) -{ - base->WAKENA |= mask; - base->WAKENB &= ~mask; -} - -/*! - * @brief Disable wakeup for VBAT module, such as POR detect wakeup, wakeup pin wakeup and so on. - * - * @param base VBAT peripheral base address. - * @param mask The mask of enumerators in @ref vbat_wakeup_enable_t. - */ -static inline void VBAT_DisableWakeup(VBAT_Type *base, uint32_t mask) -{ - base->WAKENA &= ~mask; - base->WAKENB |= mask; -} - -/*! - * @brief Lock VBAT interrupt and wakeup settings, please note that if locked the interrupt and wakeup settings can not - * be updated until the next POR. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_LockInterruptWakeupSettings(VBAT_Type *base) -{ - base->LOCKA |= VBAT_LOCKA_LOCK_MASK; -} - -/*! - * @brief Set the default state of the WAKEUP_b pin output when no enabled wakeup source is asserted. - * - * @param base VBAT peripheral base address. - * @param assert Used to set default state of the WAKEUP_b pin output: - * - \b true WAKEUP_b output state is logic one; - * - \b false WAKEUP_b output state is logic zero. - */ -static inline void VBAT_SetWakeupPinDefaultState(VBAT_Type *base, bool assert) -{ - if (assert) - { - base->WAKECFG |= VBAT_WAKECFG_OUT_MASK; - } - else - { - base->WAKECFG &= ~VBAT_WAKECFG_OUT_MASK; - } -} - -/*! @} */ -#endif /* FSL_FEATURE_MCX_VBAT_HAS_STATUS_REG */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ -#endif /* FSL_VBAT_H__ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_waketimer.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_waketimer.c deleted file mode 100644 index d45699c605d..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_waketimer.c +++ /dev/null @@ -1,253 +0,0 @@ -/* - * Copyright 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_waketimer.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.waketimer" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * brief Gets the instance from the base address - * - * param base WAKETIMER peripheral base address - * - * return The WAKETIMER instance - */ -static uint32_t WAKETIMER_GetInstance(WAKETIMER_Type *base); - -/*! - * brief WAKETIMER generic IRQ handle function. - * - * param index WAKETIMER peripheral instance index. - */ -static void WAKETIMER_GenericIRQHandler(WAKETIMER_Type *base, waketimer_callback_t callback); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/* Array of WAKETIMER peripheral base address. */ -static WAKETIMER_Type *const s_waketimerBases[] = WAKETIMER_BASE_PTRS; -/* Array of WAKETIMER ISR. */ -static waketimer_callback_t s_waketimerCallback[sizeof(s_waketimerBases) / sizeof(s_waketimerBases[0])]; -/* Array of WAKETIMER IRQ number. */ -static const IRQn_Type s_waketimerIRQ[] = WAKETIMER_IRQS; - -/******************************************************************************* - * Code - ******************************************************************************/ - -/* brief Function for getting the instance number of Waketimer. */ -static uint32_t WAKETIMER_GetInstance(WAKETIMER_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_waketimerBases); instance++) - { - if (s_waketimerBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_waketimerBases)); - - return instance; -} - -/*! - * brief Initializes an WAKETIMER. - * param base WAKETIMER peripheral base address. - */ -void WAKETIMER_Init(WAKETIMER_Type *base, const waketimer_config_t *config) -{ - assert(NULL != base); - - uint32_t index = WAKETIMER_GetInstance(base); - - /* Halt timer */ - base->WAKE_TIMER_CTRL |= WAKETIMER_WAKE_TIMER_CTRL_CLR_WAKE_TIMER_MASK; - - /* Set OSC divide */ - if (config->enableOSCDivide) - { - base->WAKE_TIMER_CTRL |= WAKETIMER_WAKE_TIMER_CTRL_OSC_DIV_ENA_MASK; - } - else - { - base->WAKE_TIMER_CTRL &= ~WAKETIMER_WAKE_TIMER_CTRL_OSC_DIV_ENA_MASK; - } - - /* Set callback */ - s_waketimerCallback[index] = config->callback; - - /* Set interrupt */ - if (config->enableInterrupt) - { - base->WAKE_TIMER_CTRL |= WAKETIMER_WAKE_TIMER_CTRL_INTR_EN_MASK; - (void)EnableIRQ(s_waketimerIRQ[index]); - } - else - { - base->WAKE_TIMER_CTRL &= ~WAKETIMER_WAKE_TIMER_CTRL_INTR_EN_MASK; - (void)DisableIRQ(s_waketimerIRQ[index]); - } -} - -/*! - * brief Deinitializes a WAKETIMER instance. - * - * This function deinitializes the WAKETIMER. - * - * param base WAKETIMER peripheral base address. - */ -void WAKETIMER_Deinit(WAKETIMER_Type *base) -{ - assert(NULL != base); - - uint32_t index = WAKETIMER_GetInstance(base); - - /* Disable IRQ at NVIC Level */ - (void)DisableIRQ(s_waketimerIRQ[index]); -} - -/*! - * brief Fills in the WAKETIMER configuration structure with the default settings. - * - * The default values are: - * code - * config->enableInterrupt = true; - * config->enableOSCDivide = true; - * config->callback = NULL; - * endcode - * param config Pointer to the user configuration structure. - */ -void WAKETIMER_GetDefaultConfig(waketimer_config_t *config) -{ - config->enableInterrupt = true; - config->enableOSCDivide = true; - config->callback = NULL; -} - -/*! - * brief Enables the selected WAKETIMER interrupts. - * - * param base WAKETIMER peripheral base address - * param mask Mask value for interrupt events. See to #_waketimer_interrupt_enable - */ -void WAKETIMER_EnableInterrupts(WAKETIMER_Type *base, uint32_t mask) -{ - assert(NULL != base); - - if (0U != (mask & (uint32_t)kWAKETIMER_WakeInterruptEnable)) - { - base->WAKE_TIMER_CTRL |= WAKETIMER_WAKE_TIMER_CTRL_INTR_EN_MASK; - } -} - -/*! - * brief Disable the selected WAKETIMER interrupts. - * - * param base WAKETIMER peripheral base address - * param mask Mask value for interrupt events. See to #_waketimer_interrupt_enable - */ -void WAKETIMER_DisableInterrupts(WAKETIMER_Type *base, uint32_t mask) -{ - assert(NULL != base); - - if (0U != (mask & (uint32_t)kWAKETIMER_WakeInterruptEnable)) - { - base->WAKE_TIMER_CTRL &= ~WAKETIMER_WAKE_TIMER_CTRL_INTR_EN_MASK; - } -} - -/*! - * brief Clear Status Interrupt Flag. - * - * This clears intrrupt status flag. - * Currently, only match interrupt flag can be cleared. - * - * param base WAKETIMER peripheral base address. - * param mask Mask value for flags to be cleared. See to #_waketimer_status_flags. - * return none - */ -void WAKETIMER_ClearStatusFlags(WAKETIMER_Type *base, uint32_t mask) -{ - if (0U != (mask & (uint32_t)kWAKETIMER_WakeFlag)) - { - base->WAKE_TIMER_CTRL |= WAKETIMER_WAKE_TIMER_CTRL_WAKE_FLAG_MASK; - } -} - -/*! - * brief Receive noticification when waketime countdown. - * - * If the interrupt for the waketime countdown is enabled, then a callback can be registered - * which will be invoked when the event is triggered - * - * param base WAKETIMER peripheral base address - * param callback Function to invoke when the event is triggered - */ -void WAKETIMER_SetCallback(WAKETIMER_Type *base, waketimer_callback_t callback) -{ - assert(NULL != base); - - uint32_t index = WAKETIMER_GetInstance(base); - s_waketimerCallback[index] = callback; -} - -/*! - * brief Get current timer count value from WAKETIMER. - * - * This function will get a decimal timer count value. - * The RAW value of timer count is gray code format, will be translated to decimal data internally. - * - * param base WAKETIMER peripheral base address. - * return Value of WAKETIMER which will formated to decimal value. - */ -uint32_t WAKETIMER_GetCurrentTimerValue(WAKETIMER_Type *base) -{ - uint32_t value1 = 0; - uint32_t value2 = 0; - - do - { - value1 = base->WAKE_TIMER_CNT; - value2 = base->WAKE_TIMER_CNT; - } while (value1 != value2); - - return value1; -} - -static void WAKETIMER_GenericIRQHandler(WAKETIMER_Type *base, waketimer_callback_t callback) -{ - /* Clear interrupt flag. */ - WAKETIMER_ClearStatusFlags(base, (uint32_t)kWAKETIMER_WakeFlag); - - if (callback != NULL) - { - callback(); - } -} - -#if defined(WAKETIMER0) -void WAKETIMER0_DriverIRQHandler(void); -void WAKETIMER0_DriverIRQHandler(void) -{ - WAKETIMER_GenericIRQHandler(WAKETIMER0, s_waketimerCallback[0]); - SDK_ISR_EXIT_BARRIER; -} -#endif diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_waketimer.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_waketimer.h deleted file mode 100644 index 9913ff96672..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_waketimer.h +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_WAKETIMER_H_ -#define FSL_WAKETIMER_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup waketimer - * @{ - */ - -/*! @file*/ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief WAKETIMER driver version. */ -#define FSL_WAKETIMER_DRIVER_VERSION (MAKE_VERSION(2, 0, 1)) -/*! @} */ - -/*! - * @brief WAKETIMER status flags. - */ -enum _waketimer_status_flags -{ - kWAKETIMER_WakeFlag = - (WAKETIMER_WAKE_TIMER_CTRL_WAKE_FLAG_MASK), /*!< Wake Timer Status Flag, sets wake timer has timed out. */ -}; - -/*! - * @brief Define interrupt switchers of the module. - */ -enum _waketimer_interrupt_enable -{ - kWAKETIMER_WakeInterruptEnable = WAKETIMER_WAKE_TIMER_CTRL_INTR_EN_MASK, /*!< Generate interrupt - requests when WAKE_FLAG is asserted. */ -}; - -/*! @brief waketimer callback function. */ -typedef void (*waketimer_callback_t)(void); - -/*! - * @brief WAKETIMER configuration structure - * - * This structure holds the configuration settings for the WAKETIMER peripheral. To initialize this - * structure to reasonable defaults, call the WAKETIMER_GetDefaultConfig() function and pass a - * pointer to the configuration structure instance. - * - * The configuration structure can be made constant so as to reside in flash. - */ -typedef struct _waketimer_config -{ - bool enableOSCDivide; /*!< true: Enable OSC Divide. - false: Disable OSC Divide. */ - bool enableInterrupt; /*!< true: Enable interrupt. - false: Disable interrupt. */ - waketimer_callback_t callback; /*!< timer countdown callback. */ -} waketimer_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* _cplusplus */ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Initializes an WAKETIMER - * - * This function initializes the WAKETIMER. - * - * @param base WAKETIMER peripheral base address. - * @param config Pointer to the user configuration structure. - */ -void WAKETIMER_Init(WAKETIMER_Type *base, const waketimer_config_t *config); - -/*! - * @brief Deinitializes a WAKETIMER instance. - * - * This function deinitialize the WAKETIMER. - * - * @param base WAKETIMER peripheral base address. - */ -void WAKETIMER_Deinit(WAKETIMER_Type *base); - -/*! - * @brief Fills in the WAKETIMER configuration structure with the default settings. - * - * The default values are: - * @code - * config->enableInterrupt = true; - * config->enableOSCDivide = true; - * config->callback = NULL; - * @endcode - * @param config Pointer to the user configuration structure. - */ -void WAKETIMER_GetDefaultConfig(waketimer_config_t *config); - -/*! @}*/ - -/*! - * @name Interrupt Interface - * @{ - */ - -/*! - * @brief Enables the selected WAKETIMER interrupts. - * - * @param base WAKETIMER peripheral base address - * @param mask Mask value for interrupt events. See to #_waketimer_interrupt_enable - */ -void WAKETIMER_EnableInterrupts(WAKETIMER_Type *base, uint32_t mask); - -/*! - * @brief Enables the selected WAKETIMER interrupts. - * - * @param base WAKETIMER peripheral base address - * @param mask Mask value for interrupt events. See to #_waketimer_interrupt_enable - */ -void WAKETIMER_DisableInterrupts(WAKETIMER_Type *base, uint32_t mask); - -/*! - * @brief Clear Status Interrupt Flag. - * - * This clears intrrupt status flag. - * Currently, only match interrupt flag can be cleared. - * - * @param base WAKETIMER peripheral base address. - * @param mask Mask value for flags to be cleared. See to #_waketimer_status_flags. - * @return none - */ -void WAKETIMER_ClearStatusFlags(WAKETIMER_Type *base, uint32_t mask); - -/*! - * @brief Receive noticification when waketime countdown. - * - * If the interrupt for the waketime countdown is enabled, then a callback can be registered - * which will be invoked when the event is triggered - * - * @param base WAKETIMER peripheral base address - * @param callback Function to invoke when the event is triggered - */ -void WAKETIMER_SetCallback(WAKETIMER_Type *base, waketimer_callback_t callback); - -/*! @}*/ - -/*! - * @name Timer Start and Stop - * @{ - */ - -/*! - * @brief Halt and clear timer counter. - * - * This halt and clear timer counter. - * - * @param base WAKETIMER peripheral base address. - * @return none - */ -static inline void WAKETIMER_HaltTimer(WAKETIMER_Type *base) -{ - base->WAKE_TIMER_CTRL |= WAKETIMER_WAKE_TIMER_CTRL_CLR_WAKE_TIMER_MASK; -} - -/*! - * @brief Set timer counter. - * - * This set the timer counter and start the timer countdown. - * - * @param base WAKETIMER peripheral base address. - * @param value countdown value. - * @return none - */ -static inline void WAKETIMER_StartTimer(WAKETIMER_Type *base, uint32_t value) -{ - base->WAKE_TIMER_CNT = value; -} - -/*! - * @brief Get current timer count value from WAKETIMER. - * - * This function will get a decimal timer count value. - * The RAW value of timer count is gray code format, will be translated to decimal data internally. - * - * @param base WAKETIMER peripheral base address. - * @return Value of WAKETIMER which will be formated to decimal value. - */ -uint32_t WAKETIMER_GetCurrentTimerValue(WAKETIMER_Type *base); - -/*! @}*/ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_WAKETIMER_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_wuu.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_wuu.c deleted file mode 100644 index 214e7c07f08..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_wuu.c +++ /dev/null @@ -1,312 +0,0 @@ -/* - * Copyright 2019-2024 NXP. - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_wuu.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.wuu" -#endif - -#define WUU_PE_REG_BIT_FIELD_MASK 0x03UL -#define WUU_PDC_REG_BIT_FIELD_MASK 0x03UL -#define WUU_PMC_REG_BIT_FIELD_MASK 0x01UL - -#define WUU_ME_REG_WUME_FIELD_MASK 0x01UL -#define WUU_DE_REG_WUME_FIELD_MASK 0x01UL - -#define WUU_FILT_REG_FILTE_FIELD_MASK 0x60U -#define WUU_FILT_REG_FILTSET_FIELD_MASK 0x1FU -#define WUU_FDC_REG_FILTC_FIELD_MASK 0x3U -#define WUU_FMC_REG_FILTM_FIELD_MASK 0x1U - -#define WUU_FILT_REG_FILTSET_FIELD(x) (((uint32_t)(x) << 5UL) & WUU_FILT_REG_FILTE_FIELD_MASK) -#define WUU_CLEAR_BIT_FIELD_IN_REG(mask, offset) (~((uint32_t)(mask) << (offset))) -#define WUU_SET_BIT_FIELD_IN_REG(val, offset) ((uint32_t)(val) << (offset)) -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Enables and Configs External WakeUp Pins. - * - * This function enables/disables the external pin as wakeup input. What's more this - * function configs pins options, including edge detection wakeup event and operate mode. - * - * param base MUU peripheral base address. - * param pinIndex The index of the external input pin. See Reference Manual for the details. - * param config Pointer to wuu_external_wakeup_pin_config_t structure. - */ -void WUU_SetExternalWakeUpPinsConfig(WUU_Type *base, uint8_t pinIndex, const wuu_external_wakeup_pin_config_t *config) -{ - assert(config != NULL); - - volatile uint32_t *edgeRegBase = NULL; - volatile uint32_t *eventRegBase = NULL; - uint32_t edgeReg; - uint32_t eventReg; - uint32_t modeReg; - uint8_t offset; - - /* Calculate offset. */ - offset = 2U * (pinIndex & 0xFU); - - if (config->edge != kWUU_ExternalPinDisable) - { - /* Based on pin index, get register base address. */ - if ((pinIndex >> 4U) != 0U) - { - edgeRegBase = &base->PE2; - eventRegBase = &base->PDC2; - } - else - { - edgeRegBase = &base->PE1; - eventRegBase = &base->PDC1; - } - - /* Enable and config the edge detection. */ - edgeReg = *edgeRegBase; - edgeReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_PE_REG_BIT_FIELD_MASK, offset); - edgeReg |= WUU_SET_BIT_FIELD_IN_REG(config->edge, offset); - *edgeRegBase = edgeReg; - - /* Config the wakeup event. */ - eventReg = *eventRegBase; - eventReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_PDC_REG_BIT_FIELD_MASK, offset); - eventReg |= WUU_SET_BIT_FIELD_IN_REG(config->event, offset); - *eventRegBase = eventReg; - - /* Config operate mode. */ - modeReg = base->PMC; - modeReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_PMC_REG_BIT_FIELD_MASK, pinIndex); - modeReg |= WUU_SET_BIT_FIELD_IN_REG(config->mode, pinIndex); - - base->PMC = modeReg; - } - else - { - /* Based on pin index, get register base address. */ - if ((pinIndex >> 4U) != 0U) - { - edgeRegBase = &base->PE2; - } - else - { - edgeRegBase = &base->PE1; - } - - edgeReg = *edgeRegBase; - edgeReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_PE_REG_BIT_FIELD_MASK, offset); - *edgeRegBase = edgeReg; - } -} - -/*! - * brief Disable and clear external wakeup pin settings. - * - * param base MUU peripheral base address. - * param pinIndex The index of the external input pin. - */ -void WUU_ClearExternalWakeupPinsConfig(WUU_Type *base, uint8_t pinIndex) -{ - if (pinIndex <= 15U) - { - base->PE1 &= ~(WUU_PE_REG_BIT_FIELD_MASK << (2UL * (uint32_t)pinIndex)); - base->PDC1 &= ~(WUU_PDC_REG_BIT_FIELD_MASK << (2UL * (uint32_t)pinIndex)); - } - else - { - base->PE1 &= ~(WUU_PE_REG_BIT_FIELD_MASK << (2UL * (uint32_t)((uint32_t)pinIndex % 16UL))); - base->PDC1 &= ~(WUU_PDC_REG_BIT_FIELD_MASK << (2UL * (uint32_t)((uint32_t)pinIndex % 16UL))); - } -} - -/*! - * brief Config Internal modules' event as the wake up soures. - * - * This function configs the internal modules event as the wake up sources. - * - * param base WUU peripheral base address. - * param moduleIndex The selected internal module. See the Reference Manual for the details. - * param event Select interrupt or DMA/Trigger of the internal module as the wake up source. - */ -void WUU_SetInternalWakeUpModulesConfig(WUU_Type *base, uint8_t moduleIndex, wuu_internal_wakeup_module_event_t event) -{ - switch (event) - { - case kWUU_InternalModuleInterrupt: - base->ME |= WUU_SET_BIT_FIELD_IN_REG(WUU_ME_REG_WUME_FIELD_MASK, moduleIndex); - break; - case kWUU_InternalModuleDMATrigger: - base->DE |= WUU_SET_BIT_FIELD_IN_REG(WUU_DE_REG_WUME_FIELD_MASK, moduleIndex); - break; - default: - assert(false); - break; - } -} - -/*! - * brief Disable an on-chip internal modules' event as the wakeup sources. - * - * param base WUU peripheral base address. - * param moduleIndex The selected internal module. See the Reference Manual for the details. - * param event The event(interrupt or DMA/trigger) of the internal module to disable. - */ -void WUU_ClearInternalWakeUpModulesConfig(WUU_Type *base, uint8_t moduleIndex, wuu_internal_wakeup_module_event_t event) -{ - switch(event) - { - case kWUU_InternalModuleInterrupt: - base->ME &= ~WUU_SET_BIT_FIELD_IN_REG(WUU_ME_REG_WUME_FIELD_MASK, moduleIndex); - break; - case kWUU_InternalModuleDMATrigger: - base->DE &= ~WUU_SET_BIT_FIELD_IN_REG(WUU_DE_REG_WUME_FIELD_MASK, moduleIndex); - break; - default: - assert(false); - break; - } -} - -/*! - * brief Configs and Enables Pin filters. - * - * This function configs Pin filter, including pin select, filer operate mode - * filer wakeup event and filter edge detection. - * - * param base WUU peripheral base address. - * param filterIndex The index of the pin filer. - * param config Pointer to wuu_pin_filter_config_t structure. - */ -void WUU_SetPinFilterConfig(WUU_Type *base, uint8_t filterIndex, const wuu_pin_filter_config_t *config) -{ - assert(config != NULL); - - uint8_t shift; - uint32_t filterReg; - uint32_t eventReg; - uint32_t modeReg; - - shift = (filterIndex - 1U) * 8U; - filterReg = base->FILT; - filterReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_FILT_REG_FILTE_FIELD_MASK, shift); - filterReg |= WUU_SET_BIT_FIELD_IN_REG(WUU_FILT_REG_FILTSET_FIELD(config->edge), shift); - - if (config->edge != kWUU_FilterDisabled) - { - filterReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_FILT_REG_FILTSET_FIELD_MASK, shift); - filterReg |= WUU_SET_BIT_FIELD_IN_REG(config->pinIndex, shift); - - /* Config wake up event. */ - shift = (filterIndex - 1U) * 2U; - eventReg = base->FDC; - eventReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_FDC_REG_FILTC_FIELD_MASK, shift); - eventReg |= WUU_SET_BIT_FIELD_IN_REG(config->event, shift); - base->FDC = eventReg; - - /* Config operate mode. */ - shift = (filterIndex - 1U) * 1U; - modeReg = base->FMC; - modeReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_FMC_REG_FILTM_FIELD_MASK, shift); - modeReg |= WUU_SET_BIT_FIELD_IN_REG(config->mode, shift); - base->FMC = modeReg; - } - - base->FILT = filterReg; -} - -/*! - * brief Gets the pin filter configuration. - * - * This function gets the pin filter flag. - * - * param base WUU peripheral base address. - * param filterIndex A pin filter index, which starts from 1. - * return True if the flag is a source of the existing low-leakage power mode. - */ -bool WUU_GetPinFilterFlag(WUU_Type *base, uint8_t filterIndex) -{ - bool ret = false; - - switch (filterIndex) - { - case 1: - ret = ((base->FILT & WUU_FILT_FILTF1_MASK) != 0U); - break; - case 2: - ret = ((base->FILT & WUU_FILT_FILTF2_MASK) != 0U); - break; - default: - ret = false; - break; - } - - return ret; -} - -/*! - * brief Clears the pin filter configuration. - * - * This function clears the pin filter flag. - * - * param base WUU peripheral base address. - * param filterIndex A pin filter index to clear the flag, starting from 1. - */ -void WUU_ClearPinFilterFlag(WUU_Type *base, uint8_t filterIndex) -{ - uint32_t reg; - - reg = base->FILT; - /* Clean the W1C bits, in case the flags are cleared by mistake. */ - reg &= ~(WUU_FILT_FILTF1_MASK | WUU_FILT_FILTF2_MASK); - - reg |= WUU_SET_BIT_FIELD_IN_REG(WUU_FILT_FILTF1_MASK, ((filterIndex - 1U) * 8U)); - - base->FILT = reg; -} - -/*! - * brief Gets the external wakeup source flag. - * - * This function checks the external pin flag to detect whether the MCU is - * woken up by the specific pin. - * - * param base WUU peripheral base address. - * param pinIndex A pin index, which starts from 0. - * return True if the specific pin is a wakeup source. - */ -bool WUU_GetExternalWakeupPinFlag(WUU_Type *base, uint32_t pinIndex) -{ - return (0U != (base->PF & (1UL << pinIndex))); -} - -/*! - * brief Clears the external wakeup source flag. - * - * This function clears the external wakeup source flag for a specific pin. - * - * param base WUU peripheral base address. - * param pinIndex A pin index, which starts from 0. - */ -void WUU_ClearExternalWakeupPinFlag(WUU_Type *base, uint32_t pinIndex) -{ - base->PF = (1UL << pinIndex); -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_wuu.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_wuu.h deleted file mode 100644 index bedfde56859..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_wuu.h +++ /dev/null @@ -1,294 +0,0 @@ -/* - * Copyright 2019-2024 NXP. - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_WUU_H_ -#define FSL_WUU_H_ - -#include "fsl_common.h" - -/*! @addtogroup wuu */ -/*! @{ */ - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief Defines WUU driver version 2.4.0. */ -#define FSL_WUU_DRIVER_VERSION (MAKE_VERSION(2, 4, 0)) -/*! @} */ - -/*! - * @brief External WakeUp pin edge detection enumeration. - */ -typedef enum _wuu_external_pin_edge_detection -{ - kWUU_ExternalPinDisable = 0x0U, /*!< External input Pin disabled as wake up input. */ - kWUU_ExternalPinRisingEdge = 0x1U, /*!< External input Pin enabled with the rising edge detection. */ - kWUU_ExternalPinFallingEdge = 0x2U, /*!< External input Pin enabled with the falling edge detection. */ - kWUU_ExternalPinAnyEdge = 0x3U, /*!< External input Pin enabled with any change detection. */ -} wuu_external_pin_edge_detection_t; - -/*! - * @brief External input wake up pin event enumeration. - */ -typedef enum _wuu_external_wakeup_pin_event -{ - kWUU_ExternalPinInterrupt = 0x0U, /*!< External input Pin configured as interrupt. */ - kWUU_ExternalPinDMARequest = 0x1U, /*!< External input Pin configured as DMA request. */ - kWUU_ExternalPinTriggerEvent = 0x2U, /*!< External input Pin configured as Trigger event. */ -} wuu_external_wakeup_pin_event_t; - -/*! - * @brief External input wake up pin mode enumeration. - */ -typedef enum _wuu_external_wakeup_pin_mode -{ - kWUU_ExternalPinActiveDSPD = 0x0U, /*!< External input Pin is active only during Deep Sleep/Power Down Mode. */ - kWUU_ExternalPinActiveAlways = 0x1U, /*!< External input Pin is active during all power modes. */ -} wuu_external_wakeup_pin_mode_t; - -/*! - * @brief Internal module wake up event enumeration. - */ -typedef enum _wuu_internal_wakeup_module_event -{ - kWUU_InternalModuleInterrupt = 0x0U, /*!< Internal modules' interrupt as a wakeup source. */ - kWUU_InternalModuleDMATrigger = 0x1U, /*!< Internal modules' DMA/Trigger as a wakeup source. */ -} wuu_internal_wakeup_module_event_t; - -/*! - * @brief Pin filter edge enumeration. - */ -typedef enum _wuu_filter_edge -{ - kWUU_FilterDisabled = 0x0U, /*!< Filter disabled. */ - kWUU_FilterPosedgeEnable = 0x1U, /*!< Filter posedge detect enabled. */ - kWUU_FilterNegedgeEnable = 0x2U, /*!< Filter negedge detect enabled. */ - kWUU_FilterAnyEdge = 0x3U, /*!< Filter any edge detect enabled. */ -} wuu_filter_edge_t; - -/*! - * @brief Pin Filter event enumeration. - */ -typedef enum _wuu_filter_event -{ - kWUU_FilterInterrupt = 0x0U, /*!< Filter output configured as interrupt. */ - kWUU_FilterDMARequest = 0x1U, /*!< Filter output configured as DMA request. */ - kWUU_FilterTriggerEvent = 0x2U, /*!< Filter output configured as Trigger event. */ -} wuu_filter_event_t; - -/*! - * @brief Pin filter mode enumeration. - */ -typedef enum _wuu_filter_mode -{ - kWUU_FilterActiveDSPD = 0x0U, /*!< External input pin filter is active only during Deep Sleep/Power Down Mode. */ - kWUU_FilterActiveAlways = 0x1U, /*!< External input Pin filter is active during all power modes. */ -} wuu_filter_mode_t; - -/*! - * @brief External WakeUp pin configuration - */ -typedef struct _wuu_external_wakeup_pin_config -{ - wuu_external_pin_edge_detection_t edge; /*!< External Input pin edge detection. */ - wuu_external_wakeup_pin_event_t event; /*!< External Input wakeup Pin event */ - wuu_external_wakeup_pin_mode_t mode; /*!< External Input wakeup Pin operate mode. */ -} wuu_external_wakeup_pin_config_t; - -/*! - * @brief Pin Filter configuration. - */ -typedef struct _wuu_pin_filter_config -{ - uint32_t pinIndex; /*!< The index of wakeup pin to be muxxed into filter. */ - wuu_filter_edge_t edge; /*!< The edge of the pin digital filter. */ - wuu_filter_event_t event; /*!< The event of the filter output. */ - wuu_filter_mode_t mode; /*!< The mode of the filter operate. */ -} wuu_pin_filter_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name External Wake up Pins Control APIs. - * @{ - */ -/*! - * @brief Enables and Configs External WakeUp Pins. - * - * This function enables/disables the external pin as wakeup input. What's more this - * function configs pins options, including edge detection wakeup event and operate mode. - * - * @param base MUU peripheral base address. - * @param pinIndex The index of the external input pin. See Reference Manual for the details. - * @param config Pointer to wuu_external_wakeup_pin_config_t structure. - */ -void WUU_SetExternalWakeUpPinsConfig(WUU_Type *base, uint8_t pinIndex, const wuu_external_wakeup_pin_config_t *config); - -/*! - * @brief Disable and clear external wakeup pin settings. - * - * @param base MUU peripheral base address. - * @param pinIndex The index of the external input pin. - */ -void WUU_ClearExternalWakeupPinsConfig(WUU_Type *base, uint8_t pinIndex); - -/*! - * @brief Gets External Wakeup pin flags. - * - * This function return the external wakeup pin flags. - * - * @param base WUU peripheral base address. - * @return Wakeup flags for all external wakeup pins. - */ -static inline uint32_t WUU_GetExternalWakeUpPinsFlag(WUU_Type *base) -{ - return base->PF; -} - -/*! - * @brief Clears External WakeUp Pin flags. - * - * This function clears external wakeup pins flags based on the mask. - * - * @param base WUU peripheral base address. - * @param mask The mask of Wakeup pin index to be cleared. - */ -static inline void WUU_ClearExternalWakeUpPinsFlag(WUU_Type *base, uint32_t mask) -{ - base->PF = mask; -} -/*! @} */ - -/*! - * @name Internal Wakeup Module control APIs. - * @{ - */ - -/*! - * @brief Config Internal modules' event as the wake up soures. - * - * This function configs the internal modules event as the wake up sources. - * - * @param base WUU peripheral base address. - * @param moduleIndex The selected internal module. See the Reference Manual for the details. - * @param event Select interrupt or DMA/Trigger of the internal module as the wake up source. - */ -void WUU_SetInternalWakeUpModulesConfig(WUU_Type *base, uint8_t moduleIndex, wuu_internal_wakeup_module_event_t event); - -/*! - * @brief Disable an on-chip internal modules' event as the wakeup sources. - * - * @param base WUU peripheral base address. - * @param moduleIndex The selected internal module. See the Reference Manual for the details. - * @param event The event(interrupt or DMA/trigger) of the internal module to disable. - */ -void WUU_ClearInternalWakeUpModulesConfig(WUU_Type *base, uint8_t moduleIndex, wuu_internal_wakeup_module_event_t event); - -#if (defined(FSL_FEATURE_WUU_HAS_MF) && FSL_FEATURE_WUU_HAS_MF) -/*! - * @brief Get wakeup flags for internal wakeup modules. - * - * @param base WUU peripheral base address. - * @return Wakeup flags for all internal wakeup modules. - */ -static inline uint32_t WUU_GetModuleInterruptFlag(WUU_Type *base) -{ - return base->MF; -} - -/*! - * @brief Gets the internal module wakeup source flag. - * - * This function checks the flag to detect whether the system is - * woken up by specific on-chip module interrupt. - * - * @param base WWU peripheral base address. - * @param moduleIndex A module index, which starts from 0. - * @return True if the specific pin is a wake up source. - */ -static inline bool WUU_GetInternalWakeupModuleFlag(WUU_Type *base, uint32_t moduleIndex) -{ - return ((1UL << moduleIndex) == (WUU_GetModuleInterruptFlag(base) & (1UL << moduleIndex))); -} -#endif /* FSL_FEATURE_WUU_HAS_MF */ - -/*! @} */ - -/*! - * @name Pin Filter Control APIs - * @{ - */ -/*! - * @brief Configs and Enables Pin filters. - * - * This function configs Pin filter, including pin select, filer operate mode - * filer wakeup event and filter edge detection. - * - * @param base WUU peripheral base address. - * @param filterIndex The index of the pin filer. - * @param config Pointer to wuu_pin_filter_config_t structure. - */ -void WUU_SetPinFilterConfig(WUU_Type *base, uint8_t filterIndex, const wuu_pin_filter_config_t *config); - -/*! - * @brief Gets the pin filter configuration. - * - * This function gets the pin filter flag. - * - * @param base WUU peripheral base address. - * @param filterIndex A pin filter index, which starts from 1. - * @return True if the flag is a source of the existing low-leakage power mode. - */ -bool WUU_GetPinFilterFlag(WUU_Type *base, uint8_t filterIndex); - -/*! - * @brief Clears the pin filter configuration. - * - * This function clears the pin filter flag. - * - * @param base WUU peripheral base address. - * @param filterIndex A pin filter index to clear the flag, starting from 1. - */ -void WUU_ClearPinFilterFlag(WUU_Type *base, uint8_t filterIndex); - -/*! - * brief Gets the external wakeup source flag. - * - * This function checks the external pin flag to detect whether the MCU is - * woken up by the specific pin. - * - * param base WUU peripheral base address. - * param pinIndex A pin index, which starts from 0. - * return True if the specific pin is a wakeup source. - */ -bool WUU_GetExternalWakeupPinFlag(WUU_Type *base, uint32_t pinIndex); - -/*! - * brief Clears the external wakeup source flag. - * - * This function clears the external wakeup source flag for a specific pin. - * - * param base WUU peripheral base address. - * param pinIndex A pin index, which starts from 0. - */ -void WUU_ClearExternalWakeupPinFlag(WUU_Type *base, uint32_t pinIndex); -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @} */ - -#endif /*FSL_WUU_H_*/ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_wwdt.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_wwdt.c deleted file mode 100644 index 6680148acf7..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_wwdt.c +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_wwdt.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.wwdt" -#endif - -#define FREQUENCY_3MHZ (3000000U) -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Gets the instance from the base address - * - * @param base WWDT peripheral base address - * - * @return The WWDT instance - */ -static uint32_t WWDT_GetInstance(WWDT_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to WWDT bases for each instance. */ -static WWDT_Type *const s_wwdtBases[] = WWDT_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to WWDT clocks for each instance. */ -static const clock_ip_name_t s_wwdtClocks[] = WWDT_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) -#if !(defined(FSL_FEATURE_WWDT_HAS_NO_RESET) && FSL_FEATURE_WWDT_HAS_NO_RESET) -/*! @brief Pointers to WWDT resets for each instance. */ -static const reset_ip_name_t s_wwdtResets[] = WWDT_RSTS; -#endif -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t WWDT_GetInstance(WWDT_Type *base) -{ - uint32_t instance; - uint32_t wwdtArrayCount = (sizeof(s_wwdtBases) / sizeof(s_wwdtBases[0])); - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < wwdtArrayCount; instance++) - { - if (s_wwdtBases[instance] == base) - { - break; - } - } - - assert(instance < wwdtArrayCount); - - return instance; -} - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Initializes WWDT configure structure. - * - * This function initializes the WWDT configure structure to default value. The default - * value are: - * code - * config->enableWwdt = true; - * config->enableWatchdogReset = false; - * config->enableWatchdogProtect = false; - * config->enableLockOscillator = false; - * config->windowValue = 0xFFFFFFU; - * config->timeoutValue = 0xFFFFFFU; - * config->warningValue = 0; - * endcode - * - * param config Pointer to WWDT config structure. - * see wwdt_config_t - */ -void WWDT_GetDefaultConfig(wwdt_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - /* Enable the watch dog */ - config->enableWwdt = true; - /* Disable the watchdog timeout reset */ - config->enableWatchdogReset = false; - /* Disable the watchdog protection for updating the timeout value */ - config->enableWatchdogProtect = false; -#if !(defined(FSL_FEATURE_WWDT_HAS_NO_OSCILLATOR_LOCK) && FSL_FEATURE_WWDT_HAS_NO_OSCILLATOR_LOCK) - /* Do not lock the watchdog oscillator */ - config->enableLockOscillator = false; -#endif - /* Windowing is not in effect */ - config->windowValue = 0xFFFFFFU; - /* Set the timeout value to the max */ - config->timeoutValue = 0xFFFFFFU; - /* No warning is provided */ - config->warningValue = 0; - /* Set clock frequency. */ - config->clockFreq_Hz = 0U; -} - -/*! - * brief Initializes the WWDT. - * - * This function initializes the WWDT. When called, the WWDT runs according to the configuration. - * - * Example: - * code - * wwdt_config_t config; - * WWDT_GetDefaultConfig(&config); - * config.timeoutValue = 0x7ffU; - * WWDT_Init(wwdt_base,&config); - * endcode - * - * param base WWDT peripheral base address - * param config The configuration of WWDT - */ -void WWDT_Init(WWDT_Type *base, const wwdt_config_t *config) -{ - assert(NULL != config); - - uint32_t value = 0U; - uint32_t DelayUs = 0U; - uint32_t primaskValue = 0U; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the WWDT clock */ - CLOCK_EnableClock(s_wwdtClocks[WWDT_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) -#if !(defined(FSL_FEATURE_WWDT_HAS_NO_RESET) && FSL_FEATURE_WWDT_HAS_NO_RESET) - /* Reset the module. */ - RESET_PeripheralReset(s_wwdtResets[WWDT_GetInstance(base)]); -#endif - -#if defined(FSL_FEATURE_WWDT_WDTRESET_FROM_PMC) && (FSL_FEATURE_WWDT_WDTRESET_FROM_PMC) - /* PMC RESETCAUSE: set bit to clear it by write 1. */ - PMC->RESETCAUSE = PMC_RESETCAUSE_WDTRESET_MASK; - /* Enable the watchdog reset event to affect the system in the Power Management Controller */ - PMC->CTRL |= PMC_CTRL_WDTRESETENABLE_MASK; -#endif /*FSL_FEATURE_WWDT_WDTRESET_FROM_PMC*/ - -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ - -#if !(defined(FSL_FEATURE_WWDT_HAS_NO_OSCILLATOR_LOCK) && FSL_FEATURE_WWDT_HAS_NO_OSCILLATOR_LOCK) - value = WWDT_MOD_WDEN(config->enableWwdt) | WWDT_MOD_WDRESET(config->enableWatchdogReset) | - WWDT_MOD_LOCK(config->enableLockOscillator); -#else - value = WWDT_MOD_WDEN(config->enableWwdt) | WWDT_MOD_WDRESET(config->enableWatchdogReset); -#endif - /* Clear legacy flag in the MOD register by software writing a "1" to this bit field.. */ - if (0U != (base->MOD & WWDT_MOD_WDINT_MASK)) - { - value |= WWDT_MOD_WDINT_MASK; - } - /* Set configuration */ - primaskValue = DisableGlobalIRQ(); - base->TC = WWDT_TC_COUNT(config->timeoutValue); - base->MOD = value; - base->WINDOW = WWDT_WINDOW_WINDOW(config->windowValue); - base->WARNINT = WWDT_WARNINT_WARNINT(config->warningValue); - /* Refreshes the WWDT timer. */ - base->FEED = WWDT_FIRST_WORD_OF_REFRESH; - base->FEED = WWDT_SECOND_WORD_OF_REFRESH; - EnableGlobalIRQ(primaskValue); - /* Read counter value to wait wwdt timer start*/ - if (config->enableWwdt) - { - while (base->TV == 0xFFUL) - { - } - } - - /* This WDPROTECT bit can be set once by software and is only cleared by a reset */ - if (config->enableWatchdogProtect && (0U == (base->MOD & WWDT_MOD_WDPROTECT_MASK))) - { - /* The config->clockFreq_Hz must be set in order to config the delay time. */ - assert(0U != config->clockFreq_Hz); - - /* Set the WDPROTECT bit after the Feed Sequence (0xAA, 0x55) with 3 WDCLK delay */ - DelayUs = FREQUENCY_3MHZ / config->clockFreq_Hz + 1U; - SDK_DelayAtLeastUs(DelayUs, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY); - - base->MOD |= WWDT_MOD_WDPROTECT(1U); - } -} - -/*! - * brief Shuts down the WWDT. - * - * This function shuts down the WWDT. - * - * param base WWDT peripheral base address - */ -void WWDT_Deinit(WWDT_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable the WWDT clock */ - CLOCK_DisableClock(s_wwdtClocks[WWDT_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Refreshes the WWDT timer. - * - * This function feeds the WWDT. - * This function should be called before WWDT timer is in timeout. Otherwise, a reset is asserted. - * - * param base WWDT peripheral base address - */ -void WWDT_Refresh(WWDT_Type *base) -{ - uint32_t primaskValue = 0U; - - /* Disable the global interrupt to protect refresh sequence */ - primaskValue = DisableGlobalIRQ(); - base->FEED = WWDT_FIRST_WORD_OF_REFRESH; - base->FEED = WWDT_SECOND_WORD_OF_REFRESH; - EnableGlobalIRQ(primaskValue); -} - -/*! - * brief Clear WWDT flag. - * - * This function clears WWDT status flag. - * - * Example for clearing warning flag: - * code - * WWDT_ClearStatusFlags(wwdt_base, kWWDT_WarningFlag); - * endcode - * param base WWDT peripheral base address - * param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::_wwdt_status_flags_t - */ -void WWDT_ClearStatusFlags(WWDT_Type *base, uint32_t mask) -{ - /* Clear the WDINT bit so that we don't accidentally clear it */ - uint32_t reg = (base->MOD & (~WWDT_MOD_WDINT_MASK)); - - /* Clear timeout by writing a zero */ - if (0U != (mask & (uint32_t)kWWDT_TimeoutFlag)) - { - reg &= ~WWDT_MOD_WDTOF_MASK; -#if defined(FSL_FEATURE_WWDT_WDTRESET_FROM_PMC) && (FSL_FEATURE_WWDT_WDTRESET_FROM_PMC) - /* PMC RESETCAUSE: set bit to clear it */ - PMC->RESETCAUSE = PMC_RESETCAUSE_WDTRESET_MASK; -#endif /*FSL_FEATURE_WWDT_WDTRESET_FROM_PMC*/ - } - - /* Clear warning interrupt flag by writing a one */ - if (0U != (mask & (uint32_t)kWWDT_WarningFlag)) - { - reg |= WWDT_MOD_WDINT_MASK; - } - - base->MOD = reg; -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_wwdt.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_wwdt.h deleted file mode 100644 index 40c90e48b38..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/drivers/fsl_wwdt.h +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_WWDT_H_ -#define FSL_WWDT_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup wwdt - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief Defines WWDT driver version. */ -#define FSL_WWDT_DRIVER_VERSION (MAKE_VERSION(2, 1, 9)) -/*! @} */ - -/*! @name Refresh sequence */ -/*! @{ */ -#define WWDT_FIRST_WORD_OF_REFRESH (0xAAU) /*!< First word of refresh sequence */ -#define WWDT_SECOND_WORD_OF_REFRESH (0x55U) /*!< Second word of refresh sequence */ -/*! @} */ - -/*! @brief Describes WWDT configuration structure. */ -typedef struct _wwdt_config -{ - bool enableWwdt; /*!< Enables or disables WWDT */ - bool enableWatchdogReset; /*!< true: Watchdog timeout will cause a chip reset - false: Watchdog timeout will not cause a chip reset */ - bool enableWatchdogProtect; /*!< true: Enable watchdog protect i.e timeout value can only be - changed after counter is below warning & window values - false: Disable watchdog protect; timeout value can be changed - at any time */ -#if !(defined(FSL_FEATURE_WWDT_HAS_NO_OSCILLATOR_LOCK) && FSL_FEATURE_WWDT_HAS_NO_OSCILLATOR_LOCK) - bool enableLockOscillator; /*!< true: Disabling or powering down the watchdog oscillator is prevented - Once set, this bit can only be cleared by a reset - false: Do not lock oscillator */ -#endif - uint32_t windowValue; /*!< Window value, set this to 0xFFFFFF if windowing is not in effect */ - uint32_t timeoutValue; /*!< Timeout value */ - uint32_t warningValue; /*!< Watchdog time counter value that will generate a - warning interrupt. Set this to 0 for no warning */ - uint32_t clockFreq_Hz; /*!< Watchdog clock source frequency. */ -} wwdt_config_t; - -/*! - * @brief WWDT status flags. - * - * This structure contains the WWDT status flags for use in the WWDT functions. - */ -enum _wwdt_status_flags_t -{ - kWWDT_TimeoutFlag = WWDT_MOD_WDTOF_MASK, /*!< Time-out flag, set when the timer times out */ - kWWDT_WarningFlag = WWDT_MOD_WDINT_MASK /*!< Warning interrupt flag, set when timer is below the value WDWARNINT */ -}; - -/******************************************************************************* - * API - *******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name WWDT Initialization and De-initialization - * @{ - */ - -/*! - * @brief Initializes WWDT configure structure. - * - * This function initializes the WWDT configure structure to default value. The default - * value are: - * @code - * config->enableWwdt = true; - * config->enableWatchdogReset = false; - * config->enableWatchdogProtect = false; - * config->enableLockOscillator = false; - * config->windowValue = 0xFFFFFFU; - * config->timeoutValue = 0xFFFFFFU; - * config->warningValue = 0; - * @endcode - * - * @param config Pointer to WWDT config structure. - * @see wwdt_config_t - */ -void WWDT_GetDefaultConfig(wwdt_config_t *config); - -/*! - * @brief Initializes the WWDT. - * - * This function initializes the WWDT. When called, the WWDT runs according to the configuration. - * - * Example: - * @code - * wwdt_config_t config; - * WWDT_GetDefaultConfig(&config); - * config.timeoutValue = 0x7ffU; - * WWDT_Init(wwdt_base,&config); - * @endcode - * - * @param base WWDT peripheral base address - * @param config The configuration of WWDT - */ -void WWDT_Init(WWDT_Type *base, const wwdt_config_t *config); - -/*! - * @brief Shuts down the WWDT. - * - * This function shuts down the WWDT. - * - * @param base WWDT peripheral base address - */ -void WWDT_Deinit(WWDT_Type *base); - -/*! @} */ - -/*! - * @name WWDT Functional Operation - * @{ - */ - -/*! - * @brief Enables the WWDT module. - * - * This function write value into WWDT_MOD register to enable the WWDT, it is a write-once bit; - * once this bit is set to one and a watchdog feed is performed, the watchdog timer will run - * permanently. - * - * @param base WWDT peripheral base address - */ -static inline void WWDT_Enable(WWDT_Type *base) -{ - base->MOD |= WWDT_MOD_WDEN_MASK; -} - -/*! - * @brief Disables the WWDT module. - * @deprecated Do not use this function. It will be deleted in next release version, for - * once the bit field of WDEN written with a 1, it can not be re-written with a 0. - * - * This function write value into WWDT_MOD register to disable the WWDT. - * - * @param base WWDT peripheral base address - */ -static inline void WWDT_Disable(WWDT_Type *base) -{ - base->MOD &= ~WWDT_MOD_WDEN_MASK; -} - -/*! - * @brief Gets all WWDT status flags. - * - * This function gets all status flags. - * - * Example for getting Timeout Flag: - * @code - * uint32_t status; - * status = WWDT_GetStatusFlags(wwdt_base) & kWWDT_TimeoutFlag; - * @endcode - * @param base WWDT peripheral base address - * @return The status flags. This is the logical OR of members of the - * enumeration ::_wwdt_status_flags_t - */ -static inline uint32_t WWDT_GetStatusFlags(WWDT_Type *base) -{ -#if defined(FSL_FEATURE_WWDT_WDTRESET_FROM_PMC) && (FSL_FEATURE_WWDT_WDTRESET_FROM_PMC) - uint32_t status; - /* WDTOF is not set in case of WD reset - get info from PMC instead */ - status = (base->MOD & (WWDT_MOD_WDTOF_MASK | WWDT_MOD_WDINT_MASK)); - if (PMC->RESETCAUSE & PMC_RESETCAUSE_WDTRESET_MASK) - { - status |= kWWDT_TimeoutFlag; - } - return status; -#else - return (base->MOD & (WWDT_MOD_WDTOF_MASK | WWDT_MOD_WDINT_MASK)); -#endif /*FSL_FEATURE_WWDT_WDTRESET_FROM_PMC*/ -} - -/*! - * @brief Clear WWDT flag. - * - * This function clears WWDT status flag. - * - * Example for clearing warning flag: - * @code - * WWDT_ClearStatusFlags(wwdt_base, kWWDT_WarningFlag); - * @endcode - * @param base WWDT peripheral base address - * @param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::_wwdt_status_flags_t - */ -void WWDT_ClearStatusFlags(WWDT_Type *base, uint32_t mask); - -/*! - * @brief Set the WWDT warning value. - * - * The WDWARNINT register determines the watchdog timer counter value that will generate a watchdog - * interrupt. When the watchdog timer counter is no longer greater than the value defined by - * WARNINT, an interrupt will be generated after the subsequent WDCLK. - * - * @param base WWDT peripheral base address - * @param warningValue WWDT warning value. - */ -static inline void WWDT_SetWarningValue(WWDT_Type *base, uint32_t warningValue) -{ - base->WARNINT = WWDT_WARNINT_WARNINT(warningValue); -} - -/*! - * @brief Set the WWDT timeout value. - * - * This function sets the timeout value. Every time a feed sequence occurs the value in the TC - * register is loaded into the Watchdog timer. Writing a value below 0xFF will cause 0xFF to be - * loaded into the TC register. Thus the minimum time-out interval is TWDCLK*256*4. - * If enableWatchdogProtect flag is true in wwdt_config_t config structure, any attempt to change - * the timeout value before the watchdog counter is below the warning and window values - * will cause a watchdog reset and set the WDTOF flag. - * - * @param base WWDT peripheral base address - * @param timeoutCount WWDT timeout value, count of WWDT clock tick. - */ -static inline void WWDT_SetTimeoutValue(WWDT_Type *base, uint32_t timeoutCount) -{ - base->TC = WWDT_TC_COUNT(timeoutCount); -} - -/*! - * @brief Sets the WWDT window value. - * - * The WINDOW register determines the highest TV value allowed when a watchdog feed is performed. - * If a feed sequence occurs when timer value is greater than the value in WINDOW, a watchdog - * event will occur. To disable windowing, set windowValue to 0xFFFFFF (maximum possible timer - * value) so windowing is not in effect. - * - * @param base WWDT peripheral base address - * @param windowValue WWDT window value. - */ -static inline void WWDT_SetWindowValue(WWDT_Type *base, uint32_t windowValue) -{ - base->WINDOW = WWDT_WINDOW_WINDOW(windowValue); -} - -/*! - * @brief Refreshes the WWDT timer. - * - * This function feeds the WWDT. - * This function should be called before WWDT timer is in timeout. Otherwise, a reset is asserted. - * - * @param base WWDT peripheral base address - */ -void WWDT_Refresh(WWDT_Type *base); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @}*/ - -#endif /* FSL_WWDT_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/fsl_device_registers.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/fsl_device_registers.h deleted file mode 100644 index 03536b56623..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/fsl_device_registers.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2014-2016 Freescale Semiconductor, Inc. - * Copyright 2016-2024 NXP - * SPDX-License-Identifier: BSD-3-Clause - * - */ - -#ifndef __FSL_DEVICE_REGISTERS_H__ -#define __FSL_DEVICE_REGISTERS_H__ - -/* - * Include the cpu specific register header files. - * - * The CPU macro should be declared in the project or makefile. - */ -#if (defined(CPU_MCXA156VLL) || defined(CPU_MCXA156VMP) || defined(CPU_MCXA156VPJ)) - -#define MCXA156_SERIES - -/* CMSIS-style register definitions */ -#include "MCXA156.h" -/* CPU specific feature definitions */ -#include "MCXA156_features.h" - -#else - #error "No valid CPU defined!" -#endif - -#endif /* __FSL_DEVICE_REGISTERS_H__ */ - -/******************************************************************************* - * EOF - ******************************************************************************/ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/gcc/MCXA156_flash.ld b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/gcc/MCXA156_flash.ld deleted file mode 100644 index efc24cbe150..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/gcc/MCXA156_flash.ld +++ /dev/null @@ -1,200 +0,0 @@ -/* -** ################################################################### -** Processors: MCXA156VLL -** MCXA156VMP -** MCXA156VPJ -** -** Compiler: GNU C Compiler -** Reference manual: MCXA18 User manual -** Version: rev. 1.0, 2022-03-29 -** Build: b240104 -** -** Abstract: -** Linker file for the GNU C Compiler -** -** Copyright 2016 Freescale Semiconductor, Inc. -** Copyright 2016-2024 NXP -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** ################################################################### -*/ - - - -/* Entry Point */ -ENTRY(Reset_Handler) - -HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400; -STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0800; - -/* Specify the memory areas */ -MEMORY -{ - m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000200 - m_text (RX) : ORIGIN = 0x00000200, LENGTH = 0x000FFE00 - m_data (RW) : ORIGIN = 0x20000000, LENGTH = 0x0001E000 - m_sramx0 (RW) : ORIGIN = 0x04000000, LENGTH = 0x00002000 -} - -/* Define output sections */ -SECTIONS -{ - /* The startup code goes first into internal flash */ - .interrupts : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - . = ALIGN(4); - } > m_interrupts - - /* The program code and other data goes into internal flash */ - .text : - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - KEEP (*(.init)) - KEEP (*(.fini)) - . = ALIGN(4); - } > m_text - - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > m_text - - .ARM : - { - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - } > m_text - - .ctors : - { - __CTOR_LIST__ = .; - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - from the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - __CTOR_END__ = .; - } > m_text - - .dtors : - { - __DTOR_LIST__ = .; - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - __DTOR_END__ = .; - } > m_text - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } > m_text - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - } > m_text - - .fini_array : - { - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - } > m_text - - __etext = .; /* define a global symbol at end of code */ - __DATA_ROM = .; /* Symbol is used by startup for data initialization */ - - .data : AT(__DATA_ROM) - { - . = ALIGN(4); - __DATA_RAM = .; - __data_start__ = .; /* create a global symbol at data start */ - *(.ramfunc*) /* for functions in ram */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - KEEP(*(.jcr*)) - . = ALIGN(4); - __data_end__ = .; /* define a global symbol at data end */ - } > m_data - - __DATA_END = __DATA_ROM + (__data_end__ - __data_start__); - text_end = ORIGIN(m_text) + LENGTH(m_text); - ASSERT(__DATA_END <= text_end, "region m_text overflowed with text and data") - - /* Uninitialized data section */ - .bss : - { - /* This is used by the startup in order to initialize the .bss section */ - . = ALIGN(4); - __START_BSS = .; - __bss_start__ = .; - *(.bss) - *(.bss*) - *(COMMON) - . = ALIGN(4); - __bss_end__ = .; - __END_BSS = .; - } > m_data - - .heap : - { - . = ALIGN(8); - __end__ = .; - PROVIDE(end = .); - __HeapBase = .; - . += HEAP_SIZE; - __HeapLimit = .; - __heap_limit = .; /* Add for _sbrk */ - } > m_data - - .stack : - { - . = ALIGN(8); - . += STACK_SIZE; - } > m_data - - - /* Initializes stack on the end of block */ - __StackTop = ORIGIN(m_data) + LENGTH(m_data); - __StackLimit = __StackTop - STACK_SIZE; - PROVIDE(__stack = __StackTop); - - .ARM.attributes 0 : { *(.ARM.attributes) } - - ASSERT(__StackLimit >= __HeapLimit, "region m_data overflowed with stack and heap") -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/gcc/MCXA156_ram.ld b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/gcc/MCXA156_ram.ld deleted file mode 100644 index 0abc11aca2c..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/gcc/MCXA156_ram.ld +++ /dev/null @@ -1,199 +0,0 @@ -/* -** ################################################################### -** Processors: MCXA156VLL -** MCXA156VMP -** MCXA156VPJ -** -** Compiler: GNU C Compiler -** Reference manual: MCXA18 User manual -** Version: rev. 1.0, 2022-03-29 -** Build: b240104 -** -** Abstract: -** Linker file for the GNU C Compiler -** -** Copyright 2016 Freescale Semiconductor, Inc. -** Copyright 2016-2024 NXP -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** ################################################################### -*/ - - - -/* Entry Point */ -ENTRY(Reset_Handler) - -HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400; -STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0800; - -/* Specify the memory areas */ -MEMORY -{ - m_interrupts (RX) : ORIGIN = 0x20000000, LENGTH = 0x00000200 - m_text (RX) : ORIGIN = 0x20000200, LENGTH = 0x00005E00 - m_data (RW) : ORIGIN = 0x20006000, LENGTH = 0x00018000 -} - -/* Define output sections */ -SECTIONS -{ - /* The startup code goes first into internal flash */ - .interrupts : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - . = ALIGN(4); - } > m_interrupts - - /* The program code and other data goes into internal flash */ - .text : - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - KEEP (*(.init)) - KEEP (*(.fini)) - . = ALIGN(4); - } > m_text - - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > m_text - - .ARM : - { - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - } > m_text - - .ctors : - { - __CTOR_LIST__ = .; - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - from the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - __CTOR_END__ = .; - } > m_text - - .dtors : - { - __DTOR_LIST__ = .; - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - __DTOR_END__ = .; - } > m_text - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } > m_text - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - } > m_text - - .fini_array : - { - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - } > m_text - - __etext = .; /* define a global symbol at end of code */ - __DATA_ROM = .; /* Symbol is used by startup for data initialization */ - - .data : AT(__DATA_ROM) - { - . = ALIGN(4); - __DATA_RAM = .; - __data_start__ = .; /* create a global symbol at data start */ - *(.ramfunc*) /* for functions in ram */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - KEEP(*(.jcr*)) - . = ALIGN(4); - __data_end__ = .; /* define a global symbol at data end */ - } > m_data - - __DATA_END = __DATA_ROM + (__data_end__ - __data_start__); - text_end = ORIGIN(m_text) + LENGTH(m_text); - ASSERT(__DATA_END <= text_end, "region m_text overflowed with text and data") - - /* Uninitialized data section */ - .bss : - { - /* This is used by the startup in order to initialize the .bss section */ - . = ALIGN(4); - __START_BSS = .; - __bss_start__ = .; - *(.bss) - *(.bss*) - *(COMMON) - . = ALIGN(4); - __bss_end__ = .; - __END_BSS = .; - } > m_data - - .heap : - { - . = ALIGN(8); - __end__ = .; - PROVIDE(end = .); - __HeapBase = .; - . += HEAP_SIZE; - __HeapLimit = .; - __heap_limit = .; /* Add for _sbrk */ - } > m_data - - .stack : - { - . = ALIGN(8); - . += STACK_SIZE; - } > m_data - - - /* Initializes stack on the end of block */ - __StackTop = ORIGIN(m_data) + LENGTH(m_data); - __StackLimit = __StackTop - STACK_SIZE; - PROVIDE(__stack = __StackTop); - - .ARM.attributes 0 : { *(.ARM.attributes) } - - ASSERT(__StackLimit >= __HeapLimit, "region m_data overflowed with stack and heap") -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/gcc/startup_MCXA156.S b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/gcc/startup_MCXA156.S deleted file mode 100644 index 22c1e7ae379..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/gcc/startup_MCXA156.S +++ /dev/null @@ -1,1211 +0,0 @@ -/* ------------------------------------------------------------------------- */ -/* @file: startup_MCXA156.s */ -/* @purpose: CMSIS Cortex-M33 Core Device Startup File */ -/* MCXA156 */ -/* @version: 1.0 */ -/* @date: 2022-3-29 */ -/* @build: b231107 */ -/* ------------------------------------------------------------------------- */ -/* */ -/* Copyright 1997-2016 Freescale Semiconductor, Inc. */ -/* Copyright 2016-2023 NXP */ -/* SPDX-License-Identifier: BSD-3-Clause */ -/*****************************************************************************/ -/* Version: GCC for ARM Embedded Processors */ -/*****************************************************************************/ - .syntax unified - .arch armv8-m.main - - .section .isr_vector, "a" - .align 2 - .globl __Vectors -__Vectors: - .long __StackTop /* Top of Stack */ - .long Reset_Handler /* Reset Handler */ - .long NMI_Handler /* NMI Handler*/ - .long HardFault_Handler /* Hard Fault Handler*/ - .long MemManage_Handler /* MPU Fault Handler*/ - .long BusFault_Handler /* Bus Fault Handler*/ - .long UsageFault_Handler /* Usage Fault Handler*/ - .long SecureFault_Handler /* Secure Fault Handler*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long SVC_Handler /* SVCall Handler*/ - .long DebugMon_Handler /* Debug Monitor Handler*/ - .long 0 /* Reserved*/ - .long PendSV_Handler /* PendSV Handler*/ - .long SysTick_Handler /* SysTick Handler*/ - - /* External Interrupts*/ - .long Reserved16_IRQHandler /* OR IRQ1 to IRQ53*/ - .long CMC_IRQHandler /* Core Mode Controller interrupt*/ - .long DMA_CH0_IRQHandler /* DMA3_0_CH0 error or transfer complete*/ - .long DMA_CH1_IRQHandler /* DMA3_0_CH1 error or transfer complete*/ - .long DMA_CH2_IRQHandler /* DMA3_0_CH2 error or transfer complete*/ - .long DMA_CH3_IRQHandler /* DMA3_0_CH3 error or transfer complete*/ - .long DMA_CH4_IRQHandler /* DMA3_0_CH4 error or transfer complete*/ - .long DMA_CH5_IRQHandler /* DMA3_0_CH5 error or transfer complete*/ - .long DMA_CH6_IRQHandler /* DMA3_0_CH6 error or transfer complete*/ - .long DMA_CH7_IRQHandler /* DMA3_0_CH7 error or transfer complete*/ - .long ERM0_SINGLE_BIT_IRQHandler /* ERM Single Bit error interrupt*/ - .long ERM0_MULTI_BIT_IRQHandler /* ERM Multi Bit error interrupt*/ - .long FMU0_IRQHandler /* Flash Management Unit interrupt*/ - .long GLIKEY0_IRQHandler /* GLIKEY Interrupt */ - .long MBC0_IRQHandler /* MBC secure violation interrupt*/ - .long SCG0_IRQHandler /* System Clock Generator interrupt*/ - .long SPC0_IRQHandler /* System Power Controller interrupt*/ - .long VBAT0_IRQHandler /* VBAT interrupt*/ - .long WUU0_IRQHandler /* Wake Up Unit interrupt*/ - .long CAN0_IRQHandler /* Controller Area Network 0 interrupt*/ - .long Reserved36_IRQHandler /* Reserved interrupt*/ - .long Reserved37_IRQHandler /* Reserved interrupt*/ - .long Reserved38_IRQHandler /* Reserved interrupt*/ - .long FLEXIO_IRQHandler /* Flexible Input/Output interrupt*/ - .long I3C0_IRQHandler /* Improved Inter Integrated Circuit interrupt 0*/ - .long Reserved41_IRQHandler /* Reserved interrupt*/ - .long LPI2C0_IRQHandler /* Low-Power Inter Integrated Circuit interrupt*/ - .long LPI2C1_IRQHandler /* Low-Power Inter Integrated Circuit interrupt*/ - .long LPSPI0_IRQHandler /* Low-Power Serial Peripheral Interface interrupt*/ - .long LPSPI1_IRQHandler /* Low-Power Serial Peripheral Interface interrupt*/ - .long Reserved46_IRQHandler /* Reserved interrupt*/ - .long LPUART0_IRQHandler /* Low-Power Universal Asynchronous Receive/Transmit interrupt*/ - .long LPUART1_IRQHandler /* Low-Power Universal Asynchronous Receive/Transmit interrupt*/ - .long LPUART2_IRQHandler /* Low-Power Universal Asynchronous Receive/Transmit interrupt*/ - .long LPUART3_IRQHandler /* Low-Power Universal Asynchronous Receive/Transmit interrupt*/ - .long LPUART4_IRQHandler /* Low-Power Universal Asynchronous Receive/Transmit interrupt*/ - .long USB0_IRQHandler /* Universal Serial Bus - Full Speed interrupt*/ - .long Reserved53_IRQHandler /* Reserved interrupt*/ - .long CDOG0_IRQHandler /* Code Watchdog Timer 0 interrupt*/ - .long CTIMER0_IRQHandler /* Standard counter/timer 0 interrupt*/ - .long CTIMER1_IRQHandler /* Standard counter/timer 1 interrupt*/ - .long CTIMER2_IRQHandler /* Standard counter/timer 2 interrupt*/ - .long CTIMER3_IRQHandler /* Standard counter/timer 3 interrupt*/ - .long CTIMER4_IRQHandler /* Standard counter/timer 4 interrupt*/ - .long FLEXPWM0_RELOAD_ERROR_IRQHandler /* FlexPWM0_reload_error interrupt*/ - .long FLEXPWM0_FAULT_IRQHandler /* FlexPWM0_fault interrupt*/ - .long FLEXPWM0_SUBMODULE0_IRQHandler /* FlexPWM0 Submodule 0 capture/compare/reload interrupt*/ - .long FLEXPWM0_SUBMODULE1_IRQHandler /* FlexPWM0 Submodule 1 capture/compare/reload interrupt*/ - .long FLEXPWM0_SUBMODULE2_IRQHandler /* FlexPWM0 Submodule 2 capture/compare/reload interrupt*/ - .long Reserved65_IRQHandler /* Reserved interrupt*/ - .long QDC0_COMPARE_IRQHandler /* Compare*/ - .long QDC0_HOME_IRQHandler /* Home*/ - .long QDC0_WATCHDOG_IRQHandler /* Watchdog / Simultaneous A and B Change*/ - .long QDC0_INDEX_IRQHandler /* Index / Roll Over / Roll Under*/ - .long FREQME0_IRQHandler /* Frequency Measurement interrupt*/ - .long LPTMR0_IRQHandler /* Low Power Timer 0 interrupt*/ - .long Reserved72_IRQHandler /* Reserved interrupt*/ - .long OS_EVENT_IRQHandler /* OS event timer interrupt*/ - .long WAKETIMER0_IRQHandler /* Wake Timer Interrupt*/ - .long UTICK0_IRQHandler /* Micro-Tick Timer interrupt*/ - .long WWDT0_IRQHandler /* Windowed Watchdog Timer 0 interrupt*/ - .long Reserved77_IRQHandler /* Reserved interrupt*/ - .long ADC0_IRQHandler /* Analog-to-Digital Converter interrupt*/ - .long ADC1_IRQHandler /* Analog-to-Digital Converter interrupt*/ - .long CMP0_IRQHandler /* Comparator interrupt*/ - .long CMP1_IRQHandler /* Comparator interrupt*/ - .long Reserved82_IRQHandler /* Reserved interrupt*/ - .long DAC0_IRQHandler /* Digital-to-Analog Converter 0 - General Purpose interrupt*/ - .long Reserved84_IRQHandler /* Reserved interrupt*/ - .long Reserved85_IRQHandler /* Reserved interrupt*/ - .long Reserved86_IRQHandler /* Reserved interrupt*/ - .long GPIO0_IRQHandler /* General Purpose Input/Output interrupt 0*/ - .long GPIO1_IRQHandler /* General Purpose Input/Output interrupt 1*/ - .long GPIO2_IRQHandler /* General Purpose Input/Output interrupt 2*/ - .long GPIO3_IRQHandler /* General Purpose Input/Output interrupt 3*/ - .long GPIO4_IRQHandler /* General Purpose Input/Output interrupt 4*/ - .long Reserved92_IRQHandler /* Reserved interrupt*/ - .long LPI2C2_IRQHandler /* Low-Power Inter Integrated Circuit interrupt*/ - .long LPI2C3_IRQHandler /* Low-Power Inter Integrated Circuit interrupt*/ - .long FLEXPWM1_RELOAD_ERROR_IRQHandler /* FlexPWM1_reload_error interrupt*/ - .long FLEXPWM1_FAULT_IRQHandler /* FlexPWM1_fault interrupt*/ - .long FLEXPWM1_SUBMODULE0_IRQHandler /* FlexPWM1 Submodule 0 capture/compare/reload interrupt*/ - .long FLEXPWM1_SUBMODULE1_IRQHandler /* FlexPWM1 Submodule 1 capture/compare/reload interrupt*/ - .long FLEXPWM1_SUBMODULE2_IRQHandler /* FlexPWM1 Submodule 2 capture/compare/reload interrupt*/ - .long Reserved100_IRQHandler /* Reserved interrupt*/ - .long QDC1_COMPARE_IRQHandler /* Compare*/ - .long QDC1_HOME_IRQHandler /* Home*/ - .long QDC1_WATCHDOG_IRQHandler /* Watchdog / Simultaneous A and B Change*/ - .long QDC1_INDEX_IRQHandler /* Index / Roll Over / Roll Under*/ - - .size __Vectors, . - __Vectors - - .text - .thumb - -#if defined (__cplusplus) -#ifdef __REDLIB__ -#error Redlib does not support C++ -#endif -#endif -/* Reset Handler */ - - .thumb_func - .align 2 - .globl Reset_Handler - .weak Reset_Handler - .type Reset_Handler, %function -Reset_Handler: - cpsid i /* Mask interrupts */ - .equ VTOR, 0xE000ED08 - ldr r0, =VTOR - ldr r1, =__Vectors - str r1, [r0] - ldr r2, [r1] - msr msp, r2 - ldr r0, =__StackLimit - msr msplim, r0 -#ifndef __NO_SYSTEM_INIT - ldr r0,=SystemInit - blx r0 -#endif -/* Loop to copy data from read only memory to RAM. The ranges - * of copy from/to are specified by following symbols evaluated in - * linker script. - * __etext: End of code section, i.e., begin of data sections to copy from. - * __data_start__/__data_end__: RAM address range that data should be - * copied to. Both must be aligned to 4 bytes boundary. */ - - ldr r1, =__etext - ldr r2, =__data_start__ - ldr r3, =__data_end__ - -#if 1 -/* Here are two copies of loop implemenations. First one favors code size - * and the second one favors performance. Default uses the first one. - * Change to "#if 0" to use the second one */ -.LC0: - cmp r2, r3 - ittt lt - ldrlt r0, [r1], #4 - strlt r0, [r2], #4 - blt .LC0 -#else - subs r3, r2 - ble .LC1 -.LC0: - subs r3, #4 - ldr r0, [r1, r3] - str r0, [r2, r3] - bgt .LC0 -.LC1: -#endif - -#ifdef __STARTUP_CLEAR_BSS -/* This part of work usually is done in C library startup code. Otherwise, - * define this macro to enable it in this startup. - * - * Loop to zero out BSS section, which uses following symbols - * in linker script: - * __bss_start__: start of BSS section. Must align to 4 - * __bss_end__: end of BSS section. Must align to 4 - */ - ldr r1, =__bss_start__ - ldr r2, =__bss_end__ - - movs r0, 0 -.LC2: - cmp r1, r2 - itt lt - strlt r0, [r1], #4 - blt .LC2 -#endif /* __STARTUP_CLEAR_BSS */ - -/* Add stack / heap initializaiton */ - movs r0, 0 - ldr r1, =__HeapBase - ldr r2, =__HeapLimit -.LC3: - cmp r1, r2 - itt lt - strlt r0, [r1], #4 - blt .LC3 - - ldr r1, =__StackLimit - ldr r2, =__StackTop -.LC4: - cmp r1, r2 - itt lt - strlt r0, [r1], #4 - blt .LC4 - -/*End of stack / heap initializaiton */ - cpsie i /* Unmask interrupts */ -#ifndef __START -#ifdef __REDLIB__ -#define __START __main -#else -#define __START _start -#endif -#endif -#ifndef __ATOLLIC__ - ldr r0,=__START - blx r0 -#else - ldr r0,=__libc_init_array - blx r0 - ldr r0,=main - bx r0 -#endif - .pool - .size Reset_Handler, . - Reset_Handler - - .align 1 - .thumb_func - .weak DefaultISR - .type DefaultISR, %function -DefaultISR: - b DefaultISR - .size DefaultISR, . - DefaultISR - - .align 1 - .thumb_func - .weak NMI_Handler - .type NMI_Handler, %function -NMI_Handler: - ldr r0,=NMI_Handler - bx r0 - .size NMI_Handler, . - NMI_Handler - - .align 1 - .thumb_func - .weak HardFault_Handler - .type HardFault_Handler, %function -HardFault_Handler: - ldr r0,=HardFault_Handler - bx r0 - .size HardFault_Handler, . - HardFault_Handler - - .align 1 - .thumb_func - .weak SVC_Handler - .type SVC_Handler, %function -SVC_Handler: - ldr r0,=SVC_Handler - bx r0 - .size SVC_Handler, . - SVC_Handler - - .align 1 - .thumb_func - .weak PendSV_Handler - .type PendSV_Handler, %function -PendSV_Handler: - ldr r0,=PendSV_Handler - bx r0 - .size PendSV_Handler, . - PendSV_Handler - - .align 1 - .thumb_func - .weak SysTick_Handler - .type SysTick_Handler, %function -SysTick_Handler: - ldr r0,=SysTick_Handler - bx r0 - .size SysTick_Handler, . - SysTick_Handler - - .align 1 - .thumb_func - .weak Reserved16_IRQHandler - .type Reserved16_IRQHandler, %function -Reserved16_IRQHandler: - ldr r0,=Reserved16_DriverIRQHandler - bx r0 - .size Reserved16_IRQHandler, . - Reserved16_IRQHandler - - .align 1 - .thumb_func - .weak CMC_IRQHandler - .type CMC_IRQHandler, %function -CMC_IRQHandler: - ldr r0,=CMC_DriverIRQHandler - bx r0 - .size CMC_IRQHandler, . - CMC_IRQHandler - - .align 1 - .thumb_func - .weak DMA_CH0_IRQHandler - .type DMA_CH0_IRQHandler, %function -DMA_CH0_IRQHandler: - ldr r0,=DMA_CH0_DriverIRQHandler - bx r0 - .size DMA_CH0_IRQHandler, . - DMA_CH0_IRQHandler - - .align 1 - .thumb_func - .weak DMA_CH1_IRQHandler - .type DMA_CH1_IRQHandler, %function -DMA_CH1_IRQHandler: - ldr r0,=DMA_CH1_DriverIRQHandler - bx r0 - .size DMA_CH1_IRQHandler, . - DMA_CH1_IRQHandler - - .align 1 - .thumb_func - .weak DMA_CH2_IRQHandler - .type DMA_CH2_IRQHandler, %function -DMA_CH2_IRQHandler: - ldr r0,=DMA_CH2_DriverIRQHandler - bx r0 - .size DMA_CH2_IRQHandler, . - DMA_CH2_IRQHandler - - .align 1 - .thumb_func - .weak DMA_CH3_IRQHandler - .type DMA_CH3_IRQHandler, %function -DMA_CH3_IRQHandler: - ldr r0,=DMA_CH3_DriverIRQHandler - bx r0 - .size DMA_CH3_IRQHandler, . - DMA_CH3_IRQHandler - - .align 1 - .thumb_func - .weak DMA_CH4_IRQHandler - .type DMA_CH4_IRQHandler, %function -DMA_CH4_IRQHandler: - ldr r0,=DMA_CH4_DriverIRQHandler - bx r0 - .size DMA_CH4_IRQHandler, . - DMA_CH4_IRQHandler - - .align 1 - .thumb_func - .weak DMA_CH5_IRQHandler - .type DMA_CH5_IRQHandler, %function -DMA_CH5_IRQHandler: - ldr r0,=DMA_CH5_DriverIRQHandler - bx r0 - .size DMA_CH5_IRQHandler, . - DMA_CH5_IRQHandler - - .align 1 - .thumb_func - .weak DMA_CH6_IRQHandler - .type DMA_CH6_IRQHandler, %function -DMA_CH6_IRQHandler: - ldr r0,=DMA_CH6_DriverIRQHandler - bx r0 - .size DMA_CH6_IRQHandler, . - DMA_CH6_IRQHandler - - .align 1 - .thumb_func - .weak DMA_CH7_IRQHandler - .type DMA_CH7_IRQHandler, %function -DMA_CH7_IRQHandler: - ldr r0,=DMA_CH7_DriverIRQHandler - bx r0 - .size DMA_CH7_IRQHandler, . - DMA_CH7_IRQHandler - - .align 1 - .thumb_func - .weak ERM0_SINGLE_BIT_IRQHandler - .type ERM0_SINGLE_BIT_IRQHandler, %function -ERM0_SINGLE_BIT_IRQHandler: - ldr r0,=ERM0_SINGLE_BIT_DriverIRQHandler - bx r0 - .size ERM0_SINGLE_BIT_IRQHandler, . - ERM0_SINGLE_BIT_IRQHandler - - .align 1 - .thumb_func - .weak ERM0_MULTI_BIT_IRQHandler - .type ERM0_MULTI_BIT_IRQHandler, %function -ERM0_MULTI_BIT_IRQHandler: - ldr r0,=ERM0_MULTI_BIT_DriverIRQHandler - bx r0 - .size ERM0_MULTI_BIT_IRQHandler, . - ERM0_MULTI_BIT_IRQHandler - - .align 1 - .thumb_func - .weak FMU0_IRQHandler - .type FMU0_IRQHandler, %function -FMU0_IRQHandler: - ldr r0,=FMU0_DriverIRQHandler - bx r0 - .size FMU0_IRQHandler, . - FMU0_IRQHandler - - .align 1 - .thumb_func - .weak GLIKEY0_IRQHandler - .type GLIKEY0_IRQHandler, %function -GLIKEY0_IRQHandler: - ldr r0,=GLIKEY0_DriverIRQHandler - bx r0 - .size GLIKEY0_IRQHandler, . - GLIKEY0_IRQHandler - - .align 1 - .thumb_func - .weak MBC0_IRQHandler - .type MBC0_IRQHandler, %function -MBC0_IRQHandler: - ldr r0,=MBC0_DriverIRQHandler - bx r0 - .size MBC0_IRQHandler, . - MBC0_IRQHandler - - .align 1 - .thumb_func - .weak SCG0_IRQHandler - .type SCG0_IRQHandler, %function -SCG0_IRQHandler: - ldr r0,=SCG0_DriverIRQHandler - bx r0 - .size SCG0_IRQHandler, . - SCG0_IRQHandler - - .align 1 - .thumb_func - .weak SPC0_IRQHandler - .type SPC0_IRQHandler, %function -SPC0_IRQHandler: - ldr r0,=SPC0_DriverIRQHandler - bx r0 - .size SPC0_IRQHandler, . - SPC0_IRQHandler - - .align 1 - .thumb_func - .weak VBAT0_IRQHandler - .type VBAT0_IRQHandler, %function -VBAT0_IRQHandler: - ldr r0,=VBAT0_DriverIRQHandler - bx r0 - .size VBAT0_IRQHandler, . - VBAT0_IRQHandler - - .align 1 - .thumb_func - .weak WUU0_IRQHandler - .type WUU0_IRQHandler, %function -WUU0_IRQHandler: - ldr r0,=WUU0_DriverIRQHandler - bx r0 - .size WUU0_IRQHandler, . - WUU0_IRQHandler - - .align 1 - .thumb_func - .weak CAN0_IRQHandler - .type CAN0_IRQHandler, %function -CAN0_IRQHandler: - ldr r0,=CAN0_DriverIRQHandler - bx r0 - .size CAN0_IRQHandler, . - CAN0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved36_IRQHandler - .type Reserved36_IRQHandler, %function -Reserved36_IRQHandler: - ldr r0,=Reserved36_DriverIRQHandler - bx r0 - .size Reserved36_IRQHandler, . - Reserved36_IRQHandler - - .align 1 - .thumb_func - .weak Reserved37_IRQHandler - .type Reserved37_IRQHandler, %function -Reserved37_IRQHandler: - ldr r0,=Reserved37_DriverIRQHandler - bx r0 - .size Reserved37_IRQHandler, . - Reserved37_IRQHandler - - .align 1 - .thumb_func - .weak Reserved38_IRQHandler - .type Reserved38_IRQHandler, %function -Reserved38_IRQHandler: - ldr r0,=Reserved38_DriverIRQHandler - bx r0 - .size Reserved38_IRQHandler, . - Reserved38_IRQHandler - - .align 1 - .thumb_func - .weak FLEXIO_IRQHandler - .type FLEXIO_IRQHandler, %function -FLEXIO_IRQHandler: - ldr r0,=FLEXIO_DriverIRQHandler - bx r0 - .size FLEXIO_IRQHandler, . - FLEXIO_IRQHandler - - .align 1 - .thumb_func - .weak I3C0_IRQHandler - .type I3C0_IRQHandler, %function -I3C0_IRQHandler: - ldr r0,=I3C0_DriverIRQHandler - bx r0 - .size I3C0_IRQHandler, . - I3C0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved41_IRQHandler - .type Reserved41_IRQHandler, %function -Reserved41_IRQHandler: - ldr r0,=Reserved41_DriverIRQHandler - bx r0 - .size Reserved41_IRQHandler, . - Reserved41_IRQHandler - - .align 1 - .thumb_func - .weak LPI2C0_IRQHandler - .type LPI2C0_IRQHandler, %function -LPI2C0_IRQHandler: - ldr r0,=LPI2C0_DriverIRQHandler - bx r0 - .size LPI2C0_IRQHandler, . - LPI2C0_IRQHandler - - .align 1 - .thumb_func - .weak LPI2C1_IRQHandler - .type LPI2C1_IRQHandler, %function -LPI2C1_IRQHandler: - ldr r0,=LPI2C1_DriverIRQHandler - bx r0 - .size LPI2C1_IRQHandler, . - LPI2C1_IRQHandler - - .align 1 - .thumb_func - .weak LPSPI0_IRQHandler - .type LPSPI0_IRQHandler, %function -LPSPI0_IRQHandler: - ldr r0,=LPSPI0_DriverIRQHandler - bx r0 - .size LPSPI0_IRQHandler, . - LPSPI0_IRQHandler - - .align 1 - .thumb_func - .weak LPSPI1_IRQHandler - .type LPSPI1_IRQHandler, %function -LPSPI1_IRQHandler: - ldr r0,=LPSPI1_DriverIRQHandler - bx r0 - .size LPSPI1_IRQHandler, . - LPSPI1_IRQHandler - - .align 1 - .thumb_func - .weak Reserved46_IRQHandler - .type Reserved46_IRQHandler, %function -Reserved46_IRQHandler: - ldr r0,=Reserved46_DriverIRQHandler - bx r0 - .size Reserved46_IRQHandler, . - Reserved46_IRQHandler - - .align 1 - .thumb_func - .weak LPUART0_IRQHandler - .type LPUART0_IRQHandler, %function -LPUART0_IRQHandler: - ldr r0,=LPUART0_DriverIRQHandler - bx r0 - .size LPUART0_IRQHandler, . - LPUART0_IRQHandler - - .align 1 - .thumb_func - .weak LPUART1_IRQHandler - .type LPUART1_IRQHandler, %function -LPUART1_IRQHandler: - ldr r0,=LPUART1_DriverIRQHandler - bx r0 - .size LPUART1_IRQHandler, . - LPUART1_IRQHandler - - .align 1 - .thumb_func - .weak LPUART2_IRQHandler - .type LPUART2_IRQHandler, %function -LPUART2_IRQHandler: - ldr r0,=LPUART2_DriverIRQHandler - bx r0 - .size LPUART2_IRQHandler, . - LPUART2_IRQHandler - - .align 1 - .thumb_func - .weak LPUART3_IRQHandler - .type LPUART3_IRQHandler, %function -LPUART3_IRQHandler: - ldr r0,=LPUART3_DriverIRQHandler - bx r0 - .size LPUART3_IRQHandler, . - LPUART3_IRQHandler - - .align 1 - .thumb_func - .weak LPUART4_IRQHandler - .type LPUART4_IRQHandler, %function -LPUART4_IRQHandler: - ldr r0,=LPUART4_DriverIRQHandler - bx r0 - .size LPUART4_IRQHandler, . - LPUART4_IRQHandler - - .align 1 - .thumb_func - .weak USB0_IRQHandler - .type USB0_IRQHandler, %function -USB0_IRQHandler: - ldr r0,=USB0_DriverIRQHandler - bx r0 - .size USB0_IRQHandler, . - USB0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved53_IRQHandler - .type Reserved53_IRQHandler, %function -Reserved53_IRQHandler: - ldr r0,=Reserved53_DriverIRQHandler - bx r0 - .size Reserved53_IRQHandler, . - Reserved53_IRQHandler - - .align 1 - .thumb_func - .weak CDOG0_IRQHandler - .type CDOG0_IRQHandler, %function -CDOG0_IRQHandler: - ldr r0,=CDOG0_DriverIRQHandler - bx r0 - .size CDOG0_IRQHandler, . - CDOG0_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER0_IRQHandler - .type CTIMER0_IRQHandler, %function -CTIMER0_IRQHandler: - ldr r0,=CTIMER0_DriverIRQHandler - bx r0 - .size CTIMER0_IRQHandler, . - CTIMER0_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER1_IRQHandler - .type CTIMER1_IRQHandler, %function -CTIMER1_IRQHandler: - ldr r0,=CTIMER1_DriverIRQHandler - bx r0 - .size CTIMER1_IRQHandler, . - CTIMER1_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER2_IRQHandler - .type CTIMER2_IRQHandler, %function -CTIMER2_IRQHandler: - ldr r0,=CTIMER2_DriverIRQHandler - bx r0 - .size CTIMER2_IRQHandler, . - CTIMER2_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER3_IRQHandler - .type CTIMER3_IRQHandler, %function -CTIMER3_IRQHandler: - ldr r0,=CTIMER3_DriverIRQHandler - bx r0 - .size CTIMER3_IRQHandler, . - CTIMER3_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER4_IRQHandler - .type CTIMER4_IRQHandler, %function -CTIMER4_IRQHandler: - ldr r0,=CTIMER4_DriverIRQHandler - bx r0 - .size CTIMER4_IRQHandler, . - CTIMER4_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_RELOAD_ERROR_IRQHandler - .type FLEXPWM0_RELOAD_ERROR_IRQHandler, %function -FLEXPWM0_RELOAD_ERROR_IRQHandler: - ldr r0,=FLEXPWM0_RELOAD_ERROR_DriverIRQHandler - bx r0 - .size FLEXPWM0_RELOAD_ERROR_IRQHandler, . - FLEXPWM0_RELOAD_ERROR_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_FAULT_IRQHandler - .type FLEXPWM0_FAULT_IRQHandler, %function -FLEXPWM0_FAULT_IRQHandler: - ldr r0,=FLEXPWM0_FAULT_DriverIRQHandler - bx r0 - .size FLEXPWM0_FAULT_IRQHandler, . - FLEXPWM0_FAULT_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE0_IRQHandler - .type FLEXPWM0_SUBMODULE0_IRQHandler, %function -FLEXPWM0_SUBMODULE0_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE0_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE0_IRQHandler, . - FLEXPWM0_SUBMODULE0_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE1_IRQHandler - .type FLEXPWM0_SUBMODULE1_IRQHandler, %function -FLEXPWM0_SUBMODULE1_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE1_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE1_IRQHandler, . - FLEXPWM0_SUBMODULE1_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE2_IRQHandler - .type FLEXPWM0_SUBMODULE2_IRQHandler, %function -FLEXPWM0_SUBMODULE2_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE2_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE2_IRQHandler, . - FLEXPWM0_SUBMODULE2_IRQHandler - - .align 1 - .thumb_func - .weak Reserved65_IRQHandler - .type Reserved65_IRQHandler, %function -Reserved65_IRQHandler: - ldr r0,=Reserved65_DriverIRQHandler - bx r0 - .size Reserved65_IRQHandler, . - Reserved65_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_COMPARE_IRQHandler - .type QDC0_COMPARE_IRQHandler, %function -QDC0_COMPARE_IRQHandler: - ldr r0,=QDC0_COMPARE_DriverIRQHandler - bx r0 - .size QDC0_COMPARE_IRQHandler, . - QDC0_COMPARE_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_HOME_IRQHandler - .type QDC0_HOME_IRQHandler, %function -QDC0_HOME_IRQHandler: - ldr r0,=QDC0_HOME_DriverIRQHandler - bx r0 - .size QDC0_HOME_IRQHandler, . - QDC0_HOME_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_WATCHDOG_IRQHandler - .type QDC0_WATCHDOG_IRQHandler, %function -QDC0_WATCHDOG_IRQHandler: - ldr r0,=QDC0_WATCHDOG_DriverIRQHandler - bx r0 - .size QDC0_WATCHDOG_IRQHandler, . - QDC0_WATCHDOG_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_INDEX_IRQHandler - .type QDC0_INDEX_IRQHandler, %function -QDC0_INDEX_IRQHandler: - ldr r0,=QDC0_INDEX_DriverIRQHandler - bx r0 - .size QDC0_INDEX_IRQHandler, . - QDC0_INDEX_IRQHandler - - .align 1 - .thumb_func - .weak FREQME0_IRQHandler - .type FREQME0_IRQHandler, %function -FREQME0_IRQHandler: - ldr r0,=FREQME0_DriverIRQHandler - bx r0 - .size FREQME0_IRQHandler, . - FREQME0_IRQHandler - - .align 1 - .thumb_func - .weak LPTMR0_IRQHandler - .type LPTMR0_IRQHandler, %function -LPTMR0_IRQHandler: - ldr r0,=LPTMR0_DriverIRQHandler - bx r0 - .size LPTMR0_IRQHandler, . - LPTMR0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved72_IRQHandler - .type Reserved72_IRQHandler, %function -Reserved72_IRQHandler: - ldr r0,=Reserved72_DriverIRQHandler - bx r0 - .size Reserved72_IRQHandler, . - Reserved72_IRQHandler - - .align 1 - .thumb_func - .weak OS_EVENT_IRQHandler - .type OS_EVENT_IRQHandler, %function -OS_EVENT_IRQHandler: - ldr r0,=OS_EVENT_DriverIRQHandler - bx r0 - .size OS_EVENT_IRQHandler, . - OS_EVENT_IRQHandler - - .align 1 - .thumb_func - .weak WAKETIMER0_IRQHandler - .type WAKETIMER0_IRQHandler, %function -WAKETIMER0_IRQHandler: - ldr r0,=WAKETIMER0_DriverIRQHandler - bx r0 - .size WAKETIMER0_IRQHandler, . - WAKETIMER0_IRQHandler - - .align 1 - .thumb_func - .weak UTICK0_IRQHandler - .type UTICK0_IRQHandler, %function -UTICK0_IRQHandler: - ldr r0,=UTICK0_DriverIRQHandler - bx r0 - .size UTICK0_IRQHandler, . - UTICK0_IRQHandler - - .align 1 - .thumb_func - .weak WWDT0_IRQHandler - .type WWDT0_IRQHandler, %function -WWDT0_IRQHandler: - ldr r0,=WWDT0_DriverIRQHandler - bx r0 - .size WWDT0_IRQHandler, . - WWDT0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved77_IRQHandler - .type Reserved77_IRQHandler, %function -Reserved77_IRQHandler: - ldr r0,=Reserved77_DriverIRQHandler - bx r0 - .size Reserved77_IRQHandler, . - Reserved77_IRQHandler - - .align 1 - .thumb_func - .weak ADC0_IRQHandler - .type ADC0_IRQHandler, %function -ADC0_IRQHandler: - ldr r0,=ADC0_DriverIRQHandler - bx r0 - .size ADC0_IRQHandler, . - ADC0_IRQHandler - - .align 1 - .thumb_func - .weak ADC1_IRQHandler - .type ADC1_IRQHandler, %function -ADC1_IRQHandler: - ldr r0,=ADC1_DriverIRQHandler - bx r0 - .size ADC1_IRQHandler, . - ADC1_IRQHandler - - .align 1 - .thumb_func - .weak CMP0_IRQHandler - .type CMP0_IRQHandler, %function -CMP0_IRQHandler: - ldr r0,=CMP0_DriverIRQHandler - bx r0 - .size CMP0_IRQHandler, . - CMP0_IRQHandler - - .align 1 - .thumb_func - .weak CMP1_IRQHandler - .type CMP1_IRQHandler, %function -CMP1_IRQHandler: - ldr r0,=CMP1_DriverIRQHandler - bx r0 - .size CMP1_IRQHandler, . - CMP1_IRQHandler - - .align 1 - .thumb_func - .weak Reserved82_IRQHandler - .type Reserved82_IRQHandler, %function -Reserved82_IRQHandler: - ldr r0,=Reserved82_DriverIRQHandler - bx r0 - .size Reserved82_IRQHandler, . - Reserved82_IRQHandler - - .align 1 - .thumb_func - .weak DAC0_IRQHandler - .type DAC0_IRQHandler, %function -DAC0_IRQHandler: - ldr r0,=DAC0_DriverIRQHandler - bx r0 - .size DAC0_IRQHandler, . - DAC0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved84_IRQHandler - .type Reserved84_IRQHandler, %function -Reserved84_IRQHandler: - ldr r0,=Reserved84_DriverIRQHandler - bx r0 - .size Reserved84_IRQHandler, . - Reserved84_IRQHandler - - .align 1 - .thumb_func - .weak Reserved85_IRQHandler - .type Reserved85_IRQHandler, %function -Reserved85_IRQHandler: - ldr r0,=Reserved85_DriverIRQHandler - bx r0 - .size Reserved85_IRQHandler, . - Reserved85_IRQHandler - - .align 1 - .thumb_func - .weak Reserved86_IRQHandler - .type Reserved86_IRQHandler, %function -Reserved86_IRQHandler: - ldr r0,=Reserved86_DriverIRQHandler - bx r0 - .size Reserved86_IRQHandler, . - Reserved86_IRQHandler - - .align 1 - .thumb_func - .weak GPIO0_IRQHandler - .type GPIO0_IRQHandler, %function -GPIO0_IRQHandler: - ldr r0,=GPIO0_DriverIRQHandler - bx r0 - .size GPIO0_IRQHandler, . - GPIO0_IRQHandler - - .align 1 - .thumb_func - .weak GPIO1_IRQHandler - .type GPIO1_IRQHandler, %function -GPIO1_IRQHandler: - ldr r0,=GPIO1_DriverIRQHandler - bx r0 - .size GPIO1_IRQHandler, . - GPIO1_IRQHandler - - .align 1 - .thumb_func - .weak GPIO2_IRQHandler - .type GPIO2_IRQHandler, %function -GPIO2_IRQHandler: - ldr r0,=GPIO2_DriverIRQHandler - bx r0 - .size GPIO2_IRQHandler, . - GPIO2_IRQHandler - - .align 1 - .thumb_func - .weak GPIO3_IRQHandler - .type GPIO3_IRQHandler, %function -GPIO3_IRQHandler: - ldr r0,=GPIO3_DriverIRQHandler - bx r0 - .size GPIO3_IRQHandler, . - GPIO3_IRQHandler - - .align 1 - .thumb_func - .weak GPIO4_IRQHandler - .type GPIO4_IRQHandler, %function -GPIO4_IRQHandler: - ldr r0,=GPIO4_DriverIRQHandler - bx r0 - .size GPIO4_IRQHandler, . - GPIO4_IRQHandler - - .align 1 - .thumb_func - .weak Reserved92_IRQHandler - .type Reserved92_IRQHandler, %function -Reserved92_IRQHandler: - ldr r0,=Reserved92_DriverIRQHandler - bx r0 - .size Reserved92_IRQHandler, . - Reserved92_IRQHandler - - .align 1 - .thumb_func - .weak LPI2C2_IRQHandler - .type LPI2C2_IRQHandler, %function -LPI2C2_IRQHandler: - ldr r0,=LPI2C2_DriverIRQHandler - bx r0 - .size LPI2C2_IRQHandler, . - LPI2C2_IRQHandler - - .align 1 - .thumb_func - .weak LPI2C3_IRQHandler - .type LPI2C3_IRQHandler, %function -LPI2C3_IRQHandler: - ldr r0,=LPI2C3_DriverIRQHandler - bx r0 - .size LPI2C3_IRQHandler, . - LPI2C3_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_RELOAD_ERROR_IRQHandler - .type FLEXPWM1_RELOAD_ERROR_IRQHandler, %function -FLEXPWM1_RELOAD_ERROR_IRQHandler: - ldr r0,=FLEXPWM1_RELOAD_ERROR_DriverIRQHandler - bx r0 - .size FLEXPWM1_RELOAD_ERROR_IRQHandler, . - FLEXPWM1_RELOAD_ERROR_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_FAULT_IRQHandler - .type FLEXPWM1_FAULT_IRQHandler, %function -FLEXPWM1_FAULT_IRQHandler: - ldr r0,=FLEXPWM1_FAULT_DriverIRQHandler - bx r0 - .size FLEXPWM1_FAULT_IRQHandler, . - FLEXPWM1_FAULT_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_SUBMODULE0_IRQHandler - .type FLEXPWM1_SUBMODULE0_IRQHandler, %function -FLEXPWM1_SUBMODULE0_IRQHandler: - ldr r0,=FLEXPWM1_SUBMODULE0_DriverIRQHandler - bx r0 - .size FLEXPWM1_SUBMODULE0_IRQHandler, . - FLEXPWM1_SUBMODULE0_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_SUBMODULE1_IRQHandler - .type FLEXPWM1_SUBMODULE1_IRQHandler, %function -FLEXPWM1_SUBMODULE1_IRQHandler: - ldr r0,=FLEXPWM1_SUBMODULE1_DriverIRQHandler - bx r0 - .size FLEXPWM1_SUBMODULE1_IRQHandler, . - FLEXPWM1_SUBMODULE1_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_SUBMODULE2_IRQHandler - .type FLEXPWM1_SUBMODULE2_IRQHandler, %function -FLEXPWM1_SUBMODULE2_IRQHandler: - ldr r0,=FLEXPWM1_SUBMODULE2_DriverIRQHandler - bx r0 - .size FLEXPWM1_SUBMODULE2_IRQHandler, . - FLEXPWM1_SUBMODULE2_IRQHandler - - .align 1 - .thumb_func - .weak Reserved100_IRQHandler - .type Reserved100_IRQHandler, %function -Reserved100_IRQHandler: - ldr r0,=Reserved100_DriverIRQHandler - bx r0 - .size Reserved100_IRQHandler, . - Reserved100_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_COMPARE_IRQHandler - .type QDC1_COMPARE_IRQHandler, %function -QDC1_COMPARE_IRQHandler: - ldr r0,=QDC1_COMPARE_DriverIRQHandler - bx r0 - .size QDC1_COMPARE_IRQHandler, . - QDC1_COMPARE_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_HOME_IRQHandler - .type QDC1_HOME_IRQHandler, %function -QDC1_HOME_IRQHandler: - ldr r0,=QDC1_HOME_DriverIRQHandler - bx r0 - .size QDC1_HOME_IRQHandler, . - QDC1_HOME_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_WATCHDOG_IRQHandler - .type QDC1_WATCHDOG_IRQHandler, %function -QDC1_WATCHDOG_IRQHandler: - ldr r0,=QDC1_WATCHDOG_DriverIRQHandler - bx r0 - .size QDC1_WATCHDOG_IRQHandler, . - QDC1_WATCHDOG_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_INDEX_IRQHandler - .type QDC1_INDEX_IRQHandler, %function -QDC1_INDEX_IRQHandler: - ldr r0,=QDC1_INDEX_DriverIRQHandler - bx r0 - .size QDC1_INDEX_IRQHandler, . - QDC1_INDEX_IRQHandler - - -/* Macro to define default handlers. Default handler - * will be weak symbol and just dead loops. They can be - * overwritten by other handlers */ - .macro def_irq_handler handler_name - .weak \handler_name - .set \handler_name, DefaultISR - .endm -/* Exception Handlers */ - def_irq_handler MemManage_Handler - def_irq_handler BusFault_Handler - def_irq_handler UsageFault_Handler - def_irq_handler SecureFault_Handler - def_irq_handler DebugMon_Handler - def_irq_handler Reserved16_DriverIRQHandler - def_irq_handler CMC_DriverIRQHandler - def_irq_handler DMA_CH0_DriverIRQHandler - def_irq_handler DMA_CH1_DriverIRQHandler - def_irq_handler DMA_CH2_DriverIRQHandler - def_irq_handler DMA_CH3_DriverIRQHandler - def_irq_handler DMA_CH4_DriverIRQHandler - def_irq_handler DMA_CH5_DriverIRQHandler - def_irq_handler DMA_CH6_DriverIRQHandler - def_irq_handler DMA_CH7_DriverIRQHandler - def_irq_handler ERM0_SINGLE_BIT_DriverIRQHandler - def_irq_handler ERM0_MULTI_BIT_DriverIRQHandler - def_irq_handler FMU0_DriverIRQHandler - def_irq_handler GLIKEY0_DriverIRQHandler - def_irq_handler MBC0_DriverIRQHandler - def_irq_handler SCG0_DriverIRQHandler - def_irq_handler SPC0_DriverIRQHandler - def_irq_handler VBAT0_DriverIRQHandler - def_irq_handler WUU0_DriverIRQHandler - def_irq_handler CAN0_DriverIRQHandler - def_irq_handler Reserved36_DriverIRQHandler - def_irq_handler Reserved37_DriverIRQHandler - def_irq_handler Reserved38_DriverIRQHandler - def_irq_handler FLEXIO_DriverIRQHandler - def_irq_handler I3C0_DriverIRQHandler - def_irq_handler Reserved41_DriverIRQHandler - def_irq_handler LPI2C0_DriverIRQHandler - def_irq_handler LPI2C1_DriverIRQHandler - def_irq_handler LPSPI0_DriverIRQHandler - def_irq_handler LPSPI1_DriverIRQHandler - def_irq_handler Reserved46_DriverIRQHandler - def_irq_handler LPUART0_DriverIRQHandler - def_irq_handler LPUART1_DriverIRQHandler - def_irq_handler LPUART2_DriverIRQHandler - def_irq_handler LPUART3_DriverIRQHandler - def_irq_handler LPUART4_DriverIRQHandler - def_irq_handler USB0_DriverIRQHandler - def_irq_handler Reserved53_DriverIRQHandler - def_irq_handler CDOG0_DriverIRQHandler - def_irq_handler CTIMER0_DriverIRQHandler - def_irq_handler CTIMER1_DriverIRQHandler - def_irq_handler CTIMER2_DriverIRQHandler - def_irq_handler CTIMER3_DriverIRQHandler - def_irq_handler CTIMER4_DriverIRQHandler - def_irq_handler FLEXPWM0_RELOAD_ERROR_DriverIRQHandler - def_irq_handler FLEXPWM0_FAULT_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE0_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE1_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE2_DriverIRQHandler - def_irq_handler Reserved65_DriverIRQHandler - def_irq_handler QDC0_COMPARE_DriverIRQHandler - def_irq_handler QDC0_HOME_DriverIRQHandler - def_irq_handler QDC0_WATCHDOG_DriverIRQHandler - def_irq_handler QDC0_INDEX_DriverIRQHandler - def_irq_handler FREQME0_DriverIRQHandler - def_irq_handler LPTMR0_DriverIRQHandler - def_irq_handler Reserved72_DriverIRQHandler - def_irq_handler OS_EVENT_DriverIRQHandler - def_irq_handler WAKETIMER0_DriverIRQHandler - def_irq_handler UTICK0_DriverIRQHandler - def_irq_handler WWDT0_DriverIRQHandler - def_irq_handler Reserved77_DriverIRQHandler - def_irq_handler ADC0_DriverIRQHandler - def_irq_handler ADC1_DriverIRQHandler - def_irq_handler CMP0_DriverIRQHandler - def_irq_handler CMP1_DriverIRQHandler - def_irq_handler Reserved82_DriverIRQHandler - def_irq_handler DAC0_DriverIRQHandler - def_irq_handler Reserved84_DriverIRQHandler - def_irq_handler Reserved85_DriverIRQHandler - def_irq_handler Reserved86_DriverIRQHandler - def_irq_handler GPIO0_DriverIRQHandler - def_irq_handler GPIO1_DriverIRQHandler - def_irq_handler GPIO2_DriverIRQHandler - def_irq_handler GPIO3_DriverIRQHandler - def_irq_handler GPIO4_DriverIRQHandler - def_irq_handler Reserved92_DriverIRQHandler - def_irq_handler LPI2C2_DriverIRQHandler - def_irq_handler LPI2C3_DriverIRQHandler - def_irq_handler FLEXPWM1_RELOAD_ERROR_DriverIRQHandler - def_irq_handler FLEXPWM1_FAULT_DriverIRQHandler - def_irq_handler FLEXPWM1_SUBMODULE0_DriverIRQHandler - def_irq_handler FLEXPWM1_SUBMODULE1_DriverIRQHandler - def_irq_handler FLEXPWM1_SUBMODULE2_DriverIRQHandler - def_irq_handler Reserved100_DriverIRQHandler - def_irq_handler QDC1_COMPARE_DriverIRQHandler - def_irq_handler QDC1_HOME_DriverIRQHandler - def_irq_handler QDC1_WATCHDOG_DriverIRQHandler - def_irq_handler QDC1_INDEX_DriverIRQHandler - - .end diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/iar/MCXA156_flash.icf b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/iar/MCXA156_flash.icf deleted file mode 100644 index 028999f4904..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/iar/MCXA156_flash.icf +++ /dev/null @@ -1,84 +0,0 @@ -/* -** ################################################################### -** Processors: MCXA156VLL -** MCXA156VMP -** MCXA156VPJ -** -** Compiler: IAR ANSI C/C++ Compiler for ARM -** Reference manual: MCXA18 User manual -** Version: rev. 1.0, 2022-03-29 -** Build: b240104 -** -** Abstract: -** Linker file for the IAR ANSI C/C++ Compiler for ARM -** -** Copyright 2016 Freescale Semiconductor, Inc. -** Copyright 2016-2024 NXP -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** ################################################################### -*/ - - -/* Stack and Heap Sizes */ -if (isdefinedsymbol(__stack_size__)) { - define symbol __size_cstack__ = __stack_size__; -} else { - define symbol __size_cstack__ = 0x0400; -} - -if (isdefinedsymbol(__heap_size__)) { - define symbol __size_heap__ = __heap_size__; -} else { - define symbol __size_heap__ = 0x0400; -} - -define symbol m_interrupts_start = 0x00000000; -define symbol m_interrupts_end = 0x000001FF; - -define symbol m_text_start = 0x00000200; -define symbol m_text_end = 0x000FFFFF; - -define symbol m_data_start = 0x20000000; -define symbol m_data_end = 0x2001DFFF; - -define symbol m_sramx0_start = 0x04000000; -define symbol m_sramx0_end = 0x04001FFF; - -define memory mem with size = 4G; - -define region TEXT_region = mem:[from m_interrupts_start to m_interrupts_end] - | mem:[from m_text_start to m_text_end]; -define region DATA_region = mem:[from m_data_start to m_data_end-__size_cstack__] - | mem:[from m_sramx0_start to m_sramx0_end]; - -define region CSTACK_region = mem:[from m_data_end-__size_cstack__+1 to m_data_end]; -if (isdefinedsymbol(__use_shmem__)) { - define region rpmsg_sh_mem_region = mem:[from rpmsg_sh_mem_start to rpmsg_sh_mem_end]; -} - -define block CSTACK with alignment = 8, size = __size_cstack__ { }; -define block HEAP with alignment = 8, size = __size_heap__ { }; -define block RW { readwrite }; -define block ZI { zi }; - -initialize by copy { readwrite, section .textrw }; - -if (isdefinedsymbol(__USE_DLIB_PERTHREAD)) -{ - /* Required in a multi-threaded application */ - initialize by copy with packing = none { section __DLIB_PERTHREAD }; -} - - -place at address mem: m_interrupts_start { readonly section .intvec }; -place in TEXT_region { readonly }; -place in DATA_region { block RW }; -place in DATA_region { block ZI }; -place in DATA_region { last block HEAP }; -place in CSTACK_region { block CSTACK }; - - diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/iar/MCXA156_ram.icf b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/iar/MCXA156_ram.icf deleted file mode 100644 index a1b3e4274b1..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/iar/MCXA156_ram.icf +++ /dev/null @@ -1,80 +0,0 @@ -/* -** ################################################################### -** Processors: MCXA156VLL -** MCXA156VMP -** MCXA156VPJ -** -** Compiler: IAR ANSI C/C++ Compiler for ARM -** Reference manual: MCXA18 User manual -** Version: rev. 1.0, 2022-03-29 -** Build: b240104 -** -** Abstract: -** Linker file for the IAR ANSI C/C++ Compiler for ARM -** -** Copyright 2016 Freescale Semiconductor, Inc. -** Copyright 2016-2024 NXP -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** ################################################################### -*/ - - -/* Stack and Heap Sizes */ -if (isdefinedsymbol(__stack_size__)) { - define symbol __size_cstack__ = __stack_size__; -} else { - define symbol __size_cstack__ = 0x0400; -} - -if (isdefinedsymbol(__heap_size__)) { - define symbol __size_heap__ = __heap_size__; -} else { - define symbol __size_heap__ = 0x0400; -} - -define symbol m_interrupts_start = 0x20000000; -define symbol m_interrupts_end = 0x200001FF; - -define symbol m_text_start = 0x20000200; -define symbol m_text_end = 0x20005FFF; - -define symbol m_data_start = 0x20006000; -define symbol m_data_end = 0x2001DFFF; - -define memory mem with size = 4G; - -define region TEXT_region = mem:[from m_interrupts_start to m_interrupts_end] - | mem:[from m_text_start to m_text_end]; -define region DATA_region = mem:[from m_data_start to m_data_end-__size_cstack__]; - -define region CSTACK_region = mem:[from m_data_end-__size_cstack__+1 to m_data_end]; -if (isdefinedsymbol(__use_shmem__)) { - define region rpmsg_sh_mem_region = mem:[from rpmsg_sh_mem_start to rpmsg_sh_mem_end]; -} - -define block CSTACK with alignment = 8, size = __size_cstack__ { }; -define block HEAP with alignment = 8, size = __size_heap__ { }; -define block RW { readwrite }; -define block ZI { zi }; - -initialize by copy { readwrite, section .textrw }; - -if (isdefinedsymbol(__USE_DLIB_PERTHREAD)) -{ - /* Required in a multi-threaded application */ - initialize by copy with packing = none { section __DLIB_PERTHREAD }; -} - - -place at address mem: m_interrupts_start { readonly section .intvec }; -place in TEXT_region { readonly }; -place in DATA_region { block RW }; -place in DATA_region { block ZI }; -place in DATA_region { last block HEAP }; -place in CSTACK_region { block CSTACK }; - - diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/iar/startup_MCXA156.s b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/iar/startup_MCXA156.s deleted file mode 100644 index 00d2bccea5a..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/iar/startup_MCXA156.s +++ /dev/null @@ -1,953 +0,0 @@ -; ------------------------------------------------------------------------- -; @file: startup_MCXA156.s -; @purpose: CMSIS Cortex-M33 Core Device Startup File -; MCXA156 -; @version: 1.0 -; @date: 2022-3-29 -; @build: b231107 -; ------------------------------------------------------------------------- -; -; Copyright 1997-2016 Freescale Semiconductor, Inc. -; Copyright 2016-2023 NXP -; SPDX-License-Identifier: BSD-3-Clause -; -; The modules in this file are included in the libraries, and may be replaced -; by any user-defined modules that define the PUBLIC symbol _program_start or -; a user defined start symbol. -; To override the cstartup defined in the library, simply add your modified -; version to the workbench project. -; -; The vector table is normally located at address 0. -; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. -; The name "__vector_table" has special meaning for C-SPY: -; it is where the SP start value is found, and the NVIC vector -; table register (VTOR) is initialized to this address if != 0. -; -; Cortex-M version -; - - MODULE ?cstartup - - ;; Forward declaration of sections. - SECTION CSTACK:DATA:NOROOT(3) - - SECTION .intvec:CODE:NOROOT(2) - - EXTERN __iar_program_start - EXTERN SystemInit - PUBLIC __vector_table - PUBLIC __vector_table_0x1c - PUBLIC __Vectors - PUBLIC __Vectors_End - PUBLIC __Vectors_Size - - DATA - -__iar_init$$done: ; The vector table is not needed - ; until after copy initialization is done - -__vector_table - DCD sfe(CSTACK) - DCD Reset_Handler - - DCD NMI_Handler ;NMI Handler - DCD HardFault_Handler ;Hard Fault Handler - DCD MemManage_Handler ;MPU Fault Handler - DCD BusFault_Handler ;Bus Fault Handler - DCD UsageFault_Handler ;Usage Fault Handler -__vector_table_0x1c - DCD SecureFault_Handler ;Secure Fault Handler - DCD 0 ;Reserved - DCD 0 ;Reserved - DCD 0 ;Reserved - DCD SVC_Handler ;SVCall Handler - DCD DebugMon_Handler ;Debug Monitor Handler - DCD 0 ;Reserved - DCD PendSV_Handler ;PendSV Handler - DCD SysTick_Handler ;SysTick Handler - - ;External Interrupts - DCD Reserved16_IRQHandler ;OR IRQ1 to IRQ53 - DCD CMC_IRQHandler ;Core Mode Controller interrupt - DCD DMA_CH0_IRQHandler ;DMA3_0_CH0 error or transfer complete - DCD DMA_CH1_IRQHandler ;DMA3_0_CH1 error or transfer complete - DCD DMA_CH2_IRQHandler ;DMA3_0_CH2 error or transfer complete - DCD DMA_CH3_IRQHandler ;DMA3_0_CH3 error or transfer complete - DCD DMA_CH4_IRQHandler ;DMA3_0_CH4 error or transfer complete - DCD DMA_CH5_IRQHandler ;DMA3_0_CH5 error or transfer complete - DCD DMA_CH6_IRQHandler ;DMA3_0_CH6 error or transfer complete - DCD DMA_CH7_IRQHandler ;DMA3_0_CH7 error or transfer complete - DCD ERM0_SINGLE_BIT_IRQHandler ;ERM Single Bit error interrupt - DCD ERM0_MULTI_BIT_IRQHandler ;ERM Multi Bit error interrupt - DCD FMU0_IRQHandler ;Flash Management Unit interrupt - DCD GLIKEY0_IRQHandler ;GLIKEY Interrupt - DCD MBC0_IRQHandler ;MBC secure violation interrupt - DCD SCG0_IRQHandler ;System Clock Generator interrupt - DCD SPC0_IRQHandler ;System Power Controller interrupt - DCD VBAT0_IRQHandler ;VBAT interrupt - DCD WUU0_IRQHandler ;Wake Up Unit interrupt - DCD CAN0_IRQHandler ;Controller Area Network 0 interrupt - DCD Reserved36_IRQHandler ;Reserved interrupt - DCD Reserved37_IRQHandler ;Reserved interrupt - DCD Reserved38_IRQHandler ;Reserved interrupt - DCD FLEXIO_IRQHandler ;Flexible Input/Output interrupt - DCD I3C0_IRQHandler ;Improved Inter Integrated Circuit interrupt 0 - DCD Reserved41_IRQHandler ;Reserved interrupt - DCD LPI2C0_IRQHandler ;Low-Power Inter Integrated Circuit interrupt - DCD LPI2C1_IRQHandler ;Low-Power Inter Integrated Circuit interrupt - DCD LPSPI0_IRQHandler ;Low-Power Serial Peripheral Interface interrupt - DCD LPSPI1_IRQHandler ;Low-Power Serial Peripheral Interface interrupt - DCD Reserved46_IRQHandler ;Reserved interrupt - DCD LPUART0_IRQHandler ;Low-Power Universal Asynchronous Receive/Transmit interrupt - DCD LPUART1_IRQHandler ;Low-Power Universal Asynchronous Receive/Transmit interrupt - DCD LPUART2_IRQHandler ;Low-Power Universal Asynchronous Receive/Transmit interrupt - DCD LPUART3_IRQHandler ;Low-Power Universal Asynchronous Receive/Transmit interrupt - DCD LPUART4_IRQHandler ;Low-Power Universal Asynchronous Receive/Transmit interrupt - DCD USB0_IRQHandler ;Universal Serial Bus - Full Speed interrupt - DCD Reserved53_IRQHandler ;Reserved interrupt - DCD CDOG0_IRQHandler ;Code Watchdog Timer 0 interrupt - DCD CTIMER0_IRQHandler ;Standard counter/timer 0 interrupt - DCD CTIMER1_IRQHandler ;Standard counter/timer 1 interrupt - DCD CTIMER2_IRQHandler ;Standard counter/timer 2 interrupt - DCD CTIMER3_IRQHandler ;Standard counter/timer 3 interrupt - DCD CTIMER4_IRQHandler ;Standard counter/timer 4 interrupt - DCD FLEXPWM0_RELOAD_ERROR_IRQHandler ;FlexPWM0_reload_error interrupt - DCD FLEXPWM0_FAULT_IRQHandler ;FlexPWM0_fault interrupt - DCD FLEXPWM0_SUBMODULE0_IRQHandler ;FlexPWM0 Submodule 0 capture/compare/reload interrupt - DCD FLEXPWM0_SUBMODULE1_IRQHandler ;FlexPWM0 Submodule 1 capture/compare/reload interrupt - DCD FLEXPWM0_SUBMODULE2_IRQHandler ;FlexPWM0 Submodule 2 capture/compare/reload interrupt - DCD Reserved65_IRQHandler ;Reserved interrupt - DCD QDC0_COMPARE_IRQHandler ;Compare - DCD QDC0_HOME_IRQHandler ;Home - DCD QDC0_WATCHDOG_IRQHandler ;Watchdog / Simultaneous A and B Change - DCD QDC0_INDEX_IRQHandler ;Index / Roll Over / Roll Under - DCD FREQME0_IRQHandler ;Frequency Measurement interrupt - DCD LPTMR0_IRQHandler ;Low Power Timer 0 interrupt - DCD Reserved72_IRQHandler ;Reserved interrupt - DCD OS_EVENT_IRQHandler ;OS event timer interrupt - DCD WAKETIMER0_IRQHandler ;Wake Timer Interrupt - DCD UTICK0_IRQHandler ;Micro-Tick Timer interrupt - DCD WWDT0_IRQHandler ;Windowed Watchdog Timer 0 interrupt - DCD Reserved77_IRQHandler ;Reserved interrupt - DCD ADC0_IRQHandler ;Analog-to-Digital Converter interrupt - DCD ADC1_IRQHandler ;Analog-to-Digital Converter interrupt - DCD CMP0_IRQHandler ;Comparator interrupt - DCD CMP1_IRQHandler ;Comparator interrupt - DCD Reserved82_IRQHandler ;Reserved interrupt - DCD DAC0_IRQHandler ;Digital-to-Analog Converter 0 - General Purpose interrupt - DCD Reserved84_IRQHandler ;Reserved interrupt - DCD Reserved85_IRQHandler ;Reserved interrupt - DCD Reserved86_IRQHandler ;Reserved interrupt - DCD GPIO0_IRQHandler ;General Purpose Input/Output interrupt 0 - DCD GPIO1_IRQHandler ;General Purpose Input/Output interrupt 1 - DCD GPIO2_IRQHandler ;General Purpose Input/Output interrupt 2 - DCD GPIO3_IRQHandler ;General Purpose Input/Output interrupt 3 - DCD GPIO4_IRQHandler ;General Purpose Input/Output interrupt 4 - DCD Reserved92_IRQHandler ;Reserved interrupt - DCD LPI2C2_IRQHandler ;Low-Power Inter Integrated Circuit interrupt - DCD LPI2C3_IRQHandler ;Low-Power Inter Integrated Circuit interrupt - DCD FLEXPWM1_RELOAD_ERROR_IRQHandler ;FlexPWM1_reload_error interrupt - DCD FLEXPWM1_FAULT_IRQHandler ;FlexPWM1_fault interrupt - DCD FLEXPWM1_SUBMODULE0_IRQHandler ;FlexPWM1 Submodule 0 capture/compare/reload interrupt - DCD FLEXPWM1_SUBMODULE1_IRQHandler ;FlexPWM1 Submodule 1 capture/compare/reload interrupt - DCD FLEXPWM1_SUBMODULE2_IRQHandler ;FlexPWM1 Submodule 2 capture/compare/reload interrupt - DCD Reserved100_IRQHandler ;Reserved interrupt - DCD QDC1_COMPARE_IRQHandler ;Compare - DCD QDC1_HOME_IRQHandler ;Home - DCD QDC1_WATCHDOG_IRQHandler ;Watchdog / Simultaneous A and B Change - DCD QDC1_INDEX_IRQHandler ;Index / Roll Over / Roll Under -__Vectors_End - -__Vectors EQU __vector_table -__Vectors_Size EQU __Vectors_End - __Vectors - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Default interrupt handlers. -;; - THUMB - - PUBWEAK Reset_Handler - SECTION .text:CODE:REORDER:NOROOT(2) -Reset_Handler - CPSID I ; Mask interrupts - LDR R0, =0xE000ED08 - LDR R1, =__vector_table - STR R1, [R0] - LDR R2, [R1] - MSR MSP, R2 - LDR R0, =sfb(CSTACK) - MSR MSPLIM, R0 - CPSIE I ; Unmask interrupts - LDR R0, =SystemInit - BLX R0 - LDR R0, =__iar_program_start - BX R0 - - PUBWEAK NMI_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -NMI_Handler - B . - - PUBWEAK HardFault_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -HardFault_Handler - B . - - PUBWEAK MemManage_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -MemManage_Handler - B . - - PUBWEAK BusFault_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -BusFault_Handler - B . - - PUBWEAK UsageFault_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -UsageFault_Handler - B . - - PUBWEAK SecureFault_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -SecureFault_Handler - B . - - PUBWEAK SVC_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -SVC_Handler - B . - - PUBWEAK DebugMon_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -DebugMon_Handler - B . - - PUBWEAK PendSV_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -PendSV_Handler - B . - - PUBWEAK SysTick_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -SysTick_Handler - B . - - PUBWEAK Reserved16_IRQHandler - PUBWEAK Reserved16_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved16_IRQHandler - LDR R0, =Reserved16_DriverIRQHandler - BX R0 - - PUBWEAK CMC_IRQHandler - PUBWEAK CMC_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CMC_IRQHandler - LDR R0, =CMC_DriverIRQHandler - BX R0 - - PUBWEAK DMA_CH0_IRQHandler - PUBWEAK DMA_CH0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -DMA_CH0_IRQHandler - LDR R0, =DMA_CH0_DriverIRQHandler - BX R0 - - PUBWEAK DMA_CH1_IRQHandler - PUBWEAK DMA_CH1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -DMA_CH1_IRQHandler - LDR R0, =DMA_CH1_DriverIRQHandler - BX R0 - - PUBWEAK DMA_CH2_IRQHandler - PUBWEAK DMA_CH2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -DMA_CH2_IRQHandler - LDR R0, =DMA_CH2_DriverIRQHandler - BX R0 - - PUBWEAK DMA_CH3_IRQHandler - PUBWEAK DMA_CH3_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -DMA_CH3_IRQHandler - LDR R0, =DMA_CH3_DriverIRQHandler - BX R0 - - PUBWEAK DMA_CH4_IRQHandler - PUBWEAK DMA_CH4_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -DMA_CH4_IRQHandler - LDR R0, =DMA_CH4_DriverIRQHandler - BX R0 - - PUBWEAK DMA_CH5_IRQHandler - PUBWEAK DMA_CH5_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -DMA_CH5_IRQHandler - LDR R0, =DMA_CH5_DriverIRQHandler - BX R0 - - PUBWEAK DMA_CH6_IRQHandler - PUBWEAK DMA_CH6_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -DMA_CH6_IRQHandler - LDR R0, =DMA_CH6_DriverIRQHandler - BX R0 - - PUBWEAK DMA_CH7_IRQHandler - PUBWEAK DMA_CH7_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -DMA_CH7_IRQHandler - LDR R0, =DMA_CH7_DriverIRQHandler - BX R0 - - PUBWEAK ERM0_SINGLE_BIT_IRQHandler - PUBWEAK ERM0_SINGLE_BIT_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ERM0_SINGLE_BIT_IRQHandler - LDR R0, =ERM0_SINGLE_BIT_DriverIRQHandler - BX R0 - - PUBWEAK ERM0_MULTI_BIT_IRQHandler - PUBWEAK ERM0_MULTI_BIT_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ERM0_MULTI_BIT_IRQHandler - LDR R0, =ERM0_MULTI_BIT_DriverIRQHandler - BX R0 - - PUBWEAK FMU0_IRQHandler - PUBWEAK FMU0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FMU0_IRQHandler - LDR R0, =FMU0_DriverIRQHandler - BX R0 - - PUBWEAK GLIKEY0_IRQHandler - PUBWEAK GLIKEY0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GLIKEY0_IRQHandler - LDR R0, =GLIKEY0_DriverIRQHandler - BX R0 - - PUBWEAK MBC0_IRQHandler - PUBWEAK MBC0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -MBC0_IRQHandler - LDR R0, =MBC0_DriverIRQHandler - BX R0 - - PUBWEAK SCG0_IRQHandler - PUBWEAK SCG0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SCG0_IRQHandler - LDR R0, =SCG0_DriverIRQHandler - BX R0 - - PUBWEAK SPC0_IRQHandler - PUBWEAK SPC0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SPC0_IRQHandler - LDR R0, =SPC0_DriverIRQHandler - BX R0 - - PUBWEAK VBAT0_IRQHandler - PUBWEAK VBAT0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -VBAT0_IRQHandler - LDR R0, =VBAT0_DriverIRQHandler - BX R0 - - PUBWEAK WUU0_IRQHandler - PUBWEAK WUU0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -WUU0_IRQHandler - LDR R0, =WUU0_DriverIRQHandler - BX R0 - - PUBWEAK CAN0_IRQHandler - PUBWEAK CAN0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CAN0_IRQHandler - LDR R0, =CAN0_DriverIRQHandler - BX R0 - - PUBWEAK Reserved36_IRQHandler - PUBWEAK Reserved36_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved36_IRQHandler - LDR R0, =Reserved36_DriverIRQHandler - BX R0 - - PUBWEAK Reserved37_IRQHandler - PUBWEAK Reserved37_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved37_IRQHandler - LDR R0, =Reserved37_DriverIRQHandler - BX R0 - - PUBWEAK Reserved38_IRQHandler - PUBWEAK Reserved38_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved38_IRQHandler - LDR R0, =Reserved38_DriverIRQHandler - BX R0 - - PUBWEAK FLEXIO_IRQHandler - PUBWEAK FLEXIO_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXIO_IRQHandler - LDR R0, =FLEXIO_DriverIRQHandler - BX R0 - - PUBWEAK I3C0_IRQHandler - PUBWEAK I3C0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -I3C0_IRQHandler - LDR R0, =I3C0_DriverIRQHandler - BX R0 - - PUBWEAK Reserved41_IRQHandler - PUBWEAK Reserved41_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved41_IRQHandler - LDR R0, =Reserved41_DriverIRQHandler - BX R0 - - PUBWEAK LPI2C0_IRQHandler - PUBWEAK LPI2C0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LPI2C0_IRQHandler - LDR R0, =LPI2C0_DriverIRQHandler - BX R0 - - PUBWEAK LPI2C1_IRQHandler - PUBWEAK LPI2C1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LPI2C1_IRQHandler - LDR R0, =LPI2C1_DriverIRQHandler - BX R0 - - PUBWEAK LPSPI0_IRQHandler - PUBWEAK LPSPI0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LPSPI0_IRQHandler - LDR R0, =LPSPI0_DriverIRQHandler - BX R0 - - PUBWEAK LPSPI1_IRQHandler - PUBWEAK LPSPI1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LPSPI1_IRQHandler - LDR R0, =LPSPI1_DriverIRQHandler - BX R0 - - PUBWEAK Reserved46_IRQHandler - PUBWEAK Reserved46_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved46_IRQHandler - LDR R0, =Reserved46_DriverIRQHandler - BX R0 - - PUBWEAK LPUART0_IRQHandler - PUBWEAK LPUART0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LPUART0_IRQHandler - LDR R0, =LPUART0_DriverIRQHandler - BX R0 - - PUBWEAK LPUART1_IRQHandler - PUBWEAK LPUART1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LPUART1_IRQHandler - LDR R0, =LPUART1_DriverIRQHandler - BX R0 - - PUBWEAK LPUART2_IRQHandler - PUBWEAK LPUART2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LPUART2_IRQHandler - LDR R0, =LPUART2_DriverIRQHandler - BX R0 - - PUBWEAK LPUART3_IRQHandler - PUBWEAK LPUART3_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LPUART3_IRQHandler - LDR R0, =LPUART3_DriverIRQHandler - BX R0 - - PUBWEAK LPUART4_IRQHandler - PUBWEAK LPUART4_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LPUART4_IRQHandler - LDR R0, =LPUART4_DriverIRQHandler - BX R0 - - PUBWEAK USB0_IRQHandler - PUBWEAK USB0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -USB0_IRQHandler - LDR R0, =USB0_DriverIRQHandler - BX R0 - - PUBWEAK Reserved53_IRQHandler - PUBWEAK Reserved53_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved53_IRQHandler - LDR R0, =Reserved53_DriverIRQHandler - BX R0 - - PUBWEAK CDOG0_IRQHandler - PUBWEAK CDOG0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CDOG0_IRQHandler - LDR R0, =CDOG0_DriverIRQHandler - BX R0 - - PUBWEAK CTIMER0_IRQHandler - PUBWEAK CTIMER0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CTIMER0_IRQHandler - LDR R0, =CTIMER0_DriverIRQHandler - BX R0 - - PUBWEAK CTIMER1_IRQHandler - PUBWEAK CTIMER1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CTIMER1_IRQHandler - LDR R0, =CTIMER1_DriverIRQHandler - BX R0 - - PUBWEAK CTIMER2_IRQHandler - PUBWEAK CTIMER2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CTIMER2_IRQHandler - LDR R0, =CTIMER2_DriverIRQHandler - BX R0 - - PUBWEAK CTIMER3_IRQHandler - PUBWEAK CTIMER3_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CTIMER3_IRQHandler - LDR R0, =CTIMER3_DriverIRQHandler - BX R0 - - PUBWEAK CTIMER4_IRQHandler - PUBWEAK CTIMER4_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CTIMER4_IRQHandler - LDR R0, =CTIMER4_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM0_RELOAD_ERROR_IRQHandler - PUBWEAK FLEXPWM0_RELOAD_ERROR_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM0_RELOAD_ERROR_IRQHandler - LDR R0, =FLEXPWM0_RELOAD_ERROR_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM0_FAULT_IRQHandler - PUBWEAK FLEXPWM0_FAULT_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM0_FAULT_IRQHandler - LDR R0, =FLEXPWM0_FAULT_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM0_SUBMODULE0_IRQHandler - PUBWEAK FLEXPWM0_SUBMODULE0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM0_SUBMODULE0_IRQHandler - LDR R0, =FLEXPWM0_SUBMODULE0_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM0_SUBMODULE1_IRQHandler - PUBWEAK FLEXPWM0_SUBMODULE1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM0_SUBMODULE1_IRQHandler - LDR R0, =FLEXPWM0_SUBMODULE1_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM0_SUBMODULE2_IRQHandler - PUBWEAK FLEXPWM0_SUBMODULE2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM0_SUBMODULE2_IRQHandler - LDR R0, =FLEXPWM0_SUBMODULE2_DriverIRQHandler - BX R0 - - PUBWEAK Reserved65_IRQHandler - PUBWEAK Reserved65_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved65_IRQHandler - LDR R0, =Reserved65_DriverIRQHandler - BX R0 - - PUBWEAK QDC0_COMPARE_IRQHandler - PUBWEAK QDC0_COMPARE_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC0_COMPARE_IRQHandler - LDR R0, =QDC0_COMPARE_DriverIRQHandler - BX R0 - - PUBWEAK QDC0_HOME_IRQHandler - PUBWEAK QDC0_HOME_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC0_HOME_IRQHandler - LDR R0, =QDC0_HOME_DriverIRQHandler - BX R0 - - PUBWEAK QDC0_WATCHDOG_IRQHandler - PUBWEAK QDC0_WATCHDOG_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC0_WATCHDOG_IRQHandler - LDR R0, =QDC0_WATCHDOG_DriverIRQHandler - BX R0 - - PUBWEAK QDC0_INDEX_IRQHandler - PUBWEAK QDC0_INDEX_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC0_INDEX_IRQHandler - LDR R0, =QDC0_INDEX_DriverIRQHandler - BX R0 - - PUBWEAK FREQME0_IRQHandler - PUBWEAK FREQME0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FREQME0_IRQHandler - LDR R0, =FREQME0_DriverIRQHandler - BX R0 - - PUBWEAK LPTMR0_IRQHandler - PUBWEAK LPTMR0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LPTMR0_IRQHandler - LDR R0, =LPTMR0_DriverIRQHandler - BX R0 - - PUBWEAK Reserved72_IRQHandler - PUBWEAK Reserved72_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved72_IRQHandler - LDR R0, =Reserved72_DriverIRQHandler - BX R0 - - PUBWEAK OS_EVENT_IRQHandler - PUBWEAK OS_EVENT_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -OS_EVENT_IRQHandler - LDR R0, =OS_EVENT_DriverIRQHandler - BX R0 - - PUBWEAK WAKETIMER0_IRQHandler - PUBWEAK WAKETIMER0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -WAKETIMER0_IRQHandler - LDR R0, =WAKETIMER0_DriverIRQHandler - BX R0 - - PUBWEAK UTICK0_IRQHandler - PUBWEAK UTICK0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -UTICK0_IRQHandler - LDR R0, =UTICK0_DriverIRQHandler - BX R0 - - PUBWEAK WWDT0_IRQHandler - PUBWEAK WWDT0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -WWDT0_IRQHandler - LDR R0, =WWDT0_DriverIRQHandler - BX R0 - - PUBWEAK Reserved77_IRQHandler - PUBWEAK Reserved77_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved77_IRQHandler - LDR R0, =Reserved77_DriverIRQHandler - BX R0 - - PUBWEAK ADC0_IRQHandler - PUBWEAK ADC0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ADC0_IRQHandler - LDR R0, =ADC0_DriverIRQHandler - BX R0 - - PUBWEAK ADC1_IRQHandler - PUBWEAK ADC1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ADC1_IRQHandler - LDR R0, =ADC1_DriverIRQHandler - BX R0 - - PUBWEAK CMP0_IRQHandler - PUBWEAK CMP0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CMP0_IRQHandler - LDR R0, =CMP0_DriverIRQHandler - BX R0 - - PUBWEAK CMP1_IRQHandler - PUBWEAK CMP1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CMP1_IRQHandler - LDR R0, =CMP1_DriverIRQHandler - BX R0 - - PUBWEAK Reserved82_IRQHandler - PUBWEAK Reserved82_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved82_IRQHandler - LDR R0, =Reserved82_DriverIRQHandler - BX R0 - - PUBWEAK DAC0_IRQHandler - PUBWEAK DAC0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -DAC0_IRQHandler - LDR R0, =DAC0_DriverIRQHandler - BX R0 - - PUBWEAK Reserved84_IRQHandler - PUBWEAK Reserved84_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved84_IRQHandler - LDR R0, =Reserved84_DriverIRQHandler - BX R0 - - PUBWEAK Reserved85_IRQHandler - PUBWEAK Reserved85_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved85_IRQHandler - LDR R0, =Reserved85_DriverIRQHandler - BX R0 - - PUBWEAK Reserved86_IRQHandler - PUBWEAK Reserved86_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved86_IRQHandler - LDR R0, =Reserved86_DriverIRQHandler - BX R0 - - PUBWEAK GPIO0_IRQHandler - PUBWEAK GPIO0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO0_IRQHandler - LDR R0, =GPIO0_DriverIRQHandler - BX R0 - - PUBWEAK GPIO1_IRQHandler - PUBWEAK GPIO1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO1_IRQHandler - LDR R0, =GPIO1_DriverIRQHandler - BX R0 - - PUBWEAK GPIO2_IRQHandler - PUBWEAK GPIO2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO2_IRQHandler - LDR R0, =GPIO2_DriverIRQHandler - BX R0 - - PUBWEAK GPIO3_IRQHandler - PUBWEAK GPIO3_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO3_IRQHandler - LDR R0, =GPIO3_DriverIRQHandler - BX R0 - - PUBWEAK GPIO4_IRQHandler - PUBWEAK GPIO4_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO4_IRQHandler - LDR R0, =GPIO4_DriverIRQHandler - BX R0 - - PUBWEAK Reserved92_IRQHandler - PUBWEAK Reserved92_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved92_IRQHandler - LDR R0, =Reserved92_DriverIRQHandler - BX R0 - - PUBWEAK LPI2C2_IRQHandler - PUBWEAK LPI2C2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LPI2C2_IRQHandler - LDR R0, =LPI2C2_DriverIRQHandler - BX R0 - - PUBWEAK LPI2C3_IRQHandler - PUBWEAK LPI2C3_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LPI2C3_IRQHandler - LDR R0, =LPI2C3_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM1_RELOAD_ERROR_IRQHandler - PUBWEAK FLEXPWM1_RELOAD_ERROR_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM1_RELOAD_ERROR_IRQHandler - LDR R0, =FLEXPWM1_RELOAD_ERROR_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM1_FAULT_IRQHandler - PUBWEAK FLEXPWM1_FAULT_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM1_FAULT_IRQHandler - LDR R0, =FLEXPWM1_FAULT_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM1_SUBMODULE0_IRQHandler - PUBWEAK FLEXPWM1_SUBMODULE0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM1_SUBMODULE0_IRQHandler - LDR R0, =FLEXPWM1_SUBMODULE0_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM1_SUBMODULE1_IRQHandler - PUBWEAK FLEXPWM1_SUBMODULE1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM1_SUBMODULE1_IRQHandler - LDR R0, =FLEXPWM1_SUBMODULE1_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM1_SUBMODULE2_IRQHandler - PUBWEAK FLEXPWM1_SUBMODULE2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM1_SUBMODULE2_IRQHandler - LDR R0, =FLEXPWM1_SUBMODULE2_DriverIRQHandler - BX R0 - - PUBWEAK Reserved100_IRQHandler - PUBWEAK Reserved100_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved100_IRQHandler - LDR R0, =Reserved100_DriverIRQHandler - BX R0 - - PUBWEAK QDC1_COMPARE_IRQHandler - PUBWEAK QDC1_COMPARE_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC1_COMPARE_IRQHandler - LDR R0, =QDC1_COMPARE_DriverIRQHandler - BX R0 - - PUBWEAK QDC1_HOME_IRQHandler - PUBWEAK QDC1_HOME_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC1_HOME_IRQHandler - LDR R0, =QDC1_HOME_DriverIRQHandler - BX R0 - - PUBWEAK QDC1_WATCHDOG_IRQHandler - PUBWEAK QDC1_WATCHDOG_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC1_WATCHDOG_IRQHandler - LDR R0, =QDC1_WATCHDOG_DriverIRQHandler - BX R0 - - PUBWEAK QDC1_INDEX_IRQHandler - PUBWEAK QDC1_INDEX_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC1_INDEX_IRQHandler - LDR R0, =QDC1_INDEX_DriverIRQHandler - BX R0 - -Reserved16_DriverIRQHandler -CMC_DriverIRQHandler -DMA_CH0_DriverIRQHandler -DMA_CH1_DriverIRQHandler -DMA_CH2_DriverIRQHandler -DMA_CH3_DriverIRQHandler -DMA_CH4_DriverIRQHandler -DMA_CH5_DriverIRQHandler -DMA_CH6_DriverIRQHandler -DMA_CH7_DriverIRQHandler -ERM0_SINGLE_BIT_DriverIRQHandler -ERM0_MULTI_BIT_DriverIRQHandler -FMU0_DriverIRQHandler -GLIKEY0_DriverIRQHandler -MBC0_DriverIRQHandler -SCG0_DriverIRQHandler -SPC0_DriverIRQHandler -VBAT0_DriverIRQHandler -WUU0_DriverIRQHandler -CAN0_DriverIRQHandler -Reserved36_DriverIRQHandler -Reserved37_DriverIRQHandler -Reserved38_DriverIRQHandler -FLEXIO_DriverIRQHandler -I3C0_DriverIRQHandler -Reserved41_DriverIRQHandler -LPI2C0_DriverIRQHandler -LPI2C1_DriverIRQHandler -LPSPI0_DriverIRQHandler -LPSPI1_DriverIRQHandler -Reserved46_DriverIRQHandler -LPUART0_DriverIRQHandler -LPUART1_DriverIRQHandler -LPUART2_DriverIRQHandler -LPUART3_DriverIRQHandler -LPUART4_DriverIRQHandler -USB0_DriverIRQHandler -Reserved53_DriverIRQHandler -CDOG0_DriverIRQHandler -CTIMER0_DriverIRQHandler -CTIMER1_DriverIRQHandler -CTIMER2_DriverIRQHandler -CTIMER3_DriverIRQHandler -CTIMER4_DriverIRQHandler -FLEXPWM0_RELOAD_ERROR_DriverIRQHandler -FLEXPWM0_FAULT_DriverIRQHandler -FLEXPWM0_SUBMODULE0_DriverIRQHandler -FLEXPWM0_SUBMODULE1_DriverIRQHandler -FLEXPWM0_SUBMODULE2_DriverIRQHandler -Reserved65_DriverIRQHandler -QDC0_COMPARE_DriverIRQHandler -QDC0_HOME_DriverIRQHandler -QDC0_WATCHDOG_DriverIRQHandler -QDC0_INDEX_DriverIRQHandler -FREQME0_DriverIRQHandler -LPTMR0_DriverIRQHandler -Reserved72_DriverIRQHandler -OS_EVENT_DriverIRQHandler -WAKETIMER0_DriverIRQHandler -UTICK0_DriverIRQHandler -WWDT0_DriverIRQHandler -Reserved77_DriverIRQHandler -ADC0_DriverIRQHandler -ADC1_DriverIRQHandler -CMP0_DriverIRQHandler -CMP1_DriverIRQHandler -Reserved82_DriverIRQHandler -DAC0_DriverIRQHandler -Reserved84_DriverIRQHandler -Reserved85_DriverIRQHandler -Reserved86_DriverIRQHandler -GPIO0_DriverIRQHandler -GPIO1_DriverIRQHandler -GPIO2_DriverIRQHandler -GPIO3_DriverIRQHandler -GPIO4_DriverIRQHandler -Reserved92_DriverIRQHandler -LPI2C2_DriverIRQHandler -LPI2C3_DriverIRQHandler -FLEXPWM1_RELOAD_ERROR_DriverIRQHandler -FLEXPWM1_FAULT_DriverIRQHandler -FLEXPWM1_SUBMODULE0_DriverIRQHandler -FLEXPWM1_SUBMODULE1_DriverIRQHandler -FLEXPWM1_SUBMODULE2_DriverIRQHandler -Reserved100_DriverIRQHandler -QDC1_COMPARE_DriverIRQHandler -QDC1_HOME_DriverIRQHandler -QDC1_WATCHDOG_DriverIRQHandler -QDC1_INDEX_DriverIRQHandler -DefaultISR - B . - - END diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/system_MCXA156.c b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/system_MCXA156.c deleted file mode 100644 index 95d57e74b70..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/system_MCXA156.c +++ /dev/null @@ -1,139 +0,0 @@ -/* -** ################################################################### -** Processors: MCXA156VLL -** MCXA156VMP -** MCXA156VPJ -** -** Compilers: GNU C Compiler -** IAR ANSI C/C++ Compiler for ARM -** Keil ARM C/C++ Compiler -** MCUXpresso Compiler -** -** Reference manual: MCXA18 User manual -** Version: rev. 1.0, 2022-03-29 -** Build: b240328 -** -** 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-2024 NXP -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** Revisions: -** - rev. 1.0 (2022-03-29) -** Initial version based on v0.1UM -** -** ################################################################### -*/ - -/*! - * @file MCXA156 - * @version 1.0 - * @date 2022-03-29 - * @brief Device specific configuration file for MCXA156 (implementation file) - * - * 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. - */ - -#include -#include "fsl_device_registers.h" - - - - - -/* ---------------------------------------------------------------------------- - -- Core clock - ---------------------------------------------------------------------------- */ - -uint32_t SystemCoreClock = DEFAULT_SYSTEM_CLOCK; - -/* ---------------------------------------------------------------------------- - -- SystemInit() - ---------------------------------------------------------------------------- */ - -__attribute__ ((weak)) 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 << 0*2) | (3UL << 1*2)); /* set CP0, CP1 Full Access in Secure mode (enable PowerQuad) */ -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) - SCB_NS->CPACR |= ((3UL << 0*2) | (3UL << 1*2)); /* set CP0, CP1 Full Access in Normal mode (enable PowerQuad) */ -#endif /* (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ - - SCB->NSACR |= ((3UL << 0) | (3UL << 10)); /* enable CP0, CP1, CP10, CP11 Non-secure Access */ - -#if defined(__MCUXPRESSO) - extern void(*const g_pfnVectors[]) (void); - SCB->VTOR = (uint32_t) &g_pfnVectors; -#else - extern void *__Vectors; - SCB->VTOR = (uint32_t) &__Vectors; -#endif - /* Enable the LPCAC */ - SYSCON->LPCAC_CTRL |= SYSCON_LPCAC_CTRL_LPCAC_MEM_REQ_MASK; - SYSCON->LPCAC_CTRL &= ~SYSCON_LPCAC_CTRL_DIS_LPCAC_MASK; - - /* Enable flash RWX when FLASH_ACL in IFR0 is invalid */ - if ((*((volatile const uint32_t *)(0x1000000)) == 0xFFFFFFFFU) || - ((*((volatile const uint32_t *)(0x1000000)) == 0x59630000U) && - (*((volatile const uint32_t *)(0x1000040)) == 0xFFFFFFFFU) && - (*((volatile const uint32_t *)(0x1000044)) == 0xFFFFFFFFU) && - (*((volatile const uint32_t *)(0x1000048)) == 0xFFFFFFFFU) && - (*((volatile const uint32_t *)(0x100004C)) == 0xFFFFFFFFU) && - (*((volatile const uint32_t *)(0x1000050)) == 0xFFFFFFFFU) && - (*((volatile const uint32_t *)(0x1000054)) == 0xFFFFFFFFU) && - (*((volatile const uint32_t *)(0x1000058)) == 0xFFFFFFFFU) && - (*((volatile const uint32_t *)(0x100005C)) == 0xFFFFFFFFU))) - { - /* Enable MBC register written with GLIKEY index15 */ - GLIKEY0->CTRL_0 = 0x00060000U; - GLIKEY0->CTRL_0 = 0x0002000FU; - GLIKEY0->CTRL_0 = 0x0001000FU; - GLIKEY0->CTRL_1 = 0x00290000U; - GLIKEY0->CTRL_0 = 0x0002000FU; - GLIKEY0->CTRL_1 = 0x00280000U; - GLIKEY0->CTRL_0 = 0x0000000FU; - - /* Enable RWX for GLBAC0 */ - MBC0->MBC_INDEX[0].MBC_MEMN_GLBAC[0] = 0x7700U; - - /* Use GLBAC0 for all flash block */ - for (uint8_t i = 0; i < 8U; i++) - { - MBC0->MBC_INDEX[0].MBC_DOM0_MEM0_BLK_CFG_W[i] = 0x00000000U; - } - - /* Disable MBC register written */ - GLIKEY0->CTRL_0 = 0x0002000FU; - } - SystemInitHook(); -} - -/* ---------------------------------------------------------------------------- - -- SystemCoreClockUpdate() - ---------------------------------------------------------------------------- */ - -void SystemCoreClockUpdate (void) { - -} - -/* ---------------------------------------------------------------------------- - -- SystemInitHook() - ---------------------------------------------------------------------------- */ - -__attribute__ ((weak)) void SystemInitHook (void) { - /* Void implementation of the weak function. */ -} diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/system_MCXA156.h b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/system_MCXA156.h deleted file mode 100644 index ab51c2cecb8..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/MCXA156/system_MCXA156.h +++ /dev/null @@ -1,107 +0,0 @@ -/* -** ################################################################### -** Processors: MCXA156VLL -** MCXA156VMP -** -** Compilers: GNU C Compiler -** IAR ANSI C/C++ Compiler for ARM -** Keil ARM C/C++ Compiler -** MCUXpresso Compiler -** -** Reference manual: MCXA18 User manual -** Version: rev. 1.0, 2022-03-29 -** Build: b230829 -** -** 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 -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** Revisions: -** - rev. 1.0 (2022-03-29) -** Initial version based on v0.1UM -** -** ################################################################### -*/ - -/*! - * @file MCXA156 - * @version 1.0 - * @date 2022-03-29 - * @brief Device specific configuration file for MCXA156 (header file) - * - * 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. - */ - -#ifndef _SYSTEM_MCXA156_H_ -#define _SYSTEM_MCXA156_H_ /**< Symbol preventing repeated inclusion */ - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#define DEFAULT_SYSTEM_CLOCK 12000000u /* Default System clock value */ -#define CLK_RTC_32K_CLK 32768u /* RTC oscillator 32 kHz output (32k_clk */ -#define CLK_FRO_12MHZ 12000000u /* FRO 12 MHz (fro_12m) */ -#define CLK_FRO_32MHZ 32000000u /* FRO 32 MHz (fro_32m) */ -#define CLK_FRO_48MHZ 48000000u /* FRO 48 MHz (fro_48m) */ -#define CLK_CLK_IN 16000000u /* Default CLK_IN pin clock */ - - -/** - * @brief System clock frequency (core clock) - * - * The system clock frequency supplied to the SysTick timer and the processor - * core clock. This variable can be used by the user application to setup the - * SysTick timer or configure other parameters. It may also be used by debugger to - * query the frequency of the debug timer or configure the trace clock speed - * SystemCoreClock is initialized with a correct predefined value. - */ -extern uint32_t SystemCoreClock; - -/** - * @brief Setup the microcontroller system. - * - * Typically this function configures the oscillator (PLL) that is part of the - * microcontroller device. For systems with variable clock speed it also updates - * the variable SystemCoreClock. SystemInit is called from startup_device file. - */ -void SystemInit (void); - -/** - * @brief Updates the SystemCoreClock variable. - * - * It must be called whenever the core clock is changed during program - * execution. SystemCoreClockUpdate() evaluates the clock register settings and calculates - * the current core clock. - */ -void SystemCoreClockUpdate (void); - -/** - * @brief SystemInit function hook. - * - * This weak function allows to call specific initialization code during the - * SystemInit() execution.This can be used when an application specific code needs - * to be called as close to the reset entry as possible (for example the Multicore - * Manager MCMGR_EarlyInit() function call). - * NOTE: No global r/w variables can be used in this hook function because the - * initialization of these variables happens after this function. - */ -void SystemInitHook (void); - -#ifdef __cplusplus -} -#endif - -#endif /* _SYSTEM_MCXA156_H_ */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/SConscript b/bsp/nxp/mcx/mcxa/Libraries/MCXA156/SConscript deleted file mode 100644 index 87e04045ccb..00000000000 --- a/bsp/nxp/mcx/mcxa/Libraries/MCXA156/SConscript +++ /dev/null @@ -1,56 +0,0 @@ -Import('rtconfig') -from building import * - -cwd = GetCurrentDir() -path = [cwd + '/../CMSIS/Core/Include',cwd + '/components/codec', cwd + '/MCXA156', cwd + '/MCXA156/drivers', cwd + '/middleware/sdmmc/inc', cwd + '/middleware/sdmmc/port'] -src = Split(''' - MCXA156/system_MCXA156.c - ''') - -if rtconfig.PLATFORM in ['gcc']: - src += ['MCXA156/gcc/startup_MCXA156.S'] -elif rtconfig.PLATFORM in ['armcc', 'armclang']: - src += ['MCXA156/arm/startup_MCXA156.s'] -elif rtconfig.PLATFORM in ['iccarm']: - src += ['MCXA156/iar/startup_MCXA156.s'] - -src += ['MCXA156/drivers/fsl_aoi.c'] -src += ['MCXA156/drivers/fsl_clock.c'] -src += ['MCXA156/drivers/fsl_cmc.c'] -src += ['MCXA156/drivers/fsl_common.c'] -src += ['MCXA156/drivers/fsl_common_arm.c'] -src += ['MCXA156/drivers/fsl_crc.c'] -src += ['MCXA156/drivers/fsl_ctimer.c'] -src += ['MCXA156/drivers/fsl_edma.c'] -src += ['MCXA156/drivers/fsl_edma_soc.c'] -src += ['MCXA156/drivers/fsl_eim.c'] -src += ['MCXA156/drivers/fsl_eqdc.c'] -src += ['MCXA156/drivers/fsl_erm.c'] -src += ['MCXA156/drivers/fsl_freqme.c'] -src += ['MCXA156/drivers/fsl_glikey.c'] -src += ['MCXA156/drivers/fsl_gpio.c'] -src += ['MCXA156/drivers/fsl_i3c.c'] -src += ['MCXA156/drivers/fsl_i3c_edma.c'] -src += ['MCXA156/drivers/fsl_inputmux.c'] -src += ['MCXA156/drivers/fsl_lpadc.c'] -src += ['MCXA156/drivers/fsl_lpcmp.c'] -src += ['MCXA156/drivers/fsl_lpi2c.c'] -src += ['MCXA156/drivers/fsl_lpi2c_edma.c'] -src += ['MCXA156/drivers/fsl_lptmr.c'] -src += ['MCXA156/drivers/fsl_lpuart.c'] -src += ['MCXA156/drivers/fsl_lpuart_edma.c'] -src += ['MCXA156/drivers/fsl_lpspi.c'] -src += ['MCXA156/drivers/fsl_lpspi_edma.c'] -src += ['MCXA156/drivers/fsl_ostimer.c'] -src += ['MCXA156/drivers/fsl_pwm.c'] -src += ['MCXA156/drivers/fsl_reset.c'] -src += ['MCXA156/drivers/fsl_spc.c'] -src += ['MCXA156/drivers/fsl_utick.c'] -src += ['MCXA156/drivers/fsl_vbat.c'] -src += ['MCXA156/drivers/fsl_waketimer.c'] -src += ['MCXA156/drivers/fsl_wuu.c'] -src += ['MCXA156/drivers/fsl_wwdt.c'] - -group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path) - -Return('group') diff --git a/bsp/nxp/mcx/mcxa/frdm-mcxa153/SConstruct b/bsp/nxp/mcx/mcxa/frdm-mcxa153/SConstruct index ed0bfe11ffd..6e65952c0eb 100644 --- a/bsp/nxp/mcx/mcxa/frdm-mcxa153/SConstruct +++ b/bsp/nxp/mcx/mcxa/frdm-mcxa153/SConstruct @@ -15,6 +15,24 @@ except: print(RTT_ROOT) exit(-1) +def bsp_pkg_check(): + import subprocess + + check_paths = [ + os.path.join("packages", "nxp-mcx-cmsis-latest"), + os.path.join("packages", "nxp-mcx-series-latest"), + ] + + need_update = not all(os.path.exists(p) for p in check_paths) + + if need_update: + print("\n==============================================================") + print("Dependency packages missing, please running 'pkgs --update'...") + print("==============================================================") + exit(1) + +RegisterPreBuildingAction(bsp_pkg_check) + TARGET = 'rtthread.' + rtconfig.TARGET_EXT if rtconfig.PLATFORM == 'armcc': @@ -60,8 +78,5 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) objs.extend(SConscript(os.path.join(libraries_path_prefix, 'drivers', 'SConscript'))) -# include cmsis -objs.extend(SConscript(os.path.join(libraries_path_prefix, rtconfig.BSP_LIBRARY_TYPE, 'SConscript'))) - # make a building DoBuilding(TARGET, objs) diff --git a/bsp/nxp/mcx/mcxa/frdm-mcxa156/SConstruct b/bsp/nxp/mcx/mcxa/frdm-mcxa156/SConstruct index ed0bfe11ffd..6e65952c0eb 100644 --- a/bsp/nxp/mcx/mcxa/frdm-mcxa156/SConstruct +++ b/bsp/nxp/mcx/mcxa/frdm-mcxa156/SConstruct @@ -15,6 +15,24 @@ except: print(RTT_ROOT) exit(-1) +def bsp_pkg_check(): + import subprocess + + check_paths = [ + os.path.join("packages", "nxp-mcx-cmsis-latest"), + os.path.join("packages", "nxp-mcx-series-latest"), + ] + + need_update = not all(os.path.exists(p) for p in check_paths) + + if need_update: + print("\n==============================================================") + print("Dependency packages missing, please running 'pkgs --update'...") + print("==============================================================") + exit(1) + +RegisterPreBuildingAction(bsp_pkg_check) + TARGET = 'rtthread.' + rtconfig.TARGET_EXT if rtconfig.PLATFORM == 'armcc': @@ -60,8 +78,5 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) objs.extend(SConscript(os.path.join(libraries_path_prefix, 'drivers', 'SConscript'))) -# include cmsis -objs.extend(SConscript(os.path.join(libraries_path_prefix, rtconfig.BSP_LIBRARY_TYPE, 'SConscript'))) - # make a building DoBuilding(TARGET, objs) diff --git a/bsp/nxp/mcx/mcxc/Libraries/CMSIS/Core/Include/cmsis_armclang.h b/bsp/nxp/mcx/mcxc/Libraries/CMSIS/Core/Include/cmsis_armclang.h deleted file mode 100644 index 69114177477..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/CMSIS/Core/Include/cmsis_armclang.h +++ /dev/null @@ -1,1503 +0,0 @@ -/**************************************************************************//** - * @file cmsis_armclang.h - * @brief CMSIS compiler armclang (Arm Compiler 6) header file - * @version V5.4.3 - * @date 27. May 2021 - ******************************************************************************/ -/* - * Copyright (c) 2009-2021 Arm Limited. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - * - * 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. - */ - -/*lint -esym(9058, IRQn)*/ /* disable MISRA 2012 Rule 2.4 for IRQn */ - -#ifndef __CMSIS_ARMCLANG_H -#define __CMSIS_ARMCLANG_H - -#pragma clang system_header /* treat file as system include file */ - -/* CMSIS compiler specific defines */ -#ifndef __ASM - #define __ASM __asm -#endif -#ifndef __INLINE - #define __INLINE __inline -#endif -#ifndef __STATIC_INLINE - #define __STATIC_INLINE static __inline -#endif -#ifndef __STATIC_FORCEINLINE - #define __STATIC_FORCEINLINE __attribute__((always_inline)) static __inline -#endif -#ifndef __NO_RETURN - #define __NO_RETURN __attribute__((__noreturn__)) -#endif -#ifndef __USED - #define __USED __attribute__((used)) -#endif -#ifndef __WEAK - #define __WEAK __attribute__((weak)) -#endif -#ifndef __PACKED - #define __PACKED __attribute__((packed, aligned(1))) -#endif -#ifndef __PACKED_STRUCT - #define __PACKED_STRUCT struct __attribute__((packed, aligned(1))) -#endif -#ifndef __PACKED_UNION - #define __PACKED_UNION union __attribute__((packed, aligned(1))) -#endif -#ifndef __UNALIGNED_UINT32 /* deprecated */ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpacked" -/*lint -esym(9058, T_UINT32)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32 */ - struct __attribute__((packed)) T_UINT32 { uint32_t v; }; - #pragma clang diagnostic pop - #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) -#endif -#ifndef __UNALIGNED_UINT16_WRITE - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpacked" -/*lint -esym(9058, T_UINT16_WRITE)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT16_WRITE */ - __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; - #pragma clang diagnostic pop - #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) -#endif -#ifndef __UNALIGNED_UINT16_READ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpacked" -/*lint -esym(9058, T_UINT16_READ)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT16_READ */ - __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; - #pragma clang diagnostic pop - #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) -#endif -#ifndef __UNALIGNED_UINT32_WRITE - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpacked" -/*lint -esym(9058, T_UINT32_WRITE)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32_WRITE */ - __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; - #pragma clang diagnostic pop - #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) -#endif -#ifndef __UNALIGNED_UINT32_READ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpacked" -/*lint -esym(9058, T_UINT32_READ)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32_READ */ - __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; - #pragma clang diagnostic pop - #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) -#endif -#ifndef __ALIGNED - #define __ALIGNED(x) __attribute__((aligned(x))) -#endif -#ifndef __RESTRICT - #define __RESTRICT __restrict -#endif -#ifndef __COMPILER_BARRIER - #define __COMPILER_BARRIER() __ASM volatile("":::"memory") -#endif - -/* ######################### Startup and Lowlevel Init ######################## */ - -#ifndef __PROGRAM_START -#define __PROGRAM_START __main -#endif - -#ifndef __INITIAL_SP -#define __INITIAL_SP Image$$ARM_LIB_STACK$$ZI$$Limit -#endif - -#ifndef __STACK_LIMIT -#define __STACK_LIMIT Image$$ARM_LIB_STACK$$ZI$$Base -#endif - -#ifndef __VECTOR_TABLE -#define __VECTOR_TABLE __Vectors -#endif - -#ifndef __VECTOR_TABLE_ATTRIBUTE -#define __VECTOR_TABLE_ATTRIBUTE __attribute__((used, section("RESET"))) -#endif - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) -#ifndef __STACK_SEAL -#define __STACK_SEAL Image$$STACKSEAL$$ZI$$Base -#endif - -#ifndef __TZ_STACK_SEAL_SIZE -#define __TZ_STACK_SEAL_SIZE 8U -#endif - -#ifndef __TZ_STACK_SEAL_VALUE -#define __TZ_STACK_SEAL_VALUE 0xFEF5EDA5FEF5EDA5ULL -#endif - - -__STATIC_FORCEINLINE void __TZ_set_STACKSEAL_S (uint32_t* stackTop) { - *((uint64_t *)stackTop) = __TZ_STACK_SEAL_VALUE; -} -#endif - - -/* ########################## Core Instruction Access ######################### */ -/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface - Access to dedicated instructions - @{ -*/ - -/* Define macros for porting to both thumb1 and thumb2. - * For thumb1, use low register (r0-r7), specified by constraint "l" - * Otherwise, use general registers, specified by constraint "r" */ -#if defined (__thumb__) && !defined (__thumb2__) -#define __CMSIS_GCC_OUT_REG(r) "=l" (r) -#define __CMSIS_GCC_RW_REG(r) "+l" (r) -#define __CMSIS_GCC_USE_REG(r) "l" (r) -#else -#define __CMSIS_GCC_OUT_REG(r) "=r" (r) -#define __CMSIS_GCC_RW_REG(r) "+r" (r) -#define __CMSIS_GCC_USE_REG(r) "r" (r) -#endif - -/** - \brief No Operation - \details No Operation does nothing. This instruction can be used for code alignment purposes. - */ -#define __NOP __builtin_arm_nop - -/** - \brief Wait For Interrupt - \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. - */ -#define __WFI __builtin_arm_wfi - - -/** - \brief Wait For Event - \details Wait For Event is a hint instruction that permits the processor to enter - a low-power state until one of a number of events occurs. - */ -#define __WFE __builtin_arm_wfe - - -/** - \brief Send Event - \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. - */ -#define __SEV __builtin_arm_sev - - -/** - \brief Instruction Synchronization Barrier - \details Instruction Synchronization Barrier flushes the pipeline in the processor, - so that all instructions following the ISB are fetched from cache or memory, - after the instruction has been completed. - */ -#define __ISB() __builtin_arm_isb(0xF) - -/** - \brief Data Synchronization Barrier - \details Acts as a special kind of Data Memory Barrier. - It completes when all explicit memory accesses before this instruction complete. - */ -#define __DSB() __builtin_arm_dsb(0xF) - - -/** - \brief Data Memory Barrier - \details Ensures the apparent order of the explicit memory operations before - and after the instruction, without ensuring their completion. - */ -#define __DMB() __builtin_arm_dmb(0xF) - - -/** - \brief Reverse byte order (32 bit) - \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV(value) __builtin_bswap32(value) - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV16(value) __ROR(__REV(value), 16) - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REVSH(value) (int16_t)__builtin_bswap16(value) - - -/** - \brief Rotate Right in unsigned value (32 bit) - \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. - \param [in] op1 Value to rotate - \param [in] op2 Number of Bits to rotate - \return Rotated value - */ -__STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2) -{ - op2 %= 32U; - if (op2 == 0U) - { - return op1; - } - return (op1 >> op2) | (op1 << (32U - op2)); -} - - -/** - \brief Breakpoint - \details Causes the processor to enter Debug state. - Debug tools can use this to investigate system state when the instruction at a particular address is reached. - \param [in] value is ignored by the processor. - If required, a debugger can use it to store additional information about the breakpoint. - */ -#define __BKPT(value) __ASM volatile ("bkpt "#value) - - -/** - \brief Reverse bit order of value - \details Reverses the bit order of the given value. - \param [in] value Value to reverse - \return Reversed value - */ -#define __RBIT __builtin_arm_rbit - -/** - \brief Count leading zeros - \details Counts the number of leading zeros of a data value. - \param [in] value Value to count the leading zeros - \return number of leading zeros in value - */ -__STATIC_FORCEINLINE uint8_t __CLZ(uint32_t value) -{ - /* Even though __builtin_clz produces a CLZ instruction on ARM, formally - __builtin_clz(0) is undefined behaviour, so handle this case specially. - This guarantees ARM-compatible results if happening to compile on a non-ARM - target, and ensures the compiler doesn't decide to activate any - optimisations using the logic "value was passed to __builtin_clz, so it - is non-zero". - ARM Compiler 6.10 and possibly earlier will optimise this test away, leaving a - single CLZ instruction. - */ - if (value == 0U) - { - return 32U; - } - return __builtin_clz(value); -} - - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) - -/** - \brief LDR Exclusive (8 bit) - \details Executes a exclusive LDR instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -#define __LDREXB (uint8_t)__builtin_arm_ldrex - - -/** - \brief LDR Exclusive (16 bit) - \details Executes a exclusive LDR instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -#define __LDREXH (uint16_t)__builtin_arm_ldrex - - -/** - \brief LDR Exclusive (32 bit) - \details Executes a exclusive LDR instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -#define __LDREXW (uint32_t)__builtin_arm_ldrex - - -/** - \brief STR Exclusive (8 bit) - \details Executes a exclusive STR instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STREXB (uint32_t)__builtin_arm_strex - - -/** - \brief STR Exclusive (16 bit) - \details Executes a exclusive STR instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STREXH (uint32_t)__builtin_arm_strex - - -/** - \brief STR Exclusive (32 bit) - \details Executes a exclusive STR instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STREXW (uint32_t)__builtin_arm_strex - - -/** - \brief Remove the exclusive lock - \details Removes the exclusive lock which is created by LDREX. - */ -#define __CLREX __builtin_arm_clrex - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) - -/** - \brief Signed Saturate - \details Saturates a signed value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (1..32) - \return Saturated value - */ -#define __SSAT __builtin_arm_ssat - - -/** - \brief Unsigned Saturate - \details Saturates an unsigned value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value - */ -#define __USAT __builtin_arm_usat - - -/** - \brief Rotate Right with Extend (32 bit) - \details Moves each bit of a bitstring right by one bit. - The carry input is shifted in at the left end of the bitstring. - \param [in] value Value to rotate - \return Rotated value - */ -__STATIC_FORCEINLINE uint32_t __RRX(uint32_t value) -{ - uint32_t result; - - __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return(result); -} - - -/** - \brief LDRT Unprivileged (8 bit) - \details Executes a Unprivileged LDRT instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -__STATIC_FORCEINLINE uint8_t __LDRBT(volatile uint8_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) ); - return ((uint8_t) result); /* Add explicit type cast here */ -} - - -/** - \brief LDRT Unprivileged (16 bit) - \details Executes a Unprivileged LDRT instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -__STATIC_FORCEINLINE uint16_t __LDRHT(volatile uint16_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) ); - return ((uint16_t) result); /* Add explicit type cast here */ -} - - -/** - \brief LDRT Unprivileged (32 bit) - \details Executes a Unprivileged LDRT instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -__STATIC_FORCEINLINE uint32_t __LDRT(volatile uint32_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*ptr) ); - return(result); -} - - -/** - \brief STRT Unprivileged (8 bit) - \details Executes a Unprivileged STRT instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STRBT(uint8_t value, volatile uint8_t *ptr) -{ - __ASM volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); -} - - -/** - \brief STRT Unprivileged (16 bit) - \details Executes a Unprivileged STRT instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STRHT(uint16_t value, volatile uint16_t *ptr) -{ - __ASM volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); -} - - -/** - \brief STRT Unprivileged (32 bit) - \details Executes a Unprivileged STRT instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STRT(uint32_t value, volatile uint32_t *ptr) -{ - __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) ); -} - -#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) */ - -/** - \brief Signed Saturate - \details Saturates a signed value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (1..32) - \return Saturated value - */ -__STATIC_FORCEINLINE int32_t __SSAT(int32_t val, uint32_t sat) -{ - if ((sat >= 1U) && (sat <= 32U)) - { - const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); - const int32_t min = -1 - max ; - if (val > max) - { - return max; - } - else if (val < min) - { - return min; - } - } - return val; -} - -/** - \brief Unsigned Saturate - \details Saturates an unsigned value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value - */ -__STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat) -{ - if (sat <= 31U) - { - const uint32_t max = ((1U << sat) - 1U); - if (val > (int32_t)max) - { - return max; - } - else if (val < 0) - { - return 0U; - } - } - return (uint32_t)val; -} - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) - -/** - \brief Load-Acquire (8 bit) - \details Executes a LDAB instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -__STATIC_FORCEINLINE uint8_t __LDAB(volatile uint8_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldab %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint8_t) result); -} - - -/** - \brief Load-Acquire (16 bit) - \details Executes a LDAH instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -__STATIC_FORCEINLINE uint16_t __LDAH(volatile uint16_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldah %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint16_t) result); -} - - -/** - \brief Load-Acquire (32 bit) - \details Executes a LDA instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -__STATIC_FORCEINLINE uint32_t __LDA(volatile uint32_t *ptr) -{ - uint32_t result; - - __ASM volatile ("lda %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return(result); -} - - -/** - \brief Store-Release (8 bit) - \details Executes a STLB instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STLB(uint8_t value, volatile uint8_t *ptr) -{ - __ASM volatile ("stlb %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); -} - - -/** - \brief Store-Release (16 bit) - \details Executes a STLH instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STLH(uint16_t value, volatile uint16_t *ptr) -{ - __ASM volatile ("stlh %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); -} - - -/** - \brief Store-Release (32 bit) - \details Executes a STL instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STL(uint32_t value, volatile uint32_t *ptr) -{ - __ASM volatile ("stl %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); -} - - -/** - \brief Load-Acquire Exclusive (8 bit) - \details Executes a LDAB exclusive instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -#define __LDAEXB (uint8_t)__builtin_arm_ldaex - - -/** - \brief Load-Acquire Exclusive (16 bit) - \details Executes a LDAH exclusive instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -#define __LDAEXH (uint16_t)__builtin_arm_ldaex - - -/** - \brief Load-Acquire Exclusive (32 bit) - \details Executes a LDA exclusive instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -#define __LDAEX (uint32_t)__builtin_arm_ldaex - - -/** - \brief Store-Release Exclusive (8 bit) - \details Executes a STLB exclusive instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STLEXB (uint32_t)__builtin_arm_stlex - - -/** - \brief Store-Release Exclusive (16 bit) - \details Executes a STLH exclusive instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STLEXH (uint32_t)__builtin_arm_stlex - - -/** - \brief Store-Release Exclusive (32 bit) - \details Executes a STL exclusive instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STLEX (uint32_t)__builtin_arm_stlex - -#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) */ - -/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ - - -/* ########################### Core Function Access ########################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions - @{ - */ - -/** - \brief Enable IRQ Interrupts - \details Enables IRQ interrupts by clearing special-purpose register PRIMASK. - Can only be executed in Privileged modes. - */ -#ifndef __ARM_COMPAT_H -__STATIC_FORCEINLINE void __enable_irq(void) -{ - __ASM volatile ("cpsie i" : : : "memory"); -} -#endif - - -/** - \brief Disable IRQ Interrupts - \details Disables IRQ interrupts by setting special-purpose register PRIMASK. - Can only be executed in Privileged modes. - */ -#ifndef __ARM_COMPAT_H -__STATIC_FORCEINLINE void __disable_irq(void) -{ - __ASM volatile ("cpsid i" : : : "memory"); -} -#endif - - -/** - \brief Get Control Register - \details Returns the content of the Control Register. - \return Control Register value - */ -__STATIC_FORCEINLINE uint32_t __get_CONTROL(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, control" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Control Register (non-secure) - \details Returns the content of the non-secure Control Register when in secure mode. - \return non-secure Control Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_CONTROL_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, control_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Control Register - \details Writes the given value to the Control Register. - \param [in] control Control Register value to set - */ -__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control) -{ - __ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); - __ISB(); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Control Register (non-secure) - \details Writes the given value to the non-secure Control Register when in secure state. - \param [in] control Control Register value to set - */ -__STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control) -{ - __ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory"); - __ISB(); -} -#endif - - -/** - \brief Get IPSR Register - \details Returns the content of the IPSR Register. - \return IPSR Register value - */ -__STATIC_FORCEINLINE uint32_t __get_IPSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, ipsr" : "=r" (result) ); - return(result); -} - - -/** - \brief Get APSR Register - \details Returns the content of the APSR Register. - \return APSR Register value - */ -__STATIC_FORCEINLINE uint32_t __get_APSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, apsr" : "=r" (result) ); - return(result); -} - - -/** - \brief Get xPSR Register - \details Returns the content of the xPSR Register. - \return xPSR Register value - */ -__STATIC_FORCEINLINE uint32_t __get_xPSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, xpsr" : "=r" (result) ); - return(result); -} - - -/** - \brief Get Process Stack Pointer - \details Returns the current value of the Process Stack Pointer (PSP). - \return PSP Register value - */ -__STATIC_FORCEINLINE uint32_t __get_PSP(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, psp" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Process Stack Pointer (non-secure) - \details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state. - \return PSP Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PSP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, psp_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Process Stack Pointer - \details Assigns the given value to the Process Stack Pointer (PSP). - \param [in] topOfProcStack Process Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack) -{ - __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : ); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Process Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state. - \param [in] topOfProcStack Process Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack) -{ - __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : ); -} -#endif - - -/** - \brief Get Main Stack Pointer - \details Returns the current value of the Main Stack Pointer (MSP). - \return MSP Register value - */ -__STATIC_FORCEINLINE uint32_t __get_MSP(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, msp" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Main Stack Pointer (non-secure) - \details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state. - \return MSP Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_MSP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, msp_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Main Stack Pointer - \details Assigns the given value to the Main Stack Pointer (MSP). - \param [in] topOfMainStack Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack) -{ - __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : ); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Main Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state. - \param [in] topOfMainStack Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack) -{ - __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : ); -} -#endif - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Stack Pointer (non-secure) - \details Returns the current value of the non-secure Stack Pointer (SP) when in secure state. - \return SP Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_SP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, sp_ns" : "=r" (result) ); - return(result); -} - - -/** - \brief Set Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Stack Pointer (SP) when in secure state. - \param [in] topOfStack Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_SP_NS(uint32_t topOfStack) -{ - __ASM volatile ("MSR sp_ns, %0" : : "r" (topOfStack) : ); -} -#endif - - -/** - \brief Get Priority Mask - \details Returns the current state of the priority mask bit from the Priority Mask Register. - \return Priority Mask value - */ -__STATIC_FORCEINLINE uint32_t __get_PRIMASK(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, primask" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Priority Mask (non-secure) - \details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state. - \return Priority Mask value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PRIMASK_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, primask_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Priority Mask - \details Assigns the given value to the Priority Mask Register. - \param [in] priMask Priority Mask - */ -__STATIC_FORCEINLINE void __set_PRIMASK(uint32_t priMask) -{ - __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Priority Mask (non-secure) - \details Assigns the given value to the non-secure Priority Mask Register when in secure state. - \param [in] priMask Priority Mask - */ -__STATIC_FORCEINLINE void __TZ_set_PRIMASK_NS(uint32_t priMask) -{ - __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory"); -} -#endif - - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) -/** - \brief Enable FIQ - \details Enables FIQ interrupts by clearing special-purpose register FAULTMASK. - Can only be executed in Privileged modes. - */ -__STATIC_FORCEINLINE void __enable_fault_irq(void) -{ - __ASM volatile ("cpsie f" : : : "memory"); -} - - -/** - \brief Disable FIQ - \details Disables FIQ interrupts by setting special-purpose register FAULTMASK. - Can only be executed in Privileged modes. - */ -__STATIC_FORCEINLINE void __disable_fault_irq(void) -{ - __ASM volatile ("cpsid f" : : : "memory"); -} - - -/** - \brief Get Base Priority - \details Returns the current value of the Base Priority register. - \return Base Priority register value - */ -__STATIC_FORCEINLINE uint32_t __get_BASEPRI(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, basepri" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Base Priority (non-secure) - \details Returns the current value of the non-secure Base Priority register when in secure state. - \return Base Priority register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_BASEPRI_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, basepri_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Base Priority - \details Assigns the given value to the Base Priority register. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __set_BASEPRI(uint32_t basePri) -{ - __ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory"); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Base Priority (non-secure) - \details Assigns the given value to the non-secure Base Priority register when in secure state. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __TZ_set_BASEPRI_NS(uint32_t basePri) -{ - __ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "memory"); -} -#endif - - -/** - \brief Set Base Priority with condition - \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, - or the new value increases the BASEPRI priority level. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __set_BASEPRI_MAX(uint32_t basePri) -{ - __ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory"); -} - - -/** - \brief Get Fault Mask - \details Returns the current value of the Fault Mask register. - \return Fault Mask register value - */ -__STATIC_FORCEINLINE uint32_t __get_FAULTMASK(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Fault Mask (non-secure) - \details Returns the current value of the non-secure Fault Mask register when in secure state. - \return Fault Mask register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_FAULTMASK_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, faultmask_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Fault Mask - \details Assigns the given value to the Fault Mask register. - \param [in] faultMask Fault Mask value to set - */ -__STATIC_FORCEINLINE void __set_FAULTMASK(uint32_t faultMask) -{ - __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Fault Mask (non-secure) - \details Assigns the given value to the non-secure Fault Mask register when in secure state. - \param [in] faultMask Fault Mask value to set - */ -__STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) -{ - __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory"); -} -#endif - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) - -/** - \brief Get Process Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always in non-secure - mode. - - \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). - \return PSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __get_PSPLIM(void) -{ -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, psplim" : "=r" (result) ); - return result; -#endif -} - -#if (defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Process Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always in non-secure - mode. - - \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \return PSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS(void) -{ -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) ) - // without main extensions, the non-secure PSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, psplim_ns" : "=r" (result) ); - return result; -#endif -} -#endif - - -/** - \brief Set Process Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored in non-secure - mode. - - \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set - */ -__STATIC_FORCEINLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) -{ -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - (void)ProcStackPtrLimit; -#else - __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit)); -#endif -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Process Stack Pointer (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored in non-secure - mode. - - \details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set - */ -__STATIC_FORCEINLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) -{ -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) ) - // without main extensions, the non-secure PSPLIM is RAZ/WI - (void)ProcStackPtrLimit; -#else - __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit)); -#endif -} -#endif - - -/** - \brief Get Main Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always. - - \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). - \return MSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __get_MSPLIM(void) -{ -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, msplim" : "=r" (result) ); - return result; -#endif -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Main Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always. - - \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. - \return MSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS(void) -{ -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) ) - // without main extensions, the non-secure MSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) ); - return result; -#endif -} -#endif - - -/** - \brief Set Main Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored. - - \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). - \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set - */ -__STATIC_FORCEINLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) -{ -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - (void)MainStackPtrLimit; -#else - __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit)); -#endif -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Main Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored. - - \details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state. - \param [in] MainStackPtrLimit Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) -{ -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) ) - // without main extensions, the non-secure MSPLIM is RAZ/WI - (void)MainStackPtrLimit; -#else - __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit)); -#endif -} -#endif - -#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) */ - -/** - \brief Get FPSCR - \details Returns the current value of the Floating Point Status/Control register. - \return Floating Point Status/Control register value - */ -#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) -#define __get_FPSCR (uint32_t)__builtin_arm_get_fpscr -#else -#define __get_FPSCR() ((uint32_t)0U) -#endif - -/** - \brief Set FPSCR - \details Assigns the given value to the Floating Point Status/Control register. - \param [in] fpscr Floating Point Status/Control value to set - */ -#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) -#define __set_FPSCR __builtin_arm_set_fpscr -#else -#define __set_FPSCR(x) ((void)(x)) -#endif - - -/*@} end of CMSIS_Core_RegAccFunctions */ - - -/* ################### Compiler specific Intrinsics ########################### */ -/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics - Access to dedicated SIMD instructions - @{ -*/ - -#if (defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1)) - -#define __SADD8 __builtin_arm_sadd8 -#define __QADD8 __builtin_arm_qadd8 -#define __SHADD8 __builtin_arm_shadd8 -#define __UADD8 __builtin_arm_uadd8 -#define __UQADD8 __builtin_arm_uqadd8 -#define __UHADD8 __builtin_arm_uhadd8 -#define __SSUB8 __builtin_arm_ssub8 -#define __QSUB8 __builtin_arm_qsub8 -#define __SHSUB8 __builtin_arm_shsub8 -#define __USUB8 __builtin_arm_usub8 -#define __UQSUB8 __builtin_arm_uqsub8 -#define __UHSUB8 __builtin_arm_uhsub8 -#define __SADD16 __builtin_arm_sadd16 -#define __QADD16 __builtin_arm_qadd16 -#define __SHADD16 __builtin_arm_shadd16 -#define __UADD16 __builtin_arm_uadd16 -#define __UQADD16 __builtin_arm_uqadd16 -#define __UHADD16 __builtin_arm_uhadd16 -#define __SSUB16 __builtin_arm_ssub16 -#define __QSUB16 __builtin_arm_qsub16 -#define __SHSUB16 __builtin_arm_shsub16 -#define __USUB16 __builtin_arm_usub16 -#define __UQSUB16 __builtin_arm_uqsub16 -#define __UHSUB16 __builtin_arm_uhsub16 -#define __SASX __builtin_arm_sasx -#define __QASX __builtin_arm_qasx -#define __SHASX __builtin_arm_shasx -#define __UASX __builtin_arm_uasx -#define __UQASX __builtin_arm_uqasx -#define __UHASX __builtin_arm_uhasx -#define __SSAX __builtin_arm_ssax -#define __QSAX __builtin_arm_qsax -#define __SHSAX __builtin_arm_shsax -#define __USAX __builtin_arm_usax -#define __UQSAX __builtin_arm_uqsax -#define __UHSAX __builtin_arm_uhsax -#define __USAD8 __builtin_arm_usad8 -#define __USADA8 __builtin_arm_usada8 -#define __SSAT16 __builtin_arm_ssat16 -#define __USAT16 __builtin_arm_usat16 -#define __UXTB16 __builtin_arm_uxtb16 -#define __UXTAB16 __builtin_arm_uxtab16 -#define __SXTB16 __builtin_arm_sxtb16 -#define __SXTAB16 __builtin_arm_sxtab16 -#define __SMUAD __builtin_arm_smuad -#define __SMUADX __builtin_arm_smuadx -#define __SMLAD __builtin_arm_smlad -#define __SMLADX __builtin_arm_smladx -#define __SMLALD __builtin_arm_smlald -#define __SMLALDX __builtin_arm_smlaldx -#define __SMUSD __builtin_arm_smusd -#define __SMUSDX __builtin_arm_smusdx -#define __SMLSD __builtin_arm_smlsd -#define __SMLSDX __builtin_arm_smlsdx -#define __SMLSLD __builtin_arm_smlsld -#define __SMLSLDX __builtin_arm_smlsldx -#define __SEL __builtin_arm_sel -#define __QADD __builtin_arm_qadd -#define __QSUB __builtin_arm_qsub - -#define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \ - ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) ) - -#define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \ - ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) ) - -#define __SXTB16_RORn(ARG1, ARG2) __SXTB16(__ROR(ARG1, ARG2)) - -#define __SXTAB16_RORn(ARG1, ARG2, ARG3) __SXTAB16(ARG1, __ROR(ARG2, ARG3)) - -__STATIC_FORCEINLINE int32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3) -{ - int32_t result; - - __ASM volatile ("smmla %0, %1, %2, %3" : "=r" (result): "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -#endif /* (__ARM_FEATURE_DSP == 1) */ -/*@} end of group CMSIS_SIMD_intrinsics */ - - -#endif /* __CMSIS_ARMCLANG_H */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/CMSIS/Core/Include/cmsis_armclang_ltm.h b/bsp/nxp/mcx/mcxc/Libraries/CMSIS/Core/Include/cmsis_armclang_ltm.h deleted file mode 100644 index 1e255d5907f..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/CMSIS/Core/Include/cmsis_armclang_ltm.h +++ /dev/null @@ -1,1928 +0,0 @@ -/**************************************************************************//** - * @file cmsis_armclang_ltm.h - * @brief CMSIS compiler armclang (Arm Compiler 6) header file - * @version V1.5.3 - * @date 27. May 2021 - ******************************************************************************/ -/* - * Copyright (c) 2018-2021 Arm Limited. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - * - * 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. - */ - -/*lint -esym(9058, IRQn)*/ /* disable MISRA 2012 Rule 2.4 for IRQn */ - -#ifndef __CMSIS_ARMCLANG_H -#define __CMSIS_ARMCLANG_H - -#pragma clang system_header /* treat file as system include file */ - -/* CMSIS compiler specific defines */ -#ifndef __ASM - #define __ASM __asm -#endif -#ifndef __INLINE - #define __INLINE __inline -#endif -#ifndef __STATIC_INLINE - #define __STATIC_INLINE static __inline -#endif -#ifndef __STATIC_FORCEINLINE - #define __STATIC_FORCEINLINE __attribute__((always_inline)) static __inline -#endif -#ifndef __NO_RETURN - #define __NO_RETURN __attribute__((__noreturn__)) -#endif -#ifndef __USED - #define __USED __attribute__((used)) -#endif -#ifndef __WEAK - #define __WEAK __attribute__((weak)) -#endif -#ifndef __PACKED - #define __PACKED __attribute__((packed, aligned(1))) -#endif -#ifndef __PACKED_STRUCT - #define __PACKED_STRUCT struct __attribute__((packed, aligned(1))) -#endif -#ifndef __PACKED_UNION - #define __PACKED_UNION union __attribute__((packed, aligned(1))) -#endif -#ifndef __UNALIGNED_UINT32 /* deprecated */ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpacked" -/*lint -esym(9058, T_UINT32)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32 */ - struct __attribute__((packed)) T_UINT32 { uint32_t v; }; - #pragma clang diagnostic pop - #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) -#endif -#ifndef __UNALIGNED_UINT16_WRITE - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpacked" -/*lint -esym(9058, T_UINT16_WRITE)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT16_WRITE */ - __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; - #pragma clang diagnostic pop - #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) -#endif -#ifndef __UNALIGNED_UINT16_READ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpacked" -/*lint -esym(9058, T_UINT16_READ)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT16_READ */ - __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; - #pragma clang diagnostic pop - #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) -#endif -#ifndef __UNALIGNED_UINT32_WRITE - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpacked" -/*lint -esym(9058, T_UINT32_WRITE)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32_WRITE */ - __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; - #pragma clang diagnostic pop - #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) -#endif -#ifndef __UNALIGNED_UINT32_READ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpacked" -/*lint -esym(9058, T_UINT32_READ)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32_READ */ - __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; - #pragma clang diagnostic pop - #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) -#endif -#ifndef __ALIGNED - #define __ALIGNED(x) __attribute__((aligned(x))) -#endif -#ifndef __RESTRICT - #define __RESTRICT __restrict -#endif -#ifndef __COMPILER_BARRIER - #define __COMPILER_BARRIER() __ASM volatile("":::"memory") -#endif - -/* ######################### Startup and Lowlevel Init ######################## */ - -#ifndef __PROGRAM_START -#define __PROGRAM_START __main -#endif - -#ifndef __INITIAL_SP -#define __INITIAL_SP Image$$ARM_LIB_STACK$$ZI$$Limit -#endif - -#ifndef __STACK_LIMIT -#define __STACK_LIMIT Image$$ARM_LIB_STACK$$ZI$$Base -#endif - -#ifndef __VECTOR_TABLE -#define __VECTOR_TABLE __Vectors -#endif - -#ifndef __VECTOR_TABLE_ATTRIBUTE -#define __VECTOR_TABLE_ATTRIBUTE __attribute__((used, section("RESET"))) -#endif - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) -#ifndef __STACK_SEAL -#define __STACK_SEAL Image$$STACKSEAL$$ZI$$Base -#endif - -#ifndef __TZ_STACK_SEAL_SIZE -#define __TZ_STACK_SEAL_SIZE 8U -#endif - -#ifndef __TZ_STACK_SEAL_VALUE -#define __TZ_STACK_SEAL_VALUE 0xFEF5EDA5FEF5EDA5ULL -#endif - - -__STATIC_FORCEINLINE void __TZ_set_STACKSEAL_S (uint32_t* stackTop) { - *((uint64_t *)stackTop) = __TZ_STACK_SEAL_VALUE; -} -#endif - - -/* ########################## Core Instruction Access ######################### */ -/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface - Access to dedicated instructions - @{ -*/ - -/* Define macros for porting to both thumb1 and thumb2. - * For thumb1, use low register (r0-r7), specified by constraint "l" - * Otherwise, use general registers, specified by constraint "r" */ -#if defined (__thumb__) && !defined (__thumb2__) -#define __CMSIS_GCC_OUT_REG(r) "=l" (r) -#define __CMSIS_GCC_USE_REG(r) "l" (r) -#else -#define __CMSIS_GCC_OUT_REG(r) "=r" (r) -#define __CMSIS_GCC_USE_REG(r) "r" (r) -#endif - -/** - \brief No Operation - \details No Operation does nothing. This instruction can be used for code alignment purposes. - */ -#define __NOP __builtin_arm_nop - -/** - \brief Wait For Interrupt - \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. - */ -#define __WFI __builtin_arm_wfi - - -/** - \brief Wait For Event - \details Wait For Event is a hint instruction that permits the processor to enter - a low-power state until one of a number of events occurs. - */ -#define __WFE __builtin_arm_wfe - - -/** - \brief Send Event - \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. - */ -#define __SEV __builtin_arm_sev - - -/** - \brief Instruction Synchronization Barrier - \details Instruction Synchronization Barrier flushes the pipeline in the processor, - so that all instructions following the ISB are fetched from cache or memory, - after the instruction has been completed. - */ -#define __ISB() __builtin_arm_isb(0xF) - -/** - \brief Data Synchronization Barrier - \details Acts as a special kind of Data Memory Barrier. - It completes when all explicit memory accesses before this instruction complete. - */ -#define __DSB() __builtin_arm_dsb(0xF) - - -/** - \brief Data Memory Barrier - \details Ensures the apparent order of the explicit memory operations before - and after the instruction, without ensuring their completion. - */ -#define __DMB() __builtin_arm_dmb(0xF) - - -/** - \brief Reverse byte order (32 bit) - \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV(value) __builtin_bswap32(value) - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV16(value) __ROR(__REV(value), 16) - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REVSH(value) (int16_t)__builtin_bswap16(value) - - -/** - \brief Rotate Right in unsigned value (32 bit) - \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. - \param [in] op1 Value to rotate - \param [in] op2 Number of Bits to rotate - \return Rotated value - */ -__STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2) -{ - op2 %= 32U; - if (op2 == 0U) - { - return op1; - } - return (op1 >> op2) | (op1 << (32U - op2)); -} - - -/** - \brief Breakpoint - \details Causes the processor to enter Debug state. - Debug tools can use this to investigate system state when the instruction at a particular address is reached. - \param [in] value is ignored by the processor. - If required, a debugger can use it to store additional information about the breakpoint. - */ -#define __BKPT(value) __ASM volatile ("bkpt "#value) - - -/** - \brief Reverse bit order of value - \details Reverses the bit order of the given value. - \param [in] value Value to reverse - \return Reversed value - */ -#define __RBIT __builtin_arm_rbit - -/** - \brief Count leading zeros - \details Counts the number of leading zeros of a data value. - \param [in] value Value to count the leading zeros - \return number of leading zeros in value - */ -__STATIC_FORCEINLINE uint8_t __CLZ(uint32_t value) -{ - /* Even though __builtin_clz produces a CLZ instruction on ARM, formally - __builtin_clz(0) is undefined behaviour, so handle this case specially. - This guarantees ARM-compatible results if happening to compile on a non-ARM - target, and ensures the compiler doesn't decide to activate any - optimisations using the logic "value was passed to __builtin_clz, so it - is non-zero". - ARM Compiler 6.10 and possibly earlier will optimise this test away, leaving a - single CLZ instruction. - */ - if (value == 0U) - { - return 32U; - } - return __builtin_clz(value); -} - - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) -/** - \brief LDR Exclusive (8 bit) - \details Executes a exclusive LDR instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -#define __LDREXB (uint8_t)__builtin_arm_ldrex - - -/** - \brief LDR Exclusive (16 bit) - \details Executes a exclusive LDR instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -#define __LDREXH (uint16_t)__builtin_arm_ldrex - - -/** - \brief LDR Exclusive (32 bit) - \details Executes a exclusive LDR instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -#define __LDREXW (uint32_t)__builtin_arm_ldrex - - -/** - \brief STR Exclusive (8 bit) - \details Executes a exclusive STR instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STREXB (uint32_t)__builtin_arm_strex - - -/** - \brief STR Exclusive (16 bit) - \details Executes a exclusive STR instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STREXH (uint32_t)__builtin_arm_strex - - -/** - \brief STR Exclusive (32 bit) - \details Executes a exclusive STR instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STREXW (uint32_t)__builtin_arm_strex - - -/** - \brief Remove the exclusive lock - \details Removes the exclusive lock which is created by LDREX. - */ -#define __CLREX __builtin_arm_clrex - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) - -/** - \brief Signed Saturate - \details Saturates a signed value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (1..32) - \return Saturated value - */ -#define __SSAT __builtin_arm_ssat - - -/** - \brief Unsigned Saturate - \details Saturates an unsigned value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value - */ -#define __USAT __builtin_arm_usat - - -/** - \brief Rotate Right with Extend (32 bit) - \details Moves each bit of a bitstring right by one bit. - The carry input is shifted in at the left end of the bitstring. - \param [in] value Value to rotate - \return Rotated value - */ -__STATIC_FORCEINLINE uint32_t __RRX(uint32_t value) -{ - uint32_t result; - - __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return(result); -} - - -/** - \brief LDRT Unprivileged (8 bit) - \details Executes a Unprivileged LDRT instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -__STATIC_FORCEINLINE uint8_t __LDRBT(volatile uint8_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) ); - return ((uint8_t) result); /* Add explicit type cast here */ -} - - -/** - \brief LDRT Unprivileged (16 bit) - \details Executes a Unprivileged LDRT instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -__STATIC_FORCEINLINE uint16_t __LDRHT(volatile uint16_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) ); - return ((uint16_t) result); /* Add explicit type cast here */ -} - - -/** - \brief LDRT Unprivileged (32 bit) - \details Executes a Unprivileged LDRT instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -__STATIC_FORCEINLINE uint32_t __LDRT(volatile uint32_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*ptr) ); - return(result); -} - - -/** - \brief STRT Unprivileged (8 bit) - \details Executes a Unprivileged STRT instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STRBT(uint8_t value, volatile uint8_t *ptr) -{ - __ASM volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); -} - - -/** - \brief STRT Unprivileged (16 bit) - \details Executes a Unprivileged STRT instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STRHT(uint16_t value, volatile uint16_t *ptr) -{ - __ASM volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); -} - - -/** - \brief STRT Unprivileged (32 bit) - \details Executes a Unprivileged STRT instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STRT(uint32_t value, volatile uint32_t *ptr) -{ - __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) ); -} - -#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ - -/** - \brief Signed Saturate - \details Saturates a signed value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (1..32) - \return Saturated value - */ -__STATIC_FORCEINLINE int32_t __SSAT(int32_t val, uint32_t sat) -{ - if ((sat >= 1U) && (sat <= 32U)) - { - const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); - const int32_t min = -1 - max ; - if (val > max) - { - return max; - } - else if (val < min) - { - return min; - } - } - return val; -} - -/** - \brief Unsigned Saturate - \details Saturates an unsigned value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value - */ -__STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat) -{ - if (sat <= 31U) - { - const uint32_t max = ((1U << sat) - 1U); - if (val > (int32_t)max) - { - return max; - } - else if (val < 0) - { - return 0U; - } - } - return (uint32_t)val; -} - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) -/** - \brief Load-Acquire (8 bit) - \details Executes a LDAB instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -__STATIC_FORCEINLINE uint8_t __LDAB(volatile uint8_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldab %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint8_t) result); -} - - -/** - \brief Load-Acquire (16 bit) - \details Executes a LDAH instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -__STATIC_FORCEINLINE uint16_t __LDAH(volatile uint16_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldah %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint16_t) result); -} - - -/** - \brief Load-Acquire (32 bit) - \details Executes a LDA instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -__STATIC_FORCEINLINE uint32_t __LDA(volatile uint32_t *ptr) -{ - uint32_t result; - - __ASM volatile ("lda %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return(result); -} - - -/** - \brief Store-Release (8 bit) - \details Executes a STLB instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STLB(uint8_t value, volatile uint8_t *ptr) -{ - __ASM volatile ("stlb %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); -} - - -/** - \brief Store-Release (16 bit) - \details Executes a STLH instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STLH(uint16_t value, volatile uint16_t *ptr) -{ - __ASM volatile ("stlh %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); -} - - -/** - \brief Store-Release (32 bit) - \details Executes a STL instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STL(uint32_t value, volatile uint32_t *ptr) -{ - __ASM volatile ("stl %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); -} - - -/** - \brief Load-Acquire Exclusive (8 bit) - \details Executes a LDAB exclusive instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -#define __LDAEXB (uint8_t)__builtin_arm_ldaex - - -/** - \brief Load-Acquire Exclusive (16 bit) - \details Executes a LDAH exclusive instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -#define __LDAEXH (uint16_t)__builtin_arm_ldaex - - -/** - \brief Load-Acquire Exclusive (32 bit) - \details Executes a LDA exclusive instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -#define __LDAEX (uint32_t)__builtin_arm_ldaex - - -/** - \brief Store-Release Exclusive (8 bit) - \details Executes a STLB exclusive instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STLEXB (uint32_t)__builtin_arm_stlex - - -/** - \brief Store-Release Exclusive (16 bit) - \details Executes a STLH exclusive instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STLEXH (uint32_t)__builtin_arm_stlex - - -/** - \brief Store-Release Exclusive (32 bit) - \details Executes a STL exclusive instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STLEX (uint32_t)__builtin_arm_stlex - -#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ - -/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ - - -/* ########################### Core Function Access ########################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions - @{ - */ - -/** - \brief Enable IRQ Interrupts - \details Enables IRQ interrupts by clearing special-purpose register PRIMASK. - Can only be executed in Privileged modes. - */ -#ifndef __ARM_COMPAT_H -__STATIC_FORCEINLINE void __enable_irq(void) -{ - __ASM volatile ("cpsie i" : : : "memory"); -} -#endif - - -/** - \brief Disable IRQ Interrupts - \details Disables IRQ interrupts by setting special-purpose register PRIMASK. - Can only be executed in Privileged modes. - */ -#ifndef __ARM_COMPAT_H -__STATIC_FORCEINLINE void __disable_irq(void) -{ - __ASM volatile ("cpsid i" : : : "memory"); -} -#endif - - -/** - \brief Get Control Register - \details Returns the content of the Control Register. - \return Control Register value - */ -__STATIC_FORCEINLINE uint32_t __get_CONTROL(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, control" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Control Register (non-secure) - \details Returns the content of the non-secure Control Register when in secure mode. - \return non-secure Control Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_CONTROL_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, control_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Control Register - \details Writes the given value to the Control Register. - \param [in] control Control Register value to set - */ -__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control) -{ - __ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); - __ISB(); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Control Register (non-secure) - \details Writes the given value to the non-secure Control Register when in secure state. - \param [in] control Control Register value to set - */ -__STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control) -{ - __ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory"); - __ISB(); -} -#endif - - -/** - \brief Get IPSR Register - \details Returns the content of the IPSR Register. - \return IPSR Register value - */ -__STATIC_FORCEINLINE uint32_t __get_IPSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, ipsr" : "=r" (result) ); - return(result); -} - - -/** - \brief Get APSR Register - \details Returns the content of the APSR Register. - \return APSR Register value - */ -__STATIC_FORCEINLINE uint32_t __get_APSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, apsr" : "=r" (result) ); - return(result); -} - - -/** - \brief Get xPSR Register - \details Returns the content of the xPSR Register. - \return xPSR Register value - */ -__STATIC_FORCEINLINE uint32_t __get_xPSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, xpsr" : "=r" (result) ); - return(result); -} - - -/** - \brief Get Process Stack Pointer - \details Returns the current value of the Process Stack Pointer (PSP). - \return PSP Register value - */ -__STATIC_FORCEINLINE uint32_t __get_PSP(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, psp" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Process Stack Pointer (non-secure) - \details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state. - \return PSP Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PSP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, psp_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Process Stack Pointer - \details Assigns the given value to the Process Stack Pointer (PSP). - \param [in] topOfProcStack Process Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack) -{ - __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : ); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Process Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state. - \param [in] topOfProcStack Process Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack) -{ - __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : ); -} -#endif - - -/** - \brief Get Main Stack Pointer - \details Returns the current value of the Main Stack Pointer (MSP). - \return MSP Register value - */ -__STATIC_FORCEINLINE uint32_t __get_MSP(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, msp" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Main Stack Pointer (non-secure) - \details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state. - \return MSP Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_MSP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, msp_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Main Stack Pointer - \details Assigns the given value to the Main Stack Pointer (MSP). - \param [in] topOfMainStack Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack) -{ - __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : ); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Main Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state. - \param [in] topOfMainStack Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack) -{ - __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : ); -} -#endif - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Stack Pointer (non-secure) - \details Returns the current value of the non-secure Stack Pointer (SP) when in secure state. - \return SP Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_SP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, sp_ns" : "=r" (result) ); - return(result); -} - - -/** - \brief Set Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Stack Pointer (SP) when in secure state. - \param [in] topOfStack Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_SP_NS(uint32_t topOfStack) -{ - __ASM volatile ("MSR sp_ns, %0" : : "r" (topOfStack) : ); -} -#endif - - -/** - \brief Get Priority Mask - \details Returns the current state of the priority mask bit from the Priority Mask Register. - \return Priority Mask value - */ -__STATIC_FORCEINLINE uint32_t __get_PRIMASK(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, primask" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Priority Mask (non-secure) - \details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state. - \return Priority Mask value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PRIMASK_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, primask_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Priority Mask - \details Assigns the given value to the Priority Mask Register. - \param [in] priMask Priority Mask - */ -__STATIC_FORCEINLINE void __set_PRIMASK(uint32_t priMask) -{ - __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Priority Mask (non-secure) - \details Assigns the given value to the non-secure Priority Mask Register when in secure state. - \param [in] priMask Priority Mask - */ -__STATIC_FORCEINLINE void __TZ_set_PRIMASK_NS(uint32_t priMask) -{ - __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory"); -} -#endif - - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) -/** - \brief Enable FIQ - \details Enables FIQ interrupts by clearing special-purpose register FAULTMASK. - Can only be executed in Privileged modes. - */ -__STATIC_FORCEINLINE void __enable_fault_irq(void) -{ - __ASM volatile ("cpsie f" : : : "memory"); -} - - -/** - \brief Disable FIQ - \details Disables FIQ interrupts by setting special-purpose register FAULTMASK. - Can only be executed in Privileged modes. - */ -__STATIC_FORCEINLINE void __disable_fault_irq(void) -{ - __ASM volatile ("cpsid f" : : : "memory"); -} - - -/** - \brief Get Base Priority - \details Returns the current value of the Base Priority register. - \return Base Priority register value - */ -__STATIC_FORCEINLINE uint32_t __get_BASEPRI(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, basepri" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Base Priority (non-secure) - \details Returns the current value of the non-secure Base Priority register when in secure state. - \return Base Priority register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_BASEPRI_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, basepri_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Base Priority - \details Assigns the given value to the Base Priority register. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __set_BASEPRI(uint32_t basePri) -{ - __ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory"); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Base Priority (non-secure) - \details Assigns the given value to the non-secure Base Priority register when in secure state. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __TZ_set_BASEPRI_NS(uint32_t basePri) -{ - __ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "memory"); -} -#endif - - -/** - \brief Set Base Priority with condition - \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, - or the new value increases the BASEPRI priority level. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __set_BASEPRI_MAX(uint32_t basePri) -{ - __ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory"); -} - - -/** - \brief Get Fault Mask - \details Returns the current value of the Fault Mask register. - \return Fault Mask register value - */ -__STATIC_FORCEINLINE uint32_t __get_FAULTMASK(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Fault Mask (non-secure) - \details Returns the current value of the non-secure Fault Mask register when in secure state. - \return Fault Mask register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_FAULTMASK_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, faultmask_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Fault Mask - \details Assigns the given value to the Fault Mask register. - \param [in] faultMask Fault Mask value to set - */ -__STATIC_FORCEINLINE void __set_FAULTMASK(uint32_t faultMask) -{ - __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Fault Mask (non-secure) - \details Assigns the given value to the non-secure Fault Mask register when in secure state. - \param [in] faultMask Fault Mask value to set - */ -__STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) -{ - __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory"); -} -#endif - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) - -/** - \brief Get Process Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always in non-secure - mode. - - \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). - \return PSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __get_PSPLIM(void) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, psplim" : "=r" (result) ); - return result; -#endif -} - -#if (defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Process Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always in non-secure - mode. - - \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \return PSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS(void) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, psplim_ns" : "=r" (result) ); - return result; -#endif -} -#endif - - -/** - \brief Set Process Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored in non-secure - mode. - - \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set - */ -__STATIC_FORCEINLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - (void)ProcStackPtrLimit; -#else - __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit)); -#endif -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Process Stack Pointer (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored in non-secure - mode. - - \details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set - */ -__STATIC_FORCEINLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - (void)ProcStackPtrLimit; -#else - __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit)); -#endif -} -#endif - - -/** - \brief Get Main Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always. - - \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). - \return MSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __get_MSPLIM(void) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, msplim" : "=r" (result) ); - return result; -#endif -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Main Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always. - - \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. - \return MSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS(void) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) ); - return result; -#endif -} -#endif - - -/** - \brief Set Main Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored. - - \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). - \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set - */ -__STATIC_FORCEINLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - (void)MainStackPtrLimit; -#else - __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit)); -#endif -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Main Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored. - - \details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state. - \param [in] MainStackPtrLimit Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - (void)MainStackPtrLimit; -#else - __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit)); -#endif -} -#endif - -#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ - -/** - \brief Get FPSCR - \details Returns the current value of the Floating Point Status/Control register. - \return Floating Point Status/Control register value - */ -#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) -#define __get_FPSCR (uint32_t)__builtin_arm_get_fpscr -#else -#define __get_FPSCR() ((uint32_t)0U) -#endif - -/** - \brief Set FPSCR - \details Assigns the given value to the Floating Point Status/Control register. - \param [in] fpscr Floating Point Status/Control value to set - */ -#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) -#define __set_FPSCR __builtin_arm_set_fpscr -#else -#define __set_FPSCR(x) ((void)(x)) -#endif - - -/*@} end of CMSIS_Core_RegAccFunctions */ - - -/* ################### Compiler specific Intrinsics ########################### */ -/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics - Access to dedicated SIMD instructions - @{ -*/ - -#if (defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1)) - -__STATIC_FORCEINLINE uint32_t __SADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - - -__STATIC_FORCEINLINE uint32_t __SSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("ssub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __USUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - - -__STATIC_FORCEINLINE uint32_t __SADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("ssub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __USUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("ssax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __USAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __USAD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usad8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __USADA8(uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("usada8 %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -#define __SSAT16(ARG1,ARG2) \ -({ \ - int32_t __RES, __ARG1 = (ARG1); \ - __ASM ("ssat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ - __RES; \ - }) - -#define __USAT16(ARG1,ARG2) \ -({ \ - uint32_t __RES, __ARG1 = (ARG1); \ - __ASM ("usat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ - __RES; \ - }) - -__STATIC_FORCEINLINE uint32_t __UXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile ("uxtb16 %0, %1" : "=r" (result) : "r" (op1)); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UXTAB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile ("sxtb16 %0, %1" : "=r" (result) : "r" (op1)); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SXTAB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMUAD (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smuad %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMUADX (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smuadx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMLAD (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smlad %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMLADX (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smladx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__STATIC_FORCEINLINE uint64_t __SMLALD (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__STATIC_FORCEINLINE uint64_t __SMLALDX (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__STATIC_FORCEINLINE uint32_t __SMUSD (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smusd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMUSDX (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smusdx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMLSD (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smlsd %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMLSDX (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smlsdx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__STATIC_FORCEINLINE uint64_t __SMLSLD (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__STATIC_FORCEINLINE uint64_t __SMLSLDX (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__STATIC_FORCEINLINE uint32_t __SEL (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sel %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE int32_t __QADD( int32_t op1, int32_t op2) -{ - int32_t result; - - __ASM volatile ("qadd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE int32_t __QSUB( int32_t op1, int32_t op2) -{ - int32_t result; - - __ASM volatile ("qsub %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -#define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \ - ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) ) - -#define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \ - ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) ) - -#define __SXTB16_RORn(ARG1, ARG2) __SXTB16(__ROR(ARG1, ARG2)) - -#define __SXTAB16_RORn(ARG1, ARG2, ARG3) __SXTAB16(ARG1, __ROR(ARG2, ARG3)) - -__STATIC_FORCEINLINE int32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3) -{ - int32_t result; - - __ASM volatile ("smmla %0, %1, %2, %3" : "=r" (result): "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -#endif /* (__ARM_FEATURE_DSP == 1) */ -/*@} end of group CMSIS_SIMD_intrinsics */ - - -#endif /* __CMSIS_ARMCLANG_H */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/CMSIS/Core/Include/cmsis_compiler.h b/bsp/nxp/mcx/mcxc/Libraries/CMSIS/Core/Include/cmsis_compiler.h deleted file mode 100644 index adbf296f15a..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/CMSIS/Core/Include/cmsis_compiler.h +++ /dev/null @@ -1,283 +0,0 @@ -/**************************************************************************//** - * @file cmsis_compiler.h - * @brief CMSIS compiler generic header file - * @version V5.1.0 - * @date 09. October 2018 - ******************************************************************************/ -/* - * Copyright (c) 2009-2018 Arm Limited. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - * - * 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 __CMSIS_COMPILER_H -#define __CMSIS_COMPILER_H - -#include - -/* - * Arm Compiler 4/5 - */ -#if defined ( __CC_ARM ) - #include "cmsis_armcc.h" - - -/* - * Arm Compiler 6.6 LTM (armclang) - */ -#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) && (__ARMCC_VERSION < 6100100) - #include "cmsis_armclang_ltm.h" - - /* - * Arm Compiler above 6.10.1 (armclang) - */ -#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6100100) - #include "cmsis_armclang.h" - - -/* - * GNU Compiler - */ -#elif defined ( __GNUC__ ) - #include "cmsis_gcc.h" - - -/* - * IAR Compiler - */ -#elif defined ( __ICCARM__ ) - #include - - -/* - * TI Arm Compiler - */ -#elif defined ( __TI_ARM__ ) - #include - - #ifndef __ASM - #define __ASM __asm - #endif - #ifndef __INLINE - #define __INLINE inline - #endif - #ifndef __STATIC_INLINE - #define __STATIC_INLINE static inline - #endif - #ifndef __STATIC_FORCEINLINE - #define __STATIC_FORCEINLINE __STATIC_INLINE - #endif - #ifndef __NO_RETURN - #define __NO_RETURN __attribute__((noreturn)) - #endif - #ifndef __USED - #define __USED __attribute__((used)) - #endif - #ifndef __WEAK - #define __WEAK __attribute__((weak)) - #endif - #ifndef __PACKED - #define __PACKED __attribute__((packed)) - #endif - #ifndef __PACKED_STRUCT - #define __PACKED_STRUCT struct __attribute__((packed)) - #endif - #ifndef __PACKED_UNION - #define __PACKED_UNION union __attribute__((packed)) - #endif - #ifndef __UNALIGNED_UINT32 /* deprecated */ - struct __attribute__((packed)) T_UINT32 { uint32_t v; }; - #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) - #endif - #ifndef __UNALIGNED_UINT16_WRITE - __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; - #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void*)(addr))->v) = (val)) - #endif - #ifndef __UNALIGNED_UINT16_READ - __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; - #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) - #endif - #ifndef __UNALIGNED_UINT32_WRITE - __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; - #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) - #endif - #ifndef __UNALIGNED_UINT32_READ - __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; - #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) - #endif - #ifndef __ALIGNED - #define __ALIGNED(x) __attribute__((aligned(x))) - #endif - #ifndef __RESTRICT - #define __RESTRICT __restrict - #endif - #ifndef __COMPILER_BARRIER - #warning No compiler specific solution for __COMPILER_BARRIER. __COMPILER_BARRIER is ignored. - #define __COMPILER_BARRIER() (void)0 - #endif - - -/* - * TASKING Compiler - */ -#elif defined ( __TASKING__ ) - /* - * The CMSIS functions have been implemented as intrinsics in the compiler. - * Please use "carm -?i" to get an up to date list of all intrinsics, - * Including the CMSIS ones. - */ - - #ifndef __ASM - #define __ASM __asm - #endif - #ifndef __INLINE - #define __INLINE inline - #endif - #ifndef __STATIC_INLINE - #define __STATIC_INLINE static inline - #endif - #ifndef __STATIC_FORCEINLINE - #define __STATIC_FORCEINLINE __STATIC_INLINE - #endif - #ifndef __NO_RETURN - #define __NO_RETURN __attribute__((noreturn)) - #endif - #ifndef __USED - #define __USED __attribute__((used)) - #endif - #ifndef __WEAK - #define __WEAK __attribute__((weak)) - #endif - #ifndef __PACKED - #define __PACKED __packed__ - #endif - #ifndef __PACKED_STRUCT - #define __PACKED_STRUCT struct __packed__ - #endif - #ifndef __PACKED_UNION - #define __PACKED_UNION union __packed__ - #endif - #ifndef __UNALIGNED_UINT32 /* deprecated */ - struct __packed__ T_UINT32 { uint32_t v; }; - #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) - #endif - #ifndef __UNALIGNED_UINT16_WRITE - __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; - #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) - #endif - #ifndef __UNALIGNED_UINT16_READ - __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; - #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) - #endif - #ifndef __UNALIGNED_UINT32_WRITE - __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; - #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) - #endif - #ifndef __UNALIGNED_UINT32_READ - __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; - #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) - #endif - #ifndef __ALIGNED - #define __ALIGNED(x) __align(x) - #endif - #ifndef __RESTRICT - #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored. - #define __RESTRICT - #endif - #ifndef __COMPILER_BARRIER - #warning No compiler specific solution for __COMPILER_BARRIER. __COMPILER_BARRIER is ignored. - #define __COMPILER_BARRIER() (void)0 - #endif - - -/* - * COSMIC Compiler - */ -#elif defined ( __CSMC__ ) - #include - - #ifndef __ASM - #define __ASM _asm - #endif - #ifndef __INLINE - #define __INLINE inline - #endif - #ifndef __STATIC_INLINE - #define __STATIC_INLINE static inline - #endif - #ifndef __STATIC_FORCEINLINE - #define __STATIC_FORCEINLINE __STATIC_INLINE - #endif - #ifndef __NO_RETURN - // NO RETURN is automatically detected hence no warning here - #define __NO_RETURN - #endif - #ifndef __USED - #warning No compiler specific solution for __USED. __USED is ignored. - #define __USED - #endif - #ifndef __WEAK - #define __WEAK __weak - #endif - #ifndef __PACKED - #define __PACKED @packed - #endif - #ifndef __PACKED_STRUCT - #define __PACKED_STRUCT @packed struct - #endif - #ifndef __PACKED_UNION - #define __PACKED_UNION @packed union - #endif - #ifndef __UNALIGNED_UINT32 /* deprecated */ - @packed struct T_UINT32 { uint32_t v; }; - #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) - #endif - #ifndef __UNALIGNED_UINT16_WRITE - __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; - #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) - #endif - #ifndef __UNALIGNED_UINT16_READ - __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; - #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) - #endif - #ifndef __UNALIGNED_UINT32_WRITE - __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; - #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) - #endif - #ifndef __UNALIGNED_UINT32_READ - __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; - #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) - #endif - #ifndef __ALIGNED - #warning No compiler specific solution for __ALIGNED. __ALIGNED is ignored. - #define __ALIGNED(x) - #endif - #ifndef __RESTRICT - #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored. - #define __RESTRICT - #endif - #ifndef __COMPILER_BARRIER - #warning No compiler specific solution for __COMPILER_BARRIER. __COMPILER_BARRIER is ignored. - #define __COMPILER_BARRIER() (void)0 - #endif - - -#else - #error Unknown compiler. -#endif - - -#endif /* __CMSIS_COMPILER_H */ - diff --git a/bsp/nxp/mcx/mcxc/Libraries/CMSIS/Core/Include/cmsis_gcc.h b/bsp/nxp/mcx/mcxc/Libraries/CMSIS/Core/Include/cmsis_gcc.h deleted file mode 100644 index 67bda4ef3c3..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/CMSIS/Core/Include/cmsis_gcc.h +++ /dev/null @@ -1,2211 +0,0 @@ -/**************************************************************************//** - * @file cmsis_gcc.h - * @brief CMSIS compiler GCC header file - * @version V5.4.1 - * @date 27. May 2021 - ******************************************************************************/ -/* - * Copyright (c) 2009-2021 Arm Limited. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - * - * 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 __CMSIS_GCC_H -#define __CMSIS_GCC_H - -/* ignore some GCC warnings */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-conversion" -#pragma GCC diagnostic ignored "-Wconversion" -#pragma GCC diagnostic ignored "-Wunused-parameter" - -/* Fallback for __has_builtin */ -#ifndef __has_builtin - #define __has_builtin(x) (0) -#endif - -/* CMSIS compiler specific defines */ -#ifndef __ASM - #define __ASM __asm -#endif -#ifndef __INLINE - #define __INLINE inline -#endif -#ifndef __STATIC_INLINE - #define __STATIC_INLINE static inline -#endif -#ifndef __STATIC_FORCEINLINE - #define __STATIC_FORCEINLINE __attribute__((always_inline)) static inline -#endif -#ifndef __NO_RETURN - #define __NO_RETURN __attribute__((__noreturn__)) -#endif -#ifndef __USED - #define __USED __attribute__((used)) -#endif -#ifndef __WEAK - #define __WEAK __attribute__((weak)) -#endif -#ifndef __PACKED - #define __PACKED __attribute__((packed, aligned(1))) -#endif -#ifndef __PACKED_STRUCT - #define __PACKED_STRUCT struct __attribute__((packed, aligned(1))) -#endif -#ifndef __PACKED_UNION - #define __PACKED_UNION union __attribute__((packed, aligned(1))) -#endif -#ifndef __UNALIGNED_UINT32 /* deprecated */ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wpacked" - #pragma GCC diagnostic ignored "-Wattributes" - struct __attribute__((packed)) T_UINT32 { uint32_t v; }; - #pragma GCC diagnostic pop - #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) -#endif -#ifndef __UNALIGNED_UINT16_WRITE - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wpacked" - #pragma GCC diagnostic ignored "-Wattributes" - __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; - #pragma GCC diagnostic pop - #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) -#endif -#ifndef __UNALIGNED_UINT16_READ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wpacked" - #pragma GCC diagnostic ignored "-Wattributes" - __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; - #pragma GCC diagnostic pop - #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) -#endif -#ifndef __UNALIGNED_UINT32_WRITE - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wpacked" - #pragma GCC diagnostic ignored "-Wattributes" - __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; - #pragma GCC diagnostic pop - #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) -#endif -#ifndef __UNALIGNED_UINT32_READ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wpacked" - #pragma GCC diagnostic ignored "-Wattributes" - __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; - #pragma GCC diagnostic pop - #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) -#endif -#ifndef __ALIGNED - #define __ALIGNED(x) __attribute__((aligned(x))) -#endif -#ifndef __RESTRICT - #define __RESTRICT __restrict -#endif -#ifndef __COMPILER_BARRIER - #define __COMPILER_BARRIER() __ASM volatile("":::"memory") -#endif - -/* ######################### Startup and Lowlevel Init ######################## */ - -#ifndef __PROGRAM_START - -/** - \brief Initializes data and bss sections - \details This default implementations initialized all data and additional bss - sections relying on .copy.table and .zero.table specified properly - in the used linker script. - - */ -__STATIC_FORCEINLINE __NO_RETURN void __cmsis_start(void) -{ - extern void _start(void) __NO_RETURN; - - typedef struct { - uint32_t const* src; - uint32_t* dest; - uint32_t wlen; - } __copy_table_t; - - typedef struct { - uint32_t* dest; - uint32_t wlen; - } __zero_table_t; - - extern const __copy_table_t __copy_table_start__; - extern const __copy_table_t __copy_table_end__; - extern const __zero_table_t __zero_table_start__; - extern const __zero_table_t __zero_table_end__; - - for (__copy_table_t const* pTable = &__copy_table_start__; pTable < &__copy_table_end__; ++pTable) { - for(uint32_t i=0u; iwlen; ++i) { - pTable->dest[i] = pTable->src[i]; - } - } - - for (__zero_table_t const* pTable = &__zero_table_start__; pTable < &__zero_table_end__; ++pTable) { - for(uint32_t i=0u; iwlen; ++i) { - pTable->dest[i] = 0u; - } - } - - _start(); -} - -#define __PROGRAM_START __cmsis_start -#endif - -#ifndef __INITIAL_SP -#define __INITIAL_SP __StackTop -#endif - -#ifndef __STACK_LIMIT -#define __STACK_LIMIT __StackLimit -#endif - -#ifndef __VECTOR_TABLE -#define __VECTOR_TABLE __Vectors -#endif - -#ifndef __VECTOR_TABLE_ATTRIBUTE -#define __VECTOR_TABLE_ATTRIBUTE __attribute__((used, section(".vectors"))) -#endif - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) -#ifndef __STACK_SEAL -#define __STACK_SEAL __StackSeal -#endif - -#ifndef __TZ_STACK_SEAL_SIZE -#define __TZ_STACK_SEAL_SIZE 8U -#endif - -#ifndef __TZ_STACK_SEAL_VALUE -#define __TZ_STACK_SEAL_VALUE 0xFEF5EDA5FEF5EDA5ULL -#endif - - -__STATIC_FORCEINLINE void __TZ_set_STACKSEAL_S (uint32_t* stackTop) { - *((uint64_t *)stackTop) = __TZ_STACK_SEAL_VALUE; -} -#endif - - -/* ########################## Core Instruction Access ######################### */ -/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface - Access to dedicated instructions - @{ -*/ - -/* Define macros for porting to both thumb1 and thumb2. - * For thumb1, use low register (r0-r7), specified by constraint "l" - * Otherwise, use general registers, specified by constraint "r" */ -#if defined (__thumb__) && !defined (__thumb2__) -#define __CMSIS_GCC_OUT_REG(r) "=l" (r) -#define __CMSIS_GCC_RW_REG(r) "+l" (r) -#define __CMSIS_GCC_USE_REG(r) "l" (r) -#else -#define __CMSIS_GCC_OUT_REG(r) "=r" (r) -#define __CMSIS_GCC_RW_REG(r) "+r" (r) -#define __CMSIS_GCC_USE_REG(r) "r" (r) -#endif - -/** - \brief No Operation - \details No Operation does nothing. This instruction can be used for code alignment purposes. - */ -#define __NOP() __ASM volatile ("nop") - -/** - \brief Wait For Interrupt - \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. - */ -#define __WFI() __ASM volatile ("wfi":::"memory") - - -/** - \brief Wait For Event - \details Wait For Event is a hint instruction that permits the processor to enter - a low-power state until one of a number of events occurs. - */ -#define __WFE() __ASM volatile ("wfe":::"memory") - - -/** - \brief Send Event - \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. - */ -#define __SEV() __ASM volatile ("sev") - - -/** - \brief Instruction Synchronization Barrier - \details Instruction Synchronization Barrier flushes the pipeline in the processor, - so that all instructions following the ISB are fetched from cache or memory, - after the instruction has been completed. - */ -__STATIC_FORCEINLINE void __ISB(void) -{ - __ASM volatile ("isb 0xF":::"memory"); -} - - -/** - \brief Data Synchronization Barrier - \details Acts as a special kind of Data Memory Barrier. - It completes when all explicit memory accesses before this instruction complete. - */ -__STATIC_FORCEINLINE void __DSB(void) -{ - __ASM volatile ("dsb 0xF":::"memory"); -} - - -/** - \brief Data Memory Barrier - \details Ensures the apparent order of the explicit memory operations before - and after the instruction, without ensuring their completion. - */ -__STATIC_FORCEINLINE void __DMB(void) -{ - __ASM volatile ("dmb 0xF":::"memory"); -} - - -/** - \brief Reverse byte order (32 bit) - \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412. - \param [in] value Value to reverse - \return Reversed value - */ -__STATIC_FORCEINLINE uint32_t __REV(uint32_t value) -{ -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) - return __builtin_bswap32(value); -#else - uint32_t result; - - __ASM ("rev %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return result; -#endif -} - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856. - \param [in] value Value to reverse - \return Reversed value - */ -__STATIC_FORCEINLINE uint32_t __REV16(uint32_t value) -{ - uint32_t result; - - __ASM ("rev16 %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return result; -} - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000. - \param [in] value Value to reverse - \return Reversed value - */ -__STATIC_FORCEINLINE int16_t __REVSH(int16_t value) -{ -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - return (int16_t)__builtin_bswap16(value); -#else - int16_t result; - - __ASM ("revsh %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return result; -#endif -} - - -/** - \brief Rotate Right in unsigned value (32 bit) - \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. - \param [in] op1 Value to rotate - \param [in] op2 Number of Bits to rotate - \return Rotated value - */ -__STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2) -{ - op2 %= 32U; - if (op2 == 0U) - { - return op1; - } - return (op1 >> op2) | (op1 << (32U - op2)); -} - - -/** - \brief Breakpoint - \details Causes the processor to enter Debug state. - Debug tools can use this to investigate system state when the instruction at a particular address is reached. - \param [in] value is ignored by the processor. - If required, a debugger can use it to store additional information about the breakpoint. - */ -#define __BKPT(value) __ASM volatile ("bkpt "#value) - - -/** - \brief Reverse bit order of value - \details Reverses the bit order of the given value. - \param [in] value Value to reverse - \return Reversed value - */ -__STATIC_FORCEINLINE uint32_t __RBIT(uint32_t value) -{ - uint32_t result; - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) - __ASM ("rbit %0, %1" : "=r" (result) : "r" (value) ); -#else - uint32_t s = (4U /*sizeof(v)*/ * 8U) - 1U; /* extra shift needed at end */ - - result = value; /* r will be reversed bits of v; first get LSB of v */ - for (value >>= 1U; value != 0U; value >>= 1U) - { - result <<= 1U; - result |= value & 1U; - s--; - } - result <<= s; /* shift when v's highest bits are zero */ -#endif - return result; -} - - -/** - \brief Count leading zeros - \details Counts the number of leading zeros of a data value. - \param [in] value Value to count the leading zeros - \return number of leading zeros in value - */ -__STATIC_FORCEINLINE uint8_t __CLZ(uint32_t value) -{ - /* Even though __builtin_clz produces a CLZ instruction on ARM, formally - __builtin_clz(0) is undefined behaviour, so handle this case specially. - This guarantees ARM-compatible results if happening to compile on a non-ARM - target, and ensures the compiler doesn't decide to activate any - optimisations using the logic "value was passed to __builtin_clz, so it - is non-zero". - ARM GCC 7.3 and possibly earlier will optimise this test away, leaving a - single CLZ instruction. - */ - if (value == 0U) - { - return 32U; - } - return __builtin_clz(value); -} - - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) -/** - \brief LDR Exclusive (8 bit) - \details Executes a exclusive LDR instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -__STATIC_FORCEINLINE uint8_t __LDREXB(volatile uint8_t *addr) -{ - uint32_t result; - -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - __ASM volatile ("ldrexb %0, %1" : "=r" (result) : "Q" (*addr) ); -#else - /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not - accepted by assembler. So has to use following less efficient pattern. - */ - __ASM volatile ("ldrexb %0, [%1]" : "=r" (result) : "r" (addr) : "memory" ); -#endif - return ((uint8_t) result); /* Add explicit type cast here */ -} - - -/** - \brief LDR Exclusive (16 bit) - \details Executes a exclusive LDR instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -__STATIC_FORCEINLINE uint16_t __LDREXH(volatile uint16_t *addr) -{ - uint32_t result; - -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - __ASM volatile ("ldrexh %0, %1" : "=r" (result) : "Q" (*addr) ); -#else - /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not - accepted by assembler. So has to use following less efficient pattern. - */ - __ASM volatile ("ldrexh %0, [%1]" : "=r" (result) : "r" (addr) : "memory" ); -#endif - return ((uint16_t) result); /* Add explicit type cast here */ -} - - -/** - \brief LDR Exclusive (32 bit) - \details Executes a exclusive LDR instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -__STATIC_FORCEINLINE uint32_t __LDREXW(volatile uint32_t *addr) -{ - uint32_t result; - - __ASM volatile ("ldrex %0, %1" : "=r" (result) : "Q" (*addr) ); - return(result); -} - - -/** - \brief STR Exclusive (8 bit) - \details Executes a exclusive STR instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -__STATIC_FORCEINLINE uint32_t __STREXB(uint8_t value, volatile uint8_t *addr) -{ - uint32_t result; - - __ASM volatile ("strexb %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) ); - return(result); -} - - -/** - \brief STR Exclusive (16 bit) - \details Executes a exclusive STR instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -__STATIC_FORCEINLINE uint32_t __STREXH(uint16_t value, volatile uint16_t *addr) -{ - uint32_t result; - - __ASM volatile ("strexh %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) ); - return(result); -} - - -/** - \brief STR Exclusive (32 bit) - \details Executes a exclusive STR instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -__STATIC_FORCEINLINE uint32_t __STREXW(uint32_t value, volatile uint32_t *addr) -{ - uint32_t result; - - __ASM volatile ("strex %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" (value) ); - return(result); -} - - -/** - \brief Remove the exclusive lock - \details Removes the exclusive lock which is created by LDREX. - */ -__STATIC_FORCEINLINE void __CLREX(void) -{ - __ASM volatile ("clrex" ::: "memory"); -} - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) -/** - \brief Signed Saturate - \details Saturates a signed value. - \param [in] ARG1 Value to be saturated - \param [in] ARG2 Bit position to saturate to (1..32) - \return Saturated value - */ -#define __SSAT(ARG1, ARG2) \ -__extension__ \ -({ \ - int32_t __RES, __ARG1 = (ARG1); \ - __ASM volatile ("ssat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) : "cc" ); \ - __RES; \ - }) - - -/** - \brief Unsigned Saturate - \details Saturates an unsigned value. - \param [in] ARG1 Value to be saturated - \param [in] ARG2 Bit position to saturate to (0..31) - \return Saturated value - */ -#define __USAT(ARG1, ARG2) \ -__extension__ \ -({ \ - uint32_t __RES, __ARG1 = (ARG1); \ - __ASM volatile ("usat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) : "cc" ); \ - __RES; \ - }) - - -/** - \brief Rotate Right with Extend (32 bit) - \details Moves each bit of a bitstring right by one bit. - The carry input is shifted in at the left end of the bitstring. - \param [in] value Value to rotate - \return Rotated value - */ -__STATIC_FORCEINLINE uint32_t __RRX(uint32_t value) -{ - uint32_t result; - - __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return(result); -} - - -/** - \brief LDRT Unprivileged (8 bit) - \details Executes a Unprivileged LDRT instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -__STATIC_FORCEINLINE uint8_t __LDRBT(volatile uint8_t *ptr) -{ - uint32_t result; - -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) ); -#else - /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not - accepted by assembler. So has to use following less efficient pattern. - */ - __ASM volatile ("ldrbt %0, [%1]" : "=r" (result) : "r" (ptr) : "memory" ); -#endif - return ((uint8_t) result); /* Add explicit type cast here */ -} - - -/** - \brief LDRT Unprivileged (16 bit) - \details Executes a Unprivileged LDRT instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -__STATIC_FORCEINLINE uint16_t __LDRHT(volatile uint16_t *ptr) -{ - uint32_t result; - -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) ); -#else - /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not - accepted by assembler. So has to use following less efficient pattern. - */ - __ASM volatile ("ldrht %0, [%1]" : "=r" (result) : "r" (ptr) : "memory" ); -#endif - return ((uint16_t) result); /* Add explicit type cast here */ -} - - -/** - \brief LDRT Unprivileged (32 bit) - \details Executes a Unprivileged LDRT instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -__STATIC_FORCEINLINE uint32_t __LDRT(volatile uint32_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*ptr) ); - return(result); -} - - -/** - \brief STRT Unprivileged (8 bit) - \details Executes a Unprivileged STRT instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STRBT(uint8_t value, volatile uint8_t *ptr) -{ - __ASM volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); -} - - -/** - \brief STRT Unprivileged (16 bit) - \details Executes a Unprivileged STRT instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STRHT(uint16_t value, volatile uint16_t *ptr) -{ - __ASM volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); -} - - -/** - \brief STRT Unprivileged (32 bit) - \details Executes a Unprivileged STRT instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STRT(uint32_t value, volatile uint32_t *ptr) -{ - __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) ); -} - -#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ - -/** - \brief Signed Saturate - \details Saturates a signed value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (1..32) - \return Saturated value - */ -__STATIC_FORCEINLINE int32_t __SSAT(int32_t val, uint32_t sat) -{ - if ((sat >= 1U) && (sat <= 32U)) - { - const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); - const int32_t min = -1 - max ; - if (val > max) - { - return max; - } - else if (val < min) - { - return min; - } - } - return val; -} - -/** - \brief Unsigned Saturate - \details Saturates an unsigned value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value - */ -__STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat) -{ - if (sat <= 31U) - { - const uint32_t max = ((1U << sat) - 1U); - if (val > (int32_t)max) - { - return max; - } - else if (val < 0) - { - return 0U; - } - } - return (uint32_t)val; -} - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) -/** - \brief Load-Acquire (8 bit) - \details Executes a LDAB instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -__STATIC_FORCEINLINE uint8_t __LDAB(volatile uint8_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldab %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint8_t) result); -} - - -/** - \brief Load-Acquire (16 bit) - \details Executes a LDAH instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -__STATIC_FORCEINLINE uint16_t __LDAH(volatile uint16_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldah %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint16_t) result); -} - - -/** - \brief Load-Acquire (32 bit) - \details Executes a LDA instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -__STATIC_FORCEINLINE uint32_t __LDA(volatile uint32_t *ptr) -{ - uint32_t result; - - __ASM volatile ("lda %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return(result); -} - - -/** - \brief Store-Release (8 bit) - \details Executes a STLB instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STLB(uint8_t value, volatile uint8_t *ptr) -{ - __ASM volatile ("stlb %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); -} - - -/** - \brief Store-Release (16 bit) - \details Executes a STLH instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STLH(uint16_t value, volatile uint16_t *ptr) -{ - __ASM volatile ("stlh %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); -} - - -/** - \brief Store-Release (32 bit) - \details Executes a STL instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STL(uint32_t value, volatile uint32_t *ptr) -{ - __ASM volatile ("stl %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); -} - - -/** - \brief Load-Acquire Exclusive (8 bit) - \details Executes a LDAB exclusive instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -__STATIC_FORCEINLINE uint8_t __LDAEXB(volatile uint8_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldaexb %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint8_t) result); -} - - -/** - \brief Load-Acquire Exclusive (16 bit) - \details Executes a LDAH exclusive instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -__STATIC_FORCEINLINE uint16_t __LDAEXH(volatile uint16_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldaexh %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint16_t) result); -} - - -/** - \brief Load-Acquire Exclusive (32 bit) - \details Executes a LDA exclusive instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -__STATIC_FORCEINLINE uint32_t __LDAEX(volatile uint32_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldaex %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return(result); -} - - -/** - \brief Store-Release Exclusive (8 bit) - \details Executes a STLB exclusive instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -__STATIC_FORCEINLINE uint32_t __STLEXB(uint8_t value, volatile uint8_t *ptr) -{ - uint32_t result; - - __ASM volatile ("stlexb %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); - return(result); -} - - -/** - \brief Store-Release Exclusive (16 bit) - \details Executes a STLH exclusive instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -__STATIC_FORCEINLINE uint32_t __STLEXH(uint16_t value, volatile uint16_t *ptr) -{ - uint32_t result; - - __ASM volatile ("stlexh %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); - return(result); -} - - -/** - \brief Store-Release Exclusive (32 bit) - \details Executes a STL exclusive instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -__STATIC_FORCEINLINE uint32_t __STLEX(uint32_t value, volatile uint32_t *ptr) -{ - uint32_t result; - - __ASM volatile ("stlex %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); - return(result); -} - -#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ - -/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ - - -/* ########################### Core Function Access ########################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions - @{ - */ - -/** - \brief Enable IRQ Interrupts - \details Enables IRQ interrupts by clearing special-purpose register PRIMASK. - Can only be executed in Privileged modes. - */ -__STATIC_FORCEINLINE void __enable_irq(void) -{ - __ASM volatile ("cpsie i" : : : "memory"); -} - - -/** - \brief Disable IRQ Interrupts - \details Disables IRQ interrupts by setting special-purpose register PRIMASK. - Can only be executed in Privileged modes. - */ -__STATIC_FORCEINLINE void __disable_irq(void) -{ - __ASM volatile ("cpsid i" : : : "memory"); -} - - -/** - \brief Get Control Register - \details Returns the content of the Control Register. - \return Control Register value - */ -__STATIC_FORCEINLINE uint32_t __get_CONTROL(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, control" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Control Register (non-secure) - \details Returns the content of the non-secure Control Register when in secure mode. - \return non-secure Control Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_CONTROL_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, control_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Control Register - \details Writes the given value to the Control Register. - \param [in] control Control Register value to set - */ -__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control) -{ - __ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); - __ISB(); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Control Register (non-secure) - \details Writes the given value to the non-secure Control Register when in secure state. - \param [in] control Control Register value to set - */ -__STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control) -{ - __ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory"); - __ISB(); -} -#endif - - -/** - \brief Get IPSR Register - \details Returns the content of the IPSR Register. - \return IPSR Register value - */ -__STATIC_FORCEINLINE uint32_t __get_IPSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, ipsr" : "=r" (result) ); - return(result); -} - - -/** - \brief Get APSR Register - \details Returns the content of the APSR Register. - \return APSR Register value - */ -__STATIC_FORCEINLINE uint32_t __get_APSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, apsr" : "=r" (result) ); - return(result); -} - - -/** - \brief Get xPSR Register - \details Returns the content of the xPSR Register. - \return xPSR Register value - */ -__STATIC_FORCEINLINE uint32_t __get_xPSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, xpsr" : "=r" (result) ); - return(result); -} - - -/** - \brief Get Process Stack Pointer - \details Returns the current value of the Process Stack Pointer (PSP). - \return PSP Register value - */ -__STATIC_FORCEINLINE uint32_t __get_PSP(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, psp" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Process Stack Pointer (non-secure) - \details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state. - \return PSP Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PSP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, psp_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Process Stack Pointer - \details Assigns the given value to the Process Stack Pointer (PSP). - \param [in] topOfProcStack Process Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack) -{ - __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : ); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Process Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state. - \param [in] topOfProcStack Process Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack) -{ - __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : ); -} -#endif - - -/** - \brief Get Main Stack Pointer - \details Returns the current value of the Main Stack Pointer (MSP). - \return MSP Register value - */ -__STATIC_FORCEINLINE uint32_t __get_MSP(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, msp" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Main Stack Pointer (non-secure) - \details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state. - \return MSP Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_MSP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, msp_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Main Stack Pointer - \details Assigns the given value to the Main Stack Pointer (MSP). - \param [in] topOfMainStack Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack) -{ - __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : ); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Main Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state. - \param [in] topOfMainStack Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack) -{ - __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : ); -} -#endif - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Stack Pointer (non-secure) - \details Returns the current value of the non-secure Stack Pointer (SP) when in secure state. - \return SP Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_SP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, sp_ns" : "=r" (result) ); - return(result); -} - - -/** - \brief Set Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Stack Pointer (SP) when in secure state. - \param [in] topOfStack Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_SP_NS(uint32_t topOfStack) -{ - __ASM volatile ("MSR sp_ns, %0" : : "r" (topOfStack) : ); -} -#endif - - -/** - \brief Get Priority Mask - \details Returns the current state of the priority mask bit from the Priority Mask Register. - \return Priority Mask value - */ -__STATIC_FORCEINLINE uint32_t __get_PRIMASK(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, primask" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Priority Mask (non-secure) - \details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state. - \return Priority Mask value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PRIMASK_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, primask_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Priority Mask - \details Assigns the given value to the Priority Mask Register. - \param [in] priMask Priority Mask - */ -__STATIC_FORCEINLINE void __set_PRIMASK(uint32_t priMask) -{ - __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Priority Mask (non-secure) - \details Assigns the given value to the non-secure Priority Mask Register when in secure state. - \param [in] priMask Priority Mask - */ -__STATIC_FORCEINLINE void __TZ_set_PRIMASK_NS(uint32_t priMask) -{ - __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory"); -} -#endif - - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) -/** - \brief Enable FIQ - \details Enables FIQ interrupts by clearing special-purpose register FAULTMASK. - Can only be executed in Privileged modes. - */ -__STATIC_FORCEINLINE void __enable_fault_irq(void) -{ - __ASM volatile ("cpsie f" : : : "memory"); -} - - -/** - \brief Disable FIQ - \details Disables FIQ interrupts by setting special-purpose register FAULTMASK. - Can only be executed in Privileged modes. - */ -__STATIC_FORCEINLINE void __disable_fault_irq(void) -{ - __ASM volatile ("cpsid f" : : : "memory"); -} - - -/** - \brief Get Base Priority - \details Returns the current value of the Base Priority register. - \return Base Priority register value - */ -__STATIC_FORCEINLINE uint32_t __get_BASEPRI(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, basepri" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Base Priority (non-secure) - \details Returns the current value of the non-secure Base Priority register when in secure state. - \return Base Priority register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_BASEPRI_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, basepri_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Base Priority - \details Assigns the given value to the Base Priority register. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __set_BASEPRI(uint32_t basePri) -{ - __ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory"); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Base Priority (non-secure) - \details Assigns the given value to the non-secure Base Priority register when in secure state. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __TZ_set_BASEPRI_NS(uint32_t basePri) -{ - __ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "memory"); -} -#endif - - -/** - \brief Set Base Priority with condition - \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, - or the new value increases the BASEPRI priority level. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __set_BASEPRI_MAX(uint32_t basePri) -{ - __ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory"); -} - - -/** - \brief Get Fault Mask - \details Returns the current value of the Fault Mask register. - \return Fault Mask register value - */ -__STATIC_FORCEINLINE uint32_t __get_FAULTMASK(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Fault Mask (non-secure) - \details Returns the current value of the non-secure Fault Mask register when in secure state. - \return Fault Mask register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_FAULTMASK_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, faultmask_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Fault Mask - \details Assigns the given value to the Fault Mask register. - \param [in] faultMask Fault Mask value to set - */ -__STATIC_FORCEINLINE void __set_FAULTMASK(uint32_t faultMask) -{ - __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Fault Mask (non-secure) - \details Assigns the given value to the non-secure Fault Mask register when in secure state. - \param [in] faultMask Fault Mask value to set - */ -__STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) -{ - __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory"); -} -#endif - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) - -/** - \brief Get Process Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always in non-secure - mode. - - \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). - \return PSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __get_PSPLIM(void) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, psplim" : "=r" (result) ); - return result; -#endif -} - -#if (defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Process Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always. - - \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \return PSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS(void) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, psplim_ns" : "=r" (result) ); - return result; -#endif -} -#endif - - -/** - \brief Set Process Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored in non-secure - mode. - - \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set - */ -__STATIC_FORCEINLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - (void)ProcStackPtrLimit; -#else - __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit)); -#endif -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Process Stack Pointer (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored. - - \details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set - */ -__STATIC_FORCEINLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - (void)ProcStackPtrLimit; -#else - __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit)); -#endif -} -#endif - - -/** - \brief Get Main Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always in non-secure - mode. - - \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). - \return MSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __get_MSPLIM(void) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, msplim" : "=r" (result) ); - return result; -#endif -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Main Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always. - - \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. - \return MSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS(void) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) ); - return result; -#endif -} -#endif - - -/** - \brief Set Main Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored in non-secure - mode. - - \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). - \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set - */ -__STATIC_FORCEINLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - (void)MainStackPtrLimit; -#else - __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit)); -#endif -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Main Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored. - - \details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state. - \param [in] MainStackPtrLimit Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - (void)MainStackPtrLimit; -#else - __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit)); -#endif -} -#endif - -#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ - - -/** - \brief Get FPSCR - \details Returns the current value of the Floating Point Status/Control register. - \return Floating Point Status/Control register value - */ -__STATIC_FORCEINLINE uint32_t __get_FPSCR(void) -{ -#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) -#if __has_builtin(__builtin_arm_get_fpscr) -// Re-enable using built-in when GCC has been fixed -// || (__GNUC__ > 7) || (__GNUC__ == 7 && __GNUC_MINOR__ >= 2) - /* see https://gcc.gnu.org/ml/gcc-patches/2017-04/msg00443.html */ - return __builtin_arm_get_fpscr(); -#else - uint32_t result; - - __ASM volatile ("VMRS %0, fpscr" : "=r" (result) ); - return(result); -#endif -#else - return(0U); -#endif -} - - -/** - \brief Set FPSCR - \details Assigns the given value to the Floating Point Status/Control register. - \param [in] fpscr Floating Point Status/Control value to set - */ -__STATIC_FORCEINLINE void __set_FPSCR(uint32_t fpscr) -{ -#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) -#if __has_builtin(__builtin_arm_set_fpscr) -// Re-enable using built-in when GCC has been fixed -// || (__GNUC__ > 7) || (__GNUC__ == 7 && __GNUC_MINOR__ >= 2) - /* see https://gcc.gnu.org/ml/gcc-patches/2017-04/msg00443.html */ - __builtin_arm_set_fpscr(fpscr); -#else - __ASM volatile ("VMSR fpscr, %0" : : "r" (fpscr) : "vfpcc", "memory"); -#endif -#else - (void)fpscr; -#endif -} - - -/*@} end of CMSIS_Core_RegAccFunctions */ - - -/* ################### Compiler specific Intrinsics ########################### */ -/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics - Access to dedicated SIMD instructions - @{ -*/ - -#if (defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1)) - -__STATIC_FORCEINLINE uint32_t __SADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("qadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("shadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uqadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uhadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - - -__STATIC_FORCEINLINE uint32_t __SSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("ssub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("qsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("shsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __USUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uqsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uhsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - - -__STATIC_FORCEINLINE uint32_t __SADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("qadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("shadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uqadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uhadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("ssub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("qsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("shsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __USUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uqsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uhsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("qasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("shasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uqasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uhasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("ssax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("qsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("shsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __USAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uqsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uhsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __USAD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("usad8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __USADA8(uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM ("usada8 %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -#define __SSAT16(ARG1, ARG2) \ -__extension__ \ -({ \ - int32_t __RES, __ARG1 = (ARG1); \ - __ASM volatile ("ssat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) : "cc" ); \ - __RES; \ - }) - -#define __USAT16(ARG1, ARG2) \ -__extension__ \ -({ \ - uint32_t __RES, __ARG1 = (ARG1); \ - __ASM volatile ("usat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) : "cc" ); \ - __RES; \ - }) - -__STATIC_FORCEINLINE uint32_t __UXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM ("uxtb16 %0, %1" : "=r" (result) : "r" (op1)); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UXTAB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM ("sxtb16 %0, %1" : "=r" (result) : "r" (op1)); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SXTB16_RORn(uint32_t op1, uint32_t rotate) -{ - uint32_t result; - if (__builtin_constant_p(rotate) && ((rotate == 8U) || (rotate == 16U) || (rotate == 24U))) { - __ASM volatile ("sxtb16 %0, %1, ROR %2" : "=r" (result) : "r" (op1), "i" (rotate) ); - } else { - result = __SXTB16(__ROR(op1, rotate)) ; - } - return result; -} - -__STATIC_FORCEINLINE uint32_t __SXTAB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("sxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SXTAB16_RORn(uint32_t op1, uint32_t op2, uint32_t rotate) -{ - uint32_t result; - if (__builtin_constant_p(rotate) && ((rotate == 8U) || (rotate == 16U) || (rotate == 24U))) { - __ASM volatile ("sxtab16 %0, %1, %2, ROR %3" : "=r" (result) : "r" (op1) , "r" (op2) , "i" (rotate)); - } else { - result = __SXTAB16(op1, __ROR(op2, rotate)); - } - return result; -} - - -__STATIC_FORCEINLINE uint32_t __SMUAD (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smuad %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMUADX (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smuadx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMLAD (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smlad %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMLADX (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smladx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__STATIC_FORCEINLINE uint64_t __SMLALD (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__STATIC_FORCEINLINE uint64_t __SMLALDX (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__STATIC_FORCEINLINE uint32_t __SMUSD (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smusd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMUSDX (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smusdx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMLSD (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smlsd %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMLSDX (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smlsdx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__STATIC_FORCEINLINE uint64_t __SMLSLD (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__STATIC_FORCEINLINE uint64_t __SMLSLDX (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__STATIC_FORCEINLINE uint32_t __SEL (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sel %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE int32_t __QADD( int32_t op1, int32_t op2) -{ - int32_t result; - - __ASM volatile ("qadd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE int32_t __QSUB( int32_t op1, int32_t op2) -{ - int32_t result; - - __ASM volatile ("qsub %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - - -#define __PKHBT(ARG1,ARG2,ARG3) \ -__extension__ \ -({ \ - uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \ - __ASM ("pkhbt %0, %1, %2, lsl %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \ - __RES; \ - }) - -#define __PKHTB(ARG1,ARG2,ARG3) \ -__extension__ \ -({ \ - uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \ - if (ARG3 == 0) \ - __ASM ("pkhtb %0, %1, %2" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2) ); \ - else \ - __ASM ("pkhtb %0, %1, %2, asr %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \ - __RES; \ - }) - - -__STATIC_FORCEINLINE int32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3) -{ - int32_t result; - - __ASM ("smmla %0, %1, %2, %3" : "=r" (result): "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -#endif /* (__ARM_FEATURE_DSP == 1) */ -/*@} end of group CMSIS_SIMD_intrinsics */ - - -#pragma GCC diagnostic pop - -#endif /* __CMSIS_GCC_H */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/CMSIS/Core/Include/cmsis_iccarm.h b/bsp/nxp/mcx/mcxc/Libraries/CMSIS/Core/Include/cmsis_iccarm.h deleted file mode 100644 index 65b824b009c..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/CMSIS/Core/Include/cmsis_iccarm.h +++ /dev/null @@ -1,1002 +0,0 @@ -/**************************************************************************//** - * @file cmsis_iccarm.h - * @brief CMSIS compiler ICCARM (IAR Compiler for Arm) header file - * @version V5.3.0 - * @date 14. April 2021 - ******************************************************************************/ - -//------------------------------------------------------------------------------ -// -// Copyright (c) 2017-2021 IAR Systems -// Copyright (c) 2017-2021 Arm Limited. All rights reserved. -// -// SPDX-License-Identifier: Apache-2.0 -// -// 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 __CMSIS_ICCARM_H__ -#define __CMSIS_ICCARM_H__ - -#ifndef __ICCARM__ - #error This file should only be compiled by ICCARM -#endif - -#pragma system_include - -#define __IAR_FT _Pragma("inline=forced") __intrinsic - -#if (__VER__ >= 8000000) - #define __ICCARM_V8 1 -#else - #define __ICCARM_V8 0 -#endif - -#ifndef __ALIGNED - #if __ICCARM_V8 - #define __ALIGNED(x) __attribute__((aligned(x))) - #elif (__VER__ >= 7080000) - /* Needs IAR language extensions */ - #define __ALIGNED(x) __attribute__((aligned(x))) - #else - #warning No compiler specific solution for __ALIGNED.__ALIGNED is ignored. - #define __ALIGNED(x) - #endif -#endif - - -/* Define compiler macros for CPU architecture, used in CMSIS 5. - */ -#if __ARM_ARCH_6M__ || __ARM_ARCH_7M__ || __ARM_ARCH_7EM__ || __ARM_ARCH_8M_BASE__ || __ARM_ARCH_8M_MAIN__ -/* Macros already defined */ -#else - #if defined(__ARM8M_MAINLINE__) || defined(__ARM8EM_MAINLINE__) - #define __ARM_ARCH_8M_MAIN__ 1 - #elif defined(__ARM8M_BASELINE__) - #define __ARM_ARCH_8M_BASE__ 1 - #elif defined(__ARM_ARCH_PROFILE) && __ARM_ARCH_PROFILE == 'M' - #if __ARM_ARCH == 6 - #define __ARM_ARCH_6M__ 1 - #elif __ARM_ARCH == 7 - #if __ARM_FEATURE_DSP - #define __ARM_ARCH_7EM__ 1 - #else - #define __ARM_ARCH_7M__ 1 - #endif - #endif /* __ARM_ARCH */ - #endif /* __ARM_ARCH_PROFILE == 'M' */ -#endif - -/* Alternativ core deduction for older ICCARM's */ -#if !defined(__ARM_ARCH_6M__) && !defined(__ARM_ARCH_7M__) && !defined(__ARM_ARCH_7EM__) && \ - !defined(__ARM_ARCH_8M_BASE__) && !defined(__ARM_ARCH_8M_MAIN__) - #if defined(__ARM6M__) && (__CORE__ == __ARM6M__) - #define __ARM_ARCH_6M__ 1 - #elif defined(__ARM7M__) && (__CORE__ == __ARM7M__) - #define __ARM_ARCH_7M__ 1 - #elif defined(__ARM7EM__) && (__CORE__ == __ARM7EM__) - #define __ARM_ARCH_7EM__ 1 - #elif defined(__ARM8M_BASELINE__) && (__CORE == __ARM8M_BASELINE__) - #define __ARM_ARCH_8M_BASE__ 1 - #elif defined(__ARM8M_MAINLINE__) && (__CORE == __ARM8M_MAINLINE__) - #define __ARM_ARCH_8M_MAIN__ 1 - #elif defined(__ARM8EM_MAINLINE__) && (__CORE == __ARM8EM_MAINLINE__) - #define __ARM_ARCH_8M_MAIN__ 1 - #else - #error "Unknown target." - #endif -#endif - - - -#if defined(__ARM_ARCH_6M__) && __ARM_ARCH_6M__==1 - #define __IAR_M0_FAMILY 1 -#elif defined(__ARM_ARCH_8M_BASE__) && __ARM_ARCH_8M_BASE__==1 - #define __IAR_M0_FAMILY 1 -#else - #define __IAR_M0_FAMILY 0 -#endif - - -#ifndef __ASM - #define __ASM __asm -#endif - -#ifndef __COMPILER_BARRIER - #define __COMPILER_BARRIER() __ASM volatile("":::"memory") -#endif - -#ifndef __INLINE - #define __INLINE inline -#endif - -#ifndef __NO_RETURN - #if __ICCARM_V8 - #define __NO_RETURN __attribute__((__noreturn__)) - #else - #define __NO_RETURN _Pragma("object_attribute=__noreturn") - #endif -#endif - -#ifndef __PACKED - #if __ICCARM_V8 - #define __PACKED __attribute__((packed, aligned(1))) - #else - /* Needs IAR language extensions */ - #define __PACKED __packed - #endif -#endif - -#ifndef __PACKED_STRUCT - #if __ICCARM_V8 - #define __PACKED_STRUCT struct __attribute__((packed, aligned(1))) - #else - /* Needs IAR language extensions */ - #define __PACKED_STRUCT __packed struct - #endif -#endif - -#ifndef __PACKED_UNION - #if __ICCARM_V8 - #define __PACKED_UNION union __attribute__((packed, aligned(1))) - #else - /* Needs IAR language extensions */ - #define __PACKED_UNION __packed union - #endif -#endif - -#ifndef __RESTRICT - #if __ICCARM_V8 - #define __RESTRICT __restrict - #else - /* Needs IAR language extensions */ - #define __RESTRICT restrict - #endif -#endif - -#ifndef __STATIC_INLINE - #define __STATIC_INLINE static inline -#endif - -#ifndef __FORCEINLINE - #define __FORCEINLINE _Pragma("inline=forced") -#endif - -#ifndef __STATIC_FORCEINLINE - #define __STATIC_FORCEINLINE __FORCEINLINE __STATIC_INLINE -#endif - -#ifndef __UNALIGNED_UINT16_READ -#pragma language=save -#pragma language=extended -__IAR_FT uint16_t __iar_uint16_read(void const *ptr) -{ - return *(__packed uint16_t*)(ptr); -} -#pragma language=restore -#define __UNALIGNED_UINT16_READ(PTR) __iar_uint16_read(PTR) -#endif - - -#ifndef __UNALIGNED_UINT16_WRITE -#pragma language=save -#pragma language=extended -__IAR_FT void __iar_uint16_write(void const *ptr, uint16_t val) -{ - *(__packed uint16_t*)(ptr) = val;; -} -#pragma language=restore -#define __UNALIGNED_UINT16_WRITE(PTR,VAL) __iar_uint16_write(PTR,VAL) -#endif - -#ifndef __UNALIGNED_UINT32_READ -#pragma language=save -#pragma language=extended -__IAR_FT uint32_t __iar_uint32_read(void const *ptr) -{ - return *(__packed uint32_t*)(ptr); -} -#pragma language=restore -#define __UNALIGNED_UINT32_READ(PTR) __iar_uint32_read(PTR) -#endif - -#ifndef __UNALIGNED_UINT32_WRITE -#pragma language=save -#pragma language=extended -__IAR_FT void __iar_uint32_write(void const *ptr, uint32_t val) -{ - *(__packed uint32_t*)(ptr) = val;; -} -#pragma language=restore -#define __UNALIGNED_UINT32_WRITE(PTR,VAL) __iar_uint32_write(PTR,VAL) -#endif - -#ifndef __UNALIGNED_UINT32 /* deprecated */ -#pragma language=save -#pragma language=extended -__packed struct __iar_u32 { uint32_t v; }; -#pragma language=restore -#define __UNALIGNED_UINT32(PTR) (((struct __iar_u32 *)(PTR))->v) -#endif - -#ifndef __USED - #if __ICCARM_V8 - #define __USED __attribute__((used)) - #else - #define __USED _Pragma("__root") - #endif -#endif - -#undef __WEAK /* undo the definition from DLib_Defaults.h */ -#ifndef __WEAK - #if __ICCARM_V8 - #define __WEAK __attribute__((weak)) - #else - #define __WEAK _Pragma("__weak") - #endif -#endif - -#ifndef __PROGRAM_START -#define __PROGRAM_START __iar_program_start -#endif - -#ifndef __INITIAL_SP -#define __INITIAL_SP CSTACK$$Limit -#endif - -#ifndef __STACK_LIMIT -#define __STACK_LIMIT CSTACK$$Base -#endif - -#ifndef __VECTOR_TABLE -#define __VECTOR_TABLE __vector_table -#endif - -#ifndef __VECTOR_TABLE_ATTRIBUTE -#define __VECTOR_TABLE_ATTRIBUTE @".intvec" -#endif - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) -#ifndef __STACK_SEAL -#define __STACK_SEAL STACKSEAL$$Base -#endif - -#ifndef __TZ_STACK_SEAL_SIZE -#define __TZ_STACK_SEAL_SIZE 8U -#endif - -#ifndef __TZ_STACK_SEAL_VALUE -#define __TZ_STACK_SEAL_VALUE 0xFEF5EDA5FEF5EDA5ULL -#endif - -__STATIC_FORCEINLINE void __TZ_set_STACKSEAL_S (uint32_t* stackTop) { - *((uint64_t *)stackTop) = __TZ_STACK_SEAL_VALUE; -} -#endif - -#ifndef __ICCARM_INTRINSICS_VERSION__ - #define __ICCARM_INTRINSICS_VERSION__ 0 -#endif - -#if __ICCARM_INTRINSICS_VERSION__ == 2 - - #if defined(__CLZ) - #undef __CLZ - #endif - #if defined(__REVSH) - #undef __REVSH - #endif - #if defined(__RBIT) - #undef __RBIT - #endif - #if defined(__SSAT) - #undef __SSAT - #endif - #if defined(__USAT) - #undef __USAT - #endif - - #include "iccarm_builtin.h" - - #define __disable_fault_irq __iar_builtin_disable_fiq - #define __disable_irq __iar_builtin_disable_interrupt - #define __enable_fault_irq __iar_builtin_enable_fiq - #define __enable_irq __iar_builtin_enable_interrupt - #define __arm_rsr __iar_builtin_rsr - #define __arm_wsr __iar_builtin_wsr - - - #define __get_APSR() (__arm_rsr("APSR")) - #define __get_BASEPRI() (__arm_rsr("BASEPRI")) - #define __get_CONTROL() (__arm_rsr("CONTROL")) - #define __get_FAULTMASK() (__arm_rsr("FAULTMASK")) - - #if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) - #define __get_FPSCR() (__arm_rsr("FPSCR")) - #define __set_FPSCR(VALUE) (__arm_wsr("FPSCR", (VALUE))) - #else - #define __get_FPSCR() ( 0 ) - #define __set_FPSCR(VALUE) ((void)VALUE) - #endif - - #define __get_IPSR() (__arm_rsr("IPSR")) - #define __get_MSP() (__arm_rsr("MSP")) - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - #define __get_MSPLIM() (0U) - #else - #define __get_MSPLIM() (__arm_rsr("MSPLIM")) - #endif - #define __get_PRIMASK() (__arm_rsr("PRIMASK")) - #define __get_PSP() (__arm_rsr("PSP")) - - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - #define __get_PSPLIM() (0U) - #else - #define __get_PSPLIM() (__arm_rsr("PSPLIM")) - #endif - - #define __get_xPSR() (__arm_rsr("xPSR")) - - #define __set_BASEPRI(VALUE) (__arm_wsr("BASEPRI", (VALUE))) - #define __set_BASEPRI_MAX(VALUE) (__arm_wsr("BASEPRI_MAX", (VALUE))) - -__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control) -{ - __arm_wsr("CONTROL", control); - __iar_builtin_ISB(); -} - - #define __set_FAULTMASK(VALUE) (__arm_wsr("FAULTMASK", (VALUE))) - #define __set_MSP(VALUE) (__arm_wsr("MSP", (VALUE))) - - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - #define __set_MSPLIM(VALUE) ((void)(VALUE)) - #else - #define __set_MSPLIM(VALUE) (__arm_wsr("MSPLIM", (VALUE))) - #endif - #define __set_PRIMASK(VALUE) (__arm_wsr("PRIMASK", (VALUE))) - #define __set_PSP(VALUE) (__arm_wsr("PSP", (VALUE))) - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - #define __set_PSPLIM(VALUE) ((void)(VALUE)) - #else - #define __set_PSPLIM(VALUE) (__arm_wsr("PSPLIM", (VALUE))) - #endif - - #define __TZ_get_CONTROL_NS() (__arm_rsr("CONTROL_NS")) - -__STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control) -{ - __arm_wsr("CONTROL_NS", control); - __iar_builtin_ISB(); -} - - #define __TZ_get_PSP_NS() (__arm_rsr("PSP_NS")) - #define __TZ_set_PSP_NS(VALUE) (__arm_wsr("PSP_NS", (VALUE))) - #define __TZ_get_MSP_NS() (__arm_rsr("MSP_NS")) - #define __TZ_set_MSP_NS(VALUE) (__arm_wsr("MSP_NS", (VALUE))) - #define __TZ_get_SP_NS() (__arm_rsr("SP_NS")) - #define __TZ_set_SP_NS(VALUE) (__arm_wsr("SP_NS", (VALUE))) - #define __TZ_get_PRIMASK_NS() (__arm_rsr("PRIMASK_NS")) - #define __TZ_set_PRIMASK_NS(VALUE) (__arm_wsr("PRIMASK_NS", (VALUE))) - #define __TZ_get_BASEPRI_NS() (__arm_rsr("BASEPRI_NS")) - #define __TZ_set_BASEPRI_NS(VALUE) (__arm_wsr("BASEPRI_NS", (VALUE))) - #define __TZ_get_FAULTMASK_NS() (__arm_rsr("FAULTMASK_NS")) - #define __TZ_set_FAULTMASK_NS(VALUE)(__arm_wsr("FAULTMASK_NS", (VALUE))) - - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - #define __TZ_get_PSPLIM_NS() (0U) - #define __TZ_set_PSPLIM_NS(VALUE) ((void)(VALUE)) - #else - #define __TZ_get_PSPLIM_NS() (__arm_rsr("PSPLIM_NS")) - #define __TZ_set_PSPLIM_NS(VALUE) (__arm_wsr("PSPLIM_NS", (VALUE))) - #endif - - #define __TZ_get_MSPLIM_NS() (__arm_rsr("MSPLIM_NS")) - #define __TZ_set_MSPLIM_NS(VALUE) (__arm_wsr("MSPLIM_NS", (VALUE))) - - #define __NOP __iar_builtin_no_operation - - #define __CLZ __iar_builtin_CLZ - #define __CLREX __iar_builtin_CLREX - - #define __DMB __iar_builtin_DMB - #define __DSB __iar_builtin_DSB - #define __ISB __iar_builtin_ISB - - #define __LDREXB __iar_builtin_LDREXB - #define __LDREXH __iar_builtin_LDREXH - #define __LDREXW __iar_builtin_LDREX - - #define __RBIT __iar_builtin_RBIT - #define __REV __iar_builtin_REV - #define __REV16 __iar_builtin_REV16 - - __IAR_FT int16_t __REVSH(int16_t val) - { - return (int16_t) __iar_builtin_REVSH(val); - } - - #define __ROR __iar_builtin_ROR - #define __RRX __iar_builtin_RRX - - #define __SEV __iar_builtin_SEV - - #if !__IAR_M0_FAMILY - #define __SSAT __iar_builtin_SSAT - #endif - - #define __STREXB __iar_builtin_STREXB - #define __STREXH __iar_builtin_STREXH - #define __STREXW __iar_builtin_STREX - - #if !__IAR_M0_FAMILY - #define __USAT __iar_builtin_USAT - #endif - - #define __WFE __iar_builtin_WFE - #define __WFI __iar_builtin_WFI - - #if __ARM_MEDIA__ - #define __SADD8 __iar_builtin_SADD8 - #define __QADD8 __iar_builtin_QADD8 - #define __SHADD8 __iar_builtin_SHADD8 - #define __UADD8 __iar_builtin_UADD8 - #define __UQADD8 __iar_builtin_UQADD8 - #define __UHADD8 __iar_builtin_UHADD8 - #define __SSUB8 __iar_builtin_SSUB8 - #define __QSUB8 __iar_builtin_QSUB8 - #define __SHSUB8 __iar_builtin_SHSUB8 - #define __USUB8 __iar_builtin_USUB8 - #define __UQSUB8 __iar_builtin_UQSUB8 - #define __UHSUB8 __iar_builtin_UHSUB8 - #define __SADD16 __iar_builtin_SADD16 - #define __QADD16 __iar_builtin_QADD16 - #define __SHADD16 __iar_builtin_SHADD16 - #define __UADD16 __iar_builtin_UADD16 - #define __UQADD16 __iar_builtin_UQADD16 - #define __UHADD16 __iar_builtin_UHADD16 - #define __SSUB16 __iar_builtin_SSUB16 - #define __QSUB16 __iar_builtin_QSUB16 - #define __SHSUB16 __iar_builtin_SHSUB16 - #define __USUB16 __iar_builtin_USUB16 - #define __UQSUB16 __iar_builtin_UQSUB16 - #define __UHSUB16 __iar_builtin_UHSUB16 - #define __SASX __iar_builtin_SASX - #define __QASX __iar_builtin_QASX - #define __SHASX __iar_builtin_SHASX - #define __UASX __iar_builtin_UASX - #define __UQASX __iar_builtin_UQASX - #define __UHASX __iar_builtin_UHASX - #define __SSAX __iar_builtin_SSAX - #define __QSAX __iar_builtin_QSAX - #define __SHSAX __iar_builtin_SHSAX - #define __USAX __iar_builtin_USAX - #define __UQSAX __iar_builtin_UQSAX - #define __UHSAX __iar_builtin_UHSAX - #define __USAD8 __iar_builtin_USAD8 - #define __USADA8 __iar_builtin_USADA8 - #define __SSAT16 __iar_builtin_SSAT16 - #define __USAT16 __iar_builtin_USAT16 - #define __UXTB16 __iar_builtin_UXTB16 - #define __UXTAB16 __iar_builtin_UXTAB16 - #define __SXTB16 __iar_builtin_SXTB16 - #define __SXTAB16 __iar_builtin_SXTAB16 - #define __SMUAD __iar_builtin_SMUAD - #define __SMUADX __iar_builtin_SMUADX - #define __SMMLA __iar_builtin_SMMLA - #define __SMLAD __iar_builtin_SMLAD - #define __SMLADX __iar_builtin_SMLADX - #define __SMLALD __iar_builtin_SMLALD - #define __SMLALDX __iar_builtin_SMLALDX - #define __SMUSD __iar_builtin_SMUSD - #define __SMUSDX __iar_builtin_SMUSDX - #define __SMLSD __iar_builtin_SMLSD - #define __SMLSDX __iar_builtin_SMLSDX - #define __SMLSLD __iar_builtin_SMLSLD - #define __SMLSLDX __iar_builtin_SMLSLDX - #define __SEL __iar_builtin_SEL - #define __QADD __iar_builtin_QADD - #define __QSUB __iar_builtin_QSUB - #define __PKHBT __iar_builtin_PKHBT - #define __PKHTB __iar_builtin_PKHTB - #endif - -#else /* __ICCARM_INTRINSICS_VERSION__ == 2 */ - - #if __IAR_M0_FAMILY - /* Avoid clash between intrinsics.h and arm_math.h when compiling for Cortex-M0. */ - #define __CLZ __cmsis_iar_clz_not_active - #define __SSAT __cmsis_iar_ssat_not_active - #define __USAT __cmsis_iar_usat_not_active - #define __RBIT __cmsis_iar_rbit_not_active - #define __get_APSR __cmsis_iar_get_APSR_not_active - #endif - - - #if (!((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) )) - #define __get_FPSCR __cmsis_iar_get_FPSR_not_active - #define __set_FPSCR __cmsis_iar_set_FPSR_not_active - #endif - - #ifdef __INTRINSICS_INCLUDED - #error intrinsics.h is already included previously! - #endif - - #include - - #if __IAR_M0_FAMILY - /* Avoid clash between intrinsics.h and arm_math.h when compiling for Cortex-M0. */ - #undef __CLZ - #undef __SSAT - #undef __USAT - #undef __RBIT - #undef __get_APSR - - __STATIC_INLINE uint8_t __CLZ(uint32_t data) - { - if (data == 0U) { return 32U; } - - uint32_t count = 0U; - uint32_t mask = 0x80000000U; - - while ((data & mask) == 0U) - { - count += 1U; - mask = mask >> 1U; - } - return count; - } - - __STATIC_INLINE uint32_t __RBIT(uint32_t v) - { - uint8_t sc = 31U; - uint32_t r = v; - for (v >>= 1U; v; v >>= 1U) - { - r <<= 1U; - r |= v & 1U; - sc--; - } - return (r << sc); - } - - __STATIC_INLINE uint32_t __get_APSR(void) - { - uint32_t res; - __asm("MRS %0,APSR" : "=r" (res)); - return res; - } - - #endif - - #if (!((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) )) - #undef __get_FPSCR - #undef __set_FPSCR - #define __get_FPSCR() (0) - #define __set_FPSCR(VALUE) ((void)VALUE) - #endif - - #pragma diag_suppress=Pe940 - #pragma diag_suppress=Pe177 - - #define __enable_irq __enable_interrupt - #define __disable_irq __disable_interrupt - #define __NOP __no_operation - - #define __get_xPSR __get_PSR - - #if (!defined(__ARM_ARCH_6M__) || __ARM_ARCH_6M__==0) - - __IAR_FT uint32_t __LDREXW(uint32_t volatile *ptr) - { - return __LDREX((unsigned long *)ptr); - } - - __IAR_FT uint32_t __STREXW(uint32_t value, uint32_t volatile *ptr) - { - return __STREX(value, (unsigned long *)ptr); - } - #endif - - - /* __CORTEX_M is defined in core_cm0.h, core_cm3.h and core_cm4.h. */ - #if (__CORTEX_M >= 0x03) - - __IAR_FT uint32_t __RRX(uint32_t value) - { - uint32_t result; - __ASM volatile("RRX %0, %1" : "=r"(result) : "r" (value)); - return(result); - } - - __IAR_FT void __set_BASEPRI_MAX(uint32_t value) - { - __asm volatile("MSR BASEPRI_MAX,%0"::"r" (value)); - } - - - #define __enable_fault_irq __enable_fiq - #define __disable_fault_irq __disable_fiq - - - #endif /* (__CORTEX_M >= 0x03) */ - - __IAR_FT uint32_t __ROR(uint32_t op1, uint32_t op2) - { - return (op1 >> op2) | (op1 << ((sizeof(op1)*8)-op2)); - } - - #if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) - - __IAR_FT uint32_t __get_MSPLIM(void) - { - uint32_t res; - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - res = 0U; - #else - __asm volatile("MRS %0,MSPLIM" : "=r" (res)); - #endif - return res; - } - - __IAR_FT void __set_MSPLIM(uint32_t value) - { - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - (void)value; - #else - __asm volatile("MSR MSPLIM,%0" :: "r" (value)); - #endif - } - - __IAR_FT uint32_t __get_PSPLIM(void) - { - uint32_t res; - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - res = 0U; - #else - __asm volatile("MRS %0,PSPLIM" : "=r" (res)); - #endif - return res; - } - - __IAR_FT void __set_PSPLIM(uint32_t value) - { - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - (void)value; - #else - __asm volatile("MSR PSPLIM,%0" :: "r" (value)); - #endif - } - - __IAR_FT uint32_t __TZ_get_CONTROL_NS(void) - { - uint32_t res; - __asm volatile("MRS %0,CONTROL_NS" : "=r" (res)); - return res; - } - - __IAR_FT void __TZ_set_CONTROL_NS(uint32_t value) - { - __asm volatile("MSR CONTROL_NS,%0" :: "r" (value)); - __iar_builtin_ISB(); - } - - __IAR_FT uint32_t __TZ_get_PSP_NS(void) - { - uint32_t res; - __asm volatile("MRS %0,PSP_NS" : "=r" (res)); - return res; - } - - __IAR_FT void __TZ_set_PSP_NS(uint32_t value) - { - __asm volatile("MSR PSP_NS,%0" :: "r" (value)); - } - - __IAR_FT uint32_t __TZ_get_MSP_NS(void) - { - uint32_t res; - __asm volatile("MRS %0,MSP_NS" : "=r" (res)); - return res; - } - - __IAR_FT void __TZ_set_MSP_NS(uint32_t value) - { - __asm volatile("MSR MSP_NS,%0" :: "r" (value)); - } - - __IAR_FT uint32_t __TZ_get_SP_NS(void) - { - uint32_t res; - __asm volatile("MRS %0,SP_NS" : "=r" (res)); - return res; - } - __IAR_FT void __TZ_set_SP_NS(uint32_t value) - { - __asm volatile("MSR SP_NS,%0" :: "r" (value)); - } - - __IAR_FT uint32_t __TZ_get_PRIMASK_NS(void) - { - uint32_t res; - __asm volatile("MRS %0,PRIMASK_NS" : "=r" (res)); - return res; - } - - __IAR_FT void __TZ_set_PRIMASK_NS(uint32_t value) - { - __asm volatile("MSR PRIMASK_NS,%0" :: "r" (value)); - } - - __IAR_FT uint32_t __TZ_get_BASEPRI_NS(void) - { - uint32_t res; - __asm volatile("MRS %0,BASEPRI_NS" : "=r" (res)); - return res; - } - - __IAR_FT void __TZ_set_BASEPRI_NS(uint32_t value) - { - __asm volatile("MSR BASEPRI_NS,%0" :: "r" (value)); - } - - __IAR_FT uint32_t __TZ_get_FAULTMASK_NS(void) - { - uint32_t res; - __asm volatile("MRS %0,FAULTMASK_NS" : "=r" (res)); - return res; - } - - __IAR_FT void __TZ_set_FAULTMASK_NS(uint32_t value) - { - __asm volatile("MSR FAULTMASK_NS,%0" :: "r" (value)); - } - - __IAR_FT uint32_t __TZ_get_PSPLIM_NS(void) - { - uint32_t res; - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - res = 0U; - #else - __asm volatile("MRS %0,PSPLIM_NS" : "=r" (res)); - #endif - return res; - } - - __IAR_FT void __TZ_set_PSPLIM_NS(uint32_t value) - { - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - (void)value; - #else - __asm volatile("MSR PSPLIM_NS,%0" :: "r" (value)); - #endif - } - - __IAR_FT uint32_t __TZ_get_MSPLIM_NS(void) - { - uint32_t res; - __asm volatile("MRS %0,MSPLIM_NS" : "=r" (res)); - return res; - } - - __IAR_FT void __TZ_set_MSPLIM_NS(uint32_t value) - { - __asm volatile("MSR MSPLIM_NS,%0" :: "r" (value)); - } - - #endif /* __ARM_ARCH_8M_MAIN__ or __ARM_ARCH_8M_BASE__ */ - -#endif /* __ICCARM_INTRINSICS_VERSION__ == 2 */ - -#define __BKPT(value) __asm volatile ("BKPT %0" : : "i"(value)) - -#if __IAR_M0_FAMILY - __STATIC_INLINE int32_t __SSAT(int32_t val, uint32_t sat) - { - if ((sat >= 1U) && (sat <= 32U)) - { - const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); - const int32_t min = -1 - max ; - if (val > max) - { - return max; - } - else if (val < min) - { - return min; - } - } - return val; - } - - __STATIC_INLINE uint32_t __USAT(int32_t val, uint32_t sat) - { - if (sat <= 31U) - { - const uint32_t max = ((1U << sat) - 1U); - if (val > (int32_t)max) - { - return max; - } - else if (val < 0) - { - return 0U; - } - } - return (uint32_t)val; - } -#endif - -#if (__CORTEX_M >= 0x03) /* __CORTEX_M is defined in core_cm0.h, core_cm3.h and core_cm4.h. */ - - __IAR_FT uint8_t __LDRBT(volatile uint8_t *addr) - { - uint32_t res; - __ASM volatile ("LDRBT %0, [%1]" : "=r" (res) : "r" (addr) : "memory"); - return ((uint8_t)res); - } - - __IAR_FT uint16_t __LDRHT(volatile uint16_t *addr) - { - uint32_t res; - __ASM volatile ("LDRHT %0, [%1]" : "=r" (res) : "r" (addr) : "memory"); - return ((uint16_t)res); - } - - __IAR_FT uint32_t __LDRT(volatile uint32_t *addr) - { - uint32_t res; - __ASM volatile ("LDRT %0, [%1]" : "=r" (res) : "r" (addr) : "memory"); - return res; - } - - __IAR_FT void __STRBT(uint8_t value, volatile uint8_t *addr) - { - __ASM volatile ("STRBT %1, [%0]" : : "r" (addr), "r" ((uint32_t)value) : "memory"); - } - - __IAR_FT void __STRHT(uint16_t value, volatile uint16_t *addr) - { - __ASM volatile ("STRHT %1, [%0]" : : "r" (addr), "r" ((uint32_t)value) : "memory"); - } - - __IAR_FT void __STRT(uint32_t value, volatile uint32_t *addr) - { - __ASM volatile ("STRT %1, [%0]" : : "r" (addr), "r" (value) : "memory"); - } - -#endif /* (__CORTEX_M >= 0x03) */ - -#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) - - - __IAR_FT uint8_t __LDAB(volatile uint8_t *ptr) - { - uint32_t res; - __ASM volatile ("LDAB %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); - return ((uint8_t)res); - } - - __IAR_FT uint16_t __LDAH(volatile uint16_t *ptr) - { - uint32_t res; - __ASM volatile ("LDAH %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); - return ((uint16_t)res); - } - - __IAR_FT uint32_t __LDA(volatile uint32_t *ptr) - { - uint32_t res; - __ASM volatile ("LDA %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); - return res; - } - - __IAR_FT void __STLB(uint8_t value, volatile uint8_t *ptr) - { - __ASM volatile ("STLB %1, [%0]" :: "r" (ptr), "r" (value) : "memory"); - } - - __IAR_FT void __STLH(uint16_t value, volatile uint16_t *ptr) - { - __ASM volatile ("STLH %1, [%0]" :: "r" (ptr), "r" (value) : "memory"); - } - - __IAR_FT void __STL(uint32_t value, volatile uint32_t *ptr) - { - __ASM volatile ("STL %1, [%0]" :: "r" (ptr), "r" (value) : "memory"); - } - - __IAR_FT uint8_t __LDAEXB(volatile uint8_t *ptr) - { - uint32_t res; - __ASM volatile ("LDAEXB %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); - return ((uint8_t)res); - } - - __IAR_FT uint16_t __LDAEXH(volatile uint16_t *ptr) - { - uint32_t res; - __ASM volatile ("LDAEXH %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); - return ((uint16_t)res); - } - - __IAR_FT uint32_t __LDAEX(volatile uint32_t *ptr) - { - uint32_t res; - __ASM volatile ("LDAEX %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); - return res; - } - - __IAR_FT uint32_t __STLEXB(uint8_t value, volatile uint8_t *ptr) - { - uint32_t res; - __ASM volatile ("STLEXB %0, %2, [%1]" : "=r" (res) : "r" (ptr), "r" (value) : "memory"); - return res; - } - - __IAR_FT uint32_t __STLEXH(uint16_t value, volatile uint16_t *ptr) - { - uint32_t res; - __ASM volatile ("STLEXH %0, %2, [%1]" : "=r" (res) : "r" (ptr), "r" (value) : "memory"); - return res; - } - - __IAR_FT uint32_t __STLEX(uint32_t value, volatile uint32_t *ptr) - { - uint32_t res; - __ASM volatile ("STLEX %0, %2, [%1]" : "=r" (res) : "r" (ptr), "r" (value) : "memory"); - return res; - } - -#endif /* __ARM_ARCH_8M_MAIN__ or __ARM_ARCH_8M_BASE__ */ - -#undef __IAR_FT -#undef __IAR_M0_FAMILY -#undef __ICCARM_V8 - -#pragma diag_default=Pe940 -#pragma diag_default=Pe177 - -#define __SXTB16_RORn(ARG1, ARG2) __SXTB16(__ROR(ARG1, ARG2)) - -#define __SXTAB16_RORn(ARG1, ARG2, ARG3) __SXTAB16(ARG1, __ROR(ARG2, ARG3)) - -#endif /* __CMSIS_ICCARM_H__ */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/CMSIS/Core/Include/cmsis_version.h b/bsp/nxp/mcx/mcxc/Libraries/CMSIS/Core/Include/cmsis_version.h deleted file mode 100644 index 8b4765f186e..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/CMSIS/Core/Include/cmsis_version.h +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************//** - * @file cmsis_version.h - * @brief CMSIS Core(M) Version definitions - * @version V5.0.5 - * @date 02. February 2022 - ******************************************************************************/ -/* - * Copyright (c) 2009-2022 ARM Limited. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined (__clang__) - #pragma clang system_header /* treat file as system include file */ -#endif - -#ifndef __CMSIS_VERSION_H -#define __CMSIS_VERSION_H - -/* CMSIS Version definitions */ -#define __CM_CMSIS_VERSION_MAIN ( 5U) /*!< [31:16] CMSIS Core(M) main version */ -#define __CM_CMSIS_VERSION_SUB ( 6U) /*!< [15:0] CMSIS Core(M) sub version */ -#define __CM_CMSIS_VERSION ((__CM_CMSIS_VERSION_MAIN << 16U) | \ - __CM_CMSIS_VERSION_SUB ) /*!< CMSIS Core(M) version number */ -#endif diff --git a/bsp/nxp/mcx/mcxc/Libraries/CMSIS/Core/Include/core_cm0plus.h b/bsp/nxp/mcx/mcxc/Libraries/CMSIS/Core/Include/core_cm0plus.h deleted file mode 100644 index 879a384124e..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/CMSIS/Core/Include/core_cm0plus.h +++ /dev/null @@ -1,1087 +0,0 @@ -/**************************************************************************//** - * @file core_cm0plus.h - * @brief CMSIS Cortex-M0+ Core Peripheral Access Layer Header File - * @version V5.0.9 - * @date 21. August 2019 - ******************************************************************************/ -/* - * Copyright (c) 2009-2019 Arm Limited. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined (__clang__) - #pragma clang system_header /* treat file as system include file */ -#endif - -#ifndef __CORE_CM0PLUS_H_GENERIC -#define __CORE_CM0PLUS_H_GENERIC - -#include - -#ifdef __cplusplus - extern "C" { -#endif - -/** - \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions - CMSIS violates the following MISRA-C:2004 rules: - - \li Required Rule 8.5, object/function definition in header file.
- Function definitions in header files are used to allow 'inlining'. - - \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
- Unions are used for effective representation of core registers. - - \li Advisory Rule 19.7, Function-like macro defined.
- Function-like macros are used to allow more efficient code. - */ - - -/******************************************************************************* - * CMSIS definitions - ******************************************************************************/ -/** - \ingroup Cortex-M0+ - @{ - */ - -#include "cmsis_version.h" - -/* CMSIS CM0+ definitions */ -#define __CM0PLUS_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ -#define __CM0PLUS_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ -#define __CM0PLUS_CMSIS_VERSION ((__CM0PLUS_CMSIS_VERSION_MAIN << 16U) | \ - __CM0PLUS_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ - -#define __CORTEX_M (0U) /*!< Cortex-M Core */ - -/** __FPU_USED indicates whether an FPU is used or not. - This core does not support an FPU at all -*/ -#define __FPU_USED 0U - -#if defined ( __CC_ARM ) - #if defined __TARGET_FPU_VFP - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #if defined __ARM_FP - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined ( __GNUC__ ) - #if defined (__VFP_FP__) && !defined(__SOFTFP__) - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined ( __ICCARM__ ) - #if defined __ARMVFP__ - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined ( __TI_ARM__ ) - #if defined __TI_VFP_SUPPORT__ - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined ( __TASKING__ ) - #if defined __FPU_VFP__ - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined ( __CSMC__ ) - #if ( __CSMC__ & 0x400U) - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#endif - -#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ - - -#ifdef __cplusplus -} -#endif - -#endif /* __CORE_CM0PLUS_H_GENERIC */ - -#ifndef __CMSIS_GENERIC - -#ifndef __CORE_CM0PLUS_H_DEPENDANT -#define __CORE_CM0PLUS_H_DEPENDANT - -#ifdef __cplusplus - extern "C" { -#endif - -/* check device defines and use defaults */ -#if defined __CHECK_DEVICE_DEFINES - #ifndef __CM0PLUS_REV - #define __CM0PLUS_REV 0x0000U - #warning "__CM0PLUS_REV not defined in device header file; using default!" - #endif - - #ifndef __MPU_PRESENT - #define __MPU_PRESENT 0U - #warning "__MPU_PRESENT not defined in device header file; using default!" - #endif - - #ifndef __VTOR_PRESENT - #define __VTOR_PRESENT 0U - #warning "__VTOR_PRESENT not defined in device header file; using default!" - #endif - - #ifndef __NVIC_PRIO_BITS - #define __NVIC_PRIO_BITS 2U - #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" - #endif - - #ifndef __Vendor_SysTickConfig - #define __Vendor_SysTickConfig 0U - #warning "__Vendor_SysTickConfig not defined in device header file; using default!" - #endif -#endif - -/* IO definitions (access restrictions to peripheral registers) */ -/** - \defgroup CMSIS_glob_defs CMSIS Global Defines - - IO Type Qualifiers are used - \li to specify the access to peripheral variables. - \li for automatic generation of peripheral register debug information. -*/ -#ifdef __cplusplus - #define __I volatile /*!< Defines 'read only' permissions */ -#else - #define __I volatile const /*!< Defines 'read only' permissions */ -#endif -#define __O volatile /*!< Defines 'write only' permissions */ -#define __IO volatile /*!< Defines 'read / write' permissions */ - -/* following defines should be used for structure members */ -#define __IM volatile const /*! Defines 'read only' structure member permissions */ -#define __OM volatile /*! Defines 'write only' structure member permissions */ -#define __IOM volatile /*! Defines 'read / write' structure member permissions */ - -/*@} end of group Cortex-M0+ */ - - - -/******************************************************************************* - * Register Abstraction - Core Register contain: - - Core Register - - Core NVIC Register - - Core SCB Register - - Core SysTick Register - - Core MPU Register - ******************************************************************************/ -/** - \defgroup CMSIS_core_register Defines and Type Definitions - \brief Type definitions and defines for Cortex-M processor based devices. -*/ - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_CORE Status and Control Registers - \brief Core Register type definitions. - @{ - */ - -/** - \brief Union type to access the Application Program Status Register (APSR). - */ -typedef union -{ - struct - { - uint32_t _reserved0:28; /*!< bit: 0..27 Reserved */ - uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ - uint32_t C:1; /*!< bit: 29 Carry condition code flag */ - uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ - uint32_t N:1; /*!< bit: 31 Negative condition code flag */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} APSR_Type; - -/* APSR Register Definitions */ -#define APSR_N_Pos 31U /*!< APSR: N Position */ -#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ - -#define APSR_Z_Pos 30U /*!< APSR: Z Position */ -#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ - -#define APSR_C_Pos 29U /*!< APSR: C Position */ -#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ - -#define APSR_V_Pos 28U /*!< APSR: V Position */ -#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ - - -/** - \brief Union type to access the Interrupt Program Status Register (IPSR). - */ -typedef union -{ - struct - { - uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ - uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} IPSR_Type; - -/* IPSR Register Definitions */ -#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ -#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ - - -/** - \brief Union type to access the Special-Purpose Program Status Registers (xPSR). - */ -typedef union -{ - struct - { - uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ - uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */ - uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ - uint32_t _reserved1:3; /*!< bit: 25..27 Reserved */ - uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ - uint32_t C:1; /*!< bit: 29 Carry condition code flag */ - uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ - uint32_t N:1; /*!< bit: 31 Negative condition code flag */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} xPSR_Type; - -/* xPSR Register Definitions */ -#define xPSR_N_Pos 31U /*!< xPSR: N Position */ -#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ - -#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ -#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ - -#define xPSR_C_Pos 29U /*!< xPSR: C Position */ -#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ - -#define xPSR_V_Pos 28U /*!< xPSR: V Position */ -#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ - -#define xPSR_T_Pos 24U /*!< xPSR: T Position */ -#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ - -#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ -#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ - - -/** - \brief Union type to access the Control Registers (CONTROL). - */ -typedef union -{ - struct - { - uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ - uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */ - uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} CONTROL_Type; - -/* CONTROL Register Definitions */ -#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ -#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ - -#define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */ -#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ - -/*@} end of group CMSIS_CORE */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) - \brief Type definitions for the NVIC Registers - @{ - */ - -/** - \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). - */ -typedef struct -{ - __IOM uint32_t ISER[1U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ - uint32_t RESERVED0[31U]; - __IOM uint32_t ICER[1U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ - uint32_t RESERVED1[31U]; - __IOM uint32_t ISPR[1U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ - uint32_t RESERVED2[31U]; - __IOM uint32_t ICPR[1U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ - uint32_t RESERVED3[31U]; - uint32_t RESERVED4[64U]; - __IOM uint32_t IP[8U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register */ -} NVIC_Type; - -/*@} end of group CMSIS_NVIC */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_SCB System Control Block (SCB) - \brief Type definitions for the System Control Block Registers - @{ - */ - -/** - \brief Structure type to access the System Control Block (SCB). - */ -typedef struct -{ - __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ - __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ -#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U) - __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ -#else - uint32_t RESERVED0; -#endif - __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ - __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ - __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ - uint32_t RESERVED1; - __IOM uint32_t SHP[2U]; /*!< Offset: 0x01C (R/W) System Handlers Priority Registers. [0] is RESERVED */ - __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ -} SCB_Type; - -/* SCB CPUID Register Definitions */ -#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ -#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ - -#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ -#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ - -#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ -#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ - -#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ -#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ - -#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ -#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ - -/* SCB Interrupt Control State Register Definitions */ -#define SCB_ICSR_NMIPENDSET_Pos 31U /*!< SCB ICSR: NMIPENDSET Position */ -#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ - -#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ -#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ - -#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ -#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ - -#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ -#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ - -#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ -#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ - -#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ -#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ - -#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ -#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ - -#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ -#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ - -#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ -#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ - -#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U) -/* SCB Interrupt Control State Register Definitions */ -#define SCB_VTOR_TBLOFF_Pos 8U /*!< SCB VTOR: TBLOFF Position */ -#define SCB_VTOR_TBLOFF_Msk (0xFFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ -#endif - -/* SCB Application Interrupt and Reset Control Register Definitions */ -#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ -#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ - -#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ -#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ - -#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ -#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ - -#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ -#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ - -#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ -#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ - -/* SCB System Control Register Definitions */ -#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ -#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ - -#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ -#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ - -#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ -#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ - -/* SCB Configuration Control Register Definitions */ -#define SCB_CCR_STKALIGN_Pos 9U /*!< SCB CCR: STKALIGN Position */ -#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ - -#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ -#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ - -/* SCB System Handler Control and State Register Definitions */ -#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ -#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ - -/*@} end of group CMSIS_SCB */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_SysTick System Tick Timer (SysTick) - \brief Type definitions for the System Timer Registers. - @{ - */ - -/** - \brief Structure type to access the System Timer (SysTick). - */ -typedef struct -{ - __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ - __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ - __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ - __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ -} SysTick_Type; - -/* SysTick Control / Status Register Definitions */ -#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ -#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ - -#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ -#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ - -#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ -#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ - -#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ -#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ - -/* SysTick Reload Register Definitions */ -#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ -#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ - -/* SysTick Current Register Definitions */ -#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ -#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ - -/* SysTick Calibration Register Definitions */ -#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ -#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ - -#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ -#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ - -#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ -#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ - -/*@} end of group CMSIS_SysTick */ - -#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_MPU Memory Protection Unit (MPU) - \brief Type definitions for the Memory Protection Unit (MPU) - @{ - */ - -/** - \brief Structure type to access the Memory Protection Unit (MPU). - */ -typedef struct -{ - __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ - __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ - __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region RNRber Register */ - __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ - __IOM uint32_t RASR; /*!< Offset: 0x010 (R/W) MPU Region Attribute and Size Register */ -} MPU_Type; - -#define MPU_TYPE_RALIASES 1U - -/* MPU Type Register Definitions */ -#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */ -#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ - -#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */ -#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ - -#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */ -#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ - -/* MPU Control Register Definitions */ -#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */ -#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ - -#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */ -#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ - -#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */ -#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ - -/* MPU Region Number Register Definitions */ -#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */ -#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ - -/* MPU Region Base Address Register Definitions */ -#define MPU_RBAR_ADDR_Pos 8U /*!< MPU RBAR: ADDR Position */ -#define MPU_RBAR_ADDR_Msk (0xFFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */ - -#define MPU_RBAR_VALID_Pos 4U /*!< MPU RBAR: VALID Position */ -#define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */ - -#define MPU_RBAR_REGION_Pos 0U /*!< MPU RBAR: REGION Position */ -#define MPU_RBAR_REGION_Msk (0xFUL /*<< MPU_RBAR_REGION_Pos*/) /*!< MPU RBAR: REGION Mask */ - -/* MPU Region Attribute and Size Register Definitions */ -#define MPU_RASR_ATTRS_Pos 16U /*!< MPU RASR: MPU Region Attribute field Position */ -#define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) /*!< MPU RASR: MPU Region Attribute field Mask */ - -#define MPU_RASR_XN_Pos 28U /*!< MPU RASR: ATTRS.XN Position */ -#define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos) /*!< MPU RASR: ATTRS.XN Mask */ - -#define MPU_RASR_AP_Pos 24U /*!< MPU RASR: ATTRS.AP Position */ -#define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos) /*!< MPU RASR: ATTRS.AP Mask */ - -#define MPU_RASR_TEX_Pos 19U /*!< MPU RASR: ATTRS.TEX Position */ -#define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos) /*!< MPU RASR: ATTRS.TEX Mask */ - -#define MPU_RASR_S_Pos 18U /*!< MPU RASR: ATTRS.S Position */ -#define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos) /*!< MPU RASR: ATTRS.S Mask */ - -#define MPU_RASR_C_Pos 17U /*!< MPU RASR: ATTRS.C Position */ -#define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos) /*!< MPU RASR: ATTRS.C Mask */ - -#define MPU_RASR_B_Pos 16U /*!< MPU RASR: ATTRS.B Position */ -#define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos) /*!< MPU RASR: ATTRS.B Mask */ - -#define MPU_RASR_SRD_Pos 8U /*!< MPU RASR: Sub-Region Disable Position */ -#define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */ - -#define MPU_RASR_SIZE_Pos 1U /*!< MPU RASR: Region Size Field Position */ -#define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region Size Field Mask */ - -#define MPU_RASR_ENABLE_Pos 0U /*!< MPU RASR: Region enable bit Position */ -#define MPU_RASR_ENABLE_Msk (1UL /*<< MPU_RASR_ENABLE_Pos*/) /*!< MPU RASR: Region enable bit Disable Mask */ - -/*@} end of group CMSIS_MPU */ -#endif - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) - \brief Cortex-M0+ Core Debug Registers (DCB registers, SHCSR, and DFSR) are only accessible over DAP and not via processor. - Therefore they are not covered by the Cortex-M0+ header file. - @{ - */ -/*@} end of group CMSIS_CoreDebug */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_core_bitfield Core register bit field macros - \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). - @{ - */ - -/** - \brief Mask and shift a bit field value for use in a register bit range. - \param[in] field Name of the register bit field. - \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. - \return Masked and shifted value. -*/ -#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) - -/** - \brief Mask and shift a register value to extract a bit filed value. - \param[in] field Name of the register bit field. - \param[in] value Value of register. This parameter is interpreted as an uint32_t type. - \return Masked and shifted bit field value. -*/ -#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) - -/*@} end of group CMSIS_core_bitfield */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_core_base Core Definitions - \brief Definitions for base addresses, unions, and structures. - @{ - */ - -/* Memory mapping of Core Hardware */ -#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ -#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ -#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ -#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ - -#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ -#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ -#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ - -#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) - #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ - #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ -#endif - -/*@} */ - - - -/******************************************************************************* - * Hardware Abstraction Layer - Core Function Interface contains: - - Core NVIC Functions - - Core SysTick Functions - - Core Register Access Functions - ******************************************************************************/ -/** - \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference -*/ - - - -/* ########################## NVIC functions #################################### */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_NVICFunctions NVIC Functions - \brief Functions that manage interrupts and exceptions via the NVIC. - @{ - */ - -#ifdef CMSIS_NVIC_VIRTUAL - #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE - #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" - #endif - #include CMSIS_NVIC_VIRTUAL_HEADER_FILE -#else - #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping - #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping - #define NVIC_EnableIRQ __NVIC_EnableIRQ - #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ - #define NVIC_DisableIRQ __NVIC_DisableIRQ - #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ - #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ - #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ -/*#define NVIC_GetActive __NVIC_GetActive not available for Cortex-M0+ */ - #define NVIC_SetPriority __NVIC_SetPriority - #define NVIC_GetPriority __NVIC_GetPriority - #define NVIC_SystemReset __NVIC_SystemReset -#endif /* CMSIS_NVIC_VIRTUAL */ - -#ifdef CMSIS_VECTAB_VIRTUAL - #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE - #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" - #endif - #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE -#else - #define NVIC_SetVector __NVIC_SetVector - #define NVIC_GetVector __NVIC_GetVector -#endif /* (CMSIS_VECTAB_VIRTUAL) */ - -#define NVIC_USER_IRQ_OFFSET 16 - - -/* The following EXC_RETURN values are saved the LR on exception entry */ -#define EXC_RETURN_HANDLER (0xFFFFFFF1UL) /* return to Handler mode, uses MSP after return */ -#define EXC_RETURN_THREAD_MSP (0xFFFFFFF9UL) /* return to Thread mode, uses MSP after return */ -#define EXC_RETURN_THREAD_PSP (0xFFFFFFFDUL) /* return to Thread mode, uses PSP after return */ - - -/* Interrupt Priorities are WORD accessible only under Armv6-M */ -/* The following MACROS handle generation of the register offset and byte masks */ -#define _BIT_SHIFT(IRQn) ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL) -#define _SHP_IDX(IRQn) ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >> 2UL) ) -#define _IP_IDX(IRQn) ( (((uint32_t)(int32_t)(IRQn)) >> 2UL) ) - -#define __NVIC_SetPriorityGrouping(X) (void)(X) -#define __NVIC_GetPriorityGrouping() (0U) - -/** - \brief Enable Interrupt - \details Enables a device specific interrupt in the NVIC interrupt controller. - \param [in] IRQn Device specific interrupt number. - \note IRQn must not be negative. - */ -__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - __COMPILER_BARRIER(); - NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); - __COMPILER_BARRIER(); - } -} - - -/** - \brief Get Interrupt Enable status - \details Returns a device specific interrupt enable status from the NVIC interrupt controller. - \param [in] IRQn Device specific interrupt number. - \return 0 Interrupt is not enabled. - \return 1 Interrupt is enabled. - \note IRQn must not be negative. - */ -__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - return((uint32_t)(((NVIC->ISER[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); - } - else - { - return(0U); - } -} - - -/** - \brief Disable Interrupt - \details Disables a device specific interrupt in the NVIC interrupt controller. - \param [in] IRQn Device specific interrupt number. - \note IRQn must not be negative. - */ -__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); - __DSB(); - __ISB(); - } -} - - -/** - \brief Get Pending Interrupt - \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. - \param [in] IRQn Device specific interrupt number. - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - \note IRQn must not be negative. - */ -__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - return((uint32_t)(((NVIC->ISPR[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); - } - else - { - return(0U); - } -} - - -/** - \brief Set Pending Interrupt - \details Sets the pending bit of a device specific interrupt in the NVIC pending register. - \param [in] IRQn Device specific interrupt number. - \note IRQn must not be negative. - */ -__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - NVIC->ISPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); - } -} - - -/** - \brief Clear Pending Interrupt - \details Clears the pending bit of a device specific interrupt in the NVIC pending register. - \param [in] IRQn Device specific interrupt number. - \note IRQn must not be negative. - */ -__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - NVIC->ICPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); - } -} - - -/** - \brief Set Interrupt Priority - \details Sets the priority of a device specific interrupt or a processor exception. - The interrupt number can be positive to specify a device specific interrupt, - or negative to specify a processor exception. - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - \note The priority cannot be set for every processor exception. - */ -__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if ((int32_t)(IRQn) >= 0) - { - NVIC->IP[_IP_IDX(IRQn)] = ((uint32_t)(NVIC->IP[_IP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | - (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); - } - else - { - SCB->SHP[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHP[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | - (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); - } -} - - -/** - \brief Get Interrupt Priority - \details Reads the priority of a device specific interrupt or a processor exception. - The interrupt number can be positive to specify a device specific interrupt, - or negative to specify a processor exception. - \param [in] IRQn Interrupt number. - \return Interrupt Priority. - Value is aligned automatically to the implemented priority bits of the microcontroller. - */ -__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) -{ - - if ((int32_t)(IRQn) >= 0) - { - return((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return((uint32_t)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); - } -} - - -/** - \brief Encode Priority - \details Encodes the priority for an interrupt with the given priority group, - preemptive priority value, and subpriority value. - In case of a conflict between priority grouping and available - priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. - \param [in] PriorityGroup Used priority group. - \param [in] PreemptPriority Preemptive priority value (starting from 0). - \param [in] SubPriority Subpriority value (starting from 0). - \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). - */ -__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) -{ - uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ - uint32_t PreemptPriorityBits; - uint32_t SubPriorityBits; - - PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); - SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); - - return ( - ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | - ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) - ); -} - - -/** - \brief Decode Priority - \details Decodes an interrupt priority value with a given priority group to - preemptive priority value and subpriority value. - In case of a conflict between priority grouping and available - priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. - \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). - \param [in] PriorityGroup Used priority group. - \param [out] pPreemptPriority Preemptive priority value (starting from 0). - \param [out] pSubPriority Subpriority value (starting from 0). - */ -__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) -{ - uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ - uint32_t PreemptPriorityBits; - uint32_t SubPriorityBits; - - PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); - SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); - - *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); - *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); -} - - -/** - \brief Set Interrupt Vector - \details Sets an interrupt vector in SRAM based interrupt vector table. - The interrupt number can be positive to specify a device specific interrupt, - or negative to specify a processor exception. - VTOR must been relocated to SRAM before. - If VTOR is not present address 0 must be mapped to SRAM. - \param [in] IRQn Interrupt number - \param [in] vector Address of interrupt handler function - */ -__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) -{ -#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U) - uint32_t *vectors = (uint32_t *)SCB->VTOR; - vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector; -#else - uint32_t *vectors = (uint32_t *)(NVIC_USER_IRQ_OFFSET << 2); /* point to 1st user interrupt */ - *(vectors + (int32_t)IRQn) = vector; /* use pointer arithmetic to access vector */ -#endif - /* ARM Application Note 321 states that the M0+ does not require the architectural barrier */ -} - - -/** - \brief Get Interrupt Vector - \details Reads an interrupt vector from interrupt vector table. - The interrupt number can be positive to specify a device specific interrupt, - or negative to specify a processor exception. - \param [in] IRQn Interrupt number. - \return Address of interrupt handler function - */ -__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) -{ -#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U) - uint32_t *vectors = (uint32_t *)SCB->VTOR; - return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET]; -#else - uint32_t *vectors = (uint32_t *)(NVIC_USER_IRQ_OFFSET << 2); /* point to 1st user interrupt */ - return *(vectors + (int32_t)IRQn); /* use pointer arithmetic to access vector */ -#endif -} - - -/** - \brief System Reset - \details Initiates a system reset request to reset the MCU. - */ -__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) -{ - __DSB(); /* Ensure all outstanding memory accesses included - buffered write are completed before reset */ - SCB->AIRCR = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | - SCB_AIRCR_SYSRESETREQ_Msk); - __DSB(); /* Ensure completion of memory access */ - - for(;;) /* wait until reset */ - { - __NOP(); - } -} - -/*@} end of CMSIS_Core_NVICFunctions */ - -/* ########################## MPU functions #################################### */ - -#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) - -#include "mpu_armv7.h" - -#endif - -/* ########################## FPU functions #################################### */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_FpuFunctions FPU Functions - \brief Function that provides FPU type. - @{ - */ - -/** - \brief get FPU type - \details returns the FPU type - \returns - - \b 0: No FPU - - \b 1: Single precision FPU - - \b 2: Double + Single precision FPU - */ -__STATIC_INLINE uint32_t SCB_GetFPUType(void) -{ - return 0U; /* No FPU */ -} - - -/*@} end of CMSIS_Core_FpuFunctions */ - - - -/* ################################## SysTick function ############################################ */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SysTickFunctions SysTick Functions - \brief Functions that configure the System. - @{ - */ - -#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) - -/** - \brief System Tick Configuration - \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. - Counter is in free running mode to generate periodic interrupts. - \param [in] ticks Number of ticks between two interrupts. - \return 0 Function succeeded. - \return 1 Function failed. - \note When the variable __Vendor_SysTickConfig is set to 1, then the - function SysTick_Config is not included. In this case, the file device.h - must contain a vendor-specific implementation of this function. - */ -__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) -{ - if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) - { - return (1UL); /* Reload value impossible */ - } - - SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ - NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ - SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ - SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | - SysTick_CTRL_TICKINT_Msk | - SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ - return (0UL); /* Function successful */ -} - -#endif - -/*@} end of CMSIS_Core_SysTickFunctions */ - - - - -#ifdef __cplusplus -} -#endif - -#endif /* __CORE_CM0PLUS_H_DEPENDANT */ - -#endif /* __CMSIS_GENERIC */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/CMSIS/Core/Include/mpu_armv7.h b/bsp/nxp/mcx/mcxc/Libraries/CMSIS/Core/Include/mpu_armv7.h deleted file mode 100644 index 9909f83990b..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/CMSIS/Core/Include/mpu_armv7.h +++ /dev/null @@ -1,275 +0,0 @@ -/****************************************************************************** - * @file mpu_armv7.h - * @brief CMSIS MPU API for Armv7-M MPU - * @version V5.1.2 - * @date 25. May 2020 - ******************************************************************************/ -/* - * Copyright (c) 2017-2020 Arm Limited. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined (__clang__) - #pragma clang system_header /* treat file as system include file */ -#endif - -#ifndef ARM_MPU_ARMV7_H -#define ARM_MPU_ARMV7_H - -#define ARM_MPU_REGION_SIZE_32B ((uint8_t)0x04U) ///!< MPU Region Size 32 Bytes -#define ARM_MPU_REGION_SIZE_64B ((uint8_t)0x05U) ///!< MPU Region Size 64 Bytes -#define ARM_MPU_REGION_SIZE_128B ((uint8_t)0x06U) ///!< MPU Region Size 128 Bytes -#define ARM_MPU_REGION_SIZE_256B ((uint8_t)0x07U) ///!< MPU Region Size 256 Bytes -#define ARM_MPU_REGION_SIZE_512B ((uint8_t)0x08U) ///!< MPU Region Size 512 Bytes -#define ARM_MPU_REGION_SIZE_1KB ((uint8_t)0x09U) ///!< MPU Region Size 1 KByte -#define ARM_MPU_REGION_SIZE_2KB ((uint8_t)0x0AU) ///!< MPU Region Size 2 KBytes -#define ARM_MPU_REGION_SIZE_4KB ((uint8_t)0x0BU) ///!< MPU Region Size 4 KBytes -#define ARM_MPU_REGION_SIZE_8KB ((uint8_t)0x0CU) ///!< MPU Region Size 8 KBytes -#define ARM_MPU_REGION_SIZE_16KB ((uint8_t)0x0DU) ///!< MPU Region Size 16 KBytes -#define ARM_MPU_REGION_SIZE_32KB ((uint8_t)0x0EU) ///!< MPU Region Size 32 KBytes -#define ARM_MPU_REGION_SIZE_64KB ((uint8_t)0x0FU) ///!< MPU Region Size 64 KBytes -#define ARM_MPU_REGION_SIZE_128KB ((uint8_t)0x10U) ///!< MPU Region Size 128 KBytes -#define ARM_MPU_REGION_SIZE_256KB ((uint8_t)0x11U) ///!< MPU Region Size 256 KBytes -#define ARM_MPU_REGION_SIZE_512KB ((uint8_t)0x12U) ///!< MPU Region Size 512 KBytes -#define ARM_MPU_REGION_SIZE_1MB ((uint8_t)0x13U) ///!< MPU Region Size 1 MByte -#define ARM_MPU_REGION_SIZE_2MB ((uint8_t)0x14U) ///!< MPU Region Size 2 MBytes -#define ARM_MPU_REGION_SIZE_4MB ((uint8_t)0x15U) ///!< MPU Region Size 4 MBytes -#define ARM_MPU_REGION_SIZE_8MB ((uint8_t)0x16U) ///!< MPU Region Size 8 MBytes -#define ARM_MPU_REGION_SIZE_16MB ((uint8_t)0x17U) ///!< MPU Region Size 16 MBytes -#define ARM_MPU_REGION_SIZE_32MB ((uint8_t)0x18U) ///!< MPU Region Size 32 MBytes -#define ARM_MPU_REGION_SIZE_64MB ((uint8_t)0x19U) ///!< MPU Region Size 64 MBytes -#define ARM_MPU_REGION_SIZE_128MB ((uint8_t)0x1AU) ///!< MPU Region Size 128 MBytes -#define ARM_MPU_REGION_SIZE_256MB ((uint8_t)0x1BU) ///!< MPU Region Size 256 MBytes -#define ARM_MPU_REGION_SIZE_512MB ((uint8_t)0x1CU) ///!< MPU Region Size 512 MBytes -#define ARM_MPU_REGION_SIZE_1GB ((uint8_t)0x1DU) ///!< MPU Region Size 1 GByte -#define ARM_MPU_REGION_SIZE_2GB ((uint8_t)0x1EU) ///!< MPU Region Size 2 GBytes -#define ARM_MPU_REGION_SIZE_4GB ((uint8_t)0x1FU) ///!< MPU Region Size 4 GBytes - -#define ARM_MPU_AP_NONE 0U ///!< MPU Access Permission no access -#define ARM_MPU_AP_PRIV 1U ///!< MPU Access Permission privileged access only -#define ARM_MPU_AP_URO 2U ///!< MPU Access Permission unprivileged access read-only -#define ARM_MPU_AP_FULL 3U ///!< MPU Access Permission full access -#define ARM_MPU_AP_PRO 5U ///!< MPU Access Permission privileged access read-only -#define ARM_MPU_AP_RO 6U ///!< MPU Access Permission read-only access - -/** MPU Region Base Address Register Value -* -* \param Region The region to be configured, number 0 to 15. -* \param BaseAddress The base address for the region. -*/ -#define ARM_MPU_RBAR(Region, BaseAddress) \ - (((BaseAddress) & MPU_RBAR_ADDR_Msk) | \ - ((Region) & MPU_RBAR_REGION_Msk) | \ - (MPU_RBAR_VALID_Msk)) - -/** -* MPU Memory Access Attributes -* -* \param TypeExtField Type extension field, allows you to configure memory access type, for example strongly ordered, peripheral. -* \param IsShareable Region is shareable between multiple bus masters. -* \param IsCacheable Region is cacheable, i.e. its value may be kept in cache. -* \param IsBufferable Region is bufferable, i.e. using write-back caching. Cacheable but non-bufferable regions use write-through policy. -*/ -#define ARM_MPU_ACCESS_(TypeExtField, IsShareable, IsCacheable, IsBufferable) \ - ((((TypeExtField) << MPU_RASR_TEX_Pos) & MPU_RASR_TEX_Msk) | \ - (((IsShareable) << MPU_RASR_S_Pos) & MPU_RASR_S_Msk) | \ - (((IsCacheable) << MPU_RASR_C_Pos) & MPU_RASR_C_Msk) | \ - (((IsBufferable) << MPU_RASR_B_Pos) & MPU_RASR_B_Msk)) - -/** -* MPU Region Attribute and Size Register Value -* -* \param DisableExec Instruction access disable bit, 1= disable instruction fetches. -* \param AccessPermission Data access permissions, allows you to configure read/write access for User and Privileged mode. -* \param AccessAttributes Memory access attribution, see \ref ARM_MPU_ACCESS_. -* \param SubRegionDisable Sub-region disable field. -* \param Size Region size of the region to be configured, for example 4K, 8K. -*/ -#define ARM_MPU_RASR_EX(DisableExec, AccessPermission, AccessAttributes, SubRegionDisable, Size) \ - ((((DisableExec) << MPU_RASR_XN_Pos) & MPU_RASR_XN_Msk) | \ - (((AccessPermission) << MPU_RASR_AP_Pos) & MPU_RASR_AP_Msk) | \ - (((AccessAttributes) & (MPU_RASR_TEX_Msk | MPU_RASR_S_Msk | MPU_RASR_C_Msk | MPU_RASR_B_Msk))) | \ - (((SubRegionDisable) << MPU_RASR_SRD_Pos) & MPU_RASR_SRD_Msk) | \ - (((Size) << MPU_RASR_SIZE_Pos) & MPU_RASR_SIZE_Msk) | \ - (((MPU_RASR_ENABLE_Msk)))) - -/** -* MPU Region Attribute and Size Register Value -* -* \param DisableExec Instruction access disable bit, 1= disable instruction fetches. -* \param AccessPermission Data access permissions, allows you to configure read/write access for User and Privileged mode. -* \param TypeExtField Type extension field, allows you to configure memory access type, for example strongly ordered, peripheral. -* \param IsShareable Region is shareable between multiple bus masters. -* \param IsCacheable Region is cacheable, i.e. its value may be kept in cache. -* \param IsBufferable Region is bufferable, i.e. using write-back caching. Cacheable but non-bufferable regions use write-through policy. -* \param SubRegionDisable Sub-region disable field. -* \param Size Region size of the region to be configured, for example 4K, 8K. -*/ -#define ARM_MPU_RASR(DisableExec, AccessPermission, TypeExtField, IsShareable, IsCacheable, IsBufferable, SubRegionDisable, Size) \ - ARM_MPU_RASR_EX(DisableExec, AccessPermission, ARM_MPU_ACCESS_(TypeExtField, IsShareable, IsCacheable, IsBufferable), SubRegionDisable, Size) - -/** -* MPU Memory Access Attribute for strongly ordered memory. -* - TEX: 000b -* - Shareable -* - Non-cacheable -* - Non-bufferable -*/ -#define ARM_MPU_ACCESS_ORDERED ARM_MPU_ACCESS_(0U, 1U, 0U, 0U) - -/** -* MPU Memory Access Attribute for device memory. -* - TEX: 000b (if shareable) or 010b (if non-shareable) -* - Shareable or non-shareable -* - Non-cacheable -* - Bufferable (if shareable) or non-bufferable (if non-shareable) -* -* \param IsShareable Configures the device memory as shareable or non-shareable. -*/ -#define ARM_MPU_ACCESS_DEVICE(IsShareable) ((IsShareable) ? ARM_MPU_ACCESS_(0U, 1U, 0U, 1U) : ARM_MPU_ACCESS_(2U, 0U, 0U, 0U)) - -/** -* MPU Memory Access Attribute for normal memory. -* - TEX: 1BBb (reflecting outer cacheability rules) -* - Shareable or non-shareable -* - Cacheable or non-cacheable (reflecting inner cacheability rules) -* - Bufferable or non-bufferable (reflecting inner cacheability rules) -* -* \param OuterCp Configures the outer cache policy. -* \param InnerCp Configures the inner cache policy. -* \param IsShareable Configures the memory as shareable or non-shareable. -*/ -#define ARM_MPU_ACCESS_NORMAL(OuterCp, InnerCp, IsShareable) ARM_MPU_ACCESS_((4U | (OuterCp)), IsShareable, ((InnerCp) >> 1U), ((InnerCp) & 1U)) - -/** -* MPU Memory Access Attribute non-cacheable policy. -*/ -#define ARM_MPU_CACHEP_NOCACHE 0U - -/** -* MPU Memory Access Attribute write-back, write and read allocate policy. -*/ -#define ARM_MPU_CACHEP_WB_WRA 1U - -/** -* MPU Memory Access Attribute write-through, no write allocate policy. -*/ -#define ARM_MPU_CACHEP_WT_NWA 2U - -/** -* MPU Memory Access Attribute write-back, no write allocate policy. -*/ -#define ARM_MPU_CACHEP_WB_NWA 3U - - -/** -* Struct for a single MPU Region -*/ -typedef struct { - uint32_t RBAR; //!< The region base address register value (RBAR) - uint32_t RASR; //!< The region attribute and size register value (RASR) \ref MPU_RASR -} ARM_MPU_Region_t; - -/** Enable the MPU. -* \param MPU_Control Default access permissions for unconfigured regions. -*/ -__STATIC_INLINE void ARM_MPU_Enable(uint32_t MPU_Control) -{ - __DMB(); - MPU->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk; -#ifdef SCB_SHCSR_MEMFAULTENA_Msk - SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk; -#endif - __DSB(); - __ISB(); -} - -/** Disable the MPU. -*/ -__STATIC_INLINE void ARM_MPU_Disable(void) -{ - __DMB(); -#ifdef SCB_SHCSR_MEMFAULTENA_Msk - SCB->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk; -#endif - MPU->CTRL &= ~MPU_CTRL_ENABLE_Msk; - __DSB(); - __ISB(); -} - -/** Clear and disable the given MPU region. -* \param rnr Region number to be cleared. -*/ -__STATIC_INLINE void ARM_MPU_ClrRegion(uint32_t rnr) -{ - MPU->RNR = rnr; - MPU->RASR = 0U; -} - -/** Configure an MPU region. -* \param rbar Value for RBAR register. -* \param rasr Value for RASR register. -*/ -__STATIC_INLINE void ARM_MPU_SetRegion(uint32_t rbar, uint32_t rasr) -{ - MPU->RBAR = rbar; - MPU->RASR = rasr; -} - -/** Configure the given MPU region. -* \param rnr Region number to be configured. -* \param rbar Value for RBAR register. -* \param rasr Value for RASR register. -*/ -__STATIC_INLINE void ARM_MPU_SetRegionEx(uint32_t rnr, uint32_t rbar, uint32_t rasr) -{ - MPU->RNR = rnr; - MPU->RBAR = rbar; - MPU->RASR = rasr; -} - -/** Memcpy with strictly ordered memory access, e.g. used by code in ARM_MPU_Load(). -* \param dst Destination data is copied to. -* \param src Source data is copied from. -* \param len Amount of data words to be copied. -*/ -__STATIC_INLINE void ARM_MPU_OrderedMemcpy(volatile uint32_t* dst, const uint32_t* __RESTRICT src, uint32_t len) -{ - uint32_t i; - for (i = 0U; i < len; ++i) - { - dst[i] = src[i]; - } -} - -/** Load the given number of MPU regions from a table. -* \param table Pointer to the MPU configuration table. -* \param cnt Amount of regions to be configured. -*/ -__STATIC_INLINE void ARM_MPU_Load(ARM_MPU_Region_t const* table, uint32_t cnt) -{ - const uint32_t rowWordSize = sizeof(ARM_MPU_Region_t)/4U; - while (cnt > MPU_TYPE_RALIASES) { - ARM_MPU_OrderedMemcpy(&(MPU->RBAR), &(table->RBAR), MPU_TYPE_RALIASES*rowWordSize); - table += MPU_TYPE_RALIASES; - cnt -= MPU_TYPE_RALIASES; - } - ARM_MPU_OrderedMemcpy(&(MPU->RBAR), &(table->RBAR), cnt*rowWordSize); -} - -#endif diff --git a/bsp/nxp/mcx/mcxc/Libraries/CMSIS/LICENSE.txt b/bsp/nxp/mcx/mcxc/Libraries/CMSIS/LICENSE.txt deleted file mode 100644 index 8dada3edaf5..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/CMSIS/LICENSE.txt +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - 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. diff --git a/bsp/nxp/mcx/mcxc/Libraries/Kconfig b/bsp/nxp/mcx/mcxc/Libraries/Kconfig index 054b8e7fc60..0230c5b3358 100644 --- a/bsp/nxp/mcx/mcxc/Libraries/Kconfig +++ b/bsp/nxp/mcx/mcxc/Libraries/Kconfig @@ -1,3 +1,5 @@ config SOC_MCX bool select ARCH_ARM_CORTEX_M0 + select PKG_USING_NXP_MCX_CMSIS_DRIVER + select PKG_USING_NXP_MCX_SERIES_DRIVER diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/MCXC444.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/MCXC444.h deleted file mode 100644 index a8aa9a3d827..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/MCXC444.h +++ /dev/null @@ -1,16556 +0,0 @@ -/* -** ################################################################### -** Processors: MCXC444VLH -** MCXC444VMP -** -** Compilers: Freescale C/C++ for Embedded ARM -** GNU C Compiler -** IAR ANSI C/C++ Compiler for ARM -** Keil ARM C/C++ Compiler -** MCUXpresso Compiler -** -** Reference manual: MCXC444RM, Rev.1, Mar 2024 -** Version: rev. 1.0, 2024-03-11 -** Build: b240401 -** -** Abstract: -** CMSIS Peripheral Access Layer for MCXC444 -** -** Copyright 1997-2016 Freescale Semiconductor, Inc. -** Copyright 2016-2024 NXP -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** Revisions: -** - rev. 1.0 (2024-03-11) -** Initial version. -** -** ################################################################### -*/ - -/*! - * @file MCXC444.h - * @version 1.0 - * @date 2024-03-11 - * @brief CMSIS Peripheral Access Layer for MCXC444 - * - * CMSIS Peripheral Access Layer for MCXC444 - */ - -#if !defined(MCXC444_H_) -#define MCXC444_H_ /**< Symbol preventing repeated inclusion */ - -/** Memory map major version (memory maps with equal major version number are - * compatible) */ -#define MCU_MEM_MAP_VERSION 0x0100U -/** Memory map minor version */ -#define MCU_MEM_MAP_VERSION_MINOR 0x0000U - - -/* ---------------------------------------------------------------------------- - -- Interrupt vector numbers - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup Interrupt_vector_numbers Interrupt vector numbers - * @{ - */ - -/** Interrupt Number Definitions */ -#define NUMBER_OF_INT_VECTORS 48 /**< Number of interrupts in the Vector table */ - -typedef enum IRQn { - /* Auxiliary constants */ - NotAvail_IRQn = -128, /**< Not available device specific interrupt */ - - /* Core interrupts */ - NonMaskableInt_IRQn = -14, /**< Non Maskable Interrupt */ - HardFault_IRQn = -13, /**< Cortex-M0 SV Hard Fault Interrupt */ - SVCall_IRQn = -5, /**< Cortex-M0 SV Call Interrupt */ - PendSV_IRQn = -2, /**< Cortex-M0 Pend SV Interrupt */ - SysTick_IRQn = -1, /**< Cortex-M0 System Tick Interrupt */ - - /* Device specific interrupts */ - DMA0_IRQn = 0, /**< DMA channel 0 transfer complete */ - DMA1_IRQn = 1, /**< DMA channel 1 transfer complete */ - DMA2_IRQn = 2, /**< DMA channel 2 transfer complete */ - DMA3_IRQn = 3, /**< DMA channel 3 transfer complete */ - Reserved20_IRQn = 4, /**< Reserved interrupt */ - FTFA_IRQn = 5, /**< Command complete and read collision */ - PMC_IRQn = 6, /**< Low-voltage detect, low-voltage warning */ - LLWU_IRQn = 7, /**< Low leakage wakeup */ - I2C0_IRQn = 8, /**< I2C0 interrupt */ - I2C1_IRQn = 9, /**< I2C1 interrupt */ - SPI0_IRQn = 10, /**< SPI0 single interrupt vector for all sources */ - SPI1_IRQn = 11, /**< SPI1 single interrupt vector for all sources */ - LPUART0_IRQn = 12, /**< LPUART0 status and error */ - LPUART1_IRQn = 13, /**< LPUART1 status and error */ - UART2_FLEXIO_IRQn = 14, /**< UART2 or FLEXIO */ - ADC0_IRQn = 15, /**< ADC0 interrupt */ - CMP0_IRQn = 16, /**< CMP0 interrupt */ - TPM0_IRQn = 17, /**< TPM0 single interrupt vector for all sources */ - TPM1_IRQn = 18, /**< TPM1 single interrupt vector for all sources */ - TPM2_IRQn = 19, /**< TPM2 single interrupt vector for all sources */ - RTC_IRQn = 20, /**< RTC alarm */ - RTC_Seconds_IRQn = 21, /**< RTC seconds */ - PIT_IRQn = 22, /**< PIT interrupt */ - I2S0_IRQn = 23, /**< I2S0 interrupt */ - USB0_IRQn = 24, /**< USB0 interrupt */ - DAC0_IRQn = 25, /**< DAC0 interrupt */ - Reserved42_IRQn = 26, /**< Reserved interrupt */ - Reserved43_IRQn = 27, /**< Reserved interrupt */ - LPTMR0_IRQn = 28, /**< LPTMR0 interrupt */ - LCD_IRQn = 29, /**< LCD interrupt */ - PORTA_IRQn = 30, /**< PORTA Pin detect */ - PORTC_PORTD_IRQn = 31 /**< Single interrupt vector for PORTC; PORTD Pin detect */ -} IRQn_Type; - -/*! - * @} - */ /* end of group Interrupt_vector_numbers */ - - -/* ---------------------------------------------------------------------------- - -- Cortex M0 Core Configuration - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup Cortex_Core_Configuration Cortex M0 Core Configuration - * @{ - */ - -#define __CM0PLUS_REV 0x0000 /**< Core revision r0p0 */ -#define __MPU_PRESENT 0 /**< Defines if an MPU is present or not */ -#define __VTOR_PRESENT 1 /**< Defines if VTOR is present or not */ -#define __NVIC_PRIO_BITS 2 /**< Number of priority bits implemented in the NVIC */ -#define __Vendor_SysTickConfig 0 /**< Vendor specific implementation of SysTickConfig is defined */ - -#include "core_cm0plus.h" /* Core Peripheral Access Layer */ -#include "system_MCXC444.h" /* Device specific configuration file */ - -/*! - * @} - */ /* end of group Cortex_Core_Configuration */ - - -/* ---------------------------------------------------------------------------- - -- Mapping Information - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup Mapping_Information Mapping Information - * @{ - */ - -/** Mapping Information */ -/*! - * @addtogroup edma_request - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @brief Structure for the DMA hardware request - * - * Defines the structure for the DMA hardware request collections. The user can configure the - * hardware request into DMAMUX to trigger the DMA transfer accordingly. The index - * of the hardware request varies according to the to SoC. - */ -typedef enum _dma_request_source -{ - kDmaRequestMux0Disable = 0|0x100U, /**< DMAMUX TriggerDisabled */ - kDmaRequestMux0Reserved1 = 1|0x100U, /**< Reserved1 */ - kDmaRequestMux0LPUART0Rx = 2|0x100U, /**< LPUART0 Receive */ - kDmaRequestMux0LPUART0Tx = 3|0x100U, /**< LPUART0 Transmit */ - kDmaRequestMux0LPUART1Rx = 4|0x100U, /**< LPUART1 Receive */ - kDmaRequestMux0LPUART1Tx = 5|0x100U, /**< LPUART1 Transmit */ - kDmaRequestMux0UART2Rx = 6|0x100U, /**< UART2 Receive */ - kDmaRequestMux0UART2Tx = 7|0x100U, /**< UART2 Transmit */ - kDmaRequestMux0Reserved8 = 8|0x100U, /**< Reserved8 */ - kDmaRequestMux0Reserved9 = 9|0x100U, /**< Reserved9 */ - kDmaRequestMux0FlexIOChannel0 = 10|0x100U, /**< FlexIO Channel 0 */ - kDmaRequestMux0FlexIOChannel1 = 11|0x100U, /**< FlexIO Channel 1 */ - kDmaRequestMux0FlexIOChannel2 = 12|0x100U, /**< FlexIO Channel 2 */ - kDmaRequestMux0FlexIOChannel3 = 13|0x100U, /**< FlexIO Channel 3 */ - kDmaRequestMux0I2S0Rx = 14|0x100U, /**< I2S0 Receive */ - kDmaRequestMux0I2S0Tx = 15|0x100U, /**< I2S0 Transmit */ - kDmaRequestMux0SPI0Rx = 16|0x100U, /**< SPI0 Receive */ - kDmaRequestMux0SPI0Tx = 17|0x100U, /**< SPI0 Transmit */ - kDmaRequestMux0SPI1Rx = 18|0x100U, /**< SPI1 Receive */ - kDmaRequestMux0SPI1Tx = 19|0x100U, /**< SPI1 Transmit */ - kDmaRequestMux0Reserved20 = 20|0x100U, /**< Reserved20 */ - kDmaRequestMux0Reserved21 = 21|0x100U, /**< Reserved21 */ - kDmaRequestMux0I2C0 = 22|0x100U, /**< I2C0 */ - kDmaRequestMux0I2C1 = 23|0x100U, /**< I2C1 */ - kDmaRequestMux0TPM0Channel0 = 24|0x100U, /**< TPM0 channel 0 */ - kDmaRequestMux0TPM0Channel1 = 25|0x100U, /**< TPM0 channel 1 */ - kDmaRequestMux0TPM0Channel2 = 26|0x100U, /**< TPM0 channel 2 */ - kDmaRequestMux0TPM0Channel3 = 27|0x100U, /**< TPM0 channel 3 */ - kDmaRequestMux0TPM0Channel4 = 28|0x100U, /**< TPM0 channel 4 */ - kDmaRequestMux0TPM0Channel5 = 29|0x100U, /**< TPM0 channel 5 */ - kDmaRequestMux0Reserved30 = 30|0x100U, /**< Reserved30 */ - kDmaRequestMux0Reserved31 = 31|0x100U, /**< Reserved31 */ - kDmaRequestMux0TPM1Channel0 = 32|0x100U, /**< TPM1 channel 0 */ - kDmaRequestMux0TPM1Channel1 = 33|0x100U, /**< TPM1 channel 1 */ - kDmaRequestMux0TPM2Channel0 = 34|0x100U, /**< TPM2 channel 0 */ - kDmaRequestMux0TPM2Channel1 = 35|0x100U, /**< TPM2 channel 1 */ - kDmaRequestMux0Reserved36 = 36|0x100U, /**< Reserved36 */ - kDmaRequestMux0Reserved37 = 37|0x100U, /**< Reserved37 */ - kDmaRequestMux0Reserved38 = 38|0x100U, /**< Reserved38 */ - kDmaRequestMux0Reserved39 = 39|0x100U, /**< Reserved39 */ - kDmaRequestMux0ADC0 = 40|0x100U, /**< ADC0 */ - kDmaRequestMux0Reserved41 = 41|0x100U, /**< Reserved41 */ - kDmaRequestMux0CMP0 = 42|0x100U, /**< CMP0 */ - kDmaRequestMux0Reserved43 = 43|0x100U, /**< Reserved43 */ - kDmaRequestMux0Reserved44 = 44|0x100U, /**< Reserved44 */ - kDmaRequestMux0DAC0 = 45|0x100U, /**< DAC0 */ - kDmaRequestMux0Reserved46 = 46|0x100U, /**< Reserved46 */ - kDmaRequestMux0Reserved47 = 47|0x100U, /**< Reserved47 */ - kDmaRequestMux0Reserved48 = 48|0x100U, /**< Reserved48 */ - kDmaRequestMux0PortA = 49|0x100U, /**< GPIO Port A */ - kDmaRequestMux0Reserved50 = 50|0x100U, /**< Reserved50 */ - kDmaRequestMux0PortC = 51|0x100U, /**< GPIO Port C */ - kDmaRequestMux0PortD = 52|0x100U, /**< GPIO Port D */ - kDmaRequestMux0Reserved53 = 53|0x100U, /**< Reserved53 */ - kDmaRequestMux0TPM0Overflow = 54|0x100U, /**< TPM0 overflow */ - kDmaRequestMux0TPM1Overflow = 55|0x100U, /**< TPM1 overflow */ - kDmaRequestMux0TPM2Overflow = 56|0x100U, /**< TPM2 overflow */ - kDmaRequestMux0Reserved57 = 57|0x100U, /**< Reserved57 */ - kDmaRequestMux0Reserved58 = 58|0x100U, /**< Reserved58 */ - kDmaRequestMux0Reserved59 = 59|0x100U, /**< Reserved59 */ - kDmaRequestMux0AlwaysOn60 = 60|0x100U, /**< DMAMUX Always Enabled slot */ - kDmaRequestMux0AlwaysOn61 = 61|0x100U, /**< DMAMUX Always Enabled slot */ - kDmaRequestMux0AlwaysOn62 = 62|0x100U, /**< DMAMUX Always Enabled slot */ - kDmaRequestMux0AlwaysOn63 = 63|0x100U, /**< DMAMUX Always Enabled slot */ -} dma_request_source_t; - -/* @} */ - - -/*! - * @} - */ /* end of group Mapping_Information */ - - -/* ---------------------------------------------------------------------------- - -- Device Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup Peripheral_access_layer Device Peripheral Access Layer - * @{ - */ - - -/* -** Start of section using anonymous unions -*/ - -#if defined(__ARMCC_VERSION) - #if (__ARMCC_VERSION >= 6010050) - #pragma clang diagnostic push - #else - #pragma push - #pragma anon_unions - #endif -#elif defined(__CWCC__) - #pragma push - #pragma cpp_extensions on -#elif defined(__GNUC__) - /* anonymous unions are enabled by default */ -#elif defined(__IAR_SYSTEMS_ICC__) - #pragma language=extended -#else - #error Not supported compiler type -#endif - -/* ---------------------------------------------------------------------------- - -- ADC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ADC_Peripheral_Access_Layer ADC Peripheral Access Layer - * @{ - */ - -/** ADC - Register Layout Typedef */ -typedef struct { - __IO uint32_t SC1[2]; /**< ADC Status and Control Registers 1, array offset: 0x0, array step: 0x4 */ - __IO uint32_t CFG1; /**< ADC Configuration Register 1, offset: 0x8 */ - __IO uint32_t CFG2; /**< ADC Configuration Register 2, offset: 0xC */ - __I uint32_t R[2]; /**< ADC Data Result Register, array offset: 0x10, array step: 0x4 */ - __IO uint32_t CV1; /**< Compare Value Registers, offset: 0x18 */ - __IO uint32_t CV2; /**< Compare Value Registers, offset: 0x1C */ - __IO uint32_t SC2; /**< Status and Control Register 2, offset: 0x20 */ - __IO uint32_t SC3; /**< Status and Control Register 3, offset: 0x24 */ - __IO uint32_t OFS; /**< ADC Offset Correction Register, offset: 0x28 */ - __IO uint32_t PG; /**< ADC Plus-Side Gain Register, offset: 0x2C */ - __IO uint32_t MG; /**< ADC Minus-Side Gain Register, offset: 0x30 */ - __IO uint32_t CLPD; /**< ADC Plus-Side General Calibration Value Register, offset: 0x34 */ - __IO uint32_t CLPS; /**< ADC Plus-Side General Calibration Value Register, offset: 0x38 */ - __IO uint32_t CLP4; /**< ADC Plus-Side General Calibration Value Register, offset: 0x3C */ - __IO uint32_t CLP3; /**< ADC Plus-Side General Calibration Value Register, offset: 0x40 */ - __IO uint32_t CLP2; /**< ADC Plus-Side General Calibration Value Register, offset: 0x44 */ - __IO uint32_t CLP1; /**< ADC Plus-Side General Calibration Value Register, offset: 0x48 */ - __IO uint32_t CLP0; /**< ADC Plus-Side General Calibration Value Register, offset: 0x4C */ - uint8_t RESERVED_0[4]; - __IO uint32_t CLMD; /**< ADC Minus-Side General Calibration Value Register, offset: 0x54 */ - __IO uint32_t CLMS; /**< ADC Minus-Side General Calibration Value Register, offset: 0x58 */ - __IO uint32_t CLM4; /**< ADC Minus-Side General Calibration Value Register, offset: 0x5C */ - __IO uint32_t CLM3; /**< ADC Minus-Side General Calibration Value Register, offset: 0x60 */ - __IO uint32_t CLM2; /**< ADC Minus-Side General Calibration Value Register, offset: 0x64 */ - __IO uint32_t CLM1; /**< ADC Minus-Side General Calibration Value Register, offset: 0x68 */ - __IO uint32_t CLM0; /**< ADC Minus-Side General Calibration Value Register, offset: 0x6C */ -} ADC_Type; - -/* ---------------------------------------------------------------------------- - -- ADC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ADC_Register_Masks ADC Register Masks - * @{ - */ - -/*! @name SC1 - ADC Status and Control Registers 1 */ -/*! @{ */ - -#define ADC_SC1_ADCH_MASK (0x1FU) -#define ADC_SC1_ADCH_SHIFT (0U) -/*! ADCH - Input channel select - * 0b00000..When DIFF=0, DADP0 is selected as input; when DIFF=1, DAD0 is selected as input. - * 0b00001..When DIFF=0, DADP1 is selected as input; when DIFF=1, DAD1 is selected as input. - * 0b00010..When DIFF=0, DADP2 is selected as input; when DIFF=1, DAD2 is selected as input. - * 0b00011..When DIFF=0, DADP3 is selected as input; when DIFF=1, DAD3 is selected as input. - * 0b00100..When DIFF=0, AD4 is selected as input; when DIFF=1, it is reserved. - * 0b00101..When DIFF=0, AD5 is selected as input; when DIFF=1, it is reserved. - * 0b00110..When DIFF=0, AD6 is selected as input; when DIFF=1, it is reserved. - * 0b00111..When DIFF=0, AD7 is selected as input; when DIFF=1, it is reserved. - * 0b01000..When DIFF=0, AD8 is selected as input; when DIFF=1, it is reserved. - * 0b01001..When DIFF=0, AD9 is selected as input; when DIFF=1, it is reserved. - * 0b01010..When DIFF=0, AD10 is selected as input; when DIFF=1, it is reserved. - * 0b01011..When DIFF=0, AD11 is selected as input; when DIFF=1, it is reserved. - * 0b01100..When DIFF=0, AD12 is selected as input; when DIFF=1, it is reserved. - * 0b01101..When DIFF=0, AD13 is selected as input; when DIFF=1, it is reserved. - * 0b01110..When DIFF=0, AD14 is selected as input; when DIFF=1, it is reserved. - * 0b01111..When DIFF=0, AD15 is selected as input; when DIFF=1, it is reserved. - * 0b10000..When DIFF=0, AD16 is selected as input; when DIFF=1, it is reserved. - * 0b10001..When DIFF=0, AD17 is selected as input; when DIFF=1, it is reserved. - * 0b10010..When DIFF=0, AD18 is selected as input; when DIFF=1, it is reserved. - * 0b10011..When DIFF=0, AD19 is selected as input; when DIFF=1, it is reserved. - * 0b10100..When DIFF=0, AD20 is selected as input; when DIFF=1, it is reserved. - * 0b10101..When DIFF=0, AD21 is selected as input; when DIFF=1, it is reserved. - * 0b10110..When DIFF=0, AD22 is selected as input; when DIFF=1, it is reserved. - * 0b10111..When DIFF=0, AD23 is selected as input; when DIFF=1, it is reserved. - * 0b11000..Reserved. - * 0b11001..Reserved. - * 0b11010..When DIFF=0, Temp Sensor (single-ended) is selected as input; when DIFF=1, Temp Sensor (differential) is selected as input. - * 0b11011..When DIFF=0, Bandgap (single-ended) is selected as input; when DIFF=1, Bandgap (differential) is selected as input. - * 0b11100..Reserved. - * 0b11101..When DIFF=0,VREFSH is selected as input; when DIFF=1, -VREFSH (differential) is selected as input. - * Voltage reference selected is determined by SC2[REFSEL]. - * 0b11110..When DIFF=0,VREFSL is selected as input; when DIFF=1, it is reserved. Voltage reference selected is determined by SC2[REFSEL]. - * 0b11111..Module is disabled. - */ -#define ADC_SC1_ADCH(x) (((uint32_t)(((uint32_t)(x)) << ADC_SC1_ADCH_SHIFT)) & ADC_SC1_ADCH_MASK) - -#define ADC_SC1_DIFF_MASK (0x20U) -#define ADC_SC1_DIFF_SHIFT (5U) -/*! DIFF - Differential Mode Enable - * 0b0..Single-ended conversions and input channels are selected. - * 0b1..Differential conversions and input channels are selected. - */ -#define ADC_SC1_DIFF(x) (((uint32_t)(((uint32_t)(x)) << ADC_SC1_DIFF_SHIFT)) & ADC_SC1_DIFF_MASK) - -#define ADC_SC1_AIEN_MASK (0x40U) -#define ADC_SC1_AIEN_SHIFT (6U) -/*! AIEN - Interrupt Enable - * 0b0..Conversion complete interrupt is disabled. - * 0b1..Conversion complete interrupt is enabled. - */ -#define ADC_SC1_AIEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_SC1_AIEN_SHIFT)) & ADC_SC1_AIEN_MASK) - -#define ADC_SC1_COCO_MASK (0x80U) -#define ADC_SC1_COCO_SHIFT (7U) -/*! COCO - Conversion Complete Flag - * 0b0..Conversion is not completed. - * 0b1..Conversion is completed. - */ -#define ADC_SC1_COCO(x) (((uint32_t)(((uint32_t)(x)) << ADC_SC1_COCO_SHIFT)) & ADC_SC1_COCO_MASK) -/*! @} */ - -/* The count of ADC_SC1 */ -#define ADC_SC1_COUNT (2U) - -/*! @name CFG1 - ADC Configuration Register 1 */ -/*! @{ */ - -#define ADC_CFG1_ADICLK_MASK (0x3U) -#define ADC_CFG1_ADICLK_SHIFT (0U) -/*! ADICLK - Input Clock Select - * 0b00..Bus clock - * 0b01..Bus clock divided by 2(BUSCLK/DIV2) - * 0b10..Alternate clock (ALTCLK) - * 0b11..Asynchronous clock (ADACK) - */ -#define ADC_CFG1_ADICLK(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG1_ADICLK_SHIFT)) & ADC_CFG1_ADICLK_MASK) - -#define ADC_CFG1_MODE_MASK (0xCU) -#define ADC_CFG1_MODE_SHIFT (2U) -/*! MODE - Conversion mode selection - * 0b00..When DIFF=0:It is single-ended 8-bit conversion; when DIFF=1, it is differential 9-bit conversion with 2's complement output. - * 0b01..When DIFF=0:It is single-ended 12-bit conversion ; when DIFF=1, it is differential 13-bit conversion with 2's complement output. - * 0b10..When DIFF=0:It is single-ended 10-bit conversion. ; when DIFF=1, it is differential 11-bit conversion with 2's complement output - * 0b11..When DIFF=0:It is single-ended 16-bit conversion..; when DIFF=1, it is differential 16-bit conversion with 2's complement output - */ -#define ADC_CFG1_MODE(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG1_MODE_SHIFT)) & ADC_CFG1_MODE_MASK) - -#define ADC_CFG1_ADLSMP_MASK (0x10U) -#define ADC_CFG1_ADLSMP_SHIFT (4U) -/*! ADLSMP - Sample Time Configuration - * 0b0..Short sample time. - * 0b1..Long sample time. - */ -#define ADC_CFG1_ADLSMP(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG1_ADLSMP_SHIFT)) & ADC_CFG1_ADLSMP_MASK) - -#define ADC_CFG1_ADIV_MASK (0x60U) -#define ADC_CFG1_ADIV_SHIFT (5U) -/*! ADIV - Clock Divide Select - * 0b00..The divide ratio is 1 and the clock rate is input clock. - * 0b01..The divide ratio is 2 and the clock rate is (input clock)/2. - * 0b10..The divide ratio is 4 and the clock rate is (input clock)/4. - * 0b11..The divide ratio is 8 and the clock rate is (input clock)/8. - */ -#define ADC_CFG1_ADIV(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG1_ADIV_SHIFT)) & ADC_CFG1_ADIV_MASK) - -#define ADC_CFG1_ADLPC_MASK (0x80U) -#define ADC_CFG1_ADLPC_SHIFT (7U) -/*! ADLPC - Low-Power Configuration - * 0b0..Normal power configuration. - * 0b1..Low-power configuration. The power is reduced at the expense of maximum clock speed. - */ -#define ADC_CFG1_ADLPC(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG1_ADLPC_SHIFT)) & ADC_CFG1_ADLPC_MASK) -/*! @} */ - -/*! @name CFG2 - ADC Configuration Register 2 */ -/*! @{ */ - -#define ADC_CFG2_ADLSTS_MASK (0x3U) -#define ADC_CFG2_ADLSTS_SHIFT (0U) -/*! ADLSTS - Long Sample Time Select - * 0b00..Default longest sample time; 20 extra ADCK cycles; 24 ADCK cycles total. - * 0b01..12 extra ADCK cycles; 16 ADCK cycles total sample time. - * 0b10..6 extra ADCK cycles; 10 ADCK cycles total sample time. - * 0b11..2 extra ADCK cycles; 6 ADCK cycles total sample time. - */ -#define ADC_CFG2_ADLSTS(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG2_ADLSTS_SHIFT)) & ADC_CFG2_ADLSTS_MASK) - -#define ADC_CFG2_ADHSC_MASK (0x4U) -#define ADC_CFG2_ADHSC_SHIFT (2U) -/*! ADHSC - High-Speed Configuration - * 0b0..Normal conversion sequence selected. - * 0b1..High-speed conversion sequence selected with 2 additional ADCK cycles to total conversion time. - */ -#define ADC_CFG2_ADHSC(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG2_ADHSC_SHIFT)) & ADC_CFG2_ADHSC_MASK) - -#define ADC_CFG2_ADACKEN_MASK (0x8U) -#define ADC_CFG2_ADACKEN_SHIFT (3U) -/*! ADACKEN - Asynchronous Clock Output Enable - * 0b0..Asynchronous clock output disabled; Asynchronous clock is enabled only if selected by ADICLK and a conversion is active. - * 0b1..Asynchronous clock and clock output is enabled regardless of the state of the ADC. - */ -#define ADC_CFG2_ADACKEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG2_ADACKEN_SHIFT)) & ADC_CFG2_ADACKEN_MASK) - -#define ADC_CFG2_MUXSEL_MASK (0x10U) -#define ADC_CFG2_MUXSEL_SHIFT (4U) -/*! MUXSEL - ADC Mux Select - * 0b0..ADxxa channels are selected. - * 0b1..ADxxb channels are selected. - */ -#define ADC_CFG2_MUXSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG2_MUXSEL_SHIFT)) & ADC_CFG2_MUXSEL_MASK) -/*! @} */ - -/*! @name R - ADC Data Result Register */ -/*! @{ */ - -#define ADC_R_D_MASK (0xFFFFU) -#define ADC_R_D_SHIFT (0U) -/*! D - Data result */ -#define ADC_R_D(x) (((uint32_t)(((uint32_t)(x)) << ADC_R_D_SHIFT)) & ADC_R_D_MASK) -/*! @} */ - -/* The count of ADC_R */ -#define ADC_R_COUNT (2U) - -/*! @name CV1 - Compare Value Registers */ -/*! @{ */ - -#define ADC_CV1_CV_MASK (0xFFFFU) -#define ADC_CV1_CV_SHIFT (0U) -/*! CV - Compare Value. */ -#define ADC_CV1_CV(x) (((uint32_t)(((uint32_t)(x)) << ADC_CV1_CV_SHIFT)) & ADC_CV1_CV_MASK) -/*! @} */ - -/*! @name CV2 - Compare Value Registers */ -/*! @{ */ - -#define ADC_CV2_CV_MASK (0xFFFFU) -#define ADC_CV2_CV_SHIFT (0U) -/*! CV - Compare Value. */ -#define ADC_CV2_CV(x) (((uint32_t)(((uint32_t)(x)) << ADC_CV2_CV_SHIFT)) & ADC_CV2_CV_MASK) -/*! @} */ - -/*! @name SC2 - Status and Control Register 2 */ -/*! @{ */ - -#define ADC_SC2_REFSEL_MASK (0x3U) -#define ADC_SC2_REFSEL_SHIFT (0U) -/*! REFSEL - Voltage Reference Selection - * 0b00..Default voltage reference pin pair, that is, external pins VREFH and VREFL - * 0b01..Alternate reference pair, that is, VALTH and VALTL . This pair may be additional external pins or - * internal sources depending on the MCU configuration. See the chip configuration information for details - * specific to this MCU - * 0b10..Reserved - * 0b11..Reserved - */ -#define ADC_SC2_REFSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_SC2_REFSEL_SHIFT)) & ADC_SC2_REFSEL_MASK) - -#define ADC_SC2_DMAEN_MASK (0x4U) -#define ADC_SC2_DMAEN_SHIFT (2U) -/*! DMAEN - DMA Enable - * 0b0..DMA is disabled. - * 0b1..DMA is enabled and will assert the ADC DMA request during an ADC conversion complete event noted when any - * of the SC1n[COCO] flags is asserted. - */ -#define ADC_SC2_DMAEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_SC2_DMAEN_SHIFT)) & ADC_SC2_DMAEN_MASK) - -#define ADC_SC2_ACREN_MASK (0x8U) -#define ADC_SC2_ACREN_SHIFT (3U) -/*! ACREN - Compare Function Range Enable - * 0b0..Range function disabled. Only CV1 is compared. - * 0b1..Range function enabled. Both CV1 and CV2 are compared. - */ -#define ADC_SC2_ACREN(x) (((uint32_t)(((uint32_t)(x)) << ADC_SC2_ACREN_SHIFT)) & ADC_SC2_ACREN_MASK) - -#define ADC_SC2_ACFGT_MASK (0x10U) -#define ADC_SC2_ACFGT_SHIFT (4U) -/*! ACFGT - Compare Function Greater Than Enable - * 0b0..Configures less than threshold, outside range not inclusive and inside range not inclusive; functionality - * based on the values placed in CV1 and CV2. - * 0b1..Configures greater than or equal to threshold, outside and inside ranges inclusive; functionality based on the values placed in CV1 and CV2. - */ -#define ADC_SC2_ACFGT(x) (((uint32_t)(((uint32_t)(x)) << ADC_SC2_ACFGT_SHIFT)) & ADC_SC2_ACFGT_MASK) - -#define ADC_SC2_ACFE_MASK (0x20U) -#define ADC_SC2_ACFE_SHIFT (5U) -/*! ACFE - Compare Function Enable - * 0b0..Compare function disabled. - * 0b1..Compare function enabled. - */ -#define ADC_SC2_ACFE(x) (((uint32_t)(((uint32_t)(x)) << ADC_SC2_ACFE_SHIFT)) & ADC_SC2_ACFE_MASK) - -#define ADC_SC2_ADTRG_MASK (0x40U) -#define ADC_SC2_ADTRG_SHIFT (6U) -/*! ADTRG - Conversion Trigger Select - * 0b0..Software trigger selected. - * 0b1..Hardware trigger selected. - */ -#define ADC_SC2_ADTRG(x) (((uint32_t)(((uint32_t)(x)) << ADC_SC2_ADTRG_SHIFT)) & ADC_SC2_ADTRG_MASK) - -#define ADC_SC2_ADACT_MASK (0x80U) -#define ADC_SC2_ADACT_SHIFT (7U) -/*! ADACT - Conversion Active - * 0b0..Conversion not in progress. - * 0b1..Conversion in progress. - */ -#define ADC_SC2_ADACT(x) (((uint32_t)(((uint32_t)(x)) << ADC_SC2_ADACT_SHIFT)) & ADC_SC2_ADACT_MASK) -/*! @} */ - -/*! @name SC3 - Status and Control Register 3 */ -/*! @{ */ - -#define ADC_SC3_AVGS_MASK (0x3U) -#define ADC_SC3_AVGS_SHIFT (0U) -/*! AVGS - Hardware Average Select - * 0b00..4 samples averaged. - * 0b01..8 samples averaged. - * 0b10..16 samples averaged. - * 0b11..32 samples averaged. - */ -#define ADC_SC3_AVGS(x) (((uint32_t)(((uint32_t)(x)) << ADC_SC3_AVGS_SHIFT)) & ADC_SC3_AVGS_MASK) - -#define ADC_SC3_AVGE_MASK (0x4U) -#define ADC_SC3_AVGE_SHIFT (2U) -/*! AVGE - Hardware Average Enable - * 0b0..Hardware average function disabled. - * 0b1..Hardware average function enabled. - */ -#define ADC_SC3_AVGE(x) (((uint32_t)(((uint32_t)(x)) << ADC_SC3_AVGE_SHIFT)) & ADC_SC3_AVGE_MASK) - -#define ADC_SC3_ADCO_MASK (0x8U) -#define ADC_SC3_ADCO_SHIFT (3U) -/*! ADCO - Continuous Conversion Enable - * 0b0..One conversion or one set of conversions if the hardware average function is enabled, that is, AVGE=1, after initiating a conversion. - * 0b1..Continuous conversions or sets of conversions if the hardware average function is enabled, that is, AVGE=1, after initiating a conversion. - */ -#define ADC_SC3_ADCO(x) (((uint32_t)(((uint32_t)(x)) << ADC_SC3_ADCO_SHIFT)) & ADC_SC3_ADCO_MASK) - -#define ADC_SC3_CALF_MASK (0x40U) -#define ADC_SC3_CALF_SHIFT (6U) -/*! CALF - Calibration Failed Flag - * 0b0..Calibration completed normally. - * 0b1..Calibration failed. ADC accuracy specifications are not guaranteed. - */ -#define ADC_SC3_CALF(x) (((uint32_t)(((uint32_t)(x)) << ADC_SC3_CALF_SHIFT)) & ADC_SC3_CALF_MASK) - -#define ADC_SC3_CAL_MASK (0x80U) -#define ADC_SC3_CAL_SHIFT (7U) -/*! CAL - Calibration */ -#define ADC_SC3_CAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_SC3_CAL_SHIFT)) & ADC_SC3_CAL_MASK) -/*! @} */ - -/*! @name OFS - ADC Offset Correction Register */ -/*! @{ */ - -#define ADC_OFS_OFS_MASK (0xFFFFU) -#define ADC_OFS_OFS_SHIFT (0U) -/*! OFS - Offset Error Correction Value */ -#define ADC_OFS_OFS(x) (((uint32_t)(((uint32_t)(x)) << ADC_OFS_OFS_SHIFT)) & ADC_OFS_OFS_MASK) -/*! @} */ - -/*! @name PG - ADC Plus-Side Gain Register */ -/*! @{ */ - -#define ADC_PG_PG_MASK (0xFFFFU) -#define ADC_PG_PG_SHIFT (0U) -/*! PG - Plus-Side Gain */ -#define ADC_PG_PG(x) (((uint32_t)(((uint32_t)(x)) << ADC_PG_PG_SHIFT)) & ADC_PG_PG_MASK) -/*! @} */ - -/*! @name MG - ADC Minus-Side Gain Register */ -/*! @{ */ - -#define ADC_MG_MG_MASK (0xFFFFU) -#define ADC_MG_MG_SHIFT (0U) -/*! MG - Minus-Side Gain */ -#define ADC_MG_MG(x) (((uint32_t)(((uint32_t)(x)) << ADC_MG_MG_SHIFT)) & ADC_MG_MG_MASK) -/*! @} */ - -/*! @name CLPD - ADC Plus-Side General Calibration Value Register */ -/*! @{ */ - -#define ADC_CLPD_CLPD_MASK (0x3FU) -#define ADC_CLPD_CLPD_SHIFT (0U) -/*! CLPD - Calibration Value */ -#define ADC_CLPD_CLPD(x) (((uint32_t)(((uint32_t)(x)) << ADC_CLPD_CLPD_SHIFT)) & ADC_CLPD_CLPD_MASK) -/*! @} */ - -/*! @name CLPS - ADC Plus-Side General Calibration Value Register */ -/*! @{ */ - -#define ADC_CLPS_CLPS_MASK (0x3FU) -#define ADC_CLPS_CLPS_SHIFT (0U) -/*! CLPS - Calibration Value */ -#define ADC_CLPS_CLPS(x) (((uint32_t)(((uint32_t)(x)) << ADC_CLPS_CLPS_SHIFT)) & ADC_CLPS_CLPS_MASK) -/*! @} */ - -/*! @name CLP4 - ADC Plus-Side General Calibration Value Register */ -/*! @{ */ - -#define ADC_CLP4_CLP4_MASK (0x3FFU) -#define ADC_CLP4_CLP4_SHIFT (0U) -/*! CLP4 - Calibration Value */ -#define ADC_CLP4_CLP4(x) (((uint32_t)(((uint32_t)(x)) << ADC_CLP4_CLP4_SHIFT)) & ADC_CLP4_CLP4_MASK) -/*! @} */ - -/*! @name CLP3 - ADC Plus-Side General Calibration Value Register */ -/*! @{ */ - -#define ADC_CLP3_CLP3_MASK (0x1FFU) -#define ADC_CLP3_CLP3_SHIFT (0U) -/*! CLP3 - Calibration Value */ -#define ADC_CLP3_CLP3(x) (((uint32_t)(((uint32_t)(x)) << ADC_CLP3_CLP3_SHIFT)) & ADC_CLP3_CLP3_MASK) -/*! @} */ - -/*! @name CLP2 - ADC Plus-Side General Calibration Value Register */ -/*! @{ */ - -#define ADC_CLP2_CLP2_MASK (0xFFU) -#define ADC_CLP2_CLP2_SHIFT (0U) -/*! CLP2 - Calibration Value */ -#define ADC_CLP2_CLP2(x) (((uint32_t)(((uint32_t)(x)) << ADC_CLP2_CLP2_SHIFT)) & ADC_CLP2_CLP2_MASK) -/*! @} */ - -/*! @name CLP1 - ADC Plus-Side General Calibration Value Register */ -/*! @{ */ - -#define ADC_CLP1_CLP1_MASK (0x7FU) -#define ADC_CLP1_CLP1_SHIFT (0U) -/*! CLP1 - Calibration Value */ -#define ADC_CLP1_CLP1(x) (((uint32_t)(((uint32_t)(x)) << ADC_CLP1_CLP1_SHIFT)) & ADC_CLP1_CLP1_MASK) -/*! @} */ - -/*! @name CLP0 - ADC Plus-Side General Calibration Value Register */ -/*! @{ */ - -#define ADC_CLP0_CLP0_MASK (0x3FU) -#define ADC_CLP0_CLP0_SHIFT (0U) -/*! CLP0 - Calibration Value */ -#define ADC_CLP0_CLP0(x) (((uint32_t)(((uint32_t)(x)) << ADC_CLP0_CLP0_SHIFT)) & ADC_CLP0_CLP0_MASK) -/*! @} */ - -/*! @name CLMD - ADC Minus-Side General Calibration Value Register */ -/*! @{ */ - -#define ADC_CLMD_CLMD_MASK (0x3FU) -#define ADC_CLMD_CLMD_SHIFT (0U) -/*! CLMD - Calibration Value */ -#define ADC_CLMD_CLMD(x) (((uint32_t)(((uint32_t)(x)) << ADC_CLMD_CLMD_SHIFT)) & ADC_CLMD_CLMD_MASK) -/*! @} */ - -/*! @name CLMS - ADC Minus-Side General Calibration Value Register */ -/*! @{ */ - -#define ADC_CLMS_CLMS_MASK (0x3FU) -#define ADC_CLMS_CLMS_SHIFT (0U) -/*! CLMS - Calibration Value */ -#define ADC_CLMS_CLMS(x) (((uint32_t)(((uint32_t)(x)) << ADC_CLMS_CLMS_SHIFT)) & ADC_CLMS_CLMS_MASK) -/*! @} */ - -/*! @name CLM4 - ADC Minus-Side General Calibration Value Register */ -/*! @{ */ - -#define ADC_CLM4_CLM4_MASK (0x3FFU) -#define ADC_CLM4_CLM4_SHIFT (0U) -/*! CLM4 - Calibration Value */ -#define ADC_CLM4_CLM4(x) (((uint32_t)(((uint32_t)(x)) << ADC_CLM4_CLM4_SHIFT)) & ADC_CLM4_CLM4_MASK) -/*! @} */ - -/*! @name CLM3 - ADC Minus-Side General Calibration Value Register */ -/*! @{ */ - -#define ADC_CLM3_CLM3_MASK (0x1FFU) -#define ADC_CLM3_CLM3_SHIFT (0U) -/*! CLM3 - Calibration Value */ -#define ADC_CLM3_CLM3(x) (((uint32_t)(((uint32_t)(x)) << ADC_CLM3_CLM3_SHIFT)) & ADC_CLM3_CLM3_MASK) -/*! @} */ - -/*! @name CLM2 - ADC Minus-Side General Calibration Value Register */ -/*! @{ */ - -#define ADC_CLM2_CLM2_MASK (0xFFU) -#define ADC_CLM2_CLM2_SHIFT (0U) -/*! CLM2 - Calibration Value */ -#define ADC_CLM2_CLM2(x) (((uint32_t)(((uint32_t)(x)) << ADC_CLM2_CLM2_SHIFT)) & ADC_CLM2_CLM2_MASK) -/*! @} */ - -/*! @name CLM1 - ADC Minus-Side General Calibration Value Register */ -/*! @{ */ - -#define ADC_CLM1_CLM1_MASK (0x7FU) -#define ADC_CLM1_CLM1_SHIFT (0U) -/*! CLM1 - Calibration Value */ -#define ADC_CLM1_CLM1(x) (((uint32_t)(((uint32_t)(x)) << ADC_CLM1_CLM1_SHIFT)) & ADC_CLM1_CLM1_MASK) -/*! @} */ - -/*! @name CLM0 - ADC Minus-Side General Calibration Value Register */ -/*! @{ */ - -#define ADC_CLM0_CLM0_MASK (0x3FU) -#define ADC_CLM0_CLM0_SHIFT (0U) -/*! CLM0 - Calibration Value */ -#define ADC_CLM0_CLM0(x) (((uint32_t)(((uint32_t)(x)) << ADC_CLM0_CLM0_SHIFT)) & ADC_CLM0_CLM0_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group ADC_Register_Masks */ - - -/* ADC - Peripheral instance base addresses */ -/** Peripheral ADC0 base address */ -#define ADC0_BASE (0x4003B000u) -/** Peripheral ADC0 base pointer */ -#define ADC0 ((ADC_Type *)ADC0_BASE) -/** Array initializer of ADC peripheral base addresses */ -#define ADC_BASE_ADDRS { ADC0_BASE } -/** Array initializer of ADC peripheral base pointers */ -#define ADC_BASE_PTRS { ADC0 } -/** Interrupt vectors for the ADC peripheral type */ -#define ADC_IRQS { ADC0_IRQn } - -/*! - * @} - */ /* end of group ADC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- CMP Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CMP_Peripheral_Access_Layer CMP Peripheral Access Layer - * @{ - */ - -/** CMP - Register Layout Typedef */ -typedef struct { - __IO uint8_t CR0; /**< CMP Control Register 0, offset: 0x0 */ - __IO uint8_t CR1; /**< CMP Control Register 1, offset: 0x1 */ - __IO uint8_t FPR; /**< CMP Filter Period Register, offset: 0x2 */ - __IO uint8_t SCR; /**< CMP Status and Control Register, offset: 0x3 */ - __IO uint8_t DACCR; /**< DAC Control Register, offset: 0x4 */ - __IO uint8_t MUXCR; /**< MUX Control Register, offset: 0x5 */ -} CMP_Type; - -/* ---------------------------------------------------------------------------- - -- CMP Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CMP_Register_Masks CMP Register Masks - * @{ - */ - -/*! @name CR0 - CMP Control Register 0 */ -/*! @{ */ - -#define CMP_CR0_HYSTCTR_MASK (0x3U) -#define CMP_CR0_HYSTCTR_SHIFT (0U) -/*! HYSTCTR - Comparator hard block hysteresis control - * 0b00..Level 0 - * 0b01..Level 1 - * 0b10..Level 2 - * 0b11..Level 3 - */ -#define CMP_CR0_HYSTCTR(x) (((uint8_t)(((uint8_t)(x)) << CMP_CR0_HYSTCTR_SHIFT)) & CMP_CR0_HYSTCTR_MASK) - -#define CMP_CR0_FILTER_CNT_MASK (0x70U) -#define CMP_CR0_FILTER_CNT_SHIFT (4U) -/*! FILTER_CNT - Filter Sample Count - * 0b000..Filter is disabled. SE = 0, COUT = COUTA. - * 0b001..One sample must agree. The comparator output is simply sampled. - * 0b010..2 consecutive samples must agree. - * 0b011..3 consecutive samples must agree. - * 0b100..4 consecutive samples must agree. - * 0b101..5 consecutive samples must agree. - * 0b110..6 consecutive samples must agree. - * 0b111..7 consecutive samples must agree. - */ -#define CMP_CR0_FILTER_CNT(x) (((uint8_t)(((uint8_t)(x)) << CMP_CR0_FILTER_CNT_SHIFT)) & CMP_CR0_FILTER_CNT_MASK) -/*! @} */ - -/*! @name CR1 - CMP Control Register 1 */ -/*! @{ */ - -#define CMP_CR1_EN_MASK (0x1U) -#define CMP_CR1_EN_SHIFT (0U) -/*! EN - Comparator Module Enable - * 0b0..Analog Comparator is disabled. - * 0b1..Analog Comparator is enabled. - */ -#define CMP_CR1_EN(x) (((uint8_t)(((uint8_t)(x)) << CMP_CR1_EN_SHIFT)) & CMP_CR1_EN_MASK) - -#define CMP_CR1_OPE_MASK (0x2U) -#define CMP_CR1_OPE_SHIFT (1U) -/*! OPE - Comparator Output Pin Enable - * 0b0..CMPO is not available on the associated CMPO output pin. If the comparator does not own the pin, this field has no effect. - * 0b1..CMPO is available on the associated CMPO output pin. The comparator output (CMPO) is driven out on the - * associated CMPO output pin if the comparator owns the pin. If the comparator does not own the field, this - * bit has no effect. - */ -#define CMP_CR1_OPE(x) (((uint8_t)(((uint8_t)(x)) << CMP_CR1_OPE_SHIFT)) & CMP_CR1_OPE_MASK) - -#define CMP_CR1_COS_MASK (0x4U) -#define CMP_CR1_COS_SHIFT (2U) -/*! COS - Comparator Output Select - * 0b0..Set the filtered comparator output (CMPO) to equal COUT. - * 0b1..Set the unfiltered comparator output (CMPO) to equal COUTA. - */ -#define CMP_CR1_COS(x) (((uint8_t)(((uint8_t)(x)) << CMP_CR1_COS_SHIFT)) & CMP_CR1_COS_MASK) - -#define CMP_CR1_INV_MASK (0x8U) -#define CMP_CR1_INV_SHIFT (3U) -/*! INV - Comparator INVERT - * 0b0..Does not invert the comparator output. - * 0b1..Inverts the comparator output. - */ -#define CMP_CR1_INV(x) (((uint8_t)(((uint8_t)(x)) << CMP_CR1_INV_SHIFT)) & CMP_CR1_INV_MASK) - -#define CMP_CR1_PMODE_MASK (0x10U) -#define CMP_CR1_PMODE_SHIFT (4U) -/*! PMODE - Power Mode Select - * 0b0..Low-Speed (LS) Comparison mode selected. In this mode, CMP has slower output propagation delay and lower current consumption. - * 0b1..High-Speed (HS) Comparison mode selected. In this mode, CMP has faster output propagation delay and higher current consumption. - */ -#define CMP_CR1_PMODE(x) (((uint8_t)(((uint8_t)(x)) << CMP_CR1_PMODE_SHIFT)) & CMP_CR1_PMODE_MASK) - -#define CMP_CR1_TRIGM_MASK (0x20U) -#define CMP_CR1_TRIGM_SHIFT (5U) -/*! TRIGM - Trigger Mode Enable - * 0b0..Trigger mode is disabled. - * 0b1..Trigger mode is enabled. - */ -#define CMP_CR1_TRIGM(x) (((uint8_t)(((uint8_t)(x)) << CMP_CR1_TRIGM_SHIFT)) & CMP_CR1_TRIGM_MASK) - -#define CMP_CR1_WE_MASK (0x40U) -#define CMP_CR1_WE_SHIFT (6U) -/*! WE - Windowing Enable - * 0b0..Windowing mode is not selected. - * 0b1..Windowing mode is selected. - */ -#define CMP_CR1_WE(x) (((uint8_t)(((uint8_t)(x)) << CMP_CR1_WE_SHIFT)) & CMP_CR1_WE_MASK) - -#define CMP_CR1_SE_MASK (0x80U) -#define CMP_CR1_SE_SHIFT (7U) -/*! SE - Sample Enable - * 0b0..Sampling mode is not selected. - * 0b1..Sampling mode is selected. - */ -#define CMP_CR1_SE(x) (((uint8_t)(((uint8_t)(x)) << CMP_CR1_SE_SHIFT)) & CMP_CR1_SE_MASK) -/*! @} */ - -/*! @name FPR - CMP Filter Period Register */ -/*! @{ */ - -#define CMP_FPR_FILT_PER_MASK (0xFFU) -#define CMP_FPR_FILT_PER_SHIFT (0U) -/*! FILT_PER - Filter Sample Period */ -#define CMP_FPR_FILT_PER(x) (((uint8_t)(((uint8_t)(x)) << CMP_FPR_FILT_PER_SHIFT)) & CMP_FPR_FILT_PER_MASK) -/*! @} */ - -/*! @name SCR - CMP Status and Control Register */ -/*! @{ */ - -#define CMP_SCR_COUT_MASK (0x1U) -#define CMP_SCR_COUT_SHIFT (0U) -/*! COUT - Analog Comparator Output */ -#define CMP_SCR_COUT(x) (((uint8_t)(((uint8_t)(x)) << CMP_SCR_COUT_SHIFT)) & CMP_SCR_COUT_MASK) - -#define CMP_SCR_CFF_MASK (0x2U) -#define CMP_SCR_CFF_SHIFT (1U) -/*! CFF - Analog Comparator Flag Falling - * 0b0..Falling-edge on COUT has not been detected. - * 0b1..Falling-edge on COUT has occurred. - */ -#define CMP_SCR_CFF(x) (((uint8_t)(((uint8_t)(x)) << CMP_SCR_CFF_SHIFT)) & CMP_SCR_CFF_MASK) - -#define CMP_SCR_CFR_MASK (0x4U) -#define CMP_SCR_CFR_SHIFT (2U) -/*! CFR - Analog Comparator Flag Rising - * 0b0..Rising-edge on COUT has not been detected. - * 0b1..Rising-edge on COUT has occurred. - */ -#define CMP_SCR_CFR(x) (((uint8_t)(((uint8_t)(x)) << CMP_SCR_CFR_SHIFT)) & CMP_SCR_CFR_MASK) - -#define CMP_SCR_IEF_MASK (0x8U) -#define CMP_SCR_IEF_SHIFT (3U) -/*! IEF - Comparator Interrupt Enable Falling - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define CMP_SCR_IEF(x) (((uint8_t)(((uint8_t)(x)) << CMP_SCR_IEF_SHIFT)) & CMP_SCR_IEF_MASK) - -#define CMP_SCR_IER_MASK (0x10U) -#define CMP_SCR_IER_SHIFT (4U) -/*! IER - Comparator Interrupt Enable Rising - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define CMP_SCR_IER(x) (((uint8_t)(((uint8_t)(x)) << CMP_SCR_IER_SHIFT)) & CMP_SCR_IER_MASK) - -#define CMP_SCR_DMAEN_MASK (0x40U) -#define CMP_SCR_DMAEN_SHIFT (6U) -/*! DMAEN - DMA Enable Control - * 0b0..DMA is disabled. - * 0b1..DMA is enabled. - */ -#define CMP_SCR_DMAEN(x) (((uint8_t)(((uint8_t)(x)) << CMP_SCR_DMAEN_SHIFT)) & CMP_SCR_DMAEN_MASK) -/*! @} */ - -/*! @name DACCR - DAC Control Register */ -/*! @{ */ - -#define CMP_DACCR_VOSEL_MASK (0x3FU) -#define CMP_DACCR_VOSEL_SHIFT (0U) -/*! VOSEL - DAC Output Voltage Select */ -#define CMP_DACCR_VOSEL(x) (((uint8_t)(((uint8_t)(x)) << CMP_DACCR_VOSEL_SHIFT)) & CMP_DACCR_VOSEL_MASK) - -#define CMP_DACCR_VRSEL_MASK (0x40U) -#define CMP_DACCR_VRSEL_SHIFT (6U) -/*! VRSEL - Supply Voltage Reference Source Select - * 0b0..Vin1 is selected as resistor ladder network supply reference. - * 0b1..Vin2 is selected as resistor ladder network supply reference. - */ -#define CMP_DACCR_VRSEL(x) (((uint8_t)(((uint8_t)(x)) << CMP_DACCR_VRSEL_SHIFT)) & CMP_DACCR_VRSEL_MASK) - -#define CMP_DACCR_DACEN_MASK (0x80U) -#define CMP_DACCR_DACEN_SHIFT (7U) -/*! DACEN - DAC Enable - * 0b0..DAC is disabled. - * 0b1..DAC is enabled. - */ -#define CMP_DACCR_DACEN(x) (((uint8_t)(((uint8_t)(x)) << CMP_DACCR_DACEN_SHIFT)) & CMP_DACCR_DACEN_MASK) -/*! @} */ - -/*! @name MUXCR - MUX Control Register */ -/*! @{ */ - -#define CMP_MUXCR_MSEL_MASK (0x7U) -#define CMP_MUXCR_MSEL_SHIFT (0U) -/*! MSEL - Minus Input Mux Control - * 0b000..IN0 - * 0b001..IN1 - * 0b010..IN2 - * 0b011..IN3 - * 0b100..IN4 - * 0b101..IN5 - * 0b110..IN6 - * 0b111..IN7 - */ -#define CMP_MUXCR_MSEL(x) (((uint8_t)(((uint8_t)(x)) << CMP_MUXCR_MSEL_SHIFT)) & CMP_MUXCR_MSEL_MASK) - -#define CMP_MUXCR_PSEL_MASK (0x38U) -#define CMP_MUXCR_PSEL_SHIFT (3U) -/*! PSEL - Plus Input Mux Control - * 0b000..IN0 - * 0b001..IN1 - * 0b010..IN2 - * 0b011..IN3 - * 0b100..IN4 - * 0b101..IN5 - * 0b110..IN6 - * 0b111..IN7 - */ -#define CMP_MUXCR_PSEL(x) (((uint8_t)(((uint8_t)(x)) << CMP_MUXCR_PSEL_SHIFT)) & CMP_MUXCR_PSEL_MASK) - -#define CMP_MUXCR_PSTM_MASK (0x80U) -#define CMP_MUXCR_PSTM_SHIFT (7U) -/*! PSTM - Pass Through Mode Enable - * 0b0..Pass Through Mode is disabled. - * 0b1..Pass Through Mode is enabled. - */ -#define CMP_MUXCR_PSTM(x) (((uint8_t)(((uint8_t)(x)) << CMP_MUXCR_PSTM_SHIFT)) & CMP_MUXCR_PSTM_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group CMP_Register_Masks */ - - -/* CMP - Peripheral instance base addresses */ -/** Peripheral CMP0 base address */ -#define CMP0_BASE (0x40073000u) -/** Peripheral CMP0 base pointer */ -#define CMP0 ((CMP_Type *)CMP0_BASE) -/** Array initializer of CMP peripheral base addresses */ -#define CMP_BASE_ADDRS { CMP0_BASE } -/** Array initializer of CMP peripheral base pointers */ -#define CMP_BASE_PTRS { CMP0 } -/** Interrupt vectors for the CMP peripheral type */ -#define CMP_IRQS { CMP0_IRQn } - -/*! - * @} - */ /* end of group CMP_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- DAC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DAC_Peripheral_Access_Layer DAC Peripheral Access Layer - * @{ - */ - -/** DAC - Register Layout Typedef */ -typedef struct { - struct { /* offset: 0x0, array step: 0x2 */ - __IO uint8_t DATL; /**< DAC Data Low Register, array offset: 0x0, array step: 0x2 */ - __IO uint8_t DATH; /**< DAC Data High Register, array offset: 0x1, array step: 0x2 */ - } DAT[2]; - uint8_t RESERVED_0[28]; - __IO uint8_t SR; /**< DAC Status Register, offset: 0x20 */ - __IO uint8_t C0; /**< DAC Control Register, offset: 0x21 */ - __IO uint8_t C1; /**< DAC Control Register 1, offset: 0x22 */ - __IO uint8_t C2; /**< DAC Control Register 2, offset: 0x23 */ -} DAC_Type; - -/* ---------------------------------------------------------------------------- - -- DAC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DAC_Register_Masks DAC Register Masks - * @{ - */ - -/*! @name DATL - DAC Data Low Register */ -/*! @{ */ - -#define DAC_DATL_DATA0_MASK (0xFFU) -#define DAC_DATL_DATA0_SHIFT (0U) -/*! DATA0 - DATA0 */ -#define DAC_DATL_DATA0(x) (((uint8_t)(((uint8_t)(x)) << DAC_DATL_DATA0_SHIFT)) & DAC_DATL_DATA0_MASK) -/*! @} */ - -/* The count of DAC_DATL */ -#define DAC_DATL_COUNT (2U) - -/*! @name DATH - DAC Data High Register */ -/*! @{ */ - -#define DAC_DATH_DATA1_MASK (0xFU) -#define DAC_DATH_DATA1_SHIFT (0U) -/*! DATA1 - DATA1 */ -#define DAC_DATH_DATA1(x) (((uint8_t)(((uint8_t)(x)) << DAC_DATH_DATA1_SHIFT)) & DAC_DATH_DATA1_MASK) -/*! @} */ - -/* The count of DAC_DATH */ -#define DAC_DATH_COUNT (2U) - -/*! @name SR - DAC Status Register */ -/*! @{ */ - -#define DAC_SR_DACBFRPBF_MASK (0x1U) -#define DAC_SR_DACBFRPBF_SHIFT (0U) -/*! DACBFRPBF - DAC Buffer Read Pointer Bottom Position Flag - * 0b0..The DAC buffer read pointer is not equal to C2[DACBFUP]. - * 0b1..The DAC buffer read pointer is equal to C2[DACBFUP]. - */ -#define DAC_SR_DACBFRPBF(x) (((uint8_t)(((uint8_t)(x)) << DAC_SR_DACBFRPBF_SHIFT)) & DAC_SR_DACBFRPBF_MASK) - -#define DAC_SR_DACBFRPTF_MASK (0x2U) -#define DAC_SR_DACBFRPTF_SHIFT (1U) -/*! DACBFRPTF - DAC Buffer Read Pointer Top Position Flag - * 0b0..The DAC buffer read pointer is not zero. - * 0b1..The DAC buffer read pointer is zero. - */ -#define DAC_SR_DACBFRPTF(x) (((uint8_t)(((uint8_t)(x)) << DAC_SR_DACBFRPTF_SHIFT)) & DAC_SR_DACBFRPTF_MASK) -/*! @} */ - -/*! @name C0 - DAC Control Register */ -/*! @{ */ - -#define DAC_C0_DACBBIEN_MASK (0x1U) -#define DAC_C0_DACBBIEN_SHIFT (0U) -/*! DACBBIEN - DAC Buffer Read Pointer Bottom Flag Interrupt Enable - * 0b0..The DAC buffer read pointer bottom flag interrupt is disabled. - * 0b1..The DAC buffer read pointer bottom flag interrupt is enabled. - */ -#define DAC_C0_DACBBIEN(x) (((uint8_t)(((uint8_t)(x)) << DAC_C0_DACBBIEN_SHIFT)) & DAC_C0_DACBBIEN_MASK) - -#define DAC_C0_DACBTIEN_MASK (0x2U) -#define DAC_C0_DACBTIEN_SHIFT (1U) -/*! DACBTIEN - DAC Buffer Read Pointer Top Flag Interrupt Enable - * 0b0..The DAC buffer read pointer top flag interrupt is disabled. - * 0b1..The DAC buffer read pointer top flag interrupt is enabled. - */ -#define DAC_C0_DACBTIEN(x) (((uint8_t)(((uint8_t)(x)) << DAC_C0_DACBTIEN_SHIFT)) & DAC_C0_DACBTIEN_MASK) - -#define DAC_C0_LPEN_MASK (0x8U) -#define DAC_C0_LPEN_SHIFT (3U) -/*! LPEN - DAC Low Power Control - * 0b0..High-Power mode - * 0b1..Low-Power mode - */ -#define DAC_C0_LPEN(x) (((uint8_t)(((uint8_t)(x)) << DAC_C0_LPEN_SHIFT)) & DAC_C0_LPEN_MASK) - -#define DAC_C0_DACSWTRG_MASK (0x10U) -#define DAC_C0_DACSWTRG_SHIFT (4U) -/*! DACSWTRG - DAC Software Trigger - * 0b0..The DAC soft trigger is not valid. - * 0b1..The DAC soft trigger is valid. - */ -#define DAC_C0_DACSWTRG(x) (((uint8_t)(((uint8_t)(x)) << DAC_C0_DACSWTRG_SHIFT)) & DAC_C0_DACSWTRG_MASK) - -#define DAC_C0_DACTRGSEL_MASK (0x20U) -#define DAC_C0_DACTRGSEL_SHIFT (5U) -/*! DACTRGSEL - DAC Trigger Select - * 0b0..The DAC hardware trigger is selected. - * 0b1..The DAC software trigger is selected. - */ -#define DAC_C0_DACTRGSEL(x) (((uint8_t)(((uint8_t)(x)) << DAC_C0_DACTRGSEL_SHIFT)) & DAC_C0_DACTRGSEL_MASK) - -#define DAC_C0_DACRFS_MASK (0x40U) -#define DAC_C0_DACRFS_SHIFT (6U) -/*! DACRFS - DAC Reference Select - * 0b0..The DAC selects DACREF_1 as the reference voltage. - * 0b1..The DAC selects DACREF_2 as the reference voltage. - */ -#define DAC_C0_DACRFS(x) (((uint8_t)(((uint8_t)(x)) << DAC_C0_DACRFS_SHIFT)) & DAC_C0_DACRFS_MASK) - -#define DAC_C0_DACEN_MASK (0x80U) -#define DAC_C0_DACEN_SHIFT (7U) -/*! DACEN - DAC Enable - * 0b0..The DAC system is disabled. - * 0b1..The DAC system is enabled. - */ -#define DAC_C0_DACEN(x) (((uint8_t)(((uint8_t)(x)) << DAC_C0_DACEN_SHIFT)) & DAC_C0_DACEN_MASK) -/*! @} */ - -/*! @name C1 - DAC Control Register 1 */ -/*! @{ */ - -#define DAC_C1_DACBFEN_MASK (0x1U) -#define DAC_C1_DACBFEN_SHIFT (0U) -/*! DACBFEN - DAC Buffer Enable - * 0b0..Buffer read pointer is disabled. The converted data is always the first word of the buffer. - * 0b1..Buffer read pointer is enabled. The converted data is the word that the read pointer points to. It means - * converted data can be from any word of the buffer. - */ -#define DAC_C1_DACBFEN(x) (((uint8_t)(((uint8_t)(x)) << DAC_C1_DACBFEN_SHIFT)) & DAC_C1_DACBFEN_MASK) - -#define DAC_C1_DACBFMD_MASK (0x6U) -#define DAC_C1_DACBFMD_SHIFT (1U) -/*! DACBFMD - DAC Buffer Work Mode Select - * 0b00..Normal mode - * 0b01..Reserved - * 0b10..One-Time Scan mode - * 0b11..FIFO mode - */ -#define DAC_C1_DACBFMD(x) (((uint8_t)(((uint8_t)(x)) << DAC_C1_DACBFMD_SHIFT)) & DAC_C1_DACBFMD_MASK) - -#define DAC_C1_DMAEN_MASK (0x80U) -#define DAC_C1_DMAEN_SHIFT (7U) -/*! DMAEN - DMA Enable Select - * 0b0..DMA is disabled. - * 0b1..DMA is enabled. When DMA is enabled, the DMA request will be generated by original interrupts. The - * interrupts will not be presented on this module at the same time. - */ -#define DAC_C1_DMAEN(x) (((uint8_t)(((uint8_t)(x)) << DAC_C1_DMAEN_SHIFT)) & DAC_C1_DMAEN_MASK) -/*! @} */ - -/*! @name C2 - DAC Control Register 2 */ -/*! @{ */ - -#define DAC_C2_DACBFUP_MASK (0x1U) -#define DAC_C2_DACBFUP_SHIFT (0U) -/*! DACBFUP - DAC Buffer Upper Limit */ -#define DAC_C2_DACBFUP(x) (((uint8_t)(((uint8_t)(x)) << DAC_C2_DACBFUP_SHIFT)) & DAC_C2_DACBFUP_MASK) - -#define DAC_C2_DACBFRP_MASK (0x10U) -#define DAC_C2_DACBFRP_SHIFT (4U) -/*! DACBFRP - DAC Buffer Read Pointer */ -#define DAC_C2_DACBFRP(x) (((uint8_t)(((uint8_t)(x)) << DAC_C2_DACBFRP_SHIFT)) & DAC_C2_DACBFRP_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group DAC_Register_Masks */ - - -/* DAC - Peripheral instance base addresses */ -/** Peripheral DAC0 base address */ -#define DAC0_BASE (0x4003F000u) -/** Peripheral DAC0 base pointer */ -#define DAC0 ((DAC_Type *)DAC0_BASE) -/** Array initializer of DAC peripheral base addresses */ -#define DAC_BASE_ADDRS { DAC0_BASE } -/** Array initializer of DAC peripheral base pointers */ -#define DAC_BASE_PTRS { DAC0 } -/** Interrupt vectors for the DAC peripheral type */ -#define DAC_IRQS { DAC0_IRQn } - -/*! - * @} - */ /* end of group DAC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- DMA Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DMA_Peripheral_Access_Layer DMA Peripheral Access Layer - * @{ - */ - -/** DMA - Register Layout Typedef */ -typedef struct { - uint8_t RESERVED_0[256]; - struct { /* offset: 0x100, array step: 0x10 */ - __IO uint32_t SAR; /**< Source Address Register, array offset: 0x100, array step: 0x10 */ - __IO uint32_t DAR; /**< Destination Address Register, array offset: 0x104, array step: 0x10 */ - union { /* offset: 0x108, array step: 0x10 */ - struct { /* offset: 0x108, array step: 0x10 */ - uint8_t RESERVED_0[3]; - uint8_t DSR; /**< DMA_DSR0 register...DMA_DSR3 register., array offset: 0x10B, array step: 0x10 */ - } DMA_DSR_ACCESS8BIT; - __IO uint32_t DSR_BCR; /**< DMA Status Register / Byte Count Register, array offset: 0x108, array step: 0x10 */ - }; - __IO uint32_t DCR; /**< DMA Control Register, array offset: 0x10C, array step: 0x10 */ - } DMA[4]; -} DMA_Type; - -/* ---------------------------------------------------------------------------- - -- DMA Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DMA_Register_Masks DMA Register Masks - * @{ - */ - -/*! @name SAR - Source Address Register */ -/*! @{ */ - -#define DMA_SAR_SAR_MASK (0xFFFFFFFFU) -#define DMA_SAR_SAR_SHIFT (0U) -/*! SAR - SAR */ -#define DMA_SAR_SAR(x) (((uint32_t)(((uint32_t)(x)) << DMA_SAR_SAR_SHIFT)) & DMA_SAR_SAR_MASK) -/*! @} */ - -/* The count of DMA_SAR */ -#define DMA_SAR_COUNT (4U) - -/*! @name DAR - Destination Address Register */ -/*! @{ */ - -#define DMA_DAR_DAR_MASK (0xFFFFFFFFU) -#define DMA_DAR_DAR_SHIFT (0U) -/*! DAR - DAR */ -#define DMA_DAR_DAR(x) (((uint32_t)(((uint32_t)(x)) << DMA_DAR_DAR_SHIFT)) & DMA_DAR_DAR_MASK) -/*! @} */ - -/* The count of DMA_DAR */ -#define DMA_DAR_COUNT (4U) - -/* The count of DMA_DSR */ -#define DMA_DSR_COUNT (4U) - -/*! @name DSR_BCR - DMA Status Register / Byte Count Register */ -/*! @{ */ - -#define DMA_DSR_BCR_BCR_MASK (0xFFFFFFU) -#define DMA_DSR_BCR_BCR_SHIFT (0U) -/*! BCR - BCR */ -#define DMA_DSR_BCR_BCR(x) (((uint32_t)(((uint32_t)(x)) << DMA_DSR_BCR_BCR_SHIFT)) & DMA_DSR_BCR_BCR_MASK) - -#define DMA_DSR_BCR_DONE_MASK (0x1000000U) -#define DMA_DSR_BCR_DONE_SHIFT (24U) -/*! DONE - Transactions Done - * 0b0..DMA transfer is not yet complete. Writing a 0 has no effect. - * 0b1..DMA transfer completed. Writing a 1 to this bit clears all DMA status bits and should be used in an - * interrupt service routine to clear the DMA interrupt and error bits. - */ -#define DMA_DSR_BCR_DONE(x) (((uint32_t)(((uint32_t)(x)) << DMA_DSR_BCR_DONE_SHIFT)) & DMA_DSR_BCR_DONE_MASK) - -#define DMA_DSR_BCR_BSY_MASK (0x2000000U) -#define DMA_DSR_BCR_BSY_SHIFT (25U) -/*! BSY - Busy - * 0b0..DMA channel is inactive. Cleared when the DMA has finished the last transaction. - * 0b1..BSY is set the first time the channel is enabled after a transfer is initiated. - */ -#define DMA_DSR_BCR_BSY(x) (((uint32_t)(((uint32_t)(x)) << DMA_DSR_BCR_BSY_SHIFT)) & DMA_DSR_BCR_BSY_MASK) - -#define DMA_DSR_BCR_REQ_MASK (0x4000000U) -#define DMA_DSR_BCR_REQ_SHIFT (26U) -/*! REQ - Request - * 0b0..No request is pending or the channel is currently active. Cleared when the channel is selected. - * 0b1..The DMA channel has a transfer remaining and the channel is not selected. - */ -#define DMA_DSR_BCR_REQ(x) (((uint32_t)(((uint32_t)(x)) << DMA_DSR_BCR_REQ_SHIFT)) & DMA_DSR_BCR_REQ_MASK) - -#define DMA_DSR_BCR_BED_MASK (0x10000000U) -#define DMA_DSR_BCR_BED_SHIFT (28U) -/*! BED - Bus Error on Destination - * 0b0..No bus error occurred. - * 0b1..The DMA channel terminated with a bus error during the write portion of a transfer. - */ -#define DMA_DSR_BCR_BED(x) (((uint32_t)(((uint32_t)(x)) << DMA_DSR_BCR_BED_SHIFT)) & DMA_DSR_BCR_BED_MASK) - -#define DMA_DSR_BCR_BES_MASK (0x20000000U) -#define DMA_DSR_BCR_BES_SHIFT (29U) -/*! BES - Bus Error on Source - * 0b0..No bus error occurred. - * 0b1..The DMA channel terminated with a bus error during the read portion of a transfer. - */ -#define DMA_DSR_BCR_BES(x) (((uint32_t)(((uint32_t)(x)) << DMA_DSR_BCR_BES_SHIFT)) & DMA_DSR_BCR_BES_MASK) - -#define DMA_DSR_BCR_CE_MASK (0x40000000U) -#define DMA_DSR_BCR_CE_SHIFT (30U) -/*! CE - Configuration Error - * 0b0..No configuration error exists. - * 0b1..A configuration error has occurred. - */ -#define DMA_DSR_BCR_CE(x) (((uint32_t)(((uint32_t)(x)) << DMA_DSR_BCR_CE_SHIFT)) & DMA_DSR_BCR_CE_MASK) -/*! @} */ - -/* The count of DMA_DSR_BCR */ -#define DMA_DSR_BCR_COUNT (4U) - -/*! @name DCR - DMA Control Register */ -/*! @{ */ - -#define DMA_DCR_LCH2_MASK (0x3U) -#define DMA_DCR_LCH2_SHIFT (0U) -/*! LCH2 - Link Channel 2 - * 0b00..DMA Channel 0 - * 0b01..DMA Channel 1 - * 0b10..DMA Channel 2 - * 0b11..DMA Channel 3 - */ -#define DMA_DCR_LCH2(x) (((uint32_t)(((uint32_t)(x)) << DMA_DCR_LCH2_SHIFT)) & DMA_DCR_LCH2_MASK) - -#define DMA_DCR_LCH1_MASK (0xCU) -#define DMA_DCR_LCH1_SHIFT (2U) -/*! LCH1 - Link Channel 1 - * 0b00..DMA Channel 0 - * 0b01..DMA Channel 1 - * 0b10..DMA Channel 2 - * 0b11..DMA Channel 3 - */ -#define DMA_DCR_LCH1(x) (((uint32_t)(((uint32_t)(x)) << DMA_DCR_LCH1_SHIFT)) & DMA_DCR_LCH1_MASK) - -#define DMA_DCR_LINKCC_MASK (0x30U) -#define DMA_DCR_LINKCC_SHIFT (4U) -/*! LINKCC - Link Channel Control - * 0b00..No channel-to-channel linking - * 0b01..Perform a link to channel LCH1 after each cycle-steal transfer followed by a link to LCH2 after the BCR decrements to 0. - * 0b10..Perform a link to channel LCH1 after each cycle-steal transfer - * 0b11..Perform a link to channel LCH1 after the BCR decrements to 0. - */ -#define DMA_DCR_LINKCC(x) (((uint32_t)(((uint32_t)(x)) << DMA_DCR_LINKCC_SHIFT)) & DMA_DCR_LINKCC_MASK) - -#define DMA_DCR_D_REQ_MASK (0x80U) -#define DMA_DCR_D_REQ_SHIFT (7U) -/*! D_REQ - Disable Request - * 0b0..ERQ bit is not affected. - * 0b1..ERQ bit is cleared when the BCR is exhausted. - */ -#define DMA_DCR_D_REQ(x) (((uint32_t)(((uint32_t)(x)) << DMA_DCR_D_REQ_SHIFT)) & DMA_DCR_D_REQ_MASK) - -#define DMA_DCR_DMOD_MASK (0xF00U) -#define DMA_DCR_DMOD_SHIFT (8U) -/*! DMOD - Destination Address Modulo - * 0b0000..Buffer disabled - * 0b0001..Circular buffer size is 16 bytes - * 0b0010..Circular buffer size is 32 bytes - * 0b0011..Circular buffer size is 64 bytes - * 0b0100..Circular buffer size is 128 bytes - * 0b0101..Circular buffer size is 256 bytes - * 0b0110..Circular buffer size is 512 bytes - * 0b0111..Circular buffer size is 1 KB - * 0b1000..Circular buffer size is 2 KB - * 0b1001..Circular buffer size is 4 KB - * 0b1010..Circular buffer size is 8 KB - * 0b1011..Circular buffer size is 16 KB - * 0b1100..Circular buffer size is 32 KB - * 0b1101..Circular buffer size is 64 KB - * 0b1110..Circular buffer size is 128 KB - * 0b1111..Circular buffer size is 256 KB - */ -#define DMA_DCR_DMOD(x) (((uint32_t)(((uint32_t)(x)) << DMA_DCR_DMOD_SHIFT)) & DMA_DCR_DMOD_MASK) - -#define DMA_DCR_SMOD_MASK (0xF000U) -#define DMA_DCR_SMOD_SHIFT (12U) -/*! SMOD - Source Address Modulo - * 0b0000..Buffer disabled - * 0b0001..Circular buffer size is 16 bytes. - * 0b0010..Circular buffer size is 32 bytes. - * 0b0011..Circular buffer size is 64 bytes. - * 0b0100..Circular buffer size is 128 bytes. - * 0b0101..Circular buffer size is 256 bytes. - * 0b0110..Circular buffer size is 512 bytes. - * 0b0111..Circular buffer size is 1 KB. - * 0b1000..Circular buffer size is 2 KB. - * 0b1001..Circular buffer size is 4 KB. - * 0b1010..Circular buffer size is 8 KB. - * 0b1011..Circular buffer size is 16 KB. - * 0b1100..Circular buffer size is 32 KB. - * 0b1101..Circular buffer size is 64 KB. - * 0b1110..Circular buffer size is 128 KB. - * 0b1111..Circular buffer size is 256 KB. - */ -#define DMA_DCR_SMOD(x) (((uint32_t)(((uint32_t)(x)) << DMA_DCR_SMOD_SHIFT)) & DMA_DCR_SMOD_MASK) - -#define DMA_DCR_START_MASK (0x10000U) -#define DMA_DCR_START_SHIFT (16U) -/*! START - Start Transfer - * 0b0..DMA inactive - * 0b1..The DMA begins the transfer in accordance to the values in the TCDn. START is cleared automatically after - * one module clock and always reads as logic 0. - */ -#define DMA_DCR_START(x) (((uint32_t)(((uint32_t)(x)) << DMA_DCR_START_SHIFT)) & DMA_DCR_START_MASK) - -#define DMA_DCR_DSIZE_MASK (0x60000U) -#define DMA_DCR_DSIZE_SHIFT (17U) -/*! DSIZE - Destination Size - * 0b00..32-bit - * 0b01..8-bit - * 0b10..16-bit - * 0b11..Reserved (generates a configuration error (DSRn[CE]) if incorrectly specified at time of channel activation) - */ -#define DMA_DCR_DSIZE(x) (((uint32_t)(((uint32_t)(x)) << DMA_DCR_DSIZE_SHIFT)) & DMA_DCR_DSIZE_MASK) - -#define DMA_DCR_DINC_MASK (0x80000U) -#define DMA_DCR_DINC_SHIFT (19U) -/*! DINC - Destination Increment - * 0b0..No change to the DAR after a successful transfer. - * 0b1..The DAR increments by 1, 2, 4 depending upon the size of the transfer. - */ -#define DMA_DCR_DINC(x) (((uint32_t)(((uint32_t)(x)) << DMA_DCR_DINC_SHIFT)) & DMA_DCR_DINC_MASK) - -#define DMA_DCR_SSIZE_MASK (0x300000U) -#define DMA_DCR_SSIZE_SHIFT (20U) -/*! SSIZE - Source Size - * 0b00..32-bit - * 0b01..8-bit - * 0b10..16-bit - * 0b11..Reserved (generates a configuration error (DSRn[CE]) if incorrectly specified at time of channel activation) - */ -#define DMA_DCR_SSIZE(x) (((uint32_t)(((uint32_t)(x)) << DMA_DCR_SSIZE_SHIFT)) & DMA_DCR_SSIZE_MASK) - -#define DMA_DCR_SINC_MASK (0x400000U) -#define DMA_DCR_SINC_SHIFT (22U) -/*! SINC - Source Increment - * 0b0..No change to SAR after a successful transfer. - * 0b1..The SAR increments by 1, 2, 4 as determined by the transfer size. - */ -#define DMA_DCR_SINC(x) (((uint32_t)(((uint32_t)(x)) << DMA_DCR_SINC_SHIFT)) & DMA_DCR_SINC_MASK) - -#define DMA_DCR_EADREQ_MASK (0x800000U) -#define DMA_DCR_EADREQ_SHIFT (23U) -/*! EADREQ - Enable asynchronous DMA requests - * 0b0..Disabled - * 0b1..Enabled - */ -#define DMA_DCR_EADREQ(x) (((uint32_t)(((uint32_t)(x)) << DMA_DCR_EADREQ_SHIFT)) & DMA_DCR_EADREQ_MASK) - -#define DMA_DCR_AA_MASK (0x10000000U) -#define DMA_DCR_AA_SHIFT (28U) -/*! AA - Auto-align - * 0b0..Auto-align disabled - * 0b1..If SSIZE indicates a transfer no smaller than DSIZE, source accesses are auto-aligned; otherwise, - * destination accesses are auto-aligned. Source alignment takes precedence over destination alignment. If - * auto-alignment is enabled, the appropriate address register increments, regardless of DINC or SINC. - */ -#define DMA_DCR_AA(x) (((uint32_t)(((uint32_t)(x)) << DMA_DCR_AA_SHIFT)) & DMA_DCR_AA_MASK) - -#define DMA_DCR_CS_MASK (0x20000000U) -#define DMA_DCR_CS_SHIFT (29U) -/*! CS - Cycle Steal - * 0b0..DMA continuously makes read/write transfers until the BCR decrements to 0. - * 0b1..Forces a single read/write transfer per request. - */ -#define DMA_DCR_CS(x) (((uint32_t)(((uint32_t)(x)) << DMA_DCR_CS_SHIFT)) & DMA_DCR_CS_MASK) - -#define DMA_DCR_ERQ_MASK (0x40000000U) -#define DMA_DCR_ERQ_SHIFT (30U) -/*! ERQ - Enable Peripheral Request - * 0b0..Peripheral request is ignored. - * 0b1..Enables peripheral request to initiate transfer. A software-initiated request (setting START) is always enabled. - */ -#define DMA_DCR_ERQ(x) (((uint32_t)(((uint32_t)(x)) << DMA_DCR_ERQ_SHIFT)) & DMA_DCR_ERQ_MASK) - -#define DMA_DCR_EINT_MASK (0x80000000U) -#define DMA_DCR_EINT_SHIFT (31U) -/*! EINT - Enable Interrupt on Completion of Transfer - * 0b0..No interrupt is generated. - * 0b1..Interrupt signal is enabled. - */ -#define DMA_DCR_EINT(x) (((uint32_t)(((uint32_t)(x)) << DMA_DCR_EINT_SHIFT)) & DMA_DCR_EINT_MASK) -/*! @} */ - -/* The count of DMA_DCR */ -#define DMA_DCR_COUNT (4U) - - -/*! - * @} - */ /* end of group DMA_Register_Masks */ - - -/* DMA - Peripheral instance base addresses */ -/** Peripheral DMA base address */ -#define DMA_BASE (0x40008000u) -/** Peripheral DMA base pointer */ -#define DMA0 ((DMA_Type *)DMA_BASE) -/** Array initializer of DMA peripheral base addresses */ -#define DMA_BASE_ADDRS { DMA_BASE } -/** Array initializer of DMA peripheral base pointers */ -#define DMA_BASE_PTRS { DMA0 } -/** Interrupt vectors for the DMA peripheral type */ -#define DMA_CHN_IRQS { { DMA0_IRQn, DMA1_IRQn, DMA2_IRQn, DMA3_IRQn } } - -/*! - * @} - */ /* end of group DMA_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- DMAMUX Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DMAMUX_Peripheral_Access_Layer DMAMUX Peripheral Access Layer - * @{ - */ - -/** DMAMUX - Register Layout Typedef */ -typedef struct { - __IO uint8_t CHCFG[4]; /**< Channel Configuration register, array offset: 0x0, array step: 0x1 */ -} DMAMUX_Type; - -/* ---------------------------------------------------------------------------- - -- DMAMUX Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DMAMUX_Register_Masks DMAMUX Register Masks - * @{ - */ - -/*! @name CHCFG - Channel Configuration register */ -/*! @{ */ - -#define DMAMUX_CHCFG_SOURCE_MASK (0x3FU) -#define DMAMUX_CHCFG_SOURCE_SHIFT (0U) -/*! SOURCE - DMA Channel Source (Slot) - * 0b000000..Disable_Signal - * 0b000010..LPUART0_Rx_Signal - * 0b000011..LPUART0_Tx_Signal - * 0b000100..LPUART1_Rx_Signal - * 0b000101..LPUART1_Tx_Signal - * 0b000110..UART2_Rx_Signal - * 0b000111..UART2_Tx_Signal - * 0b001010..FlexIO_Channel0_Signal - * 0b001011..FlexIO_Channel1_Signal - * 0b001100..FlexIO_Channel2_Signal - * 0b001101..FlexIO_Channel3_Signal - * 0b001110..I2S0_Rx_Signal - * 0b001111..I2S0_Tx_Signal - * 0b010000..SPI0_Rx_Signal - * 0b010001..SPI0_Tx_Signal - * 0b010010..SPI1_Rx_Signal - * 0b010011..SPI1_Tx_Signal - * 0b010110..I2C0_Signal - * 0b010111..I2C1_Signal - * 0b011000..TPM0_Channel0_Signal - * 0b011001..TPM0_Channel1_Signal - * 0b011010..TPM0_Channel2_Signal - * 0b011011..TPM0_Channel3_Signal - * 0b011100..TPM0_Channel4_Signal - * 0b011101..TPM0_Channel5_Signal - * 0b100000..TPM1_Channel0_Signal - * 0b100001..TPM1_Channel1_Signal - * 0b100010..TPM2_Channel0_Signal - * 0b100011..TPM2_Channel1_Signal - * 0b101000..ADC0_Signal - * 0b101010..CMP0_Signal - * 0b101101..DAC0_Signal - * 0b110001..Port_A_Signal - * 0b110011..Port_C_Signal - * 0b110100..Port_D_Signal - * 0b110110..TPM0_Overflow_Signal - * 0b110111..TPM1_Overflow_Signal - * 0b111000..TPM2_Overflow_Signal - * 0b111100..AlwaysOn60_Signal - * 0b111101..AlwaysOn61_Signal - * 0b111110..AlwaysOn62_Signal - * 0b111111..AlwaysOn63_Signal - */ -#define DMAMUX_CHCFG_SOURCE(x) (((uint8_t)(((uint8_t)(x)) << DMAMUX_CHCFG_SOURCE_SHIFT)) & DMAMUX_CHCFG_SOURCE_MASK) - -#define DMAMUX_CHCFG_TRIG_MASK (0x40U) -#define DMAMUX_CHCFG_TRIG_SHIFT (6U) -/*! TRIG - DMA Channel Trigger Enable - * 0b0..Triggering is disabled. If triggering is disabled and ENBL is set, the DMA Channel will simply route the - * specified source to the DMA channel. (Normal mode) - * 0b1..Triggering is enabled. If triggering is enabled and ENBL is set, the DMAMUX is in Periodic Trigger mode. - */ -#define DMAMUX_CHCFG_TRIG(x) (((uint8_t)(((uint8_t)(x)) << DMAMUX_CHCFG_TRIG_SHIFT)) & DMAMUX_CHCFG_TRIG_MASK) - -#define DMAMUX_CHCFG_ENBL_MASK (0x80U) -#define DMAMUX_CHCFG_ENBL_SHIFT (7U) -/*! ENBL - DMA Channel Enable - * 0b0..DMA channel is disabled. This mode is primarily used during configuration of the DMAMux. The DMA has - * separate channel enables/disables, which should be used to disable or reconfigure a DMA channel. - * 0b1..DMA channel is enabled - */ -#define DMAMUX_CHCFG_ENBL(x) (((uint8_t)(((uint8_t)(x)) << DMAMUX_CHCFG_ENBL_SHIFT)) & DMAMUX_CHCFG_ENBL_MASK) -/*! @} */ - -/* The count of DMAMUX_CHCFG */ -#define DMAMUX_CHCFG_COUNT (4U) - - -/*! - * @} - */ /* end of group DMAMUX_Register_Masks */ - - -/* DMAMUX - Peripheral instance base addresses */ -/** Peripheral DMAMUX0 base address */ -#define DMAMUX0_BASE (0x40021000u) -/** Peripheral DMAMUX0 base pointer */ -#define DMAMUX0 ((DMAMUX_Type *)DMAMUX0_BASE) -/** Array initializer of DMAMUX peripheral base addresses */ -#define DMAMUX_BASE_ADDRS { DMAMUX0_BASE } -/** Array initializer of DMAMUX peripheral base pointers */ -#define DMAMUX_BASE_PTRS { DMAMUX0 } - -/*! - * @} - */ /* end of group DMAMUX_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- FGPIO Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FGPIO_Peripheral_Access_Layer FGPIO Peripheral Access Layer - * @{ - */ - -/** FGPIO - Register Layout Typedef */ -typedef struct { - __IO uint32_t PDOR; /**< Port Data Output Register, offset: 0x0 */ - __O uint32_t PSOR; /**< Port Set Output Register, offset: 0x4 */ - __O uint32_t PCOR; /**< Port Clear Output Register, offset: 0x8 */ - __O uint32_t PTOR; /**< Port Toggle Output Register, offset: 0xC */ - __I uint32_t PDIR; /**< Port Data Input Register, offset: 0x10 */ - __IO uint32_t PDDR; /**< Port Data Direction Register, offset: 0x14 */ -} FGPIO_Type; - -/* ---------------------------------------------------------------------------- - -- FGPIO Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FGPIO_Register_Masks FGPIO Register Masks - * @{ - */ - -/*! @name PDOR - Port Data Output Register */ -/*! @{ */ - -#define FGPIO_PDOR_PDO_MASK (0xFFFFFFFFU) -#define FGPIO_PDOR_PDO_SHIFT (0U) -/*! PDO - Port Data Output - * 0b00000000000000000000000000000000..Logic level 0 is driven on pin, provided pin is configured for general-purpose output. - * 0b00000000000000000000000000000001..Logic level 1 is driven on pin, provided pin is configured for general-purpose output. - */ -#define FGPIO_PDOR_PDO(x) (((uint32_t)(((uint32_t)(x)) << FGPIO_PDOR_PDO_SHIFT)) & FGPIO_PDOR_PDO_MASK) -/*! @} */ - -/*! @name PSOR - Port Set Output Register */ -/*! @{ */ - -#define FGPIO_PSOR_PTSO_MASK (0xFFFFFFFFU) -#define FGPIO_PSOR_PTSO_SHIFT (0U) -/*! PTSO - Port Set Output - * 0b00000000000000000000000000000000..Corresponding bit in PDORn does not change. - * 0b00000000000000000000000000000001..Corresponding bit in PDORn is set to logic 1. - */ -#define FGPIO_PSOR_PTSO(x) (((uint32_t)(((uint32_t)(x)) << FGPIO_PSOR_PTSO_SHIFT)) & FGPIO_PSOR_PTSO_MASK) -/*! @} */ - -/*! @name PCOR - Port Clear Output Register */ -/*! @{ */ - -#define FGPIO_PCOR_PTCO_MASK (0xFFFFFFFFU) -#define FGPIO_PCOR_PTCO_SHIFT (0U) -/*! PTCO - Port Clear Output - * 0b00000000000000000000000000000000..Corresponding bit in PDORn does not change. - * 0b00000000000000000000000000000001..Corresponding bit in PDORn is cleared to logic 0. - */ -#define FGPIO_PCOR_PTCO(x) (((uint32_t)(((uint32_t)(x)) << FGPIO_PCOR_PTCO_SHIFT)) & FGPIO_PCOR_PTCO_MASK) -/*! @} */ - -/*! @name PTOR - Port Toggle Output Register */ -/*! @{ */ - -#define FGPIO_PTOR_PTTO_MASK (0xFFFFFFFFU) -#define FGPIO_PTOR_PTTO_SHIFT (0U) -/*! PTTO - Port Toggle Output - * 0b00000000000000000000000000000000..Corresponding bit in PDORn does not change. - * 0b00000000000000000000000000000001..Corresponding bit in PDORn is set to the inverse of its existing logic state. - */ -#define FGPIO_PTOR_PTTO(x) (((uint32_t)(((uint32_t)(x)) << FGPIO_PTOR_PTTO_SHIFT)) & FGPIO_PTOR_PTTO_MASK) -/*! @} */ - -/*! @name PDIR - Port Data Input Register */ -/*! @{ */ - -#define FGPIO_PDIR_PDI_MASK (0xFFFFFFFFU) -#define FGPIO_PDIR_PDI_SHIFT (0U) -/*! PDI - Port Data Input - * 0b00000000000000000000000000000000..Pin logic level is logic 0, or is not configured for use by digital function. - * 0b00000000000000000000000000000001..Pin logic level is logic 1. - */ -#define FGPIO_PDIR_PDI(x) (((uint32_t)(((uint32_t)(x)) << FGPIO_PDIR_PDI_SHIFT)) & FGPIO_PDIR_PDI_MASK) -/*! @} */ - -/*! @name PDDR - Port Data Direction Register */ -/*! @{ */ - -#define FGPIO_PDDR_PDD_MASK (0xFFFFFFFFU) -#define FGPIO_PDDR_PDD_SHIFT (0U) -/*! PDD - Port Data Direction - * 0b00000000000000000000000000000000..Pin is configured as general-purpose input, for the GPIO function. - * 0b00000000000000000000000000000001..Pin is configured as general-purpose output, for the GPIO function. - */ -#define FGPIO_PDDR_PDD(x) (((uint32_t)(((uint32_t)(x)) << FGPIO_PDDR_PDD_SHIFT)) & FGPIO_PDDR_PDD_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group FGPIO_Register_Masks */ - - -/* FGPIO - Peripheral instance base addresses */ -/** Peripheral FGPIOA base address */ -#define FGPIOA_BASE (0xF8000000u) -/** Peripheral FGPIOA base pointer */ -#define FGPIOA ((FGPIO_Type *)FGPIOA_BASE) -/** Peripheral FGPIOB base address */ -#define FGPIOB_BASE (0xF8000040u) -/** Peripheral FGPIOB base pointer */ -#define FGPIOB ((FGPIO_Type *)FGPIOB_BASE) -/** Peripheral FGPIOC base address */ -#define FGPIOC_BASE (0xF8000080u) -/** Peripheral FGPIOC base pointer */ -#define FGPIOC ((FGPIO_Type *)FGPIOC_BASE) -/** Peripheral FGPIOD base address */ -#define FGPIOD_BASE (0xF80000C0u) -/** Peripheral FGPIOD base pointer */ -#define FGPIOD ((FGPIO_Type *)FGPIOD_BASE) -/** Peripheral FGPIOE base address */ -#define FGPIOE_BASE (0xF8000100u) -/** Peripheral FGPIOE base pointer */ -#define FGPIOE ((FGPIO_Type *)FGPIOE_BASE) -/** Array initializer of FGPIO peripheral base addresses */ -#define FGPIO_BASE_ADDRS { FGPIOA_BASE, FGPIOB_BASE, FGPIOC_BASE, FGPIOD_BASE, FGPIOE_BASE } -/** Array initializer of FGPIO peripheral base pointers */ -#define FGPIO_BASE_PTRS { FGPIOA, FGPIOB, FGPIOC, FGPIOD, FGPIOE } - -/*! - * @} - */ /* end of group FGPIO_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- FLEXIO Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FLEXIO_Peripheral_Access_Layer FLEXIO Peripheral Access Layer - * @{ - */ - -/** FLEXIO - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID Register, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter Register, offset: 0x4 */ - __IO uint32_t CTRL; /**< FlexIO Control Register, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __IO uint32_t SHIFTSTAT; /**< Shifter Status Register, offset: 0x10 */ - __IO uint32_t SHIFTERR; /**< Shifter Error Register, offset: 0x14 */ - __IO uint32_t TIMSTAT; /**< Timer Status Register, offset: 0x18 */ - uint8_t RESERVED_1[4]; - __IO uint32_t SHIFTSIEN; /**< Shifter Status Interrupt Enable, offset: 0x20 */ - __IO uint32_t SHIFTEIEN; /**< Shifter Error Interrupt Enable, offset: 0x24 */ - __IO uint32_t TIMIEN; /**< Timer Interrupt Enable Register, offset: 0x28 */ - uint8_t RESERVED_2[4]; - __IO uint32_t SHIFTSDEN; /**< Shifter Status DMA Enable, offset: 0x30 */ - uint8_t RESERVED_3[76]; - __IO uint32_t SHIFTCTL[4]; /**< Shifter Control N Register, array offset: 0x80, array step: 0x4 */ - uint8_t RESERVED_4[112]; - __IO uint32_t SHIFTCFG[4]; /**< Shifter Configuration N Register, array offset: 0x100, array step: 0x4 */ - uint8_t RESERVED_5[240]; - __IO uint32_t SHIFTBUF[4]; /**< Shifter Buffer N Register, array offset: 0x200, array step: 0x4 */ - uint8_t RESERVED_6[112]; - __IO uint32_t SHIFTBUFBIS[4]; /**< Shifter Buffer N Bit Swapped Register, array offset: 0x280, array step: 0x4 */ - uint8_t RESERVED_7[112]; - __IO uint32_t SHIFTBUFBYS[4]; /**< Shifter Buffer N Byte Swapped Register, array offset: 0x300, array step: 0x4 */ - uint8_t RESERVED_8[112]; - __IO uint32_t SHIFTBUFBBS[4]; /**< Shifter Buffer N Bit Byte Swapped Register, array offset: 0x380, array step: 0x4 */ - uint8_t RESERVED_9[112]; - __IO uint32_t TIMCTL[4]; /**< Timer Control N Register, array offset: 0x400, array step: 0x4 */ - uint8_t RESERVED_10[112]; - __IO uint32_t TIMCFG[4]; /**< Timer Configuration N Register, array offset: 0x480, array step: 0x4 */ - uint8_t RESERVED_11[112]; - __IO uint32_t TIMCMP[4]; /**< Timer Compare N Register, array offset: 0x500, array step: 0x4 */ -} FLEXIO_Type; - -/* ---------------------------------------------------------------------------- - -- FLEXIO Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FLEXIO_Register_Masks FLEXIO Register Masks - * @{ - */ - -/*! @name VERID - Version ID Register */ -/*! @{ */ - -#define FLEXIO_VERID_FEATURE_MASK (0xFFFFU) -#define FLEXIO_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Standard features implemented. - * 0b0000000000000001..Supports state, logic and parallel modes. - */ -#define FLEXIO_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_VERID_FEATURE_SHIFT)) & FLEXIO_VERID_FEATURE_MASK) - -#define FLEXIO_VERID_MINOR_MASK (0xFF0000U) -#define FLEXIO_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define FLEXIO_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_VERID_MINOR_SHIFT)) & FLEXIO_VERID_MINOR_MASK) - -#define FLEXIO_VERID_MAJOR_MASK (0xFF000000U) -#define FLEXIO_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define FLEXIO_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_VERID_MAJOR_SHIFT)) & FLEXIO_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter Register */ -/*! @{ */ - -#define FLEXIO_PARAM_SHIFTER_MASK (0xFFU) -#define FLEXIO_PARAM_SHIFTER_SHIFT (0U) -/*! SHIFTER - Shifter Number */ -#define FLEXIO_PARAM_SHIFTER(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PARAM_SHIFTER_SHIFT)) & FLEXIO_PARAM_SHIFTER_MASK) - -#define FLEXIO_PARAM_TIMER_MASK (0xFF00U) -#define FLEXIO_PARAM_TIMER_SHIFT (8U) -/*! TIMER - Timer Number */ -#define FLEXIO_PARAM_TIMER(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PARAM_TIMER_SHIFT)) & FLEXIO_PARAM_TIMER_MASK) - -#define FLEXIO_PARAM_PIN_MASK (0xFF0000U) -#define FLEXIO_PARAM_PIN_SHIFT (16U) -/*! PIN - Pin Number */ -#define FLEXIO_PARAM_PIN(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PARAM_PIN_SHIFT)) & FLEXIO_PARAM_PIN_MASK) - -#define FLEXIO_PARAM_TRIGGER_MASK (0xFF000000U) -#define FLEXIO_PARAM_TRIGGER_SHIFT (24U) -/*! TRIGGER - Trigger Number */ -#define FLEXIO_PARAM_TRIGGER(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PARAM_TRIGGER_SHIFT)) & FLEXIO_PARAM_TRIGGER_MASK) -/*! @} */ - -/*! @name CTRL - FlexIO Control Register */ -/*! @{ */ - -#define FLEXIO_CTRL_FLEXEN_MASK (0x1U) -#define FLEXIO_CTRL_FLEXEN_SHIFT (0U) -/*! FLEXEN - FlexIO Enable - * 0b0..FlexIO module is disabled. - * 0b1..FlexIO module is enabled. - */ -#define FLEXIO_CTRL_FLEXEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_CTRL_FLEXEN_SHIFT)) & FLEXIO_CTRL_FLEXEN_MASK) - -#define FLEXIO_CTRL_SWRST_MASK (0x2U) -#define FLEXIO_CTRL_SWRST_SHIFT (1U) -/*! SWRST - Software Reset - * 0b0..Software reset is disabled - * 0b1..Software reset is enabled, all FlexIO registers except the Control Register are reset. - */ -#define FLEXIO_CTRL_SWRST(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_CTRL_SWRST_SHIFT)) & FLEXIO_CTRL_SWRST_MASK) - -#define FLEXIO_CTRL_FASTACC_MASK (0x4U) -#define FLEXIO_CTRL_FASTACC_SHIFT (2U) -/*! FASTACC - Fast Access - * 0b0..Configures for normal register accesses to FlexIO - * 0b1..Configures for fast register accesses to FlexIO - */ -#define FLEXIO_CTRL_FASTACC(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_CTRL_FASTACC_SHIFT)) & FLEXIO_CTRL_FASTACC_MASK) - -#define FLEXIO_CTRL_DBGE_MASK (0x40000000U) -#define FLEXIO_CTRL_DBGE_SHIFT (30U) -/*! DBGE - Debug Enable - * 0b0..FlexIO is disabled in debug modes. - * 0b1..FlexIO is enabled in debug modes - */ -#define FLEXIO_CTRL_DBGE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_CTRL_DBGE_SHIFT)) & FLEXIO_CTRL_DBGE_MASK) - -#define FLEXIO_CTRL_DOZEN_MASK (0x80000000U) -#define FLEXIO_CTRL_DOZEN_SHIFT (31U) -/*! DOZEN - Doze Enable - * 0b0..FlexIO enabled in Doze modes. - * 0b1..FlexIO disabled in Doze modes. - */ -#define FLEXIO_CTRL_DOZEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_CTRL_DOZEN_SHIFT)) & FLEXIO_CTRL_DOZEN_MASK) -/*! @} */ - -/*! @name SHIFTSTAT - Shifter Status Register */ -/*! @{ */ - -#define FLEXIO_SHIFTSTAT_SSF_MASK (0xFU) -#define FLEXIO_SHIFTSTAT_SSF_SHIFT (0U) -/*! SSF - Shifter Status Flag - * 0b0000..Status flag is clear - * 0b0001..Status flag is set - */ -#define FLEXIO_SHIFTSTAT_SSF(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTSTAT_SSF_SHIFT)) & FLEXIO_SHIFTSTAT_SSF_MASK) -/*! @} */ - -/*! @name SHIFTERR - Shifter Error Register */ -/*! @{ */ - -#define FLEXIO_SHIFTERR_SEF_MASK (0xFU) -#define FLEXIO_SHIFTERR_SEF_SHIFT (0U) -/*! SEF - Shifter Error Flags - * 0b0000..Shifter Error Flag is clear - * 0b0001..Shifter Error Flag is set - */ -#define FLEXIO_SHIFTERR_SEF(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTERR_SEF_SHIFT)) & FLEXIO_SHIFTERR_SEF_MASK) -/*! @} */ - -/*! @name TIMSTAT - Timer Status Register */ -/*! @{ */ - -#define FLEXIO_TIMSTAT_TSF_MASK (0xFU) -#define FLEXIO_TIMSTAT_TSF_SHIFT (0U) -/*! TSF - Timer Status Flags - * 0b0000..Timer Status Flag is clear - * 0b0001..Timer Status Flag is set - */ -#define FLEXIO_TIMSTAT_TSF(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMSTAT_TSF_SHIFT)) & FLEXIO_TIMSTAT_TSF_MASK) -/*! @} */ - -/*! @name SHIFTSIEN - Shifter Status Interrupt Enable */ -/*! @{ */ - -#define FLEXIO_SHIFTSIEN_SSIE_MASK (0xFU) -#define FLEXIO_SHIFTSIEN_SSIE_SHIFT (0U) -/*! SSIE - Shifter Status Interrupt Enable - * 0b0000..Shifter Status Flag interrupt disabled - * 0b0001..Shifter Status Flag interrupt enabled - */ -#define FLEXIO_SHIFTSIEN_SSIE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTSIEN_SSIE_SHIFT)) & FLEXIO_SHIFTSIEN_SSIE_MASK) -/*! @} */ - -/*! @name SHIFTEIEN - Shifter Error Interrupt Enable */ -/*! @{ */ - -#define FLEXIO_SHIFTEIEN_SEIE_MASK (0xFU) -#define FLEXIO_SHIFTEIEN_SEIE_SHIFT (0U) -/*! SEIE - Shifter Error Interrupt Enable - * 0b0000..Shifter Error Flag interrupt disabled - * 0b0001..Shifter Error Flag interrupt enabled - */ -#define FLEXIO_SHIFTEIEN_SEIE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTEIEN_SEIE_SHIFT)) & FLEXIO_SHIFTEIEN_SEIE_MASK) -/*! @} */ - -/*! @name TIMIEN - Timer Interrupt Enable Register */ -/*! @{ */ - -#define FLEXIO_TIMIEN_TEIE_MASK (0xFU) -#define FLEXIO_TIMIEN_TEIE_SHIFT (0U) -/*! TEIE - Timer Status Interrupt Enable - * 0b0000..Timer Status Flag interrupt is disabled - * 0b0001..Timer Status Flag interrupt is enabled - */ -#define FLEXIO_TIMIEN_TEIE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMIEN_TEIE_SHIFT)) & FLEXIO_TIMIEN_TEIE_MASK) -/*! @} */ - -/*! @name SHIFTSDEN - Shifter Status DMA Enable */ -/*! @{ */ - -#define FLEXIO_SHIFTSDEN_SSDE_MASK (0xFU) -#define FLEXIO_SHIFTSDEN_SSDE_SHIFT (0U) -/*! SSDE - Shifter Status DMA Enable - * 0b0000..Shifter Status Flag DMA request is disabled - * 0b0001..Shifter Status Flag DMA request is enabled - */ -#define FLEXIO_SHIFTSDEN_SSDE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTSDEN_SSDE_SHIFT)) & FLEXIO_SHIFTSDEN_SSDE_MASK) -/*! @} */ - -/*! @name SHIFTCTL - Shifter Control N Register */ -/*! @{ */ - -#define FLEXIO_SHIFTCTL_SMOD_MASK (0x7U) -#define FLEXIO_SHIFTCTL_SMOD_SHIFT (0U) -/*! SMOD - Shifter Mode - * 0b000..Disabled. - * 0b001..Receive mode. Captures the current Shifter content into the SHIFTBUF on expiration of the Timer. - * 0b010..Transmit mode. Load SHIFTBUF contents into the Shifter on expiration of the Timer. - * 0b011..Reserved. - * 0b100..Match Store mode. Shifter data is compared to SHIFTBUF content on expiration of the Timer. - * 0b101..Match Continuous mode. Shifter data is continuously compared to SHIFTBUF contents. - * 0b110..Reserved. - * 0b111..Reserved. - */ -#define FLEXIO_SHIFTCTL_SMOD(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCTL_SMOD_SHIFT)) & FLEXIO_SHIFTCTL_SMOD_MASK) - -#define FLEXIO_SHIFTCTL_PINPOL_MASK (0x80U) -#define FLEXIO_SHIFTCTL_PINPOL_SHIFT (7U) -/*! PINPOL - Shifter Pin Polarity - * 0b0..Pin is active high - * 0b1..Pin is active low - */ -#define FLEXIO_SHIFTCTL_PINPOL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCTL_PINPOL_SHIFT)) & FLEXIO_SHIFTCTL_PINPOL_MASK) - -#define FLEXIO_SHIFTCTL_PINSEL_MASK (0x700U) -#define FLEXIO_SHIFTCTL_PINSEL_SHIFT (8U) -/*! PINSEL - Shifter Pin Select */ -#define FLEXIO_SHIFTCTL_PINSEL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCTL_PINSEL_SHIFT)) & FLEXIO_SHIFTCTL_PINSEL_MASK) - -#define FLEXIO_SHIFTCTL_PINCFG_MASK (0x30000U) -#define FLEXIO_SHIFTCTL_PINCFG_SHIFT (16U) -/*! PINCFG - Shifter Pin Configuration - * 0b00..Shifter pin output disabled - * 0b01..Shifter pin open drain or bidirectional output enable - * 0b10..Shifter pin bidirectional output data - * 0b11..Shifter pin output - */ -#define FLEXIO_SHIFTCTL_PINCFG(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCTL_PINCFG_SHIFT)) & FLEXIO_SHIFTCTL_PINCFG_MASK) - -#define FLEXIO_SHIFTCTL_TIMPOL_MASK (0x800000U) -#define FLEXIO_SHIFTCTL_TIMPOL_SHIFT (23U) -/*! TIMPOL - Timer Polarity - * 0b0..Shift on posedge of Shift clock - * 0b1..Shift on negedge of Shift clock - */ -#define FLEXIO_SHIFTCTL_TIMPOL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCTL_TIMPOL_SHIFT)) & FLEXIO_SHIFTCTL_TIMPOL_MASK) - -#define FLEXIO_SHIFTCTL_TIMSEL_MASK (0x3000000U) -#define FLEXIO_SHIFTCTL_TIMSEL_SHIFT (24U) -/*! TIMSEL - Timer Select */ -#define FLEXIO_SHIFTCTL_TIMSEL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCTL_TIMSEL_SHIFT)) & FLEXIO_SHIFTCTL_TIMSEL_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTCTL */ -#define FLEXIO_SHIFTCTL_COUNT (4U) - -/*! @name SHIFTCFG - Shifter Configuration N Register */ -/*! @{ */ - -#define FLEXIO_SHIFTCFG_SSTART_MASK (0x3U) -#define FLEXIO_SHIFTCFG_SSTART_SHIFT (0U) -/*! SSTART - Shifter Start bit - * 0b00..Start bit disabled for transmitter/receiver/match store, transmitter loads data on enable - * 0b01..Start bit disabled for transmitter/receiver/match store, transmitter loads data on first shift - * 0b10..Transmitter outputs start bit value 0 before loading data on first shift, receiver/match store sets error flag if start bit is not 0 - * 0b11..Transmitter outputs start bit value 1 before loading data on first shift, receiver/match store sets error flag if start bit is not 1 - */ -#define FLEXIO_SHIFTCFG_SSTART(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCFG_SSTART_SHIFT)) & FLEXIO_SHIFTCFG_SSTART_MASK) - -#define FLEXIO_SHIFTCFG_SSTOP_MASK (0x30U) -#define FLEXIO_SHIFTCFG_SSTOP_SHIFT (4U) -/*! SSTOP - Shifter Stop bit - * 0b00..Stop bit disabled for transmitter/receiver/match store - * 0b01..Reserved for transmitter/receiver/match store - * 0b10..Transmitter outputs stop bit value 0 on store, receiver/match store sets error flag if stop bit is not 0 - * 0b11..Transmitter outputs stop bit value 1 on store, receiver/match store sets error flag if stop bit is not 1 - */ -#define FLEXIO_SHIFTCFG_SSTOP(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCFG_SSTOP_SHIFT)) & FLEXIO_SHIFTCFG_SSTOP_MASK) - -#define FLEXIO_SHIFTCFG_INSRC_MASK (0x100U) -#define FLEXIO_SHIFTCFG_INSRC_SHIFT (8U) -/*! INSRC - Input Source - * 0b0..Pin - * 0b1..Shifter N+1 Output - */ -#define FLEXIO_SHIFTCFG_INSRC(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCFG_INSRC_SHIFT)) & FLEXIO_SHIFTCFG_INSRC_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTCFG */ -#define FLEXIO_SHIFTCFG_COUNT (4U) - -/*! @name SHIFTBUF - Shifter Buffer N Register */ -/*! @{ */ - -#define FLEXIO_SHIFTBUF_SHIFTBUF_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUF_SHIFTBUF_SHIFT (0U) -/*! SHIFTBUF - Shift Buffer */ -#define FLEXIO_SHIFTBUF_SHIFTBUF(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUF_SHIFTBUF_SHIFT)) & FLEXIO_SHIFTBUF_SHIFTBUF_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUF */ -#define FLEXIO_SHIFTBUF_COUNT (4U) - -/*! @name SHIFTBUFBIS - Shifter Buffer N Bit Swapped Register */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFBIS_SHIFTBUFBIS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFBIS_SHIFTBUFBIS_SHIFT (0U) -/*! SHIFTBUFBIS - Shift Buffer */ -#define FLEXIO_SHIFTBUFBIS_SHIFTBUFBIS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFBIS_SHIFTBUFBIS_SHIFT)) & FLEXIO_SHIFTBUFBIS_SHIFTBUFBIS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFBIS */ -#define FLEXIO_SHIFTBUFBIS_COUNT (4U) - -/*! @name SHIFTBUFBYS - Shifter Buffer N Byte Swapped Register */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFBYS_SHIFTBUFBYS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFBYS_SHIFTBUFBYS_SHIFT (0U) -/*! SHIFTBUFBYS - Shift Buffer */ -#define FLEXIO_SHIFTBUFBYS_SHIFTBUFBYS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFBYS_SHIFTBUFBYS_SHIFT)) & FLEXIO_SHIFTBUFBYS_SHIFTBUFBYS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFBYS */ -#define FLEXIO_SHIFTBUFBYS_COUNT (4U) - -/*! @name SHIFTBUFBBS - Shifter Buffer N Bit Byte Swapped Register */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFBBS_SHIFTBUFBBS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFBBS_SHIFTBUFBBS_SHIFT (0U) -/*! SHIFTBUFBBS - Shift Buffer */ -#define FLEXIO_SHIFTBUFBBS_SHIFTBUFBBS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFBBS_SHIFTBUFBBS_SHIFT)) & FLEXIO_SHIFTBUFBBS_SHIFTBUFBBS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFBBS */ -#define FLEXIO_SHIFTBUFBBS_COUNT (4U) - -/*! @name TIMCTL - Timer Control N Register */ -/*! @{ */ - -#define FLEXIO_TIMCTL_TIMOD_MASK (0x3U) -#define FLEXIO_TIMCTL_TIMOD_SHIFT (0U) -/*! TIMOD - Timer Mode - * 0b00..Timer Disabled. - * 0b01..Dual 8-bit counters baud/bit mode. - * 0b10..Dual 8-bit counters PWM mode. - * 0b11..Single 16-bit counter mode. - */ -#define FLEXIO_TIMCTL_TIMOD(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_TIMOD_SHIFT)) & FLEXIO_TIMCTL_TIMOD_MASK) - -#define FLEXIO_TIMCTL_PINPOL_MASK (0x80U) -#define FLEXIO_TIMCTL_PINPOL_SHIFT (7U) -/*! PINPOL - Timer Pin Polarity - * 0b0..Pin is active high - * 0b1..Pin is active low - */ -#define FLEXIO_TIMCTL_PINPOL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_PINPOL_SHIFT)) & FLEXIO_TIMCTL_PINPOL_MASK) - -#define FLEXIO_TIMCTL_PINSEL_MASK (0x700U) -#define FLEXIO_TIMCTL_PINSEL_SHIFT (8U) -/*! PINSEL - Timer Pin Select */ -#define FLEXIO_TIMCTL_PINSEL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_PINSEL_SHIFT)) & FLEXIO_TIMCTL_PINSEL_MASK) - -#define FLEXIO_TIMCTL_PINCFG_MASK (0x30000U) -#define FLEXIO_TIMCTL_PINCFG_SHIFT (16U) -/*! PINCFG - Timer Pin Configuration - * 0b00..Timer pin output disabled - * 0b01..Timer pin open drain or bidirectional output enable - * 0b10..Timer pin bidirectional output data - * 0b11..Timer pin output - */ -#define FLEXIO_TIMCTL_PINCFG(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_PINCFG_SHIFT)) & FLEXIO_TIMCTL_PINCFG_MASK) - -#define FLEXIO_TIMCTL_TRGSRC_MASK (0x400000U) -#define FLEXIO_TIMCTL_TRGSRC_SHIFT (22U) -/*! TRGSRC - Trigger Source - * 0b0..External trigger selected - * 0b1..Internal trigger selected - */ -#define FLEXIO_TIMCTL_TRGSRC(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_TRGSRC_SHIFT)) & FLEXIO_TIMCTL_TRGSRC_MASK) - -#define FLEXIO_TIMCTL_TRGPOL_MASK (0x800000U) -#define FLEXIO_TIMCTL_TRGPOL_SHIFT (23U) -/*! TRGPOL - Trigger Polarity - * 0b0..Trigger active high - * 0b1..Trigger active low - */ -#define FLEXIO_TIMCTL_TRGPOL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_TRGPOL_SHIFT)) & FLEXIO_TIMCTL_TRGPOL_MASK) - -#define FLEXIO_TIMCTL_TRGSEL_MASK (0xF000000U) -#define FLEXIO_TIMCTL_TRGSEL_SHIFT (24U) -/*! TRGSEL - Trigger Select */ -#define FLEXIO_TIMCTL_TRGSEL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_TRGSEL_SHIFT)) & FLEXIO_TIMCTL_TRGSEL_MASK) -/*! @} */ - -/* The count of FLEXIO_TIMCTL */ -#define FLEXIO_TIMCTL_COUNT (4U) - -/*! @name TIMCFG - Timer Configuration N Register */ -/*! @{ */ - -#define FLEXIO_TIMCFG_TSTART_MASK (0x2U) -#define FLEXIO_TIMCFG_TSTART_SHIFT (1U) -/*! TSTART - Timer Start Bit - * 0b0..Start bit disabled - * 0b1..Start bit enabled - */ -#define FLEXIO_TIMCFG_TSTART(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TSTART_SHIFT)) & FLEXIO_TIMCFG_TSTART_MASK) - -#define FLEXIO_TIMCFG_TSTOP_MASK (0x30U) -#define FLEXIO_TIMCFG_TSTOP_SHIFT (4U) -/*! TSTOP - Timer Stop Bit - * 0b00..Stop bit disabled - * 0b01..Stop bit is enabled on timer compare - * 0b10..Stop bit is enabled on timer disable - * 0b11..Stop bit is enabled on timer compare and timer disable - */ -#define FLEXIO_TIMCFG_TSTOP(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TSTOP_SHIFT)) & FLEXIO_TIMCFG_TSTOP_MASK) - -#define FLEXIO_TIMCFG_TIMENA_MASK (0x700U) -#define FLEXIO_TIMCFG_TIMENA_SHIFT (8U) -/*! TIMENA - Timer Enable - * 0b000..Timer always enabled - * 0b001..Timer enabled on Timer N-1 enable - * 0b010..Timer enabled on Trigger high - * 0b011..Timer enabled on Trigger high and Pin high - * 0b100..Timer enabled on Pin rising edge - * 0b101..Timer enabled on Pin rising edge and Trigger high - * 0b110..Timer enabled on Trigger rising edge - * 0b111..Timer enabled on Trigger rising or falling edge - */ -#define FLEXIO_TIMCFG_TIMENA(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TIMENA_SHIFT)) & FLEXIO_TIMCFG_TIMENA_MASK) - -#define FLEXIO_TIMCFG_TIMDIS_MASK (0x7000U) -#define FLEXIO_TIMCFG_TIMDIS_SHIFT (12U) -/*! TIMDIS - Timer Disable - * 0b000..Timer never disabled - * 0b001..Timer disabled on Timer N-1 disable - * 0b010..Timer disabled on Timer compare - * 0b011..Timer disabled on Timer compare and Trigger Low - * 0b100..Timer disabled on Pin rising or falling edge - * 0b101..Timer disabled on Pin rising or falling edge provided Trigger is high - * 0b110..Timer disabled on Trigger falling edge - * 0b111..Reserved - */ -#define FLEXIO_TIMCFG_TIMDIS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TIMDIS_SHIFT)) & FLEXIO_TIMCFG_TIMDIS_MASK) - -#define FLEXIO_TIMCFG_TIMRST_MASK (0x70000U) -#define FLEXIO_TIMCFG_TIMRST_SHIFT (16U) -/*! TIMRST - Timer Reset - * 0b000..Timer never reset - * 0b001..Reserved - * 0b010..Timer reset on Timer Pin equal to Timer Output - * 0b011..Timer reset on Timer Trigger equal to Timer Output - * 0b100..Timer reset on Timer Pin rising edge - * 0b101..Reserved - * 0b110..Timer reset on Trigger rising edge - * 0b111..Timer reset on Trigger rising or falling edge - */ -#define FLEXIO_TIMCFG_TIMRST(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TIMRST_SHIFT)) & FLEXIO_TIMCFG_TIMRST_MASK) - -#define FLEXIO_TIMCFG_TIMDEC_MASK (0x300000U) -#define FLEXIO_TIMCFG_TIMDEC_SHIFT (20U) -/*! TIMDEC - Timer Decrement - * 0b00..Decrement counter on FlexIO clock, Shift clock equals Timer output. - * 0b01..Decrement counter on Trigger input (both edges), Shift clock equals Timer output. - * 0b10..Decrement counter on Pin input (both edges), Shift clock equals Pin input. - * 0b11..Decrement counter on Trigger input (both edges), Shift clock equals Trigger input. - */ -#define FLEXIO_TIMCFG_TIMDEC(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TIMDEC_SHIFT)) & FLEXIO_TIMCFG_TIMDEC_MASK) - -#define FLEXIO_TIMCFG_TIMOUT_MASK (0x3000000U) -#define FLEXIO_TIMCFG_TIMOUT_SHIFT (24U) -/*! TIMOUT - Timer Output - * 0b00..Timer output is logic one when enabled and is not affected by timer reset - * 0b01..Timer output is logic zero when enabled and is not affected by timer reset - * 0b10..Timer output is logic one when enabled and on timer reset - * 0b11..Timer output is logic zero when enabled and on timer reset - */ -#define FLEXIO_TIMCFG_TIMOUT(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TIMOUT_SHIFT)) & FLEXIO_TIMCFG_TIMOUT_MASK) -/*! @} */ - -/* The count of FLEXIO_TIMCFG */ -#define FLEXIO_TIMCFG_COUNT (4U) - -/*! @name TIMCMP - Timer Compare N Register */ -/*! @{ */ - -#define FLEXIO_TIMCMP_CMP_MASK (0xFFFFU) -#define FLEXIO_TIMCMP_CMP_SHIFT (0U) -/*! CMP - Timer Compare Value */ -#define FLEXIO_TIMCMP_CMP(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCMP_CMP_SHIFT)) & FLEXIO_TIMCMP_CMP_MASK) -/*! @} */ - -/* The count of FLEXIO_TIMCMP */ -#define FLEXIO_TIMCMP_COUNT (4U) - - -/*! - * @} - */ /* end of group FLEXIO_Register_Masks */ - - -/* FLEXIO - Peripheral instance base addresses */ -/** Peripheral FLEXIO base address */ -#define FLEXIO_BASE (0x4005F000u) -/** Peripheral FLEXIO base pointer */ -#define FLEXIO ((FLEXIO_Type *)FLEXIO_BASE) -/** Array initializer of FLEXIO peripheral base addresses */ -#define FLEXIO_BASE_ADDRS { FLEXIO_BASE } -/** Array initializer of FLEXIO peripheral base pointers */ -#define FLEXIO_BASE_PTRS { FLEXIO } -/** Interrupt vectors for the FLEXIO peripheral type */ -#define FLEXIO_IRQS { UART2_FLEXIO_IRQn } - -/*! - * @} - */ /* end of group FLEXIO_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- FTFA Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FTFA_Peripheral_Access_Layer FTFA Peripheral Access Layer - * @{ - */ - -/** FTFA - Register Layout Typedef */ -typedef struct { - __IO uint8_t FSTAT; /**< Flash Status Register, offset: 0x0 */ - __IO uint8_t FCNFG; /**< Flash Configuration Register, offset: 0x1 */ - __I uint8_t FSEC; /**< Flash Security Register, offset: 0x2 */ - __I uint8_t FOPT; /**< Flash Option Register, offset: 0x3 */ - __IO uint8_t FCCOB3; /**< Flash Common Command Object Registers, offset: 0x4 */ - __IO uint8_t FCCOB2; /**< Flash Common Command Object Registers, offset: 0x5 */ - __IO uint8_t FCCOB1; /**< Flash Common Command Object Registers, offset: 0x6 */ - __IO uint8_t FCCOB0; /**< Flash Common Command Object Registers, offset: 0x7 */ - __IO uint8_t FCCOB7; /**< Flash Common Command Object Registers, offset: 0x8 */ - __IO uint8_t FCCOB6; /**< Flash Common Command Object Registers, offset: 0x9 */ - __IO uint8_t FCCOB5; /**< Flash Common Command Object Registers, offset: 0xA */ - __IO uint8_t FCCOB4; /**< Flash Common Command Object Registers, offset: 0xB */ - __IO uint8_t FCCOBB; /**< Flash Common Command Object Registers, offset: 0xC */ - __IO uint8_t FCCOBA; /**< Flash Common Command Object Registers, offset: 0xD */ - __IO uint8_t FCCOB9; /**< Flash Common Command Object Registers, offset: 0xE */ - __IO uint8_t FCCOB8; /**< Flash Common Command Object Registers, offset: 0xF */ - __IO uint8_t FPROT3; /**< Program Flash Protection Registers, offset: 0x10 */ - __IO uint8_t FPROT2; /**< Program Flash Protection Registers, offset: 0x11 */ - __IO uint8_t FPROT1; /**< Program Flash Protection Registers, offset: 0x12 */ - __IO uint8_t FPROT0; /**< Program Flash Protection Registers, offset: 0x13 */ -} FTFA_Type; - -/* ---------------------------------------------------------------------------- - -- FTFA Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FTFA_Register_Masks FTFA Register Masks - * @{ - */ - -/*! @name FSTAT - Flash Status Register */ -/*! @{ */ - -#define FTFA_FSTAT_MGSTAT0_MASK (0x1U) -#define FTFA_FSTAT_MGSTAT0_SHIFT (0U) -/*! MGSTAT0 - Memory Controller Command Completion Status Flag */ -#define FTFA_FSTAT_MGSTAT0(x) (((uint8_t)(((uint8_t)(x)) << FTFA_FSTAT_MGSTAT0_SHIFT)) & FTFA_FSTAT_MGSTAT0_MASK) - -#define FTFA_FSTAT_FPVIOL_MASK (0x10U) -#define FTFA_FSTAT_FPVIOL_SHIFT (4U) -/*! FPVIOL - Flash Protection Violation Flag - * 0b0..No protection violation detected - * 0b1..Protection violation detected - */ -#define FTFA_FSTAT_FPVIOL(x) (((uint8_t)(((uint8_t)(x)) << FTFA_FSTAT_FPVIOL_SHIFT)) & FTFA_FSTAT_FPVIOL_MASK) - -#define FTFA_FSTAT_ACCERR_MASK (0x20U) -#define FTFA_FSTAT_ACCERR_SHIFT (5U) -/*! ACCERR - Flash Access Error Flag - * 0b0..No access error detected - * 0b1..Access error detected - */ -#define FTFA_FSTAT_ACCERR(x) (((uint8_t)(((uint8_t)(x)) << FTFA_FSTAT_ACCERR_SHIFT)) & FTFA_FSTAT_ACCERR_MASK) - -#define FTFA_FSTAT_RDCOLERR_MASK (0x40U) -#define FTFA_FSTAT_RDCOLERR_SHIFT (6U) -/*! RDCOLERR - Flash Read Collision Error Flag - * 0b0..No collision error detected - * 0b1..Collision error detected - */ -#define FTFA_FSTAT_RDCOLERR(x) (((uint8_t)(((uint8_t)(x)) << FTFA_FSTAT_RDCOLERR_SHIFT)) & FTFA_FSTAT_RDCOLERR_MASK) - -#define FTFA_FSTAT_CCIF_MASK (0x80U) -#define FTFA_FSTAT_CCIF_SHIFT (7U) -/*! CCIF - Command Complete Interrupt Flag - * 0b0..Flash command in progress - * 0b1..Flash command has completed - */ -#define FTFA_FSTAT_CCIF(x) (((uint8_t)(((uint8_t)(x)) << FTFA_FSTAT_CCIF_SHIFT)) & FTFA_FSTAT_CCIF_MASK) -/*! @} */ - -/*! @name FCNFG - Flash Configuration Register */ -/*! @{ */ - -#define FTFA_FCNFG_ERSSUSP_MASK (0x10U) -#define FTFA_FCNFG_ERSSUSP_SHIFT (4U) -/*! ERSSUSP - Erase Suspend - * 0b0..No suspend requested - * 0b1..Suspend the current Erase Flash Sector command execution. - */ -#define FTFA_FCNFG_ERSSUSP(x) (((uint8_t)(((uint8_t)(x)) << FTFA_FCNFG_ERSSUSP_SHIFT)) & FTFA_FCNFG_ERSSUSP_MASK) - -#define FTFA_FCNFG_ERSAREQ_MASK (0x20U) -#define FTFA_FCNFG_ERSAREQ_SHIFT (5U) -/*! ERSAREQ - Erase All Request - * 0b0..No request or request complete - * 0b1..Request to: run the Erase All Blocks command, verify the erased state, program the security byte in the - * Flash Configuration Field to the unsecure state, and release MCU security by setting the FSEC[SEC] field to - * the unsecure state. - */ -#define FTFA_FCNFG_ERSAREQ(x) (((uint8_t)(((uint8_t)(x)) << FTFA_FCNFG_ERSAREQ_SHIFT)) & FTFA_FCNFG_ERSAREQ_MASK) - -#define FTFA_FCNFG_RDCOLLIE_MASK (0x40U) -#define FTFA_FCNFG_RDCOLLIE_SHIFT (6U) -/*! RDCOLLIE - Read Collision Error Interrupt Enable - * 0b0..Read collision error interrupt disabled - * 0b1..Read collision error interrupt enabled. An interrupt request is generated whenever a flash memory read - * collision error is detected (see the description of FSTAT[RDCOLERR]). - */ -#define FTFA_FCNFG_RDCOLLIE(x) (((uint8_t)(((uint8_t)(x)) << FTFA_FCNFG_RDCOLLIE_SHIFT)) & FTFA_FCNFG_RDCOLLIE_MASK) - -#define FTFA_FCNFG_CCIE_MASK (0x80U) -#define FTFA_FCNFG_CCIE_SHIFT (7U) -/*! CCIE - Command Complete Interrupt Enable - * 0b0..Command complete interrupt disabled - * 0b1..Command complete interrupt enabled. An interrupt request is generated whenever the FSTAT[CCIF] flag is set. - */ -#define FTFA_FCNFG_CCIE(x) (((uint8_t)(((uint8_t)(x)) << FTFA_FCNFG_CCIE_SHIFT)) & FTFA_FCNFG_CCIE_MASK) -/*! @} */ - -/*! @name FSEC - Flash Security Register */ -/*! @{ */ - -#define FTFA_FSEC_SEC_MASK (0x3U) -#define FTFA_FSEC_SEC_SHIFT (0U) -/*! SEC - Flash Security - * 0b00..MCU security status is secure. - * 0b01..MCU security status is secure. - * 0b10..MCU security status is unsecure. (The standard shipping condition of the flash memory module is unsecure.) - * 0b11..MCU security status is secure. - */ -#define FTFA_FSEC_SEC(x) (((uint8_t)(((uint8_t)(x)) << FTFA_FSEC_SEC_SHIFT)) & FTFA_FSEC_SEC_MASK) - -#define FTFA_FSEC_FSLACC_MASK (0xCU) -#define FTFA_FSEC_FSLACC_SHIFT (2U) -/*! FSLACC - Freescale Failure Analysis Access Code - * 0b00..Freescale factory access granted - * 0b01..Freescale factory access denied - * 0b10..Freescale factory access denied - * 0b11..Freescale factory access granted - */ -#define FTFA_FSEC_FSLACC(x) (((uint8_t)(((uint8_t)(x)) << FTFA_FSEC_FSLACC_SHIFT)) & FTFA_FSEC_FSLACC_MASK) - -#define FTFA_FSEC_MEEN_MASK (0x30U) -#define FTFA_FSEC_MEEN_SHIFT (4U) -/*! MEEN - Mass Erase Enable Bits - * 0b00..Mass erase is enabled - * 0b01..Mass erase is enabled - * 0b10..Mass erase is disabled - * 0b11..Mass erase is enabled - */ -#define FTFA_FSEC_MEEN(x) (((uint8_t)(((uint8_t)(x)) << FTFA_FSEC_MEEN_SHIFT)) & FTFA_FSEC_MEEN_MASK) - -#define FTFA_FSEC_KEYEN_MASK (0xC0U) -#define FTFA_FSEC_KEYEN_SHIFT (6U) -/*! KEYEN - Backdoor Key Security Enable - * 0b00..Backdoor key access disabled - * 0b01..Backdoor key access disabled (preferred KEYEN state to disable backdoor key access) - * 0b10..Backdoor key access enabled - * 0b11..Backdoor key access disabled - */ -#define FTFA_FSEC_KEYEN(x) (((uint8_t)(((uint8_t)(x)) << FTFA_FSEC_KEYEN_SHIFT)) & FTFA_FSEC_KEYEN_MASK) -/*! @} */ - -/*! @name FOPT - Flash Option Register */ -/*! @{ */ - -#define FTFA_FOPT_OPT_MASK (0xFFU) -#define FTFA_FOPT_OPT_SHIFT (0U) -/*! OPT - Nonvolatile Option */ -#define FTFA_FOPT_OPT(x) (((uint8_t)(((uint8_t)(x)) << FTFA_FOPT_OPT_SHIFT)) & FTFA_FOPT_OPT_MASK) -/*! @} */ - -/*! @name FCCOB3 - Flash Common Command Object Registers */ -/*! @{ */ - -#define FTFA_FCCOB3_CCOBn_MASK (0xFFU) -#define FTFA_FCCOB3_CCOBn_SHIFT (0U) -#define FTFA_FCCOB3_CCOBn(x) (((uint8_t)(((uint8_t)(x)) << FTFA_FCCOB3_CCOBn_SHIFT)) & FTFA_FCCOB3_CCOBn_MASK) -/*! @} */ - -/*! @name FCCOB2 - Flash Common Command Object Registers */ -/*! @{ */ - -#define FTFA_FCCOB2_CCOBn_MASK (0xFFU) -#define FTFA_FCCOB2_CCOBn_SHIFT (0U) -#define FTFA_FCCOB2_CCOBn(x) (((uint8_t)(((uint8_t)(x)) << FTFA_FCCOB2_CCOBn_SHIFT)) & FTFA_FCCOB2_CCOBn_MASK) -/*! @} */ - -/*! @name FCCOB1 - Flash Common Command Object Registers */ -/*! @{ */ - -#define FTFA_FCCOB1_CCOBn_MASK (0xFFU) -#define FTFA_FCCOB1_CCOBn_SHIFT (0U) -#define FTFA_FCCOB1_CCOBn(x) (((uint8_t)(((uint8_t)(x)) << FTFA_FCCOB1_CCOBn_SHIFT)) & FTFA_FCCOB1_CCOBn_MASK) -/*! @} */ - -/*! @name FCCOB0 - Flash Common Command Object Registers */ -/*! @{ */ - -#define FTFA_FCCOB0_CCOBn_MASK (0xFFU) -#define FTFA_FCCOB0_CCOBn_SHIFT (0U) -#define FTFA_FCCOB0_CCOBn(x) (((uint8_t)(((uint8_t)(x)) << FTFA_FCCOB0_CCOBn_SHIFT)) & FTFA_FCCOB0_CCOBn_MASK) -/*! @} */ - -/*! @name FCCOB7 - Flash Common Command Object Registers */ -/*! @{ */ - -#define FTFA_FCCOB7_CCOBn_MASK (0xFFU) -#define FTFA_FCCOB7_CCOBn_SHIFT (0U) -#define FTFA_FCCOB7_CCOBn(x) (((uint8_t)(((uint8_t)(x)) << FTFA_FCCOB7_CCOBn_SHIFT)) & FTFA_FCCOB7_CCOBn_MASK) -/*! @} */ - -/*! @name FCCOB6 - Flash Common Command Object Registers */ -/*! @{ */ - -#define FTFA_FCCOB6_CCOBn_MASK (0xFFU) -#define FTFA_FCCOB6_CCOBn_SHIFT (0U) -#define FTFA_FCCOB6_CCOBn(x) (((uint8_t)(((uint8_t)(x)) << FTFA_FCCOB6_CCOBn_SHIFT)) & FTFA_FCCOB6_CCOBn_MASK) -/*! @} */ - -/*! @name FCCOB5 - Flash Common Command Object Registers */ -/*! @{ */ - -#define FTFA_FCCOB5_CCOBn_MASK (0xFFU) -#define FTFA_FCCOB5_CCOBn_SHIFT (0U) -#define FTFA_FCCOB5_CCOBn(x) (((uint8_t)(((uint8_t)(x)) << FTFA_FCCOB5_CCOBn_SHIFT)) & FTFA_FCCOB5_CCOBn_MASK) -/*! @} */ - -/*! @name FCCOB4 - Flash Common Command Object Registers */ -/*! @{ */ - -#define FTFA_FCCOB4_CCOBn_MASK (0xFFU) -#define FTFA_FCCOB4_CCOBn_SHIFT (0U) -#define FTFA_FCCOB4_CCOBn(x) (((uint8_t)(((uint8_t)(x)) << FTFA_FCCOB4_CCOBn_SHIFT)) & FTFA_FCCOB4_CCOBn_MASK) -/*! @} */ - -/*! @name FCCOBB - Flash Common Command Object Registers */ -/*! @{ */ - -#define FTFA_FCCOBB_CCOBn_MASK (0xFFU) -#define FTFA_FCCOBB_CCOBn_SHIFT (0U) -#define FTFA_FCCOBB_CCOBn(x) (((uint8_t)(((uint8_t)(x)) << FTFA_FCCOBB_CCOBn_SHIFT)) & FTFA_FCCOBB_CCOBn_MASK) -/*! @} */ - -/*! @name FCCOBA - Flash Common Command Object Registers */ -/*! @{ */ - -#define FTFA_FCCOBA_CCOBn_MASK (0xFFU) -#define FTFA_FCCOBA_CCOBn_SHIFT (0U) -#define FTFA_FCCOBA_CCOBn(x) (((uint8_t)(((uint8_t)(x)) << FTFA_FCCOBA_CCOBn_SHIFT)) & FTFA_FCCOBA_CCOBn_MASK) -/*! @} */ - -/*! @name FCCOB9 - Flash Common Command Object Registers */ -/*! @{ */ - -#define FTFA_FCCOB9_CCOBn_MASK (0xFFU) -#define FTFA_FCCOB9_CCOBn_SHIFT (0U) -#define FTFA_FCCOB9_CCOBn(x) (((uint8_t)(((uint8_t)(x)) << FTFA_FCCOB9_CCOBn_SHIFT)) & FTFA_FCCOB9_CCOBn_MASK) -/*! @} */ - -/*! @name FCCOB8 - Flash Common Command Object Registers */ -/*! @{ */ - -#define FTFA_FCCOB8_CCOBn_MASK (0xFFU) -#define FTFA_FCCOB8_CCOBn_SHIFT (0U) -#define FTFA_FCCOB8_CCOBn(x) (((uint8_t)(((uint8_t)(x)) << FTFA_FCCOB8_CCOBn_SHIFT)) & FTFA_FCCOB8_CCOBn_MASK) -/*! @} */ - -/*! @name FPROT3 - Program Flash Protection Registers */ -/*! @{ */ - -#define FTFA_FPROT3_PROT_MASK (0xFFU) -#define FTFA_FPROT3_PROT_SHIFT (0U) -/*! PROT - Program Flash Region Protect - * 0b00000000..Program flash region is protected. - * 0b00000001..Program flash region is not protected - */ -#define FTFA_FPROT3_PROT(x) (((uint8_t)(((uint8_t)(x)) << FTFA_FPROT3_PROT_SHIFT)) & FTFA_FPROT3_PROT_MASK) -/*! @} */ - -/*! @name FPROT2 - Program Flash Protection Registers */ -/*! @{ */ - -#define FTFA_FPROT2_PROT_MASK (0xFFU) -#define FTFA_FPROT2_PROT_SHIFT (0U) -/*! PROT - Program Flash Region Protect - * 0b00000000..Program flash region is protected. - * 0b00000001..Program flash region is not protected - */ -#define FTFA_FPROT2_PROT(x) (((uint8_t)(((uint8_t)(x)) << FTFA_FPROT2_PROT_SHIFT)) & FTFA_FPROT2_PROT_MASK) -/*! @} */ - -/*! @name FPROT1 - Program Flash Protection Registers */ -/*! @{ */ - -#define FTFA_FPROT1_PROT_MASK (0xFFU) -#define FTFA_FPROT1_PROT_SHIFT (0U) -/*! PROT - Program Flash Region Protect - * 0b00000000..Program flash region is protected. - * 0b00000001..Program flash region is not protected - */ -#define FTFA_FPROT1_PROT(x) (((uint8_t)(((uint8_t)(x)) << FTFA_FPROT1_PROT_SHIFT)) & FTFA_FPROT1_PROT_MASK) -/*! @} */ - -/*! @name FPROT0 - Program Flash Protection Registers */ -/*! @{ */ - -#define FTFA_FPROT0_PROT_MASK (0xFFU) -#define FTFA_FPROT0_PROT_SHIFT (0U) -/*! PROT - Program Flash Region Protect - * 0b00000000..Program flash region is protected. - * 0b00000001..Program flash region is not protected - */ -#define FTFA_FPROT0_PROT(x) (((uint8_t)(((uint8_t)(x)) << FTFA_FPROT0_PROT_SHIFT)) & FTFA_FPROT0_PROT_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group FTFA_Register_Masks */ - - -/* FTFA - Peripheral instance base addresses */ -/** Peripheral FTFA base address */ -#define FTFA_BASE (0x40020000u) -/** Peripheral FTFA base pointer */ -#define FTFA ((FTFA_Type *)FTFA_BASE) -/** Array initializer of FTFA peripheral base addresses */ -#define FTFA_BASE_ADDRS { FTFA_BASE } -/** Array initializer of FTFA peripheral base pointers */ -#define FTFA_BASE_PTRS { FTFA } -/** Interrupt vectors for the FTFA peripheral type */ -#define FTFA_COMMAND_COMPLETE_IRQS { FTFA_IRQn } - -/*! - * @} - */ /* end of group FTFA_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- GPIO Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup GPIO_Peripheral_Access_Layer GPIO Peripheral Access Layer - * @{ - */ - -/** GPIO - Register Layout Typedef */ -typedef struct { - __IO uint32_t PDOR; /**< Port Data Output Register, offset: 0x0 */ - __O uint32_t PSOR; /**< Port Set Output Register, offset: 0x4 */ - __O uint32_t PCOR; /**< Port Clear Output Register, offset: 0x8 */ - __O uint32_t PTOR; /**< Port Toggle Output Register, offset: 0xC */ - __I uint32_t PDIR; /**< Port Data Input Register, offset: 0x10 */ - __IO uint32_t PDDR; /**< Port Data Direction Register, offset: 0x14 */ -} GPIO_Type; - -/* ---------------------------------------------------------------------------- - -- GPIO Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup GPIO_Register_Masks GPIO Register Masks - * @{ - */ - -/*! @name PDOR - Port Data Output Register */ -/*! @{ */ - -#define GPIO_PDOR_PDO_MASK (0xFFFFFFFFU) -#define GPIO_PDOR_PDO_SHIFT (0U) -/*! PDO - Port Data Output - * 0b00000000000000000000000000000000..Logic level 0 is driven on pin, provided pin is configured for general-purpose output. - * 0b00000000000000000000000000000001..Logic level 1 is driven on pin, provided pin is configured for general-purpose output. - */ -#define GPIO_PDOR_PDO(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO_SHIFT)) & GPIO_PDOR_PDO_MASK) -/*! @} */ - -/*! @name PSOR - Port Set Output Register */ -/*! @{ */ - -#define GPIO_PSOR_PTSO_MASK (0xFFFFFFFFU) -#define GPIO_PSOR_PTSO_SHIFT (0U) -/*! PTSO - Port Set Output - * 0b00000000000000000000000000000000..Corresponding bit in PDORn does not change. - * 0b00000000000000000000000000000001..Corresponding bit in PDORn is set to logic 1. - */ -#define GPIO_PSOR_PTSO(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO_SHIFT)) & GPIO_PSOR_PTSO_MASK) -/*! @} */ - -/*! @name PCOR - Port Clear Output Register */ -/*! @{ */ - -#define GPIO_PCOR_PTCO_MASK (0xFFFFFFFFU) -#define GPIO_PCOR_PTCO_SHIFT (0U) -/*! PTCO - Port Clear Output - * 0b00000000000000000000000000000000..Corresponding bit in PDORn does not change. - * 0b00000000000000000000000000000001..Corresponding bit in PDORn is cleared to logic 0. - */ -#define GPIO_PCOR_PTCO(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO_SHIFT)) & GPIO_PCOR_PTCO_MASK) -/*! @} */ - -/*! @name PTOR - Port Toggle Output Register */ -/*! @{ */ - -#define GPIO_PTOR_PTTO_MASK (0xFFFFFFFFU) -#define GPIO_PTOR_PTTO_SHIFT (0U) -/*! PTTO - Port Toggle Output - * 0b00000000000000000000000000000000..Corresponding bit in PDORn does not change. - * 0b00000000000000000000000000000001..Corresponding bit in PDORn is set to the inverse of its existing logic state. - */ -#define GPIO_PTOR_PTTO(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO_SHIFT)) & GPIO_PTOR_PTTO_MASK) -/*! @} */ - -/*! @name PDIR - Port Data Input Register */ -/*! @{ */ - -#define GPIO_PDIR_PDI_MASK (0xFFFFFFFFU) -#define GPIO_PDIR_PDI_SHIFT (0U) -/*! PDI - Port Data Input - * 0b00000000000000000000000000000000..Pin logic level is logic 0, or is not configured for use by digital function. - * 0b00000000000000000000000000000001..Pin logic level is logic 1. - */ -#define GPIO_PDIR_PDI(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI_SHIFT)) & GPIO_PDIR_PDI_MASK) -/*! @} */ - -/*! @name PDDR - Port Data Direction Register */ -/*! @{ */ - -#define GPIO_PDDR_PDD_MASK (0xFFFFFFFFU) -#define GPIO_PDDR_PDD_SHIFT (0U) -/*! PDD - Port Data Direction - * 0b00000000000000000000000000000000..Pin is configured as general-purpose input, for the GPIO function. - * 0b00000000000000000000000000000001..Pin is configured as general-purpose output, for the GPIO function. - */ -#define GPIO_PDDR_PDD(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD_SHIFT)) & GPIO_PDDR_PDD_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group GPIO_Register_Masks */ - - -/* GPIO - Peripheral instance base addresses */ -/** Peripheral GPIOA base address */ -#define GPIOA_BASE (0x400FF000u) -/** Peripheral GPIOA base pointer */ -#define GPIOA ((GPIO_Type *)GPIOA_BASE) -/** Peripheral GPIOB base address */ -#define GPIOB_BASE (0x400FF040u) -/** Peripheral GPIOB base pointer */ -#define GPIOB ((GPIO_Type *)GPIOB_BASE) -/** Peripheral GPIOC base address */ -#define GPIOC_BASE (0x400FF080u) -/** Peripheral GPIOC base pointer */ -#define GPIOC ((GPIO_Type *)GPIOC_BASE) -/** Peripheral GPIOD base address */ -#define GPIOD_BASE (0x400FF0C0u) -/** Peripheral GPIOD base pointer */ -#define GPIOD ((GPIO_Type *)GPIOD_BASE) -/** Peripheral GPIOE base address */ -#define GPIOE_BASE (0x400FF100u) -/** Peripheral GPIOE base pointer */ -#define GPIOE ((GPIO_Type *)GPIOE_BASE) -/** Array initializer of GPIO peripheral base addresses */ -#define GPIO_BASE_ADDRS { GPIOA_BASE, GPIOB_BASE, GPIOC_BASE, GPIOD_BASE, GPIOE_BASE } -/** Array initializer of GPIO peripheral base pointers */ -#define GPIO_BASE_PTRS { GPIOA, GPIOB, GPIOC, GPIOD, GPIOE } - -/*! - * @} - */ /* end of group GPIO_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- I2C Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup I2C_Peripheral_Access_Layer I2C Peripheral Access Layer - * @{ - */ - -/** I2C - Register Layout Typedef */ -typedef struct { - __IO uint8_t A1; /**< I2C Address Register 1, offset: 0x0 */ - __IO uint8_t F; /**< I2C Frequency Divider register, offset: 0x1 */ - __IO uint8_t C1; /**< I2C Control Register 1, offset: 0x2 */ - __IO uint8_t S; /**< I2C Status register, offset: 0x3 */ - __IO uint8_t D; /**< I2C Data I/O register, offset: 0x4 */ - __IO uint8_t C2; /**< I2C Control Register 2, offset: 0x5 */ - __IO uint8_t FLT; /**< I2C Programmable Input Glitch Filter Register, offset: 0x6 */ - __IO uint8_t RA; /**< I2C Range Address register, offset: 0x7 */ - __IO uint8_t SMB; /**< I2C SMBus Control and Status register, offset: 0x8 */ - __IO uint8_t A2; /**< I2C Address Register 2, offset: 0x9 */ - __IO uint8_t SLTH; /**< I2C SCL Low Timeout Register High, offset: 0xA */ - __IO uint8_t SLTL; /**< I2C SCL Low Timeout Register Low, offset: 0xB */ - __IO uint8_t S2; /**< I2C Status register 2, offset: 0xC */ -} I2C_Type; - -/* ---------------------------------------------------------------------------- - -- I2C Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup I2C_Register_Masks I2C Register Masks - * @{ - */ - -/*! @name A1 - I2C Address Register 1 */ -/*! @{ */ - -#define I2C_A1_AD_MASK (0xFEU) -#define I2C_A1_AD_SHIFT (1U) -/*! AD - Address */ -#define I2C_A1_AD(x) (((uint8_t)(((uint8_t)(x)) << I2C_A1_AD_SHIFT)) & I2C_A1_AD_MASK) -/*! @} */ - -/*! @name F - I2C Frequency Divider register */ -/*! @{ */ - -#define I2C_F_ICR_MASK (0x3FU) -#define I2C_F_ICR_SHIFT (0U) -/*! ICR - ClockRate */ -#define I2C_F_ICR(x) (((uint8_t)(((uint8_t)(x)) << I2C_F_ICR_SHIFT)) & I2C_F_ICR_MASK) - -#define I2C_F_MULT_MASK (0xC0U) -#define I2C_F_MULT_SHIFT (6U) -/*! MULT - Multiplier Factor - * 0b00..mul = 1 - * 0b01..mul = 2 - * 0b10..mul = 4 - * 0b11..Reserved - */ -#define I2C_F_MULT(x) (((uint8_t)(((uint8_t)(x)) << I2C_F_MULT_SHIFT)) & I2C_F_MULT_MASK) -/*! @} */ - -/*! @name C1 - I2C Control Register 1 */ -/*! @{ */ - -#define I2C_C1_DMAEN_MASK (0x1U) -#define I2C_C1_DMAEN_SHIFT (0U) -/*! DMAEN - DMA Enable - * 0b0..All DMA signalling disabled. - * 0b1..DMA transfer is enabled. While SMB[FACK] = 0, the following conditions trigger the DMA request: a data - * byte is received, and either address or data is transmitted. (ACK/NACK is automatic) the first byte received - * matches the A1 register or is a general call address. If any address matching occurs, S[IAAS] and S[TCF] - * are set. If the direction of transfer is known from master to slave, then it is not required to check - * S[SRW]. With this assumption, DMA can also be used in this case. In other cases, if the master reads data from - * the slave, then it is required to rewrite the C1 register operation. With this assumption, DMA cannot be - * used. When FACK = 1, an address or a data byte is transmitted. - */ -#define I2C_C1_DMAEN(x) (((uint8_t)(((uint8_t)(x)) << I2C_C1_DMAEN_SHIFT)) & I2C_C1_DMAEN_MASK) - -#define I2C_C1_WUEN_MASK (0x2U) -#define I2C_C1_WUEN_SHIFT (1U) -/*! WUEN - Wakeup Enable - * 0b0..Normal operation. No interrupt generated when address matching in low power mode. - * 0b1..Enables the wakeup function in low power mode. - */ -#define I2C_C1_WUEN(x) (((uint8_t)(((uint8_t)(x)) << I2C_C1_WUEN_SHIFT)) & I2C_C1_WUEN_MASK) - -#define I2C_C1_RSTA_MASK (0x4U) -#define I2C_C1_RSTA_SHIFT (2U) -/*! RSTA - Repeat START */ -#define I2C_C1_RSTA(x) (((uint8_t)(((uint8_t)(x)) << I2C_C1_RSTA_SHIFT)) & I2C_C1_RSTA_MASK) - -#define I2C_C1_TXAK_MASK (0x8U) -#define I2C_C1_TXAK_SHIFT (3U) -/*! TXAK - Transmit Acknowledge Enable - * 0b0..An acknowledge signal is sent to the bus on the following receiving byte (if FACK is cleared) or the - * current receiving byte (if FACK is set). - * 0b1..No acknowledge signal is sent to the bus on the following receiving data byte (if FACK is cleared) or the - * current receiving data byte (if FACK is set). - */ -#define I2C_C1_TXAK(x) (((uint8_t)(((uint8_t)(x)) << I2C_C1_TXAK_SHIFT)) & I2C_C1_TXAK_MASK) - -#define I2C_C1_TX_MASK (0x10U) -#define I2C_C1_TX_SHIFT (4U) -/*! TX - Transmit Mode Select - * 0b0..Receive - * 0b1..Transmit - */ -#define I2C_C1_TX(x) (((uint8_t)(((uint8_t)(x)) << I2C_C1_TX_SHIFT)) & I2C_C1_TX_MASK) - -#define I2C_C1_MST_MASK (0x20U) -#define I2C_C1_MST_SHIFT (5U) -/*! MST - Master Mode Select - * 0b0..Slave mode - * 0b1..Master mode - */ -#define I2C_C1_MST(x) (((uint8_t)(((uint8_t)(x)) << I2C_C1_MST_SHIFT)) & I2C_C1_MST_MASK) - -#define I2C_C1_IICIE_MASK (0x40U) -#define I2C_C1_IICIE_SHIFT (6U) -/*! IICIE - I2C Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define I2C_C1_IICIE(x) (((uint8_t)(((uint8_t)(x)) << I2C_C1_IICIE_SHIFT)) & I2C_C1_IICIE_MASK) - -#define I2C_C1_IICEN_MASK (0x80U) -#define I2C_C1_IICEN_SHIFT (7U) -/*! IICEN - I2C Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define I2C_C1_IICEN(x) (((uint8_t)(((uint8_t)(x)) << I2C_C1_IICEN_SHIFT)) & I2C_C1_IICEN_MASK) -/*! @} */ - -/*! @name S - I2C Status register */ -/*! @{ */ - -#define I2C_S_RXAK_MASK (0x1U) -#define I2C_S_RXAK_SHIFT (0U) -/*! RXAK - Receive Acknowledge - * 0b0..Acknowledge signal was received after the completion of one byte of data transmission on the bus - * 0b1..No acknowledge signal detected - */ -#define I2C_S_RXAK(x) (((uint8_t)(((uint8_t)(x)) << I2C_S_RXAK_SHIFT)) & I2C_S_RXAK_MASK) - -#define I2C_S_IICIF_MASK (0x2U) -#define I2C_S_IICIF_SHIFT (1U) -/*! IICIF - Interrupt Flag - * 0b0..No interrupt pending - * 0b1..Interrupt pending - */ -#define I2C_S_IICIF(x) (((uint8_t)(((uint8_t)(x)) << I2C_S_IICIF_SHIFT)) & I2C_S_IICIF_MASK) - -#define I2C_S_SRW_MASK (0x4U) -#define I2C_S_SRW_SHIFT (2U) -/*! SRW - Slave Read/Write - * 0b0..Slave receive, master writing to slave - * 0b1..Slave transmit, master reading from slave - */ -#define I2C_S_SRW(x) (((uint8_t)(((uint8_t)(x)) << I2C_S_SRW_SHIFT)) & I2C_S_SRW_MASK) - -#define I2C_S_RAM_MASK (0x8U) -#define I2C_S_RAM_SHIFT (3U) -/*! RAM - Range Address Match - * 0b0..Not addressed - * 0b1..Addressed as a slave - */ -#define I2C_S_RAM(x) (((uint8_t)(((uint8_t)(x)) << I2C_S_RAM_SHIFT)) & I2C_S_RAM_MASK) - -#define I2C_S_ARBL_MASK (0x10U) -#define I2C_S_ARBL_SHIFT (4U) -/*! ARBL - Arbitration Lost - * 0b0..Standard bus operation. - * 0b1..Loss of arbitration. - */ -#define I2C_S_ARBL(x) (((uint8_t)(((uint8_t)(x)) << I2C_S_ARBL_SHIFT)) & I2C_S_ARBL_MASK) - -#define I2C_S_BUSY_MASK (0x20U) -#define I2C_S_BUSY_SHIFT (5U) -/*! BUSY - Bus Busy - * 0b0..Bus is idle - * 0b1..Bus is busy - */ -#define I2C_S_BUSY(x) (((uint8_t)(((uint8_t)(x)) << I2C_S_BUSY_SHIFT)) & I2C_S_BUSY_MASK) - -#define I2C_S_IAAS_MASK (0x40U) -#define I2C_S_IAAS_SHIFT (6U) -/*! IAAS - Addressed As A Slave - * 0b0..Not addressed - * 0b1..Addressed as a slave - */ -#define I2C_S_IAAS(x) (((uint8_t)(((uint8_t)(x)) << I2C_S_IAAS_SHIFT)) & I2C_S_IAAS_MASK) - -#define I2C_S_TCF_MASK (0x80U) -#define I2C_S_TCF_SHIFT (7U) -/*! TCF - Transfer Complete Flag - * 0b0..Transfer in progress - * 0b1..Transfer complete - */ -#define I2C_S_TCF(x) (((uint8_t)(((uint8_t)(x)) << I2C_S_TCF_SHIFT)) & I2C_S_TCF_MASK) -/*! @} */ - -/*! @name D - I2C Data I/O register */ -/*! @{ */ - -#define I2C_D_DATA_MASK (0xFFU) -#define I2C_D_DATA_SHIFT (0U) -/*! DATA - Data */ -#define I2C_D_DATA(x) (((uint8_t)(((uint8_t)(x)) << I2C_D_DATA_SHIFT)) & I2C_D_DATA_MASK) -/*! @} */ - -/*! @name C2 - I2C Control Register 2 */ -/*! @{ */ - -#define I2C_C2_AD_MASK (0x7U) -#define I2C_C2_AD_SHIFT (0U) -/*! AD - Slave Address */ -#define I2C_C2_AD(x) (((uint8_t)(((uint8_t)(x)) << I2C_C2_AD_SHIFT)) & I2C_C2_AD_MASK) - -#define I2C_C2_RMEN_MASK (0x8U) -#define I2C_C2_RMEN_SHIFT (3U) -/*! RMEN - Range Address Matching Enable - * 0b0..Range mode disabled. No address matching occurs for an address within the range of values of the A1 and RA registers. - * 0b1..Range mode enabled. Address matching occurs when a slave receives an address within the range of values of the A1 and RA registers. - */ -#define I2C_C2_RMEN(x) (((uint8_t)(((uint8_t)(x)) << I2C_C2_RMEN_SHIFT)) & I2C_C2_RMEN_MASK) - -#define I2C_C2_SBRC_MASK (0x10U) -#define I2C_C2_SBRC_SHIFT (4U) -/*! SBRC - Slave Baud Rate Control - * 0b0..The slave baud rate follows the master baud rate and clock stretching may occur - * 0b1..Slave baud rate is independent of the master baud rate - */ -#define I2C_C2_SBRC(x) (((uint8_t)(((uint8_t)(x)) << I2C_C2_SBRC_SHIFT)) & I2C_C2_SBRC_MASK) - -#define I2C_C2_HDRS_MASK (0x20U) -#define I2C_C2_HDRS_SHIFT (5U) -/*! HDRS - High Drive Select - * 0b0..Normal drive mode - * 0b1..High drive mode - */ -#define I2C_C2_HDRS(x) (((uint8_t)(((uint8_t)(x)) << I2C_C2_HDRS_SHIFT)) & I2C_C2_HDRS_MASK) - -#define I2C_C2_ADEXT_MASK (0x40U) -#define I2C_C2_ADEXT_SHIFT (6U) -/*! ADEXT - Address Extension - * 0b0..7-bit address scheme - * 0b1..10-bit address scheme - */ -#define I2C_C2_ADEXT(x) (((uint8_t)(((uint8_t)(x)) << I2C_C2_ADEXT_SHIFT)) & I2C_C2_ADEXT_MASK) - -#define I2C_C2_GCAEN_MASK (0x80U) -#define I2C_C2_GCAEN_SHIFT (7U) -/*! GCAEN - General Call Address Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define I2C_C2_GCAEN(x) (((uint8_t)(((uint8_t)(x)) << I2C_C2_GCAEN_SHIFT)) & I2C_C2_GCAEN_MASK) -/*! @} */ - -/*! @name FLT - I2C Programmable Input Glitch Filter Register */ -/*! @{ */ - -#define I2C_FLT_FLT_MASK (0xFU) -#define I2C_FLT_FLT_SHIFT (0U) -/*! FLT - I2C Programmable Filter Factor - * 0b0000..No filter/bypass - * 0b0001-0b1111..Filter glitches up to width of n I2C module clock cycles, where n=1-15d - */ -#define I2C_FLT_FLT(x) (((uint8_t)(((uint8_t)(x)) << I2C_FLT_FLT_SHIFT)) & I2C_FLT_FLT_MASK) - -#define I2C_FLT_STARTF_MASK (0x10U) -#define I2C_FLT_STARTF_SHIFT (4U) -/*! STARTF - I2C Bus Start Detect Flag - * 0b0..No start happens on I2C bus - * 0b1..Start detected on I2C bus - */ -#define I2C_FLT_STARTF(x) (((uint8_t)(((uint8_t)(x)) << I2C_FLT_STARTF_SHIFT)) & I2C_FLT_STARTF_MASK) - -#define I2C_FLT_SSIE_MASK (0x20U) -#define I2C_FLT_SSIE_SHIFT (5U) -/*! SSIE - I2C Bus Stop or Start Interrupt Enable - * 0b0..Stop or start detection interrupt is disabled - * 0b1..Stop or start detection interrupt is enabled - */ -#define I2C_FLT_SSIE(x) (((uint8_t)(((uint8_t)(x)) << I2C_FLT_SSIE_SHIFT)) & I2C_FLT_SSIE_MASK) - -#define I2C_FLT_STOPF_MASK (0x40U) -#define I2C_FLT_STOPF_SHIFT (6U) -/*! STOPF - I2C Bus Stop Detect Flag - * 0b0..No stop happens on I2C bus - * 0b1..Stop detected on I2C bus - */ -#define I2C_FLT_STOPF(x) (((uint8_t)(((uint8_t)(x)) << I2C_FLT_STOPF_SHIFT)) & I2C_FLT_STOPF_MASK) - -#define I2C_FLT_SHEN_MASK (0x80U) -#define I2C_FLT_SHEN_SHIFT (7U) -/*! SHEN - Stop Hold Enable - * 0b0..Stop holdoff is disabled. The MCU's entry to stop mode is not gated. - * 0b1..Stop holdoff is enabled. - */ -#define I2C_FLT_SHEN(x) (((uint8_t)(((uint8_t)(x)) << I2C_FLT_SHEN_SHIFT)) & I2C_FLT_SHEN_MASK) -/*! @} */ - -/*! @name RA - I2C Range Address register */ -/*! @{ */ - -#define I2C_RA_RAD_MASK (0xFEU) -#define I2C_RA_RAD_SHIFT (1U) -/*! RAD - Range Slave Address */ -#define I2C_RA_RAD(x) (((uint8_t)(((uint8_t)(x)) << I2C_RA_RAD_SHIFT)) & I2C_RA_RAD_MASK) -/*! @} */ - -/*! @name SMB - I2C SMBus Control and Status register */ -/*! @{ */ - -#define I2C_SMB_SHTF2IE_MASK (0x1U) -#define I2C_SMB_SHTF2IE_SHIFT (0U) -/*! SHTF2IE - SHTF2 Interrupt Enable - * 0b0..SHTF2 interrupt is disabled - * 0b1..SHTF2 interrupt is enabled - */ -#define I2C_SMB_SHTF2IE(x) (((uint8_t)(((uint8_t)(x)) << I2C_SMB_SHTF2IE_SHIFT)) & I2C_SMB_SHTF2IE_MASK) - -#define I2C_SMB_SHTF2_MASK (0x2U) -#define I2C_SMB_SHTF2_SHIFT (1U) -/*! SHTF2 - SCL High Timeout Flag 2 - * 0b0..No SCL high and SDA low timeout occurs - * 0b1..SCL high and SDA low timeout occurs - */ -#define I2C_SMB_SHTF2(x) (((uint8_t)(((uint8_t)(x)) << I2C_SMB_SHTF2_SHIFT)) & I2C_SMB_SHTF2_MASK) - -#define I2C_SMB_SHTF1_MASK (0x4U) -#define I2C_SMB_SHTF1_SHIFT (2U) -/*! SHTF1 - SCL High Timeout Flag 1 - * 0b0..No SCL high and SDA high timeout occurs - * 0b1..SCL high and SDA high timeout occurs - */ -#define I2C_SMB_SHTF1(x) (((uint8_t)(((uint8_t)(x)) << I2C_SMB_SHTF1_SHIFT)) & I2C_SMB_SHTF1_MASK) - -#define I2C_SMB_SLTF_MASK (0x8U) -#define I2C_SMB_SLTF_SHIFT (3U) -/*! SLTF - SCL Low Timeout Flag - * 0b0..No low timeout occurs - * 0b1..Low timeout occurs - */ -#define I2C_SMB_SLTF(x) (((uint8_t)(((uint8_t)(x)) << I2C_SMB_SLTF_SHIFT)) & I2C_SMB_SLTF_MASK) - -#define I2C_SMB_TCKSEL_MASK (0x10U) -#define I2C_SMB_TCKSEL_SHIFT (4U) -/*! TCKSEL - Timeout Counter Clock Select - * 0b0..Timeout counter counts at the frequency of the I2C module clock / 64 - * 0b1..Timeout counter counts at the frequency of the I2C module clock - */ -#define I2C_SMB_TCKSEL(x) (((uint8_t)(((uint8_t)(x)) << I2C_SMB_TCKSEL_SHIFT)) & I2C_SMB_TCKSEL_MASK) - -#define I2C_SMB_SIICAEN_MASK (0x20U) -#define I2C_SMB_SIICAEN_SHIFT (5U) -/*! SIICAEN - Second I2C Address Enable - * 0b0..I2C address register 2 matching is disabled - * 0b1..I2C address register 2 matching is enabled - */ -#define I2C_SMB_SIICAEN(x) (((uint8_t)(((uint8_t)(x)) << I2C_SMB_SIICAEN_SHIFT)) & I2C_SMB_SIICAEN_MASK) - -#define I2C_SMB_ALERTEN_MASK (0x40U) -#define I2C_SMB_ALERTEN_SHIFT (6U) -/*! ALERTEN - SMBus Alert Response Address Enable - * 0b0..SMBus alert response address matching is disabled - * 0b1..SMBus alert response address matching is enabled - */ -#define I2C_SMB_ALERTEN(x) (((uint8_t)(((uint8_t)(x)) << I2C_SMB_ALERTEN_SHIFT)) & I2C_SMB_ALERTEN_MASK) - -#define I2C_SMB_FACK_MASK (0x80U) -#define I2C_SMB_FACK_SHIFT (7U) -/*! FACK - Fast NACK/ACK Enable - * 0b0..An ACK or NACK is sent on the following receiving data byte - * 0b1..Writing 0 to TXAK after receiving a data byte generates an ACK. Writing 1 to TXAK after receiving a data byte generates a NACK. - */ -#define I2C_SMB_FACK(x) (((uint8_t)(((uint8_t)(x)) << I2C_SMB_FACK_SHIFT)) & I2C_SMB_FACK_MASK) -/*! @} */ - -/*! @name A2 - I2C Address Register 2 */ -/*! @{ */ - -#define I2C_A2_SAD_MASK (0xFEU) -#define I2C_A2_SAD_SHIFT (1U) -/*! SAD - SMBus Address */ -#define I2C_A2_SAD(x) (((uint8_t)(((uint8_t)(x)) << I2C_A2_SAD_SHIFT)) & I2C_A2_SAD_MASK) -/*! @} */ - -/*! @name SLTH - I2C SCL Low Timeout Register High */ -/*! @{ */ - -#define I2C_SLTH_SSLT_MASK (0xFFU) -#define I2C_SLTH_SSLT_SHIFT (0U) -/*! SSLT - SSLT[15:8] */ -#define I2C_SLTH_SSLT(x) (((uint8_t)(((uint8_t)(x)) << I2C_SLTH_SSLT_SHIFT)) & I2C_SLTH_SSLT_MASK) -/*! @} */ - -/*! @name SLTL - I2C SCL Low Timeout Register Low */ -/*! @{ */ - -#define I2C_SLTL_SSLT_MASK (0xFFU) -#define I2C_SLTL_SSLT_SHIFT (0U) -/*! SSLT - SSLT[7:0] */ -#define I2C_SLTL_SSLT(x) (((uint8_t)(((uint8_t)(x)) << I2C_SLTL_SSLT_SHIFT)) & I2C_SLTL_SSLT_MASK) -/*! @} */ - -/*! @name S2 - I2C Status register 2 */ -/*! @{ */ - -#define I2C_S2_EMPTY_MASK (0x1U) -#define I2C_S2_EMPTY_SHIFT (0U) -/*! EMPTY - Empty flag - * 0b0..Tx or Rx buffer is not empty and cannot be written to, that is new data cannot be loaded into the buffer. - * 0b1..Tx or Rx buffer is empty and can be written to, that is new data can be loaded into the buffer. - */ -#define I2C_S2_EMPTY(x) (((uint8_t)(((uint8_t)(x)) << I2C_S2_EMPTY_SHIFT)) & I2C_S2_EMPTY_MASK) - -#define I2C_S2_ERROR_MASK (0x2U) -#define I2C_S2_ERROR_SHIFT (1U) -/*! ERROR - Error flag - * 0b0..The buffer is not full and all write/read operations have no errors. - * 0b1..There are 3 or more write/read errors during the data transfer phase (when the Empty flag is not set and the buffer is busy). - */ -#define I2C_S2_ERROR(x) (((uint8_t)(((uint8_t)(x)) << I2C_S2_ERROR_SHIFT)) & I2C_S2_ERROR_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group I2C_Register_Masks */ - - -/* I2C - Peripheral instance base addresses */ -/** Peripheral I2C0 base address */ -#define I2C0_BASE (0x40066000u) -/** Peripheral I2C0 base pointer */ -#define I2C0 ((I2C_Type *)I2C0_BASE) -/** Peripheral I2C1 base address */ -#define I2C1_BASE (0x40067000u) -/** Peripheral I2C1 base pointer */ -#define I2C1 ((I2C_Type *)I2C1_BASE) -/** Array initializer of I2C peripheral base addresses */ -#define I2C_BASE_ADDRS { I2C0_BASE, I2C1_BASE } -/** Array initializer of I2C peripheral base pointers */ -#define I2C_BASE_PTRS { I2C0, I2C1 } -/** Interrupt vectors for the I2C peripheral type */ -#define I2C_IRQS { I2C0_IRQn, I2C1_IRQn } - -/*! - * @} - */ /* end of group I2C_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- I2S Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup I2S_Peripheral_Access_Layer I2S Peripheral Access Layer - * @{ - */ - -/** I2S - Register Layout Typedef */ -typedef struct { - __IO uint32_t TCSR; /**< SAI Transmit Control Register, offset: 0x0 */ - uint8_t RESERVED_0[4]; - __IO uint32_t TCR2; /**< SAI Transmit Configuration 2 Register, offset: 0x8 */ - __IO uint32_t TCR3; /**< SAI Transmit Configuration 3 Register, offset: 0xC */ - __IO uint32_t TCR4; /**< SAI Transmit Configuration 4 Register, offset: 0x10 */ - __IO uint32_t TCR5; /**< SAI Transmit Configuration 5 Register, offset: 0x14 */ - uint8_t RESERVED_1[8]; - __O uint32_t TDR[1]; /**< SAI Transmit Data Register, array offset: 0x20, array step: 0x4 */ - uint8_t RESERVED_2[60]; - __IO uint32_t TMR; /**< SAI Transmit Mask Register, offset: 0x60 */ - uint8_t RESERVED_3[28]; - __IO uint32_t RCSR; /**< SAI Receive Control Register, offset: 0x80 */ - uint8_t RESERVED_4[4]; - __IO uint32_t RCR2; /**< SAI Receive Configuration 2 Register, offset: 0x88 */ - __IO uint32_t RCR3; /**< SAI Receive Configuration 3 Register, offset: 0x8C */ - __IO uint32_t RCR4; /**< SAI Receive Configuration 4 Register, offset: 0x90 */ - __IO uint32_t RCR5; /**< SAI Receive Configuration 5 Register, offset: 0x94 */ - uint8_t RESERVED_5[8]; - __I uint32_t RDR[1]; /**< SAI Receive Data Register, array offset: 0xA0, array step: 0x4 */ - uint8_t RESERVED_6[60]; - __IO uint32_t RMR; /**< SAI Receive Mask Register, offset: 0xE0 */ - uint8_t RESERVED_7[28]; - __IO uint32_t MCR; /**< SAI MCLK Control Register, offset: 0x100 */ -} I2S_Type; - -/* ---------------------------------------------------------------------------- - -- I2S Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup I2S_Register_Masks I2S Register Masks - * @{ - */ - -/*! @name TCSR - SAI Transmit Control Register */ -/*! @{ */ - -#define I2S_TCSR_FWDE_MASK (0x2U) -#define I2S_TCSR_FWDE_SHIFT (1U) -/*! FWDE - FIFO Warning DMA Enable - * 0b0..Disables the DMA request. - * 0b1..Enables the DMA request. - */ -#define I2S_TCSR_FWDE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FWDE_SHIFT)) & I2S_TCSR_FWDE_MASK) - -#define I2S_TCSR_FWIE_MASK (0x200U) -#define I2S_TCSR_FWIE_SHIFT (9U) -/*! FWIE - FIFO Warning Interrupt Enable - * 0b0..Disables the interrupt. - * 0b1..Enables the interrupt. - */ -#define I2S_TCSR_FWIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FWIE_SHIFT)) & I2S_TCSR_FWIE_MASK) - -#define I2S_TCSR_FEIE_MASK (0x400U) -#define I2S_TCSR_FEIE_SHIFT (10U) -/*! FEIE - FIFO Error Interrupt Enable - * 0b0..Disables the interrupt. - * 0b1..Enables the interrupt. - */ -#define I2S_TCSR_FEIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FEIE_SHIFT)) & I2S_TCSR_FEIE_MASK) - -#define I2S_TCSR_SEIE_MASK (0x800U) -#define I2S_TCSR_SEIE_SHIFT (11U) -/*! SEIE - Sync Error Interrupt Enable - * 0b0..Disables interrupt. - * 0b1..Enables interrupt. - */ -#define I2S_TCSR_SEIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_SEIE_SHIFT)) & I2S_TCSR_SEIE_MASK) - -#define I2S_TCSR_WSIE_MASK (0x1000U) -#define I2S_TCSR_WSIE_SHIFT (12U) -/*! WSIE - Word Start Interrupt Enable - * 0b0..Disables interrupt. - * 0b1..Enables interrupt. - */ -#define I2S_TCSR_WSIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_WSIE_SHIFT)) & I2S_TCSR_WSIE_MASK) - -#define I2S_TCSR_FWF_MASK (0x20000U) -#define I2S_TCSR_FWF_SHIFT (17U) -/*! FWF - FIFO Warning Flag - * 0b0..No enabled transmit FIFO is empty. - * 0b1..Enabled transmit FIFO is empty. - */ -#define I2S_TCSR_FWF(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FWF_SHIFT)) & I2S_TCSR_FWF_MASK) - -#define I2S_TCSR_FEF_MASK (0x40000U) -#define I2S_TCSR_FEF_SHIFT (18U) -/*! FEF - FIFO Error Flag - * 0b0..Transmit underrun not detected. - * 0b1..Transmit underrun detected. - */ -#define I2S_TCSR_FEF(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FEF_SHIFT)) & I2S_TCSR_FEF_MASK) - -#define I2S_TCSR_SEF_MASK (0x80000U) -#define I2S_TCSR_SEF_SHIFT (19U) -/*! SEF - Sync Error Flag - * 0b0..Sync error not detected. - * 0b1..Frame sync error detected. - */ -#define I2S_TCSR_SEF(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_SEF_SHIFT)) & I2S_TCSR_SEF_MASK) - -#define I2S_TCSR_WSF_MASK (0x100000U) -#define I2S_TCSR_WSF_SHIFT (20U) -/*! WSF - Word Start Flag - * 0b0..Start of word not detected. - * 0b1..Start of word detected. - */ -#define I2S_TCSR_WSF(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_WSF_SHIFT)) & I2S_TCSR_WSF_MASK) - -#define I2S_TCSR_SR_MASK (0x1000000U) -#define I2S_TCSR_SR_SHIFT (24U) -/*! SR - Software Reset - * 0b0..No effect. - * 0b1..Software reset. - */ -#define I2S_TCSR_SR(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_SR_SHIFT)) & I2S_TCSR_SR_MASK) - -#define I2S_TCSR_FR_MASK (0x2000000U) -#define I2S_TCSR_FR_SHIFT (25U) -/*! FR - FIFO Reset - * 0b0..No effect. - * 0b1..FIFO reset. - */ -#define I2S_TCSR_FR(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FR_SHIFT)) & I2S_TCSR_FR_MASK) - -#define I2S_TCSR_BCE_MASK (0x10000000U) -#define I2S_TCSR_BCE_SHIFT (28U) -/*! BCE - Bit Clock Enable - * 0b0..Transmit bit clock is disabled. - * 0b1..Transmit bit clock is enabled. - */ -#define I2S_TCSR_BCE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_BCE_SHIFT)) & I2S_TCSR_BCE_MASK) - -#define I2S_TCSR_DBGE_MASK (0x20000000U) -#define I2S_TCSR_DBGE_SHIFT (29U) -/*! DBGE - Debug Enable - * 0b0..Transmitter is disabled in Debug mode, after completing the current frame. - * 0b1..Transmitter is enabled in Debug mode. - */ -#define I2S_TCSR_DBGE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_DBGE_SHIFT)) & I2S_TCSR_DBGE_MASK) - -#define I2S_TCSR_STOPE_MASK (0x40000000U) -#define I2S_TCSR_STOPE_SHIFT (30U) -/*! STOPE - Stop Enable - * 0b0..Transmitter disabled in Stop mode. - * 0b1..Transmitter enabled in Stop mode. - */ -#define I2S_TCSR_STOPE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_STOPE_SHIFT)) & I2S_TCSR_STOPE_MASK) - -#define I2S_TCSR_TE_MASK (0x80000000U) -#define I2S_TCSR_TE_SHIFT (31U) -/*! TE - Transmitter Enable - * 0b0..Transmitter is disabled. - * 0b1..Transmitter is enabled, or transmitter has been disabled and has not yet reached end of frame. - */ -#define I2S_TCSR_TE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_TE_SHIFT)) & I2S_TCSR_TE_MASK) -/*! @} */ - -/*! @name TCR2 - SAI Transmit Configuration 2 Register */ -/*! @{ */ - -#define I2S_TCR2_DIV_MASK (0xFFU) -#define I2S_TCR2_DIV_SHIFT (0U) -/*! DIV - Bit Clock Divide */ -#define I2S_TCR2_DIV(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_DIV_SHIFT)) & I2S_TCR2_DIV_MASK) - -#define I2S_TCR2_BCD_MASK (0x1000000U) -#define I2S_TCR2_BCD_SHIFT (24U) -/*! BCD - Bit Clock Direction - * 0b0..Bit clock is generated externally in Slave mode. - * 0b1..Bit clock is generated internally in Master mode. - */ -#define I2S_TCR2_BCD(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_BCD_SHIFT)) & I2S_TCR2_BCD_MASK) - -#define I2S_TCR2_BCP_MASK (0x2000000U) -#define I2S_TCR2_BCP_SHIFT (25U) -/*! BCP - Bit Clock Polarity - * 0b0..Bit clock is active high with drive outputs on rising edge and sample inputs on falling edge. - * 0b1..Bit clock is active low with drive outputs on falling edge and sample inputs on rising edge. - */ -#define I2S_TCR2_BCP(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_BCP_SHIFT)) & I2S_TCR2_BCP_MASK) - -#define I2S_TCR2_MSEL_MASK (0xC000000U) -#define I2S_TCR2_MSEL_SHIFT (26U) -/*! MSEL - MCLK Select - * 0b00..Bus Clock selected. - * 0b01..Master Clock (MCLK) 1 option selected. - * 0b10..Master Clock (MCLK) 2 option selected. - * 0b11..Master Clock (MCLK) 3 option selected. - */ -#define I2S_TCR2_MSEL(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_MSEL_SHIFT)) & I2S_TCR2_MSEL_MASK) - -#define I2S_TCR2_BCI_MASK (0x10000000U) -#define I2S_TCR2_BCI_SHIFT (28U) -/*! BCI - Bit Clock Input - * 0b0..No effect. - * 0b1..Internal logic is clocked as if bit clock was externally generated. - */ -#define I2S_TCR2_BCI(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_BCI_SHIFT)) & I2S_TCR2_BCI_MASK) - -#define I2S_TCR2_BCS_MASK (0x20000000U) -#define I2S_TCR2_BCS_SHIFT (29U) -/*! BCS - Bit Clock Swap - * 0b0..Use the normal bit clock source. - * 0b1..Swap the bit clock source. - */ -#define I2S_TCR2_BCS(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_BCS_SHIFT)) & I2S_TCR2_BCS_MASK) - -#define I2S_TCR2_SYNC_MASK (0xC0000000U) -#define I2S_TCR2_SYNC_SHIFT (30U) -/*! SYNC - Synchronous Mode - * 0b00..Asynchronous mode. - * 0b01..Synchronous with receiver. - * 0b10..Synchronous with another SAI transmitter. - * 0b11..Synchronous with another SAI receiver. - */ -#define I2S_TCR2_SYNC(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_SYNC_SHIFT)) & I2S_TCR2_SYNC_MASK) -/*! @} */ - -/*! @name TCR3 - SAI Transmit Configuration 3 Register */ -/*! @{ */ - -#define I2S_TCR3_WDFL_MASK (0x1U) -#define I2S_TCR3_WDFL_SHIFT (0U) -/*! WDFL - Word Flag Configuration */ -#define I2S_TCR3_WDFL(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR3_WDFL_SHIFT)) & I2S_TCR3_WDFL_MASK) - -#define I2S_TCR3_TCE_MASK (0x10000U) -#define I2S_TCR3_TCE_SHIFT (16U) -/*! TCE - Transmit Channel Enable - * 0b0..Transmit data channel N is disabled. - * 0b1..Transmit data channel N is enabled. - */ -#define I2S_TCR3_TCE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR3_TCE_SHIFT)) & I2S_TCR3_TCE_MASK) -/*! @} */ - -/*! @name TCR4 - SAI Transmit Configuration 4 Register */ -/*! @{ */ - -#define I2S_TCR4_FSD_MASK (0x1U) -#define I2S_TCR4_FSD_SHIFT (0U) -/*! FSD - Frame Sync Direction - * 0b0..Frame sync is generated externally in Slave mode. - * 0b1..Frame sync is generated internally in Master mode. - */ -#define I2S_TCR4_FSD(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_FSD_SHIFT)) & I2S_TCR4_FSD_MASK) - -#define I2S_TCR4_FSP_MASK (0x2U) -#define I2S_TCR4_FSP_SHIFT (1U) -/*! FSP - Frame Sync Polarity - * 0b0..Frame sync is active high. - * 0b1..Frame sync is active low. - */ -#define I2S_TCR4_FSP(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_FSP_SHIFT)) & I2S_TCR4_FSP_MASK) - -#define I2S_TCR4_ONDEM_MASK (0x4U) -#define I2S_TCR4_ONDEM_SHIFT (2U) -/*! ONDEM - On Demand Mode - * 0b0..Internal frame sync is generated continuously. - * 0b1..Internal frame sync is generated when the FIFO warning flag is clear. - */ -#define I2S_TCR4_ONDEM(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_ONDEM_SHIFT)) & I2S_TCR4_ONDEM_MASK) - -#define I2S_TCR4_FSE_MASK (0x8U) -#define I2S_TCR4_FSE_SHIFT (3U) -/*! FSE - Frame Sync Early - * 0b0..Frame sync asserts with the first bit of the frame. - * 0b1..Frame sync asserts one bit before the first bit of the frame. - */ -#define I2S_TCR4_FSE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_FSE_SHIFT)) & I2S_TCR4_FSE_MASK) - -#define I2S_TCR4_MF_MASK (0x10U) -#define I2S_TCR4_MF_SHIFT (4U) -/*! MF - MSB First - * 0b0..LSB is transmitted first. - * 0b1..MSB is transmitted first. - */ -#define I2S_TCR4_MF(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_MF_SHIFT)) & I2S_TCR4_MF_MASK) - -#define I2S_TCR4_SYWD_MASK (0x1F00U) -#define I2S_TCR4_SYWD_SHIFT (8U) -/*! SYWD - Sync Width */ -#define I2S_TCR4_SYWD(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_SYWD_SHIFT)) & I2S_TCR4_SYWD_MASK) - -#define I2S_TCR4_FRSZ_MASK (0x10000U) -#define I2S_TCR4_FRSZ_SHIFT (16U) -/*! FRSZ - Frame size */ -#define I2S_TCR4_FRSZ(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_FRSZ_SHIFT)) & I2S_TCR4_FRSZ_MASK) - -#define I2S_TCR4_FPACK_MASK (0x3000000U) -#define I2S_TCR4_FPACK_SHIFT (24U) -/*! FPACK - FIFO Packing Mode - * 0b00..FIFO packing is disabled - * 0b01..Reserved - * 0b10..8-bit FIFO packing is enabled - * 0b11..16-bit FIFO packing is enabled - */ -#define I2S_TCR4_FPACK(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_FPACK_SHIFT)) & I2S_TCR4_FPACK_MASK) - -#define I2S_TCR4_FCONT_MASK (0x10000000U) -#define I2S_TCR4_FCONT_SHIFT (28U) -/*! FCONT - FIFO Continue on Error - * 0b0..On FIFO error, the SAI will continue from the start of the next frame after the FIFO error flag has been cleared. - * 0b1..On FIFO error, the SAI will continue from the same word that caused the FIFO error to set after the FIFO warning flag has been cleared. - */ -#define I2S_TCR4_FCONT(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_FCONT_SHIFT)) & I2S_TCR4_FCONT_MASK) -/*! @} */ - -/*! @name TCR5 - SAI Transmit Configuration 5 Register */ -/*! @{ */ - -#define I2S_TCR5_FBT_MASK (0x1F00U) -#define I2S_TCR5_FBT_SHIFT (8U) -/*! FBT - First Bit Shifted */ -#define I2S_TCR5_FBT(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR5_FBT_SHIFT)) & I2S_TCR5_FBT_MASK) - -#define I2S_TCR5_W0W_MASK (0x1F0000U) -#define I2S_TCR5_W0W_SHIFT (16U) -/*! W0W - Word 0 Width */ -#define I2S_TCR5_W0W(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR5_W0W_SHIFT)) & I2S_TCR5_W0W_MASK) - -#define I2S_TCR5_WNW_MASK (0x1F000000U) -#define I2S_TCR5_WNW_SHIFT (24U) -/*! WNW - Word N Width */ -#define I2S_TCR5_WNW(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR5_WNW_SHIFT)) & I2S_TCR5_WNW_MASK) -/*! @} */ - -/*! @name TDR - SAI Transmit Data Register */ -/*! @{ */ - -#define I2S_TDR_TDR_MASK (0xFFFFFFFFU) -#define I2S_TDR_TDR_SHIFT (0U) -/*! TDR - Transmit Data Register */ -#define I2S_TDR_TDR(x) (((uint32_t)(((uint32_t)(x)) << I2S_TDR_TDR_SHIFT)) & I2S_TDR_TDR_MASK) -/*! @} */ - -/* The count of I2S_TDR */ -#define I2S_TDR_COUNT (1U) - -/*! @name TMR - SAI Transmit Mask Register */ -/*! @{ */ - -#define I2S_TMR_TWM_MASK (0x3U) -#define I2S_TMR_TWM_SHIFT (0U) -/*! TWM - Transmit Word Mask - * 0b00..Word N is enabled. - * 0b01..Word N is masked. The transmit data pins are tri-stated when masked. - */ -#define I2S_TMR_TWM(x) (((uint32_t)(((uint32_t)(x)) << I2S_TMR_TWM_SHIFT)) & I2S_TMR_TWM_MASK) -/*! @} */ - -/*! @name RCSR - SAI Receive Control Register */ -/*! @{ */ - -#define I2S_RCSR_FWDE_MASK (0x2U) -#define I2S_RCSR_FWDE_SHIFT (1U) -/*! FWDE - FIFO Warning DMA Enable - * 0b0..Disables the DMA request. - * 0b1..Enables the DMA request. - */ -#define I2S_RCSR_FWDE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FWDE_SHIFT)) & I2S_RCSR_FWDE_MASK) - -#define I2S_RCSR_FWIE_MASK (0x200U) -#define I2S_RCSR_FWIE_SHIFT (9U) -/*! FWIE - FIFO Warning Interrupt Enable - * 0b0..Disables the interrupt. - * 0b1..Enables the interrupt. - */ -#define I2S_RCSR_FWIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FWIE_SHIFT)) & I2S_RCSR_FWIE_MASK) - -#define I2S_RCSR_FEIE_MASK (0x400U) -#define I2S_RCSR_FEIE_SHIFT (10U) -/*! FEIE - FIFO Error Interrupt Enable - * 0b0..Disables the interrupt. - * 0b1..Enables the interrupt. - */ -#define I2S_RCSR_FEIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FEIE_SHIFT)) & I2S_RCSR_FEIE_MASK) - -#define I2S_RCSR_SEIE_MASK (0x800U) -#define I2S_RCSR_SEIE_SHIFT (11U) -/*! SEIE - Sync Error Interrupt Enable - * 0b0..Disables interrupt. - * 0b1..Enables interrupt. - */ -#define I2S_RCSR_SEIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_SEIE_SHIFT)) & I2S_RCSR_SEIE_MASK) - -#define I2S_RCSR_WSIE_MASK (0x1000U) -#define I2S_RCSR_WSIE_SHIFT (12U) -/*! WSIE - Word Start Interrupt Enable - * 0b0..Disables interrupt. - * 0b1..Enables interrupt. - */ -#define I2S_RCSR_WSIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_WSIE_SHIFT)) & I2S_RCSR_WSIE_MASK) - -#define I2S_RCSR_FWF_MASK (0x20000U) -#define I2S_RCSR_FWF_SHIFT (17U) -/*! FWF - FIFO Warning Flag - * 0b0..No enabled receive FIFO is full. - * 0b1..Enabled receive FIFO is full. - */ -#define I2S_RCSR_FWF(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FWF_SHIFT)) & I2S_RCSR_FWF_MASK) - -#define I2S_RCSR_FEF_MASK (0x40000U) -#define I2S_RCSR_FEF_SHIFT (18U) -/*! FEF - FIFO Error Flag - * 0b0..Receive overflow not detected. - * 0b1..Receive overflow detected. - */ -#define I2S_RCSR_FEF(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FEF_SHIFT)) & I2S_RCSR_FEF_MASK) - -#define I2S_RCSR_SEF_MASK (0x80000U) -#define I2S_RCSR_SEF_SHIFT (19U) -/*! SEF - Sync Error Flag - * 0b0..Sync error not detected. - * 0b1..Frame sync error detected. - */ -#define I2S_RCSR_SEF(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_SEF_SHIFT)) & I2S_RCSR_SEF_MASK) - -#define I2S_RCSR_WSF_MASK (0x100000U) -#define I2S_RCSR_WSF_SHIFT (20U) -/*! WSF - Word Start Flag - * 0b0..Start of word not detected. - * 0b1..Start of word detected. - */ -#define I2S_RCSR_WSF(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_WSF_SHIFT)) & I2S_RCSR_WSF_MASK) - -#define I2S_RCSR_SR_MASK (0x1000000U) -#define I2S_RCSR_SR_SHIFT (24U) -/*! SR - Software Reset - * 0b0..No effect. - * 0b1..Software reset. - */ -#define I2S_RCSR_SR(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_SR_SHIFT)) & I2S_RCSR_SR_MASK) - -#define I2S_RCSR_FR_MASK (0x2000000U) -#define I2S_RCSR_FR_SHIFT (25U) -/*! FR - FIFO Reset - * 0b0..No effect. - * 0b1..FIFO reset. - */ -#define I2S_RCSR_FR(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FR_SHIFT)) & I2S_RCSR_FR_MASK) - -#define I2S_RCSR_BCE_MASK (0x10000000U) -#define I2S_RCSR_BCE_SHIFT (28U) -/*! BCE - Bit Clock Enable - * 0b0..Receive bit clock is disabled. - * 0b1..Receive bit clock is enabled. - */ -#define I2S_RCSR_BCE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_BCE_SHIFT)) & I2S_RCSR_BCE_MASK) - -#define I2S_RCSR_DBGE_MASK (0x20000000U) -#define I2S_RCSR_DBGE_SHIFT (29U) -/*! DBGE - Debug Enable - * 0b0..Receiver is disabled in Debug mode, after completing the current frame. - * 0b1..Receiver is enabled in Debug mode. - */ -#define I2S_RCSR_DBGE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_DBGE_SHIFT)) & I2S_RCSR_DBGE_MASK) - -#define I2S_RCSR_STOPE_MASK (0x40000000U) -#define I2S_RCSR_STOPE_SHIFT (30U) -/*! STOPE - Stop Enable - * 0b0..Receiver disabled in Stop mode. - * 0b1..Receiver enabled in Stop mode. - */ -#define I2S_RCSR_STOPE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_STOPE_SHIFT)) & I2S_RCSR_STOPE_MASK) - -#define I2S_RCSR_RE_MASK (0x80000000U) -#define I2S_RCSR_RE_SHIFT (31U) -/*! RE - Receiver Enable - * 0b0..Receiver is disabled. - * 0b1..Receiver is enabled, or receiver has been disabled and has not yet reached end of frame. - */ -#define I2S_RCSR_RE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_RE_SHIFT)) & I2S_RCSR_RE_MASK) -/*! @} */ - -/*! @name RCR2 - SAI Receive Configuration 2 Register */ -/*! @{ */ - -#define I2S_RCR2_DIV_MASK (0xFFU) -#define I2S_RCR2_DIV_SHIFT (0U) -/*! DIV - Bit Clock Divide */ -#define I2S_RCR2_DIV(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_DIV_SHIFT)) & I2S_RCR2_DIV_MASK) - -#define I2S_RCR2_BCD_MASK (0x1000000U) -#define I2S_RCR2_BCD_SHIFT (24U) -/*! BCD - Bit Clock Direction - * 0b0..Bit clock is generated externally in Slave mode. - * 0b1..Bit clock is generated internally in Master mode. - */ -#define I2S_RCR2_BCD(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_BCD_SHIFT)) & I2S_RCR2_BCD_MASK) - -#define I2S_RCR2_BCP_MASK (0x2000000U) -#define I2S_RCR2_BCP_SHIFT (25U) -/*! BCP - Bit Clock Polarity - * 0b0..Bit Clock is active high with drive outputs on rising edge and sample inputs on falling edge. - * 0b1..Bit Clock is active low with drive outputs on falling edge and sample inputs on rising edge. - */ -#define I2S_RCR2_BCP(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_BCP_SHIFT)) & I2S_RCR2_BCP_MASK) - -#define I2S_RCR2_MSEL_MASK (0xC000000U) -#define I2S_RCR2_MSEL_SHIFT (26U) -/*! MSEL - MCLK Select - * 0b00..Bus Clock selected. - * 0b01..Master Clock (MCLK) 1 option selected. - * 0b10..Master Clock (MCLK) 2 option selected. - * 0b11..Master Clock (MCLK) 3 option selected. - */ -#define I2S_RCR2_MSEL(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_MSEL_SHIFT)) & I2S_RCR2_MSEL_MASK) - -#define I2S_RCR2_BCI_MASK (0x10000000U) -#define I2S_RCR2_BCI_SHIFT (28U) -/*! BCI - Bit Clock Input - * 0b0..No effect. - * 0b1..Internal logic is clocked as if bit clock was externally generated. - */ -#define I2S_RCR2_BCI(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_BCI_SHIFT)) & I2S_RCR2_BCI_MASK) - -#define I2S_RCR2_BCS_MASK (0x20000000U) -#define I2S_RCR2_BCS_SHIFT (29U) -/*! BCS - Bit Clock Swap - * 0b0..Use the normal bit clock source. - * 0b1..Swap the bit clock source. - */ -#define I2S_RCR2_BCS(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_BCS_SHIFT)) & I2S_RCR2_BCS_MASK) - -#define I2S_RCR2_SYNC_MASK (0xC0000000U) -#define I2S_RCR2_SYNC_SHIFT (30U) -/*! SYNC - Synchronous Mode - * 0b00..Asynchronous mode. - * 0b01..Synchronous with transmitter. - * 0b10..Synchronous with another SAI receiver. - * 0b11..Synchronous with another SAI transmitter. - */ -#define I2S_RCR2_SYNC(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_SYNC_SHIFT)) & I2S_RCR2_SYNC_MASK) -/*! @} */ - -/*! @name RCR3 - SAI Receive Configuration 3 Register */ -/*! @{ */ - -#define I2S_RCR3_WDFL_MASK (0x1U) -#define I2S_RCR3_WDFL_SHIFT (0U) -/*! WDFL - Word Flag Configuration */ -#define I2S_RCR3_WDFL(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR3_WDFL_SHIFT)) & I2S_RCR3_WDFL_MASK) - -#define I2S_RCR3_RCE_MASK (0x10000U) -#define I2S_RCR3_RCE_SHIFT (16U) -/*! RCE - Receive Channel Enable - * 0b0..Receive data channel N is disabled. - * 0b1..Receive data channel N is enabled. - */ -#define I2S_RCR3_RCE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR3_RCE_SHIFT)) & I2S_RCR3_RCE_MASK) -/*! @} */ - -/*! @name RCR4 - SAI Receive Configuration 4 Register */ -/*! @{ */ - -#define I2S_RCR4_FSD_MASK (0x1U) -#define I2S_RCR4_FSD_SHIFT (0U) -/*! FSD - Frame Sync Direction - * 0b0..Frame Sync is generated externally in Slave mode. - * 0b1..Frame Sync is generated internally in Master mode. - */ -#define I2S_RCR4_FSD(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_FSD_SHIFT)) & I2S_RCR4_FSD_MASK) - -#define I2S_RCR4_FSP_MASK (0x2U) -#define I2S_RCR4_FSP_SHIFT (1U) -/*! FSP - Frame Sync Polarity - * 0b0..Frame sync is active high. - * 0b1..Frame sync is active low. - */ -#define I2S_RCR4_FSP(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_FSP_SHIFT)) & I2S_RCR4_FSP_MASK) - -#define I2S_RCR4_ONDEM_MASK (0x4U) -#define I2S_RCR4_ONDEM_SHIFT (2U) -/*! ONDEM - On Demand Mode - * 0b0..Internal frame sync is generated continuously. - * 0b1..Internal frame sync is generated when the FIFO warning flag is clear. - */ -#define I2S_RCR4_ONDEM(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_ONDEM_SHIFT)) & I2S_RCR4_ONDEM_MASK) - -#define I2S_RCR4_FSE_MASK (0x8U) -#define I2S_RCR4_FSE_SHIFT (3U) -/*! FSE - Frame Sync Early - * 0b0..Frame sync asserts with the first bit of the frame. - * 0b1..Frame sync asserts one bit before the first bit of the frame. - */ -#define I2S_RCR4_FSE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_FSE_SHIFT)) & I2S_RCR4_FSE_MASK) - -#define I2S_RCR4_MF_MASK (0x10U) -#define I2S_RCR4_MF_SHIFT (4U) -/*! MF - MSB First - * 0b0..LSB is received first. - * 0b1..MSB is received first. - */ -#define I2S_RCR4_MF(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_MF_SHIFT)) & I2S_RCR4_MF_MASK) - -#define I2S_RCR4_SYWD_MASK (0x1F00U) -#define I2S_RCR4_SYWD_SHIFT (8U) -/*! SYWD - Sync Width */ -#define I2S_RCR4_SYWD(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_SYWD_SHIFT)) & I2S_RCR4_SYWD_MASK) - -#define I2S_RCR4_FRSZ_MASK (0x10000U) -#define I2S_RCR4_FRSZ_SHIFT (16U) -/*! FRSZ - Frame Size */ -#define I2S_RCR4_FRSZ(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_FRSZ_SHIFT)) & I2S_RCR4_FRSZ_MASK) - -#define I2S_RCR4_FPACK_MASK (0x3000000U) -#define I2S_RCR4_FPACK_SHIFT (24U) -/*! FPACK - FIFO Packing Mode - * 0b00..FIFO packing is disabled - * 0b01..Reserved. - * 0b10..8-bit FIFO packing is enabled - * 0b11..16-bit FIFO packing is enabled - */ -#define I2S_RCR4_FPACK(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_FPACK_SHIFT)) & I2S_RCR4_FPACK_MASK) - -#define I2S_RCR4_FCONT_MASK (0x10000000U) -#define I2S_RCR4_FCONT_SHIFT (28U) -/*! FCONT - FIFO Continue on Error - * 0b0..On FIFO error, the SAI will continue from the start of the next frame after the FIFO error flag has been cleared. - * 0b1..On FIFO error, the SAI will continue from the same word that caused the FIFO error to set after the FIFO warning flag has been cleared. - */ -#define I2S_RCR4_FCONT(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_FCONT_SHIFT)) & I2S_RCR4_FCONT_MASK) -/*! @} */ - -/*! @name RCR5 - SAI Receive Configuration 5 Register */ -/*! @{ */ - -#define I2S_RCR5_FBT_MASK (0x1F00U) -#define I2S_RCR5_FBT_SHIFT (8U) -/*! FBT - First Bit Shifted */ -#define I2S_RCR5_FBT(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR5_FBT_SHIFT)) & I2S_RCR5_FBT_MASK) - -#define I2S_RCR5_W0W_MASK (0x1F0000U) -#define I2S_RCR5_W0W_SHIFT (16U) -/*! W0W - Word 0 Width */ -#define I2S_RCR5_W0W(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR5_W0W_SHIFT)) & I2S_RCR5_W0W_MASK) - -#define I2S_RCR5_WNW_MASK (0x1F000000U) -#define I2S_RCR5_WNW_SHIFT (24U) -/*! WNW - Word N Width */ -#define I2S_RCR5_WNW(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR5_WNW_SHIFT)) & I2S_RCR5_WNW_MASK) -/*! @} */ - -/*! @name RDR - SAI Receive Data Register */ -/*! @{ */ - -#define I2S_RDR_RDR_MASK (0xFFFFFFFFU) -#define I2S_RDR_RDR_SHIFT (0U) -/*! RDR - Receive Data Register */ -#define I2S_RDR_RDR(x) (((uint32_t)(((uint32_t)(x)) << I2S_RDR_RDR_SHIFT)) & I2S_RDR_RDR_MASK) -/*! @} */ - -/* The count of I2S_RDR */ -#define I2S_RDR_COUNT (1U) - -/*! @name RMR - SAI Receive Mask Register */ -/*! @{ */ - -#define I2S_RMR_RWM_MASK (0x3U) -#define I2S_RMR_RWM_SHIFT (0U) -/*! RWM - Receive Word Mask - * 0b00..Word N is enabled. - * 0b01..Word N is masked. - */ -#define I2S_RMR_RWM(x) (((uint32_t)(((uint32_t)(x)) << I2S_RMR_RWM_SHIFT)) & I2S_RMR_RWM_MASK) -/*! @} */ - -/*! @name MCR - SAI MCLK Control Register */ -/*! @{ */ - -#define I2S_MCR_MICS_MASK (0x3000000U) -#define I2S_MCR_MICS_SHIFT (24U) -/*! MICS - MCLK Input Clock Select - * 0b00..MCLK divider input clock 0 selected. - * 0b01..MCLK divider input clock 1 selected. - * 0b10..MCLK divider input clock 2 selected. - * 0b11..MCLK divider input clock 3 selected. - */ -#define I2S_MCR_MICS(x) (((uint32_t)(((uint32_t)(x)) << I2S_MCR_MICS_SHIFT)) & I2S_MCR_MICS_MASK) - -#define I2S_MCR_MOE_MASK (0x40000000U) -#define I2S_MCR_MOE_SHIFT (30U) -/*! MOE - MCLK Output Enable - * 0b0..MCLK signal pin is configured as an input that bypasses the MCLK divider. - * 0b1..MCLK signal pin is configured as an output from the MCLK divider and the MCLK divider is enabled. - */ -#define I2S_MCR_MOE(x) (((uint32_t)(((uint32_t)(x)) << I2S_MCR_MOE_SHIFT)) & I2S_MCR_MOE_MASK) - -#define I2S_MCR_DUF_MASK (0x80000000U) -#define I2S_MCR_DUF_SHIFT (31U) -/*! DUF - Divider Update Flag - * 0b0..MCLK divider ratio is not being updated currently. - * 0b1..MCLK divider ratio is updating on-the-fly. Further updates to the MCLK divider ratio are blocked while this flag remains set. - */ -#define I2S_MCR_DUF(x) (((uint32_t)(((uint32_t)(x)) << I2S_MCR_DUF_SHIFT)) & I2S_MCR_DUF_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group I2S_Register_Masks */ - - -/* I2S - Peripheral instance base addresses */ -/** Peripheral I2S0 base address */ -#define I2S0_BASE (0x4002F000u) -/** Peripheral I2S0 base pointer */ -#define I2S0 ((I2S_Type *)I2S0_BASE) -/** Array initializer of I2S peripheral base addresses */ -#define I2S_BASE_ADDRS { I2S0_BASE } -/** Array initializer of I2S peripheral base pointers */ -#define I2S_BASE_PTRS { I2S0 } -/** Interrupt vectors for the I2S peripheral type */ -#define I2S_RX_IRQS { I2S0_IRQn } -#define I2S_TX_IRQS { I2S0_IRQn } - -/*! - * @} - */ /* end of group I2S_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LCD Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LCD_Peripheral_Access_Layer LCD Peripheral Access Layer - * @{ - */ - -/** LCD - Register Layout Typedef */ -typedef struct { - __IO uint32_t GCR; /**< LCD General Control Register, offset: 0x0 */ - __IO uint32_t AR; /**< LCD Auxiliary Register, offset: 0x4 */ - __IO uint32_t FDCR; /**< LCD Fault Detect Control Register, offset: 0x8 */ - __IO uint32_t FDSR; /**< LCD Fault Detect Status Register, offset: 0xC */ - __IO uint32_t PEN[2]; /**< LCD Pin Enable register, array offset: 0x10, array step: 0x4 */ - __IO uint32_t BPEN[2]; /**< LCD Back Plane Enable register, array offset: 0x18, array step: 0x4 */ - union { /* offset: 0x20 */ - __IO uint8_t WF8B[64]; /**< LCD Waveform Register 0...LCD Waveform Register 63., array offset: 0x20, array step: 0x1 */ - __IO uint32_t WF[16]; /**< LCD Waveform register, array offset: 0x20, array step: 0x4 */ - }; -} LCD_Type; - -/* ---------------------------------------------------------------------------- - -- LCD Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LCD_Register_Masks LCD Register Masks - * @{ - */ - -/*! @name GCR - LCD General Control Register */ -/*! @{ */ - -#define LCD_GCR_DUTY_MASK (0x7U) -#define LCD_GCR_DUTY_SHIFT (0U) -/*! DUTY - LCD duty select - * 0b000..Use 1 BP (1/1 duty cycle). - * 0b001..Use 2 BP (1/2 duty cycle). - * 0b010..Use 3 BP (1/3 duty cycle). - * 0b011..Use 4 BP (1/4 duty cycle). (Default) - * 0b100.. - * 0b101.. - * 0b110.. - * 0b111..Use 8 BP (1/8 duty cycle). - */ -#define LCD_GCR_DUTY(x) (((uint32_t)(((uint32_t)(x)) << LCD_GCR_DUTY_SHIFT)) & LCD_GCR_DUTY_MASK) - -#define LCD_GCR_LCLK_MASK (0x38U) -#define LCD_GCR_LCLK_SHIFT (3U) -/*! LCLK - LCD Clock Prescaler */ -#define LCD_GCR_LCLK(x) (((uint32_t)(((uint32_t)(x)) << LCD_GCR_LCLK_SHIFT)) & LCD_GCR_LCLK_MASK) - -#define LCD_GCR_SOURCE_MASK (0x40U) -#define LCD_GCR_SOURCE_SHIFT (6U) -/*! SOURCE - LCD Clock Source Select - * 0b0..Selects the default clock as the LCD clock source. - * 0b1..Selects output of the alternate clock source selection (see ALTSOURCE) as the LCD clock source. - */ -#define LCD_GCR_SOURCE(x) (((uint32_t)(((uint32_t)(x)) << LCD_GCR_SOURCE_SHIFT)) & LCD_GCR_SOURCE_MASK) - -#define LCD_GCR_LCDEN_MASK (0x80U) -#define LCD_GCR_LCDEN_SHIFT (7U) -/*! LCDEN - LCD Driver Enable - * 0b0..All front plane and back plane pins are disabled. The LCD controller system is also disabled, and all LCD - * waveform generation clocks are stopped. V LL3 is connected to V DD internally. All LCD pins, LCD_Pn, - * enabled using the LCD Pin Enable register, output a low value. - * 0b1..LCD controller driver system is enabled, and front plane and back plane waveforms are generated. All LCD - * pins, LCD_Pn, enabled if PAD_SAFE is clearusing the LCD Pin Enable register, output an LCD driver - * waveform. The back plane pins output an LCD driver back plane waveform based on the settings of DUTY[2:0]. Charge - * pump or resistor bias is enabled. - */ -#define LCD_GCR_LCDEN(x) (((uint32_t)(((uint32_t)(x)) << LCD_GCR_LCDEN_SHIFT)) & LCD_GCR_LCDEN_MASK) - -#define LCD_GCR_LCDSTP_MASK (0x100U) -#define LCD_GCR_LCDSTP_SHIFT (8U) -/*! LCDSTP - LCD Stop - * 0b0..Allows the LCD driver, charge pump, resistor bias network, and voltage regulator to continue running during Stop mode. - * 0b1..Disables the LCD driver, charge pump, resistor bias network, and voltage regulator when MCU enters Stop mode. - */ -#define LCD_GCR_LCDSTP(x) (((uint32_t)(((uint32_t)(x)) << LCD_GCR_LCDSTP_SHIFT)) & LCD_GCR_LCDSTP_MASK) - -#define LCD_GCR_LCDDOZE_MASK (0x200U) -#define LCD_GCR_LCDDOZE_SHIFT (9U) -/*! LCDDOZE - LCD Doze enable - * 0b0..Allows the LCD driver, charge pump, resistor bias network, and voltage regulator to continue running during Doze mode. - * 0b1..Disables the LCD driver, charge pump, resistor bias network, and voltage regulator when MCU enters Doze mode. - */ -#define LCD_GCR_LCDDOZE(x) (((uint32_t)(((uint32_t)(x)) << LCD_GCR_LCDDOZE_SHIFT)) & LCD_GCR_LCDDOZE_MASK) - -#define LCD_GCR_FFR_MASK (0x400U) -#define LCD_GCR_FFR_SHIFT (10U) -/*! FFR - Fast Frame Rate Select - * 0b0..Standard Frame Rate LCD Frame Freq: 23.3 (min) 73.1 (max) - * 0b1..Fast Frame Rate (Standard Frame Rate x2) LCD Frame Freq: 46.6 (min) 146.2 (max) - */ -#define LCD_GCR_FFR(x) (((uint32_t)(((uint32_t)(x)) << LCD_GCR_FFR_SHIFT)) & LCD_GCR_FFR_MASK) - -#define LCD_GCR_ALTSOURCE_MASK (0x800U) -#define LCD_GCR_ALTSOURCE_SHIFT (11U) -/*! ALTSOURCE - Selects the alternate clock source - * 0b0..Select Alternate Clock Source 1 (default) - * 0b1..Select Alternate Clock Source 2 - */ -#define LCD_GCR_ALTSOURCE(x) (((uint32_t)(((uint32_t)(x)) << LCD_GCR_ALTSOURCE_SHIFT)) & LCD_GCR_ALTSOURCE_MASK) - -#define LCD_GCR_ALTDIV_MASK (0x3000U) -#define LCD_GCR_ALTDIV_SHIFT (12U) -/*! ALTDIV - LCD AlternateClock Divider - * 0b00..Divide factor = 1 (No divide) - * 0b01..Divide factor = 8 - * 0b10..Divide factor = 64 - * 0b11..Divide factor = 512 - */ -#define LCD_GCR_ALTDIV(x) (((uint32_t)(((uint32_t)(x)) << LCD_GCR_ALTDIV_SHIFT)) & LCD_GCR_ALTDIV_MASK) - -#define LCD_GCR_FDCIEN_MASK (0x4000U) -#define LCD_GCR_FDCIEN_SHIFT (14U) -/*! FDCIEN - LCD Fault Detection Complete Interrupt Enable - * 0b0..No interrupt request is generated by this event. - * 0b1..When a fault is detected and FDCF bit is set, this event causes an interrupt request. - */ -#define LCD_GCR_FDCIEN(x) (((uint32_t)(((uint32_t)(x)) << LCD_GCR_FDCIEN_SHIFT)) & LCD_GCR_FDCIEN_MASK) - -#define LCD_GCR_PADSAFE_MASK (0x8000U) -#define LCD_GCR_PADSAFE_SHIFT (15U) -/*! PADSAFE - Pad Safe State Enable - * 0b0..LCD frontplane and backplane functions enabled according to other LCD control bits - * 0b1..LCD frontplane and backplane functions disabled - */ -#define LCD_GCR_PADSAFE(x) (((uint32_t)(((uint32_t)(x)) << LCD_GCR_PADSAFE_SHIFT)) & LCD_GCR_PADSAFE_MASK) - -#define LCD_GCR_VSUPPLY_MASK (0x20000U) -#define LCD_GCR_VSUPPLY_SHIFT (17U) -/*! VSUPPLY - Voltage Supply Control - * 0b0..Drive VLL3 internally from VDD - * 0b1..Drive VLL3 externally from VDD or drive VLL internally from vIREG - */ -#define LCD_GCR_VSUPPLY(x) (((uint32_t)(((uint32_t)(x)) << LCD_GCR_VSUPPLY_SHIFT)) & LCD_GCR_VSUPPLY_MASK) - -#define LCD_GCR_LADJ_MASK (0x300000U) -#define LCD_GCR_LADJ_SHIFT (20U) -/*! LADJ - Load Adjust */ -#define LCD_GCR_LADJ(x) (((uint32_t)(((uint32_t)(x)) << LCD_GCR_LADJ_SHIFT)) & LCD_GCR_LADJ_MASK) - -#define LCD_GCR_CPSEL_MASK (0x800000U) -#define LCD_GCR_CPSEL_SHIFT (23U) -/*! CPSEL - Charge Pump or Resistor Bias Select - * 0b0..LCD charge pump is disabled. Resistor network selected. (The internal 1/3-bias is forced.) - * 0b1..LCD charge pump is selected. Resistor network disabled. (The internal 1/3-bias is forced.) - */ -#define LCD_GCR_CPSEL(x) (((uint32_t)(((uint32_t)(x)) << LCD_GCR_CPSEL_SHIFT)) & LCD_GCR_CPSEL_MASK) - -#define LCD_GCR_RVTRIM_MASK (0xF000000U) -#define LCD_GCR_RVTRIM_SHIFT (24U) -/*! RVTRIM - Regulated Voltage Trim */ -#define LCD_GCR_RVTRIM(x) (((uint32_t)(((uint32_t)(x)) << LCD_GCR_RVTRIM_SHIFT)) & LCD_GCR_RVTRIM_MASK) - -#define LCD_GCR_RVEN_MASK (0x80000000U) -#define LCD_GCR_RVEN_SHIFT (31U) -/*! RVEN - Regulated Voltage Enable - * 0b0..Regulated voltage disabled. - * 0b1..Regulated voltage enabled. - */ -#define LCD_GCR_RVEN(x) (((uint32_t)(((uint32_t)(x)) << LCD_GCR_RVEN_SHIFT)) & LCD_GCR_RVEN_MASK) -/*! @} */ - -/*! @name AR - LCD Auxiliary Register */ -/*! @{ */ - -#define LCD_AR_BRATE_MASK (0x7U) -#define LCD_AR_BRATE_SHIFT (0U) -/*! BRATE - Blink-rate configuration */ -#define LCD_AR_BRATE(x) (((uint32_t)(((uint32_t)(x)) << LCD_AR_BRATE_SHIFT)) & LCD_AR_BRATE_MASK) - -#define LCD_AR_BMODE_MASK (0x8U) -#define LCD_AR_BMODE_SHIFT (3U) -/*! BMODE - Blink mode - * 0b0..Display blank during the blink period. - * 0b1..Display alternate display during blink period (Ignored if duty is 5 or greater). - */ -#define LCD_AR_BMODE(x) (((uint32_t)(((uint32_t)(x)) << LCD_AR_BMODE_SHIFT)) & LCD_AR_BMODE_MASK) - -#define LCD_AR_BLANK_MASK (0x20U) -#define LCD_AR_BLANK_SHIFT (5U) -/*! BLANK - Blank display mode - * 0b0..Normal or alternate display mode. - * 0b1..Blank display mode. - */ -#define LCD_AR_BLANK(x) (((uint32_t)(((uint32_t)(x)) << LCD_AR_BLANK_SHIFT)) & LCD_AR_BLANK_MASK) - -#define LCD_AR_ALT_MASK (0x40U) -#define LCD_AR_ALT_SHIFT (6U) -/*! ALT - Alternate display mode - * 0b0..Normal display mode. - * 0b1..Alternate display mode. - */ -#define LCD_AR_ALT(x) (((uint32_t)(((uint32_t)(x)) << LCD_AR_ALT_SHIFT)) & LCD_AR_ALT_MASK) - -#define LCD_AR_BLINK_MASK (0x80U) -#define LCD_AR_BLINK_SHIFT (7U) -/*! BLINK - Blink command - * 0b0..Disables blinking. - * 0b1..Starts blinking at blinking frequency specified by LCD blink rate calculation. - */ -#define LCD_AR_BLINK(x) (((uint32_t)(((uint32_t)(x)) << LCD_AR_BLINK_SHIFT)) & LCD_AR_BLINK_MASK) -/*! @} */ - -/*! @name FDCR - LCD Fault Detect Control Register */ -/*! @{ */ - -#define LCD_FDCR_FDPINID_MASK (0x3FU) -#define LCD_FDCR_FDPINID_SHIFT (0U) -/*! FDPINID - Fault Detect Pin ID - * 0b000000..Fault detection for LCD_P0 pin. - * 0b000001..Fault detection for LCD_P1 pin. - * 0b111111..Fault detection for LCD_P63 pin. - */ -#define LCD_FDCR_FDPINID(x) (((uint32_t)(((uint32_t)(x)) << LCD_FDCR_FDPINID_SHIFT)) & LCD_FDCR_FDPINID_MASK) - -#define LCD_FDCR_FDBPEN_MASK (0x40U) -#define LCD_FDCR_FDBPEN_SHIFT (6U) -/*! FDBPEN - Fault Detect Back Plane Enable - * 0b0..Type of the selected pin under fault detect test is front plane. - * 0b1..Type of the selected pin under fault detect test is back plane. - */ -#define LCD_FDCR_FDBPEN(x) (((uint32_t)(((uint32_t)(x)) << LCD_FDCR_FDBPEN_SHIFT)) & LCD_FDCR_FDBPEN_MASK) - -#define LCD_FDCR_FDEN_MASK (0x80U) -#define LCD_FDCR_FDEN_SHIFT (7U) -/*! FDEN - Fault Detect Enable - * 0b0..Disable fault detection. - * 0b1..Enable fault detection. - */ -#define LCD_FDCR_FDEN(x) (((uint32_t)(((uint32_t)(x)) << LCD_FDCR_FDEN_SHIFT)) & LCD_FDCR_FDEN_MASK) - -#define LCD_FDCR_FDSWW_MASK (0xE00U) -#define LCD_FDCR_FDSWW_SHIFT (9U) -/*! FDSWW - Fault Detect Sample Window Width - * 0b000..Sample window width is 4 sample clock cycles. - * 0b001..Sample window width is 8 sample clock cycles. - * 0b010..Sample window width is 16 sample clock cycles. - * 0b011..Sample window width is 32 sample clock cycles. - * 0b100..Sample window width is 64 sample clock cycles. - * 0b101..Sample window width is 128 sample clock cycles. - * 0b110..Sample window width is 256 sample clock cycles. - * 0b111..Sample window width is 512 sample clock cycles. - */ -#define LCD_FDCR_FDSWW(x) (((uint32_t)(((uint32_t)(x)) << LCD_FDCR_FDSWW_SHIFT)) & LCD_FDCR_FDSWW_MASK) - -#define LCD_FDCR_FDPRS_MASK (0x7000U) -#define LCD_FDCR_FDPRS_SHIFT (12U) -/*! FDPRS - Fault Detect Clock Prescaler - * 0b000..1/1 bus clock. - * 0b001..1/2 bus clock. - * 0b010..1/4 bus clock. - * 0b011..1/8 bus clock. - * 0b100..1/16 bus clock. - * 0b101..1/32 bus clock. - * 0b110..1/64 bus clock. - * 0b111..1/128 bus clock. - */ -#define LCD_FDCR_FDPRS(x) (((uint32_t)(((uint32_t)(x)) << LCD_FDCR_FDPRS_SHIFT)) & LCD_FDCR_FDPRS_MASK) -/*! @} */ - -/*! @name FDSR - LCD Fault Detect Status Register */ -/*! @{ */ - -#define LCD_FDSR_FDCNT_MASK (0xFFU) -#define LCD_FDSR_FDCNT_SHIFT (0U) -/*! FDCNT - Fault Detect Counter - * 0b00000000..No "one" samples. - * 0b00000001..1 "one" samples. - * 0b00000010..2 "one" samples. - * 0b11111110..254 "one" samples. - * 0b11111111..255 or more "one" samples. The FDCNT can overflow. Therefore, FDSWW and FDPRS must be reconfigured for proper sampling. - */ -#define LCD_FDSR_FDCNT(x) (((uint32_t)(((uint32_t)(x)) << LCD_FDSR_FDCNT_SHIFT)) & LCD_FDSR_FDCNT_MASK) - -#define LCD_FDSR_FDCF_MASK (0x8000U) -#define LCD_FDSR_FDCF_SHIFT (15U) -/*! FDCF - Fault Detection Complete Flag - * 0b0..Fault detection is not completed. - * 0b1..Fault detection is completed. - */ -#define LCD_FDSR_FDCF(x) (((uint32_t)(((uint32_t)(x)) << LCD_FDSR_FDCF_SHIFT)) & LCD_FDSR_FDCF_MASK) -/*! @} */ - -/*! @name PEN - LCD Pin Enable register */ -/*! @{ */ - -#define LCD_PEN_PEN_MASK (0xFFFFFFFFU) -#define LCD_PEN_PEN_SHIFT (0U) -/*! PEN - LCD Pin Enable - * 0b00000000000000000000000000000000..LCD operation disabled on LCD_Pn. - * 0b00000000000000000000000000000001..LCD operation enabled on LCD_Pn. - */ -#define LCD_PEN_PEN(x) (((uint32_t)(((uint32_t)(x)) << LCD_PEN_PEN_SHIFT)) & LCD_PEN_PEN_MASK) -/*! @} */ - -/* The count of LCD_PEN */ -#define LCD_PEN_COUNT (2U) - -/*! @name BPEN - LCD Back Plane Enable register */ -/*! @{ */ - -#define LCD_BPEN_BPEN_MASK (0xFFFFFFFFU) -#define LCD_BPEN_BPEN_SHIFT (0U) -/*! BPEN - Back Plane Enable - * 0b00000000000000000000000000000000..Front plane operation enabled on LCD_Pn. - * 0b00000000000000000000000000000001..Back plane operation enabled on LCD_Pn. - */ -#define LCD_BPEN_BPEN(x) (((uint32_t)(((uint32_t)(x)) << LCD_BPEN_BPEN_SHIFT)) & LCD_BPEN_BPEN_MASK) -/*! @} */ - -/* The count of LCD_BPEN */ -#define LCD_BPEN_COUNT (2U) - -/*! @name WF8B - LCD Waveform Register 0...LCD Waveform Register 63. */ -/*! @{ */ - -#define LCD_WF8B_BPALCD0_MASK (0x1U) -#define LCD_WF8B_BPALCD0_SHIFT (0U) -/*! BPALCD0 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD0(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD0_SHIFT)) & LCD_WF8B_BPALCD0_MASK) - -#define LCD_WF8B_BPALCD1_MASK (0x1U) -#define LCD_WF8B_BPALCD1_SHIFT (0U) -/*! BPALCD1 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD1(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD1_SHIFT)) & LCD_WF8B_BPALCD1_MASK) - -#define LCD_WF8B_BPALCD2_MASK (0x1U) -#define LCD_WF8B_BPALCD2_SHIFT (0U) -/*! BPALCD2 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD2(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD2_SHIFT)) & LCD_WF8B_BPALCD2_MASK) - -#define LCD_WF8B_BPALCD3_MASK (0x1U) -#define LCD_WF8B_BPALCD3_SHIFT (0U) -/*! BPALCD3 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD3(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD3_SHIFT)) & LCD_WF8B_BPALCD3_MASK) - -#define LCD_WF8B_BPALCD4_MASK (0x1U) -#define LCD_WF8B_BPALCD4_SHIFT (0U) -/*! BPALCD4 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD4(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD4_SHIFT)) & LCD_WF8B_BPALCD4_MASK) - -#define LCD_WF8B_BPALCD5_MASK (0x1U) -#define LCD_WF8B_BPALCD5_SHIFT (0U) -/*! BPALCD5 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD5(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD5_SHIFT)) & LCD_WF8B_BPALCD5_MASK) - -#define LCD_WF8B_BPALCD6_MASK (0x1U) -#define LCD_WF8B_BPALCD6_SHIFT (0U) -/*! BPALCD6 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD6(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD6_SHIFT)) & LCD_WF8B_BPALCD6_MASK) - -#define LCD_WF8B_BPALCD7_MASK (0x1U) -#define LCD_WF8B_BPALCD7_SHIFT (0U) -/*! BPALCD7 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD7(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD7_SHIFT)) & LCD_WF8B_BPALCD7_MASK) - -#define LCD_WF8B_BPALCD8_MASK (0x1U) -#define LCD_WF8B_BPALCD8_SHIFT (0U) -/*! BPALCD8 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD8(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD8_SHIFT)) & LCD_WF8B_BPALCD8_MASK) - -#define LCD_WF8B_BPALCD9_MASK (0x1U) -#define LCD_WF8B_BPALCD9_SHIFT (0U) -/*! BPALCD9 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD9(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD9_SHIFT)) & LCD_WF8B_BPALCD9_MASK) - -#define LCD_WF8B_BPALCD10_MASK (0x1U) -#define LCD_WF8B_BPALCD10_SHIFT (0U) -/*! BPALCD10 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD10(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD10_SHIFT)) & LCD_WF8B_BPALCD10_MASK) - -#define LCD_WF8B_BPALCD11_MASK (0x1U) -#define LCD_WF8B_BPALCD11_SHIFT (0U) -/*! BPALCD11 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD11(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD11_SHIFT)) & LCD_WF8B_BPALCD11_MASK) - -#define LCD_WF8B_BPALCD12_MASK (0x1U) -#define LCD_WF8B_BPALCD12_SHIFT (0U) -/*! BPALCD12 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD12(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD12_SHIFT)) & LCD_WF8B_BPALCD12_MASK) - -#define LCD_WF8B_BPALCD13_MASK (0x1U) -#define LCD_WF8B_BPALCD13_SHIFT (0U) -/*! BPALCD13 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD13(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD13_SHIFT)) & LCD_WF8B_BPALCD13_MASK) - -#define LCD_WF8B_BPALCD14_MASK (0x1U) -#define LCD_WF8B_BPALCD14_SHIFT (0U) -/*! BPALCD14 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD14(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD14_SHIFT)) & LCD_WF8B_BPALCD14_MASK) - -#define LCD_WF8B_BPALCD15_MASK (0x1U) -#define LCD_WF8B_BPALCD15_SHIFT (0U) -/*! BPALCD15 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD15(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD15_SHIFT)) & LCD_WF8B_BPALCD15_MASK) - -#define LCD_WF8B_BPALCD16_MASK (0x1U) -#define LCD_WF8B_BPALCD16_SHIFT (0U) -/*! BPALCD16 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD16(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD16_SHIFT)) & LCD_WF8B_BPALCD16_MASK) - -#define LCD_WF8B_BPALCD17_MASK (0x1U) -#define LCD_WF8B_BPALCD17_SHIFT (0U) -/*! BPALCD17 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD17(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD17_SHIFT)) & LCD_WF8B_BPALCD17_MASK) - -#define LCD_WF8B_BPALCD18_MASK (0x1U) -#define LCD_WF8B_BPALCD18_SHIFT (0U) -/*! BPALCD18 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD18(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD18_SHIFT)) & LCD_WF8B_BPALCD18_MASK) - -#define LCD_WF8B_BPALCD19_MASK (0x1U) -#define LCD_WF8B_BPALCD19_SHIFT (0U) -/*! BPALCD19 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD19(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD19_SHIFT)) & LCD_WF8B_BPALCD19_MASK) - -#define LCD_WF8B_BPALCD20_MASK (0x1U) -#define LCD_WF8B_BPALCD20_SHIFT (0U) -/*! BPALCD20 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD20(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD20_SHIFT)) & LCD_WF8B_BPALCD20_MASK) - -#define LCD_WF8B_BPALCD21_MASK (0x1U) -#define LCD_WF8B_BPALCD21_SHIFT (0U) -/*! BPALCD21 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD21(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD21_SHIFT)) & LCD_WF8B_BPALCD21_MASK) - -#define LCD_WF8B_BPALCD22_MASK (0x1U) -#define LCD_WF8B_BPALCD22_SHIFT (0U) -/*! BPALCD22 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD22(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD22_SHIFT)) & LCD_WF8B_BPALCD22_MASK) - -#define LCD_WF8B_BPALCD23_MASK (0x1U) -#define LCD_WF8B_BPALCD23_SHIFT (0U) -/*! BPALCD23 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD23(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD23_SHIFT)) & LCD_WF8B_BPALCD23_MASK) - -#define LCD_WF8B_BPALCD24_MASK (0x1U) -#define LCD_WF8B_BPALCD24_SHIFT (0U) -/*! BPALCD24 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD24(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD24_SHIFT)) & LCD_WF8B_BPALCD24_MASK) - -#define LCD_WF8B_BPALCD25_MASK (0x1U) -#define LCD_WF8B_BPALCD25_SHIFT (0U) -/*! BPALCD25 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD25(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD25_SHIFT)) & LCD_WF8B_BPALCD25_MASK) - -#define LCD_WF8B_BPALCD26_MASK (0x1U) -#define LCD_WF8B_BPALCD26_SHIFT (0U) -/*! BPALCD26 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD26(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD26_SHIFT)) & LCD_WF8B_BPALCD26_MASK) - -#define LCD_WF8B_BPALCD27_MASK (0x1U) -#define LCD_WF8B_BPALCD27_SHIFT (0U) -/*! BPALCD27 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD27(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD27_SHIFT)) & LCD_WF8B_BPALCD27_MASK) - -#define LCD_WF8B_BPALCD28_MASK (0x1U) -#define LCD_WF8B_BPALCD28_SHIFT (0U) -/*! BPALCD28 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD28(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD28_SHIFT)) & LCD_WF8B_BPALCD28_MASK) - -#define LCD_WF8B_BPALCD29_MASK (0x1U) -#define LCD_WF8B_BPALCD29_SHIFT (0U) -/*! BPALCD29 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD29(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD29_SHIFT)) & LCD_WF8B_BPALCD29_MASK) - -#define LCD_WF8B_BPALCD30_MASK (0x1U) -#define LCD_WF8B_BPALCD30_SHIFT (0U) -/*! BPALCD30 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD30(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD30_SHIFT)) & LCD_WF8B_BPALCD30_MASK) - -#define LCD_WF8B_BPALCD31_MASK (0x1U) -#define LCD_WF8B_BPALCD31_SHIFT (0U) -/*! BPALCD31 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD31(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD31_SHIFT)) & LCD_WF8B_BPALCD31_MASK) - -#define LCD_WF8B_BPALCD32_MASK (0x1U) -#define LCD_WF8B_BPALCD32_SHIFT (0U) -/*! BPALCD32 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD32(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD32_SHIFT)) & LCD_WF8B_BPALCD32_MASK) - -#define LCD_WF8B_BPALCD33_MASK (0x1U) -#define LCD_WF8B_BPALCD33_SHIFT (0U) -/*! BPALCD33 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD33(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD33_SHIFT)) & LCD_WF8B_BPALCD33_MASK) - -#define LCD_WF8B_BPALCD34_MASK (0x1U) -#define LCD_WF8B_BPALCD34_SHIFT (0U) -/*! BPALCD34 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD34(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD34_SHIFT)) & LCD_WF8B_BPALCD34_MASK) - -#define LCD_WF8B_BPALCD35_MASK (0x1U) -#define LCD_WF8B_BPALCD35_SHIFT (0U) -/*! BPALCD35 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD35(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD35_SHIFT)) & LCD_WF8B_BPALCD35_MASK) - -#define LCD_WF8B_BPALCD36_MASK (0x1U) -#define LCD_WF8B_BPALCD36_SHIFT (0U) -/*! BPALCD36 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD36(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD36_SHIFT)) & LCD_WF8B_BPALCD36_MASK) - -#define LCD_WF8B_BPALCD37_MASK (0x1U) -#define LCD_WF8B_BPALCD37_SHIFT (0U) -/*! BPALCD37 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD37(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD37_SHIFT)) & LCD_WF8B_BPALCD37_MASK) - -#define LCD_WF8B_BPALCD38_MASK (0x1U) -#define LCD_WF8B_BPALCD38_SHIFT (0U) -/*! BPALCD38 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD38(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD38_SHIFT)) & LCD_WF8B_BPALCD38_MASK) - -#define LCD_WF8B_BPALCD39_MASK (0x1U) -#define LCD_WF8B_BPALCD39_SHIFT (0U) -/*! BPALCD39 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD39(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD39_SHIFT)) & LCD_WF8B_BPALCD39_MASK) - -#define LCD_WF8B_BPALCD40_MASK (0x1U) -#define LCD_WF8B_BPALCD40_SHIFT (0U) -/*! BPALCD40 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD40(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD40_SHIFT)) & LCD_WF8B_BPALCD40_MASK) - -#define LCD_WF8B_BPALCD41_MASK (0x1U) -#define LCD_WF8B_BPALCD41_SHIFT (0U) -/*! BPALCD41 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD41(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD41_SHIFT)) & LCD_WF8B_BPALCD41_MASK) - -#define LCD_WF8B_BPALCD42_MASK (0x1U) -#define LCD_WF8B_BPALCD42_SHIFT (0U) -/*! BPALCD42 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD42(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD42_SHIFT)) & LCD_WF8B_BPALCD42_MASK) - -#define LCD_WF8B_BPALCD43_MASK (0x1U) -#define LCD_WF8B_BPALCD43_SHIFT (0U) -/*! BPALCD43 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD43(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD43_SHIFT)) & LCD_WF8B_BPALCD43_MASK) - -#define LCD_WF8B_BPALCD44_MASK (0x1U) -#define LCD_WF8B_BPALCD44_SHIFT (0U) -/*! BPALCD44 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD44(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD44_SHIFT)) & LCD_WF8B_BPALCD44_MASK) - -#define LCD_WF8B_BPALCD45_MASK (0x1U) -#define LCD_WF8B_BPALCD45_SHIFT (0U) -/*! BPALCD45 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD45(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD45_SHIFT)) & LCD_WF8B_BPALCD45_MASK) - -#define LCD_WF8B_BPALCD46_MASK (0x1U) -#define LCD_WF8B_BPALCD46_SHIFT (0U) -/*! BPALCD46 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD46(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD46_SHIFT)) & LCD_WF8B_BPALCD46_MASK) - -#define LCD_WF8B_BPALCD47_MASK (0x1U) -#define LCD_WF8B_BPALCD47_SHIFT (0U) -/*! BPALCD47 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD47(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD47_SHIFT)) & LCD_WF8B_BPALCD47_MASK) - -#define LCD_WF8B_BPALCD48_MASK (0x1U) -#define LCD_WF8B_BPALCD48_SHIFT (0U) -/*! BPALCD48 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD48(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD48_SHIFT)) & LCD_WF8B_BPALCD48_MASK) - -#define LCD_WF8B_BPALCD49_MASK (0x1U) -#define LCD_WF8B_BPALCD49_SHIFT (0U) -/*! BPALCD49 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD49(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD49_SHIFT)) & LCD_WF8B_BPALCD49_MASK) - -#define LCD_WF8B_BPALCD50_MASK (0x1U) -#define LCD_WF8B_BPALCD50_SHIFT (0U) -/*! BPALCD50 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD50(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD50_SHIFT)) & LCD_WF8B_BPALCD50_MASK) - -#define LCD_WF8B_BPALCD51_MASK (0x1U) -#define LCD_WF8B_BPALCD51_SHIFT (0U) -/*! BPALCD51 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD51(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD51_SHIFT)) & LCD_WF8B_BPALCD51_MASK) - -#define LCD_WF8B_BPALCD52_MASK (0x1U) -#define LCD_WF8B_BPALCD52_SHIFT (0U) -/*! BPALCD52 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD52(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD52_SHIFT)) & LCD_WF8B_BPALCD52_MASK) - -#define LCD_WF8B_BPALCD53_MASK (0x1U) -#define LCD_WF8B_BPALCD53_SHIFT (0U) -/*! BPALCD53 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD53(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD53_SHIFT)) & LCD_WF8B_BPALCD53_MASK) - -#define LCD_WF8B_BPALCD54_MASK (0x1U) -#define LCD_WF8B_BPALCD54_SHIFT (0U) -/*! BPALCD54 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD54(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD54_SHIFT)) & LCD_WF8B_BPALCD54_MASK) - -#define LCD_WF8B_BPALCD55_MASK (0x1U) -#define LCD_WF8B_BPALCD55_SHIFT (0U) -/*! BPALCD55 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD55(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD55_SHIFT)) & LCD_WF8B_BPALCD55_MASK) - -#define LCD_WF8B_BPALCD56_MASK (0x1U) -#define LCD_WF8B_BPALCD56_SHIFT (0U) -/*! BPALCD56 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD56(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD56_SHIFT)) & LCD_WF8B_BPALCD56_MASK) - -#define LCD_WF8B_BPALCD57_MASK (0x1U) -#define LCD_WF8B_BPALCD57_SHIFT (0U) -/*! BPALCD57 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD57(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD57_SHIFT)) & LCD_WF8B_BPALCD57_MASK) - -#define LCD_WF8B_BPALCD58_MASK (0x1U) -#define LCD_WF8B_BPALCD58_SHIFT (0U) -/*! BPALCD58 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD58(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD58_SHIFT)) & LCD_WF8B_BPALCD58_MASK) - -#define LCD_WF8B_BPALCD59_MASK (0x1U) -#define LCD_WF8B_BPALCD59_SHIFT (0U) -/*! BPALCD59 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD59(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD59_SHIFT)) & LCD_WF8B_BPALCD59_MASK) - -#define LCD_WF8B_BPALCD60_MASK (0x1U) -#define LCD_WF8B_BPALCD60_SHIFT (0U) -/*! BPALCD60 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD60(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD60_SHIFT)) & LCD_WF8B_BPALCD60_MASK) - -#define LCD_WF8B_BPALCD61_MASK (0x1U) -#define LCD_WF8B_BPALCD61_SHIFT (0U) -/*! BPALCD61 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD61(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD61_SHIFT)) & LCD_WF8B_BPALCD61_MASK) - -#define LCD_WF8B_BPALCD62_MASK (0x1U) -#define LCD_WF8B_BPALCD62_SHIFT (0U) -/*! BPALCD62 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD62(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD62_SHIFT)) & LCD_WF8B_BPALCD62_MASK) - -#define LCD_WF8B_BPALCD63_MASK (0x1U) -#define LCD_WF8B_BPALCD63_SHIFT (0U) -/*! BPALCD63 - * 0b0..LCD segment off or LCD backplane inactive for phase A - * 0b1..LCD segment on or LCD backplane active for phase A - */ -#define LCD_WF8B_BPALCD63(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPALCD63_SHIFT)) & LCD_WF8B_BPALCD63_MASK) - -#define LCD_WF8B_BPBLCD0_MASK (0x2U) -#define LCD_WF8B_BPBLCD0_SHIFT (1U) -/*! BPBLCD0 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD0(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD0_SHIFT)) & LCD_WF8B_BPBLCD0_MASK) - -#define LCD_WF8B_BPBLCD1_MASK (0x2U) -#define LCD_WF8B_BPBLCD1_SHIFT (1U) -/*! BPBLCD1 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD1(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD1_SHIFT)) & LCD_WF8B_BPBLCD1_MASK) - -#define LCD_WF8B_BPBLCD2_MASK (0x2U) -#define LCD_WF8B_BPBLCD2_SHIFT (1U) -/*! BPBLCD2 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD2(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD2_SHIFT)) & LCD_WF8B_BPBLCD2_MASK) - -#define LCD_WF8B_BPBLCD3_MASK (0x2U) -#define LCD_WF8B_BPBLCD3_SHIFT (1U) -/*! BPBLCD3 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD3(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD3_SHIFT)) & LCD_WF8B_BPBLCD3_MASK) - -#define LCD_WF8B_BPBLCD4_MASK (0x2U) -#define LCD_WF8B_BPBLCD4_SHIFT (1U) -/*! BPBLCD4 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD4(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD4_SHIFT)) & LCD_WF8B_BPBLCD4_MASK) - -#define LCD_WF8B_BPBLCD5_MASK (0x2U) -#define LCD_WF8B_BPBLCD5_SHIFT (1U) -/*! BPBLCD5 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD5(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD5_SHIFT)) & LCD_WF8B_BPBLCD5_MASK) - -#define LCD_WF8B_BPBLCD6_MASK (0x2U) -#define LCD_WF8B_BPBLCD6_SHIFT (1U) -/*! BPBLCD6 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD6(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD6_SHIFT)) & LCD_WF8B_BPBLCD6_MASK) - -#define LCD_WF8B_BPBLCD7_MASK (0x2U) -#define LCD_WF8B_BPBLCD7_SHIFT (1U) -/*! BPBLCD7 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD7(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD7_SHIFT)) & LCD_WF8B_BPBLCD7_MASK) - -#define LCD_WF8B_BPBLCD8_MASK (0x2U) -#define LCD_WF8B_BPBLCD8_SHIFT (1U) -/*! BPBLCD8 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD8(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD8_SHIFT)) & LCD_WF8B_BPBLCD8_MASK) - -#define LCD_WF8B_BPBLCD9_MASK (0x2U) -#define LCD_WF8B_BPBLCD9_SHIFT (1U) -/*! BPBLCD9 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD9(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD9_SHIFT)) & LCD_WF8B_BPBLCD9_MASK) - -#define LCD_WF8B_BPBLCD10_MASK (0x2U) -#define LCD_WF8B_BPBLCD10_SHIFT (1U) -/*! BPBLCD10 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD10(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD10_SHIFT)) & LCD_WF8B_BPBLCD10_MASK) - -#define LCD_WF8B_BPBLCD11_MASK (0x2U) -#define LCD_WF8B_BPBLCD11_SHIFT (1U) -/*! BPBLCD11 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD11(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD11_SHIFT)) & LCD_WF8B_BPBLCD11_MASK) - -#define LCD_WF8B_BPBLCD12_MASK (0x2U) -#define LCD_WF8B_BPBLCD12_SHIFT (1U) -/*! BPBLCD12 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD12(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD12_SHIFT)) & LCD_WF8B_BPBLCD12_MASK) - -#define LCD_WF8B_BPBLCD13_MASK (0x2U) -#define LCD_WF8B_BPBLCD13_SHIFT (1U) -/*! BPBLCD13 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD13(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD13_SHIFT)) & LCD_WF8B_BPBLCD13_MASK) - -#define LCD_WF8B_BPBLCD14_MASK (0x2U) -#define LCD_WF8B_BPBLCD14_SHIFT (1U) -/*! BPBLCD14 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD14(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD14_SHIFT)) & LCD_WF8B_BPBLCD14_MASK) - -#define LCD_WF8B_BPBLCD15_MASK (0x2U) -#define LCD_WF8B_BPBLCD15_SHIFT (1U) -/*! BPBLCD15 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD15(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD15_SHIFT)) & LCD_WF8B_BPBLCD15_MASK) - -#define LCD_WF8B_BPBLCD16_MASK (0x2U) -#define LCD_WF8B_BPBLCD16_SHIFT (1U) -/*! BPBLCD16 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD16(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD16_SHIFT)) & LCD_WF8B_BPBLCD16_MASK) - -#define LCD_WF8B_BPBLCD17_MASK (0x2U) -#define LCD_WF8B_BPBLCD17_SHIFT (1U) -/*! BPBLCD17 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD17(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD17_SHIFT)) & LCD_WF8B_BPBLCD17_MASK) - -#define LCD_WF8B_BPBLCD18_MASK (0x2U) -#define LCD_WF8B_BPBLCD18_SHIFT (1U) -/*! BPBLCD18 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD18(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD18_SHIFT)) & LCD_WF8B_BPBLCD18_MASK) - -#define LCD_WF8B_BPBLCD19_MASK (0x2U) -#define LCD_WF8B_BPBLCD19_SHIFT (1U) -/*! BPBLCD19 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD19(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD19_SHIFT)) & LCD_WF8B_BPBLCD19_MASK) - -#define LCD_WF8B_BPBLCD20_MASK (0x2U) -#define LCD_WF8B_BPBLCD20_SHIFT (1U) -/*! BPBLCD20 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD20(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD20_SHIFT)) & LCD_WF8B_BPBLCD20_MASK) - -#define LCD_WF8B_BPBLCD21_MASK (0x2U) -#define LCD_WF8B_BPBLCD21_SHIFT (1U) -/*! BPBLCD21 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD21(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD21_SHIFT)) & LCD_WF8B_BPBLCD21_MASK) - -#define LCD_WF8B_BPBLCD22_MASK (0x2U) -#define LCD_WF8B_BPBLCD22_SHIFT (1U) -/*! BPBLCD22 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD22(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD22_SHIFT)) & LCD_WF8B_BPBLCD22_MASK) - -#define LCD_WF8B_BPBLCD23_MASK (0x2U) -#define LCD_WF8B_BPBLCD23_SHIFT (1U) -/*! BPBLCD23 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD23(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD23_SHIFT)) & LCD_WF8B_BPBLCD23_MASK) - -#define LCD_WF8B_BPBLCD24_MASK (0x2U) -#define LCD_WF8B_BPBLCD24_SHIFT (1U) -/*! BPBLCD24 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD24(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD24_SHIFT)) & LCD_WF8B_BPBLCD24_MASK) - -#define LCD_WF8B_BPBLCD25_MASK (0x2U) -#define LCD_WF8B_BPBLCD25_SHIFT (1U) -/*! BPBLCD25 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD25(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD25_SHIFT)) & LCD_WF8B_BPBLCD25_MASK) - -#define LCD_WF8B_BPBLCD26_MASK (0x2U) -#define LCD_WF8B_BPBLCD26_SHIFT (1U) -/*! BPBLCD26 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD26(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD26_SHIFT)) & LCD_WF8B_BPBLCD26_MASK) - -#define LCD_WF8B_BPBLCD27_MASK (0x2U) -#define LCD_WF8B_BPBLCD27_SHIFT (1U) -/*! BPBLCD27 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD27(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD27_SHIFT)) & LCD_WF8B_BPBLCD27_MASK) - -#define LCD_WF8B_BPBLCD28_MASK (0x2U) -#define LCD_WF8B_BPBLCD28_SHIFT (1U) -/*! BPBLCD28 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD28(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD28_SHIFT)) & LCD_WF8B_BPBLCD28_MASK) - -#define LCD_WF8B_BPBLCD29_MASK (0x2U) -#define LCD_WF8B_BPBLCD29_SHIFT (1U) -/*! BPBLCD29 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD29(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD29_SHIFT)) & LCD_WF8B_BPBLCD29_MASK) - -#define LCD_WF8B_BPBLCD30_MASK (0x2U) -#define LCD_WF8B_BPBLCD30_SHIFT (1U) -/*! BPBLCD30 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD30(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD30_SHIFT)) & LCD_WF8B_BPBLCD30_MASK) - -#define LCD_WF8B_BPBLCD31_MASK (0x2U) -#define LCD_WF8B_BPBLCD31_SHIFT (1U) -/*! BPBLCD31 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD31(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD31_SHIFT)) & LCD_WF8B_BPBLCD31_MASK) - -#define LCD_WF8B_BPBLCD32_MASK (0x2U) -#define LCD_WF8B_BPBLCD32_SHIFT (1U) -/*! BPBLCD32 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD32(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD32_SHIFT)) & LCD_WF8B_BPBLCD32_MASK) - -#define LCD_WF8B_BPBLCD33_MASK (0x2U) -#define LCD_WF8B_BPBLCD33_SHIFT (1U) -/*! BPBLCD33 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD33(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD33_SHIFT)) & LCD_WF8B_BPBLCD33_MASK) - -#define LCD_WF8B_BPBLCD34_MASK (0x2U) -#define LCD_WF8B_BPBLCD34_SHIFT (1U) -/*! BPBLCD34 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD34(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD34_SHIFT)) & LCD_WF8B_BPBLCD34_MASK) - -#define LCD_WF8B_BPBLCD35_MASK (0x2U) -#define LCD_WF8B_BPBLCD35_SHIFT (1U) -/*! BPBLCD35 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD35(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD35_SHIFT)) & LCD_WF8B_BPBLCD35_MASK) - -#define LCD_WF8B_BPBLCD36_MASK (0x2U) -#define LCD_WF8B_BPBLCD36_SHIFT (1U) -/*! BPBLCD36 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD36(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD36_SHIFT)) & LCD_WF8B_BPBLCD36_MASK) - -#define LCD_WF8B_BPBLCD37_MASK (0x2U) -#define LCD_WF8B_BPBLCD37_SHIFT (1U) -/*! BPBLCD37 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD37(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD37_SHIFT)) & LCD_WF8B_BPBLCD37_MASK) - -#define LCD_WF8B_BPBLCD38_MASK (0x2U) -#define LCD_WF8B_BPBLCD38_SHIFT (1U) -/*! BPBLCD38 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD38(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD38_SHIFT)) & LCD_WF8B_BPBLCD38_MASK) - -#define LCD_WF8B_BPBLCD39_MASK (0x2U) -#define LCD_WF8B_BPBLCD39_SHIFT (1U) -/*! BPBLCD39 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD39(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD39_SHIFT)) & LCD_WF8B_BPBLCD39_MASK) - -#define LCD_WF8B_BPBLCD40_MASK (0x2U) -#define LCD_WF8B_BPBLCD40_SHIFT (1U) -/*! BPBLCD40 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD40(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD40_SHIFT)) & LCD_WF8B_BPBLCD40_MASK) - -#define LCD_WF8B_BPBLCD41_MASK (0x2U) -#define LCD_WF8B_BPBLCD41_SHIFT (1U) -/*! BPBLCD41 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD41(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD41_SHIFT)) & LCD_WF8B_BPBLCD41_MASK) - -#define LCD_WF8B_BPBLCD42_MASK (0x2U) -#define LCD_WF8B_BPBLCD42_SHIFT (1U) -/*! BPBLCD42 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD42(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD42_SHIFT)) & LCD_WF8B_BPBLCD42_MASK) - -#define LCD_WF8B_BPBLCD43_MASK (0x2U) -#define LCD_WF8B_BPBLCD43_SHIFT (1U) -/*! BPBLCD43 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD43(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD43_SHIFT)) & LCD_WF8B_BPBLCD43_MASK) - -#define LCD_WF8B_BPBLCD44_MASK (0x2U) -#define LCD_WF8B_BPBLCD44_SHIFT (1U) -/*! BPBLCD44 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD44(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD44_SHIFT)) & LCD_WF8B_BPBLCD44_MASK) - -#define LCD_WF8B_BPBLCD45_MASK (0x2U) -#define LCD_WF8B_BPBLCD45_SHIFT (1U) -/*! BPBLCD45 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD45(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD45_SHIFT)) & LCD_WF8B_BPBLCD45_MASK) - -#define LCD_WF8B_BPBLCD46_MASK (0x2U) -#define LCD_WF8B_BPBLCD46_SHIFT (1U) -/*! BPBLCD46 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD46(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD46_SHIFT)) & LCD_WF8B_BPBLCD46_MASK) - -#define LCD_WF8B_BPBLCD47_MASK (0x2U) -#define LCD_WF8B_BPBLCD47_SHIFT (1U) -/*! BPBLCD47 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD47(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD47_SHIFT)) & LCD_WF8B_BPBLCD47_MASK) - -#define LCD_WF8B_BPBLCD48_MASK (0x2U) -#define LCD_WF8B_BPBLCD48_SHIFT (1U) -/*! BPBLCD48 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD48(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD48_SHIFT)) & LCD_WF8B_BPBLCD48_MASK) - -#define LCD_WF8B_BPBLCD49_MASK (0x2U) -#define LCD_WF8B_BPBLCD49_SHIFT (1U) -/*! BPBLCD49 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD49(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD49_SHIFT)) & LCD_WF8B_BPBLCD49_MASK) - -#define LCD_WF8B_BPBLCD50_MASK (0x2U) -#define LCD_WF8B_BPBLCD50_SHIFT (1U) -/*! BPBLCD50 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD50(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD50_SHIFT)) & LCD_WF8B_BPBLCD50_MASK) - -#define LCD_WF8B_BPBLCD51_MASK (0x2U) -#define LCD_WF8B_BPBLCD51_SHIFT (1U) -/*! BPBLCD51 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD51(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD51_SHIFT)) & LCD_WF8B_BPBLCD51_MASK) - -#define LCD_WF8B_BPBLCD52_MASK (0x2U) -#define LCD_WF8B_BPBLCD52_SHIFT (1U) -/*! BPBLCD52 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD52(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD52_SHIFT)) & LCD_WF8B_BPBLCD52_MASK) - -#define LCD_WF8B_BPBLCD53_MASK (0x2U) -#define LCD_WF8B_BPBLCD53_SHIFT (1U) -/*! BPBLCD53 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD53(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD53_SHIFT)) & LCD_WF8B_BPBLCD53_MASK) - -#define LCD_WF8B_BPBLCD54_MASK (0x2U) -#define LCD_WF8B_BPBLCD54_SHIFT (1U) -/*! BPBLCD54 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD54(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD54_SHIFT)) & LCD_WF8B_BPBLCD54_MASK) - -#define LCD_WF8B_BPBLCD55_MASK (0x2U) -#define LCD_WF8B_BPBLCD55_SHIFT (1U) -/*! BPBLCD55 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD55(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD55_SHIFT)) & LCD_WF8B_BPBLCD55_MASK) - -#define LCD_WF8B_BPBLCD56_MASK (0x2U) -#define LCD_WF8B_BPBLCD56_SHIFT (1U) -/*! BPBLCD56 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD56(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD56_SHIFT)) & LCD_WF8B_BPBLCD56_MASK) - -#define LCD_WF8B_BPBLCD57_MASK (0x2U) -#define LCD_WF8B_BPBLCD57_SHIFT (1U) -/*! BPBLCD57 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD57(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD57_SHIFT)) & LCD_WF8B_BPBLCD57_MASK) - -#define LCD_WF8B_BPBLCD58_MASK (0x2U) -#define LCD_WF8B_BPBLCD58_SHIFT (1U) -/*! BPBLCD58 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD58(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD58_SHIFT)) & LCD_WF8B_BPBLCD58_MASK) - -#define LCD_WF8B_BPBLCD59_MASK (0x2U) -#define LCD_WF8B_BPBLCD59_SHIFT (1U) -/*! BPBLCD59 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD59(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD59_SHIFT)) & LCD_WF8B_BPBLCD59_MASK) - -#define LCD_WF8B_BPBLCD60_MASK (0x2U) -#define LCD_WF8B_BPBLCD60_SHIFT (1U) -/*! BPBLCD60 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD60(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD60_SHIFT)) & LCD_WF8B_BPBLCD60_MASK) - -#define LCD_WF8B_BPBLCD61_MASK (0x2U) -#define LCD_WF8B_BPBLCD61_SHIFT (1U) -/*! BPBLCD61 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD61(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD61_SHIFT)) & LCD_WF8B_BPBLCD61_MASK) - -#define LCD_WF8B_BPBLCD62_MASK (0x2U) -#define LCD_WF8B_BPBLCD62_SHIFT (1U) -/*! BPBLCD62 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD62(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD62_SHIFT)) & LCD_WF8B_BPBLCD62_MASK) - -#define LCD_WF8B_BPBLCD63_MASK (0x2U) -#define LCD_WF8B_BPBLCD63_SHIFT (1U) -/*! BPBLCD63 - * 0b0..LCD segment off or LCD backplane inactive for phase B - * 0b1..LCD segment on or LCD backplane active for phase B - */ -#define LCD_WF8B_BPBLCD63(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPBLCD63_SHIFT)) & LCD_WF8B_BPBLCD63_MASK) - -#define LCD_WF8B_BPCLCD0_MASK (0x4U) -#define LCD_WF8B_BPCLCD0_SHIFT (2U) -/*! BPCLCD0 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD0(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD0_SHIFT)) & LCD_WF8B_BPCLCD0_MASK) - -#define LCD_WF8B_BPCLCD1_MASK (0x4U) -#define LCD_WF8B_BPCLCD1_SHIFT (2U) -/*! BPCLCD1 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD1(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD1_SHIFT)) & LCD_WF8B_BPCLCD1_MASK) - -#define LCD_WF8B_BPCLCD2_MASK (0x4U) -#define LCD_WF8B_BPCLCD2_SHIFT (2U) -/*! BPCLCD2 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD2(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD2_SHIFT)) & LCD_WF8B_BPCLCD2_MASK) - -#define LCD_WF8B_BPCLCD3_MASK (0x4U) -#define LCD_WF8B_BPCLCD3_SHIFT (2U) -/*! BPCLCD3 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD3(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD3_SHIFT)) & LCD_WF8B_BPCLCD3_MASK) - -#define LCD_WF8B_BPCLCD4_MASK (0x4U) -#define LCD_WF8B_BPCLCD4_SHIFT (2U) -/*! BPCLCD4 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD4(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD4_SHIFT)) & LCD_WF8B_BPCLCD4_MASK) - -#define LCD_WF8B_BPCLCD5_MASK (0x4U) -#define LCD_WF8B_BPCLCD5_SHIFT (2U) -/*! BPCLCD5 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD5(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD5_SHIFT)) & LCD_WF8B_BPCLCD5_MASK) - -#define LCD_WF8B_BPCLCD6_MASK (0x4U) -#define LCD_WF8B_BPCLCD6_SHIFT (2U) -/*! BPCLCD6 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD6(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD6_SHIFT)) & LCD_WF8B_BPCLCD6_MASK) - -#define LCD_WF8B_BPCLCD7_MASK (0x4U) -#define LCD_WF8B_BPCLCD7_SHIFT (2U) -/*! BPCLCD7 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD7(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD7_SHIFT)) & LCD_WF8B_BPCLCD7_MASK) - -#define LCD_WF8B_BPCLCD8_MASK (0x4U) -#define LCD_WF8B_BPCLCD8_SHIFT (2U) -/*! BPCLCD8 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD8(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD8_SHIFT)) & LCD_WF8B_BPCLCD8_MASK) - -#define LCD_WF8B_BPCLCD9_MASK (0x4U) -#define LCD_WF8B_BPCLCD9_SHIFT (2U) -/*! BPCLCD9 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD9(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD9_SHIFT)) & LCD_WF8B_BPCLCD9_MASK) - -#define LCD_WF8B_BPCLCD10_MASK (0x4U) -#define LCD_WF8B_BPCLCD10_SHIFT (2U) -/*! BPCLCD10 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD10(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD10_SHIFT)) & LCD_WF8B_BPCLCD10_MASK) - -#define LCD_WF8B_BPCLCD11_MASK (0x4U) -#define LCD_WF8B_BPCLCD11_SHIFT (2U) -/*! BPCLCD11 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD11(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD11_SHIFT)) & LCD_WF8B_BPCLCD11_MASK) - -#define LCD_WF8B_BPCLCD12_MASK (0x4U) -#define LCD_WF8B_BPCLCD12_SHIFT (2U) -/*! BPCLCD12 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD12(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD12_SHIFT)) & LCD_WF8B_BPCLCD12_MASK) - -#define LCD_WF8B_BPCLCD13_MASK (0x4U) -#define LCD_WF8B_BPCLCD13_SHIFT (2U) -/*! BPCLCD13 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD13(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD13_SHIFT)) & LCD_WF8B_BPCLCD13_MASK) - -#define LCD_WF8B_BPCLCD14_MASK (0x4U) -#define LCD_WF8B_BPCLCD14_SHIFT (2U) -/*! BPCLCD14 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD14(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD14_SHIFT)) & LCD_WF8B_BPCLCD14_MASK) - -#define LCD_WF8B_BPCLCD15_MASK (0x4U) -#define LCD_WF8B_BPCLCD15_SHIFT (2U) -/*! BPCLCD15 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD15(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD15_SHIFT)) & LCD_WF8B_BPCLCD15_MASK) - -#define LCD_WF8B_BPCLCD16_MASK (0x4U) -#define LCD_WF8B_BPCLCD16_SHIFT (2U) -/*! BPCLCD16 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD16(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD16_SHIFT)) & LCD_WF8B_BPCLCD16_MASK) - -#define LCD_WF8B_BPCLCD17_MASK (0x4U) -#define LCD_WF8B_BPCLCD17_SHIFT (2U) -/*! BPCLCD17 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD17(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD17_SHIFT)) & LCD_WF8B_BPCLCD17_MASK) - -#define LCD_WF8B_BPCLCD18_MASK (0x4U) -#define LCD_WF8B_BPCLCD18_SHIFT (2U) -/*! BPCLCD18 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD18(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD18_SHIFT)) & LCD_WF8B_BPCLCD18_MASK) - -#define LCD_WF8B_BPCLCD19_MASK (0x4U) -#define LCD_WF8B_BPCLCD19_SHIFT (2U) -/*! BPCLCD19 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD19(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD19_SHIFT)) & LCD_WF8B_BPCLCD19_MASK) - -#define LCD_WF8B_BPCLCD20_MASK (0x4U) -#define LCD_WF8B_BPCLCD20_SHIFT (2U) -/*! BPCLCD20 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD20(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD20_SHIFT)) & LCD_WF8B_BPCLCD20_MASK) - -#define LCD_WF8B_BPCLCD21_MASK (0x4U) -#define LCD_WF8B_BPCLCD21_SHIFT (2U) -/*! BPCLCD21 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD21(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD21_SHIFT)) & LCD_WF8B_BPCLCD21_MASK) - -#define LCD_WF8B_BPCLCD22_MASK (0x4U) -#define LCD_WF8B_BPCLCD22_SHIFT (2U) -/*! BPCLCD22 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD22(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD22_SHIFT)) & LCD_WF8B_BPCLCD22_MASK) - -#define LCD_WF8B_BPCLCD23_MASK (0x4U) -#define LCD_WF8B_BPCLCD23_SHIFT (2U) -/*! BPCLCD23 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD23(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD23_SHIFT)) & LCD_WF8B_BPCLCD23_MASK) - -#define LCD_WF8B_BPCLCD24_MASK (0x4U) -#define LCD_WF8B_BPCLCD24_SHIFT (2U) -/*! BPCLCD24 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD24(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD24_SHIFT)) & LCD_WF8B_BPCLCD24_MASK) - -#define LCD_WF8B_BPCLCD25_MASK (0x4U) -#define LCD_WF8B_BPCLCD25_SHIFT (2U) -/*! BPCLCD25 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD25(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD25_SHIFT)) & LCD_WF8B_BPCLCD25_MASK) - -#define LCD_WF8B_BPCLCD26_MASK (0x4U) -#define LCD_WF8B_BPCLCD26_SHIFT (2U) -/*! BPCLCD26 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD26(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD26_SHIFT)) & LCD_WF8B_BPCLCD26_MASK) - -#define LCD_WF8B_BPCLCD27_MASK (0x4U) -#define LCD_WF8B_BPCLCD27_SHIFT (2U) -/*! BPCLCD27 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD27(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD27_SHIFT)) & LCD_WF8B_BPCLCD27_MASK) - -#define LCD_WF8B_BPCLCD28_MASK (0x4U) -#define LCD_WF8B_BPCLCD28_SHIFT (2U) -/*! BPCLCD28 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD28(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD28_SHIFT)) & LCD_WF8B_BPCLCD28_MASK) - -#define LCD_WF8B_BPCLCD29_MASK (0x4U) -#define LCD_WF8B_BPCLCD29_SHIFT (2U) -/*! BPCLCD29 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD29(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD29_SHIFT)) & LCD_WF8B_BPCLCD29_MASK) - -#define LCD_WF8B_BPCLCD30_MASK (0x4U) -#define LCD_WF8B_BPCLCD30_SHIFT (2U) -/*! BPCLCD30 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD30(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD30_SHIFT)) & LCD_WF8B_BPCLCD30_MASK) - -#define LCD_WF8B_BPCLCD31_MASK (0x4U) -#define LCD_WF8B_BPCLCD31_SHIFT (2U) -/*! BPCLCD31 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD31(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD31_SHIFT)) & LCD_WF8B_BPCLCD31_MASK) - -#define LCD_WF8B_BPCLCD32_MASK (0x4U) -#define LCD_WF8B_BPCLCD32_SHIFT (2U) -/*! BPCLCD32 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD32(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD32_SHIFT)) & LCD_WF8B_BPCLCD32_MASK) - -#define LCD_WF8B_BPCLCD33_MASK (0x4U) -#define LCD_WF8B_BPCLCD33_SHIFT (2U) -/*! BPCLCD33 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD33(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD33_SHIFT)) & LCD_WF8B_BPCLCD33_MASK) - -#define LCD_WF8B_BPCLCD34_MASK (0x4U) -#define LCD_WF8B_BPCLCD34_SHIFT (2U) -/*! BPCLCD34 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD34(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD34_SHIFT)) & LCD_WF8B_BPCLCD34_MASK) - -#define LCD_WF8B_BPCLCD35_MASK (0x4U) -#define LCD_WF8B_BPCLCD35_SHIFT (2U) -/*! BPCLCD35 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD35(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD35_SHIFT)) & LCD_WF8B_BPCLCD35_MASK) - -#define LCD_WF8B_BPCLCD36_MASK (0x4U) -#define LCD_WF8B_BPCLCD36_SHIFT (2U) -/*! BPCLCD36 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD36(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD36_SHIFT)) & LCD_WF8B_BPCLCD36_MASK) - -#define LCD_WF8B_BPCLCD37_MASK (0x4U) -#define LCD_WF8B_BPCLCD37_SHIFT (2U) -/*! BPCLCD37 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD37(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD37_SHIFT)) & LCD_WF8B_BPCLCD37_MASK) - -#define LCD_WF8B_BPCLCD38_MASK (0x4U) -#define LCD_WF8B_BPCLCD38_SHIFT (2U) -/*! BPCLCD38 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD38(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD38_SHIFT)) & LCD_WF8B_BPCLCD38_MASK) - -#define LCD_WF8B_BPCLCD39_MASK (0x4U) -#define LCD_WF8B_BPCLCD39_SHIFT (2U) -/*! BPCLCD39 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD39(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD39_SHIFT)) & LCD_WF8B_BPCLCD39_MASK) - -#define LCD_WF8B_BPCLCD40_MASK (0x4U) -#define LCD_WF8B_BPCLCD40_SHIFT (2U) -/*! BPCLCD40 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD40(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD40_SHIFT)) & LCD_WF8B_BPCLCD40_MASK) - -#define LCD_WF8B_BPCLCD41_MASK (0x4U) -#define LCD_WF8B_BPCLCD41_SHIFT (2U) -/*! BPCLCD41 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD41(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD41_SHIFT)) & LCD_WF8B_BPCLCD41_MASK) - -#define LCD_WF8B_BPCLCD42_MASK (0x4U) -#define LCD_WF8B_BPCLCD42_SHIFT (2U) -/*! BPCLCD42 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD42(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD42_SHIFT)) & LCD_WF8B_BPCLCD42_MASK) - -#define LCD_WF8B_BPCLCD43_MASK (0x4U) -#define LCD_WF8B_BPCLCD43_SHIFT (2U) -/*! BPCLCD43 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD43(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD43_SHIFT)) & LCD_WF8B_BPCLCD43_MASK) - -#define LCD_WF8B_BPCLCD44_MASK (0x4U) -#define LCD_WF8B_BPCLCD44_SHIFT (2U) -/*! BPCLCD44 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD44(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD44_SHIFT)) & LCD_WF8B_BPCLCD44_MASK) - -#define LCD_WF8B_BPCLCD45_MASK (0x4U) -#define LCD_WF8B_BPCLCD45_SHIFT (2U) -/*! BPCLCD45 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD45(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD45_SHIFT)) & LCD_WF8B_BPCLCD45_MASK) - -#define LCD_WF8B_BPCLCD46_MASK (0x4U) -#define LCD_WF8B_BPCLCD46_SHIFT (2U) -/*! BPCLCD46 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD46(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD46_SHIFT)) & LCD_WF8B_BPCLCD46_MASK) - -#define LCD_WF8B_BPCLCD47_MASK (0x4U) -#define LCD_WF8B_BPCLCD47_SHIFT (2U) -/*! BPCLCD47 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD47(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD47_SHIFT)) & LCD_WF8B_BPCLCD47_MASK) - -#define LCD_WF8B_BPCLCD48_MASK (0x4U) -#define LCD_WF8B_BPCLCD48_SHIFT (2U) -/*! BPCLCD48 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD48(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD48_SHIFT)) & LCD_WF8B_BPCLCD48_MASK) - -#define LCD_WF8B_BPCLCD49_MASK (0x4U) -#define LCD_WF8B_BPCLCD49_SHIFT (2U) -/*! BPCLCD49 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD49(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD49_SHIFT)) & LCD_WF8B_BPCLCD49_MASK) - -#define LCD_WF8B_BPCLCD50_MASK (0x4U) -#define LCD_WF8B_BPCLCD50_SHIFT (2U) -/*! BPCLCD50 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD50(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD50_SHIFT)) & LCD_WF8B_BPCLCD50_MASK) - -#define LCD_WF8B_BPCLCD51_MASK (0x4U) -#define LCD_WF8B_BPCLCD51_SHIFT (2U) -/*! BPCLCD51 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD51(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD51_SHIFT)) & LCD_WF8B_BPCLCD51_MASK) - -#define LCD_WF8B_BPCLCD52_MASK (0x4U) -#define LCD_WF8B_BPCLCD52_SHIFT (2U) -/*! BPCLCD52 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD52(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD52_SHIFT)) & LCD_WF8B_BPCLCD52_MASK) - -#define LCD_WF8B_BPCLCD53_MASK (0x4U) -#define LCD_WF8B_BPCLCD53_SHIFT (2U) -/*! BPCLCD53 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD53(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD53_SHIFT)) & LCD_WF8B_BPCLCD53_MASK) - -#define LCD_WF8B_BPCLCD54_MASK (0x4U) -#define LCD_WF8B_BPCLCD54_SHIFT (2U) -/*! BPCLCD54 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD54(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD54_SHIFT)) & LCD_WF8B_BPCLCD54_MASK) - -#define LCD_WF8B_BPCLCD55_MASK (0x4U) -#define LCD_WF8B_BPCLCD55_SHIFT (2U) -/*! BPCLCD55 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD55(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD55_SHIFT)) & LCD_WF8B_BPCLCD55_MASK) - -#define LCD_WF8B_BPCLCD56_MASK (0x4U) -#define LCD_WF8B_BPCLCD56_SHIFT (2U) -/*! BPCLCD56 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD56(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD56_SHIFT)) & LCD_WF8B_BPCLCD56_MASK) - -#define LCD_WF8B_BPCLCD57_MASK (0x4U) -#define LCD_WF8B_BPCLCD57_SHIFT (2U) -/*! BPCLCD57 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD57(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD57_SHIFT)) & LCD_WF8B_BPCLCD57_MASK) - -#define LCD_WF8B_BPCLCD58_MASK (0x4U) -#define LCD_WF8B_BPCLCD58_SHIFT (2U) -/*! BPCLCD58 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD58(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD58_SHIFT)) & LCD_WF8B_BPCLCD58_MASK) - -#define LCD_WF8B_BPCLCD59_MASK (0x4U) -#define LCD_WF8B_BPCLCD59_SHIFT (2U) -/*! BPCLCD59 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD59(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD59_SHIFT)) & LCD_WF8B_BPCLCD59_MASK) - -#define LCD_WF8B_BPCLCD60_MASK (0x4U) -#define LCD_WF8B_BPCLCD60_SHIFT (2U) -/*! BPCLCD60 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD60(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD60_SHIFT)) & LCD_WF8B_BPCLCD60_MASK) - -#define LCD_WF8B_BPCLCD61_MASK (0x4U) -#define LCD_WF8B_BPCLCD61_SHIFT (2U) -/*! BPCLCD61 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD61(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD61_SHIFT)) & LCD_WF8B_BPCLCD61_MASK) - -#define LCD_WF8B_BPCLCD62_MASK (0x4U) -#define LCD_WF8B_BPCLCD62_SHIFT (2U) -/*! BPCLCD62 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD62(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD62_SHIFT)) & LCD_WF8B_BPCLCD62_MASK) - -#define LCD_WF8B_BPCLCD63_MASK (0x4U) -#define LCD_WF8B_BPCLCD63_SHIFT (2U) -/*! BPCLCD63 - * 0b0..LCD segment off or LCD backplane inactive for phase C - * 0b1..LCD segment on or LCD backplane active for phase C - */ -#define LCD_WF8B_BPCLCD63(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPCLCD63_SHIFT)) & LCD_WF8B_BPCLCD63_MASK) - -#define LCD_WF8B_BPDLCD0_MASK (0x8U) -#define LCD_WF8B_BPDLCD0_SHIFT (3U) -/*! BPDLCD0 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD0(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD0_SHIFT)) & LCD_WF8B_BPDLCD0_MASK) - -#define LCD_WF8B_BPDLCD1_MASK (0x8U) -#define LCD_WF8B_BPDLCD1_SHIFT (3U) -/*! BPDLCD1 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD1(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD1_SHIFT)) & LCD_WF8B_BPDLCD1_MASK) - -#define LCD_WF8B_BPDLCD2_MASK (0x8U) -#define LCD_WF8B_BPDLCD2_SHIFT (3U) -/*! BPDLCD2 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD2(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD2_SHIFT)) & LCD_WF8B_BPDLCD2_MASK) - -#define LCD_WF8B_BPDLCD3_MASK (0x8U) -#define LCD_WF8B_BPDLCD3_SHIFT (3U) -/*! BPDLCD3 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD3(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD3_SHIFT)) & LCD_WF8B_BPDLCD3_MASK) - -#define LCD_WF8B_BPDLCD4_MASK (0x8U) -#define LCD_WF8B_BPDLCD4_SHIFT (3U) -/*! BPDLCD4 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD4(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD4_SHIFT)) & LCD_WF8B_BPDLCD4_MASK) - -#define LCD_WF8B_BPDLCD5_MASK (0x8U) -#define LCD_WF8B_BPDLCD5_SHIFT (3U) -/*! BPDLCD5 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD5(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD5_SHIFT)) & LCD_WF8B_BPDLCD5_MASK) - -#define LCD_WF8B_BPDLCD6_MASK (0x8U) -#define LCD_WF8B_BPDLCD6_SHIFT (3U) -/*! BPDLCD6 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD6(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD6_SHIFT)) & LCD_WF8B_BPDLCD6_MASK) - -#define LCD_WF8B_BPDLCD7_MASK (0x8U) -#define LCD_WF8B_BPDLCD7_SHIFT (3U) -/*! BPDLCD7 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD7(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD7_SHIFT)) & LCD_WF8B_BPDLCD7_MASK) - -#define LCD_WF8B_BPDLCD8_MASK (0x8U) -#define LCD_WF8B_BPDLCD8_SHIFT (3U) -/*! BPDLCD8 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD8(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD8_SHIFT)) & LCD_WF8B_BPDLCD8_MASK) - -#define LCD_WF8B_BPDLCD9_MASK (0x8U) -#define LCD_WF8B_BPDLCD9_SHIFT (3U) -/*! BPDLCD9 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD9(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD9_SHIFT)) & LCD_WF8B_BPDLCD9_MASK) - -#define LCD_WF8B_BPDLCD10_MASK (0x8U) -#define LCD_WF8B_BPDLCD10_SHIFT (3U) -/*! BPDLCD10 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD10(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD10_SHIFT)) & LCD_WF8B_BPDLCD10_MASK) - -#define LCD_WF8B_BPDLCD11_MASK (0x8U) -#define LCD_WF8B_BPDLCD11_SHIFT (3U) -/*! BPDLCD11 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD11(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD11_SHIFT)) & LCD_WF8B_BPDLCD11_MASK) - -#define LCD_WF8B_BPDLCD12_MASK (0x8U) -#define LCD_WF8B_BPDLCD12_SHIFT (3U) -/*! BPDLCD12 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD12(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD12_SHIFT)) & LCD_WF8B_BPDLCD12_MASK) - -#define LCD_WF8B_BPDLCD13_MASK (0x8U) -#define LCD_WF8B_BPDLCD13_SHIFT (3U) -/*! BPDLCD13 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD13(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD13_SHIFT)) & LCD_WF8B_BPDLCD13_MASK) - -#define LCD_WF8B_BPDLCD14_MASK (0x8U) -#define LCD_WF8B_BPDLCD14_SHIFT (3U) -/*! BPDLCD14 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD14(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD14_SHIFT)) & LCD_WF8B_BPDLCD14_MASK) - -#define LCD_WF8B_BPDLCD15_MASK (0x8U) -#define LCD_WF8B_BPDLCD15_SHIFT (3U) -/*! BPDLCD15 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD15(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD15_SHIFT)) & LCD_WF8B_BPDLCD15_MASK) - -#define LCD_WF8B_BPDLCD16_MASK (0x8U) -#define LCD_WF8B_BPDLCD16_SHIFT (3U) -/*! BPDLCD16 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD16(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD16_SHIFT)) & LCD_WF8B_BPDLCD16_MASK) - -#define LCD_WF8B_BPDLCD17_MASK (0x8U) -#define LCD_WF8B_BPDLCD17_SHIFT (3U) -/*! BPDLCD17 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD17(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD17_SHIFT)) & LCD_WF8B_BPDLCD17_MASK) - -#define LCD_WF8B_BPDLCD18_MASK (0x8U) -#define LCD_WF8B_BPDLCD18_SHIFT (3U) -/*! BPDLCD18 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD18(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD18_SHIFT)) & LCD_WF8B_BPDLCD18_MASK) - -#define LCD_WF8B_BPDLCD19_MASK (0x8U) -#define LCD_WF8B_BPDLCD19_SHIFT (3U) -/*! BPDLCD19 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD19(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD19_SHIFT)) & LCD_WF8B_BPDLCD19_MASK) - -#define LCD_WF8B_BPDLCD20_MASK (0x8U) -#define LCD_WF8B_BPDLCD20_SHIFT (3U) -/*! BPDLCD20 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD20(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD20_SHIFT)) & LCD_WF8B_BPDLCD20_MASK) - -#define LCD_WF8B_BPDLCD21_MASK (0x8U) -#define LCD_WF8B_BPDLCD21_SHIFT (3U) -/*! BPDLCD21 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD21(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD21_SHIFT)) & LCD_WF8B_BPDLCD21_MASK) - -#define LCD_WF8B_BPDLCD22_MASK (0x8U) -#define LCD_WF8B_BPDLCD22_SHIFT (3U) -/*! BPDLCD22 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD22(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD22_SHIFT)) & LCD_WF8B_BPDLCD22_MASK) - -#define LCD_WF8B_BPDLCD23_MASK (0x8U) -#define LCD_WF8B_BPDLCD23_SHIFT (3U) -/*! BPDLCD23 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD23(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD23_SHIFT)) & LCD_WF8B_BPDLCD23_MASK) - -#define LCD_WF8B_BPDLCD24_MASK (0x8U) -#define LCD_WF8B_BPDLCD24_SHIFT (3U) -/*! BPDLCD24 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD24(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD24_SHIFT)) & LCD_WF8B_BPDLCD24_MASK) - -#define LCD_WF8B_BPDLCD25_MASK (0x8U) -#define LCD_WF8B_BPDLCD25_SHIFT (3U) -/*! BPDLCD25 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD25(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD25_SHIFT)) & LCD_WF8B_BPDLCD25_MASK) - -#define LCD_WF8B_BPDLCD26_MASK (0x8U) -#define LCD_WF8B_BPDLCD26_SHIFT (3U) -/*! BPDLCD26 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD26(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD26_SHIFT)) & LCD_WF8B_BPDLCD26_MASK) - -#define LCD_WF8B_BPDLCD27_MASK (0x8U) -#define LCD_WF8B_BPDLCD27_SHIFT (3U) -/*! BPDLCD27 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD27(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD27_SHIFT)) & LCD_WF8B_BPDLCD27_MASK) - -#define LCD_WF8B_BPDLCD28_MASK (0x8U) -#define LCD_WF8B_BPDLCD28_SHIFT (3U) -/*! BPDLCD28 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD28(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD28_SHIFT)) & LCD_WF8B_BPDLCD28_MASK) - -#define LCD_WF8B_BPDLCD29_MASK (0x8U) -#define LCD_WF8B_BPDLCD29_SHIFT (3U) -/*! BPDLCD29 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD29(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD29_SHIFT)) & LCD_WF8B_BPDLCD29_MASK) - -#define LCD_WF8B_BPDLCD30_MASK (0x8U) -#define LCD_WF8B_BPDLCD30_SHIFT (3U) -/*! BPDLCD30 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD30(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD30_SHIFT)) & LCD_WF8B_BPDLCD30_MASK) - -#define LCD_WF8B_BPDLCD31_MASK (0x8U) -#define LCD_WF8B_BPDLCD31_SHIFT (3U) -/*! BPDLCD31 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD31(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD31_SHIFT)) & LCD_WF8B_BPDLCD31_MASK) - -#define LCD_WF8B_BPDLCD32_MASK (0x8U) -#define LCD_WF8B_BPDLCD32_SHIFT (3U) -/*! BPDLCD32 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD32(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD32_SHIFT)) & LCD_WF8B_BPDLCD32_MASK) - -#define LCD_WF8B_BPDLCD33_MASK (0x8U) -#define LCD_WF8B_BPDLCD33_SHIFT (3U) -/*! BPDLCD33 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD33(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD33_SHIFT)) & LCD_WF8B_BPDLCD33_MASK) - -#define LCD_WF8B_BPDLCD34_MASK (0x8U) -#define LCD_WF8B_BPDLCD34_SHIFT (3U) -/*! BPDLCD34 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD34(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD34_SHIFT)) & LCD_WF8B_BPDLCD34_MASK) - -#define LCD_WF8B_BPDLCD35_MASK (0x8U) -#define LCD_WF8B_BPDLCD35_SHIFT (3U) -/*! BPDLCD35 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD35(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD35_SHIFT)) & LCD_WF8B_BPDLCD35_MASK) - -#define LCD_WF8B_BPDLCD36_MASK (0x8U) -#define LCD_WF8B_BPDLCD36_SHIFT (3U) -/*! BPDLCD36 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD36(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD36_SHIFT)) & LCD_WF8B_BPDLCD36_MASK) - -#define LCD_WF8B_BPDLCD37_MASK (0x8U) -#define LCD_WF8B_BPDLCD37_SHIFT (3U) -/*! BPDLCD37 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD37(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD37_SHIFT)) & LCD_WF8B_BPDLCD37_MASK) - -#define LCD_WF8B_BPDLCD38_MASK (0x8U) -#define LCD_WF8B_BPDLCD38_SHIFT (3U) -/*! BPDLCD38 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD38(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD38_SHIFT)) & LCD_WF8B_BPDLCD38_MASK) - -#define LCD_WF8B_BPDLCD39_MASK (0x8U) -#define LCD_WF8B_BPDLCD39_SHIFT (3U) -/*! BPDLCD39 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD39(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD39_SHIFT)) & LCD_WF8B_BPDLCD39_MASK) - -#define LCD_WF8B_BPDLCD40_MASK (0x8U) -#define LCD_WF8B_BPDLCD40_SHIFT (3U) -/*! BPDLCD40 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD40(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD40_SHIFT)) & LCD_WF8B_BPDLCD40_MASK) - -#define LCD_WF8B_BPDLCD41_MASK (0x8U) -#define LCD_WF8B_BPDLCD41_SHIFT (3U) -/*! BPDLCD41 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD41(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD41_SHIFT)) & LCD_WF8B_BPDLCD41_MASK) - -#define LCD_WF8B_BPDLCD42_MASK (0x8U) -#define LCD_WF8B_BPDLCD42_SHIFT (3U) -/*! BPDLCD42 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD42(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD42_SHIFT)) & LCD_WF8B_BPDLCD42_MASK) - -#define LCD_WF8B_BPDLCD43_MASK (0x8U) -#define LCD_WF8B_BPDLCD43_SHIFT (3U) -/*! BPDLCD43 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD43(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD43_SHIFT)) & LCD_WF8B_BPDLCD43_MASK) - -#define LCD_WF8B_BPDLCD44_MASK (0x8U) -#define LCD_WF8B_BPDLCD44_SHIFT (3U) -/*! BPDLCD44 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD44(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD44_SHIFT)) & LCD_WF8B_BPDLCD44_MASK) - -#define LCD_WF8B_BPDLCD45_MASK (0x8U) -#define LCD_WF8B_BPDLCD45_SHIFT (3U) -/*! BPDLCD45 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD45(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD45_SHIFT)) & LCD_WF8B_BPDLCD45_MASK) - -#define LCD_WF8B_BPDLCD46_MASK (0x8U) -#define LCD_WF8B_BPDLCD46_SHIFT (3U) -/*! BPDLCD46 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD46(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD46_SHIFT)) & LCD_WF8B_BPDLCD46_MASK) - -#define LCD_WF8B_BPDLCD47_MASK (0x8U) -#define LCD_WF8B_BPDLCD47_SHIFT (3U) -/*! BPDLCD47 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD47(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD47_SHIFT)) & LCD_WF8B_BPDLCD47_MASK) - -#define LCD_WF8B_BPDLCD48_MASK (0x8U) -#define LCD_WF8B_BPDLCD48_SHIFT (3U) -/*! BPDLCD48 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD48(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD48_SHIFT)) & LCD_WF8B_BPDLCD48_MASK) - -#define LCD_WF8B_BPDLCD49_MASK (0x8U) -#define LCD_WF8B_BPDLCD49_SHIFT (3U) -/*! BPDLCD49 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD49(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD49_SHIFT)) & LCD_WF8B_BPDLCD49_MASK) - -#define LCD_WF8B_BPDLCD50_MASK (0x8U) -#define LCD_WF8B_BPDLCD50_SHIFT (3U) -/*! BPDLCD50 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD50(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD50_SHIFT)) & LCD_WF8B_BPDLCD50_MASK) - -#define LCD_WF8B_BPDLCD51_MASK (0x8U) -#define LCD_WF8B_BPDLCD51_SHIFT (3U) -/*! BPDLCD51 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD51(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD51_SHIFT)) & LCD_WF8B_BPDLCD51_MASK) - -#define LCD_WF8B_BPDLCD52_MASK (0x8U) -#define LCD_WF8B_BPDLCD52_SHIFT (3U) -/*! BPDLCD52 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD52(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD52_SHIFT)) & LCD_WF8B_BPDLCD52_MASK) - -#define LCD_WF8B_BPDLCD53_MASK (0x8U) -#define LCD_WF8B_BPDLCD53_SHIFT (3U) -/*! BPDLCD53 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD53(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD53_SHIFT)) & LCD_WF8B_BPDLCD53_MASK) - -#define LCD_WF8B_BPDLCD54_MASK (0x8U) -#define LCD_WF8B_BPDLCD54_SHIFT (3U) -/*! BPDLCD54 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD54(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD54_SHIFT)) & LCD_WF8B_BPDLCD54_MASK) - -#define LCD_WF8B_BPDLCD55_MASK (0x8U) -#define LCD_WF8B_BPDLCD55_SHIFT (3U) -/*! BPDLCD55 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD55(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD55_SHIFT)) & LCD_WF8B_BPDLCD55_MASK) - -#define LCD_WF8B_BPDLCD56_MASK (0x8U) -#define LCD_WF8B_BPDLCD56_SHIFT (3U) -/*! BPDLCD56 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD56(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD56_SHIFT)) & LCD_WF8B_BPDLCD56_MASK) - -#define LCD_WF8B_BPDLCD57_MASK (0x8U) -#define LCD_WF8B_BPDLCD57_SHIFT (3U) -/*! BPDLCD57 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD57(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD57_SHIFT)) & LCD_WF8B_BPDLCD57_MASK) - -#define LCD_WF8B_BPDLCD58_MASK (0x8U) -#define LCD_WF8B_BPDLCD58_SHIFT (3U) -/*! BPDLCD58 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD58(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD58_SHIFT)) & LCD_WF8B_BPDLCD58_MASK) - -#define LCD_WF8B_BPDLCD59_MASK (0x8U) -#define LCD_WF8B_BPDLCD59_SHIFT (3U) -/*! BPDLCD59 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD59(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD59_SHIFT)) & LCD_WF8B_BPDLCD59_MASK) - -#define LCD_WF8B_BPDLCD60_MASK (0x8U) -#define LCD_WF8B_BPDLCD60_SHIFT (3U) -/*! BPDLCD60 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD60(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD60_SHIFT)) & LCD_WF8B_BPDLCD60_MASK) - -#define LCD_WF8B_BPDLCD61_MASK (0x8U) -#define LCD_WF8B_BPDLCD61_SHIFT (3U) -/*! BPDLCD61 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD61(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD61_SHIFT)) & LCD_WF8B_BPDLCD61_MASK) - -#define LCD_WF8B_BPDLCD62_MASK (0x8U) -#define LCD_WF8B_BPDLCD62_SHIFT (3U) -/*! BPDLCD62 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD62(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD62_SHIFT)) & LCD_WF8B_BPDLCD62_MASK) - -#define LCD_WF8B_BPDLCD63_MASK (0x8U) -#define LCD_WF8B_BPDLCD63_SHIFT (3U) -/*! BPDLCD63 - * 0b0..LCD segment off or LCD backplane inactive for phase D - * 0b1..LCD segment on or LCD backplane active for phase D - */ -#define LCD_WF8B_BPDLCD63(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPDLCD63_SHIFT)) & LCD_WF8B_BPDLCD63_MASK) - -#define LCD_WF8B_BPELCD0_MASK (0x10U) -#define LCD_WF8B_BPELCD0_SHIFT (4U) -/*! BPELCD0 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD0(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD0_SHIFT)) & LCD_WF8B_BPELCD0_MASK) - -#define LCD_WF8B_BPELCD1_MASK (0x10U) -#define LCD_WF8B_BPELCD1_SHIFT (4U) -/*! BPELCD1 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD1(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD1_SHIFT)) & LCD_WF8B_BPELCD1_MASK) - -#define LCD_WF8B_BPELCD2_MASK (0x10U) -#define LCD_WF8B_BPELCD2_SHIFT (4U) -/*! BPELCD2 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD2(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD2_SHIFT)) & LCD_WF8B_BPELCD2_MASK) - -#define LCD_WF8B_BPELCD3_MASK (0x10U) -#define LCD_WF8B_BPELCD3_SHIFT (4U) -/*! BPELCD3 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD3(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD3_SHIFT)) & LCD_WF8B_BPELCD3_MASK) - -#define LCD_WF8B_BPELCD4_MASK (0x10U) -#define LCD_WF8B_BPELCD4_SHIFT (4U) -/*! BPELCD4 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD4(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD4_SHIFT)) & LCD_WF8B_BPELCD4_MASK) - -#define LCD_WF8B_BPELCD5_MASK (0x10U) -#define LCD_WF8B_BPELCD5_SHIFT (4U) -/*! BPELCD5 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD5(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD5_SHIFT)) & LCD_WF8B_BPELCD5_MASK) - -#define LCD_WF8B_BPELCD6_MASK (0x10U) -#define LCD_WF8B_BPELCD6_SHIFT (4U) -/*! BPELCD6 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD6(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD6_SHIFT)) & LCD_WF8B_BPELCD6_MASK) - -#define LCD_WF8B_BPELCD7_MASK (0x10U) -#define LCD_WF8B_BPELCD7_SHIFT (4U) -/*! BPELCD7 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD7(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD7_SHIFT)) & LCD_WF8B_BPELCD7_MASK) - -#define LCD_WF8B_BPELCD8_MASK (0x10U) -#define LCD_WF8B_BPELCD8_SHIFT (4U) -/*! BPELCD8 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD8(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD8_SHIFT)) & LCD_WF8B_BPELCD8_MASK) - -#define LCD_WF8B_BPELCD9_MASK (0x10U) -#define LCD_WF8B_BPELCD9_SHIFT (4U) -/*! BPELCD9 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD9(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD9_SHIFT)) & LCD_WF8B_BPELCD9_MASK) - -#define LCD_WF8B_BPELCD10_MASK (0x10U) -#define LCD_WF8B_BPELCD10_SHIFT (4U) -/*! BPELCD10 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD10(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD10_SHIFT)) & LCD_WF8B_BPELCD10_MASK) - -#define LCD_WF8B_BPELCD11_MASK (0x10U) -#define LCD_WF8B_BPELCD11_SHIFT (4U) -/*! BPELCD11 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD11(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD11_SHIFT)) & LCD_WF8B_BPELCD11_MASK) - -#define LCD_WF8B_BPELCD12_MASK (0x10U) -#define LCD_WF8B_BPELCD12_SHIFT (4U) -/*! BPELCD12 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD12(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD12_SHIFT)) & LCD_WF8B_BPELCD12_MASK) - -#define LCD_WF8B_BPELCD13_MASK (0x10U) -#define LCD_WF8B_BPELCD13_SHIFT (4U) -/*! BPELCD13 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD13(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD13_SHIFT)) & LCD_WF8B_BPELCD13_MASK) - -#define LCD_WF8B_BPELCD14_MASK (0x10U) -#define LCD_WF8B_BPELCD14_SHIFT (4U) -/*! BPELCD14 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD14(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD14_SHIFT)) & LCD_WF8B_BPELCD14_MASK) - -#define LCD_WF8B_BPELCD15_MASK (0x10U) -#define LCD_WF8B_BPELCD15_SHIFT (4U) -/*! BPELCD15 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD15(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD15_SHIFT)) & LCD_WF8B_BPELCD15_MASK) - -#define LCD_WF8B_BPELCD16_MASK (0x10U) -#define LCD_WF8B_BPELCD16_SHIFT (4U) -/*! BPELCD16 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD16(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD16_SHIFT)) & LCD_WF8B_BPELCD16_MASK) - -#define LCD_WF8B_BPELCD17_MASK (0x10U) -#define LCD_WF8B_BPELCD17_SHIFT (4U) -/*! BPELCD17 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD17(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD17_SHIFT)) & LCD_WF8B_BPELCD17_MASK) - -#define LCD_WF8B_BPELCD18_MASK (0x10U) -#define LCD_WF8B_BPELCD18_SHIFT (4U) -/*! BPELCD18 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD18(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD18_SHIFT)) & LCD_WF8B_BPELCD18_MASK) - -#define LCD_WF8B_BPELCD19_MASK (0x10U) -#define LCD_WF8B_BPELCD19_SHIFT (4U) -/*! BPELCD19 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD19(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD19_SHIFT)) & LCD_WF8B_BPELCD19_MASK) - -#define LCD_WF8B_BPELCD20_MASK (0x10U) -#define LCD_WF8B_BPELCD20_SHIFT (4U) -/*! BPELCD20 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD20(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD20_SHIFT)) & LCD_WF8B_BPELCD20_MASK) - -#define LCD_WF8B_BPELCD21_MASK (0x10U) -#define LCD_WF8B_BPELCD21_SHIFT (4U) -/*! BPELCD21 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD21(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD21_SHIFT)) & LCD_WF8B_BPELCD21_MASK) - -#define LCD_WF8B_BPELCD22_MASK (0x10U) -#define LCD_WF8B_BPELCD22_SHIFT (4U) -/*! BPELCD22 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD22(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD22_SHIFT)) & LCD_WF8B_BPELCD22_MASK) - -#define LCD_WF8B_BPELCD23_MASK (0x10U) -#define LCD_WF8B_BPELCD23_SHIFT (4U) -/*! BPELCD23 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD23(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD23_SHIFT)) & LCD_WF8B_BPELCD23_MASK) - -#define LCD_WF8B_BPELCD24_MASK (0x10U) -#define LCD_WF8B_BPELCD24_SHIFT (4U) -/*! BPELCD24 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD24(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD24_SHIFT)) & LCD_WF8B_BPELCD24_MASK) - -#define LCD_WF8B_BPELCD25_MASK (0x10U) -#define LCD_WF8B_BPELCD25_SHIFT (4U) -/*! BPELCD25 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD25(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD25_SHIFT)) & LCD_WF8B_BPELCD25_MASK) - -#define LCD_WF8B_BPELCD26_MASK (0x10U) -#define LCD_WF8B_BPELCD26_SHIFT (4U) -/*! BPELCD26 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD26(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD26_SHIFT)) & LCD_WF8B_BPELCD26_MASK) - -#define LCD_WF8B_BPELCD27_MASK (0x10U) -#define LCD_WF8B_BPELCD27_SHIFT (4U) -/*! BPELCD27 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD27(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD27_SHIFT)) & LCD_WF8B_BPELCD27_MASK) - -#define LCD_WF8B_BPELCD28_MASK (0x10U) -#define LCD_WF8B_BPELCD28_SHIFT (4U) -/*! BPELCD28 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD28(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD28_SHIFT)) & LCD_WF8B_BPELCD28_MASK) - -#define LCD_WF8B_BPELCD29_MASK (0x10U) -#define LCD_WF8B_BPELCD29_SHIFT (4U) -/*! BPELCD29 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD29(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD29_SHIFT)) & LCD_WF8B_BPELCD29_MASK) - -#define LCD_WF8B_BPELCD30_MASK (0x10U) -#define LCD_WF8B_BPELCD30_SHIFT (4U) -/*! BPELCD30 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD30(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD30_SHIFT)) & LCD_WF8B_BPELCD30_MASK) - -#define LCD_WF8B_BPELCD31_MASK (0x10U) -#define LCD_WF8B_BPELCD31_SHIFT (4U) -/*! BPELCD31 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD31(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD31_SHIFT)) & LCD_WF8B_BPELCD31_MASK) - -#define LCD_WF8B_BPELCD32_MASK (0x10U) -#define LCD_WF8B_BPELCD32_SHIFT (4U) -/*! BPELCD32 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD32(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD32_SHIFT)) & LCD_WF8B_BPELCD32_MASK) - -#define LCD_WF8B_BPELCD33_MASK (0x10U) -#define LCD_WF8B_BPELCD33_SHIFT (4U) -/*! BPELCD33 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD33(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD33_SHIFT)) & LCD_WF8B_BPELCD33_MASK) - -#define LCD_WF8B_BPELCD34_MASK (0x10U) -#define LCD_WF8B_BPELCD34_SHIFT (4U) -/*! BPELCD34 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD34(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD34_SHIFT)) & LCD_WF8B_BPELCD34_MASK) - -#define LCD_WF8B_BPELCD35_MASK (0x10U) -#define LCD_WF8B_BPELCD35_SHIFT (4U) -/*! BPELCD35 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD35(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD35_SHIFT)) & LCD_WF8B_BPELCD35_MASK) - -#define LCD_WF8B_BPELCD36_MASK (0x10U) -#define LCD_WF8B_BPELCD36_SHIFT (4U) -/*! BPELCD36 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD36(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD36_SHIFT)) & LCD_WF8B_BPELCD36_MASK) - -#define LCD_WF8B_BPELCD37_MASK (0x10U) -#define LCD_WF8B_BPELCD37_SHIFT (4U) -/*! BPELCD37 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD37(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD37_SHIFT)) & LCD_WF8B_BPELCD37_MASK) - -#define LCD_WF8B_BPELCD38_MASK (0x10U) -#define LCD_WF8B_BPELCD38_SHIFT (4U) -/*! BPELCD38 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD38(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD38_SHIFT)) & LCD_WF8B_BPELCD38_MASK) - -#define LCD_WF8B_BPELCD39_MASK (0x10U) -#define LCD_WF8B_BPELCD39_SHIFT (4U) -/*! BPELCD39 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD39(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD39_SHIFT)) & LCD_WF8B_BPELCD39_MASK) - -#define LCD_WF8B_BPELCD40_MASK (0x10U) -#define LCD_WF8B_BPELCD40_SHIFT (4U) -/*! BPELCD40 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD40(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD40_SHIFT)) & LCD_WF8B_BPELCD40_MASK) - -#define LCD_WF8B_BPELCD41_MASK (0x10U) -#define LCD_WF8B_BPELCD41_SHIFT (4U) -/*! BPELCD41 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD41(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD41_SHIFT)) & LCD_WF8B_BPELCD41_MASK) - -#define LCD_WF8B_BPELCD42_MASK (0x10U) -#define LCD_WF8B_BPELCD42_SHIFT (4U) -/*! BPELCD42 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD42(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD42_SHIFT)) & LCD_WF8B_BPELCD42_MASK) - -#define LCD_WF8B_BPELCD43_MASK (0x10U) -#define LCD_WF8B_BPELCD43_SHIFT (4U) -/*! BPELCD43 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD43(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD43_SHIFT)) & LCD_WF8B_BPELCD43_MASK) - -#define LCD_WF8B_BPELCD44_MASK (0x10U) -#define LCD_WF8B_BPELCD44_SHIFT (4U) -/*! BPELCD44 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD44(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD44_SHIFT)) & LCD_WF8B_BPELCD44_MASK) - -#define LCD_WF8B_BPELCD45_MASK (0x10U) -#define LCD_WF8B_BPELCD45_SHIFT (4U) -/*! BPELCD45 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD45(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD45_SHIFT)) & LCD_WF8B_BPELCD45_MASK) - -#define LCD_WF8B_BPELCD46_MASK (0x10U) -#define LCD_WF8B_BPELCD46_SHIFT (4U) -/*! BPELCD46 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD46(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD46_SHIFT)) & LCD_WF8B_BPELCD46_MASK) - -#define LCD_WF8B_BPELCD47_MASK (0x10U) -#define LCD_WF8B_BPELCD47_SHIFT (4U) -/*! BPELCD47 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD47(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD47_SHIFT)) & LCD_WF8B_BPELCD47_MASK) - -#define LCD_WF8B_BPELCD48_MASK (0x10U) -#define LCD_WF8B_BPELCD48_SHIFT (4U) -/*! BPELCD48 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD48(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD48_SHIFT)) & LCD_WF8B_BPELCD48_MASK) - -#define LCD_WF8B_BPELCD49_MASK (0x10U) -#define LCD_WF8B_BPELCD49_SHIFT (4U) -/*! BPELCD49 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD49(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD49_SHIFT)) & LCD_WF8B_BPELCD49_MASK) - -#define LCD_WF8B_BPELCD50_MASK (0x10U) -#define LCD_WF8B_BPELCD50_SHIFT (4U) -/*! BPELCD50 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD50(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD50_SHIFT)) & LCD_WF8B_BPELCD50_MASK) - -#define LCD_WF8B_BPELCD51_MASK (0x10U) -#define LCD_WF8B_BPELCD51_SHIFT (4U) -/*! BPELCD51 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD51(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD51_SHIFT)) & LCD_WF8B_BPELCD51_MASK) - -#define LCD_WF8B_BPELCD52_MASK (0x10U) -#define LCD_WF8B_BPELCD52_SHIFT (4U) -/*! BPELCD52 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD52(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD52_SHIFT)) & LCD_WF8B_BPELCD52_MASK) - -#define LCD_WF8B_BPELCD53_MASK (0x10U) -#define LCD_WF8B_BPELCD53_SHIFT (4U) -/*! BPELCD53 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD53(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD53_SHIFT)) & LCD_WF8B_BPELCD53_MASK) - -#define LCD_WF8B_BPELCD54_MASK (0x10U) -#define LCD_WF8B_BPELCD54_SHIFT (4U) -/*! BPELCD54 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD54(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD54_SHIFT)) & LCD_WF8B_BPELCD54_MASK) - -#define LCD_WF8B_BPELCD55_MASK (0x10U) -#define LCD_WF8B_BPELCD55_SHIFT (4U) -/*! BPELCD55 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD55(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD55_SHIFT)) & LCD_WF8B_BPELCD55_MASK) - -#define LCD_WF8B_BPELCD56_MASK (0x10U) -#define LCD_WF8B_BPELCD56_SHIFT (4U) -/*! BPELCD56 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD56(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD56_SHIFT)) & LCD_WF8B_BPELCD56_MASK) - -#define LCD_WF8B_BPELCD57_MASK (0x10U) -#define LCD_WF8B_BPELCD57_SHIFT (4U) -/*! BPELCD57 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD57(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD57_SHIFT)) & LCD_WF8B_BPELCD57_MASK) - -#define LCD_WF8B_BPELCD58_MASK (0x10U) -#define LCD_WF8B_BPELCD58_SHIFT (4U) -/*! BPELCD58 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD58(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD58_SHIFT)) & LCD_WF8B_BPELCD58_MASK) - -#define LCD_WF8B_BPELCD59_MASK (0x10U) -#define LCD_WF8B_BPELCD59_SHIFT (4U) -/*! BPELCD59 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD59(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD59_SHIFT)) & LCD_WF8B_BPELCD59_MASK) - -#define LCD_WF8B_BPELCD60_MASK (0x10U) -#define LCD_WF8B_BPELCD60_SHIFT (4U) -/*! BPELCD60 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD60(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD60_SHIFT)) & LCD_WF8B_BPELCD60_MASK) - -#define LCD_WF8B_BPELCD61_MASK (0x10U) -#define LCD_WF8B_BPELCD61_SHIFT (4U) -/*! BPELCD61 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD61(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD61_SHIFT)) & LCD_WF8B_BPELCD61_MASK) - -#define LCD_WF8B_BPELCD62_MASK (0x10U) -#define LCD_WF8B_BPELCD62_SHIFT (4U) -/*! BPELCD62 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD62(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD62_SHIFT)) & LCD_WF8B_BPELCD62_MASK) - -#define LCD_WF8B_BPELCD63_MASK (0x10U) -#define LCD_WF8B_BPELCD63_SHIFT (4U) -/*! BPELCD63 - * 0b0..LCD segment off or LCD backplane inactive for phase E - * 0b1..LCD segment on or LCD backplane active for phase E - */ -#define LCD_WF8B_BPELCD63(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPELCD63_SHIFT)) & LCD_WF8B_BPELCD63_MASK) - -#define LCD_WF8B_BPFLCD0_MASK (0x20U) -#define LCD_WF8B_BPFLCD0_SHIFT (5U) -/*! BPFLCD0 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD0(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD0_SHIFT)) & LCD_WF8B_BPFLCD0_MASK) - -#define LCD_WF8B_BPFLCD1_MASK (0x20U) -#define LCD_WF8B_BPFLCD1_SHIFT (5U) -/*! BPFLCD1 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD1(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD1_SHIFT)) & LCD_WF8B_BPFLCD1_MASK) - -#define LCD_WF8B_BPFLCD2_MASK (0x20U) -#define LCD_WF8B_BPFLCD2_SHIFT (5U) -/*! BPFLCD2 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD2(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD2_SHIFT)) & LCD_WF8B_BPFLCD2_MASK) - -#define LCD_WF8B_BPFLCD3_MASK (0x20U) -#define LCD_WF8B_BPFLCD3_SHIFT (5U) -/*! BPFLCD3 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD3(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD3_SHIFT)) & LCD_WF8B_BPFLCD3_MASK) - -#define LCD_WF8B_BPFLCD4_MASK (0x20U) -#define LCD_WF8B_BPFLCD4_SHIFT (5U) -/*! BPFLCD4 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD4(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD4_SHIFT)) & LCD_WF8B_BPFLCD4_MASK) - -#define LCD_WF8B_BPFLCD5_MASK (0x20U) -#define LCD_WF8B_BPFLCD5_SHIFT (5U) -/*! BPFLCD5 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD5(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD5_SHIFT)) & LCD_WF8B_BPFLCD5_MASK) - -#define LCD_WF8B_BPFLCD6_MASK (0x20U) -#define LCD_WF8B_BPFLCD6_SHIFT (5U) -/*! BPFLCD6 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD6(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD6_SHIFT)) & LCD_WF8B_BPFLCD6_MASK) - -#define LCD_WF8B_BPFLCD7_MASK (0x20U) -#define LCD_WF8B_BPFLCD7_SHIFT (5U) -/*! BPFLCD7 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD7(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD7_SHIFT)) & LCD_WF8B_BPFLCD7_MASK) - -#define LCD_WF8B_BPFLCD8_MASK (0x20U) -#define LCD_WF8B_BPFLCD8_SHIFT (5U) -/*! BPFLCD8 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD8(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD8_SHIFT)) & LCD_WF8B_BPFLCD8_MASK) - -#define LCD_WF8B_BPFLCD9_MASK (0x20U) -#define LCD_WF8B_BPFLCD9_SHIFT (5U) -/*! BPFLCD9 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD9(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD9_SHIFT)) & LCD_WF8B_BPFLCD9_MASK) - -#define LCD_WF8B_BPFLCD10_MASK (0x20U) -#define LCD_WF8B_BPFLCD10_SHIFT (5U) -/*! BPFLCD10 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD10(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD10_SHIFT)) & LCD_WF8B_BPFLCD10_MASK) - -#define LCD_WF8B_BPFLCD11_MASK (0x20U) -#define LCD_WF8B_BPFLCD11_SHIFT (5U) -/*! BPFLCD11 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD11(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD11_SHIFT)) & LCD_WF8B_BPFLCD11_MASK) - -#define LCD_WF8B_BPFLCD12_MASK (0x20U) -#define LCD_WF8B_BPFLCD12_SHIFT (5U) -/*! BPFLCD12 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD12(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD12_SHIFT)) & LCD_WF8B_BPFLCD12_MASK) - -#define LCD_WF8B_BPFLCD13_MASK (0x20U) -#define LCD_WF8B_BPFLCD13_SHIFT (5U) -/*! BPFLCD13 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD13(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD13_SHIFT)) & LCD_WF8B_BPFLCD13_MASK) - -#define LCD_WF8B_BPFLCD14_MASK (0x20U) -#define LCD_WF8B_BPFLCD14_SHIFT (5U) -/*! BPFLCD14 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD14(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD14_SHIFT)) & LCD_WF8B_BPFLCD14_MASK) - -#define LCD_WF8B_BPFLCD15_MASK (0x20U) -#define LCD_WF8B_BPFLCD15_SHIFT (5U) -/*! BPFLCD15 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD15(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD15_SHIFT)) & LCD_WF8B_BPFLCD15_MASK) - -#define LCD_WF8B_BPFLCD16_MASK (0x20U) -#define LCD_WF8B_BPFLCD16_SHIFT (5U) -/*! BPFLCD16 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD16(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD16_SHIFT)) & LCD_WF8B_BPFLCD16_MASK) - -#define LCD_WF8B_BPFLCD17_MASK (0x20U) -#define LCD_WF8B_BPFLCD17_SHIFT (5U) -/*! BPFLCD17 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD17(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD17_SHIFT)) & LCD_WF8B_BPFLCD17_MASK) - -#define LCD_WF8B_BPFLCD18_MASK (0x20U) -#define LCD_WF8B_BPFLCD18_SHIFT (5U) -/*! BPFLCD18 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD18(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD18_SHIFT)) & LCD_WF8B_BPFLCD18_MASK) - -#define LCD_WF8B_BPFLCD19_MASK (0x20U) -#define LCD_WF8B_BPFLCD19_SHIFT (5U) -/*! BPFLCD19 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD19(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD19_SHIFT)) & LCD_WF8B_BPFLCD19_MASK) - -#define LCD_WF8B_BPFLCD20_MASK (0x20U) -#define LCD_WF8B_BPFLCD20_SHIFT (5U) -/*! BPFLCD20 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD20(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD20_SHIFT)) & LCD_WF8B_BPFLCD20_MASK) - -#define LCD_WF8B_BPFLCD21_MASK (0x20U) -#define LCD_WF8B_BPFLCD21_SHIFT (5U) -/*! BPFLCD21 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD21(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD21_SHIFT)) & LCD_WF8B_BPFLCD21_MASK) - -#define LCD_WF8B_BPFLCD22_MASK (0x20U) -#define LCD_WF8B_BPFLCD22_SHIFT (5U) -/*! BPFLCD22 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD22(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD22_SHIFT)) & LCD_WF8B_BPFLCD22_MASK) - -#define LCD_WF8B_BPFLCD23_MASK (0x20U) -#define LCD_WF8B_BPFLCD23_SHIFT (5U) -/*! BPFLCD23 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD23(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD23_SHIFT)) & LCD_WF8B_BPFLCD23_MASK) - -#define LCD_WF8B_BPFLCD24_MASK (0x20U) -#define LCD_WF8B_BPFLCD24_SHIFT (5U) -/*! BPFLCD24 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD24(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD24_SHIFT)) & LCD_WF8B_BPFLCD24_MASK) - -#define LCD_WF8B_BPFLCD25_MASK (0x20U) -#define LCD_WF8B_BPFLCD25_SHIFT (5U) -/*! BPFLCD25 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD25(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD25_SHIFT)) & LCD_WF8B_BPFLCD25_MASK) - -#define LCD_WF8B_BPFLCD26_MASK (0x20U) -#define LCD_WF8B_BPFLCD26_SHIFT (5U) -/*! BPFLCD26 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD26(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD26_SHIFT)) & LCD_WF8B_BPFLCD26_MASK) - -#define LCD_WF8B_BPFLCD27_MASK (0x20U) -#define LCD_WF8B_BPFLCD27_SHIFT (5U) -/*! BPFLCD27 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD27(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD27_SHIFT)) & LCD_WF8B_BPFLCD27_MASK) - -#define LCD_WF8B_BPFLCD28_MASK (0x20U) -#define LCD_WF8B_BPFLCD28_SHIFT (5U) -/*! BPFLCD28 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD28(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD28_SHIFT)) & LCD_WF8B_BPFLCD28_MASK) - -#define LCD_WF8B_BPFLCD29_MASK (0x20U) -#define LCD_WF8B_BPFLCD29_SHIFT (5U) -/*! BPFLCD29 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD29(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD29_SHIFT)) & LCD_WF8B_BPFLCD29_MASK) - -#define LCD_WF8B_BPFLCD30_MASK (0x20U) -#define LCD_WF8B_BPFLCD30_SHIFT (5U) -/*! BPFLCD30 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD30(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD30_SHIFT)) & LCD_WF8B_BPFLCD30_MASK) - -#define LCD_WF8B_BPFLCD31_MASK (0x20U) -#define LCD_WF8B_BPFLCD31_SHIFT (5U) -/*! BPFLCD31 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD31(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD31_SHIFT)) & LCD_WF8B_BPFLCD31_MASK) - -#define LCD_WF8B_BPFLCD32_MASK (0x20U) -#define LCD_WF8B_BPFLCD32_SHIFT (5U) -/*! BPFLCD32 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD32(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD32_SHIFT)) & LCD_WF8B_BPFLCD32_MASK) - -#define LCD_WF8B_BPFLCD33_MASK (0x20U) -#define LCD_WF8B_BPFLCD33_SHIFT (5U) -/*! BPFLCD33 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD33(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD33_SHIFT)) & LCD_WF8B_BPFLCD33_MASK) - -#define LCD_WF8B_BPFLCD34_MASK (0x20U) -#define LCD_WF8B_BPFLCD34_SHIFT (5U) -/*! BPFLCD34 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD34(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD34_SHIFT)) & LCD_WF8B_BPFLCD34_MASK) - -#define LCD_WF8B_BPFLCD35_MASK (0x20U) -#define LCD_WF8B_BPFLCD35_SHIFT (5U) -/*! BPFLCD35 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD35(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD35_SHIFT)) & LCD_WF8B_BPFLCD35_MASK) - -#define LCD_WF8B_BPFLCD36_MASK (0x20U) -#define LCD_WF8B_BPFLCD36_SHIFT (5U) -/*! BPFLCD36 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD36(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD36_SHIFT)) & LCD_WF8B_BPFLCD36_MASK) - -#define LCD_WF8B_BPFLCD37_MASK (0x20U) -#define LCD_WF8B_BPFLCD37_SHIFT (5U) -/*! BPFLCD37 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD37(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD37_SHIFT)) & LCD_WF8B_BPFLCD37_MASK) - -#define LCD_WF8B_BPFLCD38_MASK (0x20U) -#define LCD_WF8B_BPFLCD38_SHIFT (5U) -/*! BPFLCD38 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD38(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD38_SHIFT)) & LCD_WF8B_BPFLCD38_MASK) - -#define LCD_WF8B_BPFLCD39_MASK (0x20U) -#define LCD_WF8B_BPFLCD39_SHIFT (5U) -/*! BPFLCD39 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD39(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD39_SHIFT)) & LCD_WF8B_BPFLCD39_MASK) - -#define LCD_WF8B_BPFLCD40_MASK (0x20U) -#define LCD_WF8B_BPFLCD40_SHIFT (5U) -/*! BPFLCD40 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD40(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD40_SHIFT)) & LCD_WF8B_BPFLCD40_MASK) - -#define LCD_WF8B_BPFLCD41_MASK (0x20U) -#define LCD_WF8B_BPFLCD41_SHIFT (5U) -/*! BPFLCD41 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD41(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD41_SHIFT)) & LCD_WF8B_BPFLCD41_MASK) - -#define LCD_WF8B_BPFLCD42_MASK (0x20U) -#define LCD_WF8B_BPFLCD42_SHIFT (5U) -/*! BPFLCD42 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD42(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD42_SHIFT)) & LCD_WF8B_BPFLCD42_MASK) - -#define LCD_WF8B_BPFLCD43_MASK (0x20U) -#define LCD_WF8B_BPFLCD43_SHIFT (5U) -/*! BPFLCD43 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD43(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD43_SHIFT)) & LCD_WF8B_BPFLCD43_MASK) - -#define LCD_WF8B_BPFLCD44_MASK (0x20U) -#define LCD_WF8B_BPFLCD44_SHIFT (5U) -/*! BPFLCD44 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD44(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD44_SHIFT)) & LCD_WF8B_BPFLCD44_MASK) - -#define LCD_WF8B_BPFLCD45_MASK (0x20U) -#define LCD_WF8B_BPFLCD45_SHIFT (5U) -/*! BPFLCD45 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD45(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD45_SHIFT)) & LCD_WF8B_BPFLCD45_MASK) - -#define LCD_WF8B_BPFLCD46_MASK (0x20U) -#define LCD_WF8B_BPFLCD46_SHIFT (5U) -/*! BPFLCD46 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD46(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD46_SHIFT)) & LCD_WF8B_BPFLCD46_MASK) - -#define LCD_WF8B_BPFLCD47_MASK (0x20U) -#define LCD_WF8B_BPFLCD47_SHIFT (5U) -/*! BPFLCD47 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD47(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD47_SHIFT)) & LCD_WF8B_BPFLCD47_MASK) - -#define LCD_WF8B_BPFLCD48_MASK (0x20U) -#define LCD_WF8B_BPFLCD48_SHIFT (5U) -/*! BPFLCD48 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD48(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD48_SHIFT)) & LCD_WF8B_BPFLCD48_MASK) - -#define LCD_WF8B_BPFLCD49_MASK (0x20U) -#define LCD_WF8B_BPFLCD49_SHIFT (5U) -/*! BPFLCD49 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD49(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD49_SHIFT)) & LCD_WF8B_BPFLCD49_MASK) - -#define LCD_WF8B_BPFLCD50_MASK (0x20U) -#define LCD_WF8B_BPFLCD50_SHIFT (5U) -/*! BPFLCD50 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD50(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD50_SHIFT)) & LCD_WF8B_BPFLCD50_MASK) - -#define LCD_WF8B_BPFLCD51_MASK (0x20U) -#define LCD_WF8B_BPFLCD51_SHIFT (5U) -/*! BPFLCD51 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD51(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD51_SHIFT)) & LCD_WF8B_BPFLCD51_MASK) - -#define LCD_WF8B_BPFLCD52_MASK (0x20U) -#define LCD_WF8B_BPFLCD52_SHIFT (5U) -/*! BPFLCD52 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD52(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD52_SHIFT)) & LCD_WF8B_BPFLCD52_MASK) - -#define LCD_WF8B_BPFLCD53_MASK (0x20U) -#define LCD_WF8B_BPFLCD53_SHIFT (5U) -/*! BPFLCD53 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD53(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD53_SHIFT)) & LCD_WF8B_BPFLCD53_MASK) - -#define LCD_WF8B_BPFLCD54_MASK (0x20U) -#define LCD_WF8B_BPFLCD54_SHIFT (5U) -/*! BPFLCD54 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD54(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD54_SHIFT)) & LCD_WF8B_BPFLCD54_MASK) - -#define LCD_WF8B_BPFLCD55_MASK (0x20U) -#define LCD_WF8B_BPFLCD55_SHIFT (5U) -/*! BPFLCD55 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD55(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD55_SHIFT)) & LCD_WF8B_BPFLCD55_MASK) - -#define LCD_WF8B_BPFLCD56_MASK (0x20U) -#define LCD_WF8B_BPFLCD56_SHIFT (5U) -/*! BPFLCD56 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD56(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD56_SHIFT)) & LCD_WF8B_BPFLCD56_MASK) - -#define LCD_WF8B_BPFLCD57_MASK (0x20U) -#define LCD_WF8B_BPFLCD57_SHIFT (5U) -/*! BPFLCD57 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD57(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD57_SHIFT)) & LCD_WF8B_BPFLCD57_MASK) - -#define LCD_WF8B_BPFLCD58_MASK (0x20U) -#define LCD_WF8B_BPFLCD58_SHIFT (5U) -/*! BPFLCD58 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD58(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD58_SHIFT)) & LCD_WF8B_BPFLCD58_MASK) - -#define LCD_WF8B_BPFLCD59_MASK (0x20U) -#define LCD_WF8B_BPFLCD59_SHIFT (5U) -/*! BPFLCD59 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD59(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD59_SHIFT)) & LCD_WF8B_BPFLCD59_MASK) - -#define LCD_WF8B_BPFLCD60_MASK (0x20U) -#define LCD_WF8B_BPFLCD60_SHIFT (5U) -/*! BPFLCD60 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD60(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD60_SHIFT)) & LCD_WF8B_BPFLCD60_MASK) - -#define LCD_WF8B_BPFLCD61_MASK (0x20U) -#define LCD_WF8B_BPFLCD61_SHIFT (5U) -/*! BPFLCD61 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD61(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD61_SHIFT)) & LCD_WF8B_BPFLCD61_MASK) - -#define LCD_WF8B_BPFLCD62_MASK (0x20U) -#define LCD_WF8B_BPFLCD62_SHIFT (5U) -/*! BPFLCD62 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD62(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD62_SHIFT)) & LCD_WF8B_BPFLCD62_MASK) - -#define LCD_WF8B_BPFLCD63_MASK (0x20U) -#define LCD_WF8B_BPFLCD63_SHIFT (5U) -/*! BPFLCD63 - * 0b0..LCD segment off or LCD backplane inactive for phase F - * 0b1..LCD segment on or LCD backplane active for phase F - */ -#define LCD_WF8B_BPFLCD63(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPFLCD63_SHIFT)) & LCD_WF8B_BPFLCD63_MASK) - -#define LCD_WF8B_BPGLCD0_MASK (0x40U) -#define LCD_WF8B_BPGLCD0_SHIFT (6U) -/*! BPGLCD0 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD0(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD0_SHIFT)) & LCD_WF8B_BPGLCD0_MASK) - -#define LCD_WF8B_BPGLCD1_MASK (0x40U) -#define LCD_WF8B_BPGLCD1_SHIFT (6U) -/*! BPGLCD1 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD1(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD1_SHIFT)) & LCD_WF8B_BPGLCD1_MASK) - -#define LCD_WF8B_BPGLCD2_MASK (0x40U) -#define LCD_WF8B_BPGLCD2_SHIFT (6U) -/*! BPGLCD2 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD2(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD2_SHIFT)) & LCD_WF8B_BPGLCD2_MASK) - -#define LCD_WF8B_BPGLCD3_MASK (0x40U) -#define LCD_WF8B_BPGLCD3_SHIFT (6U) -/*! BPGLCD3 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD3(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD3_SHIFT)) & LCD_WF8B_BPGLCD3_MASK) - -#define LCD_WF8B_BPGLCD4_MASK (0x40U) -#define LCD_WF8B_BPGLCD4_SHIFT (6U) -/*! BPGLCD4 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD4(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD4_SHIFT)) & LCD_WF8B_BPGLCD4_MASK) - -#define LCD_WF8B_BPGLCD5_MASK (0x40U) -#define LCD_WF8B_BPGLCD5_SHIFT (6U) -/*! BPGLCD5 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD5(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD5_SHIFT)) & LCD_WF8B_BPGLCD5_MASK) - -#define LCD_WF8B_BPGLCD6_MASK (0x40U) -#define LCD_WF8B_BPGLCD6_SHIFT (6U) -/*! BPGLCD6 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD6(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD6_SHIFT)) & LCD_WF8B_BPGLCD6_MASK) - -#define LCD_WF8B_BPGLCD7_MASK (0x40U) -#define LCD_WF8B_BPGLCD7_SHIFT (6U) -/*! BPGLCD7 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD7(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD7_SHIFT)) & LCD_WF8B_BPGLCD7_MASK) - -#define LCD_WF8B_BPGLCD8_MASK (0x40U) -#define LCD_WF8B_BPGLCD8_SHIFT (6U) -/*! BPGLCD8 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD8(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD8_SHIFT)) & LCD_WF8B_BPGLCD8_MASK) - -#define LCD_WF8B_BPGLCD9_MASK (0x40U) -#define LCD_WF8B_BPGLCD9_SHIFT (6U) -/*! BPGLCD9 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD9(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD9_SHIFT)) & LCD_WF8B_BPGLCD9_MASK) - -#define LCD_WF8B_BPGLCD10_MASK (0x40U) -#define LCD_WF8B_BPGLCD10_SHIFT (6U) -/*! BPGLCD10 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD10(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD10_SHIFT)) & LCD_WF8B_BPGLCD10_MASK) - -#define LCD_WF8B_BPGLCD11_MASK (0x40U) -#define LCD_WF8B_BPGLCD11_SHIFT (6U) -/*! BPGLCD11 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD11(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD11_SHIFT)) & LCD_WF8B_BPGLCD11_MASK) - -#define LCD_WF8B_BPGLCD12_MASK (0x40U) -#define LCD_WF8B_BPGLCD12_SHIFT (6U) -/*! BPGLCD12 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD12(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD12_SHIFT)) & LCD_WF8B_BPGLCD12_MASK) - -#define LCD_WF8B_BPGLCD13_MASK (0x40U) -#define LCD_WF8B_BPGLCD13_SHIFT (6U) -/*! BPGLCD13 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD13(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD13_SHIFT)) & LCD_WF8B_BPGLCD13_MASK) - -#define LCD_WF8B_BPGLCD14_MASK (0x40U) -#define LCD_WF8B_BPGLCD14_SHIFT (6U) -/*! BPGLCD14 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD14(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD14_SHIFT)) & LCD_WF8B_BPGLCD14_MASK) - -#define LCD_WF8B_BPGLCD15_MASK (0x40U) -#define LCD_WF8B_BPGLCD15_SHIFT (6U) -/*! BPGLCD15 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD15(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD15_SHIFT)) & LCD_WF8B_BPGLCD15_MASK) - -#define LCD_WF8B_BPGLCD16_MASK (0x40U) -#define LCD_WF8B_BPGLCD16_SHIFT (6U) -/*! BPGLCD16 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD16(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD16_SHIFT)) & LCD_WF8B_BPGLCD16_MASK) - -#define LCD_WF8B_BPGLCD17_MASK (0x40U) -#define LCD_WF8B_BPGLCD17_SHIFT (6U) -/*! BPGLCD17 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD17(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD17_SHIFT)) & LCD_WF8B_BPGLCD17_MASK) - -#define LCD_WF8B_BPGLCD18_MASK (0x40U) -#define LCD_WF8B_BPGLCD18_SHIFT (6U) -/*! BPGLCD18 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD18(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD18_SHIFT)) & LCD_WF8B_BPGLCD18_MASK) - -#define LCD_WF8B_BPGLCD19_MASK (0x40U) -#define LCD_WF8B_BPGLCD19_SHIFT (6U) -/*! BPGLCD19 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD19(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD19_SHIFT)) & LCD_WF8B_BPGLCD19_MASK) - -#define LCD_WF8B_BPGLCD20_MASK (0x40U) -#define LCD_WF8B_BPGLCD20_SHIFT (6U) -/*! BPGLCD20 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD20(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD20_SHIFT)) & LCD_WF8B_BPGLCD20_MASK) - -#define LCD_WF8B_BPGLCD21_MASK (0x40U) -#define LCD_WF8B_BPGLCD21_SHIFT (6U) -/*! BPGLCD21 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD21(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD21_SHIFT)) & LCD_WF8B_BPGLCD21_MASK) - -#define LCD_WF8B_BPGLCD22_MASK (0x40U) -#define LCD_WF8B_BPGLCD22_SHIFT (6U) -/*! BPGLCD22 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD22(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD22_SHIFT)) & LCD_WF8B_BPGLCD22_MASK) - -#define LCD_WF8B_BPGLCD23_MASK (0x40U) -#define LCD_WF8B_BPGLCD23_SHIFT (6U) -/*! BPGLCD23 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD23(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD23_SHIFT)) & LCD_WF8B_BPGLCD23_MASK) - -#define LCD_WF8B_BPGLCD24_MASK (0x40U) -#define LCD_WF8B_BPGLCD24_SHIFT (6U) -/*! BPGLCD24 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD24(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD24_SHIFT)) & LCD_WF8B_BPGLCD24_MASK) - -#define LCD_WF8B_BPGLCD25_MASK (0x40U) -#define LCD_WF8B_BPGLCD25_SHIFT (6U) -/*! BPGLCD25 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD25(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD25_SHIFT)) & LCD_WF8B_BPGLCD25_MASK) - -#define LCD_WF8B_BPGLCD26_MASK (0x40U) -#define LCD_WF8B_BPGLCD26_SHIFT (6U) -/*! BPGLCD26 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD26(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD26_SHIFT)) & LCD_WF8B_BPGLCD26_MASK) - -#define LCD_WF8B_BPGLCD27_MASK (0x40U) -#define LCD_WF8B_BPGLCD27_SHIFT (6U) -/*! BPGLCD27 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD27(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD27_SHIFT)) & LCD_WF8B_BPGLCD27_MASK) - -#define LCD_WF8B_BPGLCD28_MASK (0x40U) -#define LCD_WF8B_BPGLCD28_SHIFT (6U) -/*! BPGLCD28 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD28(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD28_SHIFT)) & LCD_WF8B_BPGLCD28_MASK) - -#define LCD_WF8B_BPGLCD29_MASK (0x40U) -#define LCD_WF8B_BPGLCD29_SHIFT (6U) -/*! BPGLCD29 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD29(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD29_SHIFT)) & LCD_WF8B_BPGLCD29_MASK) - -#define LCD_WF8B_BPGLCD30_MASK (0x40U) -#define LCD_WF8B_BPGLCD30_SHIFT (6U) -/*! BPGLCD30 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD30(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD30_SHIFT)) & LCD_WF8B_BPGLCD30_MASK) - -#define LCD_WF8B_BPGLCD31_MASK (0x40U) -#define LCD_WF8B_BPGLCD31_SHIFT (6U) -/*! BPGLCD31 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD31(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD31_SHIFT)) & LCD_WF8B_BPGLCD31_MASK) - -#define LCD_WF8B_BPGLCD32_MASK (0x40U) -#define LCD_WF8B_BPGLCD32_SHIFT (6U) -/*! BPGLCD32 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD32(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD32_SHIFT)) & LCD_WF8B_BPGLCD32_MASK) - -#define LCD_WF8B_BPGLCD33_MASK (0x40U) -#define LCD_WF8B_BPGLCD33_SHIFT (6U) -/*! BPGLCD33 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD33(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD33_SHIFT)) & LCD_WF8B_BPGLCD33_MASK) - -#define LCD_WF8B_BPGLCD34_MASK (0x40U) -#define LCD_WF8B_BPGLCD34_SHIFT (6U) -/*! BPGLCD34 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD34(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD34_SHIFT)) & LCD_WF8B_BPGLCD34_MASK) - -#define LCD_WF8B_BPGLCD35_MASK (0x40U) -#define LCD_WF8B_BPGLCD35_SHIFT (6U) -/*! BPGLCD35 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD35(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD35_SHIFT)) & LCD_WF8B_BPGLCD35_MASK) - -#define LCD_WF8B_BPGLCD36_MASK (0x40U) -#define LCD_WF8B_BPGLCD36_SHIFT (6U) -/*! BPGLCD36 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD36(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD36_SHIFT)) & LCD_WF8B_BPGLCD36_MASK) - -#define LCD_WF8B_BPGLCD37_MASK (0x40U) -#define LCD_WF8B_BPGLCD37_SHIFT (6U) -/*! BPGLCD37 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD37(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD37_SHIFT)) & LCD_WF8B_BPGLCD37_MASK) - -#define LCD_WF8B_BPGLCD38_MASK (0x40U) -#define LCD_WF8B_BPGLCD38_SHIFT (6U) -/*! BPGLCD38 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD38(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD38_SHIFT)) & LCD_WF8B_BPGLCD38_MASK) - -#define LCD_WF8B_BPGLCD39_MASK (0x40U) -#define LCD_WF8B_BPGLCD39_SHIFT (6U) -/*! BPGLCD39 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD39(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD39_SHIFT)) & LCD_WF8B_BPGLCD39_MASK) - -#define LCD_WF8B_BPGLCD40_MASK (0x40U) -#define LCD_WF8B_BPGLCD40_SHIFT (6U) -/*! BPGLCD40 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD40(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD40_SHIFT)) & LCD_WF8B_BPGLCD40_MASK) - -#define LCD_WF8B_BPGLCD41_MASK (0x40U) -#define LCD_WF8B_BPGLCD41_SHIFT (6U) -/*! BPGLCD41 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD41(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD41_SHIFT)) & LCD_WF8B_BPGLCD41_MASK) - -#define LCD_WF8B_BPGLCD42_MASK (0x40U) -#define LCD_WF8B_BPGLCD42_SHIFT (6U) -/*! BPGLCD42 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD42(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD42_SHIFT)) & LCD_WF8B_BPGLCD42_MASK) - -#define LCD_WF8B_BPGLCD43_MASK (0x40U) -#define LCD_WF8B_BPGLCD43_SHIFT (6U) -/*! BPGLCD43 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD43(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD43_SHIFT)) & LCD_WF8B_BPGLCD43_MASK) - -#define LCD_WF8B_BPGLCD44_MASK (0x40U) -#define LCD_WF8B_BPGLCD44_SHIFT (6U) -/*! BPGLCD44 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD44(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD44_SHIFT)) & LCD_WF8B_BPGLCD44_MASK) - -#define LCD_WF8B_BPGLCD45_MASK (0x40U) -#define LCD_WF8B_BPGLCD45_SHIFT (6U) -/*! BPGLCD45 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD45(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD45_SHIFT)) & LCD_WF8B_BPGLCD45_MASK) - -#define LCD_WF8B_BPGLCD46_MASK (0x40U) -#define LCD_WF8B_BPGLCD46_SHIFT (6U) -/*! BPGLCD46 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD46(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD46_SHIFT)) & LCD_WF8B_BPGLCD46_MASK) - -#define LCD_WF8B_BPGLCD47_MASK (0x40U) -#define LCD_WF8B_BPGLCD47_SHIFT (6U) -/*! BPGLCD47 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD47(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD47_SHIFT)) & LCD_WF8B_BPGLCD47_MASK) - -#define LCD_WF8B_BPGLCD48_MASK (0x40U) -#define LCD_WF8B_BPGLCD48_SHIFT (6U) -/*! BPGLCD48 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD48(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD48_SHIFT)) & LCD_WF8B_BPGLCD48_MASK) - -#define LCD_WF8B_BPGLCD49_MASK (0x40U) -#define LCD_WF8B_BPGLCD49_SHIFT (6U) -/*! BPGLCD49 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD49(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD49_SHIFT)) & LCD_WF8B_BPGLCD49_MASK) - -#define LCD_WF8B_BPGLCD50_MASK (0x40U) -#define LCD_WF8B_BPGLCD50_SHIFT (6U) -/*! BPGLCD50 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD50(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD50_SHIFT)) & LCD_WF8B_BPGLCD50_MASK) - -#define LCD_WF8B_BPGLCD51_MASK (0x40U) -#define LCD_WF8B_BPGLCD51_SHIFT (6U) -/*! BPGLCD51 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD51(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD51_SHIFT)) & LCD_WF8B_BPGLCD51_MASK) - -#define LCD_WF8B_BPGLCD52_MASK (0x40U) -#define LCD_WF8B_BPGLCD52_SHIFT (6U) -/*! BPGLCD52 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD52(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD52_SHIFT)) & LCD_WF8B_BPGLCD52_MASK) - -#define LCD_WF8B_BPGLCD53_MASK (0x40U) -#define LCD_WF8B_BPGLCD53_SHIFT (6U) -/*! BPGLCD53 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD53(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD53_SHIFT)) & LCD_WF8B_BPGLCD53_MASK) - -#define LCD_WF8B_BPGLCD54_MASK (0x40U) -#define LCD_WF8B_BPGLCD54_SHIFT (6U) -/*! BPGLCD54 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD54(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD54_SHIFT)) & LCD_WF8B_BPGLCD54_MASK) - -#define LCD_WF8B_BPGLCD55_MASK (0x40U) -#define LCD_WF8B_BPGLCD55_SHIFT (6U) -/*! BPGLCD55 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD55(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD55_SHIFT)) & LCD_WF8B_BPGLCD55_MASK) - -#define LCD_WF8B_BPGLCD56_MASK (0x40U) -#define LCD_WF8B_BPGLCD56_SHIFT (6U) -/*! BPGLCD56 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD56(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD56_SHIFT)) & LCD_WF8B_BPGLCD56_MASK) - -#define LCD_WF8B_BPGLCD57_MASK (0x40U) -#define LCD_WF8B_BPGLCD57_SHIFT (6U) -/*! BPGLCD57 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD57(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD57_SHIFT)) & LCD_WF8B_BPGLCD57_MASK) - -#define LCD_WF8B_BPGLCD58_MASK (0x40U) -#define LCD_WF8B_BPGLCD58_SHIFT (6U) -/*! BPGLCD58 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD58(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD58_SHIFT)) & LCD_WF8B_BPGLCD58_MASK) - -#define LCD_WF8B_BPGLCD59_MASK (0x40U) -#define LCD_WF8B_BPGLCD59_SHIFT (6U) -/*! BPGLCD59 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD59(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD59_SHIFT)) & LCD_WF8B_BPGLCD59_MASK) - -#define LCD_WF8B_BPGLCD60_MASK (0x40U) -#define LCD_WF8B_BPGLCD60_SHIFT (6U) -/*! BPGLCD60 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD60(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD60_SHIFT)) & LCD_WF8B_BPGLCD60_MASK) - -#define LCD_WF8B_BPGLCD61_MASK (0x40U) -#define LCD_WF8B_BPGLCD61_SHIFT (6U) -/*! BPGLCD61 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD61(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD61_SHIFT)) & LCD_WF8B_BPGLCD61_MASK) - -#define LCD_WF8B_BPGLCD62_MASK (0x40U) -#define LCD_WF8B_BPGLCD62_SHIFT (6U) -/*! BPGLCD62 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD62(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD62_SHIFT)) & LCD_WF8B_BPGLCD62_MASK) - -#define LCD_WF8B_BPGLCD63_MASK (0x40U) -#define LCD_WF8B_BPGLCD63_SHIFT (6U) -/*! BPGLCD63 - * 0b0..LCD segment off or LCD backplane inactive for phase G - * 0b1..LCD segment on or LCD backplane active for phase G - */ -#define LCD_WF8B_BPGLCD63(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPGLCD63_SHIFT)) & LCD_WF8B_BPGLCD63_MASK) - -#define LCD_WF8B_BPHLCD0_MASK (0x80U) -#define LCD_WF8B_BPHLCD0_SHIFT (7U) -/*! BPHLCD0 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD0(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD0_SHIFT)) & LCD_WF8B_BPHLCD0_MASK) - -#define LCD_WF8B_BPHLCD1_MASK (0x80U) -#define LCD_WF8B_BPHLCD1_SHIFT (7U) -/*! BPHLCD1 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD1(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD1_SHIFT)) & LCD_WF8B_BPHLCD1_MASK) - -#define LCD_WF8B_BPHLCD2_MASK (0x80U) -#define LCD_WF8B_BPHLCD2_SHIFT (7U) -/*! BPHLCD2 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD2(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD2_SHIFT)) & LCD_WF8B_BPHLCD2_MASK) - -#define LCD_WF8B_BPHLCD3_MASK (0x80U) -#define LCD_WF8B_BPHLCD3_SHIFT (7U) -/*! BPHLCD3 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD3(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD3_SHIFT)) & LCD_WF8B_BPHLCD3_MASK) - -#define LCD_WF8B_BPHLCD4_MASK (0x80U) -#define LCD_WF8B_BPHLCD4_SHIFT (7U) -/*! BPHLCD4 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD4(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD4_SHIFT)) & LCD_WF8B_BPHLCD4_MASK) - -#define LCD_WF8B_BPHLCD5_MASK (0x80U) -#define LCD_WF8B_BPHLCD5_SHIFT (7U) -/*! BPHLCD5 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD5(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD5_SHIFT)) & LCD_WF8B_BPHLCD5_MASK) - -#define LCD_WF8B_BPHLCD6_MASK (0x80U) -#define LCD_WF8B_BPHLCD6_SHIFT (7U) -/*! BPHLCD6 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD6(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD6_SHIFT)) & LCD_WF8B_BPHLCD6_MASK) - -#define LCD_WF8B_BPHLCD7_MASK (0x80U) -#define LCD_WF8B_BPHLCD7_SHIFT (7U) -/*! BPHLCD7 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD7(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD7_SHIFT)) & LCD_WF8B_BPHLCD7_MASK) - -#define LCD_WF8B_BPHLCD8_MASK (0x80U) -#define LCD_WF8B_BPHLCD8_SHIFT (7U) -/*! BPHLCD8 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD8(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD8_SHIFT)) & LCD_WF8B_BPHLCD8_MASK) - -#define LCD_WF8B_BPHLCD9_MASK (0x80U) -#define LCD_WF8B_BPHLCD9_SHIFT (7U) -/*! BPHLCD9 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD9(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD9_SHIFT)) & LCD_WF8B_BPHLCD9_MASK) - -#define LCD_WF8B_BPHLCD10_MASK (0x80U) -#define LCD_WF8B_BPHLCD10_SHIFT (7U) -/*! BPHLCD10 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD10(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD10_SHIFT)) & LCD_WF8B_BPHLCD10_MASK) - -#define LCD_WF8B_BPHLCD11_MASK (0x80U) -#define LCD_WF8B_BPHLCD11_SHIFT (7U) -/*! BPHLCD11 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD11(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD11_SHIFT)) & LCD_WF8B_BPHLCD11_MASK) - -#define LCD_WF8B_BPHLCD12_MASK (0x80U) -#define LCD_WF8B_BPHLCD12_SHIFT (7U) -/*! BPHLCD12 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD12(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD12_SHIFT)) & LCD_WF8B_BPHLCD12_MASK) - -#define LCD_WF8B_BPHLCD13_MASK (0x80U) -#define LCD_WF8B_BPHLCD13_SHIFT (7U) -/*! BPHLCD13 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD13(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD13_SHIFT)) & LCD_WF8B_BPHLCD13_MASK) - -#define LCD_WF8B_BPHLCD14_MASK (0x80U) -#define LCD_WF8B_BPHLCD14_SHIFT (7U) -/*! BPHLCD14 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD14(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD14_SHIFT)) & LCD_WF8B_BPHLCD14_MASK) - -#define LCD_WF8B_BPHLCD15_MASK (0x80U) -#define LCD_WF8B_BPHLCD15_SHIFT (7U) -/*! BPHLCD15 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD15(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD15_SHIFT)) & LCD_WF8B_BPHLCD15_MASK) - -#define LCD_WF8B_BPHLCD16_MASK (0x80U) -#define LCD_WF8B_BPHLCD16_SHIFT (7U) -/*! BPHLCD16 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD16(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD16_SHIFT)) & LCD_WF8B_BPHLCD16_MASK) - -#define LCD_WF8B_BPHLCD17_MASK (0x80U) -#define LCD_WF8B_BPHLCD17_SHIFT (7U) -/*! BPHLCD17 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD17(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD17_SHIFT)) & LCD_WF8B_BPHLCD17_MASK) - -#define LCD_WF8B_BPHLCD18_MASK (0x80U) -#define LCD_WF8B_BPHLCD18_SHIFT (7U) -/*! BPHLCD18 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD18(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD18_SHIFT)) & LCD_WF8B_BPHLCD18_MASK) - -#define LCD_WF8B_BPHLCD19_MASK (0x80U) -#define LCD_WF8B_BPHLCD19_SHIFT (7U) -/*! BPHLCD19 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD19(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD19_SHIFT)) & LCD_WF8B_BPHLCD19_MASK) - -#define LCD_WF8B_BPHLCD20_MASK (0x80U) -#define LCD_WF8B_BPHLCD20_SHIFT (7U) -/*! BPHLCD20 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD20(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD20_SHIFT)) & LCD_WF8B_BPHLCD20_MASK) - -#define LCD_WF8B_BPHLCD21_MASK (0x80U) -#define LCD_WF8B_BPHLCD21_SHIFT (7U) -/*! BPHLCD21 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD21(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD21_SHIFT)) & LCD_WF8B_BPHLCD21_MASK) - -#define LCD_WF8B_BPHLCD22_MASK (0x80U) -#define LCD_WF8B_BPHLCD22_SHIFT (7U) -/*! BPHLCD22 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD22(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD22_SHIFT)) & LCD_WF8B_BPHLCD22_MASK) - -#define LCD_WF8B_BPHLCD23_MASK (0x80U) -#define LCD_WF8B_BPHLCD23_SHIFT (7U) -/*! BPHLCD23 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD23(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD23_SHIFT)) & LCD_WF8B_BPHLCD23_MASK) - -#define LCD_WF8B_BPHLCD24_MASK (0x80U) -#define LCD_WF8B_BPHLCD24_SHIFT (7U) -/*! BPHLCD24 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD24(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD24_SHIFT)) & LCD_WF8B_BPHLCD24_MASK) - -#define LCD_WF8B_BPHLCD25_MASK (0x80U) -#define LCD_WF8B_BPHLCD25_SHIFT (7U) -/*! BPHLCD25 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD25(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD25_SHIFT)) & LCD_WF8B_BPHLCD25_MASK) - -#define LCD_WF8B_BPHLCD26_MASK (0x80U) -#define LCD_WF8B_BPHLCD26_SHIFT (7U) -/*! BPHLCD26 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD26(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD26_SHIFT)) & LCD_WF8B_BPHLCD26_MASK) - -#define LCD_WF8B_BPHLCD27_MASK (0x80U) -#define LCD_WF8B_BPHLCD27_SHIFT (7U) -/*! BPHLCD27 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD27(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD27_SHIFT)) & LCD_WF8B_BPHLCD27_MASK) - -#define LCD_WF8B_BPHLCD28_MASK (0x80U) -#define LCD_WF8B_BPHLCD28_SHIFT (7U) -/*! BPHLCD28 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD28(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD28_SHIFT)) & LCD_WF8B_BPHLCD28_MASK) - -#define LCD_WF8B_BPHLCD29_MASK (0x80U) -#define LCD_WF8B_BPHLCD29_SHIFT (7U) -/*! BPHLCD29 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD29(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD29_SHIFT)) & LCD_WF8B_BPHLCD29_MASK) - -#define LCD_WF8B_BPHLCD30_MASK (0x80U) -#define LCD_WF8B_BPHLCD30_SHIFT (7U) -/*! BPHLCD30 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD30(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD30_SHIFT)) & LCD_WF8B_BPHLCD30_MASK) - -#define LCD_WF8B_BPHLCD31_MASK (0x80U) -#define LCD_WF8B_BPHLCD31_SHIFT (7U) -/*! BPHLCD31 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD31(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD31_SHIFT)) & LCD_WF8B_BPHLCD31_MASK) - -#define LCD_WF8B_BPHLCD32_MASK (0x80U) -#define LCD_WF8B_BPHLCD32_SHIFT (7U) -/*! BPHLCD32 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD32(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD32_SHIFT)) & LCD_WF8B_BPHLCD32_MASK) - -#define LCD_WF8B_BPHLCD33_MASK (0x80U) -#define LCD_WF8B_BPHLCD33_SHIFT (7U) -/*! BPHLCD33 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD33(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD33_SHIFT)) & LCD_WF8B_BPHLCD33_MASK) - -#define LCD_WF8B_BPHLCD34_MASK (0x80U) -#define LCD_WF8B_BPHLCD34_SHIFT (7U) -/*! BPHLCD34 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD34(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD34_SHIFT)) & LCD_WF8B_BPHLCD34_MASK) - -#define LCD_WF8B_BPHLCD35_MASK (0x80U) -#define LCD_WF8B_BPHLCD35_SHIFT (7U) -/*! BPHLCD35 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD35(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD35_SHIFT)) & LCD_WF8B_BPHLCD35_MASK) - -#define LCD_WF8B_BPHLCD36_MASK (0x80U) -#define LCD_WF8B_BPHLCD36_SHIFT (7U) -/*! BPHLCD36 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD36(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD36_SHIFT)) & LCD_WF8B_BPHLCD36_MASK) - -#define LCD_WF8B_BPHLCD37_MASK (0x80U) -#define LCD_WF8B_BPHLCD37_SHIFT (7U) -/*! BPHLCD37 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD37(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD37_SHIFT)) & LCD_WF8B_BPHLCD37_MASK) - -#define LCD_WF8B_BPHLCD38_MASK (0x80U) -#define LCD_WF8B_BPHLCD38_SHIFT (7U) -/*! BPHLCD38 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD38(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD38_SHIFT)) & LCD_WF8B_BPHLCD38_MASK) - -#define LCD_WF8B_BPHLCD39_MASK (0x80U) -#define LCD_WF8B_BPHLCD39_SHIFT (7U) -/*! BPHLCD39 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD39(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD39_SHIFT)) & LCD_WF8B_BPHLCD39_MASK) - -#define LCD_WF8B_BPHLCD40_MASK (0x80U) -#define LCD_WF8B_BPHLCD40_SHIFT (7U) -/*! BPHLCD40 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD40(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD40_SHIFT)) & LCD_WF8B_BPHLCD40_MASK) - -#define LCD_WF8B_BPHLCD41_MASK (0x80U) -#define LCD_WF8B_BPHLCD41_SHIFT (7U) -/*! BPHLCD41 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD41(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD41_SHIFT)) & LCD_WF8B_BPHLCD41_MASK) - -#define LCD_WF8B_BPHLCD42_MASK (0x80U) -#define LCD_WF8B_BPHLCD42_SHIFT (7U) -/*! BPHLCD42 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD42(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD42_SHIFT)) & LCD_WF8B_BPHLCD42_MASK) - -#define LCD_WF8B_BPHLCD43_MASK (0x80U) -#define LCD_WF8B_BPHLCD43_SHIFT (7U) -/*! BPHLCD43 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD43(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD43_SHIFT)) & LCD_WF8B_BPHLCD43_MASK) - -#define LCD_WF8B_BPHLCD44_MASK (0x80U) -#define LCD_WF8B_BPHLCD44_SHIFT (7U) -/*! BPHLCD44 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD44(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD44_SHIFT)) & LCD_WF8B_BPHLCD44_MASK) - -#define LCD_WF8B_BPHLCD45_MASK (0x80U) -#define LCD_WF8B_BPHLCD45_SHIFT (7U) -/*! BPHLCD45 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD45(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD45_SHIFT)) & LCD_WF8B_BPHLCD45_MASK) - -#define LCD_WF8B_BPHLCD46_MASK (0x80U) -#define LCD_WF8B_BPHLCD46_SHIFT (7U) -/*! BPHLCD46 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD46(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD46_SHIFT)) & LCD_WF8B_BPHLCD46_MASK) - -#define LCD_WF8B_BPHLCD47_MASK (0x80U) -#define LCD_WF8B_BPHLCD47_SHIFT (7U) -/*! BPHLCD47 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD47(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD47_SHIFT)) & LCD_WF8B_BPHLCD47_MASK) - -#define LCD_WF8B_BPHLCD48_MASK (0x80U) -#define LCD_WF8B_BPHLCD48_SHIFT (7U) -/*! BPHLCD48 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD48(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD48_SHIFT)) & LCD_WF8B_BPHLCD48_MASK) - -#define LCD_WF8B_BPHLCD49_MASK (0x80U) -#define LCD_WF8B_BPHLCD49_SHIFT (7U) -/*! BPHLCD49 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD49(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD49_SHIFT)) & LCD_WF8B_BPHLCD49_MASK) - -#define LCD_WF8B_BPHLCD50_MASK (0x80U) -#define LCD_WF8B_BPHLCD50_SHIFT (7U) -/*! BPHLCD50 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD50(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD50_SHIFT)) & LCD_WF8B_BPHLCD50_MASK) - -#define LCD_WF8B_BPHLCD51_MASK (0x80U) -#define LCD_WF8B_BPHLCD51_SHIFT (7U) -/*! BPHLCD51 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD51(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD51_SHIFT)) & LCD_WF8B_BPHLCD51_MASK) - -#define LCD_WF8B_BPHLCD52_MASK (0x80U) -#define LCD_WF8B_BPHLCD52_SHIFT (7U) -/*! BPHLCD52 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD52(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD52_SHIFT)) & LCD_WF8B_BPHLCD52_MASK) - -#define LCD_WF8B_BPHLCD53_MASK (0x80U) -#define LCD_WF8B_BPHLCD53_SHIFT (7U) -/*! BPHLCD53 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD53(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD53_SHIFT)) & LCD_WF8B_BPHLCD53_MASK) - -#define LCD_WF8B_BPHLCD54_MASK (0x80U) -#define LCD_WF8B_BPHLCD54_SHIFT (7U) -/*! BPHLCD54 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD54(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD54_SHIFT)) & LCD_WF8B_BPHLCD54_MASK) - -#define LCD_WF8B_BPHLCD55_MASK (0x80U) -#define LCD_WF8B_BPHLCD55_SHIFT (7U) -/*! BPHLCD55 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD55(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD55_SHIFT)) & LCD_WF8B_BPHLCD55_MASK) - -#define LCD_WF8B_BPHLCD56_MASK (0x80U) -#define LCD_WF8B_BPHLCD56_SHIFT (7U) -/*! BPHLCD56 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD56(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD56_SHIFT)) & LCD_WF8B_BPHLCD56_MASK) - -#define LCD_WF8B_BPHLCD57_MASK (0x80U) -#define LCD_WF8B_BPHLCD57_SHIFT (7U) -/*! BPHLCD57 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD57(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD57_SHIFT)) & LCD_WF8B_BPHLCD57_MASK) - -#define LCD_WF8B_BPHLCD58_MASK (0x80U) -#define LCD_WF8B_BPHLCD58_SHIFT (7U) -/*! BPHLCD58 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD58(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD58_SHIFT)) & LCD_WF8B_BPHLCD58_MASK) - -#define LCD_WF8B_BPHLCD59_MASK (0x80U) -#define LCD_WF8B_BPHLCD59_SHIFT (7U) -/*! BPHLCD59 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD59(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD59_SHIFT)) & LCD_WF8B_BPHLCD59_MASK) - -#define LCD_WF8B_BPHLCD60_MASK (0x80U) -#define LCD_WF8B_BPHLCD60_SHIFT (7U) -/*! BPHLCD60 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD60(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD60_SHIFT)) & LCD_WF8B_BPHLCD60_MASK) - -#define LCD_WF8B_BPHLCD61_MASK (0x80U) -#define LCD_WF8B_BPHLCD61_SHIFT (7U) -/*! BPHLCD61 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD61(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD61_SHIFT)) & LCD_WF8B_BPHLCD61_MASK) - -#define LCD_WF8B_BPHLCD62_MASK (0x80U) -#define LCD_WF8B_BPHLCD62_SHIFT (7U) -/*! BPHLCD62 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD62(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD62_SHIFT)) & LCD_WF8B_BPHLCD62_MASK) - -#define LCD_WF8B_BPHLCD63_MASK (0x80U) -#define LCD_WF8B_BPHLCD63_SHIFT (7U) -/*! BPHLCD63 - * 0b0..LCD segment off or LCD backplane inactive for phase H - * 0b1..LCD segment on or LCD backplane active for phase H - */ -#define LCD_WF8B_BPHLCD63(x) (((uint8_t)(((uint8_t)(x)) << LCD_WF8B_BPHLCD63_SHIFT)) & LCD_WF8B_BPHLCD63_MASK) -/*! @} */ - -/* The count of LCD_WF8B */ -#define LCD_WF8B_COUNT (64U) - -/*! @name WF - LCD Waveform register */ -/*! @{ */ - -#define LCD_WF_WF0_MASK (0xFFU) -#define LCD_WF_WF0_SHIFT (0U) -#define LCD_WF_WF0(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF0_SHIFT)) & LCD_WF_WF0_MASK) - -#define LCD_WF_WF4_MASK (0xFFU) -#define LCD_WF_WF4_SHIFT (0U) -#define LCD_WF_WF4(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF4_SHIFT)) & LCD_WF_WF4_MASK) - -#define LCD_WF_WF8_MASK (0xFFU) -#define LCD_WF_WF8_SHIFT (0U) -#define LCD_WF_WF8(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF8_SHIFT)) & LCD_WF_WF8_MASK) - -#define LCD_WF_WF12_MASK (0xFFU) -#define LCD_WF_WF12_SHIFT (0U) -#define LCD_WF_WF12(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF12_SHIFT)) & LCD_WF_WF12_MASK) - -#define LCD_WF_WF16_MASK (0xFFU) -#define LCD_WF_WF16_SHIFT (0U) -#define LCD_WF_WF16(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF16_SHIFT)) & LCD_WF_WF16_MASK) - -#define LCD_WF_WF20_MASK (0xFFU) -#define LCD_WF_WF20_SHIFT (0U) -#define LCD_WF_WF20(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF20_SHIFT)) & LCD_WF_WF20_MASK) - -#define LCD_WF_WF24_MASK (0xFFU) -#define LCD_WF_WF24_SHIFT (0U) -#define LCD_WF_WF24(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF24_SHIFT)) & LCD_WF_WF24_MASK) - -#define LCD_WF_WF28_MASK (0xFFU) -#define LCD_WF_WF28_SHIFT (0U) -#define LCD_WF_WF28(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF28_SHIFT)) & LCD_WF_WF28_MASK) - -#define LCD_WF_WF32_MASK (0xFFU) -#define LCD_WF_WF32_SHIFT (0U) -#define LCD_WF_WF32(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF32_SHIFT)) & LCD_WF_WF32_MASK) - -#define LCD_WF_WF36_MASK (0xFFU) -#define LCD_WF_WF36_SHIFT (0U) -#define LCD_WF_WF36(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF36_SHIFT)) & LCD_WF_WF36_MASK) - -#define LCD_WF_WF40_MASK (0xFFU) -#define LCD_WF_WF40_SHIFT (0U) -#define LCD_WF_WF40(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF40_SHIFT)) & LCD_WF_WF40_MASK) - -#define LCD_WF_WF44_MASK (0xFFU) -#define LCD_WF_WF44_SHIFT (0U) -#define LCD_WF_WF44(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF44_SHIFT)) & LCD_WF_WF44_MASK) - -#define LCD_WF_WF48_MASK (0xFFU) -#define LCD_WF_WF48_SHIFT (0U) -#define LCD_WF_WF48(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF48_SHIFT)) & LCD_WF_WF48_MASK) - -#define LCD_WF_WF52_MASK (0xFFU) -#define LCD_WF_WF52_SHIFT (0U) -#define LCD_WF_WF52(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF52_SHIFT)) & LCD_WF_WF52_MASK) - -#define LCD_WF_WF56_MASK (0xFFU) -#define LCD_WF_WF56_SHIFT (0U) -#define LCD_WF_WF56(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF56_SHIFT)) & LCD_WF_WF56_MASK) - -#define LCD_WF_WF60_MASK (0xFFU) -#define LCD_WF_WF60_SHIFT (0U) -#define LCD_WF_WF60(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF60_SHIFT)) & LCD_WF_WF60_MASK) - -#define LCD_WF_WF1_MASK (0xFF00U) -#define LCD_WF_WF1_SHIFT (8U) -#define LCD_WF_WF1(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF1_SHIFT)) & LCD_WF_WF1_MASK) - -#define LCD_WF_WF5_MASK (0xFF00U) -#define LCD_WF_WF5_SHIFT (8U) -#define LCD_WF_WF5(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF5_SHIFT)) & LCD_WF_WF5_MASK) - -#define LCD_WF_WF9_MASK (0xFF00U) -#define LCD_WF_WF9_SHIFT (8U) -#define LCD_WF_WF9(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF9_SHIFT)) & LCD_WF_WF9_MASK) - -#define LCD_WF_WF13_MASK (0xFF00U) -#define LCD_WF_WF13_SHIFT (8U) -#define LCD_WF_WF13(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF13_SHIFT)) & LCD_WF_WF13_MASK) - -#define LCD_WF_WF17_MASK (0xFF00U) -#define LCD_WF_WF17_SHIFT (8U) -#define LCD_WF_WF17(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF17_SHIFT)) & LCD_WF_WF17_MASK) - -#define LCD_WF_WF21_MASK (0xFF00U) -#define LCD_WF_WF21_SHIFT (8U) -#define LCD_WF_WF21(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF21_SHIFT)) & LCD_WF_WF21_MASK) - -#define LCD_WF_WF25_MASK (0xFF00U) -#define LCD_WF_WF25_SHIFT (8U) -#define LCD_WF_WF25(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF25_SHIFT)) & LCD_WF_WF25_MASK) - -#define LCD_WF_WF29_MASK (0xFF00U) -#define LCD_WF_WF29_SHIFT (8U) -#define LCD_WF_WF29(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF29_SHIFT)) & LCD_WF_WF29_MASK) - -#define LCD_WF_WF33_MASK (0xFF00U) -#define LCD_WF_WF33_SHIFT (8U) -#define LCD_WF_WF33(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF33_SHIFT)) & LCD_WF_WF33_MASK) - -#define LCD_WF_WF37_MASK (0xFF00U) -#define LCD_WF_WF37_SHIFT (8U) -#define LCD_WF_WF37(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF37_SHIFT)) & LCD_WF_WF37_MASK) - -#define LCD_WF_WF41_MASK (0xFF00U) -#define LCD_WF_WF41_SHIFT (8U) -#define LCD_WF_WF41(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF41_SHIFT)) & LCD_WF_WF41_MASK) - -#define LCD_WF_WF45_MASK (0xFF00U) -#define LCD_WF_WF45_SHIFT (8U) -#define LCD_WF_WF45(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF45_SHIFT)) & LCD_WF_WF45_MASK) - -#define LCD_WF_WF49_MASK (0xFF00U) -#define LCD_WF_WF49_SHIFT (8U) -#define LCD_WF_WF49(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF49_SHIFT)) & LCD_WF_WF49_MASK) - -#define LCD_WF_WF53_MASK (0xFF00U) -#define LCD_WF_WF53_SHIFT (8U) -#define LCD_WF_WF53(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF53_SHIFT)) & LCD_WF_WF53_MASK) - -#define LCD_WF_WF57_MASK (0xFF00U) -#define LCD_WF_WF57_SHIFT (8U) -#define LCD_WF_WF57(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF57_SHIFT)) & LCD_WF_WF57_MASK) - -#define LCD_WF_WF61_MASK (0xFF00U) -#define LCD_WF_WF61_SHIFT (8U) -#define LCD_WF_WF61(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF61_SHIFT)) & LCD_WF_WF61_MASK) - -#define LCD_WF_WF2_MASK (0xFF0000U) -#define LCD_WF_WF2_SHIFT (16U) -#define LCD_WF_WF2(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF2_SHIFT)) & LCD_WF_WF2_MASK) - -#define LCD_WF_WF6_MASK (0xFF0000U) -#define LCD_WF_WF6_SHIFT (16U) -#define LCD_WF_WF6(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF6_SHIFT)) & LCD_WF_WF6_MASK) - -#define LCD_WF_WF10_MASK (0xFF0000U) -#define LCD_WF_WF10_SHIFT (16U) -#define LCD_WF_WF10(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF10_SHIFT)) & LCD_WF_WF10_MASK) - -#define LCD_WF_WF14_MASK (0xFF0000U) -#define LCD_WF_WF14_SHIFT (16U) -#define LCD_WF_WF14(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF14_SHIFT)) & LCD_WF_WF14_MASK) - -#define LCD_WF_WF18_MASK (0xFF0000U) -#define LCD_WF_WF18_SHIFT (16U) -#define LCD_WF_WF18(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF18_SHIFT)) & LCD_WF_WF18_MASK) - -#define LCD_WF_WF22_MASK (0xFF0000U) -#define LCD_WF_WF22_SHIFT (16U) -#define LCD_WF_WF22(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF22_SHIFT)) & LCD_WF_WF22_MASK) - -#define LCD_WF_WF26_MASK (0xFF0000U) -#define LCD_WF_WF26_SHIFT (16U) -#define LCD_WF_WF26(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF26_SHIFT)) & LCD_WF_WF26_MASK) - -#define LCD_WF_WF30_MASK (0xFF0000U) -#define LCD_WF_WF30_SHIFT (16U) -#define LCD_WF_WF30(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF30_SHIFT)) & LCD_WF_WF30_MASK) - -#define LCD_WF_WF34_MASK (0xFF0000U) -#define LCD_WF_WF34_SHIFT (16U) -#define LCD_WF_WF34(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF34_SHIFT)) & LCD_WF_WF34_MASK) - -#define LCD_WF_WF38_MASK (0xFF0000U) -#define LCD_WF_WF38_SHIFT (16U) -#define LCD_WF_WF38(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF38_SHIFT)) & LCD_WF_WF38_MASK) - -#define LCD_WF_WF42_MASK (0xFF0000U) -#define LCD_WF_WF42_SHIFT (16U) -#define LCD_WF_WF42(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF42_SHIFT)) & LCD_WF_WF42_MASK) - -#define LCD_WF_WF46_MASK (0xFF0000U) -#define LCD_WF_WF46_SHIFT (16U) -#define LCD_WF_WF46(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF46_SHIFT)) & LCD_WF_WF46_MASK) - -#define LCD_WF_WF50_MASK (0xFF0000U) -#define LCD_WF_WF50_SHIFT (16U) -#define LCD_WF_WF50(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF50_SHIFT)) & LCD_WF_WF50_MASK) - -#define LCD_WF_WF54_MASK (0xFF0000U) -#define LCD_WF_WF54_SHIFT (16U) -#define LCD_WF_WF54(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF54_SHIFT)) & LCD_WF_WF54_MASK) - -#define LCD_WF_WF58_MASK (0xFF0000U) -#define LCD_WF_WF58_SHIFT (16U) -#define LCD_WF_WF58(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF58_SHIFT)) & LCD_WF_WF58_MASK) - -#define LCD_WF_WF62_MASK (0xFF0000U) -#define LCD_WF_WF62_SHIFT (16U) -#define LCD_WF_WF62(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF62_SHIFT)) & LCD_WF_WF62_MASK) - -#define LCD_WF_WF3_MASK (0xFF000000U) -#define LCD_WF_WF3_SHIFT (24U) -#define LCD_WF_WF3(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF3_SHIFT)) & LCD_WF_WF3_MASK) - -#define LCD_WF_WF7_MASK (0xFF000000U) -#define LCD_WF_WF7_SHIFT (24U) -#define LCD_WF_WF7(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF7_SHIFT)) & LCD_WF_WF7_MASK) - -#define LCD_WF_WF11_MASK (0xFF000000U) -#define LCD_WF_WF11_SHIFT (24U) -#define LCD_WF_WF11(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF11_SHIFT)) & LCD_WF_WF11_MASK) - -#define LCD_WF_WF15_MASK (0xFF000000U) -#define LCD_WF_WF15_SHIFT (24U) -#define LCD_WF_WF15(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF15_SHIFT)) & LCD_WF_WF15_MASK) - -#define LCD_WF_WF19_MASK (0xFF000000U) -#define LCD_WF_WF19_SHIFT (24U) -#define LCD_WF_WF19(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF19_SHIFT)) & LCD_WF_WF19_MASK) - -#define LCD_WF_WF23_MASK (0xFF000000U) -#define LCD_WF_WF23_SHIFT (24U) -#define LCD_WF_WF23(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF23_SHIFT)) & LCD_WF_WF23_MASK) - -#define LCD_WF_WF27_MASK (0xFF000000U) -#define LCD_WF_WF27_SHIFT (24U) -#define LCD_WF_WF27(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF27_SHIFT)) & LCD_WF_WF27_MASK) - -#define LCD_WF_WF31_MASK (0xFF000000U) -#define LCD_WF_WF31_SHIFT (24U) -#define LCD_WF_WF31(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF31_SHIFT)) & LCD_WF_WF31_MASK) - -#define LCD_WF_WF35_MASK (0xFF000000U) -#define LCD_WF_WF35_SHIFT (24U) -#define LCD_WF_WF35(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF35_SHIFT)) & LCD_WF_WF35_MASK) - -#define LCD_WF_WF39_MASK (0xFF000000U) -#define LCD_WF_WF39_SHIFT (24U) -#define LCD_WF_WF39(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF39_SHIFT)) & LCD_WF_WF39_MASK) - -#define LCD_WF_WF43_MASK (0xFF000000U) -#define LCD_WF_WF43_SHIFT (24U) -#define LCD_WF_WF43(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF43_SHIFT)) & LCD_WF_WF43_MASK) - -#define LCD_WF_WF47_MASK (0xFF000000U) -#define LCD_WF_WF47_SHIFT (24U) -#define LCD_WF_WF47(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF47_SHIFT)) & LCD_WF_WF47_MASK) - -#define LCD_WF_WF51_MASK (0xFF000000U) -#define LCD_WF_WF51_SHIFT (24U) -#define LCD_WF_WF51(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF51_SHIFT)) & LCD_WF_WF51_MASK) - -#define LCD_WF_WF55_MASK (0xFF000000U) -#define LCD_WF_WF55_SHIFT (24U) -#define LCD_WF_WF55(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF55_SHIFT)) & LCD_WF_WF55_MASK) - -#define LCD_WF_WF59_MASK (0xFF000000U) -#define LCD_WF_WF59_SHIFT (24U) -#define LCD_WF_WF59(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF59_SHIFT)) & LCD_WF_WF59_MASK) - -#define LCD_WF_WF63_MASK (0xFF000000U) -#define LCD_WF_WF63_SHIFT (24U) -#define LCD_WF_WF63(x) (((uint32_t)(((uint32_t)(x)) << LCD_WF_WF63_SHIFT)) & LCD_WF_WF63_MASK) -/*! @} */ - -/* The count of LCD_WF */ -#define LCD_WF_COUNT (16U) - - -/*! - * @} - */ /* end of group LCD_Register_Masks */ - - -/* LCD - Peripheral instance base addresses */ -/** Peripheral LCD base address */ -#define LCD_BASE (0x40053000u) -/** Peripheral LCD base pointer */ -#define LCD ((LCD_Type *)LCD_BASE) -/** Array initializer of LCD peripheral base addresses */ -#define LCD_BASE_ADDRS { LCD_BASE } -/** Array initializer of LCD peripheral base pointers */ -#define LCD_BASE_PTRS { LCD } -/** Interrupt vectors for the LCD peripheral type */ -#define LCD_LCD_IRQS { LCD_IRQn } - -/*! - * @} - */ /* end of group LCD_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LLWU Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LLWU_Peripheral_Access_Layer LLWU Peripheral Access Layer - * @{ - */ - -/** LLWU - Register Layout Typedef */ -typedef struct { - __IO uint8_t PE1; /**< LLWU Pin Enable 1 register, offset: 0x0 */ - __IO uint8_t PE2; /**< LLWU Pin Enable 2 register, offset: 0x1 */ - __IO uint8_t PE3; /**< LLWU Pin Enable 3 register, offset: 0x2 */ - __IO uint8_t PE4; /**< LLWU Pin Enable 4 register, offset: 0x3 */ - __IO uint8_t ME; /**< LLWU Module Enable register, offset: 0x4 */ - __IO uint8_t F1; /**< LLWU Flag 1 register, offset: 0x5 */ - __IO uint8_t F2; /**< LLWU Flag 2 register, offset: 0x6 */ - __I uint8_t F3; /**< LLWU Flag 3 register, offset: 0x7 */ - __IO uint8_t FILT1; /**< LLWU Pin Filter 1 register, offset: 0x8 */ - __IO uint8_t FILT2; /**< LLWU Pin Filter 2 register, offset: 0x9 */ -} LLWU_Type; - -/* ---------------------------------------------------------------------------- - -- LLWU Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LLWU_Register_Masks LLWU Register Masks - * @{ - */ - -/*! @name PE1 - LLWU Pin Enable 1 register */ -/*! @{ */ - -#define LLWU_PE1_WUPE0_MASK (0x3U) -#define LLWU_PE1_WUPE0_SHIFT (0U) -/*! WUPE0 - Wakeup Pin Enable For LLWU_P0 - * 0b00..External input pin disabled as wakeup input - * 0b01..External input pin enabled with rising edge detection - * 0b10..External input pin enabled with falling edge detection - * 0b11..External input pin enabled with any change detection - */ -#define LLWU_PE1_WUPE0(x) (((uint8_t)(((uint8_t)(x)) << LLWU_PE1_WUPE0_SHIFT)) & LLWU_PE1_WUPE0_MASK) - -#define LLWU_PE1_WUPE1_MASK (0xCU) -#define LLWU_PE1_WUPE1_SHIFT (2U) -/*! WUPE1 - Wakeup Pin Enable For LLWU_P1 - * 0b00..External input pin disabled as wakeup input - * 0b01..External input pin enabled with rising edge detection - * 0b10..External input pin enabled with falling edge detection - * 0b11..External input pin enabled with any change detection - */ -#define LLWU_PE1_WUPE1(x) (((uint8_t)(((uint8_t)(x)) << LLWU_PE1_WUPE1_SHIFT)) & LLWU_PE1_WUPE1_MASK) - -#define LLWU_PE1_WUPE2_MASK (0x30U) -#define LLWU_PE1_WUPE2_SHIFT (4U) -/*! WUPE2 - Wakeup Pin Enable For LLWU_P2 - * 0b00..External input pin disabled as wakeup input - * 0b01..External input pin enabled with rising edge detection - * 0b10..External input pin enabled with falling edge detection - * 0b11..External input pin enabled with any change detection - */ -#define LLWU_PE1_WUPE2(x) (((uint8_t)(((uint8_t)(x)) << LLWU_PE1_WUPE2_SHIFT)) & LLWU_PE1_WUPE2_MASK) - -#define LLWU_PE1_WUPE3_MASK (0xC0U) -#define LLWU_PE1_WUPE3_SHIFT (6U) -/*! WUPE3 - Wakeup Pin Enable For LLWU_P3 - * 0b00..External input pin disabled as wakeup input - * 0b01..External input pin enabled with rising edge detection - * 0b10..External input pin enabled with falling edge detection - * 0b11..External input pin enabled with any change detection - */ -#define LLWU_PE1_WUPE3(x) (((uint8_t)(((uint8_t)(x)) << LLWU_PE1_WUPE3_SHIFT)) & LLWU_PE1_WUPE3_MASK) -/*! @} */ - -/*! @name PE2 - LLWU Pin Enable 2 register */ -/*! @{ */ - -#define LLWU_PE2_WUPE4_MASK (0x3U) -#define LLWU_PE2_WUPE4_SHIFT (0U) -/*! WUPE4 - Wakeup Pin Enable For LLWU_P4 - * 0b00..External input pin disabled as wakeup input - * 0b01..External input pin enabled with rising edge detection - * 0b10..External input pin enabled with falling edge detection - * 0b11..External input pin enabled with any change detection - */ -#define LLWU_PE2_WUPE4(x) (((uint8_t)(((uint8_t)(x)) << LLWU_PE2_WUPE4_SHIFT)) & LLWU_PE2_WUPE4_MASK) - -#define LLWU_PE2_WUPE5_MASK (0xCU) -#define LLWU_PE2_WUPE5_SHIFT (2U) -/*! WUPE5 - Wakeup Pin Enable For LLWU_P5 - * 0b00..External input pin disabled as wakeup input - * 0b01..External input pin enabled with rising edge detection - * 0b10..External input pin enabled with falling edge detection - * 0b11..External input pin enabled with any change detection - */ -#define LLWU_PE2_WUPE5(x) (((uint8_t)(((uint8_t)(x)) << LLWU_PE2_WUPE5_SHIFT)) & LLWU_PE2_WUPE5_MASK) - -#define LLWU_PE2_WUPE6_MASK (0x30U) -#define LLWU_PE2_WUPE6_SHIFT (4U) -/*! WUPE6 - Wakeup Pin Enable For LLWU_P6 - * 0b00..External input pin disabled as wakeup input - * 0b01..External input pin enabled with rising edge detection - * 0b10..External input pin enabled with falling edge detection - * 0b11..External input pin enabled with any change detection - */ -#define LLWU_PE2_WUPE6(x) (((uint8_t)(((uint8_t)(x)) << LLWU_PE2_WUPE6_SHIFT)) & LLWU_PE2_WUPE6_MASK) - -#define LLWU_PE2_WUPE7_MASK (0xC0U) -#define LLWU_PE2_WUPE7_SHIFT (6U) -/*! WUPE7 - Wakeup Pin Enable For LLWU_P7 - * 0b00..External input pin disabled as wakeup input - * 0b01..External input pin enabled with rising edge detection - * 0b10..External input pin enabled with falling edge detection - * 0b11..External input pin enabled with any change detection - */ -#define LLWU_PE2_WUPE7(x) (((uint8_t)(((uint8_t)(x)) << LLWU_PE2_WUPE7_SHIFT)) & LLWU_PE2_WUPE7_MASK) -/*! @} */ - -/*! @name PE3 - LLWU Pin Enable 3 register */ -/*! @{ */ - -#define LLWU_PE3_WUPE8_MASK (0x3U) -#define LLWU_PE3_WUPE8_SHIFT (0U) -/*! WUPE8 - Wakeup Pin Enable For LLWU_P8 - * 0b00..External input pin disabled as wakeup input - * 0b01..External input pin enabled with rising edge detection - * 0b10..External input pin enabled with falling edge detection - * 0b11..External input pin enabled with any change detection - */ -#define LLWU_PE3_WUPE8(x) (((uint8_t)(((uint8_t)(x)) << LLWU_PE3_WUPE8_SHIFT)) & LLWU_PE3_WUPE8_MASK) - -#define LLWU_PE3_WUPE9_MASK (0xCU) -#define LLWU_PE3_WUPE9_SHIFT (2U) -/*! WUPE9 - Wakeup Pin Enable For LLWU_P9 - * 0b00..External input pin disabled as wakeup input - * 0b01..External input pin enabled with rising edge detection - * 0b10..External input pin enabled with falling edge detection - * 0b11..External input pin enabled with any change detection - */ -#define LLWU_PE3_WUPE9(x) (((uint8_t)(((uint8_t)(x)) << LLWU_PE3_WUPE9_SHIFT)) & LLWU_PE3_WUPE9_MASK) - -#define LLWU_PE3_WUPE10_MASK (0x30U) -#define LLWU_PE3_WUPE10_SHIFT (4U) -/*! WUPE10 - Wakeup Pin Enable For LLWU_P10 - * 0b00..External input pin disabled as wakeup input - * 0b01..External input pin enabled with rising edge detection - * 0b10..External input pin enabled with falling edge detection - * 0b11..External input pin enabled with any change detection - */ -#define LLWU_PE3_WUPE10(x) (((uint8_t)(((uint8_t)(x)) << LLWU_PE3_WUPE10_SHIFT)) & LLWU_PE3_WUPE10_MASK) - -#define LLWU_PE3_WUPE11_MASK (0xC0U) -#define LLWU_PE3_WUPE11_SHIFT (6U) -/*! WUPE11 - Wakeup Pin Enable For LLWU_P11 - * 0b00..External input pin disabled as wakeup input - * 0b01..External input pin enabled with rising edge detection - * 0b10..External input pin enabled with falling edge detection - * 0b11..External input pin enabled with any change detection - */ -#define LLWU_PE3_WUPE11(x) (((uint8_t)(((uint8_t)(x)) << LLWU_PE3_WUPE11_SHIFT)) & LLWU_PE3_WUPE11_MASK) -/*! @} */ - -/*! @name PE4 - LLWU Pin Enable 4 register */ -/*! @{ */ - -#define LLWU_PE4_WUPE12_MASK (0x3U) -#define LLWU_PE4_WUPE12_SHIFT (0U) -/*! WUPE12 - Wakeup Pin Enable For LLWU_P12 - * 0b00..External input pin disabled as wakeup input - * 0b01..External input pin enabled with rising edge detection - * 0b10..External input pin enabled with falling edge detection - * 0b11..External input pin enabled with any change detection - */ -#define LLWU_PE4_WUPE12(x) (((uint8_t)(((uint8_t)(x)) << LLWU_PE4_WUPE12_SHIFT)) & LLWU_PE4_WUPE12_MASK) - -#define LLWU_PE4_WUPE13_MASK (0xCU) -#define LLWU_PE4_WUPE13_SHIFT (2U) -/*! WUPE13 - Wakeup Pin Enable For LLWU_P13 - * 0b00..External input pin disabled as wakeup input - * 0b01..External input pin enabled with rising edge detection - * 0b10..External input pin enabled with falling edge detection - * 0b11..External input pin enabled with any change detection - */ -#define LLWU_PE4_WUPE13(x) (((uint8_t)(((uint8_t)(x)) << LLWU_PE4_WUPE13_SHIFT)) & LLWU_PE4_WUPE13_MASK) - -#define LLWU_PE4_WUPE14_MASK (0x30U) -#define LLWU_PE4_WUPE14_SHIFT (4U) -/*! WUPE14 - Wakeup Pin Enable For LLWU_P14 - * 0b00..External input pin disabled as wakeup input - * 0b01..External input pin enabled with rising edge detection - * 0b10..External input pin enabled with falling edge detection - * 0b11..External input pin enabled with any change detection - */ -#define LLWU_PE4_WUPE14(x) (((uint8_t)(((uint8_t)(x)) << LLWU_PE4_WUPE14_SHIFT)) & LLWU_PE4_WUPE14_MASK) - -#define LLWU_PE4_WUPE15_MASK (0xC0U) -#define LLWU_PE4_WUPE15_SHIFT (6U) -/*! WUPE15 - Wakeup Pin Enable For LLWU_P15 - * 0b00..External input pin disabled as wakeup input - * 0b01..External input pin enabled with rising edge detection - * 0b10..External input pin enabled with falling edge detection - * 0b11..External input pin enabled with any change detection - */ -#define LLWU_PE4_WUPE15(x) (((uint8_t)(((uint8_t)(x)) << LLWU_PE4_WUPE15_SHIFT)) & LLWU_PE4_WUPE15_MASK) -/*! @} */ - -/*! @name ME - LLWU Module Enable register */ -/*! @{ */ - -#define LLWU_ME_WUME0_MASK (0x1U) -#define LLWU_ME_WUME0_SHIFT (0U) -/*! WUME0 - Wakeup Module Enable For Module 0 - * 0b0..Internal module flag not used as wakeup source - * 0b1..Internal module flag used as wakeup source - */ -#define LLWU_ME_WUME0(x) (((uint8_t)(((uint8_t)(x)) << LLWU_ME_WUME0_SHIFT)) & LLWU_ME_WUME0_MASK) - -#define LLWU_ME_WUME1_MASK (0x2U) -#define LLWU_ME_WUME1_SHIFT (1U) -/*! WUME1 - Wakeup Module Enable for Module 1 - * 0b0..Internal module flag not used as wakeup source - * 0b1..Internal module flag used as wakeup source - */ -#define LLWU_ME_WUME1(x) (((uint8_t)(((uint8_t)(x)) << LLWU_ME_WUME1_SHIFT)) & LLWU_ME_WUME1_MASK) - -#define LLWU_ME_WUME2_MASK (0x4U) -#define LLWU_ME_WUME2_SHIFT (2U) -/*! WUME2 - Wakeup Module Enable For Module 2 - * 0b0..Internal module flag not used as wakeup source - * 0b1..Internal module flag used as wakeup source - */ -#define LLWU_ME_WUME2(x) (((uint8_t)(((uint8_t)(x)) << LLWU_ME_WUME2_SHIFT)) & LLWU_ME_WUME2_MASK) - -#define LLWU_ME_WUME3_MASK (0x8U) -#define LLWU_ME_WUME3_SHIFT (3U) -/*! WUME3 - Wakeup Module Enable For Module 3 - * 0b0..Internal module flag not used as wakeup source - * 0b1..Internal module flag used as wakeup source - */ -#define LLWU_ME_WUME3(x) (((uint8_t)(((uint8_t)(x)) << LLWU_ME_WUME3_SHIFT)) & LLWU_ME_WUME3_MASK) - -#define LLWU_ME_WUME4_MASK (0x10U) -#define LLWU_ME_WUME4_SHIFT (4U) -/*! WUME4 - Wakeup Module Enable For Module 4 - * 0b0..Internal module flag not used as wakeup source - * 0b1..Internal module flag used as wakeup source - */ -#define LLWU_ME_WUME4(x) (((uint8_t)(((uint8_t)(x)) << LLWU_ME_WUME4_SHIFT)) & LLWU_ME_WUME4_MASK) - -#define LLWU_ME_WUME5_MASK (0x20U) -#define LLWU_ME_WUME5_SHIFT (5U) -/*! WUME5 - Wakeup Module Enable For Module 5 - * 0b0..Internal module flag not used as wakeup source - * 0b1..Internal module flag used as wakeup source - */ -#define LLWU_ME_WUME5(x) (((uint8_t)(((uint8_t)(x)) << LLWU_ME_WUME5_SHIFT)) & LLWU_ME_WUME5_MASK) - -#define LLWU_ME_WUME6_MASK (0x40U) -#define LLWU_ME_WUME6_SHIFT (6U) -/*! WUME6 - Wakeup Module Enable For Module 6 - * 0b0..Internal module flag not used as wakeup source - * 0b1..Internal module flag used as wakeup source - */ -#define LLWU_ME_WUME6(x) (((uint8_t)(((uint8_t)(x)) << LLWU_ME_WUME6_SHIFT)) & LLWU_ME_WUME6_MASK) - -#define LLWU_ME_WUME7_MASK (0x80U) -#define LLWU_ME_WUME7_SHIFT (7U) -/*! WUME7 - Wakeup Module Enable For Module 7 - * 0b0..Internal module flag not used as wakeup source - * 0b1..Internal module flag used as wakeup source - */ -#define LLWU_ME_WUME7(x) (((uint8_t)(((uint8_t)(x)) << LLWU_ME_WUME7_SHIFT)) & LLWU_ME_WUME7_MASK) -/*! @} */ - -/*! @name F1 - LLWU Flag 1 register */ -/*! @{ */ - -#define LLWU_F1_WUF0_MASK (0x1U) -#define LLWU_F1_WUF0_SHIFT (0U) -/*! WUF0 - Wakeup Flag For LLWU_P0 - * 0b0..LLWU_P0 input was not a wakeup source - * 0b1..LLWU_P0 input was a wakeup source - */ -#define LLWU_F1_WUF0(x) (((uint8_t)(((uint8_t)(x)) << LLWU_F1_WUF0_SHIFT)) & LLWU_F1_WUF0_MASK) - -#define LLWU_F1_WUF1_MASK (0x2U) -#define LLWU_F1_WUF1_SHIFT (1U) -/*! WUF1 - Wakeup Flag For LLWU_P1 - * 0b0..LLWU_P1 input was not a wakeup source - * 0b1..LLWU_P1 input was a wakeup source - */ -#define LLWU_F1_WUF1(x) (((uint8_t)(((uint8_t)(x)) << LLWU_F1_WUF1_SHIFT)) & LLWU_F1_WUF1_MASK) - -#define LLWU_F1_WUF2_MASK (0x4U) -#define LLWU_F1_WUF2_SHIFT (2U) -/*! WUF2 - Wakeup Flag For LLWU_P2 - * 0b0..LLWU_P2 input was not a wakeup source - * 0b1..LLWU_P2 input was a wakeup source - */ -#define LLWU_F1_WUF2(x) (((uint8_t)(((uint8_t)(x)) << LLWU_F1_WUF2_SHIFT)) & LLWU_F1_WUF2_MASK) - -#define LLWU_F1_WUF3_MASK (0x8U) -#define LLWU_F1_WUF3_SHIFT (3U) -/*! WUF3 - Wakeup Flag For LLWU_P3 - * 0b0..LLWU_P3 input was not a wake-up source - * 0b1..LLWU_P3 input was a wake-up source - */ -#define LLWU_F1_WUF3(x) (((uint8_t)(((uint8_t)(x)) << LLWU_F1_WUF3_SHIFT)) & LLWU_F1_WUF3_MASK) - -#define LLWU_F1_WUF4_MASK (0x10U) -#define LLWU_F1_WUF4_SHIFT (4U) -/*! WUF4 - Wakeup Flag For LLWU_P4 - * 0b0..LLWU_P4 input was not a wakeup source - * 0b1..LLWU_P4 input was a wakeup source - */ -#define LLWU_F1_WUF4(x) (((uint8_t)(((uint8_t)(x)) << LLWU_F1_WUF4_SHIFT)) & LLWU_F1_WUF4_MASK) - -#define LLWU_F1_WUF5_MASK (0x20U) -#define LLWU_F1_WUF5_SHIFT (5U) -/*! WUF5 - Wakeup Flag For LLWU_P5 - * 0b0..LLWU_P5 input was not a wakeup source - * 0b1..LLWU_P5 input was a wakeup source - */ -#define LLWU_F1_WUF5(x) (((uint8_t)(((uint8_t)(x)) << LLWU_F1_WUF5_SHIFT)) & LLWU_F1_WUF5_MASK) - -#define LLWU_F1_WUF6_MASK (0x40U) -#define LLWU_F1_WUF6_SHIFT (6U) -/*! WUF6 - Wakeup Flag For LLWU_P6 - * 0b0..LLWU_P6 input was not a wakeup source - * 0b1..LLWU_P6 input was a wakeup source - */ -#define LLWU_F1_WUF6(x) (((uint8_t)(((uint8_t)(x)) << LLWU_F1_WUF6_SHIFT)) & LLWU_F1_WUF6_MASK) - -#define LLWU_F1_WUF7_MASK (0x80U) -#define LLWU_F1_WUF7_SHIFT (7U) -/*! WUF7 - Wakeup Flag For LLWU_P7 - * 0b0..LLWU_P7 input was not a wakeup source - * 0b1..LLWU_P7 input was a wakeup source - */ -#define LLWU_F1_WUF7(x) (((uint8_t)(((uint8_t)(x)) << LLWU_F1_WUF7_SHIFT)) & LLWU_F1_WUF7_MASK) -/*! @} */ - -/*! @name F2 - LLWU Flag 2 register */ -/*! @{ */ - -#define LLWU_F2_WUF8_MASK (0x1U) -#define LLWU_F2_WUF8_SHIFT (0U) -/*! WUF8 - Wakeup Flag For LLWU_P8 - * 0b0..LLWU_P8 input was not a wakeup source - * 0b1..LLWU_P8 input was a wakeup source - */ -#define LLWU_F2_WUF8(x) (((uint8_t)(((uint8_t)(x)) << LLWU_F2_WUF8_SHIFT)) & LLWU_F2_WUF8_MASK) - -#define LLWU_F2_WUF9_MASK (0x2U) -#define LLWU_F2_WUF9_SHIFT (1U) -/*! WUF9 - Wakeup Flag For LLWU_P9 - * 0b0..LLWU_P9 input was not a wakeup source - * 0b1..LLWU_P9 input was a wakeup source - */ -#define LLWU_F2_WUF9(x) (((uint8_t)(((uint8_t)(x)) << LLWU_F2_WUF9_SHIFT)) & LLWU_F2_WUF9_MASK) - -#define LLWU_F2_WUF10_MASK (0x4U) -#define LLWU_F2_WUF10_SHIFT (2U) -/*! WUF10 - Wakeup Flag For LLWU_P10 - * 0b0..LLWU_P10 input was not a wakeup source - * 0b1..LLWU_P10 input was a wakeup source - */ -#define LLWU_F2_WUF10(x) (((uint8_t)(((uint8_t)(x)) << LLWU_F2_WUF10_SHIFT)) & LLWU_F2_WUF10_MASK) - -#define LLWU_F2_WUF11_MASK (0x8U) -#define LLWU_F2_WUF11_SHIFT (3U) -/*! WUF11 - Wakeup Flag For LLWU_P11 - * 0b0..LLWU_P11 input was not a wakeup source - * 0b1..LLWU_P11 input was a wakeup source - */ -#define LLWU_F2_WUF11(x) (((uint8_t)(((uint8_t)(x)) << LLWU_F2_WUF11_SHIFT)) & LLWU_F2_WUF11_MASK) - -#define LLWU_F2_WUF12_MASK (0x10U) -#define LLWU_F2_WUF12_SHIFT (4U) -/*! WUF12 - Wakeup Flag For LLWU_P12 - * 0b0..LLWU_P12 input was not a wakeup source - * 0b1..LLWU_P12 input was a wakeup source - */ -#define LLWU_F2_WUF12(x) (((uint8_t)(((uint8_t)(x)) << LLWU_F2_WUF12_SHIFT)) & LLWU_F2_WUF12_MASK) - -#define LLWU_F2_WUF13_MASK (0x20U) -#define LLWU_F2_WUF13_SHIFT (5U) -/*! WUF13 - Wakeup Flag For LLWU_P13 - * 0b0..LLWU_P13 input was not a wakeup source - * 0b1..LLWU_P13 input was a wakeup source - */ -#define LLWU_F2_WUF13(x) (((uint8_t)(((uint8_t)(x)) << LLWU_F2_WUF13_SHIFT)) & LLWU_F2_WUF13_MASK) - -#define LLWU_F2_WUF14_MASK (0x40U) -#define LLWU_F2_WUF14_SHIFT (6U) -/*! WUF14 - Wakeup Flag For LLWU_P14 - * 0b0..LLWU_P14 input was not a wakeup source - * 0b1..LLWU_P14 input was a wakeup source - */ -#define LLWU_F2_WUF14(x) (((uint8_t)(((uint8_t)(x)) << LLWU_F2_WUF14_SHIFT)) & LLWU_F2_WUF14_MASK) - -#define LLWU_F2_WUF15_MASK (0x80U) -#define LLWU_F2_WUF15_SHIFT (7U) -/*! WUF15 - Wakeup Flag For LLWU_P15 - * 0b0..LLWU_P15 input was not a wakeup source - * 0b1..LLWU_P15 input was a wakeup source - */ -#define LLWU_F2_WUF15(x) (((uint8_t)(((uint8_t)(x)) << LLWU_F2_WUF15_SHIFT)) & LLWU_F2_WUF15_MASK) -/*! @} */ - -/*! @name F3 - LLWU Flag 3 register */ -/*! @{ */ - -#define LLWU_F3_MWUF0_MASK (0x1U) -#define LLWU_F3_MWUF0_SHIFT (0U) -/*! MWUF0 - Wakeup flag For module 0 - * 0b0..Module 0 input was not a wakeup source - * 0b1..Module 0 input was a wakeup source - */ -#define LLWU_F3_MWUF0(x) (((uint8_t)(((uint8_t)(x)) << LLWU_F3_MWUF0_SHIFT)) & LLWU_F3_MWUF0_MASK) - -#define LLWU_F3_MWUF1_MASK (0x2U) -#define LLWU_F3_MWUF1_SHIFT (1U) -/*! MWUF1 - Wakeup flag For module 1 - * 0b0..Module 1 input was not a wakeup source - * 0b1..Module 1 input was a wakeup source - */ -#define LLWU_F3_MWUF1(x) (((uint8_t)(((uint8_t)(x)) << LLWU_F3_MWUF1_SHIFT)) & LLWU_F3_MWUF1_MASK) - -#define LLWU_F3_MWUF2_MASK (0x4U) -#define LLWU_F3_MWUF2_SHIFT (2U) -/*! MWUF2 - Wakeup flag For module 2 - * 0b0..Module 2 input was not a wakeup source - * 0b1..Module 2 input was a wakeup source - */ -#define LLWU_F3_MWUF2(x) (((uint8_t)(((uint8_t)(x)) << LLWU_F3_MWUF2_SHIFT)) & LLWU_F3_MWUF2_MASK) - -#define LLWU_F3_MWUF3_MASK (0x8U) -#define LLWU_F3_MWUF3_SHIFT (3U) -/*! MWUF3 - Wakeup flag For module 3 - * 0b0..Module 3 input was not a wakeup source - * 0b1..Module 3 input was a wakeup source - */ -#define LLWU_F3_MWUF3(x) (((uint8_t)(((uint8_t)(x)) << LLWU_F3_MWUF3_SHIFT)) & LLWU_F3_MWUF3_MASK) - -#define LLWU_F3_MWUF4_MASK (0x10U) -#define LLWU_F3_MWUF4_SHIFT (4U) -/*! MWUF4 - Wakeup flag For module 4 - * 0b0..Module 4 input was not a wakeup source - * 0b1..Module 4 input was a wakeup source - */ -#define LLWU_F3_MWUF4(x) (((uint8_t)(((uint8_t)(x)) << LLWU_F3_MWUF4_SHIFT)) & LLWU_F3_MWUF4_MASK) - -#define LLWU_F3_MWUF5_MASK (0x20U) -#define LLWU_F3_MWUF5_SHIFT (5U) -/*! MWUF5 - Wakeup flag For module 5 - * 0b0..Module 5 input was not a wakeup source - * 0b1..Module 5 input was a wakeup source - */ -#define LLWU_F3_MWUF5(x) (((uint8_t)(((uint8_t)(x)) << LLWU_F3_MWUF5_SHIFT)) & LLWU_F3_MWUF5_MASK) - -#define LLWU_F3_MWUF6_MASK (0x40U) -#define LLWU_F3_MWUF6_SHIFT (6U) -/*! MWUF6 - Wakeup flag For module 6 - * 0b0..Module 6 input was not a wakeup source - * 0b1..Module 6 input was a wakeup source - */ -#define LLWU_F3_MWUF6(x) (((uint8_t)(((uint8_t)(x)) << LLWU_F3_MWUF6_SHIFT)) & LLWU_F3_MWUF6_MASK) - -#define LLWU_F3_MWUF7_MASK (0x80U) -#define LLWU_F3_MWUF7_SHIFT (7U) -/*! MWUF7 - Wakeup flag For module 7 - * 0b0..Module 7 input was not a wakeup source - * 0b1..Module 7 input was a wakeup source - */ -#define LLWU_F3_MWUF7(x) (((uint8_t)(((uint8_t)(x)) << LLWU_F3_MWUF7_SHIFT)) & LLWU_F3_MWUF7_MASK) -/*! @} */ - -/*! @name FILT1 - LLWU Pin Filter 1 register */ -/*! @{ */ - -#define LLWU_FILT1_FILTSEL_MASK (0xFU) -#define LLWU_FILT1_FILTSEL_SHIFT (0U) -/*! FILTSEL - Filter Pin Select - * 0b0000..Select LLWU_P0 for filter - * 0b1111..Select LLWU_P15 for filter - */ -#define LLWU_FILT1_FILTSEL(x) (((uint8_t)(((uint8_t)(x)) << LLWU_FILT1_FILTSEL_SHIFT)) & LLWU_FILT1_FILTSEL_MASK) - -#define LLWU_FILT1_FILTE_MASK (0x60U) -#define LLWU_FILT1_FILTE_SHIFT (5U) -/*! FILTE - Digital Filter On External Pin - * 0b00..Filter disabled - * 0b01..Filter posedge detect enabled - * 0b10..Filter negedge detect enabled - * 0b11..Filter any edge detect enabled - */ -#define LLWU_FILT1_FILTE(x) (((uint8_t)(((uint8_t)(x)) << LLWU_FILT1_FILTE_SHIFT)) & LLWU_FILT1_FILTE_MASK) - -#define LLWU_FILT1_FILTF_MASK (0x80U) -#define LLWU_FILT1_FILTF_SHIFT (7U) -/*! FILTF - Filter Detect Flag - * 0b0..Pin Filter 1 was not a wakeup source - * 0b1..Pin Filter 1 was a wakeup source - */ -#define LLWU_FILT1_FILTF(x) (((uint8_t)(((uint8_t)(x)) << LLWU_FILT1_FILTF_SHIFT)) & LLWU_FILT1_FILTF_MASK) -/*! @} */ - -/*! @name FILT2 - LLWU Pin Filter 2 register */ -/*! @{ */ - -#define LLWU_FILT2_FILTSEL_MASK (0xFU) -#define LLWU_FILT2_FILTSEL_SHIFT (0U) -/*! FILTSEL - Filter Pin Select - * 0b0000..Select LLWU_P0 for filter - * 0b1111..Select LLWU_P15 for filter - */ -#define LLWU_FILT2_FILTSEL(x) (((uint8_t)(((uint8_t)(x)) << LLWU_FILT2_FILTSEL_SHIFT)) & LLWU_FILT2_FILTSEL_MASK) - -#define LLWU_FILT2_FILTE_MASK (0x60U) -#define LLWU_FILT2_FILTE_SHIFT (5U) -/*! FILTE - Digital Filter On External Pin - * 0b00..Filter disabled - * 0b01..Filter posedge detect enabled - * 0b10..Filter negedge detect enabled - * 0b11..Filter any edge detect enabled - */ -#define LLWU_FILT2_FILTE(x) (((uint8_t)(((uint8_t)(x)) << LLWU_FILT2_FILTE_SHIFT)) & LLWU_FILT2_FILTE_MASK) - -#define LLWU_FILT2_FILTF_MASK (0x80U) -#define LLWU_FILT2_FILTF_SHIFT (7U) -/*! FILTF - Filter Detect Flag - * 0b0..Pin Filter 2 was not a wakeup source - * 0b1..Pin Filter 2 was a wakeup source - */ -#define LLWU_FILT2_FILTF(x) (((uint8_t)(((uint8_t)(x)) << LLWU_FILT2_FILTF_SHIFT)) & LLWU_FILT2_FILTF_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group LLWU_Register_Masks */ - - -/* LLWU - Peripheral instance base addresses */ -/** Peripheral LLWU base address */ -#define LLWU_BASE (0x4007C000u) -/** Peripheral LLWU base pointer */ -#define LLWU ((LLWU_Type *)LLWU_BASE) -/** Array initializer of LLWU peripheral base addresses */ -#define LLWU_BASE_ADDRS { LLWU_BASE } -/** Array initializer of LLWU peripheral base pointers */ -#define LLWU_BASE_PTRS { LLWU } -/** Interrupt vectors for the LLWU peripheral type */ -#define LLWU_IRQS { LLWU_IRQn } - -/*! - * @} - */ /* end of group LLWU_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LPTMR Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPTMR_Peripheral_Access_Layer LPTMR Peripheral Access Layer - * @{ - */ - -/** LPTMR - Register Layout Typedef */ -typedef struct { - __IO uint32_t CSR; /**< Low Power Timer Control Status Register, offset: 0x0 */ - __IO uint32_t PSR; /**< Low Power Timer Prescale Register, offset: 0x4 */ - __IO uint32_t CMR; /**< Low Power Timer Compare Register, offset: 0x8 */ - __IO uint32_t CNR; /**< Low Power Timer Counter Register, offset: 0xC */ -} LPTMR_Type; - -/* ---------------------------------------------------------------------------- - -- LPTMR Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPTMR_Register_Masks LPTMR Register Masks - * @{ - */ - -/*! @name CSR - Low Power Timer Control Status Register */ -/*! @{ */ - -#define LPTMR_CSR_TEN_MASK (0x1U) -#define LPTMR_CSR_TEN_SHIFT (0U) -/*! TEN - Timer Enable - * 0b0..LPTMR is disabled and internal logic is reset. - * 0b1..LPTMR is enabled. - */ -#define LPTMR_CSR_TEN(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TEN_SHIFT)) & LPTMR_CSR_TEN_MASK) - -#define LPTMR_CSR_TMS_MASK (0x2U) -#define LPTMR_CSR_TMS_SHIFT (1U) -/*! TMS - Timer Mode Select - * 0b0..Time Counter mode. - * 0b1..Pulse Counter mode. - */ -#define LPTMR_CSR_TMS(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TMS_SHIFT)) & LPTMR_CSR_TMS_MASK) - -#define LPTMR_CSR_TFC_MASK (0x4U) -#define LPTMR_CSR_TFC_SHIFT (2U) -/*! TFC - Timer Free-Running Counter - * 0b0..CNR is reset whenever TCF is set. - * 0b1..CNR is reset on overflow. - */ -#define LPTMR_CSR_TFC(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TFC_SHIFT)) & LPTMR_CSR_TFC_MASK) - -#define LPTMR_CSR_TPP_MASK (0x8U) -#define LPTMR_CSR_TPP_SHIFT (3U) -/*! TPP - Timer Pin Polarity - * 0b0..Pulse Counter input source is active-high, and the CNR will increment on the rising-edge. - * 0b1..Pulse Counter input source is active-low, and the CNR will increment on the falling-edge. - */ -#define LPTMR_CSR_TPP(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TPP_SHIFT)) & LPTMR_CSR_TPP_MASK) - -#define LPTMR_CSR_TPS_MASK (0x30U) -#define LPTMR_CSR_TPS_SHIFT (4U) -/*! TPS - Timer Pin Select - * 0b00..Pulse counter input 0 is selected. - * 0b01..Pulse counter input 1 is selected. - * 0b10..Pulse counter input 2 is selected. - * 0b11..Pulse counter input 3 is selected. - */ -#define LPTMR_CSR_TPS(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TPS_SHIFT)) & LPTMR_CSR_TPS_MASK) - -#define LPTMR_CSR_TIE_MASK (0x40U) -#define LPTMR_CSR_TIE_SHIFT (6U) -/*! TIE - Timer Interrupt Enable - * 0b0..Timer interrupt disabled. - * 0b1..Timer interrupt enabled. - */ -#define LPTMR_CSR_TIE(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TIE_SHIFT)) & LPTMR_CSR_TIE_MASK) - -#define LPTMR_CSR_TCF_MASK (0x80U) -#define LPTMR_CSR_TCF_SHIFT (7U) -/*! TCF - Timer Compare Flag - * 0b0..The value of CNR is not equal to CMR and increments. - * 0b1..The value of CNR is equal to CMR and increments. - */ -#define LPTMR_CSR_TCF(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TCF_SHIFT)) & LPTMR_CSR_TCF_MASK) -/*! @} */ - -/*! @name PSR - Low Power Timer Prescale Register */ -/*! @{ */ - -#define LPTMR_PSR_PCS_MASK (0x3U) -#define LPTMR_PSR_PCS_SHIFT (0U) -/*! PCS - Prescaler Clock Select - * 0b00..Prescaler/glitch filter clock 0 selected. - * 0b01..Prescaler/glitch filter clock 1 selected. - * 0b10..Prescaler/glitch filter clock 2 selected. - * 0b11..Prescaler/glitch filter clock 3 selected. - */ -#define LPTMR_PSR_PCS(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_PSR_PCS_SHIFT)) & LPTMR_PSR_PCS_MASK) - -#define LPTMR_PSR_PBYP_MASK (0x4U) -#define LPTMR_PSR_PBYP_SHIFT (2U) -/*! PBYP - Prescaler Bypass - * 0b0..Prescaler/glitch filter is enabled. - * 0b1..Prescaler/glitch filter is bypassed. - */ -#define LPTMR_PSR_PBYP(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_PSR_PBYP_SHIFT)) & LPTMR_PSR_PBYP_MASK) - -#define LPTMR_PSR_PRESCALE_MASK (0x78U) -#define LPTMR_PSR_PRESCALE_SHIFT (3U) -/*! PRESCALE - Prescale Value - * 0b0000..Prescaler divides the prescaler clock by 2; glitch filter does not support this configuration. - * 0b0001..Prescaler divides the prescaler clock by 4; glitch filter recognizes change on input pin after 2 rising clock edges. - * 0b0010..Prescaler divides the prescaler clock by 8; glitch filter recognizes change on input pin after 4 rising clock edges. - * 0b0011..Prescaler divides the prescaler clock by 16; glitch filter recognizes change on input pin after 8 rising clock edges. - * 0b0100..Prescaler divides the prescaler clock by 32; glitch filter recognizes change on input pin after 16 rising clock edges. - * 0b0101..Prescaler divides the prescaler clock by 64; glitch filter recognizes change on input pin after 32 rising clock edges. - * 0b0110..Prescaler divides the prescaler clock by 128; glitch filter recognizes change on input pin after 64 rising clock edges. - * 0b0111..Prescaler divides the prescaler clock by 256; glitch filter recognizes change on input pin after 128 rising clock edges. - * 0b1000..Prescaler divides the prescaler clock by 512; glitch filter recognizes change on input pin after 256 rising clock edges. - * 0b1001..Prescaler divides the prescaler clock by 1024; glitch filter recognizes change on input pin after 512 rising clock edges. - * 0b1010..Prescaler divides the prescaler clock by 2048; glitch filter recognizes change on input pin after 1024 rising clock edges. - * 0b1011..Prescaler divides the prescaler clock by 4096; glitch filter recognizes change on input pin after 2048 rising clock edges. - * 0b1100..Prescaler divides the prescaler clock by 8192; glitch filter recognizes change on input pin after 4096 rising clock edges. - * 0b1101..Prescaler divides the prescaler clock by 16,384; glitch filter recognizes change on input pin after 8192 rising clock edges. - * 0b1110..Prescaler divides the prescaler clock by 32,768; glitch filter recognizes change on input pin after 16,384 rising clock edges. - * 0b1111..Prescaler divides the prescaler clock by 65,536; glitch filter recognizes change on input pin after 32,768 rising clock edges. - */ -#define LPTMR_PSR_PRESCALE(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_PSR_PRESCALE_SHIFT)) & LPTMR_PSR_PRESCALE_MASK) -/*! @} */ - -/*! @name CMR - Low Power Timer Compare Register */ -/*! @{ */ - -#define LPTMR_CMR_COMPARE_MASK (0xFFFFU) -#define LPTMR_CMR_COMPARE_SHIFT (0U) -/*! COMPARE - Compare Value */ -#define LPTMR_CMR_COMPARE(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CMR_COMPARE_SHIFT)) & LPTMR_CMR_COMPARE_MASK) -/*! @} */ - -/*! @name CNR - Low Power Timer Counter Register */ -/*! @{ */ - -#define LPTMR_CNR_COUNTER_MASK (0xFFFFU) -#define LPTMR_CNR_COUNTER_SHIFT (0U) -/*! COUNTER - Counter Value */ -#define LPTMR_CNR_COUNTER(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CNR_COUNTER_SHIFT)) & LPTMR_CNR_COUNTER_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group LPTMR_Register_Masks */ - - -/* LPTMR - Peripheral instance base addresses */ -/** Peripheral LPTMR0 base address */ -#define LPTMR0_BASE (0x40040000u) -/** Peripheral LPTMR0 base pointer */ -#define LPTMR0 ((LPTMR_Type *)LPTMR0_BASE) -/** Array initializer of LPTMR peripheral base addresses */ -#define LPTMR_BASE_ADDRS { LPTMR0_BASE } -/** Array initializer of LPTMR peripheral base pointers */ -#define LPTMR_BASE_PTRS { LPTMR0 } -/** Interrupt vectors for the LPTMR peripheral type */ -#define LPTMR_IRQS { LPTMR0_IRQn } - -/*! - * @} - */ /* end of group LPTMR_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LPUART Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPUART_Peripheral_Access_Layer LPUART Peripheral Access Layer - * @{ - */ - -/** LPUART - Register Layout Typedef */ -typedef struct { - __IO uint32_t BAUD; /**< LPUART Baud Rate Register, offset: 0x0 */ - __IO uint32_t STAT; /**< LPUART Status Register, offset: 0x4 */ - __IO uint32_t CTRL; /**< LPUART Control Register, offset: 0x8 */ - __IO uint32_t DATA; /**< LPUART Data Register, offset: 0xC */ - __IO uint32_t MATCH; /**< LPUART Match Address Register, offset: 0x10 */ -} LPUART_Type; - -/* ---------------------------------------------------------------------------- - -- LPUART Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPUART_Register_Masks LPUART Register Masks - * @{ - */ - -/*! @name BAUD - LPUART Baud Rate Register */ -/*! @{ */ - -#define LPUART_BAUD_SBR_MASK (0x1FFFU) -#define LPUART_BAUD_SBR_SHIFT (0U) -/*! SBR - Baud Rate Modulo Divisor. */ -#define LPUART_BAUD_SBR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_SBR_SHIFT)) & LPUART_BAUD_SBR_MASK) - -#define LPUART_BAUD_SBNS_MASK (0x2000U) -#define LPUART_BAUD_SBNS_SHIFT (13U) -/*! SBNS - Stop Bit Number Select - * 0b0..One stop bit. - * 0b1..Two stop bits. - */ -#define LPUART_BAUD_SBNS(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_SBNS_SHIFT)) & LPUART_BAUD_SBNS_MASK) - -#define LPUART_BAUD_RXEDGIE_MASK (0x4000U) -#define LPUART_BAUD_RXEDGIE_SHIFT (14U) -/*! RXEDGIE - RX Input Active Edge Interrupt Enable - * 0b0..Hardware interrupts from LPUART_STAT[RXEDGIF] disabled (use polling). - * 0b1..Hardware interrupt requested when LPUART_STAT[RXEDGIF] flag is 1. - */ -#define LPUART_BAUD_RXEDGIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_RXEDGIE_SHIFT)) & LPUART_BAUD_RXEDGIE_MASK) - -#define LPUART_BAUD_LBKDIE_MASK (0x8000U) -#define LPUART_BAUD_LBKDIE_SHIFT (15U) -/*! LBKDIE - LIN Break Detect Interrupt Enable - * 0b0..Hardware interrupts from LPUART_STAT[LBKDIF] disabled (use polling). - * 0b1..Hardware interrupt requested when LPUART_STAT[LBKDIF] flag is 1. - */ -#define LPUART_BAUD_LBKDIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_LBKDIE_SHIFT)) & LPUART_BAUD_LBKDIE_MASK) - -#define LPUART_BAUD_RESYNCDIS_MASK (0x10000U) -#define LPUART_BAUD_RESYNCDIS_SHIFT (16U) -/*! RESYNCDIS - Resynchronization Disable - * 0b0..Resynchronization during received data word is supported - * 0b1..Resynchronization during received data word is disabled - */ -#define LPUART_BAUD_RESYNCDIS(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_RESYNCDIS_SHIFT)) & LPUART_BAUD_RESYNCDIS_MASK) - -#define LPUART_BAUD_BOTHEDGE_MASK (0x20000U) -#define LPUART_BAUD_BOTHEDGE_SHIFT (17U) -/*! BOTHEDGE - Both Edge Sampling - * 0b0..Receiver samples input data using the rising edge of the baud rate clock. - * 0b1..Receiver samples input data using the rising and falling edge of the baud rate clock. - */ -#define LPUART_BAUD_BOTHEDGE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_BOTHEDGE_SHIFT)) & LPUART_BAUD_BOTHEDGE_MASK) - -#define LPUART_BAUD_MATCFG_MASK (0xC0000U) -#define LPUART_BAUD_MATCFG_SHIFT (18U) -/*! MATCFG - Match Configuration - * 0b00..Address Match Wakeup - * 0b01..Idle Match Wakeup - * 0b10..Match On and Match Off - * 0b11..Enables RWU on Data Match and Match On/Off for transmitter CTS input - */ -#define LPUART_BAUD_MATCFG(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_MATCFG_SHIFT)) & LPUART_BAUD_MATCFG_MASK) - -#define LPUART_BAUD_RDMAE_MASK (0x200000U) -#define LPUART_BAUD_RDMAE_SHIFT (21U) -/*! RDMAE - Receiver Full DMA Enable - * 0b0..DMA request disabled. - * 0b1..DMA request enabled. - */ -#define LPUART_BAUD_RDMAE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_RDMAE_SHIFT)) & LPUART_BAUD_RDMAE_MASK) - -#define LPUART_BAUD_TDMAE_MASK (0x800000U) -#define LPUART_BAUD_TDMAE_SHIFT (23U) -/*! TDMAE - Transmitter DMA Enable - * 0b0..DMA request disabled. - * 0b1..DMA request enabled. - */ -#define LPUART_BAUD_TDMAE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_TDMAE_SHIFT)) & LPUART_BAUD_TDMAE_MASK) - -#define LPUART_BAUD_OSR_MASK (0x1F000000U) -#define LPUART_BAUD_OSR_SHIFT (24U) -/*! OSR - Over Sampling Ratio */ -#define LPUART_BAUD_OSR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_OSR_SHIFT)) & LPUART_BAUD_OSR_MASK) - -#define LPUART_BAUD_M10_MASK (0x20000000U) -#define LPUART_BAUD_M10_SHIFT (29U) -/*! M10 - 10-bit Mode select - * 0b0..Receiver and transmitter use 8-bit or 9-bit data characters. - * 0b1..Receiver and transmitter use 10-bit data characters. - */ -#define LPUART_BAUD_M10(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_M10_SHIFT)) & LPUART_BAUD_M10_MASK) - -#define LPUART_BAUD_MAEN2_MASK (0x40000000U) -#define LPUART_BAUD_MAEN2_SHIFT (30U) -/*! MAEN2 - Match Address Mode Enable 2 - * 0b0..Normal operation. - * 0b1..Enables automatic address matching or data matching mode for MATCH[MA2]. - */ -#define LPUART_BAUD_MAEN2(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_MAEN2_SHIFT)) & LPUART_BAUD_MAEN2_MASK) - -#define LPUART_BAUD_MAEN1_MASK (0x80000000U) -#define LPUART_BAUD_MAEN1_SHIFT (31U) -/*! MAEN1 - Match Address Mode Enable 1 - * 0b0..Normal operation. - * 0b1..Enables automatic address matching or data matching mode for MATCH[MA1]. - */ -#define LPUART_BAUD_MAEN1(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_MAEN1_SHIFT)) & LPUART_BAUD_MAEN1_MASK) -/*! @} */ - -/*! @name STAT - LPUART Status Register */ -/*! @{ */ - -#define LPUART_STAT_MA2F_MASK (0x4000U) -#define LPUART_STAT_MA2F_SHIFT (14U) -/*! MA2F - Match 2 Flag - * 0b0..Received data is not equal to MA2 - * 0b1..Received data is equal to MA2 - */ -#define LPUART_STAT_MA2F(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_MA2F_SHIFT)) & LPUART_STAT_MA2F_MASK) - -#define LPUART_STAT_MA1F_MASK (0x8000U) -#define LPUART_STAT_MA1F_SHIFT (15U) -/*! MA1F - Match 1 Flag - * 0b0..Received data is not equal to MA1 - * 0b1..Received data is equal to MA1 - */ -#define LPUART_STAT_MA1F(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_MA1F_SHIFT)) & LPUART_STAT_MA1F_MASK) - -#define LPUART_STAT_PF_MASK (0x10000U) -#define LPUART_STAT_PF_SHIFT (16U) -/*! PF - Parity Error Flag - * 0b0..No parity error. - * 0b1..Parity error. - */ -#define LPUART_STAT_PF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_PF_SHIFT)) & LPUART_STAT_PF_MASK) - -#define LPUART_STAT_FE_MASK (0x20000U) -#define LPUART_STAT_FE_SHIFT (17U) -/*! FE - Framing Error Flag - * 0b0..No framing error detected. This does not guarantee the framing is correct. - * 0b1..Framing error. - */ -#define LPUART_STAT_FE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_FE_SHIFT)) & LPUART_STAT_FE_MASK) - -#define LPUART_STAT_NF_MASK (0x40000U) -#define LPUART_STAT_NF_SHIFT (18U) -/*! NF - Noise Flag - * 0b0..No noise detected. - * 0b1..Noise detected in the received character in LPUART_DATA. - */ -#define LPUART_STAT_NF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_NF_SHIFT)) & LPUART_STAT_NF_MASK) - -#define LPUART_STAT_OR_MASK (0x80000U) -#define LPUART_STAT_OR_SHIFT (19U) -/*! OR - Receiver Overrun Flag - * 0b0..No overrun. - * 0b1..Receive overrun (new LPUART data lost). - */ -#define LPUART_STAT_OR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_OR_SHIFT)) & LPUART_STAT_OR_MASK) - -#define LPUART_STAT_IDLE_MASK (0x100000U) -#define LPUART_STAT_IDLE_SHIFT (20U) -/*! IDLE - Idle Line Flag - * 0b0..No idle line detected. - * 0b1..Idle line was detected. - */ -#define LPUART_STAT_IDLE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_IDLE_SHIFT)) & LPUART_STAT_IDLE_MASK) - -#define LPUART_STAT_RDRF_MASK (0x200000U) -#define LPUART_STAT_RDRF_SHIFT (21U) -/*! RDRF - Receive Data Register Full Flag - * 0b0..Receive data buffer empty. - * 0b1..Receive data buffer full. - */ -#define LPUART_STAT_RDRF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_RDRF_SHIFT)) & LPUART_STAT_RDRF_MASK) - -#define LPUART_STAT_TC_MASK (0x400000U) -#define LPUART_STAT_TC_SHIFT (22U) -/*! TC - Transmission Complete Flag - * 0b0..Transmitter active (sending data, a preamble, or a break). - * 0b1..Transmitter idle (transmission activity complete). - */ -#define LPUART_STAT_TC(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_TC_SHIFT)) & LPUART_STAT_TC_MASK) - -#define LPUART_STAT_TDRE_MASK (0x800000U) -#define LPUART_STAT_TDRE_SHIFT (23U) -/*! TDRE - Transmit Data Register Empty Flag - * 0b0..Transmit data buffer full. - * 0b1..Transmit data buffer empty. - */ -#define LPUART_STAT_TDRE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_TDRE_SHIFT)) & LPUART_STAT_TDRE_MASK) - -#define LPUART_STAT_RAF_MASK (0x1000000U) -#define LPUART_STAT_RAF_SHIFT (24U) -/*! RAF - Receiver Active Flag - * 0b0..LPUART receiver idle waiting for a start bit. - * 0b1..LPUART receiver active (LPUART_RX input not idle). - */ -#define LPUART_STAT_RAF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_RAF_SHIFT)) & LPUART_STAT_RAF_MASK) - -#define LPUART_STAT_LBKDE_MASK (0x2000000U) -#define LPUART_STAT_LBKDE_SHIFT (25U) -/*! LBKDE - LIN Break Detection Enable - * 0b0..Break character is detected at length 10 bit times (if M = 0, SBNS = 0) or 11 (if M = 1, SBNS = 0 or M = - * 0, SBNS = 1) or 12 (if M = 1, SBNS = 1 or M10 = 1, SNBS = 0) or 13 (if M10 = 1, SNBS = 1). - * 0b1..Break character is detected at length of 11 bit times (if M = 0, SBNS = 0) or 12 (if M = 1, SBNS = 0 or M - * = 0, SBNS = 1) or 14 (if M = 1, SBNS = 1 or M10 = 1, SNBS = 0) or 15 (if M10 = 1, SNBS = 1). - */ -#define LPUART_STAT_LBKDE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_LBKDE_SHIFT)) & LPUART_STAT_LBKDE_MASK) - -#define LPUART_STAT_BRK13_MASK (0x4000000U) -#define LPUART_STAT_BRK13_SHIFT (26U) -/*! BRK13 - Break Character Generation Length - * 0b0..Break character is transmitted with length of 10 bit times (if M = 0, SBNS = 0) or 11 (if M = 1, SBNS = 0 - * or M = 0, SBNS = 1) or 12 (if M = 1, SBNS = 1 or M10 = 1, SNBS = 0) or 13 (if M10 = 1, SNBS = 1). - * 0b1..Break character is transmitted with length of 13 bit times (if M = 0, SBNS = 0) or 14 (if M = 1, SBNS = 0 - * or M = 0, SBNS = 1) or 15 (if M = 1, SBNS = 1 or M10 = 1, SNBS = 0) or 16 (if M10 = 1, SNBS = 1). - */ -#define LPUART_STAT_BRK13(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_BRK13_SHIFT)) & LPUART_STAT_BRK13_MASK) - -#define LPUART_STAT_RWUID_MASK (0x8000000U) -#define LPUART_STAT_RWUID_SHIFT (27U) -/*! RWUID - Receive Wake Up Idle Detect - * 0b0..During receive standby state (RWU = 1), the IDLE bit does not get set upon detection of an idle - * character. During address match wakeup, the IDLE bit does not get set when an address does not match. - * 0b1..During receive standby state (RWU = 1), the IDLE bit gets set upon detection of an idle character. During - * address match wakeup, the IDLE bit does get set when an address does not match. - */ -#define LPUART_STAT_RWUID(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_RWUID_SHIFT)) & LPUART_STAT_RWUID_MASK) - -#define LPUART_STAT_RXINV_MASK (0x10000000U) -#define LPUART_STAT_RXINV_SHIFT (28U) -/*! RXINV - Receive Data Inversion - * 0b0..Receive data not inverted. - * 0b1..Receive data inverted. - */ -#define LPUART_STAT_RXINV(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_RXINV_SHIFT)) & LPUART_STAT_RXINV_MASK) - -#define LPUART_STAT_MSBF_MASK (0x20000000U) -#define LPUART_STAT_MSBF_SHIFT (29U) -/*! MSBF - MSB First - * 0b0..LSB (bit0) is the first bit that is transmitted following the start bit. Further, the first bit received - * after the start bit is identified as bit0. - * 0b1..MSB (bit9, bit8, bit7 or bit6) is the first bit that is transmitted following the start bit depending on - * the setting of CTRL[M], CTRL[PE] and BAUD[M10]. Further, the first bit received after the start bit is - * identified as bit9, bit8, bit7 or bit6 depending on the setting of CTRL[M] and CTRL[PE]. - */ -#define LPUART_STAT_MSBF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_MSBF_SHIFT)) & LPUART_STAT_MSBF_MASK) - -#define LPUART_STAT_RXEDGIF_MASK (0x40000000U) -#define LPUART_STAT_RXEDGIF_SHIFT (30U) -/*! RXEDGIF - LPUART_RX Pin Active Edge Interrupt Flag - * 0b0..No active edge on the receive pin has occurred. - * 0b1..An active edge on the receive pin has occurred. - */ -#define LPUART_STAT_RXEDGIF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_RXEDGIF_SHIFT)) & LPUART_STAT_RXEDGIF_MASK) - -#define LPUART_STAT_LBKDIF_MASK (0x80000000U) -#define LPUART_STAT_LBKDIF_SHIFT (31U) -/*! LBKDIF - LIN Break Detect Interrupt Flag - * 0b0..No LIN break character has been detected. - * 0b1..LIN break character has been detected. - */ -#define LPUART_STAT_LBKDIF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_LBKDIF_SHIFT)) & LPUART_STAT_LBKDIF_MASK) -/*! @} */ - -/*! @name CTRL - LPUART Control Register */ -/*! @{ */ - -#define LPUART_CTRL_PT_MASK (0x1U) -#define LPUART_CTRL_PT_SHIFT (0U) -/*! PT - Parity Type - * 0b0..Even parity. - * 0b1..Odd parity. - */ -#define LPUART_CTRL_PT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_PT_SHIFT)) & LPUART_CTRL_PT_MASK) - -#define LPUART_CTRL_PE_MASK (0x2U) -#define LPUART_CTRL_PE_SHIFT (1U) -/*! PE - Parity Enable - * 0b0..No hardware parity generation or checking. - * 0b1..Parity enabled. - */ -#define LPUART_CTRL_PE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_PE_SHIFT)) & LPUART_CTRL_PE_MASK) - -#define LPUART_CTRL_ILT_MASK (0x4U) -#define LPUART_CTRL_ILT_SHIFT (2U) -/*! ILT - Idle Line Type Select - * 0b0..Idle character bit count starts after start bit. - * 0b1..Idle character bit count starts after stop bit. - */ -#define LPUART_CTRL_ILT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_ILT_SHIFT)) & LPUART_CTRL_ILT_MASK) - -#define LPUART_CTRL_WAKE_MASK (0x8U) -#define LPUART_CTRL_WAKE_SHIFT (3U) -/*! WAKE - Receiver Wakeup Method Select - * 0b0..Configures RWU for idle-line wakeup. - * 0b1..Configures RWU with address-mark wakeup. - */ -#define LPUART_CTRL_WAKE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_WAKE_SHIFT)) & LPUART_CTRL_WAKE_MASK) - -#define LPUART_CTRL_M_MASK (0x10U) -#define LPUART_CTRL_M_SHIFT (4U) -/*! M - 9-Bit or 8-Bit Mode Select - * 0b0..Receiver and transmitter use 8-bit data characters. - * 0b1..Receiver and transmitter use 9-bit data characters. - */ -#define LPUART_CTRL_M(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_M_SHIFT)) & LPUART_CTRL_M_MASK) - -#define LPUART_CTRL_RSRC_MASK (0x20U) -#define LPUART_CTRL_RSRC_SHIFT (5U) -/*! RSRC - Receiver Source Select - * 0b0..Provided LOOPS is set, RSRC is cleared, selects internal loop back mode and the LPUART does not use the LPUART_RX pin. - * 0b1..Single-wire LPUART mode where the LPUART_TX pin is connected to the transmitter output and receiver input. - */ -#define LPUART_CTRL_RSRC(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_RSRC_SHIFT)) & LPUART_CTRL_RSRC_MASK) - -#define LPUART_CTRL_DOZEEN_MASK (0x40U) -#define LPUART_CTRL_DOZEEN_SHIFT (6U) -/*! DOZEEN - Doze Enable - * 0b0..LPUART is enabled in Doze mode. - * 0b1..LPUART is disabled in Doze mode. - */ -#define LPUART_CTRL_DOZEEN(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_DOZEEN_SHIFT)) & LPUART_CTRL_DOZEEN_MASK) - -#define LPUART_CTRL_LOOPS_MASK (0x80U) -#define LPUART_CTRL_LOOPS_SHIFT (7U) -/*! LOOPS - Loop Mode Select - * 0b0..Normal operation - LPUART_RX and LPUART_TX use separate pins. - * 0b1..Loop mode or single-wire mode where transmitter outputs are internally connected to receiver input (see RSRC bit). - */ -#define LPUART_CTRL_LOOPS(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_LOOPS_SHIFT)) & LPUART_CTRL_LOOPS_MASK) - -#define LPUART_CTRL_IDLECFG_MASK (0x700U) -#define LPUART_CTRL_IDLECFG_SHIFT (8U) -/*! IDLECFG - Idle Configuration - * 0b000..1 idle character - * 0b001..2 idle characters - * 0b010..4 idle characters - * 0b011..8 idle characters - * 0b100..16 idle characters - * 0b101..32 idle characters - * 0b110..64 idle characters - * 0b111..128 idle characters - */ -#define LPUART_CTRL_IDLECFG(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_IDLECFG_SHIFT)) & LPUART_CTRL_IDLECFG_MASK) - -#define LPUART_CTRL_MA2IE_MASK (0x4000U) -#define LPUART_CTRL_MA2IE_SHIFT (14U) -/*! MA2IE - Match 2 Interrupt Enable - * 0b0..MA2F interrupt disabled - * 0b1..MA2F interrupt enabled - */ -#define LPUART_CTRL_MA2IE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_MA2IE_SHIFT)) & LPUART_CTRL_MA2IE_MASK) - -#define LPUART_CTRL_MA1IE_MASK (0x8000U) -#define LPUART_CTRL_MA1IE_SHIFT (15U) -/*! MA1IE - Match 1 Interrupt Enable - * 0b0..MA1F interrupt disabled - * 0b1..MA1F interrupt enabled - */ -#define LPUART_CTRL_MA1IE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_MA1IE_SHIFT)) & LPUART_CTRL_MA1IE_MASK) - -#define LPUART_CTRL_SBK_MASK (0x10000U) -#define LPUART_CTRL_SBK_SHIFT (16U) -/*! SBK - Send Break - * 0b0..Normal transmitter operation. - * 0b1..Queue break character(s) to be sent. - */ -#define LPUART_CTRL_SBK(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_SBK_SHIFT)) & LPUART_CTRL_SBK_MASK) - -#define LPUART_CTRL_RWU_MASK (0x20000U) -#define LPUART_CTRL_RWU_SHIFT (17U) -/*! RWU - Receiver Wakeup Control - * 0b0..Normal receiver operation. - * 0b1..LPUART receiver in standby waiting for wakeup condition. - */ -#define LPUART_CTRL_RWU(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_RWU_SHIFT)) & LPUART_CTRL_RWU_MASK) - -#define LPUART_CTRL_RE_MASK (0x40000U) -#define LPUART_CTRL_RE_SHIFT (18U) -/*! RE - Receiver Enable - * 0b0..Receiver disabled. - * 0b1..Receiver enabled. - */ -#define LPUART_CTRL_RE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_RE_SHIFT)) & LPUART_CTRL_RE_MASK) - -#define LPUART_CTRL_TE_MASK (0x80000U) -#define LPUART_CTRL_TE_SHIFT (19U) -/*! TE - Transmitter Enable - * 0b0..Transmitter disabled. - * 0b1..Transmitter enabled. - */ -#define LPUART_CTRL_TE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_TE_SHIFT)) & LPUART_CTRL_TE_MASK) - -#define LPUART_CTRL_ILIE_MASK (0x100000U) -#define LPUART_CTRL_ILIE_SHIFT (20U) -/*! ILIE - Idle Line Interrupt Enable - * 0b0..Hardware interrupts from IDLE disabled; use polling. - * 0b1..Hardware interrupt requested when IDLE flag is 1. - */ -#define LPUART_CTRL_ILIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_ILIE_SHIFT)) & LPUART_CTRL_ILIE_MASK) - -#define LPUART_CTRL_RIE_MASK (0x200000U) -#define LPUART_CTRL_RIE_SHIFT (21U) -/*! RIE - Receiver Interrupt Enable - * 0b0..Hardware interrupts from RDRF disabled; use polling. - * 0b1..Hardware interrupt requested when RDRF flag is 1. - */ -#define LPUART_CTRL_RIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_RIE_SHIFT)) & LPUART_CTRL_RIE_MASK) - -#define LPUART_CTRL_TCIE_MASK (0x400000U) -#define LPUART_CTRL_TCIE_SHIFT (22U) -/*! TCIE - Transmission Complete Interrupt Enable for - * 0b0..Hardware interrupts from TC disabled; use polling. - * 0b1..Hardware interrupt requested when TC flag is 1. - */ -#define LPUART_CTRL_TCIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_TCIE_SHIFT)) & LPUART_CTRL_TCIE_MASK) - -#define LPUART_CTRL_TIE_MASK (0x800000U) -#define LPUART_CTRL_TIE_SHIFT (23U) -/*! TIE - Transmit Interrupt Enable - * 0b0..Hardware interrupts from TDRE disabled; use polling. - * 0b1..Hardware interrupt requested when TDRE flag is 1. - */ -#define LPUART_CTRL_TIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_TIE_SHIFT)) & LPUART_CTRL_TIE_MASK) - -#define LPUART_CTRL_PEIE_MASK (0x1000000U) -#define LPUART_CTRL_PEIE_SHIFT (24U) -/*! PEIE - Parity Error Interrupt Enable - * 0b0..PF interrupts disabled; use polling). - * 0b1..Hardware interrupt requested when PF is set. - */ -#define LPUART_CTRL_PEIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_PEIE_SHIFT)) & LPUART_CTRL_PEIE_MASK) - -#define LPUART_CTRL_FEIE_MASK (0x2000000U) -#define LPUART_CTRL_FEIE_SHIFT (25U) -/*! FEIE - Framing Error Interrupt Enable - * 0b0..FE interrupts disabled; use polling. - * 0b1..Hardware interrupt requested when FE is set. - */ -#define LPUART_CTRL_FEIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_FEIE_SHIFT)) & LPUART_CTRL_FEIE_MASK) - -#define LPUART_CTRL_NEIE_MASK (0x4000000U) -#define LPUART_CTRL_NEIE_SHIFT (26U) -/*! NEIE - Noise Error Interrupt Enable - * 0b0..NF interrupts disabled; use polling. - * 0b1..Hardware interrupt requested when NF is set. - */ -#define LPUART_CTRL_NEIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_NEIE_SHIFT)) & LPUART_CTRL_NEIE_MASK) - -#define LPUART_CTRL_ORIE_MASK (0x8000000U) -#define LPUART_CTRL_ORIE_SHIFT (27U) -/*! ORIE - Overrun Interrupt Enable - * 0b0..OR interrupts disabled; use polling. - * 0b1..Hardware interrupt requested when OR is set. - */ -#define LPUART_CTRL_ORIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_ORIE_SHIFT)) & LPUART_CTRL_ORIE_MASK) - -#define LPUART_CTRL_TXINV_MASK (0x10000000U) -#define LPUART_CTRL_TXINV_SHIFT (28U) -/*! TXINV - Transmit Data Inversion - * 0b0..Transmit data not inverted. - * 0b1..Transmit data inverted. - */ -#define LPUART_CTRL_TXINV(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_TXINV_SHIFT)) & LPUART_CTRL_TXINV_MASK) - -#define LPUART_CTRL_TXDIR_MASK (0x20000000U) -#define LPUART_CTRL_TXDIR_SHIFT (29U) -/*! TXDIR - LPUART_TX Pin Direction in Single-Wire Mode - * 0b0..LPUART_TX pin is an input in single-wire mode. - * 0b1..LPUART_TX pin is an output in single-wire mode. - */ -#define LPUART_CTRL_TXDIR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_TXDIR_SHIFT)) & LPUART_CTRL_TXDIR_MASK) - -#define LPUART_CTRL_R9T8_MASK (0x40000000U) -#define LPUART_CTRL_R9T8_SHIFT (30U) -/*! R9T8 - Receive Bit 9 / Transmit Bit 8 */ -#define LPUART_CTRL_R9T8(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_R9T8_SHIFT)) & LPUART_CTRL_R9T8_MASK) - -#define LPUART_CTRL_R8T9_MASK (0x80000000U) -#define LPUART_CTRL_R8T9_SHIFT (31U) -/*! R8T9 - Receive Bit 8 / Transmit Bit 9 */ -#define LPUART_CTRL_R8T9(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_R8T9_SHIFT)) & LPUART_CTRL_R8T9_MASK) -/*! @} */ - -/*! @name DATA - LPUART Data Register */ -/*! @{ */ - -#define LPUART_DATA_R0T0_MASK (0x1U) -#define LPUART_DATA_R0T0_SHIFT (0U) -#define LPUART_DATA_R0T0(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R0T0_SHIFT)) & LPUART_DATA_R0T0_MASK) - -#define LPUART_DATA_R1T1_MASK (0x2U) -#define LPUART_DATA_R1T1_SHIFT (1U) -#define LPUART_DATA_R1T1(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R1T1_SHIFT)) & LPUART_DATA_R1T1_MASK) - -#define LPUART_DATA_R2T2_MASK (0x4U) -#define LPUART_DATA_R2T2_SHIFT (2U) -#define LPUART_DATA_R2T2(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R2T2_SHIFT)) & LPUART_DATA_R2T2_MASK) - -#define LPUART_DATA_R3T3_MASK (0x8U) -#define LPUART_DATA_R3T3_SHIFT (3U) -#define LPUART_DATA_R3T3(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R3T3_SHIFT)) & LPUART_DATA_R3T3_MASK) - -#define LPUART_DATA_R4T4_MASK (0x10U) -#define LPUART_DATA_R4T4_SHIFT (4U) -#define LPUART_DATA_R4T4(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R4T4_SHIFT)) & LPUART_DATA_R4T4_MASK) - -#define LPUART_DATA_R5T5_MASK (0x20U) -#define LPUART_DATA_R5T5_SHIFT (5U) -#define LPUART_DATA_R5T5(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R5T5_SHIFT)) & LPUART_DATA_R5T5_MASK) - -#define LPUART_DATA_R6T6_MASK (0x40U) -#define LPUART_DATA_R6T6_SHIFT (6U) -#define LPUART_DATA_R6T6(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R6T6_SHIFT)) & LPUART_DATA_R6T6_MASK) - -#define LPUART_DATA_R7T7_MASK (0x80U) -#define LPUART_DATA_R7T7_SHIFT (7U) -#define LPUART_DATA_R7T7(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R7T7_SHIFT)) & LPUART_DATA_R7T7_MASK) - -#define LPUART_DATA_R8T8_MASK (0x100U) -#define LPUART_DATA_R8T8_SHIFT (8U) -#define LPUART_DATA_R8T8(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R8T8_SHIFT)) & LPUART_DATA_R8T8_MASK) - -#define LPUART_DATA_R9T9_MASK (0x200U) -#define LPUART_DATA_R9T9_SHIFT (9U) -#define LPUART_DATA_R9T9(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R9T9_SHIFT)) & LPUART_DATA_R9T9_MASK) - -#define LPUART_DATA_IDLINE_MASK (0x800U) -#define LPUART_DATA_IDLINE_SHIFT (11U) -/*! IDLINE - Idle Line - * 0b0..Receiver was not idle before receiving this character. - * 0b1..Receiver was idle before receiving this character. - */ -#define LPUART_DATA_IDLINE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_IDLINE_SHIFT)) & LPUART_DATA_IDLINE_MASK) - -#define LPUART_DATA_RXEMPT_MASK (0x1000U) -#define LPUART_DATA_RXEMPT_SHIFT (12U) -/*! RXEMPT - Receive Buffer Empty - * 0b0..Receive buffer contains valid data. - * 0b1..Receive buffer is empty, data returned on read is not valid. - */ -#define LPUART_DATA_RXEMPT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_RXEMPT_SHIFT)) & LPUART_DATA_RXEMPT_MASK) - -#define LPUART_DATA_FRETSC_MASK (0x2000U) -#define LPUART_DATA_FRETSC_SHIFT (13U) -/*! FRETSC - Frame Error / Transmit Special Character - * 0b0..The dataword was received without a frame error on read, transmit a normal character on write. - * 0b1..The dataword was received with a frame error, transmit an idle or break character on transmit. - */ -#define LPUART_DATA_FRETSC(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_FRETSC_SHIFT)) & LPUART_DATA_FRETSC_MASK) - -#define LPUART_DATA_PARITYE_MASK (0x4000U) -#define LPUART_DATA_PARITYE_SHIFT (14U) -/*! PARITYE - * 0b0..The dataword was received without a parity error. - * 0b1..The dataword was received with a parity error. - */ -#define LPUART_DATA_PARITYE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_PARITYE_SHIFT)) & LPUART_DATA_PARITYE_MASK) - -#define LPUART_DATA_NOISY_MASK (0x8000U) -#define LPUART_DATA_NOISY_SHIFT (15U) -/*! NOISY - * 0b0..The dataword was received without noise. - * 0b1..The data was received with noise. - */ -#define LPUART_DATA_NOISY(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_NOISY_SHIFT)) & LPUART_DATA_NOISY_MASK) -/*! @} */ - -/*! @name MATCH - LPUART Match Address Register */ -/*! @{ */ - -#define LPUART_MATCH_MA1_MASK (0x3FFU) -#define LPUART_MATCH_MA1_SHIFT (0U) -/*! MA1 - Match Address 1 */ -#define LPUART_MATCH_MA1(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MATCH_MA1_SHIFT)) & LPUART_MATCH_MA1_MASK) - -#define LPUART_MATCH_MA2_MASK (0x3FF0000U) -#define LPUART_MATCH_MA2_SHIFT (16U) -/*! MA2 - Match Address 2 */ -#define LPUART_MATCH_MA2(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MATCH_MA2_SHIFT)) & LPUART_MATCH_MA2_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group LPUART_Register_Masks */ - - -/* LPUART - Peripheral instance base addresses */ -/** Peripheral LPUART0 base address */ -#define LPUART0_BASE (0x40054000u) -/** Peripheral LPUART0 base pointer */ -#define LPUART0 ((LPUART_Type *)LPUART0_BASE) -/** Peripheral LPUART1 base address */ -#define LPUART1_BASE (0x40055000u) -/** Peripheral LPUART1 base pointer */ -#define LPUART1 ((LPUART_Type *)LPUART1_BASE) -/** Array initializer of LPUART peripheral base addresses */ -#define LPUART_BASE_ADDRS { LPUART0_BASE, LPUART1_BASE } -/** Array initializer of LPUART peripheral base pointers */ -#define LPUART_BASE_PTRS { LPUART0, LPUART1 } -/** Interrupt vectors for the LPUART peripheral type */ -#define LPUART_RX_TX_IRQS { LPUART0_IRQn, LPUART1_IRQn } -#define LPUART_ERR_IRQS { LPUART0_IRQn, LPUART1_IRQn } - -/*! - * @} - */ /* end of group LPUART_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- MCG Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup MCG_Peripheral_Access_Layer MCG Peripheral Access Layer - * @{ - */ - -/** MCG - Register Layout Typedef */ -typedef struct { - __IO uint8_t C1; /**< MCG Control Register 1, offset: 0x0 */ - __IO uint8_t C2; /**< MCG Control Register 2, offset: 0x1 */ - uint8_t RESERVED_0[4]; - __I uint8_t S; /**< MCG Status Register, offset: 0x6 */ - uint8_t RESERVED_1[1]; - __IO uint8_t SC; /**< MCG Status and Control Register, offset: 0x8 */ - uint8_t RESERVED_2[11]; - __I uint8_t HCTRIM; /**< MCG High-frequency IRC Coarse Trim Register, offset: 0x14 */ - __I uint8_t HTTRIM; /**< MCG High-frequency IRC Tempco (Temperature Coefficient) Trim Register, offset: 0x15 */ - __I uint8_t HFTRIM; /**< MCG High-frequency IRC Fine Trim Register, offset: 0x16 */ - uint8_t RESERVED_3[1]; - __IO uint8_t MC; /**< MCG Miscellaneous Control Register, offset: 0x18 */ - __I uint8_t LTRIMRNG; /**< MCG Low-frequency IRC Trim Range Register, offset: 0x19 */ - __I uint8_t LFTRIM; /**< MCG Low-frequency IRC8M Trim Register, offset: 0x1A */ - __I uint8_t LSTRIM; /**< MCG Low-frequency IRC2M Trim Register, offset: 0x1B */ -} MCG_Type; - -/* ---------------------------------------------------------------------------- - -- MCG Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup MCG_Register_Masks MCG Register Masks - * @{ - */ - -/*! @name C1 - MCG Control Register 1 */ -/*! @{ */ - -#define MCG_C1_IREFSTEN_MASK (0x1U) -#define MCG_C1_IREFSTEN_SHIFT (0U) -/*! IREFSTEN - Internal Reference Stop Enable - * 0b0..LIRC is disabled in Stop mode. - * 0b1..LIRC is enabled in Stop mode, if IRCLKEN is set. - */ -#define MCG_C1_IREFSTEN(x) (((uint8_t)(((uint8_t)(x)) << MCG_C1_IREFSTEN_SHIFT)) & MCG_C1_IREFSTEN_MASK) - -#define MCG_C1_IRCLKEN_MASK (0x2U) -#define MCG_C1_IRCLKEN_SHIFT (1U) -/*! IRCLKEN - Internal Reference Clock Enable - * 0b0..LIRC is disabled. - * 0b1..LIRC is enabled. - */ -#define MCG_C1_IRCLKEN(x) (((uint8_t)(((uint8_t)(x)) << MCG_C1_IRCLKEN_SHIFT)) & MCG_C1_IRCLKEN_MASK) - -#define MCG_C1_CLKS_MASK (0xC0U) -#define MCG_C1_CLKS_SHIFT (6U) -/*! CLKS - Clock Source Select - * 0b00..Selects HIRC clock as the main clock source. This is HIRC mode. - * 0b01..Selects LIRC clock as the main clock source. This is LIRC2M or LIRC8M mode. - * 0b10..Selects external clock as the main clock source. This is EXT mode. - * 0b11..Reserved. Writing 11 takes no effect. - */ -#define MCG_C1_CLKS(x) (((uint8_t)(((uint8_t)(x)) << MCG_C1_CLKS_SHIFT)) & MCG_C1_CLKS_MASK) -/*! @} */ - -/*! @name C2 - MCG Control Register 2 */ -/*! @{ */ - -#define MCG_C2_IRCS_MASK (0x1U) -#define MCG_C2_IRCS_SHIFT (0U) -/*! IRCS - Low-frequency Internal Reference Clock Select - * 0b0..LIRC is in 2 MHz mode. - * 0b1..LIRC is in 8 MHz mode. - */ -#define MCG_C2_IRCS(x) (((uint8_t)(((uint8_t)(x)) << MCG_C2_IRCS_SHIFT)) & MCG_C2_IRCS_MASK) - -#define MCG_C2_EREFS0_MASK (0x4U) -#define MCG_C2_EREFS0_SHIFT (2U) -/*! EREFS0 - External Clock Source Select - * 0b0..External clock requested. - * 0b1..Oscillator requested. - */ -#define MCG_C2_EREFS0(x) (((uint8_t)(((uint8_t)(x)) << MCG_C2_EREFS0_SHIFT)) & MCG_C2_EREFS0_MASK) - -#define MCG_C2_HGO0_MASK (0x8U) -#define MCG_C2_HGO0_SHIFT (3U) -/*! HGO0 - Crystal Oscillator Operation Mode Select - * 0b0..Configure crystal oscillator for low-power operation. - * 0b1..Configure crystal oscillator for high-gain operation. - */ -#define MCG_C2_HGO0(x) (((uint8_t)(((uint8_t)(x)) << MCG_C2_HGO0_SHIFT)) & MCG_C2_HGO0_MASK) - -#define MCG_C2_RANGE0_MASK (0x30U) -#define MCG_C2_RANGE0_SHIFT (4U) -/*! RANGE0 - External Clock Source Frequency Range Select - * 0b00..Low frequency range selected for the crystal oscillator or the external clock source. - * 0b01..High frequency range selected for the crystal oscillator or the external clock source. - * 0b10..Very high frequency range selected for the crystal oscillator or the external clock source. - * 0b11..Very high frequency range selected for the crystal oscillator or the external clock source. Same effect as 10. - */ -#define MCG_C2_RANGE0(x) (((uint8_t)(((uint8_t)(x)) << MCG_C2_RANGE0_SHIFT)) & MCG_C2_RANGE0_MASK) -/*! @} */ - -/*! @name S - MCG Status Register */ -/*! @{ */ - -#define MCG_S_OSCINIT0_MASK (0x2U) -#define MCG_S_OSCINIT0_SHIFT (1U) -/*! OSCINIT0 - OSC Initialization Status - * 0b0..OSC is not ready. - * 0b1..OSC clock is ready. - */ -#define MCG_S_OSCINIT0(x) (((uint8_t)(((uint8_t)(x)) << MCG_S_OSCINIT0_SHIFT)) & MCG_S_OSCINIT0_MASK) - -#define MCG_S_CLKST_MASK (0xCU) -#define MCG_S_CLKST_SHIFT (2U) -/*! CLKST - Clock Mode Status - * 0b00..HIRC clock is selected as the main clock source, and MCG_Lite works at HIRC mode. - * 0b01..LIRC clock is selected as the main clock source, and MCG_Lite works at LIRC2M or LIRC8M mode. - * 0b10..External clock is selected as the main clock source, and MCG_Lite works at EXT mode. - * 0b11..Reserved. - */ -#define MCG_S_CLKST(x) (((uint8_t)(((uint8_t)(x)) << MCG_S_CLKST_SHIFT)) & MCG_S_CLKST_MASK) -/*! @} */ - -/*! @name SC - MCG Status and Control Register */ -/*! @{ */ - -#define MCG_SC_FCRDIV_MASK (0xEU) -#define MCG_SC_FCRDIV_SHIFT (1U) -/*! FCRDIV - Low-frequency Internal Reference Clock Divider - * 0b000..Division factor is 1. - * 0b001..Division factor is 2. - * 0b010..Division factor is 4. - * 0b011..Division factor is 8. - * 0b100..Division factor is 16. - * 0b101..Division factor is 32. - * 0b110..Division factor is 64. - * 0b111..Division factor is 128. - */ -#define MCG_SC_FCRDIV(x) (((uint8_t)(((uint8_t)(x)) << MCG_SC_FCRDIV_SHIFT)) & MCG_SC_FCRDIV_MASK) -/*! @} */ - -/*! @name HCTRIM - MCG High-frequency IRC Coarse Trim Register */ -/*! @{ */ - -#define MCG_HCTRIM_COARSE_TRIM_MASK (0x3FU) -#define MCG_HCTRIM_COARSE_TRIM_SHIFT (0U) -/*! COARSE_TRIM - High-frequency IRC Coarse Trim */ -#define MCG_HCTRIM_COARSE_TRIM(x) (((uint8_t)(((uint8_t)(x)) << MCG_HCTRIM_COARSE_TRIM_SHIFT)) & MCG_HCTRIM_COARSE_TRIM_MASK) -/*! @} */ - -/*! @name HTTRIM - MCG High-frequency IRC Tempco (Temperature Coefficient) Trim Register */ -/*! @{ */ - -#define MCG_HTTRIM_TEMPCO_TRIM_MASK (0x1FU) -#define MCG_HTTRIM_TEMPCO_TRIM_SHIFT (0U) -/*! TEMPCO_TRIM - High-frequency IRC Tempco Trim */ -#define MCG_HTTRIM_TEMPCO_TRIM(x) (((uint8_t)(((uint8_t)(x)) << MCG_HTTRIM_TEMPCO_TRIM_SHIFT)) & MCG_HTTRIM_TEMPCO_TRIM_MASK) -/*! @} */ - -/*! @name HFTRIM - MCG High-frequency IRC Fine Trim Register */ -/*! @{ */ - -#define MCG_HFTRIM_FINE_TRIM_MASK (0x7FU) -#define MCG_HFTRIM_FINE_TRIM_SHIFT (0U) -/*! FINE_TRIM - High-frequency IRC Fine Trim */ -#define MCG_HFTRIM_FINE_TRIM(x) (((uint8_t)(((uint8_t)(x)) << MCG_HFTRIM_FINE_TRIM_SHIFT)) & MCG_HFTRIM_FINE_TRIM_MASK) -/*! @} */ - -/*! @name MC - MCG Miscellaneous Control Register */ -/*! @{ */ - -#define MCG_MC_LIRC_DIV2_MASK (0x7U) -#define MCG_MC_LIRC_DIV2_SHIFT (0U) -/*! LIRC_DIV2 - Second Low-frequency Internal Reference Clock Divider - * 0b000..Division factor is 1. - * 0b001..Division factor is 2. - * 0b010..Division factor is 4. - * 0b011..Division factor is 8. - * 0b100..Division factor is 16. - * 0b101..Division factor is 32. - * 0b110..Division factor is 64. - * 0b111..Division factor is 128. - */ -#define MCG_MC_LIRC_DIV2(x) (((uint8_t)(((uint8_t)(x)) << MCG_MC_LIRC_DIV2_SHIFT)) & MCG_MC_LIRC_DIV2_MASK) - -#define MCG_MC_HIRCEN_MASK (0x80U) -#define MCG_MC_HIRCEN_SHIFT (7U) -/*! HIRCEN - High-frequency IRC Enable - * 0b0..HIRC source is not enabled. - * 0b1..HIRC source is enabled. - */ -#define MCG_MC_HIRCEN(x) (((uint8_t)(((uint8_t)(x)) << MCG_MC_HIRCEN_SHIFT)) & MCG_MC_HIRCEN_MASK) -/*! @} */ - -/*! @name LTRIMRNG - MCG Low-frequency IRC Trim Range Register */ -/*! @{ */ - -#define MCG_LTRIMRNG_STRIMRNG_MASK (0x3U) -#define MCG_LTRIMRNG_STRIMRNG_SHIFT (0U) -/*! STRIMRNG - LIRC Slow TRIM (2 MHz) Range - * 0b00..Frequency shift by 10%. - * 0b01..No frequency shift. - * 0b10..No frequency shift. - * 0b11..Frequency shift by -10%. - */ -#define MCG_LTRIMRNG_STRIMRNG(x) (((uint8_t)(((uint8_t)(x)) << MCG_LTRIMRNG_STRIMRNG_SHIFT)) & MCG_LTRIMRNG_STRIMRNG_MASK) - -#define MCG_LTRIMRNG_FTRIMRNG_MASK (0xCU) -#define MCG_LTRIMRNG_FTRIMRNG_SHIFT (2U) -/*! FTRIMRNG - LIRC Fast TRIM (8 MHz) Range - * 0b00..Frequency shift by 10%. - * 0b01..No frequency shift. - * 0b10..No frequency shift. - * 0b11..Frequency shift by -10%. - */ -#define MCG_LTRIMRNG_FTRIMRNG(x) (((uint8_t)(((uint8_t)(x)) << MCG_LTRIMRNG_FTRIMRNG_SHIFT)) & MCG_LTRIMRNG_FTRIMRNG_MASK) -/*! @} */ - -/*! @name LFTRIM - MCG Low-frequency IRC8M Trim Register */ -/*! @{ */ - -#define MCG_LFTRIM_LIRC_FTRIM_MASK (0x7FU) -#define MCG_LFTRIM_LIRC_FTRIM_SHIFT (0U) -/*! LIRC_FTRIM - LIRC8M TRIM */ -#define MCG_LFTRIM_LIRC_FTRIM(x) (((uint8_t)(((uint8_t)(x)) << MCG_LFTRIM_LIRC_FTRIM_SHIFT)) & MCG_LFTRIM_LIRC_FTRIM_MASK) -/*! @} */ - -/*! @name LSTRIM - MCG Low-frequency IRC2M Trim Register */ -/*! @{ */ - -#define MCG_LSTRIM_LIRC_STRIM_MASK (0x7FU) -#define MCG_LSTRIM_LIRC_STRIM_SHIFT (0U) -/*! LIRC_STRIM - LIRC2M TRIM */ -#define MCG_LSTRIM_LIRC_STRIM(x) (((uint8_t)(((uint8_t)(x)) << MCG_LSTRIM_LIRC_STRIM_SHIFT)) & MCG_LSTRIM_LIRC_STRIM_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group MCG_Register_Masks */ - - -/* MCG - Peripheral instance base addresses */ -/** Peripheral MCG base address */ -#define MCG_BASE (0x40064000u) -/** Peripheral MCG base pointer */ -#define MCG ((MCG_Type *)MCG_BASE) -/** Array initializer of MCG peripheral base addresses */ -#define MCG_BASE_ADDRS { MCG_BASE } -/** Array initializer of MCG peripheral base pointers */ -#define MCG_BASE_PTRS { MCG } - -/*! - * @} - */ /* end of group MCG_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- MCM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup MCM_Peripheral_Access_Layer MCM Peripheral Access Layer - * @{ - */ - -/** MCM - Register Layout Typedef */ -typedef struct { - uint8_t RESERVED_0[8]; - __I uint16_t PLASC; /**< Crossbar Switch (AXBS) Slave Configuration, offset: 0x8 */ - __I uint16_t PLAMC; /**< Crossbar Switch (AXBS) Master Configuration, offset: 0xA */ - __IO uint32_t PLACR; /**< Platform Control Register, offset: 0xC */ - uint8_t RESERVED_1[48]; - __IO uint32_t CPO; /**< Compute Operation Control Register, offset: 0x40 */ -} MCM_Type; - -/* ---------------------------------------------------------------------------- - -- MCM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup MCM_Register_Masks MCM Register Masks - * @{ - */ - -/*! @name PLASC - Crossbar Switch (AXBS) Slave Configuration */ -/*! @{ */ - -#define MCM_PLASC_ASC_MASK (0xFFU) -#define MCM_PLASC_ASC_SHIFT (0U) -/*! ASC - Each bit in the ASC field indicates whether there is a corresponding connection to the - * crossbar switch's slave input port. - * 0b00000000..A bus slave connection to AXBS input port n is absent. - * 0b00000001..A bus slave connection to AXBS input port n is present. - */ -#define MCM_PLASC_ASC(x) (((uint16_t)(((uint16_t)(x)) << MCM_PLASC_ASC_SHIFT)) & MCM_PLASC_ASC_MASK) -/*! @} */ - -/*! @name PLAMC - Crossbar Switch (AXBS) Master Configuration */ -/*! @{ */ - -#define MCM_PLAMC_AMC_MASK (0xFFU) -#define MCM_PLAMC_AMC_SHIFT (0U) -/*! AMC - Each bit in the AMC field indicates whether there is a corresponding connection to the AXBS master input port. - * 0b00000000..A bus master connection to AXBS input port n is absent - * 0b00000001..A bus master connection to AXBS input port n is present - */ -#define MCM_PLAMC_AMC(x) (((uint16_t)(((uint16_t)(x)) << MCM_PLAMC_AMC_SHIFT)) & MCM_PLAMC_AMC_MASK) -/*! @} */ - -/*! @name PLACR - Platform Control Register */ -/*! @{ */ - -#define MCM_PLACR_ARB_MASK (0x200U) -#define MCM_PLACR_ARB_SHIFT (9U) -/*! ARB - Arbitration select - * 0b0..Fixed-priority arbitration for the crossbar masters - * 0b1..Round-robin arbitration for the crossbar masters - */ -#define MCM_PLACR_ARB(x) (((uint32_t)(((uint32_t)(x)) << MCM_PLACR_ARB_SHIFT)) & MCM_PLACR_ARB_MASK) - -#define MCM_PLACR_CFCC_MASK (0x400U) -#define MCM_PLACR_CFCC_SHIFT (10U) -/*! CFCC - Clear Flash Controller Cache */ -#define MCM_PLACR_CFCC(x) (((uint32_t)(((uint32_t)(x)) << MCM_PLACR_CFCC_SHIFT)) & MCM_PLACR_CFCC_MASK) - -#define MCM_PLACR_DFCDA_MASK (0x800U) -#define MCM_PLACR_DFCDA_SHIFT (11U) -/*! DFCDA - Disable Flash Controller Data Caching - * 0b0..Enable flash controller data caching - * 0b1..Disable flash controller data caching. - */ -#define MCM_PLACR_DFCDA(x) (((uint32_t)(((uint32_t)(x)) << MCM_PLACR_DFCDA_SHIFT)) & MCM_PLACR_DFCDA_MASK) - -#define MCM_PLACR_DFCIC_MASK (0x1000U) -#define MCM_PLACR_DFCIC_SHIFT (12U) -/*! DFCIC - Disable Flash Controller Instruction Caching - * 0b0..Enable flash controller instruction caching. - * 0b1..Disable flash controller instruction caching. - */ -#define MCM_PLACR_DFCIC(x) (((uint32_t)(((uint32_t)(x)) << MCM_PLACR_DFCIC_SHIFT)) & MCM_PLACR_DFCIC_MASK) - -#define MCM_PLACR_DFCC_MASK (0x2000U) -#define MCM_PLACR_DFCC_SHIFT (13U) -/*! DFCC - Disable Flash Controller Cache - * 0b0..Enable flash controller cache. - * 0b1..Disable flash controller cache. - */ -#define MCM_PLACR_DFCC(x) (((uint32_t)(((uint32_t)(x)) << MCM_PLACR_DFCC_SHIFT)) & MCM_PLACR_DFCC_MASK) - -#define MCM_PLACR_EFDS_MASK (0x4000U) -#define MCM_PLACR_EFDS_SHIFT (14U) -/*! EFDS - Enable Flash Data Speculation - * 0b0..Disable flash data speculation. - * 0b1..Enable flash data speculation. - */ -#define MCM_PLACR_EFDS(x) (((uint32_t)(((uint32_t)(x)) << MCM_PLACR_EFDS_SHIFT)) & MCM_PLACR_EFDS_MASK) - -#define MCM_PLACR_DFCS_MASK (0x8000U) -#define MCM_PLACR_DFCS_SHIFT (15U) -/*! DFCS - Disable Flash Controller Speculation - * 0b0..Enable flash controller speculation. - * 0b1..Disable flash controller speculation. - */ -#define MCM_PLACR_DFCS(x) (((uint32_t)(((uint32_t)(x)) << MCM_PLACR_DFCS_SHIFT)) & MCM_PLACR_DFCS_MASK) - -#define MCM_PLACR_ESFC_MASK (0x10000U) -#define MCM_PLACR_ESFC_SHIFT (16U) -/*! ESFC - Enable Stalling Flash Controller - * 0b0..Disable stalling flash controller when flash is busy. - * 0b1..Enable stalling flash controller when flash is busy. - */ -#define MCM_PLACR_ESFC(x) (((uint32_t)(((uint32_t)(x)) << MCM_PLACR_ESFC_SHIFT)) & MCM_PLACR_ESFC_MASK) -/*! @} */ - -/*! @name CPO - Compute Operation Control Register */ -/*! @{ */ - -#define MCM_CPO_CPOREQ_MASK (0x1U) -#define MCM_CPO_CPOREQ_SHIFT (0U) -/*! CPOREQ - Compute Operation Request - * 0b0..Request is cleared. - * 0b1..Request Compute Operation. - */ -#define MCM_CPO_CPOREQ(x) (((uint32_t)(((uint32_t)(x)) << MCM_CPO_CPOREQ_SHIFT)) & MCM_CPO_CPOREQ_MASK) - -#define MCM_CPO_CPOACK_MASK (0x2U) -#define MCM_CPO_CPOACK_SHIFT (1U) -/*! CPOACK - Compute Operation Acknowledge - * 0b0..Compute operation entry has not completed or compute operation exit has completed. - * 0b1..Compute operation entry has completed or compute operation exit has not completed. - */ -#define MCM_CPO_CPOACK(x) (((uint32_t)(((uint32_t)(x)) << MCM_CPO_CPOACK_SHIFT)) & MCM_CPO_CPOACK_MASK) - -#define MCM_CPO_CPOWOI_MASK (0x4U) -#define MCM_CPO_CPOWOI_SHIFT (2U) -/*! CPOWOI - Compute Operation Wake-up on Interrupt - * 0b0..No effect. - * 0b1..When set, the CPOREQ is cleared on any interrupt or exception vector fetch. - */ -#define MCM_CPO_CPOWOI(x) (((uint32_t)(((uint32_t)(x)) << MCM_CPO_CPOWOI_SHIFT)) & MCM_CPO_CPOWOI_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group MCM_Register_Masks */ - - -/* MCM - Peripheral instance base addresses */ -/** Peripheral MCM base address */ -#define MCM_BASE (0xF0003000u) -/** Peripheral MCM base pointer */ -#define MCM ((MCM_Type *)MCM_BASE) -/** Array initializer of MCM peripheral base addresses */ -#define MCM_BASE_ADDRS { MCM_BASE } -/** Array initializer of MCM peripheral base pointers */ -#define MCM_BASE_PTRS { MCM } - -/*! - * @} - */ /* end of group MCM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- MTB Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup MTB_Peripheral_Access_Layer MTB Peripheral Access Layer - * @{ - */ - -/** MTB - Register Layout Typedef */ -typedef struct { - __IO uint32_t POSITION; /**< MTB Position Register, offset: 0x0 */ - __IO uint32_t MASTER; /**< MTB Master Register, offset: 0x4 */ - __IO uint32_t FLOW; /**< MTB Flow Register, offset: 0x8 */ - __I uint32_t BASE; /**< MTB Base Register, offset: 0xC */ - uint8_t RESERVED_0[3824]; - __I uint32_t MODECTRL; /**< Integration Mode Control Register, offset: 0xF00 */ - uint8_t RESERVED_1[156]; - __I uint32_t TAGSET; /**< Claim TAG Set Register, offset: 0xFA0 */ - __I uint32_t TAGCLEAR; /**< Claim TAG Clear Register, offset: 0xFA4 */ - uint8_t RESERVED_2[8]; - __I uint32_t LOCKACCESS; /**< Lock Access Register, offset: 0xFB0 */ - __I uint32_t LOCKSTAT; /**< Lock Status Register, offset: 0xFB4 */ - __I uint32_t AUTHSTAT; /**< Authentication Status Register, offset: 0xFB8 */ - __I uint32_t DEVICEARCH; /**< Device Architecture Register, offset: 0xFBC */ - uint8_t RESERVED_3[8]; - __I uint32_t DEVICECFG; /**< Device Configuration Register, offset: 0xFC8 */ - __I uint32_t DEVICETYPID; /**< Device Type Identifier Register, offset: 0xFCC */ - __I uint32_t PERIPHID4; /**< Peripheral ID Register, offset: 0xFD0 */ - __I uint32_t PERIPHID5; /**< Peripheral ID Register, offset: 0xFD4 */ - __I uint32_t PERIPHID6; /**< Peripheral ID Register, offset: 0xFD8 */ - __I uint32_t PERIPHID7; /**< Peripheral ID Register, offset: 0xFDC */ - __I uint32_t PERIPHID0; /**< Peripheral ID Register, offset: 0xFE0 */ - __I uint32_t PERIPHID1; /**< Peripheral ID Register, offset: 0xFE4 */ - __I uint32_t PERIPHID2; /**< Peripheral ID Register, offset: 0xFE8 */ - __I uint32_t PERIPHID3; /**< Peripheral ID Register, offset: 0xFEC */ - __I uint32_t COMPID[4]; /**< Component ID Register, array offset: 0xFF0, array step: 0x4 */ -} MTB_Type; - -/* ---------------------------------------------------------------------------- - -- MTB Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup MTB_Register_Masks MTB Register Masks - * @{ - */ - -/*! @name POSITION - MTB Position Register */ -/*! @{ */ - -#define MTB_POSITION_WRAP_MASK (0x4U) -#define MTB_POSITION_WRAP_SHIFT (2U) -/*! WRAP - WRAP */ -#define MTB_POSITION_WRAP(x) (((uint32_t)(((uint32_t)(x)) << MTB_POSITION_WRAP_SHIFT)) & MTB_POSITION_WRAP_MASK) - -#define MTB_POSITION_POINTER_MASK (0xFFFFFFF8U) -#define MTB_POSITION_POINTER_SHIFT (3U) -/*! POINTER - Trace Packet Address Pointer[28:0] */ -#define MTB_POSITION_POINTER(x) (((uint32_t)(((uint32_t)(x)) << MTB_POSITION_POINTER_SHIFT)) & MTB_POSITION_POINTER_MASK) -/*! @} */ - -/*! @name MASTER - MTB Master Register */ -/*! @{ */ - -#define MTB_MASTER_MASK_MASK (0x1FU) -#define MTB_MASTER_MASK_SHIFT (0U) -/*! MASK - Mask */ -#define MTB_MASTER_MASK(x) (((uint32_t)(((uint32_t)(x)) << MTB_MASTER_MASK_SHIFT)) & MTB_MASTER_MASK_MASK) - -#define MTB_MASTER_TSTARTEN_MASK (0x20U) -#define MTB_MASTER_TSTARTEN_SHIFT (5U) -/*! TSTARTEN - Trace Start Input Enable */ -#define MTB_MASTER_TSTARTEN(x) (((uint32_t)(((uint32_t)(x)) << MTB_MASTER_TSTARTEN_SHIFT)) & MTB_MASTER_TSTARTEN_MASK) - -#define MTB_MASTER_TSTOPEN_MASK (0x40U) -#define MTB_MASTER_TSTOPEN_SHIFT (6U) -/*! TSTOPEN - Trace Stop Input Enable */ -#define MTB_MASTER_TSTOPEN(x) (((uint32_t)(((uint32_t)(x)) << MTB_MASTER_TSTOPEN_SHIFT)) & MTB_MASTER_TSTOPEN_MASK) - -#define MTB_MASTER_SFRWPRIV_MASK (0x80U) -#define MTB_MASTER_SFRWPRIV_SHIFT (7U) -/*! SFRWPRIV - Special Function Register Write Privilege */ -#define MTB_MASTER_SFRWPRIV(x) (((uint32_t)(((uint32_t)(x)) << MTB_MASTER_SFRWPRIV_SHIFT)) & MTB_MASTER_SFRWPRIV_MASK) - -#define MTB_MASTER_RAMPRIV_MASK (0x100U) -#define MTB_MASTER_RAMPRIV_SHIFT (8U) -/*! RAMPRIV - RAM Privilege */ -#define MTB_MASTER_RAMPRIV(x) (((uint32_t)(((uint32_t)(x)) << MTB_MASTER_RAMPRIV_SHIFT)) & MTB_MASTER_RAMPRIV_MASK) - -#define MTB_MASTER_HALTREQ_MASK (0x200U) -#define MTB_MASTER_HALTREQ_SHIFT (9U) -/*! HALTREQ - Halt Request */ -#define MTB_MASTER_HALTREQ(x) (((uint32_t)(((uint32_t)(x)) << MTB_MASTER_HALTREQ_SHIFT)) & MTB_MASTER_HALTREQ_MASK) - -#define MTB_MASTER_EN_MASK (0x80000000U) -#define MTB_MASTER_EN_SHIFT (31U) -/*! EN - Main Trace Enable */ -#define MTB_MASTER_EN(x) (((uint32_t)(((uint32_t)(x)) << MTB_MASTER_EN_SHIFT)) & MTB_MASTER_EN_MASK) -/*! @} */ - -/*! @name FLOW - MTB Flow Register */ -/*! @{ */ - -#define MTB_FLOW_AUTOSTOP_MASK (0x1U) -#define MTB_FLOW_AUTOSTOP_SHIFT (0U) -/*! AUTOSTOP - AUTOSTOP */ -#define MTB_FLOW_AUTOSTOP(x) (((uint32_t)(((uint32_t)(x)) << MTB_FLOW_AUTOSTOP_SHIFT)) & MTB_FLOW_AUTOSTOP_MASK) - -#define MTB_FLOW_AUTOHALT_MASK (0x2U) -#define MTB_FLOW_AUTOHALT_SHIFT (1U) -/*! AUTOHALT - AUTOHALT */ -#define MTB_FLOW_AUTOHALT(x) (((uint32_t)(((uint32_t)(x)) << MTB_FLOW_AUTOHALT_SHIFT)) & MTB_FLOW_AUTOHALT_MASK) - -#define MTB_FLOW_WATERMARK_MASK (0xFFFFFFF8U) -#define MTB_FLOW_WATERMARK_SHIFT (3U) -/*! WATERMARK - WATERMARK[28:0] */ -#define MTB_FLOW_WATERMARK(x) (((uint32_t)(((uint32_t)(x)) << MTB_FLOW_WATERMARK_SHIFT)) & MTB_FLOW_WATERMARK_MASK) -/*! @} */ - -/*! @name BASE - MTB Base Register */ -/*! @{ */ - -#define MTB_BASE_BASEADDR_MASK (0xFFFFFFFFU) -#define MTB_BASE_BASEADDR_SHIFT (0U) -/*! BASEADDR - BASEADDR */ -#define MTB_BASE_BASEADDR(x) (((uint32_t)(((uint32_t)(x)) << MTB_BASE_BASEADDR_SHIFT)) & MTB_BASE_BASEADDR_MASK) -/*! @} */ - -/*! @name MODECTRL - Integration Mode Control Register */ -/*! @{ */ - -#define MTB_MODECTRL_MODECTRL_MASK (0xFFFFFFFFU) -#define MTB_MODECTRL_MODECTRL_SHIFT (0U) -/*! MODECTRL - MODECTRL */ -#define MTB_MODECTRL_MODECTRL(x) (((uint32_t)(((uint32_t)(x)) << MTB_MODECTRL_MODECTRL_SHIFT)) & MTB_MODECTRL_MODECTRL_MASK) -/*! @} */ - -/*! @name TAGSET - Claim TAG Set Register */ -/*! @{ */ - -#define MTB_TAGSET_TAGSET_MASK (0xFFFFFFFFU) -#define MTB_TAGSET_TAGSET_SHIFT (0U) -/*! TAGSET - TAGSET */ -#define MTB_TAGSET_TAGSET(x) (((uint32_t)(((uint32_t)(x)) << MTB_TAGSET_TAGSET_SHIFT)) & MTB_TAGSET_TAGSET_MASK) -/*! @} */ - -/*! @name TAGCLEAR - Claim TAG Clear Register */ -/*! @{ */ - -#define MTB_TAGCLEAR_TAGCLEAR_MASK (0xFFFFFFFFU) -#define MTB_TAGCLEAR_TAGCLEAR_SHIFT (0U) -/*! TAGCLEAR - TAGCLEAR */ -#define MTB_TAGCLEAR_TAGCLEAR(x) (((uint32_t)(((uint32_t)(x)) << MTB_TAGCLEAR_TAGCLEAR_SHIFT)) & MTB_TAGCLEAR_TAGCLEAR_MASK) -/*! @} */ - -/*! @name LOCKACCESS - Lock Access Register */ -/*! @{ */ - -#define MTB_LOCKACCESS_LOCKACCESS_MASK (0xFFFFFFFFU) -#define MTB_LOCKACCESS_LOCKACCESS_SHIFT (0U) -#define MTB_LOCKACCESS_LOCKACCESS(x) (((uint32_t)(((uint32_t)(x)) << MTB_LOCKACCESS_LOCKACCESS_SHIFT)) & MTB_LOCKACCESS_LOCKACCESS_MASK) -/*! @} */ - -/*! @name LOCKSTAT - Lock Status Register */ -/*! @{ */ - -#define MTB_LOCKSTAT_LOCKSTAT_MASK (0xFFFFFFFFU) -#define MTB_LOCKSTAT_LOCKSTAT_SHIFT (0U) -/*! LOCKSTAT - LOCKSTAT */ -#define MTB_LOCKSTAT_LOCKSTAT(x) (((uint32_t)(((uint32_t)(x)) << MTB_LOCKSTAT_LOCKSTAT_SHIFT)) & MTB_LOCKSTAT_LOCKSTAT_MASK) -/*! @} */ - -/*! @name AUTHSTAT - Authentication Status Register */ -/*! @{ */ - -#define MTB_AUTHSTAT_BIT0_MASK (0x1U) -#define MTB_AUTHSTAT_BIT0_SHIFT (0U) -#define MTB_AUTHSTAT_BIT0(x) (((uint32_t)(((uint32_t)(x)) << MTB_AUTHSTAT_BIT0_SHIFT)) & MTB_AUTHSTAT_BIT0_MASK) - -#define MTB_AUTHSTAT_BIT1_MASK (0x2U) -#define MTB_AUTHSTAT_BIT1_SHIFT (1U) -/*! BIT1 - BIT1 */ -#define MTB_AUTHSTAT_BIT1(x) (((uint32_t)(((uint32_t)(x)) << MTB_AUTHSTAT_BIT1_SHIFT)) & MTB_AUTHSTAT_BIT1_MASK) - -#define MTB_AUTHSTAT_BIT2_MASK (0x4U) -#define MTB_AUTHSTAT_BIT2_SHIFT (2U) -/*! BIT2 - BIT2 */ -#define MTB_AUTHSTAT_BIT2(x) (((uint32_t)(((uint32_t)(x)) << MTB_AUTHSTAT_BIT2_SHIFT)) & MTB_AUTHSTAT_BIT2_MASK) - -#define MTB_AUTHSTAT_BIT3_MASK (0x8U) -#define MTB_AUTHSTAT_BIT3_SHIFT (3U) -/*! BIT3 - BIT3 */ -#define MTB_AUTHSTAT_BIT3(x) (((uint32_t)(((uint32_t)(x)) << MTB_AUTHSTAT_BIT3_SHIFT)) & MTB_AUTHSTAT_BIT3_MASK) -/*! @} */ - -/*! @name DEVICEARCH - Device Architecture Register */ -/*! @{ */ - -#define MTB_DEVICEARCH_DEVICEARCH_MASK (0xFFFFFFFFU) -#define MTB_DEVICEARCH_DEVICEARCH_SHIFT (0U) -/*! DEVICEARCH - DEVICEARCH */ -#define MTB_DEVICEARCH_DEVICEARCH(x) (((uint32_t)(((uint32_t)(x)) << MTB_DEVICEARCH_DEVICEARCH_SHIFT)) & MTB_DEVICEARCH_DEVICEARCH_MASK) -/*! @} */ - -/*! @name DEVICECFG - Device Configuration Register */ -/*! @{ */ - -#define MTB_DEVICECFG_DEVICECFG_MASK (0xFFFFFFFFU) -#define MTB_DEVICECFG_DEVICECFG_SHIFT (0U) -/*! DEVICECFG - DEVICECFG */ -#define MTB_DEVICECFG_DEVICECFG(x) (((uint32_t)(((uint32_t)(x)) << MTB_DEVICECFG_DEVICECFG_SHIFT)) & MTB_DEVICECFG_DEVICECFG_MASK) -/*! @} */ - -/*! @name DEVICETYPID - Device Type Identifier Register */ -/*! @{ */ - -#define MTB_DEVICETYPID_DEVICETYPID_MASK (0xFFFFFFFFU) -#define MTB_DEVICETYPID_DEVICETYPID_SHIFT (0U) -/*! DEVICETYPID - DEVICETYPID */ -#define MTB_DEVICETYPID_DEVICETYPID(x) (((uint32_t)(((uint32_t)(x)) << MTB_DEVICETYPID_DEVICETYPID_SHIFT)) & MTB_DEVICETYPID_DEVICETYPID_MASK) -/*! @} */ - -/*! @name PERIPHID4 - Peripheral ID Register */ -/*! @{ */ - -#define MTB_PERIPHID4_PERIPHID_MASK (0xFFFFFFFFU) -#define MTB_PERIPHID4_PERIPHID_SHIFT (0U) -/*! PERIPHID - PERIPHID */ -#define MTB_PERIPHID4_PERIPHID(x) (((uint32_t)(((uint32_t)(x)) << MTB_PERIPHID4_PERIPHID_SHIFT)) & MTB_PERIPHID4_PERIPHID_MASK) -/*! @} */ - -/*! @name PERIPHID5 - Peripheral ID Register */ -/*! @{ */ - -#define MTB_PERIPHID5_PERIPHID_MASK (0xFFFFFFFFU) -#define MTB_PERIPHID5_PERIPHID_SHIFT (0U) -/*! PERIPHID - PERIPHID */ -#define MTB_PERIPHID5_PERIPHID(x) (((uint32_t)(((uint32_t)(x)) << MTB_PERIPHID5_PERIPHID_SHIFT)) & MTB_PERIPHID5_PERIPHID_MASK) -/*! @} */ - -/*! @name PERIPHID6 - Peripheral ID Register */ -/*! @{ */ - -#define MTB_PERIPHID6_PERIPHID_MASK (0xFFFFFFFFU) -#define MTB_PERIPHID6_PERIPHID_SHIFT (0U) -/*! PERIPHID - PERIPHID */ -#define MTB_PERIPHID6_PERIPHID(x) (((uint32_t)(((uint32_t)(x)) << MTB_PERIPHID6_PERIPHID_SHIFT)) & MTB_PERIPHID6_PERIPHID_MASK) -/*! @} */ - -/*! @name PERIPHID7 - Peripheral ID Register */ -/*! @{ */ - -#define MTB_PERIPHID7_PERIPHID_MASK (0xFFFFFFFFU) -#define MTB_PERIPHID7_PERIPHID_SHIFT (0U) -/*! PERIPHID - PERIPHID */ -#define MTB_PERIPHID7_PERIPHID(x) (((uint32_t)(((uint32_t)(x)) << MTB_PERIPHID7_PERIPHID_SHIFT)) & MTB_PERIPHID7_PERIPHID_MASK) -/*! @} */ - -/*! @name PERIPHID0 - Peripheral ID Register */ -/*! @{ */ - -#define MTB_PERIPHID0_PERIPHID_MASK (0xFFFFFFFFU) -#define MTB_PERIPHID0_PERIPHID_SHIFT (0U) -/*! PERIPHID - PERIPHID */ -#define MTB_PERIPHID0_PERIPHID(x) (((uint32_t)(((uint32_t)(x)) << MTB_PERIPHID0_PERIPHID_SHIFT)) & MTB_PERIPHID0_PERIPHID_MASK) -/*! @} */ - -/*! @name PERIPHID1 - Peripheral ID Register */ -/*! @{ */ - -#define MTB_PERIPHID1_PERIPHID_MASK (0xFFFFFFFFU) -#define MTB_PERIPHID1_PERIPHID_SHIFT (0U) -/*! PERIPHID - PERIPHID */ -#define MTB_PERIPHID1_PERIPHID(x) (((uint32_t)(((uint32_t)(x)) << MTB_PERIPHID1_PERIPHID_SHIFT)) & MTB_PERIPHID1_PERIPHID_MASK) -/*! @} */ - -/*! @name PERIPHID2 - Peripheral ID Register */ -/*! @{ */ - -#define MTB_PERIPHID2_PERIPHID_MASK (0xFFFFFFFFU) -#define MTB_PERIPHID2_PERIPHID_SHIFT (0U) -/*! PERIPHID - PERIPHID */ -#define MTB_PERIPHID2_PERIPHID(x) (((uint32_t)(((uint32_t)(x)) << MTB_PERIPHID2_PERIPHID_SHIFT)) & MTB_PERIPHID2_PERIPHID_MASK) -/*! @} */ - -/*! @name PERIPHID3 - Peripheral ID Register */ -/*! @{ */ - -#define MTB_PERIPHID3_PERIPHID_MASK (0xFFFFFFFFU) -#define MTB_PERIPHID3_PERIPHID_SHIFT (0U) -/*! PERIPHID - PERIPHID */ -#define MTB_PERIPHID3_PERIPHID(x) (((uint32_t)(((uint32_t)(x)) << MTB_PERIPHID3_PERIPHID_SHIFT)) & MTB_PERIPHID3_PERIPHID_MASK) -/*! @} */ - -/*! @name COMPID - Component ID Register */ -/*! @{ */ - -#define MTB_COMPID_COMPID_MASK (0xFFFFFFFFU) -#define MTB_COMPID_COMPID_SHIFT (0U) -/*! COMPID - Component ID */ -#define MTB_COMPID_COMPID(x) (((uint32_t)(((uint32_t)(x)) << MTB_COMPID_COMPID_SHIFT)) & MTB_COMPID_COMPID_MASK) -/*! @} */ - -/* The count of MTB_COMPID */ -#define MTB_COMPID_COUNT (4U) - - -/*! - * @} - */ /* end of group MTB_Register_Masks */ - - -/* MTB - Peripheral instance base addresses */ -/** Peripheral MTB base address */ -#define MTB_BASE (0xF0000000u) -/** Peripheral MTB base pointer */ -#define MTB ((MTB_Type *)MTB_BASE) -/** Array initializer of MTB peripheral base addresses */ -#define MTB_BASE_ADDRS { MTB_BASE } -/** Array initializer of MTB peripheral base pointers */ -#define MTB_BASE_PTRS { MTB } - -/*! - * @} - */ /* end of group MTB_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- MTBDWT Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup MTBDWT_Peripheral_Access_Layer MTBDWT Peripheral Access Layer - * @{ - */ - -/** MTBDWT - Register Layout Typedef */ -typedef struct { - __I uint32_t CTRL; /**< MTB DWT Control Register, offset: 0x0 */ - uint8_t RESERVED_0[28]; - struct { /* offset: 0x20, array step: 0x10 */ - __IO uint32_t COMP; /**< MTB_DWT Comparator Register, array offset: 0x20, array step: 0x10 */ - __IO uint32_t MASK; /**< MTB_DWT Comparator Mask Register, array offset: 0x24, array step: 0x10 */ - __IO uint32_t FCT; /**< MTB_DWT Comparator Function Register 0..MTB_DWT Comparator Function Register 1, array offset: 0x28, array step: 0x10 */ - uint8_t RESERVED_0[4]; - } COMPARATOR[2]; - uint8_t RESERVED_1[448]; - __IO uint32_t TBCTRL; /**< MTB_DWT Trace Buffer Control Register, offset: 0x200 */ - uint8_t RESERVED_2[3524]; - __I uint32_t DEVICECFG; /**< Device Configuration Register, offset: 0xFC8 */ - __I uint32_t DEVICETYPID; /**< Device Type Identifier Register, offset: 0xFCC */ - __I uint32_t PERIPHID4; /**< Peripheral ID Register, offset: 0xFD0 */ - __I uint32_t PERIPHID5; /**< Peripheral ID Register, offset: 0xFD4 */ - __I uint32_t PERIPHID6; /**< Peripheral ID Register, offset: 0xFD8 */ - __I uint32_t PERIPHID7; /**< Peripheral ID Register, offset: 0xFDC */ - __I uint32_t PERIPHID0; /**< Peripheral ID Register, offset: 0xFE0 */ - __I uint32_t PERIPHID1; /**< Peripheral ID Register, offset: 0xFE4 */ - __I uint32_t PERIPHID2; /**< Peripheral ID Register, offset: 0xFE8 */ - __I uint32_t PERIPHID3; /**< Peripheral ID Register, offset: 0xFEC */ - __I uint32_t COMPID[4]; /**< Component ID Register, array offset: 0xFF0, array step: 0x4 */ -} MTBDWT_Type; - -/* ---------------------------------------------------------------------------- - -- MTBDWT Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup MTBDWT_Register_Masks MTBDWT Register Masks - * @{ - */ - -/*! @name CTRL - MTB DWT Control Register */ -/*! @{ */ - -#define MTBDWT_CTRL_DWTCFGCTRL_MASK (0xFFFFFFFU) -#define MTBDWT_CTRL_DWTCFGCTRL_SHIFT (0U) -/*! DWTCFGCTRL - DWT configuration controls */ -#define MTBDWT_CTRL_DWTCFGCTRL(x) (((uint32_t)(((uint32_t)(x)) << MTBDWT_CTRL_DWTCFGCTRL_SHIFT)) & MTBDWT_CTRL_DWTCFGCTRL_MASK) - -#define MTBDWT_CTRL_NUMCMP_MASK (0xF0000000U) -#define MTBDWT_CTRL_NUMCMP_SHIFT (28U) -/*! NUMCMP - Number of comparators */ -#define MTBDWT_CTRL_NUMCMP(x) (((uint32_t)(((uint32_t)(x)) << MTBDWT_CTRL_NUMCMP_SHIFT)) & MTBDWT_CTRL_NUMCMP_MASK) -/*! @} */ - -/*! @name COMP - MTB_DWT Comparator Register */ -/*! @{ */ - -#define MTBDWT_COMP_COMP_MASK (0xFFFFFFFFU) -#define MTBDWT_COMP_COMP_SHIFT (0U) -/*! COMP - Reference value for comparison */ -#define MTBDWT_COMP_COMP(x) (((uint32_t)(((uint32_t)(x)) << MTBDWT_COMP_COMP_SHIFT)) & MTBDWT_COMP_COMP_MASK) -/*! @} */ - -/* The count of MTBDWT_COMP */ -#define MTBDWT_COMP_COUNT (2U) - -/*! @name MASK - MTB_DWT Comparator Mask Register */ -/*! @{ */ - -#define MTBDWT_MASK_MASK_MASK (0x1FU) -#define MTBDWT_MASK_MASK_SHIFT (0U) -/*! MASK - MASK */ -#define MTBDWT_MASK_MASK(x) (((uint32_t)(((uint32_t)(x)) << MTBDWT_MASK_MASK_SHIFT)) & MTBDWT_MASK_MASK_MASK) -/*! @} */ - -/* The count of MTBDWT_MASK */ -#define MTBDWT_MASK_COUNT (2U) - -/*! @name FCT - MTB_DWT Comparator Function Register 0..MTB_DWT Comparator Function Register 1 */ -/*! @{ */ - -#define MTBDWT_FCT_FUNCTION_MASK (0xFU) -#define MTBDWT_FCT_FUNCTION_SHIFT (0U) -/*! FUNCTION - Function - * 0b0000..Disabled. - * 0b0100..Instruction fetch. - * 0b0101..Data operand read. - * 0b0110..Data operand write. - * 0b0111..Data operand (read + write). - */ -#define MTBDWT_FCT_FUNCTION(x) (((uint32_t)(((uint32_t)(x)) << MTBDWT_FCT_FUNCTION_SHIFT)) & MTBDWT_FCT_FUNCTION_MASK) - -#define MTBDWT_FCT_DATAVMATCH_MASK (0x100U) -#define MTBDWT_FCT_DATAVMATCH_SHIFT (8U) -/*! DATAVMATCH - Data Value Match - * 0b0..Perform address comparison. - * 0b1..Perform data value comparison. - */ -#define MTBDWT_FCT_DATAVMATCH(x) (((uint32_t)(((uint32_t)(x)) << MTBDWT_FCT_DATAVMATCH_SHIFT)) & MTBDWT_FCT_DATAVMATCH_MASK) - -#define MTBDWT_FCT_DATAVSIZE_MASK (0xC00U) -#define MTBDWT_FCT_DATAVSIZE_SHIFT (10U) -/*! DATAVSIZE - Data Value Size - * 0b00..Byte. - * 0b01..Halfword. - * 0b10..Word. - * 0b11..Reserved. Any attempts to use this value results in UNPREDICTABLE behavior. - */ -#define MTBDWT_FCT_DATAVSIZE(x) (((uint32_t)(((uint32_t)(x)) << MTBDWT_FCT_DATAVSIZE_SHIFT)) & MTBDWT_FCT_DATAVSIZE_MASK) - -#define MTBDWT_FCT_DATAVADDR0_MASK (0xF000U) -#define MTBDWT_FCT_DATAVADDR0_SHIFT (12U) -/*! DATAVADDR0 - Data Value Address 0 */ -#define MTBDWT_FCT_DATAVADDR0(x) (((uint32_t)(((uint32_t)(x)) << MTBDWT_FCT_DATAVADDR0_SHIFT)) & MTBDWT_FCT_DATAVADDR0_MASK) - -#define MTBDWT_FCT_MATCHED_MASK (0x1000000U) -#define MTBDWT_FCT_MATCHED_SHIFT (24U) -/*! MATCHED - Comparator match - * 0b0..No match. - * 0b1..Match occurred. - */ -#define MTBDWT_FCT_MATCHED(x) (((uint32_t)(((uint32_t)(x)) << MTBDWT_FCT_MATCHED_SHIFT)) & MTBDWT_FCT_MATCHED_MASK) -/*! @} */ - -/* The count of MTBDWT_FCT */ -#define MTBDWT_FCT_COUNT (2U) - -/*! @name TBCTRL - MTB_DWT Trace Buffer Control Register */ -/*! @{ */ - -#define MTBDWT_TBCTRL_ACOMP0_MASK (0x1U) -#define MTBDWT_TBCTRL_ACOMP0_SHIFT (0U) -/*! ACOMP0 - Action based on Comparator 0 match - * 0b0..Trigger TSTOP based on the assertion of MTBDWT_FCT0[MATCHED]. - * 0b1..Trigger TSTART based on the assertion of MTBDWT_FCT0[MATCHED]. - */ -#define MTBDWT_TBCTRL_ACOMP0(x) (((uint32_t)(((uint32_t)(x)) << MTBDWT_TBCTRL_ACOMP0_SHIFT)) & MTBDWT_TBCTRL_ACOMP0_MASK) - -#define MTBDWT_TBCTRL_ACOMP1_MASK (0x2U) -#define MTBDWT_TBCTRL_ACOMP1_SHIFT (1U) -/*! ACOMP1 - Action based on Comparator 1 match - * 0b0..Trigger TSTOP based on the assertion of MTBDWT_FCT1[MATCHED]. - * 0b1..Trigger TSTART based on the assertion of MTBDWT_FCT1[MATCHED]. - */ -#define MTBDWT_TBCTRL_ACOMP1(x) (((uint32_t)(((uint32_t)(x)) << MTBDWT_TBCTRL_ACOMP1_SHIFT)) & MTBDWT_TBCTRL_ACOMP1_MASK) - -#define MTBDWT_TBCTRL_NUMCOMP_MASK (0xF0000000U) -#define MTBDWT_TBCTRL_NUMCOMP_SHIFT (28U) -/*! NUMCOMP - Number of Comparators */ -#define MTBDWT_TBCTRL_NUMCOMP(x) (((uint32_t)(((uint32_t)(x)) << MTBDWT_TBCTRL_NUMCOMP_SHIFT)) & MTBDWT_TBCTRL_NUMCOMP_MASK) -/*! @} */ - -/*! @name DEVICECFG - Device Configuration Register */ -/*! @{ */ - -#define MTBDWT_DEVICECFG_DEVICECFG_MASK (0xFFFFFFFFU) -#define MTBDWT_DEVICECFG_DEVICECFG_SHIFT (0U) -/*! DEVICECFG - DEVICECFG */ -#define MTBDWT_DEVICECFG_DEVICECFG(x) (((uint32_t)(((uint32_t)(x)) << MTBDWT_DEVICECFG_DEVICECFG_SHIFT)) & MTBDWT_DEVICECFG_DEVICECFG_MASK) -/*! @} */ - -/*! @name DEVICETYPID - Device Type Identifier Register */ -/*! @{ */ - -#define MTBDWT_DEVICETYPID_DEVICETYPID_MASK (0xFFFFFFFFU) -#define MTBDWT_DEVICETYPID_DEVICETYPID_SHIFT (0U) -/*! DEVICETYPID - DEVICETYPID */ -#define MTBDWT_DEVICETYPID_DEVICETYPID(x) (((uint32_t)(((uint32_t)(x)) << MTBDWT_DEVICETYPID_DEVICETYPID_SHIFT)) & MTBDWT_DEVICETYPID_DEVICETYPID_MASK) -/*! @} */ - -/*! @name PERIPHID4 - Peripheral ID Register */ -/*! @{ */ - -#define MTBDWT_PERIPHID4_PERIPHID_MASK (0xFFFFFFFFU) -#define MTBDWT_PERIPHID4_PERIPHID_SHIFT (0U) -/*! PERIPHID - PERIPHID */ -#define MTBDWT_PERIPHID4_PERIPHID(x) (((uint32_t)(((uint32_t)(x)) << MTBDWT_PERIPHID4_PERIPHID_SHIFT)) & MTBDWT_PERIPHID4_PERIPHID_MASK) -/*! @} */ - -/*! @name PERIPHID5 - Peripheral ID Register */ -/*! @{ */ - -#define MTBDWT_PERIPHID5_PERIPHID_MASK (0xFFFFFFFFU) -#define MTBDWT_PERIPHID5_PERIPHID_SHIFT (0U) -/*! PERIPHID - PERIPHID */ -#define MTBDWT_PERIPHID5_PERIPHID(x) (((uint32_t)(((uint32_t)(x)) << MTBDWT_PERIPHID5_PERIPHID_SHIFT)) & MTBDWT_PERIPHID5_PERIPHID_MASK) -/*! @} */ - -/*! @name PERIPHID6 - Peripheral ID Register */ -/*! @{ */ - -#define MTBDWT_PERIPHID6_PERIPHID_MASK (0xFFFFFFFFU) -#define MTBDWT_PERIPHID6_PERIPHID_SHIFT (0U) -/*! PERIPHID - PERIPHID */ -#define MTBDWT_PERIPHID6_PERIPHID(x) (((uint32_t)(((uint32_t)(x)) << MTBDWT_PERIPHID6_PERIPHID_SHIFT)) & MTBDWT_PERIPHID6_PERIPHID_MASK) -/*! @} */ - -/*! @name PERIPHID7 - Peripheral ID Register */ -/*! @{ */ - -#define MTBDWT_PERIPHID7_PERIPHID_MASK (0xFFFFFFFFU) -#define MTBDWT_PERIPHID7_PERIPHID_SHIFT (0U) -/*! PERIPHID - PERIPHID */ -#define MTBDWT_PERIPHID7_PERIPHID(x) (((uint32_t)(((uint32_t)(x)) << MTBDWT_PERIPHID7_PERIPHID_SHIFT)) & MTBDWT_PERIPHID7_PERIPHID_MASK) -/*! @} */ - -/*! @name PERIPHID0 - Peripheral ID Register */ -/*! @{ */ - -#define MTBDWT_PERIPHID0_PERIPHID_MASK (0xFFFFFFFFU) -#define MTBDWT_PERIPHID0_PERIPHID_SHIFT (0U) -/*! PERIPHID - PERIPHID */ -#define MTBDWT_PERIPHID0_PERIPHID(x) (((uint32_t)(((uint32_t)(x)) << MTBDWT_PERIPHID0_PERIPHID_SHIFT)) & MTBDWT_PERIPHID0_PERIPHID_MASK) -/*! @} */ - -/*! @name PERIPHID1 - Peripheral ID Register */ -/*! @{ */ - -#define MTBDWT_PERIPHID1_PERIPHID_MASK (0xFFFFFFFFU) -#define MTBDWT_PERIPHID1_PERIPHID_SHIFT (0U) -/*! PERIPHID - PERIPHID */ -#define MTBDWT_PERIPHID1_PERIPHID(x) (((uint32_t)(((uint32_t)(x)) << MTBDWT_PERIPHID1_PERIPHID_SHIFT)) & MTBDWT_PERIPHID1_PERIPHID_MASK) -/*! @} */ - -/*! @name PERIPHID2 - Peripheral ID Register */ -/*! @{ */ - -#define MTBDWT_PERIPHID2_PERIPHID_MASK (0xFFFFFFFFU) -#define MTBDWT_PERIPHID2_PERIPHID_SHIFT (0U) -/*! PERIPHID - PERIPHID */ -#define MTBDWT_PERIPHID2_PERIPHID(x) (((uint32_t)(((uint32_t)(x)) << MTBDWT_PERIPHID2_PERIPHID_SHIFT)) & MTBDWT_PERIPHID2_PERIPHID_MASK) -/*! @} */ - -/*! @name PERIPHID3 - Peripheral ID Register */ -/*! @{ */ - -#define MTBDWT_PERIPHID3_PERIPHID_MASK (0xFFFFFFFFU) -#define MTBDWT_PERIPHID3_PERIPHID_SHIFT (0U) -/*! PERIPHID - PERIPHID */ -#define MTBDWT_PERIPHID3_PERIPHID(x) (((uint32_t)(((uint32_t)(x)) << MTBDWT_PERIPHID3_PERIPHID_SHIFT)) & MTBDWT_PERIPHID3_PERIPHID_MASK) -/*! @} */ - -/*! @name COMPID - Component ID Register */ -/*! @{ */ - -#define MTBDWT_COMPID_COMPID_MASK (0xFFFFFFFFU) -#define MTBDWT_COMPID_COMPID_SHIFT (0U) -/*! COMPID - Component ID */ -#define MTBDWT_COMPID_COMPID(x) (((uint32_t)(((uint32_t)(x)) << MTBDWT_COMPID_COMPID_SHIFT)) & MTBDWT_COMPID_COMPID_MASK) -/*! @} */ - -/* The count of MTBDWT_COMPID */ -#define MTBDWT_COMPID_COUNT (4U) - - -/*! - * @} - */ /* end of group MTBDWT_Register_Masks */ - - -/* MTBDWT - Peripheral instance base addresses */ -/** Peripheral MTBDWT base address */ -#define MTBDWT_BASE (0xF0001000u) -/** Peripheral MTBDWT base pointer */ -#define MTBDWT ((MTBDWT_Type *)MTBDWT_BASE) -/** Array initializer of MTBDWT peripheral base addresses */ -#define MTBDWT_BASE_ADDRS { MTBDWT_BASE } -/** Array initializer of MTBDWT peripheral base pointers */ -#define MTBDWT_BASE_PTRS { MTBDWT } - -/*! - * @} - */ /* end of group MTBDWT_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- NV Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup NV_Peripheral_Access_Layer NV Peripheral Access Layer - * @{ - */ - -/** NV - Register Layout Typedef */ -typedef struct { - __I uint8_t BACKKEY3; /**< Backdoor Comparison Key 3., offset: 0x0 */ - __I uint8_t BACKKEY2; /**< Backdoor Comparison Key 2., offset: 0x1 */ - __I uint8_t BACKKEY1; /**< Backdoor Comparison Key 1., offset: 0x2 */ - __I uint8_t BACKKEY0; /**< Backdoor Comparison Key 0., offset: 0x3 */ - __I uint8_t BACKKEY7; /**< Backdoor Comparison Key 7., offset: 0x4 */ - __I uint8_t BACKKEY6; /**< Backdoor Comparison Key 6., offset: 0x5 */ - __I uint8_t BACKKEY5; /**< Backdoor Comparison Key 5., offset: 0x6 */ - __I uint8_t BACKKEY4; /**< Backdoor Comparison Key 4., offset: 0x7 */ - __I uint8_t FPROT3; /**< Non-volatile P-Flash Protection 1 - Low Register, offset: 0x8 */ - __I uint8_t FPROT2; /**< Non-volatile P-Flash Protection 1 - High Register, offset: 0x9 */ - __I uint8_t FPROT1; /**< Non-volatile P-Flash Protection 0 - Low Register, offset: 0xA */ - __I uint8_t FPROT0; /**< Non-volatile P-Flash Protection 0 - High Register, offset: 0xB */ - __I uint8_t FSEC; /**< Non-volatile Flash Security Register, offset: 0xC */ - __I uint8_t FOPT; /**< Non-volatile Flash Option Register, offset: 0xD */ -} NV_Type; - -/* ---------------------------------------------------------------------------- - -- NV Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup NV_Register_Masks NV Register Masks - * @{ - */ - -/*! @name BACKKEY3 - Backdoor Comparison Key 3. */ -/*! @{ */ - -#define NV_BACKKEY3_KEY_MASK (0xFFU) -#define NV_BACKKEY3_KEY_SHIFT (0U) -/*! KEY - Backdoor Comparison Key. */ -#define NV_BACKKEY3_KEY(x) (((uint8_t)(((uint8_t)(x)) << NV_BACKKEY3_KEY_SHIFT)) & NV_BACKKEY3_KEY_MASK) -/*! @} */ - -/*! @name BACKKEY2 - Backdoor Comparison Key 2. */ -/*! @{ */ - -#define NV_BACKKEY2_KEY_MASK (0xFFU) -#define NV_BACKKEY2_KEY_SHIFT (0U) -/*! KEY - Backdoor Comparison Key. */ -#define NV_BACKKEY2_KEY(x) (((uint8_t)(((uint8_t)(x)) << NV_BACKKEY2_KEY_SHIFT)) & NV_BACKKEY2_KEY_MASK) -/*! @} */ - -/*! @name BACKKEY1 - Backdoor Comparison Key 1. */ -/*! @{ */ - -#define NV_BACKKEY1_KEY_MASK (0xFFU) -#define NV_BACKKEY1_KEY_SHIFT (0U) -/*! KEY - Backdoor Comparison Key. */ -#define NV_BACKKEY1_KEY(x) (((uint8_t)(((uint8_t)(x)) << NV_BACKKEY1_KEY_SHIFT)) & NV_BACKKEY1_KEY_MASK) -/*! @} */ - -/*! @name BACKKEY0 - Backdoor Comparison Key 0. */ -/*! @{ */ - -#define NV_BACKKEY0_KEY_MASK (0xFFU) -#define NV_BACKKEY0_KEY_SHIFT (0U) -/*! KEY - Backdoor Comparison Key. */ -#define NV_BACKKEY0_KEY(x) (((uint8_t)(((uint8_t)(x)) << NV_BACKKEY0_KEY_SHIFT)) & NV_BACKKEY0_KEY_MASK) -/*! @} */ - -/*! @name BACKKEY7 - Backdoor Comparison Key 7. */ -/*! @{ */ - -#define NV_BACKKEY7_KEY_MASK (0xFFU) -#define NV_BACKKEY7_KEY_SHIFT (0U) -/*! KEY - Backdoor Comparison Key. */ -#define NV_BACKKEY7_KEY(x) (((uint8_t)(((uint8_t)(x)) << NV_BACKKEY7_KEY_SHIFT)) & NV_BACKKEY7_KEY_MASK) -/*! @} */ - -/*! @name BACKKEY6 - Backdoor Comparison Key 6. */ -/*! @{ */ - -#define NV_BACKKEY6_KEY_MASK (0xFFU) -#define NV_BACKKEY6_KEY_SHIFT (0U) -/*! KEY - Backdoor Comparison Key. */ -#define NV_BACKKEY6_KEY(x) (((uint8_t)(((uint8_t)(x)) << NV_BACKKEY6_KEY_SHIFT)) & NV_BACKKEY6_KEY_MASK) -/*! @} */ - -/*! @name BACKKEY5 - Backdoor Comparison Key 5. */ -/*! @{ */ - -#define NV_BACKKEY5_KEY_MASK (0xFFU) -#define NV_BACKKEY5_KEY_SHIFT (0U) -/*! KEY - Backdoor Comparison Key. */ -#define NV_BACKKEY5_KEY(x) (((uint8_t)(((uint8_t)(x)) << NV_BACKKEY5_KEY_SHIFT)) & NV_BACKKEY5_KEY_MASK) -/*! @} */ - -/*! @name BACKKEY4 - Backdoor Comparison Key 4. */ -/*! @{ */ - -#define NV_BACKKEY4_KEY_MASK (0xFFU) -#define NV_BACKKEY4_KEY_SHIFT (0U) -/*! KEY - Backdoor Comparison Key. */ -#define NV_BACKKEY4_KEY(x) (((uint8_t)(((uint8_t)(x)) << NV_BACKKEY4_KEY_SHIFT)) & NV_BACKKEY4_KEY_MASK) -/*! @} */ - -/*! @name FPROT3 - Non-volatile P-Flash Protection 1 - Low Register */ -/*! @{ */ - -#define NV_FPROT3_PROT_MASK (0xFFU) -#define NV_FPROT3_PROT_SHIFT (0U) -/*! PROT - P-Flash Region Protect */ -#define NV_FPROT3_PROT(x) (((uint8_t)(((uint8_t)(x)) << NV_FPROT3_PROT_SHIFT)) & NV_FPROT3_PROT_MASK) -/*! @} */ - -/*! @name FPROT2 - Non-volatile P-Flash Protection 1 - High Register */ -/*! @{ */ - -#define NV_FPROT2_PROT_MASK (0xFFU) -#define NV_FPROT2_PROT_SHIFT (0U) -/*! PROT - P-Flash Region Protect */ -#define NV_FPROT2_PROT(x) (((uint8_t)(((uint8_t)(x)) << NV_FPROT2_PROT_SHIFT)) & NV_FPROT2_PROT_MASK) -/*! @} */ - -/*! @name FPROT1 - Non-volatile P-Flash Protection 0 - Low Register */ -/*! @{ */ - -#define NV_FPROT1_PROT_MASK (0xFFU) -#define NV_FPROT1_PROT_SHIFT (0U) -/*! PROT - P-Flash Region Protect */ -#define NV_FPROT1_PROT(x) (((uint8_t)(((uint8_t)(x)) << NV_FPROT1_PROT_SHIFT)) & NV_FPROT1_PROT_MASK) -/*! @} */ - -/*! @name FPROT0 - Non-volatile P-Flash Protection 0 - High Register */ -/*! @{ */ - -#define NV_FPROT0_PROT_MASK (0xFFU) -#define NV_FPROT0_PROT_SHIFT (0U) -/*! PROT - P-Flash Region Protect */ -#define NV_FPROT0_PROT(x) (((uint8_t)(((uint8_t)(x)) << NV_FPROT0_PROT_SHIFT)) & NV_FPROT0_PROT_MASK) -/*! @} */ - -/*! @name FSEC - Non-volatile Flash Security Register */ -/*! @{ */ - -#define NV_FSEC_SEC_MASK (0x3U) -#define NV_FSEC_SEC_SHIFT (0U) -/*! SEC - Flash Security - * 0b10..MCU security status is unsecure - * 0b11..MCU security status is secure - */ -#define NV_FSEC_SEC(x) (((uint8_t)(((uint8_t)(x)) << NV_FSEC_SEC_SHIFT)) & NV_FSEC_SEC_MASK) - -#define NV_FSEC_FSLACC_MASK (0xCU) -#define NV_FSEC_FSLACC_SHIFT (2U) -/*! FSLACC - Freescale Failure Analysis Access Code - * 0b10..Freescale factory access denied - * 0b11..Freescale factory access granted - */ -#define NV_FSEC_FSLACC(x) (((uint8_t)(((uint8_t)(x)) << NV_FSEC_FSLACC_SHIFT)) & NV_FSEC_FSLACC_MASK) - -#define NV_FSEC_MEEN_MASK (0x30U) -#define NV_FSEC_MEEN_SHIFT (4U) -/*! MEEN - * 0b10..Mass erase is disabled - * 0b11..Mass erase is enabled - */ -#define NV_FSEC_MEEN(x) (((uint8_t)(((uint8_t)(x)) << NV_FSEC_MEEN_SHIFT)) & NV_FSEC_MEEN_MASK) - -#define NV_FSEC_KEYEN_MASK (0xC0U) -#define NV_FSEC_KEYEN_SHIFT (6U) -/*! KEYEN - Backdoor Key Security Enable - * 0b10..Backdoor key access enabled - * 0b11..Backdoor key access disabled - */ -#define NV_FSEC_KEYEN(x) (((uint8_t)(((uint8_t)(x)) << NV_FSEC_KEYEN_SHIFT)) & NV_FSEC_KEYEN_MASK) -/*! @} */ - -/*! @name FOPT - Non-volatile Flash Option Register */ -/*! @{ */ - -#define NV_FOPT_LPBOOT0_MASK (0x1U) -#define NV_FOPT_LPBOOT0_SHIFT (0U) -/*! LPBOOT0 - * 0b0..Core and system clock divider (OUTDIV1) is 0x7 (divide by 8) when LPBOOT1=0 or 0x1 (divide by 2) when LPBOOT1=1. - * 0b1..Core and system clock divider (OUTDIV1) is 0x3 (divide by 4) when LPBOOT1=0 or 0x0 (divide by 1) when LPBOOT1=1. - */ -#define NV_FOPT_LPBOOT0(x) (((uint8_t)(((uint8_t)(x)) << NV_FOPT_LPBOOT0_SHIFT)) & NV_FOPT_LPBOOT0_MASK) - -#define NV_FOPT_BOOTPIN_OPT_MASK (0x2U) -#define NV_FOPT_BOOTPIN_OPT_SHIFT (1U) -/*! BOOTPIN_OPT - * 0b0..Force Boot from ROM if BOOTCFG0 asserted, where BOOTCFG0 is the boot config function which is muxed with NMI pin - * 0b1..Boot source configured by FOPT (BOOTSRC_SEL) bits - */ -#define NV_FOPT_BOOTPIN_OPT(x) (((uint8_t)(((uint8_t)(x)) << NV_FOPT_BOOTPIN_OPT_SHIFT)) & NV_FOPT_BOOTPIN_OPT_MASK) - -#define NV_FOPT_NMI_DIS_MASK (0x4U) -#define NV_FOPT_NMI_DIS_SHIFT (2U) -/*! NMI_DIS - * 0b0..NMI interrupts are always blocked - * 0b1..NMI_b pin/interrupts reset default to enabled - */ -#define NV_FOPT_NMI_DIS(x) (((uint8_t)(((uint8_t)(x)) << NV_FOPT_NMI_DIS_SHIFT)) & NV_FOPT_NMI_DIS_MASK) - -#define NV_FOPT_RESET_PIN_CFG_MASK (0x8U) -#define NV_FOPT_RESET_PIN_CFG_SHIFT (3U) -/*! RESET_PIN_CFG - * 0b0..RESET pin is disabled following a POR and cannot be enabled as reset function - * 0b1..RESET_b pin is dedicated - */ -#define NV_FOPT_RESET_PIN_CFG(x) (((uint8_t)(((uint8_t)(x)) << NV_FOPT_RESET_PIN_CFG_SHIFT)) & NV_FOPT_RESET_PIN_CFG_MASK) - -#define NV_FOPT_LPBOOT1_MASK (0x10U) -#define NV_FOPT_LPBOOT1_SHIFT (4U) -/*! LPBOOT1 - * 0b0..Core and system clock divider (OUTDIV1) is 0x7 (divide by 8) when LPBOOT0=0 or 0x3 (divide by 4) when LPBOOT0=1. - * 0b1..Core and system clock divider (OUTDIV1) is 0x1 (divide by 2) when LPBOOT0=0 or 0x0 (divide by 1) when LPBOOT0=1. - */ -#define NV_FOPT_LPBOOT1(x) (((uint8_t)(((uint8_t)(x)) << NV_FOPT_LPBOOT1_SHIFT)) & NV_FOPT_LPBOOT1_MASK) - -#define NV_FOPT_FAST_INIT_MASK (0x20U) -#define NV_FOPT_FAST_INIT_SHIFT (5U) -/*! FAST_INIT - * 0b0..Slower initialization - * 0b1..Fast Initialization - */ -#define NV_FOPT_FAST_INIT(x) (((uint8_t)(((uint8_t)(x)) << NV_FOPT_FAST_INIT_SHIFT)) & NV_FOPT_FAST_INIT_MASK) - -#define NV_FOPT_BOOTSRC_SEL_MASK (0xC0U) -#define NV_FOPT_BOOTSRC_SEL_SHIFT (6U) -/*! BOOTSRC_SEL - Boot source selection - * 0b00..Boot from Flash - * 0b10..Boot from ROM - * 0b11..Boot from ROM - */ -#define NV_FOPT_BOOTSRC_SEL(x) (((uint8_t)(((uint8_t)(x)) << NV_FOPT_BOOTSRC_SEL_SHIFT)) & NV_FOPT_BOOTSRC_SEL_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group NV_Register_Masks */ - - -/* NV - Peripheral instance base addresses */ -/** Peripheral FTFA_FlashConfig base address */ -#define FTFA_FlashConfig_BASE (0x400u) -/** Peripheral FTFA_FlashConfig base pointer */ -#define FTFA_FlashConfig ((NV_Type *)FTFA_FlashConfig_BASE) -/** Array initializer of NV peripheral base addresses */ -#define NV_BASE_ADDRS { FTFA_FlashConfig_BASE } -/** Array initializer of NV peripheral base pointers */ -#define NV_BASE_PTRS { FTFA_FlashConfig } - -/*! - * @} - */ /* end of group NV_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- OSC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup OSC_Peripheral_Access_Layer OSC Peripheral Access Layer - * @{ - */ - -/** OSC - Register Layout Typedef */ -typedef struct { - __IO uint8_t CR; /**< OSC Control Register, offset: 0x0 */ -} OSC_Type; - -/* ---------------------------------------------------------------------------- - -- OSC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup OSC_Register_Masks OSC Register Masks - * @{ - */ - -/*! @name CR - OSC Control Register */ -/*! @{ */ - -#define OSC_CR_SC16P_MASK (0x1U) -#define OSC_CR_SC16P_SHIFT (0U) -/*! SC16P - Oscillator 16 pF Capacitor Load Configure - * 0b0..Disable the selection. - * 0b1..Add 16 pF capacitor to the oscillator load. - */ -#define OSC_CR_SC16P(x) (((uint8_t)(((uint8_t)(x)) << OSC_CR_SC16P_SHIFT)) & OSC_CR_SC16P_MASK) - -#define OSC_CR_SC8P_MASK (0x2U) -#define OSC_CR_SC8P_SHIFT (1U) -/*! SC8P - Oscillator 8 pF Capacitor Load Configure - * 0b0..Disable the selection. - * 0b1..Add 8 pF capacitor to the oscillator load. - */ -#define OSC_CR_SC8P(x) (((uint8_t)(((uint8_t)(x)) << OSC_CR_SC8P_SHIFT)) & OSC_CR_SC8P_MASK) - -#define OSC_CR_SC4P_MASK (0x4U) -#define OSC_CR_SC4P_SHIFT (2U) -/*! SC4P - Oscillator 4 pF Capacitor Load Configure - * 0b0..Disable the selection. - * 0b1..Add 4 pF capacitor to the oscillator load. - */ -#define OSC_CR_SC4P(x) (((uint8_t)(((uint8_t)(x)) << OSC_CR_SC4P_SHIFT)) & OSC_CR_SC4P_MASK) - -#define OSC_CR_SC2P_MASK (0x8U) -#define OSC_CR_SC2P_SHIFT (3U) -/*! SC2P - Oscillator 2 pF Capacitor Load Configure - * 0b0..Disable the selection. - * 0b1..Add 2 pF capacitor to the oscillator load. - */ -#define OSC_CR_SC2P(x) (((uint8_t)(((uint8_t)(x)) << OSC_CR_SC2P_SHIFT)) & OSC_CR_SC2P_MASK) - -#define OSC_CR_EREFSTEN_MASK (0x20U) -#define OSC_CR_EREFSTEN_SHIFT (5U) -/*! EREFSTEN - External Reference Stop Enable - * 0b0..External reference clock is disabled in Stop mode. - * 0b1..External reference clock stays enabled in Stop mode if ERCLKEN is set before entering Stop mode. - */ -#define OSC_CR_EREFSTEN(x) (((uint8_t)(((uint8_t)(x)) << OSC_CR_EREFSTEN_SHIFT)) & OSC_CR_EREFSTEN_MASK) - -#define OSC_CR_ERCLKEN_MASK (0x80U) -#define OSC_CR_ERCLKEN_SHIFT (7U) -/*! ERCLKEN - External Reference Enable - * 0b0..External reference clock is inactive. - * 0b1..External reference clock is enabled. - */ -#define OSC_CR_ERCLKEN(x) (((uint8_t)(((uint8_t)(x)) << OSC_CR_ERCLKEN_SHIFT)) & OSC_CR_ERCLKEN_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group OSC_Register_Masks */ - - -/* OSC - Peripheral instance base addresses */ -/** Peripheral OSC0 base address */ -#define OSC0_BASE (0x40065000u) -/** Peripheral OSC0 base pointer */ -#define OSC0 ((OSC_Type *)OSC0_BASE) -/** Array initializer of OSC peripheral base addresses */ -#define OSC_BASE_ADDRS { OSC0_BASE } -/** Array initializer of OSC peripheral base pointers */ -#define OSC_BASE_PTRS { OSC0 } - -/*! - * @} - */ /* end of group OSC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- PIT Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PIT_Peripheral_Access_Layer PIT Peripheral Access Layer - * @{ - */ - -/** PIT - Register Layout Typedef */ -typedef struct { - __IO uint32_t MCR; /**< PIT Module Control Register, offset: 0x0 */ - uint8_t RESERVED_0[220]; - __I uint32_t LTMR64H; /**< PIT Upper Lifetime Timer Register, offset: 0xE0 */ - __I uint32_t LTMR64L; /**< PIT Lower Lifetime Timer Register, offset: 0xE4 */ - uint8_t RESERVED_1[24]; - struct { /* offset: 0x100, array step: 0x10 */ - __IO uint32_t LDVAL; /**< Timer Load Value Register, array offset: 0x100, array step: 0x10 */ - __I uint32_t CVAL; /**< Current Timer Value Register, array offset: 0x104, array step: 0x10 */ - __IO uint32_t TCTRL; /**< Timer Control Register, array offset: 0x108, array step: 0x10 */ - __IO uint32_t TFLG; /**< Timer Flag Register, array offset: 0x10C, array step: 0x10 */ - } CHANNEL[2]; -} PIT_Type; - -/* ---------------------------------------------------------------------------- - -- PIT Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PIT_Register_Masks PIT Register Masks - * @{ - */ - -/*! @name MCR - PIT Module Control Register */ -/*! @{ */ - -#define PIT_MCR_FRZ_MASK (0x1U) -#define PIT_MCR_FRZ_SHIFT (0U) -/*! FRZ - Freeze - * 0b0..Timers continue to run in Debug mode. - * 0b1..Timers are stopped in Debug mode. - */ -#define PIT_MCR_FRZ(x) (((uint32_t)(((uint32_t)(x)) << PIT_MCR_FRZ_SHIFT)) & PIT_MCR_FRZ_MASK) - -#define PIT_MCR_MDIS_MASK (0x2U) -#define PIT_MCR_MDIS_SHIFT (1U) -/*! MDIS - Module Disable - (PIT section) - * 0b0..Clock for standard PIT timers is enabled. - * 0b1..Clock for standard PIT timers is disabled. - */ -#define PIT_MCR_MDIS(x) (((uint32_t)(((uint32_t)(x)) << PIT_MCR_MDIS_SHIFT)) & PIT_MCR_MDIS_MASK) -/*! @} */ - -/*! @name LTMR64H - PIT Upper Lifetime Timer Register */ -/*! @{ */ - -#define PIT_LTMR64H_LTH_MASK (0xFFFFFFFFU) -#define PIT_LTMR64H_LTH_SHIFT (0U) -/*! LTH - Life Timer value */ -#define PIT_LTMR64H_LTH(x) (((uint32_t)(((uint32_t)(x)) << PIT_LTMR64H_LTH_SHIFT)) & PIT_LTMR64H_LTH_MASK) -/*! @} */ - -/*! @name LTMR64L - PIT Lower Lifetime Timer Register */ -/*! @{ */ - -#define PIT_LTMR64L_LTL_MASK (0xFFFFFFFFU) -#define PIT_LTMR64L_LTL_SHIFT (0U) -/*! LTL - Life Timer value */ -#define PIT_LTMR64L_LTL(x) (((uint32_t)(((uint32_t)(x)) << PIT_LTMR64L_LTL_SHIFT)) & PIT_LTMR64L_LTL_MASK) -/*! @} */ - -/*! @name LDVAL - Timer Load Value Register */ -/*! @{ */ - -#define PIT_LDVAL_TSV_MASK (0xFFFFFFFFU) -#define PIT_LDVAL_TSV_SHIFT (0U) -/*! TSV - Timer Start Value */ -#define PIT_LDVAL_TSV(x) (((uint32_t)(((uint32_t)(x)) << PIT_LDVAL_TSV_SHIFT)) & PIT_LDVAL_TSV_MASK) -/*! @} */ - -/* The count of PIT_LDVAL */ -#define PIT_LDVAL_COUNT (2U) - -/*! @name CVAL - Current Timer Value Register */ -/*! @{ */ - -#define PIT_CVAL_TVL_MASK (0xFFFFFFFFU) -#define PIT_CVAL_TVL_SHIFT (0U) -/*! TVL - Current Timer Value */ -#define PIT_CVAL_TVL(x) (((uint32_t)(((uint32_t)(x)) << PIT_CVAL_TVL_SHIFT)) & PIT_CVAL_TVL_MASK) -/*! @} */ - -/* The count of PIT_CVAL */ -#define PIT_CVAL_COUNT (2U) - -/*! @name TCTRL - Timer Control Register */ -/*! @{ */ - -#define PIT_TCTRL_TEN_MASK (0x1U) -#define PIT_TCTRL_TEN_SHIFT (0U) -/*! TEN - Timer Enable - * 0b0..Timer n is disabled. - * 0b1..Timer n is enabled. - */ -#define PIT_TCTRL_TEN(x) (((uint32_t)(((uint32_t)(x)) << PIT_TCTRL_TEN_SHIFT)) & PIT_TCTRL_TEN_MASK) - -#define PIT_TCTRL_TIE_MASK (0x2U) -#define PIT_TCTRL_TIE_SHIFT (1U) -/*! TIE - Timer Interrupt Enable - * 0b0..Interrupt requests from Timer n are disabled. - * 0b1..Interrupt will be requested whenever TIF is set. - */ -#define PIT_TCTRL_TIE(x) (((uint32_t)(((uint32_t)(x)) << PIT_TCTRL_TIE_SHIFT)) & PIT_TCTRL_TIE_MASK) - -#define PIT_TCTRL_CHN_MASK (0x4U) -#define PIT_TCTRL_CHN_SHIFT (2U) -/*! CHN - Chain Mode - * 0b0..Timer is not chained. - * 0b1..Timer is chained to previous timer. For example, for Channel 2, if this field is set, Timer 2 is chained to Timer 1. - */ -#define PIT_TCTRL_CHN(x) (((uint32_t)(((uint32_t)(x)) << PIT_TCTRL_CHN_SHIFT)) & PIT_TCTRL_CHN_MASK) -/*! @} */ - -/* The count of PIT_TCTRL */ -#define PIT_TCTRL_COUNT (2U) - -/*! @name TFLG - Timer Flag Register */ -/*! @{ */ - -#define PIT_TFLG_TIF_MASK (0x1U) -#define PIT_TFLG_TIF_SHIFT (0U) -/*! TIF - Timer Interrupt Flag - * 0b0..Timeout has not yet occurred. - * 0b1..Timeout has occurred. - */ -#define PIT_TFLG_TIF(x) (((uint32_t)(((uint32_t)(x)) << PIT_TFLG_TIF_SHIFT)) & PIT_TFLG_TIF_MASK) -/*! @} */ - -/* The count of PIT_TFLG */ -#define PIT_TFLG_COUNT (2U) - - -/*! - * @} - */ /* end of group PIT_Register_Masks */ - - -/* PIT - Peripheral instance base addresses */ -/** Peripheral PIT base address */ -#define PIT_BASE (0x40037000u) -/** Peripheral PIT base pointer */ -#define PIT ((PIT_Type *)PIT_BASE) -/** Array initializer of PIT peripheral base addresses */ -#define PIT_BASE_ADDRS { PIT_BASE } -/** Array initializer of PIT peripheral base pointers */ -#define PIT_BASE_PTRS { PIT } -/** Interrupt vectors for the PIT peripheral type */ -#define PIT_IRQS { { PIT_IRQn, PIT_IRQn } } - -/*! - * @} - */ /* end of group PIT_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- PMC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PMC_Peripheral_Access_Layer PMC Peripheral Access Layer - * @{ - */ - -/** PMC - Register Layout Typedef */ -typedef struct { - __IO uint8_t LVDSC1; /**< Low Voltage Detect Status And Control 1 register, offset: 0x0 */ - __IO uint8_t LVDSC2; /**< Low Voltage Detect Status And Control 2 register, offset: 0x1 */ - __IO uint8_t REGSC; /**< Regulator Status And Control register, offset: 0x2 */ -} PMC_Type; - -/* ---------------------------------------------------------------------------- - -- PMC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PMC_Register_Masks PMC Register Masks - * @{ - */ - -/*! @name LVDSC1 - Low Voltage Detect Status And Control 1 register */ -/*! @{ */ - -#define PMC_LVDSC1_LVDV_MASK (0x3U) -#define PMC_LVDSC1_LVDV_SHIFT (0U) -/*! LVDV - Low-Voltage Detect Voltage Select - * 0b00..Low trip point selected (V LVD = V LVDL ) - * 0b01..High trip point selected (V LVD = V LVDH ) - * 0b10..Reserved - * 0b11..Reserved - */ -#define PMC_LVDSC1_LVDV(x) (((uint8_t)(((uint8_t)(x)) << PMC_LVDSC1_LVDV_SHIFT)) & PMC_LVDSC1_LVDV_MASK) - -#define PMC_LVDSC1_LVDRE_MASK (0x10U) -#define PMC_LVDSC1_LVDRE_SHIFT (4U) -/*! LVDRE - Low-Voltage Detect Reset Enable - * 0b0..LVDF does not generate hardware resets - * 0b1..Force an MCU reset when LVDF = 1 - */ -#define PMC_LVDSC1_LVDRE(x) (((uint8_t)(((uint8_t)(x)) << PMC_LVDSC1_LVDRE_SHIFT)) & PMC_LVDSC1_LVDRE_MASK) - -#define PMC_LVDSC1_LVDIE_MASK (0x20U) -#define PMC_LVDSC1_LVDIE_SHIFT (5U) -/*! LVDIE - Low-Voltage Detect Interrupt Enable - * 0b0..Hardware interrupt disabled (use polling) - * 0b1..Request a hardware interrupt when LVDF = 1 - */ -#define PMC_LVDSC1_LVDIE(x) (((uint8_t)(((uint8_t)(x)) << PMC_LVDSC1_LVDIE_SHIFT)) & PMC_LVDSC1_LVDIE_MASK) - -#define PMC_LVDSC1_LVDACK_MASK (0x40U) -#define PMC_LVDSC1_LVDACK_SHIFT (6U) -/*! LVDACK - Low-Voltage Detect Acknowledge */ -#define PMC_LVDSC1_LVDACK(x) (((uint8_t)(((uint8_t)(x)) << PMC_LVDSC1_LVDACK_SHIFT)) & PMC_LVDSC1_LVDACK_MASK) - -#define PMC_LVDSC1_LVDF_MASK (0x80U) -#define PMC_LVDSC1_LVDF_SHIFT (7U) -/*! LVDF - Low-Voltage Detect Flag - * 0b0..Low-voltage event not detected - * 0b1..Low-voltage event detected - */ -#define PMC_LVDSC1_LVDF(x) (((uint8_t)(((uint8_t)(x)) << PMC_LVDSC1_LVDF_SHIFT)) & PMC_LVDSC1_LVDF_MASK) -/*! @} */ - -/*! @name LVDSC2 - Low Voltage Detect Status And Control 2 register */ -/*! @{ */ - -#define PMC_LVDSC2_LVWV_MASK (0x3U) -#define PMC_LVDSC2_LVWV_SHIFT (0U) -/*! LVWV - Low-Voltage Warning Voltage Select - * 0b00..Low trip point selected (VLVW = VLVW1) - * 0b01..Mid 1 trip point selected (VLVW = VLVW2) - * 0b10..Mid 2 trip point selected (VLVW = VLVW3) - * 0b11..High trip point selected (VLVW = VLVW4) - */ -#define PMC_LVDSC2_LVWV(x) (((uint8_t)(((uint8_t)(x)) << PMC_LVDSC2_LVWV_SHIFT)) & PMC_LVDSC2_LVWV_MASK) - -#define PMC_LVDSC2_LVWIE_MASK (0x20U) -#define PMC_LVDSC2_LVWIE_SHIFT (5U) -/*! LVWIE - Low-Voltage Warning Interrupt Enable - * 0b0..Hardware interrupt disabled (use polling) - * 0b1..Request a hardware interrupt when LVWF = 1 - */ -#define PMC_LVDSC2_LVWIE(x) (((uint8_t)(((uint8_t)(x)) << PMC_LVDSC2_LVWIE_SHIFT)) & PMC_LVDSC2_LVWIE_MASK) - -#define PMC_LVDSC2_LVWACK_MASK (0x40U) -#define PMC_LVDSC2_LVWACK_SHIFT (6U) -/*! LVWACK - Low-Voltage Warning Acknowledge */ -#define PMC_LVDSC2_LVWACK(x) (((uint8_t)(((uint8_t)(x)) << PMC_LVDSC2_LVWACK_SHIFT)) & PMC_LVDSC2_LVWACK_MASK) - -#define PMC_LVDSC2_LVWF_MASK (0x80U) -#define PMC_LVDSC2_LVWF_SHIFT (7U) -/*! LVWF - Low-Voltage Warning Flag - * 0b0..Low-voltage warning event not detected - * 0b1..Low-voltage warning event detected - */ -#define PMC_LVDSC2_LVWF(x) (((uint8_t)(((uint8_t)(x)) << PMC_LVDSC2_LVWF_SHIFT)) & PMC_LVDSC2_LVWF_MASK) -/*! @} */ - -/*! @name REGSC - Regulator Status And Control register */ -/*! @{ */ - -#define PMC_REGSC_BGBE_MASK (0x1U) -#define PMC_REGSC_BGBE_SHIFT (0U) -/*! BGBE - Bandgap Buffer Enable - * 0b0..Bandgap buffer not enabled - * 0b1..Bandgap buffer enabled - */ -#define PMC_REGSC_BGBE(x) (((uint8_t)(((uint8_t)(x)) << PMC_REGSC_BGBE_SHIFT)) & PMC_REGSC_BGBE_MASK) - -#define PMC_REGSC_REGONS_MASK (0x4U) -#define PMC_REGSC_REGONS_SHIFT (2U) -/*! REGONS - Regulator In Run Regulation Status - * 0b0..Regulator is in stop regulation or in transition to/from it - * 0b1..Regulator is in run regulation - */ -#define PMC_REGSC_REGONS(x) (((uint8_t)(((uint8_t)(x)) << PMC_REGSC_REGONS_SHIFT)) & PMC_REGSC_REGONS_MASK) - -#define PMC_REGSC_ACKISO_MASK (0x8U) -#define PMC_REGSC_ACKISO_SHIFT (3U) -/*! ACKISO - Acknowledge Isolation - * 0b0..Peripherals and I/O pads are in normal run state. - * 0b1..Certain peripherals and I/O pads are in an isolated and latched state. - */ -#define PMC_REGSC_ACKISO(x) (((uint8_t)(((uint8_t)(x)) << PMC_REGSC_ACKISO_SHIFT)) & PMC_REGSC_ACKISO_MASK) - -#define PMC_REGSC_BGEN_MASK (0x10U) -#define PMC_REGSC_BGEN_SHIFT (4U) -/*! BGEN - Bandgap Enable In VLPx Operation - * 0b0..Bandgap voltage reference is disabled in VLPx , LLS , and VLLSx modes. - * 0b1..Bandgap voltage reference is enabled in VLPx , LLS , and VLLSx modes. - */ -#define PMC_REGSC_BGEN(x) (((uint8_t)(((uint8_t)(x)) << PMC_REGSC_BGEN_SHIFT)) & PMC_REGSC_BGEN_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group PMC_Register_Masks */ - - -/* PMC - Peripheral instance base addresses */ -/** Peripheral PMC base address */ -#define PMC_BASE (0x4007D000u) -/** Peripheral PMC base pointer */ -#define PMC ((PMC_Type *)PMC_BASE) -/** Array initializer of PMC peripheral base addresses */ -#define PMC_BASE_ADDRS { PMC_BASE } -/** Array initializer of PMC peripheral base pointers */ -#define PMC_BASE_PTRS { PMC } -/** Interrupt vectors for the PMC peripheral type */ -#define PMC_IRQS { PMC_IRQn } - -/*! - * @} - */ /* end of group PMC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- PORT Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PORT_Peripheral_Access_Layer PORT Peripheral Access Layer - * @{ - */ - -/** PORT - Register Layout Typedef */ -typedef struct { - __IO uint32_t PCR[32]; /**< Pin Control Register n, array offset: 0x0, array step: 0x4 */ - __O uint32_t GPCLR; /**< Global Pin Control Low Register, offset: 0x80 */ - __O uint32_t GPCHR; /**< Global Pin Control High Register, offset: 0x84 */ - uint8_t RESERVED_0[24]; - __IO uint32_t ISFR; /**< Interrupt Status Flag Register, offset: 0xA0 */ -} PORT_Type; - -/* ---------------------------------------------------------------------------- - -- PORT Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PORT_Register_Masks PORT Register Masks - * @{ - */ - -/*! @name PCR - Pin Control Register n */ -/*! @{ */ - -#define PORT_PCR_PS_MASK (0x1U) -#define PORT_PCR_PS_SHIFT (0U) -/*! PS - Pull Select - * 0b0..Internal pulldown resistor is enabled on the corresponding pin, if the corresponding PE field is set. - * 0b1..Internal pullup resistor is enabled on the corresponding pin, if the corresponding PE field is set. - */ -#define PORT_PCR_PS(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_PS_SHIFT)) & PORT_PCR_PS_MASK) - -#define PORT_PCR_PE_MASK (0x2U) -#define PORT_PCR_PE_SHIFT (1U) -/*! PE - Pull Enable - * 0b0..Internal pullup or pulldown resistor is not enabled on the corresponding pin. - * 0b1..Internal pullup or pulldown resistor is enabled on the corresponding pin, if the pin is configured as a digital input. - */ -#define PORT_PCR_PE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_PE_SHIFT)) & PORT_PCR_PE_MASK) - -#define PORT_PCR_SRE_MASK (0x4U) -#define PORT_PCR_SRE_SHIFT (2U) -/*! SRE - Slew Rate Enable - * 0b0..Fast slew rate is configured on the corresponding pin, if the pin is configured as a digital output. - * 0b1..Slow slew rate is configured on the corresponding pin, if the pin is configured as a digital output. - */ -#define PORT_PCR_SRE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_SRE_SHIFT)) & PORT_PCR_SRE_MASK) - -#define PORT_PCR_PFE_MASK (0x10U) -#define PORT_PCR_PFE_SHIFT (4U) -/*! PFE - Passive Filter Enable - * 0b0..Passive input filter is disabled on the corresponding pin. - * 0b1..Passive input filter is enabled on the corresponding pin, if the pin is configured as a digital input. - * Refer to the device data sheet for filter characteristics. - */ -#define PORT_PCR_PFE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_PFE_SHIFT)) & PORT_PCR_PFE_MASK) - -#define PORT_PCR_DSE_MASK (0x40U) -#define PORT_PCR_DSE_SHIFT (6U) -/*! DSE - Drive Strength Enable - * 0b0..Low drive strength is configured on the corresponding pin, if pin is configured as a digital output. - * 0b1..High drive strength is configured on the corresponding pin, if pin is configured as a digital output. - */ -#define PORT_PCR_DSE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_DSE_SHIFT)) & PORT_PCR_DSE_MASK) - -#define PORT_PCR_MUX_MASK (0x700U) -#define PORT_PCR_MUX_SHIFT (8U) -/*! MUX - Pin Mux Control - * 0b000..Pin disabled (analog). - * 0b001..Alternative 1 (GPIO). - * 0b010..Alternative 2 (chip-specific). - * 0b011..Alternative 3 (chip-specific). - * 0b100..Alternative 4 (chip-specific). - * 0b101..Alternative 5 (chip-specific). - * 0b110..Alternative 6 (chip-specific). - * 0b111..Alternative 7 (chip-specific). - */ -#define PORT_PCR_MUX(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_MUX_SHIFT)) & PORT_PCR_MUX_MASK) - -#define PORT_PCR_IRQC_MASK (0xF0000U) -#define PORT_PCR_IRQC_SHIFT (16U) -/*! IRQC - Interrupt Configuration - * 0b0000..Interrupt/DMA request disabled. - * 0b0001..DMA request on rising edge. - * 0b0010..DMA request on falling edge. - * 0b0011..DMA request on either edge. - * 0b1000..Interrupt when logic 0. - * 0b1001..Interrupt on rising-edge. - * 0b1010..Interrupt on falling-edge. - * 0b1011..Interrupt on either edge. - * 0b1100..Interrupt when logic 1. - */ -#define PORT_PCR_IRQC(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_IRQC_SHIFT)) & PORT_PCR_IRQC_MASK) - -#define PORT_PCR_ISF_MASK (0x1000000U) -#define PORT_PCR_ISF_SHIFT (24U) -/*! ISF - Interrupt Status Flag - * 0b0..Configured interrupt is not detected. - * 0b1..Configured interrupt is detected. If the pin is configured to generate a DMA request, then the - * corresponding flag will be cleared automatically at the completion of the requested DMA transfer. Otherwise, the - * flag remains set until a logic 1 is written to the flag. If the pin is configured for a level sensitive - * interrupt and the pin remains asserted, then the flag is set again immediately after it is cleared. - */ -#define PORT_PCR_ISF(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_ISF_SHIFT)) & PORT_PCR_ISF_MASK) -/*! @} */ - -/* The count of PORT_PCR */ -#define PORT_PCR_COUNT (32U) - -/*! @name GPCLR - Global Pin Control Low Register */ -/*! @{ */ - -#define PORT_GPCLR_GPWD_MASK (0xFFFFU) -#define PORT_GPCLR_GPWD_SHIFT (0U) -/*! GPWD - Global Pin Write Data */ -#define PORT_GPCLR_GPWD(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWD_SHIFT)) & PORT_GPCLR_GPWD_MASK) - -#define PORT_GPCLR_GPWE_MASK (0xFFFF0000U) -#define PORT_GPCLR_GPWE_SHIFT (16U) -/*! GPWE - Global Pin Write Enable - * 0b0000000000000000..Corresponding Pin Control Register is not updated with the value in GPWD. - * 0b0000000000000001..Corresponding Pin Control Register is updated with the value in GPWD. - */ -#define PORT_GPCLR_GPWE(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE_SHIFT)) & PORT_GPCLR_GPWE_MASK) -/*! @} */ - -/*! @name GPCHR - Global Pin Control High Register */ -/*! @{ */ - -#define PORT_GPCHR_GPWD_MASK (0xFFFFU) -#define PORT_GPCHR_GPWD_SHIFT (0U) -/*! GPWD - Global Pin Write Data */ -#define PORT_GPCHR_GPWD(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWD_SHIFT)) & PORT_GPCHR_GPWD_MASK) - -#define PORT_GPCHR_GPWE_MASK (0xFFFF0000U) -#define PORT_GPCHR_GPWE_SHIFT (16U) -/*! GPWE - Global Pin Write Enable - * 0b0000000000000000..Corresponding Pin Control Register is not updated with the value in GPWD. - * 0b0000000000000001..Corresponding Pin Control Register is updated with the value in GPWD. - */ -#define PORT_GPCHR_GPWE(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE_SHIFT)) & PORT_GPCHR_GPWE_MASK) -/*! @} */ - -/*! @name ISFR - Interrupt Status Flag Register */ -/*! @{ */ - -#define PORT_ISFR_ISF_MASK (0xFFFFFFFFU) -#define PORT_ISFR_ISF_SHIFT (0U) -/*! ISF - Interrupt Status Flag - * 0b00000000000000000000000000000000..Configured interrupt is not detected. - * 0b00000000000000000000000000000001..Configured interrupt is detected. If the pin is configured to generate a - * DMA request, then the corresponding flag will be cleared automatically at - * the completion of the requested DMA transfer. Otherwise, the flag remains set - * until a logic 1 is written to the flag. If the pin is configured for a - * level sensitive interrupt and the pin remains asserted, then the flag is set - * again immediately after it is cleared. - */ -#define PORT_ISFR_ISF(x) (((uint32_t)(((uint32_t)(x)) << PORT_ISFR_ISF_SHIFT)) & PORT_ISFR_ISF_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group PORT_Register_Masks */ - - -/* PORT - Peripheral instance base addresses */ -/** Peripheral PORTA base address */ -#define PORTA_BASE (0x40049000u) -/** Peripheral PORTA base pointer */ -#define PORTA ((PORT_Type *)PORTA_BASE) -/** Peripheral PORTB base address */ -#define PORTB_BASE (0x4004A000u) -/** Peripheral PORTB base pointer */ -#define PORTB ((PORT_Type *)PORTB_BASE) -/** Peripheral PORTC base address */ -#define PORTC_BASE (0x4004B000u) -/** Peripheral PORTC base pointer */ -#define PORTC ((PORT_Type *)PORTC_BASE) -/** Peripheral PORTD base address */ -#define PORTD_BASE (0x4004C000u) -/** Peripheral PORTD base pointer */ -#define PORTD ((PORT_Type *)PORTD_BASE) -/** Peripheral PORTE base address */ -#define PORTE_BASE (0x4004D000u) -/** Peripheral PORTE base pointer */ -#define PORTE ((PORT_Type *)PORTE_BASE) -/** Array initializer of PORT peripheral base addresses */ -#define PORT_BASE_ADDRS { PORTA_BASE, PORTB_BASE, PORTC_BASE, PORTD_BASE, PORTE_BASE } -/** Array initializer of PORT peripheral base pointers */ -#define PORT_BASE_PTRS { PORTA, PORTB, PORTC, PORTD, PORTE } -/** Interrupt vectors for the PORT peripheral type */ -#define PORT_IRQS { PORTA_IRQn, NotAvail_IRQn, PORTC_PORTD_IRQn, PORTC_PORTD_IRQn, NotAvail_IRQn } - -/*! - * @} - */ /* end of group PORT_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- RCM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup RCM_Peripheral_Access_Layer RCM Peripheral Access Layer - * @{ - */ - -/** RCM - Register Layout Typedef */ -typedef struct { - __I uint8_t SRS0; /**< System Reset Status Register 0, offset: 0x0 */ - __I uint8_t SRS1; /**< System Reset Status Register 1, offset: 0x1 */ - uint8_t RESERVED_0[2]; - __IO uint8_t RPFC; /**< Reset Pin Filter Control register, offset: 0x4 */ - __IO uint8_t RPFW; /**< Reset Pin Filter Width register, offset: 0x5 */ - __IO uint8_t FM; /**< Force Mode Register, offset: 0x6 */ - __IO uint8_t MR; /**< Mode Register, offset: 0x7 */ - __IO uint8_t SSRS0; /**< Sticky System Reset Status Register 0, offset: 0x8 */ - __IO uint8_t SSRS1; /**< Sticky System Reset Status Register 1, offset: 0x9 */ -} RCM_Type; - -/* ---------------------------------------------------------------------------- - -- RCM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup RCM_Register_Masks RCM Register Masks - * @{ - */ - -/*! @name SRS0 - System Reset Status Register 0 */ -/*! @{ */ - -#define RCM_SRS0_WAKEUP_MASK (0x1U) -#define RCM_SRS0_WAKEUP_SHIFT (0U) -/*! WAKEUP - Low Leakage Wakeup Reset - * 0b0..Reset not caused by LLWU module wakeup source - * 0b1..Reset caused by LLWU module wakeup source - */ -#define RCM_SRS0_WAKEUP(x) (((uint8_t)(((uint8_t)(x)) << RCM_SRS0_WAKEUP_SHIFT)) & RCM_SRS0_WAKEUP_MASK) - -#define RCM_SRS0_LVD_MASK (0x2U) -#define RCM_SRS0_LVD_SHIFT (1U) -/*! LVD - Low-Voltage Detect Reset - * 0b0..Reset not caused by LVD trip or POR - * 0b1..Reset caused by LVD trip or POR - */ -#define RCM_SRS0_LVD(x) (((uint8_t)(((uint8_t)(x)) << RCM_SRS0_LVD_SHIFT)) & RCM_SRS0_LVD_MASK) - -#define RCM_SRS0_WDOG_MASK (0x20U) -#define RCM_SRS0_WDOG_SHIFT (5U) -/*! WDOG - Watchdog - * 0b0..Reset not caused by watchdog timeout - * 0b1..Reset caused by watchdog timeout - */ -#define RCM_SRS0_WDOG(x) (((uint8_t)(((uint8_t)(x)) << RCM_SRS0_WDOG_SHIFT)) & RCM_SRS0_WDOG_MASK) - -#define RCM_SRS0_PIN_MASK (0x40U) -#define RCM_SRS0_PIN_SHIFT (6U) -/*! PIN - External Reset Pin - * 0b0..Reset not caused by external reset pin - * 0b1..Reset caused by external reset pin - */ -#define RCM_SRS0_PIN(x) (((uint8_t)(((uint8_t)(x)) << RCM_SRS0_PIN_SHIFT)) & RCM_SRS0_PIN_MASK) - -#define RCM_SRS0_POR_MASK (0x80U) -#define RCM_SRS0_POR_SHIFT (7U) -/*! POR - Power-On Reset - * 0b0..Reset not caused by POR - * 0b1..Reset caused by POR - */ -#define RCM_SRS0_POR(x) (((uint8_t)(((uint8_t)(x)) << RCM_SRS0_POR_SHIFT)) & RCM_SRS0_POR_MASK) -/*! @} */ - -/*! @name SRS1 - System Reset Status Register 1 */ -/*! @{ */ - -#define RCM_SRS1_LOCKUP_MASK (0x2U) -#define RCM_SRS1_LOCKUP_SHIFT (1U) -/*! LOCKUP - Core Lockup - * 0b0..Reset not caused by core LOCKUP event - * 0b1..Reset caused by core LOCKUP event - */ -#define RCM_SRS1_LOCKUP(x) (((uint8_t)(((uint8_t)(x)) << RCM_SRS1_LOCKUP_SHIFT)) & RCM_SRS1_LOCKUP_MASK) - -#define RCM_SRS1_SW_MASK (0x4U) -#define RCM_SRS1_SW_SHIFT (2U) -/*! SW - Software - * 0b0..Reset not caused by software setting of SYSRESETREQ bit - * 0b1..Reset caused by software setting of SYSRESETREQ bit - */ -#define RCM_SRS1_SW(x) (((uint8_t)(((uint8_t)(x)) << RCM_SRS1_SW_SHIFT)) & RCM_SRS1_SW_MASK) - -#define RCM_SRS1_MDM_AP_MASK (0x8U) -#define RCM_SRS1_MDM_AP_SHIFT (3U) -/*! MDM_AP - MDM-AP System Reset Request - * 0b0..Reset not caused by host debugger system setting of the System Reset Request bit - * 0b1..Reset caused by host debugger system setting of the System Reset Request bit - */ -#define RCM_SRS1_MDM_AP(x) (((uint8_t)(((uint8_t)(x)) << RCM_SRS1_MDM_AP_SHIFT)) & RCM_SRS1_MDM_AP_MASK) - -#define RCM_SRS1_SACKERR_MASK (0x20U) -#define RCM_SRS1_SACKERR_SHIFT (5U) -/*! SACKERR - Stop Mode Acknowledge Error Reset - * 0b0..Reset not caused by peripheral failure to acknowledge attempt to enter stop mode - * 0b1..Reset caused by peripheral failure to acknowledge attempt to enter stop mode - */ -#define RCM_SRS1_SACKERR(x) (((uint8_t)(((uint8_t)(x)) << RCM_SRS1_SACKERR_SHIFT)) & RCM_SRS1_SACKERR_MASK) -/*! @} */ - -/*! @name RPFC - Reset Pin Filter Control register */ -/*! @{ */ - -#define RCM_RPFC_RSTFLTSRW_MASK (0x3U) -#define RCM_RPFC_RSTFLTSRW_SHIFT (0U) -/*! RSTFLTSRW - Reset Pin Filter Select in Run and Wait Modes - * 0b00..All filtering disabled - * 0b01..Bus clock filter enabled for normal operation - * 0b10..LPO clock filter enabled for normal operation - * 0b11..Reserved - */ -#define RCM_RPFC_RSTFLTSRW(x) (((uint8_t)(((uint8_t)(x)) << RCM_RPFC_RSTFLTSRW_SHIFT)) & RCM_RPFC_RSTFLTSRW_MASK) - -#define RCM_RPFC_RSTFLTSS_MASK (0x4U) -#define RCM_RPFC_RSTFLTSS_SHIFT (2U) -/*! RSTFLTSS - Reset Pin Filter Select in Stop Mode - * 0b0..All filtering disabled - * 0b1..LPO clock filter enabled - */ -#define RCM_RPFC_RSTFLTSS(x) (((uint8_t)(((uint8_t)(x)) << RCM_RPFC_RSTFLTSS_SHIFT)) & RCM_RPFC_RSTFLTSS_MASK) -/*! @} */ - -/*! @name RPFW - Reset Pin Filter Width register */ -/*! @{ */ - -#define RCM_RPFW_RSTFLTSEL_MASK (0x1FU) -#define RCM_RPFW_RSTFLTSEL_SHIFT (0U) -/*! RSTFLTSEL - Reset Pin Filter Bus Clock Select - * 0b00000..Bus clock filter count is 1 - * 0b00001..Bus clock filter count is 2 - * 0b00010..Bus clock filter count is 3 - * 0b00011..Bus clock filter count is 4 - * 0b00100..Bus clock filter count is 5 - * 0b00101..Bus clock filter count is 6 - * 0b00110..Bus clock filter count is 7 - * 0b00111..Bus clock filter count is 8 - * 0b01000..Bus clock filter count is 9 - * 0b01001..Bus clock filter count is 10 - * 0b01010..Bus clock filter count is 11 - * 0b01011..Bus clock filter count is 12 - * 0b01100..Bus clock filter count is 13 - * 0b01101..Bus clock filter count is 14 - * 0b01110..Bus clock filter count is 15 - * 0b01111..Bus clock filter count is 16 - * 0b10000..Bus clock filter count is 17 - * 0b10001..Bus clock filter count is 18 - * 0b10010..Bus clock filter count is 19 - * 0b10011..Bus clock filter count is 20 - * 0b10100..Bus clock filter count is 21 - * 0b10101..Bus clock filter count is 22 - * 0b10110..Bus clock filter count is 23 - * 0b10111..Bus clock filter count is 24 - * 0b11000..Bus clock filter count is 25 - * 0b11001..Bus clock filter count is 26 - * 0b11010..Bus clock filter count is 27 - * 0b11011..Bus clock filter count is 28 - * 0b11100..Bus clock filter count is 29 - * 0b11101..Bus clock filter count is 30 - * 0b11110..Bus clock filter count is 31 - * 0b11111..Bus clock filter count is 32 - */ -#define RCM_RPFW_RSTFLTSEL(x) (((uint8_t)(((uint8_t)(x)) << RCM_RPFW_RSTFLTSEL_SHIFT)) & RCM_RPFW_RSTFLTSEL_MASK) -/*! @} */ - -/*! @name FM - Force Mode Register */ -/*! @{ */ - -#define RCM_FM_FORCEROM_MASK (0x6U) -#define RCM_FM_FORCEROM_SHIFT (1U) -/*! FORCEROM - Force ROM Boot - * 0b00..No effect - * 0b01..Force boot from ROM with RCM_MR[1] set. - * 0b10..Force boot from ROM with RCM_MR[2] set. - * 0b11..Force boot from ROM with RCM_MR[2:1] set. - */ -#define RCM_FM_FORCEROM(x) (((uint8_t)(((uint8_t)(x)) << RCM_FM_FORCEROM_SHIFT)) & RCM_FM_FORCEROM_MASK) -/*! @} */ - -/*! @name MR - Mode Register */ -/*! @{ */ - -#define RCM_MR_BOOTROM_MASK (0x6U) -#define RCM_MR_BOOTROM_SHIFT (1U) -/*! BOOTROM - Boot ROM Configuration - * 0b00..Boot from Flash - * 0b01..Boot from ROM due to BOOTCFG0 pin assertion - * 0b10..Boot form ROM due to FOPT[7] configuration - * 0b11..Boot from ROM due to both BOOTCFG0 pin assertion and FOPT[7] configuration - */ -#define RCM_MR_BOOTROM(x) (((uint8_t)(((uint8_t)(x)) << RCM_MR_BOOTROM_SHIFT)) & RCM_MR_BOOTROM_MASK) -/*! @} */ - -/*! @name SSRS0 - Sticky System Reset Status Register 0 */ -/*! @{ */ - -#define RCM_SSRS0_SWAKEUP_MASK (0x1U) -#define RCM_SSRS0_SWAKEUP_SHIFT (0U) -/*! SWAKEUP - Sticky Low Leakage Wakeup Reset - * 0b0..Reset not caused by LLWU module wakeup source - * 0b1..Reset caused by LLWU module wakeup source - */ -#define RCM_SSRS0_SWAKEUP(x) (((uint8_t)(((uint8_t)(x)) << RCM_SSRS0_SWAKEUP_SHIFT)) & RCM_SSRS0_SWAKEUP_MASK) - -#define RCM_SSRS0_SLVD_MASK (0x2U) -#define RCM_SSRS0_SLVD_SHIFT (1U) -/*! SLVD - Sticky Low-Voltage Detect Reset - * 0b0..Reset not caused by LVD trip or POR - * 0b1..Reset caused by LVD trip or POR - */ -#define RCM_SSRS0_SLVD(x) (((uint8_t)(((uint8_t)(x)) << RCM_SSRS0_SLVD_SHIFT)) & RCM_SSRS0_SLVD_MASK) - -#define RCM_SSRS0_SWDOG_MASK (0x20U) -#define RCM_SSRS0_SWDOG_SHIFT (5U) -/*! SWDOG - Sticky Watchdog - * 0b0..Reset not caused by watchdog timeout - * 0b1..Reset caused by watchdog timeout - */ -#define RCM_SSRS0_SWDOG(x) (((uint8_t)(((uint8_t)(x)) << RCM_SSRS0_SWDOG_SHIFT)) & RCM_SSRS0_SWDOG_MASK) - -#define RCM_SSRS0_SPIN_MASK (0x40U) -#define RCM_SSRS0_SPIN_SHIFT (6U) -/*! SPIN - Sticky External Reset Pin - * 0b0..Reset not caused by external reset pin - * 0b1..Reset caused by external reset pin - */ -#define RCM_SSRS0_SPIN(x) (((uint8_t)(((uint8_t)(x)) << RCM_SSRS0_SPIN_SHIFT)) & RCM_SSRS0_SPIN_MASK) - -#define RCM_SSRS0_SPOR_MASK (0x80U) -#define RCM_SSRS0_SPOR_SHIFT (7U) -/*! SPOR - Sticky Power-On Reset - * 0b0..Reset not caused by POR - * 0b1..Reset caused by POR - */ -#define RCM_SSRS0_SPOR(x) (((uint8_t)(((uint8_t)(x)) << RCM_SSRS0_SPOR_SHIFT)) & RCM_SSRS0_SPOR_MASK) -/*! @} */ - -/*! @name SSRS1 - Sticky System Reset Status Register 1 */ -/*! @{ */ - -#define RCM_SSRS1_SLOCKUP_MASK (0x2U) -#define RCM_SSRS1_SLOCKUP_SHIFT (1U) -/*! SLOCKUP - Sticky Core Lockup - * 0b0..Reset not caused by core LOCKUP event - * 0b1..Reset caused by core LOCKUP event - */ -#define RCM_SSRS1_SLOCKUP(x) (((uint8_t)(((uint8_t)(x)) << RCM_SSRS1_SLOCKUP_SHIFT)) & RCM_SSRS1_SLOCKUP_MASK) - -#define RCM_SSRS1_SSW_MASK (0x4U) -#define RCM_SSRS1_SSW_SHIFT (2U) -/*! SSW - Sticky Software - * 0b0..Reset not caused by software setting of SYSRESETREQ bit - * 0b1..Reset caused by software setting of SYSRESETREQ bit - */ -#define RCM_SSRS1_SSW(x) (((uint8_t)(((uint8_t)(x)) << RCM_SSRS1_SSW_SHIFT)) & RCM_SSRS1_SSW_MASK) - -#define RCM_SSRS1_SMDM_AP_MASK (0x8U) -#define RCM_SSRS1_SMDM_AP_SHIFT (3U) -/*! SMDM_AP - Sticky MDM-AP System Reset Request - * 0b0..Reset not caused by host debugger system setting of the System Reset Request bit - * 0b1..Reset caused by host debugger system setting of the System Reset Request bit - */ -#define RCM_SSRS1_SMDM_AP(x) (((uint8_t)(((uint8_t)(x)) << RCM_SSRS1_SMDM_AP_SHIFT)) & RCM_SSRS1_SMDM_AP_MASK) - -#define RCM_SSRS1_SSACKERR_MASK (0x20U) -#define RCM_SSRS1_SSACKERR_SHIFT (5U) -/*! SSACKERR - Sticky Stop Mode Acknowledge Error Reset - * 0b0..Reset not caused by peripheral failure to acknowledge attempt to enter stop mode - * 0b1..Reset caused by peripheral failure to acknowledge attempt to enter stop mode - */ -#define RCM_SSRS1_SSACKERR(x) (((uint8_t)(((uint8_t)(x)) << RCM_SSRS1_SSACKERR_SHIFT)) & RCM_SSRS1_SSACKERR_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group RCM_Register_Masks */ - - -/* RCM - Peripheral instance base addresses */ -/** Peripheral RCM base address */ -#define RCM_BASE (0x4007F000u) -/** Peripheral RCM base pointer */ -#define RCM ((RCM_Type *)RCM_BASE) -/** Array initializer of RCM peripheral base addresses */ -#define RCM_BASE_ADDRS { RCM_BASE } -/** Array initializer of RCM peripheral base pointers */ -#define RCM_BASE_PTRS { RCM } - -/*! - * @} - */ /* end of group RCM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- RFSYS Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup RFSYS_Peripheral_Access_Layer RFSYS Peripheral Access Layer - * @{ - */ - -/** RFSYS - Register Layout Typedef */ -typedef struct { - __IO uint32_t REG[8]; /**< Register file register, array offset: 0x0, array step: 0x4 */ -} RFSYS_Type; - -/* ---------------------------------------------------------------------------- - -- RFSYS Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup RFSYS_Register_Masks RFSYS Register Masks - * @{ - */ - -/*! @name REG - Register file register */ -/*! @{ */ - -#define RFSYS_REG_LL_MASK (0xFFU) -#define RFSYS_REG_LL_SHIFT (0U) -#define RFSYS_REG_LL(x) (((uint32_t)(((uint32_t)(x)) << RFSYS_REG_LL_SHIFT)) & RFSYS_REG_LL_MASK) - -#define RFSYS_REG_LH_MASK (0xFF00U) -#define RFSYS_REG_LH_SHIFT (8U) -#define RFSYS_REG_LH(x) (((uint32_t)(((uint32_t)(x)) << RFSYS_REG_LH_SHIFT)) & RFSYS_REG_LH_MASK) - -#define RFSYS_REG_HL_MASK (0xFF0000U) -#define RFSYS_REG_HL_SHIFT (16U) -#define RFSYS_REG_HL(x) (((uint32_t)(((uint32_t)(x)) << RFSYS_REG_HL_SHIFT)) & RFSYS_REG_HL_MASK) - -#define RFSYS_REG_HH_MASK (0xFF000000U) -#define RFSYS_REG_HH_SHIFT (24U) -#define RFSYS_REG_HH(x) (((uint32_t)(((uint32_t)(x)) << RFSYS_REG_HH_SHIFT)) & RFSYS_REG_HH_MASK) -/*! @} */ - -/* The count of RFSYS_REG */ -#define RFSYS_REG_COUNT (8U) - - -/*! - * @} - */ /* end of group RFSYS_Register_Masks */ - - -/* RFSYS - Peripheral instance base addresses */ -/** Peripheral RFSYS base address */ -#define RFSYS_BASE (0x40041000u) -/** Peripheral RFSYS base pointer */ -#define RFSYS ((RFSYS_Type *)RFSYS_BASE) -/** Array initializer of RFSYS peripheral base addresses */ -#define RFSYS_BASE_ADDRS { RFSYS_BASE } -/** Array initializer of RFSYS peripheral base pointers */ -#define RFSYS_BASE_PTRS { RFSYS } - -/*! - * @} - */ /* end of group RFSYS_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- ROM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ROM_Peripheral_Access_Layer ROM Peripheral Access Layer - * @{ - */ - -/** ROM - Register Layout Typedef */ -typedef struct { - __I uint32_t ENTRY[3]; /**< Entry, array offset: 0x0, array step: 0x4 */ - __I uint32_t TABLEMARK; /**< End of Table Marker Register, offset: 0xC */ - uint8_t RESERVED_0[4028]; - __I uint32_t SYSACCESS; /**< System Access Register, offset: 0xFCC */ - __I uint32_t PERIPHID4; /**< Peripheral ID Register, offset: 0xFD0 */ - __I uint32_t PERIPHID5; /**< Peripheral ID Register, offset: 0xFD4 */ - __I uint32_t PERIPHID6; /**< Peripheral ID Register, offset: 0xFD8 */ - __I uint32_t PERIPHID7; /**< Peripheral ID Register, offset: 0xFDC */ - __I uint32_t PERIPHID0; /**< Peripheral ID Register, offset: 0xFE0 */ - __I uint32_t PERIPHID1; /**< Peripheral ID Register, offset: 0xFE4 */ - __I uint32_t PERIPHID2; /**< Peripheral ID Register, offset: 0xFE8 */ - __I uint32_t PERIPHID3; /**< Peripheral ID Register, offset: 0xFEC */ - __I uint32_t COMPID[4]; /**< Component ID Register, array offset: 0xFF0, array step: 0x4 */ -} ROM_Type; - -/* ---------------------------------------------------------------------------- - -- ROM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ROM_Register_Masks ROM Register Masks - * @{ - */ - -/*! @name ENTRY - Entry */ -/*! @{ */ - -#define ROM_ENTRY_ENTRY_MASK (0xFFFFFFFFU) -#define ROM_ENTRY_ENTRY_SHIFT (0U) -/*! ENTRY - ENTRY */ -#define ROM_ENTRY_ENTRY(x) (((uint32_t)(((uint32_t)(x)) << ROM_ENTRY_ENTRY_SHIFT)) & ROM_ENTRY_ENTRY_MASK) -/*! @} */ - -/* The count of ROM_ENTRY */ -#define ROM_ENTRY_COUNT (3U) - -/*! @name TABLEMARK - End of Table Marker Register */ -/*! @{ */ - -#define ROM_TABLEMARK_MARK_MASK (0xFFFFFFFFU) -#define ROM_TABLEMARK_MARK_SHIFT (0U) -/*! MARK - MARK */ -#define ROM_TABLEMARK_MARK(x) (((uint32_t)(((uint32_t)(x)) << ROM_TABLEMARK_MARK_SHIFT)) & ROM_TABLEMARK_MARK_MASK) -/*! @} */ - -/*! @name SYSACCESS - System Access Register */ -/*! @{ */ - -#define ROM_SYSACCESS_SYSACCESS_MASK (0xFFFFFFFFU) -#define ROM_SYSACCESS_SYSACCESS_SHIFT (0U) -/*! SYSACCESS - SYSACCESS */ -#define ROM_SYSACCESS_SYSACCESS(x) (((uint32_t)(((uint32_t)(x)) << ROM_SYSACCESS_SYSACCESS_SHIFT)) & ROM_SYSACCESS_SYSACCESS_MASK) -/*! @} */ - -/*! @name PERIPHID4 - Peripheral ID Register */ -/*! @{ */ - -#define ROM_PERIPHID4_PERIPHID_MASK (0xFFFFFFFFU) -#define ROM_PERIPHID4_PERIPHID_SHIFT (0U) -/*! PERIPHID - PERIPHID */ -#define ROM_PERIPHID4_PERIPHID(x) (((uint32_t)(((uint32_t)(x)) << ROM_PERIPHID4_PERIPHID_SHIFT)) & ROM_PERIPHID4_PERIPHID_MASK) -/*! @} */ - -/*! @name PERIPHID5 - Peripheral ID Register */ -/*! @{ */ - -#define ROM_PERIPHID5_PERIPHID_MASK (0xFFFFFFFFU) -#define ROM_PERIPHID5_PERIPHID_SHIFT (0U) -/*! PERIPHID - PERIPHID */ -#define ROM_PERIPHID5_PERIPHID(x) (((uint32_t)(((uint32_t)(x)) << ROM_PERIPHID5_PERIPHID_SHIFT)) & ROM_PERIPHID5_PERIPHID_MASK) -/*! @} */ - -/*! @name PERIPHID6 - Peripheral ID Register */ -/*! @{ */ - -#define ROM_PERIPHID6_PERIPHID_MASK (0xFFFFFFFFU) -#define ROM_PERIPHID6_PERIPHID_SHIFT (0U) -/*! PERIPHID - PERIPHID */ -#define ROM_PERIPHID6_PERIPHID(x) (((uint32_t)(((uint32_t)(x)) << ROM_PERIPHID6_PERIPHID_SHIFT)) & ROM_PERIPHID6_PERIPHID_MASK) -/*! @} */ - -/*! @name PERIPHID7 - Peripheral ID Register */ -/*! @{ */ - -#define ROM_PERIPHID7_PERIPHID_MASK (0xFFFFFFFFU) -#define ROM_PERIPHID7_PERIPHID_SHIFT (0U) -/*! PERIPHID - PERIPHID */ -#define ROM_PERIPHID7_PERIPHID(x) (((uint32_t)(((uint32_t)(x)) << ROM_PERIPHID7_PERIPHID_SHIFT)) & ROM_PERIPHID7_PERIPHID_MASK) -/*! @} */ - -/*! @name PERIPHID0 - Peripheral ID Register */ -/*! @{ */ - -#define ROM_PERIPHID0_PERIPHID_MASK (0xFFFFFFFFU) -#define ROM_PERIPHID0_PERIPHID_SHIFT (0U) -/*! PERIPHID - PERIPHID */ -#define ROM_PERIPHID0_PERIPHID(x) (((uint32_t)(((uint32_t)(x)) << ROM_PERIPHID0_PERIPHID_SHIFT)) & ROM_PERIPHID0_PERIPHID_MASK) -/*! @} */ - -/*! @name PERIPHID1 - Peripheral ID Register */ -/*! @{ */ - -#define ROM_PERIPHID1_PERIPHID_MASK (0xFFFFFFFFU) -#define ROM_PERIPHID1_PERIPHID_SHIFT (0U) -/*! PERIPHID - PERIPHID */ -#define ROM_PERIPHID1_PERIPHID(x) (((uint32_t)(((uint32_t)(x)) << ROM_PERIPHID1_PERIPHID_SHIFT)) & ROM_PERIPHID1_PERIPHID_MASK) -/*! @} */ - -/*! @name PERIPHID2 - Peripheral ID Register */ -/*! @{ */ - -#define ROM_PERIPHID2_PERIPHID_MASK (0xFFFFFFFFU) -#define ROM_PERIPHID2_PERIPHID_SHIFT (0U) -/*! PERIPHID - PERIPHID */ -#define ROM_PERIPHID2_PERIPHID(x) (((uint32_t)(((uint32_t)(x)) << ROM_PERIPHID2_PERIPHID_SHIFT)) & ROM_PERIPHID2_PERIPHID_MASK) -/*! @} */ - -/*! @name PERIPHID3 - Peripheral ID Register */ -/*! @{ */ - -#define ROM_PERIPHID3_PERIPHID_MASK (0xFFFFFFFFU) -#define ROM_PERIPHID3_PERIPHID_SHIFT (0U) -/*! PERIPHID - PERIPHID */ -#define ROM_PERIPHID3_PERIPHID(x) (((uint32_t)(((uint32_t)(x)) << ROM_PERIPHID3_PERIPHID_SHIFT)) & ROM_PERIPHID3_PERIPHID_MASK) -/*! @} */ - -/*! @name COMPID - Component ID Register */ -/*! @{ */ - -#define ROM_COMPID_COMPID_MASK (0xFFFFFFFFU) -#define ROM_COMPID_COMPID_SHIFT (0U) -/*! COMPID - Component ID */ -#define ROM_COMPID_COMPID(x) (((uint32_t)(((uint32_t)(x)) << ROM_COMPID_COMPID_SHIFT)) & ROM_COMPID_COMPID_MASK) -/*! @} */ - -/* The count of ROM_COMPID */ -#define ROM_COMPID_COUNT (4U) - - -/*! - * @} - */ /* end of group ROM_Register_Masks */ - - -/* ROM - Peripheral instance base addresses */ -/** Peripheral ROM base address */ -#define ROM_BASE (0xF0002000u) -/** Peripheral ROM base pointer */ -#define ROM ((ROM_Type *)ROM_BASE) -/** Array initializer of ROM peripheral base addresses */ -#define ROM_BASE_ADDRS { ROM_BASE } -/** Array initializer of ROM peripheral base pointers */ -#define ROM_BASE_PTRS { ROM } - -/*! - * @} - */ /* end of group ROM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- RTC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup RTC_Peripheral_Access_Layer RTC Peripheral Access Layer - * @{ - */ - -/** RTC - Register Layout Typedef */ -typedef struct { - __IO uint32_t TSR; /**< RTC Time Seconds Register, offset: 0x0 */ - __IO uint32_t TPR; /**< RTC Time Prescaler Register, offset: 0x4 */ - __IO uint32_t TAR; /**< RTC Time Alarm Register, offset: 0x8 */ - __IO uint32_t TCR; /**< RTC Time Compensation Register, offset: 0xC */ - __IO uint32_t CR; /**< RTC Control Register, offset: 0x10 */ - __IO uint32_t SR; /**< RTC Status Register, offset: 0x14 */ - __IO uint32_t LR; /**< RTC Lock Register, offset: 0x18 */ - __IO uint32_t IER; /**< RTC Interrupt Enable Register, offset: 0x1C */ -} RTC_Type; - -/* ---------------------------------------------------------------------------- - -- RTC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup RTC_Register_Masks RTC Register Masks - * @{ - */ - -/*! @name TSR - RTC Time Seconds Register */ -/*! @{ */ - -#define RTC_TSR_TSR_MASK (0xFFFFFFFFU) -#define RTC_TSR_TSR_SHIFT (0U) -/*! TSR - Time Seconds Register */ -#define RTC_TSR_TSR(x) (((uint32_t)(((uint32_t)(x)) << RTC_TSR_TSR_SHIFT)) & RTC_TSR_TSR_MASK) -/*! @} */ - -/*! @name TPR - RTC Time Prescaler Register */ -/*! @{ */ - -#define RTC_TPR_TPR_MASK (0xFFFFU) -#define RTC_TPR_TPR_SHIFT (0U) -/*! TPR - Time Prescaler Register */ -#define RTC_TPR_TPR(x) (((uint32_t)(((uint32_t)(x)) << RTC_TPR_TPR_SHIFT)) & RTC_TPR_TPR_MASK) -/*! @} */ - -/*! @name TAR - RTC Time Alarm Register */ -/*! @{ */ - -#define RTC_TAR_TAR_MASK (0xFFFFFFFFU) -#define RTC_TAR_TAR_SHIFT (0U) -/*! TAR - Time Alarm Register */ -#define RTC_TAR_TAR(x) (((uint32_t)(((uint32_t)(x)) << RTC_TAR_TAR_SHIFT)) & RTC_TAR_TAR_MASK) -/*! @} */ - -/*! @name TCR - RTC Time Compensation Register */ -/*! @{ */ - -#define RTC_TCR_TCR_MASK (0xFFU) -#define RTC_TCR_TCR_SHIFT (0U) -/*! TCR - Time Compensation Register - * 0b10000000..Time Prescaler Register overflows every 32896 clock cycles. - * 0b11111111..Time Prescaler Register overflows every 32769 clock cycles. - * 0b00000000..Time Prescaler Register overflows every 32768 clock cycles. - * 0b00000001..Time Prescaler Register overflows every 32767 clock cycles. - * 0b01111111..Time Prescaler Register overflows every 32641 clock cycles. - */ -#define RTC_TCR_TCR(x) (((uint32_t)(((uint32_t)(x)) << RTC_TCR_TCR_SHIFT)) & RTC_TCR_TCR_MASK) - -#define RTC_TCR_CIR_MASK (0xFF00U) -#define RTC_TCR_CIR_SHIFT (8U) -/*! CIR - Compensation Interval Register */ -#define RTC_TCR_CIR(x) (((uint32_t)(((uint32_t)(x)) << RTC_TCR_CIR_SHIFT)) & RTC_TCR_CIR_MASK) - -#define RTC_TCR_TCV_MASK (0xFF0000U) -#define RTC_TCR_TCV_SHIFT (16U) -/*! TCV - Time Compensation Value */ -#define RTC_TCR_TCV(x) (((uint32_t)(((uint32_t)(x)) << RTC_TCR_TCV_SHIFT)) & RTC_TCR_TCV_MASK) - -#define RTC_TCR_CIC_MASK (0xFF000000U) -#define RTC_TCR_CIC_SHIFT (24U) -/*! CIC - Compensation Interval Counter */ -#define RTC_TCR_CIC(x) (((uint32_t)(((uint32_t)(x)) << RTC_TCR_CIC_SHIFT)) & RTC_TCR_CIC_MASK) -/*! @} */ - -/*! @name CR - RTC Control Register */ -/*! @{ */ - -#define RTC_CR_SWR_MASK (0x1U) -#define RTC_CR_SWR_SHIFT (0U) -/*! SWR - Software Reset - * 0b0..No effect. - * 0b1..Resets all RTC registers except for the SWR bit . The SWR bit is cleared by POR and by software explicitly clearing it. - */ -#define RTC_CR_SWR(x) (((uint32_t)(((uint32_t)(x)) << RTC_CR_SWR_SHIFT)) & RTC_CR_SWR_MASK) - -#define RTC_CR_WPE_MASK (0x2U) -#define RTC_CR_WPE_SHIFT (1U) -/*! WPE - Wakeup Pin Enable - * 0b0..Wakeup pin is disabled. - * 0b1..Wakeup pin is enabled and wakeup pin asserts if the RTC interrupt asserts or the wakeup pin is turned on. - */ -#define RTC_CR_WPE(x) (((uint32_t)(((uint32_t)(x)) << RTC_CR_WPE_SHIFT)) & RTC_CR_WPE_MASK) - -#define RTC_CR_SUP_MASK (0x4U) -#define RTC_CR_SUP_SHIFT (2U) -/*! SUP - Supervisor Access - * 0b0..Non-supervisor mode write accesses are not supported and generate a bus error. - * 0b1..Non-supervisor mode write accesses are supported. - */ -#define RTC_CR_SUP(x) (((uint32_t)(((uint32_t)(x)) << RTC_CR_SUP_SHIFT)) & RTC_CR_SUP_MASK) - -#define RTC_CR_UM_MASK (0x8U) -#define RTC_CR_UM_SHIFT (3U) -/*! UM - Update Mode - * 0b0..Registers cannot be written when locked. - * 0b1..Registers can be written when locked under limited conditions. - */ -#define RTC_CR_UM(x) (((uint32_t)(((uint32_t)(x)) << RTC_CR_UM_SHIFT)) & RTC_CR_UM_MASK) - -#define RTC_CR_WPS_MASK (0x10U) -#define RTC_CR_WPS_SHIFT (4U) -/*! WPS - Wakeup Pin Select - * 0b0..Wakeup pin asserts (active low, open drain) if the RTC interrupt asserts or the wakeup pin is turned on. - * 0b1..Wakeup pin instead outputs the RTC 32kHz clock, provided the wakeup pin is turned on and the 32kHz clock is output to other peripherals. - */ -#define RTC_CR_WPS(x) (((uint32_t)(((uint32_t)(x)) << RTC_CR_WPS_SHIFT)) & RTC_CR_WPS_MASK) - -#define RTC_CR_OSCE_MASK (0x100U) -#define RTC_CR_OSCE_SHIFT (8U) -/*! OSCE - Oscillator Enable - * 0b0..32.768 kHz oscillator is disabled. - * 0b1..32.768 kHz oscillator is enabled. After setting this bit, wait the oscillator startup time before - * enabling the time counter to allow the 32.768 kHz clock time to stabilize. - */ -#define RTC_CR_OSCE(x) (((uint32_t)(((uint32_t)(x)) << RTC_CR_OSCE_SHIFT)) & RTC_CR_OSCE_MASK) - -#define RTC_CR_CLKO_MASK (0x200U) -#define RTC_CR_CLKO_SHIFT (9U) -/*! CLKO - Clock Output - * 0b0..The 32 kHz clock is output to other peripherals. - * 0b1..The 32 kHz clock is not output to other peripherals. - */ -#define RTC_CR_CLKO(x) (((uint32_t)(((uint32_t)(x)) << RTC_CR_CLKO_SHIFT)) & RTC_CR_CLKO_MASK) - -#define RTC_CR_SC16P_MASK (0x400U) -#define RTC_CR_SC16P_SHIFT (10U) -/*! SC16P - Oscillator 16pF Load Configure - * 0b0..Disable the load. - * 0b1..Enable the additional load. - */ -#define RTC_CR_SC16P(x) (((uint32_t)(((uint32_t)(x)) << RTC_CR_SC16P_SHIFT)) & RTC_CR_SC16P_MASK) - -#define RTC_CR_SC8P_MASK (0x800U) -#define RTC_CR_SC8P_SHIFT (11U) -/*! SC8P - Oscillator 8pF Load Configure - * 0b0..Disable the load. - * 0b1..Enable the additional load. - */ -#define RTC_CR_SC8P(x) (((uint32_t)(((uint32_t)(x)) << RTC_CR_SC8P_SHIFT)) & RTC_CR_SC8P_MASK) - -#define RTC_CR_SC4P_MASK (0x1000U) -#define RTC_CR_SC4P_SHIFT (12U) -/*! SC4P - Oscillator 4pF Load Configure - * 0b0..Disable the load. - * 0b1..Enable the additional load. - */ -#define RTC_CR_SC4P(x) (((uint32_t)(((uint32_t)(x)) << RTC_CR_SC4P_SHIFT)) & RTC_CR_SC4P_MASK) - -#define RTC_CR_SC2P_MASK (0x2000U) -#define RTC_CR_SC2P_SHIFT (13U) -/*! SC2P - Oscillator 2pF Load Configure - * 0b0..Disable the load. - * 0b1..Enable the additional load. - */ -#define RTC_CR_SC2P(x) (((uint32_t)(((uint32_t)(x)) << RTC_CR_SC2P_SHIFT)) & RTC_CR_SC2P_MASK) -/*! @} */ - -/*! @name SR - RTC Status Register */ -/*! @{ */ - -#define RTC_SR_TIF_MASK (0x1U) -#define RTC_SR_TIF_SHIFT (0U) -/*! TIF - Time Invalid Flag - * 0b0..Time is valid. - * 0b1..Time is invalid and time counter is read as zero. - */ -#define RTC_SR_TIF(x) (((uint32_t)(((uint32_t)(x)) << RTC_SR_TIF_SHIFT)) & RTC_SR_TIF_MASK) - -#define RTC_SR_TOF_MASK (0x2U) -#define RTC_SR_TOF_SHIFT (1U) -/*! TOF - Time Overflow Flag - * 0b0..Time overflow has not occurred. - * 0b1..Time overflow has occurred and time counter is read as zero. - */ -#define RTC_SR_TOF(x) (((uint32_t)(((uint32_t)(x)) << RTC_SR_TOF_SHIFT)) & RTC_SR_TOF_MASK) - -#define RTC_SR_TAF_MASK (0x4U) -#define RTC_SR_TAF_SHIFT (2U) -/*! TAF - Time Alarm Flag - * 0b0..Time alarm has not occurred. - * 0b1..Time alarm has occurred. - */ -#define RTC_SR_TAF(x) (((uint32_t)(((uint32_t)(x)) << RTC_SR_TAF_SHIFT)) & RTC_SR_TAF_MASK) - -#define RTC_SR_TCE_MASK (0x10U) -#define RTC_SR_TCE_SHIFT (4U) -/*! TCE - Time Counter Enable - * 0b0..Time counter is disabled. - * 0b1..Time counter is enabled. - */ -#define RTC_SR_TCE(x) (((uint32_t)(((uint32_t)(x)) << RTC_SR_TCE_SHIFT)) & RTC_SR_TCE_MASK) -/*! @} */ - -/*! @name LR - RTC Lock Register */ -/*! @{ */ - -#define RTC_LR_TCL_MASK (0x8U) -#define RTC_LR_TCL_SHIFT (3U) -/*! TCL - Time Compensation Lock - * 0b0..Time Compensation Register is locked and writes are ignored. - * 0b1..Time Compensation Register is not locked and writes complete as normal. - */ -#define RTC_LR_TCL(x) (((uint32_t)(((uint32_t)(x)) << RTC_LR_TCL_SHIFT)) & RTC_LR_TCL_MASK) - -#define RTC_LR_CRL_MASK (0x10U) -#define RTC_LR_CRL_SHIFT (4U) -/*! CRL - Control Register Lock - * 0b0..Control Register is locked and writes are ignored. - * 0b1..Control Register is not locked and writes complete as normal. - */ -#define RTC_LR_CRL(x) (((uint32_t)(((uint32_t)(x)) << RTC_LR_CRL_SHIFT)) & RTC_LR_CRL_MASK) - -#define RTC_LR_SRL_MASK (0x20U) -#define RTC_LR_SRL_SHIFT (5U) -/*! SRL - Status Register Lock - * 0b0..Status Register is locked and writes are ignored. - * 0b1..Status Register is not locked and writes complete as normal. - */ -#define RTC_LR_SRL(x) (((uint32_t)(((uint32_t)(x)) << RTC_LR_SRL_SHIFT)) & RTC_LR_SRL_MASK) - -#define RTC_LR_LRL_MASK (0x40U) -#define RTC_LR_LRL_SHIFT (6U) -/*! LRL - Lock Register Lock - * 0b0..Lock Register is locked and writes are ignored. - * 0b1..Lock Register is not locked and writes complete as normal. - */ -#define RTC_LR_LRL(x) (((uint32_t)(((uint32_t)(x)) << RTC_LR_LRL_SHIFT)) & RTC_LR_LRL_MASK) -/*! @} */ - -/*! @name IER - RTC Interrupt Enable Register */ -/*! @{ */ - -#define RTC_IER_TIIE_MASK (0x1U) -#define RTC_IER_TIIE_SHIFT (0U) -/*! TIIE - Time Invalid Interrupt Enable - * 0b0..Time invalid flag does not generate an interrupt. - * 0b1..Time invalid flag does generate an interrupt. - */ -#define RTC_IER_TIIE(x) (((uint32_t)(((uint32_t)(x)) << RTC_IER_TIIE_SHIFT)) & RTC_IER_TIIE_MASK) - -#define RTC_IER_TOIE_MASK (0x2U) -#define RTC_IER_TOIE_SHIFT (1U) -/*! TOIE - Time Overflow Interrupt Enable - * 0b0..Time overflow flag does not generate an interrupt. - * 0b1..Time overflow flag does generate an interrupt. - */ -#define RTC_IER_TOIE(x) (((uint32_t)(((uint32_t)(x)) << RTC_IER_TOIE_SHIFT)) & RTC_IER_TOIE_MASK) - -#define RTC_IER_TAIE_MASK (0x4U) -#define RTC_IER_TAIE_SHIFT (2U) -/*! TAIE - Time Alarm Interrupt Enable - * 0b0..Time alarm flag does not generate an interrupt. - * 0b1..Time alarm flag does generate an interrupt. - */ -#define RTC_IER_TAIE(x) (((uint32_t)(((uint32_t)(x)) << RTC_IER_TAIE_SHIFT)) & RTC_IER_TAIE_MASK) - -#define RTC_IER_TSIE_MASK (0x10U) -#define RTC_IER_TSIE_SHIFT (4U) -/*! TSIE - Time Seconds Interrupt Enable - * 0b0..Seconds interrupt is disabled. - * 0b1..Seconds interrupt is enabled. - */ -#define RTC_IER_TSIE(x) (((uint32_t)(((uint32_t)(x)) << RTC_IER_TSIE_SHIFT)) & RTC_IER_TSIE_MASK) - -#define RTC_IER_WPON_MASK (0x80U) -#define RTC_IER_WPON_SHIFT (7U) -/*! WPON - Wakeup Pin On - * 0b0..No effect. - * 0b1..If the wakeup pin is enabled, then the wakeup pin will assert. - */ -#define RTC_IER_WPON(x) (((uint32_t)(((uint32_t)(x)) << RTC_IER_WPON_SHIFT)) & RTC_IER_WPON_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group RTC_Register_Masks */ - - -/* RTC - Peripheral instance base addresses */ -/** Peripheral RTC base address */ -#define RTC_BASE (0x4003D000u) -/** Peripheral RTC base pointer */ -#define RTC ((RTC_Type *)RTC_BASE) -/** Array initializer of RTC peripheral base addresses */ -#define RTC_BASE_ADDRS { RTC_BASE } -/** Array initializer of RTC peripheral base pointers */ -#define RTC_BASE_PTRS { RTC } -/** Interrupt vectors for the RTC peripheral type */ -#define RTC_IRQS { RTC_IRQn } -#define RTC_SECONDS_IRQS { RTC_Seconds_IRQn } - -/*! - * @} - */ /* end of group RTC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- SIM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SIM_Peripheral_Access_Layer SIM Peripheral Access Layer - * @{ - */ - -/** SIM - Register Layout Typedef */ -typedef struct { - __IO uint32_t SOPT1; /**< System Options Register 1, offset: 0x0 */ - __IO uint32_t SOPT1CFG; /**< SOPT1 Configuration Register, offset: 0x4 */ - uint8_t RESERVED_0[4092]; - __IO uint32_t SOPT2; /**< System Options Register 2, offset: 0x1004 */ - uint8_t RESERVED_1[4]; - __IO uint32_t SOPT4; /**< System Options Register 4, offset: 0x100C */ - __IO uint32_t SOPT5; /**< System Options Register 5, offset: 0x1010 */ - uint8_t RESERVED_2[4]; - __IO uint32_t SOPT7; /**< System Options Register 7, offset: 0x1018 */ - uint8_t RESERVED_3[8]; - __I uint32_t SDID; /**< System Device Identification Register, offset: 0x1024 */ - uint8_t RESERVED_4[12]; - __IO uint32_t SCGC4; /**< System Clock Gating Control Register 4, offset: 0x1034 */ - __IO uint32_t SCGC5; /**< System Clock Gating Control Register 5, offset: 0x1038 */ - __IO uint32_t SCGC6; /**< System Clock Gating Control Register 6, offset: 0x103C */ - __IO uint32_t SCGC7; /**< System Clock Gating Control Register 7, offset: 0x1040 */ - __IO uint32_t CLKDIV1; /**< System Clock Divider Register 1, offset: 0x1044 */ - uint8_t RESERVED_5[4]; - __IO uint32_t FCFG1; /**< Flash Configuration Register 1, offset: 0x104C */ - __I uint32_t FCFG2; /**< Flash Configuration Register 2, offset: 0x1050 */ - uint8_t RESERVED_6[4]; - __I uint32_t UIDMH; /**< Unique Identification Register Mid-High, offset: 0x1058 */ - __I uint32_t UIDML; /**< Unique Identification Register Mid Low, offset: 0x105C */ - __I uint32_t UIDL; /**< Unique Identification Register Low, offset: 0x1060 */ - uint8_t RESERVED_7[156]; - __IO uint32_t COPC; /**< COP Control Register, offset: 0x1100 */ - __O uint32_t SRVCOP; /**< Service COP, offset: 0x1104 */ -} SIM_Type; - -/* ---------------------------------------------------------------------------- - -- SIM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SIM_Register_Masks SIM Register Masks - * @{ - */ - -/*! @name SOPT1 - System Options Register 1 */ -/*! @{ */ - -#define SIM_SOPT1_OSC32KOUT_MASK (0x30000U) -#define SIM_SOPT1_OSC32KOUT_SHIFT (16U) -/*! OSC32KOUT - 32K oscillator clock output - * 0b00..ERCLK32K is not output. - * 0b01..ERCLK32K is output on PTE0. - * 0b10..ERCLK32K is output on PTE26. - * 0b11..Reserved. - */ -#define SIM_SOPT1_OSC32KOUT(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT1_OSC32KOUT_SHIFT)) & SIM_SOPT1_OSC32KOUT_MASK) - -#define SIM_SOPT1_OSC32KSEL_MASK (0xC0000U) -#define SIM_SOPT1_OSC32KSEL_SHIFT (18U) -/*! OSC32KSEL - 32K Oscillator Clock Select - * 0b00..System oscillator (OSC32KCLK) - * 0b01..Reserved - * 0b10..RTC_CLKIN - * 0b11..LPO 1kHz - */ -#define SIM_SOPT1_OSC32KSEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT1_OSC32KSEL_SHIFT)) & SIM_SOPT1_OSC32KSEL_MASK) - -#define SIM_SOPT1_USBVSTBY_MASK (0x20000000U) -#define SIM_SOPT1_USBVSTBY_SHIFT (29U) -/*! USBVSTBY - USB voltage regulator in standby mode during VLPR and VLPW modes - * 0b0..USB voltage regulator not in standby during VLPR and VLPW modes. - * 0b1..USB voltage regulator in standby during VLPR and VLPW modes. - */ -#define SIM_SOPT1_USBVSTBY(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT1_USBVSTBY_SHIFT)) & SIM_SOPT1_USBVSTBY_MASK) - -#define SIM_SOPT1_USBSSTBY_MASK (0x40000000U) -#define SIM_SOPT1_USBSSTBY_SHIFT (30U) -/*! USBSSTBY - USB voltage regulator in standby mode during Stop, VLPS, LLS and VLLS modes. - * 0b0..USB voltage regulator not in standby during Stop, VLPS, LLS and VLLS modes. - * 0b1..USB voltage regulator in standby during Stop, VLPS, LLS and VLLS modes. - */ -#define SIM_SOPT1_USBSSTBY(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT1_USBSSTBY_SHIFT)) & SIM_SOPT1_USBSSTBY_MASK) - -#define SIM_SOPT1_USBREGEN_MASK (0x80000000U) -#define SIM_SOPT1_USBREGEN_SHIFT (31U) -/*! USBREGEN - USB voltage regulator enable - * 0b0..USB voltage regulator is disabled. - * 0b1..USB voltage regulator is enabled. - */ -#define SIM_SOPT1_USBREGEN(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT1_USBREGEN_SHIFT)) & SIM_SOPT1_USBREGEN_MASK) -/*! @} */ - -/*! @name SOPT1CFG - SOPT1 Configuration Register */ -/*! @{ */ - -#define SIM_SOPT1CFG_URWE_MASK (0x1000000U) -#define SIM_SOPT1CFG_URWE_SHIFT (24U) -/*! URWE - USB voltage regulator enable write enable - * 0b0..SOPT1 USBREGEN cannot be written. - * 0b1..SOPT1 USBREGEN can be written. - */ -#define SIM_SOPT1CFG_URWE(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT1CFG_URWE_SHIFT)) & SIM_SOPT1CFG_URWE_MASK) - -#define SIM_SOPT1CFG_UVSWE_MASK (0x2000000U) -#define SIM_SOPT1CFG_UVSWE_SHIFT (25U) -/*! UVSWE - USB voltage regulator VLP standby write enable - * 0b0..SOPT1 USBVSTB cannot be written. - * 0b1..SOPT1 USBVSTB can be written. - */ -#define SIM_SOPT1CFG_UVSWE(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT1CFG_UVSWE_SHIFT)) & SIM_SOPT1CFG_UVSWE_MASK) - -#define SIM_SOPT1CFG_USSWE_MASK (0x4000000U) -#define SIM_SOPT1CFG_USSWE_SHIFT (26U) -/*! USSWE - USB voltage regulator stop standby write enable - * 0b0..SOPT1 USBSSTB cannot be written. - * 0b1..SOPT1 USBSSTB can be written. - */ -#define SIM_SOPT1CFG_USSWE(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT1CFG_USSWE_SHIFT)) & SIM_SOPT1CFG_USSWE_MASK) -/*! @} */ - -/*! @name SOPT2 - System Options Register 2 */ -/*! @{ */ - -#define SIM_SOPT2_RTCCLKOUTSEL_MASK (0x10U) -#define SIM_SOPT2_RTCCLKOUTSEL_SHIFT (4U) -/*! RTCCLKOUTSEL - RTC Clock Out Select - * 0b0..RTC 1 Hz clock is output on the RTC_CLKOUT pin. - * 0b1..OSCERCLK clock is output on the RTC_CLKOUT pin. - */ -#define SIM_SOPT2_RTCCLKOUTSEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT2_RTCCLKOUTSEL_SHIFT)) & SIM_SOPT2_RTCCLKOUTSEL_MASK) - -#define SIM_SOPT2_CLKOUTSEL_MASK (0xE0U) -#define SIM_SOPT2_CLKOUTSEL_SHIFT (5U) -/*! CLKOUTSEL - CLKOUT select - * 0b000..Reserved - * 0b001..Reserved - * 0b010..Bus clock - * 0b011..LPO clock (1 kHz) - * 0b100..LIRC_CLK - * 0b101..Reserved - * 0b110..OSCERCLK - * 0b111..IRC48M clock (IRC48M clock can be output to PAD only when chip VDD is 2.7-3.6 V) - */ -#define SIM_SOPT2_CLKOUTSEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT2_CLKOUTSEL_SHIFT)) & SIM_SOPT2_CLKOUTSEL_MASK) - -#define SIM_SOPT2_USBSRC_MASK (0x40000U) -#define SIM_SOPT2_USBSRC_SHIFT (18U) -/*! USBSRC - USB clock source select - * 0b0..External bypass clock (USB_CLKIN). - * 0b1..IRC48M clock - */ -#define SIM_SOPT2_USBSRC(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT2_USBSRC_SHIFT)) & SIM_SOPT2_USBSRC_MASK) - -#define SIM_SOPT2_FLEXIOSRC_MASK (0xC00000U) -#define SIM_SOPT2_FLEXIOSRC_SHIFT (22U) -/*! FLEXIOSRC - FlexIO Module Clock Source Select - * 0b00..Clock disabled - * 0b01..IRC48M clock - * 0b10..OSCERCLK clock - * 0b11..MCGIRCLK clock - */ -#define SIM_SOPT2_FLEXIOSRC(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT2_FLEXIOSRC_SHIFT)) & SIM_SOPT2_FLEXIOSRC_MASK) - -#define SIM_SOPT2_TPMSRC_MASK (0x3000000U) -#define SIM_SOPT2_TPMSRC_SHIFT (24U) -/*! TPMSRC - TPM Clock Source Select - * 0b00..Clock disabled - * 0b01..IRC48M clock - * 0b10..OSCERCLK clock - * 0b11..MCGIRCLK clock - */ -#define SIM_SOPT2_TPMSRC(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT2_TPMSRC_SHIFT)) & SIM_SOPT2_TPMSRC_MASK) - -#define SIM_SOPT2_LPUART0SRC_MASK (0xC000000U) -#define SIM_SOPT2_LPUART0SRC_SHIFT (26U) -/*! LPUART0SRC - LPUART0 Clock Source Select - * 0b00..Clock disabled - * 0b01..IRC48M clock - * 0b10..OSCERCLK clock - * 0b11..MCGIRCLK clock - */ -#define SIM_SOPT2_LPUART0SRC(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT2_LPUART0SRC_SHIFT)) & SIM_SOPT2_LPUART0SRC_MASK) - -#define SIM_SOPT2_LPUART1SRC_MASK (0x30000000U) -#define SIM_SOPT2_LPUART1SRC_SHIFT (28U) -/*! LPUART1SRC - LPUART1 Clock Source Select - * 0b00..Clock disabled - * 0b01..IRC48M clock - * 0b10..OSCERCLK clock - * 0b11..MCGIRCLK clock - */ -#define SIM_SOPT2_LPUART1SRC(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT2_LPUART1SRC_SHIFT)) & SIM_SOPT2_LPUART1SRC_MASK) -/*! @} */ - -/*! @name SOPT4 - System Options Register 4 */ -/*! @{ */ - -#define SIM_SOPT4_TPM1CH0SRC_MASK (0xC0000U) -#define SIM_SOPT4_TPM1CH0SRC_SHIFT (18U) -/*! TPM1CH0SRC - TPM1 channel 0 input capture source select - * 0b00..TPM1_CH0 signal - * 0b01..CMP0 output - * 0b10..Reserved - * 0b11..USB start of frame pulse - */ -#define SIM_SOPT4_TPM1CH0SRC(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT4_TPM1CH0SRC_SHIFT)) & SIM_SOPT4_TPM1CH0SRC_MASK) - -#define SIM_SOPT4_TPM2CH0SRC_MASK (0x100000U) -#define SIM_SOPT4_TPM2CH0SRC_SHIFT (20U) -/*! TPM2CH0SRC - TPM2 Channel 0 Input Capture Source Select - * 0b0..TPM2_CH0 signal - * 0b1..CMP0 output - */ -#define SIM_SOPT4_TPM2CH0SRC(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT4_TPM2CH0SRC_SHIFT)) & SIM_SOPT4_TPM2CH0SRC_MASK) - -#define SIM_SOPT4_TPM0CLKSEL_MASK (0x1000000U) -#define SIM_SOPT4_TPM0CLKSEL_SHIFT (24U) -/*! TPM0CLKSEL - TPM0 External Clock Pin Select - * 0b0..TPM0 external clock driven by TPM_CLKIN0 pin. - * 0b1..TPM0 external clock driven by TPM_CLKIN1 pin. - */ -#define SIM_SOPT4_TPM0CLKSEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT4_TPM0CLKSEL_SHIFT)) & SIM_SOPT4_TPM0CLKSEL_MASK) - -#define SIM_SOPT4_TPM1CLKSEL_MASK (0x2000000U) -#define SIM_SOPT4_TPM1CLKSEL_SHIFT (25U) -/*! TPM1CLKSEL - TPM1 External Clock Pin Select - * 0b0..TPM1 external clock driven by TPM_CLKIN0 pin. - * 0b1..TPM1 external clock driven by TPM_CLKIN1 pin. - */ -#define SIM_SOPT4_TPM1CLKSEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT4_TPM1CLKSEL_SHIFT)) & SIM_SOPT4_TPM1CLKSEL_MASK) - -#define SIM_SOPT4_TPM2CLKSEL_MASK (0x4000000U) -#define SIM_SOPT4_TPM2CLKSEL_SHIFT (26U) -/*! TPM2CLKSEL - TPM2 External Clock Pin Select - * 0b0..TPM2 external clock driven by TPM_CLKIN0 pin. - * 0b1..TPM2 external clock driven by TPM_CLKIN1 pin. - */ -#define SIM_SOPT4_TPM2CLKSEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT4_TPM2CLKSEL_SHIFT)) & SIM_SOPT4_TPM2CLKSEL_MASK) -/*! @} */ - -/*! @name SOPT5 - System Options Register 5 */ -/*! @{ */ - -#define SIM_SOPT5_LPUART0TXSRC_MASK (0x3U) -#define SIM_SOPT5_LPUART0TXSRC_SHIFT (0U) -/*! LPUART0TXSRC - LPUART0 Transmit Data Source Select - * 0b00..LPUART0_TX pin - * 0b01..LPUART0_TX pin modulated with TPM1 channel 0 output - * 0b10..LPUART0_TX pin modulated with TPM2 channel 0 output - * 0b11..Reserved - */ -#define SIM_SOPT5_LPUART0TXSRC(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT5_LPUART0TXSRC_SHIFT)) & SIM_SOPT5_LPUART0TXSRC_MASK) - -#define SIM_SOPT5_LPUART0RXSRC_MASK (0x4U) -#define SIM_SOPT5_LPUART0RXSRC_SHIFT (2U) -/*! LPUART0RXSRC - LPUART0 Receive Data Source Select - * 0b0..LPUART_RX pin - * 0b1..CMP0 output - */ -#define SIM_SOPT5_LPUART0RXSRC(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT5_LPUART0RXSRC_SHIFT)) & SIM_SOPT5_LPUART0RXSRC_MASK) - -#define SIM_SOPT5_LPUART1TXSRC_MASK (0x30U) -#define SIM_SOPT5_LPUART1TXSRC_SHIFT (4U) -/*! LPUART1TXSRC - LPUART1 Transmit Data Source Select - * 0b00..LPUART1_TX pin - * 0b01..LPUART1_TX pin modulated with TPM1 channel 0 output - * 0b10..LPUART1_TX pin modulated with TPM2 channel 0 output - * 0b11..Reserved - */ -#define SIM_SOPT5_LPUART1TXSRC(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT5_LPUART1TXSRC_SHIFT)) & SIM_SOPT5_LPUART1TXSRC_MASK) - -#define SIM_SOPT5_LPUART1RXSRC_MASK (0x40U) -#define SIM_SOPT5_LPUART1RXSRC_SHIFT (6U) -/*! LPUART1RXSRC - LPUART1 Receive Data Source Select - * 0b0..LPUART1_RX pin - * 0b1..CMP0 output - */ -#define SIM_SOPT5_LPUART1RXSRC(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT5_LPUART1RXSRC_SHIFT)) & SIM_SOPT5_LPUART1RXSRC_MASK) - -#define SIM_SOPT5_LPUART0ODE_MASK (0x10000U) -#define SIM_SOPT5_LPUART0ODE_SHIFT (16U) -/*! LPUART0ODE - LPUART0 Open Drain Enable - * 0b0..Open drain is disabled on LPUART0. - * 0b1..Open drain is enabled on LPUART0. - */ -#define SIM_SOPT5_LPUART0ODE(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT5_LPUART0ODE_SHIFT)) & SIM_SOPT5_LPUART0ODE_MASK) - -#define SIM_SOPT5_LPUART1ODE_MASK (0x20000U) -#define SIM_SOPT5_LPUART1ODE_SHIFT (17U) -/*! LPUART1ODE - LPUART1 Open Drain Enable - * 0b0..Open drain is disabled on LPUART1. - * 0b1..Open drain is enabled on LPUART1 - */ -#define SIM_SOPT5_LPUART1ODE(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT5_LPUART1ODE_SHIFT)) & SIM_SOPT5_LPUART1ODE_MASK) - -#define SIM_SOPT5_UART2ODE_MASK (0x40000U) -#define SIM_SOPT5_UART2ODE_SHIFT (18U) -/*! UART2ODE - UART2 Open Drain Enable - * 0b0..Open drain is disabled on UART2 - * 0b1..Open drain is enabled on UART2 - */ -#define SIM_SOPT5_UART2ODE(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT5_UART2ODE_SHIFT)) & SIM_SOPT5_UART2ODE_MASK) -/*! @} */ - -/*! @name SOPT7 - System Options Register 7 */ -/*! @{ */ - -#define SIM_SOPT7_ADC0TRGSEL_MASK (0xFU) -#define SIM_SOPT7_ADC0TRGSEL_SHIFT (0U) -/*! ADC0TRGSEL - ADC0 Trigger Select - * 0b0000..External trigger pin input (EXTRG_IN) - * 0b0001..CMP0 output - * 0b0010..Reserved - * 0b0011..Reserved - * 0b0100..PIT trigger 0 - * 0b0101..PIT trigger 1 - * 0b0110..Reserved - * 0b0111..Reserved - * 0b1000..TPM0 overflow - * 0b1001..TPM1 overflow - * 0b1010..TPM2 overflow - * 0b1011..Reserved - * 0b1100..RTC alarm - * 0b1101..RTC seconds - * 0b1110..LPTMR0 trigger - * 0b1111..Reserved - */ -#define SIM_SOPT7_ADC0TRGSEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT7_ADC0TRGSEL_SHIFT)) & SIM_SOPT7_ADC0TRGSEL_MASK) - -#define SIM_SOPT7_ADC0PRETRGSEL_MASK (0x10U) -#define SIM_SOPT7_ADC0PRETRGSEL_SHIFT (4U) -/*! ADC0PRETRGSEL - ADC0 Pretrigger Select - * 0b0..Pre-trigger ADHDWTSA is selected, thus ADC0 will use ADC0_SC1A configuration for the next ADC conversion - * and store the result in ADC0_RA register. - * 0b1..Pre-trigger ADHDWTSB is selected, thus ADC0 will use ADC0_SC1B configuration for the next ADC conversion - * and store the result in ADC0_RB register. - */ -#define SIM_SOPT7_ADC0PRETRGSEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT7_ADC0PRETRGSEL_SHIFT)) & SIM_SOPT7_ADC0PRETRGSEL_MASK) - -#define SIM_SOPT7_ADC0ALTTRGEN_MASK (0x80U) -#define SIM_SOPT7_ADC0ALTTRGEN_SHIFT (7U) -/*! ADC0ALTTRGEN - ADC0 Alternate Trigger Enable - * 0b0..ADC ADHWT trigger comes from TPM1 channel 0 and channel1. Prior to the assertion of TPM1 channel 0, a - * pre-trigger pulse will be sent to ADHWTSA to initiate an ADC acquisition using ADCx_SC1A configuration and - * store ADC conversion in ADCx_RA Register. Prior to the assertion of TPM1 channel 1 a pre-trigger pulse will - * be sent to ADHWTSB to initiate an ADC acquisition using ADCx_SC1Bconfiguration and store ADC conversion in - * ADCx_RB Register. - * 0b1..ADC ADHWT trigger comes from a peripheral event selected by ADC0TRGSEL bits.ADC0PRETRGSEL bit will select - * the optional ADHWTSA or ADHWTSB select lines for choosing the ADCx_SC1x config and ADCx_Rx result - * regsiter to store the ADC conversion. - */ -#define SIM_SOPT7_ADC0ALTTRGEN(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT7_ADC0ALTTRGEN_SHIFT)) & SIM_SOPT7_ADC0ALTTRGEN_MASK) -/*! @} */ - -/*! @name SDID - System Device Identification Register */ -/*! @{ */ - -#define SIM_SDID_PINID_MASK (0xFU) -#define SIM_SDID_PINID_SHIFT (0U) -/*! PINID - Pincount Identification - * 0b0010..32-pin - * 0b0100..48-pin - * 0b0101..64-pin - * 0b1011..Custom pinout (WLCSP) - */ -#define SIM_SDID_PINID(x) (((uint32_t)(((uint32_t)(x)) << SIM_SDID_PINID_SHIFT)) & SIM_SDID_PINID_MASK) - -#define SIM_SDID_REVID_MASK (0xF000U) -#define SIM_SDID_REVID_SHIFT (12U) -/*! REVID - Device Revision Number */ -#define SIM_SDID_REVID(x) (((uint32_t)(((uint32_t)(x)) << SIM_SDID_REVID_SHIFT)) & SIM_SDID_REVID_MASK) - -#define SIM_SDID_SRAMSIZE_MASK (0xF0000U) -#define SIM_SDID_SRAMSIZE_SHIFT (16U) -/*! SRAMSIZE - System SRAM Size - * 0b0101..16 KB - * 0b0110..32 KB - */ -#define SIM_SDID_SRAMSIZE(x) (((uint32_t)(((uint32_t)(x)) << SIM_SDID_SRAMSIZE_SHIFT)) & SIM_SDID_SRAMSIZE_MASK) - -#define SIM_SDID_SERIESID_MASK (0xF00000U) -#define SIM_SDID_SERIESID_SHIFT (20U) -/*! SERIESID - Kinetis Series ID - * 0b0001..KL family - */ -#define SIM_SDID_SERIESID(x) (((uint32_t)(((uint32_t)(x)) << SIM_SDID_SERIESID_SHIFT)) & SIM_SDID_SERIESID_MASK) - -#define SIM_SDID_SUBFAMID_MASK (0xF000000U) -#define SIM_SDID_SUBFAMID_SHIFT (24U) -/*! SUBFAMID - TBD Sub-Family ID - * 0b0011..TBD Subfamily - */ -#define SIM_SDID_SUBFAMID(x) (((uint32_t)(((uint32_t)(x)) << SIM_SDID_SUBFAMID_SHIFT)) & SIM_SDID_SUBFAMID_MASK) - -#define SIM_SDID_FAMID_MASK (0xF0000000U) -#define SIM_SDID_FAMID_SHIFT (28U) -/*! FAMID - * 0b0001..TBD - * 0b0010..TBD - * 0b0011..TBD - * 0b0100..TBD - */ -#define SIM_SDID_FAMID(x) (((uint32_t)(((uint32_t)(x)) << SIM_SDID_FAMID_SHIFT)) & SIM_SDID_FAMID_MASK) -/*! @} */ - -/*! @name SCGC4 - System Clock Gating Control Register 4 */ -/*! @{ */ - -#define SIM_SCGC4_I2C0_MASK (0x40U) -#define SIM_SCGC4_I2C0_SHIFT (6U) -/*! I2C0 - I2C0 Clock Gate Control - * 0b0..Clock disabled - * 0b1..Clock enabled - */ -#define SIM_SCGC4_I2C0(x) (((uint32_t)(((uint32_t)(x)) << SIM_SCGC4_I2C0_SHIFT)) & SIM_SCGC4_I2C0_MASK) - -#define SIM_SCGC4_I2C1_MASK (0x80U) -#define SIM_SCGC4_I2C1_SHIFT (7U) -/*! I2C1 - I2C1 Clock Gate Control - * 0b0..Clock disabled - * 0b1..Clock enabled - */ -#define SIM_SCGC4_I2C1(x) (((uint32_t)(((uint32_t)(x)) << SIM_SCGC4_I2C1_SHIFT)) & SIM_SCGC4_I2C1_MASK) - -#define SIM_SCGC4_UART2_MASK (0x1000U) -#define SIM_SCGC4_UART2_SHIFT (12U) -/*! UART2 - UART2 Clock Gate Control - * 0b0..Clock disabled - * 0b1..Clock enabled - */ -#define SIM_SCGC4_UART2(x) (((uint32_t)(((uint32_t)(x)) << SIM_SCGC4_UART2_SHIFT)) & SIM_SCGC4_UART2_MASK) - -#define SIM_SCGC4_USBFS_MASK (0x40000U) -#define SIM_SCGC4_USBFS_SHIFT (18U) -/*! USBFS - USB Clock Gate Control - * 0b0..Clock disabled - * 0b1..Clock enabled - */ -#define SIM_SCGC4_USBFS(x) (((uint32_t)(((uint32_t)(x)) << SIM_SCGC4_USBFS_SHIFT)) & SIM_SCGC4_USBFS_MASK) - -#define SIM_SCGC4_CMP0_MASK (0x80000U) -#define SIM_SCGC4_CMP0_SHIFT (19U) -/*! CMP0 - Comparator Clock Gate Control - * 0b0..Clock disabled - * 0b1..Clock enabled - */ -#define SIM_SCGC4_CMP0(x) (((uint32_t)(((uint32_t)(x)) << SIM_SCGC4_CMP0_SHIFT)) & SIM_SCGC4_CMP0_MASK) - -#define SIM_SCGC4_VREF_MASK (0x100000U) -#define SIM_SCGC4_VREF_SHIFT (20U) -/*! VREF - VREF Clock Gate Control - * 0b0..Clock disabled - * 0b1..Clock enabled - */ -#define SIM_SCGC4_VREF(x) (((uint32_t)(((uint32_t)(x)) << SIM_SCGC4_VREF_SHIFT)) & SIM_SCGC4_VREF_MASK) - -#define SIM_SCGC4_SPI0_MASK (0x400000U) -#define SIM_SCGC4_SPI0_SHIFT (22U) -/*! SPI0 - SPI0 Clock Gate Control - * 0b0..Clock disabled - * 0b1..Clock enabled - */ -#define SIM_SCGC4_SPI0(x) (((uint32_t)(((uint32_t)(x)) << SIM_SCGC4_SPI0_SHIFT)) & SIM_SCGC4_SPI0_MASK) - -#define SIM_SCGC4_SPI1_MASK (0x800000U) -#define SIM_SCGC4_SPI1_SHIFT (23U) -/*! SPI1 - SPI1 Clock Gate Control - * 0b0..Clock disabled - * 0b1..Clock enabled - */ -#define SIM_SCGC4_SPI1(x) (((uint32_t)(((uint32_t)(x)) << SIM_SCGC4_SPI1_SHIFT)) & SIM_SCGC4_SPI1_MASK) -/*! @} */ - -/*! @name SCGC5 - System Clock Gating Control Register 5 */ -/*! @{ */ - -#define SIM_SCGC5_LPTMR_MASK (0x1U) -#define SIM_SCGC5_LPTMR_SHIFT (0U) -/*! LPTMR - Low Power Timer Access Control - * 0b0..Access disabled - * 0b1..Access enabled - */ -#define SIM_SCGC5_LPTMR(x) (((uint32_t)(((uint32_t)(x)) << SIM_SCGC5_LPTMR_SHIFT)) & SIM_SCGC5_LPTMR_MASK) - -#define SIM_SCGC5_PORTA_MASK (0x200U) -#define SIM_SCGC5_PORTA_SHIFT (9U) -/*! PORTA - Port A Clock Gate Control - * 0b0..Clock disabled - * 0b1..Clock enabled - */ -#define SIM_SCGC5_PORTA(x) (((uint32_t)(((uint32_t)(x)) << SIM_SCGC5_PORTA_SHIFT)) & SIM_SCGC5_PORTA_MASK) - -#define SIM_SCGC5_PORTB_MASK (0x400U) -#define SIM_SCGC5_PORTB_SHIFT (10U) -/*! PORTB - Port B Clock Gate Control - * 0b0..Clock disabled - * 0b1..Clock enabled - */ -#define SIM_SCGC5_PORTB(x) (((uint32_t)(((uint32_t)(x)) << SIM_SCGC5_PORTB_SHIFT)) & SIM_SCGC5_PORTB_MASK) - -#define SIM_SCGC5_PORTC_MASK (0x800U) -#define SIM_SCGC5_PORTC_SHIFT (11U) -/*! PORTC - Port C Clock Gate Control - * 0b0..Clock disabled - * 0b1..Clock enabled - */ -#define SIM_SCGC5_PORTC(x) (((uint32_t)(((uint32_t)(x)) << SIM_SCGC5_PORTC_SHIFT)) & SIM_SCGC5_PORTC_MASK) - -#define SIM_SCGC5_PORTD_MASK (0x1000U) -#define SIM_SCGC5_PORTD_SHIFT (12U) -/*! PORTD - Port D Clock Gate Control - * 0b0..Clock disabled - * 0b1..Clock enabled - */ -#define SIM_SCGC5_PORTD(x) (((uint32_t)(((uint32_t)(x)) << SIM_SCGC5_PORTD_SHIFT)) & SIM_SCGC5_PORTD_MASK) - -#define SIM_SCGC5_PORTE_MASK (0x2000U) -#define SIM_SCGC5_PORTE_SHIFT (13U) -/*! PORTE - Port E Clock Gate Control - * 0b0..Clock disabled - * 0b1..Clock enabled - */ -#define SIM_SCGC5_PORTE(x) (((uint32_t)(((uint32_t)(x)) << SIM_SCGC5_PORTE_SHIFT)) & SIM_SCGC5_PORTE_MASK) - -#define SIM_SCGC5_SLCD_MASK (0x80000U) -#define SIM_SCGC5_SLCD_SHIFT (19U) -/*! SLCD - Segment LCD Clock Gate Control - * 0b0..Clock disabled - * 0b1..Clock enabled - */ -#define SIM_SCGC5_SLCD(x) (((uint32_t)(((uint32_t)(x)) << SIM_SCGC5_SLCD_SHIFT)) & SIM_SCGC5_SLCD_MASK) - -#define SIM_SCGC5_LPUART0_MASK (0x100000U) -#define SIM_SCGC5_LPUART0_SHIFT (20U) -/*! LPUART0 - LPUART0 Clock Gate Control - * 0b0..Clock disabled - * 0b1..Clock enabled - */ -#define SIM_SCGC5_LPUART0(x) (((uint32_t)(((uint32_t)(x)) << SIM_SCGC5_LPUART0_SHIFT)) & SIM_SCGC5_LPUART0_MASK) - -#define SIM_SCGC5_LPUART1_MASK (0x200000U) -#define SIM_SCGC5_LPUART1_SHIFT (21U) -/*! LPUART1 - LPUART1 Clock Gate Control - * 0b0..Clock disabled - * 0b1..Clock enabled - */ -#define SIM_SCGC5_LPUART1(x) (((uint32_t)(((uint32_t)(x)) << SIM_SCGC5_LPUART1_SHIFT)) & SIM_SCGC5_LPUART1_MASK) - -#define SIM_SCGC5_FLEXIO_MASK (0x80000000U) -#define SIM_SCGC5_FLEXIO_SHIFT (31U) -/*! FLEXIO - FlexIO Module - * 0b0..Clock disabled - * 0b1..Clock enabled - */ -#define SIM_SCGC5_FLEXIO(x) (((uint32_t)(((uint32_t)(x)) << SIM_SCGC5_FLEXIO_SHIFT)) & SIM_SCGC5_FLEXIO_MASK) -/*! @} */ - -/*! @name SCGC6 - System Clock Gating Control Register 6 */ -/*! @{ */ - -#define SIM_SCGC6_FTF_MASK (0x1U) -#define SIM_SCGC6_FTF_SHIFT (0U) -/*! FTF - Flash Memory Clock Gate Control - * 0b0..Clock disabled - * 0b1..Clock enabled - */ -#define SIM_SCGC6_FTF(x) (((uint32_t)(((uint32_t)(x)) << SIM_SCGC6_FTF_SHIFT)) & SIM_SCGC6_FTF_MASK) - -#define SIM_SCGC6_DMAMUX_MASK (0x2U) -#define SIM_SCGC6_DMAMUX_SHIFT (1U) -/*! DMAMUX - DMA Mux Clock Gate Control - * 0b0..Clock disabled - * 0b1..Clock enabled - */ -#define SIM_SCGC6_DMAMUX(x) (((uint32_t)(((uint32_t)(x)) << SIM_SCGC6_DMAMUX_SHIFT)) & SIM_SCGC6_DMAMUX_MASK) - -#define SIM_SCGC6_I2S_MASK (0x8000U) -#define SIM_SCGC6_I2S_SHIFT (15U) -/*! I2S - I2S Clock Gate Control - * 0b0..Clock disabled - * 0b1..Clock enabled - */ -#define SIM_SCGC6_I2S(x) (((uint32_t)(((uint32_t)(x)) << SIM_SCGC6_I2S_SHIFT)) & SIM_SCGC6_I2S_MASK) - -#define SIM_SCGC6_PIT_MASK (0x800000U) -#define SIM_SCGC6_PIT_SHIFT (23U) -/*! PIT - PIT Clock Gate Control - * 0b0..Clock disabled - * 0b1..Clock enabled - */ -#define SIM_SCGC6_PIT(x) (((uint32_t)(((uint32_t)(x)) << SIM_SCGC6_PIT_SHIFT)) & SIM_SCGC6_PIT_MASK) - -#define SIM_SCGC6_TPM0_MASK (0x1000000U) -#define SIM_SCGC6_TPM0_SHIFT (24U) -/*! TPM0 - TPM0 Clock Gate Control - * 0b0..Clock disabled - * 0b1..Clock enabled - */ -#define SIM_SCGC6_TPM0(x) (((uint32_t)(((uint32_t)(x)) << SIM_SCGC6_TPM0_SHIFT)) & SIM_SCGC6_TPM0_MASK) - -#define SIM_SCGC6_TPM1_MASK (0x2000000U) -#define SIM_SCGC6_TPM1_SHIFT (25U) -/*! TPM1 - TPM1 Clock Gate Control - * 0b0..Clock disabled - * 0b1..Clock enabled - */ -#define SIM_SCGC6_TPM1(x) (((uint32_t)(((uint32_t)(x)) << SIM_SCGC6_TPM1_SHIFT)) & SIM_SCGC6_TPM1_MASK) - -#define SIM_SCGC6_TPM2_MASK (0x4000000U) -#define SIM_SCGC6_TPM2_SHIFT (26U) -/*! TPM2 - TPM2 Clock Gate Control - * 0b0..Clock disabled - * 0b1..Clock enabled - */ -#define SIM_SCGC6_TPM2(x) (((uint32_t)(((uint32_t)(x)) << SIM_SCGC6_TPM2_SHIFT)) & SIM_SCGC6_TPM2_MASK) - -#define SIM_SCGC6_ADC0_MASK (0x8000000U) -#define SIM_SCGC6_ADC0_SHIFT (27U) -/*! ADC0 - ADC0 Clock Gate Control - * 0b0..Clock disabled - * 0b1..Clock enabled - */ -#define SIM_SCGC6_ADC0(x) (((uint32_t)(((uint32_t)(x)) << SIM_SCGC6_ADC0_SHIFT)) & SIM_SCGC6_ADC0_MASK) - -#define SIM_SCGC6_RTC_MASK (0x20000000U) -#define SIM_SCGC6_RTC_SHIFT (29U) -/*! RTC - RTC Access Control - * 0b0..Access and interrupts disabled - * 0b1..Access and interrupts enabled - */ -#define SIM_SCGC6_RTC(x) (((uint32_t)(((uint32_t)(x)) << SIM_SCGC6_RTC_SHIFT)) & SIM_SCGC6_RTC_MASK) - -#define SIM_SCGC6_DAC0_MASK (0x80000000U) -#define SIM_SCGC6_DAC0_SHIFT (31U) -/*! DAC0 - DAC0 Clock Gate Control - * 0b0..Clock disabled - * 0b1..Clock enabled - */ -#define SIM_SCGC6_DAC0(x) (((uint32_t)(((uint32_t)(x)) << SIM_SCGC6_DAC0_SHIFT)) & SIM_SCGC6_DAC0_MASK) -/*! @} */ - -/*! @name SCGC7 - System Clock Gating Control Register 7 */ -/*! @{ */ - -#define SIM_SCGC7_DMA_MASK (0x100U) -#define SIM_SCGC7_DMA_SHIFT (8U) -/*! DMA - DMA Clock Gate Control - * 0b0..Clock disabled - * 0b1..Clock enabled - */ -#define SIM_SCGC7_DMA(x) (((uint32_t)(((uint32_t)(x)) << SIM_SCGC7_DMA_SHIFT)) & SIM_SCGC7_DMA_MASK) -/*! @} */ - -/*! @name CLKDIV1 - System Clock Divider Register 1 */ -/*! @{ */ - -#define SIM_CLKDIV1_OUTDIV4_MASK (0x70000U) -#define SIM_CLKDIV1_OUTDIV4_SHIFT (16U) -/*! OUTDIV4 - Clock 4 Output Divider value - * 0b000..Divide-by-1. - * 0b001..Divide-by-2. - * 0b010..Divide-by-3. - * 0b011..Divide-by-4. - * 0b100..Divide-by-5. - * 0b101..Divide-by-6. - * 0b110..Divide-by-7. - * 0b111..Divide-by-8. - */ -#define SIM_CLKDIV1_OUTDIV4(x) (((uint32_t)(((uint32_t)(x)) << SIM_CLKDIV1_OUTDIV4_SHIFT)) & SIM_CLKDIV1_OUTDIV4_MASK) - -#define SIM_CLKDIV1_OUTDIV1_MASK (0xF0000000U) -#define SIM_CLKDIV1_OUTDIV1_SHIFT (28U) -/*! OUTDIV1 - Clock 1 Output Divider value - * 0b0000..Divide-by-1. - * 0b0001..Divide-by-2. - * 0b0010..Divide-by-3. - * 0b0011..Divide-by-4. - * 0b0100..Divide-by-5. - * 0b0101..Divide-by-6. - * 0b0110..Divide-by-7. - * 0b0111..Divide-by-8. - * 0b1000..Divide-by-9. - * 0b1001..Divide-by-10. - * 0b1010..Divide-by-11. - * 0b1011..Divide-by-12. - * 0b1100..Divide-by-13. - * 0b1101..Divide-by-14. - * 0b1110..Divide-by-15. - * 0b1111..Divide-by-16. - */ -#define SIM_CLKDIV1_OUTDIV1(x) (((uint32_t)(((uint32_t)(x)) << SIM_CLKDIV1_OUTDIV1_SHIFT)) & SIM_CLKDIV1_OUTDIV1_MASK) -/*! @} */ - -/*! @name FCFG1 - Flash Configuration Register 1 */ -/*! @{ */ - -#define SIM_FCFG1_FLASHDIS_MASK (0x1U) -#define SIM_FCFG1_FLASHDIS_SHIFT (0U) -/*! FLASHDIS - Flash Disable - * 0b0..Flash is enabled. - * 0b1..Flash is disabled. - */ -#define SIM_FCFG1_FLASHDIS(x) (((uint32_t)(((uint32_t)(x)) << SIM_FCFG1_FLASHDIS_SHIFT)) & SIM_FCFG1_FLASHDIS_MASK) - -#define SIM_FCFG1_FLASHDOZE_MASK (0x2U) -#define SIM_FCFG1_FLASHDOZE_SHIFT (1U) -/*! FLASHDOZE - Flash Doze - * 0b0..Flash remains enabled during Doze mode. - * 0b1..Flash is disabled for the duration of Doze mode. - */ -#define SIM_FCFG1_FLASHDOZE(x) (((uint32_t)(((uint32_t)(x)) << SIM_FCFG1_FLASHDOZE_SHIFT)) & SIM_FCFG1_FLASHDOZE_MASK) - -#define SIM_FCFG1_PFSIZE_MASK (0xF000000U) -#define SIM_FCFG1_PFSIZE_SHIFT (24U) -/*! PFSIZE - Program Flash Size - * 0b0000..8 KB of program flash memory, 1 KB protection region - * 0b0001..16 KB of program flash memory, 1 KB protection region - * 0b0011..32 KB of program flash memory, 1 KB protection region - * 0b0101..64 KB of program flash memory, 2 KB protection region - * 0b0111..128 KB of program flash memory, 4 KB protection region - * 0b1001..256 KB of program flash memory, 8 KB protection region - * 0b1111..256 KB of program flash memory, 8 KB protection region - */ -#define SIM_FCFG1_PFSIZE(x) (((uint32_t)(((uint32_t)(x)) << SIM_FCFG1_PFSIZE_SHIFT)) & SIM_FCFG1_PFSIZE_MASK) -/*! @} */ - -/*! @name FCFG2 - Flash Configuration Register 2 */ -/*! @{ */ - -#define SIM_FCFG2_MAXADDR1_MASK (0x7F0000U) -#define SIM_FCFG2_MAXADDR1_SHIFT (16U) -#define SIM_FCFG2_MAXADDR1(x) (((uint32_t)(((uint32_t)(x)) << SIM_FCFG2_MAXADDR1_SHIFT)) & SIM_FCFG2_MAXADDR1_MASK) - -#define SIM_FCFG2_MAXADDR0_MASK (0x7F000000U) -#define SIM_FCFG2_MAXADDR0_SHIFT (24U) -/*! MAXADDR0 - Max Address lock */ -#define SIM_FCFG2_MAXADDR0(x) (((uint32_t)(((uint32_t)(x)) << SIM_FCFG2_MAXADDR0_SHIFT)) & SIM_FCFG2_MAXADDR0_MASK) -/*! @} */ - -/*! @name UIDMH - Unique Identification Register Mid-High */ -/*! @{ */ - -#define SIM_UIDMH_UID_MASK (0xFFFFU) -#define SIM_UIDMH_UID_SHIFT (0U) -/*! UID - Unique Identification */ -#define SIM_UIDMH_UID(x) (((uint32_t)(((uint32_t)(x)) << SIM_UIDMH_UID_SHIFT)) & SIM_UIDMH_UID_MASK) -/*! @} */ - -/*! @name UIDML - Unique Identification Register Mid Low */ -/*! @{ */ - -#define SIM_UIDML_UID_MASK (0xFFFFFFFFU) -#define SIM_UIDML_UID_SHIFT (0U) -/*! UID - Unique Identification */ -#define SIM_UIDML_UID(x) (((uint32_t)(((uint32_t)(x)) << SIM_UIDML_UID_SHIFT)) & SIM_UIDML_UID_MASK) -/*! @} */ - -/*! @name UIDL - Unique Identification Register Low */ -/*! @{ */ - -#define SIM_UIDL_UID_MASK (0xFFFFFFFFU) -#define SIM_UIDL_UID_SHIFT (0U) -/*! UID - Unique Identification */ -#define SIM_UIDL_UID(x) (((uint32_t)(((uint32_t)(x)) << SIM_UIDL_UID_SHIFT)) & SIM_UIDL_UID_MASK) -/*! @} */ - -/*! @name COPC - COP Control Register */ -/*! @{ */ - -#define SIM_COPC_COPW_MASK (0x1U) -#define SIM_COPC_COPW_SHIFT (0U) -/*! COPW - COP Windowed Mode - * 0b0..Normal mode - * 0b1..Windowed mode - */ -#define SIM_COPC_COPW(x) (((uint32_t)(((uint32_t)(x)) << SIM_COPC_COPW_SHIFT)) & SIM_COPC_COPW_MASK) - -#define SIM_COPC_COPCLKS_MASK (0x2U) -#define SIM_COPC_COPCLKS_SHIFT (1U) -/*! COPCLKS - COP Clock Select - * 0b0..COP configured for short timeout - * 0b1..COP configured for long timeout - */ -#define SIM_COPC_COPCLKS(x) (((uint32_t)(((uint32_t)(x)) << SIM_COPC_COPCLKS_SHIFT)) & SIM_COPC_COPCLKS_MASK) - -#define SIM_COPC_COPT_MASK (0xCU) -#define SIM_COPC_COPT_SHIFT (2U) -/*! COPT - COP Watchdog Timeout - * 0b00..COP disabled - * 0b01..COP timeout after 25 cycles for short timeout or 213 cycles for long timeout - * 0b10..COP timeout after 28 cycles for short timeout or 216 cycles for long timeout - * 0b11..COP timeout after 210 cycles for short timeout or 218 cycles for long timeout - */ -#define SIM_COPC_COPT(x) (((uint32_t)(((uint32_t)(x)) << SIM_COPC_COPT_SHIFT)) & SIM_COPC_COPT_MASK) - -#define SIM_COPC_COPSTPEN_MASK (0x10U) -#define SIM_COPC_COPSTPEN_SHIFT (4U) -/*! COPSTPEN - COP Stop Enable - * 0b0..COP is disabled and the counter is reset in Stop modes - * 0b1..COP is enabled in Stop modes - */ -#define SIM_COPC_COPSTPEN(x) (((uint32_t)(((uint32_t)(x)) << SIM_COPC_COPSTPEN_SHIFT)) & SIM_COPC_COPSTPEN_MASK) - -#define SIM_COPC_COPDBGEN_MASK (0x20U) -#define SIM_COPC_COPDBGEN_SHIFT (5U) -/*! COPDBGEN - COP Debug Enable - * 0b0..COP is disabled and the counter is reset in Debug mode - * 0b1..COP is enabled in Debug mode - */ -#define SIM_COPC_COPDBGEN(x) (((uint32_t)(((uint32_t)(x)) << SIM_COPC_COPDBGEN_SHIFT)) & SIM_COPC_COPDBGEN_MASK) - -#define SIM_COPC_COPCLKSEL_MASK (0xC0U) -#define SIM_COPC_COPCLKSEL_SHIFT (6U) -/*! COPCLKSEL - COP Clock Select - * 0b00..LPO clock (1 kHz) - * 0b01..MCGIRCLK - * 0b10..OSCERCLK - * 0b11..Bus clock - */ -#define SIM_COPC_COPCLKSEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_COPC_COPCLKSEL_SHIFT)) & SIM_COPC_COPCLKSEL_MASK) -/*! @} */ - -/*! @name SRVCOP - Service COP */ -/*! @{ */ - -#define SIM_SRVCOP_SRVCOP_MASK (0xFFU) -#define SIM_SRVCOP_SRVCOP_SHIFT (0U) -/*! SRVCOP - Service COP Register */ -#define SIM_SRVCOP_SRVCOP(x) (((uint32_t)(((uint32_t)(x)) << SIM_SRVCOP_SRVCOP_SHIFT)) & SIM_SRVCOP_SRVCOP_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group SIM_Register_Masks */ - - -/* SIM - Peripheral instance base addresses */ -/** Peripheral SIM base address */ -#define SIM_BASE (0x40047000u) -/** Peripheral SIM base pointer */ -#define SIM ((SIM_Type *)SIM_BASE) -/** Array initializer of SIM peripheral base addresses */ -#define SIM_BASE_ADDRS { SIM_BASE } -/** Array initializer of SIM peripheral base pointers */ -#define SIM_BASE_PTRS { SIM } - -/*! - * @} - */ /* end of group SIM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- SMC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SMC_Peripheral_Access_Layer SMC Peripheral Access Layer - * @{ - */ - -/** SMC - Register Layout Typedef */ -typedef struct { - __IO uint8_t PMPROT; /**< Power Mode Protection register, offset: 0x0 */ - __IO uint8_t PMCTRL; /**< Power Mode Control register, offset: 0x1 */ - __IO uint8_t STOPCTRL; /**< Stop Control Register, offset: 0x2 */ - __I uint8_t PMSTAT; /**< Power Mode Status register, offset: 0x3 */ -} SMC_Type; - -/* ---------------------------------------------------------------------------- - -- SMC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SMC_Register_Masks SMC Register Masks - * @{ - */ - -/*! @name PMPROT - Power Mode Protection register */ -/*! @{ */ - -#define SMC_PMPROT_AVLLS_MASK (0x2U) -#define SMC_PMPROT_AVLLS_SHIFT (1U) -/*! AVLLS - Allow Very-Low-Leakage Stop Mode - * 0b0..Any VLLSx mode is not allowed - * 0b1..Any VLLSx mode is allowed - */ -#define SMC_PMPROT_AVLLS(x) (((uint8_t)(((uint8_t)(x)) << SMC_PMPROT_AVLLS_SHIFT)) & SMC_PMPROT_AVLLS_MASK) - -#define SMC_PMPROT_ALLS_MASK (0x8U) -#define SMC_PMPROT_ALLS_SHIFT (3U) -/*! ALLS - Allow Low-Leakage Stop Mode - * 0b0..LLS is not allowed - * 0b1..LLS is allowed - */ -#define SMC_PMPROT_ALLS(x) (((uint8_t)(((uint8_t)(x)) << SMC_PMPROT_ALLS_SHIFT)) & SMC_PMPROT_ALLS_MASK) - -#define SMC_PMPROT_AVLP_MASK (0x20U) -#define SMC_PMPROT_AVLP_SHIFT (5U) -/*! AVLP - Allow Very-Low-Power Modes - * 0b0..VLPR, VLPW, and VLPS are not allowed. - * 0b1..VLPR, VLPW, and VLPS are allowed. - */ -#define SMC_PMPROT_AVLP(x) (((uint8_t)(((uint8_t)(x)) << SMC_PMPROT_AVLP_SHIFT)) & SMC_PMPROT_AVLP_MASK) -/*! @} */ - -/*! @name PMCTRL - Power Mode Control register */ -/*! @{ */ - -#define SMC_PMCTRL_STOPM_MASK (0x7U) -#define SMC_PMCTRL_STOPM_SHIFT (0U) -/*! STOPM - Stop Mode Control - * 0b000..Normal Stop (STOP) - * 0b001..Reserved - * 0b010..Very-Low-Power Stop (VLPS) - * 0b011..Low-Leakage Stop (LLS) - * 0b100..Very-Low-Leakage Stop (VLLSx) - * 0b101..Reserved - * 0b110..Reseved - * 0b111..Reserved - */ -#define SMC_PMCTRL_STOPM(x) (((uint8_t)(((uint8_t)(x)) << SMC_PMCTRL_STOPM_SHIFT)) & SMC_PMCTRL_STOPM_MASK) - -#define SMC_PMCTRL_STOPA_MASK (0x8U) -#define SMC_PMCTRL_STOPA_SHIFT (3U) -/*! STOPA - Stop Aborted - * 0b0..The previous stop mode entry was successsful. - * 0b1..The previous stop mode entry was aborted. - */ -#define SMC_PMCTRL_STOPA(x) (((uint8_t)(((uint8_t)(x)) << SMC_PMCTRL_STOPA_SHIFT)) & SMC_PMCTRL_STOPA_MASK) - -#define SMC_PMCTRL_RUNM_MASK (0x60U) -#define SMC_PMCTRL_RUNM_SHIFT (5U) -/*! RUNM - Run Mode Control - * 0b00..Normal Run mode (RUN) - * 0b01..Reserved - * 0b10..Very-Low-Power Run mode (VLPR) - * 0b11..Reserved - */ -#define SMC_PMCTRL_RUNM(x) (((uint8_t)(((uint8_t)(x)) << SMC_PMCTRL_RUNM_SHIFT)) & SMC_PMCTRL_RUNM_MASK) -/*! @} */ - -/*! @name STOPCTRL - Stop Control Register */ -/*! @{ */ - -#define SMC_STOPCTRL_VLLSM_MASK (0x7U) -#define SMC_STOPCTRL_VLLSM_SHIFT (0U) -/*! VLLSM - VLLS Mode Control - * 0b000..VLLS0 - * 0b001..VLLS1 - * 0b010..Reserved - * 0b011..VLLS3 - * 0b100..Reserved - * 0b101..Reserved - * 0b110..Reserved - * 0b111..Reserved - */ -#define SMC_STOPCTRL_VLLSM(x) (((uint8_t)(((uint8_t)(x)) << SMC_STOPCTRL_VLLSM_SHIFT)) & SMC_STOPCTRL_VLLSM_MASK) - -#define SMC_STOPCTRL_PORPO_MASK (0x20U) -#define SMC_STOPCTRL_PORPO_SHIFT (5U) -/*! PORPO - POR Power Option - * 0b0..POR detect circuit is enabled in VLLS0 - * 0b1..POR detect circuit is disabled in VLLS0 - */ -#define SMC_STOPCTRL_PORPO(x) (((uint8_t)(((uint8_t)(x)) << SMC_STOPCTRL_PORPO_SHIFT)) & SMC_STOPCTRL_PORPO_MASK) - -#define SMC_STOPCTRL_PSTOPO_MASK (0xC0U) -#define SMC_STOPCTRL_PSTOPO_SHIFT (6U) -/*! PSTOPO - Partial Stop Option - * 0b00..STOP - Normal Stop mode - * 0b01..PSTOP1 - Partial Stop with both system and bus clocks disabled - * 0b10..PSTOP2 - Partial Stop with system clock disabled and bus clock enabled - * 0b11..Reserved - */ -#define SMC_STOPCTRL_PSTOPO(x) (((uint8_t)(((uint8_t)(x)) << SMC_STOPCTRL_PSTOPO_SHIFT)) & SMC_STOPCTRL_PSTOPO_MASK) -/*! @} */ - -/*! @name PMSTAT - Power Mode Status register */ -/*! @{ */ - -#define SMC_PMSTAT_PMSTAT_MASK (0xFFU) -#define SMC_PMSTAT_PMSTAT_SHIFT (0U) -/*! PMSTAT - Power Mode Status */ -#define SMC_PMSTAT_PMSTAT(x) (((uint8_t)(((uint8_t)(x)) << SMC_PMSTAT_PMSTAT_SHIFT)) & SMC_PMSTAT_PMSTAT_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group SMC_Register_Masks */ - - -/* SMC - Peripheral instance base addresses */ -/** Peripheral SMC base address */ -#define SMC_BASE (0x4007E000u) -/** Peripheral SMC base pointer */ -#define SMC ((SMC_Type *)SMC_BASE) -/** Array initializer of SMC peripheral base addresses */ -#define SMC_BASE_ADDRS { SMC_BASE } -/** Array initializer of SMC peripheral base pointers */ -#define SMC_BASE_PTRS { SMC } - -/*! - * @} - */ /* end of group SMC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- SPI Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SPI_Peripheral_Access_Layer SPI Peripheral Access Layer - * @{ - */ - -/** SPI - Register Layout Typedef */ -typedef struct { - __IO uint8_t S; /**< SPI Status Register, offset: 0x0 */ - __IO uint8_t BR; /**< SPI Baud Rate Register, offset: 0x1 */ - __IO uint8_t C2; /**< SPI Control Register 2, offset: 0x2 */ - __IO uint8_t C1; /**< SPI Control Register 1, offset: 0x3 */ - __IO uint8_t ML; /**< SPI Match Register low, offset: 0x4 */ - __IO uint8_t MH; /**< SPI match register high, offset: 0x5 */ - __IO uint8_t DL; /**< SPI Data Register low, offset: 0x6 */ - __IO uint8_t DH; /**< SPI data register high, offset: 0x7 */ - uint8_t RESERVED_0[2]; - __IO uint8_t CI; /**< SPI clear interrupt register, offset: 0xA, available only on: SPI1 (missing on SPI0) */ - __IO uint8_t C3; /**< SPI control register 3, offset: 0xB, available only on: SPI1 (missing on SPI0) */ -} SPI_Type; - -/* ---------------------------------------------------------------------------- - -- SPI Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SPI_Register_Masks SPI Register Masks - * @{ - */ - -/*! @name S - SPI Status Register */ -/*! @{ */ - -#define SPI_S_RFIFOEF_MASK (0x1U) -#define SPI_S_RFIFOEF_SHIFT (0U) -/*! RFIFOEF - SPI read FIFO empty flag - * 0b0..Read FIFO has data. Reads of the DH:DL registers in 16-bit mode or the DL register in 8-bit mode will empty the read FIFO. - * 0b1..Read FIFO is empty. - */ -#define SPI_S_RFIFOEF(x) (((uint8_t)(((uint8_t)(x)) << SPI_S_RFIFOEF_SHIFT)) & SPI_S_RFIFOEF_MASK) - -#define SPI_S_TXFULLF_MASK (0x2U) -#define SPI_S_TXFULLF_SHIFT (1U) -/*! TXFULLF - Transmit FIFO full flag - * 0b0..Transmit FIFO has less than 8 bytes - * 0b1..Transmit FIFO has 8 bytes of data - */ -#define SPI_S_TXFULLF(x) (((uint8_t)(((uint8_t)(x)) << SPI_S_TXFULLF_SHIFT)) & SPI_S_TXFULLF_MASK) - -#define SPI_S_TNEAREF_MASK (0x4U) -#define SPI_S_TNEAREF_SHIFT (2U) -/*! TNEAREF - Transmit FIFO nearly empty flag - * 0b0..Transmit FIFO has more than 16 bits (when C3[TNEAREF_MARK] is 0) or more than 32 bits (when C3[TNEAREF_MARK] is 1) remaining to transmit - * 0b1..Transmit FIFO has an amount of data equal to or less than 16 bits (when C3[TNEAREF_MARK] is 0) or 32 bits - * (when C3[TNEAREF_MARK] is 1) remaining to transmit - */ -#define SPI_S_TNEAREF(x) (((uint8_t)(((uint8_t)(x)) << SPI_S_TNEAREF_SHIFT)) & SPI_S_TNEAREF_MASK) - -#define SPI_S_RNFULLF_MASK (0x8U) -#define SPI_S_RNFULLF_SHIFT (3U) -/*! RNFULLF - Receive FIFO nearly full flag - * 0b0..Receive FIFO has received less than 48 bits (when C3[RNFULLF_MARK] is 0) or less than 32 bits (when C3[RNFULLF_MARK] is 1) - * 0b1..Receive FIFO has received data of an amount equal to or greater than 48 bits (when C3[RNFULLF_MARK] is 0) - * or 32 bits (when C3[RNFULLF_MARK] is 1) - */ -#define SPI_S_RNFULLF(x) (((uint8_t)(((uint8_t)(x)) << SPI_S_RNFULLF_SHIFT)) & SPI_S_RNFULLF_MASK) - -#define SPI_S_MODF_MASK (0x10U) -#define SPI_S_MODF_SHIFT (4U) -/*! MODF - Master Mode Fault Flag - * 0b0..No mode fault error - * 0b1..Mode fault error detected - */ -#define SPI_S_MODF(x) (((uint8_t)(((uint8_t)(x)) << SPI_S_MODF_SHIFT)) & SPI_S_MODF_MASK) - -#define SPI_S_SPTEF_MASK (0x20U) -#define SPI_S_SPTEF_SHIFT (5U) -/*! SPTEF - SPI Transmit Buffer Empty Flag (when FIFO is not supported or not enabled) or SPI - * transmit FIFO empty flag (when FIFO is supported and enabled) - * 0b0..SPI transmit buffer not empty (when FIFOMODE is not present or is 0) or SPI FIFO not empty (when FIFOMODE is 1) - * 0b1..SPI transmit buffer empty (when FIFOMODE is not present or is 0) or SPI FIFO empty (when FIFOMODE is 1) - */ -#define SPI_S_SPTEF(x) (((uint8_t)(((uint8_t)(x)) << SPI_S_SPTEF_SHIFT)) & SPI_S_SPTEF_MASK) - -#define SPI_S_SPMF_MASK (0x40U) -#define SPI_S_SPMF_SHIFT (6U) -/*! SPMF - SPI Match Flag - * 0b0..Value in the receive data buffer does not match the value in the MH:ML registers - * 0b1..Value in the receive data buffer matches the value in the MH:ML registers - */ -#define SPI_S_SPMF(x) (((uint8_t)(((uint8_t)(x)) << SPI_S_SPMF_SHIFT)) & SPI_S_SPMF_MASK) - -#define SPI_S_SPRF_MASK (0x80U) -#define SPI_S_SPRF_SHIFT (7U) -/*! SPRF - SPI Read Buffer Full Flag (when FIFO is not supported or not enabled) or SPI read FIFO - * FULL flag (when FIFO is supported and enabled) - * 0b0..No data available in the receive data buffer (when FIFOMODE is not present or is 0) or Read FIFO is not full (when FIFOMODE is 1) - * 0b1..Data available in the receive data buffer (when FIFOMODE is not present or is 0) or Read FIFO is full (when FIFOMODE is 1) - */ -#define SPI_S_SPRF(x) (((uint8_t)(((uint8_t)(x)) << SPI_S_SPRF_SHIFT)) & SPI_S_SPRF_MASK) -/*! @} */ - -/*! @name BR - SPI Baud Rate Register */ -/*! @{ */ - -#define SPI_BR_SPR_MASK (0xFU) -#define SPI_BR_SPR_SHIFT (0U) -/*! SPR - SPI Baud Rate Divisor - * 0b0000..Baud rate divisor is 2. - * 0b0001..Baud rate divisor is 4. - * 0b0010..Baud rate divisor is 8. - * 0b0011..Baud rate divisor is 16. - * 0b0100..Baud rate divisor is 32. - * 0b0101..Baud rate divisor is 64. - * 0b0110..Baud rate divisor is 128. - * 0b0111..Baud rate divisor is 256. - * 0b1000..Baud rate divisor is 512. - */ -#define SPI_BR_SPR(x) (((uint8_t)(((uint8_t)(x)) << SPI_BR_SPR_SHIFT)) & SPI_BR_SPR_MASK) - -#define SPI_BR_SPPR_MASK (0x70U) -#define SPI_BR_SPPR_SHIFT (4U) -/*! SPPR - SPI Baud Rate Prescale Divisor - * 0b000..Baud rate prescaler divisor is 1. - * 0b001..Baud rate prescaler divisor is 2. - * 0b010..Baud rate prescaler divisor is 3. - * 0b011..Baud rate prescaler divisor is 4. - * 0b100..Baud rate prescaler divisor is 5. - * 0b101..Baud rate prescaler divisor is 6. - * 0b110..Baud rate prescaler divisor is 7. - * 0b111..Baud rate prescaler divisor is 8. - */ -#define SPI_BR_SPPR(x) (((uint8_t)(((uint8_t)(x)) << SPI_BR_SPPR_SHIFT)) & SPI_BR_SPPR_MASK) -/*! @} */ - -/*! @name C2 - SPI Control Register 2 */ -/*! @{ */ - -#define SPI_C2_SPC0_MASK (0x1U) -#define SPI_C2_SPC0_SHIFT (0U) -/*! SPC0 - SPI Pin Control 0 - * 0b0..SPI uses separate pins for data input and data output (pin mode is normal). In master mode of operation: - * MISO is master in and MOSI is master out. In slave mode of operation: MISO is slave out and MOSI is slave - * in. - * 0b1..SPI configured for single-wire bidirectional operation (pin mode is bidirectional). In master mode of - * operation: MISO is not used by SPI; MOSI is master in when BIDIROE is 0 or master I/O when BIDIROE is 1. In - * slave mode of operation: MISO is slave in when BIDIROE is 0 or slave I/O when BIDIROE is 1; MOSI is not - * used by SPI. - */ -#define SPI_C2_SPC0(x) (((uint8_t)(((uint8_t)(x)) << SPI_C2_SPC0_SHIFT)) & SPI_C2_SPC0_MASK) - -#define SPI_C2_SPISWAI_MASK (0x2U) -#define SPI_C2_SPISWAI_SHIFT (1U) -/*! SPISWAI - SPI Stop in Wait Mode - * 0b0..SPI clocks continue to operate in Wait mode. - * 0b1..SPI clocks stop when the MCU enters Wait mode. - */ -#define SPI_C2_SPISWAI(x) (((uint8_t)(((uint8_t)(x)) << SPI_C2_SPISWAI_SHIFT)) & SPI_C2_SPISWAI_MASK) - -#define SPI_C2_RXDMAE_MASK (0x4U) -#define SPI_C2_RXDMAE_SHIFT (2U) -/*! RXDMAE - Receive DMA enable - * 0b0..DMA request for receive is disabled and interrupt from SPRF is allowed - * 0b1..DMA request for receive is enabled and interrupt from SPRF is disabled - */ -#define SPI_C2_RXDMAE(x) (((uint8_t)(((uint8_t)(x)) << SPI_C2_RXDMAE_SHIFT)) & SPI_C2_RXDMAE_MASK) - -#define SPI_C2_BIDIROE_MASK (0x8U) -#define SPI_C2_BIDIROE_SHIFT (3U) -/*! BIDIROE - Bidirectional Mode Output Enable - * 0b0..Output driver disabled so SPI data I/O pin acts as an input - * 0b1..SPI I/O pin enabled as an output - */ -#define SPI_C2_BIDIROE(x) (((uint8_t)(((uint8_t)(x)) << SPI_C2_BIDIROE_SHIFT)) & SPI_C2_BIDIROE_MASK) - -#define SPI_C2_MODFEN_MASK (0x10U) -#define SPI_C2_MODFEN_SHIFT (4U) -/*! MODFEN - Master Mode-Fault Function Enable - * 0b0..Mode fault function disabled, master SS pin reverts to general-purpose I/O not controlled by SPI - * 0b1..Mode fault function enabled, master SS pin acts as the mode fault input or the slave select output - */ -#define SPI_C2_MODFEN(x) (((uint8_t)(((uint8_t)(x)) << SPI_C2_MODFEN_SHIFT)) & SPI_C2_MODFEN_MASK) - -#define SPI_C2_TXDMAE_MASK (0x20U) -#define SPI_C2_TXDMAE_SHIFT (5U) -/*! TXDMAE - Transmit DMA enable - * 0b0..DMA request for transmit is disabled and interrupt from SPTEF is allowed - * 0b1..DMA request for transmit is enabled and interrupt from SPTEF is disabled - */ -#define SPI_C2_TXDMAE(x) (((uint8_t)(((uint8_t)(x)) << SPI_C2_TXDMAE_SHIFT)) & SPI_C2_TXDMAE_MASK) - -#define SPI_C2_SPIMODE_MASK (0x40U) -#define SPI_C2_SPIMODE_SHIFT (6U) -/*! SPIMODE - SPI 8-bit or 16-bit mode - * 0b0..8-bit SPI shift register, match register, and buffers - * 0b1..16-bit SPI shift register, match register, and buffers - */ -#define SPI_C2_SPIMODE(x) (((uint8_t)(((uint8_t)(x)) << SPI_C2_SPIMODE_SHIFT)) & SPI_C2_SPIMODE_MASK) - -#define SPI_C2_SPMIE_MASK (0x80U) -#define SPI_C2_SPMIE_SHIFT (7U) -/*! SPMIE - SPI Match Interrupt Enable - * 0b0..Interrupts from SPMF inhibited (use polling) - * 0b1..When SPMF is 1, requests a hardware interrupt - */ -#define SPI_C2_SPMIE(x) (((uint8_t)(((uint8_t)(x)) << SPI_C2_SPMIE_SHIFT)) & SPI_C2_SPMIE_MASK) -/*! @} */ - -/*! @name C1 - SPI Control Register 1 */ -/*! @{ */ - -#define SPI_C1_LSBFE_MASK (0x1U) -#define SPI_C1_LSBFE_SHIFT (0U) -/*! LSBFE - LSB First (shifter direction) - * 0b0..SPI serial data transfers start with the most significant bit. - * 0b1..SPI serial data transfers start with the least significant bit. - */ -#define SPI_C1_LSBFE(x) (((uint8_t)(((uint8_t)(x)) << SPI_C1_LSBFE_SHIFT)) & SPI_C1_LSBFE_MASK) - -#define SPI_C1_SSOE_MASK (0x2U) -#define SPI_C1_SSOE_SHIFT (1U) -/*! SSOE - Slave Select Output Enable - * 0b0..When C2[MODFEN] is 0: In master mode, SS pin function is general-purpose I/O (not SPI). In slave mode, SS - * pin function is slave select input. When C2[MODFEN] is 1: In master mode, SS pin function is SS input for - * mode fault. In slave mode, SS pin function is slave select input. - * 0b1..When C2[MODFEN] is 0: In master mode, SS pin function is general-purpose I/O (not SPI). In slave mode, SS - * pin function is slave select input. When C2[MODFEN] is 1: In master mode, SS pin function is automatic SS - * output. In slave mode: SS pin function is slave select input. - */ -#define SPI_C1_SSOE(x) (((uint8_t)(((uint8_t)(x)) << SPI_C1_SSOE_SHIFT)) & SPI_C1_SSOE_MASK) - -#define SPI_C1_CPHA_MASK (0x4U) -#define SPI_C1_CPHA_SHIFT (2U) -/*! CPHA - Clock Phase - * 0b0..First edge on SPSCK occurs at the middle of the first cycle of a data transfer. - * 0b1..First edge on SPSCK occurs at the start of the first cycle of a data transfer. - */ -#define SPI_C1_CPHA(x) (((uint8_t)(((uint8_t)(x)) << SPI_C1_CPHA_SHIFT)) & SPI_C1_CPHA_MASK) - -#define SPI_C1_CPOL_MASK (0x8U) -#define SPI_C1_CPOL_SHIFT (3U) -/*! CPOL - Clock Polarity - * 0b0..Active-high SPI clock (idles low) - * 0b1..Active-low SPI clock (idles high) - */ -#define SPI_C1_CPOL(x) (((uint8_t)(((uint8_t)(x)) << SPI_C1_CPOL_SHIFT)) & SPI_C1_CPOL_MASK) - -#define SPI_C1_MSTR_MASK (0x10U) -#define SPI_C1_MSTR_SHIFT (4U) -/*! MSTR - Master/Slave Mode Select - * 0b0..SPI module configured as a slave SPI device - * 0b1..SPI module configured as a master SPI device - */ -#define SPI_C1_MSTR(x) (((uint8_t)(((uint8_t)(x)) << SPI_C1_MSTR_SHIFT)) & SPI_C1_MSTR_MASK) - -#define SPI_C1_SPTIE_MASK (0x20U) -#define SPI_C1_SPTIE_SHIFT (5U) -/*! SPTIE - SPI Transmit Interrupt Enable - * 0b0..Interrupts from SPTEF inhibited (use polling) - * 0b1..When SPTEF is 1, hardware interrupt requested - */ -#define SPI_C1_SPTIE(x) (((uint8_t)(((uint8_t)(x)) << SPI_C1_SPTIE_SHIFT)) & SPI_C1_SPTIE_MASK) - -#define SPI_C1_SPE_MASK (0x40U) -#define SPI_C1_SPE_SHIFT (6U) -/*! SPE - SPI System Enable - * 0b0..SPI system inactive - * 0b1..SPI system enabled - */ -#define SPI_C1_SPE(x) (((uint8_t)(((uint8_t)(x)) << SPI_C1_SPE_SHIFT)) & SPI_C1_SPE_MASK) - -#define SPI_C1_SPIE_MASK (0x80U) -#define SPI_C1_SPIE_SHIFT (7U) -/*! SPIE - SPI Interrupt Enable: for SPRF and MODF (when FIFO is not supported or not enabled) or - * for read FIFO (when FIFO is supported and enabled) - * 0b0..Interrupts from SPRF and MODF are inhibited-use polling (when FIFOMODE is not present or is 0) or Read - * FIFO Full Interrupts are disabled (when FIFOMODE is 1) - * 0b1..Request a hardware interrupt when SPRF or MODF is 1 (when FIFOMODE is not present or is 0) or Read FIFO - * Full Interrupts are enabled (when FIFOMODE is 1) - */ -#define SPI_C1_SPIE(x) (((uint8_t)(((uint8_t)(x)) << SPI_C1_SPIE_SHIFT)) & SPI_C1_SPIE_MASK) -/*! @} */ - -/*! @name ML - SPI Match Register low */ -/*! @{ */ - -#define SPI_ML_Bits_MASK (0xFFU) -#define SPI_ML_Bits_SHIFT (0U) -/*! Bits - Hardware compare value (low byte) */ -#define SPI_ML_Bits(x) (((uint8_t)(((uint8_t)(x)) << SPI_ML_Bits_SHIFT)) & SPI_ML_Bits_MASK) -/*! @} */ - -/*! @name MH - SPI match register high */ -/*! @{ */ - -#define SPI_MH_Bits_MASK (0xFFU) -#define SPI_MH_Bits_SHIFT (0U) -/*! Bits - Hardware compare value (high byte) */ -#define SPI_MH_Bits(x) (((uint8_t)(((uint8_t)(x)) << SPI_MH_Bits_SHIFT)) & SPI_MH_Bits_MASK) -/*! @} */ - -/*! @name DL - SPI Data Register low */ -/*! @{ */ - -#define SPI_DL_Bits_MASK (0xFFU) -#define SPI_DL_Bits_SHIFT (0U) -/*! Bits - Data (low byte) */ -#define SPI_DL_Bits(x) (((uint8_t)(((uint8_t)(x)) << SPI_DL_Bits_SHIFT)) & SPI_DL_Bits_MASK) -/*! @} */ - -/*! @name DH - SPI data register high */ -/*! @{ */ - -#define SPI_DH_Bits_MASK (0xFFU) -#define SPI_DH_Bits_SHIFT (0U) -/*! Bits - Data (high byte) */ -#define SPI_DH_Bits(x) (((uint8_t)(((uint8_t)(x)) << SPI_DH_Bits_SHIFT)) & SPI_DH_Bits_MASK) -/*! @} */ - -/*! @name CI - SPI clear interrupt register */ -/*! @{ */ - -#define SPI_CI_SPRFCI_MASK (0x1U) -#define SPI_CI_SPRFCI_SHIFT (0U) -/*! SPRFCI - Receive FIFO full flag clear interrupt */ -#define SPI_CI_SPRFCI(x) (((uint8_t)(((uint8_t)(x)) << SPI_CI_SPRFCI_SHIFT)) & SPI_CI_SPRFCI_MASK) - -#define SPI_CI_SPTEFCI_MASK (0x2U) -#define SPI_CI_SPTEFCI_SHIFT (1U) -/*! SPTEFCI - Transmit FIFO empty flag clear interrupt */ -#define SPI_CI_SPTEFCI(x) (((uint8_t)(((uint8_t)(x)) << SPI_CI_SPTEFCI_SHIFT)) & SPI_CI_SPTEFCI_MASK) - -#define SPI_CI_RNFULLFCI_MASK (0x4U) -#define SPI_CI_RNFULLFCI_SHIFT (2U) -/*! RNFULLFCI - Receive FIFO nearly full flag clear interrupt */ -#define SPI_CI_RNFULLFCI(x) (((uint8_t)(((uint8_t)(x)) << SPI_CI_RNFULLFCI_SHIFT)) & SPI_CI_RNFULLFCI_MASK) - -#define SPI_CI_TNEAREFCI_MASK (0x8U) -#define SPI_CI_TNEAREFCI_SHIFT (3U) -/*! TNEAREFCI - Transmit FIFO nearly empty flag clear interrupt */ -#define SPI_CI_TNEAREFCI(x) (((uint8_t)(((uint8_t)(x)) << SPI_CI_TNEAREFCI_SHIFT)) & SPI_CI_TNEAREFCI_MASK) - -#define SPI_CI_RXFOF_MASK (0x10U) -#define SPI_CI_RXFOF_SHIFT (4U) -/*! RXFOF - Receive FIFO overflow flag - * 0b0..Receive FIFO overflow condition has not occurred - * 0b1..Receive FIFO overflow condition occurred - */ -#define SPI_CI_RXFOF(x) (((uint8_t)(((uint8_t)(x)) << SPI_CI_RXFOF_SHIFT)) & SPI_CI_RXFOF_MASK) - -#define SPI_CI_TXFOF_MASK (0x20U) -#define SPI_CI_TXFOF_SHIFT (5U) -/*! TXFOF - Transmit FIFO overflow flag - * 0b0..Transmit FIFO overflow condition has not occurred - * 0b1..Transmit FIFO overflow condition occurred - */ -#define SPI_CI_TXFOF(x) (((uint8_t)(((uint8_t)(x)) << SPI_CI_TXFOF_SHIFT)) & SPI_CI_TXFOF_MASK) - -#define SPI_CI_RXFERR_MASK (0x40U) -#define SPI_CI_RXFERR_SHIFT (6U) -/*! RXFERR - Receive FIFO error flag - * 0b0..No receive FIFO error occurred - * 0b1..A receive FIFO error occurred - */ -#define SPI_CI_RXFERR(x) (((uint8_t)(((uint8_t)(x)) << SPI_CI_RXFERR_SHIFT)) & SPI_CI_RXFERR_MASK) - -#define SPI_CI_TXFERR_MASK (0x80U) -#define SPI_CI_TXFERR_SHIFT (7U) -/*! TXFERR - Transmit FIFO error flag - * 0b0..No transmit FIFO error occurred - * 0b1..A transmit FIFO error occurred - */ -#define SPI_CI_TXFERR(x) (((uint8_t)(((uint8_t)(x)) << SPI_CI_TXFERR_SHIFT)) & SPI_CI_TXFERR_MASK) -/*! @} */ - -/*! @name C3 - SPI control register 3 */ -/*! @{ */ - -#define SPI_C3_FIFOMODE_MASK (0x1U) -#define SPI_C3_FIFOMODE_SHIFT (0U) -/*! FIFOMODE - FIFO mode enable - * 0b0..Buffer mode disabled - * 0b1..Data available in the receive data buffer - */ -#define SPI_C3_FIFOMODE(x) (((uint8_t)(((uint8_t)(x)) << SPI_C3_FIFOMODE_SHIFT)) & SPI_C3_FIFOMODE_MASK) - -#define SPI_C3_RNFULLIEN_MASK (0x2U) -#define SPI_C3_RNFULLIEN_SHIFT (1U) -/*! RNFULLIEN - Receive FIFO nearly full interrupt enable - * 0b0..No interrupt upon RNFULLF being set - * 0b1..Enable interrupts upon RNFULLF being set - */ -#define SPI_C3_RNFULLIEN(x) (((uint8_t)(((uint8_t)(x)) << SPI_C3_RNFULLIEN_SHIFT)) & SPI_C3_RNFULLIEN_MASK) - -#define SPI_C3_TNEARIEN_MASK (0x4U) -#define SPI_C3_TNEARIEN_SHIFT (2U) -/*! TNEARIEN - Transmit FIFO nearly empty interrupt enable - * 0b0..No interrupt upon TNEAREF being set - * 0b1..Enable interrupts upon TNEAREF being set - */ -#define SPI_C3_TNEARIEN(x) (((uint8_t)(((uint8_t)(x)) << SPI_C3_TNEARIEN_SHIFT)) & SPI_C3_TNEARIEN_MASK) - -#define SPI_C3_INTCLR_MASK (0x8U) -#define SPI_C3_INTCLR_SHIFT (3U) -/*! INTCLR - Interrupt clearing mechanism select - * 0b0..These interrupts are cleared when the corresponding flags are cleared depending on the state of the FIFOs - * 0b1..These interrupts are cleared by writing the corresponding bits in the CI register - */ -#define SPI_C3_INTCLR(x) (((uint8_t)(((uint8_t)(x)) << SPI_C3_INTCLR_SHIFT)) & SPI_C3_INTCLR_MASK) - -#define SPI_C3_RNFULLF_MARK_MASK (0x10U) -#define SPI_C3_RNFULLF_MARK_SHIFT (4U) -/*! RNFULLF_MARK - Receive FIFO nearly full watermark - * 0b0..RNFULLF is set when the receive FIFO has 48 bits or more - * 0b1..RNFULLF is set when the receive FIFO has 32 bits or more - */ -#define SPI_C3_RNFULLF_MARK(x) (((uint8_t)(((uint8_t)(x)) << SPI_C3_RNFULLF_MARK_SHIFT)) & SPI_C3_RNFULLF_MARK_MASK) - -#define SPI_C3_TNEAREF_MARK_MASK (0x20U) -#define SPI_C3_TNEAREF_MARK_SHIFT (5U) -/*! TNEAREF_MARK - Transmit FIFO nearly empty watermark - * 0b0..TNEAREF is set when the transmit FIFO has 16 bits or less - * 0b1..TNEAREF is set when the transmit FIFO has 32 bits or less - */ -#define SPI_C3_TNEAREF_MARK(x) (((uint8_t)(((uint8_t)(x)) << SPI_C3_TNEAREF_MARK_SHIFT)) & SPI_C3_TNEAREF_MARK_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group SPI_Register_Masks */ - - -/* SPI - Peripheral instance base addresses */ -/** Peripheral SPI0 base address */ -#define SPI0_BASE (0x40076000u) -/** Peripheral SPI0 base pointer */ -#define SPI0 ((SPI_Type *)SPI0_BASE) -/** Peripheral SPI1 base address */ -#define SPI1_BASE (0x40077000u) -/** Peripheral SPI1 base pointer */ -#define SPI1 ((SPI_Type *)SPI1_BASE) -/** Array initializer of SPI peripheral base addresses */ -#define SPI_BASE_ADDRS { SPI0_BASE, SPI1_BASE } -/** Array initializer of SPI peripheral base pointers */ -#define SPI_BASE_PTRS { SPI0, SPI1 } -/** Interrupt vectors for the SPI peripheral type */ -#define SPI_IRQS { SPI0_IRQn, SPI1_IRQn } - -/*! - * @} - */ /* end of group SPI_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- TPM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup TPM_Peripheral_Access_Layer TPM Peripheral Access Layer - * @{ - */ - -/** TPM - Register Layout Typedef */ -typedef struct { - __IO uint32_t SC; /**< Status and Control, offset: 0x0 */ - __IO uint32_t CNT; /**< Counter, offset: 0x4 */ - __IO uint32_t MOD; /**< Modulo, offset: 0x8 */ - struct { /* offset: 0xC, array step: 0x8 */ - __IO uint32_t CnSC; /**< Channel (n) Status and Control, array offset: 0xC, array step: 0x8, irregular array, not all indices are valid */ - __IO uint32_t CnV; /**< Channel (n) Value, array offset: 0x10, array step: 0x8, irregular array, not all indices are valid */ - } CONTROLS[6]; - uint8_t RESERVED_0[20]; - __IO uint32_t STATUS; /**< Capture and Compare Status, offset: 0x50 */ - uint8_t RESERVED_1[28]; - __IO uint32_t POL; /**< Channel Polarity, offset: 0x70 */ - uint8_t RESERVED_2[16]; - __IO uint32_t CONF; /**< Configuration, offset: 0x84 */ -} TPM_Type; - -/* ---------------------------------------------------------------------------- - -- TPM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup TPM_Register_Masks TPM Register Masks - * @{ - */ - -/*! @name SC - Status and Control */ -/*! @{ */ - -#define TPM_SC_PS_MASK (0x7U) -#define TPM_SC_PS_SHIFT (0U) -/*! PS - Prescale Factor Selection - * 0b000..Divide by 1 - * 0b001..Divide by 2 - * 0b010..Divide by 4 - * 0b011..Divide by 8 - * 0b100..Divide by 16 - * 0b101..Divide by 32 - * 0b110..Divide by 64 - * 0b111..Divide by 128 - */ -#define TPM_SC_PS(x) (((uint32_t)(((uint32_t)(x)) << TPM_SC_PS_SHIFT)) & TPM_SC_PS_MASK) - -#define TPM_SC_CMOD_MASK (0x18U) -#define TPM_SC_CMOD_SHIFT (3U) -/*! CMOD - Clock Mode Selection - * 0b00..TPM counter is disabled - * 0b01..TPM counter increments on every TPM counter clock - * 0b10..TPM counter increments on rising edge of TPM_EXTCLK synchronized to the TPM counter clock - * 0b11..Reserved - */ -#define TPM_SC_CMOD(x) (((uint32_t)(((uint32_t)(x)) << TPM_SC_CMOD_SHIFT)) & TPM_SC_CMOD_MASK) - -#define TPM_SC_CPWMS_MASK (0x20U) -#define TPM_SC_CPWMS_SHIFT (5U) -/*! CPWMS - Center-Aligned PWM Select - * 0b0..TPM counter operates in up counting mode. - * 0b1..TPM counter operates in up-down counting mode. - */ -#define TPM_SC_CPWMS(x) (((uint32_t)(((uint32_t)(x)) << TPM_SC_CPWMS_SHIFT)) & TPM_SC_CPWMS_MASK) - -#define TPM_SC_TOIE_MASK (0x40U) -#define TPM_SC_TOIE_SHIFT (6U) -/*! TOIE - Timer Overflow Interrupt Enable - * 0b0..Disable TOF interrupts. Use software polling or DMA request. - * 0b1..Enable TOF interrupts. An interrupt is generated when TOF equals one. - */ -#define TPM_SC_TOIE(x) (((uint32_t)(((uint32_t)(x)) << TPM_SC_TOIE_SHIFT)) & TPM_SC_TOIE_MASK) - -#define TPM_SC_TOF_MASK (0x80U) -#define TPM_SC_TOF_SHIFT (7U) -/*! TOF - Timer Overflow Flag - * 0b0..TPM counter has not overflowed. - * 0b1..TPM counter has overflowed. - */ -#define TPM_SC_TOF(x) (((uint32_t)(((uint32_t)(x)) << TPM_SC_TOF_SHIFT)) & TPM_SC_TOF_MASK) - -#define TPM_SC_DMA_MASK (0x100U) -#define TPM_SC_DMA_SHIFT (8U) -/*! DMA - DMA Enable - * 0b0..Disables DMA transfers. - * 0b1..Enables DMA transfers. - */ -#define TPM_SC_DMA(x) (((uint32_t)(((uint32_t)(x)) << TPM_SC_DMA_SHIFT)) & TPM_SC_DMA_MASK) -/*! @} */ - -/*! @name CNT - Counter */ -/*! @{ */ - -#define TPM_CNT_COUNT_MASK (0xFFFFU) -#define TPM_CNT_COUNT_SHIFT (0U) -/*! COUNT - Counter value */ -#define TPM_CNT_COUNT(x) (((uint32_t)(((uint32_t)(x)) << TPM_CNT_COUNT_SHIFT)) & TPM_CNT_COUNT_MASK) -/*! @} */ - -/*! @name MOD - Modulo */ -/*! @{ */ - -#define TPM_MOD_MOD_MASK (0xFFFFU) -#define TPM_MOD_MOD_SHIFT (0U) -/*! MOD - Modulo value */ -#define TPM_MOD_MOD(x) (((uint32_t)(((uint32_t)(x)) << TPM_MOD_MOD_SHIFT)) & TPM_MOD_MOD_MASK) -/*! @} */ - -/*! @name CnSC - Channel (n) Status and Control */ -/*! @{ */ - -#define TPM_CnSC_DMA_MASK (0x1U) -#define TPM_CnSC_DMA_SHIFT (0U) -/*! DMA - DMA Enable - * 0b0..Disable DMA transfers. - * 0b1..Enable DMA transfers. - */ -#define TPM_CnSC_DMA(x) (((uint32_t)(((uint32_t)(x)) << TPM_CnSC_DMA_SHIFT)) & TPM_CnSC_DMA_MASK) - -#define TPM_CnSC_ELSA_MASK (0x4U) -#define TPM_CnSC_ELSA_SHIFT (2U) -/*! ELSA - Edge or Level Select */ -#define TPM_CnSC_ELSA(x) (((uint32_t)(((uint32_t)(x)) << TPM_CnSC_ELSA_SHIFT)) & TPM_CnSC_ELSA_MASK) - -#define TPM_CnSC_ELSB_MASK (0x8U) -#define TPM_CnSC_ELSB_SHIFT (3U) -/*! ELSB - Edge or Level Select */ -#define TPM_CnSC_ELSB(x) (((uint32_t)(((uint32_t)(x)) << TPM_CnSC_ELSB_SHIFT)) & TPM_CnSC_ELSB_MASK) - -#define TPM_CnSC_MSA_MASK (0x10U) -#define TPM_CnSC_MSA_SHIFT (4U) -/*! MSA - Channel Mode Select */ -#define TPM_CnSC_MSA(x) (((uint32_t)(((uint32_t)(x)) << TPM_CnSC_MSA_SHIFT)) & TPM_CnSC_MSA_MASK) - -#define TPM_CnSC_MSB_MASK (0x20U) -#define TPM_CnSC_MSB_SHIFT (5U) -/*! MSB - Channel Mode Select */ -#define TPM_CnSC_MSB(x) (((uint32_t)(((uint32_t)(x)) << TPM_CnSC_MSB_SHIFT)) & TPM_CnSC_MSB_MASK) - -#define TPM_CnSC_CHIE_MASK (0x40U) -#define TPM_CnSC_CHIE_SHIFT (6U) -/*! CHIE - Channel Interrupt Enable - * 0b0..Disable channel interrupts. - * 0b1..Enable channel interrupts. - */ -#define TPM_CnSC_CHIE(x) (((uint32_t)(((uint32_t)(x)) << TPM_CnSC_CHIE_SHIFT)) & TPM_CnSC_CHIE_MASK) - -#define TPM_CnSC_CHF_MASK (0x80U) -#define TPM_CnSC_CHF_SHIFT (7U) -/*! CHF - Channel Flag - * 0b0..No channel event has occurred. - * 0b1..A channel event has occurred. - */ -#define TPM_CnSC_CHF(x) (((uint32_t)(((uint32_t)(x)) << TPM_CnSC_CHF_SHIFT)) & TPM_CnSC_CHF_MASK) -/*! @} */ - -/* The count of TPM_CnSC */ -#define TPM_CnSC_COUNT (6U) - -/*! @name CnV - Channel (n) Value */ -/*! @{ */ - -#define TPM_CnV_VAL_MASK (0xFFFFU) -#define TPM_CnV_VAL_SHIFT (0U) -/*! VAL - Channel Value */ -#define TPM_CnV_VAL(x) (((uint32_t)(((uint32_t)(x)) << TPM_CnV_VAL_SHIFT)) & TPM_CnV_VAL_MASK) -/*! @} */ - -/* The count of TPM_CnV */ -#define TPM_CnV_COUNT (6U) - -/*! @name STATUS - Capture and Compare Status */ -/*! @{ */ - -#define TPM_STATUS_CH0F_MASK (0x1U) -#define TPM_STATUS_CH0F_SHIFT (0U) -/*! CH0F - Channel 0 Flag - * 0b0..No channel event has occurred. - * 0b1..A channel event has occurred. - */ -#define TPM_STATUS_CH0F(x) (((uint32_t)(((uint32_t)(x)) << TPM_STATUS_CH0F_SHIFT)) & TPM_STATUS_CH0F_MASK) - -#define TPM_STATUS_CH1F_MASK (0x2U) -#define TPM_STATUS_CH1F_SHIFT (1U) -/*! CH1F - Channel 1 Flag - * 0b0..No channel event has occurred. - * 0b1..A channel event has occurred. - */ -#define TPM_STATUS_CH1F(x) (((uint32_t)(((uint32_t)(x)) << TPM_STATUS_CH1F_SHIFT)) & TPM_STATUS_CH1F_MASK) - -#define TPM_STATUS_CH2F_MASK (0x4U) -#define TPM_STATUS_CH2F_SHIFT (2U) -/*! CH2F - Channel 2 Flag - * 0b0..No channel event has occurred. - * 0b1..A channel event has occurred. - */ -#define TPM_STATUS_CH2F(x) (((uint32_t)(((uint32_t)(x)) << TPM_STATUS_CH2F_SHIFT)) & TPM_STATUS_CH2F_MASK) - -#define TPM_STATUS_CH3F_MASK (0x8U) -#define TPM_STATUS_CH3F_SHIFT (3U) -/*! CH3F - Channel 3 Flag - * 0b0..No channel event has occurred. - * 0b1..A channel event has occurred. - */ -#define TPM_STATUS_CH3F(x) (((uint32_t)(((uint32_t)(x)) << TPM_STATUS_CH3F_SHIFT)) & TPM_STATUS_CH3F_MASK) - -#define TPM_STATUS_CH4F_MASK (0x10U) -#define TPM_STATUS_CH4F_SHIFT (4U) -/*! CH4F - Channel 4 Flag - * 0b0..No channel event has occurred. - * 0b1..A channel event has occurred. - */ -#define TPM_STATUS_CH4F(x) (((uint32_t)(((uint32_t)(x)) << TPM_STATUS_CH4F_SHIFT)) & TPM_STATUS_CH4F_MASK) - -#define TPM_STATUS_CH5F_MASK (0x20U) -#define TPM_STATUS_CH5F_SHIFT (5U) -/*! CH5F - Channel 5 Flag - * 0b0..No channel event has occurred. - * 0b1..A channel event has occurred. - */ -#define TPM_STATUS_CH5F(x) (((uint32_t)(((uint32_t)(x)) << TPM_STATUS_CH5F_SHIFT)) & TPM_STATUS_CH5F_MASK) - -#define TPM_STATUS_TOF_MASK (0x100U) -#define TPM_STATUS_TOF_SHIFT (8U) -/*! TOF - Timer Overflow Flag - * 0b0..TPM counter has not overflowed. - * 0b1..TPM counter has overflowed. - */ -#define TPM_STATUS_TOF(x) (((uint32_t)(((uint32_t)(x)) << TPM_STATUS_TOF_SHIFT)) & TPM_STATUS_TOF_MASK) -/*! @} */ - -/*! @name POL - Channel Polarity */ -/*! @{ */ - -#define TPM_POL_POL0_MASK (0x1U) -#define TPM_POL_POL0_SHIFT (0U) -/*! POL0 - Channel 0 Polarity - * 0b0..The channel polarity is active high. - * 0b1..The channel polarity is active low. - */ -#define TPM_POL_POL0(x) (((uint32_t)(((uint32_t)(x)) << TPM_POL_POL0_SHIFT)) & TPM_POL_POL0_MASK) - -#define TPM_POL_POL1_MASK (0x2U) -#define TPM_POL_POL1_SHIFT (1U) -/*! POL1 - Channel 1 Polarity - * 0b0..The channel polarity is active high. - * 0b1..The channel polarity is active low. - */ -#define TPM_POL_POL1(x) (((uint32_t)(((uint32_t)(x)) << TPM_POL_POL1_SHIFT)) & TPM_POL_POL1_MASK) - -#define TPM_POL_POL2_MASK (0x4U) -#define TPM_POL_POL2_SHIFT (2U) -/*! POL2 - Channel 2 Polarity - * 0b0..The channel polarity is active high. - * 0b1..The channel polarity is active low. - */ -#define TPM_POL_POL2(x) (((uint32_t)(((uint32_t)(x)) << TPM_POL_POL2_SHIFT)) & TPM_POL_POL2_MASK) - -#define TPM_POL_POL3_MASK (0x8U) -#define TPM_POL_POL3_SHIFT (3U) -/*! POL3 - Channel 3 Polarity - * 0b0..The channel polarity is active high. - * 0b1..The channel polarity is active low. - */ -#define TPM_POL_POL3(x) (((uint32_t)(((uint32_t)(x)) << TPM_POL_POL3_SHIFT)) & TPM_POL_POL3_MASK) - -#define TPM_POL_POL4_MASK (0x10U) -#define TPM_POL_POL4_SHIFT (4U) -/*! POL4 - Channel Polarity 4 - * 0b0..The channel polarity is active high - * 0b1..The channel polarity is active low. - */ -#define TPM_POL_POL4(x) (((uint32_t)(((uint32_t)(x)) << TPM_POL_POL4_SHIFT)) & TPM_POL_POL4_MASK) - -#define TPM_POL_POL5_MASK (0x20U) -#define TPM_POL_POL5_SHIFT (5U) -/*! POL5 - Channel 5 Polarity - * 0b0..The channel polarity is active high. - * 0b1..The channel polarity is active low. - */ -#define TPM_POL_POL5(x) (((uint32_t)(((uint32_t)(x)) << TPM_POL_POL5_SHIFT)) & TPM_POL_POL5_MASK) -/*! @} */ - -/*! @name CONF - Configuration */ -/*! @{ */ - -#define TPM_CONF_DOZEEN_MASK (0x20U) -#define TPM_CONF_DOZEEN_SHIFT (5U) -/*! DOZEEN - Doze Enable - * 0b0..Internal TPM counter continues in Doze mode. - * 0b1..Internal TPM counter is paused and does not increment during Doze mode. Trigger inputs and input capture events are also ignored. - */ -#define TPM_CONF_DOZEEN(x) (((uint32_t)(((uint32_t)(x)) << TPM_CONF_DOZEEN_SHIFT)) & TPM_CONF_DOZEEN_MASK) - -#define TPM_CONF_DBGMODE_MASK (0xC0U) -#define TPM_CONF_DBGMODE_SHIFT (6U) -/*! DBGMODE - Debug Mode - * 0b00..TPM counter is paused and does not increment during debug mode. Trigger inputs and input capture events are also ignored. - * 0b11..TPM counter continues in debug mode. - */ -#define TPM_CONF_DBGMODE(x) (((uint32_t)(((uint32_t)(x)) << TPM_CONF_DBGMODE_SHIFT)) & TPM_CONF_DBGMODE_MASK) - -#define TPM_CONF_GTBSYNC_MASK (0x100U) -#define TPM_CONF_GTBSYNC_SHIFT (8U) -/*! GTBSYNC - Global Time Base Synchronization - * 0b0..Global timebase synchronization disabled. - * 0b1..Global timebase synchronization enabled. - */ -#define TPM_CONF_GTBSYNC(x) (((uint32_t)(((uint32_t)(x)) << TPM_CONF_GTBSYNC_SHIFT)) & TPM_CONF_GTBSYNC_MASK) - -#define TPM_CONF_GTBEEN_MASK (0x200U) -#define TPM_CONF_GTBEEN_SHIFT (9U) -/*! GTBEEN - Global time base enable - * 0b0..All channels use the internally generated TPM counter as their timebase - * 0b1..All channels use an externally generated global timebase as their timebase - */ -#define TPM_CONF_GTBEEN(x) (((uint32_t)(((uint32_t)(x)) << TPM_CONF_GTBEEN_SHIFT)) & TPM_CONF_GTBEEN_MASK) - -#define TPM_CONF_CSOT_MASK (0x10000U) -#define TPM_CONF_CSOT_SHIFT (16U) -/*! CSOT - Counter Start on Trigger - * 0b0..TPM counter starts to increment immediately, once it is enabled. - * 0b1..TPM counter only starts to increment when it a rising edge on the selected input trigger is detected, - * after it has been enabled or after it has stopped due to overflow. - */ -#define TPM_CONF_CSOT(x) (((uint32_t)(((uint32_t)(x)) << TPM_CONF_CSOT_SHIFT)) & TPM_CONF_CSOT_MASK) - -#define TPM_CONF_CSOO_MASK (0x20000U) -#define TPM_CONF_CSOO_SHIFT (17U) -/*! CSOO - Counter Stop On Overflow - * 0b0..TPM counter continues incrementing or decrementing after overflow - * 0b1..TPM counter stops incrementing or decrementing after overflow. - */ -#define TPM_CONF_CSOO(x) (((uint32_t)(((uint32_t)(x)) << TPM_CONF_CSOO_SHIFT)) & TPM_CONF_CSOO_MASK) - -#define TPM_CONF_CROT_MASK (0x40000U) -#define TPM_CONF_CROT_SHIFT (18U) -/*! CROT - Counter Reload On Trigger - * 0b0..Counter is not reloaded due to a rising edge on the selected input trigger - * 0b1..Counter is reloaded when a rising edge is detected on the selected input trigger - */ -#define TPM_CONF_CROT(x) (((uint32_t)(((uint32_t)(x)) << TPM_CONF_CROT_SHIFT)) & TPM_CONF_CROT_MASK) - -#define TPM_CONF_CPOT_MASK (0x80000U) -#define TPM_CONF_CPOT_SHIFT (19U) -/*! CPOT - Counter Pause On Trigger */ -#define TPM_CONF_CPOT(x) (((uint32_t)(((uint32_t)(x)) << TPM_CONF_CPOT_SHIFT)) & TPM_CONF_CPOT_MASK) - -#define TPM_CONF_TRGPOL_MASK (0x400000U) -#define TPM_CONF_TRGPOL_SHIFT (22U) -/*! TRGPOL - Trigger Polarity - * 0b0..Trigger is active high. - * 0b1..Trigger is active low. - */ -#define TPM_CONF_TRGPOL(x) (((uint32_t)(((uint32_t)(x)) << TPM_CONF_TRGPOL_SHIFT)) & TPM_CONF_TRGPOL_MASK) - -#define TPM_CONF_TRGSRC_MASK (0x800000U) -#define TPM_CONF_TRGSRC_SHIFT (23U) -/*! TRGSRC - Trigger Source - * 0b0..Trigger source selected by TRGSEL is external. - * 0b1..Trigger source selected by TRGSEL is internal (channel pin input capture). - */ -#define TPM_CONF_TRGSRC(x) (((uint32_t)(((uint32_t)(x)) << TPM_CONF_TRGSRC_SHIFT)) & TPM_CONF_TRGSRC_MASK) - -#define TPM_CONF_TRGSEL_MASK (0xF000000U) -#define TPM_CONF_TRGSEL_SHIFT (24U) -/*! TRGSEL - Trigger Select - * 0b0001..Channel 0 pin input capture - * 0b0010..Channel 1 pin input capture - * 0b0011..Channel 0 or Channel 1 pin input capture - * 0b0100..Channel 2 pin input capture - * 0b0101..Channel 0 or Channel 2 pin input capture - * 0b0110..Channel 1 or Channel 2 pin input capture - * 0b0111..Channel 0 or Channel 1 or Channel 2 pin input capture - * 0b1000..Channel 3 pin input capture - * 0b1001..Channel 0 or Channel 3 pin input capture - * 0b1010..Channel 1 or Channel 3 pin input capture - * 0b1011..Channel 0 or Channel 1 or Channel 3 pin input capture - * 0b1100..Channel 2 or Channel 3 pin input capture - * 0b1101..Channel 0 or Channel 2 or Channel 3 pin input capture - * 0b1110..Channel 1 or Channel 2 or Channel 3 pin input capture - * 0b1111..Channel 0 or Channel 1 or Channel 2 or Channel 3 pin input capture - */ -#define TPM_CONF_TRGSEL(x) (((uint32_t)(((uint32_t)(x)) << TPM_CONF_TRGSEL_SHIFT)) & TPM_CONF_TRGSEL_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group TPM_Register_Masks */ - - -/* TPM - Peripheral instance base addresses */ -/** Peripheral TPM0 base address */ -#define TPM0_BASE (0x40038000u) -/** Peripheral TPM0 base pointer */ -#define TPM0 ((TPM_Type *)TPM0_BASE) -/** Peripheral TPM1 base address */ -#define TPM1_BASE (0x40039000u) -/** Peripheral TPM1 base pointer */ -#define TPM1 ((TPM_Type *)TPM1_BASE) -/** Peripheral TPM2 base address */ -#define TPM2_BASE (0x4003A000u) -/** Peripheral TPM2 base pointer */ -#define TPM2 ((TPM_Type *)TPM2_BASE) -/** Array initializer of TPM peripheral base addresses */ -#define TPM_BASE_ADDRS { TPM0_BASE, TPM1_BASE, TPM2_BASE } -/** Array initializer of TPM peripheral base pointers */ -#define TPM_BASE_PTRS { TPM0, TPM1, TPM2 } -/** Interrupt vectors for the TPM peripheral type */ -#define TPM_IRQS { TPM0_IRQn, TPM1_IRQn, TPM2_IRQn } - -/*! - * @} - */ /* end of group TPM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- UART Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup UART_Peripheral_Access_Layer UART Peripheral Access Layer - * @{ - */ - -/** UART - Register Layout Typedef */ -typedef struct { - __IO uint8_t BDH; /**< UART Baud Rate Registers: High, offset: 0x0 */ - __IO uint8_t BDL; /**< UART Baud Rate Registers: Low, offset: 0x1 */ - __IO uint8_t C1; /**< UART Control Register 1, offset: 0x2 */ - __IO uint8_t C2; /**< UART Control Register 2, offset: 0x3 */ - __I uint8_t S1; /**< UART Status Register 1, offset: 0x4 */ - __IO uint8_t S2; /**< UART Status Register 2, offset: 0x5 */ - __IO uint8_t C3; /**< UART Control Register 3, offset: 0x6 */ - __IO uint8_t D; /**< UART Data Register, offset: 0x7 */ - __IO uint8_t MA1; /**< UART Match Address Registers 1, offset: 0x8 */ - __IO uint8_t MA2; /**< UART Match Address Registers 2, offset: 0x9 */ - __IO uint8_t C4; /**< UART Control Register 4, offset: 0xA */ - __IO uint8_t C5; /**< UART Control Register 5, offset: 0xB */ - uint8_t RESERVED_0[12]; - __IO uint8_t C7816; /**< UART 7816 Control Register, offset: 0x18 */ - __IO uint8_t IE7816; /**< UART 7816 Interrupt Enable Register, offset: 0x19 */ - __IO uint8_t IS7816; /**< UART 7816 Interrupt Status Register, offset: 0x1A */ - __IO uint8_t WP7816; /**< UART 7816 Wait Parameter Register, offset: 0x1B */ - __IO uint8_t WN7816; /**< UART 7816 Wait N Register, offset: 0x1C */ - __IO uint8_t WF7816; /**< UART 7816 Wait FD Register, offset: 0x1D */ - __IO uint8_t ET7816; /**< UART 7816 Error Threshold Register, offset: 0x1E */ - __IO uint8_t TL7816; /**< UART 7816 Transmit Length Register, offset: 0x1F */ - uint8_t RESERVED_1[26]; - __IO uint8_t AP7816A_T0; /**< UART 7816 ATR Duration Timer Register A, offset: 0x3A */ - __IO uint8_t AP7816B_T0; /**< UART 7816 ATR Duration Timer Register B, offset: 0x3B */ - union { /* offset: 0x3C */ - struct { /* offset: 0x3C */ - __IO uint8_t WP7816A_T0; /**< UART 7816 Wait Parameter Register A, offset: 0x3C */ - __IO uint8_t WP7816B_T0; /**< UART 7816 Wait Parameter Register B, offset: 0x3D */ - } TYPE0; - struct { /* offset: 0x3C */ - __IO uint8_t WP7816A_T1; /**< UART 7816 Wait Parameter Register A, offset: 0x3C */ - __IO uint8_t WP7816B_T1; /**< UART 7816 Wait Parameter Register B, offset: 0x3D */ - } TYPE1; - }; - __IO uint8_t WGP7816_T1; /**< UART 7816 Wait and Guard Parameter Register, offset: 0x3E */ - __IO uint8_t WP7816C_T1; /**< UART 7816 Wait Parameter Register C, offset: 0x3F */ -} UART_Type; - -/* ---------------------------------------------------------------------------- - -- UART Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup UART_Register_Masks UART Register Masks - * @{ - */ - -/*! @name BDH - UART Baud Rate Registers: High */ -/*! @{ */ - -#define UART_BDH_SBR_MASK (0x1FU) -#define UART_BDH_SBR_SHIFT (0U) -/*! SBR - UART Baud Rate Bits */ -#define UART_BDH_SBR(x) (((uint8_t)(((uint8_t)(x)) << UART_BDH_SBR_SHIFT)) & UART_BDH_SBR_MASK) - -#define UART_BDH_RXEDGIE_MASK (0x40U) -#define UART_BDH_RXEDGIE_SHIFT (6U) -/*! RXEDGIE - RxD Input Active Edge Interrupt Enable - * 0b0..Hardware interrupts from RXEDGIF disabled using polling. - * 0b1..RXEDGIF interrupt request enabled. - */ -#define UART_BDH_RXEDGIE(x) (((uint8_t)(((uint8_t)(x)) << UART_BDH_RXEDGIE_SHIFT)) & UART_BDH_RXEDGIE_MASK) -/*! @} */ - -/*! @name BDL - UART Baud Rate Registers: Low */ -/*! @{ */ - -#define UART_BDL_SBR_MASK (0xFFU) -#define UART_BDL_SBR_SHIFT (0U) -/*! SBR - UART Baud Rate Bits */ -#define UART_BDL_SBR(x) (((uint8_t)(((uint8_t)(x)) << UART_BDL_SBR_SHIFT)) & UART_BDL_SBR_MASK) -/*! @} */ - -/*! @name C1 - UART Control Register 1 */ -/*! @{ */ - -#define UART_C1_PT_MASK (0x1U) -#define UART_C1_PT_SHIFT (0U) -/*! PT - Parity Type - * 0b0..Even parity. - * 0b1..Odd parity. - */ -#define UART_C1_PT(x) (((uint8_t)(((uint8_t)(x)) << UART_C1_PT_SHIFT)) & UART_C1_PT_MASK) - -#define UART_C1_PE_MASK (0x2U) -#define UART_C1_PE_SHIFT (1U) -/*! PE - Parity Enable - * 0b0..Parity function disabled. - * 0b1..Parity function enabled. - */ -#define UART_C1_PE(x) (((uint8_t)(((uint8_t)(x)) << UART_C1_PE_SHIFT)) & UART_C1_PE_MASK) - -#define UART_C1_ILT_MASK (0x4U) -#define UART_C1_ILT_SHIFT (2U) -/*! ILT - Idle Line Type Select - * 0b0..Idle character bit count starts after start bit. - * 0b1..Idle character bit count starts after stop bit. - */ -#define UART_C1_ILT(x) (((uint8_t)(((uint8_t)(x)) << UART_C1_ILT_SHIFT)) & UART_C1_ILT_MASK) - -#define UART_C1_WAKE_MASK (0x8U) -#define UART_C1_WAKE_SHIFT (3U) -/*! WAKE - Receiver Wakeup Method Select - * 0b0..Idle line wakeup. - * 0b1..Address mark wakeup. - */ -#define UART_C1_WAKE(x) (((uint8_t)(((uint8_t)(x)) << UART_C1_WAKE_SHIFT)) & UART_C1_WAKE_MASK) - -#define UART_C1_M_MASK (0x10U) -#define UART_C1_M_SHIFT (4U) -/*! M - 9-bit or 8-bit Mode Select - * 0b0..Normal-start + 8 data bits (MSB/LSB first as determined by MSBF) + stop. - * 0b1..Use-start + 9 data bits (MSB/LSB first as determined by MSBF) + stop. - */ -#define UART_C1_M(x) (((uint8_t)(((uint8_t)(x)) << UART_C1_M_SHIFT)) & UART_C1_M_MASK) - -#define UART_C1_RSRC_MASK (0x20U) -#define UART_C1_RSRC_SHIFT (5U) -/*! RSRC - Receiver Source Select - * 0b0..Selects internal loop back mode. The receiver input is internally connected to transmitter output. - * 0b1..Single wire UART mode where the receiver input is connected to the transmit pin input signal. - */ -#define UART_C1_RSRC(x) (((uint8_t)(((uint8_t)(x)) << UART_C1_RSRC_SHIFT)) & UART_C1_RSRC_MASK) - -#define UART_C1_LOOPS_MASK (0x80U) -#define UART_C1_LOOPS_SHIFT (7U) -/*! LOOPS - Loop Mode Select - * 0b0..Normal operation. - * 0b1..Loop mode where transmitter output is internally connected to receiver input. The receiver input is determined by RSRC. - */ -#define UART_C1_LOOPS(x) (((uint8_t)(((uint8_t)(x)) << UART_C1_LOOPS_SHIFT)) & UART_C1_LOOPS_MASK) -/*! @} */ - -/*! @name C2 - UART Control Register 2 */ -/*! @{ */ - -#define UART_C2_SBK_MASK (0x1U) -#define UART_C2_SBK_SHIFT (0U) -/*! SBK - Send Break - * 0b0..Normal transmitter operation. - * 0b1..Queue break characters to be sent. - */ -#define UART_C2_SBK(x) (((uint8_t)(((uint8_t)(x)) << UART_C2_SBK_SHIFT)) & UART_C2_SBK_MASK) - -#define UART_C2_RWU_MASK (0x2U) -#define UART_C2_RWU_SHIFT (1U) -/*! RWU - Receiver Wakeup Control - * 0b0..Normal operation. - * 0b1..RWU enables the wakeup function and inhibits further receiver interrupt requests. Normally, hardware - * wakes the receiver by automatically clearing RWU. - */ -#define UART_C2_RWU(x) (((uint8_t)(((uint8_t)(x)) << UART_C2_RWU_SHIFT)) & UART_C2_RWU_MASK) - -#define UART_C2_RE_MASK (0x4U) -#define UART_C2_RE_SHIFT (2U) -/*! RE - Receiver Enable - * 0b0..Receiver off. - * 0b1..Receiver on. - */ -#define UART_C2_RE(x) (((uint8_t)(((uint8_t)(x)) << UART_C2_RE_SHIFT)) & UART_C2_RE_MASK) - -#define UART_C2_TE_MASK (0x8U) -#define UART_C2_TE_SHIFT (3U) -/*! TE - Transmitter Enable - * 0b0..Transmitter off. - * 0b1..Transmitter on. - */ -#define UART_C2_TE(x) (((uint8_t)(((uint8_t)(x)) << UART_C2_TE_SHIFT)) & UART_C2_TE_MASK) - -#define UART_C2_ILIE_MASK (0x10U) -#define UART_C2_ILIE_SHIFT (4U) -/*! ILIE - Idle Line Interrupt Enable - * 0b0..IDLE interrupt requests disabled. - * 0b1..IDLE interrupt requests enabled. - */ -#define UART_C2_ILIE(x) (((uint8_t)(((uint8_t)(x)) << UART_C2_ILIE_SHIFT)) & UART_C2_ILIE_MASK) - -#define UART_C2_RIE_MASK (0x20U) -#define UART_C2_RIE_SHIFT (5U) -/*! RIE - Receiver Full Interrupt or DMA Transfer Enable - * 0b0..RDRF interrupt and DMA transfer requests disabled. - * 0b1..RDRF interrupt or DMA transfer requests enabled. - */ -#define UART_C2_RIE(x) (((uint8_t)(((uint8_t)(x)) << UART_C2_RIE_SHIFT)) & UART_C2_RIE_MASK) - -#define UART_C2_TCIE_MASK (0x40U) -#define UART_C2_TCIE_SHIFT (6U) -/*! TCIE - Transmission Complete Interrupt Enable - * 0b0..TC interrupt requests disabled. - * 0b1..TC interrupt requests enabled. - */ -#define UART_C2_TCIE(x) (((uint8_t)(((uint8_t)(x)) << UART_C2_TCIE_SHIFT)) & UART_C2_TCIE_MASK) - -#define UART_C2_TIE_MASK (0x80U) -#define UART_C2_TIE_SHIFT (7U) -/*! TIE - Transmitter Interrupt or DMA Transfer Enable. - * 0b0..TDRE interrupt and DMA transfer requests disabled. - * 0b1..TDRE interrupt or DMA transfer requests enabled. - */ -#define UART_C2_TIE(x) (((uint8_t)(((uint8_t)(x)) << UART_C2_TIE_SHIFT)) & UART_C2_TIE_MASK) -/*! @} */ - -/*! @name S1 - UART Status Register 1 */ -/*! @{ */ - -#define UART_S1_PF_MASK (0x1U) -#define UART_S1_PF_SHIFT (0U) -/*! PF - Parity Error Flag - * 0b0..No parity error detected since the last time this flag was cleared. If the receive buffer has a depth - * greater than 1, then there may be data in the receive buffer what was received with a parity error. - * 0b1..At least one dataword was received with a parity error since the last time this flag was cleared. - */ -#define UART_S1_PF(x) (((uint8_t)(((uint8_t)(x)) << UART_S1_PF_SHIFT)) & UART_S1_PF_MASK) - -#define UART_S1_FE_MASK (0x2U) -#define UART_S1_FE_SHIFT (1U) -/*! FE - Framing Error Flag - * 0b0..No framing error detected. - * 0b1..Framing error. - */ -#define UART_S1_FE(x) (((uint8_t)(((uint8_t)(x)) << UART_S1_FE_SHIFT)) & UART_S1_FE_MASK) - -#define UART_S1_NF_MASK (0x4U) -#define UART_S1_NF_SHIFT (2U) -/*! NF - Noise Flag - * 0b0..No noise detected since the last time this flag was cleared. If the receive buffer has a depth greater - * than 1 then there may be data in the receiver buffer that was received with noise. - * 0b1..At least one dataword was received with noise detected since the last time the flag was cleared. - */ -#define UART_S1_NF(x) (((uint8_t)(((uint8_t)(x)) << UART_S1_NF_SHIFT)) & UART_S1_NF_MASK) - -#define UART_S1_OR_MASK (0x8U) -#define UART_S1_OR_SHIFT (3U) -/*! OR - Receiver Overrun Flag - * 0b0..No overrun has occurred since the last time the flag was cleared. - * 0b1..Overrun has occurred or the overrun flag has not been cleared since the last overrun occured. - */ -#define UART_S1_OR(x) (((uint8_t)(((uint8_t)(x)) << UART_S1_OR_SHIFT)) & UART_S1_OR_MASK) - -#define UART_S1_IDLE_MASK (0x10U) -#define UART_S1_IDLE_SHIFT (4U) -/*! IDLE - Idle Line Flag - * 0b0..Receiver input is either active now or has never become active since the IDLE flag was last cleared. - * 0b1..Receiver input has become idle or the flag has not been cleared since it last asserted. - */ -#define UART_S1_IDLE(x) (((uint8_t)(((uint8_t)(x)) << UART_S1_IDLE_SHIFT)) & UART_S1_IDLE_MASK) - -#define UART_S1_RDRF_MASK (0x20U) -#define UART_S1_RDRF_SHIFT (5U) -/*! RDRF - Receive Data Register Full Flag - * 0b0..The number of datawords in the receive buffer is less than the number indicated by RXWATER. - * 0b1..The number of datawords in the receive buffer is equal to or greater than the number indicated by RXWATER - * at some point in time since this flag was last cleared. - */ -#define UART_S1_RDRF(x) (((uint8_t)(((uint8_t)(x)) << UART_S1_RDRF_SHIFT)) & UART_S1_RDRF_MASK) - -#define UART_S1_TC_MASK (0x40U) -#define UART_S1_TC_SHIFT (6U) -/*! TC - Transmit Complete Flag - * 0b0..Transmitter active (sending data, a preamble, or a break). - * 0b1..Transmitter idle (transmission activity complete). - */ -#define UART_S1_TC(x) (((uint8_t)(((uint8_t)(x)) << UART_S1_TC_SHIFT)) & UART_S1_TC_MASK) - -#define UART_S1_TDRE_MASK (0x80U) -#define UART_S1_TDRE_SHIFT (7U) -/*! TDRE - Transmit Data Register Empty Flag - * 0b0..The amount of data in the transmit buffer is greater than the value indicated by TWFIFO[TXWATER]. - * 0b1..The amount of data in the transmit buffer is less than or equal to the value indicated by TWFIFO[TXWATER] - * at some point in time since the flag has been cleared. - */ -#define UART_S1_TDRE(x) (((uint8_t)(((uint8_t)(x)) << UART_S1_TDRE_SHIFT)) & UART_S1_TDRE_MASK) -/*! @} */ - -/*! @name S2 - UART Status Register 2 */ -/*! @{ */ - -#define UART_S2_RAF_MASK (0x1U) -#define UART_S2_RAF_SHIFT (0U) -/*! RAF - Receiver Active Flag - * 0b0..UART receiver idle/inactive waiting for a start bit. - * 0b1..UART receiver active, RxD input not idle. - */ -#define UART_S2_RAF(x) (((uint8_t)(((uint8_t)(x)) << UART_S2_RAF_SHIFT)) & UART_S2_RAF_MASK) - -#define UART_S2_BRK13_MASK (0x4U) -#define UART_S2_BRK13_SHIFT (2U) -/*! BRK13 - Break Transmit Character Length - * 0b0..Break character is 10, 11, or 12 bits long. - * 0b1..Break character is 13 or 14 bits long. - */ -#define UART_S2_BRK13(x) (((uint8_t)(((uint8_t)(x)) << UART_S2_BRK13_SHIFT)) & UART_S2_BRK13_MASK) - -#define UART_S2_RWUID_MASK (0x8U) -#define UART_S2_RWUID_SHIFT (3U) -/*! RWUID - Receive Wakeup Idle Detect - * 0b0..S1[IDLE] is not set upon detection of an idle character. - * 0b1..S1[IDLE] is set upon detection of an idle character. - */ -#define UART_S2_RWUID(x) (((uint8_t)(((uint8_t)(x)) << UART_S2_RWUID_SHIFT)) & UART_S2_RWUID_MASK) - -#define UART_S2_RXINV_MASK (0x10U) -#define UART_S2_RXINV_SHIFT (4U) -/*! RXINV - Receive Data Inversion - * 0b0..Receive data is not inverted. - * 0b1..Receive data is inverted. - */ -#define UART_S2_RXINV(x) (((uint8_t)(((uint8_t)(x)) << UART_S2_RXINV_SHIFT)) & UART_S2_RXINV_MASK) - -#define UART_S2_MSBF_MASK (0x20U) -#define UART_S2_MSBF_SHIFT (5U) -/*! MSBF - Most Significant Bit First - * 0b0..LSB (bit0) is the first bit that is transmitted following the start bit. Further, the first bit received - * after the start bit is identified as bit0. - * 0b1..MSB (bit8, bit7 or bit6) is the first bit that is transmitted following the start bit, depending on the - * setting of C1[M] and C1[PE]. Further, the first bit received after the start bit is identified as bit8, - * bit7, or bit6, depending on the setting of C1[M] and C1[PE]. - */ -#define UART_S2_MSBF(x) (((uint8_t)(((uint8_t)(x)) << UART_S2_MSBF_SHIFT)) & UART_S2_MSBF_MASK) - -#define UART_S2_RXEDGIF_MASK (0x40U) -#define UART_S2_RXEDGIF_SHIFT (6U) -/*! RXEDGIF - RxD Pin Active Edge Interrupt Flag - * 0b0..No active edge on the receive pin has occurred. - * 0b1..An active edge on the receive pin has occurred. - */ -#define UART_S2_RXEDGIF(x) (((uint8_t)(((uint8_t)(x)) << UART_S2_RXEDGIF_SHIFT)) & UART_S2_RXEDGIF_MASK) -/*! @} */ - -/*! @name C3 - UART Control Register 3 */ -/*! @{ */ - -#define UART_C3_PEIE_MASK (0x1U) -#define UART_C3_PEIE_SHIFT (0U) -/*! PEIE - Parity Error Interrupt Enable - * 0b0..PF interrupt requests are disabled. - * 0b1..PF interrupt requests are enabled. - */ -#define UART_C3_PEIE(x) (((uint8_t)(((uint8_t)(x)) << UART_C3_PEIE_SHIFT)) & UART_C3_PEIE_MASK) - -#define UART_C3_FEIE_MASK (0x2U) -#define UART_C3_FEIE_SHIFT (1U) -/*! FEIE - Framing Error Interrupt Enable - * 0b0..FE interrupt requests are disabled. - * 0b1..FE interrupt requests are enabled. - */ -#define UART_C3_FEIE(x) (((uint8_t)(((uint8_t)(x)) << UART_C3_FEIE_SHIFT)) & UART_C3_FEIE_MASK) - -#define UART_C3_NEIE_MASK (0x4U) -#define UART_C3_NEIE_SHIFT (2U) -/*! NEIE - Noise Error Interrupt Enable - * 0b0..NF interrupt requests are disabled. - * 0b1..NF interrupt requests are enabled. - */ -#define UART_C3_NEIE(x) (((uint8_t)(((uint8_t)(x)) << UART_C3_NEIE_SHIFT)) & UART_C3_NEIE_MASK) - -#define UART_C3_ORIE_MASK (0x8U) -#define UART_C3_ORIE_SHIFT (3U) -/*! ORIE - Overrun Error Interrupt Enable - * 0b0..OR interrupts are disabled. - * 0b1..OR interrupt requests are enabled. - */ -#define UART_C3_ORIE(x) (((uint8_t)(((uint8_t)(x)) << UART_C3_ORIE_SHIFT)) & UART_C3_ORIE_MASK) - -#define UART_C3_TXINV_MASK (0x10U) -#define UART_C3_TXINV_SHIFT (4U) -/*! TXINV - Transmit Data Inversion. - * 0b0..Transmit data is not inverted. - * 0b1..Transmit data is inverted. - */ -#define UART_C3_TXINV(x) (((uint8_t)(((uint8_t)(x)) << UART_C3_TXINV_SHIFT)) & UART_C3_TXINV_MASK) - -#define UART_C3_TXDIR_MASK (0x20U) -#define UART_C3_TXDIR_SHIFT (5U) -/*! TXDIR - Transmitter Pin Data Direction in Single-Wire mode - * 0b0..TXD pin is an input in single wire mode. - * 0b1..TXD pin is an output in single wire mode. - */ -#define UART_C3_TXDIR(x) (((uint8_t)(((uint8_t)(x)) << UART_C3_TXDIR_SHIFT)) & UART_C3_TXDIR_MASK) - -#define UART_C3_T8_MASK (0x40U) -#define UART_C3_T8_SHIFT (6U) -/*! T8 - Transmit Bit 8 */ -#define UART_C3_T8(x) (((uint8_t)(((uint8_t)(x)) << UART_C3_T8_SHIFT)) & UART_C3_T8_MASK) - -#define UART_C3_R8_MASK (0x80U) -#define UART_C3_R8_SHIFT (7U) -/*! R8 - Received Bit 8 */ -#define UART_C3_R8(x) (((uint8_t)(((uint8_t)(x)) << UART_C3_R8_SHIFT)) & UART_C3_R8_MASK) -/*! @} */ - -/*! @name D - UART Data Register */ -/*! @{ */ - -#define UART_D_RT_MASK (0xFFU) -#define UART_D_RT_SHIFT (0U) -#define UART_D_RT(x) (((uint8_t)(((uint8_t)(x)) << UART_D_RT_SHIFT)) & UART_D_RT_MASK) -/*! @} */ - -/*! @name MA1 - UART Match Address Registers 1 */ -/*! @{ */ - -#define UART_MA1_MA_MASK (0xFFU) -#define UART_MA1_MA_SHIFT (0U) -/*! MA - Match Address */ -#define UART_MA1_MA(x) (((uint8_t)(((uint8_t)(x)) << UART_MA1_MA_SHIFT)) & UART_MA1_MA_MASK) -/*! @} */ - -/*! @name MA2 - UART Match Address Registers 2 */ -/*! @{ */ - -#define UART_MA2_MA_MASK (0xFFU) -#define UART_MA2_MA_SHIFT (0U) -/*! MA - Match Address */ -#define UART_MA2_MA(x) (((uint8_t)(((uint8_t)(x)) << UART_MA2_MA_SHIFT)) & UART_MA2_MA_MASK) -/*! @} */ - -/*! @name C4 - UART Control Register 4 */ -/*! @{ */ - -#define UART_C4_BRFA_MASK (0x1FU) -#define UART_C4_BRFA_SHIFT (0U) -/*! BRFA - Baud Rate Fine Adjust */ -#define UART_C4_BRFA(x) (((uint8_t)(((uint8_t)(x)) << UART_C4_BRFA_SHIFT)) & UART_C4_BRFA_MASK) - -#define UART_C4_M10_MASK (0x20U) -#define UART_C4_M10_SHIFT (5U) -/*! M10 - 10-bit Mode select - * 0b0..The parity bit is the ninth bit in the serial transmission. - * 0b1..The parity bit is the tenth bit in the serial transmission. - */ -#define UART_C4_M10(x) (((uint8_t)(((uint8_t)(x)) << UART_C4_M10_SHIFT)) & UART_C4_M10_MASK) - -#define UART_C4_MAEN2_MASK (0x40U) -#define UART_C4_MAEN2_SHIFT (6U) -/*! MAEN2 - Match Address Mode Enable 2 - * 0b0..All data received is transferred to the data buffer if MAEN1 is cleared. - * 0b1..All data received with the most significant bit cleared, is discarded. All data received with the most - * significant bit set, is compared with contents of MA2 register. If no match occurs, the data is discarded. - * If a match occurs, data is transferred to the data buffer. This field must be cleared when C7816[ISO7816E] - * is set/enabled. - */ -#define UART_C4_MAEN2(x) (((uint8_t)(((uint8_t)(x)) << UART_C4_MAEN2_SHIFT)) & UART_C4_MAEN2_MASK) - -#define UART_C4_MAEN1_MASK (0x80U) -#define UART_C4_MAEN1_SHIFT (7U) -/*! MAEN1 - Match Address Mode Enable 1 - * 0b0..All data received is transferred to the data buffer if MAEN2 is cleared. - * 0b1..All data received with the most significant bit cleared, is discarded. All data received with the most - * significant bit set, is compared with contents of MA1 register. If no match occurs, the data is discarded. - * If match occurs, data is transferred to the data buffer. This field must be cleared when C7816[ISO7816E] is - * set/enabled. - */ -#define UART_C4_MAEN1(x) (((uint8_t)(((uint8_t)(x)) << UART_C4_MAEN1_SHIFT)) & UART_C4_MAEN1_MASK) -/*! @} */ - -/*! @name C5 - UART Control Register 5 */ -/*! @{ */ - -#define UART_C5_RDMAS_MASK (0x20U) -#define UART_C5_RDMAS_SHIFT (5U) -/*! RDMAS - Receiver Full DMA Select - * 0b0..If C2[RIE] and S1[RDRF] are set, the RDFR interrupt request signal is asserted to request an interrupt service. - * 0b1..If C2[RIE] and S1[RDRF] are set, the RDRF DMA request signal is asserted to request a DMA transfer. - */ -#define UART_C5_RDMAS(x) (((uint8_t)(((uint8_t)(x)) << UART_C5_RDMAS_SHIFT)) & UART_C5_RDMAS_MASK) - -#define UART_C5_TDMAS_MASK (0x80U) -#define UART_C5_TDMAS_SHIFT (7U) -/*! TDMAS - Transmitter DMA Select - * 0b0..If C2[TIE] is set and the S1[TDRE] flag is set, the TDRE interrupt request signal is asserted to request interrupt service. - * 0b1..If C2[TIE] is set and the S1[TDRE] flag is set, the TDRE DMA request signal is asserted to request a DMA transfer. - */ -#define UART_C5_TDMAS(x) (((uint8_t)(((uint8_t)(x)) << UART_C5_TDMAS_SHIFT)) & UART_C5_TDMAS_MASK) -/*! @} */ - -/*! @name C7816 - UART 7816 Control Register */ -/*! @{ */ - -#define UART_C7816_ISO_7816E_MASK (0x1U) -#define UART_C7816_ISO_7816E_SHIFT (0U) -/*! ISO_7816E - ISO-7816 Functionality Enabled - * 0b0..ISO-7816 functionality is turned off/not enabled. - * 0b1..ISO-7816 functionality is turned on/enabled. - */ -#define UART_C7816_ISO_7816E(x) (((uint8_t)(((uint8_t)(x)) << UART_C7816_ISO_7816E_SHIFT)) & UART_C7816_ISO_7816E_MASK) - -#define UART_C7816_TTYPE_MASK (0x2U) -#define UART_C7816_TTYPE_SHIFT (1U) -/*! TTYPE - Transfer Type - * 0b0..T = 0 per the ISO-7816 specification. - * 0b1..T = 1 per the ISO-7816 specification. - */ -#define UART_C7816_TTYPE(x) (((uint8_t)(((uint8_t)(x)) << UART_C7816_TTYPE_SHIFT)) & UART_C7816_TTYPE_MASK) - -#define UART_C7816_INIT_MASK (0x4U) -#define UART_C7816_INIT_SHIFT (2U) -/*! INIT - Detect Initial Character - * 0b0..Normal operating mode. Receiver does not seek to identify initial character. - * 0b1..Receiver searches for initial character. - */ -#define UART_C7816_INIT(x) (((uint8_t)(((uint8_t)(x)) << UART_C7816_INIT_SHIFT)) & UART_C7816_INIT_MASK) - -#define UART_C7816_ANACK_MASK (0x8U) -#define UART_C7816_ANACK_SHIFT (3U) -/*! ANACK - Generate NACK on Error - * 0b0..No NACK is automatically generated. - * 0b1..A NACK is automatically generated if a parity error is detected or if an invalid initial character is detected. - */ -#define UART_C7816_ANACK(x) (((uint8_t)(((uint8_t)(x)) << UART_C7816_ANACK_SHIFT)) & UART_C7816_ANACK_MASK) - -#define UART_C7816_ONACK_MASK (0x10U) -#define UART_C7816_ONACK_SHIFT (4U) -/*! ONACK - Generate NACK on Overflow - * 0b0..The received data does not generate a NACK when the receipt of the data results in an overflow event. - * 0b1..If the receiver buffer overflows, a NACK is automatically sent on a received character. - */ -#define UART_C7816_ONACK(x) (((uint8_t)(((uint8_t)(x)) << UART_C7816_ONACK_SHIFT)) & UART_C7816_ONACK_MASK) -/*! @} */ - -/*! @name IE7816 - UART 7816 Interrupt Enable Register */ -/*! @{ */ - -#define UART_IE7816_RXTE_MASK (0x1U) -#define UART_IE7816_RXTE_SHIFT (0U) -/*! RXTE - Receive Threshold Exceeded Interrupt Enable - * 0b0..The assertion of IS7816[RXT] does not result in the generation of an interrupt. - * 0b1..The assertion of IS7816[RXT] results in the generation of an interrupt. - */ -#define UART_IE7816_RXTE(x) (((uint8_t)(((uint8_t)(x)) << UART_IE7816_RXTE_SHIFT)) & UART_IE7816_RXTE_MASK) - -#define UART_IE7816_TXTE_MASK (0x2U) -#define UART_IE7816_TXTE_SHIFT (1U) -/*! TXTE - Transmit Threshold Exceeded Interrupt Enable - * 0b0..The assertion of IS7816[TXT] does not result in the generation of an interrupt. - * 0b1..The assertion of IS7816[TXT] results in the generation of an interrupt. - */ -#define UART_IE7816_TXTE(x) (((uint8_t)(((uint8_t)(x)) << UART_IE7816_TXTE_SHIFT)) & UART_IE7816_TXTE_MASK) - -#define UART_IE7816_GTVE_MASK (0x4U) -#define UART_IE7816_GTVE_SHIFT (2U) -/*! GTVE - Guard Timer Violated Interrupt Enable - * 0b0..The assertion of IS7816[GTV] does not result in the generation of an interrupt. - * 0b1..The assertion of IS7816[GTV] results in the generation of an interrupt. - */ -#define UART_IE7816_GTVE(x) (((uint8_t)(((uint8_t)(x)) << UART_IE7816_GTVE_SHIFT)) & UART_IE7816_GTVE_MASK) - -#define UART_IE7816_ADTE_MASK (0x8U) -#define UART_IE7816_ADTE_SHIFT (3U) -/*! ADTE - ATR Duration Timer Interrupt Enable - * 0b0..The assertion of IS7816[ADT] does not result in the generation of an interrupt. - * 0b1..The assertion of IS7816[ADT] results in the generation of an interrupt. - */ -#define UART_IE7816_ADTE(x) (((uint8_t)(((uint8_t)(x)) << UART_IE7816_ADTE_SHIFT)) & UART_IE7816_ADTE_MASK) - -#define UART_IE7816_INITDE_MASK (0x10U) -#define UART_IE7816_INITDE_SHIFT (4U) -/*! INITDE - Initial Character Detected Interrupt Enable - * 0b0..The assertion of IS7816[INITD] does not result in the generation of an interrupt. - * 0b1..The assertion of IS7816[INITD] results in the generation of an interrupt. - */ -#define UART_IE7816_INITDE(x) (((uint8_t)(((uint8_t)(x)) << UART_IE7816_INITDE_SHIFT)) & UART_IE7816_INITDE_MASK) - -#define UART_IE7816_BWTE_MASK (0x20U) -#define UART_IE7816_BWTE_SHIFT (5U) -/*! BWTE - Block Wait Timer Interrupt Enable - * 0b0..The assertion of IS7816[BWT] does not result in the generation of an interrupt. - * 0b1..The assertion of IS7816[BWT] results in the generation of an interrupt. - */ -#define UART_IE7816_BWTE(x) (((uint8_t)(((uint8_t)(x)) << UART_IE7816_BWTE_SHIFT)) & UART_IE7816_BWTE_MASK) - -#define UART_IE7816_CWTE_MASK (0x40U) -#define UART_IE7816_CWTE_SHIFT (6U) -/*! CWTE - Character Wait Timer Interrupt Enable - * 0b0..The assertion of IS7816[CWT] does not result in the generation of an interrupt. - * 0b1..The assertion of IS7816[CWT] results in the generation of an interrupt. - */ -#define UART_IE7816_CWTE(x) (((uint8_t)(((uint8_t)(x)) << UART_IE7816_CWTE_SHIFT)) & UART_IE7816_CWTE_MASK) - -#define UART_IE7816_WTE_MASK (0x80U) -#define UART_IE7816_WTE_SHIFT (7U) -/*! WTE - Wait Timer Interrupt Enable - * 0b0..The assertion of IS7816[WT] does not result in the generation of an interrupt. - * 0b1..The assertion of IS7816[WT] results in the generation of an interrupt. - */ -#define UART_IE7816_WTE(x) (((uint8_t)(((uint8_t)(x)) << UART_IE7816_WTE_SHIFT)) & UART_IE7816_WTE_MASK) -/*! @} */ - -/*! @name IS7816 - UART 7816 Interrupt Status Register */ -/*! @{ */ - -#define UART_IS7816_RXT_MASK (0x1U) -#define UART_IS7816_RXT_SHIFT (0U) -/*! RXT - Receive Threshold Exceeded Interrupt - * 0b0..The number of consecutive NACKS generated as a result of parity errors and buffer overruns is less than - * or equal to the value in ET7816[RXTHRESHOLD]. - * 0b1..The number of consecutive NACKS generated as a result of parity errors and buffer overruns is greater than the value in ET7816[RXTHRESHOLD]. - */ -#define UART_IS7816_RXT(x) (((uint8_t)(((uint8_t)(x)) << UART_IS7816_RXT_SHIFT)) & UART_IS7816_RXT_MASK) - -#define UART_IS7816_TXT_MASK (0x2U) -#define UART_IS7816_TXT_SHIFT (1U) -/*! TXT - Transmit Threshold Exceeded Interrupt - * 0b0..The number of retries and corresponding NACKS does not exceed the value in ET7816[TXTHRESHOLD]. - * 0b1..The number of retries and corresponding NACKS exceeds the value in ET7816[TXTHRESHOLD]. - */ -#define UART_IS7816_TXT(x) (((uint8_t)(((uint8_t)(x)) << UART_IS7816_TXT_SHIFT)) & UART_IS7816_TXT_MASK) - -#define UART_IS7816_GTV_MASK (0x4U) -#define UART_IS7816_GTV_SHIFT (2U) -/*! GTV - Guard Timer Violated Interrupt - * 0b0..A guard time (GT, CGT, or BGT) has not been violated. - * 0b1..A guard time (GT, CGT, or BGT) has been violated. - */ -#define UART_IS7816_GTV(x) (((uint8_t)(((uint8_t)(x)) << UART_IS7816_GTV_SHIFT)) & UART_IS7816_GTV_MASK) - -#define UART_IS7816_ADT_MASK (0x8U) -#define UART_IS7816_ADT_SHIFT (3U) -/*! ADT - ATR Duration Time Interrupt - * 0b0..ATR Duration time (ADT) has not been violated. - * 0b1..ATR Duration time (ADT) has been violated. - */ -#define UART_IS7816_ADT(x) (((uint8_t)(((uint8_t)(x)) << UART_IS7816_ADT_SHIFT)) & UART_IS7816_ADT_MASK) - -#define UART_IS7816_INITD_MASK (0x10U) -#define UART_IS7816_INITD_SHIFT (4U) -/*! INITD - Initial Character Detected Interrupt - * 0b0..A valid initial character has not been received. - * 0b1..A valid initial character has been received. - */ -#define UART_IS7816_INITD(x) (((uint8_t)(((uint8_t)(x)) << UART_IS7816_INITD_SHIFT)) & UART_IS7816_INITD_MASK) - -#define UART_IS7816_BWT_MASK (0x20U) -#define UART_IS7816_BWT_SHIFT (5U) -/*! BWT - Block Wait Timer Interrupt - * 0b0..Block wait time (BWT) has not been violated. - * 0b1..Block wait time (BWT) has been violated. - */ -#define UART_IS7816_BWT(x) (((uint8_t)(((uint8_t)(x)) << UART_IS7816_BWT_SHIFT)) & UART_IS7816_BWT_MASK) - -#define UART_IS7816_CWT_MASK (0x40U) -#define UART_IS7816_CWT_SHIFT (6U) -/*! CWT - Character Wait Timer Interrupt - * 0b0..Character wait time (CWT) has not been violated. - * 0b1..Character wait time (CWT) has been violated. - */ -#define UART_IS7816_CWT(x) (((uint8_t)(((uint8_t)(x)) << UART_IS7816_CWT_SHIFT)) & UART_IS7816_CWT_MASK) - -#define UART_IS7816_WT_MASK (0x80U) -#define UART_IS7816_WT_SHIFT (7U) -/*! WT - Wait Timer Interrupt - * 0b0..Wait time (WT) has not been violated. - * 0b1..Wait time (WT) has been violated. - */ -#define UART_IS7816_WT(x) (((uint8_t)(((uint8_t)(x)) << UART_IS7816_WT_SHIFT)) & UART_IS7816_WT_MASK) -/*! @} */ - -/*! @name WP7816 - UART 7816 Wait Parameter Register */ -/*! @{ */ - -#define UART_WP7816_WTX_MASK (0xFFU) -#define UART_WP7816_WTX_SHIFT (0U) -/*! WTX - Wait Time Multiplier (C7816[TTYPE] = 1) */ -#define UART_WP7816_WTX(x) (((uint8_t)(((uint8_t)(x)) << UART_WP7816_WTX_SHIFT)) & UART_WP7816_WTX_MASK) -/*! @} */ - -/*! @name WN7816 - UART 7816 Wait N Register */ -/*! @{ */ - -#define UART_WN7816_GTN_MASK (0xFFU) -#define UART_WN7816_GTN_SHIFT (0U) -/*! GTN - Guard Band N */ -#define UART_WN7816_GTN(x) (((uint8_t)(((uint8_t)(x)) << UART_WN7816_GTN_SHIFT)) & UART_WN7816_GTN_MASK) -/*! @} */ - -/*! @name WF7816 - UART 7816 Wait FD Register */ -/*! @{ */ - -#define UART_WF7816_GTFD_MASK (0xFFU) -#define UART_WF7816_GTFD_SHIFT (0U) -/*! GTFD - FD Multiplier */ -#define UART_WF7816_GTFD(x) (((uint8_t)(((uint8_t)(x)) << UART_WF7816_GTFD_SHIFT)) & UART_WF7816_GTFD_MASK) -/*! @} */ - -/*! @name ET7816 - UART 7816 Error Threshold Register */ -/*! @{ */ - -#define UART_ET7816_RXTHRESHOLD_MASK (0xFU) -#define UART_ET7816_RXTHRESHOLD_SHIFT (0U) -/*! RXTHRESHOLD - Receive NACK Threshold */ -#define UART_ET7816_RXTHRESHOLD(x) (((uint8_t)(((uint8_t)(x)) << UART_ET7816_RXTHRESHOLD_SHIFT)) & UART_ET7816_RXTHRESHOLD_MASK) - -#define UART_ET7816_TXTHRESHOLD_MASK (0xF0U) -#define UART_ET7816_TXTHRESHOLD_SHIFT (4U) -/*! TXTHRESHOLD - Transmit NACK Threshold - * 0b0000..TXT asserts on the first NACK that is received. - * 0b0001..TXT asserts on the second NACK that is received. - */ -#define UART_ET7816_TXTHRESHOLD(x) (((uint8_t)(((uint8_t)(x)) << UART_ET7816_TXTHRESHOLD_SHIFT)) & UART_ET7816_TXTHRESHOLD_MASK) -/*! @} */ - -/*! @name TL7816 - UART 7816 Transmit Length Register */ -/*! @{ */ - -#define UART_TL7816_TLEN_MASK (0xFFU) -#define UART_TL7816_TLEN_SHIFT (0U) -/*! TLEN - Transmit Length */ -#define UART_TL7816_TLEN(x) (((uint8_t)(((uint8_t)(x)) << UART_TL7816_TLEN_SHIFT)) & UART_TL7816_TLEN_MASK) -/*! @} */ - -/*! @name AP7816A_T0 - UART 7816 ATR Duration Timer Register A */ -/*! @{ */ - -#define UART_AP7816A_T0_ADTI_H_MASK (0xFFU) -#define UART_AP7816A_T0_ADTI_H_SHIFT (0U) -/*! ADTI_H - ATR Duration Time Integer High (C7816[TTYPE] = 0) */ -#define UART_AP7816A_T0_ADTI_H(x) (((uint8_t)(((uint8_t)(x)) << UART_AP7816A_T0_ADTI_H_SHIFT)) & UART_AP7816A_T0_ADTI_H_MASK) -/*! @} */ - -/*! @name AP7816B_T0 - UART 7816 ATR Duration Timer Register B */ -/*! @{ */ - -#define UART_AP7816B_T0_ADTI_L_MASK (0xFFU) -#define UART_AP7816B_T0_ADTI_L_SHIFT (0U) -/*! ADTI_L - ATR Duration Time Integer Low (C7816[TTYPE] = 0) */ -#define UART_AP7816B_T0_ADTI_L(x) (((uint8_t)(((uint8_t)(x)) << UART_AP7816B_T0_ADTI_L_SHIFT)) & UART_AP7816B_T0_ADTI_L_MASK) -/*! @} */ - -/*! @name WP7816A_T0 - UART 7816 Wait Parameter Register A */ -/*! @{ */ - -#define UART_WP7816A_T0_WI_H_MASK (0xFFU) -#define UART_WP7816A_T0_WI_H_SHIFT (0U) -/*! WI_H - Wait Time Integer High (C7816[TTYPE] = 0) */ -#define UART_WP7816A_T0_WI_H(x) (((uint8_t)(((uint8_t)(x)) << UART_WP7816A_T0_WI_H_SHIFT)) & UART_WP7816A_T0_WI_H_MASK) -/*! @} */ - -/*! @name WP7816B_T0 - UART 7816 Wait Parameter Register B */ -/*! @{ */ - -#define UART_WP7816B_T0_WI_L_MASK (0xFFU) -#define UART_WP7816B_T0_WI_L_SHIFT (0U) -/*! WI_L - Wait Time Integer Low (C7816[TTYPE] = 0) */ -#define UART_WP7816B_T0_WI_L(x) (((uint8_t)(((uint8_t)(x)) << UART_WP7816B_T0_WI_L_SHIFT)) & UART_WP7816B_T0_WI_L_MASK) -/*! @} */ - -/*! @name WP7816A_T1 - UART 7816 Wait Parameter Register A */ -/*! @{ */ - -#define UART_WP7816A_T1_BWI_H_MASK (0xFFU) -#define UART_WP7816A_T1_BWI_H_SHIFT (0U) -/*! BWI_H - Block Wait Time Integer High (C7816[TTYPE] = 1) */ -#define UART_WP7816A_T1_BWI_H(x) (((uint8_t)(((uint8_t)(x)) << UART_WP7816A_T1_BWI_H_SHIFT)) & UART_WP7816A_T1_BWI_H_MASK) -/*! @} */ - -/*! @name WP7816B_T1 - UART 7816 Wait Parameter Register B */ -/*! @{ */ - -#define UART_WP7816B_T1_BWI_L_MASK (0xFFU) -#define UART_WP7816B_T1_BWI_L_SHIFT (0U) -/*! BWI_L - Block Wait Time Integer Low (C7816[TTYPE] = 1) */ -#define UART_WP7816B_T1_BWI_L(x) (((uint8_t)(((uint8_t)(x)) << UART_WP7816B_T1_BWI_L_SHIFT)) & UART_WP7816B_T1_BWI_L_MASK) -/*! @} */ - -/*! @name WGP7816_T1 - UART 7816 Wait and Guard Parameter Register */ -/*! @{ */ - -#define UART_WGP7816_T1_BGI_MASK (0xFU) -#define UART_WGP7816_T1_BGI_SHIFT (0U) -/*! BGI - Block Guard Time Integer (C7816[TTYPE] = 1) */ -#define UART_WGP7816_T1_BGI(x) (((uint8_t)(((uint8_t)(x)) << UART_WGP7816_T1_BGI_SHIFT)) & UART_WGP7816_T1_BGI_MASK) - -#define UART_WGP7816_T1_CWI1_MASK (0xF0U) -#define UART_WGP7816_T1_CWI1_SHIFT (4U) -/*! CWI1 - Character Wait Time Integer 1 (C7816[TTYPE] = 1) */ -#define UART_WGP7816_T1_CWI1(x) (((uint8_t)(((uint8_t)(x)) << UART_WGP7816_T1_CWI1_SHIFT)) & UART_WGP7816_T1_CWI1_MASK) -/*! @} */ - -/*! @name WP7816C_T1 - UART 7816 Wait Parameter Register C */ -/*! @{ */ - -#define UART_WP7816C_T1_CWI2_MASK (0x1FU) -#define UART_WP7816C_T1_CWI2_SHIFT (0U) -/*! CWI2 - Character Wait Time Integer 2 (C7816[TTYPE] = 1) */ -#define UART_WP7816C_T1_CWI2(x) (((uint8_t)(((uint8_t)(x)) << UART_WP7816C_T1_CWI2_SHIFT)) & UART_WP7816C_T1_CWI2_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group UART_Register_Masks */ - - -/* UART - Peripheral instance base addresses */ -/** Peripheral UART2 base address */ -#define UART2_BASE (0x4006C000u) -/** Peripheral UART2 base pointer */ -#define UART2 ((UART_Type *)UART2_BASE) -/** Array initializer of UART peripheral base addresses */ -#define UART_BASE_ADDRS { 0u, 0u, UART2_BASE } -/** Array initializer of UART peripheral base pointers */ -#define UART_BASE_PTRS { (UART_Type *)0u, (UART_Type *)0u, UART2 } -/** Interrupt vectors for the UART peripheral type */ -#define UART_RX_TX_IRQS { NotAvail_IRQn, NotAvail_IRQn, UART2_FLEXIO_IRQn } -#define UART_ERR_IRQS { NotAvail_IRQn, NotAvail_IRQn, UART2_FLEXIO_IRQn } - -/*! - * @} - */ /* end of group UART_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- USB Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USB_Peripheral_Access_Layer USB Peripheral Access Layer - * @{ - */ - -/** USB - Register Layout Typedef */ -typedef struct { - __I uint8_t PERID; /**< Peripheral ID register, offset: 0x0 */ - uint8_t RESERVED_0[3]; - __I uint8_t IDCOMP; /**< Peripheral ID Complement register, offset: 0x4 */ - uint8_t RESERVED_1[3]; - __I uint8_t REV; /**< Peripheral Revision register, offset: 0x8 */ - uint8_t RESERVED_2[3]; - __I uint8_t ADDINFO; /**< Peripheral Additional Info register, offset: 0xC */ - uint8_t RESERVED_3[115]; - __IO uint8_t ISTAT; /**< Interrupt Status register, offset: 0x80 */ - uint8_t RESERVED_4[3]; - __IO uint8_t INTEN; /**< Interrupt Enable register, offset: 0x84 */ - uint8_t RESERVED_5[3]; - __IO uint8_t ERRSTAT; /**< Error Interrupt Status register, offset: 0x88 */ - uint8_t RESERVED_6[3]; - __IO uint8_t ERREN; /**< Error Interrupt Enable register, offset: 0x8C */ - uint8_t RESERVED_7[3]; - __I uint8_t STAT; /**< Status register, offset: 0x90 */ - uint8_t RESERVED_8[3]; - __IO uint8_t CTL; /**< Control register, offset: 0x94 */ - uint8_t RESERVED_9[3]; - __IO uint8_t ADDR; /**< Address register, offset: 0x98 */ - uint8_t RESERVED_10[3]; - __IO uint8_t BDTPAGE1; /**< BDT Page register 1, offset: 0x9C */ - uint8_t RESERVED_11[3]; - __IO uint8_t FRMNUML; /**< Frame Number register Low, offset: 0xA0 */ - uint8_t RESERVED_12[3]; - __IO uint8_t FRMNUMH; /**< Frame Number register High, offset: 0xA4 */ - uint8_t RESERVED_13[11]; - __IO uint8_t BDTPAGE2; /**< BDT Page Register 2, offset: 0xB0 */ - uint8_t RESERVED_14[3]; - __IO uint8_t BDTPAGE3; /**< BDT Page Register 3, offset: 0xB4 */ - uint8_t RESERVED_15[11]; - struct { /* offset: 0xC0, array step: 0x4 */ - __IO uint8_t ENDPT; /**< Endpoint Control register, array offset: 0xC0, array step: 0x4 */ - uint8_t RESERVED_0[3]; - } ENDPOINT[16]; - __IO uint8_t USBCTRL; /**< USB Control register, offset: 0x100 */ - uint8_t RESERVED_16[3]; - __I uint8_t OBSERVE; /**< USB OTG Observe register, offset: 0x104 */ - uint8_t RESERVED_17[3]; - __IO uint8_t CONTROL; /**< USB OTG Control register, offset: 0x108 */ - uint8_t RESERVED_18[3]; - __IO uint8_t USBTRC0; /**< USB Transceiver Control register 0, offset: 0x10C */ - uint8_t RESERVED_19[7]; - __IO uint8_t USBFRMADJUST; /**< Frame Adjust Register, offset: 0x114 */ - uint8_t RESERVED_20[43]; - __IO uint8_t CLK_RECOVER_CTRL; /**< USB Clock recovery control, offset: 0x140 */ - uint8_t RESERVED_21[3]; - __IO uint8_t CLK_RECOVER_IRC_EN; /**< IRC48M oscillator enable register, offset: 0x144 */ - uint8_t RESERVED_22[15]; - __IO uint8_t CLK_RECOVER_INT_EN; /**< Clock recovery combined interrupt enable, offset: 0x154 */ - uint8_t RESERVED_23[7]; - __IO uint8_t CLK_RECOVER_INT_STATUS; /**< Clock recovery separated interrupt status, offset: 0x15C */ -} USB_Type; - -/* ---------------------------------------------------------------------------- - -- USB Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USB_Register_Masks USB Register Masks - * @{ - */ - -/*! @name PERID - Peripheral ID register */ -/*! @{ */ - -#define USB_PERID_ID_MASK (0x3FU) -#define USB_PERID_ID_SHIFT (0U) -/*! ID - Peripheral Identification */ -#define USB_PERID_ID(x) (((uint8_t)(((uint8_t)(x)) << USB_PERID_ID_SHIFT)) & USB_PERID_ID_MASK) -/*! @} */ - -/*! @name IDCOMP - Peripheral ID Complement register */ -/*! @{ */ - -#define USB_IDCOMP_NID_MASK (0x3FU) -#define USB_IDCOMP_NID_SHIFT (0U) -#define USB_IDCOMP_NID(x) (((uint8_t)(((uint8_t)(x)) << USB_IDCOMP_NID_SHIFT)) & USB_IDCOMP_NID_MASK) -/*! @} */ - -/*! @name REV - Peripheral Revision register */ -/*! @{ */ - -#define USB_REV_REV_MASK (0xFFU) -#define USB_REV_REV_SHIFT (0U) -/*! REV - Revision */ -#define USB_REV_REV(x) (((uint8_t)(((uint8_t)(x)) << USB_REV_REV_SHIFT)) & USB_REV_REV_MASK) -/*! @} */ - -/*! @name ADDINFO - Peripheral Additional Info register */ -/*! @{ */ - -#define USB_ADDINFO_IEHOST_MASK (0x1U) -#define USB_ADDINFO_IEHOST_SHIFT (0U) -#define USB_ADDINFO_IEHOST(x) (((uint8_t)(((uint8_t)(x)) << USB_ADDINFO_IEHOST_SHIFT)) & USB_ADDINFO_IEHOST_MASK) -/*! @} */ - -/*! @name ISTAT - Interrupt Status register */ -/*! @{ */ - -#define USB_ISTAT_USBRST_MASK (0x1U) -#define USB_ISTAT_USBRST_SHIFT (0U) -#define USB_ISTAT_USBRST(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_USBRST_SHIFT)) & USB_ISTAT_USBRST_MASK) - -#define USB_ISTAT_ERROR_MASK (0x2U) -#define USB_ISTAT_ERROR_SHIFT (1U) -#define USB_ISTAT_ERROR(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_ERROR_SHIFT)) & USB_ISTAT_ERROR_MASK) - -#define USB_ISTAT_SOFTOK_MASK (0x4U) -#define USB_ISTAT_SOFTOK_SHIFT (2U) -#define USB_ISTAT_SOFTOK(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_SOFTOK_SHIFT)) & USB_ISTAT_SOFTOK_MASK) - -#define USB_ISTAT_TOKDNE_MASK (0x8U) -#define USB_ISTAT_TOKDNE_SHIFT (3U) -#define USB_ISTAT_TOKDNE(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_TOKDNE_SHIFT)) & USB_ISTAT_TOKDNE_MASK) - -#define USB_ISTAT_SLEEP_MASK (0x10U) -#define USB_ISTAT_SLEEP_SHIFT (4U) -#define USB_ISTAT_SLEEP(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_SLEEP_SHIFT)) & USB_ISTAT_SLEEP_MASK) - -#define USB_ISTAT_RESUME_MASK (0x20U) -#define USB_ISTAT_RESUME_SHIFT (5U) -#define USB_ISTAT_RESUME(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_RESUME_SHIFT)) & USB_ISTAT_RESUME_MASK) - -#define USB_ISTAT_STALL_MASK (0x80U) -#define USB_ISTAT_STALL_SHIFT (7U) -/*! STALL - Stall Interrupt */ -#define USB_ISTAT_STALL(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_STALL_SHIFT)) & USB_ISTAT_STALL_MASK) -/*! @} */ - -/*! @name INTEN - Interrupt Enable register */ -/*! @{ */ - -#define USB_INTEN_USBRSTEN_MASK (0x1U) -#define USB_INTEN_USBRSTEN_SHIFT (0U) -/*! USBRSTEN - USBRST Interrupt Enable - * 0b0..Disables the USBRST interrupt. - * 0b1..Enables the USBRST interrupt. - */ -#define USB_INTEN_USBRSTEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_USBRSTEN_SHIFT)) & USB_INTEN_USBRSTEN_MASK) - -#define USB_INTEN_ERROREN_MASK (0x2U) -#define USB_INTEN_ERROREN_SHIFT (1U) -/*! ERROREN - ERROR Interrupt Enable - * 0b0..Disables the ERROR interrupt. - * 0b1..Enables the ERROR interrupt. - */ -#define USB_INTEN_ERROREN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_ERROREN_SHIFT)) & USB_INTEN_ERROREN_MASK) - -#define USB_INTEN_SOFTOKEN_MASK (0x4U) -#define USB_INTEN_SOFTOKEN_SHIFT (2U) -/*! SOFTOKEN - SOFTOK Interrupt Enable - * 0b0..Disbles the SOFTOK interrupt. - * 0b1..Enables the SOFTOK interrupt. - */ -#define USB_INTEN_SOFTOKEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_SOFTOKEN_SHIFT)) & USB_INTEN_SOFTOKEN_MASK) - -#define USB_INTEN_TOKDNEEN_MASK (0x8U) -#define USB_INTEN_TOKDNEEN_SHIFT (3U) -/*! TOKDNEEN - TOKDNE Interrupt Enable - * 0b0..Disables the TOKDNE interrupt. - * 0b1..Enables the TOKDNE interrupt. - */ -#define USB_INTEN_TOKDNEEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_TOKDNEEN_SHIFT)) & USB_INTEN_TOKDNEEN_MASK) - -#define USB_INTEN_SLEEPEN_MASK (0x10U) -#define USB_INTEN_SLEEPEN_SHIFT (4U) -/*! SLEEPEN - SLEEP Interrupt Enable - * 0b0..Disables the SLEEP interrupt. - * 0b1..Enables the SLEEP interrupt. - */ -#define USB_INTEN_SLEEPEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_SLEEPEN_SHIFT)) & USB_INTEN_SLEEPEN_MASK) - -#define USB_INTEN_RESUMEEN_MASK (0x20U) -#define USB_INTEN_RESUMEEN_SHIFT (5U) -/*! RESUMEEN - RESUME Interrupt Enable - * 0b0..Disables the RESUME interrupt. - * 0b1..Enables the RESUME interrupt. - */ -#define USB_INTEN_RESUMEEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_RESUMEEN_SHIFT)) & USB_INTEN_RESUMEEN_MASK) - -#define USB_INTEN_STALLEN_MASK (0x80U) -#define USB_INTEN_STALLEN_SHIFT (7U) -/*! STALLEN - STALL Interrupt Enable - * 0b0..Diasbles the STALL interrupt. - * 0b1..Enables the STALL interrupt. - */ -#define USB_INTEN_STALLEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_STALLEN_SHIFT)) & USB_INTEN_STALLEN_MASK) -/*! @} */ - -/*! @name ERRSTAT - Error Interrupt Status register */ -/*! @{ */ - -#define USB_ERRSTAT_PIDERR_MASK (0x1U) -#define USB_ERRSTAT_PIDERR_SHIFT (0U) -#define USB_ERRSTAT_PIDERR(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_PIDERR_SHIFT)) & USB_ERRSTAT_PIDERR_MASK) - -#define USB_ERRSTAT_CRC5_MASK (0x2U) -#define USB_ERRSTAT_CRC5_SHIFT (1U) -#define USB_ERRSTAT_CRC5(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_CRC5_SHIFT)) & USB_ERRSTAT_CRC5_MASK) - -#define USB_ERRSTAT_CRC16_MASK (0x4U) -#define USB_ERRSTAT_CRC16_SHIFT (2U) -#define USB_ERRSTAT_CRC16(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_CRC16_SHIFT)) & USB_ERRSTAT_CRC16_MASK) - -#define USB_ERRSTAT_DFN8_MASK (0x8U) -#define USB_ERRSTAT_DFN8_SHIFT (3U) -#define USB_ERRSTAT_DFN8(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_DFN8_SHIFT)) & USB_ERRSTAT_DFN8_MASK) - -#define USB_ERRSTAT_BTOERR_MASK (0x10U) -#define USB_ERRSTAT_BTOERR_SHIFT (4U) -#define USB_ERRSTAT_BTOERR(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_BTOERR_SHIFT)) & USB_ERRSTAT_BTOERR_MASK) - -#define USB_ERRSTAT_DMAERR_MASK (0x20U) -#define USB_ERRSTAT_DMAERR_SHIFT (5U) -#define USB_ERRSTAT_DMAERR(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_DMAERR_SHIFT)) & USB_ERRSTAT_DMAERR_MASK) - -#define USB_ERRSTAT_BTSERR_MASK (0x80U) -#define USB_ERRSTAT_BTSERR_SHIFT (7U) -#define USB_ERRSTAT_BTSERR(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_BTSERR_SHIFT)) & USB_ERRSTAT_BTSERR_MASK) -/*! @} */ - -/*! @name ERREN - Error Interrupt Enable register */ -/*! @{ */ - -#define USB_ERREN_PIDERREN_MASK (0x1U) -#define USB_ERREN_PIDERREN_SHIFT (0U) -/*! PIDERREN - PIDERR Interrupt Enable - * 0b0..Disables the PIDERR interrupt. - * 0b1..Enters the PIDERR interrupt. - */ -#define USB_ERREN_PIDERREN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_PIDERREN_SHIFT)) & USB_ERREN_PIDERREN_MASK) - -#define USB_ERREN_CRC5EOFEN_MASK (0x2U) -#define USB_ERREN_CRC5EOFEN_SHIFT (1U) -/*! CRC5EOFEN - CRC5/EOF Interrupt Enable - * 0b0..Disables the CRC5/EOF interrupt. - * 0b1..Enables the CRC5/EOF interrupt. - */ -#define USB_ERREN_CRC5EOFEN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_CRC5EOFEN_SHIFT)) & USB_ERREN_CRC5EOFEN_MASK) - -#define USB_ERREN_CRC16EN_MASK (0x4U) -#define USB_ERREN_CRC16EN_SHIFT (2U) -/*! CRC16EN - CRC16 Interrupt Enable - * 0b0..Disables the CRC16 interrupt. - * 0b1..Enables the CRC16 interrupt. - */ -#define USB_ERREN_CRC16EN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_CRC16EN_SHIFT)) & USB_ERREN_CRC16EN_MASK) - -#define USB_ERREN_DFN8EN_MASK (0x8U) -#define USB_ERREN_DFN8EN_SHIFT (3U) -/*! DFN8EN - DFN8 Interrupt Enable - * 0b0..Disables the DFN8 interrupt. - * 0b1..Enables the DFN8 interrupt. - */ -#define USB_ERREN_DFN8EN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_DFN8EN_SHIFT)) & USB_ERREN_DFN8EN_MASK) - -#define USB_ERREN_BTOERREN_MASK (0x10U) -#define USB_ERREN_BTOERREN_SHIFT (4U) -/*! BTOERREN - BTOERR Interrupt Enable - * 0b0..Disables the BTOERR interrupt. - * 0b1..Enables the BTOERR interrupt. - */ -#define USB_ERREN_BTOERREN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_BTOERREN_SHIFT)) & USB_ERREN_BTOERREN_MASK) - -#define USB_ERREN_DMAERREN_MASK (0x20U) -#define USB_ERREN_DMAERREN_SHIFT (5U) -/*! DMAERREN - DMAERR Interrupt Enable - * 0b0..Disables the DMAERR interrupt. - * 0b1..Enables the DMAERR interrupt. - */ -#define USB_ERREN_DMAERREN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_DMAERREN_SHIFT)) & USB_ERREN_DMAERREN_MASK) - -#define USB_ERREN_BTSERREN_MASK (0x80U) -#define USB_ERREN_BTSERREN_SHIFT (7U) -/*! BTSERREN - BTSERR Interrupt Enable - * 0b0..Disables the BTSERR interrupt. - * 0b1..Enables the BTSERR interrupt. - */ -#define USB_ERREN_BTSERREN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_BTSERREN_SHIFT)) & USB_ERREN_BTSERREN_MASK) -/*! @} */ - -/*! @name STAT - Status register */ -/*! @{ */ - -#define USB_STAT_ODD_MASK (0x4U) -#define USB_STAT_ODD_SHIFT (2U) -#define USB_STAT_ODD(x) (((uint8_t)(((uint8_t)(x)) << USB_STAT_ODD_SHIFT)) & USB_STAT_ODD_MASK) - -#define USB_STAT_TX_MASK (0x8U) -#define USB_STAT_TX_SHIFT (3U) -/*! TX - Transmit Indicator - * 0b0..The most recent transaction was a receive operation. - * 0b1..The most recent transaction was a transmit operation. - */ -#define USB_STAT_TX(x) (((uint8_t)(((uint8_t)(x)) << USB_STAT_TX_SHIFT)) & USB_STAT_TX_MASK) - -#define USB_STAT_ENDP_MASK (0xF0U) -#define USB_STAT_ENDP_SHIFT (4U) -#define USB_STAT_ENDP(x) (((uint8_t)(((uint8_t)(x)) << USB_STAT_ENDP_SHIFT)) & USB_STAT_ENDP_MASK) -/*! @} */ - -/*! @name CTL - Control register */ -/*! @{ */ - -#define USB_CTL_USBENSOFEN_MASK (0x1U) -#define USB_CTL_USBENSOFEN_SHIFT (0U) -/*! USBENSOFEN - USB Enable - * 0b0..Disables the USB Module. - * 0b1..Enables the USB Module. - */ -#define USB_CTL_USBENSOFEN(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_USBENSOFEN_SHIFT)) & USB_CTL_USBENSOFEN_MASK) - -#define USB_CTL_ODDRST_MASK (0x2U) -#define USB_CTL_ODDRST_SHIFT (1U) -#define USB_CTL_ODDRST(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_ODDRST_SHIFT)) & USB_CTL_ODDRST_MASK) - -#define USB_CTL_RESUME_MASK (0x4U) -#define USB_CTL_RESUME_SHIFT (2U) -#define USB_CTL_RESUME(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_RESUME_SHIFT)) & USB_CTL_RESUME_MASK) - -#define USB_CTL_TXSUSPENDTOKENBUSY_MASK (0x20U) -#define USB_CTL_TXSUSPENDTOKENBUSY_SHIFT (5U) -#define USB_CTL_TXSUSPENDTOKENBUSY(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_TXSUSPENDTOKENBUSY_SHIFT)) & USB_CTL_TXSUSPENDTOKENBUSY_MASK) - -#define USB_CTL_SE0_MASK (0x40U) -#define USB_CTL_SE0_SHIFT (6U) -/*! SE0 - Live USB Single Ended Zero signal */ -#define USB_CTL_SE0(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_SE0_SHIFT)) & USB_CTL_SE0_MASK) - -#define USB_CTL_JSTATE_MASK (0x80U) -#define USB_CTL_JSTATE_SHIFT (7U) -/*! JSTATE - Live USB differential receiver JSTATE signal */ -#define USB_CTL_JSTATE(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_JSTATE_SHIFT)) & USB_CTL_JSTATE_MASK) -/*! @} */ - -/*! @name ADDR - Address register */ -/*! @{ */ - -#define USB_ADDR_ADDR_MASK (0x7FU) -#define USB_ADDR_ADDR_SHIFT (0U) -/*! ADDR - USB Address */ -#define USB_ADDR_ADDR(x) (((uint8_t)(((uint8_t)(x)) << USB_ADDR_ADDR_SHIFT)) & USB_ADDR_ADDR_MASK) -/*! @} */ - -/*! @name BDTPAGE1 - BDT Page register 1 */ -/*! @{ */ - -#define USB_BDTPAGE1_BDTBA_MASK (0xFEU) -#define USB_BDTPAGE1_BDTBA_SHIFT (1U) -#define USB_BDTPAGE1_BDTBA(x) (((uint8_t)(((uint8_t)(x)) << USB_BDTPAGE1_BDTBA_SHIFT)) & USB_BDTPAGE1_BDTBA_MASK) -/*! @} */ - -/*! @name FRMNUML - Frame Number register Low */ -/*! @{ */ - -#define USB_FRMNUML_FRM_MASK (0xFFU) -#define USB_FRMNUML_FRM_SHIFT (0U) -#define USB_FRMNUML_FRM(x) (((uint8_t)(((uint8_t)(x)) << USB_FRMNUML_FRM_SHIFT)) & USB_FRMNUML_FRM_MASK) -/*! @} */ - -/*! @name FRMNUMH - Frame Number register High */ -/*! @{ */ - -#define USB_FRMNUMH_FRM_MASK (0x7U) -#define USB_FRMNUMH_FRM_SHIFT (0U) -#define USB_FRMNUMH_FRM(x) (((uint8_t)(((uint8_t)(x)) << USB_FRMNUMH_FRM_SHIFT)) & USB_FRMNUMH_FRM_MASK) -/*! @} */ - -/*! @name BDTPAGE2 - BDT Page Register 2 */ -/*! @{ */ - -#define USB_BDTPAGE2_BDTBA_MASK (0xFFU) -#define USB_BDTPAGE2_BDTBA_SHIFT (0U) -#define USB_BDTPAGE2_BDTBA(x) (((uint8_t)(((uint8_t)(x)) << USB_BDTPAGE2_BDTBA_SHIFT)) & USB_BDTPAGE2_BDTBA_MASK) -/*! @} */ - -/*! @name BDTPAGE3 - BDT Page Register 3 */ -/*! @{ */ - -#define USB_BDTPAGE3_BDTBA_MASK (0xFFU) -#define USB_BDTPAGE3_BDTBA_SHIFT (0U) -#define USB_BDTPAGE3_BDTBA(x) (((uint8_t)(((uint8_t)(x)) << USB_BDTPAGE3_BDTBA_SHIFT)) & USB_BDTPAGE3_BDTBA_MASK) -/*! @} */ - -/*! @name ENDPT - Endpoint Control register */ -/*! @{ */ - -#define USB_ENDPT_EPHSHK_MASK (0x1U) -#define USB_ENDPT_EPHSHK_SHIFT (0U) -#define USB_ENDPT_EPHSHK(x) (((uint8_t)(((uint8_t)(x)) << USB_ENDPT_EPHSHK_SHIFT)) & USB_ENDPT_EPHSHK_MASK) - -#define USB_ENDPT_EPSTALL_MASK (0x2U) -#define USB_ENDPT_EPSTALL_SHIFT (1U) -#define USB_ENDPT_EPSTALL(x) (((uint8_t)(((uint8_t)(x)) << USB_ENDPT_EPSTALL_SHIFT)) & USB_ENDPT_EPSTALL_MASK) - -#define USB_ENDPT_EPTXEN_MASK (0x4U) -#define USB_ENDPT_EPTXEN_SHIFT (2U) -#define USB_ENDPT_EPTXEN(x) (((uint8_t)(((uint8_t)(x)) << USB_ENDPT_EPTXEN_SHIFT)) & USB_ENDPT_EPTXEN_MASK) - -#define USB_ENDPT_EPRXEN_MASK (0x8U) -#define USB_ENDPT_EPRXEN_SHIFT (3U) -#define USB_ENDPT_EPRXEN(x) (((uint8_t)(((uint8_t)(x)) << USB_ENDPT_EPRXEN_SHIFT)) & USB_ENDPT_EPRXEN_MASK) - -#define USB_ENDPT_EPCTLDIS_MASK (0x10U) -#define USB_ENDPT_EPCTLDIS_SHIFT (4U) -#define USB_ENDPT_EPCTLDIS(x) (((uint8_t)(((uint8_t)(x)) << USB_ENDPT_EPCTLDIS_SHIFT)) & USB_ENDPT_EPCTLDIS_MASK) -/*! @} */ - -/* The count of USB_ENDPT */ -#define USB_ENDPT_COUNT (16U) - -/*! @name USBCTRL - USB Control register */ -/*! @{ */ - -#define USB_USBCTRL_PDE_MASK (0x40U) -#define USB_USBCTRL_PDE_SHIFT (6U) -/*! PDE - * 0b0..Weak pulldowns are disabled on D+ and D-. - * 0b1..Weak pulldowns are enabled on D+ and D-. - */ -#define USB_USBCTRL_PDE(x) (((uint8_t)(((uint8_t)(x)) << USB_USBCTRL_PDE_SHIFT)) & USB_USBCTRL_PDE_MASK) - -#define USB_USBCTRL_SUSP_MASK (0x80U) -#define USB_USBCTRL_SUSP_SHIFT (7U) -/*! SUSP - * 0b0..USB transceiver is not in suspend state. - * 0b1..USB transceiver is in suspend state. - */ -#define USB_USBCTRL_SUSP(x) (((uint8_t)(((uint8_t)(x)) << USB_USBCTRL_SUSP_SHIFT)) & USB_USBCTRL_SUSP_MASK) -/*! @} */ - -/*! @name OBSERVE - USB OTG Observe register */ -/*! @{ */ - -#define USB_OBSERVE_DMPD_MASK (0x10U) -#define USB_OBSERVE_DMPD_SHIFT (4U) -/*! DMPD - * 0b0..D- pulldown disabled. - * 0b1..D- pulldown enabled. - */ -#define USB_OBSERVE_DMPD(x) (((uint8_t)(((uint8_t)(x)) << USB_OBSERVE_DMPD_SHIFT)) & USB_OBSERVE_DMPD_MASK) - -#define USB_OBSERVE_DPPD_MASK (0x40U) -#define USB_OBSERVE_DPPD_SHIFT (6U) -/*! DPPD - * 0b0..D+ pulldown disabled. - * 0b1..D+ pulldown enabled. - */ -#define USB_OBSERVE_DPPD(x) (((uint8_t)(((uint8_t)(x)) << USB_OBSERVE_DPPD_SHIFT)) & USB_OBSERVE_DPPD_MASK) - -#define USB_OBSERVE_DPPU_MASK (0x80U) -#define USB_OBSERVE_DPPU_SHIFT (7U) -/*! DPPU - * 0b0..D+ pullup disabled. - * 0b1..D+ pullup enabled. - */ -#define USB_OBSERVE_DPPU(x) (((uint8_t)(((uint8_t)(x)) << USB_OBSERVE_DPPU_SHIFT)) & USB_OBSERVE_DPPU_MASK) -/*! @} */ - -/*! @name CONTROL - USB OTG Control register */ -/*! @{ */ - -#define USB_CONTROL_DPPULLUPNONOTG_MASK (0x10U) -#define USB_CONTROL_DPPULLUPNONOTG_SHIFT (4U) -/*! DPPULLUPNONOTG - * 0b0..DP Pullup in non-OTG device mode is not enabled. - * 0b1..DP Pullup in non-OTG device mode is enabled. - */ -#define USB_CONTROL_DPPULLUPNONOTG(x) (((uint8_t)(((uint8_t)(x)) << USB_CONTROL_DPPULLUPNONOTG_SHIFT)) & USB_CONTROL_DPPULLUPNONOTG_MASK) -/*! @} */ - -/*! @name USBTRC0 - USB Transceiver Control register 0 */ -/*! @{ */ - -#define USB_USBTRC0_USB_RESUME_INT_MASK (0x1U) -#define USB_USBTRC0_USB_RESUME_INT_SHIFT (0U) -/*! USB_RESUME_INT - USB Asynchronous Interrupt - * 0b0..No interrupt was generated. - * 0b1..Interrupt was generated because of the USB asynchronous interrupt. - */ -#define USB_USBTRC0_USB_RESUME_INT(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_USB_RESUME_INT_SHIFT)) & USB_USBTRC0_USB_RESUME_INT_MASK) - -#define USB_USBTRC0_SYNC_DET_MASK (0x2U) -#define USB_USBTRC0_SYNC_DET_SHIFT (1U) -/*! SYNC_DET - Synchronous USB Interrupt Detect - * 0b0..Synchronous interrupt has not been detected. - * 0b1..Synchronous interrupt has been detected. - */ -#define USB_USBTRC0_SYNC_DET(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_SYNC_DET_SHIFT)) & USB_USBTRC0_SYNC_DET_MASK) - -#define USB_USBTRC0_USB_CLK_RECOVERY_INT_MASK (0x4U) -#define USB_USBTRC0_USB_CLK_RECOVERY_INT_SHIFT (2U) -/*! USB_CLK_RECOVERY_INT - Combined USB Clock Recovery interrupt status */ -#define USB_USBTRC0_USB_CLK_RECOVERY_INT(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_USB_CLK_RECOVERY_INT_SHIFT)) & USB_USBTRC0_USB_CLK_RECOVERY_INT_MASK) - -#define USB_USBTRC0_USBRESMEN_MASK (0x20U) -#define USB_USBTRC0_USBRESMEN_SHIFT (5U) -/*! USBRESMEN - Asynchronous Resume Interrupt Enable - * 0b0..USB asynchronous wakeup from suspend mode disabled. - * 0b1..USB asynchronous wakeup from suspend mode enabled. The asynchronous resume interrupt differs from the - * synchronous resume interrupt in that it asynchronously detects K-state using the unfiltered state of the D+ - * and D- pins. This interrupt should only be enabled when the Transceiver is suspended. - */ -#define USB_USBTRC0_USBRESMEN(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_USBRESMEN_SHIFT)) & USB_USBTRC0_USBRESMEN_MASK) - -#define USB_USBTRC0_USBRESET_MASK (0x80U) -#define USB_USBTRC0_USBRESET_SHIFT (7U) -/*! USBRESET - USB Reset - * 0b0..Normal USB module operation. - * 0b1..Returns the USB module to its reset state. - */ -#define USB_USBTRC0_USBRESET(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_USBRESET_SHIFT)) & USB_USBTRC0_USBRESET_MASK) -/*! @} */ - -/*! @name USBFRMADJUST - Frame Adjust Register */ -/*! @{ */ - -#define USB_USBFRMADJUST_ADJ_MASK (0xFFU) -#define USB_USBFRMADJUST_ADJ_SHIFT (0U) -/*! ADJ - Frame Adjustment */ -#define USB_USBFRMADJUST_ADJ(x) (((uint8_t)(((uint8_t)(x)) << USB_USBFRMADJUST_ADJ_SHIFT)) & USB_USBFRMADJUST_ADJ_MASK) -/*! @} */ - -/*! @name CLK_RECOVER_CTRL - USB Clock recovery control */ -/*! @{ */ - -#define USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN_MASK (0x20U) -#define USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN_SHIFT (5U) -/*! RESTART_IFRTRIM_EN - Restart from IFR trim value - * 0b0..Trim fine adjustment always works based on the previous updated trim fine value (default) - * 0b1..Trim fine restarts from the IFR trim value whenever bus_reset/bus_resume is detected or module enable is desasserted - */ -#define USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN_SHIFT)) & USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN_MASK) - -#define USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN_MASK (0x40U) -#define USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN_SHIFT (6U) -/*! RESET_RESUME_ROUGH_EN - Reset/resume to rough phase enable - * 0b0..Always works in tracking phase after the first time rough to track transition (default) - * 0b1..Go back to rough stage whenever bus reset or bus resume occurs - */ -#define USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN_SHIFT)) & USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN_MASK) - -#define USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN_MASK (0x80U) -#define USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN_SHIFT (7U) -/*! CLOCK_RECOVER_EN - Crystal-less USB enable - * 0b0..Disable clock recovery block (default) - * 0b1..Enable clock recovery block - */ -#define USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN_SHIFT)) & USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN_MASK) -/*! @} */ - -/*! @name CLK_RECOVER_IRC_EN - IRC48M oscillator enable register */ -/*! @{ */ - -#define USB_CLK_RECOVER_IRC_EN_IRC_EN_MASK (0x2U) -#define USB_CLK_RECOVER_IRC_EN_IRC_EN_SHIFT (1U) -/*! IRC_EN - IRC48M enable - * 0b0..Disable the IRC48M module (default) - * 0b1..Enable the IRC48M module - */ -#define USB_CLK_RECOVER_IRC_EN_IRC_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_IRC_EN_IRC_EN_SHIFT)) & USB_CLK_RECOVER_IRC_EN_IRC_EN_MASK) -/*! @} */ - -/*! @name CLK_RECOVER_INT_EN - Clock recovery combined interrupt enable */ -/*! @{ */ - -#define USB_CLK_RECOVER_INT_EN_OVF_ERROR_EN_MASK (0x10U) -#define USB_CLK_RECOVER_INT_EN_OVF_ERROR_EN_SHIFT (4U) -/*! OVF_ERROR_EN - * 0b0..The interrupt will be masked - * 0b1..The interrupt will be enabled (default) - */ -#define USB_CLK_RECOVER_INT_EN_OVF_ERROR_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_INT_EN_OVF_ERROR_EN_SHIFT)) & USB_CLK_RECOVER_INT_EN_OVF_ERROR_EN_MASK) -/*! @} */ - -/*! @name CLK_RECOVER_INT_STATUS - Clock recovery separated interrupt status */ -/*! @{ */ - -#define USB_CLK_RECOVER_INT_STATUS_OVF_ERROR_MASK (0x10U) -#define USB_CLK_RECOVER_INT_STATUS_OVF_ERROR_SHIFT (4U) -/*! OVF_ERROR - * 0b0..No interrupt is reported - * 0b1..Unmasked interrupt has been generated - */ -#define USB_CLK_RECOVER_INT_STATUS_OVF_ERROR(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_INT_STATUS_OVF_ERROR_SHIFT)) & USB_CLK_RECOVER_INT_STATUS_OVF_ERROR_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group USB_Register_Masks */ - - -/* USB - Peripheral instance base addresses */ -/** Peripheral USB0 base address */ -#define USB0_BASE (0x40072000u) -/** Peripheral USB0 base pointer */ -#define USB0 ((USB_Type *)USB0_BASE) -/** Array initializer of USB peripheral base addresses */ -#define USB_BASE_ADDRS { USB0_BASE } -/** Array initializer of USB peripheral base pointers */ -#define USB_BASE_PTRS { USB0 } -/** Interrupt vectors for the USB peripheral type */ -#define USB_IRQS { USB0_IRQn } - -/*! - * @} - */ /* end of group USB_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- VREF Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup VREF_Peripheral_Access_Layer VREF Peripheral Access Layer - * @{ - */ - -/** VREF - Register Layout Typedef */ -typedef struct { - __IO uint8_t TRM; /**< VREF Trim Register, offset: 0x0 */ - __IO uint8_t SC; /**< VREF Status and Control Register, offset: 0x1 */ -} VREF_Type; - -/* ---------------------------------------------------------------------------- - -- VREF Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup VREF_Register_Masks VREF Register Masks - * @{ - */ - -/*! @name TRM - VREF Trim Register */ -/*! @{ */ - -#define VREF_TRM_TRIM_MASK (0x3FU) -#define VREF_TRM_TRIM_SHIFT (0U) -/*! TRIM - Trim bits - * 0b000000..Min - * 0b111111..Max - */ -#define VREF_TRM_TRIM(x) (((uint8_t)(((uint8_t)(x)) << VREF_TRM_TRIM_SHIFT)) & VREF_TRM_TRIM_MASK) - -#define VREF_TRM_CHOPEN_MASK (0x40U) -#define VREF_TRM_CHOPEN_SHIFT (6U) -/*! CHOPEN - Chop oscillator enable. When set, internal chopping operation is enabled and the - * internal analog offset will be minimized. - * 0b0..Chop oscillator is disabled. - * 0b1..Chop oscillator is enabled. - */ -#define VREF_TRM_CHOPEN(x) (((uint8_t)(((uint8_t)(x)) << VREF_TRM_CHOPEN_SHIFT)) & VREF_TRM_CHOPEN_MASK) -/*! @} */ - -/*! @name SC - VREF Status and Control Register */ -/*! @{ */ - -#define VREF_SC_MODE_LV_MASK (0x3U) -#define VREF_SC_MODE_LV_SHIFT (0U) -/*! MODE_LV - Buffer Mode selection - * 0b00..Bandgap on only, for stabilization and startup - * 0b01..High power buffer mode enabled - * 0b10..Low-power buffer mode enabled - * 0b11..Reserved - */ -#define VREF_SC_MODE_LV(x) (((uint8_t)(((uint8_t)(x)) << VREF_SC_MODE_LV_SHIFT)) & VREF_SC_MODE_LV_MASK) - -#define VREF_SC_VREFST_MASK (0x4U) -#define VREF_SC_VREFST_SHIFT (2U) -/*! VREFST - Internal Voltage Reference stable - * 0b0..The module is disabled or not stable. - * 0b1..The module is stable. - */ -#define VREF_SC_VREFST(x) (((uint8_t)(((uint8_t)(x)) << VREF_SC_VREFST_SHIFT)) & VREF_SC_VREFST_MASK) - -#define VREF_SC_ICOMPEN_MASK (0x20U) -#define VREF_SC_ICOMPEN_SHIFT (5U) -/*! ICOMPEN - Second order curvature compensation enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define VREF_SC_ICOMPEN(x) (((uint8_t)(((uint8_t)(x)) << VREF_SC_ICOMPEN_SHIFT)) & VREF_SC_ICOMPEN_MASK) - -#define VREF_SC_REGEN_MASK (0x40U) -#define VREF_SC_REGEN_SHIFT (6U) -/*! REGEN - Regulator enable - * 0b0..Internal 1.75 V regulator is disabled. - * 0b1..Internal 1.75 V regulator is enabled. - */ -#define VREF_SC_REGEN(x) (((uint8_t)(((uint8_t)(x)) << VREF_SC_REGEN_SHIFT)) & VREF_SC_REGEN_MASK) - -#define VREF_SC_VREFEN_MASK (0x80U) -#define VREF_SC_VREFEN_SHIFT (7U) -/*! VREFEN - Internal Voltage Reference enable - * 0b0..The module is disabled. - * 0b1..The module is enabled. - */ -#define VREF_SC_VREFEN(x) (((uint8_t)(((uint8_t)(x)) << VREF_SC_VREFEN_SHIFT)) & VREF_SC_VREFEN_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group VREF_Register_Masks */ - - -/* VREF - Peripheral instance base addresses */ -/** Peripheral VREF base address */ -#define VREF_BASE (0x40074000u) -/** Peripheral VREF base pointer */ -#define VREF ((VREF_Type *)VREF_BASE) -/** Array initializer of VREF peripheral base addresses */ -#define VREF_BASE_ADDRS { VREF_BASE } -/** Array initializer of VREF peripheral base pointers */ -#define VREF_BASE_PTRS { VREF } - -/*! - * @} - */ /* end of group VREF_Peripheral_Access_Layer */ - - -/* -** End of section using anonymous unions -*/ - -#if defined(__ARMCC_VERSION) - #if (__ARMCC_VERSION >= 6010050) - #pragma clang diagnostic pop - #else - #pragma pop - #endif -#elif defined(__CWCC__) - #pragma pop -#elif defined(__GNUC__) - /* leave anonymous unions enabled */ -#elif defined(__IAR_SYSTEMS_ICC__) - #pragma language=default -#else - #error Not supported compiler type -#endif - -/*! - * @} - */ /* end of group Peripheral_access_layer */ - - -/* ---------------------------------------------------------------------------- - -- Macros for use with bit field definitions (xxx_SHIFT, xxx_MASK). - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup Bit_Field_Generic_Macros Macros for use with bit field definitions (xxx_SHIFT, xxx_MASK). - * @{ - */ - -#if defined(__ARMCC_VERSION) - #if (__ARMCC_VERSION >= 6010050) - #pragma clang system_header - #endif -#elif defined(__IAR_SYSTEMS_ICC__) - #pragma system_include -#endif - -/** - * @brief Mask and left-shift a bit field value for use in a register bit range. - * @param field Name of the register bit field. - * @param value Value of the bit field. - * @return Masked and shifted value. - */ -#define NXP_VAL2FLD(field, value) (((value) << (field ## _SHIFT)) & (field ## _MASK)) -/** - * @brief Mask and right-shift a register value to extract a bit field value. - * @param field Name of the register bit field. - * @param value Value of the register. - * @return Masked and shifted bit field value. - */ -#define NXP_FLD2VAL(field, value) (((value) & (field ## _MASK)) >> (field ## _SHIFT)) - -/*! - * @} - */ /* end of group Bit_Field_Generic_Macros */ - - -/* ---------------------------------------------------------------------------- - -- SDK Compatibility - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SDK_Compatibility_Symbols SDK Compatibility - * @{ - */ - -#define I2C_S1_RXAK_MASK I2C_S_RXAK_MASK -#define I2C_S1_RXAK_SHIFT I2C_S_RXAK_SHIFT -#define I2C_S1_IICIF_MASK I2C_S_IICIF_MASK -#define I2C_S1_IICIF_SHIFT I2C_S_IICIF_SHIFTFT -#define I2C_S1_SRW_MASK I2C_S_SRW_MASK -#define I2C_S1_SRW_SHIFT I2C_S_SRW_SHIFT -#define I2C_S1_RAM_MASK I2C_S_RAM_MASK -#define I2C_S1_RAM_SHIFT I2C_S_RAM_SHIFT -#define I2C_S1_ARBL_MASK I2C_S_ARBL_MASK -#define I2C_S1_ARBL_SHIFT I2C_S_ARBL_SHIFT -#define I2C_S1_BUSY_MASK I2C_S_BUSY_MASK -#define I2C_S1_BUSY_SHIFT I2C_S_BUSY_SHIFT -#define I2C_S1_IAAS_MASK I2C_S_IAAS_MASK -#define I2C_S1_IAAS_SHIFT I2C_S_IAAS_SHIFT -#define I2C_S1_TCF_MASK I2C_S_TCF_MASK -#define I2C_S1_TCF_SHIFT I2C_S_TCF_SHIFT -#define I2C_S1_REG(base) I2C_S_REG(base) -#define I2C0_S1 I2C0_S -#define I2C1_S1 I2C1_S -#define PTA_BASE GPIOA_BASE -#define PTB_BASE GPIOB_BASE -#define PTC_BASE GPIOC_BASE -#define PTD_BASE GPIOD_BASE -#define PTE_BASE GPIOE_BASE -#define PTA GPIOA -#define PTB GPIOB -#define PTC GPIOC -#define PTD GPIOD -#define PTE GPIOE -#define UART0_FLEXIO_IRQn UART2_FLEXIO_IRQn -#define UART0_FLEXIO_IRQHandler UART2_FLEXIO_IRQHandler -#define SIM_SOPT5_UART0ODE_MASK SIM_SOPT5_UART2ODE_MASK -#define SIM_SOPT5_UART0ODE_SHIFT SIM_SOPT5_UART2ODE_SHIFT -#define SIM_SCGC4_UART0_MASK SIM_SCGC4_UART2_MASK -#define SIM_SCGC4_UART0_SHIFT SIM_SCGC4_UART2_SHIFT -#define UART0_BASE UART2_BASE -#define UART0_BDH UART2_BDH -#define UART0_BDL UART2_BDL -#define UART0_C1 UART2_C1 -#define UART0_C2 UART2_C2 -#define UART0_S1 UART2_S1 -#define UART0_S2 UART2_S2 -#define UART0_C3 UART2_C3 -#define UART0_D UART2_D -#define UART0_MA1 UART2_MA1 -#define UART0_MA2 UART2_MA2 -#define UART0_C4 UART2_C4 -#define UART0_C5 UART2_C5 -#define UART0_ED UART2_ED -#define UART0_MODEM UART2_MODEM -#define UART0_IR UART2_IR -#define UART0_PFIFO UART2_PFIFO -#define UART0_CFIFO UART2_CFIFO -#define UART0_SFIFO UART2_SFIFO -#define UART0_TWFIFO UART2_TWFIFO -#define UART0_TCFIFO UART2_TCFIFO -#define UART0_RWFIFO UART2_RWFIFO -#define UART0_RCFIFO UART2_RCFIFO -#define UART0_C7816 UART2_C7816 -#define UART0_IE7816 UART2_IE7816 -#define UART0_IS7816 UART2_IS7816 -#define UART0_WP7816 UART2_WP7816 -#define UART0_WN7816 UART2_WN7816 -#define UART0_WF7816 UART2_WF7816 -#define UART0_ET7816 UART2_ET7816 -#define UART0_TL7816 UART2_TL7816 -#define UART0_AP7816A_T0 UART2_AP7816A_T0 -#define UART0_AP7816B_T0 UART2_AP7816B_T0 -#define UART0_WP7816A_T0 UART2_WP7816A_T0 -#define UART0_WP7816A_T1 UART2_WP7816A_T1 -#define UART0_WP7816B_T0 UART2_WP7816B_T0 -#define UART0_WP7816B_T1 UART2_WP7816B_T1 -#define UART0_WGP7816_T1 UART2_WGP7816_T1 -#define UART0_WP7816C_T1 UART2_WP7816C_T1 -#define I2S0_MDR This_symb_has_been_deprecated -#define I2S_MDR_DIVIDE_MASK This_symb_has_been_deprecated -#define I2S_MDR_DIVIDE_SHIFT This_symb_has_been_deprecated -#define I2S_MDR_DIVIDE(x) This_symb_has_been_deprecated -#define I2S_MDR_FRACT_MASK This_symb_has_been_deprecated -#define I2S_MDR_FRACT_SHIFT This_symb_has_been_deprecated -#define I2S_MDR_FRACT(x) This_symb_has_been_deprecated -#define I2S_MDR_REG(base) This_symb_has_been_deprecated -#define CTL0 OTGCTL -#define USB0_CTL0 USB0_OTGCTL -#define USB_CTL0_REG(base) USB_OTGCTL_REG(base) -#define USB_CTL0_DPHIGH_MASK USB_OTGCTL_DPHIGH_MASK -#define USB_CTL0_DPHIGH_SHIFT USB_OTGCTL_DPHIGH_SHIFT -#define CTL1 CTL -#define USB0_CTL1 USB0_CTL -#define USB_CTL1_REG(base) USB_CTL_REG(base) -#define USB_CTL1_USBEN_MASK USB_CTL_USBEN_MASK -#define USB_CTL1_USBEN_SHIFT USB_CTL_USBEN_SHIFT -#define USB_CTL1_ODDRST_MASK USB_CTL_ODDRST_MASK -#define USB_CTL1_ODDRST_SHIFT USB_CTL_ODDRST_SHIFT -#define USB_CTL1_TXSUSPENDTOKENBUSY_MASK USB_CTL_TXSUSPENDTOKENBUSY_MASK -#define USB_CTL1_TXSUSPENDTOKENBUSY_SHIFT USB_CTL_TXSUSPENDTOKENBUSY_SHIFT -#define USB_CTL1_SE0_MASK USB_CTL_SE0_MASK -#define USB_CTL1_SE0_SHIFT USB_CTL_SE0_SHIFT -#define USB_CTL1_JSTATE_MASK USB_CTL_JSTATE_MASK -#define USB_CTL1_JSTATE_SHIFT USB_CTL_JSTATE_SHIFT -#define USB_CTL_USBEN_MASK USB_CTL_USBENSOFEN_MASK -#define USB_CTL_USBEN_SHIFT USB_CTL_USBENSOFEN_SHIFT - -/*! - * @} - */ /* end of group SDK_Compatibility_Symbols */ - - -#endif /* MCXC444_H_ */ - diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/MCXC444_features.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/MCXC444_features.h deleted file mode 100644 index e5aa684302a..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/MCXC444_features.h +++ /dev/null @@ -1,1455 +0,0 @@ -/* -** ################################################################### -** Version: rev. 1.0, 2024-03-11 -** Build: b240411 -** -** Abstract: -** Chip specific module features. -** -** Copyright 2016 Freescale Semiconductor, Inc. -** Copyright 2016-2024 NXP -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** Revisions: -** - rev. 1.0 (2024-03-11) -** Initial version. -** -** ################################################################### -*/ - -#ifndef _MCXC444_FEATURES_H_ -#define _MCXC444_FEATURES_H_ - -/* SOC module features */ - -/* @brief ADC16 availability on the SoC. */ -#define FSL_FEATURE_SOC_ADC16_COUNT (1) -/* @brief CMP availability on the SoC. */ -#define FSL_FEATURE_SOC_CMP_COUNT (1) -/* @brief DAC availability on the SoC. */ -#define FSL_FEATURE_SOC_DAC_COUNT (1) -/* @brief DMA availability on the SoC. */ -#define FSL_FEATURE_SOC_DMA_COUNT (1) -/* @brief DMAMUX availability on the SoC. */ -#define FSL_FEATURE_SOC_DMAMUX_COUNT (1) -/* @brief FGPIO availability on the SoC. */ -#define FSL_FEATURE_SOC_FGPIO_COUNT (5) -/* @brief FLEXIO availability on the SoC. */ -#define FSL_FEATURE_SOC_FLEXIO_COUNT (1) -/* @brief FTFA availability on the SoC. */ -#define FSL_FEATURE_SOC_FTFA_COUNT (1) -/* @brief GPIO availability on the SoC. */ -#define FSL_FEATURE_SOC_GPIO_COUNT (5) -/* @brief I2C availability on the SoC. */ -#define FSL_FEATURE_SOC_I2C_COUNT (2) -/* @brief I2S availability on the SoC. */ -#define FSL_FEATURE_SOC_I2S_COUNT (1) -/* @brief SLCD availability on the SoC. */ -#define FSL_FEATURE_SOC_SLCD_COUNT (1) -/* @brief LLWU availability on the SoC. */ -#define FSL_FEATURE_SOC_LLWU_COUNT (1) -/* @brief LPTMR availability on the SoC. */ -#define FSL_FEATURE_SOC_LPTMR_COUNT (1) -/* @brief LPUART availability on the SoC. */ -#define FSL_FEATURE_SOC_LPUART_COUNT (2) -/* @brief MCGLITE availability on the SoC. */ -#define FSL_FEATURE_SOC_MCGLITE_COUNT (1) -/* @brief MCM availability on the SoC. */ -#define FSL_FEATURE_SOC_MCM_COUNT (1) -/* @brief MTB availability on the SoC. */ -#define FSL_FEATURE_SOC_MTB_COUNT (1) -/* @brief MTBDWT availability on the SoC. */ -#define FSL_FEATURE_SOC_MTBDWT_COUNT (1) -/* @brief OSC availability on the SoC. */ -#define FSL_FEATURE_SOC_OSC_COUNT (1) -/* @brief PIT availability on the SoC. */ -#define FSL_FEATURE_SOC_PIT_COUNT (1) -/* @brief PMC availability on the SoC. */ -#define FSL_FEATURE_SOC_PMC_COUNT (1) -/* @brief PORT availability on the SoC. */ -#define FSL_FEATURE_SOC_PORT_COUNT (5) -/* @brief RCM availability on the SoC. */ -#define FSL_FEATURE_SOC_RCM_COUNT (1) -/* @brief RFSYS availability on the SoC. */ -#define FSL_FEATURE_SOC_RFSYS_COUNT (1) -/* @brief ROM availability on the SoC. */ -#define FSL_FEATURE_SOC_ROM_COUNT (1) -/* @brief RTC availability on the SoC. */ -#define FSL_FEATURE_SOC_RTC_COUNT (1) -/* @brief SIM availability on the SoC. */ -#define FSL_FEATURE_SOC_SIM_COUNT (1) -/* @brief SMC availability on the SoC. */ -#define FSL_FEATURE_SOC_SMC_COUNT (1) -/* @brief SPI availability on the SoC. */ -#define FSL_FEATURE_SOC_SPI_COUNT (2) -/* @brief TPM availability on the SoC. */ -#define FSL_FEATURE_SOC_TPM_COUNT (3) -/* @brief UART availability on the SoC. */ -#define FSL_FEATURE_SOC_UART_COUNT (1) -/* @brief USB availability on the SoC. */ -#define FSL_FEATURE_SOC_USB_COUNT (1) -/* @brief VREF availability on the SoC. */ -#define FSL_FEATURE_SOC_VREF_COUNT (1) - -/* ADC16 module features */ - -/* @brief Has Programmable Gain Amplifier (PGA) in ADC (register PGA). */ -#define FSL_FEATURE_ADC16_HAS_PGA (0) -/* @brief Has PGA chopping control in ADC (bit PGA[PGACHPb] or PGA[PGACHP]). */ -#define FSL_FEATURE_ADC16_HAS_PGA_CHOPPING (0) -/* @brief Has PGA offset measurement mode in ADC (bit PGA[PGAOFSM]). */ -#define FSL_FEATURE_ADC16_HAS_PGA_OFFSET_MEASUREMENT (0) -/* @brief Has DMA support (bit SC2[DMAEN] or SC4[DMAEN]). */ -#define FSL_FEATURE_ADC16_HAS_DMA (1) -/* @brief Has differential mode (bitfield SC1x[DIFF]). */ -#define FSL_FEATURE_ADC16_HAS_DIFF_MODE (1) -/* @brief Has FIFO (bit SC4[AFDEP]). */ -#define FSL_FEATURE_ADC16_HAS_FIFO (0) -/* @brief FIFO size if available (bitfield SC4[AFDEP]). */ -#define FSL_FEATURE_ADC16_FIFO_SIZE (0) -/* @brief Has channel set a/b multiplexor (bitfield CFG2[MUXSEL]). */ -#define FSL_FEATURE_ADC16_HAS_MUX_SELECT (1) -/* @brief Has HW trigger masking (bitfield SC5[HTRGMASKE]. */ -#define FSL_FEATURE_ADC16_HAS_HW_TRIGGER_MASK (0) -/* @brief Has calibration feature (bit SC3[CAL] and registers CLPx, CLMx). */ -#define FSL_FEATURE_ADC16_HAS_CALIBRATION (1) -/* @brief Has HW averaging (bit SC3[AVGE]). */ -#define FSL_FEATURE_ADC16_HAS_HW_AVERAGE (1) -/* @brief Has offset correction (register OFS). */ -#define FSL_FEATURE_ADC16_HAS_OFFSET_CORRECTION (1) -/* @brief Maximum ADC resolution. */ -#define FSL_FEATURE_ADC16_MAX_RESOLUTION (16) -/* @brief Number of SC1x and Rx register pairs (conversion control and result registers). */ -#define FSL_FEATURE_ADC16_CONVERSION_CONTROL_COUNT (2) - -/* CMP module features */ - -/* @brief Has Trigger mode in CMP (register bit field CR1[TRIGM]). */ -#define FSL_FEATURE_CMP_HAS_TRIGGER_MODE (1) -/* @brief Has Window mode in CMP (register bit field CR1[WE]). */ -#define FSL_FEATURE_CMP_HAS_WINDOW_MODE (0) -/* @brief Has External sample supported in CMP (register bit field CR1[SE]). */ -#define FSL_FEATURE_CMP_HAS_EXTERNAL_SAMPLE_SUPPORT (0) -/* @brief Has DMA support in CMP (register bit field SCR[DMAEN]). */ -#define FSL_FEATURE_CMP_HAS_DMA (1) -/* @brief Has Pass Through mode in CMP (register bit field MUXCR[PSTM]). */ -#define FSL_FEATURE_CMP_HAS_PASS_THROUGH_MODE (0) -/* @brief Has DAC Test function in CMP (register DACTEST). */ -#define FSL_FEATURE_CMP_HAS_DAC_TEST (0) - -/* COP module features */ - -/* @brief Has the COP Debug Enable bit (COPC[COPDBGEN]) */ -#define FSL_FEATURE_COP_HAS_DEBUG_ENABLE (1) -/* @brief Has the COP Stop mode Enable bit (COPC[COPSTPEN]) */ -#define FSL_FEATURE_COP_HAS_STOP_ENABLE (1) -/* @brief Has more clock sources like MCGIRC */ -#define FSL_FEATURE_COP_HAS_MORE_CLKSRC (1) -/* @brief Has the timeout long and short mode bit (COPC[COPCLKS]) */ -#define FSL_FEATURE_COP_HAS_LONGTIME_MODE (1) - -/* DAC module features */ - -/* @brief Define the size of hardware buffer */ -#define FSL_FEATURE_DAC_BUFFER_SIZE (2) -/* @brief Define whether the buffer supports watermark event detection or not. */ -#define FSL_FEATURE_DAC_HAS_WATERMARK_DETECTION (0) -/* @brief Define whether the buffer supports watermark selection detection or not. */ -#define FSL_FEATURE_DAC_HAS_WATERMARK_SELECTION (0) -/* @brief Define whether the buffer supports watermark event 1 word before buffer upper limit. */ -#define FSL_FEATURE_DAC_HAS_WATERMARK_1_WORD (0) -/* @brief Define whether the buffer supports watermark event 2 words before buffer upper limit. */ -#define FSL_FEATURE_DAC_HAS_WATERMARK_2_WORDS (0) -/* @brief Define whether the buffer supports watermark event 3 words before buffer upper limit. */ -#define FSL_FEATURE_DAC_HAS_WATERMARK_3_WORDS (0) -/* @brief Define whether the buffer supports watermark event 4 words before buffer upper limit. */ -#define FSL_FEATURE_DAC_HAS_WATERMARK_4_WORDS (0) -/* @brief Define whether FIFO buffer mode is available or not. */ -#define FSL_FEATURE_DAC_HAS_BUFFER_FIFO_MODE (1) -/* @brief Define whether swing buffer mode is available or not.. */ -#define FSL_FEATURE_DAC_HAS_BUFFER_SWING_MODE (0) - -/* DMA module features */ - -/* @brief Number of DMA channels. */ -#define FSL_FEATURE_DMA_MODULE_CHANNEL (4) -/* @brief Total number of DMA channels on all modules. */ -#define FSL_FEATURE_DMA_DMAMUX_CHANNELS (4) - -/* DMAMUX module features */ - -/* @brief Number of DMA channels (related to number of register CHCFGn). */ -#define FSL_FEATURE_DMAMUX_MODULE_CHANNEL (4) -/* @brief Total number of DMA channels on all modules. */ -#define FSL_FEATURE_DMAMUX_DMAMUX_CHANNELS (4) -/* @brief Has the periodic trigger capability for the triggered DMA channel (register bit CHCFG0[TRIG]). */ -#define FSL_FEATURE_DMAMUX_HAS_TRIG (1) -/* @brief Register CHCFGn width. */ -#define FSL_FEATURE_DMAMUX_CHCFG_REGISTER_WIDTH (8) - -/* FGPIO module features */ - -/* No feature definitions */ - -/* FLEXIO module features */ - -/* @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 (0) -/* @brief Has Shifter Buffer N Nibble Byte Swapped Register (FLEXIO_SHIFTBUFNBSn) */ -#define FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_BYTE_SWAP (0) -/* @brief Has Shifter Buffer N Half Word Swapped Register (FLEXIO_SHIFTBUFHWSn) */ -#define FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_HALF_WORD_SWAP (0) -/* @brief Has Shifter Buffer N Nibble Swapped Register (FLEXIO_SHIFTBUFNISn) */ -#define FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_SWAP (0) -/* @brief Supports Shifter State Mode (FLEXIO_SHIFTCTLn[SMOD]) */ -#define FSL_FEATURE_FLEXIO_HAS_STATE_MODE (0) -/* @brief Supports Shifter Logic Mode (FLEXIO_SHIFTCTLn[SMOD]) */ -#define FSL_FEATURE_FLEXIO_HAS_LOGIC_MODE (0) -/* @brief Supports paralle width (FLEXIO_SHIFTCFGn[PWIDTH]) */ -#define FSL_FEATURE_FLEXIO_HAS_PARALLEL_WIDTH (0) -/* @brief Reset value of the FLEXIO_VERID register */ -#define FSL_FEATURE_FLEXIO_VERID_RESET_VALUE (0x1000000) -/* @brief Reset value of the FLEXIO_PARAM register */ -#define FSL_FEATURE_FLEXIO_PARAM_RESET_VALUE (0x10080404) -/* @brief Represent the bit width of the TIMDCE field (FLEXIO_TIMCFGLn[TIMDEC]) */ -#define FSL_FEATURE_FLEXIO_TIMCFG_TIMDCE_FIELD_WIDTH (2) -/* @brief Flexio DMA request base channel */ -#define FSL_FEATURE_FLEXIO_DMA_REQUEST_BASE_CHANNEL (0) - -/* FLASH module features */ - -/* @brief Is of type FTFA. */ -#define FSL_FEATURE_FLASH_IS_FTFA (1) -/* @brief Is of type FTFE. */ -#define FSL_FEATURE_FLASH_IS_FTFE (0) -/* @brief Is of type FTFL. */ -#define FSL_FEATURE_FLASH_IS_FTFL (0) -/* @brief Has flags indicating the status of the FlexRAM (register bits FCNFG[EEERDY], FCNFG[RAMRDY] and FCNFG[PFLSH]). */ -#define FSL_FEATURE_FLASH_HAS_FLEX_RAM_FLAGS (0) -/* @brief Has program flash swapping status flag (register bit FCNFG[SWAP]). */ -#define FSL_FEATURE_FLASH_HAS_PFLASH_SWAPPING_STATUS_FLAG (0) -/* @brief Has EEPROM region protection (register FEPROT). */ -#define FSL_FEATURE_FLASH_HAS_EEROM_REGION_PROTECTION (0) -/* @brief Has data flash region protection (register FDPROT). */ -#define FSL_FEATURE_FLASH_HAS_DATA_FLASH_REGION_PROTECTION (0) -/* @brief Has flash access control (registers XACCHn, SACCHn, where n is a number, FACSS and FACSN). */ -#define FSL_FEATURE_FLASH_HAS_ACCESS_CONTROL (0) -/* @brief Has flash cache control in FMC module. */ -#define FSL_FEATURE_FLASH_HAS_FMC_FLASH_CACHE_CONTROLS (0) -/* @brief Has flash cache control in MCM module. */ -#define FSL_FEATURE_FLASH_HAS_MCM_FLASH_CACHE_CONTROLS (1) -/* @brief Has flash cache control in MSCM module. */ -#define FSL_FEATURE_FLASH_HAS_MSCM_FLASH_CACHE_CONTROLS (0) -/* @brief Has prefetch speculation control in flash, such as kv5x. */ -#define FSL_FEATURE_FLASH_PREFETCH_SPECULATION_CONTROL_IN_FLASH (0) -/* @brief P-Flash flash size coding rule version, value 0 for K1 and K2, value 1 for K3. */ -#define FSL_FEATURE_FLASH_SIZE_ENCODING_RULE_VERSION (0) -/* @brief P-Flash start address. */ -#define FSL_FEATURE_FLASH_PFLASH_START_ADDRESS (0x00000000) -/* @brief P-Flash block count. */ -#define FSL_FEATURE_FLASH_PFLASH_BLOCK_COUNT (2) -/* @brief P-Flash block size. */ -#define FSL_FEATURE_FLASH_PFLASH_BLOCK_SIZE (131072) -/* @brief P-Flash sector size. */ -#define FSL_FEATURE_FLASH_PFLASH_BLOCK_SECTOR_SIZE (1024) -/* @brief P-Flash write unit size. */ -#define FSL_FEATURE_FLASH_PFLASH_BLOCK_WRITE_UNIT_SIZE (4) -/* @brief P-Flash data path width. */ -#define FSL_FEATURE_FLASH_PFLASH_BLOCK_DATA_PATH_WIDTH (4) -/* @brief P-Flash block swap feature. */ -#define FSL_FEATURE_FLASH_HAS_PFLASH_BLOCK_SWAP (0) -/* @brief P-Flash protection region count. */ -#define FSL_FEATURE_FLASH_PFLASH_PROTECTION_REGION_COUNT (32) -/* @brief Has FlexNVM memory. */ -#define FSL_FEATURE_FLASH_HAS_FLEX_NVM (0) -/* @brief Has FlexNVM alias. */ -#define FSL_FEATURE_FLASH_HAS_FLEX_NVM_ALIAS (0) -/* @brief FlexNVM start address. (Valid only if FlexNVM is available.) */ -#define FSL_FEATURE_FLASH_FLEX_NVM_START_ADDRESS (0x00000000) -/* @brief FlexNVM alias start address. (Valid only if FlexNVM alias is available.) */ -#define FSL_FEATURE_FLASH_FLEX_NVM_ALIAS_START_ADDRESS (0x00000000) -/* @brief FlexNVM block count. */ -#define FSL_FEATURE_FLASH_FLEX_NVM_BLOCK_COUNT (0) -/* @brief FlexNVM block size. */ -#define FSL_FEATURE_FLASH_FLEX_NVM_BLOCK_SIZE (0) -/* @brief FlexNVM sector size. */ -#define FSL_FEATURE_FLASH_FLEX_NVM_BLOCK_SECTOR_SIZE (0) -/* @brief FlexNVM write unit size. */ -#define FSL_FEATURE_FLASH_FLEX_NVM_BLOCK_WRITE_UNIT_SIZE (0) -/* @brief FlexNVM data path width. */ -#define FSL_FEATURE_FLASH_FLEX_BLOCK_DATA_PATH_WIDTH (0) -/* @brief Has FlexRAM memory. */ -#define FSL_FEATURE_FLASH_HAS_FLEX_RAM (0) -/* @brief FlexRAM start address. (Valid only if FlexRAM is available.) */ -#define FSL_FEATURE_FLASH_FLEX_RAM_START_ADDRESS (0x00000000) -/* @brief FlexRAM size. */ -#define FSL_FEATURE_FLASH_FLEX_RAM_SIZE (0) -/* @brief Has 0x00 Read 1s Block command. */ -#define FSL_FEATURE_FLASH_HAS_READ_1S_BLOCK_CMD (1) -/* @brief Has 0x01 Read 1s Section command. */ -#define FSL_FEATURE_FLASH_HAS_READ_1S_SECTION_CMD (1) -/* @brief Has 0x02 Program Check command. */ -#define FSL_FEATURE_FLASH_HAS_PROGRAM_CHECK_CMD (1) -/* @brief Has 0x03 Read Resource command. */ -#define FSL_FEATURE_FLASH_HAS_READ_RESOURCE_CMD (1) -/* @brief Has 0x06 Program Longword command. */ -#define FSL_FEATURE_FLASH_HAS_PROGRAM_LONGWORD_CMD (1) -/* @brief Has 0x07 Program Phrase command. */ -#define FSL_FEATURE_FLASH_HAS_PROGRAM_PHRASE_CMD (0) -/* @brief Has 0x08 Erase Flash Block command. */ -#define FSL_FEATURE_FLASH_HAS_ERASE_FLASH_BLOCK_CMD (1) -/* @brief Has 0x09 Erase Flash Sector command. */ -#define FSL_FEATURE_FLASH_HAS_ERASE_FLASH_SECTOR_CMD (1) -/* @brief Has 0x0B Program Section command. */ -#define FSL_FEATURE_FLASH_HAS_PROGRAM_SECTION_CMD (0) -/* @brief Has 0x40 Read 1s All Blocks command. */ -#define FSL_FEATURE_FLASH_HAS_READ_1S_ALL_BLOCKS_CMD (1) -/* @brief Has 0x41 Read Once command. */ -#define FSL_FEATURE_FLASH_HAS_READ_ONCE_CMD (1) -/* @brief Has 0x43 Program Once command. */ -#define FSL_FEATURE_FLASH_HAS_PROGRAM_ONCE_CMD (1) -/* @brief Has 0x44 Erase All Blocks command. */ -#define FSL_FEATURE_FLASH_HAS_ERASE_ALL_BLOCKS_CMD (1) -/* @brief Has 0x45 Verify Backdoor Access Key command. */ -#define FSL_FEATURE_FLASH_HAS_VERIFY_BACKDOOR_ACCESS_KEY_CMD (1) -/* @brief Has 0x46 Swap Control command. */ -#define FSL_FEATURE_FLASH_HAS_SWAP_CONTROL_CMD (0) -/* @brief Has 0x49 Erase All Blocks Unsecure command. */ -#define FSL_FEATURE_FLASH_HAS_ERASE_ALL_BLOCKS_UNSECURE_CMD (1) -/* @brief Has 0x4A Read 1s All Execute-only Segments command. */ -#define FSL_FEATURE_FLASH_HAS_READ_1S_ALL_EXECUTE_ONLY_SEGMENTS_CMD (0) -/* @brief Has 0x4B Erase All Execute-only Segments command. */ -#define FSL_FEATURE_FLASH_HAS_ERASE_ALL_EXECUTE_ONLY_SEGMENTS_CMD (0) -/* @brief Has 0x80 Program Partition command. */ -#define FSL_FEATURE_FLASH_HAS_PROGRAM_PARTITION_CMD (0) -/* @brief Has 0x81 Set FlexRAM Function command. */ -#define FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD (0) -/* @brief P-Flash Erase/Read 1st all block command address alignment. */ -#define FSL_FEATURE_FLASH_PFLASH_BLOCK_CMD_ADDRESS_ALIGMENT (4) -/* @brief P-Flash Erase sector command address alignment. */ -#define FSL_FEATURE_FLASH_PFLASH_SECTOR_CMD_ADDRESS_ALIGMENT (4) -/* @brief P-Flash Rrogram/Verify section command address alignment. */ -#define FSL_FEATURE_FLASH_PFLASH_SECTION_CMD_ADDRESS_ALIGMENT (4) -/* @brief P-Flash Read resource command address alignment. */ -#define FSL_FEATURE_FLASH_PFLASH_RESOURCE_CMD_ADDRESS_ALIGMENT (4) -/* @brief P-Flash Program check command address alignment. */ -#define FSL_FEATURE_FLASH_PFLASH_CHECK_CMD_ADDRESS_ALIGMENT (4) -/* @brief P-Flash Program check command address alignment. */ -#define FSL_FEATURE_FLASH_PFLASH_SWAP_CONTROL_CMD_ADDRESS_ALIGMENT (0) -/* @brief FlexNVM Erase/Read 1st all block command address alignment. */ -#define FSL_FEATURE_FLASH_FLEX_NVM_BLOCK_CMD_ADDRESS_ALIGMENT (0) -/* @brief FlexNVM Erase sector command address alignment. */ -#define FSL_FEATURE_FLASH_FLEX_NVM_SECTOR_CMD_ADDRESS_ALIGMENT (0) -/* @brief FlexNVM Rrogram/Verify section command address alignment. */ -#define FSL_FEATURE_FLASH_FLEX_NVM_SECTION_CMD_ADDRESS_ALIGMENT (0) -/* @brief FlexNVM Read resource command address alignment. */ -#define FSL_FEATURE_FLASH_FLEX_NVM_RESOURCE_CMD_ADDRESS_ALIGMENT (0) -/* @brief FlexNVM Program check command address alignment. */ -#define FSL_FEATURE_FLASH_FLEX_NVM_CHECK_CMD_ADDRESS_ALIGMENT (0) -/* @brief FlexNVM partition code 0000 mapping to data flash size in bytes (0xFFFFFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_0000 (0xFFFFFFFFU) -/* @brief FlexNVM partition code 0001 mapping to data flash size in bytes (0xFFFFFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_0001 (0xFFFFFFFFU) -/* @brief FlexNVM partition code 0010 mapping to data flash size in bytes (0xFFFFFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_0010 (0xFFFFFFFFU) -/* @brief FlexNVM partition code 0011 mapping to data flash size in bytes (0xFFFFFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_0011 (0xFFFFFFFFU) -/* @brief FlexNVM partition code 0100 mapping to data flash size in bytes (0xFFFFFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_0100 (0xFFFFFFFFU) -/* @brief FlexNVM partition code 0101 mapping to data flash size in bytes (0xFFFFFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_0101 (0xFFFFFFFFU) -/* @brief FlexNVM partition code 0110 mapping to data flash size in bytes (0xFFFFFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_0110 (0xFFFFFFFFU) -/* @brief FlexNVM partition code 0111 mapping to data flash size in bytes (0xFFFFFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_0111 (0xFFFFFFFFU) -/* @brief FlexNVM partition code 1000 mapping to data flash size in bytes (0xFFFFFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_1000 (0xFFFFFFFFU) -/* @brief FlexNVM partition code 1001 mapping to data flash size in bytes (0xFFFFFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_1001 (0xFFFFFFFFU) -/* @brief FlexNVM partition code 1010 mapping to data flash size in bytes (0xFFFFFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_1010 (0xFFFFFFFFU) -/* @brief FlexNVM partition code 1011 mapping to data flash size in bytes (0xFFFFFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_1011 (0xFFFFFFFFU) -/* @brief FlexNVM partition code 1100 mapping to data flash size in bytes (0xFFFFFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_1100 (0xFFFFFFFFU) -/* @brief FlexNVM partition code 1101 mapping to data flash size in bytes (0xFFFFFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_1101 (0xFFFFFFFFU) -/* @brief FlexNVM partition code 1110 mapping to data flash size in bytes (0xFFFFFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_1110 (0xFFFFFFFFU) -/* @brief FlexNVM partition code 1111 mapping to data flash size in bytes (0xFFFFFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_1111 (0xFFFFFFFFU) -/* @brief Emulated eeprom size code 0000 mapping to emulated eeprom size in bytes (0xFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_0000 (0xFFFF) -/* @brief Emulated eeprom size code 0001 mapping to emulated eeprom size in bytes (0xFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_0001 (0xFFFF) -/* @brief Emulated eeprom size code 0010 mapping to emulated eeprom size in bytes (0xFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_0010 (0xFFFF) -/* @brief Emulated eeprom size code 0011 mapping to emulated eeprom size in bytes (0xFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_0011 (0xFFFF) -/* @brief Emulated eeprom size code 0100 mapping to emulated eeprom size in bytes (0xFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_0100 (0xFFFF) -/* @brief Emulated eeprom size code 0101 mapping to emulated eeprom size in bytes (0xFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_0101 (0xFFFF) -/* @brief Emulated eeprom size code 0110 mapping to emulated eeprom size in bytes (0xFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_0110 (0xFFFF) -/* @brief Emulated eeprom size code 0111 mapping to emulated eeprom size in bytes (0xFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_0111 (0xFFFF) -/* @brief Emulated eeprom size code 1000 mapping to emulated eeprom size in bytes (0xFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_1000 (0xFFFF) -/* @brief Emulated eeprom size code 1001 mapping to emulated eeprom size in bytes (0xFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_1001 (0xFFFF) -/* @brief Emulated eeprom size code 1010 mapping to emulated eeprom size in bytes (0xFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_1010 (0xFFFF) -/* @brief Emulated eeprom size code 1011 mapping to emulated eeprom size in bytes (0xFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_1011 (0xFFFF) -/* @brief Emulated eeprom size code 1100 mapping to emulated eeprom size in bytes (0xFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_1100 (0xFFFF) -/* @brief Emulated eeprom size code 1101 mapping to emulated eeprom size in bytes (0xFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_1101 (0xFFFF) -/* @brief Emulated eeprom size code 1110 mapping to emulated eeprom size in bytes (0xFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_1110 (0xFFFF) -/* @brief Emulated eeprom size code 1111 mapping to emulated eeprom size in bytes (0xFFFF = reserved). */ -#define FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_1111 (0xFFFF) - -/* GPIO module features */ - -/* @brief Has GPIO attribute checker register (GACR). */ -#define FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER (0) - -/* I2C module features */ - -/* @brief Has System Management Bus support (registers SMB, A2, SLTL and SLTH). */ -#define FSL_FEATURE_I2C_HAS_SMBUS (1) -/* @brief Maximum supported baud rate in kilobit per second. */ -#define FSL_FEATURE_I2C_MAX_BAUD_KBPS (400) -/* @brief Is affected by errata with ID 6070 (repeat start cannot be generated if the F[MULT] bit field is set to a non-zero value). */ -#define FSL_FEATURE_I2C_HAS_ERRATA_6070 (0) -/* @brief Has DMA support (register bit C1[DMAEN]). */ -#define FSL_FEATURE_I2C_HAS_DMA_SUPPORT (1) -/* @brief Has I2C bus start and stop detection (register bits FLT[SSIE], FLT[STARTF] and FLT[STOPF]). */ -#define FSL_FEATURE_I2C_HAS_START_STOP_DETECT (1) -/* @brief Has I2C bus stop detection (register bits FLT[STOPIE] and FLT[STOPF]). */ -#define FSL_FEATURE_I2C_HAS_STOP_DETECT (0) -/* @brief Has I2C bus stop hold off (register bit FLT[SHEN]). */ -#define FSL_FEATURE_I2C_HAS_STOP_HOLD_OFF (1) -/* @brief Maximum width of the glitch filter in number of bus clocks. */ -#define FSL_FEATURE_I2C_MAX_GLITCH_FILTER_WIDTH (15) -/* @brief Has control of the drive capability of the I2C pins. */ -#define FSL_FEATURE_I2C_HAS_HIGH_DRIVE_SELECTION (1) -/* @brief Has double buffering support (register S2). */ -#define FSL_FEATURE_I2C_HAS_DOUBLE_BUFFERING (1) -/* @brief Has double buffer enable. */ -#define FSL_FEATURE_I2C_HAS_DOUBLE_BUFFER_ENABLE (0) - -/* SAI module features */ - -/* @brief SAI has FIFO in this soc (register bit fields TCR1[TFW]. */ -#define FSL_FEATURE_SAI_HAS_FIFO (0) -/* @brief Receive/transmit FIFO size in item count (register bit fields TCSR[FRDE], TCSR[FRIE], TCSR[FRF], TCR1[TFW], RCSR[FRDE], RCSR[FRIE], RCSR[FRF], RCR1[RFW], registers TFRn, RFRn). */ -#define FSL_FEATURE_SAI_FIFO_COUNTn(x) (0) -/* @brief Receive/transmit channel number (register bit fields TCR3[TCE], RCR3[RCE], registers TDRn and RDRn). */ -#define FSL_FEATURE_SAI_CHANNEL_COUNTn(x) (1) -/* @brief Maximum words per frame (register bit fields TCR3[WDFL], TCR4[FRSZ], TMR[TWM], RCR3[WDFL], RCR4[FRSZ], RMR[RWM]). */ -#define FSL_FEATURE_SAI_MAX_WORDS_PER_FRAME (2) -/* @brief Has support of combining multiple data channel FIFOs into single channel FIFO (register bit fields TCR3[CFR], TCR4[FCOMB], TFR0[WCP], TFR1[WCP], RCR3[CFR], RCR4[FCOMB], RFR0[RCP], RFR1[RCP]). */ -#define FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE (0) -/* @brief Has packing of 8-bit and 16-bit data into each 32-bit FIFO word (register bit fields TCR4[FPACK], RCR4[FPACK]). */ -#define FSL_FEATURE_SAI_HAS_FIFO_PACKING (1) -/* @brief Configures when the SAI will continue transmitting after a FIFO error has been detected (register bit fields TCR4[FCONT], RCR4[FCONT]). */ -#define FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR (1) -/* @brief Configures if the frame sync is generated internally, a frame sync is only generated when the FIFO warning flag is clear or continuously (register bit fields TCR4[ONDEM], RCR4[ONDEM]). */ -#define FSL_FEATURE_SAI_HAS_ON_DEMAND_MODE (1) -/* @brief Simplified bit clock source and asynchronous/synchronous mode selection (register bit fields TCR2[CLKMODE], RCR2[CLKMODE]), in comparison with the exclusively implemented TCR2[SYNC,BCS,BCI,MSEL], RCR2[SYNC,BCS,BCI,MSEL]. */ -#define FSL_FEATURE_SAI_HAS_CLOCKING_MODE (0) -/* @brief Has register for configuration of the MCLK divide ratio (register bit fields MDR[FRACT], MDR[DIVIDE]). */ -#define FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER (0) -/* @brief Ihe interrupt source number */ -#define FSL_FEATURE_SAI_INT_SOURCE_NUM (1) -/* @brief Has register of MCR. */ -#define FSL_FEATURE_SAI_HAS_MCR (1) -/* @brief Has register of MDR */ -#define FSL_FEATURE_SAI_HAS_MDR (0) -/* @brief Has DIV bit fields of MCR register (register bit fields MCR[DIV]. */ -#define FSL_FEATURE_SAI_HAS_MCR_MCLK_POST_DIV (0) -/* @brief Support Channel Mode (register bit fields TCR4[CHMOD]). */ -#define FSL_FEATURE_SAI_HAS_CHANNEL_MODE (0) - -/* SLCD module features */ - -/* @brief Has Multi Alternate Clock Source (register bit GCR[ATLSOURCE]). */ -#define FSL_FEATURE_SLCD_HAS_MULTI_ALTERNATE_CLOCK_SOURCE (1) -/* @brief Has fast frame rate (register bit GCR[FFR]). */ -#define FSL_FEATURE_SLCD_HAS_FAST_FRAME_RATE (1) -/* @brief Has frame frequency interrupt (register bit GCR[LCDIEN]). */ -#define FSL_FEATURE_SLCD_HAS_FRAME_FREQUENCY_INTERRUPT (0) -/* @brief Has high reference select (register bit GCR[HREFSEL]). */ -#define FSL_FEATURE_SLCD_HAS_HIGH_REFERENCE_SELECT (0) -/* @brief Has pad safe (register bit GCR[PADSAFE]). */ -#define FSL_FEATURE_SLCD_HAS_PAD_SAFE (1) -/* @brief Has lcd wait (register bit GCR[LCDWAIT]). */ -#define FSL_FEATURE_SLCD_HAS_LCD_WAIT (0) -/* @brief Has lcd doze enable (register bit GCR[LCDDOZE]). */ -#define FSL_FEATURE_SLCD_HAS_LCD_DOZE_ENABLE (1) -/* @brief Total pin number on LCD. */ -#define FSL_FEATURE_SLCD_HAS_PIN_NUM (64) -/* @brief Total phase number on SLCD. */ -#define FSL_FEATURE_SLCD_HAS_PHASE_NUM (8) - -/* LLWU module features */ - -/* @brief Maximum number of pins (maximal index plus one) connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN (16) -/* @brief Has pins 8-15 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_EXTERNAL_PIN_GROUP2 (1) -/* @brief Maximum number of internal modules connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_INTERNAL_MODULE (8) -/* @brief Number of digital filters. */ -#define FSL_FEATURE_LLWU_HAS_PIN_FILTER (2) -/* @brief Has MF register. */ -#define FSL_FEATURE_LLWU_HAS_MF (0) -/* @brief Has PF register. */ -#define FSL_FEATURE_LLWU_HAS_PF (0) -/* @brief Has possibility to enable reset in low leakage power mode and enable digital filter for RESET pin (register LLWU_RST). */ -#define FSL_FEATURE_LLWU_HAS_RESET_ENABLE (0) -/* @brief Has no internal module wakeup flag register. */ -#define FSL_FEATURE_LLWU_HAS_NO_INTERNAL_MODULE_WAKEUP_FLAG_REG (0) -/* @brief Has external pin 0 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN0 (0) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN0_GPIO_IDX (0) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN0_GPIO_PIN (0) -/* @brief Has external pin 1 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN1 (0) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN1_GPIO_IDX (0) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN1_GPIO_PIN (0) -/* @brief Has external pin 2 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN2 (0) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN2_GPIO_IDX (0) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN2_GPIO_PIN (0) -/* @brief Has external pin 3 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN3 (0) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN3_GPIO_IDX (0) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN3_GPIO_PIN (0) -/* @brief Has external pin 4 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN4 (0) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN4_GPIO_IDX (0) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN4_GPIO_PIN (0) -/* @brief Has external pin 5 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN5 (1) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN5_GPIO_IDX (GPIOB_IDX) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN5_GPIO_PIN (0) -/* @brief Has external pin 6 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN6 (1) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN6_GPIO_IDX (GPIOC_IDX) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN6_GPIO_PIN (1) -/* @brief Has external pin 7 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN7 (1) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN7_GPIO_IDX (GPIOC_IDX) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN7_GPIO_PIN (3) -/* @brief Has external pin 8 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN8 (1) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN8_GPIO_IDX (GPIOC_IDX) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN8_GPIO_PIN (4) -/* @brief Has external pin 9 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN9 (1) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN9_GPIO_IDX (GPIOC_IDX) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN9_GPIO_PIN (5) -/* @brief Has external pin 10 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN10 (1) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN10_GPIO_IDX (GPIOC_IDX) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN10_GPIO_PIN (6) -/* @brief Has external pin 11 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN11 (0) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN11_GPIO_IDX (0) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN11_GPIO_PIN (0) -/* @brief Has external pin 12 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN12 (0) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN12_GPIO_IDX (0) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN12_GPIO_PIN (0) -/* @brief Has external pin 13 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN13 (0) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN13_GPIO_IDX (0) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN13_GPIO_PIN (0) -/* @brief Has external pin 14 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN14 (1) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN14_GPIO_IDX (GPIOD_IDX) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN14_GPIO_PIN (4) -/* @brief Has external pin 15 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN15 (1) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN15_GPIO_IDX (GPIOD_IDX) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN15_GPIO_PIN (6) -/* @brief Has external pin 16 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN16 (0) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN16_GPIO_IDX (0) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN16_GPIO_PIN (0) -/* @brief Has external pin 17 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN17 (0) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN17_GPIO_IDX (0) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN17_GPIO_PIN (0) -/* @brief Has external pin 18 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN18 (0) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN18_GPIO_IDX (0) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN18_GPIO_PIN (0) -/* @brief Has external pin 19 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN19 (0) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN19_GPIO_IDX (0) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN19_GPIO_PIN (0) -/* @brief Has external pin 20 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN20 (0) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN20_GPIO_IDX (0) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN20_GPIO_PIN (0) -/* @brief Has external pin 21 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN21 (0) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN21_GPIO_IDX (0) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN21_GPIO_PIN (0) -/* @brief Has external pin 22 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN22 (0) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN22_GPIO_IDX (0) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN22_GPIO_PIN (0) -/* @brief Has external pin 23 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN23 (0) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN23_GPIO_IDX (0) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN23_GPIO_PIN (0) -/* @brief Has external pin 24 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN24 (0) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN24_GPIO_IDX (0) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN24_GPIO_PIN (0) -/* @brief Has external pin 25 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN25 (0) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN25_GPIO_IDX (0) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN25_GPIO_PIN (0) -/* @brief Has external pin 26 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN26 (0) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN26_GPIO_IDX (0) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN26_GPIO_PIN (0) -/* @brief Has external pin 27 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN27 (0) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN27_GPIO_IDX (0) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN27_GPIO_PIN (0) -/* @brief Has external pin 28 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN28 (0) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN28_GPIO_IDX (0) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN28_GPIO_PIN (0) -/* @brief Has external pin 29 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN29 (0) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN29_GPIO_IDX (0) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN29_GPIO_PIN (0) -/* @brief Has external pin 30 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN30 (0) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN30_GPIO_IDX (0) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN30_GPIO_PIN (0) -/* @brief Has external pin 31 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN31 (0) -/* @brief Index of port of external pin. */ -#define FSL_FEATURE_LLWU_PIN31_GPIO_IDX (0) -/* @brief Number of external pin port on specified port. */ -#define FSL_FEATURE_LLWU_PIN31_GPIO_PIN (0) -/* @brief Has internal module 0 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_INTERNAL_MODULE0 (1) -/* @brief Has internal module 1 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_INTERNAL_MODULE1 (1) -/* @brief Has internal module 2 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_INTERNAL_MODULE2 (0) -/* @brief Has internal module 3 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_INTERNAL_MODULE3 (0) -/* @brief Has internal module 4 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_INTERNAL_MODULE4 (0) -/* @brief Has internal module 5 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_INTERNAL_MODULE5 (1) -/* @brief Has internal module 6 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_INTERNAL_MODULE6 (0) -/* @brief Has internal module 7 connected to LLWU device. */ -#define FSL_FEATURE_LLWU_HAS_INTERNAL_MODULE7 (1) -/* @brief Has Version ID Register (LLWU_VERID). */ -#define FSL_FEATURE_LLWU_HAS_VERID (0) -/* @brief Has Parameter Register (LLWU_PARAM). */ -#define FSL_FEATURE_LLWU_HAS_PARAM (0) -/* @brief Width of registers of the LLWU. */ -#define FSL_FEATURE_LLWU_REG_BITWIDTH (8) -/* @brief Has DMA Enable register (LLWU_DE). */ -#define FSL_FEATURE_LLWU_HAS_DMA_ENABLE_REG (0) - -/* LPTMR module features */ - -/* @brief Has shared interrupt handler with another LPTMR module. */ -#define FSL_FEATURE_LPTMR_HAS_SHARED_IRQ_HANDLER (0) -/* @brief Whether LPTMR counter is 32 bits width. */ -#define FSL_FEATURE_LPTMR_CNR_WIDTH_IS_32B (0) -/* @brief Has timer DMA request enable (register bit CSR[TDRE]). */ -#define FSL_FEATURE_LPTMR_HAS_CSR_TDRE (0) - -/* LPUART module features */ - -/* @brief LPUART0 and LPUART1 has shared interrupt vector. */ -#define FSL_FEATURE_LPUART_HAS_SHARED_IRQ0_IRQ1 (0) -/* @brief Has receive FIFO overflow detection (bit field CFIFO[RXOFE]). */ -#define FSL_FEATURE_LPUART_HAS_IRQ_EXTENDED_FUNCTIONS (0) -/* @brief Has low power features (can be enabled in wait mode via register bit C1[DOZEEN] or CTRL[DOZEEN] if the registers are 32-bit wide). */ -#define FSL_FEATURE_LPUART_HAS_LOW_POWER_UART_SUPPORT (1) -/* @brief Has extended data register ED (or extra flags in the DATA register if the registers are 32-bit wide). */ -#define FSL_FEATURE_LPUART_HAS_EXTENDED_DATA_REGISTER_FLAGS (1) -/* @brief Capacity (number of entries) of the transmit/receive FIFO (or zero if no FIFO is available). */ -#define FSL_FEATURE_LPUART_HAS_FIFO (0) -/* @brief Has 32-bit register MODIR */ -#define FSL_FEATURE_LPUART_HAS_MODIR (0) -/* @brief Hardware flow control (RTS, CTS) is supported. */ -#define FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT (0) -/* @brief Infrared (modulation) is supported. */ -#define FSL_FEATURE_LPUART_HAS_IR_SUPPORT (0) -/* @brief 2 bits long stop bit is available. */ -#define FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT (1) -/* @brief If 10-bit mode is supported. */ -#define FSL_FEATURE_LPUART_HAS_10BIT_DATA_SUPPORT (1) -/* @brief If 7-bit mode is supported. */ -#define FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT (0) -/* @brief Baud rate fine adjustment is available. */ -#define FSL_FEATURE_LPUART_HAS_BAUD_RATE_FINE_ADJUST_SUPPORT (0) -/* @brief Baud rate oversampling is available (has bit fields C4[OSR], C5[BOTHEDGE], C5[RESYNCDIS] or BAUD[OSR], BAUD[BOTHEDGE], BAUD[RESYNCDIS] if the registers are 32-bit wide). */ -#define FSL_FEATURE_LPUART_HAS_BAUD_RATE_OVER_SAMPLING_SUPPORT (1) -/* @brief Baud rate oversampling is available. */ -#define FSL_FEATURE_LPUART_HAS_RX_RESYNC_SUPPORT (1) -/* @brief Baud rate oversampling is available. */ -#define FSL_FEATURE_LPUART_HAS_BOTH_EDGE_SAMPLING_SUPPORT (1) -/* @brief Peripheral type. */ -#define FSL_FEATURE_LPUART_IS_SCI (1) -/* @brief Capacity (number of entries) of the transmit/receive FIFO (or zero if no FIFO is available). */ -#define FSL_FEATURE_LPUART_FIFO_SIZEn(x) (0) -/* @brief Supports two match addresses to filter incoming frames. */ -#define FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING (1) -/* @brief Has transmitter/receiver DMA enable bits C5[TDMAE]/C5[RDMAE] (or BAUD[TDMAE]/BAUD[RDMAE] if the registers are 32-bit wide). */ -#define FSL_FEATURE_LPUART_HAS_DMA_ENABLE (1) -/* @brief Has transmitter/receiver DMA select bits C4[TDMAS]/C4[RDMAS], resp. C5[TDMAS]/C5[RDMAS] if IS_SCI = 0. */ -#define FSL_FEATURE_LPUART_HAS_DMA_SELECT (0) -/* @brief Data character bit order selection is supported (bit field S2[MSBF] or STAT[MSBF] if the registers are 32-bit wide). */ -#define FSL_FEATURE_LPUART_HAS_BIT_ORDER_SELECT (1) -/* @brief Has smart card (ISO7816 protocol) support and no improved smart card support. */ -#define FSL_FEATURE_LPUART_HAS_SMART_CARD_SUPPORT (0) -/* @brief Has improved smart card (ISO7816 protocol) support. */ -#define FSL_FEATURE_LPUART_HAS_IMPROVED_SMART_CARD_SUPPORT (0) -/* @brief Has local operation network (CEA709.1-B protocol) support. */ -#define FSL_FEATURE_LPUART_HAS_LOCAL_OPERATION_NETWORK_SUPPORT (0) -/* @brief Has 32-bit registers (BAUD, STAT, CTRL, DATA, MATCH, MODIR) instead of 8-bit (BDH, BDL, C1, S1, D, etc.). */ -#define FSL_FEATURE_LPUART_HAS_32BIT_REGISTERS (1) -/* @brief Lin break detect available (has bit BAUD[LBKDIE]). */ -#define FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT (1) -/* @brief UART stops in Wait mode available (has bit C1[UARTSWAI]). */ -#define FSL_FEATURE_LPUART_HAS_WAIT_MODE_OPERATION (0) -/* @brief Has separate DMA RX and TX requests. */ -#define FSL_FEATURE_LPUART_HAS_SEPARATE_DMA_RX_TX_REQn(x) (1) -/* @brief Has separate RX and TX interrupts. */ -#define FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ (0) -/* @brief Has LPAURT_PARAM. */ -#define FSL_FEATURE_LPUART_HAS_PARAM (0) -/* @brief Has LPUART_VERID. */ -#define FSL_FEATURE_LPUART_HAS_VERID (0) -/* @brief Has LPUART_GLOBAL. */ -#define FSL_FEATURE_LPUART_HAS_GLOBAL (0) -/* @brief Has LPUART_PINCFG. */ -#define FSL_FEATURE_LPUART_HAS_PINCFG (0) - -/* MCGLITE module features */ - -/* @brief Defines that clock generator is MCG Lite. */ -#define FSL_FEATURE_MCGLITE_MCGLITE (1) -/* @brief Has Crystal Oscillator Operation Mode Selection. */ -#define FSL_FEATURE_MCGLITE_HAS_HGO0 (1) -/* @brief Has HCTRIM register available. */ -#define FSL_FEATURE_MCGLITE_HAS_HCTRIM (1) -/* @brief Has HTTRIM register available. */ -#define FSL_FEATURE_MCGLITE_HAS_HTTRIM (1) -/* @brief Has HFTRIM register available. */ -#define FSL_FEATURE_MCGLITE_HAS_HFTRIM (1) -/* @brief Has LTRIMRNG register available. */ -#define FSL_FEATURE_MCGLITE_HAS_LTRIMRNG (1) -/* @brief Has LFTRIM register available. */ -#define FSL_FEATURE_MCGLITE_HAS_LFTRIM (1) -/* @brief Has LSTRIM register available. */ -#define FSL_FEATURE_MCGLITE_HAS_LSTRIM (1) -/* @brief Has External Clock Source Frequency Range Selection. */ -#define FSL_FEATURE_MCGLITE_HAS_RANGE0 (1) - -/* interrupt module features */ - -/* @brief Lowest interrupt request number. */ -#define FSL_FEATURE_INTERRUPT_IRQ_MIN (-14) -/* @brief Highest interrupt request number. */ -#define FSL_FEATURE_INTERRUPT_IRQ_MAX (31) - -/* OSC module features */ - -/* @brief Has OSC1 external oscillator. */ -#define FSL_FEATURE_OSC_HAS_OSC1 (0) -/* @brief Has OSC0 external oscillator. */ -#define FSL_FEATURE_OSC_HAS_OSC0 (1) -/* @brief Has OSC external oscillator (without index). */ -#define FSL_FEATURE_OSC_HAS_OSC (0) -/* @brief Number of OSC external oscillators. */ -#define FSL_FEATURE_OSC_OSC_COUNT (1) -/* @brief Has external reference clock divider (register bit field DIV[ERPS]). */ -#define FSL_FEATURE_OSC_HAS_EXT_REF_CLOCK_DIVIDER (0) - -/* PIT module features */ - -/* @brief Number of channels (related to number of registers LDVALn, CVALn, TCTRLn, TFLGn). */ -#define FSL_FEATURE_PIT_TIMER_COUNT (2) -/* @brief Has lifetime timer (related to existence of registers LTMR64L and LTMR64H). */ -#define FSL_FEATURE_PIT_HAS_LIFETIME_TIMER (1) -/* @brief Has chain mode (related to existence of register bit field TCTRLn[CHN]). */ -#define FSL_FEATURE_PIT_HAS_CHAIN_MODE (1) -/* @brief Has shared interrupt handler (has not individual interrupt handler for each channel). */ -#define FSL_FEATURE_PIT_HAS_SHARED_IRQ_HANDLER (1) -/* @brief Has timer enable control. */ -#define FSL_FEATURE_PIT_HAS_MDIS (1) -/* @brief Has ERRATA 7914. */ -#define FSL_FEATURE_PIT_HAS_ERRATA_7914 (1) - -/* PMC module features */ - -/* @brief Has Bandgap Enable In VLPx Operation support. */ -#define FSL_FEATURE_PMC_HAS_BGEN (1) -/* @brief Has Bandgap Buffer Enable. */ -#define FSL_FEATURE_PMC_HAS_BGBE (1) -/* @brief Has Bandgap Buffer Drive Select. */ -#define FSL_FEATURE_PMC_HAS_BGBDS (0) -/* @brief Has Low-Voltage Detect Voltage Select support. */ -#define FSL_FEATURE_PMC_HAS_LVDV (1) -/* @brief Has Low-Voltage Warning Voltage Select support. */ -#define FSL_FEATURE_PMC_HAS_LVWV (1) -/* @brief Has LPO. */ -#define FSL_FEATURE_PMC_HAS_LPO (0) -/* @brief Has VLPx option PMC_REGSC[VLPO]. */ -#define FSL_FEATURE_PMC_HAS_VLPO (0) -/* @brief Has acknowledge isolation support. */ -#define FSL_FEATURE_PMC_HAS_ACKISO (1) -/* @brief Has Regulator In Full Performance Mode Status Bit PMC_REGSC[REGFPM]. */ -#define FSL_FEATURE_PMC_HAS_REGFPM (0) -/* @brief Has Regulator In Run Regulation Status Bit PMC_REGSC[REGONS]. */ -#define FSL_FEATURE_PMC_HAS_REGONS (1) -/* @brief Has PMC_HVDSC1. */ -#define FSL_FEATURE_PMC_HAS_HVDSC1 (0) -/* @brief Has PMC_PARAM. */ -#define FSL_FEATURE_PMC_HAS_PARAM (0) -/* @brief Has PMC_VERID. */ -#define FSL_FEATURE_PMC_HAS_VERID (0) - -/* PORT module features */ - -/* @brief Has control lock (register bit PCR[LK]). */ -#define FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK (0) -/* @brief Has open drain control (register bit PCR[ODE]). */ -#define FSL_FEATURE_PORT_HAS_OPEN_DRAIN (0) -/* @brief Has digital filter (registers DFER, DFCR and DFWR). */ -#define FSL_FEATURE_PORT_HAS_DIGITAL_FILTER (0) -/* @brief Has DMA request (register bit field PCR[IRQC] values). */ -#define FSL_FEATURE_PORT_HAS_DMA_REQUEST (1) -/* @brief Has pull resistor selection available. */ -#define FSL_FEATURE_PORT_HAS_PULL_SELECTION (1) -/* @brief Has pull resistor enable (register bit PCR[PE]). */ -#define FSL_FEATURE_PORT_HAS_PULL_ENABLE (1) -/* @brief Has slew rate control (register bit PCR[SRE]). */ -#define FSL_FEATURE_PORT_HAS_SLEW_RATE (1) -/* @brief Has passive filter (register bit field PCR[PFE]). */ -#define FSL_FEATURE_PORT_HAS_PASSIVE_FILTER (1) -/* @brief Has drive strength control (register bit PCR[DSE]). */ -#define FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH (1) -/* @brief Has separate drive strength register (HDRVE). */ -#define FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH_REGISTER (0) -/* @brief Has glitch filter (register IOFLT). */ -#define FSL_FEATURE_PORT_HAS_GLITCH_FILTER (0) -/* @brief Defines width of PCR[MUX] field. */ -#define FSL_FEATURE_PORT_PCR_MUX_WIDTH (3) -/* @brief Has dedicated interrupt vector. */ -#define FSL_FEATURE_PORT_HAS_INTERRUPT_VECTOR (1) -/* @brief Has multiple pin IRQ configuration (register GICLR and GICHR). */ -#define FSL_FEATURE_PORT_HAS_MULTIPLE_IRQ_CONFIG (0) -/* @brief Defines whether PCR[IRQC] bit-field has flag states. */ -#define FSL_FEATURE_PORT_HAS_IRQC_FLAG (0) -/* @brief Defines whether PCR[IRQC] bit-field has trigger states. */ -#define FSL_FEATURE_PORT_HAS_IRQC_TRIGGER (0) - -/* RCM module features */ - -/* @brief Has Loss-of-Lock Reset support. */ -#define FSL_FEATURE_RCM_HAS_LOL (0) -/* @brief Has Loss-of-Clock Reset support. */ -#define FSL_FEATURE_RCM_HAS_LOC (0) -/* @brief Has JTAG generated Reset support. */ -#define FSL_FEATURE_RCM_HAS_JTAG (0) -/* @brief Has EzPort generated Reset support. */ -#define FSL_FEATURE_RCM_HAS_EZPORT (0) -/* @brief Has bit-field indicating EZP_MS_B pin state during last reset. */ -#define FSL_FEATURE_RCM_HAS_EZPMS (0) -/* @brief Has boot ROM configuration, MR[BOOTROM], FM[FORCEROM] */ -#define FSL_FEATURE_RCM_HAS_BOOTROM (1) -/* @brief Has sticky system reset status register RCM_SSRS0 and RCM_SSRS1. */ -#define FSL_FEATURE_RCM_HAS_SSRS (1) -/* @brief Has Version ID Register (RCM_VERID). */ -#define FSL_FEATURE_RCM_HAS_VERID (0) -/* @brief Has Parameter Register (RCM_PARAM). */ -#define FSL_FEATURE_RCM_HAS_PARAM (0) -/* @brief Has Reset Interrupt Enable Register RCM_SRIE. */ -#define FSL_FEATURE_RCM_HAS_SRIE (0) -/* @brief Width of registers of the RCM. */ -#define FSL_FEATURE_RCM_REG_WIDTH (8) -/* @brief Has Core 1 generated Reset support RCM_SRS[CORE1] */ -#define FSL_FEATURE_RCM_HAS_CORE1 (0) -/* @brief Has MDM-AP system reset support RCM_SRS1[MDM_AP] */ -#define FSL_FEATURE_RCM_HAS_MDM_AP (1) -/* @brief Has wakeup reset feature. Register bit SRS[WAKEUP]. */ -#define FSL_FEATURE_RCM_HAS_WAKEUP (1) - -/* RTC module features */ - -/* @brief Has wakeup pin. */ -#define FSL_FEATURE_RTC_HAS_WAKEUP_PIN (1) -/* @brief Has wakeup pin selection (bit field CR[WPS]). */ -#define FSL_FEATURE_RTC_HAS_WAKEUP_PIN_SELECTION (1) -/* @brief Has low power features (registers MER, MCLR and MCHR). */ -#define FSL_FEATURE_RTC_HAS_MONOTONIC (0) -/* @brief Has read/write access control (registers WAR and RAR). */ -#define FSL_FEATURE_RTC_HAS_ACCESS_CONTROL (0) -/* @brief Has security features (registers TTSR, MER, MCLR and MCHR). */ -#define FSL_FEATURE_RTC_HAS_SECURITY (0) -/* @brief Has RTC_CLKIN available. */ -#define FSL_FEATURE_RTC_HAS_RTC_CLKIN (1) -/* @brief Has prescaler adjust for LPO. */ -#define FSL_FEATURE_RTC_HAS_LPO_ADJUST (0) -/* @brief Has Clock Pin Enable field. */ -#define FSL_FEATURE_RTC_HAS_CPE (0) -/* @brief Has Timer Seconds Interrupt Configuration field. */ -#define FSL_FEATURE_RTC_HAS_TSIC (0) -/* @brief Has OSC capacitor setting RTC_CR[SC2P ~ SC16P] */ -#define FSL_FEATURE_RTC_HAS_OSC_SCXP (1) -/* @brief Has Tamper Interrupt Register (register TIR). */ -#define FSL_FEATURE_RTC_HAS_TIR (0) -/* @brief Has Tamper Pin Interrupt Enable (bitfield TIR[TPIE]). */ -#define FSL_FEATURE_RTC_HAS_TIR_TPIE (0) -/* @brief Has Security Interrupt Enable (bitfield TIR[SIE]). */ -#define FSL_FEATURE_RTC_HAS_TIR_SIE (0) -/* @brief Has Loss of Clock Interrupt Enable (bitfield TIR[LCIE]). */ -#define FSL_FEATURE_RTC_HAS_TIR_LCIE (0) -/* @brief Has Tamper Interrupt Detect Flag (bitfield SR[TIDF]). */ -#define FSL_FEATURE_RTC_HAS_SR_TIDF (0) -/* @brief Has Tamper Detect Register (register TDR). */ -#define FSL_FEATURE_RTC_HAS_TDR (0) -/* @brief Has Tamper Pin Flag (bitfield TDR[TPF]). */ -#define FSL_FEATURE_RTC_HAS_TDR_TPF (0) -/* @brief Has Security Tamper Flag (bitfield TDR[STF]). */ -#define FSL_FEATURE_RTC_HAS_TDR_STF (0) -/* @brief Has Loss of Clock Tamper Flag (bitfield TDR[LCTF]). */ -#define FSL_FEATURE_RTC_HAS_TDR_LCTF (0) -/* @brief Has Tamper Time Seconds Register (register TTSR). */ -#define FSL_FEATURE_RTC_HAS_TTSR (0) -/* @brief Has Pin Configuration Register (register PCR). */ -#define FSL_FEATURE_RTC_HAS_PCR (0) - -/* SIM module features */ - -/* @brief Has USB FS divider. */ -#define FSL_FEATURE_SIM_USBFS_USE_SPECIAL_DIVIDER (0) -/* @brief Is PLL clock divided by 2 before MCG PLL/FLL clock selection. */ -#define FSL_FEATURE_SIM_PLLCLK_USE_SPECIAL_DIVIDER (0) -/* @brief Has RAM size specification (register bit field SOPT1[RAMSIZE]). */ -#define FSL_FEATURE_SIM_OPT_HAS_RAMSIZE (0) -/* @brief Has 32k oscillator clock output (register bit SOPT1[OSC32KOUT]). */ -#define FSL_FEATURE_SIM_OPT_HAS_OSC32K_OUT (1) -/* @brief Has 32k oscillator clock selection (register bit field SOPT1[OSC32KSEL]). */ -#define FSL_FEATURE_SIM_OPT_HAS_OSC32K_SELECTION (1) -/* @brief 32k oscillator clock selection width (width of register bit field SOPT1[OSC32KSEL]). */ -#define FSL_FEATURE_SIM_OPT_OSC32K_SELECTION_WIDTH (2) -/* @brief Has RTC clock output selection (register bit SOPT2[RTCCLKOUTSEL]). */ -#define FSL_FEATURE_SIM_OPT_HAS_RTC_CLOCK_OUT_SELECTION (1) -/* @brief Has USB voltage regulator (register bits SOPT1[USBVSTBY], SOPT1[USBSSTBY], SOPT1[USBREGEN], SOPT1CFG[URWE], SOPT1CFG[UVSWE], SOPT1CFG[USSWE]). */ -#define FSL_FEATURE_SIM_OPT_HAS_USB_VOLTAGE_REGULATOR (1) -/* @brief USB has integrated PHY (register bits USBPHYCTL[USBVREGSEL], USBPHYCTL[USBVREGPD], USBPHYCTL[USB3VOUTTRG], USBPHYCTL[USBDISILIM], SOPT2[USBSLSRC], SOPT2[USBREGEN]). */ -#define FSL_FEATURE_SIM_OPT_HAS_USB_PHY (0) -/* @brief Has PTD7 pad drive strength control (register bit SOPT2[PTD7PAD]). */ -#define FSL_FEATURE_SIM_OPT_HAS_PTD7PAD (0) -/* @brief Has FlexBus security level selection (register bit SOPT2[FBSL]). */ -#define FSL_FEATURE_SIM_OPT_HAS_FBSL (0) -/* @brief Has number of FlexBus hold cycle before FlexBus can release bus (register bit SOPT6[PCR]). */ -#define FSL_FEATURE_SIM_OPT_HAS_PCR (0) -/* @brief Has number of NFC hold cycle in case of FlexBus request (register bit SOPT6[MCC]). */ -#define FSL_FEATURE_SIM_OPT_HAS_MCC (0) -/* @brief Has UART open drain enable (register bits UARTnODE, where n is a number, in register SOPT5). */ -#define FSL_FEATURE_SIM_OPT_HAS_ODE (1) -/* @brief Number of LPUART modules (number of register bits LPUARTn, where n is a number, in register SCGC5). */ -#define FSL_FEATURE_SIM_OPT_LPUART_COUNT (2) -/* @brief Number of UART modules (number of register bits UARTn, where n is a number, in register SCGC4). */ -#define FSL_FEATURE_SIM_OPT_UART_COUNT (1) -/* @brief Has UART0 open drain enable (register bit SOPT5[UART0ODE]). */ -#define FSL_FEATURE_SIM_OPT_HAS_UART0_ODE (0) -/* @brief Has UART1 open drain enable (register bit SOPT5[UART1ODE]). */ -#define FSL_FEATURE_SIM_OPT_HAS_UART1_ODE (0) -/* @brief Has UART2 open drain enable (register bit SOPT5[UART2ODE]). */ -#define FSL_FEATURE_SIM_OPT_HAS_UART2_ODE (1) -/* @brief Has LPUART0 open drain enable (register bit SOPT5[LPUART0ODE]). */ -#define FSL_FEATURE_SIM_OPT_HAS_LPUART0_ODE (1) -/* @brief Has LPUART1 open drain enable (register bit SOPT5[LPUART1ODE]). */ -#define FSL_FEATURE_SIM_OPT_HAS_LPUART1_ODE (1) -/* @brief Has CMT/UART pad drive strength control (register bit SOPT2[CMTUARTPAD]). */ -#define FSL_FEATURE_SIM_OPT_HAS_CMTUARTPAD (0) -/* @brief Has LPUART0 transmit data source selection (register bit SOPT5[LPUART0TXSRC]). */ -#define FSL_FEATURE_SIM_OPT_HAS_LPUART0_TX_SRC (1) -/* @brief Has LPUART0 receive data source selection (register bit SOPT5[LPUART0RXSRC]). */ -#define FSL_FEATURE_SIM_OPT_HAS_LPUART0_RX_SRC (1) -/* @brief Has LPUART1 transmit data source selection (register bit SOPT5[LPUART1TXSRC]). */ -#define FSL_FEATURE_SIM_OPT_HAS_LPUART1_TX_SRC (1) -/* @brief Has LPUART1 receive data source selection (register bit SOPT5[LPUART1RXSRC]). */ -#define FSL_FEATURE_SIM_OPT_HAS_LPUART1_RX_SRC (1) -/* @brief Has UART0 transmit data source selection (register bit SOPT5[UART0TXSRC]). */ -#define FSL_FEATURE_SIM_OPT_HAS_UART0_TX_SRC (0) -/* @brief UART0 transmit data source selection width (width of register bit SOPT5[UART0TXSRC]). */ -#define FSL_FEATURE_SIM_OPT_UART0_TX_SRC_WIDTH (0) -/* @brief Has UART0 receive data source selection (register bit SOPT5[UART0RXSRC]). */ -#define FSL_FEATURE_SIM_OPT_HAS_UART0_RX_SRC (0) -/* @brief UART0 receive data source selection width (width of register bit SOPT5[UART0RXSRC]). */ -#define FSL_FEATURE_SIM_OPT_UART0_RX_SRC_WIDTH (0) -/* @brief Has UART1 transmit data source selection (register bit SOPT5[UART1TXSRC]). */ -#define FSL_FEATURE_SIM_OPT_HAS_UART1_TX_SRC (0) -/* @brief Has UART1 receive data source selection (register bit SOPT5[UART1RXSRC]). */ -#define FSL_FEATURE_SIM_OPT_HAS_UART1_RX_SRC (0) -/* @brief UART1 receive data source selection width (width of register bit SOPT5[UART1RXSRC]). */ -#define FSL_FEATURE_SIM_OPT_UART1_RX_SRC_WIDTH (0) -/* @brief Has FTM module(s) configuration. */ -#define FSL_FEATURE_SIM_OPT_HAS_FTM (0) -/* @brief Number of FTM modules. */ -#define FSL_FEATURE_SIM_OPT_FTM_COUNT (0) -/* @brief Number of FTM triggers with selectable source. */ -#define FSL_FEATURE_SIM_OPT_FTM_TRIGGER_COUNT (0) -/* @brief Has FTM0 triggers source selection (register bits SOPT4[FTM0TRGnSRC], where n is a number). */ -#define FSL_FEATURE_SIM_OPT_HAS_FTM0_TRIGGER (0) -/* @brief Has FTM3 triggers source selection (register bits SOPT4[FTM3TRGnSRC], where n is a number). */ -#define FSL_FEATURE_SIM_OPT_HAS_FTM3_TRIGGER (0) -/* @brief Has FTM1 channel 0 input capture source selection (register bit SOPT4[FTM1CH0SRC]). */ -#define FSL_FEATURE_SIM_OPT_HAS_FTM1_CHANNELS (0) -/* @brief Has FTM2 channel 0 input capture source selection (register bit SOPT4[FTM2CH0SRC]). */ -#define FSL_FEATURE_SIM_OPT_HAS_FTM2_CHANNELS (0) -/* @brief Has FTM3 channel 0 input capture source selection (register bit SOPT4[FTM3CH0SRC]). */ -#define FSL_FEATURE_SIM_OPT_HAS_FTM3_CHANNELS (0) -/* @brief Has FTM2 channel 1 input capture source selection (register bit SOPT4[FTM2CH1SRC]). */ -#define FSL_FEATURE_SIM_OPT_HAS_FTM2_CHANNEL1 (0) -/* @brief Number of configurable FTM0 fault detection input (number of register bits SOPT4[FTM0FLTn], where n is a number starting from zero). */ -#define FSL_FEATURE_SIM_OPT_FTM0_FAULT_COUNT (0) -/* @brief Number of configurable FTM1 fault detection input (number of register bits SOPT4[FTM1FLTn], where n is a number starting from zero). */ -#define FSL_FEATURE_SIM_OPT_FTM1_FAULT_COUNT (0) -/* @brief Number of configurable FTM2 fault detection input (number of register bits SOPT4[FTM2FLTn], where n is a number starting from zero). */ -#define FSL_FEATURE_SIM_OPT_FTM2_FAULT_COUNT (0) -/* @brief Number of configurable FTM3 fault detection input (number of register bits SOPT4[FTM3FLTn], where n is a number starting from zero). */ -#define FSL_FEATURE_SIM_OPT_FTM3_FAULT_COUNT (0) -/* @brief Has FTM hardware trigger 0 software synchronization (register bit SOPT8[FTMnSYNCBIT], where n is a module instance index). */ -#define FSL_FEATURE_SIM_OPT_HAS_FTM_TRIGGER_SYNC (0) -/* @brief Has FTM channels output source selection (register bit SOPT8[FTMxOCHnSRC], where x is a module instance index and n is a channel index). */ -#define FSL_FEATURE_SIM_OPT_HAS_FTM_CHANNELS_OUTPUT_SRC (0) -/* @brief Has TPM module(s) configuration. */ -#define FSL_FEATURE_SIM_OPT_HAS_TPM (1) -/* @brief The highest TPM module index. */ -#define FSL_FEATURE_SIM_OPT_MAX_TPM_INDEX (2) -/* @brief Has TPM module with index 0. */ -#define FSL_FEATURE_SIM_OPT_HAS_TPM0 (1) -/* @brief Has TPM0 clock selection (register bit field SOPT4[TPM0CLKSEL]). */ -#define FSL_FEATURE_SIM_OPT_HAS_TPM0_CLK_SEL (1) -/* @brief Is TPM channels configuration in the SOPT4 (not SOPT9) register (register bits TPMnCH0SRC, TPMnCLKSEL, where n is a module instance index). */ -#define FSL_FEATURE_SIM_OPT_HAS_TPM_CHANNELS_CONFIG_IN_SOPT4_REG (1) -/* @brief Has TPM1 channel 0 input capture source selection (register bit field SOPT4[TPM1CH0SRC] or SOPT9[TPM1CH0SRC]). */ -#define FSL_FEATURE_SIM_OPT_HAS_TPM1_CH0_SRC_SELECTION (1) -/* @brief Has TPM1 clock selection (register bit field SOPT4[TPM1CLKSEL]). */ -#define FSL_FEATURE_SIM_OPT_HAS_TPM1_CLK_SEL (1) -/* @brief TPM1 channel 0 input capture source selection width (width of register bit field SOPT4[TPM1CH0SRC] or SOPT9[TPM1CH0SRC]). */ -#define FSL_FEATURE_SIM_OPT_TPM1_CH0_SRC_SELECTION_WIDTH (2) -/* @brief Has TPM2 channel 0 input capture source selection (register bit field SOPT4[TPM2CH0SRC]). */ -#define FSL_FEATURE_SIM_OPT_HAS_TPM2_CH0_SRC_SELECTION (1) -/* @brief Has TPM2 clock selection (register bit field SOPT4[TPM2CLKSEL]). */ -#define FSL_FEATURE_SIM_OPT_HAS_TPM2_CLK_SEL (1) -/* @brief Has PLL/FLL clock selection (register bit field SOPT2[PLLFLLSEL]). */ -#define FSL_FEATURE_SIM_OPT_HAS_PLL_FLL_SELECTION (0) -/* @brief PLL/FLL clock selection width (width of register bit field SOPT2[PLLFLLSEL]). */ -#define FSL_FEATURE_SIM_OPT_PLL_FLL_SELECTION_WIDTH (0) -/* @brief Has NFC clock source selection (register bit SOPT2[NFCSRC]). */ -#define FSL_FEATURE_SIM_OPT_HAS_NFCSRC (0) -/* @brief Has eSDHC clock source selection (register bit SOPT2[ESDHCSRC]). */ -#define FSL_FEATURE_SIM_OPT_HAS_ESDHCSRC (0) -/* @brief Has SDHC clock source selection (register bit SOPT2[SDHCSRC]). */ -#define FSL_FEATURE_SIM_OPT_HAS_SDHCSRC (0) -/* @brief Has LCDC clock source selection (register bits SOPT2[LCDCSRC], SOPT2[LCDC_CLKSEL]). */ -#define FSL_FEATURE_SIM_OPT_HAS_LCDCSRC (0) -/* @brief Has ENET timestamp clock source selection (register bit SOPT2[TIMESRC]). */ -#define FSL_FEATURE_SIM_OPT_HAS_TIMESRC (0) -/* @brief Has ENET RMII clock source selection (register bit SOPT2[RMIISRC]). */ -#define FSL_FEATURE_SIM_OPT_HAS_RMIISRC (0) -/* @brief Has USB clock source selection (register bit SOPT2[USBSRC]). */ -#define FSL_FEATURE_SIM_OPT_HAS_USBSRC (1) -/* @brief Has USB FS clock source selection (register bit SOPT2[USBFSRC]). */ -#define FSL_FEATURE_SIM_OPT_HAS_USBFSRC (0) -/* @brief Has USB HS clock source selection (register bit SOPT2[USBHSRC]). */ -#define FSL_FEATURE_SIM_OPT_HAS_USBHSRC (0) -/* @brief Has LPUART clock source selection (register bit SOPT2[LPUARTSRC]). */ -#define FSL_FEATURE_SIM_OPT_HAS_LPUARTSRC (0) -/* @brief Has LPUART0 clock source selection (register bit SOPT2[LPUART0SRC]). */ -#define FSL_FEATURE_SIM_OPT_HAS_LPUART0SRC (1) -/* @brief Has LPUART1 clock source selection (register bit SOPT2[LPUART1SRC]). */ -#define FSL_FEATURE_SIM_OPT_HAS_LPUART1SRC (1) -/* @brief Has FLEXIOSRC clock source selection (register bit SOPT2[FLEXIOSRC]). */ -#define FSL_FEATURE_SIM_OPT_HAS_FLEXIOSRC (1) -/* @brief Has UART0 clock source selection (register bit SOPT2[UART0SRC]). */ -#define FSL_FEATURE_SIM_OPT_HAS_UART0SRC (0) -/* @brief Has TPM clock source selection (register bit SOPT2[TPMSRC]). */ -#define FSL_FEATURE_SIM_OPT_HAS_TPMSRC (1) -/* @brief Has debug trace clock selection (register bit SOPT2[TRACECLKSEL]). */ -#define FSL_FEATURE_SIM_OPT_HAS_TRACE_CLKSEL (0) -/* @brief Number of ADC modules (register bits SOPT7[ADCnTRGSEL], SOPT7[ADCnPRETRGSEL], SOPT7[ADCnALTTRGSEL], where n is a module instance index). */ -#define FSL_FEATURE_SIM_OPT_ADC_COUNT (1) -/* @brief Has clock 2 output divider (register bit field CLKDIV1[OUTDIV2]). */ -#define FSL_FEATURE_SIM_DIVIDER_HAS_OUTDIV2 (0) -/* @brief Has clock 3 output divider (register bit field CLKDIV1[OUTDIV3]). */ -#define FSL_FEATURE_SIM_DIVIDER_HAS_OUTDIV3 (0) -/* @brief Has clock 4 output divider (register bit field CLKDIV1[OUTDIV4]). */ -#define FSL_FEATURE_SIM_DIVIDER_HAS_OUTDIV4 (1) -/* @brief Clock 4 output divider width (width of register bit field CLKDIV1[OUTDIV4]). */ -#define FSL_FEATURE_SIM_DIVIDER_OUTDIV4_WIDTH (3) -/* @brief Has clock 5 output divider (register bit field CLKDIV1[OUTDIV5]). */ -#define FSL_FEATURE_SIM_DIVIDER_HAS_OUTDIV5 (0) -/* @brief Has USB clock divider (register bit field CLKDIV2[USBDIV] and CLKDIV2[USBFRAC]). */ -#define FSL_FEATURE_SIM_DIVIDER_HAS_USBDIV (0) -/* @brief Has USB FS clock divider (register bit field CLKDIV2[USBFSDIV] and CLKDIV2[USBFSFRAC]). */ -#define FSL_FEATURE_SIM_DIVIDER_HAS_USBFSDIV (0) -/* @brief Has USB HS clock divider (register bit field CLKDIV2[USBHSDIV] and CLKDIV2[USBHSFRAC]). */ -#define FSL_FEATURE_SIM_DIVIDER_HAS_USBHSDIV (0) -/* @brief Has PLL/FLL clock divider (register bit field CLKDIV3[PLLFLLDIV] and CLKDIV3[PLLFLLFRAC]). */ -#define FSL_FEATURE_SIM_DIVIDER_HAS_PLLFLLDIV (0) -/* @brief Has LCDC clock divider (register bit field CLKDIV3[LCDCDIV] and CLKDIV3[LCDCFRAC]). */ -#define FSL_FEATURE_SIM_DIVIDER_HAS_LCDCDIV (0) -/* @brief Has trace clock divider (register bit field CLKDIV4[TRACEDIV] and CLKDIV4[TRACEFRAC]). */ -#define FSL_FEATURE_SIM_DIVIDER_HAS_TRACEDIV (0) -/* @brief Has NFC clock divider (register bit field CLKDIV4[NFCDIV] and CLKDIV4[NFCFRAC]). */ -#define FSL_FEATURE_SIM_DIVIDER_HAS_NFCDIV (0) -/* @brief Has Kinetis family ID (register bit field SDID[FAMILYID]). */ -#define FSL_FEATURE_SIM_SDID_HAS_FAMILYID (0) -/* @brief Has Kinetis family ID (register bit field SDID[FAMID]). */ -#define FSL_FEATURE_SIM_SDID_HAS_FAMID (1) -/* @brief Has Kinetis sub-family ID (register bit field SDID[SUBFAMID]). */ -#define FSL_FEATURE_SIM_SDID_HAS_SUBFAMID (1) -/* @brief Has Kinetis series ID (register bit field SDID[SERIESID]). */ -#define FSL_FEATURE_SIM_SDID_HAS_SERIESID (1) -/* @brief Has device die ID (register bit field SDID[DIEID]). */ -#define FSL_FEATURE_SIM_SDID_HAS_DIEID (0) -/* @brief Has system SRAM size specifier (register bit field SDID[SRAMSIZE]). */ -#define FSL_FEATURE_SIM_SDID_HAS_SRAMSIZE (1) -/* @brief Has flash mode (register bit FCFG1[FLASHDOZE]). */ -#define FSL_FEATURE_SIM_FCFG_HAS_FLASHDOZE (1) -/* @brief Has flash disable (register bit FCFG1[FLASHDIS]). */ -#define FSL_FEATURE_SIM_FCFG_HAS_FLASHDIS (1) -/* @brief Has FTFE disable (register bit FCFG1[FTFDIS]). */ -#define FSL_FEATURE_SIM_FCFG_HAS_FTFDIS (0) -/* @brief Has FlexNVM size specifier (register bit field FCFG1[NVMSIZE]). */ -#define FSL_FEATURE_SIM_FCFG_HAS_NVMSIZE (0) -/* @brief Has EEPROM size specifier (register bit field FCFG1[EESIZE]). */ -#define FSL_FEATURE_SIM_FCFG_HAS_EESIZE (0) -/* @brief Has FlexNVM partition (register bit field FCFG1[DEPART]). */ -#define FSL_FEATURE_SIM_FCFG_HAS_DEPART (0) -/* @brief Maximum flash address block 0 address specifier (register bit field FCFG2[MAXADDR0]). */ -#define FSL_FEATURE_SIM_FCFG_HAS_MAXADDR0 (1) -/* @brief Maximum flash address block 1 address specifier (register bit field FCFG2[MAXADDR1]). */ -#define FSL_FEATURE_SIM_FCFG_HAS_MAXADDR1 (1) -/* @brief Maximum flash address block 0 or 1 address specifier (register bit field FCFG2[MAXADDR01]). */ -#define FSL_FEATURE_SIM_FCFG_HAS_MAXADDR01 (0) -/* @brief Maximum flash address block 2 or 3 address specifier (register bit field FCFG2[MAXADDR23]). */ -#define FSL_FEATURE_SIM_FCFG_HAS_MAXADDR23 (0) -/* @brief Has program flash availability specifier (register bit FCFG2[PFLSH]). */ -#define FSL_FEATURE_SIM_FCFG_HAS_PFLSH (0) -/* @brief Has program flash swapping (register bit FCFG2[SWAPPFLSH]). */ -#define FSL_FEATURE_SIM_FCFG_HAS_PFLSH_SWAP (0) -/* @brief Has miscellanious control register (register MCR). */ -#define FSL_FEATURE_SIM_HAS_MISC_CONTROLS (0) -/* @brief Has COP watchdog (registers COPC and SRVCOP). */ -#define FSL_FEATURE_SIM_HAS_COP_WATCHDOG (1) -/* @brief Has COP watchdog stop (register bits COPC[COPSTPEN], COPC[COPDBGEN] and COPC[COPCLKSEL]). */ -#define FSL_FEATURE_SIM_HAS_COP_STOP (1) -/* @brief Has LLWU clock gate bit (e.g SIM_SCGC4). */ -#define FSL_FEATURE_SIM_HAS_SCGC_LLWU (0) -/* @brief Has UIDH registers. */ -#define FSL_FEATURE_SIM_HAS_UIDH (0) -/* @brief Has UIDM registers. */ -#define FSL_FEATURE_SIM_HAS_UIDM (0) - -/* SMC module features */ - -/* @brief Has partial stop option (register bit STOPCTRL[PSTOPO]). */ -#define FSL_FEATURE_SMC_HAS_PSTOPO (1) -/* @brief Has LPO power option (register bit STOPCTRL[LPOPO]). */ -#define FSL_FEATURE_SMC_HAS_LPOPO (0) -/* @brief Has POR power option (register bit STOPCTRL[PORPO] or VLLSCTRL[PORPO]). */ -#define FSL_FEATURE_SMC_HAS_PORPO (1) -/* @brief Has low power wakeup on interrupt (register bit PMCTRL[LPWUI]). */ -#define FSL_FEATURE_SMC_HAS_LPWUI (0) -/* @brief Has LLS or VLLS mode control (register bit STOPCTRL[LLSM]). */ -#define FSL_FEATURE_SMC_HAS_LLS_SUBMODE (0) -/* @brief Has VLLS mode control (register bit VLLSCTRL[VLLSM]). */ -#define FSL_FEATURE_SMC_USE_VLLSCTRL_REG (0) -/* @brief Has VLLS mode control (register bit STOPCTRL[VLLSM]). */ -#define FSL_FEATURE_SMC_USE_STOPCTRL_VLLSM (1) -/* @brief Has RAM partition 2 power option (register bit STOPCTRL[RAM2PO]). */ -#define FSL_FEATURE_SMC_HAS_RAM2_POWER_OPTION (0) -/* @brief Has high speed run mode (register bit PMPROT[AHSRUN]). */ -#define FSL_FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE (0) -/* @brief Has low leakage stop mode (register bit PMPROT[ALLS]). */ -#define FSL_FEATURE_SMC_HAS_LOW_LEAKAGE_STOP_MODE (1) -/* @brief Has very low leakage stop mode (register bit PMPROT[AVLLS]). */ -#define FSL_FEATURE_SMC_HAS_VERY_LOW_LEAKAGE_STOP_MODE (1) -/* @brief Has stop submode. */ -#define FSL_FEATURE_SMC_HAS_SUB_STOP_MODE (1) -/* @brief Has stop submode 0(VLLS0). */ -#define FSL_FEATURE_SMC_HAS_STOP_SUBMODE0 (1) -/* @brief Has stop submode 1(VLLS1). */ -#define FSL_FEATURE_SMC_HAS_STOP_SUBMODE1 (1) -/* @brief Has stop submode 2(VLLS2). */ -#define FSL_FEATURE_SMC_HAS_STOP_SUBMODE2 (0) -/* @brief Has SMC_PARAM. */ -#define FSL_FEATURE_SMC_HAS_PARAM (0) -/* @brief Has SMC_VERID. */ -#define FSL_FEATURE_SMC_HAS_VERID (0) -/* @brief Has stop abort flag (register bit PMCTRL[STOPA]). */ -#define FSL_FEATURE_SMC_HAS_PMCTRL_STOPA (1) -/* @brief Has tamper reset (register bit SRS[TAMPER]). */ -#define FSL_FEATURE_SMC_HAS_SRS_TAMPER (0) -/* @brief Has security violation reset (register bit SRS[SECVIO]). */ -#define FSL_FEATURE_SMC_HAS_SRS_SECVIO (0) -/* @brief Width of SMC registers. */ -#define FSL_FEATURE_SMC_REG_WIDTH (8) - -/* SPI module features */ - -/* @brief Capacity (number of entries) of the transmit/receive FIFO (or zero if no FIFO is available). */ -#define FSL_FEATURE_SPI_HAS_FIFO (1) -/* @brief Has DMA support (register bit fields C2[RXDMAE] and C2[TXDMAE]). */ -#define FSL_FEATURE_SPI_HAS_DMA_SUPPORT (1) -/* @brief Has separate DMA RX and TX requests. */ -#define FSL_FEATURE_SPI_HAS_SEPARATE_DMA_RX_TX_REQn(x) (1) -/* @brief Receive/transmit FIFO size in number of 16-bit communication items. */ -#define FSL_FEATURE_SPI_FIFO_SIZEn(x) \ - (((x) == SPI0) ? (0) : \ - (((x) == SPI1) ? (4) : (-1))) -/* @brief Maximum transfer data width in bits. */ -#define FSL_FEATURE_SPI_MAX_DATA_WIDTH (16) -/* @brief The data register name has postfix (L as low and H as high). */ -#define FSL_FEATURE_SPI_DATA_REGISTER_HAS_POSTFIX (1) -/* @brief Has separated TXDATA and CMD FIFOs (register SREX). */ -#define FSL_FEATURE_SPI_HAS_SEPARATE_TXDATA_CMD_FIFO (0) -/* @brief Has 16-bit data transfer support. */ -#define FSL_FEATURE_SPI_16BIT_TRANSFERS (1) - -/* SysTick module features */ - -/* @brief Systick has external reference clock. */ -#define FSL_FEATURE_SYSTICK_HAS_EXT_REF (1) -/* @brief Systick external reference clock is core clock divided by this value. */ -#define FSL_FEATURE_SYSTICK_EXT_REF_CORE_DIV (16) - -/* TPM module features */ - -/* @brief Bus clock is the source clock for the module. */ -#define FSL_FEATURE_TPM_BUS_CLOCK (0) -/* @brief Number of channels. */ -#define FSL_FEATURE_TPM_CHANNEL_COUNTn(x) \ - (((x) == TPM0) ? (6) : \ - (((x) == TPM1) ? (2) : \ - (((x) == TPM2) ? (2) : (-1)))) -/* @brief Has counter reset by the selected input capture event (register bits C0SC[ICRST], C1SC[ICRST], ...). */ -#define FSL_FEATURE_TPM_HAS_COUNTER_RESET_BY_CAPTURE_EVENT (0) -/* @brief Has TPM_PARAM. */ -#define FSL_FEATURE_TPM_HAS_PARAM (0) -/* @brief Has TPM_VERID. */ -#define FSL_FEATURE_TPM_HAS_VERID (0) -/* @brief Has TPM_GLOBAL. */ -#define FSL_FEATURE_TPM_HAS_GLOBAL (0) -/* @brief Has TPM_TRIG. */ -#define FSL_FEATURE_TPM_HAS_TRIG (0) -/* @brief Whether TRIG register has effect. */ -#define FSL_FEATURE_TPM_TRIG_HAS_EFFECTn(x) \ - (((x) == TPM0) ? (1) : \ - (((x) == TPM1) ? (0) : \ - (((x) == TPM2) ? (0) : (-1)))) -/* @brief Has counter pause on trigger. */ -#define FSL_FEATURE_TPM_HAS_PAUSE_COUNTER_ON_TRIGGER (1) -/* @brief Has external trigger selection. */ -#define FSL_FEATURE_TPM_HAS_EXTERNAL_TRIGGER_SELECTION (1) -/* @brief Has TPM_COMBINE register. */ -#define FSL_FEATURE_TPM_HAS_COMBINE (0) -/* @brief Whether COMBINE register has effect. */ -#define FSL_FEATURE_TPM_COMBINE_HAS_EFFECTn(x) (0) -/* @brief Has TPM_POL. */ -#define FSL_FEATURE_TPM_HAS_POL (1) -/* @brief Whether POL register has effect. */ -#define FSL_FEATURE_TPM_POL_HAS_EFFECTn(x) (1) -/* @brief Has TPM_FILTER register. */ -#define FSL_FEATURE_TPM_HAS_FILTER (0) -/* @brief Whether FILTER register has effect. */ -#define FSL_FEATURE_TPM_FILTER_HAS_EFFECTn(x) (0) -/* @brief Has TPM_QDCTRL register. */ -#define FSL_FEATURE_TPM_HAS_QDCTRL (0) -/* @brief Whether QDCTRL register has effect. */ -#define FSL_FEATURE_TPM_QDCTRL_HAS_EFFECTn(x) (0) -/* @brief Is affected by errata with ID 050050 (Incorrect duty output when EPWM mode is set to PS=0 during write 1 to CnV register). */ -#define FSL_FEATURE_TPM_HAS_ERRATA_050050 (0) -/* @brief Whether 32 bits counter has effect. */ -#define FSL_FEATURE_TPM_HAS_32BIT_COUNTERn(x) (0) - -/* UART module features */ - -/* @brief Has receive FIFO overflow detection (bit field CFIFO[RXOFE]). */ -#define FSL_FEATURE_UART_HAS_IRQ_EXTENDED_FUNCTIONS (0) -/* @brief Has low power features (can be enabled in wait mode via register bit C1[DOZEEN] or CTRL[DOZEEN] if the registers are 32-bit wide). */ -#define FSL_FEATURE_UART_HAS_LOW_POWER_UART_SUPPORT (0) -/* @brief Has extended data register ED (or extra flags in the DATA register if the registers are 32-bit wide). */ -#define FSL_FEATURE_UART_HAS_EXTENDED_DATA_REGISTER_FLAGS (0) -/* @brief Capacity (number of entries) of the transmit/receive FIFO (or zero if no FIFO is available). */ -#define FSL_FEATURE_UART_HAS_FIFO (0) -/* @brief Hardware flow control (RTS, CTS) is supported. */ -#define FSL_FEATURE_UART_HAS_MODEM_SUPPORT (0) -/* @brief Infrared (modulation) is supported. */ -#define FSL_FEATURE_UART_HAS_IR_SUPPORT (0) -/* @brief 2 bits long stop bit is available. */ -#define FSL_FEATURE_UART_HAS_STOP_BIT_CONFIG_SUPPORT (0) -/* @brief If 10-bit mode is supported. */ -#define FSL_FEATURE_UART_HAS_10BIT_DATA_SUPPORT (1) -/* @brief Baud rate fine adjustment is available. */ -#define FSL_FEATURE_UART_HAS_BAUD_RATE_FINE_ADJUST_SUPPORT (1) -/* @brief Baud rate oversampling is available (has bit fields C4[OSR], C5[BOTHEDGE], C5[RESYNCDIS] or BAUD[OSR], BAUD[BOTHEDGE], BAUD[RESYNCDIS] if the registers are 32-bit wide). */ -#define FSL_FEATURE_UART_HAS_BAUD_RATE_OVER_SAMPLING_SUPPORT (0) -/* @brief Baud rate oversampling is available. */ -#define FSL_FEATURE_UART_HAS_RX_RESYNC_SUPPORT (0) -/* @brief Baud rate oversampling is available. */ -#define FSL_FEATURE_UART_HAS_BOTH_EDGE_SAMPLING_SUPPORT (0) -/* @brief Peripheral type. */ -#define FSL_FEATURE_UART_IS_SCI (0) -/* @brief Capacity (number of entries) of the transmit/receive FIFO (or zero if no FIFO is available). */ -#define FSL_FEATURE_UART_FIFO_SIZEn(x) (0) -/* @brief Supports two match addresses to filter incoming frames. */ -#define FSL_FEATURE_UART_HAS_ADDRESS_MATCHING (1) -/* @brief Has transmitter/receiver DMA enable bits C5[TDMAE]/C5[RDMAE] (or BAUD[TDMAE]/BAUD[RDMAE] if the registers are 32-bit wide). */ -#define FSL_FEATURE_UART_HAS_DMA_ENABLE (0) -/* @brief Has transmitter/receiver DMA select bits C4[TDMAS]/C4[RDMAS], resp. C5[TDMAS]/C5[RDMAS] if IS_SCI = 0. */ -#define FSL_FEATURE_UART_HAS_DMA_SELECT (1) -/* @brief Data character bit order selection is supported (bit field S2[MSBF] or STAT[MSBF] if the registers are 32-bit wide). */ -#define FSL_FEATURE_UART_HAS_BIT_ORDER_SELECT (1) -/* @brief Has smart card (ISO7816 protocol) support and no improved smart card support. */ -#define FSL_FEATURE_UART_HAS_SMART_CARD_SUPPORT (1) -/* @brief Has improved smart card (ISO7816 protocol) support. */ -#define FSL_FEATURE_UART_HAS_IMPROVED_SMART_CARD_SUPPORT (1) -/* @brief Has local operation network (CEA709.1-B protocol) support. */ -#define FSL_FEATURE_UART_HAS_LOCAL_OPERATION_NETWORK_SUPPORT (0) -/* @brief Has 32-bit registers (BAUD, STAT, CTRL, DATA, MATCH, MODIR) instead of 8-bit (BDH, BDL, C1, S1, D, etc.). */ -#define FSL_FEATURE_UART_HAS_32BIT_REGISTERS (0) -/* @brief Lin break detect available (has bit BDH[LBKDIE]). */ -#define FSL_FEATURE_UART_HAS_LIN_BREAK_DETECT (0) -/* @brief UART stops in Wait mode available (has bit C1[UARTSWAI]). */ -#define FSL_FEATURE_UART_HAS_WAIT_MODE_OPERATION (0) -/* @brief Has separate DMA RX and TX requests. */ -#define FSL_FEATURE_UART_HAS_SEPARATE_DMA_RX_TX_REQn(x) (1) - -/* USB module features */ - -/* @brief KHCI module instance count */ -#define FSL_FEATURE_USB_KHCI_COUNT (1) -/* @brief HOST mode enabled */ -#define FSL_FEATURE_USB_KHCI_HOST_ENABLED (0) -/* @brief OTG mode enabled */ -#define FSL_FEATURE_USB_KHCI_OTG_ENABLED (0) -/* @brief Size of the USB dedicated RAM */ -#define FSL_FEATURE_USB_KHCI_USB_RAM (0) -/* @brief Has KEEP_ALIVE_CTRL register */ -#define FSL_FEATURE_USB_KHCI_KEEP_ALIVE_ENABLED (0) -/* @brief Has the Dynamic SOF threshold compare support */ -#define FSL_FEATURE_USB_KHCI_DYNAMIC_SOF_THRESHOLD_COMPARE_ENABLED (0) -/* @brief Has the VBUS detect support */ -#define FSL_FEATURE_USB_KHCI_VBUS_DETECT_ENABLED (0) -/* @brief Has the IRC48M module clock support */ -#define FSL_FEATURE_USB_KHCI_IRC48M_MODULE_CLOCK_ENABLED (1) -/* @brief Number of endpoints supported */ -#define FSL_FEATURE_USB_ENDPT_COUNT (16) -/* @brief Has STALL_IL/OL_DIS registers */ -#define FSL_FEATURE_USB_KHCI_HAS_STALL_LOW (0) -/* @brief Has STALL_IH/OH_DIS registers */ -#define FSL_FEATURE_USB_KHCI_HAS_STALL_HIGH (0) - -/* VREF module features */ - -/* @brief Has chop oscillator (bit TRM[CHOPEN]) */ -#define FSL_FEATURE_VREF_HAS_CHOP_OSC (1) -/* @brief Has second order curvature compensation (bit SC[ICOMPEN]) */ -#define FSL_FEATURE_VREF_HAS_COMPENSATION (1) -/* @brief If high/low buffer mode supported */ -#define FSL_FEATURE_VREF_MODE_LV_TYPE (1) -/* @brief Module has also low reference (registers VREFL/VREFH) */ -#define FSL_FEATURE_VREF_HAS_LOW_REFERENCE (0) -/* @brief Has VREF_TRM4. */ -#define FSL_FEATURE_VREF_HAS_TRM4 (0) - -#endif /* _MCXC444_FEATURES_H_ */ - diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/arm/startup_MCXC444.S b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/arm/startup_MCXC444.S deleted file mode 100644 index f60728f00fe..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/arm/startup_MCXC444.S +++ /dev/null @@ -1,315 +0,0 @@ -/* ------------------------------------------------------------------------- */ -/* @file: startup_MCXC444.s */ -/* @purpose: CMSIS Cortex-M0P Core Device Startup File */ -/* MCXC444 */ -/* @version: 1.0 */ -/* @date: 2024-3-11 */ -/* @build: b240401 */ -/* ------------------------------------------------------------------------- */ -/* */ -/* Copyright 1997-2016 Freescale Semiconductor, Inc. */ -/* Copyright 2016-2024 NXP */ -/* SPDX-License-Identifier: BSD-3-Clause */ -/*****************************************************************************/ -/* Version: GCC for ARM Embedded Processors */ -/*****************************************************************************/ - .syntax unified - .arch armv6-m - .eabi_attribute Tag_ABI_align_preserved, 1 /*8-byte alignment */ - - .section .isr_vector, "a" - .align 2 - .globl __Vectors -__Vectors: - .long Image$$ARM_LIB_STACK$$ZI$$Limit /* Top of Stack */ - .long Reset_Handler /* Reset Handler */ - .long NMI_Handler /* NMI Handler*/ - .long HardFault_Handler /* Hard Fault Handler*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long SVC_Handler /* SVCall Handler*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long PendSV_Handler /* PendSV Handler*/ - .long SysTick_Handler /* SysTick Handler*/ - - /* External Interrupts*/ - .long DMA0_IRQHandler /* DMA channel 0 transfer complete*/ - .long DMA1_IRQHandler /* DMA channel 1 transfer complete*/ - .long DMA2_IRQHandler /* DMA channel 2 transfer complete*/ - .long DMA3_IRQHandler /* DMA channel 3 transfer complete*/ - .long Reserved20_IRQHandler /* Reserved interrupt*/ - .long FTFA_IRQHandler /* Command complete and read collision*/ - .long PMC_IRQHandler /* Low-voltage detect, low-voltage warning*/ - .long LLWU_IRQHandler /* Low leakage wakeup*/ - .long I2C0_IRQHandler /* I2C0 interrupt*/ - .long I2C1_IRQHandler /* I2C1 interrupt*/ - .long SPI0_IRQHandler /* SPI0 single interrupt vector for all sources*/ - .long SPI1_IRQHandler /* SPI1 single interrupt vector for all sources*/ - .long LPUART0_IRQHandler /* LPUART0 status and error*/ - .long LPUART1_IRQHandler /* LPUART1 status and error*/ - .long UART2_FLEXIO_IRQHandler /* UART2 or FLEXIO*/ - .long ADC0_IRQHandler /* ADC0 interrupt*/ - .long CMP0_IRQHandler /* CMP0 interrupt*/ - .long TPM0_IRQHandler /* TPM0 single interrupt vector for all sources*/ - .long TPM1_IRQHandler /* TPM1 single interrupt vector for all sources*/ - .long TPM2_IRQHandler /* TPM2 single interrupt vector for all sources*/ - .long RTC_IRQHandler /* RTC alarm*/ - .long RTC_Seconds_IRQHandler /* RTC seconds*/ - .long PIT_IRQHandler /* PIT interrupt*/ - .long I2S0_IRQHandler /* I2S0 interrupt*/ - .long USB0_IRQHandler /* USB0 interrupt*/ - .long DAC0_IRQHandler /* DAC0 interrupt*/ - .long Reserved42_IRQHandler /* Reserved interrupt*/ - .long Reserved43_IRQHandler /* Reserved interrupt*/ - .long LPTMR0_IRQHandler /* LPTMR0 interrupt*/ - .long LCD_IRQHandler /* LCD interrupt*/ - .long PORTA_IRQHandler /* PORTA Pin detect*/ - .long PORTC_PORTD_IRQHandler /* Single interrupt vector for PORTC; PORTD Pin detect*/ - - .size __Vectors, . - __Vectors - -/* Flash Configuration */ - .section .FlashConfig, "a" - .long 0xFFFFFFFF - .long 0xFFFFFFFF - .long 0xFFFFFFFF - .long 0xFFFF3FFE - - .text - .thumb - -/* Reset Handler */ - - .thumb_func - .align 2 - .weak Reset_Handler - .type Reset_Handler, %function -Reset_Handler: - cpsid i /* Mask interrupts */ - .equ VTOR, 0xE000ED08 - ldr r0, =VTOR - ldr r1, =__Vectors - str r1, [r0] - ldr r2, [r1] - msr msp, r2 - ldr r0,=SystemInit - blx r0 - cpsie i /* Unmask interrupts */ - ldr r0,=__main - bx r0 - - .pool - .size Reset_Handler, . - Reset_Handler - - .align 1 - .thumb_func - .weak DefaultISR - .type DefaultISR, %function -DefaultISR: - ldr r0, =DefaultISR - bx r0 - .size DefaultISR, . - DefaultISR - - .align 1 - .thumb_func - .weak NMI_Handler - .type NMI_Handler, %function -NMI_Handler: - ldr r0,=NMI_Handler - bx r0 - .size NMI_Handler, . - NMI_Handler - - .align 1 - .thumb_func - .weak HardFault_Handler - .type HardFault_Handler, %function -HardFault_Handler: - ldr r0,=HardFault_Handler - bx r0 - .size HardFault_Handler, . - HardFault_Handler - - .align 1 - .thumb_func - .weak SVC_Handler - .type SVC_Handler, %function -SVC_Handler: - ldr r0,=SVC_Handler - bx r0 - .size SVC_Handler, . - SVC_Handler - - .align 1 - .thumb_func - .weak PendSV_Handler - .type PendSV_Handler, %function -PendSV_Handler: - ldr r0,=PendSV_Handler - bx r0 - .size PendSV_Handler, . - PendSV_Handler - - .align 1 - .thumb_func - .weak SysTick_Handler - .type SysTick_Handler, %function -SysTick_Handler: - ldr r0,=SysTick_Handler - bx r0 - .size SysTick_Handler, . - SysTick_Handler - - .align 1 - .thumb_func - .weak DMA0_IRQHandler - .type DMA0_IRQHandler, %function -DMA0_IRQHandler: - ldr r0,=DMA0_DriverIRQHandler - bx r0 - .size DMA0_IRQHandler, . - DMA0_IRQHandler - - .align 1 - .thumb_func - .weak DMA1_IRQHandler - .type DMA1_IRQHandler, %function -DMA1_IRQHandler: - ldr r0,=DMA1_DriverIRQHandler - bx r0 - .size DMA1_IRQHandler, . - DMA1_IRQHandler - - .align 1 - .thumb_func - .weak DMA2_IRQHandler - .type DMA2_IRQHandler, %function -DMA2_IRQHandler: - ldr r0,=DMA2_DriverIRQHandler - bx r0 - .size DMA2_IRQHandler, . - DMA2_IRQHandler - - .align 1 - .thumb_func - .weak DMA3_IRQHandler - .type DMA3_IRQHandler, %function -DMA3_IRQHandler: - ldr r0,=DMA3_DriverIRQHandler - bx r0 - .size DMA3_IRQHandler, . - DMA3_IRQHandler - - .align 1 - .thumb_func - .weak I2C0_IRQHandler - .type I2C0_IRQHandler, %function -I2C0_IRQHandler: - ldr r0,=I2C0_DriverIRQHandler - bx r0 - .size I2C0_IRQHandler, . - I2C0_IRQHandler - - .align 1 - .thumb_func - .weak I2C1_IRQHandler - .type I2C1_IRQHandler, %function -I2C1_IRQHandler: - ldr r0,=I2C1_DriverIRQHandler - bx r0 - .size I2C1_IRQHandler, . - I2C1_IRQHandler - - .align 1 - .thumb_func - .weak SPI0_IRQHandler - .type SPI0_IRQHandler, %function -SPI0_IRQHandler: - ldr r0,=SPI0_DriverIRQHandler - bx r0 - .size SPI0_IRQHandler, . - SPI0_IRQHandler - - .align 1 - .thumb_func - .weak SPI1_IRQHandler - .type SPI1_IRQHandler, %function -SPI1_IRQHandler: - ldr r0,=SPI1_DriverIRQHandler - bx r0 - .size SPI1_IRQHandler, . - SPI1_IRQHandler - - .align 1 - .thumb_func - .weak LPUART0_IRQHandler - .type LPUART0_IRQHandler, %function -LPUART0_IRQHandler: - ldr r0,=LPUART0_DriverIRQHandler - bx r0 - .size LPUART0_IRQHandler, . - LPUART0_IRQHandler - - .align 1 - .thumb_func - .weak LPUART1_IRQHandler - .type LPUART1_IRQHandler, %function -LPUART1_IRQHandler: - ldr r0,=LPUART1_DriverIRQHandler - bx r0 - .size LPUART1_IRQHandler, . - LPUART1_IRQHandler - - .align 1 - .thumb_func - .weak UART2_FLEXIO_IRQHandler - .type UART2_FLEXIO_IRQHandler, %function -UART2_FLEXIO_IRQHandler: - ldr r0,=UART2_FLEXIO_DriverIRQHandler - bx r0 - .size UART2_FLEXIO_IRQHandler, . - UART2_FLEXIO_IRQHandler - - .align 1 - .thumb_func - .weak I2S0_IRQHandler - .type I2S0_IRQHandler, %function -I2S0_IRQHandler: - ldr r0,=I2S0_DriverIRQHandler - bx r0 - .size I2S0_IRQHandler, . - I2S0_IRQHandler - - -/* Macro to define default handlers. Default handler - * will be weak symbol and just dead loops. They can be - * overwritten by other handlers */ - .macro def_irq_handler handler_name - .weak \handler_name - .set \handler_name, DefaultISR - .endm - -/* Exception Handlers */ - def_irq_handler DMA0_DriverIRQHandler - def_irq_handler DMA1_DriverIRQHandler - def_irq_handler DMA2_DriverIRQHandler - def_irq_handler DMA3_DriverIRQHandler - def_irq_handler Reserved20_IRQHandler - def_irq_handler FTFA_IRQHandler - def_irq_handler PMC_IRQHandler - def_irq_handler LLWU_IRQHandler - def_irq_handler I2C0_DriverIRQHandler - def_irq_handler I2C1_DriverIRQHandler - def_irq_handler SPI0_DriverIRQHandler - def_irq_handler SPI1_DriverIRQHandler - def_irq_handler LPUART0_DriverIRQHandler - def_irq_handler LPUART1_DriverIRQHandler - def_irq_handler UART2_FLEXIO_DriverIRQHandler - def_irq_handler ADC0_IRQHandler - def_irq_handler CMP0_IRQHandler - def_irq_handler TPM0_IRQHandler - def_irq_handler TPM1_IRQHandler - def_irq_handler TPM2_IRQHandler - def_irq_handler RTC_IRQHandler - def_irq_handler RTC_Seconds_IRQHandler - def_irq_handler PIT_IRQHandler - def_irq_handler I2S0_DriverIRQHandler - def_irq_handler USB0_IRQHandler - def_irq_handler DAC0_IRQHandler - def_irq_handler Reserved42_IRQHandler - def_irq_handler Reserved43_IRQHandler - def_irq_handler LPTMR0_IRQHandler - def_irq_handler LCD_IRQHandler - def_irq_handler PORTA_IRQHandler - def_irq_handler PORTC_PORTD_IRQHandler - - .end diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_adc16.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_adc16.c deleted file mode 100644 index 402e5641326..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_adc16.c +++ /dev/null @@ -1,501 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_adc16.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.adc16" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Get instance number for ADC16 module. - * - * @param base ADC16 peripheral base address - */ -static uint32_t ADC16_GetInstance(ADC_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to ADC16 bases for each instance. */ -static ADC_Type *const s_adc16Bases[] = ADC_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to ADC16 clocks for each instance. */ -static const clock_ip_name_t s_adc16Clocks[] = ADC16_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t ADC16_GetInstance(ADC_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_adc16Bases); instance++) - { - if (s_adc16Bases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_adc16Bases)); - - return instance; -} - -/*! - * brief Initializes the ADC16 module. - * - * param base ADC16 peripheral base address. - * param config Pointer to configuration structure. See "adc16_config_t". - */ -void ADC16_Init(ADC_Type *base, const adc16_config_t *config) -{ - assert(NULL != config); - - uint32_t tmp32; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock. */ - CLOCK_EnableClock(s_adc16Clocks[ADC16_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* ADCx_CFG1. */ - tmp32 = ADC_CFG1_ADICLK(config->clockSource) | ADC_CFG1_MODE(config->resolution); - if (kADC16_LongSampleDisabled != config->longSampleMode) - { - tmp32 |= ADC_CFG1_ADLSMP_MASK; - } - tmp32 |= ADC_CFG1_ADIV(config->clockDivider); - if (true == config->enableLowPower) - { - tmp32 |= ADC_CFG1_ADLPC_MASK; - } - base->CFG1 = tmp32; - - /* ADCx_CFG2. */ - tmp32 = base->CFG2 & ~(ADC_CFG2_ADACKEN_MASK | ADC_CFG2_ADHSC_MASK | ADC_CFG2_ADLSTS_MASK); - if (kADC16_LongSampleDisabled != config->longSampleMode) - { - tmp32 |= ADC_CFG2_ADLSTS(config->longSampleMode); - } - if (true == config->enableHighSpeed) - { - tmp32 |= ADC_CFG2_ADHSC_MASK; - } - if (true == config->enableAsynchronousClock) - { - tmp32 |= ADC_CFG2_ADACKEN_MASK; - } - base->CFG2 = tmp32; - - /* ADCx_SC2. */ - tmp32 = base->SC2 & ~(ADC_SC2_REFSEL_MASK); - tmp32 |= ADC_SC2_REFSEL(config->referenceVoltageSource); - base->SC2 = tmp32; - - /* ADCx_SC3. */ - if (true == config->enableContinuousConversion) - { - base->SC3 |= ADC_SC3_ADCO_MASK; - } - else - { - base->SC3 &= ~ADC_SC3_ADCO_MASK; - } - -#if defined(FSL_FEATURE_ADC16_HAS_HW_AVERAGE) && FSL_FEATURE_ADC16_HAS_HW_AVERAGE - ADC16_SetHardwareAverage(base, config->hardwareAverageMode); -#endif /* FSL_FEATURE_ADC16_HAS_HW_AVERAGE */ -} - -/*! - * brief De-initializes the ADC16 module. - * - * param base ADC16 peripheral base address. - */ -void ADC16_Deinit(ADC_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable the clock. */ - CLOCK_DisableClock(s_adc16Clocks[ADC16_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Gets an available pre-defined settings for the converter's configuration. - * - * This function initializes the converter configuration structure with available settings. The default values are as - * follows. - * code - * config->referenceVoltageSource = kADC16_ReferenceVoltageSourceVref; - * config->clockSource = kADC16_ClockSourceAsynchronousClock; - * config->enableAsynchronousClock = false; - * config->clockDivider = kADC16_ClockDivider8; - * config->resolution = kADC16_ResolutionSE12Bit; - * config->longSampleMode = kADC16_LongSampleDisabled; - * config->enableHighSpeed = false; - * config->enableLowPower = false; - * config->enableContinuousConversion = false; - * endcode - * param config Pointer to the configuration structure. - */ -void ADC16_GetDefaultConfig(adc16_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->referenceVoltageSource = kADC16_ReferenceVoltageSourceVref; - config->clockSource = kADC16_ClockSourceAsynchronousClock; - config->enableAsynchronousClock = false; - config->clockDivider = kADC16_ClockDivider8; - config->resolution = kADC16_ResolutionSE12Bit; - config->longSampleMode = kADC16_LongSampleDisabled; - config->enableHighSpeed = false; - config->enableLowPower = false; - config->enableContinuousConversion = false; -#if defined(FSL_FEATURE_ADC16_HAS_HW_AVERAGE) && FSL_FEATURE_ADC16_HAS_HW_AVERAGE - config->hardwareAverageMode = kADC16_HardwareAverageDisabled; -#endif /* FSL_FEATURE_ADC16_HAS_HW_AVERAGE */ -} - -#if defined(FSL_FEATURE_ADC16_HAS_CALIBRATION) && FSL_FEATURE_ADC16_HAS_CALIBRATION -/*! - * brief Automates the hardware calibration. - * - * This auto calibration helps to adjust the plus/minus side gain automatically. - * Execute the calibration before using the converter. Note that the hardware trigger should be used - * during the calibration. - * - * param base ADC16 peripheral base address. - * - * return Execution status. - * retval kStatus_Success Calibration is done successfully. - * retval kStatus_Fail Calibration has failed. - */ -status_t ADC16_DoAutoCalibration(ADC_Type *base) -{ - bool bHWTrigger = false; - uint32_t tmp32; - status_t status = kStatus_Success; - - /* The calibration would be failed when in hardwar mode. - * Remember the hardware trigger state here and restore it later if the hardware trigger is enabled.*/ - if (0U != (ADC_SC2_ADTRG_MASK & base->SC2)) - { - bHWTrigger = true; - base->SC2 &= ~ADC_SC2_ADTRG_MASK; - } - - /* Clear the CALF and launch the calibration. */ - base->SC3 |= ADC_SC3_CAL_MASK | ADC_SC3_CALF_MASK; - while (0U == ((uint32_t)kADC16_ChannelConversionDoneFlag & ADC16_GetChannelStatusFlags(base, 0U))) - { - /* Check the CALF when the calibration is active. */ - if (0U != ((uint32_t)kADC16_CalibrationFailedFlag & ADC16_GetStatusFlags(base))) - { - status = kStatus_Fail; - break; - } - } - (void)base->R[0]; /* Dummy read to clear COCO caused by calibration. */ - - /* Restore the hardware trigger setting if it was enabled before. */ - if (bHWTrigger) - { - base->SC2 |= ADC_SC2_ADTRG_MASK; - } - /* Check the CALF at the end of calibration. */ - if (0U != ((uint32_t)kADC16_CalibrationFailedFlag & ADC16_GetStatusFlags(base))) - { - status = kStatus_Fail; - } - if (kStatus_Success != status) /* Check if the calibration process is succeed. */ - { - return status; - } - - /* Calculate the calibration values. */ - tmp32 = base->CLP0; - tmp32 += base->CLP1; - tmp32 += base->CLP2; - tmp32 += base->CLP3; - tmp32 += base->CLP4; - tmp32 += base->CLPS; - tmp32 = 0x8000U | (tmp32 >> 1U); - base->PG = tmp32; - -#if defined(FSL_FEATURE_ADC16_HAS_DIFF_MODE) && FSL_FEATURE_ADC16_HAS_DIFF_MODE - tmp32 = base->CLM0; - tmp32 += base->CLM1; - tmp32 += base->CLM2; - tmp32 += base->CLM3; - tmp32 += base->CLM4; - tmp32 += base->CLMS; - tmp32 = 0x8000U | (tmp32 >> 1U); - base->MG = tmp32; -#endif /* FSL_FEATURE_ADC16_HAS_DIFF_MODE */ - - return kStatus_Success; -} -#endif /* FSL_FEATURE_ADC16_HAS_CALIBRATION */ - -#if defined(FSL_FEATURE_ADC16_HAS_MUX_SELECT) && FSL_FEATURE_ADC16_HAS_MUX_SELECT -/*! - * brief Sets the channel mux mode. - * - * Some sample pins share the same channel index. The channel mux mode decides which pin is used for an - * indicated channel. - * - * param base ADC16 peripheral base address. - * param mode Setting channel mux mode. See "adc16_channel_mux_mode_t". - */ -void ADC16_SetChannelMuxMode(ADC_Type *base, adc16_channel_mux_mode_t mode) -{ - if (kADC16_ChannelMuxA == mode) - { - base->CFG2 &= ~ADC_CFG2_MUXSEL_MASK; - } - else /* kADC16_ChannelMuxB. */ - { - base->CFG2 |= ADC_CFG2_MUXSEL_MASK; - } -} -#endif /* FSL_FEATURE_ADC16_HAS_MUX_SELECT */ - -/*! - * brief Configures the hardware compare mode. - * - * The hardware compare mode provides a way to process the conversion result automatically by using hardware. Only the - * result - * in the compare range is available. To compare the range, see "adc16_hardware_compare_mode_t" or the appopriate - * reference - * manual for more information. - * - * param base ADC16 peripheral base address. - * param config Pointer to the "adc16_hardware_compare_config_t" structure. Passing "NULL" disables the feature. - */ -void ADC16_SetHardwareCompareConfig(ADC_Type *base, const adc16_hardware_compare_config_t *config) -{ - uint32_t tmp32 = base->SC2 & ~(ADC_SC2_ACFE_MASK | ADC_SC2_ACFGT_MASK | ADC_SC2_ACREN_MASK); - - if (NULL == config) /* Pass "NULL" to disable the feature. */ - { - base->SC2 = tmp32; - return; - } - /* Enable the feature. */ - tmp32 |= ADC_SC2_ACFE_MASK; - - /* Select the hardware compare working mode. */ - switch (config->hardwareCompareMode) - { - case kADC16_HardwareCompareMode0: - break; - case kADC16_HardwareCompareMode1: - tmp32 |= ADC_SC2_ACFGT_MASK; - break; - case kADC16_HardwareCompareMode2: - tmp32 |= ADC_SC2_ACREN_MASK; - break; - case kADC16_HardwareCompareMode3: - tmp32 |= ADC_SC2_ACFGT_MASK | ADC_SC2_ACREN_MASK; - break; - default: - assert(false); - break; - } - base->SC2 = tmp32; - - /* Load the compare values. */ - base->CV1 = ADC_CV1_CV(config->value1); - base->CV2 = ADC_CV2_CV(config->value2); -} - -#if defined(FSL_FEATURE_ADC16_HAS_HW_AVERAGE) && FSL_FEATURE_ADC16_HAS_HW_AVERAGE -/*! - * brief Sets the hardware average mode. - * - * The hardware average mode provides a way to process the conversion result automatically by using hardware. The - * multiple - * conversion results are accumulated and averaged internally making them easier to read. - * - * param base ADC16 peripheral base address. - * param mode Setting the hardware average mode. See "adc16_hardware_average_mode_t". - */ -void ADC16_SetHardwareAverage(ADC_Type *base, adc16_hardware_average_mode_t mode) -{ - uint32_t tmp32 = base->SC3 & ~(ADC_SC3_AVGE_MASK | ADC_SC3_AVGS_MASK); - - if (kADC16_HardwareAverageDisabled != mode) - { - tmp32 |= ADC_SC3_AVGE_MASK | ADC_SC3_AVGS(mode); - } - base->SC3 = tmp32; -} -#endif /* FSL_FEATURE_ADC16_HAS_HW_AVERAGE */ - -#if defined(FSL_FEATURE_ADC16_HAS_PGA) && FSL_FEATURE_ADC16_HAS_PGA -/*! - * brief Configures the PGA for the converter's front end. - * - * param base ADC16 peripheral base address. - * param config Pointer to the "adc16_pga_config_t" structure. Passing "NULL" disables the feature. - */ -void ADC16_SetPGAConfig(ADC_Type *base, const adc16_pga_config_t *config) -{ - uint32_t tmp32; - - if (!config) /* Passing "NULL" is to disable the feature. */ - { - base->PGA = 0U; - return; - } - - /* Enable the PGA and set the gain value. */ - tmp32 = ADC_PGA_PGAEN_MASK | ADC_PGA_PGAG(config->pgaGain); - - /* Configure the misc features for PGA. */ - if (config->enableRunInNormalMode) - { - tmp32 |= ADC_PGA_PGALPb_MASK; - } -#if defined(FSL_FEATURE_ADC16_HAS_PGA_CHOPPING) && FSL_FEATURE_ADC16_HAS_PGA_CHOPPING - if (config->disablePgaChopping) - { - tmp32 |= ADC_PGA_PGACHPb_MASK; - } -#endif /* FSL_FEATURE_ADC16_HAS_PGA_CHOPPING */ -#if defined(FSL_FEATURE_ADC16_HAS_PGA_OFFSET_MEASUREMENT) && FSL_FEATURE_ADC16_HAS_PGA_OFFSET_MEASUREMENT - if (config->enableRunInOffsetMeasurement) - { - tmp32 |= ADC_PGA_PGAOFSM_MASK; - } -#endif /* FSL_FEATURE_ADC16_HAS_PGA_OFFSET_MEASUREMENT */ - base->PGA = tmp32; -} -#endif /* FSL_FEATURE_ADC16_HAS_PGA */ - -/*! - * brief Gets the status flags of the converter. - * - * param base ADC16 peripheral base address. - * - * return Flags' mask if indicated flags are asserted. See "_adc16_status_flags". - */ -uint32_t ADC16_GetStatusFlags(ADC_Type *base) -{ - uint32_t ret = 0; - - if (0U != (base->SC2 & ADC_SC2_ADACT_MASK)) - { - ret |= (uint32_t)kADC16_ActiveFlag; - } -#if defined(FSL_FEATURE_ADC16_HAS_CALIBRATION) && FSL_FEATURE_ADC16_HAS_CALIBRATION - if (0U != (base->SC3 & ADC_SC3_CALF_MASK)) - { - ret |= (uint32_t)kADC16_CalibrationFailedFlag; - } -#endif /* FSL_FEATURE_ADC16_HAS_CALIBRATION */ - return ret; -} - -/*! - * brief Clears the status flags of the converter. - * - * param base ADC16 peripheral base address. - * param mask Mask value for the cleared flags. See "_adc16_status_flags". - */ -void ADC16_ClearStatusFlags(ADC_Type *base, uint32_t mask) -{ -#if defined(FSL_FEATURE_ADC16_HAS_CALIBRATION) && FSL_FEATURE_ADC16_HAS_CALIBRATION - if (0U != (mask & (uint32_t)kADC16_CalibrationFailedFlag)) - { - base->SC3 |= ADC_SC3_CALF_MASK; - } -#endif /* FSL_FEATURE_ADC16_HAS_CALIBRATION */ -} - -/*! - * brief Configures the conversion channel. - * - * This operation triggers the conversion when in software trigger mode. When in hardware trigger mode, this API - * configures the channel while the external trigger source helps to trigger the conversion. - * - * Note that the "Channel Group" has a detailed description. - * To allow sequential conversions of the ADC to be triggered by internal peripherals, the ADC has more than one - * group of status and control registers, one for each conversion. The channel group parameter indicates which group of - * registers are used, for example, channel group 0 is for Group A registers and channel group 1 is for Group B - * registers. The - * channel groups are used in a "ping-pong" approach to control the ADC operation. At any point, only one of - * the channel groups is actively controlling ADC conversions. The channel group 0 is used for both software and - * hardware - * trigger modes. Channel group 1 and greater indicates multiple channel group registers for - * use only in hardware trigger mode. See the chip configuration information in the appropriate MCU reference manual for - * the - * number of SC1n registers (channel groups) specific to this device. Channel group 1 or greater are not used - * for software trigger operation. Therefore, writing to these channel groups does not initiate a new conversion. - * Updating the channel group 0 while a different channel group is actively controlling a conversion is allowed and - * vice versa. Writing any of the channel group registers while that specific channel group is actively controlling a - * conversion aborts the current conversion. - * - * param base ADC16 peripheral base address. - * param channelGroup Channel group index. - * param config Pointer to the "adc16_channel_config_t" structure for the conversion channel. - */ -void ADC16_SetChannelConfig(ADC_Type *base, uint32_t channelGroup, const adc16_channel_config_t *config) -{ - assert(channelGroup < ADC_SC1_COUNT); - assert(NULL != config); - - uint32_t sc1 = ADC_SC1_ADCH(config->channelNumber); /* Set the channel number. */ - -#if defined(FSL_FEATURE_ADC16_HAS_DIFF_MODE) && FSL_FEATURE_ADC16_HAS_DIFF_MODE - /* Enable the differential conversion. */ - if (true == config->enableDifferentialConversion) - { - sc1 |= ADC_SC1_DIFF_MASK; - } -#endif /* FSL_FEATURE_ADC16_HAS_DIFF_MODE */ - /* Enable the interrupt when the conversion is done. */ - if (true == config->enableInterruptOnConversionCompleted) - { - sc1 |= ADC_SC1_AIEN_MASK; - } - base->SC1[channelGroup] = sc1; -} - -/*! - * brief Gets the status flags of channel. - * - * param base ADC16 peripheral base address. - * param channelGroup Channel group index. - * - * return Flags' mask if indicated flags are asserted. See "_adc16_channel_status_flags". - */ -uint32_t ADC16_GetChannelStatusFlags(ADC_Type *base, uint32_t channelGroup) -{ - assert(channelGroup < ADC_SC1_COUNT); - - uint32_t ret = 0U; - - if (0U != (base->SC1[channelGroup] & ADC_SC1_COCO_MASK)) - { - ret |= (uint32_t)kADC16_ChannelConversionDoneFlag; - } - return ret; -} diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_adc16.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_adc16.h deleted file mode 100644 index 3665e8db7d2..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_adc16.h +++ /dev/null @@ -1,537 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_ADC16_H_ -#define FSL_ADC16_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup adc16 - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief ADC16 driver version 2.3.0. */ -#define FSL_ADC16_DRIVER_VERSION (MAKE_VERSION(2, 3, 0)) - -/*! @} */ - -/*! - * @brief Channel status flags. - */ -enum _adc16_channel_status_flags -{ - kADC16_ChannelConversionDoneFlag = ADC_SC1_COCO_MASK, /*!< Conversion done. */ -}; - -/*! - * @brief Converter status flags. - */ -enum _adc16_status_flags -{ - kADC16_ActiveFlag = ADC_SC2_ADACT_MASK, /*!< Converter is active. */ -#if defined(FSL_FEATURE_ADC16_HAS_CALIBRATION) && FSL_FEATURE_ADC16_HAS_CALIBRATION - kADC16_CalibrationFailedFlag = ADC_SC3_CALF_MASK, /*!< Calibration is failed. */ -#endif /* FSL_FEATURE_ADC16_HAS_CALIBRATION */ -}; - -#if defined(FSL_FEATURE_ADC16_HAS_MUX_SELECT) && FSL_FEATURE_ADC16_HAS_MUX_SELECT -/*! - * @brief Channel multiplexer mode for each channel. - * - * For some ADC16 channels, there are two pin selections in channel multiplexer. For example, ADC0_SE4a and ADC0_SE4b - * are the different channels that share the same channel number. - */ -typedef enum _adc_channel_mux_mode -{ - kADC16_ChannelMuxA = 0U, /*!< For channel with channel mux a. */ - kADC16_ChannelMuxB = 1U, /*!< For channel with channel mux b. */ -} adc16_channel_mux_mode_t; -#endif /* FSL_FEATURE_ADC16_HAS_MUX_SELECT */ - -/*! - * @brief Clock divider for the converter. - */ -typedef enum _adc16_clock_divider -{ - kADC16_ClockDivider1 = 0U, /*!< For divider 1 from the input clock to the module. */ - kADC16_ClockDivider2 = 1U, /*!< For divider 2 from the input clock to the module. */ - kADC16_ClockDivider4 = 2U, /*!< For divider 4 from the input clock to the module. */ - kADC16_ClockDivider8 = 3U, /*!< For divider 8 from the input clock to the module. */ -} adc16_clock_divider_t; - -/*! - *@brief Converter's resolution. - */ -typedef enum _adc16_resolution -{ - /* This group of enumeration is for internal use which is related to register setting. */ - kADC16_Resolution8or9Bit = 0U, /*!< Single End 8-bit or Differential Sample 9-bit. */ - kADC16_Resolution12or13Bit = 1U, /*!< Single End 12-bit or Differential Sample 13-bit. */ - kADC16_Resolution10or11Bit = 2U, /*!< Single End 10-bit or Differential Sample 11-bit. */ - - /* This group of enumeration is for a public user. */ - kADC16_ResolutionSE8Bit = kADC16_Resolution8or9Bit, /*!< Single End 8-bit. */ - kADC16_ResolutionSE12Bit = kADC16_Resolution12or13Bit, /*!< Single End 12-bit. */ - kADC16_ResolutionSE10Bit = kADC16_Resolution10or11Bit, /*!< Single End 10-bit. */ -#if defined(FSL_FEATURE_ADC16_HAS_DIFF_MODE) && FSL_FEATURE_ADC16_HAS_DIFF_MODE - kADC16_ResolutionDF9Bit = kADC16_Resolution8or9Bit, /*!< Differential Sample 9-bit. */ - kADC16_ResolutionDF13Bit = kADC16_Resolution12or13Bit, /*!< Differential Sample 13-bit. */ - kADC16_ResolutionDF11Bit = kADC16_Resolution10or11Bit, /*!< Differential Sample 11-bit. */ -#endif /* FSL_FEATURE_ADC16_HAS_DIFF_MODE */ - -#if defined(FSL_FEATURE_ADC16_MAX_RESOLUTION) && (FSL_FEATURE_ADC16_MAX_RESOLUTION >= 16U) - /* 16-bit is supported by default. */ - kADC16_Resolution16Bit = 3U, /*!< Single End 16-bit or Differential Sample 16-bit. */ - kADC16_ResolutionSE16Bit = kADC16_Resolution16Bit, /*!< Single End 16-bit. */ -#if defined(FSL_FEATURE_ADC16_HAS_DIFF_MODE) && FSL_FEATURE_ADC16_HAS_DIFF_MODE - kADC16_ResolutionDF16Bit = kADC16_Resolution16Bit, /*!< Differential Sample 16-bit. */ -#endif /* FSL_FEATURE_ADC16_HAS_DIFF_MODE */ -#endif /* FSL_FEATURE_ADC16_MAX_RESOLUTION >= 16U */ -} adc16_resolution_t; - -/*! - * @brief Clock source. - */ -typedef enum _adc16_clock_source -{ - kADC16_ClockSourceAlt0 = 0U, /*!< Selection 0 of the clock source. */ - kADC16_ClockSourceAlt1 = 1U, /*!< Selection 1 of the clock source. */ - kADC16_ClockSourceAlt2 = 2U, /*!< Selection 2 of the clock source. */ - kADC16_ClockSourceAlt3 = 3U, /*!< Selection 3 of the clock source. */ - - /* Chip defined clock source */ - kADC16_ClockSourceAsynchronousClock = kADC16_ClockSourceAlt3, /*!< Using internal asynchronous clock. */ -} adc16_clock_source_t; - -/*! - * @brief Long sample mode. - */ -typedef enum _adc16_long_sample_mode -{ - kADC16_LongSampleCycle24 = 0U, /*!< 20 extra ADCK cycles, 24 ADCK cycles total. */ - kADC16_LongSampleCycle16 = 1U, /*!< 12 extra ADCK cycles, 16 ADCK cycles total. */ - kADC16_LongSampleCycle10 = 2U, /*!< 6 extra ADCK cycles, 10 ADCK cycles total. */ - kADC16_LongSampleCycle6 = 3U, /*!< 2 extra ADCK cycles, 6 ADCK cycles total. */ - kADC16_LongSampleDisabled = 4U, /*!< Disable the long sample feature. */ -} adc16_long_sample_mode_t; - -/*! - * @brief Reference voltage source. - */ -typedef enum _adc16_reference_voltage_source -{ - kADC16_ReferenceVoltageSourceVref = 0U, /*!< For external pins pair of VrefH and VrefL. */ - kADC16_ReferenceVoltageSourceValt = 1U, /*!< For alternate reference pair of ValtH and ValtL. */ -#if defined(FSL_FEATURE_ADC16_HAS_VREF_BANDGAP) && FSL_FEATURE_ADC16_HAS_VREF_BANDGAP - kADC16_ReferenceVoltageSourceBandgap = 2U, /*!< For bandgap voltage from PMC. */ -#endif /* FSL_FEATURE_ADC16_HAS_VREF_BANDGAP */ -} adc16_reference_voltage_source_t; - -#if defined(FSL_FEATURE_ADC16_HAS_HW_AVERAGE) && FSL_FEATURE_ADC16_HAS_HW_AVERAGE -/*! - * @brief Hardware average mode. - */ -typedef enum _adc16_hardware_average_mode -{ - kADC16_HardwareAverageCount4 = 0U, /*!< For hardware average with 4 samples. */ - kADC16_HardwareAverageCount8 = 1U, /*!< For hardware average with 8 samples. */ - kADC16_HardwareAverageCount16 = 2U, /*!< For hardware average with 16 samples. */ - kADC16_HardwareAverageCount32 = 3U, /*!< For hardware average with 32 samples. */ - kADC16_HardwareAverageDisabled = 4U, /*!< Disable the hardware average feature.*/ -} adc16_hardware_average_mode_t; -#endif /* FSL_FEATURE_ADC16_HAS_HW_AVERAGE */ - -/*! - * @brief Hardware compare mode. - */ -typedef enum _adc16_hardware_compare_mode -{ - kADC16_HardwareCompareMode0 = 0U, /*!< x < value1. */ - kADC16_HardwareCompareMode1 = 1U, /*!< x > value1. */ - kADC16_HardwareCompareMode2 = 2U, /*!< if value1 <= value2, then x < value1 || x > value2; - else, value1 > x > value2. */ - kADC16_HardwareCompareMode3 = 3U, /*!< if value1 <= value2, then value1 <= x <= value2; - else x >= value1 || x <= value2. */ -} adc16_hardware_compare_mode_t; - -#if defined(FSL_FEATURE_ADC16_HAS_PGA) && FSL_FEATURE_ADC16_HAS_PGA -/*! - * @brief PGA's Gain mode. - */ -typedef enum _adc16_pga_gain -{ - kADC16_PGAGainValueOf1 = 0U, /*!< For amplifier gain of 1. */ - kADC16_PGAGainValueOf2 = 1U, /*!< For amplifier gain of 2. */ - kADC16_PGAGainValueOf4 = 2U, /*!< For amplifier gain of 4. */ - kADC16_PGAGainValueOf8 = 3U, /*!< For amplifier gain of 8. */ - kADC16_PGAGainValueOf16 = 4U, /*!< For amplifier gain of 16. */ - kADC16_PGAGainValueOf32 = 5U, /*!< For amplifier gain of 32. */ - kADC16_PGAGainValueOf64 = 6U, /*!< For amplifier gain of 64. */ -} adc16_pga_gain_t; -#endif /* FSL_FEATURE_ADC16_HAS_PGA */ - -/*! - * @brief ADC16 converter configuration. - */ -typedef struct _adc16_config -{ - adc16_reference_voltage_source_t referenceVoltageSource; /*!< Select the reference voltage source. */ - adc16_clock_source_t clockSource; /*!< Select the input clock source to converter. */ - bool enableAsynchronousClock; /*!< Enable the asynchronous clock output. */ - adc16_clock_divider_t clockDivider; /*!< Select the divider of input clock source. */ - adc16_resolution_t resolution; /*!< Select the sample resolution mode. */ - adc16_long_sample_mode_t longSampleMode; /*!< Select the long sample mode. */ - bool enableHighSpeed; /*!< Enable the high-speed mode. */ - bool enableLowPower; /*!< Enable low power. */ - bool enableContinuousConversion; /*!< Enable continuous conversion mode. */ -#if defined(FSL_FEATURE_ADC16_HAS_HW_AVERAGE) && FSL_FEATURE_ADC16_HAS_HW_AVERAGE - adc16_hardware_average_mode_t hardwareAverageMode; /*!< Set hardware average mode. */ -#endif /* FSL_FEATURE_ADC16_HAS_HW_AVERAGE */ -} adc16_config_t; - -/*! - * @brief ADC16 Hardware comparison configuration. - */ -typedef struct _adc16_hardware_compare_config -{ - adc16_hardware_compare_mode_t hardwareCompareMode; /*!< Select the hardware compare mode. - See "adc16_hardware_compare_mode_t". */ - int16_t value1; /*!< Setting value1 for hardware compare mode. */ - int16_t value2; /*!< Setting value2 for hardware compare mode. */ -} adc16_hardware_compare_config_t; - -/*! - * @brief ADC16 channel conversion configuration. - */ -typedef struct _adc16_channel_config -{ - uint32_t channelNumber; /*!< Setting the conversion channel number. The available range is 0-31. - See channel connection information for each chip in Reference - Manual document. */ - bool enableInterruptOnConversionCompleted; /*!< Generate an interrupt request once the conversion is completed. */ -#if defined(FSL_FEATURE_ADC16_HAS_DIFF_MODE) && FSL_FEATURE_ADC16_HAS_DIFF_MODE - bool enableDifferentialConversion; /*!< Using Differential sample mode. */ -#endif /* FSL_FEATURE_ADC16_HAS_DIFF_MODE */ -} adc16_channel_config_t; - -#if defined(FSL_FEATURE_ADC16_HAS_PGA) && FSL_FEATURE_ADC16_HAS_PGA -/*! - * @brief ADC16 programmable gain amplifier configuration. - */ -typedef struct _adc16_pga_config -{ - adc16_pga_gain_t pgaGain; /*!< Setting PGA gain. */ - bool enableRunInNormalMode; /*!< Enable PGA working in normal mode, or low power mode by default. */ -#if defined(FSL_FEATURE_ADC16_HAS_PGA_CHOPPING) && FSL_FEATURE_ADC16_HAS_PGA_CHOPPING - bool disablePgaChopping; /*!< Disable the PGA chopping function. - The PGA employs chopping to remove/reduce offset and 1/f noise and offers - an offset measurement configuration that aids the offset calibration. */ -#endif /* FSL_FEATURE_ADC16_HAS_PGA_CHOPPING */ -#if defined(FSL_FEATURE_ADC16_HAS_PGA_OFFSET_MEASUREMENT) && FSL_FEATURE_ADC16_HAS_PGA_OFFSET_MEASUREMENT - bool enableRunInOffsetMeasurement; /*!< Enable the PGA working in offset measurement mode. - When this feature is enabled, the PGA disconnects itself from the external - inputs and auto-configures into offset measurement mode. With this field - set, run the ADC in the recommended settings and enable the maximum hardware - averaging to get the PGA offset number. The output is the - (PGA offset * (64+1)) for the given PGA setting. */ -#endif /* FSL_FEATURE_ADC16_HAS_PGA_OFFSET_MEASUREMENT */ -} adc16_pga_config_t; -#endif /* FSL_FEATURE_ADC16_HAS_PGA */ - -#if defined(__cplusplus) -extern "C" { -#endif - -/******************************************************************************* - * API - ******************************************************************************/ - -/*! - * @name Initialization - * @{ - */ - -/*! - * @brief Initializes the ADC16 module. - * - * @param base ADC16 peripheral base address. - * @param config Pointer to configuration structure. See "adc16_config_t". - */ -void ADC16_Init(ADC_Type *base, const adc16_config_t *config); - -/*! - * @brief De-initializes the ADC16 module. - * - * @param base ADC16 peripheral base address. - */ -void ADC16_Deinit(ADC_Type *base); - -/*! - * @brief Gets an available pre-defined settings for the converter's configuration. - * - * This function initializes the converter configuration structure with available settings. The default values are as - * follows. - * @code - * config->referenceVoltageSource = kADC16_ReferenceVoltageSourceVref; - * config->clockSource = kADC16_ClockSourceAsynchronousClock; - * config->enableAsynchronousClock = false; - * config->clockDivider = kADC16_ClockDivider8; - * config->resolution = kADC16_ResolutionSE12Bit; - * config->longSampleMode = kADC16_LongSampleDisabled; - * config->enableHighSpeed = false; - * config->enableLowPower = false; - * config->enableContinuousConversion = false; - * @endcode - * @param config Pointer to the configuration structure. - */ -void ADC16_GetDefaultConfig(adc16_config_t *config); - -#if defined(FSL_FEATURE_ADC16_HAS_CALIBRATION) && FSL_FEATURE_ADC16_HAS_CALIBRATION -/*! - * @brief Automates the hardware calibration. - * - * This auto calibration helps to adjust the plus/minus side gain automatically. - * Execute the calibration before using the converter. Note that the hardware trigger should be used - * during the calibration. - * - * @param base ADC16 peripheral base address. - * - * @return Execution status. - * @retval kStatus_Success Calibration is done successfully. - * @retval kStatus_Fail Calibration has failed. - */ -status_t ADC16_DoAutoCalibration(ADC_Type *base); -#endif /* FSL_FEATURE_ADC16_HAS_CALIBRATION */ - -#if defined(FSL_FEATURE_ADC16_HAS_OFFSET_CORRECTION) && FSL_FEATURE_ADC16_HAS_OFFSET_CORRECTION -/*! - * @brief Sets the offset value for the conversion result. - * - * This offset value takes effect on the conversion result. If the offset value is not zero, the reading result - * is subtracted by it. Note, the hardware calibration fills the offset value automatically. - * - * @param base ADC16 peripheral base address. - * @param value Setting offset value. - */ -static inline void ADC16_SetOffsetValue(ADC_Type *base, int16_t value) -{ - base->OFS = (uint32_t)(value); -} -#endif /* FSL_FEATURE_ADC16_HAS_OFFSET_CORRECTION */ - -/*! @} */ - -/*! - * @name Advanced Features - * @{ - */ - -#if defined(FSL_FEATURE_ADC16_HAS_DMA) && FSL_FEATURE_ADC16_HAS_DMA -/*! - * @brief Enables generating the DMA trigger when the conversion is complete. - * - * @param base ADC16 peripheral base address. - * @param enable Switcher of the DMA feature. "true" means enabled, "false" means not enabled. - */ -static inline void ADC16_EnableDMA(ADC_Type *base, bool enable) -{ - if (enable) - { - base->SC2 |= ADC_SC2_DMAEN_MASK; - } - else - { - base->SC2 &= ~ADC_SC2_DMAEN_MASK; - } -} -#endif /* FSL_FEATURE_ADC16_HAS_DMA */ - -/*! - * @brief Enables the hardware trigger mode. - * - * @param base ADC16 peripheral base address. - * @param enable Switcher of the hardware trigger feature. "true" means enabled, "false" means not enabled. - */ -static inline void ADC16_EnableHardwareTrigger(ADC_Type *base, bool enable) -{ - if (enable) - { - base->SC2 |= ADC_SC2_ADTRG_MASK; - } - else - { - base->SC2 &= ~ADC_SC2_ADTRG_MASK; - } -} - -#if defined(FSL_FEATURE_ADC16_HAS_MUX_SELECT) && FSL_FEATURE_ADC16_HAS_MUX_SELECT -/*! - * @brief Sets the channel mux mode. - * - * Some sample pins share the same channel index. The channel mux mode decides which pin is used for an - * indicated channel. - * - * @param base ADC16 peripheral base address. - * @param mode Setting channel mux mode. See "adc16_channel_mux_mode_t". - */ -void ADC16_SetChannelMuxMode(ADC_Type *base, adc16_channel_mux_mode_t mode); -#endif /* FSL_FEATURE_ADC16_HAS_MUX_SELECT */ - -/*! - * @brief Configures the hardware compare mode. - * - * The hardware compare mode provides a way to process the conversion result automatically by using hardware. Only the - * result - * in the compare range is available. To compare the range, see "adc16_hardware_compare_mode_t" or the appopriate - * reference - * manual for more information. - * - * @param base ADC16 peripheral base address. - * @param config Pointer to the "adc16_hardware_compare_config_t" structure. Passing "NULL" disables the feature. - */ -void ADC16_SetHardwareCompareConfig(ADC_Type *base, const adc16_hardware_compare_config_t *config); - -#if defined(FSL_FEATURE_ADC16_HAS_HW_AVERAGE) && FSL_FEATURE_ADC16_HAS_HW_AVERAGE -/*! - * @brief Sets the hardware average mode. - * - * The hardware average mode provides a way to process the conversion result automatically by using hardware. The - * multiple - * conversion results are accumulated and averaged internally making them easier to read. - * - * @param base ADC16 peripheral base address. - * @param mode Setting the hardware average mode. See "adc16_hardware_average_mode_t". - */ -void ADC16_SetHardwareAverage(ADC_Type *base, adc16_hardware_average_mode_t mode); -#endif /* FSL_FEATURE_ADC16_HAS_HW_AVERAGE */ - -#if defined(FSL_FEATURE_ADC16_HAS_PGA) && FSL_FEATURE_ADC16_HAS_PGA -/*! - * @brief Configures the PGA for the converter's front end. - * - * @param base ADC16 peripheral base address. - * @param config Pointer to the "adc16_pga_config_t" structure. Passing "NULL" disables the feature. - */ -void ADC16_SetPGAConfig(ADC_Type *base, const adc16_pga_config_t *config); -#endif /* FSL_FEATURE_ADC16_HAS_PGA */ - -/*! - * @brief Gets the status flags of the converter. - * - * @param base ADC16 peripheral base address. - * - * @return Flags' mask if indicated flags are asserted. See "_adc16_status_flags". - */ -uint32_t ADC16_GetStatusFlags(ADC_Type *base); - -/*! - * @brief Clears the status flags of the converter. - * - * @param base ADC16 peripheral base address. - * @param mask Mask value for the cleared flags. See "_adc16_status_flags". - */ -void ADC16_ClearStatusFlags(ADC_Type *base, uint32_t mask); - -/*! - * @brief Enable/disable ADC Asynchronous clock output to other modules. - * - * @param base ADC16 peripheral base address. - * @param enable Used to enable/disable ADC ADACK output. - * - \b true Asynchronous clock and clock output is enabled regardless of the state of the ADC. - * - \b false Asynchronous clock output disabled, asynchronous clock is enabled only if it is selected as - * input clock and a conversion is active. - */ -static inline void ADC16_EnableAsynchronousClockOutput(ADC_Type *base, bool enable) -{ - if (enable) - { - base->CFG2 |= ADC_CFG2_ADACKEN_MASK; - } - else - { - base->CFG2 &= ~ADC_CFG2_ADACKEN_MASK; - } -} - -/*! @} */ - -/*! - * @name Conversion Channel - * @{ - */ - -/*! - * @brief Configures the conversion channel. - * - * This operation triggers the conversion when in software trigger mode. When in hardware trigger mode, this API - * configures the channel while the external trigger source helps to trigger the conversion. - * - * Note that the "Channel Group" has a detailed description. - * To allow sequential conversions of the ADC to be triggered by internal peripherals, the ADC has more than one - * group of status and control registers, one for each conversion. The channel group parameter indicates which group of - * registers are used, for example, channel group 0 is for Group A registers and channel group 1 is for Group B - * registers. The - * channel groups are used in a "ping-pong" approach to control the ADC operation. At any point, only one of - * the channel groups is actively controlling ADC conversions. The channel group 0 is used for both software and - * hardware - * trigger modes. Channel group 1 and greater indicates multiple channel group registers for - * use only in hardware trigger mode. See the chip configuration information in the appropriate MCU reference manual for - * the - * number of SC1n registers (channel groups) specific to this device. Channel group 1 or greater are not used - * for software trigger operation. Therefore, writing to these channel groups does not initiate a new conversion. - * Updating the channel group 0 while a different channel group is actively controlling a conversion is allowed and - * vice versa. Writing any of the channel group registers while that specific channel group is actively controlling a - * conversion aborts the current conversion. - * - * @param base ADC16 peripheral base address. - * @param channelGroup Channel group index. - * @param config Pointer to the "adc16_channel_config_t" structure for the conversion channel. - */ -void ADC16_SetChannelConfig(ADC_Type *base, uint32_t channelGroup, const adc16_channel_config_t *config); - -/*! - * @brief Gets the conversion value. - * - * @param base ADC16 peripheral base address. - * @param channelGroup Channel group index. - * - * @return Conversion value. - */ -static inline uint32_t ADC16_GetChannelConversionValue(ADC_Type *base, uint32_t channelGroup) -{ - assert(channelGroup < (uint32_t)FSL_FEATURE_ADC16_CONVERSION_CONTROL_COUNT); - - return base->R[channelGroup]; -} - -/*! - * @brief Gets the status flags of channel. - * - * @param base ADC16 peripheral base address. - * @param channelGroup Channel group index. - * - * @return Flags' mask if indicated flags are asserted. See "_adc16_channel_status_flags". - */ -uint32_t ADC16_GetChannelStatusFlags(ADC_Type *base, uint32_t channelGroup); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif -/*! - * @} - */ -#endif /* FSL_ADC16_H_ */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_clock.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_clock.c deleted file mode 100644 index ea0fb7f7586..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_clock.c +++ /dev/null @@ -1,505 +0,0 @@ -/* - * Copyright 2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_clock.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.clock" -#endif - -#if (defined(OSC) && !(defined(OSC0))) -#define OSC0 OSC -#endif - -#define MCG_HIRC_FREQ (48000000U) -#define MCG_LIRC_FREQ1 (2000000U) -#define MCG_LIRC_FREQ2 (8000000U) - -#define MCG_S_CLKST_VAL ((MCG->S & MCG_S_CLKST_MASK) >> MCG_S_CLKST_SHIFT) -#define MCG_SC_FCRDIV_VAL ((MCG->SC & MCG_SC_FCRDIV_MASK) >> MCG_SC_FCRDIV_SHIFT) -#define MCG_MC_LIRC_DIV2_VAL ((MCG->MC & MCG_MC_LIRC_DIV2_MASK) >> MCG_MC_LIRC_DIV2_SHIFT) -#define MCG_C2_IRCS_VAL ((MCG->C2 & MCG_C2_IRCS_MASK) >> MCG_C2_IRCS_SHIFT) - -#define SIM_CLKDIV1_OUTDIV1_VAL ((SIM->CLKDIV1 & SIM_CLKDIV1_OUTDIV1_MASK) >> SIM_CLKDIV1_OUTDIV1_SHIFT) -#define SIM_CLKDIV1_OUTDIV4_VAL ((SIM->CLKDIV1 & SIM_CLKDIV1_OUTDIV4_MASK) >> SIM_CLKDIV1_OUTDIV4_SHIFT) -#define SIM_SOPT1_OSC32KSEL_VAL ((SIM->SOPT1 & SIM_SOPT1_OSC32KSEL_MASK) >> SIM_SOPT1_OSC32KSEL_SHIFT) - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/* External XTAL0 (OSC0) clock frequency. */ -volatile uint32_t g_xtal0Freq; -/* External XTAL32K clock frequency. */ -volatile uint32_t g_xtal32Freq; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Get the current MCG_Lite LIRC_CLK frequency in Hz. - * - * This function will return the LIRC_CLK value in frequency(Hz) based - * on current MCG_Lite configurations and settings. It is an internal function. - * - * @return MCG_Lite LIRC_CLK frequency. - */ -static uint32_t CLOCK_GetLircClkFreq(void); - -/*! - * @brief Get RANGE value based on OSC frequency. - * - * To setup external crystal oscillator, must set the register bits RANGE base - * on the crystal frequency. This function returns the RANGE base on the input - * frequency. This is an internal function. - * - * @return RANGE value. - */ -static uint8_t CLOCK_GetOscRangeFromFreq(uint32_t freq); - -/******************************************************************************* - * Code - ******************************************************************************/ - -static uint32_t CLOCK_GetLircClkFreq(void) -{ - static const uint32_t lircFreqs[] = {MCG_LIRC_FREQ1, MCG_LIRC_FREQ2}; - uint32_t freq; - - /* Check whether the LIRC is enabled. */ - if (((MCG->C1 & MCG_C1_IRCLKEN_MASK) != 0U) || ((uint8_t)kMCGLITE_ClkSrcLirc == MCG_S_CLKST_VAL)) - { - freq = lircFreqs[MCG_C2_IRCS_VAL]; - } - else - { - freq = 0U; - } - - return freq; -} - -static uint8_t CLOCK_GetOscRangeFromFreq(uint32_t freq) -{ - uint8_t range; - - if (freq <= 39063U) - { - range = 0U; - } - else if (freq <= 8000000U) - { - range = 1U; - } - else - { - range = 2U; - } - - return range; -} - -/*! - * brief Get the OSC0 external reference clock frequency (OSC0ERCLK). - * - * return Clock frequency in Hz. - */ -uint32_t CLOCK_GetOsc0ErClkFreq(void) -{ - uint32_t freq; - - if ((OSC0->CR & OSC_CR_ERCLKEN_MASK) != 0U) - { - /* Please call CLOCK_SetXtal0Freq base on board setting before using OSC0 clock. */ - assert(g_xtal0Freq); - freq = g_xtal0Freq; - } - else - { - freq = 0U; - } - - return freq; -} - -/*! - * brief Get the external reference 32K clock frequency (ERCLK32K). - * - * return Clock frequency in Hz. - */ -uint32_t CLOCK_GetEr32kClkFreq(void) -{ - uint32_t freq; - - switch (SIM_SOPT1_OSC32KSEL_VAL) - { - case 0U: /* OSC 32k clock */ - freq = (CLOCK_GetOsc0ErClkFreq() == 32768U) ? 32768U : 0U; - break; - case 2U: /* RTC 32k clock */ - /* Please call CLOCK_SetXtal32Freq base on board setting before using XTAL32K/RTC_CLKIN clock. */ - assert(g_xtal32Freq); - freq = g_xtal32Freq; - break; - case 3U: /* LPO clock */ - freq = LPO_CLK_FREQ; - break; - default: - freq = 0U; - break; - } - return freq; -} - -/*! - * brief Get the platform clock frequency. - * - * return Clock frequency in Hz. - */ -uint32_t CLOCK_GetPlatClkFreq(void) -{ - return CLOCK_GetOutClkFreq() / (SIM_CLKDIV1_OUTDIV1_VAL + 1U); -} - -/*! - * brief Get the flash clock frequency. - * - * return Clock frequency in Hz. - */ -uint32_t CLOCK_GetFlashClkFreq(void) -{ - uint32_t freq; - - freq = CLOCK_GetOutClkFreq() / (SIM_CLKDIV1_OUTDIV1_VAL + 1U); - freq /= (SIM_CLKDIV1_OUTDIV4_VAL + 1U); - - return freq; -} - -/*! - * brief Get the bus clock frequency. - * - * return Clock frequency in Hz. - */ -uint32_t CLOCK_GetBusClkFreq(void) -{ - uint32_t freq; - - freq = CLOCK_GetOutClkFreq() / (SIM_CLKDIV1_OUTDIV1_VAL + 1U); - freq /= (SIM_CLKDIV1_OUTDIV4_VAL + 1U); - - return freq; -} - -/*! - * brief Get the core clock or system clock frequency. - * - * return Clock frequency in Hz. - */ -uint32_t CLOCK_GetCoreSysClkFreq(void) -{ - return CLOCK_GetOutClkFreq() / (SIM_CLKDIV1_OUTDIV1_VAL + 1U); -} - -/*! - * brief Gets the clock frequency for a specific clock name. - * - * This function checks the current clock configurations and then calculates - * the clock frequency for a specific clock name defined in clock_name_t. - * The MCG must be properly configured before using this function. - * - * param clockName Clock names defined in clock_name_t - * return Clock frequency value in Hertz - */ -uint32_t CLOCK_GetFreq(clock_name_t clockName) -{ - uint32_t freq; - - switch (clockName) - { - case kCLOCK_CoreSysClk: - case kCLOCK_PlatClk: - freq = CLOCK_GetOutClkFreq() / (SIM_CLKDIV1_OUTDIV1_VAL + 1U); - break; - case kCLOCK_BusClk: - case kCLOCK_FlashClk: - freq = CLOCK_GetOutClkFreq() / (SIM_CLKDIV1_OUTDIV1_VAL + 1U); - freq /= (SIM_CLKDIV1_OUTDIV4_VAL + 1U); - break; - case kCLOCK_Er32kClk: - freq = CLOCK_GetEr32kClkFreq(); - break; - case kCLOCK_Osc0ErClk: - freq = CLOCK_GetOsc0ErClkFreq(); - break; - case kCLOCK_McgInternalRefClk: - freq = CLOCK_GetInternalRefClkFreq(); - break; - case kCLOCK_McgPeriphClk: - case kCLOCK_McgIrc48MClk: - freq = CLOCK_GetPeriphClkFreq(); - break; - case kCLOCK_LpoClk: - freq = LPO_CLK_FREQ; - break; - default: - freq = 0U; - break; - } - - return freq; -} - -/*! - * brief Set the clock configure in SIM module. - * - * This function sets system layer clock settings in SIM module. - * - * param config Pointer to the configure structure. - */ -void CLOCK_SetSimConfig(sim_clock_config_t const *config) -{ - SIM->CLKDIV1 = config->clkdiv1; - CLOCK_SetEr32kClock(config->er32kSrc); -} - -/*! brief Enable USB FS clock. - * - * param src USB FS clock source. - * param freq The frequency specified by src. - * retval true The clock is set successfully. - * retval false The clock source is invalid to get proper USB FS clock. - */ -bool CLOCK_EnableUsbfs0Clock(clock_usb_src_t src, uint32_t freq) -{ - bool ret = true; - - CLOCK_DisableClock(kCLOCK_Usbfs0); - - if (kCLOCK_UsbSrcExt == src) - { - SIM->SOPT2 &= ~SIM_SOPT2_USBSRC_MASK; - } - else - { - SIM->SOPT2 |= SIM_SOPT2_USBSRC_MASK; - } - - CLOCK_EnableClock(kCLOCK_Usbfs0); - - if (kCLOCK_UsbSrcIrc48M == src) - { - USB0->CLK_RECOVER_IRC_EN = 0x03U; - USB0->CLK_RECOVER_CTRL |= USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN_MASK; - } - - return ret; -} - -/*! - * brief Gets the MCG internal reference clock (MCGIRCLK) frequency. - * - * This function gets the MCG_Lite internal reference clock frequency in Hz based - * on the current MCG register value. - * - * return The frequency of MCGIRCLK. - */ -uint32_t CLOCK_GetInternalRefClkFreq(void) -{ - uint8_t divider1 = MCG_SC_FCRDIV_VAL; - uint8_t divider2 = MCG_MC_LIRC_DIV2_VAL; - /* LIRC internal reference clock is selected*/ - return CLOCK_GetLircClkFreq() >> (divider1 + divider2); -} - -/* - * brief Gets the current MCGPCLK frequency. - * - * This function gets the MCGPCLK frequency in Hz based on the current MCG_Lite - * register settings. - * - * return The frequency of MCGPCLK. - */ -uint32_t CLOCK_GetPeriphClkFreq(void) -{ - uint32_t freq; - - /* Check whether the HIRC is enabled. */ - if (((MCG->MC & MCG_MC_HIRCEN_MASK) != 0U) || ((uint8_t)kMCGLITE_ClkSrcHirc == MCG_S_CLKST_VAL)) - { - freq = MCG_HIRC_FREQ; - } - else - { - freq = 0U; - } - - return freq; -} - -/*! - * brief Gets the MCG_Lite output clock (MCGOUTCLK) frequency. - * - * This function gets the MCG_Lite output clock frequency in Hz based on the current - * MCG_Lite register value. - * - * return The frequency of MCGOUTCLK. - */ -uint32_t CLOCK_GetOutClkFreq(void) -{ - uint32_t freq; - - switch (MCG_S_CLKST_VAL) - { - case (uint8_t)kMCGLITE_ClkSrcHirc: - freq = MCG_HIRC_FREQ; - break; - case (uint8_t)kMCGLITE_ClkSrcLirc: - freq = CLOCK_GetLircClkFreq() >> MCG_SC_FCRDIV_VAL; - break; - case (uint8_t)kMCGLITE_ClkSrcExt: - /* Please call CLOCK_SetXtal0Freq base on board setting before using OSC0 clock. */ - assert(g_xtal0Freq); - freq = g_xtal0Freq; - break; - default: - freq = 0U; - break; - } - - return freq; -} - -/*! - * brief Gets the current MCG_Lite mode. - * - * This function checks the MCG_Lite registers and determines the current MCG_Lite mode. - * - * return The current MCG_Lite mode or error code. - */ -mcglite_mode_t CLOCK_GetMode(void) -{ - mcglite_mode_t mode; - - switch (MCG_S_CLKST_VAL) - { - case (uint8_t)kMCGLITE_ClkSrcHirc: /* HIRC */ - mode = kMCGLITE_ModeHirc48M; - break; - case (uint8_t)kMCGLITE_ClkSrcLirc: /* LIRC */ - if ((uint8_t)kMCGLITE_Lirc2M == MCG_C2_IRCS_VAL) - { - mode = kMCGLITE_ModeLirc2M; - } - else - { - mode = kMCGLITE_ModeLirc8M; - } - break; - case (uint8_t)kMCGLITE_ClkSrcExt: /* EXT */ - mode = kMCGLITE_ModeExt; - break; - default: - mode = kMCGLITE_ModeError; - break; - } - - return mode; -} - -/*! - * brief Sets the MCG_Lite configuration. - * - * This function configures the MCG_Lite, includes the output clock source, MCGIRCLK - * settings, HIRC settings, and so on. See ref mcglite_config_t for details. - * - * param targetConfig Pointer to the target MCG_Lite mode configuration structure. - * return Error code. - */ -status_t CLOCK_SetMcgliteConfig(mcglite_config_t const *targetConfig) -{ - assert(targetConfig); - - /* - * If switch between LIRC8M and LIRC2M, need to switch to HIRC mode first, - * because could not switch directly. - */ - if (((uint8_t)kMCGLITE_ClkSrcLirc == MCG_S_CLKST_VAL) && (kMCGLITE_ClkSrcLirc == targetConfig->outSrc) && - (MCG_C2_IRCS_VAL != (uint8_t)(targetConfig->ircs))) - { - MCG->C1 = (uint8_t)((MCG->C1 & ~MCG_C1_CLKS_MASK) | MCG_C1_CLKS(kMCGLITE_ClkSrcHirc)); - while ((uint8_t)kMCGLITE_ClkSrcHirc != MCG_S_CLKST_VAL) - { - } - } - - /* Set configuration now. */ - MCG->SC = MCG_SC_FCRDIV(targetConfig->fcrdiv); - MCG->MC = MCG_MC_HIRCEN(targetConfig->hircEnableInNotHircMode) | MCG_MC_LIRC_DIV2(targetConfig->lircDiv2); - MCG->C2 = (uint8_t)((MCG->C2 & ~MCG_C2_IRCS_MASK) | MCG_C2_IRCS(targetConfig->ircs)); - MCG->C1 = MCG_C1_CLKS(targetConfig->outSrc) | targetConfig->irclkEnableMode; - - /* - * If external oscillator used and MCG_Lite is set to EXT mode, need to - * wait for the OSC stable. - */ - if (((MCG->C2 & MCG_C2_EREFS0_MASK) != 0U) && (kMCGLITE_ClkSrcExt == targetConfig->outSrc)) - { - while (0U == (MCG->S & MCG_S_OSCINIT0_MASK)) - { - } - } - - /* Wait for clock source change completed. */ - while ((uint8_t)targetConfig->outSrc != MCG_S_CLKST_VAL) - { - } - - return kStatus_Success; -} - -/*! - * brief Initializes the OSC0. - * - * This function initializes the OSC0 according to the board configuration. - * - * param config Pointer to the OSC0 configuration structure. - */ -void CLOCK_InitOsc0(osc_config_t const *config) -{ - uint8_t range = CLOCK_GetOscRangeFromFreq(config->freq); - - OSC_SetCapLoad(OSC0, config->capLoad); - OSC_SetExtRefClkConfig(OSC0, &config->oscerConfig); - - MCG->C2 = ((MCG->C2 & MCG_C2_IRCS_MASK) | MCG_C2_RANGE0(range) | (uint8_t)config->workMode); - - if ((kOSC_ModeExt != config->workMode) && ((OSC0->CR & OSC_CR_ERCLKEN_MASK) != 0U)) - { - /* Wait for stable. */ - while (0U == (MCG->S & MCG_S_OSCINIT0_MASK)) - { - } - } -} - -/*! - * brief Deinitializes the OSC0. - * - * This function deinitializes the OSC0. - */ -void CLOCK_DeinitOsc0(void) -{ - OSC0->CR = 0U; - MCG->C2 &= MCG_C2_IRCS_MASK; -} diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_clock.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_clock.h deleted file mode 100644 index 273be79fc5a..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_clock.h +++ /dev/null @@ -1,808 +0,0 @@ -/* - * Copyright 2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _FSL_CLOCK_H_ -#define _FSL_CLOCK_H_ - -#include "fsl_common.h" - -/*! @addtogroup clock */ -/*! @{ */ - -/*! @file */ - -/******************************************************************************* - * Configurations - ******************************************************************************/ - -/*! @brief Configure whether driver controls clock - * - * When set to 0, peripheral drivers will enable clock in initialize function - * and disable clock in de-initialize function. When set to 1, peripheral - * driver will not control the clock, application could control the clock out of - * the driver. - * - * @note All drivers share this feature switcher. If it is set to 1, application - * should handle clock enable and disable for all drivers. - */ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)) -#define FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL 0 -#endif - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief CLOCK driver version 2.0.0. */ -#define FSL_CLOCK_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) -/*@}*/ - -/*! @brief External XTAL0 (OSC0) clock frequency. - * - * The XTAL0/EXTAL0 (OSC0) clock frequency in Hz. When the clock is set up, use the - * function CLOCK_SetXtal0Freq to set the value in the clock driver. For example, - * if XTAL0 is 8 MHz: - * @code - * CLOCK_InitOsc0(...); - * CLOCK_SetXtal0Freq(80000000); - * @endcode - * - * This is important for the multicore platforms where one core needs to set up the - * OSC0 using the CLOCK_InitOsc0. All other cores need to call the CLOCK_SetXtal0Freq - * to get a valid clock frequency. - */ -extern volatile uint32_t g_xtal0Freq; - -/*! @brief The external XTAL32/EXTAL32/RTC_CLKIN clock frequency. - * - * The XTAL32/EXTAL32/RTC_CLKIN clock frequency in Hz. When the clock is set up, use the - * function CLOCK_SetXtal32Freq to set the value in the clock driver. - * - * This is important for the multicore platforms where one core needs to set up - * the clock. All other cores need to call the CLOCK_SetXtal32Freq - * to get a valid clock frequency. - */ -extern volatile uint32_t g_xtal32Freq; - -/* Definition for delay API in clock driver, users can redefine it to the real application. */ -#ifndef SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY -#define SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY (48000000UL) -#endif -/*! @brief Clock ip name array for DMAMUX. */ -#define DMAMUX_CLOCKS \ - { \ - kCLOCK_Dmamux0 \ - } - -/*! @brief Clock ip name array for RTC. */ -#define RTC_CLOCKS \ - { \ - kCLOCK_Rtc0 \ - } - -/*! @brief Clock ip name array for SAI. */ -#define SAI_CLOCKS \ - { \ - kCLOCK_Sai0 \ - } - -/*! @brief Clock ip name array for SPI. */ -#define SPI_CLOCKS \ - { \ - kCLOCK_Spi0, kCLOCK_Spi1 \ - } - -/*! @brief Clock ip name array for SLCD. */ -#define SLCD_CLOCKS \ - { \ - kCLOCK_Slcd0 \ - } - -/*! @brief Clock ip name array for PIT. */ -#define PIT_CLOCKS \ - { \ - kCLOCK_Pit0 \ - } - -/*! @brief Clock ip name array for PORT. */ -#define PORT_CLOCKS \ - { \ - kCLOCK_PortA, kCLOCK_PortB, kCLOCK_PortC, kCLOCK_PortD, kCLOCK_PortE \ - } - -/*! @brief Clock ip name array for LPUART. */ -#define LPUART_CLOCKS \ - { \ - kCLOCK_Lpuart0, kCLOCK_Lpuart1 \ - } - -/*! @brief Clock ip name array for DAC. */ -#define DAC_CLOCKS \ - { \ - kCLOCK_Dac0 \ - } - -/*! @brief Clock ip name array for LPTMR. */ -#define LPTMR_CLOCKS \ - { \ - kCLOCK_Lptmr0 \ - } - -/*! @brief Clock ip name array for ADC16. */ -#define ADC16_CLOCKS \ - { \ - kCLOCK_Adc0 \ - } - -/*! @brief Clock ip name array for FLEXIO. */ -#define FLEXIO_CLOCKS \ - { \ - kCLOCK_Flexio0 \ - } - -/*! @brief Clock ip name array for VREF. */ -#define VREF_CLOCKS \ - { \ - kCLOCK_Vref0 \ - } - -/*! @brief Clock ip name array for DMA. */ -#define DMA_CLOCKS \ - { \ - kCLOCK_Dma0 \ - } - -/*! @brief Clock ip name array for UART. */ -#define UART_CLOCKS \ - { \ - kCLOCK_IpInvalid, kCLOCK_IpInvalid, kCLOCK_Uart2 \ - } - -/*! @brief Clock ip name array for TPM. */ -#define TPM_CLOCKS \ - { \ - kCLOCK_Tpm0, kCLOCK_Tpm1, kCLOCK_Tpm2 \ - } - -/*! @brief Clock ip name array for I2C. */ -#define I2C_CLOCKS \ - { \ - kCLOCK_I2c0, kCLOCK_I2c1 \ - } - -/*! @brief Clock ip name array for FTF. */ -#define FTF_CLOCKS \ - { \ - kCLOCK_Ftf0 \ - } - -/*! @brief Clock ip name array for CMP. */ -#define CMP_CLOCKS \ - { \ - kCLOCK_Cmp0 \ - } - -/*! - * @brief LPO clock frequency. - */ -#define LPO_CLK_FREQ 1000U - -/*! @brief Peripherals clock source definition. */ -#define SYS_CLK kCLOCK_CoreSysClk -#define BUS_CLK kCLOCK_BusClk - -#define I2C0_CLK_SRC SYS_CLK -#define I2C1_CLK_SRC SYS_CLK -#define SPI0_CLK_SRC BUS_CLK -#define SPI1_CLK_SRC SYS_CLK -#define UART2_CLK_SRC BUS_CLK - -/*! @brief Clock name used to get clock frequency. */ -typedef enum _clock_name -{ - - /* ----------------------------- System layer clock -------------------------------*/ - kCLOCK_CoreSysClk, /*!< Core/system clock */ - kCLOCK_PlatClk, /*!< Platform clock */ - kCLOCK_BusClk, /*!< Bus clock */ - kCLOCK_FlexBusClk, /*!< FlexBus clock */ - kCLOCK_FlashClk, /*!< Flash clock */ - kCLOCK_FastPeriphClk, /*!< Fast peripheral clock */ - kCLOCK_PllFllSelClk, /*!< The clock after SIM[PLLFLLSEL]. */ - - /* ---------------------------------- OSC clock -----------------------------------*/ - kCLOCK_Er32kClk, /*!< External reference 32K clock (ERCLK32K) */ - kCLOCK_Osc0ErClk, /*!< OSC0 external reference clock (OSC0ERCLK) */ - kCLOCK_Osc1ErClk, /*!< OSC1 external reference clock (OSC1ERCLK) */ - kCLOCK_Osc0ErClkUndiv, /*!< OSC0 external reference undivided clock(OSC0ERCLK_UNDIV). */ - - /* ----------------------------- MCG and MCG-Lite clock ---------------------------*/ - kCLOCK_McgFixedFreqClk, /*!< MCG fixed frequency clock (MCGFFCLK) */ - kCLOCK_McgInternalRefClk, /*!< MCG internal reference clock (MCGIRCLK) */ - kCLOCK_McgFllClk, /*!< MCGFLLCLK */ - kCLOCK_McgPll0Clk, /*!< MCGPLL0CLK */ - kCLOCK_McgPll1Clk, /*!< MCGPLL1CLK */ - kCLOCK_McgExtPllClk, /*!< EXT_PLLCLK */ - kCLOCK_McgPeriphClk, /*!< MCG peripheral clock (MCGPCLK) */ - kCLOCK_McgIrc48MClk, /*!< MCG IRC48M clock */ - - /* --------------------------------- Other clock ----------------------------------*/ - kCLOCK_LpoClk, /*!< LPO clock */ - -} clock_name_t; - -/*! @brief USB clock source definition. */ -typedef enum _clock_usb_src -{ - kCLOCK_UsbSrcIrc48M = SIM_SOPT2_USBSRC(1U), /*!< Use IRC48M. */ - kCLOCK_UsbSrcExt = SIM_SOPT2_USBSRC(0U) /*!< Use USB_CLKIN. */ -} clock_usb_src_t; -/*------------------------------------------------------------------------------ - - clock_gate_t definition: - - 31 16 0 - ----------------------------------------------------------------- - | SIM_SCGC register offset | control bit offset in SCGC | - ----------------------------------------------------------------- - - For example, the SDHC clock gate is controlled by SIM_SCGC3[17], the - SIM_SCGC3 offset in SIM is 0x1030, then kCLOCK_GateSdhc0 is defined as - - kCLOCK_GateSdhc0 = (0x1030 << 16) | 17; - -------------------------------------------------------------------------------*/ - -#define CLK_GATE_REG_OFFSET_SHIFT 16U -#define CLK_GATE_REG_OFFSET_MASK 0xFFFF0000U -#define CLK_GATE_BIT_SHIFT_SHIFT 0U -#define CLK_GATE_BIT_SHIFT_MASK 0x0000FFFFU - -#define CLK_GATE_DEFINE(reg_offset, bit_shift) \ - ((((uint32_t)(reg_offset) << CLK_GATE_REG_OFFSET_SHIFT) & CLK_GATE_REG_OFFSET_MASK) | \ - (((uint32_t)(bit_shift) << CLK_GATE_BIT_SHIFT_SHIFT) & CLK_GATE_BIT_SHIFT_MASK)) - -#define CLK_GATE_ABSTRACT_REG_OFFSET(x) (((x)&CLK_GATE_REG_OFFSET_MASK) >> CLK_GATE_REG_OFFSET_SHIFT) -#define CLK_GATE_ABSTRACT_BITS_SHIFT(x) (((x)&CLK_GATE_BIT_SHIFT_MASK) >> CLK_GATE_BIT_SHIFT_SHIFT) - -/*! @brief Clock gate name used for CLOCK_EnableClock/CLOCK_DisableClock. */ -typedef enum _clock_ip_name -{ - kCLOCK_IpInvalid = 0U, - kCLOCK_I2c0 = CLK_GATE_DEFINE(0x1034U, 6U), - kCLOCK_I2c1 = CLK_GATE_DEFINE(0x1034U, 7U), - kCLOCK_Uart2 = CLK_GATE_DEFINE(0x1034U, 12U), - kCLOCK_Usbfs0 = CLK_GATE_DEFINE(0x1034U, 18U), - kCLOCK_Cmp0 = CLK_GATE_DEFINE(0x1034U, 19U), - kCLOCK_Vref0 = CLK_GATE_DEFINE(0x1034U, 20U), - kCLOCK_Spi0 = CLK_GATE_DEFINE(0x1034U, 22U), - kCLOCK_Spi1 = CLK_GATE_DEFINE(0x1034U, 23U), - - kCLOCK_Lptmr0 = CLK_GATE_DEFINE(0x1038U, 0U), - kCLOCK_PortA = CLK_GATE_DEFINE(0x1038U, 9U), - kCLOCK_PortB = CLK_GATE_DEFINE(0x1038U, 10U), - kCLOCK_PortC = CLK_GATE_DEFINE(0x1038U, 11U), - kCLOCK_PortD = CLK_GATE_DEFINE(0x1038U, 12U), - kCLOCK_PortE = CLK_GATE_DEFINE(0x1038U, 13U), - kCLOCK_Slcd0 = CLK_GATE_DEFINE(0x1038U, 19U), - kCLOCK_Lpuart0 = CLK_GATE_DEFINE(0x1038U, 20U), - kCLOCK_Lpuart1 = CLK_GATE_DEFINE(0x1038U, 21U), - kCLOCK_Flexio0 = CLK_GATE_DEFINE(0x1038U, 31U), - - kCLOCK_Ftf0 = CLK_GATE_DEFINE(0x103CU, 0U), - kCLOCK_Dmamux0 = CLK_GATE_DEFINE(0x103CU, 1U), - kCLOCK_Sai0 = CLK_GATE_DEFINE(0x103CU, 15U), - kCLOCK_Pit0 = CLK_GATE_DEFINE(0x103CU, 23U), - kCLOCK_Tpm0 = CLK_GATE_DEFINE(0x103CU, 24U), - kCLOCK_Tpm1 = CLK_GATE_DEFINE(0x103CU, 25U), - kCLOCK_Tpm2 = CLK_GATE_DEFINE(0x103CU, 26U), - kCLOCK_Adc0 = CLK_GATE_DEFINE(0x103CU, 27U), - kCLOCK_Rtc0 = CLK_GATE_DEFINE(0x103CU, 29U), - kCLOCK_Dac0 = CLK_GATE_DEFINE(0x103CU, 31U), - - kCLOCK_Dma0 = CLK_GATE_DEFINE(0x1040U, 8U), -} clock_ip_name_t; - -/*!@brief SIM configuration structure for clock setting. */ -typedef struct _sim_clock_config -{ - uint8_t er32kSrc; /*!< ERCLK32K source selection. */ - uint32_t clkdiv1; /*!< SIM_CLKDIV1. */ -} sim_clock_config_t; - -/*! @brief Oscillator capacitor load setting.*/ -enum _osc_cap_load -{ - kOSC_Cap2P = OSC_CR_SC2P_MASK, /*!< 2 pF capacitor load */ - kOSC_Cap4P = OSC_CR_SC4P_MASK, /*!< 4 pF capacitor load */ - kOSC_Cap8P = OSC_CR_SC8P_MASK, /*!< 8 pF capacitor load */ - kOSC_Cap16P = OSC_CR_SC16P_MASK /*!< 16 pF capacitor load */ -}; - -/*! @brief OSCERCLK enable mode. */ -enum _oscer_enable_mode -{ - kOSC_ErClkEnable = OSC_CR_ERCLKEN_MASK, /*!< Enable. */ - kOSC_ErClkEnableInStop = OSC_CR_EREFSTEN_MASK /*!< Enable in stop mode. */ -}; - -/*! @brief The OSC configuration for OSCERCLK. */ -typedef struct _oscer_config -{ - uint8_t enableMode; /*!< OSCERCLK enable mode. OR'ed value of \ref _oscer_enable_mode. */ - -} oscer_config_t; - -/*! @brief The OSC work mode. */ -typedef enum _osc_mode -{ - kOSC_ModeExt = 0U, /*!< Use external clock. */ - kOSC_ModeOscLowPower = MCG_C2_EREFS0_MASK, /*!< Oscillator low power. */ - kOSC_ModeOscHighGain = MCG_C2_EREFS0_MASK | MCG_C2_HGO0_MASK, /*!< Oscillator high gain. */ -} osc_mode_t; - -/*! - * @brief OSC Initialization Configuration Structure - * - * Defines the configuration data structure to initialize the OSC. - * When porting to a new board, set the following members - * according to the board settings: - * 1. freq: The external frequency. - * 2. workMode: The OSC module mode. - */ -typedef struct _osc_config -{ - uint32_t freq; /*!< External clock frequency. */ - uint8_t capLoad; /*!< Capacitor load setting. */ - osc_mode_t workMode; /*!< OSC work mode setting. */ - oscer_config_t oscerConfig; /*!< Configuration for OSCERCLK. */ -} osc_config_t; - -/*! @brief MCG_Lite clock source selection. */ -typedef enum _mcglite_clkout_src -{ - kMCGLITE_ClkSrcHirc, /*!< MCGOUTCLK source is HIRC */ - kMCGLITE_ClkSrcLirc, /*!< MCGOUTCLK source is LIRC */ - kMCGLITE_ClkSrcExt, /*!< MCGOUTCLK source is external clock source */ - kMCGLITE_ClkSrcReserved -} mcglite_clkout_src_t; - -/*! @brief MCG_Lite LIRC select. */ -typedef enum _mcglite_lirc_mode -{ - kMCGLITE_Lirc2M, /*!< Slow internal reference(LIRC) 2 MHz clock selected */ - kMCGLITE_Lirc8M, /*!< Slow internal reference(LIRC) 8 MHz clock selected */ -} mcglite_lirc_mode_t; - -/*! @brief MCG_Lite divider factor selection for clock source*/ -typedef enum _mcglite_lirc_div -{ - kMCGLITE_LircDivBy1 = 0U, /*!< Divider is 1 */ - kMCGLITE_LircDivBy2, /*!< Divider is 2 */ - kMCGLITE_LircDivBy4, /*!< Divider is 4 */ - kMCGLITE_LircDivBy8, /*!< Divider is 8 */ - kMCGLITE_LircDivBy16, /*!< Divider is 16 */ - kMCGLITE_LircDivBy32, /*!< Divider is 32 */ - kMCGLITE_LircDivBy64, /*!< Divider is 64 */ - kMCGLITE_LircDivBy128 /*!< Divider is 128 */ -} mcglite_lirc_div_t; - -/*! @brief MCG_Lite clock mode definitions */ -typedef enum _mcglite_mode -{ - kMCGLITE_ModeHirc48M, /*!< Clock mode is HIRC 48 M */ - kMCGLITE_ModeLirc8M, /*!< Clock mode is LIRC 8 M */ - kMCGLITE_ModeLirc2M, /*!< Clock mode is LIRC 2 M */ - kMCGLITE_ModeExt, /*!< Clock mode is EXT */ - kMCGLITE_ModeError /*!< Unknown mode */ -} mcglite_mode_t; - -/*! @brief MCG internal reference clock (MCGIRCLK) enable mode definition. */ -enum _mcglite_irclk_enable_mode -{ - kMCGLITE_IrclkEnable = MCG_C1_IRCLKEN_MASK, /*!< MCGIRCLK enable. */ - kMCGLITE_IrclkEnableInStop = MCG_C1_IREFSTEN_MASK /*!< MCGIRCLK enable in stop mode. */ -}; - -/*! @brief MCG_Lite configure structure for mode change. */ -typedef struct _mcglite_config -{ - mcglite_clkout_src_t outSrc; /*!< MCGOUT clock select. */ - uint8_t irclkEnableMode; /*!< MCGIRCLK enable mode, OR'ed value of _mcglite_irclk_enable_mode. */ - mcglite_lirc_mode_t ircs; /*!< MCG_C2[IRCS]. */ - mcglite_lirc_div_t fcrdiv; /*!< MCG_SC[FCRDIV]. */ - mcglite_lirc_div_t lircDiv2; /*!< MCG_MC[LIRC_DIV2]. */ - bool hircEnableInNotHircMode; /*!< HIRC enable when not in HIRC mode. */ -} mcglite_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @brief Enable the clock for specific IP. - * - * @param name Which clock to enable, see \ref clock_ip_name_t. - */ -static inline void CLOCK_EnableClock(clock_ip_name_t name) -{ - uint32_t regAddr = SIM_BASE + CLK_GATE_ABSTRACT_REG_OFFSET((uint32_t)name); - (*(volatile uint32_t *)regAddr) |= (1UL << CLK_GATE_ABSTRACT_BITS_SHIFT((uint32_t)name)); -} - -/*! - * @brief Disable the clock for specific IP. - * - * @param name Which clock to disable, see \ref clock_ip_name_t. - */ -static inline void CLOCK_DisableClock(clock_ip_name_t name) -{ - uint32_t regAddr = SIM_BASE + CLK_GATE_ABSTRACT_REG_OFFSET((uint32_t)name); - (*(volatile uint32_t *)regAddr) &= ~(1UL << CLK_GATE_ABSTRACT_BITS_SHIFT((uint32_t)name)); -} - -/*! - * @brief Set ERCLK32K source. - * - * @param src The value to set ERCLK32K clock source. - */ -static inline void CLOCK_SetEr32kClock(uint32_t src) -{ - SIM->SOPT1 = ((SIM->SOPT1 & ~SIM_SOPT1_OSC32KSEL_MASK) | SIM_SOPT1_OSC32KSEL(src)); -} - -/*! - * @brief Set LPUART0 clock source. - * - * @param src The value to set LPUART0 clock source. - */ -static inline void CLOCK_SetLpuart0Clock(uint32_t src) -{ - SIM->SOPT2 = ((SIM->SOPT2 & ~SIM_SOPT2_LPUART0SRC_MASK) | SIM_SOPT2_LPUART0SRC(src)); -} - -/*! - * @brief Set LPUART1 clock source. - * - * @param src The value to set LPUART1 clock source. - */ -static inline void CLOCK_SetLpuart1Clock(uint32_t src) -{ - SIM->SOPT2 = ((SIM->SOPT2 & ~SIM_SOPT2_LPUART1SRC_MASK) | SIM_SOPT2_LPUART1SRC(src)); -} - -/*! - * @brief Set TPM clock source. - * - * @param src The value to set TPM clock source. - */ -static inline void CLOCK_SetTpmClock(uint32_t src) -{ - SIM->SOPT2 = ((SIM->SOPT2 & ~SIM_SOPT2_TPMSRC_MASK) | SIM_SOPT2_TPMSRC(src)); -} - -/*! - * @brief Set FLEXIO clock source. - * - * @param src The value to set FLEXIO clock source. - */ -static inline void CLOCK_SetFlexio0Clock(uint32_t src) -{ - SIM->SOPT2 = ((SIM->SOPT2 & ~SIM_SOPT2_FLEXIOSRC_MASK) | SIM_SOPT2_FLEXIOSRC(src)); -} - -/*! @brief Enable USB FS clock. - * - * @param src USB FS clock source. - * @param freq The frequency specified by src. - * @retval true The clock is set successfully. - * @retval false The clock source is invalid to get proper USB FS clock. - */ -bool CLOCK_EnableUsbfs0Clock(clock_usb_src_t src, uint32_t freq); - -/*! @brief Disable USB FS clock. - * - * Disable USB FS clock. - */ -static inline void CLOCK_DisableUsbfs0Clock(void) -{ - CLOCK_DisableClock(kCLOCK_Usbfs0); -} - -/*! - * @brief Set CLKOUT source. - * - * @param src The value to set CLKOUT source. - */ -static inline void CLOCK_SetClkOutClock(uint32_t src) -{ - SIM->SOPT2 = ((SIM->SOPT2 & ~SIM_SOPT2_CLKOUTSEL_MASK) | SIM_SOPT2_CLKOUTSEL(src)); -} - -/*! - * @brief Set RTC_CLKOUT source. - * - * @param src The value to set RTC_CLKOUT source. - */ -static inline void CLOCK_SetRtcClkOutClock(uint32_t src) -{ - SIM->SOPT2 = ((SIM->SOPT2 & ~SIM_SOPT2_RTCCLKOUTSEL_MASK) | SIM_SOPT2_RTCCLKOUTSEL(src)); -} - -/*! - * @brief System clock divider - * - * Set the SIM_CLKDIV1[OUTDIV1], SIM_CLKDIV1[OUTDIV4]. - * - * @param outdiv1 Clock 1 output divider value. - * - * @param outdiv4 Clock 4 output divider value. - */ -static inline void CLOCK_SetOutDiv(uint32_t outdiv1, uint32_t outdiv4) -{ - SIM->CLKDIV1 = SIM_CLKDIV1_OUTDIV1(outdiv1) | SIM_CLKDIV1_OUTDIV4(outdiv4); -} - -/*! - * @brief Gets the clock frequency for a specific clock name. - * - * This function checks the current clock configurations and then calculates - * the clock frequency for a specific clock name defined in clock_name_t. - * The MCG must be properly configured before using this function. - * - * @param clockName Clock names defined in clock_name_t - * @return Clock frequency value in Hertz - */ -uint32_t CLOCK_GetFreq(clock_name_t clockName); - -/*! - * @brief Get the core clock or system clock frequency. - * - * @return Clock frequency in Hz. - */ -uint32_t CLOCK_GetCoreSysClkFreq(void); - -/*! - * @brief Get the platform clock frequency. - * - * @return Clock frequency in Hz. - */ -uint32_t CLOCK_GetPlatClkFreq(void); - -/*! - * @brief Get the bus clock frequency. - * - * @return Clock frequency in Hz. - */ -uint32_t CLOCK_GetBusClkFreq(void); - -/*! - * @brief Get the flash clock frequency. - * - * @return Clock frequency in Hz. - */ -uint32_t CLOCK_GetFlashClkFreq(void); - -/*! - * @brief Get the external reference 32K clock frequency (ERCLK32K). - * - * @return Clock frequency in Hz. - */ -uint32_t CLOCK_GetEr32kClkFreq(void); - -/*! - * @brief Get the OSC0 external reference clock frequency (OSC0ERCLK). - * - * @return Clock frequency in Hz. - */ -uint32_t CLOCK_GetOsc0ErClkFreq(void); - -/*! - * @brief Set the clock configure in SIM module. - * - * This function sets system layer clock settings in SIM module. - * - * @param config Pointer to the configure structure. - */ -void CLOCK_SetSimConfig(sim_clock_config_t const *config); - -/*! - * @brief Set the system clock dividers in SIM to safe value. - * - * The system level clocks (core clock, bus clock, flexbus clock and flash clock) - * must be in allowed ranges. During MCG clock mode switch, the MCG output clock - * changes then the system level clocks may be out of range. This function could - * be used before MCG mode change, to make sure system level clocks are in allowed - * range. - */ -static inline void CLOCK_SetSimSafeDivs(void) -{ - SIM->CLKDIV1 = 0x10030000U; -} - -/*! - * @name MCG_Lite clock frequency - * @{ - */ - -/*! - * @brief Gets the MCG_Lite output clock (MCGOUTCLK) frequency. - * - * This function gets the MCG_Lite output clock frequency in Hz based on the current - * MCG_Lite register value. - * - * @return The frequency of MCGOUTCLK. - */ -uint32_t CLOCK_GetOutClkFreq(void); - -/*! - * @brief Gets the MCG internal reference clock (MCGIRCLK) frequency. - * - * This function gets the MCG_Lite internal reference clock frequency in Hz based - * on the current MCG register value. - * - * @return The frequency of MCGIRCLK. - */ -uint32_t CLOCK_GetInternalRefClkFreq(void); - -/*! - * @brief Gets the current MCGPCLK frequency. - * - * This function gets the MCGPCLK frequency in Hz based on the current MCG_Lite - * register settings. - * - * @return The frequency of MCGPCLK. - */ -uint32_t CLOCK_GetPeriphClkFreq(void); - -/*! @}*/ - -/*! - * @name MCG_Lite mode. - * @{ - */ - -/*! - * @brief Gets the current MCG_Lite mode. - * - * This function checks the MCG_Lite registers and determines the current MCG_Lite mode. - * - * @return The current MCG_Lite mode or error code. - */ -mcglite_mode_t CLOCK_GetMode(void); - -/*! - * @brief Sets the MCG_Lite configuration. - * - * This function configures the MCG_Lite, includes the output clock source, MCGIRCLK - * settings, HIRC settings, and so on. See @ref mcglite_config_t for details. - * - * @param targetConfig Pointer to the target MCG_Lite mode configuration structure. - * @return Error code. - */ -status_t CLOCK_SetMcgliteConfig(mcglite_config_t const *targetConfig); - -/*! @}*/ - -/*! - * @name OSC configuration - * @{ - */ - -/*! - * @brief Configures the OSC external reference clock (OSCERCLK). - * - * This function configures the OSC external reference clock (OSCERCLK). - * This is an example to enable the OSCERCLK in normal mode and stop mode, and set - * the output divider to 1. - * - @code - oscer_config_t config = - { - .enableMode = kOSC_ErClkEnable | kOSC_ErClkEnableInStop, - .erclkDiv = 1U, - }; - - OSC_SetExtRefClkConfig(OSC, &config); - @endcode - * - * @param base OSC peripheral address. - * @param config Pointer to the configuration structure. - */ -static inline void OSC_SetExtRefClkConfig(OSC_Type *base, oscer_config_t const *config) -{ - uint8_t reg = base->CR; - - reg &= (uint8_t)(~(OSC_CR_ERCLKEN_MASK | OSC_CR_EREFSTEN_MASK)); - reg |= config->enableMode; - - base->CR = reg; -} - -/*! - * @brief Sets the capacitor load configuration for the oscillator. - * - * This function sets the specified capacitor configuration for the oscillator. - * This should be done in the early system level initialization function call - * based on the system configuration. - * - * @param base OSC peripheral address. - * @param capLoad OR'ed value for the capacitor load option.See \ref _osc_cap_load. - * - * Example: - @code - OSC_SetCapLoad(OSC, kOSC_Cap2P | kOSC_Cap8P); - @endcode - */ - -static inline void OSC_SetCapLoad(OSC_Type *base, uint8_t capLoad) -{ - uint8_t reg = base->CR; - - reg &= (uint8_t)(~(OSC_CR_SC2P_MASK | OSC_CR_SC4P_MASK | OSC_CR_SC8P_MASK | OSC_CR_SC16P_MASK)); - reg |= capLoad; - - base->CR = reg; -} - -/*! - * @brief Initializes the OSC0. - * - * This function initializes the OSC0 according to the board configuration. - * - * @param config Pointer to the OSC0 configuration structure. - */ -void CLOCK_InitOsc0(osc_config_t const *config); - -/*! - * @brief Deinitializes the OSC0. - * - * This function deinitializes the OSC0. - */ -void CLOCK_DeinitOsc0(void); - -/*! @}*/ - -/*! - * @name External clock frequency - * @{ - */ - -/*! - * @brief Sets the XTAL0 frequency based on board settings. - * - * @param freq The XTAL0/EXTAL0 input clock frequency in Hz. - */ -static inline void CLOCK_SetXtal0Freq(uint32_t freq) -{ - g_xtal0Freq = freq; -} - -/*! - * @brief Sets the XTAL32/RTC_CLKIN frequency based on board settings. - * - * @param freq The XTAL32/EXTAL32/RTC_CLKIN input clock frequency in Hz. - */ -static inline void CLOCK_SetXtal32Freq(uint32_t freq) -{ - g_xtal32Freq = freq; -} -/* @} */ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @} */ - -#endif /* _FSL_CLOCK_H_ */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_cmp.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_cmp.c deleted file mode 100644 index 357f711c779..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_cmp.c +++ /dev/null @@ -1,372 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2019, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_cmp.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.cmp" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Get instance number for CMP module. - * - * @param base CMP peripheral base address - */ -static uint32_t CMP_GetInstance(CMP_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to CMP bases for each instance. */ -static CMP_Type *const s_cmpBases[] = CMP_BASE_PTRS; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to CMP clocks for each instance. */ -static const clock_ip_name_t s_cmpClocks[] = CMP_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/******************************************************************************* - * Codes - ******************************************************************************/ -static uint32_t CMP_GetInstance(CMP_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_cmpBases); instance++) - { - if (s_cmpBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_cmpBases)); - - return instance; -} - -/*! - * brief Initializes the CMP. - * - * This function initializes the CMP module. The operations included are as follows. - * - Enabling the clock for CMP module. - * - Configuring the comparator. - * - Enabling the CMP module. - * Note that for some devices, multiple CMP instances share the same clock gate. In this case, to enable the clock for - * any instance enables all CMPs. See the appropriate MCU reference manual for the clock assignment of the CMP. - * - * param base CMP peripheral base address. - * param config Pointer to the configuration structure. - */ -void CMP_Init(CMP_Type *base, const cmp_config_t *config) -{ - assert(NULL != config); - - uint8_t tmp8; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock. */ - CLOCK_EnableClock(s_cmpClocks[CMP_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Configure. */ - CMP_Enable(base, false); /* Disable the CMP module during configuring. */ - /* CMPx_CR1. */ - tmp8 = (uint8_t)(base->CR1 & ~(CMP_CR1_PMODE_MASK | CMP_CR1_INV_MASK | CMP_CR1_COS_MASK | CMP_CR1_OPE_MASK)); - if (true == config->enableHighSpeed) - { - tmp8 |= CMP_CR1_PMODE_MASK; - } - if (true == config->enableInvertOutput) - { - tmp8 |= CMP_CR1_INV_MASK; - } - if (true == config->useUnfilteredOutput) - { - tmp8 |= CMP_CR1_COS_MASK; - } - if (true == config->enablePinOut) - { - tmp8 |= CMP_CR1_OPE_MASK; - } -#if defined(FSL_FEATURE_CMP_HAS_TRIGGER_MODE) && FSL_FEATURE_CMP_HAS_TRIGGER_MODE - if (true == config->enableTriggerMode) - { - tmp8 |= CMP_CR1_TRIGM_MASK; - } - else - { - tmp8 &= ~(uint8_t)CMP_CR1_TRIGM_MASK; - } -#endif /* FSL_FEATURE_CMP_HAS_TRIGGER_MODE */ - base->CR1 = tmp8; - - /* CMPx_CR0. */ - tmp8 = base->CR0 & ~(uint8_t)CMP_CR0_HYSTCTR_MASK; - tmp8 |= CMP_CR0_HYSTCTR(config->hysteresisMode); - base->CR0 = tmp8; - - CMP_Enable(base, config->enableCmp); /* Enable the CMP module after configured or not. */ -} - -/*! - * brief De-initializes the CMP module. - * - * This function de-initializes the CMP module. The operations included are as follows. - * - Disabling the CMP module. - * - Disabling the clock for CMP module. - * - * This function disables the clock for the CMP. - * Note that for some devices, multiple CMP instances share the same clock gate. In this case, before disabling the - * clock for the CMP, ensure that all the CMP instances are not used. - * - * param base CMP peripheral base address. - */ -void CMP_Deinit(CMP_Type *base) -{ - // Disable the CMP module. - base->CR0 = 0U; - base->CR1 = 0U; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable the clock. */ - CLOCK_DisableClock(s_cmpClocks[CMP_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Initializes the CMP user configuration structure. - * - * This function initializes the user configuration structure to these default values. - * code - * config->enableCmp = true; - * config->hysteresisMode = kCMP_HysteresisLevel0; - * config->enableHighSpeed = false; - * config->enableInvertOutput = false; - * config->useUnfilteredOutput = false; - * config->enablePinOut = false; - * config->enableTriggerMode = false; - * endcode - * param config Pointer to the configuration structure. - */ -void CMP_GetDefaultConfig(cmp_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->enableCmp = true; /* Enable the CMP module after initialization. */ - config->hysteresisMode = kCMP_HysteresisLevel0; - config->enableHighSpeed = false; - config->enableInvertOutput = false; - config->useUnfilteredOutput = false; - config->enablePinOut = false; -#if defined(FSL_FEATURE_CMP_HAS_TRIGGER_MODE) && FSL_FEATURE_CMP_HAS_TRIGGER_MODE - config->enableTriggerMode = false; -#endif /* FSL_FEATURE_CMP_HAS_TRIGGER_MODE */ -} - -/*! - * brief Sets the input channels for the comparator. - * - * This function sets the input channels for the comparator. - * Note that two input channels cannot be set the same way in the application. When the user selects the same input - * from the analog mux to the positive and negative port, the comparator is disabled automatically. - * - * param base CMP peripheral base address. - * param positiveChannel Positive side input channel number. Available range is 0-7. - * param negativeChannel Negative side input channel number. Available range is 0-7. - */ -void CMP_SetInputChannels(CMP_Type *base, uint8_t positiveChannel, uint8_t negativeChannel) -{ - uint8_t tmp8 = base->MUXCR; - - tmp8 &= ~(uint8_t)(CMP_MUXCR_PSEL_MASK | CMP_MUXCR_MSEL_MASK); - tmp8 |= CMP_MUXCR_PSEL(positiveChannel) | CMP_MUXCR_MSEL(negativeChannel); - base->MUXCR = tmp8; -} - -#if defined(FSL_FEATURE_CMP_HAS_DMA) && FSL_FEATURE_CMP_HAS_DMA -/*! - * brief Enables/disables the DMA request for rising/falling events. - * - * This function enables/disables the DMA request for rising/falling events. Either event triggers the generation of - * the DMA request from CMP if the DMA feature is enabled. Both events are ignored for generating the DMA request from - * the CMP - * if the DMA is disabled. - * - * param base CMP peripheral base address. - * param enable Enables or disables the feature. - */ -void CMP_EnableDMA(CMP_Type *base, bool enable) -{ - uint8_t tmp8 = (uint8_t)(base->SCR & ~(CMP_SCR_CFR_MASK | CMP_SCR_CFF_MASK)); /* To avoid change the w1c bits. */ - - if (enable) - { - tmp8 |= CMP_SCR_DMAEN_MASK; - } - else - { - tmp8 &= ~(uint8_t)CMP_SCR_DMAEN_MASK; - } - base->SCR = tmp8; -} -#endif /* FSL_FEATURE_CMP_HAS_DMA */ - -/*! - * brief Configures the filter. - * - * param base CMP peripheral base address. - * param config Pointer to the configuration structure. - */ -void CMP_SetFilterConfig(CMP_Type *base, const cmp_filter_config_t *config) -{ - assert(NULL != config); - - uint8_t tmp8; - -#if defined(FSL_FEATURE_CMP_HAS_EXTERNAL_SAMPLE_SUPPORT) && FSL_FEATURE_CMP_HAS_EXTERNAL_SAMPLE_SUPPORT - /* Choose the clock source for sampling. */ - if (config->enableSample) - { - base->CR1 |= CMP_CR1_SE_MASK; /* Choose the external SAMPLE clock. */ - } - else - { - base->CR1 &= (uint8_t)(~CMP_CR1_SE_MASK); /* Choose the internal divided bus clock. */ - } -#endif /* FSL_FEATURE_CMP_HAS_EXTERNAL_SAMPLE_SUPPORT */ - /* Set the filter count. */ - tmp8 = (uint8_t)(base->CR0 & ~CMP_CR0_FILTER_CNT_MASK); - tmp8 |= CMP_CR0_FILTER_CNT(config->filterCount); - base->CR0 = tmp8; - /* Set the filter period. It is used as the divider to bus clock. */ - base->FPR = CMP_FPR_FILT_PER(config->filterPeriod); -} - -/*! - * brief Configures the internal DAC. - * - * param base CMP peripheral base address. - * param config Pointer to the configuration structure. "NULL" disables the feature. - */ -void CMP_SetDACConfig(CMP_Type *base, const cmp_dac_config_t *config) -{ - uint8_t tmp8 = 0U; - - if (NULL == config) - { - /* Passing "NULL" as input parameter means no available configuration. So the DAC feature is disabled.*/ - base->DACCR = 0U; - return; - } - /* CMPx_DACCR. */ - tmp8 |= CMP_DACCR_DACEN_MASK; /* Enable the internal DAC. */ - if (kCMP_VrefSourceVin2 == config->referenceVoltageSource) - { - tmp8 |= CMP_DACCR_VRSEL_MASK; - } - tmp8 |= CMP_DACCR_VOSEL(config->DACValue); - - base->DACCR = tmp8; -} - -/*! - * brief Enables the interrupts. - * - * param base CMP peripheral base address. - * param mask Mask value for interrupts. See "_cmp_interrupt_enable". - */ -void CMP_EnableInterrupts(CMP_Type *base, uint32_t mask) -{ - uint8_t tmp8 = (uint8_t)(base->SCR & ~(CMP_SCR_CFR_MASK | CMP_SCR_CFF_MASK)); /* To avoid change the w1c bits. */ - - if (0U != ((uint32_t)kCMP_OutputRisingInterruptEnable & mask)) - { - tmp8 |= CMP_SCR_IER_MASK; - } - if (0U != ((uint32_t)kCMP_OutputFallingInterruptEnable & mask)) - { - tmp8 |= CMP_SCR_IEF_MASK; - } - base->SCR = tmp8; -} - -/*! - * brief Disables the interrupts. - * - * param base CMP peripheral base address. - * param mask Mask value for interrupts. See "_cmp_interrupt_enable". - */ -void CMP_DisableInterrupts(CMP_Type *base, uint32_t mask) -{ - uint8_t tmp8 = (uint8_t)(base->SCR & ~(CMP_SCR_CFR_MASK | CMP_SCR_CFF_MASK)); /* To avoid change the w1c bits. */ - - if (0U != ((uint32_t)kCMP_OutputRisingInterruptEnable & mask)) - { - tmp8 &= ~(uint8_t)CMP_SCR_IER_MASK; - } - if (0U != ((uint32_t)kCMP_OutputFallingInterruptEnable & mask)) - { - tmp8 &= ~(uint8_t)CMP_SCR_IEF_MASK; - } - base->SCR = tmp8; -} - -/*! - * brief Gets the status flags. - * - * param base CMP peripheral base address. - * - * return Mask value for the asserted flags. See "_cmp_status_flags". - */ -uint32_t CMP_GetStatusFlags(CMP_Type *base) -{ - uint32_t ret32 = 0U; - - if (0U != (CMP_SCR_CFR_MASK & base->SCR)) - { - ret32 |= (uint32_t)kCMP_OutputRisingEventFlag; - } - if (0U != (CMP_SCR_CFF_MASK & base->SCR)) - { - ret32 |= (uint32_t)kCMP_OutputFallingEventFlag; - } - if (0U != (CMP_SCR_COUT_MASK & base->SCR)) - { - ret32 |= (uint32_t)kCMP_OutputAssertEventFlag; - } - return ret32; -} - -/*! - * brief Clears the status flags. - * - * param base CMP peripheral base address. - * param mask Mask value for the flags. See "_cmp_status_flags". - */ -void CMP_ClearStatusFlags(CMP_Type *base, uint32_t mask) -{ - uint8_t tmp8 = (uint8_t)(base->SCR & ~(CMP_SCR_CFR_MASK | CMP_SCR_CFF_MASK)); /* To avoid change the w1c bits. */ - - if (0U != ((uint32_t)kCMP_OutputRisingEventFlag & mask)) - { - tmp8 |= CMP_SCR_CFR_MASK; - } - if (0U != ((uint32_t)kCMP_OutputFallingEventFlag & mask)) - { - tmp8 |= CMP_SCR_CFF_MASK; - } - base->SCR = tmp8; -} diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_cmp.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_cmp.h deleted file mode 100644 index ad6d4861b02..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_cmp.h +++ /dev/null @@ -1,321 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2019 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_CMP_H_ -#define FSL_CMP_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup cmp - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief CMP driver version 2.0.3. */ -#define FSL_CMP_DRIVER_VERSION (MAKE_VERSION(2, 0, 3)) -/*! @} */ - -/*! - * @brief Interrupt enable/disable mask. - */ -enum _cmp_interrupt_enable -{ - kCMP_OutputRisingInterruptEnable = CMP_SCR_IER_MASK, /*!< Comparator interrupt enable rising. */ - kCMP_OutputFallingInterruptEnable = CMP_SCR_IEF_MASK, /*!< Comparator interrupt enable falling. */ -}; - -/*! - * @brief Status flags' mask. - */ -enum _cmp_status_flags -{ - kCMP_OutputRisingEventFlag = CMP_SCR_CFR_MASK, /*!< Rising-edge on the comparison output has occurred. */ - kCMP_OutputFallingEventFlag = CMP_SCR_CFF_MASK, /*!< Falling-edge on the comparison output has occurred. */ - kCMP_OutputAssertEventFlag = CMP_SCR_COUT_MASK, /*!< Return the current value of the analog comparator output. */ -}; - -/*! - * @brief CMP Hysteresis mode. - */ -typedef enum _cmp_hysteresis_mode -{ - kCMP_HysteresisLevel0 = 0U, /*!< Hysteresis level 0. */ - kCMP_HysteresisLevel1 = 1U, /*!< Hysteresis level 1. */ - kCMP_HysteresisLevel2 = 2U, /*!< Hysteresis level 2. */ - kCMP_HysteresisLevel3 = 3U, /*!< Hysteresis level 3. */ -} cmp_hysteresis_mode_t; - -/*! - * @brief CMP Voltage Reference source. - */ -typedef enum _cmp_reference_voltage_source -{ - kCMP_VrefSourceVin1 = 0U, /*!< Vin1 is selected as a resistor ladder network supply reference Vin. */ - kCMP_VrefSourceVin2 = 1U, /*!< Vin2 is selected as a resistor ladder network supply reference Vin. */ -} cmp_reference_voltage_source_t; - -/*! - * @brief Configures the comparator. - */ -typedef struct _cmp_config -{ - bool enableCmp; /*!< Enable the CMP module. */ - cmp_hysteresis_mode_t hysteresisMode; /*!< CMP Hysteresis mode. */ - bool enableHighSpeed; /*!< Enable High-speed (HS) comparison mode. */ - bool enableInvertOutput; /*!< Enable the inverted comparator output. */ - bool useUnfilteredOutput; /*!< Set the compare output(COUT) to equal COUTA(true) or COUT(false). */ - bool enablePinOut; /*!< The comparator output is available on the associated pin. */ -#if defined(FSL_FEATURE_CMP_HAS_TRIGGER_MODE) && FSL_FEATURE_CMP_HAS_TRIGGER_MODE - bool enableTriggerMode; /*!< Enable the trigger mode. */ -#endif /* FSL_FEATURE_CMP_HAS_TRIGGER_MODE */ -} cmp_config_t; - -/*! - * @brief Configures the filter. - */ -typedef struct _cmp_filter_config -{ -#if defined(FSL_FEATURE_CMP_HAS_EXTERNAL_SAMPLE_SUPPORT) && FSL_FEATURE_CMP_HAS_EXTERNAL_SAMPLE_SUPPORT - bool enableSample; /*!< Using the external SAMPLE as a sampling clock input or using a divided bus clock. */ -#endif /* FSL_FEATURE_CMP_HAS_EXTERNAL_SAMPLE_SUPPORT */ - uint8_t filterCount; /*!< Filter Sample Count. Available range is 1-7; 0 disables the filter.*/ - uint8_t filterPeriod; /*!< Filter Sample Period. The divider to the bus clock. Available range is 0-255. */ -} cmp_filter_config_t; - -/*! - * @brief Configures the internal DAC. - */ -typedef struct _cmp_dac_config -{ - cmp_reference_voltage_source_t referenceVoltageSource; /*!< Supply voltage reference source. */ - uint8_t DACValue; /*!< Value for the DAC Output Voltage. Available range is 0-63.*/ -} cmp_dac_config_t; - -#if defined(__cplusplus) -extern "C" { -#endif - -/******************************************************************************* - * API - ******************************************************************************/ - -/*! - * @name Initialization - * @{ - */ - -/*! - * @brief Initializes the CMP. - * - * This function initializes the CMP module. The operations included are as follows. - * - Enabling the clock for CMP module. - * - Configuring the comparator. - * - Enabling the CMP module. - * Note that for some devices, multiple CMP instances share the same clock gate. In this case, to enable the clock for - * any instance enables all CMPs. See the appropriate MCU reference manual for the clock assignment of the CMP. - * - * @param base CMP peripheral base address. - * @param config Pointer to the configuration structure. - */ -void CMP_Init(CMP_Type *base, const cmp_config_t *config); - -/*! - * @brief De-initializes the CMP module. - * - * This function de-initializes the CMP module. The operations included are as follows. - * - Disabling the CMP module. - * - Disabling the clock for CMP module. - * - * This function disables the clock for the CMP. - * Note that for some devices, multiple CMP instances share the same clock gate. In this case, before disabling the - * clock for the CMP, ensure that all the CMP instances are not used. - * - * @param base CMP peripheral base address. - */ -void CMP_Deinit(CMP_Type *base); - -/*! - * @brief Enables/disables the CMP module. - * - * @param base CMP peripheral base address. - * @param enable Enables or disables the module. - */ -static inline void CMP_Enable(CMP_Type *base, bool enable) -{ - if (enable) - { - base->CR1 |= CMP_CR1_EN_MASK; - } - else - { - base->CR1 &= ~(uint8_t)CMP_CR1_EN_MASK; - } -} - -/*! - * @brief Initializes the CMP user configuration structure. - * - * This function initializes the user configuration structure to these default values. - * @code - * config->enableCmp = true; - * config->hysteresisMode = kCMP_HysteresisLevel0; - * config->enableHighSpeed = false; - * config->enableInvertOutput = false; - * config->useUnfilteredOutput = false; - * config->enablePinOut = false; - * config->enableTriggerMode = false; - * @endcode - * @param config Pointer to the configuration structure. - */ -void CMP_GetDefaultConfig(cmp_config_t *config); - -/*! - * @brief Sets the input channels for the comparator. - * - * This function sets the input channels for the comparator. - * Note that two input channels cannot be set the same way in the application. When the user selects the same input - * from the analog mux to the positive and negative port, the comparator is disabled automatically. - * - * @param base CMP peripheral base address. - * @param positiveChannel Positive side input channel number. Available range is 0-7. - * @param negativeChannel Negative side input channel number. Available range is 0-7. - */ -void CMP_SetInputChannels(CMP_Type *base, uint8_t positiveChannel, uint8_t negativeChannel); - -/*! @} */ - -/*! - * @name Advanced Features - * @{ - */ - -#if defined(FSL_FEATURE_CMP_HAS_DMA) && FSL_FEATURE_CMP_HAS_DMA -/*! - * @brief Enables/disables the DMA request for rising/falling events. - * - * This function enables/disables the DMA request for rising/falling events. Either event triggers the generation of - * the DMA request from CMP if the DMA feature is enabled. Both events are ignored for generating the DMA request from - * the CMP - * if the DMA is disabled. - * - * @param base CMP peripheral base address. - * @param enable Enables or disables the feature. - */ -void CMP_EnableDMA(CMP_Type *base, bool enable); -#endif /* FSL_FEATURE_CMP_HAS_DMA */ - -#if defined(FSL_FEATURE_CMP_HAS_WINDOW_MODE) && FSL_FEATURE_CMP_HAS_WINDOW_MODE -/*! - * @brief Enables/disables the window mode. - * - * @param base CMP peripheral base address. - * @param enable Enables or disables the feature. - */ -static inline void CMP_EnableWindowMode(CMP_Type *base, bool enable) -{ - if (enable) - { - base->CR1 |= CMP_CR1_WE_MASK; - } - else - { - base->CR1 &= (uint8_t)(~CMP_CR1_WE_MASK); - } -} -#endif /* FSL_FEATURE_CMP_HAS_WINDOW_MODE */ - -#if defined(FSL_FEATURE_CMP_HAS_PASS_THROUGH_MODE) && FSL_FEATURE_CMP_HAS_PASS_THROUGH_MODE -/*! - * @brief Enables/disables the pass through mode. - * - * @param base CMP peripheral base address. - * @param enable Enables or disables the feature. - */ -static inline void CMP_EnablePassThroughMode(CMP_Type *base, bool enable) -{ - if (enable) - { - base->MUXCR |= CMP_MUXCR_PSTM_MASK; - } - else - { - base->MUXCR &= (uint8_t)(~CMP_MUXCR_PSTM_MASK); - } -} -#endif /* FSL_FEATURE_CMP_HAS_PASS_THROUGH_MODE */ - -/*! - * @brief Configures the filter. - * - * @param base CMP peripheral base address. - * @param config Pointer to the configuration structure. - */ -void CMP_SetFilterConfig(CMP_Type *base, const cmp_filter_config_t *config); - -/*! - * @brief Configures the internal DAC. - * - * @param base CMP peripheral base address. - * @param config Pointer to the configuration structure. "NULL" disables the feature. - */ -void CMP_SetDACConfig(CMP_Type *base, const cmp_dac_config_t *config); - -/*! - * @brief Enables the interrupts. - * - * @param base CMP peripheral base address. - * @param mask Mask value for interrupts. See "_cmp_interrupt_enable". - */ -void CMP_EnableInterrupts(CMP_Type *base, uint32_t mask); - -/*! - * @brief Disables the interrupts. - * - * @param base CMP peripheral base address. - * @param mask Mask value for interrupts. See "_cmp_interrupt_enable". - */ -void CMP_DisableInterrupts(CMP_Type *base, uint32_t mask); - -/*! @} */ - -/*! - * @name Results - * @{ - */ - -/*! - * @brief Gets the status flags. - * - * @param base CMP peripheral base address. - * - * @return Mask value for the asserted flags. See "_cmp_status_flags". - */ -uint32_t CMP_GetStatusFlags(CMP_Type *base); - -/*! - * @brief Clears the status flags. - * - * @param base CMP peripheral base address. - * @param mask Mask value for the flags. See "_cmp_status_flags". - */ -void CMP_ClearStatusFlags(CMP_Type *base, uint32_t mask); - -/*! @} */ -#if defined(__cplusplus) -} -#endif -/*! - * @} - */ -#endif /* FSL_CMP_H_ */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_common.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_common.c deleted file mode 100644 index d3af9fdfc67..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_common.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_common.h" - -#define SDK_MEM_MAGIC_NUMBER 12345U - -typedef struct _mem_align_control_block -{ - uint16_t identifier; /*!< Identifier for the memory control block. */ - uint16_t offset; /*!< offset from aligned address to real address */ -} mem_align_cb_t; - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.common" -#endif - -#if !((defined(__DSC__) && defined(__CW__))) -void *SDK_Malloc(size_t size, size_t alignbytes) -{ - mem_align_cb_t *p_cb = NULL; - uint32_t alignedsize; - - /* Check overflow. */ - alignedsize = (uint32_t)(unsigned int)SDK_SIZEALIGN(size, alignbytes); - if (alignedsize < size) - { - return NULL; - } - - if (alignedsize > SIZE_MAX - alignbytes - sizeof(mem_align_cb_t)) - { - return NULL; - } - - alignedsize += alignbytes + (uint32_t)sizeof(mem_align_cb_t); - - union - { - void *pointer_value; - uintptr_t unsigned_value; - } p_align_addr, p_addr; - - p_addr.pointer_value = malloc((size_t)alignedsize); - - if (p_addr.pointer_value == NULL) - { - return NULL; - } - - p_align_addr.unsigned_value = SDK_SIZEALIGN(p_addr.unsigned_value + sizeof(mem_align_cb_t), alignbytes); - - p_cb = (mem_align_cb_t *)(p_align_addr.unsigned_value - 4U); - p_cb->identifier = SDK_MEM_MAGIC_NUMBER; - p_cb->offset = (uint16_t)(p_align_addr.unsigned_value - p_addr.unsigned_value); - - return p_align_addr.pointer_value; -} - -void SDK_Free(void *ptr) -{ - union - { - void *pointer_value; - uintptr_t unsigned_value; - } p_free; - p_free.pointer_value = ptr; - mem_align_cb_t *p_cb = (mem_align_cb_t *)(p_free.unsigned_value - 4U); - - if (p_cb->identifier != SDK_MEM_MAGIC_NUMBER) - { - return; - } - - p_free.unsigned_value = p_free.unsigned_value - p_cb->offset; - - free(p_free.pointer_value); -} -#endif diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_common.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_common.h deleted file mode 100644 index e6d5cce7190..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_common.h +++ /dev/null @@ -1,345 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_COMMON_H_ -#define FSL_COMMON_H_ - -#include -#include -#include -#include -#include - -#if defined(__ICCARM__) || (defined(__CC_ARM) || defined(__ARMCC_VERSION)) || defined(__GNUC__) -#include -#endif - -#include "fsl_device_registers.h" - -/*! - * @addtogroup ksdk_common - * @{ - */ - -/******************************************************************************* - * Configurations - ******************************************************************************/ - -/*! @brief Macro to use the default weak IRQ handler in drivers. */ -#ifndef FSL_DRIVER_TRANSFER_DOUBLE_WEAK_IRQ -#define FSL_DRIVER_TRANSFER_DOUBLE_WEAK_IRQ 1 -#endif - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @brief Construct a status code value from a group and code number. */ -#define MAKE_STATUS(group, code) ((((group)*100L) + (code))) - -/*! @brief Construct the version number for drivers. - * - * The driver version is a 32-bit number, for both 32-bit platforms(such as Cortex M) - * and 16-bit platforms(such as DSC). - * - * @verbatim - - | Unused || Major Version || Minor Version || Bug Fix | - 31 25 24 17 16 9 8 0 - - @endverbatim - */ -#define MAKE_VERSION(major, minor, bugfix) (((major)*65536L) + ((minor)*256L) + (bugfix)) - -/*! @name Driver version */ -/*! @{ */ -/*! @brief common driver version. */ -#define FSL_COMMON_DRIVER_VERSION (MAKE_VERSION(2, 4, 1)) -/*! @} */ - -/*! @name Debug console type definition. */ -/*! @{ */ -#define DEBUG_CONSOLE_DEVICE_TYPE_NONE 0U /*!< No debug console. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_UART 1U /*!< Debug console based on UART. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_LPUART 2U /*!< Debug console based on LPUART. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_LPSCI 3U /*!< Debug console based on LPSCI. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_USBCDC 4U /*!< Debug console based on USBCDC. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_FLEXCOMM 5U /*!< Debug console based on FLEXCOMM. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_IUART 6U /*!< Debug console based on i.MX UART. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_VUSART 7U /*!< Debug console based on LPC_VUSART. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_MINI_USART 8U /*!< Debug console based on LPC_USART. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_SWO 9U /*!< Debug console based on SWO. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_QSCI 10U /*!< Debug console based on QSCI. */ -/*! @} */ - -/*! @brief Status group numbers. */ -enum _status_groups -{ - kStatusGroup_Generic = 0, /*!< Group number for generic status codes. */ - kStatusGroup_FLASH = 1, /*!< Group number for FLASH status codes. */ - kStatusGroup_LPSPI = 4, /*!< Group number for LPSPI status codes. */ - kStatusGroup_FLEXIO_SPI = 5, /*!< Group number for FLEXIO SPI status codes. */ - kStatusGroup_DSPI = 6, /*!< Group number for DSPI status codes. */ - kStatusGroup_FLEXIO_UART = 7, /*!< Group number for FLEXIO UART status codes. */ - kStatusGroup_FLEXIO_I2C = 8, /*!< Group number for FLEXIO I2C status codes. */ - kStatusGroup_LPI2C = 9, /*!< Group number for LPI2C status codes. */ - kStatusGroup_UART = 10, /*!< Group number for UART status codes. */ - kStatusGroup_I2C = 11, /*!< Group number for UART status codes. */ - kStatusGroup_LPSCI = 12, /*!< Group number for LPSCI status codes. */ - kStatusGroup_LPUART = 13, /*!< Group number for LPUART status codes. */ - kStatusGroup_SPI = 14, /*!< Group number for SPI status code.*/ - kStatusGroup_XRDC = 15, /*!< Group number for XRDC status code.*/ - kStatusGroup_SEMA42 = 16, /*!< Group number for SEMA42 status code.*/ - kStatusGroup_SDHC = 17, /*!< Group number for SDHC status code */ - kStatusGroup_SDMMC = 18, /*!< Group number for SDMMC status code */ - kStatusGroup_SAI = 19, /*!< Group number for SAI status code */ - kStatusGroup_MCG = 20, /*!< Group number for MCG status codes. */ - kStatusGroup_SCG = 21, /*!< Group number for SCG status codes. */ - kStatusGroup_SDSPI = 22, /*!< Group number for SDSPI status codes. */ - kStatusGroup_FLEXIO_I2S = 23, /*!< Group number for FLEXIO I2S status codes */ - kStatusGroup_FLEXIO_MCULCD = 24, /*!< Group number for FLEXIO LCD status codes */ - kStatusGroup_FLASHIAP = 25, /*!< Group number for FLASHIAP status codes */ - kStatusGroup_FLEXCOMM_I2C = 26, /*!< Group number for FLEXCOMM I2C status codes */ - kStatusGroup_I2S = 27, /*!< Group number for I2S status codes */ - kStatusGroup_IUART = 28, /*!< Group number for IUART status codes */ - kStatusGroup_CSI = 29, /*!< Group number for CSI status codes */ - kStatusGroup_MIPI_DSI = 30, /*!< Group number for MIPI DSI status codes */ - kStatusGroup_SDRAMC = 35, /*!< Group number for SDRAMC status codes. */ - kStatusGroup_POWER = 39, /*!< Group number for POWER status codes. */ - kStatusGroup_ENET = 40, /*!< Group number for ENET status codes. */ - kStatusGroup_PHY = 41, /*!< Group number for PHY status codes. */ - kStatusGroup_TRGMUX = 42, /*!< Group number for TRGMUX status codes. */ - kStatusGroup_SMARTCARD = 43, /*!< Group number for SMARTCARD status codes. */ - kStatusGroup_LMEM = 44, /*!< Group number for LMEM status codes. */ - kStatusGroup_QSPI = 45, /*!< Group number for QSPI status codes. */ - kStatusGroup_DMA = 50, /*!< Group number for DMA status codes. */ - kStatusGroup_EDMA = 51, /*!< Group number for EDMA status codes. */ - kStatusGroup_DMAMGR = 52, /*!< Group number for DMAMGR status codes. */ - kStatusGroup_FLEXCAN = 53, /*!< Group number for FlexCAN status codes. */ - kStatusGroup_LTC = 54, /*!< Group number for LTC status codes. */ - kStatusGroup_FLEXIO_CAMERA = 55, /*!< Group number for FLEXIO CAMERA status codes. */ - kStatusGroup_LPC_SPI = 56, /*!< Group number for LPC_SPI status codes. */ - kStatusGroup_LPC_USART = 57, /*!< Group number for LPC_USART status codes. */ - kStatusGroup_DMIC = 58, /*!< Group number for DMIC status codes. */ - kStatusGroup_SDIF = 59, /*!< Group number for SDIF status codes.*/ - kStatusGroup_SPIFI = 60, /*!< Group number for SPIFI status codes. */ - kStatusGroup_OTP = 61, /*!< Group number for OTP status codes. */ - kStatusGroup_MCAN = 62, /*!< Group number for MCAN status codes. */ - kStatusGroup_CAAM = 63, /*!< Group number for CAAM status codes. */ - kStatusGroup_ECSPI = 64, /*!< Group number for ECSPI status codes. */ - kStatusGroup_USDHC = 65, /*!< Group number for USDHC status codes.*/ - kStatusGroup_LPC_I2C = 66, /*!< Group number for LPC_I2C status codes.*/ - kStatusGroup_DCP = 67, /*!< Group number for DCP status codes.*/ - kStatusGroup_MSCAN = 68, /*!< Group number for MSCAN status codes.*/ - kStatusGroup_ESAI = 69, /*!< Group number for ESAI status codes. */ - kStatusGroup_FLEXSPI = 70, /*!< Group number for FLEXSPI status codes. */ - kStatusGroup_MMDC = 71, /*!< Group number for MMDC status codes. */ - kStatusGroup_PDM = 72, /*!< Group number for MIC status codes. */ - kStatusGroup_SDMA = 73, /*!< Group number for SDMA status codes. */ - kStatusGroup_ICS = 74, /*!< Group number for ICS status codes. */ - kStatusGroup_SPDIF = 75, /*!< Group number for SPDIF status codes. */ - kStatusGroup_LPC_MINISPI = 76, /*!< Group number for LPC_MINISPI status codes. */ - kStatusGroup_HASHCRYPT = 77, /*!< Group number for Hashcrypt status codes */ - kStatusGroup_LPC_SPI_SSP = 78, /*!< Group number for LPC_SPI_SSP status codes. */ - kStatusGroup_I3C = 79, /*!< Group number for I3C status codes */ - kStatusGroup_LPC_I2C_1 = 97, /*!< Group number for LPC_I2C_1 status codes. */ - kStatusGroup_NOTIFIER = 98, /*!< Group number for NOTIFIER status codes. */ - kStatusGroup_DebugConsole = 99, /*!< Group number for debug console status codes. */ - kStatusGroup_SEMC = 100, /*!< Group number for SEMC status codes. */ - kStatusGroup_ApplicationRangeStart = 101, /*!< Starting number for application groups. */ - kStatusGroup_IAP = 102, /*!< Group number for IAP status codes */ - kStatusGroup_SFA = 103, /*!< Group number for SFA status codes*/ - kStatusGroup_SPC = 104, /*!< Group number for SPC status codes. */ - kStatusGroup_PUF = 105, /*!< Group number for PUF status codes. */ - kStatusGroup_TOUCH_PANEL = 106, /*!< Group number for touch panel status codes */ - kStatusGroup_VBAT = 107, /*!< Group number for VBAT status codes */ - kStatusGroup_XSPI = 108, /*!< Group number for XSPI status codes */ - kStatusGroup_PNGDEC = 109, /*!< Group number for PNGDEC status codes */ - kStatusGroup_JPEGDEC = 110, /*!< Group number for JPEGDEC status codes */ - - kStatusGroup_HAL_GPIO = 121, /*!< Group number for HAL GPIO status codes. */ - kStatusGroup_HAL_UART = 122, /*!< Group number for HAL UART status codes. */ - kStatusGroup_HAL_TIMER = 123, /*!< Group number for HAL TIMER status codes. */ - kStatusGroup_HAL_SPI = 124, /*!< Group number for HAL SPI status codes. */ - kStatusGroup_HAL_I2C = 125, /*!< Group number for HAL I2C status codes. */ - kStatusGroup_HAL_FLASH = 126, /*!< Group number for HAL FLASH status codes. */ - kStatusGroup_HAL_PWM = 127, /*!< Group number for HAL PWM status codes. */ - kStatusGroup_HAL_RNG = 128, /*!< Group number for HAL RNG status codes. */ - kStatusGroup_HAL_I2S = 129, /*!< Group number for HAL I2S status codes. */ - kStatusGroup_HAL_ADC_SENSOR = 130, /*!< Group number for HAL ADC SENSOR status codes. */ - kStatusGroup_TIMERMANAGER = 135, /*!< Group number for TiMER MANAGER status codes. */ - kStatusGroup_SERIALMANAGER = 136, /*!< Group number for SERIAL MANAGER status codes. */ - kStatusGroup_LED = 137, /*!< Group number for LED status codes. */ - kStatusGroup_BUTTON = 138, /*!< Group number for BUTTON status codes. */ - kStatusGroup_EXTERN_EEPROM = 139, /*!< Group number for EXTERN EEPROM status codes. */ - kStatusGroup_SHELL = 140, /*!< Group number for SHELL status codes. */ - kStatusGroup_MEM_MANAGER = 141, /*!< Group number for MEM MANAGER status codes. */ - kStatusGroup_LIST = 142, /*!< Group number for List status codes. */ - kStatusGroup_OSA = 143, /*!< Group number for OSA status codes. */ - kStatusGroup_COMMON_TASK = 144, /*!< Group number for Common task status codes. */ - kStatusGroup_MSG = 145, /*!< Group number for messaging status codes. */ - kStatusGroup_SDK_OCOTP = 146, /*!< Group number for OCOTP status codes. */ - kStatusGroup_SDK_FLEXSPINOR = 147, /*!< Group number for FLEXSPINOR status codes.*/ - kStatusGroup_CODEC = 148, /*!< Group number for codec status codes. */ - kStatusGroup_ASRC = 149, /*!< Group number for codec status ASRC. */ - kStatusGroup_OTFAD = 150, /*!< Group number for codec status codes. */ - kStatusGroup_SDIOSLV = 151, /*!< Group number for SDIOSLV status codes. */ - kStatusGroup_MECC = 152, /*!< Group number for MECC status codes. */ - kStatusGroup_ENET_QOS = 153, /*!< Group number for ENET_QOS status codes. */ - kStatusGroup_LOG = 154, /*!< Group number for LOG status codes. */ - kStatusGroup_I3CBUS = 155, /*!< Group number for I3CBUS status codes. */ - kStatusGroup_QSCI = 156, /*!< Group number for QSCI status codes. */ - kStatusGroup_ELEMU = 157, /*!< Group number for ELEMU status codes. */ - kStatusGroup_QUEUEDSPI = 158, /*!< Group number for QSPI status codes. */ - kStatusGroup_POWER_MANAGER = 159, /*!< Group number for POWER_MANAGER status codes. */ - kStatusGroup_IPED = 160, /*!< Group number for IPED status codes. */ - kStatusGroup_ELS_PKC = 161, /*!< Group number for ELS PKC status codes. */ - kStatusGroup_CSS_PKC = 162, /*!< Group number for CSS PKC status codes. */ - kStatusGroup_HOSTIF = 163, /*!< Group number for HOSTIF status codes. */ - kStatusGroup_CLIF = 164, /*!< Group number for CLIF status codes. */ - kStatusGroup_BMA = 165, /*!< Group number for BMA status codes. */ - kStatusGroup_NETC = 166, /*!< Group number for NETC status codes. */ - kStatusGroup_ELE = 167, /*!< Group number for ELE status codes. */ - kStatusGroup_GLIKEY = 168, /*!< Group number for GLIKEY status codes. */ -}; - -/*! \public - * @brief Generic status return codes. - */ -enum -{ - kStatus_Success = MAKE_STATUS(kStatusGroup_Generic, 0), /*!< Generic status for Success. */ - kStatus_Fail = MAKE_STATUS(kStatusGroup_Generic, 1), /*!< Generic status for Fail. */ - kStatus_ReadOnly = MAKE_STATUS(kStatusGroup_Generic, 2), /*!< Generic status for read only failure. */ - kStatus_OutOfRange = MAKE_STATUS(kStatusGroup_Generic, 3), /*!< Generic status for out of range access. */ - kStatus_InvalidArgument = MAKE_STATUS(kStatusGroup_Generic, 4), /*!< Generic status for invalid argument check. */ - kStatus_Timeout = MAKE_STATUS(kStatusGroup_Generic, 5), /*!< Generic status for timeout. */ - kStatus_NoTransferInProgress = - MAKE_STATUS(kStatusGroup_Generic, 6), /*!< Generic status for no transfer in progress. */ - kStatus_Busy = MAKE_STATUS(kStatusGroup_Generic, 7), /*!< Generic status for module is busy. */ - kStatus_NoData = - MAKE_STATUS(kStatusGroup_Generic, 8), /*!< Generic status for no data is found for the operation. */ -}; - -/*! @brief Type used for all status and error return values. */ -typedef int32_t status_t; - -#ifdef __ZEPHYR__ -#include -#else -/*! - * @name Min/max macros - * @{ - */ -#if !defined(MIN) -/*! Computes the minimum of \a a and \a b. */ -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - -#if !defined(MAX) -/*! Computes the maximum of \a a and \a b. */ -#define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif -/*! @} */ - -/*! @brief Computes the number of elements in an array. */ -#if !defined(ARRAY_SIZE) -#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) -#endif -#endif /* __ZEPHYR__ */ - -/*! @name UINT16_MAX/UINT32_MAX value */ -/*! @{ */ -#if !defined(UINT16_MAX) -/*! Max value of uint16_t type. */ -#define UINT16_MAX ((uint16_t)-1) -#endif - -#if !defined(UINT32_MAX) -/*! Max value of uint32_t type. */ -#define UINT32_MAX ((uint32_t)-1) -#endif -/*! @} */ - -/*! Macro to get upper 32 bits of a 64-bit value */ -#if !defined(UINT64_H) -#define UINT64_H(X) ((uint32_t)((((uint64_t) (X)) >> 32U) & 0x0FFFFFFFFULL)) -#endif - -/*! Macro to get lower 32 bits of a 64-bit value */ -#if !defined(UINT64_L) -#define UINT64_L(X) ((uint32_t)(((uint64_t) (X)) & 0x0FFFFFFFFULL)) -#endif - -/*! - * @def SUPPRESS_FALL_THROUGH_WARNING() - * - * For switch case code block, if case section ends without "break;" statement, there wil be - * fallthrough warning with compiler flag -Wextra or -Wimplicit-fallthrough=n when using armgcc. - * To suppress this warning, "SUPPRESS_FALL_THROUGH_WARNING();" need to be added at the end of each - * case section which misses "break;"statement. - */ -#if defined(__GNUC__) && !defined(__ARMCC_VERSION) -#define SUPPRESS_FALL_THROUGH_WARNING() __attribute__((fallthrough)) -#else -#define SUPPRESS_FALL_THROUGH_WARNING() -#endif - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -#if !((defined(__DSC__) && defined(__CW__))) -/*! - * @brief Allocate memory with given alignment and aligned size. - * - * This is provided to support the dynamically allocated memory - * used in cache-able region. - * @param size The length required to malloc. - * @param alignbytes The alignment size. - * @retval The allocated memory. - */ -void *SDK_Malloc(size_t size, size_t alignbytes); - -/*! - * @brief Free memory. - * - * @param ptr The memory to be release. - */ -void SDK_Free(void *ptr); -#endif - -/*! - * @brief Delay at least for some time. - * Please note that, this API uses while loop for delay, different run-time environments make the time not precise, - * if precise delay count was needed, please implement a new delay function with hardware timer. - * - * @param delayTime_us Delay time in unit of microsecond. - * @param coreClock_Hz Core clock frequency with Hz. - */ -void SDK_DelayAtLeastUs(uint32_t delayTime_us, uint32_t coreClock_Hz); - -#if defined(__cplusplus) -} -#endif - -/*! @} */ - -#if (defined(__DSC__) && defined(__CW__)) -#include "fsl_common_dsc.h" -#elif defined(__XTENSA__) -#include "fsl_common_dsp.h" -#else -#include "fsl_common_arm.h" -#endif - -#endif /* FSL_COMMON_H_ */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_common_arm.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_common_arm.c deleted file mode 100644 index e9f32aadf4a..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_common_arm.c +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_common.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.common_arm" -#endif - -#ifndef __GIC_PRIO_BITS -#if defined(ENABLE_RAM_VECTOR_TABLE) -uint32_t InstallIRQHandler(IRQn_Type irq, uint32_t irqHandler) -{ -#ifdef __VECTOR_TABLE -#undef __VECTOR_TABLE -#endif - -/* Addresses for VECTOR_TABLE and VECTOR_RAM come from the linker file */ -#if defined(__CC_ARM) || defined(__ARMCC_VERSION) - extern uint32_t Image$$VECTOR_ROM$$Base[]; - extern uint32_t Image$$VECTOR_RAM$$Base[]; - extern uint32_t Image$$VECTOR_RAM$$ZI$$Limit[]; - -#define __VECTOR_TABLE Image$$VECTOR_ROM$$Base -#define __VECTOR_RAM Image$$VECTOR_RAM$$Base -#define __RAM_VECTOR_TABLE_SIZE (((uint32_t)Image$$VECTOR_RAM$$ZI$$Limit - (uint32_t)Image$$VECTOR_RAM$$Base)) -#elif defined(__ICCARM__) - extern uint32_t __RAM_VECTOR_TABLE_SIZE[]; - extern uint32_t __VECTOR_TABLE[]; - extern uint32_t __VECTOR_RAM[]; -#elif defined(__GNUC__) - extern uint32_t __VECTOR_TABLE[]; - extern uint32_t __VECTOR_RAM[]; - extern uint32_t __RAM_VECTOR_TABLE_SIZE_BYTES[]; - uint32_t __RAM_VECTOR_TABLE_SIZE = (uint32_t)(__RAM_VECTOR_TABLE_SIZE_BYTES); -#endif /* defined(__CC_ARM) || defined(__ARMCC_VERSION) */ - uint32_t n; - uint32_t ret; - uint32_t irqMaskValue; - - irqMaskValue = DisableGlobalIRQ(); - if (SCB->VTOR != (uint32_t)__VECTOR_RAM) - { - /* Copy the vector table from ROM to RAM */ - for (n = 0; n < ((uint32_t)__RAM_VECTOR_TABLE_SIZE) / sizeof(uint32_t); n++) - { - __VECTOR_RAM[n] = __VECTOR_TABLE[n]; - } - /* Point the VTOR to the position of vector table */ - SCB->VTOR = (uint32_t)__VECTOR_RAM; - } - - ret = __VECTOR_RAM[(int32_t)irq + 16]; - /* make sure the __VECTOR_RAM is noncachable */ - __VECTOR_RAM[(int32_t)irq + 16] = irqHandler; - - EnableGlobalIRQ(irqMaskValue); - - return ret; -} -#endif /* ENABLE_RAM_VECTOR_TABLE. */ -#endif /* __GIC_PRIO_BITS. */ - -#if (defined(FSL_FEATURE_SOC_SYSCON_COUNT) && (FSL_FEATURE_SOC_SYSCON_COUNT > 0)) - -/* - * When FSL_FEATURE_POWERLIB_EXTEND is defined to non-zero value, - * powerlib should be used instead of these functions. - */ -#if !(defined(FSL_FEATURE_POWERLIB_EXTEND) && (FSL_FEATURE_POWERLIB_EXTEND != 0)) - -/* - * When the SYSCON STARTER registers are discontinuous, these functions are - * implemented in fsl_power.c. - */ -#if !(defined(FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS) && FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS) - -void EnableDeepSleepIRQ(IRQn_Type interrupt) -{ - uint32_t intNumber = (uint32_t)interrupt; - - uint32_t index = 0; - - while (intNumber >= 32u) - { - index++; - intNumber -= 32u; - } - - SYSCON->STARTERSET[index] = 1UL << intNumber; - (void)EnableIRQ(interrupt); /* also enable interrupt at NVIC */ -} - -void DisableDeepSleepIRQ(IRQn_Type interrupt) -{ - uint32_t intNumber = (uint32_t)interrupt; - - (void)DisableIRQ(interrupt); /* also disable interrupt at NVIC */ - uint32_t index = 0; - - while (intNumber >= 32u) - { - index++; - intNumber -= 32u; - } - - SYSCON->STARTERCLR[index] = 1UL << intNumber; -} -#endif /* FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS */ -#endif /* FSL_FEATURE_POWERLIB_EXTEND */ -#endif /* FSL_FEATURE_SOC_SYSCON_COUNT */ - -#if defined(DWT) -/* Use WDT. */ -void MSDK_EnableCpuCycleCounter(void) -{ - /* Make sure the DWT trace fucntion is enabled. */ - if (CoreDebug_DEMCR_TRCENA_Msk != (CoreDebug_DEMCR_TRCENA_Msk & CoreDebug->DEMCR)) - { - CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; - } - - /* CYCCNT not supported on this device. */ - assert(DWT_CTRL_NOCYCCNT_Msk != (DWT->CTRL & DWT_CTRL_NOCYCCNT_Msk)); - - /* Read CYCCNT directly if CYCCENT has already been enabled, otherwise enable CYCCENT first. */ - if (DWT_CTRL_CYCCNTENA_Msk != (DWT_CTRL_CYCCNTENA_Msk & DWT->CTRL)) - { - DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk; - } -} - -uint32_t MSDK_GetCpuCycleCount(void) -{ - return DWT->CYCCNT; -} -#endif /* defined(DWT) */ - -#if !(defined(SDK_DELAY_USE_DWT) && defined(DWT)) -/* Use software loop. */ -#if defined(__CC_ARM) /* This macro is arm v5 specific */ -/* clang-format off */ -__ASM static void DelayLoop(uint32_t count) -{ -loop - SUBS R0, R0, #1 - CMP R0, #0 - BNE loop - BX LR -} -#elif defined(__ARM_ARCH_8A__) /* This macro is ARMv8-A specific */ -static void DelayLoop(uint32_t count) -{ - __ASM volatile(" MOV X0, %0" : : "r"(count)); - __ASM volatile( - "loop%=: \n" - " SUB X0, X0, #1 \n" - " CMP X0, #0 \n" - - " BNE loop%= \n" - : - : - : "r0"); -} -/* clang-format on */ -#elif defined(__ARMCC_VERSION) || defined(__ICCARM__) || defined(__GNUC__) -/* Cortex-M0 has a smaller instruction set, SUBS isn't supported in thumb-16 mode reported from __GNUC__ compiler, - * use SUB and CMP here for compatibility */ -static void DelayLoop(uint32_t count) -{ - __ASM volatile(" MOV R0, %0" : : "r"(count)); - __ASM volatile( - "loop%=: \n" -#if defined(__GNUC__) && !defined(__ARMCC_VERSION) - " SUB R0, R0, #1 \n" -#else - " SUBS R0, R0, #1 \n" -#endif - " CMP R0, #0 \n" - - " BNE loop%= \n" - : - : - : "r0"); -} -#endif /* defined(__CC_ARM) */ -#endif /* defined(SDK_DELAY_USE_DWT) && defined(DWT) */ - -/*! - * @brief Delay at least for some time. - * Please note that, if not uses DWT, this API will use while loop for delay, different run-time environments have - * effect on the delay time. If precise delay is needed, please enable DWT delay. The two parmeters delayTime_us and - * coreClock_Hz have limitation. For example, in the platform with 1GHz coreClock_Hz, the delayTime_us only supports - * up to 4294967 in current code. If long time delay is needed, please implement a new delay function. - * - * @param delayTime_us Delay time in unit of microsecond. - * @param coreClock_Hz Core clock frequency with Hz. - */ -void SDK_DelayAtLeastUs(uint32_t delayTime_us, uint32_t coreClock_Hz) -{ - uint64_t count; - - if (delayTime_us > 0U) - { - count = USEC_TO_COUNT(delayTime_us, coreClock_Hz); - - assert(count <= UINT32_MAX); - -#if defined(SDK_DELAY_USE_DWT) && defined(DWT) /* Use DWT for better accuracy */ - - MSDK_EnableCpuCycleCounter(); - /* Calculate the count ticks. */ - count += MSDK_GetCpuCycleCount(); - - if (count > UINT32_MAX) - { - count -= UINT32_MAX; - /* Wait for cyccnt overflow. */ - while (count < MSDK_GetCpuCycleCount()) - { - } - } - - /* Wait for cyccnt reach count value. */ - while (count > MSDK_GetCpuCycleCount()) - { - } -#else -#if defined(__CORTEX_Axx) && ((__CORTEX_Axx == 53) || (__CORTEX_Axx == 55)) - /* - * Cortex-A53/A55 execution throughput: - * - SUB/CMP: 2 instructions per cycle - * - BNE: 1 instruction per cycle - * So, each loop takes 2 CPU cycles. - */ - count = count / 2U; -#elif (__CORTEX_M == 7) - /* Divide value may be different in various environment to ensure delay is precise. - * Every loop count includes three instructions, due to Cortex-M7 sometimes executes - * two instructions in one period, through test here set divide 1.5. Other M cores use - * divide 4. By the way, divide 1.5 or 4 could let the count lose precision, but it does - * not matter because other instructions outside while loop is enough to fill the time. - */ - count = count / 3U * 2U; -#else - count = count / 4U; -#endif - DelayLoop((uint32_t)count); -#endif /* defined(SDK_DELAY_USE_DWT) && defined(DWT) */ - } -} diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_common_arm.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_common_arm.h deleted file mode 100644 index 3d35d76f812..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_common_arm.h +++ /dev/null @@ -1,898 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_COMMON_ARM_H_ -#define FSL_COMMON_ARM_H_ - -/* - * For CMSIS pack RTE. - * CMSIS pack RTE generates "RTC_Components.h" which contains the statements - * of the related element for all selected software components. - */ -#ifdef _RTE_ -#include "RTE_Components.h" -#endif - -/*! - * @addtogroup ksdk_common - * @{ - */ - -/*! @name Atomic modification - * - * These macros are used for atomic access, such as read-modify-write - * to the peripheral registers. - * - * Take @ref SDK_ATOMIC_LOCAL_CLEAR_AND_SET as an example: the parameter @c addr - * means the address of the peripheral register or variable you want to modify - * atomically, the parameter @c clearBits is the bits to clear, the parameter - * @c setBits it the bits to set. - * For example, to set a 32-bit register bit1:bit0 to 0b10, use like this: - * - * @code - volatile uint32_t * reg = (volatile uint32_t *)REG_ADDR; - - SDK_ATOMIC_LOCAL_CLEAR_AND_SET(reg, 0x03, 0x02); - @endcode - * - * In this example, the register bit1:bit0 are cleared and bit1 is set, as a result, - * register bit1:bit0 = 0b10. - * - * @note For the platforms don't support exclusive load and store, these macros - * disable the global interrupt to pretect the modification. - * - * @note These macros only guarantee the local processor atomic operations. For - * the multi-processor devices, use hardware semaphore such as SEMA42 to - * guarantee exclusive access if necessary. - * - * @{ - */ - -/*! - * @def SDK_ATOMIC_LOCAL_ADD(addr, val) - * Add value \a val from the variable at address \a address. - * - * @def SDK_ATOMIC_LOCAL_SUB(addr, val) - * Subtract value \a val to the variable at address \a address. - * - * @def SDK_ATOMIC_LOCAL_SET(addr, bits) - * Set the bits specifiled by \a bits to the variable at address \a address. - * - * @def SDK_ATOMIC_LOCAL_CLEAR(addr, bits) - * Clear the bits specifiled by \a bits to the variable at address \a address. - * - * @def SDK_ATOMIC_LOCAL_TOGGLE(addr, bits) - * Toggle the bits specifiled by \a bits to the variable at address \a address. - * - * @def SDK_ATOMIC_LOCAL_CLEAR_AND_SET(addr, clearBits, setBits) - * For the variable at address \a address, clear the bits specifiled by \a clearBits - * and set the bits specifiled by \a setBits. - */ - -/* clang-format off */ -#if ((defined(__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined(__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined(__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined(__ARM_ARCH_8M_BASE__) && (__ARM_ARCH_8M_BASE__ == 1))) -/* clang-format on */ - -/* If the LDREX and STREX are supported, use them. */ -#define _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, val, ops) \ - do \ - { \ - (val) = __LDREXB(addr); \ - (ops); \ - } while (0UL != __STREXB((val), (addr))) - -#define _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, val, ops) \ - do \ - { \ - (val) = __LDREXH(addr); \ - (ops); \ - } while (0UL != __STREXH((val), (addr))) - -#define _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, val, ops) \ - do \ - { \ - (val) = __LDREXW(addr); \ - (ops); \ - } while (0UL != __STREXW((val), (addr))) - -static inline void _SDK_AtomicLocalAdd1Byte(volatile uint8_t *addr, uint8_t val) -{ - uint8_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, s_val, s_val += val); -} - -static inline void _SDK_AtomicLocalAdd2Byte(volatile uint16_t *addr, uint16_t val) -{ - uint16_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, s_val, s_val += val); -} - -static inline void _SDK_AtomicLocalAdd4Byte(volatile uint32_t *addr, uint32_t val) -{ - uint32_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, s_val, s_val += val); -} - -static inline void _SDK_AtomicLocalSub1Byte(volatile uint8_t *addr, uint8_t val) -{ - uint8_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, s_val, s_val -= val); -} - -static inline void _SDK_AtomicLocalSub2Byte(volatile uint16_t *addr, uint16_t val) -{ - uint16_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, s_val, s_val -= val); -} - -static inline void _SDK_AtomicLocalSub4Byte(volatile uint32_t *addr, uint32_t val) -{ - uint32_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, s_val, s_val -= val); -} - -static inline void _SDK_AtomicLocalSet1Byte(volatile uint8_t *addr, uint8_t bits) -{ - uint8_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, s_val, s_val |= bits); -} - -static inline void _SDK_AtomicLocalSet2Byte(volatile uint16_t *addr, uint16_t bits) -{ - uint16_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, s_val, s_val |= bits); -} - -static inline void _SDK_AtomicLocalSet4Byte(volatile uint32_t *addr, uint32_t bits) -{ - uint32_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, s_val, s_val |= bits); -} - -static inline void _SDK_AtomicLocalClear1Byte(volatile uint8_t *addr, uint8_t bits) -{ - uint8_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, s_val, s_val &= ~bits); -} - -static inline void _SDK_AtomicLocalClear2Byte(volatile uint16_t *addr, uint16_t bits) -{ - uint16_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, s_val, s_val &= ~bits); -} - -static inline void _SDK_AtomicLocalClear4Byte(volatile uint32_t *addr, uint32_t bits) -{ - uint32_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, s_val, s_val &= ~bits); -} - -static inline void _SDK_AtomicLocalToggle1Byte(volatile uint8_t *addr, uint8_t bits) -{ - uint8_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, s_val, s_val ^= bits); -} - -static inline void _SDK_AtomicLocalToggle2Byte(volatile uint16_t *addr, uint16_t bits) -{ - uint16_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, s_val, s_val ^= bits); -} - -static inline void _SDK_AtomicLocalToggle4Byte(volatile uint32_t *addr, uint32_t bits) -{ - uint32_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, s_val, s_val ^= bits); -} - -static inline void _SDK_AtomicLocalClearAndSet1Byte(volatile uint8_t *addr, uint8_t clearBits, uint8_t setBits) -{ - uint8_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, s_val, s_val = (s_val & ~clearBits) | setBits); -} - -static inline void _SDK_AtomicLocalClearAndSet2Byte(volatile uint16_t *addr, uint16_t clearBits, uint16_t setBits) -{ - uint16_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, s_val, s_val = (s_val & ~clearBits) | setBits); -} - -static inline void _SDK_AtomicLocalClearAndSet4Byte(volatile uint32_t *addr, uint32_t clearBits, uint32_t setBits) -{ - uint32_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, s_val, s_val = (s_val & ~clearBits) | setBits); -} - -#define SDK_ATOMIC_LOCAL_ADD(addr, val) \ - ((1UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalAdd1Byte((volatile uint8_t *)(volatile void *)(addr), (uint8_t)(val)) : \ - ((2UL == sizeof(*(addr))) ? _SDK_AtomicLocalAdd2Byte((volatile uint16_t *)(volatile void *)(addr), (uint16_t)(val)) : \ - _SDK_AtomicLocalAdd4Byte((volatile uint32_t *)(volatile void *)(addr), (uint32_t)(val)))) - -#define SDK_ATOMIC_LOCAL_SUB(addr, val) \ - ((1UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalSub1Byte((volatile uint8_t *)(volatile void *)(addr), (uint8_t)(val)) : \ - ((2UL == sizeof(*(addr))) ? _SDK_AtomicLocalSub2Byte((volatile uint16_t *)(volatile void *)(addr), (uint16_t)(val)) : \ - _SDK_AtomicLocalSub4Byte((volatile uint32_t *)(volatile void *)(addr), (uint32_t)(val)))) - -#define SDK_ATOMIC_LOCAL_SET(addr, bits) \ - ((1UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalSet1Byte((volatile uint8_t *)(volatile void *)(addr), (uint8_t)(bits)) : \ - ((2UL == sizeof(*(addr))) ? _SDK_AtomicLocalSet2Byte((volatile uint16_t *)(volatile void *)(addr), (uint16_t)(bits)) : \ - _SDK_AtomicLocalSet4Byte((volatile uint32_t *)(volatile void *)(addr), (uint32_t)(bits)))) - -#define SDK_ATOMIC_LOCAL_CLEAR(addr, bits) \ - ((1UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalClear1Byte((volatile uint8_t *)(volatile void *)(addr), (uint8_t)(bits)) : \ - ((2UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalClear2Byte((volatile uint16_t *)(volatile void *)(addr), (uint16_t)(bits)) : \ - _SDK_AtomicLocalClear4Byte((volatile uint32_t *)(volatile void *)(addr), (uint32_t)(bits)))) - -#define SDK_ATOMIC_LOCAL_TOGGLE(addr, bits) \ - ((1UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalToggle1Byte((volatile uint8_t *)(volatile void *)(addr), (uint8_t)(bits)) : \ - ((2UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalToggle2Byte((volatile uint16_t *)(volatile void *)(addr), (uint16_t)(bits)) : \ - _SDK_AtomicLocalToggle4Byte((volatile uint32_t *)(volatile void *)(addr), (uint32_t)(bits)))) - -#define SDK_ATOMIC_LOCAL_CLEAR_AND_SET(addr, clearBits, setBits) \ - ((1UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalClearAndSet1Byte((volatile uint8_t *)(volatile void *)(addr), (uint8_t)(clearBits), (uint8_t)(setBits)) : \ - ((2UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalClearAndSet2Byte((volatile uint16_t *)(volatile void *)(addr), (uint16_t)(clearBits), (uint16_t)(setBits)) : \ - _SDK_AtomicLocalClearAndSet4Byte((volatile uint32_t *)(volatile void *)(addr), (uint32_t)(clearBits), (uint32_t)(setBits)))) -#else - -#define SDK_ATOMIC_LOCAL_ADD(addr, val) \ - do \ - { \ - uint32_t s_atomicOldInt; \ - s_atomicOldInt = DisableGlobalIRQ(); \ - *(addr) += (val); \ - EnableGlobalIRQ(s_atomicOldInt); \ - } while (false) - -#define SDK_ATOMIC_LOCAL_SUB(addr, val) \ - do \ - { \ - uint32_t s_atomicOldInt; \ - s_atomicOldInt = DisableGlobalIRQ(); \ - *(addr) -= (val); \ - EnableGlobalIRQ(s_atomicOldInt); \ - } while (false) - -#define SDK_ATOMIC_LOCAL_SET(addr, bits) \ - do \ - { \ - uint32_t s_atomicOldInt; \ - s_atomicOldInt = DisableGlobalIRQ(); \ - *(addr) |= (bits); \ - EnableGlobalIRQ(s_atomicOldInt); \ - } while (false) - -#define SDK_ATOMIC_LOCAL_CLEAR(addr, bits) \ - do \ - { \ - uint32_t s_atomicOldInt; \ - s_atomicOldInt = DisableGlobalIRQ(); \ - *(addr) &= ~(bits); \ - EnableGlobalIRQ(s_atomicOldInt); \ - } while (false) - -#define SDK_ATOMIC_LOCAL_TOGGLE(addr, bits) \ - do \ - { \ - uint32_t s_atomicOldInt; \ - s_atomicOldInt = DisableGlobalIRQ(); \ - *(addr) ^= (bits); \ - EnableGlobalIRQ(s_atomicOldInt); \ - } while (false) - -#define SDK_ATOMIC_LOCAL_CLEAR_AND_SET(addr, clearBits, setBits) \ - do \ - { \ - uint32_t s_atomicOldInt; \ - s_atomicOldInt = DisableGlobalIRQ(); \ - *(addr) = (*(addr) & ~(clearBits)) | (setBits); \ - EnableGlobalIRQ(s_atomicOldInt); \ - } while (false) - -#endif -/*! @} */ - -/*! @name Timer utilities */ -/*! @{ */ -/*! Macro to convert a microsecond period to raw count value */ -#define USEC_TO_COUNT(us, clockFreqInHz) (uint64_t)(((uint64_t)(us) * (clockFreqInHz)) / 1000000U) -/*! Macro to convert a raw count value to microsecond */ -#define COUNT_TO_USEC(count, clockFreqInHz) (uint64_t)((uint64_t)(count)*1000000U / (clockFreqInHz)) - -/*! Macro to convert a millisecond period to raw count value */ -#define MSEC_TO_COUNT(ms, clockFreqInHz) (uint64_t)((uint64_t)(ms) * (clockFreqInHz) / 1000U) -/*! Macro to convert a raw count value to millisecond */ -#define COUNT_TO_MSEC(count, clockFreqInHz) (uint64_t)((uint64_t)(count)*1000U / (clockFreqInHz)) -/*! @} */ - -/*! @name ISR exit barrier - * @{ - * - * ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping - * exception return operation might vector to incorrect interrupt. - * For Cortex-M7, if core speed much faster than peripheral register write speed, - * the peripheral interrupt flags may be still set after exiting ISR, this results to - * the same error similar with errata 83869. - */ -#if (defined __CORTEX_M) && ((__CORTEX_M == 4U) || (__CORTEX_M == 7U)) -#define SDK_ISR_EXIT_BARRIER __DSB() -#else -#define SDK_ISR_EXIT_BARRIER -#endif - -/*! @} */ - -/*! @name Alignment variable definition macros */ -/*! @{ */ -#if (defined(__ICCARM__)) -/* - * Workaround to disable MISRA C message suppress warnings for IAR compiler. - * http:/ /supp.iar.com/Support/?note=24725 - */ -_Pragma("diag_suppress=Pm120") -#define SDK_PRAGMA(x) _Pragma(#x) - _Pragma("diag_error=Pm120") -/*! Macro to define a variable with alignbytes alignment */ -#define SDK_ALIGN(var, alignbytes) SDK_PRAGMA(data_alignment = alignbytes) var -#elif defined(__CC_ARM) || defined(__ARMCC_VERSION) -/*! Macro to define a variable with alignbytes alignment */ -#define SDK_ALIGN(var, alignbytes) __attribute__((aligned(alignbytes))) var -#elif defined(__GNUC__) || defined(DOXYGEN_OUTPUT) -/*! Macro to define a variable with alignbytes alignment */ -#define SDK_ALIGN(var, alignbytes) var __attribute__((aligned(alignbytes))) -#else -#error Toolchain not supported -#endif - -/*! Macro to define a variable with L1 d-cache line size alignment */ -#if defined(FSL_FEATURE_L1DCACHE_LINESIZE_BYTE) -#define SDK_L1DCACHE_ALIGN(var) SDK_ALIGN(var, FSL_FEATURE_L1DCACHE_LINESIZE_BYTE) -#endif -/*! Macro to define a variable with L2 cache line size alignment */ -#if defined(FSL_FEATURE_L2CACHE_LINESIZE_BYTE) -#define SDK_L2CACHE_ALIGN(var) SDK_ALIGN(var, FSL_FEATURE_L2CACHE_LINESIZE_BYTE) -#endif - -/*! Macro to change a value to a given size aligned value */ -#define SDK_SIZEALIGN(var, alignbytes) \ - ((unsigned int)((var) + ((alignbytes)-1U)) & (unsigned int)(~(unsigned int)((alignbytes)-1U))) -/*! @} */ - -/*! - * @name Non-cacheable region definition macros - * - * For initialized non-zero non-cacheable variables, please use "AT_NONCACHEABLE_SECTION_INIT(var) ={xx};" or - * "AT_NONCACHEABLE_SECTION_ALIGN_INIT(var) ={xx};" in your projects to define them. For zero-inited non-cacheable - * variables, please use "AT_NONCACHEABLE_SECTION(var);" or "AT_NONCACHEABLE_SECTION_ALIGN(var);" to define them, - * these zero-inited variables will be initialized to zero in system startup. - * - * @note For GCC, when the non-cacheable section is required, please define "__STARTUP_INITIALIZE_NONCACHEDATA" - * in your projects to make sure the non-cacheable section variables will be initialized in system startup. - * - * @{ - */ - -/*! - * @def AT_NONCACHEABLE_SECTION(var) - * Define a variable \a var, and place it in non-cacheable section. - * - * @def AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) - * Define a variable \a var, and place it in non-cacheable section, the start address - * of the variable is aligned to \a alignbytes. - * - * @def AT_NONCACHEABLE_SECTION_INIT(var) - * Define a variable \a var with initial value, and place it in non-cacheable section. - * - * @def AT_NONCACHEABLE_SECTION_ALIGN_INIT(var, alignbytes) - * Define a variable \a var with initial value, and place it in non-cacheable section, - * the start address of the variable is aligned to \a alignbytes. - */ - -#if ((!(defined(FSL_FEATURE_HAS_NO_NONCACHEABLE_SECTION) && FSL_FEATURE_HAS_NO_NONCACHEABLE_SECTION)) && \ - defined(FSL_FEATURE_L1ICACHE_LINESIZE_BYTE)) - -#if (defined(__ICCARM__)) -#define AT_NONCACHEABLE_SECTION(var) var @"NonCacheable" -#define AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) SDK_PRAGMA(data_alignment = alignbytes) var @"NonCacheable" -#define AT_NONCACHEABLE_SECTION_INIT(var) var @"NonCacheable.init" -#define AT_NONCACHEABLE_SECTION_ALIGN_INIT(var, alignbytes) \ - SDK_PRAGMA(data_alignment = alignbytes) var @"NonCacheable.init" - -#elif (defined(__CC_ARM) || defined(__ARMCC_VERSION)) -#define AT_NONCACHEABLE_SECTION_INIT(var) __attribute__((section("NonCacheable.init"))) var -#define AT_NONCACHEABLE_SECTION_ALIGN_INIT(var, alignbytes) \ - __attribute__((section("NonCacheable.init"))) __attribute__((aligned(alignbytes))) var -#if (defined(__CC_ARM)) -#define AT_NONCACHEABLE_SECTION(var) __attribute__((section("NonCacheable"), zero_init)) var -#define AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) \ - __attribute__((section("NonCacheable"), zero_init)) __attribute__((aligned(alignbytes))) var -#else -#define AT_NONCACHEABLE_SECTION(var) __attribute__((section(".bss.NonCacheable"))) var -#define AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) \ - __attribute__((section(".bss.NonCacheable"))) __attribute__((aligned(alignbytes))) var -#endif - -#elif (defined(__GNUC__)) || defined(DOXYGEN_OUTPUT) -/* For GCC, when the non-cacheable section is required, please define "__STARTUP_INITIALIZE_NONCACHEDATA" - * in your projects to make sure the non-cacheable section variables will be initialized in system startup. - */ -#define AT_NONCACHEABLE_SECTION_INIT(var) __attribute__((section("NonCacheable.init"))) var -#define AT_NONCACHEABLE_SECTION_ALIGN_INIT(var, alignbytes) \ - __attribute__((section("NonCacheable.init"))) var __attribute__((aligned(alignbytes))) -#define AT_NONCACHEABLE_SECTION(var) __attribute__((section("NonCacheable,\"aw\",%nobits @"))) var -#define AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) \ - __attribute__((section("NonCacheable,\"aw\",%nobits @"))) var __attribute__((aligned(alignbytes))) -#else -#error Toolchain not supported. -#endif - -#else - -#define AT_NONCACHEABLE_SECTION(var) var -#define AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) SDK_ALIGN(var, alignbytes) -#define AT_NONCACHEABLE_SECTION_INIT(var) var -#define AT_NONCACHEABLE_SECTION_ALIGN_INIT(var, alignbytes) SDK_ALIGN(var, alignbytes) - -#endif - -/*! @} */ - -/*! - * @name Time sensitive region - * @{ - */ - -/*! - * @def AT_QUICKACCESS_SECTION_CODE(func) - * Place function in a section which can be accessed quickly by core. - * - * @def AT_QUICKACCESS_SECTION_DATA(var) - * Place data in a section which can be accessed quickly by core. - * - * @def AT_QUICKACCESS_SECTION_DATA_ALIGN(var, alignbytes) - * Place data in a section which can be accessed quickly by core, and the variable - * address is set to align with \a alignbytes. - */ -#if (defined(__ICCARM__)) -#define AT_QUICKACCESS_SECTION_CODE(func) func @"CodeQuickAccess" -#define AT_QUICKACCESS_SECTION_DATA(var) var @"DataQuickAccess" -#define AT_QUICKACCESS_SECTION_DATA_ALIGN(var, alignbytes) \ - SDK_PRAGMA(data_alignment = alignbytes) var @"DataQuickAccess" -#elif (defined(__CC_ARM) || defined(__ARMCC_VERSION)) -#define AT_QUICKACCESS_SECTION_CODE(func) __attribute__((section("CodeQuickAccess"), __noinline__)) func -#define AT_QUICKACCESS_SECTION_DATA(var) __attribute__((section("DataQuickAccess"))) var -#define AT_QUICKACCESS_SECTION_DATA_ALIGN(var, alignbytes) \ - __attribute__((section("DataQuickAccess"))) __attribute__((aligned(alignbytes))) var -#elif (defined(__GNUC__)) || defined(DOXYGEN_OUTPUT) -#define AT_QUICKACCESS_SECTION_CODE(func) __attribute__((section("CodeQuickAccess"), __noinline__)) func -#define AT_QUICKACCESS_SECTION_DATA(var) __attribute__((section("DataQuickAccess"))) var -#define AT_QUICKACCESS_SECTION_DATA_ALIGN(var, alignbytes) \ - __attribute__((section("DataQuickAccess"))) var __attribute__((aligned(alignbytes))) -#else -#error Toolchain not supported. -#endif /* defined(__ICCARM__) */ -/*! @} */ - -/*! - * @name Ram Function - * @{ - * - * @def RAMFUNCTION_SECTION_CODE(func) - * Place function in ram. - */ -#if (defined(__ICCARM__)) -#define RAMFUNCTION_SECTION_CODE(func) func @"RamFunction" -#elif (defined(__CC_ARM) || defined(__ARMCC_VERSION)) -#define RAMFUNCTION_SECTION_CODE(func) __attribute__((section("RamFunction"))) func -#elif (defined(__GNUC__)) || defined(DOXYGEN_OUTPUT) -#define RAMFUNCTION_SECTION_CODE(func) __attribute__((section("RamFunction"))) func -#else -#error Toolchain not supported. -#endif /* defined(__ICCARM__) */ -/*! @} */ - -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - void DefaultISR(void); -#endif - -/* - * The fsl_clock.h is included here because it needs MAKE_VERSION/MAKE_STATUS/status_t - * defined in previous of this file. - */ -#include "fsl_clock.h" - -/* - * Chip level peripheral reset API, for MCUs that implement peripheral reset control external to a peripheral - */ -#if ((defined(FSL_FEATURE_SOC_SYSCON_COUNT) && (FSL_FEATURE_SOC_SYSCON_COUNT > 0)) || \ - (defined(FSL_FEATURE_SOC_ASYNC_SYSCON_COUNT) && (FSL_FEATURE_SOC_ASYNC_SYSCON_COUNT > 0))) -#include "fsl_reset.h" -#endif - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus*/ - -/*! - * @brief Enable specific interrupt. - * - * Enable LEVEL1 interrupt. For some devices, there might be multiple interrupt - * levels. For example, there are NVIC and intmux. Here the interrupts connected - * to NVIC are the LEVEL1 interrupts, because they are routed to the core directly. - * The interrupts connected to intmux are the LEVEL2 interrupts, they are routed - * to NVIC first then routed to core. - * - * This function only enables the LEVEL1 interrupts. The number of LEVEL1 interrupts - * is indicated by the feature macro FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS. - * - * @param interrupt The IRQ number. - * @retval kStatus_Success Interrupt enabled successfully - * @retval kStatus_Fail Failed to enable the interrupt - */ -static inline status_t EnableIRQ(IRQn_Type interrupt) -{ - status_t status = kStatus_Success; - - if (NotAvail_IRQn == interrupt) - { - status = kStatus_Fail; - } - -#if defined(FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) && (FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS > 0) - else if ((int32_t)interrupt >= (int32_t)FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) - { - status = kStatus_Fail; - } -#endif - - else - { -#if defined(__GIC_PRIO_BITS) - GIC_EnableIRQ(interrupt); -#else - NVIC_EnableIRQ(interrupt); -#endif - } - - return status; -} - -/*! - * @brief Disable specific interrupt. - * - * Disable LEVEL1 interrupt. For some devices, there might be multiple interrupt - * levels. For example, there are NVIC and intmux. Here the interrupts connected - * to NVIC are the LEVEL1 interrupts, because they are routed to the core directly. - * The interrupts connected to intmux are the LEVEL2 interrupts, they are routed - * to NVIC first then routed to core. - * - * This function only disables the LEVEL1 interrupts. The number of LEVEL1 interrupts - * is indicated by the feature macro FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS. - * - * @param interrupt The IRQ number. - * @retval kStatus_Success Interrupt disabled successfully - * @retval kStatus_Fail Failed to disable the interrupt - */ -static inline status_t DisableIRQ(IRQn_Type interrupt) -{ - status_t status = kStatus_Success; - - if (NotAvail_IRQn == interrupt) - { - status = kStatus_Fail; - } - -#if defined(FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) && (FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS > 0) - else if ((int32_t)interrupt >= (int32_t)FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) - { - status = kStatus_Fail; - } -#endif - - else - { -#if defined(__GIC_PRIO_BITS) - GIC_DisableIRQ(interrupt); -#else - NVIC_DisableIRQ(interrupt); -#endif - } - - return status; -} - -/*! - * @brief Enable the IRQ, and also set the interrupt priority. - * - * Only handle LEVEL1 interrupt. For some devices, there might be multiple interrupt - * levels. For example, there are NVIC and intmux. Here the interrupts connected - * to NVIC are the LEVEL1 interrupts, because they are routed to the core directly. - * The interrupts connected to intmux are the LEVEL2 interrupts, they are routed - * to NVIC first then routed to core. - * - * This function only handles the LEVEL1 interrupts. The number of LEVEL1 interrupts - * is indicated by the feature macro FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS. - * - * @param interrupt The IRQ to Enable. - * @param priNum Priority number set to interrupt controller register. - * @retval kStatus_Success Interrupt priority set successfully - * @retval kStatus_Fail Failed to set the interrupt priority. - */ -static inline status_t EnableIRQWithPriority(IRQn_Type interrupt, uint8_t priNum) -{ - status_t status = kStatus_Success; - - if (NotAvail_IRQn == interrupt) - { - status = kStatus_Fail; - } - -#if defined(FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) && (FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS > 0) - else if ((int32_t)interrupt >= (int32_t)FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) - { - status = kStatus_Fail; - } -#endif - - else - { -#if defined(__GIC_PRIO_BITS) - GIC_SetPriority(interrupt, priNum); - GIC_EnableIRQ(interrupt); -#else - NVIC_SetPriority(interrupt, priNum); - NVIC_EnableIRQ(interrupt); -#endif - } - - return status; -} - -/*! - * @brief Set the IRQ priority. - * - * Only handle LEVEL1 interrupt. For some devices, there might be multiple interrupt - * levels. For example, there are NVIC and intmux. Here the interrupts connected - * to NVIC are the LEVEL1 interrupts, because they are routed to the core directly. - * The interrupts connected to intmux are the LEVEL2 interrupts, they are routed - * to NVIC first then routed to core. - * - * This function only handles the LEVEL1 interrupts. The number of LEVEL1 interrupts - * is indicated by the feature macro FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS. - * - * @param interrupt The IRQ to set. - * @param priNum Priority number set to interrupt controller register. - * - * @retval kStatus_Success Interrupt priority set successfully - * @retval kStatus_Fail Failed to set the interrupt priority. - */ -static inline status_t IRQ_SetPriority(IRQn_Type interrupt, uint8_t priNum) -{ - status_t status = kStatus_Success; - - if (NotAvail_IRQn == interrupt) - { - status = kStatus_Fail; - } - -#if defined(FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) && (FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS > 0) - else if ((int32_t)interrupt >= (int32_t)FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) - { - status = kStatus_Fail; - } -#endif - - else - { -#if defined(__GIC_PRIO_BITS) - GIC_SetPriority(interrupt, priNum); -#else - NVIC_SetPriority(interrupt, priNum); -#endif - } - - return status; -} - -/*! - * @brief Clear the pending IRQ flag. - * - * Only handle LEVEL1 interrupt. For some devices, there might be multiple interrupt - * levels. For example, there are NVIC and intmux. Here the interrupts connected - * to NVIC are the LEVEL1 interrupts, because they are routed to the core directly. - * The interrupts connected to intmux are the LEVEL2 interrupts, they are routed - * to NVIC first then routed to core. - * - * This function only handles the LEVEL1 interrupts. The number of LEVEL1 interrupts - * is indicated by the feature macro FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS. - * - * @param interrupt The flag which IRQ to clear. - * - * @retval kStatus_Success Interrupt priority set successfully - * @retval kStatus_Fail Failed to set the interrupt priority. - */ -static inline status_t IRQ_ClearPendingIRQ(IRQn_Type interrupt) -{ - status_t status = kStatus_Success; - - if (NotAvail_IRQn == interrupt) - { - status = kStatus_Fail; - } - -#if defined(FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) && (FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS > 0) - else if ((int32_t)interrupt >= (int32_t)FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) - { - status = kStatus_Fail; - } -#endif - - else - { -#if defined(__GIC_PRIO_BITS) - GIC_ClearPendingIRQ(interrupt); -#else - NVIC_ClearPendingIRQ(interrupt); -#endif - } - - return status; -} - -/*! - * @brief Disable the global IRQ - * - * Disable the global interrupt and return the current primask register. User is required to provided the primask - * register for the EnableGlobalIRQ(). - * - * @return Current primask value. - */ -static inline uint32_t DisableGlobalIRQ(void) -{ - uint32_t mask; - -#if defined(CPSR_I_Msk) - mask = __get_CPSR() & CPSR_I_Msk; -#elif defined(DAIF_I_BIT) - mask = __get_DAIF() & DAIF_I_BIT; -#else - mask = __get_PRIMASK(); -#endif - __disable_irq(); - - return mask; -} - -/*! - * @brief Enable the global IRQ - * - * Set the primask register with the provided primask value but not just enable the primask. The idea is for the - * convenience of integration of RTOS. some RTOS get its own management mechanism of primask. User is required to - * use the EnableGlobalIRQ() and DisableGlobalIRQ() in pair. - * - * @param primask value of primask register to be restored. The primask value is supposed to be provided by the - * DisableGlobalIRQ(). - */ -static inline void EnableGlobalIRQ(uint32_t primask) -{ -#if defined(CPSR_I_Msk) - __set_CPSR((__get_CPSR() & ~CPSR_I_Msk) | primask); -#elif defined(DAIF_I_BIT) - if (0UL == primask) - { - __enable_irq(); - } -#else - __set_PRIMASK(primask); -#endif -} - -#if defined(ENABLE_RAM_VECTOR_TABLE) -/*! - * @brief install IRQ handler - * - * @param irq IRQ number - * @param irqHandler IRQ handler address - * @return The old IRQ handler address - */ -uint32_t InstallIRQHandler(IRQn_Type irq, uint32_t irqHandler); -#endif /* ENABLE_RAM_VECTOR_TABLE. */ - -#if (defined(FSL_FEATURE_SOC_SYSCON_COUNT) && (FSL_FEATURE_SOC_SYSCON_COUNT > 0)) - -/* - * When FSL_FEATURE_POWERLIB_EXTEND is defined to non-zero value, - * powerlib should be used instead of these functions. - */ -#if !(defined(FSL_FEATURE_POWERLIB_EXTEND) && (FSL_FEATURE_POWERLIB_EXTEND != 0)) -/*! - * @brief Enable specific interrupt for wake-up from deep-sleep mode. - * - * Enable the interrupt for wake-up from deep sleep mode. - * Some interrupts are typically used in sleep mode only and will not occur during - * deep-sleep mode because relevant clocks are stopped. However, it is possible to enable - * those clocks (significantly increasing power consumption in the reduced power mode), - * making these wake-ups possible. - * - * @note This function also enables the interrupt in the NVIC (EnableIRQ() is called internaly). - * - * @param interrupt The IRQ number. - */ -void EnableDeepSleepIRQ(IRQn_Type interrupt); - -/*! - * @brief Disable specific interrupt for wake-up from deep-sleep mode. - * - * Disable the interrupt for wake-up from deep sleep mode. - * Some interrupts are typically used in sleep mode only and will not occur during - * deep-sleep mode because relevant clocks are stopped. However, it is possible to enable - * those clocks (significantly increasing power consumption in the reduced power mode), - * making these wake-ups possible. - * - * @note This function also disables the interrupt in the NVIC (DisableIRQ() is called internaly). - * - * @param interrupt The IRQ number. - */ -void DisableDeepSleepIRQ(IRQn_Type interrupt); -#endif /* FSL_FEATURE_POWERLIB_EXTEND */ -#endif /* FSL_FEATURE_SOC_SYSCON_COUNT */ - -#if defined(DWT) -/*! - * @brief Enable the counter to get CPU cycles. - */ -void MSDK_EnableCpuCycleCounter(void); - -/*! - * @brief Get the current CPU cycle count. - * - * @return Current CPU cycle count. - */ -uint32_t MSDK_GetCpuCycleCount(void); -#endif - -#if defined(__cplusplus) -} -#endif /* __cplusplus*/ - -/*! @} */ - -#endif /* FSL_COMMON_ARM_H_ */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_cop.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_cop.c deleted file mode 100644 index a4e8350c10a..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_cop.c +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2017 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_cop.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.cop" -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Initializes the COP configuration structure. - * - * This function initializes the COP configuration structure to default values. The default - * values are: - * code - * copConfig->enableWindowMode = false; - * copConfig->timeoutMode = kCOP_LongTimeoutMode; - * copConfig->enableStop = false; - * copConfig->enableDebug = false; - * copConfig->clockSource = kCOP_LpoClock; - * copConfig->timeoutCycles = kCOP_2Power10CyclesOr2Power18Cycles; - * endcode - * - * param config Pointer to the COP configuration structure. - * see cop_config_t - */ -void COP_GetDefaultConfig(cop_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->enableWindowMode = false; -#if defined(FSL_FEATURE_COP_HAS_LONGTIME_MODE) && FSL_FEATURE_COP_HAS_LONGTIME_MODE - config->timeoutMode = kCOP_LongTimeoutMode; - config->enableStop = false; - config->enableDebug = false; -#endif /* FSL_FEATURE_COP_HAS_LONGTIME_MODE */ - config->clockSource = kCOP_LpoClock; - config->timeoutCycles = kCOP_2Power10CyclesOr2Power18Cycles; -} - -/*! - * brief Initializes the COP module. - * - * This function configures the COP. After it is called, the COP - * starts running according to the configuration. - * Because all COP control registers are write-once only, the COP_Init function - * and the COP_Disable function can be called only once. A second call has no effect. - * - * Example: - * code - * cop_config_t config; - * COP_GetDefaultConfig(&config); - * config.timeoutCycles = kCOP_2Power8CyclesOr2Power16Cycles; - * COP_Init(sim_base,&config); - * endcode - * - * param base SIM peripheral base address. - * param config The configuration of COP. - */ -void COP_Init(SIM_Type *base, const cop_config_t *config) -{ - assert(NULL != config); - - uint32_t value = 0U; - -#if defined(FSL_FEATURE_COP_HAS_LONGTIME_MODE) && FSL_FEATURE_COP_HAS_LONGTIME_MODE - value = SIM_COPC_COPW(config->enableWindowMode) | SIM_COPC_COPCLKS(config->timeoutMode) | - SIM_COPC_COPT(config->timeoutCycles) | SIM_COPC_COPSTPEN(config->enableStop) | - SIM_COPC_COPDBGEN(config->enableDebug) | SIM_COPC_COPCLKSEL(config->clockSource); -#else - value = SIM_COPC_COPW(config->enableWindowMode) | SIM_COPC_COPCLKS(config->clockSource) | - SIM_COPC_COPT(config->timeoutCycles); -#endif /* FSL_FEATURE_COP_HAS_LONGTIME_MODE */ - base->COPC = value; -} - -/*! - * brief Refreshes the COP timer - * - * This function feeds the COP. - * - * param base SIM peripheral base address. - */ -void COP_Refresh(SIM_Type *base) -{ - uint32_t primaskValue = 0U; - - /* Disable the global interrupt to protect refresh sequence */ - primaskValue = DisableGlobalIRQ(); - base->SRVCOP = COP_FIRST_BYTE_OF_REFRESH; - base->SRVCOP = COP_SECOND_BYTE_OF_REFRESH; - EnableGlobalIRQ(primaskValue); -} diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_cop.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_cop.h deleted file mode 100644 index 0005281ed9b..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_cop.h +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2018 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_COP_H_ -#define FSL_COP_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup cop - * @{ - */ - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief COP driver version 2.0.1. */ -#define FSL_COP_DRIVER_VERSION (MAKE_VERSION(2, 0, 1)) -/*! @} */ - -/*! @name COP refresh sequence. */ -/*! @{ */ -#define COP_FIRST_BYTE_OF_REFRESH (0x55U) /*!< First byte of refresh sequence */ -#define COP_SECOND_BYTE_OF_REFRESH (0xAAU) /*!< Second byte of refresh sequence */ -/*! @} */ - -/*! @brief COP clock source selection. */ -typedef enum _cop_clock_source -{ - kCOP_LpoClock = 0U, /*!< COP clock sourced from LPO */ -#if defined(FSL_FEATURE_COP_HAS_MORE_CLKSRC) && FSL_FEATURE_COP_HAS_MORE_CLKSRC - kCOP_McgIrClock = 1U, /*!< COP clock sourced from MCGIRCLK */ - kCOP_OscErClock = 2U, /*!< COP clock sourced from OSCERCLK */ -#endif /* FSL_FEATURE_COP_HAS_MORE_CLKSRC */ - kCOP_BusClock = 3U, /*!< COP clock sourced from Bus clock */ -} cop_clock_source_t; - -/*! @brief Define the COP timeout cycles. */ -typedef enum _cop_timeout_cycles -{ - kCOP_2Power5CyclesOr2Power13Cycles = 1U, /*!< 2^5 or 2^13 clock cycles */ - kCOP_2Power8CyclesOr2Power16Cycles = 2U, /*!< 2^8 or 2^16 clock cycles */ - kCOP_2Power10CyclesOr2Power18Cycles = 3U, /*!< 2^10 or 2^18 clock cycles */ -} cop_timeout_cycles_t; - -#if defined(FSL_FEATURE_COP_HAS_LONGTIME_MODE) && FSL_FEATURE_COP_HAS_LONGTIME_MODE -/*! @brief Define the COP timeout mode. */ -typedef enum _cop_timeout_mode -{ - kCOP_ShortTimeoutMode = 0U, /*!< COP selects long timeout */ - kCOP_LongTimeoutMode = 1U, /*!< COP selects short timeout */ -} cop_timeout_mode_t; -#endif /* FSL_FEATURE_COP_HAS_LONGTIME_MODE */ - -/*! @brief Describes COP configuration structure. */ -typedef struct _cop_config -{ - bool enableWindowMode; /*!< COP run mode: window mode or normal mode */ -#if defined(FSL_FEATURE_COP_HAS_LONGTIME_MODE) && FSL_FEATURE_COP_HAS_LONGTIME_MODE - cop_timeout_mode_t timeoutMode; /*!< COP timeout mode: long timeout or short timeout */ - bool enableStop; /*!< Enable or disable COP in STOP mode */ - bool enableDebug; /*!< Enable or disable COP in DEBUG mode */ -#endif /* FSL_FEATURE_COP_HAS_LONGTIME_MODE */ - cop_clock_source_t clockSource; /*!< Set COP clock source */ - cop_timeout_cycles_t timeoutCycles; /*!< Set COP timeout value */ -} cop_config_t; - -/******************************************************************************* - * API - *******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus*/ - -/*! - * @name COP Functional Operation - * @{ - */ - -/*! - * @brief Initializes the COP configuration structure. - * - * This function initializes the COP configuration structure to default values. The default - * values are: - * @code - * copConfig->enableWindowMode = false; - * copConfig->timeoutMode = kCOP_LongTimeoutMode; - * copConfig->enableStop = false; - * copConfig->enableDebug = false; - * copConfig->clockSource = kCOP_LpoClock; - * copConfig->timeoutCycles = kCOP_2Power10CyclesOr2Power18Cycles; - * @endcode - * - * @param config Pointer to the COP configuration structure. - * @see cop_config_t - */ -void COP_GetDefaultConfig(cop_config_t *config); - -/*! - * @brief Initializes the COP module. - * - * This function configures the COP. After it is called, the COP - * starts running according to the configuration. - * Because all COP control registers are write-once only, the COP_Init function - * and the COP_Disable function can be called only once. A second call has no effect. - * - * Example: - * @code - * cop_config_t config; - * COP_GetDefaultConfig(&config); - * config.timeoutCycles = kCOP_2Power8CyclesOr2Power16Cycles; - * COP_Init(sim_base,&config); - * @endcode - * - * @param base SIM peripheral base address. - * @param config The configuration of COP. - */ -void COP_Init(SIM_Type *base, const cop_config_t *config); - -/*! - * @brief De-initializes the COP module. - * This dedicated function is not provided. Instead, the COP_Disable function can be used to disable the COP. - */ - -/*! - * @brief Disables the COP module. - * - * This function disables the COP Watchdog. - * Note: The COP configuration register is a write-once after reset. - * To disable the COP Watchdog, call this function first. - * - * @param base SIM peripheral base address. - */ -static inline void COP_Disable(SIM_Type *base) -{ - base->COPC &= ~SIM_COPC_COPT_MASK; -} - -/*! - * @brief Refreshes the COP timer - * - * This function feeds the COP. - * - * @param base SIM peripheral base address. - */ -void COP_Refresh(SIM_Type *base); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @}*/ - -#endif /* FSL_COP_H_ */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_dac.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_dac.c deleted file mode 100644 index 85b5412b482..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_dac.c +++ /dev/null @@ -1,300 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2019 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_dac.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.dac" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Get instance number for DAC module. - * - * @param base DAC peripheral base address - */ -static uint32_t DAC_GetInstance(DAC_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to DAC bases for each instance. */ -static DAC_Type *const s_dacBases[] = DAC_BASE_PTRS; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to DAC clocks for each instance. */ -static const clock_ip_name_t s_dacClocks[] = DAC_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/******************************************************************************* - * Codes - ******************************************************************************/ -static uint32_t DAC_GetInstance(DAC_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_dacBases); instance++) - { - if (s_dacBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_dacBases)); - - return instance; -} - -/*! - * brief Initializes the DAC module. - * - * This function initializes the DAC module including the following operations. - * - Enabling the clock for DAC module. - * - Configuring the DAC converter with a user configuration. - * - Enabling the DAC module. - * - * param base DAC peripheral base address. - * param config Pointer to the configuration structure. See "dac_config_t". - */ -void DAC_Init(DAC_Type *base, const dac_config_t *config) -{ - assert(NULL != config); - - uint8_t tmp8; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock. */ - CLOCK_EnableClock(s_dacClocks[DAC_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Configure. */ - /* DACx_C0. */ - tmp8 = base->C0 & (uint8_t)(~(DAC_C0_DACRFS_MASK | DAC_C0_LPEN_MASK)); - if (kDAC_ReferenceVoltageSourceVref2 == config->referenceVoltageSource) - { - tmp8 |= DAC_C0_DACRFS_MASK; - } - if (config->enableLowPowerMode) - { - tmp8 |= DAC_C0_LPEN_MASK; - } - base->C0 = tmp8; - - /* DAC_Enable(base, true); */ - /* Tip: The DAC output can be enabled till then after user sets their own available data in application. */ -} - -/*! - * brief De-initializes the DAC module. - * - * This function de-initializes the DAC module including the following operations. - * - Disabling the DAC module. - * - Disabling the clock for the DAC module. - * - * param base DAC peripheral base address. - */ -void DAC_Deinit(DAC_Type *base) -{ - DAC_Enable(base, false); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable the clock. */ - CLOCK_DisableClock(s_dacClocks[DAC_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Initializes the DAC user configuration structure. - * - * This function initializes the user configuration structure to a default value. The default values are as follows. - * code - * config->referenceVoltageSource = kDAC_ReferenceVoltageSourceVref2; - * config->enableLowPowerMode = false; - * endcode - * param config Pointer to the configuration structure. See "dac_config_t". - */ -void DAC_GetDefaultConfig(dac_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->referenceVoltageSource = kDAC_ReferenceVoltageSourceVref2; - config->enableLowPowerMode = false; -} - -/*! - * brief Configures the CMP buffer. - * - * param base DAC peripheral base address. - * param config Pointer to the configuration structure. See "dac_buffer_config_t". - */ -void DAC_SetBufferConfig(DAC_Type *base, const dac_buffer_config_t *config) -{ - assert(NULL != config); - - uint8_t tmp8; - - /* DACx_C0. */ - tmp8 = base->C0 & (uint8_t)(~DAC_C0_DACTRGSEL_MASK); - if (kDAC_BufferTriggerBySoftwareMode == config->triggerMode) - { - tmp8 |= DAC_C0_DACTRGSEL_MASK; - } - base->C0 = tmp8; - - /* DACx_C1. */ - tmp8 = base->C1 & (uint8_t)(~( -#if defined(FSL_FEATURE_DAC_HAS_WATERMARK_SELECTION) && FSL_FEATURE_DAC_HAS_WATERMARK_SELECTION - DAC_C1_DACBFWM_MASK | -#endif /* FSL_FEATURE_DAC_HAS_WATERMARK_SELECTION */ - DAC_C1_DACBFMD_MASK)); -#if defined(FSL_FEATURE_DAC_HAS_WATERMARK_SELECTION) && FSL_FEATURE_DAC_HAS_WATERMARK_SELECTION - tmp8 |= DAC_C1_DACBFWM(config->watermark); -#endif /* FSL_FEATURE_DAC_HAS_WATERMARK_SELECTION */ - tmp8 |= DAC_C1_DACBFMD(config->workMode); - base->C1 = tmp8; - - /* DACx_C2. */ - tmp8 = base->C2 & (uint8_t)(~DAC_C2_DACBFUP_MASK); - tmp8 |= DAC_C2_DACBFUP(config->upperLimit); - base->C2 = tmp8; -} - -/*! - * brief Initializes the DAC buffer configuration structure. - * - * This function initializes the DAC buffer configuration structure to default values. The default values are as - * follows. - * code - * config->triggerMode = kDAC_BufferTriggerBySoftwareMode; - * config->watermark = kDAC_BufferWatermark1Word; - * config->workMode = kDAC_BufferWorkAsNormalMode; - * config->upperLimit = DAC_DATL_COUNT - 1U; - * endcode - * param config Pointer to the configuration structure. See "dac_buffer_config_t". - */ -void DAC_GetDefaultBufferConfig(dac_buffer_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->triggerMode = kDAC_BufferTriggerBySoftwareMode; -#if defined(FSL_FEATURE_DAC_HAS_WATERMARK_SELECTION) && FSL_FEATURE_DAC_HAS_WATERMARK_SELECTION - config->watermark = kDAC_BufferWatermark1Word; -#endif /* FSL_FEATURE_DAC_HAS_WATERMARK_SELECTION */ - config->workMode = kDAC_BufferWorkAsNormalMode; - config->upperLimit = DAC_DATL_COUNT - 1U; -} - -/*! - * brief Sets the value for items in the buffer. - * - * param base DAC peripheral base address. - * param index Setting the index for items in the buffer. The available index should not exceed the size of the DAC - * buffer. - * param value Setting the value for items in the buffer. 12-bits are available. - */ -void DAC_SetBufferValue(DAC_Type *base, uint8_t index, uint16_t value) -{ - assert(index < DAC_DATL_COUNT); - - base->DAT[index].DATL = (uint8_t)(0xFFU & value); /* Low 8-bit. */ - base->DAT[index].DATH = (uint8_t)((0xF00U & value) >> 8); /* High 4-bit. */ -} - -/*! - * brief Sets the current read pointer of the DAC buffer. - * - * This function sets the current read pointer of the DAC buffer. - * The current output value depends on the item indexed by the read pointer. It is updated either by a - * software trigger or a hardware trigger. After the read pointer changes, the DAC output value also changes. - * - * param base DAC peripheral base address. - * param index Setting an index value for the pointer. - */ -void DAC_SetBufferReadPointer(DAC_Type *base, uint8_t index) -{ - assert(index < DAC_DATL_COUNT); - - uint8_t tmp8 = base->C2 & (uint8_t)(~DAC_C2_DACBFRP_MASK); - - tmp8 |= DAC_C2_DACBFRP(index); - base->C2 = tmp8; -} - -/*! - * brief Enables interrupts for the DAC buffer. - * - * param base DAC peripheral base address. - * param mask Mask value for interrupts. See "_dac_buffer_interrupt_enable". - */ -void DAC_EnableBufferInterrupts(DAC_Type *base, uint32_t mask) -{ - mask &= ( -#if defined(FSL_FEATURE_DAC_HAS_WATERMARK_DETECTION) && FSL_FEATURE_DAC_HAS_WATERMARK_DETECTION - DAC_C0_DACBWIEN_MASK | -#endif /* FSL_FEATURE_DAC_HAS_WATERMARK_DETECTION */ - DAC_C0_DACBTIEN_MASK | DAC_C0_DACBBIEN_MASK); - base->C0 |= ((uint8_t)mask); /* Write 1 to enable. */ -} - -/*! - * brief Disables interrupts for the DAC buffer. - * - * param base DAC peripheral base address. - * param mask Mask value for interrupts. See "_dac_buffer_interrupt_enable". - */ -void DAC_DisableBufferInterrupts(DAC_Type *base, uint32_t mask) -{ - mask &= ( -#if defined(FSL_FEATURE_DAC_HAS_WATERMARK_DETECTION) && FSL_FEATURE_DAC_HAS_WATERMARK_DETECTION - DAC_C0_DACBWIEN_MASK | -#endif /* FSL_FEATURE_DAC_HAS_WATERMARK_DETECTION */ - DAC_C0_DACBTIEN_MASK | DAC_C0_DACBBIEN_MASK); - base->C0 &= (uint8_t)(~((uint8_t)mask)); /* Write 0 to disable. */ -} - -/*! - * brief Gets the flags of events for the DAC buffer. - * - * param base DAC peripheral base address. - * - * return Mask value for the asserted flags. See "_dac_buffer_status_flags". - */ -uint8_t DAC_GetBufferStatusFlags(DAC_Type *base) -{ - return base->SR & ( -#if defined(FSL_FEATURE_DAC_HAS_WATERMARK_DETECTION) && FSL_FEATURE_DAC_HAS_WATERMARK_DETECTION - DAC_SR_DACBFWMF_MASK | -#endif /* FSL_FEATURE_DAC_HAS_WATERMARK_DETECTION */ - DAC_SR_DACBFRPTF_MASK | DAC_SR_DACBFRPBF_MASK); -} - -/*! - * brief Clears the flags of events for the DAC buffer. - * - * param base DAC peripheral base address. - * param mask Mask value for flags. See "_dac_buffer_status_flags_t". - */ -void DAC_ClearBufferStatusFlags(DAC_Type *base, uint32_t mask) -{ - mask &= ( -#if defined(FSL_FEATURE_DAC_HAS_WATERMARK_DETECTION) && FSL_FEATURE_DAC_HAS_WATERMARK_DETECTION - DAC_SR_DACBFWMF_MASK | -#endif /* FSL_FEATURE_DAC_HAS_WATERMARK_DETECTION */ - DAC_SR_DACBFRPTF_MASK | DAC_SR_DACBFRPBF_MASK); - base->SR &= (uint8_t)(~((uint8_t)mask)); /* Write 0 to clear flags. */ -} diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_dac.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_dac.h deleted file mode 100644 index 18650deee61..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_dac.h +++ /dev/null @@ -1,357 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2019 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_DAC_H_ -#define FSL_DAC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup dac - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief DAC driver version 2.0.2. */ -#define FSL_DAC_DRIVER_VERSION (MAKE_VERSION(2, 0, 2)) -/*! @} */ - -/*! - * @brief DAC buffer flags. - */ -enum _dac_buffer_status_flags -{ -#if defined(FSL_FEATURE_DAC_HAS_WATERMARK_DETECTION) && FSL_FEATURE_DAC_HAS_WATERMARK_DETECTION - kDAC_BufferWatermarkFlag = DAC_SR_DACBFWMF_MASK, /*!< DAC Buffer Watermark Flag. */ -#endif /* FSL_FEATURE_DAC_HAS_WATERMARK_DETECTION */ - kDAC_BufferReadPointerTopPositionFlag = DAC_SR_DACBFRPTF_MASK, /*!< DAC Buffer Read Pointer Top Position Flag. */ - kDAC_BufferReadPointerBottomPositionFlag = DAC_SR_DACBFRPBF_MASK, /*!< DAC Buffer Read Pointer Bottom Position - Flag. */ -}; - -/*! - * @brief DAC buffer interrupts. - */ -enum _dac_buffer_interrupt_enable -{ -#if defined(FSL_FEATURE_DAC_HAS_WATERMARK_DETECTION) && FSL_FEATURE_DAC_HAS_WATERMARK_DETECTION - kDAC_BufferWatermarkInterruptEnable = DAC_C0_DACBWIEN_MASK, /*!< DAC Buffer Watermark Interrupt Enable. */ -#endif /* FSL_FEATURE_DAC_HAS_WATERMARK_DETECTION */ - kDAC_BufferReadPointerTopInterruptEnable = DAC_C0_DACBTIEN_MASK, /*!< DAC Buffer Read Pointer Top Flag Interrupt - Enable. */ - kDAC_BufferReadPointerBottomInterruptEnable = DAC_C0_DACBBIEN_MASK, /*!< DAC Buffer Read Pointer Bottom Flag - Interrupt Enable */ -}; - -/*! - * @brief DAC reference voltage source. - */ -typedef enum _dac_reference_voltage_source -{ - kDAC_ReferenceVoltageSourceVref1 = 0U, /*!< The DAC selects DACREF_1 as the reference voltage. */ - kDAC_ReferenceVoltageSourceVref2 = 1U, /*!< The DAC selects DACREF_2 as the reference voltage. */ -} dac_reference_voltage_source_t; - -/*! - * @brief DAC buffer trigger mode. - */ -typedef enum _dac_buffer_trigger_mode -{ - kDAC_BufferTriggerByHardwareMode = 0U, /*!< The DAC hardware trigger is selected. */ - kDAC_BufferTriggerBySoftwareMode = 1U, /*!< The DAC software trigger is selected. */ -} dac_buffer_trigger_mode_t; - -#if defined(FSL_FEATURE_DAC_HAS_WATERMARK_SELECTION) && FSL_FEATURE_DAC_HAS_WATERMARK_SELECTION -/*! - * @brief DAC buffer watermark. - */ -typedef enum _dac_buffer_watermark -{ -#if defined(FSL_FEATURE_DAC_HAS_WATERMARK_1_WORD) && FSL_FEATURE_DAC_HAS_WATERMARK_1_WORD - kDAC_BufferWatermark1Word = 0U, /*!< 1 word away from the upper limit. */ -#endif /* FSL_FEATURE_DAC_HAS_WATERMARK_1_WORD */ -#if defined(FSL_FEATURE_DAC_HAS_WATERMARK_2_WORDS) && FSL_FEATURE_DAC_HAS_WATERMARK_2_WORDS - kDAC_BufferWatermark2Word = 1U, /*!< 2 words away from the upper limit. */ -#endif /* FSL_FEATURE_DAC_HAS_WATERMARK_2_WORDS */ -#if defined(FSL_FEATURE_DAC_HAS_WATERMARK_3_WORDS) && FSL_FEATURE_DAC_HAS_WATERMARK_3_WORDS - kDAC_BufferWatermark3Word = 2U, /*!< 3 words away from the upper limit. */ -#endif /* FSL_FEATURE_DAC_HAS_WATERMARK_3_WORDS */ -#if defined(FSL_FEATURE_DAC_HAS_WATERMARK_4_WORDS) && FSL_FEATURE_DAC_HAS_WATERMARK_4_WORDS - kDAC_BufferWatermark4Word = 3U, /*!< 4 words away from the upper limit. */ -#endif /* FSL_FEATURE_DAC_HAS_WATERMARK_4_WORDS */ -} dac_buffer_watermark_t; -#endif /* FSL_FEATURE_DAC_HAS_WATERMARK_SELECTION */ - -/*! - * @brief DAC buffer work mode. - */ -typedef enum _dac_buffer_work_mode -{ - kDAC_BufferWorkAsNormalMode = 0U, /*!< Normal mode. */ -#if defined(FSL_FEATURE_DAC_HAS_BUFFER_SWING_MODE) && FSL_FEATURE_DAC_HAS_BUFFER_SWING_MODE - kDAC_BufferWorkAsSwingMode, /*!< Swing mode. */ -#endif /* FSL_FEATURE_DAC_HAS_BUFFER_SWING_MODE */ - kDAC_BufferWorkAsOneTimeScanMode, /*!< One-Time Scan mode. */ -#if defined(FSL_FEATURE_DAC_HAS_BUFFER_FIFO_MODE) && FSL_FEATURE_DAC_HAS_BUFFER_FIFO_MODE - kDAC_BufferWorkAsFIFOMode, /*!< FIFO mode. */ -#endif /* FSL_FEATURE_DAC_HAS_BUFFER_FIFO_MODE */ -} dac_buffer_work_mode_t; - -/*! - * @brief DAC module configuration. - */ -typedef struct _dac_config -{ - dac_reference_voltage_source_t referenceVoltageSource; /*!< Select the DAC reference voltage source. */ - bool enableLowPowerMode; /*!< Enable the low-power mode. */ -} dac_config_t; - -/*! - * @brief DAC buffer configuration. - */ -typedef struct _dac_buffer_config -{ - dac_buffer_trigger_mode_t triggerMode; /*!< Select the buffer's trigger mode. */ -#if defined(FSL_FEATURE_DAC_HAS_WATERMARK_SELECTION) && FSL_FEATURE_DAC_HAS_WATERMARK_SELECTION - dac_buffer_watermark_t watermark; /*!< Select the buffer's watermark. */ -#endif /* FSL_FEATURE_DAC_HAS_WATERMARK_SELECTION */ - dac_buffer_work_mode_t workMode; /*!< Select the buffer's work mode. */ - uint8_t upperLimit; /*!< Set the upper limit for the buffer index. - Normally, 0-15 is available for a buffer with 16 items. */ -} dac_buffer_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization - * @{ - */ - -/*! - * @brief Initializes the DAC module. - * - * This function initializes the DAC module including the following operations. - * - Enabling the clock for DAC module. - * - Configuring the DAC converter with a user configuration. - * - Enabling the DAC module. - * - * @param base DAC peripheral base address. - * @param config Pointer to the configuration structure. See "dac_config_t". - */ -void DAC_Init(DAC_Type *base, const dac_config_t *config); - -/*! - * @brief De-initializes the DAC module. - * - * This function de-initializes the DAC module including the following operations. - * - Disabling the DAC module. - * - Disabling the clock for the DAC module. - * - * @param base DAC peripheral base address. - */ -void DAC_Deinit(DAC_Type *base); - -/*! - * @brief Initializes the DAC user configuration structure. - * - * This function initializes the user configuration structure to a default value. The default values are as follows. - * @code - * config->referenceVoltageSource = kDAC_ReferenceVoltageSourceVref2; - * config->enableLowPowerMode = false; - * @endcode - * @param config Pointer to the configuration structure. See "dac_config_t". - */ -void DAC_GetDefaultConfig(dac_config_t *config); - -/*! - * @brief Enables the DAC module. - * - * @param base DAC peripheral base address. - * @param enable Enables or disables the feature. - */ -static inline void DAC_Enable(DAC_Type *base, bool enable) -{ - if (enable) - { - base->C0 |= (uint8_t)DAC_C0_DACEN_MASK; - } - else - { - base->C0 &= (uint8_t)(~DAC_C0_DACEN_MASK); - } -} - -/*! @} */ - -/*! - * @name Buffer - * @{ - */ - -/*! - * @brief Enables the DAC buffer. - * - * @param base DAC peripheral base address. - * @param enable Enables or disables the feature. - */ -static inline void DAC_EnableBuffer(DAC_Type *base, bool enable) -{ - if (enable) - { - base->C1 |= (uint8_t)DAC_C1_DACBFEN_MASK; - } - else - { - base->C1 &= (uint8_t)(~DAC_C1_DACBFEN_MASK); - } -} - -/*! - * @brief Configures the CMP buffer. - * - * @param base DAC peripheral base address. - * @param config Pointer to the configuration structure. See "dac_buffer_config_t". - */ -void DAC_SetBufferConfig(DAC_Type *base, const dac_buffer_config_t *config); - -/*! - * @brief Initializes the DAC buffer configuration structure. - * - * This function initializes the DAC buffer configuration structure to default values. The default values are as - * follows. - * @code - * config->triggerMode = kDAC_BufferTriggerBySoftwareMode; - * config->watermark = kDAC_BufferWatermark1Word; - * config->workMode = kDAC_BufferWorkAsNormalMode; - * config->upperLimit = DAC_DATL_COUNT - 1U; - * @endcode - * @param config Pointer to the configuration structure. See "dac_buffer_config_t". - */ -void DAC_GetDefaultBufferConfig(dac_buffer_config_t *config); - -/*! - * @brief Enables the DMA for DAC buffer. - * - * @param base DAC peripheral base address. - * @param enable Enables or disables the feature. - */ -static inline void DAC_EnableBufferDMA(DAC_Type *base, bool enable) -{ - if (enable) - { - base->C1 |= (uint8_t)DAC_C1_DMAEN_MASK; - } - else - { - base->C1 &= (uint8_t)(~DAC_C1_DMAEN_MASK); - } -} - -/*! - * @brief Sets the value for items in the buffer. - * - * @param base DAC peripheral base address. - * @param index Setting the index for items in the buffer. The available index should not exceed the size of the DAC - * buffer. - * @param value Setting the value for items in the buffer. 12-bits are available. - */ -void DAC_SetBufferValue(DAC_Type *base, uint8_t index, uint16_t value); - -/*! - * @brief Triggers the buffer using software and updates the read pointer of the DAC buffer. - * - * This function triggers the function using software. The read pointer of the DAC buffer is updated with one step - * after this function is called. Changing the read pointer depends on the buffer's work mode. - * - * @param base DAC peripheral base address. - */ -static inline void DAC_DoSoftwareTriggerBuffer(DAC_Type *base) -{ - base->C0 |= DAC_C0_DACSWTRG_MASK; -} - -/*! - * @brief Gets the current read pointer of the DAC buffer. - * - * This function gets the current read pointer of the DAC buffer. - * The current output value depends on the item indexed by the read pointer. It is updated either - * by a software trigger or a hardware trigger. - * - * @param base DAC peripheral base address. - * - * @return The current read pointer of the DAC buffer. - */ -static inline uint8_t DAC_GetBufferReadPointer(DAC_Type *base) -{ - return ((base->C2 & DAC_C2_DACBFRP_MASK) >> DAC_C2_DACBFRP_SHIFT); -} - -/*! - * @brief Sets the current read pointer of the DAC buffer. - * - * This function sets the current read pointer of the DAC buffer. - * The current output value depends on the item indexed by the read pointer. It is updated either by a - * software trigger or a hardware trigger. After the read pointer changes, the DAC output value also changes. - * - * @param base DAC peripheral base address. - * @param index Setting an index value for the pointer. - */ -void DAC_SetBufferReadPointer(DAC_Type *base, uint8_t index); - -/*! - * @brief Enables interrupts for the DAC buffer. - * - * @param base DAC peripheral base address. - * @param mask Mask value for interrupts. See "_dac_buffer_interrupt_enable". - */ -void DAC_EnableBufferInterrupts(DAC_Type *base, uint32_t mask); - -/*! - * @brief Disables interrupts for the DAC buffer. - * - * @param base DAC peripheral base address. - * @param mask Mask value for interrupts. See "_dac_buffer_interrupt_enable". - */ -void DAC_DisableBufferInterrupts(DAC_Type *base, uint32_t mask); - -/*! - * @brief Gets the flags of events for the DAC buffer. - * - * @param base DAC peripheral base address. - * - * @return Mask value for the asserted flags. See "_dac_buffer_status_flags". - */ -uint8_t DAC_GetBufferStatusFlags(DAC_Type *base); - -/*! - * @brief Clears the flags of events for the DAC buffer. - * - * @param base DAC peripheral base address. - * @param mask Mask value for flags. See "_dac_buffer_status_flags_t". - */ -void DAC_ClearBufferStatusFlags(DAC_Type *base, uint32_t mask); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif -/*! - * @} - */ -#endif /* FSL_DAC_H_ */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_dma.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_dma.c deleted file mode 100644 index d809406a2bf..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_dma.c +++ /dev/null @@ -1,484 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_dma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.dma" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Get instance number for DMA. - * - * @param base DMA peripheral base address. - */ -static uint32_t DMA_GetInstance(DMA_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/*! @brief Array to map DMA instance number to base pointer. */ -static DMA_Type *const s_dmaBases[] = DMA_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Array to map DMA instance number to clock name. */ -static const clock_ip_name_t s_dmaClockName[] = DMA_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/*! @brief Array to map DMA instance number to IRQ number. */ -static const IRQn_Type s_dmaIRQNumber[][FSL_FEATURE_DMA_MODULE_CHANNEL] = DMA_CHN_IRQS; - -/*! @brief Pointers to transfer handle for each DMA channel. */ -static dma_handle_t *s_DMAHandle[FSL_FEATURE_DMA_MODULE_CHANNEL * FSL_FEATURE_SOC_DMA_COUNT]; - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t DMA_GetInstance(DMA_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_dmaBases); instance++) - { - if (s_dmaBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_dmaBases)); - - return instance; -} - -/*! - * brief Initializes the DMA peripheral. - * - * This function ungates the DMA clock. - * - * param base DMA peripheral base address. - */ -void DMA_Init(DMA_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_EnableClock(s_dmaClockName[DMA_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Deinitializes the DMA peripheral. - * - * This function gates the DMA clock. - * - * param base DMA peripheral base address. - */ -void DMA_Deinit(DMA_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_DisableClock(s_dmaClockName[DMA_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Resets the DMA channel. - * - * Sets all register values to reset values and enables - * the cycle steal and auto stop channel request features. - * - * param base DMA peripheral base address. - * param channel DMA channel number. - */ -void DMA_ResetChannel(DMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_DMA_MODULE_CHANNEL); - - /* clear all status bit */ - base->DMA[channel].DSR_BCR |= DMA_DSR_BCR_DONE(true); - /* clear all registers */ - base->DMA[channel].SAR = 0; - base->DMA[channel].DAR = 0; - base->DMA[channel].DSR_BCR = 0; - /* enable cycle steal and enable auto disable channel request */ - base->DMA[channel].DCR = DMA_DCR_D_REQ(true) | DMA_DCR_CS(true); -} - -/*! - * brief Configures the DMA transfer attribute. - * - * This function configures the transfer attribute including the source address, - * destination address, transfer size, and so on. - * This example shows how to set up the dma_transfer_config_t - * parameters and how to call the DMA_ConfigBasicTransfer function. - * code - * dma_transfer_config_t transferConfig; - * memset(&transferConfig, 0, sizeof(transferConfig)); - * transferConfig.srcAddr = (uint32_t)srcAddr; - * transferConfig.destAddr = (uint32_t)destAddr; - * transferConfig.enbaleSrcIncrement = true; - * transferConfig.enableDestIncrement = true; - * transferConfig.srcSize = kDMA_Transfersize32bits; - * transferConfig.destSize = kDMA_Transfersize32bits; - * transferConfig.transferSize = sizeof(uint32_t) * BUFF_LENGTH; - * DMA_SetTransferConfig(DMA0, 0, &transferConfig); - * endcode - * - * param base DMA peripheral base address. - * param channel DMA channel number. - * param config Pointer to the DMA transfer configuration structure. - */ -void DMA_SetTransferConfig(DMA_Type *base, uint32_t channel, const dma_transfer_config_t *config) -{ - assert(channel < (uint32_t)FSL_FEATURE_DMA_MODULE_CHANNEL); - assert(config != NULL); - - uint32_t tmpreg; - - /* Set source address */ - base->DMA[channel].SAR = config->srcAddr; - /* Set destination address */ - base->DMA[channel].DAR = config->destAddr; - /* Set transfer bytes */ - base->DMA[channel].DSR_BCR = DMA_DSR_BCR_BCR(config->transferSize); - /* Set DMA Control Register */ - tmpreg = base->DMA[channel].DCR; - tmpreg &= ~(DMA_DCR_DSIZE_MASK | DMA_DCR_DINC_MASK | DMA_DCR_SSIZE_MASK | DMA_DCR_SINC_MASK); - tmpreg |= (DMA_DCR_DSIZE(config->destSize) | DMA_DCR_DINC(config->enableDestIncrement) | - DMA_DCR_SSIZE(config->srcSize) | DMA_DCR_SINC(config->enableSrcIncrement)); - base->DMA[channel].DCR = tmpreg; -} - -/*! - * brief Configures the DMA channel link feature. - * - * This function allows DMA channels to have their transfers linked. The current DMA channel - * triggers a DMA request to the linked channels (LCH1 or LCH2) depending on the channel link - * type. - * Perform a link to channel LCH1 after each cycle-steal transfer followed by a link to LCH2 - * after the BCR decrements to 0 if the type is kDMA_ChannelLinkChannel1AndChannel2. - * Perform a link to LCH1 after each cycle-steal transfer if the type is kDMA_ChannelLinkChannel1. - * Perform a link to LCH1 after the BCR decrements to 0 if the type is kDMA_ChannelLinkChannel1AfterBCR0. - * - * param base DMA peripheral base address. - * param channel DMA channel number. - * param config Pointer to the channel link configuration structure. - */ -void DMA_SetChannelLinkConfig(DMA_Type *base, uint32_t channel, const dma_channel_link_config_t *config) -{ - assert(channel < (uint32_t)FSL_FEATURE_DMA_MODULE_CHANNEL); - assert(config != NULL); - - uint32_t tmpreg; - - tmpreg = base->DMA[channel].DCR; - tmpreg &= ~(DMA_DCR_LINKCC_MASK | DMA_DCR_LCH1_MASK | DMA_DCR_LCH2_MASK); - tmpreg |= (DMA_DCR_LINKCC(config->linkType) | DMA_DCR_LCH1(config->channel1) | DMA_DCR_LCH2(config->channel2)); - base->DMA[channel].DCR = tmpreg; -} - -/*! - * brief Sets the DMA modulo for the DMA transfer. - * - * This function defines a specific address range specified to be the value after (SAR + SSIZE)/(DAR + DSIZE) - * calculation is performed or the original register value. It provides the ability to implement a circular - * data queue easily. - * - * param base DMA peripheral base address. - * param channel DMA channel number. - * param srcModulo source address modulo. - * param destModulo destination address modulo. - */ -void DMA_SetModulo(DMA_Type *base, uint32_t channel, dma_modulo_t srcModulo, dma_modulo_t destModulo) -{ - assert(channel < (uint32_t)FSL_FEATURE_DMA_MODULE_CHANNEL); - - uint32_t tmpreg; - - tmpreg = base->DMA[channel].DCR; - tmpreg &= ~(DMA_DCR_SMOD_MASK | DMA_DCR_DMOD_MASK); - tmpreg |= (DMA_DCR_SMOD(srcModulo) | DMA_DCR_DMOD(destModulo)); - base->DMA[channel].DCR = tmpreg; -} - -/*! - * brief Creates the DMA handle. - * - * This function is called first if using the transactional API for the DMA. This function - * initializes the internal state of the DMA handle. - * - * param handle DMA handle pointer. The DMA handle stores callback function and - * parameters. - * param base DMA peripheral base address. - * param channel DMA channel number. - */ -void DMA_CreateHandle(dma_handle_t *handle, DMA_Type *base, uint32_t channel) -{ - assert(handle != NULL); - assert(channel < (uint32_t)FSL_FEATURE_DMA_MODULE_CHANNEL); - - uint32_t dmaInstance; - uint32_t channelIndex; - - /* Zero the handle */ - (void)memset(handle, 0, sizeof(*handle)); - - handle->base = base; - handle->channel = (uint8_t)channel; - /* Get the DMA instance number */ - dmaInstance = DMA_GetInstance(base); - channelIndex = (dmaInstance * (uint32_t)FSL_FEATURE_DMA_MODULE_CHANNEL) + channel; - /* Store handle */ - s_DMAHandle[channelIndex] = handle; - /* Enable NVIC interrupt. */ - (void)EnableIRQ(s_dmaIRQNumber[dmaInstance][channelIndex]); -} - -/*! - * brief Prepares the DMA transfer configuration structure. - * - * This function prepares the transfer configuration structure according to the user input. - * The difference between this function and DMA_PrepareTransfer is that this function expose the address increment - * parameter to application, but in DMA_PrepareTransfer, only parts of the address increment option can be selected by - * dma_transfer_type_t. - * - * param config Pointer to the user configuration structure of type dma_transfer_config_t. - * param srcAddr DMA transfer source address. - * param srcWidth DMA transfer source address width (byte). - * param destAddr DMA transfer destination address. - * param destWidth DMA transfer destination address width (byte). - * param transferBytes DMA transfer bytes to be transferred. - * param srcIncrement source address increment type. - * param destIncrement dest address increment type. - */ -void DMA_PrepareTransferConfig(dma_transfer_config_t *config, - void *srcAddr, - uint32_t srcWidth, - void *destAddr, - uint32_t destWidth, - uint32_t transferBytes, - dma_addr_increment_t srcIncrement, - dma_addr_increment_t destIncrement) -{ - assert(config != NULL); - assert(srcAddr != NULL); - assert(destAddr != NULL); - assert((srcWidth == 1UL) || (srcWidth == 2UL) || (srcWidth == 4UL)); - assert((destWidth == 1UL) || (destWidth == 2UL) || (destWidth == 4UL)); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->srcAddr = (uint32_t)(uint32_t *)srcAddr; - config->destAddr = (uint32_t)(uint32_t *)destAddr; - config->transferSize = transferBytes; - - if (srcWidth == 1UL) - { - config->srcSize = kDMA_Transfersize8bits; - } - else if (srcWidth == 2UL) - { - config->srcSize = kDMA_Transfersize16bits; - } - else - { - config->srcSize = kDMA_Transfersize32bits; - } - - if (destWidth == 1UL) - { - config->destSize = kDMA_Transfersize8bits; - } - else if (destWidth == 2UL) - { - config->destSize = kDMA_Transfersize16bits; - } - else - { - config->destSize = kDMA_Transfersize32bits; - } - - config->enableSrcIncrement = srcIncrement == kDMA_AddrNoIncrement ? false : true; - config->enableDestIncrement = destIncrement == kDMA_AddrNoIncrement ? false : true; -} - -/*! - * brief Prepares the DMA transfer configuration structure. - * - * This function prepares the transfer configuration structure according to the user input. - * - * param config Pointer to the user configuration structure of type dma_transfer_config_t. - * param srcAddr DMA transfer source address. - * param srcWidth DMA transfer source address width (byte). - * param destAddr DMA transfer destination address. - * param destWidth DMA transfer destination address width (byte). - * param transferBytes DMA transfer bytes to be transferred. - * param type DMA transfer type. - */ -void DMA_PrepareTransfer(dma_transfer_config_t *config, - void *srcAddr, - uint32_t srcWidth, - void *destAddr, - uint32_t destWidth, - uint32_t transferBytes, - dma_transfer_type_t type) -{ - assert(config != NULL); - assert(srcAddr != NULL); - assert(destAddr != NULL); - assert((srcWidth == 1UL) || (srcWidth == 2UL) || (srcWidth == 4UL)); - assert((destWidth == 1UL) || (destWidth == 2UL) || (destWidth == 4UL)); - - dma_addr_increment_t srcIncrement = kDMA_AddrNoIncrement, destIncrement = kDMA_AddrNoIncrement; - - if (type == kDMA_MemoryToMemory) - { - srcIncrement = kDMA_AddrIncrementPerTransferWidth; - destIncrement = kDMA_AddrIncrementPerTransferWidth; - } - else if (type == kDMA_PeripheralToMemory) - { - srcIncrement = kDMA_AddrNoIncrement; - destIncrement = kDMA_AddrIncrementPerTransferWidth; - } - else - { - srcIncrement = kDMA_AddrIncrementPerTransferWidth; - destIncrement = kDMA_AddrNoIncrement; - } - - DMA_PrepareTransferConfig(config, srcAddr, srcWidth, destAddr, destWidth, transferBytes, srcIncrement, - destIncrement); -} - -/*! - * brief Sets the DMA callback function. - * - * This callback is called in the DMA IRQ handler. Use the callback to do something - * after the current transfer complete. - * - * param handle DMA handle pointer. - * param callback DMA callback function pointer. - * param userData Parameter for callback function. If it is not needed, just set to NULL. - */ -void DMA_SetCallback(dma_handle_t *handle, dma_callback callback, void *userData) -{ - assert(handle != NULL); - - handle->callback = callback; - handle->userData = userData; -} - -/*! - * brief Submits the DMA transfer request. - * - * This function submits the DMA transfer request according to the transfer configuration structure. - * - * param handle DMA handle pointer. - * param config Pointer to DMA transfer configuration structure. - * param options Additional configurations for transfer. Use - * the defined dma_transfer_options_t type. - * retval kStatus_DMA_Success It indicates that the DMA submit transfer request succeeded. - * retval kStatus_DMA_Busy It indicates that the DMA is busy. Submit transfer request is not allowed. - * note This function can't process multi transfer request. - */ -status_t DMA_SubmitTransfer(dma_handle_t *handle, const dma_transfer_config_t *config, uint32_t options) -{ - assert(handle != NULL); - assert(config != NULL); - - /* Check if DMA is busy */ - if ((handle->base->DMA[handle->channel].DSR_BCR & DMA_DSR_BCR_BSY_MASK) != 0UL) - { - return kStatus_DMA_Busy; - } - DMA_ResetChannel(handle->base, handle->channel); - DMA_SetTransferConfig(handle->base, handle->channel, config); - if ((options & (uint32_t)kDMA_EnableInterrupt) != 0UL) - { - DMA_EnableInterrupts(handle->base, handle->channel); - } - return kStatus_Success; -} - -/*! - * brief DMA aborts a transfer. - * - * This function disables the channel request and clears all status bits. - * Submit another transfer after calling this API. - * - * param handle DMA handle pointer. - */ -void DMA_AbortTransfer(dma_handle_t *handle) -{ - assert(handle != NULL); - - handle->base->DMA[handle->channel].DCR &= ~DMA_DCR_ERQ_MASK; - /* clear all status bit */ - handle->base->DMA[handle->channel].DSR_BCR |= DMA_DSR_BCR_DONE(true); -} - -/*! - * brief DMA IRQ handler for current transfer complete. - * - * This function clears the channel interrupt flag and calls - * the callback function if it is not NULL. - * - * param handle DMA handle pointer. - */ -void DMA_HandleIRQ(dma_handle_t *handle) -{ - assert(handle != NULL); - - /* Clear interrupt pending bit */ - DMA_ClearChannelStatusFlags(handle->base, handle->channel, kDMA_TransactionsDoneFlag); - if (handle->callback != NULL) - { - (handle->callback)(handle, handle->userData); - } -} - -#if defined(FSL_FEATURE_DMA_MODULE_CHANNEL) && (FSL_FEATURE_DMA_MODULE_CHANNEL == 4U) -void DMA0_DriverIRQHandler(void); -void DMA0_DriverIRQHandler(void) -{ - DMA_HandleIRQ(s_DMAHandle[0]); - SDK_ISR_EXIT_BARRIER; -} - -void DMA1_DriverIRQHandler(void); -void DMA1_DriverIRQHandler(void) -{ - DMA_HandleIRQ(s_DMAHandle[1]); - SDK_ISR_EXIT_BARRIER; -} - -void DMA2_DriverIRQHandler(void); -void DMA2_DriverIRQHandler(void) -{ - DMA_HandleIRQ(s_DMAHandle[2]); - SDK_ISR_EXIT_BARRIER; -} - -void DMA3_DriverIRQHandler(void); -void DMA3_DriverIRQHandler(void) -{ - DMA_HandleIRQ(s_DMAHandle[3]); - SDK_ISR_EXIT_BARRIER; -} -#endif /* FSL_FEATURE_DMA_MODULE_CHANNEL */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_dma.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_dma.h deleted file mode 100644 index 4f33943349b..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_dma.h +++ /dev/null @@ -1,639 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_DMA_H_ -#define FSL_DMA_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup dma - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief DMA driver version 2.1.2. */ -#define FSL_DMA_DRIVER_VERSION (MAKE_VERSION(2, 1, 2)) -/*! @} */ - -/*! @brief _dma_channel_status_flags status flag for the DMA driver. */ -enum -{ - kDMA_TransactionsBCRFlag = DMA_DSR_BCR_BCR_MASK, /*!< Contains the number of bytes yet to be - transferred for a given block */ - kDMA_TransactionsDoneFlag = DMA_DSR_BCR_DONE_MASK, /*!< Transactions Done */ - kDMA_TransactionsBusyFlag = DMA_DSR_BCR_BSY_MASK, /*!< Transactions Busy */ - kDMA_TransactionsRequestFlag = DMA_DSR_BCR_REQ_MASK, /*!< Transactions Request */ - kDMA_BusErrorOnDestinationFlag = DMA_DSR_BCR_BED_MASK, /*!< Bus Error on Destination */ - kDMA_BusErrorOnSourceFlag = DMA_DSR_BCR_BES_MASK, /*!< Bus Error on Source */ - kDMA_ConfigurationErrorFlag = DMA_DSR_BCR_CE_MASK, /*!< Configuration Error */ -}; - -/*! @brief DMA transfer size type*/ -typedef enum _dma_transfer_size -{ - kDMA_Transfersize32bits = 0x0U, /*!< 32 bits are transferred for every read/write */ - kDMA_Transfersize8bits, /*!< 8 bits are transferred for every read/write */ - kDMA_Transfersize16bits, /*!< 16b its are transferred for every read/write */ -} dma_transfer_size_t; - -/*! @brief Configuration type for the DMA modulo */ -typedef enum _dma_modulo -{ - kDMA_ModuloDisable = 0x0U, /*!< Buffer disabled */ - kDMA_Modulo16Bytes, /*!< Circular buffer size is 16 bytes. */ - kDMA_Modulo32Bytes, /*!< Circular buffer size is 32 bytes. */ - kDMA_Modulo64Bytes, /*!< Circular buffer size is 64 bytes. */ - kDMA_Modulo128Bytes, /*!< Circular buffer size is 128 bytes. */ - kDMA_Modulo256Bytes, /*!< Circular buffer size is 256 bytes. */ - kDMA_Modulo512Bytes, /*!< Circular buffer size is 512 bytes. */ - kDMA_Modulo1KBytes, /*!< Circular buffer size is 1 KB. */ - kDMA_Modulo2KBytes, /*!< Circular buffer size is 2 KB. */ - kDMA_Modulo4KBytes, /*!< Circular buffer size is 4 KB. */ - kDMA_Modulo8KBytes, /*!< Circular buffer size is 8 KB. */ - kDMA_Modulo16KBytes, /*!< Circular buffer size is 16 KB. */ - kDMA_Modulo32KBytes, /*!< Circular buffer size is 32 KB. */ - kDMA_Modulo64KBytes, /*!< Circular buffer size is 64 KB. */ - kDMA_Modulo128KBytes, /*!< Circular buffer size is 128 KB. */ - kDMA_Modulo256KBytes, /*!< Circular buffer size is 256 KB. */ -} dma_modulo_t; - -/*! @brief DMA channel link type */ -typedef enum _dma_channel_link_type -{ - kDMA_ChannelLinkDisable = 0x0U, /*!< No channel link. */ - kDMA_ChannelLinkChannel1AndChannel2, /*!< Perform a link to channel LCH1 after each cycle-steal transfer. - followed by a link to LCH2 after the BCR decrements to 0. */ - kDMA_ChannelLinkChannel1, /*!< Perform a link to LCH1 after each cycle-steal transfer. */ - kDMA_ChannelLinkChannel1AfterBCR0, /*!< Perform a link to LCH1 after the BCR decrements. */ -} dma_channel_link_type_t; - -/*! @brief DMA transfer type */ -typedef enum _dma_transfer_type -{ - kDMA_MemoryToMemory = 0x0U, /*!< Memory to Memory transfer. */ - kDMA_PeripheralToMemory, /*!< Peripheral to Memory transfer. */ - kDMA_MemoryToPeripheral, /*!< Memory to Peripheral transfer. */ -} dma_transfer_type_t; - -/*! @brief DMA transfer options */ -typedef enum _dma_transfer_options -{ - kDMA_NoOptions = 0x0U, /*!< Transfer without options. */ - kDMA_EnableInterrupt, /*!< Enable interrupt while transfer complete. */ -} dma_transfer_options_t; - -/*! @brief dma addre increment type */ -typedef enum _dma_addr_increment -{ - kDMA_AddrNoIncrement = 0x0U, /*!< Transfer address not increment. */ - kDMA_AddrIncrementPerTransferWidth = 0x1U, /*!< Transfer address increment per transfer width */ -} dma_addr_increment_t; - -/*! @brief _dma_transfer_status DMA transfer status */ -enum -{ - kStatus_DMA_Busy = MAKE_STATUS(kStatusGroup_DMA, 0), /*!< DMA is busy. */ -}; - -/*! @brief DMA transfer configuration structure */ -typedef struct _dma_transfer_config -{ - uint32_t srcAddr; /*!< DMA transfer source address. */ - uint32_t destAddr; /*!< DMA destination address.*/ - bool enableSrcIncrement; /*!< Source address increase after each transfer. */ - dma_transfer_size_t srcSize; /*!< Source transfer size unit. */ - bool enableDestIncrement; /*!< Destination address increase after each transfer. */ - dma_transfer_size_t destSize; /*!< Destination transfer unit.*/ - uint32_t transferSize; /*!< The number of bytes to be transferred. */ -} dma_transfer_config_t; - -/*! @brief DMA transfer configuration structure */ -typedef struct _dma_channel_link_config -{ - dma_channel_link_type_t linkType; /*!< Channel link type. */ - uint32_t channel1; /*!< The index of channel 1. */ - uint32_t channel2; /*!< The index of channel 2. */ -} dma_channel_link_config_t; - -struct _dma_handle; -/*! @brief Callback function prototype for the DMA driver. */ -typedef void (*dma_callback)(struct _dma_handle *handle, void *userData); - -/*! @brief DMA DMA handle structure */ -typedef struct _dma_handle -{ - DMA_Type *base; /*!< DMA peripheral address. */ - uint8_t channel; /*!< DMA channel used. */ - dma_callback callback; /*!< DMA callback function.*/ - void *userData; /*!< Callback parameter. */ -} dma_handle_t; - -/******************************************************************************* - * API - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name DMA Initialization and De-initialization - * @{ - */ - -/*! - * @brief Initializes the DMA peripheral. - * - * This function ungates the DMA clock. - * - * @param base DMA peripheral base address. - */ -void DMA_Init(DMA_Type *base); - -/*! - * @brief Deinitializes the DMA peripheral. - * - * This function gates the DMA clock. - * - * @param base DMA peripheral base address. - */ -void DMA_Deinit(DMA_Type *base); - -/*! @} */ -/*! - * @name DMA Channel Operation - * @{ - */ - -/*! - * @brief Resets the DMA channel. - * - * Sets all register values to reset values and enables - * the cycle steal and auto stop channel request features. - * - * @param base DMA peripheral base address. - * @param channel DMA channel number. - */ -void DMA_ResetChannel(DMA_Type *base, uint32_t channel); - -/*! - * @brief Configures the DMA transfer attribute. - * - * This function configures the transfer attribute including the source address, - * destination address, transfer size, and so on. - * This example shows how to set up the dma_transfer_config_t - * parameters and how to call the DMA_ConfigBasicTransfer function. - * @code - * dma_transfer_config_t transferConfig; - * memset(&transferConfig, 0, sizeof(transferConfig)); - * transferConfig.srcAddr = (uint32_t)srcAddr; - * transferConfig.destAddr = (uint32_t)destAddr; - * transferConfig.enbaleSrcIncrement = true; - * transferConfig.enableDestIncrement = true; - * transferConfig.srcSize = kDMA_Transfersize32bits; - * transferConfig.destSize = kDMA_Transfersize32bits; - * transferConfig.transferSize = sizeof(uint32_t) * BUFF_LENGTH; - * DMA_SetTransferConfig(DMA0, 0, &transferConfig); - * @endcode - * - * @param base DMA peripheral base address. - * @param channel DMA channel number. - * @param config Pointer to the DMA transfer configuration structure. - */ -void DMA_SetTransferConfig(DMA_Type *base, uint32_t channel, const dma_transfer_config_t *config); - -/*! - * @brief Configures the DMA channel link feature. - * - * This function allows DMA channels to have their transfers linked. The current DMA channel - * triggers a DMA request to the linked channels (LCH1 or LCH2) depending on the channel link - * type. - * Perform a link to channel LCH1 after each cycle-steal transfer followed by a link to LCH2 - * after the BCR decrements to 0 if the type is kDMA_ChannelLinkChannel1AndChannel2. - * Perform a link to LCH1 after each cycle-steal transfer if the type is kDMA_ChannelLinkChannel1. - * Perform a link to LCH1 after the BCR decrements to 0 if the type is kDMA_ChannelLinkChannel1AfterBCR0. - * - * @param base DMA peripheral base address. - * @param channel DMA channel number. - * @param config Pointer to the channel link configuration structure. - */ -void DMA_SetChannelLinkConfig(DMA_Type *base, uint32_t channel, const dma_channel_link_config_t *config); - -/*! - * @brief Sets the DMA source address for the DMA transfer. - * - * @param base DMA peripheral base address. - * @param channel DMA channel number. - * @param srcAddr DMA source address. - */ -static inline void DMA_SetSourceAddress(DMA_Type *base, uint32_t channel, uint32_t srcAddr) -{ - assert(channel < (uint32_t)FSL_FEATURE_DMA_MODULE_CHANNEL); - - base->DMA[channel].SAR = srcAddr; -} - -/*! - * @brief Sets the DMA destination address for the DMA transfer. - * - * @param base DMA peripheral base address. - * @param channel DMA channel number. - * @param destAddr DMA destination address. - */ -static inline void DMA_SetDestinationAddress(DMA_Type *base, uint32_t channel, uint32_t destAddr) -{ - assert(channel < (uint32_t)FSL_FEATURE_DMA_MODULE_CHANNEL); - - base->DMA[channel].DAR = destAddr; -} - -/*! - * @brief Sets the DMA transfer size for the DMA transfer. - * - * @param base DMA peripheral base address. - * @param channel DMA channel number. - * @param size The number of bytes to be transferred. - */ -static inline void DMA_SetTransferSize(DMA_Type *base, uint32_t channel, uint32_t size) -{ - assert(channel < (uint32_t)FSL_FEATURE_DMA_MODULE_CHANNEL); - - base->DMA[channel].DSR_BCR = DMA_DSR_BCR_BCR(size); -} - -/*! - * @brief Sets the DMA modulo for the DMA transfer. - * - * This function defines a specific address range specified to be the value after (SAR + SSIZE)/(DAR + DSIZE) - * calculation is performed or the original register value. It provides the ability to implement a circular - * data queue easily. - * - * @param base DMA peripheral base address. - * @param channel DMA channel number. - * @param srcModulo source address modulo. - * @param destModulo destination address modulo. - */ -void DMA_SetModulo(DMA_Type *base, uint32_t channel, dma_modulo_t srcModulo, dma_modulo_t destModulo); - -/*! - * @brief Enables the DMA cycle steal for the DMA transfer. - * - * If the cycle steal feature is enabled (true), the DMA controller forces a single read/write transfer per request, - * or it continuously makes read/write transfers until the BCR decrements to 0. - * - * @param base DMA peripheral base address. - * @param channel DMA channel number. - * @param enable The command for enable (true) or disable (false). - */ -static inline void DMA_EnableCycleSteal(DMA_Type *base, uint32_t channel, bool enable) -{ - assert(channel < (uint32_t)FSL_FEATURE_DMA_MODULE_CHANNEL); - - base->DMA[channel].DCR = (base->DMA[channel].DCR & (~DMA_DCR_CS_MASK)) | DMA_DCR_CS(enable); -} - -/*! - * @brief Enables the DMA auto align for the DMA transfer. - * - * If the auto align feature is enabled (true), the appropriate address register increments - * regardless of DINC or SINC. - * - * @param base DMA peripheral base address. - * @param channel DMA channel number. - * @param enable The command for enable (true) or disable (false). - */ -static inline void DMA_EnableAutoAlign(DMA_Type *base, uint32_t channel, bool enable) -{ - assert(channel < (uint32_t)FSL_FEATURE_DMA_MODULE_CHANNEL); - - base->DMA[channel].DCR = (base->DMA[channel].DCR & (~DMA_DCR_AA_MASK)) | DMA_DCR_AA(enable); -} - -/*! - * @brief Enables the DMA async request for the DMA transfer. - * - * If the async request feature is enabled (true), the DMA supports asynchronous DREQs - * while the MCU is in stop mode. - * - * @param base DMA peripheral base address. - * @param channel DMA channel number. - * @param enable The command for enable (true) or disable (false). - */ -static inline void DMA_EnableAsyncRequest(DMA_Type *base, uint32_t channel, bool enable) -{ - assert(channel < (uint32_t)FSL_FEATURE_DMA_MODULE_CHANNEL); - - base->DMA[channel].DCR = (base->DMA[channel].DCR & (~DMA_DCR_EADREQ_MASK)) | DMA_DCR_EADREQ(enable); -} - -/*! - * @brief Enables an interrupt for the DMA transfer. - * - * @param base DMA peripheral base address. - * @param channel DMA channel number. - */ -static inline void DMA_EnableInterrupts(DMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_DMA_MODULE_CHANNEL); - - base->DMA[channel].DCR |= DMA_DCR_EINT(true); -} - -/*! - * @brief Disables an interrupt for the DMA transfer. - * - * @param base DMA peripheral base address. - * @param channel DMA channel number. - */ -static inline void DMA_DisableInterrupts(DMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_DMA_MODULE_CHANNEL); - - base->DMA[channel].DCR &= ~DMA_DCR_EINT_MASK; -} - -/*! @} */ -/*! - * @name DMA Channel Transfer Operation - * @{ - */ - -/*! - * @brief Enables the DMA hardware channel request. - * - * @param base DMA peripheral base address. - * @param channel The DMA channel number. - */ -static inline void DMA_EnableChannelRequest(DMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_DMA_MODULE_CHANNEL); - - base->DMA[channel].DCR |= DMA_DCR_ERQ_MASK; -} - -/*! - * @brief Disables the DMA hardware channel request. - * - * @param base DMA peripheral base address. - * @param channel DMA channel number. - */ -static inline void DMA_DisableChannelRequest(DMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_DMA_MODULE_CHANNEL); - - base->DMA[channel].DCR &= ~DMA_DCR_ERQ_MASK; -} - -/*! - * @brief Starts the DMA transfer with a software trigger. - * - * This function starts only one read/write iteration. - * - * @param base DMA peripheral base address. - * @param channel The DMA channel number. - */ -static inline void DMA_TriggerChannelStart(DMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_DMA_MODULE_CHANNEL); - - base->DMA[channel].DCR |= DMA_DCR_START_MASK; -} - -/*! - * @brief Starts the DMA enable/disable auto disable request. - * - * @param base DMA peripheral base address. - * @param channel The DMA channel number. - * @param enable true is enable, false is disable. - */ -static inline void DMA_EnableAutoStopRequest(DMA_Type *base, uint32_t channel, bool enable) -{ - assert(channel < (uint32_t)FSL_FEATURE_DMA_MODULE_CHANNEL); - - if (enable) - { - base->DMA[channel].DCR |= DMA_DCR_D_REQ(1); - } - else - { - base->DMA[channel].DCR &= ~DMA_DCR_D_REQ_MASK; - } -} - -/*! @} */ -/*! - * @name DMA Channel Status Operation - * @{ - */ - -/*! - * @brief Gets the remaining bytes of the current DMA transfer. - * - * @param base DMA peripheral base address. - * @param channel DMA channel number. - * @return The number of bytes which have not been transferred yet. - */ -static inline uint32_t DMA_GetRemainingBytes(DMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_DMA_MODULE_CHANNEL); - - return (base->DMA[channel].DSR_BCR & DMA_DSR_BCR_BCR_MASK) >> DMA_DSR_BCR_BCR_SHIFT; -} - -/*! - * @brief Gets the DMA channel status flags. - * - * @param base DMA peripheral base address. - * @param channel DMA channel number. - * @return The mask of the channel status. Use the _dma_channel_status_flags - * type to decode the return 32 bit variables. - */ -static inline uint32_t DMA_GetChannelStatusFlags(DMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_DMA_MODULE_CHANNEL); - - return base->DMA[channel].DSR_BCR; -} - -/*! - * @brief Clears the DMA channel status flags. - * - * @param base DMA peripheral base address. - * @param channel DMA channel number. - * @param mask The mask of the channel status to be cleared. Use - * the defined _dma_channel_status_flags type. - */ -static inline void DMA_ClearChannelStatusFlags(DMA_Type *base, uint32_t channel, uint32_t mask) -{ - assert(channel < (uint32_t)FSL_FEATURE_DMA_MODULE_CHANNEL); - - if (mask != 0U) - { - base->DMA[channel].DSR_BCR |= DMA_DSR_BCR_DONE(true); - } -} - -/*! @} */ -/*! - * @name DMA Channel Transactional Operation - * @{ - */ - -/*! - * @brief Creates the DMA handle. - * - * This function is called first if using the transactional API for the DMA. This function - * initializes the internal state of the DMA handle. - * - * @param handle DMA handle pointer. The DMA handle stores callback function and - * parameters. - * @param base DMA peripheral base address. - * @param channel DMA channel number. - */ -void DMA_CreateHandle(dma_handle_t *handle, DMA_Type *base, uint32_t channel); - -/*! - * @brief Sets the DMA callback function. - * - * This callback is called in the DMA IRQ handler. Use the callback to do something - * after the current transfer complete. - * - * @param handle DMA handle pointer. - * @param callback DMA callback function pointer. - * @param userData Parameter for callback function. If it is not needed, just set to NULL. - */ -void DMA_SetCallback(dma_handle_t *handle, dma_callback callback, void *userData); - -/*! - * @brief Prepares the DMA transfer configuration structure. - * - * This function prepares the transfer configuration structure according to the user input. - * The difference between this function and DMA_PrepareTransfer is that this function expose the address increment - * parameter to application, but in DMA_PrepareTransfer, only parts of the address increment option can be selected by - * dma_transfer_type_t. - * - * @param config Pointer to the user configuration structure of type dma_transfer_config_t. - * @param srcAddr DMA transfer source address. - * @param srcWidth DMA transfer source address width (byte). - * @param destAddr DMA transfer destination address. - * @param destWidth DMA transfer destination address width (byte). - * @param transferBytes DMA transfer bytes to be transferred. - * @param srcIncrement source address increment type. - * @param destIncrement dest address increment type. - */ -void DMA_PrepareTransferConfig(dma_transfer_config_t *config, - void *srcAddr, - uint32_t srcWidth, - void *destAddr, - uint32_t destWidth, - uint32_t transferBytes, - dma_addr_increment_t srcIncrement, - dma_addr_increment_t destIncrement); - -/*! - * @brief Prepares the DMA transfer configuration structure. - * - * This function prepares the transfer configuration structure according to the user input. - * - * @param config Pointer to the user configuration structure of type dma_transfer_config_t. - * @param srcAddr DMA transfer source address. - * @param srcWidth DMA transfer source address width (byte). - * @param destAddr DMA transfer destination address. - * @param destWidth DMA transfer destination address width (byte). - * @param transferBytes DMA transfer bytes to be transferred. - * @param type DMA transfer type. - */ -void DMA_PrepareTransfer(dma_transfer_config_t *config, - void *srcAddr, - uint32_t srcWidth, - void *destAddr, - uint32_t destWidth, - uint32_t transferBytes, - dma_transfer_type_t type); - -/*! - * @brief Submits the DMA transfer request. - * - * This function submits the DMA transfer request according to the transfer configuration structure. - * - * @param handle DMA handle pointer. - * @param config Pointer to DMA transfer configuration structure. - * @param options Additional configurations for transfer. Use - * the defined dma_transfer_options_t type. - * @retval kStatus_DMA_Success It indicates that the DMA submit transfer request succeeded. - * @retval kStatus_DMA_Busy It indicates that the DMA is busy. Submit transfer request is not allowed. - * @note This function can't process multi transfer request. - */ -status_t DMA_SubmitTransfer(dma_handle_t *handle, const dma_transfer_config_t *config, uint32_t options); - -/*! - * @brief DMA starts a transfer. - * - * This function enables the channel request. Call this function - * after submitting a transfer request. - * - * @param handle DMA handle pointer. - * @retval kStatus_DMA_Success It indicates that the DMA start transfer succeed. - * @retval kStatus_DMA_Busy It indicates that the DMA has started a transfer. - */ -static inline void DMA_StartTransfer(dma_handle_t *handle) -{ - assert(handle != NULL); - - handle->base->DMA[handle->channel].DCR |= DMA_DCR_ERQ_MASK; -} - -/*! - * @brief DMA stops a transfer. - * - * This function disables the channel request to stop a DMA transfer. - * The transfer can be resumed by calling the DMA_StartTransfer. - * - * @param handle DMA handle pointer. - */ -static inline void DMA_StopTransfer(dma_handle_t *handle) -{ - assert(handle != NULL); - - handle->base->DMA[handle->channel].DCR &= ~DMA_DCR_ERQ_MASK; -} - -/*! - * @brief DMA aborts a transfer. - * - * This function disables the channel request and clears all status bits. - * Submit another transfer after calling this API. - * - * @param handle DMA handle pointer. - */ -void DMA_AbortTransfer(dma_handle_t *handle); - -/*! - * @brief DMA IRQ handler for current transfer complete. - * - * This function clears the channel interrupt flag and calls - * the callback function if it is not NULL. - * - * @param handle DMA handle pointer. - */ -void DMA_HandleIRQ(dma_handle_t *handle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @} */ - -#endif /* FSL_DMA_H_ */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_dmamux.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_dmamux.c deleted file mode 100644 index 8bfbe6c3676..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_dmamux.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2017 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_dmamux.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.dmamux" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Get instance number for DMAMUX. - * - * @param base DMAMUX peripheral base address. - */ -static uint32_t DMAMUX_GetInstance(DMAMUX_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/*! @brief Array to map DMAMUX instance number to base pointer. */ -static DMAMUX_Type *const s_dmamuxBases[] = DMAMUX_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Array to map DMAMUX instance number to clock name. */ -static const clock_ip_name_t s_dmamuxClockName[] = DMAMUX_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t DMAMUX_GetInstance(DMAMUX_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_dmamuxBases); instance++) - { - if (s_dmamuxBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_dmamuxBases)); - - return instance; -} - -/*! - * brief Initializes the DMAMUX peripheral. - * - * This function ungates the DMAMUX clock. - * - * param base DMAMUX peripheral base address. - * - */ -void DMAMUX_Init(DMAMUX_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_EnableClock(s_dmamuxClockName[DMAMUX_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Deinitializes the DMAMUX peripheral. - * - * This function gates the DMAMUX clock. - * - * param base DMAMUX peripheral base address. - */ -void DMAMUX_Deinit(DMAMUX_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_DisableClock(s_dmamuxClockName[DMAMUX_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_dmamux.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_dmamux.h deleted file mode 100644 index c28167acf0d..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_dmamux.h +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2017 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_DMAMUX_H_ -#define FSL_DMAMUX_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup dmamux - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief DMAMUX driver version 2.1.0. */ -#define FSL_DMAMUX_DRIVER_VERSION (MAKE_VERSION(2, 1, 0)) -/*! @} */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name DMAMUX Initialization and de-initialization - * @{ - */ - -/*! - * @brief Initializes the DMAMUX peripheral. - * - * This function ungates the DMAMUX clock. - * - * @param base DMAMUX peripheral base address. - * - */ -void DMAMUX_Init(DMAMUX_Type *base); - -/*! - * @brief Deinitializes the DMAMUX peripheral. - * - * This function gates the DMAMUX clock. - * - * @param base DMAMUX peripheral base address. - */ -void DMAMUX_Deinit(DMAMUX_Type *base); - -/*! @} */ -/*! - * @name DMAMUX Channel Operation - * @{ - */ - -/*! - * @brief Enables the DMAMUX channel. - * - * This function enables the DMAMUX channel. - * - * @param base DMAMUX peripheral base address. - * @param channel DMAMUX channel number. - */ -static inline void DMAMUX_EnableChannel(DMAMUX_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_DMAMUX_MODULE_CHANNEL); - - base->CHCFG[channel] |= DMAMUX_CHCFG_ENBL_MASK; -} - -/*! - * @brief Disables the DMAMUX channel. - * - * This function disables the DMAMUX channel. - * - * @note The user must disable the DMAMUX channel before configuring it. - * @param base DMAMUX peripheral base address. - * @param channel DMAMUX channel number. - */ -static inline void DMAMUX_DisableChannel(DMAMUX_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_DMAMUX_MODULE_CHANNEL); - -#if defined FSL_FEATURE_DMAMUX_CHCFG_REGISTER_WIDTH && (FSL_FEATURE_DMAMUX_CHCFG_REGISTER_WIDTH == 32U) - base->CHCFG[channel] &= ~DMAMUX_CHCFG_ENBL_MASK; -#else - base->CHCFG[channel] &= ~(uint8_t)DMAMUX_CHCFG_ENBL_MASK; -#endif -} - -/*! - * @brief Configures the DMAMUX channel source. - * - * @param base DMAMUX peripheral base address. - * @param channel DMAMUX channel number. - * @param source Channel source, which is used to trigger the DMA transfer.User need to use the - * dma_request_source_t type as the input parameter. - */ -static inline void DMAMUX_SetSource(DMAMUX_Type *base, uint32_t channel, int32_t source) -{ - assert(channel < (uint32_t)FSL_FEATURE_DMAMUX_MODULE_CHANNEL); - -#if defined FSL_FEATURE_DMAMUX_CHCFG_REGISTER_WIDTH && (FSL_FEATURE_DMAMUX_CHCFG_REGISTER_WIDTH == 32U) - base->CHCFG[channel] = ((base->CHCFG[channel] & ~DMAMUX_CHCFG_SOURCE_MASK) | DMAMUX_CHCFG_SOURCE(source)); -#else - base->CHCFG[channel] = (uint8_t)((base->CHCFG[channel] & ~DMAMUX_CHCFG_SOURCE_MASK) | DMAMUX_CHCFG_SOURCE(source)); -#endif -} - -#if defined(FSL_FEATURE_DMAMUX_HAS_TRIG) && FSL_FEATURE_DMAMUX_HAS_TRIG > 0U -/*! - * @brief Enables the DMAMUX period trigger. - * - * This function enables the DMAMUX period trigger feature. - * - * @param base DMAMUX peripheral base address. - * @param channel DMAMUX channel number. - */ -static inline void DMAMUX_EnablePeriodTrigger(DMAMUX_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_DMAMUX_MODULE_CHANNEL); - - base->CHCFG[channel] |= DMAMUX_CHCFG_TRIG_MASK; -} - -/*! - * @brief Disables the DMAMUX period trigger. - * - * This function disables the DMAMUX period trigger. - * - * @param base DMAMUX peripheral base address. - * @param channel DMAMUX channel number. - */ -static inline void DMAMUX_DisablePeriodTrigger(DMAMUX_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_DMAMUX_MODULE_CHANNEL); - -#if defined FSL_FEATURE_DMAMUX_CHCFG_REGISTER_WIDTH && (FSL_FEATURE_DMAMUX_CHCFG_REGISTER_WIDTH == 32U) - base->CHCFG[channel] &= ~DMAMUX_CHCFG_TRIG_MASK; -#else - base->CHCFG[channel] &= ~(uint8_t)DMAMUX_CHCFG_TRIG_MASK; -#endif -} -#endif /* FSL_FEATURE_DMAMUX_HAS_TRIG */ - -#if (defined(FSL_FEATURE_DMAMUX_HAS_A_ON) && FSL_FEATURE_DMAMUX_HAS_A_ON) -/*! - * @brief Enables the DMA channel to be always ON. - * - * This function enables the DMAMUX channel always ON feature. - * - * @param base DMAMUX peripheral base address. - * @param channel DMAMUX channel number. - * @param enable Switcher of the always ON feature. "true" means enabled, "false" means disabled. - */ -static inline void DMAMUX_EnableAlwaysOn(DMAMUX_Type *base, uint32_t channel, bool enable) -{ - assert(channel < (uint32_t)FSL_FEATURE_DMAMUX_MODULE_CHANNEL); - - if (enable) - { - base->CHCFG[channel] |= DMAMUX_CHCFG_A_ON_MASK; - } - else - { - base->CHCFG[channel] &= ~DMAMUX_CHCFG_A_ON_MASK; - } -} -#endif /* FSL_FEATURE_DMAMUX_HAS_A_ON */ - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @} */ - -#endif /* FSL_DMAMUX_H_ */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flash.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flash.h deleted file mode 100644 index 429d33b8af6..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flash.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2013-2016 Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - * - */ - -#ifndef FSL_FLASH_H -#define FSL_FLASH_H - -#include "fsl_ftfx_cache.h" -#include "fsl_ftfx_flash.h" -#if FSL_FEATURE_FLASH_HAS_FLEX_NVM -#include "fsl_ftfx_flexnvm.h" -#endif - -/*! - * @addtogroup flash_driver - * @{ - */ -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_FLASH_H */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio.c deleted file mode 100644 index fbdb4e959c7..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio.c +++ /dev/null @@ -1,511 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio" -#endif - -/*< @brief user configurable flexio handle count. */ -#define FLEXIO_HANDLE_COUNT 2 - -#if defined(FLEXIO_RSTS) -#define FLEXIO_RESETS_ARRAY FLEXIO_RSTS -#elif defined(FLEXIO_RSTS_N) -#define FLEXIO_RESETS_ARRAY FLEXIO_RSTS_N -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to flexio bases for each instance. */ -FLEXIO_Type *const s_flexioBases[] = FLEXIO_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to flexio clocks for each instance. */ -const clock_ip_name_t s_flexioClocks[] = FLEXIO_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/*< @brief pointer to array of FLEXIO handle. */ -static void *s_flexioHandle[FLEXIO_HANDLE_COUNT]; - -/*< @brief pointer to array of FLEXIO IP types. */ -static void *s_flexioType[FLEXIO_HANDLE_COUNT]; - -/*< @brief pointer to array of FLEXIO Isr. */ -static flexio_isr_t s_flexioIsr[FLEXIO_HANDLE_COUNT]; - -/* FlexIO common IRQ Handler. */ -static void FLEXIO_CommonIRQHandler(void); - -#if defined(FLEXIO_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_flexioResets[] = FLEXIO_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Codes - ******************************************************************************/ - -/*! - * brief Get instance number for FLEXIO module. - * - * param base FLEXIO peripheral base address. - */ -uint32_t FLEXIO_GetInstance(FLEXIO_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_flexioBases); instance++) - { - if (s_flexioBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_flexioBases)); - - return instance; -} - -/*! - * brief Configures the FlexIO with a FlexIO configuration. The configuration structure - * can be filled by the user or be set with default values by FLEXIO_GetDefaultConfig(). - * - * Example - code - flexio_config_t config = { - .enableFlexio = true, - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false - }; - FLEXIO_Configure(base, &config); - endcode - * - * param base FlexIO peripheral base address - * param userConfig pointer to flexio_config_t structure -*/ -void FLEXIO_Init(FLEXIO_Type *base, const flexio_config_t *userConfig) -{ - uint32_t ctrlReg = 0; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_EnableClock(s_flexioClocks[FLEXIO_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(FLEXIO_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_flexioResets[FLEXIO_GetInstance(base)]); -#endif - - FLEXIO_Reset(base); - - ctrlReg = base->CTRL; - ctrlReg &= ~(FLEXIO_CTRL_DOZEN_MASK | FLEXIO_CTRL_DBGE_MASK | FLEXIO_CTRL_FASTACC_MASK | FLEXIO_CTRL_FLEXEN_MASK); - ctrlReg |= (FLEXIO_CTRL_DBGE(userConfig->enableInDebug) | FLEXIO_CTRL_FASTACC(userConfig->enableFastAccess) | - FLEXIO_CTRL_FLEXEN(userConfig->enableFlexio)); - if (!userConfig->enableInDoze) - { - ctrlReg |= FLEXIO_CTRL_DOZEN_MASK; - } - - base->CTRL = ctrlReg; -} - -/*! - * brief Gates the FlexIO clock. Call this API to stop the FlexIO clock. - * - * note After calling this API, call the FLEXO_Init to use the FlexIO module. - * - * param base FlexIO peripheral base address - */ -void FLEXIO_Deinit(FLEXIO_Type *base) -{ - FLEXIO_Enable(base, false); -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_DisableClock(s_flexioClocks[FLEXIO_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Gets the default configuration to configure the FlexIO module. The configuration - * can used directly to call the FLEXIO_Configure(). - * - * Example: - code - flexio_config_t config; - FLEXIO_GetDefaultConfig(&config); - endcode - * - * param userConfig pointer to flexio_config_t structure -*/ -void FLEXIO_GetDefaultConfig(flexio_config_t *userConfig) -{ - assert(userConfig != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(userConfig, 0, sizeof(*userConfig)); - - userConfig->enableFlexio = true; - userConfig->enableInDoze = false; - userConfig->enableInDebug = true; - userConfig->enableFastAccess = false; -} - -/*! - * brief Resets the FlexIO module. - * - * param base FlexIO peripheral base address - */ -void FLEXIO_Reset(FLEXIO_Type *base) -{ - /*do software reset, software reset operation affect all other FLEXIO registers except CTRL*/ - base->CTRL |= FLEXIO_CTRL_SWRST_MASK; - base->CTRL = 0; -} - -/*! - * brief Gets the shifter buffer address for the DMA transfer usage. - * - * param base FlexIO peripheral base address - * param type Shifter type of flexio_shifter_buffer_type_t - * param index Shifter index - * return Corresponding shifter buffer index - */ -uint32_t FLEXIO_GetShifterBufferAddress(FLEXIO_Type *base, flexio_shifter_buffer_type_t type, uint8_t index) -{ - assert(index < FLEXIO_SHIFTBUF_COUNT); - - uint32_t address = 0; - - switch (type) - { - case kFLEXIO_ShifterBuffer: - address = (uint32_t) & (base->SHIFTBUF[index]); - break; - - case kFLEXIO_ShifterBufferBitSwapped: - address = (uint32_t) & (base->SHIFTBUFBIS[index]); - break; - - case kFLEXIO_ShifterBufferByteSwapped: - address = (uint32_t) & (base->SHIFTBUFBYS[index]); - break; - - case kFLEXIO_ShifterBufferBitByteSwapped: - address = (uint32_t) & (base->SHIFTBUFBBS[index]); - break; - -#if defined(FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_BYTE_SWAP) && FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_BYTE_SWAP - case kFLEXIO_ShifterBufferNibbleByteSwapped: - address = (uint32_t) & (base->SHIFTBUFNBS[index]); - break; - -#endif -#if defined(FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_HALF_WORD_SWAP) && FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_HALF_WORD_SWAP - case kFLEXIO_ShifterBufferHalfWordSwapped: - address = (uint32_t) & (base->SHIFTBUFHWS[index]); - break; - -#endif -#if defined(FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_SWAP) && FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_SWAP - case kFLEXIO_ShifterBufferNibbleSwapped: - address = (uint32_t) & (base->SHIFTBUFNIS[index]); - break; - -#endif - default: - address = (uint32_t) & (base->SHIFTBUF[index]); - break; - } - return address; -} - -/*! - * brief Configures the shifter with the shifter configuration. The configuration structure - * covers both the SHIFTCTL and SHIFTCFG registers. To configure the shifter to the proper - * mode, select which timer controls the shifter to shift, whether to generate start bit/stop - * bit, and the polarity of start bit and stop bit. - * - * Example - code - flexio_shifter_config_t config = { - .timerSelect = 0, - .timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive, - .pinConfig = kFLEXIO_PinConfigOpenDrainOrBidirection, - .pinPolarity = kFLEXIO_PinActiveLow, - .shifterMode = kFLEXIO_ShifterModeTransmit, - .inputSource = kFLEXIO_ShifterInputFromPin, - .shifterStop = kFLEXIO_ShifterStopBitHigh, - .shifterStart = kFLEXIO_ShifterStartBitLow - }; - FLEXIO_SetShifterConfig(base, &config); - endcode - * - * param base FlexIO peripheral base address - * param index Shifter index - * param shifterConfig Pointer to flexio_shifter_config_t structure -*/ -void FLEXIO_SetShifterConfig(FLEXIO_Type *base, uint8_t index, const flexio_shifter_config_t *shifterConfig) -{ - base->SHIFTCFG[index] = FLEXIO_SHIFTCFG_INSRC(shifterConfig->inputSource) -#if FSL_FEATURE_FLEXIO_HAS_PARALLEL_WIDTH - | FLEXIO_SHIFTCFG_PWIDTH(shifterConfig->parallelWidth) -#endif /* FSL_FEATURE_FLEXIO_HAS_PARALLEL_WIDTH */ - | FLEXIO_SHIFTCFG_SSTOP(shifterConfig->shifterStop) | - FLEXIO_SHIFTCFG_SSTART(shifterConfig->shifterStart); - - base->SHIFTCTL[index] = - FLEXIO_SHIFTCTL_TIMSEL(shifterConfig->timerSelect) | FLEXIO_SHIFTCTL_TIMPOL(shifterConfig->timerPolarity) | - FLEXIO_SHIFTCTL_PINCFG(shifterConfig->pinConfig) | FLEXIO_SHIFTCTL_PINSEL(shifterConfig->pinSelect) | - FLEXIO_SHIFTCTL_PINPOL(shifterConfig->pinPolarity) | FLEXIO_SHIFTCTL_SMOD(shifterConfig->shifterMode); -} - -/*! - * brief Configures the timer with the timer configuration. The configuration structure - * covers both the TIMCTL and TIMCFG registers. To configure the timer to the proper - * mode, select trigger source for timer and the timer pin output and the timing for timer. - * - * Example - code - flexio_timer_config_t config = { - .triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(0), - .triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow, - .triggerSource = kFLEXIO_TimerTriggerSourceInternal, - .pinConfig = kFLEXIO_PinConfigOpenDrainOrBidirection, - .pinSelect = 0, - .pinPolarity = kFLEXIO_PinActiveHigh, - .timerMode = kFLEXIO_TimerModeDual8BitBaudBit, - .timerOutput = kFLEXIO_TimerOutputZeroNotAffectedByReset, - .timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput, - .timerReset = kFLEXIO_TimerResetOnTimerPinEqualToTimerOutput, - .timerDisable = kFLEXIO_TimerDisableOnTimerCompare, - .timerEnable = kFLEXIO_TimerEnableOnTriggerHigh, - .timerStop = kFLEXIO_TimerStopBitEnableOnTimerDisable, - .timerStart = kFLEXIO_TimerStartBitEnabled - }; - FLEXIO_SetTimerConfig(base, &config); - endcode - * - * param base FlexIO peripheral base address - * param index Timer index - * param timerConfig Pointer to the flexio_timer_config_t structure -*/ -void FLEXIO_SetTimerConfig(FLEXIO_Type *base, uint8_t index, const flexio_timer_config_t *timerConfig) -{ - base->TIMCFG[index] = - FLEXIO_TIMCFG_TIMOUT(timerConfig->timerOutput) | FLEXIO_TIMCFG_TIMDEC(timerConfig->timerDecrement) | - FLEXIO_TIMCFG_TIMRST(timerConfig->timerReset) | FLEXIO_TIMCFG_TIMDIS(timerConfig->timerDisable) | - FLEXIO_TIMCFG_TIMENA(timerConfig->timerEnable) | FLEXIO_TIMCFG_TSTOP(timerConfig->timerStop) | - FLEXIO_TIMCFG_TSTART(timerConfig->timerStart); - - base->TIMCMP[index] = FLEXIO_TIMCMP_CMP(timerConfig->timerCompare); - - base->TIMCTL[index] = FLEXIO_TIMCTL_TRGSEL(timerConfig->triggerSelect) | - FLEXIO_TIMCTL_TRGPOL(timerConfig->triggerPolarity) | - FLEXIO_TIMCTL_TRGSRC(timerConfig->triggerSource) | - FLEXIO_TIMCTL_PINCFG(timerConfig->pinConfig) | FLEXIO_TIMCTL_PINSEL(timerConfig->pinSelect) | - FLEXIO_TIMCTL_PINPOL(timerConfig->pinPolarity) | FLEXIO_TIMCTL_TIMOD(timerConfig->timerMode); -} - -/*! - * brief Registers the handle and the interrupt handler for the FlexIO-simulated peripheral. - * - * param base Pointer to the FlexIO simulated peripheral type. - * param handle Pointer to the handler for FlexIO simulated peripheral. - * param isr FlexIO simulated peripheral interrupt handler. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_RegisterHandleIRQ(void *base, void *handle, flexio_isr_t isr) -{ - assert(base != NULL); - assert(handle != NULL); - assert(isr != NULL); - - uint8_t index; - - /* Find the an empty handle pointer to store the handle. */ - for (index = 0U; index < (uint8_t)FLEXIO_HANDLE_COUNT; index++) - { - if (s_flexioHandle[index] == NULL) - { - /* Register FLEXIO simulated driver base, handle and isr. */ - s_flexioType[index] = base; - s_flexioHandle[index] = handle; - s_flexioIsr[index] = isr; - break; - } - } - - if (index == (uint8_t)FLEXIO_HANDLE_COUNT) - { - return kStatus_OutOfRange; - } - else - { - return kStatus_Success; - } -} - -/*! - * brief Unregisters the handle and the interrupt handler for the FlexIO-simulated peripheral. - * - * param base Pointer to the FlexIO simulated peripheral type. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_UnregisterHandleIRQ(void *base) -{ - assert(base != NULL); - - uint8_t index; - - /* Find the index from base address mappings. */ - for (index = 0U; index < (uint8_t)FLEXIO_HANDLE_COUNT; index++) - { - if (s_flexioType[index] == base) - { - /* Unregister FLEXIO simulated driver handle and isr. */ - s_flexioType[index] = NULL; - s_flexioHandle[index] = NULL; - s_flexioIsr[index] = NULL; - break; - } - } - - if (index == (uint8_t)FLEXIO_HANDLE_COUNT) - { - return kStatus_OutOfRange; - } - else - { - return kStatus_Success; - } -} - -static void FLEXIO_CommonIRQHandler(void) -{ - uint8_t index; - - for (index = 0U; index < (uint8_t)FLEXIO_HANDLE_COUNT; index++) - { - if (s_flexioHandle[index] != NULL) - { - s_flexioIsr[index](s_flexioType[index], s_flexioHandle[index]); - } - } - SDK_ISR_EXIT_BARRIER; -} - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER) && FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER -/*! - * brief Configure a FLEXIO pin used by the board. - * - * To Config the FLEXIO PIN, define a pin configuration, as either input or output, in the user file. - * Then, call the FLEXIO_SetPinConfig() function. - * - * This is an example to define an input pin or an output pin configuration. - * code - * Define a digital input pin configuration, - * flexio_gpio_config_t config = - * { - * kFLEXIO_DigitalInput, - * 0U, - * kFLEXIO_FlagRisingEdgeEnable | kFLEXIO_InputInterruptEnable, - * } - * Define a digital output pin configuration, - * flexio_gpio_config_t config = - * { - * kFLEXIO_DigitalOutput, - * 0U, - * 0U - * } - * endcode - * param base FlexIO peripheral base address - * param pin FLEXIO pin number. - * param config FLEXIO pin configuration pointer. - */ -void FLEXIO_SetPinConfig(FLEXIO_Type *base, uint32_t pin, flexio_gpio_config_t *config) -{ - assert(NULL != config); - IRQn_Type flexio_irqs[] = FLEXIO_IRQS; - - if (config->pinDirection == kFLEXIO_DigitalInput) - { - base->PINOUTE &= ~(1UL << pin); - if (0U != (config->inputConfig & (uint8_t)kFLEXIO_InputInterruptEnable)) - { - base->PINIEN = 1UL << pin; - /* Clear pending NVIC IRQ before enable NVIC IRQ. */ - NVIC_ClearPendingIRQ(flexio_irqs[FLEXIO_GetInstance(base)]); - /* Enable interrupt in NVIC. */ - (void)EnableIRQ(flexio_irqs[FLEXIO_GetInstance(base)]); - } - - if (0U != (config->inputConfig & (uint8_t)kFLEXIO_FlagRisingEdgeEnable)) - { - base->PINREN = 1UL << pin; - } - - if (0U != (config->inputConfig & (uint8_t)kFLEXIO_FlagFallingEdgeEnable)) - { - base->PINFEN = 1UL << pin; - } - } - else - { - FLEXIO_EnablePinOutput(base, pin); - FLEXIO_PinWrite(base, pin, config->outputLogic); - } -} -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER*/ - -void FLEXIO_DriverIRQHandler(void); -void FLEXIO_DriverIRQHandler(void) -{ - FLEXIO_CommonIRQHandler(); -} - -void FLEXIO0_DriverIRQHandler(void); -void FLEXIO0_DriverIRQHandler(void) -{ - FLEXIO_CommonIRQHandler(); -} - -void FLEXIO1_DriverIRQHandler(void); -void FLEXIO1_DriverIRQHandler(void) -{ - FLEXIO_CommonIRQHandler(); -} - -void UART2_FLEXIO_DriverIRQHandler(void); -void UART2_FLEXIO_DriverIRQHandler(void) -{ - FLEXIO_CommonIRQHandler(); -} - -void FLEXIO2_DriverIRQHandler(void); -void FLEXIO2_DriverIRQHandler(void) -{ - FLEXIO_CommonIRQHandler(); -} - -void FLEXIO3_DriverIRQHandler(void); -void FLEXIO3_DriverIRQHandler(void) -{ - FLEXIO_CommonIRQHandler(); -} diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio.h deleted file mode 100644 index 1e1bc6278d0..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio.h +++ /dev/null @@ -1,917 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020, 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_FLEXIO_H_ -#define FSL_FLEXIO_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup flexio_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief FlexIO driver version. */ -#define FSL_FLEXIO_DRIVER_VERSION (MAKE_VERSION(2, 2, 2)) -/*! @} */ - -/*! @brief Calculate FlexIO timer trigger.*/ -#define FLEXIO_TIMER_TRIGGER_SEL_PININPUT(x) ((uint32_t)(x) << 1U) -#define FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(x) (((uint32_t)(x) << 2U) | 0x1U) -#define FLEXIO_TIMER_TRIGGER_SEL_TIMn(x) (((uint32_t)(x) << 2U) | 0x3U) - -/*! @brief Define time of timer trigger polarity.*/ -typedef enum _flexio_timer_trigger_polarity -{ - kFLEXIO_TimerTriggerPolarityActiveHigh = 0x0U, /*!< Active high. */ - kFLEXIO_TimerTriggerPolarityActiveLow = 0x1U, /*!< Active low. */ -} flexio_timer_trigger_polarity_t; - -/*! @brief Define type of timer trigger source.*/ -typedef enum _flexio_timer_trigger_source -{ - kFLEXIO_TimerTriggerSourceExternal = 0x0U, /*!< External trigger selected. */ - kFLEXIO_TimerTriggerSourceInternal = 0x1U, /*!< Internal trigger selected. */ -} flexio_timer_trigger_source_t; - -/*! @brief Define type of timer/shifter pin configuration.*/ -typedef enum _flexio_pin_config -{ - kFLEXIO_PinConfigOutputDisabled = 0x0U, /*!< Pin output disabled. */ - kFLEXIO_PinConfigOpenDrainOrBidirection = 0x1U, /*!< Pin open drain or bidirectional output enable. */ - kFLEXIO_PinConfigBidirectionOutputData = 0x2U, /*!< Pin bidirectional output data. */ - kFLEXIO_PinConfigOutput = 0x3U, /*!< Pin output. */ -} flexio_pin_config_t; - -/*! @brief Definition of pin polarity.*/ -typedef enum _flexio_pin_polarity -{ - kFLEXIO_PinActiveHigh = 0x0U, /*!< Active high. */ - kFLEXIO_PinActiveLow = 0x1U, /*!< Active low. */ -} flexio_pin_polarity_t; - -/*! @brief Define type of timer work mode.*/ -typedef enum _flexio_timer_mode -{ - kFLEXIO_TimerModeDisabled = 0x0U, /*!< Timer Disabled. */ - kFLEXIO_TimerModeDual8BitBaudBit = 0x1U, /*!< Dual 8-bit counters baud/bit mode. */ - kFLEXIO_TimerModeDual8BitPWM = 0x2U, /*!< Dual 8-bit counters PWM mode. */ - kFLEXIO_TimerModeSingle16Bit = 0x3U, /*!< Single 16-bit counter mode. */ -} flexio_timer_mode_t; - -/*! @brief Define type of timer initial output or timer reset condition.*/ -typedef enum _flexio_timer_output -{ - kFLEXIO_TimerOutputOneNotAffectedByReset = 0x0U, /*!< Logic one when enabled and is not affected by timer - reset. */ - kFLEXIO_TimerOutputZeroNotAffectedByReset = 0x1U, /*!< Logic zero when enabled and is not affected by timer - reset. */ - kFLEXIO_TimerOutputOneAffectedByReset = 0x2U, /*!< Logic one when enabled and on timer reset. */ - kFLEXIO_TimerOutputZeroAffectedByReset = 0x3U, /*!< Logic zero when enabled and on timer reset. */ -} flexio_timer_output_t; - -/*! @brief Define type of timer decrement.*/ -typedef enum _flexio_timer_decrement_source -{ - kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput = 0x0U, /*!< Decrement counter on FlexIO clock, Shift clock - equals Timer output. */ - kFLEXIO_TimerDecSrcOnTriggerInputShiftTimerOutput, /*!< Decrement counter on Trigger input (both edges), - Shift clock equals Timer output. */ - kFLEXIO_TimerDecSrcOnPinInputShiftPinInput, /*!< Decrement counter on Pin input (both edges), - Shift clock equals Pin input. */ - kFLEXIO_TimerDecSrcOnTriggerInputShiftTriggerInput /*!< Decrement counter on Trigger input (both edges), - Shift clock equals Trigger input. */ -#if (defined(FSL_FEATURE_FLEXIO_TIMCFG_TIMDCE_FIELD_WIDTH) && (FSL_FEATURE_FLEXIO_TIMCFG_TIMDCE_FIELD_WIDTH == 3)) - , - kFLEXIO_TimerDecSrcDiv16OnFlexIOClockShiftTimerOutput, /*!< Decrement counter on FlexIO clock divided by 16, - Shift clock equals Timer output. */ - kFLEXIO_TimerDecSrcDiv256OnFlexIOClockShiftTimerOutput, /*!< Decrement counter on FlexIO clock divided by 256, - Shift clock equals Timer output. */ - kFLEXIO_TimerRisSrcOnPinInputShiftPinInput, /*!< Decrement counter on Pin input (rising edges), - Shift clock equals Pin input. */ - kFLEXIO_TimerRisSrcOnTriggerInputShiftTriggerInput /*!< Decrement counter on Trigger input (rising edges), Shift - clock equals Trigger input. */ -#endif /* FSL_FEATURE_FLEXIO_TIMCFG_TIMDCE_FIELD_WIDTH */ -} flexio_timer_decrement_source_t; - -/*! @brief Define type of timer reset condition.*/ -typedef enum _flexio_timer_reset_condition -{ - kFLEXIO_TimerResetNever = 0x0U, /*!< Timer never reset. */ - kFLEXIO_TimerResetOnTimerPinEqualToTimerOutput = 0x2U, /*!< Timer reset on Timer Pin equal to Timer Output. */ - kFLEXIO_TimerResetOnTimerTriggerEqualToTimerOutput = 0x3U, /*!< Timer reset on Timer Trigger equal to - Timer Output. */ - kFLEXIO_TimerResetOnTimerPinRisingEdge = 0x4U, /*!< Timer reset on Timer Pin rising edge. */ - kFLEXIO_TimerResetOnTimerTriggerRisingEdge = 0x6U, /*!< Timer reset on Trigger rising edge. */ - kFLEXIO_TimerResetOnTimerTriggerBothEdge = 0x7U, /*!< Timer reset on Trigger rising or falling edge. */ -} flexio_timer_reset_condition_t; - -/*! @brief Define type of timer disable condition.*/ -typedef enum _flexio_timer_disable_condition -{ - kFLEXIO_TimerDisableNever = 0x0U, /*!< Timer never disabled. */ - kFLEXIO_TimerDisableOnPreTimerDisable = 0x1U, /*!< Timer disabled on Timer N-1 disable. */ - kFLEXIO_TimerDisableOnTimerCompare = 0x2U, /*!< Timer disabled on Timer compare. */ - kFLEXIO_TimerDisableOnTimerCompareTriggerLow = 0x3U, /*!< Timer disabled on Timer compare and Trigger Low. */ - kFLEXIO_TimerDisableOnPinBothEdge = 0x4U, /*!< Timer disabled on Pin rising or falling edge. */ - kFLEXIO_TimerDisableOnPinBothEdgeTriggerHigh = 0x5U, /*!< Timer disabled on Pin rising or falling edge provided - Trigger is high. */ - kFLEXIO_TimerDisableOnTriggerFallingEdge = 0x6U, /*!< Timer disabled on Trigger falling edge. */ -} flexio_timer_disable_condition_t; - -/*! @brief Define type of timer enable condition.*/ -typedef enum _flexio_timer_enable_condition -{ - kFLEXIO_TimerEnabledAlways = 0x0U, /*!< Timer always enabled. */ - kFLEXIO_TimerEnableOnPrevTimerEnable = 0x1U, /*!< Timer enabled on Timer N-1 enable. */ - kFLEXIO_TimerEnableOnTriggerHigh = 0x2U, /*!< Timer enabled on Trigger high. */ - kFLEXIO_TimerEnableOnTriggerHighPinHigh = 0x3U, /*!< Timer enabled on Trigger high and Pin high. */ - kFLEXIO_TimerEnableOnPinRisingEdge = 0x4U, /*!< Timer enabled on Pin rising edge. */ - kFLEXIO_TimerEnableOnPinRisingEdgeTriggerHigh = 0x5U, /*!< Timer enabled on Pin rising edge and Trigger high. */ - kFLEXIO_TimerEnableOnTriggerRisingEdge = 0x6U, /*!< Timer enabled on Trigger rising edge. */ - kFLEXIO_TimerEnableOnTriggerBothEdge = 0x7U, /*!< Timer enabled on Trigger rising or falling edge. */ -} flexio_timer_enable_condition_t; - -/*! @brief Define type of timer stop bit generate condition.*/ -typedef enum _flexio_timer_stop_bit_condition -{ - kFLEXIO_TimerStopBitDisabled = 0x0U, /*!< Stop bit disabled. */ - kFLEXIO_TimerStopBitEnableOnTimerCompare = 0x1U, /*!< Stop bit is enabled on timer compare. */ - kFLEXIO_TimerStopBitEnableOnTimerDisable = 0x2U, /*!< Stop bit is enabled on timer disable. */ - kFLEXIO_TimerStopBitEnableOnTimerCompareDisable = 0x3U, /*!< Stop bit is enabled on timer compare and timer - disable. */ -} flexio_timer_stop_bit_condition_t; - -/*! @brief Define type of timer start bit generate condition.*/ -typedef enum _flexio_timer_start_bit_condition -{ - kFLEXIO_TimerStartBitDisabled = 0x0U, /*!< Start bit disabled. */ - kFLEXIO_TimerStartBitEnabled = 0x1U, /*!< Start bit enabled. */ -} flexio_timer_start_bit_condition_t; - -/*! @brief FlexIO as PWM channel output state */ -typedef enum _flexio_timer_output_state -{ - kFLEXIO_PwmLow = 0, /*!< The output state of PWM channel is low */ - kFLEXIO_PwmHigh, /*!< The output state of PWM channel is high */ -} flexio_timer_output_state_t; - -/*! @brief Define type of timer polarity for shifter control. */ -typedef enum _flexio_shifter_timer_polarity -{ - kFLEXIO_ShifterTimerPolarityOnPositive = 0x0U, /*!< Shift on positive edge of shift clock. */ - kFLEXIO_ShifterTimerPolarityOnNegitive = 0x1U, /*!< Shift on negative edge of shift clock. */ -} flexio_shifter_timer_polarity_t; - -/*! @brief Define type of shifter working mode.*/ -typedef enum _flexio_shifter_mode -{ - kFLEXIO_ShifterDisabled = 0x0U, /*!< Shifter is disabled. */ - kFLEXIO_ShifterModeReceive = 0x1U, /*!< Receive mode. */ - kFLEXIO_ShifterModeTransmit = 0x2U, /*!< Transmit mode. */ - kFLEXIO_ShifterModeMatchStore = 0x4U, /*!< Match store mode. */ - kFLEXIO_ShifterModeMatchContinuous = 0x5U, /*!< Match continuous mode. */ -#if FSL_FEATURE_FLEXIO_HAS_STATE_MODE - kFLEXIO_ShifterModeState = 0x6U, /*!< SHIFTBUF contents are used for storing - programmable state attributes. */ -#endif /* FSL_FEATURE_FLEXIO_HAS_STATE_MODE */ -#if FSL_FEATURE_FLEXIO_HAS_LOGIC_MODE - kFLEXIO_ShifterModeLogic = 0x7U, /*!< SHIFTBUF contents are used for implementing - programmable logic look up table. */ -#endif /* FSL_FEATURE_FLEXIO_HAS_LOGIC_MODE */ -} flexio_shifter_mode_t; - -/*! @brief Define type of shifter input source.*/ -typedef enum _flexio_shifter_input_source -{ - kFLEXIO_ShifterInputFromPin = 0x0U, /*!< Shifter input from pin. */ - kFLEXIO_ShifterInputFromNextShifterOutput = 0x1U, /*!< Shifter input from Shifter N+1. */ -} flexio_shifter_input_source_t; - -/*! @brief Define of STOP bit configuration.*/ -typedef enum _flexio_shifter_stop_bit -{ - kFLEXIO_ShifterStopBitDisable = 0x0U, /*!< Disable shifter stop bit. */ - kFLEXIO_ShifterStopBitLow = 0x2U, /*!< Set shifter stop bit to logic low level. */ - kFLEXIO_ShifterStopBitHigh = 0x3U, /*!< Set shifter stop bit to logic high level. */ -} flexio_shifter_stop_bit_t; - -/*! @brief Define type of START bit configuration.*/ -typedef enum _flexio_shifter_start_bit -{ - kFLEXIO_ShifterStartBitDisabledLoadDataOnEnable = 0x0U, /*!< Disable shifter start bit, transmitter loads - data on enable. */ - kFLEXIO_ShifterStartBitDisabledLoadDataOnShift = 0x1U, /*!< Disable shifter start bit, transmitter loads - data on first shift. */ - kFLEXIO_ShifterStartBitLow = 0x2U, /*!< Set shifter start bit to logic low level. */ - kFLEXIO_ShifterStartBitHigh = 0x3U, /*!< Set shifter start bit to logic high level. */ -} flexio_shifter_start_bit_t; - -/*! @brief Define FlexIO shifter buffer type*/ -typedef enum _flexio_shifter_buffer_type -{ - kFLEXIO_ShifterBuffer = 0x0U, /*!< Shifter Buffer N Register. */ - kFLEXIO_ShifterBufferBitSwapped = 0x1U, /*!< Shifter Buffer N Bit Byte Swapped Register. */ - kFLEXIO_ShifterBufferByteSwapped = 0x2U, /*!< Shifter Buffer N Byte Swapped Register. */ - kFLEXIO_ShifterBufferBitByteSwapped = 0x3U, /*!< Shifter Buffer N Bit Swapped Register. */ -#if defined(FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_BYTE_SWAP) && FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_BYTE_SWAP - kFLEXIO_ShifterBufferNibbleByteSwapped = 0x4U, /*!< Shifter Buffer N Nibble Byte Swapped Register. */ -#endif /*FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_BYTE_SWAP*/ -#if defined(FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_HALF_WORD_SWAP) && FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_HALF_WORD_SWAP - kFLEXIO_ShifterBufferHalfWordSwapped = 0x5U, /*!< Shifter Buffer N Half Word Swapped Register. */ -#endif -#if defined(FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_SWAP) && FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_SWAP - kFLEXIO_ShifterBufferNibbleSwapped = 0x6U, /*!< Shifter Buffer N Nibble Swapped Register. */ -#endif -} flexio_shifter_buffer_type_t; - -/*! @brief Define FlexIO user configuration structure. */ -typedef struct _flexio_config_ -{ - bool enableFlexio; /*!< Enable/disable FlexIO module */ - bool enableInDoze; /*!< Enable/disable FlexIO operation in doze mode */ - bool enableInDebug; /*!< Enable/disable FlexIO operation in debug mode */ - bool enableFastAccess; /*!< Enable/disable fast access to FlexIO registers, fast access requires - the FlexIO clock to be at least twice the frequency of the bus clock. */ -} flexio_config_t; - -/*! @brief Define FlexIO timer configuration structure. */ -typedef struct _flexio_timer_config -{ - /* Trigger. */ - uint32_t triggerSelect; /*!< The internal trigger selection number using MACROs. */ - flexio_timer_trigger_polarity_t triggerPolarity; /*!< Trigger Polarity. */ - flexio_timer_trigger_source_t triggerSource; /*!< Trigger Source, internal (see 'trgsel') or external. */ - /* Pin. */ - flexio_pin_config_t pinConfig; /*!< Timer Pin Configuration. */ - uint32_t pinSelect; /*!< Timer Pin number Select. */ - flexio_pin_polarity_t pinPolarity; /*!< Timer Pin Polarity. */ - /* Timer. */ - flexio_timer_mode_t timerMode; /*!< Timer work Mode. */ - flexio_timer_output_t timerOutput; /*!< Configures the initial state of the Timer Output and - whether it is affected by the Timer reset. */ - flexio_timer_decrement_source_t timerDecrement; /*!< Configures the source of the Timer decrement and the - source of the Shift clock. */ - flexio_timer_reset_condition_t timerReset; /*!< Configures the condition that causes the timer counter - (and optionally the timer output) to be reset. */ - flexio_timer_disable_condition_t timerDisable; /*!< Configures the condition that causes the Timer to be - disabled and stop decrementing. */ - flexio_timer_enable_condition_t timerEnable; /*!< Configures the condition that causes the Timer to be - enabled and start decrementing. */ - flexio_timer_stop_bit_condition_t timerStop; /*!< Timer STOP Bit generation. */ - flexio_timer_start_bit_condition_t timerStart; /*!< Timer STRAT Bit generation. */ - uint32_t timerCompare; /*!< Value for Timer Compare N Register. */ -} flexio_timer_config_t; - -/*! @brief Define FlexIO shifter configuration structure. */ -typedef struct _flexio_shifter_config -{ - /* Timer. */ - uint32_t timerSelect; /*!< Selects which Timer is used for controlling the - logic/shift register and generating the Shift clock. */ - flexio_shifter_timer_polarity_t timerPolarity; /*!< Timer Polarity. */ - /* Pin. */ - flexio_pin_config_t pinConfig; /*!< Shifter Pin Configuration. */ - uint32_t pinSelect; /*!< Shifter Pin number Select. */ - flexio_pin_polarity_t pinPolarity; /*!< Shifter Pin Polarity. */ - /* Shifter. */ - flexio_shifter_mode_t shifterMode; /*!< Configures the mode of the Shifter. */ -#if FSL_FEATURE_FLEXIO_HAS_PARALLEL_WIDTH - uint32_t parallelWidth; /*!< Configures the parallel width when using parallel mode.*/ -#endif /* FSL_FEATURE_FLEXIO_HAS_PARALLEL_WIDTH */ - flexio_shifter_input_source_t inputSource; /*!< Selects the input source for the shifter. */ - flexio_shifter_stop_bit_t shifterStop; /*!< Shifter STOP bit. */ - flexio_shifter_start_bit_t shifterStart; /*!< Shifter START bit. */ -} flexio_shifter_config_t; - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER) && FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER -/*! @brief FLEXIO gpio direction definition */ -typedef enum _flexio_gpio_direction -{ - kFLEXIO_DigitalInput = 0U, /*!< Set current pin as digital input*/ - kFLEXIO_DigitalOutput = 1U, /*!< Set current pin as digital output*/ -} flexio_gpio_direction_t; - -/*! @brief FLEXIO gpio input config */ -typedef enum _flexio_pin_input_config -{ - kFLEXIO_InputInterruptDisabled = 0x0U, /*!< Interrupt request is disabled. */ - kFLEXIO_InputInterruptEnable = 0x1U, /*!< Interrupt request is enable. */ - kFLEXIO_FlagRisingEdgeEnable = 0x2U, /*!< Input pin flag on rising edge. */ - kFLEXIO_FlagFallingEdgeEnable = 0x4U, /*!< Input pin flag on falling edge. */ -} flexio_pin_input_config_t; - -/*! - * @brief The FLEXIO pin configuration structure. - * - * Each pin can only be configured as either an output pin or an input pin at a time. - * If configured as an input pin, use inputConfig param. - * If configured as an output pin, use outputLogic. - */ -typedef struct _flexio_gpio_config -{ - flexio_gpio_direction_t pinDirection; /*!< FLEXIO pin direction, input or output */ - uint8_t outputLogic; /*!< Set a default output logic, which has no use in input */ - uint8_t inputConfig; /*!< Set an input config */ -} flexio_gpio_config_t; -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER*/ - -/*! @brief typedef for FlexIO simulated driver interrupt handler.*/ -typedef void (*flexio_isr_t)(void *base, void *handle); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to flexio bases for each instance. */ -extern FLEXIO_Type *const s_flexioBases[]; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to flexio clocks for each instance. */ -extern const clock_ip_name_t s_flexioClocks[]; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus*/ - -/*! - * @name FlexIO Initialization and De-initialization - * @{ - */ - -/*! - * @brief Gets the default configuration to configure the FlexIO module. The configuration - * can used directly to call the FLEXIO_Configure(). - * - * Example: - @code - flexio_config_t config; - FLEXIO_GetDefaultConfig(&config); - @endcode - * - * @param userConfig pointer to flexio_config_t structure -*/ -void FLEXIO_GetDefaultConfig(flexio_config_t *userConfig); - -/*! - * @brief Configures the FlexIO with a FlexIO configuration. The configuration structure - * can be filled by the user or be set with default values by FLEXIO_GetDefaultConfig(). - * - * Example - @code - flexio_config_t config = { - .enableFlexio = true, - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false - }; - FLEXIO_Configure(base, &config); - @endcode - * - * @param base FlexIO peripheral base address - * @param userConfig pointer to flexio_config_t structure -*/ -void FLEXIO_Init(FLEXIO_Type *base, const flexio_config_t *userConfig); - -/*! - * @brief Gates the FlexIO clock. Call this API to stop the FlexIO clock. - * - * @note After calling this API, call the FLEXO_Init to use the FlexIO module. - * - * @param base FlexIO peripheral base address - */ -void FLEXIO_Deinit(FLEXIO_Type *base); - -/*! - * @brief Get instance number for FLEXIO module. - * - * @param base FLEXIO peripheral base address. - */ -uint32_t FLEXIO_GetInstance(FLEXIO_Type *base); - -/*! @} */ - -/*! - * @name FlexIO Basic Operation - * @{ - */ - -/*! - * @brief Resets the FlexIO module. - * - * @param base FlexIO peripheral base address - */ -void FLEXIO_Reset(FLEXIO_Type *base); - -/*! - * @brief Enables the FlexIO module operation. - * - * @param base FlexIO peripheral base address - * @param enable true to enable, false to disable. - */ -static inline void FLEXIO_Enable(FLEXIO_Type *base, bool enable) -{ - if (enable) - { - base->CTRL |= FLEXIO_CTRL_FLEXEN_MASK; - } - else - { - base->CTRL &= ~FLEXIO_CTRL_FLEXEN_MASK; - } -} - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_STATUS) && FSL_FEATURE_FLEXIO_HAS_PIN_STATUS -/*! - * @brief Reads the input data on each of the FlexIO pins. - * - * @param base FlexIO peripheral base address - * @return FlexIO pin input data - */ -static inline uint32_t FLEXIO_ReadPinInput(FLEXIO_Type *base) -{ - return base->PIN; -} -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_STATUS*/ - -#if defined(FSL_FEATURE_FLEXIO_HAS_STATE_MODE) && FSL_FEATURE_FLEXIO_HAS_STATE_MODE -/*! - * @brief Gets the current state pointer for state mode use. - * - * @param base FlexIO peripheral base address - * @return current State pointer - */ -static inline uint8_t FLEXIO_GetShifterState(FLEXIO_Type *base) -{ - return ((uint8_t)(base->SHIFTSTATE) & FLEXIO_SHIFTSTATE_STATE_MASK); -} -#endif /*FSL_FEATURE_FLEXIO_HAS_STATE_MODE*/ - -/*! - * @brief Configures the shifter with the shifter configuration. The configuration structure - * covers both the SHIFTCTL and SHIFTCFG registers. To configure the shifter to the proper - * mode, select which timer controls the shifter to shift, whether to generate start bit/stop - * bit, and the polarity of start bit and stop bit. - * - * Example - @code - flexio_shifter_config_t config = { - .timerSelect = 0, - .timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive, - .pinConfig = kFLEXIO_PinConfigOpenDrainOrBidirection, - .pinPolarity = kFLEXIO_PinActiveLow, - .shifterMode = kFLEXIO_ShifterModeTransmit, - .inputSource = kFLEXIO_ShifterInputFromPin, - .shifterStop = kFLEXIO_ShifterStopBitHigh, - .shifterStart = kFLEXIO_ShifterStartBitLow - }; - FLEXIO_SetShifterConfig(base, &config); - @endcode - * - * @param base FlexIO peripheral base address - * @param index Shifter index - * @param shifterConfig Pointer to flexio_shifter_config_t structure -*/ -void FLEXIO_SetShifterConfig(FLEXIO_Type *base, uint8_t index, const flexio_shifter_config_t *shifterConfig); -/*! - * @brief Configures the timer with the timer configuration. The configuration structure - * covers both the TIMCTL and TIMCFG registers. To configure the timer to the proper - * mode, select trigger source for timer and the timer pin output and the timing for timer. - * - * Example - @code - flexio_timer_config_t config = { - .triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(0), - .triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow, - .triggerSource = kFLEXIO_TimerTriggerSourceInternal, - .pinConfig = kFLEXIO_PinConfigOpenDrainOrBidirection, - .pinSelect = 0, - .pinPolarity = kFLEXIO_PinActiveHigh, - .timerMode = kFLEXIO_TimerModeDual8BitBaudBit, - .timerOutput = kFLEXIO_TimerOutputZeroNotAffectedByReset, - .timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput, - .timerReset = kFLEXIO_TimerResetOnTimerPinEqualToTimerOutput, - .timerDisable = kFLEXIO_TimerDisableOnTimerCompare, - .timerEnable = kFLEXIO_TimerEnableOnTriggerHigh, - .timerStop = kFLEXIO_TimerStopBitEnableOnTimerDisable, - .timerStart = kFLEXIO_TimerStartBitEnabled - }; - FLEXIO_SetTimerConfig(base, &config); - @endcode - * - * @param base FlexIO peripheral base address - * @param index Timer index - * @param timerConfig Pointer to the flexio_timer_config_t structure -*/ -void FLEXIO_SetTimerConfig(FLEXIO_Type *base, uint8_t index, const flexio_timer_config_t *timerConfig); - -/*! - * @brief This function set the value of the prescaler on flexio channels - * - * @param base Pointer to the FlexIO simulated peripheral type. - * @param index Timer index - * @param clocksource Set clock value - */ -static inline void FLEXIO_SetClockMode(FLEXIO_Type *base, uint8_t index, flexio_timer_decrement_source_t clocksource) -{ - uint32_t reg = base->TIMCFG[index]; - - reg &= ~FLEXIO_TIMCFG_TIMDEC_MASK; - - reg |= FLEXIO_TIMCFG_TIMDEC(clocksource); - - base->TIMCFG[index] = reg; -} - -/*! @} */ - -/*! - * @name FlexIO Interrupt Operation - * @{ - */ - -/*! - * @brief Enables the shifter status interrupt. The interrupt generates when the corresponding SSF is set. - * - * @param base FlexIO peripheral base address - * @param mask The shifter status mask which can be calculated by (1 << shifter index) - * @note For multiple shifter status interrupt enable, for example, two shifter status enable, can calculate - * the mask by using ((1 << shifter index0) | (1 << shifter index1)) - */ -static inline void FLEXIO_EnableShifterStatusInterrupts(FLEXIO_Type *base, uint32_t mask) -{ - base->SHIFTSIEN |= mask; -} - -/*! - * @brief Disables the shifter status interrupt. The interrupt won't generate when the corresponding SSF is set. - * - * @param base FlexIO peripheral base address - * @param mask The shifter status mask which can be calculated by (1 << shifter index) - * @note For multiple shifter status interrupt enable, for example, two shifter status enable, can calculate - * the mask by using ((1 << shifter index0) | (1 << shifter index1)) - */ -static inline void FLEXIO_DisableShifterStatusInterrupts(FLEXIO_Type *base, uint32_t mask) -{ - base->SHIFTSIEN &= ~mask; -} - -/*! - * @brief Enables the shifter error interrupt. The interrupt generates when the corresponding SEF is set. - * - * @param base FlexIO peripheral base address - * @param mask The shifter error mask which can be calculated by (1 << shifter index) - * @note For multiple shifter error interrupt enable, for example, two shifter error enable, can calculate - * the mask by using ((1 << shifter index0) | (1 << shifter index1)) - */ -static inline void FLEXIO_EnableShifterErrorInterrupts(FLEXIO_Type *base, uint32_t mask) -{ - base->SHIFTEIEN |= mask; -} - -/*! - * @brief Disables the shifter error interrupt. The interrupt won't generate when the corresponding SEF is set. - * - * @param base FlexIO peripheral base address - * @param mask The shifter error mask which can be calculated by (1 << shifter index) - * @note For multiple shifter error interrupt enable, for example, two shifter error enable, can calculate - * the mask by using ((1 << shifter index0) | (1 << shifter index1)) - */ -static inline void FLEXIO_DisableShifterErrorInterrupts(FLEXIO_Type *base, uint32_t mask) -{ - base->SHIFTEIEN &= ~mask; -} - -/*! - * @brief Enables the timer status interrupt. The interrupt generates when the corresponding SSF is set. - * - * @param base FlexIO peripheral base address - * @param mask The timer status mask which can be calculated by (1 << timer index) - * @note For multiple timer status interrupt enable, for example, two timer status enable, can calculate - * the mask by using ((1 << timer index0) | (1 << timer index1)) - */ -static inline void FLEXIO_EnableTimerStatusInterrupts(FLEXIO_Type *base, uint32_t mask) -{ - base->TIMIEN |= mask; -} - -/*! - * @brief Disables the timer status interrupt. The interrupt won't generate when the corresponding SSF is set. - * - * @param base FlexIO peripheral base address - * @param mask The timer status mask which can be calculated by (1 << timer index) - * @note For multiple timer status interrupt enable, for example, two timer status enable, can calculate - * the mask by using ((1 << timer index0) | (1 << timer index1)) - */ -static inline void FLEXIO_DisableTimerStatusInterrupts(FLEXIO_Type *base, uint32_t mask) -{ - base->TIMIEN &= ~mask; -} - -/*! @} */ - -/*! - * @name FlexIO Status Operation - * @{ - */ - -/*! - * @brief Gets the shifter status flags. - * - * @param base FlexIO peripheral base address - * @return Shifter status flags - */ -static inline uint32_t FLEXIO_GetShifterStatusFlags(FLEXIO_Type *base) -{ - return ((base->SHIFTSTAT) & FLEXIO_SHIFTSTAT_SSF_MASK); -} - -/*! - * @brief Clears the shifter status flags. - * - * @param base FlexIO peripheral base address - * @param mask The shifter status mask which can be calculated by (1 << shifter index) - * @note For clearing multiple shifter status flags, for example, two shifter status flags, can calculate - * the mask by using ((1 << shifter index0) | (1 << shifter index1)) - */ -static inline void FLEXIO_ClearShifterStatusFlags(FLEXIO_Type *base, uint32_t mask) -{ - base->SHIFTSTAT = mask; -} - -/*! - * @brief Gets the shifter error flags. - * - * @param base FlexIO peripheral base address - * @return Shifter error flags - */ -static inline uint32_t FLEXIO_GetShifterErrorFlags(FLEXIO_Type *base) -{ - return ((base->SHIFTERR) & FLEXIO_SHIFTERR_SEF_MASK); -} - -/*! - * @brief Clears the shifter error flags. - * - * @param base FlexIO peripheral base address - * @param mask The shifter error mask which can be calculated by (1 << shifter index) - * @note For clearing multiple shifter error flags, for example, two shifter error flags, can calculate - * the mask by using ((1 << shifter index0) | (1 << shifter index1)) - */ -static inline void FLEXIO_ClearShifterErrorFlags(FLEXIO_Type *base, uint32_t mask) -{ - base->SHIFTERR = mask; -} - -/*! - * @brief Gets the timer status flags. - * - * @param base FlexIO peripheral base address - * @return Timer status flags - */ -static inline uint32_t FLEXIO_GetTimerStatusFlags(FLEXIO_Type *base) -{ - return ((base->TIMSTAT) & FLEXIO_TIMSTAT_TSF_MASK); -} - -/*! - * @brief Clears the timer status flags. - * - * @param base FlexIO peripheral base address - * @param mask The timer status mask which can be calculated by (1 << timer index) - * @note For clearing multiple timer status flags, for example, two timer status flags, can calculate - * the mask by using ((1 << timer index0) | (1 << timer index1)) - */ -static inline void FLEXIO_ClearTimerStatusFlags(FLEXIO_Type *base, uint32_t mask) -{ - base->TIMSTAT = mask; -} - -/*! @} */ - -/*! - * @name FlexIO DMA Operation - * @{ - */ - -/*! - * @brief Enables/disables the shifter status DMA. The DMA request generates when the corresponding SSF is set. - * - * @note For multiple shifter status DMA enables, for example, calculate - * the mask by using ((1 << shifter index0) | (1 << shifter index1)) - * - * @param base FlexIO peripheral base address - * @param mask The shifter status mask which can be calculated by (1 << shifter index) - * @param enable True to enable, false to disable. - */ -static inline void FLEXIO_EnableShifterStatusDMA(FLEXIO_Type *base, uint32_t mask, bool enable) -{ - if (enable) - { - base->SHIFTSDEN |= mask; - } - else - { - base->SHIFTSDEN &= ~mask; - } -} - -/*! - * @brief Gets the shifter buffer address for the DMA transfer usage. - * - * @param base FlexIO peripheral base address - * @param type Shifter type of flexio_shifter_buffer_type_t - * @param index Shifter index - * @return Corresponding shifter buffer index - */ -uint32_t FLEXIO_GetShifterBufferAddress(FLEXIO_Type *base, flexio_shifter_buffer_type_t type, uint8_t index); - -/*! - * @brief Registers the handle and the interrupt handler for the FlexIO-simulated peripheral. - * - * @param base Pointer to the FlexIO simulated peripheral type. - * @param handle Pointer to the handler for FlexIO simulated peripheral. - * @param isr FlexIO simulated peripheral interrupt handler. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_RegisterHandleIRQ(void *base, void *handle, flexio_isr_t isr); - -/*! - * @brief Unregisters the handle and the interrupt handler for the FlexIO-simulated peripheral. - * - * @param base Pointer to the FlexIO simulated peripheral type. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_UnregisterHandleIRQ(void *base); -/*! @} */ - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER) && FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER - -/*! - * @brief Configure a FLEXIO pin used by the board. - * - * To Config the FLEXIO PIN, define a pin configuration, as either input or output, in the user file. - * Then, call the FLEXIO_SetPinConfig() function. - * - * This is an example to define an input pin or an output pin configuration. - * @code - * Define a digital input pin configuration, - * flexio_gpio_config_t config = - * { - * kFLEXIO_DigitalInput, - * 0U, - * kFLEXIO_FlagRisingEdgeEnable | kFLEXIO_InputInterruptEnable, - * } - * Define a digital output pin configuration, - * flexio_gpio_config_t config = - * { - * kFLEXIO_DigitalOutput, - * 0U, - * 0U - * } - * @endcode - * @param base FlexIO peripheral base address - * @param pin FLEXIO pin number. - * @param config FLEXIO pin configuration pointer. - */ -void FLEXIO_SetPinConfig(FLEXIO_Type *base, uint32_t pin, flexio_gpio_config_t *config); - -/*! - * @name GPIO Output Operations - * @{ - */ - -/*! - * @brief Sets the output level of the multiple FLEXIO pins to the logic 0. - * - * @param base FlexIO peripheral base address - * @param mask FLEXIO pin number mask - */ -static inline void FLEXIO_ClearPortOutput(FLEXIO_Type *base, uint32_t mask) -{ - base->PINOUTCLR = mask; -} - -/*! - * @brief Sets the output level of the multiple FLEXIO pins to the logic 1. - * - * @param base FlexIO peripheral base address - * @param mask FLEXIO pin number mask - */ -static inline void FLEXIO_SetPortOutput(FLEXIO_Type *base, uint32_t mask) -{ - base->PINOUTSET = mask; -} - -/*! - * @brief Reverses the current output logic of the multiple FLEXIO pins. - * - * @param base FlexIO peripheral base address - * @param mask FLEXIO pin number mask - */ -static inline void FLEXIO_TogglePortOutput(FLEXIO_Type *base, uint32_t mask) -{ - base->PINOUTTOG = mask; -} - -/*! - * @brief Sets the output level of the FLEXIO pins to the logic 1 or 0. - * - * @param base FlexIO peripheral base address - * @param pin FLEXIO pin number. - * @param output FLEXIO pin output logic level. - * - 0: corresponding pin output low-logic level. - * - 1: corresponding pin output high-logic level. - */ -static inline void FLEXIO_PinWrite(FLEXIO_Type *base, uint32_t pin, uint8_t output) -{ - if (output == 0U) - { - FLEXIO_ClearPortOutput(base, 1UL << pin); - } - else - { - FLEXIO_SetPortOutput(base, 1UL << pin); - } -} - -/*! - * @brief Enables the FLEXIO output pin function. - * - * @param base FlexIO peripheral base address - * @param pin FLEXIO pin number. - */ -static inline void FLEXIO_EnablePinOutput(FLEXIO_Type *base, uint32_t pin) -{ - base->PINOUTE |= (1UL << pin); -} -/*! @} */ - -/*! - * @name FLEXIO PIN Input Operations - * @{ - */ - -/*! - * @brief Reads the current input value of the FLEXIO pin. - * - * @param base FlexIO peripheral base address - * @param pin FLEXIO pin number. - * @retval FLEXIO port input value - * - 0: corresponding pin input low-logic level. - * - 1: corresponding pin input high-logic level. - */ -static inline uint32_t FLEXIO_PinRead(FLEXIO_Type *base, uint32_t pin) -{ - return (((base->PIN) >> pin) & 0x01U); -} - -/*! - * @brief Gets the FLEXIO input pin status. - * - * @param base FlexIO peripheral base address - * @param pin FLEXIO pin number. - * @retval FLEXIO port input status - * - 0: corresponding pin input capture no status. - * - 1: corresponding pin input capture rising or falling edge. - */ -static inline uint32_t FLEXIO_GetPinStatus(FLEXIO_Type *base, uint32_t pin) -{ - return (((base->PINSTAT) >> pin) & 0x01U); -} - -/*! - * @brief Clears the multiple FLEXIO input pins status. - * - * @param base FlexIO peripheral base address - * @param mask FLEXIO pin number mask - */ -static inline void FLEXIO_ClearPortStatus(FLEXIO_Type *base, uint32_t mask) -{ - base->PINSTAT = mask; -} -/*! @} */ - -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER*/ - -#if defined(__cplusplus) -} -#endif /*_cplusplus*/ -/*! @} */ - -#endif /*FSL_FLEXIO_H_*/ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_i2c_master.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_i2c_master.c deleted file mode 100644 index 9239527c6fa..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_i2c_master.c +++ /dev/null @@ -1,1377 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio_i2c_master.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio_i2c_master" -#endif - -/*! @brief FLEXIO I2C transfer state */ -enum _flexio_i2c_master_transfer_states -{ - kFLEXIO_I2C_Idle = 0x0U, /*!< I2C bus idle */ - kFLEXIO_I2C_Start = 0x1U, /*!< I2C start phase */ - kFLEXIO_I2C_SendCommand = 0x2U, /*!< Send command byte phase */ - kFLEXIO_I2C_SendData = 0x3U, /*!< Send data transfer phase*/ - kFLEXIO_I2C_ReceiveDataBegin = 0x4U, /*!< Receive data begin transfer phase*/ - kFLEXIO_I2C_ReceiveData = 0x5U, /*!< Receive data transfer phase*/ -}; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Set up master transfer, send slave address and decide the initial - * transfer state. - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param transfer pointer to flexio_i2c_master_transfer_t structure - */ -static status_t FLEXIO_I2C_MasterTransferInitStateMachine(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - flexio_i2c_master_transfer_t *xfer); - -/*! - * @brief Master run transfer state machine to perform a byte of transfer. - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param statusFlags flexio i2c hardware status - * @retval kStatus_Success Successfully run state machine - * @retval kStatus_FLEXIO_I2C_Nak Receive Nak during transfer - */ -static status_t FLEXIO_I2C_MasterTransferRunStateMachine(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags); - -/*! - * @brief Complete transfer, disable interrupt and call callback. - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param status flexio transfer status - */ -static void FLEXIO_I2C_MasterTransferComplete(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - status_t status); - -/*! - * @brief introduce function FLEXIO_I2C_MasterTransferStateMachineStart. - * This function was deal with Initial state, i2c start state. - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - */ -static void FLEXIO_I2C_MasterTransferStateMachineStart(FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle); - -/*! - * @brief introduce function FLEXIO_I2C_MasterTransferStateMachineSendCommand. - * This function was deal with Check address only needed for transfer with subaddress . - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param statusFlags flexio i2c hardware status - * - * @return default is true when No abnormality. - * @return false when time out. - */ -static bool FLEXIO_I2C_MasterTransferStateMachineSendCommand(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags); - -/*! - * @brief introduce function FLEXIO_I2C_MasterTransferStateMachineSendData. - * This function was deal with Send command byte. - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param statusFlags flexio i2c hardware status - * - * @return default is true when No abnormality. - * @return false when time out. - */ -static bool FLEXIO_I2C_MasterTransferStateMachineSendData(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags); - -/*! - * @brief introduce function FLEXIO_I2C_MasterTransferStateMachineReceiveDataBegin. - * This function was deal with Receive Data Begin. - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param statusFlags flexio i2c hardware status - * - * @return default is true when No abnormality. - * @return false when time out. - */ -static bool FLEXIO_I2C_MasterTransferStateMachineReceiveDataBegin(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags); - -/*! - * @brief introduce function Case_kFLEXIO_I2C_ReceiveDataBegin. - * This function was deal with Receive Data. - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param statusFlags flexio i2c hardware status - * - * @return default is kStatus_Success when No abnormality. - * @return kStatus_FLEXIO_I2C_Nak when ReceiveNakFlag is not set. - * @return kStatus_FLEXIO_I2C_Timeout when time out. - */ -static status_t FLEXIO_I2C_MasterTransferStateMachineReceiveData(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags); - -/******************************************************************************* - * Codes - ******************************************************************************/ - -static uint32_t FLEXIO_I2C_GetInstance(FLEXIO_I2C_Type *base) -{ - return FLEXIO_GetInstance(base->flexioBase); -} - -static status_t FLEXIO_I2C_MasterTransferInitStateMachine(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - flexio_i2c_master_transfer_t *xfer) -{ - bool needRestart; - uint32_t byteCount; - - /* Init the handle member. */ - handle->transfer.slaveAddress = xfer->slaveAddress; - handle->transfer.direction = xfer->direction; - handle->transfer.subaddress = xfer->subaddress; - handle->transfer.subaddressSize = xfer->subaddressSize; - handle->transfer.data = xfer->data; - handle->transfer.dataSize = xfer->dataSize; - handle->transfer.flags = xfer->flags; - handle->transferSize = xfer->dataSize; - - /* Initial state, i2c start state. */ - handle->state = (uint8_t)kFLEXIO_I2C_Start; - - /* Clear all status before transfer. */ - FLEXIO_I2C_MasterClearStatusFlags(base, (uint32_t)kFLEXIO_I2C_ReceiveNakFlag); - - /* Calculate whether need to send re-start. */ - needRestart = (handle->transfer.subaddressSize != 0U) && (handle->transfer.direction == kFLEXIO_I2C_Read); - handle->needRestart = needRestart; - - /* Calculate total byte count in a frame. */ - byteCount = 1U; - - if (!needRestart) - { - byteCount += handle->transfer.dataSize; - } - - if (handle->transfer.subaddressSize != 0U) - { - byteCount += handle->transfer.subaddressSize; - } - - /* Configure data count. */ - if (FLEXIO_I2C_MasterSetTransferCount(base, (uint16_t)byteCount) != kStatus_Success) - { - return kStatus_InvalidArgument; - } - - /* Configure timer1 disable condition. */ - uint32_t tmpConfig = base->flexioBase->TIMCFG[base->timerIndex[1]]; - tmpConfig &= ~FLEXIO_TIMCFG_TIMDIS_MASK; - tmpConfig |= FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnPreTimerDisable); - base->flexioBase->TIMCFG[base->timerIndex[1]] = tmpConfig; - -#if I2C_RETRY_TIMES - uint32_t waitTimes = I2C_RETRY_TIMES; - while ((0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return kStatus_FLEXIO_I2C_Timeout; - } -#else - while (0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) - { - } -#endif - - return kStatus_Success; -} - -static void FLEXIO_I2C_MasterTransferStateMachineStart(FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle) -{ - if (handle->needRestart) - { - FLEXIO_I2C_MasterStart(base, handle->transfer.slaveAddress, kFLEXIO_I2C_Write); - } - else - { - FLEXIO_I2C_MasterStart(base, handle->transfer.slaveAddress, handle->transfer.direction); - } - if (handle->transfer.subaddressSize == 0U) - { - if (handle->transfer.direction == kFLEXIO_I2C_Write) - { - /* Next state, send data. */ - handle->state = (uint8_t)kFLEXIO_I2C_SendData; - } - else - { - /* Next state, receive data begin. */ - handle->state = (uint8_t)kFLEXIO_I2C_ReceiveDataBegin; - } - } - else - { - /* Next state, send command byte. */ - handle->state = (uint8_t)kFLEXIO_I2C_SendCommand; - } -} - -static bool FLEXIO_I2C_MasterTransferStateMachineSendCommand(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags) -{ - if ((statusFlags & (uint32_t)kFLEXIO_I2C_TxEmptyFlag) != 0U) - { - if (handle->transfer.subaddressSize > 0U) - { - handle->transfer.subaddressSize--; - FLEXIO_I2C_MasterWriteByte(base, ((handle->transfer.subaddress) >> (8U * handle->transfer.subaddressSize))); - - if (handle->transfer.subaddressSize == 0U) - { - /* Load re-start in advance. */ - if (handle->transfer.direction == kFLEXIO_I2C_Read) - { -#if I2C_RETRY_TIMES - while ((0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return false; - } -#else - while (0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) - { - } -#endif - FLEXIO_I2C_MasterRepeatedStart(base); - } - } - } - else - { - if (handle->transfer.direction == kFLEXIO_I2C_Write) - { - /* Send first byte of data. */ - if (handle->transfer.dataSize > 0U) - { - /* Next state, send data. */ - handle->state = (uint8_t)kFLEXIO_I2C_SendData; - - FLEXIO_I2C_MasterWriteByte(base, *handle->transfer.data); - handle->transfer.data++; - handle->transfer.dataSize--; - } - else - { - FLEXIO_I2C_MasterStop(base); - -#if I2C_RETRY_TIMES - while ((0U == (FLEXIO_I2C_MasterGetStatusFlags(base) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return false; - } -#else - while (0U == (FLEXIO_I2C_MasterGetStatusFlags(base) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) - { - } -#endif - (void)FLEXIO_I2C_MasterReadByte(base); - - handle->state = (uint8_t)kFLEXIO_I2C_Idle; - } - } - else - { - (void)FLEXIO_I2C_MasterSetTransferCount(base, (uint16_t)(handle->transfer.dataSize + 1U)); - /* Delay at least one clock cycle so that the restart setup time is up to spec standard. */ - SDK_DelayAtLeastUs(1000000UL / base->baudrate, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY); - FLEXIO_I2C_MasterStart(base, handle->transfer.slaveAddress, kFLEXIO_I2C_Read); - - /* Next state, receive data begin. */ - handle->state = (uint8_t)kFLEXIO_I2C_ReceiveDataBegin; - } - } - } - return true; -} - -static bool FLEXIO_I2C_MasterTransferStateMachineSendData(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags) -{ - if ((statusFlags & (uint32_t)kFLEXIO_I2C_TxEmptyFlag) != 0U) - { - /* Send one byte of data. */ - if (handle->transfer.dataSize > 0U) - { - FLEXIO_I2C_MasterWriteByte(base, *handle->transfer.data); - - handle->transfer.data++; - handle->transfer.dataSize--; - } - else - { - FLEXIO_I2C_MasterStop(base); - -#if I2C_RETRY_TIMES - while ((0U == (FLEXIO_I2C_MasterGetStatusFlags(base) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return false; - } -#else - while (0U == (FLEXIO_I2C_MasterGetStatusFlags(base) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) - { - } -#endif - (void)FLEXIO_I2C_MasterReadByte(base); - - handle->state = (uint8_t)kFLEXIO_I2C_Idle; - } - } - return true; -} - -static bool FLEXIO_I2C_MasterTransferStateMachineReceiveDataBegin(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags) -{ - if ((statusFlags & (uint32_t)kFLEXIO_I2C_RxFullFlag) != 0U) - { - handle->state = (uint8_t)kFLEXIO_I2C_ReceiveData; - /* Send nak at the last receive byte. */ - if (handle->transfer.dataSize == 1U) - { - FLEXIO_I2C_MasterEnableAck(base, false); -#if I2C_RETRY_TIMES - while ((0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return false; - } -#else - while (0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) - { - } -#endif - FLEXIO_I2C_MasterStop(base); - } - else - { - FLEXIO_I2C_MasterEnableAck(base, true); - } - } - else if ((statusFlags & (uint32_t)kFLEXIO_I2C_TxEmptyFlag) != 0U) - { - /* Read one byte of data. */ - FLEXIO_I2C_MasterWriteByte(base, 0xFFFFFFFFU); - } - else - { - ; /* Avoid MISRA 2012 rule 15.7 */ - } - return true; -} - -static status_t FLEXIO_I2C_MasterTransferStateMachineReceiveData(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags) -{ - if ((statusFlags & (uint32_t)kFLEXIO_I2C_RxFullFlag) != 0U) - { - *handle->transfer.data = FLEXIO_I2C_MasterReadByte(base); - handle->transfer.data++; - if (0U != handle->transfer.dataSize--) - { - if (handle->transfer.dataSize == 0U) - { - FLEXIO_I2C_MasterDisableInterrupts(base, (uint32_t)kFLEXIO_I2C_RxFullInterruptEnable); - handle->state = (uint8_t)kFLEXIO_I2C_Idle; - /* Return nak if ReceiveNakFlag is not set */ - if ((statusFlags & (uint32_t)kFLEXIO_I2C_ReceiveNakFlag) == 0U) - { - return kStatus_FLEXIO_I2C_Nak; - } - } - - /* Send nak at the last receive byte. */ - if (handle->transfer.dataSize == 1U) - { - FLEXIO_I2C_MasterEnableAck(base, false); -#if I2C_RETRY_TIMES - while ((0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return kStatus_FLEXIO_I2C_Timeout; - } -#else - while (0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) - { - } -#endif - FLEXIO_I2C_MasterStop(base); - } - } - } - else if ((statusFlags & (uint32_t)kFLEXIO_I2C_TxEmptyFlag) != 0U) - { - if (handle->transfer.dataSize > 1U) - { - FLEXIO_I2C_MasterWriteByte(base, 0xFFFFFFFFU); - } - } - else - { - ; /* Avoid MISRA 2012 rule 15.7 */ - } - return kStatus_Success; -} - -static status_t FLEXIO_I2C_MasterTransferRunStateMachine(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags) -{ - status_t status; -#if I2C_RETRY_TIMES - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - - if ((statusFlags & (uint32_t)kFLEXIO_I2C_ReceiveNakFlag) != 0U) - { - /* Clear receive nak flag. */ - FLEXIO_ClearShifterErrorFlags(base->flexioBase, 1UL << base->shifterIndex[1]); - - if ((!((handle->state == (uint8_t)kFLEXIO_I2C_SendData) && (handle->transfer.dataSize == 0U))) && - (!(((handle->state == (uint8_t)kFLEXIO_I2C_ReceiveData) || - (handle->state == (uint8_t)kFLEXIO_I2C_ReceiveDataBegin)) && - (handle->transfer.dataSize == 1U)))) - { - (void)FLEXIO_I2C_MasterReadByte(base); - - FLEXIO_I2C_MasterAbortStop(base); - - /* Delay one clk cycle to ensure the bus is idle. */ - SDK_DelayAtLeastUs(1000000UL / base->baudrate, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY); - - handle->state = (uint8_t)kFLEXIO_I2C_Idle; - - return kStatus_FLEXIO_I2C_Nak; - } - } - - if (((statusFlags & (uint8_t)kFLEXIO_I2C_RxFullFlag) != 0U) && (handle->state != (uint8_t)kFLEXIO_I2C_ReceiveData)) - { - (void)FLEXIO_I2C_MasterReadByte(base); - } - - switch (handle->state) - { - /* Initial state, i2c start state. */ - case (uint8_t)kFLEXIO_I2C_Start: - /* Send address byte first. */ - FLEXIO_I2C_MasterTransferStateMachineStart(base, handle); - break; - - /* Check address only needed for transfer with subaddress */ - case (uint8_t)kFLEXIO_I2C_SendCommand: - if (false == FLEXIO_I2C_MasterTransferStateMachineSendCommand(base, handle, statusFlags)) - { - return kStatus_FLEXIO_I2C_Timeout; - } - break; - - /* Send command byte. */ - case (uint8_t)kFLEXIO_I2C_SendData: - if (false == FLEXIO_I2C_MasterTransferStateMachineSendData(base, handle, statusFlags)) - { - return kStatus_FLEXIO_I2C_Timeout; - } - break; - - case (uint8_t)kFLEXIO_I2C_ReceiveDataBegin: - if (false == FLEXIO_I2C_MasterTransferStateMachineReceiveDataBegin(base, handle, statusFlags)) - { - return kStatus_FLEXIO_I2C_Timeout; - } - break; - - case (uint8_t)kFLEXIO_I2C_ReceiveData: - status = FLEXIO_I2C_MasterTransferStateMachineReceiveData(base, handle, statusFlags); - if (kStatus_Success != status) - { - return status; - } - break; - - default: - /* Add comment to avoid MISRA violation */ - break; - } - - return kStatus_Success; -} - -static void FLEXIO_I2C_MasterTransferComplete(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - status_t status) -{ - FLEXIO_I2C_MasterDisableInterrupts( - base, (uint32_t)kFLEXIO_I2C_TxEmptyInterruptEnable | (uint32_t)kFLEXIO_I2C_RxFullInterruptEnable); - - if (handle->completionCallback != NULL) - { - handle->completionCallback(base, handle, status, handle->userData); - } -} - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_STATUS) && FSL_FEATURE_FLEXIO_HAS_PIN_STATUS -/*! - * brief Make sure the bus isn't already pulled down. - * - * Check the FLEXIO pin status to see whether either of SDA and SCL pin is pulled down. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * retval kStatus_Success - * retval kStatus_FLEXIO_I2C_Busy - */ -status_t FLEXIO_I2C_CheckForBusyBus(FLEXIO_I2C_Type *base) -{ - uint32_t mask; - /* If in certain loops the SDA/SCL is continuously pulled down, then return bus busy status. */ - /* The loop count is determined by maximum CPU clock frequency */ - for (uint32_t i = 0U; i < SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY / 600000U; ++i) - { - mask = 1UL << base->SDAPinIndex | 1UL << base->SCLPinIndex; - if ((FLEXIO_ReadPinInput(base->flexioBase) & mask) == mask) - { - return kStatus_Success; - } - } - return kStatus_FLEXIO_I2C_Busy; -} -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_STATUS*/ - -/*! - * brief Ungates the FlexIO clock, resets the FlexIO module, and configures the FlexIO I2C - * hardware configuration. - * - * Example - code - FLEXIO_I2C_Type base = { - .flexioBase = FLEXIO, - .SDAPinIndex = 0, - .SCLPinIndex = 1, - .shifterIndex = {0,1}, - .timerIndex = {0,1} - }; - flexio_i2c_master_config_t config = { - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .baudRate_Bps = 100000 - }; - FLEXIO_I2C_MasterInit(base, &config, srcClock_Hz); - endcode - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param masterConfig Pointer to flexio_i2c_master_config_t structure. - * param srcClock_Hz FlexIO source clock in Hz. - * retval kStatus_Success Initialization successful - * retval kStatus_InvalidArgument The source clock exceed upper range limitation -*/ -status_t FLEXIO_I2C_MasterInit(FLEXIO_I2C_Type *base, flexio_i2c_master_config_t *masterConfig, uint32_t srcClock_Hz) -{ - assert((base != NULL) && (masterConfig != NULL)); - - flexio_shifter_config_t shifterConfig; - flexio_timer_config_t timerConfig; - uint32_t controlVal = 0; - uint16_t timerDiv = 0; - status_t result = kStatus_Success; - - (void)memset(&shifterConfig, 0, sizeof(shifterConfig)); - (void)memset(&timerConfig, 0, sizeof(timerConfig)); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate flexio clock. */ - CLOCK_EnableClock(s_flexioClocks[FLEXIO_I2C_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Do hardware configuration. */ - /* 1. Configure the shifter 0 for tx. */ - shifterConfig.timerSelect = base->timerIndex[2]; - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive; - shifterConfig.pinConfig = kFLEXIO_PinConfigOpenDrainOrBidirection; - shifterConfig.pinSelect = base->SDAPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveLow; - shifterConfig.shifterMode = kFLEXIO_ShifterModeTransmit; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitHigh; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitLow; - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[0], &shifterConfig); - - /* 2. Configure the shifter 1 for rx. */ - shifterConfig.timerSelect = base->timerIndex[2]; - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnNegitive; - shifterConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - shifterConfig.pinSelect = base->SDAPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveHigh; - shifterConfig.shifterMode = kFLEXIO_ShifterModeReceive; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitLow; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnEnable; - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[1], &shifterConfig); - - /*3. Configure the timer 0 and timer 1 for generating bit clock. */ - /* timer 1 is used to config baudrate */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->shifterIndex[0]); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOpenDrainOrBidirection; - timerConfig.pinSelect = base->SCLPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveHigh; - timerConfig.timerMode = kFLEXIO_TimerModeSingle16Bit; - timerConfig.timerOutput = kFLEXIO_TimerOutputZeroNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput; - timerConfig.timerReset = kFLEXIO_TimerResetOnTimerPinEqualToTimerOutput; - timerConfig.timerDisable = kFLEXIO_TimerDisableOnPreTimerDisable; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnTriggerHigh; - timerConfig.timerStop = kFLEXIO_TimerStopBitDisabled; - timerConfig.timerStart = kFLEXIO_TimerStartBitDisabled; - - /* Set TIMCMP = (baud rate divider / 2) - 1. */ - timerDiv = (uint16_t)(srcClock_Hz / masterConfig->baudRate_Bps) / 2U - 1U; - /* Calculate and assign the actual baudrate. */ - base->baudrate = srcClock_Hz / (2U * ((uint32_t)timerDiv + 1U)); - - timerConfig.timerCompare = timerDiv; - - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[1], &timerConfig); - - /* timer 0 is used to config total shift clock edges */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->shifterIndex[0]); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - timerConfig.pinSelect = base->SCLPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveHigh; - timerConfig.timerMode = kFLEXIO_TimerModeSingle16Bit; - timerConfig.timerOutput = kFLEXIO_TimerOutputOneNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnPinInputShiftPinInput; - timerConfig.timerReset = kFLEXIO_TimerResetNever; - timerConfig.timerDisable = kFLEXIO_TimerDisableOnTimerCompare; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnTriggerHigh; - timerConfig.timerStop = kFLEXIO_TimerStopBitDisabled; - timerConfig.timerStart = kFLEXIO_TimerStartBitDisabled; - - /* Set TIMCMP when confinguring transfer bytes. */ - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[0], &timerConfig); - - /* 4. Configure the timer 2 for controlling shifters. */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->shifterIndex[0]); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - timerConfig.pinSelect = base->SCLPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveLow; - timerConfig.timerMode = kFLEXIO_TimerModeSingle16Bit; - timerConfig.timerOutput = kFLEXIO_TimerOutputOneNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnPinInputShiftPinInput; - timerConfig.timerReset = kFLEXIO_TimerResetNever; - timerConfig.timerDisable = kFLEXIO_TimerDisableOnPreTimerDisable; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnPrevTimerEnable; - timerConfig.timerStop = kFLEXIO_TimerStopBitEnableOnTimerCompare; - timerConfig.timerStart = kFLEXIO_TimerStartBitEnabled; - - /* Set TIMCMP[15:0] = (number of bits x 2) - 1. */ - timerConfig.timerCompare = 8U * 2U - 1U; - - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[2], &timerConfig); - - /* Configure FLEXIO I2C Master. */ - controlVal = base->flexioBase->CTRL; - controlVal &= - ~(FLEXIO_CTRL_DOZEN_MASK | FLEXIO_CTRL_DBGE_MASK | FLEXIO_CTRL_FASTACC_MASK | FLEXIO_CTRL_FLEXEN_MASK); - controlVal |= (FLEXIO_CTRL_DBGE(masterConfig->enableInDebug) | FLEXIO_CTRL_FASTACC(masterConfig->enableFastAccess) | - FLEXIO_CTRL_FLEXEN(masterConfig->enableMaster)); - if (!masterConfig->enableInDoze) - { - controlVal |= FLEXIO_CTRL_DOZEN_MASK; - } - - base->flexioBase->CTRL = controlVal; - /* Disable internal IRQs. */ - FLEXIO_I2C_MasterDisableInterrupts( - base, (uint32_t)kFLEXIO_I2C_TxEmptyInterruptEnable | (uint32_t)kFLEXIO_I2C_RxFullInterruptEnable); - return result; -} - -/*! - * brief De-initializes the FlexIO I2C master peripheral. Calling this API Resets the FlexIO I2C master - * shifer and timer config, module can't work unless the FLEXIO_I2C_MasterInit is called. - * - * param base pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterDeinit(FLEXIO_I2C_Type *base) -{ - base->flexioBase->SHIFTCFG[base->shifterIndex[0]] = 0; - base->flexioBase->SHIFTCTL[base->shifterIndex[0]] = 0; - base->flexioBase->SHIFTCFG[base->shifterIndex[1]] = 0; - base->flexioBase->SHIFTCTL[base->shifterIndex[1]] = 0; - base->flexioBase->TIMCFG[base->timerIndex[0]] = 0; - base->flexioBase->TIMCMP[base->timerIndex[0]] = 0; - base->flexioBase->TIMCTL[base->timerIndex[0]] = 0; - base->flexioBase->TIMCFG[base->timerIndex[1]] = 0; - base->flexioBase->TIMCMP[base->timerIndex[1]] = 0; - base->flexioBase->TIMCTL[base->timerIndex[1]] = 0; - base->flexioBase->TIMCFG[base->timerIndex[2]] = 0; - base->flexioBase->TIMCMP[base->timerIndex[2]] = 0; - base->flexioBase->TIMCTL[base->timerIndex[2]] = 0; - /* Clear the shifter flag. */ - base->flexioBase->SHIFTSTAT = (1UL << base->shifterIndex[0]); - base->flexioBase->SHIFTSTAT = (1UL << base->shifterIndex[1]); - /* Clear the timer flag. */ - base->flexioBase->TIMSTAT = (1UL << base->timerIndex[0]); - base->flexioBase->TIMSTAT = (1UL << base->timerIndex[1]); - base->flexioBase->TIMSTAT = (1UL << base->timerIndex[2]); -} - -/*! - * brief Gets the default configuration to configure the FlexIO module. The configuration - * can be used directly for calling the FLEXIO_I2C_MasterInit(). - * - * Example: - code - flexio_i2c_master_config_t config; - FLEXIO_I2C_MasterGetDefaultConfig(&config); - endcode - * param masterConfig Pointer to flexio_i2c_master_config_t structure. -*/ -void FLEXIO_I2C_MasterGetDefaultConfig(flexio_i2c_master_config_t *masterConfig) -{ - assert(masterConfig != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(masterConfig, 0, sizeof(*masterConfig)); - - masterConfig->enableMaster = true; - masterConfig->enableInDoze = false; - masterConfig->enableInDebug = true; - masterConfig->enableFastAccess = false; - - /* Default baud rate at 100kbps. */ - masterConfig->baudRate_Bps = 100000U; -} - -/*! - * brief Gets the FlexIO I2C master status flags. - * - * param base Pointer to FLEXIO_I2C_Type structure - * return Status flag, use status flag to AND #_flexio_i2c_master_status_flags can get the related status. - */ - -uint32_t FLEXIO_I2C_MasterGetStatusFlags(FLEXIO_I2C_Type *base) -{ - uint32_t status = 0; - - status = - ((FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0])) >> base->shifterIndex[0]); - status |= - (((FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[1])) >> (base->shifterIndex[1])) - << 1U); - status |= - (((FLEXIO_GetShifterErrorFlags(base->flexioBase) & (1UL << base->shifterIndex[1])) >> (base->shifterIndex[1])) - << 2U); - - return status; -} - -/*! - * brief Clears the FlexIO I2C master status flags. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param mask Status flag. - * The parameter can be any combination of the following values: - * arg kFLEXIO_I2C_RxFullFlag - * arg kFLEXIO_I2C_ReceiveNakFlag - */ - -void FLEXIO_I2C_MasterClearStatusFlags(FLEXIO_I2C_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_I2C_TxEmptyFlag) != 0U) - { - FLEXIO_ClearShifterStatusFlags(base->flexioBase, 1UL << base->shifterIndex[0]); - } - - if ((mask & (uint32_t)kFLEXIO_I2C_RxFullFlag) != 0U) - { - FLEXIO_ClearShifterStatusFlags(base->flexioBase, 1UL << base->shifterIndex[1]); - } - - if ((mask & (uint32_t)kFLEXIO_I2C_ReceiveNakFlag) != 0U) - { - FLEXIO_ClearShifterErrorFlags(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Enables the FlexIO i2c master interrupt requests. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param mask Interrupt source. - * Currently only one interrupt request source: - * arg kFLEXIO_I2C_TransferCompleteInterruptEnable - */ -void FLEXIO_I2C_MasterEnableInterrupts(FLEXIO_I2C_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_I2C_TxEmptyInterruptEnable) != 0U) - { - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_I2C_RxFullInterruptEnable) != 0U) - { - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Disables the FlexIO I2C master interrupt requests. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param mask Interrupt source. - */ -void FLEXIO_I2C_MasterDisableInterrupts(FLEXIO_I2C_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_I2C_TxEmptyInterruptEnable) != 0U) - { - FLEXIO_DisableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_I2C_RxFullInterruptEnable) != 0U) - { - FLEXIO_DisableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Sets the FlexIO I2C master transfer baudrate. - * - * param base Pointer to FLEXIO_I2C_Type structure - * param baudRate_Bps the baud rate value in HZ - * param srcClock_Hz source clock in HZ - */ -void FLEXIO_I2C_MasterSetBaudRate(FLEXIO_I2C_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz) -{ - uint16_t timerDiv = 0; - FLEXIO_Type *flexioBase = base->flexioBase; - - /* Set TIMCMP = (baud rate divider / 2) - 1.*/ - timerDiv = (uint16_t)((srcClock_Hz / baudRate_Bps) / 2U - 1U); - - flexioBase->TIMCMP[base->timerIndex[1]] = timerDiv; - - /* Calculate and assign the actual baudrate. */ - base->baudrate = srcClock_Hz / (2U * ((uint32_t)timerDiv + 1U)); -} - -/*! - * brief Sets the number of bytes to be transferred from a start signal to a stop signal. - * - * note Call this API before a transfer begins because the timer generates a number of clocks according - * to the number of bytes that need to be transferred. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param count Number of bytes need to be transferred from a start signal to a re-start/stop signal - * retval kStatus_Success Successfully configured the count. - * retval kStatus_InvalidArgument Input argument is invalid. - */ -status_t FLEXIO_I2C_MasterSetTransferCount(FLEXIO_I2C_Type *base, uint16_t count) -{ - /* Calculate whether the transfer count is larger than the max value compare register can achieve */ - if (count > ((0xFFFFUL - 1UL) / (16UL + 1UL + 1UL))) - { - return kStatus_InvalidArgument; - } - - uint32_t timerConfig = 0U; - FLEXIO_Type *flexioBase = base->flexioBase; - - flexioBase->TIMCMP[base->timerIndex[0]] = (uint32_t)count * 18U + 1U; - timerConfig = flexioBase->TIMCFG[base->timerIndex[0]]; - timerConfig &= ~FLEXIO_TIMCFG_TIMDIS_MASK; - timerConfig |= FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTimerCompare); - flexioBase->TIMCFG[base->timerIndex[0]] = timerConfig; - - return kStatus_Success; -} - -/*! - * brief Sends START + 7-bit address to the bus. - * - * note This API should be called when the transfer configuration is ready to send a START signal - * and 7-bit address to the bus. This is a non-blocking API, which returns directly after the address - * is put into the data register but the address transfer is not finished on the bus. Ensure that - * the kFLEXIO_I2C_RxFullFlag status is asserted before calling this API. - * param base Pointer to FLEXIO_I2C_Type structure. - * param address 7-bit address. - * param direction transfer direction. - * This parameter is one of the values in flexio_i2c_direction_t: - * arg kFLEXIO_I2C_Write: Transmit - * arg kFLEXIO_I2C_Read: Receive - */ - -void FLEXIO_I2C_MasterStart(FLEXIO_I2C_Type *base, uint8_t address, flexio_i2c_direction_t direction) -{ - uint32_t data; - - data = ((uint32_t)address) << 1U | ((direction == kFLEXIO_I2C_Read) ? 1U : 0U); - - FLEXIO_I2C_MasterWriteByte(base, data); -} - -/*! - * brief Sends the repeated start signal on the bus. - * - * param base Pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterRepeatedStart(FLEXIO_I2C_Type *base) -{ - /* Prepare for RESTART condition, no stop.*/ - FLEXIO_I2C_MasterWriteByte(base, 0xFFFFFFFFU); -} - -/*! - * brief Sends the stop signal on the bus. - * - * param base Pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterStop(FLEXIO_I2C_Type *base) -{ - /* Prepare normal stop. */ - (void)FLEXIO_I2C_MasterSetTransferCount(base, 0x0U); - FLEXIO_I2C_MasterWriteByte(base, 0x0U); -} - -/*! - * brief Sends the stop signal when transfer is still on-going. - * - * param base Pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterAbortStop(FLEXIO_I2C_Type *base) -{ - uint32_t tmpConfig; - - /* Prepare abort stop. */ - /* Disable timer 0. */ - tmpConfig = base->flexioBase->TIMCFG[base->timerIndex[0]]; - tmpConfig &= ~FLEXIO_TIMCFG_TIMDIS_MASK; - tmpConfig |= FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnPinBothEdge); - base->flexioBase->TIMCFG[base->timerIndex[0]] = tmpConfig; - - /* Disable timer 1. */ - tmpConfig = base->flexioBase->TIMCFG[base->timerIndex[1]]; - tmpConfig &= ~FLEXIO_TIMCFG_TIMDIS_MASK; - tmpConfig |= FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnPinBothEdge); - base->flexioBase->TIMCFG[base->timerIndex[1]] = tmpConfig; -} - -/*! - * brief Configures the sent ACK/NAK for the following byte. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param enable True to configure send ACK, false configure to send NAK. - */ -void FLEXIO_I2C_MasterEnableAck(FLEXIO_I2C_Type *base, bool enable) -{ - uint32_t tmpConfig = 0; - - tmpConfig = base->flexioBase->SHIFTCFG[base->shifterIndex[0]]; - tmpConfig &= ~FLEXIO_SHIFTCFG_SSTOP_MASK; - if (enable) - { - tmpConfig |= FLEXIO_SHIFTCFG_SSTOP(kFLEXIO_ShifterStopBitLow); - } - else - { - tmpConfig |= FLEXIO_SHIFTCFG_SSTOP(kFLEXIO_ShifterStopBitHigh); - } - base->flexioBase->SHIFTCFG[base->shifterIndex[0]] = tmpConfig; -} - -/*! - * brief Sends a buffer of data in bytes. - * - * note This function blocks via polling until all bytes have been sent. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param txBuff The data bytes to send. - * param txSize The number of data bytes to send. - * retval kStatus_Success Successfully write data. - * retval kStatus_FLEXIO_I2C_Nak Receive NAK during writing data. - * retval kStatus_FLEXIO_I2C_Timeout Timeout polling status flags. - */ -status_t FLEXIO_I2C_MasterWriteBlocking(FLEXIO_I2C_Type *base, const uint8_t *txBuff, uint8_t txSize) -{ - assert(txBuff != NULL); - assert(txSize != 0U); - - uint32_t status; -#if I2C_RETRY_TIMES - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - - while (0U != txSize--) - { - FLEXIO_I2C_MasterWriteByte(base, *txBuff++); - - /* Wait until data transfer complete. */ -#if I2C_RETRY_TIMES - waitTimes = I2C_RETRY_TIMES; - while ((0U == ((status = FLEXIO_I2C_MasterGetStatusFlags(base)) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return kStatus_FLEXIO_I2C_Timeout; - } -#else - while (0U == ((status = FLEXIO_I2C_MasterGetStatusFlags(base)) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) - { - } -#endif - - if ((status & (uint32_t)kFLEXIO_I2C_ReceiveNakFlag) != 0U) - { - FLEXIO_ClearShifterErrorFlags(base->flexioBase, 1UL << base->shifterIndex[1]); - return kStatus_FLEXIO_I2C_Nak; - } - } - return kStatus_Success; -} - -/*! - * brief Receives a buffer of bytes. - * - * note This function blocks via polling until all bytes have been received. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param rxBuff The buffer to store the received bytes. - * param rxSize The number of data bytes to be received. - * retval kStatus_Success Successfully read data. - * retval kStatus_FLEXIO_I2C_Timeout Timeout polling status flags. - */ -status_t FLEXIO_I2C_MasterReadBlocking(FLEXIO_I2C_Type *base, uint8_t *rxBuff, uint8_t rxSize) -{ - assert(rxBuff != NULL); - assert(rxSize != 0U); - -#if I2C_RETRY_TIMES - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - - while (0U != rxSize--) - { - /* Wait until data transfer complete. */ -#if I2C_RETRY_TIMES - waitTimes = I2C_RETRY_TIMES; - while ((0U == (FLEXIO_I2C_MasterGetStatusFlags(base) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return kStatus_FLEXIO_I2C_Timeout; - } -#else - while (0U == (FLEXIO_I2C_MasterGetStatusFlags(base) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) - { - } -#endif - *rxBuff++ = FLEXIO_I2C_MasterReadByte(base); - } - return kStatus_Success; -} - -/*! - * brief Performs a master polling transfer on the I2C bus. - * - * note The API does not return until the transfer succeeds or fails due - * to receiving NAK. - * - * param base pointer to FLEXIO_I2C_Type structure. - * param xfer pointer to flexio_i2c_master_transfer_t structure. - * return status of status_t. - */ -status_t FLEXIO_I2C_MasterTransferBlocking(FLEXIO_I2C_Type *base, flexio_i2c_master_transfer_t *xfer) -{ - assert(xfer != NULL); - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_STATUS) && FSL_FEATURE_FLEXIO_HAS_PIN_STATUS - /* Return an error if the bus is already in use not by us.*/ - status_t status = FLEXIO_I2C_CheckForBusyBus(base); - if (status != kStatus_Success) - { - return status; - } -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_STATUS*/ - - flexio_i2c_master_handle_t tmpHandle; - uint32_t statusFlags; - status_t result = kStatus_Success; -#if I2C_RETRY_TIMES - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - - /* Zero the handle. */ - (void)memset(&tmpHandle, 0, sizeof(tmpHandle)); - - /* Set up transfer machine. */ - result = FLEXIO_I2C_MasterTransferInitStateMachine(base, &tmpHandle, xfer); - if (result != kStatus_Success) - { - return result; - } - - do - { - /* Wait either tx empty or rx full flag is asserted. */ -#if I2C_RETRY_TIMES - waitTimes = I2C_RETRY_TIMES; - while ((0U == ((statusFlags = FLEXIO_I2C_MasterGetStatusFlags(base)) & - ((uint32_t)kFLEXIO_I2C_TxEmptyFlag | (uint32_t)kFLEXIO_I2C_RxFullFlag))) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return kStatus_FLEXIO_I2C_Timeout; - } -#else - while (0U == ((statusFlags = FLEXIO_I2C_MasterGetStatusFlags(base)) & - ((uint32_t)kFLEXIO_I2C_TxEmptyFlag | (uint32_t)kFLEXIO_I2C_RxFullFlag))) - { - } -#endif - FLEXIO_ClearTimerStatusFlags(base->flexioBase, ((1UL << base->timerIndex[0]) | (1UL << base->timerIndex[1]))); - result = FLEXIO_I2C_MasterTransferRunStateMachine(base, &tmpHandle, statusFlags); - - } while ((tmpHandle.state != (uint8_t)kFLEXIO_I2C_Idle) && (result == kStatus_Success)); - - /* Timer disable on timer compare, wait until bit clock TSF set, which means timer disable and stop has been sent. - */ - while (0U == (FLEXIO_GetTimerStatusFlags(base->flexioBase) & (1UL << base->timerIndex[1]))) - { - } - - return result; -} - -/*! - * brief Initializes the I2C handle which is used in transactional functions. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param handle Pointer to flexio_i2c_master_handle_t structure to store the transfer state. - * param callback Pointer to user callback function. - * param userData User param passed to the callback function. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO type/handle/isr table out of range. - */ -status_t FLEXIO_I2C_MasterTransferCreateHandle(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - flexio_i2c_master_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - IRQn_Type flexio_irqs[] = FLEXIO_IRQS; - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Register callback and userData. */ - handle->completionCallback = callback; - handle->userData = userData; - - /* Clear pending NVIC IRQ before enable NVIC IRQ. */ - NVIC_ClearPendingIRQ(flexio_irqs[FLEXIO_I2C_GetInstance(base)]); - (void)EnableIRQ(flexio_irqs[FLEXIO_I2C_GetInstance(base)]); - - /* Save the context in global variables to support the double weak mechanism. */ - return FLEXIO_RegisterHandleIRQ(base, handle, FLEXIO_I2C_MasterTransferHandleIRQ); -} - -/*! - * brief Performs a master interrupt non-blocking transfer on the I2C bus. - * - * note The API returns immediately after the transfer initiates. - * Call FLEXIO_I2C_MasterTransferGetCount to poll the transfer status to check whether - * the transfer is finished. If the return status is not kStatus_FLEXIO_I2C_Busy, the transfer - * is finished. - * - * param base Pointer to FLEXIO_I2C_Type structure - * param handle Pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * param xfer pointer to flexio_i2c_master_transfer_t structure - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_FLEXIO_I2C_Busy FlexIO I2C is not idle, is running another transfer. - */ -status_t FLEXIO_I2C_MasterTransferNonBlocking(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - flexio_i2c_master_transfer_t *xfer) -{ - assert(handle != NULL); - assert(xfer != NULL); - - status_t result = kStatus_Success; - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_STATUS) && FSL_FEATURE_FLEXIO_HAS_PIN_STATUS - /* Return an error if the bus is already in use not by us.*/ - result = FLEXIO_I2C_CheckForBusyBus(base); - if (result != kStatus_Success) - { - return result; - } -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_STATUS*/ - - if (handle->state != (uint8_t)kFLEXIO_I2C_Idle) - { - return kStatus_FLEXIO_I2C_Busy; - } - else - { - /* Set up transfer machine. */ - result = FLEXIO_I2C_MasterTransferInitStateMachine(base, handle, xfer); - if (result != kStatus_Success) - { - return result; - } - - /* Enable both tx empty and rxfull interrupt. */ - FLEXIO_I2C_MasterEnableInterrupts( - base, (uint32_t)kFLEXIO_I2C_TxEmptyInterruptEnable | (uint32_t)kFLEXIO_I2C_RxFullInterruptEnable); - - return kStatus_Success; - } -} - -/*! - * brief Aborts an interrupt non-blocking transfer early. - * - * note This API can be called at any time when an interrupt non-blocking transfer initiates - * to abort the transfer early. - * - * param base Pointer to FLEXIO_I2C_Type structure - * param handle Pointer to flexio_i2c_master_handle_t structure which stores the transfer state - */ -void FLEXIO_I2C_MasterTransferAbort(FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable interrupts. */ - FLEXIO_I2C_MasterDisableInterrupts( - base, (uint32_t)kFLEXIO_I2C_TxEmptyInterruptEnable | (uint32_t)kFLEXIO_I2C_RxFullInterruptEnable); - - /* Reset to idle state. */ - handle->state = (uint8_t)kFLEXIO_I2C_Idle; -} - -/*! - * brief Gets the master transfer status during a interrupt non-blocking transfer. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param handle Pointer to flexio_i2c_master_handle_t structure which stores the transfer state. - * param count Number of bytes transferred so far by the non-blocking transaction. - * retval kStatus_InvalidArgument count is Invalid. - * retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - * retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_I2C_MasterTransferGetCount(FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle, size_t *count) -{ - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (handle->state == (uint8_t)kFLEXIO_I2C_Idle) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - *count = handle->transferSize - handle->transfer.dataSize; - - return kStatus_Success; -} - -/*! - * brief Master interrupt handler. - * - * param i2cType Pointer to FLEXIO_I2C_Type structure - * param i2cHandle Pointer to flexio_i2c_master_transfer_t structure - */ -void FLEXIO_I2C_MasterTransferHandleIRQ(void *i2cType, void *i2cHandle) -{ - FLEXIO_I2C_Type *base = (FLEXIO_I2C_Type *)i2cType; - flexio_i2c_master_handle_t *handle = (flexio_i2c_master_handle_t *)i2cHandle; - uint32_t statusFlags; - status_t result; - - statusFlags = FLEXIO_I2C_MasterGetStatusFlags(base); - - result = FLEXIO_I2C_MasterTransferRunStateMachine(base, handle, statusFlags); - - if (handle->state == (uint8_t)kFLEXIO_I2C_Idle) - { - FLEXIO_I2C_MasterTransferComplete(base, handle, result); - } -} diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_i2c_master.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_i2c_master.h deleted file mode 100644 index 6b33abe22ca..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_i2c_master.h +++ /dev/null @@ -1,485 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_FLEXIO_I2C_MASTER_H_ -#define FSL_FLEXIO_I2C_MASTER_H_ - -#include "fsl_common.h" -#include "fsl_flexio.h" - -/*! - * @addtogroup flexio_i2c_master - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -#define FSL_FLEXIO_I2C_MASTER_DRIVER_VERSION (MAKE_VERSION(2, 5, 0)) -/*! @} */ - -/*! @brief Retry times for waiting flag. */ -#ifndef I2C_RETRY_TIMES -#define I2C_RETRY_TIMES 0U /* Define to zero means keep waiting until the flag is assert/deassert. */ -#endif - -/*! @brief FlexIO I2C transfer status*/ -enum -{ - kStatus_FLEXIO_I2C_Busy = MAKE_STATUS(kStatusGroup_FLEXIO_I2C, 0), /*!< I2C is busy doing transfer. */ - kStatus_FLEXIO_I2C_Idle = MAKE_STATUS(kStatusGroup_FLEXIO_I2C, 1), /*!< I2C is busy doing transfer. */ - kStatus_FLEXIO_I2C_Nak = MAKE_STATUS(kStatusGroup_FLEXIO_I2C, 2), /*!< NAK received during transfer. */ - kStatus_FLEXIO_I2C_Timeout = MAKE_STATUS(kStatusGroup_FLEXIO_I2C, 3), /*!< Timeout polling status flags. */ -}; - -/*! @brief Define FlexIO I2C master interrupt mask. */ -enum _flexio_i2c_master_interrupt -{ - kFLEXIO_I2C_TxEmptyInterruptEnable = 0x1U, /*!< Tx buffer empty interrupt enable. */ - kFLEXIO_I2C_RxFullInterruptEnable = 0x2U, /*!< Rx buffer full interrupt enable. */ -}; - -/*! @brief Define FlexIO I2C master status mask. */ -enum _flexio_i2c_master_status_flags -{ - kFLEXIO_I2C_TxEmptyFlag = 0x1U, /*!< Tx shifter empty flag. */ - kFLEXIO_I2C_RxFullFlag = 0x2U, /*!< Rx shifter full/Transfer complete flag. */ - kFLEXIO_I2C_ReceiveNakFlag = 0x4U, /*!< Receive NAK flag. */ -}; - -/*! @brief Direction of master transfer.*/ -typedef enum _flexio_i2c_direction -{ - kFLEXIO_I2C_Write = 0x0U, /*!< Master send to slave. */ - kFLEXIO_I2C_Read = 0x1U, /*!< Master receive from slave. */ -} flexio_i2c_direction_t; - -/*! @brief Define FlexIO I2C master access structure typedef. */ -typedef struct _flexio_i2c_type -{ - FLEXIO_Type *flexioBase; /*!< FlexIO base pointer. */ - uint8_t SDAPinIndex; /*!< Pin select for I2C SDA. */ - uint8_t SCLPinIndex; /*!< Pin select for I2C SCL. */ - uint8_t shifterIndex[2]; /*!< Shifter index used in FlexIO I2C. */ - uint8_t timerIndex[3]; /*!< Timer index used in FlexIO I2C. */ - uint32_t baudrate; /*!< Master transfer baudrate, used to calculate delay time. */ -} FLEXIO_I2C_Type; - -/*! @brief Define FlexIO I2C master user configuration structure. */ -typedef struct _flexio_i2c_master_config -{ - bool enableMaster; /*!< Enables the FlexIO I2C peripheral at initialization time. */ - bool enableInDoze; /*!< Enable/disable FlexIO operation in doze mode. */ - bool enableInDebug; /*!< Enable/disable FlexIO operation in debug mode. */ - bool enableFastAccess; /*!< Enable/disable fast access to FlexIO registers, fast access requires - the FlexIO clock to be at least twice the frequency of the bus clock. */ - uint32_t baudRate_Bps; /*!< Baud rate in Bps. */ -} flexio_i2c_master_config_t; - -/*! @brief Define FlexIO I2C master transfer structure. */ -typedef struct _flexio_i2c_master_transfer -{ - uint32_t flags; /*!< Transfer flag which controls the transfer, reserved for FlexIO I2C. */ - uint8_t slaveAddress; /*!< 7-bit slave address. */ - flexio_i2c_direction_t direction; /*!< Transfer direction, read or write. */ - uint32_t subaddress; /*!< Sub address. Transferred MSB first. */ - uint8_t subaddressSize; /*!< Size of command buffer. */ - uint8_t volatile *data; /*!< Transfer buffer. */ - volatile size_t dataSize; /*!< Transfer size. */ -} flexio_i2c_master_transfer_t; - -/*! @brief FlexIO I2C master handle typedef. */ -typedef struct _flexio_i2c_master_handle flexio_i2c_master_handle_t; - -/*! @brief FlexIO I2C master transfer callback typedef. */ -typedef void (*flexio_i2c_master_transfer_callback_t)(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - status_t status, - void *userData); - -/*! @brief Define FlexIO I2C master handle structure. */ -struct _flexio_i2c_master_handle -{ - flexio_i2c_master_transfer_t transfer; /*!< FlexIO I2C master transfer copy. */ - size_t transferSize; /*!< Total bytes to be transferred. */ - uint8_t state; /*!< Transfer state maintained during transfer. */ - flexio_i2c_master_transfer_callback_t completionCallback; /*!< Callback function called at transfer event. */ - /*!< Callback function called at transfer event. */ - void *userData; /*!< Callback parameter passed to callback function. */ - bool needRestart; /*!< Whether master needs to send re-start signal. */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus*/ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_STATUS) && FSL_FEATURE_FLEXIO_HAS_PIN_STATUS -/*! - * @brief Make sure the bus isn't already pulled down. - * - * Check the FLEXIO pin status to see whether either of SDA and SCL pin is pulled down. - * - * @param base Pointer to FLEXIO_I2C_Type structure.. - * @retval kStatus_Success - * @retval kStatus_FLEXIO_I2C_Busy - */ -status_t FLEXIO_I2C_CheckForBusyBus(FLEXIO_I2C_Type *base); -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_STATUS*/ - -/*! - * @brief Ungates the FlexIO clock, resets the FlexIO module, and configures the FlexIO I2C - * hardware configuration. - * - * Example - @code - FLEXIO_I2C_Type base = { - .flexioBase = FLEXIO, - .SDAPinIndex = 0, - .SCLPinIndex = 1, - .shifterIndex = {0,1}, - .timerIndex = {0,1} - }; - flexio_i2c_master_config_t config = { - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .baudRate_Bps = 100000 - }; - FLEXIO_I2C_MasterInit(base, &config, srcClock_Hz); - @endcode - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param masterConfig Pointer to flexio_i2c_master_config_t structure. - * @param srcClock_Hz FlexIO source clock in Hz. - * @retval kStatus_Success Initialization successful - * @retval kStatus_InvalidArgument The source clock exceed upper range limitation -*/ -status_t FLEXIO_I2C_MasterInit(FLEXIO_I2C_Type *base, flexio_i2c_master_config_t *masterConfig, uint32_t srcClock_Hz); - -/*! - * @brief De-initializes the FlexIO I2C master peripheral. Calling this API Resets the FlexIO I2C master - * shifer and timer config, module can't work unless the FLEXIO_I2C_MasterInit is called. - * - * @param base pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterDeinit(FLEXIO_I2C_Type *base); - -/*! - * @brief Gets the default configuration to configure the FlexIO module. The configuration - * can be used directly for calling the FLEXIO_I2C_MasterInit(). - * - * Example: - @code - flexio_i2c_master_config_t config; - FLEXIO_I2C_MasterGetDefaultConfig(&config); - @endcode - * @param masterConfig Pointer to flexio_i2c_master_config_t structure. -*/ -void FLEXIO_I2C_MasterGetDefaultConfig(flexio_i2c_master_config_t *masterConfig); - -/*! - * @brief Enables/disables the FlexIO module operation. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param enable Pass true to enable module, false does not have any effect. - */ -static inline void FLEXIO_I2C_MasterEnable(FLEXIO_I2C_Type *base, bool enable) -{ - if (enable) - { - base->flexioBase->CTRL |= FLEXIO_CTRL_FLEXEN_MASK; - } -} - -/*! @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets the FlexIO I2C master status flags. - * - * @param base Pointer to FLEXIO_I2C_Type structure - * @return Status flag, use status flag to AND #_flexio_i2c_master_status_flags can get the related status. - */ - -uint32_t FLEXIO_I2C_MasterGetStatusFlags(FLEXIO_I2C_Type *base); - -/*! - * @brief Clears the FlexIO I2C master status flags. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param mask Status flag. - * The parameter can be any combination of the following values: - * @arg kFLEXIO_I2C_RxFullFlag - * @arg kFLEXIO_I2C_ReceiveNakFlag - */ - -void FLEXIO_I2C_MasterClearStatusFlags(FLEXIO_I2C_Type *base, uint32_t mask); - -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables the FlexIO i2c master interrupt requests. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param mask Interrupt source. - * Currently only one interrupt request source: - * @arg kFLEXIO_I2C_TransferCompleteInterruptEnable - */ -void FLEXIO_I2C_MasterEnableInterrupts(FLEXIO_I2C_Type *base, uint32_t mask); - -/*! - * @brief Disables the FlexIO I2C master interrupt requests. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param mask Interrupt source. - */ -void FLEXIO_I2C_MasterDisableInterrupts(FLEXIO_I2C_Type *base, uint32_t mask); - -/*! @} */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Sets the FlexIO I2C master transfer baudrate. - * - * @param base Pointer to FLEXIO_I2C_Type structure - * @param baudRate_Bps the baud rate value in HZ - * @param srcClock_Hz source clock in HZ - */ -void FLEXIO_I2C_MasterSetBaudRate(FLEXIO_I2C_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz); - -/*! - * @brief Sends START + 7-bit address to the bus. - * - * @note This API should be called when the transfer configuration is ready to send a START signal - * and 7-bit address to the bus. This is a non-blocking API, which returns directly after the address - * is put into the data register but the address transfer is not finished on the bus. Ensure that - * the kFLEXIO_I2C_RxFullFlag status is asserted before calling this API. - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param address 7-bit address. - * @param direction transfer direction. - * This parameter is one of the values in flexio_i2c_direction_t: - * @arg kFLEXIO_I2C_Write: Transmit - * @arg kFLEXIO_I2C_Read: Receive - */ - -void FLEXIO_I2C_MasterStart(FLEXIO_I2C_Type *base, uint8_t address, flexio_i2c_direction_t direction); - -/*! - * @brief Sends the stop signal on the bus. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterStop(FLEXIO_I2C_Type *base); - -/*! - * @brief Sends the repeated start signal on the bus. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterRepeatedStart(FLEXIO_I2C_Type *base); - -/*! - * @brief Sends the stop signal when transfer is still on-going. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterAbortStop(FLEXIO_I2C_Type *base); - -/*! - * @brief Configures the sent ACK/NAK for the following byte. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param enable True to configure send ACK, false configure to send NAK. - */ -void FLEXIO_I2C_MasterEnableAck(FLEXIO_I2C_Type *base, bool enable); - -/*! - * @brief Sets the number of bytes to be transferred from a start signal to a stop signal. - * - * @note Call this API before a transfer begins because the timer generates a number of clocks according - * to the number of bytes that need to be transferred. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param count Number of bytes need to be transferred from a start signal to a re-start/stop signal - * @retval kStatus_Success Successfully configured the count. - * @retval kStatus_InvalidArgument Input argument is invalid. - */ -status_t FLEXIO_I2C_MasterSetTransferCount(FLEXIO_I2C_Type *base, uint16_t count); - -/*! - * @brief Writes one byte of data to the I2C bus. - * - * @note This is a non-blocking API, which returns directly after the data is put into the - * data register but the data transfer is not finished on the bus. Ensure that - * the TxEmptyFlag is asserted before calling this API. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param data a byte of data. - */ -static inline void FLEXIO_I2C_MasterWriteByte(FLEXIO_I2C_Type *base, uint32_t data) -{ - base->flexioBase->SHIFTBUFBBS[base->shifterIndex[0]] = data; -} - -/*! - * @brief Reads one byte of data from the I2C bus. - * - * @note This is a non-blocking API, which returns directly after the data is read from the - * data register. Ensure that the data is ready in the register. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @return data byte read. - */ -static inline uint8_t FLEXIO_I2C_MasterReadByte(FLEXIO_I2C_Type *base) -{ - return (uint8_t)(base->flexioBase->SHIFTBUFBIS[base->shifterIndex[1]]); -} - -/*! - * @brief Sends a buffer of data in bytes. - * - * @note This function blocks via polling until all bytes have been sent. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param txBuff The data bytes to send. - * @param txSize The number of data bytes to send. - * @retval kStatus_Success Successfully write data. - * @retval kStatus_FLEXIO_I2C_Nak Receive NAK during writing data. - * @retval kStatus_FLEXIO_I2C_Timeout Timeout polling status flags. - */ -status_t FLEXIO_I2C_MasterWriteBlocking(FLEXIO_I2C_Type *base, const uint8_t *txBuff, uint8_t txSize); - -/*! - * @brief Receives a buffer of bytes. - * - * @note This function blocks via polling until all bytes have been received. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param rxBuff The buffer to store the received bytes. - * @param rxSize The number of data bytes to be received. - * @retval kStatus_Success Successfully read data. - * @retval kStatus_FLEXIO_I2C_Timeout Timeout polling status flags. - */ -status_t FLEXIO_I2C_MasterReadBlocking(FLEXIO_I2C_Type *base, uint8_t *rxBuff, uint8_t rxSize); - -/*! - * @brief Performs a master polling transfer on the I2C bus. - * - * @note The API does not return until the transfer succeeds or fails due - * to receiving NAK. - * - * @param base pointer to FLEXIO_I2C_Type structure. - * @param xfer pointer to flexio_i2c_master_transfer_t structure. - * @return status of status_t. - */ -status_t FLEXIO_I2C_MasterTransferBlocking(FLEXIO_I2C_Type *base, flexio_i2c_master_transfer_t *xfer); -/*! @} */ - -/*Transactional APIs*/ - -/*! - * @name Transactional - * @{ - */ - -/*! - * @brief Initializes the I2C handle which is used in transactional functions. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param handle Pointer to flexio_i2c_master_handle_t structure to store the transfer state. - * @param callback Pointer to user callback function. - * @param userData User param passed to the callback function. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO type/handle/isr table out of range. - */ -status_t FLEXIO_I2C_MasterTransferCreateHandle(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - flexio_i2c_master_transfer_callback_t callback, - void *userData); - -/*! - * @brief Performs a master interrupt non-blocking transfer on the I2C bus. - * - * @note The API returns immediately after the transfer initiates. - * Call FLEXIO_I2C_MasterTransferGetCount to poll the transfer status to check whether - * the transfer is finished. If the return status is not kStatus_FLEXIO_I2C_Busy, the transfer - * is finished. - * - * @param base Pointer to FLEXIO_I2C_Type structure - * @param handle Pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param xfer pointer to flexio_i2c_master_transfer_t structure - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_FLEXIO_I2C_Busy FlexIO I2C is not idle, is running another transfer. - */ -status_t FLEXIO_I2C_MasterTransferNonBlocking(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - flexio_i2c_master_transfer_t *xfer); - -/*! - * @brief Gets the master transfer status during a interrupt non-blocking transfer. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param handle Pointer to flexio_i2c_master_handle_t structure which stores the transfer state. - * @param count Number of bytes transferred so far by the non-blocking transaction. - * @retval kStatus_InvalidArgument count is Invalid. - * @retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - * @retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_I2C_MasterTransferGetCount(FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle, size_t *count); - -/*! - * @brief Aborts an interrupt non-blocking transfer early. - * - * @note This API can be called at any time when an interrupt non-blocking transfer initiates - * to abort the transfer early. - * - * @param base Pointer to FLEXIO_I2C_Type structure - * @param handle Pointer to flexio_i2c_master_handle_t structure which stores the transfer state - */ -void FLEXIO_I2C_MasterTransferAbort(FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle); - -/*! - * @brief Master interrupt handler. - * - * @param i2cType Pointer to FLEXIO_I2C_Type structure - * @param i2cHandle Pointer to flexio_i2c_master_transfer_t structure - */ -void FLEXIO_I2C_MasterTransferHandleIRQ(void *i2cType, void *i2cHandle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /*_cplusplus*/ -/*! @} */ - -#endif /*FSL_FLEXIO_I2C_MASTER_H_*/ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_i2s.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_i2s.c deleted file mode 100644 index 087e0d691d8..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_i2s.c +++ /dev/null @@ -1,903 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2019 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio_i2s.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio_i2s" -#endif - -/******************************************************************************* - * Definitations - ******************************************************************************/ -/*!@brief _sai_transfer_state*/ -enum -{ - kFLEXIO_I2S_Busy = 0x0U, /*!< FLEXIO_I2S is busy */ - kFLEXIO_I2S_Idle, /*!< Transfer is done. */ -}; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Receive a piece of data in non-blocking way. - * - * @param base FLEXIO I2S base pointer - * @param bitWidth How many bits in a audio word, usually 8/16/24/32 bits. - * @param buffer Pointer to the data to be read. - * @param size Bytes to be read. - */ -static void FLEXIO_I2S_ReadNonBlocking(FLEXIO_I2S_Type *base, uint8_t bitWidth, uint8_t *rxData, size_t size); - -/*! - * @brief sends a piece of data in non-blocking way. - * - * @param base FLEXIO I2S base pointer - * @param bitWidth How many bits in a audio word, usually 8/16/24/32 bits. - * @param buffer Pointer to the data to be written. - * @param size Bytes to be written. - */ -static void FLEXIO_I2S_WriteNonBlocking(FLEXIO_I2S_Type *base, uint8_t bitWidth, uint8_t *txData, size_t size); -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -static uint32_t FLEXIO_I2S_GetInstance(FLEXIO_I2S_Type *base) -{ - return FLEXIO_GetInstance(base->flexioBase); -} - -static void FLEXIO_I2S_WriteNonBlocking(FLEXIO_I2S_Type *base, uint8_t bitWidth, uint8_t *txData, size_t size) -{ - uint32_t i = 0; - uint8_t j = 0; - uint8_t bytesPerWord = bitWidth / 8U; - uint32_t data = 0; - uint32_t temp = 0; - - for (i = 0; i < size / bytesPerWord; i++) - { - for (j = 0; j < bytesPerWord; j++) - { - temp = (uint32_t)(*txData); - data |= (temp << (8U * j)); - txData++; - } - base->flexioBase->SHIFTBUFBIS[base->txShifterIndex] = data << (32U - bitWidth); - data = 0; - } -} - -static void FLEXIO_I2S_ReadNonBlocking(FLEXIO_I2S_Type *base, uint8_t bitWidth, uint8_t *rxData, size_t size) -{ - uint32_t i = 0; - uint8_t j = 0; - uint8_t bytesPerWord = bitWidth / 8U; - uint32_t data = 0; - - for (i = 0; i < size / bytesPerWord; i++) - { - data = (base->flexioBase->SHIFTBUFBIS[base->rxShifterIndex]); - for (j = 0; j < bytesPerWord; j++) - { - *rxData = (uint8_t)((data >> (8U * j)) & 0xFFU); - rxData++; - } - } -} - -/*! - * brief Initializes the FlexIO I2S. - * - * This API configures FlexIO pins and shifter to I2S and configures the FlexIO I2S with a configuration structure. - * The configuration structure can be filled by the user, or be set with default values by - * FLEXIO_I2S_GetDefaultConfig(). - * - * note This API should be called at the beginning of the application to use - * the FlexIO I2S driver. Otherwise, any access to the FlexIO I2S module can cause hard fault - * because the clock is not enabled. - * - * param base FlexIO I2S base pointer - * param config FlexIO I2S configure structure. - */ -void FLEXIO_I2S_Init(FLEXIO_I2S_Type *base, const flexio_i2s_config_t *config) -{ - assert((base != NULL) && (config != NULL)); - - flexio_shifter_config_t shifterConfig = {0}; - flexio_timer_config_t timerConfig = {0}; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate flexio clock. */ - CLOCK_EnableClock(s_flexioClocks[FLEXIO_I2S_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* reset Flexio */ - FLEXIO_Reset(base->flexioBase); - - /* Set shifter for I2S Tx data */ - shifterConfig.timerSelect = base->bclkTimerIndex; - shifterConfig.pinSelect = base->txPinIndex; - shifterConfig.timerPolarity = config->txTimerPolarity; - shifterConfig.pinConfig = kFLEXIO_PinConfigOutput; - shifterConfig.pinPolarity = config->txPinPolarity; - shifterConfig.shifterMode = kFLEXIO_ShifterModeTransmit; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitDisable; - if (config->masterSlave == kFLEXIO_I2S_Master) - { - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnShift; - } - else - { - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnEnable; - } - - FLEXIO_SetShifterConfig(base->flexioBase, base->txShifterIndex, &shifterConfig); - - /* Set shifter for I2S Rx Data */ - shifterConfig.timerSelect = base->bclkTimerIndex; - shifterConfig.pinSelect = base->rxPinIndex; - shifterConfig.timerPolarity = config->rxTimerPolarity; - shifterConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - shifterConfig.pinPolarity = config->rxPinPolarity; - shifterConfig.shifterMode = kFLEXIO_ShifterModeReceive; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitDisable; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnEnable; - - FLEXIO_SetShifterConfig(base->flexioBase, base->rxShifterIndex, &shifterConfig); - - /* Set Timer to I2S frame sync */ - if (config->masterSlave == kFLEXIO_I2S_Master) - { - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_PININPUT(base->txPinIndex); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveHigh; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceExternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOutput; - timerConfig.pinSelect = base->fsPinIndex; - timerConfig.pinPolarity = config->fsPinPolarity; - timerConfig.timerMode = kFLEXIO_TimerModeSingle16Bit; - timerConfig.timerOutput = kFLEXIO_TimerOutputOneNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput; - timerConfig.timerReset = kFLEXIO_TimerResetNever; - timerConfig.timerDisable = kFLEXIO_TimerDisableNever; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnPrevTimerEnable; - timerConfig.timerStart = kFLEXIO_TimerStartBitDisabled; - timerConfig.timerStop = kFLEXIO_TimerStopBitDisabled; - } - else - { - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_PININPUT(base->bclkPinIndex); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveHigh; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - timerConfig.pinSelect = base->fsPinIndex; - timerConfig.pinPolarity = config->fsPinPolarity; - timerConfig.timerMode = kFLEXIO_TimerModeSingle16Bit; - timerConfig.timerOutput = kFLEXIO_TimerOutputOneNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnTriggerInputShiftTriggerInput; - timerConfig.timerReset = kFLEXIO_TimerResetNever; - timerConfig.timerDisable = kFLEXIO_TimerDisableOnTimerCompare; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnPinRisingEdge; - timerConfig.timerStart = kFLEXIO_TimerStartBitDisabled; - timerConfig.timerStop = kFLEXIO_TimerStopBitDisabled; - } - FLEXIO_SetTimerConfig(base->flexioBase, base->fsTimerIndex, &timerConfig); - - /* Set Timer to I2S bit clock */ - if (config->masterSlave == kFLEXIO_I2S_Master) - { - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->txShifterIndex); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinSelect = base->bclkPinIndex; - timerConfig.pinConfig = kFLEXIO_PinConfigOutput; - timerConfig.pinPolarity = config->bclkPinPolarity; - timerConfig.timerMode = kFLEXIO_TimerModeDual8BitBaudBit; - timerConfig.timerOutput = kFLEXIO_TimerOutputOneNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput; - timerConfig.timerReset = kFLEXIO_TimerResetNever; - timerConfig.timerDisable = kFLEXIO_TimerDisableNever; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnTriggerHigh; - timerConfig.timerStart = kFLEXIO_TimerStartBitEnabled; - timerConfig.timerStop = kFLEXIO_TimerStopBitDisabled; - } - else - { - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_TIMn(base->fsTimerIndex); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveHigh; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinSelect = base->bclkPinIndex; - timerConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - timerConfig.pinPolarity = config->bclkPinPolarity; - timerConfig.timerMode = kFLEXIO_TimerModeSingle16Bit; - timerConfig.timerOutput = kFLEXIO_TimerOutputOneNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnPinInputShiftPinInput; - timerConfig.timerReset = kFLEXIO_TimerResetNever; - timerConfig.timerDisable = kFLEXIO_TimerDisableOnTimerCompareTriggerLow; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnPinRisingEdgeTriggerHigh; - timerConfig.timerStart = kFLEXIO_TimerStartBitDisabled; - timerConfig.timerStop = kFLEXIO_TimerStopBitDisabled; - } - FLEXIO_SetTimerConfig(base->flexioBase, base->bclkTimerIndex, &timerConfig); - - /* If enable flexio I2S */ - if (config->enableI2S) - { - base->flexioBase->CTRL |= FLEXIO_CTRL_FLEXEN_MASK; - } - else - { - base->flexioBase->CTRL &= ~FLEXIO_CTRL_FLEXEN_MASK; - } -} - -/*! - * brief Sets the FlexIO I2S configuration structure to default values. - * - * The purpose of this API is to get the configuration structure initialized for use in FLEXIO_I2S_Init(). - * Users may use the initialized structure unchanged in FLEXIO_I2S_Init() or modify - * some fields of the structure before calling FLEXIO_I2S_Init(). - * - * param config pointer to master configuration structure - */ -void FLEXIO_I2S_GetDefaultConfig(flexio_i2s_config_t *config) -{ - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->masterSlave = kFLEXIO_I2S_Master; - config->enableI2S = true; - config->txPinPolarity = kFLEXIO_PinActiveHigh; - config->rxPinPolarity = kFLEXIO_PinActiveHigh; - config->bclkPinPolarity = kFLEXIO_PinActiveHigh; - config->fsPinPolarity = kFLEXIO_PinActiveLow; - config->txTimerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive; - config->rxTimerPolarity = kFLEXIO_ShifterTimerPolarityOnNegitive; -} - -/*! - * brief De-initializes the FlexIO I2S. - * - * Calling this API resets the FlexIO I2S shifter and timer config. After calling this API, - * call the FLEXO_I2S_Init to use the FlexIO I2S module. - * - * param base FlexIO I2S base pointer - */ -void FLEXIO_I2S_Deinit(FLEXIO_I2S_Type *base) -{ - base->flexioBase->SHIFTCFG[base->txShifterIndex] = 0; - base->flexioBase->SHIFTCTL[base->txShifterIndex] = 0; - base->flexioBase->SHIFTCFG[base->rxShifterIndex] = 0; - base->flexioBase->SHIFTCTL[base->rxShifterIndex] = 0; - base->flexioBase->TIMCFG[base->fsTimerIndex] = 0; - base->flexioBase->TIMCMP[base->fsTimerIndex] = 0; - base->flexioBase->TIMCTL[base->fsTimerIndex] = 0; - base->flexioBase->TIMCFG[base->bclkTimerIndex] = 0; - base->flexioBase->TIMCMP[base->bclkTimerIndex] = 0; - base->flexioBase->TIMCTL[base->bclkTimerIndex] = 0; -} - -/*! - * brief Enables the FlexIO I2S interrupt. - * - * This function enables the FlexIO UART interrupt. - * - * param base Pointer to FLEXIO_I2S_Type structure - * param mask interrupt source - */ -void FLEXIO_I2S_EnableInterrupts(FLEXIO_I2S_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_I2S_TxDataRegEmptyInterruptEnable) != 0UL) - { - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, 1UL << base->txShifterIndex); - } - if ((mask & (uint32_t)kFLEXIO_I2S_RxDataRegFullInterruptEnable) != 0UL) - { - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, 1UL << base->rxShifterIndex); - } -} - -/*! - * brief Gets the FlexIO I2S status flags. - * - * param base Pointer to FLEXIO_I2S_Type structure - * return Status flag, which are ORed by the enumerators in the _flexio_i2s_status_flags. - */ -uint32_t FLEXIO_I2S_GetStatusFlags(FLEXIO_I2S_Type *base) -{ - uint32_t status = 0; - status = ((FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->txShifterIndex)) >> base->txShifterIndex); - status |= - (((FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->rxShifterIndex)) >> (base->rxShifterIndex)) - << 1U); - return status; -} - -/*! - * brief Disables the FlexIO I2S interrupt. - * - * This function enables the FlexIO UART interrupt. - * - * param base pointer to FLEXIO_I2S_Type structure - * param mask interrupt source - */ -void FLEXIO_I2S_DisableInterrupts(FLEXIO_I2S_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_I2S_TxDataRegEmptyInterruptEnable) != 0UL) - { - FLEXIO_DisableShifterStatusInterrupts(base->flexioBase, 1UL << base->txShifterIndex); - } - if ((mask & (uint32_t)kFLEXIO_I2S_RxDataRegFullInterruptEnable) != 0UL) - { - FLEXIO_DisableShifterStatusInterrupts(base->flexioBase, 1UL << base->rxShifterIndex); - } -} - -/*! - * brief Configures the FlexIO I2S audio format in master mode. - * - * Audio format can be changed in run-time of FlexIO I2S. This function configures the sample rate and audio data - * format to be transferred. - * - * param base Pointer to FLEXIO_I2S_Type structure - * param format Pointer to FlexIO I2S audio data format structure. - * param srcClock_Hz I2S master clock source frequency in Hz. - */ -void FLEXIO_I2S_MasterSetFormat(FLEXIO_I2S_Type *base, flexio_i2s_format_t *format, uint32_t srcClock_Hz) -{ - uint32_t timDiv = srcClock_Hz / (format->sampleRate_Hz * format->bitWidth * 2U); - uint32_t bclkDiv = 0; - - /* Shall keep bclk and fs div an integer */ - if ((timDiv % 2UL) != 0UL) - { - timDiv += 1U; - } - /* Set Frame sync timer cmp */ - base->flexioBase->TIMCMP[base->fsTimerIndex] = FLEXIO_TIMCMP_CMP(format->bitWidth * timDiv - 1U); - - /* Set bit clock timer cmp */ - bclkDiv = ((timDiv / 2U - 1U) | ((format->bitWidth * 2UL - 1UL) << 8U)); - base->flexioBase->TIMCMP[base->bclkTimerIndex] = FLEXIO_TIMCMP_CMP(bclkDiv); -} - -/*! - * brief Configures the FlexIO I2S audio format in slave mode. - * - * Audio format can be changed in run-time of FlexIO I2S. This function configures the sample rate and audio data - * format to be transferred. - * - * param base Pointer to FLEXIO_I2S_Type structure - * param format Pointer to FlexIO I2S audio data format structure. - */ -void FLEXIO_I2S_SlaveSetFormat(FLEXIO_I2S_Type *base, flexio_i2s_format_t *format) -{ - /* Set Frame sync timer cmp */ - base->flexioBase->TIMCMP[base->fsTimerIndex] = FLEXIO_TIMCMP_CMP(format->bitWidth * 4UL - 3UL); - - /* Set bit clock timer cmp */ - base->flexioBase->TIMCMP[base->bclkTimerIndex] = FLEXIO_TIMCMP_CMP(format->bitWidth * 2UL - 1UL); -} - -/*! - * brief Sends data using a blocking method. - * - * note This function blocks via polling until data is ready to be sent. - * - * param base FlexIO I2S base pointer. - * param bitWidth How many bits in a audio word, usually 8/16/24/32 bits. - * param txData Pointer to the data to be written. - * param size Bytes to be written. - * retval kStatus_Success Successfully write data. - * retval kStatus_FLEXIO_I2C_Timeout Timeout polling status flags. - */ -status_t FLEXIO_I2S_WriteBlocking(FLEXIO_I2S_Type *base, uint8_t bitWidth, uint8_t *txData, size_t size) -{ - uint32_t i = 0; - uint8_t bytesPerWord = bitWidth / 8U; -#if I2S_RETRY_TIMES - uint32_t waitTimes = I2S_RETRY_TIMES; -#endif - - for (i = 0; i < size / bytesPerWord; i++) - { - /* Wait until it can write data */ -#if I2S_RETRY_TIMES - waitTimes = I2S_RETRY_TIMES; - while (((FLEXIO_I2S_GetStatusFlags(base) & (uint32_t)kFLEXIO_I2S_TxDataRegEmptyFlag) == 0UL) && - (--waitTimes != 0U)) - { - } - if (waitTimes == 0U) - { - return kStatus_FLEXIO_I2S_Timeout; - } -#else - while ((FLEXIO_I2S_GetStatusFlags(base) & (uint32_t)kFLEXIO_I2S_TxDataRegEmptyFlag) == 0UL) - { - } -#endif - - FLEXIO_I2S_WriteNonBlocking(base, bitWidth, txData, bytesPerWord); - txData = (uint8_t *)((uint32_t)txData + bytesPerWord); - } - - /* Wait until the last data is sent */ -#if I2S_RETRY_TIMES - waitTimes = I2S_RETRY_TIMES; - while (((FLEXIO_I2S_GetStatusFlags(base) & (uint32_t)kFLEXIO_I2S_TxDataRegEmptyFlag) == 0UL) && (--waitTimes != 0U)) - { - } - if (waitTimes == 0U) - { - return kStatus_FLEXIO_I2S_Timeout; - } -#else - while ((FLEXIO_I2S_GetStatusFlags(base) & (uint32_t)kFLEXIO_I2S_TxDataRegEmptyFlag) == 0UL) - { - } -#endif - - return kStatus_Success; -} - -/*! - * brief Receives a piece of data using a blocking method. - * - * note This function blocks via polling until data is ready to be sent. - * - * param base FlexIO I2S base pointer - * param bitWidth How many bits in a audio word, usually 8/16/24/32 bits. - * param rxData Pointer to the data to be read. - * param size Bytes to be read. - * retval kStatus_Success Successfully read data. - * retval kStatus_FLEXIO_I2C_Timeout Timeout polling status flags. - */ -status_t FLEXIO_I2S_ReadBlocking(FLEXIO_I2S_Type *base, uint8_t bitWidth, uint8_t *rxData, size_t size) -{ - uint32_t i = 0; - uint8_t bytesPerWord = bitWidth / 8U; -#if I2S_RETRY_TIMES - uint32_t waitTimes = I2S_RETRY_TIMES; -#endif - - for (i = 0; i < size / bytesPerWord; i++) - { - /* Wait until data is received */ -#if I2S_RETRY_TIMES - waitTimes = I2S_RETRY_TIMES; - while ((!((FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->rxShifterIndex)) != 0UL)) && - (--waitTimes != 0U)) - { - } - if (waitTimes == 0U) - { - return kStatus_FLEXIO_I2S_Timeout; - } -#else - while (!((FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->rxShifterIndex)) != 0UL)) - { - } -#endif - - FLEXIO_I2S_ReadNonBlocking(base, bitWidth, rxData, bytesPerWord); - rxData = (uint8_t *)((uint32_t)rxData + bytesPerWord); - } - return kStatus_Success; -} - -/*! - * brief Initializes the FlexIO I2S handle. - * - * This function initializes the FlexIO I2S handle which can be used for other - * FlexIO I2S transactional APIs. Call this API once to get the - * initialized handle. - * - * param base Pointer to FLEXIO_I2S_Type structure - * param handle Pointer to flexio_i2s_handle_t structure to store the transfer state. - * param callback FlexIO I2S callback function, which is called while finished a block. - * param userData User parameter for the FlexIO I2S callback. - */ -void FLEXIO_I2S_TransferTxCreateHandle(FLEXIO_I2S_Type *base, - flexio_i2s_handle_t *handle, - flexio_i2s_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - IRQn_Type flexio_irqs[] = FLEXIO_IRQS; - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Store callback and user data. */ - handle->callback = callback; - handle->userData = userData; - - /* Save the context in global variables to support the double weak mechanism. */ - (void)FLEXIO_RegisterHandleIRQ(base, handle, FLEXIO_I2S_TransferTxHandleIRQ); - - /* Set the TX/RX state. */ - handle->state = (uint32_t)kFLEXIO_I2S_Idle; - - /* Enable interrupt in NVIC. */ - (void)EnableIRQ(flexio_irqs[FLEXIO_I2S_GetInstance(base)]); -} - -/*! - * brief Initializes the FlexIO I2S receive handle. - * - * This function initializes the FlexIO I2S handle which can be used for other - * FlexIO I2S transactional APIs. Call this API once to get the - * initialized handle. - * - * param base Pointer to FLEXIO_I2S_Type structure. - * param handle Pointer to flexio_i2s_handle_t structure to store the transfer state. - * param callback FlexIO I2S callback function, which is called while finished a block. - * param userData User parameter for the FlexIO I2S callback. - */ -void FLEXIO_I2S_TransferRxCreateHandle(FLEXIO_I2S_Type *base, - flexio_i2s_handle_t *handle, - flexio_i2s_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - IRQn_Type flexio_irqs[] = FLEXIO_IRQS; - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Store callback and user data. */ - handle->callback = callback; - handle->userData = userData; - - /* Save the context in global variables to support the double weak mechanism. */ - (void)FLEXIO_RegisterHandleIRQ(base, handle, FLEXIO_I2S_TransferRxHandleIRQ); - - /* Set the TX/RX state. */ - handle->state = (uint32_t)kFLEXIO_I2S_Idle; - - /* Enable interrupt in NVIC. */ - (void)EnableIRQ(flexio_irqs[FLEXIO_I2S_GetInstance(base)]); -} - -/*! - * brief Configures the FlexIO I2S audio format. - * - * Audio format can be changed at run-time of FlexIO I2S. This function configures the sample rate and audio data - * format to be transferred. - * - * param base Pointer to FLEXIO_I2S_Type structure. - * param handle FlexIO I2S handle pointer. - * param format Pointer to audio data format structure. - * param srcClock_Hz FlexIO I2S bit clock source frequency in Hz. This parameter should be 0 while in slave mode. - */ -void FLEXIO_I2S_TransferSetFormat(FLEXIO_I2S_Type *base, - flexio_i2s_handle_t *handle, - flexio_i2s_format_t *format, - uint32_t srcClock_Hz) -{ - assert((handle != NULL) && (format != NULL)); - - /* Set the bitWidth to handle */ - handle->bitWidth = format->bitWidth; - - /* Set sample rate */ - if (srcClock_Hz != 0UL) - { - /* It is master */ - FLEXIO_I2S_MasterSetFormat(base, format, srcClock_Hz); - } - else - { - FLEXIO_I2S_SlaveSetFormat(base, format); - } -} - -/*! - * brief Performs an interrupt non-blocking send transfer on FlexIO I2S. - * - * note The API returns immediately after transfer initiates. - * Call FLEXIO_I2S_GetRemainingBytes to poll the transfer status and check whether - * the transfer is finished. If the return status is 0, the transfer is finished. - * - * param base Pointer to FLEXIO_I2S_Type structure. - * param handle Pointer to flexio_i2s_handle_t structure which stores the transfer state - * param xfer Pointer to flexio_i2s_transfer_t structure - * retval kStatus_Success Successfully start the data transmission. - * retval kStatus_FLEXIO_I2S_TxBusy Previous transmission still not finished, data not all written to TX register yet. - * retval kStatus_InvalidArgument The input parameter is invalid. - */ -status_t FLEXIO_I2S_TransferSendNonBlocking(FLEXIO_I2S_Type *base, - flexio_i2s_handle_t *handle, - flexio_i2s_transfer_t *xfer) -{ - assert(handle != NULL); - - /* Check if the queue is full */ - if (handle->queue[handle->queueUser].data != NULL) - { - return kStatus_FLEXIO_I2S_QueueFull; - } - if ((xfer->dataSize == 0U) || (xfer->data == NULL)) - { - return kStatus_InvalidArgument; - } - - /* Add into queue */ - handle->queue[handle->queueUser].data = xfer->data; - handle->queue[handle->queueUser].dataSize = xfer->dataSize; - handle->transferSize[handle->queueUser] = xfer->dataSize; - handle->queueUser = (handle->queueUser + 1U) % FLEXIO_I2S_XFER_QUEUE_SIZE; - - /* Set the state to busy */ - handle->state = (uint32_t)kFLEXIO_I2S_Busy; - - FLEXIO_I2S_EnableInterrupts(base, kFLEXIO_I2S_TxDataRegEmptyInterruptEnable); - - /* Enable Tx transfer */ - FLEXIO_I2S_Enable(base, true); - - return kStatus_Success; -} - -/*! - * brief Performs an interrupt non-blocking receive transfer on FlexIO I2S. - * - * note The API returns immediately after transfer initiates. - * Call FLEXIO_I2S_GetRemainingBytes to poll the transfer status to check whether - * the transfer is finished. If the return status is 0, the transfer is finished. - * - * param base Pointer to FLEXIO_I2S_Type structure. - * param handle Pointer to flexio_i2s_handle_t structure which stores the transfer state - * param xfer Pointer to flexio_i2s_transfer_t structure - * retval kStatus_Success Successfully start the data receive. - * retval kStatus_FLEXIO_I2S_RxBusy Previous receive still not finished. - * retval kStatus_InvalidArgument The input parameter is invalid. - */ -status_t FLEXIO_I2S_TransferReceiveNonBlocking(FLEXIO_I2S_Type *base, - flexio_i2s_handle_t *handle, - flexio_i2s_transfer_t *xfer) -{ - assert(handle != NULL); - - /* Check if the queue is full */ - if (handle->queue[handle->queueUser].data != NULL) - { - return kStatus_FLEXIO_I2S_QueueFull; - } - - if ((xfer->dataSize == 0U) || (xfer->data == NULL)) - { - return kStatus_InvalidArgument; - } - - /* Add into queue */ - handle->queue[handle->queueUser].data = xfer->data; - handle->queue[handle->queueUser].dataSize = xfer->dataSize; - handle->transferSize[handle->queueUser] = xfer->dataSize; - handle->queueUser = (handle->queueUser + 1U) % FLEXIO_I2S_XFER_QUEUE_SIZE; - - /* Set state to busy */ - handle->state = (uint32_t)kFLEXIO_I2S_Busy; - - /* Enable interrupt */ - FLEXIO_I2S_EnableInterrupts(base, kFLEXIO_I2S_RxDataRegFullInterruptEnable); - - /* Enable Rx transfer */ - FLEXIO_I2S_Enable(base, true); - - return kStatus_Success; -} - -/*! - * brief Aborts the current send. - * - * note This API can be called at any time when interrupt non-blocking transfer initiates - * to abort the transfer in a early time. - * - * param base Pointer to FLEXIO_I2S_Type structure. - * param handle Pointer to flexio_i2s_handle_t structure which stores the transfer state - */ -void FLEXIO_I2S_TransferAbortSend(FLEXIO_I2S_Type *base, flexio_i2s_handle_t *handle) -{ - assert(handle != NULL); - - /* Stop Tx transfer and disable interrupt */ - FLEXIO_I2S_DisableInterrupts(base, kFLEXIO_I2S_TxDataRegEmptyInterruptEnable); - handle->state = (uint32_t)kFLEXIO_I2S_Idle; - - /* Clear the queue */ - (void)memset(handle->queue, 0, sizeof(flexio_i2s_transfer_t) * FLEXIO_I2S_XFER_QUEUE_SIZE); - handle->queueDriver = 0; - handle->queueUser = 0; -} - -/*! - * brief Aborts the current receive. - * - * note This API can be called at any time when interrupt non-blocking transfer initiates - * to abort the transfer in a early time. - * - * param base Pointer to FLEXIO_I2S_Type structure. - * param handle Pointer to flexio_i2s_handle_t structure which stores the transfer state - */ -void FLEXIO_I2S_TransferAbortReceive(FLEXIO_I2S_Type *base, flexio_i2s_handle_t *handle) -{ - assert(handle != NULL); - - /* Stop rx transfer and disable interrupt */ - FLEXIO_I2S_DisableInterrupts(base, kFLEXIO_I2S_RxDataRegFullInterruptEnable); - handle->state = (uint32_t)kFLEXIO_I2S_Idle; - - /* Clear the queue */ - (void)memset(handle->queue, 0, sizeof(flexio_i2s_transfer_t) * FLEXIO_I2S_XFER_QUEUE_SIZE); - handle->queueDriver = 0; - handle->queueUser = 0; -} - -/*! - * brief Gets the remaining bytes to be sent. - * - * param base Pointer to FLEXIO_I2S_Type structure. - * param handle Pointer to flexio_i2s_handle_t structure which stores the transfer state - * param count Bytes sent. - * retval kStatus_Success Succeed get the transfer count. - * retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t FLEXIO_I2S_TransferGetSendCount(FLEXIO_I2S_Type *base, flexio_i2s_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - status_t status = kStatus_Success; - uint8_t queueDriver = handle->queueDriver; - - if (handle->state != (uint32_t)kFLEXIO_I2S_Busy) - { - status = kStatus_NoTransferInProgress; - } - else - { - *count = (handle->transferSize[queueDriver] - handle->queue[queueDriver].dataSize); - } - - return status; -} - -/*! - * brief Gets the remaining bytes to be received. - * - * param base Pointer to FLEXIO_I2S_Type structure. - * param handle Pointer to flexio_i2s_handle_t structure which stores the transfer state - * return count Bytes received. - * retval kStatus_Success Succeed get the transfer count. - * retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t FLEXIO_I2S_TransferGetReceiveCount(FLEXIO_I2S_Type *base, flexio_i2s_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - status_t status = kStatus_Success; - uint8_t queueDriver = handle->queueDriver; - - if (handle->state != (uint32_t)kFLEXIO_I2S_Busy) - { - status = kStatus_NoTransferInProgress; - } - else - { - *count = (handle->transferSize[queueDriver] - handle->queue[queueDriver].dataSize); - } - - return status; -} - -/*! - * brief Tx interrupt handler. - * - * param i2sBase Pointer to FLEXIO_I2S_Type structure. - * param i2sHandle Pointer to flexio_i2s_handle_t structure - */ -void FLEXIO_I2S_TransferTxHandleIRQ(void *i2sBase, void *i2sHandle) -{ - assert(i2sHandle != NULL); - - flexio_i2s_handle_t *handle = (flexio_i2s_handle_t *)i2sHandle; - FLEXIO_I2S_Type *base = (FLEXIO_I2S_Type *)i2sBase; - uint8_t *buffer = handle->queue[handle->queueDriver].data; - uint8_t dataSize = handle->bitWidth / 8U; - - /* Handle error */ - if ((FLEXIO_GetShifterErrorFlags(base->flexioBase) & (1UL << base->txShifterIndex)) != 0UL) - { - FLEXIO_ClearShifterErrorFlags(base->flexioBase, (1UL << base->txShifterIndex)); - } - /* Handle transfer */ - if (((FLEXIO_I2S_GetStatusFlags(base) & (uint32_t)kFLEXIO_I2S_TxDataRegEmptyFlag) != 0UL) && - (handle->queue[handle->queueDriver].data != NULL)) - { - FLEXIO_I2S_WriteNonBlocking(base, handle->bitWidth, buffer, dataSize); - - /* Update internal counter */ - handle->queue[handle->queueDriver].dataSize -= dataSize; - handle->queue[handle->queueDriver].data = - (uint8_t *)((uint32_t)handle->queue[handle->queueDriver].data + dataSize); - } - - /* If finished a block, call the callback function */ - if ((handle->queue[handle->queueDriver].dataSize == 0U) && (handle->queue[handle->queueDriver].data != NULL)) - { - (void)memset(&handle->queue[handle->queueDriver], 0, sizeof(flexio_i2s_transfer_t)); - handle->queueDriver = (handle->queueDriver + 1U) % FLEXIO_I2S_XFER_QUEUE_SIZE; - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_Success, handle->userData); - } - } - - /* If all data finished, just stop the transfer */ - if (handle->queue[handle->queueDriver].data == NULL) - { - FLEXIO_I2S_TransferAbortSend(base, handle); - } -} - -/*! - * brief Rx interrupt handler. - * - * param i2sBase Pointer to FLEXIO_I2S_Type structure. - * param i2sHandle Pointer to flexio_i2s_handle_t structure. - */ -void FLEXIO_I2S_TransferRxHandleIRQ(void *i2sBase, void *i2sHandle) -{ - assert(i2sHandle != NULL); - - flexio_i2s_handle_t *handle = (flexio_i2s_handle_t *)i2sHandle; - FLEXIO_I2S_Type *base = (FLEXIO_I2S_Type *)i2sBase; - uint8_t *buffer = handle->queue[handle->queueDriver].data; - uint8_t dataSize = handle->bitWidth / 8U; - - /* Handle transfer */ - if (((FLEXIO_I2S_GetStatusFlags(base) & (uint32_t)kFLEXIO_I2S_RxDataRegFullFlag) != 0UL) && - (handle->queue[handle->queueDriver].data != NULL)) - { - FLEXIO_I2S_ReadNonBlocking(base, handle->bitWidth, buffer, dataSize); - - /* Update internal state */ - handle->queue[handle->queueDriver].dataSize -= dataSize; - handle->queue[handle->queueDriver].data = - (uint8_t *)((uint32_t)handle->queue[handle->queueDriver].data + dataSize); - } - - /* If finished a block, call the callback function */ - if ((handle->queue[handle->queueDriver].dataSize == 0U) && (handle->queue[handle->queueDriver].data != NULL)) - { - (void)memset(&handle->queue[handle->queueDriver], 0, sizeof(flexio_i2s_transfer_t)); - handle->queueDriver = (handle->queueDriver + 1U) % FLEXIO_I2S_XFER_QUEUE_SIZE; - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_Success, handle->userData); - } - } - - /* If all data finished, just stop the transfer */ - if (handle->queue[handle->queueDriver].data == NULL) - { - FLEXIO_I2S_TransferAbortReceive(base, handle); - } -} diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_i2s.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_i2s.h deleted file mode 100644 index 5b260405a9c..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_i2s.h +++ /dev/null @@ -1,560 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_FLEXIO_I2S_H_ -#define FSL_FLEXIO_I2S_H_ - -#include "fsl_common.h" -#include "fsl_flexio.h" - -/*! - * @addtogroup flexio_i2s - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief FlexIO I2S driver version 2.2.0. */ -#define FSL_FLEXIO_I2S_DRIVER_VERSION (MAKE_VERSION(2, 2, 0)) -/*! @} */ - -/*! @brief Retry times for waiting flag. */ -#ifndef I2S_RETRY_TIMES -#define I2S_RETRY_TIMES 0U /* Define to zero means keep waiting until the flag is assert/deassert. */ -#endif - -/*! @brief FlexIO I2S transfer status */ -enum -{ - kStatus_FLEXIO_I2S_Idle = MAKE_STATUS(kStatusGroup_FLEXIO_I2S, 0), /*!< FlexIO I2S is in idle state */ - kStatus_FLEXIO_I2S_TxBusy = MAKE_STATUS(kStatusGroup_FLEXIO_I2S, 1), /*!< FlexIO I2S Tx is busy */ - kStatus_FLEXIO_I2S_RxBusy = MAKE_STATUS(kStatusGroup_FLEXIO_I2S, 2), /*!< FlexIO I2S Tx is busy */ - kStatus_FLEXIO_I2S_Error = MAKE_STATUS(kStatusGroup_FLEXIO_I2S, 3), /*!< FlexIO I2S error occurred */ - kStatus_FLEXIO_I2S_QueueFull = MAKE_STATUS(kStatusGroup_FLEXIO_I2S, 4), /*!< FlexIO I2S transfer queue is full. */ - kStatus_FLEXIO_I2S_Timeout = - MAKE_STATUS(kStatusGroup_FLEXIO_I2S, 5), /*!< FlexIO I2S timeout polling status flags. */ -}; - -/*! @brief Define FlexIO I2S access structure typedef */ -typedef struct _flexio_i2s_type -{ - FLEXIO_Type *flexioBase; /*!< FlexIO base pointer */ - uint8_t txPinIndex; /*!< Tx data pin index in FlexIO pins */ - uint8_t rxPinIndex; /*!< Rx data pin index */ - uint8_t bclkPinIndex; /*!< Bit clock pin index */ - uint8_t fsPinIndex; /*!< Frame sync pin index */ - uint8_t txShifterIndex; /*!< Tx data shifter index */ - uint8_t rxShifterIndex; /*!< Rx data shifter index */ - uint8_t bclkTimerIndex; /*!< Bit clock timer index */ - uint8_t fsTimerIndex; /*!< Frame sync timer index */ -} FLEXIO_I2S_Type; - -/*! @brief Master or slave mode */ -typedef enum _flexio_i2s_master_slave -{ - kFLEXIO_I2S_Master = 0x0U, /*!< Master mode */ - kFLEXIO_I2S_Slave = 0x1U /*!< Slave mode */ -} flexio_i2s_master_slave_t; - -/*! @brief _flexio_i2s_interrupt_enable Define FlexIO FlexIO I2S interrupt mask. */ -enum -{ - kFLEXIO_I2S_TxDataRegEmptyInterruptEnable = 0x1U, /*!< Transmit buffer empty interrupt enable. */ - kFLEXIO_I2S_RxDataRegFullInterruptEnable = 0x2U, /*!< Receive buffer full interrupt enable. */ -}; - -/*! @brief _flexio_i2s_status_flags Define FlexIO FlexIO I2S status mask. */ -enum -{ - kFLEXIO_I2S_TxDataRegEmptyFlag = 0x1U, /*!< Transmit buffer empty flag. */ - kFLEXIO_I2S_RxDataRegFullFlag = 0x2U, /*!< Receive buffer full flag. */ -}; - -/*! @brief FlexIO I2S configure structure */ -typedef struct _flexio_i2s_config -{ - bool enableI2S; /*!< Enable FlexIO I2S */ - flexio_i2s_master_slave_t masterSlave; /*!< Master or slave */ - flexio_pin_polarity_t txPinPolarity; /*!< Tx data pin polarity, active high or low */ - flexio_pin_polarity_t rxPinPolarity; /*!< Rx data pin polarity */ - flexio_pin_polarity_t bclkPinPolarity; /*!< Bit clock pin polarity */ - flexio_pin_polarity_t fsPinPolarity; /*!< Frame sync pin polarity */ - flexio_shifter_timer_polarity_t txTimerPolarity; /*!< Tx data valid on bclk rising or falling edge */ - flexio_shifter_timer_polarity_t rxTimerPolarity; /*!< Rx data valid on bclk rising or falling edge */ -} flexio_i2s_config_t; - -/*! @brief FlexIO I2S audio format, FlexIO I2S only support the same format in Tx and Rx */ -typedef struct _flexio_i2s_format -{ - uint8_t bitWidth; /*!< Bit width of audio data, always 8/16/24/32 bits */ - uint32_t sampleRate_Hz; /*!< Sample rate of the audio data */ -} flexio_i2s_format_t; - -/*!@brief FlexIO I2S transfer queue size, user can refine it according to use case. */ -#define FLEXIO_I2S_XFER_QUEUE_SIZE (4U) - -/*! @brief Audio sample rate */ -typedef enum _flexio_i2s_sample_rate -{ - kFLEXIO_I2S_SampleRate8KHz = 8000U, /*!< Sample rate 8000Hz */ - kFLEXIO_I2S_SampleRate11025Hz = 11025U, /*!< Sample rate 11025Hz */ - kFLEXIO_I2S_SampleRate12KHz = 12000U, /*!< Sample rate 12000Hz */ - kFLEXIO_I2S_SampleRate16KHz = 16000U, /*!< Sample rate 16000Hz */ - kFLEXIO_I2S_SampleRate22050Hz = 22050U, /*!< Sample rate 22050Hz */ - kFLEXIO_I2S_SampleRate24KHz = 24000U, /*!< Sample rate 24000Hz */ - kFLEXIO_I2S_SampleRate32KHz = 32000U, /*!< Sample rate 32000Hz */ - kFLEXIO_I2S_SampleRate44100Hz = 44100U, /*!< Sample rate 44100Hz */ - kFLEXIO_I2S_SampleRate48KHz = 48000U, /*!< Sample rate 48000Hz */ - kFLEXIO_I2S_SampleRate96KHz = 96000U /*!< Sample rate 96000Hz */ -} flexio_i2s_sample_rate_t; - -/*! @brief Audio word width */ -typedef enum _flexio_i2s_word_width -{ - kFLEXIO_I2S_WordWidth8bits = 8U, /*!< Audio data width 8 bits */ - kFLEXIO_I2S_WordWidth16bits = 16U, /*!< Audio data width 16 bits */ - kFLEXIO_I2S_WordWidth24bits = 24U, /*!< Audio data width 24 bits */ - kFLEXIO_I2S_WordWidth32bits = 32U /*!< Audio data width 32 bits */ -} flexio_i2s_word_width_t; - -/*! @brief Define FlexIO I2S transfer structure. */ -typedef struct _flexio_i2s_transfer -{ - uint8_t *data; /*!< Data buffer start pointer */ - size_t dataSize; /*!< Bytes to be transferred. */ -} flexio_i2s_transfer_t; - -typedef struct _flexio_i2s_handle flexio_i2s_handle_t; - -/*! @brief FlexIO I2S xfer callback prototype */ -typedef void (*flexio_i2s_callback_t)(FLEXIO_I2S_Type *base, - flexio_i2s_handle_t *handle, - status_t status, - void *userData); - -/*! @brief Define FlexIO I2S handle structure. */ -struct _flexio_i2s_handle -{ - uint32_t state; /*!< Internal state */ - flexio_i2s_callback_t callback; /*!< Callback function called at transfer event*/ - void *userData; /*!< Callback parameter passed to callback function*/ - uint8_t bitWidth; /*!< Bit width for transfer, 8/16/24/32bits */ - flexio_i2s_transfer_t queue[FLEXIO_I2S_XFER_QUEUE_SIZE]; /*!< Transfer queue storing queued transfer */ - size_t transferSize[FLEXIO_I2S_XFER_QUEUE_SIZE]; /*!< Data bytes need to transfer */ - volatile uint8_t queueUser; /*!< Index for user to queue transfer */ - volatile uint8_t queueDriver; /*!< Index for driver to get the transfer data and size */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus*/ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Initializes the FlexIO I2S. - * - * This API configures FlexIO pins and shifter to I2S and configures the FlexIO I2S with a configuration structure. - * The configuration structure can be filled by the user, or be set with default values by - * FLEXIO_I2S_GetDefaultConfig(). - * - * @note This API should be called at the beginning of the application to use - * the FlexIO I2S driver. Otherwise, any access to the FlexIO I2S module can cause hard fault - * because the clock is not enabled. - * - * @param base FlexIO I2S base pointer - * @param config FlexIO I2S configure structure. - */ -void FLEXIO_I2S_Init(FLEXIO_I2S_Type *base, const flexio_i2s_config_t *config); - -/*! - * @brief Sets the FlexIO I2S configuration structure to default values. - * - * The purpose of this API is to get the configuration structure initialized for use in FLEXIO_I2S_Init(). - * Users may use the initialized structure unchanged in FLEXIO_I2S_Init() or modify - * some fields of the structure before calling FLEXIO_I2S_Init(). - * - * @param config pointer to master configuration structure - */ -void FLEXIO_I2S_GetDefaultConfig(flexio_i2s_config_t *config); - -/*! - * @brief De-initializes the FlexIO I2S. - * - * Calling this API resets the FlexIO I2S shifter and timer config. After calling this API, - * call the FLEXO_I2S_Init to use the FlexIO I2S module. - * - * @param base FlexIO I2S base pointer - */ -void FLEXIO_I2S_Deinit(FLEXIO_I2S_Type *base); - -/*! - * @brief Enables/disables the FlexIO I2S module operation. - * - * @param base Pointer to FLEXIO_I2S_Type - * @param enable True to enable, false dose not have any effect. - */ -static inline void FLEXIO_I2S_Enable(FLEXIO_I2S_Type *base, bool enable) -{ - if (enable) - { - base->flexioBase->CTRL |= FLEXIO_CTRL_FLEXEN_MASK; - } -} - -/*! @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets the FlexIO I2S status flags. - * - * @param base Pointer to FLEXIO_I2S_Type structure - * @return Status flag, which are ORed by the enumerators in the _flexio_i2s_status_flags. - */ -uint32_t FLEXIO_I2S_GetStatusFlags(FLEXIO_I2S_Type *base); - -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables the FlexIO I2S interrupt. - * - * This function enables the FlexIO UART interrupt. - * - * @param base Pointer to FLEXIO_I2S_Type structure - * @param mask interrupt source - */ -void FLEXIO_I2S_EnableInterrupts(FLEXIO_I2S_Type *base, uint32_t mask); - -/*! - * @brief Disables the FlexIO I2S interrupt. - * - * This function enables the FlexIO UART interrupt. - * - * @param base pointer to FLEXIO_I2S_Type structure - * @param mask interrupt source - */ -void FLEXIO_I2S_DisableInterrupts(FLEXIO_I2S_Type *base, uint32_t mask); - -/*! @} */ - -/*! - * @name DMA Control - * @{ - */ - -/*! - * @brief Enables/disables the FlexIO I2S Tx DMA requests. - * - * @param base FlexIO I2S base pointer - * @param enable True means enable DMA, false means disable DMA. - */ -static inline void FLEXIO_I2S_TxEnableDMA(FLEXIO_I2S_Type *base, bool enable) -{ - FLEXIO_EnableShifterStatusDMA(base->flexioBase, 1UL << base->txShifterIndex, enable); -} - -/*! - * @brief Enables/disables the FlexIO I2S Rx DMA requests. - * - * @param base FlexIO I2S base pointer - * @param enable True means enable DMA, false means disable DMA. - */ -static inline void FLEXIO_I2S_RxEnableDMA(FLEXIO_I2S_Type *base, bool enable) -{ - FLEXIO_EnableShifterStatusDMA(base->flexioBase, 1UL << base->rxShifterIndex, enable); -} - -/*! - * @brief Gets the FlexIO I2S send data register address. - * - * This function returns the I2S data register address, mainly used by DMA/eDMA. - * - * @param base Pointer to FLEXIO_I2S_Type structure - * @return FlexIO i2s send data register address. - */ -static inline uint32_t FLEXIO_I2S_TxGetDataRegisterAddress(FLEXIO_I2S_Type *base) -{ - return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBufferBitSwapped, base->txShifterIndex); -} - -/*! - * @brief Gets the FlexIO I2S receive data register address. - * - * This function returns the I2S data register address, mainly used by DMA/eDMA. - * - * @param base Pointer to FLEXIO_I2S_Type structure - * @return FlexIO i2s receive data register address. - */ -static inline uint32_t FLEXIO_I2S_RxGetDataRegisterAddress(FLEXIO_I2S_Type *base) -{ - return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBufferBitSwapped, base->rxShifterIndex); -} - -/*! @} */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Configures the FlexIO I2S audio format in master mode. - * - * Audio format can be changed in run-time of FlexIO I2S. This function configures the sample rate and audio data - * format to be transferred. - * - * @param base Pointer to FLEXIO_I2S_Type structure - * @param format Pointer to FlexIO I2S audio data format structure. - * @param srcClock_Hz I2S master clock source frequency in Hz. - */ -void FLEXIO_I2S_MasterSetFormat(FLEXIO_I2S_Type *base, flexio_i2s_format_t *format, uint32_t srcClock_Hz); - -/*! - * @brief Configures the FlexIO I2S audio format in slave mode. - * - * Audio format can be changed in run-time of FlexIO I2S. This function configures the sample rate and audio data - * format to be transferred. - * - * @param base Pointer to FLEXIO_I2S_Type structure - * @param format Pointer to FlexIO I2S audio data format structure. - */ -void FLEXIO_I2S_SlaveSetFormat(FLEXIO_I2S_Type *base, flexio_i2s_format_t *format); - -/*! - * @brief Sends data using a blocking method. - * - * @note This function blocks via polling until data is ready to be sent. - * - * @param base FlexIO I2S base pointer. - * @param bitWidth How many bits in a audio word, usually 8/16/24/32 bits. - * @param txData Pointer to the data to be written. - * @param size Bytes to be written. - * @retval kStatus_Success Successfully write data. - * @retval kStatus_FLEXIO_I2C_Timeout Timeout polling status flags. - */ -status_t FLEXIO_I2S_WriteBlocking(FLEXIO_I2S_Type *base, uint8_t bitWidth, uint8_t *txData, size_t size); - -/*! - * @brief Writes data into a data register. - * - * @param base FlexIO I2S base pointer. - * @param bitWidth How many bits in a audio word, usually 8/16/24/32 bits. - * @param data Data to be written. - */ -static inline void FLEXIO_I2S_WriteData(FLEXIO_I2S_Type *base, uint8_t bitWidth, uint32_t data) -{ - base->flexioBase->SHIFTBUFBIS[base->txShifterIndex] = (data << (32U - bitWidth)); -} - -/*! - * @brief Receives a piece of data using a blocking method. - * - * @note This function blocks via polling until data is ready to be sent. - * - * @param base FlexIO I2S base pointer - * @param bitWidth How many bits in a audio word, usually 8/16/24/32 bits. - * @param rxData Pointer to the data to be read. - * @param size Bytes to be read. - * @retval kStatus_Success Successfully read data. - * @retval kStatus_FLEXIO_I2C_Timeout Timeout polling status flags. - */ -status_t FLEXIO_I2S_ReadBlocking(FLEXIO_I2S_Type *base, uint8_t bitWidth, uint8_t *rxData, size_t size); - -/*! - * @brief Reads a data from the data register. - * - * @param base FlexIO I2S base pointer - * @return Data read from data register. - */ -static inline uint32_t FLEXIO_I2S_ReadData(FLEXIO_I2S_Type *base) -{ - return base->flexioBase->SHIFTBUFBIS[base->rxShifterIndex]; -} - -/*! @} */ - -/*! - * @name Transactional - * @{ - */ - -/*! - * @brief Initializes the FlexIO I2S handle. - * - * This function initializes the FlexIO I2S handle which can be used for other - * FlexIO I2S transactional APIs. Call this API once to get the - * initialized handle. - * - * @param base Pointer to FLEXIO_I2S_Type structure - * @param handle Pointer to flexio_i2s_handle_t structure to store the transfer state. - * @param callback FlexIO I2S callback function, which is called while finished a block. - * @param userData User parameter for the FlexIO I2S callback. - */ -void FLEXIO_I2S_TransferTxCreateHandle(FLEXIO_I2S_Type *base, - flexio_i2s_handle_t *handle, - flexio_i2s_callback_t callback, - void *userData); - -/*! - * @brief Configures the FlexIO I2S audio format. - * - * Audio format can be changed at run-time of FlexIO I2S. This function configures the sample rate and audio data - * format to be transferred. - * - * @param base Pointer to FLEXIO_I2S_Type structure. - * @param handle FlexIO I2S handle pointer. - * @param format Pointer to audio data format structure. - * @param srcClock_Hz FlexIO I2S bit clock source frequency in Hz. This parameter should be 0 while in slave mode. - */ -void FLEXIO_I2S_TransferSetFormat(FLEXIO_I2S_Type *base, - flexio_i2s_handle_t *handle, - flexio_i2s_format_t *format, - uint32_t srcClock_Hz); - -/*! - * @brief Initializes the FlexIO I2S receive handle. - * - * This function initializes the FlexIO I2S handle which can be used for other - * FlexIO I2S transactional APIs. Call this API once to get the - * initialized handle. - * - * @param base Pointer to FLEXIO_I2S_Type structure. - * @param handle Pointer to flexio_i2s_handle_t structure to store the transfer state. - * @param callback FlexIO I2S callback function, which is called while finished a block. - * @param userData User parameter for the FlexIO I2S callback. - */ -void FLEXIO_I2S_TransferRxCreateHandle(FLEXIO_I2S_Type *base, - flexio_i2s_handle_t *handle, - flexio_i2s_callback_t callback, - void *userData); - -/*! - * @brief Performs an interrupt non-blocking send transfer on FlexIO I2S. - * - * @note The API returns immediately after transfer initiates. - * Call FLEXIO_I2S_GetRemainingBytes to poll the transfer status and check whether - * the transfer is finished. If the return status is 0, the transfer is finished. - * - * @param base Pointer to FLEXIO_I2S_Type structure. - * @param handle Pointer to flexio_i2s_handle_t structure which stores the transfer state - * @param xfer Pointer to flexio_i2s_transfer_t structure - * @retval kStatus_Success Successfully start the data transmission. - * @retval kStatus_FLEXIO_I2S_TxBusy Previous transmission still not finished, data not all written to TX register yet. - * @retval kStatus_InvalidArgument The input parameter is invalid. - */ -status_t FLEXIO_I2S_TransferSendNonBlocking(FLEXIO_I2S_Type *base, - flexio_i2s_handle_t *handle, - flexio_i2s_transfer_t *xfer); - -/*! - * @brief Performs an interrupt non-blocking receive transfer on FlexIO I2S. - * - * @note The API returns immediately after transfer initiates. - * Call FLEXIO_I2S_GetRemainingBytes to poll the transfer status to check whether - * the transfer is finished. If the return status is 0, the transfer is finished. - * - * @param base Pointer to FLEXIO_I2S_Type structure. - * @param handle Pointer to flexio_i2s_handle_t structure which stores the transfer state - * @param xfer Pointer to flexio_i2s_transfer_t structure - * @retval kStatus_Success Successfully start the data receive. - * @retval kStatus_FLEXIO_I2S_RxBusy Previous receive still not finished. - * @retval kStatus_InvalidArgument The input parameter is invalid. - */ -status_t FLEXIO_I2S_TransferReceiveNonBlocking(FLEXIO_I2S_Type *base, - flexio_i2s_handle_t *handle, - flexio_i2s_transfer_t *xfer); - -/*! - * @brief Aborts the current send. - * - * @note This API can be called at any time when interrupt non-blocking transfer initiates - * to abort the transfer in a early time. - * - * @param base Pointer to FLEXIO_I2S_Type structure. - * @param handle Pointer to flexio_i2s_handle_t structure which stores the transfer state - */ -void FLEXIO_I2S_TransferAbortSend(FLEXIO_I2S_Type *base, flexio_i2s_handle_t *handle); - -/*! - * @brief Aborts the current receive. - * - * @note This API can be called at any time when interrupt non-blocking transfer initiates - * to abort the transfer in a early time. - * - * @param base Pointer to FLEXIO_I2S_Type structure. - * @param handle Pointer to flexio_i2s_handle_t structure which stores the transfer state - */ -void FLEXIO_I2S_TransferAbortReceive(FLEXIO_I2S_Type *base, flexio_i2s_handle_t *handle); - -/*! - * @brief Gets the remaining bytes to be sent. - * - * @param base Pointer to FLEXIO_I2S_Type structure. - * @param handle Pointer to flexio_i2s_handle_t structure which stores the transfer state - * @param count Bytes sent. - * @retval kStatus_Success Succeed get the transfer count. - * @retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t FLEXIO_I2S_TransferGetSendCount(FLEXIO_I2S_Type *base, flexio_i2s_handle_t *handle, size_t *count); - -/*! - * @brief Gets the remaining bytes to be received. - * - * @param base Pointer to FLEXIO_I2S_Type structure. - * @param handle Pointer to flexio_i2s_handle_t structure which stores the transfer state - * @param count Bytes recieved. - * @return count Bytes received. - * @retval kStatus_Success Succeed get the transfer count. - * @retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t FLEXIO_I2S_TransferGetReceiveCount(FLEXIO_I2S_Type *base, flexio_i2s_handle_t *handle, size_t *count); - -/*! - * @brief Tx interrupt handler. - * - * @param i2sBase Pointer to FLEXIO_I2S_Type structure. - * @param i2sHandle Pointer to flexio_i2s_handle_t structure - */ -void FLEXIO_I2S_TransferTxHandleIRQ(void *i2sBase, void *i2sHandle); - -/*! - * @brief Rx interrupt handler. - * - * @param i2sBase Pointer to FLEXIO_I2S_Type structure. - * @param i2sHandle Pointer to flexio_i2s_handle_t structure. - */ -void FLEXIO_I2S_TransferRxHandleIRQ(void *i2sBase, void *i2sHandle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /*_cplusplus*/ - -/*! @} */ - -#endif /* FSL_FLEXIO_I2S_H_ */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_i2s_dma.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_i2s_dma.c deleted file mode 100644 index f817e2ca5ea..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_i2s_dma.c +++ /dev/null @@ -1,422 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2018 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio_i2s_dma.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio_i2s_dma" -#endif - -/******************************************************************************* - * Definitations - ******************************************************************************/ - -/*handle; - - /* If finished a block, call the callback function */ - (void)memset(&flexio_i2sHandle->queue[flexio_i2sHandle->queueDriver], 0, sizeof(flexio_i2s_transfer_t)); - flexio_i2sHandle->queueDriver = (flexio_i2sHandle->queueDriver + 1U) % FLEXIO_I2S_XFER_QUEUE_SIZE; - if (flexio_i2sHandle->callback != NULL) - { - (flexio_i2sHandle->callback)(privHandle->base, flexio_i2sHandle, kStatus_Success, flexio_i2sHandle->userData); - } - - /* If all data finished, just stop the transfer */ - if (flexio_i2sHandle->queue[flexio_i2sHandle->queueDriver].data == NULL) - { - FLEXIO_I2S_TransferAbortSendDMA(privHandle->base, flexio_i2sHandle); - } -} - -static void FLEXIO_I2S_RxDMACallback(dma_handle_t *handle, void *userData) -{ - flexio_i2s_dma_private_handle_t *privHandle = (flexio_i2s_dma_private_handle_t *)userData; - flexio_i2s_dma_handle_t *flexio_i2sHandle = privHandle->handle; - - /* If finished a block, call the callback function */ - (void)memset(&flexio_i2sHandle->queue[flexio_i2sHandle->queueDriver], 0, sizeof(flexio_i2s_transfer_t)); - flexio_i2sHandle->queueDriver = (flexio_i2sHandle->queueDriver + 1U) % FLEXIO_I2S_XFER_QUEUE_SIZE; - if (flexio_i2sHandle->callback != NULL) - { - (flexio_i2sHandle->callback)(privHandle->base, flexio_i2sHandle, kStatus_Success, flexio_i2sHandle->userData); - } - - /* If all data finished, just stop the transfer */ - if (flexio_i2sHandle->queue[flexio_i2sHandle->queueDriver].data == NULL) - { - FLEXIO_I2S_TransferAbortReceiveDMA(privHandle->base, flexio_i2sHandle); - } -} - -/*! - * brief Initializes the FlexIO I2S DMA handle. - * - * This function initializes the FlexIO I2S master DMA handle which can be used for other FlexIO I2S master - * transactional APIs. - * Usually, for a specified FlexIO I2S instance, call this API once to get the initialized handle. - * - * param base FlexIO I2S peripheral base address. - * param handle FlexIO I2S DMA handle pointer. - * param callback FlexIO I2S DMA callback function called while finished a block. - * param userData User parameter for callback. - * param dmaHandle DMA handle for FlexIO I2S. This handle is a static value allocated by users. - */ -void FLEXIO_I2S_TransferTxCreateHandleDMA(FLEXIO_I2S_Type *base, - flexio_i2s_dma_handle_t *handle, - flexio_i2s_dma_callback_t callback, - void *userData, - dma_handle_t *dmaHandle) -{ - assert((handle != NULL) && (dmaHandle != NULL)); - - /* Zero the handle */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Set flexio_i2s base to handle */ - handle->dmaHandle = dmaHandle; - handle->callback = callback; - handle->userData = userData; - - /* Set FLEXIO I2S state to idle */ - handle->state = (uint32_t)kFLEXIO_I2S_Idle; - - s_dmaPrivateHandle[0].base = base; - s_dmaPrivateHandle[0].handle = handle; - - /* Install callback for Tx dma channel */ - DMA_SetCallback(dmaHandle, FLEXIO_I2S_TxDMACallback, &s_dmaPrivateHandle[0]); -} - -/*! - * brief Initializes the FlexIO I2S Rx DMA handle. - * - * This function initializes the FlexIO I2S slave DMA handle which can be used for other FlexIO I2S master transactional - * APIs. - * Usually, for a specified FlexIO I2S instance, call this API once to get the initialized handle. - * - * param base FlexIO I2S peripheral base address. - * param handle FlexIO I2S DMA handle pointer. - * param callback FlexIO I2S DMA callback function called while finished a block. - * param userData User parameter for callback. - * param dmaHandle DMA handle for FlexIO I2S. This handle is a static value allocated by users. - */ -void FLEXIO_I2S_TransferRxCreateHandleDMA(FLEXIO_I2S_Type *base, - flexio_i2s_dma_handle_t *handle, - flexio_i2s_dma_callback_t callback, - void *userData, - dma_handle_t *dmaHandle) -{ - assert((handle != NULL) && (dmaHandle != NULL)); - - /* Zero the handle */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Set flexio_i2s base to handle */ - handle->dmaHandle = dmaHandle; - handle->callback = callback; - handle->userData = userData; - - /* Set FLEXIO I2S state to idle */ - handle->state = (uint32_t)kFLEXIO_I2S_Idle; - - s_dmaPrivateHandle[1].base = base; - s_dmaPrivateHandle[1].handle = handle; - - /* Install callback for Tx dma channel */ - DMA_SetCallback(dmaHandle, FLEXIO_I2S_RxDMACallback, &s_dmaPrivateHandle[1]); -} - -/*! - * brief Configures the FlexIO I2S Tx audio format. - * - * Audio format can be changed at run-time of FlexIO I2S. This function configures the sample rate and audio data - * format to be transferred. This function also sets the DMA parameter according to the format. - * - * param base FlexIO I2S peripheral base address. - * param handle FlexIO I2S DMA handle pointer - * param format Pointer to FlexIO I2S audio data format structure. - * param srcClock_Hz FlexIO I2S clock source frequency in Hz. It should be 0 while in slave mode. - */ -void FLEXIO_I2S_TransferSetFormatDMA(FLEXIO_I2S_Type *base, - flexio_i2s_dma_handle_t *handle, - flexio_i2s_format_t *format, - uint32_t srcClock_Hz) -{ - assert((handle != NULL) && (format != NULL)); - - /* Configure the audio format to FLEXIO I2S registers */ - if (srcClock_Hz != 0U) - { - /* It is master */ - FLEXIO_I2S_MasterSetFormat(base, format, srcClock_Hz); - } - else - { - FLEXIO_I2S_SlaveSetFormat(base, format); - } - - /* Get the transfer size from format, this should be used in DMA configuration */ - handle->bytesPerFrame = format->bitWidth / 8U; -} - -/*! - * brief Performs a non-blocking FlexIO I2S transfer using DMA. - * - * note This interface returns immediately after transfer initiates. Call - * FLEXIO_I2S_GetTransferStatus to poll the transfer status and check whether FLEXIO I2S transfer finished. - * - * param base FlexIO I2S peripheral base address. - * param handle FlexIO I2S DMA handle pointer. - * param xfer Pointer to DMA transfer structure. - * retval kStatus_Success Start a FlexIO I2S DMA send successfully. - * retval kStatus_InvalidArgument The input arguments is invalid. - * retval kStatus_TxBusy FlexIO I2S is busy sending data. - */ -status_t FLEXIO_I2S_TransferSendDMA(FLEXIO_I2S_Type *base, flexio_i2s_dma_handle_t *handle, flexio_i2s_transfer_t *xfer) -{ - assert((handle != NULL) && (xfer != NULL)); - - dma_transfer_config_t config = {0}; - uint32_t destAddr = FLEXIO_I2S_TxGetDataRegisterAddress(base) + (4UL - handle->bytesPerFrame); - - /* Check if input parameter invalid */ - if ((xfer->data == NULL) || (xfer->dataSize == 0U)) - { - return kStatus_InvalidArgument; - } - - if (handle->queue[handle->queueUser].data != NULL) - { - return kStatus_FLEXIO_I2S_QueueFull; - } - - /* Change the state of handle */ - handle->state = (uint32_t)kFLEXIO_I2S_Busy; - - /* Update the queue state */ - handle->queue[handle->queueUser].data = xfer->data; - handle->queue[handle->queueUser].dataSize = xfer->dataSize; - handle->transferSize[handle->queueUser] = xfer->dataSize; - handle->queueUser = (handle->queueUser + 1U) % FLEXIO_I2S_XFER_QUEUE_SIZE; - - DMA_PrepareTransfer(&config, xfer->data, handle->bytesPerFrame, (uint32_t *)destAddr, handle->bytesPerFrame, - xfer->dataSize, kDMA_MemoryToPeripheral); - - /* Configure DMA channel */ - (void)DMA_SubmitTransfer(handle->dmaHandle, &config, 1UL); - - /* Start DMA transfer */ - DMA_StartTransfer(handle->dmaHandle); - - /* Enable DMA enable bit */ - FLEXIO_I2S_TxEnableDMA(base, true); - - /* Enable FLEXIO I2S Tx clock */ - FLEXIO_I2S_Enable(base, true); - - return kStatus_Success; -} - -/*! - * brief Performs a non-blocking FlexIO I2S receive using DMA. - * - * note This interface returns immediately after transfer initiates. Call - * FLEXIO_I2S_GetReceiveRemainingBytes to poll the transfer status to check whether the FlexIO I2S transfer is finished. - * - * param base FlexIO I2S peripheral base address. - * param handle FlexIO I2S DMA handle pointer. - * param xfer Pointer to DMA transfer structure. - * retval kStatus_Success Start a FlexIO I2S DMA receive successfully. - * retval kStatus_InvalidArgument The input arguments is invalid. - * retval kStatus_RxBusy FlexIO I2S is busy receiving data. - */ -status_t FLEXIO_I2S_TransferReceiveDMA(FLEXIO_I2S_Type *base, - flexio_i2s_dma_handle_t *handle, - flexio_i2s_transfer_t *xfer) -{ - assert((handle != NULL) && (xfer != NULL)); - - dma_transfer_config_t config = {0}; - uint32_t srcAddr = FLEXIO_I2S_RxGetDataRegisterAddress(base); - - /* Check if input parameter invalid */ - if ((xfer->data == NULL) || (xfer->dataSize == 0U)) - { - return kStatus_InvalidArgument; - } - - if (handle->queue[handle->queueUser].data != NULL) - { - return kStatus_FLEXIO_I2S_QueueFull; - } - - /* Change the state of handle */ - handle->state = (uint32_t)kFLEXIO_I2S_Busy; - - /* Update queue state */ - handle->queue[handle->queueUser].data = xfer->data; - handle->queue[handle->queueUser].dataSize = xfer->dataSize; - handle->transferSize[handle->queueUser] = xfer->dataSize; - handle->queueUser = (handle->queueUser + 1U) % FLEXIO_I2S_XFER_QUEUE_SIZE; - - /* Prepare dma configure */ - DMA_PrepareTransfer(&config, (uint32_t *)srcAddr, handle->bytesPerFrame, xfer->data, handle->bytesPerFrame, - xfer->dataSize, kDMA_PeripheralToMemory); - - (void)DMA_SubmitTransfer(handle->dmaHandle, &config, 1UL); - - /* Start DMA transfer */ - DMA_StartTransfer(handle->dmaHandle); - - /* Enable DMA enable bit */ - FLEXIO_I2S_RxEnableDMA(base, true); - - /* Enable FLEXIO I2S Rx clock */ - FLEXIO_I2S_Enable(base, true); - - return kStatus_Success; -} - -/*! - * brief Aborts a FlexIO I2S transfer using DMA. - * - * param base FlexIO I2S peripheral base address. - * param handle FlexIO I2S DMA handle pointer. - */ -void FLEXIO_I2S_TransferAbortSendDMA(FLEXIO_I2S_Type *base, flexio_i2s_dma_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable dma */ - DMA_AbortTransfer(handle->dmaHandle); - - /* Disable DMA enable bit */ - FLEXIO_I2S_TxEnableDMA(base, false); - - /* Set the handle state */ - handle->state = (uint32_t)kFLEXIO_I2S_Idle; -} - -/*! - * brief Aborts a FlexIO I2S receive using DMA. - * - * param base FlexIO I2S peripheral base address. - * param handle FlexIO I2S DMA handle pointer. - */ -void FLEXIO_I2S_TransferAbortReceiveDMA(FLEXIO_I2S_Type *base, flexio_i2s_dma_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable dma */ - DMA_AbortTransfer(handle->dmaHandle); - - /* Disable DMA enable bit */ - FLEXIO_I2S_RxEnableDMA(base, false); - - /* Set the handle state */ - handle->state = (uint32_t)kFLEXIO_I2S_Idle; -} - -/*! - * brief Gets the remaining bytes to be sent. - * - * param base FlexIO I2S peripheral base address. - * param handle FlexIO I2S DMA handle pointer. - * param count Bytes sent. - * retval kStatus_Success Succeed get the transfer count. - * retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t FLEXIO_I2S_TransferGetSendCountDMA(FLEXIO_I2S_Type *base, flexio_i2s_dma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - status_t status = kStatus_Success; - - if (handle->state != (uint32_t)kFLEXIO_I2S_Busy) - { - status = kStatus_NoTransferInProgress; - } - else - { - *count = handle->transferSize[handle->queueDriver] - - DMA_GetRemainingBytes(handle->dmaHandle->base, handle->dmaHandle->channel); - } - - return status; -} - -/*! - * brief Gets the remaining bytes to be received. - * - * param base FlexIO I2S peripheral base address. - * param handle FlexIO I2S DMA handle pointer. - * param count Bytes received. - * retval kStatus_Success Succeed get the transfer count. - * retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t FLEXIO_I2S_TransferGetReceiveCountDMA(FLEXIO_I2S_Type *base, flexio_i2s_dma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - status_t status = kStatus_Success; - - if (handle->state != (uint32_t)kFLEXIO_I2S_Busy) - { - status = kStatus_NoTransferInProgress; - } - else - { - *count = handle->transferSize[handle->queueDriver] - - DMA_GetRemainingBytes(handle->dmaHandle->base, handle->dmaHandle->channel); - } - - return status; -} diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_i2s_dma.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_i2s_dma.h deleted file mode 100644 index 9bf6133ceab..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_i2s_dma.h +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2019 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_FLEXIO_I2S_DMA_H_ -#define FSL_FLEXIO_I2S_DMA_H_ - -#include "fsl_flexio_i2s.h" -#include "fsl_dma.h" - -/*! - * @addtogroup flexio_dma_i2s - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief FlexIO I2S DMA driver version 2.1.7. */ -#define FSL_FLEXIO_I2S_DMA_DRIVER_VERSION (MAKE_VERSION(2, 1, 7)) -/*! @} */ - -typedef struct _flexio_i2s_dma_handle flexio_i2s_dma_handle_t; - -/*! @brief FlexIO I2S DMA transfer callback function for finish and error */ -typedef void (*flexio_i2s_dma_callback_t)(FLEXIO_I2S_Type *base, - flexio_i2s_dma_handle_t *handle, - status_t status, - void *userData); - -/*! @brief FlexIO I2S DMA transfer handle, users should not touch the content of the handle.*/ -struct _flexio_i2s_dma_handle -{ - dma_handle_t *dmaHandle; /*!< DMA handler for FlexIO I2S send */ - uint8_t bytesPerFrame; /*!< Bytes in a frame */ - uint32_t state; /*!< Internal state for FlexIO I2S DMA transfer */ - flexio_i2s_dma_callback_t callback; /*!< Callback for users while transfer finish or error occurred */ - void *userData; /*!< User callback parameter */ - flexio_i2s_transfer_t queue[FLEXIO_I2S_XFER_QUEUE_SIZE]; /*!< Transfer queue storing queued transfer. */ - size_t transferSize[FLEXIO_I2S_XFER_QUEUE_SIZE]; /*!< Data bytes need to transfer */ - volatile uint8_t queueUser; /*!< Index for user to queue transfer. */ - volatile uint8_t queueDriver; /*!< Index for driver to get the transfer data and size */ -}; - -/******************************************************************************* - * APIs - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name DMA Transactional - * @{ - */ - -/*! - * @brief Initializes the FlexIO I2S DMA handle. - * - * This function initializes the FlexIO I2S master DMA handle which can be used for other FlexIO I2S master - * transactional APIs. - * Usually, for a specified FlexIO I2S instance, call this API once to get the initialized handle. - * - * @param base FlexIO I2S peripheral base address. - * @param handle FlexIO I2S DMA handle pointer. - * @param callback FlexIO I2S DMA callback function called while finished a block. - * @param userData User parameter for callback. - * @param dmaHandle DMA handle for FlexIO I2S. This handle is a static value allocated by users. - */ -void FLEXIO_I2S_TransferTxCreateHandleDMA(FLEXIO_I2S_Type *base, - flexio_i2s_dma_handle_t *handle, - flexio_i2s_dma_callback_t callback, - void *userData, - dma_handle_t *dmaHandle); - -/*! - * @brief Initializes the FlexIO I2S Rx DMA handle. - * - * This function initializes the FlexIO I2S slave DMA handle which can be used for other FlexIO I2S master transactional - * APIs. - * Usually, for a specified FlexIO I2S instance, call this API once to get the initialized handle. - * - * @param base FlexIO I2S peripheral base address. - * @param handle FlexIO I2S DMA handle pointer. - * @param callback FlexIO I2S DMA callback function called while finished a block. - * @param userData User parameter for callback. - * @param dmaHandle DMA handle for FlexIO I2S. This handle is a static value allocated by users. - */ -void FLEXIO_I2S_TransferRxCreateHandleDMA(FLEXIO_I2S_Type *base, - flexio_i2s_dma_handle_t *handle, - flexio_i2s_dma_callback_t callback, - void *userData, - dma_handle_t *dmaHandle); - -/*! - * @brief Configures the FlexIO I2S Tx audio format. - * - * Audio format can be changed at run-time of FlexIO I2S. This function configures the sample rate and audio data - * format to be transferred. This function also sets the DMA parameter according to the format. - * - * @param base FlexIO I2S peripheral base address. - * @param handle FlexIO I2S DMA handle pointer - * @param format Pointer to FlexIO I2S audio data format structure. - * @param srcClock_Hz FlexIO I2S clock source frequency in Hz. It should be 0 while in slave mode. - */ -void FLEXIO_I2S_TransferSetFormatDMA(FLEXIO_I2S_Type *base, - flexio_i2s_dma_handle_t *handle, - flexio_i2s_format_t *format, - uint32_t srcClock_Hz); - -/*! - * @brief Performs a non-blocking FlexIO I2S transfer using DMA. - * - * @note This interface returns immediately after transfer initiates. Call - * FLEXIO_I2S_GetTransferStatus to poll the transfer status and check whether FLEXIO I2S transfer finished. - * - * @param base FlexIO I2S peripheral base address. - * @param handle FlexIO I2S DMA handle pointer. - * @param xfer Pointer to DMA transfer structure. - * @retval kStatus_Success Start a FlexIO I2S DMA send successfully. - * @retval kStatus_InvalidArgument The input arguments is invalid. - * @retval kStatus_TxBusy FlexIO I2S is busy sending data. - */ -status_t FLEXIO_I2S_TransferSendDMA(FLEXIO_I2S_Type *base, - flexio_i2s_dma_handle_t *handle, - flexio_i2s_transfer_t *xfer); - -/*! - * @brief Performs a non-blocking FlexIO I2S receive using DMA. - * - * @note This interface returns immediately after transfer initiates. Call - * FLEXIO_I2S_GetReceiveRemainingBytes to poll the transfer status to check whether the FlexIO I2S transfer is finished. - * - * @param base FlexIO I2S peripheral base address. - * @param handle FlexIO I2S DMA handle pointer. - * @param xfer Pointer to DMA transfer structure. - * @retval kStatus_Success Start a FlexIO I2S DMA receive successfully. - * @retval kStatus_InvalidArgument The input arguments is invalid. - * @retval kStatus_RxBusy FlexIO I2S is busy receiving data. - */ -status_t FLEXIO_I2S_TransferReceiveDMA(FLEXIO_I2S_Type *base, - flexio_i2s_dma_handle_t *handle, - flexio_i2s_transfer_t *xfer); - -/*! - * @brief Aborts a FlexIO I2S transfer using DMA. - * - * @param base FlexIO I2S peripheral base address. - * @param handle FlexIO I2S DMA handle pointer. - */ -void FLEXIO_I2S_TransferAbortSendDMA(FLEXIO_I2S_Type *base, flexio_i2s_dma_handle_t *handle); - -/*! - * @brief Aborts a FlexIO I2S receive using DMA. - * - * @param base FlexIO I2S peripheral base address. - * @param handle FlexIO I2S DMA handle pointer. - */ -void FLEXIO_I2S_TransferAbortReceiveDMA(FLEXIO_I2S_Type *base, flexio_i2s_dma_handle_t *handle); - -/*! - * @brief Gets the remaining bytes to be sent. - * - * @param base FlexIO I2S peripheral base address. - * @param handle FlexIO I2S DMA handle pointer. - * @param count Bytes sent. - * @retval kStatus_Success Succeed get the transfer count. - * @retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t FLEXIO_I2S_TransferGetSendCountDMA(FLEXIO_I2S_Type *base, flexio_i2s_dma_handle_t *handle, size_t *count); - -/*! - * @brief Gets the remaining bytes to be received. - * - * @param base FlexIO I2S peripheral base address. - * @param handle FlexIO I2S DMA handle pointer. - * @param count Bytes received. - * @retval kStatus_Success Succeed get the transfer count. - * @retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t FLEXIO_I2S_TransferGetReceiveCountDMA(FLEXIO_I2S_Type *base, flexio_i2s_dma_handle_t *handle, size_t *count); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ -#endif diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_spi.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_spi.c deleted file mode 100644 index eaf70de644e..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_spi.c +++ /dev/null @@ -1,1565 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020, 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio_spi.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio_spi" -#endif - -/*! @brief FLEXIO SPI transfer state, which is used for SPI transactiaonl APIs' internal state. */ -enum _flexio_spi_transfer_states -{ - kFLEXIO_SPI_Idle = 0x0U, /*!< Nothing in the transmitter/receiver's queue. */ - kFLEXIO_SPI_Busy, /*!< Transmiter/Receive's queue is not finished. */ -}; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Send a piece of data for SPI. - * - * This function computes the number of data to be written into D register or Tx FIFO, - * and write the data into it. At the same time, this function updates the values in - * master handle structure. - * - * @param base pointer to FLEXIO_SPI_Type structure - * @param handle Pointer to SPI master handle structure. - */ -static void FLEXIO_SPI_TransferSendTransaction(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle); - -/*! - * @brief Receive a piece of data for SPI master. - * - * This function computes the number of data to receive from D register or Rx FIFO, - * and write the data to destination address. At the same time, this function updates - * the values in master handle structure. - * - * @param base pointer to FLEXIO_SPI_Type structure - * @param handle Pointer to SPI master handle structure. - */ -static void FLEXIO_SPI_TransferReceiveTransaction(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle); - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Codes - ******************************************************************************/ - -static uint32_t FLEXIO_SPI_GetInstance(FLEXIO_SPI_Type *base) -{ - return FLEXIO_GetInstance(base->flexioBase); -} - -static void FLEXIO_SPI_TransferSendTransaction(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle) -{ - uint32_t tmpData = FLEXIO_SPI_DUMMYDATA; - - if (handle->txData != NULL) - { - /* Transmit data and update tx size/buff. */ - if (handle->bytePerFrame == 1U) - { - tmpData = (uint32_t) * (handle->txData); - handle->txData++; - } - else if (handle->bytePerFrame == 2U) - { - if (handle->direction == kFLEXIO_SPI_MsbFirst) - { - tmpData = (uint32_t)(handle->txData[0]) << 8U; - tmpData += (uint32_t)handle->txData[1]; - } - else - { - tmpData = (uint32_t)(handle->txData[1]) << 8U; - tmpData += (uint32_t)handle->txData[0]; - } - handle->txData += 2U; - } - else - { - if (handle->direction == kFLEXIO_SPI_MsbFirst) - { - tmpData = (uint32_t)(handle->txData[0]) << 24U; - tmpData += (uint32_t)(handle->txData[1]) << 16U; - tmpData += (uint32_t)(handle->txData[2]) << 8U; - tmpData += (uint32_t)handle->txData[3]; - } - else - { - tmpData = (uint32_t)(handle->txData[3]) << 24U; - tmpData += (uint32_t)(handle->txData[2]) << 16U; - tmpData += (uint32_t)(handle->txData[1]) << 8U; - tmpData += (uint32_t)handle->txData[0]; - } - handle->txData += 4U; - } - } - else - { - tmpData = FLEXIO_SPI_DUMMYDATA; - } - - handle->txRemainingBytes -= handle->bytePerFrame; - - FLEXIO_SPI_WriteData(base, handle->direction, tmpData); - - if (0U == handle->txRemainingBytes) - { - FLEXIO_SPI_DisableInterrupts(base, (uint32_t)kFLEXIO_SPI_TxEmptyInterruptEnable); - } -} - -static void FLEXIO_SPI_TransferReceiveTransaction(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle) -{ - uint32_t tmpData; - - tmpData = FLEXIO_SPI_ReadData(base, handle->direction); - - if (handle->rxData != NULL) - { - if (handle->bytePerFrame == 1U) - { - *handle->rxData = (uint8_t)tmpData; - } - else if (handle->bytePerFrame == 2U) - { - if (handle->direction == kFLEXIO_SPI_LsbFirst) - { - *handle->rxData = (uint8_t)(tmpData >> 8); - handle->rxData++; - *handle->rxData = (uint8_t)tmpData; - } - else - { - *handle->rxData = (uint8_t)tmpData; - handle->rxData++; - *handle->rxData = (uint8_t)(tmpData >> 8); - } - } - else - { - if (handle->direction == kFLEXIO_SPI_LsbFirst) - { - *handle->rxData = (uint8_t)(tmpData >> 24U); - handle->rxData++; - *handle->rxData = (uint8_t)(tmpData >> 16U); - handle->rxData++; - *handle->rxData = (uint8_t)(tmpData >> 8U); - handle->rxData++; - *handle->rxData = (uint8_t)tmpData; - } - else - { - *handle->rxData = (uint8_t)tmpData; - handle->rxData++; - *handle->rxData = (uint8_t)(tmpData >> 8U); - handle->rxData++; - *handle->rxData = (uint8_t)(tmpData >> 16U); - handle->rxData++; - *handle->rxData = (uint8_t)(tmpData >> 24U); - } - } - handle->rxData++; - } - handle->rxRemainingBytes -= handle->bytePerFrame; -} - -/*! - * brief Ungates the FlexIO clock, resets the FlexIO module, configures the FlexIO SPI master hardware, - * and configures the FlexIO SPI with FlexIO SPI master configuration. The - * configuration structure can be filled by the user, or be set with default values - * by the FLEXIO_SPI_MasterGetDefaultConfig(). - * - * note 1.FlexIO SPI master only support CPOL = 0, which means clock inactive low. - * 2.For FlexIO SPI master, the input valid time is 1.5 clock cycles, for slave the output valid time - * is 2.5 clock cycles. So if FlexIO SPI master communicates with other spi IPs, the maximum baud - * rate is FlexIO clock frequency divided by 2*2=4. If FlexIO SPI master communicates with FlexIO - * SPI slave, the maximum baud rate is FlexIO clock frequency divided by (1.5+2.5)*2=8. - * - * Example - code - FLEXIO_SPI_Type spiDev = { - .flexioBase = FLEXIO, - .SDOPinIndex = 0, - .SDIPinIndex = 1, - .SCKPinIndex = 2, - .CSnPinIndex = 3, - .shifterIndex = {0,1}, - .timerIndex = {0,1} - }; - flexio_spi_master_config_t config = { - .enableMaster = true, - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .baudRate_Bps = 500000, - .phase = kFLEXIO_SPI_ClockPhaseFirstEdge, - .direction = kFLEXIO_SPI_MsbFirst, - .dataMode = kFLEXIO_SPI_8BitMode - }; - FLEXIO_SPI_MasterInit(&spiDev, &config, srcClock_Hz); - endcode - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param masterConfig Pointer to the flexio_spi_master_config_t structure. - * param srcClock_Hz FlexIO source clock in Hz. -*/ -void FLEXIO_SPI_MasterInit(FLEXIO_SPI_Type *base, flexio_spi_master_config_t *masterConfig, uint32_t srcClock_Hz) -{ - assert(base != NULL); - assert(masterConfig != NULL); - - flexio_shifter_config_t shifterConfig; - flexio_timer_config_t timerConfig; - uint32_t ctrlReg = 0; - uint16_t timerDiv = 0; - uint16_t timerCmp = 0; - - /* Clear the shifterConfig & timerConfig struct. */ - (void)memset(&shifterConfig, 0, sizeof(shifterConfig)); - (void)memset(&timerConfig, 0, sizeof(timerConfig)); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate flexio clock. */ - CLOCK_EnableClock(s_flexioClocks[FLEXIO_SPI_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Configure FLEXIO SPI Master */ - ctrlReg = base->flexioBase->CTRL; - ctrlReg &= ~(FLEXIO_CTRL_DOZEN_MASK | FLEXIO_CTRL_DBGE_MASK | FLEXIO_CTRL_FASTACC_MASK | FLEXIO_CTRL_FLEXEN_MASK); - ctrlReg |= (FLEXIO_CTRL_DBGE(masterConfig->enableInDebug) | FLEXIO_CTRL_FASTACC(masterConfig->enableFastAccess) | - FLEXIO_CTRL_FLEXEN(masterConfig->enableMaster)); - if (!masterConfig->enableInDoze) - { - ctrlReg |= FLEXIO_CTRL_DOZEN_MASK; - } - - base->flexioBase->CTRL = ctrlReg; - - /* Do hardware configuration. */ - /* 1. Configure the shifter 0 for tx. */ - shifterConfig.timerSelect = base->timerIndex[0]; - shifterConfig.pinConfig = kFLEXIO_PinConfigOutput; - shifterConfig.pinSelect = base->SDOPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveHigh; - shifterConfig.shifterMode = kFLEXIO_ShifterModeTransmit; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - if (masterConfig->phase == kFLEXIO_SPI_ClockPhaseFirstEdge) - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnNegitive; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitDisable; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnEnable; - } - else - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitLow; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnShift; - } - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[0], &shifterConfig); - - /* 2. Configure the shifter 1 for rx. */ - shifterConfig.timerSelect = base->timerIndex[0]; - shifterConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - shifterConfig.pinSelect = base->SDIPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveHigh; - shifterConfig.shifterMode = kFLEXIO_ShifterModeReceive; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitDisable; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnEnable; - if (masterConfig->phase == kFLEXIO_SPI_ClockPhaseFirstEdge) - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive; - } - else - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnNegitive; - } - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[1], &shifterConfig); - - /*3. Configure the timer 0 for SCK. */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->shifterIndex[0]); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOutput; - timerConfig.pinSelect = base->SCKPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveHigh; - timerConfig.timerMode = kFLEXIO_TimerModeDual8BitBaudBit; - timerConfig.timerOutput = kFLEXIO_TimerOutputZeroNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput; - timerConfig.timerReset = kFLEXIO_TimerResetNever; - timerConfig.timerDisable = kFLEXIO_TimerDisableOnTimerCompare; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnTriggerHigh; - timerConfig.timerStop = kFLEXIO_TimerStopBitEnableOnTimerDisable; - timerConfig.timerStart = kFLEXIO_TimerStartBitEnabled; - /* Low 8-bits are used to configure baudrate. */ - timerDiv = (uint16_t)(srcClock_Hz / masterConfig->baudRate_Bps); - timerDiv = timerDiv / 2U - 1U; - /* High 8-bits are used to configure shift clock edges(transfer width). */ - timerCmp = ((uint16_t)masterConfig->dataMode * 2U - 1U) << 8U; - timerCmp |= timerDiv; - - timerConfig.timerCompare = timerCmp; - - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[0], &timerConfig); - - /* 4. Configure the timer 1 for CSn. */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_TIMn(base->timerIndex[0]); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveHigh; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOutput; - timerConfig.pinSelect = base->CSnPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveLow; - timerConfig.timerMode = kFLEXIO_TimerModeSingle16Bit; - timerConfig.timerOutput = kFLEXIO_TimerOutputOneNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput; - timerConfig.timerReset = kFLEXIO_TimerResetNever; - timerConfig.timerDisable = kFLEXIO_TimerDisableOnPreTimerDisable; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnPrevTimerEnable; - timerConfig.timerStop = kFLEXIO_TimerStopBitDisabled; - timerConfig.timerStart = kFLEXIO_TimerStartBitDisabled; - - timerConfig.timerCompare = 0xFFFFU; /* Never compare. */ - - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[1], &timerConfig); -} - -/*! - * brief Resets the FlexIO SPI timer and shifter config. - * - * param base Pointer to the FLEXIO_SPI_Type. - */ -void FLEXIO_SPI_MasterDeinit(FLEXIO_SPI_Type *base) -{ - base->flexioBase->SHIFTCFG[base->shifterIndex[0]] = 0; - base->flexioBase->SHIFTCTL[base->shifterIndex[0]] = 0; - base->flexioBase->SHIFTCFG[base->shifterIndex[1]] = 0; - base->flexioBase->SHIFTCTL[base->shifterIndex[1]] = 0; - base->flexioBase->TIMCFG[base->timerIndex[0]] = 0; - base->flexioBase->TIMCMP[base->timerIndex[0]] = 0; - base->flexioBase->TIMCTL[base->timerIndex[0]] = 0; - base->flexioBase->TIMCFG[base->timerIndex[1]] = 0; - base->flexioBase->TIMCMP[base->timerIndex[1]] = 0; - base->flexioBase->TIMCTL[base->timerIndex[1]] = 0; -} - -/*! - * brief Gets the default configuration to configure the FlexIO SPI master. The configuration - * can be used directly by calling the FLEXIO_SPI_MasterConfigure(). - * Example: - code - flexio_spi_master_config_t masterConfig; - FLEXIO_SPI_MasterGetDefaultConfig(&masterConfig); - endcode - * param masterConfig Pointer to the flexio_spi_master_config_t structure. -*/ -void FLEXIO_SPI_MasterGetDefaultConfig(flexio_spi_master_config_t *masterConfig) -{ - assert(masterConfig != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(masterConfig, 0, sizeof(*masterConfig)); - - masterConfig->enableMaster = true; - masterConfig->enableInDoze = false; - masterConfig->enableInDebug = true; - masterConfig->enableFastAccess = false; - /* Default baud rate 500kbps. */ - masterConfig->baudRate_Bps = 500000U; - /* Default CPHA = 0. */ - masterConfig->phase = kFLEXIO_SPI_ClockPhaseFirstEdge; - /* Default bit count at 8. */ - masterConfig->dataMode = kFLEXIO_SPI_8BitMode; -} - -/*! - * brief Ungates the FlexIO clock, resets the FlexIO module, configures the FlexIO SPI slave hardware - * configuration, and configures the FlexIO SPI with FlexIO SPI slave configuration. The - * configuration structure can be filled by the user, or be set with default values - * by the FLEXIO_SPI_SlaveGetDefaultConfig(). - * - * note 1.Only one timer is needed in the FlexIO SPI slave. As a result, the second timer index is ignored. - * 2.FlexIO SPI slave only support CPOL = 0, which means clock inactive low. - * 3.For FlexIO SPI master, the input valid time is 1.5 clock cycles, for slave the output valid time - * is 2.5 clock cycles. So if FlexIO SPI slave communicates with other spi IPs, the maximum baud - * rate is FlexIO clock frequency divided by 3*2=6. If FlexIO SPI slave communicates with FlexIO - * SPI master, the maximum baud rate is FlexIO clock frequency divided by (1.5+2.5)*2=8. - * Example - code - FLEXIO_SPI_Type spiDev = { - .flexioBase = FLEXIO, - .SDOPinIndex = 0, - .SDIPinIndex = 1, - .SCKPinIndex = 2, - .CSnPinIndex = 3, - .shifterIndex = {0,1}, - .timerIndex = {0} - }; - flexio_spi_slave_config_t config = { - .enableSlave = true, - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .phase = kFLEXIO_SPI_ClockPhaseFirstEdge, - .direction = kFLEXIO_SPI_MsbFirst, - .dataMode = kFLEXIO_SPI_8BitMode - }; - FLEXIO_SPI_SlaveInit(&spiDev, &config); - endcode - * param base Pointer to the FLEXIO_SPI_Type structure. - * param slaveConfig Pointer to the flexio_spi_slave_config_t structure. -*/ -void FLEXIO_SPI_SlaveInit(FLEXIO_SPI_Type *base, flexio_spi_slave_config_t *slaveConfig) -{ - assert((base != NULL) && (slaveConfig != NULL)); - - flexio_shifter_config_t shifterConfig; - flexio_timer_config_t timerConfig; - uint32_t ctrlReg = 0; - - /* Clear the shifterConfig & timerConfig struct. */ - (void)memset(&shifterConfig, 0, sizeof(shifterConfig)); - (void)memset(&timerConfig, 0, sizeof(timerConfig)); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate flexio clock. */ - CLOCK_EnableClock(s_flexioClocks[FLEXIO_SPI_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Configure FLEXIO SPI Slave */ - ctrlReg = base->flexioBase->CTRL; - ctrlReg &= ~(FLEXIO_CTRL_DOZEN_MASK | FLEXIO_CTRL_DBGE_MASK | FLEXIO_CTRL_FASTACC_MASK | FLEXIO_CTRL_FLEXEN_MASK); - ctrlReg |= (FLEXIO_CTRL_DBGE(slaveConfig->enableInDebug) | FLEXIO_CTRL_FASTACC(slaveConfig->enableFastAccess) | - FLEXIO_CTRL_FLEXEN(slaveConfig->enableSlave)); - if (!slaveConfig->enableInDoze) - { - ctrlReg |= FLEXIO_CTRL_DOZEN_MASK; - } - - base->flexioBase->CTRL = ctrlReg; - - /* Do hardware configuration. */ - /* 1. Configure the shifter 0 for tx. */ - shifterConfig.timerSelect = base->timerIndex[0]; - shifterConfig.pinConfig = kFLEXIO_PinConfigOutput; - shifterConfig.pinSelect = base->SDOPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveHigh; - shifterConfig.shifterMode = kFLEXIO_ShifterModeTransmit; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitDisable; - if (slaveConfig->phase == kFLEXIO_SPI_ClockPhaseFirstEdge) - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnNegitive; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnEnable; - } - else - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnShift; - } - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[0], &shifterConfig); - - /* 2. Configure the shifter 1 for rx. */ - shifterConfig.timerSelect = base->timerIndex[0]; - shifterConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - shifterConfig.pinSelect = base->SDIPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveHigh; - shifterConfig.shifterMode = kFLEXIO_ShifterModeReceive; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitDisable; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnEnable; - if (slaveConfig->phase == kFLEXIO_SPI_ClockPhaseFirstEdge) - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive; - } - else - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnNegitive; - } - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[1], &shifterConfig); - - /*3. Configure the timer 0 for shift clock. */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_PININPUT(base->CSnPinIndex); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - timerConfig.pinSelect = base->SCKPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveHigh; - timerConfig.timerMode = kFLEXIO_TimerModeSingle16Bit; - timerConfig.timerOutput = kFLEXIO_TimerOutputZeroNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnPinInputShiftPinInput; - timerConfig.timerReset = kFLEXIO_TimerResetNever; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnTriggerRisingEdge; - timerConfig.timerStop = kFLEXIO_TimerStopBitDisabled; - if (slaveConfig->phase == kFLEXIO_SPI_ClockPhaseFirstEdge) - { - timerConfig.timerDisable = kFLEXIO_TimerDisableOnTimerCompare; - timerConfig.timerStart = kFLEXIO_TimerStartBitDisabled; - } - else - { - timerConfig.timerDisable = kFLEXIO_TimerDisableOnTriggerFallingEdge; - timerConfig.timerStart = kFLEXIO_TimerStartBitEnabled; - } - - timerConfig.timerCompare = (uint32_t)slaveConfig->dataMode * 2U - 1U; - - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[0], &timerConfig); -} - -/*! - * brief Gates the FlexIO clock. - * - * param base Pointer to the FLEXIO_SPI_Type. - */ -void FLEXIO_SPI_SlaveDeinit(FLEXIO_SPI_Type *base) -{ - FLEXIO_SPI_MasterDeinit(base); -} - -/*! - * brief Gets the default configuration to configure the FlexIO SPI slave. The configuration - * can be used directly for calling the FLEXIO_SPI_SlaveConfigure(). - * Example: - code - flexio_spi_slave_config_t slaveConfig; - FLEXIO_SPI_SlaveGetDefaultConfig(&slaveConfig); - endcode - * param slaveConfig Pointer to the flexio_spi_slave_config_t structure. -*/ -void FLEXIO_SPI_SlaveGetDefaultConfig(flexio_spi_slave_config_t *slaveConfig) -{ - assert(slaveConfig != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(slaveConfig, 0, sizeof(*slaveConfig)); - - slaveConfig->enableSlave = true; - slaveConfig->enableInDoze = false; - slaveConfig->enableInDebug = true; - slaveConfig->enableFastAccess = false; - /* Default CPHA = 0. */ - slaveConfig->phase = kFLEXIO_SPI_ClockPhaseFirstEdge; - /* Default bit count at 8. */ - slaveConfig->dataMode = kFLEXIO_SPI_8BitMode; -} - -/*! - * brief Enables the FlexIO SPI interrupt. - * - * This function enables the FlexIO SPI interrupt. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param mask interrupt source. The parameter can be any combination of the following values: - * arg kFLEXIO_SPI_RxFullInterruptEnable - * arg kFLEXIO_SPI_TxEmptyInterruptEnable - */ -void FLEXIO_SPI_EnableInterrupts(FLEXIO_SPI_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_SPI_TxEmptyInterruptEnable) != 0U) - { - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_SPI_RxFullInterruptEnable) != 0U) - { - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Disables the FlexIO SPI interrupt. - * - * This function disables the FlexIO SPI interrupt. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param mask interrupt source The parameter can be any combination of the following values: - * arg kFLEXIO_SPI_RxFullInterruptEnable - * arg kFLEXIO_SPI_TxEmptyInterruptEnable - */ -void FLEXIO_SPI_DisableInterrupts(FLEXIO_SPI_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_SPI_TxEmptyInterruptEnable) != 0U) - { - FLEXIO_DisableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_SPI_RxFullInterruptEnable) != 0U) - { - FLEXIO_DisableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Enables/disables the FlexIO SPI transmit DMA. This function enables/disables the FlexIO SPI Tx DMA, - * which means that asserting the kFLEXIO_SPI_TxEmptyFlag does/doesn't trigger the DMA request. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param mask SPI DMA source. - * param enable True means enable DMA, false means disable DMA. - */ -void FLEXIO_SPI_EnableDMA(FLEXIO_SPI_Type *base, uint32_t mask, bool enable) -{ - if ((mask & (uint32_t)kFLEXIO_SPI_TxDmaEnable) != 0U) - { - FLEXIO_EnableShifterStatusDMA(base->flexioBase, 1UL << base->shifterIndex[0], enable); - } - - if ((mask & (uint32_t)kFLEXIO_SPI_RxDmaEnable) != 0U) - { - FLEXIO_EnableShifterStatusDMA(base->flexioBase, 1UL << base->shifterIndex[1], enable); - } -} - -/*! - * brief Gets FlexIO SPI status flags. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * return status flag; Use the status flag to AND the following flag mask and get the status. - * arg kFLEXIO_SPI_TxEmptyFlag - * arg kFLEXIO_SPI_RxEmptyFlag - */ - -uint32_t FLEXIO_SPI_GetStatusFlags(FLEXIO_SPI_Type *base) -{ - uint32_t shifterStatus = FLEXIO_GetShifterStatusFlags(base->flexioBase); - uint32_t status = 0; - - status = ((shifterStatus & (1UL << base->shifterIndex[0])) >> base->shifterIndex[0]); - status |= (((shifterStatus & (1UL << base->shifterIndex[1])) >> (base->shifterIndex[1])) << 1U); - - return status; -} - -/*! - * brief Clears FlexIO SPI status flags. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param mask status flag - * The parameter can be any combination of the following values: - * arg kFLEXIO_SPI_TxEmptyFlag - * arg kFLEXIO_SPI_RxEmptyFlag - */ - -void FLEXIO_SPI_ClearStatusFlags(FLEXIO_SPI_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag) != 0U) - { - FLEXIO_ClearShifterStatusFlags(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_SPI_RxBufferFullFlag) != 0U) - { - FLEXIO_ClearShifterStatusFlags(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Sets baud rate for the FlexIO SPI transfer, which is only used for the master. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param baudRate_Bps Baud Rate needed in Hz. - * param srcClockHz SPI source clock frequency in Hz. - */ -void FLEXIO_SPI_MasterSetBaudRate(FLEXIO_SPI_Type *base, uint32_t baudRate_Bps, uint32_t srcClockHz) -{ - uint16_t timerDiv = 0; - uint16_t timerCmp = 0; - FLEXIO_Type *flexioBase = base->flexioBase; - - /* Set TIMCMP[7:0] = (baud rate divider / 2) - 1.*/ - timerDiv = (uint16_t)(srcClockHz / baudRate_Bps); - timerDiv = timerDiv / 2U - 1U; - - timerCmp = (uint16_t)(flexioBase->TIMCMP[base->timerIndex[0]]); - timerCmp &= 0xFF00U; - timerCmp |= timerDiv; - - flexioBase->TIMCMP[base->timerIndex[0]] = timerCmp; -} - -/*! - * brief Sends a buffer of data bytes. - * - * note This function blocks using the polling method until all bytes have been sent. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param direction Shift direction of MSB first or LSB first. - * param buffer The data bytes to send. - * param size The number of data bytes to send. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_FLEXIO_SPI_Timeout The transfer timed out and was aborted. - */ -status_t FLEXIO_SPI_WriteBlocking(FLEXIO_SPI_Type *base, - flexio_spi_shift_direction_t direction, - const uint8_t *buffer, - size_t size) -{ - assert(buffer != NULL); - assert(size != 0U); - -#if SPI_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != size--) - { - /* Wait until data transfer complete. */ -#if SPI_RETRY_TIMES - waitTimes = SPI_RETRY_TIMES; - while ((0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag)) && - (0U != --waitTimes)) -#else - while (0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag)) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return kStatus_FLEXIO_SPI_Timeout; - } -#endif - FLEXIO_SPI_WriteData(base, direction, *buffer++); - } - - return kStatus_Success; -} - -/*! - * brief Receives a buffer of bytes. - * - * note This function blocks using the polling method until all bytes have been received. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param direction Shift direction of MSB first or LSB first. - * param buffer The buffer to store the received bytes. - * param size The number of data bytes to be received. - * param direction Shift direction of MSB first or LSB first. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_FLEXIO_SPI_Timeout The transfer timed out and was aborted. - */ -status_t FLEXIO_SPI_ReadBlocking(FLEXIO_SPI_Type *base, - flexio_spi_shift_direction_t direction, - uint8_t *buffer, - size_t size) -{ - assert(buffer != NULL); - assert(size != 0U); - -#if SPI_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != size--) - { - /* Wait until data transfer complete. */ -#if SPI_RETRY_TIMES - waitTimes = SPI_RETRY_TIMES; - while ((0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_RxBufferFullFlag)) && - (0U != --waitTimes)) -#else - while (0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_RxBufferFullFlag)) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return kStatus_FLEXIO_SPI_Timeout; - } -#endif - *buffer++ = (uint8_t)FLEXIO_SPI_ReadData(base, direction); - } - - return kStatus_Success; -} - -/*! - * brief Receives a buffer of bytes. - * - * note This function blocks via polling until all bytes have been received. - * - * param base pointer to FLEXIO_SPI_Type structure - * param xfer FlexIO SPI transfer structure, see #flexio_spi_transfer_t. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_FLEXIO_SPI_Timeout The transfer timed out and was aborted. - */ -status_t FLEXIO_SPI_MasterTransferBlocking(FLEXIO_SPI_Type *base, flexio_spi_transfer_t *xfer) -{ - flexio_spi_shift_direction_t direction; - uint8_t bytesPerFrame; - uint32_t dataMode = 0; - uint16_t timerCmp = (uint16_t)(base->flexioBase->TIMCMP[base->timerIndex[0]]); - uint32_t tmpData = FLEXIO_SPI_DUMMYDATA; - uint8_t dataFormat = FLEXIO_SPI_XFER_DATA_FORMAT(xfer->flags); -#if SPI_RETRY_TIMES - uint32_t waitTimes; -#endif - - timerCmp &= 0x00FFU; - - if ((xfer->flags & (uint8_t)kFLEXIO_SPI_csContinuous) != 0U) - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TSTOP_MASK) | - FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitDisabled); - } - else - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TSTOP_MASK) | - FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitEnableOnTimerDisable); - } - - /* Configure the values in handle. */ - switch (dataFormat) - { - case (uint8_t)kFLEXIO_SPI_8bitMsb: - dataMode = (8UL * 2UL - 1UL) << 8U; - bytesPerFrame = 1U; - direction = kFLEXIO_SPI_MsbFirst; - break; - - case (uint8_t)kFLEXIO_SPI_8bitLsb: - dataMode = (8UL * 2UL - 1UL) << 8U; - bytesPerFrame = 1U; - direction = kFLEXIO_SPI_LsbFirst; - break; - - case (uint8_t)kFLEXIO_SPI_16bitMsb: - dataMode = (16UL * 2UL - 1UL) << 8U; - bytesPerFrame = 2U; - direction = kFLEXIO_SPI_MsbFirst; - break; - - case (uint8_t)kFLEXIO_SPI_16bitLsb: - dataMode = (16UL * 2UL - 1UL) << 8U; - bytesPerFrame = 2U; - direction = kFLEXIO_SPI_LsbFirst; - break; - - case (uint8_t)kFLEXIO_SPI_32bitMsb: - dataMode = (32UL * 2UL - 1UL) << 8U; - bytesPerFrame = 4U; - direction = kFLEXIO_SPI_MsbFirst; - break; - - case (uint8_t)kFLEXIO_SPI_32bitLsb: - dataMode = (32UL * 2UL - 1UL) << 8U; - bytesPerFrame = 4U; - direction = kFLEXIO_SPI_LsbFirst; - break; - - default: - dataMode = (8UL * 2UL - 1UL) << 8U; - bytesPerFrame = 1U; - direction = kFLEXIO_SPI_MsbFirst; - assert(true); - break; - } - - dataMode |= timerCmp; - - /* Transfer size should be bytesPerFrame divisible. */ - if ((xfer->dataSize % bytesPerFrame) != 0U) - { - return kStatus_InvalidArgument; - } - - /* Configure transfer size. */ - base->flexioBase->TIMCMP[base->timerIndex[0]] = dataMode; - - while (xfer->dataSize != 0U) - { - /* Wait until data transfer complete. */ -#if SPI_RETRY_TIMES - waitTimes = SPI_RETRY_TIMES; - while ((0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag)) && - (0U != --waitTimes)) -#else - while (0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag)) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return kStatus_FLEXIO_SPI_Timeout; - } -#endif - if (xfer->txData != NULL) - { - /* Transmit data and update tx size/buff. */ - if (bytesPerFrame == 1U) - { - tmpData = (uint32_t) * (xfer->txData); - xfer->txData++; - } - else if (bytesPerFrame == 2U) - { - if (direction == kFLEXIO_SPI_MsbFirst) - { - tmpData = (uint32_t)(xfer->txData[0]) << 8U; - tmpData += (uint32_t)xfer->txData[1]; - } - else - { - tmpData = (uint32_t)(xfer->txData[1]) << 8U; - tmpData += (uint32_t)xfer->txData[0]; - } - xfer->txData += 2U; - } - else - { - if (direction == kFLEXIO_SPI_MsbFirst) - { - tmpData = (uint32_t)(xfer->txData[0]) << 24U; - tmpData += (uint32_t)(xfer->txData[1]) << 16U; - tmpData += (uint32_t)(xfer->txData[2]) << 8U; - tmpData += (uint32_t)xfer->txData[3]; - } - else - { - tmpData = (uint32_t)(xfer->txData[3]) << 24U; - tmpData += (uint32_t)(xfer->txData[2]) << 16U; - tmpData += (uint32_t)(xfer->txData[1]) << 8U; - tmpData += (uint32_t)xfer->txData[0]; - } - xfer->txData += 4U; - } - } - else - { - tmpData = FLEXIO_SPI_DUMMYDATA; - } - - xfer->dataSize -= bytesPerFrame; - - FLEXIO_SPI_WriteData(base, direction, tmpData); - -#if SPI_RETRY_TIMES - waitTimes = SPI_RETRY_TIMES; - while ((0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_RxBufferFullFlag)) && - (0U != --waitTimes)) -#else - while (0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_RxBufferFullFlag)) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return kStatus_FLEXIO_SPI_Timeout; - } -#endif - tmpData = FLEXIO_SPI_ReadData(base, direction); - - if (xfer->rxData != NULL) - { - if (bytesPerFrame == 1U) - { - *xfer->rxData = (uint8_t)tmpData; - } - else if (bytesPerFrame == 2U) - { - if (direction == kFLEXIO_SPI_LsbFirst) - { - *xfer->rxData = (uint8_t)(tmpData >> 8); - xfer->rxData++; - *xfer->rxData = (uint8_t)tmpData; - } - else - { - *xfer->rxData = (uint8_t)tmpData; - xfer->rxData++; - *xfer->rxData = (uint8_t)(tmpData >> 8); - } - } - else - { - if (direction == kFLEXIO_SPI_LsbFirst) - { - *xfer->rxData = (uint8_t)(tmpData >> 24U); - xfer->rxData++; - *xfer->rxData = (uint8_t)(tmpData >> 16U); - xfer->rxData++; - *xfer->rxData = (uint8_t)(tmpData >> 8U); - xfer->rxData++; - *xfer->rxData = (uint8_t)tmpData; - } - else - { - *xfer->rxData = (uint8_t)tmpData; - xfer->rxData++; - *xfer->rxData = (uint8_t)(tmpData >> 8U); - xfer->rxData++; - *xfer->rxData = (uint8_t)(tmpData >> 16U); - xfer->rxData++; - *xfer->rxData = (uint8_t)(tmpData >> 24U); - } - } - xfer->rxData++; - } - } - - return kStatus_Success; -} - -/*! - * brief Initializes the FlexIO SPI Master handle, which is used in transactional functions. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - * param callback The callback function. - * param userData The parameter of the callback function. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_SPI_MasterTransferCreateHandle(FLEXIO_SPI_Type *base, - flexio_spi_master_handle_t *handle, - flexio_spi_master_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - IRQn_Type flexio_irqs[] = FLEXIO_IRQS; - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Register callback and userData. */ - handle->callback = callback; - handle->userData = userData; - - /* Clear pending NVIC IRQ before enable NVIC IRQ. */ - NVIC_ClearPendingIRQ(flexio_irqs[FLEXIO_SPI_GetInstance(base)]); - /* Enable interrupt in NVIC. */ - (void)EnableIRQ(flexio_irqs[FLEXIO_SPI_GetInstance(base)]); - - /* Save the context in global variables to support the double weak mechanism. */ - return FLEXIO_RegisterHandleIRQ(base, handle, FLEXIO_SPI_MasterTransferHandleIRQ); -} - -/*! - * brief Master transfer data using IRQ. - * - * This function sends data using IRQ. This is a non-blocking function, which returns - * right away. When all data is sent out/received, the callback function is called. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - * param xfer FlexIO SPI transfer structure. See #flexio_spi_transfer_t. - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_InvalidArgument Input argument is invalid. - * retval kStatus_FLEXIO_SPI_Busy SPI is not idle, is running another transfer. - */ -status_t FLEXIO_SPI_MasterTransferNonBlocking(FLEXIO_SPI_Type *base, - flexio_spi_master_handle_t *handle, - flexio_spi_transfer_t *xfer) -{ - assert(handle != NULL); - assert(xfer != NULL); - - uint32_t dataMode = 0; - uint16_t timerCmp = (uint16_t)base->flexioBase->TIMCMP[base->timerIndex[0]]; - uint32_t tmpData = FLEXIO_SPI_DUMMYDATA; - uint8_t dataFormat = FLEXIO_SPI_XFER_DATA_FORMAT(xfer->flags); - - timerCmp &= 0x00FFU; - - /* Check if SPI is busy. */ - if (handle->state == (uint32_t)kFLEXIO_SPI_Busy) - { - return kStatus_FLEXIO_SPI_Busy; - } - - /* Check if the argument is legal. */ - if ((xfer->txData == NULL) && (xfer->rxData == NULL)) - { - return kStatus_InvalidArgument; - } - - /* Timer1 controls the CS signal which enables/disables(asserts/deasserts) when timer0 enable/disable. Timer0 - enables when tx shifter is written and disables when timer compare. The timer compare event causes the - transmit shift registers to load which generates a tx register empty event. Since when timer stop bit is - disabled, a timer enable condition can be detected in the same cycle as a timer disable condition, so if - software writes the tx register upon the detection of tx register empty event, the timer enable condition - is triggered again, then the CS signal can remain low until software no longer writes the tx register. */ - if ((xfer->flags & (uint8_t)kFLEXIO_SPI_csContinuous) != 0U) - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TSTOP_MASK) | - FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitDisabled); - } - else - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TSTOP_MASK) | - FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitEnableOnTimerDisable); - } - - /* Configure the values in handle */ - switch (dataFormat) - { - case (uint8_t)kFLEXIO_SPI_8bitMsb: - dataMode = (8UL * 2UL - 1UL) << 8U; - handle->bytePerFrame = 1U; - handle->direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_8bitLsb: - dataMode = (8UL * 2UL - 1UL) << 8U; - handle->bytePerFrame = 1U; - handle->direction = kFLEXIO_SPI_LsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_16bitMsb: - dataMode = (16UL * 2UL - 1UL) << 8U; - handle->bytePerFrame = 2U; - handle->direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_16bitLsb: - dataMode = (16UL * 2UL - 1UL) << 8U; - handle->bytePerFrame = 2U; - handle->direction = kFLEXIO_SPI_LsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_32bitMsb: - dataMode = (32UL * 2UL - 1UL) << 8U; - handle->bytePerFrame = 4U; - handle->direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_32bitLsb: - dataMode = (32UL * 2UL - 1UL) << 8U; - handle->bytePerFrame = 4U; - handle->direction = kFLEXIO_SPI_LsbFirst; - break; - default: - dataMode = (8UL * 2UL - 1UL) << 8U; - handle->bytePerFrame = 1U; - handle->direction = kFLEXIO_SPI_MsbFirst; - assert(true); - break; - } - - dataMode |= timerCmp; - - /* Transfer size should be bytesPerFrame divisible. */ - if ((xfer->dataSize % handle->bytePerFrame) != 0U) - { - return kStatus_InvalidArgument; - } - - /* Configure transfer size. */ - base->flexioBase->TIMCMP[base->timerIndex[0]] = dataMode; - - handle->state = (uint32_t)kFLEXIO_SPI_Busy; - handle->txData = xfer->txData; - handle->rxData = xfer->rxData; - handle->rxRemainingBytes = xfer->dataSize; - - /* Save total transfer size. */ - handle->transferSize = xfer->dataSize; - - /* Send first byte of data to trigger the rx interrupt. */ - if (handle->txData != NULL) - { - /* Transmit data and update tx size/buff. */ - if (handle->bytePerFrame == 1U) - { - tmpData = (uint32_t) * (handle->txData); - handle->txData++; - } - else if (handle->bytePerFrame == 2U) - { - if (handle->direction == kFLEXIO_SPI_MsbFirst) - { - tmpData = (uint32_t)(handle->txData[0]) << 8U; - tmpData += (uint32_t)handle->txData[1]; - } - else - { - tmpData = (uint32_t)(handle->txData[1]) << 8U; - tmpData += (uint32_t)handle->txData[0]; - } - handle->txData += 2U; - } - else - { - if (handle->direction == kFLEXIO_SPI_MsbFirst) - { - tmpData = (uint32_t)(handle->txData[0]) << 24U; - tmpData += (uint32_t)(handle->txData[1]) << 16U; - tmpData += (uint32_t)(handle->txData[2]) << 8U; - tmpData += (uint32_t)handle->txData[3]; - } - else - { - tmpData = (uint32_t)(handle->txData[3]) << 24U; - tmpData += (uint32_t)(handle->txData[2]) << 16U; - tmpData += (uint32_t)(handle->txData[1]) << 8U; - tmpData += (uint32_t)handle->txData[0]; - } - handle->txData += 4U; - } - } - else - { - tmpData = FLEXIO_SPI_DUMMYDATA; - } - - handle->txRemainingBytes = xfer->dataSize - handle->bytePerFrame; - - FLEXIO_SPI_WriteData(base, handle->direction, tmpData); - - /* Enable transmit and receive interrupt to handle rx. */ - FLEXIO_SPI_EnableInterrupts(base, (uint32_t)kFLEXIO_SPI_RxFullInterruptEnable); - - if ((xfer->flags & (uint8_t)kFLEXIO_SPI_csContinuous) != 0U) - { - FLEXIO_SPI_EnableInterrupts(base, (uint32_t)kFLEXIO_SPI_TxEmptyInterruptEnable); - } - - return kStatus_Success; -} - -/*! - * brief Gets the data transfer status which used IRQ. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - * param count Number of bytes transferred so far by the non-blocking transaction. - * retval kStatus_InvalidArgument count is Invalid. - * retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_SPI_MasterTransferGetCount(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Return remaing bytes in different cases. */ - if (handle->rxData != NULL) - { - *count = handle->transferSize - handle->rxRemainingBytes; - } - else - { - *count = handle->transferSize - handle->txRemainingBytes; - } - - return kStatus_Success; -} - -/*! - * brief Aborts the master data transfer, which used IRQ. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - */ -void FLEXIO_SPI_MasterTransferAbort(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle) -{ - assert(handle != NULL); - - FLEXIO_SPI_DisableInterrupts(base, (uint32_t)kFLEXIO_SPI_RxFullInterruptEnable); - FLEXIO_SPI_DisableInterrupts(base, (uint32_t)kFLEXIO_SPI_TxEmptyInterruptEnable); - - /* Transfer finished, set the state to idle. */ - handle->state = (uint32_t)kFLEXIO_SPI_Idle; - - /* Clear the internal state. */ - handle->rxRemainingBytes = 0; - handle->txRemainingBytes = 0; -} - -/*! - * brief FlexIO SPI master IRQ handler function. - * - * param spiType Pointer to the FLEXIO_SPI_Type structure. - * param spiHandle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - */ -void FLEXIO_SPI_MasterTransferHandleIRQ(void *spiType, void *spiHandle) -{ - assert(spiHandle != NULL); - - flexio_spi_master_handle_t *handle = (flexio_spi_master_handle_t *)spiHandle; - FLEXIO_SPI_Type *base; - uint32_t status; - - if (handle->state == (uint32_t)kFLEXIO_SPI_Idle) - { - return; - } - - base = (FLEXIO_SPI_Type *)spiType; - status = FLEXIO_SPI_GetStatusFlags(base); - - /* Receive interrupt. */ - if ((status & (uint32_t)kFLEXIO_SPI_RxBufferFullFlag) == 0U) - { - FLEXIO_SPI_TransferSendTransaction(base, handle); - return; - } - - /* Handle rx. */ - if (handle->rxRemainingBytes != 0U) - { - FLEXIO_SPI_TransferReceiveTransaction(base, handle); - } - - /* Handle tx. */ - if (((status & (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag) != 0U) && (handle->txRemainingBytes != 0U)) - { - FLEXIO_SPI_TransferSendTransaction(base, handle); - } - - /* All the transfer finished. */ - if ((handle->txRemainingBytes == 0U) && (handle->rxRemainingBytes == 0U)) - { - FLEXIO_SPI_MasterTransferAbort(base, handle); - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_FLEXIO_SPI_Idle, handle->userData); - } - } -} - -/*! - * brief Initializes the FlexIO SPI Slave handle, which is used in transactional functions. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param handle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - * param callback The callback function. - * param userData The parameter of the callback function. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_SPI_SlaveTransferCreateHandle(FLEXIO_SPI_Type *base, - flexio_spi_slave_handle_t *handle, - flexio_spi_slave_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - IRQn_Type flexio_irqs[] = FLEXIO_IRQS; - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Register callback and userData. */ - handle->callback = callback; - handle->userData = userData; - - /* Clear pending NVIC IRQ before enable NVIC IRQ. */ - NVIC_ClearPendingIRQ(flexio_irqs[FLEXIO_SPI_GetInstance(base)]); - /* Enable interrupt in NVIC. */ - (void)EnableIRQ(flexio_irqs[FLEXIO_SPI_GetInstance(base)]); - - /* Save the context in global variables to support the double weak mechanism. */ - return FLEXIO_RegisterHandleIRQ(base, handle, FLEXIO_SPI_SlaveTransferHandleIRQ); -} - -/*! - * brief Slave transfer data using IRQ. - * - * This function sends data using IRQ. This is a non-blocking function, which returns - * right away. When all data is sent out/received, the callback function is called. - * param handle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param xfer FlexIO SPI transfer structure. See #flexio_spi_transfer_t. - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_InvalidArgument Input argument is invalid. - * retval kStatus_FLEXIO_SPI_Busy SPI is not idle; it is running another transfer. - */ -status_t FLEXIO_SPI_SlaveTransferNonBlocking(FLEXIO_SPI_Type *base, - flexio_spi_slave_handle_t *handle, - flexio_spi_transfer_t *xfer) -{ - assert(handle != NULL); - assert(xfer != NULL); - - uint32_t dataMode = 0; - uint8_t dataFormat = FLEXIO_SPI_XFER_DATA_FORMAT(xfer->flags); - - /* Check if SPI is busy. */ - if (handle->state == (uint32_t)kFLEXIO_SPI_Busy) - { - return kStatus_FLEXIO_SPI_Busy; - } - - /* Check if the argument is legal. */ - if ((xfer->txData == NULL) && (xfer->rxData == NULL)) - { - return kStatus_InvalidArgument; - } - - /* SCK timer use CS pin as inverted trigger so timer should be disbaled on trigger falling edge(CS re-asserts). */ - /* However if CPHA is first edge mode, timer will restart each time right after timer compare event occur and - before CS pin re-asserts, which triggers another shifter load. To avoid this, when in CS dis-continuous mode, - timer should disable in timer compare rather than trigger falling edge(CS re-asserts), and in CS continuous mode, - tx/rx shifters should be flushed after transfer finishes and before next transfer starts. */ - FLEXIO_SPI_FlushShifters(base); - if ((xfer->flags & (uint8_t)kFLEXIO_SPI_csContinuous) != 0U) - { - base->flexioBase->TIMCFG[base->timerIndex[0]] |= FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTriggerFallingEdge); - } - else - { - if ((base->flexioBase->SHIFTCTL[base->shifterIndex[0]] & FLEXIO_SHIFTCTL_TIMPOL_MASK) == - FLEXIO_SHIFTCTL_TIMPOL(kFLEXIO_ShifterTimerPolarityOnNegitive)) - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TIMDIS_MASK) | - FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTimerCompare); - } - else - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TIMDIS_MASK) | - FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTriggerFallingEdge); - } - } - - /* Configure the values in handle */ - switch (dataFormat) - { - case (uint8_t)kFLEXIO_SPI_8bitMsb: - dataMode = 8U * 2U - 1U; - handle->bytePerFrame = 1U; - handle->direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_8bitLsb: - dataMode = 8U * 2U - 1U; - handle->bytePerFrame = 1U; - handle->direction = kFLEXIO_SPI_LsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_16bitMsb: - dataMode = 16U * 2U - 1U; - handle->bytePerFrame = 2U; - handle->direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_16bitLsb: - dataMode = 16U * 2U - 1U; - handle->bytePerFrame = 2U; - handle->direction = kFLEXIO_SPI_LsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_32bitMsb: - dataMode = 32UL * 2UL - 1UL; - handle->bytePerFrame = 4U; - handle->direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_32bitLsb: - dataMode = 32UL * 2UL - 1UL; - handle->bytePerFrame = 4U; - handle->direction = kFLEXIO_SPI_LsbFirst; - break; - default: - dataMode = 8UL * 2UL - 1UL; - handle->bytePerFrame = 1U; - handle->direction = kFLEXIO_SPI_MsbFirst; - assert(true); - break; - } - - /* Transfer size should be bytesPerFrame divisible. */ - if ((xfer->dataSize % handle->bytePerFrame) != 0U) - { - return kStatus_InvalidArgument; - } - - /* Configure transfer size. */ - base->flexioBase->TIMCMP[base->timerIndex[0]] = dataMode; - - handle->state = (uint32_t)kFLEXIO_SPI_Busy; - handle->txData = xfer->txData; - handle->rxData = xfer->rxData; - handle->txRemainingBytes = xfer->dataSize; - handle->rxRemainingBytes = xfer->dataSize; - - /* Save total transfer size. */ - handle->transferSize = xfer->dataSize; - - /* Enable transmit and receive interrupt to handle tx and rx. */ - FLEXIO_SPI_EnableInterrupts(base, (uint32_t)kFLEXIO_SPI_TxEmptyInterruptEnable); - FLEXIO_SPI_EnableInterrupts(base, (uint32_t)kFLEXIO_SPI_RxFullInterruptEnable); - - return kStatus_Success; -} - -/*! - * brief FlexIO SPI slave IRQ handler function. - * - * param spiType Pointer to the FLEXIO_SPI_Type structure. - * param spiHandle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - */ -void FLEXIO_SPI_SlaveTransferHandleIRQ(void *spiType, void *spiHandle) -{ - assert(spiHandle != NULL); - - flexio_spi_master_handle_t *handle = (flexio_spi_master_handle_t *)spiHandle; - FLEXIO_SPI_Type *base; - uint32_t status; - - if (handle->state == (uint32_t)kFLEXIO_SPI_Idle) - { - return; - } - - base = (FLEXIO_SPI_Type *)spiType; - status = FLEXIO_SPI_GetStatusFlags(base); - - /* Handle tx. */ - if (((status & (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag) != 0U) && (handle->txRemainingBytes != 0U)) - { - FLEXIO_SPI_TransferSendTransaction(base, handle); - } - - /* Handle rx. */ - if (((status & (uint32_t)kFLEXIO_SPI_RxBufferFullFlag) != 0U) && (handle->rxRemainingBytes != 0U)) - { - FLEXIO_SPI_TransferReceiveTransaction(base, handle); - } - - /* All the transfer finished. */ - if ((handle->txRemainingBytes == 0U) && (handle->rxRemainingBytes == 0U)) - { - FLEXIO_SPI_SlaveTransferAbort(base, handle); - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_FLEXIO_SPI_Idle, handle->userData); - } - } -} - -/*! - * brief Flush tx/rx shifters. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - */ -void FLEXIO_SPI_FlushShifters(FLEXIO_SPI_Type *base) -{ - /* Disable then re-enable to flush the tx shifter. */ - base->flexioBase->SHIFTCTL[base->shifterIndex[0]] &= ~FLEXIO_SHIFTCTL_SMOD_MASK; - base->flexioBase->SHIFTCTL[base->shifterIndex[0]] |= FLEXIO_SHIFTCTL_SMOD(kFLEXIO_ShifterModeTransmit); - /* Read to flush the rx shifter. */ - (void)base->flexioBase->SHIFTBUF[base->shifterIndex[1]]; -} diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_spi.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_spi.h deleted file mode 100644 index cae17a802c9..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_spi.h +++ /dev/null @@ -1,718 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020, 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_FLEXIO_SPI_H_ -#define FSL_FLEXIO_SPI_H_ - -#include "fsl_common.h" -#include "fsl_flexio.h" - -/*! - * @addtogroup flexio_spi - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief FlexIO SPI driver version. */ -#define FSL_FLEXIO_SPI_DRIVER_VERSION (MAKE_VERSION(2, 3, 4)) -/*! @} */ - -#ifndef FLEXIO_SPI_DUMMYDATA -/*! @brief FlexIO SPI dummy transfer data, the data is sent while txData is NULL. */ -#define FLEXIO_SPI_DUMMYDATA (0x00U) -#endif - -/*! @brief Retry times for waiting flag. */ -#ifndef SPI_RETRY_TIMES -#define SPI_RETRY_TIMES 0U /* Define to zero means keep waiting until the flag is assert/deassert. */ -#endif - -/*! @brief Get the transfer data format of width and bit order. */ -#define FLEXIO_SPI_XFER_DATA_FORMAT(flag) ((flag) & (0x7U)) - -/*! @brief Error codes for the FlexIO SPI driver. */ -enum -{ - kStatus_FLEXIO_SPI_Busy = MAKE_STATUS(kStatusGroup_FLEXIO_SPI, 1), /*!< FlexIO SPI is busy. */ - kStatus_FLEXIO_SPI_Idle = MAKE_STATUS(kStatusGroup_FLEXIO_SPI, 2), /*!< SPI is idle */ - kStatus_FLEXIO_SPI_Error = MAKE_STATUS(kStatusGroup_FLEXIO_SPI, 3), /*!< FlexIO SPI error. */ - kStatus_FLEXIO_SPI_Timeout = - MAKE_STATUS(kStatusGroup_FLEXIO_SPI, 4), /*!< FlexIO SPI timeout polling status flags. */ -}; - -/*! @brief FlexIO SPI clock phase configuration. */ -typedef enum _flexio_spi_clock_phase -{ - kFLEXIO_SPI_ClockPhaseFirstEdge = 0x0U, /*!< First edge on SPSCK occurs at the middle of the first - * cycle of a data transfer. */ - kFLEXIO_SPI_ClockPhaseSecondEdge = 0x1U, /*!< First edge on SPSCK occurs at the start of the - * first cycle of a data transfer. */ -} flexio_spi_clock_phase_t; - -/*! @brief FlexIO SPI data shifter direction options. */ -typedef enum _flexio_spi_shift_direction -{ - kFLEXIO_SPI_MsbFirst = 0, /*!< Data transfers start with most significant bit. */ - kFLEXIO_SPI_LsbFirst = 1, /*!< Data transfers start with least significant bit. */ -} flexio_spi_shift_direction_t; - -/*! @brief FlexIO SPI data length mode options. */ -typedef enum _flexio_spi_data_bitcount_mode -{ - kFLEXIO_SPI_8BitMode = 0x08U, /*!< 8-bit data transmission mode. */ - kFLEXIO_SPI_16BitMode = 0x10U, /*!< 16-bit data transmission mode. */ - kFLEXIO_SPI_32BitMode = 0x20U, /*!< 32-bit data transmission mode. */ -} flexio_spi_data_bitcount_mode_t; - -/*! @brief Define FlexIO SPI interrupt mask. */ -enum _flexio_spi_interrupt_enable -{ - kFLEXIO_SPI_TxEmptyInterruptEnable = 0x1U, /*!< Transmit buffer empty interrupt enable. */ - kFLEXIO_SPI_RxFullInterruptEnable = 0x2U, /*!< Receive buffer full interrupt enable. */ -}; - -/*! @brief Define FlexIO SPI status mask. */ -enum _flexio_spi_status_flags -{ - kFLEXIO_SPI_TxBufferEmptyFlag = 0x1U, /*!< Transmit buffer empty flag. */ - kFLEXIO_SPI_RxBufferFullFlag = 0x2U, /*!< Receive buffer full flag. */ -}; - -/*! @brief Define FlexIO SPI DMA mask. */ -enum _flexio_spi_dma_enable -{ - kFLEXIO_SPI_TxDmaEnable = 0x1U, /*!< Tx DMA request source */ - kFLEXIO_SPI_RxDmaEnable = 0x2U, /*!< Rx DMA request source */ - kFLEXIO_SPI_DmaAllEnable = 0x3U, /*!< All DMA request source*/ -}; - -/*! @brief Define FlexIO SPI transfer flags. - * @note Use kFLEXIO_SPI_csContinuous and one of the other flags to OR together to form the transfer flag. */ -enum _flexio_spi_transfer_flags -{ - kFLEXIO_SPI_8bitMsb = 0x0U, /*!< FlexIO SPI 8-bit MSB first */ - kFLEXIO_SPI_8bitLsb = 0x1U, /*!< FlexIO SPI 8-bit LSB first */ - kFLEXIO_SPI_16bitMsb = 0x2U, /*!< FlexIO SPI 16-bit MSB first */ - kFLEXIO_SPI_16bitLsb = 0x3U, /*!< FlexIO SPI 16-bit LSB first */ - kFLEXIO_SPI_32bitMsb = 0x4U, /*!< FlexIO SPI 32-bit MSB first */ - kFLEXIO_SPI_32bitLsb = 0x5U, /*!< FlexIO SPI 32-bit LSB first */ - kFLEXIO_SPI_csContinuous = 0x8U, /*!< Enable the CS signal continuous mode */ -}; - -/*! @brief Define FlexIO SPI access structure typedef. */ -typedef struct _flexio_spi_type -{ - FLEXIO_Type *flexioBase; /*!< FlexIO base pointer. */ - uint8_t SDOPinIndex; /*!< Pin select for data output. To set SDO pin in Hi-Z state, user needs to mux the pin as - GPIO input and disable all pull up/down in application. */ - uint8_t SDIPinIndex; /*!< Pin select for data input. */ - uint8_t SCKPinIndex; /*!< Pin select for clock. */ - uint8_t CSnPinIndex; /*!< Pin select for enable. */ - uint8_t shifterIndex[2]; /*!< Shifter index used in FlexIO SPI. */ - uint8_t timerIndex[2]; /*!< Timer index used in FlexIO SPI. */ -} FLEXIO_SPI_Type; - -/*! @brief Define FlexIO SPI master configuration structure. */ -typedef struct _flexio_spi_master_config -{ - bool enableMaster; /*!< Enable/disable FlexIO SPI master after configuration. */ - bool enableInDoze; /*!< Enable/disable FlexIO operation in doze mode. */ - bool enableInDebug; /*!< Enable/disable FlexIO operation in debug mode. */ - bool enableFastAccess; /*!< Enable/disable fast access to FlexIO registers, - fast access requires the FlexIO clock to be at least - twice the frequency of the bus clock. */ - uint32_t baudRate_Bps; /*!< Baud rate in Bps. */ - flexio_spi_clock_phase_t phase; /*!< Clock phase. */ - flexio_spi_data_bitcount_mode_t dataMode; /*!< 8bit or 16bit mode. */ -} flexio_spi_master_config_t; - -/*! @brief Define FlexIO SPI slave configuration structure. */ -typedef struct _flexio_spi_slave_config -{ - bool enableSlave; /*!< Enable/disable FlexIO SPI slave after configuration. */ - bool enableInDoze; /*!< Enable/disable FlexIO operation in doze mode. */ - bool enableInDebug; /*!< Enable/disable FlexIO operation in debug mode. */ - bool enableFastAccess; /*!< Enable/disable fast access to FlexIO registers, - fast access requires the FlexIO clock to be at least - twice the frequency of the bus clock. */ - flexio_spi_clock_phase_t phase; /*!< Clock phase. */ - flexio_spi_data_bitcount_mode_t dataMode; /*!< 8bit or 16bit mode. */ -} flexio_spi_slave_config_t; - -/*! @brief Define FlexIO SPI transfer structure. */ -typedef struct _flexio_spi_transfer -{ - const uint8_t *txData; /*!< Send buffer. */ - uint8_t *rxData; /*!< Receive buffer. */ - size_t dataSize; /*!< Transfer bytes. */ - uint8_t flags; /*!< FlexIO SPI control flag, MSB first or LSB first. */ -} flexio_spi_transfer_t; - -/*! @brief typedef for flexio_spi_master_handle_t in advance. */ -typedef struct _flexio_spi_master_handle flexio_spi_master_handle_t; - -/*! @brief Slave handle is the same with master handle. */ -typedef flexio_spi_master_handle_t flexio_spi_slave_handle_t; - -/*! @brief FlexIO SPI master callback for finished transmit */ -typedef void (*flexio_spi_master_transfer_callback_t)(FLEXIO_SPI_Type *base, - flexio_spi_master_handle_t *handle, - status_t status, - void *userData); - -/*! @brief FlexIO SPI slave callback for finished transmit */ -typedef void (*flexio_spi_slave_transfer_callback_t)(FLEXIO_SPI_Type *base, - flexio_spi_slave_handle_t *handle, - status_t status, - void *userData); - -/*! @brief Define FlexIO SPI handle structure. */ -struct _flexio_spi_master_handle -{ - const uint8_t *txData; /*!< Transfer buffer. */ - uint8_t *rxData; /*!< Receive buffer. */ - size_t transferSize; /*!< Total bytes to be transferred. */ - volatile size_t txRemainingBytes; /*!< Send data remaining in bytes. */ - volatile size_t rxRemainingBytes; /*!< Receive data remaining in bytes. */ - volatile uint32_t state; /*!< FlexIO SPI internal state. */ - uint8_t bytePerFrame; /*!< SPI mode, 2bytes or 1byte in a frame */ - flexio_spi_shift_direction_t direction; /*!< Shift direction. */ - flexio_spi_master_transfer_callback_t callback; /*!< FlexIO SPI callback. */ - void *userData; /*!< Callback parameter. */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus*/ - -/*! - * @name FlexIO SPI Configuration - * @{ - */ - -/*! - * @brief Ungates the FlexIO clock, resets the FlexIO module, configures the FlexIO SPI master hardware, - * and configures the FlexIO SPI with FlexIO SPI master configuration. The - * configuration structure can be filled by the user, or be set with default values - * by the FLEXIO_SPI_MasterGetDefaultConfig(). - * - * @note 1.FlexIO SPI master only support CPOL = 0, which means clock inactive low. - * 2.For FlexIO SPI master, the input valid time is 1.5 clock cycles, for slave the output valid time - * is 2.5 clock cycles. So if FlexIO SPI master communicates with other spi IPs, the maximum baud - * rate is FlexIO clock frequency divided by 2*2=4. If FlexIO SPI master communicates with FlexIO - * SPI slave, the maximum baud rate is FlexIO clock frequency divided by (1.5+2.5)*2=8. - * - * Example - @code - FLEXIO_SPI_Type spiDev = { - .flexioBase = FLEXIO, - .SDOPinIndex = 0, - .SDIPinIndex = 1, - .SCKPinIndex = 2, - .CSnPinIndex = 3, - .shifterIndex = {0,1}, - .timerIndex = {0,1} - }; - flexio_spi_master_config_t config = { - .enableMaster = true, - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .baudRate_Bps = 500000, - .phase = kFLEXIO_SPI_ClockPhaseFirstEdge, - .direction = kFLEXIO_SPI_MsbFirst, - .dataMode = kFLEXIO_SPI_8BitMode - }; - FLEXIO_SPI_MasterInit(&spiDev, &config, srcClock_Hz); - @endcode - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param masterConfig Pointer to the flexio_spi_master_config_t structure. - * @param srcClock_Hz FlexIO source clock in Hz. -*/ -void FLEXIO_SPI_MasterInit(FLEXIO_SPI_Type *base, flexio_spi_master_config_t *masterConfig, uint32_t srcClock_Hz); - -/*! - * @brief Resets the FlexIO SPI timer and shifter config. - * - * @param base Pointer to the FLEXIO_SPI_Type. - */ -void FLEXIO_SPI_MasterDeinit(FLEXIO_SPI_Type *base); - -/*! - * @brief Gets the default configuration to configure the FlexIO SPI master. The configuration - * can be used directly by calling the FLEXIO_SPI_MasterConfigure(). - * Example: - @code - flexio_spi_master_config_t masterConfig; - FLEXIO_SPI_MasterGetDefaultConfig(&masterConfig); - @endcode - * @param masterConfig Pointer to the flexio_spi_master_config_t structure. -*/ -void FLEXIO_SPI_MasterGetDefaultConfig(flexio_spi_master_config_t *masterConfig); - -/*! - * @brief Ungates the FlexIO clock, resets the FlexIO module, configures the FlexIO SPI slave hardware - * configuration, and configures the FlexIO SPI with FlexIO SPI slave configuration. The - * configuration structure can be filled by the user, or be set with default values - * by the FLEXIO_SPI_SlaveGetDefaultConfig(). - * - * @note 1.Only one timer is needed in the FlexIO SPI slave. As a result, the second timer index is ignored. - * 2.FlexIO SPI slave only support CPOL = 0, which means clock inactive low. - * 3.For FlexIO SPI master, the input valid time is 1.5 clock cycles, for slave the output valid time - * is 2.5 clock cycles. So if FlexIO SPI slave communicates with other spi IPs, the maximum baud - * rate is FlexIO clock frequency divided by 3*2=6. If FlexIO SPI slave communicates with FlexIO - * SPI master, the maximum baud rate is FlexIO clock frequency divided by (1.5+2.5)*2=8. - * Example - @code - FLEXIO_SPI_Type spiDev = { - .flexioBase = FLEXIO, - .SDOPinIndex = 0, - .SDIPinIndex = 1, - .SCKPinIndex = 2, - .CSnPinIndex = 3, - .shifterIndex = {0,1}, - .timerIndex = {0} - }; - flexio_spi_slave_config_t config = { - .enableSlave = true, - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .phase = kFLEXIO_SPI_ClockPhaseFirstEdge, - .direction = kFLEXIO_SPI_MsbFirst, - .dataMode = kFLEXIO_SPI_8BitMode - }; - FLEXIO_SPI_SlaveInit(&spiDev, &config); - @endcode - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param slaveConfig Pointer to the flexio_spi_slave_config_t structure. -*/ -void FLEXIO_SPI_SlaveInit(FLEXIO_SPI_Type *base, flexio_spi_slave_config_t *slaveConfig); - -/*! - * @brief Gates the FlexIO clock. - * - * @param base Pointer to the FLEXIO_SPI_Type. - */ -void FLEXIO_SPI_SlaveDeinit(FLEXIO_SPI_Type *base); - -/*! - * @brief Gets the default configuration to configure the FlexIO SPI slave. The configuration - * can be used directly for calling the FLEXIO_SPI_SlaveConfigure(). - * Example: - @code - flexio_spi_slave_config_t slaveConfig; - FLEXIO_SPI_SlaveGetDefaultConfig(&slaveConfig); - @endcode - * @param slaveConfig Pointer to the flexio_spi_slave_config_t structure. -*/ -void FLEXIO_SPI_SlaveGetDefaultConfig(flexio_spi_slave_config_t *slaveConfig); - -/*! @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets FlexIO SPI status flags. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @return status flag; Use the status flag to AND the following flag mask and get the status. - * @arg kFLEXIO_SPI_TxEmptyFlag - * @arg kFLEXIO_SPI_RxEmptyFlag - */ - -uint32_t FLEXIO_SPI_GetStatusFlags(FLEXIO_SPI_Type *base); - -/*! - * @brief Clears FlexIO SPI status flags. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param mask status flag - * The parameter can be any combination of the following values: - * @arg kFLEXIO_SPI_TxEmptyFlag - * @arg kFLEXIO_SPI_RxEmptyFlag - */ - -void FLEXIO_SPI_ClearStatusFlags(FLEXIO_SPI_Type *base, uint32_t mask); - -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables the FlexIO SPI interrupt. - * - * This function enables the FlexIO SPI interrupt. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param mask interrupt source. The parameter can be any combination of the following values: - * @arg kFLEXIO_SPI_RxFullInterruptEnable - * @arg kFLEXIO_SPI_TxEmptyInterruptEnable - */ -void FLEXIO_SPI_EnableInterrupts(FLEXIO_SPI_Type *base, uint32_t mask); - -/*! - * @brief Disables the FlexIO SPI interrupt. - * - * This function disables the FlexIO SPI interrupt. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param mask interrupt source The parameter can be any combination of the following values: - * @arg kFLEXIO_SPI_RxFullInterruptEnable - * @arg kFLEXIO_SPI_TxEmptyInterruptEnable - */ -void FLEXIO_SPI_DisableInterrupts(FLEXIO_SPI_Type *base, uint32_t mask); - -/*! @} */ - -/*! - * @name DMA Control - * @{ - */ - -/*! - * @brief Enables/disables the FlexIO SPI transmit DMA. This function enables/disables the FlexIO SPI Tx DMA, - * which means that asserting the kFLEXIO_SPI_TxEmptyFlag does/doesn't trigger the DMA request. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param mask SPI DMA source. - * @param enable True means enable DMA, false means disable DMA. - */ -void FLEXIO_SPI_EnableDMA(FLEXIO_SPI_Type *base, uint32_t mask, bool enable); - -/*! - * @brief Gets the FlexIO SPI transmit data register address for MSB first transfer. - * - * This function returns the SPI data register address, which is mainly used by DMA/eDMA. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param direction Shift direction of MSB first or LSB first. - * @return FlexIO SPI transmit data register address. - */ -static inline uint32_t FLEXIO_SPI_GetTxDataRegisterAddress(FLEXIO_SPI_Type *base, - flexio_spi_shift_direction_t direction) -{ - if (direction == kFLEXIO_SPI_MsbFirst) - { - return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBufferBitSwapped, - base->shifterIndex[0]) + - 3U; - } - else - { - return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBuffer, base->shifterIndex[0]); - } -} - -/*! - * @brief Gets the FlexIO SPI receive data register address for the MSB first transfer. - * - * This function returns the SPI data register address, which is mainly used by DMA/eDMA. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param direction Shift direction of MSB first or LSB first. - * @return FlexIO SPI receive data register address. - */ -static inline uint32_t FLEXIO_SPI_GetRxDataRegisterAddress(FLEXIO_SPI_Type *base, - flexio_spi_shift_direction_t direction) -{ - if (direction == kFLEXIO_SPI_MsbFirst) - { - return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBufferBitSwapped, base->shifterIndex[1]); - } - else - { - return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBuffer, base->shifterIndex[1]) + 3U; - } -} - -/*! @} */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Enables/disables the FlexIO SPI module operation. - * - * @param base Pointer to the FLEXIO_SPI_Type. - * @param enable True to enable, false does not have any effect. - */ -static inline void FLEXIO_SPI_Enable(FLEXIO_SPI_Type *base, bool enable) -{ - if (enable) - { - base->flexioBase->CTRL |= FLEXIO_CTRL_FLEXEN_MASK; - } -} - -/*! - * @brief Sets baud rate for the FlexIO SPI transfer, which is only used for the master. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param baudRate_Bps Baud Rate needed in Hz. - * @param srcClockHz SPI source clock frequency in Hz. - */ -void FLEXIO_SPI_MasterSetBaudRate(FLEXIO_SPI_Type *base, uint32_t baudRate_Bps, uint32_t srcClockHz); - -/*! - * @brief Writes one byte of data, which is sent using the MSB method. - * - * @note This is a non-blocking API, which returns directly after the data is put into the - * data register but the data transfer is not finished on the bus. Ensure that - * the TxEmptyFlag is asserted before calling this API. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param direction Shift direction of MSB first or LSB first. - * @param data 8/16/32 bit data. - */ -static inline void FLEXIO_SPI_WriteData(FLEXIO_SPI_Type *base, flexio_spi_shift_direction_t direction, uint32_t data) -{ - if (direction == kFLEXIO_SPI_MsbFirst) - { - base->flexioBase->SHIFTBUFBBS[base->shifterIndex[0]] = data; - } - else - { - base->flexioBase->SHIFTBUF[base->shifterIndex[0]] = data; - } -} - -/*! - * @brief Reads 8 bit/16 bit data. - * - * @note This is a non-blocking API, which returns directly after the data is read from the - * data register. Ensure that the RxFullFlag is asserted before calling this API. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param direction Shift direction of MSB first or LSB first. - * @return 8 bit/16 bit data received. - */ -static inline uint32_t FLEXIO_SPI_ReadData(FLEXIO_SPI_Type *base, flexio_spi_shift_direction_t direction) -{ - if (direction == kFLEXIO_SPI_MsbFirst) - { - return (uint32_t)(base->flexioBase->SHIFTBUFBIS[base->shifterIndex[1]]); - } - else - { - return (uint32_t)(base->flexioBase->SHIFTBUFBYS[base->shifterIndex[1]]); - } -} - -/*! - * @brief Sends a buffer of data bytes. - * - * @note This function blocks using the polling method until all bytes have been sent. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param direction Shift direction of MSB first or LSB first. - * @param buffer The data bytes to send. - * @param size The number of data bytes to send. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_FLEXIO_SPI_Timeout The transfer timed out and was aborted. - */ -status_t FLEXIO_SPI_WriteBlocking(FLEXIO_SPI_Type *base, - flexio_spi_shift_direction_t direction, - const uint8_t *buffer, - size_t size); - -/*! - * @brief Receives a buffer of bytes. - * - * @note This function blocks using the polling method until all bytes have been received. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param direction Shift direction of MSB first or LSB first. - * @param buffer The buffer to store the received bytes. - * @param size The number of data bytes to be received. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_FLEXIO_SPI_Timeout The transfer timed out and was aborted. - */ -status_t FLEXIO_SPI_ReadBlocking(FLEXIO_SPI_Type *base, - flexio_spi_shift_direction_t direction, - uint8_t *buffer, - size_t size); - -/*! - * @brief Receives a buffer of bytes. - * - * @note This function blocks via polling until all bytes have been received. - * - * @param base pointer to FLEXIO_SPI_Type structure - * @param xfer FlexIO SPI transfer structure, see #flexio_spi_transfer_t. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_FLEXIO_SPI_Timeout The transfer timed out and was aborted. - */ -status_t FLEXIO_SPI_MasterTransferBlocking(FLEXIO_SPI_Type *base, flexio_spi_transfer_t *xfer); - -/*! - * @brief Flush tx/rx shifters. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - */ -void FLEXIO_SPI_FlushShifters(FLEXIO_SPI_Type *base); -/*! @} */ - -/*Transactional APIs*/ - -/*! - * @name Transactional - * @{ - */ - -/*! - * @brief Initializes the FlexIO SPI Master handle, which is used in transactional functions. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - * @param callback The callback function. - * @param userData The parameter of the callback function. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_SPI_MasterTransferCreateHandle(FLEXIO_SPI_Type *base, - flexio_spi_master_handle_t *handle, - flexio_spi_master_transfer_callback_t callback, - void *userData); - -/*! - * @brief Master transfer data using IRQ. - * - * This function sends data using IRQ. This is a non-blocking function, which returns - * right away. When all data is sent out/received, the callback function is called. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - * @param xfer FlexIO SPI transfer structure. See #flexio_spi_transfer_t. - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_InvalidArgument Input argument is invalid. - * @retval kStatus_FLEXIO_SPI_Busy SPI is not idle, is running another transfer. - */ -status_t FLEXIO_SPI_MasterTransferNonBlocking(FLEXIO_SPI_Type *base, - flexio_spi_master_handle_t *handle, - flexio_spi_transfer_t *xfer); - -/*! - * @brief Aborts the master data transfer, which used IRQ. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - */ -void FLEXIO_SPI_MasterTransferAbort(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle); - -/*! - * @brief Gets the data transfer status which used IRQ. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - * @param count Number of bytes transferred so far by the non-blocking transaction. - * @retval kStatus_InvalidArgument count is Invalid. - * @retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_SPI_MasterTransferGetCount(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle, size_t *count); - -/*! - * @brief FlexIO SPI master IRQ handler function. - * - * @param spiType Pointer to the FLEXIO_SPI_Type structure. - * @param spiHandle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - */ -void FLEXIO_SPI_MasterTransferHandleIRQ(void *spiType, void *spiHandle); - -/*! - * @brief Initializes the FlexIO SPI Slave handle, which is used in transactional functions. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param handle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - * @param callback The callback function. - * @param userData The parameter of the callback function. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_SPI_SlaveTransferCreateHandle(FLEXIO_SPI_Type *base, - flexio_spi_slave_handle_t *handle, - flexio_spi_slave_transfer_callback_t callback, - void *userData); - -/*! - * @brief Slave transfer data using IRQ. - * - * This function sends data using IRQ. This is a non-blocking function, which returns - * right away. When all data is sent out/received, the callback function is called. - * @param handle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param xfer FlexIO SPI transfer structure. See #flexio_spi_transfer_t. - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_InvalidArgument Input argument is invalid. - * @retval kStatus_FLEXIO_SPI_Busy SPI is not idle; it is running another transfer. - */ -status_t FLEXIO_SPI_SlaveTransferNonBlocking(FLEXIO_SPI_Type *base, - flexio_spi_slave_handle_t *handle, - flexio_spi_transfer_t *xfer); - -/*! - * @brief Aborts the slave data transfer which used IRQ, share same API with master. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param handle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - */ -static inline void FLEXIO_SPI_SlaveTransferAbort(FLEXIO_SPI_Type *base, flexio_spi_slave_handle_t *handle) -{ - FLEXIO_SPI_MasterTransferAbort(base, handle); -} -/*! - * @brief Gets the data transfer status which used IRQ, share same API with master. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param handle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - * @param count Number of bytes transferred so far by the non-blocking transaction. - * @retval kStatus_InvalidArgument count is Invalid. - * @retval kStatus_Success Successfully return the count. - */ -static inline status_t FLEXIO_SPI_SlaveTransferGetCount(FLEXIO_SPI_Type *base, - flexio_spi_slave_handle_t *handle, - size_t *count) -{ - return FLEXIO_SPI_MasterTransferGetCount(base, handle, count); -} - -/*! - * @brief FlexIO SPI slave IRQ handler function. - * - * @param spiType Pointer to the FLEXIO_SPI_Type structure. - * @param spiHandle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - */ -void FLEXIO_SPI_SlaveTransferHandleIRQ(void *spiType, void *spiHandle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /*_cplusplus*/ -/*! @} */ - -#endif /*FSL_FLEXIO_SPI_H_*/ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_spi_dma.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_spi_dma.c deleted file mode 100644 index f00f9e8d6e5..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_spi_dma.c +++ /dev/null @@ -1,535 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020, 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio_spi_dma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio_spi_dma" -#endif - -/*base, (uint32_t)kFLEXIO_SPI_TxDmaEnable, false); - - /* Disable interrupt. */ - DMA_DisableInterrupts(handle->base, handle->channel); - - /* change the state. */ - spiPrivateHandle->handle->txInProgress = false; - - /* All finished, call the callback. */ - if ((spiPrivateHandle->handle->txInProgress == false) && (spiPrivateHandle->handle->rxInProgress == false)) - { - if (spiPrivateHandle->handle->callback != NULL) - { - (spiPrivateHandle->handle->callback)(spiPrivateHandle->base, spiPrivateHandle->handle, kStatus_Success, - spiPrivateHandle->handle->userData); - } - } -} - -static void FLEXIO_SPI_RxDMACallback(dma_handle_t *handle, void *param) -{ - flexio_spi_master_dma_private_handle_t *spiPrivateHandle = (flexio_spi_master_dma_private_handle_t *)param; - - /* Disable Rx DMA. */ - FLEXIO_SPI_EnableDMA(spiPrivateHandle->base, (uint32_t)kFLEXIO_SPI_RxDmaEnable, false); - - /* Disable interrupt. */ - DMA_DisableInterrupts(handle->base, handle->channel); - - /* change the state. */ - spiPrivateHandle->handle->rxInProgress = false; - - /* All finished, call the callback. */ - if ((spiPrivateHandle->handle->txInProgress == false) && (spiPrivateHandle->handle->rxInProgress == false)) - { - if (spiPrivateHandle->handle->callback != NULL) - { - (spiPrivateHandle->handle->callback)(spiPrivateHandle->base, spiPrivateHandle->handle, kStatus_Success, - spiPrivateHandle->handle->userData); - } - } -} - -static status_t FLEXIO_SPI_DMAConfig(FLEXIO_SPI_Type *base, - flexio_spi_master_dma_handle_t *handle, - flexio_spi_transfer_t *xfer) -{ - dma_transfer_config_t xferConfig = {0}; - flexio_spi_shift_direction_t direction = kFLEXIO_SPI_MsbFirst; - uint8_t bytesPerFrame; - uint8_t dataFormat = FLEXIO_SPI_XFER_DATA_FORMAT(xfer->flags); - - /* Configure the values in handle. */ - switch (dataFormat) - { - case (uint8_t)kFLEXIO_SPI_8bitMsb: - bytesPerFrame = 1U; - direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_8bitLsb: - bytesPerFrame = 1U; - direction = kFLEXIO_SPI_LsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_16bitMsb: - bytesPerFrame = 2U; - direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_16bitLsb: - bytesPerFrame = 2U; - direction = kFLEXIO_SPI_LsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_32bitMsb: - bytesPerFrame = 4U; - direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_32bitLsb: - bytesPerFrame = 4U; - direction = kFLEXIO_SPI_LsbFirst; - break; - default: - bytesPerFrame = 1U; - direction = kFLEXIO_SPI_MsbFirst; - assert(true); - break; - } - - /* Transfer size should be bytesPerFrame divisible. */ - if ((xfer->dataSize % bytesPerFrame) != 0U) - { - return kStatus_InvalidArgument; - } - - /* Save total transfer size. */ - handle->transferSize = xfer->dataSize; - - /* Configure tx transfer DMA. */ - xferConfig.destAddr = FLEXIO_SPI_GetTxDataRegisterAddress(base, direction); - xferConfig.enableDestIncrement = false; - if (bytesPerFrame == 1U) - { - xferConfig.srcSize = kDMA_Transfersize8bits; - xferConfig.destSize = kDMA_Transfersize8bits; - } - else if (bytesPerFrame == 2U) - { - if (direction == kFLEXIO_SPI_MsbFirst) - { - xferConfig.destAddr -= 1U; - } - xferConfig.srcSize = kDMA_Transfersize16bits; - xferConfig.destSize = kDMA_Transfersize16bits; - } - else - { - if (direction == kFLEXIO_SPI_MsbFirst) - { - xferConfig.destAddr -= 3U; - } - xferConfig.srcSize = kDMA_Transfersize32bits; - xferConfig.destSize = kDMA_Transfersize32bits; - } - - /* Configure DMA channel. */ - if (xfer->txData != NULL) - { - xferConfig.enableSrcIncrement = true; - xferConfig.srcAddr = (uint32_t)(xfer->txData); - } - else - { - /* Disable the source increasement and source set to dummyData. */ - xferConfig.enableSrcIncrement = false; - xferConfig.srcAddr = (uint32_t)(&s_dummyData); - } - - xferConfig.transferSize = xfer->dataSize; - - if (handle->txHandle != NULL) - { - (void)DMA_SubmitTransfer(handle->txHandle, &xferConfig, (uint32_t)kDMA_EnableInterrupt); - } - - /* Configure tx transfer DMA. */ - if (xfer->rxData != NULL) - { - xferConfig.srcAddr = FLEXIO_SPI_GetRxDataRegisterAddress(base, direction); - xferConfig.enableSrcIncrement = false; - xferConfig.destAddr = (uint32_t)(xfer->rxData); - xferConfig.enableDestIncrement = true; - (void)DMA_SubmitTransfer(handle->rxHandle, &xferConfig, (uint32_t)kDMA_EnableInterrupt); - handle->rxInProgress = true; - FLEXIO_SPI_EnableDMA(base, (uint32_t)kFLEXIO_SPI_RxDmaEnable, true); - DMA_StartTransfer(handle->rxHandle); - } - - /* Always start Tx transfer. */ - if (handle->txHandle != NULL) - { - handle->txInProgress = true; - FLEXIO_SPI_EnableDMA(base, (uint32_t)kFLEXIO_SPI_TxDmaEnable, true); - DMA_StartTransfer(handle->txHandle); - } - - return kStatus_Success; -} - -/*! - * brief Initializes the FLEXO SPI master DMA handle. - * - * This function initializes the FLEXO SPI master DMA handle which can be used for other FLEXO SPI master transactional - * APIs. - * Usually, for a specified FLEXO SPI instance, call this API once to get the initialized handle. - * - * param base Pointer to FLEXIO_SPI_Type structure. - * param handle Pointer to flexio_spi_master_dma_handle_t structure to store the transfer state. - * param callback SPI callback, NULL means no callback. - * param userData callback function parameter. - * param txHandle User requested DMA handle for FlexIO SPI RX DMA transfer. - * param rxHandle User requested DMA handle for FlexIO SPI TX DMA transfer. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO SPI DMA type/handle table out of range. - */ -status_t FLEXIO_SPI_MasterTransferCreateHandleDMA(FLEXIO_SPI_Type *base, - flexio_spi_master_dma_handle_t *handle, - flexio_spi_master_dma_transfer_callback_t callback, - void *userData, - dma_handle_t *txHandle, - dma_handle_t *rxHandle) -{ - assert(handle != NULL); - - uint8_t index = 0; - - /* Find the an empty handle pointer to store the handle. */ - for (index = 0U; index < (uint8_t)FLEXIO_SPI_HANDLE_COUNT; index++) - { - if (s_dmaPrivateHandle[index].base == NULL) - { - s_dmaPrivateHandle[index].base = base; - s_dmaPrivateHandle[index].handle = handle; - break; - } - } - - if (index == (uint8_t)FLEXIO_SPI_HANDLE_COUNT) - { - return kStatus_OutOfRange; - } - - /* Set spi base to handle. */ - handle->txHandle = txHandle; - handle->rxHandle = rxHandle; - - /* Register callback and userData. */ - handle->callback = callback; - handle->userData = userData; - - /* Set SPI state to idle. */ - handle->txInProgress = false; - handle->rxInProgress = false; - - /* Install callback for Tx/Rx dma channel. */ - if (handle->txHandle != NULL) - { - DMA_SetCallback(handle->txHandle, FLEXIO_SPI_TxDMACallback, &s_dmaPrivateHandle[index]); - } - if (handle->rxHandle != NULL) - { - DMA_SetCallback(handle->rxHandle, FLEXIO_SPI_RxDMACallback, &s_dmaPrivateHandle[index]); - } - - return kStatus_Success; -} - -/*! - * brief Performs a non-blocking FlexIO SPI transfer using DMA. - * - * note This interface returned immediately after transfer initiates. Call - * FLEXIO_SPI_MasterGetTransferCountDMA to poll the transfer status to check - * whether the FlexIO SPI transfer is finished. - * - * param base Pointer to FLEXIO_SPI_Type structure. - * param handle Pointer to flexio_spi_master_dma_handle_t structure to store the transfer state. - * param xfer Pointer to FlexIO SPI transfer structure. - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_InvalidArgument Input argument is invalid. - * retval kStatus_FLEXIO_SPI_Busy FlexIO SPI is not idle, is running another transfer. - */ -status_t FLEXIO_SPI_MasterTransferDMA(FLEXIO_SPI_Type *base, - flexio_spi_master_dma_handle_t *handle, - flexio_spi_transfer_t *xfer) -{ - assert(handle != NULL); - assert(xfer != NULL); - - uint32_t dataMode = 0U; - uint16_t timerCmp = (uint16_t)base->flexioBase->TIMCMP[base->timerIndex[0]]; - uint8_t dataFormat = FLEXIO_SPI_XFER_DATA_FORMAT(xfer->flags); - - timerCmp &= 0x00FFU; - - /* Check if the device is busy. */ - if ((handle->txInProgress) || (handle->rxInProgress)) - { - return kStatus_FLEXIO_SPI_Busy; - } - - /* Check if input parameter invalid. */ - if (((xfer->txData == NULL) && (xfer->rxData == NULL)) || (xfer->dataSize == 0U)) - { - return kStatus_InvalidArgument; - } - - /* Timer1 controls the CS signal which enables/disables(asserts/deasserts) when timer0 enable/disable. Timer0 - enables when tx shifter is written and disables when timer compare. The timer compare event causes the - transmit shift registers to load which generates a tx register empty event. Since when timer stop bit is - disabled, a timer enable condition can be detected in the same cycle as a timer disable condition, so if - software writes the tx register upon the detection of tx register empty event, the timer enable condition - is triggered again, then the CS signal can remain low until software no longer writes the tx register. */ - if ((xfer->flags & (uint8_t)kFLEXIO_SPI_csContinuous) != 0U) - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TSTOP_MASK) | - FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitDisabled); - } - else - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TSTOP_MASK) | - FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitEnableOnTimerDisable); - } - - /* configure data mode. */ - if ((dataFormat == (uint8_t)kFLEXIO_SPI_8bitMsb) || (dataFormat == (uint8_t)kFLEXIO_SPI_8bitLsb)) - { - dataMode = (8UL * 2UL - 1UL) << 8U; - } - else if ((dataFormat == (uint8_t)kFLEXIO_SPI_16bitMsb) || (dataFormat == (uint8_t)kFLEXIO_SPI_16bitLsb)) - { - dataMode = (16UL * 2UL - 1UL) << 8U; - } - else if ((dataFormat == (uint8_t)kFLEXIO_SPI_32bitMsb) || (dataFormat == (uint8_t)kFLEXIO_SPI_32bitLsb)) - { - dataMode = (32UL * 2UL - 1UL) << 8U; - } - else - { - dataMode = (8UL * 2UL - 1UL) << 8U; - } - - dataMode |= timerCmp; - - base->flexioBase->TIMCMP[base->timerIndex[0]] = dataMode; - - return FLEXIO_SPI_DMAConfig(base, handle, xfer); -} - -/*! - * brief Gets the remaining bytes for FlexIO SPI DMA transfer. - * - * param base Pointer to FLEXIO_SPI_Type structure. - * param handle FlexIO SPI DMA handle pointer. - * param count Number of bytes transferred so far by the non-blocking transaction. - */ -status_t FLEXIO_SPI_MasterTransferGetCountDMA(FLEXIO_SPI_Type *base, - flexio_spi_master_dma_handle_t *handle, - size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - if (handle->rxInProgress) - { - *count = (handle->transferSize - DMA_GetRemainingBytes(handle->rxHandle->base, handle->rxHandle->channel)); - } - else - { - *count = (handle->transferSize - DMA_GetRemainingBytes(handle->txHandle->base, handle->txHandle->channel)); - } - - return kStatus_Success; -} - -/*! - * brief Aborts a FlexIO SPI transfer using DMA. - * - * param base Pointer to FLEXIO_SPI_Type structure. - * param handle FlexIO SPI DMA handle pointer. - */ -void FLEXIO_SPI_MasterTransferAbortDMA(FLEXIO_SPI_Type *base, flexio_spi_master_dma_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable dma. */ - DMA_AbortTransfer(handle->txHandle); - DMA_AbortTransfer(handle->rxHandle); - - /* Disable DMA enable bit. */ - FLEXIO_SPI_EnableDMA(base, (uint32_t)kFLEXIO_SPI_DmaAllEnable, false); - - /* Set the handle state. */ - handle->txInProgress = false; - handle->rxInProgress = false; -} - -/*! - * brief Performs a non-blocking FlexIO SPI transfer using DMA. - * - * note This interface returns immediately after transfer initiates. Call - * FLEXIO_SPI_SlaveGetTransferCountDMA to poll the transfer status and - * check whether the FlexIO SPI transfer is finished. - * - * param base Pointer to FLEXIO_SPI_Type structure. - * param handle Pointer to flexio_spi_slave_dma_handle_t structure to store the transfer state. - * param xfer Pointer to FlexIO SPI transfer structure. - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_InvalidArgument Input argument is invalid. - * retval kStatus_FLEXIO_SPI_Busy FlexIO SPI is not idle, is running another transfer. - */ -status_t FLEXIO_SPI_SlaveTransferDMA(FLEXIO_SPI_Type *base, - flexio_spi_slave_dma_handle_t *handle, - flexio_spi_transfer_t *xfer) -{ - assert(handle != NULL); - assert(xfer != NULL); - - uint32_t dataMode = 0U; - uint8_t dataFormat = FLEXIO_SPI_XFER_DATA_FORMAT(xfer->flags); - - /* Check if the device is busy. */ - if ((handle->txInProgress) || (handle->rxInProgress)) - { - return kStatus_FLEXIO_SPI_Busy; - } - - /* Check if input parameter invalid. */ - if (((xfer->txData == NULL) && (xfer->rxData == NULL)) || (xfer->dataSize == 0U)) - { - return kStatus_InvalidArgument; - } - - /* SCK timer use CS pin as inverted trigger so timer should be disbaled on trigger falling edge(CS re-asserts). */ - /* However if CPHA is first edge mode, timer will restart each time right after timer compare event occur and - before CS pin re-asserts, which triggers another shifter load. To avoid this, when in CS dis-continuous mode, - timer should disable in timer compare rather than trigger falling edge(CS re-asserts), and in CS continuous mode, - tx/rx shifters should be flushed after transfer finishes and before next transfer starts. */ - FLEXIO_SPI_FlushShifters(base); - if ((xfer->flags & (uint8_t)kFLEXIO_SPI_csContinuous) != 0U) - { - base->flexioBase->TIMCFG[base->timerIndex[0]] |= FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTriggerFallingEdge); - } - else - { - if ((base->flexioBase->SHIFTCTL[base->shifterIndex[0]] & FLEXIO_SHIFTCTL_TIMPOL_MASK) == - FLEXIO_SHIFTCTL_TIMPOL(kFLEXIO_ShifterTimerPolarityOnNegitive)) - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TIMDIS_MASK) | - FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTimerCompare); - } - else - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TIMDIS_MASK) | - FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTriggerFallingEdge); - } - } - - /* configure data mode. */ - if ((dataFormat == (uint8_t)kFLEXIO_SPI_8bitMsb) || (dataFormat == (uint8_t)kFLEXIO_SPI_8bitLsb)) - { - dataMode = 8UL * 2UL - 1UL; - } - else if ((dataFormat == (uint8_t)kFLEXIO_SPI_16bitMsb) || (dataFormat == (uint8_t)kFLEXIO_SPI_16bitLsb)) - { - dataMode = 16UL * 2UL - 1UL; - } - else if ((dataFormat == (uint8_t)kFLEXIO_SPI_32bitMsb) || (dataFormat == (uint8_t)kFLEXIO_SPI_32bitLsb)) - { - dataMode = 32UL * 2UL - 1UL; - } - else - { - dataMode = 8UL * 2UL - 1UL; - } - - base->flexioBase->TIMCMP[base->timerIndex[0]] = dataMode; - - return FLEXIO_SPI_DMAConfig(base, handle, xfer); -} diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_spi_dma.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_spi_dma.h deleted file mode 100644 index a3c9208081e..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_spi_dma.h +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020, 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_FLEXIO_SPI_DMA_H_ -#define FSL_FLEXIO_SPI_DMA_H_ - -#include "fsl_flexio_spi.h" -#include "fsl_dma.h" - -/*! - * @addtogroup flexio_dma_spi - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief FlexIO SPI DMA driver version 2.3.0. */ -#define FSL_FLEXIO_SPI_DMA_DRIVER_VERSION (MAKE_VERSION(2, 3, 0)) -/*! @} */ - -/*! @brief typedef for flexio_spi_master_dma_handle_t in advance. */ -typedef struct _flexio_spi_master_dma_handle flexio_spi_master_dma_handle_t; - -/*! @brief Slave handle is the same with master handle. */ -typedef flexio_spi_master_dma_handle_t flexio_spi_slave_dma_handle_t; - -/*! @brief FlexIO SPI master callback for finished transmit */ -typedef void (*flexio_spi_master_dma_transfer_callback_t)(FLEXIO_SPI_Type *base, - flexio_spi_master_dma_handle_t *handle, - status_t status, - void *userData); - -/*! @brief FlexIO SPI slave callback for finished transmit */ -typedef void (*flexio_spi_slave_dma_transfer_callback_t)(FLEXIO_SPI_Type *base, - flexio_spi_slave_dma_handle_t *handle, - status_t status, - void *userData); - -/*! @brief FlexIO SPI DMA transfer handle, users should not touch the content of the handle.*/ -struct _flexio_spi_master_dma_handle -{ - size_t transferSize; /*!< Total bytes to be transferred. */ - bool txInProgress; /*!< Send transfer in progress */ - bool rxInProgress; /*!< Receive transfer in progress */ - dma_handle_t *txHandle; /*!< DMA handler for SPI send */ - dma_handle_t *rxHandle; /*!< DMA handler for SPI receive */ - flexio_spi_master_dma_transfer_callback_t callback; /*!< Callback for SPI DMA transfer */ - void *userData; /*!< User Data for SPI DMA callback */ -}; - -/******************************************************************************* - * APIs - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name DMA Transactional - * @{ - */ - -/*! - * @brief Initializes the FLEXO SPI master DMA handle. - * - * This function initializes the FLEXO SPI master DMA handle which can be used for other FLEXO SPI master transactional - * APIs. - * Usually, for a specified FLEXO SPI instance, call this API once to get the initialized handle. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle Pointer to flexio_spi_master_dma_handle_t structure to store the transfer state. - * @param callback SPI callback, NULL means no callback. - * @param userData callback function parameter. - * @param txHandle User requested DMA handle for FlexIO SPI RX DMA transfer. - * @param rxHandle User requested DMA handle for FlexIO SPI TX DMA transfer. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO SPI DMA type/handle table out of range. - */ -status_t FLEXIO_SPI_MasterTransferCreateHandleDMA(FLEXIO_SPI_Type *base, - flexio_spi_master_dma_handle_t *handle, - flexio_spi_master_dma_transfer_callback_t callback, - void *userData, - dma_handle_t *txHandle, - dma_handle_t *rxHandle); - -/*! - * @brief Performs a non-blocking FlexIO SPI transfer using DMA. - * - * @note This interface returned immediately after transfer initiates. Call - * FLEXIO_SPI_MasterGetTransferCountDMA to poll the transfer status to check - * whether the FlexIO SPI transfer is finished. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle Pointer to flexio_spi_master_dma_handle_t structure to store the transfer state. - * @param xfer Pointer to FlexIO SPI transfer structure. - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_InvalidArgument Input argument is invalid. - * @retval kStatus_FLEXIO_SPI_Busy FlexIO SPI is not idle, is running another transfer. - */ -status_t FLEXIO_SPI_MasterTransferDMA(FLEXIO_SPI_Type *base, - flexio_spi_master_dma_handle_t *handle, - flexio_spi_transfer_t *xfer); - -/*! - * @brief Aborts a FlexIO SPI transfer using DMA. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle FlexIO SPI DMA handle pointer. - */ -void FLEXIO_SPI_MasterTransferAbortDMA(FLEXIO_SPI_Type *base, flexio_spi_master_dma_handle_t *handle); - -/*! - * @brief Gets the remaining bytes for FlexIO SPI DMA transfer. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle FlexIO SPI DMA handle pointer. - * @param count Number of bytes transferred so far by the non-blocking transaction. - */ -status_t FLEXIO_SPI_MasterTransferGetCountDMA(FLEXIO_SPI_Type *base, - flexio_spi_master_dma_handle_t *handle, - size_t *count); - -/*! - * @brief Initializes the FlexIO SPI slave DMA handle. - * - * This function initializes the FlexIO SPI slave DMA handle. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle Pointer to flexio_spi_slave_dma_handle_t structure to store the transfer state. - * @param callback SPI callback, NULL means no callback. - * @param userData callback function parameter. - * @param txHandle User requested DMA handle for FlexIO SPI TX DMA transfer. - * @param rxHandle User requested DMA handle for FlexIO SPI RX DMA transfer. - */ -static inline void FLEXIO_SPI_SlaveTransferCreateHandleDMA(FLEXIO_SPI_Type *base, - flexio_spi_slave_dma_handle_t *handle, - flexio_spi_slave_dma_transfer_callback_t callback, - void *userData, - dma_handle_t *txHandle, - dma_handle_t *rxHandle) -{ - (void)FLEXIO_SPI_MasterTransferCreateHandleDMA(base, handle, callback, userData, txHandle, rxHandle); -} - -/*! - * @brief Performs a non-blocking FlexIO SPI transfer using DMA. - * - * @note This interface returns immediately after transfer initiates. Call - * FLEXIO_SPI_SlaveGetTransferCountDMA to poll the transfer status and - * check whether the FlexIO SPI transfer is finished. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle Pointer to flexio_spi_slave_dma_handle_t structure to store the transfer state. - * @param xfer Pointer to FlexIO SPI transfer structure. - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_InvalidArgument Input argument is invalid. - * @retval kStatus_FLEXIO_SPI_Busy FlexIO SPI is not idle, is running another transfer. - */ -status_t FLEXIO_SPI_SlaveTransferDMA(FLEXIO_SPI_Type *base, - flexio_spi_slave_dma_handle_t *handle, - flexio_spi_transfer_t *xfer); - -/*! - * @brief Aborts a FlexIO SPI transfer using DMA. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle Pointer to flexio_spi_slave_dma_handle_t structure to store the transfer state. - */ -static inline void FLEXIO_SPI_SlaveTransferAbortDMA(FLEXIO_SPI_Type *base, flexio_spi_slave_dma_handle_t *handle) -{ - FLEXIO_SPI_MasterTransferAbortDMA(base, handle); -} - -/*! - * @brief Gets the remaining bytes to be transferred for FlexIO SPI DMA. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle FlexIO SPI DMA handle pointer. - * @param count Number of bytes transferred so far by the non-blocking transaction. - */ -static inline status_t FLEXIO_SPI_SlaveTransferGetCountDMA(FLEXIO_SPI_Type *base, - flexio_spi_slave_dma_handle_t *handle, - size_t *count) -{ - return FLEXIO_SPI_MasterTransferGetCountDMA(base, handle, count); -} - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ -#endif diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_uart.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_uart.c deleted file mode 100644 index 13890caee7d..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_uart.c +++ /dev/null @@ -1,1023 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio_uart.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio_uart" -#endif - -/*flexioBase); -} - -static size_t FLEXIO_UART_TransferGetRxRingBufferLength(flexio_uart_handle_t *handle) -{ - size_t size; - uint16_t rxRingBufferHead = handle->rxRingBufferHead; - uint16_t rxRingBufferTail = handle->rxRingBufferTail; - - if (rxRingBufferTail > rxRingBufferHead) - { - size = (size_t)rxRingBufferHead + handle->rxRingBufferSize - (size_t)rxRingBufferTail; - } - else - { - size = (size_t)rxRingBufferHead - (size_t)rxRingBufferTail; - } - - return size; -} - -static bool FLEXIO_UART_TransferIsRxRingBufferFull(flexio_uart_handle_t *handle) -{ - bool full; - - if (FLEXIO_UART_TransferGetRxRingBufferLength(handle) == (handle->rxRingBufferSize - 1U)) - { - full = true; - } - else - { - full = false; - } - - return full; -} - -/*! - * brief Ungates the FlexIO clock, resets the FlexIO module, configures FlexIO UART - * hardware, and configures the FlexIO UART with FlexIO UART configuration. - * The configuration structure can be filled by the user or be set with - * default values by FLEXIO_UART_GetDefaultConfig(). - * - * Example - code - FLEXIO_UART_Type base = { - .flexioBase = FLEXIO, - .TxPinIndex = 0, - .RxPinIndex = 1, - .shifterIndex = {0,1}, - .timerIndex = {0,1} - }; - flexio_uart_config_t config = { - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .baudRate_Bps = 115200U, - .bitCountPerChar = 8 - }; - FLEXIO_UART_Init(base, &config, srcClock_Hz); - endcode - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param userConfig Pointer to the flexio_uart_config_t structure. - * param srcClock_Hz FlexIO source clock in Hz. - * retval kStatus_Success Configuration success. - * retval kStatus_FLEXIO_UART_BaudrateNotSupport Baudrate is not supported for current clock source frequency. -*/ -status_t FLEXIO_UART_Init(FLEXIO_UART_Type *base, const flexio_uart_config_t *userConfig, uint32_t srcClock_Hz) -{ - assert((base != NULL) && (userConfig != NULL)); - - flexio_shifter_config_t shifterConfig; - flexio_timer_config_t timerConfig; - uint32_t ctrlReg = 0; - uint16_t timerDiv = 0; - uint16_t timerCmp = 0; - uint32_t calculatedBaud; - uint32_t diff; - status_t result = kStatus_Success; - - /* Clear the shifterConfig & timerConfig struct. */ - (void)memset(&shifterConfig, 0, sizeof(shifterConfig)); - (void)memset(&timerConfig, 0, sizeof(timerConfig)); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate flexio clock. */ - CLOCK_EnableClock(s_flexioClocks[FLEXIO_UART_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Configure FLEXIO UART */ - ctrlReg = base->flexioBase->CTRL; - ctrlReg &= ~(FLEXIO_CTRL_DOZEN_MASK | FLEXIO_CTRL_DBGE_MASK | FLEXIO_CTRL_FASTACC_MASK | FLEXIO_CTRL_FLEXEN_MASK); - ctrlReg |= (FLEXIO_CTRL_DBGE(userConfig->enableInDebug) | FLEXIO_CTRL_FASTACC(userConfig->enableFastAccess) | - FLEXIO_CTRL_FLEXEN(userConfig->enableUart)); - if (!userConfig->enableInDoze) - { - ctrlReg |= FLEXIO_CTRL_DOZEN_MASK; - } - - base->flexioBase->CTRL = ctrlReg; - - /* Do hardware configuration. */ - /* 1. Configure the shifter 0 for tx. */ - shifterConfig.timerSelect = base->timerIndex[0]; - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive; - shifterConfig.pinConfig = kFLEXIO_PinConfigOutput; - shifterConfig.pinSelect = base->TxPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveHigh; - shifterConfig.shifterMode = kFLEXIO_ShifterModeTransmit; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitHigh; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitLow; - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[0], &shifterConfig); - - /*2. Configure the timer 0 for tx. */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->shifterIndex[0]); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - timerConfig.pinSelect = base->TxPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveHigh; - timerConfig.timerMode = kFLEXIO_TimerModeDual8BitBaudBit; - timerConfig.timerOutput = kFLEXIO_TimerOutputOneNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput; - timerConfig.timerReset = kFLEXIO_TimerResetNever; - timerConfig.timerDisable = kFLEXIO_TimerDisableOnTimerCompare; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnTriggerHigh; - timerConfig.timerStop = kFLEXIO_TimerStopBitEnableOnTimerDisable; - timerConfig.timerStart = kFLEXIO_TimerStartBitEnabled; - - timerDiv = (uint16_t)(srcClock_Hz / userConfig->baudRate_Bps); - timerDiv = timerDiv / 2U - 1U; - - if (timerDiv > 0xFFU) - { - /* Check whether the calculated timerDiv is within allowed range. */ - return kStatus_FLEXIO_UART_BaudrateNotSupport; - } - else - { - /* Check to see if actual baud rate is within 3% of desired baud rate - * based on the best calculated timerDiv value */ - calculatedBaud = srcClock_Hz / (((uint32_t)timerDiv + 1U) * 2U); - /* timerDiv cannot be larger than the ideal divider, so calculatedBaud is definitely larger - than configured baud */ - diff = calculatedBaud - userConfig->baudRate_Bps; - if (diff > ((userConfig->baudRate_Bps / 100U) * 3U)) - { - return kStatus_FLEXIO_UART_BaudrateNotSupport; - } - } - - timerCmp = ((uint16_t)userConfig->bitCountPerChar * 2U - 1U) << 8U; - timerCmp |= timerDiv; - - timerConfig.timerCompare = timerCmp; - - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[0], &timerConfig); - - /* 3. Configure the shifter 1 for rx. */ - shifterConfig.timerSelect = base->timerIndex[1]; - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnNegitive; - shifterConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - shifterConfig.pinSelect = base->RxPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveHigh; - shifterConfig.shifterMode = kFLEXIO_ShifterModeReceive; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitHigh; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitLow; - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[1], &shifterConfig); - - /* 4. Configure the timer 1 for rx. */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_PININPUT(base->RxPinIndex); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveHigh; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceExternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - timerConfig.pinSelect = base->RxPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveLow; - timerConfig.timerMode = kFLEXIO_TimerModeDual8BitBaudBit; - timerConfig.timerOutput = kFLEXIO_TimerOutputOneAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput; - timerConfig.timerReset = kFLEXIO_TimerResetOnTimerPinRisingEdge; - timerConfig.timerDisable = kFLEXIO_TimerDisableOnTimerCompare; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnPinRisingEdge; - timerConfig.timerStop = kFLEXIO_TimerStopBitEnableOnTimerDisable; - timerConfig.timerStart = kFLEXIO_TimerStartBitEnabled; - - timerConfig.timerCompare = timerCmp; - - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[1], &timerConfig); - - return result; -} - -/*! - * brief Resets the FlexIO UART shifter and timer config. - * - * note After calling this API, call the FLEXO_UART_Init to use the FlexIO UART module. - * - * param base Pointer to FLEXIO_UART_Type structure - */ -void FLEXIO_UART_Deinit(FLEXIO_UART_Type *base) -{ - base->flexioBase->SHIFTCFG[base->shifterIndex[0]] = 0; - base->flexioBase->SHIFTCTL[base->shifterIndex[0]] = 0; - base->flexioBase->SHIFTCFG[base->shifterIndex[1]] = 0; - base->flexioBase->SHIFTCTL[base->shifterIndex[1]] = 0; - base->flexioBase->TIMCFG[base->timerIndex[0]] = 0; - base->flexioBase->TIMCMP[base->timerIndex[0]] = 0; - base->flexioBase->TIMCTL[base->timerIndex[0]] = 0; - base->flexioBase->TIMCFG[base->timerIndex[1]] = 0; - base->flexioBase->TIMCMP[base->timerIndex[1]] = 0; - base->flexioBase->TIMCTL[base->timerIndex[1]] = 0; - /* Clear the shifter flag. */ - base->flexioBase->SHIFTSTAT = (1UL << base->shifterIndex[0]); - base->flexioBase->SHIFTSTAT = (1UL << base->shifterIndex[1]); - /* Clear the timer flag. */ - base->flexioBase->TIMSTAT = (1UL << base->timerIndex[0]); - base->flexioBase->TIMSTAT = (1UL << base->timerIndex[1]); -} - -/*! - * brief Gets the default configuration to configure the FlexIO UART. The configuration - * can be used directly for calling the FLEXIO_UART_Init(). - * Example: - code - flexio_uart_config_t config; - FLEXIO_UART_GetDefaultConfig(&userConfig); - endcode - * param userConfig Pointer to the flexio_uart_config_t structure. -*/ -void FLEXIO_UART_GetDefaultConfig(flexio_uart_config_t *userConfig) -{ - assert(userConfig != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(userConfig, 0, sizeof(*userConfig)); - - userConfig->enableUart = true; - userConfig->enableInDoze = false; - userConfig->enableInDebug = true; - userConfig->enableFastAccess = false; - /* Default baud rate 115200. */ - userConfig->baudRate_Bps = 115200U; - /* Default bit count at 8. */ - userConfig->bitCountPerChar = kFLEXIO_UART_8BitsPerChar; -} - -/*! - * brief Enables the FlexIO UART interrupt. - * - * This function enables the FlexIO UART interrupt. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param mask Interrupt source. - */ -void FLEXIO_UART_EnableInterrupts(FLEXIO_UART_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_UART_TxDataRegEmptyInterruptEnable) != 0U) - { - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable) != 0U) - { - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Disables the FlexIO UART interrupt. - * - * This function disables the FlexIO UART interrupt. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param mask Interrupt source. - */ -void FLEXIO_UART_DisableInterrupts(FLEXIO_UART_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_UART_TxDataRegEmptyInterruptEnable) != 0U) - { - FLEXIO_DisableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable) != 0U) - { - FLEXIO_DisableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Gets the FlexIO UART status flags. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * return FlexIO UART status flags. - */ - -uint32_t FLEXIO_UART_GetStatusFlags(FLEXIO_UART_Type *base) -{ - uint32_t status = 0U; - status = - ((FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0])) >> base->shifterIndex[0]); - status |= - (((FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[1])) >> (base->shifterIndex[1])) - << 1U); - status |= - (((FLEXIO_GetShifterErrorFlags(base->flexioBase) & (1UL << base->shifterIndex[1])) >> (base->shifterIndex[1])) - << 2U); - return status; -} - -/*! - * brief Gets the FlexIO UART status flags. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param mask Status flag. - * The parameter can be any combination of the following values: - * arg kFLEXIO_UART_TxDataRegEmptyFlag - * arg kFLEXIO_UART_RxEmptyFlag - * arg kFLEXIO_UART_RxOverRunFlag - */ - -void FLEXIO_UART_ClearStatusFlags(FLEXIO_UART_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_UART_TxDataRegEmptyFlag) != 0U) - { - FLEXIO_ClearShifterStatusFlags(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_UART_RxDataRegFullFlag) != 0U) - { - FLEXIO_ClearShifterStatusFlags(base->flexioBase, 1UL << base->shifterIndex[1]); - } - if ((mask & (uint32_t)kFLEXIO_UART_RxOverRunFlag) != 0U) - { - FLEXIO_ClearShifterErrorFlags(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Sends a buffer of data bytes. - * - * note This function blocks using the polling method until all bytes have been sent. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param txData The data bytes to send. - * param txSize The number of data bytes to send. - * retval kStatus_FLEXIO_UART_Timeout Transmission timed out and was aborted. - * retval kStatus_Success Successfully wrote all data. - */ -status_t FLEXIO_UART_WriteBlocking(FLEXIO_UART_Type *base, const uint8_t *txData, size_t txSize) -{ - assert(txData != NULL); - assert(txSize != 0U); -#if UART_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != txSize--) - { - /* Wait until data transfer complete. */ -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; - while ((0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) && - (0U != --waitTimes)) -#else - while (0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) -#endif - { - } -#if UART_RETRY_TIMES - if (0U == waitTimes) - { - return kStatus_FLEXIO_UART_Timeout; - } -#endif - - base->flexioBase->SHIFTBUF[base->shifterIndex[0]] = *txData++; - } - return kStatus_Success; -} - -/*! - * brief Receives a buffer of bytes. - * - * note This function blocks using the polling method until all bytes have been received. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param rxData The buffer to store the received bytes. - * param rxSize The number of data bytes to be received. - * retval kStatus_FLEXIO_UART_Timeout Transmission timed out and was aborted. - * retval kStatus_Success Successfully received all data. - */ -status_t FLEXIO_UART_ReadBlocking(FLEXIO_UART_Type *base, uint8_t *rxData, size_t rxSize) -{ - assert(rxData != NULL); - assert(rxSize != 0U); -#if UART_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != rxSize--) - { - /* Wait until data transfer complete. */ -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; - while ((0U == (FLEXIO_UART_GetStatusFlags(base) & (uint32_t)kFLEXIO_UART_RxDataRegFullFlag)) && - (0U != --waitTimes)) -#else - while (0U == (FLEXIO_UART_GetStatusFlags(base) & (uint32_t)kFLEXIO_UART_RxDataRegFullFlag)) -#endif - { - } -#if UART_RETRY_TIMES - if (0U == waitTimes) - { - return kStatus_FLEXIO_UART_Timeout; - } -#endif - - *rxData++ = (uint8_t)(base->flexioBase->SHIFTBUFBYS[base->shifterIndex[1]]); - } - return kStatus_Success; -} - -/*! - * brief Initializes the UART handle. - * - * This function initializes the FlexIO UART handle, which can be used for other FlexIO - * UART transactional APIs. Call this API once to get the - * initialized handle. - * - * The UART driver supports the "background" receiving, which means that users can set up - * a RX ring buffer optionally. Data received is stored into the ring buffer even when - * the user doesn't call the FLEXIO_UART_TransferReceiveNonBlocking() API. If there is already data - * received in the ring buffer, users can get the received data from the ring buffer - * directly. The ring buffer is disabled if passing NULL as p ringBuffer. - * - * param base to FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * param callback The callback function. - * param userData The parameter of the callback function. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_UART_TransferCreateHandle(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - flexio_uart_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - IRQn_Type flexio_irqs[] = FLEXIO_IRQS; - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Set the TX/RX state. */ - handle->rxState = (uint8_t)kFLEXIO_UART_RxIdle; - handle->txState = (uint8_t)kFLEXIO_UART_TxIdle; - - /* Set the callback and user data. */ - handle->callback = callback; - handle->userData = userData; - - /* Clear pending NVIC IRQ before enable NVIC IRQ. */ - NVIC_ClearPendingIRQ(flexio_irqs[FLEXIO_UART_GetInstance(base)]); - /* Enable interrupt in NVIC. */ - (void)EnableIRQ(flexio_irqs[FLEXIO_UART_GetInstance(base)]); - - /* Save the context in global variables to support the double weak mechanism. */ - return FLEXIO_RegisterHandleIRQ(base, handle, FLEXIO_UART_TransferHandleIRQ); -} - -/*! - * brief Sets up the RX ring buffer. - * - * This function sets up the RX ring buffer to a specific UART handle. - * - * When the RX ring buffer is used, data received is stored into the ring buffer even when - * the user doesn't call the UART_ReceiveNonBlocking() API. If there is already data received - * in the ring buffer, users can get the received data from the ring buffer directly. - * - * note When using the RX ring buffer, one byte is reserved for internal use. In other - * words, if p ringBufferSize is 32, only 31 bytes are used for saving data. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * param ringBuffer Start address of ring buffer for background receiving. Pass NULL to disable the ring buffer. - * param ringBufferSize Size of the ring buffer. - */ -void FLEXIO_UART_TransferStartRingBuffer(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - uint8_t *ringBuffer, - size_t ringBufferSize) -{ - assert(handle != NULL); - - /* Setup the ringbuffer address */ - if (ringBuffer != NULL) - { - handle->rxRingBuffer = ringBuffer; - handle->rxRingBufferSize = ringBufferSize; - handle->rxRingBufferHead = 0U; - handle->rxRingBufferTail = 0U; - - /* Enable the interrupt to accept the data when user need the ring buffer. */ - FLEXIO_UART_EnableInterrupts(base, (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable); - } -} - -/*! - * brief Aborts the background transfer and uninstalls the ring buffer. - * - * This function aborts the background transfer and uninstalls the ring buffer. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferStopRingBuffer(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle) -{ - assert(handle != NULL); - - if (handle->rxState == (uint8_t)kFLEXIO_UART_RxIdle) - { - FLEXIO_UART_DisableInterrupts(base, (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable); - } - - handle->rxRingBuffer = NULL; - handle->rxRingBufferSize = 0U; - handle->rxRingBufferHead = 0U; - handle->rxRingBufferTail = 0U; -} - -/*! - * brief Transmits a buffer of data using the interrupt method. - * - * This function sends data using an interrupt method. This is a non-blocking function, - * which returns directly without waiting for all data to be written to the TX register. When - * all data is written to the TX register in ISR, the FlexIO UART driver calls the callback - * function and passes the ref kStatus_FLEXIO_UART_TxIdle as status parameter. - * - * note The kStatus_FLEXIO_UART_TxIdle is passed to the upper layer when all data is written - * to the TX register. However, it does not ensure that all data is sent out. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * param xfer FlexIO UART transfer structure. See #flexio_uart_transfer_t. - * retval kStatus_Success Successfully starts the data transmission. - * retval kStatus_UART_TxBusy Previous transmission still not finished, data not written to the TX register. - */ -status_t FLEXIO_UART_TransferSendNonBlocking(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - flexio_uart_transfer_t *xfer) -{ - status_t status; - - /* Return error if xfer invalid. */ - if ((0U == xfer->dataSize) || (NULL == xfer->txData)) - { - return kStatus_InvalidArgument; - } - - /* Return error if current TX busy. */ - if ((uint8_t)kFLEXIO_UART_TxBusy == handle->txState) - { - status = kStatus_FLEXIO_UART_TxBusy; - } - else - { - handle->txData = xfer->txData; - handle->txDataSize = xfer->dataSize; - handle->txDataSizeAll = xfer->dataSize; - handle->txState = (uint8_t)kFLEXIO_UART_TxBusy; - - /* Enable transmiter interrupt. */ - FLEXIO_UART_EnableInterrupts(base, (uint32_t)kFLEXIO_UART_TxDataRegEmptyInterruptEnable); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Aborts the interrupt-driven data transmit. - * - * This function aborts the interrupt-driven data sending. Get the remainBytes to find out - * how many bytes are still not sent out. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferAbortSend(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle) -{ - /* Disable the transmitter and disable the interrupt. */ - FLEXIO_UART_DisableInterrupts(base, (uint32_t)kFLEXIO_UART_TxDataRegEmptyInterruptEnable); - - handle->txDataSize = 0U; - handle->txState = (uint8_t)kFLEXIO_UART_TxIdle; -} - -/*! - * brief Gets the number of bytes sent. - * - * This function gets the number of bytes sent driven by interrupt. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * param count Number of bytes sent so far by the non-blocking transaction. - * retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetSendCount(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - assert(count != NULL); - - if ((uint8_t)kFLEXIO_UART_TxIdle == handle->txState) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->txDataSizeAll - handle->txDataSize; - - return kStatus_Success; -} - -/*! - * brief Receives a buffer of data using the interrupt method. - * - * This function receives data using the interrupt method. This is a non-blocking function, - * which returns without waiting for all data to be received. - * If the RX ring buffer is used and not empty, the data in ring buffer is copied and - * the parameter p receivedBytes shows how many bytes are copied from the ring buffer. - * After copying, if the data in ring buffer is not enough to read, the receive - * request is saved by the UART driver. When new data arrives, the receive request - * is serviced first. When all data is received, the UART driver notifies the upper layer - * through a callback function and passes the status parameter ref kStatus_UART_RxIdle. - * For example, if the upper layer needs 10 bytes but there are only 5 bytes in the ring buffer, - * the 5 bytes are copied to xfer->data. This function returns with the - * parameter p receivedBytes set to 5. For the last 5 bytes, newly arrived data is - * saved from the xfer->data[5]. When 5 bytes are received, the UART driver notifies upper layer. - * If the RX ring buffer is not enabled, this function enables the RX and RX interrupt - * to receive data to xfer->data. When all data is received, the upper layer is notified. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * param xfer UART transfer structure. See #flexio_uart_transfer_t. - * param receivedBytes Bytes received from the ring buffer directly. - * retval kStatus_Success Successfully queue the transfer into the transmit queue. - * retval kStatus_FLEXIO_UART_RxBusy Previous receive request is not finished. - */ -status_t FLEXIO_UART_TransferReceiveNonBlocking(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - flexio_uart_transfer_t *xfer, - size_t *receivedBytes) -{ - uint32_t i; - status_t status; - /* How many bytes to copy from ring buffer to user memory. */ - size_t bytesToCopy = 0U; - /* How many bytes to receive. */ - size_t bytesToReceive; - /* How many bytes currently have received. */ - size_t bytesCurrentReceived; - - /* Return error if xfer invalid. */ - if ((0U == xfer->dataSize) || (NULL == xfer->rxData)) - { - return kStatus_InvalidArgument; - } - - /* How to get data: - 1. If RX ring buffer is not enabled, then save xfer->data and xfer->dataSize - to uart handle, enable interrupt to store received data to xfer->data. When - all data received, trigger callback. - 2. If RX ring buffer is enabled and not empty, get data from ring buffer first. - If there are enough data in ring buffer, copy them to xfer->data and return. - If there are not enough data in ring buffer, copy all of them to xfer->data, - save the xfer->data remained empty space to uart handle, receive data - to this empty space and trigger callback when finished. */ - - if ((uint8_t)kFLEXIO_UART_RxBusy == handle->rxState) - { - status = kStatus_FLEXIO_UART_RxBusy; - } - else - { - bytesToReceive = xfer->dataSize; - bytesCurrentReceived = 0U; - - /* If RX ring buffer is used. */ - if (handle->rxRingBuffer != NULL) - { - /* Disable FLEXIO_UART RX IRQ, protect ring buffer. */ - FLEXIO_UART_DisableInterrupts(base, (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable); - - /* How many bytes in RX ring buffer currently. */ - bytesToCopy = FLEXIO_UART_TransferGetRxRingBufferLength(handle); - - if (bytesToCopy != 0U) - { - bytesToCopy = MIN(bytesToReceive, bytesToCopy); - - bytesToReceive -= bytesToCopy; - - /* Copy data from ring buffer to user memory. */ - for (i = 0U; i < bytesToCopy; i++) - { - xfer->rxData[bytesCurrentReceived++] = handle->rxRingBuffer[handle->rxRingBufferTail]; - - /* Wrap to 0. Not use modulo (%) because it might be large and slow. */ - if ((uint32_t)handle->rxRingBufferTail + 1U == handle->rxRingBufferSize) - { - handle->rxRingBufferTail = 0U; - } - else - { - handle->rxRingBufferTail++; - } - } - } - - /* If ring buffer does not have enough data, still need to read more data. */ - if (bytesToReceive != 0U) - { - /* No data in ring buffer, save the request to UART handle. */ - handle->rxData = xfer->rxData + bytesCurrentReceived; - handle->rxDataSize = bytesToReceive; - handle->rxDataSizeAll = xfer->dataSize; - handle->rxState = (uint8_t)kFLEXIO_UART_RxBusy; - } - - /* Enable FLEXIO_UART RX IRQ if previously enabled. */ - FLEXIO_UART_EnableInterrupts(base, (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable); - - /* Call user callback since all data are received. */ - if (0U == bytesToReceive) - { - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_FLEXIO_UART_RxIdle, handle->userData); - } - } - } - /* Ring buffer not used. */ - else - { - handle->rxData = xfer->rxData + bytesCurrentReceived; - handle->rxDataSize = bytesToReceive; - handle->rxDataSizeAll = bytesToReceive; - handle->rxState = (uint8_t)kFLEXIO_UART_RxBusy; - - /* Enable RX interrupt. */ - FLEXIO_UART_EnableInterrupts(base, (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable); - } - - /* Return the how many bytes have read. */ - if (receivedBytes != NULL) - { - *receivedBytes = bytesCurrentReceived; - } - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Aborts the receive data which was using IRQ. - * - * This function aborts the receive data which was using IRQ. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferAbortReceive(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle) -{ - /* Only abort the receive to handle->rxData, the RX ring buffer is still working. */ - if (NULL == handle->rxRingBuffer) - { - /* Disable RX interrupt. */ - FLEXIO_UART_DisableInterrupts(base, (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable); - } - - handle->rxDataSize = 0U; - handle->rxState = (uint8_t)kFLEXIO_UART_RxIdle; -} - -/*! - * brief Gets the number of bytes received. - * - * This function gets the number of bytes received driven by interrupt. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * param count Number of bytes received so far by the non-blocking transaction. - * retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetReceiveCount(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - assert(count != NULL); - - if ((uint8_t)kFLEXIO_UART_RxIdle == handle->rxState) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->rxDataSizeAll - handle->rxDataSize; - - return kStatus_Success; -} - -/*! - * brief FlexIO UART IRQ handler function. - * - * This function processes the FlexIO UART transmit and receives the IRQ request. - * - * param uartType Pointer to the FLEXIO_UART_Type structure. - * param uartHandle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferHandleIRQ(void *uartType, void *uartHandle) -{ - uint8_t count = 1; - FLEXIO_UART_Type *base = (FLEXIO_UART_Type *)uartType; - flexio_uart_handle_t *handle = (flexio_uart_handle_t *)uartHandle; - uint16_t rxRingBufferHead; - - /* Read the status back. */ - uint32_t status = FLEXIO_UART_GetStatusFlags(base); - - /* If RX overrun. */ - if (((uint32_t)kFLEXIO_UART_RxOverRunFlag & status) != 0U) - { - /* Clear Overrun flag. */ - FLEXIO_UART_ClearStatusFlags(base, (uint32_t)kFLEXIO_UART_RxOverRunFlag); - - /* Trigger callback. */ - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_FLEXIO_UART_RxHardwareOverrun, handle->userData); - } - } - - /* Receive data register full */ - if ((((uint32_t)kFLEXIO_UART_RxDataRegFullFlag & status) != 0U) && - ((base->flexioBase->SHIFTSIEN & (1UL << base->shifterIndex[1])) != 0U)) - { - /* If handle->rxDataSize is not 0, first save data to handle->rxData. */ - if (handle->rxDataSize != 0U) - { - /* Using non block API to read the data from the registers. */ - FLEXIO_UART_ReadByte(base, handle->rxData); - handle->rxDataSize--; - handle->rxData++; - count--; - - /* If all the data required for upper layer is ready, trigger callback. */ - if (0U == handle->rxDataSize) - { - handle->rxState = (uint8_t)kFLEXIO_UART_RxIdle; - - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_FLEXIO_UART_RxIdle, handle->userData); - } - } - } - - if (handle->rxRingBuffer != NULL) - { - if (count != 0U) - { - /* If RX ring buffer is full, trigger callback to notify over run. */ - if (FLEXIO_UART_TransferIsRxRingBufferFull(handle)) - { - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_FLEXIO_UART_RxRingBufferOverrun, handle->userData); - } - } - - /* If ring buffer is still full after callback function, the oldest data is overridden. */ - if (FLEXIO_UART_TransferIsRxRingBufferFull(handle)) - { - /* Increase handle->rxRingBufferTail to make room for new data. */ - if ((uint32_t)handle->rxRingBufferTail + 1U == handle->rxRingBufferSize) - { - handle->rxRingBufferTail = 0U; - } - else - { - handle->rxRingBufferTail++; - } - } - - /* Read data. */ - rxRingBufferHead = handle->rxRingBufferHead; - handle->rxRingBuffer[rxRingBufferHead] = - (uint8_t)(base->flexioBase->SHIFTBUFBYS[base->shifterIndex[1]]); - - /* Increase handle->rxRingBufferHead. */ - if ((uint32_t)handle->rxRingBufferHead + 1U == handle->rxRingBufferSize) - { - handle->rxRingBufferHead = 0U; - } - else - { - handle->rxRingBufferHead++; - } - } - } - /* If no receive requst pending, stop RX interrupt. */ - else if (0U == handle->rxDataSize) - { - FLEXIO_UART_DisableInterrupts(base, (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable); - } - else - { - } - } - - /* Send data register empty and the interrupt is enabled. */ - if ((((uint32_t)kFLEXIO_UART_TxDataRegEmptyFlag & status) != 0U) && - ((base->flexioBase->SHIFTSIEN & (1UL << base->shifterIndex[0])) != 0U)) - { - if (handle->txDataSize != 0U) - { - /* Using non block API to write the data to the registers. */ - FLEXIO_UART_WriteByte(base, handle->txData); - handle->txData++; - handle->txDataSize--; - - /* If all the data are written to data register, TX finished. */ - if (0U == handle->txDataSize) - { - handle->txState = (uint8_t)kFLEXIO_UART_TxIdle; - - /* Disable TX register empty interrupt. */ - FLEXIO_UART_DisableInterrupts(base, (uint32_t)kFLEXIO_UART_TxDataRegEmptyInterruptEnable); - - /* Trigger callback. */ - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_FLEXIO_UART_TxIdle, handle->userData); - } - } - } - } -} - -/*! - * brief Flush tx/rx shifters. - * - * param base Pointer to the FLEXIO_UART_Type structure. - */ -void FLEXIO_UART_FlushShifters(FLEXIO_UART_Type *base) -{ - /* Disable then re-enable to flush the tx shifter. */ - base->flexioBase->SHIFTCTL[base->shifterIndex[0]] &= ~FLEXIO_SHIFTCTL_SMOD_MASK; - base->flexioBase->SHIFTCTL[base->shifterIndex[0]] |= FLEXIO_SHIFTCTL_SMOD(kFLEXIO_ShifterModeTransmit); - /* Read to flush the rx shifter. */ - (void)base->flexioBase->SHIFTBUF[base->shifterIndex[1]]; -} diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_uart.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_uart.h deleted file mode 100644 index d6f36bf3235..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_uart.h +++ /dev/null @@ -1,588 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_FLEXIO_UART_H_ -#define FSL_FLEXIO_UART_H_ - -#include "fsl_common.h" -#include "fsl_flexio.h" - -/*! - * @addtogroup flexio_uart - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief FlexIO UART driver version. */ -#define FSL_FLEXIO_UART_DRIVER_VERSION (MAKE_VERSION(2, 5, 0)) -/*! @} */ - -/*! @brief Retry times for waiting flag. */ -#ifndef UART_RETRY_TIMES -#define UART_RETRY_TIMES 0U /* Defining to zero means to keep waiting for the flag until it is assert/deassert. */ -#endif - -/*! @brief Error codes for the UART driver. */ -enum -{ - kStatus_FLEXIO_UART_TxBusy = MAKE_STATUS(kStatusGroup_FLEXIO_UART, 0), /*!< Transmitter is busy. */ - kStatus_FLEXIO_UART_RxBusy = MAKE_STATUS(kStatusGroup_FLEXIO_UART, 1), /*!< Receiver is busy. */ - kStatus_FLEXIO_UART_TxIdle = MAKE_STATUS(kStatusGroup_FLEXIO_UART, 2), /*!< UART transmitter is idle. */ - kStatus_FLEXIO_UART_RxIdle = MAKE_STATUS(kStatusGroup_FLEXIO_UART, 3), /*!< UART receiver is idle. */ - kStatus_FLEXIO_UART_ERROR = MAKE_STATUS(kStatusGroup_FLEXIO_UART, 4), /*!< ERROR happens on UART. */ - kStatus_FLEXIO_UART_RxRingBufferOverrun = - MAKE_STATUS(kStatusGroup_FLEXIO_UART, 5), /*!< UART RX software ring buffer overrun. */ - kStatus_FLEXIO_UART_RxHardwareOverrun = MAKE_STATUS(kStatusGroup_FLEXIO_UART, 6), /*!< UART RX receiver overrun. */ - kStatus_FLEXIO_UART_Timeout = MAKE_STATUS(kStatusGroup_FLEXIO_UART, 7), /*!< UART times out. */ - kStatus_FLEXIO_UART_BaudrateNotSupport = - MAKE_STATUS(kStatusGroup_FLEXIO_UART, 8) /*!< Baudrate is not supported in current clock source */ -}; - -/*! @brief FlexIO UART bit count per char. */ -typedef enum _flexio_uart_bit_count_per_char -{ - kFLEXIO_UART_7BitsPerChar = 7U, /*!< 7-bit data characters */ - kFLEXIO_UART_8BitsPerChar = 8U, /*!< 8-bit data characters */ - kFLEXIO_UART_9BitsPerChar = 9U, /*!< 9-bit data characters */ -} flexio_uart_bit_count_per_char_t; - -/*! @brief Define FlexIO UART interrupt mask. */ -enum _flexio_uart_interrupt_enable -{ - kFLEXIO_UART_TxDataRegEmptyInterruptEnable = 0x1U, /*!< Transmit buffer empty interrupt enable. */ - kFLEXIO_UART_RxDataRegFullInterruptEnable = 0x2U, /*!< Receive buffer full interrupt enable. */ -}; - -/*! @brief Define FlexIO UART status mask. */ -enum _flexio_uart_status_flags -{ - kFLEXIO_UART_TxDataRegEmptyFlag = 0x1U, /*!< Transmit buffer empty flag. */ - kFLEXIO_UART_RxDataRegFullFlag = 0x2U, /*!< Receive buffer full flag. */ - kFLEXIO_UART_RxOverRunFlag = 0x4U, /*!< Receive buffer over run flag. */ -}; - -/*! @brief Define FlexIO UART access structure typedef. */ -typedef struct _flexio_uart_type -{ - FLEXIO_Type *flexioBase; /*!< FlexIO base pointer. */ - uint8_t TxPinIndex; /*!< Pin select for UART_Tx. */ - uint8_t RxPinIndex; /*!< Pin select for UART_Rx. */ - uint8_t shifterIndex[2]; /*!< Shifter index used in FlexIO UART. */ - uint8_t timerIndex[2]; /*!< Timer index used in FlexIO UART. */ -} FLEXIO_UART_Type; - -/*! @brief Define FlexIO UART user configuration structure. */ -typedef struct _flexio_uart_config -{ - bool enableUart; /*!< Enable/disable FlexIO UART TX & RX. */ - bool enableInDoze; /*!< Enable/disable FlexIO operation in doze mode*/ - bool enableInDebug; /*!< Enable/disable FlexIO operation in debug mode*/ - bool enableFastAccess; /*!< Enable/disable fast access to FlexIO registers, - fast access requires the FlexIO clock to be at least - twice the frequency of the bus clock. */ - uint32_t baudRate_Bps; /*!< Baud rate in Bps. */ - flexio_uart_bit_count_per_char_t bitCountPerChar; /*!< number of bits, 7/8/9 -bit */ -} flexio_uart_config_t; - -/*! @brief Define FlexIO UART transfer structure. */ -typedef struct _flexio_uart_transfer -{ - /* - * Use separate TX and RX data pointer, because TX data is const data. - * The member data is kept for backward compatibility. - */ - union - { - uint8_t *data; /*!< The buffer of data to be transfer.*/ - uint8_t *rxData; /*!< The buffer to receive data. */ - const uint8_t *txData; /*!< The buffer of data to be sent. */ - }; - size_t dataSize; /*!< Transfer size*/ -} flexio_uart_transfer_t; - -/* Forward declaration of the handle typedef. */ -typedef struct _flexio_uart_handle flexio_uart_handle_t; - -/*! @brief FlexIO UART transfer callback function. */ -typedef void (*flexio_uart_transfer_callback_t)(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - status_t status, - void *userData); - -/*! @brief Define FLEXIO UART handle structure*/ -struct _flexio_uart_handle -{ - const uint8_t *volatile txData; /*!< Address of remaining data to send. */ - volatile size_t txDataSize; /*!< Size of the remaining data to send. */ - uint8_t *volatile rxData; /*!< Address of remaining data to receive. */ - volatile size_t rxDataSize; /*!< Size of the remaining data to receive. */ - size_t txDataSizeAll; /*!< Total bytes to be sent. */ - size_t rxDataSizeAll; /*!< Total bytes to be received. */ - - uint8_t *rxRingBuffer; /*!< Start address of the receiver ring buffer. */ - size_t rxRingBufferSize; /*!< Size of the ring buffer. */ - volatile uint16_t rxRingBufferHead; /*!< Index for the driver to store received data into ring buffer. */ - volatile uint16_t rxRingBufferTail; /*!< Index for the user to get data from the ring buffer. */ - - flexio_uart_transfer_callback_t callback; /*!< Callback function. */ - void *userData; /*!< UART callback function parameter.*/ - - volatile uint8_t txState; /*!< TX transfer state. */ - volatile uint8_t rxState; /*!< RX transfer state */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus*/ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Ungates the FlexIO clock, resets the FlexIO module, configures FlexIO UART - * hardware, and configures the FlexIO UART with FlexIO UART configuration. - * The configuration structure can be filled by the user or be set with - * default values by FLEXIO_UART_GetDefaultConfig(). - * - * Example - @code - FLEXIO_UART_Type base = { - .flexioBase = FLEXIO, - .TxPinIndex = 0, - .RxPinIndex = 1, - .shifterIndex = {0,1}, - .timerIndex = {0,1} - }; - flexio_uart_config_t config = { - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .baudRate_Bps = 115200U, - .bitCountPerChar = 8 - }; - FLEXIO_UART_Init(base, &config, srcClock_Hz); - @endcode - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param userConfig Pointer to the flexio_uart_config_t structure. - * @param srcClock_Hz FlexIO source clock in Hz. - * @retval kStatus_Success Configuration success. - * @retval kStatus_FLEXIO_UART_BaudrateNotSupport Baudrate is not supported for current clock source frequency. -*/ -status_t FLEXIO_UART_Init(FLEXIO_UART_Type *base, const flexio_uart_config_t *userConfig, uint32_t srcClock_Hz); - -/*! - * @brief Resets the FlexIO UART shifter and timer config. - * - * @note After calling this API, call the FLEXO_UART_Init to use the FlexIO UART module. - * - * @param base Pointer to FLEXIO_UART_Type structure - */ -void FLEXIO_UART_Deinit(FLEXIO_UART_Type *base); - -/*! - * @brief Gets the default configuration to configure the FlexIO UART. The configuration - * can be used directly for calling the FLEXIO_UART_Init(). - * Example: - @code - flexio_uart_config_t config; - FLEXIO_UART_GetDefaultConfig(&userConfig); - @endcode - * @param userConfig Pointer to the flexio_uart_config_t structure. -*/ -void FLEXIO_UART_GetDefaultConfig(flexio_uart_config_t *userConfig); - -/*! @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets the FlexIO UART status flags. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @return FlexIO UART status flags. - */ - -uint32_t FLEXIO_UART_GetStatusFlags(FLEXIO_UART_Type *base); - -/*! - * @brief Gets the FlexIO UART status flags. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param mask Status flag. - * The parameter can be any combination of the following values: - * @arg kFLEXIO_UART_TxDataRegEmptyFlag - * @arg kFLEXIO_UART_RxEmptyFlag - * @arg kFLEXIO_UART_RxOverRunFlag - */ - -void FLEXIO_UART_ClearStatusFlags(FLEXIO_UART_Type *base, uint32_t mask); - -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables the FlexIO UART interrupt. - * - * This function enables the FlexIO UART interrupt. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param mask Interrupt source. - */ -void FLEXIO_UART_EnableInterrupts(FLEXIO_UART_Type *base, uint32_t mask); - -/*! - * @brief Disables the FlexIO UART interrupt. - * - * This function disables the FlexIO UART interrupt. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param mask Interrupt source. - */ -void FLEXIO_UART_DisableInterrupts(FLEXIO_UART_Type *base, uint32_t mask); - -/*! @} */ - -/*! - * @name DMA Control - * @{ - */ - -/*! - * @brief Gets the FlexIO UARt transmit data register address. - * - * This function returns the UART data register address, which is mainly used by DMA/eDMA. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @return FlexIO UART transmit data register address. - */ -static inline uint32_t FLEXIO_UART_GetTxDataRegisterAddress(FLEXIO_UART_Type *base) -{ - return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBuffer, base->shifterIndex[0]); -} - -/*! - * @brief Gets the FlexIO UART receive data register address. - * - * This function returns the UART data register address, which is mainly used by DMA/eDMA. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @return FlexIO UART receive data register address. - */ -static inline uint32_t FLEXIO_UART_GetRxDataRegisterAddress(FLEXIO_UART_Type *base) -{ - return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBufferByteSwapped, base->shifterIndex[1]); -} - -/*! - * @brief Enables/disables the FlexIO UART transmit DMA. - * This function enables/disables the FlexIO UART Tx DMA, - * which means asserting the kFLEXIO_UART_TxDataRegEmptyFlag does/doesn't trigger the DMA request. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param enable True to enable, false to disable. - */ -static inline void FLEXIO_UART_EnableTxDMA(FLEXIO_UART_Type *base, bool enable) -{ - FLEXIO_EnableShifterStatusDMA(base->flexioBase, 1UL << base->shifterIndex[0], enable); -} - -/*! - * @brief Enables/disables the FlexIO UART receive DMA. - * This function enables/disables the FlexIO UART Rx DMA, - * which means asserting kFLEXIO_UART_RxDataRegFullFlag does/doesn't trigger the DMA request. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param enable True to enable, false to disable. - */ -static inline void FLEXIO_UART_EnableRxDMA(FLEXIO_UART_Type *base, bool enable) -{ - FLEXIO_EnableShifterStatusDMA(base->flexioBase, 1UL << base->shifterIndex[1], enable); -} - -/*! @} */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Enables/disables the FlexIO UART module operation. - * - * @param base Pointer to the FLEXIO_UART_Type. - * @param enable True to enable, false does not have any effect. - */ -static inline void FLEXIO_UART_Enable(FLEXIO_UART_Type *base, bool enable) -{ - if (enable) - { - base->flexioBase->CTRL |= FLEXIO_CTRL_FLEXEN_MASK; - } -} - -/*! - * @brief Writes one byte of data. - * - * @note This is a non-blocking API, which returns directly after the data is put into the - * data register. Ensure that the TxEmptyFlag is asserted before calling - * this API. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param buffer The data bytes to send. - */ -static inline void FLEXIO_UART_WriteByte(FLEXIO_UART_Type *base, const uint8_t *buffer) -{ - base->flexioBase->SHIFTBUF[base->shifterIndex[0]] = *buffer; -} - -/*! - * @brief Reads one byte of data. - * - * @note This is a non-blocking API, which returns directly after the data is read from the - * data register. Ensure that the RxFullFlag is asserted before calling this API. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param buffer The buffer to store the received bytes. - */ -static inline void FLEXIO_UART_ReadByte(FLEXIO_UART_Type *base, uint8_t *buffer) -{ - *buffer = (uint8_t)(base->flexioBase->SHIFTBUFBYS[base->shifterIndex[1]]); -} - -/*! - * @brief Sends a buffer of data bytes. - * - * @note This function blocks using the polling method until all bytes have been sent. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param txData The data bytes to send. - * @param txSize The number of data bytes to send. - * @retval kStatus_FLEXIO_UART_Timeout Transmission timed out and was aborted. - * @retval kStatus_Success Successfully wrote all data. - */ -status_t FLEXIO_UART_WriteBlocking(FLEXIO_UART_Type *base, const uint8_t *txData, size_t txSize); - -/*! - * @brief Receives a buffer of bytes. - * - * @note This function blocks using the polling method until all bytes have been received. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param rxData The buffer to store the received bytes. - * @param rxSize The number of data bytes to be received. - * @retval kStatus_FLEXIO_UART_Timeout Transmission timed out and was aborted. - * @retval kStatus_Success Successfully received all data. - */ -status_t FLEXIO_UART_ReadBlocking(FLEXIO_UART_Type *base, uint8_t *rxData, size_t rxSize); - -/*! @} */ - -/*! - * @name Transactional - * @{ - */ - -/*! - * @brief Initializes the UART handle. - * - * This function initializes the FlexIO UART handle, which can be used for other FlexIO - * UART transactional APIs. Call this API once to get the - * initialized handle. - * - * The UART driver supports the "background" receiving, which means that users can set up - * a RX ring buffer optionally. Data received is stored into the ring buffer even when - * the user doesn't call the FLEXIO_UART_TransferReceiveNonBlocking() API. If there is already data - * received in the ring buffer, users can get the received data from the ring buffer - * directly. The ring buffer is disabled if passing NULL as @p ringBuffer. - * - * @param base to FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * @param callback The callback function. - * @param userData The parameter of the callback function. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_UART_TransferCreateHandle(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - flexio_uart_transfer_callback_t callback, - void *userData); - -/*! - * @brief Sets up the RX ring buffer. - * - * This function sets up the RX ring buffer to a specific UART handle. - * - * When the RX ring buffer is used, data received is stored into the ring buffer even when - * the user doesn't call the UART_ReceiveNonBlocking() API. If there is already data received - * in the ring buffer, users can get the received data from the ring buffer directly. - * - * @note When using the RX ring buffer, one byte is reserved for internal use. In other - * words, if @p ringBufferSize is 32, only 31 bytes are used for saving data. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * @param ringBuffer Start address of ring buffer for background receiving. Pass NULL to disable the ring buffer. - * @param ringBufferSize Size of the ring buffer. - */ -void FLEXIO_UART_TransferStartRingBuffer(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - uint8_t *ringBuffer, - size_t ringBufferSize); - -/*! - * @brief Aborts the background transfer and uninstalls the ring buffer. - * - * This function aborts the background transfer and uninstalls the ring buffer. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferStopRingBuffer(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle); - -/*! - * @brief Transmits a buffer of data using the interrupt method. - * - * This function sends data using an interrupt method. This is a non-blocking function, - * which returns directly without waiting for all data to be written to the TX register. When - * all data is written to the TX register in ISR, the FlexIO UART driver calls the callback - * function and passes the @ref kStatus_FLEXIO_UART_TxIdle as status parameter. - * - * @note The kStatus_FLEXIO_UART_TxIdle is passed to the upper layer when all data is written - * to the TX register. However, it does not ensure that all data is sent out. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * @param xfer FlexIO UART transfer structure. See #flexio_uart_transfer_t. - * @retval kStatus_Success Successfully starts the data transmission. - * @retval kStatus_UART_TxBusy Previous transmission still not finished, data not written to the TX register. - */ -status_t FLEXIO_UART_TransferSendNonBlocking(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - flexio_uart_transfer_t *xfer); - -/*! - * @brief Aborts the interrupt-driven data transmit. - * - * This function aborts the interrupt-driven data sending. Get the remainBytes to find out - * how many bytes are still not sent out. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferAbortSend(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle); - -/*! - * @brief Gets the number of bytes sent. - * - * This function gets the number of bytes sent driven by interrupt. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * @param count Number of bytes sent so far by the non-blocking transaction. - * @retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * @retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetSendCount(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle, size_t *count); - -/*! - * @brief Receives a buffer of data using the interrupt method. - * - * This function receives data using the interrupt method. This is a non-blocking function, - * which returns without waiting for all data to be received. - * If the RX ring buffer is used and not empty, the data in ring buffer is copied and - * the parameter @p receivedBytes shows how many bytes are copied from the ring buffer. - * After copying, if the data in ring buffer is not enough to read, the receive - * request is saved by the UART driver. When new data arrives, the receive request - * is serviced first. When all data is received, the UART driver notifies the upper layer - * through a callback function and passes the status parameter kStatus_UART_RxIdle. - * For example, if the upper layer needs 10 bytes but there are only 5 bytes in the ring buffer, - * the 5 bytes are copied to xfer->data. This function returns with the - * parameter @p receivedBytes set to 5. For the last 5 bytes, newly arrived data is - * saved from the xfer->data[5]. When 5 bytes are received, the UART driver notifies upper layer. - * If the RX ring buffer is not enabled, this function enables the RX and RX interrupt - * to receive data to xfer->data. When all data is received, the upper layer is notified. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * @param xfer UART transfer structure. See #flexio_uart_transfer_t. - * @param receivedBytes Bytes received from the ring buffer directly. - * @retval kStatus_Success Successfully queue the transfer into the transmit queue. - * @retval kStatus_FLEXIO_UART_RxBusy Previous receive request is not finished. - */ -status_t FLEXIO_UART_TransferReceiveNonBlocking(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - flexio_uart_transfer_t *xfer, - size_t *receivedBytes); - -/*! - * @brief Aborts the receive data which was using IRQ. - * - * This function aborts the receive data which was using IRQ. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferAbortReceive(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle); - -/*! - * @brief Gets the number of bytes received. - * - * This function gets the number of bytes received driven by interrupt. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * @param count Number of bytes received so far by the non-blocking transaction. - * @retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * @retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetReceiveCount(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle, size_t *count); - -/*! - * @brief FlexIO UART IRQ handler function. - * - * This function processes the FlexIO UART transmit and receives the IRQ request. - * - * @param uartType Pointer to the FLEXIO_UART_Type structure. - * @param uartHandle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferHandleIRQ(void *uartType, void *uartHandle); - -/*! - * @brief Flush tx/rx shifters. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - */ -void FLEXIO_UART_FlushShifters(FLEXIO_UART_Type *base); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /*_cplusplus*/ -/*! @} */ - -#endif /*FSL_FLEXIO_UART_H_*/ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_uart_dma.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_uart_dma.c deleted file mode 100644 index 269642064d9..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_uart_dma.c +++ /dev/null @@ -1,408 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2017 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio_uart_dma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio_uart_dma" -#endif - -/*base, false); - - /* Disable interrupt. */ - DMA_DisableInterrupts(handle->base, handle->channel); - - uartPrivateHandle->handle->txState = (uint8_t)kFLEXIO_UART_TxIdle; - - if (uartPrivateHandle->handle->callback != NULL) - { - uartPrivateHandle->handle->callback(uartPrivateHandle->base, uartPrivateHandle->handle, - kStatus_FLEXIO_UART_TxIdle, uartPrivateHandle->handle->userData); - } -} - -static void FLEXIO_UART_TransferReceiveDMACallback(dma_handle_t *handle, void *param) -{ - flexio_uart_dma_private_handle_t *uartPrivateHandle = (flexio_uart_dma_private_handle_t *)param; - - /* Disable UART RX DMA. */ - FLEXIO_UART_EnableRxDMA(uartPrivateHandle->base, false); - - /* Disable interrupt. */ - DMA_DisableInterrupts(handle->base, handle->channel); - - uartPrivateHandle->handle->rxState = (uint8_t)kFLEXIO_UART_RxIdle; - - if (uartPrivateHandle->handle->callback != NULL) - { - uartPrivateHandle->handle->callback(uartPrivateHandle->base, uartPrivateHandle->handle, - kStatus_FLEXIO_UART_RxIdle, uartPrivateHandle->handle->userData); - } -} - -/*! - * brief Initializes the FLEXIO_UART handle which is used in transactional functions. - * - * param base Pointer to FLEXIO_UART_Type structure. - * param handle Pointer to flexio_uart_dma_handle_t structure. - * param callback FlexIO UART callback, NULL means no callback. - * param userData User callback function data. - * param txDmaHandle User requested DMA handle for TX DMA transfer. - * param rxDmaHandle User requested DMA handle for RX DMA transfer. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO UART DMA type/handle table out of range. - */ -status_t FLEXIO_UART_TransferCreateHandleDMA(FLEXIO_UART_Type *base, - flexio_uart_dma_handle_t *handle, - flexio_uart_dma_transfer_callback_t callback, - void *userData, - dma_handle_t *txDmaHandle, - dma_handle_t *rxDmaHandle) -{ - assert(handle != NULL); - - dma_transfer_config_t dmaXferConfig; - uint8_t index = 0; - - /* Find the an empty handle pointer to store the handle. */ - for (index = 0U; index < (uint8_t)FLEXIO_UART_HANDLE_COUNT; index++) - { - if (s_dmaPrivateHandle[index].base == NULL) - { - s_dmaPrivateHandle[index].base = base; - s_dmaPrivateHandle[index].handle = handle; - break; - } - } - - if (index == (uint8_t)FLEXIO_UART_HANDLE_COUNT) - { - return kStatus_OutOfRange; - } - - (void)memset(handle, 0, sizeof(*handle)); - - handle->rxState = (uint8_t)kFLEXIO_UART_RxIdle; - handle->txState = (uint8_t)kFLEXIO_UART_TxIdle; - - handle->callback = callback; - handle->userData = userData; - - handle->rxDmaHandle = rxDmaHandle; - handle->txDmaHandle = txDmaHandle; - - /* Set DMA channel configuration. */ - (void)memset(&dmaXferConfig, 0, sizeof(dmaXferConfig)); - dmaXferConfig.srcSize = kDMA_Transfersize8bits; - dmaXferConfig.destSize = kDMA_Transfersize8bits; - - /* Configure TX. */ - if (txDmaHandle != NULL) - { - DMA_SetCallback(txDmaHandle, FLEXIO_UART_TransferSendDMACallback, &s_dmaPrivateHandle[index]); - - DMA_ResetChannel(txDmaHandle->base, txDmaHandle->channel); - - dmaXferConfig.destAddr = FLEXIO_UART_GetTxDataRegisterAddress(base); - dmaXferConfig.enableSrcIncrement = true; - dmaXferConfig.enableDestIncrement = false; - DMA_SetTransferConfig(txDmaHandle->base, txDmaHandle->channel, &dmaXferConfig); - } - - /* Configure RX. */ - if (rxDmaHandle != NULL) - { - DMA_SetCallback(rxDmaHandle, FLEXIO_UART_TransferReceiveDMACallback, &s_dmaPrivateHandle[index]); - - DMA_ResetChannel(rxDmaHandle->base, rxDmaHandle->channel); - - dmaXferConfig.destAddr = 0U; - dmaXferConfig.srcAddr = FLEXIO_UART_GetRxDataRegisterAddress(base); - dmaXferConfig.enableSrcIncrement = false; - dmaXferConfig.enableDestIncrement = true; - DMA_SetTransferConfig(rxDmaHandle->base, rxDmaHandle->channel, &dmaXferConfig); - } - - return kStatus_Success; -} - -/*! - * brief Sends data using DMA. - * - * This function send data using DMA. This is non-blocking function, which returns - * right away. When all data is sent out, the send callback function is called. - * - * param base Pointer to FLEXIO_UART_Type structure - * param handle Pointer to flexio_uart_dma_handle_t structure - * param xfer FLEXIO_UART DMA transfer structure, see #flexio_uart_transfer_t. - * retval kStatus_Success if succeed, others failed. - * retval kStatus_FLEXIO_UART_TxBusy Previous transfer on going. - */ -status_t FLEXIO_UART_TransferSendDMA(FLEXIO_UART_Type *base, - flexio_uart_dma_handle_t *handle, - flexio_uart_transfer_t *xfer) -{ - assert(handle->txDmaHandle != NULL); - - status_t status; - - /* Return error if xfer invalid. */ - if ((0U == xfer->dataSize) || (NULL == xfer->data)) - { - return kStatus_InvalidArgument; - } - - /* If previous TX not finished. */ - if ((uint8_t)kFLEXIO_UART_TxBusy == handle->txState) - { - status = kStatus_FLEXIO_UART_TxBusy; - } - else - { - handle->txState = (uint8_t)kFLEXIO_UART_TxBusy; - handle->txDataSizeAll = xfer->dataSize; - - /* Set transfer data address and data size. */ - DMA_SetSourceAddress(handle->txDmaHandle->base, handle->txDmaHandle->channel, (uint32_t)xfer->data); - DMA_SetTransferSize(handle->txDmaHandle->base, handle->txDmaHandle->channel, xfer->dataSize); - - /* Enable FLEXIO UART TX DMA. */ - FLEXIO_UART_EnableTxDMA(base, true); - - /* Enable DMA transfer complete interrupt and start transfer. */ - DMA_EnableInterrupts(handle->txDmaHandle->base, handle->txDmaHandle->channel); - DMA_EnableChannelRequest(handle->txDmaHandle->base, handle->txDmaHandle->channel); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Receives data using DMA. - * - * This function receives data using DMA. This is non-blocking function, which returns - * right away. When all data is received, the receive callback function is called. - * - * param base Pointer to FLEXIO_UART_Type structure - * param handle Pointer to flexio_uart_dma_handle_t structure - * param xfer FLEXIO_UART DMA transfer structure, see #flexio_uart_transfer_t. - * retval kStatus_Success if succeed, others failed. - * retval kStatus_FLEXIO_UART_RxBusy Previous transfer on going. - */ -status_t FLEXIO_UART_TransferReceiveDMA(FLEXIO_UART_Type *base, - flexio_uart_dma_handle_t *handle, - flexio_uart_transfer_t *xfer) -{ - assert(handle->rxDmaHandle != NULL); - - status_t status; - - /* Return error if xfer invalid. */ - if ((0U == xfer->dataSize) || (NULL == xfer->data)) - { - return kStatus_InvalidArgument; - } - - /* If previous RX not finished. */ - if ((uint8_t)kFLEXIO_UART_RxBusy == handle->rxState) - { - status = kStatus_FLEXIO_UART_RxBusy; - } - else - { - handle->rxState = (uint8_t)kFLEXIO_UART_RxBusy; - handle->rxDataSizeAll = xfer->dataSize; - - /* Set transfer data address and data size. */ - DMA_SetDestinationAddress(handle->rxDmaHandle->base, handle->rxDmaHandle->channel, (uint32_t)xfer->data); - DMA_SetTransferSize(handle->rxDmaHandle->base, handle->rxDmaHandle->channel, xfer->dataSize); - - /* Enable FLEXIO UART RX DMA. */ - FLEXIO_UART_EnableRxDMA(base, true); - - /* Enable DMA transfer complete interrupt and start transfer. */ - DMA_EnableInterrupts(handle->rxDmaHandle->base, handle->rxDmaHandle->channel); - DMA_EnableChannelRequest(handle->rxDmaHandle->base, handle->rxDmaHandle->channel); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Aborts the sent data which using DMA. - * - * This function aborts the sent data which using DMA. - * - * param base Pointer to FLEXIO_UART_Type structure - * param handle Pointer to flexio_uart_dma_handle_t structure - */ -void FLEXIO_UART_TransferAbortSendDMA(FLEXIO_UART_Type *base, flexio_uart_dma_handle_t *handle) -{ - assert(handle->txDmaHandle != NULL); - - /* Disable FLEXIO UART TX DMA. */ - FLEXIO_UART_EnableTxDMA(base, false); - - /* Stop transfer. */ - DMA_StopTransfer(handle->txDmaHandle); - - /* Write DMA->DSR[DONE] to abort transfer and clear status. */ - DMA_ClearChannelStatusFlags(handle->txDmaHandle->base, handle->txDmaHandle->channel, - (uint32_t)kDMA_TransactionsDoneFlag); - - handle->txState = (uint8_t)kFLEXIO_UART_TxIdle; -} - -/*! - * brief Aborts the receive data which using DMA. - * - * This function aborts the receive data which using DMA. - * - * param base Pointer to FLEXIO_UART_Type structure - * param handle Pointer to flexio_uart_dma_handle_t structure - */ -void FLEXIO_UART_TransferAbortReceiveDMA(FLEXIO_UART_Type *base, flexio_uart_dma_handle_t *handle) -{ - assert(handle->rxDmaHandle != NULL); - - /* Disable FLEXIO UART RX DMA. */ - FLEXIO_UART_EnableRxDMA(base, false); - - /* Stop transfer. */ - DMA_StopTransfer(handle->rxDmaHandle); - - /* Write DMA->DSR[DONE] to abort transfer and clear status. */ - DMA_ClearChannelStatusFlags(handle->rxDmaHandle->base, handle->rxDmaHandle->channel, - (uint32_t)kDMA_TransactionsDoneFlag); - - handle->rxState = (uint8_t)kFLEXIO_UART_RxIdle; -} - -/*! - * brief Gets the number of bytes sent out. - * - * This function gets the number of bytes sent out. - * - * param base Pointer to FLEXIO_UART_Type structure - * param handle Pointer to flexio_uart_dma_handle_t structure - * param count Number of bytes sent so far by the non-blocking transaction. - * retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetSendCountDMA(FLEXIO_UART_Type *base, flexio_uart_dma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - assert(handle->txDmaHandle != NULL); - assert(count != NULL); - - if ((uint8_t)kFLEXIO_UART_TxIdle == handle->txState) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->txDataSizeAll - DMA_GetRemainingBytes(handle->txDmaHandle->base, handle->txDmaHandle->channel); - - return kStatus_Success; -} - -/*! - * brief Gets the number of bytes received. - * - * This function gets the number of bytes received. - * - * param base Pointer to FLEXIO_UART_Type structure - * param handle Pointer to flexio_uart_dma_handle_t structure - * param count Number of bytes received so far by the non-blocking transaction. - * retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetReceiveCountDMA(FLEXIO_UART_Type *base, flexio_uart_dma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - assert(handle->rxDmaHandle != NULL); - assert(count != NULL); - - if ((uint8_t)kFLEXIO_UART_RxIdle == handle->rxState) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->rxDataSizeAll - DMA_GetRemainingBytes(handle->rxDmaHandle->base, handle->rxDmaHandle->channel); - - return kStatus_Success; -} diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_uart_dma.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_uart_dma.h deleted file mode 100644 index b1907f26a8c..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_flexio_uart_dma.h +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_FLEXIO_UART_DMA_H_ -#define FSL_FLEXIO_UART_DMA_H_ - -#include "fsl_flexio_uart.h" -#include "fsl_dma.h" - -/*! - * @addtogroup flexio_dma_uart - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief FlexIO UART DMA driver version. */ -#define FSL_FLEXIO_UART_DMA_DRIVER_VERSION (MAKE_VERSION(2, 4, 0)) -/*! @} */ - -/* Forward declaration of the handle typedef. */ -typedef struct _flexio_uart_dma_handle flexio_uart_dma_handle_t; - -/*! @brief UART transfer callback function. */ -typedef void (*flexio_uart_dma_transfer_callback_t)(FLEXIO_UART_Type *base, - flexio_uart_dma_handle_t *handle, - status_t status, - void *userData); - -/*! - * @brief UART DMA handle - */ -struct _flexio_uart_dma_handle -{ - flexio_uart_dma_transfer_callback_t callback; /*!< Callback function. */ - void *userData; /*!< UART callback function parameter.*/ - - size_t txDataSizeAll; /*!< Total bytes to be sent. */ - size_t rxDataSizeAll; /*!< Total bytes to be received. */ - - dma_handle_t *txDmaHandle; /*!< The DMA TX channel used. */ - dma_handle_t *rxDmaHandle; /*!< The DMA RX channel used. */ - - volatile uint8_t txState; /*!< TX transfer state. */ - volatile uint8_t rxState; /*!< RX transfer state */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name eDMA transactional - * @{ - */ - -/*! - * @brief Initializes the FLEXIO_UART handle which is used in transactional functions. - * - * @param base Pointer to FLEXIO_UART_Type structure. - * @param handle Pointer to flexio_uart_dma_handle_t structure. - * @param callback FlexIO UART callback, NULL means no callback. - * @param userData User callback function data. - * @param txDmaHandle User requested DMA handle for TX DMA transfer. - * @param rxDmaHandle User requested DMA handle for RX DMA transfer. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO UART DMA type/handle table out of range. - */ -status_t FLEXIO_UART_TransferCreateHandleDMA(FLEXIO_UART_Type *base, - flexio_uart_dma_handle_t *handle, - flexio_uart_dma_transfer_callback_t callback, - void *userData, - dma_handle_t *txDmaHandle, - dma_handle_t *rxDmaHandle); - -/*! - * @brief Sends data using DMA. - * - * This function send data using DMA. This is non-blocking function, which returns - * right away. When all data is sent out, the send callback function is called. - * - * @param base Pointer to FLEXIO_UART_Type structure - * @param handle Pointer to flexio_uart_dma_handle_t structure - * @param xfer FLEXIO_UART DMA transfer structure, see #flexio_uart_transfer_t. - * @retval kStatus_Success if succeed, others failed. - * @retval kStatus_FLEXIO_UART_TxBusy Previous transfer on going. - */ -status_t FLEXIO_UART_TransferSendDMA(FLEXIO_UART_Type *base, - flexio_uart_dma_handle_t *handle, - flexio_uart_transfer_t *xfer); - -/*! - * @brief Receives data using DMA. - * - * This function receives data using DMA. This is non-blocking function, which returns - * right away. When all data is received, the receive callback function is called. - * - * @param base Pointer to FLEXIO_UART_Type structure - * @param handle Pointer to flexio_uart_dma_handle_t structure - * @param xfer FLEXIO_UART DMA transfer structure, see #flexio_uart_transfer_t. - * @retval kStatus_Success if succeed, others failed. - * @retval kStatus_FLEXIO_UART_RxBusy Previous transfer on going. - */ -status_t FLEXIO_UART_TransferReceiveDMA(FLEXIO_UART_Type *base, - flexio_uart_dma_handle_t *handle, - flexio_uart_transfer_t *xfer); - -/*! - * @brief Aborts the sent data which using DMA. - * - * This function aborts the sent data which using DMA. - * - * @param base Pointer to FLEXIO_UART_Type structure - * @param handle Pointer to flexio_uart_dma_handle_t structure - */ -void FLEXIO_UART_TransferAbortSendDMA(FLEXIO_UART_Type *base, flexio_uart_dma_handle_t *handle); - -/*! - * @brief Aborts the receive data which using DMA. - * - * This function aborts the receive data which using DMA. - * - * @param base Pointer to FLEXIO_UART_Type structure - * @param handle Pointer to flexio_uart_dma_handle_t structure - */ -void FLEXIO_UART_TransferAbortReceiveDMA(FLEXIO_UART_Type *base, flexio_uart_dma_handle_t *handle); - -/*! - * @brief Gets the number of bytes sent out. - * - * This function gets the number of bytes sent out. - * - * @param base Pointer to FLEXIO_UART_Type structure - * @param handle Pointer to flexio_uart_dma_handle_t structure - * @param count Number of bytes sent so far by the non-blocking transaction. - * @retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * @retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetSendCountDMA(FLEXIO_UART_Type *base, flexio_uart_dma_handle_t *handle, size_t *count); - -/*! - * @brief Gets the number of bytes received. - * - * This function gets the number of bytes received. - * - * @param base Pointer to FLEXIO_UART_Type structure - * @param handle Pointer to flexio_uart_dma_handle_t structure - * @param count Number of bytes received so far by the non-blocking transaction. - * @retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * @retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetReceiveCountDMA(FLEXIO_UART_Type *base, - flexio_uart_dma_handle_t *handle, - size_t *count); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_UART_DMA_H_ */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_ftfx_adapter.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_ftfx_adapter.h deleted file mode 100644 index 94b00fb9a31..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_ftfx_adapter.h +++ /dev/null @@ -1,400 +0,0 @@ -/* - * Copyright 2017-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - * - */ - -#ifndef FSL_FTFX_ADAPTER_H -#define FSL_FTFX_ADAPTER_H - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -#define INVALID_REG_MASK (0) -#define INVALID_REG_SHIFT (0) -#define INVALID_REG_ADDRESS (NULL) -#define INVALID_REG_VALUE (0x00U) - -/* @brief Flash register access type defines */ -#define FTFx_REG8_ACCESS_TYPE volatile uint8_t * -#define FTFx_REG32_ACCESS_TYPE volatile uint32_t * - -/*! - * @name Common flash register info defines - * @{ - */ -#if defined(FTFA) -#define FTFx FTFA -#define FTFx_BASE FTFA_BASE -#define FTFx_FSTAT_CCIF_MASK FTFA_FSTAT_CCIF_MASK -#define FTFx_FSTAT_CCIF_SHIFT FTFA_FSTAT_CCIF_SHIFT -#define FTFx_FSTAT_RDCOLERR_MASK FTFA_FSTAT_RDCOLERR_MASK -#define FTFx_FSTAT_ACCERR_MASK FTFA_FSTAT_ACCERR_MASK -#define FTFx_FSTAT_FPVIOL_MASK FTFA_FSTAT_FPVIOL_MASK -#define FTFx_FSTAT_MGSTAT0_MASK FTFA_FSTAT_MGSTAT0_MASK -#define FTFx_FSEC_SEC_MASK FTFA_FSEC_SEC_MASK -#define FTFx_FSEC_KEYEN_MASK FTFA_FSEC_KEYEN_MASK -#if defined(FSL_FEATURE_FLASH_HAS_FLEX_RAM) && FSL_FEATURE_FLASH_HAS_FLEX_RAM -#define FTFx_FCNFG_RAMRDY_MASK FTFA_FCNFG_RAMRDY_MASK -#endif /* FSL_FEATURE_FLASH_HAS_FLEX_RAM */ -#if defined(FSL_FEATURE_FLASH_HAS_FLEX_NVM) && FSL_FEATURE_FLASH_HAS_FLEX_NVM -#define FTFx_FCNFG_EEERDY_MASK FTFA_FCNFG_EEERDY_MASK -#endif /* FSL_FEATURE_FLASH_HAS_FLEX_NVM */ -#elif defined(FTFE) -#define FTFx FTFE -#define FTFx_BASE FTFE_BASE -#define FTFx_FSTAT_CCIF_MASK FTFE_FSTAT_CCIF_MASK -#define FTFx_FSTAT_CCIF_SHIFT FTFE_FSTAT_CCIF_SHIFT -#define FTFx_FSTAT_RDCOLERR_MASK FTFE_FSTAT_RDCOLERR_MASK -#define FTFx_FSTAT_ACCERR_MASK FTFE_FSTAT_ACCERR_MASK -#define FTFx_FSTAT_FPVIOL_MASK FTFE_FSTAT_FPVIOL_MASK -#define FTFx_FSTAT_MGSTAT0_MASK FTFE_FSTAT_MGSTAT0_MASK -#define FTFx_FSEC_SEC_MASK FTFE_FSEC_SEC_MASK -#define FTFx_FSEC_KEYEN_MASK FTFE_FSEC_KEYEN_MASK -#if defined(FSL_FEATURE_FLASH_HAS_FLEX_RAM) && FSL_FEATURE_FLASH_HAS_FLEX_RAM -#define FTFx_FCNFG_RAMRDY_MASK FTFE_FCNFG_RAMRDY_MASK -#endif /* FSL_FEATURE_FLASH_HAS_FLEX_RAM */ -#if defined(FSL_FEATURE_FLASH_HAS_FLEX_NVM) && FSL_FEATURE_FLASH_HAS_FLEX_NVM -#define FTFx_FCNFG_EEERDY_MASK FTFE_FCNFG_EEERDY_MASK -#endif /* FSL_FEATURE_FLASH_HAS_FLEX_NVM */ -#elif defined(FTFL) -#define FTFx FTFL -#define FTFx_BASE FTFL_BASE -#define FTFx_FSTAT_CCIF_MASK FTFL_FSTAT_CCIF_MASK -#define FTFx_FSTAT_CCIF_SHIFT FTFL_FSTAT_CCIF_SHIFT -#define FTFx_FSTAT_RDCOLERR_MASK FTFL_FSTAT_RDCOLERR_MASK -#define FTFx_FSTAT_ACCERR_MASK FTFL_FSTAT_ACCERR_MASK -#define FTFx_FSTAT_FPVIOL_MASK FTFL_FSTAT_FPVIOL_MASK -#define FTFx_FSTAT_MGSTAT0_MASK FTFL_FSTAT_MGSTAT0_MASK -#define FTFx_FSEC_SEC_MASK FTFL_FSEC_SEC_MASK -#define FTFx_FSEC_KEYEN_MASK FTFL_FSEC_KEYEN_MASK -#if defined(FSL_FEATURE_FLASH_HAS_FLEX_RAM) && FSL_FEATURE_FLASH_HAS_FLEX_RAM -#define FTFx_FCNFG_RAMRDY_MASK FTFL_FCNFG_RAMRDY_MASK -#endif /* FSL_FEATURE_FLASH_HAS_FLEX_RAM */ -#if defined(FSL_FEATURE_FLASH_HAS_FLEX_NVM) && FSL_FEATURE_FLASH_HAS_FLEX_NVM -#define FTFx_FCNFG_EEERDY_MASK FTFL_FCNFG_EEERDY_MASK -#endif /* FSL_FEATURE_FLASH_HAS_FLEX_NVM */ -#else -#error "Unknown flash controller" -#endif -/*! @} */ - -/*! - * @name Common flash register access info defines - * @{ - */ -#define FTFx_FCCOB3_REG (FTFx->FCCOB3) -#define FTFx_FCCOB5_REG (FTFx->FCCOB5) -#define FTFx_FCCOB6_REG (FTFx->FCCOB6) -#define FTFx_FCCOB7_REG (FTFx->FCCOB7) - -#if defined(FSL_FEATURE_FLASH_HAS_MULTIPLE_FLASH) || defined(FSL_FEATURE_FLASH_PFLASH_1_START_ADDRESS) -#if defined(FTFA_FPROTSL_PROTS_MASK) || defined(FTFE_FPROTSL_PROTS_MASK) || defined(FTFL_FPROTSL_PROTS_MASK) -#define FTFx_FLASH1_HAS_INT_PROT_REG (1) -#define FTFx_FPROTSH_REG (FTFx->FPROTSH) -#define FTFx_FPROTSL_REG (FTFx->FPROTSL) -#else -#define FTFx_FLASH1_HAS_INT_PROT_REG (0) -#endif -#endif - -#if defined(FTFA_FPROTH0_PROT_MASK) || defined(FTFE_FPROTH0_PROT_MASK) || defined(FTFL_FPROTH0_PROT_MASK) -#define FTFx_FLASH0_HAS_HIGH_PROT_REG (1) -#define FTFx_FPROT_HIGH_REG (FTFx->FPROTH3) -#define FTFx_FPROTH3_REG (FTFx->FPROTH3) -#define FTFx_FPROTH2_REG (FTFx->FPROTH2) -#define FTFx_FPROTH1_REG (FTFx->FPROTH1) -#define FTFx_FPROTH0_REG (FTFx->FPROTH0) -#else -#define FTFx_FLASH0_HAS_HIGH_PROT_REG (0) -#endif - -#if defined(FTFA_FPROTL0_PROT_MASK) || defined(FTFE_FPROTL0_PROT_MASK) || defined(FTFL_FPROTL0_PROT_MASK) -#define FTFx_FPROT_LOW_REG (FTFx->FPROTL3) -#define FTFx_FPROTL3_REG (FTFx->FPROTL3) -#define FTFx_FPROTL2_REG (FTFx->FPROTL2) -#define FTFx_FPROTL1_REG (FTFx->FPROTL1) -#define FTFx_FPROTL0_REG (FTFx->FPROTL0) -#elif defined(FTFA_FPROT0_PROT_MASK) || defined(FTFE_FPROT0_PROT_MASK) || defined(FTFL_FPROT0_PROT_MASK) -#define FTFx_FPROT_LOW_REG (FTFx->FPROT3) -#define FTFx_FPROTL3_REG (FTFx->FPROT3) -#define FTFx_FPROTL2_REG (FTFx->FPROT2) -#define FTFx_FPROTL1_REG (FTFx->FPROT1) -#define FTFx_FPROTL0_REG (FTFx->FPROT0) -#endif - -#if defined(FSL_FEATURE_FLASH_HAS_MULTIPLE_FLASH) || defined(FSL_FEATURE_FLASH_PFLASH_1_START_ADDRESS) -#if defined(FTFA_FACSSS_SGSIZE_S_MASK) || defined(FTFE_FACSSS_SGSIZE_S_MASK) || defined(FTFL_FACSSS_SGSIZE_S_MASK) -#define FTFx_FLASH1_HAS_INT_XACC_REG (1) -#define FTFx_XACCSH_REG (FTFx->XACCSH) -#define FTFx_XACCSL_REG (FTFx->XACCSL) -#define FTFx_FACSSS_REG (FTFx->FACSSS) -#define FTFx_FACSNS_REG (FTFx->FACSNS) -#else -#define FTFx_FLASH1_HAS_INT_XACC_REG (0) -#endif -#endif - -#if (defined(FTFA_FACSS_SGSIZE_MASK) || defined(FTFE_FACSS_SGSIZE_MASK) || defined(FTFL_FACSS_SGSIZE_MASK) || \ - defined(FTFA_FACSS_SGSIZE_S_MASK) || defined(FTFE_FACSS_SGSIZE_S_MASK) || defined(FTFL_FACSS_SGSIZE_S_MASK)) -#define FTFx_FLASH0_HAS_INT_XACC_REG (1) -#define FTFx_XACCH3_REG (FTFx->XACCH3) -#define FTFx_XACCL3_REG (FTFx->XACCL3) -#define FTFx_FACSS_REG (FTFx->FACSS) -#define FTFx_FACSN_REG (FTFx->FACSN) -#else -#define FTFx_FLASH0_HAS_INT_XACC_REG (0) -#endif -/*! @} */ - -/*! - * @brief MCM cache register access info defines. - */ -#if defined(MCM_PLACR_CFCC_MASK) - #define MCM_CACHE_CLEAR_MASK MCM_PLACR_CFCC_MASK - #define MCM_CACHE_CLEAR_SHIFT MCM_PLACR_CFCC_SHIFT -#else - #define MCM_CACHE_CLEAR_MASK INVALID_REG_MASK - #define MCM_CACHE_CLEAR_SHIFT INVALID_REG_SHIFT -#endif - -#if defined(MCM0) - #define MCM0_CACHE_REG MCM0->PLACR -#elif defined(MCM) && (!defined(MCM1)) - #define MCM0_CACHE_REG MCM->PLACR -#else - #define MCM0_CACHE_REG (INVALID_REG_ADDRESS) -#endif - -#if defined(MCM1) - #define MCM1_CACHE_REG MCM1->PLACR -#elif defined(MCM) && (!defined(MCM0)) - #define MCM1_CACHE_REG MCM->PLACR -#else - #define MCM1_CACHE_REG (INVALID_REG_ADDRESS) -#endif - -/*! - * @brief FMC cache register access info defines. - */ -#if defined(FMC_PFB01CR_S_INV_MASK) -#define FMC_SPECULATION_INVALIDATE_MASK FMC_PFB01CR_S_INV_MASK -#define FMC_SPECULATION_INVALIDATE_SHIFT FMC_PFB01CR_S_INV_SHIFT -#define FMC_SPECULATION_INVALIDATE_REG FMC->PFB01CR -#elif defined(FMC_PFB01CR_S_B_INV_MASK) -#define FMC_SPECULATION_INVALIDATE_MASK FMC_PFB01CR_S_B_INV_MASK -#define FMC_SPECULATION_INVALIDATE_SHIFT FMC_PFB01CR_S_B_INV_SHIFT -#define FMC_SPECULATION_INVALIDATE_REG FMC->PFB01CR -#elif defined(FMC_PFB0CR_S_INV_MASK) -#define FMC_SPECULATION_INVALIDATE_MASK FMC_PFB0CR_S_INV_MASK -#define FMC_SPECULATION_INVALIDATE_SHIFT FMC_PFB0CR_S_INV_SHIFT -#define FMC_SPECULATION_INVALIDATE_REG FMC->PFB0CR -#elif defined(FMC_PFB0CR_S_B_INV_MASK) -#define FMC_SPECULATION_INVALIDATE_MASK FMC_PFB0CR_S_B_INV_MASK -#define FMC_SPECULATION_INVALIDATE_SHIFT FMC_PFB0CR_S_B_INV_SHIFT -#define FMC_SPECULATION_INVALIDATE_REG FMC->PFB0CR -#else -#define FMC_SPECULATION_INVALIDATE_MASK INVALID_REG_MASK -#define FMC_SPECULATION_INVALIDATE_SHIFT INVALID_REG_SHIFT -#define FMC_SPECULATION_INVALIDATE(x) (((uint32_t)(((uint32_t)(x)) << INVALID_REG_SHIFT)) & INVALID_REG_MASK) -#define FMC_SPECULATION_INVALIDATE_REG (INVALID_REG_ADDRESS) -#endif - -#if defined(FMC_PFB01CR_CINV_WAY_MASK) -#define FMC_CACHE_CLEAR_MASK FMC_PFB01CR_CINV_WAY_MASK -#define FMC_CACHE_CLEAR_SHIFT FMC_PFB01CR_CINV_WAY_SHIFT -#define FMC_CACHE_CLEAR(x) FMC_PFB01CR_CINV_WAY(x) -#elif defined(FMC_PFB0CR_CINV_WAY_MASK) -#define FMC_CACHE_CLEAR_MASK FMC_PFB0CR_CINV_WAY_MASK -#define FMC_CACHE_CLEAR_SHIFT FMC_PFB0CR_CINV_WAY_SHIFT -#define FMC_CACHE_CLEAR(x) FMC_PFB0CR_CINV_WAY(x) -#else -#define FMC_CACHE_CLEAR_MASK INVALID_REG_MASK -#define FMC_CACHE_CLEAR_SHIFT INVALID_REG_SHIFT -#define FMC_CACHE_CLEAR(x) (((uint32_t)(((uint32_t)(x)) << INVALID_REG_SHIFT)) & INVALID_REG_MASK) -#endif - -#if defined(FMC_PFB01CR_B0DPE_MASK) -#define FMC_CACHE_B0DPE_MASK FMC_PFB01CR_B0DPE_MASK -#define FMC_CACHE_B0IPE_MASK FMC_PFB01CR_B0IPE_MASK -#define FMC_CACHE_REG FMC->PFB01CR -#elif defined(FMC_PFB0CR_B0DPE_MASK) -#define FMC_CACHE_B0DPE_MASK FMC_PFB0CR_B0DPE_MASK -#define FMC_CACHE_B0IPE_MASK FMC_PFB0CR_B0IPE_MASK -#define FMC_CACHE_REG FMC->PFB0CR -#else -#define FMC_CACHE_B0DPE_MASK INVALID_REG_MASK -#define FMC_CACHE_B0IPE_MASK INVALID_REG_MASK -#define FMC_CACHE_REG (INVALID_REG_ADDRESS) -#endif - -/*! - * @brief MSCM cache register access info defines. - */ -#if defined(MSCM_OCMDR_OCM1_MASK) -#define MSCM_SPECULATION_SET_MASK MSCM_OCMDR_OCM1_MASK -#define MSCM_SPECULATION_SET_SHIFT MSCM_OCMDR_OCM1_SHIFT -#define MSCM_SPECULATION_SET(x) MSCM_OCMDR_OCM1(x) -#elif defined(MSCM_OCMDR0_OCM1_MASK) || defined(MSCM_OCMDR1_OCM1_MASK) -#define MSCM_SPECULATION_SET_MASK MSCM_OCMDR0_OCM1_MASK -#define MSCM_SPECULATION_SET_SHIFT MSCM_OCMDR0_OCM1_SHIFT -#define MSCM_SPECULATION_SET(x) MSCM_OCMDR0_OCM1(x) -#elif defined(MSCM_OCMDR_OCMC1_MASK) -#define MSCM_SPECULATION_SET_MASK MSCM_OCMDR_OCMC1_MASK -#define MSCM_SPECULATION_SET_SHIFT MSCM_OCMDR_OCMC1_SHIFT -#define MSCM_SPECULATION_SET(x) MSCM_OCMDR_OCMC1(x) -#else -#define MSCM_SPECULATION_SET_MASK INVALID_REG_MASK -#define MSCM_SPECULATION_SET_SHIFT INVALID_REG_SHIFT -#define MSCM_SPECULATION_SET(x) (((uint32_t)(((uint32_t)(x)) << INVALID_REG_SHIFT)) & INVALID_REG_MASK) -#endif - -#if defined(MSCM_OCMDR_OCM2_MASK) -#define MSCM_CACHE_CLEAR_MASK MSCM_OCMDR_OCM2_MASK -#define MSCM_CACHE_CLEAR_SHIFT MSCM_OCMDR_OCM2_SHIFT -#define MSCM_CACHE_CLEAR(x) MSCM_OCMDR_OCM2(x) -#else -#define MSCM_CACHE_CLEAR_MASK INVALID_REG_MASK -#define MSCM_CACHE_CLEAR_SHIFT INVALID_REG_SHIFT -#define MSCM_CACHE_CLEAR(x) (((uint32_t)(((uint32_t)(x)) << INVALID_REG_SHIFT)) & INVALID_REG_MASK) -#endif - -#if defined(MSCM_OCMDR_OCM1_MASK) || defined(MSCM_OCMDR_OCMC1_MASK) -#define MSCM_OCMDR0_REG MSCM->OCMDR[0] -#define MSCM_OCMDR1_REG MSCM->OCMDR[1] -#elif defined(MSCM_OCMDR0_OCM1_MASK) || defined(MSCM_OCMDR1_OCM1_MASK) -#define MSCM_OCMDR0_REG MSCM->OCMDR0 -#define MSCM_OCMDR1_REG MSCM->OCMDR1 -#else -#define MSCM_OCMDR0_REG (INVALID_REG_ADDRESS) -#define MSCM_OCMDR1_REG (INVALID_REG_ADDRESS) -#endif - -/*! - * @brief MSCM prefetch speculation defines. - */ -#define MSCM_OCMDR_OCMC1_DFDS_MASK (0x10U) -#define MSCM_OCMDR_OCMC1_DFCS_MASK (0x20U) -#define MSCM_OCMDR_OCMC1_DFDS_SHIFT (4U) -#define MSCM_OCMDR_OCMC1_DFCS_SHIFT (5U) - -/*! - * @brief SIM PFSIZE register access info defines. - */ -#if defined(SIM_FCFG1_CORE0_PFSIZE_MASK) -#define SIM_FLASH0_PFSIZE_MASK SIM_FCFG1_CORE0_PFSIZE_MASK -#define SIM_FLASH0_PFSIZE_SHIFT SIM_FCFG1_CORE0_PFSIZE_SHIFT -#define SIM_FCFG1_REG SIM->FCFG1 -#elif defined(SIM_FCFG1_PFSIZE_MASK) -#define SIM_FLASH0_PFSIZE_MASK SIM_FCFG1_PFSIZE_MASK -#define SIM_FLASH0_PFSIZE_SHIFT SIM_FCFG1_PFSIZE_SHIFT -#define SIM_FCFG1_REG SIM->FCFG1 -#else -#define SIM_FLASH0_PFSIZE_MASK INVALID_REG_MASK -#define SIM_FLASH0_PFSIZE_SHIFT INVALID_REG_SHIFT -#define SIM_FCFG1_REG INVALID_REG_VALUE -#endif - -#if defined(SIM_FCFG1_CORE1_PFSIZE_MASK) -#define SIM_FLASH1_PFSIZE_MASK SIM_FCFG1_CORE1_PFSIZE_MASK -#define SIM_FLASH1_PFSIZE_SHIFT SIM_FCFG1_CORE1_PFSIZE_SHIFT -#else -#define SIM_FLASH1_PFSIZE_MASK INVALID_REG_MASK -#define SIM_FLASH1_PFSIZE_SHIFT INVALID_REG_SHIFT -#endif - -/*! - * @name Dual core/flash configuration - * @{ - */ -/*! @brief Redefines some flash features. */ -#if defined(FSL_FEATURE_FLASH_CURRENT_CORE_ID) -#if (FSL_FEATURE_FLASH_CURRENT_CORE_ID == 0u) -#define FLASH0_FEATURE_PFLASH_START_ADDRESS FSL_FEATURE_FLASH_PFLASH_START_ADDRESS -#define FLASH0_FEATURE_PFLASH_BLOCK_COUNT FSL_FEATURE_FLASH_PFLASH_BLOCK_COUNT -#define FLASH0_FEATURE_PFLASH_BLOCK_SIZE FSL_FEATURE_FLASH_PFLASH_BLOCK_SIZE -#define FLASH0_FEATURE_PFLASH_BLOCK_SECTOR_SIZE FSL_FEATURE_FLASH_PFLASH_BLOCK_SECTOR_SIZE -#define FLASH0_FEATURE_PFLASH_BLOCK_WRITE_UNIT_SIZE FSL_FEATURE_FLASH_PFLASH_BLOCK_WRITE_UNIT_SIZE -#define FLASH0_FEATURE_PFLASH_SECTOR_CMD_ADDRESS_ALIGMENT FSL_FEATURE_FLASH_PFLASH_SECTOR_CMD_ADDRESS_ALIGMENT -#define FLASH0_FEATURE_PFLASH_SECTION_CMD_ADDRESS_ALIGMENT FSL_FEATURE_FLASH_PFLASH_SECTION_CMD_ADDRESS_ALIGMENT -#define FLASH0_FEATURE_PFLASH_PROTECTION_REGION_COUNT FSL_FEATURE_FLASH_PFLASH_PROTECTION_REGION_COUNT -#define FLASH1_FEATURE_PFLASH_START_ADDRESS FSL_FEATURE_FLASH_PFLASH_1_START_ADDRESS -#define FLASH1_FEATURE_PFLASH_BLOCK_COUNT FSL_FEATURE_FLASH_PFLASH_1_BLOCK_COUNT -#define FLASH1_FEATURE_PFLASH_BLOCK_SIZE FSL_FEATURE_FLASH_PFLASH_1_BLOCK_SIZE -#define FLASH1_FEATURE_PFLASH_BLOCK_SECTOR_SIZE FSL_FEATURE_FLASH_PFLASH_1_BLOCK_SECTOR_SIZE -#define FLASH1_FEATURE_PFLASH_BLOCK_WRITE_UNIT_SIZE FSL_FEATURE_FLASH_PFLASH_1_BLOCK_WRITE_UNIT_SIZE -#if defined(FSL_FEATURE_FLASH_PFLASH_1_SECTOR_CMD_ADDRESS_ALIGMENT) && \ - defined(FSL_FEATURE_FLASH_PFLASH_1_SECTION_CMD_ADDRESS_ALIGMENT) -#define FLASH1_FEATURE_PFLASH_SECTOR_CMD_ADDRESS_ALIGMENT FSL_FEATURE_FLASH_PFLASH_1_SECTOR_CMD_ADDRESS_ALIGMENT -#define FLASH1_FEATURE_PFLASH_SECTION_CMD_ADDRESS_ALIGMENT FSL_FEATURE_FLASH_PFLASH_1_SECTION_CMD_ADDRESS_ALIGMENT -#else -#define FLASH1_FEATURE_PFLASH_SECTOR_CMD_ADDRESS_ALIGMENT FSL_FEATURE_FLASH_PFLASH_SECTOR_CMD_ADDRESS_ALIGMENT -#define FLASH1_FEATURE_PFLASH_SECTION_CMD_ADDRESS_ALIGMENT FSL_FEATURE_FLASH_PFLASH_SECTION_CMD_ADDRESS_ALIGMENT -#endif -#define FLASH1_FEATURE_PFLASH_PROTECTION_REGION_COUNT FSL_FEATURE_FLASH_PFLASH_1_PROTECTION_REGION_COUNT -#elif (FSL_FEATURE_FLASH_CURRENT_CORE_ID == 1u) -#define FLASH0_FEATURE_PFLASH_START_ADDRESS FSL_FEATURE_FLASH_PFLASH_1_START_ADDRESS -#define FLASH0_FEATURE_PFLASH_BLOCK_COUNT FSL_FEATURE_FLASH_PFLASH_1_BLOCK_COUNT -#define FLASH0_FEATURE_PFLASH_BLOCK_SIZE FSL_FEATURE_FLASH_PFLASH_1_BLOCK_SIZE -#define FLASH0_FEATURE_PFLASH_BLOCK_SECTOR_SIZE FSL_FEATURE_FLASH_PFLASH_1_BLOCK_SECTOR_SIZE -#define FLASH0_FEATURE_PFLASH_BLOCK_WRITE_UNIT_SIZE FSL_FEATURE_FLASH_PFLASH_1_BLOCK_WRITE_UNIT_SIZE -#if defined(FSL_FEATURE_FLASH_PFLASH_1_SECTOR_CMD_ADDRESS_ALIGMENT) && \ - defined(FSL_FEATURE_FLASH_PFLASH_1_SECTION_CMD_ADDRESS_ALIGMENT) -#define FLASH0_FEATURE_PFLASH_SECTOR_CMD_ADDRESS_ALIGMENT FSL_FEATURE_FLASH_PFLASH_1_SECTOR_CMD_ADDRESS_ALIGMENT -#define FLASH0_FEATURE_PFLASH_SECTION_CMD_ADDRESS_ALIGMENT FSL_FEATURE_FLASH_PFLASH_1_SECTION_CMD_ADDRESS_ALIGMENT -#else -#define FLASH0_FEATURE_PFLASH_SECTOR_CMD_ADDRESS_ALIGMENT FSL_FEATURE_FLASH_PFLASH_SECTOR_CMD_ADDRESS_ALIGMENT -#define FLASH0_FEATURE_PFLASH_SECTION_CMD_ADDRESS_ALIGMENT FSL_FEATURE_FLASH_PFLASH_SECTION_CMD_ADDRESS_ALIGMENT -#endif -#define FLASH0_FEATURE_PFLASH_PROTECTION_REGION_COUNT FSL_FEATURE_FLASH_PFLASH_1_PROTECTION_REGION_COUNT -#define FLASH1_FEATURE_PFLASH_START_ADDRESS FSL_FEATURE_FLASH_PFLASH_START_ADDRESS -#define FLASH1_FEATURE_PFLASH_BLOCK_COUNT FSL_FEATURE_FLASH_PFLASH_BLOCK_COUNT -#define FLASH1_FEATURE_PFLASH_BLOCK_SIZE FSL_FEATURE_FLASH_PFLASH_BLOCK_SIZE -#define FLASH1_FEATURE_PFLASH_BLOCK_SECTOR_SIZE FSL_FEATURE_FLASH_PFLASH_BLOCK_SECTOR_SIZE -#define FLASH1_FEATURE_PFLASH_BLOCK_WRITE_UNIT_SIZE FSL_FEATURE_FLASH_PFLASH_BLOCK_WRITE_UNIT_SIZE -#define FLASH1_FEATURE_PFLASH_SECTOR_CMD_ADDRESS_ALIGMENT FSL_FEATURE_FLASH_PFLASH_SECTOR_CMD_ADDRESS_ALIGMENT -#define FLASH1_FEATURE_PFLASH_SECTION_CMD_ADDRESS_ALIGMENT FSL_FEATURE_FLASH_PFLASH_SECTION_CMD_ADDRESS_ALIGMENT -#define FLASH1_FEATURE_PFLASH_PROTECTION_REGION_COUNT FSL_FEATURE_FLASH_PFLASH_PROTECTION_REGION_COUNT -#endif -#else /* undfine FSL_FEATURE_FLASH_CURRENT_CORE_ID */ -#define FLASH0_FEATURE_PFLASH_START_ADDRESS FSL_FEATURE_FLASH_PFLASH_START_ADDRESS -#define FLASH0_FEATURE_PFLASH_BLOCK_COUNT FSL_FEATURE_FLASH_PFLASH_BLOCK_COUNT -#define FLASH0_FEATURE_PFLASH_BLOCK_SIZE FSL_FEATURE_FLASH_PFLASH_BLOCK_SIZE -#define FLASH0_FEATURE_PFLASH_BLOCK_SECTOR_SIZE FSL_FEATURE_FLASH_PFLASH_BLOCK_SECTOR_SIZE -#define FLASH0_FEATURE_PFLASH_BLOCK_WRITE_UNIT_SIZE FSL_FEATURE_FLASH_PFLASH_BLOCK_WRITE_UNIT_SIZE -#define FLASH0_FEATURE_PFLASH_SECTOR_CMD_ADDRESS_ALIGMENT FSL_FEATURE_FLASH_PFLASH_SECTOR_CMD_ADDRESS_ALIGMENT -#define FLASH0_FEATURE_PFLASH_SECTION_CMD_ADDRESS_ALIGMENT FSL_FEATURE_FLASH_PFLASH_SECTION_CMD_ADDRESS_ALIGMENT -#define FLASH0_FEATURE_PFLASH_PROTECTION_REGION_COUNT FSL_FEATURE_FLASH_PFLASH_PROTECTION_REGION_COUNT -#if defined(FSL_FEATURE_FLASH_HAS_MULTIPLE_FLASH) || defined(FSL_FEATURE_FLASH_PFLASH_1_START_ADDRESS) -#define FLASH1_FEATURE_PFLASH_START_ADDRESS FSL_FEATURE_FLASH_PFLASH_1_START_ADDRESS -#define FLASH1_FEATURE_PFLASH_BLOCK_COUNT FSL_FEATURE_FLASH_PFLASH_1_BLOCK_COUNT -#define FLASH1_FEATURE_PFLASH_BLOCK_SIZE FSL_FEATURE_FLASH_PFLASH_1_BLOCK_SIZE -#define FLASH1_FEATURE_PFLASH_BLOCK_SECTOR_SIZE FSL_FEATURE_FLASH_PFLASH_1_BLOCK_SECTOR_SIZE -#define FLASH1_FEATURE_PFLASH_BLOCK_WRITE_UNIT_SIZE FSL_FEATURE_FLASH_PFLASH_1_BLOCK_WRITE_UNIT_SIZE -#define FLASH1_FEATURE_PFLASH_SECTOR_CMD_ADDRESS_ALIGMENT FSL_FEATURE_FLASH_PFLASH_SECTOR_CMD_ADDRESS_ALIGMENT -#define FLASH1_FEATURE_PFLASH_SECTION_CMD_ADDRESS_ALIGMENT FSL_FEATURE_FLASH_PFLASH_SECTION_CMD_ADDRESS_ALIGMENT -#define FLASH1_FEATURE_PFLASH_PROTECTION_REGION_COUNT FSL_FEATURE_FLASH_PFLASH_PROTECTION_REGION_COUNT -#else /* undfine FSL_FEATURE_FLASH_HAS_MULTIPLE_FLASH or FSL_FEATURE_FLASH_PFLASH_1_START_ADDRESS */ -#define FLASH1_FEATURE_PFLASH_START_ADDRESS 0 -#define FLASH1_FEATURE_PFLASH_BLOCK_COUNT 0 -#define FLASH1_FEATURE_PFLASH_BLOCK_SIZE 0 -#define FLASH1_FEATURE_PFLASH_BLOCK_SECTOR_SIZE 0 -#define FLASH1_FEATURE_PFLASH_BLOCK_WRITE_UNIT_SIZE 0 -#define FLASH1_FEATURE_PFLASH_SECTOR_CMD_ADDRESS_ALIGMENT 0 -#define FLASH1_FEATURE_PFLASH_SECTION_CMD_ADDRESS_ALIGMENT 0 -#define FLASH1_FEATURE_PFLASH_PROTECTION_REGION_COUNT 0 -#endif -#endif - -#if FLASH0_FEATURE_PFLASH_PROTECTION_REGION_COUNT > FLASH1_FEATURE_PFLASH_PROTECTION_REGION_COUNT -#define MAX_FLASH_PROT_REGION_COUNT FLASH0_FEATURE_PFLASH_PROTECTION_REGION_COUNT -#else -#define MAX_FLASH_PROT_REGION_COUNT FLASH1_FEATURE_PFLASH_PROTECTION_REGION_COUNT -#endif - -/*! @} */ - -#endif /* FSL_FTFX_ADAPTER_H */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_ftfx_cache.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_ftfx_cache.c deleted file mode 100644 index 3912c3de526..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_ftfx_cache.c +++ /dev/null @@ -1,555 +0,0 @@ -/* - * Copyright 2013-2016 Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - * - */ - -#include "fsl_ftfx_cache.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flash" -#endif - -/*! - * @name Flash cache and speculation control defines - * @{ - */ -#if defined(MCM_PLACR_CFCC_MASK) -#define FLASH_CACHE_IS_CONTROLLED_BY_MCM (1u) -#else -#define FLASH_CACHE_IS_CONTROLLED_BY_MCM (0u) -#endif - -#define FLASH_CACHE_IS_CONTROLLED_BY_MSCM (0u) - -#if defined(FMC_PFB0CR_CINV_WAY_MASK) || defined(FMC_PFB01CR_CINV_WAY_MASK) -#define FLASH_CACHE_IS_CONTROLLED_BY_FMC (1u) -#else -#define FLASH_CACHE_IS_CONTROLLED_BY_FMC (0u) -#endif - -#if defined(MCM_PLACR_DFCS_MASK) -#define FLASH_PREFETCH_SPECULATION_IS_CONTROLLED_BY_MCM (1u) -#else -#define FLASH_PREFETCH_SPECULATION_IS_CONTROLLED_BY_MCM (0u) -#endif - -#if defined(MSCM_OCMDR_OCMC1_MASK) || defined(MSCM_OCMDR_OCM1_MASK) || defined(MSCM_OCMDR0_OCM1_MASK) || \ - defined(MSCM_OCMDR1_OCM1_MASK) -#define FLASH_PREFETCH_SPECULATION_IS_CONTROLLED_BY_MSCM (1u) -#else -#define FLASH_PREFETCH_SPECULATION_IS_CONTROLLED_BY_MSCM (0u) -#endif - -#if defined(FMC_PFB0CR_S_INV_MASK) || defined(FMC_PFB0CR_S_B_INV_MASK) || defined(FMC_PFB01CR_S_INV_MASK) || \ - defined(FMC_PFB01CR_S_B_INV_MASK) -#define FLASH_PREFETCH_SPECULATION_IS_CONTROLLED_BY_FMC (1u) -#else -#define FLASH_PREFETCH_SPECULATION_IS_CONTROLLED_BY_FMC (0u) -#endif - -#if FLASH_PREFETCH_SPECULATION_IS_CONTROLLED_BY_MSCM || FLASH_PREFETCH_SPECULATION_IS_CONTROLLED_BY_FMC || \ - FLASH_CACHE_IS_CONTROLLED_BY_MCM || FLASH_CACHE_IS_CONTROLLED_BY_FMC || FLASH_CACHE_IS_CONTROLLED_BY_MSCM -#define FLASH_IS_CACHE_INVALIDATION_AVAILABLE (1) -#else -#define FLASH_IS_CACHE_INVALIDATION_AVAILABLE (0u) -#endif -/*@}*/ - -/*! @brief A function pointer used to point to relocated ftfx_common_bit_operation() */ -typedef void (*callftfxCommonBitOperation_t)(FTFx_REG32_ACCESS_TYPE base, - uint32_t bitMask, - uint32_t bitShift, - uint32_t bitValue); - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -#if FLASH_CACHE_IS_CONTROLLED_BY_MCM -/*! @brief Performs the cache clear to the flash by MCM.*/ -void mcm_flash_cache_clear(ftfx_cache_config_t *config); -#endif /* FLASH_CACHE_IS_CONTROLLED_BY_MCM */ - -#if FLASH_CACHE_IS_CONTROLLED_BY_MSCM -/*! @brief Performs the cache clear to the flash by MSCM.*/ -void mscm_flash_cache_clear(ftfx_cache_config_t *config); -#endif /* FLASH_CACHE_IS_CONTROLLED_BY_MSCM */ - -#if FLASH_CACHE_IS_CONTROLLED_BY_FMC -/*! @brief Performs the cache clear to the flash by FMC.*/ -void fmc_flash_cache_clear(ftfx_cache_config_t *config); -#endif /* FLASH_CACHE_IS_CONTROLLED_BY_FMC */ - -#if FLASH_PREFETCH_SPECULATION_IS_CONTROLLED_BY_MSCM -/*! @brief Sets the prefetch speculation buffer to the flash by MSCM.*/ -void mscm_flash_prefetch_speculation_enable(ftfx_cache_config_t *config, bool enable); -#endif /* FLASH_PREFETCH_SPECULATION_IS_CONTROLLED_BY_MSCM */ - -#if FLASH_PREFETCH_SPECULATION_IS_CONTROLLED_BY_FMC -/*! @brief Performs the prefetch speculation buffer clear to the flash by FMC.*/ -void fmc_flash_prefetch_speculation_clear(ftfx_cache_config_t *config); -#endif /* FLASH_PREFETCH_SPECULATION_IS_CONTROLLED_BY_FMC */ - -#if FTFx_DRIVER_IS_FLASH_RESIDENT && \ - (FLASH_CACHE_IS_CONTROLLED_BY_MCM || FLASH_CACHE_IS_CONTROLLED_BY_MSCM || \ - FLASH_CACHE_IS_CONTROLLERD_BY_FMC || FLASH_PREFETCH_SPECULATION_IS_CONTROLLED_BY_MSCM || \ - FLASH_PREFETCH_SPECULATION_IS_CONTROLLED_BY_FMC) -static void ftfx_common_bit_operation_command_sequence( - ftfx_cache_config_t *config, FTFx_REG32_ACCESS_TYPE base, uint32_t bitMask, uint32_t bitShift, uint32_t bitValue); -#endif /* FTFx_DRIVER_IS_FLASH_RESIDENT */ - -#if FTFx_DRIVER_IS_FLASH_RESIDENT && FLASH_IS_CACHE_INVALIDATION_AVAILABLE -/*! @brief Copy flash_cache_clear_command() to RAM*/ -static void ftfx_copy_common_bit_operation_to_ram(uint32_t *ftfxCommonBitOperation); -#endif /* FTFx_DRIVER_IS_FLASH_RESIDENT */ - -/******************************************************************************* - * Variables - ******************************************************************************/ - -#if FTFx_DRIVER_IS_FLASH_RESIDENT && FLASH_IS_CACHE_INVALIDATION_AVAILABLE -/*! - * @brief Position independent code of ftfx_common_bit_operation() - * - * Note1: The prototype of C function is shown as below: - * @code - * void ftfx_common_bit_operation(FTFx_REG32_ACCESS_TYPE base, uint32_t bitMask, uint32_t bitShift, uint32_t - * bitValue) - * { - * if (bitMask) - * { - * uint32_t value = (((uint32_t)(((uint32_t)(bitValue)) << bitShift)) & bitMask); - * *base = (*base & (~bitMask)) | value; - * } - * - * __ISB(); - * __DSB(); - * } - * @endcode - * Note2: The binary code is generated by IAR 7.70.1 - */ -static const uint32_t s_ftfxCommonBitOperationFunctionCode[] = { - 0x2900b510u, 0x6804d005u, 0x4093438cu, 0x43214019u, 0xf3bf6001u, 0xf3bf8f6fu, 0xbd108f4fu, -}; - -#if (!FTFx_DRIVER_IS_EXPORTED) -/*! @brief A static buffer used to hold ftfx_common_bit_operation() */ -static uint32_t s_ftfxCommonBitOperation[kFTFx_CACHE_RamFuncMaxSizeInWords]; -#endif /* (!FTFx_DRIVER_IS_EXPORTED) */ -#endif /* FLASH_IS_CACHE_INVALIDATION_AVAILABLE && FTFx_DRIVER_IS_FLASH_RESIDENT */ - -/******************************************************************************* - * Code - ******************************************************************************/ - -status_t FTFx_CACHE_Init(ftfx_cache_config_t *config) -{ - if (config == NULL) - { - return kStatus_FTFx_InvalidArgument; - } - -/* copy required flash commands to RAM */ -#if FTFx_DRIVER_IS_FLASH_RESIDENT && FLASH_IS_CACHE_INVALIDATION_AVAILABLE - if (NULL == config->bitOperFuncAddr.callFlashCommand) - { -#if FTFx_DRIVER_IS_EXPORTED - return kStatus_FTFx_ExecuteInRamFunctionNotReady; -#else - config->bitOperFuncAddr.commadAddr = (uint32_t)s_ftfxCommonBitOperation; -#endif /* FTFx_DRIVER_IS_EXPORTED */ - } - - ftfx_copy_common_bit_operation_to_ram((uint32_t *)config->bitOperFuncAddr.commadAddr); -#endif /* FLASH_IS_CACHE_INVALIDATION_AVAILABLE && FTFx_DRIVER_IS_FLASH_RESIDENT */ - - return kStatus_FTFx_Success; -} - -/*! - * @brief Flash Cache/Prefetch/Speculation Clear Process - * - * This function is used to perform the cache and prefetch speculation clear process to the flash. - */ -status_t FTFx_CACHE_ClearCachePrefetchSpeculation(ftfx_cache_config_t *config, bool isPreProcess) -{ - /* We pass the ftfx register address as a parameter to ftfx_common_bit_operation() instead of using - * pre-processed MACROs or a global variable in ftfx_common_bit_operation() - * to make sure that ftfx_common_bit_operation() will be compiled into position-independent code (PIC). */ - if (!isPreProcess) - { -#if FLASH_CACHE_IS_CONTROLLED_BY_MCM - mcm_flash_cache_clear(config); -#endif -#if FLASH_CACHE_IS_CONTROLLED_BY_MSCM - mscm_flash_cache_clear(config); -#endif -#if FLASH_CACHE_IS_CONTROLLED_BY_FMC - fmc_flash_cache_clear(config); -#endif -#if FLASH_PREFETCH_SPECULATION_IS_CONTROLLED_BY_MSCM - mscm_flash_prefetch_speculation_enable(config, true); -#endif -#if FLASH_PREFETCH_SPECULATION_IS_CONTROLLED_BY_FMC - fmc_flash_prefetch_speculation_clear(config); -#endif - } - if (isPreProcess) - { -#if FLASH_PREFETCH_SPECULATION_IS_CONTROLLED_BY_MSCM - mscm_flash_prefetch_speculation_enable(config, false); -#endif - } - - return kStatus_FTFx_Success; -} - -status_t FTFx_CACHE_PflashSetPrefetchSpeculation(ftfx_prefetch_speculation_status_t *speculationStatus) -{ -#if FLASH_PREFETCH_SPECULATION_IS_CONTROLLED_BY_MCM - { - if (true == speculationStatus->instructionOff) - { - if (false == speculationStatus->dataOff) - { - return kStatus_FTFx_InvalidSpeculationOption; - } - else - { - MCM0_CACHE_REG |= MCM_PLACR_DFCS_MASK; - } - } - else - { - MCM0_CACHE_REG &= ~MCM_PLACR_DFCS_MASK; - if (false == speculationStatus->dataOff) - { - MCM0_CACHE_REG |= MCM_PLACR_EFDS_MASK; - } - else - { - MCM0_CACHE_REG &= ~MCM_PLACR_EFDS_MASK; - } - } - } -#elif FLASH_PREFETCH_SPECULATION_IS_CONTROLLED_BY_FMC - { - if (false == speculationStatus->instructionOff) - { - FMC_CACHE_REG |= FMC_CACHE_B0IPE_MASK; - } - else - { - FMC_CACHE_REG &= ~FMC_CACHE_B0IPE_MASK; - } - if (false == speculationStatus->dataOff) - { - FMC_CACHE_REG |= FMC_CACHE_B0DPE_MASK; - } - else - { - FMC_CACHE_REG &= ~FMC_CACHE_B0DPE_MASK; - } - - /* Invalidate Prefetch Speculation Buffer */ - FMC_SPECULATION_INVALIDATE_REG |= FMC_SPECULATION_INVALIDATE_MASK; - } -#elif FLASH_PREFETCH_SPECULATION_IS_CONTROLLED_BY_MSCM - { - if (true == speculationStatus->instructionOff) - { - if (false == speculationStatus->dataOff) - { - return kStatus_FTFx_InvalidSpeculationOption; - } - else - { - MSCM_OCMDR0_REG |= MSCM_OCMDR_OCMC1_DFCS_MASK; - } - } - else - { - MSCM_OCMDR0_REG &= ~MSCM_OCMDR_OCMC1_DFCS_MASK; - if (false == speculationStatus->dataOff) - { - MSCM_OCMDR0_REG &= ~MSCM_OCMDR_OCMC1_DFDS_MASK; - } - else - { - MSCM_OCMDR0_REG |= MSCM_OCMDR_OCMC1_DFDS_MASK; - } - } - } -#endif /* FSL_FEATURE_FTFx_MCM_FLASH_CACHE_CONTROLS */ - - return kStatus_FTFx_Success; -} - -status_t FTFx_CACHE_PflashGetPrefetchSpeculation(ftfx_prefetch_speculation_status_t *speculationStatus) -{ - (void)memset(speculationStatus, 0, sizeof(ftfx_prefetch_speculation_status_t)); - - /* Assuming that all speculation options are enabled. */ - speculationStatus->instructionOff = false; - speculationStatus->dataOff = false; - -#if FLASH_PREFETCH_SPECULATION_IS_CONTROLLED_BY_MCM - { - uint32_t value = MCM0_CACHE_REG; - if (0U != (value & MCM_PLACR_DFCS_MASK)) - { - /* Speculation buffer is off. */ - speculationStatus->instructionOff = true; - speculationStatus->dataOff = true; - } - else - { - /* Speculation buffer is on for instruction. */ - if (0U == (value & MCM_PLACR_EFDS_MASK)) - { - /* Speculation buffer is off for data. */ - speculationStatus->dataOff = true; - } - } - } -#elif FLASH_PREFETCH_SPECULATION_IS_CONTROLLED_BY_FMC - { - uint32_t value = FMC_CACHE_REG; - if (0U == (value & FMC_CACHE_B0DPE_MASK)) - { - /* Do not prefetch in response to data references. */ - speculationStatus->dataOff = true; - } - if (0U == (value & FMC_CACHE_B0IPE_MASK)) - { - /* Do not prefetch in response to instruction fetches. */ - speculationStatus->instructionOff = true; - } - } -#elif FLASH_PREFETCH_SPECULATION_IS_CONTROLLED_BY_MSCM - { - uint32_t value = MSCM_OCMDR0_REG; - if (0U != (value & MSCM_OCMDR_OCMC1_DFCS_MASK)) - { - /* Speculation buffer is off. */ - speculationStatus->instructionOff = true; - speculationStatus->dataOff = true; - } - else - { - /* Speculation buffer is on for instruction. */ - if (0U != (value & MSCM_OCMDR_OCMC1_DFDS_MASK)) - { - /* Speculation buffer is off for data. */ - speculationStatus->dataOff = true; - } - } - } -#endif - - return kStatus_FTFx_Success; -} - -#if FTFx_DRIVER_IS_FLASH_RESIDENT && FLASH_IS_CACHE_INVALIDATION_AVAILABLE -/*! @brief Copy PIC of ftfx_common_bit_operation() to RAM */ -static void ftfx_copy_common_bit_operation_to_ram(uint32_t *ftfxCommonBitOperation) -{ - assert(sizeof(s_ftfxCommonBitOperationFunctionCode) <= ((uint32_t)kFTFx_CACHE_RamFuncMaxSizeInWords * 4U)); - - (void)memcpy(ftfxCommonBitOperation, s_ftfxCommonBitOperationFunctionCode, - sizeof(s_ftfxCommonBitOperationFunctionCode)); -} -#endif /* FTFx_DRIVER_IS_FLASH_RESIDENT && FLASH_IS_CACHE_INVALIDATION_AVAILABLE */ - -#if FTFx_DRIVER_IS_FLASH_RESIDENT && \ - (FLASH_CACHE_IS_CONTROLLED_BY_MCM || FLASH_CACHE_IS_CONTROLLED_BY_MSCM || \ - FLASH_CACHE_IS_CONTROLLERD_BY_FMC || FLASH_PREFETCH_SPECULATION_IS_CONTROLLED_BY_MSCM || \ - FLASH_PREFETCH_SPECULATION_IS_CONTROLLED_BY_FMC) -static void ftfx_common_bit_operation_command_sequence( - ftfx_cache_config_t *config, FTFx_REG32_ACCESS_TYPE base, uint32_t bitMask, uint32_t bitShift, uint32_t bitValue) -{ - uint32_t *ftfxCommonBitOperationAddr; - ftfxCommonBitOperationAddr = &config->bitOperFuncAddr.commadAddr; - /* Since the value of ARM function pointer is always odd, but the real start - * address - * of function memory should be even, that's why +1 operation exist. */ - *ftfxCommonBitOperationAddr += 1UL; - callftfxCommonBitOperation_t ftfxCommonBitOperationCommand = config->bitOperFuncAddr.callFlashCommand; - /* Workround for some devices which doesn't need this function */ - ftfxCommonBitOperationCommand((FTFx_REG32_ACCESS_TYPE)base, bitMask, bitShift, bitValue); - *ftfxCommonBitOperationAddr -= 1UL; -} -#endif /*FTFx_DRIVER_IS_FLASH_RESIDENT*/ - -#if FLASH_CACHE_IS_CONTROLLED_BY_MCM -/*! @brief Performs the cache clear to the flash by MCM.*/ -void mcm_flash_cache_clear(ftfx_cache_config_t *config) -{ - FTFx_REG32_ACCESS_TYPE regBase; - -#if defined(MCM0_CACHE_REG) - regBase = (FTFx_REG32_ACCESS_TYPE)&MCM0_CACHE_REG; -#elif defined(MCM1_CACHE_REG) - regBase = (FTFx_REG32_ACCESS_TYPE)&MCM1_CACHE_REG; -#endif - -#if FTFx_DRIVER_IS_FLASH_RESIDENT - /* calling flash command sequence function to execute the command */ - ftfx_common_bit_operation_command_sequence(config, regBase, MCM_CACHE_CLEAR_MASK, MCM_CACHE_CLEAR_SHIFT, 1UL); - -#else /* !FTFx_DRIVER_IS_FLASH_RESIDENT */ - *regBase |= MCM_CACHE_CLEAR_MASK; - - /* Memory barriers for good measure. - * All Cache, Branch predictor and TLB maintenance operations before this instruction complete */ - __ISB(); - __DSB(); -#endif /* FTFx_DRIVER_IS_FLASH_RESIDENT */ -} -#endif /* FLASH_CACHE_IS_CONTROLLED_BY_MCM */ - -#if FLASH_CACHE_IS_CONTROLLED_BY_MSCM -/*! @brief Performs the cache clear to the flash by MSCM.*/ -void mscm_flash_cache_clear(ftfx_cache_config_t *config) -{ - uint8_t setValue = 0x1U; - -/* The OCMDR[0] is always used to cache main Pflash*/ -/* For device with FlexNVM support, the OCMDR[1] is used to cache Dflash. - * For device with secondary flash support, the OCMDR[1] is used to cache secondary Pflash. */ -#if FTFx_DRIVER_IS_FLASH_RESIDENT - switch (config->flashMemoryIndex) - { - case kFLASH_MemoryIndexSecondaryFlash: - /* calling flash command sequence function to execute the command */ - ftfx_common_bit_operation_command_sequence(config, (FTFx_REG32_ACCESS_TYPE)&MSCM_OCMDR1_REG, - MSCM_CACHE_CLEAR_MASK, MSCM_CACHE_CLEAR_SHIFT, setValue); - break; - case kFLASH_MemoryIndexPrimaryFlash: - default: - /* calling flash command sequence function to execute the command */ - ftfx_common_bit_operation_command_sequence(config, (FTFx_REG32_ACCESS_TYPE)&MSCM_OCMDR0_REG, - MSCM_CACHE_CLEAR_MASK, MSCM_CACHE_CLEAR_SHIFT, setValue); - break; - } -#else /* !FTFx_DRIVER_IS_FLASH_RESIDENT */ - switch (config->flashMemoryIndex) - { - case kFLASH_MemoryIndexSecondaryFlash: - MSCM_OCMDR1_REG = (MSCM_OCMDR1_REG & (~MSCM_CACHE_CLEAR_MASK)) | MSCM_CACHE_CLEAR(setValue); - /* Each cache clear instruction should be followed by below code*/ - __ISB(); - __DSB(); - break; - case kFLASH_MemoryIndexPrimaryFlash: - default: - MSCM_OCMDR0_REG = (MSCM_OCMDR0_REG & (~MSCM_CACHE_CLEAR_MASK)) | MSCM_CACHE_CLEAR(setValue); - /* Memory barriers for good measure. - * All Cache, Branch predictor and TLB maintenance operations before this instruction complete */ - __ISB(); - __DSB(); - break; - } -#endif /* FTFx_DRIVER_IS_FLASH_RESIDENT */ -} -#endif /* FLASH_CACHE_IS_CONTROLLED_BY_MSCM */ - -#if FLASH_CACHE_IS_CONTROLLED_BY_FMC -/*! @brief Performs the cache clear to the flash by FMC.*/ -void fmc_flash_cache_clear(ftfx_cache_config_t *config) -{ -#if FTFx_DRIVER_IS_FLASH_RESIDENT - /* calling flash command sequence function to execute the command */ - ftfx_common_bit_operation_command_sequence(config, (FTFx_REG32_ACCESS_TYPE)&FMC_CACHE_REG, FMC_CACHE_CLEAR_MASK, - FMC_CACHE_CLEAR_SHIFT, 0xFUL); -#else /* !FTFx_DRIVER_IS_FLASH_RESIDENT */ - FMC_CACHE_REG = (FMC_CACHE_REG & (~FMC_CACHE_CLEAR_MASK)) | FMC_CACHE_CLEAR(~0); - /* Memory barriers for good measure. - * All Cache, Branch predictor and TLB maintenance operations before this instruction complete */ - __ISB(); - __DSB(); -#endif /* FTFx_DRIVER_IS_FLASH_RESIDENT */ -} -#endif /* FLASH_CACHE_IS_CONTROLLED_BY_FMC */ - -#if FLASH_PREFETCH_SPECULATION_IS_CONTROLLED_BY_MSCM -/*! @brief Performs the prefetch speculation buffer clear to the flash by MSCM.*/ -void mscm_flash_prefetch_speculation_enable(ftfx_cache_config_t *config, bool enable) -{ - uint8_t setValue; - if (enable) - { - setValue = 0x0U; - } - else - { - setValue = 0x3U; - } - -/* The OCMDR[0] is always used to prefetch main Pflash*/ -/* For device with FlexNVM support, the OCMDR[1] is used to prefetch Dflash. - * For device with secondary flash support, the OCMDR[1] is used to prefetch secondary Pflash. */ -#if FTFx_DRIVER_IS_FLASH_RESIDENT - - switch (config->flashMemoryIndex) - { - case 1: - /* calling flash command sequence function to execute the command */ - ftfx_common_bit_operation_command_sequence(config, (FTFx_REG32_ACCESS_TYPE)&MSCM_OCMDR1_REG, - MSCM_SPECULATION_SET_MASK, MSCM_SPECULATION_SET_SHIFT, setValue); - break; - case 0: - default: - /* calling flash command sequence function to execute the command */ - ftfx_common_bit_operation_command_sequence(config, (FTFx_REG32_ACCESS_TYPE)&MSCM_OCMDR0_REG, - MSCM_SPECULATION_SET_MASK, MSCM_SPECULATION_SET_SHIFT, setValue); - break; - } -#else /* !FTFx_DRIVER_IS_FLASH_RESIDENT */ - switch (config->flashMemoryIndex) - { - case kFLASH_MemoryIndexSecondaryFlash: - MSCM_OCMDR1_REG = (MSCM_OCMDR1_REG & (~MSCM_SPECULATION_SET_MASK)) | MSCM_SPECULATION_SET(setValue); - /* Each cache clear instruction should be followed by below code*/ - __ISB(); - __DSB(); - break; - case kFLASH_MemoryIndexPrimaryFlash: - default: - MSCM_OCMDR0_REG = (MSCM_OCMDR0_REG & (~MSCM_SPECULATION_SET_MASK)) | MSCM_SPECULATION_SET(setValue); - /* Memory barriers for good measure. - * All Cache, Branch predictor and TLB maintenance operations before this instruction complete */ - __ISB(); - __DSB(); - break; - } -#endif /* FTFx_DRIVER_IS_FLASH_RESIDENT */ -} -#endif /* FLASH_PREFETCH_SPECULATION_IS_CONTROLLED_BY_MSCM */ - -#if FLASH_PREFETCH_SPECULATION_IS_CONTROLLED_BY_FMC -/*! @brief Performs the prefetch speculation buffer clear to the flash by FMC.*/ -void fmc_flash_prefetch_speculation_clear(ftfx_cache_config_t *config) -{ -#if FTFx_DRIVER_IS_FLASH_RESIDENT - /* calling flash command sequence function to execute the command */ - ftfx_common_bit_operation_command_sequence(config, (FTFx_REG32_ACCESS_TYPE)&FMC_SPECULATION_INVALIDATE_REG, - FMC_SPECULATION_INVALIDATE_MASK, FMC_SPECULATION_INVALIDATE_SHIFT, 1UL); -#else /* !FTFx_DRIVER_IS_FLASH_RESIDENT */ - FMC_SPECULATION_INVALIDATE_REG |= FMC_SPECULATION_INVALIDATE_MASK; - /* Memory barriers for good measure. - * All Cache, Branch predictor and TLB maintenance operations before this instruction complete */ - __ISB(); - __DSB(); -#endif /* FTFx_DRIVER_IS_FLASH_RESIDENT */ -} -#endif /* FLASH_PREFETCH_SPECULATION_IS_CONTROLLED_BY_FMC */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_ftfx_cache.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_ftfx_cache.h deleted file mode 100644 index 0bba177d4ee..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_ftfx_cache.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright 2013-2016 Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - * - */ - -#ifndef FSL_FTFX_CACHE_H -#define FSL_FTFX_CACHE_H - -#include "fsl_ftfx_controller.h" - -/*! - * @addtogroup ftfx_cache_driver - * @{ - */ -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @brief FTFx prefetch speculation status. - */ -typedef struct _flash_prefetch_speculation_status -{ - bool instructionOff; /*!< Instruction speculation.*/ - bool dataOff; /*!< Data speculation.*/ -} ftfx_prefetch_speculation_status_t; - -/*! - * @brief Constants for execute-in-RAM flash function. - */ -enum _ftfx_cache_ram_func_constants -{ - kFTFx_CACHE_RamFuncMaxSizeInWords = 16U, /*!< The maximum size of execute-in-RAM function.*/ -}; - -typedef union -{ - uint32_t commadAddr; - void (*callFlashCommand)(FTFx_REG32_ACCESS_TYPE base, uint32_t bitMask, uint32_t bitShift, uint32_t bitValue); -} function_bit_operation_ptr_t; - -/*! @brief FTFx cache driver state information. - * - * An instance of this structure is allocated by the user of the flash driver and - * passed into each of the driver APIs. - */ -typedef struct _ftfx_cache_config -{ - uint8_t flashMemoryIndex; /*!< 0 - primary flash; 1 - secondary flash*/ - uint8_t reserved[3]; - function_bit_operation_ptr_t bitOperFuncAddr; /*!< An buffer point to the flash execute-in-RAM function. */ -} ftfx_cache_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @brief Initializes the global FTFx cache structure members. - * - * This function checks and initializes the Flash module for the other FTFx cache APIs. - * - * @param config Pointer to the storage for the driver runtime state. - * - * @retval #kStatus_FTFx_Success API was executed successfully. - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - */ -status_t FTFx_CACHE_Init(ftfx_cache_config_t *config); - -/*! - * @brief Process the cache/prefetch/speculation to the flash. - * - * @param config A pointer to the storage for the driver runtime state. - * @param isPreProcess The possible option used to control flash cache/prefetch/speculation - * @retval #kStatus_FTFx_Success API was executed successfully. - * @retval #kStatus_FTFx_InvalidArgument Invalid argument is provided. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - */ -status_t FTFx_CACHE_ClearCachePrefetchSpeculation(ftfx_cache_config_t *config, bool isPreProcess); - -/*! - * @brief Sets the PFlash prefetch speculation to the intended speculation status. - * - * @param speculationStatus The expected protect status to set to the PFlash protection register. Each bit is - * @retval #kStatus_FTFx_Success API was executed successfully. - * @retval #kStatus_FTFx_InvalidSpeculationOption An invalid speculation option argument is provided. - */ -status_t FTFx_CACHE_PflashSetPrefetchSpeculation(ftfx_prefetch_speculation_status_t *speculationStatus); - -/*! - * @brief Gets the PFlash prefetch speculation status. - * - * @param speculationStatus Speculation status returned by the PFlash IP. - * @retval #kStatus_FTFx_Success API was executed successfully. - */ -status_t FTFx_CACHE_PflashGetPrefetchSpeculation(ftfx_prefetch_speculation_status_t *speculationStatus); - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_FTFX_CACHE_H */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_ftfx_controller.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_ftfx_controller.c deleted file mode 100644 index 42a322a28e6..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_ftfx_controller.c +++ /dev/null @@ -1,1510 +0,0 @@ -/* - * Copyright 2013-2016 Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - * - */ - -#include "fsl_ftfx_controller.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flash" -#endif - -/*! - * @name Flash controller command numbers - * @{ - */ -#define FTFx_VERIFY_BLOCK 0x00U /*!< RD1BLK*/ -#define FTFx_VERIFY_SECTION 0x01U /*!< RD1SEC*/ -#define FTFx_PROGRAM_CHECK 0x02U /*!< PGMCHK*/ -#define FTFx_READ_RESOURCE 0x03U /*!< RDRSRC*/ -#define FTFx_PROGRAM_LONGWORD 0x06U /*!< PGM4*/ -#define FTFx_PROGRAM_PHRASE 0x07U /*!< PGM8*/ -#define FTFx_ERASE_BLOCK 0x08U /*!< ERSBLK*/ -#define FTFx_ERASE_SECTOR 0x09U /*!< ERSSCR*/ -#define FTFx_PROGRAM_SECTION 0x0BU /*!< PGMSEC*/ -#define FTFx_GENERATE_CRC 0x0CU /*!< CRCGEN*/ -#define FTFx_VERIFY_ALL_BLOCK 0x40U /*!< RD1ALL*/ -#define FTFx_READ_ONCE 0x41U /*!< RDONCE or RDINDEX*/ -#define FTFx_PROGRAM_ONCE 0x43U /*!< PGMONCE or PGMINDEX*/ -#define FTFx_ERASE_ALL_BLOCK 0x44U /*!< ERSALL*/ -#define FTFx_SECURITY_BY_PASS 0x45U /*!< VFYKEY*/ -#define FTFx_SWAP_CONTROL 0x46U /*!< SWAP*/ -#define FTFx_ERASE_ALL_BLOCK_UNSECURE 0x49U /*!< ERSALLU*/ -#define FTFx_VERIFY_ALL_EXECUTE_ONLY_SEGMENT 0x4AU /*!< RD1XA*/ -#define FTFx_ERASE_ALL_EXECUTE_ONLY_SEGMENT 0x4BU /*!< ERSXA*/ -#define FTFx_PROGRAM_PARTITION 0x80U /*!< PGMPART*/ -#define FTFx_SET_FLEXRAM_FUNCTION 0x81U /*!< SETRAM*/ -/*@}*/ - -/*! - * @brief Constants for execute-in-RAM flash function. - */ -enum _ftfx_ram_func_constants -{ - kFTFx_RamFuncMaxSizeInWords = 16U, /*!< The maximum size of execute-in-RAM function.*/ -}; - -/*! @brief A function pointer used to point to relocated flash_run_command() */ -typedef void (*callFtfxRunCommand_t)(FTFx_REG8_ACCESS_TYPE ftfx_fstat); - -/*! - * @name Enumeration for Flash security register code - * @{ - */ -enum _ftfx_fsec_register_code -{ - kFTFx_FsecRegCode_KEYEN_Enabled = 0x80U, - kFTFx_FsecRegCode_SEC_Unsecured = 0x02U -}; -/*@}*/ - -#if defined(FSL_FEATURE_FLASH_HAS_SWAP_CONTROL_CMD) && FSL_FEATURE_FLASH_HAS_SWAP_CONTROL_CMD -/*! - * @brief Enumeration for flash config area. - */ -enum _ftfx_pflash_config_area_range -{ - kFTFx_PflashConfigAreaStart = 0x400U, - kFTFx_PflashConfigAreaEnd = 0x40FU -}; -#endif /* FSL_FEATURE_FLASH_HAS_SWAP_CONTROL_CMD */ - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! @brief Init IFR memory related info */ -static void ftfx_init_ifr(ftfx_config_t *config); - -#if FTFx_DRIVER_IS_FLASH_RESIDENT -/*! @brief Copy flash_run_command() to RAM*/ -static void ftfx_copy_run_command_to_ram(uint32_t *ftfxRunCommand); -#endif /* FTFx_DRIVER_IS_FLASH_RESIDENT */ - -/*! @brief Internal function Flash command sequence. Called by driver APIs only*/ -static status_t ftfx_command_sequence(ftfx_config_t *config); - -/*! @brief Internal function Flash asynchronous command sequence. Called by driver APIs only*/ -static void ftfx_command_sequence_non_blocking(ftfx_config_t *config); - -/*! @brief Validates the range and alignment of the given address range.*/ -static status_t ftfx_check_mem_range(ftfx_config_t *config, - uint32_t startAddress, - uint32_t lengthInBytes, - uint8_t alignmentBaseline); - -/*! @brief Validates the given user key for flash erase APIs.*/ -static status_t ftfx_check_user_key(uint32_t key); - -/*! @brief Reads word from byte address.*/ -static uint32_t ftfx_read_word_from_byte_address(const uint8_t *src); - -/*! @brief Writes word to byte address.*/ -static void ftfx_write_word_to_byte_address(uint8_t *dst, uint32_t word); - -#if defined(FSL_FEATURE_FLASH_HAS_READ_RESOURCE_CMD) && FSL_FEATURE_FLASH_HAS_READ_RESOURCE_CMD -/*! @brief Validates the range of the given resource address.*/ -static status_t ftfx_check_resource_range(ftfx_config_t *config, - uint32_t start, - uint32_t lengthInBytes, - uint32_t alignmentBaseline, - ftfx_read_resource_opt_t option); -#endif /* FSL_FEATURE_FLASH_HAS_READ_RESOURCE_CMD */ - -#if defined(FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD) && FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD -/*! @brief Validates the given flexram function option.*/ -static inline status_t ftfx_check_flexram_function_option(ftfx_flexram_func_opt_t option); -#endif /* FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD */ - -#if defined(FSL_FEATURE_FLASH_HAS_SWAP_CONTROL_CMD) && FSL_FEATURE_FLASH_HAS_SWAP_CONTROL_CMD -/*! @brief Validates the given swap control option.*/ -static status_t ftfx_check_swap_control_option(ftfx_swap_control_opt_t option); -#endif /* FSL_FEATURE_FLASH_HAS_SWAP_CONTROL_CMD */ - -/******************************************************************************* - * Variables - ******************************************************************************/ - -#if FTFx_DRIVER_IS_FLASH_RESIDENT -/*! - * @brief Position independent code of flash_run_command - * - * Note1: The prototype of C function is shown as below: - * @code - * void flash_run_command(FTFx_REG8_ACCESS_TYPE ftfx_fstat) - * { - * *ftfx_fstat = FTFx_FSTAT_CCIF_MASK; - * - * while (!((*ftfx_fstat) & FTFx_FSTAT_CCIF_MASK)) - * { - * } - * } - * @endcode - * Note2: The binary code is generated by IAR 7.70.1 - */ -static const uint32_t s_ftfxRunCommandFunctionCode[] = { - 0x70012180u, - 0x420a7802u, - 0x4770d0fcu, -}; -#if (!FTFx_DRIVER_IS_EXPORTED) -/*! @brief A static buffer used to hold flash_run_command() */ -static uint32_t s_ftfxRunCommand[kFTFx_RamFuncMaxSizeInWords]; -#endif /* (!FTFx_DRIVER_IS_EXPORTED) */ -#endif /* FTFx_DRIVER_IS_FLASH_RESIDENT */ - -/*! @brief Access to FTFx Registers */ -static volatile uint32_t *const kFCCOBx = (volatile uint32_t *)(uint32_t)&FTFx_FCCOB3_REG; - -#if defined(FSL_FEATURE_FLASH_HAS_FLEX_NVM) && FSL_FEATURE_FLASH_HAS_FLEX_NVM -/*! @brief Table of eeprom sizes. */ -static const uint16_t kEepromDensities[16] = { - FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_0000, FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_0001, - FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_0010, FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_0011, - FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_0100, FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_0101, - FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_0110, FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_0111, - FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_1000, FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_1001, - FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_1010, FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_1011, - FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_1100, FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_1101, - FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_1110, FSL_FEATURE_FLASH_FLEX_NVM_EEPROM_SIZE_FOR_EEESIZE_1111}; -/*! @brief Table of dflash sizes. */ -static const uint32_t kDflashDensities[16] = { - FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_0000, FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_0001, - FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_0010, FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_0011, - FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_0100, FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_0101, - FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_0110, FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_0111, - FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_1000, FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_1001, - FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_1010, FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_1011, - FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_1100, FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_1101, - FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_1110, FSL_FEATURE_FLASH_FLEX_NVM_DFLASH_SIZE_FOR_DEPART_1111}; -#endif /* FSL_FEATURE_FLASH_HAS_FLEX_NVM */ - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * @brief Initializes the global flash properties structure members. - */ -void FTFx_API_Init(ftfx_config_t *config) -{ - if (config == NULL) - { - return; - } - config->runCmdFuncAddr.callFlashCommand = NULL; - config->flexramBlockBase = FSL_FEATURE_FLASH_FLEX_RAM_START_ADDRESS; - config->flexramTotalSize = FSL_FEATURE_FLASH_FLEX_RAM_SIZE; - - /* copy required flash command to RAM */ -#if FTFx_DRIVER_IS_FLASH_RESIDENT - config->runCmdFuncAddr.commadAddr = (uint32_t)s_ftfxRunCommand; - ftfx_copy_run_command_to_ram((uint32_t *)config->runCmdFuncAddr.commadAddr); -#endif /* FTFx_DRIVER_IS_FLASH_RESIDENT */ - - ftfx_init_ifr(config); -} - -#if defined(FSL_FEATURE_FLASH_HAS_FLEX_NVM) && FSL_FEATURE_FLASH_HAS_FLEX_NVM -/*! - * @brief Updates FlexNVM memory partition status according to data flash 0 IFR. - */ -status_t FTFx_API_UpdateFlexnvmPartitionStatus(ftfx_config_t *config) -{ - struct _dflash_ifr_field_config - { - uint32_t reserved0; - uint8_t FlexNVMPartitionCode; - uint8_t EEPROMDataSetSize; - uint16_t reserved1; - } dataIFRReadOut; - uint32_t flexnvmInfoIfrAddr; - status_t returnCode; - - if (config == NULL) - { - return kStatus_FTFx_InvalidArgument; - } - - flexnvmInfoIfrAddr = - config->ifrDesc.resRange.dflashIfrStart + config->ifrDesc.resRange.ifrMemSize - sizeof(dataIFRReadOut); - -#if defined(FSL_FEATURE_FLASH_HAS_READ_RESOURCE_CMD) && FSL_FEATURE_FLASH_HAS_READ_RESOURCE_CMD - /* Get FlexNVM memory partition info from data flash IFR */ - returnCode = FTFx_CMD_ReadResource(config, flexnvmInfoIfrAddr, (uint8_t *)&dataIFRReadOut, sizeof(dataIFRReadOut), - kFTFx_ResourceOptionFlashIfr); - if (returnCode != kStatus_FTFx_Success) - { - return kStatus_FTFx_PartitionStatusUpdateFailure; - } -#else -#error "Cannot get FlexNVM memory partition info" -#endif /* FSL_FEATURE_FLASH_HAS_READ_RESOURCE_CMD */ - - /* Fill out partitioned EEPROM size */ - dataIFRReadOut.EEPROMDataSetSize &= 0x0FU; - config->eepromTotalSize = kEepromDensities[dataIFRReadOut.EEPROMDataSetSize]; - - /* Fill out partitioned DFlash size */ - dataIFRReadOut.FlexNVMPartitionCode &= 0x0FU; - config->flashDesc.totalSize = kDflashDensities[dataIFRReadOut.FlexNVMPartitionCode]; - - return kStatus_FTFx_Success; -} -#endif /* FSL_FEATURE_FLASH_HAS_FLEX_NVM */ - -/*! - * @brief Erases the flash sectors encompassed by parameters passed into function. - */ -status_t FTFx_CMD_Erase(ftfx_config_t *config, uint32_t start, uint32_t lengthInBytes, uint32_t key) -{ - uint32_t sectorSize; - uint32_t endAddress; /* storing end address */ - uint32_t numberOfSectors; /* number of sectors calculated by endAddress */ - status_t returnCode; - uint32_t eraseStart; - - /* Check the supplied address range. */ - returnCode = ftfx_check_mem_range(config, start, lengthInBytes, config->opsConfig.addrAligment.sectorCmd); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - - /* Validate the user key */ - returnCode = ftfx_check_user_key(key); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - - eraseStart = config->opsConfig.convertedAddress; - sectorSize = config->flashDesc.sectorSize; - - /* Calculate Flash end address */ - endAddress = eraseStart + lengthInBytes - 1U; - - /* re-calculate the endAddress and align it to the start of the next sector - * which will be used in the comparison below */ - if (0U != (endAddress % sectorSize)) - { - numberOfSectors = endAddress / sectorSize + 1U; - endAddress = numberOfSectors * sectorSize - 1U; - } - - /* the start address will increment to the next sector address - * until it reaches the endAdddress */ - while (eraseStart <= endAddress) - { - /* preparing passing parameter to erase a flash block */ - kFCCOBx[0] = BYTE2WORD_1_3(FTFx_ERASE_SECTOR, eraseStart); - - /* calling flash command sequence function to execute the command */ - returnCode = ftfx_command_sequence(config); - - /* checking the success of command execution */ - if (kStatus_FTFx_Success != returnCode) - { - break; - } - else - { - /* Increment to the next sector */ - eraseStart += sectorSize; - } - } - - return returnCode; -} - -/*! - * @brief erases one flash sector size based on the start address. - */ -status_t FTFx_CMD_EraseSectorNonBlocking(ftfx_config_t *config, uint32_t start, uint32_t key) -{ - uint32_t eraseStart; - uint8_t aligmentInBytes; - status_t returnCode = kStatus_FTFx_AddressError; - aligmentInBytes = config->opsConfig.addrAligment.sectorCmd; - uint32_t lengthInBytes = config->flashDesc.sectorSize; - - returnCode = ftfx_check_mem_range(config, start, lengthInBytes, aligmentInBytes); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - /* Validate the user key */ - returnCode = ftfx_check_user_key(key); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - - eraseStart = config->opsConfig.convertedAddress; - - /* preparing passing parameter to erase a flash block */ - kFCCOBx[0] = BYTE2WORD_1_3(FTFx_ERASE_SECTOR, eraseStart); - /* calling flash command sequence function to execute the command */ - ftfx_command_sequence_non_blocking(config); - - return returnCode; -} - -/*! - * @brief Erases entire flash - */ -status_t FTFx_CMD_EraseAll(ftfx_config_t *config, uint32_t key) -{ - status_t returnCode; - - if (config == NULL) - { - return kStatus_FTFx_InvalidArgument; - } - - /* preparing passing parameter to erase all flash blocks */ - kFCCOBx[0] = BYTE2WORD_1_3(FTFx_ERASE_ALL_BLOCK, 0xFFFFFFU); - - /* Validate the user key */ - returnCode = ftfx_check_user_key(key); - if (kStatus_FTFx_Success != returnCode) - { - return returnCode; - } - - /* calling flash command sequence function to execute the command */ - returnCode = ftfx_command_sequence(config); - -#if defined(FSL_FEATURE_FLASH_HAS_FLEX_NVM) && FSL_FEATURE_FLASH_HAS_FLEX_NVM - /* Data flash IFR will be erased by erase all command, so we need to - * update FlexNVM memory partition status synchronously */ - if (returnCode == kStatus_FTFx_Success) - { - if (config->ifrDesc.resRange.dflashIfrStart != config->ifrDesc.resRange.pflashIfrStart) - { - returnCode = FTFx_API_UpdateFlexnvmPartitionStatus(config); - } - } -#endif /* FSL_FEATURE_FLASH_HAS_FLEX_NVM */ - - return returnCode; -} - -#if defined(FSL_FEATURE_FLASH_HAS_ERASE_ALL_BLOCKS_UNSECURE_CMD) && FSL_FEATURE_FLASH_HAS_ERASE_ALL_BLOCKS_UNSECURE_CMD -/*! - * @brief Erases the entire flash, including protected sectors. - */ -status_t FTFx_CMD_EraseAllUnsecure(ftfx_config_t *config, uint32_t key) -{ - status_t returnCode; - - if (config == NULL) - { - return kStatus_FTFx_InvalidArgument; - } - - /* Prepare passing parameter to erase all flash blocks (unsecure). */ - kFCCOBx[0] = BYTE2WORD_1_3(FTFx_ERASE_ALL_BLOCK_UNSECURE, 0xFFFFFFU); - - /* Validate the user key */ - returnCode = ftfx_check_user_key(key); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - - /* calling flash command sequence function to execute the command */ - returnCode = ftfx_command_sequence(config); - -#if defined(FSL_FEATURE_FLASH_HAS_FLEX_NVM) && FSL_FEATURE_FLASH_HAS_FLEX_NVM - /* Data flash IFR will be erased by erase all unsecure command, so we need to - * update FlexNVM memory partition status synchronously */ - if (returnCode == kStatus_FTFx_Success) - { - if (config->ifrDesc.resRange.dflashIfrStart != config->ifrDesc.resRange.pflashIfrStart) - { - returnCode = FTFx_API_UpdateFlexnvmPartitionStatus(config); - } - } -#endif /* FSL_FEATURE_FLASH_HAS_FLEX_NVM */ - - return returnCode; -} -#endif /* FSL_FEATURE_FLASH_HAS_ERASE_ALL_BLOCKS_UNSECURE_CMD */ - -/*! - * @brief Erases all program flash execute-only segments defined by the FXACC registers. - */ -status_t FTFx_CMD_EraseAllExecuteOnlySegments(ftfx_config_t *config, uint32_t key) -{ - status_t returnCode; - - if (config == NULL) - { - return kStatus_FTFx_InvalidArgument; - } - - /* preparing passing parameter to erase all execute-only segments - * 1st element for the FCCOB register */ - kFCCOBx[0] = BYTE2WORD_1_3(FTFx_ERASE_ALL_EXECUTE_ONLY_SEGMENT, 0xFFFFFFU); - - /* Validate the user key */ - returnCode = ftfx_check_user_key(key); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - - /* calling flash command sequence function to execute the command */ - returnCode = ftfx_command_sequence(config); - - return returnCode; -} - -/*! - * @brief Programs flash with data at locations passed in through parameters. - */ -status_t FTFx_CMD_Program(ftfx_config_t *config, uint32_t start, const uint8_t *src, uint32_t lengthInBytes) -{ - status_t returnCode; - uint8_t blockWriteUnitSize = config->opsConfig.addrAligment.blockWriteUnitSize; - uint32_t programStart; - uint32_t remainingLength; - if (src == NULL) - { - return kStatus_FTFx_InvalidArgument; - } - - /* Check the supplied address range. */ - returnCode = ftfx_check_mem_range(config, start, lengthInBytes, blockWriteUnitSize); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - - programStart = config->opsConfig.convertedAddress; - remainingLength = lengthInBytes; - - while (remainingLength > 0U) - { - /* preparing passing parameter to program the flash block */ - kFCCOBx[1] = ftfx_read_word_from_byte_address((const uint8_t *)src); - src = &src[4]; - - if (4U == blockWriteUnitSize) - { - kFCCOBx[0] = BYTE2WORD_1_3(FTFx_PROGRAM_LONGWORD, programStart); - } - else if (8U == blockWriteUnitSize) - { - kFCCOBx[2] = ftfx_read_word_from_byte_address((const uint8_t *)src); - src = &src[4]; - kFCCOBx[0] = BYTE2WORD_1_3(FTFx_PROGRAM_PHRASE, programStart); - } - else - { - return kStatus_FTFx_InvalidArgument; - } - - /* calling flash command sequence function to execute the command */ - returnCode = ftfx_command_sequence(config); - - /* checking for the success of command execution */ - if (kStatus_FTFx_Success != returnCode) - { - break; - } - else - { - /* update programStart address for next iteration */ - programStart += blockWriteUnitSize; - - /* update remainingLength for next iteration */ - remainingLength -= blockWriteUnitSize; - } - } - - return returnCode; -} - -/*! - * @brief Programs Program Once Field through parameters. - */ -status_t FTFx_CMD_ProgramOnce(ftfx_config_t *config, uint32_t index, const uint8_t *src, uint32_t lengthInBytes) -{ - status_t returnCode; - - if ((config == NULL) || (src == NULL)) - { - return kStatus_FTFx_InvalidArgument; - } - - /* pass parameters to FTFx */ - kFCCOBx[0] = BYTE2WORD_1_1_2(FTFx_PROGRAM_ONCE, index, 0xFFFFU); - - kFCCOBx[1] = ftfx_read_word_from_byte_address((const uint8_t *)src); - - /* Note: Have to separate the first index from the rest if it equals 0 - * to avoid a pointless comparison of unsigned int to 0 compiler warning */ - if (config->ifrDesc.feature.has8ByteIdxSupport != 0U) - { - if (config->ifrDesc.feature.has4ByteIdxSupport != 0U) - { - if (((index == config->ifrDesc.idxInfo.mix8byteIdxStart) || - ((index >= ((uint32_t)config->ifrDesc.idxInfo.mix8byteIdxStart + 1U)) && - (index <= config->ifrDesc.idxInfo.mix8byteIdxEnd))) && - (lengthInBytes == 8U)) - { - kFCCOBx[2] = ftfx_read_word_from_byte_address(&src[4]); - } - } - else - { - kFCCOBx[2] = ftfx_read_word_from_byte_address(&src[4]); - } - } - - /* calling flash command sequence function to execute the command */ - returnCode = ftfx_command_sequence(config); - - return returnCode; -} - -#if defined(FSL_FEATURE_FLASH_HAS_PROGRAM_SECTION_CMD) && FSL_FEATURE_FLASH_HAS_PROGRAM_SECTION_CMD -/*! - * @brief Programs flash with data at locations passed in through parameters via the Program Section command. - */ -status_t FTFx_CMD_ProgramSection(ftfx_config_t *config, uint32_t start, const uint8_t *src, uint32_t lengthInBytes) -{ - status_t returnCode; - uint32_t sectorSize; - uint32_t programaddress; - uint8_t aligmentInBytes = config->opsConfig.addrAligment.sectionCmd; - const uint8_t *srcaddress = src; -#if defined(FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD) && FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD - bool needSwitchFlexRamMode = false; -#endif /* FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD */ - - if (srcaddress == NULL) - { - return kStatus_FTFx_InvalidArgument; - } - - /* Check the supplied address range. */ - returnCode = ftfx_check_mem_range(config, start, lengthInBytes, aligmentInBytes); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - - programaddress = config->opsConfig.convertedAddress; - sectorSize = config->flashDesc.sectorSize; - -#if defined(FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD) && FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD - /* Switch function of FlexRAM if needed */ - if ((FTFx->FCNFG & FTFx_FCNFG_RAMRDY_MASK) == 0U) - { - needSwitchFlexRamMode = true; - - returnCode = FTFx_CMD_SetFlexramFunction(config, kFTFx_FlexramFuncOptAvailableAsRam); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - } -#endif /* FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD */ - - while (lengthInBytes > 0U) - { - /* Make sure the write operation doesn't span two sectors */ - uint32_t endAddressOfCurrentSector = ALIGN_UP(programaddress, sectorSize); - uint32_t lengthTobeProgrammedOfCurrentSector; - uint32_t currentOffset = 0U; - - if (endAddressOfCurrentSector == programaddress) - { - endAddressOfCurrentSector += sectorSize; - } - - if ((lengthInBytes + programaddress) > endAddressOfCurrentSector) - { - lengthTobeProgrammedOfCurrentSector = endAddressOfCurrentSector - programaddress; - } - else - { - lengthTobeProgrammedOfCurrentSector = lengthInBytes; - } - - /* Program Current Sector */ - while (lengthTobeProgrammedOfCurrentSector > 0U) - { - /* Make sure the program size doesn't exceeds Acceleration RAM size */ - uint32_t programSizeOfCurrentPass; - uint32_t numberOfPhases; - - if (lengthTobeProgrammedOfCurrentSector > (uint32_t)kFLASH_AccelerationRamSize) - { - programSizeOfCurrentPass = (uint32_t)kFLASH_AccelerationRamSize; - } - else - { - programSizeOfCurrentPass = lengthTobeProgrammedOfCurrentSector; - } - - /* Copy data to FlexRAM */ - (void)memcpy((uint8_t *)config->flexramBlockBase, &srcaddress[currentOffset], programSizeOfCurrentPass); - /* Set programaddress address of the data to be programmed */ - kFCCOBx[0] = BYTE2WORD_1_3(FTFx_PROGRAM_SECTION, programaddress + currentOffset); - /* Set program size in terms of FEATURE_FLASH_SECTION_CMD_ADDRESS_ALIGMENT */ - numberOfPhases = programSizeOfCurrentPass / aligmentInBytes; - - kFCCOBx[1] = BYTE2WORD_2_2(numberOfPhases, 0xFFFFU); - - /* Peform command sequence */ - returnCode = ftfx_command_sequence(config); - - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - - lengthTobeProgrammedOfCurrentSector -= programSizeOfCurrentPass; - currentOffset += programSizeOfCurrentPass; - } - - srcaddress = &srcaddress[currentOffset]; - programaddress += currentOffset; - lengthInBytes -= currentOffset; - } - -#if defined(FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD) && FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD - /* Restore function of FlexRAM if needed. */ - if (needSwitchFlexRamMode) - { - returnCode = FTFx_CMD_SetFlexramFunction(config, kFTFx_FlexramFuncOptAvailableForEeprom); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - } -#endif /* FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD */ - - return returnCode; -} -#endif /* FSL_FEATURE_FLASH_HAS_PROGRAM_SECTION_CMD */ - -#if defined(FSL_FEATURE_FLASH_HAS_PROGRAM_PARTITION_CMD) && FSL_FEATURE_FLASH_HAS_PROGRAM_PARTITION_CMD -/*! - * @brief Prepares the FlexNVM block for use as data flash, EEPROM backup, or a combination of both and initializes the - * FlexRAM. - */ -status_t FTFx_CMD_ProgramPartition(ftfx_config_t *config, - ftfx_partition_flexram_load_opt_t option, - uint32_t eepromDataSizeCode, - uint32_t flexnvmPartitionCode) -{ - status_t returnCode; - - if (config == NULL) - { - return kStatus_FTFx_InvalidArgument; - } - - /* eepromDataSizeCode[7:6], flexnvmPartitionCode[7:4] should be all 1'b0 - * or it will cause access error. */ - /* eepromDataSizeCode bit with 0x3FU; */ - /* flexnvmPartitionCode bit with 0x0FU; */ - - /* preparing passing parameter to program the flash block */ - kFCCOBx[0] = BYTE2WORD_1_2_1(FTFx_PROGRAM_PARTITION, 0xFFFFU, option); - kFCCOBx[1] = BYTE2WORD_1_1_2(eepromDataSizeCode, flexnvmPartitionCode, 0xFFFFU); - - /* calling flash command sequence function to execute the command */ - returnCode = ftfx_command_sequence(config); - -#if defined(FSL_FEATURE_FLASH_HAS_FLEX_NVM) && FSL_FEATURE_FLASH_HAS_FLEX_NVM - /* Data flash IFR will be updated by program partition command during reset sequence, - * so we just set reserved values for partitioned FlexNVM size here */ - config->eepromTotalSize = 0xFFFFU; - config->flashDesc.totalSize = 0xFFFFFFFFU; -#endif /* FSL_FEATURE_FLASH_HAS_FLEX_NVM */ - - return (returnCode); -} -#endif /* FSL_FEATURE_FLASH_HAS_PROGRAM_PARTITION_CMD */ - -/*! - * @brief Reads the Program Once Field through parameters. - */ -status_t FTFx_CMD_ReadOnce(ftfx_config_t *config, uint32_t index, uint8_t *dst, uint32_t lengthInBytes) -{ - status_t returnCode; - - if ((config == NULL) || (dst == NULL)) - { - return kStatus_FTFx_InvalidArgument; - } - - /* pass parameters to FTFx */ - kFCCOBx[0] = BYTE2WORD_1_1_2(FTFx_READ_ONCE, index, 0xFFFFU); - - /* calling flash command sequence function to execute the command */ - returnCode = ftfx_command_sequence(config); - - if (returnCode == kStatus_FTFx_Success) - { - ftfx_write_word_to_byte_address(dst, kFCCOBx[1]); - /* Note: Have to separate the first index from the rest if it equals 0 - * to avoid a pointless comparison of unsigned int to 0 compiler warning */ - if (config->ifrDesc.feature.has8ByteIdxSupport != 0U) - { - if (config->ifrDesc.feature.has4ByteIdxSupport != 0U) - { - if (((index == config->ifrDesc.idxInfo.mix8byteIdxStart) || - ((index >= ((uint32_t)config->ifrDesc.idxInfo.mix8byteIdxStart + 1U)) && - (index <= config->ifrDesc.idxInfo.mix8byteIdxEnd))) && - (lengthInBytes == 8U)) - { - ftfx_write_word_to_byte_address(&dst[4], kFCCOBx[2]); - } - } - else - { - ftfx_write_word_to_byte_address(&dst[4], kFCCOBx[2]); - } - } - } - - return returnCode; -} - -#if defined(FSL_FEATURE_FLASH_HAS_READ_RESOURCE_CMD) && FSL_FEATURE_FLASH_HAS_READ_RESOURCE_CMD -/*! - * @brief Reads the resource with data at locations passed in through parameters. - * - * this function can read date from program flash IFR, data flash IFR space, - * and the Version ID field. - */ -status_t FTFx_CMD_ReadResource( - ftfx_config_t *config, uint32_t start, uint8_t *dst, uint32_t lengthInBytes, ftfx_read_resource_opt_t option) -{ - status_t returnCode; - uint32_t readstart; - uint8_t *destaddress; - uint32_t readlengthBytes; - readstart = start; - destaddress = dst; - readlengthBytes = lengthInBytes; - if ((config == NULL) || (dst == NULL)) - { - return kStatus_FTFx_InvalidArgument; - } - - uint8_t aligmentInBytes = config->opsConfig.addrAligment.resourceCmd; - - /* Check the supplied address range. */ - returnCode = ftfx_check_resource_range(config, readstart, readlengthBytes, aligmentInBytes, option); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - - while (readlengthBytes > 0U) - { - /* preparing passing parameter */ - kFCCOBx[0] = BYTE2WORD_1_3(FTFx_READ_RESOURCE, readstart); - if (aligmentInBytes == 4U) - { - kFCCOBx[2] = BYTE2WORD_1_3(option, 0xFFFFFFU); - } - else if (aligmentInBytes == 8U) - { - kFCCOBx[1] = BYTE2WORD_1_3(option, 0xFFFFFFU); - } - else - { - return kStatus_FTFx_InvalidArgument; - } - - /* calling flash command sequence function to execute the command */ - returnCode = ftfx_command_sequence(config); - - if (kStatus_FTFx_Success != returnCode) - { - break; - } - - /* fetch data */ - ftfx_write_word_to_byte_address(destaddress, kFCCOBx[1]); - destaddress = &destaddress[4]; - if (aligmentInBytes == 8U) - { - ftfx_write_word_to_byte_address(destaddress, kFCCOBx[2]); - destaddress = &destaddress[4]; - } - /* update readstart address for next iteration */ - readstart += aligmentInBytes; - /* update readlengthBytes for next iteration */ - readlengthBytes -= aligmentInBytes; - } - - return (returnCode); -} -#endif /* FSL_FEATURE_FLASH_HAS_READ_RESOURCE_CMD */ - -/*! - * @brief Verifies an erasure of the desired flash area at a specified margin level. - * - * This function checks the appropriate number of flash sectors based on - * the desired start address and length to check whether the flash is erased - * to the specified read margin level. - */ -status_t FTFx_CMD_VerifyErase(ftfx_config_t *config, uint32_t start, uint32_t lengthInBytes, ftfx_margin_value_t margin) -{ - /* Check arguments. */ - uint32_t blockSize; - uint32_t nextBlockStartAddress; - uint32_t remainingBytes; - uint8_t aligmentInBytes = config->opsConfig.addrAligment.sectionCmd; - status_t returnCode; - uint32_t erasestart; - - /* Validates the range and alignment of the given address range.*/ - returnCode = ftfx_check_mem_range(config, start, lengthInBytes, aligmentInBytes); - if (kStatus_FTFx_Success != returnCode) - { - return returnCode; - } - - erasestart = config->opsConfig.convertedAddress; - blockSize = config->flashDesc.totalSize / config->flashDesc.blockCount; - - /* Calculate the next block start address */ - nextBlockStartAddress = ALIGN_UP(erasestart, blockSize); - - if (nextBlockStartAddress == erasestart) - { - nextBlockStartAddress += blockSize; - } - - remainingBytes = lengthInBytes; - - while (0U != remainingBytes) - { - uint32_t numberOfPhrases; - - uint32_t verifyLength = nextBlockStartAddress - erasestart; - /* Calculate the size to be verified, this flash does not support erase and program across block. */ - if (verifyLength > remainingBytes) - { - verifyLength = remainingBytes; - } - - /* Calculate the number of phrases to be verified */ - numberOfPhrases = verifyLength / aligmentInBytes; - - /* Fill in verify section command parameters. */ - kFCCOBx[0] = BYTE2WORD_1_3(FTFx_VERIFY_SECTION, erasestart); - kFCCOBx[1] = BYTE2WORD_2_1_1(numberOfPhrases, margin, 0xFFU); - - /* calling flash command sequence function to execute the command */ - returnCode = ftfx_command_sequence(config); - if (kStatus_FTFx_Success != returnCode) - { - return returnCode; - } - - remainingBytes -= verifyLength; - erasestart += verifyLength; - nextBlockStartAddress += blockSize; - } - - return kStatus_FTFx_Success; -} - -/*! - * @brief Verifies erasure of the entire flash at a specified margin level. - */ -status_t FTFx_CMD_VerifyEraseAll(ftfx_config_t *config, ftfx_margin_value_t margin) -{ - if (config == NULL) - { - return kStatus_FTFx_InvalidArgument; - } - - /* preparing passing parameter to verify all block command */ - kFCCOBx[0] = BYTE2WORD_1_1_2(FTFx_VERIFY_ALL_BLOCK, margin, 0xFFFFU); - - /* calling flash command sequence function to execute the command */ - return ftfx_command_sequence(config); -} - -/*! - * @brief Verifies whether the program flash execute-only segments have been erased to - * the specified read margin level. - */ -status_t FTFx_CMD_VerifyEraseAllExecuteOnlySegments(ftfx_config_t *config, ftfx_margin_value_t margin) -{ - if (config == NULL) - { - return kStatus_FTFx_InvalidArgument; - } - - /* preparing passing parameter to verify erase all execute-only segments command */ - kFCCOBx[0] = BYTE2WORD_1_1_2(FTFx_VERIFY_ALL_EXECUTE_ONLY_SEGMENT, margin, 0xFFFFU); - - /* calling flash command sequence function to execute the command */ - return ftfx_command_sequence(config); -} - -/*! - * @brief Verifies programming of the desired flash area at a specified margin level. - * - * This function verifies the data programed in the flash memory using the - * Flash Program Check Command and compares it to the expected data for a given - * flash area as determined by the start address and length. - */ -status_t FTFx_CMD_VerifyProgram(ftfx_config_t *config, - uint32_t start, - uint32_t lengthInBytes, - const uint8_t *expectedData, - ftfx_margin_value_t margin, - uint32_t *failedAddress, - uint32_t *failedData) -{ - status_t returnCode; - uint8_t aligmentInBytes = config->opsConfig.addrAligment.checkCmd; - uint32_t programstart; - uint32_t programlength; - programlength = lengthInBytes; - if (expectedData == NULL) - { - return kStatus_FTFx_InvalidArgument; - } - - /* Validates the range and alignment of the given address range */ - returnCode = ftfx_check_mem_range(config, start, lengthInBytes, aligmentInBytes); - if (kStatus_FTFx_Success != returnCode) - { - return returnCode; - } - - programstart = config->opsConfig.convertedAddress; - - while (0U != programlength) - { - /* preparing passing parameter to program check the flash block */ - kFCCOBx[0] = BYTE2WORD_1_3(FTFx_PROGRAM_CHECK, programstart); - kFCCOBx[1] = BYTE2WORD_1_3(margin, 0xFFFFFFU); - kFCCOBx[2] = ftfx_read_word_from_byte_address((const uint8_t *)expectedData); - - /* calling flash command sequence function to execute the command */ - returnCode = ftfx_command_sequence(config); - - /* checking for the success of command execution */ - if (kStatus_FTFx_Success != returnCode) - { - if (failedAddress != NULL) - { - *failedAddress = programstart; - } - if (failedData != NULL) - { - *failedData = 0U; - } - break; - } - - programlength -= aligmentInBytes; - expectedData = &expectedData[aligmentInBytes]; - programstart += aligmentInBytes; - } - - return (returnCode); -} - -/*! - * @brief Allows users to bypass security with a backdoor key. - */ -status_t FTFx_CMD_SecurityBypass(ftfx_config_t *config, const uint8_t *backdoorKey) -{ - uint8_t registerValue; /* registerValue */ - status_t returnCode; /* return code variable */ - - if ((config == NULL) || (backdoorKey == NULL)) - { - return kStatus_FTFx_InvalidArgument; - } - - /* set the default return code as kStatus_Success */ - returnCode = kStatus_FTFx_Success; - - /* Get flash security register value */ - registerValue = FTFx->FSEC; - - /* Check to see if flash is in secure state (any state other than 0x2) - * If not, then skip this since flash is not secure */ - if (0x02U != (registerValue & 0x03U)) - { - /* preparing passing parameter to erase a flash block */ - kFCCOBx[0] = BYTE2WORD_1_3(FTFx_SECURITY_BY_PASS, 0xFFFFFFU); - kFCCOBx[1] = BYTE2WORD_1_1_1_1(backdoorKey[0], backdoorKey[1], backdoorKey[2], backdoorKey[3]); - kFCCOBx[2] = BYTE2WORD_1_1_1_1(backdoorKey[4], backdoorKey[5], backdoorKey[6], backdoorKey[7]); - - /* calling flash command sequence function to execute the command */ - returnCode = ftfx_command_sequence(config); - } - - return (returnCode); -} - -/*! - * @brief Returns the security state via the pointer passed into the function. - */ -status_t FTFx_REG_GetSecurityState(ftfx_config_t *config, ftfx_security_state_t *state) -{ - /* store data read from flash register */ - uint8_t registerValue; - if ((config == NULL) || (state == NULL)) - { - return kStatus_FTFx_InvalidArgument; - } - - /* Get flash security register value */ - registerValue = FTFx->FSEC; - - /* check the status of the flash security bits in the security register */ - if ((uint8_t)kFTFx_FsecRegCode_SEC_Unsecured == (registerValue & FTFx_FSEC_SEC_MASK)) - { - /* Flash in unsecured state */ - *state = kFTFx_SecurityStateNotSecure; - } - else - { - /* Flash in secured state - * check for backdoor key security enable bit */ - if ((uint8_t)kFTFx_FsecRegCode_KEYEN_Enabled == (registerValue & FTFx_FSEC_KEYEN_MASK)) - { - /* Backdoor key security enabled */ - *state = kFTFx_SecurityStateBackdoorEnabled; - } - else - { - /* Backdoor key security disabled */ - *state = kFTFx_SecurityStateBackdoorDisabled; - } - } - - return kStatus_FTFx_Success; -} - -#if defined(FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD) && FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD -/*! - * @brief Sets the FlexRAM function command. - */ -status_t FTFx_CMD_SetFlexramFunction(ftfx_config_t *config, ftfx_flexram_func_opt_t option) -{ - status_t status; - if (config == NULL) - { - return kStatus_FTFx_InvalidArgument; - } - - status = ftfx_check_flexram_function_option(option); - if (kStatus_FTFx_Success != status) - { - return status; - } - - /* preparing passing parameter to verify all block command */ - kFCCOBx[0] = BYTE2WORD_1_1_2(FTFx_SET_FLEXRAM_FUNCTION, option, 0xFFFFU); - - /* calling flash command sequence function to execute the command */ - return ftfx_command_sequence(config); -} -#endif /* FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD */ - -#if defined(FSL_FEATURE_FLASH_HAS_SWAP_CONTROL_CMD) && FSL_FEATURE_FLASH_HAS_SWAP_CONTROL_CMD -/*! - * @brief Configures the Swap function or checks the swap state of the Flash module. - */ -status_t FTFx_CMD_SwapControl(ftfx_config_t *config, - uint32_t address, - ftfx_swap_control_opt_t option, - ftfx_swap_state_config_t *returnInfo) -{ - status_t returnCode; - - if ((config == NULL) || (returnInfo == NULL)) - { - return kStatus_FTFx_InvalidArgument; - } - - if ((address & ((uint32_t)FSL_FEATURE_FLASH_PFLASH_SWAP_CONTROL_CMD_ADDRESS_ALIGMENT - 1u)) != 0U) - { - return kStatus_FTFx_AlignmentError; - } - - /* Make sure address provided is in the lower half of Program flash but not in the Flash Configuration Field */ - if ((address >= (config->flashDesc.totalSize / 2u)) || - ((address >= (uint32_t)kFTFx_PflashConfigAreaStart) && (address <= (uint32_t)kFTFx_PflashConfigAreaEnd))) - { - return kStatus_FTFx_SwapIndicatorAddressError; - } - - /* Checking the option. */ - returnCode = ftfx_check_swap_control_option(option); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - - kFCCOBx[0] = BYTE2WORD_1_3(FTFx_SWAP_CONTROL, address); - kFCCOBx[1] = BYTE2WORD_1_3(option, 0xFFFFFFU); - - returnCode = ftfx_command_sequence(config); - - returnInfo->flashSwapState = (ftfx_swap_state_t)FTFx_FCCOB5_REG; - returnInfo->currentSwapBlockStatus = (ftfx_swap_block_status_t)FTFx_FCCOB6_REG; - returnInfo->nextSwapBlockStatus = (ftfx_swap_block_status_t)FTFx_FCCOB7_REG; - - return returnCode; -} -#endif /* FSL_FEATURE_FLASH_HAS_SWAP_CONTROL_CMD */ - -static void ftfx_init_ifr(ftfx_config_t *config) -{ -#if FSL_FEATURE_FLASH_IS_FTFA - /* FTFA parts(eg. K80, KL80, L5K) support both 4-bytes and 8-bytes unit size */ - config->ifrDesc.feature.has4ByteIdxSupport = 1U; - config->ifrDesc.feature.has8ByteIdxSupport = 1U; - config->ifrDesc.idxInfo.mix8byteIdxStart = 0x10U; - config->ifrDesc.idxInfo.mix8byteIdxEnd = 0x13U; -#elif FSL_FEATURE_FLASH_IS_FTFE - /* FTFE parts(eg. K65, KE18) only support 8-bytes unit size */ - config->ifrDesc.feature.has4ByteIdxSupport = 0U; - config->ifrDesc.feature.has8ByteIdxSupport = 1U; -#elif FSL_FEATURE_FLASH_IS_FTFL - /* FTFL parts(eg. K20) only support 4-bytes unit size */ - config->ifrDesc.feature.has4ByteIdxSupport = 1U; - config->ifrDesc.feature.has8ByteIdxSupport = 0U; -#endif - - config->ifrDesc.resRange.pflashIfrStart = 0x0000U; - config->ifrDesc.resRange.versionIdSize = 0x08U; -#if FSL_FEATURE_FLASH_IS_FTFE - config->ifrDesc.resRange.versionIdStart = 0x08U; - config->ifrDesc.resRange.ifrMemSize = 0x0400U; -#else /* FSL_FEATURE_FLASH_IS_FTFL == 1 or FSL_FEATURE_FLASH_IS_FTFA = =1 */ - config->ifrDesc.resRange.versionIdStart = 0x00U; - config->ifrDesc.resRange.ifrMemSize = 0x0100U; -#endif - -#if FSL_FEATURE_FLASH_HAS_FLEX_NVM - config->ifrDesc.resRange.dflashIfrStart = 0x800000U; -#endif - -#if FSL_FEATURE_FLASH_HAS_SWAP_CONTROL_CMD -#if FSL_FEATURE_FLASH_IS_FTFE - config->ifrDesc.resRange.pflashSwapIfrStart = 0x40000U; -#else /* FSL_FEATURE_FLASH_IS_FTFL == 1 or FSL_FEATURE_FLASH_IS_FTFA == 1 */ - config->ifrDesc.resRange.pflashSwapIfrStart = config->flashDesc.totalSize / 4; -#endif -#endif /* FSL_FEATURE_FLASH_HAS_SWAP_CONTROL_CMD */ -} - -#if FTFx_DRIVER_IS_FLASH_RESIDENT -/*! - * @brief Copy PIC of flash_run_command() to RAM - */ -static void ftfx_copy_run_command_to_ram(uint32_t *ftfxRunCommand) -{ - assert(sizeof(s_ftfxRunCommandFunctionCode) <= ((uint32_t)kFTFx_RamFuncMaxSizeInWords * 4U)); - - /* Since the value of ARM function pointer is always odd, but the real start address - * of function memory should be even, that's why +1 operation exist. */ - (void)memcpy(ftfxRunCommand, s_ftfxRunCommandFunctionCode, sizeof(s_ftfxRunCommandFunctionCode)); -} -#endif /* FTFx_DRIVER_IS_FLASH_RESIDENT */ - -/*! - * @brief FTFx Command Sequence - * - * This function is used to perform the command write sequence to the flash. - * - * @param driver Pointer to storage for the driver runtime state. - * @return An error code or kStatus_FTFx_Success - */ -static status_t ftfx_command_sequence(ftfx_config_t *config) -{ - uint8_t registerValue; - -#if FTFx_DRIVER_IS_FLASH_RESIDENT - /* clear RDCOLERR & ACCERR & FPVIOL flag in flash status register */ - FTFx->FSTAT = FTFx_FSTAT_RDCOLERR_MASK | FTFx_FSTAT_ACCERR_MASK | FTFx_FSTAT_FPVIOL_MASK; - - /* Since the value of ARM function pointer is always odd, but the real start address - * of function memory should be even, that's why +1 operation exist. */ - config->runCmdFuncAddr.commadAddr += 1UL; - callFtfxRunCommand_t callFtfxRunCommand = config->runCmdFuncAddr.callFlashCommand; - - /* We pass the ftfx_fstat address as a parameter to flash_run_comamnd() instead of using - * pre-processed MICRO sentences or operating global variable in flash_run_comamnd() - * to make sure that flash_run_command() will be compiled into position-independent code (PIC). */ - callFtfxRunCommand((FTFx_REG8_ACCESS_TYPE)(&FTFx->FSTAT)); - config->runCmdFuncAddr.commadAddr -= 1UL; -#else - /* clear RDCOLERR & ACCERR & FPVIOL flag in flash status register */ - FTFx->FSTAT = FTFx_FSTAT_RDCOLERR_MASK | FTFx_FSTAT_ACCERR_MASK | FTFx_FSTAT_FPVIOL_MASK; - - /* clear CCIF bit */ - FTFx->FSTAT = FTFx_FSTAT_CCIF_MASK; - - /* Check CCIF bit of the flash status register, wait till it is set. - * IP team indicates that this loop will always complete. */ - while (!(FTFx->FSTAT & FTFx_FSTAT_CCIF_MASK)) - { - } -#endif /* FTFx_DRIVER_IS_FLASH_RESIDENT */ - - /* Check error bits */ - /* Get flash status register value */ - registerValue = FTFx->FSTAT; - - /* checking access error */ - if (0U != (registerValue & FTFx_FSTAT_ACCERR_MASK)) - { - return kStatus_FTFx_AccessError; - } - /* checking protection error */ - else if (0U != (registerValue & FTFx_FSTAT_FPVIOL_MASK)) - { - return kStatus_FTFx_ProtectionViolation; - } - /* checking MGSTAT0 non-correctable error */ - else if (0U != (registerValue & FTFx_FSTAT_MGSTAT0_MASK)) - { - return kStatus_FTFx_CommandFailure; - } - else - { - return kStatus_FTFx_Success; - } -} - -static void ftfx_command_sequence_non_blocking(ftfx_config_t *config) -{ -#if FTFx_DRIVER_IS_FLASH_RESIDENT - /* clear RDCOLERR & ACCERR & FPVIOL flag in flash status register */ - FTFx->FSTAT = FTFx_FSTAT_RDCOLERR_MASK | FTFx_FSTAT_ACCERR_MASK | FTFx_FSTAT_FPVIOL_MASK; - - /* Since the value of ARM function pointer is always odd, but the real start address - * of function memory should be even, that's why +1 operation exist. */ - config->runCmdFuncAddr.commadAddr += 1UL; - callFtfxRunCommand_t callFtfxRunCommand = config->runCmdFuncAddr.callFlashCommand; - - /* We pass the ftfx_fstat address as a parameter to flash_run_comamnd() instead of using - * pre-processed MICRO sentences or operating global variable in flash_run_comamnd() - * to make sure that flash_run_command() will be compiled into position-independent code (PIC). */ - callFtfxRunCommand((FTFx_REG8_ACCESS_TYPE)(&FTFx->FSTAT)); - config->runCmdFuncAddr.commadAddr -= 1UL; -#else - /* clear RDCOLERR & ACCERR & FPVIOL flag in flash status register */ - FTFx->FSTAT = FTFx_FSTAT_RDCOLERR_MASK | FTFx_FSTAT_ACCERR_MASK | FTFx_FSTAT_FPVIOL_MASK; - - /* clear CCIF bit */ - FTFx->FSTAT = FTFx_FSTAT_CCIF_MASK; -#endif -} - -/*! @brief Validates the range and alignment of the given address range.*/ -static status_t ftfx_check_mem_range(ftfx_config_t *config, - uint32_t startAddress, - uint32_t lengthInBytes, - uint8_t alignmentBaseline) -{ - status_t status = kStatus_FTFx_AddressError; - - /* Verify the start and length are alignmentBaseline aligned. */ - if ((0U != (startAddress & (uint8_t)(alignmentBaseline - 1U))) || - (0U != (lengthInBytes & (uint8_t)(alignmentBaseline - 1U)))) - { - return kStatus_FTFx_AlignmentError; - } - - /* check for valid range of the target addresses */ - if ((startAddress >= config->flashDesc.blockBase) && - ((startAddress + lengthInBytes) <= (config->flashDesc.blockBase + config->flashDesc.totalSize))) - { - status = kStatus_FTFx_Success; - } -#if defined(FSL_FEATURE_FLASH_HAS_FLEX_NVM_ALIAS) && FSL_FEATURE_FLASH_HAS_FLEX_NVM_ALIAS - else if ((startAddress >= config->flashDesc.aliasBlockBase) && - ((startAddress + lengthInBytes) <= (config->flashDesc.aliasBlockBase + config->flashDesc.totalSize))) - { - status = kStatus_FTFx_Success; - } - else - { - status = kStatus_FTFx_AddressError; - } -#endif - - return status; -} - -/*! @brief Validates the given user key for flash erase APIs.*/ -static status_t ftfx_check_user_key(uint32_t key) -{ - /* Validate the user key */ - if (key != (uint32_t)kFTFx_ApiEraseKey) - { - return kStatus_FTFx_EraseKeyError; - } - - return kStatus_FTFx_Success; -} - -/*! @brief Reads word from byte address.*/ -static uint32_t ftfx_read_word_from_byte_address(const uint8_t *src) -{ - uint32_t word = 0U; - const uint8_t *readsrc = src; - /* If the source address is aligned with 4 bytes */ - if (0U == ((uint32_t)readsrc % 4U)) - { - word = *(const uint32_t *)(uint32_t)readsrc; - } - /* Read 4 bytes from a non-4-byte aligned address, 1 byte one time */ - else - { - for (uint32_t i = 0U; i < 4U; i++) - { - word |= (uint32_t)(*readsrc) << (i * 8U); - readsrc++; - } - } - - return word; -} - -/*! @brief Writes word to byte address.*/ -static void ftfx_write_word_to_byte_address(uint8_t *dst, uint32_t word) -{ - uint8_t *writedst = dst; - /* If the source address is aligned with 4 bytes */ - if (0U == ((uint32_t)writedst % 4U)) - { - *(uint32_t *)(uint32_t)writedst = word; - } - else - { - /* Write 4 bytes into a non-4-byte aligned address memory, 1 byte one time */ - for (uint32_t i = 0U; i < 4U; i++) - { - *writedst = (uint8_t)((word >> (i * 8U)) & 0xFFU); - writedst++; - } - } -} - -#if defined(FSL_FEATURE_FLASH_HAS_READ_RESOURCE_CMD) && FSL_FEATURE_FLASH_HAS_READ_RESOURCE_CMD -/*! @brief Validates the range of the given resource address.*/ -static status_t ftfx_check_resource_range(ftfx_config_t *config, - uint32_t start, - uint32_t lengthInBytes, - uint32_t alignmentBaseline, - ftfx_read_resource_opt_t option) -{ - status_t status; - uint32_t maxReadbleAddress; - - if ((0U != (start & (alignmentBaseline - 1u))) || (0U != (lengthInBytes & (alignmentBaseline - 1u)))) - { - return kStatus_FTFx_AlignmentError; - } - - status = kStatus_FTFx_Success; - - maxReadbleAddress = start + lengthInBytes - 1u; - /* read resource code from the version ID field */ - if (option == kFTFx_ResourceOptionVersionId) - { - if ((start != config->ifrDesc.resRange.versionIdStart) || - (lengthInBytes != config->ifrDesc.resRange.versionIdSize)) - { - status = kStatus_FTFx_InvalidArgument; - } - } - else if (option == kFTFx_ResourceOptionFlashIfr) - { - /* read resource code from the program flash IFR space */ - if ((start >= config->ifrDesc.resRange.pflashIfrStart) && - (maxReadbleAddress < (config->ifrDesc.resRange.pflashIfrStart + config->ifrDesc.resRange.ifrMemSize))) - { - } -#if defined(FSL_FEATURE_FLASH_HAS_FLEX_NVM) && FSL_FEATURE_FLASH_HAS_FLEX_NVM - /* read resource code from the date flash IFR space */ - else if ((start >= config->ifrDesc.resRange.dflashIfrStart) && - (maxReadbleAddress < (config->ifrDesc.resRange.dflashIfrStart + config->ifrDesc.resRange.ifrMemSize))) - { - } -#endif /* FSL_FEATURE_FLASH_HAS_FLEX_NVM */ -#if defined(FSL_FEATURE_FLASH_HAS_SWAP_CONTROL_CMD) && FSL_FEATURE_FLASH_HAS_SWAP_CONTROL_CMD - /* read resource code from the Program Flash Swap IFR space */ - else if ((start >= config->ifrDesc.resRange.pflashSwapIfrStart) && - (maxReadbleAddress < - (config->ifrDesc.resRange.pflashSwapIfrStart + config->ifrDesc.resRange.ifrMemSize))) - { - } -#endif /* FSL_FEATURE_FLASH_HAS_SWAP_CONTROL_CMD */ - else - { - status = kStatus_FTFx_InvalidArgument; - } - } - else - { - status = kStatus_FTFx_InvalidArgument; - } - - return status; -} -#endif /* FSL_FEATURE_FLASH_HAS_READ_RESOURCE_CMD */ - -#if defined(FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD) && FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD -/*! @brief Validates the given flexram function option.*/ -static inline status_t ftfx_check_flexram_function_option(ftfx_flexram_func_opt_t option) -{ - if ((option != kFTFx_FlexramFuncOptAvailableAsRam) && (option != kFTFx_FlexramFuncOptAvailableForEeprom)) - { - return kStatus_FTFx_InvalidArgument; - } - - return kStatus_FTFx_Success; -} -#endif /* FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD */ - -#if defined(FSL_FEATURE_FLASH_HAS_SWAP_CONTROL_CMD) && FSL_FEATURE_FLASH_HAS_SWAP_CONTROL_CMD -/*! @brief Validates the given swap control option.*/ -static status_t ftfx_check_swap_control_option(ftfx_swap_control_opt_t option) -{ - if ((option == kFTFx_SwapControlOptionIntializeSystem) || (option == kFTFx_SwapControlOptionSetInUpdateState) || - (option == kFTFx_SwapControlOptionSetInCompleteState) || (option == kFTFx_SwapControlOptionReportStatus) || - (option == kFTFx_SwapControlOptionDisableSystem)) - { - return kStatus_FTFx_Success; - } - - return kStatus_FTFx_InvalidArgument; -} -#endif /* FSL_FEATURE_FLASH_HAS_SWAP_CONTROL_CMD */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_ftfx_controller.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_ftfx_controller.h deleted file mode 100644 index 48567f536d3..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_ftfx_controller.h +++ /dev/null @@ -1,849 +0,0 @@ -/* - * Copyright 2013-2016 Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - * - */ - -#ifndef FSL_FTFX_CONTROLLER_H -#define FSL_FTFX_CONTROLLER_H - -#include "fsl_ftfx_features.h" -#include "fsl_ftfx_utilities.h" - -/*! - * @addtogroup ftfx_controller - * @{ - */ -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @name FTFx status - * @{ - */ - -/*! @cond output_undoc_content */ -/* FTFx driver status group. */ -#if defined(kStatusGroup_FlashDriver) -#define kStatusGroupGeneric kStatusGroup_Generic -#define kStatusGroupFtfxDriver kStatusGroup_FlashDriver -#elif defined(kStatusGroup_FLASH) -#define kStatusGroupGeneric kStatusGroup_Generic -#define kStatusGroupFtfxDriver kStatusGroup_FLASH -#else -#define kStatusGroupGeneric 0 -#define kStatusGroupFtfxDriver 1 -#endif -/*! @endcond */ - -/*! - * @brief FTFx driver status codes. - */ -enum -{ - kStatus_FTFx_Success = MAKE_STATUS(kStatusGroupGeneric, 0), /*!< API is executed successfully*/ - kStatus_FTFx_InvalidArgument = MAKE_STATUS(kStatusGroupGeneric, 4), /*!< Invalid argument*/ - kStatus_FTFx_SizeError = MAKE_STATUS(kStatusGroupFtfxDriver, 0), /*!< Error size*/ - kStatus_FTFx_AlignmentError = - MAKE_STATUS(kStatusGroupFtfxDriver, 1), /*!< Parameter is not aligned with the specified baseline*/ - kStatus_FTFx_AddressError = MAKE_STATUS(kStatusGroupFtfxDriver, 2), /*!< Address is out of range */ - kStatus_FTFx_AccessError = - MAKE_STATUS(kStatusGroupFtfxDriver, 3), /*!< Invalid instruction codes and out-of bound addresses */ - kStatus_FTFx_ProtectionViolation = MAKE_STATUS( - kStatusGroupFtfxDriver, 4), /*!< The program/erase operation is requested to execute on protected areas */ - kStatus_FTFx_CommandFailure = - MAKE_STATUS(kStatusGroupFtfxDriver, 5), /*!< Run-time error during command execution. */ - kStatus_FTFx_UnknownProperty = MAKE_STATUS(kStatusGroupFtfxDriver, 6), /*!< Unknown property.*/ - kStatus_FTFx_EraseKeyError = MAKE_STATUS(kStatusGroupFtfxDriver, 7), /*!< API erase key is invalid.*/ - kStatus_FTFx_RegionExecuteOnly = MAKE_STATUS(kStatusGroupFtfxDriver, 8), /*!< The current region is execute-only.*/ - kStatus_FTFx_ExecuteInRamFunctionNotReady = - MAKE_STATUS(kStatusGroupFtfxDriver, 9), /*!< Execute-in-RAM function is not available.*/ - kStatus_FTFx_PartitionStatusUpdateFailure = - MAKE_STATUS(kStatusGroupFtfxDriver, 10), /*!< Failed to update partition status.*/ - kStatus_FTFx_SetFlexramAsEepromError = - MAKE_STATUS(kStatusGroupFtfxDriver, 11), /*!< Failed to set FlexRAM as EEPROM.*/ - kStatus_FTFx_RecoverFlexramAsRamError = - MAKE_STATUS(kStatusGroupFtfxDriver, 12), /*!< Failed to recover FlexRAM as RAM.*/ - kStatus_FTFx_SetFlexramAsRamError = MAKE_STATUS(kStatusGroupFtfxDriver, 13), /*!< Failed to set FlexRAM as RAM.*/ - kStatus_FTFx_RecoverFlexramAsEepromError = - MAKE_STATUS(kStatusGroupFtfxDriver, 14), /*!< Failed to recover FlexRAM as EEPROM.*/ - kStatus_FTFx_CommandNotSupported = MAKE_STATUS(kStatusGroupFtfxDriver, 15), /*!< Flash API is not supported.*/ - kStatus_FTFx_SwapSystemNotInUninitialized = - MAKE_STATUS(kStatusGroupFtfxDriver, 16), /*!< Swap system is not in an uninitialzed state.*/ - kStatus_FTFx_SwapIndicatorAddressError = - MAKE_STATUS(kStatusGroupFtfxDriver, 17), /*!< The swap indicator address is invalid.*/ - kStatus_FTFx_ReadOnlyProperty = MAKE_STATUS(kStatusGroupFtfxDriver, 18), /*!< The flash property is read-only.*/ - kStatus_FTFx_InvalidPropertyValue = - MAKE_STATUS(kStatusGroupFtfxDriver, 19), /*!< The flash property value is out of range.*/ - kStatus_FTFx_InvalidSpeculationOption = - MAKE_STATUS(kStatusGroupFtfxDriver, 20), /*!< The option of flash prefetch speculation is invalid.*/ - kStatus_FTFx_CommandOperationInProgress = - MAKE_STATUS(kStatusGroupFtfxDriver, 21), /*!< The option of flash command is processing.*/ -}; -/*! @} */ - -/*! - * @name FTFx API key - * @{ - */ -/*! - * @brief Enumeration for FTFx driver API keys. - * - * @note The resulting value is built with a byte order such that the string - * being readable in expected order when viewed in a hex editor, if the value - * is treated as a 32-bit little endian value. - */ -enum _ftfx_driver_api_keys -{ - kFTFx_ApiEraseKey = FOUR_CHAR_CODE('k', 'f', 'e', 'k') /*!< Key value used to validate all FTFx erase APIs.*/ -}; -/*! @} */ - -/*! - * @brief Enumeration for the FlexRAM load during reset option. - */ -typedef enum _ftfx_partition_flexram_load_option -{ - kFTFx_PartitionFlexramLoadOptLoadedWithValidEepromData = - 0x00U, /*!< FlexRAM is loaded with valid EEPROM data during reset sequence.*/ - kFTFx_PartitionFlexramLoadOptNotLoaded = 0x01U /*!< FlexRAM is not loaded during reset sequence.*/ -} ftfx_partition_flexram_load_opt_t; - -/*! - * @brief Enumeration for the two possible options of flash read resource command. - */ -typedef enum _ftfx_read_resource_opt -{ - kFTFx_ResourceOptionFlashIfr = - 0x00U, /*!< Select code for Program flash 0 IFR, Program flash swap 0 IFR, Data flash 0 IFR */ - kFTFx_ResourceOptionVersionId = 0x01U /*!< Select code for the version ID*/ -} ftfx_read_resource_opt_t; - -/*! - * @brief Enumeration for supported FTFx margin levels. - */ -typedef enum _ftfx_margin_value -{ - kFTFx_MarginValueNormal, /*!< Use the 'normal' read level for 1s.*/ - kFTFx_MarginValueUser, /*!< Apply the 'User' margin to the normal read-1 level.*/ - kFTFx_MarginValueFactory, /*!< Apply the 'Factory' margin to the normal read-1 level.*/ - kFTFx_MarginValueInvalid /*!< Not real margin level, Used to determine the range of valid margin level. */ -} ftfx_margin_value_t; - -/*! - * @brief Enumeration for the three possible FTFx security states. - */ -typedef enum _ftfx_security_state -{ - kFTFx_SecurityStateNotSecure = (int)0xc33cc33cu, /*!< Flash is not secure.*/ - kFTFx_SecurityStateBackdoorEnabled = (int)0x5aa55aa5u, /*!< Flash backdoor is enabled.*/ - kFTFx_SecurityStateBackdoorDisabled = (int)0x5ac33ca5u /*!< Flash backdoor is disabled.*/ -} ftfx_security_state_t; - -/*! - * @brief Enumeration for the two possilbe options of set FlexRAM function command. - */ -typedef enum _ftfx_flexram_function_option -{ - kFTFx_FlexramFuncOptAvailableAsRam = 0xFFU, /*!< An option used to make FlexRAM available as RAM */ - kFTFx_FlexramFuncOptAvailableForEeprom = 0x00U /*!< An option used to make FlexRAM available for EEPROM */ -} ftfx_flexram_func_opt_t; - -/*! - * @brief Enumeration for acceleration ram property. - */ -enum _flash_acceleration_ram_property -{ - kFLASH_AccelerationRamSize = 0x400U -}; - -#if defined(FSL_FEATURE_FLASH_HAS_SWAP_CONTROL_CMD) && FSL_FEATURE_FLASH_HAS_SWAP_CONTROL_CMD -/*! - * @brief Enumeration for the possible options of Swap control commands - */ -typedef enum _ftfx_swap_control_option -{ - kFTFx_SwapControlOptionIntializeSystem = 0x01U, /*!< An option used to initialize the Swap system */ - kFTFx_SwapControlOptionSetInUpdateState = 0x02U, /*!< An option used to set the Swap in an update state */ - kFTFx_SwapControlOptionSetInCompleteState = 0x04U, /*!< An option used to set the Swap in a complete state */ - kFTFx_SwapControlOptionReportStatus = 0x08U, /*!< An option used to report the Swap status */ - kFTFx_SwapControlOptionDisableSystem = 0x10U /*!< An option used to disable the Swap status */ -} ftfx_swap_control_opt_t; -#endif /* FSL_FEATURE_FLASH_HAS_SWAP_CONTROL_CMD */ - -/*! - * @brief Enumeration for the possible flash Swap status. - */ -typedef enum _ftfx_swap_state -{ - kFTFx_SwapStateUninitialized = 0x00U, /*!< Flash Swap system is in an uninitialized state.*/ - kFTFx_SwapStateReady = 0x01U, /*!< Flash Swap system is in a ready state.*/ - kFTFx_SwapStateUpdate = 0x02U, /*!< Flash Swap system is in an update state.*/ - kFTFx_SwapStateUpdateErased = 0x03U, /*!< Flash Swap system is in an updateErased state.*/ - kFTFx_SwapStateComplete = 0x04U, /*!< Flash Swap system is in a complete state.*/ - kFTFx_SwapStateDisabled = 0x05U /*!< Flash Swap system is in a disabled state.*/ -} ftfx_swap_state_t; - -#if defined(FSL_FEATURE_FLASH_HAS_SWAP_CONTROL_CMD) && FSL_FEATURE_FLASH_HAS_SWAP_CONTROL_CMD -/*! - * @brief Enumeration for the possible flash Swap block status - */ -typedef enum _ftfx_swap_block_status -{ - kFTFx_SwapBlockStatusLowerHalfProgramBlocksAtZero = - 0x00U, /*!< Swap block status is that lower half program block at zero.*/ - kFTFx_SwapBlockStatusUpperHalfProgramBlocksAtZero = - 0x01U, /*!< Swap block status is that upper half program block at zero.*/ -} ftfx_swap_block_status_t; - -/*! - * @brief Flash Swap information - */ -typedef struct _ftfx_swap_state_config -{ - ftfx_swap_state_t flashSwapState; /*! -#include -#include "fsl_device_registers.h" -#include "bootloader_common.h" -#else -#include "fsl_common.h" -#endif - -#include "fsl_ftfx_adapter.h" - -/*! - * @addtogroup ftfx_feature - * @{ - */ -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @name FTFx configuration - * @{ - */ -/*! @brief Flash driver location. */ -#if !defined(FTFx_DRIVER_IS_FLASH_RESIDENT) -#if (!defined(BL_TARGET_ROM) && !defined(BL_TARGET_RAM)) -#define FTFx_DRIVER_IS_FLASH_RESIDENT 1U /*!< Used for the flash resident application. */ -#else -#define FTFx_DRIVER_IS_FLASH_RESIDENT 0U /*!< Used for the non-flash resident application. */ -#endif -#endif - -/*! @brief Flash Driver Export option */ -#if !defined(FTFx_DRIVER_IS_EXPORTED) -#if defined(BL_TARGET_ROM) -#define FTFx_DRIVER_IS_EXPORTED 1U /*!< Used for the ROM bootloader. */ -#else -#define FTFx_DRIVER_IS_EXPORTED 0U /*!< Used for the MCUXpresso SDK application. */ -#endif -#endif -/*! @} */ - -/*! @brief Indicates whether the secondary flash is supported in the Flash driver */ -#if defined(FSL_FEATURE_FLASH_HAS_MULTIPLE_FLASH) || defined(FSL_FEATURE_FLASH_PFLASH_1_START_ADDRESS) -#define FTFx_DRIVER_HAS_FLASH1_SUPPORT (1U) -#define FTFx_FLASH_COUNT (2U) -#else -#define FTFx_DRIVER_HAS_FLASH1_SUPPORT (0U) -#define FTFx_FLASH_COUNT (1U) -#endif - -/*! - * @name Secondary flash configuration - * @{ - */ -/*! @brief Indicates whether the secondary flash has its own protection register in flash module. */ -#if defined(FSL_FEATURE_FLASH_HAS_MULTIPLE_FLASH) && defined(FTFE_FPROTS_PROTS_MASK) -#define FTFx_FLASH1_HAS_PROT_CONTROL (1U) -#else -#define FTFx_FLASH1_HAS_PROT_CONTROL (0U) -#endif - -/*! @brief Indicates whether the secondary flash has its own Execute-Only access register in flash module. */ -#if defined(FSL_FEATURE_FLASH_HAS_MULTIPLE_FLASH) && defined(FTFE_FACSSS_SGSIZE_S_MASK) -#define FTFx_FLASH1_HAS_XACC_CONTROL (1U) -#else -#define FTFx_FLASH1_HAS_XACC_CONTROL (0U) -#endif -/*! @} */ - -#if FTFx_FLASH1_HAS_XACC_CONTROL || FTFx_FLASH1_HAS_PROT_CONTROL -#define FTFx_FLASH1_IS_INDEPENDENT_BLOCK (1U) -#else -#define FTFx_FLASH1_IS_INDEPENDENT_BLOCK (0U) -#endif - -/*! @}*/ - -#endif /* FSL_FTFX_FEATURES_H */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_ftfx_flash.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_ftfx_flash.c deleted file mode 100644 index f6700ee476c..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_ftfx_flash.c +++ /dev/null @@ -1,1544 +0,0 @@ -/* - * Copyright 2013-2016 Freescale Semiconductor, Inc. - * Copyright 2016-2020, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - * - */ - -#include "fsl_ftfx_flash.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flash" -#endif - -/*! - * @brief Enumeration for special memory property. - */ -enum _ftfx_special_mem_property -{ - kFTFx_AccessSegmentUnitSize = 256UL, - kFTFx_MinProtectBlockSize = 1024UL, -}; - -#if defined(FSL_FEATURE_FLASH_HAS_SWAP_CONTROL_CMD) && FSL_FEATURE_FLASH_HAS_SWAP_CONTROL_CMD -/*! - * @brief Enumeration for the index of read/program once record - */ -enum _k3_flash_read_once_index -{ - kFLASH_RecordIndexSwapAddr = 0xA1U, /*!< Index of Swap indicator address.*/ - kFLASH_RecordIndexSwapEnable = 0xA2U, /*!< Index of Swap system enable.*/ - kFLASH_RecordIndexSwapDisable = 0xA3U, /*!< Index of Swap system disable.*/ -}; -#endif /* FSL_FEATURE_FLASH_HAS_SWAP_CONTROL_CMD */ - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! @brief init flash features */ -static void flash_init_features(ftfx_config_t *config); - -/*! @brief init protection feature */ -static void flash_protection_init(flash_config_t *config, uint8_t flashIndex); - -/*! @brief init access segment feature */ -#if defined(FSL_FEATURE_FLASH_HAS_ACCESS_CONTROL) && FSL_FEATURE_FLASH_HAS_ACCESS_CONTROL -static void flash_access_init(flash_config_t *config, uint8_t flashIndex); -#endif - -/*! @brief init flash operation config */ -static void flash_opsonfig_Init(flash_config_t *config, uint8_t flashIndex); - -/*! @brief Calculate flash memory size based on given parameter */ -static uint32_t flash_calculate_mem_size(uint32_t pflashBlockCount, - uint32_t pflashBlockSize, - uint32_t pfsizeMask, - uint32_t pfsizeShift); - -static uint32_t flash_calculate_prot_segment_size(uint32_t flashSize, uint32_t segmentCount); - -/*! @brief Validates the given address to get current flash index */ -static status_t flash_check_range_to_get_index(flash_config_t *config, - uint32_t start, - uint32_t lengthInBytes, - uint8_t *flashIndex); - -/*! @brief Decide whether to convert the start address from primary flash to secondary flash based on the current start - * address*/ -static void flash_convert_start_address(ftfx_config_t *config, uint32_t start); - -#if defined(FSL_FEATURE_FLASH_HAS_PFLASH_BLOCK_SWAP) && FSL_FEATURE_FLASH_HAS_PFLASH_BLOCK_SWAP -/*! @brief Validates the given address to see if it is equal to swap indicator address in pflash swap IFR.*/ -static status_t flash_validate_swap_indicator_address(ftfx_config_t *config, uint32_t address); -#endif /* FSL_FEATURE_FLASH_HAS_PFLASH_BLOCK_SWAP */ - -/******************************************************************************* - * Variables - ******************************************************************************/ - -static volatile uint32_t *const kFPROTL = (volatile uint32_t *)(uint32_t)&FTFx_FPROT_LOW_REG; -#if defined(FTFx_FLASH0_HAS_HIGH_PROT_REG) && FTFx_FLASH0_HAS_HIGH_PROT_REG -static volatile uint32_t *const kFPROTH = (volatile uint32_t *)(uint32_t)&FTFx_FPROT_HIGH_REG; -#endif /* FTFx_FLASH0_HAS_HIGH_PROT_REG */ -#if defined(FTFx_FLASH1_HAS_INT_PROT_REG) && FTFx_FLASH1_HAS_INT_PROT_REG -volatile uint8_t *const kFPROTSL = (volatile uint8_t *)(uint32_t)&FTFx_FPROTSL_REG; -volatile uint8_t *const kFPROTSH = (volatile uint8_t *)(uint32_t)&FTFx_FPROTSH_REG; -#endif /* FTFx_FLASH1_HAS_INT_PROT_REG */ - -/*! - * @brief Table of pflash sizes. - * - * The index into this table is the value of the SIM_FCFG1.PFSIZE bitfield. - * - * The values in this table have been right shifted 10 bits so that they will all fit within - * an 16-bit integer. To get the actual flash density, you must left shift the looked up value - * by 10 bits. - * - * Elements of this table have a value of 0 in cases where the PFSIZE bitfield value is - * reserved. - * - * Code to use the table: - * @code - * uint8_t pfsize = (SIM->FCFG1 & SIM_FCFG1_PFSIZE_MASK) >> SIM_FCFG1_PFSIZE_SHIFT; - * flashDensity = ((uint32_t)kPFlashDensities[pfsize]) << 10; - * @endcode - */ -#if defined(FSL_FEATURE_FLASH_SIZE_ENCODING_RULE_VERSION) && (FSL_FEATURE_FLASH_SIZE_ENCODING_RULE_VERSION == 1) -static const uint16_t kPFlashDensities[] = { - 0u, /* 0x0 - undefined */ - 0u, /* 0x1 - undefined */ - 0u, /* 0x2 - undefined */ - 0u, /* 0x3 - undefined */ - 0u, /* 0x4 - undefined */ - 0u, /* 0x5 - undefined */ - 0u, /* 0x6 - undefined */ - 0u, /* 0x7 - undefined */ - 0u, /* 0x8 - undefined */ - 0u, /* 0x9 - undefined */ - 256u, /* 0xa - 262144, 256KB */ - 512u, /* 0xb - 524288, 512KB */ - 1024u, /* 0xc - 1048576, 1MB */ - 0u, /* 0xd - undefined */ - 0u, /* 0xe - undefined */ - 0u, /* 0xf - undefined */ -}; -#else -static const uint16_t kPFlashDensities[] = { - 8u, /* 0x0 - 8192, 8KB */ - 16u, /* 0x1 - 16384, 16KB */ - 24u, /* 0x2 - 24576, 24KB */ - 32u, /* 0x3 - 32768, 32KB */ - 48u, /* 0x4 - 49152, 48KB */ - 64u, /* 0x5 - 65536, 64KB */ - 96u, /* 0x6 - 98304, 96KB */ - 128u, /* 0x7 - 131072, 128KB */ - 192u, /* 0x8 - 196608, 192KB */ - 256u, /* 0x9 - 262144, 256KB */ - 384u, /* 0xa - 393216, 384KB */ - 512u, /* 0xb - 524288, 512KB */ - 768u, /* 0xc - 786432, 768KB */ - 1024u, /* 0xd - 1048576, 1MB */ - 1536u, /* 0xe - 1572864, 1.5MB */ - /* 2048u, 0xf - 2097152, 2MB */ -}; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * @brief Initializes the global flash properties structure members. - * - * This function checks and initializes the Flash module for the other Flash APIs. - * - * @param config Pointer to the storage for the driver runtime state. - * - * @retval #kStatus_FTFx_Success API was executed successfully. - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_PartitionStatusUpdateFailure Failed to update the partition status. - */ -status_t FLASH_Init(flash_config_t *config) -{ - if (config == NULL) - { - return kStatus_FTFx_InvalidArgument; - } - - for (uint8_t flashIndex = 0U; flashIndex < FTFx_FLASH_COUNT; flashIndex++) - { - /* init flash type, kinetis has Pflash and flxnvm, pflash is often used to store executable code - * and flexnvm can be used as date flash to store user data, and can also be configured as eeprom backup space - * with flexram. - */ - config->ftfxConfig[flashIndex].flashDesc.type = (uint8_t)kFTFx_MemTypePflash; - /* init the current flash index */ - config->ftfxConfig[flashIndex].flashDesc.index = flashIndex; - /* init flash features */ - flash_init_features(&config->ftfxConfig[flashIndex]); - /* init flash Operation Config */ - flash_opsonfig_Init(config, flashIndex); - -#if defined(FSL_FEATURE_FLASH_HAS_ACCESS_CONTROL) && FSL_FEATURE_FLASH_HAS_ACCESS_CONTROL - if (0U != (config->ftfxConfig[flashIndex].flashDesc.feature.hasXaccControl)) - { - /* init access segment feature */ - flash_access_init(config, flashIndex); - } -#endif /* FSL_FEATURE_FLASH_HAS_ACCESS_CONTROL */ -#if (FTFx_FLASH_COUNT > 1U) - if (0U != (config->ftfxConfig[flashIndex].flashDesc.feature.hasProtControl)) -#endif - { - /* init protection feature */ - flash_protection_init(config, flashIndex); - } - - /* Init FTFx Kernel */ - FTFx_API_Init(&config->ftfxConfig[flashIndex]); - } - - return kStatus_FTFx_Success; -} - -/*! - * @brief Erases the Dflash sectors encompassed by parameters passed into function. - * - * This function erases the appropriate number of flash sectors based on the - * desired start address and length. - * - * @param config The pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be erased. - * The start address does not need to be sector-aligned but must be word-aligned. - * @param lengthInBytes The length, given in bytes (not words or long-words) - * to be erased. Must be word-aligned. - * @param key The value used to validate all flash erase APIs. - * - * @retval #kStatus_FTFx_Success API was executed successfully; the appropriate number of flash sectors based on the - * desired start address and length was erased successfully. - * - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_AlignmentError The parameter is not aligned with the specified baseline. - * @retval #kStatus_FTFx_AddressError The address is out of range. - * @retval #kStatus_FTFx_EraseKeyError The API erase key is invalid. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FTFx_ProtectionViolation The program/erase operation is requested to execute on protected areas. - * @retval #kStatus_FTFx_CommandFailure Run-time error during the command execution. - */ -status_t FLASH_Erase(flash_config_t *config, uint32_t start, uint32_t lengthInBytes, uint32_t key) -{ - status_t returnCode; - uint8_t flashIndex; - - /* check the supplied address range to get flash index */ - returnCode = flash_check_range_to_get_index(config, start, lengthInBytes, &flashIndex); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - - /* Decide whether to convert the start address from primary flash to secondary flash based on the current address */ - flash_convert_start_address(&config->ftfxConfig[flashIndex], start); - - return FTFx_CMD_Erase(&config->ftfxConfig[flashIndex], start, lengthInBytes, key); -} - -/*! - * @brief Erases the Dflash sectors encompassed by parameters passed into function. - * - * This function erases one flash sector size based on the start address, and it is - * executed asynchronously. - */ -status_t FLASH_EraseSectorNonBlocking(flash_config_t *config, uint32_t start, uint32_t key) -{ - status_t returnCode; - uint8_t flashIndex; - uint32_t lengthInBytes = FSL_FEATURE_FLASH_PFLASH_BLOCK_SECTOR_SIZE; - - /* check the supplied address range to get flash index */ - returnCode = flash_check_range_to_get_index(config, start, lengthInBytes, &flashIndex); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - - /* Decide whether to convert the start address from primary flash to secondary flash based on the current address */ - flash_convert_start_address(&config->ftfxConfig[flashIndex], start); - - return FTFx_CMD_EraseSectorNonBlocking(&config->ftfxConfig[flashIndex], start, key); -} - -/*! - * @brief Erases entire flexnvm - */ -status_t FLASH_EraseAll(flash_config_t *config, uint32_t key) -{ - return FTFx_CMD_EraseAll(&config->ftfxConfig[0], key); -} - -#if defined(FSL_FEATURE_FLASH_HAS_ERASE_ALL_BLOCKS_UNSECURE_CMD) && FSL_FEATURE_FLASH_HAS_ERASE_ALL_BLOCKS_UNSECURE_CMD -/*! - * @brief Erases the entire flexnvm, including protected sectors. - */ -status_t FLASH_EraseAllUnsecure(flash_config_t *config, uint32_t key) -{ - return FTFx_CMD_EraseAllUnsecure(&config->ftfxConfig[0], key); -} -#endif - -/*! - * @brief Programs flash with data at locations passed in through parameters. - * - * This function programs the flash memory with the desired data for a given - * flash area as determined by the start address and the length. - */ -status_t FLASH_Program(flash_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes) -{ - status_t returnCode; - uint8_t flashIndex; - - /* check range to get flash index */ - returnCode = flash_check_range_to_get_index(config, start, lengthInBytes, &flashIndex); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - /* convert the start address from primary flash to secondary flash based on the current address */ - flash_convert_start_address(&config->ftfxConfig[flashIndex], start); - - /* Programs flash */ - return FTFx_CMD_Program(&config->ftfxConfig[flashIndex], start, src, lengthInBytes); -} - -/*! - * @brief Reads the Program Once Field through parameters. - */ -status_t FLASH_ProgramOnce(flash_config_t *config, uint32_t index, uint8_t *src, uint32_t lengthInBytes) -{ - return FTFx_CMD_ProgramOnce(&config->ftfxConfig[0], index, src, lengthInBytes); -} - -#if defined(FSL_FEATURE_FLASH_HAS_PROGRAM_SECTION_CMD) && FSL_FEATURE_FLASH_HAS_PROGRAM_SECTION_CMD -/*! - * @brief Programs flash with data at locations passed in through parameters via the Program Section command. - * - * This function programs the flash memory with the desired data for a given - * flash area as determined by the start address and length. - * - */ -status_t FLASH_ProgramSection(flash_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes) -{ - status_t returnCode; - uint8_t flashIndex; - - /* Validates the range of the given address range and get flash index */ - returnCode = flash_check_range_to_get_index(config, start, lengthInBytes, &flashIndex); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - - /* convert the start address from primary flash to secondary flash based on the current address */ - flash_convert_start_address(&config->ftfxConfig[flashIndex], start); - - return FTFx_CMD_ProgramSection(&config->ftfxConfig[flashIndex], start, src, lengthInBytes); -} -#endif - -#if defined(FSL_FEATURE_FLASH_HAS_READ_RESOURCE_CMD) && FSL_FEATURE_FLASH_HAS_READ_RESOURCE_CMD -/*! - * @brief Reads the resource with data at locations passed in through parameters. - */ -status_t FLASH_ReadResource( - flash_config_t *config, uint32_t start, uint8_t *dst, uint32_t lengthInBytes, ftfx_read_resource_opt_t option) -{ - return FTFx_CMD_ReadResource(&config->ftfxConfig[0], start, dst, lengthInBytes, option); -} -#endif - -/*! - * @brief Reads the Program Once Field through parameters. - */ -status_t FLASH_ReadOnce(flash_config_t *config, uint32_t index, uint8_t *dst, uint32_t lengthInBytes) -{ - return FTFx_CMD_ReadOnce(&config->ftfxConfig[0], index, dst, lengthInBytes); -} - -/*! - * @brief Verifies an erasure of the desired flash area at a specified margin level. - * - * This function checks the appropriate number of flash sectors based on - * the desired start address and length to check whether the flash is erased - * to the specified read margin level. - */ -status_t FLASH_VerifyErase(flash_config_t *config, uint32_t start, uint32_t lengthInBytes, ftfx_margin_value_t margin) -{ - status_t returnCode; - uint8_t flashIndex; - - /* check range to get flash index */ - returnCode = flash_check_range_to_get_index(config, start, lengthInBytes, &flashIndex); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - - /* convert the start address from primary flash to secondary flash based on the current start address*/ - flash_convert_start_address(&config->ftfxConfig[flashIndex], start); - - return FTFx_CMD_VerifyErase(&config->ftfxConfig[flashIndex], start, lengthInBytes, margin); -} - -/*! - * @brief Verifies erasure of the entire flash at a specified margin level. - */ -status_t FLASH_VerifyEraseAll(flash_config_t *config, ftfx_margin_value_t margin) -{ - return FTFx_CMD_VerifyEraseAll(&config->ftfxConfig[0], margin); -} - -/*! - * @brief Verifies programming of the desired flash area at a specified margin level. - * - * This function verifies the data programmed in the flash memory using the - * Flash Program Check Command and compares it to the expected data for a given - * flash area as determined by the start address and length. - */ -status_t FLASH_VerifyProgram(flash_config_t *config, - uint32_t start, - uint32_t lengthInBytes, - const uint8_t *expectedData, - ftfx_margin_value_t margin, - uint32_t *failedAddress, - uint32_t *failedData) -{ - status_t returnCode; - uint8_t flashIndex; - - /* Validates the given address to get current flash index */ - returnCode = flash_check_range_to_get_index(config, start, lengthInBytes, &flashIndex); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - - /* convert the start address from primary flash to secondary flash based on the current start address */ - flash_convert_start_address(&config->ftfxConfig[flashIndex], start); - - return FTFx_CMD_VerifyProgram(&config->ftfxConfig[flashIndex], start, lengthInBytes, expectedData, margin, - failedAddress, failedData); -} - -/*! - * @brief Returns the security state via the pointer passed into the function. - */ -status_t FLASH_GetSecurityState(flash_config_t *config, ftfx_security_state_t *state) -{ - return FTFx_REG_GetSecurityState(&config->ftfxConfig[0], state); -} - -/*! - * @brief Allows users to bypass security with a backdoor key. - */ -status_t FLASH_SecurityBypass(flash_config_t *config, const uint8_t *backdoorKey) -{ - return FTFx_CMD_SecurityBypass(&config->ftfxConfig[0], backdoorKey); -} - -#if defined(FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD) && FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD -/*! - * @brief Sets the FlexRAM function command. - */ -status_t FLASH_SetFlexramFunction(flash_config_t *config, ftfx_flexram_func_opt_t option) -{ - return FTFx_CMD_SetFlexramFunction(&config->ftfxConfig[0], option); -} -#endif - -#if defined(FSL_FEATURE_FLASH_HAS_PFLASH_BLOCK_SWAP) && FSL_FEATURE_FLASH_HAS_PFLASH_BLOCK_SWAP -/*! - * @brief Swaps the lower half flash with the higher half flash. - */ -status_t FLASH_Swap(flash_config_t *config, uint32_t address, bool isSetEnable) -{ - status_t returnCode; - ftfx_swap_state_config_t returnInfo; - ftfx_config_t *ftfxConfig; - uint8_t flashIndex; - - returnCode = flash_check_range_to_get_index(config, address, 1U, &flashIndex); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - - ftfxConfig = &config->ftfxConfig[flashIndex]; - - (void)memset(&returnInfo, 0xFF, sizeof(returnInfo)); - - do - { - returnCode = FTFx_CMD_SwapControl(ftfxConfig, address, kFTFx_SwapControlOptionReportStatus, &returnInfo); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - - if (!isSetEnable) - { - if (returnInfo.flashSwapState == kFTFx_SwapStateDisabled) - { - return kStatus_FTFx_Success; - } - else if (returnInfo.flashSwapState == kFTFx_SwapStateUninitialized) - { - /* The swap system changed to the DISABLED state with Program flash block 0 - * located at relative flash address 0x0_0000 */ - returnCode = - FTFx_CMD_SwapControl(ftfxConfig, address, kFTFx_SwapControlOptionDisableSystem, &returnInfo); - } - else - { - /* Swap disable should be requested only when swap system is in the uninitialized state */ - return kStatus_FTFx_SwapSystemNotInUninitialized; - } - } - else - { - /* When first swap: the initial swap state is Uninitialized, flash swap indicator address is unset, - * the swap procedure should be Uninitialized -> Update-Erased -> Complete. - * After the first swap has been completed, the flash swap inidicator address cannot be modified - * unless EraseAllBlocks command is issued, the swap procedure is changed to Update -> Update-Erased -> - * Complete. */ - switch (returnInfo.flashSwapState) - { - case kFTFx_SwapStateUninitialized: - /* If current swap mode is Uninitialized, Initialize Swap to Initialized/READY state. */ - returnCode = - FTFx_CMD_SwapControl(ftfxConfig, address, kFTFx_SwapControlOptionIntializeSystem, &returnInfo); - break; - case kFTFx_SwapStateReady: - /* Validate whether the address provided to the swap system is matched to - * swap indicator address in the IFR */ - returnCode = flash_validate_swap_indicator_address(ftfxConfig, address); - if (returnCode == kStatus_FTFx_Success) - { - /* If current swap mode is Initialized/Ready, Initialize Swap to UPDATE state. */ - returnCode = FTFx_CMD_SwapControl(ftfxConfig, address, kFTFx_SwapControlOptionSetInUpdateState, - &returnInfo); - } - break; - case kFTFx_SwapStateUpdate: - /* If current swap mode is Update, Erase indicator sector in non active block - * to proceed swap system to update-erased state */ - returnCode = FLASH_Erase(config, address + (ftfxConfig->flashDesc.totalSize >> 1u), - ftfxConfig->opsConfig.addrAligment.sectorCmd, (uint32_t)kFTFx_ApiEraseKey); - break; - case kFTFx_SwapStateUpdateErased: - /* If current swap mode is Update or Update-Erased, progress Swap to COMPLETE State */ - returnCode = FTFx_CMD_SwapControl(ftfxConfig, address, kFTFx_SwapControlOptionSetInCompleteState, - &returnInfo); - break; - case kFTFx_SwapStateComplete: - break; - case kFTFx_SwapStateDisabled: - /* When swap system is in disabled state, We need to clear swap system back to uninitialized - * by issuing EraseAllBlocks command */ - returnCode = kStatus_FTFx_SwapSystemNotInUninitialized; - break; - default: - returnCode = kStatus_FTFx_InvalidArgument; - break; - } - } - if (returnCode != kStatus_FTFx_Success) - { - break; - } - } while (!((kFTFx_SwapStateComplete == returnInfo.flashSwapState) && isSetEnable)); - - return returnCode; -} -#endif /* FSL_FEATURE_FLASH_HAS_PFLASH_BLOCK_SWAP */ - -/*! - * @brief Returns the protection state of the desired flash area via the pointer passed into the function. - */ -status_t FLASH_IsProtected(flash_config_t *config, - uint32_t start, - uint32_t lengthInBytes, - flash_prot_state_t *protection_state) -{ - status_t returnCode; - ftfx_config_t *ftfxConfig; - uint8_t flashIndex; - - if (protection_state == NULL) - { - return kStatus_FTFx_InvalidArgument; - } - - returnCode = flash_check_range_to_get_index(config, start, lengthInBytes, &flashIndex); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - - ftfxConfig = &config->ftfxConfig[flashIndex]; - -#if (FTFx_FLASH_COUNT > 1U) - if (0U != (ftfxConfig->flashDesc.feature.hasProtControl)) -#endif - { - uint32_t endAddress; /* end address for protection check */ - uint32_t regionCheckedCounter; /* increments each time the flash address was checked for - * protection status */ - uint32_t regionCounter; /* incrementing variable used to increment through the flash - * protection regions */ - uint32_t protectStatusCounter; /* increments each time a flash region was detected as protected */ - uint8_t flashRegionProtectStatus[MAX_FLASH_PROT_REGION_COUNT]; /* array of the protection - * status for each - * protection region */ - for (uint32_t i = 0U; i < (uint32_t)MAX_FLASH_PROT_REGION_COUNT; - i++) /* The protection register is initialized to the */ - { /* unprotected state by default. */ - flashRegionProtectStatus[i] = (uint8_t)0xFF; /* The array is initialized to all 1 */ - } - - uint32_t - flashRegionAddress[MAX_FLASH_PROT_REGION_COUNT + 1U]; /* array of the start addresses for each flash - * protection region. Note this is REGION_COUNT+1 - * due to requiring the next start address after - * the end of flash for loop-check purposes below */ - bool isBreakNeeded = false; - /* Calculate Flash end address */ - endAddress = start + lengthInBytes; - - /* populate the flashRegionAddress array with the start address of each flash region */ - regionCounter = 0U; /* make sure regionCounter is initialized to 0 first */ - /* populate up to 33rd element of array, this is the next address after end of flash array */ - while (regionCounter <= ftfxConfig->flashDesc.protectRegionMem.count) - { - flashRegionAddress[regionCounter] = ftfxConfig->flashDesc.protectRegionMem.base + - ftfxConfig->flashDesc.protectRegionMem.size * regionCounter; - regionCounter++; - } - - /* populate flashRegionProtectStatus array with status information - * Protection status for each region is stored in the FPROT[3:0] registers - * Each bit represents one region of flash - * 4 registers * 8-bits-per-register = 32-bits (32-regions) - * The convention is: - * FPROT3[bit 0] is the first protection region (start of flash memory) - * FPROT0[bit 7] is the last protection region (end of flash memory) - * regionCounter is used to determine which FPROT[3:0] register to check for protection status - * Note: FPROT=1 means NOT protected, FPROT=0 means protected */ - regionCounter = 0U; /* make sure regionCounter is initialized to 0 first */ - static volatile uint32_t *const kFPROTLx = (volatile uint32_t *)(uint32_t)&FTFx_FPROTL3_REG; - -#if defined(FTFx_FLASH0_HAS_HIGH_PROT_REG) && FTFx_FLASH0_HAS_HIGH_PROT_REG - static volatile uint32_t *const kFPROTHx = (volatile uint32_t *)(uint32_t)&FTFx_FPROTH3_REG; -#endif - -#if defined(FTFx_FLASH1_HAS_INT_PROT_REG) && FTFx_FLASH1_HAS_INT_PROT_REG - static volatile uint16_t *const kFPROTSx = (volatile uint16_t *)(uint32_t)&FTFx_FPROTSL_REG; -#endif - while (regionCounter < ftfxConfig->flashDesc.protectRegionMem.count) - { -#if (FTFx_FLASH_COUNT > 1U) - if ((0U == ftfxConfig->flashDesc.index) || (0U != ftfxConfig->flashDesc.feature.hasIndProtReg)) -#endif - { -#if defined(MAX_FLASH_PROT_REGION_COUNT) && (MAX_FLASH_PROT_REGION_COUNT <= 32U) - if (regionCounter < (uint32_t)MAX_FLASH_PROT_REGION_COUNT) - { - flashRegionProtectStatus[regionCounter] = (uint8_t)(((kFPROTLx[0]) >> regionCounter) & 0x1U); - } -#else - if (regionCounter < 32u) - { - flashRegionProtectStatus[regionCounter] = (uint8_t)(((kFPROTLx[0]) >> regionCounter) & 0x1U); - } -#endif -#if defined(MAX_FLASH_PROT_REGION_COUNT) && (MAX_FLASH_PROT_REGION_COUNT == 64u) - else if (regionCounter < 64U) - { - flashRegionProtectStatus[regionCounter] = - (uint8_t)(((kFPROTHx[0]) >> (regionCounter - 32U)) & 0x1U); - } -#endif - else - { - isBreakNeeded = true; - } - regionCounter++; - } -#if defined(FTFx_FLASH1_HAS_INT_PROT_REG) && FTFx_FLASH1_HAS_INT_PROT_REG - else if ((1U == ftfxConfig->flashDesc.index) && (0U != ftfxConfig->flashDesc.feature.hasIndProtReg)) - { - /* Note: So far protection region count may be 8/16 */ - if (regionCounter < 16U) - { - flashRegionProtectStatus[regionCounter] = (uint8_t)((kFPROTSx[0] >> regionCounter) & (0x01u)); - } - else - { - isBreakNeeded = true; - } - regionCounter++; - } -#endif /* FTFx_FLASH1_HAS_INT_PROT_REG */ -#if (FTFx_FLASH_COUNT > 1U) - else - { - return kStatus_FTFx_InvalidArgument; - } -#endif - if (isBreakNeeded) - { - break; - } - } - - /* loop through the flash regions and check - * desired flash address range for protection status - * loop stops when it is detected that start has exceeded the endAddress */ - regionCounter = 0U; /* make sure regionCounter is initialized to 0 first */ - regionCheckedCounter = 0U; - protectStatusCounter = 0U; /* make sure protectStatusCounter is initialized to 0 first */ - while (start < endAddress) - { - /* check to see if the address falls within this protection region - * Note that if the entire flash is to be checked, the last protection - * region checked would consist of the last protection start address and - * the start address following the end of flash */ - if ((start >= flashRegionAddress[regionCounter]) && (start < flashRegionAddress[regionCounter + 1U])) - { - /* increment regionCheckedCounter to indicate this region was checked */ - regionCheckedCounter++; - - /* check the protection status of this region - * Note: FPROT=1 means NOT protected, FPROT=0 means protected */ - if (0U == flashRegionProtectStatus[regionCounter]) - { - /* increment protectStatusCounter to indicate this region is protected */ - protectStatusCounter++; - } - start += - ftfxConfig->flashDesc.protectRegionMem.size; /* increment to an address within the next region */ - } - regionCounter++; /* increment regionCounter to check for the next flash protection region */ - } - - /* if protectStatusCounter == 0, then no region of the desired flash region is protected */ - if (protectStatusCounter == 0U) - { - *protection_state = kFLASH_ProtectionStateUnprotected; - } - /* if protectStatusCounter == regionCheckedCounter, then each region checked was protected */ - else if (protectStatusCounter == regionCheckedCounter) - { - *protection_state = kFLASH_ProtectionStateProtected; - } - /* if protectStatusCounter != regionCheckedCounter, then protection status is mixed - * In other words, some regions are protected while others are unprotected */ - else - { - *protection_state = kFLASH_ProtectionStateMixed; - } - } -#if (FTFx_FLASH_COUNT > 1U) - else - { - *protection_state = kFLASH_ProtectionStateUnprotected; - } -#endif - - return kStatus_FTFx_Success; -} - -#if defined(FSL_FEATURE_FLASH_HAS_ACCESS_CONTROL) && FSL_FEATURE_FLASH_HAS_ACCESS_CONTROL -/*! - * @brief Returns the access state of the desired flash area via the pointer passed into the function. - * - * This function retrieves the current flash access status for a given - * flash area as determined by the start address and length. - */ -status_t FLASH_IsExecuteOnly(flash_config_t *config, - uint32_t start, - uint32_t lengthInBytes, - flash_xacc_state_t *access_state) -{ - status_t returnCode; - ftfx_config_t *ftfxConfig; - uint8_t flashIndex; - - if (access_state == NULL) - { - return kStatus_FTFx_InvalidArgument; - } - - returnCode = flash_check_range_to_get_index(config, start, lengthInBytes, &flashIndex); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - - ftfxConfig = &config->ftfxConfig[flashIndex]; - - /* store the execute only segment count */ - uint32_t executeOnlySegmentCounter = 0U; - - /* Calculate end address */ - uint32_t endAddress = start + lengthInBytes; - - /* Aligning start address and end address */ - uint32_t alignedStartAddress = ALIGN_DOWN(start, ftfxConfig->flashDesc.accessSegmentMem.size); - uint32_t alignedEndAddress = ALIGN_UP(endAddress, ftfxConfig->flashDesc.accessSegmentMem.size); - - uint32_t u32flag = 1U; - uint32_t segmentIndex = 0U; - - /* Calculate the execute only segment Count */ - uint32_t maxSupportedExecuteOnlySegmentCount = - (alignedEndAddress - alignedStartAddress) / ftfxConfig->flashDesc.accessSegmentMem.size; - - while (start < endAddress) - { - uint32_t xacc = 0U; - bool isInvalidSegmentIndex = false; - - /* Calculate which segmentIndex the address is in */ - segmentIndex = - (start - ftfxConfig->flashDesc.accessSegmentMem.base) / ftfxConfig->flashDesc.accessSegmentMem.size; - - if ((0U == ftfxConfig->flashDesc.index) || (0U != ftfxConfig->flashDesc.feature.hasIndXaccReg)) - { - /* For primary flash, The eight XACC registers allow up to 64 restricted segments of equal memory size. - */ - if (segmentIndex < 32U) - { - xacc = *(const volatile uint32_t *)(uint32_t)&FTFx_XACCL3_REG; - } - else if (segmentIndex < ftfxConfig->flashDesc.accessSegmentMem.count) - { - xacc = *(const volatile uint32_t *)(uint32_t)&FTFx_XACCH3_REG; - segmentIndex -= 32U; - } - else - { - isInvalidSegmentIndex = true; - } - } -#if defined(FTFx_FLASH1_HAS_INT_XACC_REG) && FTFx_FLASH1_HAS_INT_XACC_REG - else if ((ftfxConfig->flashDesc.index == 1U) && (0u != ftfxConfig->flashDesc.feature.hasIndXaccReg)) - { - /* For secondary flash, The two XACCS registers allow up to 16 restricted segments of equal memory size. - */ - if (segmentIndex < 8U) - { - xacc = *(const volatile uint8_t *)&FTFx_XACCSL_REG; - } - else if (segmentIndex < ftfxConfig->flashDesc.accessSegmentMem.count) - { - xacc = *(const volatile uint8_t *)&FTFx_XACCSH_REG; - segmentIndex -= 8U; - } - else - { - isInvalidSegmentIndex = true; - } - } -#endif - else - { - return kStatus_FTFx_InvalidArgument; - } - - if (isInvalidSegmentIndex) - { - break; - } - - /* Determine if this address range is in a execute-only protection flash segment. */ - if (0U != ((~xacc) & (u32flag << segmentIndex))) - { - executeOnlySegmentCounter++; - } - /* Calculate tne next start address */ - start += ftfxConfig->flashDesc.accessSegmentMem.size; - } - - if (executeOnlySegmentCounter < 1u) - { - *access_state = kFLASH_AccessStateUnLimited; - } - else if (executeOnlySegmentCounter < maxSupportedExecuteOnlySegmentCount) - { - *access_state = kFLASH_AccessStateMixed; - } - else - { - *access_state = kFLASH_AccessStateExecuteOnly; - } - - return kStatus_FTFx_Success; -} -#endif /* FSL_FEATURE_FLASH_HAS_ACCESS_CONTROL */ - -/*! - * @brief Sets the PFlash Protection to the intended protection status. - * - * @param config A pointer to storage for the driver runtime state. - * @param protectStatus The expected protect status to set to the PFlash protection register. Each bit is - * corresponding to protection of 1/32(64) of the total PFlash. The least significant bit is corresponding to the lowest - * address area of PFlash. The most significant bit is corresponding to the highest address area of PFlash. There are - * two possible cases as shown below: - * 0: this area is protected. - * 1: this area is unprotected. - * - * @retval #kStatus_FTFx_Success API was executed successfully. - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_CommandFailure Run-time error during command execution. - */ -status_t FLASH_PflashSetProtection(flash_config_t *config, pflash_prot_status_t *protectStatus) -{ - if ((config == NULL) || (protectStatus == NULL)) - { - return kStatus_FTFx_InvalidArgument; - } - - /* Most boards support program flash protect feature, The FPROT registers - * define which program flash regions are protected from program and erase operations. - * Protected flash regions cannot have their content changed; - * that is, these regions cannot be programmed and cannot be erased by any flash command - */ -#if (FTFx_FLASH_COUNT > 1U) - if (0U != (config->ftfxConfig[0].flashDesc.feature.hasProtControl)) -#endif - { - if (config->ftfxConfig[0].flashDesc.feature.ProtRegBits >= 32U) - { - /* set PFlash protection register, unprotected regions are marked with a 1 and - * setting PFlash protection register, unprotected regions are marked with a 1 and - * protected regions use a 0; each bit of FPROT register can only be changed from 1s to 0s - * while all bits with 0s to 1s transitions are ignored. - */ - *kFPROTL = protectStatus->protl; - if (protectStatus->protl != *kFPROTL) - { - return kStatus_FTFx_CommandFailure; - } - } -#if defined(FTFx_FLASH0_HAS_HIGH_PROT_REG) && FTFx_FLASH0_HAS_HIGH_PROT_REG - /* For primary flash with eight PROT registers allow up to 64 protected segments of equal memory size. */ - if (config->ftfxConfig[0].flashDesc.feature.ProtRegBits == 64U) - { - *kFPROTH = protectStatus->proth; - if (protectStatus->proth != *kFPROTH) - { - return kStatus_FTFx_CommandFailure; - } - } -#endif - } -#if defined(FTFx_FLASH1_HAS_INT_PROT_REG) && FTFx_FLASH1_HAS_INT_PROT_REG - else if ((0U != config->ftfxConfig[1].flashDesc.feature.hasProtControl) && - (0U != config->ftfxConfig[1].flashDesc.feature.hasIndProtReg)) - { - /* For secondary flash with two FPROT registers allow up to 16 protected segments of equal memory size. */ - if (config->ftfxConfig[1].flashDesc.feature.ProtRegBits == 16U) - { - *kFPROTSL = protectStatus->protsl; - if (protectStatus->protsl != *kFPROTSL) - { - return kStatus_FTFx_CommandFailure; - } - *kFPROTSH = protectStatus->protsh; - if (protectStatus->protsh != *kFPROTSH) - { - return kStatus_FTFx_CommandFailure; - } - } - } -#endif -#if (FTFx_FLASH_COUNT > 1U) - else - { - /*do nothing*/ - } -#endif - - return kStatus_FTFx_Success; -} - -/*! - * @brief Gets the PFlash protection status. - * - * @param config A pointer to the storage for the driver runtime state. - * @param protectStatus Protect status returned by the PFlash IP. Each bit is corresponding to the protection of - * 1/32(64) - * of the total PFlash. The least significant bit corresponds to the lowest address area of the PFlash. - * The most significant bit corresponds to the highest address area of PFlash. There are two possible cases as shown - * below: 0: this area is protected. 1: this area is unprotected. - * - * @retval #kStatus_FTFx_Success API was executed successfully. - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - */ -status_t FLASH_PflashGetProtection(flash_config_t *config, pflash_prot_status_t *protectStatus) -{ - if ((config == NULL) || (protectStatus == NULL)) - { - return kStatus_FTFx_InvalidArgument; - } - -#if (FTFx_FLASH_COUNT > 1U) - if (0U != (config->ftfxConfig[0].flashDesc.feature.hasProtControl)) -#endif - { - /* get the flash protect status */ - if (config->ftfxConfig[0].flashDesc.feature.ProtRegBits >= 32U) - { - protectStatus->protl = *kFPROTL; - } -#if defined(FTFx_FLASH0_HAS_HIGH_PROT_REG) && FTFx_FLASH0_HAS_HIGH_PROT_REG - /* For primary flash with eight PROT registers allow up to 64 protected segments of equal memory size. */ - if (config->ftfxConfig[0].flashDesc.feature.ProtRegBits == 64U) - { - protectStatus->proth = *kFPROTH; - } -#endif - } -#if defined(FTFx_FLASH1_HAS_INT_PROT_REG) && FTFx_FLASH1_HAS_INT_PROT_REG - /* For secondary flash with two FPROT registers allow up to 16 protected segments of equal memory size. */ - else if ((0U != config->ftfxConfig[1].flashDesc.feature.hasProtControl) && - (0U != config->ftfxConfig[1].flashDesc.feature.hasIndProtReg)) - { - if (config->ftfxConfig[0].flashDesc.feature.ProtRegBits == 16U) - { - protectStatus->protsl = *kFPROTSL; - protectStatus->protsh = *kFPROTSH; - } - } -#endif -#if (FTFx_FLASH_COUNT > 1U) - else - { - /*do nothing*/ - } -#endif - return kStatus_FTFx_Success; -} - -/*! - * @brief Returns the desired flash property. - * - * @param config A pointer to the storage for the driver runtime state. - * @param whichProperty The desired property from the list of properties in - * enum flash_property_tag_t - * @param value A pointer to the value returned for the desired flash property. - * - * @retval #kStatus_FTFx_Success API was executed successfully. - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_UnknownProperty An unknown property tag. - */ -status_t FLASH_GetProperty(flash_config_t *config, flash_property_tag_t whichProperty, uint32_t *value) -{ - if ((config == NULL) || (value == NULL)) - { - return kStatus_FTFx_InvalidArgument; - } - - status_t status = kStatus_FTFx_Success; - - switch (whichProperty) - { - /* gat Pflash0 sector size */ - case kFLASH_PropertyPflash0SectorSize: - *value = config->ftfxConfig[0].flashDesc.sectorSize; - break; - /* gat Pflash0 total size */ - case kFLASH_PropertyPflash0TotalSize: - *value = config->ftfxConfig[0].flashDesc.totalSize; - break; - /* gat Pflash0 block size */ - case kFLASH_PropertyPflash0BlockSize: - *value = config->ftfxConfig[0].flashDesc.totalSize / config->ftfxConfig[0].flashDesc.blockCount; - break; - /* gat Pflash0 block cont */ - case kFLASH_PropertyPflash0BlockCount: - *value = config->ftfxConfig[0].flashDesc.blockCount; - break; - /* gat Pflash0 block base address */ - case kFLASH_PropertyPflash0BlockBaseAddr: - *value = config->ftfxConfig[0].flashDesc.blockBase; - break; - /* gat Pflash0 fac support feature */ - case kFLASH_PropertyPflash0FacSupport: - *value = (uint32_t)config->ftfxConfig[0].flashDesc.feature.hasXaccControl; - break; - /* gat Pflash0 access segment size feature */ - case kFLASH_PropertyPflash0AccessSegmentSize: - *value = config->ftfxConfig[0].flashDesc.accessSegmentMem.size; - break; - /* gat Pflash0 access segment count feature */ - case kFLASH_PropertyPflash0AccessSegmentCount: - *value = config->ftfxConfig[0].flashDesc.accessSegmentMem.count; - break; - -#if defined(FTFx_DRIVER_HAS_FLASH1_SUPPORT) && FTFx_DRIVER_HAS_FLASH1_SUPPORT - case kFLASH_PropertyPflash1SectorSize: - *value = config->ftfxConfig[1].flashDesc.sectorSize; - break; - case kFLASH_PropertyPflash1TotalSize: - *value = config->ftfxConfig[1].flashDesc.totalSize; - break; - case kFLASH_PropertyPflash1BlockSize: - *value = config->ftfxConfig[1].flashDesc.totalSize / config->ftfxConfig[1].flashDesc.blockCount; - break; - case kFLASH_PropertyPflash1BlockCount: - *value = config->ftfxConfig[1].flashDesc.blockCount; - break; - case kFLASH_PropertyPflash1BlockBaseAddr: - *value = config->ftfxConfig[1].flashDesc.blockBase; - break; - case kFLASH_PropertyPflash1FacSupport: - *value = (uint32_t)config->ftfxConfig[1].flashDesc.feature.hasXaccControl; - break; - case kFLASH_PropertyPflash1AccessSegmentSize: - *value = config->ftfxConfig[1].flashDesc.accessSegmentMem.size; - break; - case kFLASH_PropertyPflash1AccessSegmentCount: - *value = config->ftfxConfig[1].flashDesc.accessSegmentMem.count; - break; -#endif - /* gat FlexRam block base addrese */ - case kFLASH_PropertyFlexRamBlockBaseAddr: - *value = config->ftfxConfig[0].flexramBlockBase; - break; - /* gat FlexRam total size */ - case kFLASH_PropertyFlexRamTotalSize: - *value = config->ftfxConfig[0].flexramTotalSize; - break; - - default: /* catch inputs that are not recognized */ - status = kStatus_FTFx_UnknownProperty; - break; - } - - return status; -} - -/*! - * @brief init flash FPROT, XACC registers and Independent flash block - */ -static void flash_init_features(ftfx_config_t *config) -{ - /* Initialize whether flash0 has independent block, protection registers and - * execute only access registers */ -#if (FTFx_FLASH_COUNT > 1U) - if (config->flashDesc.index == 0U) -#endif - { - config->flashDesc.feature.isIndBlock = 1U; - config->flashDesc.feature.hasIndPfsizeReg = 1U; - config->flashDesc.feature.hasIndProtReg = 1U; - config->flashDesc.feature.hasIndXaccReg = 1U; - } - /* if another flash exists */ -#if defined(FTFx_DRIVER_HAS_FLASH1_SUPPORT) && FTFx_DRIVER_HAS_FLASH1_SUPPORT - else if (config->flashDesc.index == 1U) - { - config->flashDesc.feature.isIndBlock = FTFx_FLASH1_IS_INDEPENDENT_BLOCK; - config->flashDesc.feature.hasIndPfsizeReg = config->flashDesc.feature.isIndBlock; - config->flashDesc.feature.hasIndProtReg = FTFx_FLASH1_HAS_INT_PROT_REG; - config->flashDesc.feature.hasIndXaccReg = FTFx_FLASH1_HAS_INT_XACC_REG; - } -#endif -#if (FTFx_FLASH_COUNT > 1U) - else - { - /*do nothing*/ - } -#endif - /* init protection Registers feature*/ - config->flashDesc.feature.hasProtControl = 1U; - /* init Execute-only Access Registers feature*/ - config->flashDesc.feature.hasXaccControl = FSL_FEATURE_FLASH_HAS_ACCESS_CONTROL; -} - -/*! - * @brief Initializes the flash operation config. - */ -static void flash_opsonfig_Init(flash_config_t *config, uint8_t flashIndex) -{ - uint32_t pflashStartAddress; - uint32_t pflashBlockSize; - uint32_t pflashBlockCount; - uint32_t pflashBlockSectorSize; - uint32_t pfsizeMask; - uint32_t pfsizeShift; - uint32_t pflashBlockWriteUnitSize; /* store P-Flash write unit size */ - uint32_t pflashSectorCmdAlignment; /* store P-Flash Erase sector command address alignment */ - uint32_t pflashSectionCmdAlignment; /* store Rrogram/Verify section command address alignment */ - -#if (FTFx_FLASH_COUNT > 1U) - if (flashIndex == 1U) - { - pflashStartAddress = FLASH1_FEATURE_PFLASH_START_ADDRESS; - pflashBlockSize = FLASH1_FEATURE_PFLASH_BLOCK_SIZE; - pflashBlockCount = FLASH1_FEATURE_PFLASH_BLOCK_COUNT; - pflashBlockSectorSize = FLASH1_FEATURE_PFLASH_BLOCK_SECTOR_SIZE; - pflashBlockWriteUnitSize = FLASH1_FEATURE_PFLASH_BLOCK_WRITE_UNIT_SIZE; - pflashSectorCmdAlignment = FLASH1_FEATURE_PFLASH_SECTOR_CMD_ADDRESS_ALIGMENT; - pflashSectionCmdAlignment = FLASH1_FEATURE_PFLASH_SECTION_CMD_ADDRESS_ALIGMENT; - pfsizeMask = SIM_FLASH1_PFSIZE_MASK; - pfsizeShift = SIM_FLASH1_PFSIZE_SHIFT; - } - else -#endif - { - pflashStartAddress = FLASH0_FEATURE_PFLASH_START_ADDRESS; /* get P-Flash start address */ - pflashBlockSize = FLASH0_FEATURE_PFLASH_BLOCK_SIZE; - pflashBlockCount = FLASH0_FEATURE_PFLASH_BLOCK_COUNT; - pflashBlockSectorSize = FLASH0_FEATURE_PFLASH_BLOCK_SECTOR_SIZE; - pflashBlockWriteUnitSize = FLASH0_FEATURE_PFLASH_BLOCK_WRITE_UNIT_SIZE; - pflashSectorCmdAlignment = FLASH0_FEATURE_PFLASH_SECTOR_CMD_ADDRESS_ALIGMENT; - pflashSectionCmdAlignment = FLASH0_FEATURE_PFLASH_SECTION_CMD_ADDRESS_ALIGMENT; - pfsizeMask = SIM_FLASH0_PFSIZE_MASK; - pfsizeShift = SIM_FLASH0_PFSIZE_SHIFT; - } - /* init current flash start address */ - config->ftfxConfig[flashIndex].flashDesc.blockBase = pflashStartAddress; - /* init current flash block count */ - config->ftfxConfig[flashIndex].flashDesc.blockCount = pflashBlockCount; - /* init current flash block sector size */ - config->ftfxConfig[flashIndex].flashDesc.sectorSize = pflashBlockSectorSize; - -#if (FTFx_FLASH_COUNT > 1U) - if ((0U != config->ftfxConfig[flashIndex].flashDesc.feature.isIndBlock) && - (0U != config->ftfxConfig[flashIndex].flashDesc.feature.hasIndPfsizeReg)) -#endif - { - /* Calculate flash memory size based on given parameter */ - config->ftfxConfig[flashIndex].flashDesc.totalSize = - flash_calculate_mem_size(pflashBlockCount, pflashBlockSize, pfsizeMask, pfsizeShift); - } -#if (FTFx_FLASH_COUNT > 1U) - else - { - config->ftfxConfig[flashIndex].flashDesc.totalSize = pflashBlockCount * pflashBlockSize; - } -#endif - - /* init P-Flash write unit size */ - config->ftfxConfig[flashIndex].opsConfig.addrAligment.blockWriteUnitSize = (uint8_t)pflashBlockWriteUnitSize; - /* init P-Flash Erase sector command address alignment */ - config->ftfxConfig[flashIndex].opsConfig.addrAligment.sectorCmd = (uint8_t)pflashSectorCmdAlignment; - /* init P-Flash Rrogram/Verify section command address alignment */ - config->ftfxConfig[flashIndex].opsConfig.addrAligment.sectionCmd = (uint8_t)pflashSectionCmdAlignment; - /* init P-Flash Read resource command address alignment. */ - config->ftfxConfig[flashIndex].opsConfig.addrAligment.resourceCmd = - (uint8_t)FSL_FEATURE_FLASH_PFLASH_RESOURCE_CMD_ADDRESS_ALIGMENT; - /* init P-Flash Program check command address alignment. */ - config->ftfxConfig[flashIndex].opsConfig.addrAligment.checkCmd = - (uint8_t)FSL_FEATURE_FLASH_PFLASH_CHECK_CMD_ADDRESS_ALIGMENT; - /* init P-Flash swap command address alignment */ - config->ftfxConfig[flashIndex].opsConfig.addrAligment.swapCtrlCmd = - (uint8_t)FSL_FEATURE_FLASH_PFLASH_SWAP_CONTROL_CMD_ADDRESS_ALIGMENT; -} - -#if defined(FSL_FEATURE_FLASH_HAS_ACCESS_CONTROL) && FSL_FEATURE_FLASH_HAS_ACCESS_CONTROL -/*! @brief init access segment feature */ -static void flash_access_init(flash_config_t *config, uint8_t flashIndex) -{ - ftfx_spec_mem_t *specMem; - - /* start to initialize the structure of access segment */ -#if defined(FTFx_FLASH1_HAS_INT_XACC_REG) && FTFx_FLASH1_HAS_INT_XACC_REG - specMem = &config->ftfxConfig[flashIndex].flashDesc.accessSegmentMem; - if (flashIndex == 1U) - { - specMem->base = config->ftfxConfig[flashIndex].flashDesc.blockBase; - specMem->size = (uint32_t)kFTFx_AccessSegmentUnitSize << FTFx_FACSSS_REG; - specMem->count = FTFx_FACSNS_REG; - } - else -#else - specMem = &config->ftfxConfig[0].flashDesc.accessSegmentMem; -#endif /* FTFx_FLASH1_HAS_INT_XACC_REG */ - { - specMem->base = config->ftfxConfig[0].flashDesc.blockBase; - specMem->size = (uint32_t)kFTFx_AccessSegmentUnitSize << FTFx_FACSS_REG; - specMem->count = FTFx_FACSN_REG; - } -} -#endif /* FSL_FEATURE_FLASH_HAS_ACCESS_CONTROL */ - -/*! @brief init protection feature */ -static void flash_protection_init(flash_config_t *config, uint8_t flashIndex) -{ - uint32_t pflashProtectionRegionCount; -#if (FTFx_FLASH_COUNT > 1U) - uint8_t i; - - if (flashIndex == 1U) - { - /* store flash0 Protection region count */ - pflashProtectionRegionCount = FLASH1_FEATURE_PFLASH_PROTECTION_REGION_COUNT; - } - else -#endif // #if (FTFx_FLASH_COUNT > 1U) - { - /* store flash0 Protection region count */ - pflashProtectionRegionCount = FLASH0_FEATURE_PFLASH_PROTECTION_REGION_COUNT; - } - - /* Start to initialize the structure of protection features */ - ftfx_spec_mem_t *specMem; - specMem = &config->ftfxConfig[flashIndex].flashDesc.protectRegionMem; -#if (FTFx_FLASH_COUNT > 1U) - if (0U != (config->ftfxConfig[flashIndex].flashDesc.feature.hasIndProtReg)) -#endif // #if (FTFx_FLASH_COUNT > 1U) - { - specMem->base = config->ftfxConfig[flashIndex].flashDesc.blockBase; - specMem->count = pflashProtectionRegionCount; - /* Calculate flash prot segment size */ - specMem->size = - flash_calculate_prot_segment_size(config->ftfxConfig[flashIndex].flashDesc.totalSize, specMem->count); - } -#if (FTFx_FLASH_COUNT > 1U) - else - { - uint32_t pflashTotalSize = 0U; - specMem->base = config->ftfxConfig[0].flashDesc.blockBase; - specMem->count = FLASH0_FEATURE_PFLASH_PROTECTION_REGION_COUNT; - if (flashIndex == FTFx_FLASH_COUNT - 1U) - { - uint32_t segmentSize; /* store the flash protection region count */ - for (i = 0U; i < FTFx_FLASH_COUNT; i++) - { - /* get pflash total size*/ - pflashTotalSize += config->ftfxConfig[flashIndex].flashDesc.totalSize; - } - /* get pflash port segment size based on parameters */ - segmentSize = flash_calculate_prot_segment_size(pflashTotalSize, specMem->count); - for (i = 0U; i < FTFx_FLASH_COUNT; i++) - { - /* init flash0 and flash1 port segment size */ - config->ftfxConfig[i].flashDesc.protectRegionMem.size = segmentSize; - } - } - } -#endif // #if (FTFx_FLASH_COUNT > 1U) -} - -/*! - * @brief Calculate flash memory size based on given parameter - */ -static uint32_t flash_calculate_mem_size(uint32_t pflashBlockCount, - uint32_t pflashBlockSize, - uint32_t pfsizeMask, - uint32_t pfsizeShift) -{ - uint8_t pfsize; - uint32_t flashDensity; - - /* PFSIZE=0xf means that on customer parts the IFR was not correctly programmed. - * We just use the pre-defined flash size in feature file here to support pre-production parts */ - pfsize = (uint8_t)((SIM_FCFG1_REG & pfsizeMask) >> pfsizeShift); - if (pfsize == 0xfU) - { - flashDensity = pflashBlockCount * pflashBlockSize; - } - else - { - flashDensity = ((uint32_t)kPFlashDensities[pfsize]) << 10U; - } - - return flashDensity; -} - -/*! - * @brief Calculate flash prot segment size - */ -static uint32_t flash_calculate_prot_segment_size(uint32_t flashSize, uint32_t segmentCount) -{ - uint32_t segmentSize; - - /* Calculate the size of the flash protection region - * If the flash density is > 32KB, then protection region is 1/32 of total flash density - * Else if flash density is < 32KB, then flash protection region is set to 1KB */ - if (flashSize > segmentCount * (uint32_t)kFTFx_MinProtectBlockSize) - { - segmentSize = flashSize / segmentCount; - } - else - { - segmentSize = (uint32_t)kFTFx_MinProtectBlockSize; - } - - return segmentSize; -} - -/*! - * @brief Validates the given start address and length to get flash index - */ -static status_t flash_check_range_to_get_index(flash_config_t *config, - uint32_t start, - uint32_t lengthInBytes, - uint8_t *flashIndex) -{ - if (config == NULL) - { - return kStatus_FTFx_InvalidArgument; - } - - /* Validates the range of the given address */ - for (uint8_t index = 0U; index < FTFx_FLASH_COUNT; index++) - { - if ((start >= config->ftfxConfig[index].flashDesc.blockBase) && - ((start + lengthInBytes) <= - (config->ftfxConfig[index].flashDesc.blockBase + config->ftfxConfig[index].flashDesc.totalSize))) - { - *flashIndex = config->ftfxConfig[index].flashDesc.index; - return kStatus_FTFx_Success; - } - } - - return kStatus_FTFx_AddressError; -} - -/*! - * @brief Decide whether to convert the start address from primary flash to secondary flash based on the current start - * address - */ -static void flash_convert_start_address(ftfx_config_t *config, uint32_t start) -{ - // The caller will guarantee that the config is valid -#if (FTFx_FLASH_COUNT > 1U) - if ((0U != config->flashDesc.index) && (0U != config->flashDesc.feature.isIndBlock)) - { - /* When required by the command, address bit 23 selects between main flash memory - * (=0) and secondary flash memory (=1).*/ - config->opsConfig.convertedAddress = start - config->flashDesc.blockBase + 0x800000U; - } - else -#endif - { - config->opsConfig.convertedAddress = start; - } -} - -#if defined(FSL_FEATURE_FLASH_HAS_PFLASH_BLOCK_SWAP) && FSL_FEATURE_FLASH_HAS_PFLASH_BLOCK_SWAP -/*! - * @brief Validates the given address to see if it is equal to swap indicator address in pflash swap IFR. - */ -static status_t flash_validate_swap_indicator_address(ftfx_config_t *config, uint32_t address) -{ - status_t returnCode; - struct _flash_swap_ifr_field_config - { - uint16_t swapIndicatorAddress; /*!< A Swap indicator address field.*/ - uint16_t swapEnableWord; /*!< A Swap enable word field.*/ - uint8_t reserved0[4]; /*!< A reserved field.*/ - uint8_t reserved1[2]; /*!< A reserved field.*/ - uint16_t swapDisableWord; /*!< A Swap disable word field.*/ - uint8_t reserved2[4]; /*!< A reserved field.*/ - } flashSwapIfrFieldData; - uint32_t swapIndicatorAddress; - -#if defined(FSL_FEATURE_FLASH_HAS_READ_RESOURCE_CMD) && FSL_FEATURE_FLASH_HAS_READ_RESOURCE_CMD - returnCode = - FTFx_CMD_ReadResource(config, config->ifrDesc.resRange.pflashSwapIfrStart, (uint8_t *)&flashSwapIfrFieldData, - sizeof(flashSwapIfrFieldData), kFTFx_ResourceOptionFlashIfr); - - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } -#else - { - /* From RM, the actual info are stored in FCCOB6,7 */ - uint32_t returnValue[2]; - returnCode = FTFx_CMD_ReadOnce(config, (uint32_t)kFLASH_RecordIndexSwapAddr, (uint8_t *)returnValue, 4U); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - flashSwapIfrFieldData.swapIndicatorAddress = (uint16_t)returnValue[0]; - returnCode = FTFx_CMD_ReadOnce(config, (uint32_t)kFLASH_RecordIndexSwapEnable, (uint8_t *)returnValue, 4U); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - - returnCode = FTFx_CMD_ReadOnce(config, (uint32_t)kFLASH_RecordIndexSwapDisable, (uint8_t *)returnValue, 4U); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - } -#endif - - /* The high bits value of Swap Indicator Address is stored in Program Flash Swap IFR Field, - * the low several bit value of Swap Indicator Address is always 1'b0 */ - swapIndicatorAddress = - (uint32_t)flashSwapIfrFieldData.swapIndicatorAddress * config->opsConfig.addrAligment.swapCtrlCmd; - if (address != swapIndicatorAddress) - { - return kStatus_FTFx_SwapIndicatorAddressError; - } - - return returnCode; -} -#endif /* FSL_FEATURE_FLASH_HAS_PFLASH_BLOCK_SWAP */ - -status_t FLASH_GetCommandState(void) -{ - uint8_t registerValue; - uint32_t idleFlag; - - /* Get flash status register value */ - registerValue = FTFx->FSTAT; - - /* Check DONE bit of the flash status register */ - idleFlag = ((uint32_t)registerValue & FTFx_FSTAT_CCIF_MASK) >> FTFx_FSTAT_CCIF_SHIFT; - if (idleFlag == 0U) - { - return kStatus_FTFx_CommandOperationInProgress; - } - else - { - /* Check error bits */ - /* checking access error */ - if (0U != (registerValue & FTFx_FSTAT_ACCERR_MASK)) - { - return kStatus_FTFx_AccessError; - } - /* checking protection error */ - else if (0U != (registerValue & FTFx_FSTAT_FPVIOL_MASK)) - { - return kStatus_FTFx_ProtectionViolation; - } - /* checking MGSTAT0 non-correctable error */ - else if (0U != (registerValue & FTFx_FSTAT_MGSTAT0_MASK)) - { - return kStatus_FTFx_CommandFailure; - } - else - { - return kStatus_FTFx_Success; - } - } -} diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_ftfx_flash.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_ftfx_flash.h deleted file mode 100644 index 8d5b92aa675..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_ftfx_flash.h +++ /dev/null @@ -1,705 +0,0 @@ -/* - * Copyright 2013-2016 Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - * - */ - -#ifndef FSL_FTFX_FLASH_H -#define FSL_FTFX_FLASH_H - -#include "fsl_ftfx_controller.h" - -/*! - * @addtogroup ftfx_flash_driver - * @{ - */ -/******************************************************************************* - * Definitions - ******************************************************************************/ -#define kStatus_FLASH_Success kStatus_FTFx_Success -#define kFLASH_ApiEraseKey kFTFx_ApiEraseKey - -/*! - * @name Flash version - * @{ - */ -/*! @brief Flash driver version for SDK*/ -#define FSL_FLASH_DRIVER_VERSION (MAKE_VERSION(3U, 1U, 3U)) /*!< Version 3.1.3. */ - -/*! @brief Flash driver version for ROM*/ -#define FSL_FLASH_DRIVER_VERSION_ROM (MAKE_VERSION(3U, 0U, 0U)) /*!< Version 3.0.0. */ - -/*! @} */ - -/*! - * @brief Enumeration for the three possible flash protection levels. - */ -typedef enum _flash_protection_state -{ - kFLASH_ProtectionStateUnprotected, /*!< Flash region is not protected.*/ - kFLASH_ProtectionStateProtected, /*!< Flash region is protected.*/ - kFLASH_ProtectionStateMixed /*!< Flash is mixed with protected and unprotected region.*/ -} flash_prot_state_t; - -/*! - * @brief PFlash protection status - */ -typedef union _pflash_protection_status -{ - uint32_t protl; /*!< PROT[31:0] .*/ - uint32_t proth; /*!< PROT[63:32].*/ - uint8_t protsl; /*!< PROTS[7:0] .*/ - uint8_t protsh; /*!< PROTS[15:8] .*/ - uint8_t reserved[2]; -} pflash_prot_status_t; - -#if defined(FSL_FEATURE_FLASH_HAS_ACCESS_CONTROL) && FSL_FEATURE_FLASH_HAS_ACCESS_CONTROL -/*! - * @brief Enumeration for the three possible flash execute access levels. - */ -typedef enum _flash_execute_only_access_state -{ - kFLASH_AccessStateUnLimited, /*!< Flash region is unlimited.*/ - kFLASH_AccessStateExecuteOnly, /*!< Flash region is execute only.*/ - kFLASH_AccessStateMixed /*!< Flash is mixed with unlimited and execute only region.*/ -} flash_xacc_state_t; -#endif /* not define FSL_FEATURE_FLASH_HAS_ACCESS_CONTROL */ - -/*! - * @brief Enumeration for various flash properties. - */ -typedef enum _flash_property_tag -{ - kFLASH_PropertyPflash0SectorSize = 0x00U, /*!< Pflash sector size property.*/ - kFLASH_PropertyPflash0TotalSize = 0x01U, /*!< Pflash total size property.*/ - kFLASH_PropertyPflash0BlockSize = 0x02U, /*!< Pflash block size property.*/ - kFLASH_PropertyPflash0BlockCount = 0x03U, /*!< Pflash block count property.*/ - kFLASH_PropertyPflash0BlockBaseAddr = 0x04U, /*!< Pflash block base address property.*/ - kFLASH_PropertyPflash0FacSupport = 0x05U, /*!< Pflash fac support property.*/ - kFLASH_PropertyPflash0AccessSegmentSize = 0x06U, /*!< Pflash access segment size property.*/ - kFLASH_PropertyPflash0AccessSegmentCount = 0x07U, /*!< Pflash access segment count property.*/ - - kFLASH_PropertyPflash1SectorSize = 0x10U, /*!< Pflash sector size property.*/ - kFLASH_PropertyPflash1TotalSize = 0x11U, /*!< Pflash total size property.*/ - kFLASH_PropertyPflash1BlockSize = 0x12U, /*!< Pflash block size property.*/ - kFLASH_PropertyPflash1BlockCount = 0x13U, /*!< Pflash block count property.*/ - kFLASH_PropertyPflash1BlockBaseAddr = 0x14U, /*!< Pflash block base address property.*/ - kFLASH_PropertyPflash1FacSupport = 0x15U, /*!< Pflash fac support property.*/ - kFLASH_PropertyPflash1AccessSegmentSize = 0x16U, /*!< Pflash access segment size property.*/ - kFLASH_PropertyPflash1AccessSegmentCount = 0x17U, /*!< Pflash access segment count property.*/ - - kFLASH_PropertyFlexRamBlockBaseAddr = 0x20U, /*!< FlexRam block base address property.*/ - kFLASH_PropertyFlexRamTotalSize = 0x21U, /*!< FlexRam total size property.*/ -} flash_property_tag_t; - -/*! @brief Flash driver state information. - * - * An instance of this structure is allocated by the user of the flash driver and - * passed into each of the driver APIs. - */ -typedef struct _flash_config -{ - ftfx_config_t ftfxConfig[FTFx_FLASH_COUNT]; -} flash_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization - * @{ - */ - -/*! - * @brief Initializes the global flash properties structure members. - * - * This function checks and initializes the Flash module for the other Flash APIs. - * - * @param config Pointer to the storage for the driver runtime state. - * - * @retval #kStatus_FTFx_Success API was executed successfully. - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_PartitionStatusUpdateFailure Failed to update the partition status. - */ -status_t FLASH_Init(flash_config_t *config); - -/*! @} */ - -/*! - * @name Erasing - * @{ - */ - -/*! - * @brief Erases the Dflash sectors encompassed by parameters passed into function. - * - * This function erases the appropriate number of flash sectors based on the - * desired start address and length. - * - * @param config The pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be erased. - * The start address does not need to be sector-aligned but must be word-aligned. - * @param lengthInBytes The length, given in bytes (not words or long-words) - * to be erased. Must be word-aligned. - * @param key The value used to validate all flash erase APIs. - * - * @retval #kStatus_FTFx_Success API was executed successfully; the appropriate number of flash sectors based on the - * desired start address and length were erased successfully. - * - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_AlignmentError The parameter is not aligned with the specified baseline. - * @retval #kStatus_FTFx_AddressError The address is out of range. - * @retval #kStatus_FTFx_EraseKeyError The API erase key is invalid. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FTFx_ProtectionViolation The program/erase operation is requested to execute on protected areas. - * @retval #kStatus_FTFx_CommandFailure Run-time error during the command execution. - */ -status_t FLASH_Erase(flash_config_t *config, uint32_t start, uint32_t lengthInBytes, uint32_t key); - -/*! - * @brief Erases the Dflash sectors encompassed by parameters passed into function. - * - * This function erases one flash sector size based on the start address, and it is - * executed asynchronously. - * - * NOTE: This function can only erase one flash sector at a time, and the other commands - * can be executed after the previous command has been completed. - * - * @param config The pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be erased. - * The start address does not need to be sector-aligned but must be word-aligned. - * @param key The value used to validate all flash erase APIs. - * - * @retval #kStatus_FTFx_Success API was executed successfully. - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_AlignmentError The parameter is not aligned with the specified baseline. - * @retval #kStatus_FTFx_AddressError The address is out of range. - * @retval #kStatus_FTFx_EraseKeyError The API erase key is invalid. - */ -status_t FLASH_EraseSectorNonBlocking(flash_config_t *config, uint32_t start, uint32_t key); - -/*! - * @brief Erases entire flexnvm - * - * @param config Pointer to the storage for the driver runtime state. - * @param key A value used to validate all flash erase APIs. - * - * @retval #kStatus_FTFx_Success API was executed successfully; the all pflash and flexnvm were erased successfully, - * the swap and eeprom have been reset to unconfigured state. - * - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_EraseKeyError API erase key is invalid. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FTFx_ProtectionViolation The program/erase operation is requested to execute on protected areas. - * @retval #kStatus_FTFx_CommandFailure Run-time error during command execution. - * @retval #kStatus_FTFx_PartitionStatusUpdateFailure Failed to update the partition status. - */ -status_t FLASH_EraseAll(flash_config_t *config, uint32_t key); - -#if defined(FSL_FEATURE_FLASH_HAS_ERASE_ALL_BLOCKS_UNSECURE_CMD) && FSL_FEATURE_FLASH_HAS_ERASE_ALL_BLOCKS_UNSECURE_CMD -/*! - * @brief Erases the entire flexnvm, including protected sectors. - * - * @param config Pointer to the storage for the driver runtime state. - * @param key A value used to validate all flash erase APIs. - * - * @retval #kStatus_FTFx_Success API was executed successfully; - * the protected sectors of flash were reset to unprotected status. - * - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_EraseKeyError API erase key is invalid. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FTFx_ProtectionViolation The program/erase operation is requested to execute on protected areas. - * @retval #kStatus_FTFx_CommandFailure Run-time error during command execution. - * @retval #kStatus_FTFx_PartitionStatusUpdateFailure Failed to update the partition status. - */ -status_t FLASH_EraseAllUnsecure(flash_config_t *config, uint32_t key); -#endif /* FSL_FEATURE_FLASH_HAS_ERASE_ALL_BLOCKS_UNSECURE_CMD */ - -/*! @} */ - -/*! - * @name Programming - * @{ - */ - -/*! - * @brief Programs flash with data at locations passed in through parameters. - * - * This function programs the flash memory with the desired data for a given - * flash area as determined by the start address and the length. - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be programmed. Must be - * word-aligned. - * @param src A pointer to the source buffer of data that is to be programmed - * into the flash. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be programmed. Must be word-aligned. - * - * @retval #kStatus_FTFx_Success API was executed successfully; the desired data were programed successfully - * into flash based on desired start address and length. - * - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_AlignmentError Parameter is not aligned with the specified baseline. - * @retval #kStatus_FTFx_AddressError Address is out of range. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FTFx_ProtectionViolation The program/erase operation is requested to execute on protected areas. - * @retval #kStatus_FTFx_CommandFailure Run-time error during the command execution. - */ -status_t FLASH_Program(flash_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes); - -/*! - * @brief Program the Program-Once-Field through parameters. - * - * This function Program the Program-once-feild with given index and length. - * - * @param config A pointer to the storage for the driver runtime state. - * @param index The index indicating the area of program once field to be read. - * @param src A pointer to the source buffer of data that is used to store - * data to be write. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be programmed. Must be word-aligned. - * - * @retval #kStatus_FTFx_Success API was executed successfully; The index indicating the area - * of program once field was programed successfully. - * - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FTFx_ProtectionViolation The program/erase operation is requested to execute on protected areas. - * @retval #kStatus_FTFx_CommandFailure Run-time error during the command execution. - */ -status_t FLASH_ProgramOnce(flash_config_t *config, uint32_t index, uint8_t *src, uint32_t lengthInBytes); - -#if defined(FSL_FEATURE_FLASH_HAS_PROGRAM_SECTION_CMD) && FSL_FEATURE_FLASH_HAS_PROGRAM_SECTION_CMD -/*! - * @brief Programs flash with data at locations passed in through parameters via the Program Section command. - * - * This function programs the flash memory with the desired data for a given - * flash area as determined by the start address and length. - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be programmed. Must be - * word-aligned. - * @param src A pointer to the source buffer of data that is to be programmed - * into the flash. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be programmed. Must be word-aligned. - * - * @retval #kStatus_FTFx_Success API was executed successfully; the desired data have been programed successfully into - * flash based on start address and length. - * - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_AlignmentError Parameter is not aligned with specified baseline. - * @retval #kStatus_FTFx_AddressError Address is out of range. - * @retval #kStatus_FTFx_SetFlexramAsRamError Failed to set flexram as RAM. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FTFx_ProtectionViolation The program/erase operation is requested to execute on protected areas. - * @retval #kStatus_FTFx_CommandFailure Run-time error during command execution. - * @retval #kStatus_FTFx_RecoverFlexramAsEepromError Failed to recover FlexRAM as EEPROM. - */ -status_t FLASH_ProgramSection(flash_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes); -#endif /* FSL_FEATURE_FLASH_HAS_PROGRAM_SECTION_CMD */ - -/*! @} */ - -/*! - * @name Reading - * @{ - */ - -#if defined(FSL_FEATURE_FLASH_HAS_READ_RESOURCE_CMD) && FSL_FEATURE_FLASH_HAS_READ_RESOURCE_CMD -/*! - * @brief Reads the resource with data at locations passed in through parameters. - * - * This function reads the flash memory with the desired location for a given - * flash area as determined by the start address and length. - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be programmed. Must be - * word-aligned. - * @param dst A pointer to the destination buffer of data that is used to store - * data to be read. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be read. Must be word-aligned. - * @param option The resource option which indicates which area should be read back. - * - * @retval #kStatus_FTFx_Success API was executed successfully; the data have been read successfully from - * program flash IFR, data flash IFR space, and the Version ID field. - * - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_AlignmentError Parameter is not aligned with the specified baseline. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FTFx_ProtectionViolation The program/erase operation is requested to execute on protected areas. - * @retval #kStatus_FTFx_CommandFailure Run-time error during the command execution. - */ -status_t FLASH_ReadResource( - flash_config_t *config, uint32_t start, uint8_t *dst, uint32_t lengthInBytes, ftfx_read_resource_opt_t option); -#endif /* FSL_FEATURE_FLASH_HAS_READ_RESOURCE_CMD */ - -/*! - * @brief Reads the Program Once Field through parameters. - * - * This function reads the read once feild with given index and length. - * - * @param config A pointer to the storage for the driver runtime state. - * @param index The index indicating the area of program once field to be read. - * @param dst A pointer to the destination buffer of data that is used to store - * data to be read. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be programmed. Must be word-aligned. - * - * @retval #kStatus_FTFx_Success API was executed successfully; the data have been successfuly - * read form Program flash0 IFR map and Program Once field based on index and length. - - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FTFx_ProtectionViolation The program/erase operation is requested to execute on protected areas. - * @retval #kStatus_FTFx_CommandFailure Run-time error during the command execution. - */ -status_t FLASH_ReadOnce(flash_config_t *config, uint32_t index, uint8_t *dst, uint32_t lengthInBytes); - -/*! @} */ - -/*! - * @name Verification - * @{ - */ - -/*! - * @brief Verifies an erasure of the desired flash area at a specified margin level. - * - * This function checks the appropriate number of flash sectors based on - * the desired start address and length to check whether the flash is erased - * to the specified read margin level. - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be verified. - * The start address does not need to be sector-aligned but must be word-aligned. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be verified. Must be word-aligned. - * @param margin Read margin choice. - * - * @retval #kStatus_FTFx_Success API was executed successfully; the specified FLASH region has been erased. - * - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_AlignmentError Parameter is not aligned with specified baseline. - * @retval #kStatus_FTFx_AddressError Address is out of range. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FTFx_ProtectionViolation The program/erase operation is requested to execute on protected areas. - * @retval #kStatus_FTFx_CommandFailure Run-time error during the command execution. - */ -status_t FLASH_VerifyErase(flash_config_t *config, uint32_t start, uint32_t lengthInBytes, ftfx_margin_value_t margin); - -/*! - * @brief Verifies erasure of the entire flash at a specified margin level. - * - * This function checks whether the flash is erased to the - * specified read margin level. - * - * @param config A pointer to the storage for the driver runtime state. - * @param margin Read margin choice. - * - * @retval #kStatus_FTFx_Success API was executed successfully; all program flash and flexnvm were in erased state. - * - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FTFx_ProtectionViolation The program/erase operation is requested to execute on protected areas. - * @retval #kStatus_FTFx_CommandFailure Run-time error during the command execution. - */ -status_t FLASH_VerifyEraseAll(flash_config_t *config, ftfx_margin_value_t margin); - -/*! - * @brief Verifies programming of the desired flash area at a specified margin level. - * - * This function verifies the data programmed in the flash memory using the - * Flash Program Check Command and compares it to the expected data for a given - * flash area as determined by the start address and length. - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be verified. Must be word-aligned. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be verified. Must be word-aligned. - * @param expectedData A pointer to the expected data that is to be - * verified against. - * @param margin Read margin choice. - * @param failedAddress A pointer to the returned failing address. - * @param failedData A pointer to the returned failing data. Some derivatives do - * not include failed data as part of the FCCOBx registers. In this - * case, zeros are returned upon failure. - * - * @retval #kStatus_FTFx_Success API was executed successfully; the desired data have been successfully programed into - * specified FLASH region. - * - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_AlignmentError Parameter is not aligned with specified baseline. - * @retval #kStatus_FTFx_AddressError Address is out of range. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FTFx_ProtectionViolation The program/erase operation is requested to execute on protected areas. - * @retval #kStatus_FTFx_CommandFailure Run-time error during the command execution. - */ -status_t FLASH_VerifyProgram(flash_config_t *config, - uint32_t start, - uint32_t lengthInBytes, - const uint8_t *expectedData, - ftfx_margin_value_t margin, - uint32_t *failedAddress, - uint32_t *failedData); - -/*! @} */ - -/*! - * @name Security - * @{ - */ - -/*! - * @brief Returns the security state via the pointer passed into the function. - * - * This function retrieves the current flash security status, including the - * security enabling state and the backdoor key enabling state. - * - * @param config A pointer to storage for the driver runtime state. - * @param state A pointer to the value returned for the current security status code: - * - * @retval #kStatus_FTFx_Success API was executed successfully; the security state of flash was stored to state. - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - */ -status_t FLASH_GetSecurityState(flash_config_t *config, ftfx_security_state_t *state); - -/*! - * @brief Allows users to bypass security with a backdoor key. - * - * If the MCU is in secured state, this function unsecures the MCU by - * comparing the provided backdoor key with ones in the flash configuration - * field. - * - * @param config A pointer to the storage for the driver runtime state. - * @param backdoorKey A pointer to the user buffer containing the backdoor key. - * - * @retval #kStatus_FTFx_Success API was executed successfully. - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FTFx_ProtectionViolation The program/erase operation is requested to execute on protected areas. - * @retval #kStatus_FTFx_CommandFailure Run-time error during the command execution. - */ -status_t FLASH_SecurityBypass(flash_config_t *config, const uint8_t *backdoorKey); - -/*! @} */ - -/*! - * @name FlexRAM - * @{ - */ - -#if defined(FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD) && FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD -/*! - * @brief Sets the FlexRAM function command. - * - * @param config A pointer to the storage for the driver runtime state. - * @param option The option used to set the work mode of FlexRAM. - * - * @retval #kStatus_FTFx_Success API was executed successfully; the FlexRAM has been successfully configured as RAM or - * EEPROM. - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FTFx_ProtectionViolation The program/erase operation is requested to execute on protected areas. - * @retval #kStatus_FTFx_CommandFailure Run-time error during the command execution. - */ -status_t FLASH_SetFlexramFunction(flash_config_t *config, ftfx_flexram_func_opt_t option); -#endif /* FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD */ - -/*! @} */ - -/*! - * @name Swap - * @{ - */ - -#if defined(FSL_FEATURE_FLASH_HAS_PFLASH_BLOCK_SWAP) && FSL_FEATURE_FLASH_HAS_PFLASH_BLOCK_SWAP -/*! - * @brief Swaps the lower half flash with the higher half flash. - * - * @param config A pointer to the storage for the driver runtime state. - * @param address Address used to configure the flash swap function - * @param isSetEnable The possible option used to configure the Flash Swap function or check the flash Swap status. - * - * @retval #kStatus_FTFx_Success API was executed successfully; the lower half flash and higher half flash have been - * swaped. - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_AlignmentError Parameter is not aligned with specified baseline. - * @retval #kStatus_FTFx_SwapIndicatorAddressError Swap indicator address is invalid. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FTFx_ProtectionViolation The program/erase operation is requested to execute on protected areas. - * @retval #kStatus_FTFx_CommandFailure Run-time error during command execution. - * @retval #kStatus_FTFx_SwapSystemNotInUninitialized Swap system is not in an uninitialized state. - */ -status_t FLASH_Swap(flash_config_t *config, uint32_t address, bool isSetEnable); -#endif /* FSL_FEATURE_FLASH_HAS_PFLASH_BLOCK_SWAP */ - -/*! @} */ - -/*! - * @name Protection - * @{ - */ - -/*! - * @brief Returns the protection state of the desired flash area via the pointer passed into the function. - * - * This function retrieves the current flash protect status for a given - * flash area as determined by the start address and length. - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be checked. Must be word-aligned. - * @param lengthInBytes The length, given in bytes (not words or long-words) - * to be checked. Must be word-aligned. - * @param protection_state A pointer to the value returned for the current - * protection status code for the desired flash area. - * - * @retval #kStatus_FTFx_Success API was executed successfully; the protection state of specified FLASH region was - * stored to protection_state. - * - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_AlignmentError Parameter is not aligned with specified baseline. - * @retval #kStatus_FTFx_AddressError The address is out of range. - */ -status_t FLASH_IsProtected(flash_config_t *config, - uint32_t start, - uint32_t lengthInBytes, - flash_prot_state_t *protection_state); - -#if defined(FSL_FEATURE_FLASH_HAS_ACCESS_CONTROL) && FSL_FEATURE_FLASH_HAS_ACCESS_CONTROL -/*! - * @brief Returns the access state of the desired flash area via the pointer passed into the function. - * - * This function retrieves the current flash access status for a given - * flash area as determined by the start address and length. - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be checked. Must be word-aligned. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be checked. Must be word-aligned. - * @param access_state A pointer to the value returned for the current - * access status code for the desired flash area. - * - * @retval #kStatus_FTFx_Success API was executed successfully; the executeOnly state of specified FLASH region was - * stored to access_state. - * - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_AlignmentError The parameter is not aligned to the specified baseline. - * @retval #kStatus_FTFx_AddressError The address is out of range. - */ -status_t FLASH_IsExecuteOnly(flash_config_t *config, - uint32_t start, - uint32_t lengthInBytes, - flash_xacc_state_t *access_state); -#endif /* FSL_FEATURE_FLASH_HAS_ACCESS_CONTROL */ - -/*! - * @brief Sets the PFlash Protection to the intended protection status. - * - * @param config A pointer to storage for the driver runtime state. - * @param protectStatus The expected protect status to set to the PFlash protection register. Each bit is - * corresponding to protection of 1/32(64) of the total PFlash. The least significant bit is corresponding to the lowest - * address area of PFlash. The most significant bit is corresponding to the highest address area of PFlash. There are - * two possible cases as shown below: - * 0: this area is protected. - * 1: this area is unprotected. - * - * @retval #kStatus_FTFx_Success API was executed successfully; the specified FLASH region is protected. - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_CommandFailure Run-time error during command execution. - */ -status_t FLASH_PflashSetProtection(flash_config_t *config, pflash_prot_status_t *protectStatus); - -/*! - * @brief Gets the PFlash protection status. - * - * @param config A pointer to the storage for the driver runtime state. - * @param protectStatus Protect status returned by the PFlash IP. Each bit is corresponding to the protection of - * 1/32(64) - * of the - * total PFlash. The least significant bit corresponds to the lowest address area of the PFlash. The most significant - * bit corresponds to the highest address area of PFlash. There are two possible cases as shown below: - * 0: this area is protected. - * 1: this area is unprotected. - * - * @retval #kStatus_FTFx_Success API was executed successfully; the Protection state was stored to protectStatus; - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - */ -status_t FLASH_PflashGetProtection(flash_config_t *config, pflash_prot_status_t *protectStatus); - -/*! @} */ - -/*! - * @name Properties - * @{ - */ - -/*! - * @brief Returns the desired flash property. - * - * @param config A pointer to the storage for the driver runtime state. - * @param whichProperty The desired property from the list of properties in - * enum flash_property_tag_t - * @param value A pointer to the value returned for the desired flash property. - * - * @retval #kStatus_FTFx_Success API was executed successfully; the flash property was stored to value. - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_UnknownProperty An unknown property tag. - */ -status_t FLASH_GetProperty(flash_config_t *config, flash_property_tag_t whichProperty, uint32_t *value); - -/*! @} */ - -/*! - * @name commantStatus - * @{ - */ - -/*! - * @brief Get previous command status. - * - * This function is used to obtain the execution status of the previous command. - * - * @retval #kStatus_FTFx_Success The previous command is executed successfully. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FTFx_ProtectionViolation The program/erase operation is requested to execute on protected areas. - * @retval #kStatus_FTFx_CommandFailure Run-time error during the command execution. - */ -status_t FLASH_GetCommandState(void); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_FTFX_FLASH_H */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_ftfx_flexnvm.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_ftfx_flexnvm.c deleted file mode 100644 index d8b2743f47b..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_ftfx_flexnvm.c +++ /dev/null @@ -1,511 +0,0 @@ -/* - * Copyright 2013-2016 Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - * - */ - -#include "fsl_ftfx_flexnvm.h" - -#if FSL_FEATURE_FLASH_HAS_FLEX_NVM - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flash" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! @brief Convert address for Flexnvm dflash.*/ -static status_t flexnvm_convert_start_address(flexnvm_config_t *config, uint32_t start); - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -status_t FLEXNVM_Init(flexnvm_config_t *config) -{ - status_t returnCode; - - if (config == NULL) - { - return kStatus_FTFx_InvalidArgument; - } - - config->ftfxConfig.flashDesc.type = (uint8_t)kFTFx_MemTypeFlexnvm; - config->ftfxConfig.flashDesc.index = 0U; - - /* Set Flexnvm memory operation parameters */ - config->ftfxConfig.opsConfig.addrAligment.blockWriteUnitSize = FSL_FEATURE_FLASH_FLEX_NVM_BLOCK_WRITE_UNIT_SIZE; - config->ftfxConfig.opsConfig.addrAligment.sectorCmd = FSL_FEATURE_FLASH_FLEX_NVM_SECTOR_CMD_ADDRESS_ALIGMENT; - config->ftfxConfig.opsConfig.addrAligment.sectionCmd = FSL_FEATURE_FLASH_FLEX_NVM_SECTION_CMD_ADDRESS_ALIGMENT; - config->ftfxConfig.opsConfig.addrAligment.resourceCmd = FSL_FEATURE_FLASH_FLEX_NVM_RESOURCE_CMD_ADDRESS_ALIGMENT; - config->ftfxConfig.opsConfig.addrAligment.checkCmd = FSL_FEATURE_FLASH_FLEX_NVM_CHECK_CMD_ADDRESS_ALIGMENT; - - /* Set Flexnvm memory properties */ - config->ftfxConfig.flashDesc.blockBase = FSL_FEATURE_FLASH_FLEX_NVM_START_ADDRESS; -#if defined(FSL_FEATURE_FLASH_HAS_FLEX_NVM_ALIAS) && FSL_FEATURE_FLASH_HAS_FLEX_NVM_ALIAS - config->ftfxConfig.flashDesc.aliasBlockBase = FSL_FEATURE_FLASH_FLEX_NVM_ALIAS_START_ADDRESS; -#endif - config->ftfxConfig.flashDesc.sectorSize = FSL_FEATURE_FLASH_FLEX_NVM_BLOCK_SECTOR_SIZE; - config->ftfxConfig.flashDesc.blockCount = FSL_FEATURE_FLASH_FLEX_NVM_BLOCK_COUNT; - - /* Init FTFx Kernel */ - FTFx_API_Init(&config->ftfxConfig); - - returnCode = FTFx_API_UpdateFlexnvmPartitionStatus(&config->ftfxConfig); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - - return kStatus_FTFx_Success; -} - -/*! - * @brief Erases the Dflash sectors encompassed by parameters passed into function. - */ -status_t FLEXNVM_DflashErase(flexnvm_config_t *config, uint32_t start, uint32_t lengthInBytes, uint32_t key) -{ - status_t returnCode; - returnCode = flexnvm_convert_start_address(config, start); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - - return FTFx_CMD_Erase(&config->ftfxConfig, start, lengthInBytes, key); -} - -/*! - * @brief Erases entire flexnvm - */ -status_t FLEXNVM_EraseAll(flexnvm_config_t *config, uint32_t key) -{ - return FTFx_CMD_EraseAll(&config->ftfxConfig, key); -} - -#if defined(FSL_FEATURE_FLASH_HAS_ERASE_ALL_BLOCKS_UNSECURE_CMD) && FSL_FEATURE_FLASH_HAS_ERASE_ALL_BLOCKS_UNSECURE_CMD -/*! - * @brief Erases the entire flexnvm, including protected sectors. - */ -status_t FLEXNVM_EraseAllUnsecure(flexnvm_config_t *config, uint32_t key) -{ - return FTFx_CMD_EraseAllUnsecure(&config->ftfxConfig, key); -} -#endif /* FSL_FEATURE_FLASH_HAS_ERASE_ALL_BLOCKS_UNSECURE_CMD */ - -/*! - * @brief Programs flash with data at locations passed in through parameters. - */ -status_t FLEXNVM_DflashProgram(flexnvm_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes) -{ - status_t returnCode; - returnCode = flexnvm_convert_start_address(config, start); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - - return FTFx_CMD_Program(&config->ftfxConfig, start, src, lengthInBytes); -} - -#if defined(FSL_FEATURE_FLASH_HAS_PROGRAM_SECTION_CMD) && FSL_FEATURE_FLASH_HAS_PROGRAM_SECTION_CMD -/*! - * @brief Programs flash with data at locations passed in through parameters via the Program Section command. - */ -status_t FLEXNVM_DflashProgramSection(flexnvm_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes) -{ - status_t returnCode; - /* Convert address for Flexnvm dflash */ - returnCode = flexnvm_convert_start_address(config, start); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - - return FTFx_CMD_ProgramSection(&config->ftfxConfig, start, src, lengthInBytes); -} -#endif /* FSL_FEATURE_FLASH_HAS_PROGRAM_SECTION_CMD */ - -/*! - * @brief Prepares the FlexNVM block for use as data flash, EEPROM backup, or a combination - * of both and initializes the FlexRAM. - */ -status_t FLEXNVM_ProgramPartition(flexnvm_config_t *config, - ftfx_partition_flexram_load_opt_t option, - uint32_t eepromDataSizeCode, - uint32_t flexnvmPartitionCode) -{ - return FTFx_CMD_ProgramPartition(&config->ftfxConfig, option, eepromDataSizeCode, flexnvmPartitionCode); -} - -#if defined(FSL_FEATURE_FLASH_HAS_READ_RESOURCE_CMD) && FSL_FEATURE_FLASH_HAS_READ_RESOURCE_CMD -/*! - * @brief Reads the resource with data at locations passed in through parameters. - */ -status_t FLEXNVM_ReadResource( - flexnvm_config_t *config, uint32_t start, uint8_t *dst, uint32_t lengthInBytes, ftfx_read_resource_opt_t option) -{ - return FTFx_CMD_ReadResource(&config->ftfxConfig, start, dst, lengthInBytes, option); -} -#endif /* FSL_FEATURE_FLASH_HAS_READ_RESOURCE_CMD */ - -/*! - * @brief Verifies an erasure of the desired flash area at a specified margin level. - */ -status_t FLEXNVM_DflashVerifyErase(flexnvm_config_t *config, - uint32_t start, - uint32_t lengthInBytes, - ftfx_margin_value_t margin) -{ - status_t returnCode; - returnCode = flexnvm_convert_start_address(config, start); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - - return FTFx_CMD_VerifyErase(&config->ftfxConfig, start, lengthInBytes, margin); -} - -/*! - * @brief Verifies erasure of the entire flash at a specified margin level. - */ -status_t FLEXNVM_VerifyEraseAll(flexnvm_config_t *config, ftfx_margin_value_t margin) -{ - return FTFx_CMD_VerifyEraseAll(&config->ftfxConfig, margin); -} - -/*! - * @brief Verifies programming of the desired flash area at a specified margin level. - */ -status_t FLEXNVM_DflashVerifyProgram(flexnvm_config_t *config, - uint32_t start, - uint32_t lengthInBytes, - const uint8_t *expectedData, - ftfx_margin_value_t margin, - uint32_t *failedAddress, - uint32_t *failedData) -{ - status_t returnCode; - returnCode = flexnvm_convert_start_address(config, start); - if (returnCode != kStatus_FTFx_Success) - { - return returnCode; - } - - return FTFx_CMD_VerifyProgram(&config->ftfxConfig, start, lengthInBytes, expectedData, margin, failedAddress, - failedData); -} - -/*! - * @brief Returns the security state via the pointer passed into the function. - */ -status_t FLEXNVM_GetSecurityState(flexnvm_config_t *config, ftfx_security_state_t *state) -{ - return FTFx_REG_GetSecurityState(&config->ftfxConfig, state); -} - -/*! - * @brief Allows users to bypass security with a backdoor key. - */ -status_t FLEXNVM_SecurityBypass(flexnvm_config_t *config, const uint8_t *backdoorKey) -{ - return FTFx_CMD_SecurityBypass(&config->ftfxConfig, backdoorKey); -} - -#if defined(FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD) && FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD -/*! - * @brief Sets the FlexRAM function command. - */ -status_t FLEXNVM_SetFlexramFunction(flexnvm_config_t *config, ftfx_flexram_func_opt_t option) -{ - return FTFx_CMD_SetFlexramFunction(&config->ftfxConfig, option); -} -#endif /* FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD */ - -/*! - * @brief Programs the EEPROM with data at locations passed in through parameters. - */ -status_t FLEXNVM_EepromWrite(flexnvm_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes) -{ - status_t returnCode; - bool needSwitchFlexRamMode = false; - - if (config == NULL) - { - return kStatus_FTFx_InvalidArgument; - } - - /* Validates the range of the given address */ - if ((start < config->ftfxConfig.flexramBlockBase) || - ((start + lengthInBytes) > (config->ftfxConfig.flexramBlockBase + config->ftfxConfig.eepromTotalSize))) - { - return kStatus_FTFx_AddressError; - } - - returnCode = kStatus_FTFx_Success; - - /* Switch function of FlexRAM if needed */ - if (0U == (FTFx->FCNFG & FTFx_FCNFG_EEERDY_MASK)) - { - needSwitchFlexRamMode = true; - - returnCode = FTFx_CMD_SetFlexramFunction(&config->ftfxConfig, kFTFx_FlexramFuncOptAvailableForEeprom); - if (returnCode != kStatus_FTFx_Success) - { - return kStatus_FTFx_SetFlexramAsEepromError; - } - } - - /* Write data to FlexRAM when it is used as EEPROM emulator */ - while (lengthInBytes > 0U) - { - if ((0U == (start & 0x3U)) && (0U == ((uint32_t)src & 0x3U)) && (lengthInBytes >= 4U)) - { - *(uint32_t *)start = *(uint32_t *)(uint32_t)src; - start += 4U; - src = &src[4]; - lengthInBytes -= 4U; - } - else if ((0U == (start & 0x1U)) && (0U == ((uint32_t)src & 0x1U)) && (lengthInBytes >= 2U)) - { - *(uint16_t *)start = *(uint16_t *)(uint32_t)src; - start += 2U; - src = &src[2]; - lengthInBytes -= 2U; - } - else - { - *(uint8_t *)start = *src; - start += 1U; - src = &src[1]; - lengthInBytes -= 1U; - } - /* Wait till EEERDY bit is set */ - while (0U == (FTFx->FCNFG & FTFx_FCNFG_EEERDY_MASK)) - { - } - - /* Check for protection violation error */ - if (0U != (FTFx->FSTAT & FTFx_FSTAT_FPVIOL_MASK)) - { - return kStatus_FTFx_ProtectionViolation; - } - } - - /* Switch function of FlexRAM if needed */ - if (needSwitchFlexRamMode) - { - returnCode = FTFx_CMD_SetFlexramFunction(&config->ftfxConfig, kFTFx_FlexramFuncOptAvailableAsRam); - if (returnCode != kStatus_FTFx_Success) - { - return kStatus_FTFx_RecoverFlexramAsRamError; - } - } - - return returnCode; -} - -/*! - * @brief Sets the DFlash protection to the intended protection status. - */ -status_t FLEXNVM_DflashSetProtection(flexnvm_config_t *config, uint8_t protectStatus) -{ - if (config == NULL) - { - return kStatus_FTFx_InvalidArgument; - } - - if ((config->ftfxConfig.flashDesc.totalSize == 0U) || (config->ftfxConfig.flashDesc.totalSize == 0xFFFFFFFFU)) - { - return kStatus_FTFx_CommandNotSupported; - } - - /* Individual data flash regions will be protected from program and erase operations by setting the - * associated DPROT bit to the protected state. Each FDPROT bit only be changed from 1s to 0s, - * meaning the protection can only be increased */ - FTFx->FDPROT = protectStatus; - - if (FTFx->FDPROT != protectStatus) - { - return kStatus_FTFx_CommandFailure; - } - - return kStatus_FTFx_Success; -} - -/*! - * @brief Gets the DFlash protection status. - */ -status_t FLEXNVM_DflashGetProtection(flexnvm_config_t *config, uint8_t *protectStatus) -{ - if ((config == NULL) || (protectStatus == NULL)) - { - return kStatus_FTFx_InvalidArgument; - } - - if ((config->ftfxConfig.flashDesc.totalSize == 0U) || (config->ftfxConfig.flashDesc.totalSize == 0xFFFFFFFFU)) - { - return kStatus_FTFx_CommandNotSupported; - } - - /* return the flexnvm DFlash protection status */ - *protectStatus = FTFx->FDPROT; - - return kStatus_FTFx_Success; -} - -/*! - * @brief Sets the EEPROM protection to the intended protection status. - */ -status_t FLEXNVM_EepromSetProtection(flexnvm_config_t *config, uint8_t protectStatus) -{ - if (config == NULL) - { - return kStatus_FTFx_InvalidArgument; - } - - if ((config->ftfxConfig.eepromTotalSize == 0U) || (config->ftfxConfig.eepromTotalSize == 0xFFFFU)) - { - return kStatus_FTFx_CommandNotSupported; - } - /* Individual data flash regions will be protected from program and erase operations by setting the - * associated FEPROT bit to the protected state; Each FEPROT bit only be changed from 1s to 0s, - * meaning the protection can only be increased. */ - FTFx->FEPROT = protectStatus; - - if (FTFx->FEPROT != protectStatus) - { - return kStatus_FTFx_CommandFailure; - } - - return kStatus_FTFx_Success; -} - -/*! - * @brief Gets the EEPROM protection status. - */ -status_t FLEXNVM_EepromGetProtection(flexnvm_config_t *config, uint8_t *protectStatus) -{ - if ((config == NULL) || (protectStatus == NULL)) - { - return kStatus_FTFx_InvalidArgument; - } - - if ((config->ftfxConfig.eepromTotalSize == 0U) || (config->ftfxConfig.eepromTotalSize == 0xFFFFU)) - { - return kStatus_FTFx_CommandNotSupported; - } - - /* return EEPROM protection status */ - *protectStatus = FTFx->FEPROT; - - return kStatus_FTFx_Success; -} - -/*! - * @brief Returns the desired flexnvm property. - */ -status_t FLEXNVM_GetProperty(flexnvm_config_t *config, flexnvm_property_tag_t whichProperty, uint32_t *value) -{ - if ((config == NULL) || (value == NULL)) - { - return kStatus_FTFx_InvalidArgument; - } - - status_t status = kStatus_FTFx_Success; - - switch (whichProperty) - { - /* get flexnvm date flash sector size */ - case kFLEXNVM_PropertyDflashSectorSize: - *value = config->ftfxConfig.flashDesc.sectorSize; - break; - /* get flexnvm date flash total size */ - case kFLEXNVM_PropertyDflashTotalSize: - *value = config->ftfxConfig.flashDesc.totalSize; - break; - /* get flexnvm date flash block size */ - case kFLEXNVM_PropertyDflashBlockSize: - *value = config->ftfxConfig.flashDesc.totalSize / config->ftfxConfig.flashDesc.blockCount; - break; - /* get flexnvm date flash block cont */ - case kFLEXNVM_PropertyDflashBlockCount: - *value = config->ftfxConfig.flashDesc.blockCount; - break; - /* get flexnvm date flash block base address */ - case kFLEXNVM_PropertyDflashBlockBaseAddr: - *value = config->ftfxConfig.flashDesc.blockBase; - break; -#if defined(FSL_FEATURE_FLASH_HAS_FLEX_NVM_ALIAS) && FSL_FEATURE_FLASH_HAS_FLEX_NVM_ALIAS - case kFLEXNVM_PropertyAliasDflashBlockBaseAddr: - *value = config->ftfxConfig.flashDesc.aliasBlockBase; - break; -#endif /* FSL_FEATURE_FLASH_HAS_FLEX_NVM_ALIAS */ - case kFLEXNVM_PropertyFlexRamBlockBaseAddr: - *value = config->ftfxConfig.flexramBlockBase; - break; - /* get flexram total size */ - case kFLEXNVM_PropertyFlexRamTotalSize: - *value = config->ftfxConfig.flexramTotalSize; - break; - /* get flexnvm eeprom total size */ - case kFLEXNVM_PropertyEepromTotalSize: - *value = config->ftfxConfig.eepromTotalSize; - break; - /* catch inputs that are not recognized */ - default: - status = kStatus_FTFx_UnknownProperty; - break; - } - return status; -} - -/*! @brief Convert address for Flexnvm dflash.*/ -static status_t flexnvm_convert_start_address(flexnvm_config_t *config, uint32_t start) -{ - status_t status = kStatus_FTFx_AddressError; - - if (config == NULL) - { - return kStatus_FTFx_InvalidArgument; - } - - /* From Spec: When required by the command, address bit 23 selects between program flash memory - * (=0) and data flash memory (=1).*/ - if (start >= config->ftfxConfig.flashDesc.blockBase) - { - config->ftfxConfig.opsConfig.convertedAddress = start - config->ftfxConfig.flashDesc.blockBase + 0x800000U; - status = kStatus_FTFx_Success; - } -#if defined(FSL_FEATURE_FLASH_HAS_FLEX_NVM_ALIAS) && FSL_FEATURE_FLASH_HAS_FLEX_NVM_ALIAS - /* for MKW39/38/37 which have alias blockBase */ - else if (start >= config->ftfxConfig.flashDesc.aliasBlockBase) - { - config->ftfxConfig.opsConfig.convertedAddress = start - config->ftfxConfig.flashDesc.aliasBlockBase + 0x800000U; - status = kStatus_FTFx_Success; - } - else - { - status = kStatus_FTFx_Success; - } -#endif /* FSL_FEATURE_FLASH_HAS_FLEX_NVM_ALIAS */ - - return status; -} - -#endif /* FSL_FEATURE_FLASH_HAS_FLEX_NVM */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_ftfx_flexnvm.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_ftfx_flexnvm.h deleted file mode 100644 index 57d044ff393..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_ftfx_flexnvm.h +++ /dev/null @@ -1,564 +0,0 @@ -/* - * Copyright 2013-2016 Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - * - */ - -#ifndef FSL_FTFX_FLEXNVM_H -#define FSL_FTFX_FLEXNVM_H - -#include "fsl_ftfx_controller.h" - -/*! - * @addtogroup ftfx_flexnvm_driver - * @{ - */ -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @brief Enumeration for various flexnvm properties. - */ -typedef enum _flexnvm_property_tag -{ - kFLEXNVM_PropertyDflashSectorSize = 0x00U, /*!< Dflash sector size property.*/ - kFLEXNVM_PropertyDflashTotalSize = 0x01U, /*!< Dflash total size property.*/ - kFLEXNVM_PropertyDflashBlockSize = 0x02U, /*!< Dflash block size property.*/ - kFLEXNVM_PropertyDflashBlockCount = 0x03U, /*!< Dflash block count property.*/ - kFLEXNVM_PropertyDflashBlockBaseAddr = 0x04U, /*!< Dflash block base address property.*/ - kFLEXNVM_PropertyAliasDflashBlockBaseAddr = 0x05U, /*!< Dflash block base address Alias property.*/ - kFLEXNVM_PropertyFlexRamBlockBaseAddr = 0x06U, /*!< FlexRam block base address property.*/ - kFLEXNVM_PropertyFlexRamTotalSize = 0x07U, /*!< FlexRam total size property.*/ - kFLEXNVM_PropertyEepromTotalSize = 0x08U, /*!< EEPROM total size property.*/ -} flexnvm_property_tag_t; - -/*! @brief Flexnvm driver state information. - * - * An instance of this structure is allocated by the user of the Flexnvm driver and - * passed into each of the driver APIs. - */ -typedef struct _flexnvm_config -{ - ftfx_config_t ftfxConfig; -} flexnvm_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization - * @{ - */ - -/*! - * @brief Initializes the global flash properties structure members. - * - * This function checks and initializes the Flash module for the other Flash APIs. - * - * @param config Pointer to the storage for the driver runtime state. - * - * @retval #kStatus_FTFx_Success API was executed successfully. - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_PartitionStatusUpdateFailure Failed to update the partition status. - */ -status_t FLEXNVM_Init(flexnvm_config_t *config); - -/*! @} */ - -/*! - * @name Erasing - * @{ - */ - -/*! - * @brief Erases the Dflash sectors encompassed by parameters passed into function. - * - * This function erases the appropriate number of flash sectors based on the - * desired start address and length. - * - * @param config The pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be erased. - * The start address does not need to be sector-aligned but must be word-aligned. - * @param lengthInBytes The length, given in bytes (not words or long-words) - * to be erased. Must be word-aligned. - * @param key The value used to validate all flash erase APIs. - * - * @retval #kStatus_FTFx_Success API was executed successfully; the appropriate number of date flash sectors based on - * the desired start address and length were erased successfully. - * - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_AlignmentError The parameter is not aligned with the specified baseline. - * @retval #kStatus_FTFx_AddressError The address is out of range. - * @retval #kStatus_FTFx_EraseKeyError The API erase key is invalid. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FTFx_ProtectionViolation The program/erase operation is requested to execute on protected areas. - * @retval #kStatus_FTFx_CommandFailure Run-time error during the command execution. - */ -status_t FLEXNVM_DflashErase(flexnvm_config_t *config, uint32_t start, uint32_t lengthInBytes, uint32_t key); - -/*! - * @brief Erases entire flexnvm - * - * @param config Pointer to the storage for the driver runtime state. - * @param key A value used to validate all flash erase APIs. - * - * @retval #kStatus_FTFx_Success API was executed successfully; the entire flexnvm has been erased successfully. - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_EraseKeyError API erase key is invalid. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FTFx_ProtectionViolation The program/erase operation is requested to execute on protected areas. - * @retval #kStatus_FTFx_CommandFailure Run-time error during command execution. - * @retval #kStatus_FTFx_PartitionStatusUpdateFailure Failed to update the partition status. - */ -status_t FLEXNVM_EraseAll(flexnvm_config_t *config, uint32_t key); - -#if defined(FSL_FEATURE_FLASH_HAS_ERASE_ALL_BLOCKS_UNSECURE_CMD) && FSL_FEATURE_FLASH_HAS_ERASE_ALL_BLOCKS_UNSECURE_CMD -/*! - * @brief Erases the entire flexnvm, including protected sectors. - * - * @param config Pointer to the storage for the driver runtime state. - * @param key A value used to validate all flash erase APIs. - * - * @retval #kStatus_FTFx_Success API was executed successfully; the flexnvm is not in securityi state. - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_EraseKeyError API erase key is invalid. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FTFx_ProtectionViolation The program/erase operation is requested to execute on protected areas. - * @retval #kStatus_FTFx_CommandFailure Run-time error during command execution. - * @retval #kStatus_FTFx_PartitionStatusUpdateFailure Failed to update the partition status. - */ -status_t FLEXNVM_EraseAllUnsecure(flexnvm_config_t *config, uint32_t key); -#endif /* FSL_FEATURE_FLASH_HAS_ERASE_ALL_BLOCKS_UNSECURE_CMD */ - -/*! @} */ - -/*! - * @name Programming - * @{ - */ - -/*! - * @brief Programs flash with data at locations passed in through parameters. - * - * This function programs the flash memory with the desired data for a given - * flash area as determined by the start address and the length. - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be programmed. Must be - * word-aligned. - * @param src A pointer to the source buffer of data that is to be programmed - * into the flash. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be programmed. Must be word-aligned. - * - * @retval #kStatus_FTFx_Success API was executed successfully; the desired date have been successfully - * programed into specified date flash region. - * - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_AlignmentError Parameter is not aligned with the specified baseline. - * @retval #kStatus_FTFx_AddressError Address is out of range. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FTFx_ProtectionViolation The program/erase operation is requested to execute on protected areas. - * @retval #kStatus_FTFx_CommandFailure Run-time error during the command execution. - */ -status_t FLEXNVM_DflashProgram(flexnvm_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes); - -#if defined(FSL_FEATURE_FLASH_HAS_PROGRAM_SECTION_CMD) && FSL_FEATURE_FLASH_HAS_PROGRAM_SECTION_CMD -/*! - * @brief Programs flash with data at locations passed in through parameters via the Program Section command. - * - * This function programs the flash memory with the desired data for a given - * flash area as determined by the start address and length. - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be programmed. Must be - * word-aligned. - * @param src A pointer to the source buffer of data that is to be programmed - * into the flash. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be programmed. Must be word-aligned. - * - * @retval #kStatus_FTFx_Success API was executed successfully; the desired date have been successfully - * programed into specified date flash area. - * - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_AlignmentError Parameter is not aligned with specified baseline. - * @retval #kStatus_FTFx_AddressError Address is out of range. - * @retval #kStatus_FTFx_SetFlexramAsRamError Failed to set flexram as RAM. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FTFx_ProtectionViolation The program/erase operation is requested to execute on protected areas. - * @retval #kStatus_FTFx_CommandFailure Run-time error during command execution. - * @retval #kStatus_FTFx_RecoverFlexramAsEepromError Failed to recover FlexRAM as EEPROM. - */ -status_t FLEXNVM_DflashProgramSection(flexnvm_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes); -#endif /* FSL_FEATURE_FLASH_HAS_PROGRAM_SECTION_CMD */ - -/*! - * @brief Prepares the FlexNVM block for use as data flash, EEPROM backup, or a combination of both and initializes the - * FlexRAM. - * - * @param config Pointer to storage for the driver runtime state. - * @param option The option used to set FlexRAM load behavior during reset. - * @param eepromDataSizeCode Determines the amount of FlexRAM used in each of the available EEPROM subsystems. - * @param flexnvmPartitionCode Specifies how to split the FlexNVM block between data flash memory and EEPROM backup - * memory supporting EEPROM functions. - * - * @retval #kStatus_FTFx_Success API was executed successfully; the FlexNVM block for use as data flash, EEPROM backup, - * or a combination of both have been Prepared. - * - * @retval #kStatus_FTFx_InvalidArgument Invalid argument is provided. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FTFx_ProtectionViolation The program/erase operation is requested to execute on protected areas. - * @retval #kStatus_FTFx_CommandFailure Run-time error during command execution. - */ -status_t FLEXNVM_ProgramPartition(flexnvm_config_t *config, - ftfx_partition_flexram_load_opt_t option, - uint32_t eepromDataSizeCode, - uint32_t flexnvmPartitionCode); - -/*! @} */ - -/*! - * @name Reading - * @{ - */ - -#if defined(FSL_FEATURE_FLASH_HAS_READ_RESOURCE_CMD) && FSL_FEATURE_FLASH_HAS_READ_RESOURCE_CMD -/*! - * @brief Reads the resource with data at locations passed in through parameters. - * - * This function reads the flash memory with the desired location for a given - * flash area as determined by the start address and length. - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be programmed. Must be - * word-aligned. - * @param dst A pointer to the destination buffer of data that is used to store - * data to be read. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be read. Must be word-aligned. - * @param option The resource option which indicates which area should be read back. - * - * @retval #kStatus_FTFx_Success API was executed successfully; the data have been read successfully from - * program flash IFR, data flash IFR space, and the Version ID field - * - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_AlignmentError Parameter is not aligned with the specified baseline. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FTFx_ProtectionViolation The program/erase operation is requested to execute on protected areas. - * @retval #kStatus_FTFx_CommandFailure Run-time error during the command execution. - */ -status_t FLEXNVM_ReadResource( - flexnvm_config_t *config, uint32_t start, uint8_t *dst, uint32_t lengthInBytes, ftfx_read_resource_opt_t option); -#endif /* FSL_FEATURE_FLASH_HAS_READ_RESOURCE_CMD */ - -/*! @} */ - -/*! - * @name Verification - * @{ - */ - -/*! - * @brief Verifies an erasure of the desired flash area at a specified margin level. - * - * This function checks the appropriate number of flash sectors based on - * the desired start address and length to check whether the flash is erased - * to the specified read margin level. - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be verified. - * The start address does not need to be sector-aligned but must be word-aligned. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be verified. Must be word-aligned. - * @param margin Read margin choice. - * - * @retval #kStatus_FTFx_Success API was executed successfully; the specified data flash region is in erased state. - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_AlignmentError Parameter is not aligned with specified baseline. - * @retval #kStatus_FTFx_AddressError Address is out of range. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FTFx_ProtectionViolation The program/erase operation is requested to execute on protected areas. - * @retval #kStatus_FTFx_CommandFailure Run-time error during the command execution. - */ -status_t FLEXNVM_DflashVerifyErase(flexnvm_config_t *config, - uint32_t start, - uint32_t lengthInBytes, - ftfx_margin_value_t margin); - -/*! - * @brief Verifies erasure of the entire flash at a specified margin level. - * - * This function checks whether the flash is erased to the - * specified read margin level. - * - * @param config A pointer to the storage for the driver runtime state. - * @param margin Read margin choice. - * - * @retval #kStatus_FTFx_Success API was executed successfully; the entire flexnvm region is in erased state. - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FTFx_ProtectionViolation The program/erase operation is requested to execute on protected areas. - * @retval #kStatus_FTFx_CommandFailure Run-time error during the command execution. - */ -status_t FLEXNVM_VerifyEraseAll(flexnvm_config_t *config, ftfx_margin_value_t margin); - -/*! - * @brief Verifies programming of the desired flash area at a specified margin level. - * - * This function verifies the data programmed in the flash memory using the - * Flash Program Check Command and compares it to the expected data for a given - * flash area as determined by the start address and length. - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be verified. Must be word-aligned. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be verified. Must be word-aligned. - * @param expectedData A pointer to the expected data that is to be - * verified against. - * @param margin Read margin choice. - * @param failedAddress A pointer to the returned failing address. - * @param failedData A pointer to the returned failing data. Some derivatives do - * not include failed data as part of the FCCOBx registers. In this - * case, zeros are returned upon failure. - * - * @retval #kStatus_FTFx_Success API was executed successfully; the desired data hve been programed successfully into - * specified data flash region. - * - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_AlignmentError Parameter is not aligned with specified baseline. - * @retval #kStatus_FTFx_AddressError Address is out of range. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FTFx_ProtectionViolation The program/erase operation is requested to execute on protected areas. - * @retval #kStatus_FTFx_CommandFailure Run-time error during the command execution. - */ -status_t FLEXNVM_DflashVerifyProgram(flexnvm_config_t *config, - uint32_t start, - uint32_t lengthInBytes, - const uint8_t *expectedData, - ftfx_margin_value_t margin, - uint32_t *failedAddress, - uint32_t *failedData); - -/*! @} */ - -/*! - * @name Security - * @{ - */ - -/*! - * @brief Returns the security state via the pointer passed into the function. - * - * This function retrieves the current flash security status, including the - * security enabling state and the backdoor key enabling state. - * - * @param config A pointer to storage for the driver runtime state. - * @param state A pointer to the value returned for the current security status code: - * - * @retval #kStatus_FTFx_Success API was executed successfully; - * the security state of flexnvm was stored to state. - * - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - */ -status_t FLEXNVM_GetSecurityState(flexnvm_config_t *config, ftfx_security_state_t *state); - -/*! - * @brief Allows users to bypass security with a backdoor key. - * - * If the MCU is in secured state, this function unsecures the MCU by - * comparing the provided backdoor key with ones in the flash configuration - * field. - * - * @param config A pointer to the storage for the driver runtime state. - * @param backdoorKey A pointer to the user buffer containing the backdoor key. - * - * @retval #kStatus_FTFx_Success API was executed successfully. - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FTFx_ProtectionViolation The program/erase operation is requested to execute on protected areas. - * @retval #kStatus_FTFx_CommandFailure Run-time error during the command execution. - */ -status_t FLEXNVM_SecurityBypass(flexnvm_config_t *config, const uint8_t *backdoorKey); - -/*! @} */ - -/*! - * @name FlexRAM - * @{ - */ - -#if defined(FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD) && FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD -/*! - * @brief Sets the FlexRAM function command. - * - * @param config A pointer to the storage for the driver runtime state. - * @param option The option used to set the work mode of FlexRAM. - * - * @retval #kStatus_FTFx_Success API was executed successfully; - * the FlexRAM has been successfully configured as RAM or EEPROM - * - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_ExecuteInRamFunctionNotReady Execute-in-RAM function is not available. - * @retval #kStatus_FTFx_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FTFx_ProtectionViolation The program/erase operation is requested to execute on protected areas. - * @retval #kStatus_FTFx_CommandFailure Run-time error during the command execution. - */ -status_t FLEXNVM_SetFlexramFunction(flexnvm_config_t *config, ftfx_flexram_func_opt_t option); -#endif /* FSL_FEATURE_FLASH_HAS_SET_FLEXRAM_FUNCTION_CMD */ - -/*! @} */ - -/*! - * @brief Programs the EEPROM with data at locations passed in through parameters. - * - * This function programs the emulated EEPROM with the desired data for a given - * flash area as determined by the start address and length. - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be programmed. Must be - * word-aligned. - * @param src A pointer to the source buffer of data that is to be programmed - * into the flash. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be programmed. Must be word-aligned. - * - * @retval #kStatus_FTFx_Success API was executed successfully; the desires data have been successfully programed - * into specified eeprom region. - * - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_AddressError Address is out of range. - * @retval #kStatus_FTFx_SetFlexramAsEepromError Failed to set flexram as eeprom. - * @retval #kStatus_FTFx_ProtectionViolation The program/erase operation is requested to execute on protected areas. - * @retval #kStatus_FTFx_RecoverFlexramAsRamError Failed to recover the FlexRAM as RAM. - */ -status_t FLEXNVM_EepromWrite(flexnvm_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes); - -/*! - * @name Flash Protection Utilities - * @{ - */ - -/*! - * @brief Sets the DFlash protection to the intended protection status. - * - * @param config A pointer to the storage for the driver runtime state. - * @param protectStatus The expected protect status to set to the DFlash protection register. Each bit - * corresponds to the protection of the 1/8 of the total DFlash. The least significant bit corresponds to the lowest - * address area of the DFlash. The most significant bit corresponds to the highest address area of the DFlash. There - * are - * two possible cases as shown below: - * 0: this area is protected. - * 1: this area is unprotected. - * - * @retval #kStatus_FTFx_Success API was executed successfully; the specified DFlash region is protected. - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_CommandNotSupported Flash API is not supported. - * @retval #kStatus_FTFx_CommandFailure Run-time error during command execution. - */ -status_t FLEXNVM_DflashSetProtection(flexnvm_config_t *config, uint8_t protectStatus); - -/*! - * @brief Gets the DFlash protection status. - * - * @param config A pointer to the storage for the driver runtime state. - * @param protectStatus DFlash Protect status returned by the PFlash IP. Each bit corresponds to the protection of the - * 1/8 of - * the total DFlash. The least significant bit corresponds to the lowest address area of the DFlash. The most - * significant bit corresponds to the highest address area of the DFlash, and so on. There are two possible cases as - * below: - * 0: this area is protected. - * 1: this area is unprotected. - * - * @retval #kStatus_FTFx_Success API was executed successfully. - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_CommandNotSupported Flash API is not supported. - */ -status_t FLEXNVM_DflashGetProtection(flexnvm_config_t *config, uint8_t *protectStatus); - -/*! - * @brief Sets the EEPROM protection to the intended protection status. - * - * @param config A pointer to the storage for the driver runtime state. - * @param protectStatus The expected protect status to set to the EEPROM protection register. Each bit - * corresponds to the protection of the 1/8 of the total EEPROM. The least significant bit corresponds to the lowest - * address area of the EEPROM. The most significant bit corresponds to the highest address area of EEPROM, and so on. - * There are two possible cases as shown below: - * 0: this area is protected. - * 1: this area is unprotected. - * - * @retval #kStatus_FTFx_Success API was executed successfully. - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_CommandNotSupported Flash API is not supported. - * @retval #kStatus_FTFx_CommandFailure Run-time error during command execution. - */ -status_t FLEXNVM_EepromSetProtection(flexnvm_config_t *config, uint8_t protectStatus); - -/*! - * @brief Gets the EEPROM protection status. - * - * @param config A pointer to the storage for the driver runtime state. - * @param protectStatus DFlash Protect status returned by the PFlash IP. Each bit corresponds to the protection of the - * 1/8 of - * the total EEPROM. The least significant bit corresponds to the lowest address area of the EEPROM. The most - * significant bit corresponds to the highest address area of the EEPROM. There are two possible cases as below: - * 0: this area is protected. - * 1: this area is unprotected. - * - * @retval #kStatus_FTFx_Success API was executed successfully. - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_CommandNotSupported Flash API is not supported. - */ -status_t FLEXNVM_EepromGetProtection(flexnvm_config_t *config, uint8_t *protectStatus); - -/*! @} */ - -/*! - * @name Properties - * @{ - */ - -/*! - * @brief Returns the desired flexnvm property. - * - * @param config A pointer to the storage for the driver runtime state. - * @param whichProperty The desired property from the list of properties in - * enum flexnvm_property_tag_t - * @param value A pointer to the value returned for the desired flexnvm property. - * - * @retval #kStatus_FTFx_Success API was executed successfully. - * @retval #kStatus_FTFx_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_UnknownProperty An unknown property tag. - */ -status_t FLEXNVM_GetProperty(flexnvm_config_t *config, flexnvm_property_tag_t whichProperty, uint32_t *value); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_FTFX_FLEXNVM_H */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_ftfx_utilities.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_ftfx_utilities.h deleted file mode 100644 index a3f9a84f64a..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_ftfx_utilities.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2017-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - * - */ - -#ifndef FSL_FTFX_UTILITIES_H -#define FSL_FTFX_UTILITIES_H - -/*! - * @addtogroup ftfx_utilities - * @{ - */ -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @brief Constructs the version number for drivers. */ -#if !defined(MAKE_VERSION) -#define MAKE_VERSION(major, minor, bugfix) (((major) << 16) | ((minor) << 8) | (bugfix)) -#endif - -/*! @brief Constructs a status code value from a group and a code number. */ -#if !defined(MAKE_STATUS) -#define MAKE_STATUS(group, code) ((((group)*100) + (code))) -#endif - -/*! @brief Constructs the four character code for the Flash driver API key. */ -#if !defined(FOUR_CHAR_CODE) -#define FOUR_CHAR_CODE(a, b, c, d) \ - (((uint32_t)(d) << 24u) | ((uint32_t)(c) << 16u) | ((uint32_t)(b) << 8u) | ((uint32_t)(a))) -#endif - -//! @name Alignment macros -//! @{ -/*! @brief Alignment(down) utility. */ -#if !defined(ALIGN_DOWN) -#define ALIGN_DOWN(x, a) (((uint32_t)(x)) & ~((uint32_t)(a)-1u)) -#endif - -/*! @brief Alignment(up) utility. */ -#if !defined(ALIGN_UP) -#define ALIGN_UP(x, a) ALIGN_DOWN((uint32_t)(x) + (uint32_t)(a)-1u, a) -#endif -//! @} - -/*! @brief bytes2word utility. */ -#define B1P4(b) (((uint32_t)(b)&0xFFU) << 24U) -#define B1P3(b) (((uint32_t)(b)&0xFFU) << 16U) -#define B1P2(b) (((uint32_t)(b)&0xFFU) << 8U) -#define B1P1(b) ((uint32_t)(b)&0xFFU) -#define B2P3(b) (((uint32_t)(b)&0xFFFFU) << 16U) -#define B2P2(b) (((uint32_t)(b)&0xFFFFU) << 8U) -#define B2P1(b) ((uint32_t)(b)&0xFFFFU) -#define B3P2(b) (((uint32_t)(b)&0xFFFFFFU) << 8U) -#define B3P1(b) ((uint32_t)(b)&0xFFFFFFU) - -#define BYTE2WORD_1_3(x, y) (B1P4(x) | B3P1(y)) -#define BYTE2WORD_2_2(x, y) (B2P3(x) | B2P1(y)) -#define BYTE2WORD_3_1(x, y) (B3P2(x) | B1P1(y)) -#define BYTE2WORD_1_1_2(x, y, z) (B1P4(x) | B1P3(y) | B2P1(z)) -#define BYTE2WORD_1_2_1(x, y, z) (B1P4(x) | B2P2(y) | B1P1(z)) -#define BYTE2WORD_2_1_1(x, y, z) (B2P3(x) | B1P2(y) | B1P1(z)) -#define BYTE2WORD_1_1_1_1(x, y, z, w) (B1P4(x) | B1P3(y) | B1P2(z) | B1P1(w)) - -/*! @}*/ - -#endif /* FSL_FTFX_UTILITIES_H */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_gpio.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_gpio.c deleted file mode 100644 index 3e32730d1cd..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_gpio.c +++ /dev/null @@ -1,444 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2019, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_gpio.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.gpio" -#endif - -#if defined(GPIO_RSTS) -#define GPIO_RESETS_ARRAY GPIO_RSTS -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ - -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -static PORT_Type *const s_portBases[] = PORT_BASE_PTRS; -static GPIO_Type *const s_gpioBases[] = GPIO_BASE_PTRS; -#else -#if defined(GPIO_RESETS_ARRAY) -static GPIO_Type *const s_gpioBases[] = GPIO_BASE_PTRS; -#endif -#endif - -#if defined(FSL_FEATURE_SOC_FGPIO_COUNT) && FSL_FEATURE_SOC_FGPIO_COUNT - -#if defined(FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL) && FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Array to map FGPIO instance number to clock name. */ -static const clock_ip_name_t s_fgpioClockName[] = FGPIO_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#endif /* FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL */ - -#endif /* FSL_FEATURE_SOC_FGPIO_COUNT */ - -#if defined(GPIO_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_gpioResets[] = GPIO_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -/*! - * @brief Gets the GPIO instance according to the GPIO base - * - * @param base GPIO peripheral base pointer(PTA, PTB, PTC, etc.) - * @retval GPIO instance - */ -static uint32_t GPIO_GetInstance(GPIO_Type *base); -#endif -/******************************************************************************* - * Code - ******************************************************************************/ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) || defined(GPIO_RESETS_ARRAY) -static uint32_t GPIO_GetInstance(GPIO_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_gpioBases); instance++) - { - if (s_gpioBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_gpioBases)); - - return instance; -} -#endif -/*! - * brief Initializes a GPIO pin used by the board. - * - * To initialize the GPIO, define a pin configuration, as either input or output, in the user file. - * Then, call the GPIO_PinInit() function. - * - * This is an example to define an input pin or an output pin configuration. - * code - * Define a digital input pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalInput, - * 0, - * } - * Define a digital output pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalOutput, - * 0, - * } - * endcode - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * param pin GPIO port pin number - * param config GPIO pin configuration pointer - */ -void GPIO_PinInit(GPIO_Type *base, uint32_t pin, const gpio_pin_config_t *config) -{ - assert(NULL != config); - -#if defined(GPIO_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_gpioResets[GPIO_GetInstance(base)]); -#endif - - if (config->pinDirection == kGPIO_DigitalInput) - { - base->PDDR &= GPIO_FIT_REG(~(1UL << pin)); - } - else - { - GPIO_PinWrite(base, pin, config->outputLogic); - base->PDDR |= GPIO_FIT_REG((1UL << pin)); - } -} - -#if defined(FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER) && FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER -void GPIO_GetVersionInfo(GPIO_Type *base, gpio_version_info_t *info) -{ - info->feature = (uint16_t)base->VERID; - info->minor = (uint8_t)(base->VERID >> GPIO_VERID_MINOR_SHIFT); - info->major = (uint8_t)(base->VERID >> GPIO_VERID_MAJOR_SHIFT); -} -#endif /* FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER */ - -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -/*! - * brief Reads the GPIO port interrupt status flag. - * - * If a pin is configured to generate the DMA request, the corresponding flag - * is cleared automatically at the completion of the requested DMA transfer. - * Otherwise, the flag remains set until a logic one is written to that flag. - * If configured for a level sensitive interrupt that remains asserted, the flag - * is set again immediately. - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * retval The current GPIO port interrupt status flag, for example, 0x00010001 means the - * pin 0 and 17 have the interrupt. - */ -uint32_t GPIO_PortGetInterruptFlags(GPIO_Type *base) -{ - uint8_t instance; - PORT_Type *portBase; - instance = (uint8_t)GPIO_GetInstance(base); - portBase = s_portBases[instance]; - return portBase->ISFR; -} -#else -/*! - * brief Read the GPIO interrupt status flags. - * - * param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on.) - * return The current GPIO's interrupt status flag. - * '1' means the related pin's flag is set, '0' means the related pin's flag not set. - * For example, the return value 0x00010001 means the pin 0 and 17 have the interrupt pending. - */ -uint32_t GPIO_GpioGetInterruptFlags(GPIO_Type *base) -{ - return base->ISFR[0]; -} -#if (defined(FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) && FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) -/*! - * brief Read the GPIO interrupt status flags based on selected interrupt channel(IRQS). - * param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on.) - * param channel '0' means selete interrupt channel 0, '1' means selete interrupt channel 1. - * - * return The current GPIO's interrupt status flag based on the selected interrupt channel. - * '1' means the related pin's flag is set, '0' means the related pin's flag not set. - * For example, the return value 0x00010001 means the pin 0 and 17 have the interrupt pending. - */ -uint32_t GPIO_GpioGetInterruptChannelFlags(GPIO_Type *base, uint32_t channel) -{ - assert(channel < 2U); - return base->ISFR[channel]; -} -#endif /* FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT */ -/*! - * brief Read individual pin's interrupt status flag. - * - * param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on) - * param pin GPIO specific pin number. - * return The current selected pin's interrupt status flag. - */ -uint8_t GPIO_PinGetInterruptFlag(GPIO_Type *base, uint32_t pin) -{ - return (uint8_t)((base->ICR[pin] & GPIO_ICR_ISF_MASK) >> GPIO_ICR_ISF_SHIFT); -} -#endif /* FSL_FEATURE_PORT_HAS_NO_INTERRUPT */ - -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -/*! - * brief Clears multiple GPIO pin interrupt status flags. - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * param mask GPIO pin number macro - */ -void GPIO_PortClearInterruptFlags(GPIO_Type *base, uint32_t mask) -{ - uint8_t instance; - PORT_Type *portBase; - instance = (uint8_t)GPIO_GetInstance(base); - portBase = s_portBases[instance]; - portBase->ISFR = mask; -} -#else -/*! - * brief Clears GPIO pin interrupt status flags. - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * param mask GPIO pin number macro - */ -void GPIO_GpioClearInterruptFlags(GPIO_Type *base, uint32_t mask) -{ - base->ISFR[0] = GPIO_FIT_REG(mask); -} -#if (defined(FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) && FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) -/*! - * brief Clears GPIO pin interrupt status flags based on selected interrupt channel(IRQS). - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * param mask GPIO pin number macro - * param channel '0' means selete interrupt channel 0, '1' means selete interrupt channel 1. - */ -void GPIO_GpioClearInterruptChannelFlags(GPIO_Type *base, uint32_t mask, uint32_t channel) -{ - assert(channel < 2U); - base->ISFR[channel] = GPIO_FIT_REG(mask); -} -#endif /* FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT */ -/*! - * brief Clear GPIO individual pin's interrupt status flag. - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on). - * param pin GPIO specific pin number. - */ -void GPIO_PinClearInterruptFlag(GPIO_Type *base, uint32_t pin) -{ - base->ICR[pin] |= GPIO_FIT_REG(GPIO_ICR_ISF(1U)); -} -#endif /* FSL_FEATURE_PORT_HAS_NO_INTERRUPT */ - -#if defined(FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER) && FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER -/*! - * brief The GPIO module supports a device-specific number of data ports, organized as 32-bit - * words/8-bit Bytes. Each 32-bit/8-bit data port includes a GACR register, which defines the byte-level - * attributes required for a successful access to the GPIO programming model. If the GPIO module's GACR register - * organized as 32-bit words, the attribute controls for the 4 data bytes in the GACR follow a standard little - * endian data convention. - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * param attribute GPIO checker attribute - */ -void GPIO_CheckAttributeBytes(GPIO_Type *base, gpio_checker_attribute_t attribute) -{ -#if defined(FSL_FEATURE_GPIO_REGISTERS_WIDTH) && (FSL_FEATURE_GPIO_REGISTERS_WIDTH == 8U) - base->GACR = ((uint8_t)attribute << GPIO_GACR_ACB_SHIFT); -#else - base->GACR = ((uint32_t)attribute << GPIO_GACR_ACB0_SHIFT) | ((uint32_t)attribute << GPIO_GACR_ACB1_SHIFT) | - ((uint32_t)attribute << GPIO_GACR_ACB2_SHIFT) | ((uint32_t)attribute << GPIO_GACR_ACB3_SHIFT); -#endif /* FSL_FEATURE_GPIO_REGISTERS_WIDTH */ -} -#endif - -#if defined(FSL_FEATURE_SOC_FGPIO_COUNT) && FSL_FEATURE_SOC_FGPIO_COUNT - -/******************************************************************************* - * Variables - ******************************************************************************/ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -static FGPIO_Type *const s_fgpioBases[] = FGPIO_BASE_PTRS; -#endif -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -/*! - * @brief Gets the FGPIO instance according to the GPIO base - * - * @param base FGPIO peripheral base pointer(PTA, PTB, PTC, etc.) - * @retval FGPIO instance - */ -static uint32_t FGPIO_GetInstance(FGPIO_Type *base); -#endif -/******************************************************************************* - * Code - ******************************************************************************/ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -static uint32_t FGPIO_GetInstance(FGPIO_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_fgpioBases); instance++) - { - if (s_fgpioBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_fgpioBases)); - - return instance; -} -#endif -#if defined(FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL) && FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL -/*! - * brief Initializes the FGPIO peripheral. - * - * This function ungates the FGPIO clock. - * - * param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - */ -void FGPIO_PortInit(FGPIO_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate FGPIO periphral clock */ - CLOCK_EnableClock(s_fgpioClockName[FGPIO_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} -#endif /* FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL */ - -/*! - * brief Initializes a FGPIO pin used by the board. - * - * To initialize the FGPIO driver, define a pin configuration, as either input or output, in the user file. - * Then, call the FGPIO_PinInit() function. - * - * This is an example to define an input pin or an output pin configuration: - * code - * Define a digital input pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalInput, - * 0, - * } - * Define a digital output pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalOutput, - * 0, - * } - * endcode - * - * param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * param pin FGPIO port pin number - * param config FGPIO pin configuration pointer - */ -void FGPIO_PinInit(FGPIO_Type *base, uint32_t pin, const gpio_pin_config_t *config) -{ - assert(NULL != config); - - if (config->pinDirection == kGPIO_DigitalInput) - { - base->PDDR &= ~(1UL << pin); - } - else - { - FGPIO_PinWrite(base, pin, config->outputLogic); - base->PDDR |= (1UL << pin); - } -} -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -/*! - * brief Reads the FGPIO port interrupt status flag. - * - * If a pin is configured to generate the DMA request, the corresponding flag - * is cleared automatically at the completion of the requested DMA transfer. - * Otherwise, the flag remains set until a logic one is written to that flag. - * If configured for a level-sensitive interrupt that remains asserted, the flag - * is set again immediately. - * - * param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * retval The current FGPIO port interrupt status flags, for example, 0x00010001 means the - * pin 0 and 17 have the interrupt. - */ -uint32_t FGPIO_PortGetInterruptFlags(FGPIO_Type *base) -{ - uint8_t instance; - instance = (uint8_t)FGPIO_GetInstance(base); - PORT_Type *portBase; - portBase = s_portBases[instance]; - return portBase->ISFR; -} - -/*! - * brief Clears the multiple FGPIO pin interrupt status flag. - * - * param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * param mask FGPIO pin number macro - */ -void FGPIO_PortClearInterruptFlags(FGPIO_Type *base, uint32_t mask) -{ - uint8_t instance; - instance = (uint8_t)FGPIO_GetInstance(base); - PORT_Type *portBase; - portBase = s_portBases[instance]; - portBase->ISFR = mask; -} -#endif -#if defined(FSL_FEATURE_FGPIO_HAS_ATTRIBUTE_CHECKER) && FSL_FEATURE_FGPIO_HAS_ATTRIBUTE_CHECKER -/*! - * brief The FGPIO module supports a device-specific number of data ports, organized as 32-bit - * words. Each 32-bit data port includes a GACR register, which defines the byte-level - * attributes required for a successful access to the GPIO programming model. The attribute controls for the 4 data - * bytes in the GACR follow a standard little endian - * data convention. - * - * param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * param attribute FGPIO checker attribute - */ -void FGPIO_CheckAttributeBytes(FGPIO_Type *base, gpio_checker_attribute_t attribute) -{ - base->GACR = ((uint32_t)attribute << FGPIO_GACR_ACB0_SHIFT) | ((uint32_t)attribute << FGPIO_GACR_ACB1_SHIFT) | - ((uint32_t)attribute << FGPIO_GACR_ACB2_SHIFT) | ((uint32_t)attribute << FGPIO_GACR_ACB3_SHIFT); -} -#endif - -#endif /* FSL_FEATURE_SOC_FGPIO_COUNT */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_gpio.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_gpio.h deleted file mode 100644 index a91fa403efd..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_gpio.h +++ /dev/null @@ -1,799 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_GPIO_H_ -#define FSL_GPIO_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup gpio - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief GPIO driver version. */ -#define FSL_GPIO_DRIVER_VERSION (MAKE_VERSION(2, 7, 3)) -/*! @} */ - -#if defined(FSL_FEATURE_GPIO_REGISTERS_WIDTH) && (FSL_FEATURE_GPIO_REGISTERS_WIDTH == 8U) -#define GPIO_FIT_REG(value) \ - ((uint8_t)(value)) /*!< For some platforms with 8-bit register width, cast the type to uint8_t */ -#else -#define GPIO_FIT_REG(value) ((uint32_t)(value)) -#endif /*FSL_FEATURE_GPIO_REGISTERS_WIDTH*/ - -/*! @brief GPIO direction definition */ -typedef enum _gpio_pin_direction -{ - kGPIO_DigitalInput = 0U, /*!< Set current pin as digital input*/ - kGPIO_DigitalOutput = 1U, /*!< Set current pin as digital output*/ -} gpio_pin_direction_t; - -#if defined(FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER) && FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER -/*! @brief GPIO checker attribute */ -typedef enum _gpio_checker_attribute -{ - kGPIO_UsernonsecureRWUsersecureRWPrivilegedsecureRW = - 0x00U, /*!< User nonsecure:Read+Write; User Secure:Read+Write; Privileged Secure:Read+Write */ - kGPIO_UsernonsecureRUsersecureRWPrivilegedsecureRW = - 0x01U, /*!< User nonsecure:Read; User Secure:Read+Write; Privileged Secure:Read+Write */ - kGPIO_UsernonsecureNUsersecureRWPrivilegedsecureRW = - 0x02U, /*!< User nonsecure:None; User Secure:Read+Write; Privileged Secure:Read+Write */ - kGPIO_UsernonsecureRUsersecureRPrivilegedsecureRW = - 0x03U, /*!< User nonsecure:Read; User Secure:Read; Privileged Secure:Read+Write */ - kGPIO_UsernonsecureNUsersecureRPrivilegedsecureRW = - 0x04U, /*!< User nonsecure:None; User Secure:Read; Privileged Secure:Read+Write */ - kGPIO_UsernonsecureNUsersecureNPrivilegedsecureRW = - 0x05U, /*!< User nonsecure:None; User Secure:None; Privileged Secure:Read+Write */ - kGPIO_UsernonsecureNUsersecureNPrivilegedsecureR = - 0x06U, /*!< User nonsecure:None; User Secure:None; Privileged Secure:Read */ - kGPIO_UsernonsecureNUsersecureNPrivilegedsecureN = - 0x07U, /*!< User nonsecure:None; User Secure:None; Privileged Secure:None */ - kGPIO_IgnoreAttributeCheck = 0x80U, /*!< Ignores the attribute check */ -} gpio_checker_attribute_t; -#endif - -/*! - * @brief The GPIO pin configuration structure. - * - * Each pin can only be configured as either an output pin or an input pin at a time. - * If configured as an input pin, leave the outputConfig unused. - * Note that in some use cases, the corresponding port property should be configured in advance - * with the PORT_SetPinConfig(). - */ -typedef struct _gpio_pin_config -{ - gpio_pin_direction_t pinDirection; /*!< GPIO direction, input or output */ - /* Output configurations; ignore if configured as an input pin */ - uint8_t outputLogic; /*!< Set a default output logic, which has no use in input */ -} gpio_pin_config_t; - -#if (defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) || \ - !(defined(FSL_FEATURE_SOC_PORT_COUNT)) -/*! @brief Configures the interrupt generation condition. */ -typedef enum _gpio_interrupt_config -{ - kGPIO_InterruptStatusFlagDisabled = 0x0U, /*!< Interrupt status flag is disabled. */ - kGPIO_DMARisingEdge = 0x1U, /*!< ISF flag and DMA request on rising edge. */ - kGPIO_DMAFallingEdge = 0x2U, /*!< ISF flag and DMA request on falling edge. */ - kGPIO_DMAEitherEdge = 0x3U, /*!< ISF flag and DMA request on either edge. */ - kGPIO_FlagRisingEdge = 0x05U, /*!< Flag sets on rising edge. */ - kGPIO_FlagFallingEdge = 0x06U, /*!< Flag sets on falling edge. */ - kGPIO_FlagEitherEdge = 0x07U, /*!< Flag sets on either edge. */ - kGPIO_InterruptLogicZero = 0x8U, /*!< Interrupt when logic zero. */ - kGPIO_InterruptRisingEdge = 0x9U, /*!< Interrupt on rising edge. */ - kGPIO_InterruptFallingEdge = 0xAU, /*!< Interrupt on falling edge. */ - kGPIO_InterruptEitherEdge = 0xBU, /*!< Interrupt on either edge. */ - kGPIO_InterruptLogicOne = 0xCU, /*!< Interrupt when logic one. */ - kGPIO_ActiveHighTriggerOutputEnable = 0xDU, /*!< Enable active high-trigger output. */ - kGPIO_ActiveLowTriggerOutputEnable = 0xEU, /*!< Enable active low-trigger output. */ -} gpio_interrupt_config_t; -#endif - -#if (defined(FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) && FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) -/*! @brief Configures the selection of interrupt/DMA request/trigger output. */ -typedef enum _gpio_interrupt_selection -{ - kGPIO_InterruptOutput0 = 0x0U, /*!< Interrupt/DMA request/trigger output 0. */ - kGPIO_InterruptOutput1 = 0x1U, /*!< Interrupt/DMA request/trigger output 1. */ -} gpio_interrupt_selection_t; -#endif /* FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT */ - -#if defined(FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER) && FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER -/*! @brief GPIO version information. */ -typedef struct _gpio_version_info -{ - uint16_t feature; /*!< Feature Specification Number. */ - uint8_t minor; /*!< Minor Version Number. */ - uint8_t major; /*!< Major Version Number. */ -} gpio_version_info_t; -#endif /* FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER */ - -#if defined(FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL) && FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL -/*! @brief GPIO pin and interrupt control. */ -typedef enum -{ - kGPIO_PinControlNonSecure = 0x01U, /*!< Pin Control Non-Secure. */ - kGPIO_InterruptControlNonSecure = 0x02U, /*!< Interrupt Control Non-Secure. */ - kGPIO_PinControlNonPrivilege = 0x04U, /*!< Pin Control Non-Privilege. */ - kGPIO_InterruptControlNonPrivilege = 0x08U, /*!< Interrupt Control Non-Privilege. */ -} gpio_pin_interrupt_control_t; -#endif /* FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL */ - -/*! @} */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @addtogroup gpio_driver - * @{ - */ - -/*! @name GPIO Configuration */ -/*! @{ */ - -/*! - * @brief Initializes a GPIO pin used by the board. - * - * To initialize the GPIO, define a pin configuration, as either input or output, in the user file. - * Then, call the GPIO_PinInit() function. - * - * This is an example to define an input pin or an output pin configuration. - * @code - * Define a digital input pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalInput, - * 0, - * } - * Define a digital output pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalOutput, - * 0, - * } - * @endcode - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param pin GPIO port pin number - * @param config GPIO pin configuration pointer - */ -void GPIO_PinInit(GPIO_Type *base, uint32_t pin, const gpio_pin_config_t *config); - -#if defined(FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER) && FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER -/*! - * @brief Get GPIO version information. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param info GPIO version information - */ -void GPIO_GetVersionInfo(GPIO_Type *base, gpio_version_info_t *info); -#endif /* FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER */ - -#if defined(FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL) && FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL -/*! - * @brief lock or unlock secure privilege. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask pin or interrupt macro - */ -static inline void GPIO_SecurePrivilegeLock(GPIO_Type *base, gpio_pin_interrupt_control_t mask) -{ - base->LOCK |= GPIO_FIT_REG(mask); -} - -/*! - * @brief Enable Pin Control Non-Secure. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_EnablePinControlNonSecure(GPIO_Type *base, uint32_t mask) -{ - base->PCNS |= GPIO_FIT_REG(mask); -} - -/*! - * @brief Disable Pin Control Non-Secure. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_DisablePinControlNonSecure(GPIO_Type *base, uint32_t mask) -{ - base->PCNS &= GPIO_FIT_REG(~mask); -} - -/*! - * @brief Enable Pin Control Non-Privilege. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_EnablePinControlNonPrivilege(GPIO_Type *base, uint32_t mask) -{ - base->PCNP |= GPIO_FIT_REG(mask); -} - -/*! - * @brief Disable Pin Control Non-Privilege. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_DisablePinControlNonPrivilege(GPIO_Type *base, uint32_t mask) -{ - base->PCNP &= GPIO_FIT_REG(~mask); -} - -/*! - * @brief Enable Interrupt Control Non-Secure. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_EnableInterruptControlNonSecure(GPIO_Type *base, uint32_t mask) -{ - base->ICNS |= GPIO_FIT_REG(mask); -} - -/*! - * @brief Disable Interrupt Control Non-Secure. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_DisableInterruptControlNonSecure(GPIO_Type *base, uint32_t mask) -{ - base->ICNS &= GPIO_FIT_REG(~mask); -} - -/*! - * @brief Enable Interrupt Control Non-Privilege. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_EnableInterruptControlNonPrivilege(GPIO_Type *base, uint32_t mask) -{ - base->ICNP |= GPIO_FIT_REG(mask); -} - -/*! - * @brief Disable Interrupt Control Non-Privilege. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_DisableInterruptControlNonPrivilege(GPIO_Type *base, uint32_t mask) -{ - base->ICNP &= GPIO_FIT_REG(~mask); -} -#endif /* FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL */ - -#if defined(FSL_FEATURE_GPIO_HAS_PORT_INPUT_CONTROL) && FSL_FEATURE_GPIO_HAS_PORT_INPUT_CONTROL -/*! - * @brief Enable port input. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_PortInputEnable(GPIO_Type *base, uint32_t mask) -{ - base->PIDR &= GPIO_FIT_REG(~mask); -} - -/*! - * @brief Disable port input. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_PortInputDisable(GPIO_Type *base, uint32_t mask) -{ - base->PIDR |= GPIO_FIT_REG(mask); -} -#endif /* FSL_FEATURE_GPIO_HAS_PORT_INPUT_CONTROL */ - -/*! @} */ - -/*! @name GPIO Output Operations */ -/*! @{ */ - -/*! - * @brief Sets the output level of the multiple GPIO pins to the logic 1 or 0. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param pin GPIO pin number - * @param output GPIO pin output logic level. - * - 0: corresponding pin output low-logic level. - * - 1: corresponding pin output high-logic level. - */ -static inline void GPIO_PinWrite(GPIO_Type *base, uint32_t pin, uint8_t output) -{ -#if !(defined(FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) && FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) - if (output == 0U) - { - base->PCOR = GPIO_FIT_REG(1UL << pin); - } - else - { - base->PSOR = GPIO_FIT_REG(1UL << pin); - } -#else - if (output == 0U) - { - base->PDOR |= GPIO_FIT_REG(1UL << pin); - } - else - { - base->PDOR &= ~GPIO_FIT_REG(1UL << pin); - } -#endif -} - -/*! - * @brief Sets the output level of the multiple GPIO pins to the logic 1. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_PortSet(GPIO_Type *base, uint32_t mask) -{ -#if !(defined(FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) && FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) - base->PSOR = GPIO_FIT_REG(mask); -#else - base->PDOR |= GPIO_FIT_REG(mask); -#endif -} - -/*! - * @brief Sets the output level of the multiple GPIO pins to the logic 0. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_PortClear(GPIO_Type *base, uint32_t mask) -{ -#if !(defined(FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) && FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) - base->PCOR = GPIO_FIT_REG(mask); -#else - base->PDOR &= ~GPIO_FIT_REG(mask); -#endif -} - -/*! - * @brief Reverses the current output logic of the multiple GPIO pins. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_PortToggle(GPIO_Type *base, uint32_t mask) -{ -#if !(defined(FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) && FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) - base->PTOR = GPIO_FIT_REG(mask); -#else - base->PDOR ^= GPIO_FIT_REG(mask); -#endif -} - -/*! @} */ - -/*! @name GPIO Input Operations */ -/*! @{ */ - -/*! - * @brief Reads the current input value of the GPIO port. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param pin GPIO pin number - * @retval GPIO port input value - * - 0: corresponding pin input low-logic level. - * - 1: corresponding pin input high-logic level. - */ -static inline uint32_t GPIO_PinRead(GPIO_Type *base, uint32_t pin) -{ - return (((uint32_t)(base->PDIR) >> pin) & 0x01UL); -} - -/*! @} */ - -/*! @name GPIO Interrupt */ -/*! @{ */ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -/*! - * @brief Reads the GPIO port interrupt status flag. - * - * If a pin is configured to generate the DMA request, the corresponding flag - * is cleared automatically at the completion of the requested DMA transfer. - * Otherwise, the flag remains set until a logic one is written to that flag. - * If configured for a level sensitive interrupt that remains asserted, the flag - * is set again immediately. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @retval The current GPIO port interrupt status flag, for example, 0x00010001 means the - * pin 0 and 17 have the interrupt. - */ -uint32_t GPIO_PortGetInterruptFlags(GPIO_Type *base); - -/*! - * @brief Clears multiple GPIO pin interrupt status flags. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -void GPIO_PortClearInterruptFlags(GPIO_Type *base, uint32_t mask); -#else -/*! - * @brief Configures the gpio pin interrupt/DMA request. - * - * @param base GPIO peripheral base pointer. - * @param pin GPIO pin number. - * @param config GPIO pin interrupt configuration. - * - #kGPIO_InterruptStatusFlagDisabled: Interrupt/DMA request disabled. - * - #kGPIO_DMARisingEdge : DMA request on rising edge(if the DMA requests exit). - * - #kGPIO_DMAFallingEdge: DMA request on falling edge(if the DMA requests exit). - * - #kGPIO_DMAEitherEdge : DMA request on either edge(if the DMA requests exit). - * - #kGPIO_FlagRisingEdge : Flag sets on rising edge(if the Flag states exit). - * - #kGPIO_FlagFallingEdge : Flag sets on falling edge(if the Flag states exit). - * - #kGPIO_FlagEitherEdge : Flag sets on either edge(if the Flag states exit). - * - #kGPIO_InterruptLogicZero : Interrupt when logic zero. - * - #kGPIO_InterruptRisingEdge : Interrupt on rising edge. - * - #kGPIO_InterruptFallingEdge: Interrupt on falling edge. - * - #kGPIO_InterruptEitherEdge : Interrupt on either edge. - * - #kGPIO_InterruptLogicOne : Interrupt when logic one. - * - #kGPIO_ActiveHighTriggerOutputEnable : Enable active high-trigger output (if the trigger states exit). - * - #kGPIO_ActiveLowTriggerOutputEnable : Enable active low-trigger output (if the trigger states exit). - */ -static inline void GPIO_SetPinInterruptConfig(GPIO_Type *base, uint32_t pin, gpio_interrupt_config_t config) -{ - assert(base); - - base->ICR[pin] = GPIO_FIT_REG((base->ICR[pin] & ~GPIO_ICR_IRQC_MASK) | GPIO_ICR_IRQC(config)); -} - -#if (defined(FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) && FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) -/*! - * @brief Configures the gpio pin interrupt/DMA request/trigger output channel selection. - * - * @param base GPIO peripheral base pointer. - * @param pin GPIO pin number. - * @param selection GPIO pin interrupt output selection. - * - #kGPIO_InterruptOutput0: Interrupt/DMA request/trigger output 0. - * - #kGPIO_InterruptOutput1 : Interrupt/DMA request/trigger output 1. - */ -static inline void GPIO_SetPinInterruptChannel(GPIO_Type *base, uint32_t pin, gpio_interrupt_selection_t selection) -{ - assert(base); - - base->ICR[pin] = GPIO_FIT_REG((base->ICR[pin] & ~GPIO_ICR_IRQS_MASK) | GPIO_ICR_IRQS(selection)); -} -#endif -/*! - * @brief Read the GPIO interrupt status flags. - * - * @param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on.) - * @return The current GPIO's interrupt status flag. - * '1' means the related pin's flag is set, '0' means the related pin's flag not set. - * For example, the return value 0x00010001 means the pin 0 and 17 have the interrupt pending. - */ -uint32_t GPIO_GpioGetInterruptFlags(GPIO_Type *base); -#if (defined(FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) && FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) -/*! - * @brief Read the GPIO interrupt status flags based on selected interrupt channel(IRQS). - * - * @param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on.) - * @param channel '0' means selete interrupt channel 0, '1' means selete interrupt channel 1. - * @return The current GPIO's interrupt status flag based on the selected interrupt channel. - * '1' means the related pin's flag is set, '0' means the related pin's flag not set. - * For example, the return value 0x00010001 means the pin 0 and 17 have the interrupt pending. - */ -uint32_t GPIO_GpioGetInterruptChannelFlags(GPIO_Type *base, uint32_t channel); -#endif -/*! - * @brief Read individual pin's interrupt status flag. - * - * @param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on) - * @param pin GPIO specific pin number. - * @return The current selected pin's interrupt status flag. - */ -uint8_t GPIO_PinGetInterruptFlag(GPIO_Type *base, uint32_t pin); - -/*! - * @brief Clears GPIO pin interrupt status flags. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -void GPIO_GpioClearInterruptFlags(GPIO_Type *base, uint32_t mask); -#if (defined(FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) && FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) -/*! - * @brief Clears GPIO pin interrupt status flags based on selected interrupt channel(IRQS). - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - * @param channel '0' means selete interrupt channel 0, '1' means selete interrupt channel 1. - */ -void GPIO_GpioClearInterruptChannelFlags(GPIO_Type *base, uint32_t mask, uint32_t channel); -#endif -/*! - * @brief Clear GPIO individual pin's interrupt status flag. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on). - * @param pin GPIO specific pin number. - */ -void GPIO_PinClearInterruptFlag(GPIO_Type *base, uint32_t pin); - -/*! - * @brief Reads the GPIO DMA request flags. - * The corresponding flag will be cleared automatically at the completion of the requested - * DMA transfer - */ -static inline uint32_t GPIO_GetPinsDMARequestFlags(GPIO_Type *base) -{ - assert(base); - return (base->ISFR[1]); -} - -/*! - * @brief Sets the GPIO interrupt configuration in PCR register for multiple pins. - * - * @param base GPIO peripheral base pointer. - * @param mask GPIO pin number macro. - * @param config GPIO pin interrupt configuration. - * - #kGPIO_InterruptStatusFlagDisabled: Interrupt disabled. - * - #kGPIO_DMARisingEdge : DMA request on rising edge(if the DMA requests exit). - * - #kGPIO_DMAFallingEdge: DMA request on falling edge(if the DMA requests exit). - * - #kGPIO_DMAEitherEdge : DMA request on either edge(if the DMA requests exit). - * - #kGPIO_FlagRisingEdge : Flag sets on rising edge(if the Flag states exit). - * - #kGPIO_FlagFallingEdge : Flag sets on falling edge(if the Flag states exit). - * - #kGPIO_FlagEitherEdge : Flag sets on either edge(if the Flag states exit). - * - #kGPIO_InterruptLogicZero : Interrupt when logic zero. - * - #kGPIO_InterruptRisingEdge : Interrupt on rising edge. - * - #kGPIO_InterruptFallingEdge: Interrupt on falling edge. - * - #kGPIO_InterruptEitherEdge : Interrupt on either edge. - * - #kGPIO_InterruptLogicOne : Interrupt when logic one. - * - #kGPIO_ActiveHighTriggerOutputEnable : Enable active high-trigger output (if the trigger states exit). - * - #kGPIO_ActiveLowTriggerOutputEnable : Enable active low-trigger output (if the trigger states exit).. - */ -static inline void GPIO_SetMultipleInterruptPinsConfig(GPIO_Type *base, uint32_t mask, gpio_interrupt_config_t config) -{ - assert(base); - - if (0UL != (mask & 0xffffUL)) - { - base->GICLR = GPIO_FIT_REG((GPIO_ICR_IRQC(config)) | (mask & 0xffffU)); - } - mask = mask >> 16U; - if (mask != 0UL) - { - base->GICHR = GPIO_FIT_REG((GPIO_ICR_IRQC(config)) | (mask & 0xffffU)); - } -} -#endif - -#if defined(FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER) && FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER -/*! - * brief The GPIO module supports a device-specific number of data ports, organized as 32-bit - * words/8-bit Bytes. Each 32-bit/8-bit data port includes a GACR register, which defines the byte-level - * attributes required for a successful access to the GPIO programming model. If the GPIO module's GACR register - * organized as 32-bit words, the attribute controls for the 4 data bytes in the GACR follow a standard little - * endian data convention. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param attribute GPIO checker attribute - */ -void GPIO_CheckAttributeBytes(GPIO_Type *base, gpio_checker_attribute_t attribute); -#endif - -/*! @} */ -/*! @} */ - -/*! - * @addtogroup fgpio_driver - * @{ - */ - -/* - * Introduces the FGPIO feature. - * - * The FGPIO features are only support on some Kinetis MCUs. The FGPIO registers are aliased to the IOPORT - * interface. Accesses via the IOPORT interface occur in parallel with any instruction fetches and - * complete in a single cycle. This aliased Fast GPIO memory map is called FGPIO. - */ - -#if defined(FSL_FEATURE_SOC_FGPIO_COUNT) && FSL_FEATURE_SOC_FGPIO_COUNT - -/*! @name FGPIO Configuration */ -/*! @{ */ - -#if defined(FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL) && FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL -/*! - * @brief Initializes the FGPIO peripheral. - * - * This function ungates the FGPIO clock. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - */ -void FGPIO_PortInit(FGPIO_Type *base); -#endif /* FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL */ - -/*! - * @brief Initializes a FGPIO pin used by the board. - * - * To initialize the FGPIO driver, define a pin configuration, as either input or output, in the user file. - * Then, call the FGPIO_PinInit() function. - * - * This is an example to define an input pin or an output pin configuration: - * @code - * Define a digital input pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalInput, - * 0, - * } - * Define a digital output pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalOutput, - * 0, - * } - * @endcode - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param pin FGPIO port pin number - * @param config FGPIO pin configuration pointer - */ -void FGPIO_PinInit(FGPIO_Type *base, uint32_t pin, const gpio_pin_config_t *config); - -/*! @} */ - -/*! @name FGPIO Output Operations */ -/*! @{ */ - -/*! - * @brief Sets the output level of the multiple FGPIO pins to the logic 1 or 0. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param pin FGPIO pin number - * @param output FGPIOpin output logic level. - * - 0: corresponding pin output low-logic level. - * - 1: corresponding pin output high-logic level. - */ -static inline void FGPIO_PinWrite(FGPIO_Type *base, uint32_t pin, uint8_t output) -{ - if (output == 0U) - { - base->PCOR = 1UL << pin; - } - else - { - base->PSOR = 1UL << pin; - } -} - -/*! - * @brief Sets the output level of the multiple FGPIO pins to the logic 1. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param mask FGPIO pin number macro - */ -static inline void FGPIO_PortSet(FGPIO_Type *base, uint32_t mask) -{ - base->PSOR = mask; -} - -/*! - * @brief Sets the output level of the multiple FGPIO pins to the logic 0. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param mask FGPIO pin number macro - */ -static inline void FGPIO_PortClear(FGPIO_Type *base, uint32_t mask) -{ - base->PCOR = mask; -} - -/*! - * @brief Reverses the current output logic of the multiple FGPIO pins. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param mask FGPIO pin number macro - */ -static inline void FGPIO_PortToggle(FGPIO_Type *base, uint32_t mask) -{ - base->PTOR = mask; -} -/*! @} */ - -/*! @name FGPIO Input Operations */ -/*! @{ */ - -/*! - * @brief Reads the current input value of the FGPIO port. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param pin FGPIO pin number - * @retval FGPIO port input value - * - 0: corresponding pin input low-logic level. - * - 1: corresponding pin input high-logic level. - */ -static inline uint32_t FGPIO_PinRead(FGPIO_Type *base, uint32_t pin) -{ - return (((base->PDIR) >> pin) & 0x01U); -} -/*! @} */ - -/*! @name FGPIO Interrupt */ -/*! @{ */ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) - -/*! - * @brief Reads the FGPIO port interrupt status flag. - * - * If a pin is configured to generate the DMA request, the corresponding flag - * is cleared automatically at the completion of the requested DMA transfer. - * Otherwise, the flag remains set until a logic one is written to that flag. - * If configured for a level-sensitive interrupt that remains asserted, the flag - * is set again immediately. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @retval The current FGPIO port interrupt status flags, for example, 0x00010001 means the - * pin 0 and 17 have the interrupt. - */ -uint32_t FGPIO_PortGetInterruptFlags(FGPIO_Type *base); - -/*! - * @brief Clears the multiple FGPIO pin interrupt status flag. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param mask FGPIO pin number macro - */ -void FGPIO_PortClearInterruptFlags(FGPIO_Type *base, uint32_t mask); -#endif -#if defined(FSL_FEATURE_FGPIO_HAS_ATTRIBUTE_CHECKER) && FSL_FEATURE_FGPIO_HAS_ATTRIBUTE_CHECKER -/*! - * @brief The FGPIO module supports a device-specific number of data ports, organized as 32-bit - * words. Each 32-bit data port includes a GACR register, which defines the byte-level - * attributes required for a successful access to the GPIO programming model. The attribute controls for the 4 data - * bytes in the GACR follow a standard little endian - * data convention. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param attribute FGPIO checker attribute - */ -void FGPIO_CheckAttributeBytes(FGPIO_Type *base, gpio_checker_attribute_t attribute); -#endif /* FSL_FEATURE_FGPIO_HAS_ATTRIBUTE_CHECKER */ - -/*! @} */ - -#endif /* FSL_FEATURE_SOC_FGPIO_COUNT */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ - -#endif /* FSL_GPIO_H_*/ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_i2c.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_i2c.c deleted file mode 100644 index cbae6fd0e42..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_i2c.c +++ /dev/null @@ -1,2419 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#include "fsl_i2c.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.i2c" -#endif - -/*! @brief i2c transfer state. */ -enum _i2c_transfer_states -{ - kIdleState = 0x0U, /*!< I2C bus idle. */ - kCheckAddressState = 0x1U, /*!< 7-bit address check state. */ - kSendCommandState = 0x2U, /*!< Send command byte phase. */ - kSendDataState = 0x3U, /*!< Send data transfer phase. */ - kReceiveDataBeginState = 0x4U, /*!< Receive data transfer phase begin. */ - kReceiveDataState = 0x5U, /*!< Receive data transfer phase. */ -}; - -/*! @brief Typedef for interrupt handler. */ -typedef void (*i2c_isr_t)(I2C_Type *base, void *i2cHandle); - -/*! @brief static variable to keep current configured baudrate. */ -#if defined(I2C_MASTER_FACK_CONTROL) && I2C_MASTER_FACK_CONTROL -static uint32_t g_baudrate = 100000; -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Set SCL/SDA hold time, this API receives SCL stop hold time, calculate the - * closest SCL divider and MULT value for the SDA hold time, SCL start and SCL stop - * hold time. To reduce the ROM size, SDA/SCL hold value mapping table is not provided, - * assume SCL divider = SCL stop hold value *2 to get the closest SCL divider value and MULT - * value, then the related SDA hold time, SCL start and SCL stop hold time is used. - * - * @param base I2C peripheral base address. - * @param sourceClock_Hz I2C functional clock frequency in Hertz. - * @param sclStopHoldTime_ns SCL stop hold time in ns. - */ -static void I2C_SetHoldTime(I2C_Type *base, uint32_t sclStopHoldTime_ns, uint32_t sourceClock_Hz); - -#if defined(I2C_MASTER_FACK_CONTROL) && I2C_MASTER_FACK_CONTROL -/*! - * @brief I2C master manually ack byte. - * - * @param base I2C peripheral base address. - */ -static void I2C_MasterAckByte(I2C_Type *base); -#endif - -/*! - * @brief Set up master transfer, send slave address and decide the initial - * transfer state. - * - * @param base I2C peripheral base address. - * @param handle pointer to i2c_master_handle_t structure which stores the transfer state. - * @param xfer pointer to i2c_master_transfer_t structure. - */ -static status_t I2C_InitTransferStateMachine(I2C_Type *base, i2c_master_handle_t *handle, i2c_master_transfer_t *xfer); - -/*! - * @brief Check and clear status operation. - * - * @param base I2C peripheral base address. - * @param status current i2c hardware status. - * @retval kStatus_Success No error found. - * @retval kStatus_I2C_ArbitrationLost Transfer error, arbitration lost. - * @retval kStatus_I2C_Nak Received Nak error. - */ -static status_t I2C_CheckAndClearError(I2C_Type *base, uint32_t status); - -/*! - * @brief Master run transfer state machine to perform a byte of transfer. - * - * @param base I2C peripheral base address. - * @param handle pointer to i2c_master_handle_t structure which stores the transfer state - * @param isDone input param to get whether the thing is done, true is done - * @retval kStatus_Success No error found. - * @retval kStatus_I2C_ArbitrationLost Transfer error, arbitration lost. - * @retval kStatus_I2C_Nak Received Nak error. - * @retval kStatus_I2C_Timeout Transfer error, wait signal timeout. - */ -static status_t I2C_MasterTransferRunStateMachine(I2C_Type *base, i2c_master_handle_t *handle, bool *isDone); - -/*! - * @brief I2C common interrupt handler. - * - * @param base I2C peripheral base address. - * @param handle pointer to i2c_master_handle_t structure which stores the transfer state - */ -static void I2C_TransferCommonIRQHandler(I2C_Type *base, void *handle); - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/*! @brief Pointers to i2c handles for each instance. */ -static void *s_i2cHandle[FSL_FEATURE_SOC_I2C_COUNT]; - -/*! @brief SCL clock divider used to calculate baudrate. */ -static const uint16_t s_i2cDividerTable[] = { - 20, 22, 24, 26, 28, 30, 34, 40, 28, 32, 36, 40, 44, 48, 56, 68, - 48, 56, 64, 72, 80, 88, 104, 128, 80, 96, 112, 128, 144, 160, 192, 240, - 160, 192, 224, 256, 288, 320, 384, 480, 320, 384, 448, 512, 576, 640, 768, 960, - 640, 768, 896, 1024, 1152, 1280, 1536, 1920, 1280, 1536, 1792, 2048, 2304, 2560, 3072, 3840}; - -/*! @brief Pointers to i2c IRQ number for each instance. */ -static const IRQn_Type s_i2cIrqs[] = I2C_IRQS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to i2c clocks for each instance. */ -static const clock_ip_name_t s_i2cClocks[] = I2C_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/*! @brief Pointer to master IRQ handler for each instance. */ -static i2c_isr_t s_i2cMasterIsr; - -/*! @brief Pointer to slave IRQ handler for each instance. */ -static i2c_isr_t s_i2cSlaveIsr; - -/*! @brief Pointers to i2c bases for each instance. */ -static I2C_Type *const s_i2cBases[] = I2C_BASE_PTRS; -/******************************************************************************* - * Codes - ******************************************************************************/ - -/*! - * brief Get instance number for I2C module. - * - * param base I2C peripheral base address. - */ -uint32_t I2C_GetInstance(I2C_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_i2cBases); instance++) - { - if (s_i2cBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_i2cBases)); - - return instance; -} - -static void I2C_SetHoldTime(I2C_Type *base, uint32_t sclStopHoldTime_ns, uint32_t sourceClock_Hz) -{ - uint32_t multiplier; - uint32_t computedSclHoldTime; - uint32_t absError; - uint32_t bestError = UINT32_MAX; - uint32_t bestMult = 0u; - uint32_t bestIcr = 0u; - uint32_t u32flag = 1u; - uint8_t mult; - uint8_t i; - - /* Search for the settings with the lowest error. Mult is the MULT field of the I2C_F register, - * and ranges from 0-2. It selects the multiplier factor for the divider. */ - /* SDA hold time = bus period (s) * mul * SDA hold value. */ - /* SCL start hold time = bus period (s) * mul * SCL start hold value. */ - /* SCL stop hold time = bus period (s) * mul * SCL stop hold value. */ - - for (mult = 0u; mult <= 2u; ++mult) - { - if (bestError == 0u) - { - break; - } - - multiplier = u32flag << mult; - - /* Scan table to find best match. */ - for (i = 0u; i < sizeof(s_i2cDividerTable) / sizeof(s_i2cDividerTable[0]); ++i) - { - /* Assume SCL hold(stop) value = s_i2cDividerTable[i]/2. */ - computedSclHoldTime = ((multiplier * s_i2cDividerTable[i]) * 500000U) / (sourceClock_Hz / 1000U); - absError = sclStopHoldTime_ns > computedSclHoldTime ? (sclStopHoldTime_ns - computedSclHoldTime) : - (computedSclHoldTime - sclStopHoldTime_ns); - - if (absError < bestError) - { - bestMult = mult; - bestIcr = i; - bestError = absError; - - /* If the error is 0, then we can stop searching because we won't find a better match. */ - if (absError == 0u) - { - break; - } - } - } - } - - /* Set frequency register based on best settings. */ - base->F = I2C_F_MULT(bestMult) | I2C_F_ICR(bestIcr); -} - -#if defined(I2C_MASTER_FACK_CONTROL) && I2C_MASTER_FACK_CONTROL -static void I2C_MasterAckByte(I2C_Type *base) -{ - /* Clear the TXAK flag. */ - base->C1 &= ~(uint8_t)I2C_C1_TXAK_MASK; - - /* Delay at least one bit time */ - SDK_DelayAtLeastUs(1000000 / g_baudrate, SystemCoreClock); - - /* Do dummy read. */ - (void)base->D; -} -#endif - -static status_t I2C_InitTransferStateMachine(I2C_Type *base, i2c_master_handle_t *handle, i2c_master_transfer_t *xfer) -{ - status_t result = kStatus_Success; - i2c_direction_t direction = xfer->direction; - - /* Initialize the handle transfer information. */ - handle->transfer = *xfer; - - /* Save total transfer size. */ - handle->transferSize = xfer->dataSize; - - /* Initial transfer state. */ - if (handle->transfer.subaddressSize > 0u) - { - if (xfer->direction == kI2C_Read) - { - direction = kI2C_Write; - } - } - - handle->state = (uint8_t)kCheckAddressState; - - /* Clear all status before transfer. */ - I2C_MasterClearStatusFlags(base, (uint32_t)kClearFlags); - - /* Handle no start option. */ - if (0U != (handle->transfer.flags & (uint32_t)kI2C_TransferNoStartFlag)) - { - /* No need to send start flag, directly go to send command or data */ - if (handle->transfer.subaddressSize > 0u) - { - handle->state = (uint8_t)kSendCommandState; - } - else - { - if (direction == kI2C_Write) - { - /* Next state, send data. */ - handle->state = (uint8_t)kSendDataState; - } - else - { - /* Only support write with no stop signal. */ - return kStatus_InvalidArgument; - } - } - - /* Wait for TCF bit and manually trigger tx interrupt. */ -#if I2C_RETRY_TIMES != 0U - uint32_t waitTimes = I2C_RETRY_TIMES; - while ((0U == (base->S & (uint8_t)kI2C_TransferCompleteFlag)) && (0U != waitTimes)) - { - waitTimes--; - } - if (0U == waitTimes) - { - return kStatus_I2C_Timeout; - } -#else - while (0U == (base->S & (uint8_t)kI2C_TransferCompleteFlag)) - { - } -#endif - I2C_MasterTransferHandleIRQ(base, handle); - } - /* If repeated start is requested, send repeated start. */ - else if (0U != (handle->transfer.flags & (uint32_t)kI2C_TransferRepeatedStartFlag)) - { - result = I2C_MasterRepeatedStart(base, handle->transfer.slaveAddress, direction); - } - else /* For normal transfer, send start. */ - { - result = I2C_MasterStart(base, handle->transfer.slaveAddress, direction); - } - - return result; -} - -static status_t I2C_CheckAndClearError(I2C_Type *base, uint32_t status) -{ - status_t result = kStatus_Success; - - /* Check arbitration lost. */ - if (0U != (status & (uint32_t)kI2C_ArbitrationLostFlag)) - { - /* Clear arbitration lost flag. */ - base->S = (uint8_t)kI2C_ArbitrationLostFlag; - result = kStatus_I2C_ArbitrationLost; - } - /* Check NAK */ - else if (0U != (status & (uint32_t)kI2C_ReceiveNakFlag)) - { - result = kStatus_I2C_Nak; - } - else - { - /* Add this to fix MISRA C2012 rule15.7 issue: Empty else without comment. */ - } - - return result; -} - -static status_t I2C_MasterTransferRunStateMachine(I2C_Type *base, i2c_master_handle_t *handle, bool *isDone) -{ - status_t result = kStatus_Success; - uint32_t statusFlags = base->S; - *isDone = false; - uint32_t tmpDataSize = handle->transfer.dataSize; - bool ignoreNak = ((handle->state == (uint8_t)kSendDataState) && (tmpDataSize == 0U)) || - ((handle->state == (uint8_t)kReceiveDataState) && (tmpDataSize == 1U)); - uint8_t tmpdata; - - /* Check & clear error flags. */ - result = I2C_CheckAndClearError(base, statusFlags); - - /* Ignore Nak when it's appeared for last byte. */ - if ((result == kStatus_I2C_Nak) && ignoreNak) - { - result = kStatus_Success; - } - - /* Handle Check address state to check the slave address is Acked in slave - probe application. */ - if (handle->state == (uint8_t)kCheckAddressState) - { - if (0U != (statusFlags & (uint8_t)kI2C_ReceiveNakFlag)) - { - result = kStatus_I2C_Addr_Nak; - } - else - { - if (handle->transfer.subaddressSize > 0U) - { - handle->state = (uint8_t)kSendCommandState; - } - else - { - if (handle->transfer.direction == kI2C_Write) - { - /* Next state, send data. */ - handle->state = (uint8_t)kSendDataState; - } - else - { - /* Next state, receive data begin. */ - handle->state = (uint8_t)kReceiveDataBeginState; - } - } - } - } - - if (kStatus_Success != result) - { - return result; - } - - /* Run state machine. */ - switch (handle->state) - { - /* Send I2C command. */ - case (uint8_t)kSendCommandState: - if (0U != (handle->transfer.subaddressSize)) - { - handle->transfer.subaddressSize--; - base->D = (uint8_t)((handle->transfer.subaddress) >> (8U * handle->transfer.subaddressSize)); - } - else - { - if (handle->transfer.direction == kI2C_Write) - { - /* Send first byte of data. */ - if (handle->transfer.dataSize > 0U) - { - /* Next state, send data. */ - handle->state = (uint8_t)kSendDataState; - base->D = *handle->transfer.data; - handle->transfer.data++; - handle->transfer.dataSize--; - } - else - { - *isDone = true; - } - } - else - { - /* Send repeated start and slave address. */ - result = I2C_MasterRepeatedStart(base, handle->transfer.slaveAddress, kI2C_Read); - - /* Next state, receive data begin. */ - handle->state = (uint8_t)kReceiveDataBeginState; - } - } - break; - - /* Send I2C data. */ - case (uint8_t)kSendDataState: - /* Send one byte of data. */ - if (handle->transfer.dataSize > 0U) - { - base->D = *handle->transfer.data; - handle->transfer.data++; - handle->transfer.dataSize--; - } - else - { - *isDone = true; - } - break; - - /* Start I2C data receive. */ - case (uint8_t)kReceiveDataBeginState: - -#if defined(I2C_MASTER_FACK_CONTROL) && I2C_MASTER_FACK_CONTROL - base->SMB |= I2C_SMB_FACK_MASK; -#endif - - base->C1 &= ~(uint8_t)(I2C_C1_TX_MASK | I2C_C1_TXAK_MASK); - - /* Read dummy to release the bus. */ - (void)base->D; - - if (handle->transfer.dataSize == 1U) - { - /* Issue NACK on read. */ - base->C1 |= I2C_C1_TXAK_MASK; -#if defined(I2C_MASTER_FACK_CONTROL) && I2C_MASTER_FACK_CONTROL - base->SMB &= ~(uint8_t)I2C_SMB_FACK_MASK; -#endif - } - - /* Next state, receive data. */ - handle->state = (uint8_t)kReceiveDataState; - break; - - /* Receive I2C data. */ - case (uint8_t)kReceiveDataState: - /* Receive one byte of data. */ - if (0U != (handle->transfer.dataSize--)) - { - if (handle->transfer.dataSize == 0U) - { - *isDone = true; - - /* Send stop if kI2C_TransferNoStop is not asserted. */ - if (0U == (handle->transfer.flags & (uint32_t)kI2C_TransferNoStopFlag)) - { - result = I2C_MasterStop(base); - } - else - { - base->C1 |= I2C_C1_TX_MASK; - } - } - - /* Read the data byte into the transfer buffer. */ - tmpdata = base->D; - *handle->transfer.data = tmpdata; - handle->transfer.data++; - -#if defined(I2C_MASTER_FACK_CONTROL) && I2C_MASTER_FACK_CONTROL - if (handle->transfer.dataSize != 0U) - { - I2C_MasterAckByte(base); - } -#endif - if (handle->transfer.dataSize == 1U) - { - /* Issue NACK on read. */ - base->C1 |= I2C_C1_TXAK_MASK; -#if defined(I2C_MASTER_FACK_CONTROL) && I2C_MASTER_FACK_CONTROL - base->SMB &= ~(uint8_t)I2C_SMB_FACK_MASK; -#endif - } - } - - break; - - default: - /* Add this to fix MISRA C2012 rule 16.4 issue: Empty default. */ - assert(false); - break; - } - - return result; -} - -static void I2C_TransferCommonIRQHandler(I2C_Type *base, void *handle) -{ - uint8_t tmpS = base->S; - uint8_t tmpC1 = base->C1; - - /* Check if master interrupt. */ - if ((0U != (tmpC1 & I2C_C1_MST_MASK)) || (0U != (tmpS & (uint8_t)kI2C_ArbitrationLostFlag))) - { - s_i2cMasterIsr(base, handle); - } - else - { - s_i2cSlaveIsr(base, handle); - } - SDK_ISR_EXIT_BARRIER; -} - -/*! - * brief Initializes the I2C peripheral. Call this API to ungate the I2C clock - * and configure the I2C with master configuration. - * - * note This API should be called at the beginning of the application. - * Otherwise, any operation to the I2C module can cause a hard fault - * because the clock is not enabled. The configuration structure can be custom filled - * or it can be set with default values by using the I2C_MasterGetDefaultConfig(). - * After calling this API, the master is ready to transfer. - * This is an example. - * code - * i2c_master_config_t config = { - * .enableMaster = true, - * .enableStopHold = false, - * .highDrive = false, - * .baudRate_Bps = 100000, - * .glitchFilterWidth = 0 - * }; - * I2C_MasterInit(I2C0, &config, 12000000U); - * endcode - * - * param base I2C base pointer - * param masterConfig A pointer to the master configuration structure - * param srcClock_Hz I2C peripheral clock frequency in Hz - */ -void I2C_MasterInit(I2C_Type *base, const i2c_master_config_t *masterConfig, uint32_t srcClock_Hz) -{ - assert(NULL != masterConfig); - assert(0U != srcClock_Hz); - - /* Temporary register for filter read. */ - uint8_t fltReg; -#if defined(FSL_FEATURE_I2C_HAS_DOUBLE_BUFFER_ENABLE) && FSL_FEATURE_I2C_HAS_DOUBLE_BUFFER_ENABLE - uint8_t s2Reg; -#endif -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable I2C clock. */ - CLOCK_EnableClock(s_i2cClocks[I2C_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Reset the module. */ - base->A1 = 0; - base->F = 0; - base->C1 = 0; - base->S = 0xFFU; - base->C2 = 0; -#if defined(FSL_FEATURE_I2C_HAS_START_STOP_DETECT) && FSL_FEATURE_I2C_HAS_START_STOP_DETECT - base->FLT = 0x50U; -#elif defined(FSL_FEATURE_I2C_HAS_STOP_DETECT) && FSL_FEATURE_I2C_HAS_STOP_DETECT - base->FLT = 0x40U; -#endif - base->RA = 0; - - /* Disable I2C prior to configuring it. */ - base->C1 &= ~(uint8_t)(I2C_C1_IICEN_MASK); - - /* Clear all flags. */ - I2C_MasterClearStatusFlags(base, (uint32_t)kClearFlags); - - /* Configure baud rate. */ - I2C_MasterSetBaudRate(base, masterConfig->baudRate_Bps, srcClock_Hz); - - /* Read out the FLT register. */ - fltReg = base->FLT; - -#if defined(FSL_FEATURE_I2C_HAS_STOP_HOLD_OFF) && FSL_FEATURE_I2C_HAS_STOP_HOLD_OFF - /* Configure the stop / hold enable. */ - fltReg &= ~(uint8_t)(I2C_FLT_SHEN_MASK); - fltReg |= I2C_FLT_SHEN(masterConfig->enableStopHold); -#endif - - /* Configure the glitch filter value. */ - fltReg &= ~(uint8_t)(I2C_FLT_FLT_MASK); - fltReg |= I2C_FLT_FLT(masterConfig->glitchFilterWidth); - - /* Write the register value back to the filter register. */ - base->FLT = fltReg; - - /* Enable the I2C peripheral based on the configuration. */ - base->C1 = I2C_C1_IICEN(masterConfig->enableMaster); - - /* Enable/Disable double buffering. */ -#if defined(FSL_FEATURE_I2C_HAS_DOUBLE_BUFFER_ENABLE) && FSL_FEATURE_I2C_HAS_DOUBLE_BUFFER_ENABLE - s2Reg = (uint8_t)(base->S2 & (~I2C_S2_DFEN_MASK)); - base->S2 = s2Reg | I2C_S2_DFEN(masterConfig->enableDoubleBuffering); -#endif -} - -/*! - * brief De-initializes the I2C master peripheral. Call this API to gate the I2C clock. - * The I2C master module can't work unless the I2C_MasterInit is called. - * param base I2C base pointer - */ -void I2C_MasterDeinit(I2C_Type *base) -{ - /* Disable I2C module. */ - I2C_Enable(base, false); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable I2C clock. */ - CLOCK_DisableClock(s_i2cClocks[I2C_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Sets the I2C master configuration structure to default values. - * - * The purpose of this API is to get the configuration structure initialized for use in the I2C_MasterConfigure(). - * Use the initialized structure unchanged in the I2C_MasterConfigure() or modify - * the structure before calling the I2C_MasterConfigure(). - * This is an example. - * code - * i2c_master_config_t config; - * I2C_MasterGetDefaultConfig(&config); - * endcode - * param masterConfig A pointer to the master configuration structure. - */ -void I2C_MasterGetDefaultConfig(i2c_master_config_t *masterConfig) -{ - assert(NULL != masterConfig); - - /* Initializes the configure structure to zero. */ - (void)memset(masterConfig, 0, sizeof(*masterConfig)); - - /* Default baud rate at 100kbps. */ - masterConfig->baudRate_Bps = 100000U; - -/* Default stop hold enable is disabled. */ -#if defined(FSL_FEATURE_I2C_HAS_STOP_HOLD_OFF) && FSL_FEATURE_I2C_HAS_STOP_HOLD_OFF - masterConfig->enableStopHold = false; -#endif - - /* Default glitch filter value is no filter. */ - masterConfig->glitchFilterWidth = 0U; - -/* Default enable double buffering. */ -#if defined(FSL_FEATURE_I2C_HAS_DOUBLE_BUFFER_ENABLE) && FSL_FEATURE_I2C_HAS_DOUBLE_BUFFER_ENABLE - masterConfig->enableDoubleBuffering = true; -#endif - - /* Enable the I2C peripheral. */ - masterConfig->enableMaster = true; -} - -/*! - * brief Enables I2C interrupt requests. - * - * param base I2C base pointer - * param mask interrupt source - * The parameter can be combination of the following source if defined: - * arg kI2C_GlobalInterruptEnable - * arg kI2C_StopDetectInterruptEnable/kI2C_StartDetectInterruptEnable - * arg kI2C_SdaTimeoutInterruptEnable - */ -void I2C_EnableInterrupts(I2C_Type *base, uint32_t mask) -{ -#ifdef I2C_HAS_STOP_DETECT - uint8_t fltReg; -#endif - - if (0U != (mask & (uint32_t)kI2C_GlobalInterruptEnable)) - { - base->C1 |= I2C_C1_IICIE_MASK; - } - -#if defined(FSL_FEATURE_I2C_HAS_STOP_DETECT) && FSL_FEATURE_I2C_HAS_STOP_DETECT - if (0U != (mask & (uint32_t)kI2C_StopDetectInterruptEnable)) - { - fltReg = base->FLT; - - /* Keep STOPF flag. */ - fltReg &= ~I2C_FLT_STOPF_MASK; - - /* Stop detect enable. */ - fltReg |= I2C_FLT_STOPIE_MASK; - base->FLT = fltReg; - } -#endif /* FSL_FEATURE_I2C_HAS_STOP_DETECT */ - -#if defined(FSL_FEATURE_I2C_HAS_START_STOP_DETECT) && FSL_FEATURE_I2C_HAS_START_STOP_DETECT - if (0U != (mask & (uint32_t)kI2C_StartStopDetectInterruptEnable)) - { - fltReg = base->FLT; - - /* Keep STARTF and STOPF flags. */ - fltReg &= ~(uint8_t)(I2C_FLT_STOPF_MASK | I2C_FLT_STARTF_MASK); - - /* Start and stop detect enable. */ - fltReg |= I2C_FLT_SSIE_MASK; - base->FLT = fltReg; - } -#endif /* FSL_FEATURE_I2C_HAS_START_STOP_DETECT */ -} - -/*! - * brief Disables I2C interrupt requests. - * - * param base I2C base pointer - * param mask interrupt source - * The parameter can be combination of the following source if defined: - * arg kI2C_GlobalInterruptEnable - * arg kI2C_StopDetectInterruptEnable/kI2C_StartDetectInterruptEnable - * arg kI2C_SdaTimeoutInterruptEnable - */ -void I2C_DisableInterrupts(I2C_Type *base, uint32_t mask) -{ - if (0U != (mask & (uint32_t)kI2C_GlobalInterruptEnable)) - { - base->C1 &= ~(uint8_t)I2C_C1_IICIE_MASK; - } - -#if defined(FSL_FEATURE_I2C_HAS_STOP_DETECT) && FSL_FEATURE_I2C_HAS_STOP_DETECT - if (0U != (mask & (uint32_t)kI2C_StopDetectInterruptEnable)) - { - base->FLT &= ~(I2C_FLT_STOPIE_MASK | I2C_FLT_STOPF_MASK); - } -#endif /* FSL_FEATURE_I2C_HAS_STOP_DETECT */ - -#if defined(FSL_FEATURE_I2C_HAS_START_STOP_DETECT) && FSL_FEATURE_I2C_HAS_START_STOP_DETECT - if (0U != (mask & (uint32_t)kI2C_StartStopDetectInterruptEnable)) - { - base->FLT &= ~(uint8_t)(I2C_FLT_SSIE_MASK | I2C_FLT_STOPF_MASK | I2C_FLT_STARTF_MASK); - } -#endif /* FSL_FEATURE_I2C_HAS_START_STOP_DETECT */ -} - -/*! - * brief Sets the I2C master transfer baud rate. - * - * param base I2C base pointer - * param baudRate_Bps the baud rate value in bps - * param srcClock_Hz Source clock - */ -void I2C_MasterSetBaudRate(I2C_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz) -{ - uint32_t multiplier; - uint32_t computedRate; - uint32_t absError; - uint32_t bestError = UINT32_MAX; - uint32_t bestMult = 0u; - uint32_t bestIcr = 0u; - uint32_t u32flag = 1u; - uint8_t mult; - uint8_t i; - - /* Search for the settings with the lowest error. Mult is the MULT field of the I2C_F register, - * and ranges from 0-2. It selects the multiplier factor for the divider. */ - for (mult = 0u; mult <= 2u; ++mult) - { - if (bestError == 0u) - { - break; - } - - multiplier = u32flag << mult; - - /* Scan table to find best match. */ - for (i = 0u; i < sizeof(s_i2cDividerTable) / sizeof(uint16_t); ++i) - { - computedRate = srcClock_Hz / (multiplier * s_i2cDividerTable[i]); - absError = baudRate_Bps > computedRate ? (baudRate_Bps - computedRate) : (computedRate - baudRate_Bps); - - if (absError < bestError) - { - bestMult = mult; - bestIcr = i; - bestError = absError; - - /* If the error is 0, then we can stop searching because we won't find a better match. */ - if (absError == 0u) - { - break; - } - } - } - } - -#if defined(I2C_MASTER_FACK_CONTROL) && I2C_MASTER_FACK_CONTROL - g_baudrate = baudRate_Bps; -#endif - /* Set frequency register based on best settings. */ - base->F = I2C_F_MULT(bestMult) | I2C_F_ICR(bestIcr); -} - -/*! - * brief Sends a START on the I2C bus. - * - * This function is used to initiate a new master mode transfer by sending the START signal. - * The slave address is sent following the I2C START signal. - * - * param base I2C peripheral base pointer - * param address 7-bit slave device address. - * param direction Master transfer directions(transmit/receive). - * retval kStatus_Success Successfully send the start signal. - * retval kStatus_I2C_Busy Current bus is busy. - */ -status_t I2C_MasterStart(I2C_Type *base, uint8_t address, i2c_direction_t direction) -{ - status_t result = kStatus_Success; - uint32_t statusFlags = I2C_MasterGetStatusFlags(base); - - /* Return an error if the bus is already in use. */ - if (0U != (statusFlags & (uint32_t)kI2C_BusBusyFlag)) - { - result = kStatus_I2C_Busy; - } - else - { - /* Send the START signal. */ - base->C1 |= I2C_C1_MST_MASK | I2C_C1_TX_MASK; - -#if defined(FSL_FEATURE_I2C_HAS_DOUBLE_BUFFERING) && FSL_FEATURE_I2C_HAS_DOUBLE_BUFFERING -#if I2C_RETRY_TIMES != 0U - uint32_t waitTimes = I2C_RETRY_TIMES; - while ((0U == (base->S2 & I2C_S2_EMPTY_MASK)) && (0U != waitTimes)) - { - waitTimes--; - } - if (0U == waitTimes) - { - return kStatus_I2C_Timeout; - } -#else - while (0U == (base->S2 & I2C_S2_EMPTY_MASK)) - { - } -#endif -#endif /* FSL_FEATURE_I2C_HAS_DOUBLE_BUFFERING */ - - base->D = (uint8_t)(((uint32_t)address) << 1U | ((direction == kI2C_Read) ? 1U : 0U)); - } - - return result; -} - -/*! - * brief Sends a REPEATED START on the I2C bus. - * - * param base I2C peripheral base pointer - * param address 7-bit slave device address. - * param direction Master transfer directions(transmit/receive). - * retval kStatus_Success Successfully send the start signal. - * retval kStatus_I2C_Busy Current bus is busy but not occupied by current I2C master. - */ -status_t I2C_MasterRepeatedStart(I2C_Type *base, uint8_t address, i2c_direction_t direction) -{ - status_t result = kStatus_Success; - uint8_t savedMult; - uint32_t statusFlags = I2C_MasterGetStatusFlags(base); - uint8_t timeDelay = 6; - - /* Return an error if the bus is already in use, but not by us. */ - if ((0U == (base->C1 & I2C_C1_MST_MASK)) && (0U != (statusFlags & (uint32_t)kI2C_BusBusyFlag))) - { - result = kStatus_I2C_Busy; - } - else - { - savedMult = base->F; - base->F = savedMult & (~(uint8_t)I2C_F_MULT_MASK); - - /* We are already in a transfer, so send a repeated start. */ - base->C1 |= I2C_C1_RSTA_MASK | I2C_C1_TX_MASK; - - /* Restore the multiplier factor. */ - base->F = savedMult; - - /* Add some delay to wait the Re-Start signal. */ - while (0U != (timeDelay--)) - { - __NOP(); - } - -#if defined(FSL_FEATURE_I2C_HAS_DOUBLE_BUFFERING) && FSL_FEATURE_I2C_HAS_DOUBLE_BUFFERING -#if I2C_RETRY_TIMES != 0U - uint32_t waitTimes = I2C_RETRY_TIMES; - while ((0U == (base->S2 & I2C_S2_EMPTY_MASK)) && (0U != waitTimes)) - { - waitTimes--; - } - if (0U == waitTimes) - { - return kStatus_I2C_Timeout; - } -#else - while (0U == (base->S2 & I2C_S2_EMPTY_MASK)) - { - } -#endif -#endif /* FSL_FEATURE_I2C_HAS_DOUBLE_BUFFERING */ - - base->D = (uint8_t)(((uint32_t)address) << 1U | ((direction == kI2C_Read) ? 1U : 0U)); - } - - return result; -} - -/*! - * brief Sends a STOP signal on the I2C bus. - * - * retval kStatus_Success Successfully send the stop signal. - * retval kStatus_I2C_Timeout Send stop signal failed, timeout. - */ -status_t I2C_MasterStop(I2C_Type *base) -{ - status_t result = kStatus_Success; - - /* Issue the STOP command on the bus. */ - base->C1 &= ~(uint8_t)(I2C_C1_MST_MASK | I2C_C1_TX_MASK | I2C_C1_TXAK_MASK); - -#if I2C_RETRY_TIMES != 0U - uint32_t waitTimes = I2C_RETRY_TIMES; - /* Wait until bus not busy. */ - while ((0U != (base->S & (uint8_t)kI2C_BusBusyFlag)) && (0U != waitTimes)) - { - waitTimes--; - } - - if (0U == waitTimes) - { - result = kStatus_I2C_Timeout; - } -#else - /* Wait until data transfer complete. */ - while (0U != (base->S & (uint8_t)kI2C_BusBusyFlag)) - { - } -#endif - - return result; -} - -/*! - * brief Gets the I2C status flags. - * - * param base I2C base pointer - * return status flag, use status flag to AND #_i2c_flags to get the related status. - */ -uint32_t I2C_MasterGetStatusFlags(I2C_Type *base) -{ - uint32_t statusFlags = base->S; - -#ifdef I2C_HAS_STOP_DETECT - /* Look up the STOPF bit from the filter register. */ - if (0U != (base->FLT & I2C_FLT_STOPF_MASK)) - { - statusFlags |= (uint32_t)kI2C_StopDetectFlag; - } -#endif - -#if defined(FSL_FEATURE_I2C_HAS_START_STOP_DETECT) && FSL_FEATURE_I2C_HAS_START_STOP_DETECT - /* Look up the STARTF bit from the filter register. */ - if (0U != (base->FLT & I2C_FLT_STARTF_MASK)) - { - statusFlags |= (uint32_t)kI2C_StartDetectFlag; - } -#endif /* FSL_FEATURE_I2C_HAS_START_STOP_DETECT */ - - return statusFlags; -} - -/*! - * brief Performs a polling send transaction on the I2C bus. - * - * param base The I2C peripheral base pointer. - * param txBuff The pointer to the data to be transferred. - * param txSize The length in bytes of the data to be transferred. - * param flags Transfer control flag to decide whether need to send a stop, use kI2C_TransferDefaultFlag - * to issue a stop and kI2C_TransferNoStop to not send a stop. - * retval kStatus_Success Successfully complete the data transmission. - * retval kStatus_I2C_ArbitrationLost Transfer error, arbitration lost. - * retval kStataus_I2C_Nak Transfer error, receive NAK during transfer. - */ -status_t I2C_MasterWriteBlocking(I2C_Type *base, const uint8_t *txBuff, size_t txSize, uint32_t flags) -{ - status_t result = kStatus_Success; - uint8_t statusFlags = 0; - -#if I2C_RETRY_TIMES != 0U - uint32_t waitTimes = I2C_RETRY_TIMES; - /* Wait until the data register is ready for transmit. */ - while ((0U == (base->S & (uint8_t)kI2C_TransferCompleteFlag)) && (0U != waitTimes)) - { - waitTimes--; - } - if (0U == waitTimes) - { - return kStatus_I2C_Timeout; - } -#else - /* Wait until the data register is ready for transmit. */ - while (0U == (base->S & (uint8_t)kI2C_TransferCompleteFlag)) - { - } -#endif - - /* Clear the IICIF flag. */ - base->S = (uint8_t)kI2C_IntPendingFlag; - - /* Setup the I2C peripheral to transmit data. */ - base->C1 |= I2C_C1_TX_MASK; - - while (0U != (txSize--)) - { - /* Send a byte of data. */ - base->D = *txBuff++; - -#if I2C_RETRY_TIMES != 0U - waitTimes = I2C_RETRY_TIMES; - /* Wait until data transfer complete. */ - while ((0U == (base->S & (uint8_t)kI2C_IntPendingFlag)) && (0U != waitTimes)) - { - waitTimes--; - } - if (0U == waitTimes) - { - return kStatus_I2C_Timeout; - } -#else - /* Wait until data transfer complete. */ - while (0U == (base->S & (uint8_t)kI2C_IntPendingFlag)) - { - } -#endif - statusFlags = base->S; - - /* Clear the IICIF flag. */ - base->S = (uint8_t)kI2C_IntPendingFlag; - - /* Check if arbitration lost or no acknowledgement (NAK), return failure status. */ - if (0U != (statusFlags & (uint8_t)kI2C_ArbitrationLostFlag)) - { - base->S = (uint8_t)kI2C_ArbitrationLostFlag; - result = kStatus_I2C_ArbitrationLost; - } - - if ((0U != (statusFlags & (uint8_t)kI2C_ReceiveNakFlag)) && (0U != txSize)) - { - base->S = (uint8_t)kI2C_ReceiveNakFlag; - result = kStatus_I2C_Nak; - } - - if (result != kStatus_Success) - { - /* Breaking out of the send loop. */ - break; - } - } - - if (((result == kStatus_Success) && (0U == (flags & (uint32_t)kI2C_TransferNoStopFlag))) || - (result == kStatus_I2C_Nak)) - { - /* Clear the IICIF flag. */ - base->S = (uint8_t)kI2C_IntPendingFlag; - - /* Send stop. */ - result = I2C_MasterStop(base); - } - - return result; -} - -/*! - * brief Performs a polling receive transaction on the I2C bus. - * - * note The I2C_MasterReadBlocking function stops the bus before reading the final byte. - * Without stopping the bus prior for the final read, the bus issues another read, resulting - * in garbage data being read into the data register. - * - * param base I2C peripheral base pointer. - * param rxBuff The pointer to the data to store the received data. - * param rxSize The length in bytes of the data to be received. - * param flags Transfer control flag to decide whether need to send a stop, use kI2C_TransferDefaultFlag - * to issue a stop and kI2C_TransferNoStop to not send a stop. - * retval kStatus_Success Successfully complete the data transmission. - * retval kStatus_I2C_Timeout Send stop signal failed, timeout. - */ -status_t I2C_MasterReadBlocking(I2C_Type *base, uint8_t *rxBuff, size_t rxSize, uint32_t flags) -{ - status_t result = kStatus_Success; - -#if I2C_RETRY_TIMES != 0U - uint32_t waitTimes = I2C_RETRY_TIMES; - /* Wait until the data register is ready for transmit. */ - while ((0U == (base->S & (uint8_t)kI2C_TransferCompleteFlag)) && (0U != waitTimes)) - { - waitTimes--; - } - if (0U == waitTimes) - { - return kStatus_I2C_Timeout; - } -#else - /* Wait until the data register is ready for transmit. */ - while (0U == (base->S & (uint8_t)kI2C_TransferCompleteFlag)) - { - } -#endif - - /* Clear the IICIF flag. */ - base->S = (uint8_t)kI2C_IntPendingFlag; - -#if defined(I2C_MASTER_FACK_CONTROL) && I2C_MASTER_FACK_CONTROL - base->SMB |= I2C_SMB_FACK_MASK; -#endif - - /* Setup the I2C peripheral to receive data. */ - base->C1 &= ~(uint8_t)(I2C_C1_TX_MASK | I2C_C1_TXAK_MASK); - - /* Do dummy read. */ - (void)base->D; - - if (rxSize == 1U) - { - /* Issue NACK on read. */ - base->C1 |= I2C_C1_TXAK_MASK; -#if defined(I2C_MASTER_FACK_CONTROL) && I2C_MASTER_FACK_CONTROL - base->SMB &= ~(uint8_t)I2C_SMB_FACK_MASK; -#endif - } - - while (0U != (rxSize--)) - { -#if I2C_RETRY_TIMES != 0U - waitTimes = I2C_RETRY_TIMES; - /* Wait until data transfer complete. */ - while ((0U == (base->S & (uint8_t)kI2C_IntPendingFlag)) && (0U != waitTimes)) - { - waitTimes--; - } - if (0U == waitTimes) - { - return kStatus_I2C_Timeout; - } -#else - /* Wait until data transfer complete. */ - while (0U == (base->S & (uint8_t)kI2C_IntPendingFlag)) - { - } -#endif - - if (rxSize == 0U) - { - if (0U == (flags & (uint32_t)kI2C_TransferNoStopFlag)) - { - /* Issue STOP command before reading last byte. */ - result = I2C_MasterStop(base); - } - else - { - /* Change direction to Tx to avoid extra clocks. */ - base->C1 |= I2C_C1_TX_MASK; - } - } - - /* Clear the IICIF flag. */ - base->S = (uint8_t)kI2C_IntPendingFlag; - - /* Read from the data register. */ - *rxBuff++ = base->D; - -#if defined(I2C_MASTER_FACK_CONTROL) && I2C_MASTER_FACK_CONTROL - if (rxSize != 0U) - { - I2C_MasterAckByte(base); - } -#endif - - if (rxSize == 1U) - { - base->C1 |= I2C_C1_TXAK_MASK; -#if defined(I2C_MASTER_FACK_CONTROL) && I2C_MASTER_FACK_CONTROL - /* Issue NACK on read. */ - base->SMB &= ~(uint8_t)I2C_SMB_FACK_MASK; -#endif - } - } - - return result; -} - -/*! - * brief Performs a master polling transfer on the I2C bus. - * - * note The API does not return until the transfer succeeds or fails due - * to arbitration lost or receiving a NAK. - * - * param base I2C peripheral base address. - * param xfer Pointer to the transfer structure. - * retval kStatus_Success Successfully complete the data transmission. - * retval kStatus_I2C_Busy Previous transmission still not finished. - * retval kStatus_I2C_Timeout Transfer error, wait signal timeout. - * retval kStatus_I2C_ArbitrationLost Transfer error, arbitration lost. - * retval kStataus_I2C_Nak Transfer error, receive NAK during transfer. - */ -status_t I2C_MasterTransferBlocking(I2C_Type *base, i2c_master_transfer_t *xfer) -{ - assert(NULL != xfer); - - i2c_direction_t direction = xfer->direction; - status_t result = kStatus_Success; - - /* Clear all status before transfer. */ - I2C_MasterClearStatusFlags(base, (uint32_t)kClearFlags); - -#if I2C_RETRY_TIMES != 0U - uint32_t waitTimes = I2C_RETRY_TIMES; - /* Wait until the data register is ready for transmit. */ - while ((0U == (base->S & (uint8_t)kI2C_TransferCompleteFlag)) && (0U != waitTimes)) - { - waitTimes--; - } - if (0U == waitTimes) - { - return kStatus_I2C_Timeout; - } -#else - /* Wait until the data register is ready for transmit. */ - while (0U == (base->S & (uint8_t)kI2C_TransferCompleteFlag)) - { - } -#endif - - /* Change to send write address when it's a read operation with command. */ - if ((xfer->subaddressSize > 0U) && (xfer->direction == kI2C_Read)) - { - direction = kI2C_Write; - } - - /* Handle no start option, only support write with no start signal. */ - if (0U != (xfer->flags & (uint32_t)kI2C_TransferNoStartFlag)) - { - if (direction == kI2C_Read) - { - return kStatus_InvalidArgument; - } - } - /* If repeated start is requested, send repeated start. */ - else if (0U != (xfer->flags & (uint32_t)kI2C_TransferRepeatedStartFlag)) - { - result = I2C_MasterRepeatedStart(base, xfer->slaveAddress, direction); - } - else /* For normal transfer, send start. */ - { - result = I2C_MasterStart(base, xfer->slaveAddress, direction); - } - - if (0U == (xfer->flags & (uint32_t)kI2C_TransferNoStartFlag)) - { - /* Return if error. */ - if (kStatus_Success != result) - { - return result; - } - -#if I2C_RETRY_TIMES != 0U - waitTimes = I2C_RETRY_TIMES; - /* Wait until data transfer complete. */ - while ((0U == (base->S & (uint8_t)kI2C_IntPendingFlag)) && (0U != waitTimes)) - { - waitTimes--; - } - if (0U == waitTimes) - { - return kStatus_I2C_Timeout; - } -#else - /* Wait until data transfer complete. */ - while (0U == (base->S & (uint8_t)kI2C_IntPendingFlag)) - { - } -#endif - /* Check if there's transfer error. */ - result = I2C_CheckAndClearError(base, base->S); - - /* Return if error. */ - if (kStatus_Success != result) - { - if (result == kStatus_I2C_Nak) - { - result = kStatus_I2C_Addr_Nak; - - (void)I2C_MasterStop(base); - } - - return result; - } - } - - /* Send subaddress. */ - if (0U != (xfer->subaddressSize)) - { - do - { - /* Clear interrupt pending flag. */ - base->S = (uint8_t)kI2C_IntPendingFlag; - - xfer->subaddressSize--; - base->D = (uint8_t)((xfer->subaddress) >> (8U * xfer->subaddressSize)); - -#if I2C_RETRY_TIMES != 0U - waitTimes = I2C_RETRY_TIMES; - /* Wait until data transfer complete. */ - while ((0U == (base->S & (uint8_t)kI2C_IntPendingFlag)) && (0U != waitTimes)) - { - waitTimes--; - } - if (0U == waitTimes) - { - return kStatus_I2C_Timeout; - } -#else - /* Wait until data transfer complete. */ - while (0U == (base->S & (uint8_t)kI2C_IntPendingFlag)) - { - } -#endif - - /* Check if there's transfer error. */ - result = I2C_CheckAndClearError(base, base->S); - - if (0 != result) - { - if (result == kStatus_I2C_Nak) - { - (void)I2C_MasterStop(base); - } - - return result; - } - - } while (xfer->subaddressSize > 0u); - - if (xfer->direction == kI2C_Read) - { - /* Clear pending flag. */ - base->S = (uint8_t)kI2C_IntPendingFlag; - - /* Send repeated start and slave address. */ - result = I2C_MasterRepeatedStart(base, xfer->slaveAddress, kI2C_Read); - - /* Return if error. */ - if (kStatus_Success != result) - { - return result; - } - -#if I2C_RETRY_TIMES != 0U - waitTimes = I2C_RETRY_TIMES; - /* Wait until data transfer complete. */ - while ((0U == (base->S & (uint8_t)kI2C_IntPendingFlag)) && (0U != waitTimes)) - { - waitTimes--; - } - if (0U == waitTimes) - { - return kStatus_I2C_Timeout; - } -#else - /* Wait until data transfer complete. */ - while (0U == (base->S & (uint8_t)kI2C_IntPendingFlag)) - { - } -#endif - - /* Check if there's transfer error. */ - result = I2C_CheckAndClearError(base, base->S); - - if (kStatus_Success != result) - { - if (result == kStatus_I2C_Nak) - { - result = kStatus_I2C_Addr_Nak; - - (void)I2C_MasterStop(base); - } - - return result; - } - } - } - - /* Transmit data. */ - if (xfer->direction == kI2C_Write) - { - if (xfer->dataSize > 0U) - { - uint8_t *tmpData = xfer->data; - size_t tmpDataSize = xfer->dataSize; - uint32_t tmpFlags = xfer->flags; - /* Send Data. */ - result = I2C_MasterWriteBlocking(base, tmpData, tmpDataSize, tmpFlags); - } - else if (0U == (xfer->flags & (uint32_t)kI2C_TransferNoStopFlag)) - { - /* Send stop. */ - result = I2C_MasterStop(base); - } - else - { - /* Add this to fix MISRA C2012 rule15.7 issue: Empty else without comment. */ - } - } - - /* Receive Data. */ - if ((xfer->dataSize > 0u) && (xfer->direction == kI2C_Read)) - { - uint8_t *tmpData = xfer->data; - size_t tmpDataSize = xfer->dataSize; - uint32_t tmpFlags = xfer->flags; - - result = I2C_MasterReadBlocking(base, tmpData, tmpDataSize, tmpFlags); - } - - return result; -} - -/*! - * brief Initializes the I2C handle which is used in transactional functions. - * - * param base I2C base pointer. - * param handle pointer to i2c_master_handle_t structure to store the transfer state. - * param callback pointer to user callback function. - * param userData user parameter passed to the callback function. - */ -void I2C_MasterTransferCreateHandle(I2C_Type *base, - i2c_master_handle_t *handle, - i2c_master_transfer_callback_t callback, - void *userData) -{ - assert(NULL != handle); - - uint32_t instance = I2C_GetInstance(base); - - /* Zero handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Set callback and userData. */ - handle->completionCallback = callback; - handle->userData = userData; - - /* Save the context in global variables to support the double weak mechanism. */ - s_i2cHandle[instance] = handle; - - /* Save master interrupt handler. */ - s_i2cMasterIsr = I2C_MasterTransferHandleIRQ; - - /* Enable NVIC interrupt. */ - (void)EnableIRQ(s_i2cIrqs[instance]); -} - -/*! - * brief Performs a master interrupt non-blocking transfer on the I2C bus. - * - * note Calling the API returns immediately after transfer initiates. The user needs - * to call I2C_MasterGetTransferCount to poll the transfer status to check whether - * the transfer is finished. If the return status is not kStatus_I2C_Busy, the transfer - * is finished. - * - * param base I2C base pointer. - * param handle pointer to i2c_master_handle_t structure which stores the transfer state. - * param xfer pointer to i2c_master_transfer_t structure. - * retval kStatus_Success Successfully start the data transmission. - * retval kStatus_I2C_Busy Previous transmission still not finished. - * retval kStatus_I2C_Timeout Transfer error, wait signal timeout. - */ -status_t I2C_MasterTransferNonBlocking(I2C_Type *base, i2c_master_handle_t *handle, i2c_master_transfer_t *xfer) -{ - assert(NULL != handle); - assert(NULL != xfer); - - status_t result = kStatus_Success; - - /* Check if the I2C bus is idle - if not return busy status. */ - if (handle->state != (uint8_t)kIdleState) - { - result = kStatus_I2C_Busy; - } - else - { - /* Start up the master transfer state machine. */ - result = I2C_InitTransferStateMachine(base, handle, xfer); - - if (result == kStatus_Success) - { - /* Enable the I2C interrupts. */ - I2C_EnableInterrupts(base, (uint32_t)kI2C_GlobalInterruptEnable); - } - } - - return result; -} - -/*! - * brief Aborts an interrupt non-blocking transfer early. - * - * note This API can be called at any time when an interrupt non-blocking transfer initiates - * to abort the transfer early. - * - * param base I2C base pointer. - * param handle pointer to i2c_master_handle_t structure which stores the transfer state - * retval kStatus_I2C_Timeout Timeout during polling flag. - * retval kStatus_Success Successfully abort the transfer. - */ -status_t I2C_MasterTransferAbort(I2C_Type *base, i2c_master_handle_t *handle) -{ - assert(NULL != handle); - -#if I2C_RETRY_TIMES != 0U - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - - /* Disable interrupt. */ - I2C_DisableInterrupts(base, (uint32_t)kI2C_GlobalInterruptEnable); - - /* Reset the state to idle. */ - handle->state = (uint8_t)kIdleState; - - /* If the bus is already in use, but not by us */ - if (0U == (base->C1 & I2C_C1_MST_MASK)) - { - return kStatus_I2C_Busy; - } - - /* Send STOP signal. */ - if (handle->transfer.direction == kI2C_Read) - { - base->C1 |= I2C_C1_TXAK_MASK; - -#if I2C_RETRY_TIMES != 0U - /* Wait until data transfer complete. */ - while ((0U == (base->S & (uint8_t)kI2C_IntPendingFlag)) && (0U != waitTimes)) - { - waitTimes--; - } - if (0U == waitTimes) - { - return kStatus_I2C_Timeout; - } -#else - /* Wait until data transfer complete. */ - while (0U == (base->S & (uint8_t)kI2C_IntPendingFlag)) - { - } -#endif - base->S = (uint8_t)kI2C_IntPendingFlag; - - base->C1 &= ~(uint8_t)(I2C_C1_MST_MASK | I2C_C1_TX_MASK | I2C_C1_TXAK_MASK); - (void)base->D; - } - else - { -#if I2C_RETRY_TIMES != 0U - /* Wait until data transfer complete. */ - while ((0U == (base->S & (uint8_t)kI2C_IntPendingFlag)) && (0U != waitTimes)) - { - waitTimes--; - } - if (0U == waitTimes) - { - return kStatus_I2C_Timeout; - } -#else - /* Wait until data transfer complete. */ - while (0U == (base->S & (uint8_t)kI2C_IntPendingFlag)) - { - } -#endif - base->S = (uint8_t)kI2C_IntPendingFlag; - base->C1 &= ~(uint8_t)(I2C_C1_MST_MASK | I2C_C1_TX_MASK | I2C_C1_TXAK_MASK); - } - - return kStatus_Success; -} - -/*! - * brief Gets the master transfer status during a interrupt non-blocking transfer. - * - * param base I2C base pointer. - * param handle pointer to i2c_master_handle_t structure which stores the transfer state. - * param count Number of bytes transferred so far by the non-blocking transaction. - * retval kStatus_InvalidArgument count is Invalid. - * retval kStatus_Success Successfully return the count. - */ -status_t I2C_MasterTransferGetCount(I2C_Type *base, i2c_master_handle_t *handle, size_t *count) -{ - assert(NULL != handle); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - *count = handle->transferSize - handle->transfer.dataSize; - - return kStatus_Success; -} - -/*! - * brief Master interrupt handler. - * - * param base I2C base pointer. - * param i2cHandle pointer to i2c_master_handle_t structure. - */ -void I2C_MasterTransferHandleIRQ(I2C_Type *base, void *i2cHandle) -{ - assert(NULL != i2cHandle); - - i2c_master_handle_t *handle = (i2c_master_handle_t *)i2cHandle; - status_t result = kStatus_Success; - bool isDone; - - /* Clear the interrupt flag. */ - base->S = (uint8_t)kI2C_IntPendingFlag; - - /* Check transfer complete flag. */ - result = I2C_MasterTransferRunStateMachine(base, handle, &isDone); - - if ((true == isDone) || (0 != result)) - { - /* Send stop command if transfer done or received Nak. */ - if ((0U == (handle->transfer.flags & (uint32_t)kI2C_TransferNoStopFlag)) || (result == kStatus_I2C_Nak) || - (result == kStatus_I2C_Addr_Nak)) - { - /* Ensure stop command is a need. */ - if (0U != (base->C1 & I2C_C1_MST_MASK)) - { - if (I2C_MasterStop(base) != kStatus_Success) - { - result = kStatus_I2C_Timeout; - } - } - } - - /* Restore handle to idle state. */ - handle->state = (uint8_t)kIdleState; - - /* Disable interrupt. */ - I2C_DisableInterrupts(base, (uint32_t)kI2C_GlobalInterruptEnable); - - /* Call the callback function after the function has completed. */ - if (NULL != (handle->completionCallback)) - { - handle->completionCallback(base, handle, result, handle->userData); - } - } -} - -/*! - * brief Initializes the I2C peripheral. Call this API to ungate the I2C clock - * and initialize the I2C with the slave configuration. - * - * note This API should be called at the beginning of the application. - * Otherwise, any operation to the I2C module can cause a hard fault - * because the clock is not enabled. The configuration structure can partly be set - * with default values by I2C_SlaveGetDefaultConfig() or it can be custom filled by the user. - * This is an example. - * code - * i2c_slave_config_t config = { - * .enableSlave = true, - * .enableGeneralCall = false, - * .addressingMode = kI2C_Address7bit, - * .slaveAddress = 0x1DU, - * .enableWakeUp = false, - * .enablehighDrive = false, - * .enableBaudRateCtl = false, - * .sclStopHoldTime_ns = 4000 - * }; - * I2C_SlaveInit(I2C0, &config, 12000000U); - * endcode - * - * param base I2C base pointer - * param slaveConfig A pointer to the slave configuration structure - * param srcClock_Hz I2C peripheral clock frequency in Hz - */ -void I2C_SlaveInit(I2C_Type *base, const i2c_slave_config_t *slaveConfig, uint32_t srcClock_Hz) -{ - assert(NULL != slaveConfig); - - uint8_t tmpReg; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_EnableClock(s_i2cClocks[I2C_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Reset the module. */ - base->A1 = 0; - base->F = 0; - base->C1 = 0; - base->S = 0xFFU; - base->C2 = 0; -#if defined(FSL_FEATURE_I2C_HAS_START_STOP_DETECT) && FSL_FEATURE_I2C_HAS_START_STOP_DETECT - base->FLT = 0x50U; -#elif defined(FSL_FEATURE_I2C_HAS_STOP_DETECT) && FSL_FEATURE_I2C_HAS_STOP_DETECT - base->FLT = 0x40U; -#endif - base->RA = 0; - - /* Configure addressing mode. */ - switch (slaveConfig->addressingMode) - { - case kI2C_Address7bit: - base->A1 = (uint8_t)(((uint32_t)(slaveConfig->slaveAddress)) << 1U); - break; - - case kI2C_RangeMatch: - assert(slaveConfig->slaveAddress < slaveConfig->upperAddress); - base->A1 = (uint8_t)(((uint32_t)(slaveConfig->slaveAddress)) << 1U); - base->RA = (uint8_t)(((uint32_t)(slaveConfig->upperAddress)) << 1U); - base->C2 |= I2C_C2_RMEN_MASK; - break; - - default: - /* All the cases have been listed above, the default clause should not be reached. */ - assert(false); - break; - } - - /* Configure low power wake up feature. */ - tmpReg = base->C1; - tmpReg &= ~(uint8_t)I2C_C1_WUEN_MASK; - base->C1 = tmpReg | I2C_C1_WUEN(slaveConfig->enableWakeUp) | I2C_C1_IICEN(slaveConfig->enableSlave); - - /* Configure general call & baud rate control. */ - tmpReg = base->C2; - tmpReg &= ~(uint8_t)(I2C_C2_SBRC_MASK | I2C_C2_GCAEN_MASK); - tmpReg |= I2C_C2_SBRC(slaveConfig->enableBaudRateCtl) | I2C_C2_GCAEN(slaveConfig->enableGeneralCall); - base->C2 = tmpReg; - -/* Enable/Disable double buffering. */ -#if defined(FSL_FEATURE_I2C_HAS_DOUBLE_BUFFER_ENABLE) && FSL_FEATURE_I2C_HAS_DOUBLE_BUFFER_ENABLE - tmpReg = (uint8_t)(base->S2 & (~I2C_S2_DFEN_MASK)); - base->S2 = tmpReg | I2C_S2_DFEN(slaveConfig->enableDoubleBuffering); -#endif - - /* Set hold time. */ - I2C_SetHoldTime(base, slaveConfig->sclStopHoldTime_ns, srcClock_Hz); -} - -/*! - * brief De-initializes the I2C slave peripheral. Calling this API gates the I2C clock. - * The I2C slave module can't work unless the I2C_SlaveInit is called to enable the clock. - * param base I2C base pointer - */ -void I2C_SlaveDeinit(I2C_Type *base) -{ - /* Disable I2C module. */ - I2C_Enable(base, false); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable I2C clock. */ - CLOCK_DisableClock(s_i2cClocks[I2C_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Sets the I2C slave configuration structure to default values. - * - * The purpose of this API is to get the configuration structure initialized for use in the I2C_SlaveConfigure(). - * Modify fields of the structure before calling the I2C_SlaveConfigure(). - * This is an example. - * code - * i2c_slave_config_t config; - * I2C_SlaveGetDefaultConfig(&config); - * endcode - * param slaveConfig A pointer to the slave configuration structure. - */ -void I2C_SlaveGetDefaultConfig(i2c_slave_config_t *slaveConfig) -{ - assert(NULL != slaveConfig); - - /* Initializes the configure structure to zero. */ - (void)memset(slaveConfig, 0, sizeof(*slaveConfig)); - - /* By default slave is addressed with 7-bit address. */ - slaveConfig->addressingMode = kI2C_Address7bit; - - /* General call mode is disabled by default. */ - slaveConfig->enableGeneralCall = false; - - /* Slave address match waking up MCU from low power mode is disabled. */ - slaveConfig->enableWakeUp = false; - - /* Independent slave mode baud rate at maximum frequency is disabled. */ - slaveConfig->enableBaudRateCtl = false; - -/* Default enable double buffering. */ -#if defined(FSL_FEATURE_I2C_HAS_DOUBLE_BUFFER_ENABLE) && FSL_FEATURE_I2C_HAS_DOUBLE_BUFFER_ENABLE - slaveConfig->enableDoubleBuffering = true; -#endif - - /* Set default SCL stop hold time to 4us which is minimum requirement in I2C spec. */ - slaveConfig->sclStopHoldTime_ns = 4000; - - /* Enable the I2C peripheral. */ - slaveConfig->enableSlave = true; -} - -/*! - * brief Performs a polling send transaction on the I2C bus. - * - * param base The I2C peripheral base pointer. - * param txBuff The pointer to the data to be transferred. - * param txSize The length in bytes of the data to be transferred. - * retval kStatus_Success Successfully complete the data transmission. - * retval kStatus_I2C_ArbitrationLost Transfer error, arbitration lost. - * retval kStataus_I2C_Nak Transfer error, receive NAK during transfer. - */ -status_t I2C_SlaveWriteBlocking(I2C_Type *base, const uint8_t *txBuff, size_t txSize) -{ - status_t result = kStatus_Success; - -#if defined(FSL_FEATURE_I2C_HAS_START_STOP_DETECT) && FSL_FEATURE_I2C_HAS_START_STOP_DETECT - /* Check start flag. */ - while (0U == (base->FLT & I2C_FLT_STARTF_MASK)) - { - } - /* Clear STARTF flag. */ - base->FLT |= I2C_FLT_STARTF_MASK; - /* Clear the IICIF flag. */ - base->S = (uint8_t)kI2C_IntPendingFlag; -#endif /* FSL_FEATURE_I2C_HAS_START_STOP_DETECT */ - -#if I2C_RETRY_TIMES != 0U - uint32_t waitTimes = I2C_RETRY_TIMES; - /* Wait until data transfer complete. */ - while ((0U == (base->S & (uint8_t)kI2C_AddressMatchFlag)) && (0U != waitTimes)) - { - waitTimes--; - } - if (0U == waitTimes) - { - return kStatus_I2C_Timeout; - } -#else - /* Wait for address match flag. */ - while (0U == (base->S & (uint8_t)kI2C_AddressMatchFlag)) - { - } -#endif - /* Read dummy to release bus. */ - (void)base->D; - - result = I2C_MasterWriteBlocking(base, txBuff, txSize, (uint32_t)kI2C_TransferNoStopFlag); - - /* Switch to receive mode. */ - base->C1 &= ~(uint8_t)(I2C_C1_TX_MASK | I2C_C1_TXAK_MASK); - - /* Read dummy to release bus. */ - (void)base->D; - - return result; -} - -/*! - * brief Performs a polling receive transaction on the I2C bus. - * - * param base I2C peripheral base pointer. - * param rxBuff The pointer to the data to store the received data. - * param rxSize The length in bytes of the data to be received. - * retval kStatus_Success Successfully complete data receive. - * retval kStatus_I2C_Timeout Wait status flag timeout. - */ -status_t I2C_SlaveReadBlocking(I2C_Type *base, uint8_t *rxBuff, size_t rxSize) -{ - status_t result = kStatus_Success; - -/* Wait until address match. */ -#if defined(FSL_FEATURE_I2C_HAS_START_STOP_DETECT) && FSL_FEATURE_I2C_HAS_START_STOP_DETECT - /* Check start flag. */ - while (0U == (base->FLT & I2C_FLT_STARTF_MASK)) - { - } - /* Clear STARTF flag. */ - base->FLT |= I2C_FLT_STARTF_MASK; - /* Clear the IICIF flag. */ - base->S = (uint8_t)kI2C_IntPendingFlag; -#endif /* FSL_FEATURE_I2C_HAS_START_STOP_DETECT */ - -#if I2C_RETRY_TIMES != 0U - uint32_t waitTimes = I2C_RETRY_TIMES; - /* Wait for address match and int pending flag. */ - while ((0U == (base->S & (uint8_t)kI2C_AddressMatchFlag)) && (0U != waitTimes)) - { - waitTimes--; - } - if (0U == waitTimes) - { - return kStatus_I2C_Timeout; - } - - waitTimes = I2C_RETRY_TIMES; - while ((0U == (base->S & (uint8_t)kI2C_IntPendingFlag)) && (0U != waitTimes)) - { - waitTimes--; - } - if (0U == waitTimes) - { - return kStatus_I2C_Timeout; - } -#else - /* Wait for address match and int pending flag. */ - while (0U == (base->S & (uint8_t)kI2C_AddressMatchFlag)) - { - } - while (0U == (base->S & (uint8_t)kI2C_IntPendingFlag)) - { - } -#endif - - /* Read dummy to release bus. */ - (void)base->D; - - /* Clear the IICIF flag. */ - base->S = (uint8_t)kI2C_IntPendingFlag; - - /* Setup the I2C peripheral to receive data. */ - base->C1 &= ~(uint8_t)(I2C_C1_TX_MASK); - - while (0U != (rxSize--)) - { -#if I2C_RETRY_TIMES != 0U - waitTimes = I2C_RETRY_TIMES; - /* Wait until data transfer complete. */ - while ((0U == (base->S & (uint8_t)kI2C_IntPendingFlag)) && (0U != waitTimes)) - { - waitTimes--; - } - if (0U == waitTimes) - { - return kStatus_I2C_Timeout; - } -#else - /* Wait until data transfer complete. */ - while (0U == (base->S & (uint8_t)kI2C_IntPendingFlag)) - { - } -#endif - /* Clear the IICIF flag. */ - base->S = (uint8_t)kI2C_IntPendingFlag; - - /* Read from the data register. */ - *rxBuff++ = base->D; - } - - return result; -} - -/*! - * brief Initializes the I2C handle which is used in transactional functions. - * - * param base I2C base pointer. - * param handle pointer to i2c_slave_handle_t structure to store the transfer state. - * param callback pointer to user callback function. - * param userData user parameter passed to the callback function. - */ -void I2C_SlaveTransferCreateHandle(I2C_Type *base, - i2c_slave_handle_t *handle, - i2c_slave_transfer_callback_t callback, - void *userData) -{ - assert(NULL != handle); - - uint32_t instance = I2C_GetInstance(base); - - /* Zero handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Set callback and userData. */ - handle->callback = callback; - handle->userData = userData; - - /* Save the context in global variables to support the double weak mechanism. */ - s_i2cHandle[instance] = handle; - - /* Save slave interrupt handler. */ - s_i2cSlaveIsr = I2C_SlaveTransferHandleIRQ; - - /* Enable NVIC interrupt. */ - (void)EnableIRQ(s_i2cIrqs[instance]); -} - -/*! - * brief Starts accepting slave transfers. - * - * Call this API after calling the I2C_SlaveInit() and I2C_SlaveTransferCreateHandle() to start processing - * transactions driven by an I2C master. The slave monitors the I2C bus and passes events to the - * callback that was passed into the call to I2C_SlaveTransferCreateHandle(). The callback is always invoked - * from the interrupt context. - * - * The set of events received by the callback is customizable. To do so, set the a eventMask parameter to - * the OR'd combination of #i2c_slave_transfer_event_t enumerators for the events you wish to receive. - * The #kI2C_SlaveTransmitEvent and #kLPI2C_SlaveReceiveEvent events are always enabled and do not need - * to be included in the mask. Alternatively, pass 0 to get a default set of only the transmit and - * receive events that are always enabled. In addition, the #kI2C_SlaveAllEvents constant is provided as - * a convenient way to enable all events. - * - * param base The I2C peripheral base address. - * param handle Pointer to #i2c_slave_handle_t structure which stores the transfer state. - * param eventMask Bit mask formed by OR'ing together #i2c_slave_transfer_event_t enumerators to specify - * which events to send to the callback. Other accepted values are 0 to get a default set of - * only the transmit and receive events, and #kI2C_SlaveAllEvents to enable all events. - * - * retval #kStatus_Success Slave transfers were successfully started. - * retval #kStatus_I2C_Busy Slave transfers have already been started on this handle. - */ -status_t I2C_SlaveTransferNonBlocking(I2C_Type *base, i2c_slave_handle_t *handle, uint32_t eventMask) -{ - assert(NULL != handle); - - /* Check if the I2C bus is idle - if not return busy status. */ - if (true == handle->isBusy) - { - return kStatus_I2C_Busy; - } - else - { - /* Disable LPI2C IRQ sources while we configure stuff. */ - I2C_DisableInterrupts(base, (uint32_t)kIrqFlags); - - /* Clear transfer in handle. */ - (void)memset(&handle->transfer, 0, sizeof(handle->transfer)); - - /* Record that we're busy. */ - handle->isBusy = true; - - /* Set up event mask. tx and rx are always enabled. */ - handle->eventMask = eventMask | (uint32_t)kI2C_SlaveTransmitEvent | (uint32_t)kI2C_SlaveReceiveEvent | - (uint32_t)kI2C_SlaveGenaralcallEvent; - - /* Clear all flags. */ - I2C_SlaveClearStatusFlags(base, (uint32_t)kClearFlags); - - /* Enable I2C internal IRQ sources. NVIC IRQ was enabled in CreateHandle() */ - I2C_EnableInterrupts(base, (uint32_t)kIrqFlags); - } - - return kStatus_Success; -} - -/*! - * brief Aborts the slave transfer. - * - * note This API can be called at any time to stop slave for handling the bus events. - * - * param base I2C base pointer. - * param handle pointer to i2c_slave_handle_t structure which stores the transfer state. - */ -void I2C_SlaveTransferAbort(I2C_Type *base, i2c_slave_handle_t *handle) -{ - assert(NULL != handle); - - if (true == handle->isBusy) - { - /* Disable interrupts. */ - I2C_DisableInterrupts(base, (uint32_t)kIrqFlags); - - /* Reset transfer info. */ - (void)memset(&handle->transfer, 0, sizeof(handle->transfer)); - - /* Reset the state to idle. */ - handle->isBusy = false; - } -} - -/*! - * brief Gets the slave transfer remaining bytes during a interrupt non-blocking transfer. - * - * param base I2C base pointer. - * param handle pointer to i2c_slave_handle_t structure. - * param count Number of bytes transferred so far by the non-blocking transaction. - * retval kStatus_InvalidArgument count is Invalid. - * retval kStatus_Success Successfully return the count. - */ -status_t I2C_SlaveTransferGetCount(I2C_Type *base, i2c_slave_handle_t *handle, size_t *count) -{ - assert(NULL != handle); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (false == handle->isBusy) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - /* For an active transfer, just return the count from the handle. */ - *count = handle->transfer.transferredCount; - - return kStatus_Success; -} - -/*! - * brief Slave interrupt handler. - * - * param base I2C base pointer. - * param i2cHandle pointer to i2c_slave_handle_t structure which stores the transfer state - */ -void I2C_SlaveTransferHandleIRQ(I2C_Type *base, void *i2cHandle) -{ - assert(NULL != i2cHandle); - - uint16_t status; - bool doTransmit = false; - i2c_slave_handle_t *handle = (i2c_slave_handle_t *)i2cHandle; - i2c_slave_transfer_t *xfer; - size_t tmpDataSize = 0; - - status = (uint16_t)I2C_SlaveGetStatusFlags(base); - xfer = &(handle->transfer); - -#ifdef I2C_HAS_STOP_DETECT - /* Check stop flag. */ - if (0U != (status & (uint16_t)kI2C_StopDetectFlag)) - { - I2C_MasterClearStatusFlags(base, (uint32_t)kI2C_StopDetectFlag); - - /* Clear the interrupt flag. */ - base->S = (uint8_t)kI2C_IntPendingFlag; - - /* Call slave callback if this is the STOP of the transfer. */ - if (true == handle->isBusy) - { - xfer->event = kI2C_SlaveCompletionEvent; - xfer->completionStatus = kStatus_Success; - handle->isBusy = false; - - if ((0U != (handle->eventMask & (uint32_t)xfer->event)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - } - - if (0U == (status & (uint16_t)kI2C_AddressMatchFlag)) - { - return; - } - } -#endif /* I2C_HAS_STOP_DETECT */ - -#if defined(FSL_FEATURE_I2C_HAS_START_STOP_DETECT) && FSL_FEATURE_I2C_HAS_START_STOP_DETECT - /* Check start flag. */ - if (0U != (status & (uint16_t)kI2C_StartDetectFlag)) - { - I2C_MasterClearStatusFlags(base, (uint32_t)kI2C_StartDetectFlag); - - /* Clear the interrupt flag. */ - base->S = (uint8_t)kI2C_IntPendingFlag; - - xfer->event = kI2C_SlaveStartEvent; - - if ((0U != (handle->eventMask & (uint32_t)xfer->event)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - - if (0U == (status & (uint16_t)kI2C_AddressMatchFlag)) - { - return; - } - } -#endif /* FSL_FEATURE_I2C_HAS_START_STOP_DETECT */ - - /* Clear the interrupt flag. */ - base->S = (uint8_t)kI2C_IntPendingFlag; - - /* Check NAK */ - if (0U != (status & (uint16_t)kI2C_ReceiveNakFlag)) - { - /* Set receive mode. */ - base->C1 &= ~(uint8_t)(I2C_C1_TX_MASK | I2C_C1_TXAK_MASK); - - /* Read dummy. */ - (void)base->D; - - if (handle->transfer.dataSize != 0u) - { - xfer->event = kI2C_SlaveCompletionEvent; - xfer->completionStatus = kStatus_I2C_Nak; - handle->isBusy = false; - - if ((0U != (handle->eventMask & (uint32_t)xfer->event)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - } - else - { -#ifndef I2C_HAS_STOP_DETECT - xfer->event = kI2C_SlaveCompletionEvent; - xfer->completionStatus = kStatus_Success; - handle->isBusy = false; - - if ((0U != (handle->eventMask & (uint32_t)xfer->event)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } -#endif /* !FSL_FEATURE_I2C_HAS_START_STOP_DETECT or !FSL_FEATURE_I2C_HAS_STOP_DETECT */ - } - } - /* Check address match. */ - else if (0U != (status & (uint16_t)kI2C_AddressMatchFlag)) - { - handle->isBusy = true; - xfer->event = kI2C_SlaveAddressMatchEvent; - - /* Slave transmit, master reading from slave. */ - if (0U != (status & (uint16_t)kI2C_TransferDirectionFlag)) - { - /* Change direction to send data. */ - base->C1 |= I2C_C1_TX_MASK; - - doTransmit = true; - } - else - { - /* Slave receive, master writing to slave. */ - base->C1 &= ~(uint8_t)(I2C_C1_TX_MASK | I2C_C1_TXAK_MASK); - - /* Read dummy to release the bus and check the address master issued. */ - if (base->D == 0u) - { - xfer->event = kI2C_SlaveGenaralcallEvent; - } - } - - if ((0U != (handle->eventMask & (uint32_t)xfer->event)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - } - /* Check transfer complete flag. */ - else if (0U != (status & (uint16_t)kI2C_TransferCompleteFlag)) - { - /* Slave transmit, master reading from slave. */ - if (0U != (status & (uint16_t)kI2C_TransferDirectionFlag)) - { - doTransmit = true; - } - else - { - tmpDataSize = xfer->dataSize; - /* If we're out of data, invoke callback to get more. */ - if ((NULL == xfer->data) || (0U == tmpDataSize)) - { - xfer->event = kI2C_SlaveReceiveEvent; - - if (NULL != handle->callback) - { - handle->callback(base, xfer, handle->userData); - } - - /* Clear the transferred count now that we have a new buffer. */ - xfer->transferredCount = 0; - } - - /* Slave receive, master writing to slave. */ - uint8_t data = base->D; - - if (0U != (handle->transfer.dataSize)) - { - /* Receive data. */ - *handle->transfer.data++ = data; - handle->transfer.dataSize--; - xfer->transferredCount++; - if (0U == handle->transfer.dataSize) - { -#ifndef I2C_HAS_STOP_DETECT - xfer->event = kI2C_SlaveCompletionEvent; - xfer->completionStatus = kStatus_Success; - handle->isBusy = false; - - /* Proceed receive complete event. */ - if (((handle->eventMask & (uint32_t)xfer->event) != 0U) && (handle->callback != NULL)) - { - handle->callback(base, xfer, handle->userData); - } -#endif /* !FSL_FEATURE_I2C_HAS_START_STOP_DETECT or !FSL_FEATURE_I2C_HAS_STOP_DETECT */ - } - } - } - } - else - { - /* Read dummy to release bus. */ - (void)base->D; - } - - /* Send data if there is the need. */ - if (doTransmit) - { - tmpDataSize = xfer->dataSize; - /* If we're out of data, invoke callback to get more. */ - if ((NULL == xfer->data) || (0U == tmpDataSize)) - { - xfer->event = kI2C_SlaveTransmitEvent; - - if (NULL != handle->callback) - { - handle->callback(base, xfer, handle->userData); - } - - /* Clear the transferred count now that we have a new buffer. */ - xfer->transferredCount = 0; - } - - if (0U != (handle->transfer.dataSize)) - { - /* Send data. */ - base->D = *handle->transfer.data++; - handle->transfer.dataSize--; - xfer->transferredCount++; - } - else - { - /* Switch to receive mode. */ - base->C1 &= ~(uint8_t)(I2C_C1_TX_MASK | I2C_C1_TXAK_MASK); - - /* Read dummy to release bus. */ - (void)base->D; - -#ifndef I2C_HAS_STOP_DETECT - xfer->event = kI2C_SlaveCompletionEvent; - xfer->completionStatus = kStatus_Success; - handle->isBusy = false; - - /* Proceed txdone event. */ - if (((handle->eventMask & (uint32_t)xfer->event) != 0U) && (handle->callback != NULL)) - { - handle->callback(base, xfer, handle->userData); - } -#endif /* !FSL_FEATURE_I2C_HAS_START_STOP_DETECT or !FSL_FEATURE_I2C_HAS_STOP_DETECT */ - } - } -} - -#if defined(FSL_FEATURE_I2C_HAS_SHARED_IRQ0_IRQ1) && FSL_FEATURE_I2C_HAS_SHARED_IRQ0_IRQ1 -void I2C0_I2C1_DriverIRQHandler(void); -void I2C0_I2C1_DriverIRQHandler(void) -{ - for (uint32_t instance = 0U; instance < 2U; instance++) - { - if (s_i2cHandle[instance] != NULL) - { - I2C_TransferCommonIRQHandler(s_i2cBases[instance], s_i2cHandle[instance]); - } - } -} -#else -#if defined(I2C0) -void I2C0_DriverIRQHandler(void); -void I2C0_DriverIRQHandler(void) -{ - I2C_TransferCommonIRQHandler(I2C0, s_i2cHandle[0]); -} -#endif - -#if defined(I2C1) -void I2C1_DriverIRQHandler(void); -void I2C1_DriverIRQHandler(void) -{ - I2C_TransferCommonIRQHandler(I2C1, s_i2cHandle[1]); -} -#endif -#endif - -#if defined(I2C2) -void I2C2_DriverIRQHandler(void); -void I2C2_DriverIRQHandler(void) -{ - I2C_TransferCommonIRQHandler(I2C2, s_i2cHandle[2]); -} -#endif - -#if defined(I2C3) -void I2C3_DriverIRQHandler(void); -void I2C3_DriverIRQHandler(void) -{ - I2C_TransferCommonIRQHandler(I2C3, s_i2cHandle[3]); -} -#endif diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_i2c.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_i2c.h deleted file mode 100644 index cf4b231bf2d..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_i2c.h +++ /dev/null @@ -1,807 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_I2C_H_ -#define FSL_I2C_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup i2c_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief I2C driver version. */ -#define FSL_I2C_DRIVER_VERSION (MAKE_VERSION(2, 0, 9)) -/*! @} */ - -/*! @brief Retry times for waiting flag. */ -#ifndef I2C_RETRY_TIMES -#define I2C_RETRY_TIMES 0U /* Define to zero means keep waiting until the flag is assert/deassert. */ -#endif - -/*! @brief Mater Fast ack control, control if master needs to manually write ack, this is used to -low the speed of transfer for SoCs with feature FSL_FEATURE_I2C_HAS_DOUBLE_BUFFERING */ -#ifndef I2C_MASTER_FACK_CONTROL -#define I2C_MASTER_FACK_CONTROL 0U /* Default defines to zero means master will send ack automatically. */ -#endif - -#if (defined(FSL_FEATURE_I2C_HAS_START_STOP_DETECT) && FSL_FEATURE_I2C_HAS_START_STOP_DETECT || \ - defined(FSL_FEATURE_I2C_HAS_STOP_DETECT) && FSL_FEATURE_I2C_HAS_STOP_DETECT) -#define I2C_HAS_STOP_DETECT -#endif /* FSL_FEATURE_I2C_HAS_START_STOP_DETECT / FSL_FEATURE_I2C_HAS_STOP_DETECT */ - -/*! @brief I2C status return codes. */ -enum -{ - kStatus_I2C_Busy = MAKE_STATUS(kStatusGroup_I2C, 0), /*!< I2C is busy with current transfer. */ - kStatus_I2C_Idle = MAKE_STATUS(kStatusGroup_I2C, 1), /*!< Bus is Idle. */ - kStatus_I2C_Nak = MAKE_STATUS(kStatusGroup_I2C, 2), /*!< NAK received during transfer. */ - kStatus_I2C_ArbitrationLost = MAKE_STATUS(kStatusGroup_I2C, 3), /*!< Arbitration lost during transfer. */ - kStatus_I2C_Timeout = MAKE_STATUS(kStatusGroup_I2C, 4), /*!< Timeout polling status flags. */ - kStatus_I2C_Addr_Nak = MAKE_STATUS(kStatusGroup_I2C, 5), /*!< NAK received during the address probe. */ -}; - -/*! - * @brief I2C peripheral flags - * - * @note These enumerations are meant to be OR'd together to form a bit mask. - * - */ -enum _i2c_flags -{ - kI2C_ReceiveNakFlag = I2C_S_RXAK_MASK, /*!< I2C receive NAK flag. */ - kI2C_IntPendingFlag = I2C_S_IICIF_MASK, /*!< I2C interrupt pending flag. This flag can be cleared. */ - kI2C_TransferDirectionFlag = I2C_S_SRW_MASK, /*!< I2C transfer direction flag. */ - kI2C_RangeAddressMatchFlag = I2C_S_RAM_MASK, /*!< I2C range address match flag. */ - kI2C_ArbitrationLostFlag = I2C_S_ARBL_MASK, /*!< I2C arbitration lost flag. This flag can be cleared. */ - kI2C_BusBusyFlag = I2C_S_BUSY_MASK, /*!< I2C bus busy flag. */ - kI2C_AddressMatchFlag = I2C_S_IAAS_MASK, /*!< I2C address match flag. */ - kI2C_TransferCompleteFlag = I2C_S_TCF_MASK, /*!< I2C transfer complete flag. */ -#ifdef I2C_HAS_STOP_DETECT - kI2C_StopDetectFlag = I2C_FLT_STOPF_MASK << 8, /*!< I2C stop detect flag. This flag can be cleared. */ -#endif /* FSL_FEATURE_I2C_HAS_START_STOP_DETECT / FSL_FEATURE_I2C_HAS_STOP_DETECT */ - -#if defined(FSL_FEATURE_I2C_HAS_START_STOP_DETECT) && FSL_FEATURE_I2C_HAS_START_STOP_DETECT - kI2C_StartDetectFlag = I2C_FLT_STARTF_MASK << 8, /*!< I2C start detect flag. This flag can be cleared. */ -#endif /* FSL_FEATURE_I2C_HAS_START_STOP_DETECT */ -}; - -/*! @brief I2C feature interrupt source. */ -enum _i2c_interrupt_enable -{ - kI2C_GlobalInterruptEnable = I2C_C1_IICIE_MASK, /*!< I2C global interrupt. */ - -#if defined(FSL_FEATURE_I2C_HAS_STOP_DETECT) && FSL_FEATURE_I2C_HAS_STOP_DETECT - kI2C_StopDetectInterruptEnable = I2C_FLT_STOPIE_MASK, /*!< I2C stop detect interrupt. */ -#endif /* FSL_FEATURE_I2C_HAS_STOP_DETECT */ - -#if defined(FSL_FEATURE_I2C_HAS_START_STOP_DETECT) && FSL_FEATURE_I2C_HAS_START_STOP_DETECT - kI2C_StartStopDetectInterruptEnable = I2C_FLT_SSIE_MASK, /*!< I2C start&stop detect interrupt. */ -#endif /* FSL_FEATURE_I2C_HAS_START_STOP_DETECT */ -}; - -/*! @brief The direction of master and slave transfers. */ -typedef enum _i2c_direction -{ - kI2C_Write = 0x0U, /*!< Master transmits to the slave. */ - kI2C_Read = 0x1U, /*!< Master receives from the slave. */ -} i2c_direction_t; - -/*! @brief Addressing mode. */ -typedef enum _i2c_slave_address_mode -{ - kI2C_Address7bit = 0x0U, /*!< 7-bit addressing mode. */ - kI2C_RangeMatch = 0X2U, /*!< Range address match addressing mode. */ -} i2c_slave_address_mode_t; - -/*! @brief I2C transfer control flag. */ -enum _i2c_master_transfer_flags -{ - kI2C_TransferDefaultFlag = 0x0U, /*!< A transfer starts with a start signal, stops with a stop signal. */ - kI2C_TransferNoStartFlag = 0x1U, /*!< A transfer starts without a start signal, only support write only or - write+read with no start flag, do not support read only with no start flag. */ - kI2C_TransferRepeatedStartFlag = 0x2U, /*!< A transfer starts with a repeated start signal. */ - kI2C_TransferNoStopFlag = 0x4U, /*!< A transfer ends without a stop signal. */ -}; - -/*! - * @brief Set of events sent to the callback for nonblocking slave transfers. - * - * These event enumerations are used for two related purposes. First, a bit mask created by OR'ing together - * events is passed to I2C_SlaveTransferNonBlocking() to specify which events to enable. - * Then, when the slave callback is invoked, it is passed the current event through its @a transfer - * parameter. - * - * @note These enumerations are meant to be OR'd together to form a bit mask of events. - */ -typedef enum _i2c_slave_transfer_event -{ - kI2C_SlaveAddressMatchEvent = 0x01U, /*!< Received the slave address after a start or repeated start. */ - kI2C_SlaveTransmitEvent = 0x02U, /*!< A callback is requested to provide data to transmit - (slave-transmitter role). */ - kI2C_SlaveReceiveEvent = 0x04U, /*!< A callback is requested to provide a buffer in which to place received - data (slave-receiver role). */ - kI2C_SlaveTransmitAckEvent = 0x08U, /*!< A callback needs to either transmit an ACK or NACK. */ -#if defined(FSL_FEATURE_I2C_HAS_START_STOP_DETECT) && FSL_FEATURE_I2C_HAS_START_STOP_DETECT - kI2C_SlaveStartEvent = 0x10U, /*!< A start/repeated start was detected. */ -#endif - kI2C_SlaveCompletionEvent = 0x20U, /*!< A stop was detected or finished transfer, completing the transfer. */ - kI2C_SlaveGenaralcallEvent = 0x40U, /*!< Received the general call address after a start or repeated start. */ - - /*! A bit mask of all available events. */ - kI2C_SlaveAllEvents = kI2C_SlaveAddressMatchEvent | kI2C_SlaveTransmitEvent | kI2C_SlaveReceiveEvent | -#if defined(FSL_FEATURE_I2C_HAS_START_STOP_DETECT) && FSL_FEATURE_I2C_HAS_START_STOP_DETECT - kI2C_SlaveStartEvent | -#endif - kI2C_SlaveCompletionEvent | kI2C_SlaveGenaralcallEvent, -} i2c_slave_transfer_event_t; - -/*! @brief Common sets of flags used by the driver. */ -enum -{ -/*! All flags which are cleared by the driver upon starting a transfer. */ -#if defined(FSL_FEATURE_I2C_HAS_START_STOP_DETECT) && FSL_FEATURE_I2C_HAS_START_STOP_DETECT - kClearFlags = kI2C_ArbitrationLostFlag | kI2C_IntPendingFlag | kI2C_StartDetectFlag | kI2C_StopDetectFlag, - kIrqFlags = kI2C_GlobalInterruptEnable | kI2C_StartStopDetectInterruptEnable, -#elif defined(FSL_FEATURE_I2C_HAS_STOP_DETECT) && FSL_FEATURE_I2C_HAS_STOP_DETECT - kClearFlags = kI2C_ArbitrationLostFlag | kI2C_IntPendingFlag | kI2C_StopDetectFlag, - kIrqFlags = kI2C_GlobalInterruptEnable | kI2C_StopDetectInterruptEnable, -#else - kClearFlags = kI2C_ArbitrationLostFlag | kI2C_IntPendingFlag, - kIrqFlags = kI2C_GlobalInterruptEnable, -#endif -}; - -/*! @brief I2C master user configuration. */ -typedef struct _i2c_master_config -{ - bool enableMaster; /*!< Enables the I2C peripheral at initialization time. */ -#if defined(FSL_FEATURE_I2C_HAS_STOP_HOLD_OFF) && FSL_FEATURE_I2C_HAS_STOP_HOLD_OFF - bool enableStopHold; /*!< Controls the stop hold enable. */ -#endif -#if defined(FSL_FEATURE_I2C_HAS_DOUBLE_BUFFER_ENABLE) && FSL_FEATURE_I2C_HAS_DOUBLE_BUFFER_ENABLE - bool enableDoubleBuffering; /*!< Controls double buffer enable; notice that - enabling the double buffer disables the clock stretch. */ -#endif - uint32_t baudRate_Bps; /*!< Baud rate configuration of I2C peripheral. */ - uint8_t glitchFilterWidth; /*!< Controls the width of the glitch. */ -} i2c_master_config_t; - -/*! @brief I2C slave user configuration. */ -typedef struct _i2c_slave_config -{ - bool enableSlave; /*!< Enables the I2C peripheral at initialization time. */ - bool enableGeneralCall; /*!< Enables the general call addressing mode. */ - bool enableWakeUp; /*!< Enables/disables waking up MCU from low-power mode. */ -#if defined(FSL_FEATURE_I2C_HAS_DOUBLE_BUFFER_ENABLE) && FSL_FEATURE_I2C_HAS_DOUBLE_BUFFER_ENABLE - bool enableDoubleBuffering; /*!< Controls a double buffer enable; notice that - enabling the double buffer disables the clock stretch. */ -#endif - bool enableBaudRateCtl; /*!< Enables/disables independent slave baud rate on SCL in very fast I2C modes. */ - uint16_t slaveAddress; /*!< A slave address configuration. */ - uint16_t upperAddress; /*!< A maximum boundary slave address used in a range matching mode. */ - i2c_slave_address_mode_t - addressingMode; /*!< An addressing mode configuration of i2c_slave_address_mode_config_t. */ - uint32_t sclStopHoldTime_ns; /*!< the delay from the rising edge of SCL (I2C clock) to the rising edge of SDA (I2C - data) while SCL is high (stop condition), SDA hold time and SCL start hold time - are also configured according to the SCL stop hold time. */ -} i2c_slave_config_t; - -/*! @brief I2C master handle typedef. */ -typedef struct _i2c_master_handle i2c_master_handle_t; - -/*! @brief I2C master transfer callback typedef. */ -typedef void (*i2c_master_transfer_callback_t)(I2C_Type *base, - i2c_master_handle_t *handle, - status_t status, - void *userData); - -/*! @brief I2C slave handle typedef. */ -typedef struct _i2c_slave_handle i2c_slave_handle_t; - -/*! @brief I2C master transfer structure. */ -typedef struct _i2c_master_transfer -{ - uint32_t flags; /*!< A transfer flag which controls the transfer. */ - uint8_t slaveAddress; /*!< 7-bit slave address. */ - i2c_direction_t direction; /*!< A transfer direction, read or write. */ - uint32_t subaddress; /*!< A sub address. Transferred MSB first. */ - uint8_t subaddressSize; /*!< A size of the command buffer. */ - uint8_t *volatile data; /*!< A transfer buffer. */ - volatile size_t dataSize; /*!< A transfer size. */ -} i2c_master_transfer_t; - -/*! @brief I2C master handle structure. */ -struct _i2c_master_handle -{ - i2c_master_transfer_t transfer; /*!< I2C master transfer copy. */ - size_t transferSize; /*!< Total bytes to be transferred. */ - uint8_t state; /*!< A transfer state maintained during transfer. */ - i2c_master_transfer_callback_t completionCallback; /*!< A callback function called when the transfer is finished. */ - void *userData; /*!< A callback parameter passed to the callback function. */ -}; - -/*! @brief I2C slave transfer structure. */ -typedef struct _i2c_slave_transfer -{ - i2c_slave_transfer_event_t event; /*!< A reason that the callback is invoked. */ - uint8_t *volatile data; /*!< A transfer buffer. */ - volatile size_t dataSize; /*!< A transfer size. */ - status_t completionStatus; /*!< Success or error code describing how the transfer completed. Only applies for - #kI2C_SlaveCompletionEvent. */ - size_t transferredCount; /*!< A number of bytes actually transferred since the start or since the last repeated - start. */ -} i2c_slave_transfer_t; - -/*! @brief I2C slave transfer callback typedef. */ -typedef void (*i2c_slave_transfer_callback_t)(I2C_Type *base, i2c_slave_transfer_t *xfer, void *userData); - -/*! @brief I2C slave handle structure. */ -struct _i2c_slave_handle -{ - volatile bool isBusy; /*!< Indicates whether a transfer is busy. */ - i2c_slave_transfer_t transfer; /*!< I2C slave transfer copy. */ - uint32_t eventMask; /*!< A mask of enabled events. */ - i2c_slave_transfer_callback_t callback; /*!< A callback function called at the transfer event. */ - void *userData; /*!< A callback parameter passed to the callback. */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus. */ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Initializes the I2C peripheral. Call this API to ungate the I2C clock - * and configure the I2C with master configuration. - * - * @note This API should be called at the beginning of the application. - * Otherwise, any operation to the I2C module can cause a hard fault - * because the clock is not enabled. The configuration structure can be custom filled - * or it can be set with default values by using the I2C_MasterGetDefaultConfig(). - * After calling this API, the master is ready to transfer. - * This is an example. - * @code - * i2c_master_config_t config = { - * .enableMaster = true, - * .enableStopHold = false, - * .highDrive = false, - * .baudRate_Bps = 100000, - * .glitchFilterWidth = 0 - * }; - * I2C_MasterInit(I2C0, &config, 12000000U); - * @endcode - * - * @param base I2C base pointer - * @param masterConfig A pointer to the master configuration structure - * @param srcClock_Hz I2C peripheral clock frequency in Hz - */ -void I2C_MasterInit(I2C_Type *base, const i2c_master_config_t *masterConfig, uint32_t srcClock_Hz); - -/*! - * @brief Initializes the I2C peripheral. Call this API to ungate the I2C clock - * and initialize the I2C with the slave configuration. - * - * @note This API should be called at the beginning of the application. - * Otherwise, any operation to the I2C module can cause a hard fault - * because the clock is not enabled. The configuration structure can partly be set - * with default values by I2C_SlaveGetDefaultConfig() or it can be custom filled by the user. - * This is an example. - * @code - * i2c_slave_config_t config = { - * .enableSlave = true, - * .enableGeneralCall = false, - * .addressingMode = kI2C_Address7bit, - * .slaveAddress = 0x1DU, - * .enableWakeUp = false, - * .enablehighDrive = false, - * .enableBaudRateCtl = false, - * .sclStopHoldTime_ns = 4000 - * }; - * I2C_SlaveInit(I2C0, &config, 12000000U); - * @endcode - * - * @param base I2C base pointer - * @param slaveConfig A pointer to the slave configuration structure - * @param srcClock_Hz I2C peripheral clock frequency in Hz - */ -void I2C_SlaveInit(I2C_Type *base, const i2c_slave_config_t *slaveConfig, uint32_t srcClock_Hz); - -/*! - * @brief De-initializes the I2C master peripheral. Call this API to gate the I2C clock. - * The I2C master module can't work unless the I2C_MasterInit is called. - * @param base I2C base pointer - */ -void I2C_MasterDeinit(I2C_Type *base); - -/*! - * @brief De-initializes the I2C slave peripheral. Calling this API gates the I2C clock. - * The I2C slave module can't work unless the I2C_SlaveInit is called to enable the clock. - * @param base I2C base pointer - */ -void I2C_SlaveDeinit(I2C_Type *base); - -/*! - * @brief Get instance number for I2C module. - * - * @param base I2C peripheral base address. - */ -uint32_t I2C_GetInstance(I2C_Type *base); - -/*! - * @brief Sets the I2C master configuration structure to default values. - * - * The purpose of this API is to get the configuration structure initialized for use in the I2C_MasterConfigure(). - * Use the initialized structure unchanged in the I2C_MasterConfigure() or modify - * the structure before calling the I2C_MasterConfigure(). - * This is an example. - * @code - * i2c_master_config_t config; - * I2C_MasterGetDefaultConfig(&config); - * @endcode - * @param masterConfig A pointer to the master configuration structure. - */ -void I2C_MasterGetDefaultConfig(i2c_master_config_t *masterConfig); - -/*! - * @brief Sets the I2C slave configuration structure to default values. - * - * The purpose of this API is to get the configuration structure initialized for use in the I2C_SlaveConfigure(). - * Modify fields of the structure before calling the I2C_SlaveConfigure(). - * This is an example. - * @code - * i2c_slave_config_t config; - * I2C_SlaveGetDefaultConfig(&config); - * @endcode - * @param slaveConfig A pointer to the slave configuration structure. - */ -void I2C_SlaveGetDefaultConfig(i2c_slave_config_t *slaveConfig); - -/*! - * @brief Enables or disables the I2C peripheral operation. - * - * @param base I2C base pointer - * @param enable Pass true to enable and false to disable the module. - */ -static inline void I2C_Enable(I2C_Type *base, bool enable) -{ - if (enable) - { - base->C1 |= I2C_C1_IICEN_MASK; - } - else - { - base->C1 &= ~(uint8_t)I2C_C1_IICEN_MASK; - } -} - -/*! @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets the I2C status flags. - * - * @param base I2C base pointer - * @return status flag, use status flag to AND #_i2c_flags to get the related status. - */ -uint32_t I2C_MasterGetStatusFlags(I2C_Type *base); - -/*! - * @brief Gets the I2C status flags. - * - * @param base I2C base pointer - * @return status flag, use status flag to AND #_i2c_flags to get the related status. - */ -static inline uint32_t I2C_SlaveGetStatusFlags(I2C_Type *base) -{ - return I2C_MasterGetStatusFlags(base); -} - -/*! - * @brief Clears the I2C status flag state. - * - * The following status register flags can be cleared kI2C_ArbitrationLostFlag and kI2C_IntPendingFlag. - * - * @param base I2C base pointer - * @param statusMask The status flag mask, defined in type i2c_status_flag_t. - * The parameter can be any combination of the following values: - * @arg kI2C_StartDetectFlag (if available) - * @arg kI2C_StopDetectFlag (if available) - * @arg kI2C_ArbitrationLostFlag - * @arg kI2C_IntPendingFlagFlag - */ -static inline void I2C_MasterClearStatusFlags(I2C_Type *base, uint32_t statusMask) -{ -/* Must clear the STARTF / STOPF bits prior to clearing IICIF */ -#if defined(FSL_FEATURE_I2C_HAS_START_STOP_DETECT) && FSL_FEATURE_I2C_HAS_START_STOP_DETECT - if ((uint32_t)kI2C_StartDetectFlag == (statusMask & (uint32_t)kI2C_StartDetectFlag)) - { - /* Shift the odd-ball flags back into place. */ - base->FLT |= (uint8_t)(statusMask >> 8U); - } -#endif - -#ifdef I2C_HAS_STOP_DETECT - if ((uint32_t)kI2C_StopDetectFlag == (statusMask & (uint32_t)kI2C_StopDetectFlag)) - { - /* Shift the odd-ball flags back into place. */ - base->FLT |= (uint8_t)(statusMask >> 8U); - } -#endif - - base->S = (uint8_t)statusMask; -} - -/*! - * @brief Clears the I2C status flag state. - * - * The following status register flags can be cleared kI2C_ArbitrationLostFlag and kI2C_IntPendingFlag - * - * @param base I2C base pointer - * @param statusMask The status flag mask, defined in type i2c_status_flag_t. - * The parameter can be any combination of the following values: - * @arg kI2C_StartDetectFlag (if available) - * @arg kI2C_StopDetectFlag (if available) - * @arg kI2C_ArbitrationLostFlag - * @arg kI2C_IntPendingFlagFlag - */ -static inline void I2C_SlaveClearStatusFlags(I2C_Type *base, uint32_t statusMask) -{ - I2C_MasterClearStatusFlags(base, statusMask); -} - -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables I2C interrupt requests. - * - * @param base I2C base pointer - * @param mask interrupt source - * The parameter can be combination of the following source if defined: - * @arg kI2C_GlobalInterruptEnable - * @arg kI2C_StopDetectInterruptEnable/kI2C_StartDetectInterruptEnable - * @arg kI2C_SdaTimeoutInterruptEnable - */ -void I2C_EnableInterrupts(I2C_Type *base, uint32_t mask); - -/*! - * @brief Disables I2C interrupt requests. - * - * @param base I2C base pointer - * @param mask interrupt source - * The parameter can be combination of the following source if defined: - * @arg kI2C_GlobalInterruptEnable - * @arg kI2C_StopDetectInterruptEnable/kI2C_StartDetectInterruptEnable - * @arg kI2C_SdaTimeoutInterruptEnable - */ -void I2C_DisableInterrupts(I2C_Type *base, uint32_t mask); -/*! @} */ - -/*! - * @name DMA Control - * @{ - */ -#if defined(FSL_FEATURE_I2C_HAS_DMA_SUPPORT) && FSL_FEATURE_I2C_HAS_DMA_SUPPORT -/*! - * @brief Enables/disables the I2C DMA interrupt. - * - * @param base I2C base pointer - * @param enable true to enable, false to disable - */ -static inline void I2C_EnableDMA(I2C_Type *base, bool enable) -{ - if (enable) - { - base->C1 |= I2C_C1_DMAEN_MASK; - } - else - { - base->C1 &= ~(uint8_t)I2C_C1_DMAEN_MASK; - } -} - -#endif /* FSL_FEATURE_I2C_HAS_DMA_SUPPORT */ - -/*! - * @brief Gets the I2C tx/rx data register address. This API is used to provide a transfer address - * for I2C DMA transfer configuration. - * - * @param base I2C base pointer - * @return data register address - */ -static inline uint32_t I2C_GetDataRegAddr(I2C_Type *base) -{ - return (uint32_t)(&(base->D)); -} - -/*! @} */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Sets the I2C master transfer baud rate. - * - * @param base I2C base pointer - * @param baudRate_Bps the baud rate value in bps - * @param srcClock_Hz Source clock - */ -void I2C_MasterSetBaudRate(I2C_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz); - -/*! - * @brief Sends a START on the I2C bus. - * - * This function is used to initiate a new master mode transfer by sending the START signal. - * The slave address is sent following the I2C START signal. - * - * @param base I2C peripheral base pointer - * @param address 7-bit slave device address. - * @param direction Master transfer directions(transmit/receive). - * @retval kStatus_Success Successfully send the start signal. - * @retval kStatus_I2C_Busy Current bus is busy. - */ -status_t I2C_MasterStart(I2C_Type *base, uint8_t address, i2c_direction_t direction); - -/*! - * @brief Sends a STOP signal on the I2C bus. - * - * @retval kStatus_Success Successfully send the stop signal. - * @retval kStatus_I2C_Timeout Send stop signal failed, timeout. - */ -status_t I2C_MasterStop(I2C_Type *base); - -/*! - * @brief Sends a REPEATED START on the I2C bus. - * - * @param base I2C peripheral base pointer - * @param address 7-bit slave device address. - * @param direction Master transfer directions(transmit/receive). - * @retval kStatus_Success Successfully send the start signal. - * @retval kStatus_I2C_Busy Current bus is busy but not occupied by current I2C master. - */ -status_t I2C_MasterRepeatedStart(I2C_Type *base, uint8_t address, i2c_direction_t direction); - -/*! - * @brief Performs a polling send transaction on the I2C bus. - * - * @param base The I2C peripheral base pointer. - * @param txBuff The pointer to the data to be transferred. - * @param txSize The length in bytes of the data to be transferred. - * @param flags Transfer control flag to decide whether need to send a stop, use kI2C_TransferDefaultFlag - * to issue a stop and kI2C_TransferNoStop to not send a stop. - * @retval kStatus_Success Successfully complete the data transmission. - * @retval kStatus_I2C_ArbitrationLost Transfer error, arbitration lost. - * @retval kStataus_I2C_Nak Transfer error, receive NAK during transfer. - */ -status_t I2C_MasterWriteBlocking(I2C_Type *base, const uint8_t *txBuff, size_t txSize, uint32_t flags); - -/*! - * @brief Performs a polling receive transaction on the I2C bus. - * - * @note The I2C_MasterReadBlocking function stops the bus before reading the final byte. - * Without stopping the bus prior for the final read, the bus issues another read, resulting - * in garbage data being read into the data register. - * - * @param base I2C peripheral base pointer. - * @param rxBuff The pointer to the data to store the received data. - * @param rxSize The length in bytes of the data to be received. - * @param flags Transfer control flag to decide whether need to send a stop, use kI2C_TransferDefaultFlag - * to issue a stop and kI2C_TransferNoStop to not send a stop. - * @retval kStatus_Success Successfully complete the data transmission. - * @retval kStatus_I2C_Timeout Send stop signal failed, timeout. - */ -status_t I2C_MasterReadBlocking(I2C_Type *base, uint8_t *rxBuff, size_t rxSize, uint32_t flags); - -/*! - * @brief Performs a polling send transaction on the I2C bus. - * - * @param base The I2C peripheral base pointer. - * @param txBuff The pointer to the data to be transferred. - * @param txSize The length in bytes of the data to be transferred. - * @retval kStatus_Success Successfully complete the data transmission. - * @retval kStatus_I2C_ArbitrationLost Transfer error, arbitration lost. - * @retval kStataus_I2C_Nak Transfer error, receive NAK during transfer. - */ -status_t I2C_SlaveWriteBlocking(I2C_Type *base, const uint8_t *txBuff, size_t txSize); - -/*! - * @brief Performs a polling receive transaction on the I2C bus. - * - * @param base I2C peripheral base pointer. - * @param rxBuff The pointer to the data to store the received data. - * @param rxSize The length in bytes of the data to be received. - * @retval kStatus_Success Successfully complete data receive. - * @retval kStatus_I2C_Timeout Wait status flag timeout. - */ -status_t I2C_SlaveReadBlocking(I2C_Type *base, uint8_t *rxBuff, size_t rxSize); - -/*! - * @brief Performs a master polling transfer on the I2C bus. - * - * @note The API does not return until the transfer succeeds or fails due - * to arbitration lost or receiving a NAK. - * - * @param base I2C peripheral base address. - * @param xfer Pointer to the transfer structure. - * @retval kStatus_Success Successfully complete the data transmission. - * @retval kStatus_I2C_Busy Previous transmission still not finished. - * @retval kStatus_I2C_Timeout Transfer error, wait signal timeout. - * @retval kStatus_I2C_ArbitrationLost Transfer error, arbitration lost. - * @retval kStataus_I2C_Nak Transfer error, receive NAK during transfer. - */ -status_t I2C_MasterTransferBlocking(I2C_Type *base, i2c_master_transfer_t *xfer); - -/*! @} */ - -/*! - * @name Transactional - * @{ - */ - -/*! - * @brief Initializes the I2C handle which is used in transactional functions. - * - * @param base I2C base pointer. - * @param handle pointer to i2c_master_handle_t structure to store the transfer state. - * @param callback pointer to user callback function. - * @param userData user parameter passed to the callback function. - */ -void I2C_MasterTransferCreateHandle(I2C_Type *base, - i2c_master_handle_t *handle, - i2c_master_transfer_callback_t callback, - void *userData); - -/*! - * @brief Performs a master interrupt non-blocking transfer on the I2C bus. - * - * @note Calling the API returns immediately after transfer initiates. The user needs - * to call I2C_MasterGetTransferCount to poll the transfer status to check whether - * the transfer is finished. If the return status is not kStatus_I2C_Busy, the transfer - * is finished. - * - * @param base I2C base pointer. - * @param handle pointer to i2c_master_handle_t structure which stores the transfer state. - * @param xfer pointer to i2c_master_transfer_t structure. - * @retval kStatus_Success Successfully start the data transmission. - * @retval kStatus_I2C_Busy Previous transmission still not finished. - * @retval kStatus_I2C_Timeout Transfer error, wait signal timeout. - */ -status_t I2C_MasterTransferNonBlocking(I2C_Type *base, i2c_master_handle_t *handle, i2c_master_transfer_t *xfer); - -/*! - * @brief Gets the master transfer status during a interrupt non-blocking transfer. - * - * @param base I2C base pointer. - * @param handle pointer to i2c_master_handle_t structure which stores the transfer state. - * @param count Number of bytes transferred so far by the non-blocking transaction. - * @retval kStatus_InvalidArgument count is Invalid. - * @retval kStatus_Success Successfully return the count. - */ -status_t I2C_MasterTransferGetCount(I2C_Type *base, i2c_master_handle_t *handle, size_t *count); - -/*! - * @brief Aborts an interrupt non-blocking transfer early. - * - * @note This API can be called at any time when an interrupt non-blocking transfer initiates - * to abort the transfer early. - * - * @param base I2C base pointer. - * @param handle pointer to i2c_master_handle_t structure which stores the transfer state - * @retval kStatus_I2C_Timeout Timeout during polling flag. - * @retval kStatus_Success Successfully abort the transfer. - */ -status_t I2C_MasterTransferAbort(I2C_Type *base, i2c_master_handle_t *handle); - -/*! - * @brief Master interrupt handler. - * - * @param base I2C base pointer. - * @param i2cHandle pointer to i2c_master_handle_t structure. - */ -void I2C_MasterTransferHandleIRQ(I2C_Type *base, void *i2cHandle); - -/*! - * @brief Initializes the I2C handle which is used in transactional functions. - * - * @param base I2C base pointer. - * @param handle pointer to i2c_slave_handle_t structure to store the transfer state. - * @param callback pointer to user callback function. - * @param userData user parameter passed to the callback function. - */ -void I2C_SlaveTransferCreateHandle(I2C_Type *base, - i2c_slave_handle_t *handle, - i2c_slave_transfer_callback_t callback, - void *userData); - -/*! - * @brief Starts accepting slave transfers. - * - * Call this API after calling the I2C_SlaveInit() and I2C_SlaveTransferCreateHandle() to start processing - * transactions driven by an I2C master. The slave monitors the I2C bus and passes events to the - * callback that was passed into the call to I2C_SlaveTransferCreateHandle(). The callback is always invoked - * from the interrupt context. - * - * The set of events received by the callback is customizable. To do so, set the @a eventMask parameter to - * the OR'd combination of #i2c_slave_transfer_event_t enumerators for the events you wish to receive. - * The kI2C_SlaveTransmitEvent and kLPI2C_SlaveReceiveEvent events are always enabled and do not need - * to be included in the mask. Alternatively, pass 0 to get a default set of only the transmit and - * receive events that are always enabled. In addition, the #kI2C_SlaveAllEvents constant is provided as - * a convenient way to enable all events. - * - * @param base The I2C peripheral base address. - * @param handle Pointer to i2c_slave_handle_t structure which stores the transfer state. - * @param eventMask Bit mask formed by OR'ing together #i2c_slave_transfer_event_t enumerators to specify - * which events to send to the callback. Other accepted values are 0 to get a default set of - * only the transmit and receive events, and #kI2C_SlaveAllEvents to enable all events. - * - * @retval kStatus_Success Slave transfers were successfully started. - * @retval kStatus_I2C_Busy Slave transfers have already been started on this handle. - */ -status_t I2C_SlaveTransferNonBlocking(I2C_Type *base, i2c_slave_handle_t *handle, uint32_t eventMask); - -/*! - * @brief Aborts the slave transfer. - * - * @note This API can be called at any time to stop slave for handling the bus events. - * - * @param base I2C base pointer. - * @param handle pointer to i2c_slave_handle_t structure which stores the transfer state. - */ -void I2C_SlaveTransferAbort(I2C_Type *base, i2c_slave_handle_t *handle); - -/*! - * @brief Gets the slave transfer remaining bytes during a interrupt non-blocking transfer. - * - * @param base I2C base pointer. - * @param handle pointer to i2c_slave_handle_t structure. - * @param count Number of bytes transferred so far by the non-blocking transaction. - * @retval kStatus_InvalidArgument count is Invalid. - * @retval kStatus_Success Successfully return the count. - */ -status_t I2C_SlaveTransferGetCount(I2C_Type *base, i2c_slave_handle_t *handle, size_t *count); - -/*! - * @brief Slave interrupt handler. - * - * @param base I2C base pointer. - * @param i2cHandle pointer to i2c_slave_handle_t structure which stores the transfer state - */ -void I2C_SlaveTransferHandleIRQ(I2C_Type *base, void *i2cHandle); - -/*! @} */ -#if defined(__cplusplus) -} -#endif /*_cplusplus. */ -/*! @} */ - -#endif /* FSL_I2C_H_*/ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_i2c_dma.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_i2c_dma.c deleted file mode 100644 index 0337f117643..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_i2c_dma.c +++ /dev/null @@ -1,608 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2019,2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_i2c_dma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.i2c_dma" -#endif - -/*handle->transfer.dataSize; - uint8_t tmpdata; - - /* Disable DMA. */ - I2C_EnableDMA(i2cPrivateHandle->base, false); - - /* Send stop if kI2C_TransferNoStop flag is not asserted. */ - if (0U == (i2cPrivateHandle->handle->transfer.flags & (uint32_t)kI2C_TransferNoStopFlag)) - { - if (i2cPrivateHandle->handle->transfer.direction == kI2C_Read) - { - /* Change to send NAK at the last byte. */ - i2cPrivateHandle->base->C1 |= I2C_C1_TXAK_MASK; - - /* Wait the last data to be received. */ - while (0U == (i2cPrivateHandle->base->S & (uint8_t)kI2C_TransferCompleteFlag)) - { - } - - /* Send stop signal. */ - result = I2C_MasterStop(i2cPrivateHandle->base); - - /* Read the last data byte. */ - tmpdata = i2cPrivateHandle->base->D; - *(i2cPrivateHandle->handle->transfer.data + tmpsize - 1U) = tmpdata; - } - else - { - /* Wait the last data to be sent. */ - while (0U == (i2cPrivateHandle->base->S & (uint8_t)kI2C_TransferCompleteFlag)) - { - } - - /* Send stop signal. */ - result = I2C_MasterStop(i2cPrivateHandle->base); - } - } - else - { - if (i2cPrivateHandle->handle->transfer.direction == kI2C_Read) - { - /* Change to send NAK at the last byte. */ - i2cPrivateHandle->base->C1 |= I2C_C1_TXAK_MASK; - - /* Wait the last data to be received. */ - while (0U == (i2cPrivateHandle->base->S & (uint8_t)kI2C_TransferCompleteFlag)) - { - } - - /* Change direction to send. */ - i2cPrivateHandle->base->C1 |= I2C_C1_TX_MASK; - - /* Read the last data byte. */ - tmpdata = i2cPrivateHandle->base->D; - *(i2cPrivateHandle->handle->transfer.data + tmpsize - 1U) = tmpdata; - } - } - - i2cPrivateHandle->handle->state = (uint8_t)kIdleState; - - if (i2cPrivateHandle->handle->completionCallback != NULL) - { - i2cPrivateHandle->handle->completionCallback(i2cPrivateHandle->base, i2cPrivateHandle->handle, result, - i2cPrivateHandle->handle->userData); - } -} - -static status_t I2C_CheckAndClearError(I2C_Type *base, uint32_t status) -{ - status_t result = kStatus_Success; - - /* Check arbitration lost. */ - if ((status & (uint32_t)kI2C_ArbitrationLostFlag) != 0U) - { - /* Clear arbitration lost flag. */ - base->S = (uint8_t)kI2C_ArbitrationLostFlag; - result = kStatus_I2C_ArbitrationLost; - } - /* Check NAK */ - else if ((status & (uint32_t)kI2C_ReceiveNakFlag) != 0U) - { - result = kStatus_I2C_Nak; - } - else - { - /* Avoid MISRA 2012 rule 15.7 */ - } - - return result; -} - -static status_t I2C_InitTransferStateMachineDMA(I2C_Type *base, - i2c_master_dma_handle_t *handle, - i2c_master_transfer_t *xfer) -{ - assert(handle != NULL); - assert(xfer != NULL); - - /* Set up transfer first. */ - i2c_direction_t direction = xfer->direction; - status_t result = kStatus_Success; -#if I2C_RETRY_TIMES - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - - if (handle->state != (uint8_t)kIdleState) - { - return kStatus_I2C_Busy; - } - else - { - /* Init the handle member. */ - handle->transfer = *xfer; - - /* Save total transfer size. */ - handle->transferSize = xfer->dataSize; - - handle->state = (uint8_t)kTransferDataState; - - /* Clear all status before transfer. */ - I2C_MasterClearStatusFlags(base, (uint32_t)kClearFlags); - - /* Change to send write address when it's a read operation with command. */ - if ((xfer->subaddressSize > 0U) && (xfer->direction == kI2C_Read)) - { - direction = kI2C_Write; - } - - /* If repeated start is requested, send repeated start. */ - if ((handle->transfer.flags & (uint32_t)kI2C_TransferRepeatedStartFlag) != 0U) - { - result = I2C_MasterRepeatedStart(base, handle->transfer.slaveAddress, direction); - } - else /* For normal transfer, send start. */ - { - result = I2C_MasterStart(base, handle->transfer.slaveAddress, direction); - } - - if (result != kStatus_Success) - { - return result; - } - -#if I2C_RETRY_TIMES - while ((0U == (base->S & (uint8_t)kI2C_IntPendingFlag)) && (0U != --waitTimes)) - { - } - if (waitTimes == 0U) - { - return kStatus_I2C_Timeout; - } -#else - while (0U == (base->S & (uint8_t)kI2C_IntPendingFlag)) - { - } -#endif - - /* Check if there's transfer error. */ - result = I2C_CheckAndClearError(base, base->S); - - /* Return if error. */ - if (result != kStatus_Success) - { - if (result == kStatus_I2C_Nak) - { - result = kStatus_I2C_Addr_Nak; - - if (I2C_MasterStop(base) != kStatus_Success) - { - result = kStatus_I2C_Timeout; - } - - if (handle->completionCallback != NULL) - { - (handle->completionCallback)(base, handle, result, handle->userData); - } - } - - return result; - } - - /* Send subaddress. */ - if (handle->transfer.subaddressSize != 0U) - { - do - { - /* Clear interrupt pending flag. */ - base->S = (uint8_t)kI2C_IntPendingFlag; - - handle->transfer.subaddressSize--; - base->D = (uint8_t)((handle->transfer.subaddress) >> (8U * handle->transfer.subaddressSize)); - - /* Wait until data transfer complete. */ -#if I2C_RETRY_TIMES - waitTimes = I2C_RETRY_TIMES; - while ((0U == (base->S & (uint8_t)kI2C_IntPendingFlag)) && (0U != --waitTimes)) - { - } - if (waitTimes == 0U) - { - return kStatus_I2C_Timeout; - } -#else - while (0U == (base->S & (uint8_t)kI2C_IntPendingFlag)) - { - } -#endif - - /* Check if there's transfer error. */ - result = I2C_CheckAndClearError(base, base->S); - - if (result != kStatus_Success) - { - return result; - } - - } while (handle->transfer.subaddressSize > 0U); - - if (handle->transfer.direction == kI2C_Read) - { - /* Clear pending flag. */ - base->S = (uint8_t)kI2C_IntPendingFlag; - - /* Send repeated start and slave address. */ - result = I2C_MasterRepeatedStart(base, handle->transfer.slaveAddress, kI2C_Read); - - if (result != kStatus_Success) - { - return result; - } - - /* Wait until data transfer complete. */ -#if I2C_RETRY_TIMES - waitTimes = I2C_RETRY_TIMES; - while ((0U == (base->S & (uint8_t)kI2C_IntPendingFlag)) && (0U != --waitTimes)) - { - } - if (waitTimes == 0U) - { - return kStatus_I2C_Timeout; - } -#else - while (0U == (base->S & (uint8_t)kI2C_IntPendingFlag)) - { - } -#endif - - /* Check if there's transfer error. */ - result = I2C_CheckAndClearError(base, base->S); - - if (result != kStatus_Success) - { - return result; - } - } - } - - /* Clear pending flag. */ - base->S = (uint8_t)kI2C_IntPendingFlag; - } - - return result; -} - -static void I2C_MasterTransferDMAConfig(I2C_Type *base, i2c_master_dma_handle_t *handle) -{ - dma_transfer_config_t transfer_config = {0}; - dma_transfer_options_t transfer_options = kDMA_EnableInterrupt; - - if (handle->transfer.direction == kI2C_Read) - { - transfer_config.srcAddr = (uint32_t)I2C_GetDataRegAddr(base); - transfer_config.destAddr = (uint32_t)(handle->transfer.data); - transfer_config.transferSize = (handle->transfer.dataSize - 1U); - transfer_config.srcSize = kDMA_Transfersize8bits; - transfer_config.enableSrcIncrement = false; - transfer_config.destSize = kDMA_Transfersize8bits; - transfer_config.enableDestIncrement = true; - } - else - { - transfer_config.srcAddr = (uint32_t)(handle->transfer.data + 1U); - transfer_config.destAddr = (uint32_t)I2C_GetDataRegAddr(base); - transfer_config.transferSize = (handle->transfer.dataSize - 1U); - transfer_config.srcSize = kDMA_Transfersize8bits; - transfer_config.enableSrcIncrement = true; - transfer_config.destSize = kDMA_Transfersize8bits; - transfer_config.enableDestIncrement = false; - } - - (void)DMA_SubmitTransfer(handle->dmaHandle, &transfer_config, (uint32_t)transfer_options); - DMA_StartTransfer(handle->dmaHandle); -} - -/*! - * brief Initializes the I2C handle which is used in transactional functions. - * - * param base I2C peripheral base address - * param handle Pointer to the i2c_master_dma_handle_t structure - * param callback Pointer to the user callback function - * param userData A user parameter passed to the callback function - * param dmaHandle DMA handle pointer - */ -void I2C_MasterTransferCreateHandleDMA(I2C_Type *base, - i2c_master_dma_handle_t *handle, - i2c_master_dma_transfer_callback_t callback, - void *userData, - dma_handle_t *dmaHandle) -{ - assert(handle != NULL); - assert(dmaHandle != NULL); - - uint32_t instance = I2C_GetInstance(base); - - /* Zero handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Set the user callback and userData. */ - handle->completionCallback = callback; - handle->userData = userData; - - /* Set the handle for DMA. */ - handle->dmaHandle = dmaHandle; - - s_dmaPrivateHandle[instance].base = base; - s_dmaPrivateHandle[instance].handle = handle; - - DMA_SetCallback(dmaHandle, (dma_callback)I2C_MasterTransferCallbackDMA, &s_dmaPrivateHandle[instance]); -} - -/*! - * brief Performs a master DMA non-blocking transfer on the I2C bus. - * - * param base I2C peripheral base address - * param handle A pointer to the i2c_master_dma_handle_t structure - * param xfer A pointer to the transfer structure of the i2c_master_transfer_t - * retval kStatus_Success Successfully completes the data transmission. - * retval kStatus_I2C_Busy A previous transmission is still not finished. - * retval kStatus_I2C_Timeout A transfer error, waits for the signal timeout. - * retval kStatus_I2C_ArbitrationLost A transfer error, arbitration lost. - * retval kStataus_I2C_Nak A transfer error, receives NAK during transfer. - */ -status_t I2C_MasterTransferDMA(I2C_Type *base, i2c_master_dma_handle_t *handle, i2c_master_transfer_t *xfer) -{ - assert(handle != NULL); - assert(xfer != NULL); - - status_t result; - uint8_t tmpReg; - uint8_t tmpdata; - - /* Disable dma transfer. */ - I2C_EnableDMA(base, false); - - /* Send address and command buffer(if there is), until senddata phase or receive data phase. */ - result = I2C_InitTransferStateMachineDMA(base, handle, xfer); - - if (result != kStatus_Success) - { - /* Send stop if received Nak. */ - if (result == kStatus_I2C_Nak) - { - if (I2C_MasterStop(base) != kStatus_Success) - { - result = kStatus_I2C_Timeout; - } - } - - /* Reset the state to idle state. */ - handle->state = (uint8_t)kIdleState; - - return result; - } - - /* Configure dma transfer. */ - /* For i2c send, need to send 1 byte first to trigger the dma, for i2c read, - need to send stop before reading the last byte, so the dma transfer size should - be (xSize - 1). */ - if (handle->transfer.dataSize > 1U) - { - I2C_MasterTransferDMAConfig(base, handle); - if (handle->transfer.direction == kI2C_Read) - { - /* Change direction for receive. */ - base->C1 &= ~((uint8_t)I2C_C1_TX_MASK | (uint8_t)I2C_C1_TXAK_MASK); - - /* Read dummy to release the bus. */ - (void)base->D; - - /* Enabe dma transfer. */ - I2C_EnableDMA(base, true); - } - else - { - /* Enabe dma transfer. */ - I2C_EnableDMA(base, true); - - /* Send the first data. */ - base->D = *handle->transfer.data; - } - } - else /* If transfer size is 1, use polling method. */ - { - if (handle->transfer.direction == kI2C_Read) - { - tmpReg = base->C1; - - /* Change direction to Rx. */ - tmpReg &= ~(uint8_t)I2C_C1_TX_MASK; - - /* Configure send NAK */ - tmpReg |= I2C_C1_TXAK_MASK; - - base->C1 = tmpReg; - - /* Read dummy to release the bus. */ - (void)base->D; - } - else - { - base->D = *handle->transfer.data; - } - - /* Wait until data transfer complete. */ -#if I2C_RETRY_TIMES - uint32_t waitTimes = I2C_RETRY_TIMES; - while ((0U == (base->S & (uint8_t)kI2C_IntPendingFlag)) && (0U != --waitTimes)) - { - } - if (waitTimes == 0U) - { - return kStatus_I2C_Timeout; - } -#else - while (0U == (base->S & (uint8_t)kI2C_IntPendingFlag)) - { - } -#endif - - /* Clear pending flag. */ - base->S = (uint8_t)kI2C_IntPendingFlag; - - /* Send stop if kI2C_TransferNoStop flag is not asserted. */ - if (0U == (handle->transfer.flags & (uint32_t)kI2C_TransferNoStopFlag)) - { - result = I2C_MasterStop(base); - } - else - { - /* Change direction to send. */ - base->C1 |= I2C_C1_TX_MASK; - } - - /* Read the last byte of data. */ - if (handle->transfer.direction == kI2C_Read) - { - tmpdata = base->D; - *handle->transfer.data = tmpdata; - } - - /* Reset the state to idle. */ - handle->state = (uint8_t)kIdleState; - - /* Call the callback function after the function has completed. */ - if (handle->completionCallback != NULL) - { - handle->completionCallback(base, handle, result, handle->userData); - } - } - - return result; -} - -/*! - * brief Gets a master transfer status during a DMA non-blocking transfer. - * - * param base I2C peripheral base address - * param handle A pointer to the i2c_master_dma_handle_t structure - * param count A number of bytes transferred so far by the non-blocking transaction. - */ -status_t I2C_MasterTransferGetCountDMA(I2C_Type *base, i2c_master_dma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - if ((uint8_t)kIdleState != handle->state) - { - *count = (handle->transferSize - DMA_GetRemainingBytes(handle->dmaHandle->base, handle->dmaHandle->channel)); - } - else - { - *count = handle->transferSize; - } - - return kStatus_Success; -} - -/*! - * brief Aborts a master DMA non-blocking transfer early. - * - * param base I2C peripheral base address - * param handle A pointer to the i2c_master_dma_handle_t structure. - */ -void I2C_MasterTransferAbortDMA(I2C_Type *base, i2c_master_dma_handle_t *handle) -{ - DMA_AbortTransfer(handle->dmaHandle); - - /* Disable dma transfer. */ - I2C_EnableDMA(base, false); - - /* Reset the state to idle. */ - handle->state = (uint8_t)kIdleState; -} diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_i2c_dma.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_i2c_dma.h deleted file mode 100644 index 45fb19faac4..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_i2c_dma.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_I2C_DMA_H_ -#define FSL_I2C_DMA_H_ - -#include "fsl_i2c.h" -#include "fsl_dma.h" - -/*! - * @addtogroup i2c_dma_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief I2C DMA driver version. */ -#define FSL_I2C_DMA_DRIVER_VERSION (MAKE_VERSION(2, 0, 9)) -/*! @} */ - -/*! @brief Retry times for waiting flag. */ -#ifndef I2C_RETRY_TIMES -#define I2C_RETRY_TIMES 0U /* Define to zero means keep waiting until the flag is assert/deassert. */ -#endif - -/*! @brief I2C master DMA handle typedef. */ -typedef struct _i2c_master_dma_handle i2c_master_dma_handle_t; - -/*! @brief I2C master DMA transfer callback typedef. */ -typedef void (*i2c_master_dma_transfer_callback_t)(I2C_Type *base, - i2c_master_dma_handle_t *handle, - status_t status, - void *userData); - -/*! @brief I2C master DMA transfer structure. */ -struct _i2c_master_dma_handle -{ - i2c_master_transfer_t transfer; /*!< I2C master transfer struct. */ - size_t transferSize; /*!< Total bytes to be transferred. */ - uint8_t state; /*!< I2C master transfer status. */ - dma_handle_t *dmaHandle; /*!< The DMA handler used. */ - i2c_master_dma_transfer_callback_t - completionCallback; /*!< A callback function called after the DMA transfer finished. */ - void *userData; /*!< A callback parameter passed to the callback function. */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus. */ - -/*! - * @name I2C Block DMA Transfer Operation - * @{ - */ - -/*! - * @brief Initializes the I2C handle which is used in transactional functions. - * - * @param base I2C peripheral base address - * @param handle Pointer to the i2c_master_dma_handle_t structure - * @param callback Pointer to the user callback function - * @param userData A user parameter passed to the callback function - * @param dmaHandle DMA handle pointer - */ -void I2C_MasterTransferCreateHandleDMA(I2C_Type *base, - i2c_master_dma_handle_t *handle, - i2c_master_dma_transfer_callback_t callback, - void *userData, - dma_handle_t *dmaHandle); - -/*! - * @brief Performs a master DMA non-blocking transfer on the I2C bus. - * - * @param base I2C peripheral base address - * @param handle A pointer to the i2c_master_dma_handle_t structure - * @param xfer A pointer to the transfer structure of the i2c_master_transfer_t - * @retval kStatus_Success Successfully completes the data transmission. - * @retval kStatus_I2C_Busy A previous transmission is still not finished. - * @retval kStatus_I2C_Timeout A transfer error, waits for the signal timeout. - * @retval kStatus_I2C_ArbitrationLost A transfer error, arbitration lost. - * @retval kStataus_I2C_Nak A transfer error, receives NAK during transfer. - */ -status_t I2C_MasterTransferDMA(I2C_Type *base, i2c_master_dma_handle_t *handle, i2c_master_transfer_t *xfer); - -/*! - * @brief Gets a master transfer status during a DMA non-blocking transfer. - * - * @param base I2C peripheral base address - * @param handle A pointer to the i2c_master_dma_handle_t structure - * @param count A number of bytes transferred so far by the non-blocking transaction. - */ -status_t I2C_MasterTransferGetCountDMA(I2C_Type *base, i2c_master_dma_handle_t *handle, size_t *count); - -/*! - * @brief Aborts a master DMA non-blocking transfer early. - * - * @param base I2C peripheral base address - * @param handle A pointer to the i2c_master_dma_handle_t structure. - */ -void I2C_MasterTransferAbortDMA(I2C_Type *base, i2c_master_dma_handle_t *handle); - -/*! @} */ -#if defined(__cplusplus) -} -#endif /*_cplusplus. */ -/*! @} */ -#endif /*FSL_I2C_DMA_H_*/ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_llwu.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_llwu.c deleted file mode 100644 index 08e5dc11907..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_llwu.c +++ /dev/null @@ -1,481 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_llwu.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.llwu" -#endif - -#if (defined(FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN) && FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN) -/*! - * brief Sets the external input pin source mode. - * - * This function sets the external input pin source mode that is used - * as a wake up source. - * - * param base LLWU peripheral base address. - * param pinIndex A pin index to be enabled as an external wakeup source starting from 1. - * param pinMode A pin configuration mode defined in the llwu_external_pin_modes_t. - */ -void LLWU_SetExternalWakeupPinMode(LLWU_Type *base, uint32_t pinIndex, llwu_external_pin_mode_t pinMode) -{ -#if (defined(FSL_FEATURE_LLWU_REG_BITWIDTH) && (FSL_FEATURE_LLWU_REG_BITWIDTH == 32)) - volatile uint32_t *regBase; - uint32_t regOffset; - uint32_t reg; - - switch (pinIndex >> 4U) - { - case 0U: - regBase = &base->PE1; - break; -#if (defined(FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN) && (FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN > 16)) - case 1U: - regBase = &base->PE2; - break; -#endif /* FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN */ - default: - regBase = NULL; - break; - } - - if (NULL != regBase) - { - reg = *regBase; - regOffset = ((pinIndex & 0x0FU) << 1U); - reg &= LLWU_REG_VAL(~(3UL << regOffset)); - reg |= ((uint32_t)pinMode << regOffset); - *regBase = reg; - } -#else - volatile uint8_t *regBase; - uint8_t regOffset; - uint8_t reg; - switch (pinIndex >> 2U) - { - case 0U: - regBase = &base->PE1; - break; - case 1U: - regBase = &base->PE2; - break; -#if (defined(FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN) && (FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN > 8)) - case 2U: - regBase = &base->PE3; - break; -#endif /* FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN */ -#if (defined(FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN) && (FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN > 12)) - case 3U: - regBase = &base->PE4; - break; -#endif /* FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN */ -#if (defined(FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN) && (FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN > 16)) - case 4U: - regBase = &base->PE5; - break; -#endif /* FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN */ -#if (defined(FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN) && (FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN > 20)) - case 5U: - regBase = &base->PE6; - break; -#endif /* FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN */ -#if (defined(FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN) && (FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN > 24)) - case 6U: - regBase = &base->PE7; - break; -#endif /* FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN */ -#if (defined(FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN) && (FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN > 28)) - case 7U: - regBase = &base->PE8; - break; -#endif /* FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN */ - default: - regBase = NULL; - break; - } - - if (NULL != regBase) - { - reg = *regBase; - regOffset = (uint8_t)((pinIndex & 0x03U) << 1U); - reg &= LLWU_REG_VAL(~(3UL << regOffset)); - reg |= (uint8_t)((uint32_t)pinMode << regOffset); - *regBase = reg; - } -#endif /* FSL_FEATURE_LLWU_REG_BITWIDTH == 32 */ -} - -/*! - * brief Gets the external wakeup source flag. - * - * This function checks the external pin flag to detect whether the MCU is - * woken up by the specific pin. - * - * param base LLWU peripheral base address. - * param pinIndex A pin index, which starts from 1. - * return True if the specific pin is a wakeup source. - */ -bool LLWU_GetExternalWakeupPinFlag(LLWU_Type *base, uint32_t pinIndex) -{ -#if (defined(FSL_FEATURE_LLWU_REG_BITWIDTH) && (FSL_FEATURE_LLWU_REG_BITWIDTH == 32)) - return (0U != (base->PF & (1UL << pinIndex))); -#else - bool ret; - volatile uint8_t *regBase; - - switch (pinIndex >> 3U) - { -#if (defined(FSL_FEATURE_LLWU_HAS_PF) && FSL_FEATURE_LLWU_HAS_PF) - case 0U: - regBase = &base->PF1; - break; -#if (defined(FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN) && (FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN > 8)) - case 1U: - regBase = &base->PF2; - break; -#endif /* FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN */ -#if (defined(FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN) && (FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN > 16)) - case 2U: - regBase = &base->PF3; - break; -#endif /* FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN */ -#if (defined(FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN) && (FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN > 24)) - case 3U: - regBase = &base->PF4; - break; -#endif /* FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN */ -#else - case 0U: - regBase = &base->F1; - break; -#if (defined(FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN) && (FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN > 8)) - case 1U: - regBase = &base->F2; - break; -#endif /* FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN */ -#if (defined(FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN) && (FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN > 16)) - case 2U: - regBase = &base->F3; - break; -#endif /* FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN */ -#if (defined(FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN) && (FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN > 24)) - case 3U: - regBase = &base->F4; - break; -#endif /* FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN */ -#endif /* FSL_FEATURE_LLWU_HAS_PF */ - default: - regBase = NULL; - break; - } - - if (NULL != regBase) - { - if (0U != (*regBase & (1U << pinIndex % 8U))) - { - ret = true; - } - else - { - ret = false; - } - } - else - { - ret = false; - } - - return ret; -#endif /* FSL_FEATURE_LLWU_REG_BITWIDTH */ -} - -/*! - * brief Clears the external wakeup source flag. - * - * This function clears the external wakeup source flag for a specific pin. - * - * param base LLWU peripheral base address. - * param pinIndex A pin index, which starts from 1. - */ -void LLWU_ClearExternalWakeupPinFlag(LLWU_Type *base, uint32_t pinIndex) -{ -#if (defined(FSL_FEATURE_LLWU_REG_BITWIDTH) && (FSL_FEATURE_LLWU_REG_BITWIDTH == 32)) - base->PF = (1UL << pinIndex); -#else - volatile uint8_t *regBase; - switch (pinIndex >> 3U) - { -#if (defined(FSL_FEATURE_LLWU_HAS_PF) && FSL_FEATURE_LLWU_HAS_PF) - case 0U: - regBase = &base->PF1; - break; -#if (defined(FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN) && (FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN > 8)) - case 1U: - regBase = &base->PF2; - break; -#endif /* FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN */ -#if (defined(FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN) && (FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN > 16)) - case 2U: - regBase = &base->PF3; - break; -#endif /* FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN */ -#if (defined(FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN) && (FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN > 24)) - case 3U: - regBase = &base->PF4; - break; -#endif /* FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN */ -#else - case 0U: - regBase = &base->F1; - break; -#if (defined(FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN) && (FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN > 8)) - case 1U: - regBase = &base->F2; - break; -#endif /* FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN */ -#if (defined(FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN) && (FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN > 16)) - case 2U: - regBase = &base->F3; - break; -#endif /* FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN */ -#if (defined(FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN) && (FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN > 24)) - case 3U: - regBase = &base->F4; - break; -#endif /* FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN */ -#endif /* FSL_FEATURE_LLWU_HAS_PF */ - default: - regBase = NULL; - break; - } - if (NULL != regBase) - { - *regBase = (1U << pinIndex % 8U); - } -#endif /* FSL_FEATURE_LLWU_REG_BITWIDTH */ -} -#endif /* FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN */ - -#if (defined(FSL_FEATURE_LLWU_HAS_PIN_FILTER) && FSL_FEATURE_LLWU_HAS_PIN_FILTER) -/*! - * brief Sets the pin filter configuration. - * - * This function sets the pin filter configuration. - * - * param base LLWU peripheral base address. - * param filterIndex A pin filter index used to enable/disable the digital filter, starting from 1. - * param filterMode A filter mode configuration - */ -void LLWU_SetPinFilterMode(LLWU_Type *base, uint32_t filterIndex, llwu_external_pin_filter_mode_t filterMode) -{ -#if (defined(FSL_FEATURE_LLWU_REG_BITWIDTH) && (FSL_FEATURE_LLWU_REG_BITWIDTH == 32)) - uint32_t filt; - uint32_t shiftInReg; - - if ((filterIndex > 0U) && (filterIndex <= (uint32_t)FSL_FEATURE_LLWU_HAS_PIN_FILTER)) - { - shiftInReg = (filterIndex - 1U) * 8U; - - filt = base->FILT; - /* Clean the W1C bits, in case the flags are cleared by mistake. */ - filt &= ~(((uint32_t)LLWU_FILT_FILTF1_MASK << 0U) | ((uint32_t)LLWU_FILT_FILTF1_MASK << 8U) | - ((uint32_t)LLWU_FILT_FILTF1_MASK << 16U) | ((uint32_t)LLWU_FILT_FILTF1_MASK << 24U)); - - filt &= ~(((uint32_t)LLWU_FILT_FILTSEL1_MASK | (uint32_t)LLWU_FILT_FILTE1_MASK) << shiftInReg); - - filt |= - ((LLWU_FILT_FILTSEL1(filterMode.pinIndex) | LLWU_FILT_FILTE1(filterMode.filterMode) | LLWU_FILT_FILTF1_MASK) - << shiftInReg); - - base->FILT = filt; - } -#else - volatile uint8_t *regBase; - - switch (filterIndex) - { - case 1U: - regBase = &base->FILT1; - break; -#if (defined(FSL_FEATURE_LLWU_HAS_PIN_FILTER) && (FSL_FEATURE_LLWU_HAS_PIN_FILTER > 1)) - case 2U: - regBase = &base->FILT2; - break; -#endif /* FSL_FEATURE_LLWU_HAS_PIN_FILTER */ -#if (defined(FSL_FEATURE_LLWU_HAS_PIN_FILTER) && (FSL_FEATURE_LLWU_HAS_PIN_FILTER > 2)) - case 3U: - regBase = &base->FILT3; - break; -#endif /* FSL_FEATURE_LLWU_HAS_PIN_FILTER */ -#if (defined(FSL_FEATURE_LLWU_HAS_PIN_FILTER) && (FSL_FEATURE_LLWU_HAS_PIN_FILTER > 3)) - case 4U: - regBase = &base->FILT4; - break; -#endif /* FSL_FEATURE_LLWU_HAS_PIN_FILTER */ - default: - regBase = NULL; - break; - } - - if (NULL != regBase) - { - *regBase = (uint8_t)((*regBase & ~(LLWU_FILT1_FILTSEL_MASK | LLWU_FILT1_FILTE_MASK)) | - LLWU_FILT1_FILTSEL(filterMode.pinIndex) | LLWU_FILT1_FILTE(filterMode.filterMode) | - LLWU_FILT1_FILTF_MASK) /* W1C to clear the FILTF flag bit. */ - ; - } -#endif /* FSL_FEATURE_LLWU_REG_BITWIDTH */ -} - -/*! - * brief Gets the pin filter configuration. - * - * This function gets the pin filter flag. - * - * param base LLWU peripheral base address. - * param filterIndex A pin filter index, which starts from 1. - * return True if the flag is a source of the existing low-leakage power mode. - */ -bool LLWU_GetPinFilterFlag(LLWU_Type *base, uint32_t filterIndex) -{ -#if (defined(FSL_FEATURE_LLWU_REG_BITWIDTH) && (FSL_FEATURE_LLWU_REG_BITWIDTH == 32)) - return (0U != (base->FILT & (1UL << (filterIndex * 8U - 1U)))); -#else - bool status = false; - - switch (filterIndex) - { - case 1: - status = ((base->FILT1 & LLWU_FILT1_FILTF_MASK) != 0U); - break; -#if (defined(FSL_FEATURE_LLWU_HAS_PIN_FILTER) && (FSL_FEATURE_LLWU_HAS_PIN_FILTER > 1)) - case 2: - status = ((base->FILT2 & LLWU_FILT2_FILTF_MASK) != 0U); - break; -#endif /* FSL_FEATURE_LLWU_HAS_PIN_FILTER */ -#if (defined(FSL_FEATURE_LLWU_HAS_PIN_FILTER) && (FSL_FEATURE_LLWU_HAS_PIN_FILTER > 2)) - case 3: - status = ((base->FILT3 & LLWU_FILT3_FILTF_MASK) != 0U); - break; -#endif /* FSL_FEATURE_LLWU_HAS_PIN_FILTER */ -#if (defined(FSL_FEATURE_LLWU_HAS_PIN_FILTER) && (FSL_FEATURE_LLWU_HAS_PIN_FILTER > 3)) - case 4: - status = ((base->FILT4 & LLWU_FILT4_FILTF_MASK) != 0U); - break; -#endif /* FSL_FEATURE_LLWU_HAS_PIN_FILTER */ - default: - status = false; - break; - } - - return status; -#endif /* FSL_FEATURE_LLWU_REG_BITWIDTH */ -} - -/*! - * brief Clears the pin filter configuration. - * - * This function clears the pin filter flag. - * - * param base LLWU peripheral base address. - * param filterIndex A pin filter index to clear the flag, starting from 1. - */ -void LLWU_ClearPinFilterFlag(LLWU_Type *base, uint32_t filterIndex) -{ -#if (defined(FSL_FEATURE_LLWU_REG_BITWIDTH) && (FSL_FEATURE_LLWU_REG_BITWIDTH == 32)) - -#if (defined(FSL_FEATURE_LLWU_HAS_PIN_FILTER) && (FSL_FEATURE_LLWU_HAS_PIN_FILTER > 0)) - uint32_t reg; - - if ((filterIndex > 0U) && (filterIndex <= (uint32_t)FSL_FEATURE_LLWU_HAS_PIN_FILTER)) - { - reg = base->FILT; - - /* Clean the W1C bits, in case the flags are cleared by mistake. */ - reg &= ~(((uint32_t)LLWU_FILT_FILTF1_MASK << 0U) | ((uint32_t)LLWU_FILT_FILTF1_MASK << 8U) | - ((uint32_t)LLWU_FILT_FILTF1_MASK << 16U) | ((uint32_t)LLWU_FILT_FILTF1_MASK << 24U)); - - reg |= ((uint32_t)LLWU_FILT_FILTF1_MASK << ((filterIndex - 1U) * 8U)); - - base->FILT = reg; - } - -#endif - - return; -#else - volatile uint8_t *regBase; - uint8_t reg; - - switch (filterIndex) - { - case 1: - regBase = &base->FILT1; - break; -#if (defined(FSL_FEATURE_LLWU_HAS_PIN_FILTER) && (FSL_FEATURE_LLWU_HAS_PIN_FILTER > 1)) - case 2: - regBase = &base->FILT2; - break; -#endif /* FSL_FEATURE_LLWU_HAS_PIN_FILTER */ -#if (defined(FSL_FEATURE_LLWU_HAS_PIN_FILTER) && (FSL_FEATURE_LLWU_HAS_PIN_FILTER > 2)) - case 3: - regBase = &base->FILT3; - break; -#endif /* FSL_FEATURE_LLWU_HAS_PIN_FILTER */ -#if (defined(FSL_FEATURE_LLWU_HAS_PIN_FILTER) && (FSL_FEATURE_LLWU_HAS_PIN_FILTER > 3)) - case 4: - regBase = &base->FILT4; - break; -#endif /* FSL_FEATURE_LLWU_HAS_PIN_FILTER */ - default: - regBase = NULL; - break; - } - - if (NULL != regBase) - { - reg = *regBase; - reg |= LLWU_FILT1_FILTF_MASK; - *regBase = reg; - } -#endif /* FSL_FEATURE_LLWU_REG_BITWIDTH */ -} -#endif /* FSL_FEATURE_LLWU_HAS_PIN_FILTER */ - -#if (defined(FSL_FEATURE_LLWU_HAS_RESET_ENABLE) && FSL_FEATURE_LLWU_HAS_RESET_ENABLE) -/*! - * brief Sets the reset pin mode. - * - * This function determines how the reset pin is used as a low leakage mode exit source. - * - * param pinEnable Enable reset the pin filter - * param pinFilterEnable Specify whether the pin filter is enabled in Low-Leakage power mode. - */ -void LLWU_SetResetPinMode(LLWU_Type *base, bool pinEnable, bool pinFilterEnable) -{ - uint8_t reg; - - reg = base->RST; - - reg &= (uint8_t)(~(LLWU_RST_LLRSTE_MASK | LLWU_RST_RSTFILT_MASK)); - - if (pinEnable) - { - reg |= LLWU_RST_LLRSTE_MASK; - } - - if (pinFilterEnable) - { - reg |= LLWU_RST_RSTFILT_MASK; - } - - base->RST = reg; -} -#endif /* FSL_FEATURE_LLWU_HAS_RESET_ENABLE */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_llwu.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_llwu.h deleted file mode 100644 index 35b19b14ae9..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_llwu.h +++ /dev/null @@ -1,326 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LLWU_H_ -#define FSL_LLWU_H_ - -#include "fsl_common.h" - -/*! @addtogroup llwu */ -/*! @{ */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief LLWU driver version. */ -#define FSL_LLWU_DRIVER_VERSION (MAKE_VERSION(2, 0, 5)) -/*! @} */ - -#if (defined(FSL_FEATURE_LLWU_REG_BITWIDTH) && (FSL_FEATURE_LLWU_REG_BITWIDTH == 32)) -#define LLWU_REG_VAL(x) ((uint32_t)(x)) -#else -#define LLWU_REG_VAL(x) ((uint8_t)(x)) -#endif - -/*! - * @brief External input pin control modes - */ -typedef enum _llwu_external_pin_mode -{ - kLLWU_ExternalPinDisable = 0U, /*!< Pin disabled as a wakeup input. */ - kLLWU_ExternalPinRisingEdge = 1U, /*!< Pin enabled with the rising edge detection. */ - kLLWU_ExternalPinFallingEdge = 2U, /*!< Pin enabled with the falling edge detection.*/ - kLLWU_ExternalPinAnyEdge = 3U /*!< Pin enabled with any change detection. */ -} llwu_external_pin_mode_t; - -/*! - * @brief Digital filter control modes - */ -typedef enum _llwu_pin_filter_mode -{ - kLLWU_PinFilterDisable = 0U, /*!< Filter disabled. */ - kLLWU_PinFilterRisingEdge = 1U, /*!< Filter positive edge detection.*/ - kLLWU_PinFilterFallingEdge = 2U, /*!< Filter negative edge detection.*/ - kLLWU_PinFilterAnyEdge = 3U /*!< Filter any edge detection. */ -} llwu_pin_filter_mode_t; - -#if (defined(FSL_FEATURE_LLWU_HAS_VERID) && FSL_FEATURE_LLWU_HAS_VERID) -/*! - * @brief IP version ID definition. - */ -typedef struct _llwu_version_id -{ - uint16_t feature; /*!< A feature specification number. */ - uint8_t minor; /*!< The minor version number. */ - uint8_t major; /*!< The major version number. */ -} llwu_version_id_t; -#endif /* FSL_FEATURE_LLWU_HAS_VERID */ - -#if (defined(FSL_FEATURE_LLWU_HAS_PARAM) && FSL_FEATURE_LLWU_HAS_PARAM) -/*! - * @brief IP parameter definition. - */ -typedef struct _llwu_param -{ - uint8_t filters; /*!< A number of the pin filter. */ - uint8_t dmas; /*!< A number of the wakeup DMA. */ - uint8_t modules; /*!< A number of the wakeup module. */ - uint8_t pins; /*!< A number of the wake up pin. */ -} llwu_param_t; -#endif /* FSL_FEATURE_LLWU_HAS_PARAM */ - -#if (defined(FSL_FEATURE_LLWU_HAS_PIN_FILTER) && FSL_FEATURE_LLWU_HAS_PIN_FILTER) -/*! - * @brief An external input pin filter control structure - */ -typedef struct _llwu_external_pin_filter_mode -{ - uint32_t pinIndex; /*!< A pin number */ - llwu_pin_filter_mode_t filterMode; /*!< Filter mode */ -} llwu_external_pin_filter_mode_t; -#endif /* FSL_FEATURE_LLWU_HAS_PIN_FILTER */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Low-Leakage Wakeup Unit Control APIs - * @{ - */ - -#if (defined(FSL_FEATURE_LLWU_HAS_VERID) && FSL_FEATURE_LLWU_HAS_VERID) -/*! - * @brief Gets the LLWU version ID. - * - * This function gets the LLWU version ID, including the major version number, - * the minor version number, and the feature specification number. - * - * @param base LLWU peripheral base address. - * @param versionId A pointer to the version ID structure. - */ -static inline void LLWU_GetVersionId(LLWU_Type *base, llwu_version_id_t *versionId) -{ - union - { - llwu_version_id_t vid; - uint32_t u32; - } llwuVID; - - llwuVID.u32 = base->VERID; - - *versionId = llwuVID.vid; -} -#endif /* FSL_FEATURE_LLWU_HAS_VERID */ - -#if (defined(FSL_FEATURE_LLWU_HAS_PARAM) && FSL_FEATURE_LLWU_HAS_PARAM) -/*! - * @brief Gets the LLWU parameter. - * - * This function gets the LLWU parameter, including a wakeup pin number, a module - * number, a DMA number, and a pin filter number. - * - * @param base LLWU peripheral base address. - * @param param A pointer to the LLWU parameter structure. - */ -static inline void LLWU_GetParam(LLWU_Type *base, llwu_param_t *param) -{ - union - { - llwu_param_t param; - uint32_t u32; - } llwuParam; - - llwuParam.u32 = base->PARAM; - - *param = llwuParam.param; -} -#endif /* FSL_FEATURE_LLWU_HAS_PARAM */ - -#if (defined(FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN) && FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN) -/*! - * @brief Sets the external input pin source mode. - * - * This function sets the external input pin source mode that is used - * as a wake up source. - * - * @param base LLWU peripheral base address. - * @param pinIndex A pin index to be enabled as an external wakeup source starting from 1. - * @param pinMode A pin configuration mode defined in the llwu_external_pin_modes_t. - */ -void LLWU_SetExternalWakeupPinMode(LLWU_Type *base, uint32_t pinIndex, llwu_external_pin_mode_t pinMode); - -/*! - * @brief Gets the external wakeup source flag. - * - * This function checks the external pin flag to detect whether the MCU is - * woken up by the specific pin. - * - * @param base LLWU peripheral base address. - * @param pinIndex A pin index, which starts from 1. - * @return True if the specific pin is a wakeup source. - */ -bool LLWU_GetExternalWakeupPinFlag(LLWU_Type *base, uint32_t pinIndex); - -/*! - * @brief Clears the external wakeup source flag. - * - * This function clears the external wakeup source flag for a specific pin. - * - * @param base LLWU peripheral base address. - * @param pinIndex A pin index, which starts from 1. - */ -void LLWU_ClearExternalWakeupPinFlag(LLWU_Type *base, uint32_t pinIndex); -#endif /* FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN */ - -#if (defined(FSL_FEATURE_LLWU_HAS_INTERNAL_MODULE) && FSL_FEATURE_LLWU_HAS_INTERNAL_MODULE) -/*! - * @brief Enables/disables the internal module source. - * - * This function enables/disables the internal module source mode that is used - * as a wake up source. - * - * @param base LLWU peripheral base address. - * @param moduleIndex A module index to be enabled as an internal wakeup source starting from 1. - * @param enable An enable or a disable setting - */ -static inline void LLWU_EnableInternalModuleInterruptWakup(LLWU_Type *base, uint32_t moduleIndex, bool enable) -{ - if (enable) - { - base->ME |= LLWU_REG_VAL(1UL << moduleIndex); - } - else - { - base->ME &= LLWU_REG_VAL(~(1UL << moduleIndex)); - } -} - -#if (!(defined(FSL_FEATURE_LLWU_HAS_NO_INTERNAL_MODULE_WAKEUP_FLAG_REG) && \ - FSL_FEATURE_LLWU_HAS_NO_INTERNAL_MODULE_WAKEUP_FLAG_REG)) -/* Re-define the register which includes the internal wakeup module flag. */ -#if (defined(FSL_FEATURE_LLWU_REG_BITWIDTH) && (FSL_FEATURE_LLWU_REG_BITWIDTH == 32)) /* 32-bit LLWU. */ -#if (defined(FSL_FEATURE_LLWU_HAS_MF) && FSL_FEATURE_LLWU_HAS_MF) -#define INTERNAL_WAKEUP_MODULE_FLAG_REG MF -#else -#error "Unsupported internal module flag register." -#endif -#else /* 8-bit LLUW. */ -#if (defined(FSL_FEATURE_LLWU_HAS_MF) && FSL_FEATURE_LLWU_HAS_MF) -#define INTERNAL_WAKEUP_MODULE_FLAG_REG MF5 -#elif (defined(FSL_FEATURE_LLWU_HAS_PF) && FSL_FEATURE_LLWU_HAS_PF) -#define INTERNAL_WAKEUP_MODULE_FLAG_REG PF3 -#elif (!(defined(FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN) && (FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN > 16))) -#define INTERNAL_WAKEUP_MODULE_FLAG_REG F3 -#else -#error "Unsupported internal module flag register." -#endif -#endif /* FSL_FEATURE_LLWU_REG_BITWIDTH */ - -/*! - * @brief Gets the external wakeup source flag. - * - * This function checks the external pin flag to detect whether the system is - * woken up by the specific pin. - * - * @param base LLWU peripheral base address. - * @param moduleIndex A module index, which starts from 1. - * @return True if the specific pin is a wake up source. - */ -static inline bool LLWU_GetInternalWakeupModuleFlag(LLWU_Type *base, uint32_t moduleIndex) -{ - return ((1UL << moduleIndex) == ((uint32_t)base->INTERNAL_WAKEUP_MODULE_FLAG_REG & (1UL << moduleIndex))); -} -#endif /* FSL_FEATURE_LLWU_HAS_NO_INTERNAL_MODULE_WAKEUP_FLAG_REG */ -#endif /* FSL_FEATURE_LLWU_HAS_INTERNAL_MODULE */ - -#if (defined(FSL_FEATURE_LLWU_HAS_DMA_ENABLE_REG) && FSL_FEATURE_LLWU_HAS_DMA_ENABLE_REG) -/*! - * @brief Enables/disables the internal module DMA wakeup source. - * - * This function enables/disables the internal DMA that is used as a wake up source. - * - * @param base LLWU peripheral base address. - * @param moduleIndex An internal module index which is used as a DMA request source, starting from 1. - * @param enable Enable or disable the DMA request source - */ -static inline void LLWU_EnableInternalModuleDmaRequestWakup(LLWU_Type *base, uint32_t moduleIndex, bool enable) -{ - if (enable) - { - base->DE |= LLWU_REG_VAL(1UL << moduleIndex); - } - else - { - base->DE &= LLWU_REG_VAL(~(1UL << moduleIndex)); - } -} -#endif /* FSL_FEATURE_LLWU_HAS_DMA_ENABLE_REG */ - -#if (defined(FSL_FEATURE_LLWU_HAS_PIN_FILTER) && FSL_FEATURE_LLWU_HAS_PIN_FILTER) -/*! - * @brief Sets the pin filter configuration. - * - * This function sets the pin filter configuration. - * - * @param base LLWU peripheral base address. - * @param filterIndex A pin filter index used to enable/disable the digital filter, starting from 1. - * @param filterMode A filter mode configuration - */ -void LLWU_SetPinFilterMode(LLWU_Type *base, uint32_t filterIndex, llwu_external_pin_filter_mode_t filterMode); - -/*! - * @brief Gets the pin filter configuration. - * - * This function gets the pin filter flag. - * - * @param base LLWU peripheral base address. - * @param filterIndex A pin filter index, which starts from 1. - * @return True if the flag is a source of the existing low-leakage power mode. - */ -bool LLWU_GetPinFilterFlag(LLWU_Type *base, uint32_t filterIndex); - -/*! - * @brief Clears the pin filter configuration. - * - * This function clears the pin filter flag. - * - * @param base LLWU peripheral base address. - * @param filterIndex A pin filter index to clear the flag, starting from 1. - */ -void LLWU_ClearPinFilterFlag(LLWU_Type *base, uint32_t filterIndex); - -#endif /* FSL_FEATURE_LLWU_HAS_PIN_FILTER */ - -#if (defined(FSL_FEATURE_LLWU_HAS_RESET_ENABLE) && FSL_FEATURE_LLWU_HAS_RESET_ENABLE) -/*! - * @brief Sets the reset pin mode. - * - * This function determines how the reset pin is used as a low leakage mode exit source. - * - * @param base LLWU peripheral base address. - * @param pinEnable Enable reset the pin filter - * @param pinFilterEnable Specify whether the pin filter is enabled in Low-Leakage power mode. - */ -void LLWU_SetResetPinMode(LLWU_Type *base, bool pinEnable, bool pinFilterEnable); -#endif /* FSL_FEATURE_LLWU_HAS_RESET_ENABLE */ - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ -#endif /* FSL_LLWU_H_*/ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_lptmr.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_lptmr.c deleted file mode 100644 index 9e501e7a51b..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_lptmr.c +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2017 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lptmr.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lptmr" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#if defined(LPTMR_CLOCKS) -/*! - * @brief Gets the instance from the base address to be used to gate or ungate the module clock - * - * @param base LPTMR peripheral base address - * - * @return The LPTMR instance - */ -static uint32_t LPTMR_GetInstance(LPTMR_Type *base); -#endif /* LPTMR_CLOCKS */ - -/******************************************************************************* - * Variables - ******************************************************************************/ -#if defined(LPTMR_CLOCKS) -/*! @brief Pointers to LPTMR bases for each instance. */ -static LPTMR_Type *const s_lptmrBases[] = LPTMR_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to LPTMR clocks for each instance. */ -static const clock_ip_name_t s_lptmrClocks[] = LPTMR_CLOCKS; - -#if defined(LPTMR_PERIPH_CLOCKS) -/* Array of LPTMR functional clock name. */ -static const clock_ip_name_t s_lptmrPeriphClocks[] = LPTMR_PERIPH_CLOCKS; -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* LPTMR_CLOCKS */ - -/******************************************************************************* - * Code - ******************************************************************************/ -#if defined(LPTMR_CLOCKS) -static uint32_t LPTMR_GetInstance(LPTMR_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_lptmrBases); instance++) - { - if (s_lptmrBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_lptmrBases)); - - return instance; -} -#endif /* LPTMR_CLOCKS */ - -/*! - * brief Ungates the LPTMR clock and configures the peripheral for a basic operation. - * - * note This API should be called at the beginning of the application using the LPTMR driver. - * - * param base LPTMR peripheral base address - * param config A pointer to the LPTMR configuration structure. - */ -void LPTMR_Init(LPTMR_Type *base, const lptmr_config_t *config) -{ - assert(NULL != config); - -#if defined(LPTMR_CLOCKS) -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - - uint32_t instance = LPTMR_GetInstance(base); - - /* Ungate the LPTMR clock*/ - CLOCK_EnableClock(s_lptmrClocks[instance]); -#if defined(LPTMR_PERIPH_CLOCKS) - CLOCK_EnableClock(s_lptmrPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* LPTMR_CLOCKS */ - - /* Configure the timers operation mode and input pin setup */ - base->CSR = (LPTMR_CSR_TMS(config->timerMode) | LPTMR_CSR_TFC(config->enableFreeRunning) | - LPTMR_CSR_TPP(config->pinPolarity) | LPTMR_CSR_TPS(config->pinSelect)); - - /* Configure the prescale value and clock source */ - base->PSR = (LPTMR_PSR_PRESCALE(config->value) | LPTMR_PSR_PBYP(config->bypassPrescaler) | - LPTMR_PSR_PCS(config->prescalerClockSource)); -} - -/*! - * brief Gates the LPTMR clock. - * - * param base LPTMR peripheral base address - */ -void LPTMR_Deinit(LPTMR_Type *base) -{ - /* Disable the LPTMR and reset the internal logic */ - base->CSR &= ~LPTMR_CSR_TEN_MASK; - -#if defined(LPTMR_CLOCKS) -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - - uint32_t instance = LPTMR_GetInstance(base); - - /* Gate the LPTMR clock*/ - CLOCK_DisableClock(s_lptmrClocks[instance]); -#if defined(LPTMR_PERIPH_CLOCKS) - CLOCK_DisableClock(s_lptmrPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* LPTMR_CLOCKS */ -} - -/*! - * brief Fills in the LPTMR configuration structure with default settings. - * - * The default values are as follows. - * code - * config->timerMode = kLPTMR_TimerModeTimeCounter; - * config->pinSelect = kLPTMR_PinSelectInput_0; - * config->pinPolarity = kLPTMR_PinPolarityActiveHigh; - * config->enableFreeRunning = false; - * config->bypassPrescaler = true; - * config->prescalerClockSource = kLPTMR_PrescalerClock_1; - * config->value = kLPTMR_Prescale_Glitch_0; - * endcode - * param config A pointer to the LPTMR configuration structure. - */ -void LPTMR_GetDefaultConfig(lptmr_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - /* Use time counter mode */ - config->timerMode = kLPTMR_TimerModeTimeCounter; - /* Use input 0 as source in pulse counter mode */ - config->pinSelect = kLPTMR_PinSelectInput_0; - /* Pulse input pin polarity is active-high */ - config->pinPolarity = kLPTMR_PinPolarityActiveHigh; - /* Counter resets whenever TCF flag is set */ - config->enableFreeRunning = false; - /* Bypass the prescaler */ - config->bypassPrescaler = true; - /* LPTMR clock source */ -#if !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT) - config->prescalerClockSource = kLPTMR_PrescalerClock_1; -#elif !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_0_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_0_SUPPORT) - config->prescalerClockSource = kLPTMR_PrescalerClock_0; -#elif !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_2_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_2_SUPPORT) - config->prescalerClockSource = kLPTMR_PrescalerClock_2; -#elif !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_3_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_3_SUPPORT) - config->prescalerClockSource = kLPTMR_PrescalerClock_3; -#else -#error No valid source -#endif - - /* Divide the prescaler clock by 2 */ - config->value = kLPTMR_Prescale_Glitch_0; -} diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_lptmr.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_lptmr.h deleted file mode 100644 index b8e473120c5..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_lptmr.h +++ /dev/null @@ -1,384 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2017, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LPTMR_H_ -#define FSL_LPTMR_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup lptmr - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! Driver Version */ -#define FSL_LPTMR_DRIVER_VERSION (MAKE_VERSION(2, 2, 0)) -/*! @} */ - -/*! @brief LPTMR pin selection used in pulse counter mode.*/ -typedef enum _lptmr_pin_select -{ - kLPTMR_PinSelectInput_0 = 0x0U, /*!< Pulse counter input 0 is selected */ - kLPTMR_PinSelectInput_1 = 0x1U, /*!< Pulse counter input 1 is selected */ - kLPTMR_PinSelectInput_2 = 0x2U, /*!< Pulse counter input 2 is selected */ - kLPTMR_PinSelectInput_3 = 0x3U /*!< Pulse counter input 3 is selected */ -} lptmr_pin_select_t; - -/*! @brief LPTMR pin polarity used in pulse counter mode.*/ -typedef enum _lptmr_pin_polarity -{ - kLPTMR_PinPolarityActiveHigh = 0x0U, /*!< Pulse Counter input source is active-high */ - kLPTMR_PinPolarityActiveLow = 0x1U /*!< Pulse Counter input source is active-low */ -} lptmr_pin_polarity_t; - -/*! @brief LPTMR timer mode selection.*/ -typedef enum _lptmr_timer_mode -{ - kLPTMR_TimerModeTimeCounter = 0x0U, /*!< Time Counter mode */ - kLPTMR_TimerModePulseCounter = 0x1U /*!< Pulse Counter mode */ -} lptmr_timer_mode_t; - -/*! @brief LPTMR prescaler/glitch filter values*/ -typedef enum _lptmr_prescaler_glitch_value -{ - kLPTMR_Prescale_Glitch_0 = 0x0U, /*!< Prescaler divide 2, glitch filter does not support this setting */ - kLPTMR_Prescale_Glitch_1 = 0x1U, /*!< Prescaler divide 4, glitch filter 2 */ - kLPTMR_Prescale_Glitch_2 = 0x2U, /*!< Prescaler divide 8, glitch filter 4 */ - kLPTMR_Prescale_Glitch_3 = 0x3U, /*!< Prescaler divide 16, glitch filter 8 */ - kLPTMR_Prescale_Glitch_4 = 0x4U, /*!< Prescaler divide 32, glitch filter 16 */ - kLPTMR_Prescale_Glitch_5 = 0x5U, /*!< Prescaler divide 64, glitch filter 32 */ - kLPTMR_Prescale_Glitch_6 = 0x6U, /*!< Prescaler divide 128, glitch filter 64 */ - kLPTMR_Prescale_Glitch_7 = 0x7U, /*!< Prescaler divide 256, glitch filter 128 */ - kLPTMR_Prescale_Glitch_8 = 0x8U, /*!< Prescaler divide 512, glitch filter 256 */ - kLPTMR_Prescale_Glitch_9 = 0x9U, /*!< Prescaler divide 1024, glitch filter 512*/ - kLPTMR_Prescale_Glitch_10 = 0xAU, /*!< Prescaler divide 2048 glitch filter 1024 */ - kLPTMR_Prescale_Glitch_11 = 0xBU, /*!< Prescaler divide 4096, glitch filter 2048 */ - kLPTMR_Prescale_Glitch_12 = 0xCU, /*!< Prescaler divide 8192, glitch filter 4096 */ - kLPTMR_Prescale_Glitch_13 = 0xDU, /*!< Prescaler divide 16384, glitch filter 8192 */ - kLPTMR_Prescale_Glitch_14 = 0xEU, /*!< Prescaler divide 32768, glitch filter 16384 */ - kLPTMR_Prescale_Glitch_15 = 0xFU /*!< Prescaler divide 65536, glitch filter 32768 */ -} lptmr_prescaler_glitch_value_t; - -/*! - * @brief LPTMR prescaler/glitch filter clock select. - * @note Clock connections are SoC-specific - */ -typedef enum _lptmr_prescaler_clock_select -{ -#if !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_0_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_0_SUPPORT) - kLPTMR_PrescalerClock_0 = 0x0U, /*!< Prescaler/glitch filter clock 0 selected. */ -#endif - -#if !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT) - kLPTMR_PrescalerClock_1 = 0x1U, /*!< Prescaler/glitch filter clock 1 selected. */ -#endif /* FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT */ - -#if !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_2_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_2_SUPPORT) - kLPTMR_PrescalerClock_2 = 0x2U, /*!< Prescaler/glitch filter clock 2 selected. */ -#endif - -#if !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_3_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_3_SUPPORT) - kLPTMR_PrescalerClock_3 = 0x3U, /*!< Prescaler/glitch filter clock 3 selected. */ -#endif /* FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_3_SUPPORT */ -} lptmr_prescaler_clock_select_t; - -/*! @brief List of the LPTMR interrupts */ -typedef enum _lptmr_interrupt_enable -{ - kLPTMR_TimerInterruptEnable = LPTMR_CSR_TIE_MASK, /*!< Timer interrupt enable */ -} lptmr_interrupt_enable_t; - -/*! @brief List of the LPTMR status flags */ -typedef enum _lptmr_status_flags -{ - kLPTMR_TimerCompareFlag = LPTMR_CSR_TCF_MASK, /*!< Timer compare flag */ -} lptmr_status_flags_t; - -/*! - * @brief LPTMR config structure - * - * This structure holds the configuration settings for the LPTMR peripheral. To initialize this - * structure to reasonable defaults, call the LPTMR_GetDefaultConfig() function and pass a - * pointer to your configuration structure instance. - * - * The configuration struct can be made constant so it resides in flash. - */ -typedef struct _lptmr_config -{ - lptmr_timer_mode_t timerMode; /*!< Time counter mode or pulse counter mode */ - lptmr_pin_select_t pinSelect; /*!< LPTMR pulse input pin select; used only in pulse counter mode */ - lptmr_pin_polarity_t pinPolarity; /*!< LPTMR pulse input pin polarity; used only in pulse counter mode */ - bool enableFreeRunning; /*!< True: enable free running, counter is reset on overflow - False: counter is reset when the compare flag is set */ - bool bypassPrescaler; /*!< True: bypass prescaler; false: use clock from prescaler */ - lptmr_prescaler_clock_select_t prescalerClockSource; /*!< LPTMR clock source */ - lptmr_prescaler_glitch_value_t value; /*!< Prescaler or glitch filter value */ -} lptmr_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Ungates the LPTMR clock and configures the peripheral for a basic operation. - * - * @note This API should be called at the beginning of the application using the LPTMR driver. - * - * @param base LPTMR peripheral base address - * @param config A pointer to the LPTMR configuration structure. - */ -void LPTMR_Init(LPTMR_Type *base, const lptmr_config_t *config); - -/*! - * @brief Gates the LPTMR clock. - * - * @param base LPTMR peripheral base address - */ -void LPTMR_Deinit(LPTMR_Type *base); - -/*! - * @brief Fills in the LPTMR configuration structure with default settings. - * - * The default values are as follows. - * @code - * config->timerMode = kLPTMR_TimerModeTimeCounter; - * config->pinSelect = kLPTMR_PinSelectInput_0; - * config->pinPolarity = kLPTMR_PinPolarityActiveHigh; - * config->enableFreeRunning = false; - * config->bypassPrescaler = true; - * config->prescalerClockSource = kLPTMR_PrescalerClock_1; - * config->value = kLPTMR_Prescale_Glitch_0; - * @endcode - * @param config A pointer to the LPTMR configuration structure. - */ -void LPTMR_GetDefaultConfig(lptmr_config_t *config); - -/*! @}*/ - -/*! - * @name Interrupt Interface - * @{ - */ - -/*! - * @brief Enables the selected LPTMR interrupts. - * - * @param base LPTMR peripheral base address - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::lptmr_interrupt_enable_t - */ -static inline void LPTMR_EnableInterrupts(LPTMR_Type *base, uint32_t mask) -{ - uint32_t reg = base->CSR; - - /* Clear the TCF bit so that we don't clear this w1c bit when writing back */ - reg &= ~(LPTMR_CSR_TCF_MASK); - reg |= mask; - base->CSR = reg; -} - -/*! - * @brief Disables the selected LPTMR interrupts. - * - * @param base LPTMR peripheral base address - * @param mask The interrupts to disable. This is a logical OR of members of the - * enumeration ::lptmr_interrupt_enable_t. - */ -static inline void LPTMR_DisableInterrupts(LPTMR_Type *base, uint32_t mask) -{ - uint32_t reg = base->CSR; - - /* Clear the TCF bit so that we don't clear this w1c bit when writing back */ - reg &= ~(LPTMR_CSR_TCF_MASK); - reg &= ~mask; - base->CSR = reg; -} - -/*! - * @brief Gets the enabled LPTMR interrupts. - * - * @param base LPTMR peripheral base address - * - * @return The enabled interrupts. This is the logical OR of members of the - * enumeration ::lptmr_interrupt_enable_t - */ -static inline uint32_t LPTMR_GetEnabledInterrupts(LPTMR_Type *base) -{ - return (base->CSR & LPTMR_CSR_TIE_MASK); -} - -/*! @}*/ - -#if defined(FSL_FEATURE_LPTMR_HAS_CSR_TDRE) && (FSL_FEATURE_LPTMR_HAS_CSR_TDRE) -/*! - * @brief Enable or disable timer DMA request - * - * @param base base LPTMR peripheral base address - * @param enable Switcher of timer DMA feature. "true" means to enable, "false" means to disable. - */ -static inline void LPTMR_EnableTimerDMA(LPTMR_Type *base, bool enable) -{ - if (enable) - { - base->CSR |= LPTMR_CSR_TDRE_MASK; - } - else - { - base->CSR &= ~(LPTMR_CSR_TDRE_MASK); - } -} -#endif /* FSL_FEATURE_LPTMR_HAS_CSR_TDRE */ - -/*! - * @name Status Interface - * @{ - */ - -/*! - * @brief Gets the LPTMR status flags. - * - * @param base LPTMR peripheral base address - * - * @return The status flags. This is the logical OR of members of the - * enumeration ::lptmr_status_flags_t - */ -static inline uint32_t LPTMR_GetStatusFlags(LPTMR_Type *base) -{ - return (base->CSR & LPTMR_CSR_TCF_MASK); -} - -/*! - * @brief Clears the LPTMR status flags. - * - * @param base LPTMR peripheral base address - * @param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::lptmr_status_flags_t. - */ -static inline void LPTMR_ClearStatusFlags(LPTMR_Type *base, uint32_t mask) -{ - base->CSR |= mask; -} - -/*! @}*/ - -/*! - * @name Read and write the timer period - * @{ - */ - -/*! - * @brief Sets the timer period in units of count. - * - * Timers counts from 0 until it equals the count value set here. The count value is written to - * the CMR register. - * - * @note - * 1. The TCF flag is set with the CNR equals the count provided here and then increments. - * 2. Call the utility macros provided in the fsl_common.h to convert to ticks. - * - * @param base LPTMR peripheral base address - * @param ticks A timer period in units of ticks, which should be equal or greater than 1. - */ -static inline void LPTMR_SetTimerPeriod(LPTMR_Type *base, uint32_t ticks) -{ - assert(ticks > 0U); - base->CMR = LPTMR_CMR_COMPARE(ticks - 1U); -} - -/*! - * @brief Reads the current timer counting value. - * - * This function returns the real-time timer counting value in a range from 0 to a - * timer period. - * - * @note Call the utility macros provided in the fsl_common.h to convert ticks to usec or msec. - * - * @param base LPTMR peripheral base address - * - * @return The current counter value in ticks - */ -static inline uint32_t LPTMR_GetCurrentTimerCount(LPTMR_Type *base) -{ - /* Must first write any value to the CNR. This synchronizes and registers the current value - * of the CNR into a temporary register which can then be read - */ - base->CNR = 0U; - return (uint32_t)((base->CNR & LPTMR_CNR_COUNTER_MASK) >> LPTMR_CNR_COUNTER_SHIFT); -} - -/*! @}*/ - -/*! - * @name Timer Start and Stop - * @{ - */ - -/*! - * @brief Starts the timer. - * - * After calling this function, the timer counts up to the CMR register value. - * Each time the timer reaches the CMR value and then increments, it generates a - * trigger pulse and sets the timeout interrupt flag. An interrupt is also - * triggered if the timer interrupt is enabled. - * - * @param base LPTMR peripheral base address - */ -static inline void LPTMR_StartTimer(LPTMR_Type *base) -{ - uint32_t reg = base->CSR; - - /* Clear the TCF bit to avoid clearing the w1c bit when writing back. */ - reg &= ~(LPTMR_CSR_TCF_MASK); - reg |= LPTMR_CSR_TEN_MASK; - base->CSR = reg; -} - -/*! - * @brief Stops the timer. - * - * This function stops the timer and resets the timer's counter register. - * - * @param base LPTMR peripheral base address - */ -static inline void LPTMR_StopTimer(LPTMR_Type *base) -{ - uint32_t reg = base->CSR; - - /* Clear the TCF bit to avoid clearing the w1c bit when writing back. */ - reg &= ~(LPTMR_CSR_TCF_MASK); - reg &= ~LPTMR_CSR_TEN_MASK; - base->CSR = reg; -} - -/*! @}*/ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_LPTMR_H_ */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_lpuart.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_lpuart.c deleted file mode 100644 index 5e8de5a894b..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_lpuart.c +++ /dev/null @@ -1,2742 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpuart.h" - -/* - * $Coverage Justification Reference$ - * - * $Justification fsl_lpuart_c_ref_1$ - * (osr > 3) (false) can't be not covered, because osr(osrTemp) is increased from 4U. - * - * $Justification fsl_lpuart_c_ref_2$ - * The flag is cleared successfully during test. - */ -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpuart" -#endif - -/* LPUART transfer state. */ -enum -{ - kLPUART_TxIdle, /*!< TX idle. */ - kLPUART_TxBusy, /*!< TX busy. */ - kLPUART_RxIdle, /*!< RX idle. */ - kLPUART_RxBusy /*!< RX busy. */ -}; - -#if defined(LPUART_RSTS) -#define LPUART_RESETS_ARRAY LPUART_RSTS -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Check whether the RX ring buffer is full. - * - * @userData handle LPUART handle pointer. - * @retval true RX ring buffer is full. - * @retval false RX ring buffer is not full. - */ -static bool LPUART_TransferIsRxRingBufferFull(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief Write to TX register using non-blocking method. - * - * This function writes data to the TX register directly, upper layer must make - * sure the TX register is empty or TX FIFO has empty room before calling this function. - * - * @note This function does not check whether all the data has been sent out to bus, - * so before disable TX, check kLPUART_TransmissionCompleteFlag to ensure the TX is - * finished. - * - * @param base LPUART peripheral base address. - * @param data Start address of the data to write. - * @param length Size of the buffer to be sent. - */ -static void LPUART_WriteNonBlocking(LPUART_Type *base, const uint8_t *data, size_t length); -/*! - * @brief Write to TX register using non-blocking method in 9bit or 10bit mode. - * - * The 10bit of data will be writen to TX register DATA. - * Please make sure data 10bit is valid and other bit is 0. - * - * @note This function only support 9bit or 10bit transfer. - * - * @param base LPUART peripheral base address. - * @param data Start address of the data to write. - * @param length Size of the buffer to be sent. - */ -static void LPUART_WriteNonBlocking16bit(LPUART_Type *base, const uint16_t *data, size_t length); - -/*! - * @brief Read RX register using non-blocking method. - * - * This function reads data from the TX register directly, upper layer must make - * sure the RX register is full or TX FIFO has data before calling this function. - * - * @param base LPUART peripheral base address. - * @param data Start address of the buffer to store the received data. - * @param length Size of the buffer. - */ -static void LPUART_ReadNonBlocking(LPUART_Type *base, uint8_t *data, size_t length); -/*! - * @brief Read RX register using non-blocking method in 9bit or 10bit mode. - * - * This function reads 10bit data from the RX register directly and stores to 16bit data. - * - * @note This function only support 9bit or 10bit transfer. - * - * @param base LPUART peripheral base address. - * @param data Start address of the buffer to store the received data. - * @param length Size of the buffer. - */ -static void LPUART_ReadNonBlocking16bit(LPUART_Type *base, uint16_t *data, size_t length); -/*! - * @brief LPUART_TransferHandleIDLEIsReady handle function. - * This function handles when IDLE is ready. - * - * @param base LPUART peripheral base address. - * @param irqHandle LPUART handle pointer. - */ -static void LPUART_TransferHandleIDLEReady(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief LPUART_TransferHandleReceiveDataIsFull handle function. - * This function handles when receive data is full. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - */ -static void LPUART_TransferHandleReceiveDataFull(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief LPUART_TransferHandleSendDataIsEmpty handle function. - * This function handles when send data is empty. - * - * @param base LPUART peripheral base address. - * @param irqHandle LPUART handle pointer. - */ -static void LPUART_TransferHandleSendDataEmpty(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief LPUART_TransferHandleTransmissionIsComplete handle function. - * This function handles Transmission complete and the interrupt is enabled. - * - * @param base LPUART peripheral base address. - * @param irqHandle LPUART handle pointer. - */ -static void LPUART_TransferHandleTransmissionComplete(LPUART_Type *base, lpuart_handle_t *handle); - -/******************************************************************************* - * Variables - ******************************************************************************/ -#if defined(LPUART_BASE_PTRS_NS) -static LPUART_Type *const s_lpuartBases_ns[] = LPUART_BASE_PTRS_NS; -#endif -/* Array of LPUART peripheral base address. */ -static LPUART_Type *const s_lpuartBases[] = LPUART_BASE_PTRS; -/* Array of LPUART handle. */ -void *s_lpuartHandle[ARRAY_SIZE(s_lpuartBases)]; -/* Array of LPUART IRQ number. */ -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -static const IRQn_Type s_lpuartRxIRQ[] = LPUART_RX_IRQS; -const IRQn_Type s_lpuartTxIRQ[] = LPUART_TX_IRQS; -#else -const IRQn_Type s_lpuartIRQ[] = LPUART_RX_TX_IRQS; -#endif -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/* Array of LPUART clock name. */ -static const clock_ip_name_t s_lpuartClock[] = LPUART_CLOCKS; - -#if defined(LPUART_PERIPH_CLOCKS) -/* Array of LPUART functional clock name. */ -static const clock_ip_name_t s_lpuartPeriphClocks[] = LPUART_PERIPH_CLOCKS; -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/* LPUART ISR for transactional APIs. */ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -lpuart_isr_t s_lpuartIsr[ARRAY_SIZE(s_lpuartBases)] = {[0 ...(ARRAY_SIZE(s_lpuartBases) - 1)] = - (lpuart_isr_t)DefaultISR}; -#else -lpuart_isr_t s_lpuartIsr[ARRAY_SIZE(s_lpuartBases)]; -#endif - -#if defined(LPUART_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_lpuartResets[] = LPUART_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -/*! - * brief Get the LPUART instance from peripheral base address. - * - * param base LPUART peripheral base address. - * return LPUART instance. - */ -uint32_t LPUART_GetInstance(LPUART_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0U; instance < ARRAY_SIZE(s_lpuartBases); instance++) - { - if (s_lpuartBases[instance] == base) - { - return instance; - } - } -#if defined(LPUART_BASE_PTRS_NS) - /* Find the instance index from base address mappings. */ - for (instance = 0U; instance < ARRAY_SIZE(s_lpuartBases_ns); instance++) - { - if (s_lpuartBases_ns[instance] == base) - { - return instance; - } - } - assert(instance < ARRAY_SIZE(s_lpuartBases_ns)); -#else - assert(instance < ARRAY_SIZE(s_lpuartBases)); -#endif - - return instance; -} - -/*! - * brief Get the length of received data in RX ring buffer. - * - * userData handle LPUART handle pointer. - * return Length of received data in RX ring buffer. - */ -size_t LPUART_TransferGetRxRingBufferLength(LPUART_Type *base, lpuart_handle_t *handle) -{ - assert(NULL != handle); - - size_t size; - size_t tmpRxRingBufferSize = handle->rxRingBufferSize; - uint16_t tmpRxRingBufferTail = handle->rxRingBufferTail; - uint16_t tmpRxRingBufferHead = handle->rxRingBufferHead; - - if (tmpRxRingBufferTail > tmpRxRingBufferHead) - { - size = ((size_t)tmpRxRingBufferHead + tmpRxRingBufferSize - (size_t)tmpRxRingBufferTail); - } - else - { - size = ((size_t)tmpRxRingBufferHead - (size_t)tmpRxRingBufferTail); - } - - return size; -} - -static bool LPUART_TransferIsRxRingBufferFull(LPUART_Type *base, lpuart_handle_t *handle) -{ - assert(NULL != handle); - - bool full; - - if (LPUART_TransferGetRxRingBufferLength(base, handle) == (handle->rxRingBufferSize - 1U)) - { - full = true; - } - else - { - full = false; - } - return full; -} - -static void LPUART_WriteNonBlocking(LPUART_Type *base, const uint8_t *data, size_t length) -{ - assert(NULL != data); - - size_t i; - - /* The Non Blocking write data API assume user have ensured there is enough space in - peripheral to write. */ - for (i = 0; i < length; i++) - { - base->DATA = data[i]; - } -} -static void LPUART_WriteNonBlocking16bit(LPUART_Type *base, const uint16_t *data, size_t length) -{ - assert(NULL != data); - - size_t i; - - /* The Non Blocking write data API assume user have ensured there is enough space in - peripheral to write. */ - for (i = 0; i < length; i++) - { - base->DATA = data[i]; - } -} - -static void LPUART_ReadNonBlocking(LPUART_Type *base, uint8_t *data, size_t length) -{ - assert(NULL != data); - - size_t i; -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - uint32_t ctrl = base->CTRL; - bool isSevenDataBits = (((ctrl & LPUART_CTRL_M7_MASK) != 0U) || - (((ctrl & LPUART_CTRL_M_MASK) == 0U) && ((ctrl & LPUART_CTRL_PE_MASK) != 0U))); -#endif - - /* The Non Blocking read data API assume user have ensured there is enough space in - peripheral to write. */ - for (i = 0; i < length; i++) - { -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - if (isSevenDataBits) - { - data[i] = (uint8_t)(base->DATA & 0x7FU); - } - else - { - data[i] = (uint8_t)base->DATA; - } -#else - data[i] = (uint8_t)(base->DATA); -#endif - } -} - -static void LPUART_ReadNonBlocking16bit(LPUART_Type *base, uint16_t *data, size_t length) -{ - assert(NULL != data); - - size_t i; - /* The Non Blocking read data API assume user have ensured there is enough space in - peripheral to write. */ - for (i = 0; i < length; i++) - { - data[i] = (uint16_t)(base->DATA & 0x03FFU); - } -} - -/*! - * brief Initializes an LPUART instance with the user configuration structure and the peripheral clock. - * - * This function configures the LPUART module with user-defined settings. Call the LPUART_GetDefaultConfig() function - * to configure the configuration structure and get the default configuration. - * The example below shows how to use this API to configure the LPUART. - * code - * lpuart_config_t lpuartConfig; - * lpuartConfig.baudRate_Bps = 115200U; - * lpuartConfig.parityMode = kLPUART_ParityDisabled; - * lpuartConfig.dataBitsCount = kLPUART_EightDataBits; - * lpuartConfig.isMsb = false; - * lpuartConfig.stopBitCount = kLPUART_OneStopBit; - * lpuartConfig.txFifoWatermark = 0; - * lpuartConfig.rxFifoWatermark = 1; - * LPUART_Init(LPUART1, &lpuartConfig, 20000000U); - * endcode - * - * param base LPUART peripheral base address. - * param config Pointer to a user-defined configuration structure. - * param srcClock_Hz LPUART clock source frequency in HZ. - * retval kStatus_LPUART_BaudrateNotSupport Baudrate is not support in current clock source. - * retval kStatus_Success LPUART initialize succeed - */ -status_t LPUART_Init(LPUART_Type *base, const lpuart_config_t *config, uint32_t srcClock_Hz) -{ - assert(NULL != config); - assert(0U < config->baudRate_Bps); -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - assert((uint8_t)FSL_FEATURE_LPUART_FIFO_SIZEn(base) > config->txFifoWatermark); - assert((uint8_t)FSL_FEATURE_LPUART_FIFO_SIZEn(base) > config->rxFifoWatermark); -#endif - - status_t status = kStatus_Success; - uint32_t temp; - uint16_t sbr, sbrTemp; - uint8_t osr, osrTemp; - uint32_t tempDiff, calculatedBaud, baudDiff; - - /* This LPUART instantiation uses a slightly different baud rate calculation - * The idea is to use the best OSR (over-sampling rate) possible - * Note, OSR is typically hard-set to 16 in other LPUART instantiations - * loop to find the best OSR value possible, one that generates minimum baudDiff - * iterate through the rest of the supported values of OSR */ - - baudDiff = config->baudRate_Bps; - osr = 0U; - sbr = 0U; - for (osrTemp = 4U; osrTemp <= 32U; osrTemp++) - { - /* calculate the temporary sbr value */ - sbrTemp = (uint16_t)((srcClock_Hz * 2U / (config->baudRate_Bps * (uint32_t)osrTemp) + 1U) / 2U); - /*set sbrTemp to 1 if the sourceClockInHz can not satisfy the desired baud rate*/ - if (sbrTemp == 0U) - { - sbrTemp = 1U; - } - else if (sbrTemp > LPUART_BAUD_SBR_MASK) - { - sbrTemp = LPUART_BAUD_SBR_MASK; - } - else - { - /* Avoid MISRA 15.7 */ - } - /* Calculate the baud rate based on the temporary OSR and SBR values */ - calculatedBaud = (srcClock_Hz / ((uint32_t)osrTemp * (uint32_t)sbrTemp)); - tempDiff = calculatedBaud > config->baudRate_Bps ? (calculatedBaud - config->baudRate_Bps) : - (config->baudRate_Bps - calculatedBaud); - - if (tempDiff <= baudDiff) - { - baudDiff = tempDiff; - osr = osrTemp; /* update and store the best OSR value calculated */ - sbr = sbrTemp; /* update store the best SBR value calculated */ - } - } - - /* Check to see if actual baud rate is within 3% of desired baud rate - * based on the best calculate OSR value */ - if (baudDiff > ((config->baudRate_Bps / 100U) * 3U)) - { - /* Unacceptable baud rate difference of more than 3%*/ - status = kStatus_LPUART_BaudrateNotSupport; - } - else - { -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - - uint32_t instance = LPUART_GetInstance(base); - - /* Enable lpuart clock */ - (void)CLOCK_EnableClock(s_lpuartClock[instance]); -#if defined(LPUART_PERIPH_CLOCKS) - (void)CLOCK_EnableClock(s_lpuartPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(LPUART_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_lpuartResets[LPUART_GetInstance(base)]); -#endif - -#if defined(FSL_FEATURE_LPUART_HAS_GLOBAL) && FSL_FEATURE_LPUART_HAS_GLOBAL - /*Reset all internal logic and registers, except the Global Register */ - LPUART_SoftwareReset(base); -#else - /* Disable LPUART TX RX before setting. */ - base->CTRL &= ~(LPUART_CTRL_TE_MASK | LPUART_CTRL_RE_MASK); -#endif - - temp = base->BAUD; - - /* Acceptable baud rate, check if OSR is between 4x and 7x oversampling. - * If so, then "BOTHEDGE" sampling must be turned on */ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_1$ - */ - if ((osr > 3U) && (osr < 8U)) - { - temp |= LPUART_BAUD_BOTHEDGE_MASK; - } - - /* program the osr value (bit value is one less than actual value) */ - temp &= ~LPUART_BAUD_OSR_MASK; - temp |= LPUART_BAUD_OSR((uint32_t)osr - 1UL); - - /* write the sbr value to the BAUD registers */ - temp &= ~LPUART_BAUD_SBR_MASK; - base->BAUD = temp | LPUART_BAUD_SBR(sbr); - - /* Set bit count and parity mode. */ - base->BAUD &= ~LPUART_BAUD_M10_MASK; - - temp = base->CTRL & ~(LPUART_CTRL_PE_MASK | LPUART_CTRL_PT_MASK | LPUART_CTRL_M_MASK | LPUART_CTRL_ILT_MASK | - LPUART_CTRL_IDLECFG_MASK); - - temp |= (uint8_t)config->parityMode | LPUART_CTRL_IDLECFG(config->rxIdleConfig) | - LPUART_CTRL_ILT(config->rxIdleType); - -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - if (kLPUART_SevenDataBits == config->dataBitsCount) - { - if (kLPUART_ParityDisabled != config->parityMode) - { - temp &= ~LPUART_CTRL_M7_MASK; /* Seven data bits and one parity bit */ - } - else - { - temp |= LPUART_CTRL_M7_MASK; - } - } - else -#endif - { - if (kLPUART_ParityDisabled != config->parityMode) - { - temp |= LPUART_CTRL_M_MASK; /* Eight data bits and one parity bit */ - } - } - - base->CTRL = temp; - -#if defined(FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT) && FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT - /* set stop bit per char */ - temp = base->BAUD & ~LPUART_BAUD_SBNS_MASK; - base->BAUD = temp | LPUART_BAUD_SBNS((uint8_t)config->stopBitCount); -#endif - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Set tx/rx WATER watermark - Note: - Take care of the RX FIFO, RX interrupt request only assert when received bytes - equal or more than RX water mark, there is potential issue if RX water - mark larger than 1. - For example, if RX FIFO water mark is 2, upper layer needs 5 bytes and - 5 bytes are received. the last byte will be saved in FIFO but not trigger - RX interrupt because the water mark is 2. - */ - base->WATER = (((uint32_t)(config->rxFifoWatermark) << 16U) | config->txFifoWatermark); - - /* Enable tx/rx FIFO */ - base->FIFO |= (LPUART_FIFO_TXFE_MASK | LPUART_FIFO_RXFE_MASK); - - /* Flush FIFO */ - base->FIFO |= (LPUART_FIFO_TXFLUSH_MASK | LPUART_FIFO_RXFLUSH_MASK); -#endif - - /* Clear all status flags */ - temp = (LPUART_STAT_RXEDGIF_MASK | LPUART_STAT_IDLE_MASK | LPUART_STAT_OR_MASK | LPUART_STAT_NF_MASK | - LPUART_STAT_FE_MASK | LPUART_STAT_PF_MASK); - -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - temp |= LPUART_STAT_LBKDIF_MASK; -#endif - -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - temp |= (LPUART_STAT_MA1F_MASK | LPUART_STAT_MA2F_MASK); -#endif - -#if defined(FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT) && FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT - /* Set the CTS configuration/TX CTS source. */ - base->MODIR |= LPUART_MODIR_TXCTSC(config->txCtsConfig) | LPUART_MODIR_TXCTSSRC(config->txCtsSource); - if (true == config->enableRxRTS) - { - /* Enable the receiver RTS(request-to-send) function. */ - base->MODIR |= LPUART_MODIR_RXRTSE_MASK; - } - if (true == config->enableTxCTS) - { - /* Enable the CTS(clear-to-send) function. */ - base->MODIR |= LPUART_MODIR_TXCTSE_MASK; - } -#endif - - /* Set data bits order. */ - if (true == config->isMsb) - { - temp |= LPUART_STAT_MSBF_MASK; - } - else - { - temp &= ~LPUART_STAT_MSBF_MASK; - } - - base->STAT |= temp; - - /* Enable TX/RX base on configure structure. */ - temp = base->CTRL; - if (true == config->enableTx) - { - temp |= LPUART_CTRL_TE_MASK; - } - - if (true == config->enableRx) - { - temp |= LPUART_CTRL_RE_MASK; - } - - base->CTRL = temp; - } - - return status; -} -/*! - * brief Deinitializes a LPUART instance. - * - * This function waits for transmit to complete, disables TX and RX, and disables the LPUART clock. - * - * param base LPUART peripheral base address. - */ -void LPUART_Deinit(LPUART_Type *base) -{ - uint32_t temp; - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Wait tx FIFO send out*/ - while (0U != ((base->WATER & LPUART_WATER_TXCOUNT_MASK) >> LPUART_WATER_TXWATER_SHIFT)) - { - } -#endif - /* Wait last char shift out */ - while (0U == (base->STAT & LPUART_STAT_TC_MASK)) - { - } - - /* Clear all status flags */ - temp = (LPUART_STAT_RXEDGIF_MASK | LPUART_STAT_IDLE_MASK | LPUART_STAT_OR_MASK | LPUART_STAT_NF_MASK | - LPUART_STAT_FE_MASK | LPUART_STAT_PF_MASK); - -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - temp |= LPUART_STAT_LBKDIF_MASK; -#endif - -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - temp |= (LPUART_STAT_MA1F_MASK | LPUART_STAT_MA2F_MASK); -#endif - - base->STAT |= temp; - - /* Disable the module. */ - base->CTRL = 0U; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - uint32_t instance = LPUART_GetInstance(base); - - /* Disable lpuart clock */ - (void)CLOCK_DisableClock(s_lpuartClock[instance]); - -#if defined(LPUART_PERIPH_CLOCKS) - (void)CLOCK_DisableClock(s_lpuartPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Gets the default configuration structure. - * - * This function initializes the LPUART configuration structure to a default value. The default - * values are: - * lpuartConfig->baudRate_Bps = 115200U; - * lpuartConfig->parityMode = kLPUART_ParityDisabled; - * lpuartConfig->dataBitsCount = kLPUART_EightDataBits; - * lpuartConfig->isMsb = false; - * lpuartConfig->stopBitCount = kLPUART_OneStopBit; - * lpuartConfig->txFifoWatermark = 0; - * lpuartConfig->rxFifoWatermark = 1; - * lpuartConfig->rxIdleType = kLPUART_IdleTypeStartBit; - * lpuartConfig->rxIdleConfig = kLPUART_IdleCharacter1; - * lpuartConfig->enableTx = false; - * lpuartConfig->enableRx = false; - * - * param config Pointer to a configuration structure. - */ -void LPUART_GetDefaultConfig(lpuart_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->baudRate_Bps = 115200U; - config->parityMode = kLPUART_ParityDisabled; - config->dataBitsCount = kLPUART_EightDataBits; - config->isMsb = false; -#if defined(FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT) && FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT - config->stopBitCount = kLPUART_OneStopBit; -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - config->txFifoWatermark = 0U; - config->rxFifoWatermark = 0U; -#endif -#if defined(FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT) && FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT - config->enableRxRTS = false; - config->enableTxCTS = false; - config->txCtsConfig = kLPUART_CtsSampleAtStart; - config->txCtsSource = kLPUART_CtsSourcePin; -#endif - config->rxIdleType = kLPUART_IdleTypeStartBit; - config->rxIdleConfig = kLPUART_IdleCharacter1; - config->enableTx = false; - config->enableRx = false; -} - -/*! - * brief Sets the LPUART instance baudrate. - * - * This function configures the LPUART module baudrate. This function is used to update - * the LPUART module baudrate after the LPUART module is initialized by the LPUART_Init. - * code - * LPUART_SetBaudRate(LPUART1, 115200U, 20000000U); - * endcode - * - * param base LPUART peripheral base address. - * param baudRate_Bps LPUART baudrate to be set. - * param srcClock_Hz LPUART clock source frequency in HZ. - * retval kStatus_LPUART_BaudrateNotSupport Baudrate is not supported in the current clock source. - * retval kStatus_Success Set baudrate succeeded. - */ -status_t LPUART_SetBaudRate(LPUART_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz) -{ - assert(0U < baudRate_Bps); - - status_t status = kStatus_Success; - uint32_t temp, oldCtrl; - uint16_t sbr, sbrTemp; - uint8_t osr, osrTemp; - uint32_t tempDiff, calculatedBaud, baudDiff; - - /* This LPUART instantiation uses a slightly different baud rate calculation - * The idea is to use the best OSR (over-sampling rate) possible - * Note, OSR is typically hard-set to 16 in other LPUART instantiations - * loop to find the best OSR value possible, one that generates minimum baudDiff - * iterate through the rest of the supported values of OSR */ - - baudDiff = baudRate_Bps; - osr = 0U; - sbr = 0U; - for (osrTemp = 4U; osrTemp <= 32U; osrTemp++) - { - /* calculate the temporary sbr value */ - sbrTemp = (uint16_t)((srcClock_Hz * 2U / (baudRate_Bps * (uint32_t)osrTemp) + 1U) / 2U); - /*set sbrTemp to 1 if the sourceClockInHz can not satisfy the desired baud rate*/ - if (sbrTemp == 0U) - { - sbrTemp = 1U; - } - else if (sbrTemp > LPUART_BAUD_SBR_MASK) - { - sbrTemp = LPUART_BAUD_SBR_MASK; - } - else - { - /* Avoid MISRA 15.7 */ - } - /* Calculate the baud rate based on the temporary OSR and SBR values */ - calculatedBaud = srcClock_Hz / ((uint32_t)osrTemp * (uint32_t)sbrTemp); - - tempDiff = calculatedBaud > baudRate_Bps ? (calculatedBaud - baudRate_Bps) : (baudRate_Bps - calculatedBaud); - - if (tempDiff <= baudDiff) - { - baudDiff = tempDiff; - osr = osrTemp; /* update and store the best OSR value calculated */ - sbr = sbrTemp; /* update store the best SBR value calculated */ - } - } - - /* Check to see if actual baud rate is within 3% of desired baud rate - * based on the best calculate OSR value */ - if (baudDiff < (uint32_t)((baudRate_Bps / 100U) * 3U)) - { - /* Store CTRL before disable Tx and Rx */ - oldCtrl = base->CTRL; - - /* Disable LPUART TX RX before setting. */ - base->CTRL &= ~(LPUART_CTRL_TE_MASK | LPUART_CTRL_RE_MASK); - - temp = base->BAUD; - - /* Acceptable baud rate, check if OSR is between 4x and 7x oversampling. - * If so, then "BOTHEDGE" sampling must be turned on */ - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_1$ - */ - if ((osr > 3U) && (osr < 8U)) - { - temp |= LPUART_BAUD_BOTHEDGE_MASK; - } - - /* program the osr value (bit value is one less than actual value) */ - temp &= ~LPUART_BAUD_OSR_MASK; - temp |= LPUART_BAUD_OSR((uint32_t)osr - 1UL); - - /* write the sbr value to the BAUD registers */ - temp &= ~LPUART_BAUD_SBR_MASK; - base->BAUD = temp | LPUART_BAUD_SBR(sbr); - - /* Restore CTRL. */ - base->CTRL = oldCtrl; - } - else - { - /* Unacceptable baud rate difference of more than 3%*/ - status = kStatus_LPUART_BaudrateNotSupport; - } - - return status; -} - -/*! - * brief Enable 9-bit data mode for LPUART. - * - * This function set the 9-bit mode for LPUART module. The 9th bit is not used for parity thus can be modified by user. - * - * param base LPUART peripheral base address. - * param enable true to enable, flase to disable. - */ -void LPUART_Enable9bitMode(LPUART_Type *base, bool enable) -{ - assert(base != NULL); - - uint32_t temp = 0U; - - if (enable) - { - /* Set LPUART_CTRL_M for 9-bit mode, clear LPUART_CTRL_PE to disable parity. */ - temp = base->CTRL & ~((uint32_t)LPUART_CTRL_PE_MASK | (uint32_t)LPUART_CTRL_M_MASK); - temp |= (uint32_t)LPUART_CTRL_M_MASK; - base->CTRL = temp; - } - else - { - /* Clear LPUART_CTRL_M. */ - base->CTRL &= ~(uint32_t)LPUART_CTRL_M_MASK; - } -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - /* Clear LPUART_CTRL_M7 to disable 7-bit mode. */ - base->CTRL &= ~(uint32_t)LPUART_CTRL_M7_MASK; -#endif -#if defined(FSL_FEATURE_LPUART_HAS_10BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_10BIT_DATA_SUPPORT - /* Clear LPUART_BAUD_M10 to disable 10-bit mode. */ - base->BAUD &= ~(uint32_t)LPUART_BAUD_M10_MASK; -#endif -} - -/*! - * brief Transmit an address frame in 9-bit data mode. - * - * param base LPUART peripheral base address. - * param address LPUART slave address. - */ -void LPUART_SendAddress(LPUART_Type *base, uint8_t address) -{ - assert(base != NULL); - - uint32_t temp = base->DATA & 0xFFFFFC00UL; - temp |= ((uint32_t)address | (1UL << LPUART_DATA_R8T8_SHIFT)); - base->DATA = temp; -} - -/*! - * brief Enables LPUART interrupts according to a provided mask. - * - * This function enables the LPUART interrupts according to a provided mask. The mask - * is a logical OR of enumeration members. See the ref _lpuart_interrupt_enable. - * This examples shows how to enable TX empty interrupt and RX full interrupt: - * code - * LPUART_EnableInterrupts(LPUART1,kLPUART_TxDataRegEmptyInterruptEnable | kLPUART_RxDataRegFullInterruptEnable); - * endcode - * - * param base LPUART peripheral base address. - * param mask The interrupts to enable. Logical OR of ref _lpuart_interrupt_enable. - */ -void LPUART_EnableInterrupts(LPUART_Type *base, uint32_t mask) -{ - uint32_t s_atomicOldInt; - /* Only consider the real interrupt enable bits. */ - mask &= (uint32_t)kLPUART_AllInterruptEnable; - - /* Check int enable bits in base->BAUD */ - uint32_t baudRegMask = 0UL; -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - baudRegMask |= ((mask << 8U) & LPUART_BAUD_LBKDIE_MASK); - /* Clear bit 7 from mask */ - mask &= ~(uint32_t)kLPUART_LinBreakInterruptEnable; -#endif - baudRegMask |= ((mask << 8U) & LPUART_BAUD_RXEDGIE_MASK); - /* Clear bit 6 from mask */ - mask &= ~(uint32_t)kLPUART_RxActiveEdgeInterruptEnable; - - s_atomicOldInt = DisableGlobalIRQ(); - base->BAUD |= baudRegMask; - EnableGlobalIRQ(s_atomicOldInt); - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Check int enable bits in base->FIFO */ - - s_atomicOldInt = DisableGlobalIRQ(); - base->FIFO = (base->FIFO & ~(LPUART_FIFO_TXOF_MASK | LPUART_FIFO_RXUF_MASK)) | - (mask & (LPUART_FIFO_TXOFE_MASK | LPUART_FIFO_RXUFE_MASK)); - EnableGlobalIRQ(s_atomicOldInt); - - /* Clear bit 9 and bit 8 from mask */ - mask &= ~((uint32_t)kLPUART_TxFifoOverflowInterruptEnable | (uint32_t)kLPUART_RxFifoUnderflowInterruptEnable); -#endif - - /* Set int enable bits in base->CTRL */ - s_atomicOldInt = DisableGlobalIRQ(); - base->CTRL |= mask; - EnableGlobalIRQ(s_atomicOldInt); -} - -/*! - * brief Disables LPUART interrupts according to a provided mask. - * - * This function disables the LPUART interrupts according to a provided mask. The mask - * is a logical OR of enumeration members. See ref _lpuart_interrupt_enable. - * This example shows how to disable the TX empty interrupt and RX full interrupt: - * code - * LPUART_DisableInterrupts(LPUART1,kLPUART_TxDataRegEmptyInterruptEnable | kLPUART_RxDataRegFullInterruptEnable); - * endcode - * - * param base LPUART peripheral base address. - * param mask The interrupts to disable. Logical OR of ref _lpuart_interrupt_enable. - */ -void LPUART_DisableInterrupts(LPUART_Type *base, uint32_t mask) -{ - uint32_t s_atomicOldInt; - /* Only consider the real interrupt enable bits. */ - mask &= (uint32_t)kLPUART_AllInterruptEnable; - - /* Clear int enable bits in base->BAUD */ - uint32_t baudRegMask = 0UL; -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - baudRegMask |= ((mask << 8U) & LPUART_BAUD_LBKDIE_MASK); - /* Clear bit 7 from mask */ - mask &= ~(uint32_t)kLPUART_LinBreakInterruptEnable; -#endif - baudRegMask |= ((mask << 8U) & LPUART_BAUD_RXEDGIE_MASK); - /* Clear bit 6 from mask */ - mask &= ~(uint32_t)kLPUART_RxActiveEdgeInterruptEnable; - - s_atomicOldInt = DisableGlobalIRQ(); - base->BAUD &= ~baudRegMask; - EnableGlobalIRQ(s_atomicOldInt); - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Clear int enable bits in base->FIFO */ - - s_atomicOldInt = DisableGlobalIRQ(); - base->FIFO = (base->FIFO & ~(LPUART_FIFO_TXOF_MASK | LPUART_FIFO_RXUF_MASK)) & - ~(mask & (LPUART_FIFO_TXOFE_MASK | LPUART_FIFO_RXUFE_MASK)); - EnableGlobalIRQ(s_atomicOldInt); - /* Clear bit 9 and bit 8 from mask */ - mask &= ~((uint32_t)kLPUART_TxFifoOverflowInterruptEnable | (uint32_t)kLPUART_RxFifoUnderflowInterruptEnable); -#endif - - /* Clear int enable bits in base->CTRL */ - s_atomicOldInt = DisableGlobalIRQ(); - base->CTRL &= ~mask; - EnableGlobalIRQ(s_atomicOldInt); -} - -/*! - * brief Gets enabled LPUART interrupts. - * - * This function gets the enabled LPUART interrupts. The enabled interrupts are returned - * as the logical OR value of the enumerators ref _lpuart_interrupt_enable. To check - * a specific interrupt enable status, compare the return value with enumerators - * in ref _lpuart_interrupt_enable. - * For example, to check whether the TX empty interrupt is enabled: - * code - * uint32_t enabledInterrupts = LPUART_GetEnabledInterrupts(LPUART1); - * - * if (kLPUART_TxDataRegEmptyInterruptEnable & enabledInterrupts) - * { - * ... - * } - * endcode - * - * param base LPUART peripheral base address. - * return LPUART interrupt flags which are logical OR of the enumerators in ref _lpuart_interrupt_enable. - */ -uint32_t LPUART_GetEnabledInterrupts(LPUART_Type *base) -{ - /* Check int enable bits in base->CTRL */ - uint32_t temp = (uint32_t)(base->CTRL & (uint32_t)kLPUART_AllInterruptEnable); - - /* Check int enable bits in base->BAUD */ - temp = (temp & ~(uint32_t)kLPUART_RxActiveEdgeInterruptEnable) | ((base->BAUD & LPUART_BAUD_RXEDGIE_MASK) >> 8U); -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - temp = (temp & ~(uint32_t)kLPUART_LinBreakInterruptEnable) | ((base->BAUD & LPUART_BAUD_LBKDIE_MASK) >> 8U); -#endif - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Check int enable bits in base->FIFO */ - temp = - (temp & ~((uint32_t)kLPUART_TxFifoOverflowInterruptEnable | (uint32_t)kLPUART_RxFifoUnderflowInterruptEnable)) | - (base->FIFO & (LPUART_FIFO_TXOFE_MASK | LPUART_FIFO_RXUFE_MASK)); -#endif - - return temp; -} - -/*! - * brief Gets LPUART status flags. - * - * This function gets all LPUART status flags. The flags are returned as the logical - * OR value of the enumerators ref _lpuart_flags. To check for a specific status, - * compare the return value with enumerators in the ref _lpuart_flags. - * For example, to check whether the TX is empty: - * code - * if (kLPUART_TxDataRegEmptyFlag & LPUART_GetStatusFlags(LPUART1)) - * { - * ... - * } - * endcode - * - * param base LPUART peripheral base address. - * return LPUART status flags which are ORed by the enumerators in the _lpuart_flags. - */ -uint32_t LPUART_GetStatusFlags(LPUART_Type *base) -{ - uint32_t temp; - temp = base->STAT; -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - temp |= (base->FIFO & - (LPUART_FIFO_TXEMPT_MASK | LPUART_FIFO_RXEMPT_MASK | LPUART_FIFO_TXOF_MASK | LPUART_FIFO_RXUF_MASK)) >> - 16U; -#endif - /* Only keeps the status bits */ - temp &= (uint32_t)kLPUART_AllFlags; - return temp; -} - -/*! - * brief Clears status flags with a provided mask. - * - * This function clears LPUART status flags with a provided mask. Automatically cleared flags - * can't be cleared by this function. - * Flags that can only cleared or set by hardware are: - * kLPUART_TxDataRegEmptyFlag, kLPUART_TransmissionCompleteFlag, kLPUART_RxDataRegFullFlag, - * kLPUART_RxActiveFlag, kLPUART_NoiseErrorFlag, kLPUART_ParityErrorFlag, - * kLPUART_TxFifoEmptyFlag,kLPUART_RxFifoEmptyFlag - * Note: This API should be called when the Tx/Rx is idle, otherwise it takes no effects. - * - * param base LPUART peripheral base address. - * param mask the status flags to be cleared. The user can use the enumerators in the - * _lpuart_status_flag_t to do the OR operation and get the mask. - * return 0 succeed, others failed. - * retval kStatus_LPUART_FlagCannotClearManually The flag can't be cleared by this function but - * it is cleared automatically by hardware. - * retval kStatus_Success Status in the mask are cleared. - */ -status_t LPUART_ClearStatusFlags(LPUART_Type *base, uint32_t mask) -{ - uint32_t temp; - status_t status; - - /* Only deal with the clearable flags */ - mask &= (uint32_t)kLPUART_AllClearFlags; -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Status bits in FIFO register */ - if ((mask & ((uint32_t)kLPUART_TxFifoOverflowFlag | (uint32_t)kLPUART_RxFifoUnderflowFlag)) != 0U) - { - /* Get the FIFO register value and mask the rx/tx FIFO flush bits and the status bits that can be W1C in case - they are written 1 accidentally. */ - temp = (uint32_t)base->FIFO; - temp &= (uint32_t)(~(LPUART_FIFO_TXFLUSH_MASK | LPUART_FIFO_RXFLUSH_MASK | LPUART_FIFO_TXOF_MASK | - LPUART_FIFO_RXUF_MASK)); - temp |= (mask << 16U) & (LPUART_FIFO_TXOF_MASK | LPUART_FIFO_RXUF_MASK); - base->FIFO = temp; - } -#endif - /* Status bits in STAT register */ - /* First get the STAT register value and mask all the bits that not represent status, then OR with the status bit - * that is to be W1C */ - temp = (base->STAT & 0x3E000000UL) | mask; - base->STAT = temp; - /* If some flags still pending. */ - if (0U != (mask & LPUART_GetStatusFlags(base))) - { - status = kStatus_LPUART_FlagCannotClearManually; - } - else - { - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Writes to the transmitter register using a blocking method. - * - * This function polls the transmitter register, first waits for the register to be empty or TX FIFO to have room, - * and writes data to the transmitter buffer, then waits for the data to be sent out to bus. - * - * param base LPUART peripheral base address. - * param data Start address of the data to write. - * param length Size of the data to write. - * retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * retval kStatus_Success Successfully wrote all data. - */ -status_t LPUART_WriteBlocking(LPUART_Type *base, const uint8_t *data, size_t length) -{ - assert(NULL != data); - - const uint8_t *dataAddress = data; - size_t transferSize = length; - -#if UART_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != transferSize) - { -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; - while ((0U == (base->STAT & LPUART_STAT_TDRE_MASK)) && (0U != --waitTimes)) -#else - while (0U == (base->STAT & LPUART_STAT_TDRE_MASK)) -#endif - { - } -#if UART_RETRY_TIMES - if (0U == waitTimes) - { - return kStatus_LPUART_Timeout; - } -#endif - base->DATA = *(dataAddress); - dataAddress++; - transferSize--; - } - /* Ensure all the data in the transmit buffer are sent out to bus. */ -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; - while ((0U == (base->STAT & LPUART_STAT_TC_MASK)) && (0U != --waitTimes)) -#else - while (0U == (base->STAT & LPUART_STAT_TC_MASK)) -#endif - { - } -#if UART_RETRY_TIMES - if (0U == waitTimes) - { - return kStatus_LPUART_Timeout; - } -#endif - return kStatus_Success; -} -/*! - * brief Writes to the transmitter register using a blocking method in 9bit or 10bit mode. - * - * note This function only support 9bit or 10bit transfer. - * Please make sure only 10bit of data is valid and other bits are 0. - * - * param base LPUART peripheral base address. - * param data Start address of the data to write. - * param length Size of the data to write. - * retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * retval kStatus_Success Successfully wrote all data. - */ -status_t LPUART_WriteBlocking16bit(LPUART_Type *base, const uint16_t *data, size_t length) -{ - assert(NULL != data); - - const uint16_t *dataAddress = data; - size_t transferSize = length; - -#if UART_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != transferSize) - { -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; - while ((0U == (base->STAT & LPUART_STAT_TDRE_MASK)) && (0U != --waitTimes)) -#else - while (0U == (base->STAT & LPUART_STAT_TDRE_MASK)) -#endif - { - } -#if UART_RETRY_TIMES - if (0U == waitTimes) - { - return kStatus_LPUART_Timeout; - } -#endif - base->DATA = *(dataAddress); - dataAddress++; - transferSize--; - } - /* Ensure all the data in the transmit buffer are sent out to bus. */ -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; - while ((0U == (base->STAT & LPUART_STAT_TC_MASK)) && (0U != --waitTimes)) -#else - while (0U == (base->STAT & LPUART_STAT_TC_MASK)) -#endif - { - } -#if UART_RETRY_TIMES - if (0U == waitTimes) - { - return kStatus_LPUART_Timeout; - } -#endif - return kStatus_Success; -} - -/*! - * brief Reads the receiver data register using a blocking method. - * - * This function polls the receiver register, waits for the receiver register full or receiver FIFO - * has data, and reads data from the TX register. - * - * param base LPUART peripheral base address. - * param data Start address of the buffer to store the received data. - * param length Size of the buffer. - * retval kStatus_LPUART_RxHardwareOverrun Receiver overrun happened while receiving data. - * retval kStatus_LPUART_NoiseError Noise error happened while receiving data. - * retval kStatus_LPUART_FramingError Framing error happened while receiving data. - * retval kStatus_LPUART_ParityError Parity error happened while receiving data. - * retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * retval kStatus_Success Successfully received all data. - */ -status_t LPUART_ReadBlocking(LPUART_Type *base, uint8_t *data, size_t length) -{ - assert(NULL != data); - - status_t status = kStatus_Success; - uint32_t statusFlag; - uint8_t *dataAddress = data; - -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - uint32_t ctrl = base->CTRL; - bool isSevenDataBits = (((ctrl & LPUART_CTRL_M7_MASK) != 0U) || - (((ctrl & LPUART_CTRL_M_MASK) == 0U) && ((ctrl & LPUART_CTRL_PE_MASK) != 0U))); -#endif - -#if UART_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != (length--)) - { -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - while (0U == ((base->WATER & LPUART_WATER_RXCOUNT_MASK) >> LPUART_WATER_RXCOUNT_SHIFT)) -#else - while (0U == (base->STAT & LPUART_STAT_RDRF_MASK)) -#endif - { -#if UART_RETRY_TIMES - if (0U == --waitTimes) - { - status = kStatus_LPUART_Timeout; - break; - } -#endif - statusFlag = LPUART_GetStatusFlags(base); - - if (0U != (statusFlag & (uint32_t)kLPUART_RxOverrunFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_RxOverrunFlag)) ? - (kStatus_LPUART_RxHardwareOverrun) : - (kStatus_LPUART_FlagCannotClearManually)); - /* Other error flags(FE, NF, and PF) are prevented from setting once OR is set, no need to check other - * error flags*/ - break; - } - - if (0U != (statusFlag & (uint32_t)kLPUART_ParityErrorFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_ParityErrorFlag)) ? - (kStatus_LPUART_ParityError) : - (kStatus_LPUART_FlagCannotClearManually)); - } - - if (0U != (statusFlag & (uint32_t)kLPUART_FramingErrorFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_FramingErrorFlag)) ? - (kStatus_LPUART_FramingError) : - (kStatus_LPUART_FlagCannotClearManually)); - } - - if (0U != (statusFlag & (uint32_t)kLPUART_NoiseErrorFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_NoiseErrorFlag)) ? - (kStatus_LPUART_NoiseError) : - (kStatus_LPUART_FlagCannotClearManually)); - } - if (kStatus_Success != status) - { - break; - } - } - - if (kStatus_Success == status) - { -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - if (isSevenDataBits) - { - *(dataAddress) = (uint8_t)(base->DATA & 0x7FU); - dataAddress++; - } - else - { - *(dataAddress) = (uint8_t)base->DATA; - dataAddress++; - } -#else - *(dataAddress) = (uint8_t)base->DATA; - dataAddress++; -#endif - } - else - { - break; - } - } - - return status; -} -/*! - * brief Reads the receiver data register in 9bit or 10bit mode. - * - * note This function only support 9bit or 10bit transfer. - * - * param base LPUART peripheral base address. - * param data Start address of the buffer to store the received data by 16bit, only 10bit is valid. - * param length Size of the buffer. - * retval kStatus_LPUART_RxHardwareOverrun Receiver overrun happened while receiving data. - * retval kStatus_LPUART_NoiseError Noise error happened while receiving data. - * retval kStatus_LPUART_FramingError Framing error happened while receiving data. - * retval kStatus_LPUART_ParityError Parity error happened while receiving data. - * retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * retval kStatus_Success Successfully received all data. - */ -status_t LPUART_ReadBlocking16bit(LPUART_Type *base, uint16_t *data, size_t length) -{ - assert(NULL != data); - - status_t status = kStatus_Success; - uint32_t statusFlag; - uint16_t *dataAddress = data; - -#if UART_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != (length--)) - { -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - while (0U == ((base->WATER & LPUART_WATER_RXCOUNT_MASK) >> LPUART_WATER_RXCOUNT_SHIFT)) -#else - while (0U == (base->STAT & LPUART_STAT_RDRF_MASK)) -#endif - { -#if UART_RETRY_TIMES - if (0U == --waitTimes) - { - status = kStatus_LPUART_Timeout; - break; - } -#endif - statusFlag = LPUART_GetStatusFlags(base); - - if (0U != (statusFlag & (uint32_t)kLPUART_RxOverrunFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_RxOverrunFlag)) ? - (kStatus_LPUART_RxHardwareOverrun) : - (kStatus_LPUART_FlagCannotClearManually)); - /* Other error flags(FE, NF, and PF) are prevented from setting once OR is set, no need to check other - * error flags*/ - break; - } - - if (0U != (statusFlag & (uint32_t)kLPUART_ParityErrorFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_ParityErrorFlag)) ? - (kStatus_LPUART_ParityError) : - (kStatus_LPUART_FlagCannotClearManually)); - } - - if (0U != (statusFlag & (uint32_t)kLPUART_FramingErrorFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_FramingErrorFlag)) ? - (kStatus_LPUART_FramingError) : - (kStatus_LPUART_FlagCannotClearManually)); - } - - if (0U != (statusFlag & (uint32_t)kLPUART_NoiseErrorFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_NoiseErrorFlag)) ? - (kStatus_LPUART_NoiseError) : - (kStatus_LPUART_FlagCannotClearManually)); - } - if (kStatus_Success != status) - { - break; - } - } - if (kStatus_Success == status) - { - *(dataAddress) = (uint16_t)(base->DATA & 0x03FFU); - dataAddress++; - } - else - { - break; - } - } - - return status; -} - -/*! - * brief Initializes the LPUART handle. - * - * This function initializes the LPUART handle, which can be used for other LPUART - * transactional APIs. Usually, for a specified LPUART instance, - * call this API once to get the initialized handle. - * - * The LPUART driver supports the "background" receiving, which means that user can set up - * an RX ring buffer optionally. Data received is stored into the ring buffer even when the - * user doesn't call the LPUART_TransferReceiveNonBlocking() API. If there is already data received - * in the ring buffer, the user can get the received data from the ring buffer directly. - * The ring buffer is disabled if passing NULL as p ringBuffer. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param callback Callback function. - * param userData User data. - */ -void LPUART_TransferCreateHandle(LPUART_Type *base, - lpuart_handle_t *handle, - lpuart_transfer_callback_t callback, - void *userData) -{ - assert(NULL != handle); - - uint32_t instance; - -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - uint32_t ctrl = base->CTRL; - bool isSevenDataBits = (((ctrl & LPUART_CTRL_M7_MASK) != 0U) || - (((ctrl & LPUART_CTRL_M_MASK) == 0U) && ((ctrl & LPUART_CTRL_PE_MASK) != 0U))); -#endif - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(lpuart_handle_t)); - - /* Set the TX/RX state. */ - handle->rxState = (uint8_t)kLPUART_RxIdle; - handle->txState = (uint8_t)kLPUART_TxIdle; - - /* Set the callback and user data. */ - handle->callback = callback; - handle->userData = userData; - -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - /* Initial seven data bits flag */ - handle->isSevenDataBits = isSevenDataBits; -#endif - handle->is16bitData = false; - - /* Get instance from peripheral base address. */ - instance = LPUART_GetInstance(base); - - /* Save the handle in global variables to support the double weak mechanism. */ - s_lpuartHandle[instance] = handle; - - s_lpuartIsr[instance] = LPUART_TransferHandleIRQ; - -/* Enable interrupt in NVIC. */ -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ - (void)EnableIRQ(s_lpuartRxIRQ[instance]); - (void)EnableIRQ(s_lpuartTxIRQ[instance]); -#else - (void)EnableIRQ(s_lpuartIRQ[instance]); -#endif -} - -/*! - * brief Sets up the RX ring buffer. - * - * This function sets up the RX ring buffer to a specific UART handle. - * - * When the RX ring buffer is used, data received is stored into the ring buffer even when - * the user doesn't call the UART_TransferReceiveNonBlocking() API. If there is already data received - * in the ring buffer, the user can get the received data from the ring buffer directly. - * - * note When using RX ring buffer, one byte is reserved for internal use. In other - * words, if p ringBufferSize is 32, then only 31 bytes are used for saving data. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param ringBuffer Start address of ring buffer for background receiving. Pass NULL to disable the ring buffer. - * param ringBufferSize size of the ring buffer. - */ -void LPUART_TransferStartRingBuffer(LPUART_Type *base, - lpuart_handle_t *handle, - uint8_t *ringBuffer, - size_t ringBufferSize) -{ - assert(NULL != handle); - assert(NULL != ringBuffer); - - /* Setup the ring buffer address */ - handle->rxRingBuffer = ringBuffer; - if (!handle->is16bitData) - { - handle->rxRingBufferSize = ringBufferSize; - } - else - { - handle->rxRingBufferSize = ringBufferSize / 2U; - } - handle->rxRingBufferHead = 0U; - handle->rxRingBufferTail = 0U; - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. */ - uint32_t irqMask = DisableGlobalIRQ(); - /* Enable the interrupt to accept the data when user need the ring buffer. */ - base->CTRL |= (uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); -} - -/*! - * brief Aborts the background transfer and uninstalls the ring buffer. - * - * This function aborts the background transfer and uninstalls the ring buffer. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - */ -void LPUART_TransferStopRingBuffer(LPUART_Type *base, lpuart_handle_t *handle) -{ - assert(NULL != handle); - - if (handle->rxState == (uint8_t)kLPUART_RxIdle) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. - */ - uint32_t irqMask = DisableGlobalIRQ(); - base->CTRL &= ~(uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); - } - - handle->rxRingBuffer = NULL; - handle->rxRingBufferSize = 0U; - handle->rxRingBufferHead = 0U; - handle->rxRingBufferTail = 0U; -} - -/*! - * brief Transmits a buffer of data using the interrupt method. - * - * This function send data using an interrupt method. This is a non-blocking function, which - * returns directly without waiting for all data written to the transmitter register. When - * all data is written to the TX register in the ISR, the LPUART driver calls the callback - * function and passes the ref kStatus_LPUART_TxIdle as status parameter. - * - * note The kStatus_LPUART_TxIdle is passed to the upper layer when all data are written - * to the TX register. However, there is no check to ensure that all the data sent out. Before disabling the TX, - * check the kLPUART_TransmissionCompleteFlag to ensure that the transmit is finished. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param xfer LPUART transfer structure, see #lpuart_transfer_t. - * retval kStatus_Success Successfully start the data transmission. - * retval kStatus_LPUART_TxBusy Previous transmission still not finished, data not all written to the TX register. - * retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_TransferSendNonBlocking(LPUART_Type *base, lpuart_handle_t *handle, lpuart_transfer_t *xfer) -{ - assert(NULL != handle); - assert(NULL != xfer); - assert(NULL != xfer->txData); - assert(0U != xfer->dataSize); - - status_t status; - - /* Return error if current TX busy. */ - if ((uint8_t)kLPUART_TxBusy == handle->txState) - { - status = kStatus_LPUART_TxBusy; - } - else - { - if (!handle->is16bitData) - { - handle->txData = xfer->txData; - } - else - { - handle->txData16 = xfer->txData16; - } - handle->txDataSize = xfer->dataSize; - handle->txDataSizeAll = xfer->dataSize; - handle->txState = (uint8_t)kLPUART_TxBusy; - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. - */ - uint32_t irqMask = DisableGlobalIRQ(); - /* Enable transmitter interrupt. */ - base->CTRL |= (uint32_t)LPUART_CTRL_TIE_MASK; - EnableGlobalIRQ(irqMask); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Aborts the interrupt-driven data transmit. - * - * This function aborts the interrupt driven data sending. The user can get the remainBtyes to find out - * how many bytes are not sent out. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - */ -void LPUART_TransferAbortSend(LPUART_Type *base, lpuart_handle_t *handle) -{ - assert(NULL != handle); - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. */ - uint32_t irqMask = DisableGlobalIRQ(); - base->CTRL &= ~(uint32_t)(LPUART_CTRL_TIE_MASK | LPUART_CTRL_TCIE_MASK); - EnableGlobalIRQ(irqMask); - - handle->txDataSize = 0; - handle->txState = (uint8_t)kLPUART_TxIdle; -} - -/*! - * brief Gets the number of bytes that have been sent out to bus. - * - * This function gets the number of bytes that have been sent out to bus by an interrupt method. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param count Send bytes count. - * retval kStatus_NoTransferInProgress No send in progress. - * retval kStatus_InvalidArgument Parameter is invalid. - * retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetSendCount(LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count) -{ - assert(NULL != handle); - assert(NULL != count); - - status_t status = kStatus_Success; - size_t tmptxDataSize = handle->txDataSize; - - if ((uint8_t)kLPUART_TxIdle == handle->txState) - { - status = kStatus_NoTransferInProgress; - } - else - { -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - *count = handle->txDataSizeAll - tmptxDataSize - - ((base->WATER & LPUART_WATER_TXCOUNT_MASK) >> LPUART_WATER_TXCOUNT_SHIFT); -#else - if ((base->STAT & (uint32_t)kLPUART_TxDataRegEmptyFlag) != 0U) - { - *count = handle->txDataSizeAll - tmptxDataSize; - } - else - { - *count = handle->txDataSizeAll - tmptxDataSize - 1U; - } -#endif - } - - return status; -} - -/*! - * brief Receives a buffer of data using the interrupt method. - * - * This function receives data using an interrupt method. This is a non-blocking function - * which returns without waiting to ensure that all data are received. - * If the RX ring buffer is used and not empty, the data in the ring buffer is copied and - * the parameter p receivedBytes shows how many bytes are copied from the ring buffer. - * After copying, if the data in the ring buffer is not enough for read, the receive - * request is saved by the LPUART driver. When the new data arrives, the receive request - * is serviced first. When all data is received, the LPUART driver notifies the upper layer - * through a callback function and passes a status parameter ref kStatus_UART_RxIdle. - * For example, the upper layer needs 10 bytes but there are only 5 bytes in ring buffer. - * The 5 bytes are copied to xfer->data, which returns with the - * parameter p receivedBytes set to 5. For the remaining 5 bytes, the newly arrived data is - * saved from xfer->data[5]. When 5 bytes are received, the LPUART driver notifies the upper layer. - * If the RX ring buffer is not enabled, this function enables the RX and RX interrupt - * to receive data to xfer->data. When all data is received, the upper layer is notified. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param xfer LPUART transfer structure, see #uart_transfer_t. - * param receivedBytes Bytes received from the ring buffer directly. - * retval kStatus_Success Successfully queue the transfer into the transmit queue. - * retval kStatus_LPUART_RxBusy Previous receive request is not finished. - * retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_TransferReceiveNonBlocking(LPUART_Type *base, - lpuart_handle_t *handle, - lpuart_transfer_t *xfer, - size_t *receivedBytes) -{ - assert(NULL != handle); - assert(NULL != xfer); - assert(NULL != xfer->rxData); - assert(0U != xfer->dataSize); - - uint32_t i; - status_t status; - uint32_t irqMask; - /* How many bytes to copy from ring buffer to user memory. */ - size_t bytesToCopy = 0U; - /* How many bytes to receive. */ - size_t bytesToReceive; - /* How many bytes currently have received. */ - size_t bytesCurrentReceived; - - /* How to get data: - 1. If RX ring buffer is not enabled, then save xfer->data and xfer->dataSize - to lpuart handle, enable interrupt to store received data to xfer->data. When - all data received, trigger callback. - 2. If RX ring buffer is enabled and not empty, get data from ring buffer first. - If there are enough data in ring buffer, copy them to xfer->data and return. - If there are not enough data in ring buffer, copy all of them to xfer->data, - save the xfer->data remained empty space to lpuart handle, receive data - to this empty space and trigger callback when finished. */ - - if ((uint8_t)kLPUART_RxBusy == handle->rxState) - { - status = kStatus_LPUART_RxBusy; - } - else - { - bytesToReceive = xfer->dataSize; - bytesCurrentReceived = 0; - - /* If RX ring buffer is used. */ - if (NULL != handle->rxRingBuffer) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - /* Disable LPUART RX IRQ, protect ring buffer. */ - base->CTRL &= ~(uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); - - /* How many bytes in RX ring buffer currently. */ - bytesToCopy = LPUART_TransferGetRxRingBufferLength(base, handle); - - if (0U != bytesToCopy) - { - bytesToCopy = MIN(bytesToReceive, bytesToCopy); - - bytesToReceive -= bytesToCopy; - - /* Copy data from ring buffer to user memory. */ - for (i = 0U; i < bytesToCopy; i++) - { - if (!handle->is16bitData) - { - xfer->rxData[bytesCurrentReceived] = handle->rxRingBuffer[handle->rxRingBufferTail]; - } - else - { - xfer->rxData16[bytesCurrentReceived] = handle->rxRingBuffer16[handle->rxRingBufferTail]; - } - bytesCurrentReceived++; - - /* Wrap to 0. Not use modulo (%) because it might be large and slow. */ - if (((uint32_t)handle->rxRingBufferTail + 1U) == handle->rxRingBufferSize) - { - handle->rxRingBufferTail = 0U; - } - else - { - handle->rxRingBufferTail++; - } - } - } - - /* If ring buffer does not have enough data, still need to read more data. */ - if (0U != bytesToReceive) - { - /* No data in ring buffer, save the request to LPUART handle. */ - - if (!handle->is16bitData) - { - handle->rxData = &xfer->rxData[bytesCurrentReceived]; - } - else - { - handle->rxData16 = &xfer->rxData16[bytesCurrentReceived]; - } - handle->rxDataSize = bytesToReceive; - handle->rxDataSizeAll = xfer->dataSize; - handle->rxState = (uint8_t)kLPUART_RxBusy; - } - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - /* Re-enable LPUART RX IRQ. */ - base->CTRL |= (uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); - - /* Call user callback since all data are received. */ - if (0U == bytesToReceive) - { - if (NULL != handle->callback) - { - handle->callback(base, handle, kStatus_LPUART_RxIdle, handle->userData); - } - } - } - /* Ring buffer not used. */ - else - { - if (!handle->is16bitData) - { - handle->rxData = &xfer->rxData[bytesCurrentReceived]; - } - else - { - handle->rxData16 = &xfer->rxData16[bytesCurrentReceived]; - } - handle->rxDataSize = bytesToReceive; - handle->rxDataSizeAll = bytesToReceive; - handle->rxState = (uint8_t)kLPUART_RxBusy; - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - /* Enable RX interrupt. */ - base->CTRL |= (uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ILIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); - } - - /* Return the how many bytes have read. */ - if (NULL != receivedBytes) - { - *receivedBytes = bytesCurrentReceived; - } - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Aborts the interrupt-driven data receiving. - * - * This function aborts the interrupt-driven data receiving. The user can get the remainBytes to find out - * how many bytes not received yet. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - */ -void LPUART_TransferAbortReceive(LPUART_Type *base, lpuart_handle_t *handle) -{ - assert(NULL != handle); - - /* Only abort the receive to handle->rxData, the RX ring buffer is still working. */ - if (NULL == handle->rxRingBuffer) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. - */ - uint32_t irqMask = DisableGlobalIRQ(); - /* Disable RX interrupt. */ - base->CTRL &= ~(uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ILIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); - } - - handle->rxDataSize = 0U; - handle->rxState = (uint8_t)kLPUART_RxIdle; -} - -/*! - * brief Gets the number of bytes that have been received. - * - * This function gets the number of bytes that have been received. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param count Receive bytes count. - * retval kStatus_NoTransferInProgress No receive in progress. - * retval kStatus_InvalidArgument Parameter is invalid. - * retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetReceiveCount(LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count) -{ - assert(NULL != handle); - assert(NULL != count); - - status_t status = kStatus_Success; - size_t tmprxDataSize = handle->rxDataSize; - - if ((uint8_t)kLPUART_RxIdle == handle->rxState) - { - status = kStatus_NoTransferInProgress; - } - else - { - *count = handle->rxDataSizeAll - tmprxDataSize; - } - - return status; -} - -static void LPUART_TransferHandleIDLEReady(LPUART_Type *base, lpuart_handle_t *handle) -{ - uint32_t irqMask; -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - uint8_t count; - uint8_t tempCount; - count = ((uint8_t)((base->WATER & LPUART_WATER_RXCOUNT_MASK) >> LPUART_WATER_RXCOUNT_SHIFT)); - - while ((0U != handle->rxDataSize) && (0U != count)) - { - tempCount = (uint8_t)MIN(handle->rxDataSize, count); - /* Using non block API to read the data from the registers. */ - if (!handle->is16bitData) - { - LPUART_ReadNonBlocking(base, handle->rxData, tempCount); - handle->rxData = &handle->rxData[tempCount]; - } - else - { - LPUART_ReadNonBlocking16bit(base, handle->rxData16, tempCount); - handle->rxData16 = &handle->rxData16[tempCount]; - } - handle->rxDataSize -= tempCount; - count -= tempCount; - - /* If rxDataSize is 0, invoke rx idle callback.*/ - if (0U == (handle->rxDataSize)) - { - handle->rxState = (uint8_t)kLPUART_RxIdle; - - if (NULL != handle->callback) - { - handle->callback(base, handle, kStatus_LPUART_RxIdle, handle->userData); - } - } - } -#endif - /* Clear IDLE flag.*/ - base->STAT = ((base->STAT & 0x3FE00000U) | LPUART_STAT_IDLE_MASK); - - /* If rxDataSize is 0, disable rx ready, overrun and idle line interrupt.*/ - if (0U == handle->rxDataSize) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - base->CTRL &= ~(uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ILIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); - } - /* Invoke callback if callback is not NULL and rxDataSize is not 0. */ - else if (NULL != handle->callback) - { - handle->callback(base, handle, kStatus_LPUART_IdleLineDetected, handle->userData); - } - else - { - /* Avoid MISRA 15.7 */ - } -} - -static void LPUART_TransferHandleReceiveDataFull(LPUART_Type *base, lpuart_handle_t *handle) -{ - uint8_t count; - uint8_t tempCount; - uint16_t tpmRxRingBufferHead; - uint32_t tpmData; - uint32_t irqMask; - - /* Get the size that can be stored into buffer for this interrupt. */ -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - count = ((uint8_t)((base->WATER & LPUART_WATER_RXCOUNT_MASK) >> LPUART_WATER_RXCOUNT_SHIFT)); -#else - count = 1; -#endif - - /* If handle->rxDataSize is not 0, first save data to handle->rxData. */ - while ((0U != handle->rxDataSize) && (0U != count)) - { -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - tempCount = (uint8_t)MIN(handle->rxDataSize, count); -#else - tempCount = 1; -#endif - - /* Using non block API to read the data from the registers. */ - if (!handle->is16bitData) - { - LPUART_ReadNonBlocking(base, handle->rxData, tempCount); - handle->rxData = &handle->rxData[tempCount]; - } - else - { - LPUART_ReadNonBlocking16bit(base, handle->rxData16, tempCount); - handle->rxData16 = &handle->rxData16[tempCount]; - } - handle->rxDataSize -= tempCount; - count -= tempCount; - - /* If all the data required for upper layer is ready, trigger callback. */ - if (0U == handle->rxDataSize) - { - handle->rxState = (uint8_t)kLPUART_RxIdle; - - if (NULL != handle->callback) - { - handle->callback(base, handle, kStatus_LPUART_RxIdle, handle->userData); - } - } - } - - /* If use RX ring buffer, receive data to ring buffer. */ - if (NULL != handle->rxRingBuffer) - { - while (0U != count--) - { - /* If RX ring buffer is full, trigger callback to notify over run. */ - if (LPUART_TransferIsRxRingBufferFull(base, handle)) - { - if (NULL != handle->callback) - { - handle->callback(base, handle, kStatus_LPUART_RxRingBufferOverrun, handle->userData); - } - } - - /* If ring buffer is still full after callback function, the oldest data is overridden. */ - if (LPUART_TransferIsRxRingBufferFull(base, handle)) - { - /* Increase handle->rxRingBufferTail to make room for new data. */ - if (((uint32_t)handle->rxRingBufferTail + 1U) == handle->rxRingBufferSize) - { - handle->rxRingBufferTail = 0U; - } - else - { - handle->rxRingBufferTail++; - } - } - - /* Read data. */ - tpmRxRingBufferHead = handle->rxRingBufferHead; - tpmData = base->DATA; -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - if (handle->isSevenDataBits) - { - handle->rxRingBuffer[tpmRxRingBufferHead] = (uint8_t)(tpmData & 0x7FU); - } - else - { - if (!handle->is16bitData) - { - handle->rxRingBuffer[tpmRxRingBufferHead] = (uint8_t)tpmData; - } - else - { - handle->rxRingBuffer16[tpmRxRingBufferHead] = (uint16_t)(tpmData & 0x3FFU); - } - } -#else - if (!handle->is16bitData) - { - handle->rxRingBuffer[tpmRxRingBufferHead] = (uint8_t)tpmData; - } - else - { - handle->rxRingBuffer16[tpmRxRingBufferHead] = (uint16_t)(tpmData & 0x3FFU); - } -#endif - - /* Increase handle->rxRingBufferHead. */ - if (((uint32_t)handle->rxRingBufferHead + 1U) == handle->rxRingBufferSize) - { - handle->rxRingBufferHead = 0U; - } - else - { - handle->rxRingBufferHead++; - } - } - } - /* If no receive requst pending, stop RX interrupt. */ - else if (0U == handle->rxDataSize) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - base->CTRL &= ~(uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ORIE_MASK | LPUART_CTRL_ILIE_MASK); - EnableGlobalIRQ(irqMask); - } - else - { - /* Avoid MISRA C-2012 15.7 voiation */ - return; - } -} - -static void LPUART_TransferHandleSendDataEmpty(LPUART_Type *base, lpuart_handle_t *handle) -{ - uint8_t count; - uint8_t tempCount; - uint32_t irqMask; -/* Get the bytes that available at this moment. */ -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - count = (uint8_t)FSL_FEATURE_LPUART_FIFO_SIZEn(base) - - (uint8_t)((base->WATER & LPUART_WATER_TXCOUNT_MASK) >> LPUART_WATER_TXCOUNT_SHIFT); -#else - count = 1; -#endif - - while ((0U != handle->txDataSize) && (0U != count)) - { -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - tempCount = (uint8_t)MIN(handle->txDataSize, count); -#else - tempCount = 1; -#endif - - /* Using non block API to write the data to the registers. */ - if (!handle->is16bitData) - { - LPUART_WriteNonBlocking(base, handle->txData, tempCount); - handle->txData = &handle->txData[tempCount]; - } - else - { - LPUART_WriteNonBlocking16bit(base, handle->txData16, tempCount); - handle->txData16 = &handle->txData16[tempCount]; - } - handle->txDataSize -= tempCount; - count -= tempCount; - - /* If all the data are written to data register, notify user with the callback, then TX finished. */ - if (0U == handle->txDataSize) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - /* Disable TX register empty interrupt and enable transmission completion interrupt. */ - base->CTRL = (base->CTRL & ~LPUART_CTRL_TIE_MASK) | LPUART_CTRL_TCIE_MASK; - EnableGlobalIRQ(irqMask); - } - } -} - -static void LPUART_TransferHandleTransmissionComplete(LPUART_Type *base, lpuart_handle_t *handle) -{ - uint32_t irqMask; - /* Set txState to idle only when all data has been sent out to bus. */ - handle->txState = (uint8_t)kLPUART_TxIdle; - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. - */ - irqMask = DisableGlobalIRQ(); - /* Disable transmission complete interrupt. */ - base->CTRL &= ~(uint32_t)LPUART_CTRL_TCIE_MASK; - EnableGlobalIRQ(irqMask); - - /* Trigger callback. */ - if (NULL != handle->callback) - { - handle->callback(base, handle, kStatus_LPUART_TxIdle, handle->userData); - } -} - -/*! - * brief LPUART IRQ handle function. - * - * This function handles the LPUART transmit and receive IRQ request. - * - * param base LPUART peripheral base address. - * param irqHandle LPUART handle pointer. - */ -void LPUART_TransferHandleIRQ(LPUART_Type *base, void *irqHandle) -{ - assert(NULL != irqHandle); - - uint32_t status = LPUART_GetStatusFlags(base); - uint32_t enabledInterrupts = LPUART_GetEnabledInterrupts(base); - - lpuart_handle_t *handle = (lpuart_handle_t *)irqHandle; - - /* If RX overrun. */ - if ((uint32_t)kLPUART_RxOverrunFlag == ((uint32_t)kLPUART_RxOverrunFlag & status)) - { - /* Clear overrun flag, otherwise the RX does not work. */ - base->STAT = ((base->STAT & 0x3FE00000U) | LPUART_STAT_OR_MASK); - - /* Trigger callback. */ - if (NULL != (handle->callback)) - { - handle->callback(base, handle, kStatus_LPUART_RxHardwareOverrun, handle->userData); - } - } - - /* If IDLE flag is set and the IDLE interrupt is enabled. */ - if ((0U != ((uint32_t)kLPUART_IdleLineFlag & status)) && - (0U != ((uint32_t)kLPUART_IdleLineInterruptEnable & enabledInterrupts))) - { - LPUART_TransferHandleIDLEReady(base, handle); - } - /* Receive data register full */ - if ((0U != ((uint32_t)kLPUART_RxDataRegFullFlag & status)) && - (0U != ((uint32_t)kLPUART_RxDataRegFullInterruptEnable & enabledInterrupts))) - { - LPUART_TransferHandleReceiveDataFull(base, handle); - } - - /* Send data register empty and the interrupt is enabled. */ - if ((0U != ((uint32_t)kLPUART_TxDataRegEmptyFlag & status)) && - (0U != ((uint32_t)kLPUART_TxDataRegEmptyInterruptEnable & enabledInterrupts))) - { - LPUART_TransferHandleSendDataEmpty(base, handle); - } - - /* Transmission complete and the interrupt is enabled. */ - if ((0U != ((uint32_t)kLPUART_TransmissionCompleteFlag & status)) && - (0U != ((uint32_t)kLPUART_TransmissionCompleteInterruptEnable & enabledInterrupts))) - { - LPUART_TransferHandleTransmissionComplete(base, handle); - } -} - -/*! - * brief LPUART Error IRQ handle function. - * - * This function handles the LPUART error IRQ request. - * - * param base LPUART peripheral base address. - * param irqHandle LPUART handle pointer. - */ -void LPUART_TransferHandleErrorIRQ(LPUART_Type *base, void *irqHandle) -{ - /* To be implemented by User. */ -} -#if defined(FSL_FEATURE_LPUART_HAS_SHARED_IRQ0_IRQ1) && FSL_FEATURE_LPUART_HAS_SHARED_IRQ0_IRQ1 -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART0_LPUART1_RX_DriverIRQHandler(void); -void LPUART0_LPUART1_RX_DriverIRQHandler(void) -{ - /* If handle is registered, treat the transfer function is enabled. */ - if (NULL != s_lpuartHandle[0]) - { - s_lpuartIsr[0](LPUART0, s_lpuartHandle[0]); - } - if (NULL != s_lpuartHandle[1]) - { - s_lpuartIsr[1](LPUART1, s_lpuartHandle[1]); - } - SDK_ISR_EXIT_BARRIER; -} -void LPUART0_LPUART1_TX_DriverIRQHandler(void); -void LPUART0_LPUART1_TX_DriverIRQHandler(void) -{ - /* If handle is registered, treat the transfer function is enabled. */ - if (NULL != s_lpuartHandle[0]) - { - s_lpuartIsr[0](LPUART0, s_lpuartHandle[0]); - } - if (NULL != s_lpuartHandle[1]) - { - s_lpuartIsr[1](LPUART1, s_lpuartHandle[1]); - } - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART0_LPUART1_DriverIRQHandler(void); -void LPUART0_LPUART1_DriverIRQHandler(void) -{ - /* If handle is registered, treat the transfer function is enabled. */ - if (NULL != s_lpuartHandle[0]) - { - s_lpuartIsr[0](LPUART0, s_lpuartHandle[0]); - } - if (NULL != s_lpuartHandle[1]) - { - s_lpuartIsr[1](LPUART1, s_lpuartHandle[1]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART0) -#if !(defined(FSL_FEATURE_LPUART_HAS_SHARED_IRQ0_IRQ1) && FSL_FEATURE_LPUART_HAS_SHARED_IRQ0_IRQ1) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART0_TX_DriverIRQHandler(void); -void LPUART0_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[0](LPUART0, s_lpuartHandle[0]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART0_RX_DriverIRQHandler(void); -void LPUART0_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[0](LPUART0, s_lpuartHandle[0]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART0_DriverIRQHandler(void); -void LPUART0_DriverIRQHandler(void) -{ - s_lpuartIsr[0](LPUART0, s_lpuartHandle[0]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif -#endif - -#if defined(LPUART1) -#if !(defined(FSL_FEATURE_LPUART_HAS_SHARED_IRQ0_IRQ1) && FSL_FEATURE_LPUART_HAS_SHARED_IRQ0_IRQ1) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART1_TX_DriverIRQHandler(void); -void LPUART1_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[1](LPUART1, s_lpuartHandle[1]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART1_RX_DriverIRQHandler(void); -void LPUART1_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[1](LPUART1, s_lpuartHandle[1]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART1_DriverIRQHandler(void); -void LPUART1_DriverIRQHandler(void) -{ - s_lpuartIsr[1](LPUART1, s_lpuartHandle[1]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif -#endif - -#if defined(LPUART2) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART2_TX_DriverIRQHandler(void); -void LPUART2_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[2](LPUART2, s_lpuartHandle[2]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART2_RX_DriverIRQHandler(void); -void LPUART2_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[2](LPUART2, s_lpuartHandle[2]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART2_DriverIRQHandler(void); -void LPUART2_DriverIRQHandler(void) -{ - s_lpuartIsr[2](LPUART2, s_lpuartHandle[2]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART3) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART3_TX_DriverIRQHandler(void); -void LPUART3_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[3](LPUART3, s_lpuartHandle[3]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART3_RX_DriverIRQHandler(void); -void LPUART3_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[3](LPUART3, s_lpuartHandle[3]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART3_DriverIRQHandler(void); -void LPUART3_DriverIRQHandler(void) -{ - s_lpuartIsr[3](LPUART3, s_lpuartHandle[3]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART4) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART4_TX_DriverIRQHandler(void); -void LPUART4_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[4](LPUART4, s_lpuartHandle[4]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART4_RX_DriverIRQHandler(void); -void LPUART4_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[4](LPUART4, s_lpuartHandle[4]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART4_DriverIRQHandler(void); -void LPUART4_DriverIRQHandler(void) -{ - s_lpuartIsr[4](LPUART4, s_lpuartHandle[4]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART5) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART5_TX_DriverIRQHandler(void); -void LPUART5_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[5](LPUART5, s_lpuartHandle[5]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART5_RX_DriverIRQHandler(void); -void LPUART5_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[5](LPUART5, s_lpuartHandle[5]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART5_DriverIRQHandler(void); -void LPUART5_DriverIRQHandler(void) -{ - s_lpuartIsr[5](LPUART5, s_lpuartHandle[5]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART6) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART6_TX_DriverIRQHandler(void); -void LPUART6_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[6](LPUART6, s_lpuartHandle[6]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART6_RX_DriverIRQHandler(void); -void LPUART6_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[6](LPUART6, s_lpuartHandle[6]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART6_DriverIRQHandler(void); -void LPUART6_DriverIRQHandler(void) -{ - s_lpuartIsr[6](LPUART6, s_lpuartHandle[6]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART7) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART7_TX_DriverIRQHandler(void); -void LPUART7_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[7](LPUART7, s_lpuartHandle[7]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART7_RX_DriverIRQHandler(void); -void LPUART7_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[7](LPUART7, s_lpuartHandle[7]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART7_DriverIRQHandler(void); -void LPUART7_DriverIRQHandler(void) -{ - s_lpuartIsr[7](LPUART7, s_lpuartHandle[7]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART8) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART8_TX_DriverIRQHandler(void); -void LPUART8_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[8](LPUART8, s_lpuartHandle[8]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART8_RX_DriverIRQHandler(void); -void LPUART8_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[8](LPUART8, s_lpuartHandle[8]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART8_DriverIRQHandler(void); -void LPUART8_DriverIRQHandler(void) -{ - s_lpuartIsr[8](LPUART8, s_lpuartHandle[8]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART9) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART9_TX_DriverIRQHandler(void); -void LPUART9_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[9](LPUART9, s_lpuartHandle[9]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART9_RX_DriverIRQHandler(void); -void LPUART9_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[9](LPUART9, s_lpuartHandle[9]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART9_DriverIRQHandler(void); -void LPUART9_DriverIRQHandler(void) -{ - s_lpuartIsr[9](LPUART9, s_lpuartHandle[9]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART10) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART10_TX_DriverIRQHandler(void); -void LPUART10_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[10](LPUART10, s_lpuartHandle[10]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART10_RX_DriverIRQHandler(void); -void LPUART10_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[10](LPUART10, s_lpuartHandle[10]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART10_DriverIRQHandler(void); -void LPUART10_DriverIRQHandler(void) -{ - s_lpuartIsr[10](LPUART10, s_lpuartHandle[10]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART11) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART11_TX_DriverIRQHandler(void); -void LPUART11_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[11](LPUART11, s_lpuartHandle[11]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART11_RX_DriverIRQHandler(void); -void LPUART11_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[11](LPUART11, s_lpuartHandle[11]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART11_DriverIRQHandler(void); -void LPUART11_DriverIRQHandler(void) -{ - s_lpuartIsr[11](LPUART11, s_lpuartHandle[11]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(LPUART12) -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -void LPUART12_TX_DriverIRQHandler(void); -void LPUART12_TX_DriverIRQHandler(void) -{ - s_lpuartIsr[12](LPUART12, s_lpuartHandle[12]); - SDK_ISR_EXIT_BARRIER; -} -void LPUART12_RX_DriverIRQHandler(void); -void LPUART12_RX_DriverIRQHandler(void) -{ - s_lpuartIsr[12](LPUART12, s_lpuartHandle[12]); - SDK_ISR_EXIT_BARRIER; -} -#else -void LPUART12_DriverIRQHandler(void); -void LPUART12_DriverIRQHandler(void) -{ - s_lpuartIsr[12](LPUART12, s_lpuartHandle[12]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(CM4_0__LPUART) -void M4_0_LPUART_DriverIRQHandler(void); -void M4_0_LPUART_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(CM4_0__LPUART)](CM4_0__LPUART, s_lpuartHandle[LPUART_GetInstance(CM4_0__LPUART)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CM4_1__LPUART) -void M4_1_LPUART_DriverIRQHandler(void); -void M4_1_LPUART_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(CM4_1__LPUART)](CM4_1__LPUART, s_lpuartHandle[LPUART_GetInstance(CM4_1__LPUART)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CM4__LPUART) -void M4_LPUART_DriverIRQHandler(void); -void M4_LPUART_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(CM4__LPUART)](CM4__LPUART, s_lpuartHandle[LPUART_GetInstance(CM4__LPUART)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(DMA__LPUART0) -void DMA_UART0_INT_DriverIRQHandler(void); -void DMA_UART0_INT_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(DMA__LPUART0)](DMA__LPUART0, s_lpuartHandle[LPUART_GetInstance(DMA__LPUART0)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(DMA__LPUART1) -void DMA_UART1_INT_DriverIRQHandler(void); -void DMA_UART1_INT_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(DMA__LPUART1)](DMA__LPUART1, s_lpuartHandle[LPUART_GetInstance(DMA__LPUART1)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(DMA__LPUART2) -void DMA_UART2_INT_DriverIRQHandler(void); -void DMA_UART2_INT_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(DMA__LPUART2)](DMA__LPUART2, s_lpuartHandle[LPUART_GetInstance(DMA__LPUART2)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(DMA__LPUART3) -void DMA_UART3_INT_DriverIRQHandler(void); -void DMA_UART3_INT_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(DMA__LPUART3)](DMA__LPUART3, s_lpuartHandle[LPUART_GetInstance(DMA__LPUART3)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(DMA__LPUART4) -void DMA_UART4_INT_DriverIRQHandler(void); -void DMA_UART4_INT_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(DMA__LPUART4)](DMA__LPUART4, s_lpuartHandle[LPUART_GetInstance(DMA__LPUART4)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(ADMA__LPUART0) -void ADMA_UART0_INT_DriverIRQHandler(void); -void ADMA_UART0_INT_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(ADMA__LPUART0)](ADMA__LPUART0, s_lpuartHandle[LPUART_GetInstance(ADMA__LPUART0)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(ADMA__LPUART1) -void ADMA_UART1_INT_DriverIRQHandler(void); -void ADMA_UART1_INT_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(ADMA__LPUART1)](ADMA__LPUART1, s_lpuartHandle[LPUART_GetInstance(ADMA__LPUART1)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(ADMA__LPUART2) -void ADMA_UART2_INT_DriverIRQHandler(void); -void ADMA_UART2_INT_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(ADMA__LPUART2)](ADMA__LPUART2, s_lpuartHandle[LPUART_GetInstance(ADMA__LPUART2)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(ADMA__LPUART3) -void ADMA_UART3_INT_DriverIRQHandler(void); -void ADMA_UART3_INT_DriverIRQHandler(void) -{ - s_lpuartIsr[LPUART_GetInstance(ADMA__LPUART3)](ADMA__LPUART3, s_lpuartHandle[LPUART_GetInstance(ADMA__LPUART3)]); - SDK_ISR_EXIT_BARRIER; -} -#endif diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_lpuart.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_lpuart.h deleted file mode 100644 index 13ea2365f63..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_lpuart.h +++ /dev/null @@ -1,1128 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LPUART_H_ -#define FSL_LPUART_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup lpuart_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief LPUART driver version. */ -#define FSL_LPUART_DRIVER_VERSION (MAKE_VERSION(2, 8, 2)) -/*! @} */ - -/*! @brief Retry times for waiting flag. */ -#ifndef UART_RETRY_TIMES -#define UART_RETRY_TIMES 0U /* Defining to zero means to keep waiting for the flag until it is assert/deassert. */ -#endif - -/*! @brief Error codes for the LPUART driver. */ -enum -{ - kStatus_LPUART_TxBusy = MAKE_STATUS(kStatusGroup_LPUART, 0), /*!< TX busy */ - kStatus_LPUART_RxBusy = MAKE_STATUS(kStatusGroup_LPUART, 1), /*!< RX busy */ - kStatus_LPUART_TxIdle = MAKE_STATUS(kStatusGroup_LPUART, 2), /*!< LPUART transmitter is idle. */ - kStatus_LPUART_RxIdle = MAKE_STATUS(kStatusGroup_LPUART, 3), /*!< LPUART receiver is idle. */ - kStatus_LPUART_TxWatermarkTooLarge = MAKE_STATUS(kStatusGroup_LPUART, 4), /*!< TX FIFO watermark too large */ - kStatus_LPUART_RxWatermarkTooLarge = MAKE_STATUS(kStatusGroup_LPUART, 5), /*!< RX FIFO watermark too large */ - kStatus_LPUART_FlagCannotClearManually = MAKE_STATUS(kStatusGroup_LPUART, 6), /*!< Some flag can't manually clear */ - kStatus_LPUART_Error = MAKE_STATUS(kStatusGroup_LPUART, 7), /*!< Error happens on LPUART. */ - kStatus_LPUART_RxRingBufferOverrun = - MAKE_STATUS(kStatusGroup_LPUART, 8), /*!< LPUART RX software ring buffer overrun. */ - kStatus_LPUART_RxHardwareOverrun = MAKE_STATUS(kStatusGroup_LPUART, 9), /*!< LPUART RX receiver overrun. */ - kStatus_LPUART_NoiseError = MAKE_STATUS(kStatusGroup_LPUART, 10), /*!< LPUART noise error. */ - kStatus_LPUART_FramingError = MAKE_STATUS(kStatusGroup_LPUART, 11), /*!< LPUART framing error. */ - kStatus_LPUART_ParityError = MAKE_STATUS(kStatusGroup_LPUART, 12), /*!< LPUART parity error. */ - kStatus_LPUART_BaudrateNotSupport = - MAKE_STATUS(kStatusGroup_LPUART, 13), /*!< Baudrate is not support in current clock source */ - kStatus_LPUART_IdleLineDetected = MAKE_STATUS(kStatusGroup_LPUART, 14), /*!< IDLE flag. */ - kStatus_LPUART_Timeout = MAKE_STATUS(kStatusGroup_LPUART, 15), /*!< LPUART times out. */ -}; - -/*! @brief LPUART parity mode. */ -typedef enum _lpuart_parity_mode -{ - kLPUART_ParityDisabled = 0x0U, /*!< Parity disabled */ - kLPUART_ParityEven = 0x2U, /*!< Parity enabled, type even, bit setting: PE|PT = 10 */ - kLPUART_ParityOdd = 0x3U, /*!< Parity enabled, type odd, bit setting: PE|PT = 11 */ -} lpuart_parity_mode_t; - -/*! @brief LPUART data bits count. */ -typedef enum _lpuart_data_bits -{ - kLPUART_EightDataBits = 0x0U, /*!< Eight data bit */ -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - kLPUART_SevenDataBits = 0x1U, /*!< Seven data bit */ -#endif -} lpuart_data_bits_t; - -/*! @brief LPUART stop bit count. */ -typedef enum _lpuart_stop_bit_count -{ - kLPUART_OneStopBit = 0U, /*!< One stop bit */ - kLPUART_TwoStopBit = 1U, /*!< Two stop bits */ -} lpuart_stop_bit_count_t; - -#if defined(FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT) && FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT -/*! @brief LPUART transmit CTS source. */ -typedef enum _lpuart_transmit_cts_source -{ - kLPUART_CtsSourcePin = 0U, /*!< CTS resource is the LPUART_CTS pin. */ - kLPUART_CtsSourceMatchResult = 1U, /*!< CTS resource is the match result. */ -} lpuart_transmit_cts_source_t; - -/*! @brief LPUART transmit CTS configure. */ -typedef enum _lpuart_transmit_cts_config -{ - kLPUART_CtsSampleAtStart = 0U, /*!< CTS input is sampled at the start of each character. */ - kLPUART_CtsSampleAtIdle = 1U, /*!< CTS input is sampled when the transmitter is idle */ -} lpuart_transmit_cts_config_t; -#endif - -/*! @brief LPUART idle flag type defines when the receiver starts counting. */ -typedef enum _lpuart_idle_type_select -{ - kLPUART_IdleTypeStartBit = 0U, /*!< Start counting after a valid start bit. */ - kLPUART_IdleTypeStopBit = 1U, /*!< Start counting after a stop bit. */ -} lpuart_idle_type_select_t; - -/*! @brief LPUART idle detected configuration. - * This structure defines the number of idle characters that must be received before - * the IDLE flag is set. - */ -typedef enum _lpuart_idle_config -{ - kLPUART_IdleCharacter1 = 0U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter2 = 1U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter4 = 2U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter8 = 3U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter16 = 4U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter32 = 5U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter64 = 6U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter128 = 7U, /*!< the number of idle characters. */ -} lpuart_idle_config_t; - -/*! - * @brief LPUART interrupt configuration structure, default settings all disabled. - * - * This structure contains the settings for all LPUART interrupt configurations. - */ -enum _lpuart_interrupt_enable -{ -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - kLPUART_LinBreakInterruptEnable = (LPUART_BAUD_LBKDIE_MASK >> 8U), /*!< LIN break detect. bit 7 */ -#endif - kLPUART_RxActiveEdgeInterruptEnable = (LPUART_BAUD_RXEDGIE_MASK >> 8U), /*!< Receive Active Edge. bit 6 */ - kLPUART_TxDataRegEmptyInterruptEnable = (LPUART_CTRL_TIE_MASK), /*!< Transmit data register empty. bit 23 */ - kLPUART_TransmissionCompleteInterruptEnable = (LPUART_CTRL_TCIE_MASK), /*!< Transmission complete. bit 22 */ - kLPUART_RxDataRegFullInterruptEnable = (LPUART_CTRL_RIE_MASK), /*!< Receiver data register full. bit 21 */ - kLPUART_IdleLineInterruptEnable = (LPUART_CTRL_ILIE_MASK), /*!< Idle line. bit 20 */ - kLPUART_RxOverrunInterruptEnable = (LPUART_CTRL_ORIE_MASK), /*!< Receiver Overrun. bit 27 */ - kLPUART_NoiseErrorInterruptEnable = (LPUART_CTRL_NEIE_MASK), /*!< Noise error flag. bit 26 */ - kLPUART_FramingErrorInterruptEnable = (LPUART_CTRL_FEIE_MASK), /*!< Framing error flag. bit 25 */ - kLPUART_ParityErrorInterruptEnable = (LPUART_CTRL_PEIE_MASK), /*!< Parity error flag. bit 24 */ -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - kLPUART_Match1InterruptEnable = (LPUART_CTRL_MA1IE_MASK), /*!< Parity error flag. bit 15 */ - kLPUART_Match2InterruptEnable = (LPUART_CTRL_MA2IE_MASK), /*!< Parity error flag. bit 14 */ -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - kLPUART_TxFifoOverflowInterruptEnable = (LPUART_FIFO_TXOFE_MASK), /*!< Transmit FIFO Overflow. bit 9 */ - kLPUART_RxFifoUnderflowInterruptEnable = (LPUART_FIFO_RXUFE_MASK), /*!< Receive FIFO Underflow. bit 8 */ -#endif - - kLPUART_AllInterruptEnable = kLPUART_RxActiveEdgeInterruptEnable | kLPUART_TxDataRegEmptyInterruptEnable | - kLPUART_TransmissionCompleteInterruptEnable | kLPUART_RxDataRegFullInterruptEnable | - kLPUART_IdleLineInterruptEnable | kLPUART_RxOverrunInterruptEnable | - kLPUART_NoiseErrorInterruptEnable | kLPUART_FramingErrorInterruptEnable | - kLPUART_ParityErrorInterruptEnable -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - | kLPUART_LinBreakInterruptEnable -#endif -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - | kLPUART_Match1InterruptEnable | kLPUART_Match2InterruptEnable -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - | kLPUART_TxFifoOverflowInterruptEnable | kLPUART_RxFifoUnderflowInterruptEnable -#endif - , -}; - -/*! - * @brief LPUART status flags. - * - * This provides constants for the LPUART status flags for use in the LPUART functions. - */ -enum _lpuart_flags -{ - kLPUART_TxDataRegEmptyFlag = - (LPUART_STAT_TDRE_MASK), /*!< Transmit data register empty flag, sets when transmit buffer is empty. bit 23 */ - kLPUART_TransmissionCompleteFlag = - (LPUART_STAT_TC_MASK), /*!< Transmission complete flag, sets when transmission activity complete. bit 22 */ - kLPUART_RxDataRegFullFlag = (LPUART_STAT_RDRF_MASK), /*!< Receive data register full flag, sets when the receive - data buffer is full. bit 21 */ - kLPUART_IdleLineFlag = (LPUART_STAT_IDLE_MASK), /*!< Idle line detect flag, sets when idle line detected. bit 20 */ - kLPUART_RxOverrunFlag = (LPUART_STAT_OR_MASK), /*!< Receive Overrun, sets when new data is received before data is - read from receive register. bit 19 */ - kLPUART_NoiseErrorFlag = (LPUART_STAT_NF_MASK), /*!< Receive takes 3 samples of each received bit. If any of these - samples differ, noise flag sets. bit 18 */ - kLPUART_FramingErrorFlag = - (LPUART_STAT_FE_MASK), /*!< Frame error flag, sets if logic 0 was detected where stop bit expected. bit 17 */ - kLPUART_ParityErrorFlag = (LPUART_STAT_PF_MASK), /*!< If parity enabled, sets upon parity error detection. bit 16 */ -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - kLPUART_LinBreakFlag = (LPUART_STAT_LBKDIF_MASK), /*!< LIN break detect interrupt flag, sets when LIN break - char detected and LIN circuit enabled. bit 31 */ -#endif - kLPUART_RxActiveEdgeFlag = (LPUART_STAT_RXEDGIF_MASK), /*!< Receive pin active edge interrupt flag, sets when active - edge detected. bit 30 */ - kLPUART_RxActiveFlag = - (LPUART_STAT_RAF_MASK), /*!< Receiver Active Flag (RAF), sets at beginning of valid start. bit 24 */ -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - kLPUART_DataMatch1Flag = - LPUART_STAT_MA1F_MASK, /*!< The next character to be read from LPUART_DATA matches MA1. bit 15 */ - kLPUART_DataMatch2Flag = - LPUART_STAT_MA2F_MASK, /*!< The next character to be read from LPUART_DATA matches MA2. bit 14 */ -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - kLPUART_TxFifoEmptyFlag = - (LPUART_FIFO_TXEMPT_MASK >> 16), /*!< TXEMPT bit, sets if transmit buffer is empty. bit 7 */ - kLPUART_RxFifoEmptyFlag = - (LPUART_FIFO_RXEMPT_MASK >> 16), /*!< RXEMPT bit, sets if receive buffer is empty. bit 6 */ - kLPUART_TxFifoOverflowFlag = - (LPUART_FIFO_TXOF_MASK >> 16), /*!< TXOF bit, sets if transmit buffer overflow occurred. bit 1 */ - kLPUART_RxFifoUnderflowFlag = - (LPUART_FIFO_RXUF_MASK >> 16), /*!< RXUF bit, sets if receive buffer underflow occurred. bit 0 */ -#endif - - kLPUART_AllClearFlags = kLPUART_RxActiveEdgeFlag | kLPUART_IdleLineFlag | kLPUART_RxOverrunFlag | - kLPUART_NoiseErrorFlag | kLPUART_FramingErrorFlag | kLPUART_ParityErrorFlag -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - | kLPUART_DataMatch1Flag | kLPUART_DataMatch2Flag -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - | kLPUART_TxFifoOverflowFlag | kLPUART_RxFifoUnderflowFlag -#endif -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - | kLPUART_LinBreakFlag -#endif - , - - kLPUART_AllFlags = - kLPUART_RxActiveEdgeFlag | kLPUART_IdleLineFlag | kLPUART_RxOverrunFlag | kLPUART_TxDataRegEmptyFlag | - kLPUART_TransmissionCompleteFlag | kLPUART_RxDataRegFullFlag | kLPUART_RxActiveFlag | kLPUART_NoiseErrorFlag | - kLPUART_FramingErrorFlag | kLPUART_ParityErrorFlag -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - | kLPUART_DataMatch1Flag | kLPUART_DataMatch2Flag -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - | kLPUART_TxFifoOverflowFlag | kLPUART_RxFifoUnderflowFlag | kLPUART_TxFifoEmptyFlag | kLPUART_RxFifoEmptyFlag -#endif -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - | kLPUART_LinBreakFlag -#endif - , -}; - -/*! @brief LPUART configuration structure. */ -typedef struct _lpuart_config -{ - uint32_t baudRate_Bps; /*!< LPUART baud rate */ - lpuart_parity_mode_t parityMode; /*!< Parity mode, disabled (default), even, odd */ - lpuart_data_bits_t dataBitsCount; /*!< Data bits count, eight (default), seven */ - bool isMsb; /*!< Data bits order, LSB (default), MSB */ -#if defined(FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT) && FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT - lpuart_stop_bit_count_t stopBitCount; /*!< Number of stop bits, 1 stop bit (default) or 2 stop bits */ -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - uint8_t txFifoWatermark; /*!< TX FIFO watermark */ - uint8_t rxFifoWatermark; /*!< RX FIFO watermark */ -#endif -#if defined(FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT) && FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT - bool enableRxRTS; /*!< RX RTS enable */ - bool enableTxCTS; /*!< TX CTS enable */ - lpuart_transmit_cts_source_t txCtsSource; /*!< TX CTS source */ - lpuart_transmit_cts_config_t txCtsConfig; /*!< TX CTS configure */ -#endif - lpuart_idle_type_select_t rxIdleType; /*!< RX IDLE type. */ - lpuart_idle_config_t rxIdleConfig; /*!< RX IDLE configuration. */ - bool enableTx; /*!< Enable TX */ - bool enableRx; /*!< Enable RX */ -} lpuart_config_t; - -/*! @brief LPUART transfer structure. */ -typedef struct _lpuart_transfer -{ - /* - * Use separate TX and RX data pointer, because TX data is const data. - * The member data is kept for backward compatibility. - */ - union - { - uint8_t *data; /*!< The buffer of data to be transfer.*/ - uint8_t *rxData; /*!< The buffer to receive data. */ - uint16_t *rxData16; /*!< The buffer to receive data. */ - const uint8_t *txData; /*!< The buffer of data to be sent. */ - const uint16_t *txData16; /*!< The buffer of data to be sent. */ - }; - size_t dataSize; /*!< The byte count to be transfer. */ -} lpuart_transfer_t; - -/* Forward declaration of the handle typedef. */ -typedef struct _lpuart_handle lpuart_handle_t; - -/*! @brief LPUART transfer callback function. */ -typedef void (*lpuart_transfer_callback_t)(LPUART_Type *base, lpuart_handle_t *handle, status_t status, void *userData); - -/*! @brief LPUART handle structure. */ -struct _lpuart_handle -{ - union - { - const uint8_t *volatile txData; /*!< Address of remaining data to send. */ - const uint16_t *volatile txData16; /*!< Address of remaining data to send. */ - }; - volatile size_t txDataSize; /*!< Size of the remaining data to send. */ - size_t txDataSizeAll; /*!< Size of the data to send out. */ - union - { - uint8_t *volatile rxData; /*!< Address of remaining data to receive. */ - uint16_t *volatile rxData16; /*!< Address of remaining data to receive. */ - }; - volatile size_t rxDataSize; /*!< Size of the remaining data to receive. */ - size_t rxDataSizeAll; /*!< Size of the data to receive. */ - - union - { - uint8_t *rxRingBuffer; /*!< Start address of the receiver ring buffer. */ - uint16_t *rxRingBuffer16; /*!< Start address of the receiver ring buffer. */ - }; - size_t rxRingBufferSize; /*!< Size of the ring buffer. */ - volatile uint16_t rxRingBufferHead; /*!< Index for the driver to store received data into ring buffer. */ - volatile uint16_t rxRingBufferTail; /*!< Index for the user to get data from the ring buffer. */ - - lpuart_transfer_callback_t callback; /*!< Callback function. */ - void *userData; /*!< LPUART callback function parameter.*/ - - volatile uint8_t txState; /*!< TX transfer state. */ - volatile uint8_t rxState; /*!< RX transfer state. */ - -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - bool isSevenDataBits; /*!< Seven data bits flag. */ -#endif - bool is16bitData; /*!< 16bit data bits flag, only used for 9bit or 10bit data */ -}; - -/* Typedef for interrupt handler. */ -typedef void (*lpuart_isr_t)(LPUART_Type *base, void *handle); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/* Array of LPUART handle. */ -extern void *s_lpuartHandle[]; - -/* Array of LPUART IRQ number. */ -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ -extern const IRQn_Type s_lpuartTxIRQ[]; -#else -extern const IRQn_Type s_lpuartIRQ[]; -#endif - -/* LPUART ISR for transactional APIs. */ -extern lpuart_isr_t s_lpuartIsr[]; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* _cplusplus */ - -#if defined(FSL_FEATURE_LPUART_HAS_GLOBAL) && FSL_FEATURE_LPUART_HAS_GLOBAL - -/*! - * @name Software Reset - * @{ - */ - -/*! - * @brief Resets the LPUART using software. - * - * This function resets all internal logic and registers except the Global Register. - * Remains set until cleared by software. - * - * @param base LPUART peripheral base address. - */ -static inline void LPUART_SoftwareReset(LPUART_Type *base) -{ - base->GLOBAL |= LPUART_GLOBAL_RST_MASK; - base->GLOBAL &= ~LPUART_GLOBAL_RST_MASK; -} -/*! @} */ -#endif /*FSL_FEATURE_LPUART_HAS_GLOBAL*/ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Initializes an LPUART instance with the user configuration structure and the peripheral clock. - * - * This function configures the LPUART module with user-defined settings. Call the LPUART_GetDefaultConfig() function - * to configure the configuration structure and get the default configuration. - * The example below shows how to use this API to configure the LPUART. - * @code - * lpuart_config_t lpuartConfig; - * lpuartConfig.baudRate_Bps = 115200U; - * lpuartConfig.parityMode = kLPUART_ParityDisabled; - * lpuartConfig.dataBitsCount = kLPUART_EightDataBits; - * lpuartConfig.isMsb = false; - * lpuartConfig.stopBitCount = kLPUART_OneStopBit; - * lpuartConfig.txFifoWatermark = 0; - * lpuartConfig.rxFifoWatermark = 1; - * LPUART_Init(LPUART1, &lpuartConfig, 20000000U); - * @endcode - * - * @param base LPUART peripheral base address. - * @param config Pointer to a user-defined configuration structure. - * @param srcClock_Hz LPUART clock source frequency in HZ. - * @retval kStatus_LPUART_BaudrateNotSupport Baudrate is not support in current clock source. - * @retval kStatus_Success LPUART initialize succeed - */ -status_t LPUART_Init(LPUART_Type *base, const lpuart_config_t *config, uint32_t srcClock_Hz); - -/*! - * @brief Deinitializes a LPUART instance. - * - * This function waits for transmit to complete, disables TX and RX, and disables the LPUART clock. - * - * @param base LPUART peripheral base address. - */ -void LPUART_Deinit(LPUART_Type *base); - -/*! - * @brief Gets the default configuration structure. - * - * This function initializes the LPUART configuration structure to a default value. The default - * values are: - * lpuartConfig->baudRate_Bps = 115200U; - * lpuartConfig->parityMode = kLPUART_ParityDisabled; - * lpuartConfig->dataBitsCount = kLPUART_EightDataBits; - * lpuartConfig->isMsb = false; - * lpuartConfig->stopBitCount = kLPUART_OneStopBit; - * lpuartConfig->txFifoWatermark = 0; - * lpuartConfig->rxFifoWatermark = 1; - * lpuartConfig->rxIdleType = kLPUART_IdleTypeStartBit; - * lpuartConfig->rxIdleConfig = kLPUART_IdleCharacter1; - * lpuartConfig->enableTx = false; - * lpuartConfig->enableRx = false; - * - * @param config Pointer to a configuration structure. - */ -void LPUART_GetDefaultConfig(lpuart_config_t *config); -/*! @} */ - -/*! - * @name Module configuration - * @{ - */ -/*! - * @brief Sets the LPUART instance baudrate. - * - * This function configures the LPUART module baudrate. This function is used to update - * the LPUART module baudrate after the LPUART module is initialized by the LPUART_Init. - * @code - * LPUART_SetBaudRate(LPUART1, 115200U, 20000000U); - * @endcode - * - * @param base LPUART peripheral base address. - * @param baudRate_Bps LPUART baudrate to be set. - * @param srcClock_Hz LPUART clock source frequency in HZ. - * @retval kStatus_LPUART_BaudrateNotSupport Baudrate is not supported in the current clock source. - * @retval kStatus_Success Set baudrate succeeded. - */ -status_t LPUART_SetBaudRate(LPUART_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz); - -/*! - * @brief Enable 9-bit data mode for LPUART. - * - * This function set the 9-bit mode for LPUART module. The 9th bit is not used for parity thus can be modified by user. - * - * @param base LPUART peripheral base address. - * @param enable true to enable, flase to disable. - */ -void LPUART_Enable9bitMode(LPUART_Type *base, bool enable); - -/*! - * @brief Set the LPUART address. - * - * This function configures the address for LPUART module that works as slave in 9-bit data mode. One or two address - * fields can be configured. When the address field's match enable bit is set, the frame it receices with MSB being - * 1 is considered as an address frame, otherwise it is considered as data frame. Once the address frame matches one - * of slave's own addresses, this slave is addressed. This address frame and its following data frames are stored in - * the receive buffer, otherwise the frames will be discarded. To un-address a slave, just send an address frame with - * unmatched address. - * - * @note Any LPUART instance joined in the multi-slave system can work as slave. The position of the address mark is the - * same as the parity bit when parity is enabled for 8 bit and 9 bit data formats. - * - * @param base LPUART peripheral base address. - * @param address1 LPUART slave address1. - * @param address2 LPUART slave address2. - */ -static inline void LPUART_SetMatchAddress(LPUART_Type *base, uint16_t address1, uint16_t address2) -{ - /* Configure match address. */ - uint32_t address = ((uint32_t)address2 << 16U) | (uint32_t)address1 | 0x1000100UL; - base->MATCH = address; -} - -/*! - * @brief Enable the LPUART match address feature. - * - * @param base LPUART peripheral base address. - * @param match1 true to enable match address1, false to disable. - * @param match2 true to enable match address2, false to disable. - */ -static inline void LPUART_EnableMatchAddress(LPUART_Type *base, bool match1, bool match2) -{ - /* Configure match address1 enable bit. */ - if (match1) - { - base->BAUD |= (uint32_t)LPUART_BAUD_MAEN1_MASK; - } - else - { - base->BAUD &= ~(uint32_t)LPUART_BAUD_MAEN1_MASK; - } - /* Configure match address2 enable bit. */ - if (match2) - { - base->BAUD |= (uint32_t)LPUART_BAUD_MAEN2_MASK; - } - else - { - base->BAUD &= ~(uint32_t)LPUART_BAUD_MAEN2_MASK; - } -} - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO -/*! - * @brief Sets the rx FIFO watermark. - * - * @param base LPUART peripheral base address. - * @param water Rx FIFO watermark. - */ -static inline void LPUART_SetRxFifoWatermark(LPUART_Type *base, uint8_t water) -{ - assert((uint8_t)FSL_FEATURE_LPUART_FIFO_SIZEn(base) > water); - base->WATER = (base->WATER & ~LPUART_WATER_RXWATER_MASK) | LPUART_WATER_RXWATER(water); -} - -/*! - * @brief Sets the tx FIFO watermark. - * - * @param base LPUART peripheral base address. - * @param water Tx FIFO watermark. - */ -static inline void LPUART_SetTxFifoWatermark(LPUART_Type *base, uint8_t water) -{ - assert((uint8_t)FSL_FEATURE_LPUART_FIFO_SIZEn(base) > water); - base->WATER = (base->WATER & ~LPUART_WATER_TXWATER_MASK) | LPUART_WATER_TXWATER(water); -} -#endif - -/*! - * @brief Sets the LPUART using 16bit transmit, only for 9bit or 10bit mode. - * - * This function Enable 16bit Data transmit in lpuart_handle_t. - * - * @param handle LPUART handle pointer. - * @param enable true to enable, false to disable. - */ -static inline void LPUART_TransferEnable16Bit(lpuart_handle_t *handle, bool enable) -{ - handle->is16bitData = enable; -} -/*! @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets LPUART status flags. - * - * This function gets all LPUART status flags. The flags are returned as the logical - * OR value of the enumerators @ref _lpuart_flags. To check for a specific status, - * compare the return value with enumerators in the @ref _lpuart_flags. - * For example, to check whether the TX is empty: - * @code - * if (kLPUART_TxDataRegEmptyFlag & LPUART_GetStatusFlags(LPUART1)) - * { - * ... - * } - * @endcode - * - * @param base LPUART peripheral base address. - * @return LPUART status flags which are ORed by the enumerators in the _lpuart_flags. - */ -uint32_t LPUART_GetStatusFlags(LPUART_Type *base); - -/*! - * @brief Clears status flags with a provided mask. - * - * This function clears LPUART status flags with a provided mask. Automatically cleared flags - * can't be cleared by this function. - * Flags that can only cleared or set by hardware are: - * kLPUART_TxDataRegEmptyFlag, kLPUART_TransmissionCompleteFlag, kLPUART_RxDataRegFullFlag, - * kLPUART_RxActiveFlag, kLPUART_NoiseErrorFlag, kLPUART_ParityErrorFlag, - * kLPUART_TxFifoEmptyFlag,kLPUART_RxFifoEmptyFlag - * Note: This API should be called when the Tx/Rx is idle, otherwise it takes no effects. - * - * @param base LPUART peripheral base address. - * @param mask the status flags to be cleared. The user can use the enumerators in the - * _lpuart_status_flag_t to do the OR operation and get the mask. - * @return 0 succeed, others failed. - * @retval kStatus_LPUART_FlagCannotClearManually The flag can't be cleared by this function but - * it is cleared automatically by hardware. - * @retval kStatus_Success Status in the mask are cleared. - */ -status_t LPUART_ClearStatusFlags(LPUART_Type *base, uint32_t mask); -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables LPUART interrupts according to a provided mask. - * - * This function enables the LPUART interrupts according to a provided mask. The mask - * is a logical OR of enumeration members. See the @ref _lpuart_interrupt_enable. - * This examples shows how to enable TX empty interrupt and RX full interrupt: - * @code - * LPUART_EnableInterrupts(LPUART1,kLPUART_TxDataRegEmptyInterruptEnable | kLPUART_RxDataRegFullInterruptEnable); - * @endcode - * - * @param base LPUART peripheral base address. - * @param mask The interrupts to enable. Logical OR of @ref _lpuart_interrupt_enable. - */ -void LPUART_EnableInterrupts(LPUART_Type *base, uint32_t mask); - -/*! - * @brief Disables LPUART interrupts according to a provided mask. - * - * This function disables the LPUART interrupts according to a provided mask. The mask - * is a logical OR of enumeration members. See @ref _lpuart_interrupt_enable. - * This example shows how to disable the TX empty interrupt and RX full interrupt: - * @code - * LPUART_DisableInterrupts(LPUART1,kLPUART_TxDataRegEmptyInterruptEnable | kLPUART_RxDataRegFullInterruptEnable); - * @endcode - * - * @param base LPUART peripheral base address. - * @param mask The interrupts to disable. Logical OR of @ref _lpuart_interrupt_enable. - */ -void LPUART_DisableInterrupts(LPUART_Type *base, uint32_t mask); - -/*! - * @brief Gets enabled LPUART interrupts. - * - * This function gets the enabled LPUART interrupts. The enabled interrupts are returned - * as the logical OR value of the enumerators @ref _lpuart_interrupt_enable. To check - * a specific interrupt enable status, compare the return value with enumerators - * in @ref _lpuart_interrupt_enable. - * For example, to check whether the TX empty interrupt is enabled: - * @code - * uint32_t enabledInterrupts = LPUART_GetEnabledInterrupts(LPUART1); - * - * if (kLPUART_TxDataRegEmptyInterruptEnable & enabledInterrupts) - * { - * ... - * } - * @endcode - * - * @param base LPUART peripheral base address. - * @return LPUART interrupt flags which are logical OR of the enumerators in @ref _lpuart_interrupt_enable. - */ -uint32_t LPUART_GetEnabledInterrupts(LPUART_Type *base); -/*! @} */ - -#if defined(FSL_FEATURE_LPUART_HAS_DMA_ENABLE) && FSL_FEATURE_LPUART_HAS_DMA_ENABLE -/*! - * @name DMA Configuration - * @{ - */ -/*! - * @brief Gets the LPUART data register address. - * - * This function returns the LPUART data register address, which is mainly used by the DMA/eDMA. - * - * @param base LPUART peripheral base address. - * @return LPUART data register addresses which are used both by the transmitter and receiver. - */ -static inline uintptr_t LPUART_GetDataRegisterAddress(LPUART_Type *base) -{ - return (uintptr_t) & (base->DATA); -} - -/*! - * @brief Enables or disables the LPUART transmitter DMA request. - * - * This function enables or disables the transmit data register empty flag, STAT[TDRE], to generate DMA requests. - * - * @param base LPUART peripheral base address. - * @param enable True to enable, false to disable. - */ -static inline void LPUART_EnableTxDMA(LPUART_Type *base, bool enable) -{ - if (enable) - { - base->BAUD |= LPUART_BAUD_TDMAE_MASK; - } - else - { - base->BAUD &= ~LPUART_BAUD_TDMAE_MASK; - } -} - -/*! - * @brief Enables or disables the LPUART receiver DMA. - * - * This function enables or disables the receiver data register full flag, STAT[RDRF], to generate DMA requests. - * - * @param base LPUART peripheral base address. - * @param enable True to enable, false to disable. - */ -static inline void LPUART_EnableRxDMA(LPUART_Type *base, bool enable) -{ - if (enable) - { - base->BAUD |= LPUART_BAUD_RDMAE_MASK; - } - else - { - base->BAUD &= ~LPUART_BAUD_RDMAE_MASK; - } -} -/*! @} */ -#endif /* FSL_FEATURE_LPUART_HAS_DMA_ENABLE */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Get the LPUART instance from peripheral base address. - * - * @param base LPUART peripheral base address. - * @return LPUART instance. - */ -uint32_t LPUART_GetInstance(LPUART_Type *base); - -/*! - * @brief Enables or disables the LPUART transmitter. - * - * This function enables or disables the LPUART transmitter. - * - * @param base LPUART peripheral base address. - * @param enable True to enable, false to disable. - */ -static inline void LPUART_EnableTx(LPUART_Type *base, bool enable) -{ - if (enable) - { - base->CTRL |= LPUART_CTRL_TE_MASK; - } - else - { - base->CTRL &= ~LPUART_CTRL_TE_MASK; - } -} - -/*! - * @brief Enables or disables the LPUART receiver. - * - * This function enables or disables the LPUART receiver. - * - * @param base LPUART peripheral base address. - * @param enable True to enable, false to disable. - */ -static inline void LPUART_EnableRx(LPUART_Type *base, bool enable) -{ - if (enable) - { - base->CTRL |= LPUART_CTRL_RE_MASK; - } - else - { - base->CTRL &= ~LPUART_CTRL_RE_MASK; - } -} - -/*! - * @brief Writes to the transmitter register. - * - * This function writes data to the transmitter register directly. The upper layer must - * ensure that the TX register is empty or that the TX FIFO has room before calling this function. - * - * @param base LPUART peripheral base address. - * @param data Data write to the TX register. - */ -static inline void LPUART_WriteByte(LPUART_Type *base, uint8_t data) -{ - base->DATA = data; -} - -/*! - * @brief Reads the receiver register. - * - * This function reads data from the receiver register directly. The upper layer must - * ensure that the receiver register is full or that the RX FIFO has data before calling this function. - * - * @param base LPUART peripheral base address. - * @return Data read from data register. - */ -static inline uint8_t LPUART_ReadByte(LPUART_Type *base) -{ -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - uint32_t ctrl = base->CTRL; - uint8_t result; - /* - * $Branch Coverage Justification$ - * (ctrl & LPUART_CTRL_M7_MASK) == 0U) false is not covered. - * If ctrl & LPUART_CTRL_M7_MASK is 0, it can't be !0 in next judge. - */ - bool isSevenDataBits = (((ctrl & LPUART_CTRL_M7_MASK) != 0U) || - (((ctrl & LPUART_CTRL_M7_MASK) == 0U) && ((ctrl & LPUART_CTRL_M_MASK) == 0U) && - ((ctrl & LPUART_CTRL_PE_MASK) != 0U))); - - if (isSevenDataBits) - { - result = (uint8_t)(base->DATA & 0x7FU); - } - else - { - result = (uint8_t)base->DATA; - } - - return result; -#else - return (uint8_t)(base->DATA); -#endif -} - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO -/*! - * @brief Gets the rx FIFO data count. - * - * @param base LPUART peripheral base address. - * @return rx FIFO data count. - */ -static inline uint8_t LPUART_GetRxFifoCount(LPUART_Type *base) -{ - return (uint8_t)((base->WATER & LPUART_WATER_RXCOUNT_MASK) >> LPUART_WATER_RXCOUNT_SHIFT); -} - -/*! - * @brief Gets the tx FIFO data count. - * - * @param base LPUART peripheral base address. - * @return tx FIFO data count. - */ -static inline uint8_t LPUART_GetTxFifoCount(LPUART_Type *base) -{ - return (uint8_t)((base->WATER & LPUART_WATER_TXCOUNT_MASK) >> LPUART_WATER_TXCOUNT_SHIFT); -} -#endif - -/*! - * @brief Transmit an address frame in 9-bit data mode. - * - * @param base LPUART peripheral base address. - * @param address LPUART slave address. - */ -void LPUART_SendAddress(LPUART_Type *base, uint8_t address); - -/*! - * @brief Writes to the transmitter register using a blocking method. - * - * This function polls the transmitter register, first waits for the register to be empty or TX FIFO to have room, - * and writes data to the transmitter buffer, then waits for the dat to be sent out to the bus. - * - * @param base LPUART peripheral base address. - * @param data Start address of the data to write. - * @param length Size of the data to write. - * @retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * @retval kStatus_Success Successfully wrote all data. - */ -status_t LPUART_WriteBlocking(LPUART_Type *base, const uint8_t *data, size_t length); - -/*! - * @brief Writes to the transmitter register using a blocking method in 9bit or 10bit mode. - * - * @note This function only support 9bit or 10bit transfer. - * Please make sure only 10bit of data is valid and other bits are 0. - * - * @param base LPUART peripheral base address. - * @param data Start address of the data to write. - * @param length Size of the data to write. - * @retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * @retval kStatus_Success Successfully wrote all data. - */ -status_t LPUART_WriteBlocking16bit(LPUART_Type *base, const uint16_t *data, size_t length); - -/*! - * @brief Reads the receiver data register using a blocking method. - * - * This function polls the receiver register, waits for the receiver register full or receiver FIFO - * has data, and reads data from the TX register. - * - * @param base LPUART peripheral base address. - * @param data Start address of the buffer to store the received data. - * @param length Size of the buffer. - * @retval kStatus_LPUART_RxHardwareOverrun Receiver overrun happened while receiving data. - * @retval kStatus_LPUART_NoiseError Noise error happened while receiving data. - * @retval kStatus_LPUART_FramingError Framing error happened while receiving data. - * @retval kStatus_LPUART_ParityError Parity error happened while receiving data. - * @retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * @retval kStatus_Success Successfully received all data. - */ -status_t LPUART_ReadBlocking(LPUART_Type *base, uint8_t *data, size_t length); - -/*! - * @brief Reads the receiver data register in 9bit or 10bit mode. - * - * @note This function only support 9bit or 10bit transfer. - * - * @param base LPUART peripheral base address. - * @param data Start address of the buffer to store the received data by 16bit, only 10bit is valid. - * @param length Size of the buffer. - * @retval kStatus_LPUART_RxHardwareOverrun Receiver overrun happened while receiving data. - * @retval kStatus_LPUART_NoiseError Noise error happened while receiving data. - * @retval kStatus_LPUART_FramingError Framing error happened while receiving data. - * @retval kStatus_LPUART_ParityError Parity error happened while receiving data. - * @retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * @retval kStatus_Success Successfully received all data. - */ -status_t LPUART_ReadBlocking16bit(LPUART_Type *base, uint16_t *data, size_t length); - -/*! @} */ - -/*! - * @name Transactional - * @{ - */ - -/*! - * @brief Initializes the LPUART handle. - * - * This function initializes the LPUART handle, which can be used for other LPUART - * transactional APIs. Usually, for a specified LPUART instance, - * call this API once to get the initialized handle. - * - * The LPUART driver supports the "background" receiving, which means that user can set up - * an RX ring buffer optionally. Data received is stored into the ring buffer even when the - * user doesn't call the LPUART_TransferReceiveNonBlocking() API. If there is already data received - * in the ring buffer, the user can get the received data from the ring buffer directly. - * The ring buffer is disabled if passing NULL as @p ringBuffer. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param callback Callback function. - * @param userData User data. - */ -void LPUART_TransferCreateHandle(LPUART_Type *base, - lpuart_handle_t *handle, - lpuart_transfer_callback_t callback, - void *userData); -/*! - * @brief Transmits a buffer of data using the interrupt method. - * - * This function send data using an interrupt method. This is a non-blocking function, which - * returns directly without waiting for all data written to the transmitter register. When - * all data is written to the TX register in the ISR, the LPUART driver calls the callback - * function and passes the @ref kStatus_LPUART_TxIdle as status parameter. - * - * @note The kStatus_LPUART_TxIdle is passed to the upper layer when all data are written - * to the TX register. However, there is no check to ensure that all the data sent out. Before disabling the TX, - * check the kLPUART_TransmissionCompleteFlag to ensure that the transmit is finished. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param xfer LPUART transfer structure, see #lpuart_transfer_t. - * @retval kStatus_Success Successfully start the data transmission. - * @retval kStatus_LPUART_TxBusy Previous transmission still not finished, data not all written to the TX register. - * @retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_TransferSendNonBlocking(LPUART_Type *base, lpuart_handle_t *handle, lpuart_transfer_t *xfer); - -/*! - * @brief Sets up the RX ring buffer. - * - * This function sets up the RX ring buffer to a specific UART handle. - * - * When the RX ring buffer is used, data received is stored into the ring buffer even when - * the user doesn't call the UART_TransferReceiveNonBlocking() API. If there is already data received - * in the ring buffer, the user can get the received data from the ring buffer directly. - * - * @note When using RX ring buffer, one byte is reserved for internal use. In other - * words, if @p ringBufferSize is 32, then only 31 bytes are used for saving data. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param ringBuffer Start address of ring buffer for background receiving. Pass NULL to disable the ring buffer. - * @param ringBufferSize size of the ring buffer. - */ -void LPUART_TransferStartRingBuffer(LPUART_Type *base, - lpuart_handle_t *handle, - uint8_t *ringBuffer, - size_t ringBufferSize); - -/*! - * @brief Aborts the background transfer and uninstalls the ring buffer. - * - * This function aborts the background transfer and uninstalls the ring buffer. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - */ -void LPUART_TransferStopRingBuffer(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief Get the length of received data in RX ring buffer. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @return Length of received data in RX ring buffer. - */ -size_t LPUART_TransferGetRxRingBufferLength(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief Aborts the interrupt-driven data transmit. - * - * This function aborts the interrupt driven data sending. The user can get the remainBtyes to find out - * how many bytes are not sent out. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - */ -void LPUART_TransferAbortSend(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief Gets the number of bytes that have been sent out to bus. - * - * This function gets the number of bytes that have been sent out to bus by an interrupt method. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param count Send bytes count. - * @retval kStatus_NoTransferInProgress No send in progress. - * @retval kStatus_InvalidArgument Parameter is invalid. - * @retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetSendCount(LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count); - -/*! - * @brief Receives a buffer of data using the interrupt method. - * - * This function receives data using an interrupt method. This is a non-blocking function - * which returns without waiting to ensure that all data are received. - * If the RX ring buffer is used and not empty, the data in the ring buffer is copied and - * the parameter @p receivedBytes shows how many bytes are copied from the ring buffer. - * After copying, if the data in the ring buffer is not enough for read, the receive - * request is saved by the LPUART driver. When the new data arrives, the receive request - * is serviced first. When all data is received, the LPUART driver notifies the upper layer - * through a callback function and passes a status parameter kStatus_UART_RxIdle. - * For example, the upper layer needs 10 bytes but there are only 5 bytes in ring buffer. - * The 5 bytes are copied to xfer->data, which returns with the - * parameter @p receivedBytes set to 5. For the remaining 5 bytes, the newly arrived data is - * saved from xfer->data[5]. When 5 bytes are received, the LPUART driver notifies the upper layer. - * If the RX ring buffer is not enabled, this function enables the RX and RX interrupt - * to receive data to xfer->data. When all data is received, the upper layer is notified. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param xfer LPUART transfer structure, see uart_transfer_t. - * @param receivedBytes Bytes received from the ring buffer directly. - * @retval kStatus_Success Successfully queue the transfer into the transmit queue. - * @retval kStatus_LPUART_RxBusy Previous receive request is not finished. - * @retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_TransferReceiveNonBlocking(LPUART_Type *base, - lpuart_handle_t *handle, - lpuart_transfer_t *xfer, - size_t *receivedBytes); - -/*! - * @brief Aborts the interrupt-driven data receiving. - * - * This function aborts the interrupt-driven data receiving. The user can get the remainBytes to find out - * how many bytes not received yet. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - */ -void LPUART_TransferAbortReceive(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief Gets the number of bytes that have been received. - * - * This function gets the number of bytes that have been received. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param count Receive bytes count. - * @retval kStatus_NoTransferInProgress No receive in progress. - * @retval kStatus_InvalidArgument Parameter is invalid. - * @retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetReceiveCount(LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count); - -/*! - * @brief LPUART IRQ handle function. - * - * This function handles the LPUART transmit and receive IRQ request. - * - * @param base LPUART peripheral base address. - * @param irqHandle LPUART handle pointer. - */ -void LPUART_TransferHandleIRQ(LPUART_Type *base, void *irqHandle); - -/*! - * @brief LPUART Error IRQ handle function. - * - * This function handles the LPUART error IRQ request. - * - * @param base LPUART peripheral base address. - * @param irqHandle LPUART handle pointer. - */ -void LPUART_TransferHandleErrorIRQ(LPUART_Type *base, void *irqHandle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_LPUART_H_ */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_lpuart_dma.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_lpuart_dma.c deleted file mode 100644 index 04a184df030..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_lpuart_dma.c +++ /dev/null @@ -1,487 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#include "fsl_lpuart_dma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpuart_dma" -#endif - -/*base, false); - - /* Disable interrupt. */ - DMA_DisableInterrupts(lpuartPrivateHandle->handle->txDmaHandle->base, - lpuartPrivateHandle->handle->txDmaHandle->channel); - - /* Enable tx complete interrupt */ - LPUART_EnableInterrupts(lpuartPrivateHandle->base, (uint32_t)kLPUART_TransmissionCompleteInterruptEnable); -} - -static void LPUART_TransferReceiveDMACallback(dma_handle_t *handle, void *param) -{ - assert(handle != NULL); - assert(param != NULL); - - lpuart_dma_private_handle_t *lpuartPrivateHandle = (lpuart_dma_private_handle_t *)param; - - /* Disable LPUART RX DMA. */ - LPUART_EnableRxDMA(lpuartPrivateHandle->base, false); - - /* Disable interrupt. */ - DMA_DisableInterrupts(lpuartPrivateHandle->handle->rxDmaHandle->base, - lpuartPrivateHandle->handle->rxDmaHandle->channel); - - lpuartPrivateHandle->handle->rxState = (uint8_t)kLPUART_RxIdle; - - if (lpuartPrivateHandle->handle->callback != NULL) - { - lpuartPrivateHandle->handle->callback(lpuartPrivateHandle->base, lpuartPrivateHandle->handle, - kStatus_LPUART_RxIdle, lpuartPrivateHandle->handle->userData); - } -} - -/*! - * brief Initializes the LPUART handle which is used in transactional functions. - * - * note This function disables all LPUART interrupts. - * - * param base LPUART peripheral base address. - * param handle Pointer to lpuart_dma_handle_t structure. - * param callback Callback function. - * param userData User data. - * param txDmaHandle User-requested DMA handle for TX DMA transfer. - * param rxDmaHandle User-requested DMA handle for RX DMA transfer. - */ -void LPUART_TransferCreateHandleDMA(LPUART_Type *base, - lpuart_dma_handle_t *handle, - lpuart_dma_transfer_callback_t callback, - void *userData, - dma_handle_t *txDmaHandle, - dma_handle_t *rxDmaHandle) -{ - assert(handle != NULL); - - uint32_t instance = LPUART_GetInstance(base); - - (void)memset(handle, 0, sizeof(lpuart_dma_handle_t)); - - s_dmaPrivateHandle[instance].base = base; - s_dmaPrivateHandle[instance].handle = handle; - - handle->rxState = (uint8_t)kLPUART_RxIdle; - handle->txState = (uint8_t)kLPUART_TxIdle; - - handle->callback = callback; - handle->userData = userData; - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Note: - Take care of the RX FIFO, DMA request only assert when received bytes - equal or more than RX water mark, there is potential issue if RX water - mark larger than 1. - For example, if RX FIFO water mark is 2, upper layer needs 5 bytes and - 5 bytes are received. the last byte will be saved in FIFO but not trigger - DMA transfer because the water mark is 2. - */ - if (rxDmaHandle != NULL) - { - base->WATER &= (~LPUART_WATER_RXWATER_MASK); - } -#endif - - handle->rxDmaHandle = rxDmaHandle; - handle->txDmaHandle = txDmaHandle; - - /* Save the handle in global variables to support the double weak mechanism. */ - s_lpuartHandle[instance] = handle; - /* Set LPUART_TransferDMAHandleIRQ as DMA IRQ handler */ - s_lpuartIsr[instance] = LPUART_TransferDMAHandleIRQ; - /* Disable all LPUART internal interrupts */ - LPUART_DisableInterrupts(base, (uint32_t)kLPUART_AllInterruptEnable); - /* Enable interrupt in NVIC. */ -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ - (void)EnableIRQ(s_lpuartTxIRQ[instance]); -#else - (void)EnableIRQ(s_lpuartIRQ[instance]); -#endif - - /* Configure TX. */ - if (txDmaHandle != NULL) - { - DMA_SetCallback(txDmaHandle, LPUART_TransferSendDMACallback, &s_dmaPrivateHandle[instance]); - } - - /* Configure RX. */ - if (rxDmaHandle != NULL) - { - DMA_SetCallback(rxDmaHandle, LPUART_TransferReceiveDMACallback, &s_dmaPrivateHandle[instance]); - } -} - -/*! - * brief Sends data using DMA. - * - * This function sends data using DMA. This is a non-blocking function, which returns - * right away. When all data is sent, the send callback function is called. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param xfer LPUART DMA transfer structure. See #lpuart_transfer_t. - * retval kStatus_Success if succeed, others failed. - * retval kStatus_LPUART_TxBusy Previous transfer on going. - * retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_TransferSendDMA(LPUART_Type *base, lpuart_dma_handle_t *handle, lpuart_transfer_t *xfer) -{ - assert(handle != NULL); - assert(handle->txDmaHandle != NULL); - assert(xfer != NULL); - assert(xfer->data != NULL); - assert(xfer->dataSize != 0U); - - status_t status; - dma_transfer_config_t xferConfig; - - /* If previous TX not finished. */ - if ((uint8_t)kLPUART_TxBusy == handle->txState) - { - status = kStatus_LPUART_TxBusy; - } - else - { - handle->txState = (uint8_t)kLPUART_TxBusy; - handle->txDataSizeAll = xfer->dataSize; - - /* Prepare transfer. */ - uint32_t address = LPUART_GetDataRegisterAddress(base); - DMA_PrepareTransfer(&xferConfig, xfer->data, sizeof(uint8_t), (uint32_t *)address, sizeof(uint8_t), - xfer->dataSize, kDMA_MemoryToPeripheral); - - /* Submit transfer. */ - (void)DMA_SubmitTransfer(handle->txDmaHandle, &xferConfig, (uint32_t)kDMA_EnableInterrupt); - DMA_StartTransfer(handle->txDmaHandle); - - /* Enable LPUART TX DMA. */ - LPUART_EnableTxDMA(base, true); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Receives data using DMA. - * - * This function receives data using DMA. This is a non-blocking function, which returns - * right away. When all data is received, the receive callback function is called. - * - * param base LPUART peripheral base address. - * param handle Pointer to lpuart_dma_handle_t structure. - * param xfer LPUART DMA transfer structure. See #lpuart_transfer_t. - * retval kStatus_Success if succeed, others failed. - * retval kStatus_LPUART_RxBusy Previous transfer on going. - * retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_TransferReceiveDMA(LPUART_Type *base, lpuart_dma_handle_t *handle, lpuart_transfer_t *xfer) -{ - assert(handle != NULL); - assert(handle->rxDmaHandle != NULL); - assert(xfer != NULL); - assert(xfer->data != NULL); - assert(xfer->dataSize != 0U); - - status_t status; - dma_transfer_config_t xferConfig; - - /* If previous RX not finished. */ - if ((uint8_t)kLPUART_RxBusy == handle->rxState) - { - status = kStatus_LPUART_RxBusy; - } - else - { - handle->rxState = (uint8_t)kLPUART_RxBusy; - handle->rxDataSizeAll = xfer->dataSize; - - /* Prepare transfer. */ - uint32_t address = LPUART_GetDataRegisterAddress(base); - DMA_PrepareTransfer(&xferConfig, (uint32_t *)address, sizeof(uint8_t), xfer->data, sizeof(uint8_t), - xfer->dataSize, kDMA_PeripheralToMemory); - - /* Submit transfer. */ - (void)DMA_SubmitTransfer(handle->rxDmaHandle, &xferConfig, (uint32_t)kDMA_EnableInterrupt); - DMA_StartTransfer(handle->rxDmaHandle); - - /* Enable LPUART RX DMA. */ - LPUART_EnableRxDMA(base, true); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Aborts the sent data using DMA. - * - * This function aborts send data using DMA. - * - * param base LPUART peripheral base address - * param handle Pointer to lpuart_dma_handle_t structure - */ -void LPUART_TransferAbortSendDMA(LPUART_Type *base, lpuart_dma_handle_t *handle) -{ - assert(handle != NULL); - assert(handle->txDmaHandle != NULL); - - /* Disable LPUART TX DMA. */ - LPUART_EnableTxDMA(base, false); - - /* Stop transfer. */ - DMA_AbortTransfer(handle->txDmaHandle); - - /* Write DMA->DSR[DONE] to abort transfer and clear status. */ - DMA_ClearChannelStatusFlags(handle->txDmaHandle->base, handle->txDmaHandle->channel, - (uint32_t)kDMA_TransactionsDoneFlag); - - handle->txState = (uint8_t)kLPUART_TxIdle; -} - -/*! - * brief Aborts the received data using DMA. - * - * This function aborts the received data using DMA. - * - * param base LPUART peripheral base address - * param handle Pointer to lpuart_dma_handle_t structure - */ -void LPUART_TransferAbortReceiveDMA(LPUART_Type *base, lpuart_dma_handle_t *handle) -{ - assert(handle != NULL); - assert(handle->rxDmaHandle != NULL); - - /* Disable LPUART RX DMA. */ - LPUART_EnableRxDMA(base, false); - - /* Stop transfer. */ - DMA_AbortTransfer(handle->rxDmaHandle); - - /* Write DMA->DSR[DONE] to abort transfer and clear status. */ - DMA_ClearChannelStatusFlags(handle->rxDmaHandle->base, handle->rxDmaHandle->channel, - (uint32_t)kDMA_TransactionsDoneFlag); - - handle->rxState = (uint8_t)kLPUART_RxIdle; -} - -/*! - * brief Gets the number of bytes written to the LPUART TX register. - * - * This function gets the number of bytes that have been written to LPUART TX - * register by DMA. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param count Send bytes count. - * retval kStatus_NoTransferInProgress No send in progress. - * retval kStatus_InvalidArgument Parameter is invalid. - * retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetSendCountDMA(LPUART_Type *base, lpuart_dma_handle_t *handle, uint32_t *count) -{ - assert(handle != NULL); - assert(handle->txDmaHandle != NULL); - assert(count != NULL); - - if ((uint8_t)kLPUART_TxIdle == handle->txState) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->txDataSizeAll - DMA_GetRemainingBytes(handle->txDmaHandle->base, handle->txDmaHandle->channel); - - return kStatus_Success; -} - -/*! - * brief Gets the number of received bytes. - * - * This function gets the number of received bytes. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param count Receive bytes count. - * retval kStatus_NoTransferInProgress No receive in progress. - * retval kStatus_InvalidArgument Parameter is invalid. - * retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetReceiveCountDMA(LPUART_Type *base, lpuart_dma_handle_t *handle, uint32_t *count) -{ - assert(handle != NULL); - assert(handle->rxDmaHandle != NULL); - assert(count != NULL); - - if ((uint8_t)kLPUART_RxIdle == handle->rxState) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->rxDataSizeAll - DMA_GetRemainingBytes(handle->rxDmaHandle->base, handle->rxDmaHandle->channel); - - return kStatus_Success; -} - -/*! - * brief LPUART DMA IRQ handle function. - * - * This function handles the LPUART tx complete IRQ request and invoke user callback. - * note This function is used as default IRQ handler by double weak mechanism. - * If user's specific IRQ handler is implemented, make sure this function is invoked in the handler. - * - * param base LPUART peripheral base address. - * param lpuartDmaHandle LPUART handle pointer. - */ -void LPUART_TransferDMAHandleIRQ(LPUART_Type *base, void *lpuartDmaHandle) -{ - assert(lpuartDmaHandle != NULL); - - if (((uint32_t)kLPUART_TransmissionCompleteFlag & LPUART_GetStatusFlags(base)) != 0U) - { - lpuart_dma_handle_t *handle = (lpuart_dma_handle_t *)lpuartDmaHandle; - - /* Disable tx complete interrupt */ - LPUART_DisableInterrupts(base, (uint32_t)kLPUART_TransmissionCompleteInterruptEnable); - - handle->txState = (uint8_t)kLPUART_TxIdle; - - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_LPUART_TxIdle, handle->userData); - } - } -} diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_lpuart_dma.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_lpuart_dma.h deleted file mode 100644 index 992163bbcf4..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_lpuart_dma.h +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LPUART_DMA_H_ -#define FSL_LPUART_DMA_H_ - -#include "fsl_lpuart.h" -#include "fsl_dma.h" - -/*! - * @addtogroup lpuart_dma_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief LPUART DMA driver version. */ -#define FSL_LPUART_DMA_DRIVER_VERSION (MAKE_VERSION(2, 6, 0)) -/*! @} */ - -/* Forward declaration of the handle typedef. */ -typedef struct _lpuart_dma_handle lpuart_dma_handle_t; - -/*! @brief LPUART transfer callback function. */ -typedef void (*lpuart_dma_transfer_callback_t)(LPUART_Type *base, - lpuart_dma_handle_t *handle, - status_t status, - void *userData); - -/*! - * @brief LPUART DMA handle - */ -struct _lpuart_dma_handle -{ - lpuart_dma_transfer_callback_t callback; /*!< Callback function. */ - void *userData; /*!< LPUART callback function parameter.*/ - size_t rxDataSizeAll; /*!< Size of the data to receive. */ - size_t txDataSizeAll; /*!< Size of the data to send out. */ - - dma_handle_t *txDmaHandle; /*!< The DMA TX channel used. */ - dma_handle_t *rxDmaHandle; /*!< The DMA RX channel used. */ - - volatile uint8_t txState; /*!< TX transfer state. */ - volatile uint8_t rxState; /*!< RX transfer state */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name EDMA transactional - * @{ - */ - -/*! - * @brief Initializes the LPUART handle which is used in transactional functions. - * - * @note This function disables all LPUART interrupts. - * - * @param base LPUART peripheral base address. - * @param handle Pointer to lpuart_dma_handle_t structure. - * @param callback Callback function. - * @param userData User data. - * @param txDmaHandle User-requested DMA handle for TX DMA transfer. - * @param rxDmaHandle User-requested DMA handle for RX DMA transfer. - */ -void LPUART_TransferCreateHandleDMA(LPUART_Type *base, - lpuart_dma_handle_t *handle, - lpuart_dma_transfer_callback_t callback, - void *userData, - dma_handle_t *txDmaHandle, - dma_handle_t *rxDmaHandle); - -/*! - * @brief Sends data using DMA. - * - * This function sends data using DMA. This is a non-blocking function, which returns - * right away. When all data is sent, the send callback function is called. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param xfer LPUART DMA transfer structure. See #lpuart_transfer_t. - * @retval kStatus_Success if succeed, others failed. - * @retval kStatus_LPUART_TxBusy Previous transfer on going. - * @retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_TransferSendDMA(LPUART_Type *base, lpuart_dma_handle_t *handle, lpuart_transfer_t *xfer); - -/*! - * @brief Receives data using DMA. - * - * This function receives data using DMA. This is a non-blocking function, which returns - * right away. When all data is received, the receive callback function is called. - * - * @param base LPUART peripheral base address. - * @param handle Pointer to lpuart_dma_handle_t structure. - * @param xfer LPUART DMA transfer structure. See #lpuart_transfer_t. - * @retval kStatus_Success if succeed, others failed. - * @retval kStatus_LPUART_RxBusy Previous transfer on going. - * @retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_TransferReceiveDMA(LPUART_Type *base, lpuart_dma_handle_t *handle, lpuart_transfer_t *xfer); - -/*! - * @brief Aborts the sent data using DMA. - * - * This function aborts send data using DMA. - * - * @param base LPUART peripheral base address - * @param handle Pointer to lpuart_dma_handle_t structure - */ -void LPUART_TransferAbortSendDMA(LPUART_Type *base, lpuart_dma_handle_t *handle); - -/*! - * @brief Aborts the received data using DMA. - * - * This function aborts the received data using DMA. - * - * @param base LPUART peripheral base address - * @param handle Pointer to lpuart_dma_handle_t structure - */ -void LPUART_TransferAbortReceiveDMA(LPUART_Type *base, lpuart_dma_handle_t *handle); - -/*! - * @brief Gets the number of bytes written to the LPUART TX register. - * - * This function gets the number of bytes that have been written to LPUART TX - * register by DMA. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param count Send bytes count. - * @retval kStatus_NoTransferInProgress No send in progress. - * @retval kStatus_InvalidArgument Parameter is invalid. - * @retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetSendCountDMA(LPUART_Type *base, lpuart_dma_handle_t *handle, uint32_t *count); - -/*! - * @brief Gets the number of received bytes. - * - * This function gets the number of received bytes. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param count Receive bytes count. - * @retval kStatus_NoTransferInProgress No receive in progress. - * @retval kStatus_InvalidArgument Parameter is invalid. - * @retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetReceiveCountDMA(LPUART_Type *base, lpuart_dma_handle_t *handle, uint32_t *count); - -/*! - * @brief LPUART DMA IRQ handle function. - * - * This function handles the LPUART tx complete IRQ request and invoke user callback. - * @note This function is used as default IRQ handler by double weak mechanism. - * If user's specific IRQ handler is implemented, make sure this function is invoked in the handler. - * - * @param base LPUART peripheral base address. - * @param lpuartDmaHandle LPUART handle pointer. - */ -void LPUART_TransferDMAHandleIRQ(LPUART_Type *base, void *lpuartDmaHandle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_LPUART_DMA_H_ */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_pit.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_pit.c deleted file mode 100644 index 932d52f980a..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_pit.c +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_pit.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.pit" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Gets the instance from the base address to be used to gate or ungate the module clock - * - * @param base PIT peripheral base address - * - * @return The PIT instance - */ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -static uint32_t PIT_GetInstance(PIT_Type *base); -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to PIT bases for each instance. */ -static PIT_Type *const s_pitBases[] = PIT_BASE_PTRS; - -/*! @brief Pointers to PIT clocks for each instance. */ -static const clock_ip_name_t s_pitClocks[] = PIT_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/******************************************************************************* - * Code - ******************************************************************************/ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -static uint32_t PIT_GetInstance(PIT_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_pitBases); instance++) - { - if (s_pitBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_pitBases)); - - return instance; -} -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/*! - * brief Ungates the PIT clock, enables the PIT module, and configures the peripheral for basic operations. - * - * note This API should be called at the beginning of the application using the PIT driver. - * - * param base PIT peripheral base address - * param config Pointer to the user's PIT config structure - */ -void PIT_Init(PIT_Type *base, const pit_config_t *config) -{ - assert(NULL != config); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate the PIT clock*/ - CLOCK_EnableClock(s_pitClocks[PIT_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(FSL_FEATURE_PIT_HAS_MDIS) && FSL_FEATURE_PIT_HAS_MDIS -#if defined(FSL_FEATURE_PIT_HAS_ERRATA_7914) && FSL_FEATURE_PIT_HAS_ERRATA_7914 - /* - * If a write to the MCR[MDIS] bit occurs within two bus clock cycles of enabling the PIT clock - * in the SIM_CG register, the write will be ignored and the PIT will fail to enable. - * Insert a read of the MCR register before writing to the MCR register. This guarantees a minimum - * delay of two bus clocks to guarantee the write is not ignored. - */ - (void)base->MCR; -#endif - /* Enable PIT timers */ - base->MCR &= ~PIT_MCR_MDIS_MASK; -#endif - -#if defined(FSL_FEATURE_PIT_TIMER_COUNT) && (FSL_FEATURE_PIT_TIMER_COUNT) - /* Clear all status bits for all channels to make sure the status of all TCTRL registers is clean. */ - for (uint8_t i = 0U; i < (uint32_t)FSL_FEATURE_PIT_TIMER_COUNT; i++) - { - base->CHANNEL[i].TCTRL &= ~(PIT_TCTRL_TEN_MASK | PIT_TCTRL_TIE_MASK | PIT_TCTRL_CHN_MASK); - } -#endif /* FSL_FEATURE_PIT_TIMER_COUNT */ - - /* Config timer operation when in debug mode */ - if (true == config->enableRunInDebug) - { - base->MCR &= ~PIT_MCR_FRZ_MASK; - } - else - { - base->MCR |= PIT_MCR_FRZ_MASK; - } -} - -/*! - * brief Gates the PIT clock and disables the PIT module. - * - * param base PIT peripheral base address - */ -void PIT_Deinit(PIT_Type *base) -{ -#if defined(FSL_FEATURE_PIT_HAS_MDIS) && FSL_FEATURE_PIT_HAS_MDIS - /* Disable PIT timers */ - base->MCR |= PIT_MCR_MDIS_MASK; -#endif - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate the PIT clock*/ - CLOCK_DisableClock(s_pitClocks[PIT_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -#if defined(FSL_FEATURE_PIT_HAS_LIFETIME_TIMER) && FSL_FEATURE_PIT_HAS_LIFETIME_TIMER - -/*! - * brief Reads the current lifetime counter value. - * - * The lifetime timer is a 64-bit timer which chains timer 0 and timer 1 together. - * Timer 0 and 1 are chained by calling the PIT_SetTimerChainMode before using this timer. - * The period of lifetime timer is equal to the "period of timer 0 * period of timer 1". - * For the 64-bit value, the higher 32-bit has the value of timer 1, and the lower 32-bit - * has the value of timer 0. - * - * param base PIT peripheral base address - * - * return Current lifetime timer value - */ -uint64_t PIT_GetLifetimeTimerCount(PIT_Type *base) -{ - uint32_t valueH = 0U; - uint32_t valueL = 0U; - - /* LTMR64H should be read before LTMR64L */ - valueH = base->LTMR64H; - valueL = base->LTMR64L; - - return (((uint64_t)valueH << 32U) + (uint64_t)(valueL)); -} - -#endif /* FSL_FEATURE_PIT_HAS_LIFETIME_TIMER */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_pit.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_pit.h deleted file mode 100644 index 5d168ffdef1..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_pit.h +++ /dev/null @@ -1,334 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_PIT_H_ -#define FSL_PIT_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup pit - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief PIT Driver Version 2.0.5 */ -#define FSL_PIT_DRIVER_VERSION (MAKE_VERSION(2, 0, 5)) -/*! @} */ - -/*! - * @brief List of PIT channels - * @note Actual number of available channels is SoC dependent - */ -typedef enum _pit_chnl -{ - kPIT_Chnl_0 = 0U, /*!< PIT channel number 0*/ - kPIT_Chnl_1, /*!< PIT channel number 1 */ - kPIT_Chnl_2, /*!< PIT channel number 2 */ - kPIT_Chnl_3, /*!< PIT channel number 3 */ -} pit_chnl_t; - -/*! @brief List of PIT interrupts */ -typedef enum _pit_interrupt_enable -{ - kPIT_TimerInterruptEnable = PIT_TCTRL_TIE_MASK, /*!< Timer interrupt enable*/ -} pit_interrupt_enable_t; - -/*! @brief List of PIT status flags */ -typedef enum _pit_status_flags -{ - kPIT_TimerFlag = PIT_TFLG_TIF_MASK, /*!< Timer flag */ -} pit_status_flags_t; - -/*! - * @brief PIT configuration structure - * - * This structure holds the configuration settings for the PIT peripheral. To initialize this - * structure to reasonable defaults, call the PIT_GetDefaultConfig() function and pass a - * pointer to your config structure instance. - * - * The configuration structure can be made constant so it resides in flash. - */ -typedef struct _pit_config -{ - bool enableRunInDebug; /*!< true: Timers run in debug mode; false: Timers stop in debug mode */ -} pit_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Ungates the PIT clock, enables the PIT module, and configures the peripheral for basic operations. - * - * @note This API should be called at the beginning of the application using the PIT driver. - * - * @param base PIT peripheral base address - * @param config Pointer to the user's PIT config structure - */ -void PIT_Init(PIT_Type *base, const pit_config_t *config); - -/*! - * @brief Gates the PIT clock and disables the PIT module. - * - * @param base PIT peripheral base address - */ -void PIT_Deinit(PIT_Type *base); - -/*! - * @brief Fills in the PIT configuration structure with the default settings. - * - * The default values are as follows. - * @code - * config->enableRunInDebug = false; - * @endcode - * @param config Pointer to the configuration structure. - */ -static inline void PIT_GetDefaultConfig(pit_config_t *config) -{ - assert(NULL != config); - - /* Timers are stopped in Debug mode */ - config->enableRunInDebug = false; -} - -#if defined(FSL_FEATURE_PIT_HAS_CHAIN_MODE) && FSL_FEATURE_PIT_HAS_CHAIN_MODE - -/*! - * @brief Enables or disables chaining a timer with the previous timer. - * - * When a timer has a chain mode enabled, it only counts after the previous - * timer has expired. If the timer n-1 has counted down to 0, counter n - * decrements the value by one. Each timer is 32-bits, which allows the developers - * to chain timers together and form a longer timer (64-bits and larger). The first timer - * (timer 0) can't be chained to any other timer. - * - * @param base PIT peripheral base address - * @param channel Timer channel number which is chained with the previous timer - * @param enable Enable or disable chain. - * true: Current timer is chained with the previous timer. - * false: Timer doesn't chain with other timers. - */ -static inline void PIT_SetTimerChainMode(PIT_Type *base, pit_chnl_t channel, bool enable) -{ - if (enable) - { - base->CHANNEL[channel].TCTRL |= PIT_TCTRL_CHN_MASK; - } - else - { - base->CHANNEL[channel].TCTRL &= ~PIT_TCTRL_CHN_MASK; - } -} - -#endif /* FSL_FEATURE_PIT_HAS_CHAIN_MODE */ - -/*! @}*/ - -/*! - * @name Interrupt Interface - * @{ - */ - -/*! - * @brief Enables the selected PIT interrupts. - * - * @param base PIT peripheral base address - * @param channel Timer channel number - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::pit_interrupt_enable_t - */ -static inline void PIT_EnableInterrupts(PIT_Type *base, pit_chnl_t channel, uint32_t mask) -{ - base->CHANNEL[channel].TCTRL |= mask; -} - -/*! - * @brief Disables the selected PIT interrupts. - * - * @param base PIT peripheral base address - * @param channel Timer channel number - * @param mask The interrupts to disable. This is a logical OR of members of the - * enumeration ::pit_interrupt_enable_t - */ -static inline void PIT_DisableInterrupts(PIT_Type *base, pit_chnl_t channel, uint32_t mask) -{ - base->CHANNEL[channel].TCTRL &= ~mask; -} - -/*! - * @brief Gets the enabled PIT interrupts. - * - * @param base PIT peripheral base address - * @param channel Timer channel number - * - * @return The enabled interrupts. This is the logical OR of members of the - * enumeration ::pit_interrupt_enable_t - */ -static inline uint32_t PIT_GetEnabledInterrupts(PIT_Type *base, pit_chnl_t channel) -{ - return (base->CHANNEL[channel].TCTRL & PIT_TCTRL_TIE_MASK); -} - -/*! @}*/ - -/*! - * @name Status Interface - * @{ - */ - -/*! - * @brief Gets the PIT status flags. - * - * @param base PIT peripheral base address - * @param channel Timer channel number - * - * @return The status flags. This is the logical OR of members of the - * enumeration ::pit_status_flags_t - */ -static inline uint32_t PIT_GetStatusFlags(PIT_Type *base, pit_chnl_t channel) -{ - return (base->CHANNEL[channel].TFLG & PIT_TFLG_TIF_MASK); -} - -/*! - * @brief Clears the PIT status flags. - * - * @param base PIT peripheral base address - * @param channel Timer channel number - * @param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::pit_status_flags_t - */ -static inline void PIT_ClearStatusFlags(PIT_Type *base, pit_chnl_t channel, uint32_t mask) -{ - base->CHANNEL[channel].TFLG = mask; -} - -/*! @}*/ - -/*! - * @name Read and Write the timer period - * @{ - */ - -/*! - * @brief Sets the timer period in units of count. - * - * Timers begin counting from the value set by this function until it reaches 0, - * then it generates an interrupt and load this register value again. - * Writing a new value to this register does not restart the timer. Instead, the value - * is loaded after the timer expires. - * - * @note Users can call the utility macros provided in fsl_common.h to convert to ticks. - * - * @param base PIT peripheral base address - * @param channel Timer channel number - * @param count Timer period in units of ticks - */ -static inline void PIT_SetTimerPeriod(PIT_Type *base, pit_chnl_t channel, uint32_t count) -{ - assert(count != 0U); - /* According to RM, the LDVAL trigger = clock ticks -1 */ - base->CHANNEL[channel].LDVAL = count - 1U; -} - -/*! - * @brief Reads the current timer counting value. - * - * This function returns the real-time timer counting value, in a range from 0 to a - * timer period. - * - * @note Users can call the utility macros provided in fsl_common.h to convert ticks to usec or msec. - * - * @param base PIT peripheral base address - * @param channel Timer channel number - * - * @return Current timer counting value in ticks - */ -static inline uint32_t PIT_GetCurrentTimerCount(PIT_Type *base, pit_chnl_t channel) -{ - return base->CHANNEL[channel].CVAL; -} - -/*! @}*/ - -/*! - * @name Timer Start and Stop - * @{ - */ - -/*! - * @brief Starts the timer counting. - * - * After calling this function, timers load period value, count down to 0 and - * then load the respective start value again. Each time a timer reaches 0, - * it generates a trigger pulse and sets the timeout interrupt flag. - * - * @param base PIT peripheral base address - * @param channel Timer channel number. - */ -static inline void PIT_StartTimer(PIT_Type *base, pit_chnl_t channel) -{ - base->CHANNEL[channel].TCTRL |= PIT_TCTRL_TEN_MASK; -} - -/*! - * @brief Stops the timer counting. - * - * This function stops every timer counting. Timers reload their periods - * respectively after the next time they call the PIT_DRV_StartTimer. - * - * @param base PIT peripheral base address - * @param channel Timer channel number. - */ -static inline void PIT_StopTimer(PIT_Type *base, pit_chnl_t channel) -{ - base->CHANNEL[channel].TCTRL &= ~PIT_TCTRL_TEN_MASK; -} - -/*! @}*/ - -#if defined(FSL_FEATURE_PIT_HAS_LIFETIME_TIMER) && FSL_FEATURE_PIT_HAS_LIFETIME_TIMER - -/*! - * @brief Reads the current lifetime counter value. - * - * The lifetime timer is a 64-bit timer which chains timer 0 and timer 1 together. - * Timer 0 and 1 are chained by calling the PIT_SetTimerChainMode before using this timer. - * The period of lifetime timer is equal to the "period of timer 0 * period of timer 1". - * For the 64-bit value, the higher 32-bit has the value of timer 1, and the lower 32-bit - * has the value of timer 0. - * - * @param base PIT peripheral base address - * - * @return Current lifetime timer value - */ -uint64_t PIT_GetLifetimeTimerCount(PIT_Type *base); - -#endif /* FSL_FEATURE_PIT_HAS_LIFETIME_TIMER */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_PIT_H_ */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_pmc.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_pmc.c deleted file mode 100644 index fb99654bb7d..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_pmc.c +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2019 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#include "fsl_pmc.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.pmc" -#endif - -#if (defined(FSL_FEATURE_PMC_HAS_PARAM) && FSL_FEATURE_PMC_HAS_PARAM) -/*! - * brief Gets the PMC parameter. - * - * This function gets the PMC parameter including the VLPO enable and the HVD enable. - * - * param base PMC peripheral base address. - * param param Pointer to PMC param structure. - */ -void PMC_GetParam(PMC_Type *base, pmc_param_t *param) -{ - uint32_t reg = base->PARAM; - ; - param->vlpoEnable = (bool)(reg & PMC_PARAM_VLPOE_MASK); - param->hvdEnable = (bool)(reg & PMC_PARAM_HVDE_MASK); -} -#endif /* FSL_FEATURE_PMC_HAS_PARAM */ - -/*! - * brief Configures the low-voltage detect setting. - * - * This function configures the low-voltage detect setting, including the trip - * point voltage setting, enables or disables the interrupt, enables or disables the system reset. - * - * param base PMC peripheral base address. - * param config Low-voltage detect configuration structure. - */ -void PMC_ConfigureLowVoltDetect(PMC_Type *base, const pmc_low_volt_detect_config_t *config) -{ - base->LVDSC1 = (uint8_t)((0U | -#if (defined(FSL_FEATURE_PMC_HAS_LVDV) && FSL_FEATURE_PMC_HAS_LVDV) - ((uint32_t)config->voltSelect << PMC_LVDSC1_LVDV_SHIFT) | -#endif - ((uint32_t)config->enableInt << PMC_LVDSC1_LVDIE_SHIFT) | - ((uint32_t)config->enableReset << PMC_LVDSC1_LVDRE_SHIFT) - /* Clear the Low Voltage Detect Flag with previous power detect setting */ - | PMC_LVDSC1_LVDACK_MASK)); -} - -/*! - * brief Configures the low-voltage warning setting. - * - * This function configures the low-voltage warning setting, including the trip - * point voltage setting and enabling or disabling the interrupt. - * - * param base PMC peripheral base address. - * param config Low-voltage warning configuration structure. - */ -void PMC_ConfigureLowVoltWarning(PMC_Type *base, const pmc_low_volt_warning_config_t *config) -{ - base->LVDSC2 = (uint8_t)((0U | -#if (defined(FSL_FEATURE_PMC_HAS_LVWV) && FSL_FEATURE_PMC_HAS_LVWV) - ((uint32_t)config->voltSelect << PMC_LVDSC2_LVWV_SHIFT) | -#endif - ((uint32_t)config->enableInt << PMC_LVDSC2_LVWIE_SHIFT) - /* Clear the Low Voltage Warning Flag with previous power detect setting */ - | PMC_LVDSC2_LVWACK_MASK)); -} - -#if (defined(FSL_FEATURE_PMC_HAS_HVDSC1) && FSL_FEATURE_PMC_HAS_HVDSC1) -/*! - * brief Configures the high-voltage detect setting. - * - * This function configures the high-voltage detect setting, including the trip - * point voltage setting, enabling or disabling the interrupt, enabling or disabling the system reset. - * - * param base PMC peripheral base address. - * param config High-voltage detect configuration structure. - */ -void PMC_ConfigureHighVoltDetect(PMC_Type *base, const pmc_high_volt_detect_config_t *config) -{ - base->HVDSC1 = (uint8_t)(((uint32_t)config->voltSelect << PMC_HVDSC1_HVDV_SHIFT) | - ((uint32_t)config->enableInt << PMC_HVDSC1_HVDIE_SHIFT) | - ((uint32_t)config->enableReset << PMC_HVDSC1_HVDRE_SHIFT) - /* Clear the High Voltage Detect Flag with previous power detect setting */ - | PMC_HVDSC1_HVDACK_MASK); -} -#endif /* FSL_FEATURE_PMC_HAS_HVDSC1 */ - -#if ((defined(FSL_FEATURE_PMC_HAS_BGBE) && FSL_FEATURE_PMC_HAS_BGBE) || \ - (defined(FSL_FEATURE_PMC_HAS_BGEN) && FSL_FEATURE_PMC_HAS_BGEN) || \ - (defined(FSL_FEATURE_PMC_HAS_BGBDS) && FSL_FEATURE_PMC_HAS_BGBDS)) -/*! - * brief Configures the PMC bandgap. - * - * This function configures the PMC bandgap, including the drive select and - * behavior in low-power mode. - * - * param base PMC peripheral base address. - * param config Pointer to the configuration structure - */ -void PMC_ConfigureBandgapBuffer(PMC_Type *base, const pmc_bandgap_buffer_config_t *config) -{ - base->REGSC = (uint8_t)(0U -#if (defined(FSL_FEATURE_PMC_HAS_BGBE) && FSL_FEATURE_PMC_HAS_BGBE) - | ((uint32_t)config->enable << PMC_REGSC_BGBE_SHIFT) -#endif /* FSL_FEATURE_PMC_HAS_BGBE */ -#if (defined(FSL_FEATURE_PMC_HAS_BGEN) && FSL_FEATURE_PMC_HAS_BGEN) - | (((uint32_t)config->enableInLowPowerMode << PMC_REGSC_BGEN_SHIFT)) -#endif /* FSL_FEATURE_PMC_HAS_BGEN */ -#if (defined(FSL_FEATURE_PMC_HAS_BGBDS) && FSL_FEATURE_PMC_HAS_BGBDS) - | ((uint32_t)config->drive << PMC_REGSC_BGBDS_SHIFT) -#endif /* FSL_FEATURE_PMC_HAS_BGBDS */ - ); -} -#endif diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_pmc.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_pmc.h deleted file mode 100644 index 7cbd9b5b9a5..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_pmc.h +++ /dev/null @@ -1,426 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2019 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_PMC_H_ -#define FSL_PMC_H_ - -#include "fsl_common.h" - -/*! @addtogroup pmc */ -/*! @{ */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief PMC driver version */ -#define FSL_PMC_DRIVER_VERSION (MAKE_VERSION(2, 0, 3)) /*!< Version 2.0.3. */ -/*! @} */ - -#if (defined(FSL_FEATURE_PMC_HAS_LVDV) && FSL_FEATURE_PMC_HAS_LVDV) -/*! - * @brief Low-voltage Detect Voltage Select - */ -typedef enum _pmc_low_volt_detect_volt_select -{ - kPMC_LowVoltDetectLowTrip = 0U, /*!< Low-trip point selected (VLVD = VLVDL )*/ - kPMC_LowVoltDetectHighTrip = 1U /*!< High-trip point selected (VLVD = VLVDH )*/ -} pmc_low_volt_detect_volt_select_t; -#endif - -#if (defined(FSL_FEATURE_PMC_HAS_LVWV) && FSL_FEATURE_PMC_HAS_LVWV) -/*! - * @brief Low-voltage Warning Voltage Select - */ -typedef enum _pmc_low_volt_warning_volt_select -{ - kPMC_LowVoltWarningLowTrip = 0U, /*!< Low-trip point selected (VLVW = VLVW1)*/ - kPMC_LowVoltWarningMid1Trip = 1U, /*!< Mid 1 trip point selected (VLVW = VLVW2)*/ - kPMC_LowVoltWarningMid2Trip = 2U, /*!< Mid 2 trip point selected (VLVW = VLVW3)*/ - kPMC_LowVoltWarningHighTrip = 3U /*!< High-trip point selected (VLVW = VLVW4)*/ -} pmc_low_volt_warning_volt_select_t; -#endif - -#if (defined(FSL_FEATURE_PMC_HAS_HVDSC1) && FSL_FEATURE_PMC_HAS_HVDSC1) -/*! - * @brief High-voltage Detect Voltage Select - */ -typedef enum _pmc_high_volt_detect_volt_select -{ - kPMC_HighVoltDetectLowTrip = 0U, /*!< Low-trip point selected (VHVD = VHVDL )*/ - kPMC_HighVoltDetectHighTrip = 1U /*!< High-trip point selected (VHVD = VHVDH )*/ -} pmc_high_volt_detect_volt_select_t; -#endif /* FSL_FEATURE_PMC_HAS_HVDSC1 */ - -#if (defined(FSL_FEATURE_PMC_HAS_BGBDS) && FSL_FEATURE_PMC_HAS_BGBDS) -/*! - * @brief Bandgap Buffer Drive Select. - */ -typedef enum _pmc_bandgap_buffer_drive_select -{ - kPMC_BandgapBufferDriveLow = 0U, /*!< Low-drive. */ - kPMC_BandgapBufferDriveHigh = 1U /*!< High-drive. */ -} pmc_bandgap_buffer_drive_select_t; -#endif /* FSL_FEATURE_PMC_HAS_BGBDS */ - -#if (defined(FSL_FEATURE_PMC_HAS_VLPO) && FSL_FEATURE_PMC_HAS_VLPO) -/*! - * @brief VLPx Option - */ -typedef enum _pmc_vlp_freq_option -{ - kPMC_FreqRestrict = 0U, /*!< Frequency is restricted in VLPx mode. */ - kPMC_FreqUnrestrict = 1U /*!< Frequency is unrestricted in VLPx mode. */ -} pmc_vlp_freq_mode_t; -#endif /* FSL_FEATURE_PMC_HAS_VLPO */ - -#if (defined(FSL_FEATURE_PMC_HAS_VERID) && FSL_FEATURE_PMC_HAS_VERID) -/*! - @brief IP version ID definition. - */ -typedef struct _pmc_version_id -{ - uint16_t feature; /*!< Feature Specification Number. */ - uint8_t minor; /*!< Minor version number. */ - uint8_t major; /*!< Major version number. */ -} pmc_version_id_t; -#endif /* FSL_FEATURE_PMC_HAS_VERID */ - -#if (defined(FSL_FEATURE_PMC_HAS_PARAM) && FSL_FEATURE_PMC_HAS_PARAM) -/*! @brief IP parameter definition. */ -typedef struct _pmc_param -{ - bool vlpoEnable; /*!< VLPO enable. */ - bool hvdEnable; /*!< HVD enable. */ -} pmc_param_t; -#endif /* FSL_FEATURE_PMC_HAS_PARAM */ - -/*! - * @brief Low-voltage Detect Configuration Structure - */ -typedef struct _pmc_low_volt_detect_config -{ - bool enableInt; /*!< Enable interrupt when Low-voltage detect*/ - bool enableReset; /*!< Enable system reset when Low-voltage detect*/ -#if (defined(FSL_FEATURE_PMC_HAS_LVDV) && FSL_FEATURE_PMC_HAS_LVDV) - pmc_low_volt_detect_volt_select_t voltSelect; /*!< Low-voltage detect trip point voltage selection*/ -#endif -} pmc_low_volt_detect_config_t; - -/*! - * @brief Low-voltage Warning Configuration Structure - */ -typedef struct _pmc_low_volt_warning_config -{ - bool enableInt; /*!< Enable interrupt when low-voltage warning*/ -#if (defined(FSL_FEATURE_PMC_HAS_LVWV) && FSL_FEATURE_PMC_HAS_LVWV) - pmc_low_volt_warning_volt_select_t voltSelect; /*!< Low-voltage warning trip point voltage selection*/ -#endif -} pmc_low_volt_warning_config_t; - -#if (defined(FSL_FEATURE_PMC_HAS_HVDSC1) && FSL_FEATURE_PMC_HAS_HVDSC1) -/*! - * @brief High-voltage Detect Configuration Structure - */ -typedef struct _pmc_high_volt_detect_config -{ - bool enableInt; /*!< Enable interrupt when high-voltage detect*/ - bool enableReset; /*!< Enable system reset when high-voltage detect*/ - pmc_high_volt_detect_volt_select_t voltSelect; /*!< High-voltage detect trip point voltage selection*/ -} pmc_high_volt_detect_config_t; -#endif /* FSL_FEATURE_PMC_HAS_HVDSC1 */ - -#if ((defined(FSL_FEATURE_PMC_HAS_BGBE) && FSL_FEATURE_PMC_HAS_BGBE) || \ - (defined(FSL_FEATURE_PMC_HAS_BGEN) && FSL_FEATURE_PMC_HAS_BGEN) || \ - (defined(FSL_FEATURE_PMC_HAS_BGBDS) && FSL_FEATURE_PMC_HAS_BGBDS)) -/*! - * @brief Bandgap Buffer configuration. - */ -typedef struct _pmc_bandgap_buffer_config -{ -#if (defined(FSL_FEATURE_PMC_HAS_BGBE) && FSL_FEATURE_PMC_HAS_BGBE) - bool enable; /*!< Enable bandgap buffer. */ -#endif -#if (defined(FSL_FEATURE_PMC_HAS_BGEN) && FSL_FEATURE_PMC_HAS_BGEN) - bool enableInLowPowerMode; /*!< Enable bandgap buffer in low-power mode. */ -#endif /* FSL_FEATURE_PMC_HAS_BGEN */ -#if (defined(FSL_FEATURE_PMC_HAS_BGBDS) && FSL_FEATURE_PMC_HAS_BGBDS) - pmc_bandgap_buffer_drive_select_t drive; /*!< Bandgap buffer drive select. */ -#endif /* FSL_FEATURE_PMC_HAS_BGBDS */ -} pmc_bandgap_buffer_config_t; -#endif - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus*/ - -/*! @name Power Management Controller Control APIs*/ -/*! @{ */ - -#if (defined(FSL_FEATURE_PMC_HAS_VERID) && FSL_FEATURE_PMC_HAS_VERID) -/*! - * @brief Gets the PMC version ID. - * - * This function gets the PMC version ID, including major version number, - * minor version number, and a feature specification number. - * - * @param base PMC peripheral base address. - * @param versionId Pointer to version ID structure. - */ -static inline void PMC_GetVersionId(PMC_Type *base, pmc_version_id_t *versionId) -{ - union - { - pmc_version_id_t vid; - uint32_t u32; - } pmcVID; - - pmcVID.u32 = base->VERID; - *versionId = pmcVID.vid; -} -#endif /* FSL_FEATURE_PMC_HAS_VERID */ - -#if (defined(FSL_FEATURE_PMC_HAS_PARAM) && FSL_FEATURE_PMC_HAS_PARAM) -/*! - * @brief Gets the PMC parameter. - * - * This function gets the PMC parameter including the VLPO enable and the HVD enable. - * - * @param base PMC peripheral base address. - * @param param Pointer to PMC param structure. - */ -void PMC_GetParam(PMC_Type *base, pmc_param_t *param); -#endif - -/*! - * @brief Configures the low-voltage detect setting. - * - * This function configures the low-voltage detect setting, including the trip - * point voltage setting, enables or disables the interrupt, enables or disables the system reset. - * - * @param base PMC peripheral base address. - * @param config Low-voltage detect configuration structure. - */ -void PMC_ConfigureLowVoltDetect(PMC_Type *base, const pmc_low_volt_detect_config_t *config); - -/*! - * @brief Gets the Low-voltage Detect Flag status. - * - * This function reads the current LVDF status. If it returns 1, a low-voltage event is detected. - * - * @param base PMC peripheral base address. - * @return Current low-voltage detect flag - * - true: Low-voltage detected - * - false: Low-voltage not detected - */ -static inline bool PMC_GetLowVoltDetectFlag(PMC_Type *base) -{ - if (0U != (base->LVDSC1 & PMC_LVDSC1_LVDF_MASK)) - { - return true; - } - else - { - return false; - } -} - -/*! - * @brief Acknowledges clearing the Low-voltage Detect flag. - * - * This function acknowledges the low-voltage detection errors (write 1 to - * clear LVDF). - * - * @param base PMC peripheral base address. - */ -static inline void PMC_ClearLowVoltDetectFlag(PMC_Type *base) -{ - base->LVDSC1 |= PMC_LVDSC1_LVDACK_MASK; -} - -/*! - * @brief Configures the low-voltage warning setting. - * - * This function configures the low-voltage warning setting, including the trip - * point voltage setting and enabling or disabling the interrupt. - * - * @param base PMC peripheral base address. - * @param config Low-voltage warning configuration structure. - */ -void PMC_ConfigureLowVoltWarning(PMC_Type *base, const pmc_low_volt_warning_config_t *config); - -/*! - * @brief Gets the Low-voltage Warning Flag status. - * - * This function polls the current LVWF status. When 1 is returned, it - * indicates a low-voltage warning event. LVWF is set when V Supply transitions - * below the trip point or after reset and V Supply is already below the V LVW. - * - * @param base PMC peripheral base address. - * @return Current LVWF status - * - true: Low-voltage Warning Flag is set. - * - false: the Low-voltage Warning does not happen. - */ -static inline bool PMC_GetLowVoltWarningFlag(PMC_Type *base) -{ - if (0U != (base->LVDSC2 & PMC_LVDSC2_LVWF_MASK)) - { - return true; - } - else - { - return false; - } -} - -/*! - * @brief Acknowledges the Low-voltage Warning flag. - * - * This function acknowledges the low voltage warning errors (write 1 to - * clear LVWF). - * - * @param base PMC peripheral base address. - */ -static inline void PMC_ClearLowVoltWarningFlag(PMC_Type *base) -{ - base->LVDSC2 |= PMC_LVDSC2_LVWACK_MASK; -} - -#if (defined(FSL_FEATURE_PMC_HAS_HVDSC1) && FSL_FEATURE_PMC_HAS_HVDSC1) -/*! - * @brief Configures the high-voltage detect setting. - * - * This function configures the high-voltage detect setting, including the trip - * point voltage setting, enabling or disabling the interrupt, enabling or disabling the system reset. - * - * @param base PMC peripheral base address. - * @param config High-voltage detect configuration structure. - */ -void PMC_ConfigureHighVoltDetect(PMC_Type *base, const pmc_high_volt_detect_config_t *config); - -/*! - * @brief Gets the High-voltage Detect Flag status. - * - * This function reads the current HVDF status. If it returns 1, a low - * voltage event is detected. - * - * @param base PMC peripheral base address. - * @return Current high-voltage detect flag - * - true: High-voltage detected - * - false: High-voltage not detected - */ -static inline bool PMC_GetHighVoltDetectFlag(PMC_Type *base) -{ - return (bool)(base->HVDSC1 & PMC_HVDSC1_HVDF_MASK); -} - -/*! - * @brief Acknowledges clearing the High-voltage Detect flag. - * - * This function acknowledges the high-voltage detection errors (write 1 to - * clear HVDF). - * - * @param base PMC peripheral base address. - */ -static inline void PMC_ClearHighVoltDetectFlag(PMC_Type *base) -{ - base->HVDSC1 |= PMC_HVDSC1_HVDACK_MASK; -} -#endif /* FSL_FEATURE_PMC_HAS_HVDSC1 */ - -#if ((defined(FSL_FEATURE_PMC_HAS_BGBE) && FSL_FEATURE_PMC_HAS_BGBE) || \ - (defined(FSL_FEATURE_PMC_HAS_BGEN) && FSL_FEATURE_PMC_HAS_BGEN) || \ - (defined(FSL_FEATURE_PMC_HAS_BGBDS) && FSL_FEATURE_PMC_HAS_BGBDS)) -/*! - * @brief Configures the PMC bandgap. - * - * This function configures the PMC bandgap, including the drive select and - * behavior in low-power mode. - * - * @param base PMC peripheral base address. - * @param config Pointer to the configuration structure - */ -void PMC_ConfigureBandgapBuffer(PMC_Type *base, const pmc_bandgap_buffer_config_t *config); -#endif - -#if (defined(FSL_FEATURE_PMC_HAS_ACKISO) && FSL_FEATURE_PMC_HAS_ACKISO) -/*! - * @brief Gets the acknowledge Peripherals and I/O pads isolation flag. - * - * This function reads the Acknowledge Isolation setting that indicates - * whether certain peripherals and the I/O pads are in a latched state as - * a result of having been in the VLLS mode. - * - * @param base PMC peripheral base address. - * @param base Base address for current PMC instance. - * @return ACK isolation - * 0 - Peripherals and I/O pads are in a normal run state. - * 1 - Certain peripherals and I/O pads are in an isolated and - * latched state. - */ -static inline bool PMC_GetPeriphIOIsolationFlag(PMC_Type *base) -{ - return (0U != (base->REGSC & PMC_REGSC_ACKISO_MASK)) ? true : false; -} - -/*! - * @brief Acknowledges the isolation flag to Peripherals and I/O pads. - * - * This function clears the ACK Isolation flag. Writing one to this setting - * when it is set releases the I/O pads and certain peripherals to their normal - * run mode state. - * - * @param base PMC peripheral base address. - */ -static inline void PMC_ClearPeriphIOIsolationFlag(PMC_Type *base) -{ - base->REGSC |= PMC_REGSC_ACKISO_MASK; -} -#endif /* FSL_FEATURE_PMC_HAS_ACKISO */ - -#if (defined(FSL_FEATURE_PMC_HAS_REGONS) && FSL_FEATURE_PMC_HAS_REGONS) -/*! - * @brief Gets the regulator regulation status. - * - * This function returns the regulator to run a regulation status. It provides - * the current status of the internal voltage regulator. - * - * @param base PMC peripheral base address. - * @param base Base address for current PMC instance. - * @return Regulation status - * 0 - Regulator is in a stop regulation or in transition to/from the regulation. - * 1 - Regulator is in a run regulation. - * - */ -static inline bool PMC_IsRegulatorInRunRegulation(PMC_Type *base) -{ - if (0U != (base->REGSC & PMC_REGSC_REGONS_MASK)) - { - return true; - } - else - { - return false; - } -} -#endif /* FSL_FEATURE_PMC_HAS_REGONS */ - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /* __cplusplus*/ - -/*! @}*/ - -#endif /* FSL_PMC_H_*/ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_port.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_port.h deleted file mode 100644 index 8eb512969d8..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_port.h +++ /dev/null @@ -1,684 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022, 2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_PORT_H_ -#define FSL_PORT_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup port - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.port" -#endif - -/*! @name Driver version */ -/*! @{ */ -/*! @brief PORT driver version. */ -#define FSL_PORT_DRIVER_VERSION (MAKE_VERSION(2, 5, 0)) -/*! @} */ - -#if defined(FSL_FEATURE_PORT_HAS_PULL_ENABLE) && FSL_FEATURE_PORT_HAS_PULL_ENABLE -/*! @brief Internal resistor pull feature selection */ -enum _port_pull -{ - kPORT_PullDisable = 0U, /*!< Internal pull-up/down resistor is disabled. */ - kPORT_PullDown = 2U, /*!< Internal pull-down resistor is enabled. */ - kPORT_PullUp = 3U, /*!< Internal pull-up resistor is enabled. */ -}; -#endif /* FSL_FEATURE_PORT_HAS_PULL_ENABLE */ - -#if defined(FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE) && FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE -/*! @brief Internal resistor pull value selection */ -enum _port_pull_value -{ - kPORT_LowPullResistor = 0U, /*!< Low internal pull resistor value is selected. */ - kPORT_HighPullResistor = 1U, /*!< High internal pull resistor value is selected. */ -}; -#endif /* FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE */ - -#if defined(FSL_FEATURE_PORT_HAS_SLEW_RATE) && FSL_FEATURE_PORT_HAS_SLEW_RATE -/*! @brief Slew rate selection */ -enum _port_slew_rate -{ - kPORT_FastSlewRate = 0U, /*!< Fast slew rate is configured. */ - kPORT_SlowSlewRate = 1U, /*!< Slow slew rate is configured. */ -}; -#endif /* FSL_FEATURE_PORT_HAS_SLEW_RATE */ - -#if defined(FSL_FEATURE_PORT_HAS_OPEN_DRAIN) && FSL_FEATURE_PORT_HAS_OPEN_DRAIN -/*! @brief Open Drain feature enable/disable */ -enum _port_open_drain_enable -{ - kPORT_OpenDrainDisable = 0U, /*!< Open drain output is disabled. */ - kPORT_OpenDrainEnable = 1U, /*!< Open drain output is enabled. */ -}; -#endif /* FSL_FEATURE_PORT_HAS_OPEN_DRAIN */ - -#if defined(FSL_FEATURE_PORT_HAS_PASSIVE_FILTER) && FSL_FEATURE_PORT_HAS_PASSIVE_FILTER -/*! @brief Passive filter feature enable/disable */ -enum _port_passive_filter_enable -{ - kPORT_PassiveFilterDisable = 0U, /*!< Passive input filter is disabled. */ - kPORT_PassiveFilterEnable = 1U, /*!< Passive input filter is enabled. */ -}; -#endif - -#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH -/*! @brief Configures the drive strength. */ -enum _port_drive_strength -{ - kPORT_LowDriveStrength = 0U, /*!< Low-drive strength is configured. */ - kPORT_HighDriveStrength = 1U, /*!< High-drive strength is configured. */ -}; -#endif /* FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH */ - -#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1 -/*! @brief Configures the drive strength1. */ -enum _port_drive_strength1 -{ - kPORT_NormalDriveStrength = 0U, /*!< Normal drive strength */ - kPORT_DoubleDriveStrength = 1U, /*!< Double drive strength */ -}; -#endif /* FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1 */ - -#if defined(FSL_FEATURE_PORT_HAS_INPUT_BUFFER) && FSL_FEATURE_PORT_HAS_INPUT_BUFFER -/*! @brief input buffer disable/enable. */ -enum _port_input_buffer -{ - kPORT_InputBufferDisable = 0U, /*!< Digital input is disabled */ - kPORT_InputBufferEnable = 1U, /*!< Digital input is enabled */ -}; -#endif /* FSL_FEATURE_PORT_HAS_INPUT_BUFFER */ - -#if defined(FSL_FEATURE_PORT_HAS_INVERT_INPUT) && FSL_FEATURE_PORT_HAS_INVERT_INPUT -/*! @brief Digital input is not inverted or it is inverted. */ -enum _port_invet_input -{ - kPORT_InputNormal = 0U, /*!< Digital input is not inverted */ - kPORT_InputInvert = 1U, /*!< Digital input is inverted */ -}; -#endif /* FSL_FEATURE_PORT_HAS_INVERT_INPUT */ - -#if defined(FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK) && FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK -/*! @brief Unlock/lock the pin control register field[15:0] */ -enum _port_lock_register -{ - kPORT_UnlockRegister = 0U, /*!< Pin Control Register fields [15:0] are not locked. */ - kPORT_LockRegister = 1U, /*!< Pin Control Register fields [15:0] are locked. */ -}; -#endif /* FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK */ - -#if defined(FSL_FEATURE_PORT_PCR_MUX_WIDTH) && FSL_FEATURE_PORT_PCR_MUX_WIDTH -/*! @brief Pin mux selection */ -typedef enum _port_mux -{ -#if defined(FSL_FEATURE_PORT_PCR_MUX_GPIO) && (FSL_FEATURE_PORT_PCR_MUX_GPIO == 0) - kPORT_MuxAsGpio = 0U, /*!< Corresponding pin is configured as GPIO. */ -#else - kPORT_PinDisabledOrAnalog = 0U, /*!< Corresponding pin is disabled, but is used as an analog pin. */ - kPORT_MuxAsGpio = 1U, /*!< Corresponding pin is configured as GPIO. */ -#endif - kPORT_MuxAlt0 = 0U, /*!< Chip-specific */ - kPORT_MuxAlt1 = 1U, /*!< Chip-specific */ - kPORT_MuxAlt2 = 2U, /*!< Chip-specific */ - kPORT_MuxAlt3 = 3U, /*!< Chip-specific */ - kPORT_MuxAlt4 = 4U, /*!< Chip-specific */ - kPORT_MuxAlt5 = 5U, /*!< Chip-specific */ - kPORT_MuxAlt6 = 6U, /*!< Chip-specific */ - kPORT_MuxAlt7 = 7U, /*!< Chip-specific */ - kPORT_MuxAlt8 = 8U, /*!< Chip-specific */ - kPORT_MuxAlt9 = 9U, /*!< Chip-specific */ - kPORT_MuxAlt10 = 10U, /*!< Chip-specific */ - kPORT_MuxAlt11 = 11U, /*!< Chip-specific */ - kPORT_MuxAlt12 = 12U, /*!< Chip-specific */ - kPORT_MuxAlt13 = 13U, /*!< Chip-specific */ - kPORT_MuxAlt14 = 14U, /*!< Chip-specific */ - kPORT_MuxAlt15 = 15U, /*!< Chip-specific */ -} port_mux_t; -#endif /* FSL_FEATURE_PORT_PCR_MUX_WIDTH */ - -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) -/*! @brief Configures the interrupt generation condition. */ -typedef enum _port_interrupt -{ - kPORT_InterruptOrDMADisabled = 0x0U, /*!< Interrupt/DMA request is disabled. */ -#if defined(FSL_FEATURE_PORT_HAS_DMA_REQUEST) && FSL_FEATURE_PORT_HAS_DMA_REQUEST || defined(DOXYGEN_OUTPUT) - kPORT_DMARisingEdge = 0x1U, /*!< DMA request on rising edge. */ - kPORT_DMAFallingEdge = 0x2U, /*!< DMA request on falling edge. */ - kPORT_DMAEitherEdge = 0x3U, /*!< DMA request on either edge. */ -#endif -#if defined(FSL_FEATURE_PORT_HAS_IRQC_FLAG) && FSL_FEATURE_PORT_HAS_IRQC_FLAG || defined(DOXYGEN_OUTPUT) - kPORT_FlagRisingEdge = 0x05U, /*!< Flag sets on rising edge. */ - kPORT_FlagFallingEdge = 0x06U, /*!< Flag sets on falling edge. */ - kPORT_FlagEitherEdge = 0x07U, /*!< Flag sets on either edge. */ -#endif - kPORT_InterruptLogicZero = 0x8U, /*!< Interrupt when logic zero. */ - kPORT_InterruptRisingEdge = 0x9U, /*!< Interrupt on rising edge. */ - kPORT_InterruptFallingEdge = 0xAU, /*!< Interrupt on falling edge. */ - kPORT_InterruptEitherEdge = 0xBU, /*!< Interrupt on either edge. */ - kPORT_InterruptLogicOne = 0xCU, /*!< Interrupt when logic one. */ -#if defined(FSL_FEATURE_PORT_HAS_IRQC_TRIGGER) && FSL_FEATURE_PORT_HAS_IRQC_TRIGGER || defined(DOXYGEN_OUTPUT) - kPORT_ActiveHighTriggerOutputEnable = 0xDU, /*!< Enable active high-trigger output. */ - kPORT_ActiveLowTriggerOutputEnable = 0xEU, /*!< Enable active low-trigger output. */ -#endif -} port_interrupt_t; -#endif - -#if defined(FSL_FEATURE_PORT_HAS_DIGITAL_FILTER) && FSL_FEATURE_PORT_HAS_DIGITAL_FILTER -/*! @brief Digital filter clock source selection */ -typedef enum _port_digital_filter_clock_source -{ - kPORT_BusClock = 0U, /*!< Digital filters are clocked by the bus clock. */ - kPORT_LpoClock = 1U, /*!< Digital filters are clocked by the 1 kHz LPO clock. */ -} port_digital_filter_clock_source_t; - -/*! @brief PORT digital filter feature configuration definition */ -typedef struct _port_digital_filter_config -{ - uint32_t digitalFilterWidth; /*!< Set digital filter width */ - port_digital_filter_clock_source_t clockSource; /*!< Set digital filter clockSource */ -} port_digital_filter_config_t; -#endif /* FSL_FEATURE_PORT_HAS_DIGITAL_FILTER */ - -#if defined(FSL_FEATURE_PORT_PCR_MUX_WIDTH) && FSL_FEATURE_PORT_PCR_MUX_WIDTH -/*! @brief PORT pin configuration structure */ -typedef struct _port_pin_config -{ -#if defined(FSL_FEATURE_PORT_HAS_PULL_ENABLE) && FSL_FEATURE_PORT_HAS_PULL_ENABLE - uint16_t pullSelect : 2; /*!< No-pull/pull-down/pull-up select */ -#else - uint16_t : 2; -#endif /* FSL_FEATURE_PORT_HAS_PULL_ENABLE */ - -#if defined(FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE) && FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE - uint16_t pullValueSelect : 1; /*!< Pull value select */ -#endif /* FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE */ - -#if defined(FSL_FEATURE_PORT_HAS_SLEW_RATE) && FSL_FEATURE_PORT_HAS_SLEW_RATE - uint16_t slewRate : 1; /*!< Fast/slow slew rate Configure */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_SLEW_RATE */ - -#if !(defined(FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE) && FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE) - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE */ - -#if defined(FSL_FEATURE_PORT_HAS_PASSIVE_FILTER) && FSL_FEATURE_PORT_HAS_PASSIVE_FILTER - uint16_t passiveFilterEnable : 1; /*!< Passive filter enable/disable */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_PASSIVE_FILTER */ - -#if defined(FSL_FEATURE_PORT_HAS_OPEN_DRAIN) && FSL_FEATURE_PORT_HAS_OPEN_DRAIN - uint16_t openDrainEnable : 1; /*!< Open drain enable/disable */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_OPEN_DRAIN */ - -#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH - uint16_t driveStrength : 1; /*!< Fast/slow drive strength configure */ -#else - uint16_t : 1; -#endif - -#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1 - uint16_t driveStrength1 : 1; /*!< Normal/Double drive strength enable/disable */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1 */ - -#if defined(FSL_FEATURE_PORT_PCR_MUX_WIDTH) && (FSL_FEATURE_PORT_PCR_MUX_WIDTH == 3) - uint16_t mux : 3; /*!< Pin mux Configure */ - uint16_t : 1; -#elif defined(FSL_FEATURE_PORT_PCR_MUX_WIDTH) && (FSL_FEATURE_PORT_PCR_MUX_WIDTH == 4) - uint16_t mux : 4; /*!< Pin mux Configure */ -#else - uint16_t : 4; -#endif - -#if defined(FSL_FEATURE_PORT_HAS_INPUT_BUFFER) && FSL_FEATURE_PORT_HAS_INPUT_BUFFER - uint16_t inputBuffer : 1; /*!< Input Buffer Configure */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_INPUT_BUFFER */ - -#if defined(FSL_FEATURE_PORT_HAS_INVERT_INPUT) && FSL_FEATURE_PORT_HAS_INVERT_INPUT - uint16_t invertInput : 1; /*!< Invert Input Configure */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_INVERT_INPUT */ - - uint16_t : 1; - -#if defined(FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK) && FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK - uint16_t lockRegister : 1; /*!< Lock/unlock the PCR field[15:0] */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK */ -} port_pin_config_t; -#endif /* FSL_FEATURE_PORT_PCR_MUX_WIDTH */ - -#if defined(FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER) && FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER -/*! @brief PORT version information. */ -typedef struct _port_version_info -{ - uint16_t feature; /*!< Feature Specification Number. */ - uint8_t minor; /*!< Minor Version Number. */ - uint8_t major; /*!< Major Version Number. */ -} port_version_info_t; -#endif /* FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER */ - -#if defined(FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE) && FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE -/*! @brief PORT voltage range. */ -typedef enum _port_voltage_range -{ - kPORT_VoltageRange1Dot71V_3Dot6V = 0x0U, /*!< Port voltage range is 1.71 V - 3.6 V. */ - kPORT_VoltageRange2Dot70V_3Dot6V = 0x1U, /*!< Port voltage range is 2.70 V - 3.6 V. */ -} port_voltage_range_t; -#endif /* FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! @name Configuration */ -/*! @{ */ - -#if defined(FSL_FEATURE_PORT_PCR_MUX_WIDTH) && FSL_FEATURE_PORT_PCR_MUX_WIDTH - -#if defined(FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER) && FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER -/*! - * @brief Get PORT version information. - * - * @param base PORT peripheral base pointer - * @param info PORT version information - */ -static inline void PORT_GetVersionInfo(PORT_Type *base, port_version_info_t *info) -{ - uint32_t verid = base->VERID; - info->feature = (uint16_t)verid; - info->minor = (uint8_t)(verid >> PORT_VERID_MINOR_SHIFT); - info->major = (uint8_t)(verid >> PORT_VERID_MAJOR_SHIFT); -} -#endif /* FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER */ - -#if defined(FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE) && FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE -/*! - * @brief Get PORT version information. - * - * @note : PORTA_CONFIG[RANGE] controls the voltage ranges of Port A, B, and C. Read or write PORTB_CONFIG[RANGE] and - * PORTC_CONFIG[RANGE] does not take effect. - * - * @param base PORT peripheral base pointer - * @param range port voltage range - */ -static inline void PORT_SecletPortVoltageRange(PORT_Type *base, port_voltage_range_t range) -{ - base->CONFIG = (uint32_t)range; -} -#endif /* FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE */ - -/*! - * @brief Sets the port PCR register. - * - * This is an example to define an input pin or output pin PCR configuration. - * @code - * // Define a digital input pin PCR configuration - * port_pin_config_t config = { - * kPORT_PullUp, - * kPORT_FastSlewRate, - * kPORT_PassiveFilterDisable, - * kPORT_OpenDrainDisable, - * kPORT_LowDriveStrength, - * kPORT_MuxAsGpio, - * kPORT_UnLockRegister, - * }; - * @endcode - * - * @param base PORT peripheral base pointer. - * @param pin PORT pin number. - * @param config PORT PCR register configuration structure. - */ -static inline void PORT_SetPinConfig(PORT_Type *base, uint32_t pin, const port_pin_config_t *config) -{ - assert(config); - uint32_t addr = (uint32_t)&base->PCR[pin]; - *(volatile uint16_t *)(addr) = *((const uint16_t *)(const void *)config); -} - -/*! - * @brief Sets the port PCR register for multiple pins. - * - * This is an example to define input pins or output pins PCR configuration. - * @code - * Define a digital input pin PCR configuration - * port_pin_config_t config = { - * kPORT_PullUp , - * kPORT_PullEnable, - * kPORT_FastSlewRate, - * kPORT_PassiveFilterDisable, - * kPORT_OpenDrainDisable, - * kPORT_LowDriveStrength, - * kPORT_MuxAsGpio, - * kPORT_UnlockRegister, - * }; - * @endcode - * - * @param base PORT peripheral base pointer. - * @param mask PORT pin number macro. - * @param config PORT PCR register configuration structure. - */ -static inline void PORT_SetMultiplePinsConfig(PORT_Type *base, uint32_t mask, const port_pin_config_t *config) -{ - assert(config); - - uint16_t pcrl = *((const uint16_t *)(const void *)config); - - if (0U != (mask & 0xffffU)) - { - base->GPCLR = ((mask & 0xffffU) << 16) | pcrl; - } - if (0U != (mask >> 16)) - { - base->GPCHR = (mask & 0xffff0000U) | pcrl; - } -} - -#if defined(FSL_FEATURE_PORT_HAS_MULTIPLE_IRQ_CONFIG) && FSL_FEATURE_PORT_HAS_MULTIPLE_IRQ_CONFIG -/*! - * @brief Sets the port interrupt configuration in PCR register for multiple pins. - * - * @param base PORT peripheral base pointer. - * @param mask PORT pin number macro. - * @param config PORT pin interrupt configuration. - * - #kPORT_InterruptOrDMADisabled: Interrupt/DMA request disabled. - * - #kPORT_DMARisingEdge : DMA request on rising edge(if the DMA requests exit). - * - #kPORT_DMAFallingEdge: DMA request on falling edge(if the DMA requests exit). - * - #kPORT_DMAEitherEdge : DMA request on either edge(if the DMA requests exit). - * - #kPORT_FlagRisingEdge : Flag sets on rising edge(if the Flag states exit). - * - #kPORT_FlagFallingEdge : Flag sets on falling edge(if the Flag states exit). - * - #kPORT_FlagEitherEdge : Flag sets on either edge(if the Flag states exit). - * - #kPORT_InterruptLogicZero : Interrupt when logic zero. - * - #kPORT_InterruptRisingEdge : Interrupt on rising edge. - * - #kPORT_InterruptFallingEdge: Interrupt on falling edge. - * - #kPORT_InterruptEitherEdge : Interrupt on either edge. - * - #kPORT_InterruptLogicOne : Interrupt when logic one. - * - #kPORT_ActiveHighTriggerOutputEnable : Enable active high-trigger output (if the trigger states exit). - * - #kPORT_ActiveLowTriggerOutputEnable : Enable active low-trigger output (if the trigger states exit).. - */ -static inline void PORT_SetMultipleInterruptPinsConfig(PORT_Type *base, uint32_t mask, port_interrupt_t config) -{ - assert(config); - - if (0U != ((uint32_t)mask & 0xffffU)) - { - base->GICLR = ((uint32_t)config << 16U) | ((uint32_t)mask & 0xffffU); - } - mask = mask >> 16; - if (0U != mask) - { - base->GICHR = ((uint32_t)config << 16U) | ((uint32_t)mask & 0xffffU); - } -} -#endif - -/*! - * @brief Configures the pin muxing. - * - * @param base PORT peripheral base pointer. - * @param pin PORT pin number. - * @param mux pin muxing slot selection. - * - #kPORT_PinDisabledOrAnalog: Pin disabled or work in analog function. - * - #kPORT_MuxAsGpio : Set as GPIO. - * - #kPORT_MuxAlt2 : chip-specific. - * - #kPORT_MuxAlt3 : chip-specific. - * - #kPORT_MuxAlt4 : chip-specific. - * - #kPORT_MuxAlt5 : chip-specific. - * - #kPORT_MuxAlt6 : chip-specific. - * - #kPORT_MuxAlt7 : chip-specific. - * @note : This function is NOT recommended to use together with the PORT_SetPinsConfig, because - * the PORT_SetPinsConfig need to configure the pin mux anyway (Otherwise the pin mux is - * reset to zero : kPORT_PinDisabledOrAnalog). - * This function is recommended to use to reset the pin mux - * - */ -static inline void PORT_SetPinMux(PORT_Type *base, uint32_t pin, port_mux_t mux) -{ - base->PCR[pin] = (base->PCR[pin] & ~PORT_PCR_MUX_MASK) | PORT_PCR_MUX(mux); -} -#endif /* FSL_FEATURE_PORT_PCR_MUX_WIDTH */ - -#if defined(FSL_FEATURE_PORT_HAS_DIGITAL_FILTER) && FSL_FEATURE_PORT_HAS_DIGITAL_FILTER - -/*! - * @brief Enables the digital filter in one port, each bit of the 32-bit register represents one pin. - * - * @param base PORT peripheral base pointer. - * @param mask PORT pin number macro. - * @param enable PORT digital filter configuration. - */ -static inline void PORT_EnablePinsDigitalFilter(PORT_Type *base, uint32_t mask, bool enable) -{ - if (enable == true) - { - base->DFER |= mask; - } - else - { - base->DFER &= ~mask; - } -} - -/*! - * @brief Sets the digital filter in one port, each bit of the 32-bit register represents one pin. - * - * @param base PORT peripheral base pointer. - * @param config PORT digital filter configuration structure. - */ -static inline void PORT_SetDigitalFilterConfig(PORT_Type *base, const port_digital_filter_config_t *config) -{ - assert(config); - - base->DFCR = PORT_DFCR_CS(config->clockSource); - base->DFWR = PORT_DFWR_FILT(config->digitalFilterWidth); -} - -#endif /* FSL_FEATURE_PORT_HAS_DIGITAL_FILTER */ -/*! @} */ - -/*! @name Interrupt */ -/*! @{ */ - -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) -/*! - * @brief Configures the port pin interrupt/DMA request. - * - * @param base PORT peripheral base pointer. - * @param pin PORT pin number. - * @param config PORT pin interrupt configuration. - * - #kPORT_InterruptOrDMADisabled: Interrupt/DMA request disabled. - * - #kPORT_DMARisingEdge : DMA request on rising edge(if the DMA requests exit). - * - #kPORT_DMAFallingEdge: DMA request on falling edge(if the DMA requests exit). - * - #kPORT_DMAEitherEdge : DMA request on either edge(if the DMA requests exit). - * - #kPORT_FlagRisingEdge : Flag sets on rising edge(if the Flag states exit). - * - #kPORT_FlagFallingEdge : Flag sets on falling edge(if the Flag states exit). - * - #kPORT_FlagEitherEdge : Flag sets on either edge(if the Flag states exit). - * - #kPORT_InterruptLogicZero : Interrupt when logic zero. - * - #kPORT_InterruptRisingEdge : Interrupt on rising edge. - * - #kPORT_InterruptFallingEdge: Interrupt on falling edge. - * - #kPORT_InterruptEitherEdge : Interrupt on either edge. - * - #kPORT_InterruptLogicOne : Interrupt when logic one. - * - #kPORT_ActiveHighTriggerOutputEnable : Enable active high-trigger output (if the trigger states exit). - * - #kPORT_ActiveLowTriggerOutputEnable : Enable active low-trigger output (if the trigger states exit). - */ -static inline void PORT_SetPinInterruptConfig(PORT_Type *base, uint32_t pin, port_interrupt_t config) -{ - base->PCR[pin] = (base->PCR[pin] & ~PORT_PCR_IRQC_MASK) | PORT_PCR_IRQC(config); -} -#endif - -#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH -/*! - * @brief Configures the port pin drive strength. - * - * @param base PORT peripheral base pointer. - * @param pin PORT pin number. - * @param strength PORT pin drive strength - * - #kPORT_LowDriveStrength = 0U - Low-drive strength is configured. - * - #kPORT_HighDriveStrength = 1U - High-drive strength is configured. - */ -static inline void PORT_SetPinDriveStrength(PORT_Type *base, uint32_t pin, uint8_t strength) -{ - base->PCR[pin] = (base->PCR[pin] & ~PORT_PCR_DSE_MASK) | PORT_PCR_DSE(strength); -} -#endif - -#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1 -/*! - * @brief Enables the port pin double drive strength. - * - * @param base PORT peripheral base pointer. - * @param pin PORT pin number. - * @param enable PORT pin drive strength configuration. - */ -static inline void PORT_EnablePinDoubleDriveStrength(PORT_Type *base, uint32_t pin, bool enable) -{ - base->PCR[pin] = (base->PCR[pin] & ~PORT_PCR_DSE1_MASK) | PORT_PCR_DSE1(enable); -} -#endif - -#if defined(FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE) && FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE -/*! - * @brief Configures the port pin pull value. - * - * @param base PORT peripheral base pointer. - * @param pin PORT pin number. - * @param value PORT pin pull value - * - #kPORT_LowPullResistor = 0U - Low internal pull resistor value is selected. - * - #kPORT_HighPullResistor = 1U - High internal pull resistor value is selected. - */ -static inline void PORT_SetPinPullValue(PORT_Type *base, uint32_t pin, uint8_t value) -{ - base->PCR[pin] = (base->PCR[pin] & ~PORT_PCR_PV_MASK) | PORT_PCR_PV(value); -} -#endif /* FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE */ - -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) -/*! - * @brief Reads the whole port status flag. - * - * If a pin is configured to generate the DMA request, the corresponding flag - * is cleared automatically at the completion of the requested DMA transfer. - * Otherwise, the flag remains set until a logic one is written to that flag. - * If configured for a level sensitive interrupt that remains asserted, the flag - * is set again immediately. - * - * @param base PORT peripheral base pointer. - * @return Current port interrupt status flags, for example, 0x00010001 means the - * pin 0 and 16 have the interrupt. - */ -static inline uint32_t PORT_GetPinsInterruptFlags(PORT_Type *base) -{ - return base->ISFR; -} - -/*! - * @brief Clears the multiple pin interrupt status flag. - * - * @param base PORT peripheral base pointer. - * @param mask PORT pin number macro. - */ -static inline void PORT_ClearPinsInterruptFlags(PORT_Type *base, uint32_t mask) -{ - base->ISFR = mask; -} -#endif - -#if defined(FSL_FEATURE_PORT_SUPPORT_EFT) && FSL_FEATURE_PORT_SUPPORT_EFT -/*! - * @brief Get EFT detect flags. - * - * @param base PORT peripheral base pointer - * @return EFT detect flags - */ -static inline uint32_t PORT_GetEFTDetectFlags(PORT_Type *base) -{ - return base->EDFR; -} - -/*! - * @brief Enable EFT detect interrupts. - * - * @param base PORT peripheral base pointer - * @param interrupt EFT detect interrupt - */ -static inline void PORT_EnableEFTDetectInterrupts(PORT_Type *base, uint32_t interrupt) -{ - base->EDIER |= interrupt; -} - -/*! - * @brief Disable EFT detect interrupts. - * - * @param base PORT peripheral base pointer - * @param interrupt EFT detect interrupt - */ -static inline void PORT_DisableEFTDetectInterrupts(PORT_Type *base, uint32_t interrupt) -{ - base->EDIER &= ~interrupt; -} - -/*! - * @brief Clear all low EFT detector. - * - * @note : Port B and Port C pins share the same EFT detector clear control from PORTC_EDCR register. Any write to the - * PORTB_EDCR does not take effect. - * @param base PORT peripheral base pointer - * @param interrupt EFT detect interrupt - */ -static inline void PORT_ClearAllLowEFTDetectors(PORT_Type *base) -{ - base->EDCR |= PORT_EDCR_EDLC_MASK; - base->EDCR &= ~PORT_EDCR_EDLC_MASK; -} - -/*! - * @brief Clear all high EFT detector. - * - * @param base PORT peripheral base pointer - * @param interrupt EFT detect interrupt - */ -static inline void PORT_ClearAllHighEFTDetectors(PORT_Type *base) -{ - base->EDCR |= PORT_EDCR_EDHC_MASK; - base->EDCR &= ~PORT_EDCR_EDHC_MASK; -} -#endif /* FSL_FEATURE_PORT_SUPPORT_EFT */ - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_PORT_H_ */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_rcm.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_rcm.c deleted file mode 100644 index c3f71582114..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_rcm.c +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2017, 2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_rcm.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.rcm" -#endif - -/*! - * brief Configures the reset pin filter. - * - * This function sets the reset pin filter including the filter source, filter - * width, and so on. - * - * param base RCM peripheral base address. - * param config Pointer to the configuration structure. - */ -void RCM_ConfigureResetPinFilter(RCM_Type *base, const rcm_reset_pin_filter_config_t *config) -{ - assert(NULL != config); - -#if (defined(FSL_FEATURE_RCM_REG_WIDTH) && (FSL_FEATURE_RCM_REG_WIDTH == 32)) - uint32_t reg; - - reg = (((uint32_t)config->enableFilterInStop << RCM_RPC_RSTFLTSS_SHIFT) | (uint32_t)config->filterInRunWait); - if (config->filterInRunWait == kRCM_FilterBusClock) - { - reg |= ((uint32_t)config->busClockFilterCount << RCM_RPC_RSTFLTSEL_SHIFT); - } - base->RPC = reg; -#else - base->RPFC = (((uint8_t)config->enableFilterInStop << RCM_RPFC_RSTFLTSS_SHIFT) | (uint8_t)config->filterInRunWait); - if (config->filterInRunWait == kRCM_FilterBusClock) - { - base->RPFW = config->busClockFilterCount; - } -#endif /* FSL_FEATURE_RCM_REG_WIDTH */ -} - -#if (defined(FSL_FEATURE_RCM_HAS_BOOTROM) && FSL_FEATURE_RCM_HAS_BOOTROM) -/*! - * brief Forces the boot from ROM. - * - * This function forces booting from ROM during all subsequent system resets. - * - * param base RCM peripheral base address. - * param config Boot configuration. - */ -void RCM_SetForceBootRomSource(RCM_Type *base, rcm_boot_rom_config_t config) -{ - uint32_t reg; - - reg = base->FM; - reg &= ~RCM_FM_FORCEROM_MASK; - reg |= ((uint32_t)config << RCM_FM_FORCEROM_SHIFT); -#if (defined(FSL_FEATURE_RCM_REG_WIDTH) && (FSL_FEATURE_RCM_REG_WIDTH == 32)) - base->FM = reg; -#else - base->FM = (uint8_t)reg; -#endif /* FSL_FEATURE_RCM_REG_WIDTH == 32 */ -} -#endif /* #if FSL_FEATURE_RCM_HAS_BOOTROM */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_rcm.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_rcm.h deleted file mode 100644 index 7709ab84a56..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_rcm.h +++ /dev/null @@ -1,412 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2017, 2019-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_RCM_H_ -#define FSL_RCM_H_ - -#include "fsl_common.h" - -/*! @addtogroup rcm */ -/*! @{*/ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief RCM driver version 2.0.4. */ -#define FSL_RCM_DRIVER_VERSION (MAKE_VERSION(2, 0, 4)) -/*! @} */ - -/*! - * @brief System Reset Source Name definitions - */ -typedef enum _rcm_reset_source -{ -#if (defined(FSL_FEATURE_RCM_REG_WIDTH) && (FSL_FEATURE_RCM_REG_WIDTH == 32)) -/* RCM register bit width is 32. */ -#if (defined(FSL_FEATURE_RCM_HAS_WAKEUP) && FSL_FEATURE_RCM_HAS_WAKEUP) - kRCM_SourceWakeup = RCM_SRS_WAKEUP_MASK, /*!< Low-leakage wakeup reset */ -#endif - kRCM_SourceLvd = RCM_SRS_LVD_MASK, /*!< Low-voltage detect reset */ -#if (defined(FSL_FEATURE_RCM_HAS_LOC) && FSL_FEATURE_RCM_HAS_LOC) - kRCM_SourceLoc = RCM_SRS_LOC_MASK, /*!< Loss of clock reset */ -#endif /* FSL_FEATURE_RCM_HAS_LOC */ -#if (defined(FSL_FEATURE_RCM_HAS_LOL) && FSL_FEATURE_RCM_HAS_LOL) - kRCM_SourceLol = RCM_SRS_LOL_MASK, /*!< Loss of lock reset */ -#endif /* FSL_FEATURE_RCM_HAS_LOL */ - kRCM_SourceWdog = RCM_SRS_WDOG_MASK, /*!< Watchdog reset */ - kRCM_SourcePin = RCM_SRS_PIN_MASK, /*!< External pin reset */ - kRCM_SourcePor = RCM_SRS_POR_MASK, /*!< Power on reset */ -#if (defined(FSL_FEATURE_RCM_HAS_JTAG) && FSL_FEATURE_RCM_HAS_JTAG) - kRCM_SourceJtag = RCM_SRS_JTAG_MASK, /*!< JTAG generated reset */ -#endif /* FSL_FEATURE_RCM_HAS_JTAG */ - kRCM_SourceLockup = RCM_SRS_LOCKUP_MASK, /*!< Core lock up reset */ - kRCM_SourceSw = RCM_SRS_SW_MASK, /*!< Software reset */ -#if (defined(FSL_FEATURE_RCM_HAS_MDM_AP) && FSL_FEATURE_RCM_HAS_MDM_AP) - kRCM_SourceMdmap = RCM_SRS_MDM_AP_MASK, /*!< MDM-AP system reset */ -#endif /* FSL_FEATURE_RCM_HAS_MDM_AP */ -#if (defined(FSL_FEATURE_RCM_HAS_EZPORT) && FSL_FEATURE_RCM_HAS_EZPORT) - kRCM_SourceEzpt = RCM_SRS_EZPT_MASK, /*!< EzPort reset */ -#endif /* FSL_FEATURE_RCM_HAS_EZPORT */ - kRCM_SourceSackerr = RCM_SRS_SACKERR_MASK, /*!< Parameter could get all reset flags */ - -#else /* (FSL_FEATURE_RCM_REG_WIDTH == 32) */ -/* RCM register bit width is 8. */ -#if (defined(FSL_FEATURE_RCM_HAS_WAKEUP) && FSL_FEATURE_RCM_HAS_WAKEUP) - kRCM_SourceWakeup = RCM_SRS0_WAKEUP_MASK, /*!< Low-leakage wakeup reset */ -#endif - kRCM_SourceLvd = RCM_SRS0_LVD_MASK, /*!< Low-voltage detect reset */ -#if (defined(FSL_FEATURE_RCM_HAS_LOC) && FSL_FEATURE_RCM_HAS_LOC) - kRCM_SourceLoc = RCM_SRS0_LOC_MASK, /*!< Loss of clock reset */ -#endif /* FSL_FEATURE_RCM_HAS_LOC */ -#if (defined(FSL_FEATURE_RCM_HAS_LOL) && FSL_FEATURE_RCM_HAS_LOL) - kRCM_SourceLol = RCM_SRS0_LOL_MASK, /*!< Loss of lock reset */ -#endif /* FSL_FEATURE_RCM_HAS_LOL */ - kRCM_SourceWdog = RCM_SRS0_WDOG_MASK, /*!< Watchdog reset */ - kRCM_SourcePin = RCM_SRS0_PIN_MASK, /*!< External pin reset */ - kRCM_SourcePor = RCM_SRS0_POR_MASK, /*!< Power on reset */ -#if (defined(FSL_FEATURE_RCM_HAS_JTAG) && FSL_FEATURE_RCM_HAS_JTAG) - kRCM_SourceJtag = RCM_SRS1_JTAG_MASK << 8U, /*!< JTAG generated reset */ -#endif /* FSL_FEATURE_RCM_HAS_JTAG */ - kRCM_SourceLockup = RCM_SRS1_LOCKUP_MASK << 8U, /*!< Core lock up reset */ - kRCM_SourceSw = RCM_SRS1_SW_MASK << 8U, /*!< Software reset */ -#if (defined(FSL_FEATURE_RCM_HAS_MDM_AP) && FSL_FEATURE_RCM_HAS_MDM_AP) - kRCM_SourceMdmap = RCM_SRS1_MDM_AP_MASK << 8U, /*!< MDM-AP system reset */ -#endif /* FSL_FEATURE_RCM_HAS_MDM_AP */ -#if (defined(FSL_FEATURE_RCM_HAS_EZPORT) && FSL_FEATURE_RCM_HAS_EZPORT) - kRCM_SourceEzpt = RCM_SRS1_EZPT_MASK << 8U, /*!< EzPort reset */ -#endif /* FSL_FEATURE_RCM_HAS_EZPORT */ - kRCM_SourceSackerr = RCM_SRS1_SACKERR_MASK << 8U, /*!< Parameter could get all reset flags */ -#endif /* (FSL_FEATURE_RCM_REG_WIDTH == 32) */ - kRCM_SourceAll = (int)0xffffffffU, -} rcm_reset_source_t; - -/*! - * @brief Reset pin filter select in Run and Wait modes. - */ -typedef enum _rcm_run_wait_filter_mode -{ - kRCM_FilterDisable = 0U, /*!< All filtering disabled */ - kRCM_FilterBusClock = 1U, /*!< Bus clock filter enabled */ - kRCM_FilterLpoClock = 2U /*!< LPO clock filter enabled */ -} rcm_run_wait_filter_mode_t; - -#if (defined(FSL_FEATURE_RCM_HAS_BOOTROM) && FSL_FEATURE_RCM_HAS_BOOTROM) -/*! - * @brief Boot from ROM configuration. - */ -typedef enum _rcm_boot_rom_config -{ - kRCM_BootFlash = 0U, /*!< Boot from flash */ - kRCM_BootRomCfg0 = 1U, /*!< Boot from boot ROM due to BOOTCFG0 */ - kRCM_BootRomFopt = 2U, /*!< Boot from boot ROM due to FOPT[7] */ - kRCM_BootRomBoth = 3U /*!< Boot from boot ROM due to both BOOTCFG0 and FOPT[7] */ -} rcm_boot_rom_config_t; -#endif /* FSL_FEATURE_RCM_HAS_BOOTROM */ - -#if (defined(FSL_FEATURE_RCM_HAS_SRIE) && FSL_FEATURE_RCM_HAS_SRIE) -/*! - * @brief Maximum delay time from interrupt asserts to system reset. - */ -typedef enum _rcm_reset_delay -{ - kRCM_ResetDelay8Lpo = 0U, /*!< Delay 8 LPO cycles. */ - kRCM_ResetDelay32Lpo = 1U, /*!< Delay 32 LPO cycles. */ - kRCM_ResetDelay128Lpo = 2U, /*!< Delay 128 LPO cycles. */ - kRCM_ResetDelay512Lpo = 3U /*!< Delay 512 LPO cycles. */ -} rcm_reset_delay_t; - -/*! - * @brief System reset interrupt enable bit definitions. - */ -typedef enum _rcm_interrupt_enable -{ - kRCM_IntNone = 0U, /*!< No interrupt enabled. */ - kRCM_IntLossOfClk = RCM_SRIE_LOC_MASK, /*!< Loss of clock interrupt. */ - kRCM_IntLossOfLock = RCM_SRIE_LOL_MASK, /*!< Loss of lock interrupt. */ - kRCM_IntWatchDog = RCM_SRIE_WDOG_MASK, /*!< Watch dog interrupt. */ - kRCM_IntExternalPin = RCM_SRIE_PIN_MASK, /*!< External pin interrupt. */ - kRCM_IntGlobal = RCM_SRIE_GIE_MASK, /*!< Global interrupts. */ - kRCM_IntCoreLockup = RCM_SRIE_LOCKUP_MASK, /*!< Core lock up interrupt */ - kRCM_IntSoftware = RCM_SRIE_SW_MASK, /*!< software interrupt */ - kRCM_IntStopModeAckErr = RCM_SRIE_SACKERR_MASK, /*!< Stop mode ACK error interrupt. */ -#if (defined(FSL_FEATURE_RCM_HAS_CORE1) && FSL_FEATURE_RCM_HAS_CORE1) - kRCM_IntCore1 = RCM_SRIE_CORE1_MASK, /*!< Core 1 interrupt. */ -#endif - kRCM_IntAll = RCM_SRIE_LOC_MASK /*!< Enable all interrupts. */ - | RCM_SRIE_LOL_MASK | RCM_SRIE_WDOG_MASK | RCM_SRIE_PIN_MASK | RCM_SRIE_GIE_MASK | - RCM_SRIE_LOCKUP_MASK | RCM_SRIE_SW_MASK | RCM_SRIE_SACKERR_MASK -#if (defined(FSL_FEATURE_RCM_HAS_CORE1) && FSL_FEATURE_RCM_HAS_CORE1) - | RCM_SRIE_CORE1_MASK -#endif -} rcm_interrupt_enable_t; -#endif /* FSL_FEATURE_RCM_HAS_SRIE */ - -#if (defined(FSL_FEATURE_RCM_HAS_VERID) && FSL_FEATURE_RCM_HAS_VERID) -/*! - * @brief IP version ID definition. - */ -typedef struct _rcm_version_id -{ - uint16_t feature; /*!< Feature Specification Number. */ - uint8_t minor; /*!< Minor version number. */ - uint8_t major; /*!< Major version number. */ -} rcm_version_id_t; -#endif - -/*! - * @brief Reset pin filter configuration. - */ -typedef struct _rcm_reset_pin_filter_config -{ - bool enableFilterInStop; /*!< Reset pin filter select in stop mode. */ - rcm_run_wait_filter_mode_t filterInRunWait; /*!< Reset pin filter in run/wait mode. */ - uint8_t busClockFilterCount; /*!< Reset pin bus clock filter width. */ -} rcm_reset_pin_filter_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus*/ - -/*! @name Reset Control Module APIs*/ -/*! @{ */ - -#if (defined(FSL_FEATURE_RCM_HAS_VERID) && FSL_FEATURE_RCM_HAS_VERID) -/*! - * @brief Gets the RCM version ID. - * - * This function gets the RCM version ID including the major version number, - * the minor version number, and the feature specification number. - * - * @param base RCM peripheral base address. - * @param versionId Pointer to the version ID structure. - */ -static inline void RCM_GetVersionId(RCM_Type *base, rcm_version_id_t *versionId) -{ - uint32_t tmp = base->VERID; - - versionId->feature = (uint16_t)(tmp & 0x0000FFFFUL); - versionId->minor = (uint8_t)((tmp & 0x00FF0000UL) >> 16U); - versionId->major = (uint8_t)((tmp & 0x000000FFUL) >> 24U); -} -#endif - -#if (defined(FSL_FEATURE_RCM_HAS_PARAM) && FSL_FEATURE_RCM_HAS_PARAM) -/*! - * @brief Gets the reset source implemented status. - * - * This function gets the RCM parameter that indicates whether the corresponding reset source is implemented. - * Use source masks defined in the rcm_reset_source_t to get the desired source status. - * - * This is an example. - * @code - * uint32_t status; - * - * To test whether the MCU is reset using Watchdog. - * status = RCM_GetResetSourceImplementedStatus(RCM) & (kRCM_SourceWdog | kRCM_SourcePin); - * @endcode - * - * @param base RCM peripheral base address. - * @return All reset source implemented status bit map. - */ -static inline uint32_t RCM_GetResetSourceImplementedStatus(RCM_Type *base) -{ - return base->PARAM; -} -#endif /* FSL_FEATURE_RCM_HAS_PARAM */ - -/*! - * @brief Gets the reset source status which caused a previous reset. - * - * This function gets the current reset source status. Use source masks - * defined in the rcm_reset_source_t to get the desired source status. - * - * This is an example. - * @code - * uint32_t resetStatus; - * - * To get all reset source statuses. - * resetStatus = RCM_GetPreviousResetSources(RCM) & kRCM_SourceAll; - * - * To test whether the MCU is reset using Watchdog. - * resetStatus = RCM_GetPreviousResetSources(RCM) & kRCM_SourceWdog; - * - * To test multiple reset sources. - * resetStatus = RCM_GetPreviousResetSources(RCM) & (kRCM_SourceWdog | kRCM_SourcePin); - * @endcode - * - * @param base RCM peripheral base address. - * @return All reset source status bit map. - */ -static inline uint32_t RCM_GetPreviousResetSources(RCM_Type *base) -{ -#if (defined(FSL_FEATURE_RCM_REG_WIDTH) && (FSL_FEATURE_RCM_REG_WIDTH == 32)) - return base->SRS; -#else - uint8_t tmpSrs0 = base->SRS0; - uint8_t tmpSrs1 = base->SRS1; - return (uint32_t)((uint32_t)tmpSrs0 | ((uint32_t)tmpSrs1 << 8U)); -#endif /* (FSL_FEATURE_RCM_REG_WIDTH == 32) */ -} - -#if (defined(FSL_FEATURE_RCM_HAS_SSRS) && FSL_FEATURE_RCM_HAS_SSRS) -/*! - * @brief Gets the sticky reset source status. - * - * This function gets the current reset source status that has not been cleared - * by software for a specific source. - * - * This is an example. - * @code - * uint32_t resetStatus; - * - * To get all reset source statuses. - * resetStatus = RCM_GetStickyResetSources(RCM) & kRCM_SourceAll; - * - * To test whether the MCU is reset using Watchdog. - * resetStatus = RCM_GetStickyResetSources(RCM) & kRCM_SourceWdog; - * - * To test multiple reset sources. - * resetStatus = RCM_GetStickyResetSources(RCM) & (kRCM_SourceWdog | kRCM_SourcePin); - * @endcode - * - * @param base RCM peripheral base address. - * @return All reset source status bit map. - */ -static inline uint32_t RCM_GetStickyResetSources(RCM_Type *base) -{ -#if (defined(FSL_FEATURE_RCM_REG_WIDTH) && (FSL_FEATURE_RCM_REG_WIDTH == 32)) - return base->SSRS; -#else - return (base->SSRS0 | ((uint32_t)base->SSRS1 << 8U)); -#endif /* (FSL_FEATURE_RCM_REG_WIDTH == 32) */ -} - -/*! - * @brief Clears the sticky reset source status. - * - * This function clears the sticky system reset flags indicated by source masks. - * - * This is an example. - * @code - * Clears multiple reset sources. - * RCM_ClearStickyResetSources(kRCM_SourceWdog | kRCM_SourcePin); - * @endcode - * - * @param base RCM peripheral base address. - * @param sourceMasks reset source status bit map - */ -static inline void RCM_ClearStickyResetSources(RCM_Type *base, uint32_t sourceMasks) -{ -#if (defined(FSL_FEATURE_RCM_REG_WIDTH) && (FSL_FEATURE_RCM_REG_WIDTH == 32)) - base->SSRS = sourceMasks; -#else - base->SSRS0 = (uint8_t)(sourceMasks & 0xffU); - base->SSRS1 = (uint8_t)((sourceMasks >> 8U) & 0xffU); -#endif /* (FSL_FEATURE_RCM_REG_WIDTH == 32) */ -} -#endif /* FSL_FEATURE_RCM_HAS_SSRS */ - -/*! - * @brief Configures the reset pin filter. - * - * This function sets the reset pin filter including the filter source, filter - * width, and so on. - * - * @param base RCM peripheral base address. - * @param config Pointer to the configuration structure. - */ -void RCM_ConfigureResetPinFilter(RCM_Type *base, const rcm_reset_pin_filter_config_t *config); - -#if (defined(FSL_FEATURE_RCM_HAS_EZPMS) && FSL_FEATURE_RCM_HAS_EZPMS) -/*! - * @brief Gets the EZP_MS_B pin assert status. - * - * This function gets the easy port mode status (EZP_MS_B) pin assert status. - * - * @param base RCM peripheral base address. - * @return status true - asserted, false - reasserted - */ -static inline bool RCM_GetEasyPortModePinStatus(RCM_Type *base) -{ - return (bool)(base->MR & RCM_MR_EZP_MS_MASK); -} -#endif /* FSL_FEATURE_RCM_HAS_EZPMS */ - -#if (defined(FSL_FEATURE_RCM_HAS_BOOTROM) && FSL_FEATURE_RCM_HAS_BOOTROM) -/*! - * @brief Gets the ROM boot source. - * - * This function gets the ROM boot source during the last chip reset. - * - * @param base RCM peripheral base address. - * @return The ROM boot source. - */ -static inline rcm_boot_rom_config_t RCM_GetBootRomSource(RCM_Type *base) -{ - return (rcm_boot_rom_config_t)(uint8_t)((base->MR & RCM_MR_BOOTROM_MASK) >> RCM_MR_BOOTROM_SHIFT); -} - -/*! - * @brief Clears the ROM boot source flag. - * - * This function clears the ROM boot source flag. - * - * @param base Register base address of RCM - */ -static inline void RCM_ClearBootRomSource(RCM_Type *base) -{ - base->MR |= RCM_MR_BOOTROM_MASK; -} - -/*! - * @brief Forces the boot from ROM. - * - * This function forces booting from ROM during all subsequent system resets. - * - * @param base RCM peripheral base address. - * @param config Boot configuration. - */ -void RCM_SetForceBootRomSource(RCM_Type *base, rcm_boot_rom_config_t config); -#endif /* FSL_FEATURE_RCM_HAS_BOOTROM */ - -#if (defined(FSL_FEATURE_RCM_HAS_SRIE) && FSL_FEATURE_RCM_HAS_SRIE) -/*! - * @brief Sets the system reset interrupt configuration. - * - * For a graceful shut down, the RCM supports delaying the assertion of the system - * reset for a period of time when the reset interrupt is generated. This function - * can be used to enable the interrupt and the delay period. The interrupts - * are passed in as bit mask. See rcm_int_t for details. For example, to - * delay a reset for 512 LPO cycles after the WDOG timeout or loss-of-clock occurs, - * configure as follows: - * RCM_SetSystemResetInterruptConfig(kRCM_IntWatchDog | kRCM_IntLossOfClk, kRCM_ResetDelay512Lpo); - * - * @param base RCM peripheral base address. - * @param intMask Bit mask of the system reset interrupts to enable. See - * rcm_interrupt_enable_t for details. - * @param delay Bit mask of the system reset interrupts to enable. - */ -static inline void RCM_SetSystemResetInterruptConfig(RCM_Type *base, uint32_t intMask, rcm_reset_delay_t delay) -{ - base->SRIE = (intMask | (uint32_t)delay); -} -#endif /* FSL_FEATURE_RCM_HAS_SRIE */ -/*! @} */ - -#if defined(__cplusplus) -} -#endif /* __cplusplus*/ - -/*! @}*/ - -#endif /* FSL_RCM_H_ */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_rtc.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_rtc.c deleted file mode 100644 index 4bc2d38fd1e..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_rtc.c +++ /dev/null @@ -1,886 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2019 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_rtc.h" - -/* - * $Coverage Justification Reference$ - * - * $Justification rtc_c_ref_1$ - * Month is always under 13 and checked by assert. - * - * $Justification rtc_c_ref_2$ - * Can't simulate tamper in unit test environment. - * - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.rtc" -#endif - -#define SECONDS_IN_A_DAY (86400U) -#define SECONDS_IN_A_HOUR (3600U) -#define SECONDS_IN_A_MINUTE (60U) -#define DAYS_IN_A_YEAR (365U) -#define YEAR_RANGE_START (1970U) -#define YEAR_RANGE_END (2099U) - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Checks whether the date and time passed in is valid - * - * @param datetime Pointer to structure where the date and time details are stored - * - * @return Returns false if the date & time details are out of range; true if in range - */ -static bool RTC_CheckDatetimeFormat(const rtc_datetime_t *datetime); - -/*! - * @brief Converts time data from datetime to seconds - * - * @param datetime Pointer to datetime structure where the date and time details are stored - * - * @return The result of the conversion in seconds - */ -static uint32_t RTC_ConvertDatetimeToSeconds(const rtc_datetime_t *datetime); - -/*! - * @brief Converts time data from seconds to a datetime structure - * - * @param seconds Seconds value that needs to be converted to datetime format - * @param datetime Pointer to the datetime structure where the result of the conversion is stored - */ -static void RTC_ConvertSecondsToDatetime(uint32_t seconds, rtc_datetime_t *datetime); - -/******************************************************************************* - * Code - ******************************************************************************/ -static bool RTC_CheckDatetimeFormat(const rtc_datetime_t *datetime) -{ - assert(NULL != datetime); - - /* Table of days in a month for a non leap year. First entry in the table is not used, - * valid months start from 1 - */ - uint8_t daysPerMonth[] = {0U, 31U, 28U, 31U, 30U, 31U, 30U, 31U, 31U, 30U, 31U, 30U, 31U}; - - /* Check year, month, hour, minute, seconds */ - if ((datetime->year < YEAR_RANGE_START) || (datetime->year > YEAR_RANGE_END) || (datetime->month > 12U) || - (datetime->month < 1U) || (datetime->hour >= 24U) || (datetime->minute >= 60U) || (datetime->second >= 60U)) - { - /* If not correct then error*/ - return false; - } - - /* Adjust the days in February for a leap year */ - if ((((datetime->year & 3U) == 0U) && (datetime->year % 100U != 0U)) || (datetime->year % 400U == 0U)) - { - daysPerMonth[2] = 29U; - } - - /* Check the validity of the day */ - if ((datetime->day > daysPerMonth[datetime->month]) || (datetime->day < 1U)) - { - return false; - } - - return true; -} - -static uint32_t RTC_ConvertDatetimeToSeconds(const rtc_datetime_t *datetime) -{ - assert(NULL != datetime); - - /* Number of days from begin of the non Leap-year*/ - /* Number of days from begin of the non Leap-year*/ - uint16_t monthDays[] = {0U, 0U, 31U, 59U, 90U, 120U, 151U, 181U, 212U, 243U, 273U, 304U, 334U}; - uint32_t seconds; - - /* Compute number of days from 1970 till given year*/ - seconds = ((uint32_t)datetime->year - 1970U) * DAYS_IN_A_YEAR; - /* Add leap year days */ - seconds += (((uint32_t)datetime->year / 4U) - (1970U / 4U)); - /* Add number of days till given month*/ - seconds += monthDays[datetime->month]; - /* Add days in given month. We subtract the current day as it is - * represented in the hours, minutes and seconds field*/ - seconds += ((uint32_t)datetime->day - 1U); - /* For leap year if month less than or equal to Febraury, decrement day counter*/ - if ((0U == (datetime->year & 3U)) && (datetime->month <= 2U)) - { - seconds--; - } - - seconds = (seconds * SECONDS_IN_A_DAY) + ((uint32_t)datetime->hour * SECONDS_IN_A_HOUR) + - ((uint32_t)datetime->minute * SECONDS_IN_A_MINUTE) + datetime->second; - - return seconds; -} - -static void RTC_ConvertSecondsToDatetime(uint32_t seconds, rtc_datetime_t *datetime) -{ - assert(NULL != datetime); - - uint32_t x; - uint32_t secondsRemaining, days; - uint16_t daysInYear; - /* Table of days in a month for a non leap year. First entry in the table is not used, - * valid months start from 1 - */ - uint8_t daysPerMonth[] = {0U, 31U, 28U, 31U, 30U, 31U, 30U, 31U, 31U, 30U, 31U, 30U, 31U}; - - /* Start with the seconds value that is passed in to be converted to date time format */ - secondsRemaining = seconds; - - /* Calcuate the number of days, we add 1 for the current day which is represented in the - * hours and seconds field - */ - days = secondsRemaining / SECONDS_IN_A_DAY + 1U; - - /* Update seconds left*/ - secondsRemaining = secondsRemaining % SECONDS_IN_A_DAY; - - /* Calculate the datetime hour, minute and second fields */ - datetime->hour = (uint8_t)(secondsRemaining / SECONDS_IN_A_HOUR); - secondsRemaining = secondsRemaining % SECONDS_IN_A_HOUR; - datetime->minute = (uint8_t)(secondsRemaining / 60U); - datetime->second = (uint8_t)(secondsRemaining % SECONDS_IN_A_MINUTE); - - /* Calculate year */ - daysInYear = DAYS_IN_A_YEAR; - datetime->year = YEAR_RANGE_START; - while (days > daysInYear) - { - /* Decrease day count by a year and increment year by 1 */ - days -= daysInYear; - datetime->year++; - - /* Adjust the number of days for a leap year */ - if (0U != (datetime->year & 3U)) - { - daysInYear = DAYS_IN_A_YEAR; - } - else - { - daysInYear = DAYS_IN_A_YEAR + 1U; - } - } - - /* Adjust the days in February for a leap year */ - if (0U == (datetime->year & 3U)) - { - daysPerMonth[2] = 29U; - } - - /* - * $Branch Coverage Justification$ - * (x > 12U) not covered. $ref rtc_c_ref_1$. - */ - for (x = 1U; x <= 12U; x++) - { - if (days <= daysPerMonth[x]) - { - datetime->month = (uint8_t)x; - break; - } - else - { - days -= daysPerMonth[x]; - } - } - - datetime->day = (uint8_t)days; -} - -/*! - * brief Ungates the RTC clock and configures the peripheral for basic operation. - * - * This function issues a software reset if the timer invalid flag is set. - * - * note This API should be called at the beginning of the application using the RTC driver. - * - * param base RTC peripheral base address - * param config Pointer to the user's RTC configuration structure. - */ -void RTC_Init(RTC_Type *base, const rtc_config_t *config) -{ - assert(NULL != config); - - uint32_t reg; - -#if defined(RTC_CLOCKS) -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_EnableClock(kCLOCK_Rtc0); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* RTC_CLOCKS */ - - /* Issue a software reset if timer is invalid */ - if ((uint32_t)kRTC_TimeInvalidFlag == (RTC_GetStatusFlags(base) & (uint32_t)kRTC_TimeInvalidFlag)) - { - RTC_Reset(base); - } - - reg = base->CR; -/* Setup the update mode and supervisor access mode */ -#if !(defined(FSL_FEATURE_RTC_HAS_NO_CR_OSCE) && FSL_FEATURE_RTC_HAS_NO_CR_OSCE) - reg &= ~(RTC_CR_UM_MASK | RTC_CR_SUP_MASK); - reg |= RTC_CR_UM(config->updateMode) | RTC_CR_SUP(config->supervisorAccess); -#else - reg &= ~RTC_CR_UM_MASK; - reg |= RTC_CR_UM(config->updateMode); -#endif - -#if defined(FSL_FEATURE_RTC_HAS_WAKEUP_PIN_SELECTION) && FSL_FEATURE_RTC_HAS_WAKEUP_PIN_SELECTION - /* Setup the wakeup pin select */ - reg &= ~(RTC_CR_WPS_MASK); - reg |= RTC_CR_WPS(config->wakeupSelect); -#endif /* FSL_FEATURE_RTC_HAS_WAKEUP_PIN */ - base->CR = reg; - - /* Configure the RTC time compensation register */ - base->TCR = (RTC_TCR_CIR(config->compensationInterval) | RTC_TCR_TCR(config->compensationTime)); - -#if defined(FSL_FEATURE_RTC_HAS_TSIC) && FSL_FEATURE_RTC_HAS_TSIC - /* Configure RTC timer seconds interrupt to be generated once per second */ - base->IER &= ~(RTC_IER_TSIC_MASK | RTC_IER_TSIE_MASK); -#endif -} - -/*! - * brief Fills in the RTC config struct with the default settings. - * - * The default values are as follows. - * code - * config->wakeupSelect = false; - * config->updateMode = false; - * config->supervisorAccess = false; - * config->compensationInterval = 0; - * config->compensationTime = 0; - * endcode - * param config Pointer to the user's RTC configuration structure. - */ -void RTC_GetDefaultConfig(rtc_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - /* Wakeup pin will assert if the RTC interrupt asserts or if the wakeup pin is turned on */ - config->wakeupSelect = false; - /* Registers cannot be written when locked */ - config->updateMode = false; - /* Non-supervisor mode write accesses are not supported and will generate a bus error */ - config->supervisorAccess = false; - /* Compensation interval used by the crystal compensation logic */ - config->compensationInterval = 0; - /* Compensation time used by the crystal compensation logic */ - config->compensationTime = 0; -} - -/*! - * brief Sets the RTC date and time according to the given time structure. - * - * The RTC counter must be stopped prior to calling this function because writes to the RTC - * seconds register fail if the RTC counter is running. - * - * param base RTC peripheral base address - * param datetime Pointer to the structure where the date and time details are stored. - * - * return kStatus_Success: Success in setting the time and starting the RTC - * kStatus_InvalidArgument: Error because the datetime format is incorrect - */ -status_t RTC_SetDatetime(RTC_Type *base, const rtc_datetime_t *datetime) -{ - assert(NULL != datetime); - - /* Return error if the time provided is not valid */ - if (!(RTC_CheckDatetimeFormat(datetime))) - { - return kStatus_InvalidArgument; - } - - /* Set time in seconds */ - base->TSR = RTC_ConvertDatetimeToSeconds(datetime); - - return kStatus_Success; -} - -/*! - * brief Gets the RTC time and stores it in the given time structure. - * - * param base RTC peripheral base address - * param datetime Pointer to the structure where the date and time details are stored. - */ -void RTC_GetDatetime(RTC_Type *base, rtc_datetime_t *datetime) -{ - assert(NULL != datetime); - - uint32_t seconds = 0; - - seconds = base->TSR; - RTC_ConvertSecondsToDatetime(seconds, datetime); -} - -/*! - * brief Sets the RTC alarm time. - * - * The function checks whether the specified alarm time is greater than the present - * time. If not, the function does not set the alarm and returns an error. - * - * param base RTC peripheral base address - * param alarmTime Pointer to the structure where the alarm time is stored. - * - * return kStatus_Success: success in setting the RTC alarm - * kStatus_InvalidArgument: Error because the alarm datetime format is incorrect - * kStatus_Fail: Error because the alarm time has already passed - */ -status_t RTC_SetAlarm(RTC_Type *base, const rtc_datetime_t *alarmTime) -{ - assert(NULL != alarmTime); - - uint32_t alarmSeconds = 0; - uint32_t currSeconds = 0; - - /* Return error if the alarm time provided is not valid */ - if (!(RTC_CheckDatetimeFormat(alarmTime))) - { - return kStatus_InvalidArgument; - } - - alarmSeconds = RTC_ConvertDatetimeToSeconds(alarmTime); - - /* Get the current time */ - currSeconds = base->TSR; - - /* Return error if the alarm time has passed */ - if (alarmSeconds < currSeconds) - { - return kStatus_Fail; - } - - /* Set alarm in seconds*/ - base->TAR = alarmSeconds; - - return kStatus_Success; -} - -/*! - * brief Returns the RTC alarm time. - * - * param base RTC peripheral base address - * param datetime Pointer to the structure where the alarm date and time details are stored. - */ -void RTC_GetAlarm(RTC_Type *base, rtc_datetime_t *datetime) -{ - assert(NULL != datetime); - - uint32_t alarmSeconds = 0; - - /* Get alarm in seconds */ - alarmSeconds = base->TAR; - - RTC_ConvertSecondsToDatetime(alarmSeconds, datetime); -} - -/*! - * brief Enables the selected RTC interrupts. - * - * param base RTC peripheral base address - * param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::rtc_interrupt_enable_t - */ -void RTC_EnableInterrupts(RTC_Type *base, uint32_t mask) -{ - uint32_t tmp32 = 0U; - - /* RTC_IER */ - if (0U != ((uint32_t)kRTC_TimeInvalidInterruptEnable & mask)) - { - tmp32 |= RTC_IER_TIIE_MASK; - } - if (0U != ((uint32_t)kRTC_TimeOverflowInterruptEnable & mask)) - { - tmp32 |= RTC_IER_TOIE_MASK; - } - if (0U != ((uint32_t)kRTC_AlarmInterruptEnable & mask)) - { - tmp32 |= RTC_IER_TAIE_MASK; - } - if (0U != ((uint32_t)kRTC_SecondsInterruptEnable & mask)) - { - tmp32 |= RTC_IER_TSIE_MASK; - } -#if defined(FSL_FEATURE_RTC_HAS_MONOTONIC) && (FSL_FEATURE_RTC_HAS_MONOTONIC) - if (0U != ((uint32_t)kRTC_MonotonicOverflowInterruptEnable & mask)) - { - tmp32 |= RTC_IER_MOIE_MASK; - } -#endif /* FSL_FEATURE_RTC_HAS_MONOTONIC */ - base->IER |= tmp32; - -#if (defined(FSL_FEATURE_RTC_HAS_TIR) && FSL_FEATURE_RTC_HAS_TIR) - tmp32 = 0U; - - /* RTC_TIR */ - if (0U != ((uint32_t)kRTC_TestModeInterruptEnable & mask)) - { - tmp32 |= RTC_TIR_TMIE_MASK; - } - if (0U != ((uint32_t)kRTC_FlashSecurityInterruptEnable & mask)) - { - tmp32 |= RTC_TIR_FSIE_MASK; - } -#if (defined(FSL_FEATURE_RTC_HAS_TIR_TPIE) && FSL_FEATURE_RTC_HAS_TIR_TPIE) - if (0U != ((uint32_t)kRTC_TamperPinInterruptEnable & mask)) - { - tmp32 |= RTC_TIR_TPIE_MASK; - } -#endif /* FSL_FEATURE_RTC_HAS_TIR_TPIE */ -#if (defined(FSL_FEATURE_RTC_HAS_TIR_SIE) && FSL_FEATURE_RTC_HAS_TIR_SIE) - if (0U != ((uint32_t)kRTC_SecurityModuleInterruptEnable & mask)) - { - tmp32 |= RTC_TIR_SIE_MASK; - } -#endif /* FSL_FEATURE_RTC_HAS_TIR_SIE */ -#if (defined(FSL_FEATURE_RTC_HAS_TIR_LCIE) && FSL_FEATURE_RTC_HAS_TIR_LCIE) - if (0U != ((uint32_t)kRTC_LossOfClockInterruptEnable & mask)) - { - tmp32 |= RTC_TIR_LCIE_MASK; - } -#endif /* FSL_FEATURE_RTC_HAS_TIR_LCIE */ - base->TIR |= tmp32; -#endif /* FSL_FEATURE_RTC_HAS_TIR */ -} - -/*! - * brief Disables the selected RTC interrupts. - * - * param base RTC peripheral base address - * param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::rtc_interrupt_enable_t - */ -void RTC_DisableInterrupts(RTC_Type *base, uint32_t mask) -{ - uint32_t tmp32 = 0U; - - /* RTC_IER */ - if (0U != ((uint32_t)kRTC_TimeInvalidInterruptEnable & mask)) - { - tmp32 |= RTC_IER_TIIE_MASK; - } - if (0U != ((uint32_t)kRTC_TimeOverflowInterruptEnable & mask)) - { - tmp32 |= RTC_IER_TOIE_MASK; - } - if (0U != ((uint32_t)kRTC_AlarmInterruptEnable & mask)) - { - tmp32 |= RTC_IER_TAIE_MASK; - } - if (0U != ((uint32_t)kRTC_SecondsInterruptEnable & mask)) - { - tmp32 |= RTC_IER_TSIE_MASK; - } -#if defined(FSL_FEATURE_RTC_HAS_MONOTONIC) && (FSL_FEATURE_RTC_HAS_MONOTONIC) - if (0U != ((uint32_t)kRTC_MonotonicOverflowInterruptEnable & mask)) - { - tmp32 |= RTC_IER_MOIE_MASK; - } -#endif /* FSL_FEATURE_RTC_HAS_MONOTONIC */ - base->IER &= (uint32_t)(~tmp32); - -#if (defined(FSL_FEATURE_RTC_HAS_TIR) && FSL_FEATURE_RTC_HAS_TIR) - tmp32 = 0U; - - /* RTC_TIR */ - if (0U != ((uint32_t)kRTC_TestModeInterruptEnable & mask)) - { - tmp32 |= RTC_TIR_TMIE_MASK; - } - if (0U != ((uint32_t)kRTC_FlashSecurityInterruptEnable & mask)) - { - tmp32 |= RTC_TIR_FSIE_MASK; - } -#if (defined(FSL_FEATURE_RTC_HAS_TIR_TPIE) && FSL_FEATURE_RTC_HAS_TIR_TPIE) - if (0U != ((uint32_t)kRTC_TamperPinInterruptEnable & mask)) - { - tmp32 |= RTC_TIR_TPIE_MASK; - } -#endif /* FSL_FEATURE_RTC_HAS_TIR_TPIE */ -#if (defined(FSL_FEATURE_RTC_HAS_TIR_SIE) && FSL_FEATURE_RTC_HAS_TIR_SIE) - if (0U != ((uint32_t)kRTC_SecurityModuleInterruptEnable & mask)) - { - tmp32 |= RTC_TIR_SIE_MASK; - } -#endif /* FSL_FEATURE_RTC_HAS_TIR_SIE */ -#if (defined(FSL_FEATURE_RTC_HAS_TIR_LCIE) && FSL_FEATURE_RTC_HAS_TIR_LCIE) - if (0U != ((uint32_t)kRTC_LossOfClockInterruptEnable & mask)) - { - tmp32 |= RTC_TIR_LCIE_MASK; - } -#endif /* FSL_FEATURE_RTC_HAS_TIR_LCIE */ - base->TIR &= (uint32_t)(~tmp32); -#endif /* FSL_FEATURE_RTC_HAS_TIR */ -} - -/*! - * brief Gets the enabled RTC interrupts. - * - * param base RTC peripheral base address - * - * return The enabled interrupts. This is the logical OR of members of the - * enumeration ::rtc_interrupt_enable_t - */ -uint32_t RTC_GetEnabledInterrupts(RTC_Type *base) -{ - uint32_t tmp32 = 0U; - - /* RTC_IER */ - if (0U != (RTC_IER_TIIE_MASK & base->IER)) - { - tmp32 |= (uint32_t)kRTC_TimeInvalidInterruptEnable; - } - if (0U != (RTC_IER_TOIE_MASK & base->IER)) - { - tmp32 |= (uint32_t)kRTC_TimeOverflowInterruptEnable; - } - if (0U != (RTC_IER_TAIE_MASK & base->IER)) - { - tmp32 |= (uint32_t)kRTC_AlarmInterruptEnable; - } - if (0U != (RTC_IER_TSIE_MASK & base->IER)) - { - tmp32 |= (uint32_t)kRTC_SecondsInterruptEnable; - } -#if defined(FSL_FEATURE_RTC_HAS_MONOTONIC) && (FSL_FEATURE_RTC_HAS_MONOTONIC) - if (0U != (RTC_IER_MOIE_MASK & base->IER)) - { - tmp32 |= (uint32_t)kRTC_MonotonicOverflowInterruptEnable; - } -#endif /* FSL_FEATURE_RTC_HAS_MONOTONIC */ - -#if (defined(FSL_FEATURE_RTC_HAS_TIR) && FSL_FEATURE_RTC_HAS_TIR) - /* RTC_TIR */ - if (0U != (RTC_TIR_TMIE_MASK & base->TIR)) - { - tmp32 |= (uint32_t)kRTC_TestModeInterruptEnable; - } - if (0U != (RTC_TIR_FSIE_MASK & base->TIR)) - { - tmp32 |= (uint32_t)kRTC_FlashSecurityInterruptEnable; - } -#if (defined(FSL_FEATURE_RTC_HAS_TIR_TPIE) && FSL_FEATURE_RTC_HAS_TIR_TPIE) - if (0U != (RTC_TIR_TPIE_MASK & base->TIR)) - { - tmp32 |= (uint32_t)kRTC_TamperPinInterruptEnable; - } -#endif /* FSL_FEATURE_RTC_HAS_TIR_TPIE */ -#if (defined(FSL_FEATURE_RTC_HAS_TIR_SIE) && FSL_FEATURE_RTC_HAS_TIR_SIE) - if (0U != (RTC_TIR_SIE_MASK & base->TIR)) - { - tmp32 |= (uint32_t)kRTC_SecurityModuleInterruptEnable; - } -#endif /* FSL_FEATURE_RTC_HAS_TIR_SIE */ -#if (defined(FSL_FEATURE_RTC_HAS_TIR_LCIE) && FSL_FEATURE_RTC_HAS_TIR_LCIE) - if (0U != (RTC_TIR_LCIE_MASK & base->TIR)) - { - tmp32 |= (uint32_t)kRTC_LossOfClockInterruptEnable; - } -#endif /* FSL_FEATURE_RTC_HAS_TIR_LCIE */ -#endif /* FSL_FEATURE_RTC_HAS_TIR */ - - return tmp32; -} - -/*! - * brief Gets the RTC status flags. - * - * param base RTC peripheral base address - * - * return The status flags. This is the logical OR of members of the - * enumeration ::rtc_status_flags_t - */ -uint32_t RTC_GetStatusFlags(RTC_Type *base) -{ - uint32_t tmp32 = 0U; - - /* RTC_SR */ - if (0U != (RTC_SR_TIF_MASK & base->SR)) - { - tmp32 |= (uint32_t)kRTC_TimeInvalidFlag; - } - if (0U != (RTC_SR_TOF_MASK & base->SR)) - { - tmp32 |= (uint32_t)kRTC_TimeOverflowFlag; - } - if (0U != (RTC_SR_TAF_MASK & base->SR)) - { - tmp32 |= (uint32_t)kRTC_AlarmFlag; - } -#if defined(FSL_FEATURE_RTC_HAS_MONOTONIC) && (FSL_FEATURE_RTC_HAS_MONOTONIC) - if (0U != (RTC_SR_MOF_MASK & base->SR)) - { - tmp32 |= (uint32_t)kRTC_MonotonicOverflowFlag; - } -#endif /* FSL_FEATURE_RTC_HAS_MONOTONIC */ -#if (defined(FSL_FEATURE_RTC_HAS_SR_TIDF) && FSL_FEATURE_RTC_HAS_SR_TIDF) - /* - * $Branch Coverage Justification$ - * (0U != (RTC_SR_TIDF_MASK & base->SR)) not covered. $ref rtc_c_ref_2$. - */ - if (0U != (RTC_SR_TIDF_MASK & base->SR)) - { - /* - * $Line Coverage Justification$ - * $ref rtc_c_ref_2$. - */ - tmp32 |= (uint32_t)kRTC_TamperInterruptDetectFlag; - } -#endif /* FSL_FEATURE_RTC_HAS_SR_TIDF */ - -#if (defined(FSL_FEATURE_RTC_HAS_TDR) && FSL_FEATURE_RTC_HAS_TDR) - /* RTC_TDR */ - /* - * $Branch Coverage Justification$ - * (0U != (RTC_TDR_TMF_MASK & base->TDR)) not covered. $ref rtc_c_ref_2$. - */ - if (0U != (RTC_TDR_TMF_MASK & base->TDR)) - { - /* - * $Line Coverage Justification$ - * $ref rtc_c_ref_2$. - */ - tmp32 |= (uint32_t)kRTC_TestModeFlag; - } - if (0U != (RTC_TDR_FSF_MASK & base->TDR)) - { - tmp32 |= (uint32_t)kRTC_FlashSecurityFlag; - } -#if (defined(FSL_FEATURE_RTC_HAS_TDR_TPF) && FSL_FEATURE_RTC_HAS_TDR_TPF) - /* - * $Branch Coverage Justification$ - * (0U != (RTC_TDR_TPF_MASK & base->TDR)) not covered. $ref rtc_c_ref_2$. - */ - if (0U != (RTC_TDR_TPF_MASK & base->TDR)) - { - /* - * $Line Coverage Justification$ - * $ref rtc_c_ref_2$. - */ - tmp32 |= (uint32_t)kRTC_TamperPinFlag; - } -#endif /* FSL_FEATURE_RTC_HAS_TDR_TPF */ -#if (defined(FSL_FEATURE_RTC_HAS_TDR_STF) && FSL_FEATURE_RTC_HAS_TDR_STF) - /* - * $Branch Coverage Justification$ - * (0U != (RTC_TDR_STF_MASK & base->TDR)) not covered. $ref rtc_c_ref_2$. - */ - if (0U != (RTC_TDR_STF_MASK & base->TDR)) - { - /* - * $Line Coverage Justification$ - * $ref rtc_c_ref_2$. - */ - tmp32 |= (uint32_t)kRTC_SecurityTamperFlag; - } -#endif /* FSL_FEATURE_RTC_HAS_TDR_STF */ -#if (defined(FSL_FEATURE_RTC_HAS_TDR_LCTF) && FSL_FEATURE_RTC_HAS_TDR_LCTF) - /* - * $Branch Coverage Justification$ - * (0U != (RTC_TDR_LCTF_MASK & base->TDR)) not covered. $ref rtc_c_ref_2$. - */ - if (0U != (RTC_TDR_LCTF_MASK & base->TDR)) - { - /* - * $Line Coverage Justification$ - * $ref rtc_c_ref_2$. - */ - tmp32 |= (uint32_t)kRTC_LossOfClockTamperFlag; - } -#endif /* FSL_FEATURE_RTC_HAS_TDR_LCTF */ -#endif /* FSL_FEATURE_RTC_HAS_TDR */ - - return tmp32; -} - -/*! - * brief Clears the RTC status flags. - * - * param base RTC peripheral base address - * param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::rtc_status_flags_t - */ -void RTC_ClearStatusFlags(RTC_Type *base, uint32_t mask) -{ - /* The alarm flag is cleared by writing to the TAR register */ - if (0U != (mask & (uint32_t)kRTC_AlarmFlag)) - { - base->TAR = 0U; - } - - /* The timer overflow flag is cleared by initializing the TSR register. - * The time counter should be disabled for this write to be successful - */ - if (0U != (mask & (uint32_t)kRTC_TimeOverflowFlag)) - { - base->TSR = 1U; - } - - /* The timer overflow flag is cleared by initializing the TSR register. - * The time counter should be disabled for this write to be successful - */ - if (0U != (mask & (uint32_t)kRTC_TimeInvalidFlag)) - { - base->TSR = 1U; - } - -#if (defined(FSL_FEATURE_RTC_HAS_TDR) && FSL_FEATURE_RTC_HAS_TDR) - /* To clear, write logic one to this flag after exiting from all test modes */ - /* - * $Branch Coverage Justification$ - * (0U != ((uint32_t)kRTC_TestModeFlag & mask)) not covered. $ref rtc_c_ref_2$. - */ - if (0U != ((uint32_t)kRTC_TestModeFlag & mask)) - { - /* - * $Line Coverage Justification$ - * $ref rtc_c_ref_2$. - */ - base->TDR = RTC_TDR_TMF_MASK; - } - /* To clear, write logic one to this flag after flash security is enabled */ - /* - * $Branch Coverage Justification$ - * (0U != ((uint32_t)kRTC_FlashSecurityFlag & mask)) not covered. $ref rtc_c_ref_2$. - */ - if (0U != ((uint32_t)kRTC_FlashSecurityFlag & mask)) - { - /* - * $Line Coverage Justification$ - * $ref rtc_c_ref_2$. - */ - base->TDR = RTC_TDR_FSF_MASK; - } -#if (defined(FSL_FEATURE_RTC_HAS_TDR_TPF) && FSL_FEATURE_RTC_HAS_TDR_TPF) - /* To clear, write logic one to the corresponding flag after that tamper pin negates */ - /* - * $Branch Coverage Justification$ - * (0U != ((uint32_t)kRTC_TamperPinFlag & mask)) not covered. $ref rtc_c_ref_2$. - */ - if (0U != ((uint32_t)kRTC_TamperPinFlag & mask)) - { - /* - * $Line Coverage Justification$ - * $ref rtc_c_ref_2$. - */ - base->TDR = RTC_TDR_TPF_MASK; - } -#endif /* FSL_FEATURE_RTC_HAS_TDR_TPF */ -#if (defined(FSL_FEATURE_RTC_HAS_TDR_STF) && FSL_FEATURE_RTC_HAS_TDR_STF) - /* To clear, write logic one to this flag after security module has negated its tamper detect */ - /* - * $Branch Coverage Justification$ - * (0U != ((uint32_t)kRTC_SecurityTamperFlag & mask)) not covered. $ref rtc_c_ref_2$. - */ - if (0U != ((uint32_t)kRTC_SecurityTamperFlag & mask)) - { - /* - * $Line Coverage Justification$ - * $ref rtc_c_ref_2$. - */ - base->TDR = RTC_TDR_STF_MASK; - } -#endif /* FSL_FEATURE_RTC_HAS_TDR_STF */ -#if (defined(FSL_FEATURE_RTC_HAS_TDR_LCTF) && FSL_FEATURE_RTC_HAS_TDR_LCTF) - /* To clear, write logic one to this flag after loss of clock negates */ - /* - * $Branch Coverage Justification$ - * (0U != ((uint32_t)kRTC_LossOfClockTamperFlag & mask)) not covered. $ref rtc_c_ref_2$. - */ - if (0U != ((uint32_t)kRTC_LossOfClockTamperFlag & mask)) - { - /* - * $Line Coverage Justification$ - * $ref rtc_c_ref_2$. - */ - base->TDR = RTC_TDR_LCTF_MASK; - } -#endif /* FSL_FEATURE_RTC_HAS_TDR_LCTF */ -#endif /* FSL_FEATURE_RTC_HAS_TDR */ -} - -#if defined(FSL_FEATURE_RTC_HAS_MONOTONIC) && (FSL_FEATURE_RTC_HAS_MONOTONIC) - -/*! - * brief Reads the values of the Monotonic Counter High and Monotonic Counter Low and returns - * them as a single value. - * - * param base RTC peripheral base address - * param counter Pointer to variable where the value is stored. - */ -void RTC_GetMonotonicCounter(RTC_Type *base, uint64_t *counter) -{ - uint64_t u64temp; - - assert(NULL != counter); - - u64temp = (uint64_t)base->MCLR; - *counter = (((uint64_t)base->MCHR << 32U) | u64temp); -} - -/*! - * brief Writes values Monotonic Counter High and Monotonic Counter Low by decomposing - * the given single value. The Monotonic Overflow Flag in RTC_SR is cleared due to the API. - * - * param base RTC peripheral base address - * param counter Counter value - */ -void RTC_SetMonotonicCounter(RTC_Type *base, uint64_t counter) -{ - /* Prepare to initialize the register with the new value written */ - base->MER &= ~RTC_MER_MCE_MASK; - - base->MCHR = (uint32_t)((counter) >> 32); - base->MCLR = (uint32_t)(counter); -} - -/*! - * brief Increments the Monotonic Counter by one. - * - * Increments the Monotonic Counter (registers RTC_MCLR and RTC_MCHR accordingly) by setting - * the monotonic counter enable (MER[MCE]) and then writing to the RTC_MCLR register. A write to the - * monotonic counter low that causes it to overflow also increments the monotonic counter high. - * - * param base RTC peripheral base address - * - * return kStatus_Success: success - * kStatus_Fail: error occurred, either time invalid or monotonic overflow flag was found - */ -status_t RTC_IncrementMonotonicCounter(RTC_Type *base) -{ - if (0U != (base->SR & (RTC_SR_MOF_MASK | RTC_SR_TIF_MASK))) - { - return kStatus_Fail; - } - - /* Prepare to switch to increment mode */ - base->MER |= RTC_MER_MCE_MASK; - /* Write anything so the counter increments*/ - base->MCLR = 1U; - - return kStatus_Success; -} - -#endif /* FSL_FEATURE_RTC_HAS_MONOTONIC */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_rtc.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_rtc.h deleted file mode 100644 index 33ee4b82340..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_rtc.h +++ /dev/null @@ -1,546 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2019, 2022, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_RTC_H_ -#define FSL_RTC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup rtc - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -#define FSL_RTC_DRIVER_VERSION (MAKE_VERSION(2, 3, 0)) /*!< Version 2.3.0 */ -/*! @} */ - -/*! @brief List of RTC interrupts */ -typedef enum _rtc_interrupt_enable -{ - kRTC_TimeInvalidInterruptEnable = (1U << 0U), /*!< Time invalid interrupt.*/ - kRTC_TimeOverflowInterruptEnable = (1U << 1U), /*!< Time overflow interrupt.*/ - kRTC_AlarmInterruptEnable = (1U << 2U), /*!< Alarm interrupt.*/ -#if defined(FSL_FEATURE_RTC_HAS_MONOTONIC) && (FSL_FEATURE_RTC_HAS_MONOTONIC) - kRTC_MonotonicOverflowInterruptEnable = (1U << 3U), /*!< Monotonic Overflow Interrupt Enable */ -#endif /* FSL_FEATURE_RTC_HAS_MONOTONIC */ - kRTC_SecondsInterruptEnable = (1U << 4U), /*!< Seconds interrupt.*/ -#if (defined(FSL_FEATURE_RTC_HAS_TIR) && FSL_FEATURE_RTC_HAS_TIR) - kRTC_TestModeInterruptEnable = (1U << 5U), /* test mode interrupt */ - kRTC_FlashSecurityInterruptEnable = (1U << 6U), /* flash security interrupt */ -#if (defined(FSL_FEATURE_RTC_HAS_TIR_TPIE) && FSL_FEATURE_RTC_HAS_TIR_TPIE) - kRTC_TamperPinInterruptEnable = (1U << 7U), /* Tamper pin interrupt */ -#endif /* FSL_FEATURE_RTC_HAS_TIR_TPIE */ -#if (defined(FSL_FEATURE_RTC_HAS_TIR_SIE) && FSL_FEATURE_RTC_HAS_TIR_SIE) - kRTC_SecurityModuleInterruptEnable = (1U << 8U), /* security module interrupt */ -#endif /* FSL_FEATURE_RTC_HAS_TIR_SIE */ -#if (defined(FSL_FEATURE_RTC_HAS_TIR_LCIE) && FSL_FEATURE_RTC_HAS_TIR_LCIE) - kRTC_LossOfClockInterruptEnable = (1U << 9U), /* loss of clock interrupt */ -#endif /* FSL_FEATURE_RTC_HAS_TIR_LCIE */ -#endif /* FSL_FEATURE_RTC_HAS_TIR */ -} rtc_interrupt_enable_t; - -/*! @brief List of RTC flags */ -typedef enum _rtc_status_flags -{ - kRTC_TimeInvalidFlag = (1U << 0U), /*!< Time invalid flag */ - kRTC_TimeOverflowFlag = (1U << 1U), /*!< Time overflow flag */ - kRTC_AlarmFlag = (1U << 2U), /*!< Alarm flag*/ -#if defined(FSL_FEATURE_RTC_HAS_MONOTONIC) && (FSL_FEATURE_RTC_HAS_MONOTONIC) - kRTC_MonotonicOverflowFlag = (1U << 3U), /*!< Monotonic Overflow Flag */ -#endif /* FSL_FEATURE_RTC_HAS_MONOTONIC */ -#if (defined(FSL_FEATURE_RTC_HAS_SR_TIDF) && FSL_FEATURE_RTC_HAS_SR_TIDF) - kRTC_TamperInterruptDetectFlag = (1U << 4U), /*!< Tamper interrupt detect flag */ -#endif /* FSL_FEATURE_RTC_HAS_SR_TIDF */ -#if (defined(FSL_FEATURE_RTC_HAS_TDR) && FSL_FEATURE_RTC_HAS_TDR) - kRTC_TestModeFlag = (1U << 5U), /* Test mode flag */ - kRTC_FlashSecurityFlag = (1U << 6U), /* Flash security flag */ -#if (defined(FSL_FEATURE_RTC_HAS_TDR_TPF) && FSL_FEATURE_RTC_HAS_TDR_TPF) - kRTC_TamperPinFlag = (1U << 7U), /* Tamper pin flag */ -#endif /* FSL_FEATURE_RTC_HAS_TDR_TPF */ -#if (defined(FSL_FEATURE_RTC_HAS_TDR_STF) && FSL_FEATURE_RTC_HAS_TDR_STF) - kRTC_SecurityTamperFlag = (1U << 8U), /* Security tamper flag */ -#endif /* FSL_FEATURE_RTC_HAS_TDR_STF */ -#if (defined(FSL_FEATURE_RTC_HAS_TDR_LCTF) && FSL_FEATURE_RTC_HAS_TDR_LCTF) - kRTC_LossOfClockTamperFlag = (1U << 9U), /* Loss of clock flag */ -#endif /* FSL_FEATURE_RTC_HAS_TDR_LCTF */ -#endif /* FSL_FEATURE_RTC_HAS_TDR */ -} rtc_status_flags_t; - -#if (defined(FSL_FEATURE_RTC_HAS_OSC_SCXP) && FSL_FEATURE_RTC_HAS_OSC_SCXP) - -/*! @brief List of RTC Oscillator capacitor load settings */ -typedef enum _rtc_osc_cap_load -{ - kRTC_Capacitor_2p = RTC_CR_SC2P_MASK, /*!< 2 pF capacitor load */ - kRTC_Capacitor_4p = RTC_CR_SC4P_MASK, /*!< 4 pF capacitor load */ - kRTC_Capacitor_8p = RTC_CR_SC8P_MASK, /*!< 8 pF capacitor load */ - kRTC_Capacitor_16p = RTC_CR_SC16P_MASK /*!< 16 pF capacitor load */ -} rtc_osc_cap_load_t; - -#endif /* FSL_FEATURE_SCG_HAS_OSC_SCXP */ - -/*! @brief Structure is used to hold the date and time */ -typedef struct _rtc_datetime -{ - uint16_t year; /*!< Range from 1970 to 2099.*/ - uint8_t month; /*!< Range from 1 to 12.*/ - uint8_t day; /*!< Range from 1 to 31 (depending on month).*/ - uint8_t hour; /*!< Range from 0 to 23.*/ - uint8_t minute; /*!< Range from 0 to 59.*/ - uint8_t second; /*!< Range from 0 to 59.*/ -} rtc_datetime_t; - -#if (defined(FSL_FEATURE_RTC_HAS_PCR) && FSL_FEATURE_RTC_HAS_PCR) - -/*! - * @brief RTC pin config structure - */ -typedef struct _rtc_pin_config -{ - bool inputLogic; /*!< true: Tamper pin input data is logic one. - false: Tamper pin input data is logic zero. */ - bool pinActiveLow; /*!< true: Tamper pin is active low. - false: Tamper pin is active high. */ - bool filterEnable; /*!< true: Input filter is enabled on the tamper pin. - false: Input filter is disabled on the tamper pin. */ - bool pullSelectNegate; /*!< true: Tamper pin pull resistor direction will negate the tamper pin. - false: Tamper pin pull resistor direction will assert the tamper pin. */ - bool pullEnable; /*!< true: Pull resistor is enabled on tamper pin. - false: Pull resistor is disabled on tamper pin. */ -} rtc_pin_config_t; - -#endif /* FSL_FEATURE_RTC_HAS_PCR */ - -/*! - * @brief RTC config structure - * - * This structure holds the configuration settings for the RTC peripheral. To initialize this - * structure to reasonable defaults, call the RTC_GetDefaultConfig() function and pass a - * pointer to your config structure instance. - * - * The config struct can be made const so it resides in flash - */ -typedef struct _rtc_config -{ - bool wakeupSelect; /*!< true: Wakeup pin outputs the 32 KHz clock; - false:Wakeup pin used to wakeup the chip */ - bool updateMode; /*!< true: Registers can be written even when locked under certain - conditions, false: No writes allowed when registers are locked */ - bool supervisorAccess; /*!< true: Non-supervisor accesses are allowed; - false: Non-supervisor accesses are not supported */ - uint32_t compensationInterval; /*!< Compensation interval that is written to the CIR field in RTC TCR Register */ - uint32_t compensationTime; /*!< Compensation time that is written to the TCR field in RTC TCR Register */ -} rtc_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Ungates the RTC clock and configures the peripheral for basic operation. - * - * This function issues a software reset if the timer invalid flag is set. - * - * @note This API should be called at the beginning of the application using the RTC driver. - * - * @param base RTC peripheral base address - * @param config Pointer to the user's RTC configuration structure. - */ -void RTC_Init(RTC_Type *base, const rtc_config_t *config); - -/*! - * @brief Stops the timer and gate the RTC clock. - * - * @param base RTC peripheral base address - */ -static inline void RTC_Deinit(RTC_Type *base) -{ - /* Stop the RTC timer */ - base->SR &= ~RTC_SR_TCE_MASK; - -#if defined(RTC_CLOCKS) -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate the module clock */ - CLOCK_DisableClock(kCLOCK_Rtc0); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* RTC_CLOCKS */ -} - -/*! - * @brief Fills in the RTC config struct with the default settings. - * - * The default values are as follows. - * @code - * config->wakeupSelect = false; - * config->updateMode = false; - * config->supervisorAccess = false; - * config->compensationInterval = 0; - * config->compensationTime = 0; - * @endcode - * @param config Pointer to the user's RTC configuration structure. - */ -void RTC_GetDefaultConfig(rtc_config_t *config); - -/*! @}*/ - -/*! - * @name Current Time & Alarm - * @{ - */ - -/*! - * @brief Sets the RTC date and time according to the given time structure. - * - * The RTC counter must be stopped prior to calling this function because writes to the RTC - * seconds register fail if the RTC counter is running. - * - * @param base RTC peripheral base address - * @param datetime Pointer to the structure where the date and time details are stored. - * - * @return kStatus_Success: Success in setting the time and starting the RTC - * kStatus_InvalidArgument: Error because the datetime format is incorrect - */ -status_t RTC_SetDatetime(RTC_Type *base, const rtc_datetime_t *datetime); - -/*! - * @brief Gets the RTC time and stores it in the given time structure. - * - * @param base RTC peripheral base address - * @param datetime Pointer to the structure where the date and time details are stored. - */ -void RTC_GetDatetime(RTC_Type *base, rtc_datetime_t *datetime); - -/*! - * @brief Sets the RTC alarm time. - * - * The function checks whether the specified alarm time is greater than the present - * time. If not, the function does not set the alarm and returns an error. - * - * @param base RTC peripheral base address - * @param alarmTime Pointer to the structure where the alarm time is stored. - * - * @return kStatus_Success: success in setting the RTC alarm - * kStatus_InvalidArgument: Error because the alarm datetime format is incorrect - * kStatus_Fail: Error because the alarm time has already passed - */ -status_t RTC_SetAlarm(RTC_Type *base, const rtc_datetime_t *alarmTime); - -/*! - * @brief Returns the RTC alarm time. - * - * @param base RTC peripheral base address - * @param datetime Pointer to the structure where the alarm date and time details are stored. - */ -void RTC_GetAlarm(RTC_Type *base, rtc_datetime_t *datetime); - -/*! @}*/ - -/*! - * @name Interrupt Interface - * @{ - */ - -/*! - * @brief Enables the selected RTC interrupts. - * - * @param base RTC peripheral base address - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::rtc_interrupt_enable_t - */ -void RTC_EnableInterrupts(RTC_Type *base, uint32_t mask); - -/*! - * @brief Disables the selected RTC interrupts. - * - * @param base RTC peripheral base address - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::rtc_interrupt_enable_t - */ -void RTC_DisableInterrupts(RTC_Type *base, uint32_t mask); - -/*! - * @brief Gets the enabled RTC interrupts. - * - * @param base RTC peripheral base address - * - * @return The enabled interrupts. This is the logical OR of members of the - * enumeration ::rtc_interrupt_enable_t - */ -uint32_t RTC_GetEnabledInterrupts(RTC_Type *base); - -/*! @}*/ - -/*! - * @name Status Interface - * @{ - */ - -/*! - * @brief Gets the RTC status flags. - * - * @param base RTC peripheral base address - * - * @return The status flags. This is the logical OR of members of the - * enumeration ::rtc_status_flags_t - */ -uint32_t RTC_GetStatusFlags(RTC_Type *base); - -/*! - * @brief Clears the RTC status flags. - * - * @param base RTC peripheral base address - * @param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::rtc_status_flags_t - */ -void RTC_ClearStatusFlags(RTC_Type *base, uint32_t mask); - -/*! @}*/ - -/*! - * @name Clock Source Configuration - * @{ - */ - -#if !(defined(FSL_FEATURE_RTC_HAS_NO_CR_OSCE) && FSL_FEATURE_RTC_HAS_NO_CR_OSCE) - -/*! - * @brief Enable/Disable RTC 32kHz Oscillator clock. - * - * @param base RTC peripheral base address - * @param enable Enable/Disable RTC 32.768 kHz clock - * - * @note After setting this bit, wait the oscillator startup time before enabling - * the time counter to allow the 32.768 kHz clock time to stabilize. - */ -static inline void RTC_EnableOscillatorClock(RTC_Type *base, bool enable) -{ - if (enable) - { - base->CR |= RTC_CR_OSCE_MASK; - } - else - { - base->CR &= ~RTC_CR_OSCE_MASK; - } -} - -/*! - * @brief Set RTC clock source. - * @deprecated Do not use this function. It has been superceded by @ref RTC_EnableOscillatorClock - - * @param base RTC peripheral base address - * - * @note After setting this bit, wait the oscillator startup time before enabling - * the time counter to allow the 32.768 kHz clock time to stabilize. - */ -static inline void RTC_SetClockSource(RTC_Type *base) -{ - /* Enable the RTC 32KHz oscillator */ - base->CR |= RTC_CR_OSCE_MASK; -} - -#endif /* FSL_FEATURE_RTC_HAS_NO_CR_OSCE */ - -#if (defined(FSL_FEATURE_RTC_HAS_LPO_ADJUST) && FSL_FEATURE_RTC_HAS_LPO_ADJUST) - -/*! - * @brief Enable/Disable RTC 1kHz LPO clock. - * - * @param base RTC peripheral base address - * @param enable Enable/Disable RTC 1kHz LPO clock - * - * @note After setting this bit, RTC prescaler increments using the LPO 1kHz clock - * and not the RTC 32kHz crystal clock. - */ -static inline void RTC_EnableLPOClock(RTC_Type *base, bool enable) -{ - if (enable) - { - base->CR |= RTC_CR_LPOS_MASK; - } - else - { - base->CR &= ~RTC_CR_LPOS_MASK; - } -} - -#endif /* FSL_FEATURE_RTC_HAS_LPO_ADJUST */ - -/*! @}*/ - -#if (defined(FSL_FEATURE_RTC_HAS_TTSR) && FSL_FEATURE_RTC_HAS_TTSR) - -/*! - * @brief Get the RTC tamper time seconds. - * - * @param base RTC peripheral base address - */ -static inline uint32_t RTC_GetTamperTimeSeconds(RTC_Type *base) -{ - return base->TTSR; -} - -#endif /* FSL_FEATURE_RTC_HAS_TTSR */ - -/*! - * @name Timer Start and Stop - * @{ - */ - -/*! - * @brief Starts the RTC time counter. - * - * After calling this function, the timer counter increments once a second provided SR[TOF] or - * SR[TIF] are not set. - * - * @param base RTC peripheral base address - */ -static inline void RTC_StartTimer(RTC_Type *base) -{ - base->SR |= RTC_SR_TCE_MASK; -} - -/*! - * @brief Stops the RTC time counter. - * - * RTC's seconds register can be written to only when the timer is stopped. - * - * @param base RTC peripheral base address - */ -static inline void RTC_StopTimer(RTC_Type *base) -{ - base->SR &= ~RTC_SR_TCE_MASK; -} - -/*! @}*/ - -#if (defined(FSL_FEATURE_RTC_HAS_OSC_SCXP) && FSL_FEATURE_RTC_HAS_OSC_SCXP) - -/*! - * @brief This function sets the specified capacitor configuration for the RTC oscillator. - * - * @param base RTC peripheral base address - * @param capLoad Oscillator loads to enable. This is a logical OR of members of the - * enumeration ::rtc_osc_cap_load_t - */ -static inline void RTC_SetOscCapLoad(RTC_Type *base, uint32_t capLoad) -{ - uint32_t reg = base->CR; - - reg &= ~(RTC_CR_SC2P_MASK | RTC_CR_SC4P_MASK | RTC_CR_SC8P_MASK | RTC_CR_SC16P_MASK); - reg |= capLoad; - - base->CR = reg; -} - -#endif /* FSL_FEATURE_SCG_HAS_OSC_SCXP */ - -/*! - * @brief Performs a software reset on the RTC module. - * - * This resets all RTC registers except for the SWR bit and the RTC_WAR and RTC_RAR - * registers. The SWR bit is cleared by software explicitly clearing it. - * - * @param base RTC peripheral base address - */ -static inline void RTC_Reset(RTC_Type *base) -{ - base->CR |= RTC_CR_SWR_MASK; - base->CR &= ~RTC_CR_SWR_MASK; - - /* Set TSR register to 0x1 to avoid the timer invalid (TIF) bit being set in the SR register */ - base->TSR = 1U; -} - -#if defined(FSL_FEATURE_RTC_HAS_MONOTONIC) && (FSL_FEATURE_RTC_HAS_MONOTONIC) - -/*! - * @name Monotonic counter functions - * @{ - */ - -/*! - * @brief Reads the values of the Monotonic Counter High and Monotonic Counter Low and returns - * them as a single value. - * - * @param base RTC peripheral base address - * @param counter Pointer to variable where the value is stored. - */ -void RTC_GetMonotonicCounter(RTC_Type *base, uint64_t *counter); - -/*! - * @brief Writes values Monotonic Counter High and Monotonic Counter Low by decomposing - * the given single value. The Monotonic Overflow Flag in RTC_SR is cleared due to the API. - * - * @param base RTC peripheral base address - * @param counter Counter value - */ -void RTC_SetMonotonicCounter(RTC_Type *base, uint64_t counter); - -/*! - * @brief Increments the Monotonic Counter by one. - * - * Increments the Monotonic Counter (registers RTC_MCLR and RTC_MCHR accordingly) by setting - * the monotonic counter enable (MER[MCE]) and then writing to the RTC_MCLR register. A write to the - * monotonic counter low that causes it to overflow also increments the monotonic counter high. - * - * @param base RTC peripheral base address - * - * @return kStatus_Success: success - * kStatus_Fail: error occurred, either time invalid or monotonic overflow flag was found - */ -status_t RTC_IncrementMonotonicCounter(RTC_Type *base); - -/*! @}*/ - -#endif /* FSL_FEATURE_RTC_HAS_MONOTONIC */ - -#if defined(FSL_FEATURE_RTC_HAS_WAKEUP_PIN) && (FSL_FEATURE_RTC_HAS_WAKEUP_PIN) -/*! - * @brief Enables or disables the RTC Wakeup Pin Operation. - * - * This function enable or disable RTC Wakeup Pin. - * The wakeup pin is optional and not available on all devices. - * - * @param base RTC_Type base pointer. - * @param enable true to enable, false to disable. - */ -static inline void RTC_EnableWakeUpPin(RTC_Type *base, bool enable) -{ - if (enable) - { - base->CR |= RTC_CR_WPE_MASK; - } - else - { - base->CR &= ~RTC_CR_WPE_MASK; - } -} -#endif - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_RTC_H_ */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_sai.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_sai.c deleted file mode 100644 index 6d69f5efb2a..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_sai.c +++ /dev/null @@ -1,3140 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_sai.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.sai" -#endif - -/******************************************************************************* - * Definitations - ******************************************************************************/ -/*! @brief _sai_transfer_state sai transfer state.*/ -enum -{ - kSAI_Busy = 0x0U, /*!< SAI is busy */ - kSAI_Idle, /*!< Transfer is done. */ - kSAI_Error /*!< Transfer error occurred. */ -}; - -/*! @brief Typedef for sai tx interrupt handler. */ -typedef void (*sai_tx_isr_t)(I2S_Type *base, sai_handle_t *saiHandle); - -/*! @brief Typedef for sai rx interrupt handler. */ -typedef void (*sai_rx_isr_t)(I2S_Type *base, sai_handle_t *saiHandle); - -/*! @brief check flag avalibility */ -#define IS_SAI_FLAG_SET(reg, flag) (((reg) & ((uint32_t)flag)) != 0UL) - -#if defined(SAI_RSTS) -#define SAI_RESETS_ARRAY SAI_RSTS -#endif -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief sai get rx enabled interrupt status. - * - * - * @param base SAI base pointer. - * @param enableFlag enable flag to check. - * @param statusFlag status flag to check. - */ -static bool SAI_RxGetEnabledInterruptStatus(I2S_Type *base, uint32_t enableFlag, uint32_t statusFlag); - -/*! - * @brief sai get tx enabled interrupt status. - * - * - * @param base SAI base pointer. - * @param enableFlag enable flag to check. - * @param statusFlag status flag to check. - */ -static bool SAI_TxGetEnabledInterruptStatus(I2S_Type *base, uint32_t enableFlag, uint32_t statusFlag); - -/*! - * @brief Set the master clock divider. - * - * This API will compute the master clock divider according to master clock frequency and master - * clock source clock source frequency. - * - * @param base SAI base pointer. - * @param mclk_Hz Mater clock frequency in Hz. - * @param mclkSrcClock_Hz Master clock source frequency in Hz. - */ -static bool SAI_TxGetEnabledInterruptStatus(I2S_Type *base, uint32_t enableFlag, uint32_t statusFlag); - -#if ((defined(FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) && (FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER)) || \ - (defined(FSL_FEATURE_SAI_HAS_MCR_MCLK_POST_DIV) && (FSL_FEATURE_SAI_HAS_MCR_MCLK_POST_DIV))) - -/*! - * @brief Set the master clock divider. - * - * This API will compute the master clock divider according to master clock frequency and master - * clock source clock source frequency. - * - * @param base SAI base pointer. - * @param mclk_Hz Mater clock frequency in Hz. - * @param mclkSrcClock_Hz Master clock source frequency in Hz. - */ -static void SAI_SetMasterClockDivider(I2S_Type *base, uint32_t mclk_Hz, uint32_t mclkSrcClock_Hz); -#endif /* FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER */ - -/*! - * @brief Get the instance number for SAI. - * - * @param base SAI base pointer. - */ -static uint32_t SAI_GetInstance(I2S_Type *base); - -/*! - * @brief sends a piece of data in non-blocking way. - * - * @param base SAI base pointer - * @param channel start channel number. - * @param channelMask enabled channels mask. - * @param endChannel end channel numbers. - * @param bitWidth How many bits in a audio word, usually 8/16/24/32 bits. - * @param buffer Pointer to the data to be written. - * @param size Bytes to be written. - */ -static void SAI_WriteNonBlocking(I2S_Type *base, - uint32_t channel, - uint32_t channelMask, - uint32_t endChannel, - uint8_t bitWidth, - uint8_t *buffer, - uint32_t size); - -/*! - * @brief Receive a piece of data in non-blocking way. - * - * @param base SAI base pointer - * @param channel start channel number. - * @param channelMask enabled channels mask. - * @param endChannel end channel numbers. - * @param bitWidth How many bits in a audio word, usually 8/16/24/32 bits. - * @param buffer Pointer to the data to be read. - * @param size Bytes to be read. - */ -static void SAI_ReadNonBlocking(I2S_Type *base, - uint32_t channel, - uint32_t channelMask, - uint32_t endChannel, - uint8_t bitWidth, - uint8_t *buffer, - uint32_t size); - -/*! - * @brief Get classic I2S mode configurations. - * - * @param config transceiver configurations - * @param bitWidth audio data bitWidth. - * @param mode audio data channel - * @param saiChannelMask channel mask value to enable - */ -static void SAI_GetCommonConfig(sai_transceiver_t *config, - sai_word_width_t bitWidth, - sai_mono_stereo_t mode, - uint32_t saiChannelMask); -/******************************************************************************* - * Variables - ******************************************************************************/ -/* Base pointer array */ -static I2S_Type *const s_saiBases[] = I2S_BASE_PTRS; -#if defined(SAI_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_saiReset[] = SAI_RESETS_ARRAY; -#endif -/*!@brief SAI handle pointer */ -static sai_handle_t *s_saiHandle[ARRAY_SIZE(s_saiBases)][2]; -/* IRQ number array */ -static const IRQn_Type s_saiTxIRQ[] = I2S_TX_IRQS; -static const IRQn_Type s_saiRxIRQ[] = I2S_RX_IRQS; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/* Clock name array */ -static const clock_ip_name_t s_saiClock[] = SAI_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -/*! @brief Pointer to tx IRQ handler for each instance. */ -static sai_tx_isr_t s_saiTxIsr; -/*! @brief Pointer to tx IRQ handler for each instance. */ -static sai_rx_isr_t s_saiRxIsr; - -/******************************************************************************* - * Code - ******************************************************************************/ -static bool SAI_RxGetEnabledInterruptStatus(I2S_Type *base, uint32_t enableFlag, uint32_t statusFlag) -{ - uint32_t rcsr = base->RCSR; - - return IS_SAI_FLAG_SET(rcsr, enableFlag) && IS_SAI_FLAG_SET(rcsr, statusFlag); -} - -static bool SAI_TxGetEnabledInterruptStatus(I2S_Type *base, uint32_t enableFlag, uint32_t statusFlag) -{ - uint32_t tcsr = base->TCSR; - - return IS_SAI_FLAG_SET(tcsr, enableFlag) && IS_SAI_FLAG_SET(tcsr, statusFlag); -} - -#if ((defined(FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) && (FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER)) || \ - (defined(FSL_FEATURE_SAI_HAS_MCR_MCLK_POST_DIV) && (FSL_FEATURE_SAI_HAS_MCR_MCLK_POST_DIV))) -static void SAI_SetMasterClockDivider(I2S_Type *base, uint32_t mclk_Hz, uint32_t mclkSrcClock_Hz) -{ - assert(mclk_Hz <= mclkSrcClock_Hz); - - uint32_t sourceFreq = mclkSrcClock_Hz / 100U; /*In order to prevent overflow */ - uint32_t targetFreq = mclk_Hz / 100U; /*In order to prevent overflow */ - -#if FSL_FEATURE_SAI_HAS_MCR_MCLK_POST_DIV - uint32_t postDivider = sourceFreq / targetFreq; - - /* if source equal to target, then disable divider */ - if (postDivider == 1U) - { - base->MCR &= ~I2S_MCR_DIVEN_MASK; - } - else - { - base->MCR = (base->MCR & (~I2S_MCR_DIV_MASK)) | I2S_MCR_DIV(postDivider / 2U - 1U) | I2S_MCR_DIVEN_MASK; - } -#endif -#if FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER - uint16_t fract, divide; - uint32_t remaind = 0; - uint32_t current_remainder = 0xFFFFFFFFU; - uint16_t current_fract = 0; - uint16_t current_divide = 0; - uint32_t mul_freq = 0; - uint32_t max_fract = 256; - - /* Compute the max fract number */ - max_fract = targetFreq * 4096U / sourceFreq + 1U; - if (max_fract > 256U) - { - max_fract = 256U; - } - - /* Looking for the closet frequency */ - for (fract = 1; fract < max_fract; fract++) - { - mul_freq = sourceFreq * fract; - remaind = mul_freq % targetFreq; - divide = (uint16_t)(mul_freq / targetFreq); - - /* Find the exactly frequency */ - if (remaind == 0U) - { - current_fract = fract; - current_divide = (uint16_t)(mul_freq / targetFreq); - break; - } - - /* Closer to next one, set the closest to next data */ - if (remaind > mclk_Hz / 2U) - { - remaind = targetFreq - remaind; - divide += 1U; - } - - /* Update the closest div and fract */ - if (remaind < current_remainder) - { - current_fract = fract; - current_divide = divide; - current_remainder = remaind; - } - } - - /* Fill the computed fract and divider to registers */ - base->MDR = I2S_MDR_DIVIDE(current_divide - 1UL) | I2S_MDR_FRACT(current_fract - 1UL); - - /* Waiting for the divider updated */ - while ((base->MCR & I2S_MCR_DUF_MASK) != 0UL) - { - } -#endif -} -#endif /* FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER */ - -static uint32_t SAI_GetInstance(I2S_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_saiBases); instance++) - { - if (s_saiBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_saiBases)); - - return instance; -} - -static void SAI_WriteNonBlocking(I2S_Type *base, - uint32_t channel, - uint32_t channelMask, - uint32_t endChannel, - uint8_t bitWidth, - uint8_t *buffer, - uint32_t size) -{ - uint32_t i = 0, j = 0U; - uint8_t m = 0; - uint8_t bytesPerWord = bitWidth / 8U; - uint32_t data = 0; - uint32_t temp = 0; - - for (i = 0; i < size / bytesPerWord; i++) - { - for (j = channel; j <= endChannel; j++) - { - if (IS_SAI_FLAG_SET((1UL << j), channelMask)) - { - for (m = 0; m < bytesPerWord; m++) - { - temp = (uint32_t)(*buffer); - data |= (temp << (8U * m)); - buffer++; - } - base->TDR[j] = data; - data = 0; - } - } - } -} - -static void SAI_ReadNonBlocking(I2S_Type *base, - uint32_t channel, - uint32_t channelMask, - uint32_t endChannel, - uint8_t bitWidth, - uint8_t *buffer, - uint32_t size) -{ - uint32_t i = 0, j = 0; - uint8_t m = 0; - uint8_t bytesPerWord = bitWidth / 8U; - uint32_t data = 0; - - for (i = 0; i < size / bytesPerWord; i++) - { - for (j = channel; j <= endChannel; j++) - { - if (IS_SAI_FLAG_SET((1UL << j), channelMask)) - { - data = base->RDR[j]; - for (m = 0; m < bytesPerWord; m++) - { - *buffer = (uint8_t)(data >> (8U * m)) & 0xFFU; - buffer++; - } - } - } - } -} - -static void SAI_GetCommonConfig(sai_transceiver_t *config, - sai_word_width_t bitWidth, - sai_mono_stereo_t mode, - uint32_t saiChannelMask) -{ - assert(NULL != config); - assert(saiChannelMask != 0U); - - (void)memset(config, 0, sizeof(sai_transceiver_t)); - - config->channelMask = (uint8_t)saiChannelMask; - /* sync mode default configurations */ - config->syncMode = kSAI_ModeAsync; - - /* master mode default */ - config->masterSlave = kSAI_Master; - - /* bit default configurations */ - config->bitClock.bclkSrcSwap = false; - config->bitClock.bclkInputDelay = false; - config->bitClock.bclkPolarity = kSAI_SampleOnRisingEdge; - config->bitClock.bclkSource = kSAI_BclkSourceMclkDiv; - - /* frame sync default configurations */ - config->frameSync.frameSyncWidth = (uint8_t)bitWidth; - config->frameSync.frameSyncEarly = true; -#if defined(FSL_FEATURE_SAI_HAS_ON_DEMAND_MODE) && FSL_FEATURE_SAI_HAS_ON_DEMAND_MODE - config->frameSync.frameSyncGenerateOnDemand = false; -#endif - config->frameSync.frameSyncPolarity = kSAI_PolarityActiveLow; - - /* serial data default configurations */ -#if defined(FSL_FEATURE_SAI_HAS_CHANNEL_MODE) && FSL_FEATURE_SAI_HAS_CHANNEL_MODE - config->serialData.dataMode = kSAI_DataPinStateOutputZero; -#endif - config->serialData.dataOrder = kSAI_DataMSB; - config->serialData.dataWord0Length = (uint8_t)bitWidth; - config->serialData.dataWordLength = (uint8_t)bitWidth; - config->serialData.dataWordNLength = (uint8_t)bitWidth; - config->serialData.dataFirstBitShifted = (uint8_t)bitWidth; - config->serialData.dataWordNum = 2U; - config->serialData.dataMaskedWord = (uint32_t)mode; - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) && FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR - config->fifo.fifoContinueOneError = true; -#endif -} - -/*! - * brief Initializes the SAI peripheral. - * - * This API gates the SAI clock. The SAI module can't operate unless SAI_Init is called to enable the clock. - * - * param base SAI base pointer - */ -void SAI_Init(I2S_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the SAI clock */ - (void)CLOCK_EnableClock(s_saiClock[SAI_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(SAI_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_saiReset[SAI_GetInstance(base)]); -#endif - -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - /* disable interrupt and DMA request*/ - base->TCSR &= - ~(I2S_TCSR_FRIE_MASK | I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK | I2S_TCSR_FRDE_MASK | I2S_TCSR_FWDE_MASK); - base->RCSR &= - ~(I2S_RCSR_FRIE_MASK | I2S_RCSR_FWIE_MASK | I2S_RCSR_FEIE_MASK | I2S_RCSR_FRDE_MASK | I2S_RCSR_FWDE_MASK); -#else - /* disable interrupt and DMA request*/ - base->TCSR &= ~(I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK | I2S_TCSR_FWDE_MASK); - base->RCSR &= ~(I2S_RCSR_FWIE_MASK | I2S_RCSR_FEIE_MASK | I2S_RCSR_FWDE_MASK); -#endif -} - -/*! - * brief De-initializes the SAI peripheral. - * - * This API gates the SAI clock. The SAI module can't operate unless SAI_TxInit - * or SAI_RxInit is called to enable the clock. - * - * param base SAI base pointer - */ -void SAI_Deinit(I2S_Type *base) -{ - SAI_TxEnable(base, false); - SAI_RxEnable(base, false); -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - (void)CLOCK_DisableClock(s_saiClock[SAI_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Resets the SAI Tx. - * - * This function enables the software reset and FIFO reset of SAI Tx. After reset, clear the reset bit. - * - * param base SAI base pointer - */ -void SAI_TxReset(I2S_Type *base) -{ - /* Set the software reset and FIFO reset to clear internal state */ - base->TCSR = I2S_TCSR_SR_MASK | I2S_TCSR_FR_MASK; - - /* Clear software reset bit, this should be done by software */ - base->TCSR &= ~I2S_TCSR_SR_MASK; - - /* Reset all Tx register values */ - base->TCR2 = 0; - base->TCR3 = 0; - base->TCR4 = 0; - base->TCR5 = 0; - base->TMR = 0; -} - -/*! - * brief Resets the SAI Rx. - * - * This function enables the software reset and FIFO reset of SAI Rx. After reset, clear the reset bit. - * - * param base SAI base pointer - */ -void SAI_RxReset(I2S_Type *base) -{ - /* Set the software reset and FIFO reset to clear internal state */ - base->RCSR = I2S_RCSR_SR_MASK | I2S_RCSR_FR_MASK; - - /* Clear software reset bit, this should be done by software */ - base->RCSR &= ~I2S_RCSR_SR_MASK; - - /* Reset all Rx register values */ - base->RCR2 = 0; - base->RCR3 = 0; - base->RCR4 = 0; - base->RCR5 = 0; - base->RMR = 0; -} - -/*! - * brief Enables/disables the SAI Tx. - * - * param base SAI base pointer - * param enable True means enable SAI Tx, false means disable. - */ -void SAI_TxEnable(I2S_Type *base, bool enable) -{ - if (enable) - { - /* If clock is sync with Rx, should enable RE bit. */ - if (((base->TCR2 & I2S_TCR2_SYNC_MASK) >> I2S_TCR2_SYNC_SHIFT) == 0x1U) - { - base->RCSR = ((base->RCSR & 0xFFE3FFFFU) | I2S_RCSR_RE_MASK); - } - base->TCSR = ((base->TCSR & 0xFFE3FFFFU) | I2S_TCSR_TE_MASK); - /* Also need to clear the FIFO error flag before start */ - SAI_TxClearStatusFlags(base, kSAI_FIFOErrorFlag); - } - else - { - /* If Rx not in sync with Tx, then disable Tx, otherwise, shall not disable Tx */ - if (((base->RCR2 & I2S_RCR2_SYNC_MASK) >> I2S_RCR2_SYNC_SHIFT) != 0x1U) - { - /* Disable TE bit */ - base->TCSR = ((base->TCSR & 0xFFE3FFFFU) & (~I2S_TCSR_TE_MASK)); - } - } -} - -/*! - * brief Enables/disables the SAI Rx. - * - * param base SAI base pointer - * param enable True means enable SAI Rx, false means disable. - */ -void SAI_RxEnable(I2S_Type *base, bool enable) -{ - if (enable) - { - /* If clock is sync with Tx, should enable TE bit. */ - if (((base->RCR2 & I2S_RCR2_SYNC_MASK) >> I2S_RCR2_SYNC_SHIFT) == 0x1U) - { - base->TCSR = ((base->TCSR & 0xFFE3FFFFU) | I2S_TCSR_TE_MASK); - } - base->RCSR = ((base->RCSR & 0xFFE3FFFFU) | I2S_RCSR_RE_MASK); - /* Also need to clear the FIFO error flag before start */ - SAI_RxClearStatusFlags(base, kSAI_FIFOErrorFlag); - } - else - { - /* If Tx not in sync with Rx, then disable Rx, otherwise, shall not disable Rx */ - if (((base->TCR2 & I2S_TCR2_SYNC_MASK) >> I2S_TCR2_SYNC_SHIFT) != 0x1U) - { - /* Disable RE bit */ - base->RCSR = ((base->RCSR & 0xFFE3FFFFU) & (~I2S_RCSR_RE_MASK)); - } - } -} - -/*! - * brief Do software reset or FIFO reset . - * - * FIFO reset means clear all the data in the FIFO, and make the FIFO pointer both to 0. - * Software reset means clear the Tx internal logic, including the bit clock, frame count etc. But software - * reset will not clear any configuration registers like TCR1~TCR5. - * This function will also clear all the error flags such as FIFO error, sync error etc. - * - * param base SAI base pointer - * param resetType Reset type, FIFO reset or software reset - */ -void SAI_TxSoftwareReset(I2S_Type *base, sai_reset_type_t resetType) -{ - base->TCSR |= (uint32_t)resetType; - - /* Clear the software reset */ - base->TCSR &= ~I2S_TCSR_SR_MASK; -} - -/*! - * brief Do software reset or FIFO reset . - * - * FIFO reset means clear all the data in the FIFO, and make the FIFO pointer both to 0. - * Software reset means clear the Rx internal logic, including the bit clock, frame count etc. But software - * reset will not clear any configuration registers like RCR1~RCR5. - * This function will also clear all the error flags such as FIFO error, sync error etc. - * - * param base SAI base pointer - * param resetType Reset type, FIFO reset or software reset - */ -void SAI_RxSoftwareReset(I2S_Type *base, sai_reset_type_t resetType) -{ - base->RCSR |= (uint32_t)resetType; - - /* Clear the software reset */ - base->RCSR &= ~I2S_RCSR_SR_MASK; -} - -/*! - * brief Set the Tx channel FIFO enable mask. - * - * param base SAI base pointer - * param mask Channel enable mask, 0 means all channel FIFO disabled, 1 means channel 0 enabled, - * 3 means both channel 0 and channel 1 enabled. - */ -void SAI_TxSetChannelFIFOMask(I2S_Type *base, uint8_t mask) -{ - base->TCR3 &= ~I2S_TCR3_TCE_MASK; - base->TCR3 |= I2S_TCR3_TCE(mask); -} - -/*! - * brief Set the Rx channel FIFO enable mask. - * - * param base SAI base pointer - * param mask Channel enable mask, 0 means all channel FIFO disabled, 1 means channel 0 enabled, - * 3 means both channel 0 and channel 1 enabled. - */ -void SAI_RxSetChannelFIFOMask(I2S_Type *base, uint8_t mask) -{ - base->RCR3 &= ~I2S_RCR3_RCE_MASK; - base->RCR3 |= I2S_RCR3_RCE(mask); -} - -/*! - * brief Set the Tx data order. - * - * param base SAI base pointer - * param order Data order MSB or LSB - */ -void SAI_TxSetDataOrder(I2S_Type *base, sai_data_order_t order) -{ - uint32_t val = (base->TCR4) & (~I2S_TCR4_MF_MASK); - - val |= I2S_TCR4_MF(order); - base->TCR4 = val; -} - -/*! - * brief Set the Rx data order. - * - * param base SAI base pointer - * param order Data order MSB or LSB - */ -void SAI_RxSetDataOrder(I2S_Type *base, sai_data_order_t order) -{ - uint32_t val = (base->RCR4) & (~I2S_RCR4_MF_MASK); - - val |= I2S_RCR4_MF(order); - base->RCR4 = val; -} - -/*! - * brief Set the Tx data order. - * - * param base SAI base pointer - * param order Data order MSB or LSB - */ -void SAI_TxSetBitClockPolarity(I2S_Type *base, sai_clock_polarity_t polarity) -{ - uint32_t val = (base->TCR2) & (~I2S_TCR2_BCP_MASK); - - val |= I2S_TCR2_BCP(polarity); - base->TCR2 = val; -} - -/*! - * brief Set the Rx data order. - * - * param base SAI base pointer - * param order Data order MSB or LSB - */ -void SAI_RxSetBitClockPolarity(I2S_Type *base, sai_clock_polarity_t polarity) -{ - uint32_t val = (base->RCR2) & (~I2S_RCR2_BCP_MASK); - - val |= I2S_RCR2_BCP(polarity); - base->RCR2 = val; -} - -/*! - * brief Set the Tx data order. - * - * param base SAI base pointer - * param order Data order MSB or LSB - */ -void SAI_TxSetFrameSyncPolarity(I2S_Type *base, sai_clock_polarity_t polarity) -{ - uint32_t val = (base->TCR4) & (~I2S_TCR4_FSP_MASK); - - val |= I2S_TCR4_FSP(polarity); - base->TCR4 = val; -} - -/*! - * brief Set the Rx data order. - * - * param base SAI base pointer - * param order Data order MSB or LSB - */ -void SAI_RxSetFrameSyncPolarity(I2S_Type *base, sai_clock_polarity_t polarity) -{ - uint32_t val = (base->RCR4) & (~I2S_RCR4_FSP_MASK); - - val |= I2S_RCR4_FSP(polarity); - base->RCR4 = val; -} - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_PACKING) && FSL_FEATURE_SAI_HAS_FIFO_PACKING -/*! - * brief Set Tx FIFO packing feature. - * - * param base SAI base pointer. - * param pack FIFO pack type. It is element of sai_fifo_packing_t. - */ -void SAI_TxSetFIFOPacking(I2S_Type *base, sai_fifo_packing_t pack) -{ - uint32_t val = base->TCR4; - - val &= ~I2S_TCR4_FPACK_MASK; - val |= I2S_TCR4_FPACK(pack); - base->TCR4 = val; -} - -/*! - * brief Set Rx FIFO packing feature. - * - * param base SAI base pointer. - * param pack FIFO pack type. It is element of sai_fifo_packing_t. - */ -void SAI_RxSetFIFOPacking(I2S_Type *base, sai_fifo_packing_t pack) -{ - uint32_t val = base->RCR4; - - val &= ~I2S_RCR4_FPACK_MASK; - val |= I2S_RCR4_FPACK(pack); - base->RCR4 = val; -} -#endif /* FSL_FEATURE_SAI_HAS_FIFO_PACKING */ - -/*! - * brief Transmitter bit clock rate configurations. - * - * param base SAI base pointer. - * param sourceClockHz, bit clock source frequency. - * param sampleRate audio data sample rate. - * param bitWidth, audio data bitWidth. - * param channelNumbers, audio channel numbers. - */ -void SAI_TxSetBitClockRate( - I2S_Type *base, uint32_t sourceClockHz, uint32_t sampleRate, uint32_t bitWidth, uint32_t channelNumbers) -{ - uint32_t tcr2 = base->TCR2; - uint32_t bitClockDiv = 0; - uint32_t bitClockFreq = sampleRate * bitWidth * channelNumbers; - - assert(sourceClockHz >= bitClockFreq); - - tcr2 &= ~I2S_TCR2_DIV_MASK; - /* need to check the divided bclk, if bigger than target, then divider need to re-calculate. */ - bitClockDiv = sourceClockHz / bitClockFreq; - /* for the condition where the source clock is smaller than target bclk */ - if (bitClockDiv == 0U) - { - bitClockDiv++; - } - /* recheck the divider if properly or not, to make sure output blck not bigger than target*/ - if ((sourceClockHz / bitClockDiv) > bitClockFreq) - { - bitClockDiv++; - } - -#if defined(FSL_FEATURE_SAI_HAS_BCLK_BYPASS) && (FSL_FEATURE_SAI_HAS_BCLK_BYPASS) - /* if bclk same with MCLK, bypass the divider */ - if (bitClockDiv == 1U) - { - tcr2 |= I2S_TCR2_BYP_MASK; - } - else -#endif - { - tcr2 |= I2S_TCR2_DIV(bitClockDiv / 2U - 1UL); - } - - base->TCR2 = tcr2; -} - -/*! - * brief Receiver bit clock rate configurations. - * - * param base SAI base pointer. - * param sourceClockHz, bit clock source frequency. - * param sampleRate audio data sample rate. - * param bitWidth, audio data bitWidth. - * param channelNumbers, audio channel numbers. - */ -void SAI_RxSetBitClockRate( - I2S_Type *base, uint32_t sourceClockHz, uint32_t sampleRate, uint32_t bitWidth, uint32_t channelNumbers) -{ - uint32_t rcr2 = base->RCR2; - uint32_t bitClockDiv = 0; - uint32_t bitClockFreq = sampleRate * bitWidth * channelNumbers; - - assert(sourceClockHz >= bitClockFreq); - - rcr2 &= ~I2S_RCR2_DIV_MASK; - /* need to check the divided bclk, if bigger than target, then divider need to re-calculate. */ - bitClockDiv = sourceClockHz / bitClockFreq; - /* for the condition where the source clock is smaller than target bclk */ - if (bitClockDiv == 0U) - { - bitClockDiv++; - } - /* recheck the divider if properly or not, to make sure output blck not bigger than target*/ - if ((sourceClockHz / bitClockDiv) > bitClockFreq) - { - bitClockDiv++; - } - -#if defined(FSL_FEATURE_SAI_HAS_BCLK_BYPASS) && (FSL_FEATURE_SAI_HAS_BCLK_BYPASS) - /* if bclk same with MCLK, bypass the divider */ - if (bitClockDiv == 1U) - { - rcr2 |= I2S_RCR2_BYP_MASK; - } - else -#endif - { - rcr2 |= I2S_RCR2_DIV(bitClockDiv / 2U - 1UL); - } - - base->RCR2 = rcr2; -} - -/*! - * brief Transmitter Bit clock configurations. - * - * param base SAI base pointer. - * param masterSlave master or slave. - * param config bit clock other configurations, can be NULL in slave mode. - */ -void SAI_TxSetBitclockConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_bit_clock_t *config) -{ - uint32_t tcr2 = base->TCR2; - - if ((masterSlave == kSAI_Master) || (masterSlave == kSAI_Bclk_Master_FrameSync_Slave)) - { - assert(config != NULL); - - tcr2 &= ~(I2S_TCR2_BCD_MASK | I2S_TCR2_BCP_MASK | I2S_TCR2_BCI_MASK | I2S_TCR2_BCS_MASK | I2S_TCR2_MSEL_MASK); - tcr2 |= I2S_TCR2_BCD(1U) | I2S_TCR2_BCP(config->bclkPolarity) | I2S_TCR2_BCI(config->bclkInputDelay) | - I2S_TCR2_BCS(config->bclkSrcSwap) | I2S_TCR2_MSEL(config->bclkSource); - } - else - { - tcr2 &= ~(I2S_TCR2_BCD_MASK); - tcr2 |= I2S_TCR2_BCP(config->bclkPolarity); - } - - base->TCR2 = tcr2; -} - -/*! - * brief Receiver Bit clock configurations. - * - * param base SAI base pointer. - * param masterSlave master or slave. - * param config bit clock other configurations, can be NULL in slave mode. - */ -void SAI_RxSetBitclockConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_bit_clock_t *config) -{ - uint32_t rcr2 = base->RCR2; - - if ((masterSlave == kSAI_Master) || (masterSlave == kSAI_Bclk_Master_FrameSync_Slave)) - { - assert(config != NULL); - - rcr2 &= ~(I2S_RCR2_BCD_MASK | I2S_RCR2_BCP_MASK | I2S_RCR2_BCI_MASK | I2S_RCR2_BCS_MASK | I2S_RCR2_MSEL_MASK); - rcr2 |= I2S_RCR2_BCD(1U) | I2S_RCR2_BCP(config->bclkPolarity) | I2S_RCR2_BCI(config->bclkInputDelay) | - I2S_RCR2_BCS(config->bclkSrcSwap) | I2S_RCR2_MSEL(config->bclkSource); - } - else - { - rcr2 &= ~(I2S_RCR2_BCD_MASK); - rcr2 |= I2S_RCR2_BCP(config->bclkPolarity); - } - - base->RCR2 = rcr2; -} - -#if (defined(FSL_FEATURE_SAI_HAS_MCR) && (FSL_FEATURE_SAI_HAS_MCR)) || \ - (defined(FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) && (FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER)) -/*! - * brief Master clock configurations. - * - * param base SAI base pointer. - * param config master clock configurations. - */ -void SAI_SetMasterClockConfig(I2S_Type *base, sai_master_clock_t *config) -{ - assert(config != NULL); - -#if defined(FSL_FEATURE_SAI_HAS_MCR) && (FSL_FEATURE_SAI_HAS_MCR) - uint32_t val = 0; -#if !(defined(FSL_FEATURE_SAI_HAS_NO_MCR_MICS) && (FSL_FEATURE_SAI_HAS_NO_MCR_MICS)) - /* Master clock source setting */ - val = (base->MCR & ~I2S_MCR_MICS_MASK); - base->MCR = (val | I2S_MCR_MICS(config->mclkSource)); -#endif - - /* Configure Master clock output enable */ - val = (base->MCR & ~I2S_MCR_MOE_MASK); - base->MCR = (val | I2S_MCR_MOE(config->mclkOutputEnable)); -#endif /* FSL_FEATURE_SAI_HAS_MCR */ - -#if ((defined(FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) && (FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER)) || \ - (defined(FSL_FEATURE_SAI_HAS_MCR_MCLK_POST_DIV) && (FSL_FEATURE_SAI_HAS_MCR_MCLK_POST_DIV))) - /* Check if master clock divider enabled, then set master clock divider */ - if (config->mclkOutputEnable) - { - SAI_SetMasterClockDivider(base, config->mclkHz, config->mclkSourceClkHz); - } -#endif /* FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER */ -} -#endif - -#if FSL_SAI_HAS_FIFO_EXTEND_FEATURE -/*! - * brief SAI transmitter fifo configurations. - * - * param base SAI base pointer. - * param config fifo configurations. - */ -void SAI_TxSetFifoConfig(I2S_Type *base, sai_fifo_t *config) -{ - assert(config != NULL); -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((config->fifoWatermark == 0U) || - (config->fifoWatermark > (uint8_t)((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base)))) - { - config->fifoWatermark = (uint8_t)((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base) / 2U); - } -#endif - - uint32_t tcr4 = base->TCR4; - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE - tcr4 &= ~I2S_TCR4_FCOMB_MASK; - tcr4 |= I2S_TCR4_FCOMB(config->fifoCombine); -#endif - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) && FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR - tcr4 &= ~I2S_TCR4_FCONT_MASK; - /* ERR05144: not set FCONT = 1 when TMR > 0, the transmit shift register may not load correctly that will cause TX - * not work */ - if (base->TMR == 0U) - { - tcr4 |= I2S_TCR4_FCONT(config->fifoContinueOneError); - } -#endif - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_PACKING) && FSL_FEATURE_SAI_HAS_FIFO_PACKING - tcr4 &= ~I2S_TCR4_FPACK_MASK; - tcr4 |= I2S_TCR4_FPACK(config->fifoPacking); -#endif - - base->TCR4 = tcr4; - -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - base->TCR1 = (base->TCR1 & (~I2S_TCR1_TFW_MASK)) | I2S_TCR1_TFW(config->fifoWatermark); -#endif -} - -/*! - * brief SAI receiver fifo configurations. - * - * param base SAI base pointer. - * param config fifo configurations. - */ -void SAI_RxSetFifoConfig(I2S_Type *base, sai_fifo_t *config) -{ - assert(config != NULL); -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((config->fifoWatermark == 0U) || - (config->fifoWatermark > (uint8_t)((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base)))) - { - config->fifoWatermark = (uint8_t)((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base) / 2U); - } -#endif - uint32_t rcr4 = base->RCR4; - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE - rcr4 &= ~I2S_RCR4_FCOMB_MASK; - rcr4 |= I2S_RCR4_FCOMB(config->fifoCombine); -#endif - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) && FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR - rcr4 &= ~I2S_RCR4_FCONT_MASK; - rcr4 |= I2S_RCR4_FCONT(config->fifoContinueOneError); -#endif - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_PACKING) && FSL_FEATURE_SAI_HAS_FIFO_PACKING - rcr4 &= ~I2S_RCR4_FPACK_MASK; - rcr4 |= I2S_RCR4_FPACK(config->fifoPacking); -#endif - - base->RCR4 = rcr4; - -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - base->RCR1 = (base->RCR1 & (~I2S_RCR1_RFW_MASK)) | I2S_RCR1_RFW(config->fifoWatermark); -#endif -} -#endif - -/*! - * brief SAI transmitter Frame sync configurations. - * - * param base SAI base pointer. - * param masterSlave master or slave. - * param config frame sync configurations, can be NULL in slave mode. - */ -void SAI_TxSetFrameSyncConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_frame_sync_t *config) -{ - assert(config != NULL); - assert((config->frameSyncWidth - 1UL) <= (I2S_TCR4_SYWD_MASK >> I2S_TCR4_SYWD_SHIFT)); - - uint32_t tcr4 = base->TCR4; - - tcr4 &= ~(I2S_TCR4_FSE_MASK | I2S_TCR4_FSP_MASK | I2S_TCR4_FSD_MASK | I2S_TCR4_SYWD_MASK); - -#if defined(FSL_FEATURE_SAI_HAS_ON_DEMAND_MODE) && FSL_FEATURE_SAI_HAS_ON_DEMAND_MODE - tcr4 &= ~I2S_TCR4_ONDEM_MASK; - tcr4 |= I2S_TCR4_ONDEM(config->frameSyncGenerateOnDemand); -#endif - - tcr4 |= - I2S_TCR4_FSE(config->frameSyncEarly) | I2S_TCR4_FSP(config->frameSyncPolarity) | - I2S_TCR4_FSD(((masterSlave == kSAI_Master) || (masterSlave == kSAI_Bclk_Slave_FrameSync_Master)) ? 1UL : 0U) | - I2S_TCR4_SYWD(config->frameSyncWidth - 1UL); - - base->TCR4 = tcr4; -} - -/*! - * brief SAI receiver Frame sync configurations. - * - * param base SAI base pointer. - * param masterSlave master or slave. - * param config frame sync configurations, can be NULL in slave mode. - */ -void SAI_RxSetFrameSyncConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_frame_sync_t *config) -{ - assert(config != NULL); - assert((config->frameSyncWidth - 1UL) <= (I2S_RCR4_SYWD_MASK >> I2S_RCR4_SYWD_SHIFT)); - - uint32_t rcr4 = base->RCR4; - - rcr4 &= ~(I2S_RCR4_FSE_MASK | I2S_RCR4_FSP_MASK | I2S_RCR4_FSD_MASK | I2S_RCR4_SYWD_MASK); - -#if defined(FSL_FEATURE_SAI_HAS_ON_DEMAND_MODE) && FSL_FEATURE_SAI_HAS_ON_DEMAND_MODE - rcr4 &= ~I2S_RCR4_ONDEM_MASK; - rcr4 |= I2S_RCR4_ONDEM(config->frameSyncGenerateOnDemand); -#endif - - rcr4 |= - I2S_RCR4_FSE(config->frameSyncEarly) | I2S_RCR4_FSP(config->frameSyncPolarity) | - I2S_RCR4_FSD(((masterSlave == kSAI_Master) || (masterSlave == kSAI_Bclk_Slave_FrameSync_Master)) ? 1UL : 0U) | - I2S_RCR4_SYWD(config->frameSyncWidth - 1UL); - - base->RCR4 = rcr4; -} - -/*! - * brief SAI transmitter Serial data configurations. - * - * param base SAI base pointer. - * param config serial data configurations. - */ -void SAI_TxSetSerialDataConfig(I2S_Type *base, sai_serial_data_t *config) -{ - assert(config != NULL); - - uint32_t tcr4 = base->TCR4; - - base->TCR5 = I2S_TCR5_WNW(config->dataWordNLength - 1UL) | I2S_TCR5_W0W(config->dataWord0Length - 1UL) | - I2S_TCR5_FBT(config->dataFirstBitShifted - 1UL); - base->TMR = config->dataMaskedWord; -#if defined(FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) && FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR - /* ERR05144: not set FCONT = 1 when TMR > 0, the transmit shift register may not load correctly that will cause TX - * not work */ - if (config->dataMaskedWord > 0U) - { - tcr4 &= ~I2S_TCR4_FCONT_MASK; - } -#endif - tcr4 &= ~(I2S_TCR4_FRSZ_MASK | I2S_TCR4_MF_MASK); - tcr4 |= I2S_TCR4_FRSZ(config->dataWordNum - 1UL) | I2S_TCR4_MF(config->dataOrder); - -#if defined(FSL_FEATURE_SAI_HAS_CHANNEL_MODE) && FSL_FEATURE_SAI_HAS_CHANNEL_MODE - tcr4 &= ~I2S_TCR4_CHMOD_MASK; - tcr4 |= I2S_TCR4_CHMOD(config->dataMode); -#endif - - base->TCR4 = tcr4; -} - -/*! - * @brief SAI receiver Serial data configurations. - * - * @param base SAI base pointer. - * @param config serial data configurations. - */ -void SAI_RxSetSerialDataConfig(I2S_Type *base, sai_serial_data_t *config) -{ - assert(config != NULL); - - uint32_t rcr4 = base->RCR4; - - base->RCR5 = I2S_RCR5_WNW(config->dataWordNLength - 1UL) | I2S_RCR5_W0W(config->dataWord0Length - 1UL) | - I2S_RCR5_FBT(config->dataFirstBitShifted - 1UL); - base->RMR = config->dataMaskedWord; - - rcr4 &= ~(I2S_RCR4_FRSZ_MASK | I2S_RCR4_MF_MASK); - rcr4 |= I2S_RCR4_FRSZ(config->dataWordNum - 1uL) | I2S_RCR4_MF(config->dataOrder); - - base->RCR4 = rcr4; -} - -/*! - * brief SAI transmitter configurations. - * - * param base SAI base pointer. - * param config transmitter configurations. - */ -void SAI_TxSetConfig(I2S_Type *base, sai_transceiver_t *config) -{ - assert(config != NULL); - assert(FSL_FEATURE_SAI_CHANNEL_COUNTn(base) != -1); - - uint8_t i = 0U; - uint32_t val = 0U; - uint8_t channelNums = 0U; - - /* reset transmitter */ - SAI_TxReset(base); - - /* if channel mask is not set, then format->channel must be set, - use it to get channel mask value */ - if (config->channelMask == 0U) - { - config->channelMask = 1U << config->startChannel; - } - - for (i = 0U; i < (uint32_t)FSL_FEATURE_SAI_CHANNEL_COUNTn(base); i++) - { - if (IS_SAI_FLAG_SET(1UL << i, config->channelMask)) - { - channelNums++; - config->endChannel = i; - } - } - - for (i = 0U; i < (uint32_t)FSL_FEATURE_SAI_CHANNEL_COUNTn(base); i++) - { - if (IS_SAI_FLAG_SET((1UL << i), config->channelMask)) - { - config->startChannel = i; - break; - } - } - - config->channelNums = channelNums; -#if defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && (FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) - /* make sure combine mode disabled while multipe channel is used */ - if (config->channelNums > 1U) - { - base->TCR4 &= ~I2S_TCR4_FCOMB_MASK; - } -#endif - - /* Set data channel */ - base->TCR3 &= ~I2S_TCR3_TCE_MASK; - base->TCR3 |= I2S_TCR3_TCE(config->channelMask); - - if (config->syncMode == kSAI_ModeAsync) - { - val = base->TCR2; - val &= ~I2S_TCR2_SYNC_MASK; - base->TCR2 = (val | I2S_TCR2_SYNC(0U)); - } - if (config->syncMode == kSAI_ModeSync) - { - val = base->TCR2; - val &= ~I2S_TCR2_SYNC_MASK; - base->TCR2 = (val | I2S_TCR2_SYNC(1U)); - /* If sync with Rx, should set Rx to async mode */ - val = base->RCR2; - val &= ~I2S_RCR2_SYNC_MASK; - base->RCR2 = (val | I2S_RCR2_SYNC(0U)); - } -#if defined(FSL_FEATURE_SAI_HAS_SYNC_WITH_ANOTHER_SAI) && (FSL_FEATURE_SAI_HAS_SYNC_WITH_ANOTHER_SAI) - if (config->syncMode == kSAI_ModeSyncWithOtherTx) - { - val = base->TCR2; - val &= ~I2S_TCR2_SYNC_MASK; - base->TCR2 = (val | I2S_TCR2_SYNC(2U)); - } - if (config->syncMode == kSAI_ModeSyncWithOtherRx) - { - val = base->TCR2; - val &= ~I2S_TCR2_SYNC_MASK; - base->TCR2 = (val | I2S_TCR2_SYNC(3U)); - } -#endif /* FSL_FEATURE_SAI_HAS_SYNC_WITH_ANOTHER_SAI */ - - /* bit clock configurations */ - SAI_TxSetBitclockConfig(base, config->masterSlave, &config->bitClock); - /* serial data configurations */ - SAI_TxSetSerialDataConfig(base, &config->serialData); - /* frame sync configurations */ - SAI_TxSetFrameSyncConfig(base, config->masterSlave, &config->frameSync); -#if FSL_SAI_HAS_FIFO_EXTEND_FEATURE - /* fifo configurations */ - SAI_TxSetFifoConfig(base, &config->fifo); -#endif -} - -/*! - * brief SAI transmitter transfer configurations. - * - * This function initializes the TX, include bit clock, frame sync, master clock, serial data and fifo configurations. - * - * param base SAI base pointer. - * param handle SAI handle pointer. - * param config tranmitter configurations. - */ -void SAI_TransferTxSetConfig(I2S_Type *base, sai_handle_t *handle, sai_transceiver_t *config) -{ - assert(handle != NULL); - assert(config != NULL); - assert(config->channelNums <= (uint32_t)FSL_FEATURE_SAI_CHANNEL_COUNTn(base)); - - handle->bitWidth = config->serialData.dataWordNLength; -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((config->fifo.fifoWatermark == 0U) || - (config->fifo.fifoWatermark > (uint8_t)((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base)))) - { - config->fifo.fifoWatermark = (uint8_t)((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base) / 2U); - } - handle->watermark = config->fifo.fifoWatermark; -#endif - - /* transmitter configurations */ - SAI_TxSetConfig(base, config); - - handle->channel = config->startChannel; - /* used for multi channel */ - handle->channelMask = config->channelMask; - handle->channelNums = config->channelNums; - handle->endChannel = config->endChannel; -} - -/*! - * brief SAI receiver configurations. - * - * param base SAI base pointer. - * param config transmitter configurations. - */ -void SAI_RxSetConfig(I2S_Type *base, sai_transceiver_t *config) -{ - assert(config != NULL); - assert(FSL_FEATURE_SAI_CHANNEL_COUNTn(base) != -1); - - uint8_t i = 0U; - uint32_t val = 0U; - uint8_t channelNums = 0U; - - /* reset receiver */ - SAI_RxReset(base); - - /* if channel mask is not set, then format->channel must be set, - use it to get channel mask value */ - if (config->channelMask == 0U) - { - config->channelMask = 1U << config->startChannel; - } - - for (i = 0U; i < (uint32_t)FSL_FEATURE_SAI_CHANNEL_COUNTn(base); i++) - { - if (IS_SAI_FLAG_SET((1UL << i), config->channelMask)) - { - channelNums++; - config->endChannel = i; - } - } - - for (i = 0U; i < (uint32_t)FSL_FEATURE_SAI_CHANNEL_COUNTn(base); i++) - { - if (IS_SAI_FLAG_SET((1UL << i), config->channelMask)) - { - config->startChannel = i; - break; - } - } - - config->channelNums = channelNums; -#if defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && (FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) - /* make sure combine mode disabled while multipe channel is used */ - if (config->channelNums > 1U) - { - base->RCR4 &= ~I2S_RCR4_FCOMB_MASK; - } -#endif - - /* Set data channel */ - base->RCR3 &= ~I2S_RCR3_RCE_MASK; - base->RCR3 |= I2S_RCR3_RCE(config->channelMask); - - /* Set Sync mode */ - if (config->syncMode == kSAI_ModeAsync) - { - val = base->RCR2; - val &= ~I2S_RCR2_SYNC_MASK; - base->RCR2 = (val | I2S_RCR2_SYNC(0U)); - } - if (config->syncMode == kSAI_ModeSync) - { - val = base->RCR2; - val &= ~I2S_RCR2_SYNC_MASK; - base->RCR2 = (val | I2S_RCR2_SYNC(1U)); - /* If sync with Tx, should set Tx to async mode */ - val = base->TCR2; - val &= ~I2S_TCR2_SYNC_MASK; - base->TCR2 = (val | I2S_TCR2_SYNC(0U)); - } -#if defined(FSL_FEATURE_SAI_HAS_SYNC_WITH_ANOTHER_SAI) && (FSL_FEATURE_SAI_HAS_SYNC_WITH_ANOTHER_SAI) - if (config->syncMode == kSAI_ModeSyncWithOtherTx) - { - val = base->RCR2; - val &= ~I2S_RCR2_SYNC_MASK; - base->RCR2 = (val | I2S_RCR2_SYNC(2U)); - } - if (config->syncMode == kSAI_ModeSyncWithOtherRx) - { - val = base->RCR2; - val &= ~I2S_RCR2_SYNC_MASK; - base->RCR2 = (val | I2S_RCR2_SYNC(3U)); - } -#endif /* FSL_FEATURE_SAI_HAS_SYNC_WITH_ANOTHER_SAI */ - - /* bit clock configurations */ - SAI_RxSetBitclockConfig(base, config->masterSlave, &config->bitClock); - /* serial data configurations */ - SAI_RxSetSerialDataConfig(base, &config->serialData); - /* frame sync configurations */ - SAI_RxSetFrameSyncConfig(base, config->masterSlave, &config->frameSync); -#if FSL_SAI_HAS_FIFO_EXTEND_FEATURE - /* fifo configurations */ - SAI_RxSetFifoConfig(base, &config->fifo); -#endif -} - -/*! - * brief SAI receiver transfer configurations. - * - * This function initializes the TX, include bit clock, frame sync, master clock, serial data and fifo configurations. - * - * param base SAI base pointer. - * param handle SAI handle pointer. - * param config tranmitter configurations. - */ -void SAI_TransferRxSetConfig(I2S_Type *base, sai_handle_t *handle, sai_transceiver_t *config) -{ - assert(handle != NULL); - assert(config != NULL); - - handle->bitWidth = config->serialData.dataWordNLength; -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((config->fifo.fifoWatermark == 0U) || - (config->fifo.fifoWatermark > (uint8_t)((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base)))) - { - config->fifo.fifoWatermark = (uint8_t)((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base) / 2U); - } - handle->watermark = config->fifo.fifoWatermark; -#endif - - /* receiver configurations */ - SAI_RxSetConfig(base, config); - - handle->channel = config->startChannel; - /* used for multi channel */ - handle->channelMask = config->channelMask; - handle->channelNums = config->channelNums; - handle->endChannel = config->endChannel; -} - -/*! - * brief Get classic I2S mode configurations. - * - * param config transceiver configurations. - * param bitWidth audio data bitWidth. - * param mode audio data channel. - * param saiChannelMask channel mask value to enable. - */ -void SAI_GetClassicI2SConfig(sai_transceiver_t *config, - sai_word_width_t bitWidth, - sai_mono_stereo_t mode, - uint32_t saiChannelMask) -{ - SAI_GetCommonConfig(config, bitWidth, mode, saiChannelMask); -} - -/*! - * brief Get left justified mode configurations. - * - * param config transceiver configurations. - * param bitWidth audio data bitWidth. - * param mode audio data channel. - * param saiChannelMask channel mask value to enable. - */ -void SAI_GetLeftJustifiedConfig(sai_transceiver_t *config, - sai_word_width_t bitWidth, - sai_mono_stereo_t mode, - uint32_t saiChannelMask) -{ - assert(NULL != config); - assert(saiChannelMask != 0U); - - SAI_GetCommonConfig(config, bitWidth, mode, saiChannelMask); - - config->frameSync.frameSyncEarly = false; - config->frameSync.frameSyncPolarity = kSAI_PolarityActiveHigh; -} - -/*! - * brief Get right justified mode configurations. - * - * param config transceiver configurations. - * param bitWidth audio data bitWidth. - * param mode audio data channel. - * param saiChannelMask channel mask value to enable. - */ -void SAI_GetRightJustifiedConfig(sai_transceiver_t *config, - sai_word_width_t bitWidth, - sai_mono_stereo_t mode, - uint32_t saiChannelMask) -{ - assert(NULL != config); - assert(saiChannelMask != 0U); - - SAI_GetCommonConfig(config, bitWidth, mode, saiChannelMask); - - config->frameSync.frameSyncEarly = false; - config->frameSync.frameSyncPolarity = kSAI_PolarityActiveHigh; -} - -/*! - * brief Get DSP mode configurations. - * - * note DSP mode is also called PCM mode which support MODE A and MODE B, - * DSP/PCM MODE A configuration flow. RX is similiar but uses SAI_RxSetConfig instead of SAI_TxSetConfig: - * code - * SAI_GetDSPConfig(config, kSAI_FrameSyncLenOneBitClk, bitWidth, kSAI_Stereo, channelMask) - * config->frameSync.frameSyncEarly = true; - * SAI_TxSetConfig(base, config) - * endcode - * - * DSP/PCM MODE B configuration flow for TX. RX is similiar but uses SAI_RxSetConfig instead of SAI_TxSetConfig: - * code - * SAI_GetDSPConfig(config, kSAI_FrameSyncLenOneBitClk, bitWidth, kSAI_Stereo, channelMask) - * SAI_TxSetConfig(base, config) - * endcode - * - * param config transceiver configurations. - * param frameSyncWidth length of frame sync. - * param bitWidth audio data bitWidth. - * param mode audio data channel. - * param saiChannelMask mask value of the channel to enable. - */ -void SAI_GetDSPConfig(sai_transceiver_t *config, - sai_frame_sync_len_t frameSyncWidth, - sai_word_width_t bitWidth, - sai_mono_stereo_t mode, - uint32_t saiChannelMask) -{ - assert(NULL != config); - assert(saiChannelMask != 0U); - - SAI_GetCommonConfig(config, bitWidth, mode, saiChannelMask); - - /* frame sync default configurations */ - switch (frameSyncWidth) - { - case kSAI_FrameSyncLenOneBitClk: - config->frameSync.frameSyncWidth = 1U; - break; - default: - assert(false); - break; - } - config->frameSync.frameSyncEarly = false; - config->frameSync.frameSyncPolarity = kSAI_PolarityActiveHigh; -} - -/*! - * brief Get TDM mode configurations. - * - * param config transceiver configurations. - * param bitWidth audio data bitWidth. - * param mode audio data channel. - * param saiChannelMask channel mask value to enable. - */ -void SAI_GetTDMConfig(sai_transceiver_t *config, - sai_frame_sync_len_t frameSyncWidth, - sai_word_width_t bitWidth, - uint32_t dataWordNum, - uint32_t saiChannelMask) -{ - assert(NULL != config); - assert(saiChannelMask != 0U); - assert(dataWordNum <= 32U); - - SAI_GetCommonConfig(config, bitWidth, kSAI_Stereo, saiChannelMask); - - /* frame sync default configurations */ - switch (frameSyncWidth) - { - case kSAI_FrameSyncLenOneBitClk: - config->frameSync.frameSyncWidth = 1U; - break; - case kSAI_FrameSyncLenPerWordWidth: - break; - default: - assert(false); - break; - } - config->frameSync.frameSyncEarly = false; - config->frameSync.frameSyncPolarity = kSAI_PolarityActiveHigh; - config->serialData.dataWordNum = (uint8_t)dataWordNum; -} - -/*! - * brief Sends data using a blocking method. - * - * note This function blocks by polling until data is ready to be sent. - * - * param base SAI base pointer. - * param channel Data channel used. - * param bitWidth How many bits in an audio word; usually 8/16/24/32 bits. - * param buffer Pointer to the data to be written. - * param size Bytes to be written. - */ -void SAI_WriteBlocking(I2S_Type *base, uint32_t channel, uint32_t bitWidth, uint8_t *buffer, uint32_t size) -{ - uint32_t i = 0; - uint32_t bytesPerWord = bitWidth / 8U; -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - bytesPerWord = (((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base) - base->TCR1) * bytesPerWord); -#endif - - while (i < size) - { - /* Wait until it can write data */ - while (!(IS_SAI_FLAG_SET(base->TCSR, I2S_TCSR_FWF_MASK))) - { - } - - SAI_WriteNonBlocking(base, channel, 1UL << channel, channel, (uint8_t)bitWidth, buffer, bytesPerWord); - buffer = (uint8_t *)((uintptr_t)buffer + bytesPerWord); - i += bytesPerWord; - } - - /* Wait until the last data is sent */ - while (!(IS_SAI_FLAG_SET(base->TCSR, I2S_TCSR_FWF_MASK))) - { - } -} - -/*! - * brief Sends data to multi channel using a blocking method. - * - * note This function blocks by polling until data is ready to be sent. - * - * param base SAI base pointer. - * param channel Data channel used. - * param channelMask channel mask. - * param bitWidth How many bits in an audio word; usually 8/16/24/32 bits. - * param buffer Pointer to the data to be written. - * param size Bytes to be written. - */ -void SAI_WriteMultiChannelBlocking( - I2S_Type *base, uint32_t channel, uint32_t channelMask, uint32_t bitWidth, uint8_t *buffer, uint32_t size) -{ - assert(FSL_FEATURE_SAI_CHANNEL_COUNTn(base) != -1); - - uint32_t i = 0, j = 0; - uint32_t bytesPerWord = bitWidth / 8U; - uint32_t channelNums = 0U, endChannel = 0U; - -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - bytesPerWord = (((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base) - base->TCR1) * bytesPerWord); -#endif - - for (i = 0U; (i < (uint32_t)FSL_FEATURE_SAI_CHANNEL_COUNTn(base)); i++) - { - if (IS_SAI_FLAG_SET((1UL << i), channelMask)) - { - channelNums++; - endChannel = i; - } - } - - bytesPerWord *= channelNums; - - while (j < size) - { - /* Wait until it can write data */ - while (!(IS_SAI_FLAG_SET(base->TCSR, I2S_TCSR_FWF_MASK))) - { - } - - SAI_WriteNonBlocking(base, channel, channelMask, endChannel, (uint8_t)bitWidth, buffer, - bytesPerWord * channelNums); - buffer = (uint8_t *)((uintptr_t)buffer + bytesPerWord * channelNums); - j += bytesPerWord * channelNums; - } - - /* Wait until the last data is sent */ - while (!(IS_SAI_FLAG_SET(base->TCSR, I2S_TCSR_FWF_MASK))) - { - } -} - -/*! - * brief Receives multi channel data using a blocking method. - * - * note This function blocks by polling until data is ready to be sent. - * - * param base SAI base pointer. - * param channel Data channel used. - * param channelMask channel mask. - * param bitWidth How many bits in an audio word; usually 8/16/24/32 bits. - * param buffer Pointer to the data to be read. - * param size Bytes to be read. - */ -void SAI_ReadMultiChannelBlocking( - I2S_Type *base, uint32_t channel, uint32_t channelMask, uint32_t bitWidth, uint8_t *buffer, uint32_t size) -{ - assert(FSL_FEATURE_SAI_CHANNEL_COUNTn(base) != -1); - - uint32_t i = 0, j = 0; - uint32_t bytesPerWord = bitWidth / 8U; - uint32_t channelNums = 0U, endChannel = 0U; -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - bytesPerWord = base->RCR1 * bytesPerWord; -#endif - for (i = 0U; (i < (uint32_t)FSL_FEATURE_SAI_CHANNEL_COUNTn(base)); i++) - { - if (IS_SAI_FLAG_SET((1UL << i), channelMask)) - { - channelNums++; - endChannel = i; - } - } - - bytesPerWord *= channelNums; - - while (j < size) - { - /* Wait until data is received */ - while (!(IS_SAI_FLAG_SET(base->RCSR, I2S_RCSR_FWF_MASK))) - { - } - - SAI_ReadNonBlocking(base, channel, channelMask, endChannel, (uint8_t)bitWidth, buffer, - bytesPerWord * channelNums); - buffer = (uint8_t *)((uintptr_t)buffer + bytesPerWord * channelNums); - j += bytesPerWord * channelNums; - } -} - -/*! - * brief Receives data using a blocking method. - * - * note This function blocks by polling until data is ready to be sent. - * - * param base SAI base pointer. - * param channel Data channel used. - * param bitWidth How many bits in an audio word; usually 8/16/24/32 bits. - * param buffer Pointer to the data to be read. - * param size Bytes to be read. - */ -void SAI_ReadBlocking(I2S_Type *base, uint32_t channel, uint32_t bitWidth, uint8_t *buffer, uint32_t size) -{ - uint32_t i = 0; - uint32_t bytesPerWord = bitWidth / 8U; -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - bytesPerWord = base->RCR1 * bytesPerWord; -#endif - - while (i < size) - { - /* Wait until data is received */ - while (!(IS_SAI_FLAG_SET(base->RCSR, I2S_RCSR_FWF_MASK))) - { - } - - SAI_ReadNonBlocking(base, channel, 1UL << channel, channel, (uint8_t)bitWidth, buffer, bytesPerWord); - buffer = (uint8_t *)((uintptr_t)buffer + bytesPerWord); - i += bytesPerWord; - } -} - -/*! - * brief Initializes the SAI Tx handle. - * - * This function initializes the Tx handle for the SAI Tx transactional APIs. Call - * this function once to get the handle initialized. - * - * param base SAI base pointer - * param handle SAI handle pointer. - * param callback Pointer to the user callback function. - * param userData User parameter passed to the callback function - */ -void SAI_TransferTxCreateHandle(I2S_Type *base, sai_handle_t *handle, sai_transfer_callback_t callback, void *userData) -{ - assert(handle != NULL); - - /* Zero the handle */ - (void)memset(handle, 0, sizeof(*handle)); - - s_saiHandle[SAI_GetInstance(base)][0] = handle; - - handle->callback = callback; - handle->userData = userData; - handle->base = base; - - /* Set the isr pointer */ - s_saiTxIsr = SAI_TransferTxHandleIRQ; - - /* Enable Tx irq */ - (void)EnableIRQ(s_saiTxIRQ[SAI_GetInstance(base)]); -} - -/*! - * brief Initializes the SAI Rx handle. - * - * This function initializes the Rx handle for the SAI Rx transactional APIs. Call - * this function once to get the handle initialized. - * - * param base SAI base pointer. - * param handle SAI handle pointer. - * param callback Pointer to the user callback function. - * param userData User parameter passed to the callback function. - */ -void SAI_TransferRxCreateHandle(I2S_Type *base, sai_handle_t *handle, sai_transfer_callback_t callback, void *userData) -{ - assert(handle != NULL); - - /* Zero the handle */ - (void)memset(handle, 0, sizeof(*handle)); - - s_saiHandle[SAI_GetInstance(base)][1] = handle; - - handle->callback = callback; - handle->userData = userData; - handle->base = base; - - /* Set the isr pointer */ - s_saiRxIsr = SAI_TransferRxHandleIRQ; - - /* Enable Rx irq */ - (void)EnableIRQ(s_saiRxIRQ[SAI_GetInstance(base)]); -} - -/*! - * brief Performs an interrupt non-blocking send transfer on SAI. - * - * note This API returns immediately after the transfer initiates. - * Call the SAI_TxGetTransferStatusIRQ to poll the transfer status and check whether - * the transfer is finished. If the return status is not kStatus_SAI_Busy, the transfer - * is finished. - * - * param base SAI base pointer. - * param handle Pointer to the sai_handle_t structure which stores the transfer state. - * param xfer Pointer to the sai_transfer_t structure. - * retval kStatus_Success Successfully started the data receive. - * retval kStatus_SAI_TxBusy Previous receive still not finished. - * retval kStatus_InvalidArgument The input parameter is invalid. - */ -status_t SAI_TransferSendNonBlocking(I2S_Type *base, sai_handle_t *handle, sai_transfer_t *xfer) -{ - assert(handle != NULL); - assert(handle->channelNums <= (uint32_t)FSL_FEATURE_SAI_CHANNEL_COUNTn(base)); - - /* Check if the queue is full */ - if (handle->saiQueue[handle->queueUser].data != NULL) - { - return kStatus_SAI_QueueFull; - } - - /* Add into queue */ - handle->transferSize[handle->queueUser] = xfer->dataSize; - handle->saiQueue[handle->queueUser].data = xfer->data; - handle->saiQueue[handle->queueUser].dataSize = xfer->dataSize; - handle->queueUser = (handle->queueUser + 1U) % (uint8_t)SAI_XFER_QUEUE_SIZE; - - /* Set the state to busy */ - handle->state = (uint32_t)kSAI_Busy; - - /* Enable interrupt */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - /* Use FIFO request interrupt and fifo error*/ - SAI_TxEnableInterrupts(base, I2S_TCSR_FEIE_MASK | I2S_TCSR_FRIE_MASK); -#else - SAI_TxEnableInterrupts(base, I2S_TCSR_FEIE_MASK | I2S_TCSR_FWIE_MASK); -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ - - /* Enable Tx transfer */ - SAI_TxEnable(base, true); - - return kStatus_Success; -} - -/*! - * brief Performs an interrupt non-blocking receive transfer on SAI. - * - * note This API returns immediately after the transfer initiates. - * Call the SAI_RxGetTransferStatusIRQ to poll the transfer status and check whether - * the transfer is finished. If the return status is not kStatus_SAI_Busy, the transfer - * is finished. - * - * param base SAI base pointer - * param handle Pointer to the sai_handle_t structure which stores the transfer state. - * param xfer Pointer to the sai_transfer_t structure. - * retval kStatus_Success Successfully started the data receive. - * retval kStatus_SAI_RxBusy Previous receive still not finished. - * retval kStatus_InvalidArgument The input parameter is invalid. - */ -status_t SAI_TransferReceiveNonBlocking(I2S_Type *base, sai_handle_t *handle, sai_transfer_t *xfer) -{ - assert(handle != NULL); - assert(handle->channelNums <= (uint32_t)FSL_FEATURE_SAI_CHANNEL_COUNTn(base)); - - /* Check if the queue is full */ - if (handle->saiQueue[handle->queueUser].data != NULL) - { - return kStatus_SAI_QueueFull; - } - - /* Add into queue */ - handle->transferSize[handle->queueUser] = xfer->dataSize; - handle->saiQueue[handle->queueUser].data = xfer->data; - handle->saiQueue[handle->queueUser].dataSize = xfer->dataSize; - handle->queueUser = (handle->queueUser + 1U) % (uint8_t)SAI_XFER_QUEUE_SIZE; - - /* Set state to busy */ - handle->state = (uint32_t)kSAI_Busy; - -/* Enable interrupt */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - /* Use FIFO request interrupt and fifo error*/ - SAI_RxEnableInterrupts(base, I2S_TCSR_FEIE_MASK | I2S_TCSR_FRIE_MASK); -#else - SAI_RxEnableInterrupts(base, I2S_TCSR_FEIE_MASK | I2S_TCSR_FWIE_MASK); -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ - - /* Enable Rx transfer */ - SAI_RxEnable(base, true); - - return kStatus_Success; -} - -/*! - * brief Gets a set byte count. - * - * param base SAI base pointer. - * param handle Pointer to the sai_handle_t structure which stores the transfer state. - * param count Bytes count sent. - * retval kStatus_Success Succeed get the transfer count. - * retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t SAI_TransferGetSendCount(I2S_Type *base, sai_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - status_t status = kStatus_Success; - uint32_t queueDriverIndex = handle->queueDriver; - - if (handle->state != (uint32_t)kSAI_Busy) - { - status = kStatus_NoTransferInProgress; - } - else - { - *count = (handle->transferSize[queueDriverIndex] - handle->saiQueue[queueDriverIndex].dataSize); - } - - return status; -} - -/*! - * brief Gets a received byte count. - * - * param base SAI base pointer. - * param handle Pointer to the sai_handle_t structure which stores the transfer state. - * param count Bytes count received. - * retval kStatus_Success Succeed get the transfer count. - * retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t SAI_TransferGetReceiveCount(I2S_Type *base, sai_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - status_t status = kStatus_Success; - uint32_t queueDriverIndex = handle->queueDriver; - - if (handle->state != (uint32_t)kSAI_Busy) - { - status = kStatus_NoTransferInProgress; - } - else - { - *count = (handle->transferSize[queueDriverIndex] - handle->saiQueue[queueDriverIndex].dataSize); - } - - return status; -} - -/*! - * brief Aborts the current send. - * - * note This API can be called any time when an interrupt non-blocking transfer initiates - * to abort the transfer early. - * - * param base SAI base pointer. - * param handle Pointer to the sai_handle_t structure which stores the transfer state. - */ -void SAI_TransferAbortSend(I2S_Type *base, sai_handle_t *handle) -{ - assert(handle != NULL); - - /* Stop Tx transfer and disable interrupt */ - SAI_TxEnable(base, false); -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - /* Use FIFO request interrupt and fifo error */ - SAI_TxDisableInterrupts(base, I2S_TCSR_FEIE_MASK | I2S_TCSR_FRIE_MASK); -#else - SAI_TxDisableInterrupts(base, I2S_TCSR_FEIE_MASK | I2S_TCSR_FWIE_MASK); -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ - - handle->state = (uint32_t)kSAI_Idle; - - /* Clear the queue */ - (void)memset(handle->saiQueue, 0, sizeof(sai_transfer_t) * (uint8_t)SAI_XFER_QUEUE_SIZE); - handle->queueDriver = 0; - handle->queueUser = 0; -} - -/*! - * brief Aborts the current IRQ receive. - * - * note This API can be called when an interrupt non-blocking transfer initiates - * to abort the transfer early. - * - * param base SAI base pointer - * param handle Pointer to the sai_handle_t structure which stores the transfer state. - */ -void SAI_TransferAbortReceive(I2S_Type *base, sai_handle_t *handle) -{ - assert(handle != NULL); - - /* Stop Tx transfer and disable interrupt */ - SAI_RxEnable(base, false); -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - /* Use FIFO request interrupt and fifo error */ - SAI_RxDisableInterrupts(base, I2S_TCSR_FEIE_MASK | I2S_TCSR_FRIE_MASK); -#else - SAI_RxDisableInterrupts(base, I2S_TCSR_FEIE_MASK | I2S_TCSR_FWIE_MASK); -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ - - handle->state = (uint32_t)kSAI_Idle; - - /* Clear the queue */ - (void)memset(handle->saiQueue, 0, sizeof(sai_transfer_t) * (uint8_t)SAI_XFER_QUEUE_SIZE); - handle->queueDriver = 0; - handle->queueUser = 0; -} - -/*! - * brief Terminate all SAI send. - * - * This function will clear all transfer slots buffered in the sai queue. If users only want to abort the - * current transfer slot, please call SAI_TransferAbortSend. - * - * param base SAI base pointer. - * param handle SAI eDMA handle pointer. - */ -void SAI_TransferTerminateSend(I2S_Type *base, sai_handle_t *handle) -{ - assert(handle != NULL); - - /* Abort the current transfer */ - SAI_TransferAbortSend(base, handle); - - /* Clear all the internal information */ - (void)memset(handle->saiQueue, 0, sizeof(handle->saiQueue)); - (void)memset(handle->transferSize, 0, sizeof(handle->transferSize)); - - handle->queueUser = 0U; - handle->queueDriver = 0U; -} - -/*! - * brief Terminate all SAI receive. - * - * This function will clear all transfer slots buffered in the sai queue. If users only want to abort the - * current transfer slot, please call SAI_TransferAbortReceive. - * - * param base SAI base pointer. - * param handle SAI eDMA handle pointer. - */ -void SAI_TransferTerminateReceive(I2S_Type *base, sai_handle_t *handle) -{ - assert(handle != NULL); - - /* Abort the current transfer */ - SAI_TransferAbortReceive(base, handle); - - /* Clear all the internal information */ - (void)memset(handle->saiQueue, 0, sizeof(handle->saiQueue)); - (void)memset(handle->transferSize, 0, sizeof(handle->transferSize)); - - handle->queueUser = 0U; - handle->queueDriver = 0U; -} - -/*! - * brief Tx interrupt handler. - * - * param base SAI base pointer. - * param handle Pointer to the sai_handle_t structure. - */ -void SAI_TransferTxHandleIRQ(I2S_Type *base, sai_handle_t *handle) -{ - assert(handle != NULL); - - uint8_t *buffer = handle->saiQueue[handle->queueDriver].data; - uint32_t dataSize = (handle->bitWidth / 8UL) * handle->channelNums; - - /* Handle Error */ - if (IS_SAI_FLAG_SET(base->TCSR, I2S_TCSR_FEF_MASK)) - { - /* Clear FIFO error flag to continue transfer */ - SAI_TxClearStatusFlags(base, I2S_TCSR_FEF_MASK); - - /* Reset FIFO for safety */ - SAI_TxSoftwareReset(base, kSAI_ResetTypeFIFO); - - /* Call the callback */ - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_SAI_TxError, handle->userData); - } - } - -/* Handle transfer */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if (IS_SAI_FLAG_SET(base->TCSR, I2S_TCSR_FRF_MASK)) - { - /* Judge if the data need to transmit is less than space */ - size_t size = MIN((handle->saiQueue[handle->queueDriver].dataSize), - (size_t)(((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base) - handle->watermark) * dataSize)); - - /* Copy the data from sai buffer to FIFO */ - SAI_WriteNonBlocking(base, handle->channel, handle->channelMask, handle->endChannel, handle->bitWidth, buffer, - size); - - /* Update the internal counter */ - handle->saiQueue[handle->queueDriver].dataSize -= size; - handle->saiQueue[handle->queueDriver].data = (uint8_t *)((uintptr_t)buffer + size); - } -#else - if (IS_SAI_FLAG_SET(base->TCSR, I2S_TCSR_FWF_MASK)) - { - size_t size = MIN((handle->saiQueue[handle->queueDriver].dataSize), dataSize); - - SAI_WriteNonBlocking(base, handle->channel, handle->channelMask, handle->endChannel, handle->bitWidth, buffer, - size); - - /* Update internal counter */ - handle->saiQueue[handle->queueDriver].dataSize -= size; - handle->saiQueue[handle->queueDriver].data = (uint8_t *)((uintptr_t)buffer + size); - } -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ - - /* If finished a block, call the callback function */ - if (handle->saiQueue[handle->queueDriver].dataSize == 0U) - { - (void)memset(&handle->saiQueue[handle->queueDriver], 0, sizeof(sai_transfer_t)); - handle->queueDriver = (handle->queueDriver + 1U) % (uint8_t)SAI_XFER_QUEUE_SIZE; - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_SAI_TxIdle, handle->userData); - } - } - - /* If all data finished, just stop the transfer */ - if (handle->saiQueue[handle->queueDriver].data == NULL) - { - SAI_TransferAbortSend(base, handle); - } -} - -/*! - * brief Tx interrupt handler. - * - * param base SAI base pointer. - * param handle Pointer to the sai_handle_t structure. - */ -void SAI_TransferRxHandleIRQ(I2S_Type *base, sai_handle_t *handle) -{ - assert(handle != NULL); - - uint8_t *buffer = handle->saiQueue[handle->queueDriver].data; - uint32_t dataSize = (handle->bitWidth / 8UL) * handle->channelNums; - - /* Handle Error */ - if (IS_SAI_FLAG_SET(base->RCSR, I2S_RCSR_FEF_MASK)) - { - /* Clear FIFO error flag to continue transfer */ - SAI_RxClearStatusFlags(base, I2S_TCSR_FEF_MASK); - - /* Reset FIFO for safety */ - SAI_RxSoftwareReset(base, kSAI_ResetTypeFIFO); - - /* Call the callback */ - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_SAI_RxError, handle->userData); - } - } - -/* Handle transfer */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if (IS_SAI_FLAG_SET(base->RCSR, I2S_RCSR_FRF_MASK)) - { - /* Judge if the data need to transmit is less than space */ - size_t size = MIN((handle->saiQueue[handle->queueDriver].dataSize), handle->watermark * dataSize); - - /* Copy the data from sai buffer to FIFO */ - SAI_ReadNonBlocking(base, handle->channel, handle->channelMask, handle->endChannel, handle->bitWidth, buffer, - size); - - /* Update the internal counter */ - handle->saiQueue[handle->queueDriver].dataSize -= size; - handle->saiQueue[handle->queueDriver].data = (uint8_t *)((uintptr_t)buffer + size); - } -#else - if (IS_SAI_FLAG_SET(base->RCSR, I2S_RCSR_FWF_MASK)) - { - size_t size = MIN((handle->saiQueue[handle->queueDriver].dataSize), dataSize); - - SAI_ReadNonBlocking(base, handle->channel, handle->channelMask, handle->endChannel, handle->bitWidth, buffer, - size); - - /* Update internal state */ - handle->saiQueue[handle->queueDriver].dataSize -= size; - handle->saiQueue[handle->queueDriver].data = (uint8_t *)((uintptr_t)buffer + size); - } -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ - - /* If finished a block, call the callback function */ - if (handle->saiQueue[handle->queueDriver].dataSize == 0U) - { - (void)memset(&handle->saiQueue[handle->queueDriver], 0, sizeof(sai_transfer_t)); - handle->queueDriver = (handle->queueDriver + 1U) % (uint8_t)SAI_XFER_QUEUE_SIZE; - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_SAI_RxIdle, handle->userData); - } - } - - /* If all data finished, just stop the transfer */ - if (handle->saiQueue[handle->queueDriver].data == NULL) - { - SAI_TransferAbortReceive(base, handle); - } -} - -#if defined(I2S0) -void I2S0_DriverIRQHandler(void); -void I2S0_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[0][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S0, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[0][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S0, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(I2S0, s_saiHandle[0][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[0][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S0, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[0][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S0, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(I2S0, s_saiHandle[0][0]); - } - SDK_ISR_EXIT_BARRIER; -} - -void I2S0_Tx_DriverIRQHandler(void); -void I2S0_Tx_DriverIRQHandler(void) -{ - assert(s_saiHandle[0][0] != NULL); - s_saiTxIsr(I2S0, s_saiHandle[0][0]); - SDK_ISR_EXIT_BARRIER; -} - -void I2S0_Rx_DriverIRQHandler(void); -void I2S0_Rx_DriverIRQHandler(void) -{ - assert(s_saiHandle[0][1] != NULL); - s_saiRxIsr(I2S0, s_saiHandle[0][1]); - SDK_ISR_EXIT_BARRIER; -} -#endif /* I2S0*/ - -#if defined(I2S1) -void I2S1_DriverIRQHandler(void); -void I2S1_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S1, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S1, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(I2S1, s_saiHandle[1][1]); - } - -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S1, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S1, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(I2S1, s_saiHandle[1][0]); - } - SDK_ISR_EXIT_BARRIER; -} - -void I2S1_Tx_DriverIRQHandler(void); -void I2S1_Tx_DriverIRQHandler(void) -{ - assert(s_saiHandle[1][0] != NULL); - s_saiTxIsr(I2S1, s_saiHandle[1][0]); - SDK_ISR_EXIT_BARRIER; -} - -void I2S1_Rx_DriverIRQHandler(void); -void I2S1_Rx_DriverIRQHandler(void) -{ - assert(s_saiHandle[1][1] != NULL); - s_saiRxIsr(I2S1, s_saiHandle[1][1]); - SDK_ISR_EXIT_BARRIER; -} -#endif /* I2S1*/ - -#if defined(I2S2) -void I2S2_DriverIRQHandler(void); -void I2S2_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[2][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S2, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[2][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S2, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(I2S2, s_saiHandle[2][1]); - } - -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[2][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S2, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[2][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S2, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(I2S2, s_saiHandle[2][0]); - } - SDK_ISR_EXIT_BARRIER; -} - -void I2S2_Tx_DriverIRQHandler(void); -void I2S2_Tx_DriverIRQHandler(void) -{ - assert(s_saiHandle[2][0] != NULL); - s_saiTxIsr(I2S2, s_saiHandle[2][0]); - SDK_ISR_EXIT_BARRIER; -} - -void I2S2_Rx_DriverIRQHandler(void); -void I2S2_Rx_DriverIRQHandler(void) -{ - assert(s_saiHandle[2][1] != NULL); - s_saiRxIsr(I2S2, s_saiHandle[2][1]); - SDK_ISR_EXIT_BARRIER; -} -#endif /* I2S2*/ - -#if defined(I2S3) -void I2S3_DriverIRQHandler(void); -void I2S3_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[3][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S3, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[3][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S3, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(I2S3, s_saiHandle[3][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[3][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S3, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[3][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S3, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(I2S3, s_saiHandle[3][0]); - } - SDK_ISR_EXIT_BARRIER; -} - -void I2S3_Tx_DriverIRQHandler(void); -void I2S3_Tx_DriverIRQHandler(void) -{ - assert(s_saiHandle[3][0] != NULL); - s_saiTxIsr(I2S3, s_saiHandle[3][0]); - SDK_ISR_EXIT_BARRIER; -} - -void I2S3_Rx_DriverIRQHandler(void); -void I2S3_Rx_DriverIRQHandler(void) -{ - assert(s_saiHandle[3][1] != NULL); - s_saiRxIsr(I2S3, s_saiHandle[3][1]); - SDK_ISR_EXIT_BARRIER; -} -#endif /* I2S3*/ - -#if defined(I2S4) -void I2S4_DriverIRQHandler(void); -void I2S4_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[4][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S4, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[4][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S4, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(I2S4, s_saiHandle[4][1]); - } - -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[4][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S4, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[4][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S4, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(I2S4, s_saiHandle[4][0]); - } - SDK_ISR_EXIT_BARRIER; -} - -void I2S4_Tx_DriverIRQHandler(void); -void I2S4_Tx_DriverIRQHandler(void) -{ - assert(s_saiHandle[4][0] != NULL); - s_saiTxIsr(I2S4, s_saiHandle[4][0]); - SDK_ISR_EXIT_BARRIER; -} - -void I2S4_Rx_DriverIRQHandler(void); -void I2S4_Rx_DriverIRQHandler(void) -{ - assert(s_saiHandle[4][1] != NULL); - s_saiRxIsr(I2S4, s_saiHandle[4][1]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(FSL_FEATURE_SAI_SAI5_SAI6_SHARE_IRQ) && (FSL_FEATURE_SAI_SAI5_SAI6_SHARE_IRQ) && defined(I2S5) && \ - defined(I2S6) -void I2S56_DriverIRQHandler(void); -void I2S56_DriverIRQHandler(void) -{ - /* use index 5 to get handle when I2S5 & I2S6 share IRQ NUMBER */ - I2S_Type *base = s_saiHandle[5][1]->base; -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[5][1] != NULL) && SAI_RxGetEnabledInterruptStatus(base, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[5][1] != NULL) && SAI_RxGetEnabledInterruptStatus(base, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(base, s_saiHandle[5][1]); - } - - base = s_saiHandle[5][0]->base; -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[5][0] != NULL) && SAI_TxGetEnabledInterruptStatus(base, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[5][0] != NULL) && SAI_TxGetEnabledInterruptStatus(base, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(base, s_saiHandle[5][0]); - } - SDK_ISR_EXIT_BARRIER; -} - -void I2S56_Tx_DriverIRQHandler(void); -void I2S56_Tx_DriverIRQHandler(void) -{ - /* use index 5 to get handle when I2S5 & I2S6 share IRQ NUMBER */ - assert(s_saiHandle[5][0] != NULL); - s_saiTxIsr(s_saiHandle[5][0]->base, s_saiHandle[5][0]); - SDK_ISR_EXIT_BARRIER; -} - -void I2S56_Rx_DriverIRQHandler(void); -void I2S56_Rx_DriverIRQHandler(void) -{ - /* use index 5 to get handle when I2S5 & I2S6 share IRQ NUMBER */ - assert(s_saiHandle[5][1] != NULL); - s_saiRxIsr(s_saiHandle[5][1]->base, s_saiHandle[5][1]); - SDK_ISR_EXIT_BARRIER; -} - -#else - -#if defined(I2S5) -void I2S5_DriverIRQHandler(void); -void I2S5_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[5][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S5, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[5][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S5, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(I2S5, s_saiHandle[5][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[5][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S5, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[5][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S5, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(I2S5, s_saiHandle[5][0]); - } - SDK_ISR_EXIT_BARRIER; -} - -void I2S5_Tx_DriverIRQHandler(void); -void I2S5_Tx_DriverIRQHandler(void) -{ - assert(s_saiHandle[5][0] != NULL); - s_saiTxIsr(I2S5, s_saiHandle[5][0]); - SDK_ISR_EXIT_BARRIER; -} - -void I2S5_Rx_DriverIRQHandler(void); -void I2S5_Rx_DriverIRQHandler(void) -{ - assert(s_saiHandle[5][1] != NULL); - s_saiRxIsr(I2S5, s_saiHandle[5][1]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(I2S6) -void I2S6_DriverIRQHandler(void); -void I2S6_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[6][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S6, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[6][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S6, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(I2S6, s_saiHandle[6][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[6][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S6, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[6][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S6, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(I2S6, s_saiHandle[6][0]); - } - SDK_ISR_EXIT_BARRIER; -} - -void I2S6_Tx_DriverIRQHandler(void); -void I2S6_Tx_DriverIRQHandler(void) -{ - assert(s_saiHandle[6][0] != NULL); - s_saiTxIsr(I2S6, s_saiHandle[6][0]); - SDK_ISR_EXIT_BARRIER; -} - -void I2S6_Rx_DriverIRQHandler(void); -void I2S6_Rx_DriverIRQHandler(void) -{ - assert(s_saiHandle[6][1] != NULL); - s_saiRxIsr(I2S6, s_saiHandle[6][1]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(AUDIO__SAI0) -void AUDIO_SAI0_INT_DriverIRQHandler(void); -void AUDIO_SAI0_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[0][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI0, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[0][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI0, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(AUDIO__SAI0, s_saiHandle[0][1]); - } - -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[0][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI0, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[0][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI0, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(AUDIO__SAI0, s_saiHandle[0][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* AUDIO__SAI0 */ - -#if defined(AUDIO__SAI1) -void AUDIO_SAI1_INT_DriverIRQHandler(void); -void AUDIO_SAI1_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI1, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI1, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(AUDIO__SAI1, s_saiHandle[1][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI1, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI1, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(AUDIO__SAI1, s_saiHandle[1][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* AUDIO__SAI1 */ - -#if defined(AUDIO__SAI2) -void AUDIO_SAI2_INT_DriverIRQHandler(void); -void AUDIO_SAI2_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[2][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI2, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[2][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI2, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(AUDIO__SAI2, s_saiHandle[2][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[2][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI2, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[2][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI2, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(AUDIO__SAI2, s_saiHandle[2][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* AUDIO__SAI2 */ - -#if defined(AUDIO__SAI3) -void AUDIO_SAI3_INT_DriverIRQHandler(void); -void AUDIO_SAI3_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[3][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI3, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[3][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI3, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(AUDIO__SAI3, s_saiHandle[3][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[3][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI3, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[3][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI3, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(AUDIO__SAI3, s_saiHandle[3][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(AUDIO__SAI6) -void AUDIO_SAI6_INT_DriverIRQHandler(void); -void AUDIO_SAI6_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[6][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI6, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[6][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI6, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(AUDIO__SAI6, s_saiHandle[6][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[6][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI6, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[6][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI6, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(AUDIO__SAI6, s_saiHandle[6][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* AUDIO__SAI6 */ - -#if defined(AUDIO__SAI7) -void AUDIO_SAI7_INT_DriverIRQHandler(void); -void AUDIO_SAI7_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[7][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI7, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[7][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI7, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(AUDIO__SAI7, s_saiHandle[7][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[7][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI7, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[7][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI7, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(AUDIO__SAI7, s_saiHandle[7][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* AUDIO__SAI7 */ - -#if defined(ADMA__SAI0) -void ADMA_SAI0_INT_DriverIRQHandler(void); -void ADMA_SAI0_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI0, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI0, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(ADMA__SAI0, s_saiHandle[1][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI0, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI0, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(ADMA__SAI0, s_saiHandle[1][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* ADMA__SAI0 */ - -#if defined(ADMA__SAI1) -void ADMA_SAI1_INT_DriverIRQHandler(void); -void ADMA_SAI1_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI1, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI1, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(ADMA__SAI1, s_saiHandle[1][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI1, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI1, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(ADMA__SAI1, s_saiHandle[1][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* ADMA__SAI1 */ - -#if defined(ADMA__SAI2) -void ADMA_SAI2_INT_DriverIRQHandler(void); -void ADMA_SAI2_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI2, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI2, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(ADMA__SAI2, s_saiHandle[1][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI2, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI2, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(ADMA__SAI2, s_saiHandle[1][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* ADMA__SAI2 */ - -#if defined(ADMA__SAI3) -void ADMA_SAI3_INT_DriverIRQHandler(void); -void ADMA_SAI3_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI3, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI3, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(ADMA__SAI3, s_saiHandle[1][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI3, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI3, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(ADMA__SAI3, s_saiHandle[1][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* ADMA__SAI3 */ - -#if defined(ADMA__SAI4) -void ADMA_SAI4_INT_DriverIRQHandler(void); -void ADMA_SAI4_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI4, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI4, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(ADMA__SAI4, s_saiHandle[1][1]); - } - -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI4, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI4, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(ADMA__SAI4, s_saiHandle[1][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* ADMA__SAI4 */ - -#if defined(ADMA__SAI5) -void ADMA_SAI5_INT_DriverIRQHandler(void); -void ADMA_SAI5_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI5, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI5, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(ADMA__SAI5, s_saiHandle[1][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI5, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI5, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(ADMA__SAI5, s_saiHandle[1][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* ADMA__SAI5 */ - -#if defined(SAI0) -void SAI0_DriverIRQHandler(void); -void SAI0_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[0][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI0, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[0][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI0, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(SAI0, s_saiHandle[0][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[0][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI0, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[0][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI0, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(SAI0, s_saiHandle[0][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* SAI0 */ - -#if defined(SAI1) -void SAI1_DriverIRQHandler(void); -void SAI1_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI1, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI1, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(SAI1, s_saiHandle[1][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI1, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI1, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(SAI1, s_saiHandle[1][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* SAI1 */ - -#if defined(SAI2) -void SAI2_DriverIRQHandler(void); -void SAI2_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[2][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI2, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[2][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI2, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(SAI2, s_saiHandle[2][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[2][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI2, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[2][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI2, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(SAI2, s_saiHandle[2][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* SAI2 */ - -#if defined(SAI3) -void SAI3_DriverIRQHandler(void); -void SAI3_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[3][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI3, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[3][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI3, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(SAI3, s_saiHandle[3][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[3][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI3, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[3][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI3, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(SAI3, s_saiHandle[3][0]); - } - SDK_ISR_EXIT_BARRIER; -} - -void SAI3_TX_DriverIRQHandler(void); -void SAI3_TX_DriverIRQHandler(void) -{ - assert(s_saiHandle[3][0] != NULL); - s_saiTxIsr(SAI3, s_saiHandle[3][0]); - SDK_ISR_EXIT_BARRIER; -} - -void SAI3_RX_DriverIRQHandler(void); -void SAI3_RX_DriverIRQHandler(void) -{ - assert(s_saiHandle[3][1] != NULL); - s_saiRxIsr(SAI3, s_saiHandle[3][1]); - SDK_ISR_EXIT_BARRIER; -} -#endif /* SAI3 */ - -#if defined(SAI4) -void SAI4_DriverIRQHandler(void); -void SAI4_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[4][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI4, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[4][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI4, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(SAI4, s_saiHandle[4][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[4][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI4, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[4][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI4, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(SAI4, s_saiHandle[4][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* SAI4 */ - -#if defined(SAI5) -void SAI5_DriverIRQHandler(void); -void SAI5_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[5][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI5, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[5][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI5, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(SAI5, s_saiHandle[5][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[5][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI5, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[5][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI5, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(SAI5, s_saiHandle[5][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* SAI5 */ - -#if defined(SAI6) -void SAI6_DriverIRQHandler(void); -void SAI6_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[6][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI6, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[6][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI6, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(SAI6, s_saiHandle[6][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[6][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI6, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[6][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI6, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(SAI6, s_saiHandle[6][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* SAI6 */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_sai.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_sai.h deleted file mode 100644 index 16da4fd98e3..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_sai.h +++ /dev/null @@ -1,1437 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_SAI_H_ -#define FSL_SAI_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup sai_driver SAI Driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -#define FSL_SAI_DRIVER_VERSION (MAKE_VERSION(2, 4, 2)) /*!< Version 2.4.2 */ -/*! @} */ - -/*! @brief _sai_status_t, SAI return status.*/ -enum -{ - kStatus_SAI_TxBusy = MAKE_STATUS(kStatusGroup_SAI, 0), /*!< SAI Tx is busy. */ - kStatus_SAI_RxBusy = MAKE_STATUS(kStatusGroup_SAI, 1), /*!< SAI Rx is busy. */ - kStatus_SAI_TxError = MAKE_STATUS(kStatusGroup_SAI, 2), /*!< SAI Tx FIFO error. */ - kStatus_SAI_RxError = MAKE_STATUS(kStatusGroup_SAI, 3), /*!< SAI Rx FIFO error. */ - kStatus_SAI_QueueFull = MAKE_STATUS(kStatusGroup_SAI, 4), /*!< SAI transfer queue is full. */ - kStatus_SAI_TxIdle = MAKE_STATUS(kStatusGroup_SAI, 5), /*!< SAI Tx is idle */ - kStatus_SAI_RxIdle = MAKE_STATUS(kStatusGroup_SAI, 6) /*!< SAI Rx is idle */ -}; - -/*! @brief _sai_channel_mask,.sai channel mask value, actual channel numbers is depend soc specific */ -enum -{ - kSAI_Channel0Mask = 1 << 0U, /*!< channel 0 mask value */ - kSAI_Channel1Mask = 1 << 1U, /*!< channel 1 mask value */ - kSAI_Channel2Mask = 1 << 2U, /*!< channel 2 mask value */ - kSAI_Channel3Mask = 1 << 3U, /*!< channel 3 mask value */ - kSAI_Channel4Mask = 1 << 4U, /*!< channel 4 mask value */ - kSAI_Channel5Mask = 1 << 5U, /*!< channel 5 mask value */ - kSAI_Channel6Mask = 1 << 6U, /*!< channel 6 mask value */ - kSAI_Channel7Mask = 1 << 7U, /*!< channel 7 mask value */ -}; - -/*! @brief Define the SAI bus type */ -typedef enum _sai_protocol -{ - kSAI_BusLeftJustified = 0x0U, /*!< Uses left justified format.*/ - kSAI_BusRightJustified, /*!< Uses right justified format. */ - kSAI_BusI2S, /*!< Uses I2S format. */ - kSAI_BusPCMA, /*!< Uses I2S PCM A format.*/ - kSAI_BusPCMB /*!< Uses I2S PCM B format. */ -} sai_protocol_t; - -/*! @brief Master or slave mode */ -typedef enum _sai_master_slave -{ - kSAI_Master = 0x0U, /*!< Master mode include bclk and frame sync */ - kSAI_Slave = 0x1U, /*!< Slave mode include bclk and frame sync */ - kSAI_Bclk_Master_FrameSync_Slave = 0x2U, /*!< bclk in master mode, frame sync in slave mode */ - kSAI_Bclk_Slave_FrameSync_Master = 0x3U, /*!< bclk in slave mode, frame sync in master mode */ -} sai_master_slave_t; - -/*! @brief Mono or stereo audio format */ -typedef enum _sai_mono_stereo -{ - kSAI_Stereo = 0x0U, /*!< Stereo sound. */ - kSAI_MonoRight, /*!< Only Right channel have sound. */ - kSAI_MonoLeft /*!< Only left channel have sound. */ -} sai_mono_stereo_t; - -/*! @brief SAI data order, MSB or LSB */ -typedef enum _sai_data_order -{ - kSAI_DataLSB = 0x0U, /*!< LSB bit transferred first */ - kSAI_DataMSB /*!< MSB bit transferred first */ -} sai_data_order_t; - -/*! @brief SAI clock polarity, active high or low */ -typedef enum _sai_clock_polarity -{ - kSAI_PolarityActiveHigh = 0x0U, /*!< Drive outputs on rising edge */ - kSAI_PolarityActiveLow = 0x1U, /*!< Drive outputs on falling edge */ - kSAI_SampleOnFallingEdge = 0x0U, /*!< Sample inputs on falling edge */ - kSAI_SampleOnRisingEdge = 0x1U, /*!< Sample inputs on rising edge */ -} sai_clock_polarity_t; - -/*! @brief Synchronous or asynchronous mode */ -typedef enum _sai_sync_mode -{ - kSAI_ModeAsync = 0x0U, /*!< Asynchronous mode */ - kSAI_ModeSync, /*!< Synchronous mode (with receiver or transmit) */ -#if defined(FSL_FEATURE_SAI_HAS_SYNC_WITH_ANOTHER_SAI) && (FSL_FEATURE_SAI_HAS_SYNC_WITH_ANOTHER_SAI) - kSAI_ModeSyncWithOtherTx, /*!< Synchronous with another SAI transmit */ - kSAI_ModeSyncWithOtherRx /*!< Synchronous with another SAI receiver */ -#endif /* FSL_FEATURE_SAI_HAS_SYNC_WITH_ANOTHER_SAI */ -} sai_sync_mode_t; - -#if !(defined(FSL_FEATURE_SAI_HAS_NO_MCR_MICS) && (FSL_FEATURE_SAI_HAS_NO_MCR_MICS)) -/*! @brief Mater clock source */ -typedef enum _sai_mclk_source -{ - kSAI_MclkSourceSysclk = 0x0U, /*!< Master clock from the system clock */ - kSAI_MclkSourceSelect1, /*!< Master clock from source 1 */ - kSAI_MclkSourceSelect2, /*!< Master clock from source 2 */ - kSAI_MclkSourceSelect3 /*!< Master clock from source 3 */ -} sai_mclk_source_t; -#endif - -/*! @brief Bit clock source */ -typedef enum _sai_bclk_source -{ - kSAI_BclkSourceBusclk = 0x0U, /*!< Bit clock using bus clock */ - /* General device bit source definition */ - kSAI_BclkSourceMclkOption1 = 0x1U, /*!< Bit clock MCLK option 1 */ - kSAI_BclkSourceMclkOption2 = 0x2U, /*!< Bit clock MCLK option2 */ - kSAI_BclkSourceMclkOption3 = 0x3U, /*!< Bit clock MCLK option3 */ - /* Kinetis device bit clock source definition */ - kSAI_BclkSourceMclkDiv = 0x1U, /*!< Bit clock using master clock divider */ - kSAI_BclkSourceOtherSai0 = 0x2U, /*!< Bit clock from other SAI device */ - kSAI_BclkSourceOtherSai1 = 0x3U /*!< Bit clock from other SAI device */ -} sai_bclk_source_t; - -/*! @brief _sai_interrupt_enable_t, The SAI interrupt enable flag */ -enum -{ - kSAI_WordStartInterruptEnable = - I2S_TCSR_WSIE_MASK, /*!< Word start flag, means the first word in a frame detected */ - kSAI_SyncErrorInterruptEnable = I2S_TCSR_SEIE_MASK, /*!< Sync error flag, means the sync error is detected */ - kSAI_FIFOWarningInterruptEnable = I2S_TCSR_FWIE_MASK, /*!< FIFO warning flag, means the FIFO is empty */ - kSAI_FIFOErrorInterruptEnable = I2S_TCSR_FEIE_MASK, /*!< FIFO error flag */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - kSAI_FIFORequestInterruptEnable = I2S_TCSR_FRIE_MASK, /*!< FIFO request, means reached watermark */ -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ -}; - -/*! @brief _sai_dma_enable_t, The DMA request sources */ -enum -{ - kSAI_FIFOWarningDMAEnable = I2S_TCSR_FWDE_MASK, /*!< FIFO warning caused by the DMA request */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - kSAI_FIFORequestDMAEnable = I2S_TCSR_FRDE_MASK, /*!< FIFO request caused by the DMA request */ -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ -}; - -/*! @brief _sai_flags, The SAI status flag */ -enum -{ - kSAI_WordStartFlag = I2S_TCSR_WSF_MASK, /*!< Word start flag, means the first word in a frame detected */ - kSAI_SyncErrorFlag = I2S_TCSR_SEF_MASK, /*!< Sync error flag, means the sync error is detected */ - kSAI_FIFOErrorFlag = I2S_TCSR_FEF_MASK, /*!< FIFO error flag */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - kSAI_FIFORequestFlag = I2S_TCSR_FRF_MASK, /*!< FIFO request flag. */ -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ - kSAI_FIFOWarningFlag = I2S_TCSR_FWF_MASK, /*!< FIFO warning flag */ -}; - -/*! @brief The reset type */ -typedef enum _sai_reset_type -{ - kSAI_ResetTypeSoftware = I2S_TCSR_SR_MASK, /*!< Software reset, reset the logic state */ - kSAI_ResetTypeFIFO = I2S_TCSR_FR_MASK, /*!< FIFO reset, reset the FIFO read and write pointer */ - kSAI_ResetAll = I2S_TCSR_SR_MASK | I2S_TCSR_FR_MASK /*!< All reset. */ -} sai_reset_type_t; - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_PACKING) && FSL_FEATURE_SAI_HAS_FIFO_PACKING -/*! - * @brief The SAI packing mode - * The mode includes 8 bit and 16 bit packing. - */ -typedef enum _sai_fifo_packing -{ - kSAI_FifoPackingDisabled = 0x0U, /*!< Packing disabled */ - kSAI_FifoPacking8bit = 0x2U, /*!< 8 bit packing enabled */ - kSAI_FifoPacking16bit = 0x3U /*!< 16bit packing enabled */ -} sai_fifo_packing_t; -#endif /* FSL_FEATURE_SAI_HAS_FIFO_PACKING */ - -/*! @brief SAI user configuration structure */ -typedef struct _sai_config -{ - sai_protocol_t protocol; /*!< Audio bus protocol in SAI */ - sai_sync_mode_t syncMode; /*!< SAI sync mode, control Tx/Rx clock sync */ -#if defined(FSL_FEATURE_SAI_HAS_MCR) && (FSL_FEATURE_SAI_HAS_MCR) - bool mclkOutputEnable; /*!< Master clock output enable, true means master clock divider enabled */ -#if !(defined(FSL_FEATURE_SAI_HAS_NO_MCR_MICS) && (FSL_FEATURE_SAI_HAS_NO_MCR_MICS)) - sai_mclk_source_t mclkSource; /*!< Master Clock source */ -#endif /* FSL_FEATURE_SAI_HAS_MCR */ -#endif - sai_bclk_source_t bclkSource; /*!< Bit Clock source */ - sai_master_slave_t masterSlave; /*!< Master or slave */ -} sai_config_t; - -#ifndef SAI_XFER_QUEUE_SIZE -/*!@brief SAI transfer queue size, user can refine it according to use case. */ -#define SAI_XFER_QUEUE_SIZE (4U) -#endif - -/*! @brief Audio sample rate */ -typedef enum _sai_sample_rate -{ - kSAI_SampleRate8KHz = 8000U, /*!< Sample rate 8000 Hz */ - kSAI_SampleRate11025Hz = 11025U, /*!< Sample rate 11025 Hz */ - kSAI_SampleRate12KHz = 12000U, /*!< Sample rate 12000 Hz */ - kSAI_SampleRate16KHz = 16000U, /*!< Sample rate 16000 Hz */ - kSAI_SampleRate22050Hz = 22050U, /*!< Sample rate 22050 Hz */ - kSAI_SampleRate24KHz = 24000U, /*!< Sample rate 24000 Hz */ - kSAI_SampleRate32KHz = 32000U, /*!< Sample rate 32000 Hz */ - kSAI_SampleRate44100Hz = 44100U, /*!< Sample rate 44100 Hz */ - kSAI_SampleRate48KHz = 48000U, /*!< Sample rate 48000 Hz */ - kSAI_SampleRate96KHz = 96000U, /*!< Sample rate 96000 Hz */ - kSAI_SampleRate192KHz = 192000U, /*!< Sample rate 192000 Hz */ - kSAI_SampleRate384KHz = 384000U, /*!< Sample rate 384000 Hz */ -} sai_sample_rate_t; - -/*! @brief Audio word width */ -typedef enum _sai_word_width -{ - kSAI_WordWidth8bits = 8U, /*!< Audio data width 8 bits */ - kSAI_WordWidth16bits = 16U, /*!< Audio data width 16 bits */ - kSAI_WordWidth24bits = 24U, /*!< Audio data width 24 bits */ - kSAI_WordWidth32bits = 32U /*!< Audio data width 32 bits */ -} sai_word_width_t; - -#if defined(FSL_FEATURE_SAI_HAS_CHANNEL_MODE) && FSL_FEATURE_SAI_HAS_CHANNEL_MODE -/*! @brief sai data pin state definition */ -typedef enum _sai_data_pin_state -{ - kSAI_DataPinStateTriState = - 0U, /*!< transmit data pins are tri-stated when slots are masked or channels are disabled */ - kSAI_DataPinStateOutputZero = 1U, /*!< transmit data pins are never tri-stated and will output zero when slots - are masked or channel disabled */ -} sai_data_pin_state_t; -#endif - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE -/*! @brief sai fifo combine mode definition */ -typedef enum _sai_fifo_combine -{ - kSAI_FifoCombineDisabled = 0U, /*!< sai fifo combine mode disabled */ - kSAI_FifoCombineModeEnabledOnRead, /*!< sai fifo combine mode enabled on FIFO reads */ - kSAI_FifoCombineModeEnabledOnWrite, /*!< sai fifo combine mode enabled on FIFO write */ - kSAI_FifoCombineModeEnabledOnReadWrite, /*!< sai fifo combined mode enabled on FIFO read/writes */ -} sai_fifo_combine_t; -#endif - -/*! @brief sai transceiver type */ -typedef enum _sai_transceiver_type -{ - kSAI_Transmitter = 0U, /*!< sai transmitter */ - kSAI_Receiver = 1U, /*!< sai receiver */ -} sai_transceiver_type_t; - -/*! @brief sai frame sync len */ -typedef enum _sai_frame_sync_len -{ - kSAI_FrameSyncLenOneBitClk = 0U, /*!< 1 bit clock frame sync len for DSP mode */ - kSAI_FrameSyncLenPerWordWidth = 1U, /*!< Frame sync length decided by word width */ -} sai_frame_sync_len_t; - -/*! @brief sai transfer format */ -typedef struct _sai_transfer_format -{ - uint32_t sampleRate_Hz; /*!< Sample rate of audio data */ - uint32_t bitWidth; /*!< Data length of audio data, usually 8/16/24/32 bits */ - sai_mono_stereo_t stereo; /*!< Mono or stereo */ -#if defined(FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) && (FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) - uint32_t masterClockHz; /*!< Master clock frequency in Hz */ -#endif /* FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - uint8_t watermark; /*!< Watermark value */ -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ - - /* for the multi channel usage, user can provide channelMask Oonly, then sai driver will handle - * other parameter carefully, such as - * channelMask = kSAI_Channel0Mask | kSAI_Channel1Mask | kSAI_Channel4Mask - * then in SAI_RxSetFormat/SAI_TxSetFormat function, channel/endChannel/channelNums will be calculated. - * for the single channel usage, user can provide channel or channel mask only, such as, - * channel = 0 or channelMask = kSAI_Channel0Mask. - */ - uint8_t channel; /*!< Transfer start channel */ - uint8_t channelMask; /*!< enabled channel mask value, reference _sai_channel_mask */ - uint8_t endChannel; /*!< end channel number */ - uint8_t channelNums; /*!< Total enabled channel numbers */ - - sai_protocol_t protocol; /*!< Which audio protocol used */ - bool isFrameSyncCompact; /*!< True means Frame sync length is configurable according to bitWidth, false means frame - sync length is 64 times of bit clock. */ -} sai_transfer_format_t; - -#if (defined(FSL_FEATURE_SAI_HAS_MCR) && (FSL_FEATURE_SAI_HAS_MCR)) || \ - (defined(FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) && (FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER)) -/*! @brief master clock configurations */ -typedef struct _sai_master_clock -{ -#if defined(FSL_FEATURE_SAI_HAS_MCR) && (FSL_FEATURE_SAI_HAS_MCR) - bool mclkOutputEnable; /*!< master clock output enable */ -#if !(defined(FSL_FEATURE_SAI_HAS_NO_MCR_MICS) && (FSL_FEATURE_SAI_HAS_NO_MCR_MICS)) - sai_mclk_source_t mclkSource; /*!< Master Clock source */ -#endif -#endif - -#if (defined(FSL_FEATURE_SAI_HAS_MCR) && (FSL_FEATURE_SAI_HAS_MCR)) || \ - (defined(FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) && (FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER)) - uint32_t mclkHz; /*!< target mclk frequency */ - uint32_t mclkSourceClkHz; /*!< mclk source frequency*/ -#endif -} sai_master_clock_t; -#endif - -/*! @brief sai fifo feature*/ -#if (defined(FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) && FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) || \ - (defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) || \ - (defined(FSL_FEATURE_SAI_HAS_FIFO_PACKING) && FSL_FEATURE_SAI_HAS_FIFO_PACKING) || \ - (defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO)) -#define FSL_SAI_HAS_FIFO_EXTEND_FEATURE 1 -#else -#define FSL_SAI_HAS_FIFO_EXTEND_FEATURE 0 -#endif - -#if FSL_SAI_HAS_FIFO_EXTEND_FEATURE -/*! @brief sai fifo configurations */ -typedef struct _sai_fifo -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) && FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR - bool fifoContinueOneError; /*!< fifo continues when error occur */ -#endif - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE - sai_fifo_combine_t fifoCombine; /*!< fifo combine mode */ -#endif - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_PACKING) && FSL_FEATURE_SAI_HAS_FIFO_PACKING - sai_fifo_packing_t fifoPacking; /*!< fifo packing mode */ -#endif -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - uint8_t fifoWatermark; /*!< fifo watermark */ -#endif -} sai_fifo_t; -#endif - -/*! @brief sai bit clock configurations */ -typedef struct _sai_bit_clock -{ - bool bclkSrcSwap; /*!< bit clock source swap */ - bool bclkInputDelay; /*!< bit clock actually used by the transmitter is delayed by the pad output delay, - this has effect of decreasing the data input setup time, but increasing the data output valid - time .*/ - sai_clock_polarity_t bclkPolarity; /*!< bit clock polarity */ - sai_bclk_source_t bclkSource; /*!< bit Clock source */ -} sai_bit_clock_t; - -/*! @brief sai frame sync configurations */ -typedef struct _sai_frame_sync -{ - uint8_t frameSyncWidth; /*!< frame sync width in number of bit clocks */ - bool frameSyncEarly; /*!< TRUE is frame sync assert one bit before the first bit of frame - FALSE is frame sync assert with the first bit of the frame */ - -#if defined(FSL_FEATURE_SAI_HAS_ON_DEMAND_MODE) && FSL_FEATURE_SAI_HAS_ON_DEMAND_MODE - bool frameSyncGenerateOnDemand; /*!< internal frame sync is generated when FIFO waring flag is clear */ -#endif - - sai_clock_polarity_t frameSyncPolarity; /*!< frame sync polarity */ - -} sai_frame_sync_t; - -/*! @brief sai serial data configurations */ -typedef struct _sai_serial_data -{ -#if defined(FSL_FEATURE_SAI_HAS_CHANNEL_MODE) && FSL_FEATURE_SAI_HAS_CHANNEL_MODE - sai_data_pin_state_t dataMode; /*!< sai data pin state when slots masked or channel disabled */ -#endif - - sai_data_order_t dataOrder; /*!< configure whether the LSB or MSB is transmitted first */ - uint8_t dataWord0Length; /*!< configure the number of bits in the first word in each frame */ - uint8_t dataWordNLength; /*!< configure the number of bits in the each word in each frame, except the first word */ - uint8_t dataWordLength; /*!< used to record the data length for dma transfer */ - uint8_t - dataFirstBitShifted; /*!< Configure the bit index for the first bit transmitted for each word in the frame */ - uint8_t dataWordNum; /*!< configure the number of words in each frame */ - uint32_t dataMaskedWord; /*!< configure whether the transmit word is masked */ -} sai_serial_data_t; - -/*! @brief sai transceiver configurations */ -typedef struct _sai_transceiver -{ - sai_serial_data_t serialData; /*!< serial data configurations */ - sai_frame_sync_t frameSync; /*!< ws configurations */ - sai_bit_clock_t bitClock; /*!< bit clock configurations */ -#if FSL_SAI_HAS_FIFO_EXTEND_FEATURE - sai_fifo_t fifo; /*!< fifo configurations */ -#endif - sai_master_slave_t masterSlave; /*!< transceiver is master or slave */ - - sai_sync_mode_t syncMode; /*!< transceiver sync mode */ - - uint8_t startChannel; /*!< Transfer start channel */ - uint8_t channelMask; /*!< enabled channel mask value, reference _sai_channel_mask */ - uint8_t endChannel; /*!< end channel number */ - uint8_t channelNums; /*!< Total enabled channel numbers */ - -} sai_transceiver_t; - -/*! @brief SAI transfer structure */ -typedef struct _sai_transfer -{ - uint8_t *data; /*!< Data start address to transfer. */ - size_t dataSize; /*!< Transfer size. */ -} sai_transfer_t; - -typedef struct _sai_handle sai_handle_t; - -/*! @brief SAI transfer callback prototype */ -typedef void (*sai_transfer_callback_t)(I2S_Type *base, sai_handle_t *handle, status_t status, void *userData); - -/*! @brief SAI handle structure */ -struct _sai_handle -{ - I2S_Type *base; /*!< base address */ - - uint32_t state; /*!< Transfer status */ - sai_transfer_callback_t callback; /*!< Callback function called at transfer event*/ - void *userData; /*!< Callback parameter passed to callback function*/ - uint8_t bitWidth; /*!< Bit width for transfer, 8/16/24/32 bits */ - - /* for the multi channel usage, user can provide channelMask Oonly, then sai driver will handle - * other parameter carefully, such as - * channelMask = kSAI_Channel0Mask | kSAI_Channel1Mask | kSAI_Channel4Mask - * then in SAI_RxSetFormat/SAI_TxSetFormat function, channel/endChannel/channelNums will be calculated. - * for the single channel usage, user can provide channel or channel mask only, such as, - * channel = 0 or channelMask = kSAI_Channel0Mask. - */ - uint8_t channel; /*!< Transfer start channel */ - uint8_t channelMask; /*!< enabled channel mask value, refernece _sai_channel_mask */ - uint8_t endChannel; /*!< end channel number */ - uint8_t channelNums; /*!< Total enabled channel numbers */ - - sai_transfer_t saiQueue[SAI_XFER_QUEUE_SIZE]; /*!< Transfer queue storing queued transfer */ - size_t transferSize[SAI_XFER_QUEUE_SIZE]; /*!< Data bytes need to transfer */ - volatile uint8_t queueUser; /*!< Index for user to queue transfer */ - volatile uint8_t queueDriver; /*!< Index for driver to get the transfer data and size */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - uint8_t watermark; /*!< Watermark value */ -#endif -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus*/ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Initializes the SAI peripheral. - * - * This API gates the SAI clock. The SAI module can't operate unless SAI_Init is called to enable the clock. - * - * @param base SAI base pointer. - */ -void SAI_Init(I2S_Type *base); - -/*! - * @brief De-initializes the SAI peripheral. - * - * This API gates the SAI clock. The SAI module can't operate unless SAI_TxInit - * or SAI_RxInit is called to enable the clock. - * - * @param base SAI base pointer. - */ -void SAI_Deinit(I2S_Type *base); - -/*! - * @brief Resets the SAI Tx. - * - * This function enables the software reset and FIFO reset of SAI Tx. After reset, clear the reset bit. - * - * @param base SAI base pointer - */ -void SAI_TxReset(I2S_Type *base); - -/*! - * @brief Resets the SAI Rx. - * - * This function enables the software reset and FIFO reset of SAI Rx. After reset, clear the reset bit. - * - * @param base SAI base pointer - */ -void SAI_RxReset(I2S_Type *base); - -/*! - * @brief Enables/disables the SAI Tx. - * - * @param base SAI base pointer. - * @param enable True means enable SAI Tx, false means disable. - */ -void SAI_TxEnable(I2S_Type *base, bool enable); - -/*! - * @brief Enables/disables the SAI Rx. - * - * @param base SAI base pointer. - * @param enable True means enable SAI Rx, false means disable. - */ -void SAI_RxEnable(I2S_Type *base, bool enable); - -/*! - * @brief Set Rx bit clock direction. - * - * Select bit clock direction, master or slave. - * - * @param base SAI base pointer. - * @param masterSlave reference sai_master_slave_t. - */ -static inline void SAI_TxSetBitClockDirection(I2S_Type *base, sai_master_slave_t masterSlave) -{ - if (masterSlave == kSAI_Master) - { - base->TCR2 |= I2S_TCR2_BCD_MASK; - } - else - { - base->TCR2 &= ~I2S_TCR2_BCD_MASK; - } -} - -/*! - * @brief Set Rx bit clock direction. - * - * Select bit clock direction, master or slave. - * - * @param base SAI base pointer. - * @param masterSlave reference sai_master_slave_t. - */ -static inline void SAI_RxSetBitClockDirection(I2S_Type *base, sai_master_slave_t masterSlave) -{ - if (masterSlave == kSAI_Master) - { - base->RCR2 |= I2S_RCR2_BCD_MASK; - } - else - { - base->RCR2 &= ~I2S_RCR2_BCD_MASK; - } -} - -/*! - * @brief Set Rx frame sync direction. - * - * Select frame sync direction, master or slave. - * - * @param base SAI base pointer. - * @param masterSlave reference sai_master_slave_t. - */ -static inline void SAI_RxSetFrameSyncDirection(I2S_Type *base, sai_master_slave_t masterSlave) -{ - if (masterSlave == kSAI_Master) - { - base->RCR4 |= I2S_RCR4_FSD_MASK; - } - else - { - base->RCR4 &= ~I2S_RCR4_FSD_MASK; - } -} - -/*! - * @brief Set Tx frame sync direction. - * - * Select frame sync direction, master or slave. - * - * @param base SAI base pointer. - * @param masterSlave reference sai_master_slave_t. - */ -static inline void SAI_TxSetFrameSyncDirection(I2S_Type *base, sai_master_slave_t masterSlave) -{ - if (masterSlave == kSAI_Master) - { - base->TCR4 |= I2S_TCR4_FSD_MASK; - } - else - { - base->TCR4 &= ~I2S_TCR4_FSD_MASK; - } -} - -/*! - * @brief Transmitter bit clock rate configurations. - * - * @param base SAI base pointer. - * @param sourceClockHz Bit clock source frequency. - * @param sampleRate Audio data sample rate. - * @param bitWidth Audio data bitWidth. - * @param channelNumbers Audio channel numbers. - */ -void SAI_TxSetBitClockRate( - I2S_Type *base, uint32_t sourceClockHz, uint32_t sampleRate, uint32_t bitWidth, uint32_t channelNumbers); - -/*! - * @brief Receiver bit clock rate configurations. - * - * @param base SAI base pointer. - * @param sourceClockHz Bit clock source frequency. - * @param sampleRate Audio data sample rate. - * @param bitWidth Audio data bitWidth. - * @param channelNumbers Audio channel numbers. - */ -void SAI_RxSetBitClockRate( - I2S_Type *base, uint32_t sourceClockHz, uint32_t sampleRate, uint32_t bitWidth, uint32_t channelNumbers); - -/*! - * @brief Transmitter Bit clock configurations. - * - * @param base SAI base pointer. - * @param masterSlave master or slave. - * @param config bit clock other configurations, can be NULL in slave mode. - */ -void SAI_TxSetBitclockConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_bit_clock_t *config); - -/*! - * @brief Receiver Bit clock configurations. - * - * @param base SAI base pointer. - * @param masterSlave master or slave. - * @param config bit clock other configurations, can be NULL in slave mode. - */ -void SAI_RxSetBitclockConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_bit_clock_t *config); - -#if (defined(FSL_FEATURE_SAI_HAS_MCR) && (FSL_FEATURE_SAI_HAS_MCR)) || \ - (defined(FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) && (FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER)) -/*! - * @brief Master clock configurations. - * - * @param base SAI base pointer. - * @param config master clock configurations. - */ -void SAI_SetMasterClockConfig(I2S_Type *base, sai_master_clock_t *config); -#endif - -#if FSL_SAI_HAS_FIFO_EXTEND_FEATURE -/*! - * @brief SAI transmitter fifo configurations. - * - * @param base SAI base pointer. - * @param config fifo configurations. - */ -void SAI_TxSetFifoConfig(I2S_Type *base, sai_fifo_t *config); - -/*! - * @brief SAI receiver fifo configurations. - * - * @param base SAI base pointer. - * @param config fifo configurations. - */ -void SAI_RxSetFifoConfig(I2S_Type *base, sai_fifo_t *config); -#endif - -/*! - * @brief SAI transmitter Frame sync configurations. - * - * @param base SAI base pointer. - * @param masterSlave master or slave. - * @param config frame sync configurations, can be NULL in slave mode. - */ -void SAI_TxSetFrameSyncConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_frame_sync_t *config); - -/*! - * @brief SAI receiver Frame sync configurations. - * - * @param base SAI base pointer. - * @param masterSlave master or slave. - * @param config frame sync configurations, can be NULL in slave mode. - */ -void SAI_RxSetFrameSyncConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_frame_sync_t *config); - -/*! - * @brief SAI transmitter Serial data configurations. - * - * @param base SAI base pointer. - * @param config serial data configurations. - */ -void SAI_TxSetSerialDataConfig(I2S_Type *base, sai_serial_data_t *config); - -/*! - * @brief SAI receiver Serial data configurations. - * - * @param base SAI base pointer. - * @param config serial data configurations. - */ -void SAI_RxSetSerialDataConfig(I2S_Type *base, sai_serial_data_t *config); - -/*! - * @brief SAI transmitter configurations. - * - * @param base SAI base pointer. - * @param config transmitter configurations. - */ -void SAI_TxSetConfig(I2S_Type *base, sai_transceiver_t *config); - -/*! - * @brief SAI receiver configurations. - * - * @param base SAI base pointer. - * @param config receiver configurations. - */ -void SAI_RxSetConfig(I2S_Type *base, sai_transceiver_t *config); - -/*! - * @brief Get classic I2S mode configurations. - * - * @param config transceiver configurations. - * @param bitWidth audio data bitWidth. - * @param mode audio data channel. - * @param saiChannelMask mask value of the channel to be enable. - */ -void SAI_GetClassicI2SConfig(sai_transceiver_t *config, - sai_word_width_t bitWidth, - sai_mono_stereo_t mode, - uint32_t saiChannelMask); - -/*! - * @brief Get left justified mode configurations. - * - * @param config transceiver configurations. - * @param bitWidth audio data bitWidth. - * @param mode audio data channel. - * @param saiChannelMask mask value of the channel to be enable. - */ -void SAI_GetLeftJustifiedConfig(sai_transceiver_t *config, - sai_word_width_t bitWidth, - sai_mono_stereo_t mode, - uint32_t saiChannelMask); - -/*! - * @brief Get right justified mode configurations. - * - * @param config transceiver configurations. - * @param bitWidth audio data bitWidth. - * @param mode audio data channel. - * @param saiChannelMask mask value of the channel to be enable. - */ -void SAI_GetRightJustifiedConfig(sai_transceiver_t *config, - sai_word_width_t bitWidth, - sai_mono_stereo_t mode, - uint32_t saiChannelMask); - -/*! - * @brief Get TDM mode configurations. - * - * @param config transceiver configurations. - * @param frameSyncWidth length of frame sync. - * @param bitWidth audio data word width. - * @param dataWordNum word number in one frame. - * @param saiChannelMask mask value of the channel to be enable. - */ -void SAI_GetTDMConfig(sai_transceiver_t *config, - sai_frame_sync_len_t frameSyncWidth, - sai_word_width_t bitWidth, - uint32_t dataWordNum, - uint32_t saiChannelMask); - -/*! - * @brief Get DSP mode configurations. - * - * @note DSP mode is also called PCM mode which support MODE A and MODE B, - * DSP/PCM MODE A configuration flow. RX is similiar but uses SAI_RxSetConfig instead of SAI_TxSetConfig: - * @code - * SAI_GetDSPConfig(config, kSAI_FrameSyncLenOneBitClk, bitWidth, kSAI_Stereo, channelMask) - * config->frameSync.frameSyncEarly = true; - * SAI_TxSetConfig(base, config) - * @endcode - * - * DSP/PCM MODE B configuration flow for TX. RX is similiar but uses SAI_RxSetConfig instead of SAI_TxSetConfig: - * @code - * SAI_GetDSPConfig(config, kSAI_FrameSyncLenOneBitClk, bitWidth, kSAI_Stereo, channelMask) - * SAI_TxSetConfig(base, config) - * @endcode - * - * @param config transceiver configurations. - * @param frameSyncWidth length of frame sync. - * @param bitWidth audio data bitWidth. - * @param mode audio data channel. - * @param saiChannelMask mask value of the channel to enable. - */ -void SAI_GetDSPConfig(sai_transceiver_t *config, - sai_frame_sync_len_t frameSyncWidth, - sai_word_width_t bitWidth, - sai_mono_stereo_t mode, - uint32_t saiChannelMask); -/*! @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets the SAI Tx status flag state. - * - * @param base SAI base pointer - * @return SAI Tx status flag value. Use the Status Mask to get the status value needed. - */ -static inline uint32_t SAI_TxGetStatusFlag(I2S_Type *base) -{ - return base->TCSR; -} - -/*! - * @brief Clears the SAI Tx status flag state. - * - * @param base SAI base pointer - * @param mask State mask. It can be a combination of the following source if defined: - * @arg kSAI_WordStartFlag - * @arg kSAI_SyncErrorFlag - * @arg kSAI_FIFOErrorFlag - */ -static inline void SAI_TxClearStatusFlags(I2S_Type *base, uint32_t mask) -{ - base->TCSR = ((base->TCSR & 0xFFE3FFFFU) | mask); -} - -/*! - * @brief Gets the SAI Tx status flag state. - * - * @param base SAI base pointer - * @return SAI Rx status flag value. Use the Status Mask to get the status value needed. - */ -static inline uint32_t SAI_RxGetStatusFlag(I2S_Type *base) -{ - return base->RCSR; -} - -/*! - * @brief Clears the SAI Rx status flag state. - * - * @param base SAI base pointer - * @param mask State mask. It can be a combination of the following sources if defined. - * @arg kSAI_WordStartFlag - * @arg kSAI_SyncErrorFlag - * @arg kSAI_FIFOErrorFlag - */ -static inline void SAI_RxClearStatusFlags(I2S_Type *base, uint32_t mask) -{ - base->RCSR = ((base->RCSR & 0xFFE3FFFFU) | mask); -} - -/*! - * @brief Do software reset or FIFO reset . - * - * FIFO reset means clear all the data in the FIFO, and make the FIFO pointer both to 0. - * Software reset means clear the Tx internal logic, including the bit clock, frame count etc. But software - * reset will not clear any configuration registers like TCR1~TCR5. - * This function will also clear all the error flags such as FIFO error, sync error etc. - * - * @param base SAI base pointer - * @param resetType Reset type, FIFO reset or software reset - */ -void SAI_TxSoftwareReset(I2S_Type *base, sai_reset_type_t resetType); - -/*! - * @brief Do software reset or FIFO reset . - * - * FIFO reset means clear all the data in the FIFO, and make the FIFO pointer both to 0. - * Software reset means clear the Rx internal logic, including the bit clock, frame count etc. But software - * reset will not clear any configuration registers like RCR1~RCR5. - * This function will also clear all the error flags such as FIFO error, sync error etc. - * - * @param base SAI base pointer - * @param resetType Reset type, FIFO reset or software reset - */ -void SAI_RxSoftwareReset(I2S_Type *base, sai_reset_type_t resetType); - -/*! - * @brief Set the Tx channel FIFO enable mask. - * - * @param base SAI base pointer - * @param mask Channel enable mask, 0 means all channel FIFO disabled, 1 means channel 0 enabled, - * 3 means both channel 0 and channel 1 enabled. - */ -void SAI_TxSetChannelFIFOMask(I2S_Type *base, uint8_t mask); - -/*! - * @brief Set the Rx channel FIFO enable mask. - * - * @param base SAI base pointer - * @param mask Channel enable mask, 0 means all channel FIFO disabled, 1 means channel 0 enabled, - * 3 means both channel 0 and channel 1 enabled. - */ -void SAI_RxSetChannelFIFOMask(I2S_Type *base, uint8_t mask); - -/*! - * @brief Set the Tx data order. - * - * @param base SAI base pointer - * @param order Data order MSB or LSB - */ -void SAI_TxSetDataOrder(I2S_Type *base, sai_data_order_t order); - -/*! - * @brief Set the Rx data order. - * - * @param base SAI base pointer - * @param order Data order MSB or LSB - */ -void SAI_RxSetDataOrder(I2S_Type *base, sai_data_order_t order); - -/*! - * @brief Set the Tx data order. - * - * @param base SAI base pointer - * @param polarity - */ -void SAI_TxSetBitClockPolarity(I2S_Type *base, sai_clock_polarity_t polarity); - -/*! - * @brief Set the Rx data order. - * - * @param base SAI base pointer - * @param polarity - */ -void SAI_RxSetBitClockPolarity(I2S_Type *base, sai_clock_polarity_t polarity); - -/*! - * @brief Set the Tx data order. - * - * @param base SAI base pointer - * @param polarity - */ -void SAI_TxSetFrameSyncPolarity(I2S_Type *base, sai_clock_polarity_t polarity); - -/*! - * @brief Set the Rx data order. - * - * @param base SAI base pointer - * @param polarity - */ -void SAI_RxSetFrameSyncPolarity(I2S_Type *base, sai_clock_polarity_t polarity); - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_PACKING) && FSL_FEATURE_SAI_HAS_FIFO_PACKING -/*! - * @brief Set Tx FIFO packing feature. - * - * @param base SAI base pointer. - * @param pack FIFO pack type. It is element of sai_fifo_packing_t. - */ -void SAI_TxSetFIFOPacking(I2S_Type *base, sai_fifo_packing_t pack); - -/*! - * @brief Set Rx FIFO packing feature. - * - * @param base SAI base pointer. - * @param pack FIFO pack type. It is element of sai_fifo_packing_t. - */ -void SAI_RxSetFIFOPacking(I2S_Type *base, sai_fifo_packing_t pack); -#endif /* FSL_FEATURE_SAI_HAS_FIFO_PACKING */ - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) && FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR -/*! - * @brief Set Tx FIFO error continue. - * - * FIFO error continue mode means SAI will keep running while FIFO error occurred. If this feature - * not enabled, SAI will hang and users need to clear FEF flag in TCSR register. - * - * @param base SAI base pointer. - * @param isEnabled Is FIFO error continue enabled, true means enable, false means disable. - */ -static inline void SAI_TxSetFIFOErrorContinue(I2S_Type *base, bool isEnabled) -{ - if (isEnabled) - { - base->TCR4 |= I2S_TCR4_FCONT_MASK; - } - else - { - base->TCR4 &= ~I2S_TCR4_FCONT_MASK; - } -} - -/*! - * @brief Set Rx FIFO error continue. - * - * FIFO error continue mode means SAI will keep running while FIFO error occurred. If this feature - * not enabled, SAI will hang and users need to clear FEF flag in RCSR register. - * - * @param base SAI base pointer. - * @param isEnabled Is FIFO error continue enabled, true means enable, false means disable. - */ -static inline void SAI_RxSetFIFOErrorContinue(I2S_Type *base, bool isEnabled) -{ - if (isEnabled) - { - base->RCR4 |= I2S_RCR4_FCONT_MASK; - } - else - { - base->RCR4 &= ~I2S_RCR4_FCONT_MASK; - } -} -#endif - -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables the SAI Tx interrupt requests. - * - * @param base SAI base pointer - * @param mask interrupt source - * The parameter can be a combination of the following sources if defined. - * @arg kSAI_WordStartInterruptEnable - * @arg kSAI_SyncErrorInterruptEnable - * @arg kSAI_FIFOWarningInterruptEnable - * @arg kSAI_FIFORequestInterruptEnable - * @arg kSAI_FIFOErrorInterruptEnable - */ -static inline void SAI_TxEnableInterrupts(I2S_Type *base, uint32_t mask) -{ - base->TCSR = ((base->TCSR & 0xFFE3FFFFU) | mask); -} - -/*! - * @brief Enables the SAI Rx interrupt requests. - * - * @param base SAI base pointer - * @param mask interrupt source - * The parameter can be a combination of the following sources if defined. - * @arg kSAI_WordStartInterruptEnable - * @arg kSAI_SyncErrorInterruptEnable - * @arg kSAI_FIFOWarningInterruptEnable - * @arg kSAI_FIFORequestInterruptEnable - * @arg kSAI_FIFOErrorInterruptEnable - */ -static inline void SAI_RxEnableInterrupts(I2S_Type *base, uint32_t mask) -{ - base->RCSR = ((base->RCSR & 0xFFE3FFFFU) | mask); -} - -/*! - * @brief Disables the SAI Tx interrupt requests. - * - * @param base SAI base pointer - * @param mask interrupt source - * The parameter can be a combination of the following sources if defined. - * @arg kSAI_WordStartInterruptEnable - * @arg kSAI_SyncErrorInterruptEnable - * @arg kSAI_FIFOWarningInterruptEnable - * @arg kSAI_FIFORequestInterruptEnable - * @arg kSAI_FIFOErrorInterruptEnable - */ -static inline void SAI_TxDisableInterrupts(I2S_Type *base, uint32_t mask) -{ - base->TCSR = ((base->TCSR & 0xFFE3FFFFU) & (~mask)); -} - -/*! - * @brief Disables the SAI Rx interrupt requests. - * - * @param base SAI base pointer - * @param mask interrupt source - * The parameter can be a combination of the following sources if defined. - * @arg kSAI_WordStartInterruptEnable - * @arg kSAI_SyncErrorInterruptEnable - * @arg kSAI_FIFOWarningInterruptEnable - * @arg kSAI_FIFORequestInterruptEnable - * @arg kSAI_FIFOErrorInterruptEnable - */ -static inline void SAI_RxDisableInterrupts(I2S_Type *base, uint32_t mask) -{ - base->RCSR = ((base->RCSR & 0xFFE3FFFFU) & (~mask)); -} - -/*! @} */ - -/*! - * @name DMA Control - * @{ - */ - -/*! - * @brief Enables/disables the SAI Tx DMA requests. - * @param base SAI base pointer - * @param mask DMA source - * The parameter can be combination of the following sources if defined. - * @arg kSAI_FIFOWarningDMAEnable - * @arg kSAI_FIFORequestDMAEnable - * @param enable True means enable DMA, false means disable DMA. - */ -static inline void SAI_TxEnableDMA(I2S_Type *base, uint32_t mask, bool enable) -{ - if (enable) - { - base->TCSR = ((base->TCSR & 0xFFE3FFFFU) | mask); - } - else - { - base->TCSR = ((base->TCSR & 0xFFE3FFFFU) & (~mask)); - } -} - -/*! - * @brief Enables/disables the SAI Rx DMA requests. - * @param base SAI base pointer - * @param mask DMA source - * The parameter can be a combination of the following sources if defined. - * @arg kSAI_FIFOWarningDMAEnable - * @arg kSAI_FIFORequestDMAEnable - * @param enable True means enable DMA, false means disable DMA. - */ -static inline void SAI_RxEnableDMA(I2S_Type *base, uint32_t mask, bool enable) -{ - if (enable) - { - base->RCSR = ((base->RCSR & 0xFFE3FFFFU) | mask); - } - else - { - base->RCSR = ((base->RCSR & 0xFFE3FFFFU) & (~mask)); - } -} - -/*! - * @brief Gets the SAI Tx data register address. - * - * This API is used to provide a transfer address for the SAI DMA transfer configuration. - * - * @param base SAI base pointer. - * @param channel Which data channel used. - * @return data register address. - */ -static inline uintptr_t SAI_TxGetDataRegisterAddress(I2S_Type *base, uint32_t channel) -{ - return (uintptr_t)(&(base->TDR)[channel]); -} - -/*! - * @brief Gets the SAI Rx data register address. - * - * This API is used to provide a transfer address for the SAI DMA transfer configuration. - * - * @param base SAI base pointer. - * @param channel Which data channel used. - * @return data register address. - */ -static inline uintptr_t SAI_RxGetDataRegisterAddress(I2S_Type *base, uint32_t channel) -{ - return (uintptr_t)(&(base->RDR)[channel]); -} - -/*! @} */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Sends data using a blocking method. - * - * @note This function blocks by polling until data is ready to be sent. - * - * @param base SAI base pointer. - * @param channel Data channel used. - * @param bitWidth How many bits in an audio word; usually 8/16/24/32 bits. - * @param buffer Pointer to the data to be written. - * @param size Bytes to be written. - */ -void SAI_WriteBlocking(I2S_Type *base, uint32_t channel, uint32_t bitWidth, uint8_t *buffer, uint32_t size); - -/*! - * @brief Sends data to multi channel using a blocking method. - * - * @note This function blocks by polling until data is ready to be sent. - * - * @param base SAI base pointer. - * @param channel Data channel used. - * @param channelMask channel mask. - * @param bitWidth How many bits in an audio word; usually 8/16/24/32 bits. - * @param buffer Pointer to the data to be written. - * @param size Bytes to be written. - */ -void SAI_WriteMultiChannelBlocking( - I2S_Type *base, uint32_t channel, uint32_t channelMask, uint32_t bitWidth, uint8_t *buffer, uint32_t size); - -/*! - * @brief Writes data into SAI FIFO. - * - * @param base SAI base pointer. - * @param channel Data channel used. - * @param data Data needs to be written. - */ -static inline void SAI_WriteData(I2S_Type *base, uint32_t channel, uint32_t data) -{ - base->TDR[channel] = data; -} - -/*! - * @brief Receives data using a blocking method. - * - * @note This function blocks by polling until data is ready to be sent. - * - * @param base SAI base pointer. - * @param channel Data channel used. - * @param bitWidth How many bits in an audio word; usually 8/16/24/32 bits. - * @param buffer Pointer to the data to be read. - * @param size Bytes to be read. - */ -void SAI_ReadBlocking(I2S_Type *base, uint32_t channel, uint32_t bitWidth, uint8_t *buffer, uint32_t size); - -/*! - * @brief Receives multi channel data using a blocking method. - * - * @note This function blocks by polling until data is ready to be sent. - * - * @param base SAI base pointer. - * @param channel Data channel used. - * @param channelMask channel mask. - * @param bitWidth How many bits in an audio word; usually 8/16/24/32 bits. - * @param buffer Pointer to the data to be read. - * @param size Bytes to be read. - */ -void SAI_ReadMultiChannelBlocking( - I2S_Type *base, uint32_t channel, uint32_t channelMask, uint32_t bitWidth, uint8_t *buffer, uint32_t size); - -/*! - * @brief Reads data from the SAI FIFO. - * - * @param base SAI base pointer. - * @param channel Data channel used. - * @return Data in SAI FIFO. - */ -static inline uint32_t SAI_ReadData(I2S_Type *base, uint32_t channel) -{ - return base->RDR[channel]; -} - -/*! @} */ - -/*! - * @name Transactional - * @{ - */ - -/*! - * @brief Initializes the SAI Tx handle. - * - * This function initializes the Tx handle for the SAI Tx transactional APIs. Call - * this function once to get the handle initialized. - * - * @param base SAI base pointer - * @param handle SAI handle pointer. - * @param callback Pointer to the user callback function. - * @param userData User parameter passed to the callback function - */ -void SAI_TransferTxCreateHandle(I2S_Type *base, sai_handle_t *handle, sai_transfer_callback_t callback, void *userData); - -/*! - * @brief Initializes the SAI Rx handle. - * - * This function initializes the Rx handle for the SAI Rx transactional APIs. Call - * this function once to get the handle initialized. - * - * @param base SAI base pointer. - * @param handle SAI handle pointer. - * @param callback Pointer to the user callback function. - * @param userData User parameter passed to the callback function. - */ -void SAI_TransferRxCreateHandle(I2S_Type *base, sai_handle_t *handle, sai_transfer_callback_t callback, void *userData); - -/*! - * @brief SAI transmitter transfer configurations. - * - * This function initializes the Tx, include bit clock, frame sync, master clock, serial data and fifo - * configurations. - * - * @param base SAI base pointer. - * @param handle SAI handle pointer. - * @param config tranmitter configurations. - */ -void SAI_TransferTxSetConfig(I2S_Type *base, sai_handle_t *handle, sai_transceiver_t *config); - -/*! - * @brief SAI receiver transfer configurations. - * - * This function initializes the Rx, include bit clock, frame sync, master clock, serial data and fifo - * configurations. - * - * @param base SAI base pointer. - * @param handle SAI handle pointer. - * @param config receiver configurations. - */ -void SAI_TransferRxSetConfig(I2S_Type *base, sai_handle_t *handle, sai_transceiver_t *config); - - -/*! - * @brief Performs an interrupt non-blocking send transfer on SAI. - * - * @note This API returns immediately after the transfer initiates. - * Call the SAI_TxGetTransferStatusIRQ to poll the transfer status and check whether - * the transfer is finished. If the return status is not kStatus_SAI_Busy, the transfer - * is finished. - * - * @param base SAI base pointer. - * @param handle Pointer to the sai_handle_t structure which stores the transfer state. - * @param xfer Pointer to the sai_transfer_t structure. - * @retval kStatus_Success Successfully started the data receive. - * @retval kStatus_SAI_TxBusy Previous receive still not finished. - * @retval kStatus_InvalidArgument The input parameter is invalid. - */ -status_t SAI_TransferSendNonBlocking(I2S_Type *base, sai_handle_t *handle, sai_transfer_t *xfer); - -/*! - * @brief Performs an interrupt non-blocking receive transfer on SAI. - * - * @note This API returns immediately after the transfer initiates. - * Call the SAI_RxGetTransferStatusIRQ to poll the transfer status and check whether - * the transfer is finished. If the return status is not kStatus_SAI_Busy, the transfer - * is finished. - * - * @param base SAI base pointer - * @param handle Pointer to the sai_handle_t structure which stores the transfer state. - * @param xfer Pointer to the sai_transfer_t structure. - * @retval kStatus_Success Successfully started the data receive. - * @retval kStatus_SAI_RxBusy Previous receive still not finished. - * @retval kStatus_InvalidArgument The input parameter is invalid. - */ -status_t SAI_TransferReceiveNonBlocking(I2S_Type *base, sai_handle_t *handle, sai_transfer_t *xfer); - -/*! - * @brief Gets a set byte count. - * - * @param base SAI base pointer. - * @param handle Pointer to the sai_handle_t structure which stores the transfer state. - * @param count Bytes count sent. - * @retval kStatus_Success Succeed get the transfer count. - * @retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t SAI_TransferGetSendCount(I2S_Type *base, sai_handle_t *handle, size_t *count); - -/*! - * @brief Gets a received byte count. - * - * @param base SAI base pointer. - * @param handle Pointer to the sai_handle_t structure which stores the transfer state. - * @param count Bytes count received. - * @retval kStatus_Success Succeed get the transfer count. - * @retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t SAI_TransferGetReceiveCount(I2S_Type *base, sai_handle_t *handle, size_t *count); - -/*! - * @brief Aborts the current send. - * - * @note This API can be called any time when an interrupt non-blocking transfer initiates - * to abort the transfer early. - * - * @param base SAI base pointer. - * @param handle Pointer to the sai_handle_t structure which stores the transfer state. - */ -void SAI_TransferAbortSend(I2S_Type *base, sai_handle_t *handle); - -/*! - * @brief Aborts the current IRQ receive. - * - * @note This API can be called when an interrupt non-blocking transfer initiates - * to abort the transfer early. - * - * @param base SAI base pointer - * @param handle Pointer to the sai_handle_t structure which stores the transfer state. - */ -void SAI_TransferAbortReceive(I2S_Type *base, sai_handle_t *handle); - -/*! - * @brief Terminate all SAI send. - * - * This function will clear all transfer slots buffered in the sai queue. If users only want to abort the - * current transfer slot, please call SAI_TransferAbortSend. - * - * @param base SAI base pointer. - * @param handle SAI eDMA handle pointer. - */ -void SAI_TransferTerminateSend(I2S_Type *base, sai_handle_t *handle); - -/*! - * @brief Terminate all SAI receive. - * - * This function will clear all transfer slots buffered in the sai queue. If users only want to abort the - * current transfer slot, please call SAI_TransferAbortReceive. - * - * @param base SAI base pointer. - * @param handle SAI eDMA handle pointer. - */ -void SAI_TransferTerminateReceive(I2S_Type *base, sai_handle_t *handle); - -/*! - * @brief Tx interrupt handler. - * - * @param base SAI base pointer. - * @param handle Pointer to the sai_handle_t structure. - */ -void SAI_TransferTxHandleIRQ(I2S_Type *base, sai_handle_t *handle); - -/*! - * @brief Tx interrupt handler. - * - * @param base SAI base pointer. - * @param handle Pointer to the sai_handle_t structure. - */ -void SAI_TransferRxHandleIRQ(I2S_Type *base, sai_handle_t *handle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /*_cplusplus*/ - -/*! @} */ - -#endif /* FSL_SAI_H_ */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_sai_dma.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_sai_dma.c deleted file mode 100644 index 1e78b5aa6fa..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_sai_dma.c +++ /dev/null @@ -1,539 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2017,2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_sai_dma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.sai_dma" -#endif - -/*handle; - - /* Update queue counter */ - (void)memset(&saiHandle->saiQueue[saiHandle->queueDriver], 0, sizeof(sai_transfer_t)); - saiHandle->queueDriver = (saiHandle->queueDriver + 1U) % SAI_XFER_QUEUE_SIZE; - - /* Call callback function */ - if (saiHandle->callback != NULL) - { - (saiHandle->callback)(privHandle->base, saiHandle, kStatus_SAI_TxIdle, saiHandle->userData); - } - - /* If all data finished, just stop the transfer */ - if (saiHandle->saiQueue[saiHandle->queueDriver].data == NULL) - { - SAI_TransferAbortSendDMA(privHandle->base, saiHandle); - } -} - -static void SAI_RxDMACallback(dma_handle_t *handle, void *userData) -{ - sai_dma_private_handle_t *privHandle = (sai_dma_private_handle_t *)userData; - sai_dma_handle_t *saiHandle = privHandle->handle; - - /* Update queue counter */ - (void)memset(&saiHandle->saiQueue[saiHandle->queueDriver], 0, sizeof(sai_transfer_t)); - saiHandle->queueDriver = (saiHandle->queueDriver + 1U) % SAI_XFER_QUEUE_SIZE; - - /* Call callback function */ - if (saiHandle->callback != NULL) - { - (saiHandle->callback)(privHandle->base, saiHandle, kStatus_SAI_RxIdle, saiHandle->userData); - } - - /* If all data finished, just stop the transfer */ - if (saiHandle->saiQueue[saiHandle->queueDriver].data == NULL) - { - SAI_TransferAbortReceiveDMA(privHandle->base, saiHandle); - } -} - -/*! - * brief Initializes the SAI master DMA handle. - * - * This function initializes the SAI master DMA handle, which can be used for other SAI master transactional APIs. - * Usually, for a specified SAI instance, call this API once to get the initialized handle. - * - * param base SAI base pointer. - * param handle SAI DMA handle pointer. - * param base SAI peripheral base address. - * param callback Pointer to user callback function. - * param userData User parameter passed to the callback function. - * param dmaHandle DMA handle pointer, this handle shall be static allocated by users. - */ -void SAI_TransferTxCreateHandleDMA( - I2S_Type *base, sai_dma_handle_t *handle, sai_dma_callback_t callback, void *userData, dma_handle_t *dmaHandle) -{ - assert((handle != NULL) && (dmaHandle != NULL)); - - uint32_t instance = SAI_GetInstance(base); - - /* Zero the handle */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Set sai base to handle */ - handle->dmaHandle = dmaHandle; - handle->callback = callback; - handle->userData = userData; - - /* Set SAI state to idle */ - handle->state = (uint32_t)kSAI_Idle; - - s_dmaPrivateHandle[instance][0].base = base; - s_dmaPrivateHandle[instance][0].handle = handle; - -/* Use FIFO error continue nstead of using interrupt to handle error */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) && (FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) - base->TCR4 |= I2S_TCR4_FCONT_MASK; -#endif - - /* Install callback for Tx dma channel */ - DMA_SetCallback(dmaHandle, SAI_TxDMACallback, &s_dmaPrivateHandle[instance][0]); -} - -/*! - * brief Initializes the SAI slave DMA handle. - * - * This function initializes the SAI slave DMA handle, which can be used for other SAI master transactional APIs. - * Usually, for a specified SAI instance, call this API once to get the initialized handle. - * - * param base SAI base pointer. - * param handle SAI DMA handle pointer. - * param base SAI peripheral base address. - * param callback Pointer to user callback function. - * param userData User parameter passed to the callback function. - * param dmaHandle DMA handle pointer, this handle shall be static allocated by users. - */ -void SAI_TransferRxCreateHandleDMA( - I2S_Type *base, sai_dma_handle_t *handle, sai_dma_callback_t callback, void *userData, dma_handle_t *dmaHandle) -{ - assert((handle != NULL) && (dmaHandle != NULL)); - - uint32_t instance = SAI_GetInstance(base); - - /* Zero the handle */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Set sai base to handle */ - handle->dmaHandle = dmaHandle; - handle->callback = callback; - handle->userData = userData; - - /* Set SAI state to idle */ - handle->state = (uint32_t)kSAI_Idle; - - s_dmaPrivateHandle[instance][1].base = base; - s_dmaPrivateHandle[instance][1].handle = handle; - -/* Use FIFO error continue nstead of using interrupt to handle error */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) && (FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) - base->RCR4 |= I2S_RCR4_FCONT_MASK; -#endif - - /* Install callback for Tx dma channel */ - DMA_SetCallback(dmaHandle, SAI_RxDMACallback, &s_dmaPrivateHandle[instance][1]); -} - -/*! - * @brief Configures the SAI Rx. - * - * - * @param base SAI base pointer. - * @param handle SAI DMA handle pointer. - * @param saiConfig sai configurations. - */ -void SAI_TransferRxSetConfigDMA(I2S_Type *base, sai_dma_handle_t *handle, sai_transceiver_t *saiConfig) -{ - assert((handle != NULL) && (saiConfig != NULL)); - - dma_transfer_config_t config = {0}; - - /* Configure the audio format to SAI registers */ - SAI_RxSetConfig(base, saiConfig); - - handle->channel = saiConfig->startChannel; - - /* Configure the data format into DMA register */ - config.srcAddr = SAI_RxGetDataRegisterAddress(base, handle->channel); - config.enableDestIncrement = true; - config.enableSrcIncrement = false; - switch (saiConfig->frameSync.frameSyncWidth) - { - case 8: - config.srcSize = kDMA_Transfersize8bits; - config.destSize = kDMA_Transfersize8bits; - handle->bytesPerFrame = 1U; - break; - case 16: - config.srcSize = kDMA_Transfersize16bits; - config.destSize = kDMA_Transfersize16bits; - handle->bytesPerFrame = 2U; - break; - default: - config.srcSize = kDMA_Transfersize32bits; - config.destSize = kDMA_Transfersize32bits; - handle->bytesPerFrame = 4U; - break; - } - - /* Configure DMA channel */ - (void)DMA_SubmitTransfer(handle->dmaHandle, &config, 1UL); -} - -/*! - * @brief Configures the SAI Tx. - * - * - * @param base SAI base pointer. - * @param handle SAI DMA handle pointer. - * @param saiConfig sai configurations. - */ -void SAI_TransferTxSetConfigDMA(I2S_Type *base, sai_dma_handle_t *handle, sai_transceiver_t *saiConfig) -{ - assert((handle != NULL) && (saiConfig != NULL)); - - dma_transfer_config_t config = {0}; - - /* Configure the audio format to SAI registers */ - SAI_TxSetConfig(base, saiConfig); - - handle->channel = saiConfig->startChannel; - - /* Configure the data format into DMA register */ - config.destAddr = SAI_TxGetDataRegisterAddress(base, handle->channel); - config.enableDestIncrement = false; - config.enableSrcIncrement = true; - switch (saiConfig->frameSync.frameSyncWidth) - { - case 8: - config.srcSize = kDMA_Transfersize8bits; - config.destSize = kDMA_Transfersize8bits; - handle->bytesPerFrame = 1U; - break; - case 16: - config.srcSize = kDMA_Transfersize16bits; - config.destSize = kDMA_Transfersize16bits; - handle->bytesPerFrame = 2U; - break; - default: - config.srcSize = kDMA_Transfersize32bits; - config.destSize = kDMA_Transfersize32bits; - handle->bytesPerFrame = 4U; - break; - } - - /* Configure DMA channel */ - (void)DMA_SubmitTransfer(handle->dmaHandle, &config, 1UL); -} - -/*! - * brief Performs a non-blocking SAI transfer using DMA. - * - * note This interface returns immediately after the transfer initiates. Call - * the SAI_GetTransferStatus to poll the transfer status to check whether the SAI transfer finished. - * - * param base SAI base pointer. - * param handle SAI DMA handle pointer. - * param xfer Pointer to DMA transfer structure. - * retval kStatus_Success Successfully start the data receive. - * retval kStatus_SAI_TxBusy Previous receive still not finished. - * retval kStatus_InvalidArgument The input parameter is invalid. - */ -status_t SAI_TransferSendDMA(I2S_Type *base, sai_dma_handle_t *handle, sai_transfer_t *xfer) -{ - assert((handle != NULL) && (xfer != NULL)); - - /* Check if input parameter invalid */ - if ((xfer->data == NULL) || (xfer->dataSize == 0U)) - { - return kStatus_InvalidArgument; - } - - if (handle->saiQueue[handle->queueUser].data != NULL) - { - return kStatus_SAI_QueueFull; - } - - handle->transferSize[handle->queueUser] = xfer->dataSize; - handle->saiQueue[handle->queueUser].data = xfer->data; - handle->saiQueue[handle->queueUser].dataSize = xfer->dataSize; - handle->queueUser = (handle->queueUser + 1U) % SAI_XFER_QUEUE_SIZE; - - /* Set the source address */ - DMA_SetSourceAddress(handle->dmaHandle->base, handle->dmaHandle->channel, (uint32_t)(xfer->data)); - - /* Set the transfer size */ - DMA_SetTransferSize(handle->dmaHandle->base, handle->dmaHandle->channel, xfer->dataSize); - - /* Change the state of handle */ - handle->state = (uint32_t)kSAI_Busy; - - /* Start DMA transfer */ - DMA_StartTransfer(handle->dmaHandle); - -/* Enable DMA request and start SAI */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - SAI_TxEnableDMA(base, kSAI_FIFORequestDMAEnable, true); -#else - SAI_TxEnableDMA(base, kSAI_FIFOWarningDMAEnable, true); -#endif - SAI_TxEnable(base, true); - - return kStatus_Success; -} - -/*! - * brief Performs a non-blocking SAI transfer using DMA. - * - * note This interface returns immediately after transfer initiates. Call - * SAI_GetTransferStatus to poll the transfer status to check whether the SAI transfer is finished. - * - * param base SAI base pointer - * param handle SAI DMA handle pointer. - * param xfer Pointer to DMA transfer structure. - * retval kStatus_Success Successfully start the data receive. - * retval kStatus_SAI_RxBusy Previous receive still not finished. - * retval kStatus_InvalidArgument The input parameter is invalid. - */ -status_t SAI_TransferReceiveDMA(I2S_Type *base, sai_dma_handle_t *handle, sai_transfer_t *xfer) -{ - assert((handle != NULL) && (xfer != NULL)); - - /* Check if input parameter invalid */ - if ((xfer->data == NULL) || (xfer->dataSize == 0U)) - { - return kStatus_InvalidArgument; - } - - if (handle->saiQueue[handle->queueUser].data != NULL) - { - return kStatus_SAI_QueueFull; - } - - /* Add into queue */ - handle->transferSize[handle->queueUser] = xfer->dataSize; - handle->saiQueue[handle->queueUser].data = xfer->data; - handle->saiQueue[handle->queueUser].dataSize = xfer->dataSize; - handle->queueUser = (handle->queueUser + 1U) % SAI_XFER_QUEUE_SIZE; - - /* Set the source address */ - DMA_SetDestinationAddress(handle->dmaHandle->base, handle->dmaHandle->channel, (uint32_t)(xfer->data)); - - /* Set the transfer size */ - DMA_SetTransferSize(handle->dmaHandle->base, handle->dmaHandle->channel, xfer->dataSize); - - /* Change the state of handle */ - handle->state = (uint32_t)kSAI_Busy; - - /* Start DMA transfer */ - DMA_StartTransfer(handle->dmaHandle); - -/* Enable DMA request and start SAI */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - SAI_RxEnableDMA(base, kSAI_FIFORequestDMAEnable, true); -#else - SAI_RxEnableDMA(base, kSAI_FIFOWarningDMAEnable, true); -#endif - SAI_RxEnable(base, true); - - return kStatus_Success; -} - -/*! - * brief Aborts a SAI transfer using DMA. - * - * param base SAI base pointer. - * param handle SAI DMA handle pointer. - */ -void SAI_TransferAbortSendDMA(I2S_Type *base, sai_dma_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable dma */ - DMA_AbortTransfer(handle->dmaHandle); - -/* Disable DMA enable bit */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - SAI_TxEnableDMA(base, kSAI_FIFORequestDMAEnable, false); -#else - SAI_TxEnableDMA(base, kSAI_FIFOWarningDMAEnable, false); -#endif - - /* Disable Tx */ - SAI_TxEnable(base, false); - - /* Set the handle state */ - handle->state = (uint32_t)kSAI_Idle; - - /* Clear the queue */ - (void)memset(handle->saiQueue, 0, sizeof(sai_transfer_t) * SAI_XFER_QUEUE_SIZE); - handle->queueDriver = 0; - handle->queueUser = 0; -} - -/*! - * brief Aborts a SAI transfer using DMA. - * - * param base SAI base pointer. - * param handle SAI DMA handle pointer. - */ -void SAI_TransferAbortReceiveDMA(I2S_Type *base, sai_dma_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable dma */ - DMA_AbortTransfer(handle->dmaHandle); - -/* Disable DMA enable bit */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - SAI_RxEnableDMA(base, kSAI_FIFORequestDMAEnable, false); -#else - SAI_RxEnableDMA(base, kSAI_FIFOWarningDMAEnable, false); -#endif - - /* Disable Rx */ - SAI_RxEnable(base, false); - - /* Set the handle state */ - handle->state = (uint32_t)kSAI_Idle; - - /* Clear the queue */ - (void)memset(handle->saiQueue, 0, sizeof(sai_transfer_t) * SAI_XFER_QUEUE_SIZE); - handle->queueDriver = 0; - handle->queueUser = 0; -} - -/*! - * brief Gets byte count sent by SAI. - * - * param base SAI base pointer. - * param handle SAI DMA handle pointer. - * param count Bytes count sent by SAI. - * retval kStatus_Success Succeed get the transfer count. - * retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t SAI_TransferGetSendCountDMA(I2S_Type *base, sai_dma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - status_t status = kStatus_Success; - - if (handle->state != (uint32_t)kSAI_Busy) - { - status = kStatus_NoTransferInProgress; - } - else - { - *count = handle->transferSize[handle->queueDriver] - - DMA_GetRemainingBytes(handle->dmaHandle->base, handle->dmaHandle->channel); - } - - return status; -} - -/*! - * brief Gets byte count received by SAI. - * - * param base SAI base pointer. - * param handle SAI DMA handle pointer. - * param count Bytes count received by SAI. - * retval kStatus_Success Succeed get the transfer count. - * retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t SAI_TransferGetReceiveCountDMA(I2S_Type *base, sai_dma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - status_t status = kStatus_Success; - - if (handle->state != (uint32_t)kSAI_Busy) - { - status = kStatus_NoTransferInProgress; - } - else - { - *count = handle->transferSize[handle->queueDriver] - - DMA_GetRemainingBytes(handle->dmaHandle->base, handle->dmaHandle->channel); - } - - return status; -} diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_sai_dma.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_sai_dma.h deleted file mode 100644 index 9c3f6f199ad..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_sai_dma.h +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2017,2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_SAI_DMA_H_ -#define FSL_SAI_DMA_H_ - -#include "fsl_dma.h" -#include "fsl_sai.h" - -/*! - * @addtogroup sai_dma SAI DMA Driver - * @ingroup sai - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -#define FSL_SAI_DMA_DRIVER_VERSION (MAKE_VERSION(2, 4, 0)) /*!< Version 2.4.0 */ -/*! @} */ - -typedef struct _sai_dma_handle sai_dma_handle_t; - -/*! @brief Define SAI DMA callback */ -typedef void (*sai_dma_callback_t)(I2S_Type *base, sai_dma_handle_t *handle, status_t status, void *userData); - -/*! @brief SAI DMA transfer handle, users should not touch the content of the handle.*/ -struct _sai_dma_handle -{ - dma_handle_t *dmaHandle; /*!< DMA handler for SAI send */ - uint8_t bytesPerFrame; /*!< Bytes in a frame */ - uint8_t channel; /*!< Which Data channel SAI use */ - uint32_t state; /*!< SAI DMA transfer internal state */ - sai_dma_callback_t callback; /*!< Callback for users while transfer finish or error occurred */ - void *userData; /*!< User callback parameter */ - sai_transfer_t saiQueue[SAI_XFER_QUEUE_SIZE]; /*!< Transfer queue storing queued transfer. */ - size_t transferSize[SAI_XFER_QUEUE_SIZE]; /*!< Data bytes need to transfer */ - volatile uint8_t queueUser; /*!< Index for user to queue transfer. */ - volatile uint8_t queueDriver; /*!< Index for driver to get the transfer data and size */ -}; - -/******************************************************************************* - * APIs - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif -/*! - * @name DMA Transactional - * @{ - */ - -/*! - * @brief Initializes the SAI master DMA handle. - * - * This function initializes the SAI master DMA handle, which can be used for other SAI master transactional APIs. - * Usually, for a specified SAI instance, call this API once to get the initialized handle. - * - * @param base SAI base pointer. - * @param handle SAI DMA handle pointer. - * @param base SAI peripheral base address. - * @param callback Pointer to user callback function. - * @param userData User parameter passed to the callback function. - * @param dmaHandle DMA handle pointer, this handle shall be static allocated by users. - */ -void SAI_TransferTxCreateHandleDMA( - I2S_Type *base, sai_dma_handle_t *handle, sai_dma_callback_t callback, void *userData, dma_handle_t *dmaHandle); - -/*! - * @brief Initializes the SAI slave DMA handle. - * - * This function initializes the SAI slave DMA handle, which can be used for other SAI master transactional APIs. - * Usually, for a specified SAI instance, call this API once to get the initialized handle. - * - * @param base SAI base pointer. - * @param handle SAI DMA handle pointer. - * @param base SAI peripheral base address. - * @param callback Pointer to user callback function. - * @param userData User parameter passed to the callback function. - * @param dmaHandle DMA handle pointer, this handle shall be static allocated by users. - */ -void SAI_TransferRxCreateHandleDMA( - I2S_Type *base, sai_dma_handle_t *handle, sai_dma_callback_t callback, void *userData, dma_handle_t *dmaHandle); - -/*! - * @brief Performs a non-blocking SAI transfer using DMA. - * - * @note This interface returns immediately after the transfer initiates. Call - * the SAI_GetTransferStatus to poll the transfer status to check whether the SAI transfer finished. - * - * @param base SAI base pointer. - * @param handle SAI DMA handle pointer. - * @param xfer Pointer to DMA transfer structure. - * @retval kStatus_Success Successfully start the data receive. - * @retval kStatus_SAI_TxBusy Previous receive still not finished. - * @retval kStatus_InvalidArgument The input parameter is invalid. - */ -status_t SAI_TransferSendDMA(I2S_Type *base, sai_dma_handle_t *handle, sai_transfer_t *xfer); - -/*! - * @brief Performs a non-blocking SAI transfer using DMA. - * - * @note This interface returns immediately after transfer initiates. Call - * SAI_GetTransferStatus to poll the transfer status to check whether the SAI transfer is finished. - * - * @param base SAI base pointer - * @param handle SAI DMA handle pointer. - * @param xfer Pointer to DMA transfer structure. - * @retval kStatus_Success Successfully start the data receive. - * @retval kStatus_SAI_RxBusy Previous receive still not finished. - * @retval kStatus_InvalidArgument The input parameter is invalid. - */ -status_t SAI_TransferReceiveDMA(I2S_Type *base, sai_dma_handle_t *handle, sai_transfer_t *xfer); - -/*! - * @brief Aborts a SAI transfer using DMA. - * - * @param base SAI base pointer. - * @param handle SAI DMA handle pointer. - */ -void SAI_TransferAbortSendDMA(I2S_Type *base, sai_dma_handle_t *handle); - -/*! - * @brief Aborts a SAI transfer using DMA. - * - * @param base SAI base pointer. - * @param handle SAI DMA handle pointer. - */ -void SAI_TransferAbortReceiveDMA(I2S_Type *base, sai_dma_handle_t *handle); - -/*! - * @brief Gets byte count sent by SAI. - * - * @param base SAI base pointer. - * @param handle SAI DMA handle pointer. - * @param count Bytes count sent by SAI. - * @retval kStatus_Success Succeed get the transfer count. - * @retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t SAI_TransferGetSendCountDMA(I2S_Type *base, sai_dma_handle_t *handle, size_t *count); - -/*! - * @brief Gets byte count received by SAI. - * - * @param base SAI base pointer. - * @param handle SAI DMA handle pointer. - * @param count Bytes count received by SAI. - * @retval kStatus_Success Succeed get the transfer count. - * @retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t SAI_TransferGetReceiveCountDMA(I2S_Type *base, sai_dma_handle_t *handle, size_t *count); - -/*! - * @brief Configures the SAI Tx. - * - * - * @param base SAI base pointer. - * @param handle SAI DMA handle pointer. - * @param saiConfig sai configurations. - */ -void SAI_TransferTxSetConfigDMA(I2S_Type *base, sai_dma_handle_t *handle, sai_transceiver_t *saiConfig); - -/*! - * @brief Configures the SAI Rx. - * - * - * @param base SAI base pointer. - * @param handle SAI DMA handle pointer. - * @param saiConfig sai configurations. - */ -void SAI_TransferRxSetConfigDMA(I2S_Type *base, sai_dma_handle_t *handle, sai_transceiver_t *saiConfig); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ -#endif diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_sim.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_sim.c deleted file mode 100644 index a444c23d36c..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_sim.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_sim.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.sim" -#endif - -/******************************************************************************* - * Codes - ******************************************************************************/ -#if (defined(FSL_FEATURE_SIM_OPT_HAS_USB_VOLTAGE_REGULATOR) && FSL_FEATURE_SIM_OPT_HAS_USB_VOLTAGE_REGULATOR) -/*! - * brief Sets the USB voltage regulator setting. - * - * This function configures whether the USB voltage regulator is enabled in - * normal RUN mode, STOP/VLPS/LLS/VLLS modes, and VLPR/VLPW modes. The configurations - * are passed in as mask value of \ref _sim_usb_volt_reg_enable_mode. For example, to enable - * USB voltage regulator in RUN/VLPR/VLPW modes and disable in STOP/VLPS/LLS/VLLS mode, - * use: - * - * SIM_SetUsbVoltRegulatorEnableMode(kSIM_UsbVoltRegEnable | kSIM_UsbVoltRegEnableInLowPower); - * - * param mask USB voltage regulator enable setting. - */ -void SIM_SetUsbVoltRegulatorEnableMode(uint32_t mask) -{ - SIM->SOPT1CFG |= (SIM_SOPT1CFG_URWE_MASK | SIM_SOPT1CFG_UVSWE_MASK | SIM_SOPT1CFG_USSWE_MASK); - - SIM->SOPT1 = (SIM->SOPT1 & ~(uint32_t)kSIM_UsbVoltRegEnableInAllModes) | mask; -} -#endif /* FSL_FEATURE_SIM_OPT_HAS_USB_VOLTAGE_REGULATOR */ - -/*! - * brief Gets the unique identification register value. - * - * param uid Pointer to the structure to save the UID value. - */ -void SIM_GetUniqueId(sim_uid_t *uid) -{ -#if (defined(FSL_FEATURE_SIM_HAS_UIDH) && FSL_FEATURE_SIM_HAS_UIDH) - uid->H = SIM->UIDH; -#elif defined(SIM_UID0_UID_MASK) - uid->H = SIM->UID0; -#endif /* FSL_FEATURE_SIM_HAS_UIDH */ - -#if (defined(FSL_FEATURE_SIM_HAS_UIDM) && FSL_FEATURE_SIM_HAS_UIDM) - uid->M = SIM->UIDM; -#else - -#if defined(SIM_UID1_UID_MASK) - uid->MH = SIM->UID1; -#else - uid->MH = SIM->UIDMH; -#endif /* SIM_UID1_UID_MASK */ - -#if defined(SIM_UID2_UID_MASK) - uid->ML = SIM->UID2; -#else - uid->ML = SIM->UIDML; -#endif /* SIM_UID2_UID_MASK */ - -#endif /* FSL_FEATURE_SIM_HAS_UIDM */ - -#if defined(SIM_UID3_UID_MASK) - uid->L = SIM->UID3; -#else - uid->L = SIM->UIDL; -#endif /* SIM_UID3_UID_MASK */ -} - -#if (defined(FSL_FEATURE_SIM_HAS_RF_MAC_ADDR) && FSL_FEATURE_SIM_HAS_RF_MAC_ADDR) -/*! - * brief Gets the RF address register value. - * - * param info Pointer to the structure to save the RF address value. - */ -void SIM_GetRfAddr(sim_rf_addr_t *info) -{ - info->rfAddrL = SIM->RFADDRL; - info->rfAddrH = SIM->RFADDRH; -} -#endif /* FSL_FEATURE_SIM_HAS_RF_MAC_ADDR */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_sim.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_sim.h deleted file mode 100644 index e24202417bd..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_sim.h +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_SIM_H_ -#define FSL_SIM_H_ - -#include "fsl_common.h" - -/*! @addtogroup sim */ -/*! @{*/ - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -#define FSL_SIM_DRIVER_VERSION (MAKE_VERSION(2, 1, 3)) /*!< Driver version. */ -/*! @} */ - -#if (defined(FSL_FEATURE_SIM_OPT_HAS_USB_VOLTAGE_REGULATOR) && FSL_FEATURE_SIM_OPT_HAS_USB_VOLTAGE_REGULATOR) -/*!@brief USB voltage regulator enable setting. */ -enum _sim_usb_volt_reg_enable_mode -{ - kSIM_UsbVoltRegEnable = (int)SIM_SOPT1_USBREGEN_MASK, /*!< Enable voltage regulator. */ - kSIM_UsbVoltRegEnableInLowPower = SIM_SOPT1_USBVSTBY_MASK, /*!< Enable voltage regulator in VLPR/VLPW modes. */ - kSIM_UsbVoltRegEnableInStop = SIM_SOPT1_USBSSTBY_MASK, /*!< Enable voltage regulator in STOP/VLPS/LLS/VLLS modes. */ - kSIM_UsbVoltRegEnableInAllModes = - (int)(SIM_SOPT1_USBREGEN_MASK | SIM_SOPT1_USBSSTBY_MASK | - SIM_SOPT1_USBVSTBY_MASK) /*!< Enable voltage regulator in all power modes. */ -}; -#endif /* (defined(FSL_FEATURE_SIM_OPT_HAS_USB_VOLTAGE_REGULATOR) && FSL_FEATURE_SIM_OPT_HAS_USB_VOLTAGE_REGULATOR) */ - -/*!@brief Unique ID. */ -typedef struct _sim_uid -{ -#if (defined(FSL_FEATURE_SIM_HAS_UIDH) && FSL_FEATURE_SIM_HAS_UIDH) - uint32_t H; /*!< UIDH. */ -#endif - -#if (defined(FSL_FEATURE_SIM_HAS_UIDM) && FSL_FEATURE_SIM_HAS_UIDM) - uint32_t M; /*!< SIM_UIDM. */ -#else - uint32_t MH; /*!< UIDMH. */ - uint32_t ML; /*!< UIDML. */ -#endif /* FSL_FEATURE_SIM_HAS_UIDM */ - uint32_t L; /*!< UIDL. */ -} sim_uid_t; - -#if (defined(FSL_FEATURE_SIM_HAS_RF_MAC_ADDR) && FSL_FEATURE_SIM_HAS_RF_MAC_ADDR) -/*! @brief RF Mac Address.*/ -typedef struct _sim_rf_addr -{ - uint32_t rfAddrL; /*!< RFADDRL. */ - uint32_t rfAddrH; /*!< RFADDRH. */ -} sim_rf_addr_t; -#endif /* FSL_FEATURE_SIM_HAS_RF_MAC_ADDR */ - -/*!@brief Flash enable mode. */ -enum _sim_flash_mode -{ - kSIM_FlashDisableInWait = SIM_FCFG1_FLASHDOZE_MASK, /*!< Disable flash in wait mode. */ - kSIM_FlashDisable = SIM_FCFG1_FLASHDIS_MASK /*!< Disable flash in normal mode. */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus*/ - -#if (defined(FSL_FEATURE_SIM_OPT_HAS_USB_VOLTAGE_REGULATOR) && FSL_FEATURE_SIM_OPT_HAS_USB_VOLTAGE_REGULATOR) -/*! - * @brief Sets the USB voltage regulator setting. - * - * This function configures whether the USB voltage regulator is enabled in - * normal RUN mode, STOP/VLPS/LLS/VLLS modes, and VLPR/VLPW modes. The configurations - * are passed in as mask value of \ref _sim_usb_volt_reg_enable_mode. For example, to enable - * USB voltage regulator in RUN/VLPR/VLPW modes and disable in STOP/VLPS/LLS/VLLS mode, - * use: - * - * SIM_SetUsbVoltRegulatorEnableMode(kSIM_UsbVoltRegEnable | kSIM_UsbVoltRegEnableInLowPower); - * - * @param mask USB voltage regulator enable setting. - */ -void SIM_SetUsbVoltRegulatorEnableMode(uint32_t mask); -#endif /* FSL_FEATURE_SIM_OPT_HAS_USB_VOLTAGE_REGULATOR */ - -/*! - * @brief Gets the unique identification register value. - * - * @param uid Pointer to the structure to save the UID value. - */ -void SIM_GetUniqueId(sim_uid_t *uid); - -/*! - * @brief Sets the flash enable mode. - * - * @param mode The mode to set; see \ref _sim_flash_mode for mode details. - */ -static inline void SIM_SetFlashMode(uint8_t mode) -{ - SIM->FCFG1 = mode; -} - -#if (defined(FSL_FEATURE_SIM_HAS_RF_MAC_ADDR) && FSL_FEATURE_SIM_HAS_RF_MAC_ADDR) -/*! - * @brief Gets the RF address register value. - * - * @param info Pointer to the structure to save the RF address value. - */ -void SIM_GetRfAddr(sim_rf_addr_t *info); -#endif /* FSL_FEATURE_SIM_HAS_RF_MAC_ADDR */ - -#if (defined(FSL_FEATURE_SIM_MISC2_HAS_SYSTICK_CLK_EN) && FSL_FEATURE_SIM_MISC2_HAS_SYSTICK_CLK_EN) - -/*! - * @brief Enable the Systick clock or not. - * - * The Systick clock is enabled by default. - * - * @param enable The switcher for Systick clock. - */ -static inline void SIM_EnableSystickClock(bool enable) -{ - if (enable) - { - SIM->MISC2 &= ~SIM_MISC2_SYSTICK_CLK_EN_MASK; /* Clear to enable. */ - } - else - { - SIM->MISC2 |= SIM_MISC2_SYSTICK_CLK_EN_MASK; /* Set to disable. */ - } -} - -#endif /* FSL_FEATURE_SIM_MISC2_HAS_SYSTICK_CLK_EN */ - -#if defined(__cplusplus) -} -#endif /* __cplusplus*/ - -/*! @}*/ - -#endif /* FSL_SIM_H_ */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_slcd.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_slcd.c deleted file mode 100644 index 5d66f5b3301..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_slcd.c +++ /dev/null @@ -1,374 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2019, 2021, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_slcd.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.slcd" -#endif - -#define SLCD_WAVEFORM_CONFIG_NUM 16U - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Get the SLCD instance from peripheral base address. - * - * @param base SLCD peripheral base address. - * @return SLCD instance. - */ -static uint32_t SLCD_GetInstance(LCD_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to slcd clocks for each instance. */ -static const clock_ip_name_t s_slcdClock[FSL_FEATURE_SOC_SLCD_COUNT] = SLCD_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/*! @brief Pointers to slcd bases for each instance. */ -static LCD_Type *const s_slcdBases[] = LCD_BASE_PTRS; - -/******************************************************************************* - * Code - ******************************************************************************/ - -static uint32_t SLCD_GetInstance(LCD_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_slcdBases); instance++) - { - if (s_slcdBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_slcdBases)); - - return instance; -} - -/*! - * brief Initializes the SLCD, ungates the module clock, initializes the power - * setting, enables all used plane pins, and sets with interrupt and work mode - * with the configuration. - * - * param base SLCD peripheral base address. - * param configure SLCD configuration pointer. - * For the configuration structure, many parameters have the default setting - * and the SLCD_Getdefaultconfig() is provided to get them. Use it - * verified for their applications. - * The others have no default settings, such as "clkConfig", and must be provided - * by the application before calling the SLCD_Init() API. - */ -void SLCD_Init(LCD_Type *base, slcd_config_t *configure) -{ - assert(configure); - assert(configure->clkConfig); - - uint32_t gcrReg = 0; - bool intEnabled = false; - uint32_t regNum = 0; - uint32_t instance = SLCD_GetInstance(base); - - /* Bit mask of the LCD_GCR to modify in this function. */ - uint32_t gcrMsk = 0; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Un-gate the SLCD clock. */ - CLOCK_EnableClock(s_slcdClock[instance]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Configure general setting: power supply. */ - gcrReg = LCD_GCR_RVEN((uint32_t)configure->powerSupply & 0x1U) | - LCD_GCR_CPSEL(((uint32_t)configure->powerSupply >> 1U) & 0x1U) | - LCD_GCR_VSUPPLY(((uint32_t)configure->powerSupply >> 2U) & 0x1U) | - LCD_GCR_LADJ((uint32_t)configure->loadAdjust); - /* Configure general setting: clock source. */ - gcrReg |= LCD_GCR_SOURCE(((uint32_t)configure->clkConfig->clkSource) & 0x1U) | - LCD_GCR_LCLK(configure->clkConfig->clkPrescaler) | LCD_GCR_ALTDIV(configure->clkConfig->altClkDivider); - /* Configure the duty and set the work for low power wait and stop mode. */ - gcrReg |= LCD_GCR_DUTY(configure->dutyCycle) | LCD_GCR_LCDSTP((uint32_t)configure->lowPowerBehavior & 0x1U); - - gcrMsk = LCD_GCR_RVEN_MASK | LCD_GCR_CPSEL_MASK | LCD_GCR_VSUPPLY_MASK | LCD_GCR_LADJ_MASK | LCD_GCR_SOURCE_MASK | - LCD_GCR_LCLK_MASK | LCD_GCR_ALTDIV_MASK | LCD_GCR_DUTY_MASK | LCD_GCR_LCDSTP_MASK; - -#if FSL_FEATURE_SLCD_HAS_LCD_WAIT - gcrReg |= LCD_GCR_LCDWAIT(((uint32_t)configure->lowPowerBehavior >> 1U) & 0x1U); - gcrMsk |= LCD_GCR_LCDWAIT_MASK; -#endif -#if FSL_FEATURE_SLCD_HAS_LCD_DOZE_ENABLE - gcrReg |= LCD_GCR_LCDDOZE(((uint32_t)configure->lowPowerBehavior >> 1U) & 0x1U); - gcrMsk |= LCD_GCR_LCDDOZE_MASK; -#endif -#if FSL_FEATURE_SLCD_HAS_FRAME_FREQUENCY_INTERRUPT - /* Configure for frame frequency interrupt. */ - gcrReg |= LCD_GCR_LCDIEN(configure->frameFreqIntEnable); - gcrMsk |= LCD_GCR_LCDIEN_MASK; -#endif /* FSL_FEATURE_SLCD_HAS_FRAME_FREQUENCY_INTERRUPT */ -#if FSL_FEATURE_SLCD_HAS_MULTI_ALTERNATE_CLOCK_SOURCE - /* Select the alternate clock for alternate clock source. */ - gcrReg |= LCD_GCR_ALTSOURCE((((uint32_t)configure->clkConfig->clkSource) >> 1U) & 0x1U); - gcrMsk |= LCD_GCR_ALTSOURCE_MASK; -#endif /* FSL_FEATURE_SLCD_HAS_MULTI_ALTERNATE_CLOCK_SOURCE */ -#if FSL_FEATURE_SLCD_HAS_FAST_FRAME_RATE - /* Configure the for fast frame rate. */ - gcrReg |= LCD_GCR_FFR(configure->clkConfig->fastFrameRateEnable ? 1U : 0U); - gcrMsk |= LCD_GCR_FFR_MASK; -#endif /* FSL_FEATURE_SLCD_HAS_FAST_FRAME_RATE */ - - gcrReg |= LCD_GCR_RVTRIM(configure->voltageTrim); - gcrMsk |= LCD_GCR_RVTRIM_MASK; - - base->GCR = (base->GCR & ~gcrMsk) | gcrReg; - - /* Set display mode. */ - base->AR = LCD_AR_ALT((uint32_t)configure->displayMode & 0x1U) | - LCD_AR_BLANK(((uint32_t)configure->displayMode >> 1U) & 0x1U); - - /* Configure the front plane and back plane pin setting. */ - base->BPEN[0] = configure->backPlaneLowPin; - base->BPEN[1] = configure->backPlaneHighPin; - base->PEN[0] = configure->slcdLowPinEnabled; - base->PEN[1] = configure->slcdHighPinEnabled; - - /* Set the fault frame detection. */ - base->FDCR = 0; - if (NULL != configure->faultConfig) - { - /* If fault configure structure is not NULL, the fault detection is enabled. */ - base->FDCR = LCD_FDCR_FDPRS(configure->faultConfig->faultPrescaler) | - LCD_FDCR_FDSWW(configure->faultConfig->width) | - LCD_FDCR_FDBPEN(configure->faultConfig->faultDetectBackPlaneEnable ? 1U : 0U) | - LCD_FDCR_FDPINID(configure->faultConfig->faultDetectPinIndex) | LCD_FDCR_FDEN_MASK; - if (configure->faultConfig->faultDetectIntEnable) - { - base->GCR |= LCD_GCR_FDCIEN_MASK; - intEnabled = true; - } - } - - /* Initialize the Waveform. */ - for (regNum = 0; regNum < SLCD_WAVEFORM_CONFIG_NUM; regNum++) - { - base->WF[regNum] = 0; - } - -/* Enable the NVIC. */ -#if FSL_FEATURE_SLCD_HAS_FRAME_FREQUENCY_INTERRUPT - if (configure->frameFreqIntEnable) - { - intEnabled = true; - } -#endif /* FSL_FEATURE_SLCD_HAS_FRAME_FREQUENCY_INTERRUPT */ - if (intEnabled) - { - (void)EnableIRQ(LCD_IRQn); - } -} - -/*! - * brief Deinitializes the SLCD module, gates the module clock, disables an interrupt, - * and displays the SLCD. - * - * param base SLCD peripheral base address. - */ -void SLCD_Deinit(LCD_Type *base) -{ - uint32_t instance = SLCD_GetInstance(base); - - /* Stop SLCD display. */ - SLCD_StopDisplay(base); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate the SLCD clock. */ - CLOCK_DisableClock(s_slcdClock[instance]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Disable NVIC. */ - (void)DisableIRQ(LCD_IRQn); -} - -/*! - * brief Gets the SLCD default configuration structure. The - * purpose of this API is to get default parameters of the configuration structure - * for the SLCD_Init(). Use these initialized parameters unchanged in SLCD_Init() - * or modify fields of the structure before the calling SLCD_Init(). - * All default parameters of the configure structuration are listed. - * code - config.displayMode = kSLCD_NormalMode; - config.powerSupply = kSLCD_InternalVll3UseChargePump; - config.voltageTrim = kSLCD_RegulatedVolatgeTrim00; - config.lowPowerBehavior = kSLCD_EnabledInWaitStop; - config.interruptSrc = 0; - config.faultConfig = NULL; - config.frameFreqIntEnable = false; - endcode - * param configure The SLCD configuration structure pointer. - */ -void SLCD_GetDefaultConfig(slcd_config_t *configure) -{ - assert(configure); - - /* Initializes the configure structure to zero. */ - (void)memset(configure, 0, sizeof(*configure)); - - /* Get Default parameters for the configuration structure. */ - /* SLCD in normal mode. */ - configure->displayMode = kSLCD_NormalMode; - /* Power supply default: use charge pump to generate VLL1 and VLL2, VLL3 connected to VDD internally. */ - configure->powerSupply = kSLCD_InternalVll3UseChargePump; - configure->voltageTrim = kSLCD_RegulatedVolatgeTrim08; - /* Work in low power mode. */ - configure->lowPowerBehavior = kSLCD_EnabledInWaitStop; -#if FSL_FEATURE_SLCD_HAS_FRAME_FREQUENCY_INTERRUPT - /* No interrupt source is enabled. */ - configure->frameFreqIntEnable = false; -#endif /* FSL_FEATURE_SLCD_HAS_FRAME_FREQUENCY_INTERRUPT */ - /* Fault detection is disabled. */ - configure->faultConfig = NULL; -} - -/*! - * brief Starts the SLCD blink mode. - * - * param base SLCD peripheral base address. - * param mode SLCD blink mode. - * param rate SLCD blink rate. - */ -void SLCD_StartBlinkMode(LCD_Type *base, slcd_blink_mode_t mode, slcd_blink_rate_t rate) -{ - uint32_t mask = LCD_AR_BMODE_MASK | LCD_AR_BRATE_MASK; - uint32_t arReg = base->AR; - -#if FSL_FEATURE_SLCD_HAS_FRAME_FREQUENCY_INTERRUPT - mask |= LCD_AR_LCDIF_MASK; -#endif /* FSL_FEATURE_SLCD_HAS_FRAME_FREQUENCY_INTERRUPT */ - - arReg &= ~mask; - /* Set blink mode and blink rate. */ - arReg |= LCD_AR_BMODE(mode) | LCD_AR_BRATE(rate); - base->AR = arReg; - - /* Enable Blink after setting the blink rate to meet some hardware requirement. */ - arReg |= LCD_AR_BLINK_MASK; - base->AR = arReg; -} - -/*! - * brief Enables the SLCD interrupt. - * For example, to enable fault detect complete interrupt and frame frequency interrupt, - * for FSL_FEATURE_SLCD_HAS_FRAME_FREQUENCY_INTERRUPT enabled case, do the following. - * code - * SLCD_EnableInterrupts(LCD,kSLCD_FaultDetectCompleteInterrupt | kSLCD_FrameFreqInterrupt); - * endcode - * - * param base SLCD peripheral base address. - * param mask SLCD interrupts to enable. This is a logical OR of the - * enumeration :: slcd_interrupt_enable_t. - */ -void SLCD_EnableInterrupts(LCD_Type *base, uint32_t mask) -{ - uint32_t gcReg = base->GCR; - - gcReg |= LCD_GCR_FDCIEN(mask & 0x1U); -#if FSL_FEATURE_SLCD_HAS_FRAME_FREQUENCY_INTERRUPT - gcReg |= LCD_GCR_LCDIEN((mask >> 1U) & 0x1U); -#endif /* FSL_FEATURE_SLCD_HAS_FRAME_FREQUENCY_INTERRUPT */ - - base->GCR = gcReg; -} - -/*! - * brief Disables the SLCD interrupt. - * For example, to disable fault detect complete interrupt and frame frequency interrupt, - * for FSL_FEATURE_SLCD_HAS_FRAME_FREQUENCY_INTERRUPT enabled case, do the following. - * code - * SLCD_DisableInterrupts(LCD,kSLCD_FaultDetectCompleteInterrupt | kSLCD_FrameFreqInterrupt); - * endcode - * - * param base SLCD peripheral base address. - * param mask SLCD interrupts to disable. This is a logical OR of the - * enumeration :: slcd_interrupt_enable_t. - */ -void SLCD_DisableInterrupts(LCD_Type *base, uint32_t mask) -{ - uint32_t gcrReg = base->GCR; - - /*!< SLCD fault detection complete interrupt source. */ - if (0U != (mask & (uint32_t)kSLCD_FaultDetectCompleteInterrupt)) - { - gcrReg &= ~LCD_GCR_FDCIEN_MASK; - } -/*!< SLCD frame frequency interrupt source. */ -#if FSL_FEATURE_SLCD_HAS_FRAME_FREQUENCY_INTERRUPT - if (0U != (mask & (uint32_t)kSLCD_FrameFreqInterrupt)) - { - gcrReg &= ~LCD_GCR_LCDIEN_MASK; - } -#endif /* FSL_FEATURE_SLCD_HAS_FRAME_FREQUENCY_INTERRUPT */ - - base->GCR = gcrReg; -} - -/*! - * brief Clears the SLCD interrupt events status flag. - * - * param base SLCD peripheral base address. - * param mask SLCD interrupt source to be cleared. - * This is the logical OR of members of the enumeration :: slcd_interrupt_enable_t. - */ -void SLCD_ClearInterruptStatus(LCD_Type *base, uint32_t mask) -{ - /*!< SLCD fault detection complete interrupt source. */ - if (0U != (mask & (uint32_t)kSLCD_FaultDetectCompleteInterrupt)) - { - base->FDSR |= LCD_FDSR_FDCF_MASK; - } -/*!< SLCD frame frequency interrupt source. */ -#if FSL_FEATURE_SLCD_HAS_FRAME_FREQUENCY_INTERRUPT - if (0U != (mask & (uint32_t)kSLCD_FrameFreqInterrupt)) - { - base->AR |= LCD_AR_LCDIF_MASK; - } -#endif /* FSL_FEATURE_SLCD_HAS_FRAME_FREQUENCY_INTERRUPT */ -} - -/*! - * brief Gets the SLCD interrupt status flag. - * - * param base SLCD peripheral base address. - * return The event status of the interrupt source. This is the logical OR of members - * of the enumeration :: slcd_interrupt_enable_t. - */ -uint32_t SLCD_GetInterruptStatus(LCD_Type *base) -{ - uint32_t status = 0; - - /* Get the frame detect complete interrupt status. */ - status = ((base->FDSR & LCD_FDSR_FDCF_MASK) >> LCD_FDSR_FDCF_SHIFT); - -#if FSL_FEATURE_SLCD_HAS_FRAME_FREQUENCY_INTERRUPT - /* Get the frame frequency interrupt status. */ - status |= ((base->AR & LCD_AR_LCDIF_MASK) >> (LCD_AR_LCDIF_SHIFT - 1U)); -#endif /* FSL_FEATURE_SLCD_HAS_FRAME_FREQUENCY_INTERRUPT */ - - return status; -} diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_slcd.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_slcd.h deleted file mode 100644 index 5f9797d845b..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_slcd.h +++ /dev/null @@ -1,561 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2019, 2021, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_SLCD_H_ -#define FSL_SLCD_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup slcd - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief SLCD driver version. */ -#define FSL_SLCD_DRIVER_VERSION (MAKE_VERSION(2, 0, 4)) -/*! @} */ - -/*! @brief SLCD power supply option. */ -typedef enum _slcd_power_supply_option -{ - kSLCD_InternalVll3UseChargePump = - 2U, /*!< VLL3 connected to VDD internally, charge pump is used to generate VLL1 and VLL2. */ - kSLCD_ExternalVll3UseResistorBiasNetwork = - 4U, /*!< VLL3 is driven externally and resistor bias network is used to generate VLL1 and VLL2. */ - kSLCD_ExteranlVll3UseChargePump = - 6U, /*!< VLL3 is driven externally and charge pump is used to generate VLL1 and VLL2. */ - kSLCD_InternalVll1UseChargePump = - 7U /*!< VIREG is connected to VLL1 internally and charge pump is used to generate VLL2 and VLL3. */ -} slcd_power_supply_option_t; - -/*! @brief SLCD regulated voltage trim parameter, be used to meet the desired contrast. */ -typedef enum _slcd_regulated_voltage_trim -{ - kSLCD_RegulatedVolatgeTrim00 = 0U, /*!< Increase the voltage to 0.91 V. */ - kSLCD_RegulatedVolatgeTrim01, /*!< Increase the voltage to 1.01 V. */ - kSLCD_RegulatedVolatgeTrim02, /*!< Increase the voltage to 0.96 V. */ - kSLCD_RegulatedVolatgeTrim03, /*!< Increase the voltage to 1.06 V. */ - kSLCD_RegulatedVolatgeTrim04, /*!< Increase the voltage to 0.93 V. */ - kSLCD_RegulatedVolatgeTrim05, /*!< Increase the voltage to 1.02 V. */ - kSLCD_RegulatedVolatgeTrim06, /*!< Increase the voltage to 0.98 V. */ - kSLCD_RegulatedVolatgeTrim07, /*!< Increase the voltage to 1.08 V. */ - kSLCD_RegulatedVolatgeTrim08, /*!< Increase the voltage to 0.92 V. */ - kSLCD_RegulatedVolatgeTrim09, /*!< Increase the voltage to 1.02 V. */ - kSLCD_RegulatedVolatgeTrim10, /*!< Increase the voltage to 0.97 V. */ - kSLCD_RegulatedVolatgeTrim11, /*!< Increase the voltage to 1.07 V. */ - kSLCD_RegulatedVolatgeTrim12, /*!< Increase the voltage to 0.94 V. */ - kSLCD_RegulatedVolatgeTrim13, /*!< Increase the voltage to 1.05 V. */ - kSLCD_RegulatedVolatgeTrim14, /*!< Increase the voltage to 0.99 V. */ - kSLCD_RegulatedVolatgeTrim15 /*!< Increase the voltage to 1.09 V. */ -} slcd_regulated_voltage_trim_t; - -/*! @brief SLCD load adjust to handle different LCD glass capacitance or - * configure the LCD charge pump clock source. - * Adjust the LCD glass capacitance if resistor bias network is enabled: - * kSLCD_LowLoadOrFastestClkSrc - Low load (LCD glass capacitance 2000pF or lower. - * LCD or GPIO function can be used on VLL1,VLL2,Vcap1 and Vcap2 pins) - * kSLCD_LowLoadOrIntermediateClkSrc - low load (LCD glass capacitance 2000pF or lower. - * LCD or GPIO function can be used on VLL1,VLL2,Vcap1 and Vcap2 pins) - * kSLCD_HighLoadOrIntermediateClkSrc - high load (LCD glass capacitance 8000pF or lower. - * LCD or GPIO function can be used on Vcap1 and Vcap2 pins) - * kSLCD_HighLoadOrSlowestClkSrc - high load (LCD glass capacitance 8000pF or lower - * LCD or GPIO function can be used on Vcap1 and Vcap2 pins) - * Adjust clock for charge pump if charge pump is enabled: - * kSLCD_LowLoadOrFastestClkSrc - Fasten clock source (LCD glass capacitance - * 8000pF or 4000pF or lower if Fast Frame Rate is set) - * kSLCD_LowLoadOrIntermediateClkSrc - Intermediate clock source (LCD glass - * capacitance 4000pF or 2000pF or lower if Fast Frame Rate is set) - * kSLCD_HighLoadOrIntermediateClkSrc - Intermediate clock source (LCD glass - * capacitance 2000pF or 1000pF or lower if Fast Frame Rate is set) - * kSLCD_HighLoadOrSlowestClkSrc - slowest clock source (LCD glass capacitance - * 1000pF or 500pF or lower if Fast Frame Rate is set) - */ -typedef enum _slcd_load_adjust -{ - kSLCD_LowLoadOrFastestClkSrc = 0U, /*!< Adjust in low load or selects fastest clock. */ - kSLCD_LowLoadOrIntermediateClkSrc, /*!< Adjust in low load or selects intermediate clock. */ - kSLCD_HighLoadOrIntermediateClkSrc, /*!< Adjust in high load or selects intermediate clock. */ - kSLCD_HighLoadOrSlowestClkSrc /*!< Adjust in high load or selects slowest clock. */ -} slcd_load_adjust_t; - -/*! @brief SLCD clock source. */ -typedef enum _slcd_clock_src -{ - kSLCD_DefaultClk = 0U, /*!< Select default clock ERCLK32K. */ - kSLCD_AlternateClk1 = 1U, /*!< Select alternate clock source 1 : MCGIRCLK. */ -#if FSL_FEATURE_SLCD_HAS_MULTI_ALTERNATE_CLOCK_SOURCE - kSLCD_AlternateClk2 = 3U /*!< Select alternate clock source 2 : OSCERCLK. */ -#endif /* FSL_FEATURE_SLCD_HAS_MULTI_ALTERNATE_CLOCK_SOURCE */ -} slcd_clock_src_t; - -/*! @brief SLCD alternate clock divider. */ -typedef enum _slcd_alt_clock_div -{ - kSLCD_AltClkDivFactor1 = 0U, /*!< No divide for alternate clock. */ - kSLCD_AltClkDivFactor64, /*!< Divide alternate clock with factor 64. */ - kSLCD_AltClkDivFactor256, /*!< Divide alternate clock with factor 256. */ - kSLCD_AltClkDivFactor512 /*!< Divide alternate clock with factor 512. */ -} slcd_alt_clock_div_t; - -/*! @brief SLCD clock prescaler to generate frame frequency. */ -typedef enum _slcd_clock_prescaler -{ - kSLCD_ClkPrescaler00 = 0U, /*!< Prescaler 0. */ - kSLCD_ClkPrescaler01, /*!< Prescaler 1. */ - kSLCD_ClkPrescaler02, /*!< Prescaler 2. */ - kSLCD_ClkPrescaler03, /*!< Prescaler 3. */ - kSLCD_ClkPrescaler04, /*!< Prescaler 4. */ - kSLCD_ClkPrescaler05, /*!< Prescaler 5. */ - kSLCD_ClkPrescaler06, /*!< Prescaler 6. */ - kSLCD_ClkPrescaler07 /*!< Prescaler 7. */ -} slcd_clock_prescaler_t; - -/*! @brief SLCD duty cycle. */ -typedef enum _slcd_duty_cycle -{ - kSLCD_1Div1DutyCycle = 0U, /*!< LCD use 1 BP 1/1 duty cycle. */ - kSLCD_1Div2DutyCycle, /*!< LCD use 2 BP 1/2 duty cycle. */ - kSLCD_1Div3DutyCycle, /*!< LCD use 3 BP 1/3 duty cycle. */ - kSLCD_1Div4DutyCycle, /*!< LCD use 4 BP 1/4 duty cycle. */ - kSLCD_1Div5DutyCycle, /*!< LCD use 5 BP 1/5 duty cycle. */ - kSLCD_1Div6DutyCycle, /*!< LCD use 6 BP 1/6 duty cycle. */ - kSLCD_1Div7DutyCycle, /*!< LCD use 7 BP 1/7 duty cycle. */ - kSLCD_1Div8DutyCycle /*!< LCD use 8 BP 1/8 duty cycle. */ -} slcd_duty_cycle_t; - -/*! @brief SLCD segment phase type. */ -typedef enum _slcd_phase_type -{ - kSLCD_NoPhaseActivate = 0x00U, /*!< LCD wareform no phase activates. */ - kSLCD_PhaseAActivate = 0x01U, /*!< LCD waveform phase A activates. */ - kSLCD_PhaseBActivate = 0x02U, /*!< LCD waveform phase B activates. */ - kSLCD_PhaseCActivate = 0x04U, /*!< LCD waveform phase C activates. */ - kSLCD_PhaseDActivate = 0x08U, /*!< LCD waveform phase D activates. */ - kSLCD_PhaseEActivate = 0x10U, /*!< LCD waveform phase E activates. */ - kSLCD_PhaseFActivate = 0x20U, /*!< LCD waveform phase F activates. */ - kSLCD_PhaseGActivate = 0x40U, /*!< LCD waveform phase G activates. */ - kSLCD_PhaseHActivate = 0x80U /*!< LCD waveform phase H activates. */ -} slcd_phase_type_t; - -/*! @brief SLCD segment phase bit index. */ -typedef enum _slcd_phase_index -{ - kSLCD_PhaseAIndex = 0x0U, /*!< LCD phase A bit index. */ - kSLCD_PhaseBIndex = 0x1U, /*!< LCD phase B bit index. */ - kSLCD_PhaseCIndex = 0x2U, /*!< LCD phase C bit index. */ - kSLCD_PhaseDIndex = 0x3U, /*!< LCD phase D bit index. */ - kSLCD_PhaseEIndex = 0x4U, /*!< LCD phase E bit index. */ - kSLCD_PhaseFIndex = 0x5U, /*!< LCD phase F bit index. */ - kSLCD_PhaseGIndex = 0x6U, /*!< LCD phase G bit index. */ - kSLCD_PhaseHIndex = 0x7U /*!< LCD phase H bit index. */ -} slcd_phase_index_t; - -/*! @brief SLCD display mode. */ -typedef enum _slcd_display_mode -{ - kSLCD_NormalMode = 0U, /*!< LCD Normal display mode. */ - kSLCD_AlternateMode, /*!< LCD Alternate display mode. For four back planes or less. */ - kSLCD_BlankMode /*!< LCD Blank display mode. */ -} slcd_display_mode_t; - -/*! @brief SLCD blink mode. */ -typedef enum _slcd_blink_mode -{ - kSLCD_BlankDisplayBlink = 0U, /*!< Display blank during the blink period. */ - kSLCD_AltDisplayBlink /*!< Display alternate display during the blink period if duty cycle is lower than 5. */ -} slcd_blink_mode_t; - -/*! @brief SLCD blink rate. */ -typedef enum _slcd_blink_rate -{ - kSLCD_BlinkRate00 = 0U, /*!< SLCD blink rate is LCD clock/((2^12)). */ - kSLCD_BlinkRate01, /*!< SLCD blink rate is LCD clock/((2^13)). */ - kSLCD_BlinkRate02, /*!< SLCD blink rate is LCD clock/((2^14)). */ - kSLCD_BlinkRate03, /*!< SLCD blink rate is LCD clock/((2^15)). */ - kSLCD_BlinkRate04, /*!< SLCD blink rate is LCD clock/((2^16)). */ - kSLCD_BlinkRate05, /*!< SLCD blink rate is LCD clock/((2^17)). */ - kSLCD_BlinkRate06, /*!< SLCD blink rate is LCD clock/((2^18)). */ - kSLCD_BlinkRate07 /*!< SLCD blink rate is LCD clock/((2^19)). */ -} slcd_blink_rate_t; - -/*! @brief SLCD fault detect clock prescaler. */ -typedef enum _slcd_fault_detect_clock_prescaler -{ - kSLCD_FaultSampleFreqDivider1 = 0U, /*!< Fault detect sample clock frequency is 1/1 bus clock. */ - kSLCD_FaultSampleFreqDivider2, /*!< Fault detect sample clock frequency is 1/2 bus clock. */ - kSLCD_FaultSampleFreqDivider4, /*!< Fault detect sample clock frequency is 1/4 bus clock. */ - kSLCD_FaultSampleFreqDivider8, /*!< Fault detect sample clock frequency is 1/8 bus clock. */ - kSLCD_FaultSampleFreqDivider16, /*!< Fault detect sample clock frequency is 1/16 bus clock. */ - kSLCD_FaultSampleFreqDivider32, /*!< Fault detect sample clock frequency is 1/32 bus clock. */ - kSLCD_FaultSampleFreqDivider64, /*!< Fault detect sample clock frequency is 1/64 bus clock. */ - kSLCD_FaultSampleFreqDivider128 /*!< Fault detect sample clock frequency is 1/128 bus clock. */ -} slcd_fault_detect_clock_prescaler_t; - -/*! @brief SLCD fault detect sample window width. */ -typedef enum _slcd_fault_detect_sample_window_width -{ - kSLCD_FaultDetectWindowWidth4SampleClk = 0U, /*!< Sample window width is 4 sample clock cycles. */ - kSLCD_FaultDetectWindowWidth8SampleClk, /*!< Sample window width is 8 sample clock cycles. */ - kSLCD_FaultDetectWindowWidth16SampleClk, /*!< Sample window width is 16 sample clock cycles. */ - kSLCD_FaultDetectWindowWidth32SampleClk, /*!< Sample window width is 32 sample clock cycles. */ - kSLCD_FaultDetectWindowWidth64SampleClk, /*!< Sample window width is 64 sample clock cycles. */ - kSLCD_FaultDetectWindowWidth128SampleClk, /*!< Sample window width is 128 sample clock cycles. */ - kSLCD_FaultDetectWindowWidth256SampleClk, /*!< Sample window width is 256 sample clock cycles. */ - kSLCD_FaultDetectWindowWidth512SampleClk /*!< Sample window width is 512 sample clock cycles. */ -} slcd_fault_detect_sample_window_width_t; - -/*! @brief SLCD interrupt source. */ -typedef enum _slcd_interrupt_enable -{ - kSLCD_FaultDetectCompleteInterrupt = 1U, /*!< SLCD fault detection complete interrupt source. */ -#if FSL_FEATURE_SLCD_HAS_FRAME_FREQUENCY_INTERRUPT - kSLCD_FrameFreqInterrupt = 2U /*!< SLCD frame frequency interrupt source. Not available in all low-power modes. */ -#endif /* FSL_FEATURE_SLCD_HAS_FRAME_FREQUENCY_INTERRUPT */ -} slcd_interrupt_enable_t; - -/*! @brief SLCD behavior in low power mode. */ -typedef enum _slcd_lowpower_behavior -{ - kSLCD_EnabledInWaitStop = 0, /*!< SLCD works in wait and stop mode. */ - kSLCD_EnabledInWaitOnly, /*!< SLCD works in wait mode and is disabled in stop mode. */ - kSLCD_EnabledInStopOnly, /*!< SLCD works in stop mode and is disabled in wait mode. */ - kSLCD_DisabledInWaitStop /*!< SLCD is disabled in stop mode and wait mode. */ -} slcd_lowpower_behavior; - -/*! @brief SLCD fault frame detection configuration structure. */ -typedef struct _slcd_fault_detect_config -{ - bool faultDetectIntEnable; /*!< Fault frame detection interrupt enable flag.*/ - bool faultDetectBackPlaneEnable; /*!< True means the pin id fault detected is back plane otherwise front plane. */ - uint8_t faultDetectPinIndex; /*!< Fault detected pin id from 0 to 63. */ - slcd_fault_detect_clock_prescaler_t faultPrescaler; /*!< Fault detect clock prescaler. */ - slcd_fault_detect_sample_window_width_t width; /*!< Fault detect sample window width. */ -} slcd_fault_detect_config_t; - -/*! @brief SLCD clock configuration structure. */ -typedef struct _slcd_clock_config -{ - slcd_clock_src_t clkSource; /*!< Clock source. "slcd_clock_src_t" is recommended to be used. - The SLCD is optimized to operate using a 32.768kHz clock input. */ - slcd_alt_clock_div_t - altClkDivider; /*!< The divider to divide the alternate clock used for alternate clock source. */ - slcd_clock_prescaler_t clkPrescaler; /*!< Clock prescaler. */ -#if FSL_FEATURE_SLCD_HAS_FAST_FRAME_RATE - bool fastFrameRateEnable; /*!< Fast frame rate enable flag. */ -#endif /* FSL_FEATURE_SLCD_HAS_FAST_FRAME_RATE */ -} slcd_clock_config_t; - -/*! @brief SLCD configuration structure. */ -typedef struct _slcd_config -{ - slcd_power_supply_option_t powerSupply; /*!< Power supply option. */ - slcd_regulated_voltage_trim_t voltageTrim; /*!< Regulated voltage trim used for the internal regulator VIREG to - adjust to facilitate contrast control. */ - slcd_clock_config_t *clkConfig; /*!< Clock configure. */ - slcd_display_mode_t displayMode; /*!< SLCD display mode. */ - slcd_load_adjust_t loadAdjust; /*!< Load adjust to handle glass capacitance. */ - slcd_duty_cycle_t dutyCycle; /*!< Duty cycle. */ - slcd_lowpower_behavior lowPowerBehavior; /*!< SLCD behavior in low power mode. */ -#if FSL_FEATURE_SLCD_HAS_FRAME_FREQUENCY_INTERRUPT - bool frameFreqIntEnable; /*!< Frame frequency interrupt enable flag.*/ -#endif /* FSL_FEATURE_SLCD_HAS_FAST_FRAME_RATE */ - uint32_t slcdLowPinEnabled; /*!< Setting enabled SLCD pin 0 ~ pin 31. Setting bit n to 1 means enable pin n. */ - uint32_t - slcdHighPinEnabled; /*!< Setting enabled SLCD pin 32 ~ pin 63. Setting bit n to 1 means enable pin (n + 32). */ - uint32_t backPlaneLowPin; /*!< Setting back plane pin 0 ~ pin 31. Setting bit n to 1 means setting pin n as back - plane. It should never have the same bit setting as the frontPlane Pin. */ - uint32_t backPlaneHighPin; /*!< Setting back plane pin 32 ~ pin 63. Setting bit n to 1 means setting pin (n + 32) as - back plane. It should never have the same bit setting as the frontPlane Pin. */ - slcd_fault_detect_config_t *faultConfig; /*!< Fault frame detection configure. If not requirement, set to NULL. */ -} slcd_config_t; -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus*/ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Initializes the SLCD, ungates the module clock, initializes the power - * setting, enables all used plane pins, and sets with interrupt and work mode - * with the configuration. - * - * @param base SLCD peripheral base address. - * @param configure SLCD configuration pointer. - * For the configuration structure, many parameters have the default setting - * and the SLCD_Getdefaultconfig() is provided to get them. Use it - * verified for their applications. - * The others have no default settings, such as "clkConfig", and must be provided - * by the application before calling the SLCD_Init() API. - */ -void SLCD_Init(LCD_Type *base, slcd_config_t *configure); - -/*! - * @brief Deinitializes the SLCD module, gates the module clock, disables an interrupt, - * and displays the SLCD. - * - * @param base SLCD peripheral base address. - */ -void SLCD_Deinit(LCD_Type *base); - -/*! - * @brief Gets the SLCD default configuration structure. The - * purpose of this API is to get default parameters of the configuration structure - * for the SLCD_Init(). Use these initialized parameters unchanged in SLCD_Init() - * or modify fields of the structure before the calling SLCD_Init(). - * All default parameters of the configure structuration are listed. - * @code - config.displayMode = kSLCD_NormalMode; - config.powerSupply = kSLCD_InternalVll3UseChargePump; - config.voltageTrim = kSLCD_RegulatedVolatgeTrim00; - config.lowPowerBehavior = kSLCD_EnabledInWaitStop; - config.interruptSrc = 0; - config.faultConfig = NULL; - config.frameFreqIntEnable = false; - @endcode - * @param configure The SLCD configuration structure pointer. - */ -void SLCD_GetDefaultConfig(slcd_config_t *configure); - -/*! @} */ - -/*! - * @name Plane Setting and Display Control - * @{ - */ - -/*! - * @brief Enables the SLCD controller, starts generation, and displays the front plane and back plane waveform. - * - * @param base SLCD peripheral base address. - */ -static inline void SLCD_StartDisplay(LCD_Type *base) -{ - base->GCR |= LCD_GCR_LCDEN_MASK; -} - -/*! - * @brief Stops the SLCD controller. There is no waveform generator and all enabled pins - * only output a low value. - * - * @param base SLCD peripheral base address. - */ -static inline void SLCD_StopDisplay(LCD_Type *base) -{ - base->GCR &= ~LCD_GCR_LCDEN_MASK; -} - -/*! - * @brief Starts the SLCD blink mode. - * - * @param base SLCD peripheral base address. - * @param mode SLCD blink mode. - * @param rate SLCD blink rate. - */ -void SLCD_StartBlinkMode(LCD_Type *base, slcd_blink_mode_t mode, slcd_blink_rate_t rate); - -/*! - * @brief Stops the SLCD blink mode. - * - * @param base SLCD peripheral base address. - */ -static inline void SLCD_StopBlinkMode(LCD_Type *base) -{ - base->AR &= ~LCD_AR_BLINK_MASK; -} - -/*! - * @brief Sets the SLCD back plane pin phase. - * - * This function sets the SLCD back plane pin phase. "kSLCD_PhaseXActivate" setting - * means the phase X is active for the back plane pin. "kSLCD_NoPhaseActivate" setting - * means there is no phase active for the back plane pin. - * For example, set the back plane pin 20 for phase A. - * @code - * SLCD_SetBackPlanePhase(LCD, 20, kSLCD_PhaseAActivate); - * @endcode - * - * @param base SLCD peripheral base address. - * @param pinIndx SLCD back plane pin index. Range from 0 to 63. - * @param phase The phase activates for the back plane pin. - */ -static inline void SLCD_SetBackPlanePhase(LCD_Type *base, uint32_t pinIndx, slcd_phase_type_t phase) -{ - base->WF8B[pinIndx] = (uint8_t)phase; -} - -/*! - * @brief Sets the SLCD front plane segment operation for a front plane pin. - * - * This function sets the SLCD front plane segment on or off operation. - * Each bit turns on or off the segments associated with the front plane pin in - * the following pattern: HGFEDCBA (most significant bit controls segment H and - * least significant bit controls segment A). - * For example, turn on the front plane pin 20 for phase B and phase C. - * @code - * SLCD_SetFrontPlaneSegments(LCD, 20, (kSLCD_PhaseBActivate | kSLCD_PhaseCActivate)); - * @endcode - * - * @param base SLCD peripheral base address. - * @param pinIndx SLCD back plane pin index. Range from 0 to 63. - * @param operation The operation for the segment on the front plane pin. - * This is a logical OR of the enumeration :: slcd_phase_type_t. - */ -static inline void SLCD_SetFrontPlaneSegments(LCD_Type *base, uint32_t pinIndx, uint8_t operation) -{ - base->WF8B[pinIndx] = operation; -} - -/*! - * @brief Sets one SLCD front plane pin for one phase. - * - * This function can be used to set one phase on or off for the front plane pin. - * It can be call many times to set the plane pin for different phase indexes. - * For example, turn on the front plane pin 20 for phase B and phase C. - * @code - * SLCD_SetFrontPlaneOnePhase(LCD, 20, kSLCD_PhaseBIndex, true); - * SLCD_SetFrontPlaneOnePhase(LCD, 20, kSLCD_PhaseCIndex, true); - * @endcode - * - * @param base SLCD peripheral base address. - * @param pinIndx SLCD back plane pin index. Range from 0 to 63. - * @param phaseIndx The phase bit index @ref slcd_phase_index_t. - * @param enable True to turn on the segment for phaseIndx phase - * false to turn off the segment for phaseIndx phase. - */ -static inline void SLCD_SetFrontPlaneOnePhase(LCD_Type *base, - uint32_t pinIndx, - slcd_phase_index_t phaseIndx, - bool enable) -{ - uint8_t reg = base->WF8B[pinIndx]; - - if (enable) - { - base->WF8B[pinIndx] = (reg | (1U << (uint32_t)phaseIndx)); - } - else - { - base->WF8B[pinIndx] = (reg & ~(1U << (uint32_t)phaseIndx)); - } -} - -#if FSL_FEATURE_SLCD_HAS_PAD_SAFE -/*! - * @brief Enables/disables the SLCD pad safe state. - * - * Forces the safe state on the LCD pad controls. All LCD front plane - * and backplane functions are disabled. - * - * @param base SLCD peripheral base address. - * @param enable True enable, false disable. - */ -static inline void SLCD_EnablePadSafeState(LCD_Type *base, bool enable) -{ - if (enable) - { /* Enable. */ - base->GCR |= LCD_GCR_PADSAFE_MASK; - } - else - { /* Disable. */ - base->GCR &= ~LCD_GCR_PADSAFE_MASK; - } -} -#endif /* FSL_FEATURE_SLCD_HAS_PAD_SAFE */ - -/*! - * @brief Gets the SLCD fault detect counter. - * - * This function gets the number of samples inside the - * fault detection sample window. - * - * @param base SLCD peripheral base address. - * @return The fault detect counter. The maximum return value is 255. - * If the maximum 255 returns, the overflow may happen. - * Reconfigure the fault detect sample window and fault detect clock prescaler - * for proper sampling. - */ -static inline uint32_t SLCD_GetFaultDetectCounter(LCD_Type *base) -{ - return base->FDSR & LCD_FDSR_FDCNT_MASK; -} - -/*! @} */ - -/*! - * @name Interrupts. - * @{ - */ - -/*! - * @brief Enables the SLCD interrupt. - * For example, to enable fault detect complete interrupt and frame frequency interrupt, - * for FSL_FEATURE_SLCD_HAS_FRAME_FREQUENCY_INTERRUPT enabled case, do the following. - * @code - * SLCD_EnableInterrupts(LCD,kSLCD_FaultDetectCompleteInterrupt | kSLCD_FrameFreqInterrupt); - * @endcode - * - * @param base SLCD peripheral base address. - * @param mask SLCD interrupts to enable. This is a logical OR of the - * enumeration :: slcd_interrupt_enable_t. - */ -void SLCD_EnableInterrupts(LCD_Type *base, uint32_t mask); - -/*! - * @brief Disables the SLCD interrupt. - * For example, to disable fault detect complete interrupt and frame frequency interrupt, - * for FSL_FEATURE_SLCD_HAS_FRAME_FREQUENCY_INTERRUPT enabled case, do the following. - * @code - * SLCD_DisableInterrupts(LCD,kSLCD_FaultDetectCompleteInterrupt | kSLCD_FrameFreqInterrupt); - * @endcode - * - * @param base SLCD peripheral base address. - * @param mask SLCD interrupts to disable. This is a logical OR of the - * enumeration :: slcd_interrupt_enable_t. - */ -void SLCD_DisableInterrupts(LCD_Type *base, uint32_t mask); - -/*! - * @brief Gets the SLCD interrupt status flag. - * - * @param base SLCD peripheral base address. - * @return The event status of the interrupt source. This is the logical OR of members - * of the enumeration :: slcd_interrupt_enable_t. - */ -uint32_t SLCD_GetInterruptStatus(LCD_Type *base); - -/*! - * @brief Clears the SLCD interrupt events status flag. - * - * @param base SLCD peripheral base address. - * @param mask SLCD interrupt source to be cleared. - * This is the logical OR of members of the enumeration :: slcd_interrupt_enable_t. - */ -void SLCD_ClearInterruptStatus(LCD_Type *base, uint32_t mask); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /* __cplusplus*/ - -/*! @}*/ - -#endif /* FSL_SLCD_H_*/ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_smc.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_smc.c deleted file mode 100644 index 9cda142f47f..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_smc.c +++ /dev/null @@ -1,517 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_smc.h" -#include "fsl_common.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.smc" -#endif - -#if (defined(FSL_FEATURE_SMC_REG_WIDTH) && (FSL_FEATURE_SMC_REG_WIDTH == 32U)) -typedef uint32_t smc_reg_t; -#else -typedef uint8_t smc_reg_t; -#endif - -typedef void (*smc_stop_ram_func_t)(void); - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -static void SMC_EnterStopRamFunc(void); - -/******************************************************************************* - * Variables - ******************************************************************************/ -static uint32_t g_savedPrimask; - -/* - * The ram function code is: - * - * uint32_t i; - * for (i=0; i<0x8; i++) - * { - * __NOP(); - * } - * __DSB(); - * __WFI(); - * __ISB(); - * - * When entring the stop modes, the flash prefetch might be interrupted, thus - * the prefetched code or data might be broken. To make sure the flash is idle - * when entring the stop modes, the code is moved to ram. And delay for a while - * before WFI to make sure previous flash prefetch is finished. - * - * Only need to do like this when code is in flash, if code is in rom or ram, - * this is not necessary. - */ -static uint16_t s_stopRamFuncArray[] = { - 0x2000, /* MOVS R0, #0 */ - 0x2808, /* CMP R0, #8 */ - 0xD202, /* BCS.N */ - 0xBF00, /* NOP */ - 0x1C40, /* ADDS R0, R0, #1 */ - 0xE7FA, /* B.N */ - 0xF3BF, 0x8F4F, /* DSB */ - 0xBF30, /* WFI */ - 0xF3BF, 0x8F6F, /* ISB */ - 0x4770, /* BX LR */ -}; - -/******************************************************************************* - * Code - ******************************************************************************/ -static void SMC_EnterStopRamFunc(void) -{ - uint32_t ramFuncEntry = ((uint32_t)(s_stopRamFuncArray)) + 1U; - smc_stop_ram_func_t stopRamFunc = (smc_stop_ram_func_t)ramFuncEntry; - stopRamFunc(); -} - -#if (defined(FSL_FEATURE_SMC_HAS_PARAM) && FSL_FEATURE_SMC_HAS_PARAM) -/*! - * brief Gets the SMC parameter. - * - * This function gets the SMC parameter including the enabled power mdoes. - * - * param base SMC peripheral base address. - * param param Pointer to the SMC param structure. - */ -void SMC_GetParam(SMC_Type *base, smc_param_t *param) -{ - uint32_t reg = base->PARAM; - param->hsrunEnable = (bool)(reg & SMC_PARAM_EHSRUN_MASK); - param->llsEnable = (bool)(reg & SMC_PARAM_ELLS_MASK); - param->lls2Enable = (bool)(reg & SMC_PARAM_ELLS2_MASK); - param->vlls0Enable = (bool)(reg & SMC_PARAM_EVLLS0_MASK); -} -#endif /* FSL_FEATURE_SMC_HAS_PARAM */ - -/*! - * brief Prepares to enter stop modes. - * - * This function should be called before entering STOP/VLPS/LLS/VLLS modes. - */ -void SMC_PreEnterStopModes(void) -{ - g_savedPrimask = DisableGlobalIRQ(); - __ISB(); -} - -/*! - * brief Recovers after wake up from stop modes. - * - * This function should be called after wake up from STOP/VLPS/LLS/VLLS modes. - * It is used with ref SMC_PreEnterStopModes. - */ -void SMC_PostExitStopModes(void) -{ - EnableGlobalIRQ(g_savedPrimask); - __ISB(); -} - -/*! - * brief Prepares to enter wait modes. - * - * This function should be called before entering WAIT/VLPW modes. - */ -void SMC_PreEnterWaitModes(void) -{ - g_savedPrimask = DisableGlobalIRQ(); - __ISB(); -} - -/*! - * brief Recovers after wake up from stop modes. - * - * This function should be called after wake up from WAIT/VLPW modes. - * It is used with ref SMC_PreEnterWaitModes. - */ -void SMC_PostExitWaitModes(void) -{ - EnableGlobalIRQ(g_savedPrimask); - __ISB(); -} - -/*! - * brief Configures the system to RUN power mode. - * - * param base SMC peripheral base address. - * return SMC configuration error code. - */ -status_t SMC_SetPowerModeRun(SMC_Type *base) -{ - smc_reg_t reg; - - reg = base->PMCTRL; - /* configure Normal RUN mode */ - reg &= ~(smc_reg_t)SMC_PMCTRL_RUNM_MASK; - reg |= ((smc_reg_t)kSMC_RunNormal << SMC_PMCTRL_RUNM_SHIFT); - base->PMCTRL = reg; - - return kStatus_Success; -} - -#if (defined(FSL_FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE) && FSL_FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE) -/*! - * brief Configures the system to HSRUN power mode. - * - * param base SMC peripheral base address. - * return SMC configuration error code. - */ -status_t SMC_SetPowerModeHsrun(SMC_Type *base) -{ - smc_reg_t reg; - - reg = (base->PMCTRL); - /* configure High Speed RUN mode */ - reg &= ~(smc_reg_t)SMC_PMCTRL_RUNM_MASK; - reg |= ((smc_reg_t)kSMC_Hsrun << SMC_PMCTRL_RUNM_SHIFT); - base->PMCTRL = reg; - - return kStatus_Success; -} -#endif /* FSL_FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE */ - -/*! - * brief Configures the system to WAIT power mode. - * - * param base SMC peripheral base address. - * return SMC configuration error code. - */ -status_t SMC_SetPowerModeWait(SMC_Type *base) -{ - /* configure Normal Wait mode */ - SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk; - __DSB(); - __WFI(); - __ISB(); - - return kStatus_Success; -} - -/*! - * brief Configures the system to Stop power mode. - * - * param base SMC peripheral base address. - * param option Partial Stop mode option. - * return SMC configuration error code. - */ -status_t SMC_SetPowerModeStop(SMC_Type *base, smc_partial_stop_option_t option) -{ - smc_reg_t reg; - -#if (defined(FSL_FEATURE_SMC_HAS_PSTOPO) && FSL_FEATURE_SMC_HAS_PSTOPO) - /* configure the Partial Stop mode in Normal Stop mode */ - reg = base->STOPCTRL; - reg &= ~(smc_reg_t)SMC_STOPCTRL_PSTOPO_MASK; - reg |= ((smc_reg_t)option << SMC_STOPCTRL_PSTOPO_SHIFT); - base->STOPCTRL = reg; -#endif - - /* configure Normal Stop mode */ - reg = base->PMCTRL; - reg &= ~(smc_reg_t)SMC_PMCTRL_STOPM_MASK; - reg |= ((smc_reg_t)kSMC_StopNormal << SMC_PMCTRL_STOPM_SHIFT); - base->PMCTRL = reg; - - /* Set the SLEEPDEEP bit to enable deep sleep mode (stop mode) */ - SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; - - /* read back to make sure the configuration valid before enter stop mode */ - (void)base->PMCTRL; - SMC_EnterStopRamFunc(); - - /* check whether the power mode enter Stop mode succeed */ - if (0U != (base->PMCTRL & SMC_PMCTRL_STOPA_MASK)) - { - return kStatus_SMC_StopAbort; - } - else - { - return kStatus_Success; - } -} - -/*! - * brief Configures the system to VLPR power mode. - * - * param base SMC peripheral base address. - * return SMC configuration error code. - */ -status_t SMC_SetPowerModeVlpr(SMC_Type *base -#if (defined(FSL_FEATURE_SMC_HAS_LPWUI) && FSL_FEATURE_SMC_HAS_LPWUI) - , - bool wakeupMode -#endif -) -{ - smc_reg_t reg; - - reg = (smc_reg_t)(base->PMCTRL); -#if (defined(FSL_FEATURE_SMC_HAS_LPWUI) && FSL_FEATURE_SMC_HAS_LPWUI) - /* configure whether the system remains in VLP mode on an interrupt */ - if (wakeupMode) - { - /* exits to RUN mode on an interrupt */ - reg |= SMC_PMCTRL_LPWUI_MASK; - } - else - { - /* remains in VLP mode on an interrupt */ - reg &= ~(smc_reg_t)SMC_PMCTRL_LPWUI_MASK; - } -#endif /* FSL_FEATURE_SMC_HAS_LPWUI */ - - /* configure VLPR mode */ - reg &= ~(smc_reg_t)SMC_PMCTRL_RUNM_MASK; - reg |= ((smc_reg_t)kSMC_RunVlpr << SMC_PMCTRL_RUNM_SHIFT); - base->PMCTRL = reg; - - return kStatus_Success; -} - -/*! - * brief Configures the system to VLPW power mode. - * - * param base SMC peripheral base address. - * return SMC configuration error code. - */ -status_t SMC_SetPowerModeVlpw(SMC_Type *base) -{ - /* configure VLPW mode */ - /* Set the SLEEPDEEP bit to enable deep sleep mode */ - SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk; - __DSB(); - __WFI(); - __ISB(); - - return kStatus_Success; -} - -/*! - * brief Configures the system to VLPS power mode. - * - * param base SMC peripheral base address. - * return SMC configuration error code. - */ -status_t SMC_SetPowerModeVlps(SMC_Type *base) -{ - smc_reg_t reg; - - /* configure VLPS mode */ - reg = base->PMCTRL; - reg &= ~(smc_reg_t)SMC_PMCTRL_STOPM_MASK; - reg |= ((smc_reg_t)kSMC_StopVlps << SMC_PMCTRL_STOPM_SHIFT); - base->PMCTRL = reg; - - /* Set the SLEEPDEEP bit to enable deep sleep mode */ - SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; - - /* read back to make sure the configuration valid before enter stop mode */ - (void)base->PMCTRL; - SMC_EnterStopRamFunc(); - - /* check whether the power mode enter VLPS mode succeed */ - if (0U != (base->PMCTRL & SMC_PMCTRL_STOPA_MASK)) - { - return kStatus_SMC_StopAbort; - } - else - { - return kStatus_Success; - } -} - -#if (defined(FSL_FEATURE_SMC_HAS_LOW_LEAKAGE_STOP_MODE) && FSL_FEATURE_SMC_HAS_LOW_LEAKAGE_STOP_MODE) -/*! - * brief Configures the system to LLS power mode. - * - * param base SMC peripheral base address. - * return SMC configuration error code. - */ -status_t SMC_SetPowerModeLls(SMC_Type *base -#if ((defined(FSL_FEATURE_SMC_HAS_LLS_SUBMODE) && FSL_FEATURE_SMC_HAS_LLS_SUBMODE) || \ - (defined(FSL_FEATURE_SMC_HAS_LPOPO) && FSL_FEATURE_SMC_HAS_LPOPO)) - , - const smc_power_mode_lls_config_t *config -#endif -) -{ - smc_reg_t reg; - - /* configure to LLS mode */ - reg = base->PMCTRL; - reg &= ~(smc_reg_t)SMC_PMCTRL_STOPM_MASK; - reg |= ((smc_reg_t)kSMC_StopLls << SMC_PMCTRL_STOPM_SHIFT); - base->PMCTRL = reg; - -/* configure LLS sub-mode*/ -#if (defined(FSL_FEATURE_SMC_HAS_LLS_SUBMODE) && FSL_FEATURE_SMC_HAS_LLS_SUBMODE) - reg = base->STOPCTRL; - reg &= ~(smc_reg_t)SMC_STOPCTRL_LLSM_MASK; - reg |= ((smc_reg_t)config->subMode << SMC_STOPCTRL_LLSM_SHIFT); - base->STOPCTRL = reg; -#endif /* FSL_FEATURE_SMC_HAS_LLS_SUBMODE */ - -#if (defined(FSL_FEATURE_SMC_HAS_LPOPO) && FSL_FEATURE_SMC_HAS_LPOPO) - if (config->enableLpoClock) - { - base->STOPCTRL &= ~(smc_reg_t)SMC_STOPCTRL_LPOPO_MASK; - } - else - { - base->STOPCTRL |= (smc_reg_t)SMC_STOPCTRL_LPOPO_MASK; - } -#endif /* FSL_FEATURE_SMC_HAS_LPOPO */ - - /* Set the SLEEPDEEP bit to enable deep sleep mode */ - SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; - - /* read back to make sure the configuration valid before enter stop mode */ - (void)base->PMCTRL; - SMC_EnterStopRamFunc(); - - /* check whether the power mode enter LLS mode succeed */ - if (0U != (base->PMCTRL & SMC_PMCTRL_STOPA_MASK)) - { - return kStatus_SMC_StopAbort; - } - else - { - return kStatus_Success; - } -} -#endif /* FSL_FEATURE_SMC_HAS_LOW_LEAKAGE_STOP_MODE */ - -#if (defined(FSL_FEATURE_SMC_HAS_VERY_LOW_LEAKAGE_STOP_MODE) && FSL_FEATURE_SMC_HAS_VERY_LOW_LEAKAGE_STOP_MODE) -/*! - * brief Configures the system to VLLS power mode. - * - * param base SMC peripheral base address. - * param config The VLLS power mode configuration structure. - * return SMC configuration error code. - */ -status_t SMC_SetPowerModeVlls(SMC_Type *base, const smc_power_mode_vlls_config_t *config) -{ - smc_reg_t reg; - -#if (defined(FSL_FEATURE_SMC_HAS_PORPO) && FSL_FEATURE_SMC_HAS_PORPO) -#if (defined(FSL_FEATURE_SMC_USE_VLLSCTRL_REG) && FSL_FEATURE_SMC_USE_VLLSCTRL_REG) || \ - (defined(FSL_FEATURE_SMC_USE_STOPCTRL_VLLSM) && FSL_FEATURE_SMC_USE_STOPCTRL_VLLSM) || \ - (defined(FSL_FEATURE_SMC_HAS_LLS_SUBMODE) && FSL_FEATURE_SMC_HAS_LLS_SUBMODE) - if (config->subMode == kSMC_StopSub0) -#endif - { - /* configure whether the Por Detect work in Vlls0 mode */ - if (true == config->enablePorDetectInVlls0) - { -#if (defined(FSL_FEATURE_SMC_USE_VLLSCTRL_REG) && FSL_FEATURE_SMC_USE_VLLSCTRL_REG) - base->VLLSCTRL &= ~(smc_reg_t)SMC_VLLSCTRL_PORPO_MASK; -#else - base->STOPCTRL &= ~(smc_reg_t)SMC_STOPCTRL_PORPO_MASK; -#endif - } - else - { -#if (defined(FSL_FEATURE_SMC_USE_VLLSCTRL_REG) && FSL_FEATURE_SMC_USE_VLLSCTRL_REG) - base->VLLSCTRL |= SMC_VLLSCTRL_PORPO_MASK; -#else - base->STOPCTRL |= SMC_STOPCTRL_PORPO_MASK; -#endif - } - } -#endif /* FSL_FEATURE_SMC_HAS_PORPO */ - -#if (defined(FSL_FEATURE_SMC_HAS_RAM2_POWER_OPTION) && FSL_FEATURE_SMC_HAS_RAM2_POWER_OPTION) - else if (config->subMode == kSMC_StopSub2) - { - /* configure whether the Por Detect work in Vlls0 mode */ - if (true == config->enableRam2InVlls2) - { -#if (defined(FSL_FEATURE_SMC_USE_VLLSCTRL_REG) && FSL_FEATURE_SMC_USE_VLLSCTRL_REG) - base->VLLSCTRL |= SMC_VLLSCTRL_RAM2PO_MASK; -#else - base->STOPCTRL |= SMC_STOPCTRL_RAM2PO_MASK; -#endif - } - else - { -#if (defined(FSL_FEATURE_SMC_USE_VLLSCTRL_REG) && FSL_FEATURE_SMC_USE_VLLSCTRL_REG) - base->VLLSCTRL &= ~SMC_VLLSCTRL_RAM2PO_MASK; -#else - base->STOPCTRL &= ~(smc_reg_t)SMC_STOPCTRL_RAM2PO_MASK; -#endif - } - } - else - { - /* Add this to fix MISRA C2012 rule15.7 issue: Empty else without comment. */ - } -#endif /* FSL_FEATURE_SMC_HAS_RAM2_POWER_OPTION */ - - /* configure to VLLS mode */ - reg = base->PMCTRL; - reg &= ~(smc_reg_t)SMC_PMCTRL_STOPM_MASK; - reg |= ((smc_reg_t)kSMC_StopVlls << SMC_PMCTRL_STOPM_SHIFT); - base->PMCTRL = reg; - -/* configure the VLLS sub-mode */ -#if (defined(FSL_FEATURE_SMC_USE_VLLSCTRL_REG) && FSL_FEATURE_SMC_USE_VLLSCTRL_REG) - reg = base->VLLSCTRL; - reg &= ~(smc_reg_t)SMC_VLLSCTRL_VLLSM_MASK; - reg |= ((smc_reg_t)config->subMode << SMC_VLLSCTRL_VLLSM_SHIFT); - base->VLLSCTRL = reg; -#else -#if (defined(FSL_FEATURE_SMC_HAS_LLS_SUBMODE) && FSL_FEATURE_SMC_HAS_LLS_SUBMODE) - reg = base->STOPCTRL; - reg &= ~(smc_reg_t)SMC_STOPCTRL_LLSM_MASK; - reg |= ((smc_reg_t)config->subMode << SMC_STOPCTRL_LLSM_SHIFT); - base->STOPCTRL = reg; -#else - reg = base->STOPCTRL; - reg &= ~(smc_reg_t)SMC_STOPCTRL_VLLSM_MASK; - reg |= ((smc_reg_t)config->subMode << SMC_STOPCTRL_VLLSM_SHIFT); - base->STOPCTRL = reg; -#endif /* FSL_FEATURE_SMC_HAS_LLS_SUBMODE */ -#endif - -#if (defined(FSL_FEATURE_SMC_HAS_LPOPO) && FSL_FEATURE_SMC_HAS_LPOPO) - if (config->enableLpoClock) - { - base->STOPCTRL &= ~(smc_reg_t)SMC_STOPCTRL_LPOPO_MASK; - } - else - { - base->STOPCTRL |= SMC_STOPCTRL_LPOPO_MASK; - } -#endif /* FSL_FEATURE_SMC_HAS_LPOPO */ - - /* Set the SLEEPDEEP bit to enable deep sleep mode */ - SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; - - /* read back to make sure the configuration valid before enter stop mode */ - (void)base->PMCTRL; - SMC_EnterStopRamFunc(); - - /* check whether the power mode enter LLS mode succeed */ - if (0U != (base->PMCTRL & SMC_PMCTRL_STOPA_MASK)) - { - return kStatus_SMC_StopAbort; - } - else - { - return kStatus_Success; - } -} -#endif /* FSL_FEATURE_SMC_HAS_VERY_LOW_LEAKAGE_STOP_MODE */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_smc.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_smc.h deleted file mode 100644 index f90b549dde9..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_smc.h +++ /dev/null @@ -1,421 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2017, 2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_SMC_H_ -#define FSL_SMC_H_ - -#include "fsl_common.h" - -/*! @addtogroup smc */ -/*! @{ */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief SMC driver version */ -#define FSL_SMC_DRIVER_VERSION (MAKE_VERSION(2, 0, 7)) -/*! @} */ - -/*! - * @brief Power Modes Protection - */ -typedef enum _smc_power_mode_protection -{ -#if (defined(FSL_FEATURE_SMC_HAS_VERY_LOW_LEAKAGE_STOP_MODE) && FSL_FEATURE_SMC_HAS_VERY_LOW_LEAKAGE_STOP_MODE) - kSMC_AllowPowerModeVlls = SMC_PMPROT_AVLLS_MASK, /*!< Allow Very-low-leakage Stop Mode. */ -#endif -#if (defined(FSL_FEATURE_SMC_HAS_LOW_LEAKAGE_STOP_MODE) && FSL_FEATURE_SMC_HAS_LOW_LEAKAGE_STOP_MODE) - kSMC_AllowPowerModeLls = SMC_PMPROT_ALLS_MASK, /*!< Allow Low-leakage Stop Mode. */ -#endif /* FSL_FEATURE_SMC_HAS_LOW_LEAKAGE_STOP_MODE */ - kSMC_AllowPowerModeVlp = SMC_PMPROT_AVLP_MASK, /*!< Allow Very-Low-power Mode. */ -#if (defined(FSL_FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE) && FSL_FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE) - kSMC_AllowPowerModeHsrun = SMC_PMPROT_AHSRUN_MASK, /*!< Allow High-speed Run mode. */ -#endif /* FSL_FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE */ - kSMC_AllowPowerModeAll = (0U -#if (defined(FSL_FEATURE_SMC_HAS_VERY_LOW_LEAKAGE_STOP_MODE) && FSL_FEATURE_SMC_HAS_VERY_LOW_LEAKAGE_STOP_MODE) - | SMC_PMPROT_AVLLS_MASK -#endif -#if (defined(FSL_FEATURE_SMC_HAS_LOW_LEAKAGE_STOP_MODE) && FSL_FEATURE_SMC_HAS_LOW_LEAKAGE_STOP_MODE) - | SMC_PMPROT_ALLS_MASK -#endif /* FSL_FEATURE_SMC_HAS_LOW_LEAKAGE_STOP_MODE */ - | SMC_PMPROT_AVLP_MASK -#if (defined(FSL_FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE) && FSL_FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE) - | kSMC_AllowPowerModeHsrun -#endif /* FSL_FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE */ - ) /*!< Allow all power mode. */ -} smc_power_mode_protection_t; - -/*! - * @brief Power Modes in PMSTAT - */ -typedef enum _smc_power_state -{ - kSMC_PowerStateRun = 0x01U << 0U, /*!< 0000_0001 - Current power mode is RUN */ - kSMC_PowerStateStop = 0x01U << 1U, /*!< 0000_0010 - Current power mode is STOP */ - kSMC_PowerStateVlpr = 0x01U << 2U, /*!< 0000_0100 - Current power mode is VLPR */ - kSMC_PowerStateVlpw = 0x01U << 3U, /*!< 0000_1000 - Current power mode is VLPW */ - kSMC_PowerStateVlps = 0x01U << 4U, /*!< 0001_0000 - Current power mode is VLPS */ -#if (defined(FSL_FEATURE_SMC_HAS_LOW_LEAKAGE_STOP_MODE) && FSL_FEATURE_SMC_HAS_LOW_LEAKAGE_STOP_MODE) - kSMC_PowerStateLls = 0x01U << 5U, /*!< 0010_0000 - Current power mode is LLS */ -#endif /* FSL_FEATURE_SMC_HAS_LOW_LEAKAGE_STOP_MODE */ -#if (defined(FSL_FEATURE_SMC_HAS_VERY_LOW_LEAKAGE_STOP_MODE) && FSL_FEATURE_SMC_HAS_VERY_LOW_LEAKAGE_STOP_MODE) - kSMC_PowerStateVlls = 0x01U << 6U, /*!< 0100_0000 - Current power mode is VLLS */ -#endif -#if (defined(FSL_FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE) && FSL_FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE) - kSMC_PowerStateHsrun = 0x01U << 7U /*!< 1000_0000 - Current power mode is HSRUN */ -#endif /* FSL_FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE */ -} smc_power_state_t; - -/*! - * @brief Run mode definition - */ -typedef enum _smc_run_mode -{ - kSMC_RunNormal = 0U, /*!< Normal RUN mode. */ - kSMC_RunVlpr = 2U, /*!< Very-low-power RUN mode. */ -#if (defined(FSL_FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE) && FSL_FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE) - kSMC_Hsrun = 3U /*!< High-speed Run mode (HSRUN). */ -#endif /* FSL_FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE */ -} smc_run_mode_t; - -/*! - * @brief Stop mode definition - */ -typedef enum _smc_stop_mode -{ - kSMC_StopNormal = 0U, /*!< Normal STOP mode. */ - kSMC_StopVlps = 2U, /*!< Very-low-power STOP mode. */ -#if (defined(FSL_FEATURE_SMC_HAS_LOW_LEAKAGE_STOP_MODE) && FSL_FEATURE_SMC_HAS_LOW_LEAKAGE_STOP_MODE) - kSMC_StopLls = 3U, /*!< Low-leakage Stop mode. */ -#endif /* FSL_FEATURE_SMC_HAS_LOW_LEAKAGE_STOP_MODE */ -#if (defined(FSL_FEATURE_SMC_HAS_VERY_LOW_LEAKAGE_STOP_MODE) && FSL_FEATURE_SMC_HAS_VERY_LOW_LEAKAGE_STOP_MODE) - kSMC_StopVlls = 4U /*!< Very-low-leakage Stop mode. */ -#endif -} smc_stop_mode_t; - -#if (defined(FSL_FEATURE_SMC_USE_VLLSCTRL_REG) && FSL_FEATURE_SMC_USE_VLLSCTRL_REG) || \ - (defined(FSL_FEATURE_SMC_USE_STOPCTRL_VLLSM) && FSL_FEATURE_SMC_USE_STOPCTRL_VLLSM) || \ - (defined(FSL_FEATURE_SMC_HAS_LLS_SUBMODE) && FSL_FEATURE_SMC_HAS_LLS_SUBMODE) -/*! - * @brief VLLS/LLS stop sub mode definition - */ -typedef enum _smc_stop_submode -{ - kSMC_StopSub0 = 0U, /*!< Stop submode 0, for VLLS0/LLS0. */ - kSMC_StopSub1 = 1U, /*!< Stop submode 1, for VLLS1/LLS1. */ - kSMC_StopSub2 = 2U, /*!< Stop submode 2, for VLLS2/LLS2. */ - kSMC_StopSub3 = 3U /*!< Stop submode 3, for VLLS3/LLS3. */ -} smc_stop_submode_t; -#endif - -/*! - * @brief Partial STOP option - */ -typedef enum _smc_partial_stop_mode -{ - kSMC_PartialStop = 0U, /*!< STOP - Normal Stop mode*/ - kSMC_PartialStop1 = 1U, /*!< Partial Stop with both system and bus clocks disabled*/ - kSMC_PartialStop2 = 2U, /*!< Partial Stop with system clock disabled and bus clock enabled*/ -} smc_partial_stop_option_t; - -/*! - * @brief _smc_status, SMC configuration status. - */ -enum -{ - kStatus_SMC_StopAbort = MAKE_STATUS(kStatusGroup_POWER, 0) /*!< Entering Stop mode is abort*/ -}; - -#if (defined(FSL_FEATURE_SMC_HAS_VERID) && FSL_FEATURE_SMC_HAS_VERID) -/*! - * @brief IP version ID definition. - */ -typedef struct _smc_version_id -{ - uint16_t feature; /*!< Feature Specification Number. */ - uint8_t minor; /*!< Minor version number. */ - uint8_t major; /*!< Major version number. */ -} smc_version_id_t; -#endif /* FSL_FEATURE_SMC_HAS_VERID */ - -#if (defined(FSL_FEATURE_SMC_HAS_PARAM) && FSL_FEATURE_SMC_HAS_PARAM) -/*! - * @brief IP parameter definition. - */ -typedef struct _smc_param -{ - bool hsrunEnable; /*!< HSRUN mode enable. */ - bool llsEnable; /*!< LLS mode enable. */ - bool lls2Enable; /*!< LLS2 mode enable. */ - bool vlls0Enable; /*!< VLLS0 mode enable. */ -} smc_param_t; -#endif /* FSL_FEATURE_SMC_HAS_PARAM */ - -#if (defined(FSL_FEATURE_SMC_HAS_LLS_SUBMODE) && FSL_FEATURE_SMC_HAS_LLS_SUBMODE) || \ - (defined(FSL_FEATURE_SMC_HAS_LPOPO) && FSL_FEATURE_SMC_HAS_LPOPO) -/*! - * @brief SMC Low-Leakage Stop power mode configuration. - */ -typedef struct _smc_power_mode_lls_config -{ -#if (defined(FSL_FEATURE_SMC_HAS_LLS_SUBMODE) && FSL_FEATURE_SMC_HAS_LLS_SUBMODE) - smc_stop_submode_t subMode; /*!< Low-leakage Stop sub-mode */ -#endif -#if (defined(FSL_FEATURE_SMC_HAS_LPOPO) && FSL_FEATURE_SMC_HAS_LPOPO) - bool enableLpoClock; /*!< Enable LPO clock in LLS mode */ -#endif -} smc_power_mode_lls_config_t; -#endif /* (FSL_FEATURE_SMC_HAS_LLS_SUBMODE || FSL_FEATURE_SMC_HAS_LPOPO) */ - -#if (defined(FSL_FEATURE_SMC_HAS_VERY_LOW_LEAKAGE_STOP_MODE) && FSL_FEATURE_SMC_HAS_VERY_LOW_LEAKAGE_STOP_MODE) -/*! - * @brief SMC Very Low-Leakage Stop power mode configuration. - */ -typedef struct _smc_power_mode_vlls_config -{ -#if (defined(FSL_FEATURE_SMC_USE_VLLSCTRL_REG) && FSL_FEATURE_SMC_USE_VLLSCTRL_REG) || \ - (defined(FSL_FEATURE_SMC_USE_STOPCTRL_VLLSM) && FSL_FEATURE_SMC_USE_STOPCTRL_VLLSM) || \ - (defined(FSL_FEATURE_SMC_HAS_LLS_SUBMODE) && FSL_FEATURE_SMC_HAS_LLS_SUBMODE) - smc_stop_submode_t subMode; /*!< Very Low-leakage Stop sub-mode */ -#endif -#if (defined(FSL_FEATURE_SMC_HAS_PORPO) && FSL_FEATURE_SMC_HAS_PORPO) - bool enablePorDetectInVlls0; /*!< Enable Power on reset detect in VLLS mode */ -#endif -#if (defined(FSL_FEATURE_SMC_HAS_RAM2_POWER_OPTION) && FSL_FEATURE_SMC_HAS_RAM2_POWER_OPTION) - bool enableRam2InVlls2; /*!< Enable RAM2 power in VLLS2 */ -#endif -#if (defined(FSL_FEATURE_SMC_HAS_LPOPO) && FSL_FEATURE_SMC_HAS_LPOPO) - bool enableLpoClock; /*!< Enable LPO clock in VLLS mode */ -#endif -} smc_power_mode_vlls_config_t; -#endif - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! @name System mode controller APIs*/ -/*! @{ */ - -#if (defined(FSL_FEATURE_SMC_HAS_VERID) && FSL_FEATURE_SMC_HAS_VERID) -/*! - * @brief Gets the SMC version ID. - * - * This function gets the SMC version ID, including major version number, - * minor version number, and feature specification number. - * - * @param base SMC peripheral base address. - * @param versionId Pointer to the version ID structure. - */ -static inline void SMC_GetVersionId(SMC_Type *base, smc_version_id_t *versionId) -{ - *((uint32_t *)(uint32_t)versionId) = base->VERID; -} -#endif /* FSL_FEATURE_SMC_HAS_VERID */ - -#if (defined(FSL_FEATURE_SMC_HAS_PARAM) && FSL_FEATURE_SMC_HAS_PARAM) -/*! - * @brief Gets the SMC parameter. - * - * This function gets the SMC parameter including the enabled power mdoes. - * - * @param base SMC peripheral base address. - * @param param Pointer to the SMC param structure. - */ -void SMC_GetParam(SMC_Type *base, smc_param_t *param); -#endif - -/*! - * @brief Configures all power mode protection settings. - * - * This function configures the power mode protection settings for - * supported power modes in the specified chip family. The available power modes - * are defined in the smc_power_mode_protection_t. This should be done at an early - * system level initialization stage. See the reference manual for details. - * This register can only write once after the power reset. - * - * The allowed modes are passed as bit map. For example, to allow LLS and VLLS, - * use SMC_SetPowerModeProtection(kSMC_AllowPowerModeVlls | kSMC_AllowPowerModeVlps). - * To allow all modes, use SMC_SetPowerModeProtection(kSMC_AllowPowerModeAll). - * - * @param base SMC peripheral base address. - * @param allowedModes Bitmap of the allowed power modes. - */ -static inline void SMC_SetPowerModeProtection(SMC_Type *base, uint8_t allowedModes) -{ - base->PMPROT = allowedModes; -} - -/*! - * @brief Gets the current power mode status. - * - * This function returns the current power mode status. After the application - * switches the power mode, it should always check the status to check whether it - * runs into the specified mode or not. The application should check - * this mode before switching to a different mode. The system requires that - * only certain modes can switch to other specific modes. See the - * reference manual for details and the smc_power_state_t for information about - * the power status. - * - * @param base SMC peripheral base address. - * @return Current power mode status. - */ -static inline smc_power_state_t SMC_GetPowerModeState(SMC_Type *base) -{ - return (smc_power_state_t)base->PMSTAT; -} - -/*! - * @brief Prepares to enter stop modes. - * - * This function should be called before entering STOP/VLPS/LLS/VLLS modes. - */ -void SMC_PreEnterStopModes(void); - -/*! - * @brief Recovers after wake up from stop modes. - * - * This function should be called after wake up from STOP/VLPS/LLS/VLLS modes. - * It is used with @ref SMC_PreEnterStopModes. - */ -void SMC_PostExitStopModes(void); - -/*! - * @brief Prepares to enter wait modes. - * - * This function should be called before entering WAIT/VLPW modes. - */ -void SMC_PreEnterWaitModes(void); - -/*! - * @brief Recovers after wake up from stop modes. - * - * This function should be called after wake up from WAIT/VLPW modes. - * It is used with @ref SMC_PreEnterWaitModes. - */ -void SMC_PostExitWaitModes(void); - -/*! - * @brief Configures the system to RUN power mode. - * - * @param base SMC peripheral base address. - * @return SMC configuration error code. - */ -status_t SMC_SetPowerModeRun(SMC_Type *base); - -#if (defined(FSL_FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE) && FSL_FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE) -/*! - * @brief Configures the system to HSRUN power mode. - * - * @param base SMC peripheral base address. - * @return SMC configuration error code. - */ -status_t SMC_SetPowerModeHsrun(SMC_Type *base); -#endif /* FSL_FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE */ - -/*! - * @brief Configures the system to WAIT power mode. - * - * @param base SMC peripheral base address. - * @return SMC configuration error code. - */ -status_t SMC_SetPowerModeWait(SMC_Type *base); - -/*! - * @brief Configures the system to Stop power mode. - * - * @param base SMC peripheral base address. - * @param option Partial Stop mode option. - * @return SMC configuration error code. - */ -status_t SMC_SetPowerModeStop(SMC_Type *base, smc_partial_stop_option_t option); - -#if (defined(FSL_FEATURE_SMC_HAS_LPWUI) && FSL_FEATURE_SMC_HAS_LPWUI) -/*! - * @brief Configures the system to VLPR power mode. - * - * @param base SMC peripheral base address. - * @param wakeupMode Enter Normal Run mode if true, else stay in VLPR mode. - * @return SMC configuration error code. - */ -status_t SMC_SetPowerModeVlpr(SMC_Type *base, bool wakeupMode); -#else -/*! - * @brief Configures the system to VLPR power mode. - * - * @param base SMC peripheral base address. - * @return SMC configuration error code. - */ -status_t SMC_SetPowerModeVlpr(SMC_Type *base); -#endif /* FSL_FEATURE_SMC_HAS_LPWUI */ - -/*! - * @brief Configures the system to VLPW power mode. - * - * @param base SMC peripheral base address. - * @return SMC configuration error code. - */ -status_t SMC_SetPowerModeVlpw(SMC_Type *base); - -/*! - * @brief Configures the system to VLPS power mode. - * - * @param base SMC peripheral base address. - * @return SMC configuration error code. - */ -status_t SMC_SetPowerModeVlps(SMC_Type *base); - -#if (defined(FSL_FEATURE_SMC_HAS_LOW_LEAKAGE_STOP_MODE) && FSL_FEATURE_SMC_HAS_LOW_LEAKAGE_STOP_MODE) -#if ((defined(FSL_FEATURE_SMC_HAS_LLS_SUBMODE) && FSL_FEATURE_SMC_HAS_LLS_SUBMODE) || \ - (defined(FSL_FEATURE_SMC_HAS_LPOPO) && FSL_FEATURE_SMC_HAS_LPOPO)) -/*! - * @brief Configures the system to LLS power mode. - * - * @param base SMC peripheral base address. - * @param config The LLS power mode configuration structure - * @return SMC configuration error code. - */ -status_t SMC_SetPowerModeLls(SMC_Type *base, const smc_power_mode_lls_config_t *config); -#else -/*! - * @brief Configures the system to LLS power mode. - * - * @param base SMC peripheral base address. - * @return SMC configuration error code. - */ -status_t SMC_SetPowerModeLls(SMC_Type *base); -#endif -#endif /* FSL_FEATURE_SMC_HAS_LOW_LEAKAGE_STOP_MODE */ - -#if (defined(FSL_FEATURE_SMC_HAS_VERY_LOW_LEAKAGE_STOP_MODE) && FSL_FEATURE_SMC_HAS_VERY_LOW_LEAKAGE_STOP_MODE) -/*! - * @brief Configures the system to VLLS power mode. - * - * @param base SMC peripheral base address. - * @param config The VLLS power mode configuration structure. - * @return SMC configuration error code. - */ -status_t SMC_SetPowerModeVlls(SMC_Type *base, const smc_power_mode_vlls_config_t *config); -#endif /* FSL_FEATURE_SMC_HAS_VERY_LOW_LEAKAGE_STOP_MODE */ - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @}*/ - -#endif /* FSL_SMC_H_ */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_spi.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_spi.c deleted file mode 100644 index 2561315a2f5..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_spi.c +++ /dev/null @@ -1,1520 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_spi.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.spi" -#endif - -/*! @brief SPI transfer state, which is used for SPI transactiaonl APIs' internal state. */ -enum _spi_transfer_states_t -{ - kSPI_Idle = 0x0, /*!< SPI is idle state */ - kSPI_Busy /*!< SPI is busy tranferring data. */ -}; - -/*! @brief Typedef for spi master interrupt handler. spi master and slave handle is the same. */ -typedef void (*spi_isr_t)(SPI_Type *base, spi_master_handle_t *spiHandle); - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Sends a buffer of data bytes in non-blocking way. - * - * @param base SPI base pointer - * @param buffer The data bytes to send - * @param size The number of data bytes to send - */ -static void SPI_WriteNonBlocking(SPI_Type *base, const uint8_t *buffer, size_t size); - -/*! - * @brief Receive a buffer of data bytes in non-blocking way. - * - * @param base SPI base pointer - * @param buffer The data bytes to send - * @param size The number of data bytes to send - */ -static void SPI_ReadNonBlocking(SPI_Type *base, uint8_t *buffer, size_t size); - -/*! - * @brief Get the waterrmark value for this SPI instance. - * - * @param base SPI base pointer - * @return Watermark value for the SPI instance. - */ -static uint8_t SPI_GetWatermark(SPI_Type *base); - -/*! - * @brief Send a piece of data for SPI. - * - * This function computes the number of data to be written into D register or Tx FIFO, - * and write the data into it. At the same time, this function updates the values in - * master handle structure. - * - * @param base SPI base pointer - * @param handle Pointer to SPI master handle structure. - */ -static void SPI_SendTransfer(SPI_Type *base, spi_master_handle_t *handle); - -/*! - * @brief Receive a piece of data for SPI master. - * - * This function computes the number of data to receive from D register or Rx FIFO, - * and write the data to destination address. At the same time, this function updates - * the values in master handle structure. - * - * @param base SPI base pointer - * @param handle Pointer to SPI master handle structure. - */ -static void SPI_ReceiveTransfer(SPI_Type *base, spi_master_handle_t *handle); - -/*! - * @brief Common IRQ handler for SPI. - * - * @param base SPI base pointer. - * @param instance SPI instance number. - */ -static void SPI_CommonIRQHandler(SPI_Type *base, uint32_t instance); -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief SPI internal handle pointer array */ -static spi_master_handle_t *s_spiHandle[FSL_FEATURE_SOC_SPI_COUNT]; -/*! @brief Base pointer array */ -static SPI_Type *const s_spiBases[] = SPI_BASE_PTRS; -/*! @brief IRQ name array */ -static const IRQn_Type s_spiIRQ[] = SPI_IRQS; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Clock array name */ -static const clock_ip_name_t s_spiClock[] = SPI_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/*! @brief Pointer to master IRQ handler for each instance. */ -static spi_isr_t s_spiMasterIsr; -static spi_isr_t s_spiSlaveIsr; - -/* @brief Dummy data for each instance. This data is used when user's tx buffer is NULL*/ -volatile uint8_t g_spiDummyData[ARRAY_SIZE(s_spiBases)] = {0}; -/******************************************************************************* - * Code - ******************************************************************************/ -/*! - * brief Get the instance for SPI module. - * - * param base SPI base address - */ -uint32_t SPI_GetInstance(SPI_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_spiBases); instance++) - { - if (s_spiBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_spiBases)); - - return instance; -} - -/*! - * brief Set up the dummy data. - * - * param base SPI peripheral address. - * param dummyData Data to be transferred when tx buffer is NULL. - */ -void SPI_SetDummyData(SPI_Type *base, uint8_t dummyData) -{ - uint32_t instance = SPI_GetInstance(base); - g_spiDummyData[instance] = dummyData; -} - -static void SPI_WriteNonBlocking(SPI_Type *base, const uint8_t *buffer, size_t size) -{ - uint32_t i = 0; - uint8_t bytesPerFrame = 1U; - uint32_t instance = SPI_GetInstance(base); - -#if defined(FSL_FEATURE_SPI_16BIT_TRANSFERS) && FSL_FEATURE_SPI_16BIT_TRANSFERS - /* Check if 16 bits or 8 bits */ - bytesPerFrame = ((base->C2 & SPI_C2_SPIMODE_MASK) >> SPI_C2_SPIMODE_SHIFT) + 1U; -#endif - - while (i < size) - { - if (buffer != NULL) - { -#if defined(FSL_FEATURE_SPI_16BIT_TRANSFERS) && FSL_FEATURE_SPI_16BIT_TRANSFERS - base->DL = *buffer++; - /*16 bit mode*/ - if ((base->C2 & SPI_C2_SPIMODE_MASK) != 0U) - { - base->DH = *buffer++; - } -#else - base->D = *buffer++; -#endif /* FSL_FEATURE_SPI_16BIT_TRANSFERS */ - } - /* Send dummy data */ - else - { -#if defined(FSL_FEATURE_SPI_16BIT_TRANSFERS) && (FSL_FEATURE_SPI_16BIT_TRANSFERS) - base->DL = g_spiDummyData[instance] & 0xFFU; - base->DH = g_spiDummyData[instance] & 0xFFU; -#else - base->D = g_spiDummyData[instance] & 0xFFU; -#endif - } - i += bytesPerFrame; - } -} - -static void SPI_ReadNonBlocking(SPI_Type *base, uint8_t *buffer, size_t size) -{ - uint32_t i = 0U; - uint8_t bytesPerFrame = 1U; - -#if defined(FSL_FEATURE_SPI_16BIT_TRANSFERS) && FSL_FEATURE_SPI_16BIT_TRANSFERS - /* Check if 16 bits or 8 bits */ - bytesPerFrame = ((base->C2 & SPI_C2_SPIMODE_MASK) >> SPI_C2_SPIMODE_SHIFT) + 1U; -#endif - - while (i < size) - { - if (buffer != NULL) - { -#if defined(FSL_FEATURE_SPI_16BIT_TRANSFERS) && FSL_FEATURE_SPI_16BIT_TRANSFERS - *buffer++ = base->DL; - /*16 bit mode*/ - if ((base->C2 & SPI_C2_SPIMODE_MASK) != 0U) - { - *buffer++ = base->DH; - } -#else - *buffer++ = base->D; -#endif /* FSL_FEATURE_SPI_16BIT_TRANSFERS */ - } - else - { - (void)SPI_ReadData(base); - } - i += bytesPerFrame; - } -} - -/* Get the watermark value of transfer. Please note that the entery width of FIFO is 16 bits. */ -static uint8_t SPI_GetWatermark(SPI_Type *base) -{ - uint8_t ret = 0U; -#if defined(FSL_FEATURE_SPI_HAS_FIFO) && FSL_FEATURE_SPI_HAS_FIFO - uint8_t rxSize = 0U; - /* Get the number to be sent if there is FIFO */ - if (FSL_FEATURE_SPI_FIFO_SIZEn(base) != 0) - { - rxSize = (base->C3 & SPI_C3_RNFULLF_MARK_MASK) >> SPI_C3_RNFULLF_MARK_SHIFT; - if (rxSize == 0U) - { - ret = (uint8_t)FSL_FEATURE_SPI_FIFO_SIZEn(base) * 3U / 4U; - } - else - { - ret = (uint8_t)FSL_FEATURE_SPI_FIFO_SIZEn(base) / 2U; - } - } - /* If no FIFO, just set the watermark to 1 */ - else - { - ret = 1U; - } -#else - ret = 1U; -#endif /* FSL_FEATURE_SPI_HAS_FIFO */ - return ret; -} - -static void SPI_SendInitialTransfer(SPI_Type *base, spi_master_handle_t *handle) -{ - uint8_t bytestoTransfer = handle->bytePerFrame; - -#if defined(FSL_FEATURE_SPI_HAS_FIFO) && (FSL_FEATURE_SPI_HAS_FIFO) - if (handle->watermark > 1U) - { - /* In the first time to send data to FIFO, if transfer size is not larger than - * the FIFO size, send all data to FIFO, or send data to make the FIFO full. - * Besides, The FIFO's entry width is 16 bits, need to translate it to bytes. - */ - int32_t fifosize = FSL_FEATURE_SPI_FIFO_SIZEn(base); - assert(fifosize > 0); - bytestoTransfer = (uint8_t)MIN(handle->txRemainingBytes, ((uint32_t)fifosize * 2U)); - } -#endif - - SPI_WriteNonBlocking(base, handle->txData, bytestoTransfer); - - /* Update handle information */ - if (handle->txData != NULL) - { - handle->txData += bytestoTransfer; - } - handle->txRemainingBytes -= bytestoTransfer; -} - -static void SPI_SendTransfer(SPI_Type *base, spi_master_handle_t *handle) -{ - uint8_t bytes = handle->bytePerFrame; - - /* Read S register and ensure SPTEF is 1, otherwise the write would be ignored. */ - if (handle->watermark == 1U) - { - /* Send data */ - if ((base->C1 & SPI_C1_MSTR_MASK) != 0U) - { - /* As a master, only write once */ - if ((base->S & SPI_S_SPTEF_MASK) != 0U) - { - SPI_WriteNonBlocking(base, handle->txData, bytes); - /* Update handle information */ - if (handle->txData != NULL) - { - handle->txData += bytes; - } - handle->txRemainingBytes -= bytes; - } - } - else - { - /* As a slave, send data until SPTEF cleared */ - while (((base->S & SPI_S_SPTEF_MASK) != 0U) && (handle->txRemainingBytes >= bytes)) - { - SPI_WriteNonBlocking(base, handle->txData, bytes); - - /* Update handle information */ - if (handle->txData != NULL) - { - handle->txData += bytes; - } - handle->txRemainingBytes -= bytes; - } - } - } - -#if defined(FSL_FEATURE_SPI_HAS_FIFO) && (FSL_FEATURE_SPI_HAS_FIFO) - /* If use FIFO */ - else - { - /* The FIFO's entry width is 16 bits, need to translate it to bytes. */ - uint8_t bytestoTransfer = (uint8_t)handle->watermark * 2U; - - if (handle->txRemainingBytes < 8U) - { - bytestoTransfer = (uint8_t)handle->txRemainingBytes; - } - - SPI_WriteNonBlocking(base, handle->txData, bytestoTransfer); - - /* Update handle information */ - if (handle->txData != NULL) - { - handle->txData += bytestoTransfer; - } - handle->txRemainingBytes -= bytestoTransfer; - } -#endif -} - -static void SPI_ReceiveTransfer(SPI_Type *base, spi_master_handle_t *handle) -{ - uint8_t bytes = handle->bytePerFrame; - - /* Read S register and ensure SPRF is 1, otherwise the write would be ignored. */ - if (handle->watermark == 1U) - { - if ((base->S & SPI_S_SPRF_MASK) != 0U) - { - SPI_ReadNonBlocking(base, handle->rxData, bytes); - - /* Update information in handle */ - if (handle->rxData != NULL) - { - handle->rxData += bytes; - } - handle->rxRemainingBytes -= bytes; - } - } -#if defined(FSL_FEATURE_SPI_HAS_FIFO) && (FSL_FEATURE_SPI_HAS_FIFO) - /* If use FIFO */ - else - { - /* While rx fifo not empty and remaining data can also trigger the last interrupt */ - while ((base->S & SPI_S_RFIFOEF_MASK) == 0U) - { - SPI_ReadNonBlocking(base, handle->rxData, bytes); - - /* Update information in handle */ - if (handle->rxData != NULL) - { - handle->rxData += bytes; - } - handle->rxRemainingBytes -= bytes; - - /* If the reamining data equals to watermark, leave to last interrupt */ - if (handle->rxRemainingBytes == ((uint32_t)handle->watermark * 2U)) - { - break; - } - } - } -#endif -} - -/*! - * brief Sets the SPI master configuration structure to default values. - * - * The purpose of this API is to get the configuration structure initialized for use in SPI_MasterInit(). - * User may use the initialized structure unchanged in SPI_MasterInit(), or modify - * some fields of the structure before calling SPI_MasterInit(). After calling this API, - * the master is ready to transfer. - * Example: - code - spi_master_config_t config; - SPI_MasterGetDefaultConfig(&config); - endcode - * - * param config pointer to master config structure - */ -void SPI_MasterGetDefaultConfig(spi_master_config_t *config) -{ - /* Initializes the configure structure to zero. */ - (void)(void) memset(config, 0, sizeof(*config)); - - config->enableMaster = true; - config->enableStopInWaitMode = false; - config->polarity = kSPI_ClockPolarityActiveHigh; - config->phase = kSPI_ClockPhaseFirstEdge; - config->direction = kSPI_MsbFirst; - -#if defined(FSL_FEATURE_SPI_16BIT_TRANSFERS) && FSL_FEATURE_SPI_16BIT_TRANSFERS - config->dataMode = kSPI_8BitMode; -#endif /* FSL_FEATURE_SPI_16BIT_TRANSFERS */ - -#if defined(FSL_FEATURE_SPI_HAS_FIFO) && FSL_FEATURE_SPI_HAS_FIFO - config->txWatermark = kSPI_TxFifoOneHalfEmpty; - config->rxWatermark = kSPI_RxFifoOneHalfFull; -#endif /* FSL_FEATURE_SPI_HAS_FIFO */ - - config->pinMode = kSPI_PinModeNormal; - config->outputMode = kSPI_SlaveSelectAutomaticOutput; - config->baudRate_Bps = 500000U; -} - -/*! - * brief Initializes the SPI with master configuration. - * - * The configuration structure can be filled by user from scratch, or be set with default - * values by SPI_MasterGetDefaultConfig(). After calling this API, the slave is ready to transfer. - * Example - code - spi_master_config_t config = { - .baudRate_Bps = 400000, - ... - }; - SPI_MasterInit(SPI0, &config); - endcode - * - * param base SPI base pointer - * param config pointer to master configuration structure - * param srcClock_Hz Source clock frequency. - */ -void SPI_MasterInit(SPI_Type *base, const spi_master_config_t *config, uint32_t srcClock_Hz) -{ - assert((config != NULL) && (srcClock_Hz != 0U)); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Open clock gate for SPI and open interrupt */ - CLOCK_EnableClock(s_spiClock[SPI_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Disable SPI before configuration */ - base->C1 &= (uint8_t)(~SPI_C1_SPE_MASK); - - /* Configure clock polarity and phase, set SPI to master */ - base->C1 = SPI_C1_MSTR(1U) | SPI_C1_CPOL(config->polarity) | SPI_C1_CPHA(config->phase) | - SPI_C1_SSOE((uint8_t)config->outputMode & 1U) | SPI_C1_LSBFE((uint8_t)config->direction); - -/* Set data mode, and also pin mode and mode fault settings */ -#if defined(FSL_FEATURE_SPI_16BIT_TRANSFERS) && FSL_FEATURE_SPI_16BIT_TRANSFERS - base->C2 = SPI_C2_MODFEN((uint8_t)config->outputMode >> 1U) | SPI_C2_BIDIROE((uint8_t)config->pinMode >> 1U) | - SPI_C2_SPISWAI(config->enableStopInWaitMode) | SPI_C2_SPC0((uint8_t)config->pinMode & 1U) | - SPI_C2_SPIMODE(config->dataMode); -#else - base->C2 = SPI_C2_MODFEN((uint8_t)config->outputMode >> 1U) | SPI_C2_BIDIROE((uint8_t)config->pinMode >> 1U) | - SPI_C2_SPISWAI(config->enableStopInWaitMode) | SPI_C2_SPC0((uint8_t)config->pinMode & 1U); -#endif /* FSL_FEATURE_SPI_16BIT_TRANSFERS */ - -/* Set watermark, FIFO is enabled */ -#if defined(FSL_FEATURE_SPI_HAS_FIFO) && FSL_FEATURE_SPI_HAS_FIFO - if (FSL_FEATURE_SPI_FIFO_SIZEn(base) != 0) - { - base->C3 = SPI_C3_TNEAREF_MARK(config->txWatermark) | SPI_C3_RNFULLF_MARK(config->rxWatermark) | - SPI_C3_INTCLR(0U) | SPI_C3_FIFOMODE(1U); - } -#endif /* FSL_FEATURE_SPI_HAS_FIFO */ - - /* Set baud rate */ - SPI_MasterSetBaudRate(base, config->baudRate_Bps, srcClock_Hz); - - /* Set the dummy data, this data will usefull when tx buffer is NULL. */ - SPI_SetDummyData(base, SPI_DUMMYDATA); - - /* Enable SPI */ - if (config->enableMaster) - { - base->C1 |= SPI_C1_SPE_MASK; - } -} - -/*! - * brief Sets the SPI slave configuration structure to default values. - * - * The purpose of this API is to get the configuration structure initialized for use in SPI_SlaveInit(). - * Modify some fields of the structure before calling SPI_SlaveInit(). - * Example: - code - spi_slave_config_t config; - SPI_SlaveGetDefaultConfig(&config); - endcode - * - * param config pointer to slave configuration structure - */ -void SPI_SlaveGetDefaultConfig(spi_slave_config_t *config) -{ - /* Initializes the configure structure to zero. */ - (void)(void) memset(config, 0, sizeof(*config)); - - config->enableSlave = true; - config->polarity = kSPI_ClockPolarityActiveHigh; - config->phase = kSPI_ClockPhaseFirstEdge; - config->direction = kSPI_MsbFirst; - config->enableStopInWaitMode = false; - -#if defined(FSL_FEATURE_SPI_16BIT_TRANSFERS) && FSL_FEATURE_SPI_16BIT_TRANSFERS - config->dataMode = kSPI_8BitMode; -#endif /* FSL_FEATURE_SPI_16BIT_TRANSFERS */ - -#if defined(FSL_FEATURE_SPI_HAS_FIFO) && FSL_FEATURE_SPI_HAS_FIFO - config->txWatermark = kSPI_TxFifoOneHalfEmpty; - config->rxWatermark = kSPI_RxFifoOneHalfFull; -#endif /* FSL_FEATURE_SPI_HAS_FIFO */ - config->pinMode = kSPI_PinModeNormal; -} - -/*! - * brief Initializes the SPI with slave configuration. - * - * The configuration structure can be filled by user from scratch or be set with - * default values by SPI_SlaveGetDefaultConfig(). - * After calling this API, the slave is ready to transfer. - * Example - code - spi_slave_config_t config = { - .polarity = kSPIClockPolarity_ActiveHigh; - .phase = kSPIClockPhase_FirstEdge; - .direction = kSPIMsbFirst; - ... - }; - SPI_MasterInit(SPI0, &config); - endcode - * - * param base SPI base pointer - * param config pointer to master configuration structure - */ -void SPI_SlaveInit(SPI_Type *base, const spi_slave_config_t *config) -{ - assert(config != NULL); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Open clock gate for SPI and open interrupt */ - CLOCK_EnableClock(s_spiClock[SPI_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Disable SPI before configuration */ - base->C1 &= (uint8_t)(~SPI_C1_SPE_MASK); - - /* Configure master and clock polarity and phase */ - base->C1 = - SPI_C1_MSTR(0U) | SPI_C1_CPOL(config->polarity) | SPI_C1_CPHA(config->phase) | SPI_C1_LSBFE(config->direction); - -/* Configure data mode if needed */ -#if defined(FSL_FEATURE_SPI_16BIT_TRANSFERS) && FSL_FEATURE_SPI_16BIT_TRANSFERS - base->C2 = SPI_C2_SPIMODE(config->dataMode) | SPI_C2_SPISWAI(config->enableStopInWaitMode) | - SPI_C2_BIDIROE((uint8_t)config->pinMode >> 1U) | SPI_C2_SPC0((uint8_t)config->pinMode & 1U); -#else - base->C2 = SPI_C2_SPISWAI(config->enableStopInWaitMode) | SPI_C2_BIDIROE((uint8_t)config->pinMode >> 1U) | - SPI_C2_SPC0((uint8_t)config->pinMode & 1U); -#endif /* FSL_FEATURE_SPI_16BIT_TRANSFERS */ - -/* Set watermark */ -#if defined(FSL_FEATURE_SPI_HAS_FIFO) && FSL_FEATURE_SPI_HAS_FIFO - if (FSL_FEATURE_SPI_FIFO_SIZEn(base) != 0) - { - base->C3 = SPI_C3_TNEAREF_MARK(config->txWatermark) | SPI_C3_RNFULLF_MARK(config->rxWatermark) | - SPI_C3_INTCLR(0U) | SPI_C3_FIFOMODE(1U); - } -#endif /* FSL_FEATURE_SPI_HAS_FIFO */ - - /* Set the dummy data, this data will usefull when tx buffer is NULL. */ - SPI_SetDummyData(base, SPI_DUMMYDATA); - - /* Enable SPI */ - if (config->enableSlave) - { - base->C1 |= SPI_C1_SPE_MASK; - } -} - -/*! - * brief De-initializes the SPI. - * - * Calling this API resets the SPI module, gates the SPI clock. - * The SPI module can't work unless calling the SPI_MasterInit/SPI_SlaveInit to initialize module. - * - * param base SPI base pointer - */ -void SPI_Deinit(SPI_Type *base) -{ - /* Disable SPI module before shutting down */ - base->C1 &= (uint8_t)(~SPI_C1_SPE_MASK); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate the clock */ - CLOCK_DisableClock(s_spiClock[SPI_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Gets the status flag. - * - * param base SPI base pointer - * return SPI Status, use status flag to AND #_spi_flags could get the related status. - */ -uint32_t SPI_GetStatusFlags(SPI_Type *base) -{ - uint32_t status = (uint32_t)base->S; -#if defined(FSL_FEATURE_SPI_HAS_FIFO) && FSL_FEATURE_SPI_HAS_FIFO - if (FSL_FEATURE_SPI_FIFO_SIZEn(base) != 0) - { - status |= (((uint32_t)base->CI) << 8U); - } -#endif /* FSL_FEATURE_SPI_HAS_FIFO */ - return status; -} - -/*! - * brief Enables the interrupt for the SPI. - * - * param base SPI base pointer - * param mask SPI interrupt source. The parameter can be any combination of the following values: - * arg kSPI_RxFullAndModfInterruptEnable - * arg kSPI_TxEmptyInterruptEnable - * arg kSPI_MatchInterruptEnable - * arg kSPI_RxFifoNearFullInterruptEnable - * arg kSPI_TxFifoNearEmptyInterruptEnable - */ -void SPI_EnableInterrupts(SPI_Type *base, uint32_t mask) -{ - /* Rx full interrupt */ - if ((mask & (uint32_t)kSPI_RxFullAndModfInterruptEnable) != 0U) - { - base->C1 |= SPI_C1_SPIE_MASK; - } - - /* Tx empty interrupt */ - if ((mask & (uint32_t)kSPI_TxEmptyInterruptEnable) != 0U) - { - base->C1 |= SPI_C1_SPTIE_MASK; - } - - /* Data match interrupt */ - if ((mask & (uint32_t)kSPI_MatchInterruptEnable) != 0U) - { - base->C2 |= SPI_C2_SPMIE_MASK; - } - -/* FIFO related interrupts */ -#if defined(FSL_FEATURE_SPI_HAS_FIFO) && FSL_FEATURE_SPI_HAS_FIFO - if (FSL_FEATURE_SPI_FIFO_SIZEn(base) != 0) - { - /* Rx FIFO near full interrupt */ - if ((mask & (uint32_t)kSPI_RxFifoNearFullInterruptEnable) != 0U) - { - base->C3 |= SPI_C3_RNFULLIEN_MASK; - } - - /* Tx FIFO near empty interrupt */ - if ((mask & (uint32_t)kSPI_TxFifoNearEmptyInterruptEnable) != 0U) - { - base->C3 |= SPI_C3_TNEARIEN_MASK; - } - } -#endif /* FSL_FEATURE_SPI_HAS_FIFO */ -} - -/*! - * brief Disables the interrupt for the SPI. - * - * param base SPI base pointer - * param mask SPI interrupt source. The parameter can be any combination of the following values: - * arg kSPI_RxFullAndModfInterruptEnable - * arg kSPI_TxEmptyInterruptEnable - * arg kSPI_MatchInterruptEnable - * arg kSPI_RxFifoNearFullInterruptEnable - * arg kSPI_TxFifoNearEmptyInterruptEnable - */ -void SPI_DisableInterrupts(SPI_Type *base, uint32_t mask) -{ - /* Rx full interrupt */ - if ((mask & (uint32_t)kSPI_RxFullAndModfInterruptEnable) != 0U) - { - base->C1 &= (uint8_t)(~SPI_C1_SPIE_MASK); - } - - /* Tx empty interrupt */ - if ((mask & (uint32_t)kSPI_TxEmptyInterruptEnable) != 0U) - { - base->C1 &= (uint8_t)(~SPI_C1_SPTIE_MASK); - } - - /* Data match interrupt */ - if ((mask & (uint32_t)kSPI_MatchInterruptEnable) != 0U) - { - base->C2 &= (uint8_t)(~SPI_C2_SPMIE_MASK); - } - -#if defined(FSL_FEATURE_SPI_HAS_FIFO) && FSL_FEATURE_SPI_HAS_FIFO - if (FSL_FEATURE_SPI_FIFO_SIZEn(base) != 0) - { - /* Rx FIFO near full interrupt */ - if ((mask & (uint32_t)kSPI_RxFifoNearFullInterruptEnable) != 0U) - { - base->C3 &= (uint8_t)(~SPI_C3_RNFULLIEN_MASK); - } - - /* Tx FIFO near empty interrupt */ - if ((mask & (uint32_t)kSPI_TxFifoNearEmptyInterruptEnable) != 0U) - { - base->C3 &= (uint8_t)(~SPI_C3_TNEARIEN_MASK); - } - } -#endif /* FSL_FEATURE_SPI_HAS_FIFO */ -} - -/*! - * brief Sets the baud rate for SPI transfer. This is only used in master. - * - * param base SPI base pointer - * param baudRate_Bps baud rate needed in Hz. - * param srcClock_Hz SPI source clock frequency in Hz. - */ -void SPI_MasterSetBaudRate(SPI_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz) -{ - uint32_t prescaler; - uint32_t bestPrescaler; - uint32_t rateDivisor; - uint32_t bestDivisor; - uint32_t rateDivisorValue; - uint32_t realBaudrate; - uint32_t diff; - uint32_t min_diff; - uint32_t freq = baudRate_Bps; - - /* Find combination of prescaler and scaler resulting in baudrate closest to the requested value */ - min_diff = 0xFFFFFFFFU; - - /* Set the maximum divisor bit settings for each of the following divisors */ - bestPrescaler = 7U; - bestDivisor = 8U; - - /* In all for loops, if min_diff = 0, the exit for loop*/ - for (prescaler = 0U; prescaler <= 7U; prescaler++) - { - if (min_diff == 0U) - { - break; - } - /* Initialize to div-by-2 */ - rateDivisorValue = 2U; - - for (rateDivisor = 0; rateDivisor <= 8U; rateDivisor++) - { - if (min_diff == 0U) - { - break; - } - /* Calculate actual baud rate, note need to add 1 to prescaler */ - realBaudrate = ((srcClock_Hz) / ((prescaler + 1U) * rateDivisorValue)); - - /* Calculate the baud rate difference based on the conditional statement ,that states that the - calculated baud rate must not exceed the desired baud rate */ - if (freq >= realBaudrate) - { - diff = freq - realBaudrate; - if (min_diff > diff) - { - /* A better match found */ - min_diff = diff; - bestPrescaler = prescaler; - bestDivisor = rateDivisor; - } - } - - /* Multiply by 2 for each iteration, possible divisor values: 2, 4, 8, 16, ... 512 */ - rateDivisorValue *= 2U; - } - } - - /* Write the best prescalar and baud rate scalar */ - base->BR = SPI_BR_SPR(bestDivisor) | SPI_BR_SPPR(bestPrescaler); -} - -/*! - * brief Sends a buffer of data bytes using a blocking method. - * - * note This function blocks via polling until all bytes have been sent. - * - * param base SPI base pointer - * param buffer The data bytes to send - * param size The number of data bytes to send - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_SPI_Timeout The transfer timed out and was aborted. - */ -status_t SPI_WriteBlocking(SPI_Type *base, uint8_t *buffer, size_t size) -{ - uint32_t i = 0; - uint8_t bytesPerFrame = 1U; - -#if defined(FSL_FEATURE_SPI_16BIT_TRANSFERS) && FSL_FEATURE_SPI_16BIT_TRANSFERS - /* Check if 16 bits or 8 bits */ - bytesPerFrame = ((base->C2 & SPI_C2_SPIMODE_MASK) >> SPI_C2_SPIMODE_SHIFT) + 1U; -#endif - -#if SPI_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (i < size) - { -#if SPI_RETRY_TIMES - waitTimes = SPI_RETRY_TIMES; - while (((base->S & SPI_S_SPTEF_MASK) == 0U) && (--waitTimes != 0U)) -#else - while ((base->S & SPI_S_SPTEF_MASK) == 0U) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return kStatus_SPI_Timeout; - } -#endif - - /* Send a frame of data */ - SPI_WriteNonBlocking(base, buffer, bytesPerFrame); - - i += bytesPerFrame; - buffer += bytesPerFrame; - } - - return kStatus_Success; -} - -#if defined(FSL_FEATURE_SPI_HAS_FIFO) && FSL_FEATURE_SPI_HAS_FIFO -/*! - * brief Enables or disables the FIFO if there is a FIFO. - * - * param base SPI base pointer - * param enable True means enable FIFO, false means disable FIFO. - */ -void SPI_EnableFIFO(SPI_Type *base, bool enable) -{ - if (FSL_FEATURE_SPI_FIFO_SIZEn(base) != 0) - { - if (enable) - { - base->C3 |= SPI_C3_FIFOMODE_MASK; - } - else - { - base->C3 &= (uint8_t)(~SPI_C3_FIFOMODE_MASK); - } - } -} -#endif /* FSL_FEATURE_SPI_HAS_FIFO */ - -/*! - * brief Writes a data into the SPI data register. - * - * param base SPI base pointer - * param data needs to be write. - */ -void SPI_WriteData(SPI_Type *base, uint16_t data) -{ -#if defined(FSL_FEATURE_SPI_16BIT_TRANSFERS) && (FSL_FEATURE_SPI_16BIT_TRANSFERS) - base->DL = (uint8_t)data & 0xFFU; - base->DH = (uint8_t)(data >> 8U) & 0xFFU; -#else - base->D = (uint8_t)data & 0xFFU; -#endif -} - -/*! - * brief Gets a data from the SPI data register. - * - * param base SPI base pointer - * return Data in the register. - */ -uint16_t SPI_ReadData(SPI_Type *base) -{ - uint16_t val = 0; -#if defined(FSL_FEATURE_SPI_16BIT_TRANSFERS) && (FSL_FEATURE_SPI_16BIT_TRANSFERS) - val = base->DL; - val |= (uint16_t)((uint16_t)(base->DH) << 8U); -#else - val = base->D; -#endif - return val; -} - -/*! - * brief Transfers a block of data using a polling method. - * - * param base SPI base pointer - * param xfer pointer to spi_xfer_config_t structure - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_InvalidArgument Input argument is invalid. - * retval kStatus_SPI_Timeout The transfer timed out and was aborted. - */ -status_t SPI_MasterTransferBlocking(SPI_Type *base, spi_transfer_t *xfer) -{ - assert(xfer != NULL); - - uint8_t bytesPerFrame = 1U; -#if SPI_RETRY_TIMES - uint32_t waitTimes = SPI_RETRY_TIMES; -#endif - - /* Check if the argument is legal */ - if ((xfer->txData == NULL) && (xfer->rxData == NULL)) - { - return (status_t)kStatus_InvalidArgument; - } - -#if defined(FSL_FEATURE_SPI_16BIT_TRANSFERS) && FSL_FEATURE_SPI_16BIT_TRANSFERS - /* Check if 16 bits or 8 bits */ - bytesPerFrame = ((base->C2 & SPI_C2_SPIMODE_MASK) >> SPI_C2_SPIMODE_SHIFT) + 1U; -#endif - -#if defined(FSL_FEATURE_SPI_HAS_FIFO) && FSL_FEATURE_SPI_HAS_FIFO - - /* Disable FIFO, as the FIFO may cause data loss if the data size is not integer - times of 2bytes. As SPI cannot set watermark to 0, only can set to 1/2 FIFO size or 3/4 FIFO - size. */ - if (FSL_FEATURE_SPI_FIFO_SIZEn(base) != 0) - { - base->C3 &= (uint8_t)(~SPI_C3_FIFOMODE_MASK); - } - -#endif /* FSL_FEATURE_SPI_HAS_FIFO */ - - /* Begin the polling transfer until all data sent */ - while (xfer->dataSize > 0U) - { - /* Data send */ -#if SPI_RETRY_TIMES - waitTimes = SPI_RETRY_TIMES; - while (((base->S & SPI_S_SPTEF_MASK) == 0U) && (--waitTimes != 0U)) - { - } - if (waitTimes == 0U) - { - return kStatus_SPI_Timeout; - } -#else - while ((base->S & SPI_S_SPTEF_MASK) == 0U) - { - } -#endif - SPI_WriteNonBlocking(base, xfer->txData, bytesPerFrame); - if (xfer->txData != NULL) - { - xfer->txData += bytesPerFrame; - } - -#if SPI_RETRY_TIMES - waitTimes = SPI_RETRY_TIMES; - while (((base->S & SPI_S_SPRF_MASK) == 0U) && (--waitTimes != 0U)) - { - } - if (waitTimes == 0U) - { - return kStatus_SPI_Timeout; - } -#else - while ((base->S & SPI_S_SPRF_MASK) == 0U) - { - } -#endif - SPI_ReadNonBlocking(base, xfer->rxData, bytesPerFrame); - if (xfer->rxData != NULL) - { - xfer->rxData += bytesPerFrame; - } - - /* Decrease the number */ - xfer->dataSize -= bytesPerFrame; - } - - return kStatus_Success; -} - -/*! - * brief Initializes the SPI master handle. - * - * This function initializes the SPI master handle which can be used for other SPI master transactional APIs. Usually, - * for a specified SPI instance, call this API once to get the initialized handle. - * - * param base SPI peripheral base address. - * param handle SPI handle pointer. - * param callback Callback function. - * param userData User data. - */ -void SPI_MasterTransferCreateHandle(SPI_Type *base, - spi_master_handle_t *handle, - spi_master_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - uint32_t instance = SPI_GetInstance(base); - - /* Zero the handle */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Initialize the handle */ - s_spiHandle[instance] = handle; - handle->callback = callback; - handle->userData = userData; - s_spiMasterIsr = SPI_MasterTransferHandleIRQ; - handle->watermark = SPI_GetWatermark(base); - -/* Get the bytes per frame */ -#if defined(FSL_FEATURE_SPI_16BIT_TRANSFERS) && (FSL_FEATURE_SPI_16BIT_TRANSFERS) - handle->bytePerFrame = ((base->C2 & SPI_C2_SPIMODE_MASK) >> SPI_C2_SPIMODE_SHIFT) + 1U; -#else - handle->bytePerFrame = 1U; -#endif - - /* Enable SPI NVIC */ - (void)EnableIRQ(s_spiIRQ[instance]); -} - -/*! - * brief Performs a non-blocking SPI interrupt transfer. - * - * note The API immediately returns after transfer initialization is finished. - * Call SPI_GetStatusIRQ() to get the transfer status. - * note If SPI transfer data frame size is 16 bits, the transfer size cannot be an odd number. - * - * param base SPI peripheral base address. - * param handle pointer to spi_master_handle_t structure which stores the transfer state - * param xfer pointer to spi_xfer_config_t structure - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_InvalidArgument Input argument is invalid. - * retval kStatus_SPI_Busy SPI is not idle, is running another transfer. - */ -status_t SPI_MasterTransferNonBlocking(SPI_Type *base, spi_master_handle_t *handle, spi_transfer_t *xfer) -{ - assert((handle != NULL) && (xfer != NULL)); - uint32_t mask = 0U; - - /* Check if SPI is busy */ - if (handle->state == (uint32_t)kSPI_Busy) - { - return (status_t)kStatus_SPI_Busy; - } - - /* Check if the input arguments valid */ - if (((xfer->txData == NULL) && (xfer->rxData == NULL)) || (xfer->dataSize == 0U)) - { - return (status_t)kStatus_InvalidArgument; - } - - /* Set the handle information */ - handle->txData = xfer->txData; - handle->rxData = xfer->rxData; - handle->transferSize = xfer->dataSize; - handle->txRemainingBytes = xfer->dataSize; - handle->rxRemainingBytes = xfer->dataSize; - - /* Set the SPI state to busy */ - handle->state = (uint32_t)kSPI_Busy; - - /* Enable Interrupt */ -#if defined(FSL_FEATURE_SPI_HAS_FIFO) && FSL_FEATURE_SPI_HAS_FIFO - - handle->watermark = SPI_GetWatermark(base); - - /* If the size of the transfer size less than watermark, set watermark to 1 */ - if (xfer->dataSize < (uint32_t)handle->watermark * 2U) - { - handle->watermark = 1U; - } - - /* According to watermark size, enable interrupts */ - if (handle->watermark > 1U) - { - /* Enable Rx near full interrupt */ - mask = (uint32_t)kSPI_RxFifoNearFullInterruptEnable; - /* Enable Tx near full interrupt only if there are data to send */ - if (handle->txData != NULL) - { - mask |= (uint32_t)kSPI_TxFifoNearEmptyInterruptEnable; - } - - SPI_EnableFIFO(base, true); - /* First send a piece of data to Tx Data or FIFO to start a SPI transfer */ - while ((base->S & SPI_S_TNEAREF_MASK) != SPI_S_TNEAREF_MASK) - { - } - SPI_SendInitialTransfer(base, handle); - } - else - { - /* Enable Rx full interrupt */ - mask = (uint32_t)kSPI_RxFullAndModfInterruptEnable; - /* Enable Tx full interrupt only if there are data to send */ - if (handle->txData != NULL) - { - mask |= (uint32_t)kSPI_TxEmptyInterruptEnable; - } - - SPI_EnableFIFO(base, false); - while ((base->S & SPI_S_SPTEF_MASK) != SPI_S_SPTEF_MASK) - { - } - /* First send a piece of data to Tx Data or FIFO to start a SPI transfer */ - SPI_SendInitialTransfer(base, handle); - } -#else - /* Enable Rx full interrupt */ - mask = (uint32_t)kSPI_RxFullAndModfInterruptEnable; - /* Enable Tx full interrupt only if there are data to send */ - if (handle->txData != NULL) - { - mask |= (uint32_t)kSPI_TxEmptyInterruptEnable; - } - - while ((base->S & SPI_S_SPTEF_MASK) != SPI_S_SPTEF_MASK) - { - } - /* First send a piece of data to Tx Data or FIFO to start a SPI transfer */ - SPI_SendInitialTransfer(base, handle); -#endif - - SPI_EnableInterrupts(base, mask); - return kStatus_Success; -} - -/*! - * brief Gets the bytes of the SPI interrupt transferred. - * - * param base SPI peripheral base address. - * param handle Pointer to SPI transfer handle, this should be a static variable. - * param count Transferred bytes of SPI master. - * retval kStatus_SPI_Success Succeed get the transfer count. - * retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t SPI_MasterTransferGetCount(SPI_Type *base, spi_master_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - status_t status = kStatus_Success; - - if (handle->state != (uint32_t)kSPI_Busy) - { - status = (status_t)kStatus_NoTransferInProgress; - } - else - { - /* Return remaing bytes in different cases */ - if (handle->rxData != NULL) - { - *count = handle->transferSize - handle->rxRemainingBytes; - } - else - { - *count = handle->transferSize - handle->txRemainingBytes; - } - } - - return status; -} - -/*! - * brief Aborts an SPI transfer using interrupt. - * - * param base SPI peripheral base address. - * param handle Pointer to SPI transfer handle, this should be a static variable. - */ -void SPI_MasterTransferAbort(SPI_Type *base, spi_master_handle_t *handle) -{ - assert(handle != NULL); - uint32_t mask = (uint32_t)kSPI_TxEmptyInterruptEnable; - - /* Stop interrupts */ -#if defined(FSL_FEATURE_SPI_HAS_FIFO) && FSL_FEATURE_SPI_HAS_FIFO - if (handle->watermark > 1U) - { - mask |= (uint32_t)kSPI_RxFifoNearFullInterruptEnable | (uint32_t)kSPI_TxFifoNearEmptyInterruptEnable; - } - else - { - mask |= (uint32_t)kSPI_RxFullAndModfInterruptEnable | (uint32_t)kSPI_TxEmptyInterruptEnable; - } -#else - mask |= (uint32_t)kSPI_RxFullAndModfInterruptEnable | (uint32_t)kSPI_TxEmptyInterruptEnable; -#endif - - SPI_DisableInterrupts(base, mask); - /* Transfer finished, set the state to Done*/ - handle->state = (uint32_t)kSPI_Idle; - - /* Clear the internal state */ - handle->rxRemainingBytes = 0; - handle->txRemainingBytes = 0; -} - -/*! - * brief Interrupts the handler for the SPI. - * - * param base SPI peripheral base address. - * param handle pointer to spi_master_handle_t structure which stores the transfer state. - */ -void SPI_MasterTransferHandleIRQ(SPI_Type *base, spi_master_handle_t *handle) -{ - assert(handle != NULL); - - /* If needs to receive data, do a receive */ - if ((handle->rxRemainingBytes) != 0U) - { - SPI_ReceiveTransfer(base, handle); - } - - /* We always need to send a data to make the SPI run */ - /* To prevent rx overflow, calculate the difference between rxRemainingBytes - and txRemainingBytes and make sure the difference is smaller than watermark. - The watermark is set according to FIFO size, for instance that does not have - FIFO, the watermark is 1. */ - if (((handle->txRemainingBytes) != 0U) && - ((handle->rxRemainingBytes - handle->txRemainingBytes) < handle->watermark)) - { - SPI_SendTransfer(base, handle); -#if defined(FSL_FEATURE_SPI_HAS_FIFO) && FSL_FEATURE_SPI_HAS_FIFO - if (handle->txRemainingBytes == 0U) - { - SPI_DisableInterrupts(base, (uint32_t)kSPI_TxFifoNearEmptyInterruptEnable); - SPI_EnableInterrupts(base, (uint32_t)kSPI_TxEmptyInterruptEnable); - } -#endif - } - - /* All the transfer finished */ - if ((handle->txRemainingBytes == 0U) && (handle->rxRemainingBytes == 0U)) - { - if ((SPI_GetStatusFlags(base) & (uint32_t)kSPI_TxBufferEmptyFlag) != 0U) - { - /* Complete the transfer */ - SPI_MasterTransferAbort(base, handle); - - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_SPI_Idle, handle->userData); - } - } - } -} -/*! - * brief Initializes the SPI slave handle. - * - * This function initializes the SPI slave handle which can be used for other SPI slave transactional APIs. Usually, - * for a specified SPI instance, call this API once to get the initialized handle. - * - * param base SPI peripheral base address. - * param handle SPI handle pointer. - * param callback Callback function. - * param userData User data. - */ -void SPI_SlaveTransferCreateHandle(SPI_Type *base, - spi_slave_handle_t *handle, - spi_slave_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - /* Slave create handle share same logic with master create handle, the only difference - is the Isr pointer. */ - SPI_MasterTransferCreateHandle(base, handle, callback, userData); - s_spiSlaveIsr = SPI_SlaveTransferHandleIRQ; -} - -/*! - * brief Performs a non-blocking SPI slave interrupt transfer. - * - * note The API returns immediately after the transfer initialization is finished. - * Call SPI_GetStatusIRQ() to get the transfer status. - * note If SPI transfer data frame size is 16 bits, the transfer size cannot be an odd number. - * - * param base SPI peripheral base address. - * param handle pointer to spi_slave_handle_t structure which stores the transfer state - * param xfer pointer to spi_xfer_config_t structure - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_InvalidArgument Input argument is invalid. - * retval kStatus_SPI_Busy SPI is not idle, is running another transfer. - */ -status_t SPI_SlaveTransferNonBlocking(SPI_Type *base, spi_slave_handle_t *handle, spi_transfer_t *xfer) -{ - assert((handle != NULL) && (xfer != NULL)); - uint32_t mask = 0U; - - /* Check if SPI is busy */ - if (handle->state == (uint32_t)kSPI_Busy) - { - return (status_t)kStatus_SPI_Busy; - } - - /* Check if the input arguments valid */ - if (((xfer->txData == NULL) && (xfer->rxData == NULL)) || (xfer->dataSize == 0U)) - { - return (status_t)kStatus_InvalidArgument; - } - - /* Read out any possible data */ -#if defined(FSL_FEATURE_SPI_HAS_FIFO) && FSL_FEATURE_SPI_HAS_FIFO - /* If instance has FIFO and FIFO is enabled. */ - if ((FSL_FEATURE_SPI_FIFO_SIZEn(base) != 0) && ((base->C3 & SPI_C3_FIFOMODE_MASK) != 0U)) - { - while ((SPI_GetStatusFlags(base) & (uint32_t)kSPI_RxFifoEmptyFlag) == 0U) - { - (void)SPI_ReadData(base); - } - } - else - { - if ((SPI_GetStatusFlags(base) & (uint32_t)kSPI_RxBufferFullFlag) != 0U) - { - (void)SPI_ReadData(base); - } - } -#else - if ((SPI_GetStatusFlags(base) & (uint32_t)kSPI_RxBufferFullFlag) != 0U) - { - (void)SPI_ReadData(base); - } -#endif /* FSL_FEATURE_SPI_HAS_FIFO */ - - /* Set the handle information */ - handle->txData = xfer->txData; - handle->rxData = xfer->rxData; - handle->transferSize = xfer->dataSize; - handle->txRemainingBytes = (xfer->txData == NULL) ? 0U : xfer->dataSize; - handle->rxRemainingBytes = (xfer->rxData == NULL) ? 0U : xfer->dataSize; - - /* Set the SPI state to busy */ - handle->state = (uint32_t)kSPI_Busy; - - /* Enable Interrupt */ -#if defined(FSL_FEATURE_SPI_HAS_FIFO) && FSL_FEATURE_SPI_HAS_FIFO - - handle->watermark = SPI_GetWatermark(base); - - /* If the size of the transfer size less than watermark, set watermark to 1 */ - if (xfer->dataSize < (uint32_t)handle->watermark * 2U) - { - handle->watermark = 1U; - } - - /* According to watermark size, enable interrupts */ - if (handle->watermark > 1U) - { - /* Enable Rx near full interrupt */ - - if (handle->rxData != NULL) - { - mask |= (uint32_t)kSPI_RxFifoNearFullInterruptEnable; - } - /* Enable Tx near full interrupt only if there are data to send */ - if (handle->txData != NULL) - { - mask |= (uint32_t)kSPI_TxFifoNearEmptyInterruptEnable; - } - - SPI_EnableFIFO(base, true); - } - else - { - /* Enable Rx full interrupt */ - if (handle->rxData != NULL) - { - mask |= (uint32_t)kSPI_RxFullAndModfInterruptEnable; - } - /* Enable Tx full interrupt only if there are data to send */ - if (handle->txData != NULL) - { - mask |= (uint32_t)kSPI_TxEmptyInterruptEnable; - } - - SPI_EnableFIFO(base, false); - } -#else - /* Enable Rx full interrupt */ - if (handle->rxData != NULL) - { - mask |= (uint32_t)kSPI_RxFullAndModfInterruptEnable; - } - /* Enable Tx full interrupt only if there are data to send */ - if (handle->txData != NULL) - { - mask |= (uint32_t)kSPI_TxEmptyInterruptEnable; - } -#endif - - SPI_EnableInterrupts(base, mask); - return kStatus_Success; -} - -/*! - * brief Interrupts a handler for the SPI slave. - * - * param base SPI peripheral base address. - * param handle pointer to spi_slave_handle_t structure which stores the transfer state - */ -void SPI_SlaveTransferHandleIRQ(SPI_Type *base, spi_slave_handle_t *handle) -{ - assert(handle != NULL); - - /* If needs to receive data, do a receive */ - if ((handle->rxRemainingBytes) != 0U) - { - SPI_ReceiveTransfer(base, handle); - } - - if ((handle->txRemainingBytes) != 0U) - { - SPI_SendTransfer(base, handle); -#if defined(FSL_FEATURE_SPI_HAS_FIFO) && FSL_FEATURE_SPI_HAS_FIFO - if (handle->txRemainingBytes == 0U) - { - SPI_DisableInterrupts(base, (uint32_t)kSPI_TxFifoNearEmptyInterruptEnable); - SPI_EnableInterrupts(base, (uint32_t)kSPI_TxEmptyInterruptEnable); - } -#endif - } - - /* All the transfer finished */ - if ((handle->txRemainingBytes == 0U) && (handle->rxRemainingBytes == 0U)) - { - if ((SPI_GetStatusFlags(base) & (uint32_t)kSPI_TxBufferEmptyFlag) != 0U) - { - /* Complete the transfer */ - SPI_SlaveTransferAbort(base, handle); - - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_SPI_Idle, handle->userData); - } - } - } -} - -static void SPI_CommonIRQHandler(SPI_Type *base, uint32_t instance) -{ - if ((base->C1 & SPI_C1_MSTR_MASK) != 0U) - { - s_spiMasterIsr(base, s_spiHandle[instance]); - } - else - { - s_spiSlaveIsr(base, s_spiHandle[instance]); - } - SDK_ISR_EXIT_BARRIER; -} - -#if defined(FSL_FEATURE_SPI_HAS_SHARED_IRQ0_IRQ1_IRQ2) && FSL_FEATURE_SPI_HAS_SHARED_IRQ0_IRQ1_IRQ2 -void SPI0_SPI1_SPI2_DriverIRQHandler(void); -void SPI0_SPI1_SPI2_DriverIRQHandler(void) -{ - for (uint32_t instance = 0U; instance < 3U; instance++) - { - if (s_spiHandle[instance] != NULL) - { - SPI_CommonIRQHandler(s_spiBases[instance], instance); - } - } -} -#elif defined(FSL_FEATURE_SPI_HAS_SHARED_IRQ0_IRQ1) && FSL_FEATURE_SPI_HAS_SHARED_IRQ0_IRQ1 -void SPI0_SPI1_DriverIRQHandler(void); -void SPI0_SPI1_DriverIRQHandler(void) -{ - for (uint32_t instance = 0U; instance < 2U; instance++) - { - if (s_spiHandle[instance] != NULL) - { - SPI_CommonIRQHandler(s_spiBases[instance], instance); - } - } -} -#else -#if defined(SPI0) -void SPI0_DriverIRQHandler(void); -void SPI0_DriverIRQHandler(void) -{ - assert(s_spiHandle[0] != NULL); - SPI_CommonIRQHandler(SPI0, 0); -} -#endif - -#if defined(SPI1) -void SPI1_DriverIRQHandler(void); -void SPI1_DriverIRQHandler(void) -{ - assert(s_spiHandle[1] != NULL); - SPI_CommonIRQHandler(SPI1, 1); -} -#endif - -#if defined(SPI2) -void SPI2_DriverIRQHandler(void); -void SPI2_DriverIRQHandler(void) -{ - assert(s_spiHandle[2] != NULL); - SPI_CommonIRQHandler(SPI2, 2); -} -#endif -#endif diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_spi.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_spi.h deleted file mode 100644 index e97f2ff7b05..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_spi.h +++ /dev/null @@ -1,713 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_SPI_H_ -#define FSL_SPI_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup spi_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief SPI driver version. */ -#define FSL_SPI_DRIVER_VERSION (MAKE_VERSION(2, 1, 3)) -/*! @} */ - -#ifndef SPI_DUMMYDATA -/*! @brief SPI dummy transfer data, the data is sent while txBuff is NULL. */ -#define SPI_DUMMYDATA (0x00U) -#endif - -/*! @brief Retry times for waiting flag. */ -#ifndef SPI_RETRY_TIMES -#define SPI_RETRY_TIMES 0U /* Define to zero means keep waiting until the flag is assert/deassert. */ -#endif - -/*! @brief Global variable for dummy data value setting. */ -extern volatile uint8_t g_spiDummyData[]; - -/*! @brief Return status for the SPI driver.*/ -enum -{ - kStatus_SPI_Busy = MAKE_STATUS(kStatusGroup_SPI, 0), /*!< SPI bus is busy */ - kStatus_SPI_Idle = MAKE_STATUS(kStatusGroup_SPI, 1), /*!< SPI is idle */ - kStatus_SPI_Error = MAKE_STATUS(kStatusGroup_SPI, 2), /*!< SPI error */ - kStatus_SPI_Timeout = MAKE_STATUS(kStatusGroup_SPI, 3) /*!< SPI timeout polling status flags. */ -}; - -/*! @brief SPI clock polarity configuration.*/ -typedef enum _spi_clock_polarity -{ - kSPI_ClockPolarityActiveHigh = 0x0U, /*!< Active-high SPI clock (idles low). */ - kSPI_ClockPolarityActiveLow /*!< Active-low SPI clock (idles high). */ -} spi_clock_polarity_t; - -/*! @brief SPI clock phase configuration.*/ -typedef enum _spi_clock_phase -{ - kSPI_ClockPhaseFirstEdge = 0x0U, /*!< First edge on SPSCK occurs at the middle of the first - * cycle of a data transfer. */ - kSPI_ClockPhaseSecondEdge /*!< First edge on SPSCK occurs at the start of the - * first cycle of a data transfer. */ -} spi_clock_phase_t; - -/*! @brief SPI data shifter direction options.*/ -typedef enum _spi_shift_direction -{ - kSPI_MsbFirst = 0x0U, /*!< Data transfers start with most significant bit. */ - kSPI_LsbFirst /*!< Data transfers start with least significant bit. */ -} spi_shift_direction_t; - -/*! @brief SPI slave select output mode options.*/ -typedef enum _spi_ss_output_mode -{ - kSPI_SlaveSelectAsGpio = 0x0U, /*!< Slave select pin configured as GPIO. */ - kSPI_SlaveSelectFaultInput = 0x2U, /*!< Slave select pin configured for fault detection. */ - kSPI_SlaveSelectAutomaticOutput = 0x3U /*!< Slave select pin configured for automatic SPI output. */ -} spi_ss_output_mode_t; - -/*! @brief SPI pin mode options.*/ -typedef enum _spi_pin_mode -{ - kSPI_PinModeNormal = 0x0U, /*!< Pins operate in normal, single-direction mode.*/ - kSPI_PinModeInput = 0x1U, /*!< Bidirectional mode. Master: MOSI pin is input; - * Slave: MISO pin is input. */ - kSPI_PinModeOutput = 0x3U /*!< Bidirectional mode. Master: MOSI pin is output; - * Slave: MISO pin is output. */ -} spi_pin_mode_t; - -/*! @brief SPI data length mode options.*/ -typedef enum _spi_data_bitcount_mode -{ - kSPI_8BitMode = 0x0U, /*!< 8-bit data transmission mode*/ - kSPI_16BitMode /*!< 16-bit data transmission mode*/ -} spi_data_bitcount_mode_t; - -/*! @brief SPI interrupt sources.*/ -enum _spi_interrupt_enable -{ - kSPI_RxFullAndModfInterruptEnable = 0x1U, /*!< Receive buffer full (SPRF) and mode fault (MODF) interrupt */ - kSPI_TxEmptyInterruptEnable = 0x2U, /*!< Transmit buffer empty interrupt */ - kSPI_MatchInterruptEnable = 0x4U, /*!< Match interrupt */ -#if defined(FSL_FEATURE_SPI_HAS_FIFO) && FSL_FEATURE_SPI_HAS_FIFO - kSPI_RxFifoNearFullInterruptEnable = 0x8U, /*!< Receive FIFO nearly full interrupt */ - kSPI_TxFifoNearEmptyInterruptEnable = 0x10U, /*!< Transmit FIFO nearly empty interrupt */ -#endif /* FSL_FEATURE_SPI_HAS_FIFO */ -}; - -/*! @brief SPI status flags.*/ -enum _spi_flags -{ - kSPI_RxBufferFullFlag = SPI_S_SPRF_MASK, /*!< Read buffer full flag */ - kSPI_MatchFlag = SPI_S_SPMF_MASK, /*!< Match flag */ - kSPI_TxBufferEmptyFlag = SPI_S_SPTEF_MASK, /*!< Transmit buffer empty flag */ - kSPI_ModeFaultFlag = SPI_S_MODF_MASK, /*!< Mode fault flag */ -#if defined(FSL_FEATURE_SPI_HAS_FIFO) && FSL_FEATURE_SPI_HAS_FIFO - kSPI_RxFifoNearFullFlag = SPI_S_RNFULLF_MASK, /*!< Rx FIFO near full */ - kSPI_TxFifoNearEmptyFlag = SPI_S_TNEAREF_MASK, /*!< Tx FIFO near empty */ - kSPI_TxFifoFullFlag = SPI_S_TXFULLF_MASK, /*!< Tx FIFO full */ - kSPI_RxFifoEmptyFlag = SPI_S_RFIFOEF_MASK, /*!< Rx FIFO empty */ - kSPI_TxFifoError = SPI_CI_TXFERR_MASK << 8U, /*!< Tx FIFO error */ - kSPI_RxFifoError = SPI_CI_RXFERR_MASK << 8U, /*!< Rx FIFO error */ - kSPI_TxOverflow = SPI_CI_TXFOF_MASK << 8U, /*!< Tx FIFO Overflow */ - kSPI_RxOverflow = SPI_CI_RXFOF_MASK << 8U /*!< Rx FIFO Overflow */ -#endif /* FSL_FEATURE_SPI_HAS_FIFO */ -}; - -#if defined(FSL_FEATURE_SPI_HAS_FIFO) && FSL_FEATURE_SPI_HAS_FIFO -/*! @brief SPI FIFO write-1-to-clear interrupt flags.*/ -typedef enum _spi_w1c_interrupt -{ - kSPI_RxFifoFullClearInterrupt = SPI_CI_SPRFCI_MASK, /*!< Receive FIFO full interrupt */ - kSPI_TxFifoEmptyClearInterrupt = SPI_CI_SPTEFCI_MASK, /*!< Transmit FIFO empty interrupt */ - kSPI_RxNearFullClearInterrupt = SPI_CI_RNFULLFCI_MASK, /*!< Receive FIFO nearly full interrupt */ - kSPI_TxNearEmptyClearInterrupt = SPI_CI_TNEAREFCI_MASK /*!< Transmit FIFO nearly empty interrupt */ -} spi_w1c_interrupt_t; - -/*! @brief SPI TX FIFO watermark settings.*/ -typedef enum _spi_txfifo_watermark -{ - kSPI_TxFifoOneFourthEmpty = 0, /*!< SPI tx watermark at 1/4 FIFO size */ - kSPI_TxFifoOneHalfEmpty = 1 /*!< SPI tx watermark at 1/2 FIFO size */ -} spi_txfifo_watermark_t; - -/*! @brief SPI RX FIFO watermark settings.*/ -typedef enum _spi_rxfifo_watermark -{ - kSPI_RxFifoThreeFourthsFull = 0, /*!< SPI rx watermark at 3/4 FIFO size */ - kSPI_RxFifoOneHalfFull = 1 /*!< SPI rx watermark at 1/2 FIFO size */ -} spi_rxfifo_watermark_t; -#endif /* FSL_FEATURE_SPI_HAS_FIFO */ - -#if defined(FSL_FEATURE_SPI_HAS_DMA_SUPPORT) && FSL_FEATURE_SPI_HAS_DMA_SUPPORT -/*! @brief SPI DMA source*/ -enum _spi_dma_enable_t -{ - kSPI_TxDmaEnable = SPI_C2_TXDMAE_MASK, /*!< Tx DMA request source */ - kSPI_RxDmaEnable = SPI_C2_RXDMAE_MASK, /*!< Rx DMA request source */ - kSPI_DmaAllEnable = (SPI_C2_TXDMAE_MASK | SPI_C2_RXDMAE_MASK) /*!< All DMA request source*/ -}; -#endif /* FSL_FEATURE_SPI_HAS_DMA_SUPPORT */ - -/*! @brief SPI master user configure structure.*/ -typedef struct _spi_master_config -{ - bool enableMaster; /*!< Enable SPI at initialization time */ - bool enableStopInWaitMode; /*!< SPI stop in wait mode */ - spi_clock_polarity_t polarity; /*!< Clock polarity */ - spi_clock_phase_t phase; /*!< Clock phase */ - spi_shift_direction_t direction; /*!< MSB or LSB */ -#if defined(FSL_FEATURE_SPI_16BIT_TRANSFERS) && FSL_FEATURE_SPI_16BIT_TRANSFERS - spi_data_bitcount_mode_t dataMode; /*!< 8bit or 16bit mode */ -#endif /* FSL_FEATURE_SPI_16BIT_TRANSFERS */ -#if defined(FSL_FEATURE_SPI_HAS_FIFO) && FSL_FEATURE_SPI_HAS_FIFO - spi_txfifo_watermark_t txWatermark; /*!< Tx watermark settings */ - spi_rxfifo_watermark_t rxWatermark; /*!< Rx watermark settings */ -#endif /* FSL_FEATURE_SPI_HAS_FIFO */ - spi_ss_output_mode_t outputMode; /*!< SS pin setting */ - spi_pin_mode_t pinMode; /*!< SPI pin mode select */ - uint32_t baudRate_Bps; /*!< Baud Rate for SPI in Hz */ -} spi_master_config_t; - -/*! @brief SPI slave user configure structure.*/ -typedef struct _spi_slave_config -{ - bool enableSlave; /*!< Enable SPI at initialization time */ - bool enableStopInWaitMode; /*!< SPI stop in wait mode */ - spi_clock_polarity_t polarity; /*!< Clock polarity */ - spi_clock_phase_t phase; /*!< Clock phase */ - spi_shift_direction_t direction; /*!< MSB or LSB */ -#if defined(FSL_FEATURE_SPI_16BIT_TRANSFERS) && FSL_FEATURE_SPI_16BIT_TRANSFERS - spi_data_bitcount_mode_t dataMode; /*!< 8bit or 16bit mode */ -#endif /* FSL_FEATURE_SPI_16BIT_TRANSFERS */ -#if defined(FSL_FEATURE_SPI_HAS_FIFO) && FSL_FEATURE_SPI_HAS_FIFO - spi_txfifo_watermark_t txWatermark; /*!< Tx watermark settings */ - spi_rxfifo_watermark_t rxWatermark; /*!< Rx watermark settings */ -#endif /* FSL_FEATURE_SPI_HAS_FIFO */ - spi_pin_mode_t pinMode; /*!< SPI pin mode select */ -} spi_slave_config_t; - -/*! @brief SPI transfer structure */ -typedef struct _spi_transfer -{ - const uint8_t *txData; /*!< Send buffer */ - uint8_t *rxData; /*!< Receive buffer */ - size_t dataSize; /*!< Transfer bytes */ - uint32_t flags; /*!< SPI control flag, useless to SPI.*/ -} spi_transfer_t; - -typedef struct _spi_master_handle spi_master_handle_t; - -/*! @brief Slave handle is the same with master handle */ -typedef spi_master_handle_t spi_slave_handle_t; - -/*! @brief SPI master callback for finished transmit */ -typedef void (*spi_master_callback_t)(SPI_Type *base, spi_master_handle_t *handle, status_t status, void *userData); - -/*! @brief SPI master callback for finished transmit */ -typedef void (*spi_slave_callback_t)(SPI_Type *base, spi_slave_handle_t *handle, status_t status, void *userData); - -/*! @brief SPI transfer handle structure */ -struct _spi_master_handle -{ - const uint8_t *volatile txData; /*!< Transfer buffer */ - uint8_t *volatile rxData; /*!< Receive buffer */ - volatile size_t txRemainingBytes; /*!< Send data remaining in bytes */ - volatile size_t rxRemainingBytes; /*!< Receive data remaining in bytes */ - volatile uint32_t state; /*!< SPI internal state */ - size_t transferSize; /*!< Bytes to be transferred */ - uint8_t bytePerFrame; /*!< SPI mode, 2bytes or 1byte in a frame */ - uint8_t watermark; /*!< Watermark value for SPI transfer */ - spi_master_callback_t callback; /*!< SPI callback */ - void *userData; /*!< Callback parameter */ -}; - -#if defined(__cplusplus) -extern "C" { -#endif -/******************************************************************************* - * APIs - ******************************************************************************/ -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Sets the SPI master configuration structure to default values. - * - * The purpose of this API is to get the configuration structure initialized for use in SPI_MasterInit(). - * User may use the initialized structure unchanged in SPI_MasterInit(), or modify - * some fields of the structure before calling SPI_MasterInit(). After calling this API, - * the master is ready to transfer. - * Example: - @code - spi_master_config_t config; - SPI_MasterGetDefaultConfig(&config); - @endcode - * - * @param config pointer to master config structure - */ -void SPI_MasterGetDefaultConfig(spi_master_config_t *config); - -/*! - * @brief Initializes the SPI with master configuration. - * - * The configuration structure can be filled by user from scratch, or be set with default - * values by SPI_MasterGetDefaultConfig(). After calling this API, the slave is ready to transfer. - * Example - @code - spi_master_config_t config = { - .baudRate_Bps = 400000, - ... - }; - SPI_MasterInit(SPI0, &config); - @endcode - * - * @param base SPI base pointer - * @param config pointer to master configuration structure - * @param srcClock_Hz Source clock frequency. - */ -void SPI_MasterInit(SPI_Type *base, const spi_master_config_t *config, uint32_t srcClock_Hz); - -/*! - * @brief Sets the SPI slave configuration structure to default values. - * - * The purpose of this API is to get the configuration structure initialized for use in SPI_SlaveInit(). - * Modify some fields of the structure before calling SPI_SlaveInit(). - * Example: - @code - spi_slave_config_t config; - SPI_SlaveGetDefaultConfig(&config); - @endcode - * - * @param config pointer to slave configuration structure - */ -void SPI_SlaveGetDefaultConfig(spi_slave_config_t *config); - -/*! - * @brief Initializes the SPI with slave configuration. - * - * The configuration structure can be filled by user from scratch or be set with - * default values by SPI_SlaveGetDefaultConfig(). - * After calling this API, the slave is ready to transfer. - * Example - @code - spi_slave_config_t config = { - .polarity = kSPIClockPolarity_ActiveHigh; - .phase = kSPIClockPhase_FirstEdge; - .direction = kSPIMsbFirst; - ... - }; - SPI_MasterInit(SPI0, &config); - @endcode - * - * @param base SPI base pointer - * @param config pointer to master configuration structure - */ -void SPI_SlaveInit(SPI_Type *base, const spi_slave_config_t *config); - -/*! - * @brief De-initializes the SPI. - * - * Calling this API resets the SPI module, gates the SPI clock. - * The SPI module can't work unless calling the SPI_MasterInit/SPI_SlaveInit to initialize module. - * - * @param base SPI base pointer - */ -void SPI_Deinit(SPI_Type *base); - -/*! - * @brief Enables or disables the SPI. - * - * @param base SPI base pointer - * @param enable pass true to enable module, false to disable module - */ -static inline void SPI_Enable(SPI_Type *base, bool enable) -{ - if (enable) - { - base->C1 |= SPI_C1_SPE_MASK; - } - else - { - base->C1 &= (uint8_t)~SPI_C1_SPE_MASK; - } -} - -/*! @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets the status flag. - * - * @param base SPI base pointer - * @return SPI Status, use status flag to AND #_spi_flags could get the related status. - */ -uint32_t SPI_GetStatusFlags(SPI_Type *base); - -#if defined(FSL_FEATURE_SPI_HAS_FIFO) && FSL_FEATURE_SPI_HAS_FIFO -/*! - * @brief Clear the interrupt if enable INCTLR. - * - * @param base SPI base pointer - * @param mask Interrupt need to be cleared - * The parameter could be any combination of the following values: - * @arg kSPI_RxFullAndModfInterruptEnable - * @arg kSPI_TxEmptyInterruptEnable - * @arg kSPI_MatchInterruptEnable - * @arg kSPI_RxFifoNearFullInterruptEnable - * @arg kSPI_TxFifoNearEmptyInterruptEnable - */ -static inline void SPI_ClearInterrupt(SPI_Type *base, uint8_t mask) -{ - base->CI |= mask; -} -#endif /* FSL_FEATURE_SPI_HAS_FIFO */ - -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables the interrupt for the SPI. - * - * @param base SPI base pointer - * @param mask SPI interrupt source. The parameter can be any combination of the following values: - * @arg kSPI_RxFullAndModfInterruptEnable - * @arg kSPI_TxEmptyInterruptEnable - * @arg kSPI_MatchInterruptEnable - * @arg kSPI_RxFifoNearFullInterruptEnable - * @arg kSPI_TxFifoNearEmptyInterruptEnable - */ -void SPI_EnableInterrupts(SPI_Type *base, uint32_t mask); - -/*! - * @brief Disables the interrupt for the SPI. - * - * @param base SPI base pointer - * @param mask SPI interrupt source. The parameter can be any combination of the following values: - * @arg kSPI_RxFullAndModfInterruptEnable - * @arg kSPI_TxEmptyInterruptEnable - * @arg kSPI_MatchInterruptEnable - * @arg kSPI_RxFifoNearFullInterruptEnable - * @arg kSPI_TxFifoNearEmptyInterruptEnable - */ -void SPI_DisableInterrupts(SPI_Type *base, uint32_t mask); - -/*! @} */ - -/*! - * @name DMA Control - * @{ - */ - -#if defined(FSL_FEATURE_SPI_HAS_DMA_SUPPORT) && FSL_FEATURE_SPI_HAS_DMA_SUPPORT -/*! - * @brief Enables the DMA source for SPI. - * - * @param base SPI base pointer - * @param mask SPI DMA source. - * @param enable True means enable DMA, false means disable DMA - */ -static inline void SPI_EnableDMA(SPI_Type *base, uint8_t mask, bool enable) -{ - if (enable) - { - base->C2 |= mask; - } - else - { - base->C2 &= ~mask; - } -} -#endif /* FSL_FEATURE_SPI_HAS_DMA_SUPPORT */ - -/*! - * @brief Gets the SPI tx/rx data register address. - * - * This API is used to provide a transfer address for the SPI DMA transfer configuration. - * - * @param base SPI base pointer - * @return data register address - */ -static inline uint32_t SPI_GetDataRegisterAddress(SPI_Type *base) -{ -#if defined(FSL_FEATURE_SPI_16BIT_TRANSFERS) && FSL_FEATURE_SPI_16BIT_TRANSFERS - return (uint32_t)(&(base->DL)); -#else - return (uint32_t)(&(base->D)); -#endif /* FSL_FEATURE_SPI_16BIT_TRANSFERS */ -} - -/*! @} */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Get the instance for SPI module. - * - * @param base SPI base address - */ -uint32_t SPI_GetInstance(SPI_Type *base); - -/*! - * @brief Sets the pin mode for transfer. - * - * @param base SPI base pointer - * @param pinMode pin mode for transfer AND _spi_pin_mode could get the related configuration. - */ -static inline void SPI_SetPinMode(SPI_Type *base, spi_pin_mode_t pinMode) -{ - /* Clear SPC0 and BIDIROE bit. */ - base->C2 &= (uint8_t) ~(SPI_C2_BIDIROE_MASK | SPI_C2_SPC0_MASK); - /* Set pin mode for transfer. */ - base->C2 |= SPI_C2_BIDIROE((uint8_t)pinMode >> 1U) | SPI_C2_SPC0((uint8_t)pinMode & 1U); -} - -/*! - * @brief Sets the baud rate for SPI transfer. This is only used in master. - * - * @param base SPI base pointer - * @param baudRate_Bps baud rate needed in Hz. - * @param srcClock_Hz SPI source clock frequency in Hz. - */ -void SPI_MasterSetBaudRate(SPI_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz); - -/*! - * @brief Sets the match data for SPI. - * - * The match data is a hardware comparison value. When the value received in the SPI receive data - * buffer equals the hardware comparison value, the SPI Match Flag in the S register (S[SPMF]) sets. - * This can also generate an interrupt if the enable bit sets. - * - * @param base SPI base pointer - * @param matchData Match data. - */ -static inline void SPI_SetMatchData(SPI_Type *base, uint32_t matchData) -{ -#if defined(FSL_FEATURE_SPI_16BIT_TRANSFERS) && FSL_FEATURE_SPI_16BIT_TRANSFERS - base->ML = (uint8_t)matchData & 0xFFU; - base->MH = (uint8_t)(matchData >> 8U) & 0xFFU; -#else - base->M = (uint8_t)matchData; -#endif /* FSL_FEATURE_SPI_16BIT_TRANSFERS */ -} - -#if defined(FSL_FEATURE_SPI_HAS_FIFO) && FSL_FEATURE_SPI_HAS_FIFO -/*! - * @brief Enables or disables the FIFO if there is a FIFO. - * - * @param base SPI base pointer - * @param enable True means enable FIFO, false means disable FIFO. - */ -void SPI_EnableFIFO(SPI_Type *base, bool enable); -#endif - -/*! - * @brief Sends a buffer of data bytes using a blocking method. - * - * @note This function blocks via polling until all bytes have been sent. - * - * @param base SPI base pointer - * @param buffer The data bytes to send - * @param size The number of data bytes to send - * @return kStatus_SPI_Timeout The transfer timed out and was aborted. - */ -status_t SPI_WriteBlocking(SPI_Type *base, uint8_t *buffer, size_t size); - -/*! - * @brief Writes a data into the SPI data register. - * - * @param base SPI base pointer - * @param data needs to be write. - */ -void SPI_WriteData(SPI_Type *base, uint16_t data); - -/*! - * @brief Gets a data from the SPI data register. - * - * @param base SPI base pointer - * @return Data in the register. - */ -uint16_t SPI_ReadData(SPI_Type *base); - -/*! - * @brief Set up the dummy data. - * - * @param base SPI peripheral address. - * @param dummyData Data to be transferred when tx buffer is NULL. - */ -void SPI_SetDummyData(SPI_Type *base, uint8_t dummyData); -/*! @} */ - -/*! - * @name Transactional - * @{ - */ - -/*! - * @brief Initializes the SPI master handle. - * - * This function initializes the SPI master handle which can be used for other SPI master transactional APIs. Usually, - * for a specified SPI instance, call this API once to get the initialized handle. - * - * @param base SPI peripheral base address. - * @param handle SPI handle pointer. - * @param callback Callback function. - * @param userData User data. - */ -void SPI_MasterTransferCreateHandle(SPI_Type *base, - spi_master_handle_t *handle, - spi_master_callback_t callback, - void *userData); - -/*! - * @brief Transfers a block of data using a polling method. - * - * @param base SPI base pointer - * @param xfer pointer to spi_xfer_config_t structure - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_InvalidArgument Input argument is invalid. - */ -status_t SPI_MasterTransferBlocking(SPI_Type *base, spi_transfer_t *xfer); - -/*! - * @brief Performs a non-blocking SPI interrupt transfer. - * - * @note The API immediately returns after transfer initialization is finished. - * Call SPI_GetStatusIRQ() to get the transfer status. - * @note If SPI transfer data frame size is 16 bits, the transfer size cannot be an odd number. - * - * @param base SPI peripheral base address. - * @param handle pointer to spi_master_handle_t structure which stores the transfer state - * @param xfer pointer to spi_xfer_config_t structure - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_InvalidArgument Input argument is invalid. - * @retval kStatus_SPI_Busy SPI is not idle, is running another transfer. - */ -status_t SPI_MasterTransferNonBlocking(SPI_Type *base, spi_master_handle_t *handle, spi_transfer_t *xfer); - -/*! - * @brief Gets the bytes of the SPI interrupt transferred. - * - * @param base SPI peripheral base address. - * @param handle Pointer to SPI transfer handle, this should be a static variable. - * @param count Transferred bytes of SPI master. - * @retval kStatus_SPI_Success Succeed get the transfer count. - * @retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t SPI_MasterTransferGetCount(SPI_Type *base, spi_master_handle_t *handle, size_t *count); - -/*! - * @brief Aborts an SPI transfer using interrupt. - * - * @param base SPI peripheral base address. - * @param handle Pointer to SPI transfer handle, this should be a static variable. - */ -void SPI_MasterTransferAbort(SPI_Type *base, spi_master_handle_t *handle); - -/*! - * @brief Interrupts the handler for the SPI. - * - * @param base SPI peripheral base address. - * @param handle pointer to spi_master_handle_t structure which stores the transfer state. - */ -void SPI_MasterTransferHandleIRQ(SPI_Type *base, spi_master_handle_t *handle); - -/*! - * @brief Initializes the SPI slave handle. - * - * This function initializes the SPI slave handle which can be used for other SPI slave transactional APIs. Usually, - * for a specified SPI instance, call this API once to get the initialized handle. - * - * @param base SPI peripheral base address. - * @param handle SPI handle pointer. - * @param callback Callback function. - * @param userData User data. - */ -void SPI_SlaveTransferCreateHandle(SPI_Type *base, - spi_slave_handle_t *handle, - spi_slave_callback_t callback, - void *userData); - -/*! - * @brief Performs a non-blocking SPI slave interrupt transfer. - * - * @note The API returns immediately after the transfer initialization is finished. - * Call SPI_GetStatusIRQ() to get the transfer status. - * @note If SPI transfer data frame size is 16 bits, the transfer size cannot be an odd number. - * - * @param base SPI peripheral base address. - * @param handle pointer to spi_slave_handle_t structure which stores the transfer state - * @param xfer pointer to spi_xfer_config_t structure - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_InvalidArgument Input argument is invalid. - * @retval kStatus_SPI_Busy SPI is not idle, is running another transfer. - */ -status_t SPI_SlaveTransferNonBlocking(SPI_Type *base, spi_slave_handle_t *handle, spi_transfer_t *xfer); - -/*! - * @brief Gets the bytes of the SPI interrupt transferred. - * - * @param base SPI peripheral base address. - * @param handle Pointer to SPI transfer handle, this should be a static variable. - * @param count Transferred bytes of SPI slave. - * @retval kStatus_SPI_Success Succeed get the transfer count. - * @retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -static inline status_t SPI_SlaveTransferGetCount(SPI_Type *base, spi_slave_handle_t *handle, size_t *count) -{ - return SPI_MasterTransferGetCount(base, handle, count); -} - -/*! - * @brief Aborts an SPI slave transfer using interrupt. - * - * @param base SPI peripheral base address. - * @param handle Pointer to SPI transfer handle, this should be a static variable. - */ -static inline void SPI_SlaveTransferAbort(SPI_Type *base, spi_slave_handle_t *handle) -{ - SPI_MasterTransferAbort(base, handle); -} - -/*! - * @brief Interrupts a handler for the SPI slave. - * - * @param base SPI peripheral base address. - * @param handle pointer to spi_slave_handle_t structure which stores the transfer state - */ -void SPI_SlaveTransferHandleIRQ(SPI_Type *base, spi_slave_handle_t *handle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @} */ - -#endif /* FSL_SPI_H_*/ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_spi_dma.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_spi_dma.c deleted file mode 100644 index c3439e66588..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_spi_dma.c +++ /dev/null @@ -1,335 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2017, 2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_spi_dma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.spi_dma" -#endif - -/*handle; - SPI_Type *base = privHandle->base; - - /* Disable Tx dma */ - SPI_EnableDMA(base, (uint8_t)kSPI_TxDmaEnable, false); - - /* Stop DMA transfer */ - DMA_StopTransfer(spiHandle->txHandle); - - /* change the state */ - spiHandle->txInProgress = false; - - /* All finished, call the callback */ - if ((spiHandle->txInProgress == false) && (spiHandle->rxInProgress == false)) - { - spiHandle->state = (uint32_t)kSPI_Idle; - if (spiHandle->callback != NULL) - { - (spiHandle->callback)(base, spiHandle, kStatus_Success, spiHandle->userData); - } - } -} - -static void SPI_RxDMACallback(dma_handle_t *handle, void *userData) -{ - spi_dma_private_handle_t *privHandle = (spi_dma_private_handle_t *)userData; - spi_dma_handle_t *spiHandle = privHandle->handle; - SPI_Type *base = privHandle->base; - - /* Disable Tx dma */ - SPI_EnableDMA(base, (uint8_t)kSPI_RxDmaEnable, false); - - /* Stop DMA transfer */ - DMA_StopTransfer(spiHandle->rxHandle); - - /* change the state */ - spiHandle->rxInProgress = false; - - /* All finished, call the callback */ - if ((spiHandle->txInProgress == false) && (spiHandle->rxInProgress == false)) - { - spiHandle->state = (uint32_t)kSPI_Idle; - if (spiHandle->callback != NULL) - { - (spiHandle->callback)(base, spiHandle, kStatus_Success, spiHandle->userData); - } - } -} - -/*! - * brief Initialize the SPI master DMA handle. - * - * This function initializes the SPI master DMA handle which can be used for other SPI master transactional APIs. - * Usually, for a specified SPI instance, user need only call this API once to get the initialized handle. - * - * param base SPI peripheral base address. - * param handle SPI handle pointer. - * param callback User callback function called at the end of a transfer. - * param userData User data for callback. - * param txHandle DMA handle pointer for SPI Tx, the handle shall be static allocated by users. - * param rxHandle DMA handle pointer for SPI Rx, the handle shall be static allocated by users. - */ -void SPI_MasterTransferCreateHandleDMA(SPI_Type *base, - spi_dma_handle_t *handle, - spi_dma_callback_t callback, - void *userData, - dma_handle_t *txHandle, - dma_handle_t *rxHandle) -{ - assert(handle != NULL); - uint32_t instance = SPI_GetInstance(base); - - /* Zero the handle */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Set spi base to handle */ - handle->txHandle = txHandle; - handle->rxHandle = rxHandle; - handle->callback = callback; - handle->userData = userData; - - /* Set SPI state to idle */ - handle->state = (uint32_t)kSPI_Idle; - - /* Set handle to global state */ - s_dmaPrivateHandle[instance].base = base; - s_dmaPrivateHandle[instance].handle = handle; - -/* Compute internal state */ -#if defined(FSL_FEATURE_SPI_16BIT_TRANSFERS) && (FSL_FEATURE_SPI_16BIT_TRANSFERS) - handle->bytesPerFrame = ((base->C2 & SPI_C2_SPIMODE_MASK) >> SPI_C2_SPIMODE_SHIFT) + 1U; -#else - handle->bytesPerFrame = 1U; -#endif /* FSL_FEATURE_SPI_16BIT_TRANSFERS */ - -#if defined(FSL_FEATURE_SPI_HAS_FIFO) && (FSL_FEATURE_SPI_HAS_FIFO) - /* If using DMA, disable FIFO, as the FIFO may cause data loss if the data size is not integer - times of 2bytes. As SPI cannot set watermark to 0, only can set to 1/2 FIFO size or 3/4 FIFO - size. */ - if (FSL_FEATURE_SPI_FIFO_SIZEn(base) != 0) - { - base->C3 &= (uint8_t)(~SPI_C3_FIFOMODE_MASK); - } - -#endif /* FSL_FEATURE_SPI_HAS_FIFO */ - - /* Install callback for Tx dma channel */ - DMA_SetCallback(handle->txHandle, SPI_TxDMACallback, &s_dmaPrivateHandle[instance]); - DMA_SetCallback(handle->rxHandle, SPI_RxDMACallback, &s_dmaPrivateHandle[instance]); -} - -/*! - * brief Perform a non-blocking SPI transfer using DMA. - * - * note This interface returned immediately after transfer initiates, users should call - * SPI_GetTransferStatus to poll the transfer status to check whether SPI transfer finished. - * - * param base SPI peripheral base address. - * param handle SPI DMA handle pointer. - * param xfer Pointer to dma transfer structure. - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_InvalidArgument Input argument is invalid. - * retval kStatus_SPI_Busy SPI is not idle, is running another transfer. - */ -status_t SPI_MasterTransferDMA(SPI_Type *base, spi_dma_handle_t *handle, spi_transfer_t *xfer) -{ - assert((handle != NULL) && (xfer != NULL)); - - dma_transfer_config_t config = {0}; - - /* Check if the device is busy */ - if (handle->state == (uint32_t)kSPI_Busy) - { - return (status_t)kStatus_SPI_Busy; - } - - /* Check if input parameter invalid */ - if (((xfer->txData == NULL) && (xfer->rxData == NULL)) || (xfer->dataSize == 0U)) - { - return (status_t)kStatus_InvalidArgument; - } - - /* Disable SPI and then enable it, this is used to clear S register*/ - SPI_Enable(base, false); - SPI_Enable(base, true); - - /* Configure DMA transfer. */ - if (handle->bytesPerFrame == 1U) - { - config.srcSize = kDMA_Transfersize8bits; - config.destSize = kDMA_Transfersize8bits; - } - else - { - config.srcSize = kDMA_Transfersize16bits; - config.destSize = kDMA_Transfersize16bits; - } - config.transferSize = xfer->dataSize; - - /* Configure tx transfer DMA */ - config.destAddr = SPI_GetDataRegisterAddress(base); - config.enableDestIncrement = false; - /* Configure DMA channel */ - if (xfer->txData != NULL) - { - config.enableSrcIncrement = true; - config.srcAddr = (uint32_t)(xfer->txData); - } - else - { - /* Disable the source increasement and source set to dummyData */ - config.enableSrcIncrement = false; - config.srcAddr = (uint32_t)(&g_spiDummyData[SPI_GetInstance(base)]); - } - (void)DMA_SubmitTransfer(handle->txHandle, &config, 1U); - - /* - * Configure rx transfer DMA. - * To make sure TX data has been sent out to bus, SPI DMA driver - * checks the RX data count. When the RX data reaches the - * desired count, it means TX data has been sent out to bus. - * So DMA RX is enabled even when RX data is not desired, - * and the data is saved to variable and dropped. - */ - config.srcAddr = SPI_GetDataRegisterAddress(base); - config.enableSrcIncrement = false; - - if (xfer->rxData != NULL) - { - config.destAddr = (uint32_t)(xfer->rxData); - config.enableDestIncrement = true; - } - else - { - config.destAddr = (uint32_t)(&s_spiDmaRxDrop); - config.enableDestIncrement = false; - } - (void)DMA_SubmitTransfer(handle->rxHandle, &config, (uint32_t)kDMA_EnableInterrupt); - - /* Change the state of handle */ - handle->transferSize = xfer->dataSize; - handle->state = (uint32_t)kSPI_Busy; - - /* Start Rx transfer */ - handle->rxInProgress = true; - SPI_EnableDMA(base, (uint8_t)kSPI_RxDmaEnable, true); - DMA_StartTransfer(handle->rxHandle); - - /* Always start Tx transfer */ - handle->txInProgress = true; - SPI_EnableDMA(base, (uint8_t)kSPI_TxDmaEnable, true); - DMA_StartTransfer(handle->txHandle); - - return kStatus_Success; -} - -/*! - * brief Get the transferred bytes for SPI slave DMA. - * - * param base SPI peripheral base address. - * param handle SPI DMA handle pointer. - * param count Transferred bytes. - * retval kStatus_SPI_Success Succeed get the transfer count. - * retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t SPI_MasterTransferGetCountDMA(SPI_Type *base, spi_dma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - status_t status = kStatus_Success; - - if (handle->state != (uint32_t)kSPI_Busy) - { - status = kStatus_NoTransferInProgress; - } - else - { - if (handle->rxInProgress) - { - *count = handle->transferSize - DMA_GetRemainingBytes(handle->rxHandle->base, handle->rxHandle->channel); - } - else - { - *count = handle->transferSize - DMA_GetRemainingBytes(handle->txHandle->base, handle->txHandle->channel); - } - } - - return status; -} - -/*! - * brief Abort a SPI transfer using DMA. - * - * param base SPI peripheral base address. - * param handle SPI DMA handle pointer. - */ -void SPI_MasterTransferAbortDMA(SPI_Type *base, spi_dma_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable dma */ - DMA_StopTransfer(handle->txHandle); - DMA_StopTransfer(handle->rxHandle); - - /* Disable DMA enable bit */ - SPI_EnableDMA(base, (uint8_t)kSPI_DmaAllEnable, false); - - /* Set the handle state */ - handle->txInProgress = false; - handle->rxInProgress = false; - handle->state = (uint32_t)kSPI_Idle; -} diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_spi_dma.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_spi_dma.h deleted file mode 100644 index 5b42798811a..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_spi_dma.h +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_SPI_DMA_H_ -#define FSL_SPI_DMA_H_ - -#include "fsl_spi.h" -#include "fsl_dma.h" - -/*! - * @addtogroup spi_dma_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief SPI DMA driver version. */ -#define FSL_SPI_DMA_DRIVER_VERSION (MAKE_VERSION(2, 1, 1)) -/*! @} */ - -typedef struct _spi_dma_handle spi_dma_handle_t; - -/*! @brief SPI DMA callback called at the end of transfer. */ -typedef void (*spi_dma_callback_t)(SPI_Type *base, spi_dma_handle_t *handle, status_t status, void *userData); - -/*! @brief SPI DMA transfer handle, users should not touch the content of the handle.*/ -struct _spi_dma_handle -{ - bool txInProgress; /*!< Send transfer finished */ - bool rxInProgress; /*!< Receive transfer finished */ - dma_handle_t *txHandle; /*!< DMA handler for SPI send */ - dma_handle_t *rxHandle; /*!< DMA handler for SPI receive */ - uint8_t bytesPerFrame; /*!< Bytes in a frame for SPI transfer */ - spi_dma_callback_t callback; /*!< Callback for SPI DMA transfer */ - void *userData; /*!< User Data for SPI DMA callback */ - uint32_t state; /*!< Internal state of SPI DMA transfer */ - size_t transferSize; /*!< Bytes need to be transfer */ -}; - -/******************************************************************************* - * APIs - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name DMA Transactional - * @{ - */ - -/*! - * @brief Initialize the SPI master DMA handle. - * - * This function initializes the SPI master DMA handle which can be used for other SPI master transactional APIs. - * Usually, for a specified SPI instance, user need only call this API once to get the initialized handle. - * - * @param base SPI peripheral base address. - * @param handle SPI handle pointer. - * @param callback User callback function called at the end of a transfer. - * @param userData User data for callback. - * @param txHandle DMA handle pointer for SPI Tx, the handle shall be static allocated by users. - * @param rxHandle DMA handle pointer for SPI Rx, the handle shall be static allocated by users. - */ -void SPI_MasterTransferCreateHandleDMA(SPI_Type *base, - spi_dma_handle_t *handle, - spi_dma_callback_t callback, - void *userData, - dma_handle_t *txHandle, - dma_handle_t *rxHandle); - -/*! - * @brief Perform a non-blocking SPI transfer using DMA. - * - * @note This interface returned immediately after transfer initiates, users should call - * SPI_GetTransferStatus to poll the transfer status to check whether SPI transfer finished. - * - * @param base SPI peripheral base address. - * @param handle SPI DMA handle pointer. - * @param xfer Pointer to dma transfer structure. - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_InvalidArgument Input argument is invalid. - * @retval kStatus_SPI_Busy SPI is not idle, is running another transfer. - */ -status_t SPI_MasterTransferDMA(SPI_Type *base, spi_dma_handle_t *handle, spi_transfer_t *xfer); - -/*! - * @brief Abort a SPI transfer using DMA. - * - * @param base SPI peripheral base address. - * @param handle SPI DMA handle pointer. - */ -void SPI_MasterTransferAbortDMA(SPI_Type *base, spi_dma_handle_t *handle); - -/*! - * @brief Get the transferred bytes for SPI slave DMA. - * - * @param base SPI peripheral base address. - * @param handle SPI DMA handle pointer. - * @param count Transferred bytes. - * @retval kStatus_SPI_Success Succeed get the transfer count. - * @retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t SPI_MasterTransferGetCountDMA(SPI_Type *base, spi_dma_handle_t *handle, size_t *count); - -/*! - * @brief Initialize the SPI slave DMA handle. - * - * This function initializes the SPI slave DMA handle which can be used for other SPI master transactional APIs. - * Usually, for a specified SPI instance, user need only call this API once to get the initialized handle. - * - * @param base SPI peripheral base address. - * @param handle SPI handle pointer. - * @param callback User callback function called at the end of a transfer. - * @param userData User data for callback. - * @param txHandle DMA handle pointer for SPI Tx, the handle shall be static allocated by users. - * @param rxHandle DMA handle pointer for SPI Rx, the handle shall be static allocated by users. - */ -static inline void SPI_SlaveTransferCreateHandleDMA(SPI_Type *base, - spi_dma_handle_t *handle, - spi_dma_callback_t callback, - void *userData, - dma_handle_t *txHandle, - dma_handle_t *rxHandle) -{ - SPI_MasterTransferCreateHandleDMA(base, handle, callback, userData, txHandle, rxHandle); -} - -/*! - * @brief Perform a non-blocking SPI transfer using DMA. - * - * @note This interface returned immediately after transfer initiates, users should call - * SPI_GetTransferStatus to poll the transfer status to check whether SPI transfer finished. - * - * @param base SPI peripheral base address. - * @param handle SPI DMA handle pointer. - * @param xfer Pointer to dma transfer structure. - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_InvalidArgument Input argument is invalid. - * @retval kStatus_SPI_Busy SPI is not idle, is running another transfer. - */ -static inline status_t SPI_SlaveTransferDMA(SPI_Type *base, spi_dma_handle_t *handle, spi_transfer_t *xfer) -{ - return SPI_MasterTransferDMA(base, handle, xfer); -} - -/*! - * @brief Abort a SPI transfer using DMA. - * - * @param base SPI peripheral base address. - * @param handle SPI DMA handle pointer. - */ -static inline void SPI_SlaveTransferAbortDMA(SPI_Type *base, spi_dma_handle_t *handle) -{ - SPI_MasterTransferAbortDMA(base, handle); -} - -/*! - * @brief Get the transferred bytes for SPI slave DMA. - * - * @param base SPI peripheral base address. - * @param handle SPI DMA handle pointer. - * @param count Transferred bytes. - * @retval kStatus_SPI_Success Succeed get the transfer count. - * @retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -static inline status_t SPI_SlaveTransferGetCountDMA(SPI_Type *base, spi_dma_handle_t *handle, size_t *count) -{ - return SPI_MasterTransferGetCountDMA(base, handle, count); -} - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ -#endif diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_tpm.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_tpm.c deleted file mode 100644 index 750371361b6..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_tpm.c +++ /dev/null @@ -1,1144 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_tpm.h" - -/* - * $Coverage Justification Reference$ - * - * $Justification tpm_c_ref_1$ - * Hardware limitations make this code impossible to implement. - * - * $Justification tpm_c_ref_2$ - * Because the incoming base is invalid, the second judgment is not continued after the first condition - * is established. - * - * $Justification tpm_c_ref_3$ - * Hardware limitations, the 32-bit counter register makes counterMax = 0xffffffffu, - * and the mod vlue can't be greater than or equal to counterMax after the operation. - * - * $Justification tpm_c_ref_4$ - * If the incoming base can not make (1U == (uint8_t)FSL_FEATURE_TPM_POL_HAS_EFFECTn(base) true, - * the subsequent register operation is incorrect. - * - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.tpm" -#endif - -#define TPM_COMBINE_SHIFT (8U) - -#if defined(TPM_RSTS) -#define TPM_RESETS_ARRAY TPM_RSTS -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to TPM bases for each instance. */ -static TPM_Type *const s_tpmBases[] = TPM_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to TPM clocks for each instance. */ -static const clock_ip_name_t s_tpmClocks[] = TPM_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/* Array of TPM callback function pointer. */ -static tpm_callback_t s_tpmCallback[ARRAY_SIZE(s_tpmBases)]; - -/* Array to map TPM instance to IRQ number. */ -static const IRQn_Type s_tpmIRQ[] = TPM_IRQS; - -#if defined(TPM_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_tpmResets[] = TPM_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -/*! - * brief Gets the instance from the base address - * - * param base TPM peripheral base address - * return The TPM instance - */ -uint32_t TPM_GetInstance(TPM_Type *base) -{ - uint32_t instance; - uint32_t tpmArrayCount = (sizeof(s_tpmBases) / sizeof(s_tpmBases[0])); - - /* Find the instance index from base address mappings. */ - /* - * $Branch Coverage Justification$ - * (instance >= tpmArrayCount) not covered. - * The peripheral base address is always valid. - */ - for (instance = 0; instance < tpmArrayCount; instance++) - { - if (s_tpmBases[instance] == base) - { - break; - } - } - - assert(instance < tpmArrayCount); - - return instance; -} - -/*! - * brief Ungates the TPM clock and configures the peripheral for basic operation. - * - * note This API should be called at the beginning of the application using the TPM driver. - * - * param base TPM peripheral base address - * param config Pointer to user's TPM config structure. - */ -void TPM_Init(TPM_Type *base, const tpm_config_t *config) -{ - assert(NULL != config); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the module clock */ - (void)CLOCK_EnableClock(s_tpmClocks[TPM_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(TPM_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_tpmResets[TPM_GetInstance(base)]); -#endif - -#if defined(FSL_FEATURE_TPM_HAS_GLOBAL) && FSL_FEATURE_TPM_HAS_GLOBAL - /* TPM reset is available on certain SoC's */ - TPM_Reset(base); -#endif - - /* Set the clock prescale factor */ - base->SC = TPM_SC_PS(config->prescale); -#if !(defined(FSL_FEATURE_TPM_HAS_NO_CONF) && FSL_FEATURE_TPM_HAS_NO_CONF) - /* Setup the counter operation */ - base->CONF = TPM_CONF_DOZEEN(config->enableDoze) | -#if defined(FSL_FEATURE_TPM_HAS_GLOBAL_TIME_BASE_EN) && FSL_FEATURE_TPM_HAS_GLOBAL_TIME_BASE_EN - TPM_CONF_GTBEEN(config->useGlobalTimeBase) | -#endif -#if defined(FSL_FEATURE_TPM_HAS_GLOBAL_TIME_BASE_SYNC) && FSL_FEATURE_TPM_HAS_GLOBAL_TIME_BASE_SYNC - TPM_CONF_GTBSYNC(config->syncGlobalTimeBase) | -#endif - TPM_CONF_CROT(config->enableReloadOnTrigger) | - TPM_CONF_CSOT(config->enableStartOnTrigger) | TPM_CONF_CSOO(config->enableStopOnOverflow) | -#if defined(FSL_FEATURE_TPM_HAS_PAUSE_COUNTER_ON_TRIGGER) && FSL_FEATURE_TPM_HAS_PAUSE_COUNTER_ON_TRIGGER - TPM_CONF_CPOT(config->enablePauseOnTrigger) | -#endif -#if defined(FSL_FEATURE_TPM_HAS_EXTERNAL_TRIGGER_SELECTION) && FSL_FEATURE_TPM_HAS_EXTERNAL_TRIGGER_SELECTION - TPM_CONF_TRGSRC(config->triggerSource) | TPM_CONF_TRGPOL(config->extTriggerPolarity) | -#endif - TPM_CONF_TRGSEL(config->triggerSelect); - if (true == config->enableDebugMode) - { - base->CONF |= TPM_CONF_DBGMODE_MASK; - } - else - { - base->CONF &= ~TPM_CONF_DBGMODE_MASK; - } -#endif -#if defined(FSL_FEATURE_TPM_HAS_POL) && FSL_FEATURE_TPM_HAS_POL - base->POL = config->chnlPolarity; -#endif -} - -/*! - * brief Stops the counter and gates the TPM clock - * - * param base TPM peripheral base address - */ -void TPM_Deinit(TPM_Type *base) -{ -#if defined(FSL_FEATURE_TPM_HAS_SC_CLKS) && FSL_FEATURE_TPM_HAS_SC_CLKS - /* Stop the counter */ - base->SC &= ~TPM_SC_CLKS_MASK; -#else - /* Stop the counter */ - base->SC &= ~TPM_SC_CMOD_MASK; -#endif -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate the TPM clock */ - (void)CLOCK_DisableClock(s_tpmClocks[TPM_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Fill in the TPM config struct with the default settings - * - * The default values are: - * code - * config->prescale = kTPM_Prescale_Divide_1; - * config->useGlobalTimeBase = false; - * config->syncGlobalTimeBase = false; - * config->dozeEnable = false; - * config->dbgMode = false; - * config->enableReloadOnTrigger = false; - * config->enableStopOnOverflow = false; - * config->enableStartOnTrigger = false; - *#if FSL_FEATURE_TPM_HAS_PAUSE_COUNTER_ON_TRIGGER - * config->enablePauseOnTrigger = false; - *#endif - * config->triggerSelect = kTPM_Trigger_Select_0; - *#if FSL_FEATURE_TPM_HAS_EXTERNAL_TRIGGER_SELECTION - * config->triggerSource = kTPM_TriggerSource_External; - * config->extTriggerPolarity = kTPM_ExtTrigger_Active_High; - *#endif - *#if defined(FSL_FEATURE_TPM_HAS_POL) && FSL_FEATURE_TPM_HAS_POL - * config->chnlPolarity = 0U; - *#endif - * endcode - * param config Pointer to user's TPM config structure. - */ -void TPM_GetDefaultConfig(tpm_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - /* TPM clock divide by 1 */ - config->prescale = kTPM_Prescale_Divide_1; -#if !(defined(FSL_FEATURE_TPM_HAS_NO_CONF) && FSL_FEATURE_TPM_HAS_NO_CONF) - /* Use internal TPM counter as timebase */ - config->useGlobalTimeBase = false; - /* Disable internal TPM counter sync with global timebase */ - config->syncGlobalTimeBase = false; - /* TPM counter continues in doze mode */ - config->enableDoze = false; - /* TPM counter pauses when in debug mode */ - config->enableDebugMode = false; - /* TPM counter will not be reloaded on input trigger */ - config->enableReloadOnTrigger = false; - /* TPM counter continues running after overflow */ - config->enableStopOnOverflow = false; - /* TPM counter starts immediately once it is enabled */ - config->enableStartOnTrigger = false; -#if defined(FSL_FEATURE_TPM_HAS_PAUSE_COUNTER_ON_TRIGGER) && FSL_FEATURE_TPM_HAS_PAUSE_COUNTER_ON_TRIGGER - config->enablePauseOnTrigger = false; -#endif - /* Choose trigger select 0 as input trigger for controlling counter operation */ - config->triggerSelect = kTPM_Trigger_Select_0; -#if defined(FSL_FEATURE_TPM_HAS_EXTERNAL_TRIGGER_SELECTION) && FSL_FEATURE_TPM_HAS_EXTERNAL_TRIGGER_SELECTION - /* Choose external trigger source (high active) to control counter operation */ - config->triggerSource = kTPM_TriggerSource_External; - config->extTriggerPolarity = kTPM_ExtTrigger_Active_High; -#endif -#if defined(FSL_FEATURE_TPM_HAS_POL) && FSL_FEATURE_TPM_HAS_POL - /* Default channel polarity is active high */ - config->chnlPolarity = 0U; -#endif -#endif -} - -/*! - * brief Calculates the counter clock prescaler. - * - * This function calculates the values for SC[PS]. - * - * param base TPM peripheral base address - * param counterPeriod_Hz The desired frequency in Hz which corresponding to the time when the counter reaches the - * mod value param srcClock_Hz TPM counter clock in Hz - * - * return Calculated clock prescaler value. - */ -tpm_clock_prescale_t TPM_CalculateCounterClkDiv(TPM_Type *base, uint32_t counterPeriod_Hz, uint32_t srcClock_Hz) -{ - uint32_t counterMax = TPM_MAX_COUNTER_VALUE(base); - uint32_t i; - assert(((srcClock_Hz / 2U) > counterPeriod_Hz) && ((srcClock_Hz / 128U / counterMax) <= counterPeriod_Hz)); - - for (i = 0U; i < (uint32_t)kTPM_Prescale_Divide_128; i++) - { - if ((srcClock_Hz / (1UL << i) / counterMax) < counterPeriod_Hz) - { - break; - } - } - return (tpm_clock_prescale_t)i; -} - -/*! - * brief Set parameters for PWM duty cycle and edges for a single tpm channel - * - * User calls this function to configure the mode, duty cycle and edge of a single PWM signal. - * - * param base TPM peripheral base address - * param mod PWM period - * param mode PWM operation mode, options available in enumeration ::tpm_pwm_mode_t - * param chnlParams A structure for configuring PWM channel parameters, used to configure the channel. - * - * return kStatus_Success if the PWM setup was successful, - * kStatus_Error on failure - */ -static status_t TPM_SetupSinglePwmChannel(TPM_Type *base, - uint32_t mod, - tpm_pwm_mode_t mode, - tpm_chnl_pwm_signal_param_t chnlParams) -{ - uint32_t cnv; - uint32_t counterMax = TPM_MAX_COUNTER_VALUE(base); - uint8_t controlBits; - uint8_t chnlId; - - /* MSnB:MSnA field value always be 10, ELSnB:ELSnA field value should config according to the channel params */ -#if defined(FSL_FEATURE_TPM_HAS_PAUSE_LEVEL_SELECT) && FSL_FEATURE_TPM_HAS_PAUSE_LEVEL_SELECT - controlBits = - (uint8_t)((uint32_t)kTPM_ChnlMSBMask | TPM_CnSC_ELSB(chnlParams.pauseLevel) | TPM_CnSC_ELSA(chnlParams.level)); -#else - controlBits = ((uint8_t)kTPM_ChnlMSBMask | ((uint8_t)chnlParams.level << TPM_CnSC_ELSA_SHIFT)); -#endif - chnlId = (uint8_t)chnlParams.chnlNumber; - /* Return error if requested dutycycle/chnlNumber is greater than the max allowed */ - /* - * $Branch Coverage Justification$ - * (-1 == (int8_t)FSL_FEATURE_TPM_CHANNEL_COUNTn(base)) not covered. - * This function is called inside the TPM_SetupPwm() function. - * If you enter an invalid base, the function will not work properly. - */ - if ((chnlId >= (uint8_t)FSL_FEATURE_TPM_CHANNEL_COUNTn(base)) || - /* - * $Branch Coverage Justification$ - * (chnlId >= (uint8_t)FSL_FEATURE_TPM_CHANNEL_COUNTn(base)) not covered. $ref tpm_c_ref_2$. - */ - (-1 == (int8_t)FSL_FEATURE_TPM_CHANNEL_COUNTn(base))) - { - return kStatus_InvalidArgument; - } - /* Return error if requested dutycycle is greater than the max allowed or MOD equal to 0xFFFF when it want get a - * 100% duty cycle PWM signal*/ - /* - * $Branch Coverage Justification$ - * (mod == counterMax) not covered. $ref tpm_c_ref_3$. - */ - if (((chnlParams.dutyCyclePercent == 100U) && (mod == counterMax)) || (chnlParams.dutyCyclePercent > 100U)) - { - return kStatus_OutOfRange; - } - -#if defined(FSL_FEATURE_TPM_HAS_COMBINE) && FSL_FEATURE_TPM_HAS_COMBINE - if (mode == kTPM_CombinedPwm) - { - /* Check added for combined mode */ - /* - * $Branch Coverage Justification$ - * (chnlId >= ((uint8_t)FSL_FEATURE_TPM_CHANNEL_COUNTn(base) / 2U)) not covered. $ref tpm_c_ref_2$. - */ - if ((chnlId >= ((uint8_t)FSL_FEATURE_TPM_CHANNEL_COUNTn(base) / 2U)) || - (1U != (uint8_t)FSL_FEATURE_TPM_COMBINE_HAS_EFFECTn(base))) - { - /* The instance should support combine mode and the channel number should be the pair number */ - return kStatus_InvalidArgument; - } - if (((chnlParams.firstEdgeDelayPercent + chnlParams.dutyCyclePercent) > 100U) || - ((chnlParams.firstEdgeDelayPercent > 0U) && (chnlParams.dutyCyclePercent == 0U)) || - ((chnlParams.firstEdgeDelayPercent == 0U) && (chnlParams.deadTimeValue[0] != 0U))) - { - /* Return error if the following situation occurs : - * firstEdgeDelayPercent + dutyCyclePercent > 100 - * firstEdgeDelayPercent > 0 and dutyCyclePercent == 0 - * firstEdgeDelayPercent == 0 and deadTimeValue[0] != 0 - */ - return kStatus_OutOfRange; - } - /* Configure delay of the first edge */ - uint32_t cnvFirstEdge; - /* Configure dutycycle */ - if (chnlParams.dutyCyclePercent == 0U) - { - cnvFirstEdge = mod + 1U; - cnv = 0; - } - else if (chnlParams.dutyCyclePercent == 100U) - { - cnvFirstEdge = 0U; - cnv = mod + 1U; - } - else - { - cnvFirstEdge = (mod * chnlParams.firstEdgeDelayPercent) / 100U; - cnv = (mod * chnlParams.dutyCyclePercent) / 100U; - } - - /* Set the combine bit for the channel pair */ - base->COMBINE |= 1UL << (TPM_COMBINE_SHIFT * chnlId); - - chnlId *= 2U; - /* Set deadtime insertion for the channel pair using channel filter register */ - uint32_t filterVal = base->FILTER; - /* Clear the channel pair's filter values */ - filterVal &= - ~(((uint32_t)TPM_FILTER_CH0FVAL_MASK | TPM_FILTER_CH1FVAL_MASK) << (chnlId * TPM_FILTER_CH1FVAL_SHIFT)); - /* Shift the deadtime insertion value to the right place in the register */ - filterVal |= (TPM_FILTER_CH0FVAL(chnlParams.deadTimeValue[0]) | TPM_FILTER_CH1FVAL(chnlParams.deadTimeValue[1])) - << (chnlId * TPM_FILTER_CH1FVAL_SHIFT); - base->FILTER = filterVal; - - /* When switching mode, disable channel n first */ - TPM_DisableChannel(base, (tpm_chnl_t)chnlId); - /* Set the requested PWM mode for channel n, under combine PWM mode, the active level is opposite of - * edge-aligned mode */ - TPM_EnableChannel(base, (tpm_chnl_t)chnlId, controlBits ^ TPM_CnSC_ELSA_MASK); - /* Set the channel n value */ - do - { - base->CONTROLS[chnlId].CnV = cnvFirstEdge; - /* - * $Branch Coverage Justification$ - * (cnvFirstEdge != base->CONTROLS[chnlId].CnV) not covered. $ref tpm_c_ref_1$. - */ - } while (cnvFirstEdge != base->CONTROLS[chnlId].CnV); - - chnlId += 1U; - /* When switching mode, disable channel n + 1 */ - TPM_DisableChannel(base, (tpm_chnl_t)chnlId); -#if defined(FSL_FEATURE_TPM_HAS_PAUSE_LEVEL_SELECT) && FSL_FEATURE_TPM_HAS_PAUSE_LEVEL_SELECT - /* Select the pause level for second channel */ - controlBits = (uint8_t)((uint32_t)kTPM_ChnlMSBMask | TPM_CnSC_ELSB(chnlParams.secPauseLevel) | - TPM_CnSC_ELSA(chnlParams.level)); -#endif - /* Set the requested PWM mode for channel n + 1 */ - if (chnlParams.enableComplementary) - { - /* Change the polarity on the second channel get complementary PWM signals */ - TPM_EnableChannel(base, (tpm_chnl_t)chnlId, controlBits); - } - else - { - /* Second channel use same control bits as first channel */ - TPM_EnableChannel(base, (tpm_chnl_t)chnlId, controlBits ^ TPM_CnSC_ELSA_MASK); - } - - /* Set the channel n+1 value */ - do - { - base->CONTROLS[chnlId].CnV = cnvFirstEdge + cnv; - /* - * $Branch Coverage Justification$ - * ((cnvFirstEdge + cnv) != base->CONTROLS[chnlId].CnV) not covered. $ref tpm_c_ref_1$. - */ - } while ((cnvFirstEdge + cnv) != base->CONTROLS[chnlId].CnV); - } - else - { -#endif - /* Configure dutycycle */ - if (chnlParams.dutyCyclePercent == 100U) - { - cnv = mod + 1U; - } - else - { - cnv = (mod * chnlParams.dutyCyclePercent) / 100U; - } - /* Fix ERROR050050 When TPM is configured in EPWM mode as PS = 0, the compare event is missed on - the first reload/overflow after writing 1 to the CnV register and causes an incorrect duty output.*/ -#if (defined(FSL_FEATURE_TPM_HAS_ERRATA_050050) && FSL_FEATURE_TPM_HAS_ERRATA_050050) - assert(!(mode == kTPM_EdgeAlignedPwm && cnv == 1U && (base->SC & TPM_SC_PS_MASK) == kTPM_Prescale_Divide_1)); -#endif - /* When switching mode, disable channel first */ - TPM_DisableChannel(base, (tpm_chnl_t)chnlId); - /* Set the requested PWM mode, output mode MSnB:MSnA field value set to 10 */ - TPM_EnableChannel(base, (tpm_chnl_t)chnlId, controlBits); - do - { - base->CONTROLS[chnlId].CnV = cnv; - /* - * $Branch Coverage Justification$ - * (cnv != base->CONTROLS[chnlId].CnV) not covered. $ref tpm_c_ref_1$. - */ - } while (cnv != base->CONTROLS[chnlId].CnV); - -#if defined(FSL_FEATURE_TPM_HAS_COMBINE) && FSL_FEATURE_TPM_HAS_COMBINE - } -#endif - return kStatus_Success; -} - -/*! - * brief Configures the PWM signal parameters - * - * User calls this function to configure the PWM signals period, mode, dutycycle and edge. Use this - * function to configure all the TPM channels that will be used to output a PWM signal - * - * param base TPM peripheral base address - * param chnlParams Array of PWM channel parameters to configure the channel(s) - * param numOfChnls Number of channels to configure, this should be the size of the array passed in - * param mode PWM operation mode, options available in enumeration ::tpm_pwm_mode_t - * param pwmFreq_Hz PWM signal frequency in Hz - * param srcClock_Hz TPM counter clock in Hz - * - * return kStatus_Success if the PWM setup was successful, - * kStatus_Error on failure - */ -status_t TPM_SetupPwm(TPM_Type *base, - const tpm_chnl_pwm_signal_param_t *chnlParams, - uint8_t numOfChnls, - tpm_pwm_mode_t mode, - uint32_t pwmFreq_Hz, - uint32_t srcClock_Hz) -{ - assert(NULL != chnlParams); - - uint32_t mod = 0U; - uint32_t counterMax = TPM_MAX_COUNTER_VALUE(base); - uint32_t tpmClock = (srcClock_Hz / (1UL << (base->SC & TPM_SC_PS_MASK))); - status_t status = kStatus_Success; - - if ((0U == pwmFreq_Hz) || (0U == srcClock_Hz) || (0U == numOfChnls) || (tpmClock < pwmFreq_Hz)) - { - return kStatus_InvalidArgument; - } - - switch (mode) - { -#if defined(FSL_FEATURE_TPM_HAS_COMBINE) && FSL_FEATURE_TPM_HAS_COMBINE - case kTPM_CombinedPwm: -#endif - case kTPM_EdgeAlignedPwm: - base->SC &= ~TPM_SC_CPWMS_MASK; - mod = (tpmClock / pwmFreq_Hz) - 1U; - - /* - * $Branch Coverage Justification$ - * (mod > counterMax) not covered. $ref tpm_c_tpm_3$. - */ - if ((mod > counterMax) || (mod == 0U)) - { - /* The MOD greater than the maximum allowed (some instanse only support 16-bit counter) or smaller than - 1, probably would require changing clock source to get the desired frequency. */ - status = kStatus_OutOfRange; - } - break; - case kTPM_CenterAlignedPwm: - base->SC |= TPM_SC_CPWMS_MASK; - mod = tpmClock / (pwmFreq_Hz * 2u); - /* - * $Branch Coverage Justification$ - * (mod > counterMax >> 1U) not covered. $ref tpm_c_tpm_3$. - */ - if ((mod > (counterMax >> 1U)) || (mod == 0U)) - { - /* MOD values have additional requirements under center-aligned MODE, it must be kept in the range - * of 0x1 ~ 0x7FFF (under 16-bit counter). */ - status = kStatus_OutOfRange; - } - break; - default: - /* All the cease have been listed above, the default case should not be reached. */ - status = kStatus_InvalidArgument; - break; - } - if (kStatus_Success != status) - { - return status; - } - /* Set the PWM period */ - base->MOD = mod; - - /* Setup each TPM channel */ - for (uint8_t i = 0; i < numOfChnls; i++) - { - /* Setup a single PWM channel */ - status = TPM_SetupSinglePwmChannel(base, mod, mode, *chnlParams); - if (status != kStatus_Success) - { - return status; - } - chnlParams++; - } - -#if defined(FSL_FEATURE_TPM_HAS_QDCTRL) && FSL_FEATURE_TPM_HAS_QDCTRL - /* The TPM's QDCTRL register required to be effective */ - if (1U == (uint8_t)FSL_FEATURE_TPM_QDCTRL_HAS_EFFECTn(base)) - { - /* Clear quadrature Decoder mode because in quadrature Decoder mode PWM doesn't operate*/ - base->QDCTRL &= ~TPM_QDCTRL_QUADEN_MASK; - } -#endif - - return kStatus_Success; -} - -/*! - * brief Update the duty cycle of an active PWM signal - * - * param base TPM peripheral base address - * param chnlNumber The channel number. In combined mode, this represents - * the channel pair number - * param currentPwmMode The current PWM mode set during PWM setup - * param dutyCyclePercent New PWM pulse width, value should be between 0 to 100 - * 0=inactive signal(0% duty cycle)... - * 100=active signal (100% duty cycle) - * return kStatus_Success if the PWM setup was successful, - * kStatus_Error on failure - */ -status_t TPM_UpdatePwmDutycycle(TPM_Type *base, - tpm_chnl_t chnlNumber, - tpm_pwm_mode_t currentPwmMode, - uint8_t dutyCyclePercent) -{ - uint32_t cnv, mod; - uint32_t counterMax = TPM_MAX_COUNTER_VALUE(base); - uint8_t chnlId = (uint8_t)chnlNumber; - - /* Return error if requested chnlNumber is greater than the max allowed */ - /* Return error if requested dutycycle/chnlNumber is greater than the max allowed */ - if ((chnlId >= (uint8_t)FSL_FEATURE_TPM_CHANNEL_COUNTn(base)) || - (-1 == (int8_t)FSL_FEATURE_TPM_CHANNEL_COUNTn(base))) - { - return kStatus_InvalidArgument; - } - /* Get the PWM period */ - mod = base->MOD & counterMax; - /* Return error if requested dutycycle is greater than the max allowed */ - if (((dutyCyclePercent == 100U) && (mod == counterMax)) || (dutyCyclePercent > 100U)) - { - /* MOD can't equal to 0xFFFF otherwise it can't get a 100% duty cycle PWM signal. */ - return kStatus_OutOfRange; - } - -#if defined(FSL_FEATURE_TPM_HAS_COMBINE) && FSL_FEATURE_TPM_HAS_COMBINE - if (currentPwmMode == kTPM_CombinedPwm) - { - /* Check added for combined mode */ - /* - * $Branch Coverage Justification$ - * (chnlId >= ((uint8_t)FSL_FEATURE_TPM_CHANNEL_COUNTn(base) / 2U)) not covered. $ref tpm_c_ref_2$. - */ - if ((chnlId >= ((uint8_t)FSL_FEATURE_TPM_CHANNEL_COUNTn(base) / 2U)) || - (1U != (uint8_t)FSL_FEATURE_TPM_COMBINE_HAS_EFFECTn(base))) - { - /* The instance should support combine mode and the channel number should be the pair number */ - return kStatus_InvalidArgument; - } - uint32_t cnvFirstEdge; - cnv = (mod * dutyCyclePercent) / 100U; - if ((base->CONTROLS[chnlId * 2U].CnV & counterMax) > mod) - { - cnvFirstEdge = 0U; - } - else - { - cnvFirstEdge = base->CONTROLS[chnlId * 2U].CnV & counterMax; - } - - if (((cnvFirstEdge + cnv) > mod) || ((cnv == 0U) && (cnvFirstEdge > 0U))) - { - /* Return error if the following situation occurs : - * firstEdgeDelayPercent + dutyCyclePercent > 100 - * firstEdgeDelayPercent > 0 and dutyCyclePercent == 0 - */ - return kStatus_OutOfRange; - } - if (cnv == mod) - { - /* 100% duty cycle */ - cnv = mod + 1U; - } - else if (cnv == 0U) - { - /* 0% duty cycle */ - cnvFirstEdge = mod + 1U; - } - else - { - ; /* Intentional empty */ - } - - do - { - base->CONTROLS[chnlId * 2U].CnV = cnvFirstEdge; - /* - * $Branch Coverage Justification$ - * (cnvFirstEdge != base->CONTROLS[chnlId * 2U].CnV) not covered. $ref tpm_c_ref_1$. - */ - } while (cnvFirstEdge != base->CONTROLS[chnlId * 2U].CnV); - do - { - base->CONTROLS[(chnlId * 2U) + 1U].CnV = cnvFirstEdge + cnv; - } while ((cnvFirstEdge + cnv) != base->CONTROLS[(chnlId * 2U) + 1U].CnV); - } - else - { -#endif - if (dutyCyclePercent == 100U) - { - cnv = mod + 1U; - } - else - { - cnv = (mod * dutyCyclePercent) / 100U; - } - /* Fix ERROR050050 */ -#if (defined(FSL_FEATURE_TPM_HAS_ERRATA_050050) && FSL_FEATURE_TPM_HAS_ERRATA_050050) - assert(!(currentPwmMode == kTPM_EdgeAlignedPwm && cnv == 1U && - (base->SC & TPM_SC_PS_MASK) == kTPM_Prescale_Divide_1)); -#endif - - do - { - base->CONTROLS[chnlId].CnV = cnv; - /* - * $Branch Coverage Justification$ - * (cnv != base->CONTROLS[chnlId].CnV) not covered. $ref tpm_c_ref_1$. - */ - } while (cnv != base->CONTROLS[chnlId].CnV); - -#if defined(FSL_FEATURE_TPM_HAS_COMBINE) && FSL_FEATURE_TPM_HAS_COMBINE - } -#endif - return kStatus_Success; -} - -/*! - * brief Update the edge level selection for a channel - * - * note When the TPM has PWM pause level select feature (FSL_FEATURE_TPM_HAS_PAUSE_LEVEL_SELECT = 1), the PWM output - * cannot be turned off by selecting the output level. In this case, must use TPM_DisableChannel API to close - * the PWM output. - * - * param base TPM peripheral base address - * param chnlNumber The channel number - * param level The level to be set to the ELSnB:ELSnA field; valid values are 00, 01, 10, 11. - * See the appropriate SoC reference manual for details about this field. - */ -void TPM_UpdateChnlEdgeLevelSelect(TPM_Type *base, tpm_chnl_t chnlNumber, uint8_t level) -{ - assert(((uint8_t)chnlNumber < (uint8_t)FSL_FEATURE_TPM_CHANNEL_COUNTn(base)) && - (-1 != (int8_t)FSL_FEATURE_TPM_CHANNEL_COUNTn(base))); - - uint8_t control = TPM_GetChannelContorlBits(base, chnlNumber); - - /* When switching mode, disable channel first */ - TPM_DisableChannel(base, chnlNumber); - - /* Clear the field and write the new level value */ - control &= ~(uint8_t)(TPM_CnSC_ELSA_MASK | TPM_CnSC_ELSB_MASK); - control |= ((uint8_t)level << TPM_CnSC_ELSA_SHIFT) & (TPM_CnSC_ELSA_MASK | TPM_CnSC_ELSB_MASK); - - /* Enable channle with new level value */ - TPM_EnableChannel(base, chnlNumber, control); -} - -/*! - * brief Enables capturing an input signal on the channel using the function parameters. - * - * When the edge specified in the captureMode argument occurs on the channel, the TPM counter is captured into - * the CnV register. The user has to read the CnV register separately to get this value. - * - * param base TPM peripheral base address - * param chnlNumber The channel number - * param captureMode Specifies which edge to capture - */ -void TPM_SetupInputCapture(TPM_Type *base, tpm_chnl_t chnlNumber, tpm_input_capture_edge_t captureMode) -{ - assert(((uint8_t)chnlNumber < (uint8_t)FSL_FEATURE_TPM_CHANNEL_COUNTn(base)) && - (-1 != (int8_t)FSL_FEATURE_TPM_CHANNEL_COUNTn(base))); - -#if defined(FSL_FEATURE_TPM_HAS_QDCTRL) && FSL_FEATURE_TPM_HAS_QDCTRL - /* The TPM's QDCTRL register required to be effective */ - if (1U == (uint8_t)FSL_FEATURE_TPM_QDCTRL_HAS_EFFECTn(base)) - { - /* Clear quadrature Decoder mode for channel 0 or 1*/ - if (((uint32_t)chnlNumber == 0u) || ((uint32_t)chnlNumber == 1u)) - { - base->QDCTRL &= ~TPM_QDCTRL_QUADEN_MASK; - } - } -#endif - -#if defined(FSL_FEATURE_TPM_HAS_COMBINE) && FSL_FEATURE_TPM_HAS_COMBINE - /* The TPM's COMBINE register required to be effective */ - if (1U == (uint8_t)FSL_FEATURE_TPM_COMBINE_HAS_EFFECTn(base)) - { - /* Clear the combine bit for chnlNumber */ - base->COMBINE &= ~((uint32_t)1U << (((uint32_t)chnlNumber / 2U) * TPM_COMBINE_SHIFT)); - } -#endif - /*Clear CPWMS bit when the input capture mode is selected */ - base->SC &= ~TPM_SC_CPWMS_MASK; - /* When switching mode, disable channel first */ - TPM_DisableChannel(base, chnlNumber); - /* Enable channel with new requested input capture mode */ - TPM_EnableChannel(base, chnlNumber, (uint8_t)captureMode); -} - -/*! - * brief Configures the TPM to generate timed pulses. - * - * When the TPM counter matches the value of compareVal argument (this is written into CnV reg), the channel - * output is changed based on what is specified in the compareMode argument. - * - * param base TPM peripheral base address - * param chnlNumber The channel number - * param compareMode Action to take on the channel output when the compare condition is met - * param compareValue Value to be programmed in the CnV register. - */ -void TPM_SetupOutputCompare(TPM_Type *base, - tpm_chnl_t chnlNumber, - tpm_output_compare_mode_t compareMode, - uint32_t compareValue) -{ - assert(((uint8_t)chnlNumber < (uint8_t)FSL_FEATURE_TPM_CHANNEL_COUNTn(base)) && - (-1 != (int8_t)FSL_FEATURE_TPM_CHANNEL_COUNTn(base))); - -#if defined(FSL_FEATURE_TPM_HAS_QDCTRL) && FSL_FEATURE_TPM_HAS_QDCTRL - /* The TPM's QDCTRL register required to be effective */ - if (1U == (uint8_t)FSL_FEATURE_TPM_QDCTRL_HAS_EFFECTn(base)) - { - /* Clear quadrature Decoder mode for channel 0 or 1 */ - if (((uint32_t)chnlNumber == 0U) || ((uint32_t)chnlNumber == 1U)) - { - base->QDCTRL &= ~TPM_QDCTRL_QUADEN_MASK; - } - } -#endif - - /*Clear CPWMS bit when the output compare mode is selected */ - base->SC &= ~TPM_SC_CPWMS_MASK; - /* When switching mode, disable channel first */ - TPM_DisableChannel(base, chnlNumber); - /* Enable channel with new requested compare mode */ - TPM_EnableChannel(base, chnlNumber, (uint8_t)compareMode); - - /* Setup the compare value */ - do - { - base->CONTROLS[chnlNumber].CnV = compareValue; - /* - * $Branch Coverage Justification$ - * (compareValue != base->CONTROLS[chnlNumber].CnV) not covered. $ref tpm_c_ref_1$. - */ - } while (compareValue != base->CONTROLS[chnlNumber].CnV); -} - -#if defined(FSL_FEATURE_TPM_HAS_COMBINE) && FSL_FEATURE_TPM_HAS_COMBINE -/*! - * brief Configures the dual edge capture mode of the TPM. - * - * This function allows to measure a pulse width of the signal on the input of channel of a - * channel pair. The filter function is disabled if the filterVal argument passed is zero. - * - * param base TPM peripheral base address - * param chnlPairNumber The TPM channel pair number; options are 0, 1, 2, 3 - * param edgeParam Sets up the dual edge capture function - * param filterValue Filter value, specify 0 to disable filter. - */ -void TPM_SetupDualEdgeCapture(TPM_Type *base, - tpm_chnl_t chnlPairNumber, - const tpm_dual_edge_capture_param_t *edgeParam, - uint32_t filterValue) -{ - assert(NULL != edgeParam); - assert(((uint8_t)chnlPairNumber < (uint8_t)FSL_FEATURE_TPM_CHANNEL_COUNTn(base) / 2U) && - (-1 != (int8_t)FSL_FEATURE_TPM_CHANNEL_COUNTn(base))); - assert(1U == (uint8_t)FSL_FEATURE_TPM_COMBINE_HAS_EFFECTn(base)); - - uint32_t reg; - uint32_t u32flag; - uint8_t chnlId = (uint8_t)chnlPairNumber * 2U; - -#if defined(FSL_FEATURE_TPM_HAS_QDCTRL) && FSL_FEATURE_TPM_HAS_QDCTRL - /* The TPM's QDCTRL register required to be effective */ - if (1U == (uint8_t)FSL_FEATURE_TPM_QDCTRL_HAS_EFFECTn(base)) - { - /* Clear quadrature Decoder mode for channel 0 or 1*/ - if (chnlId == 0u) - { - base->QDCTRL &= ~TPM_QDCTRL_QUADEN_MASK; - } - } -#endif - - /* When switching mode, disable channel first */ - TPM_DisableChannel(base, (tpm_chnl_t)chnlId); - chnlId++; - TPM_DisableChannel(base, (tpm_chnl_t)chnlId); - chnlId--; - - /* Now, the registers for input mode can be operated. */ - if (true == edgeParam->enableSwap) - { - u32flag = TPM_COMBINE_COMBINE0_MASK | TPM_COMBINE_COMSWAP0_MASK; - /* Set the combine and swap bits for the channel pair */ - base->COMBINE |= u32flag << (TPM_COMBINE_SHIFT * (uint32_t)chnlPairNumber); - - /* Input filter setup for channel n+1 input */ - reg = base->FILTER; - reg &= ~((uint32_t)TPM_FILTER_CH0FVAL_MASK << (TPM_FILTER_CH1FVAL_SHIFT * (chnlId + 1U))); - reg |= (filterValue << (TPM_FILTER_CH1FVAL_SHIFT * (chnlId + 1U))); - base->FILTER = reg; - } - else - { - reg = base->COMBINE; - /* Clear the swap bit for the channel pair */ - reg &= ~((uint32_t)TPM_COMBINE_COMSWAP0_MASK << ((uint32_t)chnlPairNumber * TPM_COMBINE_COMSWAP0_SHIFT)); - u32flag = TPM_COMBINE_COMBINE0_MASK; - - /* Set the combine bit for the channel pair */ - reg |= u32flag << (TPM_COMBINE_SHIFT * (uint32_t)chnlPairNumber); - base->COMBINE = reg; - - /* Input filter setup for channel n input */ - reg = base->FILTER; - reg &= ~((uint32_t)TPM_FILTER_CH0FVAL_MASK << (TPM_FILTER_CH1FVAL_SHIFT * chnlId)); - reg |= (filterValue << (TPM_FILTER_CH1FVAL_SHIFT * chnlId)); - base->FILTER = reg; - } - - /* Setup the edge detection from channel n and n+1*/ - TPM_EnableChannel(base, (tpm_chnl_t)chnlId, (uint8_t)edgeParam->currChanEdgeMode); - chnlId++; - TPM_EnableChannel(base, (tpm_chnl_t)chnlId, (uint8_t)edgeParam->nextChanEdgeMode); -} -#endif - -#if defined(FSL_FEATURE_TPM_HAS_QDCTRL) && FSL_FEATURE_TPM_HAS_QDCTRL -/*! - * brief Configures the parameters and activates the quadrature decode mode. - * - * param base TPM peripheral base address - * param phaseAParams Phase A configuration parameters - * param phaseBParams Phase B configuration parameters - * param quadMode Selects encoding mode used in quadrature decoder mode - */ -void TPM_SetupQuadDecode(TPM_Type *base, - const tpm_phase_params_t *phaseAParams, - const tpm_phase_params_t *phaseBParams, - tpm_quad_decode_mode_t quadMode) -{ - assert(NULL != phaseAParams); - assert(NULL != phaseBParams); - assert(1U == (uint8_t)FSL_FEATURE_TPM_QDCTRL_HAS_EFFECTn(base)); - - /* Disable channel 0 */ - TPM_DisableChannel(base, kTPM_Chnl_0); - - uint32_t reg; - - /* Set Phase A filter value */ - reg = base->FILTER; - reg &= ~(TPM_FILTER_CH0FVAL_MASK); - reg |= TPM_FILTER_CH0FVAL(phaseAParams->phaseFilterVal); - base->FILTER = reg; - -#if defined(FSL_FEATURE_TPM_HAS_POL) && FSL_FEATURE_TPM_HAS_POL - /* - * $Branch Coverage Justification$ - * (1U != FSL_FEATURE_TPM_QDCTRL_HAS_EFFECTn(base)) not covered. $ref tpm_c_ref_4$. - */ - if (1U == (uint8_t)FSL_FEATURE_TPM_POL_HAS_EFFECTn(base)) - { - /* Set Phase A polarity */ - if (kTPM_QuadPhaseInvert == phaseAParams->phasePolarity) - { - base->POL |= TPM_POL_POL0_MASK; - } - else - { - base->POL &= ~TPM_POL_POL0_MASK; - } - } -#endif - - /* Disable channel 1 */ - TPM_DisableChannel(base, kTPM_Chnl_0); - - /* Set Phase B filter value */ - reg = base->FILTER; - reg &= ~(TPM_FILTER_CH1FVAL_MASK); - reg |= TPM_FILTER_CH1FVAL(phaseBParams->phaseFilterVal); - base->FILTER = reg; -#if defined(FSL_FEATURE_TPM_HAS_POL) && FSL_FEATURE_TPM_HAS_POL - /* - * $Branch Coverage Justification$ - * (1U != FSL_FEATURE_TPM_QDCTRL_HAS_EFFECTn(base)) not covered. $ref tpm_c_ref_4$. - */ - if (1U == (uint8_t)FSL_FEATURE_TPM_POL_HAS_EFFECTn(base)) - { - /* Set Phase B polarity */ - if (kTPM_QuadPhaseInvert == phaseBParams->phasePolarity) - { - base->POL |= TPM_POL_POL1_MASK; - } - else - { - base->POL &= ~TPM_POL_POL1_MASK; - } - } -#endif - - /* Set Quadrature mode */ - reg = base->QDCTRL; - reg &= ~(TPM_QDCTRL_QUADMODE_MASK); - reg |= TPM_QDCTRL_QUADMODE(quadMode); - base->QDCTRL = reg; - - /* Enable Quad decode */ - base->QDCTRL |= TPM_QDCTRL_QUADEN_MASK; -} - -#endif - -/*! - * brief Enables the selected TPM interrupts. - * - * param base TPM peripheral base address - * param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::tpm_interrupt_enable_t - */ -void TPM_EnableInterrupts(TPM_Type *base, uint32_t mask) -{ - uint32_t chnlInterrupts = (mask & 0xFFU); - uint8_t chnlNumber = 0; - - /* Enable the timer overflow interrupt */ - if ((uint32_t)kTPM_TimeOverflowInterruptEnable == (mask & (uint32_t)kTPM_TimeOverflowInterruptEnable)) - { - base->SC |= TPM_SC_TOIE_MASK; - } - - /* Enable the channel interrupts */ - while (0U != chnlInterrupts) - { - if (0U != (chnlInterrupts & 0x1u)) - { - base->CONTROLS[chnlNumber].CnSC |= TPM_CnSC_CHIE_MASK; - } - chnlNumber++; - chnlInterrupts = chnlInterrupts >> 1U; - } -} - -/*! - * brief Disables the selected TPM interrupts. - * - * param base TPM peripheral base address - * param mask The interrupts to disable. This is a logical OR of members of the - * enumeration ::tpm_interrupt_enable_t - */ -void TPM_DisableInterrupts(TPM_Type *base, uint32_t mask) -{ - uint32_t chnlInterrupts = (mask & 0xFFU); - uint8_t chnlNumber = 0; - - /* Disable the timer overflow interrupt */ - if ((uint32_t)kTPM_TimeOverflowInterruptEnable == (mask & (uint32_t)kTPM_TimeOverflowInterruptEnable)) - { - base->SC &= ~TPM_SC_TOIE_MASK; - } - - /* Disable the channel interrupts */ - while (0U != chnlInterrupts) - { - if (0U != (chnlInterrupts & 0x1u)) - { - base->CONTROLS[chnlNumber].CnSC &= ~TPM_CnSC_CHIE_MASK; - } - chnlNumber++; - chnlInterrupts = chnlInterrupts >> 1U; - } -} - -/*! - * brief Gets the enabled TPM interrupts. - * - * param base TPM peripheral base address - * - * return The enabled interrupts. This is the logical OR of members of the - * enumeration ::tpm_interrupt_enable_t - */ -uint32_t TPM_GetEnabledInterrupts(TPM_Type *base) -{ - uint32_t enabledInterrupts = 0; - uint32_t u32flag = 1; - int8_t chnlCount = FSL_FEATURE_TPM_CHANNEL_COUNTn(base); - - /* The CHANNEL_COUNT macro returns -1 if it cannot match the TPM instance */ - assert(chnlCount != -1); - - /* Check if timer overflow interrupt is enabled */ - if (0U != (base->SC & TPM_SC_TOIE_MASK)) - { - enabledInterrupts |= (uint32_t)kTPM_TimeOverflowInterruptEnable; - } - - /* Check if the channel interrupts are enabled */ - while (chnlCount > 0) - { - chnlCount--; - if (0U != (base->CONTROLS[chnlCount].CnSC & TPM_CnSC_CHIE_MASK)) - { - enabledInterrupts |= (u32flag << (uint8_t)chnlCount); - } - } - - return enabledInterrupts; -} - -/*! - * brief Register callback. - * - * If channel or overflow interrupt is enabled by the user, then a callback can be registered - * which will be invoked when the interrupt is triggered. - * - * param base TPM peripheral base address - * param callback Callback function - */ -void TPM_RegisterCallBack(TPM_Type *base, tpm_callback_t callback) -{ - uint32_t instance; - - instance = TPM_GetInstance(base); - - /* Create TPM callback instance. */ - s_tpmCallback[instance] = callback; - - /* Enable IRQ. */ - (void)EnableIRQ(s_tpmIRQ[instance]); -} - -#if defined(TPM0) -void TPM0_DriverIRQHandler(void); -void TPM0_DriverIRQHandler(void) -{ - if (NULL != s_tpmCallback[0]) - { - s_tpmCallback[0](TPM0); - } - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(TPM1) -void TPM1_DriverIRQHandler(void); -void TPM1_DriverIRQHandler(void) -{ - if (NULL != s_tpmCallback[1]) - { - s_tpmCallback[1](TPM1); - } - SDK_ISR_EXIT_BARRIER; -} -#endif diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_tpm.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_tpm.h deleted file mode 100644 index b210f9cc561..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_tpm.h +++ /dev/null @@ -1,949 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2021, 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_TPM_H_ -#define FSL_TPM_H_ - -#include "fsl_common.h" - -/* - * $Coverage Justification Reference$ - * - * $Justification tpm_h_ref_1$ - * Hardware limitations make this code impossible to implement. - * - */ - -/*! - * @addtogroup tpm - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief TPM driver version 2.3.1. */ -#define FSL_TPM_DRIVER_VERSION (MAKE_VERSION(2, 3, 1)) -/*! @} */ - -/*! @brief Help macro to get the max counter value */ -#define TPM_MAX_COUNTER_VALUE(x) ((1U != (uint8_t)FSL_FEATURE_TPM_HAS_32BIT_COUNTERn(x)) ? 0xFFFFU : 0xFFFFFFFFU) - -/*! - * @brief List of TPM channels. - * @note Actual number of available channels is SoC dependent - */ -typedef enum _tpm_chnl -{ - kTPM_Chnl_0 = 0U, /*!< TPM channel number 0*/ - kTPM_Chnl_1, /*!< TPM channel number 1 */ - kTPM_Chnl_2, /*!< TPM channel number 2 */ - kTPM_Chnl_3, /*!< TPM channel number 3 */ - kTPM_Chnl_4, /*!< TPM channel number 4 */ - kTPM_Chnl_5, /*!< TPM channel number 5 */ - kTPM_Chnl_6, /*!< TPM channel number 6 */ - kTPM_Chnl_7 /*!< TPM channel number 7 */ -} tpm_chnl_t; - -/*! @brief TPM PWM operation modes */ -typedef enum _tpm_pwm_mode -{ - kTPM_EdgeAlignedPwm = 0U, /*!< Edge aligned PWM */ - kTPM_CenterAlignedPwm, /*!< Center aligned PWM */ -#if defined(FSL_FEATURE_TPM_HAS_COMBINE) && FSL_FEATURE_TPM_HAS_COMBINE - kTPM_CombinedPwm /*!< Combined PWM (Edge-aligned, center-aligned, or asymmetrical PWMs can be obtained in combined - mode using different software configurations) */ -#endif -} tpm_pwm_mode_t; - -/*! - * @brief TPM PWM output pulse mode: high-true, low-true or no output - * - * @note When the TPM has PWM pause level select feature, the PWM output cannot be turned off by selecting the output - * level. In this case, the channel must be closed to close the PWM output. - */ -typedef enum _tpm_pwm_level_select -{ -#if !(defined(FSL_FEATURE_TPM_HAS_PAUSE_LEVEL_SELECT) && FSL_FEATURE_TPM_HAS_PAUSE_LEVEL_SELECT) - kTPM_NoPwmSignal = 0U, /*!< No PWM output on pin */ - kTPM_LowTrue, /*!< Low true pulses */ - kTPM_HighTrue /*!< High true pulses */ -#else - kTPM_HighTrue = 0U, /*!< High true pulses */ - kTPM_LowTrue /*!< Low true pulses */ -#endif -} tpm_pwm_level_select_t; - -#if (defined(FSL_FEATURE_TPM_HAS_PAUSE_LEVEL_SELECT) && FSL_FEATURE_TPM_HAS_PAUSE_LEVEL_SELECT) -/*! @brief TPM PWM output when first enabled or paused: set or clear */ -typedef enum _tpm_pwm_pause_level_select -{ - kTPM_ClearOnPause = 0U, /*!< Clear Output when counter first enabled or paused. */ - kTPM_SetOnPause /*!< Set Output when counter first enabled or paused. */ -} tpm_pwm_pause_level_select_t; -#endif - -/*! @brief List of TPM channel modes and level control bit mask */ -typedef enum _tpm_chnl_control_bit_mask -{ - kTPM_ChnlELSnAMask = TPM_CnSC_ELSA_MASK, /*!< Channel ELSA bit mask.*/ - kTPM_ChnlELSnBMask = TPM_CnSC_ELSB_MASK, /*!< Channel ELSB bit mask.*/ - kTPM_ChnlMSAMask = TPM_CnSC_MSA_MASK, /*!< Channel MSA bit mask.*/ - kTPM_ChnlMSBMask = TPM_CnSC_MSB_MASK, /*!< Channel MSB bit mask.*/ -} tpm_chnl_control_bit_mask_t; - -/*! @brief Options to configure a TPM channel's PWM signal */ -typedef struct _tpm_chnl_pwm_signal_param -{ - tpm_chnl_t chnlNumber; /*!< TPM channel to configure. - In combined mode (available in some SoC's), this represents the - channel pair number */ -#if (defined(FSL_FEATURE_TPM_HAS_PAUSE_LEVEL_SELECT) && FSL_FEATURE_TPM_HAS_PAUSE_LEVEL_SELECT) - tpm_pwm_pause_level_select_t pauseLevel; /*!< PWM output level when counter first enabled or paused */ -#endif - tpm_pwm_level_select_t level; /*!< PWM output active level select */ - uint8_t dutyCyclePercent; /*!< PWM pulse width, value should be between 0 to 100 - 0=inactive signal(0% duty cycle)... - 100=always active signal (100% duty cycle)*/ -#if defined(FSL_FEATURE_TPM_HAS_COMBINE) && FSL_FEATURE_TPM_HAS_COMBINE - uint8_t firstEdgeDelayPercent; /*!< Used only in combined PWM mode to generate asymmetrical PWM. - Specifies the delay to the first edge in a PWM period. - If unsure, leave as 0. Should be specified as percentage - of the PWM period, (dutyCyclePercent + firstEdgeDelayPercent) value - should be not greate than 100. */ - bool enableComplementary; /*!< Used only in combined PWM mode. - true: The combined channels output complementary signals; - false: The combined channels output same signals; */ -#if (defined(FSL_FEATURE_TPM_HAS_PAUSE_LEVEL_SELECT) && FSL_FEATURE_TPM_HAS_PAUSE_LEVEL_SELECT) - tpm_pwm_pause_level_select_t secPauseLevel; /*!< Used only in combined PWM mode. Define the second channel output - level when counter first enabled or paused */ -#endif - uint8_t deadTimeValue[2]; /*!< The dead time value for channel n and n+1 in combined complementary PWM mode. - Deadtime insertion is disabled when this value is zero, otherwise deadtime insertion for - channel n/n+1 is configured as (deadTimeValue * 4) clock cycles. deadTimeValue's - available range is 0 ~ 15. */ -#endif -} tpm_chnl_pwm_signal_param_t; - -#if !(defined(FSL_FEATURE_TPM_HAS_NO_CONF) && FSL_FEATURE_TPM_HAS_NO_CONF) -/*! - * @brief Trigger sources available. - * - * This is used for both internal & external trigger sources (external trigger sources available in certain SoC's) - * - * @note The actual trigger sources available is SoC-specific. - */ -typedef enum _tpm_trigger_select -{ - kTPM_Trigger_Select_0 = 0U, - kTPM_Trigger_Select_1, - kTPM_Trigger_Select_2, - kTPM_Trigger_Select_3, - kTPM_Trigger_Select_4, - kTPM_Trigger_Select_5, - kTPM_Trigger_Select_6, - kTPM_Trigger_Select_7, - kTPM_Trigger_Select_8, - kTPM_Trigger_Select_9, - kTPM_Trigger_Select_10, - kTPM_Trigger_Select_11, - kTPM_Trigger_Select_12, - kTPM_Trigger_Select_13, - kTPM_Trigger_Select_14, - kTPM_Trigger_Select_15 -} tpm_trigger_select_t; - -#if defined(FSL_FEATURE_TPM_HAS_EXTERNAL_TRIGGER_SELECTION) && FSL_FEATURE_TPM_HAS_EXTERNAL_TRIGGER_SELECTION -/*! - * @brief Trigger source options available - * - * @note This selection is available only on some SoC's. For SoC's without this selection, the only - * trigger source available is internal triger. - */ -typedef enum _tpm_trigger_source -{ - kTPM_TriggerSource_External = 0U, /*!< Use external trigger input */ - kTPM_TriggerSource_Internal /*!< Use internal trigger (channel pin input capture) */ -} tpm_trigger_source_t; - -/*! - * @brief External trigger source polarity - * - * @note Selects the polarity of the external trigger source. - */ -typedef enum _tpm_ext_trigger_polarity -{ - kTPM_ExtTrigger_Active_High = 0U, /*!< External trigger input is active high */ - kTPM_ExtTrigger_Active_Low /*!< External trigger input is active low */ -} tpm_ext_trigger_polarity_t; -#endif -#endif - -/*! @brief TPM output compare modes */ -typedef enum _tpm_output_compare_mode -{ - kTPM_NoOutputSignal = (1U << TPM_CnSC_MSA_SHIFT), /*!< No channel output when counter reaches CnV */ - kTPM_ToggleOnMatch = ((1U << TPM_CnSC_MSA_SHIFT) | (1U << TPM_CnSC_ELSA_SHIFT)), /*!< Toggle output */ - kTPM_ClearOnMatch = ((1U << TPM_CnSC_MSA_SHIFT) | (2U << TPM_CnSC_ELSA_SHIFT)), /*!< Clear output */ - kTPM_SetOnMatch = ((1U << TPM_CnSC_MSA_SHIFT) | (3U << TPM_CnSC_ELSA_SHIFT)), /*!< Set output */ - kTPM_HighPulseOutput = ((3U << TPM_CnSC_MSA_SHIFT) | (1U << TPM_CnSC_ELSA_SHIFT)), /*!< Pulse output high */ - kTPM_LowPulseOutput = ((3U << TPM_CnSC_MSA_SHIFT) | (2U << TPM_CnSC_ELSA_SHIFT)) /*!< Pulse output low */ -} tpm_output_compare_mode_t; - -/*! @brief TPM input capture edge */ -typedef enum _tpm_input_capture_edge -{ - kTPM_RisingEdge = (1U << TPM_CnSC_ELSA_SHIFT), /*!< Capture on rising edge only */ - kTPM_FallingEdge = (2U << TPM_CnSC_ELSA_SHIFT), /*!< Capture on falling edge only */ - kTPM_RiseAndFallEdge = (3U << TPM_CnSC_ELSA_SHIFT) /*!< Capture on rising or falling edge */ -} tpm_input_capture_edge_t; - -#if defined(FSL_FEATURE_TPM_HAS_COMBINE) && FSL_FEATURE_TPM_HAS_COMBINE -/*! - * @brief TPM dual edge capture parameters - * - * @note This mode is available only on some SoC's. - */ -typedef struct _tpm_dual_edge_capture_param -{ - bool enableSwap; /*!< true: Use channel n+1 input, channel n input is ignored; - false: Use channel n input, channel n+1 input is ignored */ - tpm_input_capture_edge_t currChanEdgeMode; /*!< Input capture edge select for channel n */ - tpm_input_capture_edge_t nextChanEdgeMode; /*!< Input capture edge select for channel n+1 */ -} tpm_dual_edge_capture_param_t; -#endif - -#if defined(FSL_FEATURE_TPM_HAS_QDCTRL) && FSL_FEATURE_TPM_HAS_QDCTRL -/*! - * @brief TPM quadrature decode modes - * - * @note This mode is available only on some SoC's. - */ -typedef enum _tpm_quad_decode_mode -{ - kTPM_QuadPhaseEncode = 0U, /*!< Phase A and Phase B encoding mode */ - kTPM_QuadCountAndDir /*!< Count and direction encoding mode */ -} tpm_quad_decode_mode_t; - -/*! @brief TPM quadrature phase polarities */ -typedef enum _tpm_phase_polarity -{ - kTPM_QuadPhaseNormal = 0U, /*!< Phase input signal is not inverted */ - kTPM_QuadPhaseInvert /*!< Phase input signal is inverted */ -} tpm_phase_polarity_t; - -/*! @brief TPM quadrature decode phase parameters */ -typedef struct _tpm_phase_param -{ - uint32_t phaseFilterVal; /*!< Filter value, filter is disabled when the value is zero */ - tpm_phase_polarity_t phasePolarity; /*!< Phase polarity */ -} tpm_phase_params_t; -#endif - -/*! @brief TPM clock source selection*/ -typedef enum _tpm_clock_source -{ - kTPM_SystemClock = 1U, /*!< System clock */ -#if defined(FSL_FEATURE_TPM_HAS_SC_CLKS) && FSL_FEATURE_TPM_HAS_SC_CLKS - kTPM_FixedClock, /*!< Fixed frequency clock */ -#endif - kTPM_ExternalClock, /*!< External TPM_EXTCLK pin clock */ -#if defined(FSL_FEATURE_TPM_HAS_EXTERNAL_TRIGGER_SELECTION) && FSL_FEATURE_TPM_HAS_EXTERNAL_TRIGGER_SELECTION - kTPM_ExternalInputTriggerClock /*!< Selected external input trigger clock */ -#endif -} tpm_clock_source_t; - -/*! @brief TPM prescale value selection for the clock source*/ -typedef enum _tpm_clock_prescale -{ - kTPM_Prescale_Divide_1 = 0U, /*!< Divide by 1 */ - kTPM_Prescale_Divide_2, /*!< Divide by 2 */ - kTPM_Prescale_Divide_4, /*!< Divide by 4 */ - kTPM_Prescale_Divide_8, /*!< Divide by 8 */ - kTPM_Prescale_Divide_16, /*!< Divide by 16 */ - kTPM_Prescale_Divide_32, /*!< Divide by 32 */ - kTPM_Prescale_Divide_64, /*!< Divide by 64 */ - kTPM_Prescale_Divide_128 /*!< Divide by 128 */ -} tpm_clock_prescale_t; - -/*! - * @brief TPM config structure - * - * This structure holds the configuration settings for the TPM peripheral. To initialize this - * structure to reasonable defaults, call the TPM_GetDefaultConfig() function and pass a - * pointer to your config structure instance. - * - * The config struct can be made const so it resides in flash - */ -typedef struct _tpm_config -{ - tpm_clock_prescale_t prescale; /*!< Select TPM clock prescale value */ -#if !(defined(FSL_FEATURE_TPM_HAS_NO_CONF) && FSL_FEATURE_TPM_HAS_NO_CONF) - bool useGlobalTimeBase; /*!< true: The TPM channels use an external global time base (the local counter still use - for generate overflow interrupt and DMA request); - false: All TPM channels use the local counter as their timebase */ - bool syncGlobalTimeBase; /*!< true: The TPM counter is synchronized to the global time base; - false: disabled */ - tpm_trigger_select_t triggerSelect; /*!< Input trigger to use for controlling the counter operation */ -#if defined(FSL_FEATURE_TPM_HAS_EXTERNAL_TRIGGER_SELECTION) && FSL_FEATURE_TPM_HAS_EXTERNAL_TRIGGER_SELECTION - tpm_trigger_source_t triggerSource; /*!< Decides if we use external or internal trigger. */ - tpm_ext_trigger_polarity_t - extTriggerPolarity; /*!< when using external trigger source, need selects the polarity of it. */ -#endif - bool enableDoze; /*!< true: TPM counter is paused in doze mode; - false: TPM counter continues in doze mode */ - bool enableDebugMode; /*!< true: TPM counter continues in debug mode; - false: TPM counter is paused in debug mode */ - bool enableReloadOnTrigger; /*!< true: TPM counter is reloaded on trigger; - false: TPM counter not reloaded */ - bool enableStopOnOverflow; /*!< true: TPM counter stops after overflow; - false: TPM counter continues running after overflow */ - bool enableStartOnTrigger; /*!< true: TPM counter only starts when a trigger is detected; - false: TPM counter starts immediately */ -#if defined(FSL_FEATURE_TPM_HAS_PAUSE_COUNTER_ON_TRIGGER) && FSL_FEATURE_TPM_HAS_PAUSE_COUNTER_ON_TRIGGER - bool enablePauseOnTrigger; /*!< true: TPM counter will pause while trigger remains asserted; - false: TPM counter continues running */ -#endif -#if defined(FSL_FEATURE_TPM_HAS_POL) && FSL_FEATURE_TPM_HAS_POL - uint8_t chnlPolarity; /*!< Defines the input/output polarity of the channels in POL register */ -#endif -#endif -} tpm_config_t; - -/*! @brief List of TPM interrupts */ -typedef enum _tpm_interrupt_enable -{ - kTPM_Chnl0InterruptEnable = (1U << 0), /*!< Channel 0 interrupt.*/ - kTPM_Chnl1InterruptEnable = (1U << 1), /*!< Channel 1 interrupt.*/ - kTPM_Chnl2InterruptEnable = (1U << 2), /*!< Channel 2 interrupt.*/ - kTPM_Chnl3InterruptEnable = (1U << 3), /*!< Channel 3 interrupt.*/ - kTPM_Chnl4InterruptEnable = (1U << 4), /*!< Channel 4 interrupt.*/ - kTPM_Chnl5InterruptEnable = (1U << 5), /*!< Channel 5 interrupt.*/ - kTPM_Chnl6InterruptEnable = (1U << 6), /*!< Channel 6 interrupt.*/ - kTPM_Chnl7InterruptEnable = (1U << 7), /*!< Channel 7 interrupt.*/ - kTPM_TimeOverflowInterruptEnable = (1U << 8) /*!< Time overflow interrupt.*/ -} tpm_interrupt_enable_t; - -/*! @brief List of TPM flags */ -typedef enum _tpm_status_flags -{ - kTPM_Chnl0Flag = (1U << 0), /*!< Channel 0 flag */ - kTPM_Chnl1Flag = (1U << 1), /*!< Channel 1 flag */ - kTPM_Chnl2Flag = (1U << 2), /*!< Channel 2 flag */ - kTPM_Chnl3Flag = (1U << 3), /*!< Channel 3 flag */ - kTPM_Chnl4Flag = (1U << 4), /*!< Channel 4 flag */ - kTPM_Chnl5Flag = (1U << 5), /*!< Channel 5 flag */ - kTPM_Chnl6Flag = (1U << 6), /*!< Channel 6 flag */ - kTPM_Chnl7Flag = (1U << 7), /*!< Channel 7 flag */ - kTPM_TimeOverflowFlag = (1U << 8) /*!< Time overflow flag */ -} tpm_status_flags_t; - -/*! - * @brief TPM callback function pointer - * - * @param base TPM peripheral base address. - */ -typedef void (*tpm_callback_t)(TPM_Type *base); - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Gets the instance from the base address - * - * @param base TPM peripheral base address - * @return The TPM instance - */ -uint32_t TPM_GetInstance(TPM_Type *base); - -/*! - * @brief Ungates the TPM clock and configures the peripheral for basic operation. - * - * @note This API should be called at the beginning of the application using the TPM driver. - * - * @param base TPM peripheral base address - * @param config Pointer to user's TPM config structure. - */ -void TPM_Init(TPM_Type *base, const tpm_config_t *config); - -/*! - * @brief Stops the counter and gates the TPM clock - * - * @param base TPM peripheral base address - */ -void TPM_Deinit(TPM_Type *base); - -/*! - * @brief Fill in the TPM config struct with the default settings - * - * The default values are: - * @code - * config->prescale = kTPM_Prescale_Divide_1; - * config->useGlobalTimeBase = false; - * config->syncGlobalTimeBase = false; - * config->dozeEnable = false; - * config->dbgMode = false; - * config->enableReloadOnTrigger = false; - * config->enableStopOnOverflow = false; - * config->enableStartOnTrigger = false; - *#if FSL_FEATURE_TPM_HAS_PAUSE_COUNTER_ON_TRIGGER - * config->enablePauseOnTrigger = false; - *#endif - * config->triggerSelect = kTPM_Trigger_Select_0; - *#if FSL_FEATURE_TPM_HAS_EXTERNAL_TRIGGER_SELECTION - * config->triggerSource = kTPM_TriggerSource_External; - * config->extTriggerPolarity = kTPM_ExtTrigger_Active_High; - *#endif - *#if defined(FSL_FEATURE_TPM_HAS_POL) && FSL_FEATURE_TPM_HAS_POL - * config->chnlPolarity = 0U; - *#endif - * @endcode - * @param config Pointer to user's TPM config structure. - */ -void TPM_GetDefaultConfig(tpm_config_t *config); - -/*! - * @brief Calculates the counter clock prescaler. - * - * This function calculates the values for SC[PS]. - * - * @param base TPM peripheral base address - * @param counterPeriod_Hz The desired frequency in Hz which corresponding to the time when the counter reaches the mod - * value - * @param srcClock_Hz TPM counter clock in Hz - * - * return Calculated clock prescaler value. - */ -tpm_clock_prescale_t TPM_CalculateCounterClkDiv(TPM_Type *base, uint32_t counterPeriod_Hz, uint32_t srcClock_Hz); - -/*! @}*/ - -/*! - * @name Channel mode operations - * @{ - */ - -/*! - * @brief Configures the PWM signal parameters - * - * User calls this function to configure the PWM signals period, mode, dutycycle and edge. Use this - * function to configure all the TPM channels that will be used to output a PWM signal - * - * @param base TPM peripheral base address - * @param chnlParams Array of PWM channel parameters to configure the channel(s) - * @param numOfChnls Number of channels to configure, this should be the size of the array passed in - * @param mode PWM operation mode, options available in enumeration ::tpm_pwm_mode_t - * @param pwmFreq_Hz PWM signal frequency in Hz - * @param srcClock_Hz TPM counter clock in Hz - * - * @return kStatus_Success if the PWM setup was successful, - * kStatus_Error on failure - */ -status_t TPM_SetupPwm(TPM_Type *base, - const tpm_chnl_pwm_signal_param_t *chnlParams, - uint8_t numOfChnls, - tpm_pwm_mode_t mode, - uint32_t pwmFreq_Hz, - uint32_t srcClock_Hz); - -/*! - * @brief Update the duty cycle of an active PWM signal - * - * @param base TPM peripheral base address - * @param chnlNumber The channel number. In combined mode, this represents - * the channel pair number - * @param currentPwmMode The current PWM mode set during PWM setup - * @param dutyCyclePercent New PWM pulse width, value should be between 0 to 100 - * 0=inactive signal(0% duty cycle)... - * 100=active signal (100% duty cycle) - * @return kStatus_Success if the PWM setup was successful, - * kStatus_Error on failure - */ -status_t TPM_UpdatePwmDutycycle(TPM_Type *base, - tpm_chnl_t chnlNumber, - tpm_pwm_mode_t currentPwmMode, - uint8_t dutyCyclePercent); - -/*! - * @brief Update the edge level selection for a channel - * - * @note When the TPM has PWM pause level select feature (FSL_FEATURE_TPM_HAS_PAUSE_LEVEL_SELECT = 1), the PWM output - * cannot be turned off by selecting the output level. In this case, must use TPM_DisableChannel API to close the - * PWM output. - * - * @param base TPM peripheral base address - * @param chnlNumber The channel number - * @param level The level to be set to the ELSnB:ELSnA field; valid values are 00, 01, 10, 11. - * See the appropriate SoC reference manual for details about this field. - */ -void TPM_UpdateChnlEdgeLevelSelect(TPM_Type *base, tpm_chnl_t chnlNumber, uint8_t level); - -/*! - * @brief Get the channel control bits value (mode, edge and level bit fileds). - * - * This function disable the channel by clear all mode and level control bits. - * - * @param base TPM peripheral base address - * @param chnlNumber The channel number - * @return The contorl bits value. This is the logical OR of members of the - * enumeration @ref tpm_chnl_control_bit_mask_t. - */ -static inline uint8_t TPM_GetChannelContorlBits(TPM_Type *base, tpm_chnl_t chnlNumber) -{ - return (uint8_t)(base->CONTROLS[chnlNumber].CnSC & - (TPM_CnSC_MSA_MASK | TPM_CnSC_MSB_MASK | TPM_CnSC_ELSA_MASK | TPM_CnSC_ELSB_MASK)); -} - -/*! - * @brief Dsiable the channel. - * - * This function disable the channel by clear all mode and level control bits. - * - * @param base TPM peripheral base address - * @param chnlNumber The channel number - */ -static inline void TPM_DisableChannel(TPM_Type *base, tpm_chnl_t chnlNumber) -{ - do - { - /* Clear channel MSnB:MSnA and ELSnB:ELSnA to disable its output. */ - base->CONTROLS[chnlNumber].CnSC &= - ~(TPM_CnSC_MSA_MASK | TPM_CnSC_MSB_MASK | TPM_CnSC_ELSA_MASK | TPM_CnSC_ELSB_MASK); - /* Wait till mode change to disable channel is acknowledged */ - /* - * $Branch Coverage Justification$ - * (0U != (base->CONTROLS[chnlNumber].CnSC & - * (TPM_CnSC_MSA_MASK | TPM_CnSC_MSB_MASK | TPM_CnSC_ELSA_MASK | TPM_CnSC_ELSB_MASK))) - * not covered. $ref tpm_h_ref_1$. - */ - - } while (0U != (base->CONTROLS[chnlNumber].CnSC & - (TPM_CnSC_MSA_MASK | TPM_CnSC_MSB_MASK | TPM_CnSC_ELSA_MASK | TPM_CnSC_ELSB_MASK))); -} - -/*! - * @brief Enable the channel according to mode and level configs. - * - * This function enable the channel output according to input mode/level config parameters. - * - * @param base TPM peripheral base address - * @param chnlNumber The channel number - * @param control The contorl bits value. This is the logical OR of members of the - * enumeration @ref tpm_chnl_control_bit_mask_t. - */ -static inline void TPM_EnableChannel(TPM_Type *base, tpm_chnl_t chnlNumber, uint8_t control) -{ -#if defined(FSL_FEATURE_TPM_CnSC_CHF_WRITE_0_CLEAR) && FSL_FEATURE_TPM_CnSC_CHF_WRITE_0_CLEAR - control |= TPM_CnSC_CHF_MASK; -#endif - - do - { - /* Set channel MSB:MSA and ELSB:ELSA bits. */ - base->CONTROLS[chnlNumber].CnSC = - (base->CONTROLS[chnlNumber].CnSC & - ~(TPM_CnSC_MSA_MASK | TPM_CnSC_MSB_MASK | TPM_CnSC_ELSA_MASK | TPM_CnSC_ELSB_MASK)) | - (control & (TPM_CnSC_MSA_MASK | TPM_CnSC_MSB_MASK | TPM_CnSC_ELSA_MASK | TPM_CnSC_ELSB_MASK)); - /* Wait till mode change is acknowledged */ - /* - * $Branch Coverage Justification$ - * ((control & (TPM_CnSC_MSA_MASK | TPM_CnSC_MSB_MASK | TPM_CnSC_ELSA_MASK | TPM_CnSC_ELSB_MASK)) != - * (uint8_t)(base->CONTROLS[chnlNumber].CnSC & - * (TPM_CnSC_MSA_MASK | TPM_CnSC_MSB_MASK | TPM_CnSC_ELSA_MASK | TPM_CnSC_ELSB_MASK))) - * not covered. $ref tpm_h_ref_1$. - */ - } while ((control & (TPM_CnSC_MSA_MASK | TPM_CnSC_MSB_MASK | TPM_CnSC_ELSA_MASK | TPM_CnSC_ELSB_MASK)) != - (uint8_t)(base->CONTROLS[chnlNumber].CnSC & - (TPM_CnSC_MSA_MASK | TPM_CnSC_MSB_MASK | TPM_CnSC_ELSA_MASK | TPM_CnSC_ELSB_MASK))); -} - -/*! - * @brief Enables capturing an input signal on the channel using the function parameters. - * - * When the edge specified in the captureMode argument occurs on the channel, the TPM counter is captured into - * the CnV register. The user has to read the CnV register separately to get this value. - * - * @param base TPM peripheral base address - * @param chnlNumber The channel number - * @param captureMode Specifies which edge to capture - */ -void TPM_SetupInputCapture(TPM_Type *base, tpm_chnl_t chnlNumber, tpm_input_capture_edge_t captureMode); - -/*! - * @brief Configures the TPM to generate timed pulses. - * - * When the TPM counter matches the value of compareVal argument (this is written into CnV reg), the channel - * output is changed based on what is specified in the compareMode argument. - * - * @param base TPM peripheral base address - * @param chnlNumber The channel number - * @param compareMode Action to take on the channel output when the compare condition is met - * @param compareValue Value to be programmed in the CnV register. - */ -void TPM_SetupOutputCompare(TPM_Type *base, - tpm_chnl_t chnlNumber, - tpm_output_compare_mode_t compareMode, - uint32_t compareValue); - -#if defined(FSL_FEATURE_TPM_HAS_COMBINE) && FSL_FEATURE_TPM_HAS_COMBINE -/*! - * @brief Configures the dual edge capture mode of the TPM. - * - * This function allows to measure a pulse width of the signal on the input of channel of a - * channel pair. The filter function is disabled if the filterVal argument passed is zero. - * - * @param base TPM peripheral base address - * @param chnlPairNumber The TPM channel pair number; options are 0, 1, 2, 3 - * @param edgeParam Sets up the dual edge capture function - * @param filterValue Filter value, specify 0 to disable filter. - */ -void TPM_SetupDualEdgeCapture(TPM_Type *base, - tpm_chnl_t chnlPairNumber, - const tpm_dual_edge_capture_param_t *edgeParam, - uint32_t filterValue); -#endif - -#if defined(FSL_FEATURE_TPM_HAS_QDCTRL) && FSL_FEATURE_TPM_HAS_QDCTRL -/*! - * @brief Configures the parameters and activates the quadrature decode mode. - * - * @param base TPM peripheral base address - * @param phaseAParams Phase A configuration parameters - * @param phaseBParams Phase B configuration parameters - * @param quadMode Selects encoding mode used in quadrature decoder mode - */ -void TPM_SetupQuadDecode(TPM_Type *base, - const tpm_phase_params_t *phaseAParams, - const tpm_phase_params_t *phaseBParams, - tpm_quad_decode_mode_t quadMode); -#endif - -#if defined(FSL_FEATURE_TPM_HAS_POL) && FSL_FEATURE_TPM_HAS_POL -/*! - * @brief Set the input and output polarity of each of the channels. - * - * @param base TPM peripheral base address - * @param chnlNumber The channel number - * @param enable true: Set the channel polarity to active high; - * false: Set the channel polarity to active low; - */ -static inline void TPM_SetChannelPolarity(TPM_Type *base, tpm_chnl_t chnlNumber, bool enable) -{ - assert(1U == (uint8_t)FSL_FEATURE_TPM_POL_HAS_EFFECTn(base)); - if (enable) - { - base->POL &= ~((uint32_t)TPM_POL_POL0_MASK << (uint8_t)chnlNumber); - } - else - { - base->POL |= (uint32_t)TPM_POL_POL0_MASK << (uint8_t)chnlNumber; - } -} -#endif -#if defined(FSL_FEATURE_TPM_HAS_TRIG) && FSL_FEATURE_TPM_HAS_TRIG -/*! - * @brief Enable external trigger input to be used by channel. - * - * In input capture mode, configures the trigger input that is used by the channel to capture the - * counter value. In output compare or PWM mode, configures the trigger input used to modulate - * the channel output. When modulating the output, the output is forced to the channel initial - * value whenever the trigger is not asserted. - * - * @note No matter how many external trigger sources there are, only input trigger 0 and 1 are used. The even numbered - * channels share the input trigger 0 and the odd numbered channels share the second input trigger 1. - * - * @param base TPM peripheral base address - * @param chnlNumber The channel number - * @param enable true: Configures trigger input 0 or 1 to be used by channel; - * false: Trigger input has no effect on the channel - */ -static inline void TPM_EnableChannelExtTrigger(TPM_Type *base, tpm_chnl_t chnlNumber, bool enable) -{ - assert(1U == (uint8_t)FSL_FEATURE_TPM_TRIG_HAS_EFFECTn(base)); - if (enable) - { - base->TRIG |= (uint32_t)TPM_TRIG_TRIG0_MASK << (uint8_t)chnlNumber; - } - else - { - base->TRIG &= ~((uint32_t)TPM_TRIG_TRIG0_MASK << (uint8_t)chnlNumber); - } -} -#endif -/*! @}*/ - -/*! - * @name Interrupt Interface - * @{ - */ - -/*! - * @brief Enables the selected TPM interrupts. - * - * @param base TPM peripheral base address - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::tpm_interrupt_enable_t - */ -void TPM_EnableInterrupts(TPM_Type *base, uint32_t mask); - -/*! - * @brief Disables the selected TPM interrupts. - * - * @param base TPM peripheral base address - * @param mask The interrupts to disable. This is a logical OR of members of the - * enumeration ::tpm_interrupt_enable_t - */ -void TPM_DisableInterrupts(TPM_Type *base, uint32_t mask); - -/*! - * @brief Gets the enabled TPM interrupts. - * - * @param base TPM peripheral base address - * - * @return The enabled interrupts. This is the logical OR of members of the - * enumeration ::tpm_interrupt_enable_t - */ -uint32_t TPM_GetEnabledInterrupts(TPM_Type *base); - -/*! - * @brief Register callback. - * - * If channel or overflow interrupt is enabled by the user, then a callback can be registered - * which will be invoked when the interrupt is triggered. - * - * @param base TPM peripheral base address - * @param callback Callback function - */ -void TPM_RegisterCallBack(TPM_Type *base, tpm_callback_t callback); - -/*! @}*/ - -/*! - * @name Status Interface - * @{ - */ -/*! - * @brief Gets the TPM channel value - * - * @note The TPM channel value contain the captured TPM counter value for the input modes or the match value for the - * output modes. - * - * @param base TPM peripheral base address - * @param chnlNumber The channel number - * @return The channle CnV regisyer value. - */ -static inline uint32_t TPM_GetChannelValue(TPM_Type *base, tpm_chnl_t chnlNumber) -{ - return base->CONTROLS[chnlNumber].CnV; -} - -/*! - * @brief Gets the TPM status flags - * - * @param base TPM peripheral base address - * - * @return The status flags. This is the logical OR of members of the - * enumeration ::tpm_status_flags_t - */ -static inline uint32_t TPM_GetStatusFlags(TPM_Type *base) -{ - uint32_t statusFlags = 0; - -#if defined(FSL_FEATURE_TPM_HAS_NO_STATUS) && FSL_FEATURE_TPM_HAS_NO_STATUS - uint8_t chanlNumber = 0; - - /* Check the timer flag */ - if (0U != (base->SC & TPM_SC_TOF_MASK)) - { - statusFlags |= (uint32_t)kTPM_TimeOverflowFlag; - } - - for (chanlNumber = 0; (int8_t)chanlNumber < FSL_FEATURE_TPM_CHANNEL_COUNTn(base); chanlNumber++) - { - /* Check the channel flag */ - if (0U != (base->CONTROLS[chanlNumber].CnSC & TPM_CnSC_CHF_MASK)) - { - statusFlags |= (1UL << chanlNumber); - } - } -#else - statusFlags = base->STATUS; -#endif - - return statusFlags; -} - -/*! - * @brief Clears the TPM status flags - * - * @param base TPM peripheral base address - * @param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::tpm_status_flags_t - */ -static inline void TPM_ClearStatusFlags(TPM_Type *base, uint32_t mask) -{ -#if defined(FSL_FEATURE_TPM_HAS_NO_STATUS) && FSL_FEATURE_TPM_HAS_NO_STATUS - uint32_t chnlStatusFlags = (mask & 0xFFU); - uint8_t chnlNumber = 0; - - /* Clear the timer overflow flag by writing a 0 to the bit while it is set */ - if (0U != (mask & (uint32_t)kTPM_TimeOverflowFlag)) - { - base->SC &= ~TPM_SC_TOF_MASK; - } - /* Clear the channel flag */ - while (0U != chnlStatusFlags) - { - if (0U != (chnlStatusFlags & 0x1U)) - { - base->CONTROLS[chnlNumber].CnSC &= ~TPM_CnSC_CHF_MASK; - } - chnlNumber++; - chnlStatusFlags = chnlStatusFlags >> 1U; - } -#else - /* Clear the status flags */ - base->STATUS = mask; -#endif -} - -/*! @}*/ - -/*! - * @name Read and write the timer period - * @{ - */ - -/*! - * @brief Sets the timer period in units of ticks. - * - * Timers counts from 0 until it equals the count value set here. The count value is written to - * the MOD register. - * - * @note - * 1. This API allows the user to use the TPM module as a timer. Do not mix usage - * of this API with TPM's PWM setup API's. - * 2. Call the utility macros provided in the fsl_common.h to convert usec or msec to ticks. - * - * @param base TPM peripheral base address - * @param ticks A timer period in units of ticks, which should be equal or greater than 1. - */ -static inline void TPM_SetTimerPeriod(TPM_Type *base, uint32_t ticks) -{ - if (1U != (uint8_t)FSL_FEATURE_TPM_HAS_32BIT_COUNTERn(base)) - { - assert(ticks <= 0xFFFFU); - } - base->MOD = ticks; -} - -/*! - * @brief Reads the current timer counting value. - * - * This function returns the real-time timer counting value in a range from 0 to a - * timer period. - * - * @note Call the utility macros provided in the fsl_common.h to convert ticks to usec or msec. - * - * @param base TPM peripheral base address - * - * @return The current counter value in ticks - */ -static inline uint32_t TPM_GetCurrentTimerCount(TPM_Type *base) -{ - return (uint32_t)((base->CNT & TPM_CNT_COUNT_MASK) >> TPM_CNT_COUNT_SHIFT); -} - -/*! - * @name Timer Start and Stop - * @{ - */ - -/*! - * @brief Starts the TPM counter. - * - * @param base TPM peripheral base address - * @param clockSource TPM clock source; once clock source is set the counter will start running - */ -static inline void TPM_StartTimer(TPM_Type *base, tpm_clock_source_t clockSource) -{ - uint32_t reg = base->SC; -#if defined(FSL_FEATURE_TPM_HAS_SC_CLKS) && FSL_FEATURE_TPM_HAS_SC_CLKS - reg &= ~(TPM_SC_CLKS_MASK); - reg |= TPM_SC_CLKS(clockSource); -#else - reg &= ~(TPM_SC_CMOD_MASK); - reg |= TPM_SC_CMOD(clockSource); -#endif - base->SC = reg; -} - -/*! - * @brief Stops the TPM counter. - * - * @param base TPM peripheral base address - */ -static inline void TPM_StopTimer(TPM_Type *base) -{ -#if defined(FSL_FEATURE_TPM_HAS_SC_CLKS) && FSL_FEATURE_TPM_HAS_SC_CLKS - /* Set clock source to none to disable counter */ - base->SC &= ~(TPM_SC_CLKS_MASK); - - /* Wait till this reads as zero acknowledging the counter is disabled */ - while (0U != (base->SC & TPM_SC_CLKS_MASK)) - { - } -#else - /* Set clock source to none to disable counter */ - base->SC &= ~(TPM_SC_CMOD_MASK); - - /* Wait till this reads as zero acknowledging the counter is disabled */ - while (0U != (base->SC & TPM_SC_CMOD_MASK)) - { - } -#endif -} - -/*! @}*/ - -#if defined(FSL_FEATURE_TPM_HAS_GLOBAL) && FSL_FEATURE_TPM_HAS_GLOBAL -/*! - * @brief Performs a software reset on the TPM module. - * - * Reset all internal logic and registers, except the Global Register. Remains set until cleared by software. - * - * @note TPM software reset is available on certain SoC's only - * - * @param base TPM peripheral base address - */ -static inline void TPM_Reset(TPM_Type *base) -{ - base->GLOBAL |= TPM_GLOBAL_RST_MASK; - base->GLOBAL &= ~TPM_GLOBAL_RST_MASK; -} -#endif - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_TPM_H_ */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_uart.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_uart.c deleted file mode 100644 index a98e20bf383..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_uart.c +++ /dev/null @@ -1,1946 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_uart.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.uart" -#endif - -/* UART transfer state. */ -enum -{ - kUART_TxIdle, /* TX idle. */ - kUART_TxBusy, /* TX busy. */ - kUART_RxIdle, /* RX idle. */ - kUART_RxBusy, /* RX busy. */ - kUART_RxFramingError, /* Rx framing error */ - kUART_RxParityError /* Rx parity error */ -}; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Check whether the RX ring buffer is full. - * - * @param handle UART handle pointer. - * @retval true RX ring buffer is full. - * @retval false RX ring buffer is not full. - */ -static bool UART_TransferIsRxRingBufferFull(uart_handle_t *handle); - -/*! - * @brief Read RX register using non-blocking method. - * - * This function reads data from the TX register directly, upper layer must make - * sure the RX register is full or TX FIFO has data before calling this function. - * - * @param base UART peripheral base address. - * @param data Start address of the buffer to store the received data. - * @param length Size of the buffer. - */ -static void UART_ReadNonBlocking(UART_Type *base, uint8_t *data, size_t length); - -/*! - * @brief Write to TX register using non-blocking method. - * - * This function writes data to the TX register directly, upper layer must make - * sure the TX register is empty or TX FIFO has empty room before calling this function. - * - * @note This function does not check whether all the data has been sent out to bus, - * so before disable TX, check kUART_TransmissionCompleteFlag to ensure the TX is - * finished. - * - * @param base UART peripheral base address. - * @param data Start address of the data to write. - * @param length Size of the buffer to be sent. - */ -static void UART_WriteNonBlocking(UART_Type *base, const uint8_t *data, size_t length); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/* Array of UART handle. */ -#if (defined(UART5)) -#define UART_HANDLE_ARRAY_SIZE 6 -#else /* UART5 */ -#if (defined(UART4)) -#define UART_HANDLE_ARRAY_SIZE 5 -#else /* UART4 */ -#if (defined(UART3)) -#define UART_HANDLE_ARRAY_SIZE 4 -#else /* UART3 */ -#if (defined(UART2)) -#define UART_HANDLE_ARRAY_SIZE 3 -#else /* UART2 */ -#if (defined(UART1)) -#define UART_HANDLE_ARRAY_SIZE 2 -#else /* UART1 */ -#if (defined(UART0)) -#define UART_HANDLE_ARRAY_SIZE 1 -#else /* UART0 */ -#error No UART instance. -#endif /* UART 0 */ -#endif /* UART 1 */ -#endif /* UART 2 */ -#endif /* UART 3 */ -#endif /* UART 4 */ -#endif /* UART 5 */ -void *s_uartHandle[UART_HANDLE_ARRAY_SIZE]; -/* Array of UART peripheral base address. */ -static UART_Type *const s_uartBases[] = UART_BASE_PTRS; - -/* Array of UART IRQ number. */ -const IRQn_Type s_uartIRQ[] = UART_RX_TX_IRQS; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/* Array of UART clock name. */ -static const clock_ip_name_t s_uartClock[] = UART_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/* UART ISR for transactional APIs. */ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -uart_isr_t s_uartIsr = (uart_isr_t)DefaultISR; -#else -uart_isr_t s_uartIsr; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Get the UART instance from peripheral base address. - * - * param base UART peripheral base address. - * return UART instance. - */ -uint32_t UART_GetInstance(UART_Type *base) -{ - uint32_t instance; - uint32_t uartArrayCount = (sizeof(s_uartBases) / sizeof(s_uartBases[0])); - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < uartArrayCount; instance++) - { - if (s_uartBases[instance] == base) - { - break; - } - } - - assert(instance < uartArrayCount); - - return instance; -} - -/*! - * brief Get the length of received data in RX ring buffer. - * - * param handle UART handle pointer. - * return Length of received data in RX ring buffer. - */ -size_t UART_TransferGetRxRingBufferLength(uart_handle_t *handle) -{ - assert(handle != NULL); - - size_t size; - uint16_t rxRingBufferHead = handle->rxRingBufferHead; - uint16_t rxRingBufferTail = handle->rxRingBufferTail; - - if (rxRingBufferTail > rxRingBufferHead) - { - size = (size_t)rxRingBufferHead + handle->rxRingBufferSize - (size_t)rxRingBufferTail; - } - else - { - size = (size_t)rxRingBufferHead - (size_t)rxRingBufferTail; - } - - return size; -} - -static bool UART_TransferIsRxRingBufferFull(uart_handle_t *handle) -{ - assert(handle != NULL); - - bool full; - - if (UART_TransferGetRxRingBufferLength(handle) == (handle->rxRingBufferSize - 1U)) - { - full = true; - } - else - { - full = false; - } - - return full; -} - -/*! - * brief Initializes a UART instance with a user configuration structure and peripheral clock. - * - * This function configures the UART module with the user-defined settings. The user can configure the configuration - * structure and also get the default configuration by using the UART_GetDefaultConfig() function. - * The example below shows how to use this API to configure UART. - * code - * uart_config_t uartConfig; - * uartConfig.baudRate_Bps = 115200U; - * uartConfig.parityMode = kUART_ParityDisabled; - * uartConfig.stopBitCount = kUART_OneStopBit; - * uartConfig.txFifoWatermark = 0; - * uartConfig.rxFifoWatermark = 1; - * UART_Init(UART1, &uartConfig, 20000000U); - * endcode - * - * param base UART peripheral base address. - * param config Pointer to the user-defined configuration structure. - * param srcClock_Hz UART clock source frequency in HZ. - * retval kStatus_UART_BaudrateNotSupport Baudrate is not support in current clock source. - * retval kStatus_Success Status UART initialize succeed - */ -status_t UART_Init(UART_Type *base, const uart_config_t *config, uint32_t srcClock_Hz) -{ - assert(config != NULL); - assert(config->baudRate_Bps != 0U); -#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO - assert((uint8_t)FSL_FEATURE_UART_FIFO_SIZEn(base) >= config->txFifoWatermark); - assert((uint8_t)FSL_FEATURE_UART_FIFO_SIZEn(base) >= config->rxFifoWatermark); -#endif - - uint32_t sbr = 0U; - uint8_t temp = 0U; - uint32_t baudDiff = 0U; - - /* Calculate the baud rate modulo divisor, sbr*/ - sbr = srcClock_Hz / (config->baudRate_Bps * 16U); - /* set sbrTemp to 1 if the sourceClockInHz can not satisfy the desired baud rate */ - if (sbr == 0U) - { - sbr = 1U; - } -#if defined(FSL_FEATURE_UART_HAS_BAUD_RATE_FINE_ADJUST_SUPPORT) && FSL_FEATURE_UART_HAS_BAUD_RATE_FINE_ADJUST_SUPPORT - /* Determine if a fractional divider is needed to fine tune closer to the - * desired baud, each value of brfa is in 1/32 increments, - * hence the multiply-by-32. */ - uint32_t tempBaud = 0U; - - uint32_t brfa = (2U * srcClock_Hz / (config->baudRate_Bps)) - 32U * sbr; - - /* Calculate the baud rate based on the temporary SBR values and BRFA */ - tempBaud = srcClock_Hz * 2U / (sbr * 32U + brfa); - baudDiff = - (tempBaud > config->baudRate_Bps) ? (tempBaud - config->baudRate_Bps) : (config->baudRate_Bps - tempBaud); - -#else - /* Calculate the baud rate based on the temporary SBR values */ - baudDiff = (srcClock_Hz / (sbr * 16U)) - config->baudRate_Bps; - - /* Select the better value between sbr and (sbr + 1) */ - if (baudDiff > (config->baudRate_Bps - (srcClock_Hz / (16U * ((uint32_t)sbr + 1U))))) - { - baudDiff = config->baudRate_Bps - (srcClock_Hz / (16U * ((uint32_t)sbr + 1U))); - sbr++; - } -#endif - - /* next, check to see if actual baud rate is within 3% of desired baud rate - * based on the calculate SBR value */ - if (baudDiff > ((config->baudRate_Bps / 100U) * 3U)) - { - /* Unacceptable baud rate difference of more than 3%*/ - return kStatus_UART_BaudrateNotSupport; - } - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable uart clock */ - CLOCK_EnableClock(s_uartClock[UART_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Disable UART TX RX before setting. */ - base->C2 &= ~((uint8_t)UART_C2_TE_MASK | (uint8_t)UART_C2_RE_MASK); - - /* Write the sbr value to the BDH and BDL registers*/ - base->BDH = (base->BDH & ~(uint8_t)UART_BDH_SBR_MASK) | (uint8_t)(sbr >> 8); - base->BDL = (uint8_t)sbr; - -#if defined(FSL_FEATURE_UART_HAS_BAUD_RATE_FINE_ADJUST_SUPPORT) && FSL_FEATURE_UART_HAS_BAUD_RATE_FINE_ADJUST_SUPPORT - /* Write the brfa value to the register*/ - base->C4 = (base->C4 & ~(uint8_t)UART_C4_BRFA_MASK) | ((uint8_t)brfa & UART_C4_BRFA_MASK); -#endif - - /* Set bit count/parity mode/idle type. */ - temp = base->C1 & - ~((uint8_t)UART_C1_PE_MASK | (uint8_t)UART_C1_PT_MASK | (uint8_t)UART_C1_M_MASK | (uint8_t)UART_C1_ILT_MASK); - - temp |= UART_C1_ILT(config->idleType); - - if (kUART_ParityDisabled != config->parityMode) - { - temp |= (UART_C1_M_MASK | (uint8_t)config->parityMode); - } - - base->C1 = temp; - -#if defined(FSL_FEATURE_UART_HAS_STOP_BIT_CONFIG_SUPPORT) && FSL_FEATURE_UART_HAS_STOP_BIT_CONFIG_SUPPORT - /* Set stop bit per char */ - base->BDH = (base->BDH & ~(uint8_t)UART_BDH_SBNS_MASK) | (uint8_t)UART_BDH_SBNS((uint8_t)config->stopBitCount); -#endif - -#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO - /* Set tx/rx FIFO watermark - Note: - Take care of the RX FIFO, RX interrupt request only assert when received bytes - equal or more than RX water mark, there is potential issue if RX water - mark larger than 1. - For example, if RX FIFO water mark is 2, upper layer needs 5 bytes and - 5 bytes are received. the last byte will be saved in FIFO but not trigger - RX interrupt because the water mark is 2. - */ - base->TWFIFO = config->txFifoWatermark; - base->RWFIFO = config->rxFifoWatermark; - - /* Enable tx/rx FIFO */ - base->PFIFO |= (UART_PFIFO_TXFE_MASK | UART_PFIFO_RXFE_MASK); - - /* Flush FIFO */ - base->CFIFO |= (UART_CFIFO_TXFLUSH_MASK | UART_CFIFO_RXFLUSH_MASK); -#endif -#if defined(FSL_FEATURE_UART_HAS_MODEM_SUPPORT) && FSL_FEATURE_UART_HAS_MODEM_SUPPORT - if (config->enableRxRTS) - { - /* Enable receiver RTS(request-to-send) function. */ - base->MODEM |= UART_MODEM_RXRTSE_MASK; - } - if (config->enableTxCTS) - { - /* Enable transmitter CTS(clear-to-send) function. */ - base->MODEM |= UART_MODEM_TXCTSE_MASK; - } -#endif - - /* Enable TX/RX base on configure structure. */ - temp = base->C2; - - if (config->enableTx) - { - temp |= UART_C2_TE_MASK; - } - - if (config->enableRx) - { - temp |= UART_C2_RE_MASK; - } - - base->C2 = temp; - - return kStatus_Success; -} - -/*! - * brief Deinitializes a UART instance. - * - * This function waits for TX complete, disables TX and RX, and disables the UART clock. - * - * param base UART peripheral base address. - */ -void UART_Deinit(UART_Type *base) -{ -#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO - /* Wait tx FIFO send out*/ - while (0U != base->TCFIFO) - { - } -#endif - /* Wait last char shoft out */ - while (0U == (base->S1 & UART_S1_TC_MASK)) - { - } - - /* Disable the module. */ - base->C2 = 0; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable uart clock */ - CLOCK_DisableClock(s_uartClock[UART_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Gets the default configuration structure. - * - * This function initializes the UART configuration structure to a default value. The default - * values are as follows. - * uartConfig->baudRate_Bps = 115200U; - * uartConfig->bitCountPerChar = kUART_8BitsPerChar; - * uartConfig->parityMode = kUART_ParityDisabled; - * uartConfig->stopBitCount = kUART_OneStopBit; - * uartConfig->txFifoWatermark = 0; - * uartConfig->rxFifoWatermark = 1; - * uartConfig->idleType = kUART_IdleTypeStartBit; - * uartConfig->enableTx = false; - * uartConfig->enableRx = false; - * - * param config Pointer to configuration structure. - */ -void UART_GetDefaultConfig(uart_config_t *config) -{ - assert(config != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->baudRate_Bps = 115200U; - config->parityMode = kUART_ParityDisabled; -#if defined(FSL_FEATURE_UART_HAS_STOP_BIT_CONFIG_SUPPORT) && FSL_FEATURE_UART_HAS_STOP_BIT_CONFIG_SUPPORT - config->stopBitCount = kUART_OneStopBit; -#endif -#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO - config->txFifoWatermark = 0; - config->rxFifoWatermark = 1; -#endif -#if defined(FSL_FEATURE_UART_HAS_MODEM_SUPPORT) && FSL_FEATURE_UART_HAS_MODEM_SUPPORT - config->enableRxRTS = false; - config->enableTxCTS = false; -#endif - config->idleType = kUART_IdleTypeStartBit; - config->enableTx = false; - config->enableRx = false; -} - -/*! - * brief Sets the UART instance baud rate. - * - * This function configures the UART module baud rate. This function is used to update - * the UART module baud rate after the UART module is initialized by the UART_Init. - * code - * UART_SetBaudRate(UART1, 115200U, 20000000U); - * endcode - * - * param base UART peripheral base address. - * param baudRate_Bps UART baudrate to be set. - * param srcClock_Hz UART clock source frequency in Hz. - * retval kStatus_UART_BaudrateNotSupport Baudrate is not support in the current clock source. - * retval kStatus_Success Set baudrate succeeded. - */ -status_t UART_SetBaudRate(UART_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz) -{ - assert(baudRate_Bps != 0U); - - uint32_t sbr = 0; - uint32_t baudDiff = 0; - uint8_t oldCtrl; - - /* Calculate the baud rate modulo divisor, sbr*/ - sbr = srcClock_Hz / (baudRate_Bps * 16U); - /* set sbrTemp to 1 if the sourceClockInHz can not satisfy the desired baud rate */ - if (sbr == 0U) - { - sbr = 1U; - } -#if defined(FSL_FEATURE_UART_HAS_BAUD_RATE_FINE_ADJUST_SUPPORT) && FSL_FEATURE_UART_HAS_BAUD_RATE_FINE_ADJUST_SUPPORT - /* Determine if a fractional divider is needed to fine tune closer to the - * desired baud, each value of brfa is in 1/32 increments, - * hence the multiply-by-32. */ - uint32_t tempBaud = 0U; - - uint32_t brfa = (2U * srcClock_Hz / (baudRate_Bps)) - 32U * sbr; - - /* Calculate the baud rate based on the temporary SBR values and BRFA */ - tempBaud = (srcClock_Hz * 2U / ((sbr * 32U + brfa))); - baudDiff = (tempBaud > baudRate_Bps) ? (tempBaud - baudRate_Bps) : (baudRate_Bps - tempBaud); -#else - /* Calculate the baud rate based on the temporary SBR values */ - baudDiff = (srcClock_Hz / (sbr * 16U)) - baudRate_Bps; - - /* Select the better value between sbr and (sbr + 1) */ - if (baudDiff > (baudRate_Bps - (srcClock_Hz / (16U * (sbr + 1U))))) - { - baudDiff = baudRate_Bps - (srcClock_Hz / (16U * (sbr + 1U))); - sbr++; - } -#endif - - /* next, check to see if actual baud rate is within 3% of desired baud rate - * based on the calculate SBR value */ - if (baudDiff < ((baudRate_Bps / 100U) * 3U)) - { - /* Store C2 before disable Tx and Rx */ - oldCtrl = base->C2; - - /* Disable UART TX RX before setting. */ - base->C2 &= ~((uint8_t)UART_C2_TE_MASK | (uint8_t)UART_C2_RE_MASK); - - /* Write the sbr value to the BDH and BDL registers*/ - base->BDH = (base->BDH & ~(uint8_t)UART_BDH_SBR_MASK) | (uint8_t)(sbr >> 8); - base->BDL = (uint8_t)sbr; - -#if defined(FSL_FEATURE_UART_HAS_BAUD_RATE_FINE_ADJUST_SUPPORT) && FSL_FEATURE_UART_HAS_BAUD_RATE_FINE_ADJUST_SUPPORT - /* Write the brfa value to the register*/ - base->C4 = (base->C4 & ~(uint8_t)UART_C4_BRFA_MASK) | ((uint8_t)brfa & (uint8_t)UART_C4_BRFA_MASK); -#endif - /* Restore C2. */ - base->C2 = oldCtrl; - - return kStatus_Success; - } - else - { - /* Unacceptable baud rate difference of more than 3%*/ - return kStatus_UART_BaudrateNotSupport; - } -} - -/*! - * brief Enable 9-bit data mode for UART. - * - * This function set the 9-bit mode for UART module. The 9th bit is not used for parity thus can be modified by user. - * - * param base UART peripheral base address. - * param enable true to enable, flase to disable. - */ -void UART_Enable9bitMode(UART_Type *base, bool enable) -{ - assert(base != NULL); - - uint8_t temp = 0U; - - if (enable) - { - /* Set UART_C1_M for 9-bit mode, clear UART_C1_PT and UART_C1_PE to disable parity. */ - temp = base->C1 & ~((uint8_t)UART_C1_PE_MASK | (uint8_t)UART_C1_PT_MASK | (uint8_t)UART_C1_M_MASK); - temp |= (uint8_t)UART_C1_M_MASK; - base->C1 = temp; - } - else - { - /* Clear UART_C1_M. */ - base->C1 &= ~(uint8_t)UART_C1_M_MASK; - } -} - -#if defined(FSL_FEATURE_UART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_UART_HAS_ADDRESS_MATCHING -/*! - * brief Transmit an address frame in 9-bit data mode. - * - * param base UART peripheral base address. - * param address UART slave address. - */ -void UART_SendAddress(UART_Type *base, uint8_t address) -{ - assert(base != NULL); - - /* Set address mark. */ - UART_Set9thTransmitBit(base); - /* Send address. */ - UART_WriteByte(base, address); - /* Clear address mark for following data transfer. */ - UART_Clear9thTransmitBit(base); -} -#endif - -/*! - * brief Enables UART interrupts according to the provided mask. - * - * This function enables the UART interrupts according to the provided mask. The mask - * is a logical OR of enumeration members. See ref _uart_interrupt_enable. - * For example, to enable TX empty interrupt and RX full interrupt, do the following. - * code - * UART_EnableInterrupts(UART1,kUART_TxDataRegEmptyInterruptEnable | kUART_RxDataRegFullInterruptEnable); - * endcode - * - * param base UART peripheral base address. - * param mask The interrupts to enable. Logical OR of ref _uart_interrupt_enable. - */ -void UART_EnableInterrupts(UART_Type *base, uint32_t mask) -{ - mask &= (uint32_t)kUART_AllInterruptsEnable; - - /* The interrupt mask is combined by control bits from several register: ((CFIFO<<24) | (C3<<16) | (C2<<8) |(BDH)) - */ - base->BDH |= (uint8_t)mask; - base->C2 |= (uint8_t)(mask >> 8); - base->C3 |= (uint8_t)(mask >> 16); - -#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO - base->CFIFO |= (uint8_t)(mask >> 24); -#endif -} - -/*! - * brief Disables the UART interrupts according to the provided mask. - * - * This function disables the UART interrupts according to the provided mask. The mask - * is a logical OR of enumeration members. See ref _uart_interrupt_enable. - * For example, to disable TX empty interrupt and RX full interrupt do the following. - * code - * UART_DisableInterrupts(UART1,kUART_TxDataRegEmptyInterruptEnable | kUART_RxDataRegFullInterruptEnable); - * endcode - * - * param base UART peripheral base address. - * param mask The interrupts to disable. Logical OR of ref _uart_interrupt_enable. - */ -void UART_DisableInterrupts(UART_Type *base, uint32_t mask) -{ - mask &= (uint32_t)kUART_AllInterruptsEnable; - - /* The interrupt mask is combined by control bits from several register: ((CFIFO<<24) | (C3<<16) | (C2<<8) |(BDH)) - */ - base->BDH &= ~(uint8_t)mask; - base->C2 &= ~(uint8_t)(mask >> 8); - base->C3 &= ~(uint8_t)(mask >> 16); - -#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO - base->CFIFO &= ~(uint8_t)(mask >> 24); -#endif -} - -/*! - * brief Gets the enabled UART interrupts. - * - * This function gets the enabled UART interrupts. The enabled interrupts are returned - * as the logical OR value of the enumerators ref _uart_interrupt_enable. To check - * a specific interrupts enable status, compare the return value with enumerators - * in ref _uart_interrupt_enable. - * For example, to check whether TX empty interrupt is enabled, do the following. - * code - * uint32_t enabledInterrupts = UART_GetEnabledInterrupts(UART1); - * - * if (kUART_TxDataRegEmptyInterruptEnable & enabledInterrupts) - * { - * ... - * } - * endcode - * - * param base UART peripheral base address. - * return UART interrupt flags which are logical OR of the enumerators in ref _uart_interrupt_enable. - */ -uint32_t UART_GetEnabledInterrupts(UART_Type *base) -{ - uint32_t temp; - - temp = (uint32_t)base->BDH; - temp |= ((uint32_t)(base->C2) << 8); - temp |= ((uint32_t)(base->C3) << 16); - -#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO - temp |= ((uint32_t)(base->CFIFO) << 24); -#endif - - return temp & (uint32_t)kUART_AllInterruptsEnable; -} - -/*! - * brief Gets UART status flags. - * - * This function gets all UART status flags. The flags are returned as the logical - * OR value of the enumerators ref _uart_flags. To check a specific status, - * compare the return value with enumerators in ref _uart_flags. - * For example, to check whether the TX is empty, do the following. - * code - * if (kUART_TxDataRegEmptyFlag & UART_GetStatusFlags(UART1)) - * { - * ... - * } - * endcode - * - * param base UART peripheral base address. - * return UART status flags which are ORed by the enumerators in the _uart_flags. - */ -uint32_t UART_GetStatusFlags(UART_Type *base) -{ - uint32_t status_flag; - - status_flag = (uint32_t)base->S1; - status_flag |= ((uint32_t)(base->S2) << 8); - -#if defined(FSL_FEATURE_UART_HAS_EXTENDED_DATA_REGISTER_FLAGS) && FSL_FEATURE_UART_HAS_EXTENDED_DATA_REGISTER_FLAGS - status_flag |= ((uint32_t)(base->ED) << 16); -#endif - -#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO - status_flag |= ((uint32_t)(base->SFIFO) << 24); -#endif - - return status_flag; -} - -/*! - * brief Clears status flags with the provided mask. - * - * This function clears UART status flags with a provided mask. An automatically cleared flag - * can't be cleared by this function. - * These flags can only be cleared or set by hardware. - * kUART_TxDataRegEmptyFlag, kUART_TransmissionCompleteFlag, kUART_RxDataRegFullFlag, - * kUART_RxActiveFlag, kUART_NoiseErrorInRxDataRegFlag, kUART_ParityErrorInRxDataRegFlag, - * kUART_TxFifoEmptyFlag,kUART_RxFifoEmptyFlag - * Note that this API should be called when the Tx/Rx is idle. Otherwise it has no effect. - * - * param base UART peripheral base address. - * param mask The status flags to be cleared; it is logical OR value of ref _uart_flags. - * retval kStatus_UART_FlagCannotClearManually The flag can't be cleared by this function but - * it is cleared automatically by hardware. - * retval kStatus_Success Status in the mask is cleared. - */ -status_t UART_ClearStatusFlags(UART_Type *base, uint32_t mask) -{ - uint8_t reg = base->S2; - status_t status; - -#if defined(FSL_FEATURE_UART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_UART_HAS_LIN_BREAK_DETECT - reg &= ~((uint8_t)UART_S2_RXEDGIF_MASK | (uint8_t)UART_S2_LBKDIF_MASK); -#else - reg &= ~(uint8_t)UART_S2_RXEDGIF_MASK; -#endif - - base->S2 = reg | (uint8_t)(mask >> 8); - -#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO - base->SFIFO = (uint8_t)(mask >> 24); -#endif - - if ((mask & ((uint32_t)kUART_IdleLineFlag | (uint32_t)kUART_NoiseErrorFlag | (uint32_t)kUART_FramingErrorFlag | - (uint32_t)kUART_ParityErrorFlag | (uint32_t)kUART_RxOverrunFlag)) != 0u) - { - /* Read base->S1 and base->D to clear the flags. */ - (void)base->S1; - (void)base->D; -#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO - /* Read base->D may cause receiver underflow when there are no valid data. - Clear receiver underflow flag */ - base->SFIFO = UART_SFIFO_RXUF_MASK; - /* Flush FIFO data. Otherwise FIFO pointer will be in unknown state. */ - base->CFIFO |= UART_CFIFO_RXFLUSH_MASK; -#endif - } - - /* If some flags still pending. */ - if ((mask & UART_GetStatusFlags(base)) != 0U) - { - /* Some flags can only clear or set by the hardware itself, these flags are: kUART_TxDataRegEmptyFlag, - kUART_TransmissionCompleteFlag, kUART_RxDataRegFullFlag, kUART_RxActiveFlag, kUART_NoiseErrorInRxDataRegFlag, - kUART_ParityErrorInRxDataRegFlag, kUART_TxFifoEmptyFlag, kUART_RxFifoEmptyFlag. */ - status = kStatus_UART_FlagCannotClearManually; - } - else - { - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Writes to the TX register using a blocking method. - * - * This function polls the TX register, waits for the TX register to be empty or for the TX FIFO - * to have room and writes data to the TX buffer. - * - * param base UART peripheral base address. - * param data Start address of the data to write. - * param length Size of the data to write. - * retval kStatus_UART_Timeout Transmission timed out and was aborted. - * retval kStatus_Success Successfully wrote all data. - */ -status_t UART_WriteBlocking(UART_Type *base, const uint8_t *data, size_t length) -{ -#if UART_RETRY_TIMES - uint32_t waitTimes; -#endif - while (0U != length--) - { -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; - while ((0U == (base->S1 & UART_S1_TDRE_MASK)) && (0U != --waitTimes)) -#else - while (0U == (base->S1 & UART_S1_TDRE_MASK)) -#endif - { - } -#if UART_RETRY_TIMES - if (waitTimes == 0U) - { - return kStatus_LPUART_Timeout; - } -#endif - base->D = *(data++); - } - - /* Ensure all the data in the transmit buffer are sent out to bus. */ -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; - while ((0U == (base->S1 & UART_S1_TC_MASK)) && (0U != --waitTimes)) -#else - while (0U == (base->S1 & UART_S1_TC_MASK)) -#endif - { - } -#if UART_RETRY_TIMES - if (waitTimes == 0U) - { - return kStatus_LPUART_Timeout; - } -#endif - return kStatus_Success; -} - -static void UART_WriteNonBlocking(UART_Type *base, const uint8_t *data, size_t length) -{ - assert(data != NULL); - - size_t i; - - /* The Non Blocking write data API assume user have ensured there is enough space in - peripheral to write. */ - for (i = 0; i < length; i++) - { - base->D = data[i]; - } -} - -/*! - * brief Read RX data register using a blocking method. - * - * This function polls the RX register, waits for the RX register to be full or for RX FIFO to - * have data, and reads data from the TX register. - * - * param base UART peripheral base address. - * param data Start address of the buffer to store the received data. - * param length Size of the buffer. - * retval kStatus_UART_RxHardwareOverrun Receiver overrun occurred while receiving data. - * retval kStatus_UART_NoiseError A noise error occurred while receiving data. - * retval kStatus_UART_FramingError A framing error occurred while receiving data. - * retval kStatus_UART_ParityError A parity error occurred while receiving data. - * retval kStatus_UART_Timeout Transmission timed out and was aborted. - * retval kStatus_Success Successfully received all data. - */ -status_t UART_ReadBlocking(UART_Type *base, uint8_t *data, size_t length) -{ - assert(data != NULL); - - status_t status = kStatus_Success; - uint32_t statusFlag; -#if UART_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (length-- != 0U) - { -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; -#endif -#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO - while (base->RCFIFO == 0U) -#else - while ((base->S1 & UART_S1_RDRF_MASK) == 0U) -#endif - { -#if UART_RETRY_TIMES - if (0U == --waitTimes) - { - status = kStatus_LPUART_Timeout; - break; - } -#endif - statusFlag = UART_GetStatusFlags(base); - - if (0U != (statusFlag & (uint32_t)kUART_RxOverrunFlag)) - { - status = ((kStatus_Success == UART_ClearStatusFlags(base, (uint32_t)kUART_RxOverrunFlag)) ? - (status_t)(kStatus_UART_RxHardwareOverrun) : - (status_t)(kStatus_UART_FlagCannotClearManually)); - /* If the OR bit is set all the other error flags are prevented from setting, - no need to check other status flags. */ - break; - } - - if (0U != (statusFlag & (uint32_t)kUART_ParityErrorFlag)) - { - status = ((kStatus_Success == UART_ClearStatusFlags(base, (uint32_t)kUART_ParityErrorFlag)) ? - (status_t)(kStatus_UART_ParityError) : - (status_t)(kStatus_UART_FlagCannotClearManually)); - } - - if (0U != (statusFlag & (uint32_t)kUART_FramingErrorFlag)) - { - status = ((kStatus_Success == UART_ClearStatusFlags(base, (uint32_t)kUART_FramingErrorFlag)) ? - (status_t)(kStatus_UART_FramingError) : - (status_t)(kStatus_UART_FlagCannotClearManually)); - } - - if (0U != (statusFlag & (uint32_t)kUART_NoiseErrorFlag)) - { - status = ((kStatus_Success == UART_ClearStatusFlags(base, (uint32_t)kUART_NoiseErrorFlag)) ? - (status_t)(kStatus_UART_NoiseError) : - (status_t)(kStatus_UART_FlagCannotClearManually)); - } - if (kStatus_Success != status) - { - break; - } - } - if (kStatus_Success == status) - { - *(data++) = base->D; - } - else - { - break; - } - } - - return status; -} - -static void UART_ReadNonBlocking(UART_Type *base, uint8_t *data, size_t length) -{ - assert(data != NULL); - - size_t i; - - /* The Non Blocking read data API assume user have ensured there is enough space in - peripheral to write. */ - for (i = 0; i < length; i++) - { - data[i] = base->D; - } -} - -/*! - * brief Initializes the UART handle. - * - * This function initializes the UART handle which can be used for other UART - * transactional APIs. Usually, for a specified UART instance, - * call this API once to get the initialized handle. - * - * param base UART peripheral base address. - * param handle UART handle pointer. - * param callback The callback function. - * param userData The parameter of the callback function. - */ -void UART_TransferCreateHandle(UART_Type *base, - uart_handle_t *handle, - uart_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - uint32_t instance; - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Set the TX/RX state. */ - handle->rxState = (uint8_t)kUART_RxIdle; - handle->txState = (uint8_t)kUART_TxIdle; - - /* Set the callback and user data. */ - handle->callback = callback; - handle->userData = userData; - - /* Get instance from peripheral base address. */ - instance = UART_GetInstance(base); - - /* Save the handle in global variables to support the double weak mechanism. */ - s_uartHandle[instance] = handle; - - s_uartIsr = UART_TransferHandleIRQ; - /* Enable interrupt in NVIC. */ - (void)EnableIRQ(s_uartIRQ[instance]); -} - -/*! - * brief Sets up the RX ring buffer. - * - * This function sets up the RX ring buffer to a specific UART handle. - * - * When the RX ring buffer is used, data received are stored into the ring buffer even when the - * user doesn't call the UART_TransferReceiveNonBlocking() API. If data is already received - * in the ring buffer, the user can get the received data from the ring buffer directly. - * - * note When using the RX ring buffer, one byte is reserved for internal use. In other - * words, if p ringBufferSize is 32, only 31 bytes are used for saving data. - * - * param base UART peripheral base address. - * param handle UART handle pointer. - * param ringBuffer Start address of the ring buffer for background receiving. Pass NULL to disable the ring buffer. - * param ringBufferSize Size of the ring buffer. - */ -void UART_TransferStartRingBuffer(UART_Type *base, uart_handle_t *handle, uint8_t *ringBuffer, size_t ringBufferSize) -{ - assert(handle != NULL); - assert(ringBuffer != NULL); - - /* Setup the ringbuffer address */ - handle->rxRingBuffer = ringBuffer; - handle->rxRingBufferSize = ringBufferSize; - handle->rxRingBufferHead = 0U; - handle->rxRingBufferTail = 0U; - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. */ - uint32_t irqMask = DisableGlobalIRQ(); - /* Enable the interrupt to accept the data when user need the ring buffer. */ - base->C2 |= (uint8_t)UART_C2_RIE_MASK; - base->C3 |= ((uint8_t)UART_C3_ORIE_MASK | (uint8_t)UART_C3_FEIE_MASK); - /* Enable parity error interrupt when parity mode is enable*/ - if (((uint8_t)UART_C1_PE_MASK & base->C1) != 0U) - { - base->C3 |= (uint8_t)UART_C3_PEIE_MASK; - } - EnableGlobalIRQ(irqMask); -} - -/*! - * brief Aborts the background transfer and uninstalls the ring buffer. - * - * This function aborts the background transfer and uninstalls the ring buffer. - * - * param base UART peripheral base address. - * param handle UART handle pointer. - */ -void UART_TransferStopRingBuffer(UART_Type *base, uart_handle_t *handle) -{ - assert(handle != NULL); - - if (handle->rxState == (uint8_t)kUART_RxIdle) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. - */ - uint32_t irqMask = DisableGlobalIRQ(); - base->C2 &= ~(uint8_t)UART_C2_RIE_MASK; - base->C3 &= ~((uint8_t)UART_C3_ORIE_MASK | (uint8_t)UART_C3_FEIE_MASK); - /* Disable parity error interrupt when parity mode is enable*/ - if (((uint8_t)UART_C1_PE_MASK & base->C1) != 0U) - { - base->C3 &= ~(uint8_t)UART_C3_PEIE_MASK; - } - EnableGlobalIRQ(irqMask); - } - - handle->rxRingBuffer = NULL; - handle->rxRingBufferSize = 0U; - handle->rxRingBufferHead = 0U; - handle->rxRingBufferTail = 0U; -} - -/*! - * brief Transmits a buffer of data using the interrupt method. - * - * This function sends data using an interrupt method. This is a non-blocking function, which - * returns directly without waiting for all data to be written to the TX register. When - * all data is written to the TX register in the ISR, the UART driver calls the callback - * function and passes the ref kStatus_UART_TxIdle as status parameter. - * - * note The kStatus_UART_TxIdle is passed to the upper layer when all data is written - * to the TX register. However, it does not ensure that all data is sent out. Before disabling the TX, - * check the kUART_TransmissionCompleteFlag to ensure that the TX is finished. - * - * param base UART peripheral base address. - * param handle UART handle pointer. - * param xfer UART transfer structure. See #uart_transfer_t. - * retval kStatus_Success Successfully start the data transmission. - * retval kStatus_UART_TxBusy Previous transmission still not finished; data not all written to TX register yet. - * retval kStatus_InvalidArgument Invalid argument. - */ -status_t UART_TransferSendNonBlocking(UART_Type *base, uart_handle_t *handle, uart_transfer_t *xfer) -{ - assert(handle != NULL); - assert(xfer != NULL); - assert(xfer->dataSize != 0U); - assert(xfer->txData != NULL); - - status_t status; - - /* Return error if current TX busy. */ - if ((uint8_t)kUART_TxBusy == handle->txState) - { - status = kStatus_UART_TxBusy; - } - else - { - handle->txData = xfer->txData; - handle->txDataSize = xfer->dataSize; - handle->txDataSizeAll = xfer->dataSize; - handle->txState = (uint8_t)kUART_TxBusy; - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. - */ - uint32_t irqMask = DisableGlobalIRQ(); - /* Enable transmitter interrupt. */ - base->C2 |= (uint8_t)UART_C2_TIE_MASK; - EnableGlobalIRQ(irqMask); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Aborts the interrupt-driven data transmit. - * - * This function aborts the interrupt-driven data sending. The user can get the remainBytes to find out - * how many bytes are not sent out. - * - * param base UART peripheral base address. - * param handle UART handle pointer. - */ -void UART_TransferAbortSend(UART_Type *base, uart_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. */ - uint32_t irqMask = DisableGlobalIRQ(); - base->C2 &= ~((uint8_t)UART_C2_TIE_MASK | (uint8_t)UART_C2_TCIE_MASK); - EnableGlobalIRQ(irqMask); - - handle->txDataSize = 0; - handle->txState = (uint8_t)kUART_TxIdle; -} - -/*! - * brief Gets the number of bytes sent out to bus. - * - * This function gets the number of bytes sent out to bus by using the interrupt method. - * - * param base UART peripheral base address. - * param handle UART handle pointer. - * param count Send bytes count. - * retval kStatus_NoTransferInProgress No send in progress. - * retval kStatus_InvalidArgument The parameter is invalid. - * retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t UART_TransferGetSendCount(UART_Type *base, uart_handle_t *handle, uint32_t *count) -{ - assert(handle != NULL); - assert(count != NULL); - - if ((uint8_t)kUART_TxIdle == handle->txState) - { - return kStatus_NoTransferInProgress; - } -#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO - *count = handle->txDataSizeAll - handle->txDataSize - base->TCFIFO; -#else - if ((base->S1 & (uint8_t)kUART_TxDataRegEmptyFlag) != 0U) - { - *count = handle->txDataSizeAll - handle->txDataSize; - } - else - { - *count = handle->txDataSizeAll - handle->txDataSize - 1U; - } -#endif /* FSL_FEATURE_UART_HAS_FIFO */ - - return kStatus_Success; -} - -/*! - * brief Receives a buffer of data using an interrupt method. - * - * This function receives data using an interrupt method. This is a non-blocking function, which - * returns without waiting for all data to be received. - * If the RX ring buffer is used and not empty, the data in the ring buffer is copied and - * the parameter p receivedBytes shows how many bytes are copied from the ring buffer. - * After copying, if the data in the ring buffer is not enough to read, the receive - * request is saved by the UART driver. When the new data arrives, the receive request - * is serviced first. When all data is received, the UART driver notifies the upper layer - * through a callback function and passes the status parameter ref kStatus_UART_RxIdle. - * For example, the upper layer needs 10 bytes but there are only 5 bytes in the ring buffer. - * The 5 bytes are copied to the xfer->data and this function returns with the - * parameter p receivedBytes set to 5. For the left 5 bytes, newly arrived data is - * saved from the xfer->data[5]. When 5 bytes are received, the UART driver notifies the upper layer. - * If the RX ring buffer is not enabled, this function enables the RX and RX interrupt - * to receive data to the xfer->data. When all data is received, the upper layer is notified. - * - * param base UART peripheral base address. - * param handle UART handle pointer. - * param xfer UART transfer structure, see #uart_transfer_t. - * param receivedBytes Bytes received from the ring buffer directly. - * retval kStatus_Success Successfully queue the transfer into transmit queue. - * retval kStatus_UART_RxBusy Previous receive request is not finished. - * retval kStatus_InvalidArgument Invalid argument. - */ -status_t UART_TransferReceiveNonBlocking(UART_Type *base, - uart_handle_t *handle, - uart_transfer_t *xfer, - size_t *receivedBytes) -{ - assert(handle != NULL); - assert(xfer != NULL); - assert(xfer->rxData != NULL); - assert(xfer->dataSize != 0U); - - uint32_t i; - status_t status; - /* How many bytes to copy from ring buffer to user memory. */ - size_t bytesToCopy = 0U; - /* How many bytes to receive. */ - size_t bytesToReceive; - /* How many bytes currently have received. */ - size_t bytesCurrentReceived; - uint32_t irqMask; - - /* How to get data: - 1. If RX ring buffer is not enabled, then save xfer->data and xfer->dataSize - to uart handle, enable interrupt to store received data to xfer->data. When - all data received, trigger callback. - 2. If RX ring buffer is enabled and not empty, get data from ring buffer first. - If there are enough data in ring buffer, copy them to xfer->data and return. - If there are not enough data in ring buffer, copy all of them to xfer->data, - save the xfer->data remained empty space to uart handle, receive data - to this empty space and trigger callback when finished. */ - - if ((uint8_t)kUART_RxBusy == handle->rxState) - { - status = kStatus_UART_RxBusy; - } - else - { - bytesToReceive = xfer->dataSize; - bytesCurrentReceived = 0U; - - /* If RX ring buffer is used. */ - if (handle->rxRingBuffer != NULL) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - /* Disable UART RX IRQ, protect ring buffer. */ - base->C2 &= ~(uint8_t)UART_C2_RIE_MASK; - EnableGlobalIRQ(irqMask); - - /* How many bytes in RX ring buffer currently. */ - bytesToCopy = UART_TransferGetRxRingBufferLength(handle); - - if (bytesToCopy != 0U) - { - bytesToCopy = MIN(bytesToReceive, bytesToCopy); - - bytesToReceive -= bytesToCopy; - - /* Copy data from ring buffer to user memory. */ - for (i = 0U; i < bytesToCopy; i++) - { - xfer->rxData[bytesCurrentReceived++] = handle->rxRingBuffer[handle->rxRingBufferTail]; - - /* Wrap to 0. Not use modulo (%) because it might be large and slow. */ - if ((size_t)handle->rxRingBufferTail + 1U == handle->rxRingBufferSize) - { - handle->rxRingBufferTail = 0U; - } - else - { - handle->rxRingBufferTail++; - } - } - } - - /* If ring buffer does not have enough data, still need to read more data. */ - if (bytesToReceive != 0U) - { - /* No data in ring buffer, save the request to UART handle. */ - handle->rxData = xfer->rxData + bytesCurrentReceived; - handle->rxDataSize = bytesToReceive; - handle->rxDataSizeAll = xfer->dataSize; - handle->rxState = (uint8_t)kUART_RxBusy; - } - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - /* Re-enable UART RX IRQ. */ - base->C2 |= (uint8_t)UART_C2_RIE_MASK; - EnableGlobalIRQ(irqMask); - - /* Call user callback since all data are received. */ - if (0U == bytesToReceive) - { - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_UART_RxIdle, handle->userData); - } - } - } - /* Ring buffer not used. */ - else - { - handle->rxData = xfer->rxData + bytesCurrentReceived; - handle->rxDataSize = bytesToReceive; - handle->rxDataSizeAll = bytesToReceive; - handle->rxState = (uint8_t)kUART_RxBusy; - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - /* Enable RX/Rx overrun/framing error/idle line interrupt. */ - base->C2 |= ((uint8_t)UART_C2_RIE_MASK | (uint8_t)UART_C2_ILIE_MASK); - base->C3 |= ((uint8_t)UART_C3_ORIE_MASK | (uint8_t)UART_C3_FEIE_MASK); - - /* Enable parity error interrupt when parity mode is enable*/ - if (((uint8_t)UART_C1_PE_MASK & base->C1) != 0U) - { - base->C3 |= (uint8_t)UART_C3_PEIE_MASK; - } - EnableGlobalIRQ(irqMask); - } - - /* Return the how many bytes have read. */ - if (receivedBytes != NULL) - { - *receivedBytes = bytesCurrentReceived; - } - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Aborts the interrupt-driven data receiving. - * - * This function aborts the interrupt-driven data receiving. The user can get the remainBytes to know - * how many bytes are not received yet. - * - * param base UART peripheral base address. - * param handle UART handle pointer. - */ -void UART_TransferAbortReceive(UART_Type *base, uart_handle_t *handle) -{ - assert(handle != NULL); - - /* Only abort the receive to handle->rxData, the RX ring buffer is still working. */ - if (NULL == handle->rxRingBuffer) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. - */ - uint32_t irqMask = DisableGlobalIRQ(); - /* Disable RX interrupt. */ - base->C2 &= ~((uint8_t)UART_C2_RIE_MASK | (uint8_t)UART_C2_ILIE_MASK); - base->C3 &= ~((uint8_t)UART_C3_ORIE_MASK | (uint8_t)UART_C3_FEIE_MASK); - /* Disable parity error interrupt when parity mode is enable*/ - if (((uint8_t)UART_C1_PE_MASK & base->C1) != 0U) - { - base->C3 &= ~(uint8_t)UART_C3_PEIE_MASK; - } - EnableGlobalIRQ(irqMask); - } - - handle->rxDataSize = 0U; - handle->rxState = (uint8_t)kUART_RxIdle; -} - -/*! - * brief Gets the number of bytes that have been received. - * - * This function gets the number of bytes that have been received. - * - * param base UART peripheral base address. - * param handle UART handle pointer. - * param count Receive bytes count. - * retval kStatus_NoTransferInProgress No receive in progress. - * retval kStatus_InvalidArgument Parameter is invalid. - * retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t UART_TransferGetReceiveCount(UART_Type *base, uart_handle_t *handle, uint32_t *count) -{ - assert(handle != NULL); - assert(count != NULL); - - if ((uint8_t)kUART_RxIdle == handle->rxState) - { - return kStatus_NoTransferInProgress; - } - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - *count = handle->rxDataSizeAll - handle->rxDataSize; - - return kStatus_Success; -} - -#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO -/*! - * @brief Enables or disables the UART Tx FIFO. - * - * This function enables or disables the UART Tx FIFO. - * - * param base UART peripheral base address. - * param enable true to enable, false to disable. - * retval kStatus_Success Successfully turn on or turn off Tx FIFO. - * retval kStatus_Fail Fail to turn on or turn off Tx FIFO. - */ -status_t UART_EnableTxFIFO(UART_Type *base, bool enable) -{ - uint8_t sfifo = 0; - uint8_t temp = 0; - - sfifo = base->SFIFO; - temp = base->C2 & (UART_C2_RE_MASK | UART_C2_TE_MASK); - /* The Tx FIFO must be empty */ - if ((sfifo & UART_SFIFO_TXEMPT_MASK) == UART_SFIFO_TXEMPT_MASK) - { - /* Disable UART TX RX before setting */ - base->C2 &= ~((uint8_t)UART_C2_TE_MASK | (uint8_t)UART_C2_RE_MASK); - /* Flush FIFO */ - base->CFIFO |= (UART_CFIFO_TXFLUSH_MASK | UART_CFIFO_RXFLUSH_MASK); - - if (enable) - { - base->PFIFO |= (uint8_t)UART_PFIFO_TXFE_MASK; - } - else - { - base->PFIFO &= ~(uint8_t)UART_PFIFO_TXFE_MASK; - } - - /* Flush FIFO */ - base->CFIFO |= (UART_CFIFO_TXFLUSH_MASK | UART_CFIFO_RXFLUSH_MASK); - base->C2 |= temp; - return kStatus_Success; - } - else - { - return kStatus_Fail; - } -} - -/*! - * @brief Enables or disables the UART Rx FIFO. - * - * This function enables or disables the UART Rx FIFO. - * - * param base UART peripheral base address. - * param enable true to enable, false to disable. - * retval kStatus_Success Successfully turn on or turn off Rx FIFO. - * retval kStatus_Fail Fail to turn on or turn off Rx FIFO. - */ -status_t UART_EnableRxFIFO(UART_Type *base, bool enable) -{ - uint8_t sfifo = 0; - uint8_t temp = 0; - - sfifo = base->SFIFO; - temp = base->C2 & ((uint8_t)UART_C2_RE_MASK | (uint8_t)UART_C2_TE_MASK); - /* The Rx FIFO must be empty */ - if ((sfifo & UART_SFIFO_RXEMPT_MASK) == UART_SFIFO_RXEMPT_MASK) - { - /* Disable UART TX RX before setting */ - base->C2 &= ~((uint8_t)UART_C2_TE_MASK | (uint8_t)UART_C2_RE_MASK); - /* Flush FIFO */ - base->CFIFO |= (UART_CFIFO_TXFLUSH_MASK | UART_CFIFO_RXFLUSH_MASK); - - if (enable) - { - base->PFIFO |= (uint8_t)UART_PFIFO_RXFE_MASK; - } - else - { - base->PFIFO &= ~(uint8_t)UART_PFIFO_RXFE_MASK; - } - /* Flush FIFO */ - base->CFIFO |= (UART_CFIFO_TXFLUSH_MASK | UART_CFIFO_RXFLUSH_MASK); - base->C2 |= temp; - return kStatus_Success; - } - else - { - return kStatus_Fail; - } -} -#endif /* FSL_FEATURE_UART_HAS_FIFO */ - -/*! - * brief UART IRQ handle function. - * - * This function handles the UART transmit and receive IRQ request. - * - * param base UART peripheral base address. - * param irqHandle UART handle pointer. - */ -void UART_TransferHandleIRQ(UART_Type *base, void *irqHandle) -{ - assert(irqHandle != NULL); - - uint8_t count; - uint8_t tempCount; - uint32_t status = UART_GetStatusFlags(base); - uint8_t tmpdata; - uint32_t irqMask; - uart_handle_t *handle = (uart_handle_t *)irqHandle; - - /* If RX framing error */ - if (((uint32_t)kUART_FramingErrorFlag & status) != 0U) - { - /* Read base->D to clear framing error flag, otherwise the RX does not work. */ - while ((base->S1 & UART_S1_RDRF_MASK) != 0U) - { - (void)base->D; - } -#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO - /* Flush FIFO date, otherwise FIFO pointer will be in unknown state. */ - base->CFIFO |= UART_CFIFO_RXFLUSH_MASK; -#endif - - handle->rxState = (uint8_t)kUART_RxFramingError; - handle->rxDataSize = 0U; - /* Trigger callback. */ - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_UART_FramingError, handle->userData); - } - } - - /* If RX parity error */ - if (((uint32_t)kUART_ParityErrorFlag & status) != 0U) - { - /* Read base->D to clear parity error flag, otherwise the RX does not work. */ - while ((base->S1 & UART_S1_RDRF_MASK) != 0U) - { - (void)base->D; - } -#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO - /* Flush FIFO date, otherwise FIFO pointer will be in unknown state. */ - base->CFIFO |= UART_CFIFO_RXFLUSH_MASK; -#endif - - handle->rxState = (uint8_t)kUART_RxParityError; - handle->rxDataSize = 0U; - /* Trigger callback. */ - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_UART_ParityError, handle->userData); - } - } - - /* If RX overrun. */ - if (((uint32_t)kUART_RxOverrunFlag & status) != 0U) - { - /* Read base->D to clear overrun flag, otherwise the RX does not work. */ - while ((base->S1 & UART_S1_RDRF_MASK) != 0U) - { - (void)base->D; - } -#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO - /* Flush FIFO date, otherwise FIFO pointer will be in unknown state. */ - base->CFIFO |= UART_CFIFO_RXFLUSH_MASK; -#endif - /* Trigger callback. */ - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_UART_RxHardwareOverrun, handle->userData); - } - } - - /* If IDLE line was detected. */ - if ((((uint32_t)kUART_IdleLineFlag & status) != 0U) && ((UART_C2_ILIE_MASK & base->C2) != 0U)) - { -#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO - /* If still some data in the FIFO, read out these data to user data buffer. */ - count = base->RCFIFO; - /* If handle->rxDataSize is not 0, first save data to handle->rxData. */ - while ((count != 0U) && (handle->rxDataSize != 0U)) - { - tempCount = (uint8_t)MIN(handle->rxDataSize, (uint32_t)count); - - /* Using non block API to read the data from the registers. */ - UART_ReadNonBlocking(base, handle->rxData, tempCount); - handle->rxData += tempCount; - handle->rxDataSize -= tempCount; - count -= tempCount; - - /* If all the data required for upper layer is ready, trigger callback. */ - if (0U == handle->rxDataSize) - { - handle->rxState = (uint8_t)kUART_RxIdle; - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - /* Disable RX interrupt/overrun interrupt/fram error/idle line detected interrupt */ - base->C2 &= ~(uint8_t)UART_C2_RIE_MASK; - base->C3 &= ~((uint8_t)UART_C3_ORIE_MASK | (uint8_t)UART_C3_FEIE_MASK); - /* Disable parity error interrupt when parity mode is enabled */ - if (((uint8_t)UART_C1_PE_MASK & base->C1) != 0U) - { - base->C3 &= ~(uint8_t)UART_C3_PEIE_MASK; - } - EnableGlobalIRQ(irqMask); - - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_UART_RxIdle, handle->userData); - } - } - } -#endif - /* To clear IDLE, read UART status S1 with IDLE set and then read D.*/ - while ((UART_S1_IDLE_MASK & base->S1) != 0U) - { - (void)base->D; - } -#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO - /* Flush FIFO date, otherwise FIFO pointer will be in unknown state. */ - base->CFIFO |= UART_CFIFO_RXFLUSH_MASK; -#endif - /* If rxDataSize is 0, disable idle line interrupt.*/ - if (0U == (handle->rxDataSize)) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - base->C2 &= ~(uint8_t)UART_C2_ILIE_MASK; - EnableGlobalIRQ(irqMask); - } - /* If callback is not NULL and rxDataSize is not 0. */ - if ((handle->callback != NULL) && (handle->rxDataSize != 0U)) - { - handle->callback(base, handle, kStatus_UART_IdleLineDetected, handle->userData); - } - } - /* Receive data register full */ - if ((((uint32_t)kUART_RxDataRegFullFlag & status) != 0U) && ((UART_C2_RIE_MASK & base->C2) != 0U)) - { -/* Get the size that can be stored into buffer for this interrupt. */ -#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO - count = base->RCFIFO; -#else - count = 1; -#endif - - /* If handle->rxDataSize is not 0, first save data to handle->rxData. */ - while ((count != 0U) && (handle->rxDataSize != 0U)) - { -#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO - tempCount = (uint8_t)MIN(handle->rxDataSize, (uint32_t)count); -#else - tempCount = 1; -#endif - - /* Using non block API to read the data from the registers. */ - UART_ReadNonBlocking(base, handle->rxData, tempCount); - handle->rxData += tempCount; - handle->rxDataSize -= tempCount; - count -= tempCount; - - /* If all the data required for upper layer is ready, trigger callback. */ - if (0U == handle->rxDataSize) - { - handle->rxState = (uint8_t)kUART_RxIdle; - - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_UART_RxIdle, handle->userData); - } - } - } - - /* If use RX ring buffer, receive data to ring buffer. */ - if (handle->rxRingBuffer != NULL) - { - while (0U != count--) - { - /* If RX ring buffer is full, trigger callback to notify over run. */ - if (UART_TransferIsRxRingBufferFull(handle)) - { - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_UART_RxRingBufferOverrun, handle->userData); - } - } - - /* If ring buffer is still full after callback function, the oldest data is overridden. */ - if (UART_TransferIsRxRingBufferFull(handle)) - { - /* Increase handle->rxRingBufferTail to make room for new data. */ - if ((size_t)handle->rxRingBufferTail + 1U == handle->rxRingBufferSize) - { - handle->rxRingBufferTail = 0U; - } - else - { - handle->rxRingBufferTail++; - } - } - - /* Read data. */ - tmpdata = base->D; - handle->rxRingBuffer[handle->rxRingBufferHead] = tmpdata; - - /* Increase handle->rxRingBufferHead. */ - if ((size_t)handle->rxRingBufferHead + 1U == handle->rxRingBufferSize) - { - handle->rxRingBufferHead = 0U; - } - else - { - handle->rxRingBufferHead++; - } - } - } - - else if (0U == handle->rxDataSize) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - /* Disable RX interrupt/overrun interrupt/fram error/idle line detected interrupt */ - base->C2 &= ~(uint8_t)UART_C2_RIE_MASK; - base->C3 &= ~((uint8_t)UART_C3_ORIE_MASK | (uint8_t)UART_C3_FEIE_MASK); - /* Disable parity error interrupt when parity mode is enabled */ - if (((uint8_t)UART_C1_PE_MASK & base->C1) != 0U) - { - base->C3 &= ~(uint8_t)UART_C3_PEIE_MASK; - } - EnableGlobalIRQ(irqMask); - } - else - { - } - } - - /* If framing error or parity error happened, stop the RX interrupt when use no ring buffer */ - if (((handle->rxState == (uint8_t)kUART_RxFramingError) || (handle->rxState == (uint8_t)kUART_RxParityError)) && - (NULL == handle->rxRingBuffer)) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. - */ - irqMask = DisableGlobalIRQ(); - /* Enable RX/Rx overrun/framing error/idle line interrupt. */ - base->C2 |= ((uint8_t)UART_C2_RIE_MASK | (uint8_t)UART_C2_ILIE_MASK); - base->C3 |= ((uint8_t)UART_C3_ORIE_MASK | (uint8_t)UART_C3_FEIE_MASK); - - /* Enable parity error interrupt when parity mode is enable*/ - if (((uint8_t)UART_C1_PE_MASK & base->C1) != 0U) - { - base->C3 |= (uint8_t)UART_C3_PEIE_MASK; - } - EnableGlobalIRQ(irqMask); - } - - /* Send data register empty and the interrupt is enabled. */ - if ((((uint32_t)kUART_TxDataRegEmptyFlag & status) != 0U) && ((base->C2 & UART_C2_TIE_MASK) != 0U)) - { -/* Get the bytes that available at this moment. */ -#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO - count = (uint8_t)FSL_FEATURE_UART_FIFO_SIZEn(base) - base->TCFIFO; -#else - count = 1; -#endif - - while ((count != 0U) && (handle->txDataSize != 0U)) - { -#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO - tempCount = (uint8_t)MIN(handle->txDataSize, (uint32_t)count); -#else - tempCount = 1; -#endif - - /* Using non block API to write the data to the registers. */ - UART_WriteNonBlocking(base, handle->txData, tempCount); - handle->txData += tempCount; - handle->txDataSize -= tempCount; - count -= tempCount; - - /* If all the data are written to data register, TX finished. */ - if (0U == handle->txDataSize) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - /* Disable TX register empty interrupt and enable transmission complete interrupt. */ - base->C2 = (base->C2 & ~(uint8_t)UART_C2_TIE_MASK) | (uint8_t)UART_C2_TCIE_MASK; - EnableGlobalIRQ(irqMask); - } - } - } - - /* Transmission complete and the interrupt is enabled. */ - if ((0U != ((uint32_t)kUART_TransmissionCompleteFlag & status)) && (0U != (base->C2 & UART_C2_TCIE_MASK))) - { - /* Set txState to idle only when all data has been sent out to bus. */ - handle->txState = (uint8_t)kUART_TxIdle; - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. - */ - irqMask = DisableGlobalIRQ(); - /* Disable transmission complete interrupt. */ - base->C2 &= ~(uint8_t)UART_C2_TCIE_MASK; - EnableGlobalIRQ(irqMask); - - /* Trigger callback. */ - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_UART_TxIdle, handle->userData); - } - } -} - -/*! - * brief UART Error IRQ handle function. - * - * This function handles the UART error IRQ request. - * - * param base UART peripheral base address. - * param irqHandle UART handle pointer. - */ -void UART_TransferHandleErrorIRQ(UART_Type *base, void *irqHandle) -{ - /* To be implemented by User. */ -} - -#if defined(FSL_FEATURE_UART_HAS_SHARED_IRQ0_IRQ1_IRQ2_IRQ3) && FSL_FEATURE_UART_HAS_SHARED_IRQ0_IRQ1_IRQ2_IRQ3 -void UART0_UART1_UART2_UART3_DriverIRQHandler(void); -void UART0_UART1_UART2_UART3_DriverIRQHandler(void) -{ - for (uint32_t instance = 0U; instance < 4U; instance++) - { - if (s_uartHandle[instance] != NULL) - { - s_uartIsr(s_uartBases[instance], s_uartHandle[instance]); - } - } -} -#else -#if defined(FSL_FEATURE_UART_HAS_SHARED_IRQ0_IRQ1) && FSL_FEATURE_UART_HAS_SHARED_IRQ0_IRQ1 -void UART0_UART1_DriverIRQHandler(void); -void UART0_UART1_DriverIRQHandler(void) -{ - for (uint32_t instance = 0U; instance < 2U; instance++) - { - if (s_uartHandle[instance] != NULL) - { - s_uartIsr(s_uartBases[instance], s_uartHandle[instance]); - } - } -} -#else /* FSL_FEATURE_UART_HAS_SHARED_IRQ0_IRQ1 */ -#if defined(UART0) -#if ((!(defined(FSL_FEATURE_SOC_LPSCI_COUNT))) || \ - ((defined(FSL_FEATURE_SOC_LPSCI_COUNT)) && (FSL_FEATURE_SOC_LPSCI_COUNT == 0))) -void UART0_DriverIRQHandler(void); -void UART0_DriverIRQHandler(void) -{ - s_uartIsr(UART0, s_uartHandle[0]); - SDK_ISR_EXIT_BARRIER; -} - -void UART0_RX_TX_DriverIRQHandler(void); -void UART0_RX_TX_DriverIRQHandler(void) -{ - UART0_DriverIRQHandler(); - SDK_ISR_EXIT_BARRIER; -} -#endif /* FSL_FEATURE_SOC_LPSCI_COUNT */ -#endif /* UART0 */ - -#if defined(UART1) -void UART1_DriverIRQHandler(void); -void UART1_DriverIRQHandler(void) -{ - s_uartIsr(UART1, s_uartHandle[1]); - SDK_ISR_EXIT_BARRIER; -} - -void UART1_RX_TX_DriverIRQHandler(void); -void UART1_RX_TX_DriverIRQHandler(void) -{ - UART1_DriverIRQHandler(); - SDK_ISR_EXIT_BARRIER; -} -#endif /* UART1 */ -#endif /* FSL_FEATURE_UART_HAS_SHARED_IRQ0_IRQ1 */ - -#if defined(FSL_FEATURE_UART_HAS_SHARED_IRQ2_IRQ3) && FSL_FEATURE_UART_HAS_SHARED_IRQ2_IRQ3 -void UART2_UART3_DriverIRQHandler(void); -void UART2_UART3_DriverIRQHandler(void) -{ - for (uint32_t instance = 2U; instance < 4U; instance++) - { - if (s_uartHandle[instance] != NULL) - { - s_uartIsr(s_uartBases[instance], s_uartHandle[instance]); - } - } -} -#else /* FSL_FEATURE_UART_HAS_SHARED_IRQ2_IRQ3 */ -#if defined(UART2) -void UART2_DriverIRQHandler(void); -void UART2_DriverIRQHandler(void) -{ - s_uartIsr(UART2, s_uartHandle[2]); - SDK_ISR_EXIT_BARRIER; -} - -void UART2_RX_TX_DriverIRQHandler(void); -void UART2_RX_TX_DriverIRQHandler(void) -{ - UART2_DriverIRQHandler(); - SDK_ISR_EXIT_BARRIER; -} -#endif /* UART2 */ - -#if defined(UART3) -void UART3_DriverIRQHandler(void); -void UART3_DriverIRQHandler(void) -{ - s_uartIsr(UART3, s_uartHandle[3]); - SDK_ISR_EXIT_BARRIER; -} - -void UART3_RX_TX_DriverIRQHandler(void); -void UART3_RX_TX_DriverIRQHandler(void) -{ - UART3_DriverIRQHandler(); - SDK_ISR_EXIT_BARRIER; -} -#endif /* UART3 */ -#endif /* FSL_FEATURE_UART_HAS_SHARED_IRQ2_IRQ3 */ -#endif /* FSL_FEATURE_UART_HAS_SHARED_IRQ0_IRQ1_IRQ2_IRQ3 */ - -#if defined(UART4) -void UART4_DriverIRQHandler(void); -void UART4_DriverIRQHandler(void) -{ - s_uartIsr(UART4, s_uartHandle[4]); - SDK_ISR_EXIT_BARRIER; -} - -void UART4_RX_TX_DriverIRQHandler(void); -void UART4_RX_TX_DriverIRQHandler(void) -{ - UART4_DriverIRQHandler(); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(UART5) -void UART5_DriverIRQHandler(void); -void UART5_DriverIRQHandler(void) -{ - s_uartIsr(UART5, s_uartHandle[5]); - SDK_ISR_EXIT_BARRIER; -} - -void UART5_RX_TX_DriverIRQHandler(void); -void UART5_RX_TX_DriverIRQHandler(void) -{ - UART5_DriverIRQHandler(); - SDK_ISR_EXIT_BARRIER; -} -#endif diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_uart.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_uart.h deleted file mode 100644 index 44d5419f6b1..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_uart.h +++ /dev/null @@ -1,979 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_UART_H_ -#define FSL_UART_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup uart_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief UART driver version. */ -#define FSL_UART_DRIVER_VERSION (MAKE_VERSION(2, 5, 1)) -/*! @} */ - -/*! @brief Retry times for waiting flag. */ -#ifndef UART_RETRY_TIMES -#define UART_RETRY_TIMES 0U /* Defining to zero means to keep waiting for the flag until it is assert/deassert. */ -#endif - -/*! @brief Error codes for the UART driver. */ -enum -{ - kStatus_UART_TxBusy = MAKE_STATUS(kStatusGroup_UART, 0), /*!< Transmitter is busy. */ - kStatus_UART_RxBusy = MAKE_STATUS(kStatusGroup_UART, 1), /*!< Receiver is busy. */ - kStatus_UART_TxIdle = MAKE_STATUS(kStatusGroup_UART, 2), /*!< UART transmitter is idle. */ - kStatus_UART_RxIdle = MAKE_STATUS(kStatusGroup_UART, 3), /*!< UART receiver is idle. */ - kStatus_UART_TxWatermarkTooLarge = MAKE_STATUS(kStatusGroup_UART, 4), /*!< TX FIFO watermark too large */ - kStatus_UART_RxWatermarkTooLarge = MAKE_STATUS(kStatusGroup_UART, 5), /*!< RX FIFO watermark too large */ - kStatus_UART_FlagCannotClearManually = - MAKE_STATUS(kStatusGroup_UART, 6), /*!< UART flag can't be manually cleared. */ - kStatus_UART_Error = MAKE_STATUS(kStatusGroup_UART, 7), /*!< Error happens on UART. */ - kStatus_UART_RxRingBufferOverrun = MAKE_STATUS(kStatusGroup_UART, 8), /*!< UART RX software ring buffer overrun. */ - kStatus_UART_RxHardwareOverrun = MAKE_STATUS(kStatusGroup_UART, 9), /*!< UART RX receiver overrun. */ - kStatus_UART_NoiseError = MAKE_STATUS(kStatusGroup_UART, 10), /*!< UART noise error. */ - kStatus_UART_FramingError = MAKE_STATUS(kStatusGroup_UART, 11), /*!< UART framing error. */ - kStatus_UART_ParityError = MAKE_STATUS(kStatusGroup_UART, 12), /*!< UART parity error. */ - kStatus_UART_BaudrateNotSupport = - MAKE_STATUS(kStatusGroup_UART, 13), /*!< Baudrate is not support in current clock source */ - kStatus_UART_IdleLineDetected = MAKE_STATUS(kStatusGroup_UART, 14), /*!< UART IDLE line detected. */ - kStatus_UART_Timeout = MAKE_STATUS(kStatusGroup_UART, 15), /*!< UART times out. */ -}; - -/*! @brief UART parity mode. */ -typedef enum _uart_parity_mode -{ - kUART_ParityDisabled = 0x0U, /*!< Parity disabled */ - kUART_ParityEven = 0x2U, /*!< Parity enabled, type even, bit setting: PE|PT = 10 */ - kUART_ParityOdd = 0x3U, /*!< Parity enabled, type odd, bit setting: PE|PT = 11 */ -} uart_parity_mode_t; - -/*! @brief UART stop bit count. */ -typedef enum _uart_stop_bit_count -{ - kUART_OneStopBit = 0U, /*!< One stop bit */ - kUART_TwoStopBit = 1U, /*!< Two stop bits */ -} uart_stop_bit_count_t; - -/*! @brief UART idle type select. */ -typedef enum _uart_idle_type_select -{ - kUART_IdleTypeStartBit = 0U, /*!< Start counting after a valid start bit. */ - kUART_IdleTypeStopBit = 1U, /*!< Start counting after a stop bit. */ -} uart_idle_type_select_t; - -/*! - * @brief UART interrupt configuration structure, default settings all disabled. - * - * This structure contains the settings for all of the UART interrupt configurations. - */ -enum _uart_interrupt_enable -{ -#if defined(FSL_FEATURE_UART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_UART_HAS_LIN_BREAK_DETECT - kUART_LinBreakInterruptEnable = (UART_BDH_LBKDIE_MASK), /*!< LIN break detect interrupt. */ -#endif - kUART_RxActiveEdgeInterruptEnable = (UART_BDH_RXEDGIE_MASK), /*!< RX active edge interrupt. */ - kUART_TxDataRegEmptyInterruptEnable = (UART_C2_TIE_MASK << 8), /*!< Transmit data register empty interrupt. */ - kUART_TransmissionCompleteInterruptEnable = (UART_C2_TCIE_MASK << 8), /*!< Transmission complete interrupt. */ - kUART_RxDataRegFullInterruptEnable = (UART_C2_RIE_MASK << 8), /*!< Receiver data register full interrupt. */ - kUART_IdleLineInterruptEnable = (UART_C2_ILIE_MASK << 8), /*!< Idle line interrupt. */ - kUART_RxOverrunInterruptEnable = (UART_C3_ORIE_MASK << 16), /*!< Receiver overrun interrupt. */ - kUART_NoiseErrorInterruptEnable = (UART_C3_NEIE_MASK << 16), /*!< Noise error flag interrupt. */ - kUART_FramingErrorInterruptEnable = (UART_C3_FEIE_MASK << 16), /*!< Framing error flag interrupt. */ - kUART_ParityErrorInterruptEnable = (UART_C3_PEIE_MASK << 16), /*!< Parity error flag interrupt. */ -#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO - kUART_RxFifoOverflowInterruptEnable = (UART_CFIFO_RXOFE_MASK << 24), /*!< RX FIFO overflow interrupt. */ - kUART_TxFifoOverflowInterruptEnable = (UART_CFIFO_TXOFE_MASK << 24), /*!< TX FIFO overflow interrupt. */ - kUART_RxFifoUnderflowInterruptEnable = (UART_CFIFO_RXUFE_MASK << 24), /*!< RX FIFO underflow interrupt. */ -#endif - kUART_AllInterruptsEnable = -#if defined(FSL_FEATURE_UART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_UART_HAS_LIN_BREAK_DETECT - kUART_LinBreakInterruptEnable | -#endif - kUART_RxActiveEdgeInterruptEnable | kUART_TxDataRegEmptyInterruptEnable | - kUART_TransmissionCompleteInterruptEnable | kUART_RxDataRegFullInterruptEnable | kUART_IdleLineInterruptEnable | - kUART_RxOverrunInterruptEnable | kUART_NoiseErrorInterruptEnable | kUART_FramingErrorInterruptEnable | - kUART_ParityErrorInterruptEnable -#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO - | kUART_RxFifoOverflowInterruptEnable | kUART_TxFifoOverflowInterruptEnable | - kUART_RxFifoUnderflowInterruptEnable -#endif - , -}; - -/*! - * @brief UART status flags. - * - * This provides constants for the UART status flags for use in the UART functions. - */ -enum -{ - kUART_TxDataRegEmptyFlag = (UART_S1_TDRE_MASK), /*!< TX data register empty flag. */ - kUART_TransmissionCompleteFlag = (UART_S1_TC_MASK), /*!< Transmission complete flag. */ - kUART_RxDataRegFullFlag = (UART_S1_RDRF_MASK), /*!< RX data register full flag. */ - kUART_IdleLineFlag = (UART_S1_IDLE_MASK), /*!< Idle line detect flag. */ - kUART_RxOverrunFlag = (UART_S1_OR_MASK), /*!< RX overrun flag. */ - kUART_NoiseErrorFlag = (UART_S1_NF_MASK), /*!< RX takes 3 samples of each received bit. - If any of these samples differ, noise flag sets */ - kUART_FramingErrorFlag = (UART_S1_FE_MASK), /*!< Frame error flag, sets if logic 0 was detected - where stop bit expected */ - kUART_ParityErrorFlag = (UART_S1_PF_MASK), /*!< If parity enabled, sets upon parity error detection */ -#if defined(FSL_FEATURE_UART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_UART_HAS_LIN_BREAK_DETECT - kUART_LinBreakFlag = - (UART_S2_LBKDIF_MASK - << 8), /*!< LIN break detect interrupt flag, sets when LIN break char detected and LIN circuit enabled */ -#endif - kUART_RxActiveEdgeFlag = - (UART_S2_RXEDGIF_MASK << 8), /*!< RX pin active edge interrupt flag,sets when active edge detected */ - kUART_RxActiveFlag = - (UART_S2_RAF_MASK << 8), /*!< Receiver Active Flag (RAF), sets at beginning of valid start bit */ -#if defined(FSL_FEATURE_UART_HAS_EXTENDED_DATA_REGISTER_FLAGS) && FSL_FEATURE_UART_HAS_EXTENDED_DATA_REGISTER_FLAGS - kUART_NoiseErrorInRxDataRegFlag = (UART_ED_NOISY_MASK << 16), /*!< Noisy bit, sets if noise detected. */ - kUART_ParityErrorInRxDataRegFlag = (UART_ED_PARITYE_MASK << 16), /*!< Parity bit, sets if parity error detected. */ -#endif -#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO - kUART_TxFifoEmptyFlag = (int)(UART_SFIFO_TXEMPT_MASK << 24), /*!< TXEMPT bit, sets if TX buffer is empty */ - kUART_RxFifoEmptyFlag = (UART_SFIFO_RXEMPT_MASK << 24), /*!< RXEMPT bit, sets if RX buffer is empty */ - kUART_TxFifoOverflowFlag = (UART_SFIFO_TXOF_MASK << 24), /*!< TXOF bit, sets if TX buffer overflow occurred */ - kUART_RxFifoOverflowFlag = (UART_SFIFO_RXOF_MASK << 24), /*!< RXOF bit, sets if receive buffer overflow */ - kUART_RxFifoUnderflowFlag = (UART_SFIFO_RXUF_MASK << 24), /*!< RXUF bit, sets if receive buffer underflow */ -#endif -}; - -/*! @brief UART configuration structure. */ -typedef struct _uart_config -{ - uint32_t baudRate_Bps; /*!< UART baud rate */ - uart_parity_mode_t parityMode; /*!< Parity mode, disabled (default), even, odd */ -#if defined(FSL_FEATURE_UART_HAS_STOP_BIT_CONFIG_SUPPORT) && FSL_FEATURE_UART_HAS_STOP_BIT_CONFIG_SUPPORT - uart_stop_bit_count_t stopBitCount; /*!< Number of stop bits, 1 stop bit (default) or 2 stop bits */ -#endif -#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO - uint8_t txFifoWatermark; /*!< TX FIFO watermark */ - uint8_t rxFifoWatermark; /*!< RX FIFO watermark */ -#endif -#if defined(FSL_FEATURE_UART_HAS_MODEM_SUPPORT) && FSL_FEATURE_UART_HAS_MODEM_SUPPORT - bool enableRxRTS; /*!< RX RTS enable */ - bool enableTxCTS; /*!< TX CTS enable */ -#endif - uart_idle_type_select_t idleType; /*!< IDLE type select. */ - bool enableTx; /*!< Enable TX */ - bool enableRx; /*!< Enable RX */ -} uart_config_t; - -/*! @brief UART transfer structure. */ -typedef struct _uart_transfer -{ - /* - * Use separate TX and RX data pointer, because TX data is const data. - * The member data is kept for backward compatibility. - */ - union - { - uint8_t *data; /*!< The buffer of data to be transfer.*/ - uint8_t *rxData; /*!< The buffer to receive data. */ - const uint8_t *txData; /*!< The buffer of data to be sent. */ - }; - size_t dataSize; /*!< The byte count to be transfer. */ -} uart_transfer_t; - -/* Forward declaration of the handle typedef. */ -typedef struct _uart_handle uart_handle_t; - -/*! @brief UART transfer callback function. */ -typedef void (*uart_transfer_callback_t)(UART_Type *base, uart_handle_t *handle, status_t status, void *userData); - -/*! @brief UART handle structure. */ -struct _uart_handle -{ - const uint8_t *volatile txData; /*!< Address of remaining data to send. */ - volatile size_t txDataSize; /*!< Size of the remaining data to send. */ - size_t txDataSizeAll; /*!< Size of the data to send out. */ - uint8_t *volatile rxData; /*!< Address of remaining data to receive. */ - volatile size_t rxDataSize; /*!< Size of the remaining data to receive. */ - size_t rxDataSizeAll; /*!< Size of the data to receive. */ - - uint8_t *rxRingBuffer; /*!< Start address of the receiver ring buffer. */ - size_t rxRingBufferSize; /*!< Size of the ring buffer. */ - volatile uint16_t rxRingBufferHead; /*!< Index for the driver to store received data into ring buffer. */ - volatile uint16_t rxRingBufferTail; /*!< Index for the user to get data from the ring buffer. */ - - uart_transfer_callback_t callback; /*!< Callback function. */ - void *userData; /*!< UART callback function parameter.*/ - - volatile uint8_t txState; /*!< TX transfer state. */ - volatile uint8_t rxState; /*!< RX transfer state */ -}; - -/* Typedef for interrupt handler. */ -typedef void (*uart_isr_t)(UART_Type *base, void *handle); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! Pointers to uart handles for each instance. */ -extern void *s_uartHandle[]; - -/* Array of UART IRQs. */ -extern const IRQn_Type s_uartIRQ[]; - -/*! Pointer to uart IRQ handler for each instance. */ -extern uart_isr_t s_uartIsr; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* _cplusplus */ - -/*! - * @brief Get the UART instance from peripheral base address. - * - * @param base UART peripheral base address. - * @return UART instance. - */ -uint32_t UART_GetInstance(UART_Type *base); - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Initializes a UART instance with a user configuration structure and peripheral clock. - * - * This function configures the UART module with the user-defined settings. The user can configure the configuration - * structure and also get the default configuration by using the UART_GetDefaultConfig() function. - * The example below shows how to use this API to configure UART. - * @code - * uart_config_t uartConfig; - * uartConfig.baudRate_Bps = 115200U; - * uartConfig.parityMode = kUART_ParityDisabled; - * uartConfig.stopBitCount = kUART_OneStopBit; - * uartConfig.txFifoWatermark = 0; - * uartConfig.rxFifoWatermark = 1; - * UART_Init(UART1, &uartConfig, 20000000U); - * @endcode - * - * @param base UART peripheral base address. - * @param config Pointer to the user-defined configuration structure. - * @param srcClock_Hz UART clock source frequency in HZ. - * @retval kStatus_UART_BaudrateNotSupport Baudrate is not support in current clock source. - * @retval kStatus_Success Status UART initialize succeed - */ -status_t UART_Init(UART_Type *base, const uart_config_t *config, uint32_t srcClock_Hz); - -/*! - * @brief Deinitializes a UART instance. - * - * This function waits for TX complete, disables TX and RX, and disables the UART clock. - * - * @param base UART peripheral base address. - */ -void UART_Deinit(UART_Type *base); - -/*! - * @brief Gets the default configuration structure. - * - * This function initializes the UART configuration structure to a default value. The default - * values are as follows. - * uartConfig->baudRate_Bps = 115200U; - * uartConfig->bitCountPerChar = kUART_8BitsPerChar; - * uartConfig->parityMode = kUART_ParityDisabled; - * uartConfig->stopBitCount = kUART_OneStopBit; - * uartConfig->txFifoWatermark = 0; - * uartConfig->rxFifoWatermark = 1; - * uartConfig->idleType = kUART_IdleTypeStartBit; - * uartConfig->enableTx = false; - * uartConfig->enableRx = false; - * - * @param config Pointer to configuration structure. - */ -void UART_GetDefaultConfig(uart_config_t *config); - -/*! - * @brief Sets the UART instance baud rate. - * - * This function configures the UART module baud rate. This function is used to update - * the UART module baud rate after the UART module is initialized by the UART_Init. - * @code - * UART_SetBaudRate(UART1, 115200U, 20000000U); - * @endcode - * - * @param base UART peripheral base address. - * @param baudRate_Bps UART baudrate to be set. - * @param srcClock_Hz UART clock source frequency in Hz. - * @retval kStatus_UART_BaudrateNotSupport Baudrate is not support in the current clock source. - * @retval kStatus_Success Set baudrate succeeded. - */ -status_t UART_SetBaudRate(UART_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz); - -/*! - * @brief Enable 9-bit data mode for UART. - * - * This function set the 9-bit mode for UART module. The 9th bit is not used for parity thus can be modified by user. - * - * @param base UART peripheral base address. - * @param enable true to enable, flase to disable. - */ -void UART_Enable9bitMode(UART_Type *base, bool enable); - -#if defined(FSL_FEATURE_UART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_UART_HAS_ADDRESS_MATCHING -/*! - * @brief Set the UART slave address. - * - * This function configures the address for UART module that works as slave in 9-bit data mode. One or two address - * fields can be configured. When the address field's match enable bit is set, the frame it receices with MSB being - * 1 is considered as an address frame, otherwise it is considered as data frame. Once the address frame matches one - * of slave's own addresses, this slave is addressed. This address frame and its following data frames are stored in - * the receive buffer, otherwise the frames will be discarded. To un-address a slave, just send an address frame with - * unmatched address. - * - * @note Any UART instance joined in the multi-slave system can work as slave. The position of the address mark is the - * same as the parity bit when parity is enabled for 8 bit and 9 bit data formats. - * - * @param base UART peripheral base address. - * @param address1 UART slave address 1. - * @param address2 UART slave address 2. - */ -static inline void UART_SetMatchAddress(UART_Type *base, uint8_t address1, uint8_t address2) -{ - /* Configure match address. */ - base->MA1 = address1; - base->MA2 = address2; -} - -/*! - * @brief Enable the UART match address feature. - * - * @param base UART peripheral base address. - * @param match1 true to enable match address1, false to disable. - * @param match2 true to enable match address2, false to disable. - */ -static inline void UART_EnableMatchAddress(UART_Type *base, bool match1, bool match2) -{ - /* Configure match address1 enable bit. */ - if (match1) - { - base->C4 |= (uint8_t)UART_C4_MAEN1_MASK; - } - else - { - base->C4 &= ~(uint8_t)UART_C4_MAEN1_MASK; - } - /* Configure match address2 enable bit. */ - if (match2) - { - base->C4 |= (uint8_t)UART_C4_MAEN2_MASK; - } - else - { - base->C4 &= ~(uint8_t)UART_C4_MAEN2_MASK; - } -} -#endif - -/*! - * @brief Set UART 9th transmit bit. - * - * @param base UART peripheral base address. - */ -static inline void UART_Set9thTransmitBit(UART_Type *base) -{ - base->C3 |= (uint8_t)UART_C3_T8_MASK; -} - -/*! - * @brief Clear UART 9th transmit bit. - * - * @param base UART peripheral base address. - */ -static inline void UART_Clear9thTransmitBit(UART_Type *base) -{ - base->C3 &= ~(uint8_t)UART_C3_T8_MASK; -} - -/*! @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets UART status flags. - * - * This function gets all UART status flags. The flags are returned as the logical - * OR value of the enumerators _uart_flags. To check a specific status, - * compare the return value with enumerators in _uart_flags. - * For example, to check whether the TX is empty, do the following. - * @code - * if (kUART_TxDataRegEmptyFlag & UART_GetStatusFlags(UART1)) - * { - * ... - * } - * @endcode - * - * @param base UART peripheral base address. - * @return UART status flags which are ORed by the enumerators in the _uart_flags. - */ -uint32_t UART_GetStatusFlags(UART_Type *base); - -/*! - * @brief Clears status flags with the provided mask. - * - * This function clears UART status flags with a provided mask. An automatically cleared flag - * can't be cleared by this function. - * These flags can only be cleared or set by hardware. - * kUART_TxDataRegEmptyFlag, kUART_TransmissionCompleteFlag, kUART_RxDataRegFullFlag, - * kUART_RxActiveFlag, kUART_NoiseErrorInRxDataRegFlag, kUART_ParityErrorInRxDataRegFlag, - * kUART_TxFifoEmptyFlag,kUART_RxFifoEmptyFlag - * @note that this API should be called when the Tx/Rx is idle. Otherwise it has no effect. - * - * @param base UART peripheral base address. - * @param mask The status flags to be cleared; it is logical OR value of _uart_flags. - * @retval kStatus_UART_FlagCannotClearManually The flag can't be cleared by this function but - * it is cleared automatically by hardware. - * @retval kStatus_Success Status in the mask is cleared. - */ -status_t UART_ClearStatusFlags(UART_Type *base, uint32_t mask); - -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables UART interrupts according to the provided mask. - * - * This function enables the UART interrupts according to the provided mask. The mask - * is a logical OR of enumeration members. See @ref _uart_interrupt_enable. - * For example, to enable TX empty interrupt and RX full interrupt, do the following. - * @code - * UART_EnableInterrupts(UART1,kUART_TxDataRegEmptyInterruptEnable | kUART_RxDataRegFullInterruptEnable); - * @endcode - * - * @param base UART peripheral base address. - * @param mask The interrupts to enable. Logical OR of @ref _uart_interrupt_enable. - */ -void UART_EnableInterrupts(UART_Type *base, uint32_t mask); - -/*! - * @brief Disables the UART interrupts according to the provided mask. - * - * This function disables the UART interrupts according to the provided mask. The mask - * is a logical OR of enumeration members. See @ref _uart_interrupt_enable. - * For example, to disable TX empty interrupt and RX full interrupt do the following. - * @code - * UART_DisableInterrupts(UART1,kUART_TxDataRegEmptyInterruptEnable | kUART_RxDataRegFullInterruptEnable); - * @endcode - * - * @param base UART peripheral base address. - * @param mask The interrupts to disable. Logical OR of @ref _uart_interrupt_enable. - */ -void UART_DisableInterrupts(UART_Type *base, uint32_t mask); - -/*! - * @brief Gets the enabled UART interrupts. - * - * This function gets the enabled UART interrupts. The enabled interrupts are returned - * as the logical OR value of the enumerators @ref _uart_interrupt_enable. To check - * a specific interrupts enable status, compare the return value with enumerators - * in @ref _uart_interrupt_enable. - * For example, to check whether TX empty interrupt is enabled, do the following. - * @code - * uint32_t enabledInterrupts = UART_GetEnabledInterrupts(UART1); - * - * if (kUART_TxDataRegEmptyInterruptEnable & enabledInterrupts) - * { - * ... - * } - * @endcode - * - * @param base UART peripheral base address. - * @return UART interrupt flags which are logical OR of the enumerators in @ref _uart_interrupt_enable. - */ -uint32_t UART_GetEnabledInterrupts(UART_Type *base); - -/*! @} */ - -#if defined(FSL_FEATURE_UART_HAS_DMA_SELECT) && FSL_FEATURE_UART_HAS_DMA_SELECT -/*! - * @name DMA Control - * @{ - */ - -/*! - * @brief Gets the UART data register address. - * - * This function returns the UART data register address, which is mainly used by DMA/eDMA. - * - * @param base UART peripheral base address. - * @return UART data register addresses which are used both by the transmitter and the receiver. - */ -static inline uint32_t UART_GetDataRegisterAddress(UART_Type *base) -{ - return (uint32_t) & (base->D); -} - -/*! - * @brief Enables or disables the UART transmitter DMA request. - * - * This function enables or disables the transmit data register empty flag, S1[TDRE], to generate the DMA requests. - * - * @param base UART peripheral base address. - * @param enable True to enable, false to disable. - */ -static inline void UART_EnableTxDMA(UART_Type *base, bool enable) -{ - if (enable) - { -#if (defined(FSL_FEATURE_UART_IS_SCI) && FSL_FEATURE_UART_IS_SCI) - base->C4 |= (uint8_t)UART_C4_TDMAS_MASK; -#else - base->C5 |= (uint8_t)UART_C5_TDMAS_MASK; -#endif - base->C2 |= (uint8_t)UART_C2_TIE_MASK; - } - else - { -#if (defined(FSL_FEATURE_UART_IS_SCI) && FSL_FEATURE_UART_IS_SCI) - base->C4 &= ~(uint8_t)UART_C4_TDMAS_MASK; -#else - base->C5 &= ~(uint8_t)UART_C5_TDMAS_MASK; -#endif - base->C2 &= ~(uint8_t)UART_C2_TIE_MASK; - } -} - -/*! - * @brief Enables or disables the UART receiver DMA. - * - * This function enables or disables the receiver data register full flag, S1[RDRF], to generate DMA requests. - * - * @param base UART peripheral base address. - * @param enable True to enable, false to disable. - */ -static inline void UART_EnableRxDMA(UART_Type *base, bool enable) -{ - if (enable) - { -#if (defined(FSL_FEATURE_UART_IS_SCI) && FSL_FEATURE_UART_IS_SCI) - base->C4 |= (uint8_t)UART_C4_RDMAS_MASK; -#else - base->C5 |= (uint8_t)UART_C5_RDMAS_MASK; -#endif - base->C2 |= (uint8_t)UART_C2_RIE_MASK; - } - else - { -#if (defined(FSL_FEATURE_UART_IS_SCI) && FSL_FEATURE_UART_IS_SCI) - base->C4 &= ~(uint8_t)UART_C4_RDMAS_MASK; -#else - base->C5 &= ~(uint8_t)UART_C5_RDMAS_MASK; -#endif - base->C2 &= ~(uint8_t)UART_C2_RIE_MASK; - } -} - -/*! @} */ -#endif /* FSL_FEATURE_UART_HAS_DMA_SELECT */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Enables or disables the UART transmitter. - * - * This function enables or disables the UART transmitter. - * - * @param base UART peripheral base address. - * @param enable True to enable, false to disable. - */ -static inline void UART_EnableTx(UART_Type *base, bool enable) -{ - if (enable) - { - base->C2 |= (uint8_t)UART_C2_TE_MASK; - } - else - { - base->C2 &= ~(uint8_t)UART_C2_TE_MASK; - } -} - -/*! - * @brief Enables or disables the UART receiver. - * - * This function enables or disables the UART receiver. - * - * @param base UART peripheral base address. - * @param enable True to enable, false to disable. - */ -static inline void UART_EnableRx(UART_Type *base, bool enable) -{ - if (enable) - { - base->C2 |= (uint8_t)UART_C2_RE_MASK; - } - else - { - base->C2 &= ~(uint8_t)UART_C2_RE_MASK; - } -} - -/*! - * @brief Writes to the TX register. - * - * This function writes data to the TX register directly. The upper layer must ensure - * that the TX register is empty or TX FIFO has empty room before calling this function. - * - * @param base UART peripheral base address. - * @param data The byte to write. - */ -static inline void UART_WriteByte(UART_Type *base, uint8_t data) -{ - base->D = data; -} - -/*! - * @brief Reads the RX register directly. - * - * This function reads data from the RX register directly. The upper layer must - * ensure that the RX register is full or that the TX FIFO has data before calling this function. - * - * @param base UART peripheral base address. - * @return The byte read from UART data register. - */ -static inline uint8_t UART_ReadByte(UART_Type *base) -{ - return base->D; -} - -#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO -/*! - * @brief Gets the rx FIFO data count. - * - * @param base UART peripheral base address. - * @return rx FIFO data count. - */ -static inline uint8_t UART_GetRxFifoCount(UART_Type *base) -{ - return (uint8_t)base->RCFIFO; -} - -/*! - * @brief Gets the tx FIFO data count. - * - * @param base UART peripheral base address. - * @return tx FIFO data count. - */ -static inline uint8_t UART_GetTxFifoCount(UART_Type *base) -{ - return (uint8_t)base->TCFIFO; -} -#endif /* FSL_FEATURE_UART_HAS_FIFO */ - -#if defined(FSL_FEATURE_UART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_UART_HAS_ADDRESS_MATCHING -/*! - * @brief Transmit an address frame in 9-bit data mode. - * - * @param base UART peripheral base address. - * @param address UART slave address. - */ -void UART_SendAddress(UART_Type *base, uint8_t address); -#endif - -/*! - * @brief Writes to the TX register using a blocking method. - * - * This function polls the TX register, waits for the TX register to be empty or for the TX FIFO - * to have room and writes data to the TX buffer. - * - * @param base UART peripheral base address. - * @param data Start address of the data to write. - * @param length Size of the data to write. - * @retval kStatus_UART_Timeout Transmission timed out and was aborted. - * @retval kStatus_Success Successfully wrote all data. - */ -status_t UART_WriteBlocking(UART_Type *base, const uint8_t *data, size_t length); - -/*! - * @brief Read RX data register using a blocking method. - * - * This function polls the RX register, waits for the RX register to be full or for RX FIFO to - * have data, and reads data from the TX register. - * - * @param base UART peripheral base address. - * @param data Start address of the buffer to store the received data. - * @param length Size of the buffer. - * @retval kStatus_UART_RxHardwareOverrun Receiver overrun occurred while receiving data. - * @retval kStatus_UART_NoiseError A noise error occurred while receiving data. - * @retval kStatus_UART_FramingError A framing error occurred while receiving data. - * @retval kStatus_UART_ParityError A parity error occurred while receiving data. - * @retval kStatus_UART_Timeout Transmission timed out and was aborted. - * @retval kStatus_Success Successfully received all data. - */ -status_t UART_ReadBlocking(UART_Type *base, uint8_t *data, size_t length); - -/*! @} */ - -/*! - * @name Transactional - * @{ - */ - -/*! - * @brief Initializes the UART handle. - * - * This function initializes the UART handle which can be used for other UART - * transactional APIs. Usually, for a specified UART instance, - * call this API once to get the initialized handle. - * - * @param base UART peripheral base address. - * @param handle UART handle pointer. - * @param callback The callback function. - * @param userData The parameter of the callback function. - */ -void UART_TransferCreateHandle(UART_Type *base, - uart_handle_t *handle, - uart_transfer_callback_t callback, - void *userData); - -/*! - * @brief Sets up the RX ring buffer. - * - * This function sets up the RX ring buffer to a specific UART handle. - * - * When the RX ring buffer is used, data received are stored into the ring buffer even when the - * user doesn't call the UART_TransferReceiveNonBlocking() API. If data is already received - * in the ring buffer, the user can get the received data from the ring buffer directly. - * - * @note When using the RX ring buffer, one byte is reserved for internal use. In other - * words, if @p ringBufferSize is 32, only 31 bytes are used for saving data. - * - * @param base UART peripheral base address. - * @param handle UART handle pointer. - * @param ringBuffer Start address of the ring buffer for background receiving. Pass NULL to disable the ring buffer. - * @param ringBufferSize Size of the ring buffer. - */ -void UART_TransferStartRingBuffer(UART_Type *base, uart_handle_t *handle, uint8_t *ringBuffer, size_t ringBufferSize); - -/*! - * @brief Aborts the background transfer and uninstalls the ring buffer. - * - * This function aborts the background transfer and uninstalls the ring buffer. - * - * @param base UART peripheral base address. - * @param handle UART handle pointer. - */ -void UART_TransferStopRingBuffer(UART_Type *base, uart_handle_t *handle); - -/*! - * @brief Get the length of received data in RX ring buffer. - * - * @param handle UART handle pointer. - * @return Length of received data in RX ring buffer. - */ -size_t UART_TransferGetRxRingBufferLength(uart_handle_t *handle); - -/*! - * @brief Transmits a buffer of data using the interrupt method. - * - * This function sends data using an interrupt method. This is a non-blocking function, which - * returns directly without waiting for all data to be written to the TX register. When - * all data is written to the TX register in the ISR, the UART driver calls the callback - * function and passes the @ref kStatus_UART_TxIdle as status parameter. - * - * @note The kStatus_UART_TxIdle is passed to the upper layer when all data is written - * to the TX register. However, it does not ensure that all data is sent out. Before disabling the TX, - * check the kUART_TransmissionCompleteFlag to ensure that the TX is finished. - * - * @param base UART peripheral base address. - * @param handle UART handle pointer. - * @param xfer UART transfer structure. See #uart_transfer_t. - * @retval kStatus_Success Successfully start the data transmission. - * @retval kStatus_UART_TxBusy Previous transmission still not finished; data not all written to TX register yet. - * @retval kStatus_InvalidArgument Invalid argument. - */ -status_t UART_TransferSendNonBlocking(UART_Type *base, uart_handle_t *handle, uart_transfer_t *xfer); - -/*! - * @brief Aborts the interrupt-driven data transmit. - * - * This function aborts the interrupt-driven data sending. The user can get the remainBytes to find out - * how many bytes are not sent out. - * - * @param base UART peripheral base address. - * @param handle UART handle pointer. - */ -void UART_TransferAbortSend(UART_Type *base, uart_handle_t *handle); - -/*! - * @brief Gets the number of bytes sent out to bus. - * - * This function gets the number of bytes sent out to bus by using the interrupt method. - * - * @param base UART peripheral base address. - * @param handle UART handle pointer. - * @param count Send bytes count. - * @retval kStatus_NoTransferInProgress No send in progress. - * @retval kStatus_InvalidArgument The parameter is invalid. - * @retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t UART_TransferGetSendCount(UART_Type *base, uart_handle_t *handle, uint32_t *count); - -/*! - * @brief Receives a buffer of data using an interrupt method. - * - * This function receives data using an interrupt method. This is a non-blocking function, which - * returns without waiting for all data to be received. - * If the RX ring buffer is used and not empty, the data in the ring buffer is copied and - * the parameter @p receivedBytes shows how many bytes are copied from the ring buffer. - * After copying, if the data in the ring buffer is not enough to read, the receive - * request is saved by the UART driver. When the new data arrives, the receive request - * is serviced first. When all data is received, the UART driver notifies the upper layer - * through a callback function and passes the status parameter @ref kStatus_UART_RxIdle. - * For example, the upper layer needs 10 bytes but there are only 5 bytes in the ring buffer. - * The 5 bytes are copied to the xfer->data and this function returns with the - * parameter @p receivedBytes set to 5. For the left 5 bytes, newly arrived data is - * saved from the xfer->data[5]. When 5 bytes are received, the UART driver notifies the upper layer. - * If the RX ring buffer is not enabled, this function enables the RX and RX interrupt - * to receive data to the xfer->data. When all data is received, the upper layer is notified. - * - * @param base UART peripheral base address. - * @param handle UART handle pointer. - * @param xfer UART transfer structure, see #uart_transfer_t. - * @param receivedBytes Bytes received from the ring buffer directly. - * @retval kStatus_Success Successfully queue the transfer into transmit queue. - * @retval kStatus_UART_RxBusy Previous receive request is not finished. - * @retval kStatus_InvalidArgument Invalid argument. - */ -status_t UART_TransferReceiveNonBlocking(UART_Type *base, - uart_handle_t *handle, - uart_transfer_t *xfer, - size_t *receivedBytes); - -/*! - * @brief Aborts the interrupt-driven data receiving. - * - * This function aborts the interrupt-driven data receiving. The user can get the remainBytes to know - * how many bytes are not received yet. - * - * @param base UART peripheral base address. - * @param handle UART handle pointer. - */ -void UART_TransferAbortReceive(UART_Type *base, uart_handle_t *handle); - -/*! - * @brief Gets the number of bytes that have been received. - * - * This function gets the number of bytes that have been received. - * - * @param base UART peripheral base address. - * @param handle UART handle pointer. - * @param count Receive bytes count. - * @retval kStatus_NoTransferInProgress No receive in progress. - * @retval kStatus_InvalidArgument Parameter is invalid. - * @retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t UART_TransferGetReceiveCount(UART_Type *base, uart_handle_t *handle, uint32_t *count); - -#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO -/*! - * @brief Enables or disables the UART Tx FIFO. - * - * This function enables or disables the UART Tx FIFO. - * - * param base UART peripheral base address. - * param enable true to enable, false to disable. - * retval kStatus_Success Successfully turn on or turn off Tx FIFO. - * retval kStatus_Fail Fail to turn on or turn off Tx FIFO. - */ -status_t UART_EnableTxFIFO(UART_Type *base, bool enable); - -/*! - * @brief Enables or disables the UART Rx FIFO. - * - * This function enables or disables the UART Rx FIFO. - * - * param base UART peripheral base address. - * param enable true to enable, false to disable. - * retval kStatus_Success Successfully turn on or turn off Rx FIFO. - * retval kStatus_Fail Fail to turn on or turn off Rx FIFO. - */ -status_t UART_EnableRxFIFO(UART_Type *base, bool enable); - -/*! - * @brief Sets the rx FIFO watermark. - * - * @param base UART peripheral base address. - * @param water Rx FIFO watermark. - */ -static inline void UART_SetRxFifoWatermark(UART_Type *base, uint8_t water) -{ - assert((uint8_t)FSL_FEATURE_UART_FIFO_SIZEn(base) >= water); - base->RWFIFO = water; -} - -/*! - * @brief Sets the tx FIFO watermark. - * - * @param base UART peripheral base address. - * @param water Tx FIFO watermark. - */ -static inline void UART_SetTxFifoWatermark(UART_Type *base, uint8_t water) -{ - assert((uint8_t)FSL_FEATURE_UART_FIFO_SIZEn(base) >= water); - base->TWFIFO = water; -} -#endif /* FSL_FEATURE_UART_HAS_FIFO */ - -/*! - * @brief UART IRQ handle function. - * - * This function handles the UART transmit and receive IRQ request. - * - * @param base UART peripheral base address. - * @param irqHandle UART handle pointer. - */ -void UART_TransferHandleIRQ(UART_Type *base, void *irqHandle); - -/*! - * @brief UART Error IRQ handle function. - * - * This function handles the UART error IRQ request. - * - * @param base UART peripheral base address. - * @param irqHandle UART handle pointer. - */ -void UART_TransferHandleErrorIRQ(UART_Type *base, void *irqHandle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_UART_H_ */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_uart_dma.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_uart_dma.c deleted file mode 100644 index 2f9ff5ff5d2..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_uart_dma.c +++ /dev/null @@ -1,436 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_uart_dma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.uart_dma" -#endif - -/* Array of UART handle. */ -#if (defined(UART5)) -#define UART_HANDLE_ARRAY_SIZE 6 -#else /* UART5 */ -#if (defined(UART4)) -#define UART_HANDLE_ARRAY_SIZE 5 -#else /* UART4 */ -#if (defined(UART3)) -#define UART_HANDLE_ARRAY_SIZE 4 -#else /* UART3 */ -#if (defined(UART2)) -#define UART_HANDLE_ARRAY_SIZE 3 -#else /* UART2 */ -#if (defined(UART1)) -#define UART_HANDLE_ARRAY_SIZE 2 -#else /* UART1 */ -#if (defined(UART0)) -#define UART_HANDLE_ARRAY_SIZE 1 -#else /* UART0 */ -#error No UART instance. -#endif /* UART 0 */ -#endif /* UART 1 */ -#endif /* UART 2 */ -#endif /* UART 3 */ -#endif /* UART 4 */ -#endif /* UART 5 */ - -/*base, false); - - /* Disable interrupt. */ - DMA_DisableInterrupts(handle->base, handle->channel); - - /* Enable tx complete interrupt */ - UART_EnableInterrupts(uartPrivateHandle->base, (uint32_t)kUART_TransmissionCompleteInterruptEnable); -} - -static void UART_TransferReceiveDMACallback(dma_handle_t *handle, void *param) -{ - assert(handle != NULL); - assert(param != NULL); - - uart_dma_private_handle_t *uartPrivateHandle = (uart_dma_private_handle_t *)param; - - /* Disable UART RX DMA. */ - UART_EnableRxDMA(uartPrivateHandle->base, false); - - /* Disable interrupt. */ - DMA_DisableInterrupts(handle->base, handle->channel); - - uartPrivateHandle->handle->rxState = (uint8_t)kUART_RxIdle; - - if (uartPrivateHandle->handle->callback != NULL) - { - uartPrivateHandle->handle->callback(uartPrivateHandle->base, uartPrivateHandle->handle, kStatus_UART_RxIdle, - uartPrivateHandle->handle->userData); - } -} - -/*! - * brief Initializes the UART handle which is used in transactional functions and sets the callback. - * - * param base UART peripheral base address. - * param handle Pointer to the uart_dma_handle_t structure. - * param callback UART callback, NULL means no callback. - * param userData User callback function data. - * param rxDmaHandle User requested DMA handle for the RX DMA transfer. - * param txDmaHandle User requested DMA handle for the TX DMA transfer. - */ -void UART_TransferCreateHandleDMA(UART_Type *base, - uart_dma_handle_t *handle, - uart_dma_transfer_callback_t callback, - void *userData, - dma_handle_t *txDmaHandle, - dma_handle_t *rxDmaHandle) -{ - assert(handle != NULL); - - uint32_t instance = UART_GetInstance(base); - - (void)memset(handle, 0, sizeof(*handle)); - - s_dmaPrivateHandle[instance].base = base; - s_dmaPrivateHandle[instance].handle = handle; - - handle->rxState = (uint8_t)kUART_RxIdle; - handle->txState = (uint8_t)kUART_TxIdle; - - handle->callback = callback; - handle->userData = userData; - -#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO - /* Note: - Take care of the RX FIFO, DMA request only assert when received bytes - equal or more than RX water mark, there is potential issue if RX water - mark larger than 1. - For example, if RX FIFO water mark is 2, upper layer needs 5 bytes and - 5 bytes are received. the last byte will be saved in FIFO but not trigger - DMA transfer because the water mark is 2. - */ - if (rxDmaHandle != NULL) - { - base->RWFIFO = 1U; - } -#endif - - handle->rxDmaHandle = rxDmaHandle; - handle->txDmaHandle = txDmaHandle; - - /* Save the handle in global variables to support the double weak mechanism. */ - s_uartHandle[instance] = handle; - /* Save IRQ handler into static ISR function pointer. */ - s_uartIsr = UART_TransferDMAHandleIRQ; - /* Disable internal IRQs and enable global IRQ. */ - UART_DisableInterrupts(base, (uint32_t)kUART_AllInterruptsEnable); - (void)EnableIRQ(s_uartIRQ[instance]); - - /* Configure TX. */ - if (txDmaHandle != NULL) - { - DMA_SetCallback(txDmaHandle, UART_TransferSendDMACallback, &s_dmaPrivateHandle[instance]); - } - - /* Configure RX. */ - if (rxDmaHandle != NULL) - { - DMA_SetCallback(rxDmaHandle, UART_TransferReceiveDMACallback, &s_dmaPrivateHandle[instance]); - } -} - -/*! - * brief Sends data using DMA. - * - * This function sends data using DMA. This is non-blocking function, which returns - * right away. When all data is sent, the send callback function is called. - * - * param base UART peripheral base address. - * param handle UART handle pointer. - * param xfer UART DMA transfer structure. See #uart_transfer_t. - * retval kStatus_Success if succeeded; otherwise failed. - * retval kStatus_UART_TxBusy Previous transfer ongoing. - * retval kStatus_InvalidArgument Invalid argument. - */ -status_t UART_TransferSendDMA(UART_Type *base, uart_dma_handle_t *handle, uart_transfer_t *xfer) -{ - assert(handle != NULL); - assert(handle->txDmaHandle != NULL); - assert(xfer != NULL); - assert(xfer->data != NULL); - assert(xfer->dataSize != 0U); - - dma_transfer_config_t xferConfig; - status_t status; - - /* If previous TX not finished. */ - if ((uint8_t)kUART_TxBusy == handle->txState) - { - status = kStatus_UART_TxBusy; - } - else - { - handle->txState = (uint8_t)kUART_TxBusy; - handle->txDataSizeAll = xfer->dataSize; - - /* Prepare transfer. */ - DMA_PrepareTransfer(&xferConfig, xfer->data, sizeof(uint8_t), (uint32_t *)UART_GetDataRegisterAddress(base), - sizeof(uint8_t), xfer->dataSize, kDMA_MemoryToPeripheral); - - /* Submit transfer. */ - (void)DMA_SubmitTransfer(handle->txDmaHandle, &xferConfig, (uint32_t)kDMA_EnableInterrupt); - DMA_StartTransfer(handle->txDmaHandle); - - /* Enable UART TX DMA. */ - UART_EnableTxDMA(base, true); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Receives data using DMA. - * - * This function receives data using DMA. This is non-blocking function, which returns - * right away. When all data is received, the receive callback function is called. - * - * param base UART peripheral base address. - * param handle Pointer to the uart_dma_handle_t structure. - * param xfer UART DMA transfer structure. See #uart_transfer_t. - * retval kStatus_Success if succeeded; otherwise failed. - * retval kStatus_UART_RxBusy Previous transfer on going. - * retval kStatus_InvalidArgument Invalid argument. - */ -status_t UART_TransferReceiveDMA(UART_Type *base, uart_dma_handle_t *handle, uart_transfer_t *xfer) -{ - assert(handle != NULL); - assert(handle->rxDmaHandle != NULL); - assert(xfer != NULL); - assert(xfer->data != NULL); - assert(xfer->dataSize != 0U); - - dma_transfer_config_t xferConfig; - status_t status; - - /* If previous RX not finished. */ - if ((uint8_t)kUART_RxBusy == handle->rxState) - { - status = kStatus_UART_RxBusy; - } - else - { - handle->rxState = (uint8_t)kUART_RxBusy; - handle->rxDataSizeAll = xfer->dataSize; - - /* Prepare transfer. */ - DMA_PrepareTransfer(&xferConfig, (uint32_t *)UART_GetDataRegisterAddress(base), sizeof(uint8_t), xfer->data, - sizeof(uint8_t), xfer->dataSize, kDMA_PeripheralToMemory); - - /* Submit transfer. */ - (void)DMA_SubmitTransfer(handle->rxDmaHandle, &xferConfig, (uint32_t)kDMA_EnableInterrupt); - DMA_StartTransfer(handle->rxDmaHandle); - - /* Enable UART RX DMA. */ - UART_EnableRxDMA(base, true); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Aborts the send data using DMA. - * - * This function aborts the sent data using DMA. - * - * param base UART peripheral base address. - * param handle Pointer to uart_dma_handle_t structure. - */ -void UART_TransferAbortSendDMA(UART_Type *base, uart_dma_handle_t *handle) -{ - assert(handle != NULL); - assert(handle->txDmaHandle != NULL); - - /* Disable UART TX DMA. */ - UART_EnableTxDMA(base, false); - - /* Stop transfer. */ - DMA_AbortTransfer(handle->txDmaHandle); - - /* Write DMA->DSR[DONE] to abort transfer and clear status. */ - DMA_ClearChannelStatusFlags(handle->txDmaHandle->base, handle->txDmaHandle->channel, - (uint32_t)kDMA_TransactionsDoneFlag); - - handle->txState = (uint8_t)kUART_TxIdle; -} - -/*! - * brief Aborts the received data using DMA. - * - * This function abort receive data which using DMA. - * - * param base UART peripheral base address. - * param handle Pointer to uart_dma_handle_t structure. - */ -void UART_TransferAbortReceiveDMA(UART_Type *base, uart_dma_handle_t *handle) -{ - assert(handle != NULL); - assert(handle->rxDmaHandle != NULL); - - /* Disable UART RX DMA. */ - UART_EnableRxDMA(base, false); - - /* Stop transfer. */ - DMA_AbortTransfer(handle->rxDmaHandle); - - /* Write DMA->DSR[DONE] to abort transfer and clear status. */ - DMA_ClearChannelStatusFlags(handle->rxDmaHandle->base, handle->rxDmaHandle->channel, - (uint32_t)kDMA_TransactionsDoneFlag); - - handle->rxState = (uint8_t)kUART_RxIdle; -} - -/*! - * brief Gets the number of bytes written to UART TX register. - * - * This function gets the number of bytes written to UART TX - * register by DMA. - * - * param base UART peripheral base address. - * param handle UART handle pointer. - * param count Send bytes count. - * retval kStatus_NoTransferInProgress No send in progress. - * retval kStatus_InvalidArgument Parameter is invalid. - * retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t UART_TransferGetSendCountDMA(UART_Type *base, uart_dma_handle_t *handle, uint32_t *count) -{ - assert(handle != NULL); - assert(handle->txDmaHandle != NULL); - assert(count != NULL); - - if ((uint8_t)kUART_TxIdle == handle->txState) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->txDataSizeAll - DMA_GetRemainingBytes(handle->txDmaHandle->base, handle->txDmaHandle->channel); - - return kStatus_Success; -} - -/*! - * brief Gets the number of bytes that have been received. - * - * This function gets the number of bytes that have been received. - * - * param base UART peripheral base address. - * param handle UART handle pointer. - * param count Receive bytes count. - * retval kStatus_NoTransferInProgress No receive in progress. - * retval kStatus_InvalidArgument Parameter is invalid. - * retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t UART_TransferGetReceiveCountDMA(UART_Type *base, uart_dma_handle_t *handle, uint32_t *count) -{ - assert(handle != NULL); - assert(handle->rxDmaHandle != NULL); - assert(count != NULL); - - if ((uint8_t)kUART_RxIdle == handle->rxState) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->rxDataSizeAll - DMA_GetRemainingBytes(handle->rxDmaHandle->base, handle->rxDmaHandle->channel); - - return kStatus_Success; -} - -void UART_TransferDMAHandleIRQ(UART_Type *base, void *uartDmaHandle) -{ - assert(uartDmaHandle != NULL); - - uart_dma_handle_t *handle = (uart_dma_handle_t *)uartDmaHandle; - - handle->txState = (uint8_t)kUART_TxIdle; - - /* Disable tx complete interrupt */ - UART_DisableInterrupts(base, (uint32_t)kUART_TransmissionCompleteInterruptEnable); - - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_UART_TxIdle, handle->userData); - } -} diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_uart_dma.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_uart_dma.h deleted file mode 100644 index 4cc01126913..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_uart_dma.h +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_UART_DMA_H_ -#define FSL_UART_DMA_H_ - -#include "fsl_uart.h" -#include "fsl_dma.h" - -/*! - * @addtogroup uart_dma_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief UART DMA driver version. */ -#define FSL_UART_DMA_DRIVER_VERSION (MAKE_VERSION(2, 5, 0)) -/*! @} */ - -/* Forward declaration of the handle typedef. */ -typedef struct _uart_dma_handle uart_dma_handle_t; - -/*! @brief UART transfer callback function. */ -typedef void (*uart_dma_transfer_callback_t)(UART_Type *base, - uart_dma_handle_t *handle, - status_t status, - void *userData); - -/*! - * @brief UART DMA handle - */ -struct _uart_dma_handle -{ - UART_Type *base; /*!< UART peripheral base address. */ - - uart_dma_transfer_callback_t callback; /*!< Callback function. */ - void *userData; /*!< UART callback function parameter.*/ - size_t rxDataSizeAll; /*!< Size of the data to receive. */ - size_t txDataSizeAll; /*!< Size of the data to send out. */ - - dma_handle_t *txDmaHandle; /*!< The DMA TX channel used. */ - dma_handle_t *rxDmaHandle; /*!< The DMA RX channel used. */ - - volatile uint8_t txState; /*!< TX transfer state. */ - volatile uint8_t rxState; /*!< RX transfer state */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name eDMA transactional - * @{ - */ - -/*! - * @brief Initializes the UART handle which is used in transactional functions and sets the callback. - * - * @param base UART peripheral base address. - * @param handle Pointer to the uart_dma_handle_t structure. - * @param callback UART callback, NULL means no callback. - * @param userData User callback function data. - * @param rxDmaHandle User requested DMA handle for the RX DMA transfer. - * @param txDmaHandle User requested DMA handle for the TX DMA transfer. - */ -void UART_TransferCreateHandleDMA(UART_Type *base, - uart_dma_handle_t *handle, - uart_dma_transfer_callback_t callback, - void *userData, - dma_handle_t *txDmaHandle, - dma_handle_t *rxDmaHandle); - -/*! - * @brief Sends data using DMA. - * - * This function sends data using DMA. This is non-blocking function, which returns - * right away. When all data is sent, the send callback function is called. - * - * @param base UART peripheral base address. - * @param handle UART handle pointer. - * @param xfer UART DMA transfer structure. See #uart_transfer_t. - * @retval kStatus_Success if succeeded; otherwise failed. - * @retval kStatus_UART_TxBusy Previous transfer ongoing. - * @retval kStatus_InvalidArgument Invalid argument. - */ -status_t UART_TransferSendDMA(UART_Type *base, uart_dma_handle_t *handle, uart_transfer_t *xfer); - -/*! - * @brief Receives data using DMA. - * - * This function receives data using DMA. This is non-blocking function, which returns - * right away. When all data is received, the receive callback function is called. - * - * @param base UART peripheral base address. - * @param handle Pointer to the uart_dma_handle_t structure. - * @param xfer UART DMA transfer structure. See #uart_transfer_t. - * @retval kStatus_Success if succeeded; otherwise failed. - * @retval kStatus_UART_RxBusy Previous transfer on going. - * @retval kStatus_InvalidArgument Invalid argument. - */ -status_t UART_TransferReceiveDMA(UART_Type *base, uart_dma_handle_t *handle, uart_transfer_t *xfer); - -/*! - * @brief Aborts the send data using DMA. - * - * This function aborts the sent data using DMA. - * - * @param base UART peripheral base address. - * @param handle Pointer to uart_dma_handle_t structure. - */ -void UART_TransferAbortSendDMA(UART_Type *base, uart_dma_handle_t *handle); - -/*! - * @brief Aborts the received data using DMA. - * - * This function abort receive data which using DMA. - * - * @param base UART peripheral base address. - * @param handle Pointer to uart_dma_handle_t structure. - */ -void UART_TransferAbortReceiveDMA(UART_Type *base, uart_dma_handle_t *handle); - -/*! - * @brief Gets the number of bytes written to UART TX register. - * - * This function gets the number of bytes written to UART TX - * register by DMA. - * - * @param base UART peripheral base address. - * @param handle UART handle pointer. - * @param count Send bytes count. - * @retval kStatus_NoTransferInProgress No send in progress. - * @retval kStatus_InvalidArgument Parameter is invalid. - * @retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t UART_TransferGetSendCountDMA(UART_Type *base, uart_dma_handle_t *handle, uint32_t *count); - -/*! - * @brief Gets the number of bytes that have been received. - * - * This function gets the number of bytes that have been received. - * - * @param base UART peripheral base address. - * @param handle UART handle pointer. - * @param count Receive bytes count. - * @retval kStatus_NoTransferInProgress No receive in progress. - * @retval kStatus_InvalidArgument Parameter is invalid. - * @retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t UART_TransferGetReceiveCountDMA(UART_Type *base, uart_dma_handle_t *handle, uint32_t *count); - -/*! - * @brief UART DMA IRQ handle function. - * - * This function handles the UART transmit complete IRQ request and invoke user callback. - * - * @param base UART peripheral base address. - * @param uartDmaHandle UART handle pointer. - */ -void UART_TransferDMAHandleIRQ(UART_Type *base, void *uartDmaHandle); -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_UART_DMA_H_ */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_uart_freertos.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_uart_freertos.h deleted file mode 100644 index c46fa02f5f5..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_uart_freertos.h +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef __FSL_UART_RTOS_H__ -#define __FSL_UART_RTOS_H__ - -#include "fsl_uart.h" -#include -#include -#include - -/*! - * @addtogroup uart_freertos_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief UART FreeRTOS driver version. */ -#define FSL_UART_FREERTOS_DRIVER_VERSION (MAKE_VERSION(2, 5, 0)) -/*@}*/ - -/*! @brief UART configuration structure */ -typedef struct _uart_rtos_config -{ - UART_Type *base; /*!< UART base address */ - uint32_t srcclk; /*!< UART source clock in Hz*/ - uint32_t baudrate; /*!< Desired communication speed */ - uart_parity_mode_t parity; /*!< Parity setting */ - uart_stop_bit_count_t stopbits; /*!< Number of stop bits to use */ - uint8_t *buffer; /*!< Buffer for background reception */ - uint32_t buffer_size; /*!< Size of buffer for background reception */ -} uart_rtos_config_t; - -/*! - * @cond RTOS_PRIVATE - * @name UART FreeRTOS handler - * - * These are the only valid states for txEvent and rxEvent (uart_rtos_handle_t). - */ -/*@{*/ -/*! @brief Event flag - transfer complete. */ -#define RTOS_UART_COMPLETE 0x1U -/*! @brief Event flag - ring buffer overrun. */ -#define RTOS_UART_RING_BUFFER_OVERRUN 0x2U -/*! @brief Event flag - hardware buffer overrun. */ -#define RTOS_UART_HARDWARE_BUFFER_OVERRUN 0x4U -/*@}*/ - -/*! @brief UART FreeRTOS transfer structure. */ -typedef struct _uart_rtos_handle -{ - UART_Type *base; /*!< UART base address */ - uart_transfer_t txTransfer; /*!< TX transfer structure */ - uart_transfer_t rxTransfer; /*!< RX transfer structure */ - SemaphoreHandle_t rxSemaphore; /*!< RX semaphore for resource sharing */ - SemaphoreHandle_t txSemaphore; /*!< TX semaphore for resource sharing */ - EventGroupHandle_t rxEvent; /*!< RX completion event */ - EventGroupHandle_t txEvent; /*!< TX completion event */ - void *t_state; /*!< Transactional state of the underlying driver */ -#if (configSUPPORT_STATIC_ALLOCATION == 1) - StaticSemaphore_t txSemaphoreBuffer; /*!< Statically allocated memory for txSemaphore */ - StaticSemaphore_t rxSemaphoreBuffer; /*!< Statically allocated memory for rxSemaphore */ - StaticEventGroup_t txEventBuffer; /*!< Statically allocated memory for txEvent */ - StaticEventGroup_t rxEventBuffer; /*!< Statically allocated memory for rxEvent */ -#endif -} uart_rtos_handle_t; -/*! \endcond */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name UART RTOS Operation - * @{ - */ - -/*! - * @brief Initializes a UART instance for operation in RTOS. - * - * @param handle The RTOS UART handle, the pointer to an allocated space for RTOS context. - * @param t_handle The pointer to the allocated space to store the transactional layer internal state. - * @param cfg The pointer to the parameters required to configure the UART after initialization. - * @return 0 succeed; otherwise fail. - */ -int UART_RTOS_Init(uart_rtos_handle_t *handle, uart_handle_t *t_handle, const uart_rtos_config_t *cfg); - -/*! - * @brief Deinitializes a UART instance for operation. - * - * This function deinitializes the UART module, sets all register values to reset value, - * and frees the resources. - * - * @param handle The RTOS UART handle. - */ -int UART_RTOS_Deinit(uart_rtos_handle_t *handle); - -/*! - * @name UART transactional Operation - * @{ - */ - -/*! - * @brief Sends data in the background. - * - * This function sends data. It is a synchronous API. - * If the hardware buffer is full, the task is in the blocked state. - * - * @param handle The RTOS UART handle. - * @param buffer The pointer to the buffer to send. - * @param length The number of bytes to send. - */ -int UART_RTOS_Send(uart_rtos_handle_t *handle, uint8_t *buffer, uint32_t length); - -/*! - * @brief Receives data. - * - * This function receives data from UART. It is a synchronous API. If data is immediately available, - * it is returned immediately and the number of bytes received. - * - * @param handle The RTOS UART handle. - * @param buffer The pointer to the buffer to write received data. - * @param length The number of bytes to receive. - * @param received The pointer to a variable of size_t where the number of received data is filled. - */ -int UART_RTOS_Receive(uart_rtos_handle_t *handle, uint8_t *buffer, uint32_t length, size_t *received); - -/* @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* __FSL_UART_RTOS_H__ */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_vref.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_vref.c deleted file mode 100644 index 400e5a62298..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_vref.c +++ /dev/null @@ -1,292 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2019 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_vref.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.vref" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Gets the instance from the base address - * - * @param base VREF peripheral base address - * - * @return The VREF instance - */ -static uint32_t VREF_GetInstance(VREF_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/*! @brief Pointers to VREF bases for each instance. */ -static VREF_Type *const s_vrefBases[] = VREF_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to VREF clocks for each instance. */ -static const clock_ip_name_t s_vrefClocks[] = VREF_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/******************************************************************************* - * Code - ******************************************************************************/ - -static uint32_t VREF_GetInstance(VREF_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_vrefBases); instance++) - { - if (s_vrefBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_vrefBases)); - - return instance; -} - -/*! - * brief Enables the clock gate and configures the VREF module according to the configuration structure. - * - * This function must be called before calling all other VREF driver functions, - * read/write registers, and configurations with user-defined settings. - * The example below shows how to set up vref_config_t parameters and - * how to call the VREF_Init function by passing in these parameters. - * This is an example. - * code - * vref_config_t vrefConfig; - * vrefConfig.bufferMode = kVREF_ModeHighPowerBuffer; - * vrefConfig.enableExternalVoltRef = false; - * vrefConfig.enableLowRef = false; - * VREF_Init(VREF, &vrefConfig); - * endcode - * - * param base VREF peripheral address. - * param config Pointer to the configuration structure. - */ -void VREF_Init(VREF_Type *base, const vref_config_t *config) -{ - assert(config != NULL); - - uint8_t reg = 0U; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate clock for VREF */ - CLOCK_EnableClock(s_vrefClocks[VREF_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/* Configure VREF to a known state */ -#if defined(FSL_FEATURE_VREF_HAS_CHOP_OSC) && FSL_FEATURE_VREF_HAS_CHOP_OSC - /* Set chop oscillator bit */ - base->TRM |= VREF_TRM_CHOPEN_MASK; -#endif /* FSL_FEATURE_VREF_HAS_CHOP_OSC */ -/* Get current SC register */ -#if defined(FSL_FEATURE_VREF_HAS_LOW_REFERENCE) && FSL_FEATURE_VREF_HAS_LOW_REFERENCE - reg = base->VREFH_SC; -#else - reg = base->SC; -#endif /* FSL_FEATURE_VREF_HAS_LOW_REFERENCE */ - /* Clear old buffer mode selection bits */ - reg &= ~(uint8_t)VREF_SC_MODE_LV_MASK; - /* Set buffer Mode selection and Regulator enable bit */ - reg |= VREF_SC_MODE_LV(config->bufferMode) | VREF_SC_REGEN(1U); -#if defined(FSL_FEATURE_VREF_HAS_COMPENSATION) && FSL_FEATURE_VREF_HAS_COMPENSATION - /* Set second order curvature compensation enable bit */ - reg |= VREF_SC_ICOMPEN(1U); -#endif /* FSL_FEATURE_VREF_HAS_COMPENSATION */ - /* Enable VREF module */ - reg |= VREF_SC_VREFEN(1U); -/* Update bit-field from value to Status and Control register */ -#if defined(FSL_FEATURE_VREF_HAS_LOW_REFERENCE) && FSL_FEATURE_VREF_HAS_LOW_REFERENCE - base->VREFH_SC = reg; -#else - base->SC = reg; -#endif /* FSL_FEATURE_VREF_HAS_LOW_REFERENCE */ -#if defined(FSL_FEATURE_VREF_HAS_LOW_REFERENCE) && FSL_FEATURE_VREF_HAS_LOW_REFERENCE - reg = base->VREFL_TRM; - /* Clear old select external voltage reference and VREFL (0.4 V) reference buffer enable bits */ - reg &= (uint8_t)(~(VREF_VREFL_TRM_VREFL_EN_MASK | VREF_VREFL_TRM_VREFL_SEL_MASK)); - /* Select external voltage reference and set VREFL (0.4 V) reference buffer enable */ - reg |= VREF_VREFL_TRM_VREFL_SEL(config->enableExternalVoltRef) | VREF_VREFL_TRM_VREFL_EN(config->enableLowRef); - base->VREFL_TRM = reg; -#endif /* FSL_FEATURE_VREF_HAS_LOW_REFERENCE */ - -#if defined(FSL_FEATURE_VREF_HAS_TRM4) && FSL_FEATURE_VREF_HAS_TRM4 - reg = base->TRM4; - /* Clear old select internal voltage reference bit (2.1V) */ - reg &= ~(uint8_t)VREF_TRM4_VREF2V1_EN_MASK; - /* Select internal voltage reference (2.1V) */ - reg |= VREF_TRM4_VREF2V1_EN(config->enable2V1VoltRef); - base->TRM4 = reg; -#endif /* FSL_FEATURE_VREF_HAS_TRM4 */ - -/* Wait until internal voltage stable */ -#if defined(FSL_FEATURE_VREF_HAS_LOW_REFERENCE) && FSL_FEATURE_VREF_HAS_LOW_REFERENCE - while ((base->VREFH_SC & VREF_SC_VREFST_MASK) == 0U) -#else - while ((base->SC & VREF_SC_VREFST_MASK) == 0U) -#endif /* FSL_FEATURE_VREF_HAS_LOW_REFERENCE */ - { - } -} - -/*! - * brief Stops and disables the clock for the VREF module. - * - * This function should be called to shut down the module. - * This is an example. - * code - * vref_config_t vrefUserConfig; - * VREF_Init(VREF); - * VREF_GetDefaultConfig(&vrefUserConfig); - * ... - * VREF_Deinit(VREF); - * endcode - * - * param base VREF peripheral address. - */ -void VREF_Deinit(VREF_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate clock for VREF */ - CLOCK_DisableClock(s_vrefClocks[VREF_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Initializes the VREF configuration structure. - * - * This function initializes the VREF configuration structure to default values. - * This is an example. - * code - * vrefConfig->bufferMode = kVREF_ModeHighPowerBuffer; - * vrefConfig->enableExternalVoltRef = false; - * vrefConfig->enableLowRef = false; - * endcode - * - * param config Pointer to the initialization structure. - */ -void VREF_GetDefaultConfig(vref_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - -/* Set High power buffer mode in */ -#if defined(FSL_FEATURE_VREF_MODE_LV_TYPE) && FSL_FEATURE_VREF_MODE_LV_TYPE - config->bufferMode = kVREF_ModeHighPowerBuffer; -#else - config->bufferMode = kVREF_ModeTightRegulationBuffer; -#endif /* FSL_FEATURE_VREF_MODE_LV_TYPE */ - -#if defined(FSL_FEATURE_VREF_HAS_LOW_REFERENCE) && FSL_FEATURE_VREF_HAS_LOW_REFERENCE - /* Select internal voltage reference */ - config->enableExternalVoltRef = false; - /* Set VREFL (0.4 V) reference buffer disable */ - config->enableLowRef = false; -#endif /* FSL_FEATURE_VREF_HAS_LOW_REFERENCE */ - -#if defined(FSL_FEATURE_VREF_HAS_TRM4) && FSL_FEATURE_VREF_HAS_TRM4 - /* Disable internal voltage reference (2.1V) */ - config->enable2V1VoltRef = false; -#endif /* FSL_FEATURE_VREF_HAS_TRM4 */ -} - -/*! - * brief Sets a TRIM value for the reference voltage. - * - * This function sets a TRIM value for the reference voltage. - * Note that the TRIM value maximum is 0x3F. - * - * param base VREF peripheral address. - * param trimValue Value of the trim register to set the output reference voltage (maximum 0x3F (6-bit)). - */ -void VREF_SetTrimVal(VREF_Type *base, uint8_t trimValue) -{ - uint8_t reg = 0U; - - /* Set TRIM bits value in voltage reference */ - reg = base->TRM; - reg = (uint8_t)((reg & ~VREF_TRM_TRIM_MASK) | VREF_TRM_TRIM(trimValue)); - base->TRM = reg; -/* Wait until internal voltage stable */ -#if defined(FSL_FEATURE_VREF_HAS_LOW_REFERENCE) && FSL_FEATURE_VREF_HAS_LOW_REFERENCE - while ((base->VREFH_SC & VREF_SC_VREFST_MASK) == 0U) -#else - while ((base->SC & VREF_SC_VREFST_MASK) == 0U) -#endif /* FSL_FEATURE_VREF_HAS_LOW_REFERENCE */ - { - } -} - -#if defined(FSL_FEATURE_VREF_HAS_TRM4) && FSL_FEATURE_VREF_HAS_TRM4 -/*! - * brief Sets a TRIM value for the reference voltage (2V1). - * - * This function sets a TRIM value for the reference voltage (2V1). - * Note that the TRIM value maximum is 0x3F. - * - * param base VREF peripheral address. - * param trimValue Value of the trim register to set the output reference voltage (maximum 0x3F (6-bit)). - */ -void VREF_SetTrim2V1Val(VREF_Type *base, uint8_t trimValue) -{ - uint8_t reg = 0U; - - /* Set TRIM bits value in voltage reference (2V1) */ - reg = base->TRM4; - reg = (uint8_t)((reg & ~VREF_TRM4_TRIM2V1_MASK) | VREF_TRM4_TRIM2V1(trimValue)); - base->TRM4 = reg; - /* Wait until internal voltage stable */ - while ((base->SC & VREF_SC_VREFST_MASK) == 0U) - { - } -} -#endif /* FSL_FEATURE_VREF_HAS_TRM4 */ - -#if defined(FSL_FEATURE_VREF_HAS_LOW_REFERENCE) && FSL_FEATURE_VREF_HAS_LOW_REFERENCE -/*! - * brief Sets the TRIM value for the low voltage reference. - * - * This function sets the TRIM value for low reference voltage. - * Note the following. - * - The TRIM value maximum is 0x05U - * - The values 111b and 110b are not valid/allowed. - * - * param base VREF peripheral address. - * param trimValue Value of the trim register to set output low reference voltage (maximum 0x05U (3-bit)). - */ -void VREF_SetLowReferenceTrimVal(VREF_Type *base, uint8_t trimValue) -{ - /* The values 111b and 110b are NOT valid/allowed */ - assert((trimValue != 0x7U) && (trimValue != 0x6U)); - - uint8_t reg = 0U; - - /* Set TRIM bits value in low voltage reference */ - reg = base->VREFL_TRM; - reg = ((reg & (uint8_t)(~VREF_VREFL_TRM_VREFL_TRIM_MASK)) | VREF_VREFL_TRM_VREFL_TRIM(trimValue)); - base->VREFL_TRM = reg; - /* Wait until internal voltage stable */ - - while ((base->VREFH_SC & VREF_SC_VREFST_MASK) == 0U) - { - } -} -#endif /* FSL_FEATURE_VREF_HAS_LOW_REFERENCE */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_vref.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_vref.h deleted file mode 100644 index ded4bdb70ee..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/drivers/fsl_vref.h +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2019 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_VREF_H_ -#define FSL_VREF_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup vref - * @{ - */ - -/****************************************************************************** - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -#define FSL_VREF_DRIVER_VERSION (MAKE_VERSION(2, 1, 2)) /*!< Version 2.1.2. */ -/*! @} */ - -/* Those macros below defined to support SoC family which have VREFL (0.4V) reference */ -#if defined(FSL_FEATURE_VREF_HAS_LOW_REFERENCE) && FSL_FEATURE_VREF_HAS_LOW_REFERENCE -#define VREF_SC_MODE_LV VREF_VREFH_SC_MODE_LV -#define VREF_SC_REGEN VREF_VREFH_SC_REGEN -#define VREF_SC_VREFEN VREF_VREFH_SC_VREFEN -#define VREF_SC_ICOMPEN VREF_VREFH_SC_ICOMPEN -#define VREF_SC_REGEN_MASK VREF_VREFH_SC_REGEN_MASK -#define VREF_SC_VREFST_MASK VREF_VREFH_SC_VREFST_MASK -#define VREF_SC_VREFEN_MASK VREF_VREFH_SC_VREFEN_MASK -#define VREF_SC_MODE_LV_MASK VREF_VREFH_SC_MODE_LV_MASK -#define VREF_SC_ICOMPEN_MASK VREF_VREFH_SC_ICOMPEN_MASK -#define TRM VREFH_TRM -#define VREF_TRM_TRIM VREF_VREFH_TRM_TRIM -#define VREF_TRM_CHOPEN_MASK VREF_VREFH_TRM_CHOPEN_MASK -#define VREF_TRM_TRIM_MASK VREF_VREFH_TRM_TRIM_MASK -#define VREF_TRM_CHOPEN_SHIFT VREF_VREFH_TRM_CHOPEN_SHIFT -#define VREF_TRM_TRIM_SHIFT VREF_VREFH_TRM_TRIM_SHIFT -#define VREF_SC_MODE_LV_SHIFT VREF_VREFH_SC_MODE_LV_SHIFT -#define VREF_SC_REGEN_SHIFT VREF_VREFH_SC_REGEN_SHIFT -#define VREF_SC_VREFST_SHIFT VREF_VREFH_SC_VREFST_SHIFT -#define VREF_SC_ICOMPEN_SHIFT VREF_VREFH_SC_ICOMPEN_SHIFT -#endif /* FSL_FEATURE_VREF_HAS_LOW_REFERENCE */ - -/*! - * @brief VREF modes. - */ -typedef enum _vref_buffer_mode -{ - kVREF_ModeBandgapOnly = 0U, /*!< Bandgap on only, for stabilization and startup */ -#if defined(FSL_FEATURE_VREF_MODE_LV_TYPE) && FSL_FEATURE_VREF_MODE_LV_TYPE - kVREF_ModeHighPowerBuffer = 1U, /*!< High-power buffer mode enabled */ - kVREF_ModeLowPowerBuffer = 2U /*!< Low-power buffer mode enabled */ -#else - kVREF_ModeTightRegulationBuffer = 2U /*!< Tight regulation buffer enabled */ -#endif /* FSL_FEATURE_VREF_MODE_LV_TYPE */ -} vref_buffer_mode_t; - -/*! - * @brief The description structure for the VREF module. - */ -typedef struct _vref_config -{ - vref_buffer_mode_t bufferMode; /*!< Buffer mode selection */ -#if defined(FSL_FEATURE_VREF_HAS_LOW_REFERENCE) && FSL_FEATURE_VREF_HAS_LOW_REFERENCE - bool enableLowRef; /*!< Set VREFL (0.4 V) reference buffer enable or disable */ - bool enableExternalVoltRef; /*!< Select external voltage reference or not (internal) */ -#endif /* FSL_FEATURE_VREF_HAS_LOW_REFERENCE */ -#if defined(FSL_FEATURE_VREF_HAS_TRM4) && FSL_FEATURE_VREF_HAS_TRM4 - bool enable2V1VoltRef; /*!< Enable Internal Voltage Reference (2.1V) */ -#endif /* FSL_FEATURE_VREF_HAS_TRM4 */ -} vref_config_t; - -/****************************************************************************** - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name VREF functional operation - * @{ - */ - -/*! - * @brief Enables the clock gate and configures the VREF module according to the configuration structure. - * - * This function must be called before calling all other VREF driver functions, - * read/write registers, and configurations with user-defined settings. - * The example below shows how to set up vref_config_t parameters and - * how to call the VREF_Init function by passing in these parameters. - * This is an example. - * @code - * vref_config_t vrefConfig; - * vrefConfig.bufferMode = kVREF_ModeHighPowerBuffer; - * vrefConfig.enableExternalVoltRef = false; - * vrefConfig.enableLowRef = false; - * VREF_Init(VREF, &vrefConfig); - * @endcode - * - * @param base VREF peripheral address. - * @param config Pointer to the configuration structure. - */ -void VREF_Init(VREF_Type *base, const vref_config_t *config); - -/*! - * @brief Stops and disables the clock for the VREF module. - * - * This function should be called to shut down the module. - * This is an example. - * @code - * vref_config_t vrefUserConfig; - * VREF_Init(VREF); - * VREF_GetDefaultConfig(&vrefUserConfig); - * ... - * VREF_Deinit(VREF); - * @endcode - * - * @param base VREF peripheral address. - */ -void VREF_Deinit(VREF_Type *base); - -/*! - * @brief Initializes the VREF configuration structure. - * - * This function initializes the VREF configuration structure to default values. - * This is an example. - * @code - * vrefConfig->bufferMode = kVREF_ModeHighPowerBuffer; - * vrefConfig->enableExternalVoltRef = false; - * vrefConfig->enableLowRef = false; - * @endcode - * - * @param config Pointer to the initialization structure. - */ -void VREF_GetDefaultConfig(vref_config_t *config); - -/*! - * @brief Sets a TRIM value for the reference voltage. - * - * This function sets a TRIM value for the reference voltage. - * Note that the TRIM value maximum is 0x3F. - * - * @param base VREF peripheral address. - * @param trimValue Value of the trim register to set the output reference voltage (maximum 0x3F (6-bit)). - */ -void VREF_SetTrimVal(VREF_Type *base, uint8_t trimValue); - -/*! - * @brief Reads the value of the TRIM meaning output voltage. - * - * This function gets the TRIM value from the TRM register. - * - * @param base VREF peripheral address. - * @return Six-bit value of trim setting. - */ -static inline uint8_t VREF_GetTrimVal(VREF_Type *base) -{ - return (base->TRM & VREF_TRM_TRIM_MASK); -} - -#if defined(FSL_FEATURE_VREF_HAS_TRM4) && FSL_FEATURE_VREF_HAS_TRM4 -/*! - * @brief Sets a TRIM value for the reference voltage (2V1). - * - * This function sets a TRIM value for the reference voltage (2V1). - * Note that the TRIM value maximum is 0x3F. - * - * @param base VREF peripheral address. - * @param trimValue Value of the trim register to set the output reference voltage (maximum 0x3F (6-bit)). - */ -void VREF_SetTrim2V1Val(VREF_Type *base, uint8_t trimValue); - -/*! - * @brief Reads the value of the TRIM meaning output voltage (2V1). - * - * This function gets the TRIM value from the VREF_TRM4 register. - * - * @param base VREF peripheral address. - * @return Six-bit value of trim setting. - */ -static inline uint8_t VREF_GetTrim2V1Val(VREF_Type *base) -{ - return (base->TRM4 & VREF_TRM4_TRIM2V1_MASK); -} -#endif /* FSL_FEATURE_VREF_HAS_TRM4 */ - -#if defined(FSL_FEATURE_VREF_HAS_LOW_REFERENCE) && FSL_FEATURE_VREF_HAS_LOW_REFERENCE - -/*! - * @brief Sets the TRIM value for the low voltage reference. - * - * This function sets the TRIM value for low reference voltage. - * Note the following. - * - The TRIM value maximum is 0x05U - * - The values 111b and 110b are not valid/allowed. - * - * @param base VREF peripheral address. - * @param trimValue Value of the trim register to set output low reference voltage (maximum 0x05U (3-bit)). - */ -void VREF_SetLowReferenceTrimVal(VREF_Type *base, uint8_t trimValue); - -/*! - * @brief Reads the value of the TRIM meaning output voltage. - * - * This function gets the TRIM value from the VREFL_TRM register. - * - * @param base VREF peripheral address. - * @return Three-bit value of the trim setting. - */ -static inline uint8_t VREF_GetLowReferenceTrimVal(VREF_Type *base) -{ - return (base->VREFL_TRM & VREF_VREFL_TRM_VREFL_TRIM_MASK); -} -#endif /* FSL_FEATURE_VREF_HAS_LOW_REFERENCE */ - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @}*/ - -#endif /* FSL_VREF_H_ */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/fsl_device_registers.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/fsl_device_registers.h deleted file mode 100644 index 4b61d468a77..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/fsl_device_registers.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2014-2016 Freescale Semiconductor, Inc. - * Copyright 2016-2024 NXP - * SPDX-License-Identifier: BSD-3-Clause - * - */ - -#ifndef __FSL_DEVICE_REGISTERS_H__ -#define __FSL_DEVICE_REGISTERS_H__ - -/* - * Include the cpu specific register header files. - * - * The CPU macro should be declared in the project or makefile. - */ -#if (defined(CPU_MCXC444VLH) || defined(CPU_MCXC444VMP)) - -#define MCXC444_SERIES - -/* CMSIS-style register definitions */ -#include "MCXC444.h" -/* CPU specific feature definitions */ -#include "MCXC444_features.h" - -#else - #error "No valid CPU defined!" -#endif - -#endif /* __FSL_DEVICE_REGISTERS_H__ */ - -/******************************************************************************* - * EOF - ******************************************************************************/ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/gcc/startup_MCXC444.S b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/gcc/startup_MCXC444.S deleted file mode 100644 index 99bec9ca66f..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/gcc/startup_MCXC444.S +++ /dev/null @@ -1,377 +0,0 @@ -/* ------------------------------------------------------------------------- */ -/* @file: startup_MCXC444.s */ -/* @purpose: CMSIS Cortex-M0P Core Device Startup File */ -/* MCXC444 */ -/* @version: 1.0 */ -/* @date: 2024-3-11 */ -/* @build: b240401 */ -/* ------------------------------------------------------------------------- */ -/* */ -/* Copyright 1997-2016 Freescale Semiconductor, Inc. */ -/* Copyright 2016-2024 NXP */ -/* SPDX-License-Identifier: BSD-3-Clause */ -/*****************************************************************************/ -/* Version: GCC for ARM Embedded Processors */ -/*****************************************************************************/ - .syntax unified - .arch armv6-m - - .section .isr_vector, "a" - .align 2 - .globl __isr_vector -__isr_vector: - .long __StackTop /* Top of Stack */ - .long Reset_Handler /* Reset Handler */ - .long NMI_Handler /* NMI Handler*/ - .long HardFault_Handler /* Hard Fault Handler*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long SVC_Handler /* SVCall Handler*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long PendSV_Handler /* PendSV Handler*/ - .long SysTick_Handler /* SysTick Handler*/ - - /* External Interrupts*/ - .long DMA0_IRQHandler /* DMA channel 0 transfer complete*/ - .long DMA1_IRQHandler /* DMA channel 1 transfer complete*/ - .long DMA2_IRQHandler /* DMA channel 2 transfer complete*/ - .long DMA3_IRQHandler /* DMA channel 3 transfer complete*/ - .long Reserved20_IRQHandler /* Reserved interrupt*/ - .long FTFA_IRQHandler /* Command complete and read collision*/ - .long PMC_IRQHandler /* Low-voltage detect, low-voltage warning*/ - .long LLWU_IRQHandler /* Low leakage wakeup*/ - .long I2C0_IRQHandler /* I2C0 interrupt*/ - .long I2C1_IRQHandler /* I2C1 interrupt*/ - .long SPI0_IRQHandler /* SPI0 single interrupt vector for all sources*/ - .long SPI1_IRQHandler /* SPI1 single interrupt vector for all sources*/ - .long LPUART0_IRQHandler /* LPUART0 status and error*/ - .long LPUART1_IRQHandler /* LPUART1 status and error*/ - .long UART2_FLEXIO_IRQHandler /* UART2 or FLEXIO*/ - .long ADC0_IRQHandler /* ADC0 interrupt*/ - .long CMP0_IRQHandler /* CMP0 interrupt*/ - .long TPM0_IRQHandler /* TPM0 single interrupt vector for all sources*/ - .long TPM1_IRQHandler /* TPM1 single interrupt vector for all sources*/ - .long TPM2_IRQHandler /* TPM2 single interrupt vector for all sources*/ - .long RTC_IRQHandler /* RTC alarm*/ - .long RTC_Seconds_IRQHandler /* RTC seconds*/ - .long PIT_IRQHandler /* PIT interrupt*/ - .long I2S0_IRQHandler /* I2S0 interrupt*/ - .long USB0_IRQHandler /* USB0 interrupt*/ - .long DAC0_IRQHandler /* DAC0 interrupt*/ - .long Reserved42_IRQHandler /* Reserved interrupt*/ - .long Reserved43_IRQHandler /* Reserved interrupt*/ - .long LPTMR0_IRQHandler /* LPTMR0 interrupt*/ - .long LCD_IRQHandler /* LCD interrupt*/ - .long PORTA_IRQHandler /* PORTA Pin detect*/ - .long PORTC_PORTD_IRQHandler /* Single interrupt vector for PORTC; PORTD Pin detect*/ - - .size __isr_vector, . - __isr_vector - -/* Flash Configuration */ - .section .FlashConfig, "a" - .long 0xFFFFFFFF - .long 0xFFFFFFFF - .long 0xFFFFFFFF - .long 0xFFFF3FFE - - .text - .thumb - -#if defined (__cplusplus) -#ifdef __REDLIB__ -#error Redlib does not support C++ -#endif -#endif -/* Reset Handler */ - - .thumb_func - .align 2 - .globl Reset_Handler - .weak Reset_Handler - .type Reset_Handler, %function -Reset_Handler: - cpsid i /* Mask interrupts */ - .equ VTOR, 0xE000ED08 - ldr r0, =VTOR - ldr r1, =__isr_vector - str r1, [r0] - ldr r2, [r1] - msr msp, r2 -#ifndef __NO_SYSTEM_INIT - ldr r0,=SystemInit - blx r0 -#endif -/* Loop to copy data from read only memory to RAM. The ranges - * of copy from/to are specified by following symbols evaluated in - * linker script. - * __etext: End of code section, i.e., begin of data sections to copy from. - * __data_start__/__data_end__: RAM address range that data should be - * copied to. Both must be aligned to 4 bytes boundary. */ - - ldr r1, =__etext - ldr r2, =__data_start__ - ldr r3, =__data_end__ - - subs r3, r2 - ble .LC0 - -.LC1: - subs r3, 4 - ldr r0, [r1,r3] - str r0, [r2,r3] - bgt .LC1 -.LC0: - -#ifdef __STARTUP_CLEAR_BSS -/* This part of work usually is done in C library startup code. Otherwise, - * define this macro to enable it in this startup. - * - * Loop to zero out BSS section, which uses following symbols - * in linker script: - * __bss_start__: start of BSS section. Must align to 4 - * __bss_end__: end of BSS section. Must align to 4 - */ - ldr r1, =__bss_start__ - ldr r2, =__bss_end__ - - subs r2, r1 - ble .LC3 - - movs r0, 0 -.LC2: - subs r2, 4 - str r0, [r1, r2] - bgt .LC2 -.LC3: -#endif - cpsie i /* Unmask interrupts */ -#ifndef __START -#ifdef __REDLIB__ -#define __START __main -#else -#define __START _start -#endif -#endif -#ifndef __ATOLLIC__ - ldr r0,=__START - blx r0 -#else - ldr r0,=__libc_init_array - blx r0 - ldr r0,=main - bx r0 -#endif - .pool - .size Reset_Handler, . - Reset_Handler - - .align 1 - .thumb_func - .weak DefaultISR - .type DefaultISR, %function -DefaultISR: - ldr r0, =DefaultISR - bx r0 - .size DefaultISR, . - DefaultISR - - .align 1 - .thumb_func - .weak NMI_Handler - .type NMI_Handler, %function -NMI_Handler: - ldr r0,=NMI_Handler - bx r0 - .size NMI_Handler, . - NMI_Handler - - .align 1 - .thumb_func - .weak HardFault_Handler - .type HardFault_Handler, %function -HardFault_Handler: - ldr r0,=HardFault_Handler - bx r0 - .size HardFault_Handler, . - HardFault_Handler - - .align 1 - .thumb_func - .weak SVC_Handler - .type SVC_Handler, %function -SVC_Handler: - ldr r0,=SVC_Handler - bx r0 - .size SVC_Handler, . - SVC_Handler - - .align 1 - .thumb_func - .weak PendSV_Handler - .type PendSV_Handler, %function -PendSV_Handler: - ldr r0,=PendSV_Handler - bx r0 - .size PendSV_Handler, . - PendSV_Handler - - .align 1 - .thumb_func - .weak SysTick_Handler - .type SysTick_Handler, %function -SysTick_Handler: - ldr r0,=SysTick_Handler - bx r0 - .size SysTick_Handler, . - SysTick_Handler - - .align 1 - .thumb_func - .weak DMA0_IRQHandler - .type DMA0_IRQHandler, %function -DMA0_IRQHandler: - ldr r0,=DMA0_DriverIRQHandler - bx r0 - .size DMA0_IRQHandler, . - DMA0_IRQHandler - - .align 1 - .thumb_func - .weak DMA1_IRQHandler - .type DMA1_IRQHandler, %function -DMA1_IRQHandler: - ldr r0,=DMA1_DriverIRQHandler - bx r0 - .size DMA1_IRQHandler, . - DMA1_IRQHandler - - .align 1 - .thumb_func - .weak DMA2_IRQHandler - .type DMA2_IRQHandler, %function -DMA2_IRQHandler: - ldr r0,=DMA2_DriverIRQHandler - bx r0 - .size DMA2_IRQHandler, . - DMA2_IRQHandler - - .align 1 - .thumb_func - .weak DMA3_IRQHandler - .type DMA3_IRQHandler, %function -DMA3_IRQHandler: - ldr r0,=DMA3_DriverIRQHandler - bx r0 - .size DMA3_IRQHandler, . - DMA3_IRQHandler - - .align 1 - .thumb_func - .weak I2C0_IRQHandler - .type I2C0_IRQHandler, %function -I2C0_IRQHandler: - ldr r0,=I2C0_DriverIRQHandler - bx r0 - .size I2C0_IRQHandler, . - I2C0_IRQHandler - - .align 1 - .thumb_func - .weak I2C1_IRQHandler - .type I2C1_IRQHandler, %function -I2C1_IRQHandler: - ldr r0,=I2C1_DriverIRQHandler - bx r0 - .size I2C1_IRQHandler, . - I2C1_IRQHandler - - .align 1 - .thumb_func - .weak SPI0_IRQHandler - .type SPI0_IRQHandler, %function -SPI0_IRQHandler: - ldr r0,=SPI0_DriverIRQHandler - bx r0 - .size SPI0_IRQHandler, . - SPI0_IRQHandler - - .align 1 - .thumb_func - .weak SPI1_IRQHandler - .type SPI1_IRQHandler, %function -SPI1_IRQHandler: - ldr r0,=SPI1_DriverIRQHandler - bx r0 - .size SPI1_IRQHandler, . - SPI1_IRQHandler - - .align 1 - .thumb_func - .weak LPUART0_IRQHandler - .type LPUART0_IRQHandler, %function -LPUART0_IRQHandler: - ldr r0,=LPUART0_DriverIRQHandler - bx r0 - .size LPUART0_IRQHandler, . - LPUART0_IRQHandler - - .align 1 - .thumb_func - .weak LPUART1_IRQHandler - .type LPUART1_IRQHandler, %function -LPUART1_IRQHandler: - ldr r0,=LPUART1_DriverIRQHandler - bx r0 - .size LPUART1_IRQHandler, . - LPUART1_IRQHandler - - .align 1 - .thumb_func - .weak UART2_FLEXIO_IRQHandler - .type UART2_FLEXIO_IRQHandler, %function -UART2_FLEXIO_IRQHandler: - ldr r0,=UART2_FLEXIO_DriverIRQHandler - bx r0 - .size UART2_FLEXIO_IRQHandler, . - UART2_FLEXIO_IRQHandler - - .align 1 - .thumb_func - .weak I2S0_IRQHandler - .type I2S0_IRQHandler, %function -I2S0_IRQHandler: - ldr r0,=I2S0_DriverIRQHandler - bx r0 - .size I2S0_IRQHandler, . - I2S0_IRQHandler - - -/* Macro to define default handlers. Default handler - * will be weak symbol and just dead loops. They can be - * overwritten by other handlers */ - .macro def_irq_handler handler_name - .weak \handler_name - .set \handler_name, DefaultISR - .endm -/* Exception Handlers */ - def_irq_handler DMA0_DriverIRQHandler - def_irq_handler DMA1_DriverIRQHandler - def_irq_handler DMA2_DriverIRQHandler - def_irq_handler DMA3_DriverIRQHandler - def_irq_handler Reserved20_IRQHandler - def_irq_handler FTFA_IRQHandler - def_irq_handler PMC_IRQHandler - def_irq_handler LLWU_IRQHandler - def_irq_handler I2C0_DriverIRQHandler - def_irq_handler I2C1_DriverIRQHandler - def_irq_handler SPI0_DriverIRQHandler - def_irq_handler SPI1_DriverIRQHandler - def_irq_handler LPUART0_DriverIRQHandler - def_irq_handler LPUART1_DriverIRQHandler - def_irq_handler UART2_FLEXIO_DriverIRQHandler - def_irq_handler ADC0_IRQHandler - def_irq_handler CMP0_IRQHandler - def_irq_handler TPM0_IRQHandler - def_irq_handler TPM1_IRQHandler - def_irq_handler TPM2_IRQHandler - def_irq_handler RTC_IRQHandler - def_irq_handler RTC_Seconds_IRQHandler - def_irq_handler PIT_IRQHandler - def_irq_handler I2S0_DriverIRQHandler - def_irq_handler USB0_IRQHandler - def_irq_handler DAC0_IRQHandler - def_irq_handler Reserved42_IRQHandler - def_irq_handler Reserved43_IRQHandler - def_irq_handler LPTMR0_IRQHandler - def_irq_handler LCD_IRQHandler - def_irq_handler PORTA_IRQHandler - def_irq_handler PORTC_PORTD_IRQHandler - - .end diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/iar/startup_MCXC444.s b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/iar/startup_MCXC444.s deleted file mode 100644 index 40d222e7335..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/iar/startup_MCXC444.s +++ /dev/null @@ -1,304 +0,0 @@ -; ------------------------------------------------------------------------- -; @file: startup_MCXC444.s -; @purpose: CMSIS Cortex-M0P Core Device Startup File -; MCXC444 -; @version: 1.0 -; @date: 2024-3-11 -; @build: b240401 -; ------------------------------------------------------------------------- -; -; Copyright 1997-2016 Freescale Semiconductor, Inc. -; Copyright 2016-2024 NXP -; SPDX-License-Identifier: BSD-3-Clause -; -; The modules in this file are included in the libraries, and may be replaced -; by any user-defined modules that define the PUBLIC symbol _program_start or -; a user defined start symbol. -; To override the cstartup defined in the library, simply add your modified -; version to the workbench project. -; -; The vector table is normally located at address 0. -; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. -; The name "__vector_table" has special meaning for C-SPY: -; it is where the SP start value is found, and the NVIC vector -; table register (VTOR) is initialized to this address if != 0. -; -; Cortex-M version -; - - MODULE ?cstartup - - ;; Forward declaration of sections. - SECTION CSTACK:DATA:NOROOT(3) - - SECTION .intvec:CODE:NOROOT(2) - - EXTERN __iar_program_start - EXTERN SystemInit - PUBLIC __vector_table - PUBLIC __vector_table_0x1c - PUBLIC __Vectors - PUBLIC __Vectors_End - PUBLIC __Vectors_Size - - DATA - -__iar_init$$done: ; The vector table is not needed - ; until after copy initialization is done - -__vector_table - DCD sfe(CSTACK) - DCD Reset_Handler - - DCD NMI_Handler ;NMI Handler - DCD HardFault_Handler ;Hard Fault Handler - DCD 0 ;Reserved - DCD 0 ;Reserved - DCD 0 ;Reserved -__vector_table_0x1c - DCD 0 ;Reserved - DCD 0 ;Reserved - DCD 0 ;Reserved - DCD 0 ;Reserved - DCD SVC_Handler ;SVCall Handler - DCD 0 ;Reserved - DCD 0 ;Reserved - DCD PendSV_Handler ;PendSV Handler - DCD SysTick_Handler ;SysTick Handler - - ;External Interrupts - DCD DMA0_IRQHandler ;DMA channel 0 transfer complete - DCD DMA1_IRQHandler ;DMA channel 1 transfer complete - DCD DMA2_IRQHandler ;DMA channel 2 transfer complete - DCD DMA3_IRQHandler ;DMA channel 3 transfer complete - DCD Reserved20_IRQHandler ;Reserved interrupt - DCD FTFA_IRQHandler ;Command complete and read collision - DCD PMC_IRQHandler ;Low-voltage detect, low-voltage warning - DCD LLWU_IRQHandler ;Low leakage wakeup - DCD I2C0_IRQHandler ;I2C0 interrupt - DCD I2C1_IRQHandler ;I2C1 interrupt - DCD SPI0_IRQHandler ;SPI0 single interrupt vector for all sources - DCD SPI1_IRQHandler ;SPI1 single interrupt vector for all sources - DCD LPUART0_IRQHandler ;LPUART0 status and error - DCD LPUART1_IRQHandler ;LPUART1 status and error - DCD UART2_FLEXIO_IRQHandler ;UART2 or FLEXIO - DCD ADC0_IRQHandler ;ADC0 interrupt - DCD CMP0_IRQHandler ;CMP0 interrupt - DCD TPM0_IRQHandler ;TPM0 single interrupt vector for all sources - DCD TPM1_IRQHandler ;TPM1 single interrupt vector for all sources - DCD TPM2_IRQHandler ;TPM2 single interrupt vector for all sources - DCD RTC_IRQHandler ;RTC alarm - DCD RTC_Seconds_IRQHandler ;RTC seconds - DCD PIT_IRQHandler ;PIT interrupt - DCD I2S0_IRQHandler ;I2S0 interrupt - DCD USB0_IRQHandler ;USB0 interrupt - DCD DAC0_IRQHandler ;DAC0 interrupt - DCD Reserved42_IRQHandler ;Reserved interrupt - DCD Reserved43_IRQHandler ;Reserved interrupt - DCD LPTMR0_IRQHandler ;LPTMR0 interrupt - DCD LCD_IRQHandler ;LCD interrupt - DCD PORTA_IRQHandler ;PORTA Pin detect - DCD PORTC_PORTD_IRQHandler ;Single interrupt vector for PORTC; PORTD Pin detect -__Vectors_End - - SECTION FlashConfig:CODE -__FlashConfig - DCD 0xFFFFFFFF - DCD 0xFFFFFFFF - DCD 0xFFFFFFFF - DCD 0xFFFF3FFE -__FlashConfig_End - -__Vectors EQU __vector_table -__Vectors_Size EQU __Vectors_End - __Vectors - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Default interrupt handlers. -;; - THUMB - - PUBWEAK Reset_Handler - SECTION .text:CODE:REORDER:NOROOT(2) -Reset_Handler - CPSID I ; Mask interrupts - LDR R0, =0xE000ED08 - LDR R1, =__vector_table - STR R1, [R0] - LDR R2, [R1] - MSR MSP, R2 - LDR R0, =SystemInit - BLX R0 - CPSIE I ; Unmask interrupts - LDR R0, =__iar_program_start - BX R0 - - PUBWEAK NMI_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -NMI_Handler - B . - - PUBWEAK HardFault_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -HardFault_Handler - B . - - PUBWEAK SVC_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -SVC_Handler - B . - - PUBWEAK PendSV_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -PendSV_Handler - B . - - PUBWEAK SysTick_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -SysTick_Handler - B . - - PUBWEAK DMA0_IRQHandler - PUBWEAK DMA0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -DMA0_IRQHandler - LDR R0, =DMA0_DriverIRQHandler - BX R0 - - PUBWEAK DMA1_IRQHandler - PUBWEAK DMA1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -DMA1_IRQHandler - LDR R0, =DMA1_DriverIRQHandler - BX R0 - - PUBWEAK DMA2_IRQHandler - PUBWEAK DMA2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -DMA2_IRQHandler - LDR R0, =DMA2_DriverIRQHandler - BX R0 - - PUBWEAK DMA3_IRQHandler - PUBWEAK DMA3_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -DMA3_IRQHandler - LDR R0, =DMA3_DriverIRQHandler - BX R0 - - PUBWEAK Reserved20_IRQHandler - PUBWEAK FTFA_IRQHandler - PUBWEAK PMC_IRQHandler - PUBWEAK LLWU_IRQHandler - PUBWEAK I2C0_IRQHandler - PUBWEAK I2C0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -I2C0_IRQHandler - LDR R0, =I2C0_DriverIRQHandler - BX R0 - - PUBWEAK I2C1_IRQHandler - PUBWEAK I2C1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -I2C1_IRQHandler - LDR R0, =I2C1_DriverIRQHandler - BX R0 - - PUBWEAK SPI0_IRQHandler - PUBWEAK SPI0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SPI0_IRQHandler - LDR R0, =SPI0_DriverIRQHandler - BX R0 - - PUBWEAK SPI1_IRQHandler - PUBWEAK SPI1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SPI1_IRQHandler - LDR R0, =SPI1_DriverIRQHandler - BX R0 - - PUBWEAK LPUART0_IRQHandler - PUBWEAK LPUART0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LPUART0_IRQHandler - LDR R0, =LPUART0_DriverIRQHandler - BX R0 - - PUBWEAK LPUART1_IRQHandler - PUBWEAK LPUART1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LPUART1_IRQHandler - LDR R0, =LPUART1_DriverIRQHandler - BX R0 - - PUBWEAK UART2_FLEXIO_IRQHandler - PUBWEAK UART2_FLEXIO_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -UART2_FLEXIO_IRQHandler - LDR R0, =UART2_FLEXIO_DriverIRQHandler - BX R0 - - PUBWEAK ADC0_IRQHandler - PUBWEAK CMP0_IRQHandler - PUBWEAK TPM0_IRQHandler - PUBWEAK TPM1_IRQHandler - PUBWEAK TPM2_IRQHandler - PUBWEAK RTC_IRQHandler - PUBWEAK RTC_Seconds_IRQHandler - PUBWEAK PIT_IRQHandler - PUBWEAK I2S0_IRQHandler - PUBWEAK I2S0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -I2S0_IRQHandler - LDR R0, =I2S0_DriverIRQHandler - BX R0 - - PUBWEAK USB0_IRQHandler - PUBWEAK DAC0_IRQHandler - PUBWEAK Reserved42_IRQHandler - PUBWEAK Reserved43_IRQHandler - PUBWEAK LPTMR0_IRQHandler - PUBWEAK LCD_IRQHandler - PUBWEAK PORTA_IRQHandler - PUBWEAK PORTC_PORTD_IRQHandler - PUBWEAK DefaultISR - SECTION .text:CODE:REORDER:NOROOT(2) -DMA0_DriverIRQHandler -DMA1_DriverIRQHandler -DMA2_DriverIRQHandler -DMA3_DriverIRQHandler -Reserved20_IRQHandler -FTFA_IRQHandler -PMC_IRQHandler -LLWU_IRQHandler -I2C0_DriverIRQHandler -I2C1_DriverIRQHandler -SPI0_DriverIRQHandler -SPI1_DriverIRQHandler -LPUART0_DriverIRQHandler -LPUART1_DriverIRQHandler -UART2_FLEXIO_DriverIRQHandler -ADC0_IRQHandler -CMP0_IRQHandler -TPM0_IRQHandler -TPM1_IRQHandler -TPM2_IRQHandler -RTC_IRQHandler -RTC_Seconds_IRQHandler -PIT_IRQHandler -I2S0_DriverIRQHandler -USB0_IRQHandler -DAC0_IRQHandler -Reserved42_IRQHandler -Reserved43_IRQHandler -LPTMR0_IRQHandler -LCD_IRQHandler -PORTA_IRQHandler -PORTC_PORTD_IRQHandler -DefaultISR - LDR R0, =DefaultISR - BX R0 - - END diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/system_MCXC444.c b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/system_MCXC444.c deleted file mode 100644 index 98dc64d9d39..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/system_MCXC444.c +++ /dev/null @@ -1,109 +0,0 @@ -/* -** ################################################################### -** Processors: MCXC444VLH -** MCXC444VMP -** -** Compilers: Freescale C/C++ for Embedded ARM -** GNU C Compiler -** IAR ANSI C/C++ Compiler for ARM -** Keil ARM C/C++ Compiler -** MCUXpresso Compiler -** -** Reference manual: MCXC444RM, Rev.1, Mar 2024 -** Version: rev. 1.0, 2024-03-11 -** Build: b240401 -** -** 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-2024 NXP -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** Revisions: -** - rev. 1.0 (2024-03-11) -** Initial version. -** -** ################################################################### -*/ - -/*! - * @file MCXC444 - * @version 1.0 - * @date 2024-03-11 - * @brief Device specific configuration file for MCXC444 (implementation file) - * - * 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. - */ - -#include -#include "fsl_device_registers.h" - - - -/* ---------------------------------------------------------------------------- - -- Core clock - ---------------------------------------------------------------------------- */ - -uint32_t SystemCoreClock = DEFAULT_SYSTEM_CLOCK; - -/* ---------------------------------------------------------------------------- - -- SystemInit() - ---------------------------------------------------------------------------- */ - -void SystemInit (void) { - -#if (ACK_ISOLATION) - if((PMC->REGSC & PMC_REGSC_ACKISO_MASK) != 0U) { - PMC->REGSC |= PMC_REGSC_ACKISO_MASK; /* VLLSx recovery */ - } -#endif - -#if (DISABLE_WDOG) - /* SIM->COPC: ?=0,COPCLKSEL=0,COPDBGEN=0,COPSTPEN=0,COPT=0,COPCLKS=0,COPW=0 */ - SIM->COPC = (uint32_t)0x00U; -#endif /* (DISABLE_WDOG) */ - - SystemInitHook(); -} - -/* ---------------------------------------------------------------------------- - -- SystemCoreClockUpdate() - ---------------------------------------------------------------------------- */ - -void SystemCoreClockUpdate (void) { - - uint32_t MCGOUTClock; /* Variable to store output clock frequency of the MCG module */ - uint16_t Divider; - - if ((MCG->S & MCG_S_CLKST_MASK) == 0x00U) { - /* High internal reference clock is selected */ - MCGOUTClock = CPU_INT_FAST_CLK_HZ; /* Fast internal reference clock selected */ - } else if ((MCG->S & MCG_S_CLKST_MASK) == 0x04U) { - /* Internal reference clock is selected */ - Divider = (uint16_t)(0x01LU << ((MCG->SC & MCG_SC_FCRDIV_MASK) >> MCG_SC_FCRDIV_SHIFT)); - MCGOUTClock = (uint32_t) (CPU_INT_SLOW_CLK_HZ / Divider); /* Slow internal reference clock 8MHz selected */ - } else if ((MCG->S & MCG_S_CLKST_MASK) == 0x08U) { - /* External reference clock is selected */ - MCGOUTClock = CPU_XTAL_CLK_HZ; - } else { - /* Reserved value */ - return; - } /* (!((MCG->S & MCG_S_CLKST_MASK) == 0x08U)) */ - SystemCoreClock = (MCGOUTClock / (0x01U + ((SIM->CLKDIV1 & SIM_CLKDIV1_OUTDIV1_MASK) >> SIM_CLKDIV1_OUTDIV1_SHIFT))); -} - -/* ---------------------------------------------------------------------------- - -- SystemInitHook() - ---------------------------------------------------------------------------- */ - -__attribute__ ((weak)) void SystemInitHook (void) { - /* Void implementation of the weak function. */ -} diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/system_MCXC444.h b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/system_MCXC444.h deleted file mode 100644 index d7ecec039b6..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/MCXC444/system_MCXC444.h +++ /dev/null @@ -1,121 +0,0 @@ -/* -** ################################################################### -** Processors: MCXC444VLH -** MCXC444VMP -** -** Compilers: Freescale C/C++ for Embedded ARM -** GNU C Compiler -** IAR ANSI C/C++ Compiler for ARM -** Keil ARM C/C++ Compiler -** MCUXpresso Compiler -** -** Reference manual: MCXC444RM, Rev.1, Mar 2024 -** Version: rev. 1.0, 2024-03-11 -** Build: b240401 -** -** 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-2024 NXP -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** Revisions: -** - rev. 1.0 (2024-03-11) -** Initial version. -** -** ################################################################### -*/ - -/*! - * @file MCXC444 - * @version 1.0 - * @date 2024-03-11 - * @brief Device specific configuration file for MCXC444 (header file) - * - * 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. - */ - -#ifndef _SYSTEM_MCXC444_H_ -#define _SYSTEM_MCXC444_H_ /**< Symbol preventing repeated inclusion */ - -#ifdef __cplusplus -extern "C" { -#endif - -#include - - -#ifndef DISABLE_WDOG - #define DISABLE_WDOG 1 -#endif - -#define ACK_ISOLATION 1 - -/* Define clock source values */ -#define CPU_XTAL_CLK_HZ 32768U /* Value of the external crystal or oscillator clock frequency in Hz */ -#define CPU_INT_FAST_CLK_HZ 48000000U /* Value of the fast internal oscillator clock frequency in Hz */ -#define CPU_INT_IRC_CLK_HZ 48000000U /* Value of the 48M internal oscillator clock frequency in Hz */ - -/* Low power mode enable */ -/* SMC_PMPROT: AVLP=1,AVLLS=1 */ -#define SYSTEM_SMC_PMPROT_VALUE 0x2AU /* SMC_PMPROT */ - -#define DEFAULT_SYSTEM_CLOCK 8000000U /* Default System clock value */ -#define CPU_INT_SLOW_CLK_HZ 8000000U /* Value of the slow internal oscillator clock frequency in Hz */ - - - -/** - * @brief System clock frequency (core clock) - * - * The system clock frequency supplied to the SysTick timer and the processor - * core clock. This variable can be used by the user application to setup the - * SysTick timer or configure other parameters. It may also be used by debugger to - * query the frequency of the debug timer or configure the trace clock speed - * SystemCoreClock is initialized with a correct predefined value. - */ -extern uint32_t SystemCoreClock; - -/** - * @brief Setup the microcontroller system. - * - * Typically this function configures the oscillator (PLL) that is part of the - * microcontroller device. For systems with variable clock speed it also updates - * the variable SystemCoreClock. SystemInit is called from startup_device file. - */ -void SystemInit (void); - -/** - * @brief Updates the SystemCoreClock variable. - * - * It must be called whenever the core clock is changed during program - * execution. SystemCoreClockUpdate() evaluates the clock register settings and calculates - * the current core clock. - */ -void SystemCoreClockUpdate (void); - -/** - * @brief SystemInit function hook. - * - * This weak function allows to call specific initialization code during the - * SystemInit() execution.This can be used when an application specific code needs - * to be called as close to the reset entry as possible (for example the Multicore - * Manager MCMGR_EarlyInit() function call). - * NOTE: No global r/w variables can be used in this hook function because the - * initialization of these variables happens after this function. - */ -void SystemInitHook (void); - -#ifdef __cplusplus -} -#endif - -#endif /* _SYSTEM_MCXC444_H_ */ diff --git a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/SConscript b/bsp/nxp/mcx/mcxc/Libraries/MCXC444/SConscript deleted file mode 100644 index 793dcde045f..00000000000 --- a/bsp/nxp/mcx/mcxc/Libraries/MCXC444/SConscript +++ /dev/null @@ -1,48 +0,0 @@ -Import('rtconfig') -from building import * - -cwd = GetCurrentDir() -path = [cwd + '/../CMSIS/Core/Include', cwd + '/MCXC444', cwd + '/MCXC444/drivers'] -src = Split(''' - MCXC444/system_MCXC444.c - ''') - -if rtconfig.PLATFORM in ['gcc']: - src += ['MCXC444/gcc/startup_MCXC444.S'] -elif rtconfig.PLATFORM in ['armcc', 'armclang']: - src += ['MCXC444/arm/startup_MCXC444.s'] -elif rtconfig.PLATFORM in ['iccarm']: - src += ['MCXC444/iar/startup_MCXC444.s'] - -src += ['MCXC444/drivers/fsl_adc16.c'] -src += ['MCXC444/drivers/fsl_clock.c'] -src += ['MCXC444/drivers/fsl_cmp.c'] -src += ['MCXC444/drivers/fsl_common.c'] -src += ['MCXC444/drivers/fsl_common_arm.c'] -src += ['MCXC444/drivers/fsl_cop.c'] -src += ['MCXC444/drivers/fsl_dac.c'] -src += ['MCXC444/drivers/fsl_dma.c'] -src += ['MCXC444/drivers/fsl_ftfx_controller.c'] -src += ['MCXC444/drivers/fsl_ftfx_flexnvm.c'] -src += ['MCXC444/drivers/fsl_gpio.c'] -src += ['MCXC444/drivers/fsl_i2c.c'] -src += ['MCXC444/drivers/fsl_i2c_dma.c'] -src += ['MCXC444/drivers/fsl_lpuart.c'] -src += ['MCXC444/drivers/fsl_lpuart_dma.c'] -src += ['MCXC444/drivers/fsl_pit.c'] -src += ['MCXC444/drivers/fsl_pmc.c'] -src += ['MCXC444/drivers/fsl_rtc.c'] -src += ['MCXC444/drivers/fsl_sai.c'] -src += ['MCXC444/drivers/fsl_sai_dma.c'] -src += ['MCXC444/drivers/fsl_sim.c'] -src += ['MCXC444/drivers/fsl_slcd.c'] -src += ['MCXC444/drivers/fsl_smc.c'] -src += ['MCXC444/drivers/fsl_spi.c'] -src += ['MCXC444/drivers/fsl_tpm.c'] -src += ['MCXC444/drivers/fsl_uart.c'] -src += ['MCXC444/drivers/fsl_uart_dma.c'] - - -group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path) - -Return('group') diff --git a/bsp/nxp/mcx/mcxc/frdm-mcxc444/README_EN.md b/bsp/nxp/mcx/mcxc/frdm-mcxc444/README_EN.md index e2c6971be9f..71b106a27ef 100644 --- a/bsp/nxp/mcx/mcxc/frdm-mcxc444/README_EN.md +++ b/bsp/nxp/mcx/mcxc/frdm-mcxc444/README_EN.md @@ -44,6 +44,14 @@ To run sample programs on the FRDM-MCXC444 board, you need to make the following ### Compile and Download +**Please note!!!** + +Before performing the compilation process, please first open the ENV and execute the following command (this command is used to pull the necessary libraries; otherwise, the compilation will not be successful): + +```bash +pkgs --update +``` + 1. Navigate to the `rt-thread\bsp\nxp\mcxc\frdm-mcxc444` folder. 2. Open the project file in Keil. 3. Compile the project. diff --git a/bsp/nxp/mcx/mcxc/frdm-mcxc444/SConstruct b/bsp/nxp/mcx/mcxc/frdm-mcxc444/SConstruct index ed0bfe11ffd..6e65952c0eb 100644 --- a/bsp/nxp/mcx/mcxc/frdm-mcxc444/SConstruct +++ b/bsp/nxp/mcx/mcxc/frdm-mcxc444/SConstruct @@ -15,6 +15,24 @@ except: print(RTT_ROOT) exit(-1) +def bsp_pkg_check(): + import subprocess + + check_paths = [ + os.path.join("packages", "nxp-mcx-cmsis-latest"), + os.path.join("packages", "nxp-mcx-series-latest"), + ] + + need_update = not all(os.path.exists(p) for p in check_paths) + + if need_update: + print("\n==============================================================") + print("Dependency packages missing, please running 'pkgs --update'...") + print("==============================================================") + exit(1) + +RegisterPreBuildingAction(bsp_pkg_check) + TARGET = 'rtthread.' + rtconfig.TARGET_EXT if rtconfig.PLATFORM == 'armcc': @@ -60,8 +78,5 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) objs.extend(SConscript(os.path.join(libraries_path_prefix, 'drivers', 'SConscript'))) -# include cmsis -objs.extend(SConscript(os.path.join(libraries_path_prefix, rtconfig.BSP_LIBRARY_TYPE, 'SConscript'))) - # make a building DoBuilding(TARGET, objs) diff --git a/bsp/nxp/mcx/mcxn/Libraries/CMSIS/Core/Include/cmsis_armclang.h b/bsp/nxp/mcx/mcxn/Libraries/CMSIS/Core/Include/cmsis_armclang.h deleted file mode 100644 index 69114177477..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/CMSIS/Core/Include/cmsis_armclang.h +++ /dev/null @@ -1,1503 +0,0 @@ -/**************************************************************************//** - * @file cmsis_armclang.h - * @brief CMSIS compiler armclang (Arm Compiler 6) header file - * @version V5.4.3 - * @date 27. May 2021 - ******************************************************************************/ -/* - * Copyright (c) 2009-2021 Arm Limited. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - * - * 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. - */ - -/*lint -esym(9058, IRQn)*/ /* disable MISRA 2012 Rule 2.4 for IRQn */ - -#ifndef __CMSIS_ARMCLANG_H -#define __CMSIS_ARMCLANG_H - -#pragma clang system_header /* treat file as system include file */ - -/* CMSIS compiler specific defines */ -#ifndef __ASM - #define __ASM __asm -#endif -#ifndef __INLINE - #define __INLINE __inline -#endif -#ifndef __STATIC_INLINE - #define __STATIC_INLINE static __inline -#endif -#ifndef __STATIC_FORCEINLINE - #define __STATIC_FORCEINLINE __attribute__((always_inline)) static __inline -#endif -#ifndef __NO_RETURN - #define __NO_RETURN __attribute__((__noreturn__)) -#endif -#ifndef __USED - #define __USED __attribute__((used)) -#endif -#ifndef __WEAK - #define __WEAK __attribute__((weak)) -#endif -#ifndef __PACKED - #define __PACKED __attribute__((packed, aligned(1))) -#endif -#ifndef __PACKED_STRUCT - #define __PACKED_STRUCT struct __attribute__((packed, aligned(1))) -#endif -#ifndef __PACKED_UNION - #define __PACKED_UNION union __attribute__((packed, aligned(1))) -#endif -#ifndef __UNALIGNED_UINT32 /* deprecated */ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpacked" -/*lint -esym(9058, T_UINT32)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32 */ - struct __attribute__((packed)) T_UINT32 { uint32_t v; }; - #pragma clang diagnostic pop - #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) -#endif -#ifndef __UNALIGNED_UINT16_WRITE - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpacked" -/*lint -esym(9058, T_UINT16_WRITE)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT16_WRITE */ - __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; - #pragma clang diagnostic pop - #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) -#endif -#ifndef __UNALIGNED_UINT16_READ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpacked" -/*lint -esym(9058, T_UINT16_READ)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT16_READ */ - __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; - #pragma clang diagnostic pop - #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) -#endif -#ifndef __UNALIGNED_UINT32_WRITE - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpacked" -/*lint -esym(9058, T_UINT32_WRITE)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32_WRITE */ - __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; - #pragma clang diagnostic pop - #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) -#endif -#ifndef __UNALIGNED_UINT32_READ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpacked" -/*lint -esym(9058, T_UINT32_READ)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32_READ */ - __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; - #pragma clang diagnostic pop - #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) -#endif -#ifndef __ALIGNED - #define __ALIGNED(x) __attribute__((aligned(x))) -#endif -#ifndef __RESTRICT - #define __RESTRICT __restrict -#endif -#ifndef __COMPILER_BARRIER - #define __COMPILER_BARRIER() __ASM volatile("":::"memory") -#endif - -/* ######################### Startup and Lowlevel Init ######################## */ - -#ifndef __PROGRAM_START -#define __PROGRAM_START __main -#endif - -#ifndef __INITIAL_SP -#define __INITIAL_SP Image$$ARM_LIB_STACK$$ZI$$Limit -#endif - -#ifndef __STACK_LIMIT -#define __STACK_LIMIT Image$$ARM_LIB_STACK$$ZI$$Base -#endif - -#ifndef __VECTOR_TABLE -#define __VECTOR_TABLE __Vectors -#endif - -#ifndef __VECTOR_TABLE_ATTRIBUTE -#define __VECTOR_TABLE_ATTRIBUTE __attribute__((used, section("RESET"))) -#endif - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) -#ifndef __STACK_SEAL -#define __STACK_SEAL Image$$STACKSEAL$$ZI$$Base -#endif - -#ifndef __TZ_STACK_SEAL_SIZE -#define __TZ_STACK_SEAL_SIZE 8U -#endif - -#ifndef __TZ_STACK_SEAL_VALUE -#define __TZ_STACK_SEAL_VALUE 0xFEF5EDA5FEF5EDA5ULL -#endif - - -__STATIC_FORCEINLINE void __TZ_set_STACKSEAL_S (uint32_t* stackTop) { - *((uint64_t *)stackTop) = __TZ_STACK_SEAL_VALUE; -} -#endif - - -/* ########################## Core Instruction Access ######################### */ -/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface - Access to dedicated instructions - @{ -*/ - -/* Define macros for porting to both thumb1 and thumb2. - * For thumb1, use low register (r0-r7), specified by constraint "l" - * Otherwise, use general registers, specified by constraint "r" */ -#if defined (__thumb__) && !defined (__thumb2__) -#define __CMSIS_GCC_OUT_REG(r) "=l" (r) -#define __CMSIS_GCC_RW_REG(r) "+l" (r) -#define __CMSIS_GCC_USE_REG(r) "l" (r) -#else -#define __CMSIS_GCC_OUT_REG(r) "=r" (r) -#define __CMSIS_GCC_RW_REG(r) "+r" (r) -#define __CMSIS_GCC_USE_REG(r) "r" (r) -#endif - -/** - \brief No Operation - \details No Operation does nothing. This instruction can be used for code alignment purposes. - */ -#define __NOP __builtin_arm_nop - -/** - \brief Wait For Interrupt - \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. - */ -#define __WFI __builtin_arm_wfi - - -/** - \brief Wait For Event - \details Wait For Event is a hint instruction that permits the processor to enter - a low-power state until one of a number of events occurs. - */ -#define __WFE __builtin_arm_wfe - - -/** - \brief Send Event - \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. - */ -#define __SEV __builtin_arm_sev - - -/** - \brief Instruction Synchronization Barrier - \details Instruction Synchronization Barrier flushes the pipeline in the processor, - so that all instructions following the ISB are fetched from cache or memory, - after the instruction has been completed. - */ -#define __ISB() __builtin_arm_isb(0xF) - -/** - \brief Data Synchronization Barrier - \details Acts as a special kind of Data Memory Barrier. - It completes when all explicit memory accesses before this instruction complete. - */ -#define __DSB() __builtin_arm_dsb(0xF) - - -/** - \brief Data Memory Barrier - \details Ensures the apparent order of the explicit memory operations before - and after the instruction, without ensuring their completion. - */ -#define __DMB() __builtin_arm_dmb(0xF) - - -/** - \brief Reverse byte order (32 bit) - \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV(value) __builtin_bswap32(value) - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV16(value) __ROR(__REV(value), 16) - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REVSH(value) (int16_t)__builtin_bswap16(value) - - -/** - \brief Rotate Right in unsigned value (32 bit) - \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. - \param [in] op1 Value to rotate - \param [in] op2 Number of Bits to rotate - \return Rotated value - */ -__STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2) -{ - op2 %= 32U; - if (op2 == 0U) - { - return op1; - } - return (op1 >> op2) | (op1 << (32U - op2)); -} - - -/** - \brief Breakpoint - \details Causes the processor to enter Debug state. - Debug tools can use this to investigate system state when the instruction at a particular address is reached. - \param [in] value is ignored by the processor. - If required, a debugger can use it to store additional information about the breakpoint. - */ -#define __BKPT(value) __ASM volatile ("bkpt "#value) - - -/** - \brief Reverse bit order of value - \details Reverses the bit order of the given value. - \param [in] value Value to reverse - \return Reversed value - */ -#define __RBIT __builtin_arm_rbit - -/** - \brief Count leading zeros - \details Counts the number of leading zeros of a data value. - \param [in] value Value to count the leading zeros - \return number of leading zeros in value - */ -__STATIC_FORCEINLINE uint8_t __CLZ(uint32_t value) -{ - /* Even though __builtin_clz produces a CLZ instruction on ARM, formally - __builtin_clz(0) is undefined behaviour, so handle this case specially. - This guarantees ARM-compatible results if happening to compile on a non-ARM - target, and ensures the compiler doesn't decide to activate any - optimisations using the logic "value was passed to __builtin_clz, so it - is non-zero". - ARM Compiler 6.10 and possibly earlier will optimise this test away, leaving a - single CLZ instruction. - */ - if (value == 0U) - { - return 32U; - } - return __builtin_clz(value); -} - - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) - -/** - \brief LDR Exclusive (8 bit) - \details Executes a exclusive LDR instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -#define __LDREXB (uint8_t)__builtin_arm_ldrex - - -/** - \brief LDR Exclusive (16 bit) - \details Executes a exclusive LDR instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -#define __LDREXH (uint16_t)__builtin_arm_ldrex - - -/** - \brief LDR Exclusive (32 bit) - \details Executes a exclusive LDR instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -#define __LDREXW (uint32_t)__builtin_arm_ldrex - - -/** - \brief STR Exclusive (8 bit) - \details Executes a exclusive STR instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STREXB (uint32_t)__builtin_arm_strex - - -/** - \brief STR Exclusive (16 bit) - \details Executes a exclusive STR instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STREXH (uint32_t)__builtin_arm_strex - - -/** - \brief STR Exclusive (32 bit) - \details Executes a exclusive STR instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STREXW (uint32_t)__builtin_arm_strex - - -/** - \brief Remove the exclusive lock - \details Removes the exclusive lock which is created by LDREX. - */ -#define __CLREX __builtin_arm_clrex - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) - -/** - \brief Signed Saturate - \details Saturates a signed value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (1..32) - \return Saturated value - */ -#define __SSAT __builtin_arm_ssat - - -/** - \brief Unsigned Saturate - \details Saturates an unsigned value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value - */ -#define __USAT __builtin_arm_usat - - -/** - \brief Rotate Right with Extend (32 bit) - \details Moves each bit of a bitstring right by one bit. - The carry input is shifted in at the left end of the bitstring. - \param [in] value Value to rotate - \return Rotated value - */ -__STATIC_FORCEINLINE uint32_t __RRX(uint32_t value) -{ - uint32_t result; - - __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return(result); -} - - -/** - \brief LDRT Unprivileged (8 bit) - \details Executes a Unprivileged LDRT instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -__STATIC_FORCEINLINE uint8_t __LDRBT(volatile uint8_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) ); - return ((uint8_t) result); /* Add explicit type cast here */ -} - - -/** - \brief LDRT Unprivileged (16 bit) - \details Executes a Unprivileged LDRT instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -__STATIC_FORCEINLINE uint16_t __LDRHT(volatile uint16_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) ); - return ((uint16_t) result); /* Add explicit type cast here */ -} - - -/** - \brief LDRT Unprivileged (32 bit) - \details Executes a Unprivileged LDRT instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -__STATIC_FORCEINLINE uint32_t __LDRT(volatile uint32_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*ptr) ); - return(result); -} - - -/** - \brief STRT Unprivileged (8 bit) - \details Executes a Unprivileged STRT instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STRBT(uint8_t value, volatile uint8_t *ptr) -{ - __ASM volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); -} - - -/** - \brief STRT Unprivileged (16 bit) - \details Executes a Unprivileged STRT instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STRHT(uint16_t value, volatile uint16_t *ptr) -{ - __ASM volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); -} - - -/** - \brief STRT Unprivileged (32 bit) - \details Executes a Unprivileged STRT instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STRT(uint32_t value, volatile uint32_t *ptr) -{ - __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) ); -} - -#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) */ - -/** - \brief Signed Saturate - \details Saturates a signed value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (1..32) - \return Saturated value - */ -__STATIC_FORCEINLINE int32_t __SSAT(int32_t val, uint32_t sat) -{ - if ((sat >= 1U) && (sat <= 32U)) - { - const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); - const int32_t min = -1 - max ; - if (val > max) - { - return max; - } - else if (val < min) - { - return min; - } - } - return val; -} - -/** - \brief Unsigned Saturate - \details Saturates an unsigned value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value - */ -__STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat) -{ - if (sat <= 31U) - { - const uint32_t max = ((1U << sat) - 1U); - if (val > (int32_t)max) - { - return max; - } - else if (val < 0) - { - return 0U; - } - } - return (uint32_t)val; -} - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) - -/** - \brief Load-Acquire (8 bit) - \details Executes a LDAB instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -__STATIC_FORCEINLINE uint8_t __LDAB(volatile uint8_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldab %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint8_t) result); -} - - -/** - \brief Load-Acquire (16 bit) - \details Executes a LDAH instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -__STATIC_FORCEINLINE uint16_t __LDAH(volatile uint16_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldah %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint16_t) result); -} - - -/** - \brief Load-Acquire (32 bit) - \details Executes a LDA instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -__STATIC_FORCEINLINE uint32_t __LDA(volatile uint32_t *ptr) -{ - uint32_t result; - - __ASM volatile ("lda %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return(result); -} - - -/** - \brief Store-Release (8 bit) - \details Executes a STLB instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STLB(uint8_t value, volatile uint8_t *ptr) -{ - __ASM volatile ("stlb %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); -} - - -/** - \brief Store-Release (16 bit) - \details Executes a STLH instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STLH(uint16_t value, volatile uint16_t *ptr) -{ - __ASM volatile ("stlh %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); -} - - -/** - \brief Store-Release (32 bit) - \details Executes a STL instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STL(uint32_t value, volatile uint32_t *ptr) -{ - __ASM volatile ("stl %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); -} - - -/** - \brief Load-Acquire Exclusive (8 bit) - \details Executes a LDAB exclusive instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -#define __LDAEXB (uint8_t)__builtin_arm_ldaex - - -/** - \brief Load-Acquire Exclusive (16 bit) - \details Executes a LDAH exclusive instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -#define __LDAEXH (uint16_t)__builtin_arm_ldaex - - -/** - \brief Load-Acquire Exclusive (32 bit) - \details Executes a LDA exclusive instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -#define __LDAEX (uint32_t)__builtin_arm_ldaex - - -/** - \brief Store-Release Exclusive (8 bit) - \details Executes a STLB exclusive instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STLEXB (uint32_t)__builtin_arm_stlex - - -/** - \brief Store-Release Exclusive (16 bit) - \details Executes a STLH exclusive instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STLEXH (uint32_t)__builtin_arm_stlex - - -/** - \brief Store-Release Exclusive (32 bit) - \details Executes a STL exclusive instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STLEX (uint32_t)__builtin_arm_stlex - -#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) */ - -/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ - - -/* ########################### Core Function Access ########################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions - @{ - */ - -/** - \brief Enable IRQ Interrupts - \details Enables IRQ interrupts by clearing special-purpose register PRIMASK. - Can only be executed in Privileged modes. - */ -#ifndef __ARM_COMPAT_H -__STATIC_FORCEINLINE void __enable_irq(void) -{ - __ASM volatile ("cpsie i" : : : "memory"); -} -#endif - - -/** - \brief Disable IRQ Interrupts - \details Disables IRQ interrupts by setting special-purpose register PRIMASK. - Can only be executed in Privileged modes. - */ -#ifndef __ARM_COMPAT_H -__STATIC_FORCEINLINE void __disable_irq(void) -{ - __ASM volatile ("cpsid i" : : : "memory"); -} -#endif - - -/** - \brief Get Control Register - \details Returns the content of the Control Register. - \return Control Register value - */ -__STATIC_FORCEINLINE uint32_t __get_CONTROL(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, control" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Control Register (non-secure) - \details Returns the content of the non-secure Control Register when in secure mode. - \return non-secure Control Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_CONTROL_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, control_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Control Register - \details Writes the given value to the Control Register. - \param [in] control Control Register value to set - */ -__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control) -{ - __ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); - __ISB(); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Control Register (non-secure) - \details Writes the given value to the non-secure Control Register when in secure state. - \param [in] control Control Register value to set - */ -__STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control) -{ - __ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory"); - __ISB(); -} -#endif - - -/** - \brief Get IPSR Register - \details Returns the content of the IPSR Register. - \return IPSR Register value - */ -__STATIC_FORCEINLINE uint32_t __get_IPSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, ipsr" : "=r" (result) ); - return(result); -} - - -/** - \brief Get APSR Register - \details Returns the content of the APSR Register. - \return APSR Register value - */ -__STATIC_FORCEINLINE uint32_t __get_APSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, apsr" : "=r" (result) ); - return(result); -} - - -/** - \brief Get xPSR Register - \details Returns the content of the xPSR Register. - \return xPSR Register value - */ -__STATIC_FORCEINLINE uint32_t __get_xPSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, xpsr" : "=r" (result) ); - return(result); -} - - -/** - \brief Get Process Stack Pointer - \details Returns the current value of the Process Stack Pointer (PSP). - \return PSP Register value - */ -__STATIC_FORCEINLINE uint32_t __get_PSP(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, psp" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Process Stack Pointer (non-secure) - \details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state. - \return PSP Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PSP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, psp_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Process Stack Pointer - \details Assigns the given value to the Process Stack Pointer (PSP). - \param [in] topOfProcStack Process Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack) -{ - __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : ); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Process Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state. - \param [in] topOfProcStack Process Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack) -{ - __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : ); -} -#endif - - -/** - \brief Get Main Stack Pointer - \details Returns the current value of the Main Stack Pointer (MSP). - \return MSP Register value - */ -__STATIC_FORCEINLINE uint32_t __get_MSP(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, msp" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Main Stack Pointer (non-secure) - \details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state. - \return MSP Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_MSP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, msp_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Main Stack Pointer - \details Assigns the given value to the Main Stack Pointer (MSP). - \param [in] topOfMainStack Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack) -{ - __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : ); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Main Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state. - \param [in] topOfMainStack Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack) -{ - __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : ); -} -#endif - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Stack Pointer (non-secure) - \details Returns the current value of the non-secure Stack Pointer (SP) when in secure state. - \return SP Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_SP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, sp_ns" : "=r" (result) ); - return(result); -} - - -/** - \brief Set Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Stack Pointer (SP) when in secure state. - \param [in] topOfStack Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_SP_NS(uint32_t topOfStack) -{ - __ASM volatile ("MSR sp_ns, %0" : : "r" (topOfStack) : ); -} -#endif - - -/** - \brief Get Priority Mask - \details Returns the current state of the priority mask bit from the Priority Mask Register. - \return Priority Mask value - */ -__STATIC_FORCEINLINE uint32_t __get_PRIMASK(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, primask" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Priority Mask (non-secure) - \details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state. - \return Priority Mask value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PRIMASK_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, primask_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Priority Mask - \details Assigns the given value to the Priority Mask Register. - \param [in] priMask Priority Mask - */ -__STATIC_FORCEINLINE void __set_PRIMASK(uint32_t priMask) -{ - __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Priority Mask (non-secure) - \details Assigns the given value to the non-secure Priority Mask Register when in secure state. - \param [in] priMask Priority Mask - */ -__STATIC_FORCEINLINE void __TZ_set_PRIMASK_NS(uint32_t priMask) -{ - __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory"); -} -#endif - - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) -/** - \brief Enable FIQ - \details Enables FIQ interrupts by clearing special-purpose register FAULTMASK. - Can only be executed in Privileged modes. - */ -__STATIC_FORCEINLINE void __enable_fault_irq(void) -{ - __ASM volatile ("cpsie f" : : : "memory"); -} - - -/** - \brief Disable FIQ - \details Disables FIQ interrupts by setting special-purpose register FAULTMASK. - Can only be executed in Privileged modes. - */ -__STATIC_FORCEINLINE void __disable_fault_irq(void) -{ - __ASM volatile ("cpsid f" : : : "memory"); -} - - -/** - \brief Get Base Priority - \details Returns the current value of the Base Priority register. - \return Base Priority register value - */ -__STATIC_FORCEINLINE uint32_t __get_BASEPRI(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, basepri" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Base Priority (non-secure) - \details Returns the current value of the non-secure Base Priority register when in secure state. - \return Base Priority register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_BASEPRI_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, basepri_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Base Priority - \details Assigns the given value to the Base Priority register. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __set_BASEPRI(uint32_t basePri) -{ - __ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory"); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Base Priority (non-secure) - \details Assigns the given value to the non-secure Base Priority register when in secure state. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __TZ_set_BASEPRI_NS(uint32_t basePri) -{ - __ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "memory"); -} -#endif - - -/** - \brief Set Base Priority with condition - \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, - or the new value increases the BASEPRI priority level. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __set_BASEPRI_MAX(uint32_t basePri) -{ - __ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory"); -} - - -/** - \brief Get Fault Mask - \details Returns the current value of the Fault Mask register. - \return Fault Mask register value - */ -__STATIC_FORCEINLINE uint32_t __get_FAULTMASK(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Fault Mask (non-secure) - \details Returns the current value of the non-secure Fault Mask register when in secure state. - \return Fault Mask register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_FAULTMASK_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, faultmask_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Fault Mask - \details Assigns the given value to the Fault Mask register. - \param [in] faultMask Fault Mask value to set - */ -__STATIC_FORCEINLINE void __set_FAULTMASK(uint32_t faultMask) -{ - __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Fault Mask (non-secure) - \details Assigns the given value to the non-secure Fault Mask register when in secure state. - \param [in] faultMask Fault Mask value to set - */ -__STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) -{ - __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory"); -} -#endif - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) - -/** - \brief Get Process Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always in non-secure - mode. - - \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). - \return PSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __get_PSPLIM(void) -{ -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, psplim" : "=r" (result) ); - return result; -#endif -} - -#if (defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Process Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always in non-secure - mode. - - \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \return PSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS(void) -{ -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) ) - // without main extensions, the non-secure PSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, psplim_ns" : "=r" (result) ); - return result; -#endif -} -#endif - - -/** - \brief Set Process Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored in non-secure - mode. - - \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set - */ -__STATIC_FORCEINLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) -{ -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - (void)ProcStackPtrLimit; -#else - __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit)); -#endif -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Process Stack Pointer (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored in non-secure - mode. - - \details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set - */ -__STATIC_FORCEINLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) -{ -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) ) - // without main extensions, the non-secure PSPLIM is RAZ/WI - (void)ProcStackPtrLimit; -#else - __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit)); -#endif -} -#endif - - -/** - \brief Get Main Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always. - - \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). - \return MSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __get_MSPLIM(void) -{ -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, msplim" : "=r" (result) ); - return result; -#endif -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Main Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always. - - \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. - \return MSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS(void) -{ -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) ) - // without main extensions, the non-secure MSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) ); - return result; -#endif -} -#endif - - -/** - \brief Set Main Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored. - - \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). - \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set - */ -__STATIC_FORCEINLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) -{ -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - (void)MainStackPtrLimit; -#else - __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit)); -#endif -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Main Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored. - - \details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state. - \param [in] MainStackPtrLimit Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) -{ -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) ) - // without main extensions, the non-secure MSPLIM is RAZ/WI - (void)MainStackPtrLimit; -#else - __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit)); -#endif -} -#endif - -#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) */ - -/** - \brief Get FPSCR - \details Returns the current value of the Floating Point Status/Control register. - \return Floating Point Status/Control register value - */ -#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) -#define __get_FPSCR (uint32_t)__builtin_arm_get_fpscr -#else -#define __get_FPSCR() ((uint32_t)0U) -#endif - -/** - \brief Set FPSCR - \details Assigns the given value to the Floating Point Status/Control register. - \param [in] fpscr Floating Point Status/Control value to set - */ -#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) -#define __set_FPSCR __builtin_arm_set_fpscr -#else -#define __set_FPSCR(x) ((void)(x)) -#endif - - -/*@} end of CMSIS_Core_RegAccFunctions */ - - -/* ################### Compiler specific Intrinsics ########################### */ -/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics - Access to dedicated SIMD instructions - @{ -*/ - -#if (defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1)) - -#define __SADD8 __builtin_arm_sadd8 -#define __QADD8 __builtin_arm_qadd8 -#define __SHADD8 __builtin_arm_shadd8 -#define __UADD8 __builtin_arm_uadd8 -#define __UQADD8 __builtin_arm_uqadd8 -#define __UHADD8 __builtin_arm_uhadd8 -#define __SSUB8 __builtin_arm_ssub8 -#define __QSUB8 __builtin_arm_qsub8 -#define __SHSUB8 __builtin_arm_shsub8 -#define __USUB8 __builtin_arm_usub8 -#define __UQSUB8 __builtin_arm_uqsub8 -#define __UHSUB8 __builtin_arm_uhsub8 -#define __SADD16 __builtin_arm_sadd16 -#define __QADD16 __builtin_arm_qadd16 -#define __SHADD16 __builtin_arm_shadd16 -#define __UADD16 __builtin_arm_uadd16 -#define __UQADD16 __builtin_arm_uqadd16 -#define __UHADD16 __builtin_arm_uhadd16 -#define __SSUB16 __builtin_arm_ssub16 -#define __QSUB16 __builtin_arm_qsub16 -#define __SHSUB16 __builtin_arm_shsub16 -#define __USUB16 __builtin_arm_usub16 -#define __UQSUB16 __builtin_arm_uqsub16 -#define __UHSUB16 __builtin_arm_uhsub16 -#define __SASX __builtin_arm_sasx -#define __QASX __builtin_arm_qasx -#define __SHASX __builtin_arm_shasx -#define __UASX __builtin_arm_uasx -#define __UQASX __builtin_arm_uqasx -#define __UHASX __builtin_arm_uhasx -#define __SSAX __builtin_arm_ssax -#define __QSAX __builtin_arm_qsax -#define __SHSAX __builtin_arm_shsax -#define __USAX __builtin_arm_usax -#define __UQSAX __builtin_arm_uqsax -#define __UHSAX __builtin_arm_uhsax -#define __USAD8 __builtin_arm_usad8 -#define __USADA8 __builtin_arm_usada8 -#define __SSAT16 __builtin_arm_ssat16 -#define __USAT16 __builtin_arm_usat16 -#define __UXTB16 __builtin_arm_uxtb16 -#define __UXTAB16 __builtin_arm_uxtab16 -#define __SXTB16 __builtin_arm_sxtb16 -#define __SXTAB16 __builtin_arm_sxtab16 -#define __SMUAD __builtin_arm_smuad -#define __SMUADX __builtin_arm_smuadx -#define __SMLAD __builtin_arm_smlad -#define __SMLADX __builtin_arm_smladx -#define __SMLALD __builtin_arm_smlald -#define __SMLALDX __builtin_arm_smlaldx -#define __SMUSD __builtin_arm_smusd -#define __SMUSDX __builtin_arm_smusdx -#define __SMLSD __builtin_arm_smlsd -#define __SMLSDX __builtin_arm_smlsdx -#define __SMLSLD __builtin_arm_smlsld -#define __SMLSLDX __builtin_arm_smlsldx -#define __SEL __builtin_arm_sel -#define __QADD __builtin_arm_qadd -#define __QSUB __builtin_arm_qsub - -#define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \ - ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) ) - -#define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \ - ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) ) - -#define __SXTB16_RORn(ARG1, ARG2) __SXTB16(__ROR(ARG1, ARG2)) - -#define __SXTAB16_RORn(ARG1, ARG2, ARG3) __SXTAB16(ARG1, __ROR(ARG2, ARG3)) - -__STATIC_FORCEINLINE int32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3) -{ - int32_t result; - - __ASM volatile ("smmla %0, %1, %2, %3" : "=r" (result): "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -#endif /* (__ARM_FEATURE_DSP == 1) */ -/*@} end of group CMSIS_SIMD_intrinsics */ - - -#endif /* __CMSIS_ARMCLANG_H */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/CMSIS/Core/Include/cmsis_armclang_ltm.h b/bsp/nxp/mcx/mcxn/Libraries/CMSIS/Core/Include/cmsis_armclang_ltm.h deleted file mode 100644 index 1e255d5907f..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/CMSIS/Core/Include/cmsis_armclang_ltm.h +++ /dev/null @@ -1,1928 +0,0 @@ -/**************************************************************************//** - * @file cmsis_armclang_ltm.h - * @brief CMSIS compiler armclang (Arm Compiler 6) header file - * @version V1.5.3 - * @date 27. May 2021 - ******************************************************************************/ -/* - * Copyright (c) 2018-2021 Arm Limited. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - * - * 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. - */ - -/*lint -esym(9058, IRQn)*/ /* disable MISRA 2012 Rule 2.4 for IRQn */ - -#ifndef __CMSIS_ARMCLANG_H -#define __CMSIS_ARMCLANG_H - -#pragma clang system_header /* treat file as system include file */ - -/* CMSIS compiler specific defines */ -#ifndef __ASM - #define __ASM __asm -#endif -#ifndef __INLINE - #define __INLINE __inline -#endif -#ifndef __STATIC_INLINE - #define __STATIC_INLINE static __inline -#endif -#ifndef __STATIC_FORCEINLINE - #define __STATIC_FORCEINLINE __attribute__((always_inline)) static __inline -#endif -#ifndef __NO_RETURN - #define __NO_RETURN __attribute__((__noreturn__)) -#endif -#ifndef __USED - #define __USED __attribute__((used)) -#endif -#ifndef __WEAK - #define __WEAK __attribute__((weak)) -#endif -#ifndef __PACKED - #define __PACKED __attribute__((packed, aligned(1))) -#endif -#ifndef __PACKED_STRUCT - #define __PACKED_STRUCT struct __attribute__((packed, aligned(1))) -#endif -#ifndef __PACKED_UNION - #define __PACKED_UNION union __attribute__((packed, aligned(1))) -#endif -#ifndef __UNALIGNED_UINT32 /* deprecated */ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpacked" -/*lint -esym(9058, T_UINT32)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32 */ - struct __attribute__((packed)) T_UINT32 { uint32_t v; }; - #pragma clang diagnostic pop - #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) -#endif -#ifndef __UNALIGNED_UINT16_WRITE - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpacked" -/*lint -esym(9058, T_UINT16_WRITE)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT16_WRITE */ - __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; - #pragma clang diagnostic pop - #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) -#endif -#ifndef __UNALIGNED_UINT16_READ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpacked" -/*lint -esym(9058, T_UINT16_READ)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT16_READ */ - __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; - #pragma clang diagnostic pop - #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) -#endif -#ifndef __UNALIGNED_UINT32_WRITE - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpacked" -/*lint -esym(9058, T_UINT32_WRITE)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32_WRITE */ - __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; - #pragma clang diagnostic pop - #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) -#endif -#ifndef __UNALIGNED_UINT32_READ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpacked" -/*lint -esym(9058, T_UINT32_READ)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32_READ */ - __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; - #pragma clang diagnostic pop - #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) -#endif -#ifndef __ALIGNED - #define __ALIGNED(x) __attribute__((aligned(x))) -#endif -#ifndef __RESTRICT - #define __RESTRICT __restrict -#endif -#ifndef __COMPILER_BARRIER - #define __COMPILER_BARRIER() __ASM volatile("":::"memory") -#endif - -/* ######################### Startup and Lowlevel Init ######################## */ - -#ifndef __PROGRAM_START -#define __PROGRAM_START __main -#endif - -#ifndef __INITIAL_SP -#define __INITIAL_SP Image$$ARM_LIB_STACK$$ZI$$Limit -#endif - -#ifndef __STACK_LIMIT -#define __STACK_LIMIT Image$$ARM_LIB_STACK$$ZI$$Base -#endif - -#ifndef __VECTOR_TABLE -#define __VECTOR_TABLE __Vectors -#endif - -#ifndef __VECTOR_TABLE_ATTRIBUTE -#define __VECTOR_TABLE_ATTRIBUTE __attribute__((used, section("RESET"))) -#endif - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) -#ifndef __STACK_SEAL -#define __STACK_SEAL Image$$STACKSEAL$$ZI$$Base -#endif - -#ifndef __TZ_STACK_SEAL_SIZE -#define __TZ_STACK_SEAL_SIZE 8U -#endif - -#ifndef __TZ_STACK_SEAL_VALUE -#define __TZ_STACK_SEAL_VALUE 0xFEF5EDA5FEF5EDA5ULL -#endif - - -__STATIC_FORCEINLINE void __TZ_set_STACKSEAL_S (uint32_t* stackTop) { - *((uint64_t *)stackTop) = __TZ_STACK_SEAL_VALUE; -} -#endif - - -/* ########################## Core Instruction Access ######################### */ -/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface - Access to dedicated instructions - @{ -*/ - -/* Define macros for porting to both thumb1 and thumb2. - * For thumb1, use low register (r0-r7), specified by constraint "l" - * Otherwise, use general registers, specified by constraint "r" */ -#if defined (__thumb__) && !defined (__thumb2__) -#define __CMSIS_GCC_OUT_REG(r) "=l" (r) -#define __CMSIS_GCC_USE_REG(r) "l" (r) -#else -#define __CMSIS_GCC_OUT_REG(r) "=r" (r) -#define __CMSIS_GCC_USE_REG(r) "r" (r) -#endif - -/** - \brief No Operation - \details No Operation does nothing. This instruction can be used for code alignment purposes. - */ -#define __NOP __builtin_arm_nop - -/** - \brief Wait For Interrupt - \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. - */ -#define __WFI __builtin_arm_wfi - - -/** - \brief Wait For Event - \details Wait For Event is a hint instruction that permits the processor to enter - a low-power state until one of a number of events occurs. - */ -#define __WFE __builtin_arm_wfe - - -/** - \brief Send Event - \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. - */ -#define __SEV __builtin_arm_sev - - -/** - \brief Instruction Synchronization Barrier - \details Instruction Synchronization Barrier flushes the pipeline in the processor, - so that all instructions following the ISB are fetched from cache or memory, - after the instruction has been completed. - */ -#define __ISB() __builtin_arm_isb(0xF) - -/** - \brief Data Synchronization Barrier - \details Acts as a special kind of Data Memory Barrier. - It completes when all explicit memory accesses before this instruction complete. - */ -#define __DSB() __builtin_arm_dsb(0xF) - - -/** - \brief Data Memory Barrier - \details Ensures the apparent order of the explicit memory operations before - and after the instruction, without ensuring their completion. - */ -#define __DMB() __builtin_arm_dmb(0xF) - - -/** - \brief Reverse byte order (32 bit) - \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV(value) __builtin_bswap32(value) - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV16(value) __ROR(__REV(value), 16) - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REVSH(value) (int16_t)__builtin_bswap16(value) - - -/** - \brief Rotate Right in unsigned value (32 bit) - \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. - \param [in] op1 Value to rotate - \param [in] op2 Number of Bits to rotate - \return Rotated value - */ -__STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2) -{ - op2 %= 32U; - if (op2 == 0U) - { - return op1; - } - return (op1 >> op2) | (op1 << (32U - op2)); -} - - -/** - \brief Breakpoint - \details Causes the processor to enter Debug state. - Debug tools can use this to investigate system state when the instruction at a particular address is reached. - \param [in] value is ignored by the processor. - If required, a debugger can use it to store additional information about the breakpoint. - */ -#define __BKPT(value) __ASM volatile ("bkpt "#value) - - -/** - \brief Reverse bit order of value - \details Reverses the bit order of the given value. - \param [in] value Value to reverse - \return Reversed value - */ -#define __RBIT __builtin_arm_rbit - -/** - \brief Count leading zeros - \details Counts the number of leading zeros of a data value. - \param [in] value Value to count the leading zeros - \return number of leading zeros in value - */ -__STATIC_FORCEINLINE uint8_t __CLZ(uint32_t value) -{ - /* Even though __builtin_clz produces a CLZ instruction on ARM, formally - __builtin_clz(0) is undefined behaviour, so handle this case specially. - This guarantees ARM-compatible results if happening to compile on a non-ARM - target, and ensures the compiler doesn't decide to activate any - optimisations using the logic "value was passed to __builtin_clz, so it - is non-zero". - ARM Compiler 6.10 and possibly earlier will optimise this test away, leaving a - single CLZ instruction. - */ - if (value == 0U) - { - return 32U; - } - return __builtin_clz(value); -} - - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) -/** - \brief LDR Exclusive (8 bit) - \details Executes a exclusive LDR instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -#define __LDREXB (uint8_t)__builtin_arm_ldrex - - -/** - \brief LDR Exclusive (16 bit) - \details Executes a exclusive LDR instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -#define __LDREXH (uint16_t)__builtin_arm_ldrex - - -/** - \brief LDR Exclusive (32 bit) - \details Executes a exclusive LDR instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -#define __LDREXW (uint32_t)__builtin_arm_ldrex - - -/** - \brief STR Exclusive (8 bit) - \details Executes a exclusive STR instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STREXB (uint32_t)__builtin_arm_strex - - -/** - \brief STR Exclusive (16 bit) - \details Executes a exclusive STR instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STREXH (uint32_t)__builtin_arm_strex - - -/** - \brief STR Exclusive (32 bit) - \details Executes a exclusive STR instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STREXW (uint32_t)__builtin_arm_strex - - -/** - \brief Remove the exclusive lock - \details Removes the exclusive lock which is created by LDREX. - */ -#define __CLREX __builtin_arm_clrex - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) - -/** - \brief Signed Saturate - \details Saturates a signed value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (1..32) - \return Saturated value - */ -#define __SSAT __builtin_arm_ssat - - -/** - \brief Unsigned Saturate - \details Saturates an unsigned value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value - */ -#define __USAT __builtin_arm_usat - - -/** - \brief Rotate Right with Extend (32 bit) - \details Moves each bit of a bitstring right by one bit. - The carry input is shifted in at the left end of the bitstring. - \param [in] value Value to rotate - \return Rotated value - */ -__STATIC_FORCEINLINE uint32_t __RRX(uint32_t value) -{ - uint32_t result; - - __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return(result); -} - - -/** - \brief LDRT Unprivileged (8 bit) - \details Executes a Unprivileged LDRT instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -__STATIC_FORCEINLINE uint8_t __LDRBT(volatile uint8_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) ); - return ((uint8_t) result); /* Add explicit type cast here */ -} - - -/** - \brief LDRT Unprivileged (16 bit) - \details Executes a Unprivileged LDRT instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -__STATIC_FORCEINLINE uint16_t __LDRHT(volatile uint16_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) ); - return ((uint16_t) result); /* Add explicit type cast here */ -} - - -/** - \brief LDRT Unprivileged (32 bit) - \details Executes a Unprivileged LDRT instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -__STATIC_FORCEINLINE uint32_t __LDRT(volatile uint32_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*ptr) ); - return(result); -} - - -/** - \brief STRT Unprivileged (8 bit) - \details Executes a Unprivileged STRT instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STRBT(uint8_t value, volatile uint8_t *ptr) -{ - __ASM volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); -} - - -/** - \brief STRT Unprivileged (16 bit) - \details Executes a Unprivileged STRT instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STRHT(uint16_t value, volatile uint16_t *ptr) -{ - __ASM volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); -} - - -/** - \brief STRT Unprivileged (32 bit) - \details Executes a Unprivileged STRT instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STRT(uint32_t value, volatile uint32_t *ptr) -{ - __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) ); -} - -#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ - -/** - \brief Signed Saturate - \details Saturates a signed value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (1..32) - \return Saturated value - */ -__STATIC_FORCEINLINE int32_t __SSAT(int32_t val, uint32_t sat) -{ - if ((sat >= 1U) && (sat <= 32U)) - { - const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); - const int32_t min = -1 - max ; - if (val > max) - { - return max; - } - else if (val < min) - { - return min; - } - } - return val; -} - -/** - \brief Unsigned Saturate - \details Saturates an unsigned value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value - */ -__STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat) -{ - if (sat <= 31U) - { - const uint32_t max = ((1U << sat) - 1U); - if (val > (int32_t)max) - { - return max; - } - else if (val < 0) - { - return 0U; - } - } - return (uint32_t)val; -} - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) -/** - \brief Load-Acquire (8 bit) - \details Executes a LDAB instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -__STATIC_FORCEINLINE uint8_t __LDAB(volatile uint8_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldab %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint8_t) result); -} - - -/** - \brief Load-Acquire (16 bit) - \details Executes a LDAH instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -__STATIC_FORCEINLINE uint16_t __LDAH(volatile uint16_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldah %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint16_t) result); -} - - -/** - \brief Load-Acquire (32 bit) - \details Executes a LDA instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -__STATIC_FORCEINLINE uint32_t __LDA(volatile uint32_t *ptr) -{ - uint32_t result; - - __ASM volatile ("lda %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return(result); -} - - -/** - \brief Store-Release (8 bit) - \details Executes a STLB instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STLB(uint8_t value, volatile uint8_t *ptr) -{ - __ASM volatile ("stlb %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); -} - - -/** - \brief Store-Release (16 bit) - \details Executes a STLH instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STLH(uint16_t value, volatile uint16_t *ptr) -{ - __ASM volatile ("stlh %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); -} - - -/** - \brief Store-Release (32 bit) - \details Executes a STL instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STL(uint32_t value, volatile uint32_t *ptr) -{ - __ASM volatile ("stl %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); -} - - -/** - \brief Load-Acquire Exclusive (8 bit) - \details Executes a LDAB exclusive instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -#define __LDAEXB (uint8_t)__builtin_arm_ldaex - - -/** - \brief Load-Acquire Exclusive (16 bit) - \details Executes a LDAH exclusive instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -#define __LDAEXH (uint16_t)__builtin_arm_ldaex - - -/** - \brief Load-Acquire Exclusive (32 bit) - \details Executes a LDA exclusive instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -#define __LDAEX (uint32_t)__builtin_arm_ldaex - - -/** - \brief Store-Release Exclusive (8 bit) - \details Executes a STLB exclusive instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STLEXB (uint32_t)__builtin_arm_stlex - - -/** - \brief Store-Release Exclusive (16 bit) - \details Executes a STLH exclusive instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STLEXH (uint32_t)__builtin_arm_stlex - - -/** - \brief Store-Release Exclusive (32 bit) - \details Executes a STL exclusive instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STLEX (uint32_t)__builtin_arm_stlex - -#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ - -/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ - - -/* ########################### Core Function Access ########################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions - @{ - */ - -/** - \brief Enable IRQ Interrupts - \details Enables IRQ interrupts by clearing special-purpose register PRIMASK. - Can only be executed in Privileged modes. - */ -#ifndef __ARM_COMPAT_H -__STATIC_FORCEINLINE void __enable_irq(void) -{ - __ASM volatile ("cpsie i" : : : "memory"); -} -#endif - - -/** - \brief Disable IRQ Interrupts - \details Disables IRQ interrupts by setting special-purpose register PRIMASK. - Can only be executed in Privileged modes. - */ -#ifndef __ARM_COMPAT_H -__STATIC_FORCEINLINE void __disable_irq(void) -{ - __ASM volatile ("cpsid i" : : : "memory"); -} -#endif - - -/** - \brief Get Control Register - \details Returns the content of the Control Register. - \return Control Register value - */ -__STATIC_FORCEINLINE uint32_t __get_CONTROL(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, control" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Control Register (non-secure) - \details Returns the content of the non-secure Control Register when in secure mode. - \return non-secure Control Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_CONTROL_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, control_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Control Register - \details Writes the given value to the Control Register. - \param [in] control Control Register value to set - */ -__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control) -{ - __ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); - __ISB(); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Control Register (non-secure) - \details Writes the given value to the non-secure Control Register when in secure state. - \param [in] control Control Register value to set - */ -__STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control) -{ - __ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory"); - __ISB(); -} -#endif - - -/** - \brief Get IPSR Register - \details Returns the content of the IPSR Register. - \return IPSR Register value - */ -__STATIC_FORCEINLINE uint32_t __get_IPSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, ipsr" : "=r" (result) ); - return(result); -} - - -/** - \brief Get APSR Register - \details Returns the content of the APSR Register. - \return APSR Register value - */ -__STATIC_FORCEINLINE uint32_t __get_APSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, apsr" : "=r" (result) ); - return(result); -} - - -/** - \brief Get xPSR Register - \details Returns the content of the xPSR Register. - \return xPSR Register value - */ -__STATIC_FORCEINLINE uint32_t __get_xPSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, xpsr" : "=r" (result) ); - return(result); -} - - -/** - \brief Get Process Stack Pointer - \details Returns the current value of the Process Stack Pointer (PSP). - \return PSP Register value - */ -__STATIC_FORCEINLINE uint32_t __get_PSP(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, psp" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Process Stack Pointer (non-secure) - \details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state. - \return PSP Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PSP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, psp_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Process Stack Pointer - \details Assigns the given value to the Process Stack Pointer (PSP). - \param [in] topOfProcStack Process Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack) -{ - __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : ); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Process Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state. - \param [in] topOfProcStack Process Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack) -{ - __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : ); -} -#endif - - -/** - \brief Get Main Stack Pointer - \details Returns the current value of the Main Stack Pointer (MSP). - \return MSP Register value - */ -__STATIC_FORCEINLINE uint32_t __get_MSP(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, msp" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Main Stack Pointer (non-secure) - \details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state. - \return MSP Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_MSP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, msp_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Main Stack Pointer - \details Assigns the given value to the Main Stack Pointer (MSP). - \param [in] topOfMainStack Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack) -{ - __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : ); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Main Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state. - \param [in] topOfMainStack Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack) -{ - __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : ); -} -#endif - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Stack Pointer (non-secure) - \details Returns the current value of the non-secure Stack Pointer (SP) when in secure state. - \return SP Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_SP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, sp_ns" : "=r" (result) ); - return(result); -} - - -/** - \brief Set Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Stack Pointer (SP) when in secure state. - \param [in] topOfStack Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_SP_NS(uint32_t topOfStack) -{ - __ASM volatile ("MSR sp_ns, %0" : : "r" (topOfStack) : ); -} -#endif - - -/** - \brief Get Priority Mask - \details Returns the current state of the priority mask bit from the Priority Mask Register. - \return Priority Mask value - */ -__STATIC_FORCEINLINE uint32_t __get_PRIMASK(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, primask" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Priority Mask (non-secure) - \details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state. - \return Priority Mask value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PRIMASK_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, primask_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Priority Mask - \details Assigns the given value to the Priority Mask Register. - \param [in] priMask Priority Mask - */ -__STATIC_FORCEINLINE void __set_PRIMASK(uint32_t priMask) -{ - __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Priority Mask (non-secure) - \details Assigns the given value to the non-secure Priority Mask Register when in secure state. - \param [in] priMask Priority Mask - */ -__STATIC_FORCEINLINE void __TZ_set_PRIMASK_NS(uint32_t priMask) -{ - __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory"); -} -#endif - - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) -/** - \brief Enable FIQ - \details Enables FIQ interrupts by clearing special-purpose register FAULTMASK. - Can only be executed in Privileged modes. - */ -__STATIC_FORCEINLINE void __enable_fault_irq(void) -{ - __ASM volatile ("cpsie f" : : : "memory"); -} - - -/** - \brief Disable FIQ - \details Disables FIQ interrupts by setting special-purpose register FAULTMASK. - Can only be executed in Privileged modes. - */ -__STATIC_FORCEINLINE void __disable_fault_irq(void) -{ - __ASM volatile ("cpsid f" : : : "memory"); -} - - -/** - \brief Get Base Priority - \details Returns the current value of the Base Priority register. - \return Base Priority register value - */ -__STATIC_FORCEINLINE uint32_t __get_BASEPRI(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, basepri" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Base Priority (non-secure) - \details Returns the current value of the non-secure Base Priority register when in secure state. - \return Base Priority register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_BASEPRI_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, basepri_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Base Priority - \details Assigns the given value to the Base Priority register. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __set_BASEPRI(uint32_t basePri) -{ - __ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory"); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Base Priority (non-secure) - \details Assigns the given value to the non-secure Base Priority register when in secure state. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __TZ_set_BASEPRI_NS(uint32_t basePri) -{ - __ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "memory"); -} -#endif - - -/** - \brief Set Base Priority with condition - \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, - or the new value increases the BASEPRI priority level. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __set_BASEPRI_MAX(uint32_t basePri) -{ - __ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory"); -} - - -/** - \brief Get Fault Mask - \details Returns the current value of the Fault Mask register. - \return Fault Mask register value - */ -__STATIC_FORCEINLINE uint32_t __get_FAULTMASK(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Fault Mask (non-secure) - \details Returns the current value of the non-secure Fault Mask register when in secure state. - \return Fault Mask register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_FAULTMASK_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, faultmask_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Fault Mask - \details Assigns the given value to the Fault Mask register. - \param [in] faultMask Fault Mask value to set - */ -__STATIC_FORCEINLINE void __set_FAULTMASK(uint32_t faultMask) -{ - __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Fault Mask (non-secure) - \details Assigns the given value to the non-secure Fault Mask register when in secure state. - \param [in] faultMask Fault Mask value to set - */ -__STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) -{ - __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory"); -} -#endif - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) - -/** - \brief Get Process Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always in non-secure - mode. - - \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). - \return PSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __get_PSPLIM(void) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, psplim" : "=r" (result) ); - return result; -#endif -} - -#if (defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Process Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always in non-secure - mode. - - \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \return PSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS(void) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, psplim_ns" : "=r" (result) ); - return result; -#endif -} -#endif - - -/** - \brief Set Process Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored in non-secure - mode. - - \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set - */ -__STATIC_FORCEINLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - (void)ProcStackPtrLimit; -#else - __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit)); -#endif -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Process Stack Pointer (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored in non-secure - mode. - - \details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set - */ -__STATIC_FORCEINLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - (void)ProcStackPtrLimit; -#else - __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit)); -#endif -} -#endif - - -/** - \brief Get Main Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always. - - \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). - \return MSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __get_MSPLIM(void) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, msplim" : "=r" (result) ); - return result; -#endif -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Main Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always. - - \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. - \return MSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS(void) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) ); - return result; -#endif -} -#endif - - -/** - \brief Set Main Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored. - - \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). - \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set - */ -__STATIC_FORCEINLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - (void)MainStackPtrLimit; -#else - __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit)); -#endif -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Main Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored. - - \details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state. - \param [in] MainStackPtrLimit Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - (void)MainStackPtrLimit; -#else - __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit)); -#endif -} -#endif - -#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ - -/** - \brief Get FPSCR - \details Returns the current value of the Floating Point Status/Control register. - \return Floating Point Status/Control register value - */ -#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) -#define __get_FPSCR (uint32_t)__builtin_arm_get_fpscr -#else -#define __get_FPSCR() ((uint32_t)0U) -#endif - -/** - \brief Set FPSCR - \details Assigns the given value to the Floating Point Status/Control register. - \param [in] fpscr Floating Point Status/Control value to set - */ -#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) -#define __set_FPSCR __builtin_arm_set_fpscr -#else -#define __set_FPSCR(x) ((void)(x)) -#endif - - -/*@} end of CMSIS_Core_RegAccFunctions */ - - -/* ################### Compiler specific Intrinsics ########################### */ -/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics - Access to dedicated SIMD instructions - @{ -*/ - -#if (defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1)) - -__STATIC_FORCEINLINE uint32_t __SADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - - -__STATIC_FORCEINLINE uint32_t __SSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("ssub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __USUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - - -__STATIC_FORCEINLINE uint32_t __SADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("ssub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __USUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("ssax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __USAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __USAD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usad8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __USADA8(uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("usada8 %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -#define __SSAT16(ARG1,ARG2) \ -({ \ - int32_t __RES, __ARG1 = (ARG1); \ - __ASM ("ssat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ - __RES; \ - }) - -#define __USAT16(ARG1,ARG2) \ -({ \ - uint32_t __RES, __ARG1 = (ARG1); \ - __ASM ("usat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ - __RES; \ - }) - -__STATIC_FORCEINLINE uint32_t __UXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile ("uxtb16 %0, %1" : "=r" (result) : "r" (op1)); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UXTAB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile ("sxtb16 %0, %1" : "=r" (result) : "r" (op1)); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SXTAB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMUAD (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smuad %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMUADX (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smuadx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMLAD (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smlad %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMLADX (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smladx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__STATIC_FORCEINLINE uint64_t __SMLALD (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__STATIC_FORCEINLINE uint64_t __SMLALDX (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__STATIC_FORCEINLINE uint32_t __SMUSD (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smusd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMUSDX (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smusdx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMLSD (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smlsd %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMLSDX (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smlsdx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__STATIC_FORCEINLINE uint64_t __SMLSLD (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__STATIC_FORCEINLINE uint64_t __SMLSLDX (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__STATIC_FORCEINLINE uint32_t __SEL (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sel %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE int32_t __QADD( int32_t op1, int32_t op2) -{ - int32_t result; - - __ASM volatile ("qadd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE int32_t __QSUB( int32_t op1, int32_t op2) -{ - int32_t result; - - __ASM volatile ("qsub %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -#define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \ - ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) ) - -#define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \ - ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) ) - -#define __SXTB16_RORn(ARG1, ARG2) __SXTB16(__ROR(ARG1, ARG2)) - -#define __SXTAB16_RORn(ARG1, ARG2, ARG3) __SXTAB16(ARG1, __ROR(ARG2, ARG3)) - -__STATIC_FORCEINLINE int32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3) -{ - int32_t result; - - __ASM volatile ("smmla %0, %1, %2, %3" : "=r" (result): "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -#endif /* (__ARM_FEATURE_DSP == 1) */ -/*@} end of group CMSIS_SIMD_intrinsics */ - - -#endif /* __CMSIS_ARMCLANG_H */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/CMSIS/Core/Include/cmsis_compiler.h b/bsp/nxp/mcx/mcxn/Libraries/CMSIS/Core/Include/cmsis_compiler.h deleted file mode 100644 index adbf296f15a..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/CMSIS/Core/Include/cmsis_compiler.h +++ /dev/null @@ -1,283 +0,0 @@ -/**************************************************************************//** - * @file cmsis_compiler.h - * @brief CMSIS compiler generic header file - * @version V5.1.0 - * @date 09. October 2018 - ******************************************************************************/ -/* - * Copyright (c) 2009-2018 Arm Limited. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - * - * 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 __CMSIS_COMPILER_H -#define __CMSIS_COMPILER_H - -#include - -/* - * Arm Compiler 4/5 - */ -#if defined ( __CC_ARM ) - #include "cmsis_armcc.h" - - -/* - * Arm Compiler 6.6 LTM (armclang) - */ -#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) && (__ARMCC_VERSION < 6100100) - #include "cmsis_armclang_ltm.h" - - /* - * Arm Compiler above 6.10.1 (armclang) - */ -#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6100100) - #include "cmsis_armclang.h" - - -/* - * GNU Compiler - */ -#elif defined ( __GNUC__ ) - #include "cmsis_gcc.h" - - -/* - * IAR Compiler - */ -#elif defined ( __ICCARM__ ) - #include - - -/* - * TI Arm Compiler - */ -#elif defined ( __TI_ARM__ ) - #include - - #ifndef __ASM - #define __ASM __asm - #endif - #ifndef __INLINE - #define __INLINE inline - #endif - #ifndef __STATIC_INLINE - #define __STATIC_INLINE static inline - #endif - #ifndef __STATIC_FORCEINLINE - #define __STATIC_FORCEINLINE __STATIC_INLINE - #endif - #ifndef __NO_RETURN - #define __NO_RETURN __attribute__((noreturn)) - #endif - #ifndef __USED - #define __USED __attribute__((used)) - #endif - #ifndef __WEAK - #define __WEAK __attribute__((weak)) - #endif - #ifndef __PACKED - #define __PACKED __attribute__((packed)) - #endif - #ifndef __PACKED_STRUCT - #define __PACKED_STRUCT struct __attribute__((packed)) - #endif - #ifndef __PACKED_UNION - #define __PACKED_UNION union __attribute__((packed)) - #endif - #ifndef __UNALIGNED_UINT32 /* deprecated */ - struct __attribute__((packed)) T_UINT32 { uint32_t v; }; - #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) - #endif - #ifndef __UNALIGNED_UINT16_WRITE - __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; - #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void*)(addr))->v) = (val)) - #endif - #ifndef __UNALIGNED_UINT16_READ - __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; - #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) - #endif - #ifndef __UNALIGNED_UINT32_WRITE - __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; - #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) - #endif - #ifndef __UNALIGNED_UINT32_READ - __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; - #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) - #endif - #ifndef __ALIGNED - #define __ALIGNED(x) __attribute__((aligned(x))) - #endif - #ifndef __RESTRICT - #define __RESTRICT __restrict - #endif - #ifndef __COMPILER_BARRIER - #warning No compiler specific solution for __COMPILER_BARRIER. __COMPILER_BARRIER is ignored. - #define __COMPILER_BARRIER() (void)0 - #endif - - -/* - * TASKING Compiler - */ -#elif defined ( __TASKING__ ) - /* - * The CMSIS functions have been implemented as intrinsics in the compiler. - * Please use "carm -?i" to get an up to date list of all intrinsics, - * Including the CMSIS ones. - */ - - #ifndef __ASM - #define __ASM __asm - #endif - #ifndef __INLINE - #define __INLINE inline - #endif - #ifndef __STATIC_INLINE - #define __STATIC_INLINE static inline - #endif - #ifndef __STATIC_FORCEINLINE - #define __STATIC_FORCEINLINE __STATIC_INLINE - #endif - #ifndef __NO_RETURN - #define __NO_RETURN __attribute__((noreturn)) - #endif - #ifndef __USED - #define __USED __attribute__((used)) - #endif - #ifndef __WEAK - #define __WEAK __attribute__((weak)) - #endif - #ifndef __PACKED - #define __PACKED __packed__ - #endif - #ifndef __PACKED_STRUCT - #define __PACKED_STRUCT struct __packed__ - #endif - #ifndef __PACKED_UNION - #define __PACKED_UNION union __packed__ - #endif - #ifndef __UNALIGNED_UINT32 /* deprecated */ - struct __packed__ T_UINT32 { uint32_t v; }; - #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) - #endif - #ifndef __UNALIGNED_UINT16_WRITE - __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; - #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) - #endif - #ifndef __UNALIGNED_UINT16_READ - __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; - #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) - #endif - #ifndef __UNALIGNED_UINT32_WRITE - __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; - #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) - #endif - #ifndef __UNALIGNED_UINT32_READ - __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; - #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) - #endif - #ifndef __ALIGNED - #define __ALIGNED(x) __align(x) - #endif - #ifndef __RESTRICT - #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored. - #define __RESTRICT - #endif - #ifndef __COMPILER_BARRIER - #warning No compiler specific solution for __COMPILER_BARRIER. __COMPILER_BARRIER is ignored. - #define __COMPILER_BARRIER() (void)0 - #endif - - -/* - * COSMIC Compiler - */ -#elif defined ( __CSMC__ ) - #include - - #ifndef __ASM - #define __ASM _asm - #endif - #ifndef __INLINE - #define __INLINE inline - #endif - #ifndef __STATIC_INLINE - #define __STATIC_INLINE static inline - #endif - #ifndef __STATIC_FORCEINLINE - #define __STATIC_FORCEINLINE __STATIC_INLINE - #endif - #ifndef __NO_RETURN - // NO RETURN is automatically detected hence no warning here - #define __NO_RETURN - #endif - #ifndef __USED - #warning No compiler specific solution for __USED. __USED is ignored. - #define __USED - #endif - #ifndef __WEAK - #define __WEAK __weak - #endif - #ifndef __PACKED - #define __PACKED @packed - #endif - #ifndef __PACKED_STRUCT - #define __PACKED_STRUCT @packed struct - #endif - #ifndef __PACKED_UNION - #define __PACKED_UNION @packed union - #endif - #ifndef __UNALIGNED_UINT32 /* deprecated */ - @packed struct T_UINT32 { uint32_t v; }; - #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) - #endif - #ifndef __UNALIGNED_UINT16_WRITE - __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; - #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) - #endif - #ifndef __UNALIGNED_UINT16_READ - __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; - #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) - #endif - #ifndef __UNALIGNED_UINT32_WRITE - __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; - #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) - #endif - #ifndef __UNALIGNED_UINT32_READ - __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; - #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) - #endif - #ifndef __ALIGNED - #warning No compiler specific solution for __ALIGNED. __ALIGNED is ignored. - #define __ALIGNED(x) - #endif - #ifndef __RESTRICT - #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored. - #define __RESTRICT - #endif - #ifndef __COMPILER_BARRIER - #warning No compiler specific solution for __COMPILER_BARRIER. __COMPILER_BARRIER is ignored. - #define __COMPILER_BARRIER() (void)0 - #endif - - -#else - #error Unknown compiler. -#endif - - -#endif /* __CMSIS_COMPILER_H */ - diff --git a/bsp/nxp/mcx/mcxn/Libraries/CMSIS/Core/Include/cmsis_gcc.h b/bsp/nxp/mcx/mcxn/Libraries/CMSIS/Core/Include/cmsis_gcc.h deleted file mode 100644 index 67bda4ef3c3..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/CMSIS/Core/Include/cmsis_gcc.h +++ /dev/null @@ -1,2211 +0,0 @@ -/**************************************************************************//** - * @file cmsis_gcc.h - * @brief CMSIS compiler GCC header file - * @version V5.4.1 - * @date 27. May 2021 - ******************************************************************************/ -/* - * Copyright (c) 2009-2021 Arm Limited. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - * - * 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 __CMSIS_GCC_H -#define __CMSIS_GCC_H - -/* ignore some GCC warnings */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-conversion" -#pragma GCC diagnostic ignored "-Wconversion" -#pragma GCC diagnostic ignored "-Wunused-parameter" - -/* Fallback for __has_builtin */ -#ifndef __has_builtin - #define __has_builtin(x) (0) -#endif - -/* CMSIS compiler specific defines */ -#ifndef __ASM - #define __ASM __asm -#endif -#ifndef __INLINE - #define __INLINE inline -#endif -#ifndef __STATIC_INLINE - #define __STATIC_INLINE static inline -#endif -#ifndef __STATIC_FORCEINLINE - #define __STATIC_FORCEINLINE __attribute__((always_inline)) static inline -#endif -#ifndef __NO_RETURN - #define __NO_RETURN __attribute__((__noreturn__)) -#endif -#ifndef __USED - #define __USED __attribute__((used)) -#endif -#ifndef __WEAK - #define __WEAK __attribute__((weak)) -#endif -#ifndef __PACKED - #define __PACKED __attribute__((packed, aligned(1))) -#endif -#ifndef __PACKED_STRUCT - #define __PACKED_STRUCT struct __attribute__((packed, aligned(1))) -#endif -#ifndef __PACKED_UNION - #define __PACKED_UNION union __attribute__((packed, aligned(1))) -#endif -#ifndef __UNALIGNED_UINT32 /* deprecated */ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wpacked" - #pragma GCC diagnostic ignored "-Wattributes" - struct __attribute__((packed)) T_UINT32 { uint32_t v; }; - #pragma GCC diagnostic pop - #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) -#endif -#ifndef __UNALIGNED_UINT16_WRITE - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wpacked" - #pragma GCC diagnostic ignored "-Wattributes" - __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; - #pragma GCC diagnostic pop - #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) -#endif -#ifndef __UNALIGNED_UINT16_READ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wpacked" - #pragma GCC diagnostic ignored "-Wattributes" - __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; - #pragma GCC diagnostic pop - #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) -#endif -#ifndef __UNALIGNED_UINT32_WRITE - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wpacked" - #pragma GCC diagnostic ignored "-Wattributes" - __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; - #pragma GCC diagnostic pop - #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) -#endif -#ifndef __UNALIGNED_UINT32_READ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wpacked" - #pragma GCC diagnostic ignored "-Wattributes" - __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; - #pragma GCC diagnostic pop - #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) -#endif -#ifndef __ALIGNED - #define __ALIGNED(x) __attribute__((aligned(x))) -#endif -#ifndef __RESTRICT - #define __RESTRICT __restrict -#endif -#ifndef __COMPILER_BARRIER - #define __COMPILER_BARRIER() __ASM volatile("":::"memory") -#endif - -/* ######################### Startup and Lowlevel Init ######################## */ - -#ifndef __PROGRAM_START - -/** - \brief Initializes data and bss sections - \details This default implementations initialized all data and additional bss - sections relying on .copy.table and .zero.table specified properly - in the used linker script. - - */ -__STATIC_FORCEINLINE __NO_RETURN void __cmsis_start(void) -{ - extern void _start(void) __NO_RETURN; - - typedef struct { - uint32_t const* src; - uint32_t* dest; - uint32_t wlen; - } __copy_table_t; - - typedef struct { - uint32_t* dest; - uint32_t wlen; - } __zero_table_t; - - extern const __copy_table_t __copy_table_start__; - extern const __copy_table_t __copy_table_end__; - extern const __zero_table_t __zero_table_start__; - extern const __zero_table_t __zero_table_end__; - - for (__copy_table_t const* pTable = &__copy_table_start__; pTable < &__copy_table_end__; ++pTable) { - for(uint32_t i=0u; iwlen; ++i) { - pTable->dest[i] = pTable->src[i]; - } - } - - for (__zero_table_t const* pTable = &__zero_table_start__; pTable < &__zero_table_end__; ++pTable) { - for(uint32_t i=0u; iwlen; ++i) { - pTable->dest[i] = 0u; - } - } - - _start(); -} - -#define __PROGRAM_START __cmsis_start -#endif - -#ifndef __INITIAL_SP -#define __INITIAL_SP __StackTop -#endif - -#ifndef __STACK_LIMIT -#define __STACK_LIMIT __StackLimit -#endif - -#ifndef __VECTOR_TABLE -#define __VECTOR_TABLE __Vectors -#endif - -#ifndef __VECTOR_TABLE_ATTRIBUTE -#define __VECTOR_TABLE_ATTRIBUTE __attribute__((used, section(".vectors"))) -#endif - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) -#ifndef __STACK_SEAL -#define __STACK_SEAL __StackSeal -#endif - -#ifndef __TZ_STACK_SEAL_SIZE -#define __TZ_STACK_SEAL_SIZE 8U -#endif - -#ifndef __TZ_STACK_SEAL_VALUE -#define __TZ_STACK_SEAL_VALUE 0xFEF5EDA5FEF5EDA5ULL -#endif - - -__STATIC_FORCEINLINE void __TZ_set_STACKSEAL_S (uint32_t* stackTop) { - *((uint64_t *)stackTop) = __TZ_STACK_SEAL_VALUE; -} -#endif - - -/* ########################## Core Instruction Access ######################### */ -/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface - Access to dedicated instructions - @{ -*/ - -/* Define macros for porting to both thumb1 and thumb2. - * For thumb1, use low register (r0-r7), specified by constraint "l" - * Otherwise, use general registers, specified by constraint "r" */ -#if defined (__thumb__) && !defined (__thumb2__) -#define __CMSIS_GCC_OUT_REG(r) "=l" (r) -#define __CMSIS_GCC_RW_REG(r) "+l" (r) -#define __CMSIS_GCC_USE_REG(r) "l" (r) -#else -#define __CMSIS_GCC_OUT_REG(r) "=r" (r) -#define __CMSIS_GCC_RW_REG(r) "+r" (r) -#define __CMSIS_GCC_USE_REG(r) "r" (r) -#endif - -/** - \brief No Operation - \details No Operation does nothing. This instruction can be used for code alignment purposes. - */ -#define __NOP() __ASM volatile ("nop") - -/** - \brief Wait For Interrupt - \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. - */ -#define __WFI() __ASM volatile ("wfi":::"memory") - - -/** - \brief Wait For Event - \details Wait For Event is a hint instruction that permits the processor to enter - a low-power state until one of a number of events occurs. - */ -#define __WFE() __ASM volatile ("wfe":::"memory") - - -/** - \brief Send Event - \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. - */ -#define __SEV() __ASM volatile ("sev") - - -/** - \brief Instruction Synchronization Barrier - \details Instruction Synchronization Barrier flushes the pipeline in the processor, - so that all instructions following the ISB are fetched from cache or memory, - after the instruction has been completed. - */ -__STATIC_FORCEINLINE void __ISB(void) -{ - __ASM volatile ("isb 0xF":::"memory"); -} - - -/** - \brief Data Synchronization Barrier - \details Acts as a special kind of Data Memory Barrier. - It completes when all explicit memory accesses before this instruction complete. - */ -__STATIC_FORCEINLINE void __DSB(void) -{ - __ASM volatile ("dsb 0xF":::"memory"); -} - - -/** - \brief Data Memory Barrier - \details Ensures the apparent order of the explicit memory operations before - and after the instruction, without ensuring their completion. - */ -__STATIC_FORCEINLINE void __DMB(void) -{ - __ASM volatile ("dmb 0xF":::"memory"); -} - - -/** - \brief Reverse byte order (32 bit) - \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412. - \param [in] value Value to reverse - \return Reversed value - */ -__STATIC_FORCEINLINE uint32_t __REV(uint32_t value) -{ -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) - return __builtin_bswap32(value); -#else - uint32_t result; - - __ASM ("rev %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return result; -#endif -} - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856. - \param [in] value Value to reverse - \return Reversed value - */ -__STATIC_FORCEINLINE uint32_t __REV16(uint32_t value) -{ - uint32_t result; - - __ASM ("rev16 %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return result; -} - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000. - \param [in] value Value to reverse - \return Reversed value - */ -__STATIC_FORCEINLINE int16_t __REVSH(int16_t value) -{ -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - return (int16_t)__builtin_bswap16(value); -#else - int16_t result; - - __ASM ("revsh %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return result; -#endif -} - - -/** - \brief Rotate Right in unsigned value (32 bit) - \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. - \param [in] op1 Value to rotate - \param [in] op2 Number of Bits to rotate - \return Rotated value - */ -__STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2) -{ - op2 %= 32U; - if (op2 == 0U) - { - return op1; - } - return (op1 >> op2) | (op1 << (32U - op2)); -} - - -/** - \brief Breakpoint - \details Causes the processor to enter Debug state. - Debug tools can use this to investigate system state when the instruction at a particular address is reached. - \param [in] value is ignored by the processor. - If required, a debugger can use it to store additional information about the breakpoint. - */ -#define __BKPT(value) __ASM volatile ("bkpt "#value) - - -/** - \brief Reverse bit order of value - \details Reverses the bit order of the given value. - \param [in] value Value to reverse - \return Reversed value - */ -__STATIC_FORCEINLINE uint32_t __RBIT(uint32_t value) -{ - uint32_t result; - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) - __ASM ("rbit %0, %1" : "=r" (result) : "r" (value) ); -#else - uint32_t s = (4U /*sizeof(v)*/ * 8U) - 1U; /* extra shift needed at end */ - - result = value; /* r will be reversed bits of v; first get LSB of v */ - for (value >>= 1U; value != 0U; value >>= 1U) - { - result <<= 1U; - result |= value & 1U; - s--; - } - result <<= s; /* shift when v's highest bits are zero */ -#endif - return result; -} - - -/** - \brief Count leading zeros - \details Counts the number of leading zeros of a data value. - \param [in] value Value to count the leading zeros - \return number of leading zeros in value - */ -__STATIC_FORCEINLINE uint8_t __CLZ(uint32_t value) -{ - /* Even though __builtin_clz produces a CLZ instruction on ARM, formally - __builtin_clz(0) is undefined behaviour, so handle this case specially. - This guarantees ARM-compatible results if happening to compile on a non-ARM - target, and ensures the compiler doesn't decide to activate any - optimisations using the logic "value was passed to __builtin_clz, so it - is non-zero". - ARM GCC 7.3 and possibly earlier will optimise this test away, leaving a - single CLZ instruction. - */ - if (value == 0U) - { - return 32U; - } - return __builtin_clz(value); -} - - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) -/** - \brief LDR Exclusive (8 bit) - \details Executes a exclusive LDR instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -__STATIC_FORCEINLINE uint8_t __LDREXB(volatile uint8_t *addr) -{ - uint32_t result; - -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - __ASM volatile ("ldrexb %0, %1" : "=r" (result) : "Q" (*addr) ); -#else - /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not - accepted by assembler. So has to use following less efficient pattern. - */ - __ASM volatile ("ldrexb %0, [%1]" : "=r" (result) : "r" (addr) : "memory" ); -#endif - return ((uint8_t) result); /* Add explicit type cast here */ -} - - -/** - \brief LDR Exclusive (16 bit) - \details Executes a exclusive LDR instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -__STATIC_FORCEINLINE uint16_t __LDREXH(volatile uint16_t *addr) -{ - uint32_t result; - -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - __ASM volatile ("ldrexh %0, %1" : "=r" (result) : "Q" (*addr) ); -#else - /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not - accepted by assembler. So has to use following less efficient pattern. - */ - __ASM volatile ("ldrexh %0, [%1]" : "=r" (result) : "r" (addr) : "memory" ); -#endif - return ((uint16_t) result); /* Add explicit type cast here */ -} - - -/** - \brief LDR Exclusive (32 bit) - \details Executes a exclusive LDR instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -__STATIC_FORCEINLINE uint32_t __LDREXW(volatile uint32_t *addr) -{ - uint32_t result; - - __ASM volatile ("ldrex %0, %1" : "=r" (result) : "Q" (*addr) ); - return(result); -} - - -/** - \brief STR Exclusive (8 bit) - \details Executes a exclusive STR instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -__STATIC_FORCEINLINE uint32_t __STREXB(uint8_t value, volatile uint8_t *addr) -{ - uint32_t result; - - __ASM volatile ("strexb %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) ); - return(result); -} - - -/** - \brief STR Exclusive (16 bit) - \details Executes a exclusive STR instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -__STATIC_FORCEINLINE uint32_t __STREXH(uint16_t value, volatile uint16_t *addr) -{ - uint32_t result; - - __ASM volatile ("strexh %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) ); - return(result); -} - - -/** - \brief STR Exclusive (32 bit) - \details Executes a exclusive STR instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -__STATIC_FORCEINLINE uint32_t __STREXW(uint32_t value, volatile uint32_t *addr) -{ - uint32_t result; - - __ASM volatile ("strex %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" (value) ); - return(result); -} - - -/** - \brief Remove the exclusive lock - \details Removes the exclusive lock which is created by LDREX. - */ -__STATIC_FORCEINLINE void __CLREX(void) -{ - __ASM volatile ("clrex" ::: "memory"); -} - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) -/** - \brief Signed Saturate - \details Saturates a signed value. - \param [in] ARG1 Value to be saturated - \param [in] ARG2 Bit position to saturate to (1..32) - \return Saturated value - */ -#define __SSAT(ARG1, ARG2) \ -__extension__ \ -({ \ - int32_t __RES, __ARG1 = (ARG1); \ - __ASM volatile ("ssat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) : "cc" ); \ - __RES; \ - }) - - -/** - \brief Unsigned Saturate - \details Saturates an unsigned value. - \param [in] ARG1 Value to be saturated - \param [in] ARG2 Bit position to saturate to (0..31) - \return Saturated value - */ -#define __USAT(ARG1, ARG2) \ -__extension__ \ -({ \ - uint32_t __RES, __ARG1 = (ARG1); \ - __ASM volatile ("usat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) : "cc" ); \ - __RES; \ - }) - - -/** - \brief Rotate Right with Extend (32 bit) - \details Moves each bit of a bitstring right by one bit. - The carry input is shifted in at the left end of the bitstring. - \param [in] value Value to rotate - \return Rotated value - */ -__STATIC_FORCEINLINE uint32_t __RRX(uint32_t value) -{ - uint32_t result; - - __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return(result); -} - - -/** - \brief LDRT Unprivileged (8 bit) - \details Executes a Unprivileged LDRT instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -__STATIC_FORCEINLINE uint8_t __LDRBT(volatile uint8_t *ptr) -{ - uint32_t result; - -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) ); -#else - /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not - accepted by assembler. So has to use following less efficient pattern. - */ - __ASM volatile ("ldrbt %0, [%1]" : "=r" (result) : "r" (ptr) : "memory" ); -#endif - return ((uint8_t) result); /* Add explicit type cast here */ -} - - -/** - \brief LDRT Unprivileged (16 bit) - \details Executes a Unprivileged LDRT instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -__STATIC_FORCEINLINE uint16_t __LDRHT(volatile uint16_t *ptr) -{ - uint32_t result; - -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) ); -#else - /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not - accepted by assembler. So has to use following less efficient pattern. - */ - __ASM volatile ("ldrht %0, [%1]" : "=r" (result) : "r" (ptr) : "memory" ); -#endif - return ((uint16_t) result); /* Add explicit type cast here */ -} - - -/** - \brief LDRT Unprivileged (32 bit) - \details Executes a Unprivileged LDRT instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -__STATIC_FORCEINLINE uint32_t __LDRT(volatile uint32_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*ptr) ); - return(result); -} - - -/** - \brief STRT Unprivileged (8 bit) - \details Executes a Unprivileged STRT instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STRBT(uint8_t value, volatile uint8_t *ptr) -{ - __ASM volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); -} - - -/** - \brief STRT Unprivileged (16 bit) - \details Executes a Unprivileged STRT instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STRHT(uint16_t value, volatile uint16_t *ptr) -{ - __ASM volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); -} - - -/** - \brief STRT Unprivileged (32 bit) - \details Executes a Unprivileged STRT instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STRT(uint32_t value, volatile uint32_t *ptr) -{ - __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) ); -} - -#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ - -/** - \brief Signed Saturate - \details Saturates a signed value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (1..32) - \return Saturated value - */ -__STATIC_FORCEINLINE int32_t __SSAT(int32_t val, uint32_t sat) -{ - if ((sat >= 1U) && (sat <= 32U)) - { - const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); - const int32_t min = -1 - max ; - if (val > max) - { - return max; - } - else if (val < min) - { - return min; - } - } - return val; -} - -/** - \brief Unsigned Saturate - \details Saturates an unsigned value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value - */ -__STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat) -{ - if (sat <= 31U) - { - const uint32_t max = ((1U << sat) - 1U); - if (val > (int32_t)max) - { - return max; - } - else if (val < 0) - { - return 0U; - } - } - return (uint32_t)val; -} - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) -/** - \brief Load-Acquire (8 bit) - \details Executes a LDAB instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -__STATIC_FORCEINLINE uint8_t __LDAB(volatile uint8_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldab %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint8_t) result); -} - - -/** - \brief Load-Acquire (16 bit) - \details Executes a LDAH instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -__STATIC_FORCEINLINE uint16_t __LDAH(volatile uint16_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldah %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint16_t) result); -} - - -/** - \brief Load-Acquire (32 bit) - \details Executes a LDA instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -__STATIC_FORCEINLINE uint32_t __LDA(volatile uint32_t *ptr) -{ - uint32_t result; - - __ASM volatile ("lda %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return(result); -} - - -/** - \brief Store-Release (8 bit) - \details Executes a STLB instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STLB(uint8_t value, volatile uint8_t *ptr) -{ - __ASM volatile ("stlb %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); -} - - -/** - \brief Store-Release (16 bit) - \details Executes a STLH instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STLH(uint16_t value, volatile uint16_t *ptr) -{ - __ASM volatile ("stlh %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); -} - - -/** - \brief Store-Release (32 bit) - \details Executes a STL instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__STATIC_FORCEINLINE void __STL(uint32_t value, volatile uint32_t *ptr) -{ - __ASM volatile ("stl %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); -} - - -/** - \brief Load-Acquire Exclusive (8 bit) - \details Executes a LDAB exclusive instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -__STATIC_FORCEINLINE uint8_t __LDAEXB(volatile uint8_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldaexb %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint8_t) result); -} - - -/** - \brief Load-Acquire Exclusive (16 bit) - \details Executes a LDAH exclusive instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -__STATIC_FORCEINLINE uint16_t __LDAEXH(volatile uint16_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldaexh %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint16_t) result); -} - - -/** - \brief Load-Acquire Exclusive (32 bit) - \details Executes a LDA exclusive instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -__STATIC_FORCEINLINE uint32_t __LDAEX(volatile uint32_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldaex %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return(result); -} - - -/** - \brief Store-Release Exclusive (8 bit) - \details Executes a STLB exclusive instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -__STATIC_FORCEINLINE uint32_t __STLEXB(uint8_t value, volatile uint8_t *ptr) -{ - uint32_t result; - - __ASM volatile ("stlexb %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); - return(result); -} - - -/** - \brief Store-Release Exclusive (16 bit) - \details Executes a STLH exclusive instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -__STATIC_FORCEINLINE uint32_t __STLEXH(uint16_t value, volatile uint16_t *ptr) -{ - uint32_t result; - - __ASM volatile ("stlexh %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); - return(result); -} - - -/** - \brief Store-Release Exclusive (32 bit) - \details Executes a STL exclusive instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -__STATIC_FORCEINLINE uint32_t __STLEX(uint32_t value, volatile uint32_t *ptr) -{ - uint32_t result; - - __ASM volatile ("stlex %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); - return(result); -} - -#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ - -/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ - - -/* ########################### Core Function Access ########################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions - @{ - */ - -/** - \brief Enable IRQ Interrupts - \details Enables IRQ interrupts by clearing special-purpose register PRIMASK. - Can only be executed in Privileged modes. - */ -__STATIC_FORCEINLINE void __enable_irq(void) -{ - __ASM volatile ("cpsie i" : : : "memory"); -} - - -/** - \brief Disable IRQ Interrupts - \details Disables IRQ interrupts by setting special-purpose register PRIMASK. - Can only be executed in Privileged modes. - */ -__STATIC_FORCEINLINE void __disable_irq(void) -{ - __ASM volatile ("cpsid i" : : : "memory"); -} - - -/** - \brief Get Control Register - \details Returns the content of the Control Register. - \return Control Register value - */ -__STATIC_FORCEINLINE uint32_t __get_CONTROL(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, control" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Control Register (non-secure) - \details Returns the content of the non-secure Control Register when in secure mode. - \return non-secure Control Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_CONTROL_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, control_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Control Register - \details Writes the given value to the Control Register. - \param [in] control Control Register value to set - */ -__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control) -{ - __ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); - __ISB(); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Control Register (non-secure) - \details Writes the given value to the non-secure Control Register when in secure state. - \param [in] control Control Register value to set - */ -__STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control) -{ - __ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory"); - __ISB(); -} -#endif - - -/** - \brief Get IPSR Register - \details Returns the content of the IPSR Register. - \return IPSR Register value - */ -__STATIC_FORCEINLINE uint32_t __get_IPSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, ipsr" : "=r" (result) ); - return(result); -} - - -/** - \brief Get APSR Register - \details Returns the content of the APSR Register. - \return APSR Register value - */ -__STATIC_FORCEINLINE uint32_t __get_APSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, apsr" : "=r" (result) ); - return(result); -} - - -/** - \brief Get xPSR Register - \details Returns the content of the xPSR Register. - \return xPSR Register value - */ -__STATIC_FORCEINLINE uint32_t __get_xPSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, xpsr" : "=r" (result) ); - return(result); -} - - -/** - \brief Get Process Stack Pointer - \details Returns the current value of the Process Stack Pointer (PSP). - \return PSP Register value - */ -__STATIC_FORCEINLINE uint32_t __get_PSP(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, psp" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Process Stack Pointer (non-secure) - \details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state. - \return PSP Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PSP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, psp_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Process Stack Pointer - \details Assigns the given value to the Process Stack Pointer (PSP). - \param [in] topOfProcStack Process Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack) -{ - __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : ); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Process Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state. - \param [in] topOfProcStack Process Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack) -{ - __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : ); -} -#endif - - -/** - \brief Get Main Stack Pointer - \details Returns the current value of the Main Stack Pointer (MSP). - \return MSP Register value - */ -__STATIC_FORCEINLINE uint32_t __get_MSP(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, msp" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Main Stack Pointer (non-secure) - \details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state. - \return MSP Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_MSP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, msp_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Main Stack Pointer - \details Assigns the given value to the Main Stack Pointer (MSP). - \param [in] topOfMainStack Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack) -{ - __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : ); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Main Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state. - \param [in] topOfMainStack Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack) -{ - __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : ); -} -#endif - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Stack Pointer (non-secure) - \details Returns the current value of the non-secure Stack Pointer (SP) when in secure state. - \return SP Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_SP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, sp_ns" : "=r" (result) ); - return(result); -} - - -/** - \brief Set Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Stack Pointer (SP) when in secure state. - \param [in] topOfStack Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_SP_NS(uint32_t topOfStack) -{ - __ASM volatile ("MSR sp_ns, %0" : : "r" (topOfStack) : ); -} -#endif - - -/** - \brief Get Priority Mask - \details Returns the current state of the priority mask bit from the Priority Mask Register. - \return Priority Mask value - */ -__STATIC_FORCEINLINE uint32_t __get_PRIMASK(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, primask" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Priority Mask (non-secure) - \details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state. - \return Priority Mask value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PRIMASK_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, primask_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Priority Mask - \details Assigns the given value to the Priority Mask Register. - \param [in] priMask Priority Mask - */ -__STATIC_FORCEINLINE void __set_PRIMASK(uint32_t priMask) -{ - __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Priority Mask (non-secure) - \details Assigns the given value to the non-secure Priority Mask Register when in secure state. - \param [in] priMask Priority Mask - */ -__STATIC_FORCEINLINE void __TZ_set_PRIMASK_NS(uint32_t priMask) -{ - __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory"); -} -#endif - - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) -/** - \brief Enable FIQ - \details Enables FIQ interrupts by clearing special-purpose register FAULTMASK. - Can only be executed in Privileged modes. - */ -__STATIC_FORCEINLINE void __enable_fault_irq(void) -{ - __ASM volatile ("cpsie f" : : : "memory"); -} - - -/** - \brief Disable FIQ - \details Disables FIQ interrupts by setting special-purpose register FAULTMASK. - Can only be executed in Privileged modes. - */ -__STATIC_FORCEINLINE void __disable_fault_irq(void) -{ - __ASM volatile ("cpsid f" : : : "memory"); -} - - -/** - \brief Get Base Priority - \details Returns the current value of the Base Priority register. - \return Base Priority register value - */ -__STATIC_FORCEINLINE uint32_t __get_BASEPRI(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, basepri" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Base Priority (non-secure) - \details Returns the current value of the non-secure Base Priority register when in secure state. - \return Base Priority register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_BASEPRI_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, basepri_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Base Priority - \details Assigns the given value to the Base Priority register. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __set_BASEPRI(uint32_t basePri) -{ - __ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory"); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Base Priority (non-secure) - \details Assigns the given value to the non-secure Base Priority register when in secure state. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __TZ_set_BASEPRI_NS(uint32_t basePri) -{ - __ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "memory"); -} -#endif - - -/** - \brief Set Base Priority with condition - \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, - or the new value increases the BASEPRI priority level. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __set_BASEPRI_MAX(uint32_t basePri) -{ - __ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory"); -} - - -/** - \brief Get Fault Mask - \details Returns the current value of the Fault Mask register. - \return Fault Mask register value - */ -__STATIC_FORCEINLINE uint32_t __get_FAULTMASK(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); - return(result); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Fault Mask (non-secure) - \details Returns the current value of the non-secure Fault Mask register when in secure state. - \return Fault Mask register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_FAULTMASK_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, faultmask_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Fault Mask - \details Assigns the given value to the Fault Mask register. - \param [in] faultMask Fault Mask value to set - */ -__STATIC_FORCEINLINE void __set_FAULTMASK(uint32_t faultMask) -{ - __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Fault Mask (non-secure) - \details Assigns the given value to the non-secure Fault Mask register when in secure state. - \param [in] faultMask Fault Mask value to set - */ -__STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) -{ - __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory"); -} -#endif - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ - - -#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) - -/** - \brief Get Process Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always in non-secure - mode. - - \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). - \return PSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __get_PSPLIM(void) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, psplim" : "=r" (result) ); - return result; -#endif -} - -#if (defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Process Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always. - - \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \return PSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS(void) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, psplim_ns" : "=r" (result) ); - return result; -#endif -} -#endif - - -/** - \brief Set Process Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored in non-secure - mode. - - \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set - */ -__STATIC_FORCEINLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - (void)ProcStackPtrLimit; -#else - __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit)); -#endif -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Process Stack Pointer (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored. - - \details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set - */ -__STATIC_FORCEINLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - (void)ProcStackPtrLimit; -#else - __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit)); -#endif -} -#endif - - -/** - \brief Get Main Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always in non-secure - mode. - - \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). - \return MSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __get_MSPLIM(void) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, msplim" : "=r" (result) ); - return result; -#endif -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Main Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always. - - \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. - \return MSPLIM Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS(void) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) ); - return result; -#endif -} -#endif - - -/** - \brief Set Main Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored in non-secure - mode. - - \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). - \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set - */ -__STATIC_FORCEINLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - (void)MainStackPtrLimit; -#else - __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit)); -#endif -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Main Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored. - - \details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state. - \param [in] MainStackPtrLimit Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) -{ -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - (void)MainStackPtrLimit; -#else - __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit)); -#endif -} -#endif - -#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ - - -/** - \brief Get FPSCR - \details Returns the current value of the Floating Point Status/Control register. - \return Floating Point Status/Control register value - */ -__STATIC_FORCEINLINE uint32_t __get_FPSCR(void) -{ -#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) -#if __has_builtin(__builtin_arm_get_fpscr) -// Re-enable using built-in when GCC has been fixed -// || (__GNUC__ > 7) || (__GNUC__ == 7 && __GNUC_MINOR__ >= 2) - /* see https://gcc.gnu.org/ml/gcc-patches/2017-04/msg00443.html */ - return __builtin_arm_get_fpscr(); -#else - uint32_t result; - - __ASM volatile ("VMRS %0, fpscr" : "=r" (result) ); - return(result); -#endif -#else - return(0U); -#endif -} - - -/** - \brief Set FPSCR - \details Assigns the given value to the Floating Point Status/Control register. - \param [in] fpscr Floating Point Status/Control value to set - */ -__STATIC_FORCEINLINE void __set_FPSCR(uint32_t fpscr) -{ -#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) -#if __has_builtin(__builtin_arm_set_fpscr) -// Re-enable using built-in when GCC has been fixed -// || (__GNUC__ > 7) || (__GNUC__ == 7 && __GNUC_MINOR__ >= 2) - /* see https://gcc.gnu.org/ml/gcc-patches/2017-04/msg00443.html */ - __builtin_arm_set_fpscr(fpscr); -#else - __ASM volatile ("VMSR fpscr, %0" : : "r" (fpscr) : "vfpcc", "memory"); -#endif -#else - (void)fpscr; -#endif -} - - -/*@} end of CMSIS_Core_RegAccFunctions */ - - -/* ################### Compiler specific Intrinsics ########################### */ -/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics - Access to dedicated SIMD instructions - @{ -*/ - -#if (defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1)) - -__STATIC_FORCEINLINE uint32_t __SADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("qadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("shadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uqadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uhadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - - -__STATIC_FORCEINLINE uint32_t __SSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("ssub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("qsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("shsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __USUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uqsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uhsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - - -__STATIC_FORCEINLINE uint32_t __SADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("qadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("shadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uqadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uhadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("ssub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("qsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("shsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __USUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uqsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uhsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("qasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("shasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uqasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uhasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("ssax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __QSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("qsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SHSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("shsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __USAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UQSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uqsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UHSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uhsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __USAD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("usad8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __USADA8(uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM ("usada8 %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -#define __SSAT16(ARG1, ARG2) \ -__extension__ \ -({ \ - int32_t __RES, __ARG1 = (ARG1); \ - __ASM volatile ("ssat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) : "cc" ); \ - __RES; \ - }) - -#define __USAT16(ARG1, ARG2) \ -__extension__ \ -({ \ - uint32_t __RES, __ARG1 = (ARG1); \ - __ASM volatile ("usat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) : "cc" ); \ - __RES; \ - }) - -__STATIC_FORCEINLINE uint32_t __UXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM ("uxtb16 %0, %1" : "=r" (result) : "r" (op1)); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __UXTAB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("uxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM ("sxtb16 %0, %1" : "=r" (result) : "r" (op1)); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SXTB16_RORn(uint32_t op1, uint32_t rotate) -{ - uint32_t result; - if (__builtin_constant_p(rotate) && ((rotate == 8U) || (rotate == 16U) || (rotate == 24U))) { - __ASM volatile ("sxtb16 %0, %1, ROR %2" : "=r" (result) : "r" (op1), "i" (rotate) ); - } else { - result = __SXTB16(__ROR(op1, rotate)) ; - } - return result; -} - -__STATIC_FORCEINLINE uint32_t __SXTAB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM ("sxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SXTAB16_RORn(uint32_t op1, uint32_t op2, uint32_t rotate) -{ - uint32_t result; - if (__builtin_constant_p(rotate) && ((rotate == 8U) || (rotate == 16U) || (rotate == 24U))) { - __ASM volatile ("sxtab16 %0, %1, %2, ROR %3" : "=r" (result) : "r" (op1) , "r" (op2) , "i" (rotate)); - } else { - result = __SXTAB16(op1, __ROR(op2, rotate)); - } - return result; -} - - -__STATIC_FORCEINLINE uint32_t __SMUAD (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smuad %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMUADX (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smuadx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMLAD (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smlad %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMLADX (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smladx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__STATIC_FORCEINLINE uint64_t __SMLALD (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__STATIC_FORCEINLINE uint64_t __SMLALDX (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__STATIC_FORCEINLINE uint32_t __SMUSD (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smusd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMUSDX (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smusdx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMLSD (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smlsd %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__STATIC_FORCEINLINE uint32_t __SMLSDX (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smlsdx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__STATIC_FORCEINLINE uint64_t __SMLSLD (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__STATIC_FORCEINLINE uint64_t __SMLSLDX (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__STATIC_FORCEINLINE uint32_t __SEL (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sel %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE int32_t __QADD( int32_t op1, int32_t op2) -{ - int32_t result; - - __ASM volatile ("qadd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__STATIC_FORCEINLINE int32_t __QSUB( int32_t op1, int32_t op2) -{ - int32_t result; - - __ASM volatile ("qsub %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - - -#define __PKHBT(ARG1,ARG2,ARG3) \ -__extension__ \ -({ \ - uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \ - __ASM ("pkhbt %0, %1, %2, lsl %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \ - __RES; \ - }) - -#define __PKHTB(ARG1,ARG2,ARG3) \ -__extension__ \ -({ \ - uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \ - if (ARG3 == 0) \ - __ASM ("pkhtb %0, %1, %2" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2) ); \ - else \ - __ASM ("pkhtb %0, %1, %2, asr %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \ - __RES; \ - }) - - -__STATIC_FORCEINLINE int32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3) -{ - int32_t result; - - __ASM ("smmla %0, %1, %2, %3" : "=r" (result): "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -#endif /* (__ARM_FEATURE_DSP == 1) */ -/*@} end of group CMSIS_SIMD_intrinsics */ - - -#pragma GCC diagnostic pop - -#endif /* __CMSIS_GCC_H */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/CMSIS/Core/Include/cmsis_iccarm.h b/bsp/nxp/mcx/mcxn/Libraries/CMSIS/Core/Include/cmsis_iccarm.h deleted file mode 100644 index 65b824b009c..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/CMSIS/Core/Include/cmsis_iccarm.h +++ /dev/null @@ -1,1002 +0,0 @@ -/**************************************************************************//** - * @file cmsis_iccarm.h - * @brief CMSIS compiler ICCARM (IAR Compiler for Arm) header file - * @version V5.3.0 - * @date 14. April 2021 - ******************************************************************************/ - -//------------------------------------------------------------------------------ -// -// Copyright (c) 2017-2021 IAR Systems -// Copyright (c) 2017-2021 Arm Limited. All rights reserved. -// -// SPDX-License-Identifier: Apache-2.0 -// -// 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 __CMSIS_ICCARM_H__ -#define __CMSIS_ICCARM_H__ - -#ifndef __ICCARM__ - #error This file should only be compiled by ICCARM -#endif - -#pragma system_include - -#define __IAR_FT _Pragma("inline=forced") __intrinsic - -#if (__VER__ >= 8000000) - #define __ICCARM_V8 1 -#else - #define __ICCARM_V8 0 -#endif - -#ifndef __ALIGNED - #if __ICCARM_V8 - #define __ALIGNED(x) __attribute__((aligned(x))) - #elif (__VER__ >= 7080000) - /* Needs IAR language extensions */ - #define __ALIGNED(x) __attribute__((aligned(x))) - #else - #warning No compiler specific solution for __ALIGNED.__ALIGNED is ignored. - #define __ALIGNED(x) - #endif -#endif - - -/* Define compiler macros for CPU architecture, used in CMSIS 5. - */ -#if __ARM_ARCH_6M__ || __ARM_ARCH_7M__ || __ARM_ARCH_7EM__ || __ARM_ARCH_8M_BASE__ || __ARM_ARCH_8M_MAIN__ -/* Macros already defined */ -#else - #if defined(__ARM8M_MAINLINE__) || defined(__ARM8EM_MAINLINE__) - #define __ARM_ARCH_8M_MAIN__ 1 - #elif defined(__ARM8M_BASELINE__) - #define __ARM_ARCH_8M_BASE__ 1 - #elif defined(__ARM_ARCH_PROFILE) && __ARM_ARCH_PROFILE == 'M' - #if __ARM_ARCH == 6 - #define __ARM_ARCH_6M__ 1 - #elif __ARM_ARCH == 7 - #if __ARM_FEATURE_DSP - #define __ARM_ARCH_7EM__ 1 - #else - #define __ARM_ARCH_7M__ 1 - #endif - #endif /* __ARM_ARCH */ - #endif /* __ARM_ARCH_PROFILE == 'M' */ -#endif - -/* Alternativ core deduction for older ICCARM's */ -#if !defined(__ARM_ARCH_6M__) && !defined(__ARM_ARCH_7M__) && !defined(__ARM_ARCH_7EM__) && \ - !defined(__ARM_ARCH_8M_BASE__) && !defined(__ARM_ARCH_8M_MAIN__) - #if defined(__ARM6M__) && (__CORE__ == __ARM6M__) - #define __ARM_ARCH_6M__ 1 - #elif defined(__ARM7M__) && (__CORE__ == __ARM7M__) - #define __ARM_ARCH_7M__ 1 - #elif defined(__ARM7EM__) && (__CORE__ == __ARM7EM__) - #define __ARM_ARCH_7EM__ 1 - #elif defined(__ARM8M_BASELINE__) && (__CORE == __ARM8M_BASELINE__) - #define __ARM_ARCH_8M_BASE__ 1 - #elif defined(__ARM8M_MAINLINE__) && (__CORE == __ARM8M_MAINLINE__) - #define __ARM_ARCH_8M_MAIN__ 1 - #elif defined(__ARM8EM_MAINLINE__) && (__CORE == __ARM8EM_MAINLINE__) - #define __ARM_ARCH_8M_MAIN__ 1 - #else - #error "Unknown target." - #endif -#endif - - - -#if defined(__ARM_ARCH_6M__) && __ARM_ARCH_6M__==1 - #define __IAR_M0_FAMILY 1 -#elif defined(__ARM_ARCH_8M_BASE__) && __ARM_ARCH_8M_BASE__==1 - #define __IAR_M0_FAMILY 1 -#else - #define __IAR_M0_FAMILY 0 -#endif - - -#ifndef __ASM - #define __ASM __asm -#endif - -#ifndef __COMPILER_BARRIER - #define __COMPILER_BARRIER() __ASM volatile("":::"memory") -#endif - -#ifndef __INLINE - #define __INLINE inline -#endif - -#ifndef __NO_RETURN - #if __ICCARM_V8 - #define __NO_RETURN __attribute__((__noreturn__)) - #else - #define __NO_RETURN _Pragma("object_attribute=__noreturn") - #endif -#endif - -#ifndef __PACKED - #if __ICCARM_V8 - #define __PACKED __attribute__((packed, aligned(1))) - #else - /* Needs IAR language extensions */ - #define __PACKED __packed - #endif -#endif - -#ifndef __PACKED_STRUCT - #if __ICCARM_V8 - #define __PACKED_STRUCT struct __attribute__((packed, aligned(1))) - #else - /* Needs IAR language extensions */ - #define __PACKED_STRUCT __packed struct - #endif -#endif - -#ifndef __PACKED_UNION - #if __ICCARM_V8 - #define __PACKED_UNION union __attribute__((packed, aligned(1))) - #else - /* Needs IAR language extensions */ - #define __PACKED_UNION __packed union - #endif -#endif - -#ifndef __RESTRICT - #if __ICCARM_V8 - #define __RESTRICT __restrict - #else - /* Needs IAR language extensions */ - #define __RESTRICT restrict - #endif -#endif - -#ifndef __STATIC_INLINE - #define __STATIC_INLINE static inline -#endif - -#ifndef __FORCEINLINE - #define __FORCEINLINE _Pragma("inline=forced") -#endif - -#ifndef __STATIC_FORCEINLINE - #define __STATIC_FORCEINLINE __FORCEINLINE __STATIC_INLINE -#endif - -#ifndef __UNALIGNED_UINT16_READ -#pragma language=save -#pragma language=extended -__IAR_FT uint16_t __iar_uint16_read(void const *ptr) -{ - return *(__packed uint16_t*)(ptr); -} -#pragma language=restore -#define __UNALIGNED_UINT16_READ(PTR) __iar_uint16_read(PTR) -#endif - - -#ifndef __UNALIGNED_UINT16_WRITE -#pragma language=save -#pragma language=extended -__IAR_FT void __iar_uint16_write(void const *ptr, uint16_t val) -{ - *(__packed uint16_t*)(ptr) = val;; -} -#pragma language=restore -#define __UNALIGNED_UINT16_WRITE(PTR,VAL) __iar_uint16_write(PTR,VAL) -#endif - -#ifndef __UNALIGNED_UINT32_READ -#pragma language=save -#pragma language=extended -__IAR_FT uint32_t __iar_uint32_read(void const *ptr) -{ - return *(__packed uint32_t*)(ptr); -} -#pragma language=restore -#define __UNALIGNED_UINT32_READ(PTR) __iar_uint32_read(PTR) -#endif - -#ifndef __UNALIGNED_UINT32_WRITE -#pragma language=save -#pragma language=extended -__IAR_FT void __iar_uint32_write(void const *ptr, uint32_t val) -{ - *(__packed uint32_t*)(ptr) = val;; -} -#pragma language=restore -#define __UNALIGNED_UINT32_WRITE(PTR,VAL) __iar_uint32_write(PTR,VAL) -#endif - -#ifndef __UNALIGNED_UINT32 /* deprecated */ -#pragma language=save -#pragma language=extended -__packed struct __iar_u32 { uint32_t v; }; -#pragma language=restore -#define __UNALIGNED_UINT32(PTR) (((struct __iar_u32 *)(PTR))->v) -#endif - -#ifndef __USED - #if __ICCARM_V8 - #define __USED __attribute__((used)) - #else - #define __USED _Pragma("__root") - #endif -#endif - -#undef __WEAK /* undo the definition from DLib_Defaults.h */ -#ifndef __WEAK - #if __ICCARM_V8 - #define __WEAK __attribute__((weak)) - #else - #define __WEAK _Pragma("__weak") - #endif -#endif - -#ifndef __PROGRAM_START -#define __PROGRAM_START __iar_program_start -#endif - -#ifndef __INITIAL_SP -#define __INITIAL_SP CSTACK$$Limit -#endif - -#ifndef __STACK_LIMIT -#define __STACK_LIMIT CSTACK$$Base -#endif - -#ifndef __VECTOR_TABLE -#define __VECTOR_TABLE __vector_table -#endif - -#ifndef __VECTOR_TABLE_ATTRIBUTE -#define __VECTOR_TABLE_ATTRIBUTE @".intvec" -#endif - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) -#ifndef __STACK_SEAL -#define __STACK_SEAL STACKSEAL$$Base -#endif - -#ifndef __TZ_STACK_SEAL_SIZE -#define __TZ_STACK_SEAL_SIZE 8U -#endif - -#ifndef __TZ_STACK_SEAL_VALUE -#define __TZ_STACK_SEAL_VALUE 0xFEF5EDA5FEF5EDA5ULL -#endif - -__STATIC_FORCEINLINE void __TZ_set_STACKSEAL_S (uint32_t* stackTop) { - *((uint64_t *)stackTop) = __TZ_STACK_SEAL_VALUE; -} -#endif - -#ifndef __ICCARM_INTRINSICS_VERSION__ - #define __ICCARM_INTRINSICS_VERSION__ 0 -#endif - -#if __ICCARM_INTRINSICS_VERSION__ == 2 - - #if defined(__CLZ) - #undef __CLZ - #endif - #if defined(__REVSH) - #undef __REVSH - #endif - #if defined(__RBIT) - #undef __RBIT - #endif - #if defined(__SSAT) - #undef __SSAT - #endif - #if defined(__USAT) - #undef __USAT - #endif - - #include "iccarm_builtin.h" - - #define __disable_fault_irq __iar_builtin_disable_fiq - #define __disable_irq __iar_builtin_disable_interrupt - #define __enable_fault_irq __iar_builtin_enable_fiq - #define __enable_irq __iar_builtin_enable_interrupt - #define __arm_rsr __iar_builtin_rsr - #define __arm_wsr __iar_builtin_wsr - - - #define __get_APSR() (__arm_rsr("APSR")) - #define __get_BASEPRI() (__arm_rsr("BASEPRI")) - #define __get_CONTROL() (__arm_rsr("CONTROL")) - #define __get_FAULTMASK() (__arm_rsr("FAULTMASK")) - - #if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) - #define __get_FPSCR() (__arm_rsr("FPSCR")) - #define __set_FPSCR(VALUE) (__arm_wsr("FPSCR", (VALUE))) - #else - #define __get_FPSCR() ( 0 ) - #define __set_FPSCR(VALUE) ((void)VALUE) - #endif - - #define __get_IPSR() (__arm_rsr("IPSR")) - #define __get_MSP() (__arm_rsr("MSP")) - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - #define __get_MSPLIM() (0U) - #else - #define __get_MSPLIM() (__arm_rsr("MSPLIM")) - #endif - #define __get_PRIMASK() (__arm_rsr("PRIMASK")) - #define __get_PSP() (__arm_rsr("PSP")) - - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - #define __get_PSPLIM() (0U) - #else - #define __get_PSPLIM() (__arm_rsr("PSPLIM")) - #endif - - #define __get_xPSR() (__arm_rsr("xPSR")) - - #define __set_BASEPRI(VALUE) (__arm_wsr("BASEPRI", (VALUE))) - #define __set_BASEPRI_MAX(VALUE) (__arm_wsr("BASEPRI_MAX", (VALUE))) - -__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control) -{ - __arm_wsr("CONTROL", control); - __iar_builtin_ISB(); -} - - #define __set_FAULTMASK(VALUE) (__arm_wsr("FAULTMASK", (VALUE))) - #define __set_MSP(VALUE) (__arm_wsr("MSP", (VALUE))) - - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - #define __set_MSPLIM(VALUE) ((void)(VALUE)) - #else - #define __set_MSPLIM(VALUE) (__arm_wsr("MSPLIM", (VALUE))) - #endif - #define __set_PRIMASK(VALUE) (__arm_wsr("PRIMASK", (VALUE))) - #define __set_PSP(VALUE) (__arm_wsr("PSP", (VALUE))) - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - #define __set_PSPLIM(VALUE) ((void)(VALUE)) - #else - #define __set_PSPLIM(VALUE) (__arm_wsr("PSPLIM", (VALUE))) - #endif - - #define __TZ_get_CONTROL_NS() (__arm_rsr("CONTROL_NS")) - -__STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control) -{ - __arm_wsr("CONTROL_NS", control); - __iar_builtin_ISB(); -} - - #define __TZ_get_PSP_NS() (__arm_rsr("PSP_NS")) - #define __TZ_set_PSP_NS(VALUE) (__arm_wsr("PSP_NS", (VALUE))) - #define __TZ_get_MSP_NS() (__arm_rsr("MSP_NS")) - #define __TZ_set_MSP_NS(VALUE) (__arm_wsr("MSP_NS", (VALUE))) - #define __TZ_get_SP_NS() (__arm_rsr("SP_NS")) - #define __TZ_set_SP_NS(VALUE) (__arm_wsr("SP_NS", (VALUE))) - #define __TZ_get_PRIMASK_NS() (__arm_rsr("PRIMASK_NS")) - #define __TZ_set_PRIMASK_NS(VALUE) (__arm_wsr("PRIMASK_NS", (VALUE))) - #define __TZ_get_BASEPRI_NS() (__arm_rsr("BASEPRI_NS")) - #define __TZ_set_BASEPRI_NS(VALUE) (__arm_wsr("BASEPRI_NS", (VALUE))) - #define __TZ_get_FAULTMASK_NS() (__arm_rsr("FAULTMASK_NS")) - #define __TZ_set_FAULTMASK_NS(VALUE)(__arm_wsr("FAULTMASK_NS", (VALUE))) - - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - #define __TZ_get_PSPLIM_NS() (0U) - #define __TZ_set_PSPLIM_NS(VALUE) ((void)(VALUE)) - #else - #define __TZ_get_PSPLIM_NS() (__arm_rsr("PSPLIM_NS")) - #define __TZ_set_PSPLIM_NS(VALUE) (__arm_wsr("PSPLIM_NS", (VALUE))) - #endif - - #define __TZ_get_MSPLIM_NS() (__arm_rsr("MSPLIM_NS")) - #define __TZ_set_MSPLIM_NS(VALUE) (__arm_wsr("MSPLIM_NS", (VALUE))) - - #define __NOP __iar_builtin_no_operation - - #define __CLZ __iar_builtin_CLZ - #define __CLREX __iar_builtin_CLREX - - #define __DMB __iar_builtin_DMB - #define __DSB __iar_builtin_DSB - #define __ISB __iar_builtin_ISB - - #define __LDREXB __iar_builtin_LDREXB - #define __LDREXH __iar_builtin_LDREXH - #define __LDREXW __iar_builtin_LDREX - - #define __RBIT __iar_builtin_RBIT - #define __REV __iar_builtin_REV - #define __REV16 __iar_builtin_REV16 - - __IAR_FT int16_t __REVSH(int16_t val) - { - return (int16_t) __iar_builtin_REVSH(val); - } - - #define __ROR __iar_builtin_ROR - #define __RRX __iar_builtin_RRX - - #define __SEV __iar_builtin_SEV - - #if !__IAR_M0_FAMILY - #define __SSAT __iar_builtin_SSAT - #endif - - #define __STREXB __iar_builtin_STREXB - #define __STREXH __iar_builtin_STREXH - #define __STREXW __iar_builtin_STREX - - #if !__IAR_M0_FAMILY - #define __USAT __iar_builtin_USAT - #endif - - #define __WFE __iar_builtin_WFE - #define __WFI __iar_builtin_WFI - - #if __ARM_MEDIA__ - #define __SADD8 __iar_builtin_SADD8 - #define __QADD8 __iar_builtin_QADD8 - #define __SHADD8 __iar_builtin_SHADD8 - #define __UADD8 __iar_builtin_UADD8 - #define __UQADD8 __iar_builtin_UQADD8 - #define __UHADD8 __iar_builtin_UHADD8 - #define __SSUB8 __iar_builtin_SSUB8 - #define __QSUB8 __iar_builtin_QSUB8 - #define __SHSUB8 __iar_builtin_SHSUB8 - #define __USUB8 __iar_builtin_USUB8 - #define __UQSUB8 __iar_builtin_UQSUB8 - #define __UHSUB8 __iar_builtin_UHSUB8 - #define __SADD16 __iar_builtin_SADD16 - #define __QADD16 __iar_builtin_QADD16 - #define __SHADD16 __iar_builtin_SHADD16 - #define __UADD16 __iar_builtin_UADD16 - #define __UQADD16 __iar_builtin_UQADD16 - #define __UHADD16 __iar_builtin_UHADD16 - #define __SSUB16 __iar_builtin_SSUB16 - #define __QSUB16 __iar_builtin_QSUB16 - #define __SHSUB16 __iar_builtin_SHSUB16 - #define __USUB16 __iar_builtin_USUB16 - #define __UQSUB16 __iar_builtin_UQSUB16 - #define __UHSUB16 __iar_builtin_UHSUB16 - #define __SASX __iar_builtin_SASX - #define __QASX __iar_builtin_QASX - #define __SHASX __iar_builtin_SHASX - #define __UASX __iar_builtin_UASX - #define __UQASX __iar_builtin_UQASX - #define __UHASX __iar_builtin_UHASX - #define __SSAX __iar_builtin_SSAX - #define __QSAX __iar_builtin_QSAX - #define __SHSAX __iar_builtin_SHSAX - #define __USAX __iar_builtin_USAX - #define __UQSAX __iar_builtin_UQSAX - #define __UHSAX __iar_builtin_UHSAX - #define __USAD8 __iar_builtin_USAD8 - #define __USADA8 __iar_builtin_USADA8 - #define __SSAT16 __iar_builtin_SSAT16 - #define __USAT16 __iar_builtin_USAT16 - #define __UXTB16 __iar_builtin_UXTB16 - #define __UXTAB16 __iar_builtin_UXTAB16 - #define __SXTB16 __iar_builtin_SXTB16 - #define __SXTAB16 __iar_builtin_SXTAB16 - #define __SMUAD __iar_builtin_SMUAD - #define __SMUADX __iar_builtin_SMUADX - #define __SMMLA __iar_builtin_SMMLA - #define __SMLAD __iar_builtin_SMLAD - #define __SMLADX __iar_builtin_SMLADX - #define __SMLALD __iar_builtin_SMLALD - #define __SMLALDX __iar_builtin_SMLALDX - #define __SMUSD __iar_builtin_SMUSD - #define __SMUSDX __iar_builtin_SMUSDX - #define __SMLSD __iar_builtin_SMLSD - #define __SMLSDX __iar_builtin_SMLSDX - #define __SMLSLD __iar_builtin_SMLSLD - #define __SMLSLDX __iar_builtin_SMLSLDX - #define __SEL __iar_builtin_SEL - #define __QADD __iar_builtin_QADD - #define __QSUB __iar_builtin_QSUB - #define __PKHBT __iar_builtin_PKHBT - #define __PKHTB __iar_builtin_PKHTB - #endif - -#else /* __ICCARM_INTRINSICS_VERSION__ == 2 */ - - #if __IAR_M0_FAMILY - /* Avoid clash between intrinsics.h and arm_math.h when compiling for Cortex-M0. */ - #define __CLZ __cmsis_iar_clz_not_active - #define __SSAT __cmsis_iar_ssat_not_active - #define __USAT __cmsis_iar_usat_not_active - #define __RBIT __cmsis_iar_rbit_not_active - #define __get_APSR __cmsis_iar_get_APSR_not_active - #endif - - - #if (!((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) )) - #define __get_FPSCR __cmsis_iar_get_FPSR_not_active - #define __set_FPSCR __cmsis_iar_set_FPSR_not_active - #endif - - #ifdef __INTRINSICS_INCLUDED - #error intrinsics.h is already included previously! - #endif - - #include - - #if __IAR_M0_FAMILY - /* Avoid clash between intrinsics.h and arm_math.h when compiling for Cortex-M0. */ - #undef __CLZ - #undef __SSAT - #undef __USAT - #undef __RBIT - #undef __get_APSR - - __STATIC_INLINE uint8_t __CLZ(uint32_t data) - { - if (data == 0U) { return 32U; } - - uint32_t count = 0U; - uint32_t mask = 0x80000000U; - - while ((data & mask) == 0U) - { - count += 1U; - mask = mask >> 1U; - } - return count; - } - - __STATIC_INLINE uint32_t __RBIT(uint32_t v) - { - uint8_t sc = 31U; - uint32_t r = v; - for (v >>= 1U; v; v >>= 1U) - { - r <<= 1U; - r |= v & 1U; - sc--; - } - return (r << sc); - } - - __STATIC_INLINE uint32_t __get_APSR(void) - { - uint32_t res; - __asm("MRS %0,APSR" : "=r" (res)); - return res; - } - - #endif - - #if (!((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) )) - #undef __get_FPSCR - #undef __set_FPSCR - #define __get_FPSCR() (0) - #define __set_FPSCR(VALUE) ((void)VALUE) - #endif - - #pragma diag_suppress=Pe940 - #pragma diag_suppress=Pe177 - - #define __enable_irq __enable_interrupt - #define __disable_irq __disable_interrupt - #define __NOP __no_operation - - #define __get_xPSR __get_PSR - - #if (!defined(__ARM_ARCH_6M__) || __ARM_ARCH_6M__==0) - - __IAR_FT uint32_t __LDREXW(uint32_t volatile *ptr) - { - return __LDREX((unsigned long *)ptr); - } - - __IAR_FT uint32_t __STREXW(uint32_t value, uint32_t volatile *ptr) - { - return __STREX(value, (unsigned long *)ptr); - } - #endif - - - /* __CORTEX_M is defined in core_cm0.h, core_cm3.h and core_cm4.h. */ - #if (__CORTEX_M >= 0x03) - - __IAR_FT uint32_t __RRX(uint32_t value) - { - uint32_t result; - __ASM volatile("RRX %0, %1" : "=r"(result) : "r" (value)); - return(result); - } - - __IAR_FT void __set_BASEPRI_MAX(uint32_t value) - { - __asm volatile("MSR BASEPRI_MAX,%0"::"r" (value)); - } - - - #define __enable_fault_irq __enable_fiq - #define __disable_fault_irq __disable_fiq - - - #endif /* (__CORTEX_M >= 0x03) */ - - __IAR_FT uint32_t __ROR(uint32_t op1, uint32_t op2) - { - return (op1 >> op2) | (op1 << ((sizeof(op1)*8)-op2)); - } - - #if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) - - __IAR_FT uint32_t __get_MSPLIM(void) - { - uint32_t res; - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - res = 0U; - #else - __asm volatile("MRS %0,MSPLIM" : "=r" (res)); - #endif - return res; - } - - __IAR_FT void __set_MSPLIM(uint32_t value) - { - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - (void)value; - #else - __asm volatile("MSR MSPLIM,%0" :: "r" (value)); - #endif - } - - __IAR_FT uint32_t __get_PSPLIM(void) - { - uint32_t res; - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - res = 0U; - #else - __asm volatile("MRS %0,PSPLIM" : "=r" (res)); - #endif - return res; - } - - __IAR_FT void __set_PSPLIM(uint32_t value) - { - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - (void)value; - #else - __asm volatile("MSR PSPLIM,%0" :: "r" (value)); - #endif - } - - __IAR_FT uint32_t __TZ_get_CONTROL_NS(void) - { - uint32_t res; - __asm volatile("MRS %0,CONTROL_NS" : "=r" (res)); - return res; - } - - __IAR_FT void __TZ_set_CONTROL_NS(uint32_t value) - { - __asm volatile("MSR CONTROL_NS,%0" :: "r" (value)); - __iar_builtin_ISB(); - } - - __IAR_FT uint32_t __TZ_get_PSP_NS(void) - { - uint32_t res; - __asm volatile("MRS %0,PSP_NS" : "=r" (res)); - return res; - } - - __IAR_FT void __TZ_set_PSP_NS(uint32_t value) - { - __asm volatile("MSR PSP_NS,%0" :: "r" (value)); - } - - __IAR_FT uint32_t __TZ_get_MSP_NS(void) - { - uint32_t res; - __asm volatile("MRS %0,MSP_NS" : "=r" (res)); - return res; - } - - __IAR_FT void __TZ_set_MSP_NS(uint32_t value) - { - __asm volatile("MSR MSP_NS,%0" :: "r" (value)); - } - - __IAR_FT uint32_t __TZ_get_SP_NS(void) - { - uint32_t res; - __asm volatile("MRS %0,SP_NS" : "=r" (res)); - return res; - } - __IAR_FT void __TZ_set_SP_NS(uint32_t value) - { - __asm volatile("MSR SP_NS,%0" :: "r" (value)); - } - - __IAR_FT uint32_t __TZ_get_PRIMASK_NS(void) - { - uint32_t res; - __asm volatile("MRS %0,PRIMASK_NS" : "=r" (res)); - return res; - } - - __IAR_FT void __TZ_set_PRIMASK_NS(uint32_t value) - { - __asm volatile("MSR PRIMASK_NS,%0" :: "r" (value)); - } - - __IAR_FT uint32_t __TZ_get_BASEPRI_NS(void) - { - uint32_t res; - __asm volatile("MRS %0,BASEPRI_NS" : "=r" (res)); - return res; - } - - __IAR_FT void __TZ_set_BASEPRI_NS(uint32_t value) - { - __asm volatile("MSR BASEPRI_NS,%0" :: "r" (value)); - } - - __IAR_FT uint32_t __TZ_get_FAULTMASK_NS(void) - { - uint32_t res; - __asm volatile("MRS %0,FAULTMASK_NS" : "=r" (res)); - return res; - } - - __IAR_FT void __TZ_set_FAULTMASK_NS(uint32_t value) - { - __asm volatile("MSR FAULTMASK_NS,%0" :: "r" (value)); - } - - __IAR_FT uint32_t __TZ_get_PSPLIM_NS(void) - { - uint32_t res; - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - res = 0U; - #else - __asm volatile("MRS %0,PSPLIM_NS" : "=r" (res)); - #endif - return res; - } - - __IAR_FT void __TZ_set_PSPLIM_NS(uint32_t value) - { - #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - (void)value; - #else - __asm volatile("MSR PSPLIM_NS,%0" :: "r" (value)); - #endif - } - - __IAR_FT uint32_t __TZ_get_MSPLIM_NS(void) - { - uint32_t res; - __asm volatile("MRS %0,MSPLIM_NS" : "=r" (res)); - return res; - } - - __IAR_FT void __TZ_set_MSPLIM_NS(uint32_t value) - { - __asm volatile("MSR MSPLIM_NS,%0" :: "r" (value)); - } - - #endif /* __ARM_ARCH_8M_MAIN__ or __ARM_ARCH_8M_BASE__ */ - -#endif /* __ICCARM_INTRINSICS_VERSION__ == 2 */ - -#define __BKPT(value) __asm volatile ("BKPT %0" : : "i"(value)) - -#if __IAR_M0_FAMILY - __STATIC_INLINE int32_t __SSAT(int32_t val, uint32_t sat) - { - if ((sat >= 1U) && (sat <= 32U)) - { - const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); - const int32_t min = -1 - max ; - if (val > max) - { - return max; - } - else if (val < min) - { - return min; - } - } - return val; - } - - __STATIC_INLINE uint32_t __USAT(int32_t val, uint32_t sat) - { - if (sat <= 31U) - { - const uint32_t max = ((1U << sat) - 1U); - if (val > (int32_t)max) - { - return max; - } - else if (val < 0) - { - return 0U; - } - } - return (uint32_t)val; - } -#endif - -#if (__CORTEX_M >= 0x03) /* __CORTEX_M is defined in core_cm0.h, core_cm3.h and core_cm4.h. */ - - __IAR_FT uint8_t __LDRBT(volatile uint8_t *addr) - { - uint32_t res; - __ASM volatile ("LDRBT %0, [%1]" : "=r" (res) : "r" (addr) : "memory"); - return ((uint8_t)res); - } - - __IAR_FT uint16_t __LDRHT(volatile uint16_t *addr) - { - uint32_t res; - __ASM volatile ("LDRHT %0, [%1]" : "=r" (res) : "r" (addr) : "memory"); - return ((uint16_t)res); - } - - __IAR_FT uint32_t __LDRT(volatile uint32_t *addr) - { - uint32_t res; - __ASM volatile ("LDRT %0, [%1]" : "=r" (res) : "r" (addr) : "memory"); - return res; - } - - __IAR_FT void __STRBT(uint8_t value, volatile uint8_t *addr) - { - __ASM volatile ("STRBT %1, [%0]" : : "r" (addr), "r" ((uint32_t)value) : "memory"); - } - - __IAR_FT void __STRHT(uint16_t value, volatile uint16_t *addr) - { - __ASM volatile ("STRHT %1, [%0]" : : "r" (addr), "r" ((uint32_t)value) : "memory"); - } - - __IAR_FT void __STRT(uint32_t value, volatile uint32_t *addr) - { - __ASM volatile ("STRT %1, [%0]" : : "r" (addr), "r" (value) : "memory"); - } - -#endif /* (__CORTEX_M >= 0x03) */ - -#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) - - - __IAR_FT uint8_t __LDAB(volatile uint8_t *ptr) - { - uint32_t res; - __ASM volatile ("LDAB %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); - return ((uint8_t)res); - } - - __IAR_FT uint16_t __LDAH(volatile uint16_t *ptr) - { - uint32_t res; - __ASM volatile ("LDAH %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); - return ((uint16_t)res); - } - - __IAR_FT uint32_t __LDA(volatile uint32_t *ptr) - { - uint32_t res; - __ASM volatile ("LDA %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); - return res; - } - - __IAR_FT void __STLB(uint8_t value, volatile uint8_t *ptr) - { - __ASM volatile ("STLB %1, [%0]" :: "r" (ptr), "r" (value) : "memory"); - } - - __IAR_FT void __STLH(uint16_t value, volatile uint16_t *ptr) - { - __ASM volatile ("STLH %1, [%0]" :: "r" (ptr), "r" (value) : "memory"); - } - - __IAR_FT void __STL(uint32_t value, volatile uint32_t *ptr) - { - __ASM volatile ("STL %1, [%0]" :: "r" (ptr), "r" (value) : "memory"); - } - - __IAR_FT uint8_t __LDAEXB(volatile uint8_t *ptr) - { - uint32_t res; - __ASM volatile ("LDAEXB %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); - return ((uint8_t)res); - } - - __IAR_FT uint16_t __LDAEXH(volatile uint16_t *ptr) - { - uint32_t res; - __ASM volatile ("LDAEXH %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); - return ((uint16_t)res); - } - - __IAR_FT uint32_t __LDAEX(volatile uint32_t *ptr) - { - uint32_t res; - __ASM volatile ("LDAEX %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); - return res; - } - - __IAR_FT uint32_t __STLEXB(uint8_t value, volatile uint8_t *ptr) - { - uint32_t res; - __ASM volatile ("STLEXB %0, %2, [%1]" : "=r" (res) : "r" (ptr), "r" (value) : "memory"); - return res; - } - - __IAR_FT uint32_t __STLEXH(uint16_t value, volatile uint16_t *ptr) - { - uint32_t res; - __ASM volatile ("STLEXH %0, %2, [%1]" : "=r" (res) : "r" (ptr), "r" (value) : "memory"); - return res; - } - - __IAR_FT uint32_t __STLEX(uint32_t value, volatile uint32_t *ptr) - { - uint32_t res; - __ASM volatile ("STLEX %0, %2, [%1]" : "=r" (res) : "r" (ptr), "r" (value) : "memory"); - return res; - } - -#endif /* __ARM_ARCH_8M_MAIN__ or __ARM_ARCH_8M_BASE__ */ - -#undef __IAR_FT -#undef __IAR_M0_FAMILY -#undef __ICCARM_V8 - -#pragma diag_default=Pe940 -#pragma diag_default=Pe177 - -#define __SXTB16_RORn(ARG1, ARG2) __SXTB16(__ROR(ARG1, ARG2)) - -#define __SXTAB16_RORn(ARG1, ARG2, ARG3) __SXTAB16(ARG1, __ROR(ARG2, ARG3)) - -#endif /* __CMSIS_ICCARM_H__ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/CMSIS/Core/Include/cmsis_version.h b/bsp/nxp/mcx/mcxn/Libraries/CMSIS/Core/Include/cmsis_version.h deleted file mode 100644 index 2f048e4552d..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/CMSIS/Core/Include/cmsis_version.h +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************//** - * @file cmsis_version.h - * @brief CMSIS Core(M) Version definitions - * @version V5.0.4 - * @date 23. July 2019 - ******************************************************************************/ -/* - * Copyright (c) 2009-2019 ARM Limited. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined (__clang__) - #pragma clang system_header /* treat file as system include file */ -#endif - -#ifndef __CMSIS_VERSION_H -#define __CMSIS_VERSION_H - -/* CMSIS Version definitions */ -#define __CM_CMSIS_VERSION_MAIN ( 5U) /*!< [31:16] CMSIS Core(M) main version */ -#define __CM_CMSIS_VERSION_SUB ( 4U) /*!< [15:0] CMSIS Core(M) sub version */ -#define __CM_CMSIS_VERSION ((__CM_CMSIS_VERSION_MAIN << 16U) | \ - __CM_CMSIS_VERSION_SUB ) /*!< CMSIS Core(M) version number */ -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/CMSIS/Core/Include/core_cm33.h b/bsp/nxp/mcx/mcxn/Libraries/CMSIS/Core/Include/core_cm33.h deleted file mode 100644 index f9cf6ab183a..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/CMSIS/Core/Include/core_cm33.h +++ /dev/null @@ -1,3265 +0,0 @@ -/**************************************************************************//** - * @file core_cm33.h - * @brief CMSIS Cortex-M33 Core Peripheral Access Layer Header File - * @version V5.2.2 - * @date 04. June 2021 - ******************************************************************************/ -/* - * Copyright (c) 2009-2021 Arm Limited. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined (__clang__) - #pragma clang system_header /* treat file as system include file */ -#elif defined ( __GNUC__ ) - #pragma GCC diagnostic ignored "-Wpedantic" /* disable pedantic warning due to unnamed structs/unions */ -#endif - -#ifndef __CORE_CM33_H_GENERIC -#define __CORE_CM33_H_GENERIC - -#include - -#ifdef __cplusplus - extern "C" { -#endif - -/** - \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions - CMSIS violates the following MISRA-C:2004 rules: - - \li Required Rule 8.5, object/function definition in header file.
- Function definitions in header files are used to allow 'inlining'. - - \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
- Unions are used for effective representation of core registers. - - \li Advisory Rule 19.7, Function-like macro defined.
- Function-like macros are used to allow more efficient code. - */ - - -/******************************************************************************* - * CMSIS definitions - ******************************************************************************/ -/** - \ingroup Cortex_M33 - @{ - */ - -#include "cmsis_version.h" - -/* CMSIS CM33 definitions */ -#define __CM33_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ -#define __CM33_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ -#define __CM33_CMSIS_VERSION ((__CM33_CMSIS_VERSION_MAIN << 16U) | \ - __CM33_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ - -#define __CORTEX_M (33U) /*!< Cortex-M Core */ - -/** __FPU_USED indicates whether an FPU is used or not. - For this, __FPU_PRESENT has to be checked prior to making use of FPU specific registers and functions. -*/ -#if defined ( __CC_ARM ) - #if defined (__TARGET_FPU_VFP) - #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) - #define __FPU_USED 1U - #else - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0U - #endif - #else - #define __FPU_USED 0U - #endif - - #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U) - #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U) - #define __DSP_USED 1U - #else - #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" - #define __DSP_USED 0U - #endif - #else - #define __DSP_USED 0U - #endif - -#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #if defined (__ARM_FP) - #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) - #define __FPU_USED 1U - #else - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0U - #endif - #else - #define __FPU_USED 0U - #endif - - #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U) - #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U) - #define __DSP_USED 1U - #else - #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" - #define __DSP_USED 0U - #endif - #else - #define __DSP_USED 0U - #endif - -#elif defined ( __GNUC__ ) - #if defined (__VFP_FP__) && !defined(__SOFTFP__) - #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) - #define __FPU_USED 1U - #else - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0U - #endif - #else - #define __FPU_USED 0U - #endif - - #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U) - #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U) - #define __DSP_USED 1U - #else - #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" - #define __DSP_USED 0U - #endif - #else - #define __DSP_USED 0U - #endif - -#elif defined ( __ICCARM__ ) - #if defined (__ARMVFP__) - #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) - #define __FPU_USED 1U - #else - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0U - #endif - #else - #define __FPU_USED 0U - #endif - - #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U) - #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U) - #define __DSP_USED 1U - #else - #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" - #define __DSP_USED 0U - #endif - #else - #define __DSP_USED 0U - #endif - -#elif defined ( __TI_ARM__ ) - #if defined (__TI_VFP_SUPPORT__) - #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) - #define __FPU_USED 1U - #else - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0U - #endif - #else - #define __FPU_USED 0U - #endif - -#elif defined ( __TASKING__ ) - #if defined (__FPU_VFP__) - #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) - #define __FPU_USED 1U - #else - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0U - #endif - #else - #define __FPU_USED 0U - #endif - -#elif defined ( __CSMC__ ) - #if ( __CSMC__ & 0x400U) - #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) - #define __FPU_USED 1U - #else - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0U - #endif - #else - #define __FPU_USED 0U - #endif - -#endif - -#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ - - -#ifdef __cplusplus -} -#endif - -#endif /* __CORE_CM33_H_GENERIC */ - -#ifndef __CMSIS_GENERIC - -#ifndef __CORE_CM33_H_DEPENDANT -#define __CORE_CM33_H_DEPENDANT - -#ifdef __cplusplus - extern "C" { -#endif - -/* check device defines and use defaults */ -#if defined __CHECK_DEVICE_DEFINES - #ifndef __CM33_REV - #define __CM33_REV 0x0000U - #warning "__CM33_REV not defined in device header file; using default!" - #endif - - #ifndef __FPU_PRESENT - #define __FPU_PRESENT 0U - #warning "__FPU_PRESENT not defined in device header file; using default!" - #endif - - #ifndef __MPU_PRESENT - #define __MPU_PRESENT 0U - #warning "__MPU_PRESENT not defined in device header file; using default!" - #endif - - #ifndef __SAUREGION_PRESENT - #define __SAUREGION_PRESENT 0U - #warning "__SAUREGION_PRESENT not defined in device header file; using default!" - #endif - - #ifndef __DSP_PRESENT - #define __DSP_PRESENT 0U - #warning "__DSP_PRESENT not defined in device header file; using default!" - #endif - - #ifndef __VTOR_PRESENT - #define __VTOR_PRESENT 1U - #warning "__VTOR_PRESENT not defined in device header file; using default!" - #endif - - #ifndef __NVIC_PRIO_BITS - #define __NVIC_PRIO_BITS 3U - #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" - #endif - - #ifndef __Vendor_SysTickConfig - #define __Vendor_SysTickConfig 0U - #warning "__Vendor_SysTickConfig not defined in device header file; using default!" - #endif -#endif - -/* IO definitions (access restrictions to peripheral registers) */ -/** - \defgroup CMSIS_glob_defs CMSIS Global Defines - - IO Type Qualifiers are used - \li to specify the access to peripheral variables. - \li for automatic generation of peripheral register debug information. -*/ -#ifdef __cplusplus - #define __I volatile /*!< Defines 'read only' permissions */ -#else - #define __I volatile const /*!< Defines 'read only' permissions */ -#endif -#define __O volatile /*!< Defines 'write only' permissions */ -#define __IO volatile /*!< Defines 'read / write' permissions */ - -/* following defines should be used for structure members */ -#define __IM volatile const /*! Defines 'read only' structure member permissions */ -#define __OM volatile /*! Defines 'write only' structure member permissions */ -#define __IOM volatile /*! Defines 'read / write' structure member permissions */ - -/*@} end of group Cortex_M33 */ - - - -/******************************************************************************* - * Register Abstraction - Core Register contain: - - Core Register - - Core NVIC Register - - Core SCB Register - - Core SysTick Register - - Core Debug Register - - Core MPU Register - - Core SAU Register - - Core FPU Register - ******************************************************************************/ -/** - \defgroup CMSIS_core_register Defines and Type Definitions - \brief Type definitions and defines for Cortex-M processor based devices. -*/ - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_CORE Status and Control Registers - \brief Core Register type definitions. - @{ - */ - -/** - \brief Union type to access the Application Program Status Register (APSR). - */ -typedef union -{ - struct - { - uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */ - uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ - uint32_t _reserved1:7; /*!< bit: 20..26 Reserved */ - uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ - uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ - uint32_t C:1; /*!< bit: 29 Carry condition code flag */ - uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ - uint32_t N:1; /*!< bit: 31 Negative condition code flag */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} APSR_Type; - -/* APSR Register Definitions */ -#define APSR_N_Pos 31U /*!< APSR: N Position */ -#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ - -#define APSR_Z_Pos 30U /*!< APSR: Z Position */ -#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ - -#define APSR_C_Pos 29U /*!< APSR: C Position */ -#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ - -#define APSR_V_Pos 28U /*!< APSR: V Position */ -#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ - -#define APSR_Q_Pos 27U /*!< APSR: Q Position */ -#define APSR_Q_Msk (1UL << APSR_Q_Pos) /*!< APSR: Q Mask */ - -#define APSR_GE_Pos 16U /*!< APSR: GE Position */ -#define APSR_GE_Msk (0xFUL << APSR_GE_Pos) /*!< APSR: GE Mask */ - - -/** - \brief Union type to access the Interrupt Program Status Register (IPSR). - */ -typedef union -{ - struct - { - uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ - uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} IPSR_Type; - -/* IPSR Register Definitions */ -#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ -#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ - - -/** - \brief Union type to access the Special-Purpose Program Status Registers (xPSR). - */ -typedef union -{ - struct - { - uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ - uint32_t _reserved0:7; /*!< bit: 9..15 Reserved */ - uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ - uint32_t _reserved1:4; /*!< bit: 20..23 Reserved */ - uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ - uint32_t IT:2; /*!< bit: 25..26 saved IT state (read 0) */ - uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ - uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ - uint32_t C:1; /*!< bit: 29 Carry condition code flag */ - uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ - uint32_t N:1; /*!< bit: 31 Negative condition code flag */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} xPSR_Type; - -/* xPSR Register Definitions */ -#define xPSR_N_Pos 31U /*!< xPSR: N Position */ -#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ - -#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ -#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ - -#define xPSR_C_Pos 29U /*!< xPSR: C Position */ -#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ - -#define xPSR_V_Pos 28U /*!< xPSR: V Position */ -#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ - -#define xPSR_Q_Pos 27U /*!< xPSR: Q Position */ -#define xPSR_Q_Msk (1UL << xPSR_Q_Pos) /*!< xPSR: Q Mask */ - -#define xPSR_IT_Pos 25U /*!< xPSR: IT Position */ -#define xPSR_IT_Msk (3UL << xPSR_IT_Pos) /*!< xPSR: IT Mask */ - -#define xPSR_T_Pos 24U /*!< xPSR: T Position */ -#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ - -#define xPSR_GE_Pos 16U /*!< xPSR: GE Position */ -#define xPSR_GE_Msk (0xFUL << xPSR_GE_Pos) /*!< xPSR: GE Mask */ - -#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ -#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ - - -/** - \brief Union type to access the Control Registers (CONTROL). - */ -typedef union -{ - struct - { - uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ - uint32_t SPSEL:1; /*!< bit: 1 Stack-pointer select */ - uint32_t FPCA:1; /*!< bit: 2 Floating-point context active */ - uint32_t SFPA:1; /*!< bit: 3 Secure floating-point active */ - uint32_t _reserved1:28; /*!< bit: 4..31 Reserved */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} CONTROL_Type; - -/* CONTROL Register Definitions */ -#define CONTROL_SFPA_Pos 3U /*!< CONTROL: SFPA Position */ -#define CONTROL_SFPA_Msk (1UL << CONTROL_SFPA_Pos) /*!< CONTROL: SFPA Mask */ - -#define CONTROL_FPCA_Pos 2U /*!< CONTROL: FPCA Position */ -#define CONTROL_FPCA_Msk (1UL << CONTROL_FPCA_Pos) /*!< CONTROL: FPCA Mask */ - -#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ -#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ - -#define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */ -#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ - -/*@} end of group CMSIS_CORE */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) - \brief Type definitions for the NVIC Registers - @{ - */ - -/** - \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). - */ -typedef struct -{ - __IOM uint32_t ISER[16U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ - uint32_t RESERVED0[16U]; - __IOM uint32_t ICER[16U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ - uint32_t RSERVED1[16U]; - __IOM uint32_t ISPR[16U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ - uint32_t RESERVED2[16U]; - __IOM uint32_t ICPR[16U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ - uint32_t RESERVED3[16U]; - __IOM uint32_t IABR[16U]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ - uint32_t RESERVED4[16U]; - __IOM uint32_t ITNS[16U]; /*!< Offset: 0x280 (R/W) Interrupt Non-Secure State Register */ - uint32_t RESERVED5[16U]; - __IOM uint8_t IPR[496U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */ - uint32_t RESERVED6[580U]; - __OM uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */ -} NVIC_Type; - -/* Software Triggered Interrupt Register Definitions */ -#define NVIC_STIR_INTID_Pos 0U /*!< STIR: INTLINESNUM Position */ -#define NVIC_STIR_INTID_Msk (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/) /*!< STIR: INTLINESNUM Mask */ - -/*@} end of group CMSIS_NVIC */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_SCB System Control Block (SCB) - \brief Type definitions for the System Control Block Registers - @{ - */ - -/** - \brief Structure type to access the System Control Block (SCB). - */ -typedef struct -{ - __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ - __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ - __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ - __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ - __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ - __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ - __IOM uint8_t SHPR[12U]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */ - __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ - __IOM uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */ - __IOM uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */ - __IOM uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */ - __IOM uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */ - __IOM uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */ - __IOM uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ - __IM uint32_t ID_PFR[2U]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ - __IM uint32_t ID_DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ - __IM uint32_t ID_ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ - __IM uint32_t ID_MMFR[4U]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ - __IM uint32_t ID_ISAR[6U]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ - __IM uint32_t CLIDR; /*!< Offset: 0x078 (R/ ) Cache Level ID register */ - __IM uint32_t CTR; /*!< Offset: 0x07C (R/ ) Cache Type register */ - __IM uint32_t CCSIDR; /*!< Offset: 0x080 (R/ ) Cache Size ID Register */ - __IOM uint32_t CSSELR; /*!< Offset: 0x084 (R/W) Cache Size Selection Register */ - __IOM uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ - __IOM uint32_t NSACR; /*!< Offset: 0x08C (R/W) Non-Secure Access Control Register */ - uint32_t RESERVED3[92U]; - __OM uint32_t STIR; /*!< Offset: 0x200 ( /W) Software Triggered Interrupt Register */ - uint32_t RESERVED4[15U]; - __IM uint32_t MVFR0; /*!< Offset: 0x240 (R/ ) Media and VFP Feature Register 0 */ - __IM uint32_t MVFR1; /*!< Offset: 0x244 (R/ ) Media and VFP Feature Register 1 */ - __IM uint32_t MVFR2; /*!< Offset: 0x248 (R/ ) Media and VFP Feature Register 2 */ - uint32_t RESERVED5[1U]; - __OM uint32_t ICIALLU; /*!< Offset: 0x250 ( /W) I-Cache Invalidate All to PoU */ - uint32_t RESERVED6[1U]; - __OM uint32_t ICIMVAU; /*!< Offset: 0x258 ( /W) I-Cache Invalidate by MVA to PoU */ - __OM uint32_t DCIMVAC; /*!< Offset: 0x25C ( /W) D-Cache Invalidate by MVA to PoC */ - __OM uint32_t DCISW; /*!< Offset: 0x260 ( /W) D-Cache Invalidate by Set-way */ - __OM uint32_t DCCMVAU; /*!< Offset: 0x264 ( /W) D-Cache Clean by MVA to PoU */ - __OM uint32_t DCCMVAC; /*!< Offset: 0x268 ( /W) D-Cache Clean by MVA to PoC */ - __OM uint32_t DCCSW; /*!< Offset: 0x26C ( /W) D-Cache Clean by Set-way */ - __OM uint32_t DCCIMVAC; /*!< Offset: 0x270 ( /W) D-Cache Clean and Invalidate by MVA to PoC */ - __OM uint32_t DCCISW; /*!< Offset: 0x274 ( /W) D-Cache Clean and Invalidate by Set-way */ - __OM uint32_t BPIALL; /*!< Offset: 0x278 ( /W) Branch Predictor Invalidate All */ -} SCB_Type; - -/* SCB CPUID Register Definitions */ -#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ -#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ - -#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ -#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ - -#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ -#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ - -#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ -#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ - -#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ -#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ - -/* SCB Interrupt Control State Register Definitions */ -#define SCB_ICSR_PENDNMISET_Pos 31U /*!< SCB ICSR: PENDNMISET Position */ -#define SCB_ICSR_PENDNMISET_Msk (1UL << SCB_ICSR_PENDNMISET_Pos) /*!< SCB ICSR: PENDNMISET Mask */ - -#define SCB_ICSR_NMIPENDSET_Pos SCB_ICSR_PENDNMISET_Pos /*!< SCB ICSR: NMIPENDSET Position, backward compatibility */ -#define SCB_ICSR_NMIPENDSET_Msk SCB_ICSR_PENDNMISET_Msk /*!< SCB ICSR: NMIPENDSET Mask, backward compatibility */ - -#define SCB_ICSR_PENDNMICLR_Pos 30U /*!< SCB ICSR: PENDNMICLR Position */ -#define SCB_ICSR_PENDNMICLR_Msk (1UL << SCB_ICSR_PENDNMICLR_Pos) /*!< SCB ICSR: PENDNMICLR Mask */ - -#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ -#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ - -#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ -#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ - -#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ -#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ - -#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ -#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ - -#define SCB_ICSR_STTNS_Pos 24U /*!< SCB ICSR: STTNS Position (Security Extension) */ -#define SCB_ICSR_STTNS_Msk (1UL << SCB_ICSR_STTNS_Pos) /*!< SCB ICSR: STTNS Mask (Security Extension) */ - -#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ -#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ - -#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ -#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ - -#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ -#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ - -#define SCB_ICSR_RETTOBASE_Pos 11U /*!< SCB ICSR: RETTOBASE Position */ -#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ - -#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ -#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ - -/* SCB Vector Table Offset Register Definitions */ -#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */ -#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ - -/* SCB Application Interrupt and Reset Control Register Definitions */ -#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ -#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ - -#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ -#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ - -#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ -#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ - -#define SCB_AIRCR_PRIS_Pos 14U /*!< SCB AIRCR: PRIS Position */ -#define SCB_AIRCR_PRIS_Msk (1UL << SCB_AIRCR_PRIS_Pos) /*!< SCB AIRCR: PRIS Mask */ - -#define SCB_AIRCR_BFHFNMINS_Pos 13U /*!< SCB AIRCR: BFHFNMINS Position */ -#define SCB_AIRCR_BFHFNMINS_Msk (1UL << SCB_AIRCR_BFHFNMINS_Pos) /*!< SCB AIRCR: BFHFNMINS Mask */ - -#define SCB_AIRCR_PRIGROUP_Pos 8U /*!< SCB AIRCR: PRIGROUP Position */ -#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ - -#define SCB_AIRCR_SYSRESETREQS_Pos 3U /*!< SCB AIRCR: SYSRESETREQS Position */ -#define SCB_AIRCR_SYSRESETREQS_Msk (1UL << SCB_AIRCR_SYSRESETREQS_Pos) /*!< SCB AIRCR: SYSRESETREQS Mask */ - -#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ -#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ - -#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ -#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ - -/* SCB System Control Register Definitions */ -#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ -#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ - -#define SCB_SCR_SLEEPDEEPS_Pos 3U /*!< SCB SCR: SLEEPDEEPS Position */ -#define SCB_SCR_SLEEPDEEPS_Msk (1UL << SCB_SCR_SLEEPDEEPS_Pos) /*!< SCB SCR: SLEEPDEEPS Mask */ - -#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ -#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ - -#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ -#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ - -/* SCB Configuration Control Register Definitions */ -#define SCB_CCR_BP_Pos 18U /*!< SCB CCR: BP Position */ -#define SCB_CCR_BP_Msk (1UL << SCB_CCR_BP_Pos) /*!< SCB CCR: BP Mask */ - -#define SCB_CCR_IC_Pos 17U /*!< SCB CCR: IC Position */ -#define SCB_CCR_IC_Msk (1UL << SCB_CCR_IC_Pos) /*!< SCB CCR: IC Mask */ - -#define SCB_CCR_DC_Pos 16U /*!< SCB CCR: DC Position */ -#define SCB_CCR_DC_Msk (1UL << SCB_CCR_DC_Pos) /*!< SCB CCR: DC Mask */ - -#define SCB_CCR_STKOFHFNMIGN_Pos 10U /*!< SCB CCR: STKOFHFNMIGN Position */ -#define SCB_CCR_STKOFHFNMIGN_Msk (1UL << SCB_CCR_STKOFHFNMIGN_Pos) /*!< SCB CCR: STKOFHFNMIGN Mask */ - -#define SCB_CCR_BFHFNMIGN_Pos 8U /*!< SCB CCR: BFHFNMIGN Position */ -#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ - -#define SCB_CCR_DIV_0_TRP_Pos 4U /*!< SCB CCR: DIV_0_TRP Position */ -#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ - -#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ -#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ - -#define SCB_CCR_USERSETMPEND_Pos 1U /*!< SCB CCR: USERSETMPEND Position */ -#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ - -/* SCB System Handler Control and State Register Definitions */ -#define SCB_SHCSR_HARDFAULTPENDED_Pos 21U /*!< SCB SHCSR: HARDFAULTPENDED Position */ -#define SCB_SHCSR_HARDFAULTPENDED_Msk (1UL << SCB_SHCSR_HARDFAULTPENDED_Pos) /*!< SCB SHCSR: HARDFAULTPENDED Mask */ - -#define SCB_SHCSR_SECUREFAULTPENDED_Pos 20U /*!< SCB SHCSR: SECUREFAULTPENDED Position */ -#define SCB_SHCSR_SECUREFAULTPENDED_Msk (1UL << SCB_SHCSR_SECUREFAULTPENDED_Pos) /*!< SCB SHCSR: SECUREFAULTPENDED Mask */ - -#define SCB_SHCSR_SECUREFAULTENA_Pos 19U /*!< SCB SHCSR: SECUREFAULTENA Position */ -#define SCB_SHCSR_SECUREFAULTENA_Msk (1UL << SCB_SHCSR_SECUREFAULTENA_Pos) /*!< SCB SHCSR: SECUREFAULTENA Mask */ - -#define SCB_SHCSR_USGFAULTENA_Pos 18U /*!< SCB SHCSR: USGFAULTENA Position */ -#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */ - -#define SCB_SHCSR_BUSFAULTENA_Pos 17U /*!< SCB SHCSR: BUSFAULTENA Position */ -#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */ - -#define SCB_SHCSR_MEMFAULTENA_Pos 16U /*!< SCB SHCSR: MEMFAULTENA Position */ -#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */ - -#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ -#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ - -#define SCB_SHCSR_BUSFAULTPENDED_Pos 14U /*!< SCB SHCSR: BUSFAULTPENDED Position */ -#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */ - -#define SCB_SHCSR_MEMFAULTPENDED_Pos 13U /*!< SCB SHCSR: MEMFAULTPENDED Position */ -#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */ - -#define SCB_SHCSR_USGFAULTPENDED_Pos 12U /*!< SCB SHCSR: USGFAULTPENDED Position */ -#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */ - -#define SCB_SHCSR_SYSTICKACT_Pos 11U /*!< SCB SHCSR: SYSTICKACT Position */ -#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ - -#define SCB_SHCSR_PENDSVACT_Pos 10U /*!< SCB SHCSR: PENDSVACT Position */ -#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ - -#define SCB_SHCSR_MONITORACT_Pos 8U /*!< SCB SHCSR: MONITORACT Position */ -#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */ - -#define SCB_SHCSR_SVCALLACT_Pos 7U /*!< SCB SHCSR: SVCALLACT Position */ -#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ - -#define SCB_SHCSR_NMIACT_Pos 5U /*!< SCB SHCSR: NMIACT Position */ -#define SCB_SHCSR_NMIACT_Msk (1UL << SCB_SHCSR_NMIACT_Pos) /*!< SCB SHCSR: NMIACT Mask */ - -#define SCB_SHCSR_SECUREFAULTACT_Pos 4U /*!< SCB SHCSR: SECUREFAULTACT Position */ -#define SCB_SHCSR_SECUREFAULTACT_Msk (1UL << SCB_SHCSR_SECUREFAULTACT_Pos) /*!< SCB SHCSR: SECUREFAULTACT Mask */ - -#define SCB_SHCSR_USGFAULTACT_Pos 3U /*!< SCB SHCSR: USGFAULTACT Position */ -#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */ - -#define SCB_SHCSR_HARDFAULTACT_Pos 2U /*!< SCB SHCSR: HARDFAULTACT Position */ -#define SCB_SHCSR_HARDFAULTACT_Msk (1UL << SCB_SHCSR_HARDFAULTACT_Pos) /*!< SCB SHCSR: HARDFAULTACT Mask */ - -#define SCB_SHCSR_BUSFAULTACT_Pos 1U /*!< SCB SHCSR: BUSFAULTACT Position */ -#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */ - -#define SCB_SHCSR_MEMFAULTACT_Pos 0U /*!< SCB SHCSR: MEMFAULTACT Position */ -#define SCB_SHCSR_MEMFAULTACT_Msk (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/) /*!< SCB SHCSR: MEMFAULTACT Mask */ - -/* SCB Configurable Fault Status Register Definitions */ -#define SCB_CFSR_USGFAULTSR_Pos 16U /*!< SCB CFSR: Usage Fault Status Register Position */ -#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */ - -#define SCB_CFSR_BUSFAULTSR_Pos 8U /*!< SCB CFSR: Bus Fault Status Register Position */ -#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */ - -#define SCB_CFSR_MEMFAULTSR_Pos 0U /*!< SCB CFSR: Memory Manage Fault Status Register Position */ -#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ - -/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */ -#define SCB_CFSR_MMARVALID_Pos (SCB_CFSR_MEMFAULTSR_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ -#define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */ - -#define SCB_CFSR_MLSPERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */ -#define SCB_CFSR_MLSPERR_Msk (1UL << SCB_CFSR_MLSPERR_Pos) /*!< SCB CFSR (MMFSR): MLSPERR Mask */ - -#define SCB_CFSR_MSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ -#define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */ - -#define SCB_CFSR_MUNSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ -#define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */ - -#define SCB_CFSR_DACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ -#define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */ - -#define SCB_CFSR_IACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ -#define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */ - -/* BusFault Status Register (part of SCB Configurable Fault Status Register) */ -#define SCB_CFSR_BFARVALID_Pos (SCB_CFSR_BUSFAULTSR_Pos + 7U) /*!< SCB CFSR (BFSR): BFARVALID Position */ -#define SCB_CFSR_BFARVALID_Msk (1UL << SCB_CFSR_BFARVALID_Pos) /*!< SCB CFSR (BFSR): BFARVALID Mask */ - -#define SCB_CFSR_LSPERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 5U) /*!< SCB CFSR (BFSR): LSPERR Position */ -#define SCB_CFSR_LSPERR_Msk (1UL << SCB_CFSR_LSPERR_Pos) /*!< SCB CFSR (BFSR): LSPERR Mask */ - -#define SCB_CFSR_STKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 4U) /*!< SCB CFSR (BFSR): STKERR Position */ -#define SCB_CFSR_STKERR_Msk (1UL << SCB_CFSR_STKERR_Pos) /*!< SCB CFSR (BFSR): STKERR Mask */ - -#define SCB_CFSR_UNSTKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 3U) /*!< SCB CFSR (BFSR): UNSTKERR Position */ -#define SCB_CFSR_UNSTKERR_Msk (1UL << SCB_CFSR_UNSTKERR_Pos) /*!< SCB CFSR (BFSR): UNSTKERR Mask */ - -#define SCB_CFSR_IMPRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 2U) /*!< SCB CFSR (BFSR): IMPRECISERR Position */ -#define SCB_CFSR_IMPRECISERR_Msk (1UL << SCB_CFSR_IMPRECISERR_Pos) /*!< SCB CFSR (BFSR): IMPRECISERR Mask */ - -#define SCB_CFSR_PRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 1U) /*!< SCB CFSR (BFSR): PRECISERR Position */ -#define SCB_CFSR_PRECISERR_Msk (1UL << SCB_CFSR_PRECISERR_Pos) /*!< SCB CFSR (BFSR): PRECISERR Mask */ - -#define SCB_CFSR_IBUSERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 0U) /*!< SCB CFSR (BFSR): IBUSERR Position */ -#define SCB_CFSR_IBUSERR_Msk (1UL << SCB_CFSR_IBUSERR_Pos) /*!< SCB CFSR (BFSR): IBUSERR Mask */ - -/* UsageFault Status Register (part of SCB Configurable Fault Status Register) */ -#define SCB_CFSR_DIVBYZERO_Pos (SCB_CFSR_USGFAULTSR_Pos + 9U) /*!< SCB CFSR (UFSR): DIVBYZERO Position */ -#define SCB_CFSR_DIVBYZERO_Msk (1UL << SCB_CFSR_DIVBYZERO_Pos) /*!< SCB CFSR (UFSR): DIVBYZERO Mask */ - -#define SCB_CFSR_UNALIGNED_Pos (SCB_CFSR_USGFAULTSR_Pos + 8U) /*!< SCB CFSR (UFSR): UNALIGNED Position */ -#define SCB_CFSR_UNALIGNED_Msk (1UL << SCB_CFSR_UNALIGNED_Pos) /*!< SCB CFSR (UFSR): UNALIGNED Mask */ - -#define SCB_CFSR_STKOF_Pos (SCB_CFSR_USGFAULTSR_Pos + 4U) /*!< SCB CFSR (UFSR): STKOF Position */ -#define SCB_CFSR_STKOF_Msk (1UL << SCB_CFSR_STKOF_Pos) /*!< SCB CFSR (UFSR): STKOF Mask */ - -#define SCB_CFSR_NOCP_Pos (SCB_CFSR_USGFAULTSR_Pos + 3U) /*!< SCB CFSR (UFSR): NOCP Position */ -#define SCB_CFSR_NOCP_Msk (1UL << SCB_CFSR_NOCP_Pos) /*!< SCB CFSR (UFSR): NOCP Mask */ - -#define SCB_CFSR_INVPC_Pos (SCB_CFSR_USGFAULTSR_Pos + 2U) /*!< SCB CFSR (UFSR): INVPC Position */ -#define SCB_CFSR_INVPC_Msk (1UL << SCB_CFSR_INVPC_Pos) /*!< SCB CFSR (UFSR): INVPC Mask */ - -#define SCB_CFSR_INVSTATE_Pos (SCB_CFSR_USGFAULTSR_Pos + 1U) /*!< SCB CFSR (UFSR): INVSTATE Position */ -#define SCB_CFSR_INVSTATE_Msk (1UL << SCB_CFSR_INVSTATE_Pos) /*!< SCB CFSR (UFSR): INVSTATE Mask */ - -#define SCB_CFSR_UNDEFINSTR_Pos (SCB_CFSR_USGFAULTSR_Pos + 0U) /*!< SCB CFSR (UFSR): UNDEFINSTR Position */ -#define SCB_CFSR_UNDEFINSTR_Msk (1UL << SCB_CFSR_UNDEFINSTR_Pos) /*!< SCB CFSR (UFSR): UNDEFINSTR Mask */ - -/* SCB Hard Fault Status Register Definitions */ -#define SCB_HFSR_DEBUGEVT_Pos 31U /*!< SCB HFSR: DEBUGEVT Position */ -#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */ - -#define SCB_HFSR_FORCED_Pos 30U /*!< SCB HFSR: FORCED Position */ -#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */ - -#define SCB_HFSR_VECTTBL_Pos 1U /*!< SCB HFSR: VECTTBL Position */ -#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */ - -/* SCB Debug Fault Status Register Definitions */ -#define SCB_DFSR_EXTERNAL_Pos 4U /*!< SCB DFSR: EXTERNAL Position */ -#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */ - -#define SCB_DFSR_VCATCH_Pos 3U /*!< SCB DFSR: VCATCH Position */ -#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */ - -#define SCB_DFSR_DWTTRAP_Pos 2U /*!< SCB DFSR: DWTTRAP Position */ -#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */ - -#define SCB_DFSR_BKPT_Pos 1U /*!< SCB DFSR: BKPT Position */ -#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */ - -#define SCB_DFSR_HALTED_Pos 0U /*!< SCB DFSR: HALTED Position */ -#define SCB_DFSR_HALTED_Msk (1UL /*<< SCB_DFSR_HALTED_Pos*/) /*!< SCB DFSR: HALTED Mask */ - -/* SCB Non-Secure Access Control Register Definitions */ -#define SCB_NSACR_CP11_Pos 11U /*!< SCB NSACR: CP11 Position */ -#define SCB_NSACR_CP11_Msk (1UL << SCB_NSACR_CP11_Pos) /*!< SCB NSACR: CP11 Mask */ - -#define SCB_NSACR_CP10_Pos 10U /*!< SCB NSACR: CP10 Position */ -#define SCB_NSACR_CP10_Msk (1UL << SCB_NSACR_CP10_Pos) /*!< SCB NSACR: CP10 Mask */ - -#define SCB_NSACR_CPn_Pos 0U /*!< SCB NSACR: CPn Position */ -#define SCB_NSACR_CPn_Msk (1UL /*<< SCB_NSACR_CPn_Pos*/) /*!< SCB NSACR: CPn Mask */ - -/* SCB Cache Level ID Register Definitions */ -#define SCB_CLIDR_LOUU_Pos 27U /*!< SCB CLIDR: LoUU Position */ -#define SCB_CLIDR_LOUU_Msk (7UL << SCB_CLIDR_LOUU_Pos) /*!< SCB CLIDR: LoUU Mask */ - -#define SCB_CLIDR_LOC_Pos 24U /*!< SCB CLIDR: LoC Position */ -#define SCB_CLIDR_LOC_Msk (7UL << SCB_CLIDR_LOC_Pos) /*!< SCB CLIDR: LoC Mask */ - -/* SCB Cache Type Register Definitions */ -#define SCB_CTR_FORMAT_Pos 29U /*!< SCB CTR: Format Position */ -#define SCB_CTR_FORMAT_Msk (7UL << SCB_CTR_FORMAT_Pos) /*!< SCB CTR: Format Mask */ - -#define SCB_CTR_CWG_Pos 24U /*!< SCB CTR: CWG Position */ -#define SCB_CTR_CWG_Msk (0xFUL << SCB_CTR_CWG_Pos) /*!< SCB CTR: CWG Mask */ - -#define SCB_CTR_ERG_Pos 20U /*!< SCB CTR: ERG Position */ -#define SCB_CTR_ERG_Msk (0xFUL << SCB_CTR_ERG_Pos) /*!< SCB CTR: ERG Mask */ - -#define SCB_CTR_DMINLINE_Pos 16U /*!< SCB CTR: DminLine Position */ -#define SCB_CTR_DMINLINE_Msk (0xFUL << SCB_CTR_DMINLINE_Pos) /*!< SCB CTR: DminLine Mask */ - -#define SCB_CTR_IMINLINE_Pos 0U /*!< SCB CTR: ImInLine Position */ -#define SCB_CTR_IMINLINE_Msk (0xFUL /*<< SCB_CTR_IMINLINE_Pos*/) /*!< SCB CTR: ImInLine Mask */ - -/* SCB Cache Size ID Register Definitions */ -#define SCB_CCSIDR_WT_Pos 31U /*!< SCB CCSIDR: WT Position */ -#define SCB_CCSIDR_WT_Msk (1UL << SCB_CCSIDR_WT_Pos) /*!< SCB CCSIDR: WT Mask */ - -#define SCB_CCSIDR_WB_Pos 30U /*!< SCB CCSIDR: WB Position */ -#define SCB_CCSIDR_WB_Msk (1UL << SCB_CCSIDR_WB_Pos) /*!< SCB CCSIDR: WB Mask */ - -#define SCB_CCSIDR_RA_Pos 29U /*!< SCB CCSIDR: RA Position */ -#define SCB_CCSIDR_RA_Msk (1UL << SCB_CCSIDR_RA_Pos) /*!< SCB CCSIDR: RA Mask */ - -#define SCB_CCSIDR_WA_Pos 28U /*!< SCB CCSIDR: WA Position */ -#define SCB_CCSIDR_WA_Msk (1UL << SCB_CCSIDR_WA_Pos) /*!< SCB CCSIDR: WA Mask */ - -#define SCB_CCSIDR_NUMSETS_Pos 13U /*!< SCB CCSIDR: NumSets Position */ -#define SCB_CCSIDR_NUMSETS_Msk (0x7FFFUL << SCB_CCSIDR_NUMSETS_Pos) /*!< SCB CCSIDR: NumSets Mask */ - -#define SCB_CCSIDR_ASSOCIATIVITY_Pos 3U /*!< SCB CCSIDR: Associativity Position */ -#define SCB_CCSIDR_ASSOCIATIVITY_Msk (0x3FFUL << SCB_CCSIDR_ASSOCIATIVITY_Pos) /*!< SCB CCSIDR: Associativity Mask */ - -#define SCB_CCSIDR_LINESIZE_Pos 0U /*!< SCB CCSIDR: LineSize Position */ -#define SCB_CCSIDR_LINESIZE_Msk (7UL /*<< SCB_CCSIDR_LINESIZE_Pos*/) /*!< SCB CCSIDR: LineSize Mask */ - -/* SCB Cache Size Selection Register Definitions */ -#define SCB_CSSELR_LEVEL_Pos 1U /*!< SCB CSSELR: Level Position */ -#define SCB_CSSELR_LEVEL_Msk (7UL << SCB_CSSELR_LEVEL_Pos) /*!< SCB CSSELR: Level Mask */ - -#define SCB_CSSELR_IND_Pos 0U /*!< SCB CSSELR: InD Position */ -#define SCB_CSSELR_IND_Msk (1UL /*<< SCB_CSSELR_IND_Pos*/) /*!< SCB CSSELR: InD Mask */ - -/* SCB Software Triggered Interrupt Register Definitions */ -#define SCB_STIR_INTID_Pos 0U /*!< SCB STIR: INTID Position */ -#define SCB_STIR_INTID_Msk (0x1FFUL /*<< SCB_STIR_INTID_Pos*/) /*!< SCB STIR: INTID Mask */ - -/* SCB D-Cache Invalidate by Set-way Register Definitions */ -#define SCB_DCISW_WAY_Pos 30U /*!< SCB DCISW: Way Position */ -#define SCB_DCISW_WAY_Msk (3UL << SCB_DCISW_WAY_Pos) /*!< SCB DCISW: Way Mask */ - -#define SCB_DCISW_SET_Pos 5U /*!< SCB DCISW: Set Position */ -#define SCB_DCISW_SET_Msk (0x1FFUL << SCB_DCISW_SET_Pos) /*!< SCB DCISW: Set Mask */ - -/* SCB D-Cache Clean by Set-way Register Definitions */ -#define SCB_DCCSW_WAY_Pos 30U /*!< SCB DCCSW: Way Position */ -#define SCB_DCCSW_WAY_Msk (3UL << SCB_DCCSW_WAY_Pos) /*!< SCB DCCSW: Way Mask */ - -#define SCB_DCCSW_SET_Pos 5U /*!< SCB DCCSW: Set Position */ -#define SCB_DCCSW_SET_Msk (0x1FFUL << SCB_DCCSW_SET_Pos) /*!< SCB DCCSW: Set Mask */ - -/* SCB D-Cache Clean and Invalidate by Set-way Register Definitions */ -#define SCB_DCCISW_WAY_Pos 30U /*!< SCB DCCISW: Way Position */ -#define SCB_DCCISW_WAY_Msk (3UL << SCB_DCCISW_WAY_Pos) /*!< SCB DCCISW: Way Mask */ - -#define SCB_DCCISW_SET_Pos 5U /*!< SCB DCCISW: Set Position */ -#define SCB_DCCISW_SET_Msk (0x1FFUL << SCB_DCCISW_SET_Pos) /*!< SCB DCCISW: Set Mask */ - -/*@} end of group CMSIS_SCB */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) - \brief Type definitions for the System Control and ID Register not in the SCB - @{ - */ - -/** - \brief Structure type to access the System Control and ID Register not in the SCB. - */ -typedef struct -{ - uint32_t RESERVED0[1U]; - __IM uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */ - __IOM uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ - __IOM uint32_t CPPWR; /*!< Offset: 0x00C (R/W) Coprocessor Power Control Register */ -} SCnSCB_Type; - -/* Interrupt Controller Type Register Definitions */ -#define SCnSCB_ICTR_INTLINESNUM_Pos 0U /*!< ICTR: INTLINESNUM Position */ -#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */ - -/*@} end of group CMSIS_SCnotSCB */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_SysTick System Tick Timer (SysTick) - \brief Type definitions for the System Timer Registers. - @{ - */ - -/** - \brief Structure type to access the System Timer (SysTick). - */ -typedef struct -{ - __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ - __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ - __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ - __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ -} SysTick_Type; - -/* SysTick Control / Status Register Definitions */ -#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ -#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ - -#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ -#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ - -#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ -#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ - -#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ -#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ - -/* SysTick Reload Register Definitions */ -#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ -#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ - -/* SysTick Current Register Definitions */ -#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ -#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ - -/* SysTick Calibration Register Definitions */ -#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ -#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ - -#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ -#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ - -#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ -#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ - -/*@} end of group CMSIS_SysTick */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM) - \brief Type definitions for the Instrumentation Trace Macrocell (ITM) - @{ - */ - -/** - \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM). - */ -typedef struct -{ - __OM union - { - __OM uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */ - __OM uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */ - __OM uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */ - } PORT [32U]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */ - uint32_t RESERVED0[864U]; - __IOM uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */ - uint32_t RESERVED1[15U]; - __IOM uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */ - uint32_t RESERVED2[15U]; - __IOM uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */ - uint32_t RESERVED3[32U]; - uint32_t RESERVED4[43U]; - __OM uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */ - __IM uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */ - uint32_t RESERVED5[1U]; - __IM uint32_t DEVARCH; /*!< Offset: 0xFBC (R/ ) ITM Device Architecture Register */ - uint32_t RESERVED6[4U]; - __IM uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */ - __IM uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */ - __IM uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */ - __IM uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */ - __IM uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */ - __IM uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */ - __IM uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */ - __IM uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */ - __IM uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */ - __IM uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */ - __IM uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */ - __IM uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */ -} ITM_Type; - -/* ITM Stimulus Port Register Definitions */ -#define ITM_STIM_DISABLED_Pos 1U /*!< ITM STIM: DISABLED Position */ -#define ITM_STIM_DISABLED_Msk (0x1UL << ITM_STIM_DISABLED_Pos) /*!< ITM STIM: DISABLED Mask */ - -#define ITM_STIM_FIFOREADY_Pos 0U /*!< ITM STIM: FIFOREADY Position */ -#define ITM_STIM_FIFOREADY_Msk (0x1UL /*<< ITM_STIM_FIFOREADY_Pos*/) /*!< ITM STIM: FIFOREADY Mask */ - -/* ITM Trace Privilege Register Definitions */ -#define ITM_TPR_PRIVMASK_Pos 0U /*!< ITM TPR: PRIVMASK Position */ -#define ITM_TPR_PRIVMASK_Msk (0xFFFFFFFFUL /*<< ITM_TPR_PRIVMASK_Pos*/) /*!< ITM TPR: PRIVMASK Mask */ - -/* ITM Trace Control Register Definitions */ -#define ITM_TCR_BUSY_Pos 23U /*!< ITM TCR: BUSY Position */ -#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */ - -#define ITM_TCR_TRACEBUSID_Pos 16U /*!< ITM TCR: ATBID Position */ -#define ITM_TCR_TRACEBUSID_Msk (0x7FUL << ITM_TCR_TRACEBUSID_Pos) /*!< ITM TCR: ATBID Mask */ - -#define ITM_TCR_GTSFREQ_Pos 10U /*!< ITM TCR: Global timestamp frequency Position */ -#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */ - -#define ITM_TCR_TSPRESCALE_Pos 8U /*!< ITM TCR: TSPRESCALE Position */ -#define ITM_TCR_TSPRESCALE_Msk (3UL << ITM_TCR_TSPRESCALE_Pos) /*!< ITM TCR: TSPRESCALE Mask */ - -#define ITM_TCR_STALLENA_Pos 5U /*!< ITM TCR: STALLENA Position */ -#define ITM_TCR_STALLENA_Msk (1UL << ITM_TCR_STALLENA_Pos) /*!< ITM TCR: STALLENA Mask */ - -#define ITM_TCR_SWOENA_Pos 4U /*!< ITM TCR: SWOENA Position */ -#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */ - -#define ITM_TCR_DWTENA_Pos 3U /*!< ITM TCR: DWTENA Position */ -#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */ - -#define ITM_TCR_SYNCENA_Pos 2U /*!< ITM TCR: SYNCENA Position */ -#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */ - -#define ITM_TCR_TSENA_Pos 1U /*!< ITM TCR: TSENA Position */ -#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */ - -#define ITM_TCR_ITMENA_Pos 0U /*!< ITM TCR: ITM Enable bit Position */ -#define ITM_TCR_ITMENA_Msk (1UL /*<< ITM_TCR_ITMENA_Pos*/) /*!< ITM TCR: ITM Enable bit Mask */ - -/* ITM Lock Status Register Definitions */ -#define ITM_LSR_ByteAcc_Pos 2U /*!< ITM LSR: ByteAcc Position */ -#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */ - -#define ITM_LSR_Access_Pos 1U /*!< ITM LSR: Access Position */ -#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */ - -#define ITM_LSR_Present_Pos 0U /*!< ITM LSR: Present Position */ -#define ITM_LSR_Present_Msk (1UL /*<< ITM_LSR_Present_Pos*/) /*!< ITM LSR: Present Mask */ - -/*@}*/ /* end of group CMSIS_ITM */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT) - \brief Type definitions for the Data Watchpoint and Trace (DWT) - @{ - */ - -/** - \brief Structure type to access the Data Watchpoint and Trace Register (DWT). - */ -typedef struct -{ - __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ - __IOM uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */ - __IOM uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */ - __IOM uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */ - __IOM uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */ - __IOM uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */ - __IOM uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */ - __IM uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ - __IOM uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ - uint32_t RESERVED1[1U]; - __IOM uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ - uint32_t RESERVED2[1U]; - __IOM uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ - uint32_t RESERVED3[1U]; - __IOM uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ - uint32_t RESERVED4[1U]; - __IOM uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ - uint32_t RESERVED5[1U]; - __IOM uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ - uint32_t RESERVED6[1U]; - __IOM uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ - uint32_t RESERVED7[1U]; - __IOM uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ - uint32_t RESERVED8[1U]; - __IOM uint32_t COMP4; /*!< Offset: 0x060 (R/W) Comparator Register 4 */ - uint32_t RESERVED9[1U]; - __IOM uint32_t FUNCTION4; /*!< Offset: 0x068 (R/W) Function Register 4 */ - uint32_t RESERVED10[1U]; - __IOM uint32_t COMP5; /*!< Offset: 0x070 (R/W) Comparator Register 5 */ - uint32_t RESERVED11[1U]; - __IOM uint32_t FUNCTION5; /*!< Offset: 0x078 (R/W) Function Register 5 */ - uint32_t RESERVED12[1U]; - __IOM uint32_t COMP6; /*!< Offset: 0x080 (R/W) Comparator Register 6 */ - uint32_t RESERVED13[1U]; - __IOM uint32_t FUNCTION6; /*!< Offset: 0x088 (R/W) Function Register 6 */ - uint32_t RESERVED14[1U]; - __IOM uint32_t COMP7; /*!< Offset: 0x090 (R/W) Comparator Register 7 */ - uint32_t RESERVED15[1U]; - __IOM uint32_t FUNCTION7; /*!< Offset: 0x098 (R/W) Function Register 7 */ - uint32_t RESERVED16[1U]; - __IOM uint32_t COMP8; /*!< Offset: 0x0A0 (R/W) Comparator Register 8 */ - uint32_t RESERVED17[1U]; - __IOM uint32_t FUNCTION8; /*!< Offset: 0x0A8 (R/W) Function Register 8 */ - uint32_t RESERVED18[1U]; - __IOM uint32_t COMP9; /*!< Offset: 0x0B0 (R/W) Comparator Register 9 */ - uint32_t RESERVED19[1U]; - __IOM uint32_t FUNCTION9; /*!< Offset: 0x0B8 (R/W) Function Register 9 */ - uint32_t RESERVED20[1U]; - __IOM uint32_t COMP10; /*!< Offset: 0x0C0 (R/W) Comparator Register 10 */ - uint32_t RESERVED21[1U]; - __IOM uint32_t FUNCTION10; /*!< Offset: 0x0C8 (R/W) Function Register 10 */ - uint32_t RESERVED22[1U]; - __IOM uint32_t COMP11; /*!< Offset: 0x0D0 (R/W) Comparator Register 11 */ - uint32_t RESERVED23[1U]; - __IOM uint32_t FUNCTION11; /*!< Offset: 0x0D8 (R/W) Function Register 11 */ - uint32_t RESERVED24[1U]; - __IOM uint32_t COMP12; /*!< Offset: 0x0E0 (R/W) Comparator Register 12 */ - uint32_t RESERVED25[1U]; - __IOM uint32_t FUNCTION12; /*!< Offset: 0x0E8 (R/W) Function Register 12 */ - uint32_t RESERVED26[1U]; - __IOM uint32_t COMP13; /*!< Offset: 0x0F0 (R/W) Comparator Register 13 */ - uint32_t RESERVED27[1U]; - __IOM uint32_t FUNCTION13; /*!< Offset: 0x0F8 (R/W) Function Register 13 */ - uint32_t RESERVED28[1U]; - __IOM uint32_t COMP14; /*!< Offset: 0x100 (R/W) Comparator Register 14 */ - uint32_t RESERVED29[1U]; - __IOM uint32_t FUNCTION14; /*!< Offset: 0x108 (R/W) Function Register 14 */ - uint32_t RESERVED30[1U]; - __IOM uint32_t COMP15; /*!< Offset: 0x110 (R/W) Comparator Register 15 */ - uint32_t RESERVED31[1U]; - __IOM uint32_t FUNCTION15; /*!< Offset: 0x118 (R/W) Function Register 15 */ - uint32_t RESERVED32[934U]; - __IM uint32_t LSR; /*!< Offset: 0xFB4 (R ) Lock Status Register */ - uint32_t RESERVED33[1U]; - __IM uint32_t DEVARCH; /*!< Offset: 0xFBC (R/ ) Device Architecture Register */ -} DWT_Type; - -/* DWT Control Register Definitions */ -#define DWT_CTRL_NUMCOMP_Pos 28U /*!< DWT CTRL: NUMCOMP Position */ -#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ - -#define DWT_CTRL_NOTRCPKT_Pos 27U /*!< DWT CTRL: NOTRCPKT Position */ -#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ - -#define DWT_CTRL_NOEXTTRIG_Pos 26U /*!< DWT CTRL: NOEXTTRIG Position */ -#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ - -#define DWT_CTRL_NOCYCCNT_Pos 25U /*!< DWT CTRL: NOCYCCNT Position */ -#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ - -#define DWT_CTRL_NOPRFCNT_Pos 24U /*!< DWT CTRL: NOPRFCNT Position */ -#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ - -#define DWT_CTRL_CYCDISS_Pos 23U /*!< DWT CTRL: CYCDISS Position */ -#define DWT_CTRL_CYCDISS_Msk (0x1UL << DWT_CTRL_CYCDISS_Pos) /*!< DWT CTRL: CYCDISS Mask */ - -#define DWT_CTRL_CYCEVTENA_Pos 22U /*!< DWT CTRL: CYCEVTENA Position */ -#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */ - -#define DWT_CTRL_FOLDEVTENA_Pos 21U /*!< DWT CTRL: FOLDEVTENA Position */ -#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */ - -#define DWT_CTRL_LSUEVTENA_Pos 20U /*!< DWT CTRL: LSUEVTENA Position */ -#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */ - -#define DWT_CTRL_SLEEPEVTENA_Pos 19U /*!< DWT CTRL: SLEEPEVTENA Position */ -#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */ - -#define DWT_CTRL_EXCEVTENA_Pos 18U /*!< DWT CTRL: EXCEVTENA Position */ -#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */ - -#define DWT_CTRL_CPIEVTENA_Pos 17U /*!< DWT CTRL: CPIEVTENA Position */ -#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */ - -#define DWT_CTRL_EXCTRCENA_Pos 16U /*!< DWT CTRL: EXCTRCENA Position */ -#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */ - -#define DWT_CTRL_PCSAMPLENA_Pos 12U /*!< DWT CTRL: PCSAMPLENA Position */ -#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */ - -#define DWT_CTRL_SYNCTAP_Pos 10U /*!< DWT CTRL: SYNCTAP Position */ -#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */ - -#define DWT_CTRL_CYCTAP_Pos 9U /*!< DWT CTRL: CYCTAP Position */ -#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */ - -#define DWT_CTRL_POSTINIT_Pos 5U /*!< DWT CTRL: POSTINIT Position */ -#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */ - -#define DWT_CTRL_POSTPRESET_Pos 1U /*!< DWT CTRL: POSTPRESET Position */ -#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */ - -#define DWT_CTRL_CYCCNTENA_Pos 0U /*!< DWT CTRL: CYCCNTENA Position */ -#define DWT_CTRL_CYCCNTENA_Msk (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/) /*!< DWT CTRL: CYCCNTENA Mask */ - -/* DWT CPI Count Register Definitions */ -#define DWT_CPICNT_CPICNT_Pos 0U /*!< DWT CPICNT: CPICNT Position */ -#define DWT_CPICNT_CPICNT_Msk (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/) /*!< DWT CPICNT: CPICNT Mask */ - -/* DWT Exception Overhead Count Register Definitions */ -#define DWT_EXCCNT_EXCCNT_Pos 0U /*!< DWT EXCCNT: EXCCNT Position */ -#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/) /*!< DWT EXCCNT: EXCCNT Mask */ - -/* DWT Sleep Count Register Definitions */ -#define DWT_SLEEPCNT_SLEEPCNT_Pos 0U /*!< DWT SLEEPCNT: SLEEPCNT Position */ -#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/) /*!< DWT SLEEPCNT: SLEEPCNT Mask */ - -/* DWT LSU Count Register Definitions */ -#define DWT_LSUCNT_LSUCNT_Pos 0U /*!< DWT LSUCNT: LSUCNT Position */ -#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/) /*!< DWT LSUCNT: LSUCNT Mask */ - -/* DWT Folded-instruction Count Register Definitions */ -#define DWT_FOLDCNT_FOLDCNT_Pos 0U /*!< DWT FOLDCNT: FOLDCNT Position */ -#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/) /*!< DWT FOLDCNT: FOLDCNT Mask */ - -/* DWT Comparator Function Register Definitions */ -#define DWT_FUNCTION_ID_Pos 27U /*!< DWT FUNCTION: ID Position */ -#define DWT_FUNCTION_ID_Msk (0x1FUL << DWT_FUNCTION_ID_Pos) /*!< DWT FUNCTION: ID Mask */ - -#define DWT_FUNCTION_MATCHED_Pos 24U /*!< DWT FUNCTION: MATCHED Position */ -#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ - -#define DWT_FUNCTION_DATAVSIZE_Pos 10U /*!< DWT FUNCTION: DATAVSIZE Position */ -#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ - -#define DWT_FUNCTION_ACTION_Pos 4U /*!< DWT FUNCTION: ACTION Position */ -#define DWT_FUNCTION_ACTION_Msk (0x1UL << DWT_FUNCTION_ACTION_Pos) /*!< DWT FUNCTION: ACTION Mask */ - -#define DWT_FUNCTION_MATCH_Pos 0U /*!< DWT FUNCTION: MATCH Position */ -#define DWT_FUNCTION_MATCH_Msk (0xFUL /*<< DWT_FUNCTION_MATCH_Pos*/) /*!< DWT FUNCTION: MATCH Mask */ - -/*@}*/ /* end of group CMSIS_DWT */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_TPI Trace Port Interface (TPI) - \brief Type definitions for the Trace Port Interface (TPI) - @{ - */ - -/** - \brief Structure type to access the Trace Port Interface Register (TPI). - */ -typedef struct -{ - __IM uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Size Register */ - __IOM uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Size Register */ - uint32_t RESERVED0[2U]; - __IOM uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ - uint32_t RESERVED1[55U]; - __IOM uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ - uint32_t RESERVED2[131U]; - __IM uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ - __IOM uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ - __IOM uint32_t PSCR; /*!< Offset: 0x308 (R/W) Periodic Synchronization Control Register */ - uint32_t RESERVED3[759U]; - __IM uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER Register */ - __IM uint32_t ITFTTD0; /*!< Offset: 0xEEC (R/ ) Integration Test FIFO Test Data 0 Register */ - __IOM uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/W) Integration Test ATB Control Register 2 */ - uint32_t RESERVED4[1U]; - __IM uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) Integration Test ATB Control Register 0 */ - __IM uint32_t ITFTTD1; /*!< Offset: 0xEFC (R/ ) Integration Test FIFO Test Data 1 Register */ - __IOM uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */ - uint32_t RESERVED5[39U]; - __IOM uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */ - __IOM uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */ - uint32_t RESERVED7[8U]; - __IM uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) Device Configuration Register */ - __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) Device Type Identifier Register */ -} TPI_Type; - -/* TPI Asynchronous Clock Prescaler Register Definitions */ -#define TPI_ACPR_PRESCALER_Pos 0U /*!< TPI ACPR: PRESCALER Position */ -#define TPI_ACPR_PRESCALER_Msk (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/) /*!< TPI ACPR: PRESCALER Mask */ - -/* TPI Selected Pin Protocol Register Definitions */ -#define TPI_SPPR_TXMODE_Pos 0U /*!< TPI SPPR: TXMODE Position */ -#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */ - -/* TPI Formatter and Flush Status Register Definitions */ -#define TPI_FFSR_FtNonStop_Pos 3U /*!< TPI FFSR: FtNonStop Position */ -#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ - -#define TPI_FFSR_TCPresent_Pos 2U /*!< TPI FFSR: TCPresent Position */ -#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ - -#define TPI_FFSR_FtStopped_Pos 1U /*!< TPI FFSR: FtStopped Position */ -#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ - -#define TPI_FFSR_FlInProg_Pos 0U /*!< TPI FFSR: FlInProg Position */ -#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */ - -/* TPI Formatter and Flush Control Register Definitions */ -#define TPI_FFCR_TrigIn_Pos 8U /*!< TPI FFCR: TrigIn Position */ -#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ - -#define TPI_FFCR_FOnMan_Pos 6U /*!< TPI FFCR: FOnMan Position */ -#define TPI_FFCR_FOnMan_Msk (0x1UL << TPI_FFCR_FOnMan_Pos) /*!< TPI FFCR: FOnMan Mask */ - -#define TPI_FFCR_EnFCont_Pos 1U /*!< TPI FFCR: EnFCont Position */ -#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */ - -/* TPI TRIGGER Register Definitions */ -#define TPI_TRIGGER_TRIGGER_Pos 0U /*!< TPI TRIGGER: TRIGGER Position */ -#define TPI_TRIGGER_TRIGGER_Msk (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/) /*!< TPI TRIGGER: TRIGGER Mask */ - -/* TPI Integration Test FIFO Test Data 0 Register Definitions */ -#define TPI_ITFTTD0_ATB_IF2_ATVALID_Pos 29U /*!< TPI ITFTTD0: ATB Interface 2 ATVALIDPosition */ -#define TPI_ITFTTD0_ATB_IF2_ATVALID_Msk (0x3UL << TPI_ITFTTD0_ATB_IF2_ATVALID_Pos) /*!< TPI ITFTTD0: ATB Interface 2 ATVALID Mask */ - -#define TPI_ITFTTD0_ATB_IF2_bytecount_Pos 27U /*!< TPI ITFTTD0: ATB Interface 2 byte count Position */ -#define TPI_ITFTTD0_ATB_IF2_bytecount_Msk (0x3UL << TPI_ITFTTD0_ATB_IF2_bytecount_Pos) /*!< TPI ITFTTD0: ATB Interface 2 byte count Mask */ - -#define TPI_ITFTTD0_ATB_IF1_ATVALID_Pos 26U /*!< TPI ITFTTD0: ATB Interface 1 ATVALID Position */ -#define TPI_ITFTTD0_ATB_IF1_ATVALID_Msk (0x3UL << TPI_ITFTTD0_ATB_IF1_ATVALID_Pos) /*!< TPI ITFTTD0: ATB Interface 1 ATVALID Mask */ - -#define TPI_ITFTTD0_ATB_IF1_bytecount_Pos 24U /*!< TPI ITFTTD0: ATB Interface 1 byte count Position */ -#define TPI_ITFTTD0_ATB_IF1_bytecount_Msk (0x3UL << TPI_ITFTTD0_ATB_IF1_bytecount_Pos) /*!< TPI ITFTTD0: ATB Interface 1 byte countt Mask */ - -#define TPI_ITFTTD0_ATB_IF1_data2_Pos 16U /*!< TPI ITFTTD0: ATB Interface 1 data2 Position */ -#define TPI_ITFTTD0_ATB_IF1_data2_Msk (0xFFUL << TPI_ITFTTD0_ATB_IF1_data1_Pos) /*!< TPI ITFTTD0: ATB Interface 1 data2 Mask */ - -#define TPI_ITFTTD0_ATB_IF1_data1_Pos 8U /*!< TPI ITFTTD0: ATB Interface 1 data1 Position */ -#define TPI_ITFTTD0_ATB_IF1_data1_Msk (0xFFUL << TPI_ITFTTD0_ATB_IF1_data1_Pos) /*!< TPI ITFTTD0: ATB Interface 1 data1 Mask */ - -#define TPI_ITFTTD0_ATB_IF1_data0_Pos 0U /*!< TPI ITFTTD0: ATB Interface 1 data0 Position */ -#define TPI_ITFTTD0_ATB_IF1_data0_Msk (0xFFUL /*<< TPI_ITFTTD0_ATB_IF1_data0_Pos*/) /*!< TPI ITFTTD0: ATB Interface 1 data0 Mask */ - -/* TPI Integration Test ATB Control Register 2 Register Definitions */ -#define TPI_ITATBCTR2_AFVALID2S_Pos 1U /*!< TPI ITATBCTR2: AFVALID2S Position */ -#define TPI_ITATBCTR2_AFVALID2S_Msk (0x1UL << TPI_ITATBCTR2_AFVALID2S_Pos) /*!< TPI ITATBCTR2: AFVALID2SS Mask */ - -#define TPI_ITATBCTR2_AFVALID1S_Pos 1U /*!< TPI ITATBCTR2: AFVALID1S Position */ -#define TPI_ITATBCTR2_AFVALID1S_Msk (0x1UL << TPI_ITATBCTR2_AFVALID1S_Pos) /*!< TPI ITATBCTR2: AFVALID1SS Mask */ - -#define TPI_ITATBCTR2_ATREADY2S_Pos 0U /*!< TPI ITATBCTR2: ATREADY2S Position */ -#define TPI_ITATBCTR2_ATREADY2S_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY2S_Pos*/) /*!< TPI ITATBCTR2: ATREADY2S Mask */ - -#define TPI_ITATBCTR2_ATREADY1S_Pos 0U /*!< TPI ITATBCTR2: ATREADY1S Position */ -#define TPI_ITATBCTR2_ATREADY1S_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY1S_Pos*/) /*!< TPI ITATBCTR2: ATREADY1S Mask */ - -/* TPI Integration Test FIFO Test Data 1 Register Definitions */ -#define TPI_ITFTTD1_ATB_IF2_ATVALID_Pos 29U /*!< TPI ITFTTD1: ATB Interface 2 ATVALID Position */ -#define TPI_ITFTTD1_ATB_IF2_ATVALID_Msk (0x3UL << TPI_ITFTTD1_ATB_IF2_ATVALID_Pos) /*!< TPI ITFTTD1: ATB Interface 2 ATVALID Mask */ - -#define TPI_ITFTTD1_ATB_IF2_bytecount_Pos 27U /*!< TPI ITFTTD1: ATB Interface 2 byte count Position */ -#define TPI_ITFTTD1_ATB_IF2_bytecount_Msk (0x3UL << TPI_ITFTTD1_ATB_IF2_bytecount_Pos) /*!< TPI ITFTTD1: ATB Interface 2 byte count Mask */ - -#define TPI_ITFTTD1_ATB_IF1_ATVALID_Pos 26U /*!< TPI ITFTTD1: ATB Interface 1 ATVALID Position */ -#define TPI_ITFTTD1_ATB_IF1_ATVALID_Msk (0x3UL << TPI_ITFTTD1_ATB_IF1_ATVALID_Pos) /*!< TPI ITFTTD1: ATB Interface 1 ATVALID Mask */ - -#define TPI_ITFTTD1_ATB_IF1_bytecount_Pos 24U /*!< TPI ITFTTD1: ATB Interface 1 byte count Position */ -#define TPI_ITFTTD1_ATB_IF1_bytecount_Msk (0x3UL << TPI_ITFTTD1_ATB_IF1_bytecount_Pos) /*!< TPI ITFTTD1: ATB Interface 1 byte countt Mask */ - -#define TPI_ITFTTD1_ATB_IF2_data2_Pos 16U /*!< TPI ITFTTD1: ATB Interface 2 data2 Position */ -#define TPI_ITFTTD1_ATB_IF2_data2_Msk (0xFFUL << TPI_ITFTTD1_ATB_IF2_data1_Pos) /*!< TPI ITFTTD1: ATB Interface 2 data2 Mask */ - -#define TPI_ITFTTD1_ATB_IF2_data1_Pos 8U /*!< TPI ITFTTD1: ATB Interface 2 data1 Position */ -#define TPI_ITFTTD1_ATB_IF2_data1_Msk (0xFFUL << TPI_ITFTTD1_ATB_IF2_data1_Pos) /*!< TPI ITFTTD1: ATB Interface 2 data1 Mask */ - -#define TPI_ITFTTD1_ATB_IF2_data0_Pos 0U /*!< TPI ITFTTD1: ATB Interface 2 data0 Position */ -#define TPI_ITFTTD1_ATB_IF2_data0_Msk (0xFFUL /*<< TPI_ITFTTD1_ATB_IF2_data0_Pos*/) /*!< TPI ITFTTD1: ATB Interface 2 data0 Mask */ - -/* TPI Integration Test ATB Control Register 0 Definitions */ -#define TPI_ITATBCTR0_AFVALID2S_Pos 1U /*!< TPI ITATBCTR0: AFVALID2S Position */ -#define TPI_ITATBCTR0_AFVALID2S_Msk (0x1UL << TPI_ITATBCTR0_AFVALID2S_Pos) /*!< TPI ITATBCTR0: AFVALID2SS Mask */ - -#define TPI_ITATBCTR0_AFVALID1S_Pos 1U /*!< TPI ITATBCTR0: AFVALID1S Position */ -#define TPI_ITATBCTR0_AFVALID1S_Msk (0x1UL << TPI_ITATBCTR0_AFVALID1S_Pos) /*!< TPI ITATBCTR0: AFVALID1SS Mask */ - -#define TPI_ITATBCTR0_ATREADY2S_Pos 0U /*!< TPI ITATBCTR0: ATREADY2S Position */ -#define TPI_ITATBCTR0_ATREADY2S_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY2S_Pos*/) /*!< TPI ITATBCTR0: ATREADY2S Mask */ - -#define TPI_ITATBCTR0_ATREADY1S_Pos 0U /*!< TPI ITATBCTR0: ATREADY1S Position */ -#define TPI_ITATBCTR0_ATREADY1S_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY1S_Pos*/) /*!< TPI ITATBCTR0: ATREADY1S Mask */ - -/* TPI Integration Mode Control Register Definitions */ -#define TPI_ITCTRL_Mode_Pos 0U /*!< TPI ITCTRL: Mode Position */ -#define TPI_ITCTRL_Mode_Msk (0x3UL /*<< TPI_ITCTRL_Mode_Pos*/) /*!< TPI ITCTRL: Mode Mask */ - -/* TPI DEVID Register Definitions */ -#define TPI_DEVID_NRZVALID_Pos 11U /*!< TPI DEVID: NRZVALID Position */ -#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ - -#define TPI_DEVID_MANCVALID_Pos 10U /*!< TPI DEVID: MANCVALID Position */ -#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ - -#define TPI_DEVID_PTINVALID_Pos 9U /*!< TPI DEVID: PTINVALID Position */ -#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ - -#define TPI_DEVID_FIFOSZ_Pos 6U /*!< TPI DEVID: FIFOSZ Position */ -#define TPI_DEVID_FIFOSZ_Msk (0x7UL << TPI_DEVID_FIFOSZ_Pos) /*!< TPI DEVID: FIFOSZ Mask */ - -#define TPI_DEVID_NrTraceInput_Pos 0U /*!< TPI DEVID: NrTraceInput Position */ -#define TPI_DEVID_NrTraceInput_Msk (0x3FUL /*<< TPI_DEVID_NrTraceInput_Pos*/) /*!< TPI DEVID: NrTraceInput Mask */ - -/* TPI DEVTYPE Register Definitions */ -#define TPI_DEVTYPE_SubType_Pos 4U /*!< TPI DEVTYPE: SubType Position */ -#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */ - -#define TPI_DEVTYPE_MajorType_Pos 0U /*!< TPI DEVTYPE: MajorType Position */ -#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ - -/*@}*/ /* end of group CMSIS_TPI */ - - -#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_MPU Memory Protection Unit (MPU) - \brief Type definitions for the Memory Protection Unit (MPU) - @{ - */ - -/** - \brief Structure type to access the Memory Protection Unit (MPU). - */ -typedef struct -{ - __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ - __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ - __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region Number Register */ - __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ - __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) MPU Region Limit Address Register */ - __IOM uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Region Base Address Register Alias 1 */ - __IOM uint32_t RLAR_A1; /*!< Offset: 0x018 (R/W) MPU Region Limit Address Register Alias 1 */ - __IOM uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Region Base Address Register Alias 2 */ - __IOM uint32_t RLAR_A2; /*!< Offset: 0x020 (R/W) MPU Region Limit Address Register Alias 2 */ - __IOM uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Region Base Address Register Alias 3 */ - __IOM uint32_t RLAR_A3; /*!< Offset: 0x028 (R/W) MPU Region Limit Address Register Alias 3 */ - uint32_t RESERVED0[1]; - union { - __IOM uint32_t MAIR[2]; - struct { - __IOM uint32_t MAIR0; /*!< Offset: 0x030 (R/W) MPU Memory Attribute Indirection Register 0 */ - __IOM uint32_t MAIR1; /*!< Offset: 0x034 (R/W) MPU Memory Attribute Indirection Register 1 */ - }; - }; -} MPU_Type; - -#define MPU_TYPE_RALIASES 4U - -/* MPU Type Register Definitions */ -#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */ -#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ - -#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */ -#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ - -#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */ -#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ - -/* MPU Control Register Definitions */ -#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */ -#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ - -#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */ -#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ - -#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */ -#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ - -/* MPU Region Number Register Definitions */ -#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */ -#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ - -/* MPU Region Base Address Register Definitions */ -#define MPU_RBAR_BASE_Pos 5U /*!< MPU RBAR: BASE Position */ -#define MPU_RBAR_BASE_Msk (0x7FFFFFFUL << MPU_RBAR_BASE_Pos) /*!< MPU RBAR: BASE Mask */ - -#define MPU_RBAR_SH_Pos 3U /*!< MPU RBAR: SH Position */ -#define MPU_RBAR_SH_Msk (0x3UL << MPU_RBAR_SH_Pos) /*!< MPU RBAR: SH Mask */ - -#define MPU_RBAR_AP_Pos 1U /*!< MPU RBAR: AP Position */ -#define MPU_RBAR_AP_Msk (0x3UL << MPU_RBAR_AP_Pos) /*!< MPU RBAR: AP Mask */ - -#define MPU_RBAR_XN_Pos 0U /*!< MPU RBAR: XN Position */ -#define MPU_RBAR_XN_Msk (01UL /*<< MPU_RBAR_XN_Pos*/) /*!< MPU RBAR: XN Mask */ - -/* MPU Region Limit Address Register Definitions */ -#define MPU_RLAR_LIMIT_Pos 5U /*!< MPU RLAR: LIMIT Position */ -#define MPU_RLAR_LIMIT_Msk (0x7FFFFFFUL << MPU_RLAR_LIMIT_Pos) /*!< MPU RLAR: LIMIT Mask */ - -#define MPU_RLAR_AttrIndx_Pos 1U /*!< MPU RLAR: AttrIndx Position */ -#define MPU_RLAR_AttrIndx_Msk (0x7UL << MPU_RLAR_AttrIndx_Pos) /*!< MPU RLAR: AttrIndx Mask */ - -#define MPU_RLAR_EN_Pos 0U /*!< MPU RLAR: Region enable bit Position */ -#define MPU_RLAR_EN_Msk (1UL /*<< MPU_RLAR_EN_Pos*/) /*!< MPU RLAR: Region enable bit Disable Mask */ - -/* MPU Memory Attribute Indirection Register 0 Definitions */ -#define MPU_MAIR0_Attr3_Pos 24U /*!< MPU MAIR0: Attr3 Position */ -#define MPU_MAIR0_Attr3_Msk (0xFFUL << MPU_MAIR0_Attr3_Pos) /*!< MPU MAIR0: Attr3 Mask */ - -#define MPU_MAIR0_Attr2_Pos 16U /*!< MPU MAIR0: Attr2 Position */ -#define MPU_MAIR0_Attr2_Msk (0xFFUL << MPU_MAIR0_Attr2_Pos) /*!< MPU MAIR0: Attr2 Mask */ - -#define MPU_MAIR0_Attr1_Pos 8U /*!< MPU MAIR0: Attr1 Position */ -#define MPU_MAIR0_Attr1_Msk (0xFFUL << MPU_MAIR0_Attr1_Pos) /*!< MPU MAIR0: Attr1 Mask */ - -#define MPU_MAIR0_Attr0_Pos 0U /*!< MPU MAIR0: Attr0 Position */ -#define MPU_MAIR0_Attr0_Msk (0xFFUL /*<< MPU_MAIR0_Attr0_Pos*/) /*!< MPU MAIR0: Attr0 Mask */ - -/* MPU Memory Attribute Indirection Register 1 Definitions */ -#define MPU_MAIR1_Attr7_Pos 24U /*!< MPU MAIR1: Attr7 Position */ -#define MPU_MAIR1_Attr7_Msk (0xFFUL << MPU_MAIR1_Attr7_Pos) /*!< MPU MAIR1: Attr7 Mask */ - -#define MPU_MAIR1_Attr6_Pos 16U /*!< MPU MAIR1: Attr6 Position */ -#define MPU_MAIR1_Attr6_Msk (0xFFUL << MPU_MAIR1_Attr6_Pos) /*!< MPU MAIR1: Attr6 Mask */ - -#define MPU_MAIR1_Attr5_Pos 8U /*!< MPU MAIR1: Attr5 Position */ -#define MPU_MAIR1_Attr5_Msk (0xFFUL << MPU_MAIR1_Attr5_Pos) /*!< MPU MAIR1: Attr5 Mask */ - -#define MPU_MAIR1_Attr4_Pos 0U /*!< MPU MAIR1: Attr4 Position */ -#define MPU_MAIR1_Attr4_Msk (0xFFUL /*<< MPU_MAIR1_Attr4_Pos*/) /*!< MPU MAIR1: Attr4 Mask */ - -/*@} end of group CMSIS_MPU */ -#endif - - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_SAU Security Attribution Unit (SAU) - \brief Type definitions for the Security Attribution Unit (SAU) - @{ - */ - -/** - \brief Structure type to access the Security Attribution Unit (SAU). - */ -typedef struct -{ - __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SAU Control Register */ - __IM uint32_t TYPE; /*!< Offset: 0x004 (R/ ) SAU Type Register */ -#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) - __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) SAU Region Number Register */ - __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) SAU Region Base Address Register */ - __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) SAU Region Limit Address Register */ -#else - uint32_t RESERVED0[3]; -#endif - __IOM uint32_t SFSR; /*!< Offset: 0x014 (R/W) Secure Fault Status Register */ - __IOM uint32_t SFAR; /*!< Offset: 0x018 (R/W) Secure Fault Address Register */ -} SAU_Type; - -/* SAU Control Register Definitions */ -#define SAU_CTRL_ALLNS_Pos 1U /*!< SAU CTRL: ALLNS Position */ -#define SAU_CTRL_ALLNS_Msk (1UL << SAU_CTRL_ALLNS_Pos) /*!< SAU CTRL: ALLNS Mask */ - -#define SAU_CTRL_ENABLE_Pos 0U /*!< SAU CTRL: ENABLE Position */ -#define SAU_CTRL_ENABLE_Msk (1UL /*<< SAU_CTRL_ENABLE_Pos*/) /*!< SAU CTRL: ENABLE Mask */ - -/* SAU Type Register Definitions */ -#define SAU_TYPE_SREGION_Pos 0U /*!< SAU TYPE: SREGION Position */ -#define SAU_TYPE_SREGION_Msk (0xFFUL /*<< SAU_TYPE_SREGION_Pos*/) /*!< SAU TYPE: SREGION Mask */ - -#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) -/* SAU Region Number Register Definitions */ -#define SAU_RNR_REGION_Pos 0U /*!< SAU RNR: REGION Position */ -#define SAU_RNR_REGION_Msk (0xFFUL /*<< SAU_RNR_REGION_Pos*/) /*!< SAU RNR: REGION Mask */ - -/* SAU Region Base Address Register Definitions */ -#define SAU_RBAR_BADDR_Pos 5U /*!< SAU RBAR: BADDR Position */ -#define SAU_RBAR_BADDR_Msk (0x7FFFFFFUL << SAU_RBAR_BADDR_Pos) /*!< SAU RBAR: BADDR Mask */ - -/* SAU Region Limit Address Register Definitions */ -#define SAU_RLAR_LADDR_Pos 5U /*!< SAU RLAR: LADDR Position */ -#define SAU_RLAR_LADDR_Msk (0x7FFFFFFUL << SAU_RLAR_LADDR_Pos) /*!< SAU RLAR: LADDR Mask */ - -#define SAU_RLAR_NSC_Pos 1U /*!< SAU RLAR: NSC Position */ -#define SAU_RLAR_NSC_Msk (1UL << SAU_RLAR_NSC_Pos) /*!< SAU RLAR: NSC Mask */ - -#define SAU_RLAR_ENABLE_Pos 0U /*!< SAU RLAR: ENABLE Position */ -#define SAU_RLAR_ENABLE_Msk (1UL /*<< SAU_RLAR_ENABLE_Pos*/) /*!< SAU RLAR: ENABLE Mask */ - -#endif /* defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) */ - -/* Secure Fault Status Register Definitions */ -#define SAU_SFSR_LSERR_Pos 7U /*!< SAU SFSR: LSERR Position */ -#define SAU_SFSR_LSERR_Msk (1UL << SAU_SFSR_LSERR_Pos) /*!< SAU SFSR: LSERR Mask */ - -#define SAU_SFSR_SFARVALID_Pos 6U /*!< SAU SFSR: SFARVALID Position */ -#define SAU_SFSR_SFARVALID_Msk (1UL << SAU_SFSR_SFARVALID_Pos) /*!< SAU SFSR: SFARVALID Mask */ - -#define SAU_SFSR_LSPERR_Pos 5U /*!< SAU SFSR: LSPERR Position */ -#define SAU_SFSR_LSPERR_Msk (1UL << SAU_SFSR_LSPERR_Pos) /*!< SAU SFSR: LSPERR Mask */ - -#define SAU_SFSR_INVTRAN_Pos 4U /*!< SAU SFSR: INVTRAN Position */ -#define SAU_SFSR_INVTRAN_Msk (1UL << SAU_SFSR_INVTRAN_Pos) /*!< SAU SFSR: INVTRAN Mask */ - -#define SAU_SFSR_AUVIOL_Pos 3U /*!< SAU SFSR: AUVIOL Position */ -#define SAU_SFSR_AUVIOL_Msk (1UL << SAU_SFSR_AUVIOL_Pos) /*!< SAU SFSR: AUVIOL Mask */ - -#define SAU_SFSR_INVER_Pos 2U /*!< SAU SFSR: INVER Position */ -#define SAU_SFSR_INVER_Msk (1UL << SAU_SFSR_INVER_Pos) /*!< SAU SFSR: INVER Mask */ - -#define SAU_SFSR_INVIS_Pos 1U /*!< SAU SFSR: INVIS Position */ -#define SAU_SFSR_INVIS_Msk (1UL << SAU_SFSR_INVIS_Pos) /*!< SAU SFSR: INVIS Mask */ - -#define SAU_SFSR_INVEP_Pos 0U /*!< SAU SFSR: INVEP Position */ -#define SAU_SFSR_INVEP_Msk (1UL /*<< SAU_SFSR_INVEP_Pos*/) /*!< SAU SFSR: INVEP Mask */ - -/*@} end of group CMSIS_SAU */ -#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_FPU Floating Point Unit (FPU) - \brief Type definitions for the Floating Point Unit (FPU) - @{ - */ - -/** - \brief Structure type to access the Floating Point Unit (FPU). - */ -typedef struct -{ - uint32_t RESERVED0[1U]; - __IOM uint32_t FPCCR; /*!< Offset: 0x004 (R/W) Floating-Point Context Control Register */ - __IOM uint32_t FPCAR; /*!< Offset: 0x008 (R/W) Floating-Point Context Address Register */ - __IOM uint32_t FPDSCR; /*!< Offset: 0x00C (R/W) Floating-Point Default Status Control Register */ - __IM uint32_t MVFR0; /*!< Offset: 0x010 (R/ ) Media and VFP Feature Register 0 */ - __IM uint32_t MVFR1; /*!< Offset: 0x014 (R/ ) Media and VFP Feature Register 1 */ - __IM uint32_t MVFR2; /*!< Offset: 0x018 (R/ ) Media and VFP Feature Register 2 */ -} FPU_Type; - -/* Floating-Point Context Control Register Definitions */ -#define FPU_FPCCR_ASPEN_Pos 31U /*!< FPCCR: ASPEN bit Position */ -#define FPU_FPCCR_ASPEN_Msk (1UL << FPU_FPCCR_ASPEN_Pos) /*!< FPCCR: ASPEN bit Mask */ - -#define FPU_FPCCR_LSPEN_Pos 30U /*!< FPCCR: LSPEN Position */ -#define FPU_FPCCR_LSPEN_Msk (1UL << FPU_FPCCR_LSPEN_Pos) /*!< FPCCR: LSPEN bit Mask */ - -#define FPU_FPCCR_LSPENS_Pos 29U /*!< FPCCR: LSPENS Position */ -#define FPU_FPCCR_LSPENS_Msk (1UL << FPU_FPCCR_LSPENS_Pos) /*!< FPCCR: LSPENS bit Mask */ - -#define FPU_FPCCR_CLRONRET_Pos 28U /*!< FPCCR: CLRONRET Position */ -#define FPU_FPCCR_CLRONRET_Msk (1UL << FPU_FPCCR_CLRONRET_Pos) /*!< FPCCR: CLRONRET bit Mask */ - -#define FPU_FPCCR_CLRONRETS_Pos 27U /*!< FPCCR: CLRONRETS Position */ -#define FPU_FPCCR_CLRONRETS_Msk (1UL << FPU_FPCCR_CLRONRETS_Pos) /*!< FPCCR: CLRONRETS bit Mask */ - -#define FPU_FPCCR_TS_Pos 26U /*!< FPCCR: TS Position */ -#define FPU_FPCCR_TS_Msk (1UL << FPU_FPCCR_TS_Pos) /*!< FPCCR: TS bit Mask */ - -#define FPU_FPCCR_UFRDY_Pos 10U /*!< FPCCR: UFRDY Position */ -#define FPU_FPCCR_UFRDY_Msk (1UL << FPU_FPCCR_UFRDY_Pos) /*!< FPCCR: UFRDY bit Mask */ - -#define FPU_FPCCR_SPLIMVIOL_Pos 9U /*!< FPCCR: SPLIMVIOL Position */ -#define FPU_FPCCR_SPLIMVIOL_Msk (1UL << FPU_FPCCR_SPLIMVIOL_Pos) /*!< FPCCR: SPLIMVIOL bit Mask */ - -#define FPU_FPCCR_MONRDY_Pos 8U /*!< FPCCR: MONRDY Position */ -#define FPU_FPCCR_MONRDY_Msk (1UL << FPU_FPCCR_MONRDY_Pos) /*!< FPCCR: MONRDY bit Mask */ - -#define FPU_FPCCR_SFRDY_Pos 7U /*!< FPCCR: SFRDY Position */ -#define FPU_FPCCR_SFRDY_Msk (1UL << FPU_FPCCR_SFRDY_Pos) /*!< FPCCR: SFRDY bit Mask */ - -#define FPU_FPCCR_BFRDY_Pos 6U /*!< FPCCR: BFRDY Position */ -#define FPU_FPCCR_BFRDY_Msk (1UL << FPU_FPCCR_BFRDY_Pos) /*!< FPCCR: BFRDY bit Mask */ - -#define FPU_FPCCR_MMRDY_Pos 5U /*!< FPCCR: MMRDY Position */ -#define FPU_FPCCR_MMRDY_Msk (1UL << FPU_FPCCR_MMRDY_Pos) /*!< FPCCR: MMRDY bit Mask */ - -#define FPU_FPCCR_HFRDY_Pos 4U /*!< FPCCR: HFRDY Position */ -#define FPU_FPCCR_HFRDY_Msk (1UL << FPU_FPCCR_HFRDY_Pos) /*!< FPCCR: HFRDY bit Mask */ - -#define FPU_FPCCR_THREAD_Pos 3U /*!< FPCCR: processor mode bit Position */ -#define FPU_FPCCR_THREAD_Msk (1UL << FPU_FPCCR_THREAD_Pos) /*!< FPCCR: processor mode active bit Mask */ - -#define FPU_FPCCR_S_Pos 2U /*!< FPCCR: Security status of the FP context bit Position */ -#define FPU_FPCCR_S_Msk (1UL << FPU_FPCCR_S_Pos) /*!< FPCCR: Security status of the FP context bit Mask */ - -#define FPU_FPCCR_USER_Pos 1U /*!< FPCCR: privilege level bit Position */ -#define FPU_FPCCR_USER_Msk (1UL << FPU_FPCCR_USER_Pos) /*!< FPCCR: privilege level bit Mask */ - -#define FPU_FPCCR_LSPACT_Pos 0U /*!< FPCCR: Lazy state preservation active bit Position */ -#define FPU_FPCCR_LSPACT_Msk (1UL /*<< FPU_FPCCR_LSPACT_Pos*/) /*!< FPCCR: Lazy state preservation active bit Mask */ - -/* Floating-Point Context Address Register Definitions */ -#define FPU_FPCAR_ADDRESS_Pos 3U /*!< FPCAR: ADDRESS bit Position */ -#define FPU_FPCAR_ADDRESS_Msk (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos) /*!< FPCAR: ADDRESS bit Mask */ - -/* Floating-Point Default Status Control Register Definitions */ -#define FPU_FPDSCR_AHP_Pos 26U /*!< FPDSCR: AHP bit Position */ -#define FPU_FPDSCR_AHP_Msk (1UL << FPU_FPDSCR_AHP_Pos) /*!< FPDSCR: AHP bit Mask */ - -#define FPU_FPDSCR_DN_Pos 25U /*!< FPDSCR: DN bit Position */ -#define FPU_FPDSCR_DN_Msk (1UL << FPU_FPDSCR_DN_Pos) /*!< FPDSCR: DN bit Mask */ - -#define FPU_FPDSCR_FZ_Pos 24U /*!< FPDSCR: FZ bit Position */ -#define FPU_FPDSCR_FZ_Msk (1UL << FPU_FPDSCR_FZ_Pos) /*!< FPDSCR: FZ bit Mask */ - -#define FPU_FPDSCR_RMode_Pos 22U /*!< FPDSCR: RMode bit Position */ -#define FPU_FPDSCR_RMode_Msk (3UL << FPU_FPDSCR_RMode_Pos) /*!< FPDSCR: RMode bit Mask */ - -/* Media and VFP Feature Register 0 Definitions */ -#define FPU_MVFR0_FP_rounding_modes_Pos 28U /*!< MVFR0: FP rounding modes bits Position */ -#define FPU_MVFR0_FP_rounding_modes_Msk (0xFUL << FPU_MVFR0_FP_rounding_modes_Pos) /*!< MVFR0: FP rounding modes bits Mask */ - -#define FPU_MVFR0_Short_vectors_Pos 24U /*!< MVFR0: Short vectors bits Position */ -#define FPU_MVFR0_Short_vectors_Msk (0xFUL << FPU_MVFR0_Short_vectors_Pos) /*!< MVFR0: Short vectors bits Mask */ - -#define FPU_MVFR0_Square_root_Pos 20U /*!< MVFR0: Square root bits Position */ -#define FPU_MVFR0_Square_root_Msk (0xFUL << FPU_MVFR0_Square_root_Pos) /*!< MVFR0: Square root bits Mask */ - -#define FPU_MVFR0_Divide_Pos 16U /*!< MVFR0: Divide bits Position */ -#define FPU_MVFR0_Divide_Msk (0xFUL << FPU_MVFR0_Divide_Pos) /*!< MVFR0: Divide bits Mask */ - -#define FPU_MVFR0_FP_excep_trapping_Pos 12U /*!< MVFR0: FP exception trapping bits Position */ -#define FPU_MVFR0_FP_excep_trapping_Msk (0xFUL << FPU_MVFR0_FP_excep_trapping_Pos) /*!< MVFR0: FP exception trapping bits Mask */ - -#define FPU_MVFR0_Double_precision_Pos 8U /*!< MVFR0: Double-precision bits Position */ -#define FPU_MVFR0_Double_precision_Msk (0xFUL << FPU_MVFR0_Double_precision_Pos) /*!< MVFR0: Double-precision bits Mask */ - -#define FPU_MVFR0_Single_precision_Pos 4U /*!< MVFR0: Single-precision bits Position */ -#define FPU_MVFR0_Single_precision_Msk (0xFUL << FPU_MVFR0_Single_precision_Pos) /*!< MVFR0: Single-precision bits Mask */ - -#define FPU_MVFR0_A_SIMD_registers_Pos 0U /*!< MVFR0: A_SIMD registers bits Position */ -#define FPU_MVFR0_A_SIMD_registers_Msk (0xFUL /*<< FPU_MVFR0_A_SIMD_registers_Pos*/) /*!< MVFR0: A_SIMD registers bits Mask */ - -/* Media and VFP Feature Register 1 Definitions */ -#define FPU_MVFR1_FP_fused_MAC_Pos 28U /*!< MVFR1: FP fused MAC bits Position */ -#define FPU_MVFR1_FP_fused_MAC_Msk (0xFUL << FPU_MVFR1_FP_fused_MAC_Pos) /*!< MVFR1: FP fused MAC bits Mask */ - -#define FPU_MVFR1_FP_HPFP_Pos 24U /*!< MVFR1: FP HPFP bits Position */ -#define FPU_MVFR1_FP_HPFP_Msk (0xFUL << FPU_MVFR1_FP_HPFP_Pos) /*!< MVFR1: FP HPFP bits Mask */ - -#define FPU_MVFR1_D_NaN_mode_Pos 4U /*!< MVFR1: D_NaN mode bits Position */ -#define FPU_MVFR1_D_NaN_mode_Msk (0xFUL << FPU_MVFR1_D_NaN_mode_Pos) /*!< MVFR1: D_NaN mode bits Mask */ - -#define FPU_MVFR1_FtZ_mode_Pos 0U /*!< MVFR1: FtZ mode bits Position */ -#define FPU_MVFR1_FtZ_mode_Msk (0xFUL /*<< FPU_MVFR1_FtZ_mode_Pos*/) /*!< MVFR1: FtZ mode bits Mask */ - -/* Media and VFP Feature Register 2 Definitions */ -#define FPU_MVFR2_FPMisc_Pos 4U /*!< MVFR2: FPMisc bits Position */ -#define FPU_MVFR2_FPMisc_Msk (0xFUL << FPU_MVFR2_FPMisc_Pos) /*!< MVFR2: FPMisc bits Mask */ - -/*@} end of group CMSIS_FPU */ - -/* CoreDebug is deprecated. replaced by DCB (Debug Control Block) */ -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) - \brief Type definitions for the Core Debug Registers - @{ - */ - -/** - \brief \deprecated Structure type to access the Core Debug Register (CoreDebug). - */ -typedef struct -{ - __IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ - __OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ - __IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ - __IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ - uint32_t RESERVED0[1U]; - __IOM uint32_t DAUTHCTRL; /*!< Offset: 0x014 (R/W) Debug Authentication Control Register */ - __IOM uint32_t DSCSR; /*!< Offset: 0x018 (R/W) Debug Security Control and Status Register */ -} CoreDebug_Type; - -/* Debug Halting Control and Status Register Definitions */ -#define CoreDebug_DHCSR_DBGKEY_Pos 16U /*!< \deprecated CoreDebug DHCSR: DBGKEY Position */ -#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< \deprecated CoreDebug DHCSR: DBGKEY Mask */ - -#define CoreDebug_DHCSR_S_RESTART_ST_Pos 26U /*!< \deprecated CoreDebug DHCSR: S_RESTART_ST Position */ -#define CoreDebug_DHCSR_S_RESTART_ST_Msk (1UL << CoreDebug_DHCSR_S_RESTART_ST_Pos) /*!< \deprecated CoreDebug DHCSR: S_RESTART_ST Mask */ - -#define CoreDebug_DHCSR_S_RESET_ST_Pos 25U /*!< \deprecated CoreDebug DHCSR: S_RESET_ST Position */ -#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< \deprecated CoreDebug DHCSR: S_RESET_ST Mask */ - -#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24U /*!< \deprecated CoreDebug DHCSR: S_RETIRE_ST Position */ -#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< \deprecated CoreDebug DHCSR: S_RETIRE_ST Mask */ - -#define CoreDebug_DHCSR_S_LOCKUP_Pos 19U /*!< \deprecated CoreDebug DHCSR: S_LOCKUP Position */ -#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< \deprecated CoreDebug DHCSR: S_LOCKUP Mask */ - -#define CoreDebug_DHCSR_S_SLEEP_Pos 18U /*!< \deprecated CoreDebug DHCSR: S_SLEEP Position */ -#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< \deprecated CoreDebug DHCSR: S_SLEEP Mask */ - -#define CoreDebug_DHCSR_S_HALT_Pos 17U /*!< \deprecated CoreDebug DHCSR: S_HALT Position */ -#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< \deprecated CoreDebug DHCSR: S_HALT Mask */ - -#define CoreDebug_DHCSR_S_REGRDY_Pos 16U /*!< \deprecated CoreDebug DHCSR: S_REGRDY Position */ -#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< \deprecated CoreDebug DHCSR: S_REGRDY Mask */ - -#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5U /*!< \deprecated CoreDebug DHCSR: C_SNAPSTALL Position */ -#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< \deprecated CoreDebug DHCSR: C_SNAPSTALL Mask */ - -#define CoreDebug_DHCSR_C_MASKINTS_Pos 3U /*!< \deprecated CoreDebug DHCSR: C_MASKINTS Position */ -#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< \deprecated CoreDebug DHCSR: C_MASKINTS Mask */ - -#define CoreDebug_DHCSR_C_STEP_Pos 2U /*!< \deprecated CoreDebug DHCSR: C_STEP Position */ -#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< \deprecated CoreDebug DHCSR: C_STEP Mask */ - -#define CoreDebug_DHCSR_C_HALT_Pos 1U /*!< \deprecated CoreDebug DHCSR: C_HALT Position */ -#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< \deprecated CoreDebug DHCSR: C_HALT Mask */ - -#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0U /*!< \deprecated CoreDebug DHCSR: C_DEBUGEN Position */ -#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< \deprecated CoreDebug DHCSR: C_DEBUGEN Mask */ - -/* Debug Core Register Selector Register Definitions */ -#define CoreDebug_DCRSR_REGWnR_Pos 16U /*!< \deprecated CoreDebug DCRSR: REGWnR Position */ -#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< \deprecated CoreDebug DCRSR: REGWnR Mask */ - -#define CoreDebug_DCRSR_REGSEL_Pos 0U /*!< \deprecated CoreDebug DCRSR: REGSEL Position */ -#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< \deprecated CoreDebug DCRSR: REGSEL Mask */ - -/* Debug Exception and Monitor Control Register Definitions */ -#define CoreDebug_DEMCR_TRCENA_Pos 24U /*!< \deprecated CoreDebug DEMCR: TRCENA Position */ -#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< \deprecated CoreDebug DEMCR: TRCENA Mask */ - -#define CoreDebug_DEMCR_MON_REQ_Pos 19U /*!< \deprecated CoreDebug DEMCR: MON_REQ Position */ -#define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< \deprecated CoreDebug DEMCR: MON_REQ Mask */ - -#define CoreDebug_DEMCR_MON_STEP_Pos 18U /*!< \deprecated CoreDebug DEMCR: MON_STEP Position */ -#define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< \deprecated CoreDebug DEMCR: MON_STEP Mask */ - -#define CoreDebug_DEMCR_MON_PEND_Pos 17U /*!< \deprecated CoreDebug DEMCR: MON_PEND Position */ -#define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< \deprecated CoreDebug DEMCR: MON_PEND Mask */ - -#define CoreDebug_DEMCR_MON_EN_Pos 16U /*!< \deprecated CoreDebug DEMCR: MON_EN Position */ -#define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< \deprecated CoreDebug DEMCR: MON_EN Mask */ - -#define CoreDebug_DEMCR_VC_HARDERR_Pos 10U /*!< \deprecated CoreDebug DEMCR: VC_HARDERR Position */ -#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< \deprecated CoreDebug DEMCR: VC_HARDERR Mask */ - -#define CoreDebug_DEMCR_VC_INTERR_Pos 9U /*!< \deprecated CoreDebug DEMCR: VC_INTERR Position */ -#define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< \deprecated CoreDebug DEMCR: VC_INTERR Mask */ - -#define CoreDebug_DEMCR_VC_BUSERR_Pos 8U /*!< \deprecated CoreDebug DEMCR: VC_BUSERR Position */ -#define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< \deprecated CoreDebug DEMCR: VC_BUSERR Mask */ - -#define CoreDebug_DEMCR_VC_STATERR_Pos 7U /*!< \deprecated CoreDebug DEMCR: VC_STATERR Position */ -#define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< \deprecated CoreDebug DEMCR: VC_STATERR Mask */ - -#define CoreDebug_DEMCR_VC_CHKERR_Pos 6U /*!< \deprecated CoreDebug DEMCR: VC_CHKERR Position */ -#define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< \deprecated CoreDebug DEMCR: VC_CHKERR Mask */ - -#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5U /*!< \deprecated CoreDebug DEMCR: VC_NOCPERR Position */ -#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< \deprecated CoreDebug DEMCR: VC_NOCPERR Mask */ - -#define CoreDebug_DEMCR_VC_MMERR_Pos 4U /*!< \deprecated CoreDebug DEMCR: VC_MMERR Position */ -#define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< \deprecated CoreDebug DEMCR: VC_MMERR Mask */ - -#define CoreDebug_DEMCR_VC_CORERESET_Pos 0U /*!< \deprecated CoreDebug DEMCR: VC_CORERESET Position */ -#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< \deprecated CoreDebug DEMCR: VC_CORERESET Mask */ - -/* Debug Authentication Control Register Definitions */ -#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos 3U /*!< \deprecated CoreDebug DAUTHCTRL: INTSPNIDEN, Position */ -#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos) /*!< \deprecated CoreDebug DAUTHCTRL: INTSPNIDEN, Mask */ - -#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos 2U /*!< \deprecated CoreDebug DAUTHCTRL: SPNIDENSEL Position */ -#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Msk (1UL << CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos) /*!< \deprecated CoreDebug DAUTHCTRL: SPNIDENSEL Mask */ - -#define CoreDebug_DAUTHCTRL_INTSPIDEN_Pos 1U /*!< \deprecated CoreDebug DAUTHCTRL: INTSPIDEN Position */ -#define CoreDebug_DAUTHCTRL_INTSPIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPIDEN_Pos) /*!< \deprecated CoreDebug DAUTHCTRL: INTSPIDEN Mask */ - -#define CoreDebug_DAUTHCTRL_SPIDENSEL_Pos 0U /*!< \deprecated CoreDebug DAUTHCTRL: SPIDENSEL Position */ -#define CoreDebug_DAUTHCTRL_SPIDENSEL_Msk (1UL /*<< CoreDebug_DAUTHCTRL_SPIDENSEL_Pos*/) /*!< \deprecated CoreDebug DAUTHCTRL: SPIDENSEL Mask */ - -/* Debug Security Control and Status Register Definitions */ -#define CoreDebug_DSCSR_CDS_Pos 16U /*!< \deprecated CoreDebug DSCSR: CDS Position */ -#define CoreDebug_DSCSR_CDS_Msk (1UL << CoreDebug_DSCSR_CDS_Pos) /*!< \deprecated CoreDebug DSCSR: CDS Mask */ - -#define CoreDebug_DSCSR_SBRSEL_Pos 1U /*!< \deprecated CoreDebug DSCSR: SBRSEL Position */ -#define CoreDebug_DSCSR_SBRSEL_Msk (1UL << CoreDebug_DSCSR_SBRSEL_Pos) /*!< \deprecated CoreDebug DSCSR: SBRSEL Mask */ - -#define CoreDebug_DSCSR_SBRSELEN_Pos 0U /*!< \deprecated CoreDebug DSCSR: SBRSELEN Position */ -#define CoreDebug_DSCSR_SBRSELEN_Msk (1UL /*<< CoreDebug_DSCSR_SBRSELEN_Pos*/) /*!< \deprecated CoreDebug DSCSR: SBRSELEN Mask */ - -/*@} end of group CMSIS_CoreDebug */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_DCB Debug Control Block - \brief Type definitions for the Debug Control Block Registers - @{ - */ - -/** - \brief Structure type to access the Debug Control Block Registers (DCB). - */ -typedef struct -{ - __IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ - __OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ - __IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ - __IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ - uint32_t RESERVED0[1U]; - __IOM uint32_t DAUTHCTRL; /*!< Offset: 0x014 (R/W) Debug Authentication Control Register */ - __IOM uint32_t DSCSR; /*!< Offset: 0x018 (R/W) Debug Security Control and Status Register */ -} DCB_Type; - -/* DHCSR, Debug Halting Control and Status Register Definitions */ -#define DCB_DHCSR_DBGKEY_Pos 16U /*!< DCB DHCSR: Debug key Position */ -#define DCB_DHCSR_DBGKEY_Msk (0xFFFFUL << DCB_DHCSR_DBGKEY_Pos) /*!< DCB DHCSR: Debug key Mask */ - -#define DCB_DHCSR_S_RESTART_ST_Pos 26U /*!< DCB DHCSR: Restart sticky status Position */ -#define DCB_DHCSR_S_RESTART_ST_Msk (0x1UL << DCB_DHCSR_S_RESTART_ST_Pos) /*!< DCB DHCSR: Restart sticky status Mask */ - -#define DCB_DHCSR_S_RESET_ST_Pos 25U /*!< DCB DHCSR: Reset sticky status Position */ -#define DCB_DHCSR_S_RESET_ST_Msk (0x1UL << DCB_DHCSR_S_RESET_ST_Pos) /*!< DCB DHCSR: Reset sticky status Mask */ - -#define DCB_DHCSR_S_RETIRE_ST_Pos 24U /*!< DCB DHCSR: Retire sticky status Position */ -#define DCB_DHCSR_S_RETIRE_ST_Msk (0x1UL << DCB_DHCSR_S_RETIRE_ST_Pos) /*!< DCB DHCSR: Retire sticky status Mask */ - -#define DCB_DHCSR_S_SDE_Pos 20U /*!< DCB DHCSR: Secure debug enabled Position */ -#define DCB_DHCSR_S_SDE_Msk (0x1UL << DCB_DHCSR_S_SDE_Pos) /*!< DCB DHCSR: Secure debug enabled Mask */ - -#define DCB_DHCSR_S_LOCKUP_Pos 19U /*!< DCB DHCSR: Lockup status Position */ -#define DCB_DHCSR_S_LOCKUP_Msk (0x1UL << DCB_DHCSR_S_LOCKUP_Pos) /*!< DCB DHCSR: Lockup status Mask */ - -#define DCB_DHCSR_S_SLEEP_Pos 18U /*!< DCB DHCSR: Sleeping status Position */ -#define DCB_DHCSR_S_SLEEP_Msk (0x1UL << DCB_DHCSR_S_SLEEP_Pos) /*!< DCB DHCSR: Sleeping status Mask */ - -#define DCB_DHCSR_S_HALT_Pos 17U /*!< DCB DHCSR: Halted status Position */ -#define DCB_DHCSR_S_HALT_Msk (0x1UL << DCB_DHCSR_S_HALT_Pos) /*!< DCB DHCSR: Halted status Mask */ - -#define DCB_DHCSR_S_REGRDY_Pos 16U /*!< DCB DHCSR: Register ready status Position */ -#define DCB_DHCSR_S_REGRDY_Msk (0x1UL << DCB_DHCSR_S_REGRDY_Pos) /*!< DCB DHCSR: Register ready status Mask */ - -#define DCB_DHCSR_C_SNAPSTALL_Pos 5U /*!< DCB DHCSR: Snap stall control Position */ -#define DCB_DHCSR_C_SNAPSTALL_Msk (0x1UL << DCB_DHCSR_C_SNAPSTALL_Pos) /*!< DCB DHCSR: Snap stall control Mask */ - -#define DCB_DHCSR_C_MASKINTS_Pos 3U /*!< DCB DHCSR: Mask interrupts control Position */ -#define DCB_DHCSR_C_MASKINTS_Msk (0x1UL << DCB_DHCSR_C_MASKINTS_Pos) /*!< DCB DHCSR: Mask interrupts control Mask */ - -#define DCB_DHCSR_C_STEP_Pos 2U /*!< DCB DHCSR: Step control Position */ -#define DCB_DHCSR_C_STEP_Msk (0x1UL << DCB_DHCSR_C_STEP_Pos) /*!< DCB DHCSR: Step control Mask */ - -#define DCB_DHCSR_C_HALT_Pos 1U /*!< DCB DHCSR: Halt control Position */ -#define DCB_DHCSR_C_HALT_Msk (0x1UL << DCB_DHCSR_C_HALT_Pos) /*!< DCB DHCSR: Halt control Mask */ - -#define DCB_DHCSR_C_DEBUGEN_Pos 0U /*!< DCB DHCSR: Debug enable control Position */ -#define DCB_DHCSR_C_DEBUGEN_Msk (0x1UL /*<< DCB_DHCSR_C_DEBUGEN_Pos*/) /*!< DCB DHCSR: Debug enable control Mask */ - -/* DCRSR, Debug Core Register Select Register Definitions */ -#define DCB_DCRSR_REGWnR_Pos 16U /*!< DCB DCRSR: Register write/not-read Position */ -#define DCB_DCRSR_REGWnR_Msk (0x1UL << DCB_DCRSR_REGWnR_Pos) /*!< DCB DCRSR: Register write/not-read Mask */ - -#define DCB_DCRSR_REGSEL_Pos 0U /*!< DCB DCRSR: Register selector Position */ -#define DCB_DCRSR_REGSEL_Msk (0x7FUL /*<< DCB_DCRSR_REGSEL_Pos*/) /*!< DCB DCRSR: Register selector Mask */ - -/* DCRDR, Debug Core Register Data Register Definitions */ -#define DCB_DCRDR_DBGTMP_Pos 0U /*!< DCB DCRDR: Data temporary buffer Position */ -#define DCB_DCRDR_DBGTMP_Msk (0xFFFFFFFFUL /*<< DCB_DCRDR_DBGTMP_Pos*/) /*!< DCB DCRDR: Data temporary buffer Mask */ - -/* DEMCR, Debug Exception and Monitor Control Register Definitions */ -#define DCB_DEMCR_TRCENA_Pos 24U /*!< DCB DEMCR: Trace enable Position */ -#define DCB_DEMCR_TRCENA_Msk (0x1UL << DCB_DEMCR_TRCENA_Pos) /*!< DCB DEMCR: Trace enable Mask */ - -#define DCB_DEMCR_MONPRKEY_Pos 23U /*!< DCB DEMCR: Monitor pend req key Position */ -#define DCB_DEMCR_MONPRKEY_Msk (0x1UL << DCB_DEMCR_MONPRKEY_Pos) /*!< DCB DEMCR: Monitor pend req key Mask */ - -#define DCB_DEMCR_UMON_EN_Pos 21U /*!< DCB DEMCR: Unprivileged monitor enable Position */ -#define DCB_DEMCR_UMON_EN_Msk (0x1UL << DCB_DEMCR_UMON_EN_Pos) /*!< DCB DEMCR: Unprivileged monitor enable Mask */ - -#define DCB_DEMCR_SDME_Pos 20U /*!< DCB DEMCR: Secure DebugMonitor enable Position */ -#define DCB_DEMCR_SDME_Msk (0x1UL << DCB_DEMCR_SDME_Pos) /*!< DCB DEMCR: Secure DebugMonitor enable Mask */ - -#define DCB_DEMCR_MON_REQ_Pos 19U /*!< DCB DEMCR: Monitor request Position */ -#define DCB_DEMCR_MON_REQ_Msk (0x1UL << DCB_DEMCR_MON_REQ_Pos) /*!< DCB DEMCR: Monitor request Mask */ - -#define DCB_DEMCR_MON_STEP_Pos 18U /*!< DCB DEMCR: Monitor step Position */ -#define DCB_DEMCR_MON_STEP_Msk (0x1UL << DCB_DEMCR_MON_STEP_Pos) /*!< DCB DEMCR: Monitor step Mask */ - -#define DCB_DEMCR_MON_PEND_Pos 17U /*!< DCB DEMCR: Monitor pend Position */ -#define DCB_DEMCR_MON_PEND_Msk (0x1UL << DCB_DEMCR_MON_PEND_Pos) /*!< DCB DEMCR: Monitor pend Mask */ - -#define DCB_DEMCR_MON_EN_Pos 16U /*!< DCB DEMCR: Monitor enable Position */ -#define DCB_DEMCR_MON_EN_Msk (0x1UL << DCB_DEMCR_MON_EN_Pos) /*!< DCB DEMCR: Monitor enable Mask */ - -#define DCB_DEMCR_VC_SFERR_Pos 11U /*!< DCB DEMCR: Vector Catch SecureFault Position */ -#define DCB_DEMCR_VC_SFERR_Msk (0x1UL << DCB_DEMCR_VC_SFERR_Pos) /*!< DCB DEMCR: Vector Catch SecureFault Mask */ - -#define DCB_DEMCR_VC_HARDERR_Pos 10U /*!< DCB DEMCR: Vector Catch HardFault errors Position */ -#define DCB_DEMCR_VC_HARDERR_Msk (0x1UL << DCB_DEMCR_VC_HARDERR_Pos) /*!< DCB DEMCR: Vector Catch HardFault errors Mask */ - -#define DCB_DEMCR_VC_INTERR_Pos 9U /*!< DCB DEMCR: Vector Catch interrupt errors Position */ -#define DCB_DEMCR_VC_INTERR_Msk (0x1UL << DCB_DEMCR_VC_INTERR_Pos) /*!< DCB DEMCR: Vector Catch interrupt errors Mask */ - -#define DCB_DEMCR_VC_BUSERR_Pos 8U /*!< DCB DEMCR: Vector Catch BusFault errors Position */ -#define DCB_DEMCR_VC_BUSERR_Msk (0x1UL << DCB_DEMCR_VC_BUSERR_Pos) /*!< DCB DEMCR: Vector Catch BusFault errors Mask */ - -#define DCB_DEMCR_VC_STATERR_Pos 7U /*!< DCB DEMCR: Vector Catch state errors Position */ -#define DCB_DEMCR_VC_STATERR_Msk (0x1UL << DCB_DEMCR_VC_STATERR_Pos) /*!< DCB DEMCR: Vector Catch state errors Mask */ - -#define DCB_DEMCR_VC_CHKERR_Pos 6U /*!< DCB DEMCR: Vector Catch check errors Position */ -#define DCB_DEMCR_VC_CHKERR_Msk (0x1UL << DCB_DEMCR_VC_CHKERR_Pos) /*!< DCB DEMCR: Vector Catch check errors Mask */ - -#define DCB_DEMCR_VC_NOCPERR_Pos 5U /*!< DCB DEMCR: Vector Catch NOCP errors Position */ -#define DCB_DEMCR_VC_NOCPERR_Msk (0x1UL << DCB_DEMCR_VC_NOCPERR_Pos) /*!< DCB DEMCR: Vector Catch NOCP errors Mask */ - -#define DCB_DEMCR_VC_MMERR_Pos 4U /*!< DCB DEMCR: Vector Catch MemManage errors Position */ -#define DCB_DEMCR_VC_MMERR_Msk (0x1UL << DCB_DEMCR_VC_MMERR_Pos) /*!< DCB DEMCR: Vector Catch MemManage errors Mask */ - -#define DCB_DEMCR_VC_CORERESET_Pos 0U /*!< DCB DEMCR: Vector Catch Core reset Position */ -#define DCB_DEMCR_VC_CORERESET_Msk (0x1UL /*<< DCB_DEMCR_VC_CORERESET_Pos*/) /*!< DCB DEMCR: Vector Catch Core reset Mask */ - -/* DAUTHCTRL, Debug Authentication Control Register Definitions */ -#define DCB_DAUTHCTRL_INTSPNIDEN_Pos 3U /*!< DCB DAUTHCTRL: Internal Secure non-invasive debug enable Position */ -#define DCB_DAUTHCTRL_INTSPNIDEN_Msk (0x1UL << DCB_DAUTHCTRL_INTSPNIDEN_Pos) /*!< DCB DAUTHCTRL: Internal Secure non-invasive debug enable Mask */ - -#define DCB_DAUTHCTRL_SPNIDENSEL_Pos 2U /*!< DCB DAUTHCTRL: Secure non-invasive debug enable select Position */ -#define DCB_DAUTHCTRL_SPNIDENSEL_Msk (0x1UL << DCB_DAUTHCTRL_SPNIDENSEL_Pos) /*!< DCB DAUTHCTRL: Secure non-invasive debug enable select Mask */ - -#define DCB_DAUTHCTRL_INTSPIDEN_Pos 1U /*!< DCB DAUTHCTRL: Internal Secure invasive debug enable Position */ -#define DCB_DAUTHCTRL_INTSPIDEN_Msk (0x1UL << DCB_DAUTHCTRL_INTSPIDEN_Pos) /*!< DCB DAUTHCTRL: Internal Secure invasive debug enable Mask */ - -#define DCB_DAUTHCTRL_SPIDENSEL_Pos 0U /*!< DCB DAUTHCTRL: Secure invasive debug enable select Position */ -#define DCB_DAUTHCTRL_SPIDENSEL_Msk (0x1UL /*<< DCB_DAUTHCTRL_SPIDENSEL_Pos*/) /*!< DCB DAUTHCTRL: Secure invasive debug enable select Mask */ - -/* DSCSR, Debug Security Control and Status Register Definitions */ -#define DCB_DSCSR_CDSKEY_Pos 17U /*!< DCB DSCSR: CDS write-enable key Position */ -#define DCB_DSCSR_CDSKEY_Msk (0x1UL << DCB_DSCSR_CDSKEY_Pos) /*!< DCB DSCSR: CDS write-enable key Mask */ - -#define DCB_DSCSR_CDS_Pos 16U /*!< DCB DSCSR: Current domain Secure Position */ -#define DCB_DSCSR_CDS_Msk (0x1UL << DCB_DSCSR_CDS_Pos) /*!< DCB DSCSR: Current domain Secure Mask */ - -#define DCB_DSCSR_SBRSEL_Pos 1U /*!< DCB DSCSR: Secure banked register select Position */ -#define DCB_DSCSR_SBRSEL_Msk (0x1UL << DCB_DSCSR_SBRSEL_Pos) /*!< DCB DSCSR: Secure banked register select Mask */ - -#define DCB_DSCSR_SBRSELEN_Pos 0U /*!< DCB DSCSR: Secure banked register select enable Position */ -#define DCB_DSCSR_SBRSELEN_Msk (0x1UL /*<< DCB_DSCSR_SBRSELEN_Pos*/) /*!< DCB DSCSR: Secure banked register select enable Mask */ - -/*@} end of group CMSIS_DCB */ - - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_DIB Debug Identification Block - \brief Type definitions for the Debug Identification Block Registers - @{ - */ - -/** - \brief Structure type to access the Debug Identification Block Registers (DIB). - */ -typedef struct -{ - __OM uint32_t DLAR; /*!< Offset: 0x000 ( /W) SCS Software Lock Access Register */ - __IM uint32_t DLSR; /*!< Offset: 0x004 (R/ ) SCS Software Lock Status Register */ - __IM uint32_t DAUTHSTATUS; /*!< Offset: 0x008 (R/ ) Debug Authentication Status Register */ - __IM uint32_t DDEVARCH; /*!< Offset: 0x00C (R/ ) SCS Device Architecture Register */ - __IM uint32_t DDEVTYPE; /*!< Offset: 0x010 (R/ ) SCS Device Type Register */ -} DIB_Type; - -/* DLAR, SCS Software Lock Access Register Definitions */ -#define DIB_DLAR_KEY_Pos 0U /*!< DIB DLAR: KEY Position */ -#define DIB_DLAR_KEY_Msk (0xFFFFFFFFUL /*<< DIB_DLAR_KEY_Pos */) /*!< DIB DLAR: KEY Mask */ - -/* DLSR, SCS Software Lock Status Register Definitions */ -#define DIB_DLSR_nTT_Pos 2U /*!< DIB DLSR: Not thirty-two bit Position */ -#define DIB_DLSR_nTT_Msk (0x1UL << DIB_DLSR_nTT_Pos ) /*!< DIB DLSR: Not thirty-two bit Mask */ - -#define DIB_DLSR_SLK_Pos 1U /*!< DIB DLSR: Software Lock status Position */ -#define DIB_DLSR_SLK_Msk (0x1UL << DIB_DLSR_SLK_Pos ) /*!< DIB DLSR: Software Lock status Mask */ - -#define DIB_DLSR_SLI_Pos 0U /*!< DIB DLSR: Software Lock implemented Position */ -#define DIB_DLSR_SLI_Msk (0x1UL /*<< DIB_DLSR_SLI_Pos*/) /*!< DIB DLSR: Software Lock implemented Mask */ - -/* DAUTHSTATUS, Debug Authentication Status Register Definitions */ -#define DIB_DAUTHSTATUS_SNID_Pos 6U /*!< DIB DAUTHSTATUS: Secure Non-invasive Debug Position */ -#define DIB_DAUTHSTATUS_SNID_Msk (0x3UL << DIB_DAUTHSTATUS_SNID_Pos ) /*!< DIB DAUTHSTATUS: Secure Non-invasive Debug Mask */ - -#define DIB_DAUTHSTATUS_SID_Pos 4U /*!< DIB DAUTHSTATUS: Secure Invasive Debug Position */ -#define DIB_DAUTHSTATUS_SID_Msk (0x3UL << DIB_DAUTHSTATUS_SID_Pos ) /*!< DIB DAUTHSTATUS: Secure Invasive Debug Mask */ - -#define DIB_DAUTHSTATUS_NSNID_Pos 2U /*!< DIB DAUTHSTATUS: Non-secure Non-invasive Debug Position */ -#define DIB_DAUTHSTATUS_NSNID_Msk (0x3UL << DIB_DAUTHSTATUS_NSNID_Pos ) /*!< DIB DAUTHSTATUS: Non-secure Non-invasive Debug Mask */ - -#define DIB_DAUTHSTATUS_NSID_Pos 0U /*!< DIB DAUTHSTATUS: Non-secure Invasive Debug Position */ -#define DIB_DAUTHSTATUS_NSID_Msk (0x3UL /*<< DIB_DAUTHSTATUS_NSID_Pos*/) /*!< DIB DAUTHSTATUS: Non-secure Invasive Debug Mask */ - -/* DDEVARCH, SCS Device Architecture Register Definitions */ -#define DIB_DDEVARCH_ARCHITECT_Pos 21U /*!< DIB DDEVARCH: Architect Position */ -#define DIB_DDEVARCH_ARCHITECT_Msk (0x7FFUL << DIB_DDEVARCH_ARCHITECT_Pos ) /*!< DIB DDEVARCH: Architect Mask */ - -#define DIB_DDEVARCH_PRESENT_Pos 20U /*!< DIB DDEVARCH: DEVARCH Present Position */ -#define DIB_DDEVARCH_PRESENT_Msk (0x1FUL << DIB_DDEVARCH_PRESENT_Pos ) /*!< DIB DDEVARCH: DEVARCH Present Mask */ - -#define DIB_DDEVARCH_REVISION_Pos 16U /*!< DIB DDEVARCH: Revision Position */ -#define DIB_DDEVARCH_REVISION_Msk (0xFUL << DIB_DDEVARCH_REVISION_Pos ) /*!< DIB DDEVARCH: Revision Mask */ - -#define DIB_DDEVARCH_ARCHVER_Pos 12U /*!< DIB DDEVARCH: Architecture Version Position */ -#define DIB_DDEVARCH_ARCHVER_Msk (0xFUL << DIB_DDEVARCH_ARCHVER_Pos ) /*!< DIB DDEVARCH: Architecture Version Mask */ - -#define DIB_DDEVARCH_ARCHPART_Pos 0U /*!< DIB DDEVARCH: Architecture Part Position */ -#define DIB_DDEVARCH_ARCHPART_Msk (0xFFFUL /*<< DIB_DDEVARCH_ARCHPART_Pos*/) /*!< DIB DDEVARCH: Architecture Part Mask */ - -/* DDEVTYPE, SCS Device Type Register Definitions */ -#define DIB_DDEVTYPE_SUB_Pos 4U /*!< DIB DDEVTYPE: Sub-type Position */ -#define DIB_DDEVTYPE_SUB_Msk (0xFUL << DIB_DDEVTYPE_SUB_Pos ) /*!< DIB DDEVTYPE: Sub-type Mask */ - -#define DIB_DDEVTYPE_MAJOR_Pos 0U /*!< DIB DDEVTYPE: Major type Position */ -#define DIB_DDEVTYPE_MAJOR_Msk (0xFUL /*<< DIB_DDEVTYPE_MAJOR_Pos*/) /*!< DIB DDEVTYPE: Major type Mask */ - - -/*@} end of group CMSIS_DIB */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_core_bitfield Core register bit field macros - \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). - @{ - */ - -/** - \brief Mask and shift a bit field value for use in a register bit range. - \param[in] field Name of the register bit field. - \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. - \return Masked and shifted value. -*/ -#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) - -/** - \brief Mask and shift a register value to extract a bit filed value. - \param[in] field Name of the register bit field. - \param[in] value Value of register. This parameter is interpreted as an uint32_t type. - \return Masked and shifted bit field value. -*/ -#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) - -/*@} end of group CMSIS_core_bitfield */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_core_base Core Definitions - \brief Definitions for base addresses, unions, and structures. - @{ - */ - -/* Memory mapping of Core Hardware */ - #define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ - #define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */ - #define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ - #define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ - #define CoreDebug_BASE (0xE000EDF0UL) /*!< \deprecated Core Debug Base Address */ - #define DCB_BASE (0xE000EDF0UL) /*!< DCB Base Address */ - #define DIB_BASE (0xE000EFB0UL) /*!< DIB Base Address */ - #define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ - #define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ - #define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ - - #define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ - #define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ - #define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ - #define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ - #define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */ - #define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */ - #define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */ - #define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE ) /*!< \deprecated Core Debug configuration struct */ - #define DCB ((DCB_Type *) DCB_BASE ) /*!< DCB configuration struct */ - #define DIB ((DIB_Type *) DIB_BASE ) /*!< DIB configuration struct */ - - #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) - #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ - #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ - #endif - - #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) - #define SAU_BASE (SCS_BASE + 0x0DD0UL) /*!< Security Attribution Unit */ - #define SAU ((SAU_Type *) SAU_BASE ) /*!< Security Attribution Unit */ - #endif - - #define FPU_BASE (SCS_BASE + 0x0F30UL) /*!< Floating Point Unit */ - #define FPU ((FPU_Type *) FPU_BASE ) /*!< Floating Point Unit */ - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) - #define SCS_BASE_NS (0xE002E000UL) /*!< System Control Space Base Address (non-secure address space) */ - #define CoreDebug_BASE_NS (0xE002EDF0UL) /*!< \deprecated Core Debug Base Address (non-secure address space) */ - #define DCB_BASE_NS (0xE002EDF0UL) /*!< DCB Base Address (non-secure address space) */ - #define DIB_BASE_NS (0xE002EFB0UL) /*!< DIB Base Address (non-secure address space) */ - #define SysTick_BASE_NS (SCS_BASE_NS + 0x0010UL) /*!< SysTick Base Address (non-secure address space) */ - #define NVIC_BASE_NS (SCS_BASE_NS + 0x0100UL) /*!< NVIC Base Address (non-secure address space) */ - #define SCB_BASE_NS (SCS_BASE_NS + 0x0D00UL) /*!< System Control Block Base Address (non-secure address space) */ - - #define SCnSCB_NS ((SCnSCB_Type *) SCS_BASE_NS ) /*!< System control Register not in SCB(non-secure address space) */ - #define SCB_NS ((SCB_Type *) SCB_BASE_NS ) /*!< SCB configuration struct (non-secure address space) */ - #define SysTick_NS ((SysTick_Type *) SysTick_BASE_NS ) /*!< SysTick configuration struct (non-secure address space) */ - #define NVIC_NS ((NVIC_Type *) NVIC_BASE_NS ) /*!< NVIC configuration struct (non-secure address space) */ - #define CoreDebug_NS ((CoreDebug_Type *) CoreDebug_BASE_NS) /*!< \deprecated Core Debug configuration struct (non-secure address space) */ - #define DCB_NS ((DCB_Type *) DCB_BASE_NS ) /*!< DCB configuration struct (non-secure address space) */ - #define DIB_NS ((DIB_Type *) DIB_BASE_NS ) /*!< DIB configuration struct (non-secure address space) */ - - #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) - #define MPU_BASE_NS (SCS_BASE_NS + 0x0D90UL) /*!< Memory Protection Unit (non-secure address space) */ - #define MPU_NS ((MPU_Type *) MPU_BASE_NS ) /*!< Memory Protection Unit (non-secure address space) */ - #endif - - #define FPU_BASE_NS (SCS_BASE_NS + 0x0F30UL) /*!< Floating Point Unit (non-secure address space) */ - #define FPU_NS ((FPU_Type *) FPU_BASE_NS ) /*!< Floating Point Unit (non-secure address space) */ - -#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ -/*@} */ - - - -/******************************************************************************* - * Hardware Abstraction Layer - Core Function Interface contains: - - Core NVIC Functions - - Core SysTick Functions - - Core Debug Functions - - Core Register Access Functions - ******************************************************************************/ -/** - \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference -*/ - - - -/* ########################## NVIC functions #################################### */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_NVICFunctions NVIC Functions - \brief Functions that manage interrupts and exceptions via the NVIC. - @{ - */ - -#ifdef CMSIS_NVIC_VIRTUAL - #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE - #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" - #endif - #include CMSIS_NVIC_VIRTUAL_HEADER_FILE -#else - #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping - #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping - #define NVIC_EnableIRQ __NVIC_EnableIRQ - #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ - #define NVIC_DisableIRQ __NVIC_DisableIRQ - #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ - #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ - #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ - #define NVIC_GetActive __NVIC_GetActive - #define NVIC_SetPriority __NVIC_SetPriority - #define NVIC_GetPriority __NVIC_GetPriority - #define NVIC_SystemReset __NVIC_SystemReset -#endif /* CMSIS_NVIC_VIRTUAL */ - -#ifdef CMSIS_VECTAB_VIRTUAL - #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE - #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" - #endif - #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE -#else - #define NVIC_SetVector __NVIC_SetVector - #define NVIC_GetVector __NVIC_GetVector -#endif /* (CMSIS_VECTAB_VIRTUAL) */ - -#define NVIC_USER_IRQ_OFFSET 16 - - -/* Special LR values for Secure/Non-Secure call handling and exception handling */ - -/* Function Return Payload (from ARMv8-M Architecture Reference Manual) LR value on entry from Secure BLXNS */ -#define FNC_RETURN (0xFEFFFFFFUL) /* bit [0] ignored when processing a branch */ - -/* The following EXC_RETURN mask values are used to evaluate the LR on exception entry */ -#define EXC_RETURN_PREFIX (0xFF000000UL) /* bits [31:24] set to indicate an EXC_RETURN value */ -#define EXC_RETURN_S (0x00000040UL) /* bit [6] stack used to push registers: 0=Non-secure 1=Secure */ -#define EXC_RETURN_DCRS (0x00000020UL) /* bit [5] stacking rules for called registers: 0=skipped 1=saved */ -#define EXC_RETURN_FTYPE (0x00000010UL) /* bit [4] allocate stack for floating-point context: 0=done 1=skipped */ -#define EXC_RETURN_MODE (0x00000008UL) /* bit [3] processor mode for return: 0=Handler mode 1=Thread mode */ -#define EXC_RETURN_SPSEL (0x00000004UL) /* bit [2] stack pointer used to restore context: 0=MSP 1=PSP */ -#define EXC_RETURN_ES (0x00000001UL) /* bit [0] security state exception was taken to: 0=Non-secure 1=Secure */ - -/* Integrity Signature (from ARMv8-M Architecture Reference Manual) for exception context stacking */ -#if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) /* Value for processors with floating-point extension: */ -#define EXC_INTEGRITY_SIGNATURE (0xFEFA125AUL) /* bit [0] SFTC must match LR bit[4] EXC_RETURN_FTYPE */ -#else -#define EXC_INTEGRITY_SIGNATURE (0xFEFA125BUL) /* Value for processors without floating-point extension */ -#endif - - -/** - \brief Set Priority Grouping - \details Sets the priority grouping field using the required unlock sequence. - The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. - Only values from 0..7 are used. - In case of a conflict between priority grouping and available - priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. - \param [in] PriorityGroup Priority grouping field. - */ -__STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup) -{ - uint32_t reg_value; - uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ - - reg_value = SCB->AIRCR; /* read old register configuration */ - reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ - reg_value = (reg_value | - ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | - (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority group */ - SCB->AIRCR = reg_value; -} - - -/** - \brief Get Priority Grouping - \details Reads the priority grouping field from the NVIC Interrupt Controller. - \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). - */ -__STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void) -{ - return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); -} - - -/** - \brief Enable Interrupt - \details Enables a device specific interrupt in the NVIC interrupt controller. - \param [in] IRQn Device specific interrupt number. - \note IRQn must not be negative. - */ -__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - __COMPILER_BARRIER(); - NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); - __COMPILER_BARRIER(); - } -} - - -/** - \brief Get Interrupt Enable status - \details Returns a device specific interrupt enable status from the NVIC interrupt controller. - \param [in] IRQn Device specific interrupt number. - \return 0 Interrupt is not enabled. - \return 1 Interrupt is enabled. - \note IRQn must not be negative. - */ -__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); - } - else - { - return(0U); - } -} - - -/** - \brief Disable Interrupt - \details Disables a device specific interrupt in the NVIC interrupt controller. - \param [in] IRQn Device specific interrupt number. - \note IRQn must not be negative. - */ -__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); - __DSB(); - __ISB(); - } -} - - -/** - \brief Get Pending Interrupt - \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. - \param [in] IRQn Device specific interrupt number. - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - \note IRQn must not be negative. - */ -__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); - } - else - { - return(0U); - } -} - - -/** - \brief Set Pending Interrupt - \details Sets the pending bit of a device specific interrupt in the NVIC pending register. - \param [in] IRQn Device specific interrupt number. - \note IRQn must not be negative. - */ -__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); - } -} - - -/** - \brief Clear Pending Interrupt - \details Clears the pending bit of a device specific interrupt in the NVIC pending register. - \param [in] IRQn Device specific interrupt number. - \note IRQn must not be negative. - */ -__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); - } -} - - -/** - \brief Get Active Interrupt - \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt. - \param [in] IRQn Device specific interrupt number. - \return 0 Interrupt status is not active. - \return 1 Interrupt status is active. - \note IRQn must not be negative. - */ -__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); - } - else - { - return(0U); - } -} - - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) -/** - \brief Get Interrupt Target State - \details Reads the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. - \param [in] IRQn Device specific interrupt number. - \return 0 if interrupt is assigned to Secure - \return 1 if interrupt is assigned to Non Secure - \note IRQn must not be negative. - */ -__STATIC_INLINE uint32_t NVIC_GetTargetState(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); - } - else - { - return(0U); - } -} - - -/** - \brief Set Interrupt Target State - \details Sets the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. - \param [in] IRQn Device specific interrupt number. - \return 0 if interrupt is assigned to Secure - 1 if interrupt is assigned to Non Secure - \note IRQn must not be negative. - */ -__STATIC_INLINE uint32_t NVIC_SetTargetState(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] |= ((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL))); - return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); - } - else - { - return(0U); - } -} - - -/** - \brief Clear Interrupt Target State - \details Clears the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. - \param [in] IRQn Device specific interrupt number. - \return 0 if interrupt is assigned to Secure - 1 if interrupt is assigned to Non Secure - \note IRQn must not be negative. - */ -__STATIC_INLINE uint32_t NVIC_ClearTargetState(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] &= ~((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL))); - return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); - } - else - { - return(0U); - } -} -#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ - - -/** - \brief Set Interrupt Priority - \details Sets the priority of a device specific interrupt or a processor exception. - The interrupt number can be positive to specify a device specific interrupt, - or negative to specify a processor exception. - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - \note The priority cannot be set for every processor exception. - */ -__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if ((int32_t)(IRQn) >= 0) - { - NVIC->IPR[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } -} - - -/** - \brief Get Interrupt Priority - \details Reads the priority of a device specific interrupt or a processor exception. - The interrupt number can be positive to specify a device specific interrupt, - or negative to specify a processor exception. - \param [in] IRQn Interrupt number. - \return Interrupt Priority. - Value is aligned automatically to the implemented priority bits of the microcontroller. - */ -__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) -{ - - if ((int32_t)(IRQn) >= 0) - { - return(((uint32_t)NVIC->IPR[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return(((uint32_t)SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); - } -} - - -/** - \brief Encode Priority - \details Encodes the priority for an interrupt with the given priority group, - preemptive priority value, and subpriority value. - In case of a conflict between priority grouping and available - priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. - \param [in] PriorityGroup Used priority group. - \param [in] PreemptPriority Preemptive priority value (starting from 0). - \param [in] SubPriority Subpriority value (starting from 0). - \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). - */ -__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) -{ - uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ - uint32_t PreemptPriorityBits; - uint32_t SubPriorityBits; - - PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); - SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); - - return ( - ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | - ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) - ); -} - - -/** - \brief Decode Priority - \details Decodes an interrupt priority value with a given priority group to - preemptive priority value and subpriority value. - In case of a conflict between priority grouping and available - priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. - \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). - \param [in] PriorityGroup Used priority group. - \param [out] pPreemptPriority Preemptive priority value (starting from 0). - \param [out] pSubPriority Subpriority value (starting from 0). - */ -__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) -{ - uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ - uint32_t PreemptPriorityBits; - uint32_t SubPriorityBits; - - PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); - SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); - - *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); - *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); -} - - -/** - \brief Set Interrupt Vector - \details Sets an interrupt vector in SRAM based interrupt vector table. - The interrupt number can be positive to specify a device specific interrupt, - or negative to specify a processor exception. - VTOR must been relocated to SRAM before. - \param [in] IRQn Interrupt number - \param [in] vector Address of interrupt handler function - */ -__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) -{ - uint32_t *vectors = (uint32_t *)SCB->VTOR; - vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector; - __DSB(); -} - - -/** - \brief Get Interrupt Vector - \details Reads an interrupt vector from interrupt vector table. - The interrupt number can be positive to specify a device specific interrupt, - or negative to specify a processor exception. - \param [in] IRQn Interrupt number. - \return Address of interrupt handler function - */ -__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) -{ - uint32_t *vectors = (uint32_t *)SCB->VTOR; - return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET]; -} - - -/** - \brief System Reset - \details Initiates a system reset request to reset the MCU. - */ -__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) -{ - __DSB(); /* Ensure all outstanding memory accesses included - buffered write are completed before reset */ - SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | - (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | - SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */ - __DSB(); /* Ensure completion of memory access */ - - for(;;) /* wait until reset */ - { - __NOP(); - } -} - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) -/** - \brief Set Priority Grouping (non-secure) - \details Sets the non-secure priority grouping field when in secure state using the required unlock sequence. - The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. - Only values from 0..7 are used. - In case of a conflict between priority grouping and available - priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. - \param [in] PriorityGroup Priority grouping field. - */ -__STATIC_INLINE void TZ_NVIC_SetPriorityGrouping_NS(uint32_t PriorityGroup) -{ - uint32_t reg_value; - uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ - - reg_value = SCB_NS->AIRCR; /* read old register configuration */ - reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ - reg_value = (reg_value | - ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | - (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority group */ - SCB_NS->AIRCR = reg_value; -} - - -/** - \brief Get Priority Grouping (non-secure) - \details Reads the priority grouping field from the non-secure NVIC when in secure state. - \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). - */ -__STATIC_INLINE uint32_t TZ_NVIC_GetPriorityGrouping_NS(void) -{ - return ((uint32_t)((SCB_NS->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); -} - - -/** - \brief Enable Interrupt (non-secure) - \details Enables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state. - \param [in] IRQn Device specific interrupt number. - \note IRQn must not be negative. - */ -__STATIC_INLINE void TZ_NVIC_EnableIRQ_NS(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); - } -} - - -/** - \brief Get Interrupt Enable status (non-secure) - \details Returns a device specific interrupt enable status from the non-secure NVIC interrupt controller when in secure state. - \param [in] IRQn Device specific interrupt number. - \return 0 Interrupt is not enabled. - \return 1 Interrupt is enabled. - \note IRQn must not be negative. - */ -__STATIC_INLINE uint32_t TZ_NVIC_GetEnableIRQ_NS(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - return((uint32_t)(((NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); - } - else - { - return(0U); - } -} - - -/** - \brief Disable Interrupt (non-secure) - \details Disables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state. - \param [in] IRQn Device specific interrupt number. - \note IRQn must not be negative. - */ -__STATIC_INLINE void TZ_NVIC_DisableIRQ_NS(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - NVIC_NS->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); - } -} - - -/** - \brief Get Pending Interrupt (non-secure) - \details Reads the NVIC pending register in the non-secure NVIC when in secure state and returns the pending bit for the specified device specific interrupt. - \param [in] IRQn Device specific interrupt number. - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - \note IRQn must not be negative. - */ -__STATIC_INLINE uint32_t TZ_NVIC_GetPendingIRQ_NS(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - return((uint32_t)(((NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); - } - else - { - return(0U); - } -} - - -/** - \brief Set Pending Interrupt (non-secure) - \details Sets the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state. - \param [in] IRQn Device specific interrupt number. - \note IRQn must not be negative. - */ -__STATIC_INLINE void TZ_NVIC_SetPendingIRQ_NS(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); - } -} - - -/** - \brief Clear Pending Interrupt (non-secure) - \details Clears the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state. - \param [in] IRQn Device specific interrupt number. - \note IRQn must not be negative. - */ -__STATIC_INLINE void TZ_NVIC_ClearPendingIRQ_NS(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - NVIC_NS->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); - } -} - - -/** - \brief Get Active Interrupt (non-secure) - \details Reads the active register in non-secure NVIC when in secure state and returns the active bit for the device specific interrupt. - \param [in] IRQn Device specific interrupt number. - \return 0 Interrupt status is not active. - \return 1 Interrupt status is active. - \note IRQn must not be negative. - */ -__STATIC_INLINE uint32_t TZ_NVIC_GetActive_NS(IRQn_Type IRQn) -{ - if ((int32_t)(IRQn) >= 0) - { - return((uint32_t)(((NVIC_NS->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); - } - else - { - return(0U); - } -} - - -/** - \brief Set Interrupt Priority (non-secure) - \details Sets the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state. - The interrupt number can be positive to specify a device specific interrupt, - or negative to specify a processor exception. - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - \note The priority cannot be set for every non-secure processor exception. - */ -__STATIC_INLINE void TZ_NVIC_SetPriority_NS(IRQn_Type IRQn, uint32_t priority) -{ - if ((int32_t)(IRQn) >= 0) - { - NVIC_NS->IPR[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - SCB_NS->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } -} - - -/** - \brief Get Interrupt Priority (non-secure) - \details Reads the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state. - The interrupt number can be positive to specify a device specific interrupt, - or negative to specify a processor exception. - \param [in] IRQn Interrupt number. - \return Interrupt Priority. Value is aligned automatically to the implemented priority bits of the microcontroller. - */ -__STATIC_INLINE uint32_t TZ_NVIC_GetPriority_NS(IRQn_Type IRQn) -{ - - if ((int32_t)(IRQn) >= 0) - { - return(((uint32_t)NVIC_NS->IPR[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return(((uint32_t)SCB_NS->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); - } -} -#endif /* defined (__ARM_FEATURE_CMSE) &&(__ARM_FEATURE_CMSE == 3U) */ - -/*@} end of CMSIS_Core_NVICFunctions */ - -/* ########################## MPU functions #################################### */ - -#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) - -#include "mpu_armv8.h" - -#endif - -/* ########################## FPU functions #################################### */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_FpuFunctions FPU Functions - \brief Function that provides FPU type. - @{ - */ - -/** - \brief get FPU type - \details returns the FPU type - \returns - - \b 0: No FPU - - \b 1: Single precision FPU - - \b 2: Double + Single precision FPU - */ -__STATIC_INLINE uint32_t SCB_GetFPUType(void) -{ - uint32_t mvfr0; - - mvfr0 = FPU->MVFR0; - if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x220U) - { - return 2U; /* Double + Single precision FPU */ - } - else if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x020U) - { - return 1U; /* Single precision FPU */ - } - else - { - return 0U; /* No FPU */ - } -} - - -/*@} end of CMSIS_Core_FpuFunctions */ - - - -/* ########################## SAU functions #################################### */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SAUFunctions SAU Functions - \brief Functions that configure the SAU. - @{ - */ - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) - -/** - \brief Enable SAU - \details Enables the Security Attribution Unit (SAU). - */ -__STATIC_INLINE void TZ_SAU_Enable(void) -{ - SAU->CTRL |= (SAU_CTRL_ENABLE_Msk); -} - - - -/** - \brief Disable SAU - \details Disables the Security Attribution Unit (SAU). - */ -__STATIC_INLINE void TZ_SAU_Disable(void) -{ - SAU->CTRL &= ~(SAU_CTRL_ENABLE_Msk); -} - -#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ - -/*@} end of CMSIS_Core_SAUFunctions */ - - - - -/* ################################## Debug Control function ############################################ */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_DCBFunctions Debug Control Functions - \brief Functions that access the Debug Control Block. - @{ - */ - - -/** - \brief Set Debug Authentication Control Register - \details writes to Debug Authentication Control register. - \param [in] value value to be writen. - */ -__STATIC_INLINE void DCB_SetAuthCtrl(uint32_t value) -{ - __DSB(); - __ISB(); - DCB->DAUTHCTRL = value; - __DSB(); - __ISB(); -} - - -/** - \brief Get Debug Authentication Control Register - \details Reads Debug Authentication Control register. - \return Debug Authentication Control Register. - */ -__STATIC_INLINE uint32_t DCB_GetAuthCtrl(void) -{ - return (DCB->DAUTHCTRL); -} - - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) -/** - \brief Set Debug Authentication Control Register (non-secure) - \details writes to non-secure Debug Authentication Control register when in secure state. - \param [in] value value to be writen - */ -__STATIC_INLINE void TZ_DCB_SetAuthCtrl_NS(uint32_t value) -{ - __DSB(); - __ISB(); - DCB_NS->DAUTHCTRL = value; - __DSB(); - __ISB(); -} - - -/** - \brief Get Debug Authentication Control Register (non-secure) - \details Reads non-secure Debug Authentication Control register when in secure state. - \return Debug Authentication Control Register. - */ -__STATIC_INLINE uint32_t TZ_DCB_GetAuthCtrl_NS(void) -{ - return (DCB_NS->DAUTHCTRL); -} -#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ - -/*@} end of CMSIS_Core_DCBFunctions */ - - - - -/* ################################## Debug Identification function ############################################ */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_DIBFunctions Debug Identification Functions - \brief Functions that access the Debug Identification Block. - @{ - */ - - -/** - \brief Get Debug Authentication Status Register - \details Reads Debug Authentication Status register. - \return Debug Authentication Status Register. - */ -__STATIC_INLINE uint32_t DIB_GetAuthStatus(void) -{ - return (DIB->DAUTHSTATUS); -} - - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) -/** - \brief Get Debug Authentication Status Register (non-secure) - \details Reads non-secure Debug Authentication Status register when in secure state. - \return Debug Authentication Status Register. - */ -__STATIC_INLINE uint32_t TZ_DIB_GetAuthStatus_NS(void) -{ - return (DIB_NS->DAUTHSTATUS); -} -#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ - -/*@} end of CMSIS_Core_DCBFunctions */ - - - - -/* ################################## SysTick function ############################################ */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SysTickFunctions SysTick Functions - \brief Functions that configure the System. - @{ - */ - -#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) - -/** - \brief System Tick Configuration - \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. - Counter is in free running mode to generate periodic interrupts. - \param [in] ticks Number of ticks between two interrupts. - \return 0 Function succeeded. - \return 1 Function failed. - \note When the variable __Vendor_SysTickConfig is set to 1, then the - function SysTick_Config is not included. In this case, the file device.h - must contain a vendor-specific implementation of this function. - */ -__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) -{ - if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) - { - return (1UL); /* Reload value impossible */ - } - - SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ - NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ - SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ - SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | - SysTick_CTRL_TICKINT_Msk | - SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ - return (0UL); /* Function successful */ -} - -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) -/** - \brief System Tick Configuration (non-secure) - \details Initializes the non-secure System Timer and its interrupt when in secure state, and starts the System Tick Timer. - Counter is in free running mode to generate periodic interrupts. - \param [in] ticks Number of ticks between two interrupts. - \return 0 Function succeeded. - \return 1 Function failed. - \note When the variable __Vendor_SysTickConfig is set to 1, then the - function TZ_SysTick_Config_NS is not included. In this case, the file device.h - must contain a vendor-specific implementation of this function. - - */ -__STATIC_INLINE uint32_t TZ_SysTick_Config_NS(uint32_t ticks) -{ - if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) - { - return (1UL); /* Reload value impossible */ - } - - SysTick_NS->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ - TZ_NVIC_SetPriority_NS (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ - SysTick_NS->VAL = 0UL; /* Load the SysTick Counter Value */ - SysTick_NS->CTRL = SysTick_CTRL_CLKSOURCE_Msk | - SysTick_CTRL_TICKINT_Msk | - SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ - return (0UL); /* Function successful */ -} -#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ - -#endif - -/*@} end of CMSIS_Core_SysTickFunctions */ - - - -/* ##################################### Debug In/Output function ########################################### */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_core_DebugFunctions ITM Functions - \brief Functions that access the ITM debug interface. - @{ - */ - -extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */ -#define ITM_RXBUFFER_EMPTY ((int32_t)0x5AA55AA5U) /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */ - - -/** - \brief ITM Send Character - \details Transmits a character via the ITM channel 0, and - \li Just returns when no debugger is connected that has booked the output. - \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted. - \param [in] ch Character to transmit. - \returns Character to transmit. - */ -__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch) -{ - if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */ - ((ITM->TER & 1UL ) != 0UL) ) /* ITM Port #0 enabled */ - { - while (ITM->PORT[0U].u32 == 0UL) - { - __NOP(); - } - ITM->PORT[0U].u8 = (uint8_t)ch; - } - return (ch); -} - - -/** - \brief ITM Receive Character - \details Inputs a character via the external variable \ref ITM_RxBuffer. - \return Received character. - \return -1 No character pending. - */ -__STATIC_INLINE int32_t ITM_ReceiveChar (void) -{ - int32_t ch = -1; /* no character available */ - - if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) - { - ch = ITM_RxBuffer; - ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */ - } - - return (ch); -} - - -/** - \brief ITM Check Character - \details Checks whether a character is pending for reading in the variable \ref ITM_RxBuffer. - \return 0 No character available. - \return 1 Character available. - */ -__STATIC_INLINE int32_t ITM_CheckChar (void) -{ - - if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) - { - return (0); /* no character available */ - } - else - { - return (1); /* character available */ - } -} - -/*@} end of CMSIS_core_DebugFunctions */ - - - - -#ifdef __cplusplus -} -#endif - -#endif /* __CORE_CM33_H_DEPENDANT */ - -#endif /* __CMSIS_GENERIC */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/CMSIS/Core/Include/mpu_armv8.h b/bsp/nxp/mcx/mcxn/Libraries/CMSIS/Core/Include/mpu_armv8.h deleted file mode 100644 index 19855b9667c..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/CMSIS/Core/Include/mpu_armv8.h +++ /dev/null @@ -1,352 +0,0 @@ -/****************************************************************************** - * @file mpu_armv8.h - * @brief CMSIS MPU API for Armv8-M and Armv8.1-M MPU - * @version V5.1.3 - * @date 03. February 2021 - ******************************************************************************/ -/* - * Copyright (c) 2017-2021 Arm Limited. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined (__clang__) - #pragma clang system_header /* treat file as system include file */ -#endif - -#ifndef ARM_MPU_ARMV8_H -#define ARM_MPU_ARMV8_H - -/** \brief Attribute for device memory (outer only) */ -#define ARM_MPU_ATTR_DEVICE ( 0U ) - -/** \brief Attribute for non-cacheable, normal memory */ -#define ARM_MPU_ATTR_NON_CACHEABLE ( 4U ) - -/** \brief Attribute for normal memory (outer and inner) -* \param NT Non-Transient: Set to 1 for non-transient data. -* \param WB Write-Back: Set to 1 to use write-back update policy. -* \param RA Read Allocation: Set to 1 to use cache allocation on read miss. -* \param WA Write Allocation: Set to 1 to use cache allocation on write miss. -*/ -#define ARM_MPU_ATTR_MEMORY_(NT, WB, RA, WA) \ - ((((NT) & 1U) << 3U) | (((WB) & 1U) << 2U) | (((RA) & 1U) << 1U) | ((WA) & 1U)) - -/** \brief Device memory type non Gathering, non Re-ordering, non Early Write Acknowledgement */ -#define ARM_MPU_ATTR_DEVICE_nGnRnE (0U) - -/** \brief Device memory type non Gathering, non Re-ordering, Early Write Acknowledgement */ -#define ARM_MPU_ATTR_DEVICE_nGnRE (1U) - -/** \brief Device memory type non Gathering, Re-ordering, Early Write Acknowledgement */ -#define ARM_MPU_ATTR_DEVICE_nGRE (2U) - -/** \brief Device memory type Gathering, Re-ordering, Early Write Acknowledgement */ -#define ARM_MPU_ATTR_DEVICE_GRE (3U) - -/** \brief Memory Attribute -* \param O Outer memory attributes -* \param I O == ARM_MPU_ATTR_DEVICE: Device memory attributes, else: Inner memory attributes -*/ -#define ARM_MPU_ATTR(O, I) ((((O) & 0xFU) << 4U) | ((((O) & 0xFU) != 0U) ? ((I) & 0xFU) : (((I) & 0x3U) << 2U))) - -/** \brief Normal memory non-shareable */ -#define ARM_MPU_SH_NON (0U) - -/** \brief Normal memory outer shareable */ -#define ARM_MPU_SH_OUTER (2U) - -/** \brief Normal memory inner shareable */ -#define ARM_MPU_SH_INNER (3U) - -/** \brief Memory access permissions -* \param RO Read-Only: Set to 1 for read-only memory. -* \param NP Non-Privileged: Set to 1 for non-privileged memory. -*/ -#define ARM_MPU_AP_(RO, NP) ((((RO) & 1U) << 1U) | ((NP) & 1U)) - -/** \brief Region Base Address Register value -* \param BASE The base address bits [31:5] of a memory region. The value is zero extended. Effective address gets 32 byte aligned. -* \param SH Defines the Shareability domain for this memory region. -* \param RO Read-Only: Set to 1 for a read-only memory region. -* \param NP Non-Privileged: Set to 1 for a non-privileged memory region. -* \oaram XN eXecute Never: Set to 1 for a non-executable memory region. -*/ -#define ARM_MPU_RBAR(BASE, SH, RO, NP, XN) \ - (((BASE) & MPU_RBAR_BASE_Msk) | \ - (((SH) << MPU_RBAR_SH_Pos) & MPU_RBAR_SH_Msk) | \ - ((ARM_MPU_AP_(RO, NP) << MPU_RBAR_AP_Pos) & MPU_RBAR_AP_Msk) | \ - (((XN) << MPU_RBAR_XN_Pos) & MPU_RBAR_XN_Msk)) - -/** \brief Region Limit Address Register value -* \param LIMIT The limit address bits [31:5] for this memory region. The value is one extended. -* \param IDX The attribute index to be associated with this memory region. -*/ -#define ARM_MPU_RLAR(LIMIT, IDX) \ - (((LIMIT) & MPU_RLAR_LIMIT_Msk) | \ - (((IDX) << MPU_RLAR_AttrIndx_Pos) & MPU_RLAR_AttrIndx_Msk) | \ - (MPU_RLAR_EN_Msk)) - -#if defined(MPU_RLAR_PXN_Pos) - -/** \brief Region Limit Address Register with PXN value -* \param LIMIT The limit address bits [31:5] for this memory region. The value is one extended. -* \param PXN Privileged execute never. Defines whether code can be executed from this privileged region. -* \param IDX The attribute index to be associated with this memory region. -*/ -#define ARM_MPU_RLAR_PXN(LIMIT, PXN, IDX) \ - (((LIMIT) & MPU_RLAR_LIMIT_Msk) | \ - (((PXN) << MPU_RLAR_PXN_Pos) & MPU_RLAR_PXN_Msk) | \ - (((IDX) << MPU_RLAR_AttrIndx_Pos) & MPU_RLAR_AttrIndx_Msk) | \ - (MPU_RLAR_EN_Msk)) - -#endif - -/** -* Struct for a single MPU Region -*/ -typedef struct { - uint32_t RBAR; /*!< Region Base Address Register value */ - uint32_t RLAR; /*!< Region Limit Address Register value */ -} ARM_MPU_Region_t; - -/** Enable the MPU. -* \param MPU_Control Default access permissions for unconfigured regions. -*/ -__STATIC_INLINE void ARM_MPU_Enable(uint32_t MPU_Control) -{ - __DMB(); - MPU->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk; -#ifdef SCB_SHCSR_MEMFAULTENA_Msk - SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk; -#endif - __DSB(); - __ISB(); -} - -/** Disable the MPU. -*/ -__STATIC_INLINE void ARM_MPU_Disable(void) -{ - __DMB(); -#ifdef SCB_SHCSR_MEMFAULTENA_Msk - SCB->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk; -#endif - MPU->CTRL &= ~MPU_CTRL_ENABLE_Msk; - __DSB(); - __ISB(); -} - -#ifdef MPU_NS -/** Enable the Non-secure MPU. -* \param MPU_Control Default access permissions for unconfigured regions. -*/ -__STATIC_INLINE void ARM_MPU_Enable_NS(uint32_t MPU_Control) -{ - __DMB(); - MPU_NS->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk; -#ifdef SCB_SHCSR_MEMFAULTENA_Msk - SCB_NS->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk; -#endif - __DSB(); - __ISB(); -} - -/** Disable the Non-secure MPU. -*/ -__STATIC_INLINE void ARM_MPU_Disable_NS(void) -{ - __DMB(); -#ifdef SCB_SHCSR_MEMFAULTENA_Msk - SCB_NS->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk; -#endif - MPU_NS->CTRL &= ~MPU_CTRL_ENABLE_Msk; - __DSB(); - __ISB(); -} -#endif - -/** Set the memory attribute encoding to the given MPU. -* \param mpu Pointer to the MPU to be configured. -* \param idx The attribute index to be set [0-7] -* \param attr The attribute value to be set. -*/ -__STATIC_INLINE void ARM_MPU_SetMemAttrEx(MPU_Type* mpu, uint8_t idx, uint8_t attr) -{ - const uint8_t reg = idx / 4U; - const uint32_t pos = ((idx % 4U) * 8U); - const uint32_t mask = 0xFFU << pos; - - if (reg >= (sizeof(mpu->MAIR) / sizeof(mpu->MAIR[0]))) { - return; // invalid index - } - - mpu->MAIR[reg] = ((mpu->MAIR[reg] & ~mask) | ((attr << pos) & mask)); -} - -/** Set the memory attribute encoding. -* \param idx The attribute index to be set [0-7] -* \param attr The attribute value to be set. -*/ -__STATIC_INLINE void ARM_MPU_SetMemAttr(uint8_t idx, uint8_t attr) -{ - ARM_MPU_SetMemAttrEx(MPU, idx, attr); -} - -#ifdef MPU_NS -/** Set the memory attribute encoding to the Non-secure MPU. -* \param idx The attribute index to be set [0-7] -* \param attr The attribute value to be set. -*/ -__STATIC_INLINE void ARM_MPU_SetMemAttr_NS(uint8_t idx, uint8_t attr) -{ - ARM_MPU_SetMemAttrEx(MPU_NS, idx, attr); -} -#endif - -/** Clear and disable the given MPU region of the given MPU. -* \param mpu Pointer to MPU to be used. -* \param rnr Region number to be cleared. -*/ -__STATIC_INLINE void ARM_MPU_ClrRegionEx(MPU_Type* mpu, uint32_t rnr) -{ - mpu->RNR = rnr; - mpu->RLAR = 0U; -} - -/** Clear and disable the given MPU region. -* \param rnr Region number to be cleared. -*/ -__STATIC_INLINE void ARM_MPU_ClrRegion(uint32_t rnr) -{ - ARM_MPU_ClrRegionEx(MPU, rnr); -} - -#ifdef MPU_NS -/** Clear and disable the given Non-secure MPU region. -* \param rnr Region number to be cleared. -*/ -__STATIC_INLINE void ARM_MPU_ClrRegion_NS(uint32_t rnr) -{ - ARM_MPU_ClrRegionEx(MPU_NS, rnr); -} -#endif - -/** Configure the given MPU region of the given MPU. -* \param mpu Pointer to MPU to be used. -* \param rnr Region number to be configured. -* \param rbar Value for RBAR register. -* \param rlar Value for RLAR register. -*/ -__STATIC_INLINE void ARM_MPU_SetRegionEx(MPU_Type* mpu, uint32_t rnr, uint32_t rbar, uint32_t rlar) -{ - mpu->RNR = rnr; - mpu->RBAR = rbar; - mpu->RLAR = rlar; -} - -/** Configure the given MPU region. -* \param rnr Region number to be configured. -* \param rbar Value for RBAR register. -* \param rlar Value for RLAR register. -*/ -__STATIC_INLINE void ARM_MPU_SetRegion(uint32_t rnr, uint32_t rbar, uint32_t rlar) -{ - ARM_MPU_SetRegionEx(MPU, rnr, rbar, rlar); -} - -#ifdef MPU_NS -/** Configure the given Non-secure MPU region. -* \param rnr Region number to be configured. -* \param rbar Value for RBAR register. -* \param rlar Value for RLAR register. -*/ -__STATIC_INLINE void ARM_MPU_SetRegion_NS(uint32_t rnr, uint32_t rbar, uint32_t rlar) -{ - ARM_MPU_SetRegionEx(MPU_NS, rnr, rbar, rlar); -} -#endif - -/** Memcpy with strictly ordered memory access, e.g. used by code in ARM_MPU_LoadEx() -* \param dst Destination data is copied to. -* \param src Source data is copied from. -* \param len Amount of data words to be copied. -*/ -__STATIC_INLINE void ARM_MPU_OrderedMemcpy(volatile uint32_t* dst, const uint32_t* __RESTRICT src, uint32_t len) -{ - uint32_t i; - for (i = 0U; i < len; ++i) - { - dst[i] = src[i]; - } -} - -/** Load the given number of MPU regions from a table to the given MPU. -* \param mpu Pointer to the MPU registers to be used. -* \param rnr First region number to be configured. -* \param table Pointer to the MPU configuration table. -* \param cnt Amount of regions to be configured. -*/ -__STATIC_INLINE void ARM_MPU_LoadEx(MPU_Type* mpu, uint32_t rnr, ARM_MPU_Region_t const* table, uint32_t cnt) -{ - const uint32_t rowWordSize = sizeof(ARM_MPU_Region_t)/4U; - if (cnt == 1U) { - mpu->RNR = rnr; - ARM_MPU_OrderedMemcpy(&(mpu->RBAR), &(table->RBAR), rowWordSize); - } else { - uint32_t rnrBase = rnr & ~(MPU_TYPE_RALIASES-1U); - uint32_t rnrOffset = rnr % MPU_TYPE_RALIASES; - - mpu->RNR = rnrBase; - while ((rnrOffset + cnt) > MPU_TYPE_RALIASES) { - uint32_t c = MPU_TYPE_RALIASES - rnrOffset; - ARM_MPU_OrderedMemcpy(&(mpu->RBAR)+(rnrOffset*2U), &(table->RBAR), c*rowWordSize); - table += c; - cnt -= c; - rnrOffset = 0U; - rnrBase += MPU_TYPE_RALIASES; - mpu->RNR = rnrBase; - } - - ARM_MPU_OrderedMemcpy(&(mpu->RBAR)+(rnrOffset*2U), &(table->RBAR), cnt*rowWordSize); - } -} - -/** Load the given number of MPU regions from a table. -* \param rnr First region number to be configured. -* \param table Pointer to the MPU configuration table. -* \param cnt Amount of regions to be configured. -*/ -__STATIC_INLINE void ARM_MPU_Load(uint32_t rnr, ARM_MPU_Region_t const* table, uint32_t cnt) -{ - ARM_MPU_LoadEx(MPU, rnr, table, cnt); -} - -#ifdef MPU_NS -/** Load the given number of MPU regions from a table to the Non-secure MPU. -* \param rnr First region number to be configured. -* \param table Pointer to the MPU configuration table. -* \param cnt Amount of regions to be configured. -*/ -__STATIC_INLINE void ARM_MPU_Load_NS(uint32_t rnr, ARM_MPU_Region_t const* table, uint32_t cnt) -{ - ARM_MPU_LoadEx(MPU_NS, rnr, table, cnt); -} -#endif - -#endif - diff --git a/bsp/nxp/mcx/mcxn/Libraries/CMSIS/Core/Include/tz_context.h b/bsp/nxp/mcx/mcxn/Libraries/CMSIS/Core/Include/tz_context.h deleted file mode 100644 index facc2c9a47e..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/CMSIS/Core/Include/tz_context.h +++ /dev/null @@ -1,70 +0,0 @@ -/****************************************************************************** - * @file tz_context.h - * @brief Context Management for Armv8-M TrustZone - * @version V1.0.1 - * @date 10. January 2018 - ******************************************************************************/ -/* - * Copyright (c) 2017-2018 Arm Limited. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined (__clang__) - #pragma clang system_header /* treat file as system include file */ -#endif - -#ifndef TZ_CONTEXT_H -#define TZ_CONTEXT_H - -#include - -#ifndef TZ_MODULEID_T -#define TZ_MODULEID_T -/// \details Data type that identifies secure software modules called by a process. -typedef uint32_t TZ_ModuleId_t; -#endif - -/// \details TZ Memory ID identifies an allocated memory slot. -typedef uint32_t TZ_MemoryId_t; - -/// Initialize secure context memory system -/// \return execution status (1: success, 0: error) -uint32_t TZ_InitContextSystem_S (void); - -/// Allocate context memory for calling secure software modules in TrustZone -/// \param[in] module identifies software modules called from non-secure mode -/// \return value != 0 id TrustZone memory slot identifier -/// \return value 0 no memory available or internal error -TZ_MemoryId_t TZ_AllocModuleContext_S (TZ_ModuleId_t module); - -/// Free context memory that was previously allocated with \ref TZ_AllocModuleContext_S -/// \param[in] id TrustZone memory slot identifier -/// \return execution status (1: success, 0: error) -uint32_t TZ_FreeModuleContext_S (TZ_MemoryId_t id); - -/// Load secure context (called on RTOS thread context switch) -/// \param[in] id TrustZone memory slot identifier -/// \return execution status (1: success, 0: error) -uint32_t TZ_LoadContext_S (TZ_MemoryId_t id); - -/// Store secure context (called on RTOS thread context switch) -/// \param[in] id TrustZone memory slot identifier -/// \return execution status (1: success, 0: error) -uint32_t TZ_StoreContext_S (TZ_MemoryId_t id); - -#endif // TZ_CONTEXT_H diff --git a/bsp/nxp/mcx/mcxn/Libraries/CMSIS/LICENSE.txt b/bsp/nxp/mcx/mcxn/Libraries/CMSIS/LICENSE.txt deleted file mode 100644 index 8dada3edaf5..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/CMSIS/LICENSE.txt +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - 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. diff --git a/bsp/nxp/mcx/mcxn/Libraries/Kconfig b/bsp/nxp/mcx/mcxn/Libraries/Kconfig index 77ee549201b..5c7bad2a64a 100644 --- a/bsp/nxp/mcx/mcxn/Libraries/Kconfig +++ b/bsp/nxp/mcx/mcxn/Libraries/Kconfig @@ -2,3 +2,5 @@ config SOC_MCX bool select ARCH_ARM_CORTEX_M33 select ARCH_ARM_CORTEX_FPU + select PKG_USING_NXP_MCX_CMSIS_DRIVER + select PKG_USING_NXP_MCX_SERIES_DRIVER diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/MCXN236.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/MCXN236.h deleted file mode 100644 index 113e97967e0..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/MCXN236.h +++ /dev/null @@ -1,70367 +0,0 @@ -/* -** ################################################################### -** Processors: MCXN236VDF -** MCXN236VNL -** -** Compilers: GNU C Compiler -** IAR ANSI C/C++ Compiler for ARM -** Keil ARM C/C++ Compiler -** MCUXpresso Compiler -** -** Reference manual: MCXN23XRM -** Version: rev. 1.0, 2023-10-01 -** Build: b240409 -** -** Abstract: -** CMSIS Peripheral Access Layer for MCXN236 -** -** Copyright 1997-2016 Freescale Semiconductor, Inc. -** Copyright 2016-2024 NXP -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** Revisions: -** - rev. 1.0 (2023-10-01) -** Initial version based on RM 1.2 -** -** ################################################################### -*/ - -/*! - * @file MCXN236.h - * @version 1.0 - * @date 2023-10-01 - * @brief CMSIS Peripheral Access Layer for MCXN236 - * - * CMSIS Peripheral Access Layer for MCXN236 - */ - -#if !defined(MCXN236_H_) -#define MCXN236_H_ /**< Symbol preventing repeated inclusion */ - -/** Memory map major version (memory maps with equal major version number are - * compatible) */ -#define MCU_MEM_MAP_VERSION 0x0100U -/** Memory map minor version */ -#define MCU_MEM_MAP_VERSION_MINOR 0x0000U - - -/* ---------------------------------------------------------------------------- - -- Interrupt vector numbers - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup Interrupt_vector_numbers Interrupt vector numbers - * @{ - */ - -/** Interrupt Number Definitions */ -#define NUMBER_OF_INT_VECTORS 172 /**< Number of interrupts in the Vector table */ - -typedef enum IRQn { - /* Auxiliary constants */ - NotAvail_IRQn = -128, /**< Not available device specific interrupt */ - - /* Core interrupts */ - NonMaskableInt_IRQn = -14, /**< Non Maskable Interrupt */ - HardFault_IRQn = -13, /**< Cortex-M33 SV Hard Fault Interrupt */ - MemoryManagement_IRQn = -12, /**< Cortex-M33 Memory Management Interrupt */ - BusFault_IRQn = -11, /**< Cortex-M33 Bus Fault Interrupt */ - UsageFault_IRQn = -10, /**< Cortex-M33 Usage Fault Interrupt */ - SecureFault_IRQn = -9, /**< Cortex-M33 Secure Fault Interrupt */ - SVCall_IRQn = -5, /**< Cortex-M33 SV Call Interrupt */ - DebugMonitor_IRQn = -4, /**< Cortex-M33 Debug Monitor Interrupt */ - PendSV_IRQn = -2, /**< Cortex-M33 Pend SV Interrupt */ - SysTick_IRQn = -1, /**< Cortex-M33 System Tick Interrupt */ - - /* Device specific interrupts */ - OR_IRQn = 0, /**< OR IRQ */ - EDMA_0_CH0_IRQn = 1, /**< eDMA_0_CH0 error or transfer complete */ - EDMA_0_CH1_IRQn = 2, /**< eDMA_0_CH1 error or transfer complete */ - EDMA_0_CH2_IRQn = 3, /**< eDMA_0_CH2 error or transfer complete */ - EDMA_0_CH3_IRQn = 4, /**< eDMA_0_CH3 error or transfer complete */ - EDMA_0_CH4_IRQn = 5, /**< eDMA_0_CH4 error or transfer complete */ - EDMA_0_CH5_IRQn = 6, /**< eDMA_0_CH5 error or transfer complete */ - EDMA_0_CH6_IRQn = 7, /**< eDMA_0_CH6 error or transfer complete */ - EDMA_0_CH7_IRQn = 8, /**< eDMA_0_CH7 error or transfer complete */ - EDMA_0_CH8_IRQn = 9, /**< eDMA_0_CH8 error or transfer complete */ - EDMA_0_CH9_IRQn = 10, /**< eDMA_0_CH9 error or transfer complete */ - EDMA_0_CH10_IRQn = 11, /**< eDMA_0_CH10 error or transfer complete */ - EDMA_0_CH11_IRQn = 12, /**< eDMA_0_CH11 error or transfer complete */ - EDMA_0_CH12_IRQn = 13, /**< eDMA_0_CH12 error or transfer complete */ - EDMA_0_CH13_IRQn = 14, /**< eDMA_0_CH13 error or transfer complete */ - EDMA_0_CH14_IRQn = 15, /**< eDMA_0_CH14 error or transfer complete */ - EDMA_0_CH15_IRQn = 16, /**< eDMA_0_CH15 error or transfer complete */ - GPIO00_IRQn = 17, /**< GPIO0 interrupt 0 */ - GPIO01_IRQn = 18, /**< GPIO0 interrupt 1 */ - GPIO10_IRQn = 19, /**< GPIO1 interrupt 0 */ - GPIO11_IRQn = 20, /**< GPIO1 interrupt 1 */ - GPIO20_IRQn = 21, /**< GPIO2 interrupt 0 */ - GPIO21_IRQn = 22, /**< GPIO2 interrupt 1 */ - GPIO30_IRQn = 23, /**< GPIO3 interrupt 0 */ - GPIO31_IRQn = 24, /**< GPIO3 interrupt 1 */ - GPIO40_IRQn = 25, /**< GPIO4 interrupt 0 */ - GPIO41_IRQn = 26, /**< GPIO4 interrupt 1 */ - GPIO50_IRQn = 27, /**< GPIO5 interrupt 0 */ - GPIO51_IRQn = 28, /**< GPIO5 interrupt 1 */ - UTICK0_IRQn = 29, /**< Micro-Tick Timer interrupt */ - MRT0_IRQn = 30, /**< Multi-Rate Timer interrupt */ - CTIMER0_IRQn = 31, /**< Standard counter/timer 0 interrupt */ - CTIMER1_IRQn = 32, /**< Standard counter/timer 1 interrupt */ - Reserved49_IRQn = 33, /**< Reserved interrupt */ - CTIMER2_IRQn = 34, /**< Standard counter/timer 2 interrupt */ - LP_FLEXCOMM0_IRQn = 35, /**< LP_FLEXCOMM0 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) */ - LP_FLEXCOMM1_IRQn = 36, /**< LP_FLEXCOMM1 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) */ - LP_FLEXCOMM2_IRQn = 37, /**< LP_FLEXCOMM2 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) */ - LP_FLEXCOMM3_IRQn = 38, /**< LP_FLEXCOMM3 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) */ - LP_FLEXCOMM4_IRQn = 39, /**< LP_FLEXCOMM4 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) */ - LP_FLEXCOMM5_IRQn = 40, /**< LP_FLEXCOMM5 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) */ - LP_FLEXCOMM6_IRQn = 41, /**< LP_FLEXCOMM6 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) */ - LP_FLEXCOMM7_IRQn = 42, /**< LP_FLEXCOMM7 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) */ - Reserved59_IRQn = 43, /**< Reserved interrupt */ - Reserved60_IRQn = 44, /**< Reserved interrupt */ - ADC0_IRQn = 45, /**< Analog-to-Digital Converter 0 - General Purpose interrupt */ - ADC1_IRQn = 46, /**< Analog-to-Digital Converter 1 - General Purpose interrupt */ - PINT0_IRQn = 47, /**< Pin Interrupt Pattern Match Interrupt */ - PDM_EVENT_IRQn = 48, /**< Microphone Interface interrupt */ - Reserved65_IRQn = 49, /**< Reserved interrupt */ - Reserved66_IRQn = 50, /**< Reserved interrupt */ - USB0_DCD_IRQn = 51, /**< Universal Serial Bus - Device Charge Detect interrupt */ - RTC_IRQn = 52, /**< RTC Subsystem interrupt (RTC interrupt or Wake timer interrupt) */ - SMARTDMA_IRQn = 53, /**< SmartDMA_IRQ */ - Reserved70_IRQn = 54, /**< Reserved interrupt */ - CTIMER3_IRQn = 55, /**< Standard counter/timer 3 interrupt */ - CTIMER4_IRQn = 56, /**< Standard counter/timer 4 interrupt */ - OS_EVENT_IRQn = 57, /**< OS event timer interrupt */ - Reserved74_IRQn = 58, /**< Reserved interrupt */ - SAI0_IRQn = 59, /**< Serial Audio Interface 0 interrupt */ - SAI1_IRQn = 60, /**< Serial Audio Interface 1 interrupt */ - Reserved77_IRQn = 61, /**< Reserved interrupt */ - CAN0_IRQn = 62, /**< Controller Area Network 0 interrupt */ - CAN1_IRQn = 63, /**< Controller Area Network 1 interrupt */ - Reserved80_IRQn = 64, /**< Reserved interrupt */ - Reserved81_IRQn = 65, /**< Reserved interrupt */ - USB1_HS_PHY_IRQn = 66, /**< USBHS DCD or USBHS Phy interrupt */ - USB1_HS_IRQn = 67, /**< USB High Speed OTG Controller interrupt */ - SEC_HYPERVISOR_CALL_IRQn = 68, /**< AHB Secure Controller hypervisor call interrupt */ - Reserved85_IRQn = 69, /**< Reserved interrupt */ - Reserved86_IRQn = 70, /**< Reserved interrupt */ - Freqme_IRQn = 71, /**< Frequency Measurement interrupt */ - SEC_VIO_IRQn = 72, /**< Secure violation interrupt (Memory Block Checker interrupt or secure AHB matrix violation interrupt) */ - ELS_IRQn = 73, /**< ELS interrupt */ - PKC_IRQn = 74, /**< PKC interrupt */ - PUF_IRQn = 75, /**< Physical Unclonable Function interrupt */ - Reserved92_IRQn = 76, /**< Reserved interrupt */ - EDMA_1_CH0_IRQn = 77, /**< eDMA_1_CH0 error or transfer complete */ - EDMA_1_CH1_IRQn = 78, /**< eDMA_1_CH1 error or transfer complete */ - EDMA_1_CH2_IRQn = 79, /**< eDMA_1_CH2 error or transfer complete */ - EDMA_1_CH3_IRQn = 80, /**< eDMA_1_CH3 error or transfer complete */ - EDMA_1_CH4_IRQn = 81, /**< eDMA_1_CH4 error or transfer complete */ - EDMA_1_CH5_IRQn = 82, /**< eDMA_1_CH5 error or transfer complete */ - EDMA_1_CH6_IRQn = 83, /**< eDMA_1_CH6 error or transfer complete */ - EDMA_1_CH7_IRQn = 84, /**< eDMA_1_CH7 error or transfer complete */ - Reserved101_IRQn = 85, /**< Reserved interrupt */ - Reserved102_IRQn = 86, /**< Reserved interrupt */ - Reserved103_IRQn = 87, /**< Reserved interrupt */ - Reserved104_IRQn = 88, /**< Reserved interrupt */ - Reserved105_IRQn = 89, /**< Reserved interrupt */ - Reserved106_IRQn = 90, /**< Reserved interrupt */ - Reserved107_IRQn = 91, /**< Reserved interrupt */ - Reserved108_IRQn = 92, /**< Reserved interrupt */ - CDOG0_IRQn = 93, /**< Code Watchdog Timer 0 interrupt */ - CDOG1_IRQn = 94, /**< Code Watchdog Timer 1 interrupt */ - I3C0_IRQn = 95, /**< Improved Inter Integrated Circuit interrupt 0 */ - I3C1_IRQn = 96, /**< Improved Inter Integrated Circuit interrupt 1 */ - Reserved113_IRQn = 97, /**< Reserved interrupt */ - GDET_IRQn = 98, /**< Digital Glitch Detect 0 interrupt or Digital Glitch Detect 1 interrupt */ - VBAT0_IRQn = 99, /**< VBAT interrupt( VBAT interrupt or digital tamper interrupt) */ - EWM0_IRQn = 100, /**< External Watchdog Monitor interrupt */ - Reserved117_IRQn = 101, /**< Reserved interrupt */ - Reserved118_IRQn = 102, /**< Reserved interrupt */ - Reserved119_IRQn = 103, /**< Reserved interrupt */ - Reserved120_IRQn = 104, /**< Reserved interrupt */ - FLEXIO_IRQn = 105, /**< Flexible Input/Output interrupt */ - Reserved122_IRQn = 106, /**< Reserved interrupt */ - Reserved123_IRQn = 107, /**< Reserved interrupt */ - Reserved124_IRQn = 108, /**< Reserved interrupt */ - HSCMP0_IRQn = 109, /**< High-Speed comparator0 interrupt */ - HSCMP1_IRQn = 110, /**< High-Speed comparator1 interrupt */ - Reserved127_IRQn = 111, /**< Reserved interrupt */ - FLEXPWM0_RELOAD_ERROR_IRQn = 112, /**< FlexPWM0_reload_error interrupt */ - FLEXPWM0_FAULT_IRQn = 113, /**< FlexPWM0_fault interrupt */ - FLEXPWM0_SUBMODULE0_IRQn = 114, /**< FlexPWM0 Submodule 0 capture/compare/reload interrupt */ - FLEXPWM0_SUBMODULE1_IRQn = 115, /**< FlexPWM0 Submodule 1 capture/compare/reload interrupt */ - FLEXPWM0_SUBMODULE2_IRQn = 116, /**< FlexPWM0 Submodule 2 capture/compare/reload interrupt */ - FLEXPWM0_SUBMODULE3_IRQn = 117, /**< FlexPWM0 Submodule 3 capture/compare/reload interrupt */ - FLEXPWM1_RELOAD_ERROR_IRQn = 118, /**< FlexPWM1_reload_error interrupt */ - FLEXPWM1_FAULT_IRQn = 119, /**< FlexPWM1_fault interrupt */ - FLEXPWM1_SUBMODULE0_IRQn = 120, /**< FlexPWM1 Submodule 0 capture/compare/reload interrupt */ - FLEXPWM1_SUBMODULE1_IRQn = 121, /**< FlexPWM1 Submodule 1 capture/compare/reload interrupt */ - FLEXPWM1_SUBMODULE2_IRQn = 122, /**< FlexPWM1 Submodule 2 capture/compare/reload interrupt */ - FLEXPWM1_SUBMODULE3_IRQn = 123, /**< FlexPWM1 Submodule 3 capture/compare/reload interrupt */ - QDC0_COMPARE_IRQn = 124, /**< QDC0_Compare interrupt */ - QDC0_HOME_IRQn = 125, /**< QDC0_Home interrupt */ - QDC0_WDG_SAB_IRQn = 126, /**< QDC0_WDG_IRQ/SAB interrupt */ - QDC0_IDX_IRQn = 127, /**< QDC0_IDX interrupt */ - QDC1_COMPARE_IRQn = 128, /**< QDC1_Compare interrupt */ - QDC1_HOME_IRQn = 129, /**< QDC1_Home interrupt */ - QDC1_WDG_SAB_IRQn = 130, /**< QDC1_WDG_IRQ/SAB interrupt */ - QDC1_IDX_IRQn = 131, /**< QDC1_IDX interrupt */ - ITRC0_IRQn = 132, /**< Intrusion and Tamper Response Controller interrupt */ - Reserved149_IRQn = 133, /**< Reserved interrupt */ - ELS_ERR_IRQn = 134, /**< ELS error interrupt */ - PKC_ERR_IRQn = 135, /**< PKC error interrupt */ - ERM_SINGLE_BIT_ERROR_IRQn = 136, /**< ERM Single Bit error interrupt */ - ERM_MULTI_BIT_ERROR_IRQn = 137, /**< ERM Multi Bit error interrupt */ - FMU0_IRQn = 138, /**< Flash Management Unit interrupt */ - Reserved155_IRQn = 139, /**< Reserved interrupt */ - Reserved156_IRQn = 140, /**< Reserved interrupt */ - Reserved157_IRQn = 141, /**< Reserved interrupt */ - Reserved158_IRQn = 142, /**< Reserved interrupt */ - LPTMR0_IRQn = 143, /**< Low Power Timer 0 interrupt */ - LPTMR1_IRQn = 144, /**< Low Power Timer 1 interrupt */ - SCG_IRQn = 145, /**< System Clock Generator interrupt */ - SPC_IRQn = 146, /**< System Power Controller interrupt */ - WUU_IRQn = 147, /**< Wake Up Unit interrupt */ - PORT_EFT_IRQn = 148, /**< PORT0~5 EFT interrupt */ - Reserved165_IRQn = 149, /**< Reserved interrupt */ - Reserved166_IRQn = 150, /**< Reserved interrupt */ - Reserved167_IRQn = 151, /**< Reserved interrupt */ - WWDT0_IRQn = 152, /**< Windowed Watchdog Timer 0 interrupt */ - WWDT1_IRQn = 153, /**< Windowed Watchdog Timer 1 interrupt */ - CMC0_IRQn = 154, /**< Core Mode Controller interrupt */ - Reserved171_IRQn = 155 /**< Reserved interrupt */ -} IRQn_Type; - -/*! - * @} - */ /* end of group Interrupt_vector_numbers */ - - -/* ---------------------------------------------------------------------------- - -- Cortex M33 Core Configuration - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup Cortex_Core_Configuration Cortex M33 Core Configuration - * @{ - */ - -#define __MPU_PRESENT 1 /**< Defines if an MPU is present or not */ -#define __NVIC_PRIO_BITS 3 /**< Number of priority bits implemented in the NVIC */ -#define __Vendor_SysTickConfig 0 /**< Vendor specific implementation of SysTickConfig is defined */ -#define __FPU_PRESENT 1 /**< Defines if an FPU is present or not */ -#define __DSP_PRESENT 1 /**< Defines if Armv8-M Mainline core supports DSP instructions */ -#define __SAUREGION_PRESENT 1 /**< Defines if an SAU is present or not */ - -#include "core_cm33.h" /* Core Peripheral Access Layer */ -#include "system_MCXN236.h" /* Device specific configuration file */ - -/*! - * @} - */ /* end of group Cortex_Core_Configuration */ - - -/* ---------------------------------------------------------------------------- - -- Mapping Information - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup Mapping_Information Mapping Information - * @{ - */ - -/** Mapping Information */ -/*! - * @addtogroup eim_memory_channel - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @brief Structure for the eim_memory_channel - * - * Defines the structure for the EIM resource collections. - */ - -typedef enum _eim_memory_channel -{ - kEIM_MemoryChannelRAMX = 0U, /**< Memory RAMX */ - kEIM_MemoryChannelRAMA = 1U, /**< Memory RAMA */ - kEIM_MemoryChannelRAMB = 2U, /**< Memory RAMB */ - kEIM_MemoryChannelRAMC = 3U, /**< Memory RAMC */ - kEIM_MemoryChannelRAMD = 4U, /**< Memory RAMD */ - kEIM_MemoryChannelRAME = 5U, /**< Memory RAME */ - kEIM_MemoryChannelRAMF = 6U, /**< Memory RAMF */ - kEIM_MemoryChannelLPCACRAM = 7U, /**< Memory LPCACRAM */ - kEIM_MemoryChannelPKCRAM = 8U, /**< Memory PKCRAM */ -} eim_memory_channel_t; - -/* @} */ - -/*! - * @addtogroup eim_error_injection_channel_enable - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @brief Structure for the eim_error_injection_channel_enable - * - * Defines the structure for the EIM error injection resource collections. - */ - -typedef enum _eim_error_injection_channel_enable -{ - kEIM_MemoryChannelRAMXEnable = 0x80000000U, /**< Memory channel 0(RAMX) error injection enable */ - kEIM_MemoryChannelRAMAEnable = 0x40000000U, /**< Memory channel 1(RAMA) error injection enable */ - kEIM_MemoryChannelRAMBEnable = 0x20000000U, /**< Memory channel 2(RAMB) error injection enable */ - kEIM_MemoryChannelRAMCEnable = 0x10000000U, /**< Memory channel 3(RAMC) error injection enable */ - kEIM_MemoryChannelRAMDEnable = 0x8000000U, /**< Memory channel 4(RAMD) error injection enable */ - kEIM_MemoryChannelRAMEEnable = 0x4000000U, /**< Memory channel 5(RAME) error injection enable */ - kEIM_MemoryChannelRAMFEnable = 0x2000000U, /**< Memory channel 6(RAMF) error injection enable */ - kEIM_MemoryChannelLPCACRAMEnable = 0x1000000U, /**< Memory channel 7(LPCACRAM) error injection enable */ - kEIM_MemoryChannelPKCRAMEnable = 0x800000U, /**< Memory channel 8(PKCRAM) error injection enable */ -} eim_error_injection_channel_enable_t; - -/* @} */ - -/*! - * @addtogroup erm_memory_channel - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @brief Structure for the erm_memory_channel - * - * Defines the structure for the ERM resource collections. - */ - -typedef enum _erm_memory_channel -{ - kERM_MemoryChannelRAMX = 0U, /**< Memory RAMX */ - kERM_MemoryChannelRAMA = 1U, /**< Memory RAMA */ - kERM_MemoryChannelRAMB = 2U, /**< Memory RAMB */ - kERM_MemoryChannelRAMC = 3U, /**< Memory RAMC */ - kERM_MemoryChannelRAMD = 4U, /**< Memory RAMD */ - kERM_MemoryChannelRAME = 5U, /**< Memory RAME */ - kERM_MemoryChannelRAMF = 6U, /**< Memory RAMF */ - kERM_MemoryChannelLPCACRAM = 7U, /**< Memory LPCACRAM */ - kERM_MemoryChannelPKCRAM = 8U, /**< Memory PKCRAM */ - kERM_MemoryChannelFLASH = 9U, /**< Memory FLASH */ -} erm_memory_channel_t; - -/* @} */ - -/*! - * @addtogroup dma_request - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @brief Structure for the DMA hardware request - * - * Defines the structure for the DMA hardware request collections. The user can configure the - * hardware request to trigger the DMA transfer accordingly. The index - * of the hardware request varies according to the to SoC. - */ -typedef enum _dma_request_source -{ - kDma0RequestMuxPinInt0 = 3U, /**< PINT0 INT0 */ - kDma1RequestMuxPinInt0 = 3U, /**< PINT0 INT0 */ - kDma0RequestMuxPinInt1 = 4U, /**< PINT0 INT1 */ - kDma1RequestMuxPinInt1 = 4U, /**< PINT0 INT1 */ - kDma0RequestMuxPinInt2 = 5U, /**< PINT0 INT2 */ - kDma1RequestMuxPinInt2 = 5U, /**< PINT0 INT2 */ - kDma0RequestMuxPinInt3 = 6U, /**< PINT0 INT3 */ - kDma1RequestMuxPinInt3 = 6U, /**< PINT0 INT3 */ - kDma0RequestMuxCtimer0M0 = 7U, /**< CTIMER0 Match channel 0 request */ - kDma1RequestMuxCtimer0M0 = 7U, /**< CTIMER0 Match channel 0 request */ - kDma0RequestMuxCtimer0M1 = 8U, /**< CTIMER0 Match channel 1 request */ - kDma1RequestMuxCtimer0M1 = 8U, /**< CTIMER0 Match channel 1 request */ - kDma0RequestMuxCtimer1M0 = 9U, /**< CTIMER1 Match channel 0 request */ - kDma1RequestMuxCtimer1M0 = 9U, /**< CTIMER1 Match channel 0 request */ - kDma0RequestMuxCtimer1M1 = 10U, /**< CTIMER1 Match channel 1 request */ - kDma1RequestMuxCtimer1M1 = 10U, /**< CTIMER1 Match channel 1 request */ - kDma0RequestMuxCtimer2M0 = 11U, /**< CTIMER2 Match channel 0 request */ - kDma1RequestMuxCtimer2M0 = 11U, /**< CTIMER2 Match channel 0 request */ - kDma0RequestMuxCtimer2M1 = 12U, /**< CTIMER2 Match channel 1 request */ - kDma1RequestMuxCtimer2M1 = 12U, /**< CTIMER2 Match channel 1 request */ - kDma0RequestMuxCtimer3M0 = 13U, /**< CTIMER3 Match channel 0 request */ - kDma1RequestMuxCtimer3M0 = 13U, /**< CTIMER3 Match channel 0 request */ - kDma0RequestMuxCtimer3M1 = 14U, /**< CTIMER3 Match channel 1 request */ - kDma1RequestMuxCtimer3M1 = 14U, /**< CTIMER3 Match channel 1 request */ - kDma0RequestMuxCtimer4M0 = 15U, /**< CTIMER4 Match channel 0 request */ - kDma1RequestMuxCtimer4M0 = 15U, /**< CTIMER4 Match channel 0 request */ - kDma0RequestMuxCtimer4M1 = 16U, /**< CTIMER4 Match channel 1 request */ - kDma1RequestMuxCtimer4M1 = 16U, /**< CTIMER4 Match channel 1 request */ - kDma0RequestMuxWuu0 = 17U, /**< WUU0 Wake up event */ - kDma1RequestMuxWuu0 = 17U, /**< WUU0 Wake up event */ - kDma0RequestMuxMicfil0FifoRequest = 18U, /**< MICFIL0 FIFO_request */ - kDma1RequestMuxMicfil0FifoRequest = 18U, /**< MICFIL0 FIFO_request */ - kDma0RequestMuxAdc0FifoARequest = 21U, /**< ADC0 FIFO A request */ - kDma1RequestMuxAdc0FifoARequest = 21U, /**< ADC0 FIFO A request */ - kDma0RequestMuxAdc0FifoBRequest = 22U, /**< ADC0 FIFO B request */ - kDma1RequestMuxAdc0FifoBRequest = 22U, /**< ADC0 FIFO B request */ - kDma0RequestMuxAdc1FifoARequest = 23U, /**< ADC1 FIFO A request */ - kDma1RequestMuxAdc1FifoARequest = 23U, /**< ADC1 FIFO A request */ - kDma0RequestMuxAdc1FifoBRequest = 24U, /**< ADC1 FIFO B request */ - kDma1RequestMuxAdc1FifoBRequest = 24U, /**< ADC1 FIFO B request */ - kDma0RequestMuxHsCmp0DmaRequest = 28U, /**< CMP0 DMA_request */ - kDma1RequestMuxHsCmp0DmaRequest = 28U, /**< CMP0 DMA_request */ - kDma0RequestMuxHsCmp1DmaRequest = 29U, /**< CMP1 DMA_request */ - kDma1RequestMuxHsCmp1DmaRequest = 29U, /**< CMP1 DMA_request */ - kDma0RequestMuxEvtg0Out0A = 31U, /**< EVTG0 OUT0A */ - kDma1RequestMuxEvtg0Out0A = 31U, /**< EVTG0 OUT0A */ - kDma0RequestMuxEvtg0Out0B = 32U, /**< EVTG0 OUT0B */ - kDma1RequestMuxEvtg0Out0B = 32U, /**< EVTG0 OUT0B */ - kDma0RequestMuxEvtg0Out1A = 33U, /**< EVTG0 OUT1A */ - kDma1RequestMuxEvtg0Out1A = 33U, /**< EVTG0 OUT1A */ - kDma0RequestMuxEvtg0Out1B = 34U, /**< EVTG0 OUT1B */ - kDma1RequestMuxEvtg0Out1B = 34U, /**< EVTG0 OUT1B */ - kDma0RequestMuxEvtg0Out2A = 35U, /**< EVTG0 OUT2A */ - kDma1RequestMuxEvtg0Out2A = 35U, /**< EVTG0 OUT2A */ - kDma0RequestMuxEvtg0Out2B = 36U, /**< EVTG0 OUT2B */ - kDma1RequestMuxEvtg0Out2B = 36U, /**< EVTG0 OUT2B */ - kDma0RequestMuxEvtg0Out3A = 37U, /**< EVTG0 OUT3A */ - kDma1RequestMuxEvtg0Out3A = 37U, /**< EVTG0 OUT3A */ - kDma0RequestMuxEvtg0Out3B = 38U, /**< EVTG0 OUT3B */ - kDma1RequestMuxEvtg0Out3B = 38U, /**< EVTG0 OUT3B */ - kDma0RequestMuxFlexPwm0ReqCapt0 = 39U, /**< PWM0 capture0 request */ - kDma1RequestMuxFlexPwm0ReqCapt0 = 39U, /**< PWM0 capture0 request */ - kDma0RequestMuxFlexPwm0ReqCapt1 = 40U, /**< PWM0 capture1 request */ - kDma1RequestMuxFlexPwm0ReqCapt1 = 40U, /**< PWM0 capture1 request */ - kDma0RequestMuxFlexPwm0ReqCapt2 = 41U, /**< PWM0 capture2 request */ - kDma1RequestMuxFlexPwm0ReqCapt2 = 41U, /**< PWM0 capture2 request */ - kDma0RequestMuxFlexPwm0ReqCapt3 = 42U, /**< PWM0 capture3 request */ - kDma1RequestMuxFlexPwm0ReqCapt3 = 42U, /**< PWM0 capture3 request */ - kDma0RequestMuxFlexPwm0ReqVal0 = 43U, /**< PWM0 value0 request */ - kDma1RequestMuxFlexPwm0ReqVal0 = 43U, /**< PWM0 value0 request */ - kDma0RequestMuxFlexPwm0ReqVal1 = 44U, /**< PWM0 value1 request */ - kDma1RequestMuxFlexPwm0ReqVal1 = 44U, /**< PWM0 value1 request */ - kDma0RequestMuxFlexPwm0ReqVal2 = 45U, /**< PWM0 value2 request */ - kDma1RequestMuxFlexPwm0ReqVal2 = 45U, /**< PWM0 value2 request */ - kDma0RequestMuxFlexPwm0ReqVal3 = 46U, /**< PWM0 value3 request */ - kDma1RequestMuxFlexPwm0ReqVal3 = 46U, /**< PWM0 value3 request */ - kDma0RequestMuxFlexPwm1ReqCapt0 = 47U, /**< PWM1 capture0 request */ - kDma1RequestMuxFlexPwm1ReqCapt0 = 47U, /**< PWM1 capture0 request */ - kDma0RequestMuxFlexPwm1ReqCapt1 = 48U, /**< PWM1 capture1 request */ - kDma1RequestMuxFlexPwm1ReqCapt1 = 48U, /**< PWM1 capture1 request */ - kDma0RequestMuxFlexPwm1ReqCapt2 = 49U, /**< PWM1 capture2 request */ - kDma1RequestMuxFlexPwm1ReqCapt2 = 49U, /**< PWM1 capture2 request */ - kDma0RequestMuxFlexPwm1ReqCapt3 = 50U, /**< PWM1 capture3 request */ - kDma1RequestMuxFlexPwm1ReqCapt3 = 50U, /**< PWM1 capture3 request */ - kDma0RequestMuxFlexPwm1ReqVal0 = 51U, /**< PWM1 value0 request */ - kDma1RequestMuxFlexPwm1ReqVal0 = 51U, /**< PWM1 value0 request */ - kDma0RequestMuxFlexPwm1ReqVal1 = 52U, /**< PWM1 value1 request */ - kDma1RequestMuxFlexPwm1ReqVal1 = 52U, /**< PWM1 value1 request */ - kDma0RequestMuxFlexPwm1ReqVal2 = 53U, /**< PWM1 value2 request */ - kDma1RequestMuxFlexPwm1ReqVal2 = 53U, /**< PWM1 value2 request */ - kDma0RequestMuxFlexPwm1ReqVal3 = 54U, /**< PWM0 value3 request */ - kDma1RequestMuxFlexPwm1ReqVal3 = 54U, /**< PWM0 value3 request */ - kDma0RequestMuxLptmr0 = 57U, /**< LPTMR0 Counter match event */ - kDma1RequestMuxLptmr0 = 57U, /**< LPTMR0 Counter match event */ - kDma0RequestMuxLptmr1 = 58U, /**< LPTMR1 Counter match event */ - kDma1RequestMuxLptmr1 = 58U, /**< LPTMR1 Counter match event */ - kDma0RequestMuxFlexCan0DmaRequest = 59U, /**< CAN0 DMA request */ - kDma1RequestMuxFlexCan0DmaRequest = 59U, /**< CAN0 DMA request */ - kDma0RequestMuxFlexCan1DmaRequest = 60U, /**< CAN1 DMA request */ - kDma1RequestMuxFlexCan1DmaRequest = 60U, /**< CAN1 DMA request */ - kDma0RequestMuxFlexIO0ShiftRegister0Request = 61U, /**< FlexIO0 Shifter0 Status DMA request OR Timer0 Status DMA request */ - kDma1RequestMuxFlexIO0ShiftRegister0Request = 61U, /**< FlexIO0 Shifter0 Status DMA request OR Timer0 Status DMA request */ - kDma0RequestMuxFlexIO0ShiftRegister1Request = 62U, /**< FlexIO0 Shifter1 Status DMA request OR Timer1 Status DMA request */ - kDma1RequestMuxFlexIO0ShiftRegister1Request = 62U, /**< FlexIO0 Shifter1 Status DMA request OR Timer1 Status DMA request */ - kDma0RequestMuxFlexIO0ShiftRegister2Request = 63U, /**< FlexIO0 Shifter2 Status DMA request OR Timer2 Status DMA request */ - kDma1RequestMuxFlexIO0ShiftRegister2Request = 63U, /**< FlexIO0 Shifter2 Status DMA request OR Timer2 Status DMA request */ - kDma0RequestMuxFlexIO0ShiftRegister3Request = 64U, /**< FlexIO0 Shifter3 Status DMA request OR Timer3 Status DMA request */ - kDma1RequestMuxFlexIO0ShiftRegister3Request = 64U, /**< FlexIO0 Shifter3 Status DMA request OR Timer3 Status DMA request */ - kDma0RequestMuxFlexIO0ShiftRegister4Request = 65U, /**< FlexIO0 Shifter4 Status DMA request OR Timer4 Status DMA request */ - kDma1RequestMuxFlexIO0ShiftRegister4Request = 65U, /**< FlexIO0 Shifter4 Status DMA request OR Timer4 Status DMA request */ - kDma0RequestMuxFlexIO0ShiftRegister5Request = 66U, /**< FlexIO0 Shifter5 Status DMA request OR Timer5 Status DMA request */ - kDma1RequestMuxFlexIO0ShiftRegister5Request = 66U, /**< FlexIO0 Shifter5 Status DMA request OR Timer5 Status DMA request */ - kDma0RequestMuxFlexIO0ShiftRegister6Request = 67U, /**< FlexIO0 Shifter6 Status DMA request OR Timer6 Status DMA request */ - kDma1RequestMuxFlexIO0ShiftRegister6Request = 67U, /**< FlexIO0 Shifter6 Status DMA request OR Timer6 Status DMA request */ - kDma0RequestMuxFlexIO0ShiftRegister7Request = 68U, /**< FlexIO0 Shifter7 Status DMA request OR Timer7 Status DMA request */ - kDma1RequestMuxFlexIO0ShiftRegister7Request = 68U, /**< FlexIO0 Shifter7 Status DMA request OR Timer7 Status DMA request */ - kDma0RequestMuxLpFlexcomm0Rx = 69U, /**< LP_FLEXCOMM0 Receive request */ - kDma1RequestMuxLpFlexcomm0Rx = 69U, /**< LP_FLEXCOMM0 Receive request */ - kDma0RequestMuxLpFlexcomm0Tx = 70U, /**< LP_FLEXCOMM0 Transmit request */ - kDma1RequestMuxLpFlexcomm0Tx = 70U, /**< LP_FLEXCOMM0 Transmit request */ - kDma0RequestMuxLpFlexcomm1Rx = 71U, /**< LP_FLEXCOMM1 Receive request */ - kDma1RequestMuxLpFlexcomm1Rx = 71U, /**< LP_FLEXCOMM1 Receive request */ - kDma0RequestMuxLpFlexcomm1Tx = 72U, /**< LP_FLEXCOMM1 Transmit request */ - kDma1RequestMuxLpFlexcomm1Tx = 72U, /**< LP_FLEXCOMM1 Transmit request */ - kDma0RequestMuxLpFlexcomm2Rx = 73U, /**< LP_FLEXCOMM2 Receive request */ - kDma1RequestMuxLpFlexcomm2Rx = 73U, /**< LP_FLEXCOMM2 Receive request */ - kDma0RequestMuxLpFlexcomm2Tx = 74U, /**< LP_FLEXCOMM2 Transmit request */ - kDma1RequestMuxLpFlexcomm2Tx = 74U, /**< LP_FLEXCOMM2 Transmit request */ - kDma0RequestMuxLpFlexcomm3Rx = 75U, /**< LP_FLEXCOMM3 Receive request */ - kDma1RequestMuxLpFlexcomm3Rx = 75U, /**< LP_FLEXCOMM3 Receive request */ - kDma0RequestMuxLpFlexcomm3Tx = 76U, /**< LP_FLEXCOMM3 Transmit request */ - kDma1RequestMuxLpFlexcomm3Tx = 76U, /**< LP_FLEXCOMM3 Transmit request */ - kDma0RequestMuxLpFlexcomm4Rx = 77U, /**< LP_FLEXCOMM4 Receive request */ - kDma1RequestMuxLpFlexcomm4Rx = 77U, /**< LP_FLEXCOMM4 Receive request */ - kDma0RequestMuxLpFlexcomm4Tx = 78U, /**< LP_FLEXCOMM4 Transmit request */ - kDma1RequestMuxLpFlexcomm4Tx = 78U, /**< LP_FLEXCOMM4 Transmit request */ - kDma0RequestMuxLpFlexcomm5Rx = 79U, /**< LP_FLEXCOMM5 Receive request */ - kDma1RequestMuxLpFlexcomm5Rx = 79U, /**< LP_FLEXCOMM5 Receive request */ - kDma0RequestMuxLpFlexcomm5Tx = 80U, /**< LP_FLEXCOMM5 Transmit request */ - kDma1RequestMuxLpFlexcomm5Tx = 80U, /**< LP_FLEXCOMM5 Transmit request */ - kDma0RequestMuxLpFlexcomm6Rx = 81U, /**< LP_FLEXCOMM6 Receive request */ - kDma1RequestMuxLpFlexcomm6Rx = 81U, /**< LP_FLEXCOMM6 Receive request */ - kDma0RequestMuxLpFlexcomm6Tx = 82U, /**< LP_FLEXCOMM6 Transmit request */ - kDma1RequestMuxLpFlexcomm6Tx = 82U, /**< LP_FLEXCOMM6 Transmit request */ - kDma0RequestMuxLpFlexcomm7Rx = 83U, /**< LP_FLEXCOMM7 Receive request */ - kDma1RequestMuxLpFlexcomm7Rx = 83U, /**< LP_FLEXCOMM7 Receive request */ - kDma0RequestMuxLpFlexcomm7Tx = 84U, /**< LP_FLEXCOMM7 Transmit request */ - kDma1RequestMuxLpFlexcomm7Tx = 84U, /**< LP_FLEXCOMM7 Transmit request */ - kDma0RequestMuxI3c0Rx = 95U, /**< I3C0 Receive request */ - kDma1RequestMuxI3c0Rx = 95U, /**< I3C0 Receive request */ - kDma0RequestMuxI3c0Tx = 96U, /**< I3C0 Transmit request */ - kDma1RequestMuxI3c0Tx = 96U, /**< I3C0 Transmit request */ - kDma0RequestMuxI3c1Rx = 97U, /**< I3C1 Receive request */ - kDma1RequestMuxI3c1Rx = 97U, /**< I3C1 Receive request */ - kDma0RequestMuxI3c1Tx = 98U, /**< I3C1 Transmit request */ - kDma1RequestMuxI3c1Tx = 98U, /**< I3C1 Transmit request */ - kDma0RequestMuxSai0Rx = 99U, /**< SAI0 Receive request */ - kDma1RequestMuxSai0Rx = 99U, /**< SAI0 Receive request */ - kDma0RequestMuxSai0Tx = 100U, /**< SAI0 Transmit request */ - kDma1RequestMuxSai0Tx = 100U, /**< SAI0 Transmit request */ - kDma0RequestMuxSai1Rx = 101U, /**< SAI1 Receive request */ - kDma1RequestMuxSai1Rx = 101U, /**< SAI1 Receive request */ - kDma0RequestMuxSai1Tx = 102U, /**< SAI1 Transmit request */ - kDma1RequestMuxSai1Tx = 102U, /**< SAI1 Transmit request */ - kDma0RequestMuxGpio0PinEventRequest0 = 108U, /**< GPIO0 Pin event request 0 */ - kDma1RequestMuxGpio0PinEventRequest0 = 108U, /**< GPIO0 Pin event request 0 */ - kDma0RequestMuxGpio0PinEventRequest1 = 109U, /**< GPIO0 Pin event request 1 */ - kDma1RequestMuxGpio0PinEventRequest1 = 109U, /**< GPIO0 Pin event request 1 */ - kDma0RequestMuxGpio1PinEventRequest0 = 110U, /**< GPIO1 Pin event request 0 */ - kDma1RequestMuxGpio1PinEventRequest0 = 110U, /**< GPIO1 Pin event request 0 */ - kDma0RequestMuxGpio1PinEventRequest1 = 111U, /**< GPIO1 Pin event request 1 */ - kDma1RequestMuxGpio1PinEventRequest1 = 111U, /**< GPIO1 Pin event request 1 */ - kDma0RequestMuxGpio2PinEventRequest0 = 112U, /**< GPIO2 Pin event request 0 */ - kDma1RequestMuxGpio2PinEventRequest0 = 112U, /**< GPIO2 Pin event request 0 */ - kDma0RequestMuxGpio2PinEventRequest1 = 113U, /**< GPIO2 Pin event request 1 */ - kDma1RequestMuxGpio2PinEventRequest1 = 113U, /**< GPIO2 Pin event request 1 */ - kDma0RequestMuxGpio3PinEventRequest0 = 114U, /**< GPIO3 Pin event request 0 */ - kDma1RequestMuxGpio3PinEventRequest0 = 114U, /**< GPIO3 Pin event request 0 */ - kDma0RequestMuxGpio3PinEventRequest1 = 115U, /**< GPIO3 Pin event request 1 */ - kDma1RequestMuxGpio3PinEventRequest1 = 115U, /**< GPIO3 Pin event request 1 */ - kDma0RequestMuxGpio4PinEventRequest0 = 116U, /**< GPIO4 Pin event request 0 */ - kDma1RequestMuxGpio4PinEventRequest0 = 116U, /**< GPIO4 Pin event request 0 */ - kDma0RequestMuxGpio4PinEventRequest1 = 117U, /**< GPIO4 Pin event request 1 */ - kDma1RequestMuxGpio4PinEventRequest1 = 117U, /**< GPIO4 Pin event request 1 */ - kDma0RequestMuxGpio5PinEventRequest0 = 118U, /**< GPIO5 Pin event request 0 */ - kDma1RequestMuxGpio5PinEventRequest0 = 118U, /**< GPIO5 Pin event request 0 */ - kDma0RequestMuxGpio5PinEventRequest1 = 119U, /**< GPIO5 Pin event request 1 */ - kDma1RequestMuxGpio5PinEventRequest1 = 119U, /**< GPIO5 Pin event request 1 */ -} dma_request_source_t; - -/* @} */ - - -/*! - * @} - */ /* end of group Mapping_Information */ - - -/* ---------------------------------------------------------------------------- - -- Device Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup Peripheral_access_layer Device Peripheral Access Layer - * @{ - */ - - -/* -** Start of section using anonymous unions -*/ - -#if defined(__ARMCC_VERSION) - #if (__ARMCC_VERSION >= 6010050) - #pragma clang diagnostic push - #else - #pragma push - #pragma anon_unions - #endif -#elif defined(__GNUC__) - /* anonymous unions are enabled by default */ -#elif defined(__IAR_SYSTEMS_ICC__) - #pragma language=extended -#else - #error Not supported compiler type -#endif - -/* ---------------------------------------------------------------------------- - -- ADC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ADC_Peripheral_Access_Layer ADC Peripheral Access Layer - * @{ - */ - -/** ADC - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID Register, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter Register, offset: 0x4 */ - uint8_t RESERVED_0[8]; - __IO uint32_t CTRL; /**< Control Register, offset: 0x10 */ - __IO uint32_t STAT; /**< Status Register, offset: 0x14 */ - __IO uint32_t IE; /**< Interrupt Enable Register, offset: 0x18 */ - __IO uint32_t DE; /**< DMA Enable Register, offset: 0x1C */ - __IO uint32_t CFG; /**< Configuration Register, offset: 0x20 */ - __IO uint32_t PAUSE; /**< Pause Register, offset: 0x24 */ - uint8_t RESERVED_1[12]; - __O uint32_t SWTRIG; /**< Software Trigger Register, offset: 0x34 */ - __IO uint32_t TSTAT; /**< Trigger Status Register, offset: 0x38 */ - uint8_t RESERVED_2[4]; - __IO uint32_t OFSTRIM; /**< Offset Trim Register, offset: 0x40 */ - uint8_t RESERVED_3[92]; - __IO uint32_t TCTRL[4]; /**< Trigger Control Register, array offset: 0xA0, array step: 0x4 */ - uint8_t RESERVED_4[48]; - __IO uint32_t FCTRL[2]; /**< FIFO Control Register, array offset: 0xE0, array step: 0x4 */ - uint8_t RESERVED_5[8]; - __I uint32_t GCC[2]; /**< Gain Calibration Control, array offset: 0xF0, array step: 0x4 */ - __IO uint32_t GCR[2]; /**< Gain Calculation Result, array offset: 0xF8, array step: 0x4 */ - struct { /* offset: 0x100, array step: 0x8 */ - __IO uint32_t CMDL; /**< Command Low Buffer Register, array offset: 0x100, array step: 0x8 */ - __IO uint32_t CMDH; /**< Command High Buffer Register, array offset: 0x104, array step: 0x8 */ - } CMD[15]; - uint8_t RESERVED_6[136]; - __IO uint32_t CV[15]; /**< Compare Value Register, array offset: 0x200, array step: 0x4 */ - uint8_t RESERVED_7[196]; - __I uint32_t RESFIFO[2]; /**< Data Result FIFO Register, array offset: 0x300, array step: 0x4 */ - uint8_t RESERVED_8[248]; - __IO uint32_t CAL_GAR0; /**< Calibration General A-Side Registers, offset: 0x400 */ - __IO uint32_t CAL_GAR1; /**< Calibration General A-Side Registers, offset: 0x404 */ - __IO uint32_t CAL_GAR2; /**< Calibration General A-Side Registers, offset: 0x408 */ - __IO uint32_t CAL_GAR3; /**< Calibration General A-Side Registers, offset: 0x40C */ - __IO uint32_t CAL_GAR4; /**< Calibration General A-Side Registers, offset: 0x410 */ - __IO uint32_t CAL_GAR5; /**< Calibration General A-Side Registers, offset: 0x414 */ - __IO uint32_t CAL_GAR6; /**< Calibration General A-Side Registers, offset: 0x418 */ - __IO uint32_t CAL_GAR7; /**< Calibration General A-Side Registers, offset: 0x41C */ - __IO uint32_t CAL_GAR8; /**< Calibration General A-Side Registers, offset: 0x420 */ - __IO uint32_t CAL_GAR9; /**< Calibration General A-Side Registers, offset: 0x424 */ - __IO uint32_t CAL_GAR10; /**< Calibration General A-Side Registers, offset: 0x428 */ - __IO uint32_t CAL_GAR11; /**< Calibration General A-Side Registers, offset: 0x42C */ - __IO uint32_t CAL_GAR12; /**< Calibration General A-Side Registers, offset: 0x430 */ - __IO uint32_t CAL_GAR13; /**< Calibration General A-Side Registers, offset: 0x434 */ - __IO uint32_t CAL_GAR14; /**< Calibration General A-Side Registers, offset: 0x438 */ - __IO uint32_t CAL_GAR15; /**< Calibration General A-Side Registers, offset: 0x43C */ - __IO uint32_t CAL_GAR16; /**< Calibration General A-Side Registers, offset: 0x440 */ - __IO uint32_t CAL_GAR17; /**< Calibration General A-Side Registers, offset: 0x444 */ - __IO uint32_t CAL_GAR18; /**< Calibration General A-Side Registers, offset: 0x448 */ - __IO uint32_t CAL_GAR19; /**< Calibration General A-Side Registers, offset: 0x44C */ - __IO uint32_t CAL_GAR20; /**< Calibration General A-Side Registers, offset: 0x450 */ - __IO uint32_t CAL_GAR21; /**< Calibration General A-Side Registers, offset: 0x454 */ - __IO uint32_t CAL_GAR22; /**< Calibration General A-Side Registers, offset: 0x458 */ - __IO uint32_t CAL_GAR23; /**< Calibration General A-Side Registers, offset: 0x45C */ - __IO uint32_t CAL_GAR24; /**< Calibration General A-Side Registers, offset: 0x460 */ - __IO uint32_t CAL_GAR25; /**< Calibration General A-Side Registers, offset: 0x464 */ - __IO uint32_t CAL_GAR26; /**< Calibration General A-Side Registers, offset: 0x468 */ - __IO uint32_t CAL_GAR27; /**< Calibration General A-Side Registers, offset: 0x46C */ - __IO uint32_t CAL_GAR28; /**< Calibration General A-Side Registers, offset: 0x470 */ - __IO uint32_t CAL_GAR29; /**< Calibration General A-Side Registers, offset: 0x474 */ - __IO uint32_t CAL_GAR30; /**< Calibration General A-Side Registers, offset: 0x478 */ - __IO uint32_t CAL_GAR31; /**< Calibration General A-Side Registers, offset: 0x47C */ - __IO uint32_t CAL_GAR32; /**< Calibration General A-Side Registers, offset: 0x480 */ - uint8_t RESERVED_9[124]; - __IO uint32_t CAL_GBR0; /**< Calibration General B-Side Registers, offset: 0x500 */ - __IO uint32_t CAL_GBR1; /**< Calibration General B-Side Registers, offset: 0x504 */ - __IO uint32_t CAL_GBR2; /**< Calibration General B-Side Registers, offset: 0x508 */ - __IO uint32_t CAL_GBR3; /**< Calibration General B-Side Registers, offset: 0x50C */ - __IO uint32_t CAL_GBR4; /**< Calibration General B-Side Registers, offset: 0x510 */ - __IO uint32_t CAL_GBR5; /**< Calibration General B-Side Registers, offset: 0x514 */ - __IO uint32_t CAL_GBR6; /**< Calibration General B-Side Registers, offset: 0x518 */ - __IO uint32_t CAL_GBR7; /**< Calibration General B-Side Registers, offset: 0x51C */ - __IO uint32_t CAL_GBR8; /**< Calibration General B-Side Registers, offset: 0x520 */ - __IO uint32_t CAL_GBR9; /**< Calibration General B-Side Registers, offset: 0x524 */ - __IO uint32_t CAL_GBR10; /**< Calibration General B-Side Registers, offset: 0x528 */ - __IO uint32_t CAL_GBR11; /**< Calibration General B-Side Registers, offset: 0x52C */ - __IO uint32_t CAL_GBR12; /**< Calibration General B-Side Registers, offset: 0x530 */ - __IO uint32_t CAL_GBR13; /**< Calibration General B-Side Registers, offset: 0x534 */ - __IO uint32_t CAL_GBR14; /**< Calibration General B-Side Registers, offset: 0x538 */ - __IO uint32_t CAL_GBR15; /**< Calibration General B-Side Registers, offset: 0x53C */ - __IO uint32_t CAL_GBR16; /**< Calibration General B-Side Registers, offset: 0x540 */ - __IO uint32_t CAL_GBR17; /**< Calibration General B-Side Registers, offset: 0x544 */ - __IO uint32_t CAL_GBR18; /**< Calibration General B-Side Registers, offset: 0x548 */ - __IO uint32_t CAL_GBR19; /**< Calibration General B-Side Registers, offset: 0x54C */ - __IO uint32_t CAL_GBR20; /**< Calibration General B-Side Registers, offset: 0x550 */ - __IO uint32_t CAL_GBR21; /**< Calibration General B-Side Registers, offset: 0x554 */ - __IO uint32_t CAL_GBR22; /**< Calibration General B-Side Registers, offset: 0x558 */ - __IO uint32_t CAL_GBR23; /**< Calibration General B-Side Registers, offset: 0x55C */ - __IO uint32_t CAL_GBR24; /**< Calibration General B-Side Registers, offset: 0x560 */ - __IO uint32_t CAL_GBR25; /**< Calibration General B-Side Registers, offset: 0x564 */ - __IO uint32_t CAL_GBR26; /**< Calibration General B-Side Registers, offset: 0x568 */ - __IO uint32_t CAL_GBR27; /**< Calibration General B-Side Registers, offset: 0x56C */ - __IO uint32_t CAL_GBR28; /**< Calibration General B-Side Registers, offset: 0x570 */ - __IO uint32_t CAL_GBR29; /**< Calibration General B-Side Registers, offset: 0x574 */ - __IO uint32_t CAL_GBR30; /**< Calibration General B-Side Registers, offset: 0x578 */ - __IO uint32_t CAL_GBR31; /**< Calibration General B-Side Registers, offset: 0x57C */ - __IO uint32_t CAL_GBR32; /**< Calibration General B-Side Registers, offset: 0x580 */ -} ADC_Type; - -/* ---------------------------------------------------------------------------- - -- ADC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ADC_Register_Masks ADC Register Masks - * @{ - */ - -/*! @name VERID - Version ID Register */ -/*! @{ */ - -#define ADC_VERID_RES_MASK (0x1U) -#define ADC_VERID_RES_SHIFT (0U) -/*! RES - Resolution - * 0b0..Up to 13-bit differential or 12-bit single-ended resolution supported. - * 0b1..Up to 16-bit differential or 16-bit single-ended resolution supported. CMDLn[MODE] available for - * selecting the resolution of conversions for the associated command. - */ -#define ADC_VERID_RES(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_RES_SHIFT)) & ADC_VERID_RES_MASK) - -#define ADC_VERID_DIFFEN_MASK (0x2U) -#define ADC_VERID_DIFFEN_SHIFT (1U) -/*! DIFFEN - Differential Supported - * 0b0..Not supported - * 0b1..Supported. CMDLn[CTYPE] controls fields implemented. - */ -#define ADC_VERID_DIFFEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_DIFFEN_SHIFT)) & ADC_VERID_DIFFEN_MASK) - -#define ADC_VERID_MVI_MASK (0x8U) -#define ADC_VERID_MVI_SHIFT (3U) -/*! MVI - Multiple Vref Implemented - * 0b0..Single VREFH input supported. - * 0b1..Multiple VREFH inputs supported. - */ -#define ADC_VERID_MVI(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_MVI_SHIFT)) & ADC_VERID_MVI_MASK) - -#define ADC_VERID_CSW_MASK (0x70U) -#define ADC_VERID_CSW_SHIFT (4U) -/*! CSW - Channel Scale Width - * 0b000..Not supported. - * 0b001..Supported with one-bit CSCALE control field. - * 0b110..Supported with six-bit CSCALE control field. - */ -#define ADC_VERID_CSW(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_CSW_SHIFT)) & ADC_VERID_CSW_MASK) - -#define ADC_VERID_VR1RNGI_MASK (0x100U) -#define ADC_VERID_VR1RNGI_SHIFT (8U) -/*! VR1RNGI - Voltage Reference 1 Range Control Bit Implemented - * 0b0..Range control not required. - * 0b1..Range control required. - */ -#define ADC_VERID_VR1RNGI(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_VR1RNGI_SHIFT)) & ADC_VERID_VR1RNGI_MASK) - -#define ADC_VERID_IADCKI_MASK (0x200U) -#define ADC_VERID_IADCKI_SHIFT (9U) -/*! IADCKI - Internal ADC Clock Implemented - * 0b0..Not implemented - * 0b1..Implemented - */ -#define ADC_VERID_IADCKI(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_IADCKI_SHIFT)) & ADC_VERID_IADCKI_MASK) - -#define ADC_VERID_CALOFSI_MASK (0x400U) -#define ADC_VERID_CALOFSI_SHIFT (10U) -/*! CALOFSI - Calibration Function Implemented - * 0b0..Not implemented - * 0b1..Implemented - */ -#define ADC_VERID_CALOFSI(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_CALOFSI_SHIFT)) & ADC_VERID_CALOFSI_MASK) - -#define ADC_VERID_NUM_SEC_MASK (0x800U) -#define ADC_VERID_NUM_SEC_SHIFT (11U) -/*! NUM_SEC - Number of Single-Ended Outputs Supported - * 0b0..One - * 0b1..Two - */ -#define ADC_VERID_NUM_SEC(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_NUM_SEC_SHIFT)) & ADC_VERID_NUM_SEC_MASK) - -#define ADC_VERID_NUM_FIFO_MASK (0x7000U) -#define ADC_VERID_NUM_FIFO_SHIFT (12U) -/*! NUM_FIFO - Number of FIFOs - * 0b000..N/A - * 0b001..One - * 0b010..Two - * 0b011..Three - * 0b100..Four - */ -#define ADC_VERID_NUM_FIFO(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_NUM_FIFO_SHIFT)) & ADC_VERID_NUM_FIFO_MASK) - -#define ADC_VERID_MINOR_MASK (0xFF0000U) -#define ADC_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define ADC_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_MINOR_SHIFT)) & ADC_VERID_MINOR_MASK) - -#define ADC_VERID_MAJOR_MASK (0xFF000000U) -#define ADC_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define ADC_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_MAJOR_SHIFT)) & ADC_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter Register */ -/*! @{ */ - -#define ADC_PARAM_TRIG_NUM_MASK (0xFFU) -#define ADC_PARAM_TRIG_NUM_SHIFT (0U) -/*! TRIG_NUM - Trigger Number */ -#define ADC_PARAM_TRIG_NUM(x) (((uint32_t)(((uint32_t)(x)) << ADC_PARAM_TRIG_NUM_SHIFT)) & ADC_PARAM_TRIG_NUM_MASK) - -#define ADC_PARAM_FIFOSIZE_MASK (0xFF00U) -#define ADC_PARAM_FIFOSIZE_SHIFT (8U) -/*! FIFOSIZE - Result FIFO Depth - * 0b00000001..2 - * 0b00000100..4 - * 0b00001000..8 - * 0b00010000..16 - * 0b00100000..32 - * 0b01000000..64 - */ -#define ADC_PARAM_FIFOSIZE(x) (((uint32_t)(((uint32_t)(x)) << ADC_PARAM_FIFOSIZE_SHIFT)) & ADC_PARAM_FIFOSIZE_MASK) - -#define ADC_PARAM_CV_NUM_MASK (0xFF0000U) -#define ADC_PARAM_CV_NUM_SHIFT (16U) -/*! CV_NUM - Compare Value Number */ -#define ADC_PARAM_CV_NUM(x) (((uint32_t)(((uint32_t)(x)) << ADC_PARAM_CV_NUM_SHIFT)) & ADC_PARAM_CV_NUM_MASK) - -#define ADC_PARAM_CMD_NUM_MASK (0xFF000000U) -#define ADC_PARAM_CMD_NUM_SHIFT (24U) -/*! CMD_NUM - Command Buffer Number */ -#define ADC_PARAM_CMD_NUM(x) (((uint32_t)(((uint32_t)(x)) << ADC_PARAM_CMD_NUM_SHIFT)) & ADC_PARAM_CMD_NUM_MASK) -/*! @} */ - -/*! @name CTRL - Control Register */ -/*! @{ */ - -#define ADC_CTRL_ADCEN_MASK (0x1U) -#define ADC_CTRL_ADCEN_SHIFT (0U) -/*! ADCEN - ADC Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_CTRL_ADCEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_ADCEN_SHIFT)) & ADC_CTRL_ADCEN_MASK) - -#define ADC_CTRL_RST_MASK (0x2U) -#define ADC_CTRL_RST_SHIFT (1U) -/*! RST - Software Reset - * 0b0..ADC logic is not reset. - * 0b1..ADC logic is reset. - */ -#define ADC_CTRL_RST(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_RST_SHIFT)) & ADC_CTRL_RST_MASK) - -#define ADC_CTRL_DOZEN_MASK (0x4U) -#define ADC_CTRL_DOZEN_SHIFT (2U) -/*! DOZEN - Doze Enable - * 0b0..ADC is enabled in low-power mode. - * 0b1..ADC is disabled in low-power mode. - */ -#define ADC_CTRL_DOZEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_DOZEN_SHIFT)) & ADC_CTRL_DOZEN_MASK) - -#define ADC_CTRL_CAL_REQ_MASK (0x8U) -#define ADC_CTRL_CAL_REQ_SHIFT (3U) -/*! CAL_REQ - Auto-Calibration Request - * 0b0..No request made. - * 0b1..Request has been made. - */ -#define ADC_CTRL_CAL_REQ(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_CAL_REQ_SHIFT)) & ADC_CTRL_CAL_REQ_MASK) - -#define ADC_CTRL_CALOFS_MASK (0x10U) -#define ADC_CTRL_CALOFS_SHIFT (4U) -/*! CALOFS - Offset Calibration Request - * 0b0..Calibration function disabled - * 0b1..Request for offset calibration function - */ -#define ADC_CTRL_CALOFS(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_CALOFS_SHIFT)) & ADC_CTRL_CALOFS_MASK) - -#define ADC_CTRL_RSTFIFO0_MASK (0x100U) -#define ADC_CTRL_RSTFIFO0_SHIFT (8U) -/*! RSTFIFO0 - Reset FIFO 0 - * 0b0..No effect. - * 0b1..FIFO 0 is reset. - */ -#define ADC_CTRL_RSTFIFO0(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_RSTFIFO0_SHIFT)) & ADC_CTRL_RSTFIFO0_MASK) - -#define ADC_CTRL_RSTFIFO1_MASK (0x200U) -#define ADC_CTRL_RSTFIFO1_SHIFT (9U) -/*! RSTFIFO1 - Reset FIFO 1 - * 0b0..No effect. - * 0b1..FIFO 1 is reset. - */ -#define ADC_CTRL_RSTFIFO1(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_RSTFIFO1_SHIFT)) & ADC_CTRL_RSTFIFO1_MASK) - -#define ADC_CTRL_CAL_AVGS_MASK (0xF0000U) -#define ADC_CTRL_CAL_AVGS_SHIFT (16U) -/*! CAL_AVGS - Auto-Calibration Averages - * 0b0000..Single conversion. - * 0b0001..2 conversions averaged. - * 0b0010..4 conversions averaged. - * 0b0011..8 conversions averaged. - * 0b0100..16 conversions averaged. - * 0b0101..32 conversions averaged. - * 0b0110..64 conversions averaged. - * 0b0111..128 conversions averaged. - * 0b1000..256 conversions averaged. - * 0b1001..512 conversions averaged. - * 0b1010..1024 conversions averaged. - */ -#define ADC_CTRL_CAL_AVGS(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_CAL_AVGS_SHIFT)) & ADC_CTRL_CAL_AVGS_MASK) -/*! @} */ - -/*! @name STAT - Status Register */ -/*! @{ */ - -#define ADC_STAT_RDY0_MASK (0x1U) -#define ADC_STAT_RDY0_SHIFT (0U) -/*! RDY0 - Result FIFO 0 Ready Flag - * 0b0..Not above watermark - * 0b1..Above watermark - */ -#define ADC_STAT_RDY0(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_RDY0_SHIFT)) & ADC_STAT_RDY0_MASK) - -#define ADC_STAT_FOF0_MASK (0x2U) -#define ADC_STAT_FOF0_SHIFT (1U) -/*! FOF0 - Result FIFO 0 Overflow Flag - * 0b0..No result FIFO 0 overflow has occurred since the last time that the flag was cleared. - * 0b1..At least one result FIFO 0 overflow has occurred since the last time that the flag was cleared. - */ -#define ADC_STAT_FOF0(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_FOF0_SHIFT)) & ADC_STAT_FOF0_MASK) - -#define ADC_STAT_RDY1_MASK (0x4U) -#define ADC_STAT_RDY1_SHIFT (2U) -/*! RDY1 - Result FIFO1 Ready Flag - * 0b0..Not above watermark - * 0b1..Above watermark - */ -#define ADC_STAT_RDY1(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_RDY1_SHIFT)) & ADC_STAT_RDY1_MASK) - -#define ADC_STAT_FOF1_MASK (0x8U) -#define ADC_STAT_FOF1_SHIFT (3U) -/*! FOF1 - Result FIFO1 Overflow Flag - * 0b0..No result FIFO1 overflow has occurred since the last time that the flag was cleared. - * 0b1..At least one result FIFO1 overflow has occurred since the last time that the flag was cleared. - */ -#define ADC_STAT_FOF1(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_FOF1_SHIFT)) & ADC_STAT_FOF1_MASK) - -#define ADC_STAT_TEXC_INT_MASK (0x100U) -#define ADC_STAT_TEXC_INT_SHIFT (8U) -/*! TEXC_INT - Interrupt Flag For High-Priority Trigger Exception - * 0b0..No trigger exceptions have occurred. - * 0b1..A trigger exception has occurred and is pending acknowledgment. - */ -#define ADC_STAT_TEXC_INT(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_TEXC_INT_SHIFT)) & ADC_STAT_TEXC_INT_MASK) - -#define ADC_STAT_TCOMP_INT_MASK (0x200U) -#define ADC_STAT_TCOMP_INT_SHIFT (9U) -/*! TCOMP_INT - Interrupt Flag For Trigger Completion - * 0b0..Either IE[TCOMP_IE] = 0, or no trigger sequences have run to completion. - * 0b1..Trigger sequence has been completed and all data is stored in the associated FIFO. - */ -#define ADC_STAT_TCOMP_INT(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_TCOMP_INT_SHIFT)) & ADC_STAT_TCOMP_INT_MASK) - -#define ADC_STAT_CAL_RDY_MASK (0x400U) -#define ADC_STAT_CAL_RDY_SHIFT (10U) -/*! CAL_RDY - Calibration Ready - * 0b0..Calibration is incomplete or has not been run. - * 0b1..ADC is calibrated. - */ -#define ADC_STAT_CAL_RDY(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_CAL_RDY_SHIFT)) & ADC_STAT_CAL_RDY_MASK) - -#define ADC_STAT_ADC_ACTIVE_MASK (0x800U) -#define ADC_STAT_ADC_ACTIVE_SHIFT (11U) -/*! ADC_ACTIVE - ADC Active - * 0b0..ADC is idle. There are no pending triggers to service and no active commands are being processed. - * 0b1..ADC is processing a conversion, running through the power-up delay, or servicing a trigger. - */ -#define ADC_STAT_ADC_ACTIVE(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_ADC_ACTIVE_SHIFT)) & ADC_STAT_ADC_ACTIVE_MASK) - -#define ADC_STAT_TRGACT_MASK (0x30000U) -#define ADC_STAT_TRGACT_SHIFT (16U) -/*! TRGACT - Trigger Active - * 0b00..Command (sequence) associated with Trigger 0 currently being executed. - * 0b01..Command (sequence) associated with Trigger 1 currently being executed. - * 0b10..Command (sequence) associated with Trigger 2 currently being executed. - * 0b11..Command (sequence) associated with Trigger 3 currently being executed. - */ -#define ADC_STAT_TRGACT(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_TRGACT_SHIFT)) & ADC_STAT_TRGACT_MASK) - -#define ADC_STAT_CMDACT_MASK (0xF000000U) -#define ADC_STAT_CMDACT_SHIFT (24U) -/*! CMDACT - Command Active - * 0b0000..No command currently in progress. - * 0b0001..Command 1 currently being executed. - * 0b0010..Command 2 currently being executed. - * 0b0011-0b1111..Associated command number currently being executed. - */ -#define ADC_STAT_CMDACT(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_CMDACT_SHIFT)) & ADC_STAT_CMDACT_MASK) -/*! @} */ - -/*! @name IE - Interrupt Enable Register */ -/*! @{ */ - -#define ADC_IE_FWMIE0_MASK (0x1U) -#define ADC_IE_FWMIE0_SHIFT (0U) -/*! FWMIE0 - FIFO 0 Watermark Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_IE_FWMIE0(x) (((uint32_t)(((uint32_t)(x)) << ADC_IE_FWMIE0_SHIFT)) & ADC_IE_FWMIE0_MASK) - -#define ADC_IE_FOFIE0_MASK (0x2U) -#define ADC_IE_FOFIE0_SHIFT (1U) -/*! FOFIE0 - Result FIFO 0 Overflow Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_IE_FOFIE0(x) (((uint32_t)(((uint32_t)(x)) << ADC_IE_FOFIE0_SHIFT)) & ADC_IE_FOFIE0_MASK) - -#define ADC_IE_FWMIE1_MASK (0x4U) -#define ADC_IE_FWMIE1_SHIFT (2U) -/*! FWMIE1 - FIFO1 Watermark Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_IE_FWMIE1(x) (((uint32_t)(((uint32_t)(x)) << ADC_IE_FWMIE1_SHIFT)) & ADC_IE_FWMIE1_MASK) - -#define ADC_IE_FOFIE1_MASK (0x8U) -#define ADC_IE_FOFIE1_SHIFT (3U) -/*! FOFIE1 - Result FIFO1 Overflow Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_IE_FOFIE1(x) (((uint32_t)(((uint32_t)(x)) << ADC_IE_FOFIE1_SHIFT)) & ADC_IE_FOFIE1_MASK) - -#define ADC_IE_TEXC_IE_MASK (0x100U) -#define ADC_IE_TEXC_IE_SHIFT (8U) -/*! TEXC_IE - Trigger Exception Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_IE_TEXC_IE(x) (((uint32_t)(((uint32_t)(x)) << ADC_IE_TEXC_IE_SHIFT)) & ADC_IE_TEXC_IE_MASK) - -#define ADC_IE_TCOMP_IE_MASK (0xF0000U) -#define ADC_IE_TCOMP_IE_SHIFT (16U) -/*! TCOMP_IE - Trigger Completion Interrupt Enable - * 0b0000..All disabled - * 0b0001..Trigger completion interrupts are enabled for trigger source 0 only. - * 0b0010..Trigger completion interrupts are enabled for trigger source 1 only. - * 0b0011-0b1110..Associated trigger completion interrupts are enabled. - * 0b1111..All enabled - */ -#define ADC_IE_TCOMP_IE(x) (((uint32_t)(((uint32_t)(x)) << ADC_IE_TCOMP_IE_SHIFT)) & ADC_IE_TCOMP_IE_MASK) -/*! @} */ - -/*! @name DE - DMA Enable Register */ -/*! @{ */ - -#define ADC_DE_FWMDE0_MASK (0x1U) -#define ADC_DE_FWMDE0_SHIFT (0U) -/*! FWMDE0 - FIFO 0 Watermark DMA Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_DE_FWMDE0(x) (((uint32_t)(((uint32_t)(x)) << ADC_DE_FWMDE0_SHIFT)) & ADC_DE_FWMDE0_MASK) - -#define ADC_DE_FWMDE1_MASK (0x2U) -#define ADC_DE_FWMDE1_SHIFT (1U) -/*! FWMDE1 - FIFO1 Watermark DMA Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_DE_FWMDE1(x) (((uint32_t)(((uint32_t)(x)) << ADC_DE_FWMDE1_SHIFT)) & ADC_DE_FWMDE1_MASK) -/*! @} */ - -/*! @name CFG - Configuration Register */ -/*! @{ */ - -#define ADC_CFG_TPRICTRL_MASK (0x3U) -#define ADC_CFG_TPRICTRL_SHIFT (0U) -/*! TPRICTRL - ADC Trigger Priority Control - * 0b00..Current conversion is aborted and the new command specified by the trigger is started. - * 0b01..Current command is stopped after completing the current conversion. If averaging is enabled, the - * averaging loop is completed. CMDHn[LOOP] is ignored and the higher-priority trigger is serviced. - * 0b10..Current command is completed (averaging, looping, compare) before servicing the higher-priority trigger. - * 0b11.. - */ -#define ADC_CFG_TPRICTRL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_TPRICTRL_SHIFT)) & ADC_CFG_TPRICTRL_MASK) - -#define ADC_CFG_PWRSEL_MASK (0x30U) -#define ADC_CFG_PWRSEL_SHIFT (4U) -/*! PWRSEL - Power Configuration Select - * 0b0x..Low power - * 0b1x..High power - */ -#define ADC_CFG_PWRSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_PWRSEL_SHIFT)) & ADC_CFG_PWRSEL_MASK) - -#define ADC_CFG_REFSEL_MASK (0xC0U) -#define ADC_CFG_REFSEL_SHIFT (6U) -/*! REFSEL - Voltage Reference Selection - * 0b00..Option 1 - * 0b01..Option 2 - * 0b10..Option 3 - * 0b11.. - */ -#define ADC_CFG_REFSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_REFSEL_SHIFT)) & ADC_CFG_REFSEL_MASK) - -#define ADC_CFG_TRES_MASK (0x100U) -#define ADC_CFG_TRES_SHIFT (8U) -/*! TRES - Trigger Resume Enable - * 0b0..Not automatically resumed or restarted - * 0b1..Automatically resumed or restarted - */ -#define ADC_CFG_TRES(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_TRES_SHIFT)) & ADC_CFG_TRES_MASK) - -#define ADC_CFG_TCMDRES_MASK (0x200U) -#define ADC_CFG_TCMDRES_SHIFT (9U) -/*! TCMDRES - Trigger Command Resume - * 0b0..Trigger sequence automatically restarted. - * 0b1..Trigger sequence resumed from the command that was executed prior to the exception. - */ -#define ADC_CFG_TCMDRES(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_TCMDRES_SHIFT)) & ADC_CFG_TCMDRES_MASK) - -#define ADC_CFG_HPT_EXDI_MASK (0x400U) -#define ADC_CFG_HPT_EXDI_SHIFT (10U) -/*! HPT_EXDI - High-Priority Trigger Exception Disable - * 0b0..Enabled - * 0b1..Disabled - */ -#define ADC_CFG_HPT_EXDI(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_HPT_EXDI_SHIFT)) & ADC_CFG_HPT_EXDI_MASK) - -#define ADC_CFG_PUDLY_MASK (0xFF0000U) -#define ADC_CFG_PUDLY_SHIFT (16U) -/*! PUDLY - Power-up Delay */ -#define ADC_CFG_PUDLY(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_PUDLY_SHIFT)) & ADC_CFG_PUDLY_MASK) - -#define ADC_CFG_PWREN_MASK (0x10000000U) -#define ADC_CFG_PWREN_SHIFT (28U) -/*! PWREN - ADC Analog Pre-Enable - * 0b0..ADC analog circuits are only enabled while conversions are active. Analog startup delays affect performance. - * 0b1..ADC analog circuits are pre-enabled and ready to execute conversions without startup delays, at the cost - * of higher DC current consumption. A single power-up delay (CFG[PUDLY]) is executed immediately once PWREN - * is set. No detected triggers begin ADC operation until the power-up delay time has passed. After this - * initial delay expires, the analog circuits remain pre-enabled, and no additional delays are executed. - */ -#define ADC_CFG_PWREN(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_PWREN_SHIFT)) & ADC_CFG_PWREN_MASK) -/*! @} */ - -/*! @name PAUSE - Pause Register */ -/*! @{ */ - -#define ADC_PAUSE_PAUSEDLY_MASK (0x1FFU) -#define ADC_PAUSE_PAUSEDLY_SHIFT (0U) -/*! PAUSEDLY - Pause Delay */ -#define ADC_PAUSE_PAUSEDLY(x) (((uint32_t)(((uint32_t)(x)) << ADC_PAUSE_PAUSEDLY_SHIFT)) & ADC_PAUSE_PAUSEDLY_MASK) - -#define ADC_PAUSE_PAUSEEN_MASK (0x80000000U) -#define ADC_PAUSE_PAUSEEN_SHIFT (31U) -/*! PAUSEEN - Pause Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_PAUSE_PAUSEEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_PAUSE_PAUSEEN_SHIFT)) & ADC_PAUSE_PAUSEEN_MASK) -/*! @} */ - -/*! @name SWTRIG - Software Trigger Register */ -/*! @{ */ - -#define ADC_SWTRIG_SWT0_MASK (0x1U) -#define ADC_SWTRIG_SWT0_SHIFT (0U) -/*! SWT0 - Software Trigger 0 - * 0b0..No trigger 0 event generated. - * 0b1..Trigger 0 event generated. - */ -#define ADC_SWTRIG_SWT0(x) (((uint32_t)(((uint32_t)(x)) << ADC_SWTRIG_SWT0_SHIFT)) & ADC_SWTRIG_SWT0_MASK) - -#define ADC_SWTRIG_SWT1_MASK (0x2U) -#define ADC_SWTRIG_SWT1_SHIFT (1U) -/*! SWT1 - Software Trigger 1 - * 0b0..No trigger 1 event generated. - * 0b1..Trigger 1 event generated. - */ -#define ADC_SWTRIG_SWT1(x) (((uint32_t)(((uint32_t)(x)) << ADC_SWTRIG_SWT1_SHIFT)) & ADC_SWTRIG_SWT1_MASK) - -#define ADC_SWTRIG_SWT2_MASK (0x4U) -#define ADC_SWTRIG_SWT2_SHIFT (2U) -/*! SWT2 - Software Trigger 2 - * 0b0..No trigger 2 event generated. - * 0b1..Trigger 2 event generated. - */ -#define ADC_SWTRIG_SWT2(x) (((uint32_t)(((uint32_t)(x)) << ADC_SWTRIG_SWT2_SHIFT)) & ADC_SWTRIG_SWT2_MASK) - -#define ADC_SWTRIG_SWT3_MASK (0x8U) -#define ADC_SWTRIG_SWT3_SHIFT (3U) -/*! SWT3 - Software Trigger 3 - * 0b0..No trigger 3 event generated. - * 0b1..Trigger 3 event generated. - */ -#define ADC_SWTRIG_SWT3(x) (((uint32_t)(((uint32_t)(x)) << ADC_SWTRIG_SWT3_SHIFT)) & ADC_SWTRIG_SWT3_MASK) -/*! @} */ - -/*! @name TSTAT - Trigger Status Register */ -/*! @{ */ - -#define ADC_TSTAT_TEXC_NUM_MASK (0xFU) -#define ADC_TSTAT_TEXC_NUM_SHIFT (0U) -/*! TEXC_NUM - Trigger Exception Number - * 0b0000..No triggers have been interrupted by a high-priority exception. - * 0b0001..Trigger 0 has been interrupted by a high-priority exception. - * 0b0010..Trigger 1 has been interrupted by a high-priority exception. - * 0b0011-0b1110..Associated trigger sequence has interrupted by a high-priority exception. - * 0b1111..Every trigger sequence has been interrupted by a high-priority exception. - */ -#define ADC_TSTAT_TEXC_NUM(x) (((uint32_t)(((uint32_t)(x)) << ADC_TSTAT_TEXC_NUM_SHIFT)) & ADC_TSTAT_TEXC_NUM_MASK) - -#define ADC_TSTAT_TCOMP_FLAG_MASK (0xF0000U) -#define ADC_TSTAT_TCOMP_FLAG_SHIFT (16U) -/*! TCOMP_FLAG - Trigger Completion Flag - * 0b0000..No triggers have been completed. Trigger completion interrupts are disabled. - * 0b0001..Trigger 0 has been completed and trigger 0 has enabled completion interrupts. - * 0b0010..Trigger 1 has been completed and trigger 1 has enabled completion interrupts. - * 0b0011-0b1110..Associated trigger sequence has completed and has enabled completion interrupts. - * 0b1111..Every trigger sequence has been completed and every trigger has enabled completion interrupts. - */ -#define ADC_TSTAT_TCOMP_FLAG(x) (((uint32_t)(((uint32_t)(x)) << ADC_TSTAT_TCOMP_FLAG_SHIFT)) & ADC_TSTAT_TCOMP_FLAG_MASK) -/*! @} */ - -/*! @name OFSTRIM - Offset Trim Register */ -/*! @{ */ - -#define ADC_OFSTRIM_OFSTRIM_A_MASK (0x1FU) -#define ADC_OFSTRIM_OFSTRIM_A_SHIFT (0U) -/*! OFSTRIM_A - Trim for Offset */ -#define ADC_OFSTRIM_OFSTRIM_A(x) (((uint32_t)(((uint32_t)(x)) << ADC_OFSTRIM_OFSTRIM_A_SHIFT)) & ADC_OFSTRIM_OFSTRIM_A_MASK) - -#define ADC_OFSTRIM_OFSTRIM_B_MASK (0x1F0000U) -#define ADC_OFSTRIM_OFSTRIM_B_SHIFT (16U) -/*! OFSTRIM_B - Trim for Offset */ -#define ADC_OFSTRIM_OFSTRIM_B(x) (((uint32_t)(((uint32_t)(x)) << ADC_OFSTRIM_OFSTRIM_B_SHIFT)) & ADC_OFSTRIM_OFSTRIM_B_MASK) -/*! @} */ - -/*! @name TCTRL - Trigger Control Register */ -/*! @{ */ - -#define ADC_TCTRL_HTEN_MASK (0x1U) -#define ADC_TCTRL_HTEN_SHIFT (0U) -/*! HTEN - Trigger Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_TCTRL_HTEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_HTEN_SHIFT)) & ADC_TCTRL_HTEN_MASK) - -#define ADC_TCTRL_FIFO_SEL_A_MASK (0x2U) -#define ADC_TCTRL_FIFO_SEL_A_SHIFT (1U) -/*! FIFO_SEL_A - SAR Result Destination for Channel A - * 0b0..FIFO 0 - * 0b1..FIFO 1 - */ -#define ADC_TCTRL_FIFO_SEL_A(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_FIFO_SEL_A_SHIFT)) & ADC_TCTRL_FIFO_SEL_A_MASK) - -#define ADC_TCTRL_FIFO_SEL_B_MASK (0x4U) -#define ADC_TCTRL_FIFO_SEL_B_SHIFT (2U) -/*! FIFO_SEL_B - SAR Result Destination for Channel B - * 0b0..FIFO 0 - * 0b1..FIFO 1 - */ -#define ADC_TCTRL_FIFO_SEL_B(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_FIFO_SEL_B_SHIFT)) & ADC_TCTRL_FIFO_SEL_B_MASK) - -#define ADC_TCTRL_TPRI_MASK (0x300U) -#define ADC_TCTRL_TPRI_SHIFT (8U) -/*! TPRI - Trigger Priority Setting - * 0b00..Highest priority, Level 1 - * 0b01-0b10..Set to corresponding priority level. - * 0b11..Lowest priority, Level 4 - */ -#define ADC_TCTRL_TPRI(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_TPRI_SHIFT)) & ADC_TCTRL_TPRI_MASK) - -#define ADC_TCTRL_RSYNC_MASK (0x8000U) -#define ADC_TCTRL_RSYNC_SHIFT (15U) -/*! RSYNC - Trigger Resync - * 0b0..Disable - * 0b1..Enable - */ -#define ADC_TCTRL_RSYNC(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_RSYNC_SHIFT)) & ADC_TCTRL_RSYNC_MASK) - -#define ADC_TCTRL_TDLY_MASK (0xF0000U) -#define ADC_TCTRL_TDLY_SHIFT (16U) -/*! TDLY - Trigger Delay Select */ -#define ADC_TCTRL_TDLY(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_TDLY_SHIFT)) & ADC_TCTRL_TDLY_MASK) - -#define ADC_TCTRL_TCMD_MASK (0xF000000U) -#define ADC_TCTRL_TCMD_SHIFT (24U) -/*! TCMD - Trigger Command Select - * 0b0000..Not a valid selection from the command buffer. Trigger event is ignored. - * 0b0001..CMD1 - * 0b0010-0b1110..Corresponding CMD is executed - * 0b1111..CMD15 - */ -#define ADC_TCTRL_TCMD(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_TCMD_SHIFT)) & ADC_TCTRL_TCMD_MASK) -/*! @} */ - -/* The count of ADC_TCTRL */ -#define ADC_TCTRL_COUNT (4U) - -/*! @name FCTRL - FIFO Control Register */ -/*! @{ */ - -#define ADC_FCTRL_FCOUNT_MASK (0x1FU) -#define ADC_FCTRL_FCOUNT_SHIFT (0U) -/*! FCOUNT - Result FIFO Counter */ -#define ADC_FCTRL_FCOUNT(x) (((uint32_t)(((uint32_t)(x)) << ADC_FCTRL_FCOUNT_SHIFT)) & ADC_FCTRL_FCOUNT_MASK) - -#define ADC_FCTRL_FWMARK_MASK (0xF0000U) -#define ADC_FCTRL_FWMARK_SHIFT (16U) -/*! FWMARK - Watermark Level Selection */ -#define ADC_FCTRL_FWMARK(x) (((uint32_t)(((uint32_t)(x)) << ADC_FCTRL_FWMARK_SHIFT)) & ADC_FCTRL_FWMARK_MASK) -/*! @} */ - -/* The count of ADC_FCTRL */ -#define ADC_FCTRL_COUNT (2U) - -/*! @name GCC - Gain Calibration Control */ -/*! @{ */ - -#define ADC_GCC_GAIN_CAL_MASK (0xFFFFU) -#define ADC_GCC_GAIN_CAL_SHIFT (0U) -/*! GAIN_CAL - Gain Calibration Value */ -#define ADC_GCC_GAIN_CAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_GCC_GAIN_CAL_SHIFT)) & ADC_GCC_GAIN_CAL_MASK) - -#define ADC_GCC_RDY_MASK (0x1000000U) -#define ADC_GCC_RDY_SHIFT (24U) -/*! RDY - Gain Calibration Value Valid - * 0b0..Invalid - * 0b1..Valid - */ -#define ADC_GCC_RDY(x) (((uint32_t)(((uint32_t)(x)) << ADC_GCC_RDY_SHIFT)) & ADC_GCC_RDY_MASK) -/*! @} */ - -/* The count of ADC_GCC */ -#define ADC_GCC_COUNT (2U) - -/*! @name GCR - Gain Calculation Result */ -/*! @{ */ - -#define ADC_GCR_GCALR_MASK (0xFFFFU) -#define ADC_GCR_GCALR_SHIFT (0U) -/*! GCALR - Gain Calculation Result */ -#define ADC_GCR_GCALR(x) (((uint32_t)(((uint32_t)(x)) << ADC_GCR_GCALR_SHIFT)) & ADC_GCR_GCALR_MASK) - -#define ADC_GCR_RDY_MASK (0x1000000U) -#define ADC_GCR_RDY_SHIFT (24U) -/*! RDY - Gain Calculation Ready - * 0b0..Invalid - * 0b1..Valid - */ -#define ADC_GCR_RDY(x) (((uint32_t)(((uint32_t)(x)) << ADC_GCR_RDY_SHIFT)) & ADC_GCR_RDY_MASK) -/*! @} */ - -/* The count of ADC_GCR */ -#define ADC_GCR_COUNT (2U) - -/*! @name CMDL - Command Low Buffer Register */ -/*! @{ */ - -#define ADC_CMDL_ADCH_MASK (0x1FU) -#define ADC_CMDL_ADCH_SHIFT (0U) -/*! ADCH - Input Channel Select - * 0b00000..CH0A or CH0B or CH0A/CH0B pair. - * 0b00001..CH1A or CH1B or CH1A/CH1B pair. - * 0b00010..CH2A or CH2B or CH2A/CH2B pair. - * 0b00011..CH3A or CH3B or CH3A/CH3B pair. - * 0b00100-0b11101..Select corresponding channel CHnA or CHnB or CHnA/CHnB pair. - * 0b11110..CH30A or CH30B or CH30A/CH30B pair. - * 0b11111..CH31A or CH31B or CH31A/CH31B pair. - */ -#define ADC_CMDL_ADCH(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDL_ADCH_SHIFT)) & ADC_CMDL_ADCH_MASK) - -#define ADC_CMDL_CTYPE_MASK (0x60U) -#define ADC_CMDL_CTYPE_SHIFT (5U) -/*! CTYPE - Conversion Type - * 0b00..Single-Ended mode. Only A-side channel is converted. - * 0b01..Single-Ended mode. Only B-side channel is converted. - * 0b10..Differential mode. A-B. - * 0b11..Dual-Single-Ended mode. Both A-side and B-side channels are converted independently. - */ -#define ADC_CMDL_CTYPE(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDL_CTYPE_SHIFT)) & ADC_CMDL_CTYPE_MASK) - -#define ADC_CMDL_MODE_MASK (0x80U) -#define ADC_CMDL_MODE_SHIFT (7U) -/*! MODE - Select Resolution of Conversions - * 0b0..Standard resolution. Single-ended 12-bit conversion; differential 13-bit conversion with 2's complement output. - * 0b1..High resolution. Single-ended 16-bit conversion; differential 16-bit conversion with 2's complement output. - */ -#define ADC_CMDL_MODE(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDL_MODE_SHIFT)) & ADC_CMDL_MODE_MASK) - -#define ADC_CMDL_ALTB_ADCH_MASK (0x1F0000U) -#define ADC_CMDL_ALTB_ADCH_SHIFT (16U) -/*! ALTB_ADCH - Alternate Channel B Input Channel Select - * 0b00000..Select CH0B - * 0b00001..Select CH1B - * 0b00010..Select CH2B - * 0b00011..Select CH3B - * 0b00100-0b11101..Select corresponding channel CHnB - * 0b11110..Select CH30B - * 0b11111..Select CH31B - */ -#define ADC_CMDL_ALTB_ADCH(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDL_ALTB_ADCH_SHIFT)) & ADC_CMDL_ALTB_ADCH_MASK) - -#define ADC_CMDL_ALTBEN_MASK (0x200000U) -#define ADC_CMDL_ALTBEN_SHIFT (21U) -/*! ALTBEN - Alternate Channel B Select Enable - * 0b0..ALTBEN_ADCH disabled. Channel-A and Channel-B inputs are selected based on ADCH settings. - * 0b1..ALTBEN_ADCH enabled. Channel-A inputs are selected by ADCH setting and Channel-B inputs are selected by ALTB_ADCH setting. - */ -#define ADC_CMDL_ALTBEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDL_ALTBEN_SHIFT)) & ADC_CMDL_ALTBEN_MASK) -/*! @} */ - -/* The count of ADC_CMDL */ -#define ADC_CMDL_COUNT (15U) - -/*! @name CMDH - Command High Buffer Register */ -/*! @{ */ - -#define ADC_CMDH_CMPEN_MASK (0x3U) -#define ADC_CMDH_CMPEN_SHIFT (0U) -/*! CMPEN - Compare Function Enable - * 0b00..Disabled - * 0b01.. - * 0b10..Enabled. Store on true. - * 0b11..Enabled. Repeat channel acquisition (sample, convert, and compare) until true. - */ -#define ADC_CMDH_CMPEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_CMPEN_SHIFT)) & ADC_CMDH_CMPEN_MASK) - -#define ADC_CMDH_WAIT_TRIG_MASK (0x4U) -#define ADC_CMDH_WAIT_TRIG_SHIFT (2U) -/*! WAIT_TRIG - Wait for Trigger Assertion Before Execution - * 0b0..Command executes automatically. - * 0b1..Active trigger must be asserted again before executing this command. - */ -#define ADC_CMDH_WAIT_TRIG(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_WAIT_TRIG_SHIFT)) & ADC_CMDH_WAIT_TRIG_MASK) - -#define ADC_CMDH_LWI_MASK (0x80U) -#define ADC_CMDH_LWI_SHIFT (7U) -/*! LWI - Loop with Increment - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_CMDH_LWI(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_LWI_SHIFT)) & ADC_CMDH_LWI_MASK) - -#define ADC_CMDH_STS_MASK (0x700U) -#define ADC_CMDH_STS_SHIFT (8U) -/*! STS - Sample Time Select - * 0b000..Minimum sample time of 3.5 ADCK cycles. - * 0b001..5.5 ADCK cycles - * 0b010..7.5 ADCK cycles - * 0b011..11.5 ADCK cycles - * 0b100..19.5 ADCK cycles - * 0b101..35.5 ADCK cycles - * 0b110..67.5 ADCK cycles - * 0b111..131.5 ADCK cycles - */ -#define ADC_CMDH_STS(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_STS_SHIFT)) & ADC_CMDH_STS_MASK) - -#define ADC_CMDH_AVGS_MASK (0xF000U) -#define ADC_CMDH_AVGS_SHIFT (12U) -/*! AVGS - Hardware Average Select - * 0b0000..Single conversion - * 0b0001..2 - * 0b0010..4 - * 0b0011..8 - * 0b0100..16 - * 0b0101..32 - * 0b0110..64 - * 0b0111..128 - * 0b1000..256 - * 0b1001..512 - * 0b1010..1024 - */ -#define ADC_CMDH_AVGS(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_AVGS_SHIFT)) & ADC_CMDH_AVGS_MASK) - -#define ADC_CMDH_LOOP_MASK (0xF0000U) -#define ADC_CMDH_LOOP_SHIFT (16U) -/*! LOOP - Loop Count Select - * 0b0000..Looping not enabled. Command executes one time. - * 0b0001..Loop one time. Command executes two times. - * 0b0010..Loop two times. Command executes three times. - * 0b0011-0b1110..Loop corresponding number of times. Command executes LOOP + 1 times. - * 0b1111..Loop 15 times. Command executes 16 times. - */ -#define ADC_CMDH_LOOP(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_LOOP_SHIFT)) & ADC_CMDH_LOOP_MASK) - -#define ADC_CMDH_NEXT_MASK (0xF000000U) -#define ADC_CMDH_NEXT_SHIFT (24U) -/*! NEXT - Next Command Select - * 0b0000..No next command defined. Terminate conversions at completion of current command. If lower priority - * trigger pending, begin command associated with lower priority trigger. - * 0b0001..CMD1 - * 0b0010-0b1110..Select corresponding CMD command buffer register as next command - * 0b1111..CMD15 - */ -#define ADC_CMDH_NEXT(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_NEXT_SHIFT)) & ADC_CMDH_NEXT_MASK) -/*! @} */ - -/* The count of ADC_CMDH */ -#define ADC_CMDH_COUNT (15U) - -/*! @name CV - Compare Value Register */ -/*! @{ */ - -#define ADC_CV_CVL_MASK (0xFFFFU) -#define ADC_CV_CVL_SHIFT (0U) -/*! CVL - Compare Value Low */ -#define ADC_CV_CVL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CV_CVL_SHIFT)) & ADC_CV_CVL_MASK) - -#define ADC_CV_CVH_MASK (0xFFFF0000U) -#define ADC_CV_CVH_SHIFT (16U) -/*! CVH - Compare Value High */ -#define ADC_CV_CVH(x) (((uint32_t)(((uint32_t)(x)) << ADC_CV_CVH_SHIFT)) & ADC_CV_CVH_MASK) -/*! @} */ - -/* The count of ADC_CV */ -#define ADC_CV_COUNT (15U) - -/*! @name RESFIFO - Data Result FIFO Register */ -/*! @{ */ - -#define ADC_RESFIFO_D_MASK (0xFFFFU) -#define ADC_RESFIFO_D_SHIFT (0U) -/*! D - Data Result */ -#define ADC_RESFIFO_D(x) (((uint32_t)(((uint32_t)(x)) << ADC_RESFIFO_D_SHIFT)) & ADC_RESFIFO_D_MASK) - -#define ADC_RESFIFO_TSRC_MASK (0x30000U) -#define ADC_RESFIFO_TSRC_SHIFT (16U) -/*! TSRC - Trigger Source - * 0b00..Trigger source 0 - * 0b01..Trigger source 1 - * 0b10..Trigger source 2 - * 0b11..Trigger source 3 - */ -#define ADC_RESFIFO_TSRC(x) (((uint32_t)(((uint32_t)(x)) << ADC_RESFIFO_TSRC_SHIFT)) & ADC_RESFIFO_TSRC_MASK) - -#define ADC_RESFIFO_LOOPCNT_MASK (0xF00000U) -#define ADC_RESFIFO_LOOPCNT_SHIFT (20U) -/*! LOOPCNT - Loop Count Value - * 0b0000..Result is from initial conversion in command. - * 0b0001..Result is from second conversion in command. - * 0b0010-0b1110..Result is from (LOOPCNT + 1) conversion in command. - * 0b1111..Result is from 16th conversion in command. - */ -#define ADC_RESFIFO_LOOPCNT(x) (((uint32_t)(((uint32_t)(x)) << ADC_RESFIFO_LOOPCNT_SHIFT)) & ADC_RESFIFO_LOOPCNT_MASK) - -#define ADC_RESFIFO_CMDSRC_MASK (0xF000000U) -#define ADC_RESFIFO_CMDSRC_SHIFT (24U) -/*! CMDSRC - Command Buffer Source - * 0b0000..Not a valid value CMDSRC value for a data word in RESFIFO. 0h is only found in the initial FIFO state, - * prior to the storage of an ADC conversion result into a RESFIFO buffer. - * 0b0001..CMD1 - * 0b0010-0b1110..Corresponding command buffer used as control settings for this conversion. - * 0b1111..CMD15 - */ -#define ADC_RESFIFO_CMDSRC(x) (((uint32_t)(((uint32_t)(x)) << ADC_RESFIFO_CMDSRC_SHIFT)) & ADC_RESFIFO_CMDSRC_MASK) - -#define ADC_RESFIFO_VALID_MASK (0x80000000U) -#define ADC_RESFIFO_VALID_SHIFT (31U) -/*! VALID - FIFO Entry is Valid - * 0b0..FIFO is empty. Discard any read from RESFIFO. - * 0b1..FIFO contains data. FIFO record read from RESFIFO is valid. - */ -#define ADC_RESFIFO_VALID(x) (((uint32_t)(((uint32_t)(x)) << ADC_RESFIFO_VALID_SHIFT)) & ADC_RESFIFO_VALID_MASK) -/*! @} */ - -/* The count of ADC_RESFIFO */ -#define ADC_RESFIFO_COUNT (2U) - -/*! @name CAL_GAR0 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR0_CAL_GAR_VAL_MASK (0x7FFU) -#define ADC_CAL_GAR0_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR0_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR0_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR0_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR1 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR1_CAL_GAR_VAL_MASK (0xFFFU) -#define ADC_CAL_GAR1_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR1_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR1_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR1_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR2 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR2_CAL_GAR_VAL_MASK (0x1FFFU) -#define ADC_CAL_GAR2_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR2_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR2_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR2_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR3 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR3_CAL_GAR_VAL_MASK (0x1FFFU) -#define ADC_CAL_GAR3_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR3_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR3_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR3_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR4 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR4_CAL_GAR_VAL_MASK (0x3FFFU) -#define ADC_CAL_GAR4_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR4_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR4_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR4_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR5 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR5_CAL_GAR_VAL_MASK (0x3FFFU) -#define ADC_CAL_GAR5_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR5_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR5_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR5_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR6 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR6_CAL_GAR_VAL_MASK (0x3FFFU) -#define ADC_CAL_GAR6_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR6_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR6_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR6_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR7 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR7_CAL_GAR_VAL_MASK (0x3FFFU) -#define ADC_CAL_GAR7_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR7_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR7_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR7_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR8 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR8_CAL_GAR_VAL_MASK (0x7FFFU) -#define ADC_CAL_GAR8_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR8_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR8_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR8_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR9 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR9_CAL_GAR_VAL_MASK (0x7FFFU) -#define ADC_CAL_GAR9_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR9_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR9_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR9_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR10 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR10_CAL_GAR_VAL_MASK (0x7FFFU) -#define ADC_CAL_GAR10_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR10_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR10_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR10_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR11 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR11_CAL_GAR_VAL_MASK (0x7FFFU) -#define ADC_CAL_GAR11_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR11_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR11_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR11_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR12 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR12_CAL_GAR_VAL_MASK (0x7FFFU) -#define ADC_CAL_GAR12_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR12_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR12_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR12_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR13 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR13_CAL_GAR_VAL_MASK (0x7FFFU) -#define ADC_CAL_GAR13_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR13_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR13_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR13_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR14 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR14_CAL_GAR_VAL_MASK (0x7FFFU) -#define ADC_CAL_GAR14_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR14_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR14_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR14_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR15 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR15_CAL_GAR_VAL_MASK (0x7FFFU) -#define ADC_CAL_GAR15_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR15_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR15_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR15_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR16 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR16_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR16_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR16_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR16_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR16_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR17 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR17_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR17_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR17_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR17_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR17_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR18 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR18_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR18_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR18_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR18_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR18_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR19 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR19_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR19_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR19_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR19_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR19_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR20 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR20_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR20_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR20_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR20_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR20_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR21 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR21_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR21_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR21_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR21_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR21_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR22 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR22_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR22_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR22_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR22_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR22_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR23 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR23_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR23_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR23_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR23_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR23_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR24 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR24_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR24_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR24_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR24_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR24_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR25 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR25_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR25_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR25_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR25_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR25_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR26 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR26_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR26_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR26_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR26_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR26_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR27 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR27_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR27_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR27_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR27_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR27_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR28 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR28_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR28_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR28_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR28_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR28_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR29 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR29_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR29_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR29_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR29_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR29_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR30 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR30_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR30_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR30_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR30_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR30_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR31 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR31_CAL_GAR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GAR31_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR31_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR31_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR31_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GAR32 - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR32_CAL_GAR_VAL_MASK (0x7FFU) -#define ADC_CAL_GAR32_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR32_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR32_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR32_CAL_GAR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR0 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR0_CAL_GBR_VAL_MASK (0x7FFU) -#define ADC_CAL_GBR0_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR0_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR0_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR0_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR1 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR1_CAL_GBR_VAL_MASK (0xFFFU) -#define ADC_CAL_GBR1_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR1_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR1_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR1_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR2 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR2_CAL_GBR_VAL_MASK (0x1FFFU) -#define ADC_CAL_GBR2_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR2_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR2_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR2_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR3 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR3_CAL_GBR_VAL_MASK (0x1FFFU) -#define ADC_CAL_GBR3_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR3_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR3_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR3_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR4 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR4_CAL_GBR_VAL_MASK (0x3FFFU) -#define ADC_CAL_GBR4_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR4_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR4_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR4_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR5 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR5_CAL_GBR_VAL_MASK (0x3FFFU) -#define ADC_CAL_GBR5_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR5_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR5_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR5_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR6 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR6_CAL_GBR_VAL_MASK (0x3FFFU) -#define ADC_CAL_GBR6_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR6_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR6_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR6_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR7 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR7_CAL_GBR_VAL_MASK (0x3FFFU) -#define ADC_CAL_GBR7_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR7_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR7_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR7_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR8 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR8_CAL_GBR_VAL_MASK (0x7FFFU) -#define ADC_CAL_GBR8_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR8_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR8_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR8_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR9 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR9_CAL_GBR_VAL_MASK (0x7FFFU) -#define ADC_CAL_GBR9_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR9_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR9_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR9_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR10 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR10_CAL_GBR_VAL_MASK (0x7FFFU) -#define ADC_CAL_GBR10_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR10_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR10_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR10_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR11 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR11_CAL_GBR_VAL_MASK (0x7FFFU) -#define ADC_CAL_GBR11_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR11_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR11_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR11_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR12 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR12_CAL_GBR_VAL_MASK (0x7FFFU) -#define ADC_CAL_GBR12_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR12_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR12_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR12_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR13 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR13_CAL_GBR_VAL_MASK (0x7FFFU) -#define ADC_CAL_GBR13_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR13_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR13_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR13_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR14 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR14_CAL_GBR_VAL_MASK (0x7FFFU) -#define ADC_CAL_GBR14_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR14_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR14_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR14_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR15 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR15_CAL_GBR_VAL_MASK (0x7FFFU) -#define ADC_CAL_GBR15_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR15_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR15_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR15_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR16 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR16_CAL_GBR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GBR16_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR16_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR16_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR16_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR17 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR17_CAL_GBR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GBR17_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR17_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR17_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR17_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR18 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR18_CAL_GBR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GBR18_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR18_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR18_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR18_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR19 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR19_CAL_GBR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GBR19_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR19_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR19_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR19_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR20 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR20_CAL_GBR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GBR20_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR20_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR20_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR20_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR21 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR21_CAL_GBR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GBR21_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR21_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR21_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR21_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR22 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR22_CAL_GBR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GBR22_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR22_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR22_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR22_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR23 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR23_CAL_GBR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GBR23_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR23_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR23_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR23_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR24 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR24_CAL_GBR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GBR24_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR24_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR24_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR24_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR25 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR25_CAL_GBR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GBR25_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR25_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR25_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR25_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR26 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR26_CAL_GBR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GBR26_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR26_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR26_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR26_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR27 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR27_CAL_GBR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GBR27_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR27_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR27_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR27_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR28 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR28_CAL_GBR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GBR28_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR28_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR28_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR28_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR29 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR29_CAL_GBR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GBR29_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR29_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR29_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR29_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR30 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR30_CAL_GBR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GBR30_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR30_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR30_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR30_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR31 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR31_CAL_GBR_VAL_MASK (0xFFFFU) -#define ADC_CAL_GBR31_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR31_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR31_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR31_CAL_GBR_VAL_MASK) -/*! @} */ - -/*! @name CAL_GBR32 - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR32_CAL_GBR_VAL_MASK (0x7FFU) -#define ADC_CAL_GBR32_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR32_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR32_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR32_CAL_GBR_VAL_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group ADC_Register_Masks */ - - -/* ADC - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral ADC0 base address */ - #define ADC0_BASE (0x5010D000u) - /** Peripheral ADC0 base address */ - #define ADC0_BASE_NS (0x4010D000u) - /** Peripheral ADC0 base pointer */ - #define ADC0 ((ADC_Type *)ADC0_BASE) - /** Peripheral ADC0 base pointer */ - #define ADC0_NS ((ADC_Type *)ADC0_BASE_NS) - /** Peripheral ADC1 base address */ - #define ADC1_BASE (0x5010E000u) - /** Peripheral ADC1 base address */ - #define ADC1_BASE_NS (0x4010E000u) - /** Peripheral ADC1 base pointer */ - #define ADC1 ((ADC_Type *)ADC1_BASE) - /** Peripheral ADC1 base pointer */ - #define ADC1_NS ((ADC_Type *)ADC1_BASE_NS) - /** Array initializer of ADC peripheral base addresses */ - #define ADC_BASE_ADDRS { ADC0_BASE, ADC1_BASE } - /** Array initializer of ADC peripheral base pointers */ - #define ADC_BASE_PTRS { ADC0, ADC1 } - /** Array initializer of ADC peripheral base addresses */ - #define ADC_BASE_ADDRS_NS { ADC0_BASE_NS, ADC1_BASE_NS } - /** Array initializer of ADC peripheral base pointers */ - #define ADC_BASE_PTRS_NS { ADC0_NS, ADC1_NS } -#else - /** Peripheral ADC0 base address */ - #define ADC0_BASE (0x4010D000u) - /** Peripheral ADC0 base pointer */ - #define ADC0 ((ADC_Type *)ADC0_BASE) - /** Peripheral ADC1 base address */ - #define ADC1_BASE (0x4010E000u) - /** Peripheral ADC1 base pointer */ - #define ADC1 ((ADC_Type *)ADC1_BASE) - /** Array initializer of ADC peripheral base addresses */ - #define ADC_BASE_ADDRS { ADC0_BASE, ADC1_BASE } - /** Array initializer of ADC peripheral base pointers */ - #define ADC_BASE_PTRS { ADC0, ADC1 } -#endif -/** Interrupt vectors for the ADC peripheral type */ -#define ADC_IRQS { ADC0_IRQn, ADC1_IRQn } - -/*! - * @} - */ /* end of group ADC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- AHBSC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup AHBSC_Peripheral_Access_Layer AHBSC Peripheral Access Layer - * @{ - */ - -/** AHBSC - Register Layout Typedef */ -typedef struct { - uint8_t RESERVED_0[16]; - __IO uint32_t FLASH00_MEM_RULE[4]; /**< Flash Memory Rule, array offset: 0x10, array step: 0x4 */ - uint8_t RESERVED_1[16]; - __IO uint32_t FLASH02_MEM_RULE; /**< Flash Memory Rule, offset: 0x30 */ - uint8_t RESERVED_2[12]; - __IO uint32_t FLASH03_MEM_RULE; /**< Flash Memory Rule, offset: 0x40 */ - uint8_t RESERVED_3[28]; - __IO uint32_t ROM_MEM_RULE[4]; /**< ROM Memory Rule, array offset: 0x60, array step: 0x4 */ - uint8_t RESERVED_4[16]; - __IO uint32_t RAMX_MEM_RULE[3]; /**< RAMX Memory Rule, array offset: 0x80, array step: 0x4 */ - uint8_t RESERVED_5[20]; - __IO uint32_t RAMA_MEM_RULE; /**< RAMA Memory Rule 0, offset: 0xA0 */ - uint8_t RESERVED_6[28]; - __IO uint32_t RAMB_MEM_RULE; /**< RAMB Memory Rule, offset: 0xC0 */ - uint8_t RESERVED_7[28]; - __IO uint32_t RAMC_MEM_RULE[2]; /**< RAMC Memory Rule, array offset: 0xE0, array step: 0x4 */ - uint8_t RESERVED_8[24]; - __IO uint32_t RAMD_MEM_RULE[2]; /**< RAMD Memory Rule, array offset: 0x100, array step: 0x4 */ - uint8_t RESERVED_9[24]; - __IO uint32_t RAME_MEM_RULE[2]; /**< RAME Memory Rule, array offset: 0x120, array step: 0x4 */ - uint8_t RESERVED_10[120]; - __IO uint32_t APB_PERIPHERAL_GROUP0_MEM_RULE0; /**< APB Bridge Group 0 Memory Rule 0, offset: 0x1A0 */ - __IO uint32_t APB_PERIPHERAL_GROUP0_MEM_RULE1; /**< APB Bridge Group 0 Memory Rule 1, offset: 0x1A4 */ - __IO uint32_t APB_PERIPHERAL_GROUP0_MEM_RULE2; /**< APB Bridge Group 0 Rule 2, offset: 0x1A8 */ - __IO uint32_t APB_PERIPHERAL_GROUP0_MEM_RULE3; /**< APB Bridge Group 0 Memory Rule 3, offset: 0x1AC */ - __IO uint32_t APB_PERIPHERAL_GROUP1_MEM_RULE0; /**< APB Bridge Group 1 Memory Rule 0, offset: 0x1B0 */ - __IO uint32_t APB_PERIPHERAL_GROUP1_MEM_RULE1; /**< APB Bridge Group 1 Memory Rule 1, offset: 0x1B4 */ - uint8_t RESERVED_11[4]; - __IO uint32_t APB_PERIPHERAL_GROUP1_MEM_RULE2; /**< APB Bridge Group 1 Memory Rule 2, offset: 0x1BC */ - __IO uint32_t AIPS_BRIDGE_GROUP0_MEM_RULE0; /**< AIPS Bridge Group 0 Memory Rule 0, offset: 0x1C0 */ - __IO uint32_t AIPS_BRIDGE_GROUP0_MEM_RULE1; /**< AIPS Bridge Group 0 Memory Rule 1, offset: 0x1C4 */ - __IO uint32_t AIPS_BRIDGE_GROUP0_MEM_RULE2; /**< AIPS Bridge Group 0 Memory Rule 2, offset: 0x1C8 */ - __IO uint32_t AIPS_BRIDGE_GROUP0_MEM_RULE3; /**< AIPS Bridge Group 0 Memory Rule 3, offset: 0x1CC */ - __IO uint32_t AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0; /**< AHB Peripheral 0 Slave Port 12 Slave Rule 0, offset: 0x1D0 */ - __IO uint32_t AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1; /**< AHB Peripheral 0 Slave Port 12 Slave Rule 1, offset: 0x1D4 */ - __IO uint32_t AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE2; /**< AHB Peripheral 0 Slave Port 12 Slave Rule 2, offset: 0x1D8 */ - uint8_t RESERVED_12[4]; - __IO uint32_t AIPS_BRIDGE_GROUP1_MEM_RULE0; /**< AIPS Bridge Group 1 Rule 0, offset: 0x1E0 */ - __IO uint32_t AIPS_BRIDGE_GROUP1_MEM_RULE1; /**< AIPS Bridge Group 1 Rule 1, offset: 0x1E4 */ - uint8_t RESERVED_13[8]; - __IO uint32_t AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0; /**< AHB Peripheral 1 Slave Port 13 Slave Rule 0, offset: 0x1F0 */ - __IO uint32_t AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1; /**< AHB Peripheral 1 Slave Port 13 Slave Rule 1, offset: 0x1F4 */ - uint32_t AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE2; /**< AHB Peripheral 1 Slave Port 13 Slave Rule 2, offset: 0x1F8 */ - uint8_t RESERVED_14[4]; - __IO uint32_t AIPS_BRIDGE_GROUP2_MEM_RULE0; /**< AIPS Bridge Group 2 Rule 0, offset: 0x200 */ - __IO uint32_t AIPS_BRIDGE_GROUP2_MEM_RULE1; /**< AIPS Bridge Group 2 Memory Rule 1, offset: 0x204 */ - uint8_t RESERVED_15[24]; - __IO uint32_t AIPS_BRIDGE_GROUP3_MEM_RULE0; /**< AIPS Bridge Group 3 Rule 0, offset: 0x220 */ - __IO uint32_t AIPS_BRIDGE_GROUP3_MEM_RULE1; /**< AIPS Bridge Group 3 Memory Rule 1, offset: 0x224 */ - __IO uint32_t AIPS_BRIDGE_GROUP3_MEM_RULE2; /**< AIPS Bridge Group 3 Rule 2, offset: 0x228 */ - __IO uint32_t AIPS_BRIDGE_GROUP3_MEM_RULE3; /**< AIPS Bridge Group 3 Rule 3, offset: 0x22C */ - uint8_t RESERVED_16[16]; - __IO uint32_t AIPS_BRIDGE_GROUP4_MEM_RULE0; /**< AIPS Bridge Group 4 Rule 0, offset: 0x240 */ - __IO uint32_t AIPS_BRIDGE_GROUP4_MEM_RULE1; /**< AIPS Bridge Group 4 Rule 1, offset: 0x244 */ - __IO uint32_t AIPS_BRIDGE_GROUP4_MEM_RULE2; /**< AIPS Bridge Group 4 Rule 2, offset: 0x248 */ - __IO uint32_t AIPS_BRIDGE_GROUP4_MEM_RULE3; /**< AIPS Bridge Group 4 Rule 3, offset: 0x24C */ - __IO uint32_t AHB_SECURE_CTRL_PERIPHERAL_RULE0; /**< AHB Secure Control Peripheral Rule 0, offset: 0x250 */ - uint8_t RESERVED_17[2988]; - __I uint32_t SEC_VIO_ADDR[32]; /**< Security Violation Address, array offset: 0xE00, array step: 0x4 */ - __I uint32_t SEC_VIO_MISC_INFO[32]; /**< Security Violation Miscellaneous Information at Address, array offset: 0xE80, array step: 0x4 */ - __IO uint32_t SEC_VIO_INFO_VALID; /**< Security Violation Info Validity for Address, offset: 0xF00 */ - uint8_t RESERVED_18[124]; - __IO uint32_t SEC_GPIO_MASK[2]; /**< GPIO Mask for Port 0..GPIO Mask for Port 1, array offset: 0xF80, array step: 0x4 */ - uint8_t RESERVED_19[72]; - __IO uint32_t MASTER_SEC_LEVEL; /**< Master Secure Level, offset: 0xFD0 */ - __IO uint32_t MASTER_SEC_ANTI_POL_REG; /**< Master Secure Level, offset: 0xFD4 */ - uint8_t RESERVED_20[20]; - __IO uint32_t CPU0_LOCK_REG; /**< Miscellaneous CPU0 Control Signals, offset: 0xFEC */ - uint8_t RESERVED_21[8]; - __IO uint32_t MISC_CTRL_DP_REG; /**< Secure Control Duplicate, offset: 0xFF8 */ - __IO uint32_t MISC_CTRL_REG; /**< Secure Control, offset: 0xFFC */ -} AHBSC_Type; - -/* ---------------------------------------------------------------------------- - -- AHBSC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup AHBSC_Register_Masks AHBSC Register Masks - * @{ - */ - -/*! @name FLASH00_MEM_RULE - Flash Memory Rule */ -/*! @{ */ - -#define AHBSC_FLASH00_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_FLASH00_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH00_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH00_MEM_RULE_RULE0_SHIFT)) & AHBSC_FLASH00_MEM_RULE_RULE0_MASK) - -#define AHBSC_FLASH00_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_FLASH00_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH00_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH00_MEM_RULE_RULE1_SHIFT)) & AHBSC_FLASH00_MEM_RULE_RULE1_MASK) - -#define AHBSC_FLASH00_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_FLASH00_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH00_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH00_MEM_RULE_RULE2_SHIFT)) & AHBSC_FLASH00_MEM_RULE_RULE2_MASK) - -#define AHBSC_FLASH00_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_FLASH00_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH00_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH00_MEM_RULE_RULE3_SHIFT)) & AHBSC_FLASH00_MEM_RULE_RULE3_MASK) - -#define AHBSC_FLASH00_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_FLASH00_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH00_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH00_MEM_RULE_RULE4_SHIFT)) & AHBSC_FLASH00_MEM_RULE_RULE4_MASK) - -#define AHBSC_FLASH00_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_FLASH00_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH00_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH00_MEM_RULE_RULE5_SHIFT)) & AHBSC_FLASH00_MEM_RULE_RULE5_MASK) - -#define AHBSC_FLASH00_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_FLASH00_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH00_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH00_MEM_RULE_RULE6_SHIFT)) & AHBSC_FLASH00_MEM_RULE_RULE6_MASK) - -#define AHBSC_FLASH00_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_FLASH00_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH00_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH00_MEM_RULE_RULE7_SHIFT)) & AHBSC_FLASH00_MEM_RULE_RULE7_MASK) -/*! @} */ - -/* The count of AHBSC_FLASH00_MEM_RULE */ -#define AHBSC_FLASH00_MEM_RULE_COUNT (4U) - -/*! @name FLASH02_MEM_RULE - Flash Memory Rule */ -/*! @{ */ - -#define AHBSC_FLASH02_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_FLASH02_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH02_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH02_MEM_RULE_RULE0_SHIFT)) & AHBSC_FLASH02_MEM_RULE_RULE0_MASK) - -#define AHBSC_FLASH02_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_FLASH02_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH02_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH02_MEM_RULE_RULE1_SHIFT)) & AHBSC_FLASH02_MEM_RULE_RULE1_MASK) - -#define AHBSC_FLASH02_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_FLASH02_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH02_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH02_MEM_RULE_RULE2_SHIFT)) & AHBSC_FLASH02_MEM_RULE_RULE2_MASK) - -#define AHBSC_FLASH02_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_FLASH02_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH02_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH02_MEM_RULE_RULE3_SHIFT)) & AHBSC_FLASH02_MEM_RULE_RULE3_MASK) -/*! @} */ - -/*! @name FLASH03_MEM_RULE - Flash Memory Rule */ -/*! @{ */ - -#define AHBSC_FLASH03_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_FLASH03_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH03_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH03_MEM_RULE_RULE0_SHIFT)) & AHBSC_FLASH03_MEM_RULE_RULE0_MASK) - -#define AHBSC_FLASH03_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_FLASH03_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH03_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH03_MEM_RULE_RULE1_SHIFT)) & AHBSC_FLASH03_MEM_RULE_RULE1_MASK) - -#define AHBSC_FLASH03_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_FLASH03_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH03_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH03_MEM_RULE_RULE2_SHIFT)) & AHBSC_FLASH03_MEM_RULE_RULE2_MASK) - -#define AHBSC_FLASH03_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_FLASH03_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH03_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH03_MEM_RULE_RULE3_SHIFT)) & AHBSC_FLASH03_MEM_RULE_RULE3_MASK) - -#define AHBSC_FLASH03_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_FLASH03_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH03_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH03_MEM_RULE_RULE4_SHIFT)) & AHBSC_FLASH03_MEM_RULE_RULE4_MASK) - -#define AHBSC_FLASH03_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_FLASH03_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH03_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH03_MEM_RULE_RULE5_SHIFT)) & AHBSC_FLASH03_MEM_RULE_RULE5_MASK) - -#define AHBSC_FLASH03_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_FLASH03_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH03_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH03_MEM_RULE_RULE6_SHIFT)) & AHBSC_FLASH03_MEM_RULE_RULE6_MASK) - -#define AHBSC_FLASH03_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_FLASH03_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH03_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH03_MEM_RULE_RULE7_SHIFT)) & AHBSC_FLASH03_MEM_RULE_RULE7_MASK) -/*! @} */ - -/*! @name ROM_MEM_RULE - ROM Memory Rule */ -/*! @{ */ - -#define AHBSC_ROM_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_ROM_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_ROM_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_ROM_MEM_RULE_RULE0_SHIFT)) & AHBSC_ROM_MEM_RULE_RULE0_MASK) - -#define AHBSC_ROM_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_ROM_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_ROM_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_ROM_MEM_RULE_RULE1_SHIFT)) & AHBSC_ROM_MEM_RULE_RULE1_MASK) - -#define AHBSC_ROM_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_ROM_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_ROM_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_ROM_MEM_RULE_RULE2_SHIFT)) & AHBSC_ROM_MEM_RULE_RULE2_MASK) - -#define AHBSC_ROM_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_ROM_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_ROM_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_ROM_MEM_RULE_RULE3_SHIFT)) & AHBSC_ROM_MEM_RULE_RULE3_MASK) - -#define AHBSC_ROM_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_ROM_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_ROM_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_ROM_MEM_RULE_RULE4_SHIFT)) & AHBSC_ROM_MEM_RULE_RULE4_MASK) - -#define AHBSC_ROM_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_ROM_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_ROM_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_ROM_MEM_RULE_RULE5_SHIFT)) & AHBSC_ROM_MEM_RULE_RULE5_MASK) - -#define AHBSC_ROM_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_ROM_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_ROM_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_ROM_MEM_RULE_RULE6_SHIFT)) & AHBSC_ROM_MEM_RULE_RULE6_MASK) - -#define AHBSC_ROM_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_ROM_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_ROM_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_ROM_MEM_RULE_RULE7_SHIFT)) & AHBSC_ROM_MEM_RULE_RULE7_MASK) -/*! @} */ - -/* The count of AHBSC_ROM_MEM_RULE */ -#define AHBSC_ROM_MEM_RULE_COUNT (4U) - -/*! @name RAMX_MEM_RULE0_RAMX_MEM_RULE - RAMX Memory Rule */ -/*! @{ */ - -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE0_SHIFT)) & AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE0_MASK) - -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE1_SHIFT)) & AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE1_MASK) - -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE2_SHIFT)) & AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE2_MASK) - -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE3_SHIFT)) & AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE3_MASK) - -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE4_SHIFT)) & AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE4_MASK) - -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE5_SHIFT)) & AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE5_MASK) - -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE6_SHIFT)) & AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE6_MASK) - -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE7_SHIFT)) & AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE7_MASK) -/*! @} */ - -/* The count of AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE */ -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_COUNT (3U) - -/*! @name RAMA_MEM_RULE - RAMA Memory Rule 0 */ -/*! @{ */ - -#define AHBSC_RAMA_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_RAMA_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMA_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMA_MEM_RULE_RULE0_SHIFT)) & AHBSC_RAMA_MEM_RULE_RULE0_MASK) - -#define AHBSC_RAMA_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_RAMA_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMA_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMA_MEM_RULE_RULE1_SHIFT)) & AHBSC_RAMA_MEM_RULE_RULE1_MASK) - -#define AHBSC_RAMA_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_RAMA_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMA_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMA_MEM_RULE_RULE2_SHIFT)) & AHBSC_RAMA_MEM_RULE_RULE2_MASK) - -#define AHBSC_RAMA_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_RAMA_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMA_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMA_MEM_RULE_RULE3_SHIFT)) & AHBSC_RAMA_MEM_RULE_RULE3_MASK) - -#define AHBSC_RAMA_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_RAMA_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMA_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMA_MEM_RULE_RULE4_SHIFT)) & AHBSC_RAMA_MEM_RULE_RULE4_MASK) - -#define AHBSC_RAMA_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_RAMA_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMA_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMA_MEM_RULE_RULE5_SHIFT)) & AHBSC_RAMA_MEM_RULE_RULE5_MASK) - -#define AHBSC_RAMA_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_RAMA_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMA_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMA_MEM_RULE_RULE6_SHIFT)) & AHBSC_RAMA_MEM_RULE_RULE6_MASK) - -#define AHBSC_RAMA_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_RAMA_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMA_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMA_MEM_RULE_RULE7_SHIFT)) & AHBSC_RAMA_MEM_RULE_RULE7_MASK) -/*! @} */ - -/*! @name RAMB_MEM_RULE - RAMB Memory Rule */ -/*! @{ */ - -#define AHBSC_RAMB_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_RAMB_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMB_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMB_MEM_RULE_RULE0_SHIFT)) & AHBSC_RAMB_MEM_RULE_RULE0_MASK) - -#define AHBSC_RAMB_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_RAMB_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMB_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMB_MEM_RULE_RULE1_SHIFT)) & AHBSC_RAMB_MEM_RULE_RULE1_MASK) - -#define AHBSC_RAMB_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_RAMB_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMB_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMB_MEM_RULE_RULE2_SHIFT)) & AHBSC_RAMB_MEM_RULE_RULE2_MASK) - -#define AHBSC_RAMB_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_RAMB_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMB_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMB_MEM_RULE_RULE3_SHIFT)) & AHBSC_RAMB_MEM_RULE_RULE3_MASK) - -#define AHBSC_RAMB_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_RAMB_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMB_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMB_MEM_RULE_RULE4_SHIFT)) & AHBSC_RAMB_MEM_RULE_RULE4_MASK) - -#define AHBSC_RAMB_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_RAMB_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMB_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMB_MEM_RULE_RULE5_SHIFT)) & AHBSC_RAMB_MEM_RULE_RULE5_MASK) - -#define AHBSC_RAMB_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_RAMB_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMB_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMB_MEM_RULE_RULE6_SHIFT)) & AHBSC_RAMB_MEM_RULE_RULE6_MASK) - -#define AHBSC_RAMB_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_RAMB_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMB_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMB_MEM_RULE_RULE7_SHIFT)) & AHBSC_RAMB_MEM_RULE_RULE7_MASK) -/*! @} */ - -/*! @name RAMC_MEM_RULE - RAMC Memory Rule */ -/*! @{ */ - -#define AHBSC_RAMC_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_RAMC_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMC_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMC_MEM_RULE_RULE0_SHIFT)) & AHBSC_RAMC_MEM_RULE_RULE0_MASK) - -#define AHBSC_RAMC_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_RAMC_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMC_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMC_MEM_RULE_RULE1_SHIFT)) & AHBSC_RAMC_MEM_RULE_RULE1_MASK) - -#define AHBSC_RAMC_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_RAMC_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMC_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMC_MEM_RULE_RULE2_SHIFT)) & AHBSC_RAMC_MEM_RULE_RULE2_MASK) - -#define AHBSC_RAMC_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_RAMC_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMC_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMC_MEM_RULE_RULE3_SHIFT)) & AHBSC_RAMC_MEM_RULE_RULE3_MASK) - -#define AHBSC_RAMC_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_RAMC_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMC_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMC_MEM_RULE_RULE4_SHIFT)) & AHBSC_RAMC_MEM_RULE_RULE4_MASK) - -#define AHBSC_RAMC_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_RAMC_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMC_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMC_MEM_RULE_RULE5_SHIFT)) & AHBSC_RAMC_MEM_RULE_RULE5_MASK) - -#define AHBSC_RAMC_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_RAMC_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMC_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMC_MEM_RULE_RULE6_SHIFT)) & AHBSC_RAMC_MEM_RULE_RULE6_MASK) - -#define AHBSC_RAMC_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_RAMC_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMC_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMC_MEM_RULE_RULE7_SHIFT)) & AHBSC_RAMC_MEM_RULE_RULE7_MASK) -/*! @} */ - -/* The count of AHBSC_RAMC_MEM_RULE */ -#define AHBSC_RAMC_MEM_RULE_COUNT (2U) - -/*! @name RAMD_MEM_RULE - RAMD Memory Rule */ -/*! @{ */ - -#define AHBSC_RAMD_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_RAMD_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMD_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMD_MEM_RULE_RULE0_SHIFT)) & AHBSC_RAMD_MEM_RULE_RULE0_MASK) - -#define AHBSC_RAMD_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_RAMD_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMD_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMD_MEM_RULE_RULE1_SHIFT)) & AHBSC_RAMD_MEM_RULE_RULE1_MASK) - -#define AHBSC_RAMD_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_RAMD_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMD_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMD_MEM_RULE_RULE2_SHIFT)) & AHBSC_RAMD_MEM_RULE_RULE2_MASK) - -#define AHBSC_RAMD_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_RAMD_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMD_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMD_MEM_RULE_RULE3_SHIFT)) & AHBSC_RAMD_MEM_RULE_RULE3_MASK) - -#define AHBSC_RAMD_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_RAMD_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMD_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMD_MEM_RULE_RULE4_SHIFT)) & AHBSC_RAMD_MEM_RULE_RULE4_MASK) - -#define AHBSC_RAMD_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_RAMD_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMD_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMD_MEM_RULE_RULE5_SHIFT)) & AHBSC_RAMD_MEM_RULE_RULE5_MASK) - -#define AHBSC_RAMD_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_RAMD_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMD_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMD_MEM_RULE_RULE6_SHIFT)) & AHBSC_RAMD_MEM_RULE_RULE6_MASK) - -#define AHBSC_RAMD_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_RAMD_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMD_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMD_MEM_RULE_RULE7_SHIFT)) & AHBSC_RAMD_MEM_RULE_RULE7_MASK) -/*! @} */ - -/* The count of AHBSC_RAMD_MEM_RULE */ -#define AHBSC_RAMD_MEM_RULE_COUNT (2U) - -/*! @name RAME_MEM_RULE - RAME Memory Rule */ -/*! @{ */ - -#define AHBSC_RAME_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_RAME_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAME_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAME_MEM_RULE_RULE0_SHIFT)) & AHBSC_RAME_MEM_RULE_RULE0_MASK) - -#define AHBSC_RAME_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_RAME_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAME_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAME_MEM_RULE_RULE1_SHIFT)) & AHBSC_RAME_MEM_RULE_RULE1_MASK) - -#define AHBSC_RAME_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_RAME_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAME_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAME_MEM_RULE_RULE2_SHIFT)) & AHBSC_RAME_MEM_RULE_RULE2_MASK) - -#define AHBSC_RAME_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_RAME_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAME_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAME_MEM_RULE_RULE3_SHIFT)) & AHBSC_RAME_MEM_RULE_RULE3_MASK) - -#define AHBSC_RAME_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_RAME_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAME_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAME_MEM_RULE_RULE4_SHIFT)) & AHBSC_RAME_MEM_RULE_RULE4_MASK) - -#define AHBSC_RAME_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_RAME_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAME_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAME_MEM_RULE_RULE5_SHIFT)) & AHBSC_RAME_MEM_RULE_RULE5_MASK) - -#define AHBSC_RAME_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_RAME_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAME_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAME_MEM_RULE_RULE6_SHIFT)) & AHBSC_RAME_MEM_RULE_RULE6_MASK) - -#define AHBSC_RAME_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_RAME_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAME_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAME_MEM_RULE_RULE7_SHIFT)) & AHBSC_RAME_MEM_RULE_RULE7_MASK) -/*! @} */ - -/* The count of AHBSC_RAME_MEM_RULE */ -#define AHBSC_RAME_MEM_RULE_COUNT (2U) - -/*! @name APB_PERIPHERAL_GROUP0_MEM_RULE0 - APB Bridge Group 0 Memory Rule 0 */ -/*! @{ */ - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_SYSCON_MASK (0x3U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_SYSCON_SHIFT (0U) -/*! SYSCON - SYSCON - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_SYSCON(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_SYSCON_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_SYSCON_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_PINT0_MASK (0x30000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_PINT0_SHIFT (16U) -/*! PINT0 - PINT0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_PINT0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_PINT0_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_PINT0_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_INPUTMUX_MASK (0x3000000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_INPUTMUX_SHIFT (24U) -/*! INPUTMUX - INPUTMUX - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_INPUTMUX(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_INPUTMUX_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_INPUTMUX_MASK) -/*! @} */ - -/*! @name APB_PERIPHERAL_GROUP0_MEM_RULE1 - APB Bridge Group 0 Memory Rule 1 */ -/*! @{ */ - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER0_MASK (0x30000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER0_SHIFT (16U) -/*! CTIMER0 - CTIMER0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER0_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER0_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER1_MASK (0x300000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER1_SHIFT (20U) -/*! CTIMER1 - CTIMER1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER1_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER1_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER2_MASK (0x3000000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER2_SHIFT (24U) -/*! CTIMER2 - CTIMER2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER2_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER2_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER3_MASK (0x30000000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER3_SHIFT (28U) -/*! CTIMER3 - CTIMER3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER3_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER3_MASK) -/*! @} */ - -/*! @name APB_PERIPHERAL_GROUP0_MEM_RULE2 - APB Bridge Group 0 Rule 2 */ -/*! @{ */ - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_CTIMER4_MASK (0x3U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_CTIMER4_SHIFT (0U) -/*! CTIMER4 - CTIMER4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_CTIMER4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_CTIMER4_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_CTIMER4_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_FREQME0_MASK (0x30U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_FREQME0_SHIFT (4U) -/*! FREQME0 - FREQME0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_FREQME0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_FREQME0_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_FREQME0_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_UTCIK0_MASK (0x300U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_UTCIK0_SHIFT (8U) -/*! UTCIK0 - UTCIK0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_UTCIK0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_UTCIK0_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_UTCIK0_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_MRT0_MASK (0x3000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_MRT0_SHIFT (12U) -/*! MRT0 - MRT0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_MRT0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_MRT0_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_MRT0_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_OSTIMER0_MASK (0x30000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_OSTIMER0_SHIFT (16U) -/*! OSTIMER0 - OSTIMER0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_OSTIMER0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_OSTIMER0_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_OSTIMER0_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_WWDT0_MASK (0x3000000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_WWDT0_SHIFT (24U) -/*! WWDT0 - WWDT0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_WWDT0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_WWDT0_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_WWDT0_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_WWDT1_MASK (0x30000000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_WWDT1_SHIFT (28U) -/*! WWDT1 - WWDT1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_WWDT1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_WWDT1_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_WWDT1_MASK) -/*! @} */ - -/*! @name APB_PERIPHERAL_GROUP0_MEM_RULE3 - APB Bridge Group 0 Memory Rule 3 */ -/*! @{ */ - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE3_CACHE64_POLSEL0_MASK (0x3000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE3_CACHE64_POLSEL0_SHIFT (12U) -/*! CACHE64_POLSEL0 - CACHE64_POLSEL0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE3_CACHE64_POLSEL0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE3_CACHE64_POLSEL0_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE3_CACHE64_POLSEL0_MASK) -/*! @} */ - -/*! @name APB_PERIPHERAL_GROUP1_MEM_RULE0 - APB Bridge Group 1 Memory Rule 0 */ -/*! @{ */ - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_I3C0_MASK (0x30U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_I3C0_SHIFT (4U) -/*! I3C0 - I3C0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_I3C0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_I3C0_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_I3C0_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_I3C1_MASK (0x300U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_I3C1_SHIFT (8U) -/*! I3C1 - I3C1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_I3C1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_I3C1_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_I3C1_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_GDET_MASK (0x300000U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_GDET_SHIFT (20U) -/*! GDET - GDET - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_GDET(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_GDET_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_GDET_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_ITRC_MASK (0x3000000U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_ITRC_SHIFT (24U) -/*! ITRC - ITRC - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_ITRC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_ITRC_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_ITRC_MASK) -/*! @} */ - -/*! @name APB_PERIPHERAL_GROUP1_MEM_RULE1 - APB Bridge Group 1 Memory Rule 1 */ -/*! @{ */ - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PKC_MASK (0x3000U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PKC_SHIFT (12U) -/*! PKC - PKC - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PKC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PKC_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PKC_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS0_MASK (0x30000U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS0_SHIFT (16U) -/*! PUF_ALIAS0 - PUF_ALIAS0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS0_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS0_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS1_MASK (0x300000U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS1_SHIFT (20U) -/*! PUF_ALIAS1 - PUF_ALIAS1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS1_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS1_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS2_MASK (0x3000000U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS2_SHIFT (24U) -/*! PUF_ALIAS2 - PUF_ALIAS2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS2_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS2_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS3_MASK (0x30000000U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS3_SHIFT (28U) -/*! PUF_ALIAS3 - PUF_ALIAS3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS3_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS3_MASK) -/*! @} */ - -/*! @name APB_PERIPHERAL_GROUP1_MEM_RULE2 - APB Bridge Group 1 Memory Rule 2 */ -/*! @{ */ - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_COOLFLUX_MASK (0x300U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_COOLFLUX_SHIFT (8U) -/*! COOLFLUX - COOLFLUX - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_COOLFLUX(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_COOLFLUX_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_COOLFLUX_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_SMARTDMA_MASK (0x3000U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_SMARTDMA_SHIFT (12U) -/*! SMARTDMA - SmartDMA - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_SMARTDMA(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_SMARTDMA_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_SMARTDMA_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_PLU_MASK (0x30000U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_PLU_SHIFT (16U) -/*! PLU - PLU - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_PLU(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_PLU_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_PLU_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP0_MEM_RULE0 - AIPS Bridge Group 0 Memory Rule 0 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_GPIO5_ALIAS0_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_GPIO5_ALIAS0_SHIFT (0U) -/*! GPIO5_ALIAS0 - GPIO5_ALIAS0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_GPIO5_ALIAS0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_GPIO5_ALIAS0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_GPIO5_ALIAS0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_GPIO5_ALIAS1_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_GPIO5_ALIAS1_SHIFT (4U) -/*! GPIO5_ALIAS1 - GPIO5_ALIAS2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_GPIO5_ALIAS1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_GPIO5_ALIAS1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_GPIO5_ALIAS1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_PORT5_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_PORT5_SHIFT (8U) -/*! PORT5 - PORT5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_PORT5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_PORT5_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_PORT5_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_FMU0_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_FMU0_SHIFT (12U) -/*! FMU0 - FMU0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_FMU0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_FMU0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_FMU0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_SCG0_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_SCG0_SHIFT (16U) -/*! SCG0 - SCG0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_SCG0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_SCG0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_SCG0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_SPC0_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_SPC0_SHIFT (20U) -/*! SPC0 - SPC0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_SPC0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_SPC0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_SPC0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_WUU0_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_WUU0_SHIFT (24U) -/*! WUU0 - WUU0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_WUU0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_WUU0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_WUU0_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP0_MEM_RULE1 - AIPS Bridge Group 0 Memory Rule 1 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_LPTMR0_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_LPTMR0_SHIFT (8U) -/*! LPTMR0 - LPTMR0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_LPTMR0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_LPTMR0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_LPTMR0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_LPTMR1_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_LPTMR1_SHIFT (12U) -/*! LPTMR1 - LPTMR1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_LPTMR1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_LPTMR1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_LPTMR1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_RTC_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_RTC_SHIFT (16U) -/*! RTC - RTC - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_RTC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_RTC_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_RTC_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_FMU_TEST_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_FMU_TEST_SHIFT (24U) -/*! FMU_TEST - FMU_TEST - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_FMU_TEST(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_FMU_TEST_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_FMU_TEST_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP0_MEM_RULE2 - AIPS Bridge Group 0 Memory Rule 2 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_TSI_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_TSI_SHIFT (0U) -/*! TSI - TSI - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_TSI(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_TSI_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_TSI_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP0_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP0_SHIFT (4U) -/*! CMP0 - CMP0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP1_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP1_SHIFT (8U) -/*! CMP1 - CMP1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP2_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP2_SHIFT (12U) -/*! CMP2 - CMP2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP2_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP2_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_SHIFT (16U) -/*! ELS - ELS - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS1_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS1_SHIFT (20U) -/*! ELS_ALIAS1 - ELS_ALIAS1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS2_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS2_SHIFT (24U) -/*! ELS_ALIAS2 - ELS_ALIAS2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS2_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS2_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS3_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS3_SHIFT (28U) -/*! ELS_ALIAS3 - ELS_ALIAS3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS3_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS3_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP0_MEM_RULE3 - AIPS Bridge Group 0 Memory Rule 3 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_DIGTMP_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_DIGTMP_SHIFT (0U) -/*! DIGTMP - DIGTMP - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_DIGTMP(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_DIGTMP_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_DIGTMP_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_VBAT_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_VBAT_SHIFT (4U) -/*! VBAT - VBAT - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_VBAT(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_VBAT_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_VBAT_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_TRNG_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_TRNG_SHIFT (8U) -/*! TRNG - TRNG - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_TRNG(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_TRNG_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_TRNG_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_EIM0_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_EIM0_SHIFT (12U) -/*! EIM0 - EIM0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_EIM0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_EIM0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_EIM0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_ERM0_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_ERM0_SHIFT (16U) -/*! ERM0 - ERM0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_ERM0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_ERM0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_ERM0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_INTM0_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_INTM0_SHIFT (20U) -/*! INTM0 - INTM0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_INTM0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_INTM0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_INTM0_MASK) -/*! @} */ - -/*! @name AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0 - AHB Peripheral 0 Slave Port 12 Slave Rule 0 */ -/*! @{ */ - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_EDMA0_CH15_MASK (0x30U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_EDMA0_CH15_SHIFT (4U) -/*! eDMA0_CH15 - eDMA0_CH15 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_EDMA0_CH15(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_EDMA0_CH15_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_EDMA0_CH15_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_SCT0_MASK (0x300U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_SCT0_SHIFT (8U) -/*! SCT0 - SCT0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_SCT0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_SCT0_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_SCT0_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM0_MASK (0x3000U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM0_SHIFT (12U) -/*! LP_FLEXCOMM0 - LP_FLEXCOMM0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM0_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM0_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM1_MASK (0x30000U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM1_SHIFT (16U) -/*! LP_FLEXCOMM1 - LP_FLEXCOMM1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM1_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM1_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM2_MASK (0x300000U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM2_SHIFT (20U) -/*! LP_FLEXCOMM2 - LP_FLEXCOMM2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM2_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM2_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM3_MASK (0x3000000U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM3_SHIFT (24U) -/*! LP_FLEXCOMM3 - LP_FLEXCOMM3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM3_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM3_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_GPIO0_ALIAS0_MASK (0x30000000U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_GPIO0_ALIAS0_SHIFT (28U) -/*! GPIO0_ALIAS0 - GPIO0_ALIAS0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_GPIO0_ALIAS0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_GPIO0_ALIAS0_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_GPIO0_ALIAS0_MASK) -/*! @} */ - -/*! @name AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1 - AHB Peripheral 0 Slave Port 12 Slave Rule 1 */ -/*! @{ */ - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO0_ALIAS1_MASK (0x3U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO0_ALIAS1_SHIFT (0U) -/*! GPIO0_ALIAS1 - GPIO0_ALIAS1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO0_ALIAS1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO0_ALIAS1_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO0_ALIAS1_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO1_ALIAS0_MASK (0x30U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO1_ALIAS0_SHIFT (4U) -/*! GPIO1_ALIAS0 - GPIO1_ALIAS0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO1_ALIAS0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO1_ALIAS0_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO1_ALIAS0_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO1_ALIAS1_MASK (0x300U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO1_ALIAS1_SHIFT (8U) -/*! GPIO1_ALIAS1 - GPIO1_ALIAS1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO1_ALIAS1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO1_ALIAS1_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO1_ALIAS1_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO2_ALIAS0_MASK (0x3000U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO2_ALIAS0_SHIFT (12U) -/*! GPIO2_ALIAS0 - GPIO2_ALIAS0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO2_ALIAS0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO2_ALIAS0_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO2_ALIAS0_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO2_ALIAS1_MASK (0x30000U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO2_ALIAS1_SHIFT (16U) -/*! GPIO2_ALIAS1 - GPIO2_ALIAS1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO2_ALIAS1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO2_ALIAS1_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO2_ALIAS1_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO3_ALIAS0_MASK (0x300000U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO3_ALIAS0_SHIFT (20U) -/*! GPIO3_ALIAS0 - GPIO3_ALIAS0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO3_ALIAS0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO3_ALIAS0_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO3_ALIAS0_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO3_ALIAS1_MASK (0x3000000U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO3_ALIAS1_SHIFT (24U) -/*! GPIO3_ALIAS1 - GPIO3_ALIAS1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO3_ALIAS1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO3_ALIAS1_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO3_ALIAS1_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO4_ALIAS0_MASK (0x30000000U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO4_ALIAS0_SHIFT (28U) -/*! GPIO4_ALIAS0 - GPIO4_ALIAS0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO4_ALIAS0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO4_ALIAS0_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO4_ALIAS0_MASK) -/*! @} */ - -/*! @name AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE2 - AHB Peripheral 0 Slave Port 12 Slave Rule 2 */ -/*! @{ */ - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE2_GPIO4_ALIAS1_MASK (0x3U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE2_GPIO4_ALIAS1_SHIFT (0U) -/*! GPIO4_ALIAS1 - GPIO4_ALIAS1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE2_GPIO4_ALIAS1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE2_GPIO4_ALIAS1_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE2_GPIO4_ALIAS1_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP1_MEM_RULE0 - AIPS Bridge Group 1 Rule 0 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_MP_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_MP_SHIFT (0U) -/*! eDMA0_MP - eDMA0_MP - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_MP(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_MP_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_MP_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH0_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH0_SHIFT (4U) -/*! eDMA0_CH0 - eDMA0_CH0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH1_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH1_SHIFT (8U) -/*! eDMA0_CH1 - eDMA0_CH1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH2_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH2_SHIFT (12U) -/*! eDMA0_CH2 - eDMA0_CH2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH2_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH2_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH3_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH3_SHIFT (16U) -/*! eDMA0_CH3 - FLEXSPI0 Registers - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH3_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH3_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH4_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH4_SHIFT (20U) -/*! eDMA0_CH4 - eDMA0_CH4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH4_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH4_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH5_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH5_SHIFT (24U) -/*! eDMA0_CH5 - eDMA0_CH5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH5_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH5_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH6_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH6_SHIFT (28U) -/*! eDMA0_CH6 - eDMA0_CH6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH6_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH6_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP1_MEM_RULE1 - AIPS Bridge Group 1 Rule 1 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH7_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH7_SHIFT (0U) -/*! eDMA0_CH7 - eDMA0_CH7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH7_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH7_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH8_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH8_SHIFT (4U) -/*! eDMA0_CH8 - eDMA0_CH8 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH8(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH8_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH8_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH9_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH9_SHIFT (8U) -/*! eDMA0_CH9 - eDMA0_CH9 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH9(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH9_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH9_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH10_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH10_SHIFT (12U) -/*! eDMA0_CH10 - eDMA0_CH10 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH10(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH10_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH10_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH11_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH11_SHIFT (16U) -/*! eDMA0_CH11 - FLEXSPI0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH11(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH11_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH11_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH12_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH12_SHIFT (20U) -/*! eDMA0_CH12 - eDMA0_CH12 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH12(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH12_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH12_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH13_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH13_SHIFT (24U) -/*! eDMA0_CH13 - eDMA0_CH13 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH13(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH13_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH13_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH14_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH14_SHIFT (28U) -/*! eDMA0_CH14 - eDMA0_CH14 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH14(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH14_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH14_MASK) -/*! @} */ - -/*! @name AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0 - AHB Peripheral 1 Slave Port 13 Slave Rule 0 */ -/*! @{ */ - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_EDMA1_CH15_MASK (0x30U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_EDMA1_CH15_SHIFT (4U) -/*! eDMA1_CH15 - eDMA1_CH15 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_EDMA1_CH15(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_EDMA1_CH15_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_EDMA1_CH15_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_SEMA42_MASK (0x300U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_SEMA42_SHIFT (8U) -/*! SEMA42 - SEMA42 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_SEMA42(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_SEMA42_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_SEMA42_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_MAILBOX_MASK (0x3000U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_MAILBOX_SHIFT (12U) -/*! MAILBOX - MAILBOX - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_MAILBOX(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_MAILBOX_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_MAILBOX_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_PKC_RAM_MASK (0x30000U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_PKC_RAM_SHIFT (16U) -/*! PKC_RAM - PKC_RAM - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_PKC_RAM(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_PKC_RAM_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_PKC_RAM_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM4_MASK (0x300000U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM4_SHIFT (20U) -/*! FLEXCOMM4 - FLEXCOMM4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM4_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM4_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM5_MASK (0x3000000U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM5_SHIFT (24U) -/*! FLEXCOMM5 - FLEXCOMM5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM5_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM5_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM6_MASK (0x30000000U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM6_SHIFT (28U) -/*! FLEXCOMM6 - FLEXCOMM6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM6_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM6_MASK) -/*! @} */ - -/*! @name AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1 - AHB Peripheral 1 Slave Port 13 Slave Rule 1 */ -/*! @{ */ - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM7_MASK (0x3U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM7_SHIFT (0U) -/*! FLEXCOMM7 - FLEXCOMM7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM7_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM7_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM8_MASK (0x30U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM8_SHIFT (4U) -/*! FLEXCOMM8 - FLEXCOMM8 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM8(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM8_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM8_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM9_MASK (0x300U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM9_SHIFT (8U) -/*! FLEXCOMM9 - FLEXCOMM9 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM9(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM9_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM9_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_USB_FS_OTG_RAM_MASK (0x3000U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_USB_FS_OTG_RAM_SHIFT (12U) -/*! USB_FS_OTG_RAM - USB FS OTG RAM - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_USB_FS_OTG_RAM(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_USB_FS_OTG_RAM_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_USB_FS_OTG_RAM_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_CDOG0_MASK (0x30000U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_CDOG0_SHIFT (16U) -/*! CDOG0 - CDOG0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_CDOG0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_CDOG0_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_CDOG0_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_CDOG1_MASK (0x300000U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_CDOG1_SHIFT (20U) -/*! CDOG1 - CDOG1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_CDOG1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_CDOG1_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_CDOG1_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_DEBUG_MAILBOX_MASK (0x3000000U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_DEBUG_MAILBOX_SHIFT (24U) -/*! DEBUG_MAILBOX - DEBUG_MAILBOX - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_DEBUG_MAILBOX(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_DEBUG_MAILBOX_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_DEBUG_MAILBOX_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_NPU_MASK (0x30000000U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_NPU_SHIFT (28U) -/*! NPU - NPU - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_NPU(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_NPU_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_NPU_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP2_MEM_RULE0 - AIPS Bridge Group 2 Rule 0 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_MP_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_MP_SHIFT (0U) -/*! eDMA1_MP - eDMA1_MP - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_MP(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_MP_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_MP_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH0_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH0_SHIFT (4U) -/*! eDMA1_CH0 - eDMA1_CH0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH1_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH1_SHIFT (8U) -/*! eDMA1_CH1 - eDMA1_CH1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH2_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH2_SHIFT (12U) -/*! eDMA1_CH2 - eDMA1_CH2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH2_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH2_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH3_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH3_SHIFT (16U) -/*! eDMA1_CH3 - eDMA1_CH3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH3_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH3_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH4_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH4_SHIFT (20U) -/*! eDMA1_CH4 - eDMA1_CH4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH4_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH4_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH5_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH5_SHIFT (24U) -/*! eDMA1_CH5 - eDMA1_CH5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH5_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH5_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH6_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH6_SHIFT (28U) -/*! eDMA1_CH6 - eDMA1_CH6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH6_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH6_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP2_MEM_RULE1 - AIPS Bridge Group 2 Memory Rule 1 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH7_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH7_SHIFT (0U) -/*! eDMA1_CH7 - eDMA1_CH7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH7_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH7_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP3_MEM_RULE0 - AIPS Bridge Group 3 Rule 0 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_EWM0_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_EWM0_SHIFT (0U) -/*! EWM0 - EWM0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_EWM0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_EWM0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_EWM0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_LPCAC_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_LPCAC_SHIFT (4U) -/*! LPCAC - LPCAC - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_LPCAC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_LPCAC_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_LPCAC_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_FLEXSPI_CMX_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_FLEXSPI_CMX_SHIFT (8U) -/*! FLEXSPI_CMX - FLEXSPI_CMX - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_FLEXSPI_CMX(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_FLEXSPI_CMX_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_FLEXSPI_CMX_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_SFA_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_SFA_SHIFT (20U) -/*! SFA - SFA - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_SFA(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_SFA_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_SFA_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_MBC_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_MBC_SHIFT (28U) -/*! MBC - MBC - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_MBC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_MBC_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_MBC_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP3_MEM_RULE1 - AIPS Bridge Group 3 Memory Rule 1 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_FLEXSPI_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_FLEXSPI_SHIFT (0U) -/*! FLEXSPI - FLEXSPI - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_FLEXSPI(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_FLEXSPI_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_FLEXSPI_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_OTPC_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_OTPC_SHIFT (4U) -/*! OTPC - OTPC - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_OTPC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_OTPC_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_OTPC_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_CRC_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_CRC_SHIFT (12U) -/*! CRC - CRC - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_CRC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_CRC_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_CRC_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_NPX_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_NPX_SHIFT (16U) -/*! NPX - NPX - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_NPX(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_NPX_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_NPX_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_PWM_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_PWM_SHIFT (24U) -/*! PWM - PWM - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_PWM(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_PWM_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_PWM_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_QDC_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_QDC_SHIFT (28U) -/*! QDC - QDC - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_QDC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_QDC_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_QDC_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP3_MEM_RULE2 - AIPS Bridge Group 3 Rule 2 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_PWM1_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_PWM1_SHIFT (0U) -/*! PWM1 - PWM1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_PWM1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_PWM1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_PWM1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_QDC1_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_QDC1_SHIFT (4U) -/*! QDC1 - QDC1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_QDC1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_QDC1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_QDC1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_EVTG_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_EVTG_SHIFT (8U) -/*! EVTG - EVTG - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_EVTG(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_EVTG_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_EVTG_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE0_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE0_SHIFT (16U) -/*! CAN0_RULE0 - CAN0 RULE0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE1_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE1_SHIFT (20U) -/*! CAN0_RULE1 - CAN0 RULE1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE2_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE2_SHIFT (24U) -/*! CAN0_RULE2 - CAN0 RULE2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE2_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE2_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE3_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE3_SHIFT (28U) -/*! CAN0_RULE3 - CAN0 RULE3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE3_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE3_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP3_MEM_RULE3 - AIPS Bridge Group 3 Rule 3 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE0_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE0_SHIFT (0U) -/*! CAN1_RULE0 - CAN1 RULE0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE1_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE1_SHIFT (4U) -/*! CAN1_RULE1 - CAN1 RULE1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE2_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE2_SHIFT (8U) -/*! CAN1_RULE2 - CAN1 RULE2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE2_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE2_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE3_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE3_SHIFT (12U) -/*! CAN1_RULE3 - CAN1 RULE3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE3_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE3_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_USBDCD_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_USBDCD_SHIFT (16U) -/*! USBDCD - USBDCD - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_USBDCD(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_USBDCD_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_USBDCD_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_USBFS_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_USBFS_SHIFT (20U) -/*! USBFS - USBFS - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_USBFS(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_USBFS_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_USBFS_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP4_MEM_RULE0 - AIPS Bridge Group 4 Rule 0 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_ENET_MASK (0xFU) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_ENET_SHIFT (0U) -/*! ENET - ENET - * 0b0000..Non-secure and non-privilege user access allowed - * 0b0001..Non-secure and privilege access allowed - * 0b0010..Secure and non-privilege user access allowed - * 0b0011..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_ENET(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_ENET_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_ENET_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_EMVSIM0_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_EMVSIM0_SHIFT (12U) -/*! EMVSIM0 - EMVSIM0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_EMVSIM0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_EMVSIM0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_EMVSIM0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_EMVSIM1_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_EMVSIM1_SHIFT (16U) -/*! EMVSIM1 - EMVSIM1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_EMVSIM1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_EMVSIM1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_EMVSIM1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_FLEXIO_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_FLEXIO_SHIFT (20U) -/*! FLEXIO - FLEXIO - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_FLEXIO(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_FLEXIO_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_FLEXIO_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_SAI0_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_SAI0_SHIFT (24U) -/*! SAI0 - SAI0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_SAI0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_SAI0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_SAI0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_SAI1_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_SAI1_SHIFT (28U) -/*! SAI1 - SAI1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_SAI1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_SAI1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_SAI1_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP4_MEM_RULE1 - AIPS Bridge Group 4 Rule 1 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_SINC0_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_SINC0_SHIFT (0U) -/*! SINC0 - SINC0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_SINC0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_SINC0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_SINC0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USDHC0_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USDHC0_SHIFT (4U) -/*! uSDHC0 - uSDHC0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USDHC0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USDHC0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USDHC0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USBHSPHY_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USBHSPHY_SHIFT (8U) -/*! USBHSPHY - USBHSPHY - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USBHSPHY(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USBHSPHY_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USBHSPHY_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USBHS_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USBHS_SHIFT (12U) -/*! USBHS - USBHS - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USBHS(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USBHS_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USBHS_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_MICD_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_MICD_SHIFT (16U) -/*! MICD - MICD - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_MICD(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_MICD_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_MICD_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_ADC0_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_ADC0_SHIFT (20U) -/*! ADC0 - ADC0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_ADC0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_ADC0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_ADC0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_ADC1_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_ADC1_SHIFT (24U) -/*! ADC1 - ADC1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_ADC1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_ADC1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_ADC1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_DAC0_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_DAC0_SHIFT (28U) -/*! DAC0 - DAC0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_DAC0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_DAC0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_DAC0_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP4_MEM_RULE2 - AIPS Bridge Group 4 Rule 2 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP0_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP0_SHIFT (0U) -/*! OPAMP0 - OPAMP0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_VREF_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_VREF_SHIFT (4U) -/*! VREF - VREF - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_VREF(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_VREF_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_VREF_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_DAC_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_DAC_SHIFT (8U) -/*! DAC - DAC - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_DAC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_DAC_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_DAC_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP1_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP1_SHIFT (12U) -/*! OPAMP1 - OPAMP1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_HPDAC0_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_HPDAC0_SHIFT (16U) -/*! HPDAC0 - HPDAC0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_HPDAC0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_HPDAC0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_HPDAC0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP2_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP2_SHIFT (20U) -/*! OPAMP2 - OPAMP2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP2_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP2_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_PORT0_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_PORT0_SHIFT (24U) -/*! PORT0 - PORT0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_PORT0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_PORT0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_PORT0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_PORT1_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_PORT1_SHIFT (28U) -/*! PORT1 - PORT1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_PORT1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_PORT1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_PORT1_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP4_MEM_RULE3 - AIPS Bridge Group 4 Rule 3 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT2_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT2_SHIFT (0U) -/*! PORT2 - PORT2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT2_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT2_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT3_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT3_SHIFT (4U) -/*! PORT3 - PORT3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT3_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT3_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT4_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT4_SHIFT (8U) -/*! PORT4 - PORT4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT4_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT4_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_MTR0_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_MTR0_SHIFT (24U) -/*! MTR0 - MTR0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_MTR0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_MTR0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_MTR0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_ATX0_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_ATX0_SHIFT (28U) -/*! ATX0 - ATX0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_ATX0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_ATX0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_ATX0_MASK) -/*! @} */ - -/*! @name AHB_SECURE_CTRL_PERIPHERAL_RULE0 - AHB Secure Control Peripheral Rule 0 */ -/*! @{ */ - -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE0_MASK (0x3U) -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE0_SHIFT)) & AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE0_MASK) - -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE1_MASK (0x30U) -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE1_SHIFT)) & AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE1_MASK) - -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE2_MASK (0x300U) -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE2_SHIFT)) & AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE2_MASK) - -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE3_MASK (0x3000U) -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE3_SHIFT)) & AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE3_MASK) -/*! @} */ - -/*! @name SEC_VIO_ADDRN_SEC_VIO_ADDR - Security Violation Address */ -/*! @{ */ - -#define AHBSC_SEC_VIO_ADDRN_SEC_VIO_ADDR_SEC_VIO_ADDR_MASK (0xFFFFFFFFU) -#define AHBSC_SEC_VIO_ADDRN_SEC_VIO_ADDR_SEC_VIO_ADDR_SHIFT (0U) -/*! SEC_VIO_ADDR - Security violation address for AHB layer a reset value 0 */ -#define AHBSC_SEC_VIO_ADDRN_SEC_VIO_ADDR_SEC_VIO_ADDR(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_ADDRN_SEC_VIO_ADDR_SEC_VIO_ADDR_SHIFT)) & AHBSC_SEC_VIO_ADDRN_SEC_VIO_ADDR_SEC_VIO_ADDR_MASK) -/*! @} */ - -/* The count of AHBSC_SEC_VIO_ADDRN_SEC_VIO_ADDR */ -#define AHBSC_SEC_VIO_ADDRN_SEC_VIO_ADDR_COUNT (32U) - -/*! @name SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO - Security Violation Miscellaneous Information at Address */ -/*! @{ */ - -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_WRITE_MASK (0x1U) -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_WRITE_SHIFT (0U) -/*! SEC_VIO_INFO_WRITE - Security violation access read/write indicator - * 0b0..Read access - * 0b1..Write access - */ -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_WRITE(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_WRITE_SHIFT)) & AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_WRITE_MASK) - -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_DATA_ACCESS_MASK (0x2U) -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_DATA_ACCESS_SHIFT (1U) -/*! SEC_VIO_INFO_DATA_ACCESS - Security Violation Info Data Access - * 0b0..Code - * 0b1..Data - */ -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_DATA_ACCESS(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_DATA_ACCESS_SHIFT)) & AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_DATA_ACCESS_MASK) - -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_MASTER_SEC_LEVEL_MASK (0xF0U) -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_MASTER_SEC_LEVEL_SHIFT (4U) -/*! SEC_VIO_INFO_MASTER_SEC_LEVEL - Security Violation Info Master Security Level */ -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_MASTER_SEC_LEVEL(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_MASTER_SEC_LEVEL_SHIFT)) & AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_MASTER_SEC_LEVEL_MASK) - -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_MASTER_MASK (0x1F00U) -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_MASTER_SHIFT (8U) -/*! SEC_VIO_INFO_MASTER - Security violation master number - * 0b00000..M33 Code - * 0b00001..M33 System - * 0b00011..SMARTDMA Instruction - * 0b00101..SMARTDMA Data - * 0b00110..eDMA0 - * 0b00111..eDMA1 - * 0b01000..PKC - * 0b01001..ELS S50 - * 0b01010..PKC M0 - * 0b01011..NPU Operands - * 0b01100..DSP Instruction - * 0b01101..DSPX - * 0b01110..DSPY - * 0b10000..NPU Data - * 0b10010..Ethernet - * 0b10011..USB HS - */ -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_MASTER(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_MASTER_SHIFT)) & AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_MASTER_MASK) -/*! @} */ - -/* The count of AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO */ -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_COUNT (32U) - -/*! @name SEC_VIO_INFO_VALID - Security Violation Info Validity for Address */ -/*! @{ */ - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID0_MASK (0x1U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID0_SHIFT (0U) -/*! VIO_INFO_VALID0 - Violation information valid flag for AHB port 0 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID0_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID0_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID1_MASK (0x2U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID1_SHIFT (1U) -/*! VIO_INFO_VALID1 - Violation information valid flag for AHB port 1 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID1_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID1_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID2_MASK (0x4U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID2_SHIFT (2U) -/*! VIO_INFO_VALID2 - Violation information valid flag for AHB port 2 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID2_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID2_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID3_MASK (0x8U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID3_SHIFT (3U) -/*! VIO_INFO_VALID3 - Violation information valid flag for AHB port 3 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID3_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID3_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID4_MASK (0x10U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID4_SHIFT (4U) -/*! VIO_INFO_VALID4 - Violation information valid flag for AHB port 4 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID4_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID4_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID5_MASK (0x20U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID5_SHIFT (5U) -/*! VIO_INFO_VALID5 - Violation information valid flag for AHB port 5 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID5_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID5_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID6_MASK (0x40U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID6_SHIFT (6U) -/*! VIO_INFO_VALID6 - Violation information valid flag for AHB port 6 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID6_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID6_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID7_MASK (0x80U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID7_SHIFT (7U) -/*! VIO_INFO_VALID7 - Violation information valid flag for AHB port 7 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID7_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID7_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID8_MASK (0x100U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID8_SHIFT (8U) -/*! VIO_INFO_VALID8 - Violation information valid flag for AHB port 8 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID8(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID8_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID8_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID9_MASK (0x200U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID9_SHIFT (9U) -/*! VIO_INFO_VALID9 - Violation information valid flag for AHB port 9 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID9(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID9_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID9_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID10_MASK (0x400U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID10_SHIFT (10U) -/*! VIO_INFO_VALID10 - Violation information valid flag for AHB port 10 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID10(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID10_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID10_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID11_MASK (0x800U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID11_SHIFT (11U) -/*! VIO_INFO_VALID11 - Violation information valid flag for AHB port 11 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID11(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID11_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID11_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID12_MASK (0x1000U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID12_SHIFT (12U) -/*! VIO_INFO_VALID12 - Violation information valid flag for AHB port 12 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID12(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID12_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID12_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID13_MASK (0x2000U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID13_SHIFT (13U) -/*! VIO_INFO_VALID13 - Violation information valid flag for AHB port 13 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID13(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID13_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID13_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID14_MASK (0x4000U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID14_SHIFT (14U) -/*! VIO_INFO_VALID14 - Violation information valid flag for AHB port 14 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID14(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID14_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID14_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID15_MASK (0x8000U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID15_SHIFT (15U) -/*! VIO_INFO_VALID15 - Violation information valid flag for AHB port 15 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID15(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID15_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID15_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID16_MASK (0x10000U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID16_SHIFT (16U) -/*! VIO_INFO_VALID16 - Violation information valid flag for AHB port 16 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID16(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID16_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID16_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID17_MASK (0x20000U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID17_SHIFT (17U) -/*! VIO_INFO_VALID17 - Violation information valid flag for AHB port 17 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID17(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID17_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID17_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID18_MASK (0x40000U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID18_SHIFT (18U) -/*! VIO_INFO_VALID18 - Violation information valid flag for AHB port 18 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID18(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID18_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID18_MASK) -/*! @} */ - -/*! @name SEC_GPIO_MASKN_SEC_GPIO_MASK - GPIO Mask for Port 0..GPIO Mask for Port 1 */ -/*! @{ */ - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN0_SEC_MASK_MASK (0x1U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN0_SEC_MASK_SHIFT (0U) -/*! PIO0_PIN0_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN0_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN0_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN0_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN0_SEC_MASK_MASK (0x1U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN0_SEC_MASK_SHIFT (0U) -/*! PIO1_PIN0_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN0_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN0_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN0_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN1_SEC_MASK_MASK (0x2U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN1_SEC_MASK_SHIFT (1U) -/*! PIO0_PIN1_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN1_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN1_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN1_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN1_SEC_MASK_MASK (0x2U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN1_SEC_MASK_SHIFT (1U) -/*! PIO1_PIN1_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN1_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN1_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN1_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN2_SEC_MASK_MASK (0x4U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN2_SEC_MASK_SHIFT (2U) -/*! PIO0_PIN2_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN2_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN2_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN2_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN2_SEC_MASK_MASK (0x4U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN2_SEC_MASK_SHIFT (2U) -/*! PIO1_PIN2_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN2_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN2_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN2_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN3_SEC_MASK_MASK (0x8U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN3_SEC_MASK_SHIFT (3U) -/*! PIO0_PIN3_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN3_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN3_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN3_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN3_SEC_MASK_MASK (0x8U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN3_SEC_MASK_SHIFT (3U) -/*! PIO1_PIN3_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN3_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN3_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN3_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN4_SEC_MASK_MASK (0x10U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN4_SEC_MASK_SHIFT (4U) -/*! PIO0_PIN4_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN4_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN4_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN4_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN4_SEC_MASK_MASK (0x10U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN4_SEC_MASK_SHIFT (4U) -/*! PIO1_PIN4_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN4_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN4_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN4_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN5_SEC_MASK_MASK (0x20U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN5_SEC_MASK_SHIFT (5U) -/*! PIO0_PIN5_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN5_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN5_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN5_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN5_SEC_MASK_MASK (0x20U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN5_SEC_MASK_SHIFT (5U) -/*! PIO1_PIN5_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN5_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN5_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN5_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN6_SEC_MASK_MASK (0x40U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN6_SEC_MASK_SHIFT (6U) -/*! PIO0_PIN6_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN6_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN6_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN6_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN6_SEC_MASK_MASK (0x40U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN6_SEC_MASK_SHIFT (6U) -/*! PIO1_PIN6_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN6_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN6_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN6_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN7_SEC_MASK_MASK (0x80U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN7_SEC_MASK_SHIFT (7U) -/*! PIO0_PIN7_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN7_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN7_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN7_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN7_SEC_MASK_MASK (0x80U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN7_SEC_MASK_SHIFT (7U) -/*! PIO1_PIN7_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN7_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN7_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN7_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN8_SEC_MASK_MASK (0x100U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN8_SEC_MASK_SHIFT (8U) -/*! PIO0_PIN8_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN8_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN8_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN8_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN8_SEC_MASK_MASK (0x100U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN8_SEC_MASK_SHIFT (8U) -/*! PIO1_PIN8_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN8_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN8_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN8_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN9_SEC_MASK_MASK (0x200U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN9_SEC_MASK_SHIFT (9U) -/*! PIO0_PIN9_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN9_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN9_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN9_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN9_SEC_MASK_MASK (0x200U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN9_SEC_MASK_SHIFT (9U) -/*! PIO1_PIN9_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN9_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN9_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN9_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN10_SEC_MASK_MASK (0x400U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN10_SEC_MASK_SHIFT (10U) -/*! PIO0_PIN10_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN10_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN10_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN10_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN10_SEC_MASK_MASK (0x400U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN10_SEC_MASK_SHIFT (10U) -/*! PIO1_PIN10_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN10_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN10_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN10_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN11_SEC_MASK_MASK (0x800U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN11_SEC_MASK_SHIFT (11U) -/*! PIO0_PIN11_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN11_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN11_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN11_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN11_SEC_MASK_MASK (0x800U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN11_SEC_MASK_SHIFT (11U) -/*! PIO1_PIN11_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN11_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN11_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN11_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN12_SEC_MASK_MASK (0x1000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN12_SEC_MASK_SHIFT (12U) -/*! PIO0_PIN12_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN12_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN12_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN12_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN12_SEC_MASK_MASK (0x1000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN12_SEC_MASK_SHIFT (12U) -/*! PIO1_PIN12_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN12_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN12_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN12_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN13_SEC_MASK_MASK (0x2000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN13_SEC_MASK_SHIFT (13U) -/*! PIO0_PIN13_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN13_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN13_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN13_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN13_SEC_MASK_MASK (0x2000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN13_SEC_MASK_SHIFT (13U) -/*! PIO1_PIN13_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN13_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN13_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN13_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN14_SEC_MASK_MASK (0x4000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN14_SEC_MASK_SHIFT (14U) -/*! PIO0_PIN14_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN14_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN14_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN14_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN14_SEC_MASK_MASK (0x4000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN14_SEC_MASK_SHIFT (14U) -/*! PIO1_PIN14_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN14_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN14_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN14_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN15_SEC_MASK_MASK (0x8000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN15_SEC_MASK_SHIFT (15U) -/*! PIO0_PIN15_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN15_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN15_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN15_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN15_SEC_MASK_MASK (0x8000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN15_SEC_MASK_SHIFT (15U) -/*! PIO1_PIN15_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN15_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN15_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN15_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN16_SEC_MASK_MASK (0x10000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN16_SEC_MASK_SHIFT (16U) -/*! PIO0_PIN16_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN16_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN16_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN16_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN16_SEC_MASK_MASK (0x10000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN16_SEC_MASK_SHIFT (16U) -/*! PIO1_PIN16_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN16_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN16_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN16_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN17_SEC_MASK_MASK (0x20000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN17_SEC_MASK_SHIFT (17U) -/*! PIO0_PIN17_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN17_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN17_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN17_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN17_SEC_MASK_MASK (0x20000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN17_SEC_MASK_SHIFT (17U) -/*! PIO1_PIN17_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN17_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN17_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN17_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN18_SEC_MASK_MASK (0x40000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN18_SEC_MASK_SHIFT (18U) -/*! PIO0_PIN18_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN18_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN18_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN18_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN18_SEC_MASK_MASK (0x40000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN18_SEC_MASK_SHIFT (18U) -/*! PIO1_PIN18_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN18_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN18_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN18_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN19_SEC_MASK_MASK (0x80000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN19_SEC_MASK_SHIFT (19U) -/*! PIO0_PIN19_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN19_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN19_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN19_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN19_SEC_MASK_MASK (0x80000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN19_SEC_MASK_SHIFT (19U) -/*! PIO1_PIN19_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN19_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN19_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN19_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN20_SEC_MASK_MASK (0x100000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN20_SEC_MASK_SHIFT (20U) -/*! PIO0_PIN20_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN20_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN20_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN20_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN20_SEC_MASK_MASK (0x100000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN20_SEC_MASK_SHIFT (20U) -/*! PIO1_PIN20_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN20_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN20_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN20_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN21_SEC_MASK_MASK (0x200000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN21_SEC_MASK_SHIFT (21U) -/*! PIO0_PIN21_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN21_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN21_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN21_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN21_SEC_MASK_MASK (0x200000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN21_SEC_MASK_SHIFT (21U) -/*! PIO1_PIN21_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN21_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN21_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN21_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN22_SEC_MASK_MASK (0x400000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN22_SEC_MASK_SHIFT (22U) -/*! PIO0_PIN22_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN22_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN22_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN22_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN22_SEC_MASK_MASK (0x400000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN22_SEC_MASK_SHIFT (22U) -/*! PIO1_PIN22_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN22_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN22_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN22_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN23_SEC_MASK_MASK (0x800000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN23_SEC_MASK_SHIFT (23U) -/*! PIO0_PIN23_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN23_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN23_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN23_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN23_SEC_MASK_MASK (0x800000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN23_SEC_MASK_SHIFT (23U) -/*! PIO1_PIN23_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN23_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN23_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN23_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN24_SEC_MASK_MASK (0x1000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN24_SEC_MASK_SHIFT (24U) -/*! PIO0_PIN24_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN24_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN24_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN24_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN24_SEC_MASK_MASK (0x1000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN24_SEC_MASK_SHIFT (24U) -/*! PIO1_PIN24_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN24_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN24_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN24_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN25_SEC_MASK_MASK (0x2000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN25_SEC_MASK_SHIFT (25U) -/*! PIO0_PIN25_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN25_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN25_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN25_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN25_SEC_MASK_MASK (0x2000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN25_SEC_MASK_SHIFT (25U) -/*! PIO1_PIN25_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN25_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN25_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN25_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN26_SEC_MASK_MASK (0x4000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN26_SEC_MASK_SHIFT (26U) -/*! PIO0_PIN26_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN26_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN26_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN26_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN26_SEC_MASK_MASK (0x4000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN26_SEC_MASK_SHIFT (26U) -/*! PIO1_PIN26_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN26_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN26_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN26_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN27_SEC_MASK_MASK (0x8000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN27_SEC_MASK_SHIFT (27U) -/*! PIO0_PIN27_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN27_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN27_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN27_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN27_SEC_MASK_MASK (0x8000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN27_SEC_MASK_SHIFT (27U) -/*! PIO1_PIN27_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN27_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN27_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN27_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN28_SEC_MASK_MASK (0x10000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN28_SEC_MASK_SHIFT (28U) -/*! PIO0_PIN28_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN28_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN28_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN28_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN28_SEC_MASK_MASK (0x10000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN28_SEC_MASK_SHIFT (28U) -/*! PIO1_PIN28_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN28_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN28_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN28_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN29_SEC_MASK_MASK (0x20000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN29_SEC_MASK_SHIFT (29U) -/*! PIO0_PIN29_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN29_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN29_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN29_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN29_SEC_MASK_MASK (0x20000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN29_SEC_MASK_SHIFT (29U) -/*! PIO1_PIN29_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN29_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN29_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN29_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN30_SEC_MASK_MASK (0x40000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN30_SEC_MASK_SHIFT (30U) -/*! PIO0_PIN30_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN30_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN30_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN30_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN30_SEC_MASK_MASK (0x40000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN30_SEC_MASK_SHIFT (30U) -/*! PIO1_PIN30_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN30_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN30_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN30_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN31_SEC_MASK_MASK (0x80000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN31_SEC_MASK_SHIFT (31U) -/*! PIO0_PIN31_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN31_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN31_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN31_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN31_SEC_MASK_MASK (0x80000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN31_SEC_MASK_SHIFT (31U) -/*! PIO1_PIN31_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN31_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN31_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN31_SEC_MASK_MASK) -/*! @} */ - -/* The count of AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_COUNT (2U) - -/*! @name MASTER_SEC_LEVEL - Master Secure Level */ -/*! @{ */ - -#define AHBSC_MASTER_SEC_LEVEL_SMARTDMA_MASK (0x30U) -#define AHBSC_MASTER_SEC_LEVEL_SMARTDMA_SHIFT (4U) -/*! SMARTDMA - SMARTDMA Data - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define AHBSC_MASTER_SEC_LEVEL_SMARTDMA(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_SMARTDMA_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_SMARTDMA_MASK) - -#define AHBSC_MASTER_SEC_LEVEL_EDMA0_MASK (0xC0U) -#define AHBSC_MASTER_SEC_LEVEL_EDMA0_SHIFT (6U) -/*! eDMA0 - eDMA0 - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define AHBSC_MASTER_SEC_LEVEL_EDMA0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_EDMA0_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_EDMA0_MASK) - -#define AHBSC_MASTER_SEC_LEVEL_EDMA1_MASK (0x300U) -#define AHBSC_MASTER_SEC_LEVEL_EDMA1_SHIFT (8U) -/*! eDMA1 - eDMA1 - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define AHBSC_MASTER_SEC_LEVEL_EDMA1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_EDMA1_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_EDMA1_MASK) - -#define AHBSC_MASTER_SEC_LEVEL_PKC_MASK (0xC00U) -#define AHBSC_MASTER_SEC_LEVEL_PKC_SHIFT (10U) -/*! PKC - PKC - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define AHBSC_MASTER_SEC_LEVEL_PKC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_PKC_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_PKC_MASK) - -#define AHBSC_MASTER_SEC_LEVEL_USB_HS_MASK (0xC000000U) -#define AHBSC_MASTER_SEC_LEVEL_USB_HS_SHIFT (26U) -/*! USB_HS - USB HS - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define AHBSC_MASTER_SEC_LEVEL_USB_HS(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_USB_HS_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_USB_HS_MASK) - -#define AHBSC_MASTER_SEC_LEVEL_MASTER_SEC_LEVEL_LOCK_MASK (0xC0000000U) -#define AHBSC_MASTER_SEC_LEVEL_MASTER_SEC_LEVEL_LOCK_SHIFT (30U) -/*! MASTER_SEC_LEVEL_LOCK - Master SEC Level Lock - * 0b00..Reserved - * 0b01..MASTER_SEC_LEVEL_LOCK cannot be written - * 0b10..MASTER_SEC_LEVEL_LOCK can be written - * 0b11..Reserved - */ -#define AHBSC_MASTER_SEC_LEVEL_MASTER_SEC_LEVEL_LOCK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_MASTER_SEC_LEVEL_LOCK_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_MASTER_SEC_LEVEL_LOCK_MASK) -/*! @} */ - -/*! @name MASTER_SEC_ANTI_POL_REG - Master Secure Level */ -/*! @{ */ - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_SMARTDMA_MASK (0x30U) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_SMARTDMA_SHIFT (4U) -/*! SMARTDMA - SMARTDMA Data - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_SMARTDMA(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_SMARTDMA_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_SMARTDMA_MASK) - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_EDMA0_MASK (0xC0U) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_EDMA0_SHIFT (6U) -/*! eDMA0 - eDMA0 - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_EDMA0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_EDMA0_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_EDMA0_MASK) - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_EDMA1_MASK (0x300U) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_EDMA1_SHIFT (8U) -/*! eDMA1 - eDMA1 - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_EDMA1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_EDMA1_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_EDMA1_MASK) - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_PKC_MASK (0xC00U) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_PKC_SHIFT (10U) -/*! PKC - PKC - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_PKC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_PKC_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_PKC_MASK) - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_USB_HS_MASK (0xC000000U) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_USB_HS_SHIFT (26U) -/*! USB_HS - USB HS - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_USB_HS(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_USB_HS_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_USB_HS_MASK) - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_MASTER_SEC_LEVEL_ANTIPOL_LOCK_MASK (0xC0000000U) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_MASTER_SEC_LEVEL_ANTIPOL_LOCK_SHIFT (30U) -/*! MASTER_SEC_LEVEL_ANTIPOL_LOCK - Master SEC Level Antipol Lock - * 0b00..Reserved - * 0b01..MASTER_SEC_LEVEL_LOCK cannot be written - * 0b10..MASTER_SEC_LEVEL_LOCK can be written - * 0b11..Reserved - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_MASTER_SEC_LEVEL_ANTIPOL_LOCK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_MASTER_SEC_LEVEL_ANTIPOL_LOCK_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_MASTER_SEC_LEVEL_ANTIPOL_LOCK_MASK) -/*! @} */ - -/*! @name CPU0_LOCK_REG - Miscellaneous CPU0 Control Signals */ -/*! @{ */ - -#define AHBSC_CPU0_LOCK_REG_LOCK_NS_VTOR_MASK (0x3U) -#define AHBSC_CPU0_LOCK_REG_LOCK_NS_VTOR_SHIFT (0U) -/*! LOCK_NS_VTOR - LOCK_NS_VTOR - * 0b00..Reserved - * 0b01..CM33 (CPU0) LOCKNSVTOR is 1 - * 0b10..CM33 (CPU0) LOCKNSVTOR is 0 - * 0b11..Reserved - */ -#define AHBSC_CPU0_LOCK_REG_LOCK_NS_VTOR(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_CPU0_LOCK_REG_LOCK_NS_VTOR_SHIFT)) & AHBSC_CPU0_LOCK_REG_LOCK_NS_VTOR_MASK) - -#define AHBSC_CPU0_LOCK_REG_LOCK_NS_MPU_MASK (0xCU) -#define AHBSC_CPU0_LOCK_REG_LOCK_NS_MPU_SHIFT (2U) -/*! LOCK_NS_MPU - LOCK_NS_MPU - * 0b00..Reserved - * 0b01..CM33 (CPU0) LOCK_NS_MPU is 1 - * 0b10..CM33 (CPU0) LOCK_NS_MPU is 0 - * 0b11..Reserved - */ -#define AHBSC_CPU0_LOCK_REG_LOCK_NS_MPU(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_CPU0_LOCK_REG_LOCK_NS_MPU_SHIFT)) & AHBSC_CPU0_LOCK_REG_LOCK_NS_MPU_MASK) - -#define AHBSC_CPU0_LOCK_REG_LOCK_S_VTAIRCR_MASK (0x30U) -#define AHBSC_CPU0_LOCK_REG_LOCK_S_VTAIRCR_SHIFT (4U) -/*! LOCK_S_VTAIRCR - LOCK_S_VTAIRCR - * 0b00..Reserved - * 0b01..CM33 (CPU0) LOCK_S_VTAIRCR is 1 - * 0b10..CM33 (CPU0) LOCK_S_VTAIRCR is 0 - * 0b11..Reserved - */ -#define AHBSC_CPU0_LOCK_REG_LOCK_S_VTAIRCR(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_CPU0_LOCK_REG_LOCK_S_VTAIRCR_SHIFT)) & AHBSC_CPU0_LOCK_REG_LOCK_S_VTAIRCR_MASK) - -#define AHBSC_CPU0_LOCK_REG_LOCK_S_MPU_MASK (0xC0U) -#define AHBSC_CPU0_LOCK_REG_LOCK_S_MPU_SHIFT (6U) -/*! LOCK_S_MPU - LOCK_S_MPU - * 0b00..Reserved - * 0b01..CM33 (CPU0) LOCK_S_MPU is 1 - * 0b10..CM33 (CPU0) LOCK_S_MPU is 0 - * 0b11..Reserved - */ -#define AHBSC_CPU0_LOCK_REG_LOCK_S_MPU(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_CPU0_LOCK_REG_LOCK_S_MPU_SHIFT)) & AHBSC_CPU0_LOCK_REG_LOCK_S_MPU_MASK) - -#define AHBSC_CPU0_LOCK_REG_LOCK_SAU_MASK (0x300U) -#define AHBSC_CPU0_LOCK_REG_LOCK_SAU_SHIFT (8U) -/*! LOCK_SAU - LOCK_SAU - * 0b00..Reserved - * 0b01..CM33 (CPU0) LOCK_SAU is 1 - * 0b10..CM33 (CPU0) LOCK_SAU is 0 - * 0b11..Reserved - */ -#define AHBSC_CPU0_LOCK_REG_LOCK_SAU(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_CPU0_LOCK_REG_LOCK_SAU_SHIFT)) & AHBSC_CPU0_LOCK_REG_LOCK_SAU_MASK) - -#define AHBSC_CPU0_LOCK_REG_CM33_LOCK_REG_LOCK_MASK (0xC0000000U) -#define AHBSC_CPU0_LOCK_REG_CM33_LOCK_REG_LOCK_SHIFT (30U) -/*! CM33_LOCK_REG_LOCK - CM33_LOCK_REG_LOCK - * 0b00..Reserved - * 0b01..CM33_LOCK_REG_LOCK is 1 - * 0b10..CM33_LOCK_REG_LOCK is 0 - * 0b11..Reserved - */ -#define AHBSC_CPU0_LOCK_REG_CM33_LOCK_REG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_CPU0_LOCK_REG_CM33_LOCK_REG_LOCK_SHIFT)) & AHBSC_CPU0_LOCK_REG_CM33_LOCK_REG_LOCK_MASK) -/*! @} */ - -/*! @name MISC_CTRL_DP_REG - Secure Control Duplicate */ -/*! @{ */ - -#define AHBSC_MISC_CTRL_DP_REG_WRITE_LOCK_MASK (0x3U) -#define AHBSC_MISC_CTRL_DP_REG_WRITE_LOCK_SHIFT (0U) -/*! WRITE_LOCK - Write Lock - * 0b00..Reserved - * 0b01..Writes to this register and to the Memory and Peripheral RULE registers are not allowed - * 0b10..Writes to this register and to the Memory and Peripheral RULE registers are allowed - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_DP_REG_WRITE_LOCK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_DP_REG_WRITE_LOCK_SHIFT)) & AHBSC_MISC_CTRL_DP_REG_WRITE_LOCK_MASK) - -#define AHBSC_MISC_CTRL_DP_REG_ENABLE_SECURE_CHECKING_MASK (0xCU) -#define AHBSC_MISC_CTRL_DP_REG_ENABLE_SECURE_CHECKING_SHIFT (2U) -/*! ENABLE_SECURE_CHECKING - Enable Secure Checking - * 0b00..Reserved - * 0b01..Enables secure checking. Violation can be detected when the security level of a transaction does not - * meet the security rule of the slave or memory to be accessed. - * 0b10..Disables secure checking. Even if the security level of a transaction does not conform to the security - * rule of the slave or memory, it will not be detected as a violation. - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_DP_REG_ENABLE_SECURE_CHECKING(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_DP_REG_ENABLE_SECURE_CHECKING_SHIFT)) & AHBSC_MISC_CTRL_DP_REG_ENABLE_SECURE_CHECKING_MASK) - -#define AHBSC_MISC_CTRL_DP_REG_ENABLE_S_PRIV_CHECK_MASK (0x30U) -#define AHBSC_MISC_CTRL_DP_REG_ENABLE_S_PRIV_CHECK_SHIFT (4U) -/*! ENABLE_S_PRIV_CHECK - Enable Secure Privilege Checking - * 0b00..Reserved - * 0b01..Enables the privilege checking of secure mode access. - * 0b10..Disables the privilege checking of secure mode access. - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_DP_REG_ENABLE_S_PRIV_CHECK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_DP_REG_ENABLE_S_PRIV_CHECK_SHIFT)) & AHBSC_MISC_CTRL_DP_REG_ENABLE_S_PRIV_CHECK_MASK) - -#define AHBSC_MISC_CTRL_DP_REG_ENABLE_NS_PRIV_CHECK_MASK (0xC0U) -#define AHBSC_MISC_CTRL_DP_REG_ENABLE_NS_PRIV_CHECK_SHIFT (6U) -/*! ENABLE_NS_PRIV_CHECK - Enable Non-Secure Privilege Checking - * 0b00..Reserved - * 0b01..Enables the privilege checking of non-secure mode access. - * 0b10..Disables the privilege checking of non-secure mode access. - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_DP_REG_ENABLE_NS_PRIV_CHECK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_DP_REG_ENABLE_NS_PRIV_CHECK_SHIFT)) & AHBSC_MISC_CTRL_DP_REG_ENABLE_NS_PRIV_CHECK_MASK) - -#define AHBSC_MISC_CTRL_DP_REG_DISABLE_VIOLATION_ABORT_MASK (0x300U) -#define AHBSC_MISC_CTRL_DP_REG_DISABLE_VIOLATION_ABORT_SHIFT (8U) -/*! DISABLE_VIOLATION_ABORT - Disable Violation Abort - * 0b00..Reserved - * 0b01..The violation detected by the secure checker will not cause an abort, but a secure_violation_irq - * (interrupt request) will still be asserted and serviced by ISR. - * 0b10..The violation detected by the secure checker will cause an abort. - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_DP_REG_DISABLE_VIOLATION_ABORT(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_DP_REG_DISABLE_VIOLATION_ABORT_SHIFT)) & AHBSC_MISC_CTRL_DP_REG_DISABLE_VIOLATION_ABORT_MASK) - -#define AHBSC_MISC_CTRL_DP_REG_DISABLE_STRICT_MODE_MASK (0xC00U) -#define AHBSC_MISC_CTRL_DP_REG_DISABLE_STRICT_MODE_SHIFT (10U) -/*! DISABLE_STRICT_MODE - Disable Strict Mode - * 0b00..Reserved - * 0b01..Master can access memories and peripherals at the same level or below that level. - * 0b10..Master can access memories and peripherals at same level only - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_DP_REG_DISABLE_STRICT_MODE(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_DP_REG_DISABLE_STRICT_MODE_SHIFT)) & AHBSC_MISC_CTRL_DP_REG_DISABLE_STRICT_MODE_MASK) - -#define AHBSC_MISC_CTRL_DP_REG_IDAU_ALL_NS_MASK (0xC000U) -#define AHBSC_MISC_CTRL_DP_REG_IDAU_ALL_NS_SHIFT (14U) -/*! IDAU_ALL_NS - IDAU All Non-Secure - * 0b00..Reserved - * 0b01..IDAU is disabled, which means that all memories are attributed as non-secure memory. - * 0b10..IDAU is enabled (restrictive mode) - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_DP_REG_IDAU_ALL_NS(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_DP_REG_IDAU_ALL_NS_SHIFT)) & AHBSC_MISC_CTRL_DP_REG_IDAU_ALL_NS_MASK) -/*! @} */ - -/*! @name MISC_CTRL_REG - Secure Control */ -/*! @{ */ - -#define AHBSC_MISC_CTRL_REG_WRITE_LOCK_MASK (0x3U) -#define AHBSC_MISC_CTRL_REG_WRITE_LOCK_SHIFT (0U) -/*! WRITE_LOCK - Write Lock - * 0b00..Reserved - * 0b01..Writes to this register and to the Memory and Peripheral RULE registers are not allowed - * 0b10..Writes to this register and to the Memory and Peripheral RULE registers are allowed - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_REG_WRITE_LOCK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_REG_WRITE_LOCK_SHIFT)) & AHBSC_MISC_CTRL_REG_WRITE_LOCK_MASK) - -#define AHBSC_MISC_CTRL_REG_ENABLE_SECURE_CHECKING_MASK (0xCU) -#define AHBSC_MISC_CTRL_REG_ENABLE_SECURE_CHECKING_SHIFT (2U) -/*! ENABLE_SECURE_CHECKING - Enable Secure Checking - * 0b00..Reserved - * 0b01..Enables secure checking. Violation can be detected when the security level of a transaction does not - * meet the security rule of the slave or memory to be accessed. - * 0b10..Disables secure checking. Even if the security level of a transaction does not conform to the security - * rule of the slave or memory, it will not be detected as a violation. - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_REG_ENABLE_SECURE_CHECKING(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_REG_ENABLE_SECURE_CHECKING_SHIFT)) & AHBSC_MISC_CTRL_REG_ENABLE_SECURE_CHECKING_MASK) - -#define AHBSC_MISC_CTRL_REG_ENABLE_S_PRIV_CHECK_MASK (0x30U) -#define AHBSC_MISC_CTRL_REG_ENABLE_S_PRIV_CHECK_SHIFT (4U) -/*! ENABLE_S_PRIV_CHECK - Enable Secure Privilege Checking - * 0b00..Reserved - * 0b01..Enables privilege checking of secure mode access. - * 0b10..Disables privilege checking of secure mode access. - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_REG_ENABLE_S_PRIV_CHECK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_REG_ENABLE_S_PRIV_CHECK_SHIFT)) & AHBSC_MISC_CTRL_REG_ENABLE_S_PRIV_CHECK_MASK) - -#define AHBSC_MISC_CTRL_REG_ENABLE_NS_PRIV_CHECK_MASK (0xC0U) -#define AHBSC_MISC_CTRL_REG_ENABLE_NS_PRIV_CHECK_SHIFT (6U) -/*! ENABLE_NS_PRIV_CHECK - Enable Non-Secure Privilege Checking - * 0b00..Reserved - * 0b01..Enables privilege checking of non-secure mode access. - * 0b10..Disables privilege checking of non-secure mode access is disabled. - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_REG_ENABLE_NS_PRIV_CHECK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_REG_ENABLE_NS_PRIV_CHECK_SHIFT)) & AHBSC_MISC_CTRL_REG_ENABLE_NS_PRIV_CHECK_MASK) - -#define AHBSC_MISC_CTRL_REG_DISABLE_VIOLATION_ABORT_MASK (0x300U) -#define AHBSC_MISC_CTRL_REG_DISABLE_VIOLATION_ABORT_SHIFT (8U) -/*! DISABLE_VIOLATION_ABORT - Disable Violation Abort - * 0b00..Reserved - * 0b01..The violation detected by the secure checker will not cause an abort, but a secure_violation_irq - * (interrupt request) will still be asserted and serviced by ISR. - * 0b10..The violation detected by the secure checker will cause an abort. - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_REG_DISABLE_VIOLATION_ABORT(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_REG_DISABLE_VIOLATION_ABORT_SHIFT)) & AHBSC_MISC_CTRL_REG_DISABLE_VIOLATION_ABORT_MASK) - -#define AHBSC_MISC_CTRL_REG_DISABLE_STRICT_MODE_MASK (0xC00U) -#define AHBSC_MISC_CTRL_REG_DISABLE_STRICT_MODE_SHIFT (10U) -/*! DISABLE_STRICT_MODE - Disable Strict Mode - * 0b00..Reserved - * 0b01..Master strict mode is on and can access memories and peripherals at the same level or below that level - * 0b10..Master strict mode is disabled and can access memories and peripherals at same level only - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_REG_DISABLE_STRICT_MODE(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_REG_DISABLE_STRICT_MODE_SHIFT)) & AHBSC_MISC_CTRL_REG_DISABLE_STRICT_MODE_MASK) - -#define AHBSC_MISC_CTRL_REG_IDAU_ALL_NS_MASK (0xC000U) -#define AHBSC_MISC_CTRL_REG_IDAU_ALL_NS_SHIFT (14U) -/*! IDAU_ALL_NS - IDAU All Non-Secure - * 0b00..Reserved - * 0b01..IDAU is disabled, which means that all memories are attributed as non-secure memory. - * 0b10..IDAU is enabled (restrictive mode) - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_REG_IDAU_ALL_NS(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_REG_IDAU_ALL_NS_SHIFT)) & AHBSC_MISC_CTRL_REG_IDAU_ALL_NS_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group AHBSC_Register_Masks */ - - -/* AHBSC - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral AHBSC base address */ - #define AHBSC_BASE (0x50120000u) - /** Peripheral AHBSC base address */ - #define AHBSC_BASE_NS (0x40120000u) - /** Peripheral AHBSC base pointer */ - #define AHBSC ((AHBSC_Type *)AHBSC_BASE) - /** Peripheral AHBSC base pointer */ - #define AHBSC_NS ((AHBSC_Type *)AHBSC_BASE_NS) - /** Peripheral AHBSC_ALIAS1 base address */ - #define AHBSC_ALIAS1_BASE (0x50121000u) - /** Peripheral AHBSC_ALIAS1 base address */ - #define AHBSC_ALIAS1_BASE_NS (0x40121000u) - /** Peripheral AHBSC_ALIAS1 base pointer */ - #define AHBSC_ALIAS1 ((AHBSC_Type *)AHBSC_ALIAS1_BASE) - /** Peripheral AHBSC_ALIAS1 base pointer */ - #define AHBSC_ALIAS1_NS ((AHBSC_Type *)AHBSC_ALIAS1_BASE_NS) - /** Peripheral AHBSC_ALIAS2 base address */ - #define AHBSC_ALIAS2_BASE (0x50122000u) - /** Peripheral AHBSC_ALIAS2 base address */ - #define AHBSC_ALIAS2_BASE_NS (0x40122000u) - /** Peripheral AHBSC_ALIAS2 base pointer */ - #define AHBSC_ALIAS2 ((AHBSC_Type *)AHBSC_ALIAS2_BASE) - /** Peripheral AHBSC_ALIAS2 base pointer */ - #define AHBSC_ALIAS2_NS ((AHBSC_Type *)AHBSC_ALIAS2_BASE_NS) - /** Peripheral AHBSC_ALIAS3 base address */ - #define AHBSC_ALIAS3_BASE (0x50123000u) - /** Peripheral AHBSC_ALIAS3 base address */ - #define AHBSC_ALIAS3_BASE_NS (0x40123000u) - /** Peripheral AHBSC_ALIAS3 base pointer */ - #define AHBSC_ALIAS3 ((AHBSC_Type *)AHBSC_ALIAS3_BASE) - /** Peripheral AHBSC_ALIAS3 base pointer */ - #define AHBSC_ALIAS3_NS ((AHBSC_Type *)AHBSC_ALIAS3_BASE_NS) - /** Array initializer of AHBSC peripheral base addresses */ - #define AHBSC_BASE_ADDRS { AHBSC_BASE, AHBSC_ALIAS1_BASE, AHBSC_ALIAS2_BASE, AHBSC_ALIAS3_BASE } - /** Array initializer of AHBSC peripheral base pointers */ - #define AHBSC_BASE_PTRS { AHBSC, AHBSC_ALIAS1, AHBSC_ALIAS2, AHBSC_ALIAS3 } - /** Array initializer of AHBSC peripheral base addresses */ - #define AHBSC_BASE_ADDRS_NS { AHBSC_BASE_NS, AHBSC_ALIAS1_BASE_NS, AHBSC_ALIAS2_BASE_NS, AHBSC_ALIAS3_BASE_NS } - /** Array initializer of AHBSC peripheral base pointers */ - #define AHBSC_BASE_PTRS_NS { AHBSC_NS, AHBSC_ALIAS1_NS, AHBSC_ALIAS2_NS, AHBSC_ALIAS3_NS } -#else - /** Peripheral AHBSC base address */ - #define AHBSC_BASE (0x40120000u) - /** Peripheral AHBSC base pointer */ - #define AHBSC ((AHBSC_Type *)AHBSC_BASE) - /** Peripheral AHBSC_ALIAS1 base address */ - #define AHBSC_ALIAS1_BASE (0x40121000u) - /** Peripheral AHBSC_ALIAS1 base pointer */ - #define AHBSC_ALIAS1 ((AHBSC_Type *)AHBSC_ALIAS1_BASE) - /** Peripheral AHBSC_ALIAS2 base address */ - #define AHBSC_ALIAS2_BASE (0x40122000u) - /** Peripheral AHBSC_ALIAS2 base pointer */ - #define AHBSC_ALIAS2 ((AHBSC_Type *)AHBSC_ALIAS2_BASE) - /** Peripheral AHBSC_ALIAS3 base address */ - #define AHBSC_ALIAS3_BASE (0x40123000u) - /** Peripheral AHBSC_ALIAS3 base pointer */ - #define AHBSC_ALIAS3 ((AHBSC_Type *)AHBSC_ALIAS3_BASE) - /** Array initializer of AHBSC peripheral base addresses */ - #define AHBSC_BASE_ADDRS { AHBSC_BASE, AHBSC_ALIAS1_BASE, AHBSC_ALIAS2_BASE, AHBSC_ALIAS3_BASE } - /** Array initializer of AHBSC peripheral base pointers */ - #define AHBSC_BASE_PTRS { AHBSC, AHBSC_ALIAS1, AHBSC_ALIAS2, AHBSC_ALIAS3 } -#endif - -/*! - * @} - */ /* end of group AHBSC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- CAN Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CAN_Peripheral_Access_Layer CAN Peripheral Access Layer - * @{ - */ - -/** CAN - Register Layout Typedef */ -typedef struct { - __IO uint32_t MCR; /**< Module Configuration, offset: 0x0 */ - __IO uint32_t CTRL1; /**< Control 1, offset: 0x4 */ - __IO uint32_t TIMER; /**< Free-Running Timer, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __IO uint32_t RXMGMASK; /**< RX Message Buffers Global Mask, offset: 0x10 */ - __IO uint32_t RX14MASK; /**< Receive 14 Mask, offset: 0x14 */ - __IO uint32_t RX15MASK; /**< Receive 15 Mask, offset: 0x18 */ - __IO uint32_t ECR; /**< Error Counter, offset: 0x1C */ - __IO uint32_t ESR1; /**< Error and Status 1, offset: 0x20 */ - uint8_t RESERVED_1[4]; - __IO uint32_t IMASK1; /**< Interrupt Masks 1, offset: 0x28 */ - uint8_t RESERVED_2[4]; - __IO uint32_t IFLAG1; /**< Interrupt Flags 1, offset: 0x30 */ - __IO uint32_t CTRL2; /**< Control 2, offset: 0x34 */ - __I uint32_t ESR2; /**< Error and Status 2, offset: 0x38 */ - uint8_t RESERVED_3[8]; - __I uint32_t CRCR; /**< Cyclic Redundancy Check, offset: 0x44 */ - __IO uint32_t RXFGMASK; /**< Legacy RX FIFO Global Mask, offset: 0x48 */ - __I uint32_t RXFIR; /**< Legacy RX FIFO Information, offset: 0x4C */ - __IO uint32_t CBT; /**< CAN Bit Timing, offset: 0x50 */ - uint8_t RESERVED_4[44]; - union { /* offset: 0x80 */ - struct { /* offset: 0x80, array step: 0x10 */ - __IO uint32_t CS; /**< Message Buffer 0 CS Register..Message Buffer 31 CS Register, array offset: 0x80, array step: 0x10 */ - __IO uint32_t ID; /**< Message Buffer 0 ID Register..Message Buffer 31 ID Register, array offset: 0x84, array step: 0x10 */ - __IO uint32_t WORD[2]; /**< Message Buffer 0 WORD_8B Register..Message Buffer 31 WORD_8B Register, array offset: 0x88, array step: index*0x10, index2*0x4 */ - } MB_8B[32]; - struct { /* offset: 0x80, array step: 0x18 */ - __IO uint32_t CS; /**< Message Buffer 0 CS Register..Message Buffer 20 CS Register, array offset: 0x80, array step: 0x18 */ - __IO uint32_t ID; /**< Message Buffer 0 ID Register..Message Buffer 20 ID Register, array offset: 0x84, array step: 0x18 */ - __IO uint32_t WORD[4]; /**< Message Buffer 0 WORD_16B Register..Message Buffer 20 WORD_16B Register, array offset: 0x88, array step: index*0x18, index2*0x4 */ - } MB_16B[21]; - struct { /* offset: 0x80, array step: 0x28 */ - __IO uint32_t CS; /**< Message Buffer 0 CS Register..Message Buffer 11 CS Register, array offset: 0x80, array step: 0x28 */ - __IO uint32_t ID; /**< Message Buffer 0 ID Register..Message Buffer 11 ID Register, array offset: 0x84, array step: 0x28 */ - __IO uint32_t WORD[8]; /**< Message Buffer 0 WORD_32B Register..Message Buffer 11 WORD_32B Register, array offset: 0x88, array step: index*0x28, index2*0x4 */ - } MB_32B[12]; - struct { /* offset: 0x80, array step: 0x48 */ - __IO uint32_t CS; /**< Message Buffer 0 CS Register..Message Buffer 6 CS Register, array offset: 0x80, array step: 0x48 */ - __IO uint32_t ID; /**< Message Buffer 0 ID Register..Message Buffer 6 ID Register, array offset: 0x84, array step: 0x48 */ - __IO uint32_t WORD[16]; /**< Message Buffer 0 WORD_64B Register..Message Buffer 6 WORD_64B Register, array offset: 0x88, array step: index*0x48, index2*0x4 */ - } MB_64B[7]; - struct { /* offset: 0x80, array step: 0x10 */ - __IO uint32_t CS; /**< Message Buffer 0 CS Register..Message Buffer 31 CS Register, array offset: 0x80, array step: 0x10 */ - __IO uint32_t ID; /**< Message Buffer 0 ID Register..Message Buffer 31 ID Register, array offset: 0x84, array step: 0x10 */ - __IO uint32_t WORD0; /**< Message Buffer 0 WORD0 Register..Message Buffer 31 WORD0 Register, array offset: 0x88, array step: 0x10 */ - __IO uint32_t WORD1; /**< Message Buffer 0 WORD1 Register..Message Buffer 31 WORD1 Register, array offset: 0x8C, array step: 0x10 */ - } MB[32]; - }; - uint8_t RESERVED_5[1536]; - __IO uint32_t RXIMR[32]; /**< Receive Individual Mask, array offset: 0x880, array step: 0x4 */ - uint8_t RESERVED_6[512]; - __IO uint32_t CTRL1_PN; /**< Pretended Networking Control 1, offset: 0xB00 */ - __IO uint32_t CTRL2_PN; /**< Pretended Networking Control 2, offset: 0xB04 */ - __IO uint32_t WU_MTC; /**< Pretended Networking Wake-Up Match, offset: 0xB08 */ - __IO uint32_t FLT_ID1; /**< Pretended Networking ID Filter 1, offset: 0xB0C */ - __IO uint32_t FLT_DLC; /**< Pretended Networking Data Length Code (DLC) Filter, offset: 0xB10 */ - __IO uint32_t PL1_LO; /**< Pretended Networking Payload Low Filter 1, offset: 0xB14 */ - __IO uint32_t PL1_HI; /**< Pretended Networking Payload High Filter 1, offset: 0xB18 */ - __IO uint32_t FLT_ID2_IDMASK; /**< Pretended Networking ID Filter 2 or ID Mask, offset: 0xB1C */ - __IO uint32_t PL2_PLMASK_LO; /**< Pretended Networking Payload Low Filter 2 and Payload Low Mask, offset: 0xB20 */ - __IO uint32_t PL2_PLMASK_HI; /**< Pretended Networking Payload High Filter 2 and Payload High Mask, offset: 0xB24 */ - uint8_t RESERVED_7[24]; - struct { /* offset: 0xB40, array step: 0x10 */ - __I uint32_t CS; /**< Wake-Up Message Buffer, array offset: 0xB40, array step: 0x10 */ - __I uint32_t ID; /**< Wake-Up Message Buffer for ID, array offset: 0xB44, array step: 0x10 */ - __I uint32_t D03; /**< Wake-Up Message Buffer for Data 0-3, array offset: 0xB48, array step: 0x10 */ - __I uint32_t D47; /**< Wake-Up Message Buffer Register Data 4-7, array offset: 0xB4C, array step: 0x10 */ - } WMB[4]; - uint8_t RESERVED_8[112]; - __IO uint32_t EPRS; /**< Enhanced CAN Bit Timing Prescalers, offset: 0xBF0 */ - __IO uint32_t ENCBT; /**< Enhanced Nominal CAN Bit Timing, offset: 0xBF4 */ - __IO uint32_t EDCBT; /**< Enhanced Data Phase CAN Bit Timing, offset: 0xBF8 */ - __IO uint32_t ETDC; /**< Enhanced Transceiver Delay Compensation, offset: 0xBFC */ - __IO uint32_t FDCTRL; /**< CAN FD Control, offset: 0xC00 */ - __IO uint32_t FDCBT; /**< CAN FD Bit Timing, offset: 0xC04 */ - __I uint32_t FDCRC; /**< CAN FD CRC, offset: 0xC08 */ - __IO uint32_t ERFCR; /**< Enhanced RX FIFO Control, offset: 0xC0C */ - __IO uint32_t ERFIER; /**< Enhanced RX FIFO Interrupt Enable, offset: 0xC10 */ - __IO uint32_t ERFSR; /**< Enhanced RX FIFO Status, offset: 0xC14 */ - uint8_t RESERVED_9[9192]; - __IO uint32_t ERFFEL[32]; /**< Enhanced RX FIFO Filter Element, array offset: 0x3000, array step: 0x4 */ -} CAN_Type; - -/* ---------------------------------------------------------------------------- - -- CAN Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CAN_Register_Masks CAN Register Masks - * @{ - */ - -/*! @name MCR - Module Configuration */ -/*! @{ */ - -#define CAN_MCR_MAXMB_MASK (0x7FU) -#define CAN_MCR_MAXMB_SHIFT (0U) -/*! MAXMB - Number of the Last Message Buffer */ -#define CAN_MCR_MAXMB(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_MAXMB_SHIFT)) & CAN_MCR_MAXMB_MASK) - -#define CAN_MCR_IDAM_MASK (0x300U) -#define CAN_MCR_IDAM_SHIFT (8U) -/*! IDAM - ID Acceptance Mode - * 0b00..Format A: One full ID (standard and extended) per ID filter table element. - * 0b01..Format B: Two full standard IDs or two partial 14-bit (standard and extended) IDs per ID filter table element. - * 0b10..Format C: Four partial 8-bit standard IDs per ID filter table element. - * 0b11..Format D: All frames rejected. - */ -#define CAN_MCR_IDAM(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_IDAM_SHIFT)) & CAN_MCR_IDAM_MASK) - -#define CAN_MCR_FDEN_MASK (0x800U) -#define CAN_MCR_FDEN_SHIFT (11U) -/*! FDEN - CAN FD Operation Enable - * 0b1..Enable - * 0b0..Disable - */ -#define CAN_MCR_FDEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_FDEN_SHIFT)) & CAN_MCR_FDEN_MASK) - -#define CAN_MCR_AEN_MASK (0x1000U) -#define CAN_MCR_AEN_SHIFT (12U) -/*! AEN - Abort Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define CAN_MCR_AEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_AEN_SHIFT)) & CAN_MCR_AEN_MASK) - -#define CAN_MCR_LPRIOEN_MASK (0x2000U) -#define CAN_MCR_LPRIOEN_SHIFT (13U) -/*! LPRIOEN - Local Priority Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_LPRIOEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_LPRIOEN_SHIFT)) & CAN_MCR_LPRIOEN_MASK) - -#define CAN_MCR_PNET_EN_MASK (0x4000U) -#define CAN_MCR_PNET_EN_SHIFT (14U) -/*! PNET_EN - Pretended Networking Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_PNET_EN(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_PNET_EN_SHIFT)) & CAN_MCR_PNET_EN_MASK) - -#define CAN_MCR_DMA_MASK (0x8000U) -#define CAN_MCR_DMA_SHIFT (15U) -/*! DMA - DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_DMA(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_DMA_SHIFT)) & CAN_MCR_DMA_MASK) - -#define CAN_MCR_IRMQ_MASK (0x10000U) -#define CAN_MCR_IRMQ_SHIFT (16U) -/*! IRMQ - Individual RX Masking and Queue Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_IRMQ(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_IRMQ_SHIFT)) & CAN_MCR_IRMQ_MASK) - -#define CAN_MCR_SRXDIS_MASK (0x20000U) -#define CAN_MCR_SRXDIS_SHIFT (17U) -/*! SRXDIS - Self-Reception Disable - * 0b0..Enable - * 0b1..Disable - */ -#define CAN_MCR_SRXDIS(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_SRXDIS_SHIFT)) & CAN_MCR_SRXDIS_MASK) - -#define CAN_MCR_WAKSRC_MASK (0x80000U) -#define CAN_MCR_WAKSRC_SHIFT (19U) -/*! WAKSRC - Wake-Up Source - * 0b0..No filter applied - * 0b1..Filter applied - */ -#define CAN_MCR_WAKSRC(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_WAKSRC_SHIFT)) & CAN_MCR_WAKSRC_MASK) - -#define CAN_MCR_LPMACK_MASK (0x100000U) -#define CAN_MCR_LPMACK_SHIFT (20U) -/*! LPMACK - Low-Power Mode Acknowledge - * 0b0..Not in a low-power mode - * 0b1..In a low-power mode - */ -#define CAN_MCR_LPMACK(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_LPMACK_SHIFT)) & CAN_MCR_LPMACK_MASK) - -#define CAN_MCR_WRNEN_MASK (0x200000U) -#define CAN_MCR_WRNEN_SHIFT (21U) -/*! WRNEN - Warning Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_WRNEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_WRNEN_SHIFT)) & CAN_MCR_WRNEN_MASK) - -#define CAN_MCR_SLFWAK_MASK (0x400000U) -#define CAN_MCR_SLFWAK_SHIFT (22U) -/*! SLFWAK - Self Wake-up - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_SLFWAK(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_SLFWAK_SHIFT)) & CAN_MCR_SLFWAK_MASK) - -#define CAN_MCR_FRZACK_MASK (0x1000000U) -#define CAN_MCR_FRZACK_SHIFT (24U) -/*! FRZACK - Freeze Mode Acknowledge - * 0b0..Not in Freeze mode, prescaler running. - * 0b1..In Freeze mode, prescaler stopped. - */ -#define CAN_MCR_FRZACK(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_FRZACK_SHIFT)) & CAN_MCR_FRZACK_MASK) - -#define CAN_MCR_SOFTRST_MASK (0x2000000U) -#define CAN_MCR_SOFTRST_SHIFT (25U) -/*! SOFTRST - Soft Reset - * 0b0..No reset - * 0b1..Soft reset affects reset registers - */ -#define CAN_MCR_SOFTRST(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_SOFTRST_SHIFT)) & CAN_MCR_SOFTRST_MASK) - -#define CAN_MCR_WAKMSK_MASK (0x4000000U) -#define CAN_MCR_WAKMSK_SHIFT (26U) -/*! WAKMSK - Wake-up Interrupt Mask - * 0b0..Disabled - * 0b1..Enabled - */ -#define CAN_MCR_WAKMSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_WAKMSK_SHIFT)) & CAN_MCR_WAKMSK_MASK) - -#define CAN_MCR_NOTRDY_MASK (0x8000000U) -#define CAN_MCR_NOTRDY_SHIFT (27U) -/*! NOTRDY - FlexCAN Not Ready - * 0b0..FlexCAN is in Normal mode, Listen-Only mode, or Loopback mode. - * 0b1..FlexCAN is in Disable mode, Stop mode, or Freeze mode. - */ -#define CAN_MCR_NOTRDY(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_NOTRDY_SHIFT)) & CAN_MCR_NOTRDY_MASK) - -#define CAN_MCR_HALT_MASK (0x10000000U) -#define CAN_MCR_HALT_SHIFT (28U) -/*! HALT - Halt FlexCAN - * 0b0..No request - * 0b1..Enter Freeze mode, if MCR[FRZ] = 1. - */ -#define CAN_MCR_HALT(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_HALT_SHIFT)) & CAN_MCR_HALT_MASK) - -#define CAN_MCR_RFEN_MASK (0x20000000U) -#define CAN_MCR_RFEN_SHIFT (29U) -/*! RFEN - Legacy RX FIFO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_RFEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_RFEN_SHIFT)) & CAN_MCR_RFEN_MASK) - -#define CAN_MCR_FRZ_MASK (0x40000000U) -#define CAN_MCR_FRZ_SHIFT (30U) -/*! FRZ - Freeze Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_FRZ(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_FRZ_SHIFT)) & CAN_MCR_FRZ_MASK) - -#define CAN_MCR_MDIS_MASK (0x80000000U) -#define CAN_MCR_MDIS_SHIFT (31U) -/*! MDIS - Module Disable - * 0b0..Enable - * 0b1..Disable - */ -#define CAN_MCR_MDIS(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_MDIS_SHIFT)) & CAN_MCR_MDIS_MASK) -/*! @} */ - -/*! @name CTRL1 - Control 1 */ -/*! @{ */ - -#define CAN_CTRL1_PROPSEG_MASK (0x7U) -#define CAN_CTRL1_PROPSEG_SHIFT (0U) -/*! PROPSEG - Propagation Segment */ -#define CAN_CTRL1_PROPSEG(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PROPSEG_SHIFT)) & CAN_CTRL1_PROPSEG_MASK) - -#define CAN_CTRL1_LOM_MASK (0x8U) -#define CAN_CTRL1_LOM_SHIFT (3U) -/*! LOM - Listen-Only Mode - * 0b0..Listen-Only mode is deactivated. - * 0b1..FlexCAN module operates in Listen-Only mode. - */ -#define CAN_CTRL1_LOM(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_LOM_SHIFT)) & CAN_CTRL1_LOM_MASK) - -#define CAN_CTRL1_LBUF_MASK (0x10U) -#define CAN_CTRL1_LBUF_SHIFT (4U) -/*! LBUF - Lowest Buffer Transmitted First - * 0b0..Buffer with highest priority is transmitted first. - * 0b1..Lowest number buffer is transmitted first. - */ -#define CAN_CTRL1_LBUF(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_LBUF_SHIFT)) & CAN_CTRL1_LBUF_MASK) - -#define CAN_CTRL1_TSYN_MASK (0x20U) -#define CAN_CTRL1_TSYN_SHIFT (5U) -/*! TSYN - Timer Sync - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL1_TSYN(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_TSYN_SHIFT)) & CAN_CTRL1_TSYN_MASK) - -#define CAN_CTRL1_BOFFREC_MASK (0x40U) -#define CAN_CTRL1_BOFFREC_SHIFT (6U) -/*! BOFFREC - Bus Off Recovery - * 0b0..Enabled - * 0b1..Disabled - */ -#define CAN_CTRL1_BOFFREC(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_BOFFREC_SHIFT)) & CAN_CTRL1_BOFFREC_MASK) - -#define CAN_CTRL1_SMP_MASK (0x80U) -#define CAN_CTRL1_SMP_SHIFT (7U) -/*! SMP - CAN Bit Sampling - * 0b0..One sample is used to determine the bit value. - * 0b1..Three samples are used to determine the value of the received bit: the regular one (sample point) and two - * preceding samples. A majority rule is used. - */ -#define CAN_CTRL1_SMP(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_SMP_SHIFT)) & CAN_CTRL1_SMP_MASK) - -#define CAN_CTRL1_RWRNMSK_MASK (0x400U) -#define CAN_CTRL1_RWRNMSK_SHIFT (10U) -/*! RWRNMSK - RX Warning Interrupt Mask - * 0b0..Disabled - * 0b1..Enabled - */ -#define CAN_CTRL1_RWRNMSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_RWRNMSK_SHIFT)) & CAN_CTRL1_RWRNMSK_MASK) - -#define CAN_CTRL1_TWRNMSK_MASK (0x800U) -#define CAN_CTRL1_TWRNMSK_SHIFT (11U) -/*! TWRNMSK - TX Warning Interrupt Mask - * 0b0..Disabled - * 0b1..Enabled - */ -#define CAN_CTRL1_TWRNMSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_TWRNMSK_SHIFT)) & CAN_CTRL1_TWRNMSK_MASK) - -#define CAN_CTRL1_LPB_MASK (0x1000U) -#define CAN_CTRL1_LPB_SHIFT (12U) -/*! LPB - Loopback Mode - * 0b0..Disabled - * 0b1..Enabled - */ -#define CAN_CTRL1_LPB(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_LPB_SHIFT)) & CAN_CTRL1_LPB_MASK) - -#define CAN_CTRL1_ERRMSK_MASK (0x4000U) -#define CAN_CTRL1_ERRMSK_SHIFT (14U) -/*! ERRMSK - Error Interrupt Mask - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CAN_CTRL1_ERRMSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_ERRMSK_SHIFT)) & CAN_CTRL1_ERRMSK_MASK) - -#define CAN_CTRL1_BOFFMSK_MASK (0x8000U) -#define CAN_CTRL1_BOFFMSK_SHIFT (15U) -/*! BOFFMSK - Bus Off Interrupt Mask - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CAN_CTRL1_BOFFMSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_BOFFMSK_SHIFT)) & CAN_CTRL1_BOFFMSK_MASK) - -#define CAN_CTRL1_PSEG2_MASK (0x70000U) -#define CAN_CTRL1_PSEG2_SHIFT (16U) -/*! PSEG2 - Phase Segment 2 */ -#define CAN_CTRL1_PSEG2(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PSEG2_SHIFT)) & CAN_CTRL1_PSEG2_MASK) - -#define CAN_CTRL1_PSEG1_MASK (0x380000U) -#define CAN_CTRL1_PSEG1_SHIFT (19U) -/*! PSEG1 - Phase Segment 1 */ -#define CAN_CTRL1_PSEG1(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PSEG1_SHIFT)) & CAN_CTRL1_PSEG1_MASK) - -#define CAN_CTRL1_RJW_MASK (0xC00000U) -#define CAN_CTRL1_RJW_SHIFT (22U) -/*! RJW - Resync Jump Width */ -#define CAN_CTRL1_RJW(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_RJW_SHIFT)) & CAN_CTRL1_RJW_MASK) - -#define CAN_CTRL1_PRESDIV_MASK (0xFF000000U) -#define CAN_CTRL1_PRESDIV_SHIFT (24U) -/*! PRESDIV - Prescaler Division Factor */ -#define CAN_CTRL1_PRESDIV(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PRESDIV_SHIFT)) & CAN_CTRL1_PRESDIV_MASK) -/*! @} */ - -/*! @name TIMER - Free-Running Timer */ -/*! @{ */ - -#define CAN_TIMER_TIMER_MASK (0xFFFFU) -#define CAN_TIMER_TIMER_SHIFT (0U) -/*! TIMER - Timer Value */ -#define CAN_TIMER_TIMER(x) (((uint32_t)(((uint32_t)(x)) << CAN_TIMER_TIMER_SHIFT)) & CAN_TIMER_TIMER_MASK) -/*! @} */ - -/*! @name RXMGMASK - RX Message Buffers Global Mask */ -/*! @{ */ - -#define CAN_RXMGMASK_MG_MASK (0xFFFFFFFFU) -#define CAN_RXMGMASK_MG_SHIFT (0U) -/*! MG - Global Mask for RX Message Buffers */ -#define CAN_RXMGMASK_MG(x) (((uint32_t)(((uint32_t)(x)) << CAN_RXMGMASK_MG_SHIFT)) & CAN_RXMGMASK_MG_MASK) -/*! @} */ - -/*! @name RX14MASK - Receive 14 Mask */ -/*! @{ */ - -#define CAN_RX14MASK_RX14M_MASK (0xFFFFFFFFU) -#define CAN_RX14MASK_RX14M_SHIFT (0U) -/*! RX14M - RX Buffer 14 Mask Bits */ -#define CAN_RX14MASK_RX14M(x) (((uint32_t)(((uint32_t)(x)) << CAN_RX14MASK_RX14M_SHIFT)) & CAN_RX14MASK_RX14M_MASK) -/*! @} */ - -/*! @name RX15MASK - Receive 15 Mask */ -/*! @{ */ - -#define CAN_RX15MASK_RX15M_MASK (0xFFFFFFFFU) -#define CAN_RX15MASK_RX15M_SHIFT (0U) -/*! RX15M - RX Buffer 15 Mask Bits */ -#define CAN_RX15MASK_RX15M(x) (((uint32_t)(((uint32_t)(x)) << CAN_RX15MASK_RX15M_SHIFT)) & CAN_RX15MASK_RX15M_MASK) -/*! @} */ - -/*! @name ECR - Error Counter */ -/*! @{ */ - -#define CAN_ECR_TXERRCNT_MASK (0xFFU) -#define CAN_ECR_TXERRCNT_SHIFT (0U) -/*! TXERRCNT - Transmit Error Counter */ -#define CAN_ECR_TXERRCNT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ECR_TXERRCNT_SHIFT)) & CAN_ECR_TXERRCNT_MASK) - -#define CAN_ECR_RXERRCNT_MASK (0xFF00U) -#define CAN_ECR_RXERRCNT_SHIFT (8U) -/*! RXERRCNT - Receive Error Counter */ -#define CAN_ECR_RXERRCNT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ECR_RXERRCNT_SHIFT)) & CAN_ECR_RXERRCNT_MASK) - -#define CAN_ECR_TXERRCNT_FAST_MASK (0xFF0000U) -#define CAN_ECR_TXERRCNT_FAST_SHIFT (16U) -/*! TXERRCNT_FAST - Transmit Error Counter for Fast Bits */ -#define CAN_ECR_TXERRCNT_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ECR_TXERRCNT_FAST_SHIFT)) & CAN_ECR_TXERRCNT_FAST_MASK) - -#define CAN_ECR_RXERRCNT_FAST_MASK (0xFF000000U) -#define CAN_ECR_RXERRCNT_FAST_SHIFT (24U) -/*! RXERRCNT_FAST - Receive Error Counter for Fast Bits */ -#define CAN_ECR_RXERRCNT_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ECR_RXERRCNT_FAST_SHIFT)) & CAN_ECR_RXERRCNT_FAST_MASK) -/*! @} */ - -/*! @name ESR1 - Error and Status 1 */ -/*! @{ */ - -#define CAN_ESR1_WAKINT_MASK (0x1U) -#define CAN_ESR1_WAKINT_SHIFT (0U) -/*! WAKINT - Wake-up Interrupt Flag - * 0b0..No such occurrence. - * 0b1..Indicates that a recessive-to-dominant transition was received on the CAN bus. - */ -#define CAN_ESR1_WAKINT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_WAKINT_SHIFT)) & CAN_ESR1_WAKINT_MASK) - -#define CAN_ESR1_ERRINT_MASK (0x2U) -#define CAN_ESR1_ERRINT_SHIFT (1U) -/*! ERRINT - Error Interrupt Flag - * 0b0..No such occurrence. - * 0b1..Indicates setting of any error flag in the Error and Status register. - */ -#define CAN_ESR1_ERRINT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_ERRINT_SHIFT)) & CAN_ESR1_ERRINT_MASK) - -#define CAN_ESR1_BOFFINT_MASK (0x4U) -#define CAN_ESR1_BOFFINT_SHIFT (2U) -/*! BOFFINT - Bus Off Interrupt Flag - * 0b0..No such occurrence. - * 0b1..FlexCAN module entered Bus Off state. - */ -#define CAN_ESR1_BOFFINT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_BOFFINT_SHIFT)) & CAN_ESR1_BOFFINT_MASK) - -#define CAN_ESR1_RX_MASK (0x8U) -#define CAN_ESR1_RX_SHIFT (3U) -/*! RX - FlexCAN in Reception Flag - * 0b0..Not receiving - * 0b1..Receiving - */ -#define CAN_ESR1_RX(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_RX_SHIFT)) & CAN_ESR1_RX_MASK) - -#define CAN_ESR1_FLTCONF_MASK (0x30U) -#define CAN_ESR1_FLTCONF_SHIFT (4U) -/*! FLTCONF - Fault Confinement State - * 0b00..Error Active - * 0b01..Error Passive - * 0b1x..Bus Off - */ -#define CAN_ESR1_FLTCONF(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_FLTCONF_SHIFT)) & CAN_ESR1_FLTCONF_MASK) - -#define CAN_ESR1_TX_MASK (0x40U) -#define CAN_ESR1_TX_SHIFT (6U) -/*! TX - FlexCAN In Transmission - * 0b0..Not transmitting - * 0b1..Transmitting - */ -#define CAN_ESR1_TX(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_TX_SHIFT)) & CAN_ESR1_TX_MASK) - -#define CAN_ESR1_IDLE_MASK (0x80U) -#define CAN_ESR1_IDLE_SHIFT (7U) -/*! IDLE - Idle - * 0b0..Not IDLE - * 0b1..IDLE - */ -#define CAN_ESR1_IDLE(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_IDLE_SHIFT)) & CAN_ESR1_IDLE_MASK) - -#define CAN_ESR1_RXWRN_MASK (0x100U) -#define CAN_ESR1_RXWRN_SHIFT (8U) -/*! RXWRN - RX Error Warning Flag - * 0b0..No such occurrence. - * 0b1..RXERRCNT is greater than or equal to 96. - */ -#define CAN_ESR1_RXWRN(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_RXWRN_SHIFT)) & CAN_ESR1_RXWRN_MASK) - -#define CAN_ESR1_TXWRN_MASK (0x200U) -#define CAN_ESR1_TXWRN_SHIFT (9U) -/*! TXWRN - TX Error Warning Flag - * 0b0..No such occurrence. - * 0b1..TXERRCNT is 96 or greater. - */ -#define CAN_ESR1_TXWRN(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_TXWRN_SHIFT)) & CAN_ESR1_TXWRN_MASK) - -#define CAN_ESR1_STFERR_MASK (0x400U) -#define CAN_ESR1_STFERR_SHIFT (10U) -/*! STFERR - Stuffing Error Flag - * 0b0..No error - * 0b1..Error occurred since last read of this register. - */ -#define CAN_ESR1_STFERR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_STFERR_SHIFT)) & CAN_ESR1_STFERR_MASK) - -#define CAN_ESR1_FRMERR_MASK (0x800U) -#define CAN_ESR1_FRMERR_SHIFT (11U) -/*! FRMERR - Form Error Flag - * 0b0..No error - * 0b1..Error occurred since last read of this register. - */ -#define CAN_ESR1_FRMERR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_FRMERR_SHIFT)) & CAN_ESR1_FRMERR_MASK) - -#define CAN_ESR1_CRCERR_MASK (0x1000U) -#define CAN_ESR1_CRCERR_SHIFT (12U) -/*! CRCERR - Cyclic Redundancy Check Error Flag - * 0b0..No error - * 0b1..Error occurred since last read of this register. - */ -#define CAN_ESR1_CRCERR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_CRCERR_SHIFT)) & CAN_ESR1_CRCERR_MASK) - -#define CAN_ESR1_ACKERR_MASK (0x2000U) -#define CAN_ESR1_ACKERR_SHIFT (13U) -/*! ACKERR - Acknowledge Error Flag - * 0b0..No error - * 0b1..Error occurred since last read of this register. - */ -#define CAN_ESR1_ACKERR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_ACKERR_SHIFT)) & CAN_ESR1_ACKERR_MASK) - -#define CAN_ESR1_BIT0ERR_MASK (0x4000U) -#define CAN_ESR1_BIT0ERR_SHIFT (14U) -/*! BIT0ERR - Bit0 Error Flag - * 0b0..No such occurrence. - * 0b1..At least one bit sent as dominant is received as recessive. - */ -#define CAN_ESR1_BIT0ERR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_BIT0ERR_SHIFT)) & CAN_ESR1_BIT0ERR_MASK) - -#define CAN_ESR1_BIT1ERR_MASK (0x8000U) -#define CAN_ESR1_BIT1ERR_SHIFT (15U) -/*! BIT1ERR - Bit1 Error Flag - * 0b0..No such occurrence. - * 0b1..At least one bit sent as recessive is received as dominant. - */ -#define CAN_ESR1_BIT1ERR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_BIT1ERR_SHIFT)) & CAN_ESR1_BIT1ERR_MASK) - -#define CAN_ESR1_RWRNINT_MASK (0x10000U) -#define CAN_ESR1_RWRNINT_SHIFT (16U) -/*! RWRNINT - RX Warning Interrupt Flag - * 0b0..No such occurrence - * 0b1..RX error counter changed from less than 96 to greater than or equal to 96. - */ -#define CAN_ESR1_RWRNINT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_RWRNINT_SHIFT)) & CAN_ESR1_RWRNINT_MASK) - -#define CAN_ESR1_TWRNINT_MASK (0x20000U) -#define CAN_ESR1_TWRNINT_SHIFT (17U) -/*! TWRNINT - TX Warning Interrupt Flag - * 0b0..No such occurrence - * 0b1..TX error counter changed from less than 96 to greater than or equal to 96. - */ -#define CAN_ESR1_TWRNINT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_TWRNINT_SHIFT)) & CAN_ESR1_TWRNINT_MASK) - -#define CAN_ESR1_SYNCH_MASK (0x40000U) -#define CAN_ESR1_SYNCH_SHIFT (18U) -/*! SYNCH - CAN Synchronization Status Flag - * 0b0..Not synchronized - * 0b1..Synchronized - */ -#define CAN_ESR1_SYNCH(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_SYNCH_SHIFT)) & CAN_ESR1_SYNCH_MASK) - -#define CAN_ESR1_BOFFDONEINT_MASK (0x80000U) -#define CAN_ESR1_BOFFDONEINT_SHIFT (19U) -/*! BOFFDONEINT - Bus Off Done Interrupt Flag - * 0b0..No such occurrence - * 0b1..FlexCAN module has completed Bus Off process. - */ -#define CAN_ESR1_BOFFDONEINT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_BOFFDONEINT_SHIFT)) & CAN_ESR1_BOFFDONEINT_MASK) - -#define CAN_ESR1_ERRINT_FAST_MASK (0x100000U) -#define CAN_ESR1_ERRINT_FAST_SHIFT (20U) -/*! ERRINT_FAST - Fast Error Interrupt Flag - * 0b0..No such occurrence. - * 0b1..Error flag set in the data phase of CAN FD frames that have BRS = 1. - */ -#define CAN_ESR1_ERRINT_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_ERRINT_FAST_SHIFT)) & CAN_ESR1_ERRINT_FAST_MASK) - -#define CAN_ESR1_ERROVR_MASK (0x200000U) -#define CAN_ESR1_ERROVR_SHIFT (21U) -/*! ERROVR - Error Overrun Flag - * 0b0..No overrun - * 0b1..Overrun - */ -#define CAN_ESR1_ERROVR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_ERROVR_SHIFT)) & CAN_ESR1_ERROVR_MASK) - -#define CAN_ESR1_STFERR_FAST_MASK (0x4000000U) -#define CAN_ESR1_STFERR_FAST_SHIFT (26U) -/*! STFERR_FAST - Fast Stuffing Error Flag - * 0b0..No such occurrence. - * 0b1..A stuffing error occurred since last read of this register. - */ -#define CAN_ESR1_STFERR_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_STFERR_FAST_SHIFT)) & CAN_ESR1_STFERR_FAST_MASK) - -#define CAN_ESR1_FRMERR_FAST_MASK (0x8000000U) -#define CAN_ESR1_FRMERR_FAST_SHIFT (27U) -/*! FRMERR_FAST - Fast Form Error Flag - * 0b0..No such occurrence. - * 0b1..A form error occurred since last read of this register. - */ -#define CAN_ESR1_FRMERR_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_FRMERR_FAST_SHIFT)) & CAN_ESR1_FRMERR_FAST_MASK) - -#define CAN_ESR1_CRCERR_FAST_MASK (0x10000000U) -#define CAN_ESR1_CRCERR_FAST_SHIFT (28U) -/*! CRCERR_FAST - Fast Cyclic Redundancy Check Error Flag - * 0b0..No such occurrence. - * 0b1..A CRC error occurred since last read of this register. - */ -#define CAN_ESR1_CRCERR_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_CRCERR_FAST_SHIFT)) & CAN_ESR1_CRCERR_FAST_MASK) - -#define CAN_ESR1_BIT0ERR_FAST_MASK (0x40000000U) -#define CAN_ESR1_BIT0ERR_FAST_SHIFT (30U) -/*! BIT0ERR_FAST - Fast Bit0 Error Flag - * 0b0..No such occurrence. - * 0b1..At least one bit transmitted as dominant is received as recessive. - */ -#define CAN_ESR1_BIT0ERR_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_BIT0ERR_FAST_SHIFT)) & CAN_ESR1_BIT0ERR_FAST_MASK) - -#define CAN_ESR1_BIT1ERR_FAST_MASK (0x80000000U) -#define CAN_ESR1_BIT1ERR_FAST_SHIFT (31U) -/*! BIT1ERR_FAST - Fast Bit1 Error Flag - * 0b0..No such occurrence. - * 0b1..At least one bit transmitted as recessive is received as dominant. - */ -#define CAN_ESR1_BIT1ERR_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_BIT1ERR_FAST_SHIFT)) & CAN_ESR1_BIT1ERR_FAST_MASK) -/*! @} */ - -/*! @name IMASK1 - Interrupt Masks 1 */ -/*! @{ */ - -#define CAN_IMASK1_BUF31TO0M_MASK (0xFFFFFFFFU) -#define CAN_IMASK1_BUF31TO0M_SHIFT (0U) -/*! BUF31TO0M - Buffer MBi Mask */ -#define CAN_IMASK1_BUF31TO0M(x) (((uint32_t)(((uint32_t)(x)) << CAN_IMASK1_BUF31TO0M_SHIFT)) & CAN_IMASK1_BUF31TO0M_MASK) -/*! @} */ - -/*! @name IFLAG1 - Interrupt Flags 1 */ -/*! @{ */ - -#define CAN_IFLAG1_BUF0I_MASK (0x1U) -#define CAN_IFLAG1_BUF0I_SHIFT (0U) -/*! BUF0I - Buffer MB0 Interrupt or Clear Legacy FIFO bit - * 0b0..MB0 has no occurrence of successfully completed transmission or reception. - * 0b1..MB0 has successfully completed transmission or reception. - */ -#define CAN_IFLAG1_BUF0I(x) (((uint32_t)(((uint32_t)(x)) << CAN_IFLAG1_BUF0I_SHIFT)) & CAN_IFLAG1_BUF0I_MASK) - -#define CAN_IFLAG1_BUF4TO1I_MASK (0x1EU) -#define CAN_IFLAG1_BUF4TO1I_SHIFT (1U) -/*! BUF4TO1I - Buffer MBi Interrupt or Reserved */ -#define CAN_IFLAG1_BUF4TO1I(x) (((uint32_t)(((uint32_t)(x)) << CAN_IFLAG1_BUF4TO1I_SHIFT)) & CAN_IFLAG1_BUF4TO1I_MASK) - -#define CAN_IFLAG1_BUF5I_MASK (0x20U) -#define CAN_IFLAG1_BUF5I_SHIFT (5U) -/*! BUF5I - Buffer MB5 Interrupt or Frames available in Legacy RX FIFO - * 0b0..No occurrence of completed transmission or reception, or no frames available - * 0b1..MB5 completed transmission or reception, or frames available - */ -#define CAN_IFLAG1_BUF5I(x) (((uint32_t)(((uint32_t)(x)) << CAN_IFLAG1_BUF5I_SHIFT)) & CAN_IFLAG1_BUF5I_MASK) - -#define CAN_IFLAG1_BUF6I_MASK (0x40U) -#define CAN_IFLAG1_BUF6I_SHIFT (6U) -/*! BUF6I - Buffer MB6 Interrupt or Legacy RX FIFO Warning - * 0b0..No occurrence of MB6 completing transmission or reception, or FIFO not almost full. - * 0b1..MB6 completed transmission or reception, or FIFO almost full. - */ -#define CAN_IFLAG1_BUF6I(x) (((uint32_t)(((uint32_t)(x)) << CAN_IFLAG1_BUF6I_SHIFT)) & CAN_IFLAG1_BUF6I_MASK) - -#define CAN_IFLAG1_BUF7I_MASK (0x80U) -#define CAN_IFLAG1_BUF7I_SHIFT (7U) -/*! BUF7I - Buffer MB7 Interrupt or Legacy RX FIFO Overflow - * 0b0..No occurrence of MB7 completing transmission or reception, or no FIFO overflow. - * 0b1..MB7 completed transmission or reception, or FIFO overflow. - */ -#define CAN_IFLAG1_BUF7I(x) (((uint32_t)(((uint32_t)(x)) << CAN_IFLAG1_BUF7I_SHIFT)) & CAN_IFLAG1_BUF7I_MASK) - -#define CAN_IFLAG1_BUF31TO8I_MASK (0xFFFFFF00U) -#define CAN_IFLAG1_BUF31TO8I_SHIFT (8U) -/*! BUF31TO8I - Buffer MBi Interrupt */ -#define CAN_IFLAG1_BUF31TO8I(x) (((uint32_t)(((uint32_t)(x)) << CAN_IFLAG1_BUF31TO8I_SHIFT)) & CAN_IFLAG1_BUF31TO8I_MASK) -/*! @} */ - -/*! @name CTRL2 - Control 2 */ -/*! @{ */ - -#define CAN_CTRL2_EDFLTDIS_MASK (0x800U) -#define CAN_CTRL2_EDFLTDIS_SHIFT (11U) -/*! EDFLTDIS - Edge Filter Disable - * 0b0..Enabled - * 0b1..Disabled - */ -#define CAN_CTRL2_EDFLTDIS(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_EDFLTDIS_SHIFT)) & CAN_CTRL2_EDFLTDIS_MASK) - -#define CAN_CTRL2_ISOCANFDEN_MASK (0x1000U) -#define CAN_CTRL2_ISOCANFDEN_SHIFT (12U) -/*! ISOCANFDEN - ISO CAN FD Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL2_ISOCANFDEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_ISOCANFDEN_SHIFT)) & CAN_CTRL2_ISOCANFDEN_MASK) - -#define CAN_CTRL2_BTE_MASK (0x2000U) -#define CAN_CTRL2_BTE_SHIFT (13U) -/*! BTE - Bit Timing Expansion Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL2_BTE(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_BTE_SHIFT)) & CAN_CTRL2_BTE_MASK) - -#define CAN_CTRL2_PREXCEN_MASK (0x4000U) -#define CAN_CTRL2_PREXCEN_SHIFT (14U) -/*! PREXCEN - Protocol Exception Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define CAN_CTRL2_PREXCEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_PREXCEN_SHIFT)) & CAN_CTRL2_PREXCEN_MASK) - -#define CAN_CTRL2_EACEN_MASK (0x10000U) -#define CAN_CTRL2_EACEN_SHIFT (16U) -/*! EACEN - Entire Frame Arbitration Field Comparison Enable for RX Message Buffers - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL2_EACEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_EACEN_SHIFT)) & CAN_CTRL2_EACEN_MASK) - -#define CAN_CTRL2_RRS_MASK (0x20000U) -#define CAN_CTRL2_RRS_SHIFT (17U) -/*! RRS - Remote Request Storing - * 0b0..Generated - * 0b1..Stored - */ -#define CAN_CTRL2_RRS(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_RRS_SHIFT)) & CAN_CTRL2_RRS_MASK) - -#define CAN_CTRL2_MRP_MASK (0x40000U) -#define CAN_CTRL2_MRP_SHIFT (18U) -/*! MRP - Message Buffers Reception Priority - * 0b0..Matching starts from Legacy RX FIFO or Enhanced RX FIFO and continues on message buffers. - * 0b1..Matching starts from message buffers and continues on Legacy RX FIFO or Enhanced RX FIFO. - */ -#define CAN_CTRL2_MRP(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_MRP_SHIFT)) & CAN_CTRL2_MRP_MASK) - -#define CAN_CTRL2_TASD_MASK (0xF80000U) -#define CAN_CTRL2_TASD_SHIFT (19U) -/*! TASD - Transmission Arbitration Start Delay */ -#define CAN_CTRL2_TASD(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_TASD_SHIFT)) & CAN_CTRL2_TASD_MASK) - -#define CAN_CTRL2_RFFN_MASK (0xF000000U) -#define CAN_CTRL2_RFFN_SHIFT (24U) -/*! RFFN - Number of Legacy Receive FIFO Filters */ -#define CAN_CTRL2_RFFN(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_RFFN_SHIFT)) & CAN_CTRL2_RFFN_MASK) - -#define CAN_CTRL2_BOFFDONEMSK_MASK (0x40000000U) -#define CAN_CTRL2_BOFFDONEMSK_SHIFT (30U) -/*! BOFFDONEMSK - Bus Off Done Interrupt Mask - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL2_BOFFDONEMSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_BOFFDONEMSK_SHIFT)) & CAN_CTRL2_BOFFDONEMSK_MASK) - -#define CAN_CTRL2_ERRMSK_FAST_MASK (0x80000000U) -#define CAN_CTRL2_ERRMSK_FAST_SHIFT (31U) -/*! ERRMSK_FAST - Error Interrupt Mask for Errors Detected in the Data Phase of Fast CAN FD Frames - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL2_ERRMSK_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_ERRMSK_FAST_SHIFT)) & CAN_CTRL2_ERRMSK_FAST_MASK) -/*! @} */ - -/*! @name ESR2 - Error and Status 2 */ -/*! @{ */ - -#define CAN_ESR2_IMB_MASK (0x2000U) -#define CAN_ESR2_IMB_SHIFT (13U) -/*! IMB - Inactive Message Buffer - * 0b0..Message buffer indicated by ESR2[LPTM] is not inactive. - * 0b1..At least one message buffer is inactive. - */ -#define CAN_ESR2_IMB(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR2_IMB_SHIFT)) & CAN_ESR2_IMB_MASK) - -#define CAN_ESR2_VPS_MASK (0x4000U) -#define CAN_ESR2_VPS_SHIFT (14U) -/*! VPS - Valid Priority Status - * 0b0..Invalid - * 0b1..Valid - */ -#define CAN_ESR2_VPS(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR2_VPS_SHIFT)) & CAN_ESR2_VPS_MASK) - -#define CAN_ESR2_LPTM_MASK (0x7F0000U) -#define CAN_ESR2_LPTM_SHIFT (16U) -/*! LPTM - Lowest Priority TX Message Buffer */ -#define CAN_ESR2_LPTM(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR2_LPTM_SHIFT)) & CAN_ESR2_LPTM_MASK) -/*! @} */ - -/*! @name CRCR - Cyclic Redundancy Check */ -/*! @{ */ - -#define CAN_CRCR_TXCRC_MASK (0x7FFFU) -#define CAN_CRCR_TXCRC_SHIFT (0U) -/*! TXCRC - Transmitted CRC value */ -#define CAN_CRCR_TXCRC(x) (((uint32_t)(((uint32_t)(x)) << CAN_CRCR_TXCRC_SHIFT)) & CAN_CRCR_TXCRC_MASK) - -#define CAN_CRCR_MBCRC_MASK (0x7F0000U) -#define CAN_CRCR_MBCRC_SHIFT (16U) -/*! MBCRC - CRC Message Buffer */ -#define CAN_CRCR_MBCRC(x) (((uint32_t)(((uint32_t)(x)) << CAN_CRCR_MBCRC_SHIFT)) & CAN_CRCR_MBCRC_MASK) -/*! @} */ - -/*! @name RXFGMASK - Legacy RX FIFO Global Mask */ -/*! @{ */ - -#define CAN_RXFGMASK_FGM_MASK (0xFFFFFFFFU) -#define CAN_RXFGMASK_FGM_SHIFT (0U) -/*! FGM - Legacy RX FIFO Global Mask Bits */ -#define CAN_RXFGMASK_FGM(x) (((uint32_t)(((uint32_t)(x)) << CAN_RXFGMASK_FGM_SHIFT)) & CAN_RXFGMASK_FGM_MASK) -/*! @} */ - -/*! @name RXFIR - Legacy RX FIFO Information */ -/*! @{ */ - -#define CAN_RXFIR_IDHIT_MASK (0x1FFU) -#define CAN_RXFIR_IDHIT_SHIFT (0U) -/*! IDHIT - Identifier Acceptance Filter Hit Indicator */ -#define CAN_RXFIR_IDHIT(x) (((uint32_t)(((uint32_t)(x)) << CAN_RXFIR_IDHIT_SHIFT)) & CAN_RXFIR_IDHIT_MASK) -/*! @} */ - -/*! @name CBT - CAN Bit Timing */ -/*! @{ */ - -#define CAN_CBT_EPSEG2_MASK (0x1FU) -#define CAN_CBT_EPSEG2_SHIFT (0U) -/*! EPSEG2 - Extended Phase Segment 2 */ -#define CAN_CBT_EPSEG2(x) (((uint32_t)(((uint32_t)(x)) << CAN_CBT_EPSEG2_SHIFT)) & CAN_CBT_EPSEG2_MASK) - -#define CAN_CBT_EPSEG1_MASK (0x3E0U) -#define CAN_CBT_EPSEG1_SHIFT (5U) -/*! EPSEG1 - Extended Phase Segment 1 */ -#define CAN_CBT_EPSEG1(x) (((uint32_t)(((uint32_t)(x)) << CAN_CBT_EPSEG1_SHIFT)) & CAN_CBT_EPSEG1_MASK) - -#define CAN_CBT_EPROPSEG_MASK (0xFC00U) -#define CAN_CBT_EPROPSEG_SHIFT (10U) -/*! EPROPSEG - Extended Propagation Segment */ -#define CAN_CBT_EPROPSEG(x) (((uint32_t)(((uint32_t)(x)) << CAN_CBT_EPROPSEG_SHIFT)) & CAN_CBT_EPROPSEG_MASK) - -#define CAN_CBT_ERJW_MASK (0x1F0000U) -#define CAN_CBT_ERJW_SHIFT (16U) -/*! ERJW - Extended Resync Jump Width */ -#define CAN_CBT_ERJW(x) (((uint32_t)(((uint32_t)(x)) << CAN_CBT_ERJW_SHIFT)) & CAN_CBT_ERJW_MASK) - -#define CAN_CBT_EPRESDIV_MASK (0x7FE00000U) -#define CAN_CBT_EPRESDIV_SHIFT (21U) -/*! EPRESDIV - Extended Prescaler Division Factor */ -#define CAN_CBT_EPRESDIV(x) (((uint32_t)(((uint32_t)(x)) << CAN_CBT_EPRESDIV_SHIFT)) & CAN_CBT_EPRESDIV_MASK) - -#define CAN_CBT_BTF_MASK (0x80000000U) -#define CAN_CBT_BTF_SHIFT (31U) -/*! BTF - Bit Timing Format Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CBT_BTF(x) (((uint32_t)(((uint32_t)(x)) << CAN_CBT_BTF_SHIFT)) & CAN_CBT_BTF_MASK) -/*! @} */ - -/* The count of CAN_CS */ -#define CAN_CS_COUNT_MB8B (32U) - -/* The count of CAN_ID */ -#define CAN_ID_COUNT_MB8B (32U) - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB8B (32U) - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB8B2 (2U) - -/* The count of CAN_CS */ -#define CAN_CS_COUNT_MB16B (21U) - -/* The count of CAN_ID */ -#define CAN_ID_COUNT_MB16B (21U) - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB16B (21U) - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB16B2 (4U) - -/* The count of CAN_CS */ -#define CAN_CS_COUNT_MB32B (12U) - -/* The count of CAN_ID */ -#define CAN_ID_COUNT_MB32B (12U) - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB32B (12U) - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB32B2 (8U) - -/*! @name CS - Message Buffer 0 CS Register..Message Buffer 6 CS Register */ -/*! @{ */ - -#define CAN_CS_TIME_STAMP_MASK (0xFFFFU) -#define CAN_CS_TIME_STAMP_SHIFT (0U) -/*! TIME_STAMP - Free-Running Counter Time stamp. This 16-bit field is a copy of the Free-Running - * Timer, captured for Tx and Rx frames at the time when the beginning of the Identifier field - * appears on the CAN bus. - */ -#define CAN_CS_TIME_STAMP(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_TIME_STAMP_SHIFT)) & CAN_CS_TIME_STAMP_MASK) - -#define CAN_CS_DLC_MASK (0xF0000U) -#define CAN_CS_DLC_SHIFT (16U) -/*! DLC - Length of the data to be stored/transmitted. */ -#define CAN_CS_DLC(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_DLC_SHIFT)) & CAN_CS_DLC_MASK) - -#define CAN_CS_RTR_MASK (0x100000U) -#define CAN_CS_RTR_SHIFT (20U) -/*! RTR - Remote Transmission Request. One/zero for remote/data frame. */ -#define CAN_CS_RTR(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_RTR_SHIFT)) & CAN_CS_RTR_MASK) - -#define CAN_CS_IDE_MASK (0x200000U) -#define CAN_CS_IDE_SHIFT (21U) -/*! IDE - ID Extended. One/zero for extended/standard format frame. */ -#define CAN_CS_IDE(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_IDE_SHIFT)) & CAN_CS_IDE_MASK) - -#define CAN_CS_SRR_MASK (0x400000U) -#define CAN_CS_SRR_SHIFT (22U) -/*! SRR - Substitute Remote Request. Contains a fixed recessive bit. */ -#define CAN_CS_SRR(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_SRR_SHIFT)) & CAN_CS_SRR_MASK) - -#define CAN_CS_CODE_MASK (0xF000000U) -#define CAN_CS_CODE_SHIFT (24U) -/*! CODE - Message Buffer Code. This 4-bit field can be accessed (read or write) by the CPU and by - * the FlexCAN module itself, as part of the message buffer matching and arbitration process. - */ -#define CAN_CS_CODE(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_CODE_SHIFT)) & CAN_CS_CODE_MASK) - -#define CAN_CS_ESI_MASK (0x20000000U) -#define CAN_CS_ESI_SHIFT (29U) -/*! ESI - Error State Indicator. This bit indicates if the transmitting node is error active or error passive. */ -#define CAN_CS_ESI(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_ESI_SHIFT)) & CAN_CS_ESI_MASK) - -#define CAN_CS_BRS_MASK (0x40000000U) -#define CAN_CS_BRS_SHIFT (30U) -/*! BRS - Bit Rate Switch. This bit defines whether the bit rate is switched inside a CAN FD format frame. */ -#define CAN_CS_BRS(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_BRS_SHIFT)) & CAN_CS_BRS_MASK) - -#define CAN_CS_EDL_MASK (0x80000000U) -#define CAN_CS_EDL_SHIFT (31U) -/*! EDL - Extended Data Length. This bit distinguishes between CAN format and CAN FD format frames. - * The EDL bit must not be set for Message Buffers configured to RANSWER with code field 0b1010. - */ -#define CAN_CS_EDL(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_EDL_SHIFT)) & CAN_CS_EDL_MASK) -/*! @} */ - -/* The count of CAN_CS */ -#define CAN_CS_COUNT_MB64B (7U) - -/*! @name ID - Message Buffer 0 ID Register..Message Buffer 6 ID Register */ -/*! @{ */ - -#define CAN_ID_EXT_MASK (0x3FFFFU) -#define CAN_ID_EXT_SHIFT (0U) -/*! EXT - Contains extended (LOW word) identifier of message buffer. */ -#define CAN_ID_EXT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ID_EXT_SHIFT)) & CAN_ID_EXT_MASK) - -#define CAN_ID_STD_MASK (0x1FFC0000U) -#define CAN_ID_STD_SHIFT (18U) -/*! STD - Contains standard/extended (HIGH word) identifier of message buffer. */ -#define CAN_ID_STD(x) (((uint32_t)(((uint32_t)(x)) << CAN_ID_STD_SHIFT)) & CAN_ID_STD_MASK) - -#define CAN_ID_PRIO_MASK (0xE0000000U) -#define CAN_ID_PRIO_SHIFT (29U) -/*! PRIO - Local priority. This 3-bit fieldis only used when LPRIO_EN bit is set in MCR and it only - * makes sense for Tx buffers. These bits are not transmitted. They are appended to the regular - * ID to define the transmission priority. - */ -#define CAN_ID_PRIO(x) (((uint32_t)(((uint32_t)(x)) << CAN_ID_PRIO_SHIFT)) & CAN_ID_PRIO_MASK) -/*! @} */ - -/* The count of CAN_ID */ -#define CAN_ID_COUNT_MB64B (7U) - -/*! @name WORD - Message Buffer 0 WORD_64B Register..Message Buffer 6 WORD_64B Register */ -/*! @{ */ - -#define CAN_WORD_DATA_BYTE_3_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_3_SHIFT (0U) -/*! DATA_BYTE_3 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_3(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_3_SHIFT)) & CAN_WORD_DATA_BYTE_3_MASK) - -#define CAN_WORD_DATA_BYTE_7_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_7_SHIFT (0U) -/*! DATA_BYTE_7 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_7(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_7_SHIFT)) & CAN_WORD_DATA_BYTE_7_MASK) - -#define CAN_WORD_DATA_BYTE_11_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_11_SHIFT (0U) -/*! DATA_BYTE_11 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_11(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_11_SHIFT)) & CAN_WORD_DATA_BYTE_11_MASK) - -#define CAN_WORD_DATA_BYTE_15_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_15_SHIFT (0U) -/*! DATA_BYTE_15 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_15(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_15_SHIFT)) & CAN_WORD_DATA_BYTE_15_MASK) - -#define CAN_WORD_DATA_BYTE_19_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_19_SHIFT (0U) -/*! DATA_BYTE_19 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_19(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_19_SHIFT)) & CAN_WORD_DATA_BYTE_19_MASK) - -#define CAN_WORD_DATA_BYTE_23_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_23_SHIFT (0U) -/*! DATA_BYTE_23 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_23(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_23_SHIFT)) & CAN_WORD_DATA_BYTE_23_MASK) - -#define CAN_WORD_DATA_BYTE_27_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_27_SHIFT (0U) -/*! DATA_BYTE_27 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_27(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_27_SHIFT)) & CAN_WORD_DATA_BYTE_27_MASK) - -#define CAN_WORD_DATA_BYTE_31_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_31_SHIFT (0U) -/*! DATA_BYTE_31 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_31(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_31_SHIFT)) & CAN_WORD_DATA_BYTE_31_MASK) - -#define CAN_WORD_DATA_BYTE_35_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_35_SHIFT (0U) -/*! DATA_BYTE_35 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_35(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_35_SHIFT)) & CAN_WORD_DATA_BYTE_35_MASK) - -#define CAN_WORD_DATA_BYTE_39_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_39_SHIFT (0U) -/*! DATA_BYTE_39 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_39(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_39_SHIFT)) & CAN_WORD_DATA_BYTE_39_MASK) - -#define CAN_WORD_DATA_BYTE_43_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_43_SHIFT (0U) -/*! DATA_BYTE_43 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_43(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_43_SHIFT)) & CAN_WORD_DATA_BYTE_43_MASK) - -#define CAN_WORD_DATA_BYTE_47_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_47_SHIFT (0U) -/*! DATA_BYTE_47 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_47(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_47_SHIFT)) & CAN_WORD_DATA_BYTE_47_MASK) - -#define CAN_WORD_DATA_BYTE_51_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_51_SHIFT (0U) -/*! DATA_BYTE_51 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_51(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_51_SHIFT)) & CAN_WORD_DATA_BYTE_51_MASK) - -#define CAN_WORD_DATA_BYTE_55_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_55_SHIFT (0U) -/*! DATA_BYTE_55 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_55(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_55_SHIFT)) & CAN_WORD_DATA_BYTE_55_MASK) - -#define CAN_WORD_DATA_BYTE_59_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_59_SHIFT (0U) -/*! DATA_BYTE_59 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_59(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_59_SHIFT)) & CAN_WORD_DATA_BYTE_59_MASK) - -#define CAN_WORD_DATA_BYTE_63_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_63_SHIFT (0U) -/*! DATA_BYTE_63 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_63(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_63_SHIFT)) & CAN_WORD_DATA_BYTE_63_MASK) - -#define CAN_WORD_DATA_BYTE_2_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_2_SHIFT (8U) -/*! DATA_BYTE_2 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_2(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_2_SHIFT)) & CAN_WORD_DATA_BYTE_2_MASK) - -#define CAN_WORD_DATA_BYTE_6_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_6_SHIFT (8U) -/*! DATA_BYTE_6 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_6(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_6_SHIFT)) & CAN_WORD_DATA_BYTE_6_MASK) - -#define CAN_WORD_DATA_BYTE_10_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_10_SHIFT (8U) -/*! DATA_BYTE_10 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_10(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_10_SHIFT)) & CAN_WORD_DATA_BYTE_10_MASK) - -#define CAN_WORD_DATA_BYTE_14_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_14_SHIFT (8U) -/*! DATA_BYTE_14 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_14(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_14_SHIFT)) & CAN_WORD_DATA_BYTE_14_MASK) - -#define CAN_WORD_DATA_BYTE_18_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_18_SHIFT (8U) -/*! DATA_BYTE_18 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_18(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_18_SHIFT)) & CAN_WORD_DATA_BYTE_18_MASK) - -#define CAN_WORD_DATA_BYTE_22_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_22_SHIFT (8U) -/*! DATA_BYTE_22 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_22(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_22_SHIFT)) & CAN_WORD_DATA_BYTE_22_MASK) - -#define CAN_WORD_DATA_BYTE_26_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_26_SHIFT (8U) -/*! DATA_BYTE_26 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_26(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_26_SHIFT)) & CAN_WORD_DATA_BYTE_26_MASK) - -#define CAN_WORD_DATA_BYTE_30_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_30_SHIFT (8U) -/*! DATA_BYTE_30 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_30(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_30_SHIFT)) & CAN_WORD_DATA_BYTE_30_MASK) - -#define CAN_WORD_DATA_BYTE_34_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_34_SHIFT (8U) -/*! DATA_BYTE_34 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_34(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_34_SHIFT)) & CAN_WORD_DATA_BYTE_34_MASK) - -#define CAN_WORD_DATA_BYTE_38_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_38_SHIFT (8U) -/*! DATA_BYTE_38 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_38(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_38_SHIFT)) & CAN_WORD_DATA_BYTE_38_MASK) - -#define CAN_WORD_DATA_BYTE_42_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_42_SHIFT (8U) -/*! DATA_BYTE_42 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_42(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_42_SHIFT)) & CAN_WORD_DATA_BYTE_42_MASK) - -#define CAN_WORD_DATA_BYTE_46_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_46_SHIFT (8U) -/*! DATA_BYTE_46 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_46(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_46_SHIFT)) & CAN_WORD_DATA_BYTE_46_MASK) - -#define CAN_WORD_DATA_BYTE_50_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_50_SHIFT (8U) -/*! DATA_BYTE_50 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_50(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_50_SHIFT)) & CAN_WORD_DATA_BYTE_50_MASK) - -#define CAN_WORD_DATA_BYTE_54_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_54_SHIFT (8U) -/*! DATA_BYTE_54 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_54(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_54_SHIFT)) & CAN_WORD_DATA_BYTE_54_MASK) - -#define CAN_WORD_DATA_BYTE_58_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_58_SHIFT (8U) -/*! DATA_BYTE_58 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_58(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_58_SHIFT)) & CAN_WORD_DATA_BYTE_58_MASK) - -#define CAN_WORD_DATA_BYTE_62_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_62_SHIFT (8U) -/*! DATA_BYTE_62 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_62(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_62_SHIFT)) & CAN_WORD_DATA_BYTE_62_MASK) - -#define CAN_WORD_DATA_BYTE_1_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_1_SHIFT (16U) -/*! DATA_BYTE_1 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_1(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_1_SHIFT)) & CAN_WORD_DATA_BYTE_1_MASK) - -#define CAN_WORD_DATA_BYTE_5_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_5_SHIFT (16U) -/*! DATA_BYTE_5 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_5(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_5_SHIFT)) & CAN_WORD_DATA_BYTE_5_MASK) - -#define CAN_WORD_DATA_BYTE_9_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_9_SHIFT (16U) -/*! DATA_BYTE_9 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_9(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_9_SHIFT)) & CAN_WORD_DATA_BYTE_9_MASK) - -#define CAN_WORD_DATA_BYTE_13_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_13_SHIFT (16U) -/*! DATA_BYTE_13 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_13(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_13_SHIFT)) & CAN_WORD_DATA_BYTE_13_MASK) - -#define CAN_WORD_DATA_BYTE_17_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_17_SHIFT (16U) -/*! DATA_BYTE_17 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_17(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_17_SHIFT)) & CAN_WORD_DATA_BYTE_17_MASK) - -#define CAN_WORD_DATA_BYTE_21_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_21_SHIFT (16U) -/*! DATA_BYTE_21 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_21(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_21_SHIFT)) & CAN_WORD_DATA_BYTE_21_MASK) - -#define CAN_WORD_DATA_BYTE_25_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_25_SHIFT (16U) -/*! DATA_BYTE_25 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_25(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_25_SHIFT)) & CAN_WORD_DATA_BYTE_25_MASK) - -#define CAN_WORD_DATA_BYTE_29_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_29_SHIFT (16U) -/*! DATA_BYTE_29 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_29(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_29_SHIFT)) & CAN_WORD_DATA_BYTE_29_MASK) - -#define CAN_WORD_DATA_BYTE_33_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_33_SHIFT (16U) -/*! DATA_BYTE_33 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_33(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_33_SHIFT)) & CAN_WORD_DATA_BYTE_33_MASK) - -#define CAN_WORD_DATA_BYTE_37_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_37_SHIFT (16U) -/*! DATA_BYTE_37 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_37(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_37_SHIFT)) & CAN_WORD_DATA_BYTE_37_MASK) - -#define CAN_WORD_DATA_BYTE_41_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_41_SHIFT (16U) -/*! DATA_BYTE_41 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_41(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_41_SHIFT)) & CAN_WORD_DATA_BYTE_41_MASK) - -#define CAN_WORD_DATA_BYTE_45_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_45_SHIFT (16U) -/*! DATA_BYTE_45 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_45(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_45_SHIFT)) & CAN_WORD_DATA_BYTE_45_MASK) - -#define CAN_WORD_DATA_BYTE_49_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_49_SHIFT (16U) -/*! DATA_BYTE_49 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_49(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_49_SHIFT)) & CAN_WORD_DATA_BYTE_49_MASK) - -#define CAN_WORD_DATA_BYTE_53_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_53_SHIFT (16U) -/*! DATA_BYTE_53 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_53(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_53_SHIFT)) & CAN_WORD_DATA_BYTE_53_MASK) - -#define CAN_WORD_DATA_BYTE_57_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_57_SHIFT (16U) -/*! DATA_BYTE_57 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_57(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_57_SHIFT)) & CAN_WORD_DATA_BYTE_57_MASK) - -#define CAN_WORD_DATA_BYTE_61_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_61_SHIFT (16U) -/*! DATA_BYTE_61 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_61(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_61_SHIFT)) & CAN_WORD_DATA_BYTE_61_MASK) - -#define CAN_WORD_DATA_BYTE_0_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_0_SHIFT (24U) -/*! DATA_BYTE_0 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_0(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_0_SHIFT)) & CAN_WORD_DATA_BYTE_0_MASK) - -#define CAN_WORD_DATA_BYTE_4_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_4_SHIFT (24U) -/*! DATA_BYTE_4 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_4(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_4_SHIFT)) & CAN_WORD_DATA_BYTE_4_MASK) - -#define CAN_WORD_DATA_BYTE_8_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_8_SHIFT (24U) -/*! DATA_BYTE_8 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_8(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_8_SHIFT)) & CAN_WORD_DATA_BYTE_8_MASK) - -#define CAN_WORD_DATA_BYTE_12_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_12_SHIFT (24U) -/*! DATA_BYTE_12 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_12(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_12_SHIFT)) & CAN_WORD_DATA_BYTE_12_MASK) - -#define CAN_WORD_DATA_BYTE_16_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_16_SHIFT (24U) -/*! DATA_BYTE_16 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_16(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_16_SHIFT)) & CAN_WORD_DATA_BYTE_16_MASK) - -#define CAN_WORD_DATA_BYTE_20_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_20_SHIFT (24U) -/*! DATA_BYTE_20 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_20(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_20_SHIFT)) & CAN_WORD_DATA_BYTE_20_MASK) - -#define CAN_WORD_DATA_BYTE_24_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_24_SHIFT (24U) -/*! DATA_BYTE_24 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_24(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_24_SHIFT)) & CAN_WORD_DATA_BYTE_24_MASK) - -#define CAN_WORD_DATA_BYTE_28_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_28_SHIFT (24U) -/*! DATA_BYTE_28 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_28(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_28_SHIFT)) & CAN_WORD_DATA_BYTE_28_MASK) - -#define CAN_WORD_DATA_BYTE_32_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_32_SHIFT (24U) -/*! DATA_BYTE_32 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_32(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_32_SHIFT)) & CAN_WORD_DATA_BYTE_32_MASK) - -#define CAN_WORD_DATA_BYTE_36_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_36_SHIFT (24U) -/*! DATA_BYTE_36 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_36(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_36_SHIFT)) & CAN_WORD_DATA_BYTE_36_MASK) - -#define CAN_WORD_DATA_BYTE_40_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_40_SHIFT (24U) -/*! DATA_BYTE_40 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_40(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_40_SHIFT)) & CAN_WORD_DATA_BYTE_40_MASK) - -#define CAN_WORD_DATA_BYTE_44_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_44_SHIFT (24U) -/*! DATA_BYTE_44 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_44(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_44_SHIFT)) & CAN_WORD_DATA_BYTE_44_MASK) - -#define CAN_WORD_DATA_BYTE_48_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_48_SHIFT (24U) -/*! DATA_BYTE_48 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_48(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_48_SHIFT)) & CAN_WORD_DATA_BYTE_48_MASK) - -#define CAN_WORD_DATA_BYTE_52_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_52_SHIFT (24U) -/*! DATA_BYTE_52 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_52(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_52_SHIFT)) & CAN_WORD_DATA_BYTE_52_MASK) - -#define CAN_WORD_DATA_BYTE_56_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_56_SHIFT (24U) -/*! DATA_BYTE_56 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_56(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_56_SHIFT)) & CAN_WORD_DATA_BYTE_56_MASK) - -#define CAN_WORD_DATA_BYTE_60_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_60_SHIFT (24U) -/*! DATA_BYTE_60 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_60(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_60_SHIFT)) & CAN_WORD_DATA_BYTE_60_MASK) -/*! @} */ - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB64B (7U) - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB64B2 (16U) - -/* The count of CAN_CS */ -#define CAN_CS_COUNT (32U) - -/* The count of CAN_ID */ -#define CAN_ID_COUNT (32U) - -/*! @name WORD0 - Message Buffer 0 WORD0 Register..Message Buffer 31 WORD0 Register */ -/*! @{ */ - -#define CAN_WORD0_DATA_BYTE_3_MASK (0xFFU) -#define CAN_WORD0_DATA_BYTE_3_SHIFT (0U) -/*! DATA_BYTE_3 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD0_DATA_BYTE_3(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD0_DATA_BYTE_3_SHIFT)) & CAN_WORD0_DATA_BYTE_3_MASK) - -#define CAN_WORD0_DATA_BYTE_2_MASK (0xFF00U) -#define CAN_WORD0_DATA_BYTE_2_SHIFT (8U) -/*! DATA_BYTE_2 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD0_DATA_BYTE_2(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD0_DATA_BYTE_2_SHIFT)) & CAN_WORD0_DATA_BYTE_2_MASK) - -#define CAN_WORD0_DATA_BYTE_1_MASK (0xFF0000U) -#define CAN_WORD0_DATA_BYTE_1_SHIFT (16U) -/*! DATA_BYTE_1 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD0_DATA_BYTE_1(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD0_DATA_BYTE_1_SHIFT)) & CAN_WORD0_DATA_BYTE_1_MASK) - -#define CAN_WORD0_DATA_BYTE_0_MASK (0xFF000000U) -#define CAN_WORD0_DATA_BYTE_0_SHIFT (24U) -/*! DATA_BYTE_0 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD0_DATA_BYTE_0(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD0_DATA_BYTE_0_SHIFT)) & CAN_WORD0_DATA_BYTE_0_MASK) -/*! @} */ - -/* The count of CAN_WORD0 */ -#define CAN_WORD0_COUNT (32U) - -/*! @name WORD1 - Message Buffer 0 WORD1 Register..Message Buffer 31 WORD1 Register */ -/*! @{ */ - -#define CAN_WORD1_DATA_BYTE_7_MASK (0xFFU) -#define CAN_WORD1_DATA_BYTE_7_SHIFT (0U) -/*! DATA_BYTE_7 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD1_DATA_BYTE_7(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD1_DATA_BYTE_7_SHIFT)) & CAN_WORD1_DATA_BYTE_7_MASK) - -#define CAN_WORD1_DATA_BYTE_6_MASK (0xFF00U) -#define CAN_WORD1_DATA_BYTE_6_SHIFT (8U) -/*! DATA_BYTE_6 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD1_DATA_BYTE_6(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD1_DATA_BYTE_6_SHIFT)) & CAN_WORD1_DATA_BYTE_6_MASK) - -#define CAN_WORD1_DATA_BYTE_5_MASK (0xFF0000U) -#define CAN_WORD1_DATA_BYTE_5_SHIFT (16U) -/*! DATA_BYTE_5 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD1_DATA_BYTE_5(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD1_DATA_BYTE_5_SHIFT)) & CAN_WORD1_DATA_BYTE_5_MASK) - -#define CAN_WORD1_DATA_BYTE_4_MASK (0xFF000000U) -#define CAN_WORD1_DATA_BYTE_4_SHIFT (24U) -/*! DATA_BYTE_4 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD1_DATA_BYTE_4(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD1_DATA_BYTE_4_SHIFT)) & CAN_WORD1_DATA_BYTE_4_MASK) -/*! @} */ - -/* The count of CAN_WORD1 */ -#define CAN_WORD1_COUNT (32U) - -/*! @name RXIMR - Receive Individual Mask */ -/*! @{ */ - -#define CAN_RXIMR_MI_MASK (0xFFFFFFFFU) -#define CAN_RXIMR_MI_SHIFT (0U) -/*! MI - Individual Mask Bits */ -#define CAN_RXIMR_MI(x) (((uint32_t)(((uint32_t)(x)) << CAN_RXIMR_MI_SHIFT)) & CAN_RXIMR_MI_MASK) -/*! @} */ - -/* The count of CAN_RXIMR */ -#define CAN_RXIMR_COUNT (32U) - -/*! @name CTRL1_PN - Pretended Networking Control 1 */ -/*! @{ */ - -#define CAN_CTRL1_PN_FCS_MASK (0x3U) -#define CAN_CTRL1_PN_FCS_SHIFT (0U) -/*! FCS - Filtering Combination Selection - * 0b00..Message ID filtering only - * 0b01..Message ID filtering and payload filtering - * 0b10..Message ID filtering occurring a specified number of times - * 0b11..Message ID filtering and payload filtering a specified number of times - */ -#define CAN_CTRL1_PN_FCS(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PN_FCS_SHIFT)) & CAN_CTRL1_PN_FCS_MASK) - -#define CAN_CTRL1_PN_IDFS_MASK (0xCU) -#define CAN_CTRL1_PN_IDFS_SHIFT (2U) -/*! IDFS - ID Filtering Selection - * 0b00..Match ID contents to an exact target value - * 0b01..Match an ID value greater than or equal to a specified target value - * 0b10..Match an ID value smaller than or equal to a specified target value - * 0b11..Match an ID value within a range of values, inclusive - */ -#define CAN_CTRL1_PN_IDFS(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PN_IDFS_SHIFT)) & CAN_CTRL1_PN_IDFS_MASK) - -#define CAN_CTRL1_PN_PLFS_MASK (0x30U) -#define CAN_CTRL1_PN_PLFS_SHIFT (4U) -/*! PLFS - Payload Filtering Selection - * 0b00..Match payload contents to an exact target value - * 0b01..Match a payload value greater than or equal to a specified target value - * 0b10..Match a payload value smaller than or equal to a specified target value - * 0b11..Match upon a payload value within a range of values, inclusive - */ -#define CAN_CTRL1_PN_PLFS(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PN_PLFS_SHIFT)) & CAN_CTRL1_PN_PLFS_MASK) - -#define CAN_CTRL1_PN_NMATCH_MASK (0xFF00U) -#define CAN_CTRL1_PN_NMATCH_SHIFT (8U) -/*! NMATCH - Number of Messages Matching the Same Filtering Criteria - * 0b00000001..Once - * 0b00000010..Twice - * 0b11111111..255 times - */ -#define CAN_CTRL1_PN_NMATCH(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PN_NMATCH_SHIFT)) & CAN_CTRL1_PN_NMATCH_MASK) - -#define CAN_CTRL1_PN_WUMF_MSK_MASK (0x10000U) -#define CAN_CTRL1_PN_WUMF_MSK_SHIFT (16U) -/*! WUMF_MSK - Wake-up by Matching Flag Mask - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL1_PN_WUMF_MSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PN_WUMF_MSK_SHIFT)) & CAN_CTRL1_PN_WUMF_MSK_MASK) - -#define CAN_CTRL1_PN_WTOF_MSK_MASK (0x20000U) -#define CAN_CTRL1_PN_WTOF_MSK_SHIFT (17U) -/*! WTOF_MSK - Wake-up by Timeout Flag Mask - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL1_PN_WTOF_MSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PN_WTOF_MSK_SHIFT)) & CAN_CTRL1_PN_WTOF_MSK_MASK) -/*! @} */ - -/*! @name CTRL2_PN - Pretended Networking Control 2 */ -/*! @{ */ - -#define CAN_CTRL2_PN_MATCHTO_MASK (0xFFFFU) -#define CAN_CTRL2_PN_MATCHTO_SHIFT (0U) -/*! MATCHTO - Timeout for No Message Matching the Filtering Criteria */ -#define CAN_CTRL2_PN_MATCHTO(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_PN_MATCHTO_SHIFT)) & CAN_CTRL2_PN_MATCHTO_MASK) -/*! @} */ - -/*! @name WU_MTC - Pretended Networking Wake-Up Match */ -/*! @{ */ - -#define CAN_WU_MTC_MCOUNTER_MASK (0xFF00U) -#define CAN_WU_MTC_MCOUNTER_SHIFT (8U) -/*! MCOUNTER - Number of Matches in Pretended Networking */ -#define CAN_WU_MTC_MCOUNTER(x) (((uint32_t)(((uint32_t)(x)) << CAN_WU_MTC_MCOUNTER_SHIFT)) & CAN_WU_MTC_MCOUNTER_MASK) - -#define CAN_WU_MTC_WUMF_MASK (0x10000U) -#define CAN_WU_MTC_WUMF_SHIFT (16U) -/*! WUMF - Wake-up by Match Flag - * 0b0..No event detected - * 0b1..Event detected - */ -#define CAN_WU_MTC_WUMF(x) (((uint32_t)(((uint32_t)(x)) << CAN_WU_MTC_WUMF_SHIFT)) & CAN_WU_MTC_WUMF_MASK) - -#define CAN_WU_MTC_WTOF_MASK (0x20000U) -#define CAN_WU_MTC_WTOF_SHIFT (17U) -/*! WTOF - Wake-up by Timeout Flag Bit - * 0b0..No event detected - * 0b1..Event detected - */ -#define CAN_WU_MTC_WTOF(x) (((uint32_t)(((uint32_t)(x)) << CAN_WU_MTC_WTOF_SHIFT)) & CAN_WU_MTC_WTOF_MASK) -/*! @} */ - -/*! @name FLT_ID1 - Pretended Networking ID Filter 1 */ -/*! @{ */ - -#define CAN_FLT_ID1_FLT_ID1_MASK (0x1FFFFFFFU) -#define CAN_FLT_ID1_FLT_ID1_SHIFT (0U) -/*! FLT_ID1 - ID Filter 1 for Pretended Networking filtering */ -#define CAN_FLT_ID1_FLT_ID1(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_ID1_FLT_ID1_SHIFT)) & CAN_FLT_ID1_FLT_ID1_MASK) - -#define CAN_FLT_ID1_FLT_RTR_MASK (0x20000000U) -#define CAN_FLT_ID1_FLT_RTR_SHIFT (29U) -/*! FLT_RTR - Remote Transmission Request Filter - * 0b0..Reject remote frame (accept data frame) - * 0b1..Accept remote frame - */ -#define CAN_FLT_ID1_FLT_RTR(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_ID1_FLT_RTR_SHIFT)) & CAN_FLT_ID1_FLT_RTR_MASK) - -#define CAN_FLT_ID1_FLT_IDE_MASK (0x40000000U) -#define CAN_FLT_ID1_FLT_IDE_SHIFT (30U) -/*! FLT_IDE - ID Extended Filter - * 0b0..Standard - * 0b1..Extended - */ -#define CAN_FLT_ID1_FLT_IDE(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_ID1_FLT_IDE_SHIFT)) & CAN_FLT_ID1_FLT_IDE_MASK) -/*! @} */ - -/*! @name FLT_DLC - Pretended Networking Data Length Code (DLC) Filter */ -/*! @{ */ - -#define CAN_FLT_DLC_FLT_DLC_HI_MASK (0xFU) -#define CAN_FLT_DLC_FLT_DLC_HI_SHIFT (0U) -/*! FLT_DLC_HI - Upper Limit for Length of Data Bytes Filter */ -#define CAN_FLT_DLC_FLT_DLC_HI(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_DLC_FLT_DLC_HI_SHIFT)) & CAN_FLT_DLC_FLT_DLC_HI_MASK) - -#define CAN_FLT_DLC_FLT_DLC_LO_MASK (0xF0000U) -#define CAN_FLT_DLC_FLT_DLC_LO_SHIFT (16U) -/*! FLT_DLC_LO - Lower Limit for Length of Data Bytes Filter */ -#define CAN_FLT_DLC_FLT_DLC_LO(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_DLC_FLT_DLC_LO_SHIFT)) & CAN_FLT_DLC_FLT_DLC_LO_MASK) -/*! @} */ - -/*! @name PL1_LO - Pretended Networking Payload Low Filter 1 */ -/*! @{ */ - -#define CAN_PL1_LO_Data_byte_3_MASK (0xFFU) -#define CAN_PL1_LO_Data_byte_3_SHIFT (0U) -/*! Data_byte_3 - Data byte 3 */ -#define CAN_PL1_LO_Data_byte_3(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_LO_Data_byte_3_SHIFT)) & CAN_PL1_LO_Data_byte_3_MASK) - -#define CAN_PL1_LO_Data_byte_2_MASK (0xFF00U) -#define CAN_PL1_LO_Data_byte_2_SHIFT (8U) -/*! Data_byte_2 - Data byte 2 */ -#define CAN_PL1_LO_Data_byte_2(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_LO_Data_byte_2_SHIFT)) & CAN_PL1_LO_Data_byte_2_MASK) - -#define CAN_PL1_LO_Data_byte_1_MASK (0xFF0000U) -#define CAN_PL1_LO_Data_byte_1_SHIFT (16U) -/*! Data_byte_1 - Data byte 1 */ -#define CAN_PL1_LO_Data_byte_1(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_LO_Data_byte_1_SHIFT)) & CAN_PL1_LO_Data_byte_1_MASK) - -#define CAN_PL1_LO_Data_byte_0_MASK (0xFF000000U) -#define CAN_PL1_LO_Data_byte_0_SHIFT (24U) -/*! Data_byte_0 - Data byte 0 */ -#define CAN_PL1_LO_Data_byte_0(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_LO_Data_byte_0_SHIFT)) & CAN_PL1_LO_Data_byte_0_MASK) -/*! @} */ - -/*! @name PL1_HI - Pretended Networking Payload High Filter 1 */ -/*! @{ */ - -#define CAN_PL1_HI_Data_byte_7_MASK (0xFFU) -#define CAN_PL1_HI_Data_byte_7_SHIFT (0U) -/*! Data_byte_7 - Data byte 7 */ -#define CAN_PL1_HI_Data_byte_7(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_HI_Data_byte_7_SHIFT)) & CAN_PL1_HI_Data_byte_7_MASK) - -#define CAN_PL1_HI_Data_byte_6_MASK (0xFF00U) -#define CAN_PL1_HI_Data_byte_6_SHIFT (8U) -/*! Data_byte_6 - Data byte 6 */ -#define CAN_PL1_HI_Data_byte_6(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_HI_Data_byte_6_SHIFT)) & CAN_PL1_HI_Data_byte_6_MASK) - -#define CAN_PL1_HI_Data_byte_5_MASK (0xFF0000U) -#define CAN_PL1_HI_Data_byte_5_SHIFT (16U) -/*! Data_byte_5 - Data byte 5 */ -#define CAN_PL1_HI_Data_byte_5(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_HI_Data_byte_5_SHIFT)) & CAN_PL1_HI_Data_byte_5_MASK) - -#define CAN_PL1_HI_Data_byte_4_MASK (0xFF000000U) -#define CAN_PL1_HI_Data_byte_4_SHIFT (24U) -/*! Data_byte_4 - Data byte 4 */ -#define CAN_PL1_HI_Data_byte_4(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_HI_Data_byte_4_SHIFT)) & CAN_PL1_HI_Data_byte_4_MASK) -/*! @} */ - -/*! @name FLT_ID2_IDMASK - Pretended Networking ID Filter 2 or ID Mask */ -/*! @{ */ - -#define CAN_FLT_ID2_IDMASK_FLT_ID2_IDMASK_MASK (0x1FFFFFFFU) -#define CAN_FLT_ID2_IDMASK_FLT_ID2_IDMASK_SHIFT (0U) -/*! FLT_ID2_IDMASK - ID Filter 2 for Pretended Networking Filtering or ID Mask Bits for Pretended Networking ID Filtering */ -#define CAN_FLT_ID2_IDMASK_FLT_ID2_IDMASK(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_ID2_IDMASK_FLT_ID2_IDMASK_SHIFT)) & CAN_FLT_ID2_IDMASK_FLT_ID2_IDMASK_MASK) - -#define CAN_FLT_ID2_IDMASK_RTR_MSK_MASK (0x20000000U) -#define CAN_FLT_ID2_IDMASK_RTR_MSK_SHIFT (29U) -/*! RTR_MSK - Remote Transmission Request Mask - * 0b0..The corresponding bit in the filter is "don't care." - * 0b1..The corresponding bit in the filter is checked. - */ -#define CAN_FLT_ID2_IDMASK_RTR_MSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_ID2_IDMASK_RTR_MSK_SHIFT)) & CAN_FLT_ID2_IDMASK_RTR_MSK_MASK) - -#define CAN_FLT_ID2_IDMASK_IDE_MSK_MASK (0x40000000U) -#define CAN_FLT_ID2_IDMASK_IDE_MSK_SHIFT (30U) -/*! IDE_MSK - ID Extended Mask - * 0b0..The corresponding bit in the filter is "don't care." - * 0b1..The corresponding bit in the filter is checked. - */ -#define CAN_FLT_ID2_IDMASK_IDE_MSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_ID2_IDMASK_IDE_MSK_SHIFT)) & CAN_FLT_ID2_IDMASK_IDE_MSK_MASK) -/*! @} */ - -/*! @name PL2_PLMASK_LO - Pretended Networking Payload Low Filter 2 and Payload Low Mask */ -/*! @{ */ - -#define CAN_PL2_PLMASK_LO_Data_byte_3_MASK (0xFFU) -#define CAN_PL2_PLMASK_LO_Data_byte_3_SHIFT (0U) -/*! Data_byte_3 - Data Byte 3 */ -#define CAN_PL2_PLMASK_LO_Data_byte_3(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_LO_Data_byte_3_SHIFT)) & CAN_PL2_PLMASK_LO_Data_byte_3_MASK) - -#define CAN_PL2_PLMASK_LO_Data_byte_2_MASK (0xFF00U) -#define CAN_PL2_PLMASK_LO_Data_byte_2_SHIFT (8U) -/*! Data_byte_2 - Data Byte 2 */ -#define CAN_PL2_PLMASK_LO_Data_byte_2(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_LO_Data_byte_2_SHIFT)) & CAN_PL2_PLMASK_LO_Data_byte_2_MASK) - -#define CAN_PL2_PLMASK_LO_Data_byte_1_MASK (0xFF0000U) -#define CAN_PL2_PLMASK_LO_Data_byte_1_SHIFT (16U) -/*! Data_byte_1 - Data Byte 1 */ -#define CAN_PL2_PLMASK_LO_Data_byte_1(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_LO_Data_byte_1_SHIFT)) & CAN_PL2_PLMASK_LO_Data_byte_1_MASK) - -#define CAN_PL2_PLMASK_LO_Data_byte_0_MASK (0xFF000000U) -#define CAN_PL2_PLMASK_LO_Data_byte_0_SHIFT (24U) -/*! Data_byte_0 - Data Byte 0 */ -#define CAN_PL2_PLMASK_LO_Data_byte_0(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_LO_Data_byte_0_SHIFT)) & CAN_PL2_PLMASK_LO_Data_byte_0_MASK) -/*! @} */ - -/*! @name PL2_PLMASK_HI - Pretended Networking Payload High Filter 2 and Payload High Mask */ -/*! @{ */ - -#define CAN_PL2_PLMASK_HI_Data_byte_7_MASK (0xFFU) -#define CAN_PL2_PLMASK_HI_Data_byte_7_SHIFT (0U) -/*! Data_byte_7 - Data Byte 7 */ -#define CAN_PL2_PLMASK_HI_Data_byte_7(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_HI_Data_byte_7_SHIFT)) & CAN_PL2_PLMASK_HI_Data_byte_7_MASK) - -#define CAN_PL2_PLMASK_HI_Data_byte_6_MASK (0xFF00U) -#define CAN_PL2_PLMASK_HI_Data_byte_6_SHIFT (8U) -/*! Data_byte_6 - Data Byte 6 */ -#define CAN_PL2_PLMASK_HI_Data_byte_6(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_HI_Data_byte_6_SHIFT)) & CAN_PL2_PLMASK_HI_Data_byte_6_MASK) - -#define CAN_PL2_PLMASK_HI_Data_byte_5_MASK (0xFF0000U) -#define CAN_PL2_PLMASK_HI_Data_byte_5_SHIFT (16U) -/*! Data_byte_5 - Data Byte 5 */ -#define CAN_PL2_PLMASK_HI_Data_byte_5(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_HI_Data_byte_5_SHIFT)) & CAN_PL2_PLMASK_HI_Data_byte_5_MASK) - -#define CAN_PL2_PLMASK_HI_Data_byte_4_MASK (0xFF000000U) -#define CAN_PL2_PLMASK_HI_Data_byte_4_SHIFT (24U) -/*! Data_byte_4 - Data Byte 4 */ -#define CAN_PL2_PLMASK_HI_Data_byte_4(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_HI_Data_byte_4_SHIFT)) & CAN_PL2_PLMASK_HI_Data_byte_4_MASK) -/*! @} */ - -/*! @name WMB_CS - Wake-Up Message Buffer */ -/*! @{ */ - -#define CAN_WMB_CS_DLC_MASK (0xF0000U) -#define CAN_WMB_CS_DLC_SHIFT (16U) -/*! DLC - Length of Data in Bytes */ -#define CAN_WMB_CS_DLC(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_CS_DLC_SHIFT)) & CAN_WMB_CS_DLC_MASK) - -#define CAN_WMB_CS_RTR_MASK (0x100000U) -#define CAN_WMB_CS_RTR_SHIFT (20U) -/*! RTR - Remote Transmission Request - * 0b0..Data - * 0b1..Remote - */ -#define CAN_WMB_CS_RTR(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_CS_RTR_SHIFT)) & CAN_WMB_CS_RTR_MASK) - -#define CAN_WMB_CS_IDE_MASK (0x200000U) -#define CAN_WMB_CS_IDE_SHIFT (21U) -/*! IDE - ID Extended Bit - * 0b0..Standard - * 0b1..Extended - */ -#define CAN_WMB_CS_IDE(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_CS_IDE_SHIFT)) & CAN_WMB_CS_IDE_MASK) - -#define CAN_WMB_CS_SRR_MASK (0x400000U) -#define CAN_WMB_CS_SRR_SHIFT (22U) -/*! SRR - Substitute Remote Request - * 0b0..Dominant - * 0b1..Recessive - */ -#define CAN_WMB_CS_SRR(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_CS_SRR_SHIFT)) & CAN_WMB_CS_SRR_MASK) -/*! @} */ - -/* The count of CAN_WMB_CS */ -#define CAN_WMB_CS_COUNT (4U) - -/*! @name WMB_ID - Wake-Up Message Buffer for ID */ -/*! @{ */ - -#define CAN_WMB_ID_ID_MASK (0x1FFFFFFFU) -#define CAN_WMB_ID_ID_SHIFT (0U) -/*! ID - Received ID in Pretended Networking Mode */ -#define CAN_WMB_ID_ID(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_ID_ID_SHIFT)) & CAN_WMB_ID_ID_MASK) -/*! @} */ - -/* The count of CAN_WMB_ID */ -#define CAN_WMB_ID_COUNT (4U) - -/*! @name WMB_D03 - Wake-Up Message Buffer for Data 0-3 */ -/*! @{ */ - -#define CAN_WMB_D03_Data_byte_3_MASK (0xFFU) -#define CAN_WMB_D03_Data_byte_3_SHIFT (0U) -/*! Data_byte_3 - Data Byte 3 */ -#define CAN_WMB_D03_Data_byte_3(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D03_Data_byte_3_SHIFT)) & CAN_WMB_D03_Data_byte_3_MASK) - -#define CAN_WMB_D03_Data_byte_2_MASK (0xFF00U) -#define CAN_WMB_D03_Data_byte_2_SHIFT (8U) -/*! Data_byte_2 - Data Byte 2 */ -#define CAN_WMB_D03_Data_byte_2(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D03_Data_byte_2_SHIFT)) & CAN_WMB_D03_Data_byte_2_MASK) - -#define CAN_WMB_D03_Data_byte_1_MASK (0xFF0000U) -#define CAN_WMB_D03_Data_byte_1_SHIFT (16U) -/*! Data_byte_1 - Data Byte 1 */ -#define CAN_WMB_D03_Data_byte_1(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D03_Data_byte_1_SHIFT)) & CAN_WMB_D03_Data_byte_1_MASK) - -#define CAN_WMB_D03_Data_byte_0_MASK (0xFF000000U) -#define CAN_WMB_D03_Data_byte_0_SHIFT (24U) -/*! Data_byte_0 - Data Byte 0 */ -#define CAN_WMB_D03_Data_byte_0(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D03_Data_byte_0_SHIFT)) & CAN_WMB_D03_Data_byte_0_MASK) -/*! @} */ - -/* The count of CAN_WMB_D03 */ -#define CAN_WMB_D03_COUNT (4U) - -/*! @name WMB_D47 - Wake-Up Message Buffer Register Data 4-7 */ -/*! @{ */ - -#define CAN_WMB_D47_Data_byte_7_MASK (0xFFU) -#define CAN_WMB_D47_Data_byte_7_SHIFT (0U) -/*! Data_byte_7 - Data Byte 7 */ -#define CAN_WMB_D47_Data_byte_7(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D47_Data_byte_7_SHIFT)) & CAN_WMB_D47_Data_byte_7_MASK) - -#define CAN_WMB_D47_Data_byte_6_MASK (0xFF00U) -#define CAN_WMB_D47_Data_byte_6_SHIFT (8U) -/*! Data_byte_6 - Data Byte 6 */ -#define CAN_WMB_D47_Data_byte_6(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D47_Data_byte_6_SHIFT)) & CAN_WMB_D47_Data_byte_6_MASK) - -#define CAN_WMB_D47_Data_byte_5_MASK (0xFF0000U) -#define CAN_WMB_D47_Data_byte_5_SHIFT (16U) -/*! Data_byte_5 - Data Byte 5 */ -#define CAN_WMB_D47_Data_byte_5(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D47_Data_byte_5_SHIFT)) & CAN_WMB_D47_Data_byte_5_MASK) - -#define CAN_WMB_D47_Data_byte_4_MASK (0xFF000000U) -#define CAN_WMB_D47_Data_byte_4_SHIFT (24U) -/*! Data_byte_4 - Data Byte 4 */ -#define CAN_WMB_D47_Data_byte_4(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D47_Data_byte_4_SHIFT)) & CAN_WMB_D47_Data_byte_4_MASK) -/*! @} */ - -/* The count of CAN_WMB_D47 */ -#define CAN_WMB_D47_COUNT (4U) - -/*! @name EPRS - Enhanced CAN Bit Timing Prescalers */ -/*! @{ */ - -#define CAN_EPRS_ENPRESDIV_MASK (0x3FFU) -#define CAN_EPRS_ENPRESDIV_SHIFT (0U) -/*! ENPRESDIV - Extended Nominal Prescaler Division Factor */ -#define CAN_EPRS_ENPRESDIV(x) (((uint32_t)(((uint32_t)(x)) << CAN_EPRS_ENPRESDIV_SHIFT)) & CAN_EPRS_ENPRESDIV_MASK) - -#define CAN_EPRS_EDPRESDIV_MASK (0x3FF0000U) -#define CAN_EPRS_EDPRESDIV_SHIFT (16U) -/*! EDPRESDIV - Extended Data Phase Prescaler Division Factor */ -#define CAN_EPRS_EDPRESDIV(x) (((uint32_t)(((uint32_t)(x)) << CAN_EPRS_EDPRESDIV_SHIFT)) & CAN_EPRS_EDPRESDIV_MASK) -/*! @} */ - -/*! @name ENCBT - Enhanced Nominal CAN Bit Timing */ -/*! @{ */ - -#define CAN_ENCBT_NTSEG1_MASK (0xFFU) -#define CAN_ENCBT_NTSEG1_SHIFT (0U) -/*! NTSEG1 - Nominal Time Segment 1 */ -#define CAN_ENCBT_NTSEG1(x) (((uint32_t)(((uint32_t)(x)) << CAN_ENCBT_NTSEG1_SHIFT)) & CAN_ENCBT_NTSEG1_MASK) - -#define CAN_ENCBT_NTSEG2_MASK (0x7F000U) -#define CAN_ENCBT_NTSEG2_SHIFT (12U) -/*! NTSEG2 - Nominal Time Segment 2 */ -#define CAN_ENCBT_NTSEG2(x) (((uint32_t)(((uint32_t)(x)) << CAN_ENCBT_NTSEG2_SHIFT)) & CAN_ENCBT_NTSEG2_MASK) - -#define CAN_ENCBT_NRJW_MASK (0x1FC00000U) -#define CAN_ENCBT_NRJW_SHIFT (22U) -/*! NRJW - Nominal Resynchronization Jump Width */ -#define CAN_ENCBT_NRJW(x) (((uint32_t)(((uint32_t)(x)) << CAN_ENCBT_NRJW_SHIFT)) & CAN_ENCBT_NRJW_MASK) -/*! @} */ - -/*! @name EDCBT - Enhanced Data Phase CAN Bit Timing */ -/*! @{ */ - -#define CAN_EDCBT_DTSEG1_MASK (0x1FU) -#define CAN_EDCBT_DTSEG1_SHIFT (0U) -/*! DTSEG1 - Data Phase Segment 1 */ -#define CAN_EDCBT_DTSEG1(x) (((uint32_t)(((uint32_t)(x)) << CAN_EDCBT_DTSEG1_SHIFT)) & CAN_EDCBT_DTSEG1_MASK) - -#define CAN_EDCBT_DTSEG2_MASK (0xF000U) -#define CAN_EDCBT_DTSEG2_SHIFT (12U) -/*! DTSEG2 - Data Phase Time Segment 2 */ -#define CAN_EDCBT_DTSEG2(x) (((uint32_t)(((uint32_t)(x)) << CAN_EDCBT_DTSEG2_SHIFT)) & CAN_EDCBT_DTSEG2_MASK) - -#define CAN_EDCBT_DRJW_MASK (0x3C00000U) -#define CAN_EDCBT_DRJW_SHIFT (22U) -/*! DRJW - Data Phase Resynchronization Jump Width */ -#define CAN_EDCBT_DRJW(x) (((uint32_t)(((uint32_t)(x)) << CAN_EDCBT_DRJW_SHIFT)) & CAN_EDCBT_DRJW_MASK) -/*! @} */ - -/*! @name ETDC - Enhanced Transceiver Delay Compensation */ -/*! @{ */ - -#define CAN_ETDC_ETDCVAL_MASK (0xFFU) -#define CAN_ETDC_ETDCVAL_SHIFT (0U) -/*! ETDCVAL - Enhanced Transceiver Delay Compensation Value */ -#define CAN_ETDC_ETDCVAL(x) (((uint32_t)(((uint32_t)(x)) << CAN_ETDC_ETDCVAL_SHIFT)) & CAN_ETDC_ETDCVAL_MASK) - -#define CAN_ETDC_ETDCFAIL_MASK (0x8000U) -#define CAN_ETDC_ETDCFAIL_SHIFT (15U) -/*! ETDCFAIL - Transceiver Delay Compensation Fail - * 0b0..In range - * 0b1..Out of range - */ -#define CAN_ETDC_ETDCFAIL(x) (((uint32_t)(((uint32_t)(x)) << CAN_ETDC_ETDCFAIL_SHIFT)) & CAN_ETDC_ETDCFAIL_MASK) - -#define CAN_ETDC_ETDCOFF_MASK (0x7F0000U) -#define CAN_ETDC_ETDCOFF_SHIFT (16U) -/*! ETDCOFF - Enhanced Transceiver Delay Compensation Offset */ -#define CAN_ETDC_ETDCOFF(x) (((uint32_t)(((uint32_t)(x)) << CAN_ETDC_ETDCOFF_SHIFT)) & CAN_ETDC_ETDCOFF_MASK) - -#define CAN_ETDC_TDMDIS_MASK (0x40000000U) -#define CAN_ETDC_TDMDIS_SHIFT (30U) -/*! TDMDIS - Transceiver Delay Measurement Disable - * 0b0..Enable - * 0b1..Disable - */ -#define CAN_ETDC_TDMDIS(x) (((uint32_t)(((uint32_t)(x)) << CAN_ETDC_TDMDIS_SHIFT)) & CAN_ETDC_TDMDIS_MASK) - -#define CAN_ETDC_ETDCEN_MASK (0x80000000U) -#define CAN_ETDC_ETDCEN_SHIFT (31U) -/*! ETDCEN - Transceiver Delay Compensation Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_ETDC_ETDCEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_ETDC_ETDCEN_SHIFT)) & CAN_ETDC_ETDCEN_MASK) -/*! @} */ - -/*! @name FDCTRL - CAN FD Control */ -/*! @{ */ - -#define CAN_FDCTRL_TDCVAL_MASK (0x3FU) -#define CAN_FDCTRL_TDCVAL_SHIFT (0U) -/*! TDCVAL - Transceiver Delay Compensation Value */ -#define CAN_FDCTRL_TDCVAL(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCTRL_TDCVAL_SHIFT)) & CAN_FDCTRL_TDCVAL_MASK) - -#define CAN_FDCTRL_TDCOFF_MASK (0x1F00U) -#define CAN_FDCTRL_TDCOFF_SHIFT (8U) -/*! TDCOFF - Transceiver Delay Compensation Offset */ -#define CAN_FDCTRL_TDCOFF(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCTRL_TDCOFF_SHIFT)) & CAN_FDCTRL_TDCOFF_MASK) - -#define CAN_FDCTRL_TDCFAIL_MASK (0x4000U) -#define CAN_FDCTRL_TDCFAIL_SHIFT (14U) -/*! TDCFAIL - Transceiver Delay Compensation Fail - * 0b0..In range - * 0b1..Out of range - */ -#define CAN_FDCTRL_TDCFAIL(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCTRL_TDCFAIL_SHIFT)) & CAN_FDCTRL_TDCFAIL_MASK) - -#define CAN_FDCTRL_TDCEN_MASK (0x8000U) -#define CAN_FDCTRL_TDCEN_SHIFT (15U) -/*! TDCEN - Transceiver Delay Compensation Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_FDCTRL_TDCEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCTRL_TDCEN_SHIFT)) & CAN_FDCTRL_TDCEN_MASK) - -#define CAN_FDCTRL_MBDSR0_MASK (0x30000U) -#define CAN_FDCTRL_MBDSR0_SHIFT (16U) -/*! MBDSR0 - Message Buffer Data Size for Region 0 - * 0b00..8 bytes - * 0b01..16 bytes - * 0b10..32 bytes - * 0b11..64 bytes - */ -#define CAN_FDCTRL_MBDSR0(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCTRL_MBDSR0_SHIFT)) & CAN_FDCTRL_MBDSR0_MASK) - -#define CAN_FDCTRL_FDRATE_MASK (0x80000000U) -#define CAN_FDCTRL_FDRATE_SHIFT (31U) -/*! FDRATE - Bit Rate Switch Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_FDCTRL_FDRATE(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCTRL_FDRATE_SHIFT)) & CAN_FDCTRL_FDRATE_MASK) -/*! @} */ - -/*! @name FDCBT - CAN FD Bit Timing */ -/*! @{ */ - -#define CAN_FDCBT_FPSEG2_MASK (0x7U) -#define CAN_FDCBT_FPSEG2_SHIFT (0U) -/*! FPSEG2 - Fast Phase Segment 2 */ -#define CAN_FDCBT_FPSEG2(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCBT_FPSEG2_SHIFT)) & CAN_FDCBT_FPSEG2_MASK) - -#define CAN_FDCBT_FPSEG1_MASK (0xE0U) -#define CAN_FDCBT_FPSEG1_SHIFT (5U) -/*! FPSEG1 - Fast Phase Segment 1 */ -#define CAN_FDCBT_FPSEG1(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCBT_FPSEG1_SHIFT)) & CAN_FDCBT_FPSEG1_MASK) - -#define CAN_FDCBT_FPROPSEG_MASK (0x7C00U) -#define CAN_FDCBT_FPROPSEG_SHIFT (10U) -/*! FPROPSEG - Fast Propagation Segment */ -#define CAN_FDCBT_FPROPSEG(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCBT_FPROPSEG_SHIFT)) & CAN_FDCBT_FPROPSEG_MASK) - -#define CAN_FDCBT_FRJW_MASK (0x70000U) -#define CAN_FDCBT_FRJW_SHIFT (16U) -/*! FRJW - Fast Resync Jump Width */ -#define CAN_FDCBT_FRJW(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCBT_FRJW_SHIFT)) & CAN_FDCBT_FRJW_MASK) - -#define CAN_FDCBT_FPRESDIV_MASK (0x3FF00000U) -#define CAN_FDCBT_FPRESDIV_SHIFT (20U) -/*! FPRESDIV - Fast Prescaler Division Factor */ -#define CAN_FDCBT_FPRESDIV(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCBT_FPRESDIV_SHIFT)) & CAN_FDCBT_FPRESDIV_MASK) -/*! @} */ - -/*! @name FDCRC - CAN FD CRC */ -/*! @{ */ - -#define CAN_FDCRC_FD_TXCRC_MASK (0x1FFFFFU) -#define CAN_FDCRC_FD_TXCRC_SHIFT (0U) -/*! FD_TXCRC - Extended Transmitted CRC value */ -#define CAN_FDCRC_FD_TXCRC(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCRC_FD_TXCRC_SHIFT)) & CAN_FDCRC_FD_TXCRC_MASK) - -#define CAN_FDCRC_FD_MBCRC_MASK (0x7F000000U) -#define CAN_FDCRC_FD_MBCRC_SHIFT (24U) -/*! FD_MBCRC - CRC Message Buffer Number for FD_TXCRC */ -#define CAN_FDCRC_FD_MBCRC(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCRC_FD_MBCRC_SHIFT)) & CAN_FDCRC_FD_MBCRC_MASK) -/*! @} */ - -/*! @name ERFCR - Enhanced RX FIFO Control */ -/*! @{ */ - -#define CAN_ERFCR_ERFWM_MASK (0x1FU) -#define CAN_ERFCR_ERFWM_SHIFT (0U) -/*! ERFWM - Enhanced RX FIFO Watermark */ -#define CAN_ERFCR_ERFWM(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFCR_ERFWM_SHIFT)) & CAN_ERFCR_ERFWM_MASK) - -#define CAN_ERFCR_NFE_MASK (0x3F00U) -#define CAN_ERFCR_NFE_SHIFT (8U) -/*! NFE - Number of Enhanced RX FIFO Filter Elements */ -#define CAN_ERFCR_NFE(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFCR_NFE_SHIFT)) & CAN_ERFCR_NFE_MASK) - -#define CAN_ERFCR_NEXIF_MASK (0x7F0000U) -#define CAN_ERFCR_NEXIF_SHIFT (16U) -/*! NEXIF - Number of Extended ID Filter Elements */ -#define CAN_ERFCR_NEXIF(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFCR_NEXIF_SHIFT)) & CAN_ERFCR_NEXIF_MASK) - -#define CAN_ERFCR_DMALW_MASK (0x7C000000U) -#define CAN_ERFCR_DMALW_SHIFT (26U) -/*! DMALW - DMA Last Word */ -#define CAN_ERFCR_DMALW(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFCR_DMALW_SHIFT)) & CAN_ERFCR_DMALW_MASK) - -#define CAN_ERFCR_ERFEN_MASK (0x80000000U) -#define CAN_ERFCR_ERFEN_SHIFT (31U) -/*! ERFEN - Enhanced RX FIFO enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_ERFCR_ERFEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFCR_ERFEN_SHIFT)) & CAN_ERFCR_ERFEN_MASK) -/*! @} */ - -/*! @name ERFIER - Enhanced RX FIFO Interrupt Enable */ -/*! @{ */ - -#define CAN_ERFIER_ERFDAIE_MASK (0x10000000U) -#define CAN_ERFIER_ERFDAIE_SHIFT (28U) -/*! ERFDAIE - Enhanced RX FIFO Data Available Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_ERFIER_ERFDAIE(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFIER_ERFDAIE_SHIFT)) & CAN_ERFIER_ERFDAIE_MASK) - -#define CAN_ERFIER_ERFWMIIE_MASK (0x20000000U) -#define CAN_ERFIER_ERFWMIIE_SHIFT (29U) -/*! ERFWMIIE - Enhanced RX FIFO Watermark Indication Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_ERFIER_ERFWMIIE(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFIER_ERFWMIIE_SHIFT)) & CAN_ERFIER_ERFWMIIE_MASK) - -#define CAN_ERFIER_ERFOVFIE_MASK (0x40000000U) -#define CAN_ERFIER_ERFOVFIE_SHIFT (30U) -/*! ERFOVFIE - Enhanced RX FIFO Overflow Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_ERFIER_ERFOVFIE(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFIER_ERFOVFIE_SHIFT)) & CAN_ERFIER_ERFOVFIE_MASK) - -#define CAN_ERFIER_ERFUFWIE_MASK (0x80000000U) -#define CAN_ERFIER_ERFUFWIE_SHIFT (31U) -/*! ERFUFWIE - Enhanced RX FIFO Underflow Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_ERFIER_ERFUFWIE(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFIER_ERFUFWIE_SHIFT)) & CAN_ERFIER_ERFUFWIE_MASK) -/*! @} */ - -/*! @name ERFSR - Enhanced RX FIFO Status */ -/*! @{ */ - -#define CAN_ERFSR_ERFEL_MASK (0x3FU) -#define CAN_ERFSR_ERFEL_SHIFT (0U) -/*! ERFEL - Enhanced RX FIFO Elements */ -#define CAN_ERFSR_ERFEL(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFEL_SHIFT)) & CAN_ERFSR_ERFEL_MASK) - -#define CAN_ERFSR_ERFF_MASK (0x10000U) -#define CAN_ERFSR_ERFF_SHIFT (16U) -/*! ERFF - Enhanced RX FIFO Full Flag - * 0b0..Not full - * 0b1..Full - */ -#define CAN_ERFSR_ERFF(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFF_SHIFT)) & CAN_ERFSR_ERFF_MASK) - -#define CAN_ERFSR_ERFE_MASK (0x20000U) -#define CAN_ERFSR_ERFE_SHIFT (17U) -/*! ERFE - Enhanced RX FIFO Empty Flag - * 0b0..Not empty - * 0b1..Empty - */ -#define CAN_ERFSR_ERFE(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFE_SHIFT)) & CAN_ERFSR_ERFE_MASK) - -#define CAN_ERFSR_ERFCLR_MASK (0x8000000U) -#define CAN_ERFSR_ERFCLR_SHIFT (27U) -/*! ERFCLR - Enhanced RX FIFO Clear - * 0b0..No effect - * 0b1..Clear enhanced RX FIFO content - */ -#define CAN_ERFSR_ERFCLR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFCLR_SHIFT)) & CAN_ERFSR_ERFCLR_MASK) - -#define CAN_ERFSR_ERFDA_MASK (0x10000000U) -#define CAN_ERFSR_ERFDA_SHIFT (28U) -/*! ERFDA - Enhanced RX FIFO Data Available Flag - * 0b0..No such occurrence - * 0b1..At least one message stored in Enhanced RX FIFO - */ -#define CAN_ERFSR_ERFDA(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFDA_SHIFT)) & CAN_ERFSR_ERFDA_MASK) - -#define CAN_ERFSR_ERFWMI_MASK (0x20000000U) -#define CAN_ERFSR_ERFWMI_SHIFT (29U) -/*! ERFWMI - Enhanced RX FIFO Watermark Indication Flag - * 0b0..No such occurrence - * 0b1..Number of messages in FIFO is greater than the watermark - */ -#define CAN_ERFSR_ERFWMI(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFWMI_SHIFT)) & CAN_ERFSR_ERFWMI_MASK) - -#define CAN_ERFSR_ERFOVF_MASK (0x40000000U) -#define CAN_ERFSR_ERFOVF_SHIFT (30U) -/*! ERFOVF - Enhanced RX FIFO Overflow Flag - * 0b0..No such occurrence - * 0b1..Overflow - */ -#define CAN_ERFSR_ERFOVF(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFOVF_SHIFT)) & CAN_ERFSR_ERFOVF_MASK) - -#define CAN_ERFSR_ERFUFW_MASK (0x80000000U) -#define CAN_ERFSR_ERFUFW_SHIFT (31U) -/*! ERFUFW - Enhanced RX FIFO Underflow Flag - * 0b0..No such occurrence - * 0b1..Underflow - */ -#define CAN_ERFSR_ERFUFW(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFUFW_SHIFT)) & CAN_ERFSR_ERFUFW_MASK) -/*! @} */ - -/*! @name ERFFEL - Enhanced RX FIFO Filter Element */ -/*! @{ */ - -#define CAN_ERFFEL_FEL_MASK (0xFFFFFFFFU) -#define CAN_ERFFEL_FEL_SHIFT (0U) -/*! FEL - Filter Element Bits */ -#define CAN_ERFFEL_FEL(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFFEL_FEL_SHIFT)) & CAN_ERFFEL_FEL_MASK) -/*! @} */ - -/* The count of CAN_ERFFEL */ -#define CAN_ERFFEL_COUNT (32U) - - -/*! - * @} - */ /* end of group CAN_Register_Masks */ - - -/* CAN - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral CAN0 base address */ - #define CAN0_BASE (0x500D4000u) - /** Peripheral CAN0 base address */ - #define CAN0_BASE_NS (0x400D4000u) - /** Peripheral CAN0 base pointer */ - #define CAN0 ((CAN_Type *)CAN0_BASE) - /** Peripheral CAN0 base pointer */ - #define CAN0_NS ((CAN_Type *)CAN0_BASE_NS) - /** Peripheral CAN1 base address */ - #define CAN1_BASE (0x500D8000u) - /** Peripheral CAN1 base address */ - #define CAN1_BASE_NS (0x400D8000u) - /** Peripheral CAN1 base pointer */ - #define CAN1 ((CAN_Type *)CAN1_BASE) - /** Peripheral CAN1 base pointer */ - #define CAN1_NS ((CAN_Type *)CAN1_BASE_NS) - /** Array initializer of CAN peripheral base addresses */ - #define CAN_BASE_ADDRS { CAN0_BASE, CAN1_BASE } - /** Array initializer of CAN peripheral base pointers */ - #define CAN_BASE_PTRS { CAN0, CAN1 } - /** Array initializer of CAN peripheral base addresses */ - #define CAN_BASE_ADDRS_NS { CAN0_BASE_NS, CAN1_BASE_NS } - /** Array initializer of CAN peripheral base pointers */ - #define CAN_BASE_PTRS_NS { CAN0_NS, CAN1_NS } -#else - /** Peripheral CAN0 base address */ - #define CAN0_BASE (0x400D4000u) - /** Peripheral CAN0 base pointer */ - #define CAN0 ((CAN_Type *)CAN0_BASE) - /** Peripheral CAN1 base address */ - #define CAN1_BASE (0x400D8000u) - /** Peripheral CAN1 base pointer */ - #define CAN1 ((CAN_Type *)CAN1_BASE) - /** Array initializer of CAN peripheral base addresses */ - #define CAN_BASE_ADDRS { CAN0_BASE, CAN1_BASE } - /** Array initializer of CAN peripheral base pointers */ - #define CAN_BASE_PTRS { CAN0, CAN1 } -#endif -/** Interrupt vectors for the CAN peripheral type */ -#define CAN_Rx_Warning_IRQS { CAN0_IRQn, CAN1_IRQn } -#define CAN_Tx_Warning_IRQS { CAN0_IRQn, CAN1_IRQn } -#define CAN_Wake_Up_IRQS { CAN0_IRQn, CAN1_IRQn } -#define CAN_Error_IRQS { CAN0_IRQn, CAN1_IRQn } -#define CAN_Bus_Off_IRQS { CAN0_IRQn, CAN1_IRQn } -#define CAN_ORed_Message_buffer_IRQS { CAN0_IRQn, CAN1_IRQn } - -/*! - * @} - */ /* end of group CAN_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- CDOG Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CDOG_Peripheral_Access_Layer CDOG Peripheral Access Layer - * @{ - */ - -/** CDOG - Register Layout Typedef */ -typedef struct { - __IO uint32_t CONTROL; /**< Control Register, offset: 0x0 */ - __IO uint32_t RELOAD; /**< Instruction Timer Reload Register, offset: 0x4 */ - __I uint32_t INSTRUCTION_TIMER; /**< Instruction Timer Register, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __I uint32_t STATUS; /**< Status 1 Register, offset: 0x10 */ - __I uint32_t STATUS2; /**< Status 2 Register, offset: 0x14 */ - __IO uint32_t FLAGS; /**< Flags Register, offset: 0x18 */ - __IO uint32_t PERSISTENT; /**< Persistent Data Storage Register, offset: 0x1C */ - __O uint32_t START; /**< START Command Register, offset: 0x20 */ - __O uint32_t STOP; /**< STOP Command Register, offset: 0x24 */ - __O uint32_t RESTART; /**< RESTART Command Register, offset: 0x28 */ - __O uint32_t ADD; /**< ADD Command Register, offset: 0x2C */ - __O uint32_t ADD1; /**< ADD1 Command Register, offset: 0x30 */ - __O uint32_t ADD16; /**< ADD16 Command Register, offset: 0x34 */ - __O uint32_t ADD256; /**< ADD256 Command Register, offset: 0x38 */ - __O uint32_t SUB; /**< SUB Command Register, offset: 0x3C */ - __O uint32_t SUB1; /**< SUB1 Command Register, offset: 0x40 */ - __O uint32_t SUB16; /**< SUB16 Command Register, offset: 0x44 */ - __O uint32_t SUB256; /**< SUB256 Command Register, offset: 0x48 */ - __O uint32_t ASSERT16; /**< ASSERT16 Command Register, offset: 0x4C */ -} CDOG_Type; - -/* ---------------------------------------------------------------------------- - -- CDOG Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CDOG_Register_Masks CDOG Register Masks - * @{ - */ - -/*! @name CONTROL - Control Register */ -/*! @{ */ - -#define CDOG_CONTROL_LOCK_CTRL_MASK (0x3U) -#define CDOG_CONTROL_LOCK_CTRL_SHIFT (0U) -/*! LOCK_CTRL - Lock control - * 0b01..Locked - * 0b10..Unlocked - */ -#define CDOG_CONTROL_LOCK_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_LOCK_CTRL_SHIFT)) & CDOG_CONTROL_LOCK_CTRL_MASK) - -#define CDOG_CONTROL_TIMEOUT_CTRL_MASK (0x1CU) -#define CDOG_CONTROL_TIMEOUT_CTRL_SHIFT (2U) -/*! TIMEOUT_CTRL - TIMEOUT fault control - * 0b100..Disable both reset and interrupt - * 0b001..Enable reset - * 0b010..Enable interrupt - */ -#define CDOG_CONTROL_TIMEOUT_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_TIMEOUT_CTRL_SHIFT)) & CDOG_CONTROL_TIMEOUT_CTRL_MASK) - -#define CDOG_CONTROL_MISCOMPARE_CTRL_MASK (0xE0U) -#define CDOG_CONTROL_MISCOMPARE_CTRL_SHIFT (5U) -/*! MISCOMPARE_CTRL - MISCOMPARE fault control - * 0b100..Disable both reset and interrupt - * 0b001..Enable reset - * 0b010..Enable interrupt - */ -#define CDOG_CONTROL_MISCOMPARE_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_MISCOMPARE_CTRL_SHIFT)) & CDOG_CONTROL_MISCOMPARE_CTRL_MASK) - -#define CDOG_CONTROL_SEQUENCE_CTRL_MASK (0x700U) -#define CDOG_CONTROL_SEQUENCE_CTRL_SHIFT (8U) -/*! SEQUENCE_CTRL - SEQUENCE fault control - * 0b001..Enable reset - * 0b010..Enable interrupt - * 0b100..Disable both reset and interrupt - */ -#define CDOG_CONTROL_SEQUENCE_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_SEQUENCE_CTRL_SHIFT)) & CDOG_CONTROL_SEQUENCE_CTRL_MASK) - -#define CDOG_CONTROL_STATE_CTRL_MASK (0x1C000U) -#define CDOG_CONTROL_STATE_CTRL_SHIFT (14U) -/*! STATE_CTRL - STATE fault control - * 0b001..Enable reset - * 0b010..Enable interrupt - * 0b100..Disable both reset and interrupt - */ -#define CDOG_CONTROL_STATE_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_STATE_CTRL_SHIFT)) & CDOG_CONTROL_STATE_CTRL_MASK) - -#define CDOG_CONTROL_ADDRESS_CTRL_MASK (0xE0000U) -#define CDOG_CONTROL_ADDRESS_CTRL_SHIFT (17U) -/*! ADDRESS_CTRL - ADDRESS fault control - * 0b001..Enable reset - * 0b010..Enable interrupt - * 0b100..Disable both reset and interrupt - */ -#define CDOG_CONTROL_ADDRESS_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_ADDRESS_CTRL_SHIFT)) & CDOG_CONTROL_ADDRESS_CTRL_MASK) - -#define CDOG_CONTROL_IRQ_PAUSE_MASK (0x30000000U) -#define CDOG_CONTROL_IRQ_PAUSE_SHIFT (28U) -/*! IRQ_PAUSE - IRQ pause control - * 0b01..Keep the timer running - * 0b10..Stop the timer - */ -#define CDOG_CONTROL_IRQ_PAUSE(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_IRQ_PAUSE_SHIFT)) & CDOG_CONTROL_IRQ_PAUSE_MASK) - -#define CDOG_CONTROL_DEBUG_HALT_CTRL_MASK (0xC0000000U) -#define CDOG_CONTROL_DEBUG_HALT_CTRL_SHIFT (30U) -/*! DEBUG_HALT_CTRL - DEBUG_HALT control - * 0b01..Keep the timer running - * 0b10..Stop the timer - */ -#define CDOG_CONTROL_DEBUG_HALT_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_DEBUG_HALT_CTRL_SHIFT)) & CDOG_CONTROL_DEBUG_HALT_CTRL_MASK) -/*! @} */ - -/*! @name RELOAD - Instruction Timer Reload Register */ -/*! @{ */ - -#define CDOG_RELOAD_RLOAD_MASK (0xFFFFFFFFU) -#define CDOG_RELOAD_RLOAD_SHIFT (0U) -/*! RLOAD - Instruction Timer reload value */ -#define CDOG_RELOAD_RLOAD(x) (((uint32_t)(((uint32_t)(x)) << CDOG_RELOAD_RLOAD_SHIFT)) & CDOG_RELOAD_RLOAD_MASK) -/*! @} */ - -/*! @name INSTRUCTION_TIMER - Instruction Timer Register */ -/*! @{ */ - -#define CDOG_INSTRUCTION_TIMER_INSTIM_MASK (0xFFFFFFFFU) -#define CDOG_INSTRUCTION_TIMER_INSTIM_SHIFT (0U) -/*! INSTIM - Current value of the Instruction Timer */ -#define CDOG_INSTRUCTION_TIMER_INSTIM(x) (((uint32_t)(((uint32_t)(x)) << CDOG_INSTRUCTION_TIMER_INSTIM_SHIFT)) & CDOG_INSTRUCTION_TIMER_INSTIM_MASK) -/*! @} */ - -/*! @name STATUS - Status 1 Register */ -/*! @{ */ - -#define CDOG_STATUS_NUMTOF_MASK (0xFFU) -#define CDOG_STATUS_NUMTOF_SHIFT (0U) -/*! NUMTOF - Number of TIMEOUT faults since the last POR */ -#define CDOG_STATUS_NUMTOF(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS_NUMTOF_SHIFT)) & CDOG_STATUS_NUMTOF_MASK) - -#define CDOG_STATUS_NUMMISCOMPF_MASK (0xFF00U) -#define CDOG_STATUS_NUMMISCOMPF_SHIFT (8U) -/*! NUMMISCOMPF - Number of MISCOMPARE faults since the last POR */ -#define CDOG_STATUS_NUMMISCOMPF(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS_NUMMISCOMPF_SHIFT)) & CDOG_STATUS_NUMMISCOMPF_MASK) - -#define CDOG_STATUS_NUMILSEQF_MASK (0xFF0000U) -#define CDOG_STATUS_NUMILSEQF_SHIFT (16U) -/*! NUMILSEQF - Number of SEQUENCE faults since the last POR */ -#define CDOG_STATUS_NUMILSEQF(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS_NUMILSEQF_SHIFT)) & CDOG_STATUS_NUMILSEQF_MASK) - -#define CDOG_STATUS_CURST_MASK (0xF0000000U) -#define CDOG_STATUS_CURST_SHIFT (28U) -/*! CURST - Current State */ -#define CDOG_STATUS_CURST(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS_CURST_SHIFT)) & CDOG_STATUS_CURST_MASK) -/*! @} */ - -/*! @name STATUS2 - Status 2 Register */ -/*! @{ */ - -#define CDOG_STATUS2_NUMCNTF_MASK (0xFFU) -#define CDOG_STATUS2_NUMCNTF_SHIFT (0U) -/*! NUMCNTF - Number of CONTROL faults since the last POR */ -#define CDOG_STATUS2_NUMCNTF(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS2_NUMCNTF_SHIFT)) & CDOG_STATUS2_NUMCNTF_MASK) - -#define CDOG_STATUS2_NUMILLSTF_MASK (0xFF00U) -#define CDOG_STATUS2_NUMILLSTF_SHIFT (8U) -/*! NUMILLSTF - Number of STATE faults since the last POR */ -#define CDOG_STATUS2_NUMILLSTF(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS2_NUMILLSTF_SHIFT)) & CDOG_STATUS2_NUMILLSTF_MASK) - -#define CDOG_STATUS2_NUMILLA_MASK (0xFF0000U) -#define CDOG_STATUS2_NUMILLA_SHIFT (16U) -/*! NUMILLA - Number of ADDRESS faults since the last POR */ -#define CDOG_STATUS2_NUMILLA(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS2_NUMILLA_SHIFT)) & CDOG_STATUS2_NUMILLA_MASK) -/*! @} */ - -/*! @name FLAGS - Flags Register */ -/*! @{ */ - -#define CDOG_FLAGS_TO_FLAG_MASK (0x1U) -#define CDOG_FLAGS_TO_FLAG_SHIFT (0U) -/*! TO_FLAG - TIMEOUT fault flag - * 0b0..A TIMEOUT fault has not occurred - * 0b1..A TIMEOUT fault has occurred - */ -#define CDOG_FLAGS_TO_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_TO_FLAG_SHIFT)) & CDOG_FLAGS_TO_FLAG_MASK) - -#define CDOG_FLAGS_MISCOM_FLAG_MASK (0x2U) -#define CDOG_FLAGS_MISCOM_FLAG_SHIFT (1U) -/*! MISCOM_FLAG - MISCOMPARE fault flag - * 0b0..A MISCOMPARE fault has not occurred - * 0b1..A MISCOMPARE fault has occurred - */ -#define CDOG_FLAGS_MISCOM_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_MISCOM_FLAG_SHIFT)) & CDOG_FLAGS_MISCOM_FLAG_MASK) - -#define CDOG_FLAGS_SEQ_FLAG_MASK (0x4U) -#define CDOG_FLAGS_SEQ_FLAG_SHIFT (2U) -/*! SEQ_FLAG - SEQUENCE fault flag - * 0b0..A SEQUENCE fault has not occurred - * 0b1..A SEQUENCE fault has occurred - */ -#define CDOG_FLAGS_SEQ_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_SEQ_FLAG_SHIFT)) & CDOG_FLAGS_SEQ_FLAG_MASK) - -#define CDOG_FLAGS_CNT_FLAG_MASK (0x8U) -#define CDOG_FLAGS_CNT_FLAG_SHIFT (3U) -/*! CNT_FLAG - CONTROL fault flag - * 0b0..A CONTROL fault has not occurred - * 0b1..A CONTROL fault has occurred - */ -#define CDOG_FLAGS_CNT_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_CNT_FLAG_SHIFT)) & CDOG_FLAGS_CNT_FLAG_MASK) - -#define CDOG_FLAGS_STATE_FLAG_MASK (0x10U) -#define CDOG_FLAGS_STATE_FLAG_SHIFT (4U) -/*! STATE_FLAG - STATE fault flag - * 0b0..A STATE fault has not occurred - * 0b1..A STATE fault has occurred - */ -#define CDOG_FLAGS_STATE_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_STATE_FLAG_SHIFT)) & CDOG_FLAGS_STATE_FLAG_MASK) - -#define CDOG_FLAGS_ADDR_FLAG_MASK (0x20U) -#define CDOG_FLAGS_ADDR_FLAG_SHIFT (5U) -/*! ADDR_FLAG - ADDRESS fault flag - * 0b0..An ADDRESS fault has not occurred - * 0b1..An ADDRESS fault has occurred - */ -#define CDOG_FLAGS_ADDR_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_ADDR_FLAG_SHIFT)) & CDOG_FLAGS_ADDR_FLAG_MASK) - -#define CDOG_FLAGS_POR_FLAG_MASK (0x10000U) -#define CDOG_FLAGS_POR_FLAG_SHIFT (16U) -/*! POR_FLAG - Power-on reset flag - * 0b0..A Power-on reset event has not occurred - * 0b1..A Power-on reset event has occurred - */ -#define CDOG_FLAGS_POR_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_POR_FLAG_SHIFT)) & CDOG_FLAGS_POR_FLAG_MASK) -/*! @} */ - -/*! @name PERSISTENT - Persistent Data Storage Register */ -/*! @{ */ - -#define CDOG_PERSISTENT_PERSIS_MASK (0xFFFFFFFFU) -#define CDOG_PERSISTENT_PERSIS_SHIFT (0U) -/*! PERSIS - Persistent Storage */ -#define CDOG_PERSISTENT_PERSIS(x) (((uint32_t)(((uint32_t)(x)) << CDOG_PERSISTENT_PERSIS_SHIFT)) & CDOG_PERSISTENT_PERSIS_MASK) -/*! @} */ - -/*! @name START - START Command Register */ -/*! @{ */ - -#define CDOG_START_STRT_MASK (0xFFFFFFFFU) -#define CDOG_START_STRT_SHIFT (0U) -/*! STRT - Start command */ -#define CDOG_START_STRT(x) (((uint32_t)(((uint32_t)(x)) << CDOG_START_STRT_SHIFT)) & CDOG_START_STRT_MASK) -/*! @} */ - -/*! @name STOP - STOP Command Register */ -/*! @{ */ - -#define CDOG_STOP_STP_MASK (0xFFFFFFFFU) -#define CDOG_STOP_STP_SHIFT (0U) -/*! STP - Stop command */ -#define CDOG_STOP_STP(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STOP_STP_SHIFT)) & CDOG_STOP_STP_MASK) -/*! @} */ - -/*! @name RESTART - RESTART Command Register */ -/*! @{ */ - -#define CDOG_RESTART_RSTRT_MASK (0xFFFFFFFFU) -#define CDOG_RESTART_RSTRT_SHIFT (0U) -/*! RSTRT - Restart command */ -#define CDOG_RESTART_RSTRT(x) (((uint32_t)(((uint32_t)(x)) << CDOG_RESTART_RSTRT_SHIFT)) & CDOG_RESTART_RSTRT_MASK) -/*! @} */ - -/*! @name ADD - ADD Command Register */ -/*! @{ */ - -#define CDOG_ADD_AD_MASK (0xFFFFFFFFU) -#define CDOG_ADD_AD_SHIFT (0U) -/*! AD - ADD Write Value */ -#define CDOG_ADD_AD(x) (((uint32_t)(((uint32_t)(x)) << CDOG_ADD_AD_SHIFT)) & CDOG_ADD_AD_MASK) -/*! @} */ - -/*! @name ADD1 - ADD1 Command Register */ -/*! @{ */ - -#define CDOG_ADD1_AD1_MASK (0xFFFFFFFFU) -#define CDOG_ADD1_AD1_SHIFT (0U) -/*! AD1 - ADD 1 */ -#define CDOG_ADD1_AD1(x) (((uint32_t)(((uint32_t)(x)) << CDOG_ADD1_AD1_SHIFT)) & CDOG_ADD1_AD1_MASK) -/*! @} */ - -/*! @name ADD16 - ADD16 Command Register */ -/*! @{ */ - -#define CDOG_ADD16_AD16_MASK (0xFFFFFFFFU) -#define CDOG_ADD16_AD16_SHIFT (0U) -/*! AD16 - ADD 16 */ -#define CDOG_ADD16_AD16(x) (((uint32_t)(((uint32_t)(x)) << CDOG_ADD16_AD16_SHIFT)) & CDOG_ADD16_AD16_MASK) -/*! @} */ - -/*! @name ADD256 - ADD256 Command Register */ -/*! @{ */ - -#define CDOG_ADD256_AD256_MASK (0xFFFFFFFFU) -#define CDOG_ADD256_AD256_SHIFT (0U) -/*! AD256 - ADD 256 */ -#define CDOG_ADD256_AD256(x) (((uint32_t)(((uint32_t)(x)) << CDOG_ADD256_AD256_SHIFT)) & CDOG_ADD256_AD256_MASK) -/*! @} */ - -/*! @name SUB - SUB Command Register */ -/*! @{ */ - -#define CDOG_SUB_SB_MASK (0xFFFFFFFFU) -#define CDOG_SUB_SB_SHIFT (0U) -/*! SB - Subtract Write Value */ -#define CDOG_SUB_SB(x) (((uint32_t)(((uint32_t)(x)) << CDOG_SUB_SB_SHIFT)) & CDOG_SUB_SB_MASK) -/*! @} */ - -/*! @name SUB1 - SUB1 Command Register */ -/*! @{ */ - -#define CDOG_SUB1_SB1_MASK (0xFFFFFFFFU) -#define CDOG_SUB1_SB1_SHIFT (0U) -/*! SB1 - Subtract 1 */ -#define CDOG_SUB1_SB1(x) (((uint32_t)(((uint32_t)(x)) << CDOG_SUB1_SB1_SHIFT)) & CDOG_SUB1_SB1_MASK) -/*! @} */ - -/*! @name SUB16 - SUB16 Command Register */ -/*! @{ */ - -#define CDOG_SUB16_SB16_MASK (0xFFFFFFFFU) -#define CDOG_SUB16_SB16_SHIFT (0U) -/*! SB16 - Subtract 16 */ -#define CDOG_SUB16_SB16(x) (((uint32_t)(((uint32_t)(x)) << CDOG_SUB16_SB16_SHIFT)) & CDOG_SUB16_SB16_MASK) -/*! @} */ - -/*! @name SUB256 - SUB256 Command Register */ -/*! @{ */ - -#define CDOG_SUB256_SB256_MASK (0xFFFFFFFFU) -#define CDOG_SUB256_SB256_SHIFT (0U) -/*! SB256 - Subtract 256 */ -#define CDOG_SUB256_SB256(x) (((uint32_t)(((uint32_t)(x)) << CDOG_SUB256_SB256_SHIFT)) & CDOG_SUB256_SB256_MASK) -/*! @} */ - -/*! @name ASSERT16 - ASSERT16 Command Register */ -/*! @{ */ - -#define CDOG_ASSERT16_AST16_MASK (0xFFFFFFFFU) -#define CDOG_ASSERT16_AST16_SHIFT (0U) -/*! AST16 - ASSERT16 Command */ -#define CDOG_ASSERT16_AST16(x) (((uint32_t)(((uint32_t)(x)) << CDOG_ASSERT16_AST16_SHIFT)) & CDOG_ASSERT16_AST16_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group CDOG_Register_Masks */ - - -/* CDOG - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral CDOG0 base address */ - #define CDOG0_BASE (0x500BB000u) - /** Peripheral CDOG0 base address */ - #define CDOG0_BASE_NS (0x400BB000u) - /** Peripheral CDOG0 base pointer */ - #define CDOG0 ((CDOG_Type *)CDOG0_BASE) - /** Peripheral CDOG0 base pointer */ - #define CDOG0_NS ((CDOG_Type *)CDOG0_BASE_NS) - /** Peripheral CDOG1 base address */ - #define CDOG1_BASE (0x500BC000u) - /** Peripheral CDOG1 base address */ - #define CDOG1_BASE_NS (0x400BC000u) - /** Peripheral CDOG1 base pointer */ - #define CDOG1 ((CDOG_Type *)CDOG1_BASE) - /** Peripheral CDOG1 base pointer */ - #define CDOG1_NS ((CDOG_Type *)CDOG1_BASE_NS) - /** Array initializer of CDOG peripheral base addresses */ - #define CDOG_BASE_ADDRS { CDOG0_BASE, CDOG1_BASE } - /** Array initializer of CDOG peripheral base pointers */ - #define CDOG_BASE_PTRS { CDOG0, CDOG1 } - /** Array initializer of CDOG peripheral base addresses */ - #define CDOG_BASE_ADDRS_NS { CDOG0_BASE_NS, CDOG1_BASE_NS } - /** Array initializer of CDOG peripheral base pointers */ - #define CDOG_BASE_PTRS_NS { CDOG0_NS, CDOG1_NS } -#else - /** Peripheral CDOG0 base address */ - #define CDOG0_BASE (0x400BB000u) - /** Peripheral CDOG0 base pointer */ - #define CDOG0 ((CDOG_Type *)CDOG0_BASE) - /** Peripheral CDOG1 base address */ - #define CDOG1_BASE (0x400BC000u) - /** Peripheral CDOG1 base pointer */ - #define CDOG1 ((CDOG_Type *)CDOG1_BASE) - /** Array initializer of CDOG peripheral base addresses */ - #define CDOG_BASE_ADDRS { CDOG0_BASE, CDOG1_BASE } - /** Array initializer of CDOG peripheral base pointers */ - #define CDOG_BASE_PTRS { CDOG0, CDOG1 } -#endif -/** Interrupt vectors for the CDOG peripheral type */ -#define CDOG_IRQS { CDOG0_IRQn, CDOG1_IRQn } - -/*! - * @} - */ /* end of group CDOG_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- CMC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CMC_Peripheral_Access_Layer CMC Peripheral Access Layer - * @{ - */ - -/** CMC - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - uint8_t RESERVED_0[12]; - __IO uint32_t CKCTRL; /**< Clock Control, offset: 0x10 */ - __IO uint32_t CKSTAT; /**< Clock Status, offset: 0x14 */ - __IO uint32_t PMPROT; /**< Power Mode Protection, offset: 0x18 */ - __O uint32_t GPMCTRL; /**< Global Power Mode Control, offset: 0x1C */ - __IO uint32_t PMCTRL[2]; /**< Power Mode Control, array offset: 0x20, array step: 0x4 */ - uint8_t RESERVED_1[88]; - __I uint32_t SRS; /**< System Reset Status, offset: 0x80 */ - __IO uint32_t RPC; /**< Reset Pin Control, offset: 0x84 */ - __IO uint32_t SSRS; /**< Sticky System Reset Status, offset: 0x88 */ - __IO uint32_t SRIE; /**< System Reset Interrupt Enable, offset: 0x8C */ - __IO uint32_t SRIF; /**< System Reset Interrupt Flag, offset: 0x90 */ - uint8_t RESERVED_2[8]; - __I uint32_t RSTCNT; /**< Reset Count Register, offset: 0x9C */ - __IO uint32_t MR[1]; /**< Mode, array offset: 0xA0, array step: 0x4 */ - uint8_t RESERVED_3[12]; - __IO uint32_t FM[1]; /**< Force Mode, array offset: 0xB0, array step: 0x4 */ - uint8_t RESERVED_4[12]; - __IO uint32_t SRAMDIS[1]; /**< SRAM Disable, array offset: 0xC0, array step: 0x4 */ - uint8_t RESERVED_5[12]; - __IO uint32_t SRAMRET[1]; /**< SRAM Retention, array offset: 0xD0, array step: 0x4 */ - uint8_t RESERVED_6[12]; - __IO uint32_t FLASHCR; /**< Flash Control, offset: 0xE0 */ - uint8_t RESERVED_7[28]; - __IO uint32_t BSR; /**< BootROM Status Register, offset: 0x100 */ - uint8_t RESERVED_8[8]; - __IO uint32_t BLR; /**< BootROM Lock Register, offset: 0x10C */ - __IO uint32_t CORECTL; /**< Core Control, offset: 0x110 */ - uint8_t RESERVED_9[12]; - __IO uint32_t DBGCTL; /**< Debug Control, offset: 0x120 */ -} CMC_Type; - -/* ---------------------------------------------------------------------------- - -- CMC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CMC_Register_Masks CMC Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define CMC_VERID_FEATURE_MASK (0xFFFFU) -#define CMC_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number */ -#define CMC_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << CMC_VERID_FEATURE_SHIFT)) & CMC_VERID_FEATURE_MASK) - -#define CMC_VERID_MINOR_MASK (0xFF0000U) -#define CMC_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define CMC_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << CMC_VERID_MINOR_SHIFT)) & CMC_VERID_MINOR_MASK) - -#define CMC_VERID_MAJOR_MASK (0xFF000000U) -#define CMC_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define CMC_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << CMC_VERID_MAJOR_SHIFT)) & CMC_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name CKCTRL - Clock Control */ -/*! @{ */ - -#define CMC_CKCTRL_CKMODE_MASK (0xFU) -#define CMC_CKCTRL_CKMODE_SHIFT (0U) -/*! CKMODE - Clocking Mode - * 0b0000..No clock gating - * 0b0001..Core clock is gated - * 0b1111..Core, platform, and peripheral clocks are gated, and core enters Low-Power mode. - */ -#define CMC_CKCTRL_CKMODE(x) (((uint32_t)(((uint32_t)(x)) << CMC_CKCTRL_CKMODE_SHIFT)) & CMC_CKCTRL_CKMODE_MASK) - -#define CMC_CKCTRL_LOCK_MASK (0x80000000U) -#define CMC_CKCTRL_LOCK_SHIFT (31U) -/*! LOCK - Lock - * 0b0..Allowed - * 0b1..Blocked - */ -#define CMC_CKCTRL_LOCK(x) (((uint32_t)(((uint32_t)(x)) << CMC_CKCTRL_LOCK_SHIFT)) & CMC_CKCTRL_LOCK_MASK) -/*! @} */ - -/*! @name CKSTAT - Clock Status */ -/*! @{ */ - -#define CMC_CKSTAT_CKMODE_MASK (0xFU) -#define CMC_CKSTAT_CKMODE_SHIFT (0U) -/*! CKMODE - Low Power Status - * 0b0000..Core clock not gated - * 0b0001..Core clock was gated - * 0b1111..Core, platform, and peripheral clocks were gated, and power domain entered Low-Power mode - * *.. - */ -#define CMC_CKSTAT_CKMODE(x) (((uint32_t)(((uint32_t)(x)) << CMC_CKSTAT_CKMODE_SHIFT)) & CMC_CKSTAT_CKMODE_MASK) - -#define CMC_CKSTAT_WAKEUP_MASK (0xFF00U) -#define CMC_CKSTAT_WAKEUP_SHIFT (8U) -/*! WAKEUP - Wake-up Source */ -#define CMC_CKSTAT_WAKEUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_CKSTAT_WAKEUP_SHIFT)) & CMC_CKSTAT_WAKEUP_MASK) - -#define CMC_CKSTAT_VALID_MASK (0x80000000U) -#define CMC_CKSTAT_VALID_SHIFT (31U) -/*! VALID - Clock Status Valid - * 0b0..Core clock not gated - * 0b1..Core clock was gated due to Low-Power mode entry - */ -#define CMC_CKSTAT_VALID(x) (((uint32_t)(((uint32_t)(x)) << CMC_CKSTAT_VALID_SHIFT)) & CMC_CKSTAT_VALID_MASK) -/*! @} */ - -/*! @name PMPROT - Power Mode Protection */ -/*! @{ */ - -#define CMC_PMPROT_LPMODE_MASK (0xFU) -#define CMC_PMPROT_LPMODE_SHIFT (0U) -/*! LPMODE - Low-Power Mode - * 0b0000..Not allowed - * 0b0001..Allowed - * 0b0010..Allowed - * 0b0011..Allowed - * 0b0100..Allowed - * 0b0101..Allowed - * 0b0110..Allowed - * 0b0111..Allowed - * 0b1000..Allowed - * 0b1001..Allowed - * 0b1010..Allowed - * 0b1011..Allowed - * 0b1100..Allowed - * 0b1101..Allowed - * 0b1110..Allowed - * 0b1111..Allowed - */ -#define CMC_PMPROT_LPMODE(x) (((uint32_t)(((uint32_t)(x)) << CMC_PMPROT_LPMODE_SHIFT)) & CMC_PMPROT_LPMODE_MASK) - -#define CMC_PMPROT_LOCK_MASK (0x80000000U) -#define CMC_PMPROT_LOCK_SHIFT (31U) -/*! LOCK - Lock Register - * 0b0..Allowed - * 0b1..Blocked - */ -#define CMC_PMPROT_LOCK(x) (((uint32_t)(((uint32_t)(x)) << CMC_PMPROT_LOCK_SHIFT)) & CMC_PMPROT_LOCK_MASK) -/*! @} */ - -/*! @name GPMCTRL - Global Power Mode Control */ -/*! @{ */ - -#define CMC_GPMCTRL_LPMODE_MASK (0xFU) -#define CMC_GPMCTRL_LPMODE_SHIFT (0U) -/*! LPMODE - Low-Power Mode */ -#define CMC_GPMCTRL_LPMODE(x) (((uint32_t)(((uint32_t)(x)) << CMC_GPMCTRL_LPMODE_SHIFT)) & CMC_GPMCTRL_LPMODE_MASK) -/*! @} */ - -/*! @name PMCTRL - Power Mode Control */ -/*! @{ */ - -#define CMC_PMCTRL_LPMODE_MASK (0xFU) -#define CMC_PMCTRL_LPMODE_SHIFT (0U) -/*! LPMODE - Low-Power Mode - * 0b0000..Active/Sleep - * 0b0001..Deep Sleep - * 0b0011..Power Down - * 0b0111..Reserved - * 0b1111..Deep-Power Down - */ -#define CMC_PMCTRL_LPMODE(x) (((uint32_t)(((uint32_t)(x)) << CMC_PMCTRL_LPMODE_SHIFT)) & CMC_PMCTRL_LPMODE_MASK) -/*! @} */ - -/* The count of CMC_PMCTRL */ -#define CMC_PMCTRL_COUNT (2U) - -/*! @name SRS - System Reset Status */ -/*! @{ */ - -#define CMC_SRS_WAKEUP_MASK (0x1U) -#define CMC_SRS_WAKEUP_SHIFT (0U) -/*! WAKEUP - Wake-up Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_WAKEUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_WAKEUP_SHIFT)) & CMC_SRS_WAKEUP_MASK) - -#define CMC_SRS_POR_MASK (0x2U) -#define CMC_SRS_POR_SHIFT (1U) -/*! POR - Power-on Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_POR(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_POR_SHIFT)) & CMC_SRS_POR_MASK) - -#define CMC_SRS_VD_MASK (0x4U) -#define CMC_SRS_VD_SHIFT (2U) -/*! VD - Voltage Detect Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_VD(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_VD_SHIFT)) & CMC_SRS_VD_MASK) - -#define CMC_SRS_WARM_MASK (0x10U) -#define CMC_SRS_WARM_SHIFT (4U) -/*! WARM - Warm Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_WARM(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_WARM_SHIFT)) & CMC_SRS_WARM_MASK) - -#define CMC_SRS_FATAL_MASK (0x20U) -#define CMC_SRS_FATAL_SHIFT (5U) -/*! FATAL - Fatal Reset - * 0b0..Reset was not generated - * 0b1..Reset was generated - */ -#define CMC_SRS_FATAL(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_FATAL_SHIFT)) & CMC_SRS_FATAL_MASK) - -#define CMC_SRS_PIN_MASK (0x100U) -#define CMC_SRS_PIN_SHIFT (8U) -/*! PIN - Pin Reset - * 0b0..Reset was not generated - * 0b1..Reset was generated - */ -#define CMC_SRS_PIN(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_PIN_SHIFT)) & CMC_SRS_PIN_MASK) - -#define CMC_SRS_DAP_MASK (0x200U) -#define CMC_SRS_DAP_SHIFT (9U) -/*! DAP - Debug Access Port Reset - * 0b0..Reset was not generated - * 0b1..Reset was generated - */ -#define CMC_SRS_DAP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_DAP_SHIFT)) & CMC_SRS_DAP_MASK) - -#define CMC_SRS_RSTACK_MASK (0x400U) -#define CMC_SRS_RSTACK_SHIFT (10U) -/*! RSTACK - Reset Timeout - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_RSTACK(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_RSTACK_SHIFT)) & CMC_SRS_RSTACK_MASK) - -#define CMC_SRS_LPACK_MASK (0x800U) -#define CMC_SRS_LPACK_SHIFT (11U) -/*! LPACK - Low Power Acknowledge Timeout Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_LPACK(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_LPACK_SHIFT)) & CMC_SRS_LPACK_MASK) - -#define CMC_SRS_SCG_MASK (0x1000U) -#define CMC_SRS_SCG_SHIFT (12U) -/*! SCG - System Clock Generation Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SRS_SCG(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_SCG_SHIFT)) & CMC_SRS_SCG_MASK) - -#define CMC_SRS_WWDT0_MASK (0x2000U) -#define CMC_SRS_WWDT0_SHIFT (13U) -/*! WWDT0 - Windowed Watchdog 0 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SRS_WWDT0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_WWDT0_SHIFT)) & CMC_SRS_WWDT0_MASK) - -#define CMC_SRS_SW_MASK (0x4000U) -#define CMC_SRS_SW_SHIFT (14U) -/*! SW - Software Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_SW(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_SW_SHIFT)) & CMC_SRS_SW_MASK) - -#define CMC_SRS_LOCKUP_MASK (0x8000U) -#define CMC_SRS_LOCKUP_SHIFT (15U) -/*! LOCKUP - Lockup Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_LOCKUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_LOCKUP_SHIFT)) & CMC_SRS_LOCKUP_MASK) - -#define CMC_SRS_CPU1_MASK (0x10000U) -#define CMC_SRS_CPU1_SHIFT (16U) -/*! CPU1 - CPU1 System Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_CPU1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_CPU1_SHIFT)) & CMC_SRS_CPU1_MASK) - -#define CMC_SRS_VBAT_MASK (0x1000000U) -#define CMC_SRS_VBAT_SHIFT (24U) -/*! VBAT - VBAT System Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_VBAT(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_VBAT_SHIFT)) & CMC_SRS_VBAT_MASK) - -#define CMC_SRS_WWDT1_MASK (0x2000000U) -#define CMC_SRS_WWDT1_SHIFT (25U) -/*! WWDT1 - Windowed Watchdog 1 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SRS_WWDT1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_WWDT1_SHIFT)) & CMC_SRS_WWDT1_MASK) - -#define CMC_SRS_CDOG0_MASK (0x4000000U) -#define CMC_SRS_CDOG0_SHIFT (26U) -/*! CDOG0 - Code Watchdog 0 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SRS_CDOG0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_CDOG0_SHIFT)) & CMC_SRS_CDOG0_MASK) - -#define CMC_SRS_CDOG1_MASK (0x8000000U) -#define CMC_SRS_CDOG1_SHIFT (27U) -/*! CDOG1 - Code Watchdog 1 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SRS_CDOG1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_CDOG1_SHIFT)) & CMC_SRS_CDOG1_MASK) - -#define CMC_SRS_JTAG_MASK (0x10000000U) -#define CMC_SRS_JTAG_SHIFT (28U) -/*! JTAG - JTAG System Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_JTAG(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_JTAG_SHIFT)) & CMC_SRS_JTAG_MASK) - -#define CMC_SRS_SECVIO_MASK (0x40000000U) -#define CMC_SRS_SECVIO_SHIFT (30U) -/*! SECVIO - Security Violation Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_SECVIO(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_SECVIO_SHIFT)) & CMC_SRS_SECVIO_MASK) - -#define CMC_SRS_TAMPER_MASK (0x80000000U) -#define CMC_SRS_TAMPER_SHIFT (31U) -/*! TAMPER - Tamper Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_TAMPER(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_TAMPER_SHIFT)) & CMC_SRS_TAMPER_MASK) -/*! @} */ - -/*! @name RPC - Reset Pin Control */ -/*! @{ */ - -#define CMC_RPC_FILTCFG_MASK (0x1FU) -#define CMC_RPC_FILTCFG_SHIFT (0U) -/*! FILTCFG - Reset Filter Configuration */ -#define CMC_RPC_FILTCFG(x) (((uint32_t)(((uint32_t)(x)) << CMC_RPC_FILTCFG_SHIFT)) & CMC_RPC_FILTCFG_MASK) - -#define CMC_RPC_FILTEN_MASK (0x100U) -#define CMC_RPC_FILTEN_SHIFT (8U) -/*! FILTEN - Filter Enable - * 0b0..Disables - * 0b1..Enables - */ -#define CMC_RPC_FILTEN(x) (((uint32_t)(((uint32_t)(x)) << CMC_RPC_FILTEN_SHIFT)) & CMC_RPC_FILTEN_MASK) - -#define CMC_RPC_LPFEN_MASK (0x200U) -#define CMC_RPC_LPFEN_SHIFT (9U) -/*! LPFEN - Low-Power Filter Enable - * 0b0..Disables - * 0b1..Enables - */ -#define CMC_RPC_LPFEN(x) (((uint32_t)(((uint32_t)(x)) << CMC_RPC_LPFEN_SHIFT)) & CMC_RPC_LPFEN_MASK) -/*! @} */ - -/*! @name SSRS - Sticky System Reset Status */ -/*! @{ */ - -#define CMC_SSRS_WAKEUP_MASK (0x1U) -#define CMC_SSRS_WAKEUP_SHIFT (0U) -/*! WAKEUP - Wake-up Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_WAKEUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_WAKEUP_SHIFT)) & CMC_SSRS_WAKEUP_MASK) - -#define CMC_SSRS_POR_MASK (0x2U) -#define CMC_SSRS_POR_SHIFT (1U) -/*! POR - Power-on Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_POR(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_POR_SHIFT)) & CMC_SSRS_POR_MASK) - -#define CMC_SSRS_VD_MASK (0x4U) -#define CMC_SSRS_VD_SHIFT (2U) -/*! VD - Voltage Detect Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_VD(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_VD_SHIFT)) & CMC_SSRS_VD_MASK) - -#define CMC_SSRS_WARM_MASK (0x10U) -#define CMC_SSRS_WARM_SHIFT (4U) -/*! WARM - Warm Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_WARM(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_WARM_SHIFT)) & CMC_SSRS_WARM_MASK) - -#define CMC_SSRS_FATAL_MASK (0x20U) -#define CMC_SSRS_FATAL_SHIFT (5U) -/*! FATAL - Fatal Reset - * 0b0..Reset was not generated - * 0b1..Reset was generated - */ -#define CMC_SSRS_FATAL(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_FATAL_SHIFT)) & CMC_SSRS_FATAL_MASK) - -#define CMC_SSRS_PIN_MASK (0x100U) -#define CMC_SSRS_PIN_SHIFT (8U) -/*! PIN - Pin Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_PIN(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_PIN_SHIFT)) & CMC_SSRS_PIN_MASK) - -#define CMC_SSRS_DAP_MASK (0x200U) -#define CMC_SSRS_DAP_SHIFT (9U) -/*! DAP - DAP Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_DAP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_DAP_SHIFT)) & CMC_SSRS_DAP_MASK) - -#define CMC_SSRS_RSTACK_MASK (0x400U) -#define CMC_SSRS_RSTACK_SHIFT (10U) -/*! RSTACK - Reset Timeout - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_RSTACK(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_RSTACK_SHIFT)) & CMC_SSRS_RSTACK_MASK) - -#define CMC_SSRS_LPACK_MASK (0x800U) -#define CMC_SSRS_LPACK_SHIFT (11U) -/*! LPACK - Low Power Acknowledge Timeout Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_LPACK(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_LPACK_SHIFT)) & CMC_SSRS_LPACK_MASK) - -#define CMC_SSRS_SCG_MASK (0x1000U) -#define CMC_SSRS_SCG_SHIFT (12U) -/*! SCG - System Clock Generation Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SSRS_SCG(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_SCG_SHIFT)) & CMC_SSRS_SCG_MASK) - -#define CMC_SSRS_WWDT0_MASK (0x2000U) -#define CMC_SSRS_WWDT0_SHIFT (13U) -/*! WWDT0 - Windowed Watchdog 0 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SSRS_WWDT0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_WWDT0_SHIFT)) & CMC_SSRS_WWDT0_MASK) - -#define CMC_SSRS_SW_MASK (0x4000U) -#define CMC_SSRS_SW_SHIFT (14U) -/*! SW - Software Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_SW(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_SW_SHIFT)) & CMC_SSRS_SW_MASK) - -#define CMC_SSRS_LOCKUP_MASK (0x8000U) -#define CMC_SSRS_LOCKUP_SHIFT (15U) -/*! LOCKUP - Lockup Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_LOCKUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_LOCKUP_SHIFT)) & CMC_SSRS_LOCKUP_MASK) - -#define CMC_SSRS_CPU1_MASK (0x10000U) -#define CMC_SSRS_CPU1_SHIFT (16U) -/*! CPU1 - CPU1 Reset - * 0b0..Reset not generated from CPU1 reset source. - * 0b1..Reset generated from CPU1 reset source. - */ -#define CMC_SSRS_CPU1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_CPU1_SHIFT)) & CMC_SSRS_CPU1_MASK) - -#define CMC_SSRS_VBAT_MASK (0x1000000U) -#define CMC_SSRS_VBAT_SHIFT (24U) -/*! VBAT - VBAT System Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_VBAT(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_VBAT_SHIFT)) & CMC_SSRS_VBAT_MASK) - -#define CMC_SSRS_WWDT1_MASK (0x2000000U) -#define CMC_SSRS_WWDT1_SHIFT (25U) -/*! WWDT1 - Windowed Watchdog 1 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SSRS_WWDT1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_WWDT1_SHIFT)) & CMC_SSRS_WWDT1_MASK) - -#define CMC_SSRS_CDOG0_MASK (0x4000000U) -#define CMC_SSRS_CDOG0_SHIFT (26U) -/*! CDOG0 - Code Watchdog 0 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SSRS_CDOG0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_CDOG0_SHIFT)) & CMC_SSRS_CDOG0_MASK) - -#define CMC_SSRS_CDOG1_MASK (0x8000000U) -#define CMC_SSRS_CDOG1_SHIFT (27U) -/*! CDOG1 - Code Watchdog 1 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SSRS_CDOG1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_CDOG1_SHIFT)) & CMC_SSRS_CDOG1_MASK) - -#define CMC_SSRS_JTAG_MASK (0x10000000U) -#define CMC_SSRS_JTAG_SHIFT (28U) -/*! JTAG - JTAG System Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_JTAG(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_JTAG_SHIFT)) & CMC_SSRS_JTAG_MASK) - -#define CMC_SSRS_SECVIO_MASK (0x40000000U) -#define CMC_SSRS_SECVIO_SHIFT (30U) -/*! SECVIO - Security Violation Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_SECVIO(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_SECVIO_SHIFT)) & CMC_SSRS_SECVIO_MASK) - -#define CMC_SSRS_TAMPER_MASK (0x80000000U) -#define CMC_SSRS_TAMPER_SHIFT (31U) -/*! TAMPER - Tamper Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_TAMPER(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_TAMPER_SHIFT)) & CMC_SSRS_TAMPER_MASK) -/*! @} */ - -/*! @name SRIE - System Reset Interrupt Enable */ -/*! @{ */ - -#define CMC_SRIE_PIN_MASK (0x100U) -#define CMC_SRIE_PIN_SHIFT (8U) -/*! PIN - Pin Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_PIN(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_PIN_SHIFT)) & CMC_SRIE_PIN_MASK) - -#define CMC_SRIE_DAP_MASK (0x200U) -#define CMC_SRIE_DAP_SHIFT (9U) -/*! DAP - DAP Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_DAP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_DAP_SHIFT)) & CMC_SRIE_DAP_MASK) - -#define CMC_SRIE_LPACK_MASK (0x800U) -#define CMC_SRIE_LPACK_SHIFT (11U) -/*! LPACK - Low Power Acknowledge Timeout Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_LPACK(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_LPACK_SHIFT)) & CMC_SRIE_LPACK_MASK) - -#define CMC_SRIE_SCG_MASK (0x1000U) -#define CMC_SRIE_SCG_SHIFT (12U) -/*! SCG - System Clock Generation Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_SCG(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_SCG_SHIFT)) & CMC_SRIE_SCG_MASK) - -#define CMC_SRIE_WWDT0_MASK (0x2000U) -#define CMC_SRIE_WWDT0_SHIFT (13U) -/*! WWDT0 - Windowed Watchdog 0 Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_WWDT0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_WWDT0_SHIFT)) & CMC_SRIE_WWDT0_MASK) - -#define CMC_SRIE_SW_MASK (0x4000U) -#define CMC_SRIE_SW_SHIFT (14U) -/*! SW - Software Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_SW(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_SW_SHIFT)) & CMC_SRIE_SW_MASK) - -#define CMC_SRIE_LOCKUP_MASK (0x8000U) -#define CMC_SRIE_LOCKUP_SHIFT (15U) -/*! LOCKUP - Lockup Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_LOCKUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_LOCKUP_SHIFT)) & CMC_SRIE_LOCKUP_MASK) - -#define CMC_SRIE_CPU1_MASK (0x10000U) -#define CMC_SRIE_CPU1_SHIFT (16U) -/*! CPU1 - CPU1 Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_CPU1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_CPU1_SHIFT)) & CMC_SRIE_CPU1_MASK) - -#define CMC_SRIE_VBAT_MASK (0x1000000U) -#define CMC_SRIE_VBAT_SHIFT (24U) -/*! VBAT - VBAT System Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_VBAT(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_VBAT_SHIFT)) & CMC_SRIE_VBAT_MASK) - -#define CMC_SRIE_WWDT1_MASK (0x2000000U) -#define CMC_SRIE_WWDT1_SHIFT (25U) -/*! WWDT1 - Windowed Watchdog 1 Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_WWDT1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_WWDT1_SHIFT)) & CMC_SRIE_WWDT1_MASK) - -#define CMC_SRIE_CDOG0_MASK (0x4000000U) -#define CMC_SRIE_CDOG0_SHIFT (26U) -/*! CDOG0 - Code Watchdog 0 Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_CDOG0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_CDOG0_SHIFT)) & CMC_SRIE_CDOG0_MASK) - -#define CMC_SRIE_CDOG1_MASK (0x8000000U) -#define CMC_SRIE_CDOG1_SHIFT (27U) -/*! CDOG1 - Code Watchdog 1 Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_CDOG1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_CDOG1_SHIFT)) & CMC_SRIE_CDOG1_MASK) -/*! @} */ - -/*! @name SRIF - System Reset Interrupt Flag */ -/*! @{ */ - -#define CMC_SRIF_PIN_MASK (0x100U) -#define CMC_SRIF_PIN_SHIFT (8U) -/*! PIN - Pin Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_PIN(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_PIN_SHIFT)) & CMC_SRIF_PIN_MASK) - -#define CMC_SRIF_DAP_MASK (0x200U) -#define CMC_SRIF_DAP_SHIFT (9U) -/*! DAP - DAP Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_DAP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_DAP_SHIFT)) & CMC_SRIF_DAP_MASK) - -#define CMC_SRIF_LPACK_MASK (0x800U) -#define CMC_SRIF_LPACK_SHIFT (11U) -/*! LPACK - Low Power Acknowledge Timeout Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_LPACK(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_LPACK_SHIFT)) & CMC_SRIF_LPACK_MASK) - -#define CMC_SRIF_WWDT0_MASK (0x2000U) -#define CMC_SRIF_WWDT0_SHIFT (13U) -/*! WWDT0 - Windowed Watchdog 0 Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_WWDT0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_WWDT0_SHIFT)) & CMC_SRIF_WWDT0_MASK) - -#define CMC_SRIF_SW_MASK (0x4000U) -#define CMC_SRIF_SW_SHIFT (14U) -/*! SW - Software Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_SW(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_SW_SHIFT)) & CMC_SRIF_SW_MASK) - -#define CMC_SRIF_LOCKUP_MASK (0x8000U) -#define CMC_SRIF_LOCKUP_SHIFT (15U) -/*! LOCKUP - Lockup Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_LOCKUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_LOCKUP_SHIFT)) & CMC_SRIF_LOCKUP_MASK) - -#define CMC_SRIF_CPU1_MASK (0x10000U) -#define CMC_SRIF_CPU1_SHIFT (16U) -/*! CPU1 - CPU1 Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_CPU1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_CPU1_SHIFT)) & CMC_SRIF_CPU1_MASK) - -#define CMC_SRIF_VBAT_MASK (0x1000000U) -#define CMC_SRIF_VBAT_SHIFT (24U) -/*! VBAT - VBAT System Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_VBAT(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_VBAT_SHIFT)) & CMC_SRIF_VBAT_MASK) - -#define CMC_SRIF_WWDT1_MASK (0x2000000U) -#define CMC_SRIF_WWDT1_SHIFT (25U) -/*! WWDT1 - Windowed Watchdog 1 Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_WWDT1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_WWDT1_SHIFT)) & CMC_SRIF_WWDT1_MASK) - -#define CMC_SRIF_CDOG0_MASK (0x4000000U) -#define CMC_SRIF_CDOG0_SHIFT (26U) -/*! CDOG0 - Code Watchdog 0 Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_CDOG0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_CDOG0_SHIFT)) & CMC_SRIF_CDOG0_MASK) - -#define CMC_SRIF_CDOG1_MASK (0x8000000U) -#define CMC_SRIF_CDOG1_SHIFT (27U) -/*! CDOG1 - Code Watchdog 1 Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_CDOG1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_CDOG1_SHIFT)) & CMC_SRIF_CDOG1_MASK) -/*! @} */ - -/*! @name RSTCNT - Reset Count Register */ -/*! @{ */ - -#define CMC_RSTCNT_COUNT_MASK (0xFFU) -#define CMC_RSTCNT_COUNT_SHIFT (0U) -/*! COUNT - Count */ -#define CMC_RSTCNT_COUNT(x) (((uint32_t)(((uint32_t)(x)) << CMC_RSTCNT_COUNT_SHIFT)) & CMC_RSTCNT_COUNT_MASK) -/*! @} */ - -/*! @name MR - Mode */ -/*! @{ */ - -#define CMC_MR_ISPMODE_n_MASK (0x1U) -#define CMC_MR_ISPMODE_n_SHIFT (0U) -/*! ISPMODE_n - In System Programming Mode */ -#define CMC_MR_ISPMODE_n(x) (((uint32_t)(((uint32_t)(x)) << CMC_MR_ISPMODE_n_SHIFT)) & CMC_MR_ISPMODE_n_MASK) -/*! @} */ - -/* The count of CMC_MR */ -#define CMC_MR_COUNT (1U) - -/*! @name FM - Force Mode */ -/*! @{ */ - -#define CMC_FM_FORCECFG_MASK (0x1U) -#define CMC_FM_FORCECFG_SHIFT (0U) -/*! FORCECFG - Boot Configuration - * 0b0..No effect - * 0b1..Asserts - */ -#define CMC_FM_FORCECFG(x) (((uint32_t)(((uint32_t)(x)) << CMC_FM_FORCECFG_SHIFT)) & CMC_FM_FORCECFG_MASK) -/*! @} */ - -/* The count of CMC_FM */ -#define CMC_FM_COUNT (1U) - -/*! @name SRAMDIS - SRAM Disable */ -/*! @{ */ - -#define CMC_SRAMDIS_DIS0_MASK (0x1U) -#define CMC_SRAMDIS_DIS0_SHIFT (0U) -/*! DIS0 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS0_SHIFT)) & CMC_SRAMDIS_DIS0_MASK) - -#define CMC_SRAMDIS_DIS1_MASK (0x2U) -#define CMC_SRAMDIS_DIS1_SHIFT (1U) -/*! DIS1 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS1_SHIFT)) & CMC_SRAMDIS_DIS1_MASK) - -#define CMC_SRAMDIS_DIS2_MASK (0x4U) -#define CMC_SRAMDIS_DIS2_SHIFT (2U) -/*! DIS2 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS2(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS2_SHIFT)) & CMC_SRAMDIS_DIS2_MASK) - -#define CMC_SRAMDIS_DIS3_MASK (0x8U) -#define CMC_SRAMDIS_DIS3_SHIFT (3U) -/*! DIS3 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS3(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS3_SHIFT)) & CMC_SRAMDIS_DIS3_MASK) - -#define CMC_SRAMDIS_DIS4_MASK (0x10U) -#define CMC_SRAMDIS_DIS4_SHIFT (4U) -/*! DIS4 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS4(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS4_SHIFT)) & CMC_SRAMDIS_DIS4_MASK) - -#define CMC_SRAMDIS_DIS5_MASK (0x20U) -#define CMC_SRAMDIS_DIS5_SHIFT (5U) -/*! DIS5 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS5(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS5_SHIFT)) & CMC_SRAMDIS_DIS5_MASK) - -#define CMC_SRAMDIS_DIS6_MASK (0x40U) -#define CMC_SRAMDIS_DIS6_SHIFT (6U) -/*! DIS6 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS6(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS6_SHIFT)) & CMC_SRAMDIS_DIS6_MASK) - -#define CMC_SRAMDIS_DIS7_MASK (0x80U) -#define CMC_SRAMDIS_DIS7_SHIFT (7U) -/*! DIS7 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS7(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS7_SHIFT)) & CMC_SRAMDIS_DIS7_MASK) - -#define CMC_SRAMDIS_DIS8_MASK (0x100U) -#define CMC_SRAMDIS_DIS8_SHIFT (8U) -/*! DIS8 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS8(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS8_SHIFT)) & CMC_SRAMDIS_DIS8_MASK) - -#define CMC_SRAMDIS_DIS9_MASK (0x200U) -#define CMC_SRAMDIS_DIS9_SHIFT (9U) -/*! DIS9 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS9(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS9_SHIFT)) & CMC_SRAMDIS_DIS9_MASK) - -#define CMC_SRAMDIS_DIS10_MASK (0x400U) -#define CMC_SRAMDIS_DIS10_SHIFT (10U) -/*! DIS10 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS10(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS10_SHIFT)) & CMC_SRAMDIS_DIS10_MASK) - -#define CMC_SRAMDIS_DIS11_MASK (0x800U) -#define CMC_SRAMDIS_DIS11_SHIFT (11U) -/*! DIS11 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS11(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS11_SHIFT)) & CMC_SRAMDIS_DIS11_MASK) - -#define CMC_SRAMDIS_DIS12_MASK (0x1000U) -#define CMC_SRAMDIS_DIS12_SHIFT (12U) -/*! DIS12 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS12(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS12_SHIFT)) & CMC_SRAMDIS_DIS12_MASK) - -#define CMC_SRAMDIS_DIS13_MASK (0x2000U) -#define CMC_SRAMDIS_DIS13_SHIFT (13U) -/*! DIS13 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS13(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS13_SHIFT)) & CMC_SRAMDIS_DIS13_MASK) - -#define CMC_SRAMDIS_DIS14_MASK (0x4000U) -#define CMC_SRAMDIS_DIS14_SHIFT (14U) -/*! DIS14 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS14(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS14_SHIFT)) & CMC_SRAMDIS_DIS14_MASK) - -#define CMC_SRAMDIS_DIS15_MASK (0x8000U) -#define CMC_SRAMDIS_DIS15_SHIFT (15U) -/*! DIS15 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS15(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS15_SHIFT)) & CMC_SRAMDIS_DIS15_MASK) - -#define CMC_SRAMDIS_DIS16_MASK (0x10000U) -#define CMC_SRAMDIS_DIS16_SHIFT (16U) -/*! DIS16 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS16(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS16_SHIFT)) & CMC_SRAMDIS_DIS16_MASK) - -#define CMC_SRAMDIS_DIS17_MASK (0x20000U) -#define CMC_SRAMDIS_DIS17_SHIFT (17U) -/*! DIS17 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS17(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS17_SHIFT)) & CMC_SRAMDIS_DIS17_MASK) - -#define CMC_SRAMDIS_DIS18_MASK (0x40000U) -#define CMC_SRAMDIS_DIS18_SHIFT (18U) -/*! DIS18 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS18(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS18_SHIFT)) & CMC_SRAMDIS_DIS18_MASK) - -#define CMC_SRAMDIS_DIS19_MASK (0x80000U) -#define CMC_SRAMDIS_DIS19_SHIFT (19U) -/*! DIS19 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS19(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS19_SHIFT)) & CMC_SRAMDIS_DIS19_MASK) - -#define CMC_SRAMDIS_DIS20_MASK (0x100000U) -#define CMC_SRAMDIS_DIS20_SHIFT (20U) -/*! DIS20 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS20(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS20_SHIFT)) & CMC_SRAMDIS_DIS20_MASK) - -#define CMC_SRAMDIS_DIS21_MASK (0x200000U) -#define CMC_SRAMDIS_DIS21_SHIFT (21U) -/*! DIS21 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS21(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS21_SHIFT)) & CMC_SRAMDIS_DIS21_MASK) - -#define CMC_SRAMDIS_DIS22_MASK (0x400000U) -#define CMC_SRAMDIS_DIS22_SHIFT (22U) -/*! DIS22 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS22(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS22_SHIFT)) & CMC_SRAMDIS_DIS22_MASK) - -#define CMC_SRAMDIS_DIS23_MASK (0x800000U) -#define CMC_SRAMDIS_DIS23_SHIFT (23U) -/*! DIS23 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS23(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS23_SHIFT)) & CMC_SRAMDIS_DIS23_MASK) - -#define CMC_SRAMDIS_DIS24_MASK (0x1000000U) -#define CMC_SRAMDIS_DIS24_SHIFT (24U) -/*! DIS24 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS24(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS24_SHIFT)) & CMC_SRAMDIS_DIS24_MASK) - -#define CMC_SRAMDIS_DIS25_MASK (0x2000000U) -#define CMC_SRAMDIS_DIS25_SHIFT (25U) -/*! DIS25 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS25(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS25_SHIFT)) & CMC_SRAMDIS_DIS25_MASK) - -#define CMC_SRAMDIS_DIS26_MASK (0x4000000U) -#define CMC_SRAMDIS_DIS26_SHIFT (26U) -/*! DIS26 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS26(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS26_SHIFT)) & CMC_SRAMDIS_DIS26_MASK) - -#define CMC_SRAMDIS_DIS27_MASK (0x8000000U) -#define CMC_SRAMDIS_DIS27_SHIFT (27U) -/*! DIS27 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS27(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS27_SHIFT)) & CMC_SRAMDIS_DIS27_MASK) - -#define CMC_SRAMDIS_DIS28_MASK (0x10000000U) -#define CMC_SRAMDIS_DIS28_SHIFT (28U) -/*! DIS28 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS28(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS28_SHIFT)) & CMC_SRAMDIS_DIS28_MASK) - -#define CMC_SRAMDIS_DIS29_MASK (0x20000000U) -#define CMC_SRAMDIS_DIS29_SHIFT (29U) -/*! DIS29 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS29(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS29_SHIFT)) & CMC_SRAMDIS_DIS29_MASK) - -#define CMC_SRAMDIS_DIS30_MASK (0x40000000U) -#define CMC_SRAMDIS_DIS30_SHIFT (30U) -/*! DIS30 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS30(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS30_SHIFT)) & CMC_SRAMDIS_DIS30_MASK) - -#define CMC_SRAMDIS_DIS31_MASK (0x80000000U) -#define CMC_SRAMDIS_DIS31_SHIFT (31U) -/*! DIS31 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS31(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS31_SHIFT)) & CMC_SRAMDIS_DIS31_MASK) -/*! @} */ - -/* The count of CMC_SRAMDIS */ -#define CMC_SRAMDIS_COUNT (1U) - -/*! @name SRAMRET - SRAM Retention */ -/*! @{ */ - -#define CMC_SRAMRET_RET0_MASK (0x1U) -#define CMC_SRAMRET_RET0_SHIFT (0U) -/*! RET0 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET0_SHIFT)) & CMC_SRAMRET_RET0_MASK) - -#define CMC_SRAMRET_RET1_MASK (0x2U) -#define CMC_SRAMRET_RET1_SHIFT (1U) -/*! RET1 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET1_SHIFT)) & CMC_SRAMRET_RET1_MASK) - -#define CMC_SRAMRET_RET2_MASK (0x4U) -#define CMC_SRAMRET_RET2_SHIFT (2U) -/*! RET2 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET2(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET2_SHIFT)) & CMC_SRAMRET_RET2_MASK) - -#define CMC_SRAMRET_RET3_MASK (0x8U) -#define CMC_SRAMRET_RET3_SHIFT (3U) -/*! RET3 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET3(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET3_SHIFT)) & CMC_SRAMRET_RET3_MASK) - -#define CMC_SRAMRET_RET4_MASK (0x10U) -#define CMC_SRAMRET_RET4_SHIFT (4U) -/*! RET4 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET4(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET4_SHIFT)) & CMC_SRAMRET_RET4_MASK) - -#define CMC_SRAMRET_RET5_MASK (0x20U) -#define CMC_SRAMRET_RET5_SHIFT (5U) -/*! RET5 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET5(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET5_SHIFT)) & CMC_SRAMRET_RET5_MASK) - -#define CMC_SRAMRET_RET6_MASK (0x40U) -#define CMC_SRAMRET_RET6_SHIFT (6U) -/*! RET6 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET6(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET6_SHIFT)) & CMC_SRAMRET_RET6_MASK) - -#define CMC_SRAMRET_RET7_MASK (0x80U) -#define CMC_SRAMRET_RET7_SHIFT (7U) -/*! RET7 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET7(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET7_SHIFT)) & CMC_SRAMRET_RET7_MASK) - -#define CMC_SRAMRET_RET8_MASK (0x100U) -#define CMC_SRAMRET_RET8_SHIFT (8U) -/*! RET8 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET8(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET8_SHIFT)) & CMC_SRAMRET_RET8_MASK) - -#define CMC_SRAMRET_RET9_MASK (0x200U) -#define CMC_SRAMRET_RET9_SHIFT (9U) -/*! RET9 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET9(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET9_SHIFT)) & CMC_SRAMRET_RET9_MASK) - -#define CMC_SRAMRET_RET10_MASK (0x400U) -#define CMC_SRAMRET_RET10_SHIFT (10U) -/*! RET10 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET10(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET10_SHIFT)) & CMC_SRAMRET_RET10_MASK) - -#define CMC_SRAMRET_RET11_MASK (0x800U) -#define CMC_SRAMRET_RET11_SHIFT (11U) -/*! RET11 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET11(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET11_SHIFT)) & CMC_SRAMRET_RET11_MASK) - -#define CMC_SRAMRET_RET12_MASK (0x1000U) -#define CMC_SRAMRET_RET12_SHIFT (12U) -/*! RET12 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET12(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET12_SHIFT)) & CMC_SRAMRET_RET12_MASK) - -#define CMC_SRAMRET_RET13_MASK (0x2000U) -#define CMC_SRAMRET_RET13_SHIFT (13U) -/*! RET13 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET13(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET13_SHIFT)) & CMC_SRAMRET_RET13_MASK) - -#define CMC_SRAMRET_RET14_MASK (0x4000U) -#define CMC_SRAMRET_RET14_SHIFT (14U) -/*! RET14 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET14(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET14_SHIFT)) & CMC_SRAMRET_RET14_MASK) - -#define CMC_SRAMRET_RET15_MASK (0x8000U) -#define CMC_SRAMRET_RET15_SHIFT (15U) -/*! RET15 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET15(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET15_SHIFT)) & CMC_SRAMRET_RET15_MASK) - -#define CMC_SRAMRET_RET16_MASK (0x10000U) -#define CMC_SRAMRET_RET16_SHIFT (16U) -/*! RET16 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET16(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET16_SHIFT)) & CMC_SRAMRET_RET16_MASK) - -#define CMC_SRAMRET_RET17_MASK (0x20000U) -#define CMC_SRAMRET_RET17_SHIFT (17U) -/*! RET17 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET17(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET17_SHIFT)) & CMC_SRAMRET_RET17_MASK) - -#define CMC_SRAMRET_RET18_MASK (0x40000U) -#define CMC_SRAMRET_RET18_SHIFT (18U) -/*! RET18 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET18(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET18_SHIFT)) & CMC_SRAMRET_RET18_MASK) - -#define CMC_SRAMRET_RET19_MASK (0x80000U) -#define CMC_SRAMRET_RET19_SHIFT (19U) -/*! RET19 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET19(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET19_SHIFT)) & CMC_SRAMRET_RET19_MASK) - -#define CMC_SRAMRET_RET20_MASK (0x100000U) -#define CMC_SRAMRET_RET20_SHIFT (20U) -/*! RET20 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET20(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET20_SHIFT)) & CMC_SRAMRET_RET20_MASK) - -#define CMC_SRAMRET_RET21_MASK (0x200000U) -#define CMC_SRAMRET_RET21_SHIFT (21U) -/*! RET21 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET21(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET21_SHIFT)) & CMC_SRAMRET_RET21_MASK) - -#define CMC_SRAMRET_RET22_MASK (0x400000U) -#define CMC_SRAMRET_RET22_SHIFT (22U) -/*! RET22 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET22(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET22_SHIFT)) & CMC_SRAMRET_RET22_MASK) - -#define CMC_SRAMRET_RET23_MASK (0x800000U) -#define CMC_SRAMRET_RET23_SHIFT (23U) -/*! RET23 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET23(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET23_SHIFT)) & CMC_SRAMRET_RET23_MASK) - -#define CMC_SRAMRET_RET24_MASK (0x1000000U) -#define CMC_SRAMRET_RET24_SHIFT (24U) -/*! RET24 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET24(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET24_SHIFT)) & CMC_SRAMRET_RET24_MASK) - -#define CMC_SRAMRET_RET25_MASK (0x2000000U) -#define CMC_SRAMRET_RET25_SHIFT (25U) -/*! RET25 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET25(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET25_SHIFT)) & CMC_SRAMRET_RET25_MASK) - -#define CMC_SRAMRET_RET26_MASK (0x4000000U) -#define CMC_SRAMRET_RET26_SHIFT (26U) -/*! RET26 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET26(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET26_SHIFT)) & CMC_SRAMRET_RET26_MASK) - -#define CMC_SRAMRET_RET27_MASK (0x8000000U) -#define CMC_SRAMRET_RET27_SHIFT (27U) -/*! RET27 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET27(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET27_SHIFT)) & CMC_SRAMRET_RET27_MASK) - -#define CMC_SRAMRET_RET28_MASK (0x10000000U) -#define CMC_SRAMRET_RET28_SHIFT (28U) -/*! RET28 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET28(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET28_SHIFT)) & CMC_SRAMRET_RET28_MASK) - -#define CMC_SRAMRET_RET29_MASK (0x20000000U) -#define CMC_SRAMRET_RET29_SHIFT (29U) -/*! RET29 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET29(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET29_SHIFT)) & CMC_SRAMRET_RET29_MASK) - -#define CMC_SRAMRET_RET30_MASK (0x40000000U) -#define CMC_SRAMRET_RET30_SHIFT (30U) -/*! RET30 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET30(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET30_SHIFT)) & CMC_SRAMRET_RET30_MASK) - -#define CMC_SRAMRET_RET31_MASK (0x80000000U) -#define CMC_SRAMRET_RET31_SHIFT (31U) -/*! RET31 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET31(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET31_SHIFT)) & CMC_SRAMRET_RET31_MASK) -/*! @} */ - -/* The count of CMC_SRAMRET */ -#define CMC_SRAMRET_COUNT (1U) - -/*! @name FLASHCR - Flash Control */ -/*! @{ */ - -#define CMC_FLASHCR_FLASHDIS_MASK (0x1U) -#define CMC_FLASHCR_FLASHDIS_SHIFT (0U) -/*! FLASHDIS - Flash Disable - * 0b0..No effect - * 0b1..Flash memory is disabled - */ -#define CMC_FLASHCR_FLASHDIS(x) (((uint32_t)(((uint32_t)(x)) << CMC_FLASHCR_FLASHDIS_SHIFT)) & CMC_FLASHCR_FLASHDIS_MASK) - -#define CMC_FLASHCR_FLASHDOZE_MASK (0x2U) -#define CMC_FLASHCR_FLASHDOZE_SHIFT (1U) -/*! FLASHDOZE - Flash Doze - * 0b0..No effect - * 0b1..Flash memory is disabled when core is sleeping (CKMODE > 0) - */ -#define CMC_FLASHCR_FLASHDOZE(x) (((uint32_t)(((uint32_t)(x)) << CMC_FLASHCR_FLASHDOZE_SHIFT)) & CMC_FLASHCR_FLASHDOZE_MASK) -/*! @} */ - -/*! @name BSR - BootROM Status Register */ -/*! @{ */ - -#define CMC_BSR_STAT_MASK (0xFFFFFFFFU) -#define CMC_BSR_STAT_SHIFT (0U) -/*! STAT - Provides status information written by the BootROM. */ -#define CMC_BSR_STAT(x) (((uint32_t)(((uint32_t)(x)) << CMC_BSR_STAT_SHIFT)) & CMC_BSR_STAT_MASK) -/*! @} */ - -/*! @name BLR - BootROM Lock Register */ -/*! @{ */ - -#define CMC_BLR_LOCK_MASK (0x7U) -#define CMC_BLR_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b010..BootROM Status and Lock Registers can be written - * 0b101..BootROM Status and Lock Registers cannot be written - */ -#define CMC_BLR_LOCK(x) (((uint32_t)(((uint32_t)(x)) << CMC_BLR_LOCK_SHIFT)) & CMC_BLR_LOCK_MASK) -/*! @} */ - -/*! @name CORECTL - Core Control */ -/*! @{ */ - -#define CMC_CORECTL_NPIE_MASK (0x1U) -#define CMC_CORECTL_NPIE_SHIFT (0U) -/*! NPIE - Non-maskable Pin Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define CMC_CORECTL_NPIE(x) (((uint32_t)(((uint32_t)(x)) << CMC_CORECTL_NPIE_SHIFT)) & CMC_CORECTL_NPIE_MASK) -/*! @} */ - -/*! @name DBGCTL - Debug Control */ -/*! @{ */ - -#define CMC_DBGCTL_SOD_MASK (0x1U) -#define CMC_DBGCTL_SOD_SHIFT (0U) -/*! SOD - Sleep Or Debug - * 0b0..Remains enabled - * 0b1..Disabled - */ -#define CMC_DBGCTL_SOD(x) (((uint32_t)(((uint32_t)(x)) << CMC_DBGCTL_SOD_SHIFT)) & CMC_DBGCTL_SOD_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group CMC_Register_Masks */ - - -/* CMC - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral CMC0 base address */ - #define CMC0_BASE (0x50048000u) - /** Peripheral CMC0 base address */ - #define CMC0_BASE_NS (0x40048000u) - /** Peripheral CMC0 base pointer */ - #define CMC0 ((CMC_Type *)CMC0_BASE) - /** Peripheral CMC0 base pointer */ - #define CMC0_NS ((CMC_Type *)CMC0_BASE_NS) - /** Array initializer of CMC peripheral base addresses */ - #define CMC_BASE_ADDRS { CMC0_BASE } - /** Array initializer of CMC peripheral base pointers */ - #define CMC_BASE_PTRS { CMC0 } - /** Array initializer of CMC peripheral base addresses */ - #define CMC_BASE_ADDRS_NS { CMC0_BASE_NS } - /** Array initializer of CMC peripheral base pointers */ - #define CMC_BASE_PTRS_NS { CMC0_NS } -#else - /** Peripheral CMC0 base address */ - #define CMC0_BASE (0x40048000u) - /** Peripheral CMC0 base pointer */ - #define CMC0 ((CMC_Type *)CMC0_BASE) - /** Array initializer of CMC peripheral base addresses */ - #define CMC_BASE_ADDRS { CMC0_BASE } - /** Array initializer of CMC peripheral base pointers */ - #define CMC_BASE_PTRS { CMC0 } -#endif -/* Backward compatibility for CMC */ -#define CMC_SRAMDIS_DIS_MASK (0xFFFFFFFFU) -#define CMC_SRAMDIS_DIS_SHIFT (0U) -/*! DIS - SRAM Disable */ -#define CMC_SRAMDIS_DIS(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS_SHIFT)) & CMC_SRAMDIS_DIS_MASK) - -#define CMC_SRAMRET_RET_MASK (0xFFFFFFFFU) -#define CMC_SRAMRET_RET_SHIFT (0U) -/*! RET - SRAM Retention */ -#define CMC_SRAMRET_RET(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET_SHIFT)) & CMC_SRAMRET_RET_MASK) - - -/*! - * @} - */ /* end of group CMC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- CRC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CRC_Peripheral_Access_Layer CRC Peripheral Access Layer - * @{ - */ - -/** CRC - Register Layout Typedef */ -typedef struct { - union { /* offset: 0x0 */ - struct { /* offset: 0x0 */ - __IO uint8_t DATALL; /**< CRC_DATALL register, offset: 0x0 */ - __IO uint8_t DATALU; /**< CRC_DATALU register, offset: 0x1 */ - __IO uint8_t DATAHL; /**< CRC_DATAHL register, offset: 0x2 */ - __IO uint8_t DATAHU; /**< CRC_DATAHU register, offset: 0x3 */ - } ACCESS8BIT; - struct { /* offset: 0x0 */ - __IO uint16_t DATAL; /**< CRC_DATAL register, offset: 0x0 */ - __IO uint16_t DATAH; /**< CRC_DATAH register, offset: 0x2 */ - } ACCESS16BIT; - __IO uint32_t DATA; /**< Data, offset: 0x0 */ - }; - union { /* offset: 0x4 */ - struct { /* offset: 0x4 */ - __IO uint8_t GPOLYLL; /**< CRC_GPOLYLL register, offset: 0x4 */ - __IO uint8_t GPOLYLU; /**< CRC_GPOLYLU register, offset: 0x5 */ - __IO uint8_t GPOLYHL; /**< CRC_GPOLYHL register, offset: 0x6 */ - __IO uint8_t GPOLYHU; /**< CRC_GPOLYHU register, offset: 0x7 */ - } GPOLY_ACCESS8BIT; - struct { /* offset: 0x4 */ - __IO uint16_t GPOLYL; /**< CRC_GPOLYL register, offset: 0x4 */ - __IO uint16_t GPOLYH; /**< CRC_GPOLYH register, offset: 0x6 */ - } GPOLY_ACCESS16BIT; - __IO uint32_t GPOLY; /**< Polynomial, offset: 0x4 */ - }; - union { /* offset: 0x8 */ - struct { /* offset: 0x8 */ - uint8_t RESERVED_0[3]; - __IO uint8_t CTRLHU; /**< CRC_CTRLHU register, offset: 0xB */ - } CTRL_ACCESS8BIT; - __IO uint32_t CTRL; /**< Control, offset: 0x8 */ - }; -} CRC_Type; - -/* ---------------------------------------------------------------------------- - -- CRC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CRC_Register_Masks CRC Register Masks - * @{ - */ - -/*! @name DATALL - CRC_DATALL register */ -/*! @{ */ - -#define CRC_DATALL_DATALL_MASK (0xFFU) -#define CRC_DATALL_DATALL_SHIFT (0U) -#define CRC_DATALL_DATALL(x) (((uint8_t)(((uint8_t)(x)) << CRC_DATALL_DATALL_SHIFT)) & CRC_DATALL_DATALL_MASK) -/*! @} */ - -/*! @name DATALU - CRC_DATALU register */ -/*! @{ */ - -#define CRC_DATALU_DATALU_MASK (0xFFU) -#define CRC_DATALU_DATALU_SHIFT (0U) -#define CRC_DATALU_DATALU(x) (((uint8_t)(((uint8_t)(x)) << CRC_DATALU_DATALU_SHIFT)) & CRC_DATALU_DATALU_MASK) -/*! @} */ - -/*! @name DATAHL - CRC_DATAHL register */ -/*! @{ */ - -#define CRC_DATAHL_DATAHL_MASK (0xFFU) -#define CRC_DATAHL_DATAHL_SHIFT (0U) -#define CRC_DATAHL_DATAHL(x) (((uint8_t)(((uint8_t)(x)) << CRC_DATAHL_DATAHL_SHIFT)) & CRC_DATAHL_DATAHL_MASK) -/*! @} */ - -/*! @name DATAHU - CRC_DATAHU register */ -/*! @{ */ - -#define CRC_DATAHU_DATAHU_MASK (0xFFU) -#define CRC_DATAHU_DATAHU_SHIFT (0U) -#define CRC_DATAHU_DATAHU(x) (((uint8_t)(((uint8_t)(x)) << CRC_DATAHU_DATAHU_SHIFT)) & CRC_DATAHU_DATAHU_MASK) -/*! @} */ - -/*! @name DATAL - CRC_DATAL register */ -/*! @{ */ - -#define CRC_DATAL_DATAL_MASK (0xFFFFU) -#define CRC_DATAL_DATAL_SHIFT (0U) -#define CRC_DATAL_DATAL(x) (((uint16_t)(((uint16_t)(x)) << CRC_DATAL_DATAL_SHIFT)) & CRC_DATAL_DATAL_MASK) -/*! @} */ - -/*! @name DATAH - CRC_DATAH register */ -/*! @{ */ - -#define CRC_DATAH_DATAH_MASK (0xFFFFU) -#define CRC_DATAH_DATAH_SHIFT (0U) -#define CRC_DATAH_DATAH(x) (((uint16_t)(((uint16_t)(x)) << CRC_DATAH_DATAH_SHIFT)) & CRC_DATAH_DATAH_MASK) -/*! @} */ - -/*! @name DATA - Data */ -/*! @{ */ - -#define CRC_DATA_LL_MASK (0xFFU) -#define CRC_DATA_LL_SHIFT (0U) -/*! LL - Lower Part of Low Byte */ -#define CRC_DATA_LL(x) (((uint32_t)(((uint32_t)(x)) << CRC_DATA_LL_SHIFT)) & CRC_DATA_LL_MASK) - -#define CRC_DATA_LU_MASK (0xFF00U) -#define CRC_DATA_LU_SHIFT (8U) -/*! LU - Upper Part of Low Byte */ -#define CRC_DATA_LU(x) (((uint32_t)(((uint32_t)(x)) << CRC_DATA_LU_SHIFT)) & CRC_DATA_LU_MASK) - -#define CRC_DATA_HL_MASK (0xFF0000U) -#define CRC_DATA_HL_SHIFT (16U) -/*! HL - Lower Part of High Byte */ -#define CRC_DATA_HL(x) (((uint32_t)(((uint32_t)(x)) << CRC_DATA_HL_SHIFT)) & CRC_DATA_HL_MASK) - -#define CRC_DATA_HU_MASK (0xFF000000U) -#define CRC_DATA_HU_SHIFT (24U) -/*! HU - Upper Part of High Byte */ -#define CRC_DATA_HU(x) (((uint32_t)(((uint32_t)(x)) << CRC_DATA_HU_SHIFT)) & CRC_DATA_HU_MASK) -/*! @} */ - -/*! @name GPOLYLL - CRC_GPOLYLL register */ -/*! @{ */ - -#define CRC_GPOLYLL_GPOLYLL_MASK (0xFFU) -#define CRC_GPOLYLL_GPOLYLL_SHIFT (0U) -#define CRC_GPOLYLL_GPOLYLL(x) (((uint8_t)(((uint8_t)(x)) << CRC_GPOLYLL_GPOLYLL_SHIFT)) & CRC_GPOLYLL_GPOLYLL_MASK) -/*! @} */ - -/*! @name GPOLYLU - CRC_GPOLYLU register */ -/*! @{ */ - -#define CRC_GPOLYLU_GPOLYLU_MASK (0xFFU) -#define CRC_GPOLYLU_GPOLYLU_SHIFT (0U) -#define CRC_GPOLYLU_GPOLYLU(x) (((uint8_t)(((uint8_t)(x)) << CRC_GPOLYLU_GPOLYLU_SHIFT)) & CRC_GPOLYLU_GPOLYLU_MASK) -/*! @} */ - -/*! @name GPOLYHL - CRC_GPOLYHL register */ -/*! @{ */ - -#define CRC_GPOLYHL_GPOLYHL_MASK (0xFFU) -#define CRC_GPOLYHL_GPOLYHL_SHIFT (0U) -#define CRC_GPOLYHL_GPOLYHL(x) (((uint8_t)(((uint8_t)(x)) << CRC_GPOLYHL_GPOLYHL_SHIFT)) & CRC_GPOLYHL_GPOLYHL_MASK) -/*! @} */ - -/*! @name GPOLYHU - CRC_GPOLYHU register */ -/*! @{ */ - -#define CRC_GPOLYHU_GPOLYHU_MASK (0xFFU) -#define CRC_GPOLYHU_GPOLYHU_SHIFT (0U) -#define CRC_GPOLYHU_GPOLYHU(x) (((uint8_t)(((uint8_t)(x)) << CRC_GPOLYHU_GPOLYHU_SHIFT)) & CRC_GPOLYHU_GPOLYHU_MASK) -/*! @} */ - -/*! @name GPOLYL - CRC_GPOLYL register */ -/*! @{ */ - -#define CRC_GPOLYL_GPOLYL_MASK (0xFFFFU) -#define CRC_GPOLYL_GPOLYL_SHIFT (0U) -#define CRC_GPOLYL_GPOLYL(x) (((uint16_t)(((uint16_t)(x)) << CRC_GPOLYL_GPOLYL_SHIFT)) & CRC_GPOLYL_GPOLYL_MASK) -/*! @} */ - -/*! @name GPOLYH - CRC_GPOLYH register */ -/*! @{ */ - -#define CRC_GPOLYH_GPOLYH_MASK (0xFFFFU) -#define CRC_GPOLYH_GPOLYH_SHIFT (0U) -#define CRC_GPOLYH_GPOLYH(x) (((uint16_t)(((uint16_t)(x)) << CRC_GPOLYH_GPOLYH_SHIFT)) & CRC_GPOLYH_GPOLYH_MASK) -/*! @} */ - -/*! @name GPOLY - Polynomial */ -/*! @{ */ - -#define CRC_GPOLY_LOW_MASK (0xFFFFU) -#define CRC_GPOLY_LOW_SHIFT (0U) -/*! LOW - Low Half-Word */ -#define CRC_GPOLY_LOW(x) (((uint32_t)(((uint32_t)(x)) << CRC_GPOLY_LOW_SHIFT)) & CRC_GPOLY_LOW_MASK) - -#define CRC_GPOLY_HIGH_MASK (0xFFFF0000U) -#define CRC_GPOLY_HIGH_SHIFT (16U) -/*! HIGH - High Half-Word */ -#define CRC_GPOLY_HIGH(x) (((uint32_t)(((uint32_t)(x)) << CRC_GPOLY_HIGH_SHIFT)) & CRC_GPOLY_HIGH_MASK) -/*! @} */ - -/*! @name CTRLHU - CRC_CTRLHU register */ -/*! @{ */ - -#define CRC_CTRLHU_TCRC_MASK (0x1U) -#define CRC_CTRLHU_TCRC_SHIFT (0U) -/*! TCRC - TCRC - * 0b0..16 bits - * 0b1..32 bits - */ -#define CRC_CTRLHU_TCRC(x) (((uint8_t)(((uint8_t)(x)) << CRC_CTRLHU_TCRC_SHIFT)) & CRC_CTRLHU_TCRC_MASK) - -#define CRC_CTRLHU_WAS_MASK (0x2U) -#define CRC_CTRLHU_WAS_SHIFT (1U) -/*! WAS - Write as Seed - * 0b0..Data values - * 0b1..Seed values - */ -#define CRC_CTRLHU_WAS(x) (((uint8_t)(((uint8_t)(x)) << CRC_CTRLHU_WAS_SHIFT)) & CRC_CTRLHU_WAS_MASK) - -#define CRC_CTRLHU_FXOR_MASK (0x4U) -#define CRC_CTRLHU_FXOR_SHIFT (2U) -/*! FXOR - Complement Read of CRC Data Register - * 0b0..Disables XOR on reading data. - * 0b1..Inverts or complements the read value of the CRC Data. - */ -#define CRC_CTRLHU_FXOR(x) (((uint8_t)(((uint8_t)(x)) << CRC_CTRLHU_FXOR_SHIFT)) & CRC_CTRLHU_FXOR_MASK) - -#define CRC_CTRLHU_TOTR_MASK (0x30U) -#define CRC_CTRLHU_TOTR_SHIFT (4U) -/*! TOTR - Transpose Type for Read - * 0b00..No transposition - * 0b01..Bits in bytes are transposed, but bytes are not transposed. - * 0b10..Both bits in bytes and bytes are transposed. - * 0b11..Only bytes are transposed, no bits in a byte are transposed. - */ -#define CRC_CTRLHU_TOTR(x) (((uint8_t)(((uint8_t)(x)) << CRC_CTRLHU_TOTR_SHIFT)) & CRC_CTRLHU_TOTR_MASK) - -#define CRC_CTRLHU_TOT_MASK (0xC0U) -#define CRC_CTRLHU_TOT_SHIFT (6U) -/*! TOT - Transpose Type for Write - * 0b00..No transposition - * 0b01..Bits in bytes are transposed, but bytes are not transposed. - * 0b10..Both bits in bytes and bytes are transposed. - * 0b11..Only bytes are transposed, no bits in a byte are transposed. - */ -#define CRC_CTRLHU_TOT(x) (((uint8_t)(((uint8_t)(x)) << CRC_CTRLHU_TOT_SHIFT)) & CRC_CTRLHU_TOT_MASK) -/*! @} */ - -/*! @name CTRL - Control */ -/*! @{ */ - -#define CRC_CTRL_TCRC_MASK (0x1000000U) -#define CRC_CTRL_TCRC_SHIFT (24U) -/*! TCRC - TCRC - * 0b0..16 bits - * 0b1..32 bits - */ -#define CRC_CTRL_TCRC(x) (((uint32_t)(((uint32_t)(x)) << CRC_CTRL_TCRC_SHIFT)) & CRC_CTRL_TCRC_MASK) - -#define CRC_CTRL_WAS_MASK (0x2000000U) -#define CRC_CTRL_WAS_SHIFT (25U) -/*! WAS - Write as Seed - * 0b0..Data values - * 0b1..Seed values - */ -#define CRC_CTRL_WAS(x) (((uint32_t)(((uint32_t)(x)) << CRC_CTRL_WAS_SHIFT)) & CRC_CTRL_WAS_MASK) - -#define CRC_CTRL_FXOR_MASK (0x4000000U) -#define CRC_CTRL_FXOR_SHIFT (26U) -/*! FXOR - Complement Read of CRC Data Register - * 0b0..Disables XOR on reading data. - * 0b1..Inverts or complements the read value of the CRC Data. - */ -#define CRC_CTRL_FXOR(x) (((uint32_t)(((uint32_t)(x)) << CRC_CTRL_FXOR_SHIFT)) & CRC_CTRL_FXOR_MASK) - -#define CRC_CTRL_TOTR_MASK (0x30000000U) -#define CRC_CTRL_TOTR_SHIFT (28U) -/*! TOTR - Transpose Type for Read - * 0b00..No transposition - * 0b01..Bits in bytes are transposed, but bytes are not transposed. - * 0b10..Both bits in bytes and bytes are transposed. - * 0b11..Only bytes are transposed, no bits in a byte are transposed. - */ -#define CRC_CTRL_TOTR(x) (((uint32_t)(((uint32_t)(x)) << CRC_CTRL_TOTR_SHIFT)) & CRC_CTRL_TOTR_MASK) - -#define CRC_CTRL_TOT_MASK (0xC0000000U) -#define CRC_CTRL_TOT_SHIFT (30U) -/*! TOT - Transpose Type for Write - * 0b00..No transposition - * 0b01..Bits in bytes are transposed, but bytes are not transposed. - * 0b10..Both bits in bytes and bytes are transposed. - * 0b11..Only bytes are transposed, no bits in a byte are transposed. - */ -#define CRC_CTRL_TOT(x) (((uint32_t)(((uint32_t)(x)) << CRC_CTRL_TOT_SHIFT)) & CRC_CTRL_TOT_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group CRC_Register_Masks */ - - -/* CRC - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral CRC0 base address */ - #define CRC0_BASE (0x500CB000u) - /** Peripheral CRC0 base address */ - #define CRC0_BASE_NS (0x400CB000u) - /** Peripheral CRC0 base pointer */ - #define CRC0 ((CRC_Type *)CRC0_BASE) - /** Peripheral CRC0 base pointer */ - #define CRC0_NS ((CRC_Type *)CRC0_BASE_NS) - /** Array initializer of CRC peripheral base addresses */ - #define CRC_BASE_ADDRS { CRC0_BASE } - /** Array initializer of CRC peripheral base pointers */ - #define CRC_BASE_PTRS { CRC0 } - /** Array initializer of CRC peripheral base addresses */ - #define CRC_BASE_ADDRS_NS { CRC0_BASE_NS } - /** Array initializer of CRC peripheral base pointers */ - #define CRC_BASE_PTRS_NS { CRC0_NS } -#else - /** Peripheral CRC0 base address */ - #define CRC0_BASE (0x400CB000u) - /** Peripheral CRC0 base pointer */ - #define CRC0 ((CRC_Type *)CRC0_BASE) - /** Array initializer of CRC peripheral base addresses */ - #define CRC_BASE_ADDRS { CRC0_BASE } - /** Array initializer of CRC peripheral base pointers */ - #define CRC_BASE_PTRS { CRC0 } -#endif - -/*! - * @} - */ /* end of group CRC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- CTIMER Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CTIMER_Peripheral_Access_Layer CTIMER Peripheral Access Layer - * @{ - */ - -/** CTIMER - Register Layout Typedef */ -typedef struct { - __IO uint32_t IR; /**< Interrupt, offset: 0x0 */ - __IO uint32_t TCR; /**< Timer Control, offset: 0x4 */ - __IO uint32_t TC; /**< Timer Counter, offset: 0x8 */ - __IO uint32_t PR; /**< Prescale, offset: 0xC */ - __IO uint32_t PC; /**< Prescale Counter, offset: 0x10 */ - __IO uint32_t MCR; /**< Match Control, offset: 0x14 */ - __IO uint32_t MR[4]; /**< Match, array offset: 0x18, array step: 0x4 */ - __IO uint32_t CCR; /**< Capture Control, offset: 0x28 */ - __I uint32_t CR[4]; /**< Capture, array offset: 0x2C, array step: 0x4 */ - __IO uint32_t EMR; /**< External Match, offset: 0x3C */ - uint8_t RESERVED_0[48]; - __IO uint32_t CTCR; /**< Count Control, offset: 0x70 */ - __IO uint32_t PWMC; /**< PWM Control, offset: 0x74 */ - __IO uint32_t MSR[4]; /**< Match Shadow, array offset: 0x78, array step: 0x4 */ -} CTIMER_Type; - -/* ---------------------------------------------------------------------------- - -- CTIMER Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CTIMER_Register_Masks CTIMER Register Masks - * @{ - */ - -/*! @name IR - Interrupt */ -/*! @{ */ - -#define CTIMER_IR_MR0INT_MASK (0x1U) -#define CTIMER_IR_MR0INT_SHIFT (0U) -/*! MR0INT - Interrupt Flag for Match Channel 0 Event */ -#define CTIMER_IR_MR0INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_MR0INT_SHIFT)) & CTIMER_IR_MR0INT_MASK) - -#define CTIMER_IR_MR1INT_MASK (0x2U) -#define CTIMER_IR_MR1INT_SHIFT (1U) -/*! MR1INT - Interrupt Flag for Match Channel 1 Event */ -#define CTIMER_IR_MR1INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_MR1INT_SHIFT)) & CTIMER_IR_MR1INT_MASK) - -#define CTIMER_IR_MR2INT_MASK (0x4U) -#define CTIMER_IR_MR2INT_SHIFT (2U) -/*! MR2INT - Interrupt Flag for Match Channel 2 Event */ -#define CTIMER_IR_MR2INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_MR2INT_SHIFT)) & CTIMER_IR_MR2INT_MASK) - -#define CTIMER_IR_MR3INT_MASK (0x8U) -#define CTIMER_IR_MR3INT_SHIFT (3U) -/*! MR3INT - Interrupt Flag for Match Channel 3 Event */ -#define CTIMER_IR_MR3INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_MR3INT_SHIFT)) & CTIMER_IR_MR3INT_MASK) - -#define CTIMER_IR_CR0INT_MASK (0x10U) -#define CTIMER_IR_CR0INT_SHIFT (4U) -/*! CR0INT - Interrupt Flag for Capture Channel 0 Event */ -#define CTIMER_IR_CR0INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_CR0INT_SHIFT)) & CTIMER_IR_CR0INT_MASK) - -#define CTIMER_IR_CR1INT_MASK (0x20U) -#define CTIMER_IR_CR1INT_SHIFT (5U) -/*! CR1INT - Interrupt Flag for Capture Channel 1 Event */ -#define CTIMER_IR_CR1INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_CR1INT_SHIFT)) & CTIMER_IR_CR1INT_MASK) - -#define CTIMER_IR_CR2INT_MASK (0x40U) -#define CTIMER_IR_CR2INT_SHIFT (6U) -/*! CR2INT - Interrupt Flag for Capture Channel 2 Event */ -#define CTIMER_IR_CR2INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_CR2INT_SHIFT)) & CTIMER_IR_CR2INT_MASK) - -#define CTIMER_IR_CR3INT_MASK (0x80U) -#define CTIMER_IR_CR3INT_SHIFT (7U) -/*! CR3INT - Interrupt Flag for Capture Channel 3 Event */ -#define CTIMER_IR_CR3INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_CR3INT_SHIFT)) & CTIMER_IR_CR3INT_MASK) -/*! @} */ - -/*! @name TCR - Timer Control */ -/*! @{ */ - -#define CTIMER_TCR_CEN_MASK (0x1U) -#define CTIMER_TCR_CEN_SHIFT (0U) -/*! CEN - Counter Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_TCR_CEN(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TCR_CEN_SHIFT)) & CTIMER_TCR_CEN_MASK) - -#define CTIMER_TCR_CRST_MASK (0x2U) -#define CTIMER_TCR_CRST_SHIFT (1U) -/*! CRST - Counter Reset Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_TCR_CRST(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TCR_CRST_SHIFT)) & CTIMER_TCR_CRST_MASK) - -#define CTIMER_TCR_AGCEN_MASK (0x10U) -#define CTIMER_TCR_AGCEN_SHIFT (4U) -/*! AGCEN - Allow Global Count Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_TCR_AGCEN(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TCR_AGCEN_SHIFT)) & CTIMER_TCR_AGCEN_MASK) - -#define CTIMER_TCR_ATCEN_MASK (0x20U) -#define CTIMER_TCR_ATCEN_SHIFT (5U) -/*! ATCEN - Allow Trigger Count Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_TCR_ATCEN(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TCR_ATCEN_SHIFT)) & CTIMER_TCR_ATCEN_MASK) -/*! @} */ - -/*! @name TC - Timer Counter */ -/*! @{ */ - -#define CTIMER_TC_TCVAL_MASK (0xFFFFFFFFU) -#define CTIMER_TC_TCVAL_SHIFT (0U) -/*! TCVAL - Timer Counter Value */ -#define CTIMER_TC_TCVAL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TC_TCVAL_SHIFT)) & CTIMER_TC_TCVAL_MASK) -/*! @} */ - -/*! @name PR - Prescale */ -/*! @{ */ - -#define CTIMER_PR_PRVAL_MASK (0xFFFFFFFFU) -#define CTIMER_PR_PRVAL_SHIFT (0U) -/*! PRVAL - Prescale Reload Value */ -#define CTIMER_PR_PRVAL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PR_PRVAL_SHIFT)) & CTIMER_PR_PRVAL_MASK) -/*! @} */ - -/*! @name PC - Prescale Counter */ -/*! @{ */ - -#define CTIMER_PC_PCVAL_MASK (0xFFFFFFFFU) -#define CTIMER_PC_PCVAL_SHIFT (0U) -/*! PCVAL - Prescale Counter Value */ -#define CTIMER_PC_PCVAL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PC_PCVAL_SHIFT)) & CTIMER_PC_PCVAL_MASK) -/*! @} */ - -/*! @name MCR - Match Control */ -/*! @{ */ - -#define CTIMER_MCR_MR0I_MASK (0x1U) -#define CTIMER_MCR_MR0I_SHIFT (0U) -/*! MR0I - Interrupt on MR0 - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_MCR_MR0I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR0I_SHIFT)) & CTIMER_MCR_MR0I_MASK) - -#define CTIMER_MCR_MR0R_MASK (0x2U) -#define CTIMER_MCR_MR0R_SHIFT (1U) -/*! MR0R - Reset on MR0 - * 0b0..Does not reset - * 0b1..Resets - */ -#define CTIMER_MCR_MR0R(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR0R_SHIFT)) & CTIMER_MCR_MR0R_MASK) - -#define CTIMER_MCR_MR0S_MASK (0x4U) -#define CTIMER_MCR_MR0S_SHIFT (2U) -/*! MR0S - Stop on MR0 - * 0b0..Does not stop - * 0b1..Stops - */ -#define CTIMER_MCR_MR0S(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR0S_SHIFT)) & CTIMER_MCR_MR0S_MASK) - -#define CTIMER_MCR_MR1I_MASK (0x8U) -#define CTIMER_MCR_MR1I_SHIFT (3U) -/*! MR1I - Interrupt on MR1 - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_MCR_MR1I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR1I_SHIFT)) & CTIMER_MCR_MR1I_MASK) - -#define CTIMER_MCR_MR1R_MASK (0x10U) -#define CTIMER_MCR_MR1R_SHIFT (4U) -/*! MR1R - Reset on MR1 - * 0b0..Does not reset - * 0b1..Resets - */ -#define CTIMER_MCR_MR1R(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR1R_SHIFT)) & CTIMER_MCR_MR1R_MASK) - -#define CTIMER_MCR_MR1S_MASK (0x20U) -#define CTIMER_MCR_MR1S_SHIFT (5U) -/*! MR1S - Stop on MR1 - * 0b0..Does not stop - * 0b1..Stops - */ -#define CTIMER_MCR_MR1S(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR1S_SHIFT)) & CTIMER_MCR_MR1S_MASK) - -#define CTIMER_MCR_MR2I_MASK (0x40U) -#define CTIMER_MCR_MR2I_SHIFT (6U) -/*! MR2I - Interrupt on MR2 - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_MCR_MR2I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR2I_SHIFT)) & CTIMER_MCR_MR2I_MASK) - -#define CTIMER_MCR_MR2R_MASK (0x80U) -#define CTIMER_MCR_MR2R_SHIFT (7U) -/*! MR2R - Reset on MR2 - * 0b0..Does not reset - * 0b1..Resets - */ -#define CTIMER_MCR_MR2R(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR2R_SHIFT)) & CTIMER_MCR_MR2R_MASK) - -#define CTIMER_MCR_MR2S_MASK (0x100U) -#define CTIMER_MCR_MR2S_SHIFT (8U) -/*! MR2S - Stop on MR2 - * 0b0..Does not stop - * 0b1..Stops - */ -#define CTIMER_MCR_MR2S(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR2S_SHIFT)) & CTIMER_MCR_MR2S_MASK) - -#define CTIMER_MCR_MR3I_MASK (0x200U) -#define CTIMER_MCR_MR3I_SHIFT (9U) -/*! MR3I - Interrupt on MR3 - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_MCR_MR3I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR3I_SHIFT)) & CTIMER_MCR_MR3I_MASK) - -#define CTIMER_MCR_MR3R_MASK (0x400U) -#define CTIMER_MCR_MR3R_SHIFT (10U) -/*! MR3R - Reset on MR3 - * 0b0..Does not reset - * 0b1..Resets - */ -#define CTIMER_MCR_MR3R(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR3R_SHIFT)) & CTIMER_MCR_MR3R_MASK) - -#define CTIMER_MCR_MR3S_MASK (0x800U) -#define CTIMER_MCR_MR3S_SHIFT (11U) -/*! MR3S - Stop on MR3 - * 0b0..Does not stop - * 0b1..Stops - */ -#define CTIMER_MCR_MR3S(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR3S_SHIFT)) & CTIMER_MCR_MR3S_MASK) - -#define CTIMER_MCR_MR0RL_MASK (0x1000000U) -#define CTIMER_MCR_MR0RL_SHIFT (24U) -/*! MR0RL - Reload MR - * 0b0..Does not reload - * 0b1..Reloads - */ -#define CTIMER_MCR_MR0RL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR0RL_SHIFT)) & CTIMER_MCR_MR0RL_MASK) - -#define CTIMER_MCR_MR1RL_MASK (0x2000000U) -#define CTIMER_MCR_MR1RL_SHIFT (25U) -/*! MR1RL - Reload MR - * 0b0..Does not reload - * 0b1..Reloads - */ -#define CTIMER_MCR_MR1RL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR1RL_SHIFT)) & CTIMER_MCR_MR1RL_MASK) - -#define CTIMER_MCR_MR2RL_MASK (0x4000000U) -#define CTIMER_MCR_MR2RL_SHIFT (26U) -/*! MR2RL - Reload MR - * 0b0..Does not reload - * 0b1..Reloads - */ -#define CTIMER_MCR_MR2RL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR2RL_SHIFT)) & CTIMER_MCR_MR2RL_MASK) - -#define CTIMER_MCR_MR3RL_MASK (0x8000000U) -#define CTIMER_MCR_MR3RL_SHIFT (27U) -/*! MR3RL - Reload MR - * 0b0..Does not reload - * 0b1..Reloads - */ -#define CTIMER_MCR_MR3RL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR3RL_SHIFT)) & CTIMER_MCR_MR3RL_MASK) -/*! @} */ - -/*! @name MR - Match */ -/*! @{ */ - -#define CTIMER_MR_MATCH_MASK (0xFFFFFFFFU) -#define CTIMER_MR_MATCH_SHIFT (0U) -/*! MATCH - Timer Counter Match Value */ -#define CTIMER_MR_MATCH(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MR_MATCH_SHIFT)) & CTIMER_MR_MATCH_MASK) -/*! @} */ - -/* The count of CTIMER_MR */ -#define CTIMER_MR_COUNT (4U) - -/*! @name CCR - Capture Control */ -/*! @{ */ - -#define CTIMER_CCR_CAP0RE_MASK (0x1U) -#define CTIMER_CCR_CAP0RE_SHIFT (0U) -/*! CAP0RE - Rising Edge of Capture Channel 0 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP0RE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP0RE_SHIFT)) & CTIMER_CCR_CAP0RE_MASK) - -#define CTIMER_CCR_CAP0FE_MASK (0x2U) -#define CTIMER_CCR_CAP0FE_SHIFT (1U) -/*! CAP0FE - Falling Edge of Capture Channel 0 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP0FE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP0FE_SHIFT)) & CTIMER_CCR_CAP0FE_MASK) - -#define CTIMER_CCR_CAP0I_MASK (0x4U) -#define CTIMER_CCR_CAP0I_SHIFT (2U) -/*! CAP0I - Generate Interrupt on Channel 0 Capture Event - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_CCR_CAP0I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP0I_SHIFT)) & CTIMER_CCR_CAP0I_MASK) - -#define CTIMER_CCR_CAP1RE_MASK (0x8U) -#define CTIMER_CCR_CAP1RE_SHIFT (3U) -/*! CAP1RE - Rising Edge of Capture Channel 1 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP1RE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP1RE_SHIFT)) & CTIMER_CCR_CAP1RE_MASK) - -#define CTIMER_CCR_CAP1FE_MASK (0x10U) -#define CTIMER_CCR_CAP1FE_SHIFT (4U) -/*! CAP1FE - Falling Edge of Capture Channel 1 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP1FE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP1FE_SHIFT)) & CTIMER_CCR_CAP1FE_MASK) - -#define CTIMER_CCR_CAP1I_MASK (0x20U) -#define CTIMER_CCR_CAP1I_SHIFT (5U) -/*! CAP1I - Generate Interrupt on Channel 1 Capture Event - * 0b0..Does not generates - * 0b1..Generates - */ -#define CTIMER_CCR_CAP1I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP1I_SHIFT)) & CTIMER_CCR_CAP1I_MASK) - -#define CTIMER_CCR_CAP2RE_MASK (0x40U) -#define CTIMER_CCR_CAP2RE_SHIFT (6U) -/*! CAP2RE - Rising Edge of Capture Channel 2 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP2RE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP2RE_SHIFT)) & CTIMER_CCR_CAP2RE_MASK) - -#define CTIMER_CCR_CAP2FE_MASK (0x80U) -#define CTIMER_CCR_CAP2FE_SHIFT (7U) -/*! CAP2FE - Falling Edge of Capture Channel 2 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP2FE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP2FE_SHIFT)) & CTIMER_CCR_CAP2FE_MASK) - -#define CTIMER_CCR_CAP2I_MASK (0x100U) -#define CTIMER_CCR_CAP2I_SHIFT (8U) -/*! CAP2I - Generate Interrupt on Channel 2 Capture Event - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_CCR_CAP2I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP2I_SHIFT)) & CTIMER_CCR_CAP2I_MASK) - -#define CTIMER_CCR_CAP3RE_MASK (0x200U) -#define CTIMER_CCR_CAP3RE_SHIFT (9U) -/*! CAP3RE - Rising Edge of Capture Channel 3 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP3RE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP3RE_SHIFT)) & CTIMER_CCR_CAP3RE_MASK) - -#define CTIMER_CCR_CAP3FE_MASK (0x400U) -#define CTIMER_CCR_CAP3FE_SHIFT (10U) -/*! CAP3FE - Falling Edge of Capture Channel 3 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP3FE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP3FE_SHIFT)) & CTIMER_CCR_CAP3FE_MASK) - -#define CTIMER_CCR_CAP3I_MASK (0x800U) -#define CTIMER_CCR_CAP3I_SHIFT (11U) -/*! CAP3I - Generate Interrupt on Channel 3 Capture Event - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_CCR_CAP3I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP3I_SHIFT)) & CTIMER_CCR_CAP3I_MASK) -/*! @} */ - -/*! @name CR - Capture */ -/*! @{ */ - -#define CTIMER_CR_CAP_MASK (0xFFFFFFFFU) -#define CTIMER_CR_CAP_SHIFT (0U) -/*! CAP - Timer Counter Capture Value */ -#define CTIMER_CR_CAP(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CR_CAP_SHIFT)) & CTIMER_CR_CAP_MASK) -/*! @} */ - -/* The count of CTIMER_CR */ -#define CTIMER_CR_COUNT (4U) - -/*! @name EMR - External Match */ -/*! @{ */ - -#define CTIMER_EMR_EM0_MASK (0x1U) -#define CTIMER_EMR_EM0_SHIFT (0U) -/*! EM0 - External Match 0 - * 0b0..Low - * 0b1..High - */ -#define CTIMER_EMR_EM0(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EM0_SHIFT)) & CTIMER_EMR_EM0_MASK) - -#define CTIMER_EMR_EM1_MASK (0x2U) -#define CTIMER_EMR_EM1_SHIFT (1U) -/*! EM1 - External Match 1 - * 0b0..Low - * 0b1..High - */ -#define CTIMER_EMR_EM1(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EM1_SHIFT)) & CTIMER_EMR_EM1_MASK) - -#define CTIMER_EMR_EM2_MASK (0x4U) -#define CTIMER_EMR_EM2_SHIFT (2U) -/*! EM2 - External Match 2 - * 0b0..Low - * 0b1..High - */ -#define CTIMER_EMR_EM2(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EM2_SHIFT)) & CTIMER_EMR_EM2_MASK) - -#define CTIMER_EMR_EM3_MASK (0x8U) -#define CTIMER_EMR_EM3_SHIFT (3U) -/*! EM3 - External Match 3 - * 0b0..Low - * 0b1..High - */ -#define CTIMER_EMR_EM3(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EM3_SHIFT)) & CTIMER_EMR_EM3_MASK) - -#define CTIMER_EMR_EMC0_MASK (0x30U) -#define CTIMER_EMR_EMC0_SHIFT (4U) -/*! EMC0 - External Match Control 0 - * 0b00..Does nothing - * 0b01..Goes low - * 0b10..Goes high - * 0b11..Toggles - */ -#define CTIMER_EMR_EMC0(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EMC0_SHIFT)) & CTIMER_EMR_EMC0_MASK) - -#define CTIMER_EMR_EMC1_MASK (0xC0U) -#define CTIMER_EMR_EMC1_SHIFT (6U) -/*! EMC1 - External Match Control 1 - * 0b00..Does nothing - * 0b01..Goes low - * 0b10..Goes high - * 0b11..Toggles - */ -#define CTIMER_EMR_EMC1(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EMC1_SHIFT)) & CTIMER_EMR_EMC1_MASK) - -#define CTIMER_EMR_EMC2_MASK (0x300U) -#define CTIMER_EMR_EMC2_SHIFT (8U) -/*! EMC2 - External Match Control 2 - * 0b00..Does nothing - * 0b01..Goes low - * 0b10..Goes high - * 0b11..Toggles - */ -#define CTIMER_EMR_EMC2(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EMC2_SHIFT)) & CTIMER_EMR_EMC2_MASK) - -#define CTIMER_EMR_EMC3_MASK (0xC00U) -#define CTIMER_EMR_EMC3_SHIFT (10U) -/*! EMC3 - External Match Control 3 - * 0b00..Does nothing - * 0b01..Goes low - * 0b10..Goes high - * 0b11..Toggles - */ -#define CTIMER_EMR_EMC3(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EMC3_SHIFT)) & CTIMER_EMR_EMC3_MASK) -/*! @} */ - -/*! @name CTCR - Count Control */ -/*! @{ */ - -#define CTIMER_CTCR_CTMODE_MASK (0x3U) -#define CTIMER_CTCR_CTMODE_SHIFT (0U) -/*! CTMODE - Counter Timer Mode - * 0b00..Timer mode - * 0b01..Counter mode rising edge - * 0b10..Counter mode falling edge - * 0b11..Counter mode dual edge - */ -#define CTIMER_CTCR_CTMODE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CTCR_CTMODE_SHIFT)) & CTIMER_CTCR_CTMODE_MASK) - -#define CTIMER_CTCR_CINSEL_MASK (0xCU) -#define CTIMER_CTCR_CINSEL_SHIFT (2U) -/*! CINSEL - Count Input Select - * 0b00..Channel 0, CAPn[0] for CTIMERn - * 0b01..Channel 1, CAPn[1] for CTIMERn - * 0b10..Channel 2, CAPn[2] for CTIMERn - * 0b11..Channel 3, CAPn[3] for CTIMERn - */ -#define CTIMER_CTCR_CINSEL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CTCR_CINSEL_SHIFT)) & CTIMER_CTCR_CINSEL_MASK) - -#define CTIMER_CTCR_ENCC_MASK (0x10U) -#define CTIMER_CTCR_ENCC_SHIFT (4U) -/*! ENCC - Capture Channel Enable */ -#define CTIMER_CTCR_ENCC(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CTCR_ENCC_SHIFT)) & CTIMER_CTCR_ENCC_MASK) - -#define CTIMER_CTCR_SELCC_MASK (0xE0U) -#define CTIMER_CTCR_SELCC_SHIFT (5U) -/*! SELCC - Edge Select - * 0b000..Capture channel 0 rising edge - * 0b001..Capture channel 0 falling edge - * 0b010..Capture channel 1 rising edge - * 0b011..Capture channel 1 falling edge - * 0b100..Capture channel 2 rising edge - * 0b101..Capture channel 2 falling edge - */ -#define CTIMER_CTCR_SELCC(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CTCR_SELCC_SHIFT)) & CTIMER_CTCR_SELCC_MASK) -/*! @} */ - -/*! @name PWMC - PWM Control */ -/*! @{ */ - -#define CTIMER_PWMC_PWMEN0_MASK (0x1U) -#define CTIMER_PWMC_PWMEN0_SHIFT (0U) -/*! PWMEN0 - PWM Mode Enable for Channel 0 - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_PWMC_PWMEN0(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PWMC_PWMEN0_SHIFT)) & CTIMER_PWMC_PWMEN0_MASK) - -#define CTIMER_PWMC_PWMEN1_MASK (0x2U) -#define CTIMER_PWMC_PWMEN1_SHIFT (1U) -/*! PWMEN1 - PWM Mode Enable for Channel 1 - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_PWMC_PWMEN1(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PWMC_PWMEN1_SHIFT)) & CTIMER_PWMC_PWMEN1_MASK) - -#define CTIMER_PWMC_PWMEN2_MASK (0x4U) -#define CTIMER_PWMC_PWMEN2_SHIFT (2U) -/*! PWMEN2 - PWM Mode Enable for Channel 2 - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_PWMC_PWMEN2(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PWMC_PWMEN2_SHIFT)) & CTIMER_PWMC_PWMEN2_MASK) - -#define CTIMER_PWMC_PWMEN3_MASK (0x8U) -#define CTIMER_PWMC_PWMEN3_SHIFT (3U) -/*! PWMEN3 - PWM Mode Enable for Channel 3 - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_PWMC_PWMEN3(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PWMC_PWMEN3_SHIFT)) & CTIMER_PWMC_PWMEN3_MASK) -/*! @} */ - -/*! @name MSR - Match Shadow */ -/*! @{ */ - -#define CTIMER_MSR_MATCH_SHADOW_MASK (0xFFFFFFFFU) -#define CTIMER_MSR_MATCH_SHADOW_SHIFT (0U) -/*! MATCH_SHADOW - Timer Counter Match Shadow Value */ -#define CTIMER_MSR_MATCH_SHADOW(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MSR_MATCH_SHADOW_SHIFT)) & CTIMER_MSR_MATCH_SHADOW_MASK) -/*! @} */ - -/* The count of CTIMER_MSR */ -#define CTIMER_MSR_COUNT (4U) - - -/*! - * @} - */ /* end of group CTIMER_Register_Masks */ - - -/* CTIMER - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral CTIMER0 base address */ - #define CTIMER0_BASE (0x5000C000u) - /** Peripheral CTIMER0 base address */ - #define CTIMER0_BASE_NS (0x4000C000u) - /** Peripheral CTIMER0 base pointer */ - #define CTIMER0 ((CTIMER_Type *)CTIMER0_BASE) - /** Peripheral CTIMER0 base pointer */ - #define CTIMER0_NS ((CTIMER_Type *)CTIMER0_BASE_NS) - /** Peripheral CTIMER1 base address */ - #define CTIMER1_BASE (0x5000D000u) - /** Peripheral CTIMER1 base address */ - #define CTIMER1_BASE_NS (0x4000D000u) - /** Peripheral CTIMER1 base pointer */ - #define CTIMER1 ((CTIMER_Type *)CTIMER1_BASE) - /** Peripheral CTIMER1 base pointer */ - #define CTIMER1_NS ((CTIMER_Type *)CTIMER1_BASE_NS) - /** Peripheral CTIMER2 base address */ - #define CTIMER2_BASE (0x5000E000u) - /** Peripheral CTIMER2 base address */ - #define CTIMER2_BASE_NS (0x4000E000u) - /** Peripheral CTIMER2 base pointer */ - #define CTIMER2 ((CTIMER_Type *)CTIMER2_BASE) - /** Peripheral CTIMER2 base pointer */ - #define CTIMER2_NS ((CTIMER_Type *)CTIMER2_BASE_NS) - /** Peripheral CTIMER3 base address */ - #define CTIMER3_BASE (0x5000F000u) - /** Peripheral CTIMER3 base address */ - #define CTIMER3_BASE_NS (0x4000F000u) - /** Peripheral CTIMER3 base pointer */ - #define CTIMER3 ((CTIMER_Type *)CTIMER3_BASE) - /** Peripheral CTIMER3 base pointer */ - #define CTIMER3_NS ((CTIMER_Type *)CTIMER3_BASE_NS) - /** Peripheral CTIMER4 base address */ - #define CTIMER4_BASE (0x50010000u) - /** Peripheral CTIMER4 base address */ - #define CTIMER4_BASE_NS (0x40010000u) - /** Peripheral CTIMER4 base pointer */ - #define CTIMER4 ((CTIMER_Type *)CTIMER4_BASE) - /** Peripheral CTIMER4 base pointer */ - #define CTIMER4_NS ((CTIMER_Type *)CTIMER4_BASE_NS) - /** Array initializer of CTIMER peripheral base addresses */ - #define CTIMER_BASE_ADDRS { CTIMER0_BASE, CTIMER1_BASE, CTIMER2_BASE, CTIMER3_BASE, CTIMER4_BASE } - /** Array initializer of CTIMER peripheral base pointers */ - #define CTIMER_BASE_PTRS { CTIMER0, CTIMER1, CTIMER2, CTIMER3, CTIMER4 } - /** Array initializer of CTIMER peripheral base addresses */ - #define CTIMER_BASE_ADDRS_NS { CTIMER0_BASE_NS, CTIMER1_BASE_NS, CTIMER2_BASE_NS, CTIMER3_BASE_NS, CTIMER4_BASE_NS } - /** Array initializer of CTIMER peripheral base pointers */ - #define CTIMER_BASE_PTRS_NS { CTIMER0_NS, CTIMER1_NS, CTIMER2_NS, CTIMER3_NS, CTIMER4_NS } -#else - /** Peripheral CTIMER0 base address */ - #define CTIMER0_BASE (0x4000C000u) - /** Peripheral CTIMER0 base pointer */ - #define CTIMER0 ((CTIMER_Type *)CTIMER0_BASE) - /** Peripheral CTIMER1 base address */ - #define CTIMER1_BASE (0x4000D000u) - /** Peripheral CTIMER1 base pointer */ - #define CTIMER1 ((CTIMER_Type *)CTIMER1_BASE) - /** Peripheral CTIMER2 base address */ - #define CTIMER2_BASE (0x4000E000u) - /** Peripheral CTIMER2 base pointer */ - #define CTIMER2 ((CTIMER_Type *)CTIMER2_BASE) - /** Peripheral CTIMER3 base address */ - #define CTIMER3_BASE (0x4000F000u) - /** Peripheral CTIMER3 base pointer */ - #define CTIMER3 ((CTIMER_Type *)CTIMER3_BASE) - /** Peripheral CTIMER4 base address */ - #define CTIMER4_BASE (0x40010000u) - /** Peripheral CTIMER4 base pointer */ - #define CTIMER4 ((CTIMER_Type *)CTIMER4_BASE) - /** Array initializer of CTIMER peripheral base addresses */ - #define CTIMER_BASE_ADDRS { CTIMER0_BASE, CTIMER1_BASE, CTIMER2_BASE, CTIMER3_BASE, CTIMER4_BASE } - /** Array initializer of CTIMER peripheral base pointers */ - #define CTIMER_BASE_PTRS { CTIMER0, CTIMER1, CTIMER2, CTIMER3, CTIMER4 } -#endif -/** Interrupt vectors for the CTIMER peripheral type */ -#define CTIMER_IRQS { CTIMER0_IRQn, CTIMER1_IRQn, CTIMER2_IRQn, CTIMER3_IRQn, CTIMER4_IRQn } - -/*! - * @} - */ /* end of group CTIMER_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- DIGTMP Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DIGTMP_Peripheral_Access_Layer DIGTMP Peripheral Access Layer - * @{ - */ - -/** DIGTMP - Register Layout Typedef */ -typedef struct { - uint8_t RESERVED_0[16]; - __IO uint32_t CR; /**< Control, offset: 0x10 */ - __IO uint32_t SR; /**< Status, offset: 0x14 */ - __IO uint32_t LR; /**< Lock, offset: 0x18 */ - __IO uint32_t IER; /**< Interrupt Enable, offset: 0x1C */ - __IO uint32_t TSR; /**< Tamper Seconds, offset: 0x20 */ - __IO uint32_t TER; /**< Tamper Enable, offset: 0x24 */ - __IO uint32_t PDR; /**< Pin Direction, offset: 0x28 */ - __IO uint32_t PPR; /**< Pin Polarity, offset: 0x2C */ - __IO uint32_t ATR[2]; /**< Active Tamper, array offset: 0x30, array step: 0x4 */ - uint8_t RESERVED_1[8]; - __IO uint32_t PGFR[8]; /**< Pin Glitch Filter, array offset: 0x40, array step: 0x4 */ -} DIGTMP_Type; - -/* ---------------------------------------------------------------------------- - -- DIGTMP Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DIGTMP_Register_Masks DIGTMP Register Masks - * @{ - */ - -/*! @name CR - Control */ -/*! @{ */ - -#define DIGTMP_CR_SWR_MASK (0x1U) -#define DIGTMP_CR_SWR_SHIFT (0U) -/*! SWR - Software Reset - * 0b0..No effect - * 0b1..Perform a software reset - */ -#define DIGTMP_CR_SWR(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_CR_SWR_SHIFT)) & DIGTMP_CR_SWR_MASK) - -#define DIGTMP_CR_DEN_MASK (0x2U) -#define DIGTMP_CR_DEN_SHIFT (1U) -/*! DEN - Digital Tamper Enable - * 0b0..Disables TDET clock and prescaler - * 0b1..Enables TDET clock and prescaler - */ -#define DIGTMP_CR_DEN(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_CR_DEN_SHIFT)) & DIGTMP_CR_DEN_MASK) - -#define DIGTMP_CR_TFSR_MASK (0x4U) -#define DIGTMP_CR_TFSR_SHIFT (2U) -/*! TFSR - Tamper Force System Reset - * 0b0..Do not force chip reset - * 0b1..Force chip reset - */ -#define DIGTMP_CR_TFSR(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_CR_TFSR_SHIFT)) & DIGTMP_CR_TFSR_MASK) - -#define DIGTMP_CR_UM_MASK (0x8U) -#define DIGTMP_CR_UM_SHIFT (3U) -/*! UM - Update Mode - * 0b0..No effect - * 0b1..Allows the clearing of interrupts - */ -#define DIGTMP_CR_UM(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_CR_UM_SHIFT)) & DIGTMP_CR_UM_MASK) - -#define DIGTMP_CR_ATCS0_MASK (0x10U) -#define DIGTMP_CR_ATCS0_SHIFT (4U) -/*! ATCS0 - Active Tamper Clock Source - * 0b0..1 Hz prescaler clock - * 0b1..64 Hz prescaler clock - */ -#define DIGTMP_CR_ATCS0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_CR_ATCS0_SHIFT)) & DIGTMP_CR_ATCS0_MASK) - -#define DIGTMP_CR_ATCS1_MASK (0x20U) -#define DIGTMP_CR_ATCS1_SHIFT (5U) -/*! ATCS1 - Active Tamper Clock Source - * 0b0..1 Hz prescaler clock - * 0b1..64 Hz prescaler clock - */ -#define DIGTMP_CR_ATCS1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_CR_ATCS1_SHIFT)) & DIGTMP_CR_ATCS1_MASK) - -#define DIGTMP_CR_DISTAM_MASK (0x100U) -#define DIGTMP_CR_DISTAM_SHIFT (8U) -/*! DISTAM - Disable Prescaler On Tamper - * 0b0..No effect - * 0b1..Automatically disables the prescaler after tamper detection - */ -#define DIGTMP_CR_DISTAM(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_CR_DISTAM_SHIFT)) & DIGTMP_CR_DISTAM_MASK) - -#define DIGTMP_CR_DPR_MASK (0xFFFE0000U) -#define DIGTMP_CR_DPR_SHIFT (17U) -/*! DPR - Digital Tamper Prescaler */ -#define DIGTMP_CR_DPR(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_CR_DPR_SHIFT)) & DIGTMP_CR_DPR_MASK) -/*! @} */ - -/*! @name SR - Status */ -/*! @{ */ - -#define DIGTMP_SR_DTF_MASK (0x1U) -#define DIGTMP_SR_DTF_SHIFT (0U) -/*! DTF - Digital Tamper Flag - * 0b0..TDET tampering not detected - * 0b1..TDET tampering detected - */ -#define DIGTMP_SR_DTF(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_DTF_SHIFT)) & DIGTMP_SR_DTF_MASK) - -#define DIGTMP_SR_TAF_MASK (0x2U) -#define DIGTMP_SR_TAF_SHIFT (1U) -/*! TAF - Tamper Acknowledge Flag - * 0b0..Digital Tamper Flag (SR[DTF]) is clear or chip reset has not occurred after Digital Tamper Flag (SR[DTF]) was set. - * 0b1..Chip reset has occurred after Digital Tamper Flag (SR[DTF]) was set. - */ -#define DIGTMP_SR_TAF(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TAF_SHIFT)) & DIGTMP_SR_TAF_MASK) - -#define DIGTMP_SR_TIF0_MASK (0x4U) -#define DIGTMP_SR_TIF0_SHIFT (2U) -/*! TIF0 - Tamper Input n Flag - * 0b0..On-chip tamper not detected - * 0b1..On-chip tamper detected - */ -#define DIGTMP_SR_TIF0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TIF0_SHIFT)) & DIGTMP_SR_TIF0_MASK) - -#define DIGTMP_SR_TIF1_MASK (0x8U) -#define DIGTMP_SR_TIF1_SHIFT (3U) -/*! TIF1 - Tamper Input n Flag - * 0b0..On-chip tamper not detected - * 0b1..On-chip tamper detected - */ -#define DIGTMP_SR_TIF1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TIF1_SHIFT)) & DIGTMP_SR_TIF1_MASK) - -#define DIGTMP_SR_TIF2_MASK (0x10U) -#define DIGTMP_SR_TIF2_SHIFT (4U) -/*! TIF2 - Tamper Input n Flag - * 0b0..On-chip tamper not detected - * 0b1..On-chip tamper detected - */ -#define DIGTMP_SR_TIF2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TIF2_SHIFT)) & DIGTMP_SR_TIF2_MASK) - -#define DIGTMP_SR_TIF3_MASK (0x20U) -#define DIGTMP_SR_TIF3_SHIFT (5U) -/*! TIF3 - Tamper Input n Flag - * 0b0..On-chip tamper not detected - * 0b1..On-chip tamper detected - */ -#define DIGTMP_SR_TIF3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TIF3_SHIFT)) & DIGTMP_SR_TIF3_MASK) - -#define DIGTMP_SR_TIF4_MASK (0x40U) -#define DIGTMP_SR_TIF4_SHIFT (6U) -/*! TIF4 - Tamper Input n Flag - * 0b0..On-chip tamper not detected - * 0b1..On-chip tamper detected - */ -#define DIGTMP_SR_TIF4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TIF4_SHIFT)) & DIGTMP_SR_TIF4_MASK) - -#define DIGTMP_SR_TIF5_MASK (0x80U) -#define DIGTMP_SR_TIF5_SHIFT (7U) -/*! TIF5 - Tamper Input n Flag - * 0b0..On-chip tamper not detected - * 0b1..On-chip tamper detected - */ -#define DIGTMP_SR_TIF5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TIF5_SHIFT)) & DIGTMP_SR_TIF5_MASK) - -#define DIGTMP_SR_TIF6_MASK (0x100U) -#define DIGTMP_SR_TIF6_SHIFT (8U) -/*! TIF6 - Tamper Input n Flag - * 0b0..On-chip tamper not detected - * 0b1..On-chip tamper detected - */ -#define DIGTMP_SR_TIF6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TIF6_SHIFT)) & DIGTMP_SR_TIF6_MASK) - -#define DIGTMP_SR_TIF7_MASK (0x200U) -#define DIGTMP_SR_TIF7_SHIFT (9U) -/*! TIF7 - Tamper Input n Flag - * 0b0..On-chip tamper not detected - * 0b1..On-chip tamper detected - */ -#define DIGTMP_SR_TIF7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TIF7_SHIFT)) & DIGTMP_SR_TIF7_MASK) - -#define DIGTMP_SR_TIF8_MASK (0x400U) -#define DIGTMP_SR_TIF8_SHIFT (10U) -/*! TIF8 - Tamper Input n Flag - * 0b0..On-chip tamper not detected - * 0b1..On-chip tamper detected - */ -#define DIGTMP_SR_TIF8(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TIF8_SHIFT)) & DIGTMP_SR_TIF8_MASK) - -#define DIGTMP_SR_TIF9_MASK (0x800U) -#define DIGTMP_SR_TIF9_SHIFT (11U) -/*! TIF9 - Tamper Input n Flag - * 0b0..On-chip tamper not detected - * 0b1..On-chip tamper detected - */ -#define DIGTMP_SR_TIF9(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TIF9_SHIFT)) & DIGTMP_SR_TIF9_MASK) - -#define DIGTMP_SR_TPF0_MASK (0x10000U) -#define DIGTMP_SR_TPF0_SHIFT (16U) -/*! TPF0 - Tamper Pin n Flag - * 0b0..Pin tamper not detected - * 0b1..Pin tamper detected - */ -#define DIGTMP_SR_TPF0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TPF0_SHIFT)) & DIGTMP_SR_TPF0_MASK) - -#define DIGTMP_SR_TPF1_MASK (0x20000U) -#define DIGTMP_SR_TPF1_SHIFT (17U) -/*! TPF1 - Tamper Pin n Flag - * 0b0..Pin tamper not detected - * 0b1..Pin tamper detected - */ -#define DIGTMP_SR_TPF1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TPF1_SHIFT)) & DIGTMP_SR_TPF1_MASK) - -#define DIGTMP_SR_TPF2_MASK (0x40000U) -#define DIGTMP_SR_TPF2_SHIFT (18U) -/*! TPF2 - Tamper Pin n Flag - * 0b0..Pin tamper not detected - * 0b1..Pin tamper detected - */ -#define DIGTMP_SR_TPF2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TPF2_SHIFT)) & DIGTMP_SR_TPF2_MASK) - -#define DIGTMP_SR_TPF3_MASK (0x80000U) -#define DIGTMP_SR_TPF3_SHIFT (19U) -/*! TPF3 - Tamper Pin n Flag - * 0b0..Pin tamper not detected - * 0b1..Pin tamper detected - */ -#define DIGTMP_SR_TPF3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TPF3_SHIFT)) & DIGTMP_SR_TPF3_MASK) - -#define DIGTMP_SR_TPF4_MASK (0x100000U) -#define DIGTMP_SR_TPF4_SHIFT (20U) -/*! TPF4 - Tamper Pin n Flag - * 0b0..Pin tamper not detected - * 0b1..Pin tamper detected - */ -#define DIGTMP_SR_TPF4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TPF4_SHIFT)) & DIGTMP_SR_TPF4_MASK) - -#define DIGTMP_SR_TPF5_MASK (0x200000U) -#define DIGTMP_SR_TPF5_SHIFT (21U) -/*! TPF5 - Tamper Pin n Flag - * 0b0..Pin tamper not detected - * 0b1..Pin tamper detected - */ -#define DIGTMP_SR_TPF5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TPF5_SHIFT)) & DIGTMP_SR_TPF5_MASK) - -#define DIGTMP_SR_TPF6_MASK (0x400000U) -#define DIGTMP_SR_TPF6_SHIFT (22U) -/*! TPF6 - Tamper Pin n Flag - * 0b0..Pin tamper not detected - * 0b1..Pin tamper detected - */ -#define DIGTMP_SR_TPF6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TPF6_SHIFT)) & DIGTMP_SR_TPF6_MASK) - -#define DIGTMP_SR_TPF7_MASK (0x800000U) -#define DIGTMP_SR_TPF7_SHIFT (23U) -/*! TPF7 - Tamper Pin n Flag - * 0b0..Pin tamper not detected - * 0b1..Pin tamper detected - */ -#define DIGTMP_SR_TPF7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TPF7_SHIFT)) & DIGTMP_SR_TPF7_MASK) -/*! @} */ - -/*! @name LR - Lock */ -/*! @{ */ - -#define DIGTMP_LR_CRL_MASK (0x10U) -#define DIGTMP_LR_CRL_SHIFT (4U) -/*! CRL - Control Register Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_CRL(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_CRL_SHIFT)) & DIGTMP_LR_CRL_MASK) - -#define DIGTMP_LR_SRL_MASK (0x20U) -#define DIGTMP_LR_SRL_SHIFT (5U) -/*! SRL - Status Register Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_SRL(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_SRL_SHIFT)) & DIGTMP_LR_SRL_MASK) - -#define DIGTMP_LR_LRL_MASK (0x40U) -#define DIGTMP_LR_LRL_SHIFT (6U) -/*! LRL - Lock Register Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_LRL(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_LRL_SHIFT)) & DIGTMP_LR_LRL_MASK) - -#define DIGTMP_LR_IEL_MASK (0x80U) -#define DIGTMP_LR_IEL_SHIFT (7U) -/*! IEL - Interrupt Enable Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_IEL(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_IEL_SHIFT)) & DIGTMP_LR_IEL_MASK) - -#define DIGTMP_LR_TSL_MASK (0x100U) -#define DIGTMP_LR_TSL_SHIFT (8U) -/*! TSL - Tamper Seconds Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_TSL(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_TSL_SHIFT)) & DIGTMP_LR_TSL_MASK) - -#define DIGTMP_LR_TEL_MASK (0x200U) -#define DIGTMP_LR_TEL_SHIFT (9U) -/*! TEL - Tamper Enable Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_TEL(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_TEL_SHIFT)) & DIGTMP_LR_TEL_MASK) - -#define DIGTMP_LR_PDL_MASK (0x400U) -#define DIGTMP_LR_PDL_SHIFT (10U) -/*! PDL - Pin Direction Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_PDL(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_PDL_SHIFT)) & DIGTMP_LR_PDL_MASK) - -#define DIGTMP_LR_PPL_MASK (0x800U) -#define DIGTMP_LR_PPL_SHIFT (11U) -/*! PPL - Pin Polarity Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_PPL(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_PPL_SHIFT)) & DIGTMP_LR_PPL_MASK) - -#define DIGTMP_LR_ATL0_MASK (0x1000U) -#define DIGTMP_LR_ATL0_SHIFT (12U) -/*! ATL0 - Active Tamper Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_ATL0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_ATL0_SHIFT)) & DIGTMP_LR_ATL0_MASK) - -#define DIGTMP_LR_ATL1_MASK (0x2000U) -#define DIGTMP_LR_ATL1_SHIFT (13U) -/*! ATL1 - Active Tamper Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_ATL1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_ATL1_SHIFT)) & DIGTMP_LR_ATL1_MASK) - -#define DIGTMP_LR_GFL0_MASK (0x10000U) -#define DIGTMP_LR_GFL0_SHIFT (16U) -/*! GFL0 - Glitch Filter Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_GFL0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_GFL0_SHIFT)) & DIGTMP_LR_GFL0_MASK) - -#define DIGTMP_LR_GFL1_MASK (0x20000U) -#define DIGTMP_LR_GFL1_SHIFT (17U) -/*! GFL1 - Glitch Filter Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_GFL1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_GFL1_SHIFT)) & DIGTMP_LR_GFL1_MASK) - -#define DIGTMP_LR_GFL2_MASK (0x40000U) -#define DIGTMP_LR_GFL2_SHIFT (18U) -/*! GFL2 - Glitch Filter Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_GFL2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_GFL2_SHIFT)) & DIGTMP_LR_GFL2_MASK) - -#define DIGTMP_LR_GFL3_MASK (0x80000U) -#define DIGTMP_LR_GFL3_SHIFT (19U) -/*! GFL3 - Glitch Filter Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_GFL3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_GFL3_SHIFT)) & DIGTMP_LR_GFL3_MASK) - -#define DIGTMP_LR_GFL4_MASK (0x100000U) -#define DIGTMP_LR_GFL4_SHIFT (20U) -/*! GFL4 - Glitch Filter Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_GFL4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_GFL4_SHIFT)) & DIGTMP_LR_GFL4_MASK) - -#define DIGTMP_LR_GFL5_MASK (0x200000U) -#define DIGTMP_LR_GFL5_SHIFT (21U) -/*! GFL5 - Glitch Filter Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_GFL5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_GFL5_SHIFT)) & DIGTMP_LR_GFL5_MASK) - -#define DIGTMP_LR_GFL6_MASK (0x400000U) -#define DIGTMP_LR_GFL6_SHIFT (22U) -/*! GFL6 - Glitch Filter Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_GFL6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_GFL6_SHIFT)) & DIGTMP_LR_GFL6_MASK) - -#define DIGTMP_LR_GFL7_MASK (0x800000U) -#define DIGTMP_LR_GFL7_SHIFT (23U) -/*! GFL7 - Glitch Filter Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_GFL7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_GFL7_SHIFT)) & DIGTMP_LR_GFL7_MASK) -/*! @} */ - -/*! @name IER - Interrupt Enable */ -/*! @{ */ - -#define DIGTMP_IER_DTIE_MASK (0x1U) -#define DIGTMP_IER_DTIE_SHIFT (0U) -/*! DTIE - Digital Tamper Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_DTIE(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_DTIE_SHIFT)) & DIGTMP_IER_DTIE_MASK) - -#define DIGTMP_IER_TIIE0_MASK (0x4U) -#define DIGTMP_IER_TIIE0_SHIFT (2U) -/*! TIIE0 - Tamper Input n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TIIE0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TIIE0_SHIFT)) & DIGTMP_IER_TIIE0_MASK) - -#define DIGTMP_IER_TIIE1_MASK (0x8U) -#define DIGTMP_IER_TIIE1_SHIFT (3U) -/*! TIIE1 - Tamper Input n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TIIE1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TIIE1_SHIFT)) & DIGTMP_IER_TIIE1_MASK) - -#define DIGTMP_IER_TIIE2_MASK (0x10U) -#define DIGTMP_IER_TIIE2_SHIFT (4U) -/*! TIIE2 - Tamper Input n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TIIE2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TIIE2_SHIFT)) & DIGTMP_IER_TIIE2_MASK) - -#define DIGTMP_IER_TIIE3_MASK (0x20U) -#define DIGTMP_IER_TIIE3_SHIFT (5U) -/*! TIIE3 - Tamper Input n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TIIE3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TIIE3_SHIFT)) & DIGTMP_IER_TIIE3_MASK) - -#define DIGTMP_IER_TIIE4_MASK (0x40U) -#define DIGTMP_IER_TIIE4_SHIFT (6U) -/*! TIIE4 - Tamper Input n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TIIE4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TIIE4_SHIFT)) & DIGTMP_IER_TIIE4_MASK) - -#define DIGTMP_IER_TIIE5_MASK (0x80U) -#define DIGTMP_IER_TIIE5_SHIFT (7U) -/*! TIIE5 - Tamper Input n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TIIE5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TIIE5_SHIFT)) & DIGTMP_IER_TIIE5_MASK) - -#define DIGTMP_IER_TIIE6_MASK (0x100U) -#define DIGTMP_IER_TIIE6_SHIFT (8U) -/*! TIIE6 - Tamper Input n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TIIE6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TIIE6_SHIFT)) & DIGTMP_IER_TIIE6_MASK) - -#define DIGTMP_IER_TIIE7_MASK (0x200U) -#define DIGTMP_IER_TIIE7_SHIFT (9U) -/*! TIIE7 - Tamper Input n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TIIE7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TIIE7_SHIFT)) & DIGTMP_IER_TIIE7_MASK) - -#define DIGTMP_IER_TIIE8_MASK (0x400U) -#define DIGTMP_IER_TIIE8_SHIFT (10U) -/*! TIIE8 - Tamper Input n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TIIE8(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TIIE8_SHIFT)) & DIGTMP_IER_TIIE8_MASK) - -#define DIGTMP_IER_TIIE9_MASK (0x800U) -#define DIGTMP_IER_TIIE9_SHIFT (11U) -/*! TIIE9 - Tamper Input n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TIIE9(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TIIE9_SHIFT)) & DIGTMP_IER_TIIE9_MASK) - -#define DIGTMP_IER_TPIE0_MASK (0x10000U) -#define DIGTMP_IER_TPIE0_SHIFT (16U) -/*! TPIE0 - Tamper Pin n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TPIE0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TPIE0_SHIFT)) & DIGTMP_IER_TPIE0_MASK) - -#define DIGTMP_IER_TPIE1_MASK (0x20000U) -#define DIGTMP_IER_TPIE1_SHIFT (17U) -/*! TPIE1 - Tamper Pin n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TPIE1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TPIE1_SHIFT)) & DIGTMP_IER_TPIE1_MASK) - -#define DIGTMP_IER_TPIE2_MASK (0x40000U) -#define DIGTMP_IER_TPIE2_SHIFT (18U) -/*! TPIE2 - Tamper Pin n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TPIE2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TPIE2_SHIFT)) & DIGTMP_IER_TPIE2_MASK) - -#define DIGTMP_IER_TPIE3_MASK (0x80000U) -#define DIGTMP_IER_TPIE3_SHIFT (19U) -/*! TPIE3 - Tamper Pin n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TPIE3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TPIE3_SHIFT)) & DIGTMP_IER_TPIE3_MASK) - -#define DIGTMP_IER_TPIE4_MASK (0x100000U) -#define DIGTMP_IER_TPIE4_SHIFT (20U) -/*! TPIE4 - Tamper Pin n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TPIE4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TPIE4_SHIFT)) & DIGTMP_IER_TPIE4_MASK) - -#define DIGTMP_IER_TPIE5_MASK (0x200000U) -#define DIGTMP_IER_TPIE5_SHIFT (21U) -/*! TPIE5 - Tamper Pin n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TPIE5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TPIE5_SHIFT)) & DIGTMP_IER_TPIE5_MASK) - -#define DIGTMP_IER_TPIE6_MASK (0x400000U) -#define DIGTMP_IER_TPIE6_SHIFT (22U) -/*! TPIE6 - Tamper Pin n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TPIE6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TPIE6_SHIFT)) & DIGTMP_IER_TPIE6_MASK) - -#define DIGTMP_IER_TPIE7_MASK (0x800000U) -#define DIGTMP_IER_TPIE7_SHIFT (23U) -/*! TPIE7 - Tamper Pin n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TPIE7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TPIE7_SHIFT)) & DIGTMP_IER_TPIE7_MASK) -/*! @} */ - -/*! @name TSR - Tamper Seconds */ -/*! @{ */ - -#define DIGTMP_TSR_TTS_MASK (0xFFFFFFFFU) -#define DIGTMP_TSR_TTS_SHIFT (0U) -/*! TTS - Tamper Time Seconds */ -#define DIGTMP_TSR_TTS(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TSR_TTS_SHIFT)) & DIGTMP_TSR_TTS_MASK) -/*! @} */ - -/*! @name TER - Tamper Enable */ -/*! @{ */ - -#define DIGTMP_TER_TIE0_MASK (0x4U) -#define DIGTMP_TER_TIE0_SHIFT (2U) -/*! TIE0 - Tamper Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TIE0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TIE0_SHIFT)) & DIGTMP_TER_TIE0_MASK) - -#define DIGTMP_TER_TIE1_MASK (0x8U) -#define DIGTMP_TER_TIE1_SHIFT (3U) -/*! TIE1 - Tamper Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TIE1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TIE1_SHIFT)) & DIGTMP_TER_TIE1_MASK) - -#define DIGTMP_TER_TIE2_MASK (0x10U) -#define DIGTMP_TER_TIE2_SHIFT (4U) -/*! TIE2 - Tamper Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TIE2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TIE2_SHIFT)) & DIGTMP_TER_TIE2_MASK) - -#define DIGTMP_TER_TIE3_MASK (0x20U) -#define DIGTMP_TER_TIE3_SHIFT (5U) -/*! TIE3 - Tamper Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TIE3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TIE3_SHIFT)) & DIGTMP_TER_TIE3_MASK) - -#define DIGTMP_TER_TIE4_MASK (0x40U) -#define DIGTMP_TER_TIE4_SHIFT (6U) -/*! TIE4 - Tamper Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TIE4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TIE4_SHIFT)) & DIGTMP_TER_TIE4_MASK) - -#define DIGTMP_TER_TIE5_MASK (0x80U) -#define DIGTMP_TER_TIE5_SHIFT (7U) -/*! TIE5 - Tamper Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TIE5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TIE5_SHIFT)) & DIGTMP_TER_TIE5_MASK) - -#define DIGTMP_TER_TIE6_MASK (0x100U) -#define DIGTMP_TER_TIE6_SHIFT (8U) -/*! TIE6 - Tamper Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TIE6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TIE6_SHIFT)) & DIGTMP_TER_TIE6_MASK) - -#define DIGTMP_TER_TIE7_MASK (0x200U) -#define DIGTMP_TER_TIE7_SHIFT (9U) -/*! TIE7 - Tamper Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TIE7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TIE7_SHIFT)) & DIGTMP_TER_TIE7_MASK) - -#define DIGTMP_TER_TIE8_MASK (0x400U) -#define DIGTMP_TER_TIE8_SHIFT (10U) -/*! TIE8 - Tamper Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TIE8(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TIE8_SHIFT)) & DIGTMP_TER_TIE8_MASK) - -#define DIGTMP_TER_TIE9_MASK (0x800U) -#define DIGTMP_TER_TIE9_SHIFT (11U) -/*! TIE9 - Tamper Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TIE9(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TIE9_SHIFT)) & DIGTMP_TER_TIE9_MASK) - -#define DIGTMP_TER_TPE0_MASK (0x10000U) -#define DIGTMP_TER_TPE0_SHIFT (16U) -/*! TPE0 - Tamper Pin Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TPE0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TPE0_SHIFT)) & DIGTMP_TER_TPE0_MASK) - -#define DIGTMP_TER_TPE1_MASK (0x20000U) -#define DIGTMP_TER_TPE1_SHIFT (17U) -/*! TPE1 - Tamper Pin Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TPE1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TPE1_SHIFT)) & DIGTMP_TER_TPE1_MASK) - -#define DIGTMP_TER_TPE2_MASK (0x40000U) -#define DIGTMP_TER_TPE2_SHIFT (18U) -/*! TPE2 - Tamper Pin Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TPE2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TPE2_SHIFT)) & DIGTMP_TER_TPE2_MASK) - -#define DIGTMP_TER_TPE3_MASK (0x80000U) -#define DIGTMP_TER_TPE3_SHIFT (19U) -/*! TPE3 - Tamper Pin Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TPE3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TPE3_SHIFT)) & DIGTMP_TER_TPE3_MASK) - -#define DIGTMP_TER_TPE4_MASK (0x100000U) -#define DIGTMP_TER_TPE4_SHIFT (20U) -/*! TPE4 - Tamper Pin Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TPE4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TPE4_SHIFT)) & DIGTMP_TER_TPE4_MASK) - -#define DIGTMP_TER_TPE5_MASK (0x200000U) -#define DIGTMP_TER_TPE5_SHIFT (21U) -/*! TPE5 - Tamper Pin Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TPE5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TPE5_SHIFT)) & DIGTMP_TER_TPE5_MASK) - -#define DIGTMP_TER_TPE6_MASK (0x400000U) -#define DIGTMP_TER_TPE6_SHIFT (22U) -/*! TPE6 - Tamper Pin Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TPE6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TPE6_SHIFT)) & DIGTMP_TER_TPE6_MASK) - -#define DIGTMP_TER_TPE7_MASK (0x800000U) -#define DIGTMP_TER_TPE7_SHIFT (23U) -/*! TPE7 - Tamper Pin Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TPE7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TPE7_SHIFT)) & DIGTMP_TER_TPE7_MASK) -/*! @} */ - -/*! @name PDR - Pin Direction */ -/*! @{ */ - -#define DIGTMP_PDR_TPD0_MASK (0x1U) -#define DIGTMP_PDR_TPD0_SHIFT (0U) -/*! TPD0 - Tamper Pin Direction - * 0b0..Input - * 0b1..Output and drives the inverse of the expected value (tamper pin is asserted) - */ -#define DIGTMP_PDR_TPD0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPD0_SHIFT)) & DIGTMP_PDR_TPD0_MASK) - -#define DIGTMP_PDR_TPD1_MASK (0x2U) -#define DIGTMP_PDR_TPD1_SHIFT (1U) -/*! TPD1 - Tamper Pin Direction - * 0b0..Input - * 0b1..Output and drives the inverse of the expected value (tamper pin is asserted) - */ -#define DIGTMP_PDR_TPD1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPD1_SHIFT)) & DIGTMP_PDR_TPD1_MASK) - -#define DIGTMP_PDR_TPD2_MASK (0x4U) -#define DIGTMP_PDR_TPD2_SHIFT (2U) -/*! TPD2 - Tamper Pin Direction - * 0b0..Input - * 0b1..Output and drives the inverse of the expected value (tamper pin is asserted) - */ -#define DIGTMP_PDR_TPD2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPD2_SHIFT)) & DIGTMP_PDR_TPD2_MASK) - -#define DIGTMP_PDR_TPD3_MASK (0x8U) -#define DIGTMP_PDR_TPD3_SHIFT (3U) -/*! TPD3 - Tamper Pin Direction - * 0b0..Input - * 0b1..Output and drives the inverse of the expected value (tamper pin is asserted) - */ -#define DIGTMP_PDR_TPD3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPD3_SHIFT)) & DIGTMP_PDR_TPD3_MASK) - -#define DIGTMP_PDR_TPD4_MASK (0x10U) -#define DIGTMP_PDR_TPD4_SHIFT (4U) -/*! TPD4 - Tamper Pin Direction - * 0b0..Input - * 0b1..Output and drives the inverse of the expected value (tamper pin is asserted) - */ -#define DIGTMP_PDR_TPD4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPD4_SHIFT)) & DIGTMP_PDR_TPD4_MASK) - -#define DIGTMP_PDR_TPD5_MASK (0x20U) -#define DIGTMP_PDR_TPD5_SHIFT (5U) -/*! TPD5 - Tamper Pin Direction - * 0b0..Input - * 0b1..Output and drives the inverse of the expected value (tamper pin is asserted) - */ -#define DIGTMP_PDR_TPD5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPD5_SHIFT)) & DIGTMP_PDR_TPD5_MASK) - -#define DIGTMP_PDR_TPD6_MASK (0x40U) -#define DIGTMP_PDR_TPD6_SHIFT (6U) -/*! TPD6 - Tamper Pin Direction - * 0b0..Input - * 0b1..Output and drives the inverse of the expected value (tamper pin is asserted) - */ -#define DIGTMP_PDR_TPD6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPD6_SHIFT)) & DIGTMP_PDR_TPD6_MASK) - -#define DIGTMP_PDR_TPD7_MASK (0x80U) -#define DIGTMP_PDR_TPD7_SHIFT (7U) -/*! TPD7 - Tamper Pin Direction - * 0b0..Input - * 0b1..Output and drives the inverse of the expected value (tamper pin is asserted) - */ -#define DIGTMP_PDR_TPD7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPD7_SHIFT)) & DIGTMP_PDR_TPD7_MASK) - -#define DIGTMP_PDR_TPOD0_MASK (0x10000U) -#define DIGTMP_PDR_TPOD0_SHIFT (16U) -/*! TPOD0 - Tamper Pin Output Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PDR_TPOD0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPOD0_SHIFT)) & DIGTMP_PDR_TPOD0_MASK) - -#define DIGTMP_PDR_TPOD1_MASK (0x20000U) -#define DIGTMP_PDR_TPOD1_SHIFT (17U) -/*! TPOD1 - Tamper Pin Output Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PDR_TPOD1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPOD1_SHIFT)) & DIGTMP_PDR_TPOD1_MASK) - -#define DIGTMP_PDR_TPOD2_MASK (0x40000U) -#define DIGTMP_PDR_TPOD2_SHIFT (18U) -/*! TPOD2 - Tamper Pin Output Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PDR_TPOD2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPOD2_SHIFT)) & DIGTMP_PDR_TPOD2_MASK) - -#define DIGTMP_PDR_TPOD3_MASK (0x80000U) -#define DIGTMP_PDR_TPOD3_SHIFT (19U) -/*! TPOD3 - Tamper Pin Output Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PDR_TPOD3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPOD3_SHIFT)) & DIGTMP_PDR_TPOD3_MASK) - -#define DIGTMP_PDR_TPOD4_MASK (0x100000U) -#define DIGTMP_PDR_TPOD4_SHIFT (20U) -/*! TPOD4 - Tamper Pin Output Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PDR_TPOD4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPOD4_SHIFT)) & DIGTMP_PDR_TPOD4_MASK) - -#define DIGTMP_PDR_TPOD5_MASK (0x200000U) -#define DIGTMP_PDR_TPOD5_SHIFT (21U) -/*! TPOD5 - Tamper Pin Output Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PDR_TPOD5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPOD5_SHIFT)) & DIGTMP_PDR_TPOD5_MASK) - -#define DIGTMP_PDR_TPOD6_MASK (0x400000U) -#define DIGTMP_PDR_TPOD6_SHIFT (22U) -/*! TPOD6 - Tamper Pin Output Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PDR_TPOD6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPOD6_SHIFT)) & DIGTMP_PDR_TPOD6_MASK) - -#define DIGTMP_PDR_TPOD7_MASK (0x800000U) -#define DIGTMP_PDR_TPOD7_SHIFT (23U) -/*! TPOD7 - Tamper Pin Output Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PDR_TPOD7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPOD7_SHIFT)) & DIGTMP_PDR_TPOD7_MASK) -/*! @} */ - -/*! @name PPR - Pin Polarity */ -/*! @{ */ - -#define DIGTMP_PPR_TPP0_MASK (0x1U) -#define DIGTMP_PPR_TPP0_SHIFT (0U) -/*! TPP0 - Tamper Pin n Polarity - * 0b0..Not inverted - * 0b1..Inverted - */ -#define DIGTMP_PPR_TPP0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPP0_SHIFT)) & DIGTMP_PPR_TPP0_MASK) - -#define DIGTMP_PPR_TPP1_MASK (0x2U) -#define DIGTMP_PPR_TPP1_SHIFT (1U) -/*! TPP1 - Tamper Pin n Polarity - * 0b0..Not inverted - * 0b1..Inverted - */ -#define DIGTMP_PPR_TPP1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPP1_SHIFT)) & DIGTMP_PPR_TPP1_MASK) - -#define DIGTMP_PPR_TPP2_MASK (0x4U) -#define DIGTMP_PPR_TPP2_SHIFT (2U) -/*! TPP2 - Tamper Pin n Polarity - * 0b0..Not inverted - * 0b1..Inverted - */ -#define DIGTMP_PPR_TPP2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPP2_SHIFT)) & DIGTMP_PPR_TPP2_MASK) - -#define DIGTMP_PPR_TPP3_MASK (0x8U) -#define DIGTMP_PPR_TPP3_SHIFT (3U) -/*! TPP3 - Tamper Pin n Polarity - * 0b0..Not inverted - * 0b1..Inverted - */ -#define DIGTMP_PPR_TPP3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPP3_SHIFT)) & DIGTMP_PPR_TPP3_MASK) - -#define DIGTMP_PPR_TPP4_MASK (0x10U) -#define DIGTMP_PPR_TPP4_SHIFT (4U) -/*! TPP4 - Tamper Pin n Polarity - * 0b0..Not inverted - * 0b1..Inverted - */ -#define DIGTMP_PPR_TPP4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPP4_SHIFT)) & DIGTMP_PPR_TPP4_MASK) - -#define DIGTMP_PPR_TPP5_MASK (0x20U) -#define DIGTMP_PPR_TPP5_SHIFT (5U) -/*! TPP5 - Tamper Pin n Polarity - * 0b0..Not inverted - * 0b1..Inverted - */ -#define DIGTMP_PPR_TPP5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPP5_SHIFT)) & DIGTMP_PPR_TPP5_MASK) - -#define DIGTMP_PPR_TPP6_MASK (0x40U) -#define DIGTMP_PPR_TPP6_SHIFT (6U) -/*! TPP6 - Tamper Pin n Polarity - * 0b0..Not inverted - * 0b1..Inverted - */ -#define DIGTMP_PPR_TPP6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPP6_SHIFT)) & DIGTMP_PPR_TPP6_MASK) - -#define DIGTMP_PPR_TPP7_MASK (0x80U) -#define DIGTMP_PPR_TPP7_SHIFT (7U) -/*! TPP7 - Tamper Pin n Polarity - * 0b0..Not inverted - * 0b1..Inverted - */ -#define DIGTMP_PPR_TPP7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPP7_SHIFT)) & DIGTMP_PPR_TPP7_MASK) - -#define DIGTMP_PPR_TPID0_MASK (0x10000U) -#define DIGTMP_PPR_TPID0_SHIFT (16U) -/*! TPID0 - Tamper Pin n Input Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PPR_TPID0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPID0_SHIFT)) & DIGTMP_PPR_TPID0_MASK) - -#define DIGTMP_PPR_TPID1_MASK (0x20000U) -#define DIGTMP_PPR_TPID1_SHIFT (17U) -/*! TPID1 - Tamper Pin n Input Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PPR_TPID1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPID1_SHIFT)) & DIGTMP_PPR_TPID1_MASK) - -#define DIGTMP_PPR_TPID2_MASK (0x40000U) -#define DIGTMP_PPR_TPID2_SHIFT (18U) -/*! TPID2 - Tamper Pin n Input Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PPR_TPID2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPID2_SHIFT)) & DIGTMP_PPR_TPID2_MASK) - -#define DIGTMP_PPR_TPID3_MASK (0x80000U) -#define DIGTMP_PPR_TPID3_SHIFT (19U) -/*! TPID3 - Tamper Pin n Input Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PPR_TPID3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPID3_SHIFT)) & DIGTMP_PPR_TPID3_MASK) - -#define DIGTMP_PPR_TPID4_MASK (0x100000U) -#define DIGTMP_PPR_TPID4_SHIFT (20U) -/*! TPID4 - Tamper Pin n Input Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PPR_TPID4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPID4_SHIFT)) & DIGTMP_PPR_TPID4_MASK) - -#define DIGTMP_PPR_TPID5_MASK (0x200000U) -#define DIGTMP_PPR_TPID5_SHIFT (21U) -/*! TPID5 - Tamper Pin n Input Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PPR_TPID5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPID5_SHIFT)) & DIGTMP_PPR_TPID5_MASK) - -#define DIGTMP_PPR_TPID6_MASK (0x400000U) -#define DIGTMP_PPR_TPID6_SHIFT (22U) -/*! TPID6 - Tamper Pin n Input Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PPR_TPID6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPID6_SHIFT)) & DIGTMP_PPR_TPID6_MASK) - -#define DIGTMP_PPR_TPID7_MASK (0x800000U) -#define DIGTMP_PPR_TPID7_SHIFT (23U) -/*! TPID7 - Tamper Pin n Input Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PPR_TPID7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPID7_SHIFT)) & DIGTMP_PPR_TPID7_MASK) -/*! @} */ - -/*! @name ATR - Active Tamper */ -/*! @{ */ - -#define DIGTMP_ATR_ATSR_MASK (0xFFFFU) -#define DIGTMP_ATR_ATSR_SHIFT (0U) -/*! ATSR - Active Tamper Shift Register */ -#define DIGTMP_ATR_ATSR(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_ATR_ATSR_SHIFT)) & DIGTMP_ATR_ATSR_MASK) - -#define DIGTMP_ATR_ATP_MASK (0xFFFF0000U) -#define DIGTMP_ATR_ATP_SHIFT (16U) -/*! ATP - Active Tamper Polynomial */ -#define DIGTMP_ATR_ATP(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_ATR_ATP_SHIFT)) & DIGTMP_ATR_ATP_MASK) -/*! @} */ - -/* The count of DIGTMP_ATR */ -#define DIGTMP_ATR_COUNT (2U) - -/*! @name PGFR - Pin Glitch Filter */ -/*! @{ */ - -#define DIGTMP_PGFR_GFW_MASK (0x3FU) -#define DIGTMP_PGFR_GFW_SHIFT (0U) -/*! GFW - Glitch Filter Width */ -#define DIGTMP_PGFR_GFW(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PGFR_GFW_SHIFT)) & DIGTMP_PGFR_GFW_MASK) - -#define DIGTMP_PGFR_GFP_MASK (0x40U) -#define DIGTMP_PGFR_GFP_SHIFT (6U) -/*! GFP - Glitch Filter Prescaler - * 0b0..512 Hz prescaler clock - * 0b1..32.768 kHz clock - */ -#define DIGTMP_PGFR_GFP(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PGFR_GFP_SHIFT)) & DIGTMP_PGFR_GFP_MASK) - -#define DIGTMP_PGFR_GFE_MASK (0x80U) -#define DIGTMP_PGFR_GFE_SHIFT (7U) -/*! GFE - Glitch Filter Enable - * 0b0..Bypasses - * 0b1..Enables - */ -#define DIGTMP_PGFR_GFE(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PGFR_GFE_SHIFT)) & DIGTMP_PGFR_GFE_MASK) - -#define DIGTMP_PGFR_TPSW_MASK (0x300U) -#define DIGTMP_PGFR_TPSW_SHIFT (8U) -/*! TPSW - Tamper Pin Sample Width - * 0b00..Continuous monitoring, pin sampling disabled - * 0b01..2 cycles for pull enable and 1 cycle for input buffer enable - * 0b10..4 cycles for pull enable and 2 cycles for input buffer enable - * 0b11..8 cycles for pull enable and 4 cycles for input buffer enable - */ -#define DIGTMP_PGFR_TPSW(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PGFR_TPSW_SHIFT)) & DIGTMP_PGFR_TPSW_MASK) - -#define DIGTMP_PGFR_TPSF_MASK (0xC00U) -#define DIGTMP_PGFR_TPSF_SHIFT (10U) -/*! TPSF - Tamper Pin Sample Frequency - * 0b00..Every 8 cycles - * 0b01..Every 32 cycles - * 0b10..Every 128 cycles - * 0b11..Every 512 cycles - */ -#define DIGTMP_PGFR_TPSF(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PGFR_TPSF_SHIFT)) & DIGTMP_PGFR_TPSF_MASK) - -#define DIGTMP_PGFR_TPEX_MASK (0x30000U) -#define DIGTMP_PGFR_TPEX_SHIFT (16U) -/*! TPEX - Tamper Pin Expected - * 0b00..Zero/passive tamper - * 0b01..Active Tamper 0 output - * 0b10..Active Tamper 1 output - * 0b11..Active Tamper 0 output XORed with Active Tamper 1 output - */ -#define DIGTMP_PGFR_TPEX(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PGFR_TPEX_SHIFT)) & DIGTMP_PGFR_TPEX_MASK) - -#define DIGTMP_PGFR_TPE_MASK (0x1000000U) -#define DIGTMP_PGFR_TPE_SHIFT (24U) -/*! TPE - Tamper Pull Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_PGFR_TPE(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PGFR_TPE_SHIFT)) & DIGTMP_PGFR_TPE_MASK) - -#define DIGTMP_PGFR_TPS_MASK (0x2000000U) -#define DIGTMP_PGFR_TPS_SHIFT (25U) -/*! TPS - Tamper Pull Select - * 0b0..Asserts - * 0b1..Negates - */ -#define DIGTMP_PGFR_TPS(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PGFR_TPS_SHIFT)) & DIGTMP_PGFR_TPS_MASK) -/*! @} */ - -/* The count of DIGTMP_PGFR */ -#define DIGTMP_PGFR_COUNT (8U) - - -/*! - * @} - */ /* end of group DIGTMP_Register_Masks */ - - -/* DIGTMP - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral TDET0 base address */ - #define TDET0_BASE (0x50058000u) - /** Peripheral TDET0 base address */ - #define TDET0_BASE_NS (0x40058000u) - /** Peripheral TDET0 base pointer */ - #define TDET0 ((DIGTMP_Type *)TDET0_BASE) - /** Peripheral TDET0 base pointer */ - #define TDET0_NS ((DIGTMP_Type *)TDET0_BASE_NS) - /** Array initializer of DIGTMP peripheral base addresses */ - #define DIGTMP_BASE_ADDRS { TDET0_BASE } - /** Array initializer of DIGTMP peripheral base pointers */ - #define DIGTMP_BASE_PTRS { TDET0 } - /** Array initializer of DIGTMP peripheral base addresses */ - #define DIGTMP_BASE_ADDRS_NS { TDET0_BASE_NS } - /** Array initializer of DIGTMP peripheral base pointers */ - #define DIGTMP_BASE_PTRS_NS { TDET0_NS } -#else - /** Peripheral TDET0 base address */ - #define TDET0_BASE (0x40058000u) - /** Peripheral TDET0 base pointer */ - #define TDET0 ((DIGTMP_Type *)TDET0_BASE) - /** Array initializer of DIGTMP peripheral base addresses */ - #define DIGTMP_BASE_ADDRS { TDET0_BASE } - /** Array initializer of DIGTMP peripheral base pointers */ - #define DIGTMP_BASE_PTRS { TDET0 } -#endif - -/*! - * @} - */ /* end of group DIGTMP_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- DM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DM_Peripheral_Access_Layer DM Peripheral Access Layer - * @{ - */ - -/** DM - Register Layout Typedef */ -typedef struct { - __IO uint32_t CSW; /**< Command and Status Word, offset: 0x0 */ - __IO uint32_t REQUEST; /**< Request Value, offset: 0x4 */ - __IO uint32_t RETURN; /**< Return Value, offset: 0x8 */ - uint8_t RESERVED_0[240]; - __I uint32_t ID; /**< Identification, offset: 0xFC */ -} DM_Type; - -/* ---------------------------------------------------------------------------- - -- DM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DM_Register_Masks DM Register Masks - * @{ - */ - -/*! @name CSW - Command and Status Word */ -/*! @{ */ - -#define DM_CSW_RESYNCH_REQ_MASK (0x1U) -#define DM_CSW_RESYNCH_REQ_SHIFT (0U) -/*! RESYNCH_REQ - Resynchronization Request - * 0b0..No request - * 0b1..Request for resynchronization - */ -#define DM_CSW_RESYNCH_REQ(x) (((uint32_t)(((uint32_t)(x)) << DM_CSW_RESYNCH_REQ_SHIFT)) & DM_CSW_RESYNCH_REQ_MASK) - -#define DM_CSW_REQ_PENDING_MASK (0x2U) -#define DM_CSW_REQ_PENDING_SHIFT (1U) -/*! REQ_PENDING - Request Pending - * 0b0..No request pending - * 0b1..Request for resynchronization pending - */ -#define DM_CSW_REQ_PENDING(x) (((uint32_t)(((uint32_t)(x)) << DM_CSW_REQ_PENDING_SHIFT)) & DM_CSW_REQ_PENDING_MASK) - -#define DM_CSW_DBG_OR_ERR_MASK (0x4U) -#define DM_CSW_DBG_OR_ERR_SHIFT (2U) -/*! DBG_OR_ERR - DBGMB Overrun Error - * 0b0..No DBGMB Overrun error - * 0b1..DBGMB overrun error. A DBGMB overrun occurred. - */ -#define DM_CSW_DBG_OR_ERR(x) (((uint32_t)(((uint32_t)(x)) << DM_CSW_DBG_OR_ERR_SHIFT)) & DM_CSW_DBG_OR_ERR_MASK) - -#define DM_CSW_AHB_OR_ERR_MASK (0x8U) -#define DM_CSW_AHB_OR_ERR_SHIFT (3U) -/*! AHB_OR_ERR - AHB Overrun Error - * 0b0..No AHB Overrun Error - * 0b1..AHB Overrun Error. An AHB overrun occurred. - */ -#define DM_CSW_AHB_OR_ERR(x) (((uint32_t)(((uint32_t)(x)) << DM_CSW_AHB_OR_ERR_SHIFT)) & DM_CSW_AHB_OR_ERR_MASK) - -#define DM_CSW_SOFT_RESET_MASK (0x10U) -#define DM_CSW_SOFT_RESET_SHIFT (4U) -/*! SOFT_RESET - Soft Reset */ -#define DM_CSW_SOFT_RESET(x) (((uint32_t)(((uint32_t)(x)) << DM_CSW_SOFT_RESET_SHIFT)) & DM_CSW_SOFT_RESET_MASK) - -#define DM_CSW_CHIP_RESET_REQ_MASK (0x20U) -#define DM_CSW_CHIP_RESET_REQ_SHIFT (5U) -/*! CHIP_RESET_REQ - Chip Reset Request */ -#define DM_CSW_CHIP_RESET_REQ(x) (((uint32_t)(((uint32_t)(x)) << DM_CSW_CHIP_RESET_REQ_SHIFT)) & DM_CSW_CHIP_RESET_REQ_MASK) -/*! @} */ - -/*! @name REQUEST - Request Value */ -/*! @{ */ - -#define DM_REQUEST_REQUEST_MASK (0xFFFFFFFFU) -#define DM_REQUEST_REQUEST_SHIFT (0U) -/*! REQUEST - Request Value */ -#define DM_REQUEST_REQUEST(x) (((uint32_t)(((uint32_t)(x)) << DM_REQUEST_REQUEST_SHIFT)) & DM_REQUEST_REQUEST_MASK) -/*! @} */ - -/*! @name RETURN - Return Value */ -/*! @{ */ - -#define DM_RETURN_RET_MASK (0xFFFFFFFFU) -#define DM_RETURN_RET_SHIFT (0U) -/*! RET - Return Value */ -#define DM_RETURN_RET(x) (((uint32_t)(((uint32_t)(x)) << DM_RETURN_RET_SHIFT)) & DM_RETURN_RET_MASK) -/*! @} */ - -/*! @name ID - Identification */ -/*! @{ */ - -#define DM_ID_ID_MASK (0xFFFFFFFFU) -#define DM_ID_ID_SHIFT (0U) -/*! ID - Identification Value */ -#define DM_ID_ID(x) (((uint32_t)(((uint32_t)(x)) << DM_ID_ID_SHIFT)) & DM_ID_ID_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group DM_Register_Masks */ - - -/* DM - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral DM0 base address */ - #define DM0_BASE (0x500BD000u) - /** Peripheral DM0 base address */ - #define DM0_BASE_NS (0x400BD000u) - /** Peripheral DM0 base pointer */ - #define DM0 ((DM_Type *)DM0_BASE) - /** Peripheral DM0 base pointer */ - #define DM0_NS ((DM_Type *)DM0_BASE_NS) - /** Array initializer of DM peripheral base addresses */ - #define DM_BASE_ADDRS { DM0_BASE } - /** Array initializer of DM peripheral base pointers */ - #define DM_BASE_PTRS { DM0 } - /** Array initializer of DM peripheral base addresses */ - #define DM_BASE_ADDRS_NS { DM0_BASE_NS } - /** Array initializer of DM peripheral base pointers */ - #define DM_BASE_PTRS_NS { DM0_NS } -#else - /** Peripheral DM0 base address */ - #define DM0_BASE (0x400BD000u) - /** Peripheral DM0 base pointer */ - #define DM0 ((DM_Type *)DM0_BASE) - /** Array initializer of DM peripheral base addresses */ - #define DM_BASE_ADDRS { DM0_BASE } - /** Array initializer of DM peripheral base pointers */ - #define DM_BASE_PTRS { DM0 } -#endif - -/*! - * @} - */ /* end of group DM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- DMA Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DMA_Peripheral_Access_Layer DMA Peripheral Access Layer - * @{ - */ - -/** DMA - Register Layout Typedef */ -typedef struct { - __IO uint32_t MP_CSR; /**< Management Page Control, offset: 0x0 */ - __I uint32_t MP_ES; /**< Management Page Error Status, offset: 0x4 */ - __I uint32_t MP_INT; /**< Management Page Interrupt Request Status, offset: 0x8 */ - __I uint32_t MP_HRS; /**< Management Page Hardware Request Status, offset: 0xC */ - uint8_t RESERVED_0[240]; - __IO uint32_t CH_GRPRI[16]; /**< Channel Arbitration Group, array offset: 0x100, array step: 0x4, irregular array, not all indices are valid */ - uint8_t RESERVED_1[3776]; - struct { /* offset: 0x1000, array step: 0x1000 */ - __IO uint32_t CH_CSR; /**< Channel Control and Status, array offset: 0x1000, array step: 0x1000, irregular array, not all indices are valid */ - __IO uint32_t CH_ES; /**< Channel Error Status, array offset: 0x1004, array step: 0x1000, irregular array, not all indices are valid */ - __IO uint32_t CH_INT; /**< Channel Interrupt Status, array offset: 0x1008, array step: 0x1000, irregular array, not all indices are valid */ - __IO uint32_t CH_SBR; /**< Channel System Bus, array offset: 0x100C, array step: 0x1000, irregular array, not all indices are valid */ - __IO uint32_t CH_PRI; /**< Channel Priority, array offset: 0x1010, array step: 0x1000, irregular array, not all indices are valid */ - __IO uint32_t CH_MUX; /**< Channel Multiplexor Configuration, array offset: 0x1014, array step: 0x1000, irregular array, not all indices are valid */ - uint8_t RESERVED_0[8]; - __IO uint32_t TCD_SADDR; /**< TCD Source Address, array offset: 0x1020, array step: 0x1000, irregular array, not all indices are valid */ - __IO uint16_t TCD_SOFF; /**< TCD Signed Source Address Offset, array offset: 0x1024, array step: 0x1000, irregular array, not all indices are valid */ - __IO uint16_t TCD_ATTR; /**< TCD Transfer Attributes, array offset: 0x1026, array step: 0x1000, irregular array, not all indices are valid */ - union { /* offset: 0x1028, array step: 0x1000 */ - __IO uint32_t TCD_NBYTES_MLOFFNO; /**< TCD Transfer Size Without Minor Loop Offsets, array offset: 0x1028, array step: 0x1000, irregular array, not all indices are valid */ - __IO uint32_t TCD_NBYTES_MLOFFYES; /**< TCD Transfer Size with Minor Loop Offsets, array offset: 0x1028, array step: 0x1000, irregular array, not all indices are valid */ - }; - __IO uint32_t TCD_SLAST_SDA; /**< TCD Last Source Address Adjustment / Store DADDR Address, array offset: 0x102C, array step: 0x1000, irregular array, not all indices are valid */ - __IO uint32_t TCD_DADDR; /**< TCD Destination Address, array offset: 0x1030, array step: 0x1000, irregular array, not all indices are valid */ - __IO uint16_t TCD_DOFF; /**< TCD Signed Destination Address Offset, array offset: 0x1034, array step: 0x1000, irregular array, not all indices are valid */ - union { /* offset: 0x1036, array step: 0x1000 */ - __IO uint16_t TCD_CITER_ELINKNO; /**< TCD Current Major Loop Count (Minor Loop Channel Linking Disabled), array offset: 0x1036, array step: 0x1000, irregular array, not all indices are valid */ - __IO uint16_t TCD_CITER_ELINKYES; /**< TCD Current Major Loop Count (Minor Loop Channel Linking Enabled), array offset: 0x1036, array step: 0x1000, irregular array, not all indices are valid */ - }; - __IO uint32_t TCD_DLAST_SGA; /**< TCD Last Destination Address Adjustment / Scatter Gather Address, array offset: 0x1038, array step: 0x1000, irregular array, not all indices are valid */ - __IO uint16_t TCD_CSR; /**< TCD Control and Status, array offset: 0x103C, array step: 0x1000, irregular array, not all indices are valid */ - union { /* offset: 0x103E, array step: 0x1000 */ - __IO uint16_t TCD_BITER_ELINKNO; /**< TCD Beginning Major Loop Count (Minor Loop Channel Linking Disabled), array offset: 0x103E, array step: 0x1000, irregular array, not all indices are valid */ - __IO uint16_t TCD_BITER_ELINKYES; /**< TCD Beginning Major Loop Count (Minor Loop Channel Linking Enabled), array offset: 0x103E, array step: 0x1000, irregular array, not all indices are valid */ - }; - uint8_t RESERVED_1[4032]; - } CH[16]; -} DMA_Type; - -/* ---------------------------------------------------------------------------- - -- DMA Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DMA_Register_Masks DMA Register Masks - * @{ - */ - -/*! @name MP_CSR - Management Page Control */ -/*! @{ */ - -#define DMA_MP_CSR_EDBG_MASK (0x2U) -#define DMA_MP_CSR_EDBG_SHIFT (1U) -/*! EDBG - Enable Debug - * 0b0..Debug mode disabled - * 0b1..Debug mode is enabled. - */ -#define DMA_MP_CSR_EDBG(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_EDBG_SHIFT)) & DMA_MP_CSR_EDBG_MASK) - -#define DMA_MP_CSR_ERCA_MASK (0x4U) -#define DMA_MP_CSR_ERCA_SHIFT (2U) -/*! ERCA - Enable Round Robin Channel Arbitration - * 0b0..Round-robin channel arbitration disabled - * 0b1..Round-robin channel arbitration enabled - */ -#define DMA_MP_CSR_ERCA(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_ERCA_SHIFT)) & DMA_MP_CSR_ERCA_MASK) - -#define DMA_MP_CSR_HAE_MASK (0x10U) -#define DMA_MP_CSR_HAE_SHIFT (4U) -/*! HAE - Halt After Error - * 0b0..Normal operation - * 0b1..Any error causes the HALT field to be set to 1 - */ -#define DMA_MP_CSR_HAE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_HAE_SHIFT)) & DMA_MP_CSR_HAE_MASK) - -#define DMA_MP_CSR_HALT_MASK (0x20U) -#define DMA_MP_CSR_HALT_SHIFT (5U) -/*! HALT - Halt DMA Operations - * 0b0..Normal operation - * 0b1..Stall the start of any new channels - */ -#define DMA_MP_CSR_HALT(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_HALT_SHIFT)) & DMA_MP_CSR_HALT_MASK) - -#define DMA_MP_CSR_GCLC_MASK (0x40U) -#define DMA_MP_CSR_GCLC_SHIFT (6U) -/*! GCLC - Global Channel Linking Control - * 0b0..Channel linking disabled for all channels - * 0b1..Channel linking available and controlled by each channel's link settings - */ -#define DMA_MP_CSR_GCLC(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_GCLC_SHIFT)) & DMA_MP_CSR_GCLC_MASK) - -#define DMA_MP_CSR_GMRC_MASK (0x80U) -#define DMA_MP_CSR_GMRC_SHIFT (7U) -/*! GMRC - Global Master ID Replication Control - * 0b0..Master ID replication disabled for all channels - * 0b1..Master ID replication available and controlled by each channel's CHn_SBR[EMI] setting - */ -#define DMA_MP_CSR_GMRC(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_GMRC_SHIFT)) & DMA_MP_CSR_GMRC_MASK) - -#define DMA_MP_CSR_ECX_MASK (0x100U) -#define DMA_MP_CSR_ECX_SHIFT (8U) -/*! ECX - Cancel Transfer With Error - * 0b0..Normal operation - * 0b1..Cancel the remaining data transfer - */ -#define DMA_MP_CSR_ECX(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_ECX_SHIFT)) & DMA_MP_CSR_ECX_MASK) - -#define DMA_MP_CSR_CX_MASK (0x200U) -#define DMA_MP_CSR_CX_SHIFT (9U) -/*! CX - Cancel Transfer - * 0b0..Normal operation - * 0b1..Cancel the remaining data transfer - */ -#define DMA_MP_CSR_CX(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_CX_SHIFT)) & DMA_MP_CSR_CX_MASK) - -#define DMA_MP_CSR_ACTIVE_ID_MASK (0xF000000U) /* Merged from fields with different position or width, of widths (3, 4), largest definition used */ -#define DMA_MP_CSR_ACTIVE_ID_SHIFT (24U) -/*! ACTIVE_ID - Active Channel ID */ -#define DMA_MP_CSR_ACTIVE_ID(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_ACTIVE_ID_SHIFT)) & DMA_MP_CSR_ACTIVE_ID_MASK) /* Merged from fields with different position or width, of widths (3, 4), largest definition used */ - -#define DMA_MP_CSR_ACTIVE_MASK (0x80000000U) -#define DMA_MP_CSR_ACTIVE_SHIFT (31U) -/*! ACTIVE - DMA Active Status - * 0b0..eDMA is idle - * 0b1..eDMA is executing a channel - */ -#define DMA_MP_CSR_ACTIVE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_ACTIVE_SHIFT)) & DMA_MP_CSR_ACTIVE_MASK) -/*! @} */ - -/*! @name MP_ES - Management Page Error Status */ -/*! @{ */ - -#define DMA_MP_ES_DBE_MASK (0x1U) -#define DMA_MP_ES_DBE_SHIFT (0U) -/*! DBE - Destination Bus Error - * 0b0..No destination bus error - * 0b1..Last recorded error was a bus error on a destination write - */ -#define DMA_MP_ES_DBE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_DBE_SHIFT)) & DMA_MP_ES_DBE_MASK) - -#define DMA_MP_ES_SBE_MASK (0x2U) -#define DMA_MP_ES_SBE_SHIFT (1U) -/*! SBE - Source Bus Error - * 0b0..No source bus error - * 0b1..Last recorded error was a bus error on a source read - */ -#define DMA_MP_ES_SBE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_SBE_SHIFT)) & DMA_MP_ES_SBE_MASK) - -#define DMA_MP_ES_SGE_MASK (0x4U) -#define DMA_MP_ES_SGE_SHIFT (2U) -/*! SGE - Scatter/Gather Configuration Error - * 0b0..No scatter/gather configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_DLAST_SGA field - */ -#define DMA_MP_ES_SGE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_SGE_SHIFT)) & DMA_MP_ES_SGE_MASK) - -#define DMA_MP_ES_NCE_MASK (0x8U) -#define DMA_MP_ES_NCE_SHIFT (3U) -/*! NCE - NBYTES/CITER Configuration Error - * 0b0..No NBYTES/CITER configuration error - * 0b1..The last recorded error was NBYTES equal to zero or a CITER not equal to BITER error - */ -#define DMA_MP_ES_NCE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_NCE_SHIFT)) & DMA_MP_ES_NCE_MASK) - -#define DMA_MP_ES_DOE_MASK (0x10U) -#define DMA_MP_ES_DOE_SHIFT (4U) -/*! DOE - Destination Offset Error - * 0b0..No destination offset configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_DOFF field - */ -#define DMA_MP_ES_DOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_DOE_SHIFT)) & DMA_MP_ES_DOE_MASK) - -#define DMA_MP_ES_DAE_MASK (0x20U) -#define DMA_MP_ES_DAE_SHIFT (5U) -/*! DAE - Destination Address Error - * 0b0..No destination address configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_DADDR field - */ -#define DMA_MP_ES_DAE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_DAE_SHIFT)) & DMA_MP_ES_DAE_MASK) - -#define DMA_MP_ES_SOE_MASK (0x40U) -#define DMA_MP_ES_SOE_SHIFT (6U) -/*! SOE - Source Offset Error - * 0b0..No source offset configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_SOFF field - */ -#define DMA_MP_ES_SOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_SOE_SHIFT)) & DMA_MP_ES_SOE_MASK) - -#define DMA_MP_ES_SAE_MASK (0x80U) -#define DMA_MP_ES_SAE_SHIFT (7U) -/*! SAE - Source Address Error - * 0b0..No source address configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_SADDR field - */ -#define DMA_MP_ES_SAE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_SAE_SHIFT)) & DMA_MP_ES_SAE_MASK) - -#define DMA_MP_ES_ECX_MASK (0x100U) -#define DMA_MP_ES_ECX_SHIFT (8U) -/*! ECX - Transfer Canceled - * 0b0..No canceled transfers - * 0b1..Last recorded entry was a canceled transfer by the error cancel transfer input - */ -#define DMA_MP_ES_ECX(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_ECX_SHIFT)) & DMA_MP_ES_ECX_MASK) - -#define DMA_MP_ES_ERRCHN_MASK (0xF000000U) /* Merged from fields with different position or width, of widths (3, 4), largest definition used */ -#define DMA_MP_ES_ERRCHN_SHIFT (24U) -/*! ERRCHN - Error Channel Number or Canceled Channel Number */ -#define DMA_MP_ES_ERRCHN(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_ERRCHN_SHIFT)) & DMA_MP_ES_ERRCHN_MASK) /* Merged from fields with different position or width, of widths (3, 4), largest definition used */ - -#define DMA_MP_ES_VLD_MASK (0x80000000U) -#define DMA_MP_ES_VLD_SHIFT (31U) -/*! VLD - Valid - * 0b0..No CHn_ES[ERR] fields are set to 1 - * 0b1..At least one CHn_ES[ERR] field is set to 1, indicating a valid error exists that software has not cleared - */ -#define DMA_MP_ES_VLD(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_VLD_SHIFT)) & DMA_MP_ES_VLD_MASK) -/*! @} */ - -/*! @name MP_INT - Management Page Interrupt Request Status */ -/*! @{ */ - -#define DMA_MP_INT_INT_MASK (0xFFFFU) /* Merged from fields with different position or width, of widths (8, 16), largest definition used */ -#define DMA_MP_INT_INT_SHIFT (0U) -/*! INT - Interrupt Request Status */ -#define DMA_MP_INT_INT(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_INT_INT_SHIFT)) & DMA_MP_INT_INT_MASK) /* Merged from fields with different position or width, of widths (8, 16), largest definition used */ -/*! @} */ - -/*! @name MP_HRS - Management Page Hardware Request Status */ -/*! @{ */ - -#define DMA_MP_HRS_HRS_MASK (0xFFFFFFFFU) -#define DMA_MP_HRS_HRS_SHIFT (0U) -/*! HRS - Hardware Request Status */ -#define DMA_MP_HRS_HRS(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_HRS_HRS_SHIFT)) & DMA_MP_HRS_HRS_MASK) -/*! @} */ - -/*! @name CH_GRPRI - Channel Arbitration Group */ -/*! @{ */ - -#define DMA_CH_GRPRI_GRPRI_MASK (0x1FU) -#define DMA_CH_GRPRI_GRPRI_SHIFT (0U) -/*! GRPRI - Arbitration Group For Channel n */ -#define DMA_CH_GRPRI_GRPRI(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_GRPRI_GRPRI_SHIFT)) & DMA_CH_GRPRI_GRPRI_MASK) -/*! @} */ - -/* The count of DMA_CH_GRPRI */ -#define DMA_CH_GRPRI_COUNT (16U) - -/*! @name CH_CSR - Channel Control and Status */ -/*! @{ */ - -#define DMA_CH_CSR_ERQ_MASK (0x1U) -#define DMA_CH_CSR_ERQ_SHIFT (0U) -/*! ERQ - Enable DMA Request - * 0b0..DMA hardware request signal for corresponding channel disabled - * 0b1..DMA hardware request signal for corresponding channel enabled - */ -#define DMA_CH_CSR_ERQ(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_CSR_ERQ_SHIFT)) & DMA_CH_CSR_ERQ_MASK) - -#define DMA_CH_CSR_EARQ_MASK (0x2U) -#define DMA_CH_CSR_EARQ_SHIFT (1U) -/*! EARQ - Enable Asynchronous DMA Request - * 0b0..Disable asynchronous DMA request for the channel - * 0b1..Enable asynchronous DMA request for the channel - */ -#define DMA_CH_CSR_EARQ(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_CSR_EARQ_SHIFT)) & DMA_CH_CSR_EARQ_MASK) - -#define DMA_CH_CSR_EEI_MASK (0x4U) -#define DMA_CH_CSR_EEI_SHIFT (2U) -/*! EEI - Enable Error Interrupt - * 0b0..Error signal for corresponding channel does not generate error interrupt - * 0b1..Assertion of error signal for corresponding channel generates error interrupt request - */ -#define DMA_CH_CSR_EEI(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_CSR_EEI_SHIFT)) & DMA_CH_CSR_EEI_MASK) - -#define DMA_CH_CSR_EBW_MASK (0x8U) -#define DMA_CH_CSR_EBW_SHIFT (3U) -/*! EBW - Enable Buffered Writes - * 0b0..Buffered writes on system bus disabled - * 0b1..Buffered writes on system bus enabled - */ -#define DMA_CH_CSR_EBW(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_CSR_EBW_SHIFT)) & DMA_CH_CSR_EBW_MASK) - -#define DMA_CH_CSR_DONE_MASK (0x40000000U) -#define DMA_CH_CSR_DONE_SHIFT (30U) -/*! DONE - Channel Done */ -#define DMA_CH_CSR_DONE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_CSR_DONE_SHIFT)) & DMA_CH_CSR_DONE_MASK) - -#define DMA_CH_CSR_ACTIVE_MASK (0x80000000U) -#define DMA_CH_CSR_ACTIVE_SHIFT (31U) -/*! ACTIVE - Channel Active */ -#define DMA_CH_CSR_ACTIVE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_CSR_ACTIVE_SHIFT)) & DMA_CH_CSR_ACTIVE_MASK) -/*! @} */ - -/* The count of DMA_CH_CSR */ -#define DMA_CH_CSR_COUNT (16U) - -/*! @name CH_ES - Channel Error Status */ -/*! @{ */ - -#define DMA_CH_ES_DBE_MASK (0x1U) -#define DMA_CH_ES_DBE_SHIFT (0U) -/*! DBE - Destination Bus Error - * 0b0..No destination bus error - * 0b1..Last recorded error was bus error on destination write - */ -#define DMA_CH_ES_DBE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_DBE_SHIFT)) & DMA_CH_ES_DBE_MASK) - -#define DMA_CH_ES_SBE_MASK (0x2U) -#define DMA_CH_ES_SBE_SHIFT (1U) -/*! SBE - Source Bus Error - * 0b0..No source bus error - * 0b1..Last recorded error was bus error on source read - */ -#define DMA_CH_ES_SBE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_SBE_SHIFT)) & DMA_CH_ES_SBE_MASK) - -#define DMA_CH_ES_SGE_MASK (0x4U) -#define DMA_CH_ES_SGE_SHIFT (2U) -/*! SGE - Scatter/Gather Configuration Error - * 0b0..No scatter/gather configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_DLAST_SGA field - */ -#define DMA_CH_ES_SGE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_SGE_SHIFT)) & DMA_CH_ES_SGE_MASK) - -#define DMA_CH_ES_NCE_MASK (0x8U) -#define DMA_CH_ES_NCE_SHIFT (3U) -/*! NCE - NBYTES/CITER Configuration Error - * 0b0..No NBYTES/CITER configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_NBYTES or TCDn_CITER fields - */ -#define DMA_CH_ES_NCE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_NCE_SHIFT)) & DMA_CH_ES_NCE_MASK) - -#define DMA_CH_ES_DOE_MASK (0x10U) -#define DMA_CH_ES_DOE_SHIFT (4U) -/*! DOE - Destination Offset Error - * 0b0..No destination offset configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_DOFF field - */ -#define DMA_CH_ES_DOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_DOE_SHIFT)) & DMA_CH_ES_DOE_MASK) - -#define DMA_CH_ES_DAE_MASK (0x20U) -#define DMA_CH_ES_DAE_SHIFT (5U) -/*! DAE - Destination Address Error - * 0b0..No destination address configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_DADDR field - */ -#define DMA_CH_ES_DAE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_DAE_SHIFT)) & DMA_CH_ES_DAE_MASK) - -#define DMA_CH_ES_SOE_MASK (0x40U) -#define DMA_CH_ES_SOE_SHIFT (6U) -/*! SOE - Source Offset Error - * 0b0..No source offset configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_SOFF field - */ -#define DMA_CH_ES_SOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_SOE_SHIFT)) & DMA_CH_ES_SOE_MASK) - -#define DMA_CH_ES_SAE_MASK (0x80U) -#define DMA_CH_ES_SAE_SHIFT (7U) -/*! SAE - Source Address Error - * 0b0..No source address configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_SADDR field - */ -#define DMA_CH_ES_SAE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_SAE_SHIFT)) & DMA_CH_ES_SAE_MASK) - -#define DMA_CH_ES_ERR_MASK (0x80000000U) -#define DMA_CH_ES_ERR_SHIFT (31U) -/*! ERR - Error In Channel - * 0b0..An error in this channel has not occurred - * 0b1..An error in this channel has occurred - */ -#define DMA_CH_ES_ERR(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_ERR_SHIFT)) & DMA_CH_ES_ERR_MASK) -/*! @} */ - -/* The count of DMA_CH_ES */ -#define DMA_CH_ES_COUNT (16U) - -/*! @name CH_INT - Channel Interrupt Status */ -/*! @{ */ - -#define DMA_CH_INT_INT_MASK (0x1U) -#define DMA_CH_INT_INT_SHIFT (0U) -/*! INT - Interrupt Request - * 0b0..Interrupt request for corresponding channel cleared - * 0b1..Interrupt request for corresponding channel active - */ -#define DMA_CH_INT_INT(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_INT_INT_SHIFT)) & DMA_CH_INT_INT_MASK) -/*! @} */ - -/* The count of DMA_CH_INT */ -#define DMA_CH_INT_COUNT (16U) - -/*! @name CH_SBR - Channel System Bus */ -/*! @{ */ - -#define DMA_CH_SBR_MID_MASK (0x1FU) -#define DMA_CH_SBR_MID_SHIFT (0U) -/*! MID - Master ID */ -#define DMA_CH_SBR_MID(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_SBR_MID_SHIFT)) & DMA_CH_SBR_MID_MASK) - -#define DMA_CH_SBR_SEC_MASK (0x4000U) -#define DMA_CH_SBR_SEC_SHIFT (14U) -/*! SEC - Security Level - * 0b0..Nonsecure protection level for DMA transfers - * 0b1..Secure protection level for DMA transfers - */ -#define DMA_CH_SBR_SEC(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_SBR_SEC_SHIFT)) & DMA_CH_SBR_SEC_MASK) - -#define DMA_CH_SBR_PAL_MASK (0x8000U) -#define DMA_CH_SBR_PAL_SHIFT (15U) -/*! PAL - Privileged Access Level - * 0b0..User protection level for DMA transfers - * 0b1..Privileged protection level for DMA transfers - */ -#define DMA_CH_SBR_PAL(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_SBR_PAL_SHIFT)) & DMA_CH_SBR_PAL_MASK) - -#define DMA_CH_SBR_EMI_MASK (0x10000U) -#define DMA_CH_SBR_EMI_SHIFT (16U) -/*! EMI - Enable Master ID Replication - * 0b0..Master ID replication is disabled - * 0b1..Master ID replication is enabled - */ -#define DMA_CH_SBR_EMI(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_SBR_EMI_SHIFT)) & DMA_CH_SBR_EMI_MASK) -/*! @} */ - -/* The count of DMA_CH_SBR */ -#define DMA_CH_SBR_COUNT (16U) - -/*! @name CH_PRI - Channel Priority */ -/*! @{ */ - -#define DMA_CH_PRI_APL_MASK (0x7U) -#define DMA_CH_PRI_APL_SHIFT (0U) -/*! APL - Arbitration Priority Level */ -#define DMA_CH_PRI_APL(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_PRI_APL_SHIFT)) & DMA_CH_PRI_APL_MASK) - -#define DMA_CH_PRI_DPA_MASK (0x40000000U) -#define DMA_CH_PRI_DPA_SHIFT (30U) -/*! DPA - Disable Preempt Ability - * 0b0..Channel can suspend a lower-priority channel - * 0b1..Channel cannot suspend any other channel, regardless of channel priority - */ -#define DMA_CH_PRI_DPA(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_PRI_DPA_SHIFT)) & DMA_CH_PRI_DPA_MASK) - -#define DMA_CH_PRI_ECP_MASK (0x80000000U) -#define DMA_CH_PRI_ECP_SHIFT (31U) -/*! ECP - Enable Channel Preemption - * 0b0..Channel cannot be suspended by a higher-priority channel's service request - * 0b1..Channel can be temporarily suspended by a higher-priority channel's service request - */ -#define DMA_CH_PRI_ECP(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_PRI_ECP_SHIFT)) & DMA_CH_PRI_ECP_MASK) -/*! @} */ - -/* The count of DMA_CH_PRI */ -#define DMA_CH_PRI_COUNT (16U) - -/*! @name CH_MUX - Channel Multiplexor Configuration */ -/*! @{ */ - -#define DMA_CH_MUX_SRC_MASK (0x7FU) -#define DMA_CH_MUX_SRC_SHIFT (0U) -/*! SRC - Service Request Source */ -#define DMA_CH_MUX_SRC(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_MUX_SRC_SHIFT)) & DMA_CH_MUX_SRC_MASK) -/*! @} */ - -/* The count of DMA_CH_MUX */ -#define DMA_CH_MUX_COUNT (16U) - -/*! @name TCD_SADDR - TCD Source Address */ -/*! @{ */ - -#define DMA_TCD_SADDR_SADDR_MASK (0xFFFFFFFFU) -#define DMA_TCD_SADDR_SADDR_SHIFT (0U) -/*! SADDR - Source Address */ -#define DMA_TCD_SADDR_SADDR(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_SADDR_SADDR_SHIFT)) & DMA_TCD_SADDR_SADDR_MASK) -/*! @} */ - -/* The count of DMA_TCD_SADDR */ -#define DMA_TCD_SADDR_COUNT (16U) - -/*! @name TCD_SOFF - TCD Signed Source Address Offset */ -/*! @{ */ - -#define DMA_TCD_SOFF_SOFF_MASK (0xFFFFU) -#define DMA_TCD_SOFF_SOFF_SHIFT (0U) -/*! SOFF - Source Address Signed Offset */ -#define DMA_TCD_SOFF_SOFF(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_SOFF_SOFF_SHIFT)) & DMA_TCD_SOFF_SOFF_MASK) -/*! @} */ - -/* The count of DMA_TCD_SOFF */ -#define DMA_TCD_SOFF_COUNT (16U) - -/*! @name TCD_ATTR - TCD Transfer Attributes */ -/*! @{ */ - -#define DMA_TCD_ATTR_DSIZE_MASK (0x7U) -#define DMA_TCD_ATTR_DSIZE_SHIFT (0U) -/*! DSIZE - Destination Data Transfer Size */ -#define DMA_TCD_ATTR_DSIZE(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_ATTR_DSIZE_SHIFT)) & DMA_TCD_ATTR_DSIZE_MASK) - -#define DMA_TCD_ATTR_DMOD_MASK (0xF8U) -#define DMA_TCD_ATTR_DMOD_SHIFT (3U) -/*! DMOD - Destination Address Modulo */ -#define DMA_TCD_ATTR_DMOD(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_ATTR_DMOD_SHIFT)) & DMA_TCD_ATTR_DMOD_MASK) - -#define DMA_TCD_ATTR_SSIZE_MASK (0x700U) -#define DMA_TCD_ATTR_SSIZE_SHIFT (8U) -/*! SSIZE - Source Data Transfer Size - * 0b000..8-bit - * 0b001..16-bit - * 0b010..32-bit - * 0b011..64-bit - * 0b100..16-byte - * 0b101..32-byte - * 0b110.. - * 0b111.. - */ -#define DMA_TCD_ATTR_SSIZE(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_ATTR_SSIZE_SHIFT)) & DMA_TCD_ATTR_SSIZE_MASK) - -#define DMA_TCD_ATTR_SMOD_MASK (0xF800U) -#define DMA_TCD_ATTR_SMOD_SHIFT (11U) -/*! SMOD - Source Address Modulo - * 0b00000..Source address modulo feature disabled - * 0b00001..Source address modulo feature enabled for any non-zero value [1-31] - */ -#define DMA_TCD_ATTR_SMOD(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_ATTR_SMOD_SHIFT)) & DMA_TCD_ATTR_SMOD_MASK) -/*! @} */ - -/* The count of DMA_TCD_ATTR */ -#define DMA_TCD_ATTR_COUNT (16U) - -/*! @name TCD_NBYTES_MLOFFNO - TCD Transfer Size Without Minor Loop Offsets */ -/*! @{ */ - -#define DMA_TCD_NBYTES_MLOFFNO_NBYTES_MASK (0x3FFFFFFFU) -#define DMA_TCD_NBYTES_MLOFFNO_NBYTES_SHIFT (0U) -/*! NBYTES - Number of Bytes To Transfer Per Service Request */ -#define DMA_TCD_NBYTES_MLOFFNO_NBYTES(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFNO_NBYTES_SHIFT)) & DMA_TCD_NBYTES_MLOFFNO_NBYTES_MASK) - -#define DMA_TCD_NBYTES_MLOFFNO_DMLOE_MASK (0x40000000U) -#define DMA_TCD_NBYTES_MLOFFNO_DMLOE_SHIFT (30U) -/*! DMLOE - Destination Minor Loop Offset Enable - * 0b0..Minor loop offset not applied to DADDR - * 0b1..Minor loop offset applied to DADDR - */ -#define DMA_TCD_NBYTES_MLOFFNO_DMLOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFNO_DMLOE_SHIFT)) & DMA_TCD_NBYTES_MLOFFNO_DMLOE_MASK) - -#define DMA_TCD_NBYTES_MLOFFNO_SMLOE_MASK (0x80000000U) -#define DMA_TCD_NBYTES_MLOFFNO_SMLOE_SHIFT (31U) -/*! SMLOE - Source Minor Loop Offset Enable - * 0b0..Minor loop offset not applied to SADDR - * 0b1..Minor loop offset applied to SADDR - */ -#define DMA_TCD_NBYTES_MLOFFNO_SMLOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFNO_SMLOE_SHIFT)) & DMA_TCD_NBYTES_MLOFFNO_SMLOE_MASK) -/*! @} */ - -/* The count of DMA_TCD_NBYTES_MLOFFNO */ -#define DMA_TCD_NBYTES_MLOFFNO_COUNT (16U) - -/*! @name TCD_NBYTES_MLOFFYES - TCD Transfer Size with Minor Loop Offsets */ -/*! @{ */ - -#define DMA_TCD_NBYTES_MLOFFYES_NBYTES_MASK (0x3FFU) -#define DMA_TCD_NBYTES_MLOFFYES_NBYTES_SHIFT (0U) -/*! NBYTES - Number of Bytes To Transfer Per Service Request */ -#define DMA_TCD_NBYTES_MLOFFYES_NBYTES(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFYES_NBYTES_SHIFT)) & DMA_TCD_NBYTES_MLOFFYES_NBYTES_MASK) - -#define DMA_TCD_NBYTES_MLOFFYES_MLOFF_MASK (0x3FFFFC00U) -#define DMA_TCD_NBYTES_MLOFFYES_MLOFF_SHIFT (10U) -/*! MLOFF - Minor Loop Offset */ -#define DMA_TCD_NBYTES_MLOFFYES_MLOFF(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFYES_MLOFF_SHIFT)) & DMA_TCD_NBYTES_MLOFFYES_MLOFF_MASK) - -#define DMA_TCD_NBYTES_MLOFFYES_DMLOE_MASK (0x40000000U) -#define DMA_TCD_NBYTES_MLOFFYES_DMLOE_SHIFT (30U) -/*! DMLOE - Destination Minor Loop Offset Enable - * 0b0..Minor loop offset not applied to DADDR - * 0b1..Minor loop offset applied to DADDR - */ -#define DMA_TCD_NBYTES_MLOFFYES_DMLOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFYES_DMLOE_SHIFT)) & DMA_TCD_NBYTES_MLOFFYES_DMLOE_MASK) - -#define DMA_TCD_NBYTES_MLOFFYES_SMLOE_MASK (0x80000000U) -#define DMA_TCD_NBYTES_MLOFFYES_SMLOE_SHIFT (31U) -/*! SMLOE - Source Minor Loop Offset Enable - * 0b0..Minor loop offset not applied to SADDR - * 0b1..Minor loop offset applied to SADDR - */ -#define DMA_TCD_NBYTES_MLOFFYES_SMLOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFYES_SMLOE_SHIFT)) & DMA_TCD_NBYTES_MLOFFYES_SMLOE_MASK) -/*! @} */ - -/* The count of DMA_TCD_NBYTES_MLOFFYES */ -#define DMA_TCD_NBYTES_MLOFFYES_COUNT (16U) - -/*! @name TCD_SLAST_SDA - TCD Last Source Address Adjustment / Store DADDR Address */ -/*! @{ */ - -#define DMA_TCD_SLAST_SDA_SLAST_SDA_MASK (0xFFFFFFFFU) -#define DMA_TCD_SLAST_SDA_SLAST_SDA_SHIFT (0U) -/*! SLAST_SDA - Last Source Address Adjustment / Store DADDR Address */ -#define DMA_TCD_SLAST_SDA_SLAST_SDA(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_SLAST_SDA_SLAST_SDA_SHIFT)) & DMA_TCD_SLAST_SDA_SLAST_SDA_MASK) -/*! @} */ - -/* The count of DMA_TCD_SLAST_SDA */ -#define DMA_TCD_SLAST_SDA_COUNT (16U) - -/*! @name TCD_DADDR - TCD Destination Address */ -/*! @{ */ - -#define DMA_TCD_DADDR_DADDR_MASK (0xFFFFFFFFU) -#define DMA_TCD_DADDR_DADDR_SHIFT (0U) -/*! DADDR - Destination Address */ -#define DMA_TCD_DADDR_DADDR(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_DADDR_DADDR_SHIFT)) & DMA_TCD_DADDR_DADDR_MASK) -/*! @} */ - -/* The count of DMA_TCD_DADDR */ -#define DMA_TCD_DADDR_COUNT (16U) - -/*! @name TCD_DOFF - TCD Signed Destination Address Offset */ -/*! @{ */ - -#define DMA_TCD_DOFF_DOFF_MASK (0xFFFFU) -#define DMA_TCD_DOFF_DOFF_SHIFT (0U) -/*! DOFF - Destination Address Signed Offset */ -#define DMA_TCD_DOFF_DOFF(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_DOFF_DOFF_SHIFT)) & DMA_TCD_DOFF_DOFF_MASK) -/*! @} */ - -/* The count of DMA_TCD_DOFF */ -#define DMA_TCD_DOFF_COUNT (16U) - -/*! @name TCD_CITER_ELINKNO - TCD Current Major Loop Count (Minor Loop Channel Linking Disabled) */ -/*! @{ */ - -#define DMA_TCD_CITER_ELINKNO_CITER_MASK (0x7FFFU) -#define DMA_TCD_CITER_ELINKNO_CITER_SHIFT (0U) -/*! CITER - Current Major Iteration Count */ -#define DMA_TCD_CITER_ELINKNO_CITER(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CITER_ELINKNO_CITER_SHIFT)) & DMA_TCD_CITER_ELINKNO_CITER_MASK) - -#define DMA_TCD_CITER_ELINKNO_ELINK_MASK (0x8000U) -#define DMA_TCD_CITER_ELINKNO_ELINK_SHIFT (15U) -/*! ELINK - Enable Link - * 0b0..Channel-to-channel linking disabled - * 0b1..Channel-to-channel linking enabled - */ -#define DMA_TCD_CITER_ELINKNO_ELINK(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CITER_ELINKNO_ELINK_SHIFT)) & DMA_TCD_CITER_ELINKNO_ELINK_MASK) -/*! @} */ - -/* The count of DMA_TCD_CITER_ELINKNO */ -#define DMA_TCD_CITER_ELINKNO_COUNT (16U) - -/*! @name TCD_CITER_ELINKYES - TCD Current Major Loop Count (Minor Loop Channel Linking Enabled) */ -/*! @{ */ - -#define DMA_TCD_CITER_ELINKYES_CITER_MASK (0x1FFU) -#define DMA_TCD_CITER_ELINKYES_CITER_SHIFT (0U) -/*! CITER - Current Major Iteration Count */ -#define DMA_TCD_CITER_ELINKYES_CITER(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CITER_ELINKYES_CITER_SHIFT)) & DMA_TCD_CITER_ELINKYES_CITER_MASK) - -#define DMA_TCD_CITER_ELINKYES_LINKCH_MASK (0x1E00U) /* Merged from fields with different position or width, of widths (3, 4), largest definition used */ -#define DMA_TCD_CITER_ELINKYES_LINKCH_SHIFT (9U) -/*! LINKCH - Minor Loop Link Channel Number */ -#define DMA_TCD_CITER_ELINKYES_LINKCH(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CITER_ELINKYES_LINKCH_SHIFT)) & DMA_TCD_CITER_ELINKYES_LINKCH_MASK) /* Merged from fields with different position or width, of widths (3, 4), largest definition used */ - -#define DMA_TCD_CITER_ELINKYES_ELINK_MASK (0x8000U) -#define DMA_TCD_CITER_ELINKYES_ELINK_SHIFT (15U) -/*! ELINK - Enable Link - * 0b0..Channel-to-channel linking disabled - * 0b1..Channel-to-channel linking enabled - */ -#define DMA_TCD_CITER_ELINKYES_ELINK(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CITER_ELINKYES_ELINK_SHIFT)) & DMA_TCD_CITER_ELINKYES_ELINK_MASK) -/*! @} */ - -/* The count of DMA_TCD_CITER_ELINKYES */ -#define DMA_TCD_CITER_ELINKYES_COUNT (16U) - -/*! @name TCD_DLAST_SGA - TCD Last Destination Address Adjustment / Scatter Gather Address */ -/*! @{ */ - -#define DMA_TCD_DLAST_SGA_DLAST_SGA_MASK (0xFFFFFFFFU) -#define DMA_TCD_DLAST_SGA_DLAST_SGA_SHIFT (0U) -/*! DLAST_SGA - Last Destination Address Adjustment / Scatter Gather Address */ -#define DMA_TCD_DLAST_SGA_DLAST_SGA(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_DLAST_SGA_DLAST_SGA_SHIFT)) & DMA_TCD_DLAST_SGA_DLAST_SGA_MASK) -/*! @} */ - -/* The count of DMA_TCD_DLAST_SGA */ -#define DMA_TCD_DLAST_SGA_COUNT (16U) - -/*! @name TCD_CSR - TCD Control and Status */ -/*! @{ */ - -#define DMA_TCD_CSR_START_MASK (0x1U) -#define DMA_TCD_CSR_START_SHIFT (0U) -/*! START - Channel Start - * 0b0..Channel not explicitly started - * 0b1..Channel explicitly started via a software-initiated service request - */ -#define DMA_TCD_CSR_START(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_START_SHIFT)) & DMA_TCD_CSR_START_MASK) - -#define DMA_TCD_CSR_INTMAJOR_MASK (0x2U) -#define DMA_TCD_CSR_INTMAJOR_SHIFT (1U) -/*! INTMAJOR - Enable Interrupt If Major count complete - * 0b0..End-of-major loop interrupt disabled - * 0b1..End-of-major loop interrupt enabled - */ -#define DMA_TCD_CSR_INTMAJOR(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_INTMAJOR_SHIFT)) & DMA_TCD_CSR_INTMAJOR_MASK) - -#define DMA_TCD_CSR_INTHALF_MASK (0x4U) -#define DMA_TCD_CSR_INTHALF_SHIFT (2U) -/*! INTHALF - Enable Interrupt If Major Counter Half-complete - * 0b0..Halfway point interrupt disabled - * 0b1..Halfway point interrupt enabled - */ -#define DMA_TCD_CSR_INTHALF(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_INTHALF_SHIFT)) & DMA_TCD_CSR_INTHALF_MASK) - -#define DMA_TCD_CSR_DREQ_MASK (0x8U) -#define DMA_TCD_CSR_DREQ_SHIFT (3U) -/*! DREQ - Disable Request - * 0b0..No operation - * 0b1..Clear the ERQ field to 0 upon major loop completion, thus disabling hardware service requests - */ -#define DMA_TCD_CSR_DREQ(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_DREQ_SHIFT)) & DMA_TCD_CSR_DREQ_MASK) - -#define DMA_TCD_CSR_ESG_MASK (0x10U) -#define DMA_TCD_CSR_ESG_SHIFT (4U) -/*! ESG - Enable Scatter/Gather Processing - * 0b0..Current channel's TCD is normal format - * 0b1..Current channel's TCD specifies scatter/gather format. - */ -#define DMA_TCD_CSR_ESG(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_ESG_SHIFT)) & DMA_TCD_CSR_ESG_MASK) - -#define DMA_TCD_CSR_MAJORELINK_MASK (0x20U) -#define DMA_TCD_CSR_MAJORELINK_SHIFT (5U) -/*! MAJORELINK - Enable Link When Major Loop Complete - * 0b0..Channel-to-channel linking disabled - * 0b1..Channel-to-channel linking enabled - */ -#define DMA_TCD_CSR_MAJORELINK(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_MAJORELINK_SHIFT)) & DMA_TCD_CSR_MAJORELINK_MASK) - -#define DMA_TCD_CSR_EEOP_MASK (0x40U) -#define DMA_TCD_CSR_EEOP_SHIFT (6U) -/*! EEOP - Enable End-Of-Packet Processing - * 0b0..End-of-packet operation disabled - * 0b1..End-of-packet hardware input signal enabled - */ -#define DMA_TCD_CSR_EEOP(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_EEOP_SHIFT)) & DMA_TCD_CSR_EEOP_MASK) - -#define DMA_TCD_CSR_ESDA_MASK (0x80U) -#define DMA_TCD_CSR_ESDA_SHIFT (7U) -/*! ESDA - Enable Store Destination Address - * 0b0..Ability to store destination address to system memory disabled - * 0b1..Ability to store destination address to system memory enabled - */ -#define DMA_TCD_CSR_ESDA(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_ESDA_SHIFT)) & DMA_TCD_CSR_ESDA_MASK) - -#define DMA_TCD_CSR_MAJORLINKCH_MASK (0xF00U) /* Merged from fields with different position or width, of widths (3, 4), largest definition used */ -#define DMA_TCD_CSR_MAJORLINKCH_SHIFT (8U) -/*! MAJORLINKCH - Major Loop Link Channel Number */ -#define DMA_TCD_CSR_MAJORLINKCH(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_MAJORLINKCH_SHIFT)) & DMA_TCD_CSR_MAJORLINKCH_MASK) /* Merged from fields with different position or width, of widths (3, 4), largest definition used */ - -#define DMA_TCD_CSR_BWC_MASK (0xC000U) -#define DMA_TCD_CSR_BWC_SHIFT (14U) -/*! BWC - Bandwidth Control - * 0b00..No eDMA engine stalls - * 0b01.. - * 0b10..eDMA engine stalls for 4 cycles after each R/W - * 0b11..eDMA engine stalls for 8 cycles after each R/W - */ -#define DMA_TCD_CSR_BWC(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_BWC_SHIFT)) & DMA_TCD_CSR_BWC_MASK) -/*! @} */ - -/* The count of DMA_TCD_CSR */ -#define DMA_TCD_CSR_COUNT (16U) - -/*! @name TCD_BITER_ELINKNO - TCD Beginning Major Loop Count (Minor Loop Channel Linking Disabled) */ -/*! @{ */ - -#define DMA_TCD_BITER_ELINKNO_BITER_MASK (0x7FFFU) -#define DMA_TCD_BITER_ELINKNO_BITER_SHIFT (0U) -/*! BITER - Starting Major Iteration Count */ -#define DMA_TCD_BITER_ELINKNO_BITER(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_BITER_ELINKNO_BITER_SHIFT)) & DMA_TCD_BITER_ELINKNO_BITER_MASK) - -#define DMA_TCD_BITER_ELINKNO_ELINK_MASK (0x8000U) -#define DMA_TCD_BITER_ELINKNO_ELINK_SHIFT (15U) -/*! ELINK - Enables Link - * 0b0..Channel-to-channel linking disabled - * 0b1..Channel-to-channel linking enabled - */ -#define DMA_TCD_BITER_ELINKNO_ELINK(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_BITER_ELINKNO_ELINK_SHIFT)) & DMA_TCD_BITER_ELINKNO_ELINK_MASK) -/*! @} */ - -/* The count of DMA_TCD_BITER_ELINKNO */ -#define DMA_TCD_BITER_ELINKNO_COUNT (16U) - -/*! @name TCD_BITER_ELINKYES - TCD Beginning Major Loop Count (Minor Loop Channel Linking Enabled) */ -/*! @{ */ - -#define DMA_TCD_BITER_ELINKYES_BITER_MASK (0x1FFU) -#define DMA_TCD_BITER_ELINKYES_BITER_SHIFT (0U) -/*! BITER - Starting Major Iteration Count */ -#define DMA_TCD_BITER_ELINKYES_BITER(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_BITER_ELINKYES_BITER_SHIFT)) & DMA_TCD_BITER_ELINKYES_BITER_MASK) - -#define DMA_TCD_BITER_ELINKYES_LINKCH_MASK (0x1E00U) /* Merged from fields with different position or width, of widths (3, 4), largest definition used */ -#define DMA_TCD_BITER_ELINKYES_LINKCH_SHIFT (9U) -/*! LINKCH - Link Channel Number */ -#define DMA_TCD_BITER_ELINKYES_LINKCH(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_BITER_ELINKYES_LINKCH_SHIFT)) & DMA_TCD_BITER_ELINKYES_LINKCH_MASK) /* Merged from fields with different position or width, of widths (3, 4), largest definition used */ - -#define DMA_TCD_BITER_ELINKYES_ELINK_MASK (0x8000U) -#define DMA_TCD_BITER_ELINKYES_ELINK_SHIFT (15U) -/*! ELINK - Enable Link - * 0b0..Channel-to-channel linking disabled - * 0b1..Channel-to-channel linking enabled - */ -#define DMA_TCD_BITER_ELINKYES_ELINK(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_BITER_ELINKYES_ELINK_SHIFT)) & DMA_TCD_BITER_ELINKYES_ELINK_MASK) -/*! @} */ - -/* The count of DMA_TCD_BITER_ELINKYES */ -#define DMA_TCD_BITER_ELINKYES_COUNT (16U) - - -/*! - * @} - */ /* end of group DMA_Register_Masks */ - - -/* DMA - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral DMA0 base address */ - #define DMA0_BASE (0x50080000u) - /** Peripheral DMA0 base address */ - #define DMA0_BASE_NS (0x40080000u) - /** Peripheral DMA0 base pointer */ - #define DMA0 ((DMA_Type *)DMA0_BASE) - /** Peripheral DMA0 base pointer */ - #define DMA0_NS ((DMA_Type *)DMA0_BASE_NS) - /** Peripheral DMA1 base address */ - #define DMA1_BASE (0x500A0000u) - /** Peripheral DMA1 base address */ - #define DMA1_BASE_NS (0x400A0000u) - /** Peripheral DMA1 base pointer */ - #define DMA1 ((DMA_Type *)DMA1_BASE) - /** Peripheral DMA1 base pointer */ - #define DMA1_NS ((DMA_Type *)DMA1_BASE_NS) - /** Array initializer of DMA peripheral base addresses */ - #define DMA_BASE_ADDRS { DMA0_BASE, DMA1_BASE } - /** Array initializer of DMA peripheral base pointers */ - #define DMA_BASE_PTRS { DMA0, DMA1 } - /** Array initializer of DMA peripheral base addresses */ - #define DMA_BASE_ADDRS_NS { DMA0_BASE_NS, DMA1_BASE_NS } - /** Array initializer of DMA peripheral base pointers */ - #define DMA_BASE_PTRS_NS { DMA0_NS, DMA1_NS } -#else - /** Peripheral DMA0 base address */ - #define DMA0_BASE (0x40080000u) - /** Peripheral DMA0 base pointer */ - #define DMA0 ((DMA_Type *)DMA0_BASE) - /** Peripheral DMA1 base address */ - #define DMA1_BASE (0x400A0000u) - /** Peripheral DMA1 base pointer */ - #define DMA1 ((DMA_Type *)DMA1_BASE) - /** Array initializer of DMA peripheral base addresses */ - #define DMA_BASE_ADDRS { DMA0_BASE, DMA1_BASE } - /** Array initializer of DMA peripheral base pointers */ - #define DMA_BASE_PTRS { DMA0, DMA1 } -#endif -/** Interrupt vectors for the DMA peripheral type */ -#define DMA_IRQS { { EDMA_0_CH0_IRQn, EDMA_0_CH1_IRQn, EDMA_0_CH2_IRQn, EDMA_0_CH3_IRQn, EDMA_0_CH4_IRQn, EDMA_0_CH5_IRQn, EDMA_0_CH6_IRQn, EDMA_0_CH7_IRQn, EDMA_0_CH8_IRQn, EDMA_0_CH9_IRQn, EDMA_0_CH10_IRQn, EDMA_0_CH11_IRQn, EDMA_0_CH12_IRQn, EDMA_0_CH13_IRQn, EDMA_0_CH14_IRQn, EDMA_0_CH15_IRQn }, \ - { EDMA_1_CH0_IRQn, EDMA_1_CH1_IRQn, EDMA_1_CH2_IRQn, EDMA_1_CH3_IRQn, EDMA_1_CH4_IRQn, EDMA_1_CH5_IRQn, EDMA_1_CH6_IRQn, EDMA_1_CH7_IRQn, NotAvail_IRQn, NotAvail_IRQn, NotAvail_IRQn, NotAvail_IRQn, NotAvail_IRQn, NotAvail_IRQn, NotAvail_IRQn, NotAvail_IRQn } } - -/*! - * @} - */ /* end of group DMA_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- DMA0_TEE_ALIAS Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DMA0_TEE_ALIAS_Peripheral_Access_Layer DMA0_TEE_ALIAS Peripheral Access Layer - * @{ - */ - -/** DMA0_TEE_ALIAS - Register Layout Typedef */ -typedef struct { - uint8_t RESERVED_0[4092]; - uint32_t RESERVED; /**< Reserved., offset: 0xFFC */ -} DMA0_TEE_ALIAS_Type; - -/* ---------------------------------------------------------------------------- - -- DMA0_TEE_ALIAS Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DMA0_TEE_ALIAS_Register_Masks DMA0_TEE_ALIAS Register Masks - * @{ - */ - - -/*! - * @} - */ /* end of group DMA0_TEE_ALIAS_Register_Masks */ - - -/* DMA0_TEE_ALIAS - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral DMA0_TEE_ALIAS0 base address */ - #define DMA0_TEE_ALIAS0_BASE (0x50080000u) - /** Peripheral DMA0_TEE_ALIAS0 base address */ - #define DMA0_TEE_ALIAS0_BASE_NS (0x40080000u) - /** Peripheral DMA0_TEE_ALIAS0 base pointer */ - #define DMA0_TEE_ALIAS0 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS0_BASE) - /** Peripheral DMA0_TEE_ALIAS0 base pointer */ - #define DMA0_TEE_ALIAS0_NS ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS0_BASE_NS) - /** Peripheral DMA0_TEE_ALIAS1 base address */ - #define DMA0_TEE_ALIAS1_BASE (0x50081000u) - /** Peripheral DMA0_TEE_ALIAS1 base address */ - #define DMA0_TEE_ALIAS1_BASE_NS (0x40081000u) - /** Peripheral DMA0_TEE_ALIAS1 base pointer */ - #define DMA0_TEE_ALIAS1 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS1_BASE) - /** Peripheral DMA0_TEE_ALIAS1 base pointer */ - #define DMA0_TEE_ALIAS1_NS ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS1_BASE_NS) - /** Peripheral DMA0_TEE_ALIAS2 base address */ - #define DMA0_TEE_ALIAS2_BASE (0x50082000u) - /** Peripheral DMA0_TEE_ALIAS2 base address */ - #define DMA0_TEE_ALIAS2_BASE_NS (0x40082000u) - /** Peripheral DMA0_TEE_ALIAS2 base pointer */ - #define DMA0_TEE_ALIAS2 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS2_BASE) - /** Peripheral DMA0_TEE_ALIAS2 base pointer */ - #define DMA0_TEE_ALIAS2_NS ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS2_BASE_NS) - /** Peripheral DMA0_TEE_ALIAS3 base address */ - #define DMA0_TEE_ALIAS3_BASE (0x50083000u) - /** Peripheral DMA0_TEE_ALIAS3 base address */ - #define DMA0_TEE_ALIAS3_BASE_NS (0x40083000u) - /** Peripheral DMA0_TEE_ALIAS3 base pointer */ - #define DMA0_TEE_ALIAS3 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS3_BASE) - /** Peripheral DMA0_TEE_ALIAS3 base pointer */ - #define DMA0_TEE_ALIAS3_NS ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS3_BASE_NS) - /** Peripheral DMA0_TEE_ALIAS4 base address */ - #define DMA0_TEE_ALIAS4_BASE (0x50084000u) - /** Peripheral DMA0_TEE_ALIAS4 base address */ - #define DMA0_TEE_ALIAS4_BASE_NS (0x40084000u) - /** Peripheral DMA0_TEE_ALIAS4 base pointer */ - #define DMA0_TEE_ALIAS4 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS4_BASE) - /** Peripheral DMA0_TEE_ALIAS4 base pointer */ - #define DMA0_TEE_ALIAS4_NS ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS4_BASE_NS) - /** Peripheral DMA0_TEE_ALIAS5 base address */ - #define DMA0_TEE_ALIAS5_BASE (0x50085000u) - /** Peripheral DMA0_TEE_ALIAS5 base address */ - #define DMA0_TEE_ALIAS5_BASE_NS (0x40085000u) - /** Peripheral DMA0_TEE_ALIAS5 base pointer */ - #define DMA0_TEE_ALIAS5 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS5_BASE) - /** Peripheral DMA0_TEE_ALIAS5 base pointer */ - #define DMA0_TEE_ALIAS5_NS ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS5_BASE_NS) - /** Peripheral DMA0_TEE_ALIAS6 base address */ - #define DMA0_TEE_ALIAS6_BASE (0x50086000u) - /** Peripheral DMA0_TEE_ALIAS6 base address */ - #define DMA0_TEE_ALIAS6_BASE_NS (0x40086000u) - /** Peripheral DMA0_TEE_ALIAS6 base pointer */ - #define DMA0_TEE_ALIAS6 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS6_BASE) - /** Peripheral DMA0_TEE_ALIAS6 base pointer */ - #define DMA0_TEE_ALIAS6_NS ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS6_BASE_NS) - /** Peripheral DMA0_TEE_ALIAS7 base address */ - #define DMA0_TEE_ALIAS7_BASE (0x50087000u) - /** Peripheral DMA0_TEE_ALIAS7 base address */ - #define DMA0_TEE_ALIAS7_BASE_NS (0x40087000u) - /** Peripheral DMA0_TEE_ALIAS7 base pointer */ - #define DMA0_TEE_ALIAS7 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS7_BASE) - /** Peripheral DMA0_TEE_ALIAS7 base pointer */ - #define DMA0_TEE_ALIAS7_NS ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS7_BASE_NS) - /** Peripheral DMA0_TEE_ALIAS8 base address */ - #define DMA0_TEE_ALIAS8_BASE (0x50088000u) - /** Peripheral DMA0_TEE_ALIAS8 base address */ - #define DMA0_TEE_ALIAS8_BASE_NS (0x40088000u) - /** Peripheral DMA0_TEE_ALIAS8 base pointer */ - #define DMA0_TEE_ALIAS8 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS8_BASE) - /** Peripheral DMA0_TEE_ALIAS8 base pointer */ - #define DMA0_TEE_ALIAS8_NS ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS8_BASE_NS) - /** Peripheral DMA0_TEE_ALIAS9 base address */ - #define DMA0_TEE_ALIAS9_BASE (0x50089000u) - /** Peripheral DMA0_TEE_ALIAS9 base address */ - #define DMA0_TEE_ALIAS9_BASE_NS (0x40089000u) - /** Peripheral DMA0_TEE_ALIAS9 base pointer */ - #define DMA0_TEE_ALIAS9 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS9_BASE) - /** Peripheral DMA0_TEE_ALIAS9 base pointer */ - #define DMA0_TEE_ALIAS9_NS ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS9_BASE_NS) - /** Peripheral DMA0_TEE_ALIAS10 base address */ - #define DMA0_TEE_ALIAS10_BASE (0x5008A000u) - /** Peripheral DMA0_TEE_ALIAS10 base address */ - #define DMA0_TEE_ALIAS10_BASE_NS (0x4008A000u) - /** Peripheral DMA0_TEE_ALIAS10 base pointer */ - #define DMA0_TEE_ALIAS10 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS10_BASE) - /** Peripheral DMA0_TEE_ALIAS10 base pointer */ - #define DMA0_TEE_ALIAS10_NS ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS10_BASE_NS) - /** Peripheral DMA0_TEE_ALIAS11 base address */ - #define DMA0_TEE_ALIAS11_BASE (0x5008B000u) - /** Peripheral DMA0_TEE_ALIAS11 base address */ - #define DMA0_TEE_ALIAS11_BASE_NS (0x4008B000u) - /** Peripheral DMA0_TEE_ALIAS11 base pointer */ - #define DMA0_TEE_ALIAS11 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS11_BASE) - /** Peripheral DMA0_TEE_ALIAS11 base pointer */ - #define DMA0_TEE_ALIAS11_NS ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS11_BASE_NS) - /** Peripheral DMA0_TEE_ALIAS12 base address */ - #define DMA0_TEE_ALIAS12_BASE (0x5008C000u) - /** Peripheral DMA0_TEE_ALIAS12 base address */ - #define DMA0_TEE_ALIAS12_BASE_NS (0x4008C000u) - /** Peripheral DMA0_TEE_ALIAS12 base pointer */ - #define DMA0_TEE_ALIAS12 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS12_BASE) - /** Peripheral DMA0_TEE_ALIAS12 base pointer */ - #define DMA0_TEE_ALIAS12_NS ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS12_BASE_NS) - /** Peripheral DMA0_TEE_ALIAS13 base address */ - #define DMA0_TEE_ALIAS13_BASE (0x5008D000u) - /** Peripheral DMA0_TEE_ALIAS13 base address */ - #define DMA0_TEE_ALIAS13_BASE_NS (0x4008D000u) - /** Peripheral DMA0_TEE_ALIAS13 base pointer */ - #define DMA0_TEE_ALIAS13 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS13_BASE) - /** Peripheral DMA0_TEE_ALIAS13 base pointer */ - #define DMA0_TEE_ALIAS13_NS ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS13_BASE_NS) - /** Peripheral DMA0_TEE_ALIAS14 base address */ - #define DMA0_TEE_ALIAS14_BASE (0x5008E000u) - /** Peripheral DMA0_TEE_ALIAS14 base address */ - #define DMA0_TEE_ALIAS14_BASE_NS (0x4008E000u) - /** Peripheral DMA0_TEE_ALIAS14 base pointer */ - #define DMA0_TEE_ALIAS14 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS14_BASE) - /** Peripheral DMA0_TEE_ALIAS14 base pointer */ - #define DMA0_TEE_ALIAS14_NS ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS14_BASE_NS) - /** Peripheral DMA0_TEE_ALIAS15 base address */ - #define DMA0_TEE_ALIAS15_BASE (0x5008F000u) - /** Peripheral DMA0_TEE_ALIAS15 base address */ - #define DMA0_TEE_ALIAS15_BASE_NS (0x4008F000u) - /** Peripheral DMA0_TEE_ALIAS15 base pointer */ - #define DMA0_TEE_ALIAS15 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS15_BASE) - /** Peripheral DMA0_TEE_ALIAS15 base pointer */ - #define DMA0_TEE_ALIAS15_NS ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS15_BASE_NS) - /** Peripheral DMA0_TEE_ALIAS16 base address */ - #define DMA0_TEE_ALIAS16_BASE (0x50090000u) - /** Peripheral DMA0_TEE_ALIAS16 base address */ - #define DMA0_TEE_ALIAS16_BASE_NS (0x40090000u) - /** Peripheral DMA0_TEE_ALIAS16 base pointer */ - #define DMA0_TEE_ALIAS16 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS16_BASE) - /** Peripheral DMA0_TEE_ALIAS16 base pointer */ - #define DMA0_TEE_ALIAS16_NS ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS16_BASE_NS) - /** Array initializer of DMA0_TEE_ALIAS peripheral base addresses */ - #define DMA0_TEE_ALIAS_BASE_ADDRS { DMA0_TEE_ALIAS0_BASE, DMA0_TEE_ALIAS1_BASE, DMA0_TEE_ALIAS2_BASE, DMA0_TEE_ALIAS3_BASE, DMA0_TEE_ALIAS4_BASE, DMA0_TEE_ALIAS5_BASE, DMA0_TEE_ALIAS6_BASE, DMA0_TEE_ALIAS7_BASE, DMA0_TEE_ALIAS8_BASE, DMA0_TEE_ALIAS9_BASE, DMA0_TEE_ALIAS10_BASE, DMA0_TEE_ALIAS11_BASE, DMA0_TEE_ALIAS12_BASE, DMA0_TEE_ALIAS13_BASE, DMA0_TEE_ALIAS14_BASE, DMA0_TEE_ALIAS15_BASE, DMA0_TEE_ALIAS16_BASE } - /** Array initializer of DMA0_TEE_ALIAS peripheral base pointers */ - #define DMA0_TEE_ALIAS_BASE_PTRS { DMA0_TEE_ALIAS0, DMA0_TEE_ALIAS1, DMA0_TEE_ALIAS2, DMA0_TEE_ALIAS3, DMA0_TEE_ALIAS4, DMA0_TEE_ALIAS5, DMA0_TEE_ALIAS6, DMA0_TEE_ALIAS7, DMA0_TEE_ALIAS8, DMA0_TEE_ALIAS9, DMA0_TEE_ALIAS10, DMA0_TEE_ALIAS11, DMA0_TEE_ALIAS12, DMA0_TEE_ALIAS13, DMA0_TEE_ALIAS14, DMA0_TEE_ALIAS15, DMA0_TEE_ALIAS16 } - /** Array initializer of DMA0_TEE_ALIAS peripheral base addresses */ - #define DMA0_TEE_ALIAS_BASE_ADDRS_NS { DMA0_TEE_ALIAS0_BASE_NS, DMA0_TEE_ALIAS1_BASE_NS, DMA0_TEE_ALIAS2_BASE_NS, DMA0_TEE_ALIAS3_BASE_NS, DMA0_TEE_ALIAS4_BASE_NS, DMA0_TEE_ALIAS5_BASE_NS, DMA0_TEE_ALIAS6_BASE_NS, DMA0_TEE_ALIAS7_BASE_NS, DMA0_TEE_ALIAS8_BASE_NS, DMA0_TEE_ALIAS9_BASE_NS, DMA0_TEE_ALIAS10_BASE_NS, DMA0_TEE_ALIAS11_BASE_NS, DMA0_TEE_ALIAS12_BASE_NS, DMA0_TEE_ALIAS13_BASE_NS, DMA0_TEE_ALIAS14_BASE_NS, DMA0_TEE_ALIAS15_BASE_NS, DMA0_TEE_ALIAS16_BASE_NS } - /** Array initializer of DMA0_TEE_ALIAS peripheral base pointers */ - #define DMA0_TEE_ALIAS_BASE_PTRS_NS { DMA0_TEE_ALIAS0_NS, DMA0_TEE_ALIAS1_NS, DMA0_TEE_ALIAS2_NS, DMA0_TEE_ALIAS3_NS, DMA0_TEE_ALIAS4_NS, DMA0_TEE_ALIAS5_NS, DMA0_TEE_ALIAS6_NS, DMA0_TEE_ALIAS7_NS, DMA0_TEE_ALIAS8_NS, DMA0_TEE_ALIAS9_NS, DMA0_TEE_ALIAS10_NS, DMA0_TEE_ALIAS11_NS, DMA0_TEE_ALIAS12_NS, DMA0_TEE_ALIAS13_NS, DMA0_TEE_ALIAS14_NS, DMA0_TEE_ALIAS15_NS, DMA0_TEE_ALIAS16_NS } -#else - /** Peripheral DMA0_TEE_ALIAS0 base address */ - #define DMA0_TEE_ALIAS0_BASE (0x40080000u) - /** Peripheral DMA0_TEE_ALIAS0 base pointer */ - #define DMA0_TEE_ALIAS0 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS0_BASE) - /** Peripheral DMA0_TEE_ALIAS1 base address */ - #define DMA0_TEE_ALIAS1_BASE (0x40081000u) - /** Peripheral DMA0_TEE_ALIAS1 base pointer */ - #define DMA0_TEE_ALIAS1 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS1_BASE) - /** Peripheral DMA0_TEE_ALIAS2 base address */ - #define DMA0_TEE_ALIAS2_BASE (0x40082000u) - /** Peripheral DMA0_TEE_ALIAS2 base pointer */ - #define DMA0_TEE_ALIAS2 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS2_BASE) - /** Peripheral DMA0_TEE_ALIAS3 base address */ - #define DMA0_TEE_ALIAS3_BASE (0x40083000u) - /** Peripheral DMA0_TEE_ALIAS3 base pointer */ - #define DMA0_TEE_ALIAS3 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS3_BASE) - /** Peripheral DMA0_TEE_ALIAS4 base address */ - #define DMA0_TEE_ALIAS4_BASE (0x40084000u) - /** Peripheral DMA0_TEE_ALIAS4 base pointer */ - #define DMA0_TEE_ALIAS4 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS4_BASE) - /** Peripheral DMA0_TEE_ALIAS5 base address */ - #define DMA0_TEE_ALIAS5_BASE (0x40085000u) - /** Peripheral DMA0_TEE_ALIAS5 base pointer */ - #define DMA0_TEE_ALIAS5 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS5_BASE) - /** Peripheral DMA0_TEE_ALIAS6 base address */ - #define DMA0_TEE_ALIAS6_BASE (0x40086000u) - /** Peripheral DMA0_TEE_ALIAS6 base pointer */ - #define DMA0_TEE_ALIAS6 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS6_BASE) - /** Peripheral DMA0_TEE_ALIAS7 base address */ - #define DMA0_TEE_ALIAS7_BASE (0x40087000u) - /** Peripheral DMA0_TEE_ALIAS7 base pointer */ - #define DMA0_TEE_ALIAS7 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS7_BASE) - /** Peripheral DMA0_TEE_ALIAS8 base address */ - #define DMA0_TEE_ALIAS8_BASE (0x40088000u) - /** Peripheral DMA0_TEE_ALIAS8 base pointer */ - #define DMA0_TEE_ALIAS8 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS8_BASE) - /** Peripheral DMA0_TEE_ALIAS9 base address */ - #define DMA0_TEE_ALIAS9_BASE (0x40089000u) - /** Peripheral DMA0_TEE_ALIAS9 base pointer */ - #define DMA0_TEE_ALIAS9 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS9_BASE) - /** Peripheral DMA0_TEE_ALIAS10 base address */ - #define DMA0_TEE_ALIAS10_BASE (0x4008A000u) - /** Peripheral DMA0_TEE_ALIAS10 base pointer */ - #define DMA0_TEE_ALIAS10 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS10_BASE) - /** Peripheral DMA0_TEE_ALIAS11 base address */ - #define DMA0_TEE_ALIAS11_BASE (0x4008B000u) - /** Peripheral DMA0_TEE_ALIAS11 base pointer */ - #define DMA0_TEE_ALIAS11 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS11_BASE) - /** Peripheral DMA0_TEE_ALIAS12 base address */ - #define DMA0_TEE_ALIAS12_BASE (0x4008C000u) - /** Peripheral DMA0_TEE_ALIAS12 base pointer */ - #define DMA0_TEE_ALIAS12 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS12_BASE) - /** Peripheral DMA0_TEE_ALIAS13 base address */ - #define DMA0_TEE_ALIAS13_BASE (0x4008D000u) - /** Peripheral DMA0_TEE_ALIAS13 base pointer */ - #define DMA0_TEE_ALIAS13 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS13_BASE) - /** Peripheral DMA0_TEE_ALIAS14 base address */ - #define DMA0_TEE_ALIAS14_BASE (0x4008E000u) - /** Peripheral DMA0_TEE_ALIAS14 base pointer */ - #define DMA0_TEE_ALIAS14 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS14_BASE) - /** Peripheral DMA0_TEE_ALIAS15 base address */ - #define DMA0_TEE_ALIAS15_BASE (0x4008F000u) - /** Peripheral DMA0_TEE_ALIAS15 base pointer */ - #define DMA0_TEE_ALIAS15 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS15_BASE) - /** Peripheral DMA0_TEE_ALIAS16 base address */ - #define DMA0_TEE_ALIAS16_BASE (0x40090000u) - /** Peripheral DMA0_TEE_ALIAS16 base pointer */ - #define DMA0_TEE_ALIAS16 ((DMA0_TEE_ALIAS_Type *)DMA0_TEE_ALIAS16_BASE) - /** Array initializer of DMA0_TEE_ALIAS peripheral base addresses */ - #define DMA0_TEE_ALIAS_BASE_ADDRS { DMA0_TEE_ALIAS0_BASE, DMA0_TEE_ALIAS1_BASE, DMA0_TEE_ALIAS2_BASE, DMA0_TEE_ALIAS3_BASE, DMA0_TEE_ALIAS4_BASE, DMA0_TEE_ALIAS5_BASE, DMA0_TEE_ALIAS6_BASE, DMA0_TEE_ALIAS7_BASE, DMA0_TEE_ALIAS8_BASE, DMA0_TEE_ALIAS9_BASE, DMA0_TEE_ALIAS10_BASE, DMA0_TEE_ALIAS11_BASE, DMA0_TEE_ALIAS12_BASE, DMA0_TEE_ALIAS13_BASE, DMA0_TEE_ALIAS14_BASE, DMA0_TEE_ALIAS15_BASE, DMA0_TEE_ALIAS16_BASE } - /** Array initializer of DMA0_TEE_ALIAS peripheral base pointers */ - #define DMA0_TEE_ALIAS_BASE_PTRS { DMA0_TEE_ALIAS0, DMA0_TEE_ALIAS1, DMA0_TEE_ALIAS2, DMA0_TEE_ALIAS3, DMA0_TEE_ALIAS4, DMA0_TEE_ALIAS5, DMA0_TEE_ALIAS6, DMA0_TEE_ALIAS7, DMA0_TEE_ALIAS8, DMA0_TEE_ALIAS9, DMA0_TEE_ALIAS10, DMA0_TEE_ALIAS11, DMA0_TEE_ALIAS12, DMA0_TEE_ALIAS13, DMA0_TEE_ALIAS14, DMA0_TEE_ALIAS15, DMA0_TEE_ALIAS16 } -#endif - -/*! - * @} - */ /* end of group DMA0_TEE_ALIAS_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- DMA1_TEE_ALIAS Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DMA1_TEE_ALIAS_Peripheral_Access_Layer DMA1_TEE_ALIAS Peripheral Access Layer - * @{ - */ - -/** DMA1_TEE_ALIAS - Register Layout Typedef */ -typedef struct { - uint8_t RESERVED_0[4092]; - uint32_t RESERVED; /**< Reserved., offset: 0xFFC */ -} DMA1_TEE_ALIAS_Type; - -/* ---------------------------------------------------------------------------- - -- DMA1_TEE_ALIAS Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DMA1_TEE_ALIAS_Register_Masks DMA1_TEE_ALIAS Register Masks - * @{ - */ - - -/*! - * @} - */ /* end of group DMA1_TEE_ALIAS_Register_Masks */ - - -/* DMA1_TEE_ALIAS - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral DMA1_TEE_ALIAS0 base address */ - #define DMA1_TEE_ALIAS0_BASE (0x500A0000u) - /** Peripheral DMA1_TEE_ALIAS0 base address */ - #define DMA1_TEE_ALIAS0_BASE_NS (0x400A0000u) - /** Peripheral DMA1_TEE_ALIAS0 base pointer */ - #define DMA1_TEE_ALIAS0 ((DMA1_TEE_ALIAS_Type *)DMA1_TEE_ALIAS0_BASE) - /** Peripheral DMA1_TEE_ALIAS0 base pointer */ - #define DMA1_TEE_ALIAS0_NS ((DMA1_TEE_ALIAS_Type *)DMA1_TEE_ALIAS0_BASE_NS) - /** Peripheral DMA1_TEE_ALIAS1 base address */ - #define DMA1_TEE_ALIAS1_BASE (0x500A1000u) - /** Peripheral DMA1_TEE_ALIAS1 base address */ - #define DMA1_TEE_ALIAS1_BASE_NS (0x400A1000u) - /** Peripheral DMA1_TEE_ALIAS1 base pointer */ - #define DMA1_TEE_ALIAS1 ((DMA1_TEE_ALIAS_Type *)DMA1_TEE_ALIAS1_BASE) - /** Peripheral DMA1_TEE_ALIAS1 base pointer */ - #define DMA1_TEE_ALIAS1_NS ((DMA1_TEE_ALIAS_Type *)DMA1_TEE_ALIAS1_BASE_NS) - /** Peripheral DMA1_TEE_ALIAS2 base address */ - #define DMA1_TEE_ALIAS2_BASE (0x500A2000u) - /** Peripheral DMA1_TEE_ALIAS2 base address */ - #define DMA1_TEE_ALIAS2_BASE_NS (0x400A2000u) - /** Peripheral DMA1_TEE_ALIAS2 base pointer */ - #define DMA1_TEE_ALIAS2 ((DMA1_TEE_ALIAS_Type *)DMA1_TEE_ALIAS2_BASE) - /** Peripheral DMA1_TEE_ALIAS2 base pointer */ - #define DMA1_TEE_ALIAS2_NS ((DMA1_TEE_ALIAS_Type *)DMA1_TEE_ALIAS2_BASE_NS) - /** Peripheral DMA1_TEE_ALIAS3 base address */ - #define DMA1_TEE_ALIAS3_BASE (0x500A3000u) - /** Peripheral DMA1_TEE_ALIAS3 base address */ - #define DMA1_TEE_ALIAS3_BASE_NS (0x400A3000u) - /** Peripheral DMA1_TEE_ALIAS3 base pointer */ - #define DMA1_TEE_ALIAS3 ((DMA1_TEE_ALIAS_Type *)DMA1_TEE_ALIAS3_BASE) - /** Peripheral DMA1_TEE_ALIAS3 base pointer */ - #define DMA1_TEE_ALIAS3_NS ((DMA1_TEE_ALIAS_Type *)DMA1_TEE_ALIAS3_BASE_NS) - /** Peripheral DMA1_TEE_ALIAS4 base address */ - #define DMA1_TEE_ALIAS4_BASE (0x500A4000u) - /** Peripheral DMA1_TEE_ALIAS4 base address */ - #define DMA1_TEE_ALIAS4_BASE_NS (0x400A4000u) - /** Peripheral DMA1_TEE_ALIAS4 base pointer */ - #define DMA1_TEE_ALIAS4 ((DMA1_TEE_ALIAS_Type *)DMA1_TEE_ALIAS4_BASE) - /** Peripheral DMA1_TEE_ALIAS4 base pointer */ - #define DMA1_TEE_ALIAS4_NS ((DMA1_TEE_ALIAS_Type *)DMA1_TEE_ALIAS4_BASE_NS) - /** Peripheral DMA1_TEE_ALIAS5 base address */ - #define DMA1_TEE_ALIAS5_BASE (0x500A5000u) - /** Peripheral DMA1_TEE_ALIAS5 base address */ - #define DMA1_TEE_ALIAS5_BASE_NS (0x400A5000u) - /** Peripheral DMA1_TEE_ALIAS5 base pointer */ - #define DMA1_TEE_ALIAS5 ((DMA1_TEE_ALIAS_Type *)DMA1_TEE_ALIAS5_BASE) - /** Peripheral DMA1_TEE_ALIAS5 base pointer */ - #define DMA1_TEE_ALIAS5_NS ((DMA1_TEE_ALIAS_Type *)DMA1_TEE_ALIAS5_BASE_NS) - /** Peripheral DMA1_TEE_ALIAS6 base address */ - #define DMA1_TEE_ALIAS6_BASE (0x500A6000u) - /** Peripheral DMA1_TEE_ALIAS6 base address */ - #define DMA1_TEE_ALIAS6_BASE_NS (0x400A6000u) - /** Peripheral DMA1_TEE_ALIAS6 base pointer */ - #define DMA1_TEE_ALIAS6 ((DMA1_TEE_ALIAS_Type *)DMA1_TEE_ALIAS6_BASE) - /** Peripheral DMA1_TEE_ALIAS6 base pointer */ - #define DMA1_TEE_ALIAS6_NS ((DMA1_TEE_ALIAS_Type *)DMA1_TEE_ALIAS6_BASE_NS) - /** Peripheral DMA1_TEE_ALIAS7 base address */ - #define DMA1_TEE_ALIAS7_BASE (0x500A7000u) - /** Peripheral DMA1_TEE_ALIAS7 base address */ - #define DMA1_TEE_ALIAS7_BASE_NS (0x400A7000u) - /** Peripheral DMA1_TEE_ALIAS7 base pointer */ - #define DMA1_TEE_ALIAS7 ((DMA1_TEE_ALIAS_Type *)DMA1_TEE_ALIAS7_BASE) - /** Peripheral DMA1_TEE_ALIAS7 base pointer */ - #define DMA1_TEE_ALIAS7_NS ((DMA1_TEE_ALIAS_Type *)DMA1_TEE_ALIAS7_BASE_NS) - /** Peripheral DMA1_TEE_ALIAS8 base address */ - #define DMA1_TEE_ALIAS8_BASE (0x500A8000u) - /** Peripheral DMA1_TEE_ALIAS8 base address */ - #define DMA1_TEE_ALIAS8_BASE_NS (0x400A8000u) - /** Peripheral DMA1_TEE_ALIAS8 base pointer */ - #define DMA1_TEE_ALIAS8 ((DMA1_TEE_ALIAS_Type *)DMA1_TEE_ALIAS8_BASE) - /** Peripheral DMA1_TEE_ALIAS8 base pointer */ - #define DMA1_TEE_ALIAS8_NS ((DMA1_TEE_ALIAS_Type *)DMA1_TEE_ALIAS8_BASE_NS) - /** Array initializer of DMA1_TEE_ALIAS peripheral base addresses */ - #define DMA1_TEE_ALIAS_BASE_ADDRS { DMA1_TEE_ALIAS0_BASE, DMA1_TEE_ALIAS1_BASE, DMA1_TEE_ALIAS2_BASE, DMA1_TEE_ALIAS3_BASE, DMA1_TEE_ALIAS4_BASE, DMA1_TEE_ALIAS5_BASE, DMA1_TEE_ALIAS6_BASE, DMA1_TEE_ALIAS7_BASE, DMA1_TEE_ALIAS8_BASE } - /** Array initializer of DMA1_TEE_ALIAS peripheral base pointers */ - #define DMA1_TEE_ALIAS_BASE_PTRS { DMA1_TEE_ALIAS0, DMA1_TEE_ALIAS1, DMA1_TEE_ALIAS2, DMA1_TEE_ALIAS3, DMA1_TEE_ALIAS4, DMA1_TEE_ALIAS5, DMA1_TEE_ALIAS6, DMA1_TEE_ALIAS7, DMA1_TEE_ALIAS8 } - /** Array initializer of DMA1_TEE_ALIAS peripheral base addresses */ - #define DMA1_TEE_ALIAS_BASE_ADDRS_NS { DMA1_TEE_ALIAS0_BASE_NS, DMA1_TEE_ALIAS1_BASE_NS, DMA1_TEE_ALIAS2_BASE_NS, DMA1_TEE_ALIAS3_BASE_NS, DMA1_TEE_ALIAS4_BASE_NS, DMA1_TEE_ALIAS5_BASE_NS, DMA1_TEE_ALIAS6_BASE_NS, DMA1_TEE_ALIAS7_BASE_NS, DMA1_TEE_ALIAS8_BASE_NS } - /** Array initializer of DMA1_TEE_ALIAS peripheral base pointers */ - #define DMA1_TEE_ALIAS_BASE_PTRS_NS { DMA1_TEE_ALIAS0_NS, DMA1_TEE_ALIAS1_NS, DMA1_TEE_ALIAS2_NS, DMA1_TEE_ALIAS3_NS, DMA1_TEE_ALIAS4_NS, DMA1_TEE_ALIAS5_NS, DMA1_TEE_ALIAS6_NS, DMA1_TEE_ALIAS7_NS, DMA1_TEE_ALIAS8_NS } -#else - /** Peripheral DMA1_TEE_ALIAS0 base address */ - #define DMA1_TEE_ALIAS0_BASE (0x400A0000u) - /** Peripheral DMA1_TEE_ALIAS0 base pointer */ - #define DMA1_TEE_ALIAS0 ((DMA1_TEE_ALIAS_Type *)DMA1_TEE_ALIAS0_BASE) - /** Peripheral DMA1_TEE_ALIAS1 base address */ - #define DMA1_TEE_ALIAS1_BASE (0x400A1000u) - /** Peripheral DMA1_TEE_ALIAS1 base pointer */ - #define DMA1_TEE_ALIAS1 ((DMA1_TEE_ALIAS_Type *)DMA1_TEE_ALIAS1_BASE) - /** Peripheral DMA1_TEE_ALIAS2 base address */ - #define DMA1_TEE_ALIAS2_BASE (0x400A2000u) - /** Peripheral DMA1_TEE_ALIAS2 base pointer */ - #define DMA1_TEE_ALIAS2 ((DMA1_TEE_ALIAS_Type *)DMA1_TEE_ALIAS2_BASE) - /** Peripheral DMA1_TEE_ALIAS3 base address */ - #define DMA1_TEE_ALIAS3_BASE (0x400A3000u) - /** Peripheral DMA1_TEE_ALIAS3 base pointer */ - #define DMA1_TEE_ALIAS3 ((DMA1_TEE_ALIAS_Type *)DMA1_TEE_ALIAS3_BASE) - /** Peripheral DMA1_TEE_ALIAS4 base address */ - #define DMA1_TEE_ALIAS4_BASE (0x400A4000u) - /** Peripheral DMA1_TEE_ALIAS4 base pointer */ - #define DMA1_TEE_ALIAS4 ((DMA1_TEE_ALIAS_Type *)DMA1_TEE_ALIAS4_BASE) - /** Peripheral DMA1_TEE_ALIAS5 base address */ - #define DMA1_TEE_ALIAS5_BASE (0x400A5000u) - /** Peripheral DMA1_TEE_ALIAS5 base pointer */ - #define DMA1_TEE_ALIAS5 ((DMA1_TEE_ALIAS_Type *)DMA1_TEE_ALIAS5_BASE) - /** Peripheral DMA1_TEE_ALIAS6 base address */ - #define DMA1_TEE_ALIAS6_BASE (0x400A6000u) - /** Peripheral DMA1_TEE_ALIAS6 base pointer */ - #define DMA1_TEE_ALIAS6 ((DMA1_TEE_ALIAS_Type *)DMA1_TEE_ALIAS6_BASE) - /** Peripheral DMA1_TEE_ALIAS7 base address */ - #define DMA1_TEE_ALIAS7_BASE (0x400A7000u) - /** Peripheral DMA1_TEE_ALIAS7 base pointer */ - #define DMA1_TEE_ALIAS7 ((DMA1_TEE_ALIAS_Type *)DMA1_TEE_ALIAS7_BASE) - /** Peripheral DMA1_TEE_ALIAS8 base address */ - #define DMA1_TEE_ALIAS8_BASE (0x400A8000u) - /** Peripheral DMA1_TEE_ALIAS8 base pointer */ - #define DMA1_TEE_ALIAS8 ((DMA1_TEE_ALIAS_Type *)DMA1_TEE_ALIAS8_BASE) - /** Array initializer of DMA1_TEE_ALIAS peripheral base addresses */ - #define DMA1_TEE_ALIAS_BASE_ADDRS { DMA1_TEE_ALIAS0_BASE, DMA1_TEE_ALIAS1_BASE, DMA1_TEE_ALIAS2_BASE, DMA1_TEE_ALIAS3_BASE, DMA1_TEE_ALIAS4_BASE, DMA1_TEE_ALIAS5_BASE, DMA1_TEE_ALIAS6_BASE, DMA1_TEE_ALIAS7_BASE, DMA1_TEE_ALIAS8_BASE } - /** Array initializer of DMA1_TEE_ALIAS peripheral base pointers */ - #define DMA1_TEE_ALIAS_BASE_PTRS { DMA1_TEE_ALIAS0, DMA1_TEE_ALIAS1, DMA1_TEE_ALIAS2, DMA1_TEE_ALIAS3, DMA1_TEE_ALIAS4, DMA1_TEE_ALIAS5, DMA1_TEE_ALIAS6, DMA1_TEE_ALIAS7, DMA1_TEE_ALIAS8 } -#endif - -/*! - * @} - */ /* end of group DMA1_TEE_ALIAS_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- EIM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup EIM_Peripheral_Access_Layer EIM Peripheral Access Layer - * @{ - */ - -/** EIM - Register Layout Typedef */ -typedef struct { - __IO uint32_t EIMCR; /**< Error Injection Module Configuration Register, offset: 0x0 */ - __IO uint32_t EICHEN; /**< Error Injection Channel Enable register, offset: 0x4 */ - uint8_t RESERVED_0[248]; - __IO uint32_t EICHD0_WORD0; /**< Error Injection Channel Descriptor 0, Word0, offset: 0x100 */ - __IO uint32_t EICHD0_WORD1; /**< Error Injection Channel Descriptor 0, Word1, offset: 0x104 */ - uint8_t RESERVED_1[56]; - __IO uint32_t EICHD1_WORD0; /**< Error Injection Channel Descriptor 1, Word0, offset: 0x140 */ - __IO uint32_t EICHD1_WORD1; /**< Error Injection Channel Descriptor 1, Word1, offset: 0x144 */ - uint8_t RESERVED_2[56]; - __IO uint32_t EICHD2_WORD0; /**< Error Injection Channel Descriptor 2, Word0, offset: 0x180 */ - __IO uint32_t EICHD2_WORD1; /**< Error Injection Channel Descriptor 2, Word1, offset: 0x184 */ - uint8_t RESERVED_3[56]; - __IO uint32_t EICHD3_WORD0; /**< Error Injection Channel Descriptor 3, Word0, offset: 0x1C0 */ - __IO uint32_t EICHD3_WORD1; /**< Error Injection Channel Descriptor 3, Word1, offset: 0x1C4 */ - uint8_t RESERVED_4[56]; - __IO uint32_t EICHD4_WORD0; /**< Error Injection Channel Descriptor 4, Word0, offset: 0x200 */ - __IO uint32_t EICHD4_WORD1; /**< Error Injection Channel Descriptor 4, Word1, offset: 0x204 */ - uint8_t RESERVED_5[56]; - __IO uint32_t EICHD5_WORD0; /**< Error Injection Channel Descriptor 5, Word0, offset: 0x240 */ - __IO uint32_t EICHD5_WORD1; /**< Error Injection Channel Descriptor 5, Word1, offset: 0x244 */ - uint8_t RESERVED_6[56]; - __IO uint32_t EICHD6_WORD0; /**< Error Injection Channel Descriptor 6, Word0, offset: 0x280 */ - __IO uint32_t EICHD6_WORD1; /**< Error Injection Channel Descriptor 6, Word1, offset: 0x284 */ - uint8_t RESERVED_7[56]; - __IO uint32_t EICHD7_WORD0; /**< Error Injection Channel Descriptor 7, Word0, offset: 0x2C0 */ - __IO uint32_t EICHD7_WORD1; /**< Error Injection Channel Descriptor 7, Word1, offset: 0x2C4 */ - uint8_t RESERVED_8[56]; - __IO uint32_t EICHD8_WORD0; /**< Error Injection Channel Descriptor 8, Word0, offset: 0x300 */ - __IO uint32_t EICHD8_WORD1; /**< Error Injection Channel Descriptor 8, Word1, offset: 0x304 */ -} EIM_Type; - -/* ---------------------------------------------------------------------------- - -- EIM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup EIM_Register_Masks EIM Register Masks - * @{ - */ - -/*! @name EIMCR - Error Injection Module Configuration Register */ -/*! @{ */ - -#define EIM_EIMCR_GEIEN_MASK (0x1U) -#define EIM_EIMCR_GEIEN_SHIFT (0U) -/*! GEIEN - Global Error Injection Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EIM_EIMCR_GEIEN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EIMCR_GEIEN_SHIFT)) & EIM_EIMCR_GEIEN_MASK) -/*! @} */ - -/*! @name EICHEN - Error Injection Channel Enable register */ -/*! @{ */ - -#define EIM_EICHEN_EICH8EN_MASK (0x800000U) -#define EIM_EICHEN_EICH8EN_SHIFT (23U) -/*! EICH8EN - Error Injection Channel 8 Enable - * 0b0..Error injection is disabled on Error Injection Channel 8 - * 0b1..Error injection is enabled on Error Injection Channel 8 - */ -#define EIM_EICHEN_EICH8EN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHEN_EICH8EN_SHIFT)) & EIM_EICHEN_EICH8EN_MASK) - -#define EIM_EICHEN_EICH7EN_MASK (0x1000000U) -#define EIM_EICHEN_EICH7EN_SHIFT (24U) -/*! EICH7EN - Error Injection Channel 7 Enable - * 0b0..Error injection is disabled on Error Injection Channel 7 - * 0b1..Error injection is enabled on Error Injection Channel 7 - */ -#define EIM_EICHEN_EICH7EN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHEN_EICH7EN_SHIFT)) & EIM_EICHEN_EICH7EN_MASK) - -#define EIM_EICHEN_EICH6EN_MASK (0x2000000U) -#define EIM_EICHEN_EICH6EN_SHIFT (25U) -/*! EICH6EN - Error Injection Channel 6 Enable - * 0b0..Error injection is disabled on Error Injection Channel 6 - * 0b1..Error injection is enabled on Error Injection Channel 6 - */ -#define EIM_EICHEN_EICH6EN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHEN_EICH6EN_SHIFT)) & EIM_EICHEN_EICH6EN_MASK) - -#define EIM_EICHEN_EICH5EN_MASK (0x4000000U) -#define EIM_EICHEN_EICH5EN_SHIFT (26U) -/*! EICH5EN - Error Injection Channel 5 Enable - * 0b0..Error injection is disabled on Error Injection Channel 5 - * 0b1..Error injection is enabled on Error Injection Channel 5 - */ -#define EIM_EICHEN_EICH5EN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHEN_EICH5EN_SHIFT)) & EIM_EICHEN_EICH5EN_MASK) - -#define EIM_EICHEN_EICH4EN_MASK (0x8000000U) -#define EIM_EICHEN_EICH4EN_SHIFT (27U) -/*! EICH4EN - Error Injection Channel 4 Enable - * 0b0..Error injection is disabled on Error Injection Channel 4 - * 0b1..Error injection is enabled on Error Injection Channel 4 - */ -#define EIM_EICHEN_EICH4EN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHEN_EICH4EN_SHIFT)) & EIM_EICHEN_EICH4EN_MASK) - -#define EIM_EICHEN_EICH3EN_MASK (0x10000000U) -#define EIM_EICHEN_EICH3EN_SHIFT (28U) -/*! EICH3EN - Error Injection Channel 3 Enable - * 0b0..Error injection is disabled on Error Injection Channel 3 - * 0b1..Error injection is enabled on Error Injection Channel 3 - */ -#define EIM_EICHEN_EICH3EN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHEN_EICH3EN_SHIFT)) & EIM_EICHEN_EICH3EN_MASK) - -#define EIM_EICHEN_EICH2EN_MASK (0x20000000U) -#define EIM_EICHEN_EICH2EN_SHIFT (29U) -/*! EICH2EN - Error Injection Channel 2 Enable - * 0b0..Error injection is disabled on Error Injection Channel 2 - * 0b1..Error injection is enabled on Error Injection Channel 2 - */ -#define EIM_EICHEN_EICH2EN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHEN_EICH2EN_SHIFT)) & EIM_EICHEN_EICH2EN_MASK) - -#define EIM_EICHEN_EICH1EN_MASK (0x40000000U) -#define EIM_EICHEN_EICH1EN_SHIFT (30U) -/*! EICH1EN - Error Injection Channel 1 Enable - * 0b0..Error injection is disabled on Error Injection Channel 1 - * 0b1..Error injection is enabled on Error Injection Channel 1 - */ -#define EIM_EICHEN_EICH1EN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHEN_EICH1EN_SHIFT)) & EIM_EICHEN_EICH1EN_MASK) - -#define EIM_EICHEN_EICH0EN_MASK (0x80000000U) -#define EIM_EICHEN_EICH0EN_SHIFT (31U) -/*! EICH0EN - Error Injection Channel 0 Enable - * 0b0..Error injection is disabled on Error Injection Channel 0 - * 0b1..Error injection is enabled on Error Injection Channel 0 - */ -#define EIM_EICHEN_EICH0EN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHEN_EICH0EN_SHIFT)) & EIM_EICHEN_EICH0EN_MASK) -/*! @} */ - -/*! @name EICHD0_WORD0 - Error Injection Channel Descriptor 0, Word0 */ -/*! @{ */ - -#define EIM_EICHD0_WORD0_CHKBIT_MASK_MASK (0xFE000000U) -#define EIM_EICHD0_WORD0_CHKBIT_MASK_SHIFT (25U) -/*! CHKBIT_MASK - Checkbit Mask */ -#define EIM_EICHD0_WORD0_CHKBIT_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD0_WORD0_CHKBIT_MASK_SHIFT)) & EIM_EICHD0_WORD0_CHKBIT_MASK_MASK) -/*! @} */ - -/*! @name EICHD0_WORD1 - Error Injection Channel Descriptor 0, Word1 */ -/*! @{ */ - -#define EIM_EICHD0_WORD1_B0_3DATA_MASK_MASK (0xFFFFFFFFU) -#define EIM_EICHD0_WORD1_B0_3DATA_MASK_SHIFT (0U) -/*! B0_3DATA_MASK - Data Mask Bytes 0-3 */ -#define EIM_EICHD0_WORD1_B0_3DATA_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD0_WORD1_B0_3DATA_MASK_SHIFT)) & EIM_EICHD0_WORD1_B0_3DATA_MASK_MASK) -/*! @} */ - -/*! @name EICHD1_WORD0 - Error Injection Channel Descriptor 1, Word0 */ -/*! @{ */ - -#define EIM_EICHD1_WORD0_CHKBIT_MASK_MASK (0xFE000000U) -#define EIM_EICHD1_WORD0_CHKBIT_MASK_SHIFT (25U) -/*! CHKBIT_MASK - Checkbit Mask */ -#define EIM_EICHD1_WORD0_CHKBIT_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD1_WORD0_CHKBIT_MASK_SHIFT)) & EIM_EICHD1_WORD0_CHKBIT_MASK_MASK) -/*! @} */ - -/*! @name EICHD1_WORD1 - Error Injection Channel Descriptor 1, Word1 */ -/*! @{ */ - -#define EIM_EICHD1_WORD1_B0_3DATA_MASK_MASK (0xFFFFFFFFU) -#define EIM_EICHD1_WORD1_B0_3DATA_MASK_SHIFT (0U) -/*! B0_3DATA_MASK - Data Mask Bytes 0-3 */ -#define EIM_EICHD1_WORD1_B0_3DATA_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD1_WORD1_B0_3DATA_MASK_SHIFT)) & EIM_EICHD1_WORD1_B0_3DATA_MASK_MASK) -/*! @} */ - -/*! @name EICHD2_WORD0 - Error Injection Channel Descriptor 2, Word0 */ -/*! @{ */ - -#define EIM_EICHD2_WORD0_CHKBIT_MASK_MASK (0xFE000000U) -#define EIM_EICHD2_WORD0_CHKBIT_MASK_SHIFT (25U) -/*! CHKBIT_MASK - Checkbit Mask */ -#define EIM_EICHD2_WORD0_CHKBIT_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD2_WORD0_CHKBIT_MASK_SHIFT)) & EIM_EICHD2_WORD0_CHKBIT_MASK_MASK) -/*! @} */ - -/*! @name EICHD2_WORD1 - Error Injection Channel Descriptor 2, Word1 */ -/*! @{ */ - -#define EIM_EICHD2_WORD1_B0_3DATA_MASK_MASK (0xFFFFFFFFU) -#define EIM_EICHD2_WORD1_B0_3DATA_MASK_SHIFT (0U) -/*! B0_3DATA_MASK - Data Mask Bytes 0-3 */ -#define EIM_EICHD2_WORD1_B0_3DATA_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD2_WORD1_B0_3DATA_MASK_SHIFT)) & EIM_EICHD2_WORD1_B0_3DATA_MASK_MASK) -/*! @} */ - -/*! @name EICHD3_WORD0 - Error Injection Channel Descriptor 3, Word0 */ -/*! @{ */ - -#define EIM_EICHD3_WORD0_CHKBIT_MASK_MASK (0xFE000000U) -#define EIM_EICHD3_WORD0_CHKBIT_MASK_SHIFT (25U) -/*! CHKBIT_MASK - Checkbit Mask */ -#define EIM_EICHD3_WORD0_CHKBIT_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD3_WORD0_CHKBIT_MASK_SHIFT)) & EIM_EICHD3_WORD0_CHKBIT_MASK_MASK) -/*! @} */ - -/*! @name EICHD3_WORD1 - Error Injection Channel Descriptor 3, Word1 */ -/*! @{ */ - -#define EIM_EICHD3_WORD1_B0_3DATA_MASK_MASK (0xFFFFFFFFU) -#define EIM_EICHD3_WORD1_B0_3DATA_MASK_SHIFT (0U) -/*! B0_3DATA_MASK - Data Mask Bytes 0-3 */ -#define EIM_EICHD3_WORD1_B0_3DATA_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD3_WORD1_B0_3DATA_MASK_SHIFT)) & EIM_EICHD3_WORD1_B0_3DATA_MASK_MASK) -/*! @} */ - -/*! @name EICHD4_WORD0 - Error Injection Channel Descriptor 4, Word0 */ -/*! @{ */ - -#define EIM_EICHD4_WORD0_CHKBIT_MASK_MASK (0xFE000000U) -#define EIM_EICHD4_WORD0_CHKBIT_MASK_SHIFT (25U) -/*! CHKBIT_MASK - Checkbit Mask */ -#define EIM_EICHD4_WORD0_CHKBIT_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD4_WORD0_CHKBIT_MASK_SHIFT)) & EIM_EICHD4_WORD0_CHKBIT_MASK_MASK) -/*! @} */ - -/*! @name EICHD4_WORD1 - Error Injection Channel Descriptor 4, Word1 */ -/*! @{ */ - -#define EIM_EICHD4_WORD1_B0_3DATA_MASK_MASK (0xFFFFFFFFU) -#define EIM_EICHD4_WORD1_B0_3DATA_MASK_SHIFT (0U) -/*! B0_3DATA_MASK - Data Mask Bytes 0-3 */ -#define EIM_EICHD4_WORD1_B0_3DATA_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD4_WORD1_B0_3DATA_MASK_SHIFT)) & EIM_EICHD4_WORD1_B0_3DATA_MASK_MASK) -/*! @} */ - -/*! @name EICHD5_WORD0 - Error Injection Channel Descriptor 5, Word0 */ -/*! @{ */ - -#define EIM_EICHD5_WORD0_CHKBIT_MASK_MASK (0xFE000000U) -#define EIM_EICHD5_WORD0_CHKBIT_MASK_SHIFT (25U) -/*! CHKBIT_MASK - Checkbit Mask */ -#define EIM_EICHD5_WORD0_CHKBIT_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD5_WORD0_CHKBIT_MASK_SHIFT)) & EIM_EICHD5_WORD0_CHKBIT_MASK_MASK) -/*! @} */ - -/*! @name EICHD5_WORD1 - Error Injection Channel Descriptor 5, Word1 */ -/*! @{ */ - -#define EIM_EICHD5_WORD1_B0_3DATA_MASK_MASK (0xFFFFFFFFU) -#define EIM_EICHD5_WORD1_B0_3DATA_MASK_SHIFT (0U) -/*! B0_3DATA_MASK - Data Mask Bytes 0-3 */ -#define EIM_EICHD5_WORD1_B0_3DATA_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD5_WORD1_B0_3DATA_MASK_SHIFT)) & EIM_EICHD5_WORD1_B0_3DATA_MASK_MASK) -/*! @} */ - -/*! @name EICHD6_WORD0 - Error Injection Channel Descriptor 6, Word0 */ -/*! @{ */ - -#define EIM_EICHD6_WORD0_CHKBIT_MASK_MASK (0xFE000000U) -#define EIM_EICHD6_WORD0_CHKBIT_MASK_SHIFT (25U) -/*! CHKBIT_MASK - Checkbit Mask */ -#define EIM_EICHD6_WORD0_CHKBIT_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD6_WORD0_CHKBIT_MASK_SHIFT)) & EIM_EICHD6_WORD0_CHKBIT_MASK_MASK) -/*! @} */ - -/*! @name EICHD6_WORD1 - Error Injection Channel Descriptor 6, Word1 */ -/*! @{ */ - -#define EIM_EICHD6_WORD1_B0_3DATA_MASK_MASK (0xFFFFFFFFU) -#define EIM_EICHD6_WORD1_B0_3DATA_MASK_SHIFT (0U) -/*! B0_3DATA_MASK - Data Mask Bytes 0-3 */ -#define EIM_EICHD6_WORD1_B0_3DATA_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD6_WORD1_B0_3DATA_MASK_SHIFT)) & EIM_EICHD6_WORD1_B0_3DATA_MASK_MASK) -/*! @} */ - -/*! @name EICHD7_WORD0 - Error Injection Channel Descriptor 7, Word0 */ -/*! @{ */ - -#define EIM_EICHD7_WORD0_CHKBIT_MASK_MASK (0x80000000U) -#define EIM_EICHD7_WORD0_CHKBIT_MASK_SHIFT (31U) -/*! CHKBIT_MASK - Checkbit Mask */ -#define EIM_EICHD7_WORD0_CHKBIT_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD7_WORD0_CHKBIT_MASK_SHIFT)) & EIM_EICHD7_WORD0_CHKBIT_MASK_MASK) -/*! @} */ - -/*! @name EICHD7_WORD1 - Error Injection Channel Descriptor 7, Word1 */ -/*! @{ */ - -#define EIM_EICHD7_WORD1_B0_3DATA_MASK_MASK (0xFFFFFFFFU) -#define EIM_EICHD7_WORD1_B0_3DATA_MASK_SHIFT (0U) -/*! B0_3DATA_MASK - Data Mask Bytes 0-3 */ -#define EIM_EICHD7_WORD1_B0_3DATA_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD7_WORD1_B0_3DATA_MASK_SHIFT)) & EIM_EICHD7_WORD1_B0_3DATA_MASK_MASK) -/*! @} */ - -/*! @name EICHD8_WORD0 - Error Injection Channel Descriptor 8, Word0 */ -/*! @{ */ - -#define EIM_EICHD8_WORD0_CHKBIT_MASK_MASK (0xF0000000U) -#define EIM_EICHD8_WORD0_CHKBIT_MASK_SHIFT (28U) -/*! CHKBIT_MASK - Checkbit Mask */ -#define EIM_EICHD8_WORD0_CHKBIT_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD8_WORD0_CHKBIT_MASK_SHIFT)) & EIM_EICHD8_WORD0_CHKBIT_MASK_MASK) -/*! @} */ - -/*! @name EICHD8_WORD1 - Error Injection Channel Descriptor 8, Word1 */ -/*! @{ */ - -#define EIM_EICHD8_WORD1_B0_3DATA_MASK_MASK (0xFFFFFFFFU) -#define EIM_EICHD8_WORD1_B0_3DATA_MASK_SHIFT (0U) -/*! B0_3DATA_MASK - Data Mask Bytes 0-3 */ -#define EIM_EICHD8_WORD1_B0_3DATA_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD8_WORD1_B0_3DATA_MASK_SHIFT)) & EIM_EICHD8_WORD1_B0_3DATA_MASK_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group EIM_Register_Masks */ - - -/* EIM - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral EIM0 base address */ - #define EIM0_BASE (0x5005B000u) - /** Peripheral EIM0 base address */ - #define EIM0_BASE_NS (0x4005B000u) - /** Peripheral EIM0 base pointer */ - #define EIM0 ((EIM_Type *)EIM0_BASE) - /** Peripheral EIM0 base pointer */ - #define EIM0_NS ((EIM_Type *)EIM0_BASE_NS) - /** Array initializer of EIM peripheral base addresses */ - #define EIM_BASE_ADDRS { EIM0_BASE } - /** Array initializer of EIM peripheral base pointers */ - #define EIM_BASE_PTRS { EIM0 } - /** Array initializer of EIM peripheral base addresses */ - #define EIM_BASE_ADDRS_NS { EIM0_BASE_NS } - /** Array initializer of EIM peripheral base pointers */ - #define EIM_BASE_PTRS_NS { EIM0_NS } -#else - /** Peripheral EIM0 base address */ - #define EIM0_BASE (0x4005B000u) - /** Peripheral EIM0 base pointer */ - #define EIM0 ((EIM_Type *)EIM0_BASE) - /** Array initializer of EIM peripheral base addresses */ - #define EIM_BASE_ADDRS { EIM0_BASE } - /** Array initializer of EIM peripheral base pointers */ - #define EIM_BASE_PTRS { EIM0 } -#endif - -/*! - * @} - */ /* end of group EIM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- ERM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ERM_Peripheral_Access_Layer ERM Peripheral Access Layer - * @{ - */ - -/** ERM - Register Layout Typedef */ -typedef struct { - __IO uint32_t CR0; /**< ERM Configuration Register 0, offset: 0x0 */ - __IO uint32_t CR1; /**< ERM Configuration Register 1, offset: 0x4 */ - uint8_t RESERVED_0[8]; - __IO uint32_t SR0; /**< ERM Status Register 0, offset: 0x10 */ - __IO uint32_t SR1; /**< ERM Status Register 1, offset: 0x14 */ - uint8_t RESERVED_1[232]; - __I uint32_t EAR0; /**< ERM Memory 0 Error Address Register, offset: 0x100 */ - __I uint32_t SYN0; /**< ERM Memory 0 Syndrome Register, offset: 0x104 */ - __IO uint32_t CORR_ERR_CNT0; /**< ERM Memory 0 Correctable Error Count Register, offset: 0x108 */ - uint8_t RESERVED_2[4]; - __I uint32_t EAR1; /**< ERM Memory 1 Error Address Register, offset: 0x110 */ - __I uint32_t SYN1; /**< ERM Memory 1 Syndrome Register, offset: 0x114 */ - __IO uint32_t CORR_ERR_CNT1; /**< ERM Memory 1 Correctable Error Count Register, offset: 0x118 */ - uint8_t RESERVED_3[4]; - __I uint32_t EAR2; /**< ERM Memory 2 Error Address Register, offset: 0x120 */ - __I uint32_t SYN2; /**< ERM Memory 2 Syndrome Register, offset: 0x124 */ - __IO uint32_t CORR_ERR_CNT2; /**< ERM Memory 2 Correctable Error Count Register, offset: 0x128 */ - uint8_t RESERVED_4[4]; - __I uint32_t EAR3; /**< ERM Memory 3 Error Address Register, offset: 0x130 */ - __I uint32_t SYN3; /**< ERM Memory 3 Syndrome Register, offset: 0x134 */ - __IO uint32_t CORR_ERR_CNT3; /**< ERM Memory 3 Correctable Error Count Register, offset: 0x138 */ - uint8_t RESERVED_5[4]; - __I uint32_t EAR4; /**< ERM Memory 4 Error Address Register, offset: 0x140 */ - __I uint32_t SYN4; /**< ERM Memory 4 Syndrome Register, offset: 0x144 */ - __IO uint32_t CORR_ERR_CNT4; /**< ERM Memory 4 Correctable Error Count Register, offset: 0x148 */ - uint8_t RESERVED_6[12]; - __IO uint32_t CORR_ERR_CNT5; /**< ERM Memory 5 Correctable Error Count Register, offset: 0x158 */ - uint8_t RESERVED_7[12]; - __IO uint32_t CORR_ERR_CNT6; /**< ERM Memory 6 Correctable Error Count Register, offset: 0x168 */ - uint8_t RESERVED_8[12]; - __IO uint32_t CORR_ERR_CNT7; /**< ERM Memory 7 Correctable Error Count Register, offset: 0x178 */ - uint8_t RESERVED_9[8]; - __I uint32_t SYN8; /**< ERM Memory 8 Syndrome Register, offset: 0x184 */ - __IO uint32_t CORR_ERR_CNT8; /**< ERM Memory 8 Correctable Error Count Register, offset: 0x188 */ - uint8_t RESERVED_10[12]; - __IO uint32_t CORR_ERR_CNT9; /**< ERM Memory 9 Correctable Error Count Register, offset: 0x198 */ -} ERM_Type; - -/* ---------------------------------------------------------------------------- - -- ERM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ERM_Register_Masks ERM Register Masks - * @{ - */ - -/*! @name CR0 - ERM Configuration Register 0 */ -/*! @{ */ - -#define ERM_CR0_ENCIE7_MASK (0x4U) -#define ERM_CR0_ENCIE7_SHIFT (2U) -/*! ENCIE7 - ENCIE7 - * 0b0..Interrupt notification of Memory 7 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 7 non-correctable error events is enabled. - */ -#define ERM_CR0_ENCIE7(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ENCIE7_SHIFT)) & ERM_CR0_ENCIE7_MASK) - -#define ERM_CR0_ESCIE7_MASK (0x8U) -#define ERM_CR0_ESCIE7_SHIFT (3U) -/*! ESCIE7 - ESCIE7 - * 0b0..Interrupt notification of Memory 7 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 7 single-bit correction events is enabled. - */ -#define ERM_CR0_ESCIE7(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ESCIE7_SHIFT)) & ERM_CR0_ESCIE7_MASK) - -#define ERM_CR0_ENCIE6_MASK (0x40U) -#define ERM_CR0_ENCIE6_SHIFT (6U) -/*! ENCIE6 - ENCIE6 - * 0b0..Interrupt notification of Memory 6 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 6 non-correctable error events is enabled. - */ -#define ERM_CR0_ENCIE6(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ENCIE6_SHIFT)) & ERM_CR0_ENCIE6_MASK) - -#define ERM_CR0_ESCIE6_MASK (0x80U) -#define ERM_CR0_ESCIE6_SHIFT (7U) -/*! ESCIE6 - ESCIE6 - * 0b0..Interrupt notification of Memory 6 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 6 single-bit correction events is enabled. - */ -#define ERM_CR0_ESCIE6(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ESCIE6_SHIFT)) & ERM_CR0_ESCIE6_MASK) - -#define ERM_CR0_ENCIE5_MASK (0x400U) -#define ERM_CR0_ENCIE5_SHIFT (10U) -/*! ENCIE5 - ENCIE5 - * 0b0..Interrupt notification of Memory 5 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 5 non-correctable error events is enabled. - */ -#define ERM_CR0_ENCIE5(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ENCIE5_SHIFT)) & ERM_CR0_ENCIE5_MASK) - -#define ERM_CR0_ESCIE5_MASK (0x800U) -#define ERM_CR0_ESCIE5_SHIFT (11U) -/*! ESCIE5 - ESCIE5 - * 0b0..Interrupt notification of Memory 5 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 5 single-bit correction events is enabled. - */ -#define ERM_CR0_ESCIE5(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ESCIE5_SHIFT)) & ERM_CR0_ESCIE5_MASK) - -#define ERM_CR0_ENCIE4_MASK (0x4000U) -#define ERM_CR0_ENCIE4_SHIFT (14U) -/*! ENCIE4 - ENCIE4 - * 0b0..Interrupt notification of Memory 4 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 4 non-correctable error events is enabled. - */ -#define ERM_CR0_ENCIE4(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ENCIE4_SHIFT)) & ERM_CR0_ENCIE4_MASK) - -#define ERM_CR0_ESCIE4_MASK (0x8000U) -#define ERM_CR0_ESCIE4_SHIFT (15U) -/*! ESCIE4 - ESCIE4 - * 0b0..Interrupt notification of Memory 4 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 4 single-bit correction events is enabled. - */ -#define ERM_CR0_ESCIE4(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ESCIE4_SHIFT)) & ERM_CR0_ESCIE4_MASK) - -#define ERM_CR0_ENCIE3_MASK (0x40000U) -#define ERM_CR0_ENCIE3_SHIFT (18U) -/*! ENCIE3 - ENCIE3 - * 0b0..Interrupt notification of Memory 3 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 3 non-correctable error events is enabled. - */ -#define ERM_CR0_ENCIE3(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ENCIE3_SHIFT)) & ERM_CR0_ENCIE3_MASK) - -#define ERM_CR0_ESCIE3_MASK (0x80000U) -#define ERM_CR0_ESCIE3_SHIFT (19U) -/*! ESCIE3 - ESCIE3 - * 0b0..Interrupt notification of Memory 3 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 3 single-bit correction events is enabled. - */ -#define ERM_CR0_ESCIE3(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ESCIE3_SHIFT)) & ERM_CR0_ESCIE3_MASK) - -#define ERM_CR0_ENCIE2_MASK (0x400000U) -#define ERM_CR0_ENCIE2_SHIFT (22U) -/*! ENCIE2 - ENCIE2 - * 0b0..Interrupt notification of Memory 2 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 2 non-correctable error events is enabled. - */ -#define ERM_CR0_ENCIE2(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ENCIE2_SHIFT)) & ERM_CR0_ENCIE2_MASK) - -#define ERM_CR0_ESCIE2_MASK (0x800000U) -#define ERM_CR0_ESCIE2_SHIFT (23U) -/*! ESCIE2 - ESCIE2 - * 0b0..Interrupt notification of Memory 2 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 2 single-bit correction events is enabled. - */ -#define ERM_CR0_ESCIE2(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ESCIE2_SHIFT)) & ERM_CR0_ESCIE2_MASK) - -#define ERM_CR0_ENCIE1_MASK (0x4000000U) -#define ERM_CR0_ENCIE1_SHIFT (26U) -/*! ENCIE1 - ENCIE1 - * 0b0..Interrupt notification of Memory 1 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 1 non-correctable error events is enabled. - */ -#define ERM_CR0_ENCIE1(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ENCIE1_SHIFT)) & ERM_CR0_ENCIE1_MASK) - -#define ERM_CR0_ESCIE1_MASK (0x8000000U) -#define ERM_CR0_ESCIE1_SHIFT (27U) -/*! ESCIE1 - ESCIE1 - * 0b0..Interrupt notification of Memory 1 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 1 single-bit correction events is enabled. - */ -#define ERM_CR0_ESCIE1(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ESCIE1_SHIFT)) & ERM_CR0_ESCIE1_MASK) - -#define ERM_CR0_ENCIE0_MASK (0x40000000U) -#define ERM_CR0_ENCIE0_SHIFT (30U) -/*! ENCIE0 - ENCIE0 - * 0b0..Interrupt notification of Memory 0 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 0 non-correctable error events is enabled. - */ -#define ERM_CR0_ENCIE0(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ENCIE0_SHIFT)) & ERM_CR0_ENCIE0_MASK) - -#define ERM_CR0_ESCIE0_MASK (0x80000000U) -#define ERM_CR0_ESCIE0_SHIFT (31U) -/*! ESCIE0 - ESCIE0 - * 0b0..Interrupt notification of Memory 0 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 0 single-bit correction events is enabled. - */ -#define ERM_CR0_ESCIE0(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ESCIE0_SHIFT)) & ERM_CR0_ESCIE0_MASK) -/*! @} */ - -/*! @name CR1 - ERM Configuration Register 1 */ -/*! @{ */ - -#define ERM_CR1_ENCIE9_MASK (0x4000000U) -#define ERM_CR1_ENCIE9_SHIFT (26U) -/*! ENCIE9 - ENCIE9 - * 0b0..Interrupt notification of Memory 9 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 9 non-correctable error events is enabled. - */ -#define ERM_CR1_ENCIE9(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR1_ENCIE9_SHIFT)) & ERM_CR1_ENCIE9_MASK) - -#define ERM_CR1_ESCIE9_MASK (0x8000000U) -#define ERM_CR1_ESCIE9_SHIFT (27U) -/*! ESCIE9 - ESCIE9 - * 0b0..Interrupt notification of Memory 9 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 9 single-bit correction events is enabled. - */ -#define ERM_CR1_ESCIE9(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR1_ESCIE9_SHIFT)) & ERM_CR1_ESCIE9_MASK) - -#define ERM_CR1_ENCIE8_MASK (0x40000000U) -#define ERM_CR1_ENCIE8_SHIFT (30U) -/*! ENCIE8 - ENCIE8 - * 0b0..Interrupt notification of Memory 8 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 8 non-correctable error events is enabled. - */ -#define ERM_CR1_ENCIE8(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR1_ENCIE8_SHIFT)) & ERM_CR1_ENCIE8_MASK) - -#define ERM_CR1_ESCIE8_MASK (0x80000000U) -#define ERM_CR1_ESCIE8_SHIFT (31U) -/*! ESCIE8 - ESCIE8 - * 0b0..Interrupt notification of Memory 8 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 8 single-bit correction events is enabled. - */ -#define ERM_CR1_ESCIE8(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR1_ESCIE8_SHIFT)) & ERM_CR1_ESCIE8_MASK) -/*! @} */ - -/*! @name SR0 - ERM Status Register 0 */ -/*! @{ */ - -#define ERM_SR0_NCE7_MASK (0x4U) -#define ERM_SR0_NCE7_SHIFT (2U) -/*! NCE7 - NCE7 - * 0b0..No non-correctable error event on Memory 7 detected. - * 0b1..Non-correctable error event on Memory 7 detected. - */ -#define ERM_SR0_NCE7(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_NCE7_SHIFT)) & ERM_SR0_NCE7_MASK) - -#define ERM_SR0_SBC7_MASK (0x8U) -#define ERM_SR0_SBC7_SHIFT (3U) -/*! SBC7 - SBC7 - * 0b0..No single-bit correction event on Memory 7 detected. - * 0b1..Single-bit correction event on Memory 7 detected. - */ -#define ERM_SR0_SBC7(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_SBC7_SHIFT)) & ERM_SR0_SBC7_MASK) - -#define ERM_SR0_NCE6_MASK (0x40U) -#define ERM_SR0_NCE6_SHIFT (6U) -/*! NCE6 - NCE6 - * 0b0..No non-correctable error event on Memory 6 detected. - * 0b1..Non-correctable error event on Memory 6 detected. - */ -#define ERM_SR0_NCE6(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_NCE6_SHIFT)) & ERM_SR0_NCE6_MASK) - -#define ERM_SR0_SBC6_MASK (0x80U) -#define ERM_SR0_SBC6_SHIFT (7U) -/*! SBC6 - SBC6 - * 0b0..No single-bit correction event on Memory 6 detected. - * 0b1..Single-bit correction event on Memory 6 detected. - */ -#define ERM_SR0_SBC6(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_SBC6_SHIFT)) & ERM_SR0_SBC6_MASK) - -#define ERM_SR0_NCE5_MASK (0x400U) -#define ERM_SR0_NCE5_SHIFT (10U) -/*! NCE5 - NCE5 - * 0b0..No non-correctable error event on Memory 5 detected. - * 0b1..Non-correctable error event on Memory 5 detected. - */ -#define ERM_SR0_NCE5(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_NCE5_SHIFT)) & ERM_SR0_NCE5_MASK) - -#define ERM_SR0_SBC5_MASK (0x800U) -#define ERM_SR0_SBC5_SHIFT (11U) -/*! SBC5 - SBC5 - * 0b0..No single-bit correction event on Memory 5 detected. - * 0b1..Single-bit correction event on Memory 5 detected. - */ -#define ERM_SR0_SBC5(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_SBC5_SHIFT)) & ERM_SR0_SBC5_MASK) - -#define ERM_SR0_NCE4_MASK (0x4000U) -#define ERM_SR0_NCE4_SHIFT (14U) -/*! NCE4 - NCE4 - * 0b0..No non-correctable error event on Memory 4 detected. - * 0b1..Non-correctable error event on Memory 4 detected. - */ -#define ERM_SR0_NCE4(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_NCE4_SHIFT)) & ERM_SR0_NCE4_MASK) - -#define ERM_SR0_SBC4_MASK (0x8000U) -#define ERM_SR0_SBC4_SHIFT (15U) -/*! SBC4 - SBC4 - * 0b0..No single-bit correction event on Memory 4 detected. - * 0b1..Single-bit correction event on Memory 4 detected. - */ -#define ERM_SR0_SBC4(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_SBC4_SHIFT)) & ERM_SR0_SBC4_MASK) - -#define ERM_SR0_NCE3_MASK (0x40000U) -#define ERM_SR0_NCE3_SHIFT (18U) -/*! NCE3 - NCE3 - * 0b0..No non-correctable error event on Memory 3 detected. - * 0b1..Non-correctable error event on Memory 3 detected. - */ -#define ERM_SR0_NCE3(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_NCE3_SHIFT)) & ERM_SR0_NCE3_MASK) - -#define ERM_SR0_SBC3_MASK (0x80000U) -#define ERM_SR0_SBC3_SHIFT (19U) -/*! SBC3 - SBC3 - * 0b0..No single-bit correction event on Memory 3 detected. - * 0b1..Single-bit correction event on Memory 3 detected. - */ -#define ERM_SR0_SBC3(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_SBC3_SHIFT)) & ERM_SR0_SBC3_MASK) - -#define ERM_SR0_NCE2_MASK (0x400000U) -#define ERM_SR0_NCE2_SHIFT (22U) -/*! NCE2 - NCE2 - * 0b0..No non-correctable error event on Memory 2 detected. - * 0b1..Non-correctable error event on Memory 2 detected. - */ -#define ERM_SR0_NCE2(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_NCE2_SHIFT)) & ERM_SR0_NCE2_MASK) - -#define ERM_SR0_SBC2_MASK (0x800000U) -#define ERM_SR0_SBC2_SHIFT (23U) -/*! SBC2 - SBC2 - * 0b0..No single-bit correction event on Memory 2 detected. - * 0b1..Single-bit correction event on Memory 2 detected. - */ -#define ERM_SR0_SBC2(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_SBC2_SHIFT)) & ERM_SR0_SBC2_MASK) - -#define ERM_SR0_NCE1_MASK (0x4000000U) -#define ERM_SR0_NCE1_SHIFT (26U) -/*! NCE1 - NCE1 - * 0b0..No non-correctable error event on Memory 1 detected. - * 0b1..Non-correctable error event on Memory 1 detected. - */ -#define ERM_SR0_NCE1(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_NCE1_SHIFT)) & ERM_SR0_NCE1_MASK) - -#define ERM_SR0_SBC1_MASK (0x8000000U) -#define ERM_SR0_SBC1_SHIFT (27U) -/*! SBC1 - SBC1 - * 0b0..No single-bit correction event on Memory 1 detected. - * 0b1..Single-bit correction event on Memory 1 detected. - */ -#define ERM_SR0_SBC1(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_SBC1_SHIFT)) & ERM_SR0_SBC1_MASK) - -#define ERM_SR0_NCE0_MASK (0x40000000U) -#define ERM_SR0_NCE0_SHIFT (30U) -/*! NCE0 - NCE0 - * 0b0..No non-correctable error event on Memory 0 detected. - * 0b1..Non-correctable error event on Memory 0 detected. - */ -#define ERM_SR0_NCE0(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_NCE0_SHIFT)) & ERM_SR0_NCE0_MASK) - -#define ERM_SR0_SBC0_MASK (0x80000000U) -#define ERM_SR0_SBC0_SHIFT (31U) -/*! SBC0 - SBC0 - * 0b0..No single-bit correction event on Memory 0 detected. - * 0b1..Single-bit correction event on Memory 0 detected. - */ -#define ERM_SR0_SBC0(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_SBC0_SHIFT)) & ERM_SR0_SBC0_MASK) -/*! @} */ - -/*! @name SR1 - ERM Status Register 1 */ -/*! @{ */ - -#define ERM_SR1_NCE9_MASK (0x4000000U) -#define ERM_SR1_NCE9_SHIFT (26U) -/*! NCE9 - NCE9 - * 0b0..No non-correctable error event on Memory 9 detected. - * 0b1..Non-correctable error event on Memory 9 detected. - */ -#define ERM_SR1_NCE9(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR1_NCE9_SHIFT)) & ERM_SR1_NCE9_MASK) - -#define ERM_SR1_SBC9_MASK (0x8000000U) -#define ERM_SR1_SBC9_SHIFT (27U) -/*! SBC9 - SBC9 - * 0b0..No single-bit correction event on Memory 9 detected. - * 0b1..Single-bit correction event on Memory 9 detected. - */ -#define ERM_SR1_SBC9(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR1_SBC9_SHIFT)) & ERM_SR1_SBC9_MASK) - -#define ERM_SR1_NCE8_MASK (0x40000000U) -#define ERM_SR1_NCE8_SHIFT (30U) -/*! NCE8 - NCE8 - * 0b0..No non-correctable error event on Memory 8 detected. - * 0b1..Non-correctable error event on Memory 8 detected. - */ -#define ERM_SR1_NCE8(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR1_NCE8_SHIFT)) & ERM_SR1_NCE8_MASK) - -#define ERM_SR1_SBC8_MASK (0x80000000U) -#define ERM_SR1_SBC8_SHIFT (31U) -/*! SBC8 - SBC8 - * 0b0..No single-bit correction event on Memory 8 detected. - * 0b1..Single-bit correction event on Memory 8 detected. - */ -#define ERM_SR1_SBC8(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR1_SBC8_SHIFT)) & ERM_SR1_SBC8_MASK) -/*! @} */ - -/*! @name EAR0 - ERM Memory 0 Error Address Register */ -/*! @{ */ - -#define ERM_EAR0_EAR_MASK (0xFFFFFFFFU) -#define ERM_EAR0_EAR_SHIFT (0U) -/*! EAR - EAR */ -#define ERM_EAR0_EAR(x) (((uint32_t)(((uint32_t)(x)) << ERM_EAR0_EAR_SHIFT)) & ERM_EAR0_EAR_MASK) -/*! @} */ - -/*! @name SYN0 - ERM Memory 0 Syndrome Register */ -/*! @{ */ - -#define ERM_SYN0_SYNDROME_MASK (0xFF000000U) -#define ERM_SYN0_SYNDROME_SHIFT (24U) -/*! SYNDROME - SYNDROME */ -#define ERM_SYN0_SYNDROME(x) (((uint32_t)(((uint32_t)(x)) << ERM_SYN0_SYNDROME_SHIFT)) & ERM_SYN0_SYNDROME_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT0 - ERM Memory 0 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT0_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT0_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT0_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT0_COUNT_SHIFT)) & ERM_CORR_ERR_CNT0_COUNT_MASK) -/*! @} */ - -/*! @name EAR1 - ERM Memory 1 Error Address Register */ -/*! @{ */ - -#define ERM_EAR1_EAR_MASK (0xFFFFFFFFU) -#define ERM_EAR1_EAR_SHIFT (0U) -/*! EAR - EAR */ -#define ERM_EAR1_EAR(x) (((uint32_t)(((uint32_t)(x)) << ERM_EAR1_EAR_SHIFT)) & ERM_EAR1_EAR_MASK) -/*! @} */ - -/*! @name SYN1 - ERM Memory 1 Syndrome Register */ -/*! @{ */ - -#define ERM_SYN1_SYNDROME_MASK (0xFF000000U) -#define ERM_SYN1_SYNDROME_SHIFT (24U) -/*! SYNDROME - SYNDROME */ -#define ERM_SYN1_SYNDROME(x) (((uint32_t)(((uint32_t)(x)) << ERM_SYN1_SYNDROME_SHIFT)) & ERM_SYN1_SYNDROME_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT1 - ERM Memory 1 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT1_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT1_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT1_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT1_COUNT_SHIFT)) & ERM_CORR_ERR_CNT1_COUNT_MASK) -/*! @} */ - -/*! @name EAR2 - ERM Memory 2 Error Address Register */ -/*! @{ */ - -#define ERM_EAR2_EAR_MASK (0xFFFFFFFFU) -#define ERM_EAR2_EAR_SHIFT (0U) -/*! EAR - EAR */ -#define ERM_EAR2_EAR(x) (((uint32_t)(((uint32_t)(x)) << ERM_EAR2_EAR_SHIFT)) & ERM_EAR2_EAR_MASK) -/*! @} */ - -/*! @name SYN2 - ERM Memory 2 Syndrome Register */ -/*! @{ */ - -#define ERM_SYN2_SYNDROME_MASK (0xFF000000U) -#define ERM_SYN2_SYNDROME_SHIFT (24U) -/*! SYNDROME - SYNDROME */ -#define ERM_SYN2_SYNDROME(x) (((uint32_t)(((uint32_t)(x)) << ERM_SYN2_SYNDROME_SHIFT)) & ERM_SYN2_SYNDROME_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT2 - ERM Memory 2 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT2_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT2_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT2_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT2_COUNT_SHIFT)) & ERM_CORR_ERR_CNT2_COUNT_MASK) -/*! @} */ - -/*! @name EAR3 - ERM Memory 3 Error Address Register */ -/*! @{ */ - -#define ERM_EAR3_EAR_MASK (0xFFFFFFFFU) -#define ERM_EAR3_EAR_SHIFT (0U) -/*! EAR - EAR */ -#define ERM_EAR3_EAR(x) (((uint32_t)(((uint32_t)(x)) << ERM_EAR3_EAR_SHIFT)) & ERM_EAR3_EAR_MASK) -/*! @} */ - -/*! @name SYN3 - ERM Memory 3 Syndrome Register */ -/*! @{ */ - -#define ERM_SYN3_SYNDROME_MASK (0xFF000000U) -#define ERM_SYN3_SYNDROME_SHIFT (24U) -/*! SYNDROME - SYNDROME */ -#define ERM_SYN3_SYNDROME(x) (((uint32_t)(((uint32_t)(x)) << ERM_SYN3_SYNDROME_SHIFT)) & ERM_SYN3_SYNDROME_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT3 - ERM Memory 3 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT3_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT3_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT3_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT3_COUNT_SHIFT)) & ERM_CORR_ERR_CNT3_COUNT_MASK) -/*! @} */ - -/*! @name EAR4 - ERM Memory 4 Error Address Register */ -/*! @{ */ - -#define ERM_EAR4_EAR_MASK (0xFFFFFFFFU) -#define ERM_EAR4_EAR_SHIFT (0U) -/*! EAR - EAR */ -#define ERM_EAR4_EAR(x) (((uint32_t)(((uint32_t)(x)) << ERM_EAR4_EAR_SHIFT)) & ERM_EAR4_EAR_MASK) -/*! @} */ - -/*! @name SYN4 - ERM Memory 4 Syndrome Register */ -/*! @{ */ - -#define ERM_SYN4_SYNDROME_MASK (0xFF000000U) -#define ERM_SYN4_SYNDROME_SHIFT (24U) -/*! SYNDROME - SYNDROME */ -#define ERM_SYN4_SYNDROME(x) (((uint32_t)(((uint32_t)(x)) << ERM_SYN4_SYNDROME_SHIFT)) & ERM_SYN4_SYNDROME_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT4 - ERM Memory 4 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT4_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT4_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT4_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT4_COUNT_SHIFT)) & ERM_CORR_ERR_CNT4_COUNT_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT5 - ERM Memory 5 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT5_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT5_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT5_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT5_COUNT_SHIFT)) & ERM_CORR_ERR_CNT5_COUNT_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT6 - ERM Memory 6 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT6_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT6_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT6_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT6_COUNT_SHIFT)) & ERM_CORR_ERR_CNT6_COUNT_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT7 - ERM Memory 7 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT7_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT7_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT7_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT7_COUNT_SHIFT)) & ERM_CORR_ERR_CNT7_COUNT_MASK) -/*! @} */ - -/*! @name SYN8 - ERM Memory 8 Syndrome Register */ -/*! @{ */ - -#define ERM_SYN8_SYNDROME_MASK (0xFF000000U) -#define ERM_SYN8_SYNDROME_SHIFT (24U) -/*! SYNDROME - SYNDROME */ -#define ERM_SYN8_SYNDROME(x) (((uint32_t)(((uint32_t)(x)) << ERM_SYN8_SYNDROME_SHIFT)) & ERM_SYN8_SYNDROME_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT8 - ERM Memory 8 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT8_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT8_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT8_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT8_COUNT_SHIFT)) & ERM_CORR_ERR_CNT8_COUNT_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT9 - ERM Memory 9 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT9_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT9_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT9_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT9_COUNT_SHIFT)) & ERM_CORR_ERR_CNT9_COUNT_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group ERM_Register_Masks */ - - -/* ERM - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral ERM0 base address */ - #define ERM0_BASE (0x5005C000u) - /** Peripheral ERM0 base address */ - #define ERM0_BASE_NS (0x4005C000u) - /** Peripheral ERM0 base pointer */ - #define ERM0 ((ERM_Type *)ERM0_BASE) - /** Peripheral ERM0 base pointer */ - #define ERM0_NS ((ERM_Type *)ERM0_BASE_NS) - /** Array initializer of ERM peripheral base addresses */ - #define ERM_BASE_ADDRS { ERM0_BASE } - /** Array initializer of ERM peripheral base pointers */ - #define ERM_BASE_PTRS { ERM0 } - /** Array initializer of ERM peripheral base addresses */ - #define ERM_BASE_ADDRS_NS { ERM0_BASE_NS } - /** Array initializer of ERM peripheral base pointers */ - #define ERM_BASE_PTRS_NS { ERM0_NS } -#else - /** Peripheral ERM0 base address */ - #define ERM0_BASE (0x4005C000u) - /** Peripheral ERM0 base pointer */ - #define ERM0 ((ERM_Type *)ERM0_BASE) - /** Array initializer of ERM peripheral base addresses */ - #define ERM_BASE_ADDRS { ERM0_BASE } - /** Array initializer of ERM peripheral base pointers */ - #define ERM_BASE_PTRS { ERM0 } -#endif - -/*! - * @} - */ /* end of group ERM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- EVTG Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup EVTG_Peripheral_Access_Layer EVTG Peripheral Access Layer - * @{ - */ - -/** EVTG - Register Layout Typedef */ -typedef struct { - struct { /* offset: 0x0, array step: 0x10 */ - __IO uint16_t EVTG_AOI0_BFT01; /**< AOI0 Boolean Function Term 0 and 1 Configuration, array offset: 0x0, array step: 0x10 */ - __IO uint16_t EVTG_AOI0_BFT23; /**< AOI0 Boolean Function Term 2 and 3 Configuration, array offset: 0x2, array step: 0x10 */ - __IO uint16_t EVTG_AOI1_BFT01; /**< AOI1 Boolean Function Term 0 and 1 Configuration, array offset: 0x4, array step: 0x10 */ - __IO uint16_t EVTG_AOI1_BFT23; /**< AOI1 Boolean Function Term 2 and 3 Configuration, array offset: 0x6, array step: 0x10 */ - uint8_t RESERVED_0[2]; - __IO uint16_t EVTG_CTRL; /**< Control and Status, array offset: 0xA, array step: 0x10 */ - __IO uint16_t EVTG_AOI0_FILT; /**< AOI0 Output Filter, array offset: 0xC, array step: 0x10 */ - __IO uint16_t EVTG_AOI1_FILT; /**< AOI1 Output Filter, array offset: 0xE, array step: 0x10 */ - } EVTG_INST[4]; -} EVTG_Type; - -/* ---------------------------------------------------------------------------- - -- EVTG Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup EVTG_Register_Masks EVTG Register Masks - * @{ - */ - -/*! @name EVTG_INST_EVTG_AOI0_BFT01 - AOI0 Boolean Function Term 0 and 1 Configuration */ -/*! @{ */ - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_DC_MASK (0x3U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_DC_SHIFT (0U) -/*! PT1_DC - Product Term 1, D Input Configuration - * 0b00..Force the D input in this product term to a logical zero - * 0b01..Pass the D input in this product term - * 0b10..Complement the D input in this product term - * 0b11..Force the D input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_DC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_DC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_DC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_CC_MASK (0xCU) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_CC_SHIFT (2U) -/*! PT1_CC - Product Term 1, C Input Configuration - * 0b00..Force the C input in this product term to a logical zero - * 0b01..Pass the C input in this product term - * 0b10..Complement the C input in this product term - * 0b11..Force the C input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_CC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_CC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_CC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_BC_MASK (0x30U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_BC_SHIFT (4U) -/*! PT1_BC - Product Term 1, B Input Configuration - * 0b00..Force the B input in this product term to a logical zero - * 0b01..Pass the B input in this product term - * 0b10..Complement the B input in this product term - * 0b11..Force the B input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_BC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_BC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_BC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_AC_MASK (0xC0U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_AC_SHIFT (6U) -/*! PT1_AC - Product Term 1, A Input Configuration - * 0b00..Force the A input in this product term to a logical zero - * 0b01..Pass the A input in this product term - * 0b10..Complement the A input in this product term - * 0b11..Force the A input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_AC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_AC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_AC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_DC_MASK (0x300U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_DC_SHIFT (8U) -/*! PT0_DC - Product Term 0, D Input Configuration - * 0b00..Force the D input in this product term to a logical zero - * 0b01..Pass the D input in this product term - * 0b10..Complement the D input in this product term - * 0b11..Force the D input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_DC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_DC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_DC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_CC_MASK (0xC00U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_CC_SHIFT (10U) -/*! PT0_CC - Product Term 0, C Input Configuration - * 0b00..Force the C input in this product term to a logical zero - * 0b01..Pass the C input in this product term - * 0b10..Complement the C input in this product term - * 0b11..Force the C input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_CC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_CC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_CC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_BC_MASK (0x3000U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_BC_SHIFT (12U) -/*! PT0_BC - Product Term 0, B Input Configuration - * 0b00..Force the B input in this product term to a logical zero - * 0b01..Pass the B input in this product term - * 0b10..Complement the B input in this product term - * 0b11..Force the B input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_BC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_BC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_BC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_AC_MASK (0xC000U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_AC_SHIFT (14U) -/*! PT0_AC - Product Term 0, A Input Configuration - * 0b00..Force the A input in this product term to a logical zero - * 0b01..Pass the A input in this product term - * 0b10..Complement the A input in this product term - * 0b11..Force the A input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_AC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_AC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_AC_MASK) -/*! @} */ - -/* The count of EVTG_EVTG_INST_EVTG_AOI0_BFT01 */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_COUNT (4U) - -/*! @name EVTG_INST_EVTG_AOI0_BFT23 - AOI0 Boolean Function Term 2 and 3 Configuration */ -/*! @{ */ - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_DC_MASK (0x3U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_DC_SHIFT (0U) -/*! PT3_DC - Product Term 3, D Input Configuration - * 0b00..Force the D input in this product term to a logical zero - * 0b01..Pass the D input in this product term - * 0b10..Complement the D input in this product term - * 0b11..Force the D input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_DC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_DC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_DC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_CC_MASK (0xCU) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_CC_SHIFT (2U) -/*! PT3_CC - Product Term 3, C Input Configuration - * 0b00..Force the C input in this product term to a logical zero - * 0b01..Pass the C input in this product term - * 0b10..Complement the C input in this product term - * 0b11..Force the C input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_CC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_CC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_CC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_BC_MASK (0x30U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_BC_SHIFT (4U) -/*! PT3_BC - Product Term 3, B Input Configuration - * 0b00..Force the B input in this product term to a logical zero - * 0b01..Pass the B input in this product term - * 0b10..Complement the B input in this product term - * 0b11..Force the B input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_BC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_BC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_BC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_AC_MASK (0xC0U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_AC_SHIFT (6U) -/*! PT3_AC - Product Term 3, A Input Configuration - * 0b00..Force the A input in this product term to a logical zero - * 0b01..Pass the A input in this product term - * 0b10..Complement the A input in this product term - * 0b11..Force the A input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_AC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_AC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_AC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_DC_MASK (0x300U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_DC_SHIFT (8U) -/*! PT2_DC - Product Term 2, D Input Configuration - * 0b00..Force the D input in this product term to a logical zero - * 0b01..Pass the D input in this product term - * 0b10..Complement the D input in this product term - * 0b11..Force the D input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_DC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_DC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_DC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_CC_MASK (0xC00U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_CC_SHIFT (10U) -/*! PT2_CC - Product Term 2, C Input Configuration - * 0b00..Force the C input in this product term to a logical zero - * 0b01..Pass the C input in this product term - * 0b10..Complement the C input in this product term - * 0b11..Force the C input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_CC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_CC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_CC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_BC_MASK (0x3000U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_BC_SHIFT (12U) -/*! PT2_BC - Product Term 2, B Input Configuration - * 0b00..Force the B input in this product term to a logical zero - * 0b01..Pass the B input in this product term - * 0b10..Complement the B input in this product term - * 0b11..Force the B input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_BC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_BC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_BC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_AC_MASK (0xC000U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_AC_SHIFT (14U) -/*! PT2_AC - Product Term 2, A Input Configuration - * 0b00..Force the A input in this product term to a logical zero - * 0b01..Pass the A input in this product term - * 0b10..Complement the A input in this product term - * 0b11..Force the A input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_AC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_AC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_AC_MASK) -/*! @} */ - -/* The count of EVTG_EVTG_INST_EVTG_AOI0_BFT23 */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_COUNT (4U) - -/*! @name EVTG_INST_EVTG_AOI1_BFT01 - AOI1 Boolean Function Term 0 and 1 Configuration */ -/*! @{ */ - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_DC_MASK (0x3U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_DC_SHIFT (0U) -/*! PT1_DC - Product Term 1, D Input Configuration - * 0b00..Force the D input in this product term to a logical zero - * 0b01..Pass the D input in this product term - * 0b10..Complement the D input in this product term - * 0b11..Force the D input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_DC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_DC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_DC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_CC_MASK (0xCU) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_CC_SHIFT (2U) -/*! PT1_CC - Product Term 1, C Input Configuration - * 0b00..Force the C input in this product term to a logical zero - * 0b01..Pass the C input in this product term - * 0b10..Complement the C input in this product term - * 0b11..Force the C input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_CC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_CC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_CC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_BC_MASK (0x30U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_BC_SHIFT (4U) -/*! PT1_BC - Product Term 1, B Input Configuration - * 0b00..Force the B input in this product term to a logical zero - * 0b01..Pass the B input in this product term - * 0b10..Complement the B input in this product term - * 0b11..Force the B input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_BC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_BC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_BC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_AC_MASK (0xC0U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_AC_SHIFT (6U) -/*! PT1_AC - Product Term 1, A Input Configuration - * 0b00..Force the A input in this product term to a logical zero - * 0b01..Pass the A input in this product term - * 0b10..Complement the A input in this product term - * 0b11..Force the A input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_AC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_AC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_AC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_DC_MASK (0x300U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_DC_SHIFT (8U) -/*! PT0_DC - Product Term 0, D Input Configuration - * 0b00..Force the D input in this product term to a logical zero - * 0b01..Pass the D input in this product term - * 0b10..Complement the D input in this product term - * 0b11..Force the D input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_DC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_DC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_DC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_CC_MASK (0xC00U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_CC_SHIFT (10U) -/*! PT0_CC - Product Term 0, C Input Configuration - * 0b00..Force the C input in this product term to a logical zero - * 0b01..Pass the C input in this product term - * 0b10..Complement the C input in this product term - * 0b11..Force the C input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_CC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_CC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_CC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_BC_MASK (0x3000U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_BC_SHIFT (12U) -/*! PT0_BC - Product Term 0, B Input Configuration - * 0b00..Force the B input in this product term to a logical zero - * 0b01..Pass the B input in this product term - * 0b10..Complement the B input in this product term - * 0b11..Force the B input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_BC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_BC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_BC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_AC_MASK (0xC000U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_AC_SHIFT (14U) -/*! PT0_AC - Product Term 0, A Input Configuration - * 0b00..Force the A input in this product term to a logical zero - * 0b01..Pass the A input in this product term - * 0b10..Complement the A input in this product term - * 0b11..Force the A input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_AC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_AC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_AC_MASK) -/*! @} */ - -/* The count of EVTG_EVTG_INST_EVTG_AOI1_BFT01 */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_COUNT (4U) - -/*! @name EVTG_INST_EVTG_AOI1_BFT23 - AOI1 Boolean Function Term 2 and 3 Configuration */ -/*! @{ */ - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_DC_MASK (0x3U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_DC_SHIFT (0U) -/*! PT3_DC - Product Term 3, D Input Configuration - * 0b00..Force the D input in this product term to a logical zero - * 0b01..Pass the D input in this product term - * 0b10..Complement the D input in this product term - * 0b11..Force the D input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_DC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_DC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_DC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_CC_MASK (0xCU) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_CC_SHIFT (2U) -/*! PT3_CC - Product Term 3, C Input Configuration - * 0b00..Force the C input in this product term to a logical zero - * 0b01..Pass the C input in this product term - * 0b10..Complement the C input in this product term - * 0b11..Force the C input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_CC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_CC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_CC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_BC_MASK (0x30U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_BC_SHIFT (4U) -/*! PT3_BC - Product Term 3, B Input Configuration - * 0b00..Force the B input in this product term to a logical zero - * 0b01..Pass the B input in this product term - * 0b10..Complement the B input in this product term - * 0b11..Force the B input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_BC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_BC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_BC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_AC_MASK (0xC0U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_AC_SHIFT (6U) -/*! PT3_AC - Product Term 3, A Input Configuration - * 0b00..Force the A input in this product term to a logical zero - * 0b01..Pass the A input in this product term - * 0b10..Complement the A input in this product term - * 0b11..Force the A input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_AC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_AC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_AC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_DC_MASK (0x300U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_DC_SHIFT (8U) -/*! PT2_DC - Product Term 2, D Input Configuration - * 0b00..Force the D input in this product term to a logical zero - * 0b01..Pass the D input in this product term - * 0b10..Complement the D input in this product term - * 0b11..Force the D input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_DC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_DC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_DC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_CC_MASK (0xC00U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_CC_SHIFT (10U) -/*! PT2_CC - Product Term 2, C Input Configuration - * 0b00..Force the C input in this product term to a logical zero - * 0b01..Pass the C input in this product term - * 0b10..Complement the C input in this product term - * 0b11..Force the C input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_CC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_CC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_CC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_BC_MASK (0x3000U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_BC_SHIFT (12U) -/*! PT2_BC - Product Term 2, B Input Configuration - * 0b00..Force the B input in this product term to a logical zero - * 0b01..Pass the B input in this product term - * 0b10..Complement the B input in this product term - * 0b11..Force the B input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_BC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_BC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_BC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_AC_MASK (0xC000U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_AC_SHIFT (14U) -/*! PT2_AC - Product Term 2, A Input Configuration - * 0b00..Force the A input in this product term to a logical zero - * 0b01..Pass the A input in this product term - * 0b10..Complement the A input in this product term - * 0b11..Force the A input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_AC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_AC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_AC_MASK) -/*! @} */ - -/* The count of EVTG_EVTG_INST_EVTG_AOI1_BFT23 */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_COUNT (4U) - -/*! @name EVTG_INST_EVTG_CTRL - Control and Status */ -/*! @{ */ - -#define EVTG_EVTG_INST_EVTG_CTRL_FF_INIT_MASK (0x1U) -#define EVTG_EVTG_INST_EVTG_CTRL_FF_INIT_SHIFT (0U) -/*! FF_INIT - Flip flop Initial Value Configuration - * 0b0..0 - * 0b1..1 - */ -#define EVTG_EVTG_INST_EVTG_CTRL_FF_INIT(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_CTRL_FF_INIT_SHIFT)) & EVTG_EVTG_INST_EVTG_CTRL_FF_INIT_MASK) - -#define EVTG_EVTG_INST_EVTG_CTRL_INIT_EN_MASK (0x2U) -#define EVTG_EVTG_INST_EVTG_CTRL_INIT_EN_SHIFT (1U) -/*! INIT_EN - Flip-Flop Initial Output Enable Control - * 0b0..Write 0 does not generate enable pulse - * 0b1..Write 1 generates enable pulse - */ -#define EVTG_EVTG_INST_EVTG_CTRL_INIT_EN(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_CTRL_INIT_EN_SHIFT)) & EVTG_EVTG_INST_EVTG_CTRL_INIT_EN_MASK) - -#define EVTG_EVTG_INST_EVTG_CTRL_MODE_SEL_MASK (0x1CU) -#define EVTG_EVTG_INST_EVTG_CTRL_MODE_SEL_SHIFT (2U) -/*! MODE_SEL - Flip-Flop Mode Selection - * 0b000..Bypass mode - * 0b001..RS Trigger mode - * 0b010..T-FF mode - * 0b011..D-FF mode - * 0b100..JK-FF mode - * 0b101..Latch mode - * 0b110..Reserved - * 0b111..Reserved - */ -#define EVTG_EVTG_INST_EVTG_CTRL_MODE_SEL(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_CTRL_MODE_SEL_SHIFT)) & EVTG_EVTG_INST_EVTG_CTRL_MODE_SEL_MASK) - -#define EVTG_EVTG_INST_EVTG_CTRL_FB_OVRD_MASK (0xC0U) -#define EVTG_EVTG_INST_EVTG_CTRL_FB_OVRD_SHIFT (6U) -/*! FB_OVRD - EVTG Output Feedback Override Control - * 0b00..Replace An - * 0b01..Replace Bn - * 0b10..Replace Cn - * 0b11..Replace Dn - */ -#define EVTG_EVTG_INST_EVTG_CTRL_FB_OVRD(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_CTRL_FB_OVRD_SHIFT)) & EVTG_EVTG_INST_EVTG_CTRL_FB_OVRD_MASK) - -#define EVTG_EVTG_INST_EVTG_CTRL_SYNC_CTRL_MASK (0xF00U) -#define EVTG_EVTG_INST_EVTG_CTRL_SYNC_CTRL_SHIFT (8U) -/*! SYNC_CTRL - Synchronize Control - * 0bxxx1..EVTG input "An" will be synced by two bus clk cycles - * 0bxxx0..EVTG input "An" will not be synced - * 0bxx1x..EVTG input "Bn" will be synced by two bus clk cycles - * 0bxx0x..EVTG input "Bn" will not be synced - * 0bx1xx..EVTG input "Cn" will be synced by two bus clk cycles - * 0bx0xx..EVTG input "Cn" will not be synced - * 0b1xxx..EVTG input "Dn" will be synced by two bus clk cycles - * 0b0xxx..EVTG input "Dn" will not be synced - */ -#define EVTG_EVTG_INST_EVTG_CTRL_SYNC_CTRL(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_CTRL_SYNC_CTRL_SHIFT)) & EVTG_EVTG_INST_EVTG_CTRL_SYNC_CTRL_MASK) - -#define EVTG_EVTG_INST_EVTG_CTRL_FORCE_BYPASS_MASK (0x3000U) -#define EVTG_EVTG_INST_EVTG_CTRL_FORCE_BYPASS_SHIFT (12U) -/*! FORCE_BYPASS - Force Bypass Control - * 0bx1..Whatever MODE_SEL is, will force bypass flip-flop and route the AOI_0(Filter_0) value directly to EVTG_OUTA - * 0bx0..Will not force the bypass - * 0b1x..Whatever MODE_SEL is, will force bypass flip-flop and route the AOI_1(Filter_1) value directly to EVTG_OUTB - * 0b0x..Will not force the bypass - */ -#define EVTG_EVTG_INST_EVTG_CTRL_FORCE_BYPASS(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_CTRL_FORCE_BYPASS_SHIFT)) & EVTG_EVTG_INST_EVTG_CTRL_FORCE_BYPASS_MASK) -/*! @} */ - -/* The count of EVTG_EVTG_INST_EVTG_CTRL */ -#define EVTG_EVTG_INST_EVTG_CTRL_COUNT (4U) - -/*! @name EVTG_INST_EVTG_AOI0_FILT - AOI0 Output Filter */ -/*! @{ */ - -#define EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_PER_MASK (0xFFU) -#define EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_PER_SHIFT (0U) -/*! FILT_PER - Output Filter Sample Period */ -#define EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_PER(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_PER_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_PER_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_CNT_MASK (0x700U) -#define EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_CNT_SHIFT (8U) -/*! FILT_CNT - Output Filter Sample Count */ -#define EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_CNT(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_CNT_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_CNT_MASK) -/*! @} */ - -/* The count of EVTG_EVTG_INST_EVTG_AOI0_FILT */ -#define EVTG_EVTG_INST_EVTG_AOI0_FILT_COUNT (4U) - -/*! @name EVTG_INST_EVTG_AOI1_FILT - AOI1 Output Filter */ -/*! @{ */ - -#define EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_PER_MASK (0xFFU) -#define EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_PER_SHIFT (0U) -/*! FILT_PER - Output Filter Sample Period */ -#define EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_PER(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_PER_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_PER_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_CNT_MASK (0x700U) -#define EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_CNT_SHIFT (8U) -/*! FILT_CNT - Output Filter Sample Count */ -#define EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_CNT(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_CNT_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_CNT_MASK) -/*! @} */ - -/* The count of EVTG_EVTG_INST_EVTG_AOI1_FILT */ -#define EVTG_EVTG_INST_EVTG_AOI1_FILT_COUNT (4U) - - -/*! - * @} - */ /* end of group EVTG_Register_Masks */ - - -/* EVTG - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral EVTG0 base address */ - #define EVTG0_BASE (0x500D2000u) - /** Peripheral EVTG0 base address */ - #define EVTG0_BASE_NS (0x400D2000u) - /** Peripheral EVTG0 base pointer */ - #define EVTG0 ((EVTG_Type *)EVTG0_BASE) - /** Peripheral EVTG0 base pointer */ - #define EVTG0_NS ((EVTG_Type *)EVTG0_BASE_NS) - /** Array initializer of EVTG peripheral base addresses */ - #define EVTG_BASE_ADDRS { EVTG0_BASE } - /** Array initializer of EVTG peripheral base pointers */ - #define EVTG_BASE_PTRS { EVTG0 } - /** Array initializer of EVTG peripheral base addresses */ - #define EVTG_BASE_ADDRS_NS { EVTG0_BASE_NS } - /** Array initializer of EVTG peripheral base pointers */ - #define EVTG_BASE_PTRS_NS { EVTG0_NS } -#else - /** Peripheral EVTG0 base address */ - #define EVTG0_BASE (0x400D2000u) - /** Peripheral EVTG0 base pointer */ - #define EVTG0 ((EVTG_Type *)EVTG0_BASE) - /** Array initializer of EVTG peripheral base addresses */ - #define EVTG_BASE_ADDRS { EVTG0_BASE } - /** Array initializer of EVTG peripheral base pointers */ - #define EVTG_BASE_PTRS { EVTG0 } -#endif - -/*! - * @} - */ /* end of group EVTG_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- EWM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup EWM_Peripheral_Access_Layer EWM Peripheral Access Layer - * @{ - */ - -/** EWM - Register Layout Typedef */ -typedef struct { - __IO uint8_t CTRL; /**< Control, offset: 0x0 */ - __O uint8_t SERV; /**< Service, offset: 0x1 */ - __IO uint8_t CMPL; /**< Compare Low, offset: 0x2 */ - __IO uint8_t CMPH; /**< Compare High, offset: 0x3 */ - __IO uint8_t CLKCTRL; /**< Clock Control, offset: 0x4 */ - __IO uint8_t CLKPRESCALER; /**< Clock Prescaler, offset: 0x5 */ -} EWM_Type; - -/* ---------------------------------------------------------------------------- - -- EWM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup EWM_Register_Masks EWM Register Masks - * @{ - */ - -/*! @name CTRL - Control */ -/*! @{ */ - -#define EWM_CTRL_EWMEN_MASK (0x1U) -#define EWM_CTRL_EWMEN_SHIFT (0U) -/*! EWMEN - EWM Enable - * 0b0..Disables - * 0b1..Enables - */ -#define EWM_CTRL_EWMEN(x) (((uint8_t)(((uint8_t)(x)) << EWM_CTRL_EWMEN_SHIFT)) & EWM_CTRL_EWMEN_MASK) - -#define EWM_CTRL_ASSIN_MASK (0x2U) -#define EWM_CTRL_ASSIN_SHIFT (1U) -/*! ASSIN - Assertion State Select - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define EWM_CTRL_ASSIN(x) (((uint8_t)(((uint8_t)(x)) << EWM_CTRL_ASSIN_SHIFT)) & EWM_CTRL_ASSIN_MASK) - -#define EWM_CTRL_INEN_MASK (0x4U) -#define EWM_CTRL_INEN_SHIFT (2U) -/*! INEN - Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define EWM_CTRL_INEN(x) (((uint8_t)(((uint8_t)(x)) << EWM_CTRL_INEN_SHIFT)) & EWM_CTRL_INEN_MASK) - -#define EWM_CTRL_INTEN_MASK (0x8U) -#define EWM_CTRL_INTEN_SHIFT (3U) -/*! INTEN - Interrupt Enable - * 0b1..Generates interrupt requests - * 0b0..Deasserts interrupt requests - */ -#define EWM_CTRL_INTEN(x) (((uint8_t)(((uint8_t)(x)) << EWM_CTRL_INTEN_SHIFT)) & EWM_CTRL_INTEN_MASK) -/*! @} */ - -/*! @name SERV - Service */ -/*! @{ */ - -#define EWM_SERV_SERVICE_MASK (0xFFU) -#define EWM_SERV_SERVICE_SHIFT (0U) -/*! SERVICE - Service */ -#define EWM_SERV_SERVICE(x) (((uint8_t)(((uint8_t)(x)) << EWM_SERV_SERVICE_SHIFT)) & EWM_SERV_SERVICE_MASK) -/*! @} */ - -/*! @name CMPL - Compare Low */ -/*! @{ */ - -#define EWM_CMPL_COMPAREL_MASK (0xFFU) -#define EWM_CMPL_COMPAREL_SHIFT (0U) -/*! COMPAREL - Compare Low */ -#define EWM_CMPL_COMPAREL(x) (((uint8_t)(((uint8_t)(x)) << EWM_CMPL_COMPAREL_SHIFT)) & EWM_CMPL_COMPAREL_MASK) -/*! @} */ - -/*! @name CMPH - Compare High */ -/*! @{ */ - -#define EWM_CMPH_COMPAREH_MASK (0xFFU) -#define EWM_CMPH_COMPAREH_SHIFT (0U) -/*! COMPAREH - Compare High */ -#define EWM_CMPH_COMPAREH(x) (((uint8_t)(((uint8_t)(x)) << EWM_CMPH_COMPAREH_SHIFT)) & EWM_CMPH_COMPAREH_MASK) -/*! @} */ - -/*! @name CLKCTRL - Clock Control */ -/*! @{ */ - -#define EWM_CLKCTRL_CLKSEL_MASK (0x3U) -#define EWM_CLKCTRL_CLKSEL_SHIFT (0U) -/*! CLKSEL - Clock Select */ -#define EWM_CLKCTRL_CLKSEL(x) (((uint8_t)(((uint8_t)(x)) << EWM_CLKCTRL_CLKSEL_SHIFT)) & EWM_CLKCTRL_CLKSEL_MASK) -/*! @} */ - -/*! @name CLKPRESCALER - Clock Prescaler */ -/*! @{ */ - -#define EWM_CLKPRESCALER_CLK_DIV_MASK (0xFFU) -#define EWM_CLKPRESCALER_CLK_DIV_SHIFT (0U) -/*! CLK_DIV - Clock Divider */ -#define EWM_CLKPRESCALER_CLK_DIV(x) (((uint8_t)(((uint8_t)(x)) << EWM_CLKPRESCALER_CLK_DIV_SHIFT)) & EWM_CLKPRESCALER_CLK_DIV_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group EWM_Register_Masks */ - - -/* EWM - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral EWM0 base address */ - #define EWM0_BASE (0x500C0000u) - /** Peripheral EWM0 base address */ - #define EWM0_BASE_NS (0x400C0000u) - /** Peripheral EWM0 base pointer */ - #define EWM0 ((EWM_Type *)EWM0_BASE) - /** Peripheral EWM0 base pointer */ - #define EWM0_NS ((EWM_Type *)EWM0_BASE_NS) - /** Array initializer of EWM peripheral base addresses */ - #define EWM_BASE_ADDRS { EWM0_BASE } - /** Array initializer of EWM peripheral base pointers */ - #define EWM_BASE_PTRS { EWM0 } - /** Array initializer of EWM peripheral base addresses */ - #define EWM_BASE_ADDRS_NS { EWM0_BASE_NS } - /** Array initializer of EWM peripheral base pointers */ - #define EWM_BASE_PTRS_NS { EWM0_NS } -#else - /** Peripheral EWM0 base address */ - #define EWM0_BASE (0x400C0000u) - /** Peripheral EWM0 base pointer */ - #define EWM0 ((EWM_Type *)EWM0_BASE) - /** Array initializer of EWM peripheral base addresses */ - #define EWM_BASE_ADDRS { EWM0_BASE } - /** Array initializer of EWM peripheral base pointers */ - #define EWM_BASE_PTRS { EWM0 } -#endif - -/*! - * @} - */ /* end of group EWM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- FLEXIO Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FLEXIO_Peripheral_Access_Layer FLEXIO Peripheral Access Layer - * @{ - */ - -/** FLEXIO - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - __IO uint32_t CTRL; /**< FLEXIO Control, offset: 0x8 */ - __I uint32_t PIN; /**< Pin State, offset: 0xC */ - __IO uint32_t SHIFTSTAT; /**< Shifter Status, offset: 0x10 */ - __IO uint32_t SHIFTERR; /**< Shifter Error, offset: 0x14 */ - __IO uint32_t TIMSTAT; /**< Timer Status Flag, offset: 0x18 */ - uint8_t RESERVED_0[4]; - __IO uint32_t SHIFTSIEN; /**< Shifter Status Interrupt Enable, offset: 0x20 */ - __IO uint32_t SHIFTEIEN; /**< Shifter Error Interrupt Enable, offset: 0x24 */ - __IO uint32_t TIMIEN; /**< Timer Interrupt Enable, offset: 0x28 */ - uint8_t RESERVED_1[4]; - __IO uint32_t SHIFTSDEN; /**< Shifter Status DMA Enable, offset: 0x30 */ - uint8_t RESERVED_2[4]; - __IO uint32_t TIMERSDEN; /**< Timer Status DMA Enable, offset: 0x38 */ - uint8_t RESERVED_3[4]; - __IO uint32_t SHIFTSTATE; /**< Shifter State, offset: 0x40 */ - uint8_t RESERVED_4[4]; - __IO uint32_t TRGSTAT; /**< Trigger Status, offset: 0x48 */ - __IO uint32_t TRIGIEN; /**< External Trigger Interrupt Enable, offset: 0x4C */ - __IO uint32_t PINSTAT; /**< Pin Status, offset: 0x50 */ - __IO uint32_t PINIEN; /**< Pin Interrupt Enable, offset: 0x54 */ - __IO uint32_t PINREN; /**< Pin Rising Edge Enable, offset: 0x58 */ - __IO uint32_t PINFEN; /**< Pin Falling Edge Enable, offset: 0x5C */ - __IO uint32_t PINOUTD; /**< Pin Output Data, offset: 0x60 */ - __IO uint32_t PINOUTE; /**< Pin Output Enable, offset: 0x64 */ - __O uint32_t PINOUTDIS; /**< Pin Output Disable, offset: 0x68 */ - __O uint32_t PINOUTCLR; /**< Pin Output Clear, offset: 0x6C */ - __O uint32_t PINOUTSET; /**< Pin Output Set, offset: 0x70 */ - __O uint32_t PINOUTTOG; /**< Pin Output Toggle, offset: 0x74 */ - uint8_t RESERVED_5[8]; - __IO uint32_t SHIFTCTL[8]; /**< Shifter Control, array offset: 0x80, array step: 0x4 */ - uint8_t RESERVED_6[96]; - __IO uint32_t SHIFTCFG[8]; /**< Shifter Configuration, array offset: 0x100, array step: 0x4 */ - uint8_t RESERVED_7[224]; - __IO uint32_t SHIFTBUF[8]; /**< Shifter Buffer, array offset: 0x200, array step: 0x4 */ - uint8_t RESERVED_8[96]; - __IO uint32_t SHIFTBUFBIS[8]; /**< Shifter Buffer Bit Swapped, array offset: 0x280, array step: 0x4 */ - uint8_t RESERVED_9[96]; - __IO uint32_t SHIFTBUFBYS[8]; /**< Shifter Buffer Byte Swapped, array offset: 0x300, array step: 0x4 */ - uint8_t RESERVED_10[96]; - __IO uint32_t SHIFTBUFBBS[8]; /**< Shifter Buffer Bit Byte Swapped, array offset: 0x380, array step: 0x4 */ - uint8_t RESERVED_11[96]; - __IO uint32_t TIMCTL[8]; /**< Timer Control, array offset: 0x400, array step: 0x4 */ - uint8_t RESERVED_12[96]; - __IO uint32_t TIMCFG[8]; /**< Timer Configuration, array offset: 0x480, array step: 0x4 */ - uint8_t RESERVED_13[96]; - __IO uint32_t TIMCMP[8]; /**< Timer Compare, array offset: 0x500, array step: 0x4 */ - uint8_t RESERVED_14[352]; - __IO uint32_t SHIFTBUFNBS[8]; /**< Shifter Buffer Nibble Byte Swapped, array offset: 0x680, array step: 0x4 */ - uint8_t RESERVED_15[96]; - __IO uint32_t SHIFTBUFHWS[8]; /**< Shifter Buffer Halfword Swapped, array offset: 0x700, array step: 0x4 */ - uint8_t RESERVED_16[96]; - __IO uint32_t SHIFTBUFNIS[8]; /**< Shifter Buffer Nibble Swapped, array offset: 0x780, array step: 0x4 */ - uint8_t RESERVED_17[96]; - __IO uint32_t SHIFTBUFOES[8]; /**< Shifter Buffer Odd Even Swapped, array offset: 0x800, array step: 0x4 */ - uint8_t RESERVED_18[96]; - __IO uint32_t SHIFTBUFEOS[8]; /**< Shifter Buffer Even Odd Swapped, array offset: 0x880, array step: 0x4 */ - uint8_t RESERVED_19[96]; - __IO uint32_t SHIFTBUFHBS[8]; /**< Shifter Buffer Halfword Byte Swapped, array offset: 0x900, array step: 0x4 */ -} FLEXIO_Type; - -/* ---------------------------------------------------------------------------- - -- FLEXIO Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FLEXIO_Register_Masks FLEXIO Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define FLEXIO_VERID_FEATURE_MASK (0xFFFFU) -#define FLEXIO_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Standard features implemented - * 0b0000000000000001..State, logic, and parallel modes supported - * 0b0000000000000010..Pin control registers supported - * 0b0000000000000011..State, logic, and parallel modes, plus pin control registers supported - */ -#define FLEXIO_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_VERID_FEATURE_SHIFT)) & FLEXIO_VERID_FEATURE_MASK) - -#define FLEXIO_VERID_MINOR_MASK (0xFF0000U) -#define FLEXIO_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define FLEXIO_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_VERID_MINOR_SHIFT)) & FLEXIO_VERID_MINOR_MASK) - -#define FLEXIO_VERID_MAJOR_MASK (0xFF000000U) -#define FLEXIO_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define FLEXIO_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_VERID_MAJOR_SHIFT)) & FLEXIO_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define FLEXIO_PARAM_SHIFTER_MASK (0xFFU) -#define FLEXIO_PARAM_SHIFTER_SHIFT (0U) -/*! SHIFTER - Shifter Number */ -#define FLEXIO_PARAM_SHIFTER(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PARAM_SHIFTER_SHIFT)) & FLEXIO_PARAM_SHIFTER_MASK) - -#define FLEXIO_PARAM_TIMER_MASK (0xFF00U) -#define FLEXIO_PARAM_TIMER_SHIFT (8U) -/*! TIMER - Timer Number */ -#define FLEXIO_PARAM_TIMER(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PARAM_TIMER_SHIFT)) & FLEXIO_PARAM_TIMER_MASK) - -#define FLEXIO_PARAM_PIN_MASK (0xFF0000U) -#define FLEXIO_PARAM_PIN_SHIFT (16U) -/*! PIN - Pin Number */ -#define FLEXIO_PARAM_PIN(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PARAM_PIN_SHIFT)) & FLEXIO_PARAM_PIN_MASK) - -#define FLEXIO_PARAM_TRIGGER_MASK (0xFF000000U) -#define FLEXIO_PARAM_TRIGGER_SHIFT (24U) -/*! TRIGGER - Trigger Number */ -#define FLEXIO_PARAM_TRIGGER(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PARAM_TRIGGER_SHIFT)) & FLEXIO_PARAM_TRIGGER_MASK) -/*! @} */ - -/*! @name CTRL - FLEXIO Control */ -/*! @{ */ - -#define FLEXIO_CTRL_FLEXEN_MASK (0x1U) -#define FLEXIO_CTRL_FLEXEN_SHIFT (0U) -/*! FLEXEN - FLEXIO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXIO_CTRL_FLEXEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_CTRL_FLEXEN_SHIFT)) & FLEXIO_CTRL_FLEXEN_MASK) - -#define FLEXIO_CTRL_SWRST_MASK (0x2U) -#define FLEXIO_CTRL_SWRST_SHIFT (1U) -/*! SWRST - Software Reset - * 0b0..Disabled - * 0b1..Enabled - */ -#define FLEXIO_CTRL_SWRST(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_CTRL_SWRST_SHIFT)) & FLEXIO_CTRL_SWRST_MASK) - -#define FLEXIO_CTRL_FASTACC_MASK (0x4U) -#define FLEXIO_CTRL_FASTACC_SHIFT (2U) -/*! FASTACC - Fast Access - * 0b0..Normal - * 0b1..Fast - */ -#define FLEXIO_CTRL_FASTACC(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_CTRL_FASTACC_SHIFT)) & FLEXIO_CTRL_FASTACC_MASK) - -#define FLEXIO_CTRL_DBGE_MASK (0x40000000U) -#define FLEXIO_CTRL_DBGE_SHIFT (30U) -/*! DBGE - Debug Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXIO_CTRL_DBGE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_CTRL_DBGE_SHIFT)) & FLEXIO_CTRL_DBGE_MASK) - -#define FLEXIO_CTRL_DOZEN_MASK (0x80000000U) -#define FLEXIO_CTRL_DOZEN_SHIFT (31U) -/*! DOZEN - Doze Enable - * 0b0..Enable - * 0b1..Disable - */ -#define FLEXIO_CTRL_DOZEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_CTRL_DOZEN_SHIFT)) & FLEXIO_CTRL_DOZEN_MASK) -/*! @} */ - -/*! @name PIN - Pin State */ -/*! @{ */ - -#define FLEXIO_PIN_PDI_MASK (0xFFFFFFFFU) -#define FLEXIO_PIN_PDI_SHIFT (0U) -/*! PDI - Pin Data Input */ -#define FLEXIO_PIN_PDI(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PIN_PDI_SHIFT)) & FLEXIO_PIN_PDI_MASK) -/*! @} */ - -/*! @name SHIFTSTAT - Shifter Status */ -/*! @{ */ - -#define FLEXIO_SHIFTSTAT_SSF_MASK (0xFFU) -#define FLEXIO_SHIFTSTAT_SSF_SHIFT (0U) -/*! SSF - Shifter Status Flag - * 0b00000000..Clear - * 0b00000001..Set - * 0b00000000..No effect - * 0b00000001..Clear the flag - */ -#define FLEXIO_SHIFTSTAT_SSF(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTSTAT_SSF_SHIFT)) & FLEXIO_SHIFTSTAT_SSF_MASK) -/*! @} */ - -/*! @name SHIFTERR - Shifter Error */ -/*! @{ */ - -#define FLEXIO_SHIFTERR_SEF_MASK (0xFFU) -#define FLEXIO_SHIFTERR_SEF_SHIFT (0U) -/*! SEF - Shifter Error Flag - * 0b00000000..Clear - * 0b00000001..Set - * 0b00000000..No effect - * 0b00000001..Clear the flag - */ -#define FLEXIO_SHIFTERR_SEF(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTERR_SEF_SHIFT)) & FLEXIO_SHIFTERR_SEF_MASK) -/*! @} */ - -/*! @name TIMSTAT - Timer Status Flag */ -/*! @{ */ - -#define FLEXIO_TIMSTAT_TSF_MASK (0xFFU) -#define FLEXIO_TIMSTAT_TSF_SHIFT (0U) -/*! TSF - Timer Status Flag - * 0b00000000..Clear - * 0b00000001..Set - * 0b00000000..No effect - * 0b00000001..Clear the flag - */ -#define FLEXIO_TIMSTAT_TSF(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMSTAT_TSF_SHIFT)) & FLEXIO_TIMSTAT_TSF_MASK) -/*! @} */ - -/*! @name SHIFTSIEN - Shifter Status Interrupt Enable */ -/*! @{ */ - -#define FLEXIO_SHIFTSIEN_SSIE_MASK (0xFFU) -#define FLEXIO_SHIFTSIEN_SSIE_SHIFT (0U) -/*! SSIE - Shifter Status Interrupt Enable */ -#define FLEXIO_SHIFTSIEN_SSIE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTSIEN_SSIE_SHIFT)) & FLEXIO_SHIFTSIEN_SSIE_MASK) -/*! @} */ - -/*! @name SHIFTEIEN - Shifter Error Interrupt Enable */ -/*! @{ */ - -#define FLEXIO_SHIFTEIEN_SEIE_MASK (0xFFU) -#define FLEXIO_SHIFTEIEN_SEIE_SHIFT (0U) -/*! SEIE - Shifter Error Interrupt Enable */ -#define FLEXIO_SHIFTEIEN_SEIE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTEIEN_SEIE_SHIFT)) & FLEXIO_SHIFTEIEN_SEIE_MASK) -/*! @} */ - -/*! @name TIMIEN - Timer Interrupt Enable */ -/*! @{ */ - -#define FLEXIO_TIMIEN_TEIE_MASK (0xFFU) -#define FLEXIO_TIMIEN_TEIE_SHIFT (0U) -/*! TEIE - Timer Status Interrupt Enable */ -#define FLEXIO_TIMIEN_TEIE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMIEN_TEIE_SHIFT)) & FLEXIO_TIMIEN_TEIE_MASK) -/*! @} */ - -/*! @name SHIFTSDEN - Shifter Status DMA Enable */ -/*! @{ */ - -#define FLEXIO_SHIFTSDEN_SSDE_MASK (0xFFU) -#define FLEXIO_SHIFTSDEN_SSDE_SHIFT (0U) -/*! SSDE - Shifter Status DMA Enable */ -#define FLEXIO_SHIFTSDEN_SSDE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTSDEN_SSDE_SHIFT)) & FLEXIO_SHIFTSDEN_SSDE_MASK) -/*! @} */ - -/*! @name TIMERSDEN - Timer Status DMA Enable */ -/*! @{ */ - -#define FLEXIO_TIMERSDEN_TSDE_MASK (0xFFU) -#define FLEXIO_TIMERSDEN_TSDE_SHIFT (0U) -/*! TSDE - Timer Status DMA Enable */ -#define FLEXIO_TIMERSDEN_TSDE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMERSDEN_TSDE_SHIFT)) & FLEXIO_TIMERSDEN_TSDE_MASK) -/*! @} */ - -/*! @name SHIFTSTATE - Shifter State */ -/*! @{ */ - -#define FLEXIO_SHIFTSTATE_STATE_MASK (0x7U) -#define FLEXIO_SHIFTSTATE_STATE_SHIFT (0U) -/*! STATE - Current State Pointer */ -#define FLEXIO_SHIFTSTATE_STATE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTSTATE_STATE_SHIFT)) & FLEXIO_SHIFTSTATE_STATE_MASK) -/*! @} */ - -/*! @name TRGSTAT - Trigger Status */ -/*! @{ */ - -#define FLEXIO_TRGSTAT_ETSF_MASK (0xFFU) -#define FLEXIO_TRGSTAT_ETSF_SHIFT (0U) -/*! ETSF - External Trigger Status Flag - * 0b00000000..Clear - * 0b00000001..Set - * 0b00000000..No effect - * 0b00000001..Clear the flag - */ -#define FLEXIO_TRGSTAT_ETSF(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TRGSTAT_ETSF_SHIFT)) & FLEXIO_TRGSTAT_ETSF_MASK) -/*! @} */ - -/*! @name TRIGIEN - External Trigger Interrupt Enable */ -/*! @{ */ - -#define FLEXIO_TRIGIEN_TRIE_MASK (0xFFU) -#define FLEXIO_TRIGIEN_TRIE_SHIFT (0U) -/*! TRIE - External Trigger Interrupt Enable */ -#define FLEXIO_TRIGIEN_TRIE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TRIGIEN_TRIE_SHIFT)) & FLEXIO_TRIGIEN_TRIE_MASK) -/*! @} */ - -/*! @name PINSTAT - Pin Status */ -/*! @{ */ - -#define FLEXIO_PINSTAT_PSF_MASK (0xFFFFFFFFU) -#define FLEXIO_PINSTAT_PSF_SHIFT (0U) -/*! PSF - Pin Status Flag - * 0b00000000000000000000000000000000..Clear - * 0b00000000000000000000000000000001..Set - * 0b00000000000000000000000000000000..No effect - * 0b00000000000000000000000000000001..Clear the flag - */ -#define FLEXIO_PINSTAT_PSF(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINSTAT_PSF_SHIFT)) & FLEXIO_PINSTAT_PSF_MASK) -/*! @} */ - -/*! @name PINIEN - Pin Interrupt Enable */ -/*! @{ */ - -#define FLEXIO_PINIEN_PSIE_MASK (0xFFFFFFFFU) -#define FLEXIO_PINIEN_PSIE_SHIFT (0U) -/*! PSIE - Pin Status Interrupt Enable */ -#define FLEXIO_PINIEN_PSIE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINIEN_PSIE_SHIFT)) & FLEXIO_PINIEN_PSIE_MASK) -/*! @} */ - -/*! @name PINREN - Pin Rising Edge Enable */ -/*! @{ */ - -#define FLEXIO_PINREN_PRE_MASK (0xFFFFFFFFU) -#define FLEXIO_PINREN_PRE_SHIFT (0U) -/*! PRE - Pin Rising Edge */ -#define FLEXIO_PINREN_PRE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINREN_PRE_SHIFT)) & FLEXIO_PINREN_PRE_MASK) -/*! @} */ - -/*! @name PINFEN - Pin Falling Edge Enable */ -/*! @{ */ - -#define FLEXIO_PINFEN_PFE_MASK (0xFFFFFFFFU) -#define FLEXIO_PINFEN_PFE_SHIFT (0U) -/*! PFE - Pin Falling Edge */ -#define FLEXIO_PINFEN_PFE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINFEN_PFE_SHIFT)) & FLEXIO_PINFEN_PFE_MASK) -/*! @} */ - -/*! @name PINOUTD - Pin Output Data */ -/*! @{ */ - -#define FLEXIO_PINOUTD_OUTD_MASK (0xFFFFFFFFU) -#define FLEXIO_PINOUTD_OUTD_SHIFT (0U) -/*! OUTD - Output Data */ -#define FLEXIO_PINOUTD_OUTD(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINOUTD_OUTD_SHIFT)) & FLEXIO_PINOUTD_OUTD_MASK) -/*! @} */ - -/*! @name PINOUTE - Pin Output Enable */ -/*! @{ */ - -#define FLEXIO_PINOUTE_OUTE_MASK (0xFFFFFFFFU) -#define FLEXIO_PINOUTE_OUTE_SHIFT (0U) -/*! OUTE - Output Enable */ -#define FLEXIO_PINOUTE_OUTE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINOUTE_OUTE_SHIFT)) & FLEXIO_PINOUTE_OUTE_MASK) -/*! @} */ - -/*! @name PINOUTDIS - Pin Output Disable */ -/*! @{ */ - -#define FLEXIO_PINOUTDIS_OUTDIS_MASK (0xFFFFFFFFU) -#define FLEXIO_PINOUTDIS_OUTDIS_SHIFT (0U) -/*! OUTDIS - Output Disable */ -#define FLEXIO_PINOUTDIS_OUTDIS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINOUTDIS_OUTDIS_SHIFT)) & FLEXIO_PINOUTDIS_OUTDIS_MASK) -/*! @} */ - -/*! @name PINOUTCLR - Pin Output Clear */ -/*! @{ */ - -#define FLEXIO_PINOUTCLR_OUTCLR_MASK (0xFFFFFFFFU) -#define FLEXIO_PINOUTCLR_OUTCLR_SHIFT (0U) -/*! OUTCLR - Output Clear */ -#define FLEXIO_PINOUTCLR_OUTCLR(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINOUTCLR_OUTCLR_SHIFT)) & FLEXIO_PINOUTCLR_OUTCLR_MASK) -/*! @} */ - -/*! @name PINOUTSET - Pin Output Set */ -/*! @{ */ - -#define FLEXIO_PINOUTSET_OUTSET_MASK (0xFFFFFFFFU) -#define FLEXIO_PINOUTSET_OUTSET_SHIFT (0U) -/*! OUTSET - Output Set */ -#define FLEXIO_PINOUTSET_OUTSET(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINOUTSET_OUTSET_SHIFT)) & FLEXIO_PINOUTSET_OUTSET_MASK) -/*! @} */ - -/*! @name PINOUTTOG - Pin Output Toggle */ -/*! @{ */ - -#define FLEXIO_PINOUTTOG_OUTTOG_MASK (0xFFFFFFFFU) -#define FLEXIO_PINOUTTOG_OUTTOG_SHIFT (0U) -/*! OUTTOG - Output Toggle */ -#define FLEXIO_PINOUTTOG_OUTTOG(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINOUTTOG_OUTTOG_SHIFT)) & FLEXIO_PINOUTTOG_OUTTOG_MASK) -/*! @} */ - -/*! @name SHIFTCTL - Shifter Control */ -/*! @{ */ - -#define FLEXIO_SHIFTCTL_SMOD_MASK (0x7U) -#define FLEXIO_SHIFTCTL_SMOD_SHIFT (0U) -/*! SMOD - Shifter Mode - * 0b000..Disable - * 0b001..Receive mode; capture the current shifter content into SHIFTBUF on expiration of the timer - * 0b010..Transmit mode; load SHIFTBUF contents into the shifter on expiration of the timer - * 0b011..Reserved - * 0b100..Match Store mode; shifter data is compared to SHIFTBUF content on expiration of the timer - * 0b101..Match Continuous mode; shifter data is continuously compared to SHIFTBUF contents - * 0b110..State mode; SHIFTBUF contents store programmable state attributes - * 0b111..Logic mode; SHIFTBUF contents implement programmable logic lookup table - */ -#define FLEXIO_SHIFTCTL_SMOD(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCTL_SMOD_SHIFT)) & FLEXIO_SHIFTCTL_SMOD_MASK) - -#define FLEXIO_SHIFTCTL_PINPOL_MASK (0x80U) -#define FLEXIO_SHIFTCTL_PINPOL_SHIFT (7U) -/*! PINPOL - Shifter Pin Polarity - * 0b0..Active high - * 0b1..Active low - */ -#define FLEXIO_SHIFTCTL_PINPOL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCTL_PINPOL_SHIFT)) & FLEXIO_SHIFTCTL_PINPOL_MASK) - -#define FLEXIO_SHIFTCTL_PINSEL_MASK (0x1F00U) -#define FLEXIO_SHIFTCTL_PINSEL_SHIFT (8U) -/*! PINSEL - Shifter Pin Select */ -#define FLEXIO_SHIFTCTL_PINSEL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCTL_PINSEL_SHIFT)) & FLEXIO_SHIFTCTL_PINSEL_MASK) - -#define FLEXIO_SHIFTCTL_PINCFG_MASK (0x30000U) -#define FLEXIO_SHIFTCTL_PINCFG_SHIFT (16U) -/*! PINCFG - Shifter Pin Configuration - * 0b00..Shifter pin output disabled - * 0b01..Shifter pin open-drain or bidirectional output enable - * 0b10..Shifter pin bidirectional output data - * 0b11..Shifter pin output - */ -#define FLEXIO_SHIFTCTL_PINCFG(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCTL_PINCFG_SHIFT)) & FLEXIO_SHIFTCTL_PINCFG_MASK) - -#define FLEXIO_SHIFTCTL_TIMPOL_MASK (0x800000U) -#define FLEXIO_SHIFTCTL_TIMPOL_SHIFT (23U) -/*! TIMPOL - Timer Polarity - * 0b0..Positive edge - * 0b1..Negative edge - */ -#define FLEXIO_SHIFTCTL_TIMPOL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCTL_TIMPOL_SHIFT)) & FLEXIO_SHIFTCTL_TIMPOL_MASK) - -#define FLEXIO_SHIFTCTL_TIMSEL_MASK (0x7000000U) -#define FLEXIO_SHIFTCTL_TIMSEL_SHIFT (24U) -/*! TIMSEL - Timer Select */ -#define FLEXIO_SHIFTCTL_TIMSEL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCTL_TIMSEL_SHIFT)) & FLEXIO_SHIFTCTL_TIMSEL_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTCTL */ -#define FLEXIO_SHIFTCTL_COUNT (8U) - -/*! @name SHIFTCFG - Shifter Configuration */ -/*! @{ */ - -#define FLEXIO_SHIFTCFG_SSTART_MASK (0x3U) -#define FLEXIO_SHIFTCFG_SSTART_SHIFT (0U) -/*! SSTART - Shifter Start - * 0b00..Start bit disabled for Transmitter, Receiver, and Match Store modes; Transmitter mode loads data on enable - * 0b01..Start bit disabled for Transmitter, Receiver, and Match Store modes; Transmitter mode loads data on first shift - * 0b10..Transmitter mode outputs start bit value 0 before loading data on first shift; if start bit is not 0, - * Receiver and Match Store modes set error flag - * 0b11..Transmitter mode outputs start bit value 1 before loading data on first shift; if start bit is not 1, - * Receiver and Match Store modes set error flag - */ -#define FLEXIO_SHIFTCFG_SSTART(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCFG_SSTART_SHIFT)) & FLEXIO_SHIFTCFG_SSTART_MASK) - -#define FLEXIO_SHIFTCFG_SSTOP_MASK (0x30U) -#define FLEXIO_SHIFTCFG_SSTOP_SHIFT (4U) -/*! SSTOP - Shifter Stop - * 0b00..Stop bit disabled for Transmitter, Receiver, and Match Store modes - * 0b01..Stop bit disabled for Transmitter, Receiver, and Match Store modes; when timer is in stop condition, - * Receiver and Match Store modes store receive data on the configured shift edge - * 0b10..Transmitter mode outputs stop bit value 0 in Match Store mode; if stop bit is not 0, Receiver and Match - * Store modes set error flag (when timer is in stop condition, these modes also store receive data on the - * configured shift edge) - * 0b11..Transmitter mode outputs stop bit value 1 in Match Store mode; if stop bit is not 1, Receiver and Match - * Store modes set error flag (when timer is in stop condition, these modes also store receive data on the - * configured shift edge) - */ -#define FLEXIO_SHIFTCFG_SSTOP(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCFG_SSTOP_SHIFT)) & FLEXIO_SHIFTCFG_SSTOP_MASK) - -#define FLEXIO_SHIFTCFG_INSRC_MASK (0x100U) -#define FLEXIO_SHIFTCFG_INSRC_SHIFT (8U) -/*! INSRC - Input Source - * 0b0..Pin - * 0b1..Shifter n+1 output - */ -#define FLEXIO_SHIFTCFG_INSRC(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCFG_INSRC_SHIFT)) & FLEXIO_SHIFTCFG_INSRC_MASK) - -#define FLEXIO_SHIFTCFG_LATST_MASK (0x200U) -#define FLEXIO_SHIFTCFG_LATST_SHIFT (9U) -/*! LATST - Late Store - * 0b0..Store the pre-shift register state - * 0b1..Store the post-shift register state - */ -#define FLEXIO_SHIFTCFG_LATST(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCFG_LATST_SHIFT)) & FLEXIO_SHIFTCFG_LATST_MASK) - -#define FLEXIO_SHIFTCFG_SSIZE_MASK (0x1000U) -#define FLEXIO_SHIFTCFG_SSIZE_SHIFT (12U) -/*! SSIZE - Shifter Size - * 0b0..32-bit - * 0b1..24-bit - */ -#define FLEXIO_SHIFTCFG_SSIZE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCFG_SSIZE_SHIFT)) & FLEXIO_SHIFTCFG_SSIZE_MASK) - -#define FLEXIO_SHIFTCFG_PWIDTH_MASK (0x1F0000U) -#define FLEXIO_SHIFTCFG_PWIDTH_SHIFT (16U) -/*! PWIDTH - Parallel Width */ -#define FLEXIO_SHIFTCFG_PWIDTH(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCFG_PWIDTH_SHIFT)) & FLEXIO_SHIFTCFG_PWIDTH_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTCFG */ -#define FLEXIO_SHIFTCFG_COUNT (8U) - -/*! @name SHIFTBUF - Shifter Buffer */ -/*! @{ */ - -#define FLEXIO_SHIFTBUF_SHIFTBUF_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUF_SHIFTBUF_SHIFT (0U) -/*! SHIFTBUF - Shift Buffer */ -#define FLEXIO_SHIFTBUF_SHIFTBUF(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUF_SHIFTBUF_SHIFT)) & FLEXIO_SHIFTBUF_SHIFTBUF_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUF */ -#define FLEXIO_SHIFTBUF_COUNT (8U) - -/*! @name SHIFTBUFBIS - Shifter Buffer Bit Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFBIS_SHIFTBUFBIS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFBIS_SHIFTBUFBIS_SHIFT (0U) -/*! SHIFTBUFBIS - Shift Buffer */ -#define FLEXIO_SHIFTBUFBIS_SHIFTBUFBIS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFBIS_SHIFTBUFBIS_SHIFT)) & FLEXIO_SHIFTBUFBIS_SHIFTBUFBIS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFBIS */ -#define FLEXIO_SHIFTBUFBIS_COUNT (8U) - -/*! @name SHIFTBUFBYS - Shifter Buffer Byte Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFBYS_SHIFTBUFBYS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFBYS_SHIFTBUFBYS_SHIFT (0U) -/*! SHIFTBUFBYS - Shift Buffer */ -#define FLEXIO_SHIFTBUFBYS_SHIFTBUFBYS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFBYS_SHIFTBUFBYS_SHIFT)) & FLEXIO_SHIFTBUFBYS_SHIFTBUFBYS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFBYS */ -#define FLEXIO_SHIFTBUFBYS_COUNT (8U) - -/*! @name SHIFTBUFBBS - Shifter Buffer Bit Byte Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFBBS_SHIFTBUFBBS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFBBS_SHIFTBUFBBS_SHIFT (0U) -/*! SHIFTBUFBBS - Shift Buffer */ -#define FLEXIO_SHIFTBUFBBS_SHIFTBUFBBS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFBBS_SHIFTBUFBBS_SHIFT)) & FLEXIO_SHIFTBUFBBS_SHIFTBUFBBS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFBBS */ -#define FLEXIO_SHIFTBUFBBS_COUNT (8U) - -/*! @name TIMCTL - Timer Control */ -/*! @{ */ - -#define FLEXIO_TIMCTL_TIMOD_MASK (0x7U) -#define FLEXIO_TIMCTL_TIMOD_SHIFT (0U) -/*! TIMOD - Timer Mode - * 0b000..Timer disabled - * 0b001..Dual 8-bit counters baud mode - * 0b010..Dual 8-bit counters PWM high mode - * 0b011..Single 16-bit counter mode - * 0b100..Single 16-bit counter disable mode - * 0b101..Dual 8-bit counters word mode - * 0b110..Dual 8-bit counters PWM low mode - * 0b111..Single 16-bit input capture mode - */ -#define FLEXIO_TIMCTL_TIMOD(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_TIMOD_SHIFT)) & FLEXIO_TIMCTL_TIMOD_MASK) - -#define FLEXIO_TIMCTL_ONETIM_MASK (0x20U) -#define FLEXIO_TIMCTL_ONETIM_SHIFT (5U) -/*! ONETIM - Timer One Time Operation - * 0b0..Generate the timer enable event as normal - * 0b1..Block the timer enable event unless the timer status flag is clear - */ -#define FLEXIO_TIMCTL_ONETIM(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_ONETIM_SHIFT)) & FLEXIO_TIMCTL_ONETIM_MASK) - -#define FLEXIO_TIMCTL_PININS_MASK (0x40U) -#define FLEXIO_TIMCTL_PININS_SHIFT (6U) -/*! PININS - Timer Pin Input Select - * 0b0..PINSEL selects timer pin input and output - * 0b1..PINSEL + 1 selects the timer pin input; timer pin output remains selected by PINSEL - */ -#define FLEXIO_TIMCTL_PININS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_PININS_SHIFT)) & FLEXIO_TIMCTL_PININS_MASK) - -#define FLEXIO_TIMCTL_PINPOL_MASK (0x80U) -#define FLEXIO_TIMCTL_PINPOL_SHIFT (7U) -/*! PINPOL - Timer Pin Polarity - * 0b0..Active high - * 0b1..Active low - */ -#define FLEXIO_TIMCTL_PINPOL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_PINPOL_SHIFT)) & FLEXIO_TIMCTL_PINPOL_MASK) - -#define FLEXIO_TIMCTL_PINSEL_MASK (0x1F00U) -#define FLEXIO_TIMCTL_PINSEL_SHIFT (8U) -/*! PINSEL - Timer Pin Select */ -#define FLEXIO_TIMCTL_PINSEL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_PINSEL_SHIFT)) & FLEXIO_TIMCTL_PINSEL_MASK) - -#define FLEXIO_TIMCTL_PINCFG_MASK (0x30000U) -#define FLEXIO_TIMCTL_PINCFG_SHIFT (16U) -/*! PINCFG - Timer Pin Configuration - * 0b00..Timer pin output disabled - * 0b01..Timer pin open-drain or bidirectional output enable - * 0b10..Timer pin bidirectional output data - * 0b11..Timer pin output - */ -#define FLEXIO_TIMCTL_PINCFG(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_PINCFG_SHIFT)) & FLEXIO_TIMCTL_PINCFG_MASK) - -#define FLEXIO_TIMCTL_TRGSRC_MASK (0x400000U) -#define FLEXIO_TIMCTL_TRGSRC_SHIFT (22U) -/*! TRGSRC - Trigger Source - * 0b0..External - * 0b1..Internal - */ -#define FLEXIO_TIMCTL_TRGSRC(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_TRGSRC_SHIFT)) & FLEXIO_TIMCTL_TRGSRC_MASK) - -#define FLEXIO_TIMCTL_TRGPOL_MASK (0x800000U) -#define FLEXIO_TIMCTL_TRGPOL_SHIFT (23U) -/*! TRGPOL - Trigger Polarity - * 0b0..Active high - * 0b1..Active low - */ -#define FLEXIO_TIMCTL_TRGPOL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_TRGPOL_SHIFT)) & FLEXIO_TIMCTL_TRGPOL_MASK) - -#define FLEXIO_TIMCTL_TRGSEL_MASK (0x3F000000U) -#define FLEXIO_TIMCTL_TRGSEL_SHIFT (24U) -/*! TRGSEL - Trigger Select */ -#define FLEXIO_TIMCTL_TRGSEL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_TRGSEL_SHIFT)) & FLEXIO_TIMCTL_TRGSEL_MASK) -/*! @} */ - -/* The count of FLEXIO_TIMCTL */ -#define FLEXIO_TIMCTL_COUNT (8U) - -/*! @name TIMCFG - Timer Configuration */ -/*! @{ */ - -#define FLEXIO_TIMCFG_TSTART_MASK (0x2U) -#define FLEXIO_TIMCFG_TSTART_SHIFT (1U) -/*! TSTART - Timer Start - * 0b0..Disabled - * 0b1..Enabled - */ -#define FLEXIO_TIMCFG_TSTART(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TSTART_SHIFT)) & FLEXIO_TIMCFG_TSTART_MASK) - -#define FLEXIO_TIMCFG_TSTOP_MASK (0x30U) -#define FLEXIO_TIMCFG_TSTOP_SHIFT (4U) -/*! TSTOP - Timer Stop - * 0b00..Disabled - * 0b01..Enabled on timer compare - * 0b10..Enabled on timer disable - * 0b11..Enabled on timer compare and timer disable - */ -#define FLEXIO_TIMCFG_TSTOP(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TSTOP_SHIFT)) & FLEXIO_TIMCFG_TSTOP_MASK) - -#define FLEXIO_TIMCFG_TIMENA_MASK (0x700U) -#define FLEXIO_TIMCFG_TIMENA_SHIFT (8U) -/*! TIMENA - Timer Enable - * 0b000..Timer always enabled - * 0b001..Timer enabled on timer n-1 enable - * 0b010..Timer enabled on trigger high - * 0b011..Timer enabled on trigger high and pin high - * 0b100..Timer enabled on pin rising edge - * 0b101..Timer enabled on pin rising edge and trigger high - * 0b110..Timer enabled on trigger rising edge - * 0b111..Timer enabled on trigger rising or falling edge - */ -#define FLEXIO_TIMCFG_TIMENA(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TIMENA_SHIFT)) & FLEXIO_TIMCFG_TIMENA_MASK) - -#define FLEXIO_TIMCFG_TIMDIS_MASK (0x7000U) -#define FLEXIO_TIMCFG_TIMDIS_SHIFT (12U) -/*! TIMDIS - Timer Disable - * 0b000..Timer never disabled - * 0b001..Timer disabled on timer n-1 disable - * 0b010..Timer disabled on timer compare (upper 8 bits match and decrement) - * 0b011..Timer disabled on timer compare (upper 8 bits match and decrement) and trigger low - * 0b100..Timer disabled on pin rising or falling edge - * 0b101..Timer disabled on pin rising or falling edge provided trigger is high - * 0b110..Timer disabled on trigger falling edge - * 0b111..Reserved - */ -#define FLEXIO_TIMCFG_TIMDIS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TIMDIS_SHIFT)) & FLEXIO_TIMCFG_TIMDIS_MASK) - -#define FLEXIO_TIMCFG_TIMRST_MASK (0x70000U) -#define FLEXIO_TIMCFG_TIMRST_SHIFT (16U) -/*! TIMRST - Timer Reset - * 0b000..Never reset timer - * 0b001..Timer reset on timer output high. - * 0b010..Timer reset on timer pin equal to timer output - * 0b011..Timer reset on timer trigger equal to timer output - * 0b100..Timer reset on timer pin rising edge - * 0b101..Reserved - * 0b110..Timer reset on trigger rising edge - * 0b111..Timer reset on trigger rising or falling edge - */ -#define FLEXIO_TIMCFG_TIMRST(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TIMRST_SHIFT)) & FLEXIO_TIMCFG_TIMRST_MASK) - -#define FLEXIO_TIMCFG_TIMDEC_MASK (0x700000U) -#define FLEXIO_TIMCFG_TIMDEC_SHIFT (20U) -/*! TIMDEC - Timer Decrement - * 0b000..Decrement counter on FLEXIO clock; shift clock equals timer output - * 0b001..Decrement counter on trigger input (both edges); shift clock equals timer output - * 0b010..Decrement counter on pin input (both edges); shift clock equals pin input - * 0b011..Decrement counter on trigger input (both edges); shift clock equals trigger input - * 0b100..Decrement counter on FLEXIO clock divided by 16; shift clock equals timer output - * 0b101..Decrement counter on FLEXIO clock divided by 256; shift clock equals timer output - * 0b110..Decrement counter on pin input (rising edge); shift clock equals pin input - * 0b111..Decrement counter on trigger input (rising edge); shift clock equals trigger input - */ -#define FLEXIO_TIMCFG_TIMDEC(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TIMDEC_SHIFT)) & FLEXIO_TIMCFG_TIMDEC_MASK) - -#define FLEXIO_TIMCFG_TIMOUT_MASK (0x3000000U) -#define FLEXIO_TIMCFG_TIMOUT_SHIFT (24U) -/*! TIMOUT - Timer Output - * 0b00..Logic one when enabled; not affected by timer reset - * 0b01..Logic zero when enabled; not affected by timer reset - * 0b10..Logic one when enabled and on timer reset - * 0b11..Logic zero when enabled and on timer reset - */ -#define FLEXIO_TIMCFG_TIMOUT(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TIMOUT_SHIFT)) & FLEXIO_TIMCFG_TIMOUT_MASK) -/*! @} */ - -/* The count of FLEXIO_TIMCFG */ -#define FLEXIO_TIMCFG_COUNT (8U) - -/*! @name TIMCMP - Timer Compare */ -/*! @{ */ - -#define FLEXIO_TIMCMP_CMP_MASK (0xFFFFU) -#define FLEXIO_TIMCMP_CMP_SHIFT (0U) -/*! CMP - Timer Compare Value */ -#define FLEXIO_TIMCMP_CMP(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCMP_CMP_SHIFT)) & FLEXIO_TIMCMP_CMP_MASK) -/*! @} */ - -/* The count of FLEXIO_TIMCMP */ -#define FLEXIO_TIMCMP_COUNT (8U) - -/*! @name SHIFTBUFNBS - Shifter Buffer Nibble Byte Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFNBS_SHIFTBUFNBS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFNBS_SHIFTBUFNBS_SHIFT (0U) -/*! SHIFTBUFNBS - Shift Buffer */ -#define FLEXIO_SHIFTBUFNBS_SHIFTBUFNBS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFNBS_SHIFTBUFNBS_SHIFT)) & FLEXIO_SHIFTBUFNBS_SHIFTBUFNBS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFNBS */ -#define FLEXIO_SHIFTBUFNBS_COUNT (8U) - -/*! @name SHIFTBUFHWS - Shifter Buffer Halfword Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFHWS_SHIFTBUFHWS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFHWS_SHIFTBUFHWS_SHIFT (0U) -/*! SHIFTBUFHWS - Shift Buffer */ -#define FLEXIO_SHIFTBUFHWS_SHIFTBUFHWS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFHWS_SHIFTBUFHWS_SHIFT)) & FLEXIO_SHIFTBUFHWS_SHIFTBUFHWS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFHWS */ -#define FLEXIO_SHIFTBUFHWS_COUNT (8U) - -/*! @name SHIFTBUFNIS - Shifter Buffer Nibble Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFNIS_SHIFTBUFNIS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFNIS_SHIFTBUFNIS_SHIFT (0U) -/*! SHIFTBUFNIS - Shift Buffer */ -#define FLEXIO_SHIFTBUFNIS_SHIFTBUFNIS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFNIS_SHIFTBUFNIS_SHIFT)) & FLEXIO_SHIFTBUFNIS_SHIFTBUFNIS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFNIS */ -#define FLEXIO_SHIFTBUFNIS_COUNT (8U) - -/*! @name SHIFTBUFOES - Shifter Buffer Odd Even Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFOES_SHIFTBUFOES_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFOES_SHIFTBUFOES_SHIFT (0U) -/*! SHIFTBUFOES - Shift Buffer */ -#define FLEXIO_SHIFTBUFOES_SHIFTBUFOES(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFOES_SHIFTBUFOES_SHIFT)) & FLEXIO_SHIFTBUFOES_SHIFTBUFOES_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFOES */ -#define FLEXIO_SHIFTBUFOES_COUNT (8U) - -/*! @name SHIFTBUFEOS - Shifter Buffer Even Odd Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFEOS_SHIFTBUFEOS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFEOS_SHIFTBUFEOS_SHIFT (0U) -/*! SHIFTBUFEOS - Shift Buffer */ -#define FLEXIO_SHIFTBUFEOS_SHIFTBUFEOS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFEOS_SHIFTBUFEOS_SHIFT)) & FLEXIO_SHIFTBUFEOS_SHIFTBUFEOS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFEOS */ -#define FLEXIO_SHIFTBUFEOS_COUNT (8U) - -/*! @name SHIFTBUFHBS - Shifter Buffer Halfword Byte Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFHBS_SHIFTBUFHBS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFHBS_SHIFTBUFHBS_SHIFT (0U) -/*! SHIFTBUFHBS - Shift Buffer */ -#define FLEXIO_SHIFTBUFHBS_SHIFTBUFHBS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFHBS_SHIFTBUFHBS_SHIFT)) & FLEXIO_SHIFTBUFHBS_SHIFTBUFHBS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFHBS */ -#define FLEXIO_SHIFTBUFHBS_COUNT (8U) - - -/*! - * @} - */ /* end of group FLEXIO_Register_Masks */ - - -/* FLEXIO - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral FLEXIO0 base address */ - #define FLEXIO0_BASE (0x50105000u) - /** Peripheral FLEXIO0 base address */ - #define FLEXIO0_BASE_NS (0x40105000u) - /** Peripheral FLEXIO0 base pointer */ - #define FLEXIO0 ((FLEXIO_Type *)FLEXIO0_BASE) - /** Peripheral FLEXIO0 base pointer */ - #define FLEXIO0_NS ((FLEXIO_Type *)FLEXIO0_BASE_NS) - /** Array initializer of FLEXIO peripheral base addresses */ - #define FLEXIO_BASE_ADDRS { FLEXIO0_BASE } - /** Array initializer of FLEXIO peripheral base pointers */ - #define FLEXIO_BASE_PTRS { FLEXIO0 } - /** Array initializer of FLEXIO peripheral base addresses */ - #define FLEXIO_BASE_ADDRS_NS { FLEXIO0_BASE_NS } - /** Array initializer of FLEXIO peripheral base pointers */ - #define FLEXIO_BASE_PTRS_NS { FLEXIO0_NS } -#else - /** Peripheral FLEXIO0 base address */ - #define FLEXIO0_BASE (0x40105000u) - /** Peripheral FLEXIO0 base pointer */ - #define FLEXIO0 ((FLEXIO_Type *)FLEXIO0_BASE) - /** Array initializer of FLEXIO peripheral base addresses */ - #define FLEXIO_BASE_ADDRS { FLEXIO0_BASE } - /** Array initializer of FLEXIO peripheral base pointers */ - #define FLEXIO_BASE_PTRS { FLEXIO0 } -#endif -/** Interrupt vectors for the FLEXIO peripheral type */ -#define FLEXIO_IRQS { FLEXIO_IRQn } - -/*! - * @} - */ /* end of group FLEXIO_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- FMU Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FMU_Peripheral_Access_Layer FMU Peripheral Access Layer - * @{ - */ - -/** FMU - Register Layout Typedef */ -typedef struct { - __IO uint32_t FSTAT; /**< Flash Status Register, offset: 0x0 */ - __IO uint32_t FCNFG; /**< Flash Configuration Register, offset: 0x4 */ - __IO uint32_t FCTRL; /**< Flash Control Register, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __IO uint32_t FCCOB[8]; /**< Flash Common Command Object Registers, array offset: 0x10, array step: 0x4 */ -} FMU_Type; - -/* ---------------------------------------------------------------------------- - -- FMU Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FMU_Register_Masks FMU Register Masks - * @{ - */ - -/*! @name FSTAT - Flash Status Register */ -/*! @{ */ - -#define FMU_FSTAT_FAIL_MASK (0x1U) -#define FMU_FSTAT_FAIL_SHIFT (0U) -/*! FAIL - Command Fail Flag - * 0b0..Error not detected - * 0b1..Error detected - */ -#define FMU_FSTAT_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_FAIL_SHIFT)) & FMU_FSTAT_FAIL_MASK) - -#define FMU_FSTAT_CMDABT_MASK (0x4U) -#define FMU_FSTAT_CMDABT_SHIFT (2U) -/*! CMDABT - Command Abort Flag - * 0b0..No command abort detected - * 0b1..Command abort detected - */ -#define FMU_FSTAT_CMDABT(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_CMDABT_SHIFT)) & FMU_FSTAT_CMDABT_MASK) - -#define FMU_FSTAT_PVIOL_MASK (0x10U) -#define FMU_FSTAT_PVIOL_SHIFT (4U) -/*! PVIOL - Command Protection Violation Flag - * 0b0..No protection violation detected - * 0b1..Protection violation detected - */ -#define FMU_FSTAT_PVIOL(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_PVIOL_SHIFT)) & FMU_FSTAT_PVIOL_MASK) - -#define FMU_FSTAT_ACCERR_MASK (0x20U) -#define FMU_FSTAT_ACCERR_SHIFT (5U) -/*! ACCERR - Command Access Error Flag - * 0b0..No access error detected - * 0b1..Access error detected - */ -#define FMU_FSTAT_ACCERR(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_ACCERR_SHIFT)) & FMU_FSTAT_ACCERR_MASK) - -#define FMU_FSTAT_CWSABT_MASK (0x40U) -#define FMU_FSTAT_CWSABT_SHIFT (6U) -/*! CWSABT - Command Write Sequence Abort Flag - * 0b0..Command write sequence not aborted - * 0b1..Command write sequence aborted - */ -#define FMU_FSTAT_CWSABT(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_CWSABT_SHIFT)) & FMU_FSTAT_CWSABT_MASK) - -#define FMU_FSTAT_CCIF_MASK (0x80U) -#define FMU_FSTAT_CCIF_SHIFT (7U) -/*! CCIF - Command Complete Interrupt Flag - * 0b0..Flash command, initialization, or power mode recovery in progress - * 0b1..Flash command, initialization, or power mode recovery has completed - */ -#define FMU_FSTAT_CCIF(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_CCIF_SHIFT)) & FMU_FSTAT_CCIF_MASK) - -#define FMU_FSTAT_CMDPRT_MASK (0x300U) -#define FMU_FSTAT_CMDPRT_SHIFT (8U) -/*! CMDPRT - Command protection level - * 0b00..Secure, normal access - * 0b01..Secure, privileged access - * 0b10..Nonsecure, normal access - * 0b11..Nonsecure, privileged access - */ -#define FMU_FSTAT_CMDPRT(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_CMDPRT_SHIFT)) & FMU_FSTAT_CMDPRT_MASK) - -#define FMU_FSTAT_CMDP_MASK (0x800U) -#define FMU_FSTAT_CMDP_SHIFT (11U) -/*! CMDP - Command protection status flag - * 0b0..Command protection level and domain ID are stale - * 0b1..Command protection level (CMDPRT) and domain ID (CMDDID) are set - */ -#define FMU_FSTAT_CMDP(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_CMDP_SHIFT)) & FMU_FSTAT_CMDP_MASK) - -#define FMU_FSTAT_CMDDID_MASK (0xF000U) -#define FMU_FSTAT_CMDDID_SHIFT (12U) -/*! CMDDID - Command domain ID */ -#define FMU_FSTAT_CMDDID(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_CMDDID_SHIFT)) & FMU_FSTAT_CMDDID_MASK) - -#define FMU_FSTAT_DFDIF_MASK (0x10000U) -#define FMU_FSTAT_DFDIF_SHIFT (16U) -/*! DFDIF - Double Bit Fault Detect Interrupt Flag - * 0b0..Double bit fault not detected during a valid flash read access - * 0b1..Double bit fault detected (or FCTRL[FDFD] is set) during a valid flash read access - */ -#define FMU_FSTAT_DFDIF(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_DFDIF_SHIFT)) & FMU_FSTAT_DFDIF_MASK) - -#define FMU_FSTAT_SALV_USED_MASK (0x20000U) -#define FMU_FSTAT_SALV_USED_SHIFT (17U) -/*! SALV_USED - Salvage Used for Erase operation - * 0b0..Salvage not used during last operation - * 0b1..Salvage used during the last erase operation - */ -#define FMU_FSTAT_SALV_USED(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_SALV_USED_SHIFT)) & FMU_FSTAT_SALV_USED_MASK) - -#define FMU_FSTAT_PEWEN_MASK (0x3000000U) -#define FMU_FSTAT_PEWEN_SHIFT (24U) -/*! PEWEN - Program-Erase Write Enable Control - * 0b00..Writes are not enabled - * 0b01..Writes are enabled for one flash or IFR phrase (phrase programming, sector erase) - * 0b10..Writes are enabled for one flash or IFR page (page programming) - * 0b11..Reserved - */ -#define FMU_FSTAT_PEWEN(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_PEWEN_SHIFT)) & FMU_FSTAT_PEWEN_MASK) - -#define FMU_FSTAT_PERDY_MASK (0x80000000U) -#define FMU_FSTAT_PERDY_SHIFT (31U) -/*! PERDY - Program-Erase Ready Control/Status Flag - * 0b0..Program or sector erase command operation not stalled - * 0b1..Program or sector erase command operation ready to execute - */ -#define FMU_FSTAT_PERDY(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_PERDY_SHIFT)) & FMU_FSTAT_PERDY_MASK) -/*! @} */ - -/*! @name FCNFG - Flash Configuration Register */ -/*! @{ */ - -#define FMU_FCNFG_CCIE_MASK (0x80U) -#define FMU_FCNFG_CCIE_SHIFT (7U) -/*! CCIE - Command Complete Interrupt Enable - * 0b0..Command complete interrupt disabled - * 0b1..Command complete interrupt enabled - */ -#define FMU_FCNFG_CCIE(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCNFG_CCIE_SHIFT)) & FMU_FCNFG_CCIE_MASK) - -#define FMU_FCNFG_ERSREQ_MASK (0x100U) -#define FMU_FCNFG_ERSREQ_SHIFT (8U) -/*! ERSREQ - Mass Erase Request - * 0b0..No request or request complete - * 0b1..Request to run the Mass Erase operation - */ -#define FMU_FCNFG_ERSREQ(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCNFG_ERSREQ_SHIFT)) & FMU_FCNFG_ERSREQ_MASK) - -#define FMU_FCNFG_DFDIE_MASK (0x10000U) -#define FMU_FCNFG_DFDIE_SHIFT (16U) -/*! DFDIE - Double Bit Fault Detect Interrupt Enable - * 0b0..Double bit fault detect interrupt disabled - * 0b1..Double bit fault detect interrupt enabled - */ -#define FMU_FCNFG_DFDIE(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCNFG_DFDIE_SHIFT)) & FMU_FCNFG_DFDIE_MASK) - -#define FMU_FCNFG_ERSIEN0_MASK (0xF000000U) -#define FMU_FCNFG_ERSIEN0_SHIFT (24U) -/*! ERSIEN0 - Erase IFR Sector Enable - Block 0 - * 0b0000..Block 0 IFR Sector X is protected from erase by ERSSCR command - * 0b0001..Block 0 IFR Sector X is not protected from erase by ERSSCR command - */ -#define FMU_FCNFG_ERSIEN0(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCNFG_ERSIEN0_SHIFT)) & FMU_FCNFG_ERSIEN0_MASK) - -#define FMU_FCNFG_ERSIEN1_MASK (0xF0000000U) -#define FMU_FCNFG_ERSIEN1_SHIFT (28U) -/*! ERSIEN1 - Erase IFR Sector Enable - Block 1 (for dual block configs) - * 0b0000..Block 1 IFR Sector X is protected from erase by ERSSCR command - * 0b0001..Block 1 IFR Sector X is not protected from erase by ERSSCR command - */ -#define FMU_FCNFG_ERSIEN1(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCNFG_ERSIEN1_SHIFT)) & FMU_FCNFG_ERSIEN1_MASK) -/*! @} */ - -/*! @name FCTRL - Flash Control Register */ -/*! @{ */ - -#define FMU_FCTRL_RWSC_MASK (0xFU) -#define FMU_FCTRL_RWSC_SHIFT (0U) -/*! RWSC - Read Wait-State Control */ -#define FMU_FCTRL_RWSC(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCTRL_RWSC_SHIFT)) & FMU_FCTRL_RWSC_MASK) - -#define FMU_FCTRL_FDFD_MASK (0x10000U) -#define FMU_FCTRL_FDFD_SHIFT (16U) -/*! FDFD - Force Double Bit Fault Detect - * 0b0..FSTAT[DFDIF] sets only if a double bit fault is detected during a valid flash read access from the platform flash controller - * 0b1..FSTAT[DFDIF] sets during any valid flash read access from the platform flash controller. An interrupt - * request is generated if the DFDIE bit is set. - */ -#define FMU_FCTRL_FDFD(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCTRL_FDFD_SHIFT)) & FMU_FCTRL_FDFD_MASK) - -#define FMU_FCTRL_ABTREQ_MASK (0x1000000U) -#define FMU_FCTRL_ABTREQ_SHIFT (24U) -/*! ABTREQ - Abort Request - * 0b0..No request to abort a command write sequence - * 0b1..Request to abort a command write sequence - */ -#define FMU_FCTRL_ABTREQ(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCTRL_ABTREQ_SHIFT)) & FMU_FCTRL_ABTREQ_MASK) -/*! @} */ - -/*! @name FCCOB - Flash Common Command Object Registers */ -/*! @{ */ - -#define FMU_FCCOB_CCOBn_MASK (0xFFFFFFFFU) -#define FMU_FCCOB_CCOBn_SHIFT (0U) -/*! CCOBn - CCOBn */ -#define FMU_FCCOB_CCOBn(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCCOB_CCOBn_SHIFT)) & FMU_FCCOB_CCOBn_MASK) -/*! @} */ - -/* The count of FMU_FCCOB */ -#define FMU_FCCOB_COUNT (8U) - - -/*! - * @} - */ /* end of group FMU_Register_Masks */ - - -/* FMU - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral FMU0 base address */ - #define FMU0_BASE (0x50043000u) - /** Peripheral FMU0 base address */ - #define FMU0_BASE_NS (0x40043000u) - /** Peripheral FMU0 base pointer */ - #define FMU0 ((FMU_Type *)FMU0_BASE) - /** Peripheral FMU0 base pointer */ - #define FMU0_NS ((FMU_Type *)FMU0_BASE_NS) - /** Array initializer of FMU peripheral base addresses */ - #define FMU_BASE_ADDRS { FMU0_BASE } - /** Array initializer of FMU peripheral base pointers */ - #define FMU_BASE_PTRS { FMU0 } - /** Array initializer of FMU peripheral base addresses */ - #define FMU_BASE_ADDRS_NS { FMU0_BASE_NS } - /** Array initializer of FMU peripheral base pointers */ - #define FMU_BASE_PTRS_NS { FMU0_NS } -#else - /** Peripheral FMU0 base address */ - #define FMU0_BASE (0x40043000u) - /** Peripheral FMU0 base pointer */ - #define FMU0 ((FMU_Type *)FMU0_BASE) - /** Array initializer of FMU peripheral base addresses */ - #define FMU_BASE_ADDRS { FMU0_BASE } - /** Array initializer of FMU peripheral base pointers */ - #define FMU_BASE_PTRS { FMU0 } -#endif - -/*! - * @} - */ /* end of group FMU_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- FMUTEST Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FMUTEST_Peripheral_Access_Layer FMUTEST Peripheral Access Layer - * @{ - */ - -/** FMUTEST - Register Layout Typedef */ -typedef struct { - __IO uint32_t FSTAT; /**< Flash Status Register, offset: 0x0 */ - __IO uint32_t FCNFG; /**< Flash Configuration Register, offset: 0x4 */ - __IO uint32_t FCTRL; /**< Flash Control Register, offset: 0x8 */ - __I uint32_t FTEST; /**< Flash Test Register, offset: 0xC */ - __IO uint32_t FCCOB0; /**< Flash Command Control 0 Register, offset: 0x10 */ - __IO uint32_t FCCOB1; /**< Flash Command Control 1 Register, offset: 0x14 */ - __IO uint32_t FCCOB2; /**< Flash Command Control 2 Register, offset: 0x18 */ - __IO uint32_t FCCOB3; /**< Flash Command Control 3 Register, offset: 0x1C */ - __IO uint32_t FCCOB4; /**< Flash Command Control 4 Register, offset: 0x20 */ - __IO uint32_t FCCOB5; /**< Flash Command Control 5 Register, offset: 0x24 */ - __IO uint32_t FCCOB6; /**< Flash Command Control 6 Register, offset: 0x28 */ - __IO uint32_t FCCOB7; /**< Flash Command Control 7 Register, offset: 0x2C */ - uint8_t RESERVED_0[208]; - __IO uint32_t RESET_STATUS; /**< FMU Initialization Tracking Register, offset: 0x100 */ - __IO uint32_t MCTL; /**< FMU Control Register, offset: 0x104 */ - __I uint32_t BSEL_GEN; /**< FMU Block Select Generation Register, offset: 0x108 */ - __IO uint32_t PWR_OPT; /**< Power Mode Options Register, offset: 0x10C */ - __I uint32_t CMD_CHECK; /**< FMU Command Check Register, offset: 0x110 */ - uint8_t RESERVED_1[12]; - __IO uint32_t BSEL; /**< FMU Block Select Register, offset: 0x120 */ - __IO uint32_t MSIZE; /**< FMU Memory Size Register, offset: 0x124 */ - __IO uint32_t FLASH_RD_ADD; /**< Flash Read Address Register, offset: 0x128 */ - uint8_t RESERVED_2[4]; - __IO uint32_t FLASH_STOP_ADD; /**< Flash Stop Address Register, offset: 0x130 */ - __IO uint32_t FLASH_RD_CTRL; /**< Flash Read Control Register, offset: 0x134 */ - __IO uint32_t MM_ADDR; /**< Memory Map Address Register, offset: 0x138 */ - uint8_t RESERVED_3[4]; - __IO uint32_t MM_WDATA; /**< Memory Map Write Data Register, offset: 0x140 */ - __IO uint32_t MM_CTL; /**< Memory Map Control Register, offset: 0x144 */ - __IO uint32_t UINT_CTL; /**< User Interface Control Register, offset: 0x148 */ - __IO uint32_t RD_DATA0; /**< Read Data 0 Register, offset: 0x14C */ - __IO uint32_t RD_DATA1; /**< Read Data 1 Register, offset: 0x150 */ - __IO uint32_t RD_DATA2; /**< Read Data 2 Register, offset: 0x154 */ - __IO uint32_t RD_DATA3; /**< Read Data 3 Register, offset: 0x158 */ - __IO uint32_t PARITY; /**< Parity Register, offset: 0x15C */ - __IO uint32_t RD_PATH_CTRL_STATUS; /**< Read Path Control and Status Register, offset: 0x160 */ - __IO uint32_t SMW_DIN0; /**< SMW DIN 0 Register, offset: 0x164 */ - __IO uint32_t SMW_DIN1; /**< SMW DIN 1 Register, offset: 0x168 */ - __IO uint32_t SMW_DIN2; /**< SMW DIN 2 Register, offset: 0x16C */ - __IO uint32_t SMW_DIN3; /**< SMW DIN 3 Register, offset: 0x170 */ - __IO uint32_t SMW_ADDR; /**< SMW Address Register, offset: 0x174 */ - __IO uint32_t SMW_CMD_WAIT; /**< SMW Command and Wait Register, offset: 0x178 */ - __I uint32_t SMW_STATUS; /**< SMW Status Register, offset: 0x17C */ - __IO uint32_t SOCTRIM0_0; /**< SoC Trim Phrase 0 Word 0 Register, offset: 0x180 */ - __IO uint32_t SOCTRIM0_1; /**< SoC Trim Phrase 0 Word 1 Register, offset: 0x184 */ - __IO uint32_t SOCTRIM0_2; /**< SoC Trim Phrase 0 Word 2 Register, offset: 0x188 */ - __IO uint32_t SOCTRIM0_3; /**< SoC Trim Phrase 0 Word 3 Register, offset: 0x18C */ - __IO uint32_t SOCTRIM1_0; /**< SoC Trim Phrase 1 Word 0 Register, offset: 0x190 */ - __IO uint32_t SOCTRIM1_1; /**< SoC Trim Phrase 1 Word 1 Register, offset: 0x194 */ - __IO uint32_t SOCTRIM1_2; /**< SoC Trim Phrase 1 Word 2 Register, offset: 0x198 */ - __IO uint32_t SOCTRIM1_3; /**< SoC Trim Phrase 1 Word 3 Register, offset: 0x19C */ - __IO uint32_t SOCTRIM2_0; /**< SoC Trim Phrase 2 Word 0 Register, offset: 0x1A0 */ - __IO uint32_t SOCTRIM2_1; /**< SoC Trim Phrase 2 Word 1 Register, offset: 0x1A4 */ - __IO uint32_t SOCTRIM2_2; /**< SoC Trim Phrase 2 Word 2 Register, offset: 0x1A8 */ - __IO uint32_t SOCTRIM2_3; /**< SoC Trim Phrase 2 Word 3 Register, offset: 0x1AC */ - __IO uint32_t SOCTRIM3_0; /**< SoC Trim Phrase 3 Word 0 Register, offset: 0x1B0 */ - __IO uint32_t SOCTRIM3_1; /**< SoC Trim Phrase 3 Word 1 Register, offset: 0x1B4 */ - __IO uint32_t SOCTRIM3_2; /**< SoC Trim Phrase 3 Word 2 Register, offset: 0x1B8 */ - __IO uint32_t SOCTRIM3_3; /**< SoC Trim Phrase 3 Word 3 Register, offset: 0x1BC */ - __IO uint32_t SOCTRIM4_0; /**< SoC Trim Phrase 4 Word 0 Register, offset: 0x1C0 */ - __IO uint32_t SOCTRIM4_1; /**< SoC Trim Phrase 4 Word 1 Register, offset: 0x1C4 */ - __IO uint32_t SOCTRIM4_2; /**< SoC Trim Phrase 4 Word 2 Register, offset: 0x1C8 */ - __IO uint32_t SOCTRIM4_3; /**< SoC Trim Phrase 4 Word 3 Register, offset: 0x1CC */ - __IO uint32_t SOCTRIM5_0; /**< SoC Trim Phrase 5 Word 0 Register, offset: 0x1D0 */ - __IO uint32_t SOCTRIM5_1; /**< SoC Trim Phrase 5 Word 1 Register, offset: 0x1D4 */ - __IO uint32_t SOCTRIM5_2; /**< SoC Trim Phrase 5 Word 2 Register, offset: 0x1D8 */ - __IO uint32_t SOCTRIM5_3; /**< SoC Trim Phrase 5 Word 3 Register, offset: 0x1DC */ - __IO uint32_t SOCTRIM6_0; /**< SoC Trim Phrase 6 Word 0 Register, offset: 0x1E0 */ - __IO uint32_t SOCTRIM6_1; /**< SoC Trim Phrase 6 Word 1 Register, offset: 0x1E4 */ - __IO uint32_t SOCTRIM6_2; /**< SoC Trim Phrase 6 Word 2 Register, offset: 0x1E8 */ - __IO uint32_t SOCTRIM6_3; /**< SoC Trim Phrase 6 Word 3 Register, offset: 0x1EC */ - __IO uint32_t SOCTRIM7_0; /**< SoC Trim Phrase 7 Word 0 Register, offset: 0x1F0 */ - __IO uint32_t SOCTRIM7_1; /**< SoC Trim Phrase 7 Word 1 Register, offset: 0x1F4 */ - __IO uint32_t SOCTRIM7_2; /**< SoC Trim Phrase 7 Word 2 Register, offset: 0x1F8 */ - __IO uint32_t SOCTRIM7_3; /**< SoC Trim Phrase 7 Word 3 Register, offset: 0x1FC */ - uint8_t RESERVED_4[4]; - __IO uint32_t R_IP_CONFIG; /**< BIST Configuration Register, offset: 0x204 */ - __IO uint32_t R_TESTCODE; /**< BIST Test Code Register, offset: 0x208 */ - __IO uint32_t R_DFT_CTRL; /**< BIST DFT Control Register, offset: 0x20C */ - __IO uint32_t R_ADR_CTRL; /**< BIST Address Control Register, offset: 0x210 */ - __IO uint32_t R_DATA_CTRL0; /**< BIST Data Control 0 Register, offset: 0x214 */ - __IO uint32_t R_PIN_CTRL; /**< BIST Pin Control Register, offset: 0x218 */ - __IO uint32_t R_CNT_LOOP_CTRL; /**< BIST Loop Count Control Register, offset: 0x21C */ - __IO uint32_t R_TIMER_CTRL; /**< BIST Timer Control Register, offset: 0x220 */ - __IO uint32_t R_TEST_CTRL; /**< BIST Test Control Register, offset: 0x224 */ - __O uint32_t R_ABORT_LOOP; /**< BIST Abort Loop Register, offset: 0x228 */ - __I uint32_t R_ADR_QUERY; /**< BIST Address Query Register, offset: 0x22C */ - __I uint32_t R_DOUT_QUERY0; /**< BIST DOUT Query 0 Register, offset: 0x230 */ - uint8_t RESERVED_5[8]; - __I uint32_t R_SMW_QUERY; /**< BIST SMW Query Register, offset: 0x23C */ - __IO uint32_t R_SMW_SETTING0; /**< BIST SMW Setting 0 Register, offset: 0x240 */ - __IO uint32_t R_SMW_SETTING1; /**< BIST SMW Setting 1 Register, offset: 0x244 */ - __IO uint32_t R_SMP_WHV0; /**< BIST SMP WHV Setting 0 Register, offset: 0x248 */ - __IO uint32_t R_SMP_WHV1; /**< BIST SMP WHV Setting 1 Register, offset: 0x24C */ - __IO uint32_t R_SME_WHV0; /**< BIST SME WHV Setting 0 Register, offset: 0x250 */ - __IO uint32_t R_SME_WHV1; /**< BIST SME WHV Setting 1 Register, offset: 0x254 */ - __IO uint32_t R_SMW_SETTING2; /**< BIST SMW Setting 2 Register, offset: 0x258 */ - __I uint32_t R_D_MISR0; /**< BIST DIN MISR 0 Register, offset: 0x25C */ - __I uint32_t R_A_MISR0; /**< BIST Address MISR 0 Register, offset: 0x260 */ - __I uint32_t R_C_MISR0; /**< BIST Control MISR 0 Register, offset: 0x264 */ - __IO uint32_t R_SMW_SETTING3; /**< BIST SMW Setting 3 Register, offset: 0x268 */ - __IO uint32_t R_DATA_CTRL1; /**< BIST Data Control 1 Register, offset: 0x26C */ - __IO uint32_t R_DATA_CTRL2; /**< BIST Data Control 2 Register, offset: 0x270 */ - __IO uint32_t R_DATA_CTRL3; /**< BIST Data Control 3 Register, offset: 0x274 */ - uint8_t RESERVED_6[8]; - __I uint32_t R_REPAIR0_0; /**< BIST Repair 0 for Block 0 Register, offset: 0x280 */ - __I uint32_t R_REPAIR0_1; /**< BIST Repair 1 Block 0 Register, offset: 0x284 */ - __I uint32_t R_REPAIR1_0; /**< BIST Repair 0 Block 1 Register, offset: 0x288 */ - __I uint32_t R_REPAIR1_1; /**< BIST Repair 1 Block 1 Register, offset: 0x28C */ - uint8_t RESERVED_7[132]; - __IO uint32_t R_DATA_CTRL0_EX; /**< BIST Data Control 0 Extension Register, offset: 0x314 */ - uint8_t RESERVED_8[8]; - __IO uint32_t R_TIMER_CTRL_EX; /**< BIST Timer Control Extension Register, offset: 0x320 */ - uint8_t RESERVED_9[12]; - __I uint32_t R_DOUT_QUERY1; /**< BIST DOUT Query 1 Register, offset: 0x330 */ - uint8_t RESERVED_10[40]; - __I uint32_t R_D_MISR1; /**< BIST DIN MISR 1 Register, offset: 0x35C */ - __I uint32_t R_A_MISR1; /**< BIST Address MISR 1 Register, offset: 0x360 */ - __I uint32_t R_C_MISR1; /**< BIST Control MISR 1 Register, offset: 0x364 */ - uint8_t RESERVED_11[4]; - __IO uint32_t R_DATA_CTRL1_EX; /**< BIST Data Control 1 Extension Register, offset: 0x36C */ - __IO uint32_t R_DATA_CTRL2_EX; /**< BIST Data Control 2 Extension Register, offset: 0x370 */ - __IO uint32_t R_DATA_CTRL3_EX; /**< BIST Data Control 3 Extension Register, offset: 0x374 */ - uint8_t RESERVED_12[136]; - __IO uint32_t SMW_TIMER_OPTION; /**< SMW Timer Option Register, offset: 0x400 */ - __IO uint32_t SMW_SETTING_OPTION0; /**< SMW Setting Option 0 Register, offset: 0x404 */ - __IO uint32_t SMW_SETTING_OPTION2; /**< SMW Setting Option 2 Register, offset: 0x408 */ - __IO uint32_t SMW_SETTING_OPTION3; /**< SMW Setting Option 3 Register, offset: 0x40C */ - __IO uint32_t SMW_SMP_WHV_OPTION0; /**< SMW SMP WHV Option 0 Register, offset: 0x410 */ - __IO uint32_t SMW_SME_WHV_OPTION0; /**< SMW SME WHV Option 0 Register, offset: 0x414 */ - __IO uint32_t SMW_SETTING_OPTION1; /**< SMW Setting Option 1 Register, offset: 0x418 */ - __IO uint32_t SMW_SMP_WHV_OPTION1; /**< SMW SMP WHV Option 1 Register, offset: 0x41C */ - __IO uint32_t SMW_SME_WHV_OPTION1; /**< SMW SME WHV Option 1 Register, offset: 0x420 */ - uint8_t RESERVED_13[220]; - __IO uint32_t REPAIR0_0; /**< FMU Repair 0 Block 0 Register, offset: 0x500 */ - __IO uint32_t REPAIR0_1; /**< FMU Repair 1 Block 0 Register, offset: 0x504 */ - __IO uint32_t REPAIR1_0; /**< FMU Repair 0 Block 1 Register, offset: 0x508 */ - __IO uint32_t REPAIR1_1; /**< FMU Repair 1 Block 1 Register, offset: 0x50C */ - uint8_t RESERVED_14[240]; - __IO uint32_t SMW_HB_SIGNALS; /**< SMW HB Signals Register, offset: 0x600 */ - __IO uint32_t BIST_DUMP_CTRL; /**< BIST Datadump Control Register, offset: 0x604 */ - uint8_t RESERVED_15[4]; - __IO uint32_t ATX_PIN_CTRL; /**< ATX Pin Control Register, offset: 0x60C */ - __IO uint32_t FAILCNT; /**< Fail Count Register, offset: 0x610 */ - __IO uint32_t PGM_PULSE_CNT0; /**< Block 0 Program Pulse Count Register, offset: 0x614 */ - __IO uint32_t PGM_PULSE_CNT1; /**< Block 1 Program Pulse Count Register, offset: 0x618 */ - __IO uint32_t ERS_PULSE_CNT; /**< Erase Pulse Count Register, offset: 0x61C */ - __IO uint32_t MAX_PULSE_CNT; /**< Maximum Pulse Count Register, offset: 0x620 */ - __IO uint32_t PORT_CTRL; /**< Port Control Register, offset: 0x624 */ -} FMUTEST_Type; - -/* ---------------------------------------------------------------------------- - -- FMUTEST Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FMUTEST_Register_Masks FMUTEST Register Masks - * @{ - */ - -/*! @name FSTAT - Flash Status Register */ -/*! @{ */ - -#define FMUTEST_FSTAT_FAIL_MASK (0x1U) -#define FMUTEST_FSTAT_FAIL_SHIFT (0U) -/*! FAIL - Command Fail Flag - * 0b0..Error not detected - * 0b1..Error detected - */ -#define FMUTEST_FSTAT_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_FAIL_SHIFT)) & FMUTEST_FSTAT_FAIL_MASK) - -#define FMUTEST_FSTAT_CMDABT_MASK (0x4U) -#define FMUTEST_FSTAT_CMDABT_SHIFT (2U) -/*! CMDABT - Command Abort Flag - * 0b0..No command abort detected - * 0b1..Command abort detected - */ -#define FMUTEST_FSTAT_CMDABT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_CMDABT_SHIFT)) & FMUTEST_FSTAT_CMDABT_MASK) - -#define FMUTEST_FSTAT_PVIOL_MASK (0x10U) -#define FMUTEST_FSTAT_PVIOL_SHIFT (4U) -/*! PVIOL - Command Protection Violation Flag - * 0b0..No protection violation detected - * 0b1..Protection violation detected - */ -#define FMUTEST_FSTAT_PVIOL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_PVIOL_SHIFT)) & FMUTEST_FSTAT_PVIOL_MASK) - -#define FMUTEST_FSTAT_ACCERR_MASK (0x20U) -#define FMUTEST_FSTAT_ACCERR_SHIFT (5U) -/*! ACCERR - Command Access Error Flag - * 0b0..No access error detected - * 0b1..Access error detected - */ -#define FMUTEST_FSTAT_ACCERR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_ACCERR_SHIFT)) & FMUTEST_FSTAT_ACCERR_MASK) - -#define FMUTEST_FSTAT_CWSABT_MASK (0x40U) -#define FMUTEST_FSTAT_CWSABT_SHIFT (6U) -/*! CWSABT - Command Write Sequence Abort Flag - * 0b0..Command write sequence not aborted - * 0b1..Command write sequence aborted - */ -#define FMUTEST_FSTAT_CWSABT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_CWSABT_SHIFT)) & FMUTEST_FSTAT_CWSABT_MASK) - -#define FMUTEST_FSTAT_CCIF_MASK (0x80U) -#define FMUTEST_FSTAT_CCIF_SHIFT (7U) -/*! CCIF - Command Complete Interrupt Flag - * 0b0..Flash command or initialization in progress - * 0b1..Flash command or initialization has completed - */ -#define FMUTEST_FSTAT_CCIF(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_CCIF_SHIFT)) & FMUTEST_FSTAT_CCIF_MASK) - -#define FMUTEST_FSTAT_CMDPRT_MASK (0x300U) -#define FMUTEST_FSTAT_CMDPRT_SHIFT (8U) -/*! CMDPRT - Command Protection Level - * 0b00..Secure, normal access - * 0b01..Secure, privileged access - * 0b10..Nonsecure, normal access - * 0b11..Nonsecure, privileged access - */ -#define FMUTEST_FSTAT_CMDPRT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_CMDPRT_SHIFT)) & FMUTEST_FSTAT_CMDPRT_MASK) - -#define FMUTEST_FSTAT_CMDP_MASK (0x800U) -#define FMUTEST_FSTAT_CMDP_SHIFT (11U) -/*! CMDP - Command Protection Status Flag - * 0b0..Command protection level and domain ID are stale - * 0b1..Command protection level (CMDPRT) and domain ID (CMDDID) are set - */ -#define FMUTEST_FSTAT_CMDP(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_CMDP_SHIFT)) & FMUTEST_FSTAT_CMDP_MASK) - -#define FMUTEST_FSTAT_CMDDID_MASK (0xF000U) -#define FMUTEST_FSTAT_CMDDID_SHIFT (12U) -/*! CMDDID - Command Domain ID */ -#define FMUTEST_FSTAT_CMDDID(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_CMDDID_SHIFT)) & FMUTEST_FSTAT_CMDDID_MASK) - -#define FMUTEST_FSTAT_DFDIF_MASK (0x10000U) -#define FMUTEST_FSTAT_DFDIF_SHIFT (16U) -/*! DFDIF - Double Bit Fault Detect Interrupt Flag - * 0b0..Double bit fault not detected during a valid flash read access from the FMC - * 0b1..Double bit fault detected (or FCTRL[FDFD] is set) during a valid flash read access from the FMC - */ -#define FMUTEST_FSTAT_DFDIF(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_DFDIF_SHIFT)) & FMUTEST_FSTAT_DFDIF_MASK) - -#define FMUTEST_FSTAT_SALV_USED_MASK (0x20000U) -#define FMUTEST_FSTAT_SALV_USED_SHIFT (17U) -/*! SALV_USED - Salvage Used for Erase operation - * 0b0..Salvage not used during the last operation - * 0b1..Salvage used during the last erase operation - */ -#define FMUTEST_FSTAT_SALV_USED(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_SALV_USED_SHIFT)) & FMUTEST_FSTAT_SALV_USED_MASK) - -#define FMUTEST_FSTAT_PEWEN_MASK (0x3000000U) -#define FMUTEST_FSTAT_PEWEN_SHIFT (24U) -/*! PEWEN - Program-Erase Write Enable Control - * 0b00..Writes are not enabled - * 0b01..Writes are enabled for one flash or IFR phrase (phrase programming, sector erase) - * 0b10..Writes are enabled for one flash or IFR page (page programming) - * 0b11..Reserved - */ -#define FMUTEST_FSTAT_PEWEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_PEWEN_SHIFT)) & FMUTEST_FSTAT_PEWEN_MASK) - -#define FMUTEST_FSTAT_PERDY_MASK (0x80000000U) -#define FMUTEST_FSTAT_PERDY_SHIFT (31U) -/*! PERDY - Program/Erase Ready Control/Status Flag - * 0b0..Program or sector erase command operation is not stalled - * 0b1..Program or sector erase command operation is stalled - */ -#define FMUTEST_FSTAT_PERDY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_PERDY_SHIFT)) & FMUTEST_FSTAT_PERDY_MASK) -/*! @} */ - -/*! @name FCNFG - Flash Configuration Register */ -/*! @{ */ - -#define FMUTEST_FCNFG_CCIE_MASK (0x80U) -#define FMUTEST_FCNFG_CCIE_SHIFT (7U) -/*! CCIE - Command Complete Interrupt Enable - * 0b0..Command complete interrupt disabled - * 0b1..Command complete interrupt enabled. An interrupt request is generated whenever the FSTAT[CCIF] flag is set. - */ -#define FMUTEST_FCNFG_CCIE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCNFG_CCIE_SHIFT)) & FMUTEST_FCNFG_CCIE_MASK) - -#define FMUTEST_FCNFG_ERSREQ_MASK (0x100U) -#define FMUTEST_FCNFG_ERSREQ_SHIFT (8U) -/*! ERSREQ - Mass Erase (Erase All) Request - * 0b0..No request or request complete - * 0b1..Request to run the Mass Erase operation - */ -#define FMUTEST_FCNFG_ERSREQ(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCNFG_ERSREQ_SHIFT)) & FMUTEST_FCNFG_ERSREQ_MASK) - -#define FMUTEST_FCNFG_DFDIE_MASK (0x10000U) -#define FMUTEST_FCNFG_DFDIE_SHIFT (16U) -/*! DFDIE - Double Bit Fault Detect Interrupt Enable - * 0b0..Double bit fault detect interrupt disabled - * 0b1..Double bit fault detect interrupt enabled; an interrupt request is generated whenever the FSTAT[DFDIF] flag is set - */ -#define FMUTEST_FCNFG_DFDIE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCNFG_DFDIE_SHIFT)) & FMUTEST_FCNFG_DFDIE_MASK) - -#define FMUTEST_FCNFG_ERSIEN0_MASK (0xF000000U) -#define FMUTEST_FCNFG_ERSIEN0_SHIFT (24U) -/*! ERSIEN0 - Erase IFR Sector Enable - Block 0 - * 0b0000..Block 0 IFR Sector X is protected from erase by ERSSCR command - * 0b0001..Block 0 IFR Sector X is not protected from erase by ERSSCR command - */ -#define FMUTEST_FCNFG_ERSIEN0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCNFG_ERSIEN0_SHIFT)) & FMUTEST_FCNFG_ERSIEN0_MASK) - -#define FMUTEST_FCNFG_ERSIEN1_MASK (0xF0000000U) -#define FMUTEST_FCNFG_ERSIEN1_SHIFT (28U) -/*! ERSIEN1 - Erase IFR Sector Enable - Block 1 (for dual block configs) - * 0b0000..Block 1 IFR Sector X is protected from erase by ERSSCR command - * 0b0001..Block 1 IFR Sector X is not protected from erase by ERSSCR command - */ -#define FMUTEST_FCNFG_ERSIEN1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCNFG_ERSIEN1_SHIFT)) & FMUTEST_FCNFG_ERSIEN1_MASK) -/*! @} */ - -/*! @name FCTRL - Flash Control Register */ -/*! @{ */ - -#define FMUTEST_FCTRL_RWSC_MASK (0xFU) -#define FMUTEST_FCTRL_RWSC_SHIFT (0U) -/*! RWSC - Read Wait-State Control - * 0b0000..no additional wait-states are added (single cycle access) - * 0b0001..1 additional wait-state is added - * 0b0010..2 additional wait-states are added - * 0b0011..3 additional wait-states are added - * 0b0100..4 additional wait-states are added - * 0b0101..5 additional wait-states are added - * 0b0110..6 additional wait-states are added - * 0b0111..7 additional wait-states are added - * 0b1000..8 additional wait-states are added - * 0b1001..9 additional wait-states are added - * 0b1010..10 additional wait-states are added - * 0b1011..11 additional wait-states are added - * 0b1100..12 additional wait-states are added - * 0b1101..13 additional wait-states are added - * 0b1110..14 additional wait-states are added - * 0b1111..15 additional wait-states are added - */ -#define FMUTEST_FCTRL_RWSC(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCTRL_RWSC_SHIFT)) & FMUTEST_FCTRL_RWSC_MASK) - -#define FMUTEST_FCTRL_LSACTIVE_MASK (0x100U) -#define FMUTEST_FCTRL_LSACTIVE_SHIFT (8U) -/*! LSACTIVE - Low Speed Active Mode - * 0b0..Full speed active mode requested - * 0b1..Low speed active mode requested - */ -#define FMUTEST_FCTRL_LSACTIVE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCTRL_LSACTIVE_SHIFT)) & FMUTEST_FCTRL_LSACTIVE_MASK) - -#define FMUTEST_FCTRL_FDFD_MASK (0x10000U) -#define FMUTEST_FCTRL_FDFD_SHIFT (16U) -/*! FDFD - Force Double Bit Fault Detect - * 0b0..FSTAT[DFDIF] sets only if a double bit fault is detected during a valid flash read access from the FMC - * 0b1..FSTAT[DFDIF] sets during any valid flash read access from the FMC; an interrupt request is generated if the DFDIE bit is set - */ -#define FMUTEST_FCTRL_FDFD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCTRL_FDFD_SHIFT)) & FMUTEST_FCTRL_FDFD_MASK) - -#define FMUTEST_FCTRL_ABTREQ_MASK (0x1000000U) -#define FMUTEST_FCTRL_ABTREQ_SHIFT (24U) -/*! ABTREQ - Abort Request - * 0b0..No request to abort a command write sequence - * 0b1..Request to abort a command write sequence - */ -#define FMUTEST_FCTRL_ABTREQ(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCTRL_ABTREQ_SHIFT)) & FMUTEST_FCTRL_ABTREQ_MASK) -/*! @} */ - -/*! @name FTEST - Flash Test Register */ -/*! @{ */ - -#define FMUTEST_FTEST_TMECTL_MASK (0x1U) -#define FMUTEST_FTEST_TMECTL_SHIFT (0U) -/*! TMECTL - Test Mode Entry Control - * 0b0..FTEST register always reads 0 and writes to FTEST are ignored - * 0b1..FTEST register is readable and can be written to enable writability of TME - */ -#define FMUTEST_FTEST_TMECTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FTEST_TMECTL_SHIFT)) & FMUTEST_FTEST_TMECTL_MASK) - -#define FMUTEST_FTEST_TMEWR_MASK (0x2U) -#define FMUTEST_FTEST_TMEWR_SHIFT (1U) -/*! TMEWR - Test Mode Entry Writable - * 0b0..TME bit is not writable - * 0b1..TME bit is writable - */ -#define FMUTEST_FTEST_TMEWR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FTEST_TMEWR_SHIFT)) & FMUTEST_FTEST_TMEWR_MASK) - -#define FMUTEST_FTEST_TME_MASK (0x4U) -#define FMUTEST_FTEST_TME_SHIFT (2U) -/*! TME - Test Mode Entry - * 0b0..Test mode entry not requested - * 0b1..Test mode entry requested - */ -#define FMUTEST_FTEST_TME(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FTEST_TME_SHIFT)) & FMUTEST_FTEST_TME_MASK) - -#define FMUTEST_FTEST_TMODE_MASK (0x8U) -#define FMUTEST_FTEST_TMODE_SHIFT (3U) -/*! TMODE - Test Mode Status - * 0b0..Test mode not active - * 0b1..Test mode active - */ -#define FMUTEST_FTEST_TMODE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FTEST_TMODE_SHIFT)) & FMUTEST_FTEST_TMODE_MASK) - -#define FMUTEST_FTEST_TMELOCK_MASK (0x10U) -#define FMUTEST_FTEST_TMELOCK_SHIFT (4U) -/*! TMELOCK - Test Mode Entry Lock - * 0b0..FTEST register not locked from accepting writes - * 0b1..FTEST register locked from accepting writes - */ -#define FMUTEST_FTEST_TMELOCK(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FTEST_TMELOCK_SHIFT)) & FMUTEST_FTEST_TMELOCK_MASK) -/*! @} */ - -/*! @name FCCOB0 - Flash Command Control 0 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB0_CMDCODE_MASK (0xFFU) -#define FMUTEST_FCCOB0_CMDCODE_SHIFT (0U) -/*! CMDCODE - Command code */ -#define FMUTEST_FCCOB0_CMDCODE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB0_CMDCODE_SHIFT)) & FMUTEST_FCCOB0_CMDCODE_MASK) -/*! @} */ - -/*! @name FCCOB1 - Flash Command Control 1 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB1_CMDOPT_MASK (0xFFU) -#define FMUTEST_FCCOB1_CMDOPT_SHIFT (0U) -/*! CMDOPT - Command options */ -#define FMUTEST_FCCOB1_CMDOPT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB1_CMDOPT_SHIFT)) & FMUTEST_FCCOB1_CMDOPT_MASK) -/*! @} */ - -/*! @name FCCOB2 - Flash Command Control 2 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB2_CMDADDR_MASK (0xFFFFFFFFU) -#define FMUTEST_FCCOB2_CMDADDR_SHIFT (0U) -/*! CMDADDR - Command starting address */ -#define FMUTEST_FCCOB2_CMDADDR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB2_CMDADDR_SHIFT)) & FMUTEST_FCCOB2_CMDADDR_MASK) -/*! @} */ - -/*! @name FCCOB3 - Flash Command Control 3 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB3_CMDADDRE_MASK (0xFFFFFFFFU) -#define FMUTEST_FCCOB3_CMDADDRE_SHIFT (0U) -/*! CMDADDRE - Command ending address */ -#define FMUTEST_FCCOB3_CMDADDRE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB3_CMDADDRE_SHIFT)) & FMUTEST_FCCOB3_CMDADDRE_MASK) -/*! @} */ - -/*! @name FCCOB4 - Flash Command Control 4 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB4_CMDDATA0_MASK (0xFFFFFFFFU) -#define FMUTEST_FCCOB4_CMDDATA0_SHIFT (0U) -/*! CMDDATA0 - Command data word 0 */ -#define FMUTEST_FCCOB4_CMDDATA0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB4_CMDDATA0_SHIFT)) & FMUTEST_FCCOB4_CMDDATA0_MASK) -/*! @} */ - -/*! @name FCCOB5 - Flash Command Control 5 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB5_CMDDATA1_MASK (0xFFFFFFFFU) -#define FMUTEST_FCCOB5_CMDDATA1_SHIFT (0U) -/*! CMDDATA1 - Command data word 1 */ -#define FMUTEST_FCCOB5_CMDDATA1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB5_CMDDATA1_SHIFT)) & FMUTEST_FCCOB5_CMDDATA1_MASK) -/*! @} */ - -/*! @name FCCOB6 - Flash Command Control 6 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB6_CMDDATA2_MASK (0xFFFFFFFFU) -#define FMUTEST_FCCOB6_CMDDATA2_SHIFT (0U) -/*! CMDDATA2 - Command data word 2 */ -#define FMUTEST_FCCOB6_CMDDATA2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB6_CMDDATA2_SHIFT)) & FMUTEST_FCCOB6_CMDDATA2_MASK) -/*! @} */ - -/*! @name FCCOB7 - Flash Command Control 7 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB7_CMDDATA3_MASK (0xFFFFFFFFU) -#define FMUTEST_FCCOB7_CMDDATA3_SHIFT (0U) -/*! CMDDATA3 - Command data word 3 */ -#define FMUTEST_FCCOB7_CMDDATA3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB7_CMDDATA3_SHIFT)) & FMUTEST_FCCOB7_CMDDATA3_MASK) -/*! @} */ - -/*! @name RESET_STATUS - FMU Initialization Tracking Register */ -/*! @{ */ - -#define FMUTEST_RESET_STATUS_ARY_TRIM_DONE_MASK (0x1U) -#define FMUTEST_RESET_STATUS_ARY_TRIM_DONE_SHIFT (0U) -/*! ARY_TRIM_DONE - Array Trim Complete - * 0b0..Recall register load operation has not been completed - * 0b1..Recall register load operation has completed - */ -#define FMUTEST_RESET_STATUS_ARY_TRIM_DONE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_ARY_TRIM_DONE_SHIFT)) & FMUTEST_RESET_STATUS_ARY_TRIM_DONE_MASK) - -#define FMUTEST_RESET_STATUS_FMU_PARM_EN_MASK (0x2U) -#define FMUTEST_RESET_STATUS_FMU_PARM_EN_SHIFT (1U) -/*! FMU_PARM_EN - Status of the C0DE_C0DEh check to enable loading of the FMU parameters - * 0b0..C0DE_C0DEh check not attempted - * 0b1..C0DE_C0DEh check completed - */ -#define FMUTEST_RESET_STATUS_FMU_PARM_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_FMU_PARM_EN_SHIFT)) & FMUTEST_RESET_STATUS_FMU_PARM_EN_MASK) - -#define FMUTEST_RESET_STATUS_FMU_PARM_DONE_MASK (0x4U) -#define FMUTEST_RESET_STATUS_FMU_PARM_DONE_SHIFT (2U) -/*! FMU_PARM_DONE - FMU Register Load Complete - * 0b0..FMU registers have not been loaded - * 0b1..FMU registers have been loaded - */ -#define FMUTEST_RESET_STATUS_FMU_PARM_DONE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_FMU_PARM_DONE_SHIFT)) & FMUTEST_RESET_STATUS_FMU_PARM_DONE_MASK) - -#define FMUTEST_RESET_STATUS_SOC_TRIM_EN_MASK (0x8U) -#define FMUTEST_RESET_STATUS_SOC_TRIM_EN_SHIFT (3U) -/*! SOC_TRIM_EN - Status of the C0DE_C0DEh check to enable loading of the SoC trim settings - * 0b0..C0DE_C0DEh check not attempted - * 0b1..C0DE_C0DEh check completed - */ -#define FMUTEST_RESET_STATUS_SOC_TRIM_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_SOC_TRIM_EN_SHIFT)) & FMUTEST_RESET_STATUS_SOC_TRIM_EN_MASK) - -#define FMUTEST_RESET_STATUS_SOC_TRIM_ECC_MASK (0x10U) -#define FMUTEST_RESET_STATUS_SOC_TRIM_ECC_SHIFT (4U) -/*! SOC_TRIM_ECC - Status of the C0DE_C0DEh check for enabling ECC decoder during reads of SoC trim settings - * 0b0..C0DE_C0DEh check failed - * 0b1..C0DE_C0DEh check passed - */ -#define FMUTEST_RESET_STATUS_SOC_TRIM_ECC(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_SOC_TRIM_ECC_SHIFT)) & FMUTEST_RESET_STATUS_SOC_TRIM_ECC_MASK) - -#define FMUTEST_RESET_STATUS_SOC_TRIM_DONE_MASK (0x20U) -#define FMUTEST_RESET_STATUS_SOC_TRIM_DONE_SHIFT (5U) -/*! SOC_TRIM_DONE - SoC Trim Complete - * 0b0..SoC Trim registers have not been updated - * 0b1..All SoC Trim registers have been updated - */ -#define FMUTEST_RESET_STATUS_SOC_TRIM_DONE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_SOC_TRIM_DONE_SHIFT)) & FMUTEST_RESET_STATUS_SOC_TRIM_DONE_MASK) - -#define FMUTEST_RESET_STATUS_RPR_DONE_MASK (0x40U) -#define FMUTEST_RESET_STATUS_RPR_DONE_SHIFT (6U) -/*! RPR_DONE - Array Repair Complete - * 0b0..Repair registers have not been loaded - * 0b1..Repair registers have been loaded - */ -#define FMUTEST_RESET_STATUS_RPR_DONE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_RPR_DONE_SHIFT)) & FMUTEST_RESET_STATUS_RPR_DONE_MASK) - -#define FMUTEST_RESET_STATUS_INIT_DONE_MASK (0x80U) -#define FMUTEST_RESET_STATUS_INIT_DONE_SHIFT (7U) -/*! INIT_DONE - Initialization Done - * 0b0..All initialization steps did not complete - * 0b1..All initialization steps completed - */ -#define FMUTEST_RESET_STATUS_INIT_DONE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_INIT_DONE_SHIFT)) & FMUTEST_RESET_STATUS_INIT_DONE_MASK) - -#define FMUTEST_RESET_STATUS_RST_SF_ERR_MASK (0x100U) -#define FMUTEST_RESET_STATUS_RST_SF_ERR_SHIFT (8U) -/*! RST_SF_ERR - ECC Single Fault during Reset Recovery - * 0b0..No single-bit faults detected during initialization - * 0b1..At least one single ECC fault was detected during initialization - */ -#define FMUTEST_RESET_STATUS_RST_SF_ERR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_RST_SF_ERR_SHIFT)) & FMUTEST_RESET_STATUS_RST_SF_ERR_MASK) - -#define FMUTEST_RESET_STATUS_RST_DF_ERR_MASK (0x200U) -#define FMUTEST_RESET_STATUS_RST_DF_ERR_SHIFT (9U) -/*! RST_DF_ERR - ECC Double Fault during Reset Recovery - * 0b0..No double-bit faults detected during initialization - * 0b1..Double-bit ECC fault was detected during initialization - */ -#define FMUTEST_RESET_STATUS_RST_DF_ERR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_RST_DF_ERR_SHIFT)) & FMUTEST_RESET_STATUS_RST_DF_ERR_MASK) - -#define FMUTEST_RESET_STATUS_SOC_TRIM_DF_ERR_MASK (0x3FC00U) -#define FMUTEST_RESET_STATUS_SOC_TRIM_DF_ERR_SHIFT (10U) -/*! SOC_TRIM_DF_ERR - ECC Double Fault during load of SoC Trim phrases */ -#define FMUTEST_RESET_STATUS_SOC_TRIM_DF_ERR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_SOC_TRIM_DF_ERR_SHIFT)) & FMUTEST_RESET_STATUS_SOC_TRIM_DF_ERR_MASK) - -#define FMUTEST_RESET_STATUS_RST_PATCH_LD_MASK (0x40000U) -#define FMUTEST_RESET_STATUS_RST_PATCH_LD_SHIFT (18U) -/*! RST_PATCH_LD - Reset Patch Required - * 0b0..No patch required to be loaded during reset - * 0b1..Patch loaded during reset - */ -#define FMUTEST_RESET_STATUS_RST_PATCH_LD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_RST_PATCH_LD_SHIFT)) & FMUTEST_RESET_STATUS_RST_PATCH_LD_MASK) - -#define FMUTEST_RESET_STATUS_RECALL_DATA_MISMATCH_MASK (0x80000U) -#define FMUTEST_RESET_STATUS_RECALL_DATA_MISMATCH_SHIFT (19U) -/*! RECALL_DATA_MISMATCH - Recall Data Mismatch - * 0b0..Data read towards end of reset matched data read for Recall - * 0b1..Data read towards end of reset did not match data read for recall - */ -#define FMUTEST_RESET_STATUS_RECALL_DATA_MISMATCH(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_RECALL_DATA_MISMATCH_SHIFT)) & FMUTEST_RESET_STATUS_RECALL_DATA_MISMATCH_MASK) -/*! @} */ - -/*! @name MCTL - FMU Control Register */ -/*! @{ */ - -#define FMUTEST_MCTL_COREHLD_MASK (0x1U) -#define FMUTEST_MCTL_COREHLD_SHIFT (0U) -/*! COREHLD - Core Hold - * 0b0..CPU access is allowed - * 0b1..CPU access must be blocked - */ -#define FMUTEST_MCTL_COREHLD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_COREHLD_SHIFT)) & FMUTEST_MCTL_COREHLD_MASK) - -#define FMUTEST_MCTL_LSACT_EN_MASK (0x4U) -#define FMUTEST_MCTL_LSACT_EN_SHIFT (2U) -/*! LSACT_EN - LSACTIVE Feature Enable - * 0b0..LSACTIVE feature disabled completely: FCTRL[LSACTIVE] is forced low and no longer writable, LVE cannot assert at the TSMC array interface. - * 0b1..LSACTIVE feature fully enabled and controllable by SoC and internal UINT SM. - */ -#define FMUTEST_MCTL_LSACT_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_LSACT_EN_SHIFT)) & FMUTEST_MCTL_LSACT_EN_MASK) - -#define FMUTEST_MCTL_LSACTWREN_MASK (0x8U) -#define FMUTEST_MCTL_LSACTWREN_SHIFT (3U) -/*! LSACTWREN - LSACTIVE Write Enable - * 0b0..Unrestricted write access allowed - * 0b1..Write access while CMP set must match CMDDID and CMDPRT - */ -#define FMUTEST_MCTL_LSACTWREN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_LSACTWREN_SHIFT)) & FMUTEST_MCTL_LSACTWREN_MASK) - -#define FMUTEST_MCTL_MASTER_REPAIR_EN_MASK (0x10U) -#define FMUTEST_MCTL_MASTER_REPAIR_EN_SHIFT (4U) -/*! MASTER_REPAIR_EN - Master Repair Enable - * 0b0..Repair disabled - * 0b1..Repair enable determined by bit 0 of each REPAIR register - */ -#define FMUTEST_MCTL_MASTER_REPAIR_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_MASTER_REPAIR_EN_SHIFT)) & FMUTEST_MCTL_MASTER_REPAIR_EN_MASK) - -#define FMUTEST_MCTL_RFCMDEN_MASK (0x20U) -#define FMUTEST_MCTL_RFCMDEN_SHIFT (5U) -/*! RFCMDEN - RF Active Command Enable Control - * 0b0..Flash commands blocked (CCIF not writable) - * 0b1..Flash commands allowed - */ -#define FMUTEST_MCTL_RFCMDEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_RFCMDEN_SHIFT)) & FMUTEST_MCTL_RFCMDEN_MASK) - -#define FMUTEST_MCTL_CWSABTEN_MASK (0x40U) -#define FMUTEST_MCTL_CWSABTEN_SHIFT (6U) -/*! CWSABTEN - Command Write Sequence Abort Enable - * 0b0..CWS abort feature is disabled - * 0b1..CWS abort feature is enabled - */ -#define FMUTEST_MCTL_CWSABTEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_CWSABTEN_SHIFT)) & FMUTEST_MCTL_CWSABTEN_MASK) - -#define FMUTEST_MCTL_MRGRDDIS_MASK (0x80U) -#define FMUTEST_MCTL_MRGRDDIS_SHIFT (7U) -/*! MRGRDDIS - Margin Read Disable - * 0b0..Margin Read Settings are enabled - * 0b1..Margin Read Settings are disabled - */ -#define FMUTEST_MCTL_MRGRDDIS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_MRGRDDIS_SHIFT)) & FMUTEST_MCTL_MRGRDDIS_MASK) - -#define FMUTEST_MCTL_MRGRD0_MASK (0xF00U) -#define FMUTEST_MCTL_MRGRD0_SHIFT (8U) -/*! MRGRD0 - Margin Read Setting for Program */ -#define FMUTEST_MCTL_MRGRD0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_MRGRD0_SHIFT)) & FMUTEST_MCTL_MRGRD0_MASK) - -#define FMUTEST_MCTL_MRGRD1_MASK (0xF000U) -#define FMUTEST_MCTL_MRGRD1_SHIFT (12U) -/*! MRGRD1 - Margin Read Setting for Erase */ -#define FMUTEST_MCTL_MRGRD1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_MRGRD1_SHIFT)) & FMUTEST_MCTL_MRGRD1_MASK) - -#define FMUTEST_MCTL_ERSAACK_MASK (0x10000U) -#define FMUTEST_MCTL_ERSAACK_SHIFT (16U) -/*! ERSAACK - Mass Erase (Erase All) Acknowledge - * 0b0..Mass Erase operation is not active (operation has completed or has not started) - * 0b1..Mass Erase operation is active (controller acknowledges that the soc_ersall_req input is asserted and will continue with the operation) - */ -#define FMUTEST_MCTL_ERSAACK(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_ERSAACK_SHIFT)) & FMUTEST_MCTL_ERSAACK_MASK) - -#define FMUTEST_MCTL_SCAN_OBS_MASK (0x80000U) -#define FMUTEST_MCTL_SCAN_OBS_SHIFT (19U) -/*! SCAN_OBS - Scan Observability Control - * 0b0..Normal functional behavior - * 0b1..Enables observation of signals that may otherwise be ATPG untestable - */ -#define FMUTEST_MCTL_SCAN_OBS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_SCAN_OBS_SHIFT)) & FMUTEST_MCTL_SCAN_OBS_MASK) - -#define FMUTEST_MCTL_BIST_CTL_MASK (0x100000U) -#define FMUTEST_MCTL_BIST_CTL_SHIFT (20U) -/*! BIST_CTL - BIST IP Control - * 0b0..BIST IP disabled - * 0b1..BIST IP enabled - */ -#define FMUTEST_MCTL_BIST_CTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_BIST_CTL_SHIFT)) & FMUTEST_MCTL_BIST_CTL_MASK) - -#define FMUTEST_MCTL_SMWR_CTL_MASK (0x200000U) -#define FMUTEST_MCTL_SMWR_CTL_SHIFT (21U) -/*! SMWR_CTL - SMWR IP Control - * 0b0..SMWR IP disabled - * 0b1..SMWR IP enabled - */ -#define FMUTEST_MCTL_SMWR_CTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_SMWR_CTL_SHIFT)) & FMUTEST_MCTL_SMWR_CTL_MASK) - -#define FMUTEST_MCTL_SALV_DIS_MASK (0x1000000U) -#define FMUTEST_MCTL_SALV_DIS_SHIFT (24U) -/*! SALV_DIS - Salvage Disable - * 0b0..Salvage enabled (ECC used during erase verify) - * 0b1..Salvage disabled (ECC not used during erase verify) - */ -#define FMUTEST_MCTL_SALV_DIS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_SALV_DIS_SHIFT)) & FMUTEST_MCTL_SALV_DIS_MASK) - -#define FMUTEST_MCTL_SOC_ECC_CTL_MASK (0x2000000U) -#define FMUTEST_MCTL_SOC_ECC_CTL_SHIFT (25U) -/*! SOC_ECC_CTL - SOC ECC Control - * 0b0..ECC is enabled for SOC read access - * 0b1..ECC is disabled for SOC read access - */ -#define FMUTEST_MCTL_SOC_ECC_CTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_SOC_ECC_CTL_SHIFT)) & FMUTEST_MCTL_SOC_ECC_CTL_MASK) - -#define FMUTEST_MCTL_FMU_ECC_CTL_MASK (0x4000000U) -#define FMUTEST_MCTL_FMU_ECC_CTL_SHIFT (26U) -/*! FMU_ECC_CTL - FMU ECC Control - * 0b0..ECC is enabled for FMU program operations - * 0b1..ECC is disabled for FMU program operations - */ -#define FMUTEST_MCTL_FMU_ECC_CTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_FMU_ECC_CTL_SHIFT)) & FMUTEST_MCTL_FMU_ECC_CTL_MASK) - -#define FMUTEST_MCTL_BIST_PWR_DIS_MASK (0x20000000U) -#define FMUTEST_MCTL_BIST_PWR_DIS_SHIFT (29U) -/*! BIST_PWR_DIS - BIST Power Mode Disable - * 0b0..BIST DFT logic has full control of SLM and LVE when BIST is enabled (including during commands) - * 0b1..BIST DFT logic has no control of SLM and LVE; power mode RTL is in complete control of SLM and LVE values - */ -#define FMUTEST_MCTL_BIST_PWR_DIS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_BIST_PWR_DIS_SHIFT)) & FMUTEST_MCTL_BIST_PWR_DIS_MASK) - -#define FMUTEST_MCTL_OSC_H_MASK (0x80000000U) -#define FMUTEST_MCTL_OSC_H_SHIFT (31U) -/*! OSC_H - Oscillator control - * 0b0..Use APB clock - * 0b1..Use a known fixed-frequency clock, e.g. 12 MHz - */ -#define FMUTEST_MCTL_OSC_H(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_OSC_H_SHIFT)) & FMUTEST_MCTL_OSC_H_MASK) -/*! @} */ - -/*! @name BSEL_GEN - FMU Block Select Generation Register */ -/*! @{ */ - -#define FMUTEST_BSEL_GEN_SBSEL_GEN_MASK (0x3U) -#define FMUTEST_BSEL_GEN_SBSEL_GEN_SHIFT (0U) -/*! SBSEL_GEN - Generated SBSEL */ -#define FMUTEST_BSEL_GEN_SBSEL_GEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BSEL_GEN_SBSEL_GEN_SHIFT)) & FMUTEST_BSEL_GEN_SBSEL_GEN_MASK) - -#define FMUTEST_BSEL_GEN_MBSEL_GEN_MASK (0x300U) -#define FMUTEST_BSEL_GEN_MBSEL_GEN_SHIFT (8U) -/*! MBSEL_GEN - Generated MBSEL */ -#define FMUTEST_BSEL_GEN_MBSEL_GEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BSEL_GEN_MBSEL_GEN_SHIFT)) & FMUTEST_BSEL_GEN_MBSEL_GEN_MASK) -/*! @} */ - -/*! @name PWR_OPT - Power Mode Options Register */ -/*! @{ */ - -#define FMUTEST_PWR_OPT_PD_CDIV_MASK (0xFFU) -#define FMUTEST_PWR_OPT_PD_CDIV_SHIFT (0U) -/*! PD_CDIV - Power Down Clock Divider Setting */ -#define FMUTEST_PWR_OPT_PD_CDIV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PWR_OPT_PD_CDIV_SHIFT)) & FMUTEST_PWR_OPT_PD_CDIV_MASK) - -#define FMUTEST_PWR_OPT_SLM_COUNT_MASK (0x3FF0000U) -#define FMUTEST_PWR_OPT_SLM_COUNT_SHIFT (16U) -/*! SLM_COUNT - Sleep Recovery Timer Count */ -#define FMUTEST_PWR_OPT_SLM_COUNT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PWR_OPT_SLM_COUNT_SHIFT)) & FMUTEST_PWR_OPT_SLM_COUNT_MASK) - -#define FMUTEST_PWR_OPT_PD_TIMER_EN_MASK (0x80000000U) -#define FMUTEST_PWR_OPT_PD_TIMER_EN_SHIFT (31U) -/*! PD_TIMER_EN - Power Down BIST Timer Enable - * 0b0..BIST timer is not triggered during Power Down recovery - * 0b1..BIST timer is triggered during Power Down recovery (default behavior) - */ -#define FMUTEST_PWR_OPT_PD_TIMER_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PWR_OPT_PD_TIMER_EN_SHIFT)) & FMUTEST_PWR_OPT_PD_TIMER_EN_MASK) -/*! @} */ - -/*! @name CMD_CHECK - FMU Command Check Register */ -/*! @{ */ - -#define FMUTEST_CMD_CHECK_ALIGNFAIL_PHR_MASK (0x1U) -#define FMUTEST_CMD_CHECK_ALIGNFAIL_PHR_SHIFT (0U) -/*! ALIGNFAIL_PHR - Phrase Alignment Fail - * 0b0..The address is phrase-aligned - * 0b1..The address is not phrase-aligned - */ -#define FMUTEST_CMD_CHECK_ALIGNFAIL_PHR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ALIGNFAIL_PHR_SHIFT)) & FMUTEST_CMD_CHECK_ALIGNFAIL_PHR_MASK) - -#define FMUTEST_CMD_CHECK_ALIGNFAIL_PG_MASK (0x2U) -#define FMUTEST_CMD_CHECK_ALIGNFAIL_PG_SHIFT (1U) -/*! ALIGNFAIL_PG - Page Alignment Fail - * 0b0..The address is page-aligned - * 0b1..The address is not page-aligned - */ -#define FMUTEST_CMD_CHECK_ALIGNFAIL_PG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ALIGNFAIL_PG_SHIFT)) & FMUTEST_CMD_CHECK_ALIGNFAIL_PG_MASK) - -#define FMUTEST_CMD_CHECK_ALIGNFAIL_SCR_MASK (0x4U) -#define FMUTEST_CMD_CHECK_ALIGNFAIL_SCR_SHIFT (2U) -/*! ALIGNFAIL_SCR - Sector Alignment Fail - * 0b0..The address is sector-aligned - * 0b1..The address is not sector-aligned - */ -#define FMUTEST_CMD_CHECK_ALIGNFAIL_SCR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ALIGNFAIL_SCR_SHIFT)) & FMUTEST_CMD_CHECK_ALIGNFAIL_SCR_MASK) - -#define FMUTEST_CMD_CHECK_ALIGNFAIL_BLK_MASK (0x8U) -#define FMUTEST_CMD_CHECK_ALIGNFAIL_BLK_SHIFT (3U) -/*! ALIGNFAIL_BLK - Block Alignment Fail - * 0b0..The address is block-aligned - * 0b1..The address is not block-aligned - */ -#define FMUTEST_CMD_CHECK_ALIGNFAIL_BLK(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ALIGNFAIL_BLK_SHIFT)) & FMUTEST_CMD_CHECK_ALIGNFAIL_BLK_MASK) - -#define FMUTEST_CMD_CHECK_ADDR_FAIL_MASK (0x10U) -#define FMUTEST_CMD_CHECK_ADDR_FAIL_SHIFT (4U) -/*! ADDR_FAIL - Address Fail - * 0b0..The address is within the flash or IFR address space - * 0b1..The address is outside the flash or IFR address space - */ -#define FMUTEST_CMD_CHECK_ADDR_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ADDR_FAIL_SHIFT)) & FMUTEST_CMD_CHECK_ADDR_FAIL_MASK) - -#define FMUTEST_CMD_CHECK_IFR_CMD_MASK (0x20U) -#define FMUTEST_CMD_CHECK_IFR_CMD_SHIFT (5U) -/*! IFR_CMD - IFR Command - * 0b0..The command operates on a main flash address - * 0b1..The command operates on an IFR address - */ -#define FMUTEST_CMD_CHECK_IFR_CMD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_IFR_CMD_SHIFT)) & FMUTEST_CMD_CHECK_IFR_CMD_MASK) - -#define FMUTEST_CMD_CHECK_ALL_CMD_MASK (0x40U) -#define FMUTEST_CMD_CHECK_ALL_CMD_SHIFT (6U) -/*! ALL_CMD - All Blocks Command - * 0b0..The command operates on a single flash block - * 0b1..The command operates on all flash blocks - */ -#define FMUTEST_CMD_CHECK_ALL_CMD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ALL_CMD_SHIFT)) & FMUTEST_CMD_CHECK_ALL_CMD_MASK) - -#define FMUTEST_CMD_CHECK_RANGE_FAIL_MASK (0x80U) -#define FMUTEST_CMD_CHECK_RANGE_FAIL_SHIFT (7U) -/*! RANGE_FAIL - Address Range Fail - * 0b0..The address range is valid - * 0b1..The address range is invalid - */ -#define FMUTEST_CMD_CHECK_RANGE_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_RANGE_FAIL_SHIFT)) & FMUTEST_CMD_CHECK_RANGE_FAIL_MASK) - -#define FMUTEST_CMD_CHECK_SCR_ALIGN_CHK_MASK (0x100U) -#define FMUTEST_CMD_CHECK_SCR_ALIGN_CHK_SHIFT (8U) -/*! SCR_ALIGN_CHK - Sector Alignment Check - * 0b0..No sector alignment check - * 0b1..Sector alignment check - */ -#define FMUTEST_CMD_CHECK_SCR_ALIGN_CHK(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_SCR_ALIGN_CHK_SHIFT)) & FMUTEST_CMD_CHECK_SCR_ALIGN_CHK_MASK) - -#define FMUTEST_CMD_CHECK_OPTION_FAIL_MASK (0x200U) -#define FMUTEST_CMD_CHECK_OPTION_FAIL_SHIFT (9U) -/*! OPTION_FAIL - Option Check Fail - * 0b0..Option check passes for read command or command is not a read command - * 0b1..Option check fails for read command - */ -#define FMUTEST_CMD_CHECK_OPTION_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_OPTION_FAIL_SHIFT)) & FMUTEST_CMD_CHECK_OPTION_FAIL_MASK) - -#define FMUTEST_CMD_CHECK_ILLEGAL_CMD_MASK (0x400U) -#define FMUTEST_CMD_CHECK_ILLEGAL_CMD_SHIFT (10U) -/*! ILLEGAL_CMD - Illegal Command - * 0b0..Command is legal - * 0b1..Command is illegal - */ -#define FMUTEST_CMD_CHECK_ILLEGAL_CMD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ILLEGAL_CMD_SHIFT)) & FMUTEST_CMD_CHECK_ILLEGAL_CMD_MASK) -/*! @} */ - -/*! @name BSEL - FMU Block Select Register */ -/*! @{ */ - -#define FMUTEST_BSEL_SBSEL_MASK (0x3U) -#define FMUTEST_BSEL_SBSEL_SHIFT (0U) -/*! SBSEL - Slave Block Select */ -#define FMUTEST_BSEL_SBSEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BSEL_SBSEL_SHIFT)) & FMUTEST_BSEL_SBSEL_MASK) - -#define FMUTEST_BSEL_MBSEL_MASK (0x300U) -#define FMUTEST_BSEL_MBSEL_SHIFT (8U) -/*! MBSEL - Master Block Select */ -#define FMUTEST_BSEL_MBSEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BSEL_MBSEL_SHIFT)) & FMUTEST_BSEL_MBSEL_MASK) -/*! @} */ - -/*! @name MSIZE - FMU Memory Size Register */ -/*! @{ */ - -#define FMUTEST_MSIZE_MAXADDR0_MASK (0xFFU) -#define FMUTEST_MSIZE_MAXADDR0_SHIFT (0U) -/*! MAXADDR0 - Size of Flash Block 0 */ -#define FMUTEST_MSIZE_MAXADDR0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MSIZE_MAXADDR0_SHIFT)) & FMUTEST_MSIZE_MAXADDR0_MASK) - -#define FMUTEST_MSIZE_MAXADDR1_MASK (0xFF00U) -#define FMUTEST_MSIZE_MAXADDR1_SHIFT (8U) -/*! MAXADDR1 - Size of Flash Block 1 */ -#define FMUTEST_MSIZE_MAXADDR1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MSIZE_MAXADDR1_SHIFT)) & FMUTEST_MSIZE_MAXADDR1_MASK) -/*! @} */ - -/*! @name FLASH_RD_ADD - Flash Read Address Register */ -/*! @{ */ - -#define FMUTEST_FLASH_RD_ADD_FLASH_RD_ADD_MASK (0xFFFFFFFFU) -#define FMUTEST_FLASH_RD_ADD_FLASH_RD_ADD_SHIFT (0U) -/*! FLASH_RD_ADD - Flash Read Address */ -#define FMUTEST_FLASH_RD_ADD_FLASH_RD_ADD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FLASH_RD_ADD_FLASH_RD_ADD_SHIFT)) & FMUTEST_FLASH_RD_ADD_FLASH_RD_ADD_MASK) -/*! @} */ - -/*! @name FLASH_STOP_ADD - Flash Stop Address Register */ -/*! @{ */ - -#define FMUTEST_FLASH_STOP_ADD_FLASH_STOP_ADD_MASK (0xFFFFFFFFU) -#define FMUTEST_FLASH_STOP_ADD_FLASH_STOP_ADD_SHIFT (0U) -/*! FLASH_STOP_ADD - Flash Stop Address */ -#define FMUTEST_FLASH_STOP_ADD_FLASH_STOP_ADD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FLASH_STOP_ADD_FLASH_STOP_ADD_SHIFT)) & FMUTEST_FLASH_STOP_ADD_FLASH_STOP_ADD_MASK) -/*! @} */ - -/*! @name FLASH_RD_CTRL - Flash Read Control Register */ -/*! @{ */ - -#define FMUTEST_FLASH_RD_CTRL_FLASH_RD_MASK (0x1U) -#define FMUTEST_FLASH_RD_CTRL_FLASH_RD_SHIFT (0U) -/*! FLASH_RD - Flash Read Enable - * 0b0..Manual flash read not enabled.(default) - * 0b1..Manual flash read enabled - */ -#define FMUTEST_FLASH_RD_CTRL_FLASH_RD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FLASH_RD_CTRL_FLASH_RD_SHIFT)) & FMUTEST_FLASH_RD_CTRL_FLASH_RD_MASK) - -#define FMUTEST_FLASH_RD_CTRL_WIDE_LOAD_MASK (0x2U) -#define FMUTEST_FLASH_RD_CTRL_WIDE_LOAD_SHIFT (1U) -/*! WIDE_LOAD - Wide Load Enable - * 0b0..Wide load mode disabled (default) - * 0b1..Wide load mode enabled - */ -#define FMUTEST_FLASH_RD_CTRL_WIDE_LOAD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FLASH_RD_CTRL_WIDE_LOAD_SHIFT)) & FMUTEST_FLASH_RD_CTRL_WIDE_LOAD_MASK) - -#define FMUTEST_FLASH_RD_CTRL_SINGLE_RD_MASK (0x4U) -#define FMUTEST_FLASH_RD_CTRL_SINGLE_RD_SHIFT (2U) -/*! SINGLE_RD - Single Flash Read - * 0b0..Normal UINT operation - * 0b1..UINT configured for single cycle reads - */ -#define FMUTEST_FLASH_RD_CTRL_SINGLE_RD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FLASH_RD_CTRL_SINGLE_RD_SHIFT)) & FMUTEST_FLASH_RD_CTRL_SINGLE_RD_MASK) -/*! @} */ - -/*! @name MM_ADDR - Memory Map Address Register */ -/*! @{ */ - -#define FMUTEST_MM_ADDR_MM_ADDR_MASK (0xFFFFFFFFU) -#define FMUTEST_MM_ADDR_MM_ADDR_SHIFT (0U) -/*! MM_ADDR - Memory Map Address */ -#define FMUTEST_MM_ADDR_MM_ADDR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MM_ADDR_MM_ADDR_SHIFT)) & FMUTEST_MM_ADDR_MM_ADDR_MASK) -/*! @} */ - -/*! @name MM_WDATA - Memory Map Write Data Register */ -/*! @{ */ - -#define FMUTEST_MM_WDATA_MM_WDATA_MASK (0xFFFFFFFFU) -#define FMUTEST_MM_WDATA_MM_WDATA_SHIFT (0U) -/*! MM_WDATA - Memory Map Write Data */ -#define FMUTEST_MM_WDATA_MM_WDATA(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MM_WDATA_MM_WDATA_SHIFT)) & FMUTEST_MM_WDATA_MM_WDATA_MASK) -/*! @} */ - -/*! @name MM_CTL - Memory Map Control Register */ -/*! @{ */ - -#define FMUTEST_MM_CTL_MM_SEL_MASK (0x1U) -#define FMUTEST_MM_CTL_MM_SEL_SHIFT (0U) -/*! MM_SEL - Register Access Enable */ -#define FMUTEST_MM_CTL_MM_SEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MM_CTL_MM_SEL_SHIFT)) & FMUTEST_MM_CTL_MM_SEL_MASK) - -#define FMUTEST_MM_CTL_MM_RD_MASK (0x2U) -#define FMUTEST_MM_CTL_MM_RD_SHIFT (1U) -/*! MM_RD - Register R/W Control - * 0b0..Write to register - * 0b1..Read register - */ -#define FMUTEST_MM_CTL_MM_RD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MM_CTL_MM_RD_SHIFT)) & FMUTEST_MM_CTL_MM_RD_MASK) - -#define FMUTEST_MM_CTL_BIST_ON_MASK (0x4U) -#define FMUTEST_MM_CTL_BIST_ON_SHIFT (2U) -/*! BIST_ON - BIST on - * 0b0..BIST enable not forced by user interface - * 0b1..BIST enable control by user interface - */ -#define FMUTEST_MM_CTL_BIST_ON(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MM_CTL_BIST_ON_SHIFT)) & FMUTEST_MM_CTL_BIST_ON_MASK) - -#define FMUTEST_MM_CTL_FORCE_SW_CLK_MASK (0x8U) -#define FMUTEST_MM_CTL_FORCE_SW_CLK_SHIFT (3U) -/*! FORCE_SW_CLK - Force Switch Clock - * 0b0..Switch clock not forced on (gated normally) - * 0b1..Switch clock forced on - */ -#define FMUTEST_MM_CTL_FORCE_SW_CLK(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MM_CTL_FORCE_SW_CLK_SHIFT)) & FMUTEST_MM_CTL_FORCE_SW_CLK_MASK) -/*! @} */ - -/*! @name UINT_CTL - User Interface Control Register */ -/*! @{ */ - -#define FMUTEST_UINT_CTL_SET_FAIL_MASK (0x1U) -#define FMUTEST_UINT_CTL_SET_FAIL_SHIFT (0U) -/*! SET_FAIL - Set Fail On Exit - * 0b0..FAIL flag should not be set on command exit (no failure detected) - * 0b1..FAIL flag should be set on command exit - */ -#define FMUTEST_UINT_CTL_SET_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_UINT_CTL_SET_FAIL_SHIFT)) & FMUTEST_UINT_CTL_SET_FAIL_MASK) - -#define FMUTEST_UINT_CTL_DBERR_MASK (0x2U) -#define FMUTEST_UINT_CTL_DBERR_SHIFT (1U) -/*! DBERR - Double-Bit ECC Fault Detect - * 0b0..No double-bit fault detected during UINT-driven read sequence - * 0b1..Double-bit fault detected during UINT-driven read sequence - */ -#define FMUTEST_UINT_CTL_DBERR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_UINT_CTL_DBERR_SHIFT)) & FMUTEST_UINT_CTL_DBERR_MASK) -/*! @} */ - -/*! @name RD_DATA0 - Read Data 0 Register */ -/*! @{ */ - -#define FMUTEST_RD_DATA0_RD_DATA0_MASK (0xFFFFFFFFU) -#define FMUTEST_RD_DATA0_RD_DATA0_SHIFT (0U) -/*! RD_DATA0 - Read Data 0 */ -#define FMUTEST_RD_DATA0_RD_DATA0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_DATA0_RD_DATA0_SHIFT)) & FMUTEST_RD_DATA0_RD_DATA0_MASK) -/*! @} */ - -/*! @name RD_DATA1 - Read Data 1 Register */ -/*! @{ */ - -#define FMUTEST_RD_DATA1_RD_DATA1_MASK (0xFFFFFFFFU) -#define FMUTEST_RD_DATA1_RD_DATA1_SHIFT (0U) -/*! RD_DATA1 - Read Data 1 */ -#define FMUTEST_RD_DATA1_RD_DATA1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_DATA1_RD_DATA1_SHIFT)) & FMUTEST_RD_DATA1_RD_DATA1_MASK) -/*! @} */ - -/*! @name RD_DATA2 - Read Data 2 Register */ -/*! @{ */ - -#define FMUTEST_RD_DATA2_RD_DATA2_MASK (0xFFFFFFFFU) -#define FMUTEST_RD_DATA2_RD_DATA2_SHIFT (0U) -/*! RD_DATA2 - Read Data 2 */ -#define FMUTEST_RD_DATA2_RD_DATA2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_DATA2_RD_DATA2_SHIFT)) & FMUTEST_RD_DATA2_RD_DATA2_MASK) -/*! @} */ - -/*! @name RD_DATA3 - Read Data 3 Register */ -/*! @{ */ - -#define FMUTEST_RD_DATA3_RD_DATA3_MASK (0xFFFFFFFFU) -#define FMUTEST_RD_DATA3_RD_DATA3_SHIFT (0U) -/*! RD_DATA3 - Read Data 3 */ -#define FMUTEST_RD_DATA3_RD_DATA3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_DATA3_RD_DATA3_SHIFT)) & FMUTEST_RD_DATA3_RD_DATA3_MASK) -/*! @} */ - -/*! @name PARITY - Parity Register */ -/*! @{ */ - -#define FMUTEST_PARITY_PARITY_MASK (0x1FFU) -#define FMUTEST_PARITY_PARITY_SHIFT (0U) -/*! PARITY - Read data [136:128] */ -#define FMUTEST_PARITY_PARITY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PARITY_PARITY_SHIFT)) & FMUTEST_PARITY_PARITY_MASK) -/*! @} */ - -/*! @name RD_PATH_CTRL_STATUS - Read Path Control and Status Register */ -/*! @{ */ - -#define FMUTEST_RD_PATH_CTRL_STATUS_RD_CAPT_MASK (0xFFU) -#define FMUTEST_RD_PATH_CTRL_STATUS_RD_CAPT_SHIFT (0U) -/*! RD_CAPT - Read Capture Clock Periods */ -#define FMUTEST_RD_PATH_CTRL_STATUS_RD_CAPT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_RD_CAPT_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_RD_CAPT_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_SE_SIZE_MASK (0xFF00U) -#define FMUTEST_RD_PATH_CTRL_STATUS_SE_SIZE_SHIFT (8U) -/*! SE_SIZE - SE Clock Periods */ -#define FMUTEST_RD_PATH_CTRL_STATUS_SE_SIZE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_SE_SIZE_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_SE_SIZE_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_ECC_ENABLEB_MASK (0x10000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_ECC_ENABLEB_SHIFT (16U) -/*! ECC_ENABLEB - ECC Decoder Control - * 0b0..ECC decoder enabled (default) - * 0b1..ECC decoder disabled - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_ECC_ENABLEB(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_ECC_ENABLEB_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_ECC_ENABLEB_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_MISR_EN_MASK (0x20000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_MISR_EN_SHIFT (17U) -/*! MISR_EN - MISR Enable - * 0b0..MISR option disabled (default) - * 0b1..MISR option enabled - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_MISR_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_MISR_EN_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_MISR_EN_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_CPY_PAR_EN_MASK (0x40000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_CPY_PAR_EN_SHIFT (18U) -/*! CPY_PAR_EN - Copy Parity Enable - * 0b0..Copy parity disabled - * 0b1..Copy parity enabled - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_CPY_PAR_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_CPY_PAR_EN_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_CPY_PAR_EN_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_BIST_MUX_TO_SMW_MASK (0x80000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_BIST_MUX_TO_SMW_SHIFT (19U) -/*! BIST_MUX_TO_SMW - BIST Mux to SMW - * 0b0..BIST drives fields - * 0b1..SMW registers drive fields - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_BIST_MUX_TO_SMW(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_BIST_MUX_TO_SMW_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_BIST_MUX_TO_SMW_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_AD_SET_MASK (0xF00000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_AD_SET_SHIFT (20U) -/*! AD_SET - Multi-Cycle Address Setup Time */ -#define FMUTEST_RD_PATH_CTRL_STATUS_AD_SET(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_AD_SET_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_AD_SET_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_EN_MASK (0x1000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_EN_SHIFT (24U) -/*! WR_PATH_EN - Write Path Enable - * 0b0..Writes to BIST setting registers driven by MM_WDATA - * 0b1..Writes to BIST setting registers driven by SMW_DIN - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_EN_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_EN_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_ECC_EN_MASK (0x2000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_ECC_EN_SHIFT (25U) -/*! WR_PATH_ECC_EN - Write Path ECC Enable - * 0b0..ECC encoding disabled - * 0b1..ECC encoding enabled - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_ECC_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_ECC_EN_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_ECC_EN_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_DBERR_REG_MASK (0x4000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_DBERR_REG_SHIFT (26U) -/*! DBERR_REG - Double-Bit Error - * 0b0..Double-bit fault not detected - * 0b1..Double-bit fault detected on previous UINT flash read - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_DBERR_REG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_DBERR_REG_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_DBERR_REG_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_SBERR_REG_MASK (0x8000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_SBERR_REG_SHIFT (27U) -/*! SBERR_REG - Single-Bit Error - * 0b0..Single-bit fault not detected - * 0b1..Single-bit fault detected on previous UINT flash read - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_SBERR_REG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_SBERR_REG_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_SBERR_REG_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_CPY_PHRASE_EN_MASK (0x10000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_CPY_PHRASE_EN_SHIFT (28U) -/*! CPY_PHRASE_EN - Copy Phrase Enable - * 0b0..Copy Flash read data disabled - * 0b1..Copy Flash read data enabled - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_CPY_PHRASE_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_CPY_PHRASE_EN_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_CPY_PHRASE_EN_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_SMW_ARRAY1_SMW0_SEL_MASK (0x20000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_SMW_ARRAY1_SMW0_SEL_SHIFT (29U) -/*! SMW_ARRAY1_SMW0_SEL - SMW_ARRAY1_SMW0_SEL - * 0b0..Select block 0 - * 0b1..Select block 1 - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_SMW_ARRAY1_SMW0_SEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_SMW_ARRAY1_SMW0_SEL_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_SMW_ARRAY1_SMW0_SEL_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_BIST_ECC_EN_MASK (0x40000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_BIST_ECC_EN_SHIFT (30U) -/*! BIST_ECC_EN - BIST ECC Enable - * 0b0..ECC correction disabled - * 0b1..ECC correction enabled - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_BIST_ECC_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_BIST_ECC_EN_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_BIST_ECC_EN_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_LAST_READ_MASK (0x80000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_LAST_READ_SHIFT (31U) -/*! LAST_READ - Last Read - * 0b0..Latest read not last in multi-address operation - * 0b1..Latest read last in multi-address operation - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_LAST_READ(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_LAST_READ_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_LAST_READ_MASK) -/*! @} */ - -/*! @name SMW_DIN0 - SMW DIN 0 Register */ -/*! @{ */ - -#define FMUTEST_SMW_DIN0_SMW_DIN0_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_DIN0_SMW_DIN0_SHIFT (0U) -/*! SMW_DIN0 - SMW DIN 0 */ -#define FMUTEST_SMW_DIN0_SMW_DIN0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_DIN0_SMW_DIN0_SHIFT)) & FMUTEST_SMW_DIN0_SMW_DIN0_MASK) -/*! @} */ - -/*! @name SMW_DIN1 - SMW DIN 1 Register */ -/*! @{ */ - -#define FMUTEST_SMW_DIN1_SMW_DIN1_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_DIN1_SMW_DIN1_SHIFT (0U) -/*! SMW_DIN1 - SMW DIN 1 */ -#define FMUTEST_SMW_DIN1_SMW_DIN1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_DIN1_SMW_DIN1_SHIFT)) & FMUTEST_SMW_DIN1_SMW_DIN1_MASK) -/*! @} */ - -/*! @name SMW_DIN2 - SMW DIN 2 Register */ -/*! @{ */ - -#define FMUTEST_SMW_DIN2_SMW_DIN2_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_DIN2_SMW_DIN2_SHIFT (0U) -/*! SMW_DIN2 - SMW DIN 2 */ -#define FMUTEST_SMW_DIN2_SMW_DIN2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_DIN2_SMW_DIN2_SHIFT)) & FMUTEST_SMW_DIN2_SMW_DIN2_MASK) -/*! @} */ - -/*! @name SMW_DIN3 - SMW DIN 3 Register */ -/*! @{ */ - -#define FMUTEST_SMW_DIN3_SMW_DIN3_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_DIN3_SMW_DIN3_SHIFT (0U) -/*! SMW_DIN3 - SMW DIN 3 */ -#define FMUTEST_SMW_DIN3_SMW_DIN3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_DIN3_SMW_DIN3_SHIFT)) & FMUTEST_SMW_DIN3_SMW_DIN3_MASK) -/*! @} */ - -/*! @name SMW_ADDR - SMW Address Register */ -/*! @{ */ - -#define FMUTEST_SMW_ADDR_SMW_ADDR_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_ADDR_SMW_ADDR_SHIFT (0U) -/*! SMW_ADDR - SMW Address */ -#define FMUTEST_SMW_ADDR_SMW_ADDR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_ADDR_SMW_ADDR_SHIFT)) & FMUTEST_SMW_ADDR_SMW_ADDR_MASK) -/*! @} */ - -/*! @name SMW_CMD_WAIT - SMW Command and Wait Register */ -/*! @{ */ - -#define FMUTEST_SMW_CMD_WAIT_CMD_MASK (0x7U) -#define FMUTEST_SMW_CMD_WAIT_CMD_SHIFT (0U) -/*! CMD - SMW Command - * 0b000..IDLE - * 0b001..ABORT - * 0b010..SME2 to one-shot mass erase - * 0b011..SME3 to sector erase on selected array - * 0b100..SMP1 to program phrase or page on selected array with shot disabled on previously programmed bit - * 0b101..Reserved for SME4 (multi-sector erase) - * 0b110..SMP2 to program phrase or page on selected array to repair cells of weak program after power loss - * 0b111..Reserved - */ -#define FMUTEST_SMW_CMD_WAIT_CMD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_CMD_WAIT_CMD_SHIFT)) & FMUTEST_SMW_CMD_WAIT_CMD_MASK) - -#define FMUTEST_SMW_CMD_WAIT_WAIT_EN_MASK (0x8U) -#define FMUTEST_SMW_CMD_WAIT_WAIT_EN_SHIFT (3U) -/*! WAIT_EN - SMW Wait Enable - * 0b0..Wait feature disabled - * 0b1..Wait feature enabled - */ -#define FMUTEST_SMW_CMD_WAIT_WAIT_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_CMD_WAIT_WAIT_EN_SHIFT)) & FMUTEST_SMW_CMD_WAIT_WAIT_EN_MASK) - -#define FMUTEST_SMW_CMD_WAIT_WAIT_AUTO_SET_MASK (0x10U) -#define FMUTEST_SMW_CMD_WAIT_WAIT_AUTO_SET_SHIFT (4U) -/*! WAIT_AUTO_SET - SMW Wait Auto Set */ -#define FMUTEST_SMW_CMD_WAIT_WAIT_AUTO_SET(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_CMD_WAIT_WAIT_AUTO_SET_SHIFT)) & FMUTEST_SMW_CMD_WAIT_WAIT_AUTO_SET_MASK) -/*! @} */ - -/*! @name SMW_STATUS - SMW Status Register */ -/*! @{ */ - -#define FMUTEST_SMW_STATUS_SMW_ERR_MASK (0x1U) -#define FMUTEST_SMW_STATUS_SMW_ERR_SHIFT (0U) -/*! SMW_ERR - SMW Error - * 0b0..Error not detected - * 0b1..Error detected - */ -#define FMUTEST_SMW_STATUS_SMW_ERR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_STATUS_SMW_ERR_SHIFT)) & FMUTEST_SMW_STATUS_SMW_ERR_MASK) - -#define FMUTEST_SMW_STATUS_SMW_BUSY_MASK (0x2U) -#define FMUTEST_SMW_STATUS_SMW_BUSY_SHIFT (1U) -/*! SMW_BUSY - SMW Busy - * 0b0..SMW command not active - * 0b1..SMW command is active - */ -#define FMUTEST_SMW_STATUS_SMW_BUSY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_STATUS_SMW_BUSY_SHIFT)) & FMUTEST_SMW_STATUS_SMW_BUSY_MASK) - -#define FMUTEST_SMW_STATUS_BIST_BUSY_MASK (0x4U) -#define FMUTEST_SMW_STATUS_BIST_BUSY_SHIFT (2U) -/*! BIST_BUSY - BIST Busy - * 0b0..BIST Command not active - * 0b1..BIST Command is active - */ -#define FMUTEST_SMW_STATUS_BIST_BUSY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_STATUS_BIST_BUSY_SHIFT)) & FMUTEST_SMW_STATUS_BIST_BUSY_MASK) -/*! @} */ - -/*! @name SOCTRIM0_0 - SoC Trim Phrase 0 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM0_0_TRIM0_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM0_0_TRIM0_0_SHIFT (0U) -/*! TRIM0_0 - TRIM0_0 */ -#define FMUTEST_SOCTRIM0_0_TRIM0_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM0_0_TRIM0_0_SHIFT)) & FMUTEST_SOCTRIM0_0_TRIM0_0_MASK) -/*! @} */ - -/*! @name SOCTRIM0_1 - SoC Trim Phrase 0 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM0_1_TRIM0_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM0_1_TRIM0_1_SHIFT (0U) -/*! TRIM0_1 - TRIM0_1 */ -#define FMUTEST_SOCTRIM0_1_TRIM0_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM0_1_TRIM0_1_SHIFT)) & FMUTEST_SOCTRIM0_1_TRIM0_1_MASK) -/*! @} */ - -/*! @name SOCTRIM0_2 - SoC Trim Phrase 0 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM0_2_TRIM0_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM0_2_TRIM0_2_SHIFT (0U) -/*! TRIM0_2 - TRIM0_2 */ -#define FMUTEST_SOCTRIM0_2_TRIM0_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM0_2_TRIM0_2_SHIFT)) & FMUTEST_SOCTRIM0_2_TRIM0_2_MASK) -/*! @} */ - -/*! @name SOCTRIM0_3 - SoC Trim Phrase 0 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM0_3_TRIM0_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM0_3_TRIM0_3_SHIFT (0U) -/*! TRIM0_3 - TRIM0_3 */ -#define FMUTEST_SOCTRIM0_3_TRIM0_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM0_3_TRIM0_3_SHIFT)) & FMUTEST_SOCTRIM0_3_TRIM0_3_MASK) -/*! @} */ - -/*! @name SOCTRIM1_0 - SoC Trim Phrase 1 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM1_0_TRIM1_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM1_0_TRIM1_0_SHIFT (0U) -/*! TRIM1_0 - TRIM1_0 */ -#define FMUTEST_SOCTRIM1_0_TRIM1_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM1_0_TRIM1_0_SHIFT)) & FMUTEST_SOCTRIM1_0_TRIM1_0_MASK) -/*! @} */ - -/*! @name SOCTRIM1_1 - SoC Trim Phrase 1 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM1_1_TRIM1_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM1_1_TRIM1_1_SHIFT (0U) -/*! TRIM1_1 - TRIM1_1 */ -#define FMUTEST_SOCTRIM1_1_TRIM1_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM1_1_TRIM1_1_SHIFT)) & FMUTEST_SOCTRIM1_1_TRIM1_1_MASK) -/*! @} */ - -/*! @name SOCTRIM1_2 - SoC Trim Phrase 1 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM1_2_TRIM1_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM1_2_TRIM1_2_SHIFT (0U) -/*! TRIM1_2 - TRIM1_2 */ -#define FMUTEST_SOCTRIM1_2_TRIM1_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM1_2_TRIM1_2_SHIFT)) & FMUTEST_SOCTRIM1_2_TRIM1_2_MASK) -/*! @} */ - -/*! @name SOCTRIM1_3 - SoC Trim Phrase 1 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM1_3_TRIM1_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM1_3_TRIM1_3_SHIFT (0U) -/*! TRIM1_3 - TRIM1_3 */ -#define FMUTEST_SOCTRIM1_3_TRIM1_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM1_3_TRIM1_3_SHIFT)) & FMUTEST_SOCTRIM1_3_TRIM1_3_MASK) -/*! @} */ - -/*! @name SOCTRIM2_0 - SoC Trim Phrase 2 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM2_0_TRIM2_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM2_0_TRIM2_0_SHIFT (0U) -/*! TRIM2_0 - TRIM2_0 */ -#define FMUTEST_SOCTRIM2_0_TRIM2_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM2_0_TRIM2_0_SHIFT)) & FMUTEST_SOCTRIM2_0_TRIM2_0_MASK) -/*! @} */ - -/*! @name SOCTRIM2_1 - SoC Trim Phrase 2 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM2_1_TRIM2_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM2_1_TRIM2_1_SHIFT (0U) -/*! TRIM2_1 - TRIM2_1 */ -#define FMUTEST_SOCTRIM2_1_TRIM2_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM2_1_TRIM2_1_SHIFT)) & FMUTEST_SOCTRIM2_1_TRIM2_1_MASK) -/*! @} */ - -/*! @name SOCTRIM2_2 - SoC Trim Phrase 2 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM2_2_TRIM2_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM2_2_TRIM2_2_SHIFT (0U) -/*! TRIM2_2 - TRIM2_2 */ -#define FMUTEST_SOCTRIM2_2_TRIM2_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM2_2_TRIM2_2_SHIFT)) & FMUTEST_SOCTRIM2_2_TRIM2_2_MASK) -/*! @} */ - -/*! @name SOCTRIM2_3 - SoC Trim Phrase 2 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM2_3_TRIM2_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM2_3_TRIM2_3_SHIFT (0U) -/*! TRIM2_3 - TRIM2_3 */ -#define FMUTEST_SOCTRIM2_3_TRIM2_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM2_3_TRIM2_3_SHIFT)) & FMUTEST_SOCTRIM2_3_TRIM2_3_MASK) -/*! @} */ - -/*! @name SOCTRIM3_0 - SoC Trim Phrase 3 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM3_0_TRIM3_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM3_0_TRIM3_0_SHIFT (0U) -/*! TRIM3_0 - TRIM3_0 */ -#define FMUTEST_SOCTRIM3_0_TRIM3_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM3_0_TRIM3_0_SHIFT)) & FMUTEST_SOCTRIM3_0_TRIM3_0_MASK) -/*! @} */ - -/*! @name SOCTRIM3_1 - SoC Trim Phrase 3 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM3_1_TRIM3_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM3_1_TRIM3_1_SHIFT (0U) -/*! TRIM3_1 - TRIM3_1 */ -#define FMUTEST_SOCTRIM3_1_TRIM3_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM3_1_TRIM3_1_SHIFT)) & FMUTEST_SOCTRIM3_1_TRIM3_1_MASK) -/*! @} */ - -/*! @name SOCTRIM3_2 - SoC Trim Phrase 3 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM3_2_TRIM3_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM3_2_TRIM3_2_SHIFT (0U) -/*! TRIM3_2 - TRIM3_2 */ -#define FMUTEST_SOCTRIM3_2_TRIM3_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM3_2_TRIM3_2_SHIFT)) & FMUTEST_SOCTRIM3_2_TRIM3_2_MASK) -/*! @} */ - -/*! @name SOCTRIM3_3 - SoC Trim Phrase 3 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM3_3_TRIM3_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM3_3_TRIM3_3_SHIFT (0U) -/*! TRIM3_3 - TRIM3_3 */ -#define FMUTEST_SOCTRIM3_3_TRIM3_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM3_3_TRIM3_3_SHIFT)) & FMUTEST_SOCTRIM3_3_TRIM3_3_MASK) -/*! @} */ - -/*! @name SOCTRIM4_0 - SoC Trim Phrase 4 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM4_0_TRIM4_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM4_0_TRIM4_0_SHIFT (0U) -/*! TRIM4_0 - TRIM4_0 */ -#define FMUTEST_SOCTRIM4_0_TRIM4_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM4_0_TRIM4_0_SHIFT)) & FMUTEST_SOCTRIM4_0_TRIM4_0_MASK) -/*! @} */ - -/*! @name SOCTRIM4_1 - SoC Trim Phrase 4 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM4_1_TRIM4_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM4_1_TRIM4_1_SHIFT (0U) -/*! TRIM4_1 - TRIM4_1 */ -#define FMUTEST_SOCTRIM4_1_TRIM4_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM4_1_TRIM4_1_SHIFT)) & FMUTEST_SOCTRIM4_1_TRIM4_1_MASK) -/*! @} */ - -/*! @name SOCTRIM4_2 - SoC Trim Phrase 4 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM4_2_TRIM4_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM4_2_TRIM4_2_SHIFT (0U) -/*! TRIM4_2 - TRIM4_2 */ -#define FMUTEST_SOCTRIM4_2_TRIM4_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM4_2_TRIM4_2_SHIFT)) & FMUTEST_SOCTRIM4_2_TRIM4_2_MASK) -/*! @} */ - -/*! @name SOCTRIM4_3 - SoC Trim Phrase 4 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM4_3_TRIM4_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM4_3_TRIM4_3_SHIFT (0U) -/*! TRIM4_3 - TRIM4_3 */ -#define FMUTEST_SOCTRIM4_3_TRIM4_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM4_3_TRIM4_3_SHIFT)) & FMUTEST_SOCTRIM4_3_TRIM4_3_MASK) -/*! @} */ - -/*! @name SOCTRIM5_0 - SoC Trim Phrase 5 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM5_0_TRIM5_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM5_0_TRIM5_0_SHIFT (0U) -/*! TRIM5_0 - TRIM5_0 */ -#define FMUTEST_SOCTRIM5_0_TRIM5_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM5_0_TRIM5_0_SHIFT)) & FMUTEST_SOCTRIM5_0_TRIM5_0_MASK) -/*! @} */ - -/*! @name SOCTRIM5_1 - SoC Trim Phrase 5 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM5_1_TRIM5_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM5_1_TRIM5_1_SHIFT (0U) -/*! TRIM5_1 - TRIM5_1 */ -#define FMUTEST_SOCTRIM5_1_TRIM5_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM5_1_TRIM5_1_SHIFT)) & FMUTEST_SOCTRIM5_1_TRIM5_1_MASK) -/*! @} */ - -/*! @name SOCTRIM5_2 - SoC Trim Phrase 5 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM5_2_TRIM5_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM5_2_TRIM5_2_SHIFT (0U) -/*! TRIM5_2 - TRIM5_2 */ -#define FMUTEST_SOCTRIM5_2_TRIM5_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM5_2_TRIM5_2_SHIFT)) & FMUTEST_SOCTRIM5_2_TRIM5_2_MASK) -/*! @} */ - -/*! @name SOCTRIM5_3 - SoC Trim Phrase 5 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM5_3_TRIM5_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM5_3_TRIM5_3_SHIFT (0U) -/*! TRIM5_3 - TRIM5_3 */ -#define FMUTEST_SOCTRIM5_3_TRIM5_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM5_3_TRIM5_3_SHIFT)) & FMUTEST_SOCTRIM5_3_TRIM5_3_MASK) -/*! @} */ - -/*! @name SOCTRIM6_0 - SoC Trim Phrase 6 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM6_0_TRIM6_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM6_0_TRIM6_0_SHIFT (0U) -/*! TRIM6_0 - TRIM6_0 */ -#define FMUTEST_SOCTRIM6_0_TRIM6_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM6_0_TRIM6_0_SHIFT)) & FMUTEST_SOCTRIM6_0_TRIM6_0_MASK) -/*! @} */ - -/*! @name SOCTRIM6_1 - SoC Trim Phrase 6 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM6_1_TRIM6_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM6_1_TRIM6_1_SHIFT (0U) -/*! TRIM6_1 - TRIM6_1 */ -#define FMUTEST_SOCTRIM6_1_TRIM6_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM6_1_TRIM6_1_SHIFT)) & FMUTEST_SOCTRIM6_1_TRIM6_1_MASK) -/*! @} */ - -/*! @name SOCTRIM6_2 - SoC Trim Phrase 6 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM6_2_TRIM6_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM6_2_TRIM6_2_SHIFT (0U) -/*! TRIM6_2 - TRIM6_2 */ -#define FMUTEST_SOCTRIM6_2_TRIM6_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM6_2_TRIM6_2_SHIFT)) & FMUTEST_SOCTRIM6_2_TRIM6_2_MASK) -/*! @} */ - -/*! @name SOCTRIM6_3 - SoC Trim Phrase 6 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM6_3_TRIM6_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM6_3_TRIM6_3_SHIFT (0U) -/*! TRIM6_3 - TRIM6_3 */ -#define FMUTEST_SOCTRIM6_3_TRIM6_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM6_3_TRIM6_3_SHIFT)) & FMUTEST_SOCTRIM6_3_TRIM6_3_MASK) -/*! @} */ - -/*! @name SOCTRIM7_0 - SoC Trim Phrase 7 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM7_0_TRIM7_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM7_0_TRIM7_0_SHIFT (0U) -/*! TRIM7_0 - TRIM7_0 */ -#define FMUTEST_SOCTRIM7_0_TRIM7_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM7_0_TRIM7_0_SHIFT)) & FMUTEST_SOCTRIM7_0_TRIM7_0_MASK) -/*! @} */ - -/*! @name SOCTRIM7_1 - SoC Trim Phrase 7 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM7_1_TRIM7_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM7_1_TRIM7_1_SHIFT (0U) -/*! TRIM7_1 - TRIM7_1 */ -#define FMUTEST_SOCTRIM7_1_TRIM7_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM7_1_TRIM7_1_SHIFT)) & FMUTEST_SOCTRIM7_1_TRIM7_1_MASK) -/*! @} */ - -/*! @name SOCTRIM7_2 - SoC Trim Phrase 7 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM7_2_TRIM7_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM7_2_TRIM7_2_SHIFT (0U) -/*! TRIM7_2 - TRIM7_2 */ -#define FMUTEST_SOCTRIM7_2_TRIM7_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM7_2_TRIM7_2_SHIFT)) & FMUTEST_SOCTRIM7_2_TRIM7_2_MASK) -/*! @} */ - -/*! @name SOCTRIM7_3 - SoC Trim Phrase 7 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM7_3_TRIM7_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM7_3_TRIM7_3_SHIFT (0U) -/*! TRIM7_3 - TRIM7_3 */ -#define FMUTEST_SOCTRIM7_3_TRIM7_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM7_3_TRIM7_3_SHIFT)) & FMUTEST_SOCTRIM7_3_TRIM7_3_MASK) -/*! @} */ - -/*! @name R_IP_CONFIG - BIST Configuration Register */ -/*! @{ */ - -#define FMUTEST_R_IP_CONFIG_IPSEL0_MASK (0x3U) -#define FMUTEST_R_IP_CONFIG_IPSEL0_SHIFT (0U) -/*! IPSEL0 - Block 0 Select Control - * 0b00..Unselect block 0 - * 0b01..not used, reserved - * 0b10..Enable block 0 test, repair off (default) - * 0b11..Enable block 0 test, repair on - */ -#define FMUTEST_R_IP_CONFIG_IPSEL0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_IPSEL0_SHIFT)) & FMUTEST_R_IP_CONFIG_IPSEL0_MASK) - -#define FMUTEST_R_IP_CONFIG_IPSEL1_MASK (0xCU) -#define FMUTEST_R_IP_CONFIG_IPSEL1_SHIFT (2U) -/*! IPSEL1 - Block 1 Select Control - * 0b00..Unselect block 1 - * 0b01..not used, reserved - * 0b10..Enable block 1 test, repair off (default) - * 0b11..Enable block 1 test, repair on - */ -#define FMUTEST_R_IP_CONFIG_IPSEL1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_IPSEL1_SHIFT)) & FMUTEST_R_IP_CONFIG_IPSEL1_MASK) - -#define FMUTEST_R_IP_CONFIG_BIST_CDIVL_MASK (0xFF0U) -#define FMUTEST_R_IP_CONFIG_BIST_CDIVL_SHIFT (4U) -/*! BIST_CDIVL - Clock Divide Scalar for Long Pulse */ -#define FMUTEST_R_IP_CONFIG_BIST_CDIVL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_BIST_CDIVL_SHIFT)) & FMUTEST_R_IP_CONFIG_BIST_CDIVL_MASK) - -#define FMUTEST_R_IP_CONFIG_CDIVS_MASK (0x7000U) -#define FMUTEST_R_IP_CONFIG_CDIVS_SHIFT (12U) -/*! CDIVS - Number of clock cycles to generate short pulse */ -#define FMUTEST_R_IP_CONFIG_CDIVS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_CDIVS_SHIFT)) & FMUTEST_R_IP_CONFIG_CDIVS_MASK) - -#define FMUTEST_R_IP_CONFIG_BIST_TVFY_MASK (0xF8000U) -#define FMUTEST_R_IP_CONFIG_BIST_TVFY_SHIFT (15U) -/*! BIST_TVFY - Timer adjust for verify */ -#define FMUTEST_R_IP_CONFIG_BIST_TVFY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_BIST_TVFY_SHIFT)) & FMUTEST_R_IP_CONFIG_BIST_TVFY_MASK) - -#define FMUTEST_R_IP_CONFIG_TSTCTL_MASK (0x300000U) -#define FMUTEST_R_IP_CONFIG_TSTCTL_SHIFT (20U) -/*! TSTCTL - BIST self-test control - * 0b00..Default, disable both BIST self-test and MISR - * 0b01..Enable BIST self-test mode DOUT from macro will be forced to '0', and disable MISR. - * 0b10..Enable MISR - * 0b11..Enable both BIST self-test mode and MISR - */ -#define FMUTEST_R_IP_CONFIG_TSTCTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_TSTCTL_SHIFT)) & FMUTEST_R_IP_CONFIG_TSTCTL_MASK) - -#define FMUTEST_R_IP_CONFIG_DBGCTL_MASK (0x400000U) -#define FMUTEST_R_IP_CONFIG_DBGCTL_SHIFT (22U) -/*! DBGCTL - Debug feature control - * 0b0..Default - * 0b1..Enable debug feature to collect failure address and data. - */ -#define FMUTEST_R_IP_CONFIG_DBGCTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_DBGCTL_SHIFT)) & FMUTEST_R_IP_CONFIG_DBGCTL_MASK) - -#define FMUTEST_R_IP_CONFIG_BIST_CLK_SEL_MASK (0x800000U) -#define FMUTEST_R_IP_CONFIG_BIST_CLK_SEL_SHIFT (23U) -/*! BIST_CLK_SEL - BIST Clock Select */ -#define FMUTEST_R_IP_CONFIG_BIST_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_BIST_CLK_SEL_SHIFT)) & FMUTEST_R_IP_CONFIG_BIST_CLK_SEL_MASK) - -#define FMUTEST_R_IP_CONFIG_SMWTST_MASK (0x3000000U) -#define FMUTEST_R_IP_CONFIG_SMWTST_SHIFT (24U) -/*! SMWTST - SMWR DOUT Function Control - * 0b00..Default - * 0b01..Enable SMWR self-test mode, DOUT from macro will be forced to all 0 - * 0b10..Enable SMWR self-test mode, DOUT from macro will be forced to all 1 - * 0b11..Reserved (unused) - */ -#define FMUTEST_R_IP_CONFIG_SMWTST(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_SMWTST_SHIFT)) & FMUTEST_R_IP_CONFIG_SMWTST_MASK) - -#define FMUTEST_R_IP_CONFIG_ECCEN_MASK (0x4000000U) -#define FMUTEST_R_IP_CONFIG_ECCEN_SHIFT (26U) -/*! ECCEN - BIST ECC Control - * 0b0..Default mode (no ECC encode or decode) - * 0b1..Enable ECC encode/decode - */ -#define FMUTEST_R_IP_CONFIG_ECCEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_ECCEN_SHIFT)) & FMUTEST_R_IP_CONFIG_ECCEN_MASK) -/*! @} */ - -/*! @name R_TESTCODE - BIST Test Code Register */ -/*! @{ */ - -#define FMUTEST_R_TESTCODE_TESTCODE_MASK (0x3FU) -#define FMUTEST_R_TESTCODE_TESTCODE_SHIFT (0U) -/*! TESTCODE - Used to store test code information before running TMR-RST/TMRSET BIST command */ -#define FMUTEST_R_TESTCODE_TESTCODE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TESTCODE_TESTCODE_SHIFT)) & FMUTEST_R_TESTCODE_TESTCODE_MASK) -/*! @} */ - -/*! @name R_DFT_CTRL - BIST DFT Control Register */ -/*! @{ */ - -#define FMUTEST_R_DFT_CTRL_DFT_XADR_MASK (0xFU) -#define FMUTEST_R_DFT_CTRL_DFT_XADR_SHIFT (0U) -/*! DFT_XADR - DFT XADR Pattern - * 0b0000..XADR fixed, no change at all - * 0b0001..XADR increased by 1 after row. For READ operation, XADR increases by 1 after reading the last word of - * row. For PROG operation, XADR increases by 1 after NVSTR falls. - * 0b0010..XADR increased for diagonal. For PROG-DIAGONAL operation, XADR is increased to create diagonal pattern. - * 0b0011..XADR increased by sector. During ERASE operation, XADR increased by number of rows in a sector when NVSTR falls. - * 0b0100..XADR inversed. XADR is inversed after reading one word or after programming one row when NVSTR falls. - * 0b0101..XADR increased by 2 after row. For READ operation, XADR is increased by 2 after reading the last word - * of a row. For PROG operation, XADR is increased by 2 when NVSTR falls. - * 0b0110..XADR[0] inversed. XADR[0] is inversed after reading one word or after programming one row when NVSTR falls. - * 0b0111..XADR increased by 1. For READ operations only, XADR increased by 1 after each read cycle. - * 0b1000..XADR decreased by 1 after row. For READ operations only, XADR is decreased by 1 after YADR decreases to 0. - * 0b1001..XADR decreased by 1. For READ operations only, XADR is decreased by 1 after each read cycle. - */ -#define FMUTEST_R_DFT_CTRL_DFT_XADR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DFT_CTRL_DFT_XADR_SHIFT)) & FMUTEST_R_DFT_CTRL_DFT_XADR_MASK) - -#define FMUTEST_R_DFT_CTRL_DFT_YADR_MASK (0xF0U) -#define FMUTEST_R_DFT_CTRL_DFT_YADR_SHIFT (4U) -/*! DFT_YADR - DFT YADR Pattern - * 0b0000..YADR fixed, no change at all - * 0b0001..YADR for ICKBD. For PROG and READ operations, YADR changed to generate inverse checkerboard pattern. - * 0b0010..YADR for CKBD. For PROG and READ operations, YADR changed to generate checkerboard pattern. - * 0b0011..YADR increased by 1. For READ operations, YADR increased by 1 after each read cycle. For PROG - * operations, YADR increased by 1 after YE falls. - * 0b0100..YADR increased for diagonal. For PROG-DIAGONAL operation, YADR is increased to create diagonal pattern. - * 0b0101..YADR inversed. YADR is inversed after reading one word or after programming one word when YE falls. - * 0b0110..YADR[0] inversed. YADR[0] is inversed after reading one word or after programming one word when YE falls. - * 0b0111..YADR increased by 1 after last row. For READ operations only, YADR is increased by 1 after XADR reaches last row. - * 0b1000..YADR decreased by 1. For READ operations only, YADR is decreased by 1 after each read cycle. - * 0b1001..YADR decreased by 1 after first row. For READ operations only, YADR is decreased by 1 after XADR decreases to 0. - */ -#define FMUTEST_R_DFT_CTRL_DFT_YADR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DFT_CTRL_DFT_YADR_SHIFT)) & FMUTEST_R_DFT_CTRL_DFT_YADR_MASK) - -#define FMUTEST_R_DFT_CTRL_DFT_DATA_MASK (0xF00U) -#define FMUTEST_R_DFT_CTRL_DFT_DATA_SHIFT (8U) -/*! DFT_DATA - DFT Data Pattern - * 0b0000..CKBD pattern. For READ operations only, compare DOUT with checkerboard data pattern for each read cycle. - * 0b0001..ICKBD pattern. For READ operations only, compare DOUT with inverse checkerboard data pattern for each read cycle. - * 0b0010..Diagonal pattern. Used for READ operations only, compare DOUT to diagonal pattern. - * 0b0011..Fixed data pattern. For READ operations, comparison to DOUT for selected groups; refer to - * R_ADR_CTRL[GRPSEL] for modules with multiple groups. - * 0b0100..Random data pattern which will be generated based on the initial seed set in R_DATA; for READ - * operations, used for DOUT comparison of selected groups. For PROG operations, used to control DIN of selected - * groups. - * 0b0101..DOUT based pattern. For READ operations only, DOUT of selected group will be latched in R_DATA. If - * more than one group is selected in R_ADR_CTRL[GRPSEL], the group with the lower index will be latched. - * 0b0110..R_DATA based pattern. For READ operations, expected DOUT value of selected groups equals to R_DATA - * when XADR[0]==YADR[0] or ~R_DATA when XADR[0]!=YADR[0]. For PROG operations, DIN of selected groups equals - * R_DATA when XADR[0]==YADR[0] or ~R_DATA when XADR[0]!=YADR[0]. - * 0b0111..SCAN-IO pattern. For READ operations, control expected DOUT value of selected groups to SCAN-IO data - * pattern. For PROG operations, control DIN of selected groups to SCAN-IO data pattern. - * 0b1000..REPAIR set. For PROG operation to IFR1(7,1) and IFR1(7,2), R_REPAIR0_0 and R_REPAIR0_1 or R_REPAIR1_0 - * and R_REPAIR1_1 will control DIN. For READ operation on IFR1(7,1) and IFR1(7,2), DOUT will be compared - * against R_REPAIR0_0 and R_REPAIR0_1 or R_REPAIR1_0 andR_REPAIR1_1. When this option is selected, only - * one flash block can be selected. - * 0b1001..REPAIR load. For READ operation only, DOUT from IFR1(7,1) and IFR1(7,2) is loaded to R_REPAIR0 and R_REPAIR1. - */ -#define FMUTEST_R_DFT_CTRL_DFT_DATA(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DFT_CTRL_DFT_DATA_SHIFT)) & FMUTEST_R_DFT_CTRL_DFT_DATA_MASK) - -#define FMUTEST_R_DFT_CTRL_CMP_MASK_MASK (0x3000U) -#define FMUTEST_R_DFT_CTRL_CMP_MASK_SHIFT (12U) -/*! CMP_MASK - Data Compare Mask - * 0b00..Expected data is compared to DOUT - * 0b01..Expected data (only 0s are considered) are compared to DOUT - * 0b10..Expected data (only 1s are considered) are compared to DOUT - */ -#define FMUTEST_R_DFT_CTRL_CMP_MASK(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DFT_CTRL_CMP_MASK_SHIFT)) & FMUTEST_R_DFT_CTRL_CMP_MASK_MASK) - -#define FMUTEST_R_DFT_CTRL_DFT_DATA_SRC_MASK (0x4000U) -#define FMUTEST_R_DFT_CTRL_DFT_DATA_SRC_SHIFT (14U) -/*! DFT_DATA_SRC - DFT Data Source - * 0b0..{R_DATA_CTRL0,R_DATA_CTRL_EX[2:0],R_DATA_CTRL0,R_DATA_CTRL_EX[2:0],R_DATA_CTRL0,R_DATA_CTRL_EX[2:0],R_DATA_CTRL0} is used - * 0b1..{R_DATA_CTRL3,R_DATA_CTRL2_EX[2:0],R_DATA_CTRL2,R_DATA_CTRL1_EX[2:0],R_DATA_CTRL1,R_DATA_CTRL_EX[2:0],R_DATA_CTRL0} is used - */ -#define FMUTEST_R_DFT_CTRL_DFT_DATA_SRC(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DFT_CTRL_DFT_DATA_SRC_SHIFT)) & FMUTEST_R_DFT_CTRL_DFT_DATA_SRC_MASK) -/*! @} */ - -/*! @name R_ADR_CTRL - BIST Address Control Register */ -/*! @{ */ - -#define FMUTEST_R_ADR_CTRL_GRPSEL_MASK (0xFU) -#define FMUTEST_R_ADR_CTRL_GRPSEL_SHIFT (0U) -/*! GRPSEL - Data Group Select - * 0b0000..Select no data - * 0b0001..Select data slice [34:0] - * 0b0010..Select data slice [69:35] - * 0b0100..Select data slice [104:70] - * 0b1000..Select data slice [136:105] - * 0b1111..Select data [136:0] - */ -#define FMUTEST_R_ADR_CTRL_GRPSEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ADR_CTRL_GRPSEL_SHIFT)) & FMUTEST_R_ADR_CTRL_GRPSEL_MASK) - -#define FMUTEST_R_ADR_CTRL_XADR_MASK (0xFFF0U) -#define FMUTEST_R_ADR_CTRL_XADR_SHIFT (4U) -/*! XADR - BIST XADR */ -#define FMUTEST_R_ADR_CTRL_XADR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ADR_CTRL_XADR_SHIFT)) & FMUTEST_R_ADR_CTRL_XADR_MASK) - -#define FMUTEST_R_ADR_CTRL_YADR_MASK (0x1F0000U) -#define FMUTEST_R_ADR_CTRL_YADR_SHIFT (16U) -/*! YADR - BIST YADR */ -#define FMUTEST_R_ADR_CTRL_YADR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ADR_CTRL_YADR_SHIFT)) & FMUTEST_R_ADR_CTRL_YADR_MASK) - -#define FMUTEST_R_ADR_CTRL_PROG_ATTR_MASK (0xE00000U) -#define FMUTEST_R_ADR_CTRL_PROG_ATTR_SHIFT (21U) -/*! PROG_ATTR - Program Attribute - * 0b000..One YE pulse will program one data slice group - * 0b001..One YE pulse will program two data slice groups - * 0b010..One YE pulse will program three data slice groups (reserved) - * 0b011..One YE pulse will program four data slice groups - * 0b100..One YE pulse will program five data slice groups (reserved) - * 0b101..One YE pulse will program six data slice groups (reserved) - * 0b110..One YE pulse will program seven data slice groups (reserved) - * 0b111..One YE pulse will program eight data slice groups (reserved) - */ -#define FMUTEST_R_ADR_CTRL_PROG_ATTR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ADR_CTRL_PROG_ATTR_SHIFT)) & FMUTEST_R_ADR_CTRL_PROG_ATTR_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL0 - BIST Data Control 0 Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL0_DATA0_MASK (0xFFFFFFFFU) -#define FMUTEST_R_DATA_CTRL0_DATA0_SHIFT (0U) -/*! DATA0 - BIST Data 0 Low */ -#define FMUTEST_R_DATA_CTRL0_DATA0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL0_DATA0_SHIFT)) & FMUTEST_R_DATA_CTRL0_DATA0_MASK) -/*! @} */ - -/*! @name R_PIN_CTRL - BIST Pin Control Register */ -/*! @{ */ - -#define FMUTEST_R_PIN_CTRL_MAS1_MASK (0x1U) -#define FMUTEST_R_PIN_CTRL_MAS1_SHIFT (0U) -/*! MAS1 - Mass Erase */ -#define FMUTEST_R_PIN_CTRL_MAS1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_MAS1_SHIFT)) & FMUTEST_R_PIN_CTRL_MAS1_MASK) - -#define FMUTEST_R_PIN_CTRL_IFREN_MASK (0x2U) -#define FMUTEST_R_PIN_CTRL_IFREN_SHIFT (1U) -/*! IFREN - IFR Enable */ -#define FMUTEST_R_PIN_CTRL_IFREN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_IFREN_SHIFT)) & FMUTEST_R_PIN_CTRL_IFREN_MASK) - -#define FMUTEST_R_PIN_CTRL_IFREN1_MASK (0x4U) -#define FMUTEST_R_PIN_CTRL_IFREN1_SHIFT (2U) -/*! IFREN1 - IFR1 Enable */ -#define FMUTEST_R_PIN_CTRL_IFREN1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_IFREN1_SHIFT)) & FMUTEST_R_PIN_CTRL_IFREN1_MASK) - -#define FMUTEST_R_PIN_CTRL_REDEN_MASK (0x8U) -#define FMUTEST_R_PIN_CTRL_REDEN_SHIFT (3U) -/*! REDEN - Redundancy Block Enable */ -#define FMUTEST_R_PIN_CTRL_REDEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_REDEN_SHIFT)) & FMUTEST_R_PIN_CTRL_REDEN_MASK) - -#define FMUTEST_R_PIN_CTRL_LVE_MASK (0x10U) -#define FMUTEST_R_PIN_CTRL_LVE_SHIFT (4U) -/*! LVE - Low Voltage Enable */ -#define FMUTEST_R_PIN_CTRL_LVE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_LVE_SHIFT)) & FMUTEST_R_PIN_CTRL_LVE_MASK) - -#define FMUTEST_R_PIN_CTRL_PV_MASK (0x20U) -#define FMUTEST_R_PIN_CTRL_PV_SHIFT (5U) -/*! PV - Program Verify Enable */ -#define FMUTEST_R_PIN_CTRL_PV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_PV_SHIFT)) & FMUTEST_R_PIN_CTRL_PV_MASK) - -#define FMUTEST_R_PIN_CTRL_EV_MASK (0x40U) -#define FMUTEST_R_PIN_CTRL_EV_SHIFT (6U) -/*! EV - Erase Verify Enable */ -#define FMUTEST_R_PIN_CTRL_EV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_EV_SHIFT)) & FMUTEST_R_PIN_CTRL_EV_MASK) - -#define FMUTEST_R_PIN_CTRL_WIPGM_MASK (0x180U) -#define FMUTEST_R_PIN_CTRL_WIPGM_SHIFT (7U) -/*! WIPGM - Program Current */ -#define FMUTEST_R_PIN_CTRL_WIPGM(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_WIPGM_SHIFT)) & FMUTEST_R_PIN_CTRL_WIPGM_MASK) - -#define FMUTEST_R_PIN_CTRL_WHV_MASK (0x1E00U) -#define FMUTEST_R_PIN_CTRL_WHV_SHIFT (9U) -/*! WHV - High Voltage Level */ -#define FMUTEST_R_PIN_CTRL_WHV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_WHV_SHIFT)) & FMUTEST_R_PIN_CTRL_WHV_MASK) - -#define FMUTEST_R_PIN_CTRL_WMV_MASK (0xE000U) -#define FMUTEST_R_PIN_CTRL_WMV_SHIFT (13U) -/*! WMV - Medium Voltage Level */ -#define FMUTEST_R_PIN_CTRL_WMV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_WMV_SHIFT)) & FMUTEST_R_PIN_CTRL_WMV_MASK) - -#define FMUTEST_R_PIN_CTRL_XE_MASK (0x10000U) -#define FMUTEST_R_PIN_CTRL_XE_SHIFT (16U) -/*! XE - X Address Enable */ -#define FMUTEST_R_PIN_CTRL_XE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_XE_SHIFT)) & FMUTEST_R_PIN_CTRL_XE_MASK) - -#define FMUTEST_R_PIN_CTRL_YE_MASK (0x20000U) -#define FMUTEST_R_PIN_CTRL_YE_SHIFT (17U) -/*! YE - Y Address Enable */ -#define FMUTEST_R_PIN_CTRL_YE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_YE_SHIFT)) & FMUTEST_R_PIN_CTRL_YE_MASK) - -#define FMUTEST_R_PIN_CTRL_SE_MASK (0x40000U) -#define FMUTEST_R_PIN_CTRL_SE_SHIFT (18U) -/*! SE - Sense Amp Enable */ -#define FMUTEST_R_PIN_CTRL_SE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_SE_SHIFT)) & FMUTEST_R_PIN_CTRL_SE_MASK) - -#define FMUTEST_R_PIN_CTRL_ERASE_MASK (0x80000U) -#define FMUTEST_R_PIN_CTRL_ERASE_SHIFT (19U) -/*! ERASE - Erase Mode */ -#define FMUTEST_R_PIN_CTRL_ERASE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_ERASE_SHIFT)) & FMUTEST_R_PIN_CTRL_ERASE_MASK) - -#define FMUTEST_R_PIN_CTRL_PROG_MASK (0x100000U) -#define FMUTEST_R_PIN_CTRL_PROG_SHIFT (20U) -/*! PROG - Program Mode */ -#define FMUTEST_R_PIN_CTRL_PROG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_PROG_SHIFT)) & FMUTEST_R_PIN_CTRL_PROG_MASK) - -#define FMUTEST_R_PIN_CTRL_NVSTR_MASK (0x200000U) -#define FMUTEST_R_PIN_CTRL_NVSTR_SHIFT (21U) -/*! NVSTR - NVM Store */ -#define FMUTEST_R_PIN_CTRL_NVSTR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_NVSTR_SHIFT)) & FMUTEST_R_PIN_CTRL_NVSTR_MASK) - -#define FMUTEST_R_PIN_CTRL_SLM_MASK (0x400000U) -#define FMUTEST_R_PIN_CTRL_SLM_SHIFT (22U) -/*! SLM - Sleep Mode Enable */ -#define FMUTEST_R_PIN_CTRL_SLM(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_SLM_SHIFT)) & FMUTEST_R_PIN_CTRL_SLM_MASK) - -#define FMUTEST_R_PIN_CTRL_RECALL_MASK (0x800000U) -#define FMUTEST_R_PIN_CTRL_RECALL_SHIFT (23U) -/*! RECALL - Recall Trim Code */ -#define FMUTEST_R_PIN_CTRL_RECALL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_RECALL_SHIFT)) & FMUTEST_R_PIN_CTRL_RECALL_MASK) - -#define FMUTEST_R_PIN_CTRL_HEM_MASK (0x1000000U) -#define FMUTEST_R_PIN_CTRL_HEM_SHIFT (24U) -/*! HEM - HEM Control */ -#define FMUTEST_R_PIN_CTRL_HEM(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_HEM_SHIFT)) & FMUTEST_R_PIN_CTRL_HEM_MASK) -/*! @} */ - -/*! @name R_CNT_LOOP_CTRL - BIST Loop Count Control Register */ -/*! @{ */ - -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPCNT_MASK (0xFFFU) -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPCNT_SHIFT (0U) -/*! LOOPCNT - Loop Count Control */ -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPCNT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_CNT_LOOP_CTRL_LOOPCNT_SHIFT)) & FMUTEST_R_CNT_LOOP_CTRL_LOOPCNT_MASK) - -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPOPT_MASK (0x7000U) -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPOPT_SHIFT (12U) -/*! LOOPOPT - Loop Option - * 0b000..Loop is disabled; selected BIST operation is run once - * 0b001..Loop is enabled; XADR increments by 1 XADR increments by 1 for each new loop. Stops when total loop count meets LOOPCNT+1. - * 0b010..Loop is enabled; YADR increments by 1 YADR increments by 1 for each new loop. Stops when total loop count meets LOOPCNT+1. - * 0b011..Loop is enabled; XADR increments by 2 XADR increments by 2 for each new loop. Stops when total loop count meets LOOPCNT+1. - * 0b100..Loop is enabled; XADR increments by sector XADR increments by 16 for each new loop. Stops when total loop count meets LOOPCNT+1. - */ -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPOPT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_CNT_LOOP_CTRL_LOOPOPT_SHIFT)) & FMUTEST_R_CNT_LOOP_CTRL_LOOPOPT_MASK) - -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPUNIT_MASK (0x38000U) -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPUNIT_SHIFT (15U) -/*! LOOPUNIT - Loop Time Unit - * 0b000..Clock cycles - * 0b001..0.5 usec - * 0b010..1 usec - * 0b011..10 usec - * 0b100..100 usec - * 0b101..1 msec - * 0b110..10 msec - * 0b111..100 msec - */ -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPUNIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_CNT_LOOP_CTRL_LOOPUNIT_SHIFT)) & FMUTEST_R_CNT_LOOP_CTRL_LOOPUNIT_MASK) - -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPDLY_MASK (0x1FC0000U) -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPDLY_SHIFT (18U) -/*! LOOPDLY - Loop Time Delay Scalar */ -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPDLY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_CNT_LOOP_CTRL_LOOPDLY_SHIFT)) & FMUTEST_R_CNT_LOOP_CTRL_LOOPDLY_MASK) -/*! @} */ - -/*! @name R_TIMER_CTRL - BIST Timer Control Register */ -/*! @{ */ - -#define FMUTEST_R_TIMER_CTRL_TNVSUNIT_MASK (0x7U) -#define FMUTEST_R_TIMER_CTRL_TNVSUNIT_SHIFT (0U) -/*! TNVSUNIT - Tnvs Time Unit - * 0b000..Clock cycles - * 0b001..0.5 usec - * 0b010..1 usec - * 0b011..10 usec - * 0b100..100 usec - * 0b101..1 msec - * 0b110..10 msec - * 0b111..100 msec - */ -#define FMUTEST_R_TIMER_CTRL_TNVSUNIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TNVSUNIT_SHIFT)) & FMUTEST_R_TIMER_CTRL_TNVSUNIT_MASK) - -#define FMUTEST_R_TIMER_CTRL_TNVSDLY_MASK (0x78U) -#define FMUTEST_R_TIMER_CTRL_TNVSDLY_SHIFT (3U) -/*! TNVSDLY - Tnvs Time Delay Scalar */ -#define FMUTEST_R_TIMER_CTRL_TNVSDLY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TNVSDLY_SHIFT)) & FMUTEST_R_TIMER_CTRL_TNVSDLY_MASK) - -#define FMUTEST_R_TIMER_CTRL_TNVHUNIT_MASK (0x380U) -#define FMUTEST_R_TIMER_CTRL_TNVHUNIT_SHIFT (7U) -/*! TNVHUNIT - Tnvh Time Unit - * 0b000..Clock cycles - * 0b001..0.5 usec - * 0b010..1 usec - * 0b011..10 usec - * 0b100..100 usec - * 0b101..1 msec - * 0b110..10 msec - * 0b111..100 msec - */ -#define FMUTEST_R_TIMER_CTRL_TNVHUNIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TNVHUNIT_SHIFT)) & FMUTEST_R_TIMER_CTRL_TNVHUNIT_MASK) - -#define FMUTEST_R_TIMER_CTRL_TNVHDLY_MASK (0x3C00U) -#define FMUTEST_R_TIMER_CTRL_TNVHDLY_SHIFT (10U) -/*! TNVHDLY - Tnvh Time Delay Scalar */ -#define FMUTEST_R_TIMER_CTRL_TNVHDLY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TNVHDLY_SHIFT)) & FMUTEST_R_TIMER_CTRL_TNVHDLY_MASK) - -#define FMUTEST_R_TIMER_CTRL_TPGSUNIT_MASK (0x1C000U) -#define FMUTEST_R_TIMER_CTRL_TPGSUNIT_SHIFT (14U) -/*! TPGSUNIT - Tpgs Time Unit - * 0b000..Clock cycles - * 0b001..0.5 usec - * 0b010..1 usec - * 0b011..10 usec - * 0b100..100 usec - * 0b101..1 msec - * 0b110..10 msec - * 0b111..100 msec - */ -#define FMUTEST_R_TIMER_CTRL_TPGSUNIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TPGSUNIT_SHIFT)) & FMUTEST_R_TIMER_CTRL_TPGSUNIT_MASK) - -#define FMUTEST_R_TIMER_CTRL_TPGSDLY_MASK (0x1E0000U) -#define FMUTEST_R_TIMER_CTRL_TPGSDLY_SHIFT (17U) -/*! TPGSDLY - Tpgs Time Delay Scalar */ -#define FMUTEST_R_TIMER_CTRL_TPGSDLY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TPGSDLY_SHIFT)) & FMUTEST_R_TIMER_CTRL_TPGSDLY_MASK) - -#define FMUTEST_R_TIMER_CTRL_TRCVUNIT_MASK (0xE00000U) -#define FMUTEST_R_TIMER_CTRL_TRCVUNIT_SHIFT (21U) -/*! TRCVUNIT - Trcv Time Unit - * 0b000..Clock cycles - * 0b001..0.5 usec - * 0b010..1 usec - * 0b011..10 usec - * 0b100..100 usec - * 0b101..1 msec - * 0b110..10 msec - * 0b111..100 msec - */ -#define FMUTEST_R_TIMER_CTRL_TRCVUNIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TRCVUNIT_SHIFT)) & FMUTEST_R_TIMER_CTRL_TRCVUNIT_MASK) - -#define FMUTEST_R_TIMER_CTRL_TRCVDLY_MASK (0xF000000U) -#define FMUTEST_R_TIMER_CTRL_TRCVDLY_SHIFT (24U) -/*! TRCVDLY - Trcv Time Delay Scalar */ -#define FMUTEST_R_TIMER_CTRL_TRCVDLY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TRCVDLY_SHIFT)) & FMUTEST_R_TIMER_CTRL_TRCVDLY_MASK) - -#define FMUTEST_R_TIMER_CTRL_TLVSUNIT_MASK (0x70000000U) -#define FMUTEST_R_TIMER_CTRL_TLVSUNIT_SHIFT (28U) -/*! TLVSUNIT - Tlvs Time Unit - * 0b000..Clock cycles - * 0b001..0.5 usec - * 0b010..1 usec - * 0b011..10 usec - * 0b100..100 usec - * 0b101..1 msec - * 0b110..10 msec - * 0b111..100 msec - */ -#define FMUTEST_R_TIMER_CTRL_TLVSUNIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TLVSUNIT_SHIFT)) & FMUTEST_R_TIMER_CTRL_TLVSUNIT_MASK) - -#define FMUTEST_R_TIMER_CTRL_TLVSDLY_L_MASK (0x80000000U) -#define FMUTEST_R_TIMER_CTRL_TLVSDLY_L_SHIFT (31U) -/*! TLVSDLY_L - Tlvs Time Delay Scalar Low */ -#define FMUTEST_R_TIMER_CTRL_TLVSDLY_L(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TLVSDLY_L_SHIFT)) & FMUTEST_R_TIMER_CTRL_TLVSDLY_L_MASK) -/*! @} */ - -/*! @name R_TEST_CTRL - BIST Test Control Register */ -/*! @{ */ - -#define FMUTEST_R_TEST_CTRL_BUSY_MASK (0x1U) -#define FMUTEST_R_TEST_CTRL_BUSY_SHIFT (0U) -/*! BUSY - BIST Busy Status - * 0b0..BIST is idle - * 0b1..BIST is busy - */ -#define FMUTEST_R_TEST_CTRL_BUSY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_BUSY_SHIFT)) & FMUTEST_R_TEST_CTRL_BUSY_MASK) - -#define FMUTEST_R_TEST_CTRL_DEBUG_MASK (0x2U) -#define FMUTEST_R_TEST_CTRL_DEBUG_SHIFT (1U) -/*! DEBUG - BIST Debug Status */ -#define FMUTEST_R_TEST_CTRL_DEBUG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_DEBUG_SHIFT)) & FMUTEST_R_TEST_CTRL_DEBUG_MASK) - -#define FMUTEST_R_TEST_CTRL_STATUS0_MASK (0x4U) -#define FMUTEST_R_TEST_CTRL_STATUS0_SHIFT (2U) -/*! STATUS0 - BIST Status 0 - * 0b0..BIST test passed on flash block 0 - * 0b1..BIST test failed on flash block 0 - */ -#define FMUTEST_R_TEST_CTRL_STATUS0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_STATUS0_SHIFT)) & FMUTEST_R_TEST_CTRL_STATUS0_MASK) - -#define FMUTEST_R_TEST_CTRL_STATUS1_MASK (0x8U) -#define FMUTEST_R_TEST_CTRL_STATUS1_SHIFT (3U) -/*! STATUS1 - BIST status 1 - * 0b0..BIST test passed on flash block 1 - * 0b1..BIST test failed on flash block 1 - */ -#define FMUTEST_R_TEST_CTRL_STATUS1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_STATUS1_SHIFT)) & FMUTEST_R_TEST_CTRL_STATUS1_MASK) - -#define FMUTEST_R_TEST_CTRL_DEBUGRUN_MASK (0x10U) -#define FMUTEST_R_TEST_CTRL_DEBUGRUN_SHIFT (4U) -/*! DEBUGRUN - BIST Continue Debug Run */ -#define FMUTEST_R_TEST_CTRL_DEBUGRUN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_DEBUGRUN_SHIFT)) & FMUTEST_R_TEST_CTRL_DEBUGRUN_MASK) - -#define FMUTEST_R_TEST_CTRL_STARTRUN_MASK (0x20U) -#define FMUTEST_R_TEST_CTRL_STARTRUN_SHIFT (5U) -/*! STARTRUN - Run New BIST Operation */ -#define FMUTEST_R_TEST_CTRL_STARTRUN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_STARTRUN_SHIFT)) & FMUTEST_R_TEST_CTRL_STARTRUN_MASK) - -#define FMUTEST_R_TEST_CTRL_CMDINDEX_MASK (0xFFC0U) -#define FMUTEST_R_TEST_CTRL_CMDINDEX_SHIFT (6U) -/*! CMDINDEX - BIST Command Index (code) */ -#define FMUTEST_R_TEST_CTRL_CMDINDEX(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_CMDINDEX_SHIFT)) & FMUTEST_R_TEST_CTRL_CMDINDEX_MASK) - -#define FMUTEST_R_TEST_CTRL_DISABLE_IP1_MASK (0x10000U) -#define FMUTEST_R_TEST_CTRL_DISABLE_IP1_SHIFT (16U) -/*! DISABLE_IP1 - BIST Disable IP1 */ -#define FMUTEST_R_TEST_CTRL_DISABLE_IP1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_DISABLE_IP1_SHIFT)) & FMUTEST_R_TEST_CTRL_DISABLE_IP1_MASK) -/*! @} */ - -/*! @name R_ABORT_LOOP - BIST Abort Loop Register */ -/*! @{ */ - -#define FMUTEST_R_ABORT_LOOP_ABORT_LOOP_MASK (0x1U) -#define FMUTEST_R_ABORT_LOOP_ABORT_LOOP_SHIFT (0U) -/*! ABORT_LOOP - Abort Loop - * 0b0..No effect - * 0b1..Abort BIST loop commands and force the loop counter to return to 0x0 - */ -#define FMUTEST_R_ABORT_LOOP_ABORT_LOOP(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ABORT_LOOP_ABORT_LOOP_SHIFT)) & FMUTEST_R_ABORT_LOOP_ABORT_LOOP_MASK) -/*! @} */ - -/*! @name R_ADR_QUERY - BIST Address Query Register */ -/*! @{ */ - -#define FMUTEST_R_ADR_QUERY_YADRFAIL_MASK (0x1FU) -#define FMUTEST_R_ADR_QUERY_YADRFAIL_SHIFT (0U) -/*! YADRFAIL - Failing YADR */ -#define FMUTEST_R_ADR_QUERY_YADRFAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ADR_QUERY_YADRFAIL_SHIFT)) & FMUTEST_R_ADR_QUERY_YADRFAIL_MASK) - -#define FMUTEST_R_ADR_QUERY_XADRFAIL_MASK (0x1FFE0U) -#define FMUTEST_R_ADR_QUERY_XADRFAIL_SHIFT (5U) -/*! XADRFAIL - Failing XADR */ -#define FMUTEST_R_ADR_QUERY_XADRFAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ADR_QUERY_XADRFAIL_SHIFT)) & FMUTEST_R_ADR_QUERY_XADRFAIL_MASK) -/*! @} */ - -/*! @name R_DOUT_QUERY0 - BIST DOUT Query 0 Register */ -/*! @{ */ - -#define FMUTEST_R_DOUT_QUERY0_DOUTFAIL_MASK (0xFFFFFFFFU) -#define FMUTEST_R_DOUT_QUERY0_DOUTFAIL_SHIFT (0U) -/*! DOUTFAIL - Failing DOUT Low */ -#define FMUTEST_R_DOUT_QUERY0_DOUTFAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DOUT_QUERY0_DOUTFAIL_SHIFT)) & FMUTEST_R_DOUT_QUERY0_DOUTFAIL_MASK) -/*! @} */ - -/*! @name R_SMW_QUERY - BIST SMW Query Register */ -/*! @{ */ - -#define FMUTEST_R_SMW_QUERY_SMWLOOP_MASK (0x3FFU) -#define FMUTEST_R_SMW_QUERY_SMWLOOP_SHIFT (0U) -/*! SMWLOOP - SMW Total Loop Count */ -#define FMUTEST_R_SMW_QUERY_SMWLOOP(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMW_QUERY_SMWLOOP_SHIFT)) & FMUTEST_R_SMW_QUERY_SMWLOOP_MASK) - -#define FMUTEST_R_SMW_QUERY_SMWLAST_MASK (0x7FC00U) -#define FMUTEST_R_SMW_QUERY_SMWLAST_SHIFT (10U) -/*! SMWLAST - SMW Last Voltage Setting */ -#define FMUTEST_R_SMW_QUERY_SMWLAST(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMW_QUERY_SMWLAST_SHIFT)) & FMUTEST_R_SMW_QUERY_SMWLAST_MASK) -/*! @} */ - -/*! @name R_SMW_SETTING0 - BIST SMW Setting 0 Register */ -/*! @{ */ - -#define FMUTEST_R_SMW_SETTING0_SMWPARM0_MASK (0x7FFFFFFFU) -#define FMUTEST_R_SMW_SETTING0_SMWPARM0_SHIFT (0U) -/*! SMWPARM0 - SMW Parameter Set 0 */ -#define FMUTEST_R_SMW_SETTING0_SMWPARM0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMW_SETTING0_SMWPARM0_SHIFT)) & FMUTEST_R_SMW_SETTING0_SMWPARM0_MASK) -/*! @} */ - -/*! @name R_SMW_SETTING1 - BIST SMW Setting 1 Register */ -/*! @{ */ - -#define FMUTEST_R_SMW_SETTING1_SMWPARM1_MASK (0xFFFFFFFU) -#define FMUTEST_R_SMW_SETTING1_SMWPARM1_SHIFT (0U) -/*! SMWPARM1 - SMW Parameter Set 1 */ -#define FMUTEST_R_SMW_SETTING1_SMWPARM1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMW_SETTING1_SMWPARM1_SHIFT)) & FMUTEST_R_SMW_SETTING1_SMWPARM1_MASK) -/*! @} */ - -/*! @name R_SMP_WHV0 - BIST SMP WHV Setting 0 Register */ -/*! @{ */ - -#define FMUTEST_R_SMP_WHV0_SMPWHV0_MASK (0xFFFFFFFFU) -#define FMUTEST_R_SMP_WHV0_SMPWHV0_SHIFT (0U) -/*! SMPWHV0 - SMP WHV Parameter Set 0 */ -#define FMUTEST_R_SMP_WHV0_SMPWHV0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMP_WHV0_SMPWHV0_SHIFT)) & FMUTEST_R_SMP_WHV0_SMPWHV0_MASK) -/*! @} */ - -/*! @name R_SMP_WHV1 - BIST SMP WHV Setting 1 Register */ -/*! @{ */ - -#define FMUTEST_R_SMP_WHV1_SMPWHV1_MASK (0xFFFFFFFFU) -#define FMUTEST_R_SMP_WHV1_SMPWHV1_SHIFT (0U) -/*! SMPWHV1 - SMP WHV Parameter Set 1 */ -#define FMUTEST_R_SMP_WHV1_SMPWHV1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMP_WHV1_SMPWHV1_SHIFT)) & FMUTEST_R_SMP_WHV1_SMPWHV1_MASK) -/*! @} */ - -/*! @name R_SME_WHV0 - BIST SME WHV Setting 0 Register */ -/*! @{ */ - -#define FMUTEST_R_SME_WHV0_SMEWHV0_MASK (0xFFFFFFFFU) -#define FMUTEST_R_SME_WHV0_SMEWHV0_SHIFT (0U) -/*! SMEWHV0 - SME WHV Parameter Set 0 */ -#define FMUTEST_R_SME_WHV0_SMEWHV0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SME_WHV0_SMEWHV0_SHIFT)) & FMUTEST_R_SME_WHV0_SMEWHV0_MASK) -/*! @} */ - -/*! @name R_SME_WHV1 - BIST SME WHV Setting 1 Register */ -/*! @{ */ - -#define FMUTEST_R_SME_WHV1_SMEWHV1_MASK (0xFFFFFFFFU) -#define FMUTEST_R_SME_WHV1_SMEWHV1_SHIFT (0U) -/*! SMEWHV1 - SME WHV Parameter Set 1 */ -#define FMUTEST_R_SME_WHV1_SMEWHV1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SME_WHV1_SMEWHV1_SHIFT)) & FMUTEST_R_SME_WHV1_SMEWHV1_MASK) -/*! @} */ - -/*! @name R_SMW_SETTING2 - BIST SMW Setting 2 Register */ -/*! @{ */ - -#define FMUTEST_R_SMW_SETTING2_SMWPARM2_MASK (0x1FFFFFFFU) -#define FMUTEST_R_SMW_SETTING2_SMWPARM2_SHIFT (0U) -/*! SMWPARM2 - SMW Parameter Set 2 */ -#define FMUTEST_R_SMW_SETTING2_SMWPARM2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMW_SETTING2_SMWPARM2_SHIFT)) & FMUTEST_R_SMW_SETTING2_SMWPARM2_MASK) -/*! @} */ - -/*! @name R_D_MISR0 - BIST DIN MISR 0 Register */ -/*! @{ */ - -#define FMUTEST_R_D_MISR0_DATASIG0_MASK (0xFFFFFFFFU) -#define FMUTEST_R_D_MISR0_DATASIG0_SHIFT (0U) -/*! DATASIG0 - Data Signature */ -#define FMUTEST_R_D_MISR0_DATASIG0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_D_MISR0_DATASIG0_SHIFT)) & FMUTEST_R_D_MISR0_DATASIG0_MASK) -/*! @} */ - -/*! @name R_A_MISR0 - BIST Address MISR 0 Register */ -/*! @{ */ - -#define FMUTEST_R_A_MISR0_ADRSIG0_MASK (0xFFFFFFFFU) -#define FMUTEST_R_A_MISR0_ADRSIG0_SHIFT (0U) -/*! ADRSIG0 - Address Signature */ -#define FMUTEST_R_A_MISR0_ADRSIG0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_A_MISR0_ADRSIG0_SHIFT)) & FMUTEST_R_A_MISR0_ADRSIG0_MASK) -/*! @} */ - -/*! @name R_C_MISR0 - BIST Control MISR 0 Register */ -/*! @{ */ - -#define FMUTEST_R_C_MISR0_CTRLSIG0_MASK (0xFFFFFFFFU) -#define FMUTEST_R_C_MISR0_CTRLSIG0_SHIFT (0U) -/*! CTRLSIG0 - Control Signature */ -#define FMUTEST_R_C_MISR0_CTRLSIG0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_C_MISR0_CTRLSIG0_SHIFT)) & FMUTEST_R_C_MISR0_CTRLSIG0_MASK) -/*! @} */ - -/*! @name R_SMW_SETTING3 - BIST SMW Setting 3 Register */ -/*! @{ */ - -#define FMUTEST_R_SMW_SETTING3_SMWPARM3_MASK (0x1FFFFU) -#define FMUTEST_R_SMW_SETTING3_SMWPARM3_SHIFT (0U) -/*! SMWPARM3 - SMW Parameter Set 3 */ -#define FMUTEST_R_SMW_SETTING3_SMWPARM3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMW_SETTING3_SMWPARM3_SHIFT)) & FMUTEST_R_SMW_SETTING3_SMWPARM3_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL1 - BIST Data Control 1 Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL1_DATA1_MASK (0xFFFFFFFFU) -#define FMUTEST_R_DATA_CTRL1_DATA1_SHIFT (0U) -/*! DATA1 - BIST Data 1 Low */ -#define FMUTEST_R_DATA_CTRL1_DATA1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL1_DATA1_SHIFT)) & FMUTEST_R_DATA_CTRL1_DATA1_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL2 - BIST Data Control 2 Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL2_DATA2_MASK (0xFFFFFFFFU) -#define FMUTEST_R_DATA_CTRL2_DATA2_SHIFT (0U) -/*! DATA2 - BIST Data 2 Low */ -#define FMUTEST_R_DATA_CTRL2_DATA2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL2_DATA2_SHIFT)) & FMUTEST_R_DATA_CTRL2_DATA2_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL3 - BIST Data Control 3 Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL3_DATA3_MASK (0xFFFFFFFFU) -#define FMUTEST_R_DATA_CTRL3_DATA3_SHIFT (0U) -/*! DATA3 - BIST Data 3 Low */ -#define FMUTEST_R_DATA_CTRL3_DATA3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL3_DATA3_SHIFT)) & FMUTEST_R_DATA_CTRL3_DATA3_MASK) -/*! @} */ - -/*! @name R_REPAIR0_0 - BIST Repair 0 for Block 0 Register */ -/*! @{ */ - -#define FMUTEST_R_REPAIR0_0_RDIS0_0_MASK (0x1U) -#define FMUTEST_R_REPAIR0_0_RDIS0_0_SHIFT (0U) -/*! RDIS0_0 - Control Repair 0 in Block 0. - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_R_REPAIR0_0_RDIS0_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR0_0_RDIS0_0_SHIFT)) & FMUTEST_R_REPAIR0_0_RDIS0_0_MASK) - -#define FMUTEST_R_REPAIR0_0_RADR0_0_MASK (0x1FEU) -#define FMUTEST_R_REPAIR0_0_RADR0_0_SHIFT (1U) -/*! RADR0_0 - XADR for Repair 0 in Block 0 */ -#define FMUTEST_R_REPAIR0_0_RADR0_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR0_0_RADR0_0_SHIFT)) & FMUTEST_R_REPAIR0_0_RADR0_0_MASK) -/*! @} */ - -/*! @name R_REPAIR0_1 - BIST Repair 1 Block 0 Register */ -/*! @{ */ - -#define FMUTEST_R_REPAIR0_1_RDIS0_1_MASK (0x1U) -#define FMUTEST_R_REPAIR0_1_RDIS0_1_SHIFT (0U) -/*! RDIS0_1 - Control Repair 1 in Block 0. - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_R_REPAIR0_1_RDIS0_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR0_1_RDIS0_1_SHIFT)) & FMUTEST_R_REPAIR0_1_RDIS0_1_MASK) - -#define FMUTEST_R_REPAIR0_1_RADR0_1_MASK (0x1FEU) -#define FMUTEST_R_REPAIR0_1_RADR0_1_SHIFT (1U) -/*! RADR0_1 - XADR for Repair 1 in Block 0. */ -#define FMUTEST_R_REPAIR0_1_RADR0_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR0_1_RADR0_1_SHIFT)) & FMUTEST_R_REPAIR0_1_RADR0_1_MASK) -/*! @} */ - -/*! @name R_REPAIR1_0 - BIST Repair 0 Block 1 Register */ -/*! @{ */ - -#define FMUTEST_R_REPAIR1_0_RDIS1_0_MASK (0x1U) -#define FMUTEST_R_REPAIR1_0_RDIS1_0_SHIFT (0U) -/*! RDIS1_0 - Control Repair 0 in Block 1. - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_R_REPAIR1_0_RDIS1_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR1_0_RDIS1_0_SHIFT)) & FMUTEST_R_REPAIR1_0_RDIS1_0_MASK) - -#define FMUTEST_R_REPAIR1_0_RADR1_0_MASK (0x1FEU) -#define FMUTEST_R_REPAIR1_0_RADR1_0_SHIFT (1U) -/*! RADR1_0 - XADR for Repair 0 in Block 1. */ -#define FMUTEST_R_REPAIR1_0_RADR1_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR1_0_RADR1_0_SHIFT)) & FMUTEST_R_REPAIR1_0_RADR1_0_MASK) -/*! @} */ - -/*! @name R_REPAIR1_1 - BIST Repair 1 Block 1 Register */ -/*! @{ */ - -#define FMUTEST_R_REPAIR1_1_RDIS1_1_MASK (0x1U) -#define FMUTEST_R_REPAIR1_1_RDIS1_1_SHIFT (0U) -/*! RDIS1_1 - Control Repair 1 in Block 1. - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_R_REPAIR1_1_RDIS1_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR1_1_RDIS1_1_SHIFT)) & FMUTEST_R_REPAIR1_1_RDIS1_1_MASK) - -#define FMUTEST_R_REPAIR1_1_RADR1_1_MASK (0x1FEU) -#define FMUTEST_R_REPAIR1_1_RADR1_1_SHIFT (1U) -/*! RADR1_1 - XADR for Repair 1 in Block 1. */ -#define FMUTEST_R_REPAIR1_1_RADR1_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR1_1_RADR1_1_SHIFT)) & FMUTEST_R_REPAIR1_1_RADR1_1_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL0_EX - BIST Data Control 0 Extension Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL0_EX_DATA0X_MASK (0x7U) -#define FMUTEST_R_DATA_CTRL0_EX_DATA0X_SHIFT (0U) -/*! DATA0X - BIST Data 0 High */ -#define FMUTEST_R_DATA_CTRL0_EX_DATA0X(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL0_EX_DATA0X_SHIFT)) & FMUTEST_R_DATA_CTRL0_EX_DATA0X_MASK) -/*! @} */ - -/*! @name R_TIMER_CTRL_EX - BIST Timer Control Extension Register */ -/*! @{ */ - -#define FMUTEST_R_TIMER_CTRL_EX_TLVSDLY_H_MASK (0x7U) -#define FMUTEST_R_TIMER_CTRL_EX_TLVSDLY_H_SHIFT (0U) -/*! TLVSDLY_H - Tlvs Time Delay Scalar High */ -#define FMUTEST_R_TIMER_CTRL_EX_TLVSDLY_H(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_EX_TLVSDLY_H_SHIFT)) & FMUTEST_R_TIMER_CTRL_EX_TLVSDLY_H_MASK) -/*! @} */ - -/*! @name R_DOUT_QUERY1 - BIST DOUT Query 1 Register */ -/*! @{ */ - -#define FMUTEST_R_DOUT_QUERY1_DOUT_MASK (0x7U) -#define FMUTEST_R_DOUT_QUERY1_DOUT_SHIFT (0U) -/*! DOUT - Failing DOUT High */ -#define FMUTEST_R_DOUT_QUERY1_DOUT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DOUT_QUERY1_DOUT_SHIFT)) & FMUTEST_R_DOUT_QUERY1_DOUT_MASK) -/*! @} */ - -/*! @name R_D_MISR1 - BIST DIN MISR 1 Register */ -/*! @{ */ - -#define FMUTEST_R_D_MISR1_DATASIG1_MASK (0xFFU) -#define FMUTEST_R_D_MISR1_DATASIG1_SHIFT (0U) -/*! DATASIG1 - MISR Data Signature High */ -#define FMUTEST_R_D_MISR1_DATASIG1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_D_MISR1_DATASIG1_SHIFT)) & FMUTEST_R_D_MISR1_DATASIG1_MASK) -/*! @} */ - -/*! @name R_A_MISR1 - BIST Address MISR 1 Register */ -/*! @{ */ - -#define FMUTEST_R_A_MISR1_ADRSIG1_MASK (0xFFU) -#define FMUTEST_R_A_MISR1_ADRSIG1_SHIFT (0U) -/*! ADRSIG1 - MISR Address Signature High */ -#define FMUTEST_R_A_MISR1_ADRSIG1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_A_MISR1_ADRSIG1_SHIFT)) & FMUTEST_R_A_MISR1_ADRSIG1_MASK) -/*! @} */ - -/*! @name R_C_MISR1 - BIST Control MISR 1 Register */ -/*! @{ */ - -#define FMUTEST_R_C_MISR1_CTRLSIG1_MASK (0xFFU) -#define FMUTEST_R_C_MISR1_CTRLSIG1_SHIFT (0U) -/*! CTRLSIG1 - MISR Control Signature High */ -#define FMUTEST_R_C_MISR1_CTRLSIG1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_C_MISR1_CTRLSIG1_SHIFT)) & FMUTEST_R_C_MISR1_CTRLSIG1_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL1_EX - BIST Data Control 1 Extension Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL1_EX_DATA1X_MASK (0x7U) -#define FMUTEST_R_DATA_CTRL1_EX_DATA1X_SHIFT (0U) -/*! DATA1X - BIST Data 1 High */ -#define FMUTEST_R_DATA_CTRL1_EX_DATA1X(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL1_EX_DATA1X_SHIFT)) & FMUTEST_R_DATA_CTRL1_EX_DATA1X_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL2_EX - BIST Data Control 2 Extension Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL2_EX_DATA2X_MASK (0x7U) -#define FMUTEST_R_DATA_CTRL2_EX_DATA2X_SHIFT (0U) -/*! DATA2X - BIST Data 2 High */ -#define FMUTEST_R_DATA_CTRL2_EX_DATA2X(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL2_EX_DATA2X_SHIFT)) & FMUTEST_R_DATA_CTRL2_EX_DATA2X_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL3_EX - BIST Data Control 3 Extension Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL3_EX_DATA3X_MASK (0x7U) -#define FMUTEST_R_DATA_CTRL3_EX_DATA3X_SHIFT (0U) -/*! DATA3X - BIST Data 3 High */ -#define FMUTEST_R_DATA_CTRL3_EX_DATA3X(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL3_EX_DATA3X_SHIFT)) & FMUTEST_R_DATA_CTRL3_EX_DATA3X_MASK) -/*! @} */ - -/*! @name SMW_TIMER_OPTION - SMW Timer Option Register */ -/*! @{ */ - -#define FMUTEST_SMW_TIMER_OPTION_SMW_CDIVL_MASK (0xFFU) -#define FMUTEST_SMW_TIMER_OPTION_SMW_CDIVL_SHIFT (0U) -/*! SMW_CDIVL - Clock Divide Scalar for Long Pulse */ -#define FMUTEST_SMW_TIMER_OPTION_SMW_CDIVL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_TIMER_OPTION_SMW_CDIVL_SHIFT)) & FMUTEST_SMW_TIMER_OPTION_SMW_CDIVL_MASK) - -#define FMUTEST_SMW_TIMER_OPTION_SMW_TVFY_MASK (0x1F00U) -#define FMUTEST_SMW_TIMER_OPTION_SMW_TVFY_SHIFT (8U) -/*! SMW_TVFY - Timer Adjust for Verify */ -#define FMUTEST_SMW_TIMER_OPTION_SMW_TVFY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_TIMER_OPTION_SMW_TVFY_SHIFT)) & FMUTEST_SMW_TIMER_OPTION_SMW_TVFY_MASK) -/*! @} */ - -/*! @name SMW_SETTING_OPTION0 - SMW Setting Option 0 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SETTING_OPTION0_MV_INIT_MASK (0x1C000U) -#define FMUTEST_SMW_SETTING_OPTION0_MV_INIT_SHIFT (14U) -/*! MV_INIT - Medium Voltage Level Select Initial */ -#define FMUTEST_SMW_SETTING_OPTION0_MV_INIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION0_MV_INIT_SHIFT)) & FMUTEST_SMW_SETTING_OPTION0_MV_INIT_MASK) - -#define FMUTEST_SMW_SETTING_OPTION0_MV_END_MASK (0xE0000U) -#define FMUTEST_SMW_SETTING_OPTION0_MV_END_SHIFT (17U) -/*! MV_END - Medium Voltage Level Select Final */ -#define FMUTEST_SMW_SETTING_OPTION0_MV_END(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION0_MV_END_SHIFT)) & FMUTEST_SMW_SETTING_OPTION0_MV_END_MASK) - -#define FMUTEST_SMW_SETTING_OPTION0_MV_MISC_MASK (0xF00000U) -#define FMUTEST_SMW_SETTING_OPTION0_MV_MISC_SHIFT (20U) -/*! MV_MISC - Medium Voltage Control Misc */ -#define FMUTEST_SMW_SETTING_OPTION0_MV_MISC(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION0_MV_MISC_SHIFT)) & FMUTEST_SMW_SETTING_OPTION0_MV_MISC_MASK) - -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_INIT_MASK (0x3000000U) -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_INIT_SHIFT (24U) -/*! IPGM_INIT - Program Current Control Initial */ -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_INIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION0_IPGM_INIT_SHIFT)) & FMUTEST_SMW_SETTING_OPTION0_IPGM_INIT_MASK) - -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_END_MASK (0xC000000U) -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_END_SHIFT (26U) -/*! IPGM_END - Program Current Control Final */ -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_END(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION0_IPGM_END_SHIFT)) & FMUTEST_SMW_SETTING_OPTION0_IPGM_END_MASK) - -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_MISC_MASK (0x70000000U) -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_MISC_SHIFT (28U) -/*! IPGM_MISC - Program Current Control Misc */ -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_MISC(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION0_IPGM_MISC_SHIFT)) & FMUTEST_SMW_SETTING_OPTION0_IPGM_MISC_MASK) -/*! @} */ - -/*! @name SMW_SETTING_OPTION2 - SMW Setting Option 2 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SETTING_OPTION2_THVS_CTRL_MASK (0x7U) -#define FMUTEST_SMW_SETTING_OPTION2_THVS_CTRL_SHIFT (0U) -/*! THVS_CTRL - Thvs control */ -#define FMUTEST_SMW_SETTING_OPTION2_THVS_CTRL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_THVS_CTRL_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_THVS_CTRL_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_TRCV_CTRL_MASK (0x38U) -#define FMUTEST_SMW_SETTING_OPTION2_TRCV_CTRL_SHIFT (3U) -/*! TRCV_CTRL - Trcv Control */ -#define FMUTEST_SMW_SETTING_OPTION2_TRCV_CTRL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_TRCV_CTRL_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_TRCV_CTRL_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_XTRA_ERS_MASK (0xC0U) -#define FMUTEST_SMW_SETTING_OPTION2_XTRA_ERS_SHIFT (6U) -/*! XTRA_ERS - Number of Post Shots for SME */ -#define FMUTEST_SMW_SETTING_OPTION2_XTRA_ERS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_XTRA_ERS_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_XTRA_ERS_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_XTRA_PGM_MASK (0x300U) -#define FMUTEST_SMW_SETTING_OPTION2_XTRA_PGM_SHIFT (8U) -/*! XTRA_PGM - Number of Post Shots for SMP */ -#define FMUTEST_SMW_SETTING_OPTION2_XTRA_PGM(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_XTRA_PGM_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_XTRA_PGM_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_WHV_CNTR_MASK (0x3FC00U) -#define FMUTEST_SMW_SETTING_OPTION2_WHV_CNTR_SHIFT (10U) -/*! WHV_CNTR - WHV Counter */ -#define FMUTEST_SMW_SETTING_OPTION2_WHV_CNTR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_WHV_CNTR_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_WHV_CNTR_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_POST_TERS_MASK (0x1C0000U) -#define FMUTEST_SMW_SETTING_OPTION2_POST_TERS_SHIFT (18U) -/*! POST_TERS - Post Ters Time - * 0b000..50 usec - * 0b001..100 usec - * 0b010..200 usec - * 0b011..300 usec - * 0b100..500 usec - * 0b101..1 msec - * 0b110..1.5 msec - * 0b111..2 msec - */ -#define FMUTEST_SMW_SETTING_OPTION2_POST_TERS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_POST_TERS_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_POST_TERS_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_POST_TPGM_MASK (0x600000U) -#define FMUTEST_SMW_SETTING_OPTION2_POST_TPGM_SHIFT (21U) -/*! POST_TPGM - Post Tpgm Time - * 0b00..1 usec - * 0b01..2 usec - * 0b10..4 usec - * 0b11..8 usec - */ -#define FMUTEST_SMW_SETTING_OPTION2_POST_TPGM(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_POST_TPGM_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_POST_TPGM_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_VFY_OPT_MASK (0x1800000U) -#define FMUTEST_SMW_SETTING_OPTION2_VFY_OPT_SHIFT (23U) -/*! VFY_OPT - Verify Option - * 0b00..Skip verify for post shot only, verify for all other shots - * 0b01..Skip verify for the 1st and post shots - * 0b10..Skip the 1st, 2nd, and post shots - * 0b11..Skip verify for all shots - */ -#define FMUTEST_SMW_SETTING_OPTION2_VFY_OPT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_VFY_OPT_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_VFY_OPT_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_TPGM_OPT_MASK (0x6000000U) -#define FMUTEST_SMW_SETTING_OPTION2_TPGM_OPT_SHIFT (25U) -/*! TPGM_OPT - Tpgm Option - * 0b00..Fixed Tpgm for all shots, except post shot - * 0b01..Increase Tpgm option by 1 for each loop until Tpgm reaches 4 usec - * 0b10..Increase Tpgm option by 1 for each loop until Tpgm reaches 8 usec - * 0b11..Unused - */ -#define FMUTEST_SMW_SETTING_OPTION2_TPGM_OPT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_TPGM_OPT_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_TPGM_OPT_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_MASK0_OPT_MASK (0x8000000U) -#define FMUTEST_SMW_SETTING_OPTION2_MASK0_OPT_SHIFT (27U) -/*! MASK0_OPT - MASK0_OPT - * 0b0..Mask programmed bits passing PV until extra shot - * 0b1..Always program bits even if they pass PV - */ -#define FMUTEST_SMW_SETTING_OPTION2_MASK0_OPT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_MASK0_OPT_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_MASK0_OPT_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_DIS_PRER_MASK (0x10000000U) -#define FMUTEST_SMW_SETTING_OPTION2_DIS_PRER_SHIFT (28U) -/*! DIS_PRER - Disable pre-PV Read before First Program Shot - * 0b0..Enable pre-PV read before first program shot - * 0b1..Disable pre-PV read before first program shot - */ -#define FMUTEST_SMW_SETTING_OPTION2_DIS_PRER(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_DIS_PRER_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_DIS_PRER_MASK) -/*! @} */ - -/*! @name SMW_SETTING_OPTION3 - SMW Setting Option 3 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SETTING_OPTION3_HEM_WHV_CNTR_MASK (0xFFU) -#define FMUTEST_SMW_SETTING_OPTION3_HEM_WHV_CNTR_SHIFT (0U) -/*! HEM_WHV_CNTR - WHV_COUNTER for HEM-erase Cycle */ -#define FMUTEST_SMW_SETTING_OPTION3_HEM_WHV_CNTR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION3_HEM_WHV_CNTR_SHIFT)) & FMUTEST_SMW_SETTING_OPTION3_HEM_WHV_CNTR_MASK) - -#define FMUTEST_SMW_SETTING_OPTION3_HEM_MAX_ERS_MASK (0x1FF00U) -#define FMUTEST_SMW_SETTING_OPTION3_HEM_MAX_ERS_SHIFT (8U) -/*! HEM_MAX_ERS - HEM Max Erase Shot Count */ -#define FMUTEST_SMW_SETTING_OPTION3_HEM_MAX_ERS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION3_HEM_MAX_ERS_SHIFT)) & FMUTEST_SMW_SETTING_OPTION3_HEM_MAX_ERS_MASK) -/*! @} */ - -/*! @name SMW_SMP_WHV_OPTION0 - SMW SMP WHV Option 0 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SMP_WHV_OPTION0_SMP_WHV_OPT0_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_SMP_WHV_OPTION0_SMP_WHV_OPT0_SHIFT (0U) -/*! SMP_WHV_OPT0 - Smart Program WHV Option Low */ -#define FMUTEST_SMW_SMP_WHV_OPTION0_SMP_WHV_OPT0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SMP_WHV_OPTION0_SMP_WHV_OPT0_SHIFT)) & FMUTEST_SMW_SMP_WHV_OPTION0_SMP_WHV_OPT0_MASK) -/*! @} */ - -/*! @name SMW_SME_WHV_OPTION0 - SMW SME WHV Option 0 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SME_WHV_OPTION0_SME_WHV_OPT0_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_SME_WHV_OPTION0_SME_WHV_OPT0_SHIFT (0U) -/*! SME_WHV_OPT0 - Smart Erase WHV Option Low */ -#define FMUTEST_SMW_SME_WHV_OPTION0_SME_WHV_OPT0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SME_WHV_OPTION0_SME_WHV_OPT0_SHIFT)) & FMUTEST_SMW_SME_WHV_OPTION0_SME_WHV_OPT0_MASK) -/*! @} */ - -/*! @name SMW_SETTING_OPTION1 - SMW Setting Option 1 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SETTING_OPTION1_TERS_CTRL0_MASK (0x7U) -#define FMUTEST_SMW_SETTING_OPTION1_TERS_CTRL0_SHIFT (0U) -/*! TERS_CTRL0 - Ters Control - * 0b000..50 usec - * 0b001..100 usec - * 0b010..200 usec - * 0b011..300 usec - * 0b100..500 usec - * 0b101..1 msec - * 0b110..1.5 msec - * 0b111..2 msec - */ -#define FMUTEST_SMW_SETTING_OPTION1_TERS_CTRL0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_TERS_CTRL0_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_TERS_CTRL0_MASK) - -#define FMUTEST_SMW_SETTING_OPTION1_TPGM_CTRL_MASK (0x18U) -#define FMUTEST_SMW_SETTING_OPTION1_TPGM_CTRL_SHIFT (3U) -/*! TPGM_CTRL - Tpgm Control - * 0b00..1 usec - * 0b01..2 usec - * 0b10..4 usec - * 0b11..8 usec - */ -#define FMUTEST_SMW_SETTING_OPTION1_TPGM_CTRL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_TPGM_CTRL_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_TPGM_CTRL_MASK) - -#define FMUTEST_SMW_SETTING_OPTION1_TNVS_CTRL_MASK (0xE0U) -#define FMUTEST_SMW_SETTING_OPTION1_TNVS_CTRL_SHIFT (5U) -/*! TNVS_CTRL - Tnvs Control - * 0b000..5 usec - * 0b001..8 usec - * 0b010..11 usec - * 0b011..14 usec - * 0b100..17 usec - * 0b101..20 usec - * 0b110..23 usec - * 0b111..26 usec - */ -#define FMUTEST_SMW_SETTING_OPTION1_TNVS_CTRL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_TNVS_CTRL_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_TNVS_CTRL_MASK) - -#define FMUTEST_SMW_SETTING_OPTION1_TNVH_CTRL_MASK (0x700U) -#define FMUTEST_SMW_SETTING_OPTION1_TNVH_CTRL_SHIFT (8U) -/*! TNVH_CTRL - Tnvh Control - * 0b000..2 usec - * 0b001..2.5 usec - * 0b010..3 usec - * 0b011..3.5 usec - * 0b100..4 usec - * 0b101..4.5 usec - * 0b110..5 usec - * 0b111..5.5 usec - */ -#define FMUTEST_SMW_SETTING_OPTION1_TNVH_CTRL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_TNVH_CTRL_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_TNVH_CTRL_MASK) - -#define FMUTEST_SMW_SETTING_OPTION1_TPGS_CTRL_MASK (0x3800U) -#define FMUTEST_SMW_SETTING_OPTION1_TPGS_CTRL_SHIFT (11U) -/*! TPGS_CTRL - Tpgs Control - * 0b000..1 usec - * 0b001..2 usec - * 0b010..3 usec - * 0b011..4 usec - * 0b100..5 usec - * 0b101..6 usec - * 0b110..7 usec - * 0b111..8 usec - */ -#define FMUTEST_SMW_SETTING_OPTION1_TPGS_CTRL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_TPGS_CTRL_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_TPGS_CTRL_MASK) - -#define FMUTEST_SMW_SETTING_OPTION1_MAX_ERASE_MASK (0x7FC000U) -#define FMUTEST_SMW_SETTING_OPTION1_MAX_ERASE_SHIFT (14U) -/*! MAX_ERASE - Number of Erase Shots */ -#define FMUTEST_SMW_SETTING_OPTION1_MAX_ERASE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_MAX_ERASE_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_MAX_ERASE_MASK) - -#define FMUTEST_SMW_SETTING_OPTION1_MAX_PROG_MASK (0xF800000U) -#define FMUTEST_SMW_SETTING_OPTION1_MAX_PROG_SHIFT (23U) -/*! MAX_PROG - Number of Program Shots */ -#define FMUTEST_SMW_SETTING_OPTION1_MAX_PROG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_MAX_PROG_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_MAX_PROG_MASK) -/*! @} */ - -/*! @name SMW_SMP_WHV_OPTION1 - SMW SMP WHV Option 1 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SMP_WHV_OPTION1_SMP_WHV_OPT1_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_SMP_WHV_OPTION1_SMP_WHV_OPT1_SHIFT (0U) -/*! SMP_WHV_OPT1 - Smart Program WHV Option High */ -#define FMUTEST_SMW_SMP_WHV_OPTION1_SMP_WHV_OPT1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SMP_WHV_OPTION1_SMP_WHV_OPT1_SHIFT)) & FMUTEST_SMW_SMP_WHV_OPTION1_SMP_WHV_OPT1_MASK) -/*! @} */ - -/*! @name SMW_SME_WHV_OPTION1 - SMW SME WHV Option 1 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SME_WHV_OPTION1_SME_WHV_OPT1_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_SME_WHV_OPTION1_SME_WHV_OPT1_SHIFT (0U) -/*! SME_WHV_OPT1 - Smart Erase WHV Option High */ -#define FMUTEST_SMW_SME_WHV_OPTION1_SME_WHV_OPT1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SME_WHV_OPTION1_SME_WHV_OPT1_SHIFT)) & FMUTEST_SMW_SME_WHV_OPTION1_SME_WHV_OPT1_MASK) -/*! @} */ - -/*! @name REPAIR0_0 - FMU Repair 0 Block 0 Register */ -/*! @{ */ - -#define FMUTEST_REPAIR0_0_RDIS0_0_MASK (0x1U) -#define FMUTEST_REPAIR0_0_RDIS0_0_SHIFT (0U) -/*! RDIS0_0 - RDIS0_0 - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_REPAIR0_0_RDIS0_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR0_0_RDIS0_0_SHIFT)) & FMUTEST_REPAIR0_0_RDIS0_0_MASK) - -#define FMUTEST_REPAIR0_0_RADR0_0_MASK (0x1FEU) -#define FMUTEST_REPAIR0_0_RADR0_0_SHIFT (1U) -/*! RADR0_0 - RADR0_0 */ -#define FMUTEST_REPAIR0_0_RADR0_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR0_0_RADR0_0_SHIFT)) & FMUTEST_REPAIR0_0_RADR0_0_MASK) -/*! @} */ - -/*! @name REPAIR0_1 - FMU Repair 1 Block 0 Register */ -/*! @{ */ - -#define FMUTEST_REPAIR0_1_RDIS0_1_MASK (0x1U) -#define FMUTEST_REPAIR0_1_RDIS0_1_SHIFT (0U) -/*! RDIS0_1 - RDIS0_1 - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_REPAIR0_1_RDIS0_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR0_1_RDIS0_1_SHIFT)) & FMUTEST_REPAIR0_1_RDIS0_1_MASK) - -#define FMUTEST_REPAIR0_1_RADR0_1_MASK (0x1FEU) -#define FMUTEST_REPAIR0_1_RADR0_1_SHIFT (1U) -/*! RADR0_1 - RADR0_1 */ -#define FMUTEST_REPAIR0_1_RADR0_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR0_1_RADR0_1_SHIFT)) & FMUTEST_REPAIR0_1_RADR0_1_MASK) -/*! @} */ - -/*! @name REPAIR1_0 - FMU Repair 0 Block 1 Register */ -/*! @{ */ - -#define FMUTEST_REPAIR1_0_RDIS1_0_MASK (0x1U) -#define FMUTEST_REPAIR1_0_RDIS1_0_SHIFT (0U) -/*! RDIS1_0 - RDIS1_0 - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_REPAIR1_0_RDIS1_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR1_0_RDIS1_0_SHIFT)) & FMUTEST_REPAIR1_0_RDIS1_0_MASK) - -#define FMUTEST_REPAIR1_0_RADR1_0_MASK (0x1FEU) -#define FMUTEST_REPAIR1_0_RADR1_0_SHIFT (1U) -/*! RADR1_0 - RADR1_0 */ -#define FMUTEST_REPAIR1_0_RADR1_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR1_0_RADR1_0_SHIFT)) & FMUTEST_REPAIR1_0_RADR1_0_MASK) -/*! @} */ - -/*! @name REPAIR1_1 - FMU Repair 1 Block 1 Register */ -/*! @{ */ - -#define FMUTEST_REPAIR1_1_RDIS1_1_MASK (0x1U) -#define FMUTEST_REPAIR1_1_RDIS1_1_SHIFT (0U) -/*! RDIS1_1 - RDIS1_1 - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_REPAIR1_1_RDIS1_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR1_1_RDIS1_1_SHIFT)) & FMUTEST_REPAIR1_1_RDIS1_1_MASK) - -#define FMUTEST_REPAIR1_1_RADR1_1_MASK (0x1FEU) -#define FMUTEST_REPAIR1_1_RADR1_1_SHIFT (1U) -/*! RADR1_1 - RADR1_1 */ -#define FMUTEST_REPAIR1_1_RADR1_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR1_1_RADR1_1_SHIFT)) & FMUTEST_REPAIR1_1_RADR1_1_MASK) -/*! @} */ - -/*! @name SMW_HB_SIGNALS - SMW HB Signals Register */ -/*! @{ */ - -#define FMUTEST_SMW_HB_SIGNALS_SMW_ARRAY_MASK (0x7U) -#define FMUTEST_SMW_HB_SIGNALS_SMW_ARRAY_SHIFT (0U) -/*! SMW_ARRAY - SMW Region Select - * 0b000..Main array - * 0b001..IFR space only or main (and REDEN space) with IFR space for mass erase - * 0b010..IFR1 space - * 0b100..REDEN space - */ -#define FMUTEST_SMW_HB_SIGNALS_SMW_ARRAY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_SMW_ARRAY_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_SMW_ARRAY_MASK) - -#define FMUTEST_SMW_HB_SIGNALS_USER_IFREN1_MASK (0x8U) -#define FMUTEST_SMW_HB_SIGNALS_USER_IFREN1_SHIFT (3U) -/*! USER_IFREN1 - IFR1 Enable - * 0b0..IFREN1 input to the flash array is driven LOW - * 0b1..IFREN1 input to the flash array is driven HIGH - */ -#define FMUTEST_SMW_HB_SIGNALS_USER_IFREN1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_USER_IFREN1_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_USER_IFREN1_MASK) - -#define FMUTEST_SMW_HB_SIGNALS_USER_PV_MASK (0x10U) -#define FMUTEST_SMW_HB_SIGNALS_USER_PV_SHIFT (4U) -/*! USER_PV - Program Verify - * 0b0..PV input to the flash array is driven LOW - * 0b1..PV input to the flash array is driven HIGH - */ -#define FMUTEST_SMW_HB_SIGNALS_USER_PV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_USER_PV_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_USER_PV_MASK) - -#define FMUTEST_SMW_HB_SIGNALS_USER_EV_MASK (0x20U) -#define FMUTEST_SMW_HB_SIGNALS_USER_EV_SHIFT (5U) -/*! USER_EV - Erase Verify - * 0b0..EV input to the flash array is driven LOW - * 0b1..EV input to the flash array is driven HIGH - */ -#define FMUTEST_SMW_HB_SIGNALS_USER_EV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_USER_EV_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_USER_EV_MASK) - -#define FMUTEST_SMW_HB_SIGNALS_USER_IFREN_MASK (0x40U) -#define FMUTEST_SMW_HB_SIGNALS_USER_IFREN_SHIFT (6U) -/*! USER_IFREN - IFR Enable - * 0b0..IFREN input to the flash array is driven LOW - * 0b1..IFREN input to the flash array is driven HIGH - */ -#define FMUTEST_SMW_HB_SIGNALS_USER_IFREN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_USER_IFREN_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_USER_IFREN_MASK) - -#define FMUTEST_SMW_HB_SIGNALS_USER_REDEN_MASK (0x80U) -#define FMUTEST_SMW_HB_SIGNALS_USER_REDEN_SHIFT (7U) -/*! USER_REDEN - Repair Read Enable - * 0b0..REDEN input to the flash array is driven LOW - * 0b1..REDEN input to the flash array is driven HIGH - */ -#define FMUTEST_SMW_HB_SIGNALS_USER_REDEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_USER_REDEN_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_USER_REDEN_MASK) - -#define FMUTEST_SMW_HB_SIGNALS_USER_HEM_MASK (0x100U) -#define FMUTEST_SMW_HB_SIGNALS_USER_HEM_SHIFT (8U) -/*! USER_HEM - High Endurance Enable - * 0b0..HEM input to SMW / BIST PIN_CTRL[24] is driven LOW - * 0b1..HEM input to SMW / BIST PIN_CTRL[24] is driven HIGH - */ -#define FMUTEST_SMW_HB_SIGNALS_USER_HEM(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_USER_HEM_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_USER_HEM_MASK) -/*! @} */ - -/*! @name BIST_DUMP_CTRL - BIST Datadump Control Register */ -/*! @{ */ - -#define FMUTEST_BIST_DUMP_CTRL_BIST_DONE_MASK (0x10000U) -#define FMUTEST_BIST_DUMP_CTRL_BIST_DONE_SHIFT (16U) -/*! BIST_DONE - BIST Done - * 0b0..The BIST (or data dump) is running - * 0b1..The BIST (or data dump) has completed - */ -#define FMUTEST_BIST_DUMP_CTRL_BIST_DONE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_BIST_DONE_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_BIST_DONE_MASK) - -#define FMUTEST_BIST_DUMP_CTRL_BIST_FAIL_MASK (0x20000U) -#define FMUTEST_BIST_DUMP_CTRL_BIST_FAIL_SHIFT (17U) -/*! BIST_FAIL - BIST Fail - * 0b0..The last BIST operation completed successfully (or could not fail) - * 0b1..The last BIST operation failed - */ -#define FMUTEST_BIST_DUMP_CTRL_BIST_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_BIST_FAIL_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_BIST_FAIL_MASK) - -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MASK (0x40000U) -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_SHIFT (18U) -/*! DATADUMP - Data Dump Enable */ -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_DATADUMP_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_DATADUMP_MASK) - -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_TRIG_MASK (0x80000U) -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_TRIG_SHIFT (19U) -/*! DATADUMP_TRIG - Data Dump Trigger */ -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_TRIG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_DATADUMP_TRIG_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_DATADUMP_TRIG_MASK) - -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_PATT_MASK (0x300000U) -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_PATT_SHIFT (20U) -/*! DATADUMP_PATT - Data Dump Pattern Select - * 0b00..All ones - * 0b01..All zeroes - * 0b10..Checkerboard - * 0b11..Inverse checkerboard - */ -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_PATT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_DATADUMP_PATT_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_DATADUMP_PATT_MASK) - -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGEN_MASK (0x400000U) -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGEN_SHIFT (22U) -/*! DATADUMP_MRGEN - Data Dump Margin Enable - * 0b0..Normal read pulse shape - * 0b1..Margin read pulse shape - */ -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGEN_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGEN_MASK) - -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGTYPE_MASK (0x800000U) -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGTYPE_SHIFT (23U) -/*! DATADUMP_MRGTYPE - Data Dump Margin Type - * 0b0..DIN method used - * 0b1..TM method used - */ -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGTYPE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGTYPE_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGTYPE_MASK) -/*! @} */ - -/*! @name ATX_PIN_CTRL - ATX Pin Control Register */ -/*! @{ */ - -#define FMUTEST_ATX_PIN_CTRL_TM_TO_ATX_MASK (0xFFU) -#define FMUTEST_ATX_PIN_CTRL_TM_TO_ATX_SHIFT (0U) -/*! TM_TO_ATX - TM to ATX - * 0b00000001..TM[0] to ATX0 - * 0b00000010..TM[1] to ATX0 - * 0b00000100..TM[2] to ATX0 - * 0b00001000..TM[3] to ATX0 - * 0b00010000..TM[0] to ATX1 - * 0b00100000..TM[1] to ATX1 - * 0b01000000..TM[2] to ATX1 - * 0b10000000..TM[3] to ATX1 - */ -#define FMUTEST_ATX_PIN_CTRL_TM_TO_ATX(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_ATX_PIN_CTRL_TM_TO_ATX_SHIFT)) & FMUTEST_ATX_PIN_CTRL_TM_TO_ATX_MASK) -/*! @} */ - -/*! @name FAILCNT - Fail Count Register */ -/*! @{ */ - -#define FMUTEST_FAILCNT_FAILCNT_MASK (0xFFFFFFFFU) -#define FMUTEST_FAILCNT_FAILCNT_SHIFT (0U) -/*! FAILCNT - Fail Count */ -#define FMUTEST_FAILCNT_FAILCNT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FAILCNT_FAILCNT_SHIFT)) & FMUTEST_FAILCNT_FAILCNT_MASK) -/*! @} */ - -/*! @name PGM_PULSE_CNT0 - Block 0 Program Pulse Count Register */ -/*! @{ */ - -#define FMUTEST_PGM_PULSE_CNT0_PGM_CNT0_MASK (0xFFFFFFFFU) -#define FMUTEST_PGM_PULSE_CNT0_PGM_CNT0_SHIFT (0U) -/*! PGM_CNT0 - Program Pulse Count */ -#define FMUTEST_PGM_PULSE_CNT0_PGM_CNT0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PGM_PULSE_CNT0_PGM_CNT0_SHIFT)) & FMUTEST_PGM_PULSE_CNT0_PGM_CNT0_MASK) -/*! @} */ - -/*! @name PGM_PULSE_CNT1 - Block 1 Program Pulse Count Register */ -/*! @{ */ - -#define FMUTEST_PGM_PULSE_CNT1_PGM_CNT1_MASK (0xFFFFFFFFU) -#define FMUTEST_PGM_PULSE_CNT1_PGM_CNT1_SHIFT (0U) -/*! PGM_CNT1 - Program Pulse Count */ -#define FMUTEST_PGM_PULSE_CNT1_PGM_CNT1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PGM_PULSE_CNT1_PGM_CNT1_SHIFT)) & FMUTEST_PGM_PULSE_CNT1_PGM_CNT1_MASK) -/*! @} */ - -/*! @name ERS_PULSE_CNT - Erase Pulse Count Register */ -/*! @{ */ - -#define FMUTEST_ERS_PULSE_CNT_ERS_CNT0_MASK (0xFFFFU) -#define FMUTEST_ERS_PULSE_CNT_ERS_CNT0_SHIFT (0U) -/*! ERS_CNT0 - Block 0 Erase Pulse Count */ -#define FMUTEST_ERS_PULSE_CNT_ERS_CNT0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_ERS_PULSE_CNT_ERS_CNT0_SHIFT)) & FMUTEST_ERS_PULSE_CNT_ERS_CNT0_MASK) - -#define FMUTEST_ERS_PULSE_CNT_ERS_CNT1_MASK (0xFFFF0000U) -#define FMUTEST_ERS_PULSE_CNT_ERS_CNT1_SHIFT (16U) -/*! ERS_CNT1 - Block 1 Erase Pulse Count */ -#define FMUTEST_ERS_PULSE_CNT_ERS_CNT1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_ERS_PULSE_CNT_ERS_CNT1_SHIFT)) & FMUTEST_ERS_PULSE_CNT_ERS_CNT1_MASK) -/*! @} */ - -/*! @name MAX_PULSE_CNT - Maximum Pulse Count Register */ -/*! @{ */ - -#define FMUTEST_MAX_PULSE_CNT_LAST_PCNT_MASK (0x1FFU) -#define FMUTEST_MAX_PULSE_CNT_LAST_PCNT_SHIFT (0U) -/*! LAST_PCNT - Last SMW Operation's Pulse Count */ -#define FMUTEST_MAX_PULSE_CNT_LAST_PCNT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MAX_PULSE_CNT_LAST_PCNT_SHIFT)) & FMUTEST_MAX_PULSE_CNT_LAST_PCNT_MASK) - -#define FMUTEST_MAX_PULSE_CNT_MAX_ERS_CNT_MASK (0x1FF0000U) -#define FMUTEST_MAX_PULSE_CNT_MAX_ERS_CNT_SHIFT (16U) -/*! MAX_ERS_CNT - Maximum Erase Pulse Count */ -#define FMUTEST_MAX_PULSE_CNT_MAX_ERS_CNT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MAX_PULSE_CNT_MAX_ERS_CNT_SHIFT)) & FMUTEST_MAX_PULSE_CNT_MAX_ERS_CNT_MASK) - -#define FMUTEST_MAX_PULSE_CNT_MAX_PGM_CNT_MASK (0xF8000000U) -#define FMUTEST_MAX_PULSE_CNT_MAX_PGM_CNT_SHIFT (27U) -/*! MAX_PGM_CNT - Maximum Program Pulse Count */ -#define FMUTEST_MAX_PULSE_CNT_MAX_PGM_CNT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MAX_PULSE_CNT_MAX_PGM_CNT_SHIFT)) & FMUTEST_MAX_PULSE_CNT_MAX_PGM_CNT_MASK) -/*! @} */ - -/*! @name PORT_CTRL - Port Control Register */ -/*! @{ */ - -#define FMUTEST_PORT_CTRL_BDONE_SEL_MASK (0x3U) -#define FMUTEST_PORT_CTRL_BDONE_SEL_SHIFT (0U) -/*! BDONE_SEL - BIST Done Select - * 0b00..Select internal bist_done signal from current module instantiation - * 0b01..Select ipt_bist_fail signal from current module instantiation - * 0b10..Select ipt_bist_done signal from other module instantiation - * 0b11..Select AND of internal bist_done signal from current module instantiation with ipt_bist_done signal from other module instantiation - */ -#define FMUTEST_PORT_CTRL_BDONE_SEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PORT_CTRL_BDONE_SEL_SHIFT)) & FMUTEST_PORT_CTRL_BDONE_SEL_MASK) - -#define FMUTEST_PORT_CTRL_BSDO_SEL_MASK (0xCU) -#define FMUTEST_PORT_CTRL_BSDO_SEL_SHIFT (2U) -/*! BSDO_SEL - BIST Serial Data Output Select - * 0b00..Select internal bist_sdo signal from current module instantiation - * 0b01..Select ipt_bist_done signal from current module instantiation - * 0b10..Select ipt_bist_sdo signal from other module instantiation - * 0b11..Select ipt_bist_done signal from other module instantiation - */ -#define FMUTEST_PORT_CTRL_BSDO_SEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PORT_CTRL_BSDO_SEL_SHIFT)) & FMUTEST_PORT_CTRL_BSDO_SEL_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group FMUTEST_Register_Masks */ - - -/* FMUTEST - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral FMU0TEST base address */ - #define FMU0TEST_BASE (0x50043000u) - /** Peripheral FMU0TEST base address */ - #define FMU0TEST_BASE_NS (0x40043000u) - /** Peripheral FMU0TEST base pointer */ - #define FMU0TEST ((FMUTEST_Type *)FMU0TEST_BASE) - /** Peripheral FMU0TEST base pointer */ - #define FMU0TEST_NS ((FMUTEST_Type *)FMU0TEST_BASE_NS) - /** Array initializer of FMUTEST peripheral base addresses */ - #define FMUTEST_BASE_ADDRS { FMU0TEST_BASE } - /** Array initializer of FMUTEST peripheral base pointers */ - #define FMUTEST_BASE_PTRS { FMU0TEST } - /** Array initializer of FMUTEST peripheral base addresses */ - #define FMUTEST_BASE_ADDRS_NS { FMU0TEST_BASE_NS } - /** Array initializer of FMUTEST peripheral base pointers */ - #define FMUTEST_BASE_PTRS_NS { FMU0TEST_NS } -#else - /** Peripheral FMU0TEST base address */ - #define FMU0TEST_BASE (0x40043000u) - /** Peripheral FMU0TEST base pointer */ - #define FMU0TEST ((FMUTEST_Type *)FMU0TEST_BASE) - /** Array initializer of FMUTEST peripheral base addresses */ - #define FMUTEST_BASE_ADDRS { FMU0TEST_BASE } - /** Array initializer of FMUTEST peripheral base pointers */ - #define FMUTEST_BASE_PTRS { FMU0TEST } -#endif - -/*! - * @} - */ /* end of group FMUTEST_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- FREQME Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FREQME_Peripheral_Access_Layer FREQME Peripheral Access Layer - * @{ - */ - -/** FREQME - Register Layout Typedef */ -typedef struct { - union { /* offset: 0x0 */ - __I uint32_t CTRL_R; /**< Control (in Read mode), offset: 0x0 */ - __O uint32_t CTRL_W; /**< Control (in Write mode), offset: 0x0 */ - }; - __IO uint32_t CTRLSTAT; /**< Control Status, offset: 0x4 */ - __IO uint32_t MIN; /**< Minimum, offset: 0x8 */ - __IO uint32_t MAX; /**< Maximum, offset: 0xC */ -} FREQME_Type; - -/* ---------------------------------------------------------------------------- - -- FREQME Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FREQME_Register_Masks FREQME Register Masks - * @{ - */ - -/*! @name CTRL_R - Control (in Read mode) */ -/*! @{ */ - -#define FREQME_CTRL_R_RESULT_MASK (0x7FFFFFFFU) -#define FREQME_CTRL_R_RESULT_SHIFT (0U) -#define FREQME_CTRL_R_RESULT(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_R_RESULT_SHIFT)) & FREQME_CTRL_R_RESULT_MASK) - -#define FREQME_CTRL_R_MEASURE_IN_PROGRESS_MASK (0x80000000U) -#define FREQME_CTRL_R_MEASURE_IN_PROGRESS_SHIFT (31U) -/*! MEASURE_IN_PROGRESS - Measurement In Progress - * 0b0..Complete - * 0b1..In progress - */ -#define FREQME_CTRL_R_MEASURE_IN_PROGRESS(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_R_MEASURE_IN_PROGRESS_SHIFT)) & FREQME_CTRL_R_MEASURE_IN_PROGRESS_MASK) -/*! @} */ - -/*! @name CTRL_W - Control (in Write mode) */ -/*! @{ */ - -#define FREQME_CTRL_W_REF_SCALE_MASK (0x1FU) -#define FREQME_CTRL_W_REF_SCALE_SHIFT (0U) -/*! REF_SCALE - Reference Clock Scaling Factor */ -#define FREQME_CTRL_W_REF_SCALE(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_REF_SCALE_SHIFT)) & FREQME_CTRL_W_REF_SCALE_MASK) - -#define FREQME_CTRL_W_PULSE_MODE_MASK (0x100U) -#define FREQME_CTRL_W_PULSE_MODE_SHIFT (8U) -/*! PULSE_MODE - Pulse Width Measurement Mode Select - * 0b0..Frequency Measurement mode - * 0b1..Pulse Width Measurement mode - */ -#define FREQME_CTRL_W_PULSE_MODE(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_PULSE_MODE_SHIFT)) & FREQME_CTRL_W_PULSE_MODE_MASK) - -#define FREQME_CTRL_W_PULSE_POL_MASK (0x200U) -#define FREQME_CTRL_W_PULSE_POL_SHIFT (9U) -/*! PULSE_POL - Pulse Polarity - * 0b0..High period - * 0b1..Low period - */ -#define FREQME_CTRL_W_PULSE_POL(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_PULSE_POL_SHIFT)) & FREQME_CTRL_W_PULSE_POL_MASK) - -#define FREQME_CTRL_W_LT_MIN_INT_EN_MASK (0x1000U) -#define FREQME_CTRL_W_LT_MIN_INT_EN_SHIFT (12U) -/*! LT_MIN_INT_EN - Less Than Minimum Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FREQME_CTRL_W_LT_MIN_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_LT_MIN_INT_EN_SHIFT)) & FREQME_CTRL_W_LT_MIN_INT_EN_MASK) - -#define FREQME_CTRL_W_GT_MAX_INT_EN_MASK (0x2000U) -#define FREQME_CTRL_W_GT_MAX_INT_EN_SHIFT (13U) -/*! GT_MAX_INT_EN - Greater Than Maximum Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FREQME_CTRL_W_GT_MAX_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_GT_MAX_INT_EN_SHIFT)) & FREQME_CTRL_W_GT_MAX_INT_EN_MASK) - -#define FREQME_CTRL_W_RESULT_READY_INT_EN_MASK (0x4000U) -#define FREQME_CTRL_W_RESULT_READY_INT_EN_SHIFT (14U) -/*! RESULT_READY_INT_EN - Result Ready Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FREQME_CTRL_W_RESULT_READY_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_RESULT_READY_INT_EN_SHIFT)) & FREQME_CTRL_W_RESULT_READY_INT_EN_MASK) - -#define FREQME_CTRL_W_CONTINUOUS_MODE_EN_MASK (0x40000000U) -#define FREQME_CTRL_W_CONTINUOUS_MODE_EN_SHIFT (30U) -/*! CONTINUOUS_MODE_EN - Continuous Mode Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FREQME_CTRL_W_CONTINUOUS_MODE_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_CONTINUOUS_MODE_EN_SHIFT)) & FREQME_CTRL_W_CONTINUOUS_MODE_EN_MASK) - -#define FREQME_CTRL_W_MEASURE_IN_PROGRESS_MASK (0x80000000U) -#define FREQME_CTRL_W_MEASURE_IN_PROGRESS_SHIFT (31U) -/*! MEASURE_IN_PROGRESS - Measurement In Progress - * 0b0..Terminates measurement - * 0b1..Initiates measurement - */ -#define FREQME_CTRL_W_MEASURE_IN_PROGRESS(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_MEASURE_IN_PROGRESS_SHIFT)) & FREQME_CTRL_W_MEASURE_IN_PROGRESS_MASK) -/*! @} */ - -/*! @name CTRLSTAT - Control Status */ -/*! @{ */ - -#define FREQME_CTRLSTAT_REF_SCALE_MASK (0x1FU) -#define FREQME_CTRLSTAT_REF_SCALE_SHIFT (0U) -/*! REF_SCALE - Reference Scale */ -#define FREQME_CTRLSTAT_REF_SCALE(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_REF_SCALE_SHIFT)) & FREQME_CTRLSTAT_REF_SCALE_MASK) - -#define FREQME_CTRLSTAT_PULSE_MODE_MASK (0x100U) -#define FREQME_CTRLSTAT_PULSE_MODE_SHIFT (8U) -/*! PULSE_MODE - Pulse Mode - * 0b0..Frequency Measurement mode - * 0b1..Pulse Width Measurement mode - */ -#define FREQME_CTRLSTAT_PULSE_MODE(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_PULSE_MODE_SHIFT)) & FREQME_CTRLSTAT_PULSE_MODE_MASK) - -#define FREQME_CTRLSTAT_PULSE_POL_MASK (0x200U) -#define FREQME_CTRLSTAT_PULSE_POL_SHIFT (9U) -/*! PULSE_POL - Pulse Polarity - * 0b0..High period - * 0b1..Low period - */ -#define FREQME_CTRLSTAT_PULSE_POL(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_PULSE_POL_SHIFT)) & FREQME_CTRLSTAT_PULSE_POL_MASK) - -#define FREQME_CTRLSTAT_LT_MIN_INT_EN_MASK (0x1000U) -#define FREQME_CTRLSTAT_LT_MIN_INT_EN_SHIFT (12U) -/*! LT_MIN_INT_EN - Less Than Minimum Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define FREQME_CTRLSTAT_LT_MIN_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_LT_MIN_INT_EN_SHIFT)) & FREQME_CTRLSTAT_LT_MIN_INT_EN_MASK) - -#define FREQME_CTRLSTAT_GT_MAX_INT_EN_MASK (0x2000U) -#define FREQME_CTRLSTAT_GT_MAX_INT_EN_SHIFT (13U) -/*! GT_MAX_INT_EN - Greater Than Maximum Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define FREQME_CTRLSTAT_GT_MAX_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_GT_MAX_INT_EN_SHIFT)) & FREQME_CTRLSTAT_GT_MAX_INT_EN_MASK) - -#define FREQME_CTRLSTAT_RESULT_READY_INT_EN_MASK (0x4000U) -#define FREQME_CTRLSTAT_RESULT_READY_INT_EN_SHIFT (14U) -/*! RESULT_READY_INT_EN - Result Ready Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define FREQME_CTRLSTAT_RESULT_READY_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_RESULT_READY_INT_EN_SHIFT)) & FREQME_CTRLSTAT_RESULT_READY_INT_EN_MASK) - -#define FREQME_CTRLSTAT_LT_MIN_STAT_MASK (0x1000000U) -#define FREQME_CTRLSTAT_LT_MIN_STAT_SHIFT (24U) -/*! LT_MIN_STAT - Less Than Minimum Results Status - * 0b0..Greater than MIN[MIN_VALUE] - * 0b1..Less than MIN[MIN_VALUE] - */ -#define FREQME_CTRLSTAT_LT_MIN_STAT(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_LT_MIN_STAT_SHIFT)) & FREQME_CTRLSTAT_LT_MIN_STAT_MASK) - -#define FREQME_CTRLSTAT_GT_MAX_STAT_MASK (0x2000000U) -#define FREQME_CTRLSTAT_GT_MAX_STAT_SHIFT (25U) -/*! GT_MAX_STAT - Greater Than Maximum Result Status - * 0b0..Less than MAX[MAX_VALUE] - * 0b1..Greater than MAX[MAX_VALUE] - */ -#define FREQME_CTRLSTAT_GT_MAX_STAT(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_GT_MAX_STAT_SHIFT)) & FREQME_CTRLSTAT_GT_MAX_STAT_MASK) - -#define FREQME_CTRLSTAT_RESULT_READY_STAT_MASK (0x4000000U) -#define FREQME_CTRLSTAT_RESULT_READY_STAT_SHIFT (26U) -/*! RESULT_READY_STAT - Result Ready Status - * 0b0..Not complete - * 0b1..Complete - */ -#define FREQME_CTRLSTAT_RESULT_READY_STAT(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_RESULT_READY_STAT_SHIFT)) & FREQME_CTRLSTAT_RESULT_READY_STAT_MASK) - -#define FREQME_CTRLSTAT_CONTINUOUS_MODE_EN_MASK (0x40000000U) -#define FREQME_CTRLSTAT_CONTINUOUS_MODE_EN_SHIFT (30U) -/*! CONTINUOUS_MODE_EN - Continuous Mode Enable Status - * 0b0..Disabled - * 0b1..Enabled - */ -#define FREQME_CTRLSTAT_CONTINUOUS_MODE_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_CONTINUOUS_MODE_EN_SHIFT)) & FREQME_CTRLSTAT_CONTINUOUS_MODE_EN_MASK) - -#define FREQME_CTRLSTAT_MEASURE_IN_PROGRESS_MASK (0x80000000U) -#define FREQME_CTRLSTAT_MEASURE_IN_PROGRESS_SHIFT (31U) -/*! MEASURE_IN_PROGRESS - Measurement in Progress Status - * 0b0..Not in progress - * 0b1..In progress - */ -#define FREQME_CTRLSTAT_MEASURE_IN_PROGRESS(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_MEASURE_IN_PROGRESS_SHIFT)) & FREQME_CTRLSTAT_MEASURE_IN_PROGRESS_MASK) -/*! @} */ - -/*! @name MIN - Minimum */ -/*! @{ */ - -#define FREQME_MIN_MIN_VALUE_MASK (0x7FFFFFFFU) -#define FREQME_MIN_MIN_VALUE_SHIFT (0U) -/*! MIN_VALUE - Minimum Value */ -#define FREQME_MIN_MIN_VALUE(x) (((uint32_t)(((uint32_t)(x)) << FREQME_MIN_MIN_VALUE_SHIFT)) & FREQME_MIN_MIN_VALUE_MASK) -/*! @} */ - -/*! @name MAX - Maximum */ -/*! @{ */ - -#define FREQME_MAX_MAX_VALUE_MASK (0x7FFFFFFFU) -#define FREQME_MAX_MAX_VALUE_SHIFT (0U) -/*! MAX_VALUE - Maximum Value */ -#define FREQME_MAX_MAX_VALUE(x) (((uint32_t)(((uint32_t)(x)) << FREQME_MAX_MAX_VALUE_SHIFT)) & FREQME_MAX_MAX_VALUE_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group FREQME_Register_Masks */ - - -/* FREQME - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral FREQME0 base address */ - #define FREQME0_BASE (0x50011000u) - /** Peripheral FREQME0 base address */ - #define FREQME0_BASE_NS (0x40011000u) - /** Peripheral FREQME0 base pointer */ - #define FREQME0 ((FREQME_Type *)FREQME0_BASE) - /** Peripheral FREQME0 base pointer */ - #define FREQME0_NS ((FREQME_Type *)FREQME0_BASE_NS) - /** Array initializer of FREQME peripheral base addresses */ - #define FREQME_BASE_ADDRS { FREQME0_BASE } - /** Array initializer of FREQME peripheral base pointers */ - #define FREQME_BASE_PTRS { FREQME0 } - /** Array initializer of FREQME peripheral base addresses */ - #define FREQME_BASE_ADDRS_NS { FREQME0_BASE_NS } - /** Array initializer of FREQME peripheral base pointers */ - #define FREQME_BASE_PTRS_NS { FREQME0_NS } -#else - /** Peripheral FREQME0 base address */ - #define FREQME0_BASE (0x40011000u) - /** Peripheral FREQME0 base pointer */ - #define FREQME0 ((FREQME_Type *)FREQME0_BASE) - /** Array initializer of FREQME peripheral base addresses */ - #define FREQME_BASE_ADDRS { FREQME0_BASE } - /** Array initializer of FREQME peripheral base pointers */ - #define FREQME_BASE_PTRS { FREQME0 } -#endif -/** Interrupt vectors for the FREQME peripheral type */ -#define FREQME_IRQS { Freqme_IRQn } - -/*! - * @} - */ /* end of group FREQME_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- GDET Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup GDET_Peripheral_Access_Layer GDET Peripheral Access Layer - * @{ - */ - -/** GDET - Register Layout Typedef */ -typedef struct { - __IO uint32_t GDET_CONF_0; /**< GDET Configuration 0 Register, offset: 0x0 */ - __IO uint32_t GDET_CONF_1; /**< GDET Configuration 1 Register, offset: 0x4 */ - __IO uint32_t GDET_ENABLE1; /**< GDET Enable Register, offset: 0x8 */ - __IO uint32_t GDET_CONF_2; /**< GDET Configuration 2 Register, offset: 0xC */ - __IO uint32_t GDET_CONF_3; /**< GDET Configuration 3 Register, offset: 0x10 */ - __IO uint32_t GDET_CONF_4; /**< GDET Configuration 4 Register, offset: 0x14 */ - __IO uint32_t GDET_CONF_5; /**< GDET Configuration 5 Register, offset: 0x18 */ - uint8_t RESERVED_0[4004]; - __IO uint32_t GDET_RESET; /**< GDET Reset Register, offset: 0xFC0 */ - __IO uint32_t GDET_TEST; /**< GDET Test Register, offset: 0xFC4 */ - uint8_t RESERVED_1[4]; - __IO uint32_t GDET_DLY_CTRL; /**< GDET Delay Control Register, offset: 0xFCC */ -} GDET_Type; - -/* ---------------------------------------------------------------------------- - -- GDET Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup GDET_Register_Masks GDET Register Masks - * @{ - */ - -/*! @name GDET_CONF_0 - GDET Configuration 0 Register */ -/*! @{ */ - -#define GDET_GDET_CONF_0_FIELD_3_0_MASK (0xFU) -#define GDET_GDET_CONF_0_FIELD_3_0_SHIFT (0U) -/*! FIELD_3_0 - GDET Configuration 0 Field 3_0 */ -#define GDET_GDET_CONF_0_FIELD_3_0(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_0_FIELD_3_0_SHIFT)) & GDET_GDET_CONF_0_FIELD_3_0_MASK) - -#define GDET_GDET_CONF_0_SBZ_MASK (0x10U) -#define GDET_GDET_CONF_0_SBZ_SHIFT (4U) -/*! SBZ - Should Be Left to Zero */ -#define GDET_GDET_CONF_0_SBZ(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_0_SBZ_SHIFT)) & GDET_GDET_CONF_0_SBZ_MASK) - -#define GDET_GDET_CONF_0_RFU_MASK (0xFFFFFFE0U) -#define GDET_GDET_CONF_0_RFU_SHIFT (5U) -/*! RFU - Reserved for Future Use */ -#define GDET_GDET_CONF_0_RFU(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_0_RFU_SHIFT)) & GDET_GDET_CONF_0_RFU_MASK) -/*! @} */ - -/*! @name GDET_CONF_1 - GDET Configuration 1 Register */ -/*! @{ */ - -#define GDET_GDET_CONF_1_FIELD_1_0_MASK (0x3U) -#define GDET_GDET_CONF_1_FIELD_1_0_SHIFT (0U) -/*! FIELD_1_0 - GDET Configuration 1 Field 1_0 */ -#define GDET_GDET_CONF_1_FIELD_1_0(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_FIELD_1_0_SHIFT)) & GDET_GDET_CONF_1_FIELD_1_0_MASK) - -#define GDET_GDET_CONF_1_FIELD_3_2_MASK (0xCU) -#define GDET_GDET_CONF_1_FIELD_3_2_SHIFT (2U) -/*! FIELD_3_2 - GDET Configuration 1 Field 3_2 */ -#define GDET_GDET_CONF_1_FIELD_3_2(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_FIELD_3_2_SHIFT)) & GDET_GDET_CONF_1_FIELD_3_2_MASK) - -#define GDET_GDET_CONF_1_SBZ1_MASK (0x10U) -#define GDET_GDET_CONF_1_SBZ1_SHIFT (4U) -/*! SBZ1 - Should Be Left to Zero */ -#define GDET_GDET_CONF_1_SBZ1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_SBZ1_SHIFT)) & GDET_GDET_CONF_1_SBZ1_MASK) - -#define GDET_GDET_CONF_1_SBZ2_MASK (0x20U) -#define GDET_GDET_CONF_1_SBZ2_SHIFT (5U) -/*! SBZ2 - Should Be Left to Zero */ -#define GDET_GDET_CONF_1_SBZ2(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_SBZ2_SHIFT)) & GDET_GDET_CONF_1_SBZ2_MASK) - -#define GDET_GDET_CONF_1_SBZ3_MASK (0x40U) -#define GDET_GDET_CONF_1_SBZ3_SHIFT (6U) -/*! SBZ3 - Should Be Left to Zero */ -#define GDET_GDET_CONF_1_SBZ3(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_SBZ3_SHIFT)) & GDET_GDET_CONF_1_SBZ3_MASK) - -#define GDET_GDET_CONF_1_FIELD_7_MASK (0x80U) -#define GDET_GDET_CONF_1_FIELD_7_SHIFT (7U) -/*! FIELD_7 - GDET Configuration 1 Field 7 */ -#define GDET_GDET_CONF_1_FIELD_7(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_FIELD_7_SHIFT)) & GDET_GDET_CONF_1_FIELD_7_MASK) - -#define GDET_GDET_CONF_1_FIELD_8_MASK (0x100U) -#define GDET_GDET_CONF_1_FIELD_8_SHIFT (8U) -/*! FIELD_8 - GDET Configuration 1 Field 8 */ -#define GDET_GDET_CONF_1_FIELD_8(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_FIELD_8_SHIFT)) & GDET_GDET_CONF_1_FIELD_8_MASK) - -#define GDET_GDET_CONF_1_SBZ4_MASK (0x200U) -#define GDET_GDET_CONF_1_SBZ4_SHIFT (9U) -/*! SBZ4 - Should Be Left to Zero */ -#define GDET_GDET_CONF_1_SBZ4(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_SBZ4_SHIFT)) & GDET_GDET_CONF_1_SBZ4_MASK) - -#define GDET_GDET_CONF_1_SBZ5_MASK (0x400U) -#define GDET_GDET_CONF_1_SBZ5_SHIFT (10U) -/*! SBZ5 - Should Be Left to Zero */ -#define GDET_GDET_CONF_1_SBZ5(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_SBZ5_SHIFT)) & GDET_GDET_CONF_1_SBZ5_MASK) - -#define GDET_GDET_CONF_1_RFU_MASK (0xFFFFF800U) -#define GDET_GDET_CONF_1_RFU_SHIFT (11U) -/*! RFU - Reserved for Future Use */ -#define GDET_GDET_CONF_1_RFU(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_RFU_SHIFT)) & GDET_GDET_CONF_1_RFU_MASK) -/*! @} */ - -/*! @name GDET_ENABLE1 - GDET Enable Register */ -/*! @{ */ - -#define GDET_GDET_ENABLE1_EN1_MASK (0x1U) -#define GDET_GDET_ENABLE1_EN1_SHIFT (0U) -/*! EN1 - If set, the detector will be clock gated */ -#define GDET_GDET_ENABLE1_EN1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_ENABLE1_EN1_SHIFT)) & GDET_GDET_ENABLE1_EN1_MASK) - -#define GDET_GDET_ENABLE1_RFU_MASK (0xFFFFFFFEU) -#define GDET_GDET_ENABLE1_RFU_SHIFT (1U) -/*! RFU - Reserved for Future Use */ -#define GDET_GDET_ENABLE1_RFU(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_ENABLE1_RFU_SHIFT)) & GDET_GDET_ENABLE1_RFU_MASK) -/*! @} */ - -/*! @name GDET_CONF_2 - GDET Configuration 2 Register */ -/*! @{ */ - -#define GDET_GDET_CONF_2_FIELD_6_0_MASK (0x7FU) -#define GDET_GDET_CONF_2_FIELD_6_0_SHIFT (0U) -/*! FIELD_6_0 - GDET Configuration 2 Field 6_0 */ -#define GDET_GDET_CONF_2_FIELD_6_0(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_2_FIELD_6_0_SHIFT)) & GDET_GDET_CONF_2_FIELD_6_0_MASK) - -#define GDET_GDET_CONF_2_RFU1_MASK (0xFF80U) -#define GDET_GDET_CONF_2_RFU1_SHIFT (7U) -/*! RFU1 - Reserved for Future Use */ -#define GDET_GDET_CONF_2_RFU1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_2_RFU1_SHIFT)) & GDET_GDET_CONF_2_RFU1_MASK) - -#define GDET_GDET_CONF_2_FIELD_21_16_MASK (0x3F0000U) -#define GDET_GDET_CONF_2_FIELD_21_16_SHIFT (16U) -/*! FIELD_21_16 - GDET Configuration 2 Field 21_16 */ -#define GDET_GDET_CONF_2_FIELD_21_16(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_2_FIELD_21_16_SHIFT)) & GDET_GDET_CONF_2_FIELD_21_16_MASK) - -#define GDET_GDET_CONF_2_RFU2_MASK (0xC00000U) -#define GDET_GDET_CONF_2_RFU2_SHIFT (22U) -/*! RFU2 - Reserved for Future Use */ -#define GDET_GDET_CONF_2_RFU2(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_2_RFU2_SHIFT)) & GDET_GDET_CONF_2_RFU2_MASK) - -#define GDET_GDET_CONF_2_FIELD_29_24_MASK (0x3F000000U) -#define GDET_GDET_CONF_2_FIELD_29_24_SHIFT (24U) -/*! FIELD_29_24 - GDET Configuration 2 Field 29_24 */ -#define GDET_GDET_CONF_2_FIELD_29_24(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_2_FIELD_29_24_SHIFT)) & GDET_GDET_CONF_2_FIELD_29_24_MASK) - -#define GDET_GDET_CONF_2_RFU3_MASK (0xC0000000U) -#define GDET_GDET_CONF_2_RFU3_SHIFT (30U) -/*! RFU3 - Reserved for Future Use */ -#define GDET_GDET_CONF_2_RFU3(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_2_RFU3_SHIFT)) & GDET_GDET_CONF_2_RFU3_MASK) -/*! @} */ - -/*! @name GDET_CONF_3 - GDET Configuration 3 Register */ -/*! @{ */ - -#define GDET_GDET_CONF_3_FIELD_6_0_MASK (0x7FU) -#define GDET_GDET_CONF_3_FIELD_6_0_SHIFT (0U) -/*! FIELD_6_0 - GDET Configuration 3 Field 6_0 */ -#define GDET_GDET_CONF_3_FIELD_6_0(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_3_FIELD_6_0_SHIFT)) & GDET_GDET_CONF_3_FIELD_6_0_MASK) - -#define GDET_GDET_CONF_3_RFU1_MASK (0xFFFFFF80U) -#define GDET_GDET_CONF_3_RFU1_SHIFT (7U) -/*! RFU1 - Reserved for Future Use */ -#define GDET_GDET_CONF_3_RFU1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_3_RFU1_SHIFT)) & GDET_GDET_CONF_3_RFU1_MASK) -/*! @} */ - -/*! @name GDET_CONF_4 - GDET Configuration 4 Register */ -/*! @{ */ - -#define GDET_GDET_CONF_4_FIELD_6_0_MASK (0x7FU) -#define GDET_GDET_CONF_4_FIELD_6_0_SHIFT (0U) -/*! FIELD_6_0 - GDET Configuration 4 Field 6_0 */ -#define GDET_GDET_CONF_4_FIELD_6_0(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_4_FIELD_6_0_SHIFT)) & GDET_GDET_CONF_4_FIELD_6_0_MASK) - -#define GDET_GDET_CONF_4_RFU1_MASK (0xFFFFFF80U) -#define GDET_GDET_CONF_4_RFU1_SHIFT (7U) -/*! RFU1 - Reserved for Future Use */ -#define GDET_GDET_CONF_4_RFU1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_4_RFU1_SHIFT)) & GDET_GDET_CONF_4_RFU1_MASK) -/*! @} */ - -/*! @name GDET_CONF_5 - GDET Configuration 5 Register */ -/*! @{ */ - -#define GDET_GDET_CONF_5_FIELD_5_0_MASK (0x3FU) -#define GDET_GDET_CONF_5_FIELD_5_0_SHIFT (0U) -/*! FIELD_5_0 - GDET Configuration 5 Field 5_0 */ -#define GDET_GDET_CONF_5_FIELD_5_0(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_5_FIELD_5_0_SHIFT)) & GDET_GDET_CONF_5_FIELD_5_0_MASK) - -#define GDET_GDET_CONF_5_FIELD_11_6_MASK (0xFC0U) -#define GDET_GDET_CONF_5_FIELD_11_6_SHIFT (6U) -/*! FIELD_11_6 - GDET Configuration 5 Field 11_6 */ -#define GDET_GDET_CONF_5_FIELD_11_6(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_5_FIELD_11_6_SHIFT)) & GDET_GDET_CONF_5_FIELD_11_6_MASK) - -#define GDET_GDET_CONF_5_RFU1_MASK (0xFFFFF000U) -#define GDET_GDET_CONF_5_RFU1_SHIFT (12U) -/*! RFU1 - Reserved for Future Use */ -#define GDET_GDET_CONF_5_RFU1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_5_RFU1_SHIFT)) & GDET_GDET_CONF_5_RFU1_MASK) -/*! @} */ - -/*! @name GDET_RESET - GDET Reset Register */ -/*! @{ */ - -#define GDET_GDET_RESET_RFU1_MASK (0x7U) -#define GDET_GDET_RESET_RFU1_SHIFT (0U) -/*! RFU1 - Reserved for Future Use */ -#define GDET_GDET_RESET_RFU1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_RESET_RFU1_SHIFT)) & GDET_GDET_RESET_RFU1_MASK) - -#define GDET_GDET_RESET_SFT_RST_MASK (0x8U) -#define GDET_GDET_RESET_SFT_RST_SHIFT (3U) -/*! SFT_RST - Soft Reset for the Core Reset */ -#define GDET_GDET_RESET_SFT_RST(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_RESET_SFT_RST_SHIFT)) & GDET_GDET_RESET_SFT_RST_MASK) - -#define GDET_GDET_RESET_RFU2_MASK (0xFFFFFFF0U) -#define GDET_GDET_RESET_RFU2_SHIFT (4U) -/*! RFU2 - Reserved for Future Use */ -#define GDET_GDET_RESET_RFU2(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_RESET_RFU2_SHIFT)) & GDET_GDET_RESET_RFU2_MASK) -/*! @} */ - -/*! @name GDET_TEST - GDET Test Register */ -/*! @{ */ - -#define GDET_GDET_TEST_SBZ_MASK (0x1U) -#define GDET_GDET_TEST_SBZ_SHIFT (0U) -/*! SBZ - Should Be Left to Zero */ -#define GDET_GDET_TEST_SBZ(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_TEST_SBZ_SHIFT)) & GDET_GDET_TEST_SBZ_MASK) - -#define GDET_GDET_TEST_RFU_MASK (0xFFFFFFFEU) -#define GDET_GDET_TEST_RFU_SHIFT (1U) -/*! RFU - Reserved for Future Use */ -#define GDET_GDET_TEST_RFU(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_TEST_RFU_SHIFT)) & GDET_GDET_TEST_RFU_MASK) -/*! @} */ - -/*! @name GDET_DLY_CTRL - GDET Delay Control Register */ -/*! @{ */ - -#define GDET_GDET_DLY_CTRL_VOL_SEL_MASK (0x3U) -#define GDET_GDET_DLY_CTRL_VOL_SEL_SHIFT (0U) -/*! VOL_SEL - GDET Delay Control of the Voltage Mode */ -#define GDET_GDET_DLY_CTRL_VOL_SEL(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_DLY_CTRL_VOL_SEL_SHIFT)) & GDET_GDET_DLY_CTRL_VOL_SEL_MASK) - -#define GDET_GDET_DLY_CTRL_SW_VOL_CTRL_MASK (0x4U) -#define GDET_GDET_DLY_CTRL_SW_VOL_CTRL_SHIFT (2U) -/*! SW_VOL_CTRL - Select the Control of the Trim Code to the Delay Line */ -#define GDET_GDET_DLY_CTRL_SW_VOL_CTRL(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_DLY_CTRL_SW_VOL_CTRL_SHIFT)) & GDET_GDET_DLY_CTRL_SW_VOL_CTRL_MASK) - -#define GDET_GDET_DLY_CTRL_RFU_MASK (0xFFFFFFF8U) -#define GDET_GDET_DLY_CTRL_RFU_SHIFT (3U) -/*! RFU - Reserved for Future Use */ -#define GDET_GDET_DLY_CTRL_RFU(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_DLY_CTRL_RFU_SHIFT)) & GDET_GDET_DLY_CTRL_RFU_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group GDET_Register_Masks */ - - -/* GDET - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral GDET0 base address */ - #define GDET0_BASE (0x50024000u) - /** Peripheral GDET0 base address */ - #define GDET0_BASE_NS (0x40024000u) - /** Peripheral GDET0 base pointer */ - #define GDET0 ((GDET_Type *)GDET0_BASE) - /** Peripheral GDET0 base pointer */ - #define GDET0_NS ((GDET_Type *)GDET0_BASE_NS) - /** Peripheral GDET1 base address */ - #define GDET1_BASE (0x50025000u) - /** Peripheral GDET1 base address */ - #define GDET1_BASE_NS (0x40025000u) - /** Peripheral GDET1 base pointer */ - #define GDET1 ((GDET_Type *)GDET1_BASE) - /** Peripheral GDET1 base pointer */ - #define GDET1_NS ((GDET_Type *)GDET1_BASE_NS) - /** Array initializer of GDET peripheral base addresses */ - #define GDET_BASE_ADDRS { GDET0_BASE, GDET1_BASE } - /** Array initializer of GDET peripheral base pointers */ - #define GDET_BASE_PTRS { GDET0, GDET1 } - /** Array initializer of GDET peripheral base addresses */ - #define GDET_BASE_ADDRS_NS { GDET0_BASE_NS, GDET1_BASE_NS } - /** Array initializer of GDET peripheral base pointers */ - #define GDET_BASE_PTRS_NS { GDET0_NS, GDET1_NS } -#else - /** Peripheral GDET0 base address */ - #define GDET0_BASE (0x40024000u) - /** Peripheral GDET0 base pointer */ - #define GDET0 ((GDET_Type *)GDET0_BASE) - /** Peripheral GDET1 base address */ - #define GDET1_BASE (0x40025000u) - /** Peripheral GDET1 base pointer */ - #define GDET1 ((GDET_Type *)GDET1_BASE) - /** Array initializer of GDET peripheral base addresses */ - #define GDET_BASE_ADDRS { GDET0_BASE, GDET1_BASE } - /** Array initializer of GDET peripheral base pointers */ - #define GDET_BASE_PTRS { GDET0, GDET1 } -#endif - -/*! - * @} - */ /* end of group GDET_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- GPIO Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup GPIO_Peripheral_Access_Layer GPIO Peripheral Access Layer - * @{ - */ - -/** GPIO - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - uint8_t RESERVED_0[4]; - __IO uint32_t LOCK; /**< Lock, offset: 0xC */ - __IO uint32_t PCNS; /**< Pin Control Nonsecure, offset: 0x10 */ - __IO uint32_t ICNS; /**< Interrupt Control Nonsecure, offset: 0x14 */ - __IO uint32_t PCNP; /**< Pin Control Nonprivilege, offset: 0x18 */ - __IO uint32_t ICNP; /**< Interrupt Control Nonprivilege, offset: 0x1C */ - uint8_t RESERVED_1[32]; - __IO uint32_t PDOR; /**< Port Data Output, offset: 0x40 */ - __O uint32_t PSOR; /**< Port Set Output, offset: 0x44 */ - __O uint32_t PCOR; /**< Port Clear Output, offset: 0x48 */ - __O uint32_t PTOR; /**< Port Toggle Output, offset: 0x4C */ - __I uint32_t PDIR; /**< Port Data Input, offset: 0x50 */ - __IO uint32_t PDDR; /**< Port Data Direction, offset: 0x54 */ - __IO uint32_t PIDR; /**< Port Input Disable, offset: 0x58 */ - uint8_t RESERVED_2[4]; - __IO uint8_t PDR[32]; /**< Pin Data, array offset: 0x60, array step: 0x1 */ - __IO uint32_t ICR[32]; /**< Interrupt Control 0..Interrupt Control 31, array offset: 0x80, array step: 0x4 */ - __O uint32_t GICLR; /**< Global Interrupt Control Low, offset: 0x100 */ - __O uint32_t GICHR; /**< Global Interrupt Control High, offset: 0x104 */ - uint8_t RESERVED_3[24]; - __IO uint32_t ISFR[2]; /**< Interrupt Status Flag, array offset: 0x120, array step: 0x4 */ -} GPIO_Type; - -/* ---------------------------------------------------------------------------- - -- GPIO Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup GPIO_Register_Masks GPIO Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define GPIO_VERID_FEATURE_MASK (0xFFFFU) -#define GPIO_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Basic implementation - * 0b0000000000000001..Protection registers implemented - */ -#define GPIO_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << GPIO_VERID_FEATURE_SHIFT)) & GPIO_VERID_FEATURE_MASK) - -#define GPIO_VERID_MINOR_MASK (0xFF0000U) -#define GPIO_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define GPIO_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << GPIO_VERID_MINOR_SHIFT)) & GPIO_VERID_MINOR_MASK) - -#define GPIO_VERID_MAJOR_MASK (0xFF000000U) -#define GPIO_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define GPIO_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << GPIO_VERID_MAJOR_SHIFT)) & GPIO_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define GPIO_PARAM_IRQNUM_MASK (0xFU) -#define GPIO_PARAM_IRQNUM_SHIFT (0U) -/*! IRQNUM - Interrupt Number */ -#define GPIO_PARAM_IRQNUM(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PARAM_IRQNUM_SHIFT)) & GPIO_PARAM_IRQNUM_MASK) -/*! @} */ - -/*! @name LOCK - Lock */ -/*! @{ */ - -#define GPIO_LOCK_PCNS_MASK (0x1U) -#define GPIO_LOCK_PCNS_SHIFT (0U) -/*! PCNS - Lock PCNS - * 0b0..Writable in Secure-Privilege state - * 0b1..Not writable until the next reset - */ -#define GPIO_LOCK_PCNS(x) (((uint32_t)(((uint32_t)(x)) << GPIO_LOCK_PCNS_SHIFT)) & GPIO_LOCK_PCNS_MASK) - -#define GPIO_LOCK_ICNS_MASK (0x2U) -#define GPIO_LOCK_ICNS_SHIFT (1U) -/*! ICNS - Lock ICNS - * 0b0..Writable in Secure-Privilege state - * 0b1..Not writable until the next reset - */ -#define GPIO_LOCK_ICNS(x) (((uint32_t)(((uint32_t)(x)) << GPIO_LOCK_ICNS_SHIFT)) & GPIO_LOCK_ICNS_MASK) - -#define GPIO_LOCK_PCNP_MASK (0x4U) -#define GPIO_LOCK_PCNP_SHIFT (2U) -/*! PCNP - Lock PCNP - * 0b0..Writable in Secure-Privilege state - * 0b1..Not writable until the next reset - */ -#define GPIO_LOCK_PCNP(x) (((uint32_t)(((uint32_t)(x)) << GPIO_LOCK_PCNP_SHIFT)) & GPIO_LOCK_PCNP_MASK) - -#define GPIO_LOCK_ICNP_MASK (0x8U) -#define GPIO_LOCK_ICNP_SHIFT (3U) -/*! ICNP - Lock ICNP - * 0b0..Writable in Secure-Privilege state - * 0b1..Not writable until the next reset - */ -#define GPIO_LOCK_ICNP(x) (((uint32_t)(((uint32_t)(x)) << GPIO_LOCK_ICNP_SHIFT)) & GPIO_LOCK_ICNP_MASK) -/*! @} */ - -/*! @name PCNS - Pin Control Nonsecure */ -/*! @{ */ - -#define GPIO_PCNS_NSE0_MASK (0x1U) -#define GPIO_PCNS_NSE0_SHIFT (0U) -/*! NSE0 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE0_SHIFT)) & GPIO_PCNS_NSE0_MASK) - -#define GPIO_PCNS_NSE1_MASK (0x2U) -#define GPIO_PCNS_NSE1_SHIFT (1U) -/*! NSE1 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE1_SHIFT)) & GPIO_PCNS_NSE1_MASK) - -#define GPIO_PCNS_NSE2_MASK (0x4U) -#define GPIO_PCNS_NSE2_SHIFT (2U) -/*! NSE2 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE2_SHIFT)) & GPIO_PCNS_NSE2_MASK) - -#define GPIO_PCNS_NSE3_MASK (0x8U) -#define GPIO_PCNS_NSE3_SHIFT (3U) -/*! NSE3 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE3_SHIFT)) & GPIO_PCNS_NSE3_MASK) - -#define GPIO_PCNS_NSE4_MASK (0x10U) -#define GPIO_PCNS_NSE4_SHIFT (4U) -/*! NSE4 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE4_SHIFT)) & GPIO_PCNS_NSE4_MASK) - -#define GPIO_PCNS_NSE5_MASK (0x20U) -#define GPIO_PCNS_NSE5_SHIFT (5U) -/*! NSE5 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE5_SHIFT)) & GPIO_PCNS_NSE5_MASK) - -#define GPIO_PCNS_NSE6_MASK (0x40U) -#define GPIO_PCNS_NSE6_SHIFT (6U) -/*! NSE6 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE6_SHIFT)) & GPIO_PCNS_NSE6_MASK) - -#define GPIO_PCNS_NSE7_MASK (0x80U) -#define GPIO_PCNS_NSE7_SHIFT (7U) -/*! NSE7 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE7_SHIFT)) & GPIO_PCNS_NSE7_MASK) - -#define GPIO_PCNS_NSE8_MASK (0x100U) -#define GPIO_PCNS_NSE8_SHIFT (8U) -/*! NSE8 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE8_SHIFT)) & GPIO_PCNS_NSE8_MASK) - -#define GPIO_PCNS_NSE9_MASK (0x200U) -#define GPIO_PCNS_NSE9_SHIFT (9U) -/*! NSE9 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE9_SHIFT)) & GPIO_PCNS_NSE9_MASK) - -#define GPIO_PCNS_NSE10_MASK (0x400U) -#define GPIO_PCNS_NSE10_SHIFT (10U) -/*! NSE10 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE10_SHIFT)) & GPIO_PCNS_NSE10_MASK) - -#define GPIO_PCNS_NSE11_MASK (0x800U) -#define GPIO_PCNS_NSE11_SHIFT (11U) -/*! NSE11 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE11_SHIFT)) & GPIO_PCNS_NSE11_MASK) - -#define GPIO_PCNS_NSE12_MASK (0x1000U) -#define GPIO_PCNS_NSE12_SHIFT (12U) -/*! NSE12 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE12_SHIFT)) & GPIO_PCNS_NSE12_MASK) - -#define GPIO_PCNS_NSE13_MASK (0x2000U) -#define GPIO_PCNS_NSE13_SHIFT (13U) -/*! NSE13 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE13_SHIFT)) & GPIO_PCNS_NSE13_MASK) - -#define GPIO_PCNS_NSE14_MASK (0x4000U) -#define GPIO_PCNS_NSE14_SHIFT (14U) -/*! NSE14 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE14_SHIFT)) & GPIO_PCNS_NSE14_MASK) - -#define GPIO_PCNS_NSE15_MASK (0x8000U) -#define GPIO_PCNS_NSE15_SHIFT (15U) -/*! NSE15 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE15_SHIFT)) & GPIO_PCNS_NSE15_MASK) - -#define GPIO_PCNS_NSE16_MASK (0x10000U) -#define GPIO_PCNS_NSE16_SHIFT (16U) -/*! NSE16 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE16_SHIFT)) & GPIO_PCNS_NSE16_MASK) - -#define GPIO_PCNS_NSE17_MASK (0x20000U) -#define GPIO_PCNS_NSE17_SHIFT (17U) -/*! NSE17 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE17_SHIFT)) & GPIO_PCNS_NSE17_MASK) - -#define GPIO_PCNS_NSE18_MASK (0x40000U) -#define GPIO_PCNS_NSE18_SHIFT (18U) -/*! NSE18 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE18_SHIFT)) & GPIO_PCNS_NSE18_MASK) - -#define GPIO_PCNS_NSE19_MASK (0x80000U) -#define GPIO_PCNS_NSE19_SHIFT (19U) -/*! NSE19 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE19_SHIFT)) & GPIO_PCNS_NSE19_MASK) - -#define GPIO_PCNS_NSE20_MASK (0x100000U) -#define GPIO_PCNS_NSE20_SHIFT (20U) -/*! NSE20 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE20_SHIFT)) & GPIO_PCNS_NSE20_MASK) - -#define GPIO_PCNS_NSE21_MASK (0x200000U) -#define GPIO_PCNS_NSE21_SHIFT (21U) -/*! NSE21 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE21_SHIFT)) & GPIO_PCNS_NSE21_MASK) - -#define GPIO_PCNS_NSE22_MASK (0x400000U) -#define GPIO_PCNS_NSE22_SHIFT (22U) -/*! NSE22 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE22_SHIFT)) & GPIO_PCNS_NSE22_MASK) - -#define GPIO_PCNS_NSE23_MASK (0x800000U) -#define GPIO_PCNS_NSE23_SHIFT (23U) -/*! NSE23 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE23_SHIFT)) & GPIO_PCNS_NSE23_MASK) - -#define GPIO_PCNS_NSE24_MASK (0x1000000U) -#define GPIO_PCNS_NSE24_SHIFT (24U) -/*! NSE24 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE24_SHIFT)) & GPIO_PCNS_NSE24_MASK) - -#define GPIO_PCNS_NSE25_MASK (0x2000000U) -#define GPIO_PCNS_NSE25_SHIFT (25U) -/*! NSE25 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE25_SHIFT)) & GPIO_PCNS_NSE25_MASK) - -#define GPIO_PCNS_NSE26_MASK (0x4000000U) -#define GPIO_PCNS_NSE26_SHIFT (26U) -/*! NSE26 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE26_SHIFT)) & GPIO_PCNS_NSE26_MASK) - -#define GPIO_PCNS_NSE27_MASK (0x8000000U) -#define GPIO_PCNS_NSE27_SHIFT (27U) -/*! NSE27 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE27_SHIFT)) & GPIO_PCNS_NSE27_MASK) - -#define GPIO_PCNS_NSE28_MASK (0x10000000U) -#define GPIO_PCNS_NSE28_SHIFT (28U) -/*! NSE28 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE28_SHIFT)) & GPIO_PCNS_NSE28_MASK) - -#define GPIO_PCNS_NSE29_MASK (0x20000000U) -#define GPIO_PCNS_NSE29_SHIFT (29U) -/*! NSE29 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE29_SHIFT)) & GPIO_PCNS_NSE29_MASK) - -#define GPIO_PCNS_NSE30_MASK (0x40000000U) -#define GPIO_PCNS_NSE30_SHIFT (30U) -/*! NSE30 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE30_SHIFT)) & GPIO_PCNS_NSE30_MASK) - -#define GPIO_PCNS_NSE31_MASK (0x80000000U) -#define GPIO_PCNS_NSE31_SHIFT (31U) -/*! NSE31 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE31_SHIFT)) & GPIO_PCNS_NSE31_MASK) -/*! @} */ - -/*! @name ICNS - Interrupt Control Nonsecure */ -/*! @{ */ - -#define GPIO_ICNS_NSE0_MASK (0x1U) -#define GPIO_ICNS_NSE0_SHIFT (0U) -/*! NSE0 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_ICNS_NSE0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ICNS_NSE0_SHIFT)) & GPIO_ICNS_NSE0_MASK) - -#define GPIO_ICNS_NSE1_MASK (0x2U) -#define GPIO_ICNS_NSE1_SHIFT (1U) -/*! NSE1 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_ICNS_NSE1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ICNS_NSE1_SHIFT)) & GPIO_ICNS_NSE1_MASK) -/*! @} */ - -/*! @name PCNP - Pin Control Nonprivilege */ -/*! @{ */ - -#define GPIO_PCNP_NPE0_MASK (0x1U) -#define GPIO_PCNP_NPE0_SHIFT (0U) -/*! NPE0 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE0_SHIFT)) & GPIO_PCNP_NPE0_MASK) - -#define GPIO_PCNP_NPE1_MASK (0x2U) -#define GPIO_PCNP_NPE1_SHIFT (1U) -/*! NPE1 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE1_SHIFT)) & GPIO_PCNP_NPE1_MASK) - -#define GPIO_PCNP_NPE2_MASK (0x4U) -#define GPIO_PCNP_NPE2_SHIFT (2U) -/*! NPE2 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE2_SHIFT)) & GPIO_PCNP_NPE2_MASK) - -#define GPIO_PCNP_NPE3_MASK (0x8U) -#define GPIO_PCNP_NPE3_SHIFT (3U) -/*! NPE3 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE3_SHIFT)) & GPIO_PCNP_NPE3_MASK) - -#define GPIO_PCNP_NPE4_MASK (0x10U) -#define GPIO_PCNP_NPE4_SHIFT (4U) -/*! NPE4 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE4_SHIFT)) & GPIO_PCNP_NPE4_MASK) - -#define GPIO_PCNP_NPE5_MASK (0x20U) -#define GPIO_PCNP_NPE5_SHIFT (5U) -/*! NPE5 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE5_SHIFT)) & GPIO_PCNP_NPE5_MASK) - -#define GPIO_PCNP_NPE6_MASK (0x40U) -#define GPIO_PCNP_NPE6_SHIFT (6U) -/*! NPE6 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE6_SHIFT)) & GPIO_PCNP_NPE6_MASK) - -#define GPIO_PCNP_NPE7_MASK (0x80U) -#define GPIO_PCNP_NPE7_SHIFT (7U) -/*! NPE7 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE7_SHIFT)) & GPIO_PCNP_NPE7_MASK) - -#define GPIO_PCNP_NPE8_MASK (0x100U) -#define GPIO_PCNP_NPE8_SHIFT (8U) -/*! NPE8 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE8_SHIFT)) & GPIO_PCNP_NPE8_MASK) - -#define GPIO_PCNP_NPE9_MASK (0x200U) -#define GPIO_PCNP_NPE9_SHIFT (9U) -/*! NPE9 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE9_SHIFT)) & GPIO_PCNP_NPE9_MASK) - -#define GPIO_PCNP_NPE10_MASK (0x400U) -#define GPIO_PCNP_NPE10_SHIFT (10U) -/*! NPE10 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE10_SHIFT)) & GPIO_PCNP_NPE10_MASK) - -#define GPIO_PCNP_NPE11_MASK (0x800U) -#define GPIO_PCNP_NPE11_SHIFT (11U) -/*! NPE11 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE11_SHIFT)) & GPIO_PCNP_NPE11_MASK) - -#define GPIO_PCNP_NPE12_MASK (0x1000U) -#define GPIO_PCNP_NPE12_SHIFT (12U) -/*! NPE12 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE12_SHIFT)) & GPIO_PCNP_NPE12_MASK) - -#define GPIO_PCNP_NPE13_MASK (0x2000U) -#define GPIO_PCNP_NPE13_SHIFT (13U) -/*! NPE13 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE13_SHIFT)) & GPIO_PCNP_NPE13_MASK) - -#define GPIO_PCNP_NPE14_MASK (0x4000U) -#define GPIO_PCNP_NPE14_SHIFT (14U) -/*! NPE14 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE14_SHIFT)) & GPIO_PCNP_NPE14_MASK) - -#define GPIO_PCNP_NPE15_MASK (0x8000U) -#define GPIO_PCNP_NPE15_SHIFT (15U) -/*! NPE15 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE15_SHIFT)) & GPIO_PCNP_NPE15_MASK) - -#define GPIO_PCNP_NPE16_MASK (0x10000U) -#define GPIO_PCNP_NPE16_SHIFT (16U) -/*! NPE16 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE16_SHIFT)) & GPIO_PCNP_NPE16_MASK) - -#define GPIO_PCNP_NPE17_MASK (0x20000U) -#define GPIO_PCNP_NPE17_SHIFT (17U) -/*! NPE17 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE17_SHIFT)) & GPIO_PCNP_NPE17_MASK) - -#define GPIO_PCNP_NPE18_MASK (0x40000U) -#define GPIO_PCNP_NPE18_SHIFT (18U) -/*! NPE18 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE18_SHIFT)) & GPIO_PCNP_NPE18_MASK) - -#define GPIO_PCNP_NPE19_MASK (0x80000U) -#define GPIO_PCNP_NPE19_SHIFT (19U) -/*! NPE19 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE19_SHIFT)) & GPIO_PCNP_NPE19_MASK) - -#define GPIO_PCNP_NPE20_MASK (0x100000U) -#define GPIO_PCNP_NPE20_SHIFT (20U) -/*! NPE20 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE20_SHIFT)) & GPIO_PCNP_NPE20_MASK) - -#define GPIO_PCNP_NPE21_MASK (0x200000U) -#define GPIO_PCNP_NPE21_SHIFT (21U) -/*! NPE21 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE21_SHIFT)) & GPIO_PCNP_NPE21_MASK) - -#define GPIO_PCNP_NPE22_MASK (0x400000U) -#define GPIO_PCNP_NPE22_SHIFT (22U) -/*! NPE22 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE22_SHIFT)) & GPIO_PCNP_NPE22_MASK) - -#define GPIO_PCNP_NPE23_MASK (0x800000U) -#define GPIO_PCNP_NPE23_SHIFT (23U) -/*! NPE23 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE23_SHIFT)) & GPIO_PCNP_NPE23_MASK) - -#define GPIO_PCNP_NPE24_MASK (0x1000000U) -#define GPIO_PCNP_NPE24_SHIFT (24U) -/*! NPE24 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE24_SHIFT)) & GPIO_PCNP_NPE24_MASK) - -#define GPIO_PCNP_NPE25_MASK (0x2000000U) -#define GPIO_PCNP_NPE25_SHIFT (25U) -/*! NPE25 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE25_SHIFT)) & GPIO_PCNP_NPE25_MASK) - -#define GPIO_PCNP_NPE26_MASK (0x4000000U) -#define GPIO_PCNP_NPE26_SHIFT (26U) -/*! NPE26 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE26_SHIFT)) & GPIO_PCNP_NPE26_MASK) - -#define GPIO_PCNP_NPE27_MASK (0x8000000U) -#define GPIO_PCNP_NPE27_SHIFT (27U) -/*! NPE27 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE27_SHIFT)) & GPIO_PCNP_NPE27_MASK) - -#define GPIO_PCNP_NPE28_MASK (0x10000000U) -#define GPIO_PCNP_NPE28_SHIFT (28U) -/*! NPE28 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE28_SHIFT)) & GPIO_PCNP_NPE28_MASK) - -#define GPIO_PCNP_NPE29_MASK (0x20000000U) -#define GPIO_PCNP_NPE29_SHIFT (29U) -/*! NPE29 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE29_SHIFT)) & GPIO_PCNP_NPE29_MASK) - -#define GPIO_PCNP_NPE30_MASK (0x40000000U) -#define GPIO_PCNP_NPE30_SHIFT (30U) -/*! NPE30 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE30_SHIFT)) & GPIO_PCNP_NPE30_MASK) - -#define GPIO_PCNP_NPE31_MASK (0x80000000U) -#define GPIO_PCNP_NPE31_SHIFT (31U) -/*! NPE31 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE31_SHIFT)) & GPIO_PCNP_NPE31_MASK) -/*! @} */ - -/*! @name ICNP - Interrupt Control Nonprivilege */ -/*! @{ */ - -#define GPIO_ICNP_NPE0_MASK (0x1U) -#define GPIO_ICNP_NPE0_SHIFT (0U) -/*! NPE0 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_ICNP_NPE0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ICNP_NPE0_SHIFT)) & GPIO_ICNP_NPE0_MASK) - -#define GPIO_ICNP_NPE1_MASK (0x2U) -#define GPIO_ICNP_NPE1_SHIFT (1U) -/*! NPE1 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_ICNP_NPE1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ICNP_NPE1_SHIFT)) & GPIO_ICNP_NPE1_MASK) -/*! @} */ - -/*! @name PDOR - Port Data Output */ -/*! @{ */ - -#define GPIO_PDOR_PDO0_MASK (0x1U) -#define GPIO_PDOR_PDO0_SHIFT (0U) -/*! PDO0 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO0_SHIFT)) & GPIO_PDOR_PDO0_MASK) - -#define GPIO_PDOR_PDO1_MASK (0x2U) -#define GPIO_PDOR_PDO1_SHIFT (1U) -/*! PDO1 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO1_SHIFT)) & GPIO_PDOR_PDO1_MASK) - -#define GPIO_PDOR_PDO2_MASK (0x4U) -#define GPIO_PDOR_PDO2_SHIFT (2U) -/*! PDO2 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO2_SHIFT)) & GPIO_PDOR_PDO2_MASK) - -#define GPIO_PDOR_PDO3_MASK (0x8U) -#define GPIO_PDOR_PDO3_SHIFT (3U) -/*! PDO3 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO3_SHIFT)) & GPIO_PDOR_PDO3_MASK) - -#define GPIO_PDOR_PDO4_MASK (0x10U) -#define GPIO_PDOR_PDO4_SHIFT (4U) -/*! PDO4 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO4_SHIFT)) & GPIO_PDOR_PDO4_MASK) - -#define GPIO_PDOR_PDO5_MASK (0x20U) -#define GPIO_PDOR_PDO5_SHIFT (5U) -/*! PDO5 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO5_SHIFT)) & GPIO_PDOR_PDO5_MASK) - -#define GPIO_PDOR_PDO6_MASK (0x40U) -#define GPIO_PDOR_PDO6_SHIFT (6U) -/*! PDO6 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO6_SHIFT)) & GPIO_PDOR_PDO6_MASK) - -#define GPIO_PDOR_PDO7_MASK (0x80U) -#define GPIO_PDOR_PDO7_SHIFT (7U) -/*! PDO7 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO7_SHIFT)) & GPIO_PDOR_PDO7_MASK) - -#define GPIO_PDOR_PDO8_MASK (0x100U) -#define GPIO_PDOR_PDO8_SHIFT (8U) -/*! PDO8 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO8_SHIFT)) & GPIO_PDOR_PDO8_MASK) - -#define GPIO_PDOR_PDO9_MASK (0x200U) -#define GPIO_PDOR_PDO9_SHIFT (9U) -/*! PDO9 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO9_SHIFT)) & GPIO_PDOR_PDO9_MASK) - -#define GPIO_PDOR_PDO10_MASK (0x400U) -#define GPIO_PDOR_PDO10_SHIFT (10U) -/*! PDO10 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO10_SHIFT)) & GPIO_PDOR_PDO10_MASK) - -#define GPIO_PDOR_PDO11_MASK (0x800U) -#define GPIO_PDOR_PDO11_SHIFT (11U) -/*! PDO11 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO11_SHIFT)) & GPIO_PDOR_PDO11_MASK) - -#define GPIO_PDOR_PDO12_MASK (0x1000U) -#define GPIO_PDOR_PDO12_SHIFT (12U) -/*! PDO12 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO12_SHIFT)) & GPIO_PDOR_PDO12_MASK) - -#define GPIO_PDOR_PDO13_MASK (0x2000U) -#define GPIO_PDOR_PDO13_SHIFT (13U) -/*! PDO13 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO13_SHIFT)) & GPIO_PDOR_PDO13_MASK) - -#define GPIO_PDOR_PDO14_MASK (0x4000U) -#define GPIO_PDOR_PDO14_SHIFT (14U) -/*! PDO14 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO14_SHIFT)) & GPIO_PDOR_PDO14_MASK) - -#define GPIO_PDOR_PDO15_MASK (0x8000U) -#define GPIO_PDOR_PDO15_SHIFT (15U) -/*! PDO15 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO15_SHIFT)) & GPIO_PDOR_PDO15_MASK) - -#define GPIO_PDOR_PDO16_MASK (0x10000U) -#define GPIO_PDOR_PDO16_SHIFT (16U) -/*! PDO16 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO16_SHIFT)) & GPIO_PDOR_PDO16_MASK) - -#define GPIO_PDOR_PDO17_MASK (0x20000U) -#define GPIO_PDOR_PDO17_SHIFT (17U) -/*! PDO17 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO17_SHIFT)) & GPIO_PDOR_PDO17_MASK) - -#define GPIO_PDOR_PDO18_MASK (0x40000U) -#define GPIO_PDOR_PDO18_SHIFT (18U) -/*! PDO18 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO18_SHIFT)) & GPIO_PDOR_PDO18_MASK) - -#define GPIO_PDOR_PDO19_MASK (0x80000U) -#define GPIO_PDOR_PDO19_SHIFT (19U) -/*! PDO19 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO19_SHIFT)) & GPIO_PDOR_PDO19_MASK) - -#define GPIO_PDOR_PDO20_MASK (0x100000U) -#define GPIO_PDOR_PDO20_SHIFT (20U) -/*! PDO20 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO20_SHIFT)) & GPIO_PDOR_PDO20_MASK) - -#define GPIO_PDOR_PDO21_MASK (0x200000U) -#define GPIO_PDOR_PDO21_SHIFT (21U) -/*! PDO21 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO21_SHIFT)) & GPIO_PDOR_PDO21_MASK) - -#define GPIO_PDOR_PDO22_MASK (0x400000U) -#define GPIO_PDOR_PDO22_SHIFT (22U) -/*! PDO22 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO22_SHIFT)) & GPIO_PDOR_PDO22_MASK) - -#define GPIO_PDOR_PDO23_MASK (0x800000U) -#define GPIO_PDOR_PDO23_SHIFT (23U) -/*! PDO23 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO23_SHIFT)) & GPIO_PDOR_PDO23_MASK) - -#define GPIO_PDOR_PDO24_MASK (0x1000000U) -#define GPIO_PDOR_PDO24_SHIFT (24U) -/*! PDO24 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO24_SHIFT)) & GPIO_PDOR_PDO24_MASK) - -#define GPIO_PDOR_PDO25_MASK (0x2000000U) -#define GPIO_PDOR_PDO25_SHIFT (25U) -/*! PDO25 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO25_SHIFT)) & GPIO_PDOR_PDO25_MASK) - -#define GPIO_PDOR_PDO26_MASK (0x4000000U) -#define GPIO_PDOR_PDO26_SHIFT (26U) -/*! PDO26 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO26_SHIFT)) & GPIO_PDOR_PDO26_MASK) - -#define GPIO_PDOR_PDO27_MASK (0x8000000U) -#define GPIO_PDOR_PDO27_SHIFT (27U) -/*! PDO27 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO27_SHIFT)) & GPIO_PDOR_PDO27_MASK) - -#define GPIO_PDOR_PDO28_MASK (0x10000000U) -#define GPIO_PDOR_PDO28_SHIFT (28U) -/*! PDO28 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO28_SHIFT)) & GPIO_PDOR_PDO28_MASK) - -#define GPIO_PDOR_PDO29_MASK (0x20000000U) -#define GPIO_PDOR_PDO29_SHIFT (29U) -/*! PDO29 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO29_SHIFT)) & GPIO_PDOR_PDO29_MASK) - -#define GPIO_PDOR_PDO30_MASK (0x40000000U) -#define GPIO_PDOR_PDO30_SHIFT (30U) -/*! PDO30 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO30_SHIFT)) & GPIO_PDOR_PDO30_MASK) - -#define GPIO_PDOR_PDO31_MASK (0x80000000U) -#define GPIO_PDOR_PDO31_SHIFT (31U) -/*! PDO31 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO31_SHIFT)) & GPIO_PDOR_PDO31_MASK) -/*! @} */ - -/*! @name PSOR - Port Set Output */ -/*! @{ */ - -#define GPIO_PSOR_PTSO0_MASK (0x1U) -#define GPIO_PSOR_PTSO0_SHIFT (0U) -/*! PTSO0 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO0_SHIFT)) & GPIO_PSOR_PTSO0_MASK) - -#define GPIO_PSOR_PTSO1_MASK (0x2U) -#define GPIO_PSOR_PTSO1_SHIFT (1U) -/*! PTSO1 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO1_SHIFT)) & GPIO_PSOR_PTSO1_MASK) - -#define GPIO_PSOR_PTSO2_MASK (0x4U) -#define GPIO_PSOR_PTSO2_SHIFT (2U) -/*! PTSO2 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO2_SHIFT)) & GPIO_PSOR_PTSO2_MASK) - -#define GPIO_PSOR_PTSO3_MASK (0x8U) -#define GPIO_PSOR_PTSO3_SHIFT (3U) -/*! PTSO3 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO3_SHIFT)) & GPIO_PSOR_PTSO3_MASK) - -#define GPIO_PSOR_PTSO4_MASK (0x10U) -#define GPIO_PSOR_PTSO4_SHIFT (4U) -/*! PTSO4 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO4_SHIFT)) & GPIO_PSOR_PTSO4_MASK) - -#define GPIO_PSOR_PTSO5_MASK (0x20U) -#define GPIO_PSOR_PTSO5_SHIFT (5U) -/*! PTSO5 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO5_SHIFT)) & GPIO_PSOR_PTSO5_MASK) - -#define GPIO_PSOR_PTSO6_MASK (0x40U) -#define GPIO_PSOR_PTSO6_SHIFT (6U) -/*! PTSO6 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO6_SHIFT)) & GPIO_PSOR_PTSO6_MASK) - -#define GPIO_PSOR_PTSO7_MASK (0x80U) -#define GPIO_PSOR_PTSO7_SHIFT (7U) -/*! PTSO7 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO7_SHIFT)) & GPIO_PSOR_PTSO7_MASK) - -#define GPIO_PSOR_PTSO8_MASK (0x100U) -#define GPIO_PSOR_PTSO8_SHIFT (8U) -/*! PTSO8 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO8_SHIFT)) & GPIO_PSOR_PTSO8_MASK) - -#define GPIO_PSOR_PTSO9_MASK (0x200U) -#define GPIO_PSOR_PTSO9_SHIFT (9U) -/*! PTSO9 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO9_SHIFT)) & GPIO_PSOR_PTSO9_MASK) - -#define GPIO_PSOR_PTSO10_MASK (0x400U) -#define GPIO_PSOR_PTSO10_SHIFT (10U) -/*! PTSO10 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO10_SHIFT)) & GPIO_PSOR_PTSO10_MASK) - -#define GPIO_PSOR_PTSO11_MASK (0x800U) -#define GPIO_PSOR_PTSO11_SHIFT (11U) -/*! PTSO11 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO11_SHIFT)) & GPIO_PSOR_PTSO11_MASK) - -#define GPIO_PSOR_PTSO12_MASK (0x1000U) -#define GPIO_PSOR_PTSO12_SHIFT (12U) -/*! PTSO12 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO12_SHIFT)) & GPIO_PSOR_PTSO12_MASK) - -#define GPIO_PSOR_PTSO13_MASK (0x2000U) -#define GPIO_PSOR_PTSO13_SHIFT (13U) -/*! PTSO13 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO13_SHIFT)) & GPIO_PSOR_PTSO13_MASK) - -#define GPIO_PSOR_PTSO14_MASK (0x4000U) -#define GPIO_PSOR_PTSO14_SHIFT (14U) -/*! PTSO14 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO14_SHIFT)) & GPIO_PSOR_PTSO14_MASK) - -#define GPIO_PSOR_PTSO15_MASK (0x8000U) -#define GPIO_PSOR_PTSO15_SHIFT (15U) -/*! PTSO15 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO15_SHIFT)) & GPIO_PSOR_PTSO15_MASK) - -#define GPIO_PSOR_PTSO16_MASK (0x10000U) -#define GPIO_PSOR_PTSO16_SHIFT (16U) -/*! PTSO16 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO16_SHIFT)) & GPIO_PSOR_PTSO16_MASK) - -#define GPIO_PSOR_PTSO17_MASK (0x20000U) -#define GPIO_PSOR_PTSO17_SHIFT (17U) -/*! PTSO17 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO17_SHIFT)) & GPIO_PSOR_PTSO17_MASK) - -#define GPIO_PSOR_PTSO18_MASK (0x40000U) -#define GPIO_PSOR_PTSO18_SHIFT (18U) -/*! PTSO18 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO18_SHIFT)) & GPIO_PSOR_PTSO18_MASK) - -#define GPIO_PSOR_PTSO19_MASK (0x80000U) -#define GPIO_PSOR_PTSO19_SHIFT (19U) -/*! PTSO19 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO19_SHIFT)) & GPIO_PSOR_PTSO19_MASK) - -#define GPIO_PSOR_PTSO20_MASK (0x100000U) -#define GPIO_PSOR_PTSO20_SHIFT (20U) -/*! PTSO20 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO20_SHIFT)) & GPIO_PSOR_PTSO20_MASK) - -#define GPIO_PSOR_PTSO21_MASK (0x200000U) -#define GPIO_PSOR_PTSO21_SHIFT (21U) -/*! PTSO21 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO21_SHIFT)) & GPIO_PSOR_PTSO21_MASK) - -#define GPIO_PSOR_PTSO22_MASK (0x400000U) -#define GPIO_PSOR_PTSO22_SHIFT (22U) -/*! PTSO22 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO22_SHIFT)) & GPIO_PSOR_PTSO22_MASK) - -#define GPIO_PSOR_PTSO23_MASK (0x800000U) -#define GPIO_PSOR_PTSO23_SHIFT (23U) -/*! PTSO23 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO23_SHIFT)) & GPIO_PSOR_PTSO23_MASK) - -#define GPIO_PSOR_PTSO24_MASK (0x1000000U) -#define GPIO_PSOR_PTSO24_SHIFT (24U) -/*! PTSO24 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO24_SHIFT)) & GPIO_PSOR_PTSO24_MASK) - -#define GPIO_PSOR_PTSO25_MASK (0x2000000U) -#define GPIO_PSOR_PTSO25_SHIFT (25U) -/*! PTSO25 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO25_SHIFT)) & GPIO_PSOR_PTSO25_MASK) - -#define GPIO_PSOR_PTSO26_MASK (0x4000000U) -#define GPIO_PSOR_PTSO26_SHIFT (26U) -/*! PTSO26 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO26_SHIFT)) & GPIO_PSOR_PTSO26_MASK) - -#define GPIO_PSOR_PTSO27_MASK (0x8000000U) -#define GPIO_PSOR_PTSO27_SHIFT (27U) -/*! PTSO27 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO27_SHIFT)) & GPIO_PSOR_PTSO27_MASK) - -#define GPIO_PSOR_PTSO28_MASK (0x10000000U) -#define GPIO_PSOR_PTSO28_SHIFT (28U) -/*! PTSO28 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO28_SHIFT)) & GPIO_PSOR_PTSO28_MASK) - -#define GPIO_PSOR_PTSO29_MASK (0x20000000U) -#define GPIO_PSOR_PTSO29_SHIFT (29U) -/*! PTSO29 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO29_SHIFT)) & GPIO_PSOR_PTSO29_MASK) - -#define GPIO_PSOR_PTSO30_MASK (0x40000000U) -#define GPIO_PSOR_PTSO30_SHIFT (30U) -/*! PTSO30 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO30_SHIFT)) & GPIO_PSOR_PTSO30_MASK) - -#define GPIO_PSOR_PTSO31_MASK (0x80000000U) -#define GPIO_PSOR_PTSO31_SHIFT (31U) -/*! PTSO31 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO31_SHIFT)) & GPIO_PSOR_PTSO31_MASK) -/*! @} */ - -/*! @name PCOR - Port Clear Output */ -/*! @{ */ - -#define GPIO_PCOR_PTCO0_MASK (0x1U) -#define GPIO_PCOR_PTCO0_SHIFT (0U) -/*! PTCO0 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO0_SHIFT)) & GPIO_PCOR_PTCO0_MASK) - -#define GPIO_PCOR_PTCO1_MASK (0x2U) -#define GPIO_PCOR_PTCO1_SHIFT (1U) -/*! PTCO1 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO1_SHIFT)) & GPIO_PCOR_PTCO1_MASK) - -#define GPIO_PCOR_PTCO2_MASK (0x4U) -#define GPIO_PCOR_PTCO2_SHIFT (2U) -/*! PTCO2 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO2_SHIFT)) & GPIO_PCOR_PTCO2_MASK) - -#define GPIO_PCOR_PTCO3_MASK (0x8U) -#define GPIO_PCOR_PTCO3_SHIFT (3U) -/*! PTCO3 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO3_SHIFT)) & GPIO_PCOR_PTCO3_MASK) - -#define GPIO_PCOR_PTCO4_MASK (0x10U) -#define GPIO_PCOR_PTCO4_SHIFT (4U) -/*! PTCO4 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO4_SHIFT)) & GPIO_PCOR_PTCO4_MASK) - -#define GPIO_PCOR_PTCO5_MASK (0x20U) -#define GPIO_PCOR_PTCO5_SHIFT (5U) -/*! PTCO5 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO5_SHIFT)) & GPIO_PCOR_PTCO5_MASK) - -#define GPIO_PCOR_PTCO6_MASK (0x40U) -#define GPIO_PCOR_PTCO6_SHIFT (6U) -/*! PTCO6 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO6_SHIFT)) & GPIO_PCOR_PTCO6_MASK) - -#define GPIO_PCOR_PTCO7_MASK (0x80U) -#define GPIO_PCOR_PTCO7_SHIFT (7U) -/*! PTCO7 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO7_SHIFT)) & GPIO_PCOR_PTCO7_MASK) - -#define GPIO_PCOR_PTCO8_MASK (0x100U) -#define GPIO_PCOR_PTCO8_SHIFT (8U) -/*! PTCO8 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO8_SHIFT)) & GPIO_PCOR_PTCO8_MASK) - -#define GPIO_PCOR_PTCO9_MASK (0x200U) -#define GPIO_PCOR_PTCO9_SHIFT (9U) -/*! PTCO9 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO9_SHIFT)) & GPIO_PCOR_PTCO9_MASK) - -#define GPIO_PCOR_PTCO10_MASK (0x400U) -#define GPIO_PCOR_PTCO10_SHIFT (10U) -/*! PTCO10 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO10_SHIFT)) & GPIO_PCOR_PTCO10_MASK) - -#define GPIO_PCOR_PTCO11_MASK (0x800U) -#define GPIO_PCOR_PTCO11_SHIFT (11U) -/*! PTCO11 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO11_SHIFT)) & GPIO_PCOR_PTCO11_MASK) - -#define GPIO_PCOR_PTCO12_MASK (0x1000U) -#define GPIO_PCOR_PTCO12_SHIFT (12U) -/*! PTCO12 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO12_SHIFT)) & GPIO_PCOR_PTCO12_MASK) - -#define GPIO_PCOR_PTCO13_MASK (0x2000U) -#define GPIO_PCOR_PTCO13_SHIFT (13U) -/*! PTCO13 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO13_SHIFT)) & GPIO_PCOR_PTCO13_MASK) - -#define GPIO_PCOR_PTCO14_MASK (0x4000U) -#define GPIO_PCOR_PTCO14_SHIFT (14U) -/*! PTCO14 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO14_SHIFT)) & GPIO_PCOR_PTCO14_MASK) - -#define GPIO_PCOR_PTCO15_MASK (0x8000U) -#define GPIO_PCOR_PTCO15_SHIFT (15U) -/*! PTCO15 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO15_SHIFT)) & GPIO_PCOR_PTCO15_MASK) - -#define GPIO_PCOR_PTCO16_MASK (0x10000U) -#define GPIO_PCOR_PTCO16_SHIFT (16U) -/*! PTCO16 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO16_SHIFT)) & GPIO_PCOR_PTCO16_MASK) - -#define GPIO_PCOR_PTCO17_MASK (0x20000U) -#define GPIO_PCOR_PTCO17_SHIFT (17U) -/*! PTCO17 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO17_SHIFT)) & GPIO_PCOR_PTCO17_MASK) - -#define GPIO_PCOR_PTCO18_MASK (0x40000U) -#define GPIO_PCOR_PTCO18_SHIFT (18U) -/*! PTCO18 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO18_SHIFT)) & GPIO_PCOR_PTCO18_MASK) - -#define GPIO_PCOR_PTCO19_MASK (0x80000U) -#define GPIO_PCOR_PTCO19_SHIFT (19U) -/*! PTCO19 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO19_SHIFT)) & GPIO_PCOR_PTCO19_MASK) - -#define GPIO_PCOR_PTCO20_MASK (0x100000U) -#define GPIO_PCOR_PTCO20_SHIFT (20U) -/*! PTCO20 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO20_SHIFT)) & GPIO_PCOR_PTCO20_MASK) - -#define GPIO_PCOR_PTCO21_MASK (0x200000U) -#define GPIO_PCOR_PTCO21_SHIFT (21U) -/*! PTCO21 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO21_SHIFT)) & GPIO_PCOR_PTCO21_MASK) - -#define GPIO_PCOR_PTCO22_MASK (0x400000U) -#define GPIO_PCOR_PTCO22_SHIFT (22U) -/*! PTCO22 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO22_SHIFT)) & GPIO_PCOR_PTCO22_MASK) - -#define GPIO_PCOR_PTCO23_MASK (0x800000U) -#define GPIO_PCOR_PTCO23_SHIFT (23U) -/*! PTCO23 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO23_SHIFT)) & GPIO_PCOR_PTCO23_MASK) - -#define GPIO_PCOR_PTCO24_MASK (0x1000000U) -#define GPIO_PCOR_PTCO24_SHIFT (24U) -/*! PTCO24 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO24_SHIFT)) & GPIO_PCOR_PTCO24_MASK) - -#define GPIO_PCOR_PTCO25_MASK (0x2000000U) -#define GPIO_PCOR_PTCO25_SHIFT (25U) -/*! PTCO25 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO25_SHIFT)) & GPIO_PCOR_PTCO25_MASK) - -#define GPIO_PCOR_PTCO26_MASK (0x4000000U) -#define GPIO_PCOR_PTCO26_SHIFT (26U) -/*! PTCO26 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO26_SHIFT)) & GPIO_PCOR_PTCO26_MASK) - -#define GPIO_PCOR_PTCO27_MASK (0x8000000U) -#define GPIO_PCOR_PTCO27_SHIFT (27U) -/*! PTCO27 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO27_SHIFT)) & GPIO_PCOR_PTCO27_MASK) - -#define GPIO_PCOR_PTCO28_MASK (0x10000000U) -#define GPIO_PCOR_PTCO28_SHIFT (28U) -/*! PTCO28 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO28_SHIFT)) & GPIO_PCOR_PTCO28_MASK) - -#define GPIO_PCOR_PTCO29_MASK (0x20000000U) -#define GPIO_PCOR_PTCO29_SHIFT (29U) -/*! PTCO29 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO29_SHIFT)) & GPIO_PCOR_PTCO29_MASK) - -#define GPIO_PCOR_PTCO30_MASK (0x40000000U) -#define GPIO_PCOR_PTCO30_SHIFT (30U) -/*! PTCO30 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO30_SHIFT)) & GPIO_PCOR_PTCO30_MASK) - -#define GPIO_PCOR_PTCO31_MASK (0x80000000U) -#define GPIO_PCOR_PTCO31_SHIFT (31U) -/*! PTCO31 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO31_SHIFT)) & GPIO_PCOR_PTCO31_MASK) -/*! @} */ - -/*! @name PTOR - Port Toggle Output */ -/*! @{ */ - -#define GPIO_PTOR_PTTO0_MASK (0x1U) -#define GPIO_PTOR_PTTO0_SHIFT (0U) -/*! PTTO0 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO0_SHIFT)) & GPIO_PTOR_PTTO0_MASK) - -#define GPIO_PTOR_PTTO1_MASK (0x2U) -#define GPIO_PTOR_PTTO1_SHIFT (1U) -/*! PTTO1 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO1_SHIFT)) & GPIO_PTOR_PTTO1_MASK) - -#define GPIO_PTOR_PTTO2_MASK (0x4U) -#define GPIO_PTOR_PTTO2_SHIFT (2U) -/*! PTTO2 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO2_SHIFT)) & GPIO_PTOR_PTTO2_MASK) - -#define GPIO_PTOR_PTTO3_MASK (0x8U) -#define GPIO_PTOR_PTTO3_SHIFT (3U) -/*! PTTO3 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO3_SHIFT)) & GPIO_PTOR_PTTO3_MASK) - -#define GPIO_PTOR_PTTO4_MASK (0x10U) -#define GPIO_PTOR_PTTO4_SHIFT (4U) -/*! PTTO4 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO4_SHIFT)) & GPIO_PTOR_PTTO4_MASK) - -#define GPIO_PTOR_PTTO5_MASK (0x20U) -#define GPIO_PTOR_PTTO5_SHIFT (5U) -/*! PTTO5 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO5_SHIFT)) & GPIO_PTOR_PTTO5_MASK) - -#define GPIO_PTOR_PTTO6_MASK (0x40U) -#define GPIO_PTOR_PTTO6_SHIFT (6U) -/*! PTTO6 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO6_SHIFT)) & GPIO_PTOR_PTTO6_MASK) - -#define GPIO_PTOR_PTTO7_MASK (0x80U) -#define GPIO_PTOR_PTTO7_SHIFT (7U) -/*! PTTO7 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO7_SHIFT)) & GPIO_PTOR_PTTO7_MASK) - -#define GPIO_PTOR_PTTO8_MASK (0x100U) -#define GPIO_PTOR_PTTO8_SHIFT (8U) -/*! PTTO8 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO8_SHIFT)) & GPIO_PTOR_PTTO8_MASK) - -#define GPIO_PTOR_PTTO9_MASK (0x200U) -#define GPIO_PTOR_PTTO9_SHIFT (9U) -/*! PTTO9 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO9_SHIFT)) & GPIO_PTOR_PTTO9_MASK) - -#define GPIO_PTOR_PTTO10_MASK (0x400U) -#define GPIO_PTOR_PTTO10_SHIFT (10U) -/*! PTTO10 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO10_SHIFT)) & GPIO_PTOR_PTTO10_MASK) - -#define GPIO_PTOR_PTTO11_MASK (0x800U) -#define GPIO_PTOR_PTTO11_SHIFT (11U) -/*! PTTO11 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO11_SHIFT)) & GPIO_PTOR_PTTO11_MASK) - -#define GPIO_PTOR_PTTO12_MASK (0x1000U) -#define GPIO_PTOR_PTTO12_SHIFT (12U) -/*! PTTO12 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO12_SHIFT)) & GPIO_PTOR_PTTO12_MASK) - -#define GPIO_PTOR_PTTO13_MASK (0x2000U) -#define GPIO_PTOR_PTTO13_SHIFT (13U) -/*! PTTO13 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO13_SHIFT)) & GPIO_PTOR_PTTO13_MASK) - -#define GPIO_PTOR_PTTO14_MASK (0x4000U) -#define GPIO_PTOR_PTTO14_SHIFT (14U) -/*! PTTO14 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO14_SHIFT)) & GPIO_PTOR_PTTO14_MASK) - -#define GPIO_PTOR_PTTO15_MASK (0x8000U) -#define GPIO_PTOR_PTTO15_SHIFT (15U) -/*! PTTO15 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO15_SHIFT)) & GPIO_PTOR_PTTO15_MASK) - -#define GPIO_PTOR_PTTO16_MASK (0x10000U) -#define GPIO_PTOR_PTTO16_SHIFT (16U) -/*! PTTO16 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO16_SHIFT)) & GPIO_PTOR_PTTO16_MASK) - -#define GPIO_PTOR_PTTO17_MASK (0x20000U) -#define GPIO_PTOR_PTTO17_SHIFT (17U) -/*! PTTO17 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO17_SHIFT)) & GPIO_PTOR_PTTO17_MASK) - -#define GPIO_PTOR_PTTO18_MASK (0x40000U) -#define GPIO_PTOR_PTTO18_SHIFT (18U) -/*! PTTO18 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO18_SHIFT)) & GPIO_PTOR_PTTO18_MASK) - -#define GPIO_PTOR_PTTO19_MASK (0x80000U) -#define GPIO_PTOR_PTTO19_SHIFT (19U) -/*! PTTO19 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO19_SHIFT)) & GPIO_PTOR_PTTO19_MASK) - -#define GPIO_PTOR_PTTO20_MASK (0x100000U) -#define GPIO_PTOR_PTTO20_SHIFT (20U) -/*! PTTO20 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO20_SHIFT)) & GPIO_PTOR_PTTO20_MASK) - -#define GPIO_PTOR_PTTO21_MASK (0x200000U) -#define GPIO_PTOR_PTTO21_SHIFT (21U) -/*! PTTO21 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO21_SHIFT)) & GPIO_PTOR_PTTO21_MASK) - -#define GPIO_PTOR_PTTO22_MASK (0x400000U) -#define GPIO_PTOR_PTTO22_SHIFT (22U) -/*! PTTO22 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO22_SHIFT)) & GPIO_PTOR_PTTO22_MASK) - -#define GPIO_PTOR_PTTO23_MASK (0x800000U) -#define GPIO_PTOR_PTTO23_SHIFT (23U) -/*! PTTO23 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO23_SHIFT)) & GPIO_PTOR_PTTO23_MASK) - -#define GPIO_PTOR_PTTO24_MASK (0x1000000U) -#define GPIO_PTOR_PTTO24_SHIFT (24U) -/*! PTTO24 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO24_SHIFT)) & GPIO_PTOR_PTTO24_MASK) - -#define GPIO_PTOR_PTTO25_MASK (0x2000000U) -#define GPIO_PTOR_PTTO25_SHIFT (25U) -/*! PTTO25 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO25_SHIFT)) & GPIO_PTOR_PTTO25_MASK) - -#define GPIO_PTOR_PTTO26_MASK (0x4000000U) -#define GPIO_PTOR_PTTO26_SHIFT (26U) -/*! PTTO26 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO26_SHIFT)) & GPIO_PTOR_PTTO26_MASK) - -#define GPIO_PTOR_PTTO27_MASK (0x8000000U) -#define GPIO_PTOR_PTTO27_SHIFT (27U) -/*! PTTO27 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO27_SHIFT)) & GPIO_PTOR_PTTO27_MASK) - -#define GPIO_PTOR_PTTO28_MASK (0x10000000U) -#define GPIO_PTOR_PTTO28_SHIFT (28U) -/*! PTTO28 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO28_SHIFT)) & GPIO_PTOR_PTTO28_MASK) - -#define GPIO_PTOR_PTTO29_MASK (0x20000000U) -#define GPIO_PTOR_PTTO29_SHIFT (29U) -/*! PTTO29 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO29_SHIFT)) & GPIO_PTOR_PTTO29_MASK) - -#define GPIO_PTOR_PTTO30_MASK (0x40000000U) -#define GPIO_PTOR_PTTO30_SHIFT (30U) -/*! PTTO30 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO30_SHIFT)) & GPIO_PTOR_PTTO30_MASK) - -#define GPIO_PTOR_PTTO31_MASK (0x80000000U) -#define GPIO_PTOR_PTTO31_SHIFT (31U) -/*! PTTO31 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO31_SHIFT)) & GPIO_PTOR_PTTO31_MASK) -/*! @} */ - -/*! @name PDIR - Port Data Input */ -/*! @{ */ - -#define GPIO_PDIR_PDI0_MASK (0x1U) -#define GPIO_PDIR_PDI0_SHIFT (0U) -/*! PDI0 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI0_SHIFT)) & GPIO_PDIR_PDI0_MASK) - -#define GPIO_PDIR_PDI1_MASK (0x2U) -#define GPIO_PDIR_PDI1_SHIFT (1U) -/*! PDI1 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI1_SHIFT)) & GPIO_PDIR_PDI1_MASK) - -#define GPIO_PDIR_PDI2_MASK (0x4U) -#define GPIO_PDIR_PDI2_SHIFT (2U) -/*! PDI2 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI2_SHIFT)) & GPIO_PDIR_PDI2_MASK) - -#define GPIO_PDIR_PDI3_MASK (0x8U) -#define GPIO_PDIR_PDI3_SHIFT (3U) -/*! PDI3 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI3_SHIFT)) & GPIO_PDIR_PDI3_MASK) - -#define GPIO_PDIR_PDI4_MASK (0x10U) -#define GPIO_PDIR_PDI4_SHIFT (4U) -/*! PDI4 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI4_SHIFT)) & GPIO_PDIR_PDI4_MASK) - -#define GPIO_PDIR_PDI5_MASK (0x20U) -#define GPIO_PDIR_PDI5_SHIFT (5U) -/*! PDI5 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI5_SHIFT)) & GPIO_PDIR_PDI5_MASK) - -#define GPIO_PDIR_PDI6_MASK (0x40U) -#define GPIO_PDIR_PDI6_SHIFT (6U) -/*! PDI6 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI6_SHIFT)) & GPIO_PDIR_PDI6_MASK) - -#define GPIO_PDIR_PDI7_MASK (0x80U) -#define GPIO_PDIR_PDI7_SHIFT (7U) -/*! PDI7 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI7_SHIFT)) & GPIO_PDIR_PDI7_MASK) - -#define GPIO_PDIR_PDI8_MASK (0x100U) -#define GPIO_PDIR_PDI8_SHIFT (8U) -/*! PDI8 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI8_SHIFT)) & GPIO_PDIR_PDI8_MASK) - -#define GPIO_PDIR_PDI9_MASK (0x200U) -#define GPIO_PDIR_PDI9_SHIFT (9U) -/*! PDI9 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI9_SHIFT)) & GPIO_PDIR_PDI9_MASK) - -#define GPIO_PDIR_PDI10_MASK (0x400U) -#define GPIO_PDIR_PDI10_SHIFT (10U) -/*! PDI10 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI10_SHIFT)) & GPIO_PDIR_PDI10_MASK) - -#define GPIO_PDIR_PDI11_MASK (0x800U) -#define GPIO_PDIR_PDI11_SHIFT (11U) -/*! PDI11 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI11_SHIFT)) & GPIO_PDIR_PDI11_MASK) - -#define GPIO_PDIR_PDI12_MASK (0x1000U) -#define GPIO_PDIR_PDI12_SHIFT (12U) -/*! PDI12 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI12_SHIFT)) & GPIO_PDIR_PDI12_MASK) - -#define GPIO_PDIR_PDI13_MASK (0x2000U) -#define GPIO_PDIR_PDI13_SHIFT (13U) -/*! PDI13 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI13_SHIFT)) & GPIO_PDIR_PDI13_MASK) - -#define GPIO_PDIR_PDI14_MASK (0x4000U) -#define GPIO_PDIR_PDI14_SHIFT (14U) -/*! PDI14 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI14_SHIFT)) & GPIO_PDIR_PDI14_MASK) - -#define GPIO_PDIR_PDI15_MASK (0x8000U) -#define GPIO_PDIR_PDI15_SHIFT (15U) -/*! PDI15 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI15_SHIFT)) & GPIO_PDIR_PDI15_MASK) - -#define GPIO_PDIR_PDI16_MASK (0x10000U) -#define GPIO_PDIR_PDI16_SHIFT (16U) -/*! PDI16 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI16_SHIFT)) & GPIO_PDIR_PDI16_MASK) - -#define GPIO_PDIR_PDI17_MASK (0x20000U) -#define GPIO_PDIR_PDI17_SHIFT (17U) -/*! PDI17 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI17_SHIFT)) & GPIO_PDIR_PDI17_MASK) - -#define GPIO_PDIR_PDI18_MASK (0x40000U) -#define GPIO_PDIR_PDI18_SHIFT (18U) -/*! PDI18 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI18_SHIFT)) & GPIO_PDIR_PDI18_MASK) - -#define GPIO_PDIR_PDI19_MASK (0x80000U) -#define GPIO_PDIR_PDI19_SHIFT (19U) -/*! PDI19 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI19_SHIFT)) & GPIO_PDIR_PDI19_MASK) - -#define GPIO_PDIR_PDI20_MASK (0x100000U) -#define GPIO_PDIR_PDI20_SHIFT (20U) -/*! PDI20 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI20_SHIFT)) & GPIO_PDIR_PDI20_MASK) - -#define GPIO_PDIR_PDI21_MASK (0x200000U) -#define GPIO_PDIR_PDI21_SHIFT (21U) -/*! PDI21 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI21_SHIFT)) & GPIO_PDIR_PDI21_MASK) - -#define GPIO_PDIR_PDI22_MASK (0x400000U) -#define GPIO_PDIR_PDI22_SHIFT (22U) -/*! PDI22 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI22_SHIFT)) & GPIO_PDIR_PDI22_MASK) - -#define GPIO_PDIR_PDI23_MASK (0x800000U) -#define GPIO_PDIR_PDI23_SHIFT (23U) -/*! PDI23 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI23_SHIFT)) & GPIO_PDIR_PDI23_MASK) - -#define GPIO_PDIR_PDI24_MASK (0x1000000U) -#define GPIO_PDIR_PDI24_SHIFT (24U) -/*! PDI24 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI24_SHIFT)) & GPIO_PDIR_PDI24_MASK) - -#define GPIO_PDIR_PDI25_MASK (0x2000000U) -#define GPIO_PDIR_PDI25_SHIFT (25U) -/*! PDI25 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI25_SHIFT)) & GPIO_PDIR_PDI25_MASK) - -#define GPIO_PDIR_PDI26_MASK (0x4000000U) -#define GPIO_PDIR_PDI26_SHIFT (26U) -/*! PDI26 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI26_SHIFT)) & GPIO_PDIR_PDI26_MASK) - -#define GPIO_PDIR_PDI27_MASK (0x8000000U) -#define GPIO_PDIR_PDI27_SHIFT (27U) -/*! PDI27 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI27_SHIFT)) & GPIO_PDIR_PDI27_MASK) - -#define GPIO_PDIR_PDI28_MASK (0x10000000U) -#define GPIO_PDIR_PDI28_SHIFT (28U) -/*! PDI28 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI28_SHIFT)) & GPIO_PDIR_PDI28_MASK) - -#define GPIO_PDIR_PDI29_MASK (0x20000000U) -#define GPIO_PDIR_PDI29_SHIFT (29U) -/*! PDI29 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI29_SHIFT)) & GPIO_PDIR_PDI29_MASK) - -#define GPIO_PDIR_PDI30_MASK (0x40000000U) -#define GPIO_PDIR_PDI30_SHIFT (30U) -/*! PDI30 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI30_SHIFT)) & GPIO_PDIR_PDI30_MASK) - -#define GPIO_PDIR_PDI31_MASK (0x80000000U) -#define GPIO_PDIR_PDI31_SHIFT (31U) -/*! PDI31 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI31_SHIFT)) & GPIO_PDIR_PDI31_MASK) -/*! @} */ - -/*! @name PDDR - Port Data Direction */ -/*! @{ */ - -#define GPIO_PDDR_PDD0_MASK (0x1U) -#define GPIO_PDDR_PDD0_SHIFT (0U) -/*! PDD0 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD0_SHIFT)) & GPIO_PDDR_PDD0_MASK) - -#define GPIO_PDDR_PDD1_MASK (0x2U) -#define GPIO_PDDR_PDD1_SHIFT (1U) -/*! PDD1 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD1_SHIFT)) & GPIO_PDDR_PDD1_MASK) - -#define GPIO_PDDR_PDD2_MASK (0x4U) -#define GPIO_PDDR_PDD2_SHIFT (2U) -/*! PDD2 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD2_SHIFT)) & GPIO_PDDR_PDD2_MASK) - -#define GPIO_PDDR_PDD3_MASK (0x8U) -#define GPIO_PDDR_PDD3_SHIFT (3U) -/*! PDD3 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD3_SHIFT)) & GPIO_PDDR_PDD3_MASK) - -#define GPIO_PDDR_PDD4_MASK (0x10U) -#define GPIO_PDDR_PDD4_SHIFT (4U) -/*! PDD4 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD4_SHIFT)) & GPIO_PDDR_PDD4_MASK) - -#define GPIO_PDDR_PDD5_MASK (0x20U) -#define GPIO_PDDR_PDD5_SHIFT (5U) -/*! PDD5 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD5_SHIFT)) & GPIO_PDDR_PDD5_MASK) - -#define GPIO_PDDR_PDD6_MASK (0x40U) -#define GPIO_PDDR_PDD6_SHIFT (6U) -/*! PDD6 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD6_SHIFT)) & GPIO_PDDR_PDD6_MASK) - -#define GPIO_PDDR_PDD7_MASK (0x80U) -#define GPIO_PDDR_PDD7_SHIFT (7U) -/*! PDD7 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD7_SHIFT)) & GPIO_PDDR_PDD7_MASK) - -#define GPIO_PDDR_PDD8_MASK (0x100U) -#define GPIO_PDDR_PDD8_SHIFT (8U) -/*! PDD8 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD8_SHIFT)) & GPIO_PDDR_PDD8_MASK) - -#define GPIO_PDDR_PDD9_MASK (0x200U) -#define GPIO_PDDR_PDD9_SHIFT (9U) -/*! PDD9 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD9_SHIFT)) & GPIO_PDDR_PDD9_MASK) - -#define GPIO_PDDR_PDD10_MASK (0x400U) -#define GPIO_PDDR_PDD10_SHIFT (10U) -/*! PDD10 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD10_SHIFT)) & GPIO_PDDR_PDD10_MASK) - -#define GPIO_PDDR_PDD11_MASK (0x800U) -#define GPIO_PDDR_PDD11_SHIFT (11U) -/*! PDD11 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD11_SHIFT)) & GPIO_PDDR_PDD11_MASK) - -#define GPIO_PDDR_PDD12_MASK (0x1000U) -#define GPIO_PDDR_PDD12_SHIFT (12U) -/*! PDD12 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD12_SHIFT)) & GPIO_PDDR_PDD12_MASK) - -#define GPIO_PDDR_PDD13_MASK (0x2000U) -#define GPIO_PDDR_PDD13_SHIFT (13U) -/*! PDD13 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD13_SHIFT)) & GPIO_PDDR_PDD13_MASK) - -#define GPIO_PDDR_PDD14_MASK (0x4000U) -#define GPIO_PDDR_PDD14_SHIFT (14U) -/*! PDD14 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD14_SHIFT)) & GPIO_PDDR_PDD14_MASK) - -#define GPIO_PDDR_PDD15_MASK (0x8000U) -#define GPIO_PDDR_PDD15_SHIFT (15U) -/*! PDD15 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD15_SHIFT)) & GPIO_PDDR_PDD15_MASK) - -#define GPIO_PDDR_PDD16_MASK (0x10000U) -#define GPIO_PDDR_PDD16_SHIFT (16U) -/*! PDD16 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD16_SHIFT)) & GPIO_PDDR_PDD16_MASK) - -#define GPIO_PDDR_PDD17_MASK (0x20000U) -#define GPIO_PDDR_PDD17_SHIFT (17U) -/*! PDD17 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD17_SHIFT)) & GPIO_PDDR_PDD17_MASK) - -#define GPIO_PDDR_PDD18_MASK (0x40000U) -#define GPIO_PDDR_PDD18_SHIFT (18U) -/*! PDD18 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD18_SHIFT)) & GPIO_PDDR_PDD18_MASK) - -#define GPIO_PDDR_PDD19_MASK (0x80000U) -#define GPIO_PDDR_PDD19_SHIFT (19U) -/*! PDD19 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD19_SHIFT)) & GPIO_PDDR_PDD19_MASK) - -#define GPIO_PDDR_PDD20_MASK (0x100000U) -#define GPIO_PDDR_PDD20_SHIFT (20U) -/*! PDD20 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD20_SHIFT)) & GPIO_PDDR_PDD20_MASK) - -#define GPIO_PDDR_PDD21_MASK (0x200000U) -#define GPIO_PDDR_PDD21_SHIFT (21U) -/*! PDD21 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD21_SHIFT)) & GPIO_PDDR_PDD21_MASK) - -#define GPIO_PDDR_PDD22_MASK (0x400000U) -#define GPIO_PDDR_PDD22_SHIFT (22U) -/*! PDD22 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD22_SHIFT)) & GPIO_PDDR_PDD22_MASK) - -#define GPIO_PDDR_PDD23_MASK (0x800000U) -#define GPIO_PDDR_PDD23_SHIFT (23U) -/*! PDD23 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD23_SHIFT)) & GPIO_PDDR_PDD23_MASK) - -#define GPIO_PDDR_PDD24_MASK (0x1000000U) -#define GPIO_PDDR_PDD24_SHIFT (24U) -/*! PDD24 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD24_SHIFT)) & GPIO_PDDR_PDD24_MASK) - -#define GPIO_PDDR_PDD25_MASK (0x2000000U) -#define GPIO_PDDR_PDD25_SHIFT (25U) -/*! PDD25 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD25_SHIFT)) & GPIO_PDDR_PDD25_MASK) - -#define GPIO_PDDR_PDD26_MASK (0x4000000U) -#define GPIO_PDDR_PDD26_SHIFT (26U) -/*! PDD26 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD26_SHIFT)) & GPIO_PDDR_PDD26_MASK) - -#define GPIO_PDDR_PDD27_MASK (0x8000000U) -#define GPIO_PDDR_PDD27_SHIFT (27U) -/*! PDD27 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD27_SHIFT)) & GPIO_PDDR_PDD27_MASK) - -#define GPIO_PDDR_PDD28_MASK (0x10000000U) -#define GPIO_PDDR_PDD28_SHIFT (28U) -/*! PDD28 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD28_SHIFT)) & GPIO_PDDR_PDD28_MASK) - -#define GPIO_PDDR_PDD29_MASK (0x20000000U) -#define GPIO_PDDR_PDD29_SHIFT (29U) -/*! PDD29 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD29_SHIFT)) & GPIO_PDDR_PDD29_MASK) - -#define GPIO_PDDR_PDD30_MASK (0x40000000U) -#define GPIO_PDDR_PDD30_SHIFT (30U) -/*! PDD30 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD30_SHIFT)) & GPIO_PDDR_PDD30_MASK) - -#define GPIO_PDDR_PDD31_MASK (0x80000000U) -#define GPIO_PDDR_PDD31_SHIFT (31U) -/*! PDD31 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD31_SHIFT)) & GPIO_PDDR_PDD31_MASK) -/*! @} */ - -/*! @name PIDR - Port Input Disable */ -/*! @{ */ - -#define GPIO_PIDR_PID0_MASK (0x1U) -#define GPIO_PIDR_PID0_SHIFT (0U) -/*! PID0 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID0_SHIFT)) & GPIO_PIDR_PID0_MASK) - -#define GPIO_PIDR_PID1_MASK (0x2U) -#define GPIO_PIDR_PID1_SHIFT (1U) -/*! PID1 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID1_SHIFT)) & GPIO_PIDR_PID1_MASK) - -#define GPIO_PIDR_PID2_MASK (0x4U) -#define GPIO_PIDR_PID2_SHIFT (2U) -/*! PID2 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID2_SHIFT)) & GPIO_PIDR_PID2_MASK) - -#define GPIO_PIDR_PID3_MASK (0x8U) -#define GPIO_PIDR_PID3_SHIFT (3U) -/*! PID3 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID3_SHIFT)) & GPIO_PIDR_PID3_MASK) - -#define GPIO_PIDR_PID4_MASK (0x10U) -#define GPIO_PIDR_PID4_SHIFT (4U) -/*! PID4 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID4_SHIFT)) & GPIO_PIDR_PID4_MASK) - -#define GPIO_PIDR_PID5_MASK (0x20U) -#define GPIO_PIDR_PID5_SHIFT (5U) -/*! PID5 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID5_SHIFT)) & GPIO_PIDR_PID5_MASK) - -#define GPIO_PIDR_PID6_MASK (0x40U) -#define GPIO_PIDR_PID6_SHIFT (6U) -/*! PID6 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID6_SHIFT)) & GPIO_PIDR_PID6_MASK) - -#define GPIO_PIDR_PID7_MASK (0x80U) -#define GPIO_PIDR_PID7_SHIFT (7U) -/*! PID7 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID7_SHIFT)) & GPIO_PIDR_PID7_MASK) - -#define GPIO_PIDR_PID8_MASK (0x100U) -#define GPIO_PIDR_PID8_SHIFT (8U) -/*! PID8 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID8_SHIFT)) & GPIO_PIDR_PID8_MASK) - -#define GPIO_PIDR_PID9_MASK (0x200U) -#define GPIO_PIDR_PID9_SHIFT (9U) -/*! PID9 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID9_SHIFT)) & GPIO_PIDR_PID9_MASK) - -#define GPIO_PIDR_PID10_MASK (0x400U) -#define GPIO_PIDR_PID10_SHIFT (10U) -/*! PID10 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID10_SHIFT)) & GPIO_PIDR_PID10_MASK) - -#define GPIO_PIDR_PID11_MASK (0x800U) -#define GPIO_PIDR_PID11_SHIFT (11U) -/*! PID11 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID11_SHIFT)) & GPIO_PIDR_PID11_MASK) - -#define GPIO_PIDR_PID12_MASK (0x1000U) -#define GPIO_PIDR_PID12_SHIFT (12U) -/*! PID12 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID12_SHIFT)) & GPIO_PIDR_PID12_MASK) - -#define GPIO_PIDR_PID13_MASK (0x2000U) -#define GPIO_PIDR_PID13_SHIFT (13U) -/*! PID13 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID13_SHIFT)) & GPIO_PIDR_PID13_MASK) - -#define GPIO_PIDR_PID14_MASK (0x4000U) -#define GPIO_PIDR_PID14_SHIFT (14U) -/*! PID14 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID14_SHIFT)) & GPIO_PIDR_PID14_MASK) - -#define GPIO_PIDR_PID15_MASK (0x8000U) -#define GPIO_PIDR_PID15_SHIFT (15U) -/*! PID15 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID15_SHIFT)) & GPIO_PIDR_PID15_MASK) - -#define GPIO_PIDR_PID16_MASK (0x10000U) -#define GPIO_PIDR_PID16_SHIFT (16U) -/*! PID16 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID16_SHIFT)) & GPIO_PIDR_PID16_MASK) - -#define GPIO_PIDR_PID17_MASK (0x20000U) -#define GPIO_PIDR_PID17_SHIFT (17U) -/*! PID17 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID17_SHIFT)) & GPIO_PIDR_PID17_MASK) - -#define GPIO_PIDR_PID18_MASK (0x40000U) -#define GPIO_PIDR_PID18_SHIFT (18U) -/*! PID18 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID18_SHIFT)) & GPIO_PIDR_PID18_MASK) - -#define GPIO_PIDR_PID19_MASK (0x80000U) -#define GPIO_PIDR_PID19_SHIFT (19U) -/*! PID19 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID19_SHIFT)) & GPIO_PIDR_PID19_MASK) - -#define GPIO_PIDR_PID20_MASK (0x100000U) -#define GPIO_PIDR_PID20_SHIFT (20U) -/*! PID20 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID20_SHIFT)) & GPIO_PIDR_PID20_MASK) - -#define GPIO_PIDR_PID21_MASK (0x200000U) -#define GPIO_PIDR_PID21_SHIFT (21U) -/*! PID21 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID21_SHIFT)) & GPIO_PIDR_PID21_MASK) - -#define GPIO_PIDR_PID22_MASK (0x400000U) -#define GPIO_PIDR_PID22_SHIFT (22U) -/*! PID22 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID22_SHIFT)) & GPIO_PIDR_PID22_MASK) - -#define GPIO_PIDR_PID23_MASK (0x800000U) -#define GPIO_PIDR_PID23_SHIFT (23U) -/*! PID23 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID23_SHIFT)) & GPIO_PIDR_PID23_MASK) - -#define GPIO_PIDR_PID24_MASK (0x1000000U) -#define GPIO_PIDR_PID24_SHIFT (24U) -/*! PID24 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID24_SHIFT)) & GPIO_PIDR_PID24_MASK) - -#define GPIO_PIDR_PID25_MASK (0x2000000U) -#define GPIO_PIDR_PID25_SHIFT (25U) -/*! PID25 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID25_SHIFT)) & GPIO_PIDR_PID25_MASK) - -#define GPIO_PIDR_PID26_MASK (0x4000000U) -#define GPIO_PIDR_PID26_SHIFT (26U) -/*! PID26 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID26_SHIFT)) & GPIO_PIDR_PID26_MASK) - -#define GPIO_PIDR_PID27_MASK (0x8000000U) -#define GPIO_PIDR_PID27_SHIFT (27U) -/*! PID27 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID27_SHIFT)) & GPIO_PIDR_PID27_MASK) - -#define GPIO_PIDR_PID28_MASK (0x10000000U) -#define GPIO_PIDR_PID28_SHIFT (28U) -/*! PID28 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID28_SHIFT)) & GPIO_PIDR_PID28_MASK) - -#define GPIO_PIDR_PID29_MASK (0x20000000U) -#define GPIO_PIDR_PID29_SHIFT (29U) -/*! PID29 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID29_SHIFT)) & GPIO_PIDR_PID29_MASK) - -#define GPIO_PIDR_PID30_MASK (0x40000000U) -#define GPIO_PIDR_PID30_SHIFT (30U) -/*! PID30 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID30_SHIFT)) & GPIO_PIDR_PID30_MASK) - -#define GPIO_PIDR_PID31_MASK (0x80000000U) -#define GPIO_PIDR_PID31_SHIFT (31U) -/*! PID31 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID31_SHIFT)) & GPIO_PIDR_PID31_MASK) -/*! @} */ - -/*! @name PDR - Pin Data */ -/*! @{ */ - -#define GPIO_PDR_PD_MASK (0x1U) -#define GPIO_PDR_PD_SHIFT (0U) -/*! PD - Pin Data (I/O) - * 0b0..Logic zero - * 0b1..Logic one - */ -#define GPIO_PDR_PD(x) (((uint8_t)(((uint8_t)(x)) << GPIO_PDR_PD_SHIFT)) & GPIO_PDR_PD_MASK) -/*! @} */ - -/* The count of GPIO_PDR */ -#define GPIO_PDR_COUNT (32U) - -/*! @name ICR - Interrupt Control 0..Interrupt Control 31 */ -/*! @{ */ - -#define GPIO_ICR_IRQC_MASK (0xF0000U) -#define GPIO_ICR_IRQC_SHIFT (16U) -/*! IRQC - Interrupt Configuration - * 0b0000..ISF is disabled - * 0b0001..ISF and DMA request on rising edge - * 0b0010..ISF and DMA request on falling edge - * 0b0011..ISF and DMA request on either edge - * 0b0100..Reserved - * 0b0101..ISF sets on rising edge - * 0b0110..ISF sets on falling edge - * 0b0111..ISF sets on either edge - * 0b1000..ISF and interrupt when logic 0 - * 0b1001..ISF and interrupt on rising edge - * 0b1010..ISF and interrupt on falling edge - * 0b1011..ISF and Interrupt on either edge - * 0b1100..ISF and interrupt when logic 1 - * 0b1101..Enable active-high trigger output; ISF on rising edge (pin state is ORed with other enabled triggers - * to generate the output trigger for use by other peripherals) - * 0b1110..Enable active-low trigger output; ISF on falling edge (pin state is inverted and ORed with other - * enabled triggers to generate the output trigger for use by other peripherals) - * 0b1111..Reserved - */ -#define GPIO_ICR_IRQC(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ICR_IRQC_SHIFT)) & GPIO_ICR_IRQC_MASK) - -#define GPIO_ICR_IRQS_MASK (0x100000U) -#define GPIO_ICR_IRQS_SHIFT (20U) -/*! IRQS - Interrupt Select - * 0b0..Interrupt, trigger output, or DMA request 0 - * 0b1..Interrupt, trigger output, or DMA request 1 - */ -#define GPIO_ICR_IRQS(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ICR_IRQS_SHIFT)) & GPIO_ICR_IRQS_MASK) - -#define GPIO_ICR_LK_MASK (0x800000U) -#define GPIO_ICR_LK_SHIFT (23U) -/*! LK - Lock - * 0b0..Lock - * 0b1..Do not lock - */ -#define GPIO_ICR_LK(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ICR_LK_SHIFT)) & GPIO_ICR_LK_MASK) - -#define GPIO_ICR_ISF_MASK (0x1000000U) -#define GPIO_ICR_ISF_SHIFT (24U) -/*! ISF - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ICR_ISF(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ICR_ISF_SHIFT)) & GPIO_ICR_ISF_MASK) -/*! @} */ - -/* The count of GPIO_ICR */ -#define GPIO_ICR_COUNT (32U) - -/*! @name GICLR - Global Interrupt Control Low */ -/*! @{ */ - -#define GPIO_GICLR_GIWE0_MASK (0x1U) -#define GPIO_GICLR_GIWE0_SHIFT (0U) -/*! GIWE0 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE0_SHIFT)) & GPIO_GICLR_GIWE0_MASK) - -#define GPIO_GICLR_GIWE1_MASK (0x2U) -#define GPIO_GICLR_GIWE1_SHIFT (1U) -/*! GIWE1 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE1_SHIFT)) & GPIO_GICLR_GIWE1_MASK) - -#define GPIO_GICLR_GIWE2_MASK (0x4U) -#define GPIO_GICLR_GIWE2_SHIFT (2U) -/*! GIWE2 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE2_SHIFT)) & GPIO_GICLR_GIWE2_MASK) - -#define GPIO_GICLR_GIWE3_MASK (0x8U) -#define GPIO_GICLR_GIWE3_SHIFT (3U) -/*! GIWE3 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE3_SHIFT)) & GPIO_GICLR_GIWE3_MASK) - -#define GPIO_GICLR_GIWE4_MASK (0x10U) -#define GPIO_GICLR_GIWE4_SHIFT (4U) -/*! GIWE4 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE4_SHIFT)) & GPIO_GICLR_GIWE4_MASK) - -#define GPIO_GICLR_GIWE5_MASK (0x20U) -#define GPIO_GICLR_GIWE5_SHIFT (5U) -/*! GIWE5 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE5_SHIFT)) & GPIO_GICLR_GIWE5_MASK) - -#define GPIO_GICLR_GIWE6_MASK (0x40U) -#define GPIO_GICLR_GIWE6_SHIFT (6U) -/*! GIWE6 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE6_SHIFT)) & GPIO_GICLR_GIWE6_MASK) - -#define GPIO_GICLR_GIWE7_MASK (0x80U) -#define GPIO_GICLR_GIWE7_SHIFT (7U) -/*! GIWE7 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE7_SHIFT)) & GPIO_GICLR_GIWE7_MASK) - -#define GPIO_GICLR_GIWE8_MASK (0x100U) -#define GPIO_GICLR_GIWE8_SHIFT (8U) -/*! GIWE8 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE8_SHIFT)) & GPIO_GICLR_GIWE8_MASK) - -#define GPIO_GICLR_GIWE9_MASK (0x200U) -#define GPIO_GICLR_GIWE9_SHIFT (9U) -/*! GIWE9 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE9_SHIFT)) & GPIO_GICLR_GIWE9_MASK) - -#define GPIO_GICLR_GIWE10_MASK (0x400U) -#define GPIO_GICLR_GIWE10_SHIFT (10U) -/*! GIWE10 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE10_SHIFT)) & GPIO_GICLR_GIWE10_MASK) - -#define GPIO_GICLR_GIWE11_MASK (0x800U) -#define GPIO_GICLR_GIWE11_SHIFT (11U) -/*! GIWE11 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE11_SHIFT)) & GPIO_GICLR_GIWE11_MASK) - -#define GPIO_GICLR_GIWE12_MASK (0x1000U) -#define GPIO_GICLR_GIWE12_SHIFT (12U) -/*! GIWE12 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE12_SHIFT)) & GPIO_GICLR_GIWE12_MASK) - -#define GPIO_GICLR_GIWE13_MASK (0x2000U) -#define GPIO_GICLR_GIWE13_SHIFT (13U) -/*! GIWE13 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE13_SHIFT)) & GPIO_GICLR_GIWE13_MASK) - -#define GPIO_GICLR_GIWE14_MASK (0x4000U) -#define GPIO_GICLR_GIWE14_SHIFT (14U) -/*! GIWE14 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE14_SHIFT)) & GPIO_GICLR_GIWE14_MASK) - -#define GPIO_GICLR_GIWE15_MASK (0x8000U) -#define GPIO_GICLR_GIWE15_SHIFT (15U) -/*! GIWE15 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE15_SHIFT)) & GPIO_GICLR_GIWE15_MASK) - -#define GPIO_GICLR_GIWD_MASK (0xFFFF0000U) -#define GPIO_GICLR_GIWD_SHIFT (16U) -/*! GIWD - Global Interrupt Write Data */ -#define GPIO_GICLR_GIWD(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWD_SHIFT)) & GPIO_GICLR_GIWD_MASK) -/*! @} */ - -/*! @name GICHR - Global Interrupt Control High */ -/*! @{ */ - -#define GPIO_GICHR_GIWE16_MASK (0x1U) -#define GPIO_GICHR_GIWE16_SHIFT (0U) -/*! GIWE16 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE16_SHIFT)) & GPIO_GICHR_GIWE16_MASK) - -#define GPIO_GICHR_GIWE17_MASK (0x2U) -#define GPIO_GICHR_GIWE17_SHIFT (1U) -/*! GIWE17 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE17_SHIFT)) & GPIO_GICHR_GIWE17_MASK) - -#define GPIO_GICHR_GIWE18_MASK (0x4U) -#define GPIO_GICHR_GIWE18_SHIFT (2U) -/*! GIWE18 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE18_SHIFT)) & GPIO_GICHR_GIWE18_MASK) - -#define GPIO_GICHR_GIWE19_MASK (0x8U) -#define GPIO_GICHR_GIWE19_SHIFT (3U) -/*! GIWE19 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE19_SHIFT)) & GPIO_GICHR_GIWE19_MASK) - -#define GPIO_GICHR_GIWE20_MASK (0x10U) -#define GPIO_GICHR_GIWE20_SHIFT (4U) -/*! GIWE20 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE20_SHIFT)) & GPIO_GICHR_GIWE20_MASK) - -#define GPIO_GICHR_GIWE21_MASK (0x20U) -#define GPIO_GICHR_GIWE21_SHIFT (5U) -/*! GIWE21 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE21_SHIFT)) & GPIO_GICHR_GIWE21_MASK) - -#define GPIO_GICHR_GIWE22_MASK (0x40U) -#define GPIO_GICHR_GIWE22_SHIFT (6U) -/*! GIWE22 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE22_SHIFT)) & GPIO_GICHR_GIWE22_MASK) - -#define GPIO_GICHR_GIWE23_MASK (0x80U) -#define GPIO_GICHR_GIWE23_SHIFT (7U) -/*! GIWE23 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE23_SHIFT)) & GPIO_GICHR_GIWE23_MASK) - -#define GPIO_GICHR_GIWE24_MASK (0x100U) -#define GPIO_GICHR_GIWE24_SHIFT (8U) -/*! GIWE24 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE24_SHIFT)) & GPIO_GICHR_GIWE24_MASK) - -#define GPIO_GICHR_GIWE25_MASK (0x200U) -#define GPIO_GICHR_GIWE25_SHIFT (9U) -/*! GIWE25 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE25_SHIFT)) & GPIO_GICHR_GIWE25_MASK) - -#define GPIO_GICHR_GIWE26_MASK (0x400U) -#define GPIO_GICHR_GIWE26_SHIFT (10U) -/*! GIWE26 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE26_SHIFT)) & GPIO_GICHR_GIWE26_MASK) - -#define GPIO_GICHR_GIWE27_MASK (0x800U) -#define GPIO_GICHR_GIWE27_SHIFT (11U) -/*! GIWE27 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE27_SHIFT)) & GPIO_GICHR_GIWE27_MASK) - -#define GPIO_GICHR_GIWE28_MASK (0x1000U) -#define GPIO_GICHR_GIWE28_SHIFT (12U) -/*! GIWE28 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE28_SHIFT)) & GPIO_GICHR_GIWE28_MASK) - -#define GPIO_GICHR_GIWE29_MASK (0x2000U) -#define GPIO_GICHR_GIWE29_SHIFT (13U) -/*! GIWE29 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE29_SHIFT)) & GPIO_GICHR_GIWE29_MASK) - -#define GPIO_GICHR_GIWE30_MASK (0x4000U) -#define GPIO_GICHR_GIWE30_SHIFT (14U) -/*! GIWE30 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE30_SHIFT)) & GPIO_GICHR_GIWE30_MASK) - -#define GPIO_GICHR_GIWE31_MASK (0x8000U) -#define GPIO_GICHR_GIWE31_SHIFT (15U) -/*! GIWE31 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE31_SHIFT)) & GPIO_GICHR_GIWE31_MASK) - -#define GPIO_GICHR_GIWD_MASK (0xFFFF0000U) -#define GPIO_GICHR_GIWD_SHIFT (16U) -/*! GIWD - Global Interrupt Write Data */ -#define GPIO_GICHR_GIWD(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWD_SHIFT)) & GPIO_GICHR_GIWD_MASK) -/*! @} */ - -/*! @name ISFR - Interrupt Status Flag */ -/*! @{ */ - -#define GPIO_ISFR_ISF0_MASK (0x1U) -#define GPIO_ISFR_ISF0_SHIFT (0U) -/*! ISF0 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF0_SHIFT)) & GPIO_ISFR_ISF0_MASK) - -#define GPIO_ISFR_ISF1_MASK (0x2U) -#define GPIO_ISFR_ISF1_SHIFT (1U) -/*! ISF1 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF1_SHIFT)) & GPIO_ISFR_ISF1_MASK) - -#define GPIO_ISFR_ISF2_MASK (0x4U) -#define GPIO_ISFR_ISF2_SHIFT (2U) -/*! ISF2 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF2_SHIFT)) & GPIO_ISFR_ISF2_MASK) - -#define GPIO_ISFR_ISF3_MASK (0x8U) -#define GPIO_ISFR_ISF3_SHIFT (3U) -/*! ISF3 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF3_SHIFT)) & GPIO_ISFR_ISF3_MASK) - -#define GPIO_ISFR_ISF4_MASK (0x10U) -#define GPIO_ISFR_ISF4_SHIFT (4U) -/*! ISF4 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF4_SHIFT)) & GPIO_ISFR_ISF4_MASK) - -#define GPIO_ISFR_ISF5_MASK (0x20U) -#define GPIO_ISFR_ISF5_SHIFT (5U) -/*! ISF5 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF5_SHIFT)) & GPIO_ISFR_ISF5_MASK) - -#define GPIO_ISFR_ISF6_MASK (0x40U) -#define GPIO_ISFR_ISF6_SHIFT (6U) -/*! ISF6 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF6_SHIFT)) & GPIO_ISFR_ISF6_MASK) - -#define GPIO_ISFR_ISF7_MASK (0x80U) -#define GPIO_ISFR_ISF7_SHIFT (7U) -/*! ISF7 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF7_SHIFT)) & GPIO_ISFR_ISF7_MASK) - -#define GPIO_ISFR_ISF8_MASK (0x100U) -#define GPIO_ISFR_ISF8_SHIFT (8U) -/*! ISF8 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF8_SHIFT)) & GPIO_ISFR_ISF8_MASK) - -#define GPIO_ISFR_ISF9_MASK (0x200U) -#define GPIO_ISFR_ISF9_SHIFT (9U) -/*! ISF9 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF9_SHIFT)) & GPIO_ISFR_ISF9_MASK) - -#define GPIO_ISFR_ISF10_MASK (0x400U) -#define GPIO_ISFR_ISF10_SHIFT (10U) -/*! ISF10 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF10_SHIFT)) & GPIO_ISFR_ISF10_MASK) - -#define GPIO_ISFR_ISF11_MASK (0x800U) -#define GPIO_ISFR_ISF11_SHIFT (11U) -/*! ISF11 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF11_SHIFT)) & GPIO_ISFR_ISF11_MASK) - -#define GPIO_ISFR_ISF12_MASK (0x1000U) -#define GPIO_ISFR_ISF12_SHIFT (12U) -/*! ISF12 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF12_SHIFT)) & GPIO_ISFR_ISF12_MASK) - -#define GPIO_ISFR_ISF13_MASK (0x2000U) -#define GPIO_ISFR_ISF13_SHIFT (13U) -/*! ISF13 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF13_SHIFT)) & GPIO_ISFR_ISF13_MASK) - -#define GPIO_ISFR_ISF14_MASK (0x4000U) -#define GPIO_ISFR_ISF14_SHIFT (14U) -/*! ISF14 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF14_SHIFT)) & GPIO_ISFR_ISF14_MASK) - -#define GPIO_ISFR_ISF15_MASK (0x8000U) -#define GPIO_ISFR_ISF15_SHIFT (15U) -/*! ISF15 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF15_SHIFT)) & GPIO_ISFR_ISF15_MASK) - -#define GPIO_ISFR_ISF16_MASK (0x10000U) -#define GPIO_ISFR_ISF16_SHIFT (16U) -/*! ISF16 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF16_SHIFT)) & GPIO_ISFR_ISF16_MASK) - -#define GPIO_ISFR_ISF17_MASK (0x20000U) -#define GPIO_ISFR_ISF17_SHIFT (17U) -/*! ISF17 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF17_SHIFT)) & GPIO_ISFR_ISF17_MASK) - -#define GPIO_ISFR_ISF18_MASK (0x40000U) -#define GPIO_ISFR_ISF18_SHIFT (18U) -/*! ISF18 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF18_SHIFT)) & GPIO_ISFR_ISF18_MASK) - -#define GPIO_ISFR_ISF19_MASK (0x80000U) -#define GPIO_ISFR_ISF19_SHIFT (19U) -/*! ISF19 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF19_SHIFT)) & GPIO_ISFR_ISF19_MASK) - -#define GPIO_ISFR_ISF20_MASK (0x100000U) -#define GPIO_ISFR_ISF20_SHIFT (20U) -/*! ISF20 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF20_SHIFT)) & GPIO_ISFR_ISF20_MASK) - -#define GPIO_ISFR_ISF21_MASK (0x200000U) -#define GPIO_ISFR_ISF21_SHIFT (21U) -/*! ISF21 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF21_SHIFT)) & GPIO_ISFR_ISF21_MASK) - -#define GPIO_ISFR_ISF22_MASK (0x400000U) -#define GPIO_ISFR_ISF22_SHIFT (22U) -/*! ISF22 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF22_SHIFT)) & GPIO_ISFR_ISF22_MASK) - -#define GPIO_ISFR_ISF23_MASK (0x800000U) -#define GPIO_ISFR_ISF23_SHIFT (23U) -/*! ISF23 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF23_SHIFT)) & GPIO_ISFR_ISF23_MASK) - -#define GPIO_ISFR_ISF24_MASK (0x1000000U) -#define GPIO_ISFR_ISF24_SHIFT (24U) -/*! ISF24 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF24_SHIFT)) & GPIO_ISFR_ISF24_MASK) - -#define GPIO_ISFR_ISF25_MASK (0x2000000U) -#define GPIO_ISFR_ISF25_SHIFT (25U) -/*! ISF25 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF25_SHIFT)) & GPIO_ISFR_ISF25_MASK) - -#define GPIO_ISFR_ISF26_MASK (0x4000000U) -#define GPIO_ISFR_ISF26_SHIFT (26U) -/*! ISF26 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF26_SHIFT)) & GPIO_ISFR_ISF26_MASK) - -#define GPIO_ISFR_ISF27_MASK (0x8000000U) -#define GPIO_ISFR_ISF27_SHIFT (27U) -/*! ISF27 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF27_SHIFT)) & GPIO_ISFR_ISF27_MASK) - -#define GPIO_ISFR_ISF28_MASK (0x10000000U) -#define GPIO_ISFR_ISF28_SHIFT (28U) -/*! ISF28 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF28_SHIFT)) & GPIO_ISFR_ISF28_MASK) - -#define GPIO_ISFR_ISF29_MASK (0x20000000U) -#define GPIO_ISFR_ISF29_SHIFT (29U) -/*! ISF29 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF29_SHIFT)) & GPIO_ISFR_ISF29_MASK) - -#define GPIO_ISFR_ISF30_MASK (0x40000000U) -#define GPIO_ISFR_ISF30_SHIFT (30U) -/*! ISF30 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF30_SHIFT)) & GPIO_ISFR_ISF30_MASK) - -#define GPIO_ISFR_ISF31_MASK (0x80000000U) -#define GPIO_ISFR_ISF31_SHIFT (31U) -/*! ISF31 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF31_SHIFT)) & GPIO_ISFR_ISF31_MASK) -/*! @} */ - -/* The count of GPIO_ISFR */ -#define GPIO_ISFR_COUNT (2U) - - -/*! - * @} - */ /* end of group GPIO_Register_Masks */ - - -/* GPIO - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral GPIO0 base address */ - #define GPIO0_BASE (0x50096000u) - /** Peripheral GPIO0 base address */ - #define GPIO0_BASE_NS (0x40096000u) - /** Peripheral GPIO0 base pointer */ - #define GPIO0 ((GPIO_Type *)GPIO0_BASE) - /** Peripheral GPIO0 base pointer */ - #define GPIO0_NS ((GPIO_Type *)GPIO0_BASE_NS) - /** Peripheral GPIO0_ALIAS1 base address */ - #define GPIO0_ALIAS1_BASE (0x50097000u) - /** Peripheral GPIO0_ALIAS1 base address */ - #define GPIO0_ALIAS1_BASE_NS (0x40097000u) - /** Peripheral GPIO0_ALIAS1 base pointer */ - #define GPIO0_ALIAS1 ((GPIO_Type *)GPIO0_ALIAS1_BASE) - /** Peripheral GPIO0_ALIAS1 base pointer */ - #define GPIO0_ALIAS1_NS ((GPIO_Type *)GPIO0_ALIAS1_BASE_NS) - /** Peripheral GPIO1 base address */ - #define GPIO1_BASE (0x50098000u) - /** Peripheral GPIO1 base address */ - #define GPIO1_BASE_NS (0x40098000u) - /** Peripheral GPIO1 base pointer */ - #define GPIO1 ((GPIO_Type *)GPIO1_BASE) - /** Peripheral GPIO1 base pointer */ - #define GPIO1_NS ((GPIO_Type *)GPIO1_BASE_NS) - /** Peripheral GPIO1_ALIAS1 base address */ - #define GPIO1_ALIAS1_BASE (0x50099000u) - /** Peripheral GPIO1_ALIAS1 base address */ - #define GPIO1_ALIAS1_BASE_NS (0x40099000u) - /** Peripheral GPIO1_ALIAS1 base pointer */ - #define GPIO1_ALIAS1 ((GPIO_Type *)GPIO1_ALIAS1_BASE) - /** Peripheral GPIO1_ALIAS1 base pointer */ - #define GPIO1_ALIAS1_NS ((GPIO_Type *)GPIO1_ALIAS1_BASE_NS) - /** Peripheral GPIO2 base address */ - #define GPIO2_BASE (0x5009A000u) - /** Peripheral GPIO2 base address */ - #define GPIO2_BASE_NS (0x4009A000u) - /** Peripheral GPIO2 base pointer */ - #define GPIO2 ((GPIO_Type *)GPIO2_BASE) - /** Peripheral GPIO2 base pointer */ - #define GPIO2_NS ((GPIO_Type *)GPIO2_BASE_NS) - /** Peripheral GPIO2_ALIAS1 base address */ - #define GPIO2_ALIAS1_BASE (0x5009B000u) - /** Peripheral GPIO2_ALIAS1 base address */ - #define GPIO2_ALIAS1_BASE_NS (0x4009B000u) - /** Peripheral GPIO2_ALIAS1 base pointer */ - #define GPIO2_ALIAS1 ((GPIO_Type *)GPIO2_ALIAS1_BASE) - /** Peripheral GPIO2_ALIAS1 base pointer */ - #define GPIO2_ALIAS1_NS ((GPIO_Type *)GPIO2_ALIAS1_BASE_NS) - /** Peripheral GPIO3 base address */ - #define GPIO3_BASE (0x5009C000u) - /** Peripheral GPIO3 base address */ - #define GPIO3_BASE_NS (0x4009C000u) - /** Peripheral GPIO3 base pointer */ - #define GPIO3 ((GPIO_Type *)GPIO3_BASE) - /** Peripheral GPIO3 base pointer */ - #define GPIO3_NS ((GPIO_Type *)GPIO3_BASE_NS) - /** Peripheral GPIO3_ALIAS1 base address */ - #define GPIO3_ALIAS1_BASE (0x5009D000u) - /** Peripheral GPIO3_ALIAS1 base address */ - #define GPIO3_ALIAS1_BASE_NS (0x4009D000u) - /** Peripheral GPIO3_ALIAS1 base pointer */ - #define GPIO3_ALIAS1 ((GPIO_Type *)GPIO3_ALIAS1_BASE) - /** Peripheral GPIO3_ALIAS1 base pointer */ - #define GPIO3_ALIAS1_NS ((GPIO_Type *)GPIO3_ALIAS1_BASE_NS) - /** Peripheral GPIO4 base address */ - #define GPIO4_BASE (0x5009E000u) - /** Peripheral GPIO4 base address */ - #define GPIO4_BASE_NS (0x4009E000u) - /** Peripheral GPIO4 base pointer */ - #define GPIO4 ((GPIO_Type *)GPIO4_BASE) - /** Peripheral GPIO4 base pointer */ - #define GPIO4_NS ((GPIO_Type *)GPIO4_BASE_NS) - /** Peripheral GPIO4_ALIAS1 base address */ - #define GPIO4_ALIAS1_BASE (0x5009F000u) - /** Peripheral GPIO4_ALIAS1 base address */ - #define GPIO4_ALIAS1_BASE_NS (0x4009F000u) - /** Peripheral GPIO4_ALIAS1 base pointer */ - #define GPIO4_ALIAS1 ((GPIO_Type *)GPIO4_ALIAS1_BASE) - /** Peripheral GPIO4_ALIAS1 base pointer */ - #define GPIO4_ALIAS1_NS ((GPIO_Type *)GPIO4_ALIAS1_BASE_NS) - /** Peripheral GPIO5 base address */ - #define GPIO5_BASE (0x50040000u) - /** Peripheral GPIO5 base address */ - #define GPIO5_BASE_NS (0x40040000u) - /** Peripheral GPIO5 base pointer */ - #define GPIO5 ((GPIO_Type *)GPIO5_BASE) - /** Peripheral GPIO5 base pointer */ - #define GPIO5_NS ((GPIO_Type *)GPIO5_BASE_NS) - /** Peripheral GPIO5_ALIAS1 base address */ - #define GPIO5_ALIAS1_BASE (0x50041000u) - /** Peripheral GPIO5_ALIAS1 base address */ - #define GPIO5_ALIAS1_BASE_NS (0x40041000u) - /** Peripheral GPIO5_ALIAS1 base pointer */ - #define GPIO5_ALIAS1 ((GPIO_Type *)GPIO5_ALIAS1_BASE) - /** Peripheral GPIO5_ALIAS1 base pointer */ - #define GPIO5_ALIAS1_NS ((GPIO_Type *)GPIO5_ALIAS1_BASE_NS) - /** Array initializer of GPIO peripheral base addresses */ - #define GPIO_BASE_ADDRS { GPIO0_BASE, GPIO1_BASE, GPIO2_BASE, GPIO3_BASE, GPIO4_BASE, GPIO5_BASE } - #define GPIO_ALIAS1_BASE_ADDRS { GPIO0_ALIAS1_BASE, GPIO1_ALIAS1_BASE, GPIO2_ALIAS1_BASE, GPIO3_ALIAS1_BASE, GPIO4_ALIAS1_BASE, GPIO5_ALIAS1_BASE } - /** Array initializer of GPIO peripheral base pointers */ - #define GPIO_BASE_PTRS { GPIO0, GPIO1, GPIO2, GPIO3, GPIO4, GPIO5 } - #define GPIO_ALIAS1_BASE_PTRS { GPIO0_ALIAS1, GPIO1_ALIAS1, GPIO2_ALIAS1, GPIO3_ALIAS1, GPIO4_ALIAS1, GPIO5_ALIAS1 } - /** Array initializer of GPIO peripheral base addresses */ - #define GPIO_BASE_ADDRS_NS { GPIO0_BASE_NS, GPIO1_BASE_NS, GPIO2_BASE_NS, GPIO3_BASE_NS, GPIO4_BASE_NS, GPIO5_BASE_NS } - #define GPIO_ALIAS1_BASE_ADDRS_NS { GPIO0_ALIAS1_BASE_NS, GPIO1_ALIAS1_BASE_NS, GPIO2_ALIAS1_BASE_NS, GPIO3_ALIAS1_BASE_NS, GPIO4_ALIAS1_BASE_NS, GPIO5_ALIAS1_BASE_NS } - /** Array initializer of GPIO peripheral base pointers */ - #define GPIO_BASE_PTRS_NS { GPIO0_NS, GPIO1_NS, GPIO2_NS, GPIO3_NS, GPIO4_NS, GPIO5_NS } - #define GPIO_ALIAS1_BASE_PTRS_NS { GPIO0_ALIAS1_NS, GPIO1_ALIAS1_NS, GPIO2_ALIAS1_NS, GPIO3_ALIAS1_NS, GPIO4_ALIAS1_NS, GPIO5_ALIAS1_NS } -#else - /** Peripheral GPIO0 base address */ - #define GPIO0_BASE (0x40096000u) - /** Peripheral GPIO0 base pointer */ - #define GPIO0 ((GPIO_Type *)GPIO0_BASE) - /** Peripheral GPIO0_ALIAS1 base address */ - #define GPIO0_ALIAS1_BASE (0x40097000u) - /** Peripheral GPIO0_ALIAS1 base pointer */ - #define GPIO0_ALIAS1 ((GPIO_Type *)GPIO0_ALIAS1_BASE) - /** Peripheral GPIO1 base address */ - #define GPIO1_BASE (0x40098000u) - /** Peripheral GPIO1 base pointer */ - #define GPIO1 ((GPIO_Type *)GPIO1_BASE) - /** Peripheral GPIO1_ALIAS1 base address */ - #define GPIO1_ALIAS1_BASE (0x40099000u) - /** Peripheral GPIO1_ALIAS1 base pointer */ - #define GPIO1_ALIAS1 ((GPIO_Type *)GPIO1_ALIAS1_BASE) - /** Peripheral GPIO2 base address */ - #define GPIO2_BASE (0x4009A000u) - /** Peripheral GPIO2 base pointer */ - #define GPIO2 ((GPIO_Type *)GPIO2_BASE) - /** Peripheral GPIO2_ALIAS1 base address */ - #define GPIO2_ALIAS1_BASE (0x4009B000u) - /** Peripheral GPIO2_ALIAS1 base pointer */ - #define GPIO2_ALIAS1 ((GPIO_Type *)GPIO2_ALIAS1_BASE) - /** Peripheral GPIO3 base address */ - #define GPIO3_BASE (0x4009C000u) - /** Peripheral GPIO3 base pointer */ - #define GPIO3 ((GPIO_Type *)GPIO3_BASE) - /** Peripheral GPIO3_ALIAS1 base address */ - #define GPIO3_ALIAS1_BASE (0x4009D000u) - /** Peripheral GPIO3_ALIAS1 base pointer */ - #define GPIO3_ALIAS1 ((GPIO_Type *)GPIO3_ALIAS1_BASE) - /** Peripheral GPIO4 base address */ - #define GPIO4_BASE (0x4009E000u) - /** Peripheral GPIO4 base pointer */ - #define GPIO4 ((GPIO_Type *)GPIO4_BASE) - /** Peripheral GPIO4_ALIAS1 base address */ - #define GPIO4_ALIAS1_BASE (0x4009F000u) - /** Peripheral GPIO4_ALIAS1 base pointer */ - #define GPIO4_ALIAS1 ((GPIO_Type *)GPIO4_ALIAS1_BASE) - /** Peripheral GPIO5 base address */ - #define GPIO5_BASE (0x40040000u) - /** Peripheral GPIO5 base pointer */ - #define GPIO5 ((GPIO_Type *)GPIO5_BASE) - /** Peripheral GPIO5_ALIAS1 base address */ - #define GPIO5_ALIAS1_BASE (0x40041000u) - /** Peripheral GPIO5_ALIAS1 base pointer */ - #define GPIO5_ALIAS1 ((GPIO_Type *)GPIO5_ALIAS1_BASE) - /** Array initializer of GPIO peripheral base addresses */ - #define GPIO_BASE_ADDRS { GPIO0_BASE, GPIO1_BASE, GPIO2_BASE, GPIO3_BASE, GPIO4_BASE, GPIO5_BASE } - #define GPIO_ALIAS1_BASE_ADDRS { GPIO0_ALIAS1_BASE, GPIO1_ALIAS1_BASE, GPIO2_ALIAS1_BASE, GPIO3_ALIAS1_BASE, GPIO4_ALIAS1_BASE, GPIO5_ALIAS1_BASE } - /** Array initializer of GPIO peripheral base pointers */ - #define GPIO_BASE_PTRS { GPIO0, GPIO1, GPIO2, GPIO3, GPIO4, GPIO5 } - #define GPIO_ALIAS1_BASE_PTRS { GPIO0_ALIAS1, GPIO1_ALIAS1, GPIO2_ALIAS1, GPIO3_ALIAS1, GPIO4_ALIAS1, GPIO5_ALIAS1 } -#endif -/* Interrupt vectors for the GPIO peripheral type */ -#define GPIO_IRQS {GPIO00_IRQn, GPIO10_IRQn, GPIO20_IRQn, GPIO30_IRQn,GPIO40_IRQn,GPIO50_IRQn} -#define GPIO_IRQS_1 {GPIO01_IRQn, GPIO11_IRQn, GPIO21_IRQn, GPIO31_IRQn,GPIO41_IRQn,GPIO51_IRQn} - - -/*! - * @} - */ /* end of group GPIO_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- I2S Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup I2S_Peripheral_Access_Layer I2S Peripheral Access Layer - * @{ - */ - -/** I2S - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - __IO uint32_t TCSR; /**< Transmit Control, offset: 0x8 */ - __IO uint32_t TCR1; /**< Transmit Configuration 1, offset: 0xC */ - __IO uint32_t TCR2; /**< Transmit Configuration 2, offset: 0x10 */ - __IO uint32_t TCR3; /**< Transmit Configuration 3, offset: 0x14 */ - __IO uint32_t TCR4; /**< Transmit Configuration 4, offset: 0x18 */ - __IO uint32_t TCR5; /**< Transmit Configuration 5, offset: 0x1C */ - __O uint32_t TDR[2]; /**< Transmit Data, array offset: 0x20, array step: 0x4 */ - uint8_t RESERVED_0[24]; - __I uint32_t TFR[2]; /**< Transmit FIFO, array offset: 0x40, array step: 0x4 */ - uint8_t RESERVED_1[24]; - __IO uint32_t TMR; /**< Transmit Mask, offset: 0x60 */ - uint8_t RESERVED_2[36]; - __IO uint32_t RCSR; /**< Receive Control, offset: 0x88 */ - __IO uint32_t RCR1; /**< Receive Configuration 1, offset: 0x8C */ - __IO uint32_t RCR2; /**< Receive Configuration 2, offset: 0x90 */ - __IO uint32_t RCR3; /**< Receive Configuration 3, offset: 0x94 */ - __IO uint32_t RCR4; /**< Receive Configuration 4, offset: 0x98 */ - __IO uint32_t RCR5; /**< Receive Configuration 5, offset: 0x9C */ - __I uint32_t RDR[2]; /**< Receive Data, array offset: 0xA0, array step: 0x4 */ - uint8_t RESERVED_3[24]; - __I uint32_t RFR[2]; /**< Receive FIFO, array offset: 0xC0, array step: 0x4 */ - uint8_t RESERVED_4[24]; - __IO uint32_t RMR; /**< Receive Mask, offset: 0xE0 */ - uint8_t RESERVED_5[28]; - __IO uint32_t MCR; /**< MCLK Control, offset: 0x100 */ -} I2S_Type; - -/* ---------------------------------------------------------------------------- - -- I2S Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup I2S_Register_Masks I2S Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define I2S_VERID_FEATURE_MASK (0xFFFFU) -#define I2S_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Standard feature set - */ -#define I2S_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << I2S_VERID_FEATURE_SHIFT)) & I2S_VERID_FEATURE_MASK) - -#define I2S_VERID_MINOR_MASK (0xFF0000U) -#define I2S_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define I2S_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << I2S_VERID_MINOR_SHIFT)) & I2S_VERID_MINOR_MASK) - -#define I2S_VERID_MAJOR_MASK (0xFF000000U) -#define I2S_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define I2S_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << I2S_VERID_MAJOR_SHIFT)) & I2S_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define I2S_PARAM_DATALINE_MASK (0xFU) -#define I2S_PARAM_DATALINE_SHIFT (0U) -/*! DATALINE - Number of Data Lines */ -#define I2S_PARAM_DATALINE(x) (((uint32_t)(((uint32_t)(x)) << I2S_PARAM_DATALINE_SHIFT)) & I2S_PARAM_DATALINE_MASK) - -#define I2S_PARAM_FIFO_MASK (0xF00U) -#define I2S_PARAM_FIFO_SHIFT (8U) -/*! FIFO - FIFO Size */ -#define I2S_PARAM_FIFO(x) (((uint32_t)(((uint32_t)(x)) << I2S_PARAM_FIFO_SHIFT)) & I2S_PARAM_FIFO_MASK) - -#define I2S_PARAM_FRAME_MASK (0xF0000U) -#define I2S_PARAM_FRAME_SHIFT (16U) -/*! FRAME - Frame Size */ -#define I2S_PARAM_FRAME(x) (((uint32_t)(((uint32_t)(x)) << I2S_PARAM_FRAME_SHIFT)) & I2S_PARAM_FRAME_MASK) -/*! @} */ - -/*! @name TCSR - Transmit Control */ -/*! @{ */ - -#define I2S_TCSR_FRDE_MASK (0x1U) -#define I2S_TCSR_FRDE_SHIFT (0U) -/*! FRDE - FIFO Request DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCSR_FRDE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FRDE_SHIFT)) & I2S_TCSR_FRDE_MASK) - -#define I2S_TCSR_FWDE_MASK (0x2U) -#define I2S_TCSR_FWDE_SHIFT (1U) -/*! FWDE - FIFO Warning DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCSR_FWDE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FWDE_SHIFT)) & I2S_TCSR_FWDE_MASK) - -#define I2S_TCSR_FRIE_MASK (0x100U) -#define I2S_TCSR_FRIE_SHIFT (8U) -/*! FRIE - FIFO Request Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCSR_FRIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FRIE_SHIFT)) & I2S_TCSR_FRIE_MASK) - -#define I2S_TCSR_FWIE_MASK (0x200U) -#define I2S_TCSR_FWIE_SHIFT (9U) -/*! FWIE - FIFO Warning Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCSR_FWIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FWIE_SHIFT)) & I2S_TCSR_FWIE_MASK) - -#define I2S_TCSR_FEIE_MASK (0x400U) -#define I2S_TCSR_FEIE_SHIFT (10U) -/*! FEIE - FIFO Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCSR_FEIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FEIE_SHIFT)) & I2S_TCSR_FEIE_MASK) - -#define I2S_TCSR_SEIE_MASK (0x800U) -#define I2S_TCSR_SEIE_SHIFT (11U) -/*! SEIE - Sync Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCSR_SEIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_SEIE_SHIFT)) & I2S_TCSR_SEIE_MASK) - -#define I2S_TCSR_WSIE_MASK (0x1000U) -#define I2S_TCSR_WSIE_SHIFT (12U) -/*! WSIE - Word Start Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCSR_WSIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_WSIE_SHIFT)) & I2S_TCSR_WSIE_MASK) - -#define I2S_TCSR_FRF_MASK (0x10000U) -#define I2S_TCSR_FRF_SHIFT (16U) -/*! FRF - FIFO Request Flag - * 0b0..Watermark not reached - * 0b1..Watermark reached - */ -#define I2S_TCSR_FRF(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FRF_SHIFT)) & I2S_TCSR_FRF_MASK) - -#define I2S_TCSR_FWF_MASK (0x20000U) -#define I2S_TCSR_FWF_SHIFT (17U) -/*! FWF - FIFO Warning Flag - * 0b0..Not empty - * 0b1..Empty - */ -#define I2S_TCSR_FWF(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FWF_SHIFT)) & I2S_TCSR_FWF_MASK) - -#define I2S_TCSR_FEF_MASK (0x40000U) -#define I2S_TCSR_FEF_SHIFT (18U) -/*! FEF - FIFO Error Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I2S_TCSR_FEF(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FEF_SHIFT)) & I2S_TCSR_FEF_MASK) - -#define I2S_TCSR_SEF_MASK (0x80000U) -#define I2S_TCSR_SEF_SHIFT (19U) -/*! SEF - Sync Error Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I2S_TCSR_SEF(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_SEF_SHIFT)) & I2S_TCSR_SEF_MASK) - -#define I2S_TCSR_WSF_MASK (0x100000U) -#define I2S_TCSR_WSF_SHIFT (20U) -/*! WSF - Word Start Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I2S_TCSR_WSF(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_WSF_SHIFT)) & I2S_TCSR_WSF_MASK) - -#define I2S_TCSR_SR_MASK (0x1000000U) -#define I2S_TCSR_SR_SHIFT (24U) -/*! SR - Software Reset - * 0b0..No effect - * 0b1..Software reset - */ -#define I2S_TCSR_SR(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_SR_SHIFT)) & I2S_TCSR_SR_MASK) - -#define I2S_TCSR_FR_MASK (0x2000000U) -#define I2S_TCSR_FR_SHIFT (25U) -/*! FR - FIFO Reset - * 0b0..No effect - * 0b1..FIFO reset - */ -#define I2S_TCSR_FR(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FR_SHIFT)) & I2S_TCSR_FR_MASK) - -#define I2S_TCSR_BCE_MASK (0x10000000U) -#define I2S_TCSR_BCE_SHIFT (28U) -/*! BCE - Bit Clock Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCSR_BCE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_BCE_SHIFT)) & I2S_TCSR_BCE_MASK) - -#define I2S_TCSR_DBGE_MASK (0x20000000U) -#define I2S_TCSR_DBGE_SHIFT (29U) -/*! DBGE - Debug Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCSR_DBGE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_DBGE_SHIFT)) & I2S_TCSR_DBGE_MASK) - -#define I2S_TCSR_STOPE_MASK (0x40000000U) -#define I2S_TCSR_STOPE_SHIFT (30U) -/*! STOPE - Stop Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCSR_STOPE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_STOPE_SHIFT)) & I2S_TCSR_STOPE_MASK) - -#define I2S_TCSR_TE_MASK (0x80000000U) -#define I2S_TCSR_TE_SHIFT (31U) -/*! TE - Transmitter Enable - * 0b0..Disable - * 0b1..Enable (or transmitter has been disabled and has not yet reached the end of the frame) - */ -#define I2S_TCSR_TE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_TE_SHIFT)) & I2S_TCSR_TE_MASK) -/*! @} */ - -/*! @name TCR1 - Transmit Configuration 1 */ -/*! @{ */ - -#define I2S_TCR1_TFW_MASK (0x7U) -#define I2S_TCR1_TFW_SHIFT (0U) -/*! TFW - Transmit FIFO Watermark - * 0b000..1 - * 0b001..2 - * 0b010-0b110..(TFW +1) - * 0b111..8 - */ -#define I2S_TCR1_TFW(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR1_TFW_SHIFT)) & I2S_TCR1_TFW_MASK) -/*! @} */ - -/*! @name TCR2 - Transmit Configuration 2 */ -/*! @{ */ - -#define I2S_TCR2_DIV_MASK (0xFFU) -#define I2S_TCR2_DIV_SHIFT (0U) -/*! DIV - Bit Clock Divide */ -#define I2S_TCR2_DIV(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_DIV_SHIFT)) & I2S_TCR2_DIV_MASK) - -#define I2S_TCR2_BYP_MASK (0x800000U) -#define I2S_TCR2_BYP_SHIFT (23U) -/*! BYP - Bit Clock Bypass - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCR2_BYP(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_BYP_SHIFT)) & I2S_TCR2_BYP_MASK) - -#define I2S_TCR2_BCD_MASK (0x1000000U) -#define I2S_TCR2_BCD_SHIFT (24U) -/*! BCD - Bit Clock Direction - * 0b0..Generate externally in Target mode - * 0b1..Generate internally in Controller mode - */ -#define I2S_TCR2_BCD(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_BCD_SHIFT)) & I2S_TCR2_BCD_MASK) - -#define I2S_TCR2_BCP_MASK (0x2000000U) -#define I2S_TCR2_BCP_SHIFT (25U) -/*! BCP - Bit Clock Polarity - * 0b0..Active high - * 0b1..Active low - */ -#define I2S_TCR2_BCP(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_BCP_SHIFT)) & I2S_TCR2_BCP_MASK) - -#define I2S_TCR2_MSEL_MASK (0xC000000U) -#define I2S_TCR2_MSEL_SHIFT (26U) -/*! MSEL - MCLK Select - * 0b00..Bus clock - * 0b01..Controller clock (MCLK) option 1 - * 0b10..Controller clock (MCLK) option 2 - * 0b11..Controller clock (MCLK) option 3 - */ -#define I2S_TCR2_MSEL(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_MSEL_SHIFT)) & I2S_TCR2_MSEL_MASK) - -#define I2S_TCR2_BCI_MASK (0x10000000U) -#define I2S_TCR2_BCI_SHIFT (28U) -/*! BCI - Bit Clock Input - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCR2_BCI(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_BCI_SHIFT)) & I2S_TCR2_BCI_MASK) - -#define I2S_TCR2_BCS_MASK (0x20000000U) -#define I2S_TCR2_BCS_SHIFT (29U) -/*! BCS - Bit Clock Swap - * 0b0..Use the normal bit clock source - * 0b1..Swap the bit clock source - */ -#define I2S_TCR2_BCS(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_BCS_SHIFT)) & I2S_TCR2_BCS_MASK) - -#define I2S_TCR2_SYNC_MASK (0xC0000000U) -#define I2S_TCR2_SYNC_SHIFT (30U) -/*! SYNC - Synchronous Mode - * 0b00..Asynchronous mode - * 0b01..Synchronous with receiver - * 0b10..Synchronous with another SAI transmitter - * 0b11..Synchronous with another SAI receiver - */ -#define I2S_TCR2_SYNC(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_SYNC_SHIFT)) & I2S_TCR2_SYNC_MASK) -/*! @} */ - -/*! @name TCR3 - Transmit Configuration 3 */ -/*! @{ */ - -#define I2S_TCR3_WDFL_MASK (0x1FU) -#define I2S_TCR3_WDFL_SHIFT (0U) -/*! WDFL - Word Flag Configuration */ -#define I2S_TCR3_WDFL(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR3_WDFL_SHIFT)) & I2S_TCR3_WDFL_MASK) - -#define I2S_TCR3_TCE_MASK (0x30000U) -#define I2S_TCR3_TCE_SHIFT (16U) -/*! TCE - Transmit Channel Enable */ -#define I2S_TCR3_TCE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR3_TCE_SHIFT)) & I2S_TCR3_TCE_MASK) - -#define I2S_TCR3_CFR_MASK (0x3000000U) -#define I2S_TCR3_CFR_SHIFT (24U) -/*! CFR - Channel FIFO Reset */ -#define I2S_TCR3_CFR(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR3_CFR_SHIFT)) & I2S_TCR3_CFR_MASK) -/*! @} */ - -/*! @name TCR4 - Transmit Configuration 4 */ -/*! @{ */ - -#define I2S_TCR4_FSD_MASK (0x1U) -#define I2S_TCR4_FSD_SHIFT (0U) -/*! FSD - Frame Sync Direction - * 0b0..Generated externally in Target mode - * 0b1..Generated internally in Controller mode - */ -#define I2S_TCR4_FSD(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_FSD_SHIFT)) & I2S_TCR4_FSD_MASK) - -#define I2S_TCR4_FSP_MASK (0x2U) -#define I2S_TCR4_FSP_SHIFT (1U) -/*! FSP - Frame Sync Polarity - * 0b0..Active high - * 0b1..Active low - */ -#define I2S_TCR4_FSP(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_FSP_SHIFT)) & I2S_TCR4_FSP_MASK) - -#define I2S_TCR4_ONDEM_MASK (0x4U) -#define I2S_TCR4_ONDEM_SHIFT (2U) -/*! ONDEM - On-Demand Mode - * 0b0..Generated continuously - * 0b1..Generated after the FIFO warning flag is cleared - */ -#define I2S_TCR4_ONDEM(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_ONDEM_SHIFT)) & I2S_TCR4_ONDEM_MASK) - -#define I2S_TCR4_FSE_MASK (0x8U) -#define I2S_TCR4_FSE_SHIFT (3U) -/*! FSE - Frame Sync Early - * 0b0..First bit of the frame - * 0b1..One bit before the first bit of the frame - */ -#define I2S_TCR4_FSE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_FSE_SHIFT)) & I2S_TCR4_FSE_MASK) - -#define I2S_TCR4_MF_MASK (0x10U) -#define I2S_TCR4_MF_SHIFT (4U) -/*! MF - MSB First - * 0b0..LSB - * 0b1..MSB - */ -#define I2S_TCR4_MF(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_MF_SHIFT)) & I2S_TCR4_MF_MASK) - -#define I2S_TCR4_CHMOD_MASK (0x20U) -#define I2S_TCR4_CHMOD_SHIFT (5U) -/*! CHMOD - Channel Mode - * 0b0..TDM mode - * 0b1..Output mode - */ -#define I2S_TCR4_CHMOD(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_CHMOD_SHIFT)) & I2S_TCR4_CHMOD_MASK) - -#define I2S_TCR4_SYWD_MASK (0x1F00U) -#define I2S_TCR4_SYWD_SHIFT (8U) -/*! SYWD - Sync Width */ -#define I2S_TCR4_SYWD(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_SYWD_SHIFT)) & I2S_TCR4_SYWD_MASK) - -#define I2S_TCR4_FRSZ_MASK (0x1F0000U) -#define I2S_TCR4_FRSZ_SHIFT (16U) -/*! FRSZ - Frame Size */ -#define I2S_TCR4_FRSZ(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_FRSZ_SHIFT)) & I2S_TCR4_FRSZ_MASK) - -#define I2S_TCR4_FPACK_MASK (0x3000000U) -#define I2S_TCR4_FPACK_SHIFT (24U) -/*! FPACK - FIFO Packing Mode - * 0b00..Disable FIFO packing - * 0b01..Reserved - * 0b10..Enable 8-bit FIFO packing - * 0b11..Enable 16-bit FIFO packing - */ -#define I2S_TCR4_FPACK(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_FPACK_SHIFT)) & I2S_TCR4_FPACK_MASK) - -#define I2S_TCR4_FCOMB_MASK (0xC000000U) -#define I2S_TCR4_FCOMB_SHIFT (26U) -/*! FCOMB - FIFO Combine Mode - * 0b00..Disable - * 0b01..Enable on FIFO reads (from transmit shift registers) - * 0b10..Enable on FIFO writes (by software) - * 0b11..Enable on FIFO reads (from transmit shift registers) and writes (by software) - */ -#define I2S_TCR4_FCOMB(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_FCOMB_SHIFT)) & I2S_TCR4_FCOMB_MASK) - -#define I2S_TCR4_FCONT_MASK (0x10000000U) -#define I2S_TCR4_FCONT_SHIFT (28U) -/*! FCONT - FIFO Continue on Error - * 0b0..Continue from the start of the next frame - * 0b1..Continue from the same word that caused the FIFO error - */ -#define I2S_TCR4_FCONT(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_FCONT_SHIFT)) & I2S_TCR4_FCONT_MASK) -/*! @} */ - -/*! @name TCR5 - Transmit Configuration 5 */ -/*! @{ */ - -#define I2S_TCR5_FBT_MASK (0x1F00U) -#define I2S_TCR5_FBT_SHIFT (8U) -/*! FBT - First Bit Shifted - * 0b00000..0 - * 0b00001-0b11110..FBT - * 0b11111..31 - */ -#define I2S_TCR5_FBT(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR5_FBT_SHIFT)) & I2S_TCR5_FBT_MASK) - -#define I2S_TCR5_W0W_MASK (0x1F0000U) -#define I2S_TCR5_W0W_SHIFT (16U) -/*! W0W - Word 0 Width - * 0b00111..8 - * 0b01000..9 - * 0b01001-0b11110..(W0W value + 1) - * 0b11111..32 - */ -#define I2S_TCR5_W0W(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR5_W0W_SHIFT)) & I2S_TCR5_W0W_MASK) - -#define I2S_TCR5_WNW_MASK (0x1F000000U) -#define I2S_TCR5_WNW_SHIFT (24U) -/*! WNW - Word N Width - * 0b00111..8 - * 0b01000..9 - * 0b01001-0b11110..(WNW value + 1) - * 0b11111..32 - */ -#define I2S_TCR5_WNW(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR5_WNW_SHIFT)) & I2S_TCR5_WNW_MASK) -/*! @} */ - -/*! @name TDR - Transmit Data */ -/*! @{ */ - -#define I2S_TDR_TDR_MASK (0xFFFFFFFFU) -#define I2S_TDR_TDR_SHIFT (0U) -/*! TDR - Transmit Data */ -#define I2S_TDR_TDR(x) (((uint32_t)(((uint32_t)(x)) << I2S_TDR_TDR_SHIFT)) & I2S_TDR_TDR_MASK) -/*! @} */ - -/* The count of I2S_TDR */ -#define I2S_TDR_COUNT (2U) - -/*! @name TFR - Transmit FIFO */ -/*! @{ */ - -#define I2S_TFR_RFP_MASK (0xFU) -#define I2S_TFR_RFP_SHIFT (0U) -/*! RFP - Read FIFO Pointer */ -#define I2S_TFR_RFP(x) (((uint32_t)(((uint32_t)(x)) << I2S_TFR_RFP_SHIFT)) & I2S_TFR_RFP_MASK) - -#define I2S_TFR_WFP_MASK (0xF0000U) -#define I2S_TFR_WFP_SHIFT (16U) -/*! WFP - Write FIFO Pointer */ -#define I2S_TFR_WFP(x) (((uint32_t)(((uint32_t)(x)) << I2S_TFR_WFP_SHIFT)) & I2S_TFR_WFP_MASK) - -#define I2S_TFR_WCP_MASK (0x80000000U) -#define I2S_TFR_WCP_SHIFT (31U) -/*! WCP - Write Channel Pointer - * 0b0..No effect - * 0b1..Next FIFO to be written - */ -#define I2S_TFR_WCP(x) (((uint32_t)(((uint32_t)(x)) << I2S_TFR_WCP_SHIFT)) & I2S_TFR_WCP_MASK) -/*! @} */ - -/* The count of I2S_TFR */ -#define I2S_TFR_COUNT (2U) - -/*! @name TMR - Transmit Mask */ -/*! @{ */ - -#define I2S_TMR_TWM_MASK (0xFFFFFFFFU) -#define I2S_TMR_TWM_SHIFT (0U) -/*! TWM - Transmit Word Mask - * 0b00000000000000000000000000000000..Enable - * 0b00000000000000000000000000000001..Mask - */ -#define I2S_TMR_TWM(x) (((uint32_t)(((uint32_t)(x)) << I2S_TMR_TWM_SHIFT)) & I2S_TMR_TWM_MASK) -/*! @} */ - -/*! @name RCSR - Receive Control */ -/*! @{ */ - -#define I2S_RCSR_FRDE_MASK (0x1U) -#define I2S_RCSR_FRDE_SHIFT (0U) -/*! FRDE - FIFO Request DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCSR_FRDE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FRDE_SHIFT)) & I2S_RCSR_FRDE_MASK) - -#define I2S_RCSR_FWDE_MASK (0x2U) -#define I2S_RCSR_FWDE_SHIFT (1U) -/*! FWDE - FIFO Warning DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCSR_FWDE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FWDE_SHIFT)) & I2S_RCSR_FWDE_MASK) - -#define I2S_RCSR_FRIE_MASK (0x100U) -#define I2S_RCSR_FRIE_SHIFT (8U) -/*! FRIE - FIFO Request Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCSR_FRIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FRIE_SHIFT)) & I2S_RCSR_FRIE_MASK) - -#define I2S_RCSR_FWIE_MASK (0x200U) -#define I2S_RCSR_FWIE_SHIFT (9U) -/*! FWIE - FIFO Warning Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCSR_FWIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FWIE_SHIFT)) & I2S_RCSR_FWIE_MASK) - -#define I2S_RCSR_FEIE_MASK (0x400U) -#define I2S_RCSR_FEIE_SHIFT (10U) -/*! FEIE - FIFO Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCSR_FEIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FEIE_SHIFT)) & I2S_RCSR_FEIE_MASK) - -#define I2S_RCSR_SEIE_MASK (0x800U) -#define I2S_RCSR_SEIE_SHIFT (11U) -/*! SEIE - Sync Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCSR_SEIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_SEIE_SHIFT)) & I2S_RCSR_SEIE_MASK) - -#define I2S_RCSR_WSIE_MASK (0x1000U) -#define I2S_RCSR_WSIE_SHIFT (12U) -/*! WSIE - Word Start Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCSR_WSIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_WSIE_SHIFT)) & I2S_RCSR_WSIE_MASK) - -#define I2S_RCSR_FRF_MASK (0x10000U) -#define I2S_RCSR_FRF_SHIFT (16U) -/*! FRF - FIFO Request Flag - * 0b0..Watermark not reached - * 0b1..Watermark reached - */ -#define I2S_RCSR_FRF(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FRF_SHIFT)) & I2S_RCSR_FRF_MASK) - -#define I2S_RCSR_FWF_MASK (0x20000U) -#define I2S_RCSR_FWF_SHIFT (17U) -/*! FWF - FIFO Warning Flag - * 0b0..Not full - * 0b1..Full - */ -#define I2S_RCSR_FWF(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FWF_SHIFT)) & I2S_RCSR_FWF_MASK) - -#define I2S_RCSR_FEF_MASK (0x40000U) -#define I2S_RCSR_FEF_SHIFT (18U) -/*! FEF - FIFO Error Flag - * 0b0..No error - * 0b1..Receive overflow detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I2S_RCSR_FEF(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FEF_SHIFT)) & I2S_RCSR_FEF_MASK) - -#define I2S_RCSR_SEF_MASK (0x80000U) -#define I2S_RCSR_SEF_SHIFT (19U) -/*! SEF - Sync Error Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I2S_RCSR_SEF(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_SEF_SHIFT)) & I2S_RCSR_SEF_MASK) - -#define I2S_RCSR_WSF_MASK (0x100000U) -#define I2S_RCSR_WSF_SHIFT (20U) -/*! WSF - Word Start Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I2S_RCSR_WSF(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_WSF_SHIFT)) & I2S_RCSR_WSF_MASK) - -#define I2S_RCSR_SR_MASK (0x1000000U) -#define I2S_RCSR_SR_SHIFT (24U) -/*! SR - Software Reset - * 0b0..No effect - * 0b1..Software reset - */ -#define I2S_RCSR_SR(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_SR_SHIFT)) & I2S_RCSR_SR_MASK) - -#define I2S_RCSR_FR_MASK (0x2000000U) -#define I2S_RCSR_FR_SHIFT (25U) -/*! FR - FIFO Reset - * 0b0..No effect - * 0b1..Reset - */ -#define I2S_RCSR_FR(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FR_SHIFT)) & I2S_RCSR_FR_MASK) - -#define I2S_RCSR_BCE_MASK (0x10000000U) -#define I2S_RCSR_BCE_SHIFT (28U) -/*! BCE - Bit Clock Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCSR_BCE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_BCE_SHIFT)) & I2S_RCSR_BCE_MASK) - -#define I2S_RCSR_DBGE_MASK (0x20000000U) -#define I2S_RCSR_DBGE_SHIFT (29U) -/*! DBGE - Debug Enable - * 0b0..Disable after completing the current frame - * 0b1..Enable - */ -#define I2S_RCSR_DBGE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_DBGE_SHIFT)) & I2S_RCSR_DBGE_MASK) - -#define I2S_RCSR_STOPE_MASK (0x40000000U) -#define I2S_RCSR_STOPE_SHIFT (30U) -/*! STOPE - Stop Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCSR_STOPE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_STOPE_SHIFT)) & I2S_RCSR_STOPE_MASK) - -#define I2S_RCSR_RE_MASK (0x80000000U) -#define I2S_RCSR_RE_SHIFT (31U) -/*! RE - Receiver Enable - * 0b0..Disable - * 0b1..Enable (or receiver disabled and not yet reached end of frame) - */ -#define I2S_RCSR_RE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_RE_SHIFT)) & I2S_RCSR_RE_MASK) -/*! @} */ - -/*! @name RCR1 - Receive Configuration 1 */ -/*! @{ */ - -#define I2S_RCR1_RFW_MASK (0x7U) -#define I2S_RCR1_RFW_SHIFT (0U) -/*! RFW - Receive FIFO Watermark - * 0b000..1 - * 0b001..2 - * 0b010-0b110..(RFW value + 1) - * 0b111..8 - */ -#define I2S_RCR1_RFW(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR1_RFW_SHIFT)) & I2S_RCR1_RFW_MASK) -/*! @} */ - -/*! @name RCR2 - Receive Configuration 2 */ -/*! @{ */ - -#define I2S_RCR2_DIV_MASK (0xFFU) -#define I2S_RCR2_DIV_SHIFT (0U) -/*! DIV - Bit Clock Divide */ -#define I2S_RCR2_DIV(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_DIV_SHIFT)) & I2S_RCR2_DIV_MASK) - -#define I2S_RCR2_BYP_MASK (0x800000U) -#define I2S_RCR2_BYP_SHIFT (23U) -/*! BYP - Bit Clock Bypass - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCR2_BYP(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_BYP_SHIFT)) & I2S_RCR2_BYP_MASK) - -#define I2S_RCR2_BCD_MASK (0x1000000U) -#define I2S_RCR2_BCD_SHIFT (24U) -/*! BCD - Bit Clock Direction - * 0b0..Generated externally in Target mode - * 0b1..Generated internally in Controller mode - */ -#define I2S_RCR2_BCD(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_BCD_SHIFT)) & I2S_RCR2_BCD_MASK) - -#define I2S_RCR2_BCP_MASK (0x2000000U) -#define I2S_RCR2_BCP_SHIFT (25U) -/*! BCP - Bit Clock Polarity - * 0b0..Active high - * 0b1..Active low - */ -#define I2S_RCR2_BCP(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_BCP_SHIFT)) & I2S_RCR2_BCP_MASK) - -#define I2S_RCR2_MSEL_MASK (0xC000000U) -#define I2S_RCR2_MSEL_SHIFT (26U) -/*! MSEL - MCLK Select - * 0b00..Bus clock - * 0b01..Controller clock (MCLK) option 1 - * 0b10..Controller clock (MCLK) option 2 - * 0b11..Controller clock (MCLK) option 3 - */ -#define I2S_RCR2_MSEL(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_MSEL_SHIFT)) & I2S_RCR2_MSEL_MASK) - -#define I2S_RCR2_BCI_MASK (0x10000000U) -#define I2S_RCR2_BCI_SHIFT (28U) -/*! BCI - Bit Clock Input - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCR2_BCI(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_BCI_SHIFT)) & I2S_RCR2_BCI_MASK) - -#define I2S_RCR2_BCS_MASK (0x20000000U) -#define I2S_RCR2_BCS_SHIFT (29U) -/*! BCS - Bit Clock Swap - * 0b0..Use the normal bit clock source - * 0b1..Swap the bit clock source - */ -#define I2S_RCR2_BCS(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_BCS_SHIFT)) & I2S_RCR2_BCS_MASK) - -#define I2S_RCR2_SYNC_MASK (0xC0000000U) -#define I2S_RCR2_SYNC_SHIFT (30U) -/*! SYNC - Synchronous Mode - * 0b00..Asynchronous mode - * 0b01..Synchronous with transmitter - * 0b10..Synchronous with another SAI receiver - * 0b11..Synchronous with another SAI transmitter - */ -#define I2S_RCR2_SYNC(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_SYNC_SHIFT)) & I2S_RCR2_SYNC_MASK) -/*! @} */ - -/*! @name RCR3 - Receive Configuration 3 */ -/*! @{ */ - -#define I2S_RCR3_WDFL_MASK (0x1FU) -#define I2S_RCR3_WDFL_SHIFT (0U) -/*! WDFL - Word Flag Configuration - * 0b00000..Word 1 - * 0b00001..Word 2 - * 0b00010-0b11110..Word (WDFL value + 1) - * 0b11111..Word 32 - */ -#define I2S_RCR3_WDFL(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR3_WDFL_SHIFT)) & I2S_RCR3_WDFL_MASK) - -#define I2S_RCR3_RCE_MASK (0x30000U) -#define I2S_RCR3_RCE_SHIFT (16U) -/*! RCE - Receive Channel Enable */ -#define I2S_RCR3_RCE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR3_RCE_SHIFT)) & I2S_RCR3_RCE_MASK) - -#define I2S_RCR3_CFR_MASK (0x3000000U) -#define I2S_RCR3_CFR_SHIFT (24U) -/*! CFR - Channel FIFO Reset */ -#define I2S_RCR3_CFR(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR3_CFR_SHIFT)) & I2S_RCR3_CFR_MASK) -/*! @} */ - -/*! @name RCR4 - Receive Configuration 4 */ -/*! @{ */ - -#define I2S_RCR4_FSD_MASK (0x1U) -#define I2S_RCR4_FSD_SHIFT (0U) -/*! FSD - Frame Sync Direction - * 0b0..Generated externally in Target mode - * 0b1..Generated internally in Controller mode - */ -#define I2S_RCR4_FSD(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_FSD_SHIFT)) & I2S_RCR4_FSD_MASK) - -#define I2S_RCR4_FSP_MASK (0x2U) -#define I2S_RCR4_FSP_SHIFT (1U) -/*! FSP - Frame Sync Polarity - * 0b0..Active high - * 0b1..Active low - */ -#define I2S_RCR4_FSP(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_FSP_SHIFT)) & I2S_RCR4_FSP_MASK) - -#define I2S_RCR4_ONDEM_MASK (0x4U) -#define I2S_RCR4_ONDEM_SHIFT (2U) -/*! ONDEM - On-Demand Mode - * 0b0..Generated continuously - * 0b1..Generated when the FIFO warning flag is 0 - */ -#define I2S_RCR4_ONDEM(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_ONDEM_SHIFT)) & I2S_RCR4_ONDEM_MASK) - -#define I2S_RCR4_FSE_MASK (0x8U) -#define I2S_RCR4_FSE_SHIFT (3U) -/*! FSE - Frame Sync Early - * 0b0..First bit of the frame - * 0b1..One bit before the first bit of the frame - */ -#define I2S_RCR4_FSE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_FSE_SHIFT)) & I2S_RCR4_FSE_MASK) - -#define I2S_RCR4_MF_MASK (0x10U) -#define I2S_RCR4_MF_SHIFT (4U) -/*! MF - MSB First - * 0b0..LSB - * 0b1..MSB - */ -#define I2S_RCR4_MF(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_MF_SHIFT)) & I2S_RCR4_MF_MASK) - -#define I2S_RCR4_SYWD_MASK (0x1F00U) -#define I2S_RCR4_SYWD_SHIFT (8U) -/*! SYWD - Sync Width - * 0b00000..1 - * 0b00001..2 - * 0b00010-0b11110..(SYWD value + 1) - * 0b11111..32 - */ -#define I2S_RCR4_SYWD(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_SYWD_SHIFT)) & I2S_RCR4_SYWD_MASK) - -#define I2S_RCR4_FRSZ_MASK (0x1F0000U) -#define I2S_RCR4_FRSZ_SHIFT (16U) -/*! FRSZ - Frame Size - * 0b00000..1 - * 0b00001..2 - * 0b00010-0b11110..(FRSZ value + 1) - * 0b11111..32 - */ -#define I2S_RCR4_FRSZ(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_FRSZ_SHIFT)) & I2S_RCR4_FRSZ_MASK) - -#define I2S_RCR4_FPACK_MASK (0x3000000U) -#define I2S_RCR4_FPACK_SHIFT (24U) -/*! FPACK - FIFO Packing Mode - * 0b00..Disable - * 0b01..Reserved - * 0b10..Enable 8-bit FIFO packing - * 0b11..Enable 16-bit FIFO packing - */ -#define I2S_RCR4_FPACK(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_FPACK_SHIFT)) & I2S_RCR4_FPACK_MASK) - -#define I2S_RCR4_FCOMB_MASK (0xC000000U) -#define I2S_RCR4_FCOMB_SHIFT (26U) -/*! FCOMB - FIFO Combine Mode - * 0b00..Disable - * 0b01..Enable on FIFO writes (from receive shift registers) - * 0b10..Enable on FIFO reads (by software) - * 0b11..Enable on FIFO writes (from receive shift registers) and reads (by software) - */ -#define I2S_RCR4_FCOMB(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_FCOMB_SHIFT)) & I2S_RCR4_FCOMB_MASK) - -#define I2S_RCR4_FCONT_MASK (0x10000000U) -#define I2S_RCR4_FCONT_SHIFT (28U) -/*! FCONT - FIFO Continue on Error - * 0b0..From the start of the next frame after the FIFO error flag is cleared - * 0b1..From the same word that caused the FIFO error to become 1 after the FIFO warning flag is cleared - */ -#define I2S_RCR4_FCONT(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_FCONT_SHIFT)) & I2S_RCR4_FCONT_MASK) -/*! @} */ - -/*! @name RCR5 - Receive Configuration 5 */ -/*! @{ */ - -#define I2S_RCR5_FBT_MASK (0x1F00U) -#define I2S_RCR5_FBT_SHIFT (8U) -/*! FBT - First Bit Shifted - * 0b00000..0 - * 0b00001-0b11110..FBT value - * 0b11111..31 - */ -#define I2S_RCR5_FBT(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR5_FBT_SHIFT)) & I2S_RCR5_FBT_MASK) - -#define I2S_RCR5_W0W_MASK (0x1F0000U) -#define I2S_RCR5_W0W_SHIFT (16U) -/*! W0W - Word 0 Width - * 0b00000..1 - * 0b00001..2 - * 0b00010-0b11110..(W0W value + 1) - * 0b11111..32 - */ -#define I2S_RCR5_W0W(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR5_W0W_SHIFT)) & I2S_RCR5_W0W_MASK) - -#define I2S_RCR5_WNW_MASK (0x1F000000U) -#define I2S_RCR5_WNW_SHIFT (24U) -/*! WNW - Word N Width - * 0b00111..8 - * 0b01000..9 - * 0b01001-0b11110..(WNW value + 1) - * 0b11111..32 - */ -#define I2S_RCR5_WNW(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR5_WNW_SHIFT)) & I2S_RCR5_WNW_MASK) -/*! @} */ - -/*! @name RDR - Receive Data */ -/*! @{ */ - -#define I2S_RDR_RDR_MASK (0xFFFFFFFFU) -#define I2S_RDR_RDR_SHIFT (0U) -/*! RDR - Receive Data */ -#define I2S_RDR_RDR(x) (((uint32_t)(((uint32_t)(x)) << I2S_RDR_RDR_SHIFT)) & I2S_RDR_RDR_MASK) -/*! @} */ - -/* The count of I2S_RDR */ -#define I2S_RDR_COUNT (2U) - -/*! @name RFR - Receive FIFO */ -/*! @{ */ - -#define I2S_RFR_RFP_MASK (0xFU) -#define I2S_RFR_RFP_SHIFT (0U) -/*! RFP - Read FIFO Pointer */ -#define I2S_RFR_RFP(x) (((uint32_t)(((uint32_t)(x)) << I2S_RFR_RFP_SHIFT)) & I2S_RFR_RFP_MASK) - -#define I2S_RFR_RCP_MASK (0x8000U) -#define I2S_RFR_RCP_SHIFT (15U) -/*! RCP - Read Channel Pointer - * 0b0..No effect - * 0b1..Next FIFO to be read - */ -#define I2S_RFR_RCP(x) (((uint32_t)(((uint32_t)(x)) << I2S_RFR_RCP_SHIFT)) & I2S_RFR_RCP_MASK) - -#define I2S_RFR_WFP_MASK (0xF0000U) -#define I2S_RFR_WFP_SHIFT (16U) -/*! WFP - Write FIFO Pointer */ -#define I2S_RFR_WFP(x) (((uint32_t)(((uint32_t)(x)) << I2S_RFR_WFP_SHIFT)) & I2S_RFR_WFP_MASK) -/*! @} */ - -/* The count of I2S_RFR */ -#define I2S_RFR_COUNT (2U) - -/*! @name RMR - Receive Mask */ -/*! @{ */ - -#define I2S_RMR_RWM_MASK (0xFFFFFFFFU) -#define I2S_RMR_RWM_SHIFT (0U) -/*! RWM - Receive Word Mask - * 0b00000000000000000000000000000000..Enable - * 0b00000000000000000000000000000001..Mask - */ -#define I2S_RMR_RWM(x) (((uint32_t)(((uint32_t)(x)) << I2S_RMR_RWM_SHIFT)) & I2S_RMR_RWM_MASK) -/*! @} */ - -/*! @name MCR - MCLK Control */ -/*! @{ */ - -#define I2S_MCR_DIV_MASK (0xFFU) -#define I2S_MCR_DIV_SHIFT (0U) -/*! DIV - MCLK Post Divide */ -#define I2S_MCR_DIV(x) (((uint32_t)(((uint32_t)(x)) << I2S_MCR_DIV_SHIFT)) & I2S_MCR_DIV_MASK) - -#define I2S_MCR_DIVEN_MASK (0x800000U) -#define I2S_MCR_DIVEN_SHIFT (23U) -/*! DIVEN - MCLK Post Divide Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_MCR_DIVEN(x) (((uint32_t)(((uint32_t)(x)) << I2S_MCR_DIVEN_SHIFT)) & I2S_MCR_DIVEN_MASK) - -#define I2S_MCR_MSEL_MASK (0x3000000U) -#define I2S_MCR_MSEL_SHIFT (24U) -/*! MSEL - MCLK Select - * 0b00..Controller clock (MCLK) option 1 - * 0b01..Reserved - * 0b10..Controller clock (MCLK) option 2 - * 0b11..Controller clock (MCLK) option 3 - */ -#define I2S_MCR_MSEL(x) (((uint32_t)(((uint32_t)(x)) << I2S_MCR_MSEL_SHIFT)) & I2S_MCR_MSEL_MASK) - -#define I2S_MCR_MOE_MASK (0x40000000U) -#define I2S_MCR_MOE_SHIFT (30U) -/*! MOE - MCLK Output Enable - * 0b0..Input - * 0b1..Output - */ -#define I2S_MCR_MOE(x) (((uint32_t)(((uint32_t)(x)) << I2S_MCR_MOE_SHIFT)) & I2S_MCR_MOE_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group I2S_Register_Masks */ - - -/* I2S - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral SAI0 base address */ - #define SAI0_BASE (0x50106000u) - /** Peripheral SAI0 base address */ - #define SAI0_BASE_NS (0x40106000u) - /** Peripheral SAI0 base pointer */ - #define SAI0 ((I2S_Type *)SAI0_BASE) - /** Peripheral SAI0 base pointer */ - #define SAI0_NS ((I2S_Type *)SAI0_BASE_NS) - /** Peripheral SAI1 base address */ - #define SAI1_BASE (0x50107000u) - /** Peripheral SAI1 base address */ - #define SAI1_BASE_NS (0x40107000u) - /** Peripheral SAI1 base pointer */ - #define SAI1 ((I2S_Type *)SAI1_BASE) - /** Peripheral SAI1 base pointer */ - #define SAI1_NS ((I2S_Type *)SAI1_BASE_NS) - /** Array initializer of I2S peripheral base addresses */ - #define I2S_BASE_ADDRS { SAI0_BASE, SAI1_BASE } - /** Array initializer of I2S peripheral base pointers */ - #define I2S_BASE_PTRS { SAI0, SAI1 } - /** Array initializer of I2S peripheral base addresses */ - #define I2S_BASE_ADDRS_NS { SAI0_BASE_NS, SAI1_BASE_NS } - /** Array initializer of I2S peripheral base pointers */ - #define I2S_BASE_PTRS_NS { SAI0_NS, SAI1_NS } -#else - /** Peripheral SAI0 base address */ - #define SAI0_BASE (0x40106000u) - /** Peripheral SAI0 base pointer */ - #define SAI0 ((I2S_Type *)SAI0_BASE) - /** Peripheral SAI1 base address */ - #define SAI1_BASE (0x40107000u) - /** Peripheral SAI1 base pointer */ - #define SAI1 ((I2S_Type *)SAI1_BASE) - /** Array initializer of I2S peripheral base addresses */ - #define I2S_BASE_ADDRS { SAI0_BASE, SAI1_BASE } - /** Array initializer of I2S peripheral base pointers */ - #define I2S_BASE_PTRS { SAI0, SAI1 } -#endif -/** Interrupt vectors for the I2S peripheral type */ -#define I2S_RX_IRQS { SAI0_IRQn, SAI1_IRQn } -#define I2S_TX_IRQS { SAI0_IRQn, SAI1_IRQn } - -/*! - * @} - */ /* end of group I2S_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- I3C Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup I3C_Peripheral_Access_Layer I3C Peripheral Access Layer - * @{ - */ - -/** I3C - Register Layout Typedef */ -typedef struct { - __IO uint32_t MCONFIG; /**< Controller Configuration, offset: 0x0 */ - __IO uint32_t SCONFIG; /**< Target Configuration, offset: 0x4 */ - __IO uint32_t SSTATUS; /**< Target Status, offset: 0x8 */ - __IO uint32_t SCTRL; /**< Target Control, offset: 0xC */ - __IO uint32_t SINTSET; /**< Target Interrupt Set, offset: 0x10 */ - __IO uint32_t SINTCLR; /**< Target Interrupt Clear, offset: 0x14 */ - __I uint32_t SINTMASKED; /**< Target Interrupt Mask, offset: 0x18 */ - __IO uint32_t SERRWARN; /**< Target Errors and Warnings, offset: 0x1C */ - __IO uint32_t SDMACTRL; /**< Target DMA Control, offset: 0x20 */ - uint8_t RESERVED_0[8]; - __IO uint32_t SDATACTRL; /**< Target Data Control, offset: 0x2C */ - __O uint32_t SWDATAB; /**< Target Write Data Byte, offset: 0x30 */ - __O uint32_t SWDATABE; /**< Target Write Data Byte End, offset: 0x34 */ - __O uint32_t SWDATAH; /**< Target Write Data Halfword, offset: 0x38 */ - __O uint32_t SWDATAHE; /**< Target Write Data Halfword End, offset: 0x3C */ - __I uint32_t SRDATAB; /**< Target Read Data Byte, offset: 0x40 */ - uint8_t RESERVED_1[4]; - __I uint32_t SRDATAH; /**< Target Read Data Halfword, offset: 0x48 */ - uint8_t RESERVED_2[8]; - union { /* offset: 0x54 */ - __O uint32_t SWDATAB1; /**< Target Write Data Byte, offset: 0x54 */ - __O uint32_t SWDATAH1; /**< Target Write Data Halfword, offset: 0x54 */ - }; - uint8_t RESERVED_3[4]; - __I uint32_t SCAPABILITIES2; /**< Target Capabilities 2, offset: 0x5C */ - __I uint32_t SCAPABILITIES; /**< Target Capabilities, offset: 0x60 */ - __IO uint32_t SDYNADDR; /**< Target Dynamic Address, offset: 0x64 */ - __IO uint32_t SMAXLIMITS; /**< Target Maximum Limits, offset: 0x68 */ - __IO uint32_t SIDPARTNO; /**< Target ID Part Number, offset: 0x6C */ - __IO uint32_t SIDEXT; /**< Target ID Extension, offset: 0x70 */ - __IO uint32_t SVENDORID; /**< Target Vendor ID, offset: 0x74 */ - __IO uint32_t STCCLOCK; /**< Target Time Control Clock, offset: 0x78 */ - __I uint32_t SMSGMAPADDR; /**< Target Message Map Address, offset: 0x7C */ - __IO uint32_t MCONFIG_EXT; /**< Controller Extended Configuration, offset: 0x80 */ - __IO uint32_t MCTRL; /**< Controller Control, offset: 0x84 */ - __IO uint32_t MSTATUS; /**< Controller Status, offset: 0x88 */ - __IO uint32_t MIBIRULES; /**< Controller In-band Interrupt Registry and Rules, offset: 0x8C */ - __IO uint32_t MINTSET; /**< Controller Interrupt Set, offset: 0x90 */ - __IO uint32_t MINTCLR; /**< Controller Interrupt Clear, offset: 0x94 */ - __I uint32_t MINTMASKED; /**< Controller Interrupt Mask, offset: 0x98 */ - __IO uint32_t MERRWARN; /**< Controller Errors and Warnings, offset: 0x9C */ - __IO uint32_t MDMACTRL; /**< Controller DMA Control, offset: 0xA0 */ - uint8_t RESERVED_4[8]; - __IO uint32_t MDATACTRL; /**< Controller Data Control, offset: 0xAC */ - __O uint32_t MWDATAB; /**< Controller Write Data Byte, offset: 0xB0 */ - __O uint32_t MWDATABE; /**< Controller Write Data Byte End, offset: 0xB4 */ - __O uint32_t MWDATAH; /**< Controller Write Data Halfword, offset: 0xB8 */ - __O uint32_t MWDATAHE; /**< Controller Write Data Halfword End, offset: 0xBC */ - __I uint32_t MRDATAB; /**< Controller Read Data Byte, offset: 0xC0 */ - uint8_t RESERVED_5[4]; - __I uint32_t MRDATAH; /**< Controller Read Data Halfword, offset: 0xC8 */ - union { /* offset: 0xCC */ - __O uint32_t MWDATAB1; /**< Controller Write Byte Data 1 (to Bus), offset: 0xCC */ - __O uint32_t MWDATAH1; /**< Controller Write Halfword Data (to Bus), offset: 0xCC */ - }; - union { /* offset: 0xD0 */ - __O uint32_t MWMSG_SDR_CONTROL; /**< Controller Write Message Control in SDR mode, offset: 0xD0 */ - __O uint32_t MWMSG_SDR_DATA; /**< Controller Write Message Data in SDR mode, offset: 0xD0 */ - }; - __I uint32_t MRMSG_SDR; /**< Controller Read Message in SDR mode, offset: 0xD4 */ - union { /* offset: 0xD8 */ - __O uint32_t MWMSG_DDR_CONTROL; /**< Controller Write Message in DDR mode: First Control Word, offset: 0xD8 */ - __O uint32_t MWMSG_DDR_CONTROL2; /**< Controller Write Message in DDR Mode Control 2, offset: 0xD8 */ - __O uint32_t MWMSG_DDR_DATA; /**< Controller Write Message Data in DDR mode, offset: 0xD8 */ - }; - __I uint32_t MRMSG_DDR; /**< Controller Read Message in DDR mode, offset: 0xDC */ - uint8_t RESERVED_6[4]; - __IO uint32_t MDYNADDR; /**< Controller Dynamic Address, offset: 0xE4 */ - uint8_t RESERVED_7[52]; - __I uint32_t SMAPCTRL0; /**< Map Feature Control 0, offset: 0x11C */ - uint8_t RESERVED_8[32]; - __IO uint32_t IBIEXT1; /**< Extended IBI Data 1, offset: 0x140 */ - __IO uint32_t IBIEXT2; /**< Extended IBI Data 2, offset: 0x144 */ - uint8_t RESERVED_9[3764]; - __I uint32_t SID; /**< Target Module ID, offset: 0xFFC */ -} I3C_Type; - -/* ---------------------------------------------------------------------------- - -- I3C Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup I3C_Register_Masks I3C Register Masks - * @{ - */ - -/*! @name MCONFIG - Controller Configuration */ -/*! @{ */ - -#define I3C_MCONFIG_MSTENA_MASK (0x3U) -#define I3C_MCONFIG_MSTENA_SHIFT (0U) -/*! MSTENA - Controller Enable - * 0b00..CONTROLLER_OFF - * 0b01..CONTROLLER_ON - * 0b10..CONTROLLER_CAPABLE - * 0b11..I2C_CONTROLLER_MODE - */ -#define I3C_MCONFIG_MSTENA(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_MSTENA_SHIFT)) & I3C_MCONFIG_MSTENA_MASK) - -#define I3C_MCONFIG_DISTO_MASK (0x8U) -#define I3C_MCONFIG_DISTO_SHIFT (3U) -/*! DISTO - Disable Timeout - * 0b1..Disabled, if configured - * 0b0..Enabled - */ -#define I3C_MCONFIG_DISTO(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_DISTO_SHIFT)) & I3C_MCONFIG_DISTO_MASK) - -#define I3C_MCONFIG_HKEEP_MASK (0x30U) -#define I3C_MCONFIG_HKEEP_SHIFT (4U) -/*! HKEEP - High-Keeper - * 0b00..None - * 0b01..WIRED_IN - * 0b10..PASSIVE_SDA - * 0b11..PASSIVE_ON_SDA_SCL - */ -#define I3C_MCONFIG_HKEEP(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_HKEEP_SHIFT)) & I3C_MCONFIG_HKEEP_MASK) - -#define I3C_MCONFIG_ODSTOP_MASK (0x40U) -#define I3C_MCONFIG_ODSTOP_SHIFT (6U) -/*! ODSTOP - Open Drain Stop - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MCONFIG_ODSTOP(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_ODSTOP_SHIFT)) & I3C_MCONFIG_ODSTOP_MASK) - -#define I3C_MCONFIG_PPBAUD_MASK (0xF00U) -#define I3C_MCONFIG_PPBAUD_SHIFT (8U) -/*! PPBAUD - Push-Pull Baud Rate */ -#define I3C_MCONFIG_PPBAUD(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_PPBAUD_SHIFT)) & I3C_MCONFIG_PPBAUD_MASK) - -#define I3C_MCONFIG_PPLOW_MASK (0xF000U) -#define I3C_MCONFIG_PPLOW_SHIFT (12U) -/*! PPLOW - Push-Pull Low */ -#define I3C_MCONFIG_PPLOW(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_PPLOW_SHIFT)) & I3C_MCONFIG_PPLOW_MASK) - -#define I3C_MCONFIG_ODBAUD_MASK (0xFF0000U) -#define I3C_MCONFIG_ODBAUD_SHIFT (16U) -/*! ODBAUD - Open Drain Baud Rate */ -#define I3C_MCONFIG_ODBAUD(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_ODBAUD_SHIFT)) & I3C_MCONFIG_ODBAUD_MASK) - -#define I3C_MCONFIG_ODHPP_MASK (0x1000000U) -#define I3C_MCONFIG_ODHPP_SHIFT (24U) -/*! ODHPP - Open Drain High Push-Pull - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MCONFIG_ODHPP(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_ODHPP_SHIFT)) & I3C_MCONFIG_ODHPP_MASK) - -#define I3C_MCONFIG_SKEW_MASK (0xE000000U) -#define I3C_MCONFIG_SKEW_SHIFT (25U) -/*! SKEW - Skew */ -#define I3C_MCONFIG_SKEW(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_SKEW_SHIFT)) & I3C_MCONFIG_SKEW_MASK) - -#define I3C_MCONFIG_I2CBAUD_MASK (0xF0000000U) -#define I3C_MCONFIG_I2CBAUD_SHIFT (28U) -/*! I2CBAUD - I2C Baud Rate */ -#define I3C_MCONFIG_I2CBAUD(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_I2CBAUD_SHIFT)) & I3C_MCONFIG_I2CBAUD_MASK) -/*! @} */ - -/*! @name SCONFIG - Target Configuration */ -/*! @{ */ - -#define I3C_SCONFIG_SLVENA_MASK (0x1U) -#define I3C_SCONFIG_SLVENA_SHIFT (0U) -/*! SLVENA - Target Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SCONFIG_SLVENA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_SLVENA_SHIFT)) & I3C_SCONFIG_SLVENA_MASK) - -#define I3C_SCONFIG_NACK_MASK (0x2U) -#define I3C_SCONFIG_NACK_SHIFT (1U) -/*! NACK - Not Acknowledge - * 0b1..Always enable NACK mode (works normally) - * 0b0..Always disable NACK mode - */ -#define I3C_SCONFIG_NACK(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_NACK_SHIFT)) & I3C_SCONFIG_NACK_MASK) - -#define I3C_SCONFIG_MATCHSS_MASK (0x4U) -#define I3C_SCONFIG_MATCHSS_SHIFT (2U) -/*! MATCHSS - Match Start or Stop - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SCONFIG_MATCHSS(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_MATCHSS_SHIFT)) & I3C_SCONFIG_MATCHSS_MASK) - -#define I3C_SCONFIG_S0IGNORE_MASK (0x8U) -#define I3C_SCONFIG_S0IGNORE_SHIFT (3U) -/*! S0IGNORE - Ignore TE0 or TE1 Errors - * 0b1..Ignore TE0 or TE1 errors - * 0b0..Do not ignore TE0 or TE1 errors - */ -#define I3C_SCONFIG_S0IGNORE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_S0IGNORE_SHIFT)) & I3C_SCONFIG_S0IGNORE_MASK) - -#define I3C_SCONFIG_HDROK_MASK (0x10U) -#define I3C_SCONFIG_HDROK_SHIFT (4U) -/*! HDROK - HDR OK - * 0b1..Enable HDR OK - * 0b0..Disable HDR OK - */ -#define I3C_SCONFIG_HDROK(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_HDROK_SHIFT)) & I3C_SCONFIG_HDROK_MASK) - -#define I3C_SCONFIG_OFFLINE_MASK (0x200U) -#define I3C_SCONFIG_OFFLINE_SHIFT (9U) -/*! OFFLINE - Offline - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SCONFIG_OFFLINE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_OFFLINE_SHIFT)) & I3C_SCONFIG_OFFLINE_MASK) - -#define I3C_SCONFIG_BAMATCH_MASK (0xFF0000U) -#define I3C_SCONFIG_BAMATCH_SHIFT (16U) -/*! BAMATCH - Bus Available Match */ -#define I3C_SCONFIG_BAMATCH(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_BAMATCH_SHIFT)) & I3C_SCONFIG_BAMATCH_MASK) - -#define I3C_SCONFIG_SADDR_MASK (0xFE000000U) -#define I3C_SCONFIG_SADDR_SHIFT (25U) -/*! SADDR - Static Address */ -#define I3C_SCONFIG_SADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_SADDR_SHIFT)) & I3C_SCONFIG_SADDR_MASK) -/*! @} */ - -/*! @name SSTATUS - Target Status */ -/*! @{ */ - -#define I3C_SSTATUS_STNOTSTOP_MASK (0x1U) -#define I3C_SSTATUS_STNOTSTOP_SHIFT (0U) -/*! STNOTSTOP - Status not Stop - * 0b1..Busy - * 0b0..In STOP condition - */ -#define I3C_SSTATUS_STNOTSTOP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STNOTSTOP_SHIFT)) & I3C_SSTATUS_STNOTSTOP_MASK) - -#define I3C_SSTATUS_STMSG_MASK (0x2U) -#define I3C_SSTATUS_STMSG_SHIFT (1U) -/*! STMSG - Status Message - * 0b1..Busy - * 0b0..Idle - */ -#define I3C_SSTATUS_STMSG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STMSG_SHIFT)) & I3C_SSTATUS_STMSG_MASK) - -#define I3C_SSTATUS_STCCCH_MASK (0x4U) -#define I3C_SSTATUS_STCCCH_SHIFT (2U) -/*! STCCCH - Status Common Command Code Handler - * 0b1..Handled automatically - * 0b0..No CCC message handled - */ -#define I3C_SSTATUS_STCCCH(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STCCCH_SHIFT)) & I3C_SSTATUS_STCCCH_MASK) - -#define I3C_SSTATUS_STREQRD_MASK (0x8U) -#define I3C_SSTATUS_STREQRD_SHIFT (3U) -/*! STREQRD - Status Request Read - * 0b1..SDR read from this target or an IBI is being pushed out - * 0b0..Not an SDR read - */ -#define I3C_SSTATUS_STREQRD(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STREQRD_SHIFT)) & I3C_SSTATUS_STREQRD_MASK) - -#define I3C_SSTATUS_STREQWR_MASK (0x10U) -#define I3C_SSTATUS_STREQWR_SHIFT (4U) -/*! STREQWR - Status Request Write - * 0b1..SDR write data from the controller, but not in ENTDAA mode - * 0b0..Not an SDR write - */ -#define I3C_SSTATUS_STREQWR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STREQWR_SHIFT)) & I3C_SSTATUS_STREQWR_MASK) - -#define I3C_SSTATUS_STDAA_MASK (0x20U) -#define I3C_SSTATUS_STDAA_SHIFT (5U) -/*! STDAA - Status Dynamic Address Assignment - * 0b1..In ENTDAA mode - * 0b0..Not in ENTDAA mode - */ -#define I3C_SSTATUS_STDAA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STDAA_SHIFT)) & I3C_SSTATUS_STDAA_MASK) - -#define I3C_SSTATUS_STHDR_MASK (0x40U) -#define I3C_SSTATUS_STHDR_SHIFT (6U) -/*! STHDR - Status High Data Rate - * 0b1..I3C bus in HDR-DDR mode - * 0b0..I3C bus not in HDR-DDR mode - */ -#define I3C_SSTATUS_STHDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STHDR_SHIFT)) & I3C_SSTATUS_STHDR_MASK) - -#define I3C_SSTATUS_START_MASK (0x100U) -#define I3C_SSTATUS_START_SHIFT (8U) -/*! START - Start - * 0b1..Detected - * 0b0..Not detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_START(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_START_SHIFT)) & I3C_SSTATUS_START_MASK) - -#define I3C_SSTATUS_MATCHED_MASK (0x200U) -#define I3C_SSTATUS_MATCHED_SHIFT (9U) -/*! MATCHED - Matched - * 0b1..Header matched - * 0b0..Header not matched - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_MATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_MATCHED_SHIFT)) & I3C_SSTATUS_MATCHED_MASK) - -#define I3C_SSTATUS_STOP_MASK (0x400U) -#define I3C_SSTATUS_STOP_SHIFT (10U) -/*! STOP - Stop - * 0b1..Stopped state detected - * 0b0..No Stopped state detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_STOP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STOP_SHIFT)) & I3C_SSTATUS_STOP_MASK) - -#define I3C_SSTATUS_RX_PEND_MASK (0x800U) -#define I3C_SSTATUS_RX_PEND_SHIFT (11U) -/*! RX_PEND - Received Message Pending - * 0b1..Received message pending - * 0b0..No received message pending - */ -#define I3C_SSTATUS_RX_PEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_RX_PEND_SHIFT)) & I3C_SSTATUS_RX_PEND_MASK) - -#define I3C_SSTATUS_TXNOTFULL_MASK (0x1000U) -#define I3C_SSTATUS_TXNOTFULL_SHIFT (12U) -/*! TXNOTFULL - Transmit Buffer Not Full - * 0b1..Transmit buffer not full - * 0b0..Transmit buffer full - */ -#define I3C_SSTATUS_TXNOTFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_TXNOTFULL_SHIFT)) & I3C_SSTATUS_TXNOTFULL_MASK) - -#define I3C_SSTATUS_DACHG_MASK (0x2000U) -#define I3C_SSTATUS_DACHG_SHIFT (13U) -/*! DACHG - Dynamic Address Change - * 0b1..DA change detected - * 0b0..No DA change detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_DACHG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_DACHG_SHIFT)) & I3C_SSTATUS_DACHG_MASK) - -#define I3C_SSTATUS_CCC_MASK (0x4000U) -#define I3C_SSTATUS_CCC_SHIFT (14U) -/*! CCC - Common Command Code - * 0b1..CCC received - * 0b0..CCC not received - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_CCC(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_CCC_SHIFT)) & I3C_SSTATUS_CCC_MASK) - -#define I3C_SSTATUS_ERRWARN_MASK (0x8000U) -#define I3C_SSTATUS_ERRWARN_SHIFT (15U) -/*! ERRWARN - Error Warning */ -#define I3C_SSTATUS_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_ERRWARN_SHIFT)) & I3C_SSTATUS_ERRWARN_MASK) - -#define I3C_SSTATUS_HDRMATCH_MASK (0x10000U) -#define I3C_SSTATUS_HDRMATCH_SHIFT (16U) -/*! HDRMATCH - High Data Rate Command Match - * 0b1..Matched the I3C dynamic address - * 0b0..Did not match - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_HDRMATCH(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_HDRMATCH_SHIFT)) & I3C_SSTATUS_HDRMATCH_MASK) - -#define I3C_SSTATUS_CHANDLED_MASK (0x20000U) -#define I3C_SSTATUS_CHANDLED_SHIFT (17U) -/*! CHANDLED - Common Command Code Handled - * 0b1..CCC handling in progress - * 0b0..CCC handling not in progress - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_CHANDLED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_CHANDLED_SHIFT)) & I3C_SSTATUS_CHANDLED_MASK) - -#define I3C_SSTATUS_EVENT_MASK (0x40000U) -#define I3C_SSTATUS_EVENT_SHIFT (18U) -/*! EVENT - Event - * 0b1..IBI, CR, or HJ occurred - * 0b0..No event occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_EVENT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_EVENT_SHIFT)) & I3C_SSTATUS_EVENT_MASK) - -#define I3C_SSTATUS_EVDET_MASK (0x300000U) -#define I3C_SSTATUS_EVDET_SHIFT (20U) -/*! EVDET - Event Details - * 0b00..NONE (no event or no pending event) - * 0b01..NO_REQUEST (request is not sent yet; either there is no START condition yet, or is waiting for Bus-Available or Bus-Idle (HJ)) - * 0b10..NACKed (not acknowledged, request sent and rejected); I3C tries again - * 0b11..ACKed (acknowledged; request sent and accepted), so done (unless the time control data is still being sent) - */ -#define I3C_SSTATUS_EVDET(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_EVDET_SHIFT)) & I3C_SSTATUS_EVDET_MASK) - -#define I3C_SSTATUS_IBIDIS_MASK (0x1000000U) -#define I3C_SSTATUS_IBIDIS_SHIFT (24U) -/*! IBIDIS - In-Band Interrupts Disable - * 0b1..Disabled - * 0b0..Enabled - */ -#define I3C_SSTATUS_IBIDIS(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_IBIDIS_SHIFT)) & I3C_SSTATUS_IBIDIS_MASK) - -#define I3C_SSTATUS_MRDIS_MASK (0x2000000U) -#define I3C_SSTATUS_MRDIS_SHIFT (25U) -/*! MRDIS - Controller Requests Disable - * 0b1..Disabled - * 0b0..Enabled - */ -#define I3C_SSTATUS_MRDIS(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_MRDIS_SHIFT)) & I3C_SSTATUS_MRDIS_MASK) - -#define I3C_SSTATUS_HJDIS_MASK (0x8000000U) -#define I3C_SSTATUS_HJDIS_SHIFT (27U) -/*! HJDIS - Hot-Join Disabled - * 0b1..Disabled - * 0b0..Enabled - */ -#define I3C_SSTATUS_HJDIS(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_HJDIS_SHIFT)) & I3C_SSTATUS_HJDIS_MASK) - -#define I3C_SSTATUS_ACTSTATE_MASK (0x30000000U) -#define I3C_SSTATUS_ACTSTATE_SHIFT (28U) -/*! ACTSTATE - Activity State from Common Command Codes (CCC) - * 0b00..NO_LATENCY (normal bus operations) - * 0b01..LATENCY_1MS (1 ms of latency) - * 0b10..LATENCY_100MS (100 ms of latency) - * 0b11..LATENCY_10S (10 seconds of latency) - */ -#define I3C_SSTATUS_ACTSTATE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_ACTSTATE_SHIFT)) & I3C_SSTATUS_ACTSTATE_MASK) - -#define I3C_SSTATUS_TIMECTRL_MASK (0xC0000000U) -#define I3C_SSTATUS_TIMECTRL_SHIFT (30U) -/*! TIMECTRL - Time Control - * 0b00..NO_TIME_CONTROL (no time control is enabled) - * 0b01..SYNC_MODE (Synchronous mode is enabled) - * 0b10..ASYNC_MODE (Asynchronous standard mode (0 or 1) is enabled) - * 0b11..BOTHSYNCASYNC (both Synchronous and Asynchronous modes are enabled) - */ -#define I3C_SSTATUS_TIMECTRL(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_TIMECTRL_SHIFT)) & I3C_SSTATUS_TIMECTRL_MASK) -/*! @} */ - -/*! @name SCTRL - Target Control */ -/*! @{ */ - -#define I3C_SCTRL_EVENT_MASK (0x3U) -#define I3C_SCTRL_EVENT_SHIFT (0U) -/*! EVENT - Event - * 0b00..NORMAL_MODE - * 0b01..IBI - * 0b10..CONTROLLER_REQUEST - * 0b11..HOT_JOIN_REQUEST - */ -#define I3C_SCTRL_EVENT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCTRL_EVENT_SHIFT)) & I3C_SCTRL_EVENT_MASK) - -#define I3C_SCTRL_EXTDATA_MASK (0x8U) -#define I3C_SCTRL_EXTDATA_SHIFT (3U) -/*! EXTDATA - Extended Data - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SCTRL_EXTDATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCTRL_EXTDATA_SHIFT)) & I3C_SCTRL_EXTDATA_MASK) - -#define I3C_SCTRL_IBIDATA_MASK (0xFF00U) -#define I3C_SCTRL_IBIDATA_SHIFT (8U) -/*! IBIDATA - In-Band Interrupt Data */ -#define I3C_SCTRL_IBIDATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCTRL_IBIDATA_SHIFT)) & I3C_SCTRL_IBIDATA_MASK) - -#define I3C_SCTRL_PENDINT_MASK (0xF0000U) -#define I3C_SCTRL_PENDINT_SHIFT (16U) -/*! PENDINT - Pending Interrupt */ -#define I3C_SCTRL_PENDINT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCTRL_PENDINT_SHIFT)) & I3C_SCTRL_PENDINT_MASK) - -#define I3C_SCTRL_ACTSTATE_MASK (0x300000U) -#define I3C_SCTRL_ACTSTATE_SHIFT (20U) -/*! ACTSTATE - Activity State of Target */ -#define I3C_SCTRL_ACTSTATE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCTRL_ACTSTATE_SHIFT)) & I3C_SCTRL_ACTSTATE_MASK) - -#define I3C_SCTRL_VENDINFO_MASK (0xFF000000U) -#define I3C_SCTRL_VENDINFO_SHIFT (24U) -/*! VENDINFO - Vendor Information */ -#define I3C_SCTRL_VENDINFO(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCTRL_VENDINFO_SHIFT)) & I3C_SCTRL_VENDINFO_MASK) -/*! @} */ - -/*! @name SINTSET - Target Interrupt Set */ -/*! @{ */ - -#define I3C_SINTSET_START_MASK (0x100U) -#define I3C_SINTSET_START_SHIFT (8U) -/*! START - Start Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_START(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_START_SHIFT)) & I3C_SINTSET_START_MASK) - -#define I3C_SINTSET_MATCHED_MASK (0x200U) -#define I3C_SINTSET_MATCHED_SHIFT (9U) -/*! MATCHED - Match Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_MATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_MATCHED_SHIFT)) & I3C_SINTSET_MATCHED_MASK) - -#define I3C_SINTSET_STOP_MASK (0x400U) -#define I3C_SINTSET_STOP_SHIFT (10U) -/*! STOP - Stop Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_STOP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_STOP_SHIFT)) & I3C_SINTSET_STOP_MASK) - -#define I3C_SINTSET_RXPEND_MASK (0x800U) -#define I3C_SINTSET_RXPEND_SHIFT (11U) -/*! RXPEND - Receive Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_RXPEND_SHIFT)) & I3C_SINTSET_RXPEND_MASK) - -#define I3C_SINTSET_TXSEND_MASK (0x1000U) -#define I3C_SINTSET_TXSEND_SHIFT (12U) -/*! TXSEND - Transmit Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_TXSEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_TXSEND_SHIFT)) & I3C_SINTSET_TXSEND_MASK) - -#define I3C_SINTSET_DACHG_MASK (0x2000U) -#define I3C_SINTSET_DACHG_SHIFT (13U) -/*! DACHG - Dynamic Address Change Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_DACHG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_DACHG_SHIFT)) & I3C_SINTSET_DACHG_MASK) - -#define I3C_SINTSET_CCC_MASK (0x4000U) -#define I3C_SINTSET_CCC_SHIFT (14U) -/*! CCC - Common Command Code (CCC) Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_CCC(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_CCC_SHIFT)) & I3C_SINTSET_CCC_MASK) - -#define I3C_SINTSET_ERRWARN_MASK (0x8000U) -#define I3C_SINTSET_ERRWARN_SHIFT (15U) -/*! ERRWARN - Error or Warning Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_ERRWARN_SHIFT)) & I3C_SINTSET_ERRWARN_MASK) - -#define I3C_SINTSET_DDRMATCHED_MASK (0x10000U) -#define I3C_SINTSET_DDRMATCHED_SHIFT (16U) -/*! DDRMATCHED - Double Data Rate Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_DDRMATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_DDRMATCHED_SHIFT)) & I3C_SINTSET_DDRMATCHED_MASK) - -#define I3C_SINTSET_CHANDLED_MASK (0x20000U) -#define I3C_SINTSET_CHANDLED_SHIFT (17U) -/*! CHANDLED - Common Command Code (CCC) Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_CHANDLED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_CHANDLED_SHIFT)) & I3C_SINTSET_CHANDLED_MASK) - -#define I3C_SINTSET_EVENT_MASK (0x40000U) -#define I3C_SINTSET_EVENT_SHIFT (18U) -/*! EVENT - Event Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_EVENT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_EVENT_SHIFT)) & I3C_SINTSET_EVENT_MASK) -/*! @} */ - -/*! @name SINTCLR - Target Interrupt Clear */ -/*! @{ */ - -#define I3C_SINTCLR_START_MASK (0x100U) -#define I3C_SINTCLR_START_SHIFT (8U) -/*! START - START Interrupt Enable Clear */ -#define I3C_SINTCLR_START(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_START_SHIFT)) & I3C_SINTCLR_START_MASK) - -#define I3C_SINTCLR_MATCHED_MASK (0x200U) -#define I3C_SINTCLR_MATCHED_SHIFT (9U) -/*! MATCHED - Matched Interrupt Enable Clear */ -#define I3C_SINTCLR_MATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_MATCHED_SHIFT)) & I3C_SINTCLR_MATCHED_MASK) - -#define I3C_SINTCLR_STOP_MASK (0x400U) -#define I3C_SINTCLR_STOP_SHIFT (10U) -/*! STOP - STOP Interrupt Enable Clear */ -#define I3C_SINTCLR_STOP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_STOP_SHIFT)) & I3C_SINTCLR_STOP_MASK) - -#define I3C_SINTCLR_RXPEND_MASK (0x800U) -#define I3C_SINTCLR_RXPEND_SHIFT (11U) -/*! RXPEND - RXPEND Interrupt Enable Clear */ -#define I3C_SINTCLR_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_RXPEND_SHIFT)) & I3C_SINTCLR_RXPEND_MASK) - -#define I3C_SINTCLR_TXSEND_MASK (0x1000U) -#define I3C_SINTCLR_TXSEND_SHIFT (12U) -/*! TXSEND - TXSEND Interrupt Enable Clear */ -#define I3C_SINTCLR_TXSEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_TXSEND_SHIFT)) & I3C_SINTCLR_TXSEND_MASK) - -#define I3C_SINTCLR_DACHG_MASK (0x2000U) -#define I3C_SINTCLR_DACHG_SHIFT (13U) -/*! DACHG - DACHG Interrupt Enable Clear */ -#define I3C_SINTCLR_DACHG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_DACHG_SHIFT)) & I3C_SINTCLR_DACHG_MASK) - -#define I3C_SINTCLR_CCC_MASK (0x4000U) -#define I3C_SINTCLR_CCC_SHIFT (14U) -/*! CCC - CCC Interrupt Enable Clear */ -#define I3C_SINTCLR_CCC(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_CCC_SHIFT)) & I3C_SINTCLR_CCC_MASK) - -#define I3C_SINTCLR_ERRWARN_MASK (0x8000U) -#define I3C_SINTCLR_ERRWARN_SHIFT (15U) -/*! ERRWARN - ERRWARN Interrupt Enable Clear */ -#define I3C_SINTCLR_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_ERRWARN_SHIFT)) & I3C_SINTCLR_ERRWARN_MASK) - -#define I3C_SINTCLR_DDRMATCHED_MASK (0x10000U) -#define I3C_SINTCLR_DDRMATCHED_SHIFT (16U) -/*! DDRMATCHED - DDRMATCHED Interrupt Enable Clear */ -#define I3C_SINTCLR_DDRMATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_DDRMATCHED_SHIFT)) & I3C_SINTCLR_DDRMATCHED_MASK) - -#define I3C_SINTCLR_CHANDLED_MASK (0x20000U) -#define I3C_SINTCLR_CHANDLED_SHIFT (17U) -/*! CHANDLED - CHANDLED Interrupt Enable Clear */ -#define I3C_SINTCLR_CHANDLED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_CHANDLED_SHIFT)) & I3C_SINTCLR_CHANDLED_MASK) - -#define I3C_SINTCLR_EVENT_MASK (0x40000U) -#define I3C_SINTCLR_EVENT_SHIFT (18U) -/*! EVENT - EVENT Interrupt Enable Clear */ -#define I3C_SINTCLR_EVENT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_EVENT_SHIFT)) & I3C_SINTCLR_EVENT_MASK) -/*! @} */ - -/*! @name SINTMASKED - Target Interrupt Mask */ -/*! @{ */ - -#define I3C_SINTMASKED_START_MASK (0x100U) -#define I3C_SINTMASKED_START_SHIFT (8U) -/*! START - START Interrupt Mask */ -#define I3C_SINTMASKED_START(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_START_SHIFT)) & I3C_SINTMASKED_START_MASK) - -#define I3C_SINTMASKED_MATCHED_MASK (0x200U) -#define I3C_SINTMASKED_MATCHED_SHIFT (9U) -/*! MATCHED - MATCHED Interrupt Mask */ -#define I3C_SINTMASKED_MATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_MATCHED_SHIFT)) & I3C_SINTMASKED_MATCHED_MASK) - -#define I3C_SINTMASKED_STOP_MASK (0x400U) -#define I3C_SINTMASKED_STOP_SHIFT (10U) -/*! STOP - STOP Interrupt Mask */ -#define I3C_SINTMASKED_STOP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_STOP_SHIFT)) & I3C_SINTMASKED_STOP_MASK) - -#define I3C_SINTMASKED_RXPEND_MASK (0x800U) -#define I3C_SINTMASKED_RXPEND_SHIFT (11U) -/*! RXPEND - RXPEND Interrupt Mask */ -#define I3C_SINTMASKED_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_RXPEND_SHIFT)) & I3C_SINTMASKED_RXPEND_MASK) - -#define I3C_SINTMASKED_TXSEND_MASK (0x1000U) -#define I3C_SINTMASKED_TXSEND_SHIFT (12U) -/*! TXSEND - TXSEND Interrupt Mask */ -#define I3C_SINTMASKED_TXSEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_TXSEND_SHIFT)) & I3C_SINTMASKED_TXSEND_MASK) - -#define I3C_SINTMASKED_DACHG_MASK (0x2000U) -#define I3C_SINTMASKED_DACHG_SHIFT (13U) -/*! DACHG - DACHG Interrupt Mask */ -#define I3C_SINTMASKED_DACHG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_DACHG_SHIFT)) & I3C_SINTMASKED_DACHG_MASK) - -#define I3C_SINTMASKED_CCC_MASK (0x4000U) -#define I3C_SINTMASKED_CCC_SHIFT (14U) -/*! CCC - CCC Interrupt Mask */ -#define I3C_SINTMASKED_CCC(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_CCC_SHIFT)) & I3C_SINTMASKED_CCC_MASK) - -#define I3C_SINTMASKED_ERRWARN_MASK (0x8000U) -#define I3C_SINTMASKED_ERRWARN_SHIFT (15U) -/*! ERRWARN - ERRWARN Interrupt Mask */ -#define I3C_SINTMASKED_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_ERRWARN_SHIFT)) & I3C_SINTMASKED_ERRWARN_MASK) - -#define I3C_SINTMASKED_DDRMATCHED_MASK (0x10000U) -#define I3C_SINTMASKED_DDRMATCHED_SHIFT (16U) -/*! DDRMATCHED - DDRMATCHED Interrupt Mask */ -#define I3C_SINTMASKED_DDRMATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_DDRMATCHED_SHIFT)) & I3C_SINTMASKED_DDRMATCHED_MASK) - -#define I3C_SINTMASKED_CHANDLED_MASK (0x20000U) -#define I3C_SINTMASKED_CHANDLED_SHIFT (17U) -/*! CHANDLED - CHANDLED Interrupt Mask */ -#define I3C_SINTMASKED_CHANDLED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_CHANDLED_SHIFT)) & I3C_SINTMASKED_CHANDLED_MASK) - -#define I3C_SINTMASKED_EVENT_MASK (0x40000U) -#define I3C_SINTMASKED_EVENT_SHIFT (18U) -/*! EVENT - EVENT Interrupt Mask */ -#define I3C_SINTMASKED_EVENT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_EVENT_SHIFT)) & I3C_SINTMASKED_EVENT_MASK) -/*! @} */ - -/*! @name SERRWARN - Target Errors and Warnings */ -/*! @{ */ - -#define I3C_SERRWARN_ORUN_MASK (0x1U) -#define I3C_SERRWARN_ORUN_SHIFT (0U) -/*! ORUN - Overrun Error - * 0b1..Overrun error - * 0b0..No overrun error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_ORUN(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_ORUN_SHIFT)) & I3C_SERRWARN_ORUN_MASK) - -#define I3C_SERRWARN_URUN_MASK (0x2U) -#define I3C_SERRWARN_URUN_SHIFT (1U) -/*! URUN - Underrun Error - * 0b1..Underrun error - * 0b0..No underrun error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_URUN(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_URUN_SHIFT)) & I3C_SERRWARN_URUN_MASK) - -#define I3C_SERRWARN_URUNNACK_MASK (0x4U) -#define I3C_SERRWARN_URUNNACK_SHIFT (2U) -/*! URUNNACK - Underrun and Not Acknowledged (NACKed) Error - * 0b1..Underrun; not acknowledged error - * 0b0..No underrun; not acknowledged error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_URUNNACK(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_URUNNACK_SHIFT)) & I3C_SERRWARN_URUNNACK_MASK) - -#define I3C_SERRWARN_TERM_MASK (0x8U) -#define I3C_SERRWARN_TERM_SHIFT (3U) -/*! TERM - Terminated Error - * 0b1..Terminated error - * 0b0..No terminated error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_TERM(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_TERM_SHIFT)) & I3C_SERRWARN_TERM_MASK) - -#define I3C_SERRWARN_INVSTART_MASK (0x10U) -#define I3C_SERRWARN_INVSTART_SHIFT (4U) -/*! INVSTART - Invalid Start Error - * 0b1..Invalid start error - * 0b0..No invalid start error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_INVSTART(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_INVSTART_SHIFT)) & I3C_SERRWARN_INVSTART_MASK) - -#define I3C_SERRWARN_SPAR_MASK (0x100U) -#define I3C_SERRWARN_SPAR_SHIFT (8U) -/*! SPAR - SDR Parity Error - * 0b1..SDR parity error - * 0b0..No SDR parity error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_SPAR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_SPAR_SHIFT)) & I3C_SERRWARN_SPAR_MASK) - -#define I3C_SERRWARN_HPAR_MASK (0x200U) -#define I3C_SERRWARN_HPAR_SHIFT (9U) -/*! HPAR - HDR Parity Error - * 0b1..HDR parity error - * 0b0..No HDR parity error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_HPAR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_HPAR_SHIFT)) & I3C_SERRWARN_HPAR_MASK) - -#define I3C_SERRWARN_HCRC_MASK (0x400U) -#define I3C_SERRWARN_HCRC_SHIFT (10U) -/*! HCRC - HDR-DDR CRC Error - * 0b1..HDR-DDR CRC error occurred - * 0b0..No HDR-DDR CRC error occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_HCRC(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_HCRC_SHIFT)) & I3C_SERRWARN_HCRC_MASK) - -#define I3C_SERRWARN_S0S1_MASK (0x800U) -#define I3C_SERRWARN_S0S1_SHIFT (11U) -/*! S0S1 - TE0 or TE1 Error - * 0b1..TE0 or TE1 error occurred - * 0b0..No TE0 or TE1 error occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_S0S1(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_S0S1_SHIFT)) & I3C_SERRWARN_S0S1_MASK) - -#define I3C_SERRWARN_OREAD_MASK (0x10000U) -#define I3C_SERRWARN_OREAD_SHIFT (16U) -/*! OREAD - Over-Read Error - * 0b1..Over-read error - * 0b0..No over-read error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_OREAD(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_OREAD_SHIFT)) & I3C_SERRWARN_OREAD_MASK) - -#define I3C_SERRWARN_OWRITE_MASK (0x20000U) -#define I3C_SERRWARN_OWRITE_SHIFT (17U) -/*! OWRITE - Over-Write Error - * 0b1..Overwrite error - * 0b0..No overwrite error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_OWRITE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_OWRITE_SHIFT)) & I3C_SERRWARN_OWRITE_MASK) -/*! @} */ - -/*! @name SDMACTRL - Target DMA Control */ -/*! @{ */ - -#define I3C_SDMACTRL_DMAFB_MASK (0x3U) -#define I3C_SDMACTRL_DMAFB_SHIFT (0U) -/*! DMAFB - DMA Read (From-Bus) Trigger - * 0b00..DMA not used - * 0b01..DMA enabled for one frame - * 0b10..DMA enabled until turned off - * 0b11.. - */ -#define I3C_SDMACTRL_DMAFB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDMACTRL_DMAFB_SHIFT)) & I3C_SDMACTRL_DMAFB_MASK) - -#define I3C_SDMACTRL_DMATB_MASK (0xCU) -#define I3C_SDMACTRL_DMATB_SHIFT (2U) -/*! DMATB - DMA Write (To-Bus) Trigger - * 0b00..DMA not used - * 0b01..DMA enabled for one frame - * 0b10..DMA enabled until turned off - * 0b11.. - */ -#define I3C_SDMACTRL_DMATB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDMACTRL_DMATB_SHIFT)) & I3C_SDMACTRL_DMATB_MASK) - -#define I3C_SDMACTRL_DMAWIDTH_MASK (0x30U) -#define I3C_SDMACTRL_DMAWIDTH_SHIFT (4U) -/*! DMAWIDTH - Width of DMA Operations - * 0b00, 0b01..Byte - * 0b10..Halfword (16 bits) (this value ensures that two bytes are available in the FIFO) - * 0b11.. - */ -#define I3C_SDMACTRL_DMAWIDTH(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDMACTRL_DMAWIDTH_SHIFT)) & I3C_SDMACTRL_DMAWIDTH_MASK) -/*! @} */ - -/*! @name SDATACTRL - Target Data Control */ -/*! @{ */ - -#define I3C_SDATACTRL_FLUSHTB_MASK (0x1U) -#define I3C_SDATACTRL_FLUSHTB_SHIFT (0U) -/*! FLUSHTB - Flush To-Bus Buffer or FIFO */ -#define I3C_SDATACTRL_FLUSHTB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_FLUSHTB_SHIFT)) & I3C_SDATACTRL_FLUSHTB_MASK) - -#define I3C_SDATACTRL_FLUSHFB_MASK (0x2U) -#define I3C_SDATACTRL_FLUSHFB_SHIFT (1U) -/*! FLUSHFB - Flush From-Bus Buffer or FIFO */ -#define I3C_SDATACTRL_FLUSHFB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_FLUSHFB_SHIFT)) & I3C_SDATACTRL_FLUSHFB_MASK) - -#define I3C_SDATACTRL_UNLOCK_MASK (0x8U) -#define I3C_SDATACTRL_UNLOCK_SHIFT (3U) -/*! UNLOCK - Unlock - * 0b0..Cannot be changed - * 0b1..Can be changed - */ -#define I3C_SDATACTRL_UNLOCK(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_UNLOCK_SHIFT)) & I3C_SDATACTRL_UNLOCK_MASK) - -#define I3C_SDATACTRL_TXTRIG_MASK (0x30U) -#define I3C_SDATACTRL_TXTRIG_SHIFT (4U) -/*! TXTRIG - Transmit Trigger Level - * 0b00..Trigger when empty - * 0b01..Trigger when 1/4 full or less - * 0b10..Trigger when 1/2 full or less - * 0b11..Default (trigger when 1 less than full or less) - */ -#define I3C_SDATACTRL_TXTRIG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_TXTRIG_SHIFT)) & I3C_SDATACTRL_TXTRIG_MASK) - -#define I3C_SDATACTRL_RXTRIG_MASK (0xC0U) -#define I3C_SDATACTRL_RXTRIG_SHIFT (6U) -/*! RXTRIG - Receive Trigger Level - * 0b00..Trigger when not empty - * 0b01..Trigger when 1/4 or more full - * 0b10..Trigger when 1/2 or more full - * 0b11..Trigger when 3/4 or more full - */ -#define I3C_SDATACTRL_RXTRIG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_RXTRIG_SHIFT)) & I3C_SDATACTRL_RXTRIG_MASK) - -#define I3C_SDATACTRL_TXCOUNT_MASK (0x1F0000U) -#define I3C_SDATACTRL_TXCOUNT_SHIFT (16U) -/*! TXCOUNT - Count of Bytes in Transmit */ -#define I3C_SDATACTRL_TXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_TXCOUNT_SHIFT)) & I3C_SDATACTRL_TXCOUNT_MASK) - -#define I3C_SDATACTRL_RXCOUNT_MASK (0x1F000000U) -#define I3C_SDATACTRL_RXCOUNT_SHIFT (24U) -/*! RXCOUNT - Count of Bytes in Receive */ -#define I3C_SDATACTRL_RXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_RXCOUNT_SHIFT)) & I3C_SDATACTRL_RXCOUNT_MASK) - -#define I3C_SDATACTRL_TXFULL_MASK (0x40000000U) -#define I3C_SDATACTRL_TXFULL_SHIFT (30U) -/*! TXFULL - Transmit is Full - * 0b1..Full - * 0b0..Not full - */ -#define I3C_SDATACTRL_TXFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_TXFULL_SHIFT)) & I3C_SDATACTRL_TXFULL_MASK) - -#define I3C_SDATACTRL_RXEMPTY_MASK (0x80000000U) -#define I3C_SDATACTRL_RXEMPTY_SHIFT (31U) -/*! RXEMPTY - Receive is Empty - * 0b1..Empty - * 0b0..Not empty - */ -#define I3C_SDATACTRL_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_RXEMPTY_SHIFT)) & I3C_SDATACTRL_RXEMPTY_MASK) -/*! @} */ - -/*! @name SWDATAB - Target Write Data Byte */ -/*! @{ */ - -#define I3C_SWDATAB_DATA_MASK (0xFFU) -#define I3C_SWDATAB_DATA_SHIFT (0U) -/*! DATA - Data */ -#define I3C_SWDATAB_DATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAB_DATA_SHIFT)) & I3C_SWDATAB_DATA_MASK) - -#define I3C_SWDATAB_END_MASK (0x100U) -#define I3C_SWDATAB_END_SHIFT (8U) -/*! END - End - * 0b1..End - * 0b0..Not the end - */ -#define I3C_SWDATAB_END(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAB_END_SHIFT)) & I3C_SWDATAB_END_MASK) - -#define I3C_SWDATAB_END_ALSO_MASK (0x10000U) -#define I3C_SWDATAB_END_ALSO_SHIFT (16U) -/*! END_ALSO - End Also - * 0b1..End - * 0b0..Not the end - */ -#define I3C_SWDATAB_END_ALSO(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAB_END_ALSO_SHIFT)) & I3C_SWDATAB_END_ALSO_MASK) -/*! @} */ - -/*! @name SWDATABE - Target Write Data Byte End */ -/*! @{ */ - -#define I3C_SWDATABE_DATA_MASK (0xFFU) -#define I3C_SWDATABE_DATA_SHIFT (0U) -/*! DATA - Data */ -#define I3C_SWDATABE_DATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATABE_DATA_SHIFT)) & I3C_SWDATABE_DATA_MASK) -/*! @} */ - -/*! @name SWDATAH - Target Write Data Halfword */ -/*! @{ */ - -#define I3C_SWDATAH_DATA0_MASK (0xFFU) -#define I3C_SWDATAH_DATA0_SHIFT (0U) -/*! DATA0 - Data 0 */ -#define I3C_SWDATAH_DATA0(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAH_DATA0_SHIFT)) & I3C_SWDATAH_DATA0_MASK) - -#define I3C_SWDATAH_DATA1_MASK (0xFF00U) -#define I3C_SWDATAH_DATA1_SHIFT (8U) -/*! DATA1 - Data 1 */ -#define I3C_SWDATAH_DATA1(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAH_DATA1_SHIFT)) & I3C_SWDATAH_DATA1_MASK) - -#define I3C_SWDATAH_END_MASK (0x10000U) -#define I3C_SWDATAH_END_SHIFT (16U) -/*! END - End of Message - * 0b1..End - * 0b0..Not the end - */ -#define I3C_SWDATAH_END(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAH_END_SHIFT)) & I3C_SWDATAH_END_MASK) -/*! @} */ - -/*! @name SWDATAHE - Target Write Data Halfword End */ -/*! @{ */ - -#define I3C_SWDATAHE_DATA0_MASK (0xFFU) -#define I3C_SWDATAHE_DATA0_SHIFT (0U) -/*! DATA0 - Data 0 */ -#define I3C_SWDATAHE_DATA0(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAHE_DATA0_SHIFT)) & I3C_SWDATAHE_DATA0_MASK) - -#define I3C_SWDATAHE_DATA1_MASK (0xFF00U) -#define I3C_SWDATAHE_DATA1_SHIFT (8U) -/*! DATA1 - Data 1 */ -#define I3C_SWDATAHE_DATA1(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAHE_DATA1_SHIFT)) & I3C_SWDATAHE_DATA1_MASK) -/*! @} */ - -/*! @name SRDATAB - Target Read Data Byte */ -/*! @{ */ - -#define I3C_SRDATAB_DATA0_MASK (0xFFU) -#define I3C_SRDATAB_DATA0_SHIFT (0U) -/*! DATA0 - Data 0 */ -#define I3C_SRDATAB_DATA0(x) (((uint32_t)(((uint32_t)(x)) << I3C_SRDATAB_DATA0_SHIFT)) & I3C_SRDATAB_DATA0_MASK) -/*! @} */ - -/*! @name SRDATAH - Target Read Data Halfword */ -/*! @{ */ - -#define I3C_SRDATAH_LSB_MASK (0xFFU) -#define I3C_SRDATAH_LSB_SHIFT (0U) -/*! LSB - Low Byte */ -#define I3C_SRDATAH_LSB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SRDATAH_LSB_SHIFT)) & I3C_SRDATAH_LSB_MASK) - -#define I3C_SRDATAH_MSB_MASK (0xFF00U) -#define I3C_SRDATAH_MSB_SHIFT (8U) -/*! MSB - High Byte */ -#define I3C_SRDATAH_MSB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SRDATAH_MSB_SHIFT)) & I3C_SRDATAH_MSB_MASK) -/*! @} */ - -/*! @name SWDATAB1 - Target Write Data Byte */ -/*! @{ */ - -#define I3C_SWDATAB1_DATA_MASK (0xFFU) -#define I3C_SWDATAB1_DATA_SHIFT (0U) -/*! DATA - Data */ -#define I3C_SWDATAB1_DATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAB1_DATA_SHIFT)) & I3C_SWDATAB1_DATA_MASK) -/*! @} */ - -/*! @name SWDATAH1 - Target Write Data Halfword */ -/*! @{ */ - -#define I3C_SWDATAH1_DATA_MASK (0xFFFFU) -#define I3C_SWDATAH1_DATA_SHIFT (0U) -/*! DATA - Data */ -#define I3C_SWDATAH1_DATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAH1_DATA_SHIFT)) & I3C_SWDATAH1_DATA_MASK) -/*! @} */ - -/*! @name SCAPABILITIES2 - Target Capabilities 2 */ -/*! @{ */ - -#define I3C_SCAPABILITIES2_MAPCNT_MASK (0xFU) -#define I3C_SCAPABILITIES2_MAPCNT_SHIFT (0U) -/*! MAPCNT - Map Count */ -#define I3C_SCAPABILITIES2_MAPCNT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_MAPCNT_SHIFT)) & I3C_SCAPABILITIES2_MAPCNT_MASK) - -#define I3C_SCAPABILITIES2_I2C10B_MASK (0x10U) -#define I3C_SCAPABILITIES2_I2C10B_SHIFT (4U) -/*! I2C10B - I2C 10-bit Address - * 0b0..Not supported - * 0b1..Supported - */ -#define I3C_SCAPABILITIES2_I2C10B(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_I2C10B_SHIFT)) & I3C_SCAPABILITIES2_I2C10B_MASK) - -#define I3C_SCAPABILITIES2_I2CRST_MASK (0x20U) -#define I3C_SCAPABILITIES2_I2CRST_SHIFT (5U) -/*! I2CRST - I2C Software Reset - * 0b0..Not supported - * 0b1..Supported - */ -#define I3C_SCAPABILITIES2_I2CRST(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_I2CRST_SHIFT)) & I3C_SCAPABILITIES2_I2CRST_MASK) - -#define I3C_SCAPABILITIES2_I2CDEVID_MASK (0x40U) -#define I3C_SCAPABILITIES2_I2CDEVID_SHIFT (6U) -/*! I2CDEVID - I2C Device ID - * 0b0..Not supported - * 0b1..Supported - */ -#define I3C_SCAPABILITIES2_I2CDEVID(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_I2CDEVID_SHIFT)) & I3C_SCAPABILITIES2_I2CDEVID_MASK) - -#define I3C_SCAPABILITIES2_IBIEXT_MASK (0x100U) -#define I3C_SCAPABILITIES2_IBIEXT_SHIFT (8U) -/*! IBIEXT - In-Band Interrupt EXTDATA - * 0b0..Not supported - * 0b1..Supported - */ -#define I3C_SCAPABILITIES2_IBIEXT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_IBIEXT_SHIFT)) & I3C_SCAPABILITIES2_IBIEXT_MASK) - -#define I3C_SCAPABILITIES2_IBIXREG_MASK (0x200U) -#define I3C_SCAPABILITIES2_IBIXREG_SHIFT (9U) -/*! IBIXREG - In-Band Interrupt Extended Register - * 0b0..Not supported - * 0b1..Supported - */ -#define I3C_SCAPABILITIES2_IBIXREG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_IBIXREG_SHIFT)) & I3C_SCAPABILITIES2_IBIXREG_MASK) - -#define I3C_SCAPABILITIES2_SLVRST_MASK (0x20000U) -#define I3C_SCAPABILITIES2_SLVRST_SHIFT (17U) -/*! SLVRST - Target Reset - * 0b0..Not supported - * 0b1..Supported - */ -#define I3C_SCAPABILITIES2_SLVRST(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_SLVRST_SHIFT)) & I3C_SCAPABILITIES2_SLVRST_MASK) - -#define I3C_SCAPABILITIES2_GROUP_MASK (0xC0000U) -#define I3C_SCAPABILITIES2_GROUP_SHIFT (18U) -/*! GROUP - Group - * 0b00..v1.1 group addressing not supported - * 0b01..One group supported - * 0b10..Two groups supported - * 0b11..Three groups supported - */ -#define I3C_SCAPABILITIES2_GROUP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_GROUP_SHIFT)) & I3C_SCAPABILITIES2_GROUP_MASK) - -#define I3C_SCAPABILITIES2_AASA_MASK (0x200000U) -#define I3C_SCAPABILITIES2_AASA_SHIFT (21U) -/*! AASA - SETAASA - * 0b1..SETAASA supported - * 0b0..SETAASA not supported - */ -#define I3C_SCAPABILITIES2_AASA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_AASA_SHIFT)) & I3C_SCAPABILITIES2_AASA_MASK) - -#define I3C_SCAPABILITIES2_SSTSUB_MASK (0x400000U) -#define I3C_SCAPABILITIES2_SSTSUB_SHIFT (22U) -/*! SSTSUB - Target-Target(s)-Tunnel Subscriber Capable - * 0b1..Subscriber capable - * 0b0..Not subscriber capable - */ -#define I3C_SCAPABILITIES2_SSTSUB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_SSTSUB_SHIFT)) & I3C_SCAPABILITIES2_SSTSUB_MASK) - -#define I3C_SCAPABILITIES2_SSTWR_MASK (0x800000U) -#define I3C_SCAPABILITIES2_SSTWR_SHIFT (23U) -/*! SSTWR - Target-Target(s)-Tunnel Write Capable - * 0b1..Write capable - * 0b0..Not write capable - */ -#define I3C_SCAPABILITIES2_SSTWR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_SSTWR_SHIFT)) & I3C_SCAPABILITIES2_SSTWR_MASK) -/*! @} */ - -/*! @name SCAPABILITIES - Target Capabilities */ -/*! @{ */ - -#define I3C_SCAPABILITIES_IDENA_MASK (0x3U) -#define I3C_SCAPABILITIES_IDENA_SHIFT (0U) -/*! IDENA - ID 48b Handler - * 0b00..Application - * 0b01..Hardware - * 0b10..Hardware, but the I3C module instance handles ID 48b - * 0b11..A part number register (PARTNO) - */ -#define I3C_SCAPABILITIES_IDENA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_IDENA_SHIFT)) & I3C_SCAPABILITIES_IDENA_MASK) - -#define I3C_SCAPABILITIES_IDREG_MASK (0x3CU) -#define I3C_SCAPABILITIES_IDREG_SHIFT (2U) -/*! IDREG - ID Register - * 0b0000..All ID register features disabled - * 0bxxx1..ID Instance is a register; used if there is no PARTNO register - * 0bxx1x..An ID Random field is available - * 0bx1xx..A Device Characteristic Register (DCR) is available - * 0b1xxx..A Bus Characteristics Register (BCR) is available - */ -#define I3C_SCAPABILITIES_IDREG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_IDREG_SHIFT)) & I3C_SCAPABILITIES_IDREG_MASK) - -#define I3C_SCAPABILITIES_HDRSUPP_MASK (0xC0U) -#define I3C_SCAPABILITIES_HDRSUPP_SHIFT (6U) -/*! HDRSUPP - High Data Rate Support - * 0b00..No HDR modes supported - * 0b01..DDR mode supported - * *.. - */ -#define I3C_SCAPABILITIES_HDRSUPP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_HDRSUPP_SHIFT)) & I3C_SCAPABILITIES_HDRSUPP_MASK) - -#define I3C_SCAPABILITIES_MASTER_MASK (0x200U) -#define I3C_SCAPABILITIES_MASTER_SHIFT (9U) -/*! MASTER - Controller - * 0b0..Not supported - * 0b1..Supported - */ -#define I3C_SCAPABILITIES_MASTER(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_MASTER_SHIFT)) & I3C_SCAPABILITIES_MASTER_MASK) - -#define I3C_SCAPABILITIES_SADDR_MASK (0xC00U) -#define I3C_SCAPABILITIES_SADDR_SHIFT (10U) -/*! SADDR - Static Address - * 0b00..No static address - * 0b01..Static address is fixed in hardware - * 0b10..Hardware controls the static address dynamically (for example, from the pin strap) - * 0b11..SCONFIG register supplies the static address - */ -#define I3C_SCAPABILITIES_SADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_SADDR_SHIFT)) & I3C_SCAPABILITIES_SADDR_MASK) - -#define I3C_SCAPABILITIES_CCCHANDLE_MASK (0xF000U) -#define I3C_SCAPABILITIES_CCCHANDLE_SHIFT (12U) -/*! CCCHANDLE - Common Command Codes Handling - * 0b0000..All handling features disabled - * 0bxxx1..The I3C module manages events, activities, status, HDR, and if enabled for it, ID and static-address-related items - * 0bxx1x..The I3C module manages maximum read and write lengths, and max data speed - * 0bx1xx..GETSTATUS CCC returns the values of SCTRL[PENDINT] and SCTRL[ACTSTATE] - * 0b1xxx..GETSTATUS CCC returns the value of SCTRL[VENDINFO] - */ -#define I3C_SCAPABILITIES_CCCHANDLE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_CCCHANDLE_SHIFT)) & I3C_SCAPABILITIES_CCCHANDLE_MASK) - -#define I3C_SCAPABILITIES_IBI_MR_HJ_MASK (0x1F0000U) -#define I3C_SCAPABILITIES_IBI_MR_HJ_SHIFT (16U) -/*! IBI_MR_HJ - In-Band Interrupts, Controller Requests, Hot-Join Events - * 0b00000..Application cannot generate IBI, CR, or HJ - * 0bxxxx1..Application can generate an IBI - * 0bxxx1x..When bit 0 = 1, the IBI has data from the SCTRL register - * 0bxx1xx..Application can generate a controller request for a secondary controller - * 0bx1xxx..Application can generate a Hot-Join event - * 0b1xxxx..Application can use SCONFIG[BAMATCH] for bus-available timing - */ -#define I3C_SCAPABILITIES_IBI_MR_HJ(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_IBI_MR_HJ_SHIFT)) & I3C_SCAPABILITIES_IBI_MR_HJ_MASK) - -#define I3C_SCAPABILITIES_TIMECTRL_MASK (0x200000U) -#define I3C_SCAPABILITIES_TIMECTRL_SHIFT (21U) -/*! TIMECTRL - Time Control - * 0b0..No time control supported - * 0b1..At least one time-control type supported - */ -#define I3C_SCAPABILITIES_TIMECTRL(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_TIMECTRL_SHIFT)) & I3C_SCAPABILITIES_TIMECTRL_MASK) - -#define I3C_SCAPABILITIES_EXTFIFO_MASK (0x3800000U) -#define I3C_SCAPABILITIES_EXTFIFO_SHIFT (23U) -/*! EXTFIFO - External FIFO - * 0b000..No external FIFO available - * 0b001..Standard available or free external FIFO - * 0b010..Request track external FIFO - * *.. - */ -#define I3C_SCAPABILITIES_EXTFIFO(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_EXTFIFO_SHIFT)) & I3C_SCAPABILITIES_EXTFIFO_MASK) - -#define I3C_SCAPABILITIES_FIFOTX_MASK (0xC000000U) -#define I3C_SCAPABILITIES_FIFOTX_SHIFT (26U) -/*! FIFOTX - FIFO Transmit - * 0b00..Two - * 0b01..Four - * 0b10..Eight - * 0b11..16 or larger - */ -#define I3C_SCAPABILITIES_FIFOTX(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_FIFOTX_SHIFT)) & I3C_SCAPABILITIES_FIFOTX_MASK) - -#define I3C_SCAPABILITIES_FIFORX_MASK (0x30000000U) -#define I3C_SCAPABILITIES_FIFORX_SHIFT (28U) -/*! FIFORX - FIFO Receive - * 0b00..Two or three - * 0b01..Four - * 0b10..Eight - * 0b11..16 or larger - */ -#define I3C_SCAPABILITIES_FIFORX(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_FIFORX_SHIFT)) & I3C_SCAPABILITIES_FIFORX_MASK) - -#define I3C_SCAPABILITIES_INT_MASK (0x40000000U) -#define I3C_SCAPABILITIES_INT_SHIFT (30U) -/*! INT - Interrupts - * 0b1..Supported - * 0b0..Not supported - */ -#define I3C_SCAPABILITIES_INT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_INT_SHIFT)) & I3C_SCAPABILITIES_INT_MASK) - -#define I3C_SCAPABILITIES_DMA_MASK (0x80000000U) -#define I3C_SCAPABILITIES_DMA_SHIFT (31U) -/*! DMA - Direct Memory Access - * 0b1..Supported - * 0b0..Not supported - */ -#define I3C_SCAPABILITIES_DMA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_DMA_SHIFT)) & I3C_SCAPABILITIES_DMA_MASK) -/*! @} */ - -/*! @name SDYNADDR - Target Dynamic Address */ -/*! @{ */ - -#define I3C_SDYNADDR_DAVALID_MASK (0x1U) -#define I3C_SDYNADDR_DAVALID_SHIFT (0U) -/*! DAVALID - Dynamic Address Valid - * 0b0..DANOTASSIGNED: a dynamic address is not assigned - * 0b1..DAASSIGNED: a dynamic address is assigned - */ -#define I3C_SDYNADDR_DAVALID(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDYNADDR_DAVALID_SHIFT)) & I3C_SDYNADDR_DAVALID_MASK) - -#define I3C_SDYNADDR_DADDR_MASK (0xFEU) -#define I3C_SDYNADDR_DADDR_SHIFT (1U) -/*! DADDR - Dynamic Address */ -#define I3C_SDYNADDR_DADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDYNADDR_DADDR_SHIFT)) & I3C_SDYNADDR_DADDR_MASK) - -#define I3C_SDYNADDR_MAPSA_MASK (0x1000U) -#define I3C_SDYNADDR_MAPSA_SHIFT (12U) -/*! MAPSA - Map a Static Address */ -#define I3C_SDYNADDR_MAPSA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDYNADDR_MAPSA_SHIFT)) & I3C_SDYNADDR_MAPSA_MASK) - -#define I3C_SDYNADDR_SA10B_MASK (0xE000U) -#define I3C_SDYNADDR_SA10B_SHIFT (13U) -/*! SA10B - 10-Bit Static Address */ -#define I3C_SDYNADDR_SA10B(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDYNADDR_SA10B_SHIFT)) & I3C_SDYNADDR_SA10B_MASK) - -#define I3C_SDYNADDR_KEY_MASK (0xFFFF0000U) -#define I3C_SDYNADDR_KEY_SHIFT (16U) -/*! KEY - Key */ -#define I3C_SDYNADDR_KEY(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDYNADDR_KEY_SHIFT)) & I3C_SDYNADDR_KEY_MASK) -/*! @} */ - -/*! @name SMAXLIMITS - Target Maximum Limits */ -/*! @{ */ - -#define I3C_SMAXLIMITS_MAXRD_MASK (0xFFFU) -#define I3C_SMAXLIMITS_MAXRD_SHIFT (0U) -/*! MAXRD - Maximum Read Length */ -#define I3C_SMAXLIMITS_MAXRD(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMAXLIMITS_MAXRD_SHIFT)) & I3C_SMAXLIMITS_MAXRD_MASK) - -#define I3C_SMAXLIMITS_MAXWR_MASK (0xFFF0000U) -#define I3C_SMAXLIMITS_MAXWR_SHIFT (16U) -/*! MAXWR - Maximum Write Length */ -#define I3C_SMAXLIMITS_MAXWR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMAXLIMITS_MAXWR_SHIFT)) & I3C_SMAXLIMITS_MAXWR_MASK) -/*! @} */ - -/*! @name SIDPARTNO - Target ID Part Number */ -/*! @{ */ - -#define I3C_SIDPARTNO_PARTNO_MASK (0xFFFFFFFFU) -#define I3C_SIDPARTNO_PARTNO_SHIFT (0U) -/*! PARTNO - Part Number */ -#define I3C_SIDPARTNO_PARTNO(x) (((uint32_t)(((uint32_t)(x)) << I3C_SIDPARTNO_PARTNO_SHIFT)) & I3C_SIDPARTNO_PARTNO_MASK) -/*! @} */ - -/*! @name SIDEXT - Target ID Extension */ -/*! @{ */ - -#define I3C_SIDEXT_DCR_MASK (0xFF00U) -#define I3C_SIDEXT_DCR_SHIFT (8U) -/*! DCR - Device Characteristic Register */ -#define I3C_SIDEXT_DCR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SIDEXT_DCR_SHIFT)) & I3C_SIDEXT_DCR_MASK) - -#define I3C_SIDEXT_BCR_MASK (0xFF0000U) -#define I3C_SIDEXT_BCR_SHIFT (16U) -/*! BCR - Bus Characteristics Register */ -#define I3C_SIDEXT_BCR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SIDEXT_BCR_SHIFT)) & I3C_SIDEXT_BCR_MASK) -/*! @} */ - -/*! @name SVENDORID - Target Vendor ID */ -/*! @{ */ - -#define I3C_SVENDORID_VID_MASK (0x7FFFU) -#define I3C_SVENDORID_VID_SHIFT (0U) -/*! VID - Vendor ID */ -#define I3C_SVENDORID_VID(x) (((uint32_t)(((uint32_t)(x)) << I3C_SVENDORID_VID_SHIFT)) & I3C_SVENDORID_VID_MASK) -/*! @} */ - -/*! @name STCCLOCK - Target Time Control Clock */ -/*! @{ */ - -#define I3C_STCCLOCK_ACCURACY_MASK (0xFFU) -#define I3C_STCCLOCK_ACCURACY_SHIFT (0U) -/*! ACCURACY - Clock Accuracy */ -#define I3C_STCCLOCK_ACCURACY(x) (((uint32_t)(((uint32_t)(x)) << I3C_STCCLOCK_ACCURACY_SHIFT)) & I3C_STCCLOCK_ACCURACY_MASK) - -#define I3C_STCCLOCK_FREQ_MASK (0xFF00U) -#define I3C_STCCLOCK_FREQ_SHIFT (8U) -/*! FREQ - Clock Frequency */ -#define I3C_STCCLOCK_FREQ(x) (((uint32_t)(((uint32_t)(x)) << I3C_STCCLOCK_FREQ_SHIFT)) & I3C_STCCLOCK_FREQ_MASK) -/*! @} */ - -/*! @name SMSGMAPADDR - Target Message Map Address */ -/*! @{ */ - -#define I3C_SMSGMAPADDR_MAPLAST_MASK (0xFU) -#define I3C_SMSGMAPADDR_MAPLAST_SHIFT (0U) -/*! MAPLAST - Matched Address Index */ -#define I3C_SMSGMAPADDR_MAPLAST(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMSGMAPADDR_MAPLAST_SHIFT)) & I3C_SMSGMAPADDR_MAPLAST_MASK) - -#define I3C_SMSGMAPADDR_LASTSTATIC_MASK (0x10U) -#define I3C_SMSGMAPADDR_LASTSTATIC_SHIFT (4U) -/*! LASTSTATIC - Last Static Address Matched - * 0b1..I2C static address - * 0b0..I3C dynamic address - */ -#define I3C_SMSGMAPADDR_LASTSTATIC(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMSGMAPADDR_LASTSTATIC_SHIFT)) & I3C_SMSGMAPADDR_LASTSTATIC_MASK) - -#define I3C_SMSGMAPADDR_MAPLASTM1_MASK (0xF00U) -#define I3C_SMSGMAPADDR_MAPLASTM1_SHIFT (8U) -/*! MAPLASTM1 - Matched Previous Address Index 1 */ -#define I3C_SMSGMAPADDR_MAPLASTM1(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMSGMAPADDR_MAPLASTM1_SHIFT)) & I3C_SMSGMAPADDR_MAPLASTM1_MASK) - -#define I3C_SMSGMAPADDR_MAPLASTM2_MASK (0xF0000U) -#define I3C_SMSGMAPADDR_MAPLASTM2_SHIFT (16U) -/*! MAPLASTM2 - Matched Previous Index 2 */ -#define I3C_SMSGMAPADDR_MAPLASTM2(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMSGMAPADDR_MAPLASTM2_SHIFT)) & I3C_SMSGMAPADDR_MAPLASTM2_MASK) -/*! @} */ - -/*! @name MCONFIG_EXT - Controller Extended Configuration */ -/*! @{ */ - -#define I3C_MCONFIG_EXT_I3C_CAS_DEL_MASK (0x30000U) -#define I3C_MCONFIG_EXT_I3C_CAS_DEL_SHIFT (16U) -/*! I3C_CAS_DEL - I3C CAS Delay After START - * 0b00..No delay - * 0b01..Increases SCL clock period by 1/2 - * 0b10..Increases SCL clock period by 1 - * 0b11..Increases SCL clock period by 3/2 - */ -#define I3C_MCONFIG_EXT_I3C_CAS_DEL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_EXT_I3C_CAS_DEL_SHIFT)) & I3C_MCONFIG_EXT_I3C_CAS_DEL_MASK) - -#define I3C_MCONFIG_EXT_I3C_CASR_DEL_MASK (0xC0000U) -#define I3C_MCONFIG_EXT_I3C_CASR_DEL_SHIFT (18U) -/*! I3C_CASR_DEL - I3C CAS Delay After Repeated START - * 0b00..No delay - * 0b01..Increases SCL clock period by 1/2 - * 0b10..Increases SCL clock period by 1 - * 0b11..Increases SCL clock period by 1 1/2 - */ -#define I3C_MCONFIG_EXT_I3C_CASR_DEL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_EXT_I3C_CASR_DEL_SHIFT)) & I3C_MCONFIG_EXT_I3C_CASR_DEL_MASK) -/*! @} */ - -/*! @name MCTRL - Controller Control */ -/*! @{ */ - -#define I3C_MCTRL_REQUEST_MASK (0x7U) -#define I3C_MCTRL_REQUEST_SHIFT (0U) -/*! REQUEST - Request - * 0b000..NONE - * 0b001..EMITSTARTADDR - * 0b010..EMITSTOP - * 0b011..IBIACKNACK - * 0b100..PROCESSDAA - * 0b101.. - * 0b110..Force Exit and Target Reset - * 0b111..AUTOIBI - */ -#define I3C_MCTRL_REQUEST(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCTRL_REQUEST_SHIFT)) & I3C_MCTRL_REQUEST_MASK) - -#define I3C_MCTRL_TYPE_MASK (0x30U) -#define I3C_MCTRL_TYPE_SHIFT (4U) -/*! TYPE - Bus Type with EmitStartAddr - * 0b00..I3C - * 0b01..I2C - * 0b10..DDR - * 0b11.. - */ -#define I3C_MCTRL_TYPE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCTRL_TYPE_SHIFT)) & I3C_MCTRL_TYPE_MASK) - -#define I3C_MCTRL_IBIRESP_MASK (0xC0U) -#define I3C_MCTRL_IBIRESP_SHIFT (6U) -/*! IBIRESP - In-Band Interrupt Response - * 0b00..ACK (acknowledge) - * 0b01..NACK (reject) - * 0b10..Acknowledge with mandatory byte - * 0b11..Manual - */ -#define I3C_MCTRL_IBIRESP(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCTRL_IBIRESP_SHIFT)) & I3C_MCTRL_IBIRESP_MASK) - -#define I3C_MCTRL_DIR_MASK (0x100U) -#define I3C_MCTRL_DIR_SHIFT (8U) -/*! DIR - Direction - * 0b0..Write - * 0b1..Read - */ -#define I3C_MCTRL_DIR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCTRL_DIR_SHIFT)) & I3C_MCTRL_DIR_MASK) - -#define I3C_MCTRL_ADDR_MASK (0xFE00U) -#define I3C_MCTRL_ADDR_SHIFT (9U) -/*! ADDR - Address */ -#define I3C_MCTRL_ADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCTRL_ADDR_SHIFT)) & I3C_MCTRL_ADDR_MASK) - -#define I3C_MCTRL_RDTERM_MASK (0xFF0000U) -#define I3C_MCTRL_RDTERM_SHIFT (16U) -/*! RDTERM - Read Terminate Counter */ -#define I3C_MCTRL_RDTERM(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCTRL_RDTERM_SHIFT)) & I3C_MCTRL_RDTERM_MASK) -/*! @} */ - -/*! @name MSTATUS - Controller Status */ -/*! @{ */ - -#define I3C_MSTATUS_STATE_MASK (0x7U) -#define I3C_MSTATUS_STATE_SHIFT (0U) -/*! STATE - State of the Controller - * 0b000..IDLE (bus has stopped) - * 0b001..SLVREQ (target request) - * 0b010..MSGSDR - * 0b011..NORMACT - * 0b100..MSGDDR - * 0b101..DAA - * 0b110..IBIACK - * 0b111..IBIRCV - */ -#define I3C_MSTATUS_STATE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_STATE_SHIFT)) & I3C_MSTATUS_STATE_MASK) - -#define I3C_MSTATUS_BETWEEN_MASK (0x10U) -#define I3C_MSTATUS_BETWEEN_SHIFT (4U) -/*! BETWEEN - Between - * 0b0..Inactive (for other cases) - * 0b1..Active - */ -#define I3C_MSTATUS_BETWEEN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_BETWEEN_SHIFT)) & I3C_MSTATUS_BETWEEN_MASK) - -#define I3C_MSTATUS_NACKED_MASK (0x20U) -#define I3C_MSTATUS_NACKED_SHIFT (5U) -/*! NACKED - Not Acknowledged - * 0b1..NACKed (not acknowledged) - * 0b0..Not NACKed - */ -#define I3C_MSTATUS_NACKED(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_NACKED_SHIFT)) & I3C_MSTATUS_NACKED_MASK) - -#define I3C_MSTATUS_IBITYPE_MASK (0xC0U) -#define I3C_MSTATUS_IBITYPE_SHIFT (6U) -/*! IBITYPE - In-Band Interrupt (IBI) Type - * 0b00..NONE (no IBI: this status occurs when MSTATUS[IBIWON] becomes 0) - * 0b01..IBI - * 0b10..CR - * 0b11..HJ - */ -#define I3C_MSTATUS_IBITYPE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_IBITYPE_SHIFT)) & I3C_MSTATUS_IBITYPE_MASK) - -#define I3C_MSTATUS_SLVSTART_MASK (0x100U) -#define I3C_MSTATUS_SLVSTART_SHIFT (8U) -/*! SLVSTART - Target Start - * 0b1..Target requesting START - * 0b0..Target not requesting START - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MSTATUS_SLVSTART(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_SLVSTART_SHIFT)) & I3C_MSTATUS_SLVSTART_MASK) - -#define I3C_MSTATUS_MCTRLDONE_MASK (0x200U) -#define I3C_MSTATUS_MCTRLDONE_SHIFT (9U) -/*! MCTRLDONE - Controller Control Done - * 0b1..Done - * 0b0..Not done - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MSTATUS_MCTRLDONE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_MCTRLDONE_SHIFT)) & I3C_MSTATUS_MCTRLDONE_MASK) - -#define I3C_MSTATUS_COMPLETE_MASK (0x400U) -#define I3C_MSTATUS_COMPLETE_SHIFT (10U) -/*! COMPLETE - Complete - * 0b1..Complete - * 0b0..Not complete - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MSTATUS_COMPLETE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_COMPLETE_SHIFT)) & I3C_MSTATUS_COMPLETE_MASK) - -#define I3C_MSTATUS_RXPEND_MASK (0x800U) -#define I3C_MSTATUS_RXPEND_SHIFT (11U) -/*! RXPEND - RXPEND - * 0b1..Receive message pending - * 0b0..No receive message pending - */ -#define I3C_MSTATUS_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_RXPEND_SHIFT)) & I3C_MSTATUS_RXPEND_MASK) - -#define I3C_MSTATUS_TXNOTFULL_MASK (0x1000U) -#define I3C_MSTATUS_TXNOTFULL_SHIFT (12U) -/*! TXNOTFULL - TX Buffer or FIFO Not Full - * 0b1..Receive buffer or FIFO not full - * 0b0..Receive buffer or FIFO full - */ -#define I3C_MSTATUS_TXNOTFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_TXNOTFULL_SHIFT)) & I3C_MSTATUS_TXNOTFULL_MASK) - -#define I3C_MSTATUS_IBIWON_MASK (0x2000U) -#define I3C_MSTATUS_IBIWON_SHIFT (13U) -/*! IBIWON - In-Band Interrupt (IBI) Won - * 0b1..IBI arbitration won - * 0b0..No IBI arbitration won - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MSTATUS_IBIWON(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_IBIWON_SHIFT)) & I3C_MSTATUS_IBIWON_MASK) - -#define I3C_MSTATUS_ERRWARN_MASK (0x8000U) -#define I3C_MSTATUS_ERRWARN_SHIFT (15U) -/*! ERRWARN - Error or Warning - * 0b1..Error or warning - * 0b0..No error or warning - */ -#define I3C_MSTATUS_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_ERRWARN_SHIFT)) & I3C_MSTATUS_ERRWARN_MASK) - -#define I3C_MSTATUS_NOWMASTER_MASK (0x80000U) -#define I3C_MSTATUS_NOWMASTER_SHIFT (19U) -/*! NOWMASTER - Module is now Controller - * 0b1..Controller - * 0b0..Not a controller - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MSTATUS_NOWMASTER(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_NOWMASTER_SHIFT)) & I3C_MSTATUS_NOWMASTER_MASK) - -#define I3C_MSTATUS_IBIADDR_MASK (0x7F000000U) -#define I3C_MSTATUS_IBIADDR_SHIFT (24U) -/*! IBIADDR - IBI Address */ -#define I3C_MSTATUS_IBIADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_IBIADDR_SHIFT)) & I3C_MSTATUS_IBIADDR_MASK) -/*! @} */ - -/*! @name MIBIRULES - Controller In-band Interrupt Registry and Rules */ -/*! @{ */ - -#define I3C_MIBIRULES_ADDR0_MASK (0x3FU) -#define I3C_MIBIRULES_ADDR0_SHIFT (0U) -/*! ADDR0 - ADDR0 */ -#define I3C_MIBIRULES_ADDR0(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_ADDR0_SHIFT)) & I3C_MIBIRULES_ADDR0_MASK) - -#define I3C_MIBIRULES_ADDR1_MASK (0xFC0U) -#define I3C_MIBIRULES_ADDR1_SHIFT (6U) -/*! ADDR1 - ADDR1 */ -#define I3C_MIBIRULES_ADDR1(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_ADDR1_SHIFT)) & I3C_MIBIRULES_ADDR1_MASK) - -#define I3C_MIBIRULES_ADDR2_MASK (0x3F000U) -#define I3C_MIBIRULES_ADDR2_SHIFT (12U) -/*! ADDR2 - ADDR2 */ -#define I3C_MIBIRULES_ADDR2(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_ADDR2_SHIFT)) & I3C_MIBIRULES_ADDR2_MASK) - -#define I3C_MIBIRULES_ADDR3_MASK (0xFC0000U) -#define I3C_MIBIRULES_ADDR3_SHIFT (18U) -/*! ADDR3 - ADDR3 */ -#define I3C_MIBIRULES_ADDR3(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_ADDR3_SHIFT)) & I3C_MIBIRULES_ADDR3_MASK) - -#define I3C_MIBIRULES_ADDR4_MASK (0x3F000000U) -#define I3C_MIBIRULES_ADDR4_SHIFT (24U) -/*! ADDR4 - ADDR4 */ -#define I3C_MIBIRULES_ADDR4(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_ADDR4_SHIFT)) & I3C_MIBIRULES_ADDR4_MASK) - -#define I3C_MIBIRULES_MSB0_MASK (0x40000000U) -#define I3C_MIBIRULES_MSB0_SHIFT (30U) -/*! MSB0 - Most Significant Address Bit is 0 - * 0b1..MSB is 0 - * 0b0..MSB is not 0 - */ -#define I3C_MIBIRULES_MSB0(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_MSB0_SHIFT)) & I3C_MIBIRULES_MSB0_MASK) - -#define I3C_MIBIRULES_NOBYTE_MASK (0x80000000U) -#define I3C_MIBIRULES_NOBYTE_SHIFT (31U) -/*! NOBYTE - No IBI byte - * 0b1..Without mandatory IBI byte - * 0b0..With mandatory IBI byte - */ -#define I3C_MIBIRULES_NOBYTE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_NOBYTE_SHIFT)) & I3C_MIBIRULES_NOBYTE_MASK) -/*! @} */ - -/*! @name MINTSET - Controller Interrupt Set */ -/*! @{ */ - -#define I3C_MINTSET_SLVSTART_MASK (0x100U) -#define I3C_MINTSET_SLVSTART_SHIFT (8U) -/*! SLVSTART - Target Start Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_SLVSTART(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_SLVSTART_SHIFT)) & I3C_MINTSET_SLVSTART_MASK) - -#define I3C_MINTSET_MCTRLDONE_MASK (0x200U) -#define I3C_MINTSET_MCTRLDONE_SHIFT (9U) -/*! MCTRLDONE - Controller Control Done Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_MCTRLDONE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_MCTRLDONE_SHIFT)) & I3C_MINTSET_MCTRLDONE_MASK) - -#define I3C_MINTSET_COMPLETE_MASK (0x400U) -#define I3C_MINTSET_COMPLETE_SHIFT (10U) -/*! COMPLETE - Completed Message Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_COMPLETE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_COMPLETE_SHIFT)) & I3C_MINTSET_COMPLETE_MASK) - -#define I3C_MINTSET_RXPEND_MASK (0x800U) -#define I3C_MINTSET_RXPEND_SHIFT (11U) -/*! RXPEND - Receive Pending Interrupt Enable */ -#define I3C_MINTSET_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_RXPEND_SHIFT)) & I3C_MINTSET_RXPEND_MASK) - -#define I3C_MINTSET_TXNOTFULL_MASK (0x1000U) -#define I3C_MINTSET_TXNOTFULL_SHIFT (12U) -/*! TXNOTFULL - Transmit Buffer/FIFO Not Full Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_TXNOTFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_TXNOTFULL_SHIFT)) & I3C_MINTSET_TXNOTFULL_MASK) - -#define I3C_MINTSET_IBIWON_MASK (0x2000U) -#define I3C_MINTSET_IBIWON_SHIFT (13U) -/*! IBIWON - IBI Won Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_IBIWON(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_IBIWON_SHIFT)) & I3C_MINTSET_IBIWON_MASK) - -#define I3C_MINTSET_ERRWARN_MASK (0x8000U) -#define I3C_MINTSET_ERRWARN_SHIFT (15U) -/*! ERRWARN - Error or Warning (ERRWARN) Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_ERRWARN_SHIFT)) & I3C_MINTSET_ERRWARN_MASK) - -#define I3C_MINTSET_NOWMASTER_MASK (0x80000U) -#define I3C_MINTSET_NOWMASTER_SHIFT (19U) -/*! NOWMASTER - Now Controller Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_NOWMASTER(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_NOWMASTER_SHIFT)) & I3C_MINTSET_NOWMASTER_MASK) -/*! @} */ - -/*! @name MINTCLR - Controller Interrupt Clear */ -/*! @{ */ - -#define I3C_MINTCLR_SLVSTART_MASK (0x100U) -#define I3C_MINTCLR_SLVSTART_SHIFT (8U) -/*! SLVSTART - SLVSTART Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_SLVSTART(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_SLVSTART_SHIFT)) & I3C_MINTCLR_SLVSTART_MASK) - -#define I3C_MINTCLR_MCTRLDONE_MASK (0x200U) -#define I3C_MINTCLR_MCTRLDONE_SHIFT (9U) -/*! MCTRLDONE - MCTRLDONE Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_MCTRLDONE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_MCTRLDONE_SHIFT)) & I3C_MINTCLR_MCTRLDONE_MASK) - -#define I3C_MINTCLR_COMPLETE_MASK (0x400U) -#define I3C_MINTCLR_COMPLETE_SHIFT (10U) -/*! COMPLETE - COMPLETE Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_COMPLETE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_COMPLETE_SHIFT)) & I3C_MINTCLR_COMPLETE_MASK) - -#define I3C_MINTCLR_RXPEND_MASK (0x800U) -#define I3C_MINTCLR_RXPEND_SHIFT (11U) -/*! RXPEND - RXPEND Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_RXPEND_SHIFT)) & I3C_MINTCLR_RXPEND_MASK) - -#define I3C_MINTCLR_TXNOTFULL_MASK (0x1000U) -#define I3C_MINTCLR_TXNOTFULL_SHIFT (12U) -/*! TXNOTFULL - TXNOTFULL Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_TXNOTFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_TXNOTFULL_SHIFT)) & I3C_MINTCLR_TXNOTFULL_MASK) - -#define I3C_MINTCLR_IBIWON_MASK (0x2000U) -#define I3C_MINTCLR_IBIWON_SHIFT (13U) -/*! IBIWON - IBIWON Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_IBIWON(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_IBIWON_SHIFT)) & I3C_MINTCLR_IBIWON_MASK) - -#define I3C_MINTCLR_ERRWARN_MASK (0x8000U) -#define I3C_MINTCLR_ERRWARN_SHIFT (15U) -/*! ERRWARN - ERRWARN Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_ERRWARN_SHIFT)) & I3C_MINTCLR_ERRWARN_MASK) - -#define I3C_MINTCLR_NOWMASTER_MASK (0x80000U) -#define I3C_MINTCLR_NOWMASTER_SHIFT (19U) -/*! NOWMASTER - NOWCONTROLLER Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_NOWMASTER(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_NOWMASTER_SHIFT)) & I3C_MINTCLR_NOWMASTER_MASK) -/*! @} */ - -/*! @name MINTMASKED - Controller Interrupt Mask */ -/*! @{ */ - -#define I3C_MINTMASKED_SLVSTART_MASK (0x100U) -#define I3C_MINTMASKED_SLVSTART_SHIFT (8U) -/*! SLVSTART - SLVSTART Interrupt Mask - * 0b1..Enabled - * 0b0..Disabled - */ -#define I3C_MINTMASKED_SLVSTART(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_SLVSTART_SHIFT)) & I3C_MINTMASKED_SLVSTART_MASK) - -#define I3C_MINTMASKED_MCTRLDONE_MASK (0x200U) -#define I3C_MINTMASKED_MCTRLDONE_SHIFT (9U) -/*! MCTRLDONE - MCTRLDONE Interrupt Mask - * 0b1..Enabled - * 0b0..Disabled - */ -#define I3C_MINTMASKED_MCTRLDONE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_MCTRLDONE_SHIFT)) & I3C_MINTMASKED_MCTRLDONE_MASK) - -#define I3C_MINTMASKED_COMPLETE_MASK (0x400U) -#define I3C_MINTMASKED_COMPLETE_SHIFT (10U) -/*! COMPLETE - COMPLETE Interrupt Mask - * 0b1..Enabled - * 0b0..Disabled - */ -#define I3C_MINTMASKED_COMPLETE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_COMPLETE_SHIFT)) & I3C_MINTMASKED_COMPLETE_MASK) - -#define I3C_MINTMASKED_RXPEND_MASK (0x800U) -#define I3C_MINTMASKED_RXPEND_SHIFT (11U) -/*! RXPEND - RXPEND Interrupt Mask */ -#define I3C_MINTMASKED_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_RXPEND_SHIFT)) & I3C_MINTMASKED_RXPEND_MASK) - -#define I3C_MINTMASKED_TXNOTFULL_MASK (0x1000U) -#define I3C_MINTMASKED_TXNOTFULL_SHIFT (12U) -/*! TXNOTFULL - TXNOTFULL Interrupt Mask - * 0b1..Enabled - * 0b0..Disabled - */ -#define I3C_MINTMASKED_TXNOTFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_TXNOTFULL_SHIFT)) & I3C_MINTMASKED_TXNOTFULL_MASK) - -#define I3C_MINTMASKED_IBIWON_MASK (0x2000U) -#define I3C_MINTMASKED_IBIWON_SHIFT (13U) -/*! IBIWON - IBIWON Interrupt Mask - * 0b1..Enabled - * 0b0..Disabled - */ -#define I3C_MINTMASKED_IBIWON(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_IBIWON_SHIFT)) & I3C_MINTMASKED_IBIWON_MASK) - -#define I3C_MINTMASKED_ERRWARN_MASK (0x8000U) -#define I3C_MINTMASKED_ERRWARN_SHIFT (15U) -/*! ERRWARN - ERRWARN Interrupt Mask - * 0b1..Enabled - * 0b0..Disabled - */ -#define I3C_MINTMASKED_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_ERRWARN_SHIFT)) & I3C_MINTMASKED_ERRWARN_MASK) - -#define I3C_MINTMASKED_NOWMASTER_MASK (0x80000U) -#define I3C_MINTMASKED_NOWMASTER_SHIFT (19U) -/*! NOWMASTER - NOWCONTROLLER Interrupt Mask - * 0b1..Enabled - * 0b0..Disabled - */ -#define I3C_MINTMASKED_NOWMASTER(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_NOWMASTER_SHIFT)) & I3C_MINTMASKED_NOWMASTER_MASK) -/*! @} */ - -/*! @name MERRWARN - Controller Errors and Warnings */ -/*! @{ */ - -#define I3C_MERRWARN_URUN_MASK (0x2U) -#define I3C_MERRWARN_URUN_SHIFT (1U) -/*! URUN - Underrun Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_URUN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_URUN_SHIFT)) & I3C_MERRWARN_URUN_MASK) - -#define I3C_MERRWARN_NACK_MASK (0x4U) -#define I3C_MERRWARN_NACK_SHIFT (2U) -/*! NACK - Not Acknowledge Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_NACK(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_NACK_SHIFT)) & I3C_MERRWARN_NACK_MASK) - -#define I3C_MERRWARN_WRABT_MASK (0x8U) -#define I3C_MERRWARN_WRABT_SHIFT (3U) -/*! WRABT - Write Abort Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_WRABT(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_WRABT_SHIFT)) & I3C_MERRWARN_WRABT_MASK) - -#define I3C_MERRWARN_TERM_MASK (0x10U) -#define I3C_MERRWARN_TERM_SHIFT (4U) -/*! TERM - Terminate Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_TERM(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_TERM_SHIFT)) & I3C_MERRWARN_TERM_MASK) - -#define I3C_MERRWARN_HPAR_MASK (0x200U) -#define I3C_MERRWARN_HPAR_SHIFT (9U) -/*! HPAR - High Data Rate Parity - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_HPAR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_HPAR_SHIFT)) & I3C_MERRWARN_HPAR_MASK) - -#define I3C_MERRWARN_HCRC_MASK (0x400U) -#define I3C_MERRWARN_HCRC_SHIFT (10U) -/*! HCRC - High Data Rate CRC Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_HCRC(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_HCRC_SHIFT)) & I3C_MERRWARN_HCRC_MASK) - -#define I3C_MERRWARN_OREAD_MASK (0x10000U) -#define I3C_MERRWARN_OREAD_SHIFT (16U) -/*! OREAD - Overread Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_OREAD(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_OREAD_SHIFT)) & I3C_MERRWARN_OREAD_MASK) - -#define I3C_MERRWARN_OWRITE_MASK (0x20000U) -#define I3C_MERRWARN_OWRITE_SHIFT (17U) -/*! OWRITE - Overwrite Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_OWRITE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_OWRITE_SHIFT)) & I3C_MERRWARN_OWRITE_MASK) - -#define I3C_MERRWARN_MSGERR_MASK (0x40000U) -#define I3C_MERRWARN_MSGERR_SHIFT (18U) -/*! MSGERR - Message Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_MSGERR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_MSGERR_SHIFT)) & I3C_MERRWARN_MSGERR_MASK) - -#define I3C_MERRWARN_INVREQ_MASK (0x80000U) -#define I3C_MERRWARN_INVREQ_SHIFT (19U) -/*! INVREQ - Invalid Request Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_INVREQ(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_INVREQ_SHIFT)) & I3C_MERRWARN_INVREQ_MASK) - -#define I3C_MERRWARN_TIMEOUT_MASK (0x100000U) -#define I3C_MERRWARN_TIMEOUT_SHIFT (20U) -/*! TIMEOUT - Timeout Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_TIMEOUT(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_TIMEOUT_SHIFT)) & I3C_MERRWARN_TIMEOUT_MASK) -/*! @} */ - -/*! @name MDMACTRL - Controller DMA Control */ -/*! @{ */ - -#define I3C_MDMACTRL_DMAFB_MASK (0x3U) -#define I3C_MDMACTRL_DMAFB_SHIFT (0U) -/*! DMAFB - DMA from Bus - * 0b00..DMA not used - * 0b01..Enable DMA for one frame - * 0b10..Enable DMA until DMA is turned off - * 0b11.. - */ -#define I3C_MDMACTRL_DMAFB(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDMACTRL_DMAFB_SHIFT)) & I3C_MDMACTRL_DMAFB_MASK) - -#define I3C_MDMACTRL_DMATB_MASK (0xCU) -#define I3C_MDMACTRL_DMATB_SHIFT (2U) -/*! DMATB - DMA to Bus - * 0b00..DMA not used - * 0b01..Enable DMA for one frame (ended by DMA or terminated) - * 0b10..Enable DMA until DMA is turned off - * 0b11.. - */ -#define I3C_MDMACTRL_DMATB(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDMACTRL_DMATB_SHIFT)) & I3C_MDMACTRL_DMATB_MASK) - -#define I3C_MDMACTRL_DMAWIDTH_MASK (0x30U) -#define I3C_MDMACTRL_DMAWIDTH_SHIFT (4U) -/*! DMAWIDTH - DMA Width - * 0b00, 0b01..Byte - * 0b10..Halfword (16 bits) - * 0b11.. - */ -#define I3C_MDMACTRL_DMAWIDTH(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDMACTRL_DMAWIDTH_SHIFT)) & I3C_MDMACTRL_DMAWIDTH_MASK) -/*! @} */ - -/*! @name MDATACTRL - Controller Data Control */ -/*! @{ */ - -#define I3C_MDATACTRL_FLUSHTB_MASK (0x1U) -#define I3C_MDATACTRL_FLUSHTB_SHIFT (0U) -/*! FLUSHTB - Flush To-Bus Buffer or FIFO - * 0b1..Flush the buffer - * 0b0..No action - */ -#define I3C_MDATACTRL_FLUSHTB(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_FLUSHTB_SHIFT)) & I3C_MDATACTRL_FLUSHTB_MASK) - -#define I3C_MDATACTRL_FLUSHFB_MASK (0x2U) -#define I3C_MDATACTRL_FLUSHFB_SHIFT (1U) -/*! FLUSHFB - Flush From-Bus Buffer or FIFO - * 0b1..Flush the buffer - * 0b0..No action - */ -#define I3C_MDATACTRL_FLUSHFB(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_FLUSHFB_SHIFT)) & I3C_MDATACTRL_FLUSHFB_MASK) - -#define I3C_MDATACTRL_UNLOCK_MASK (0x8U) -#define I3C_MDATACTRL_UNLOCK_SHIFT (3U) -/*! UNLOCK - Unlock - * 0b0..Locked - * 0b1..Unlocked - */ -#define I3C_MDATACTRL_UNLOCK(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_UNLOCK_SHIFT)) & I3C_MDATACTRL_UNLOCK_MASK) - -#define I3C_MDATACTRL_TXTRIG_MASK (0x30U) -#define I3C_MDATACTRL_TXTRIG_SHIFT (4U) -/*! TXTRIG - Transmit Trigger Level - * 0b00..Trigger when empty - * 0b01..Trigger when 1/4 full or less - * 0b10..Trigger when 1/2 full or less - * 0b11..Trigger when 1 less than full or less (default) - */ -#define I3C_MDATACTRL_TXTRIG(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_TXTRIG_SHIFT)) & I3C_MDATACTRL_TXTRIG_MASK) - -#define I3C_MDATACTRL_RXTRIG_MASK (0xC0U) -#define I3C_MDATACTRL_RXTRIG_SHIFT (6U) -/*! RXTRIG - Receive Trigger Level - * 0b00..Trigger when not empty - * 0b01..Trigger when 1/4 full or more - * 0b10..Trigger when 1/2 full or more - * 0b11..Trigger when 3/4 full or more - */ -#define I3C_MDATACTRL_RXTRIG(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_RXTRIG_SHIFT)) & I3C_MDATACTRL_RXTRIG_MASK) - -#define I3C_MDATACTRL_TXCOUNT_MASK (0x1F0000U) -#define I3C_MDATACTRL_TXCOUNT_SHIFT (16U) -/*! TXCOUNT - Transmit Byte Count */ -#define I3C_MDATACTRL_TXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_TXCOUNT_SHIFT)) & I3C_MDATACTRL_TXCOUNT_MASK) - -#define I3C_MDATACTRL_RXCOUNT_MASK (0x1F000000U) -#define I3C_MDATACTRL_RXCOUNT_SHIFT (24U) -/*! RXCOUNT - Receive Byte Count */ -#define I3C_MDATACTRL_RXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_RXCOUNT_SHIFT)) & I3C_MDATACTRL_RXCOUNT_MASK) - -#define I3C_MDATACTRL_TXFULL_MASK (0x40000000U) -#define I3C_MDATACTRL_TXFULL_SHIFT (30U) -/*! TXFULL - Transmit is Full - * 0b0..Not full - * 0b1..Full - */ -#define I3C_MDATACTRL_TXFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_TXFULL_SHIFT)) & I3C_MDATACTRL_TXFULL_MASK) - -#define I3C_MDATACTRL_RXEMPTY_MASK (0x80000000U) -#define I3C_MDATACTRL_RXEMPTY_SHIFT (31U) -/*! RXEMPTY - Receive is Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define I3C_MDATACTRL_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_RXEMPTY_SHIFT)) & I3C_MDATACTRL_RXEMPTY_MASK) -/*! @} */ - -/*! @name MWDATAB - Controller Write Data Byte */ -/*! @{ */ - -#define I3C_MWDATAB_VALUE_MASK (0xFFU) -#define I3C_MWDATAB_VALUE_SHIFT (0U) -/*! VALUE - Data Byte */ -#define I3C_MWDATAB_VALUE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAB_VALUE_SHIFT)) & I3C_MWDATAB_VALUE_MASK) - -#define I3C_MWDATAB_END_MASK (0x100U) -#define I3C_MWDATAB_END_SHIFT (8U) -/*! END - End of Message - * 0b0..Not the end - * 0b1..End - */ -#define I3C_MWDATAB_END(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAB_END_SHIFT)) & I3C_MWDATAB_END_MASK) - -#define I3C_MWDATAB_END_ALSO_MASK (0x10000U) -#define I3C_MWDATAB_END_ALSO_SHIFT (16U) -/*! END_ALSO - End of Message ALSO - * 0b0..Not the end - * 0b1..End - */ -#define I3C_MWDATAB_END_ALSO(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAB_END_ALSO_SHIFT)) & I3C_MWDATAB_END_ALSO_MASK) -/*! @} */ - -/*! @name MWDATABE - Controller Write Data Byte End */ -/*! @{ */ - -#define I3C_MWDATABE_VALUE_MASK (0xFFU) -#define I3C_MWDATABE_VALUE_SHIFT (0U) -/*! VALUE - Data */ -#define I3C_MWDATABE_VALUE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATABE_VALUE_SHIFT)) & I3C_MWDATABE_VALUE_MASK) -/*! @} */ - -/*! @name MWDATAH - Controller Write Data Halfword */ -/*! @{ */ - -#define I3C_MWDATAH_DATA0_MASK (0xFFU) -#define I3C_MWDATAH_DATA0_SHIFT (0U) -/*! DATA0 - Data Byte 0 */ -#define I3C_MWDATAH_DATA0(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAH_DATA0_SHIFT)) & I3C_MWDATAH_DATA0_MASK) - -#define I3C_MWDATAH_DATA1_MASK (0xFF00U) -#define I3C_MWDATAH_DATA1_SHIFT (8U) -/*! DATA1 - Data Byte 1 */ -#define I3C_MWDATAH_DATA1(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAH_DATA1_SHIFT)) & I3C_MWDATAH_DATA1_MASK) - -#define I3C_MWDATAH_END_MASK (0x10000U) -#define I3C_MWDATAH_END_SHIFT (16U) -/*! END - End of Message - * 0b0..Not the end - * 0b1..End - */ -#define I3C_MWDATAH_END(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAH_END_SHIFT)) & I3C_MWDATAH_END_MASK) -/*! @} */ - -/*! @name MWDATAHE - Controller Write Data Halfword End */ -/*! @{ */ - -#define I3C_MWDATAHE_DATA0_MASK (0xFFU) -#define I3C_MWDATAHE_DATA0_SHIFT (0U) -/*! DATA0 - Data Byte 0 */ -#define I3C_MWDATAHE_DATA0(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAHE_DATA0_SHIFT)) & I3C_MWDATAHE_DATA0_MASK) - -#define I3C_MWDATAHE_DATA1_MASK (0xFF00U) -#define I3C_MWDATAHE_DATA1_SHIFT (8U) -/*! DATA1 - Data Byte 1 */ -#define I3C_MWDATAHE_DATA1(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAHE_DATA1_SHIFT)) & I3C_MWDATAHE_DATA1_MASK) -/*! @} */ - -/*! @name MRDATAB - Controller Read Data Byte */ -/*! @{ */ - -#define I3C_MRDATAB_VALUE_MASK (0xFFU) -#define I3C_MRDATAB_VALUE_SHIFT (0U) -/*! VALUE - Value */ -#define I3C_MRDATAB_VALUE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MRDATAB_VALUE_SHIFT)) & I3C_MRDATAB_VALUE_MASK) -/*! @} */ - -/*! @name MRDATAH - Controller Read Data Halfword */ -/*! @{ */ - -#define I3C_MRDATAH_LSB_MASK (0xFFU) -#define I3C_MRDATAH_LSB_SHIFT (0U) -/*! LSB - Low Byte */ -#define I3C_MRDATAH_LSB(x) (((uint32_t)(((uint32_t)(x)) << I3C_MRDATAH_LSB_SHIFT)) & I3C_MRDATAH_LSB_MASK) - -#define I3C_MRDATAH_MSB_MASK (0xFF00U) -#define I3C_MRDATAH_MSB_SHIFT (8U) -/*! MSB - High Byte */ -#define I3C_MRDATAH_MSB(x) (((uint32_t)(((uint32_t)(x)) << I3C_MRDATAH_MSB_SHIFT)) & I3C_MRDATAH_MSB_MASK) -/*! @} */ - -/*! @name MWDATAB1 - Controller Write Byte Data 1 (to Bus) */ -/*! @{ */ - -#define I3C_MWDATAB1_VALUE_MASK (0xFFU) -#define I3C_MWDATAB1_VALUE_SHIFT (0U) -/*! VALUE - Value */ -#define I3C_MWDATAB1_VALUE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAB1_VALUE_SHIFT)) & I3C_MWDATAB1_VALUE_MASK) -/*! @} */ - -/*! @name MWDATAH1 - Controller Write Halfword Data (to Bus) */ -/*! @{ */ - -#define I3C_MWDATAH1_VALUE_MASK (0xFFFFU) -#define I3C_MWDATAH1_VALUE_SHIFT (0U) -/*! VALUE - Value */ -#define I3C_MWDATAH1_VALUE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAH1_VALUE_SHIFT)) & I3C_MWDATAH1_VALUE_MASK) -/*! @} */ - -/*! @name MWMSG_SDR_CONTROL - Controller Write Message Control in SDR mode */ -/*! @{ */ - -#define I3C_MWMSG_SDR_CONTROL_DIR_MASK (0x1U) -#define I3C_MWMSG_SDR_CONTROL_DIR_SHIFT (0U) -/*! DIR - Direction - * 0b0..Write - * 0b1..Read - */ -#define I3C_MWMSG_SDR_CONTROL_DIR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_SDR_CONTROL_DIR_SHIFT)) & I3C_MWMSG_SDR_CONTROL_DIR_MASK) - -#define I3C_MWMSG_SDR_CONTROL_ADDR_MASK (0xFEU) -#define I3C_MWMSG_SDR_CONTROL_ADDR_SHIFT (1U) -/*! ADDR - Address */ -#define I3C_MWMSG_SDR_CONTROL_ADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_SDR_CONTROL_ADDR_SHIFT)) & I3C_MWMSG_SDR_CONTROL_ADDR_MASK) - -#define I3C_MWMSG_SDR_CONTROL_END_MASK (0x100U) -#define I3C_MWMSG_SDR_CONTROL_END_SHIFT (8U) -/*! END - End of SDR Message - * 0b0..Not the end - * 0b1..End - */ -#define I3C_MWMSG_SDR_CONTROL_END(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_SDR_CONTROL_END_SHIFT)) & I3C_MWMSG_SDR_CONTROL_END_MASK) - -#define I3C_MWMSG_SDR_CONTROL_I2C_MASK (0x400U) -#define I3C_MWMSG_SDR_CONTROL_I2C_SHIFT (10U) -/*! I2C - I2C - * 0b0..I3C message - * 0b1..I2C message - */ -#define I3C_MWMSG_SDR_CONTROL_I2C(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_SDR_CONTROL_I2C_SHIFT)) & I3C_MWMSG_SDR_CONTROL_I2C_MASK) - -#define I3C_MWMSG_SDR_CONTROL_LEN_MASK (0xF800U) -#define I3C_MWMSG_SDR_CONTROL_LEN_SHIFT (11U) -/*! LEN - Length */ -#define I3C_MWMSG_SDR_CONTROL_LEN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_SDR_CONTROL_LEN_SHIFT)) & I3C_MWMSG_SDR_CONTROL_LEN_MASK) -/*! @} */ - -/*! @name MWMSG_SDR_DATA - Controller Write Message Data in SDR mode */ -/*! @{ */ - -#define I3C_MWMSG_SDR_DATA_DATA16B_MASK (0xFFFFU) -#define I3C_MWMSG_SDR_DATA_DATA16B_SHIFT (0U) -/*! DATA16B - Data */ -#define I3C_MWMSG_SDR_DATA_DATA16B(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_SDR_DATA_DATA16B_SHIFT)) & I3C_MWMSG_SDR_DATA_DATA16B_MASK) -/*! @} */ - -/*! @name MRMSG_SDR - Controller Read Message in SDR mode */ -/*! @{ */ - -#define I3C_MRMSG_SDR_DATA_MASK (0xFFFFU) -#define I3C_MRMSG_SDR_DATA_SHIFT (0U) -/*! DATA - Data */ -#define I3C_MRMSG_SDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_MRMSG_SDR_DATA_SHIFT)) & I3C_MRMSG_SDR_DATA_MASK) -/*! @} */ - -/*! @name MWMSG_DDR_CONTROL - Controller Write Message in DDR mode: First Control Word */ -/*! @{ */ - -#define I3C_MWMSG_DDR_CONTROL_ADDRCMD_MASK (0xFFFFU) -#define I3C_MWMSG_DDR_CONTROL_ADDRCMD_SHIFT (0U) -/*! ADDRCMD - Address Command */ -#define I3C_MWMSG_DDR_CONTROL_ADDRCMD(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_DDR_CONTROL_ADDRCMD_SHIFT)) & I3C_MWMSG_DDR_CONTROL_ADDRCMD_MASK) -/*! @} */ - -/*! @name MWMSG_DDR_CONTROL2 - Controller Write Message in DDR Mode Control 2 */ -/*! @{ */ - -#define I3C_MWMSG_DDR_CONTROL2_LEN_MASK (0x3FFU) -#define I3C_MWMSG_DDR_CONTROL2_LEN_SHIFT (0U) -/*! LEN - Length of Message */ -#define I3C_MWMSG_DDR_CONTROL2_LEN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_DDR_CONTROL2_LEN_SHIFT)) & I3C_MWMSG_DDR_CONTROL2_LEN_MASK) - -#define I3C_MWMSG_DDR_CONTROL2_END_MASK (0x4000U) -#define I3C_MWMSG_DDR_CONTROL2_END_SHIFT (14U) -/*! END - End of Message - * 0b1..End - * 0b0..Not the end - */ -#define I3C_MWMSG_DDR_CONTROL2_END(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_DDR_CONTROL2_END_SHIFT)) & I3C_MWMSG_DDR_CONTROL2_END_MASK) -/*! @} */ - -/*! @name MWMSG_DDR_DATA - Controller Write Message Data in DDR mode */ -/*! @{ */ - -#define I3C_MWMSG_DDR_DATA_DATA16B_MASK (0xFFFFU) -#define I3C_MWMSG_DDR_DATA_DATA16B_SHIFT (0U) -/*! DATA16B - Data */ -#define I3C_MWMSG_DDR_DATA_DATA16B(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_DDR_DATA_DATA16B_SHIFT)) & I3C_MWMSG_DDR_DATA_DATA16B_MASK) -/*! @} */ - -/*! @name MRMSG_DDR - Controller Read Message in DDR mode */ -/*! @{ */ - -#define I3C_MRMSG_DDR_DATA_MASK (0xFFFFU) -#define I3C_MRMSG_DDR_DATA_SHIFT (0U) -/*! DATA - Data */ -#define I3C_MRMSG_DDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_MRMSG_DDR_DATA_SHIFT)) & I3C_MRMSG_DDR_DATA_MASK) -/*! @} */ - -/*! @name MDYNADDR - Controller Dynamic Address */ -/*! @{ */ - -#define I3C_MDYNADDR_DAVALID_MASK (0x1U) -#define I3C_MDYNADDR_DAVALID_SHIFT (0U) -/*! DAVALID - Dynamic Address Valid - * 0b1..Valid DA assigned - * 0b0..No valid DA assigned - */ -#define I3C_MDYNADDR_DAVALID(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDYNADDR_DAVALID_SHIFT)) & I3C_MDYNADDR_DAVALID_MASK) - -#define I3C_MDYNADDR_DADDR_MASK (0xFEU) -#define I3C_MDYNADDR_DADDR_SHIFT (1U) -/*! DADDR - Dynamic Address */ -#define I3C_MDYNADDR_DADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDYNADDR_DADDR_SHIFT)) & I3C_MDYNADDR_DADDR_MASK) -/*! @} */ - -/*! @name SMAPCTRL0 - Map Feature Control 0 */ -/*! @{ */ - -#define I3C_SMAPCTRL0_ENA_MASK (0x1U) -#define I3C_SMAPCTRL0_ENA_SHIFT (0U) -/*! ENA - Enable Primary Dynamic Address - * 0b0..Disabled - * 0b1..Enabled - */ -#define I3C_SMAPCTRL0_ENA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMAPCTRL0_ENA_SHIFT)) & I3C_SMAPCTRL0_ENA_MASK) - -#define I3C_SMAPCTRL0_DA_MASK (0xFEU) -#define I3C_SMAPCTRL0_DA_SHIFT (1U) -/*! DA - Dynamic Address */ -#define I3C_SMAPCTRL0_DA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMAPCTRL0_DA_SHIFT)) & I3C_SMAPCTRL0_DA_MASK) - -#define I3C_SMAPCTRL0_CAUSE_MASK (0x700U) -#define I3C_SMAPCTRL0_CAUSE_SHIFT (8U) -/*! CAUSE - Cause - * 0b000..No information (this value occurs when not configured to write DA) - * 0b001..Set using ENTDAA - * 0b010..Set using SETDASA, SETAASA, or SETNEWDA - * 0b011..Cleared using RSTDAA - * 0b100..Auto MAP change happened last - * *.. - */ -#define I3C_SMAPCTRL0_CAUSE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMAPCTRL0_CAUSE_SHIFT)) & I3C_SMAPCTRL0_CAUSE_MASK) -/*! @} */ - -/*! @name IBIEXT1 - Extended IBI Data 1 */ -/*! @{ */ - -#define I3C_IBIEXT1_CNT_MASK (0x7U) -#define I3C_IBIEXT1_CNT_SHIFT (0U) -/*! CNT - Count */ -#define I3C_IBIEXT1_CNT(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT1_CNT_SHIFT)) & I3C_IBIEXT1_CNT_MASK) - -#define I3C_IBIEXT1_MAX_MASK (0x70U) -#define I3C_IBIEXT1_MAX_SHIFT (4U) -/*! MAX - Maximum */ -#define I3C_IBIEXT1_MAX(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT1_MAX_SHIFT)) & I3C_IBIEXT1_MAX_MASK) - -#define I3C_IBIEXT1_EXT1_MASK (0xFF00U) -#define I3C_IBIEXT1_EXT1_SHIFT (8U) -/*! EXT1 - Extra Byte 1 */ -#define I3C_IBIEXT1_EXT1(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT1_EXT1_SHIFT)) & I3C_IBIEXT1_EXT1_MASK) - -#define I3C_IBIEXT1_EXT2_MASK (0xFF0000U) -#define I3C_IBIEXT1_EXT2_SHIFT (16U) -/*! EXT2 - Extra Byte 2 */ -#define I3C_IBIEXT1_EXT2(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT1_EXT2_SHIFT)) & I3C_IBIEXT1_EXT2_MASK) - -#define I3C_IBIEXT1_EXT3_MASK (0xFF000000U) -#define I3C_IBIEXT1_EXT3_SHIFT (24U) -/*! EXT3 - Extra Byte 3 */ -#define I3C_IBIEXT1_EXT3(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT1_EXT3_SHIFT)) & I3C_IBIEXT1_EXT3_MASK) -/*! @} */ - -/*! @name IBIEXT2 - Extended IBI Data 2 */ -/*! @{ */ - -#define I3C_IBIEXT2_EXT4_MASK (0xFFU) -#define I3C_IBIEXT2_EXT4_SHIFT (0U) -/*! EXT4 - Extra Byte 4 */ -#define I3C_IBIEXT2_EXT4(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT2_EXT4_SHIFT)) & I3C_IBIEXT2_EXT4_MASK) - -#define I3C_IBIEXT2_EXT5_MASK (0xFF00U) -#define I3C_IBIEXT2_EXT5_SHIFT (8U) -/*! EXT5 - Extra Byte 5 */ -#define I3C_IBIEXT2_EXT5(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT2_EXT5_SHIFT)) & I3C_IBIEXT2_EXT5_MASK) - -#define I3C_IBIEXT2_EXT6_MASK (0xFF0000U) -#define I3C_IBIEXT2_EXT6_SHIFT (16U) -/*! EXT6 - Extra Byte 6 */ -#define I3C_IBIEXT2_EXT6(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT2_EXT6_SHIFT)) & I3C_IBIEXT2_EXT6_MASK) - -#define I3C_IBIEXT2_EXT7_MASK (0xFF000000U) -#define I3C_IBIEXT2_EXT7_SHIFT (24U) -/*! EXT7 - Extra Byte 7 */ -#define I3C_IBIEXT2_EXT7(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT2_EXT7_SHIFT)) & I3C_IBIEXT2_EXT7_MASK) -/*! @} */ - -/*! @name SID - Target Module ID */ -/*! @{ */ - -#define I3C_SID_ID_MASK (0xFFFFFFFFU) -#define I3C_SID_ID_SHIFT (0U) -/*! ID - ID */ -#define I3C_SID_ID(x) (((uint32_t)(((uint32_t)(x)) << I3C_SID_ID_SHIFT)) & I3C_SID_ID_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group I3C_Register_Masks */ - - -/* I3C - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral I3C0 base address */ - #define I3C0_BASE (0x50021000u) - /** Peripheral I3C0 base address */ - #define I3C0_BASE_NS (0x40021000u) - /** Peripheral I3C0 base pointer */ - #define I3C0 ((I3C_Type *)I3C0_BASE) - /** Peripheral I3C0 base pointer */ - #define I3C0_NS ((I3C_Type *)I3C0_BASE_NS) - /** Peripheral I3C1 base address */ - #define I3C1_BASE (0x50022000u) - /** Peripheral I3C1 base address */ - #define I3C1_BASE_NS (0x40022000u) - /** Peripheral I3C1 base pointer */ - #define I3C1 ((I3C_Type *)I3C1_BASE) - /** Peripheral I3C1 base pointer */ - #define I3C1_NS ((I3C_Type *)I3C1_BASE_NS) - /** Array initializer of I3C peripheral base addresses */ - #define I3C_BASE_ADDRS { I3C0_BASE, I3C1_BASE } - /** Array initializer of I3C peripheral base pointers */ - #define I3C_BASE_PTRS { I3C0, I3C1 } - /** Array initializer of I3C peripheral base addresses */ - #define I3C_BASE_ADDRS_NS { I3C0_BASE_NS, I3C1_BASE_NS } - /** Array initializer of I3C peripheral base pointers */ - #define I3C_BASE_PTRS_NS { I3C0_NS, I3C1_NS } -#else - /** Peripheral I3C0 base address */ - #define I3C0_BASE (0x40021000u) - /** Peripheral I3C0 base pointer */ - #define I3C0 ((I3C_Type *)I3C0_BASE) - /** Peripheral I3C1 base address */ - #define I3C1_BASE (0x40022000u) - /** Peripheral I3C1 base pointer */ - #define I3C1 ((I3C_Type *)I3C1_BASE) - /** Array initializer of I3C peripheral base addresses */ - #define I3C_BASE_ADDRS { I3C0_BASE, I3C1_BASE } - /** Array initializer of I3C peripheral base pointers */ - #define I3C_BASE_PTRS { I3C0, I3C1 } -#endif -/** Interrupt vectors for the I3C peripheral type */ -#define I3C_IRQS { I3C0_IRQn, I3C1_IRQn } - -/*! - * @} - */ /* end of group I3C_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- INPUTMUX Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup INPUTMUX_Peripheral_Access_Layer INPUTMUX Peripheral Access Layer - * @{ - */ - -/** INPUTMUX - Register Layout Typedef */ -typedef struct { - uint8_t RESERVED_0[32]; - __IO uint32_t CTIMER0CAP0; /**< Capture Select Register for CTIMER Inputs, offset: 0x20 */ - __IO uint32_t CTIMER0CAP1; /**< Capture Select Register for CTIMER Inputs, offset: 0x24 */ - __IO uint32_t CTIMER0CAP2; /**< Capture Select Register for CTIMER Inputs, offset: 0x28 */ - __IO uint32_t CTIMER0CAP3; /**< Capture Select Register for CTIMER Inputs, offset: 0x2C */ - __IO uint32_t TIMER0TRIG; /**< Trigger Register for CTIMER, offset: 0x30 */ - uint8_t RESERVED_1[12]; - __IO uint32_t CTIMER1CAP0; /**< Capture Select Register for CTIMER Inputs, offset: 0x40 */ - __IO uint32_t CTIMER1CAP1; /**< Capture Select Register for CTIMER Inputs, offset: 0x44 */ - __IO uint32_t CTIMER1CAP2; /**< Capture Select Register for CTIMER Inputs, offset: 0x48 */ - __IO uint32_t CTIMER1CAP3; /**< Capture Select Register for CTIMER Inputs, offset: 0x4C */ - __IO uint32_t TIMER1TRIG; /**< Trigger Register for CTIMER, offset: 0x50 */ - uint8_t RESERVED_2[12]; - __IO uint32_t CTIMER2CAP0; /**< Capture Select Register for CTIMER Inputs, offset: 0x60 */ - __IO uint32_t CTIMER2CAP1; /**< Capture Select Register for CTIMER Inputs, offset: 0x64 */ - __IO uint32_t CTIMER2CAP2; /**< Capture Select Register for CTIMER Inputs, offset: 0x68 */ - __IO uint32_t CTIMER2CAP3; /**< Capture Select Register for CTIMER Inputs, offset: 0x6C */ - __IO uint32_t TIMER2TRIG; /**< Trigger Register for CTIMER, offset: 0x70 */ - uint8_t RESERVED_3[44]; - __IO uint32_t SMARTDMAARCHB_INMUX[8]; /**< Inputmux Register for SMARTDMA Arch B Inputs, array offset: 0xA0, array step: 0x4 */ - __IO uint32_t PINTSEL[8]; /**< Pin Interrupt Select, array offset: 0xC0, array step: 0x4 */ - uint8_t RESERVED_4[160]; - __IO uint32_t FREQMEAS_REF; /**< Selection for Frequency Measurement Reference Clock, offset: 0x180 */ - __IO uint32_t FREQMEAS_TAR; /**< Selection for Frequency Measurement Target Clock, offset: 0x184 */ - uint8_t RESERVED_5[24]; - __IO uint32_t CTIMER3CAP0; /**< Capture Select Register for CTIMER Inputs, offset: 0x1A0 */ - __IO uint32_t CTIMER3CAP1; /**< Capture Select Register for CTIMER Inputs, offset: 0x1A4 */ - __IO uint32_t CTIMER3CAP2; /**< Capture Select Register for CTIMER Inputs, offset: 0x1A8 */ - __IO uint32_t CTIMER3CAP3; /**< Capture Select Register for CTIMER Inputs, offset: 0x1AC */ - __IO uint32_t TIMER3TRIG; /**< Trigger Register for CTIMER, offset: 0x1B0 */ - uint8_t RESERVED_6[12]; - __IO uint32_t CTIMER4CAP0; /**< Capture Select Register for CTIMER Inputs, offset: 0x1C0 */ - __IO uint32_t CTIMER4CAP1; /**< Capture Select Register for CTIMER Inputs, offset: 0x1C4 */ - __IO uint32_t CTIMER4CAP2; /**< Capture Select Register for CTIMER Inputs, offset: 0x1C8 */ - __IO uint32_t CTIMER4CAP3; /**< Capture Select Register for CTIMER Inputs, offset: 0x1CC */ - __IO uint32_t TIMER4TRIG; /**< Trigger Register for CTIMER, offset: 0x1D0 */ - uint8_t RESERVED_7[140]; - __IO uint32_t CMP0_TRIG; /**< CMP0 Input Connections, offset: 0x260 */ - uint8_t RESERVED_8[28]; - __IO uint32_t ADC0_TRIG[4]; /**< ADC Trigger Input Connections, array offset: 0x280, array step: 0x4 */ - uint8_t RESERVED_9[48]; - __IO uint32_t ADC1_TRIG[4]; /**< ADC Trigger Input Connections, array offset: 0x2C0, array step: 0x4 */ - uint8_t RESERVED_10[144]; - struct { /* offset: 0x360, array step: 0x20 */ - __IO uint32_t QDC_TRIG; /**< QDC0 Trigger Input Connections..QDC1 Trigger Input Connections, array offset: 0x360, array step: 0x20 */ - __IO uint32_t QDC_HOME; /**< QDC0 Input Connections..QDC1 Input Connections, array offset: 0x364, array step: 0x20 */ - __IO uint32_t QDC_INDEX; /**< QDC0 Input Connections..QDC1 Input Connections, array offset: 0x368, array step: 0x20 */ - __IO uint32_t QDC_PHASEB; /**< QDC0 Input Connections..QDC1 Input Connections, array offset: 0x36C, array step: 0x20 */ - __IO uint32_t QDC_PHASEA; /**< QDC0 Input Connections..QDC1 Input Connections, array offset: 0x370, array step: 0x20 */ - uint8_t RESERVED_0[12]; - } QDCN[2]; - __IO uint32_t FLEXPWM0_SM_EXTSYNC[4]; /**< PWM0 External Synchronization, array offset: 0x3A0, array step: 0x4 */ - __IO uint32_t FLEXPWM0_SM_EXTA[4]; /**< PWM0 Input Trigger Connections, array offset: 0x3B0, array step: 0x4 */ - __IO uint32_t FLEXPWM0_EXTFORCE; /**< PWM0 External Force Trigger Connections, offset: 0x3C0 */ - __IO uint32_t FLEXPWM0_FAULT[4]; /**< PWM0 Fault Input Trigger Connections, array offset: 0x3C4, array step: 0x4 */ - uint8_t RESERVED_11[12]; - __IO uint32_t FLEXPWM1_SM_EXTSYNC[4]; /**< PWM1 External Synchronization, array offset: 0x3E0, array step: 0x4 */ - __IO uint32_t FLEXPWM1_SM_EXTA[4]; /**< PWM1 Input EXTA Connections, array offset: 0x3F0, array step: 0x4 */ - __IO uint32_t FLEXPWM1_EXTFORCE; /**< PWM1 External Force Trigger Connections, offset: 0x400 */ - __IO uint32_t FLEXPWM1_FAULT[4]; /**< PWM1 Fault Input Trigger Connections, array offset: 0x404, array step: 0x4 */ - uint8_t RESERVED_12[12]; - __IO uint32_t PWM0_EXT_CLK; /**< PWM0 External Clock Trigger, offset: 0x420 */ - __IO uint32_t PWM1_EXT_CLK; /**< PWM1 External Clock Trigger, offset: 0x424 */ - uint8_t RESERVED_13[24]; - __IO uint32_t EVTG_TRIG[16]; /**< EVTG Trigger Input Connections, array offset: 0x440, array step: 0x4 */ - uint8_t RESERVED_14[64]; - __IO uint32_t EXT_TRIG[8]; /**< EXT Trigger Connections, array offset: 0x4C0, array step: 0x4 */ - __IO uint32_t CMP1_TRIG; /**< CMP1 Input Connections, offset: 0x4E0 */ - uint8_t RESERVED_15[188]; - __IO uint32_t FLEXCOMM0_TRIG; /**< LP_FLEXCOMM0 Trigger Input Connections, offset: 0x5A0 */ - uint8_t RESERVED_16[28]; - __IO uint32_t FLEXCOMM1_TRIG; /**< LP_FLEXCOMM1 Trigger Input Connections, offset: 0x5C0 */ - uint8_t RESERVED_17[28]; - __IO uint32_t FLEXCOMM2_TRIG; /**< LP_FLEXCOMM2 Trigger Input Connections, offset: 0x5E0 */ - uint8_t RESERVED_18[28]; - __IO uint32_t FLEXCOMM3_TRIG; /**< LP_FLEXCOMM3 Trigger Input Connections, offset: 0x600 */ - uint8_t RESERVED_19[28]; - __IO uint32_t FLEXCOMM4_TRIG; /**< LP_FLEXCOMM4 Trigger Input Connections, offset: 0x620 */ - uint8_t RESERVED_20[28]; - __IO uint32_t FLEXCOMM5_TRIG; /**< LP_FLEXCOMM5 Trigger Input Connections, offset: 0x640 */ - uint8_t RESERVED_21[28]; - __IO uint32_t FLEXCOMM6_TRIG; /**< LP_FLEXCOMM6 Trigger Input Connections, offset: 0x660 */ - uint8_t RESERVED_22[28]; - __IO uint32_t FLEXCOMM7_TRIG; /**< LP_FLEXCOMM7 Trigger Input Connections, offset: 0x680 */ - uint8_t RESERVED_23[92]; - __IO uint32_t FLEXIO_TRIG[8]; /**< FlexIO Trigger Input Connections, array offset: 0x6E0, array step: 0x4 */ - __IO uint32_t DMA0_REQ_ENABLE0; /**< DMA0 Request Enable0, offset: 0x700 */ - __O uint32_t DMA0_REQ_ENABLE0_SET; /**< DMA0 Request Enable0, offset: 0x704 */ - __O uint32_t DMA0_REQ_ENABLE0_CLR; /**< DMA0 Request Enable0, offset: 0x708 */ - __O uint32_t DMA0_REQ_ENABLE0_TOG; /**< DMA0 Request Enable0, offset: 0x70C */ - __IO uint32_t DMA0_REQ_ENABLE1; /**< DMA0 Request Enable1, offset: 0x710 */ - __O uint32_t DMA0_REQ_ENABLE1_SET; /**< DMA0 Request Enable1, offset: 0x714 */ - __O uint32_t DMA0_REQ_ENABLE1_CLR; /**< DMA0 Request Enable1, offset: 0x718 */ - __O uint32_t DMA0_REQ_ENABLE1_TOG; /**< DMA0 Request Enable1, offset: 0x71C */ - __IO uint32_t DMA0_REQ_ENABLE2; /**< DMA0 Request Enable2, offset: 0x720 */ - __O uint32_t DMA0_REQ_ENABLE2_SET; /**< DMA0 Request Enable2, offset: 0x724 */ - __O uint32_t DMA0_REQ_ENABLE2_CLR; /**< DMA0 Request Enable2, offset: 0x728 */ - __O uint32_t DMA0_REQ_ENABLE2_TOG; /**< DMA0 Request Enable2, offset: 0x72C */ - __IO uint32_t DMA0_REQ_ENABLE3; /**< DMA0 Request Enable3, offset: 0x730 */ - __O uint32_t DMA0_REQ_ENABLE3_SET; /**< DMA0 Request Enable3, offset: 0x734 */ - __O uint32_t DMA0_REQ_ENABLE3_CLR; /**< DMA0 Request Enable3, offset: 0x738 */ - uint8_t RESERVED_24[68]; - __IO uint32_t DMA1_REQ_ENABLE0; /**< DMA1 Request Enable0, offset: 0x780 */ - __O uint32_t DMA1_REQ_ENABLE0_SET; /**< DMA1 Request Enable0, offset: 0x784 */ - __O uint32_t DMA1_REQ_ENABLE0_CLR; /**< DMA1 Request Enable0, offset: 0x788 */ - __O uint32_t DMA1_REQ_ENABLE0_TOG; /**< DMA1 Request Enable0, offset: 0x78C */ - __IO uint32_t DMA1_REQ_ENABLE1; /**< DMA1 Request Enable1, offset: 0x790 */ - __O uint32_t DMA1_REQ_ENABLE1_SET; /**< DMA1 Request Enable1, offset: 0x794 */ - __O uint32_t DMA1_REQ_ENABLE1_CLR; /**< DMA1 Request Enable1, offset: 0x798 */ - __O uint32_t DMA1_REQ_ENABLE1_TOG; /**< DMA1 Request Enable1, offset: 0x79C */ - __IO uint32_t DMA1_REQ_ENABLE2; /**< DMA1 Request Enable2, offset: 0x7A0 */ - __O uint32_t DMA1_REQ_ENABLE2_SET; /**< DMA1 Request Enable2, offset: 0x7A4 */ - __O uint32_t DMA1_REQ_ENABLE2_CLR; /**< DMA1 Request Enable2, offset: 0x7A8 */ - __O uint32_t DMA1_REQ_ENABLE2_TOG; /**< DMA1 Request Enable2, offset: 0x7AC */ - __IO uint32_t DMA1_REQ_ENABLE3; /**< DMA1 Request Enable3, offset: 0x7B0 */ - __O uint32_t DMA1_REQ_ENABLE3_SET; /**< DMA1 Request Enable3, offset: 0x7B4 */ - __O uint32_t DMA1_REQ_ENABLE3_CLR; /**< DMA1 Request Enable3, offset: 0x7B8 */ -} INPUTMUX_Type; - -/* ---------------------------------------------------------------------------- - -- INPUTMUX Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup INPUTMUX_Register_Masks INPUTMUX Register Masks - * @{ - */ - -/*! @name CTIMER0CAP0 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER0CAP0_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER0CAP0_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..Reserved - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER0CAP0_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER0CAP0_INP_SHIFT)) & INPUTMUX_CTIMER0CAP0_INP_MASK) -/*! @} */ - -/*! @name CTIMER0CAP1 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER0CAP1_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER0CAP1_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..Reserved - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER0CAP1_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER0CAP1_INP_SHIFT)) & INPUTMUX_CTIMER0CAP1_INP_MASK) -/*! @} */ - -/*! @name CTIMER0CAP2 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER0CAP2_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER0CAP2_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..Reserved - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER0CAP2_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER0CAP2_INP_SHIFT)) & INPUTMUX_CTIMER0CAP2_INP_MASK) -/*! @} */ - -/*! @name CTIMER0CAP3 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER0CAP3_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER0CAP3_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..Reserved - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER0CAP3_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER0CAP3_INP_SHIFT)) & INPUTMUX_CTIMER0CAP3_INP_MASK) -/*! @} */ - -/*! @name TIMER0TRIG - Trigger Register for CTIMER */ -/*! @{ */ - -#define INPUTMUX_TIMER0TRIG_INP_MASK (0x7FU) -#define INPUTMUX_TIMER0TRIG_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..Reserved - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_TIMER0TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_TIMER0TRIG_INP_SHIFT)) & INPUTMUX_TIMER0TRIG_INP_MASK) -/*! @} */ - -/*! @name CTIMER1CAP0 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER1CAP0_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER1CAP0_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..Reserved - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER1CAP0_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER1CAP0_INP_SHIFT)) & INPUTMUX_CTIMER1CAP0_INP_MASK) -/*! @} */ - -/*! @name CTIMER1CAP1 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER1CAP1_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER1CAP1_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..Reserved - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER1CAP1_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER1CAP1_INP_SHIFT)) & INPUTMUX_CTIMER1CAP1_INP_MASK) -/*! @} */ - -/*! @name CTIMER1CAP2 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER1CAP2_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER1CAP2_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..Reserved - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER1CAP2_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER1CAP2_INP_SHIFT)) & INPUTMUX_CTIMER1CAP2_INP_MASK) -/*! @} */ - -/*! @name CTIMER1CAP3 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER1CAP3_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER1CAP3_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..Reserved - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER1CAP3_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER1CAP3_INP_SHIFT)) & INPUTMUX_CTIMER1CAP3_INP_MASK) -/*! @} */ - -/*! @name TIMER1TRIG - Trigger Register for CTIMER */ -/*! @{ */ - -#define INPUTMUX_TIMER1TRIG_INP_MASK (0x7FU) -#define INPUTMUX_TIMER1TRIG_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..Reserved - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_TIMER1TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_TIMER1TRIG_INP_SHIFT)) & INPUTMUX_TIMER1TRIG_INP_MASK) -/*! @} */ - -/*! @name CTIMER2CAP0 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER2CAP0_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER2CAP0_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..Reserved - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER2CAP0_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER2CAP0_INP_SHIFT)) & INPUTMUX_CTIMER2CAP0_INP_MASK) -/*! @} */ - -/*! @name CTIMER2CAP1 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER2CAP1_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER2CAP1_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..Reserved - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER2CAP1_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER2CAP1_INP_SHIFT)) & INPUTMUX_CTIMER2CAP1_INP_MASK) -/*! @} */ - -/*! @name CTIMER2CAP2 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER2CAP2_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER2CAP2_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..Reserved - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER2CAP2_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER2CAP2_INP_SHIFT)) & INPUTMUX_CTIMER2CAP2_INP_MASK) -/*! @} */ - -/*! @name CTIMER2CAP3 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER2CAP3_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER2CAP3_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..Reserved - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER2CAP3_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER2CAP3_INP_SHIFT)) & INPUTMUX_CTIMER2CAP3_INP_MASK) -/*! @} */ - -/*! @name TIMER2TRIG - Trigger Register for CTIMER */ -/*! @{ */ - -#define INPUTMUX_TIMER2TRIG_INP_MASK (0x7FU) -#define INPUTMUX_TIMER2TRIG_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..Reserved - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_TIMER2TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_TIMER2TRIG_INP_SHIFT)) & INPUTMUX_TIMER2TRIG_INP_MASK) -/*! @} */ - -/*! @name INPUTMUX_SMARTDMA_SMARTDMAARCHB_INMUX - Inputmux Register for SMARTDMA Arch B Inputs */ -/*! @{ */ - -#define INPUTMUX_INPUTMUX_SMARTDMA_SMARTDMAARCHB_INMUX_INP_MASK (0x7FU) -#define INPUTMUX_INPUTMUX_SMARTDMA_SMARTDMAARCHB_INMUX_INP_SHIFT (0U) -/*! INP - Input number select to SmartDMA ARCHB input - * 0b0000000..FlexIO interrupt is selected as input - * 0b0000001..GPIO P0_1 input is selected - * 0b0000010..GPIO P0_2 input is selected - * 0b0000011..GPIO P0_3 input is selected - * 0b0000100..GPIO P0_4 input is selected - * 0b0000101..GPIO P0_5 input is selected - * 0b0000110..GPIO P0_6 input is selected - * 0b0000111..GPIO P0_7 input is selected - * 0b0001000..Reserved - * 0b0001001..Reserved - * 0b0001010..Reserved - * 0b0001011..Reserved - * 0b0001100..GPIO P0_12 input is selected - * 0b0001101..GPIO P0_13 input is selected - * 0b0001110..GPIO P0_14 input is selected - * 0b0001111..GPIO P0_15 input is selected - * 0b0010000..Reserved - * 0b0010001..Reserved - * 0b0010010..Reserved - * 0b0010011..Reserved - * 0b0010100..MRT0 MRT_CH0_IRQ input is selected - * 0b0010101..MRT0 MRT_CH1_IRQ input is selected - * 0b0010110..CTIMER4_MAT3 input is selected - * 0b0010111..CTIMER4_MAT2 input is selected - * 0b0011000..CTIMER3_MAT3 input is selected - * 0b0011001..CTIMER3_MAT2 input is selected - * 0b0011010..CTIMER1_MAT3 input is selected - * 0b0011011..CTIMER1_MAT2 input is selected - * 0b0011100..UTICK0 UTICK_IRQ input is selected - * 0b0011101..WWDT0 WDT0_IRQ input is selected - * 0b0011110..ADC0 ADC0_IRQ input is selected - * 0b0011111..CMP0_IRQ input is selected - * 0b0100000..Reserved - * 0b0100001..LP_FLEXCOMM7_IRQ input is selected - * 0b0100010..LP_FLEXCOMM6_IRQ input is selected - * 0b0100011..LP_FLEXCOMM5_IRQ input is selected - * 0b0100100..LP_FLEXCOMM4_IRQ input is selected - * 0b0100101..LP_FLEXCOMM3_IRQ input is selected - * 0b0100110..LP_FLEXCOMM2_IRQ input is selected - * 0b0100111..LP_FLEXCOMM1_IRQ input is selected - * 0b0101000..LP_FLEXCOMM0_IRQ input is selected - * 0b0101001..DMA0_IRQ input is selected - * 0b0101010..DMA1_IRQ input is selected - * 0b0101011..SYS_IRQSYS_IRQ combines the CDOG IRQ, WWDT IRQ, MBC secure violation IRQ, Secure AHB Matrix secure - * violation IRQ, GDET IRQ, ELS S50 error IRQ, PKC error IRQ, and VBAT IRQ using the logical OR - * operation. input is selected - * 0b0101100..RTC_COMBO_IRQ input is selected - * 0b0101101..ARM_TXEV input is selected - * 0b0101110..PINT0 GPIO_INT_BMATCH input is selected - * 0b0101111..Reserved - * 0b0110000..Reserved - * 0b0110001..CMP0_OUT input is selected - * 0b0110010..usb0 start of frame input is selected - * 0b0110011..usb1 start of frame input is selected - * 0b0110100..OSTIMER0 OS_EVENT_TIMER_IRQ input is selected - * 0b0110101..ADC1_IRQ input is selected - * 0b0110110..CMP0_IRQ/CMP1_IRQ input is selected - * 0b0110111..Reserved - * 0b0111000..Reserved - * 0b0111001..PWM0_IRQ input is selected - * 0b0111010..PWM1_IRQ input is selected - * 0b0111011..QDC0_IRQ input is selected - * 0b0111100..QDC1_IRQ input is selected - * 0b0111101..EVTG_OUT0A input is selected - * 0b0111110..EVTG_OUT1A input is selected - * 0b0111111..Reserved - * 0b1000000..Reserved - * 0b1000001..GPIO1_alias0 GPIO1 Pin Event Trig 0 input is selected - * 0b1000010..GPIO1_alias1 GPIO1 Pin Event Trig 1 input is selected - * 0b1000011..GPIO2_alias0 GPIO2 Pin Event Trig 0 input is selected - * 0b1000100..GPIO2_alias1 GPIO2 Pin Event Trig 1 input is selected - * 0b1000101..GPIO3_alias0 GPIO3 Pin Event Trig 0 input is selected - * 0b1000110..GPIO3_alias1 GPIO3 Pin Event Trig 1 input is selected - * 0b1000111..FlexIO Shifter DMA Request 0 is selected - * 0b1001000..FlexIO Shifter DMA Request 1 is selected - * 0b1001001..FlexIO Shifter DMA Request 2 is selected - * 0b1001010..FlexIO Shifter DMA Request 3 is selected - * 0b1001011..FlexIO Shifter DMA Request 4 is selected - * 0b1001100..FlexIO Shifter DMA Request 5 is selected - * 0b1001101..FlexIO Shifter DMA Request 6 is selected - * 0b1001110..FlexIO Shifter DMA Request 7 is selected - * *.. - */ -#define INPUTMUX_INPUTMUX_SMARTDMA_SMARTDMAARCHB_INMUX_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_INPUTMUX_SMARTDMA_SMARTDMAARCHB_INMUX_INP_SHIFT)) & INPUTMUX_INPUTMUX_SMARTDMA_SMARTDMAARCHB_INMUX_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_INPUTMUX_SMARTDMA_SMARTDMAARCHB_INMUX */ -#define INPUTMUX_INPUTMUX_SMARTDMA_SMARTDMAARCHB_INMUX_COUNT (8U) - -/*! @name INPUTMUX_GPIO_INT_PINTSEL - Pin Interrupt Select */ -/*! @{ */ - -#define INPUTMUX_INPUTMUX_GPIO_INT_PINTSEL_INP_MASK (0x7FU) -#define INPUTMUX_INPUTMUX_GPIO_INT_PINTSEL_INP_SHIFT (0U) -/*! INP - Pin number select for pin interrupt or pattern match engine input. For PIOx_y: INP = (x * - * 32) + y. PIO0_0 to PIO1_31 correspond to numbers 0 to 63. - * 0b0000000..GPIO P0_0 input is selected - * 0b0000001..GPIO P0_1 input is selected - * 0b0000010..GPIO P0_2 input is selected - * 0b0000011..GPIO P0_3 input is selected - * 0b0000100..GPIO P0_4 input is selected - * 0b0000101..GPIO P0_5 input is selected - * 0b0000110..GPIO P0_6 input is selected - * 0b0000111..GPIO P0_7 input is selected - * 0b0001000..Reserved - * 0b0001001..Reserved - * 0b0001010..Reserved - * 0b0001011..Reserved - * 0b0001100..GPIO P0_12 input is selected - * 0b0001101..GPIO P0_13 input is selected - * 0b0001110..GPIO P0_14 input is selected - * 0b0001111..GPIO P0_15 input is selected - * 0b0010000..GPIO P0_16 input is selected - * 0b0010001..GPIO P0_17 input is selected - * 0b0010010..GPIO P0_18 input is selected - * 0b0010011..GPIO P0_19 input is selected - * 0b0010100..GPIO P0_20 input is selected - * 0b0010101..GPIO P0_21 input is selected - * 0b0010110..GPIO P0_22 input is selected - * 0b0010111..GPIO P0_23 input is selected - * 0b0011000..GPIO P0_24 input is selected - * 0b0011001..GPIO P0_25 input is selected - * 0b0011010..GPIO P0_26 input is selected - * 0b0011011..GPIO P0_27 input is selected - * 0b0011100..GPIO P0_28 input is selected - * 0b0011101..GPIO P0_29 input is selected - * 0b0011110..Reserved - * 0b0011111..Reserved - * 0b0100000..GPIO P1_0 input is selected - * 0b0100001..GPIO P1_1 input is selected - * 0b0100010..GPIO P1_2 input is selected - * 0b0100011..GPIO P1_3 input is selected - * 0b0100100..GPIO P1_4 input is selected - * 0b0100101..GPIO P1_5 input is selected - * 0b0100110..GPIO P1_6 input is selected - * 0b0100111..GPIO P1_7 input is selected - * 0b0101000..GPIO P1_8 input is selected - * 0b0101001..GPIO P1_9 input is selected - * 0b0101010..GPIO P1_10 input is selected - * 0b0101011..GPIO P1_11 input is selected - * 0b0101100..GPIO P1_12 input is selected - * 0b0101101..GPIO P1_13 input is selected - * 0b0101110..GPIO P1_14 input is selected - * 0b0101111..GPIO P1_15 input is selected - * 0b0110000..GPIO P1_16 input is selected - * 0b0110001..GPIO P1_17 input is selected - * 0b0110010..GPIO P1_18 input is selected - * 0b0110011..GPIO P1_19 input is selected - * 0b0110100..Reserved - * 0b0110101..Reserved - * 0b0110110..Reserved - * 0b0110111..Reserved - * 0b0111000..Reserved - * 0b0111001..Reserved - * 0b0111010..Reserved - * 0b0111011..Reserved - * 0b0111100..Reserved - * 0b0111101..Reserved - * 0b0111110..GPIO P1_30 input is selected - * 0b0111111..GPIO P1_31 input is selected - * *.. - */ -#define INPUTMUX_INPUTMUX_GPIO_INT_PINTSEL_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_INPUTMUX_GPIO_INT_PINTSEL_INP_SHIFT)) & INPUTMUX_INPUTMUX_GPIO_INT_PINTSEL_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_INPUTMUX_GPIO_INT_PINTSEL */ -#define INPUTMUX_INPUTMUX_GPIO_INT_PINTSEL_COUNT (8U) - -/*! @name FREQMEAS_REF - Selection for Frequency Measurement Reference Clock */ -/*! @{ */ - -#define INPUTMUX_FREQMEAS_REF_INP_MASK (0x3FU) -#define INPUTMUX_FREQMEAS_REF_INP_SHIFT (0U) -/*! INP - Clock source number (binary value) for frequency measure function reference clock. - * 0b000000..clk_in (output of clk_in or XTAL mux in Clockgen) input is selected - * 0b000001..FRO_12M input is selected - * 0b000010..FRO_144M input is selected - * 0b000011..Reserved - * 0b000100..OSC_32K input is selected - * 0b000101..CPU/system_clk input is selected - * 0b000110..FREQME_CLK_IN0 input is selected - * 0b000111..FREQME_CLK_IN1 input is selected - * 0b001000..EVTG_OUT0A input is selected - * 0b001001..EVTG_OUT1A input is selected - * *.. - */ -#define INPUTMUX_FREQMEAS_REF_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FREQMEAS_REF_INP_SHIFT)) & INPUTMUX_FREQMEAS_REF_INP_MASK) -/*! @} */ - -/*! @name FREQMEAS_TAR - Selection for Frequency Measurement Target Clock */ -/*! @{ */ - -#define INPUTMUX_FREQMEAS_TAR_INP_MASK (0x3FU) -#define INPUTMUX_FREQMEAS_TAR_INP_SHIFT (0U) -/*! INP - Clock source number (binary value) for frequency measure function target clock. - * 0b000000..clk_in (output of clk_in or XTAL mux in Clockgen) input is selected - * 0b000001..FRO_12M input is selected - * 0b000010..FRO_144M input is selected - * 0b000011..Reserved - * 0b000100..OSC_32K input is selected - * 0b000101..CPU/system_clk input is selected - * 0b000110..FREQME_CLK_IN0 input is selected - * 0b000111..FREQME_CLK_IN1 input is selected - * 0b001000..EVTG_OUT0A input is selected - * 0b001001..EVTG_OUT1A input is selected - * *.. - */ -#define INPUTMUX_FREQMEAS_TAR_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FREQMEAS_TAR_INP_SHIFT)) & INPUTMUX_FREQMEAS_TAR_INP_MASK) -/*! @} */ - -/*! @name CTIMER3CAP0 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER3CAP0_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER3CAP0_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0 ADC0_IRQ input is selected - * 0b0011010..ADC0 ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..Reserved - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER3CAP0_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER3CAP0_INP_SHIFT)) & INPUTMUX_CTIMER3CAP0_INP_MASK) -/*! @} */ - -/*! @name CTIMER3CAP1 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER3CAP1_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER3CAP1_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0 ADC0_IRQ input is selected - * 0b0011010..ADC0 ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..Reserved - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER3CAP1_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER3CAP1_INP_SHIFT)) & INPUTMUX_CTIMER3CAP1_INP_MASK) -/*! @} */ - -/*! @name CTIMER3CAP2 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER3CAP2_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER3CAP2_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0 ADC0_IRQ input is selected - * 0b0011010..ADC0 ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..Reserved - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER3CAP2_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER3CAP2_INP_SHIFT)) & INPUTMUX_CTIMER3CAP2_INP_MASK) -/*! @} */ - -/*! @name CTIMER3CAP3 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER3CAP3_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER3CAP3_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0 ADC0_IRQ input is selected - * 0b0011010..ADC0 ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..Reserved - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER3CAP3_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER3CAP3_INP_SHIFT)) & INPUTMUX_CTIMER3CAP3_INP_MASK) -/*! @} */ - -/*! @name TIMER3TRIG - Trigger Register for CTIMER */ -/*! @{ */ - -#define INPUTMUX_TIMER3TRIG_INP_MASK (0x7FU) -#define INPUTMUX_TIMER3TRIG_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0 ADC0_IRQ input is selected - * 0b0011010..ADC0 ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..Reserved - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_TIMER3TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_TIMER3TRIG_INP_SHIFT)) & INPUTMUX_TIMER3TRIG_INP_MASK) -/*! @} */ - -/*! @name CTIMER4CAP0 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER4CAP0_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER4CAP0_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0 ADC0_IRQ input is selected - * 0b0011010..ADC0 ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..Reserved - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER4CAP0_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER4CAP0_INP_SHIFT)) & INPUTMUX_CTIMER4CAP0_INP_MASK) -/*! @} */ - -/*! @name CTIMER4CAP1 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER4CAP1_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER4CAP1_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0 ADC0_IRQ input is selected - * 0b0011010..ADC0 ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..Reserved - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER4CAP1_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER4CAP1_INP_SHIFT)) & INPUTMUX_CTIMER4CAP1_INP_MASK) -/*! @} */ - -/*! @name CTIMER4CAP2 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER4CAP2_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER4CAP2_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0 ADC0_IRQ input is selected - * 0b0011010..ADC0 ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..Reserved - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER4CAP2_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER4CAP2_INP_SHIFT)) & INPUTMUX_CTIMER4CAP2_INP_MASK) -/*! @} */ - -/*! @name CTIMER4CAP3 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER4CAP3_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER4CAP3_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0 ADC0_IRQ input is selected - * 0b0011010..ADC0 ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..Reserved - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER4CAP3_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER4CAP3_INP_SHIFT)) & INPUTMUX_CTIMER4CAP3_INP_MASK) -/*! @} */ - -/*! @name TIMER4TRIG - Trigger Register for CTIMER */ -/*! @{ */ - -#define INPUTMUX_TIMER4TRIG_INP_MASK (0x7FU) -#define INPUTMUX_TIMER4TRIG_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0 ADC0_IRQ input is selected - * 0b0011010..ADC0 ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..Reserved - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_TIMER4TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_TIMER4TRIG_INP_SHIFT)) & INPUTMUX_TIMER4TRIG_INP_MASK) -/*! @} */ - -/*! @name CMP0_TRIG - CMP0 Input Connections */ -/*! @{ */ - -#define INPUTMUX_CMP0_TRIG_TRIGIN_MASK (0x3FU) -#define INPUTMUX_CMP0_TRIG_TRIGIN_SHIFT (0U) -/*! TRIGIN - CMP0 input trigger - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT6 input is selected - * 0b000010..Reserved - * 0b000011..Reserved - * 0b000100..Reserved - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER0_MAT0 input is selected - * 0b001001..CTIMER4_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..Reserved - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC1_tcomp[0] input is selected - * 0b001111..Reserved - * 0b010000..Reserved - * 0b010001..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b010010..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b010011..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b010100..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b010101..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b010110..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b010111..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b011000..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b011001..QDC0_CMP/POS_MATCH input is selected - * 0b011010..QDC1_CMP/POS_MATCH input is selected - * 0b011011..EVTG_OUT0A input is selected - * 0b011100..EVTG_OUT0B input is selected - * 0b011101..EVTG_OUT1A input is selected - * 0b011110..EVTG_OUT1B input is selected - * 0b011111..EVTG_OUT2A input is selected - * 0b100000..EVTG_OUT2B input is selected - * 0b100001..EVTG_OUT3A input is selected - * 0b100010..EVTG_OUT3B input is selected - * 0b100011..LPTMR0 input is selected - * 0b100100..LPTMR1 input is selected - * 0b100101..GPIO2 Pin Event Trig 0 input is selected - * 0b100110..GPIO2 Pin Event Trig 1 input is selected - * 0b100111..GPIO3 Pin Event Trig 0 input is selected - * 0b101000..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_CMP0_TRIG_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CMP0_TRIG_TRIGIN_SHIFT)) & INPUTMUX_CMP0_TRIG_TRIGIN_MASK) -/*! @} */ - -/*! @name ADC0_TRIGM_ADC0_TRIG - ADC Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_ADC0_TRIGM_ADC0_TRIG_TRIGIN_MASK (0xFFU) -#define INPUTMUX_ADC0_TRIGM_ADC0_TRIG_TRIGIN_SHIFT (0U) -/*! TRIGIN - ADC0 trigger inputs - * 0b00000000..PINT PIN_INT0 input is selected - * 0b00000001..PINT PIN_INT1 input is selected - * 0b00000010..Reserved - * 0b00000011..Reserved - * 0b00000100..Reserved - * 0b00000101..CTIMER0_MAT3 input is selected - * 0b00000110..CTIMER1_MAT3 input is selected - * 0b00000111..CTIMER2_MAT3 input is selected - * 0b00001000..CTIMER3_MAT3 input is selected - * 0b00001001..CTIMER4_MAT3 input is selected - * 0b00001010..DCDC_Burst_Done_Trig input is selected - * 0b00001011..Reserved - * 0b00001100..PINT GPIO_INT_BMAT input is selected - * 0b00001101..ADC0_tcomp[0] input is selected - * 0b00001110..ADC0_tcomp[1] input is selected - * 0b00001111..ADC0_tcomp[2] input is selected - * 0b00010000..ADC0_tcomp[3] input is selected - * 0b00010001..ADC1_tcomp[0] input is selected - * 0b00010010..ADC1_tcomp[1] input is selected - * 0b00010011..ADC1_tcomp[2] input is selected - * 0b00010100..ADC1_tcomp[3] input is selected - * 0b00010101..CMP0_OUT input is selected - * 0b00010110..CMP1_OUT input is selected - * 0b00010111..Reserved - * 0b00011000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b00011001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b00011010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b00011011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b00011100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b00011101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b00011110..PWM0_SM3_MUX_TRIG0 input is selected - * 0b00011111..PWM0_SM3_MUX_TRIG1 input is selected - * 0b00100000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b00100001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b00100010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b00100011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b00100100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b00100101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b00100110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b00100111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b00101000..QDC0_CMP/POS_MATCH input is selected - * 0b00101001..QDC1_CMP/POS_MATCH input is selected - * 0b00101010..EVTG_OUT0A input is selected - * 0b00101011..EVTG_OUT0B input is selected - * 0b00101100..EVTG_OUT1A input is selected - * 0b00101101..EVTG_OUT1B input is selected - * 0b00101110..EVTG_OUT2A input is selected - * 0b00101111..EVTG_OUT2B input is selected - * 0b00110000..EVTG_OUT3A input is selected - * 0b00110001..EVTG_OUT3B input is selected - * 0b00110010..LPTMR0 input is selected - * 0b00110011..LPTMR1 input is selected - * 0b00110100..FlexIO CH0 input is selected - * 0b00110101..FlexIO CH1 input is selected - * 0b00110110..FlexIO CH2 input is selected - * 0b00110111..FlexIO CH3 input is selected - * 0b00111000..Reserved - * 0b00111001..Reserved - * 0b00111010..Reserved - * 0b00111011..Reserved - * 0b00111100..Reserved - * 0b00111101..GPIO2 Pin Event Trig 0 input is selected - * 0b00111110..GPIO2 Pin Event Trig 1 input is selected - * 0b00111111..GPIO3 Pin Event Trig 0 input is selected - * 0b01000000..GPIO3 Pin Event Trig 1 input is selected - * 0b01000001..WUU input is selected - * *.. - */ -#define INPUTMUX_ADC0_TRIGM_ADC0_TRIG_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_ADC0_TRIGM_ADC0_TRIG_TRIGIN_SHIFT)) & INPUTMUX_ADC0_TRIGM_ADC0_TRIG_TRIGIN_MASK) -/*! @} */ - -/* The count of INPUTMUX_ADC0_TRIGM_ADC0_TRIG */ -#define INPUTMUX_ADC0_TRIGM_ADC0_TRIG_COUNT (4U) - -/*! @name ADC1_TRIGN_ADC1_TRIG - ADC Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_ADC1_TRIGN_ADC1_TRIG_TRIGIN_MASK (0xFFU) -#define INPUTMUX_ADC1_TRIGN_ADC1_TRIG_TRIGIN_SHIFT (0U) -/*! TRIGIN - ADC1 trigger inputs - * 0b00000000..PINT PIN_INT0 input is selected - * 0b00000001..PINT PIN_INT2 input is selected - * 0b00000010..Reserved - * 0b00000011..Reserved - * 0b00000100..Reserved - * 0b00000101..CTIMER0_MAT3 input is selected - * 0b00000110..CTIMER1_MAT3 input is selected - * 0b00000111..CTIMER2_MAT3 input is selected - * 0b00001000..CTIMER3_MAT2 input is selected - * 0b00001001..CTIMER4_MAT1 input is selected - * 0b00001010..DCDC_Burst_Done_Trig input is selected - * 0b00001011..Reserved - * 0b00001100..PINT GPIO_INT_BMAT input is selected - * 0b00001101..ADC0_tcomp[0] input is selected - * 0b00001110..ADC0_tcomp[1] input is selected - * 0b00001111..ADC0_tcomp[2] input is selected - * 0b00010000..ADC0_tcomp[3] input is selected - * 0b00010001..ADC1_tcomp[0] input is selected - * 0b00010010..ADC1_tcomp[1] input is selected - * 0b00010011..ADC1_tcomp[2] input is selected - * 0b00010100..ADC1_tcomp[3] input is selected - * 0b00010101..CMP0_OUT input is selected - * 0b00010110..CMP1_OUT input is selected - * 0b00010111..Reserved - * 0b00011000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b00011001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b00011010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b00011011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b00011100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b00011101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b00011110..PWM0_SM3_MUX_TRIG0 input is selected - * 0b00011111..PWM0_SM3_MUX_TRIG1 input is selected - * 0b00100000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b00100001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b00100010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b00100011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b00100100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b00100101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b00100110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b00100111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b00101000..QDC0_CMP/POS_MATCH input is selected - * 0b00101001..QDC1_CMP/POS_MATCH input is selected - * 0b00101010..EVTG_OUT0A input is selected - * 0b00101011..EVTG_OUT0B input is selected - * 0b00101100..EVTG_OUT1A input is selected - * 0b00101101..EVTG_OUT1B input is selected - * 0b00101110..EVTG_OUT2A input is selected - * 0b00101111..EVTG_OUT2B input is selected - * 0b00110000..EVTG_OUT3A input is selected - * 0b00110001..EVTG_OUT3B input is selected - * 0b00110010..LPTMR0 input is selected - * 0b00110011..LPTMR1 input is selected - * 0b00110100..FlexIO CH0 input is selected - * 0b00110101..FlexIO CH1 input is selected - * 0b00110110..FlexIO CH2 input is selected - * 0b00110111..FlexIO CH3 input is selected - * 0b00111000..Reserved - * 0b00111001..Reserved - * 0b00111010..Reserved - * 0b00111011..Reserved - * 0b00111100..Reserved - * 0b00111101..GPIO2 Pin Event Trig 0 input is selected - * 0b00111110..GPIO2 Pin Event Trig 1 input is selected - * 0b00111111..GPIO3 Pin Event Trig 0 input is selected - * 0b01000000..GPIO3 Pin Event Trig 1 input is selected - * 0b01000001..WUU input is selected - * *.. - */ -#define INPUTMUX_ADC1_TRIGN_ADC1_TRIG_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_ADC1_TRIGN_ADC1_TRIG_TRIGIN_SHIFT)) & INPUTMUX_ADC1_TRIGN_ADC1_TRIG_TRIGIN_MASK) -/*! @} */ - -/* The count of INPUTMUX_ADC1_TRIGN_ADC1_TRIG */ -#define INPUTMUX_ADC1_TRIGN_ADC1_TRIG_COUNT (4U) - -/*! @name QDCN_QDC_TRIG - QDC0 Trigger Input Connections..QDC1 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDCN_QDC_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_QDCN_QDC_TRIG_INP_SHIFT (0U) -/*! INP - QDC1 trigger input connections - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT4 input is selected - * 0b000010..Reserved - * 0b000011..Reserved - * 0b000100..Reserved - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER1_MAT0 input is selected - * 0b001001..CTIMER3_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..Reserved - * 0b011000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * *.. - */ -#define INPUTMUX_QDCN_QDC_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDCN_QDC_TRIG_INP_SHIFT)) & INPUTMUX_QDCN_QDC_TRIG_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_QDCN_QDC_TRIG */ -#define INPUTMUX_QDCN_QDC_TRIG_COUNT (2U) - -/*! @name QDCN_QDC_HOME - QDC0 Input Connections..QDC1 Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDCN_QDC_HOME_INP_MASK (0x3FU) -#define INPUTMUX_QDCN_QDC_HOME_INP_SHIFT (0U) -/*! INP - QDC1 HOME input connections - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT4 input is selected - * 0b000010..Reserved - * 0b000011..Reserved - * 0b000100..Reserved - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER1_MAT0 input is selected - * 0b001001..CTIMER3_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..Reserved - * 0b011000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * *.. - */ -#define INPUTMUX_QDCN_QDC_HOME_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDCN_QDC_HOME_INP_SHIFT)) & INPUTMUX_QDCN_QDC_HOME_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_QDCN_QDC_HOME */ -#define INPUTMUX_QDCN_QDC_HOME_COUNT (2U) - -/*! @name QDCN_QDC_INDEX - QDC0 Input Connections..QDC1 Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDCN_QDC_INDEX_INP_MASK (0x3FU) -#define INPUTMUX_QDCN_QDC_INDEX_INP_SHIFT (0U) -/*! INP - QDC1 INDEX input connections - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT4 input is selected - * 0b000010..Reserved - * 0b000011..Reserved - * 0b000100..Reserved - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER1_MAT0 input is selected - * 0b001001..CTIMER3_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..Reserved - * 0b011000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * *.. - */ -#define INPUTMUX_QDCN_QDC_INDEX_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDCN_QDC_INDEX_INP_SHIFT)) & INPUTMUX_QDCN_QDC_INDEX_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_QDCN_QDC_INDEX */ -#define INPUTMUX_QDCN_QDC_INDEX_COUNT (2U) - -/*! @name QDCN_QDC_PHASEB - QDC0 Input Connections..QDC1 Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDCN_QDC_PHASEB_INP_MASK (0x3FU) -#define INPUTMUX_QDCN_QDC_PHASEB_INP_SHIFT (0U) -/*! INP - QDC1 PHASEB input connections - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT4 input is selected - * 0b000010..Reserved - * 0b000011..Reserved - * 0b000100..Reserved - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER1_MAT0 input is selected - * 0b001001..CTIMER3_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..Reserved - * 0b011000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * *.. - */ -#define INPUTMUX_QDCN_QDC_PHASEB_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDCN_QDC_PHASEB_INP_SHIFT)) & INPUTMUX_QDCN_QDC_PHASEB_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_QDCN_QDC_PHASEB */ -#define INPUTMUX_QDCN_QDC_PHASEB_COUNT (2U) - -/*! @name QDCN_QDC_PHASEA - QDC0 Input Connections..QDC1 Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDCN_QDC_PHASEA_INP_MASK (0x3FU) -#define INPUTMUX_QDCN_QDC_PHASEA_INP_SHIFT (0U) -/*! INP - QDC1 PHASEA input connections - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT4 input is selected - * 0b000010..Reserved - * 0b000011..Reserved - * 0b000100..Reserved - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER1_MAT0 input is selected - * 0b001001..CTIMER3_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..Reserved - * 0b011000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * *.. - */ -#define INPUTMUX_QDCN_QDC_PHASEA_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDCN_QDC_PHASEA_INP_SHIFT)) & INPUTMUX_QDCN_QDC_PHASEA_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_QDCN_QDC_PHASEA */ -#define INPUTMUX_QDCN_QDC_PHASEA_COUNT (2U) - -/*! @name FLEXPWM_SM_EXTSYNC_FLEXPWM0_SM_EXTSYNC - PWM0 External Synchronization */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM_SM_EXTSYNC_FLEXPWM0_SM_EXTSYNC_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM_SM_EXTSYNC_FLEXPWM0_SM_EXTSYNC_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXTSYNC input connections for PWM0 - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..Reserved - * 0b000011..Reserved - * 0b000100..Reserved - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER2_MAT0 input is selected - * 0b001001..CTIMER4_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..Reserved - * 0b011000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * 0b110100..Reserved - * 0b110101..Reserved - * 0b110110..Reserved - * 0b110111..Reserved - * 0b111000..Reserved - * 0b111001..GPIO2 Pin Event Trig 0 input is selected - * 0b111010..GPIO2 Pin Event Trig 1 input is selected - * 0b111011..GPIO3 Pin Event Trig 0 input is selected - * 0b111100..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM_SM_EXTSYNC_FLEXPWM0_SM_EXTSYNC_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM_SM_EXTSYNC_FLEXPWM0_SM_EXTSYNC_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM_SM_EXTSYNC_FLEXPWM0_SM_EXTSYNC_TRIGIN_MASK) -/*! @} */ - -/* The count of INPUTMUX_FLEXPWM_SM_EXTSYNC_FLEXPWM0_SM_EXTSYNC */ -#define INPUTMUX_FLEXPWM_SM_EXTSYNC_FLEXPWM0_SM_EXTSYNC_COUNT (4U) - -/*! @name FLEXPWM_SM_EXT_FLEXPWM0_SM_EXTA - PWM0 Input Trigger Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM_SM_EXT_FLEXPWM0_SM_EXTA_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM_SM_EXT_FLEXPWM0_SM_EXTA_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXTA input connections for PWM0 - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..Reserved - * 0b000011..Reserved - * 0b000100..Reserved - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER2_MAT0 input is selected - * 0b001001..CTIMER4_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..Reserved - * 0b011000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * 0b110100..Reserved - * 0b110101..Reserved - * 0b110110..Reserved - * 0b110111..Reserved - * 0b111000..Reserved - * 0b111001..GPIO2 Pin Event Trig 0 input is selected - * 0b111010..GPIO2 Pin Event Trig 1 input is selected - * 0b111011..GPIO3 Pin Event Trig 0 input is selected - * 0b111100..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM_SM_EXT_FLEXPWM0_SM_EXTA_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM_SM_EXT_FLEXPWM0_SM_EXTA_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM_SM_EXT_FLEXPWM0_SM_EXTA_TRIGIN_MASK) -/*! @} */ - -/* The count of INPUTMUX_FLEXPWM_SM_EXT_FLEXPWM0_SM_EXTA */ -#define INPUTMUX_FLEXPWM_SM_EXT_FLEXPWM0_SM_EXTA_COUNT (4U) - -/*! @name FLEXPWM0_EXTFORCE - PWM0 External Force Trigger Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM0_EXTFORCE_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM0_EXTFORCE_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXTFORCE input connections for PWM0 - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..Reserved - * 0b000011..Reserved - * 0b000100..Reserved - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER2_MAT0 input is selected - * 0b001001..CTIMER4_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..Reserved - * 0b011000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * 0b110100..Reserved - * 0b110101..Reserved - * 0b110110..Reserved - * 0b110111..Reserved - * 0b111000..Reserved - * 0b111001..GPIO2 Pin Event Trig 0 input is selected - * 0b111010..GPIO2 Pin Event Trig 1 input is selected - * 0b111011..GPIO3 Pin Event Trig 0 input is selected - * 0b111100..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM0_EXTFORCE_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM0_EXTFORCE_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM0_EXTFORCE_TRIGIN_MASK) -/*! @} */ - -/*! @name FLEXPWM_FAULT_FLEXPWM0_FAULT - PWM0 Fault Input Trigger Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM_FAULT_FLEXPWM0_FAULT_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM_FAULT_FLEXPWM0_FAULT_TRIGIN_SHIFT (0U) -/*! TRIGIN - FAULT input connections for PWM0 - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..Reserved - * 0b000011..Reserved - * 0b000100..Reserved - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER2_MAT0 input is selected - * 0b001001..CTIMER4_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..Reserved - * 0b011000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * 0b110100..Reserved - * 0b110101..Reserved - * 0b110110..Reserved - * 0b110111..Reserved - * 0b111000..Reserved - * 0b111001..GPIO2 Pin Event Trig 0 input is selected - * 0b111010..GPIO2 Pin Event Trig 1 input is selected - * 0b111011..GPIO3 Pin Event Trig 0 input is selected - * 0b111100..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM_FAULT_FLEXPWM0_FAULT_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM_FAULT_FLEXPWM0_FAULT_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM_FAULT_FLEXPWM0_FAULT_TRIGIN_MASK) -/*! @} */ - -/* The count of INPUTMUX_FLEXPWM_FAULT_FLEXPWM0_FAULT */ -#define INPUTMUX_FLEXPWM_FAULT_FLEXPWM0_FAULT_COUNT (4U) - -/*! @name FLEXPWM1_SM_EXTSYNC_ARRAY_FLEXPWM1_SM_EXTSYNC - PWM1 External Synchronization */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM1_SM_EXTSYNC_ARRAY_FLEXPWM1_SM_EXTSYNC_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM1_SM_EXTSYNC_ARRAY_FLEXPWM1_SM_EXTSYNC_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXTSYNC input connections for PWM1 - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT2 input is selected - * 0b000010..Reserved - * 0b000011..Reserved - * 0b000100..Reserved - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER2_MAT1 input is selected - * 0b001001..CTIMER4_MAT1 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..Reserved - * 0b011000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM0_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM0_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * 0b110100..Reserved - * 0b110101..Reserved - * 0b110110..Reserved - * 0b110111..Reserved - * 0b111000..Reserved - * 0b111001..GPIO2 Pin Event Trig 0 input is selected - * 0b111010..GPIO2 Pin Event Trig 1 input is selected - * 0b111011..GPIO3 Pin Event Trig 0 input is selected - * 0b111100..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM1_SM_EXTSYNC_ARRAY_FLEXPWM1_SM_EXTSYNC_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM1_SM_EXTSYNC_ARRAY_FLEXPWM1_SM_EXTSYNC_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM1_SM_EXTSYNC_ARRAY_FLEXPWM1_SM_EXTSYNC_TRIGIN_MASK) -/*! @} */ - -/* The count of INPUTMUX_FLEXPWM1_SM_EXTSYNC_ARRAY_FLEXPWM1_SM_EXTSYNC */ -#define INPUTMUX_FLEXPWM1_SM_EXTSYNC_ARRAY_FLEXPWM1_SM_EXTSYNC_COUNT (4U) - -/*! @name FLEXPWM_SM1_EXTA_ARRAY_FLEXPWM1_SM_EXTA - PWM1 Input EXTA Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM_SM1_EXTA_ARRAY_FLEXPWM1_SM_EXTA_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM_SM1_EXTA_ARRAY_FLEXPWM1_SM_EXTA_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXTA input connections for PWM1 - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT2 input is selected - * 0b000010..Reserved - * 0b000011..Reserved - * 0b000100..Reserved - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER2_MAT1 input is selected - * 0b001001..CTIMER4_MAT1 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..Reserved - * 0b011000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM0_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM0_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * 0b110100..Reserved - * 0b110101..Reserved - * 0b110110..Reserved - * 0b110111..Reserved - * 0b111000..Reserved - * 0b111001..GPIO2 Pin Event Trig 0 input is selected - * 0b111010..GPIO2 Pin Event Trig 1 input is selected - * 0b111011..GPIO3 Pin Event Trig 0 input is selected - * 0b111100..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM_SM1_EXTA_ARRAY_FLEXPWM1_SM_EXTA_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM_SM1_EXTA_ARRAY_FLEXPWM1_SM_EXTA_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM_SM1_EXTA_ARRAY_FLEXPWM1_SM_EXTA_TRIGIN_MASK) -/*! @} */ - -/* The count of INPUTMUX_FLEXPWM_SM1_EXTA_ARRAY_FLEXPWM1_SM_EXTA */ -#define INPUTMUX_FLEXPWM_SM1_EXTA_ARRAY_FLEXPWM1_SM_EXTA_COUNT (4U) - -/*! @name FLEXPWM1_EXTFORCE - PWM1 External Force Trigger Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM1_EXTFORCE_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM1_EXTFORCE_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXTFORCE input connections for PWM1 - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT2 input is selected - * 0b000010..Reserved - * 0b000011..Reserved - * 0b000100..Reserved - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER2_MAT1 input is selected - * 0b001001..CTIMER4_MAT1 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..Reserved - * 0b011000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM0_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM0_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * 0b110100..Reserved - * 0b110101..Reserved - * 0b110110..Reserved - * 0b110111..Reserved - * 0b111000..Reserved - * 0b111001..GPIO2 Pin Event Trig 0 input is selected - * 0b111010..GPIO2 Pin Event Trig 1 input is selected - * 0b111011..GPIO3 Pin Event Trig 0 input is selected - * 0b111100..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM1_EXTFORCE_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM1_EXTFORCE_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM1_EXTFORCE_TRIGIN_MASK) -/*! @} */ - -/*! @name FLEXPWM1_FAULT - PWM1 Fault Input Trigger Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM1_FAULT_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM1_FAULT_TRIGIN_SHIFT (0U) -/*! TRIGIN - FAULT input connections for PWM1 - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT2 input is selected - * 0b000010..Reserved - * 0b000011..Reserved - * 0b000100..Reserved - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER2_MAT1 input is selected - * 0b001001..CTIMER4_MAT1 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..Reserved - * 0b011000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM0_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM0_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * 0b110100..Reserved - * 0b110101..Reserved - * 0b110110..Reserved - * 0b110111..Reserved - * 0b111000..Reserved - * 0b111001..GPIO2 Pin Event Trig 0 input is selected - * 0b111010..GPIO2 Pin Event Trig 1 input is selected - * 0b111011..GPIO3 Pin Event Trig 0 input is selected - * 0b111100..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM1_FAULT_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM1_FAULT_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM1_FAULT_TRIGIN_MASK) -/*! @} */ - -/* The count of INPUTMUX_FLEXPWM1_FAULT */ -#define INPUTMUX_FLEXPWM1_FAULT_COUNT (4U) - -/*! @name PWM0_EXT_CLK - PWM0 External Clock Trigger */ -/*! @{ */ - -#define INPUTMUX_PWM0_EXT_CLK_TRIGIN_MASK (0x7U) -#define INPUTMUX_PWM0_EXT_CLK_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXT_CLK input connections for PWM0 - * 0b000..FRO16K input is selected - * 0b001..OSC_32k input is selected - * 0b010..EVTG_OUT0A input is selected - * 0b011..EVTG_OUT1A input is selected - * 0b100..TRIG_IN0 input is selected - * 0b101..TRIG_IN7 input is selected - * *.. - */ -#define INPUTMUX_PWM0_EXT_CLK_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_PWM0_EXT_CLK_TRIGIN_SHIFT)) & INPUTMUX_PWM0_EXT_CLK_TRIGIN_MASK) -/*! @} */ - -/*! @name PWM1_EXT_CLK - PWM1 External Clock Trigger */ -/*! @{ */ - -#define INPUTMUX_PWM1_EXT_CLK_TRIGIN_MASK (0xFU) -#define INPUTMUX_PWM1_EXT_CLK_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXT_CLK input connections for PWM1 - * 0b0000..FRO16K input is selected - * 0b0001..OSC_32k input is selected - * 0b0010..EVTG_OUT0A input is selected - * 0b0011..EVTG_OUT1A input is selected - * 0b0100..TRIG_IN0 input is selected - * 0b0101..TRIG_IN7 input is selected - * *.. - */ -#define INPUTMUX_PWM1_EXT_CLK_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_PWM1_EXT_CLK_TRIGIN_SHIFT)) & INPUTMUX_PWM1_EXT_CLK_TRIGIN_MASK) -/*! @} */ - -/*! @name EVTG_TRIGN_EVTG_TRIG - EVTG Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_EVTG_TRIGN_EVTG_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_EVTG_TRIGN_EVTG_TRIG_INP_SHIFT (0U) -/*! INP - EVTG trigger input connections - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT1 input is selected - * 0b000010..Reserved - * 0b000011..Reserved - * 0b000100..Reserved - * 0b000101..Reserved - * 0b000110..CTIMER0_MAT3 input is selected - * 0b000111..CTIMER1_MAT3 input is selected - * 0b001000..CTIMER2_MAT3 input is selected - * 0b001001..CTIMER2_MAT2 input is selected - * 0b001010..CTIMER3_MAT2 input is selected - * 0b001011..CTIMER4_MAT2 input is selected - * 0b001100..Reserved - * 0b001101..PINT GPIO_INT_BMAT input is selected - * 0b001110..ADC0_IRQ input is selected - * 0b001111..ADC1_IRQ input is selected - * 0b010000..ADC0_tcomp[0] input is selected - * 0b010001..ADC0_tcomp[1] input is selected - * 0b010010..ADC0_tcomp[2] input is selected - * 0b010011..ADC0_tcomp[3] input is selected - * 0b010100..ADC1_tcomp[0] input is selected - * 0b010101..ADC1_tcomp[1] input is selected - * 0b010110..ADC1_tcomp[2] input is selected - * 0b010111..ADC1_tcomp[3] input is selected - * 0b011000..CMP0_OUT input is selected - * 0b011001..CMP1_OUT input is selected - * 0b011010..Reserved - * 0b011011..PWM0_SM0_MUX_TRIG0 input is selected - * 0b011100..PWM0_SM0_MUX_TRIG1 input is selected - * 0b011101..PWM0_SM1_MUX_TRIG0 input is selected - * 0b011110..PWM0_SM1_MUX_TRIG1 input is selected - * 0b011111..PWM0_SM2_MUX_TRIG0 input is selected - * 0b100000..PWM0_SM2_MUX_TRIG1 input is selected - * 0b100001..PWM0_SM3_MUX_TRIG0 input is selected - * 0b100010..PWM0_SM3_MUX_TRIG1 input is selected - * 0b100011..PWM1_SM0_MUX_TRIG0 input is selected - * 0b100100..PWM1_SM0_MUX_TRIG1 input is selected - * 0b100101..PWM1_SM1_MUX_TRIG0 input is selected - * 0b100110..PWM1_SM1_MUX_TRIG1 input is selected - * 0b100111..PWM1_SM2_MUX_TRIG0 input is selected - * 0b101000..PWM1_SM2_MUX_TRIG1 input is selected - * 0b101001..PWM1_SM3_MUX_TRIG0 input is selected - * 0b101010..PWM1_SM3_MUX_TRIG1 input is selected - * 0b101011..QDC0_CMP/POS_MATCH input is selected - * 0b101100..QDC1_CMP/POS_MATCH input is selected - * 0b101101..TRIG_IN0 input is selected - * 0b101110..TRIG_IN1 input is selected - * 0b101111..TRIG_IN2 input is selected - * 0b110000..TRIG_IN3 input is selected - * 0b110001..LPTMR0 input is selected - * 0b110010..LPTMR1 input is selected - * 0b110011..Reserved - * 0b110100..Reserved - * 0b110101..Reserved - * 0b110110..Reserved - * 0b110111..Reserved - * 0b111000..Reserved - * 0b111001..Reserved - * *.. - */ -#define INPUTMUX_EVTG_TRIGN_EVTG_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_EVTG_TRIGN_EVTG_TRIG_INP_SHIFT)) & INPUTMUX_EVTG_TRIGN_EVTG_TRIG_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_EVTG_TRIGN_EVTG_TRIG */ -#define INPUTMUX_EVTG_TRIGN_EVTG_TRIG_COUNT (16U) - -/*! @name EXT_TRIGN_EXT_TRIG - EXT Trigger Connections */ -/*! @{ */ - -#define INPUTMUX_EXT_TRIGN_EXT_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_EXT_TRIGN_EXT_TRIG_INP_SHIFT (0U) -/*! INP - EXT trigger input connections - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT1 input is selected - * 0b000010..ADC0_IRQ input is selected - * 0b000011..ADC1_IRQ input is selected - * 0b000100..ADC0_tcomp[0] input is selected - * 0b000101..ADC1_tcomp[0] input is selected - * 0b000110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b000111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b001000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b001001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b001010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b001011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b001100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b001101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b001110..QDC0_CMP/POS_MATCH input is selected - * 0b001111..QDC1_CMP/POS_MATCH input is selected - * 0b010000..EVTG_OUT0A input is selected - * 0b010001..EVTG_OUT0B input is selected - * 0b010010..EVTG_OUT1A input is selected - * 0b010011..EVTG_OUT1B input is selected - * 0b010100..EVTG_OUT2A input is selected - * 0b010101..EVTG_OUT2B input is selected - * 0b010110..EVTG_OUT3A input is selected - * 0b010111..EVTG_OUT3B input is selected - * 0b011000..Reserved - * 0b011001..Reserved - * 0b011010..LPTMR0 input is selected - * 0b011011..LPTMR1 input is selected - * 0b011100..Reserved - * 0b011101..Reserved - * 0b011110..Reserved - * 0b011111..Reserved - * 0b100000..Reserved - * 0b100001..Reserved - * 0b100010..LP_FLEXCOMM0 trigger output 3 input is selected - * 0b100011..LP_FLEXCOMM1 trigger output 3 input is selected - * 0b100100..LP_FLEXCOMM2 trigger output 3 input is selected - * 0b100101..LP_FLEXCOMM3 trigger output 3 input is selected - * 0b100110..LP_FLEXCOMM4 trigger output 3 input is selected - * 0b100111..LP_FLEXCOMM5 trigger output 3 input is selected - * 0b101000..LP_FLEXCOMM6 trigger output 3 input is selected - * 0b101001..LP_FLEXCOMM7 trigger output 3 input is selected - * 0b101010..Reserved - * 0b101011..Reserved - * 0b101100..CMP0_OUT input is selected - * 0b101101..CMP1_OUT input is selected - * 0b101110..Reserved - * 0b101111..Reserved - * *.. - */ -#define INPUTMUX_EXT_TRIGN_EXT_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_EXT_TRIGN_EXT_TRIG_INP_SHIFT)) & INPUTMUX_EXT_TRIGN_EXT_TRIG_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_EXT_TRIGN_EXT_TRIG */ -#define INPUTMUX_EXT_TRIGN_EXT_TRIG_COUNT (8U) - -/*! @name CMP1_TRIG - CMP1 Input Connections */ -/*! @{ */ - -#define INPUTMUX_CMP1_TRIG_TRIGIN_MASK (0x3FU) -#define INPUTMUX_CMP1_TRIG_TRIGIN_SHIFT (0U) -/*! TRIGIN - CMP1 input trigger - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT7 input is selected - * 0b000010..Reserved - * 0b000011..Reserved - * 0b000100..Reserved - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER3_MAT1 input is selected - * 0b001001..CTIMER4_MAT1 input is selected - * 0b001010..Reserved - * 0b001011..Reserved - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[1] input is selected - * 0b001110..ADC1_tcomp[1] input is selected - * 0b001111..Reserved - * 0b010000..Reserved - * 0b010001..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b010010..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b010011..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b010100..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b010101..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b010110..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b010111..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b011000..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b011001..QDC0_CMP/POS_MATCH input is selected - * 0b011010..QDC1_CMP/POS_MATCH input is selected - * 0b011011..EVTG_OUT0A input is selected - * 0b011100..EVTG_OUT0B input is selected - * 0b011101..EVTG_OUT1A input is selected - * 0b011110..EVTG_OUT1B input is selected - * 0b011111..EVTG_OUT2A input is selected - * 0b100000..EVTG_OUT2B input is selected - * 0b100001..EVTG_OUT3A input is selected - * 0b100010..EVTG_OUT3B input is selected - * 0b100011..LPTMR0 input is selected - * 0b100100..LPTMR1 input is selected - * 0b100101..GPIO2 Pin Event Trig 0 input is selected - * 0b100110..GPIO2 Pin Event Trig 1 input is selected - * 0b100111..GPIO3 Pin Event Trig 0 input is selected - * 0b101000..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_CMP1_TRIG_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CMP1_TRIG_TRIGIN_SHIFT)) & INPUTMUX_CMP1_TRIG_TRIGIN_MASK) -/*! @} */ - -/*! @name FLEXCOMM0_TRIG - LP_FLEXCOMM0 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXCOMM0_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_FLEXCOMM0_TRIG_INP_SHIFT (0U) -/*! INP - LP_FLEXCOMM0 trigger input connections - * 0b000000..PINT PIN_INT4 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..PINT PIN_INT6 input is selected - * 0b000011..Reserved - * 0b000100..Reserved - * 0b000101..Reserved - * 0b000110..CTIMER0_MAT1 input is selected - * 0b000111..CTIMER1_MAT1 input is selected - * 0b001000..CTIMER2_MAT0 input is selected - * 0b001001..CTIMER3_MAT0 input is selected - * 0b001010..CTIMER4_MAT0 input is selected - * 0b001011..LPTMR0 input is selected - * 0b001100..LPTMR1 input is selected - * 0b001101..Reserved - * 0b001110..PINT GPIO_INT_BMAT input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..Reserved - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..TRIG_IN0 input is selected - * 0b011011..TRIG_IN1 input is selected - * 0b011100..TRIG_IN2 input is selected - * 0b011101..TRIG_IN3 input is selected - * 0b011110..TRIG_IN4 input is selected - * 0b011111..TRIG_IN10 input is selected - * 0b100000..TRIG_IN11 input is selected - * 0b100001..FlexIO CH4 input is selected - * 0b100010..FlexIO CH5 input is selected - * 0b100011..FlexIO CH6 input is selected - * 0b100100..FlexIO CH7 input is selected - * 0b100101..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO2 Pin Event Trig 1 input is selected - * 0b101000..GPIO3 Pin Event Trig 0 input is selected - * 0b101001..GPIO3 Pin Event Trig 1 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXCOMM0_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXCOMM0_TRIG_INP_SHIFT)) & INPUTMUX_FLEXCOMM0_TRIG_INP_MASK) -/*! @} */ - -/*! @name FLEXCOMM1_TRIG - LP_FLEXCOMM1 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXCOMM1_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_FLEXCOMM1_TRIG_INP_SHIFT (0U) -/*! INP - LP_FLEXCOMM1 trigger input connections - * 0b000000..PINT PIN_INT4 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..PINT PIN_INT6 input is selected - * 0b000011..Reserved - * 0b000100..Reserved - * 0b000101..Reserved - * 0b000110..CTIMER0_MAT1 input is selected - * 0b000111..CTIMER1_MAT1 input is selected - * 0b001000..CTIMER2_MAT0 input is selected - * 0b001001..CTIMER3_MAT0 input is selected - * 0b001010..CTIMER4_MAT0 input is selected - * 0b001011..LPTMR0 input is selected - * 0b001100..LPTMR1 input is selected - * 0b001101..Reserved - * 0b001110..PINT GPIO_INT_BMAT input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..Reserved - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..TRIG_IN0 input is selected - * 0b011011..TRIG_IN1 input is selected - * 0b011100..TRIG_IN2 input is selected - * 0b011101..TRIG_IN3 input is selected - * 0b011110..TRIG_IN4 input is selected - * 0b011111..TRIG_IN10 input is selected - * 0b100000..TRIG_IN11 input is selected - * 0b100001..FlexIO CH4 input is selected - * 0b100010..FlexIO CH5 input is selected - * 0b100011..FlexIO CH6 input is selected - * 0b100100..FlexIO CH7 input is selected - * 0b100101..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO2 Pin Event Trig 1 input is selected - * 0b101000..GPIO3 Pin Event Trig 0 input is selected - * 0b101001..GPIO3 Pin Event Trig 1 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXCOMM1_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXCOMM1_TRIG_INP_SHIFT)) & INPUTMUX_FLEXCOMM1_TRIG_INP_MASK) -/*! @} */ - -/*! @name FLEXCOMM2_TRIG - LP_FLEXCOMM2 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXCOMM2_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_FLEXCOMM2_TRIG_INP_SHIFT (0U) -/*! INP - LP_FLEXCOMM2 trigger input connections - * 0b000000..PINT PIN_INT4 input is selected - * 0b000001..PINT PIN_INT6 input is selected - * 0b000010..PINT PIN_INT7 input is selected - * 0b000011..Reserved - * 0b000100..Reserved - * 0b000101..Reserved - * 0b000110..CTIMER0_MAT1 input is selected - * 0b000111..CTIMER1_MAT1 input is selected - * 0b001000..CTIMER2_MAT1 input is selected - * 0b001001..CTIMER3_MAT1 input is selected - * 0b001010..CTIMER4_MAT1 input is selected - * 0b001011..LPTMR0 input is selected - * 0b001100..LPTMR1 input is selected - * 0b001101..Reserved - * 0b001110..PINT GPIO_INT_BMAT input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..Reserved - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..TRIG_IN0 input is selected - * 0b011011..TRIG_IN1 input is selected - * 0b011100..TRIG_IN2 input is selected - * 0b011101..TRIG_IN3 input is selected - * 0b011110..TRIG_IN4 input is selected - * 0b011111..TRIG_IN10 input is selected - * 0b100000..TRIG_IN11 input is selected - * 0b100001..FlexIO CH4 input is selected - * 0b100010..FlexIO CH5 input is selected - * 0b100011..FlexIO CH6 input is selected - * 0b100100..FlexIO CH7 input is selected - * 0b100101..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO2 Pin Event Trig 1 input is selected - * 0b101000..GPIO3 Pin Event Trig 0 input is selected - * 0b101001..GPIO3 Pin Event Trig 1 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXCOMM2_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXCOMM2_TRIG_INP_SHIFT)) & INPUTMUX_FLEXCOMM2_TRIG_INP_MASK) -/*! @} */ - -/*! @name FLEXCOMM3_TRIG - LP_FLEXCOMM3 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXCOMM3_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_FLEXCOMM3_TRIG_INP_SHIFT (0U) -/*! INP - LP_FLEXCOMM3 trigger input connections - * 0b000000..PINT PIN_INT4 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..PINT PIN_INT7 input is selected - * 0b000011..Reserved - * 0b000100..Reserved - * 0b000101..Reserved - * 0b000110..CTIMER0_MAT1 input is selected - * 0b000111..CTIMER1_MAT1 input is selected - * 0b001000..CTIMER2_MAT1 input is selected - * 0b001001..CTIMER3_MAT1 input is selected - * 0b001010..CTIMER4_MAT1 input is selected - * 0b001011..LPTMR0 input is selected - * 0b001100..LPTMR1 input is selected - * 0b001101..Reserved - * 0b001110..PINT GPIO_INT_BMAT input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..Reserved - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..TRIG_IN0 input is selected - * 0b011011..TRIG_IN1 input is selected - * 0b011100..TRIG_IN2 input is selected - * 0b011101..TRIG_IN3 input is selected - * 0b011110..TRIG_IN4 input is selected - * 0b011111..TRIG_IN10 input is selected - * 0b100000..TRIG_IN11 input is selected - * 0b100001..FlexIO CH4 input is selected - * 0b100010..FlexIO CH5 input is selected - * 0b100011..FlexIO CH6 input is selected - * 0b100100..FlexIO CH7 input is selected - * 0b100101..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO2 Pin Event Trig 1 input is selected - * 0b101000..GPIO3 Pin Event Trig 0 input is selected - * 0b101001..GPIO3 Pin Event Trig 1 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXCOMM3_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXCOMM3_TRIG_INP_SHIFT)) & INPUTMUX_FLEXCOMM3_TRIG_INP_MASK) -/*! @} */ - -/*! @name FLEXCOMM4_TRIG - LP_FLEXCOMM4 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXCOMM4_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_FLEXCOMM4_TRIG_INP_SHIFT (0U) -/*! INP - LP_FLEXCOMM4 trigger input connections - * 0b000000..PINT PIN_INT4 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..PINT PIN_INT7 input is selected - * 0b000011..Reserved - * 0b000100..Reserved - * 0b000101..Reserved - * 0b000110..CTIMER0_MAT1 input is selected - * 0b000111..CTIMER1_MAT1 input is selected - * 0b001000..CTIMER2_MAT2 input is selected - * 0b001001..CTIMER3_MAT2 input is selected - * 0b001010..CTIMER4_MAT2 input is selected - * 0b001011..LPTMR0 input is selected - * 0b001100..LPTMR1 input is selected - * 0b001101..Reserved - * 0b001110..PINT GPIO_INT_BMAT input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..Reserved - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..TRIG_IN0 input is selected - * 0b011011..TRIG_IN1 input is selected - * 0b011100..TRIG_IN2 input is selected - * 0b011101..TRIG_IN3 input is selected - * 0b011110..TRIG_IN4 input is selected - * 0b011111..TRIG_IN10 input is selected - * 0b100000..TRIG_IN11 input is selected - * 0b100001..FlexIO CH4 input is selected - * 0b100010..FlexIO CH5 input is selected - * 0b100011..FlexIO CH6 input is selected - * 0b100100..FlexIO CH7 input is selected - * 0b100101..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO2 Pin Event Trig 1 input is selected - * 0b101000..GPIO3 Pin Event Trig 0 input is selected - * 0b101001..GPIO3 Pin Event Trig 1 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXCOMM4_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXCOMM4_TRIG_INP_SHIFT)) & INPUTMUX_FLEXCOMM4_TRIG_INP_MASK) -/*! @} */ - -/*! @name FLEXCOMM5_TRIG - LP_FLEXCOMM5 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXCOMM5_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_FLEXCOMM5_TRIG_INP_SHIFT (0U) -/*! INP - LP_FLEXCOMM5 trigger input connections - * 0b000000..PINT PIN_INT4 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..PINT PIN_INT7 input is selected - * 0b000011..Reserved - * 0b000100..Reserved - * 0b000101..Reserved - * 0b000110..CTIMER0_MAT1 input is selected - * 0b000111..CTIMER1_MAT1 input is selected - * 0b001000..CTIMER2_MAT2 input is selected - * 0b001001..CTIMER3_MAT2 input is selected - * 0b001010..CTIMER4_MAT2 input is selected - * 0b001011..LPTMR0 input is selected - * 0b001100..LPTMR1 input is selected - * 0b001101..Reserved - * 0b001110..PINT GPIO_INT_BMAT input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..Reserved - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..TRIG_IN0 input is selected - * 0b011011..TRIG_IN1 input is selected - * 0b011100..TRIG_IN2 input is selected - * 0b011101..TRIG_IN3 input is selected - * 0b011110..TRIG_IN4 input is selected - * 0b011111..TRIG_IN10 input is selected - * 0b100000..TRIG_IN11 input is selected - * 0b100001..FlexIO CH4 input is selected - * 0b100010..FlexIO CH5 input is selected - * 0b100011..FlexIO CH6 input is selected - * 0b100100..FlexIO CH7 input is selected - * 0b100101..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO2 Pin Event Trig 1 input is selected - * 0b101000..GPIO3 Pin Event Trig 0 input is selected - * 0b101001..GPIO3 Pin Event Trig 1 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXCOMM5_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXCOMM5_TRIG_INP_SHIFT)) & INPUTMUX_FLEXCOMM5_TRIG_INP_MASK) -/*! @} */ - -/*! @name FLEXCOMM6_TRIG - LP_FLEXCOMM6 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXCOMM6_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_FLEXCOMM6_TRIG_INP_SHIFT (0U) -/*! INP - LP_FLEXCOMM6 trigger input connections - * 0b000000..PINT PIN_INT4 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..PINT PIN_INT7 input is selected - * 0b000011..Reserved - * 0b000100..Reserved - * 0b000101..Reserved - * 0b000110..CTIMER0_MAT1 input is selected - * 0b000111..CTIMER1_MAT1 input is selected - * 0b001000..CTIMER2_MAT3 input is selected - * 0b001001..CTIMER3_MAT3 input is selected - * 0b001010..CTIMER4_MAT3 input is selected - * 0b001011..LPTMR0 input is selected - * 0b001100..LPTMR1 input is selected - * 0b001101..Reserved - * 0b001110..PINT GPIO_INT_BMAT input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..Reserved - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..TRIG_IN0 input is selected - * 0b011011..TRIG_IN1 input is selected - * 0b011100..TRIG_IN2 input is selected - * 0b011101..TRIG_IN3 input is selected - * 0b011110..TRIG_IN4 input is selected - * 0b011111..TRIG_IN10 input is selected - * 0b100000..TRIG_IN11 input is selected - * 0b100001..FlexIO CH4 input is selected - * 0b100010..FlexIO CH5 input is selected - * 0b100011..FlexIO CH6 input is selected - * 0b100100..FlexIO CH7 input is selected - * 0b100101..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO2 Pin Event Trig 1 input is selected - * 0b101000..GPIO3 Pin Event Trig 0 input is selected - * 0b101001..GPIO3 Pin Event Trig 1 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXCOMM6_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXCOMM6_TRIG_INP_SHIFT)) & INPUTMUX_FLEXCOMM6_TRIG_INP_MASK) -/*! @} */ - -/*! @name FLEXCOMM7_TRIG - LP_FLEXCOMM7 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXCOMM7_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_FLEXCOMM7_TRIG_INP_SHIFT (0U) -/*! INP - LP_FLEXCOMM7 trigger input connections - * 0b000000..PINT PIN_INT4 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..PINT PIN_INT7 input is selected - * 0b000011..Reserved - * 0b000100..Reserved - * 0b000101..Reserved - * 0b000110..CTIMER0_MAT1 input is selected - * 0b000111..CTIMER1_MAT1 input is selected - * 0b001000..CTIMER2_MAT3 input is selected - * 0b001001..CTIMER3_MAT3 input is selected - * 0b001010..CTIMER4_MAT3 input is selected - * 0b001011..LPTMR0 input is selected - * 0b001100..LPTMR1 input is selected - * 0b001101..Reserved - * 0b001110..PINT GPIO_INT_BMAT input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..Reserved - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..TRIG_IN0 input is selected - * 0b011011..TRIG_IN1 input is selected - * 0b011100..TRIG_IN2 input is selected - * 0b011101..TRIG_IN3 input is selected - * 0b011110..TRIG_IN4 input is selected - * 0b011111..TRIG_IN10 input is selected - * 0b100000..TRIG_IN11 input is selected - * 0b100001..FlexIO CH4 input is selected - * 0b100010..FlexIO CH5 input is selected - * 0b100011..FlexIO CH6 input is selected - * 0b100100..FlexIO CH7 input is selected - * 0b100101..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO2 Pin Event Trig 1 input is selected - * 0b101000..GPIO3 Pin Event Trig 0 input is selected - * 0b101001..GPIO3 Pin Event Trig 1 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXCOMM7_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXCOMM7_TRIG_INP_SHIFT)) & INPUTMUX_FLEXCOMM7_TRIG_INP_MASK) -/*! @} */ - -/*! @name FLEXIO_TRIGN_FLEXIO_TRIG - FlexIO Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXIO_TRIGN_FLEXIO_TRIG_INP_MASK (0x7FU) -#define INPUTMUX_FLEXIO_TRIGN_FLEXIO_TRIG_INP_SHIFT (0U) -/*! INP - Input number for FlexIO0. - * 0b0000000..PINT PIN_INT4 input is selected - * 0b0000001..PINT PIN_INT5 input is selected - * 0b0000010..PINT PIN_INT6 input is selected - * 0b0000011..PINT PIN_INT7 input is selected - * 0b0000100..Reserved - * 0b0000101..Reserved - * 0b0000110..Reserved - * 0b0000111..Reserved - * 0b0001000..Reserved - * 0b0001001..T0_MAT1 input is selected - * 0b0001010..T1_MAT1 input is selected - * 0b0001011..T2_MAT1 input is selected - * 0b0001100..T3_MAT1 input is selected - * 0b0001101..T4_MAT1 input is selected - * 0b0001110..LPTMR0 input is selected - * 0b0001111..LPTMR1 input is selected - * 0b0010000..Reserved - * 0b0010001..PINT GPIO_INT_BMAT input is selected - * 0b0010010..ADC0_tcomp[0] input is selected - * 0b0010011..ADC0_tcomp[1] input is selected - * 0b0010100..ADC0_tcomp[2] input is selected - * 0b0010101..ADC0_tcomp[3] input is selected - * 0b0010110..ADC1_tcomp[0] input is selected - * 0b0010111..ADC1_tcomp[1] input is selected - * 0b0011000..ADC1_tcomp[2] input is selected - * 0b0011001..ADC1_tcomp[3] input is selected - * 0b0011010..CMP0_OUT input is selected - * 0b0011011..CMP1_OUT input is selected - * 0b0011100..Reserved - * 0b0011101..PWM0_SM0_MUX_TRIG0 input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0100000..PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0100010..PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100011..PWM0_SM3_MUX_TRIG0 input is selected - * 0b0100100..PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM0_MUX_TRIG0 input is selected - * 0b0100110..PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100111..PWM1_SM1_MUX_TRIG0 input is selected - * 0b0101000..PWM1_SM1_MUX_TRIG1 input is selected - * 0b0101001..PWM1_SM2_MUX_TRIG0 input is selected - * 0b0101010..PWM1_SM2_MUX_TRIG1 input is selected - * 0b0101011..PWM1_SM3_MUX_TRIG0 input is selected - * 0b0101100..PWM1_SM3_MUX_TRIG1 input is selected - * 0b0101101..EVTG_OUT0A input is selected - * 0b0101110..EVTG_OUT0B input is selected - * 0b0101111..EVTG_OUT1A input is selected - * 0b0110000..EVTG_OUT1B input is selected - * 0b0110001..EVTG_OUT2A input is selected - * 0b0110010..EVTG_OUT2B input is selected - * 0b0110011..EVTG_OUT3A input is selected - * 0b0110100..EVTG_OUT3B input is selected - * 0b0110101..TRIG_IN0 input is selected - * 0b0110110..TRIG_IN1 input is selected - * 0b0110111..TRIG_IN2 input is selected - * 0b0111000..TRIG_IN3 input is selected - * 0b0111001..TRIG_IN4 input is selected - * 0b0111010..Reserved - * 0b0111011..Reserved - * 0b0111100..Reserved - * 0b0111101..Reserved - * 0b0111110..Reserved - * 0b0111111..LP_FLEXCOMM0 trig 0 (lpuart_trg_txword) input is selected - * 0b1000000..LP_FLEXCOMM0 trig 1 (lpuart_trg_rxword) input is selected - * 0b1000001..LP_FLEXCOMM0 trig 2 (lpuart_trg_rxidle) input is selected - * 0b1000010..LP_FLEXCOMM1 trig 0 input is selected - * 0b1000011..LP_FLEXCOMM1 trig 1 input is selected - * 0b1000100..LP_FLEXCOMM1 trig 2 input is selected - * 0b1000101..LP_FLEXCOMM2 trig 0 input is selected - * 0b1000110..LP_FLEXCOMM2 trig 1 input is selected - * 0b1000111..LP_FLEXCOMM2 trig 2 input is selected - * 0b1001000..LP_FLEXCOMM3 trig 0 input is selected - * 0b1001001..LP_FLEXCOMM3 trig 1 input is selected - * 0b1001010..LP_FLEXCOMM3 trig 2 input is selected - * 0b1001011..LP_FLEXCOMM3 trig 3 input is selected - * 0b1001100..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXIO_TRIGN_FLEXIO_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXIO_TRIGN_FLEXIO_TRIG_INP_SHIFT)) & INPUTMUX_FLEXIO_TRIGN_FLEXIO_TRIG_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_FLEXIO_TRIGN_FLEXIO_TRIG */ -#define INPUTMUX_FLEXIO_TRIGN_FLEXIO_TRIG_COUNT (8U) - -/*! @name DMA0_REQ_ENABLE0 - DMA0 Request Enable0 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ3_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ3_EN0_SHIFT (3U) -/*! REQ3_EN0 - This register is used to enable and disable PINT0 INT0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ3_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ3_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ3_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ4_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ4_EN0_SHIFT (4U) -/*! REQ4_EN0 - This register is used to enable and disable PINT0 INT1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ4_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ4_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ4_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ5_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ5_EN0_SHIFT (5U) -/*! REQ5_EN0 - This register is used to enable and disable PINT0 INT2 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ5_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ5_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ5_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ6_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ6_EN0_SHIFT (6U) -/*! REQ6_EN0 - This register is used to enable and disable PINT0 INT3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ6_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ6_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ6_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ7_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ7_EN0_SHIFT (7U) -/*! REQ7_EN0 - This register is used to enable and disable CTIMER0 DMAREQ_M0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ7_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ7_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ7_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ8_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ8_EN0_SHIFT (8U) -/*! REQ8_EN0 - This register is used to enable and disable CTIMER0 DMAREQ_M1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ8_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ8_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ8_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ9_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ9_EN0_SHIFT (9U) -/*! REQ9_EN0 - This register is used to enable and disable CTIMER1 DMAREQ_M0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ9_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ9_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ9_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ10_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ10_EN0_SHIFT (10U) -/*! REQ10_EN0 - This register is used to enable and disable CTIMER1 DMAREQ_M1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ10_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ10_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ10_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ11_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ11_EN0_SHIFT (11U) -/*! REQ11_EN0 - This register is used to enable and disable CTIMER2 DMAREQ_M0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ11_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ11_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ11_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ12_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ12_EN0_SHIFT (12U) -/*! REQ12_EN0 - This register is used to enable and disable CTIMER2 DMAREQ_M1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ12_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ12_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ12_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ13_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ13_EN0_SHIFT (13U) -/*! REQ13_EN0 - This register is used to enable and disable CTIMER3 DMAREQ_M0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ13_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ13_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ13_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ14_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ14_EN0_SHIFT (14U) -/*! REQ14_EN0 - This register is used to enable and disable CTIMER3 DMAREQ_M1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ14_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ14_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ14_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ15_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ15_EN0_SHIFT (15U) -/*! REQ15_EN0 - This register is used to enable and disable CTIMER4 DMAREQ_M0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ15_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ15_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ15_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ16_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ16_EN0_SHIFT (16U) -/*! REQ16_EN0 - This register is used to enable and disable CTIMER4 DMAREQ_M1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ16_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ16_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ16_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ17_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ17_EN0_SHIFT (17U) -/*! REQ17_EN0 - This register is used to enable and disable WUU0 wake up event request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ17_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ17_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ17_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ18_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ18_EN0_SHIFT (18U) -/*! REQ18_EN0 - This register is used to enable and disable MICFIL0 FIFO_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ18_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ18_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ18_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ21_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ21_EN0_SHIFT (21U) -/*! REQ21_EN0 - This register is used to enable and disable ADC0 FIFO A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ21_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ21_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ21_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ22_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ22_EN0_SHIFT (22U) -/*! REQ22_EN0 - This register is used to enable and disable ADC0 FIFO B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ22_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ22_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ22_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ23_EN0_MASK (0x800000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ23_EN0_SHIFT (23U) -/*! REQ23_EN0 - This register is used to enable and disable ADC1 FIFO A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ23_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ23_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ23_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ24_EN0_MASK (0x1000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ24_EN0_SHIFT (24U) -/*! REQ24_EN0 - This register is used to enable and disable ADC1 FIFO B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ24_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ24_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ24_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ28_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ28_EN0_SHIFT (28U) -/*! REQ28_EN0 - This register is used to enable and disable CMP0 DMA_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ28_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ28_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ28_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ29_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ29_EN0_SHIFT (29U) -/*! REQ29_EN0 - This register is used to enable and disable CMP1 DMA_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ29_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ29_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ29_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ31_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ31_EN0_SHIFT (31U) -/*! REQ31_EN0 - This register is used to enable and disable EVTG0 OUT0A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ31_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ31_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ31_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE0_SET - DMA0 Request Enable0 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ3_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ3_EN0_SHIFT (3U) -/*! REQ3_EN0 - Writing a 1 to REQ3_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ3_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ3_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ3_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ4_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ4_EN0_SHIFT (4U) -/*! REQ4_EN0 - Writing a 1 to REQ4_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ4_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ4_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ4_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ5_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ5_EN0_SHIFT (5U) -/*! REQ5_EN0 - Writing a 1 to REQ5_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ5_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ5_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ5_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ6_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ6_EN0_SHIFT (6U) -/*! REQ6_EN0 - Writing a 1 to REQ6_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ6_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ6_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ6_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ7_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ7_EN0_SHIFT (7U) -/*! REQ7_EN0 - Writing a 1 to REQ7_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ7_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ7_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ7_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ8_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ8_EN0_SHIFT (8U) -/*! REQ8_EN0 - Writing a 1 to REQ8_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ8_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ8_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ8_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ9_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ9_EN0_SHIFT (9U) -/*! REQ9_EN0 - Writing a 1 to REQ9_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ9_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ9_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ9_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ10_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ10_EN0_SHIFT (10U) -/*! REQ10_EN0 - Writing a 1 to REQ10_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ10_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ10_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ10_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ11_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ11_EN0_SHIFT (11U) -/*! REQ11_EN0 - Writing a 1 to REQ11_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ11_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ11_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ11_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ12_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ12_EN0_SHIFT (12U) -/*! REQ12_EN0 - Writing a 1 to REQ12_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ12_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ12_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ12_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ13_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ13_EN0_SHIFT (13U) -/*! REQ13_EN0 - Writing a 1 to REQ13_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ13_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ13_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ13_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ14_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ14_EN0_SHIFT (14U) -/*! REQ14_EN0 - Writing a 1 to REQ14_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ14_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ14_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ14_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ15_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ15_EN0_SHIFT (15U) -/*! REQ15_EN0 - Writing a 1 to REQ15_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ15_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ15_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ15_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ16_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ16_EN0_SHIFT (16U) -/*! REQ16_EN0 - Writing a 1 to REQ16_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ16_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ16_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ16_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ17_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ17_EN0_SHIFT (17U) -/*! REQ17_EN0 - Writing a 1 to REQ17_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ17_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ17_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ17_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ18_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ18_EN0_SHIFT (18U) -/*! REQ18_EN0 - Writing a 1 to REQ18_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ18_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ18_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ18_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ21_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ21_EN0_SHIFT (21U) -/*! REQ21_EN0 - Writing a 1 to REQ21_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ21_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ21_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ21_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ22_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ22_EN0_SHIFT (22U) -/*! REQ22_EN0 - Writing a 1 to REQ22_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ22_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ22_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ22_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ23_EN0_MASK (0x800000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ23_EN0_SHIFT (23U) -/*! REQ23_EN0 - Writing a 1 to REQ23_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ23_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ23_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ23_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ24_EN0_MASK (0x1000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ24_EN0_SHIFT (24U) -/*! REQ24_EN0 - Writing a 1 to REQ24_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ24_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ24_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ24_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ28_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ28_EN0_SHIFT (28U) -/*! REQ28_EN0 - Writing a 1 to REQ28_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ28_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ28_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ28_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ29_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ29_EN0_SHIFT (29U) -/*! REQ29_EN0 - Writing a 1 to REQ29_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ29_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ29_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ29_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ31_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ31_EN0_SHIFT (31U) -/*! REQ31_EN0 - Writing a 1 to REQ31_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ31_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ31_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ31_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE0_CLR - DMA0 Request Enable0 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ3_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ3_EN0_SHIFT (3U) -/*! REQ3_EN0 - Writing a 1 to REQ3_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ3_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ3_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ3_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ4_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ4_EN0_SHIFT (4U) -/*! REQ4_EN0 - Writing a 1 to REQ4_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ4_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ4_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ4_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ5_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ5_EN0_SHIFT (5U) -/*! REQ5_EN0 - Writing a 1 to REQ5_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ5_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ5_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ5_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ6_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ6_EN0_SHIFT (6U) -/*! REQ6_EN0 - Writing a 1 to REQ6_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ6_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ6_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ6_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ7_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ7_EN0_SHIFT (7U) -/*! REQ7_EN0 - Writing a 1 to REQ7_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ7_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ7_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ7_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ8_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ8_EN0_SHIFT (8U) -/*! REQ8_EN0 - Writing a 1 to REQ8_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ8_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ8_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ8_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ9_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ9_EN0_SHIFT (9U) -/*! REQ9_EN0 - Writing a 1 to REQ9_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ9_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ9_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ9_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ10_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ10_EN0_SHIFT (10U) -/*! REQ10_EN0 - Writing a 1 to REQ10_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ10_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ10_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ10_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ11_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ11_EN0_SHIFT (11U) -/*! REQ11_EN0 - Writing a 1 to REQ11_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ11_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ11_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ11_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ12_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ12_EN0_SHIFT (12U) -/*! REQ12_EN0 - Writing a 1 to REQ12_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ12_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ12_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ12_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ13_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ13_EN0_SHIFT (13U) -/*! REQ13_EN0 - Writing a 1 to REQ13_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ13_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ13_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ13_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ14_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ14_EN0_SHIFT (14U) -/*! REQ14_EN0 - Writing a 1 to REQ14_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ14_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ14_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ14_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ15_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ15_EN0_SHIFT (15U) -/*! REQ15_EN0 - Writing a 1 to REQ15_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ15_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ15_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ15_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ16_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ16_EN0_SHIFT (16U) -/*! REQ16_EN0 - Writing a 1 to REQ16_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ16_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ16_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ16_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ17_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ17_EN0_SHIFT (17U) -/*! REQ17_EN0 - Writing a 1 to REQ17_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ17_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ17_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ17_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ18_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ18_EN0_SHIFT (18U) -/*! REQ18_EN0 - Writing a 1 to REQ18_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ18_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ18_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ18_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ21_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ21_EN0_SHIFT (21U) -/*! REQ21_EN0 - Writing a 1 to REQ21_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ21_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ21_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ21_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ22_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ22_EN0_SHIFT (22U) -/*! REQ22_EN0 - Writing a 1 to REQ22_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ22_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ22_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ22_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ23_EN0_MASK (0x800000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ23_EN0_SHIFT (23U) -/*! REQ23_EN0 - Writing a 1 to REQ23_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ23_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ23_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ23_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ24_EN0_MASK (0x1000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ24_EN0_SHIFT (24U) -/*! REQ24_EN0 - Writing a 1 to REQ24_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ24_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ24_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ24_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ28_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ28_EN0_SHIFT (28U) -/*! REQ28_EN0 - Writing a 1 to REQ28_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ28_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ28_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ28_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ29_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ29_EN0_SHIFT (29U) -/*! REQ29_EN0 - Writing a 1 to REQ29_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ29_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ29_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ29_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ31_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ31_EN0_SHIFT (31U) -/*! REQ31_EN0 - Writing a 1 to REQ31_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ31_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ31_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ31_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE0_TOG - DMA0 Request Enable0 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ3_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ3_EN0_SHIFT (3U) -/*! REQ3_EN0 - Writing a 1 to REQ3_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ3_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ3_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ3_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ4_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ4_EN0_SHIFT (4U) -/*! REQ4_EN0 - Writing a 1 to REQ4_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ4_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ4_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ4_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ5_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ5_EN0_SHIFT (5U) -/*! REQ5_EN0 - Writing a 1 to REQ5_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ5_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ5_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ5_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ6_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ6_EN0_SHIFT (6U) -/*! REQ6_EN0 - Writing a 1 to REQ6_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ6_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ6_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ6_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ7_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ7_EN0_SHIFT (7U) -/*! REQ7_EN0 - Writing a 1 to REQ7_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ7_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ7_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ7_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ8_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ8_EN0_SHIFT (8U) -/*! REQ8_EN0 - Writing a 1 to REQ8_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ8_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ8_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ8_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ9_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ9_EN0_SHIFT (9U) -/*! REQ9_EN0 - Writing a 1 to RE9_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ9_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ9_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ9_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ10_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ10_EN0_SHIFT (10U) -/*! REQ10_EN0 - Writing a 1 to REQ10_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ10_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ10_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ10_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ11_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ11_EN0_SHIFT (11U) -/*! REQ11_EN0 - Writing a 1 to REQ11_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ11_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ11_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ11_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ12_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ12_EN0_SHIFT (12U) -/*! REQ12_EN0 - Writing a 1 to REQ12_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ12_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ12_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ12_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ13_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ13_EN0_SHIFT (13U) -/*! REQ13_EN0 - Writing a 1 to REQ13_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ13_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ13_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ13_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ14_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ14_EN0_SHIFT (14U) -/*! REQ14_EN0 - Writing a 1 to REQ14_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ14_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ14_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ14_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ15_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ15_EN0_SHIFT (15U) -/*! REQ15_EN0 - Writing a 1 to REQ15_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ15_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ15_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ15_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ16_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ16_EN0_SHIFT (16U) -/*! REQ16_EN0 - Writing a 1 to REQ16_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ16_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ16_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ16_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ17_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ17_EN0_SHIFT (17U) -/*! REQ17_EN0 - Writing a 1 to REQ17_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ17_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ17_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ17_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ18_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ18_EN0_SHIFT (18U) -/*! REQ18_EN0 - Writing a 1 to REQ18_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ18_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ18_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ18_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ21_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ21_EN0_SHIFT (21U) -/*! REQ21_EN0 - Writing a 1 to REQ21_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ21_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ21_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ21_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ22_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ22_EN0_SHIFT (22U) -/*! REQ22_EN0 - Writing a 1 to REQ22_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ22_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ22_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ22_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ23_EN0_MASK (0x800000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ23_EN0_SHIFT (23U) -/*! REQ23_EN0 - Writing a 1 to REQ23_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ23_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ23_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ23_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ24_EN0_MASK (0x1000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ24_EN0_SHIFT (24U) -/*! REQ24_EN0 - Writing a 1 to REQ24_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ24_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ24_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ24_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ28_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ28_EN0_SHIFT (28U) -/*! REQ28_EN0 - Writing a 1 to REQ28_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ28_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ28_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ28_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ29_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ29_EN0_SHIFT (29U) -/*! REQ29_EN0 - Writing a 1 to REQ29_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ29_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ29_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ29_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ31_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ31_EN0_SHIFT (31U) -/*! REQ31_EN0 - Writing a 1 to REQ31_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ31_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ31_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ31_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE1 - DMA0 Request Enable1 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ32_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ32_EN0_SHIFT (0U) -/*! REQ32_EN0 - This register is used to enable and disable EVTG0 OUT0B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ32_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ32_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ32_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ33_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ33_EN0_SHIFT (1U) -/*! REQ33_EN0 - This register is used to enable and disable EVTG0 OUT1A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ33_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ33_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ33_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ34_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ34_EN0_SHIFT (2U) -/*! REQ34_EN0 - This register is used to enable and disable EVTG0 OUT1B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ34_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ34_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ34_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ35_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ35_EN0_SHIFT (3U) -/*! REQ35_EN0 - This register is used to enable and disable EVTG0 OUT2A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ35_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ35_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ35_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ36_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ36_EN0_SHIFT (4U) -/*! REQ36_EN0 - This register is used to enable and disable EVTG0 OUT2B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ36_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ36_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ36_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ37_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ37_EN0_SHIFT (5U) -/*! REQ37_EN0 - This register is used to enable and disable EVTG0 OUT3A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ37_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ37_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ37_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ38_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ38_EN0_SHIFT (6U) -/*! REQ38_EN0 - This register is used to enable and disable EVTG0 OUT3B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ38_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ38_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ38_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ39_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ39_EN0_SHIFT (7U) -/*! REQ39_EN0 - This register is used to enable and disable PWM0 Req_capt0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ39_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ39_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ39_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ40_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ40_EN0_SHIFT (8U) -/*! REQ40_EN0 - This register is used to enable and disable PWM0 Req_capt1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ40_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ40_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ40_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ41_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ41_EN0_SHIFT (9U) -/*! REQ41_EN0 - This register is used to enable and disable PWM0 Req_capt2 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ41_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ41_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ41_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ42_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ42_EN0_SHIFT (10U) -/*! REQ42_EN0 - This register is used to enable and disable PWM0 Req_capt3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ42_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ42_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ42_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ43_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ43_EN0_SHIFT (11U) -/*! REQ43_EN0 - This register is used to enable and disable PWM0 Req_val0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ43_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ43_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ43_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ44_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ44_EN0_SHIFT (12U) -/*! REQ44_EN0 - This register is used to enable and disable PWM0 Req_val1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ44_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ44_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ44_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ45_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ45_EN0_SHIFT (13U) -/*! REQ45_EN0 - This register is used to enable and disable PWM0 Req_val2 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ45_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ45_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ45_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ46_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ46_EN0_SHIFT (14U) -/*! REQ46_EN0 - This register is used to enable and disable PWM0 Req_val3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ46_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ46_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ46_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ47_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ47_EN0_SHIFT (15U) -/*! REQ47_EN0 - This register is used to enable and disable PWM1 Req_capt0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ47_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ47_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ47_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ48_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ48_EN0_SHIFT (16U) -/*! REQ48_EN0 - This register is used to enable and disable PWM1 Req_capt1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ48_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ48_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ48_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ49_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ49_EN0_SHIFT (17U) -/*! REQ49_EN0 - This register is used to enable and disable PWM1 Req_capt2 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ49_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ49_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ49_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ50_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ50_EN0_SHIFT (18U) -/*! REQ50_EN0 - This register is used to enable and disable PWM1 Req_capt3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ50_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ50_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ50_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ51_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ51_EN0_SHIFT (19U) -/*! REQ51_EN0 - This register is used to enable and disable PWM1 Req_val0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ51_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ51_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ51_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ52_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ52_EN0_SHIFT (20U) -/*! REQ52_EN0 - This register is used to enable and disable PWM1 Req_val1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ52_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ52_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ52_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ53_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ53_EN0_SHIFT (21U) -/*! REQ53_EN0 - This register is used to enable and disable PWM1 Req_val2 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ53_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ53_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ53_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ54_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ54_EN0_SHIFT (22U) -/*! REQ54_EN0 - This register is used to enable and disable PWM1 Req_val3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ54_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ54_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ54_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ57_EN0_MASK (0x2000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ57_EN0_SHIFT (25U) -/*! REQ57_EN0 - This register is used to enable and disable LPTMR0 counter match event request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ57_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ57_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ57_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ58_EN0_MASK (0x4000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ58_EN0_SHIFT (26U) -/*! REQ58_EN0 - This register is used to enable and disable LPTMR1 counter match event request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ58_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ58_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ58_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ59_EN0_MASK (0x8000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ59_EN0_SHIFT (27U) -/*! REQ59_EN0 - This register is used to enable and disable CAN0 DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ59_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ59_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ59_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ60_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ60_EN0_SHIFT (28U) -/*! REQ60_EN0 - This register is used to enable and disable CAN1 DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ60_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ60_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ60_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ61_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ61_EN0_SHIFT (29U) -/*! REQ61_EN0 - This register is used to enable and disable FlexIO0 Shifter0 Status DMA request OR Timer0 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ61_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ61_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ61_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ62_EN0_MASK (0x40000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ62_EN0_SHIFT (30U) -/*! REQ62_EN0 - This register is used to enable and disable FlexIO0 Shifter1 Status DMA request OR Timer1 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ62_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ62_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ62_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ63_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ63_EN0_SHIFT (31U) -/*! REQ63_EN0 - This register is used to enable and disable FlexIO0 Shifter2 Status DMA request OR Timer2 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ63_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ63_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ63_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE1_SET - DMA0 Request Enable1 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ32_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ32_EN0_SHIFT (0U) -/*! REQ32_EN0 - Writing a 1 to REQ32_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ32_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ32_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ32_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ33_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ33_EN0_SHIFT (1U) -/*! REQ33_EN0 - Writing a 1 to REQ33_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ33_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ33_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ33_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ34_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ34_EN0_SHIFT (2U) -/*! REQ34_EN0 - Writing a 1 to REQ34_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ34_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ34_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ34_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ35_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ35_EN0_SHIFT (3U) -/*! REQ35_EN0 - Writing a 1 to REQ35_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ35_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ35_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ35_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ36_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ36_EN0_SHIFT (4U) -/*! REQ36_EN0 - Writing a 1 to REQ36_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ36_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ36_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ36_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ37_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ37_EN0_SHIFT (5U) -/*! REQ37_EN0 - Writing a 1 to REQ37_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ37_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ37_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ37_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ38_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ38_EN0_SHIFT (6U) -/*! REQ38_EN0 - Writing a 1 to REQ38_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ38_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ38_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ38_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ39_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ39_EN0_SHIFT (7U) -/*! REQ39_EN0 - Writing a 1 to REQ39_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ39_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ39_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ39_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ40_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ40_EN0_SHIFT (8U) -/*! REQ40_EN0 - Writing a 1 to REQ40_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ40_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ40_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ40_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ41_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ41_EN0_SHIFT (9U) -/*! REQ41_EN0 - Writing a 1 to REQ41_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ41_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ41_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ41_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ42_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ42_EN0_SHIFT (10U) -/*! REQ42_EN0 - Writing a 1 to REQ42_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ42_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ42_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ42_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ43_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ43_EN0_SHIFT (11U) -/*! REQ43_EN0 - Writing a 1 to REQ43_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ43_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ43_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ43_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ44_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ44_EN0_SHIFT (12U) -/*! REQ44_EN0 - Writing a 1 to REQ44_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ44_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ44_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ44_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ45_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ45_EN0_SHIFT (13U) -/*! REQ45_EN0 - Writing a 1 to REQ45_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ45_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ45_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ45_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ46_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ46_EN0_SHIFT (14U) -/*! REQ46_EN0 - Writing a 1 to REQ46_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ46_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ46_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ46_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ47_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ47_EN0_SHIFT (15U) -/*! REQ47_EN0 - Writing a 1 to REQ47_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ47_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ47_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ47_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ48_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ48_EN0_SHIFT (16U) -/*! REQ48_EN0 - Writing a 1 to REQ48_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ48_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ48_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ48_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ49_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ49_EN0_SHIFT (17U) -/*! REQ49_EN0 - Writing a 1 to REQ49_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ49_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ49_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ49_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ50_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ50_EN0_SHIFT (18U) -/*! REQ50_EN0 - Writing a 1 to REQ50_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ50_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ50_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ50_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ51_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ51_EN0_SHIFT (19U) -/*! REQ51_EN0 - Writing a 1 to REQ51_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ51_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ51_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ51_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ52_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ52_EN0_SHIFT (20U) -/*! REQ52_EN0 - Writing a 1 to REQ52_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ52_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ52_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ52_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ53_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ53_EN0_SHIFT (21U) -/*! REQ53_EN0 - Writing a 1 to REQ53_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ53_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ53_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ53_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ54_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ54_EN0_SHIFT (22U) -/*! REQ54_EN0 - Writing a 1 to REQ54_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ54_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ54_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ54_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ57_EN0_MASK (0x2000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ57_EN0_SHIFT (25U) -/*! REQ57_EN0 - Writing a 1 to REQ57_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ57_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ57_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ57_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ58_EN0_MASK (0x4000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ58_EN0_SHIFT (26U) -/*! REQ58_EN0 - Writing a 1 to REQ58_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ58_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ58_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ58_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ59_EN0_MASK (0x8000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ59_EN0_SHIFT (27U) -/*! REQ59_EN0 - Writing a 1 to REQ59_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ59_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ59_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ59_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ60_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ60_EN0_SHIFT (28U) -/*! REQ60_EN0 - Writing a 1 to REQ60_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ60_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ60_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ60_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ61_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ61_EN0_SHIFT (29U) -/*! REQ61_EN0 - Writing a 1 to REQ61_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ61_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ61_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ61_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ62_EN0_MASK (0x40000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ62_EN0_SHIFT (30U) -/*! REQ62_EN0 - Writing a 1 to REQ62_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ62_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ62_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ62_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ63_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ63_EN0_SHIFT (31U) -/*! REQ63_EN0 - Writing a 1 to REQ63_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ63_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ63_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ63_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE1_CLR - DMA0 Request Enable1 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ32_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ32_EN0_SHIFT (0U) -/*! REQ32_EN0 - Writing a 1 to REQ32_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ32_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ32_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ32_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ33_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ33_EN0_SHIFT (1U) -/*! REQ33_EN0 - Writing a 1 to REQ33_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ33_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ33_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ33_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ34_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ34_EN0_SHIFT (2U) -/*! REQ34_EN0 - Writing a 1 to REQ34_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ34_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ34_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ34_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ35_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ35_EN0_SHIFT (3U) -/*! REQ35_EN0 - Writing a 1 to REQ35_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ35_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ35_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ35_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ36_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ36_EN0_SHIFT (4U) -/*! REQ36_EN0 - Writing a 1 to REQ36_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ36_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ36_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ36_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ37_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ37_EN0_SHIFT (5U) -/*! REQ37_EN0 - Writing a 1 to REQ37_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ37_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ37_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ37_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ38_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ38_EN0_SHIFT (6U) -/*! REQ38_EN0 - Writing a 1 to REQ38_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ38_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ38_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ38_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ39_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ39_EN0_SHIFT (7U) -/*! REQ39_EN0 - Writing a 1 to REQ39_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ39_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ39_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ39_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ40_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ40_EN0_SHIFT (8U) -/*! REQ40_EN0 - Writing a 1 to REQ40_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ40_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ40_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ40_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ41_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ41_EN0_SHIFT (9U) -/*! REQ41_EN0 - Writing a 1 to REQ41_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ41_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ41_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ41_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ42_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ42_EN0_SHIFT (10U) -/*! REQ42_EN0 - Writing a 1 to REQ42_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ42_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ42_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ42_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ43_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ43_EN0_SHIFT (11U) -/*! REQ43_EN0 - Writing a 1 to REQ43_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ43_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ43_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ43_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ44_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ44_EN0_SHIFT (12U) -/*! REQ44_EN0 - Writing a 1 to REQ44_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ44_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ44_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ44_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ45_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ45_EN0_SHIFT (13U) -/*! REQ45_EN0 - Writing a 1 to REQ45_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ45_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ45_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ45_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ46_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ46_EN0_SHIFT (14U) -/*! REQ46_EN0 - Writing a 1 to REQ46_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ46_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ46_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ46_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ47_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ47_EN0_SHIFT (15U) -/*! REQ47_EN0 - Writing a 1 to REQ47_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ47_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ47_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ47_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ48_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ48_EN0_SHIFT (16U) -/*! REQ48_EN0 - Writing a 1 to REQ48_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ48_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ48_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ48_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ49_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ49_EN0_SHIFT (17U) -/*! REQ49_EN0 - Writing a 1 to REQ49_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ49_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ49_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ49_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ50_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ50_EN0_SHIFT (18U) -/*! REQ50_EN0 - Writing a 1 to REQ50_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ50_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ50_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ50_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ51_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ51_EN0_SHIFT (19U) -/*! REQ51_EN0 - Writing a 1 to REQ51_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ51_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ51_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ51_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ52_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ52_EN0_SHIFT (20U) -/*! REQ52_EN0 - Writing a 1 to REQ52_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ52_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ52_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ52_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ53_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ53_EN0_SHIFT (21U) -/*! REQ53_EN0 - Writing a 1 to REQ53_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ53_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ53_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ53_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ54_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ54_EN0_SHIFT (22U) -/*! REQ54_EN0 - Writing a 1 to REQ54_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ54_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ54_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ54_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ57_EN0_MASK (0x2000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ57_EN0_SHIFT (25U) -/*! REQ57_EN0 - Writing a 1 to REQ57_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ57_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ57_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ57_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ58_EN0_MASK (0x4000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ58_EN0_SHIFT (26U) -/*! REQ58_EN0 - Writing a 1 to REQ58_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ58_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ58_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ58_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ59_EN0_MASK (0x8000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ59_EN0_SHIFT (27U) -/*! REQ59_EN0 - Writing a 1 to REQ59_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ59_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ59_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ59_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ60_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ60_EN0_SHIFT (28U) -/*! REQ60_EN0 - Writing a 1 to REQ60_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ60_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ60_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ60_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ61_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ61_EN0_SHIFT (29U) -/*! REQ61_EN0 - Writing a 1 to REQ61_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ61_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ61_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ61_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ62_EN0_MASK (0x40000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ62_EN0_SHIFT (30U) -/*! REQ62_EN0 - Writing a 1 to REQ62_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ62_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ62_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ62_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ63_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ63_EN0_SHIFT (31U) -/*! REQ63_EN0 - Writing a 1 to REQ63_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ63_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ63_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ63_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE1_TOG - DMA0 Request Enable1 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ32_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ32_EN0_SHIFT (0U) -/*! REQ32_EN0 - Writing a 1 to REQ32_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ32_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ32_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ32_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ33_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ33_EN0_SHIFT (1U) -/*! REQ33_EN0 - Writing a 1 to REQ33_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ33_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ33_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ33_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ34_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ34_EN0_SHIFT (2U) -/*! REQ34_EN0 - Writing a 1 to REQ34_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ34_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ34_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ34_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ35_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ35_EN0_SHIFT (3U) -/*! REQ35_EN0 - Writing a 1 to REQ35_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ35_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ35_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ35_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ36_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ36_EN0_SHIFT (4U) -/*! REQ36_EN0 - Writing a 1 to REQ36_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ36_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ36_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ36_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ37_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ37_EN0_SHIFT (5U) -/*! REQ37_EN0 - Writing a 1 to REQ37_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ37_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ37_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ37_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ38_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ38_EN0_SHIFT (6U) -/*! REQ38_EN0 - Writing a 1 to REQ38_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ38_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ38_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ38_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ39_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ39_EN0_SHIFT (7U) -/*! REQ39_EN0 - Writing a 1 to REQ39_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ39_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ39_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ39_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ40_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ40_EN0_SHIFT (8U) -/*! REQ40_EN0 - Writing a 1 to REQ40_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ40_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ40_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ40_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ41_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ41_EN0_SHIFT (9U) -/*! REQ41_EN0 - Writing a 1 to REQ41_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ41_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ41_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ41_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ42_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ42_EN0_SHIFT (10U) -/*! REQ42_EN0 - Writing a 1 to REQ42_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ42_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ42_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ42_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ43_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ43_EN0_SHIFT (11U) -/*! REQ43_EN0 - Writing a 1 to REQ43_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ43_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ43_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ43_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ44_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ44_EN0_SHIFT (12U) -/*! REQ44_EN0 - Writing a 1 to REQ44_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ44_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ44_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ44_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ45_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ45_EN0_SHIFT (13U) -/*! REQ45_EN0 - Writing a 1 to REQ55_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ45_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ45_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ45_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ46_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ46_EN0_SHIFT (14U) -/*! REQ46_EN0 - Writing a 1 to REQ46_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ46_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ46_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ46_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ47_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ47_EN0_SHIFT (15U) -/*! REQ47_EN0 - Writing a 1 to REQ47_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ47_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ47_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ47_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ48_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ48_EN0_SHIFT (16U) -/*! REQ48_EN0 - Writing a 1 to REQ48_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ48_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ48_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ48_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ49_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ49_EN0_SHIFT (17U) -/*! REQ49_EN0 - Writing a 1 to REQ49_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ49_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ49_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ49_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ50_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ50_EN0_SHIFT (18U) -/*! REQ50_EN0 - Writing a 1 to REQ50_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ50_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ50_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ50_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ51_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ51_EN0_SHIFT (19U) -/*! REQ51_EN0 - Writing a 1 to REQ51_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ51_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ51_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ51_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ52_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ52_EN0_SHIFT (20U) -/*! REQ52_EN0 - Writing a 1 to REQ52_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ52_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ52_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ52_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ53_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ53_EN0_SHIFT (21U) -/*! REQ53_EN0 - Writing a 1 to REQ53_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ53_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ53_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ53_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ54_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ54_EN0_SHIFT (22U) -/*! REQ54_EN0 - Writing a 1 to REQ54_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ54_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ54_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ54_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ57_EN0_MASK (0x2000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ57_EN0_SHIFT (25U) -/*! REQ57_EN0 - Writing a 1 to REQ57_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ57_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ57_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ57_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ58_EN0_MASK (0x4000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ58_EN0_SHIFT (26U) -/*! REQ58_EN0 - Writing a 1 to REQ58_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ58_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ58_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ58_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ59_EN0_MASK (0x8000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ59_EN0_SHIFT (27U) -/*! REQ59_EN0 - Writing a 1 to REQ59_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ59_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ59_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ59_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ60_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ60_EN0_SHIFT (28U) -/*! REQ60_EN0 - Writing a 1 to REQ60_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ60_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ60_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ60_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ61_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ61_EN0_SHIFT (29U) -/*! REQ61_EN0 - Writing a 1 to REQ61_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ61_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ61_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ61_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ62_EN0_MASK (0x40000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ62_EN0_SHIFT (30U) -/*! REQ62_EN0 - Writing a 1 to REQ62_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ62_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ62_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ62_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ63_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ63_EN0_SHIFT (31U) -/*! REQ63_EN0 - Writing a 1 to REQ63_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ63_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ63_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ63_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE2 - DMA0 Request Enable2 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ64_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ64_EN0_SHIFT (0U) -/*! REQ64_EN0 - This register is used to enable and disable FlexIO0 shift register 3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ64_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ64_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ64_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ65_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ65_EN0_SHIFT (1U) -/*! REQ65_EN0 - This register is used to enable and disable FlexIO0 shift register 4 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ65_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ65_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ65_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ66_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ66_EN0_SHIFT (2U) -/*! REQ66_EN0 - This register is used to enable and disable FlexIO0 shift register 5 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ66_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ66_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ66_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ67_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ67_EN0_SHIFT (3U) -/*! REQ67_EN0 - This register is used to enable and disable FlexIO0 shift register 6 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ67_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ67_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ67_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ68_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ68_EN0_SHIFT (4U) -/*! REQ68_EN0 - This register is used to enable and disable FlexIO0 shift register 7 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ68_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ68_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ68_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ69_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ69_EN0_SHIFT (5U) -/*! REQ69_EN0 - This register is used to enable and disable LP_FLEXCOMM0 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ69_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ69_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ69_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ70_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ70_EN0_SHIFT (6U) -/*! REQ70_EN0 - This register is used to enable and disable LP_FLEXCOMM0 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ70_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ70_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ70_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ71_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ71_EN0_SHIFT (7U) -/*! REQ71_EN0 - This register is used to enable and disable LP_FLEXCOMM1 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ71_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ71_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ71_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ72_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ72_EN0_SHIFT (8U) -/*! REQ72_EN0 - This register is used to enable and disable LP_FLEXCOMM1 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ72_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ72_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ72_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ73_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ73_EN0_SHIFT (9U) -/*! REQ73_EN0 - This register is used to enable and disable LP_FLEXCOMM2 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ73_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ73_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ73_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ74_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ74_EN0_SHIFT (10U) -/*! REQ74_EN0 - This register is used to enable and disable LP_FLEXCOMM2 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ74_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ74_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ74_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ75_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ75_EN0_SHIFT (11U) -/*! REQ75_EN0 - This register is used to enable and disable LP_FLEXCOMM3 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ75_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ75_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ75_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ76_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ76_EN0_SHIFT (12U) -/*! REQ76_EN0 - This register is used to enable and disable LP_FLEXCOMM3 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ76_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ76_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ76_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ77_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ77_EN0_SHIFT (13U) -/*! REQ77_EN0 - This register is used to enable and disable LP_FLEXCOMM4 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ77_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ77_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ77_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ78_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ78_EN0_SHIFT (14U) -/*! REQ78_EN0 - This register is used to enable and disable LP_FLEXCOMM4 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ78_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ78_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ78_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ79_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ79_EN0_SHIFT (15U) -/*! REQ79_EN0 - This register is used to enable and disable LP_FLEXCOMM5 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ79_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ79_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ79_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ80_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ80_EN0_SHIFT (16U) -/*! REQ80_EN0 - This register is used to enable and disable LP_FLEXCOMM5 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ80_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ80_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ80_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ81_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ81_EN0_SHIFT (17U) -/*! REQ81_EN0 - This register is used to enable and disable LP_FLEXCOMM6 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ81_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ81_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ81_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ82_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ82_EN0_SHIFT (18U) -/*! REQ82_EN0 - This register is used to enable and disable LP_FLEXCOMM6 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ82_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ82_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ82_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ83_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ83_EN0_SHIFT (19U) -/*! REQ83_EN0 - This register is used to enable and disable LP_FLEXCOMM7 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ83_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ83_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ83_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ84_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ84_EN0_SHIFT (20U) -/*! REQ84_EN0 - This register is used to enable and disable LP_FLEXCOMM7 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ84_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ84_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ84_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ95_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ95_EN0_SHIFT (31U) -/*! REQ95_EN0 - This register is used to enable and disable I3C0 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ95_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ95_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ95_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE2_SET - DMA0 Request Enable2 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ64_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ64_EN0_SHIFT (0U) -/*! REQ64_EN0 - Writing a 1 to REQ64_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ64_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ64_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ64_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ65_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ65_EN0_SHIFT (1U) -/*! REQ65_EN0 - Writing a 1 to REQ65_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ65_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ65_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ65_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ66_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ66_EN0_SHIFT (2U) -/*! REQ66_EN0 - Writing a 1 to REQ66_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ66_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ66_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ66_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ67_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ67_EN0_SHIFT (3U) -/*! REQ67_EN0 - Writing a 1 to REQ67_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ67_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ67_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ67_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ68_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ68_EN0_SHIFT (4U) -/*! REQ68_EN0 - Writing a 1 to REQ68_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ68_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ68_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ68_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ69_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ69_EN0_SHIFT (5U) -/*! REQ69_EN0 - Writing a 1 to REQ69_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ69_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ69_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ69_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ70_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ70_EN0_SHIFT (6U) -/*! REQ70_EN0 - Writing a 1 to REQ70_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ70_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ70_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ70_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ71_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ71_EN0_SHIFT (7U) -/*! REQ71_EN0 - Writing a 1 to REQ71_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ71_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ71_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ71_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ72_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ72_EN0_SHIFT (8U) -/*! REQ72_EN0 - Writing a 1 to REQ72_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ72_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ72_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ72_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ73_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ73_EN0_SHIFT (9U) -/*! REQ73_EN0 - Writing a 1 to REQ73_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ73_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ73_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ73_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ74_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ74_EN0_SHIFT (10U) -/*! REQ74_EN0 - Writing a 1 to REQ74_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ74_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ74_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ74_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ75_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ75_EN0_SHIFT (11U) -/*! REQ75_EN0 - Writing a 1 to REQ75_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ75_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ75_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ75_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ76_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ76_EN0_SHIFT (12U) -/*! REQ76_EN0 - Writing a 1 to REQ876_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ76_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ76_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ76_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ77_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ77_EN0_SHIFT (13U) -/*! REQ77_EN0 - Writing a 1 to REQ77_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ77_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ77_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ77_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ78_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ78_EN0_SHIFT (14U) -/*! REQ78_EN0 - Writing a 1 to REQ78_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ78_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ78_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ78_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ79_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ79_EN0_SHIFT (15U) -/*! REQ79_EN0 - Writing a 1 to REQ79_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ79_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ79_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ79_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ80_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ80_EN0_SHIFT (16U) -/*! REQ80_EN0 - Writing a 1 to REQ80_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ80_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ80_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ80_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ81_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ81_EN0_SHIFT (17U) -/*! REQ81_EN0 - Writing a 1 to REQ81_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ81_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ81_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ81_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ82_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ82_EN0_SHIFT (18U) -/*! REQ82_EN0 - Writing a 1 to REQ82_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ82_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ82_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ82_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ83_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ83_EN0_SHIFT (19U) -/*! REQ83_EN0 - Writing a 1 to REQ83_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ83_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ83_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ83_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ84_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ84_EN0_SHIFT (20U) -/*! REQ84_EN0 - Writing a 1 to REQ84_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ84_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ84_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ84_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ95_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ95_EN0_SHIFT (31U) -/*! REQ95_EN0 - Writing a 1 to REQ95_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ95_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ95_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ95_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE2_CLR - DMA0 Request Enable2 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ64_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ64_EN0_SHIFT (0U) -/*! REQ64_EN0 - Writing a 1 to REQ64_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ64_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ64_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ64_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ65_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ65_EN0_SHIFT (1U) -/*! REQ65_EN0 - Writing a 1 to REQ65_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ65_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ65_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ65_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ66_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ66_EN0_SHIFT (2U) -/*! REQ66_EN0 - Writing a 1 to REQ66_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ66_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ66_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ66_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ67_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ67_EN0_SHIFT (3U) -/*! REQ67_EN0 - Writing a 1 to REQ67_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ67_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ67_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ67_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ68_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ68_EN0_SHIFT (4U) -/*! REQ68_EN0 - Writing a 1 to REQ68_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ68_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ68_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ68_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ69_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ69_EN0_SHIFT (5U) -/*! REQ69_EN0 - Writing a 1 to REQ69_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ69_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ69_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ69_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ70_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ70_EN0_SHIFT (6U) -/*! REQ70_EN0 - Writing a 1 to REQ70_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ70_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ70_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ70_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ71_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ71_EN0_SHIFT (7U) -/*! REQ71_EN0 - Writing a 1 to REQ71_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ71_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ71_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ71_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ72_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ72_EN0_SHIFT (8U) -/*! REQ72_EN0 - Writing a 1 to REQ72_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ72_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ72_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ72_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ73_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ73_EN0_SHIFT (9U) -/*! REQ73_EN0 - Writing a 1 to REQ73_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ73_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ73_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ73_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ74_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ74_EN0_SHIFT (10U) -/*! REQ74_EN0 - Writing a 1 to REQ74_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ74_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ74_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ74_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ75_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ75_EN0_SHIFT (11U) -/*! REQ75_EN0 - Writing a 1 to REQ75_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ75_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ75_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ75_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ76_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ76_EN0_SHIFT (12U) -/*! REQ76_EN0 - Writing a 1 to REQ76_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ76_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ76_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ76_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ77_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ77_EN0_SHIFT (13U) -/*! REQ77_EN0 - Writing a 1 to REQ77_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ77_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ77_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ77_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ78_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ78_EN0_SHIFT (14U) -/*! REQ78_EN0 - Writing a 1 to REQ78_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ78_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ78_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ78_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ79_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ79_EN0_SHIFT (15U) -/*! REQ79_EN0 - Writing a 1 to REQ79_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ79_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ79_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ79_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ80_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ80_EN0_SHIFT (16U) -/*! REQ80_EN0 - Writing a 1 to REQ80_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ80_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ80_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ80_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ81_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ81_EN0_SHIFT (17U) -/*! REQ81_EN0 - Writing a 1 to REQ81_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ81_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ81_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ81_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ82_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ82_EN0_SHIFT (18U) -/*! REQ82_EN0 - Writing a 1 to REQ82_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ82_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ82_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ82_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ83_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ83_EN0_SHIFT (19U) -/*! REQ83_EN0 - Writing a 1 to REQ83_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ83_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ83_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ83_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ84_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ84_EN0_SHIFT (20U) -/*! REQ84_EN0 - Writing a 1 to REQ84_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ84_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ84_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ84_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ95_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ95_EN0_SHIFT (31U) -/*! REQ95_EN0 - Writing a 1 to REQ95_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ95_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ95_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ95_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE2_TOG - DMA0 Request Enable2 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ64_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ64_EN0_SHIFT (0U) -/*! REQ64_EN0 - Writing a 1 to REQ64_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ64_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ64_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ64_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ65_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ65_EN0_SHIFT (1U) -/*! REQ65_EN0 - Writing a 1 to REQ65_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ65_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ65_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ65_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ66_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ66_EN0_SHIFT (2U) -/*! REQ66_EN0 - Writing a 1 to REQ66_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ66_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ66_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ66_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ67_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ67_EN0_SHIFT (3U) -/*! REQ67_EN0 - Writing a 1 to REQ67_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ67_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ67_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ67_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ68_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ68_EN0_SHIFT (4U) -/*! REQ68_EN0 - Writing a 1 to REQ68_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ68_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ68_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ68_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ69_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ69_EN0_SHIFT (5U) -/*! REQ69_EN0 - Writing a 1 to REQ69_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ69_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ69_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ69_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ70_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ70_EN0_SHIFT (6U) -/*! REQ70_EN0 - Writing a 1 to REQ70_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ70_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ70_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ70_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ71_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ71_EN0_SHIFT (7U) -/*! REQ71_EN0 - Writing a 1 to REQ71_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ71_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ71_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ71_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ72_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ72_EN0_SHIFT (8U) -/*! REQ72_EN0 - Writing a 1 to REQ72_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ72_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ72_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ72_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ73_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ73_EN0_SHIFT (9U) -/*! REQ73_EN0 - Writing a 1 to REQ73_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ73_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ73_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ73_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ74_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ74_EN0_SHIFT (10U) -/*! REQ74_EN0 - Writing a 1 to REQ74_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ74_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ74_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ74_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ75_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ75_EN0_SHIFT (11U) -/*! REQ75_EN0 - Writing a 1 to REQ75_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ75_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ75_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ75_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ76_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ76_EN0_SHIFT (12U) -/*! REQ76_EN0 - Writing a 1 to REQ76_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ76_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ76_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ76_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ77_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ77_EN0_SHIFT (13U) -/*! REQ77_EN0 - Writing a 1 to REQ77_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ77_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ77_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ77_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ78_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ78_EN0_SHIFT (14U) -/*! REQ78_EN0 - Writing a 1 to REQ78_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ78_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ78_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ78_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ79_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ79_EN0_SHIFT (15U) -/*! REQ79_EN0 - Writing a 1 to REQ79_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ79_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ79_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ79_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ80_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ80_EN0_SHIFT (16U) -/*! REQ80_EN0 - Writing a 1 to REQ80_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ80_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ80_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ80_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ81_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ81_EN0_SHIFT (17U) -/*! REQ81_EN0 - Writing a 1 to REQ81_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ81_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ81_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ81_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ82_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ82_EN0_SHIFT (18U) -/*! REQ82_EN0 - Writing a 1 to REQ82_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ82_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ82_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ82_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ83_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ83_EN0_SHIFT (19U) -/*! REQ83_EN0 - Writing a 1 to REQ83_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ83_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ83_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ83_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ84_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ84_EN0_SHIFT (20U) -/*! REQ84_EN0 - Writing a 1 to REQ84_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ84_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ84_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ84_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ95_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ95_EN0_SHIFT (31U) -/*! REQ95_EN0 - Writing a 1 to REQ95_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ95_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ95_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ95_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE3 - DMA0 Request Enable3 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ96_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ96_EN0_SHIFT (0U) -/*! REQ96_EN0 - This register is used to enable and disable I3C0 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ96_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ96_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ96_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ97_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ97_EN0_SHIFT (1U) -/*! REQ97_EN0 - This register is used to enable and disable I3C1 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ97_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ97_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ97_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ98_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ98_EN0_SHIFT (2U) -/*! REQ98_EN0 - This register is used to enable and disable I3C1 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ98_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ98_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ98_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ99_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ99_EN0_SHIFT (3U) -/*! REQ99_EN0 - This register is used to enable and disable SAI0 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ99_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ99_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ99_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ100_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ100_EN0_SHIFT (4U) -/*! REQ100_EN0 - This register is used to enable and disable SAI0 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ100_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ100_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ100_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ101_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ101_EN0_SHIFT (5U) -/*! REQ101_EN0 - This register is used to enable and disable SAI1 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ101_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ101_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ101_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ102_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ102_EN0_SHIFT (6U) -/*! REQ102_EN0 - This register is used to enable and disable SAI1 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ102_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ102_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ102_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ108_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ108_EN0_SHIFT (12U) -/*! REQ108_EN0 - This register is used to enable and disable GPIO0 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ108_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ108_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ108_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ109_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ109_EN0_SHIFT (13U) -/*! REQ109_EN0 - This register is used to enable and disable GPIO0 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ109_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ109_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ109_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ110_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ110_EN0_SHIFT (14U) -/*! REQ110_EN0 - This register is used to enable and disable GPIO1 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ110_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ110_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ110_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ111_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ111_EN0_SHIFT (15U) -/*! REQ111_EN0 - This register is used to enable and disable GPIO1 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ111_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ111_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ111_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ112_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ112_EN0_SHIFT (16U) -/*! REQ112_EN0 - This register is used to enable and disable GPIO2 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ112_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ112_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ112_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ113_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ113_EN0_SHIFT (17U) -/*! REQ113_EN0 - This register is used to enable and disable GPIO2 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ113_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ113_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ113_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ114_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ114_EN0_SHIFT (18U) -/*! REQ114_EN0 - This register is used to enable and disable GPIO3 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ114_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ114_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ114_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ115_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ115_EN0_SHIFT (19U) -/*! REQ115_EN0 - This register is used to enable and disable GPIO3 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ115_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ115_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ115_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ116_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ116_EN0_SHIFT (20U) -/*! REQ116_EN0 - This register is used to enable and disable GPIO4 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ116_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ116_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ116_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ117_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ117_EN0_SHIFT (21U) -/*! REQ117_EN0 - This register is used to enable and disable GPIO4 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ117_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ117_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ117_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ118_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ118_EN0_SHIFT (22U) -/*! REQ118_EN0 - This register is used to enable and disable GPIO5 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ118_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ118_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ118_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ119_EN0_MASK (0x800000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ119_EN0_SHIFT (23U) -/*! REQ119_EN0 - This register is used to enable and disable GPIO5 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ119_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ119_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ119_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE3_SET - DMA0 Request Enable3 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ96_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ96_EN0_SHIFT (0U) -/*! REQ96_EN0 - Writing a 1 to REQ96_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ96_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ96_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ96_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ97_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ97_EN0_SHIFT (1U) -/*! REQ97_EN0 - Writing a 1 to REQ97_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ97_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ97_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ97_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ98_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ98_EN0_SHIFT (2U) -/*! REQ98_EN0 - Writing a 1 to REQ98_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ98_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ98_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ98_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ99_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ99_EN0_SHIFT (3U) -/*! REQ99_EN0 - Writing a 1 to REQ99_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ99_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ99_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ99_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ100_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ100_EN0_SHIFT (4U) -/*! REQ100_EN0 - Writing a 1 to REQ100_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ100_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ100_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ100_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ101_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ101_EN0_SHIFT (5U) -/*! REQ101_EN0 - Writing a 1 to REQ101_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ101_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ101_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ101_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ102_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ102_EN0_SHIFT (6U) -/*! REQ102_EN0 - Writing a 1 to REQ102_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ102_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ102_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ102_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ108_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ108_EN0_SHIFT (12U) -/*! REQ108_EN0 - Writing a 1 to REQ108_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ108_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ108_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ108_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ109_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ109_EN0_SHIFT (13U) -/*! REQ109_EN0 - Writing a 1 to REQ109_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ109_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ109_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ109_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ110_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ110_EN0_SHIFT (14U) -/*! REQ110_EN0 - Writing a 1 to REQ110_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ110_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ110_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ110_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ111_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ111_EN0_SHIFT (15U) -/*! REQ111_EN0 - Writing a 1 to REQ111_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ111_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ111_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ111_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ112_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ112_EN0_SHIFT (16U) -/*! REQ112_EN0 - Writing a 1 to REQ112_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ112_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ112_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ112_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ113_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ113_EN0_SHIFT (17U) -/*! REQ113_EN0 - Writing a 1 to REQ113_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ113_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ113_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ113_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ114_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ114_EN0_SHIFT (18U) -/*! REQ114_EN0 - Writing a 1 to REQ114_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ114_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ114_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ114_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ115_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ115_EN0_SHIFT (19U) -/*! REQ115_EN0 - Writing a 1 to REQ115_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ115_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ115_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ115_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ116_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ116_EN0_SHIFT (20U) -/*! REQ116_EN0 - Writing a 1 to REQ116_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ116_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ116_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ116_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ117_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ117_EN0_SHIFT (21U) -/*! REQ117_EN0 - Writing a 1 to REQ117_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ117_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ117_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ117_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ118_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ118_EN0_SHIFT (22U) -/*! REQ118_EN0 - Writing a 1 to REQ118_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ118_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ118_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ118_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ119_EN0_MASK (0x800000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ119_EN0_SHIFT (23U) -/*! REQ119_EN0 - Writing a 1 to REQ119_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ119_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ119_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ119_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE3_CLR - DMA0 Request Enable3 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ96_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ96_EN0_SHIFT (0U) -/*! REQ96_EN0 - Writing a 1 to REQ96_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ96_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ96_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ96_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ97_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ97_EN0_SHIFT (1U) -/*! REQ97_EN0 - Writing a 1 to REQ97_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ97_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ97_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ97_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ98_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ98_EN0_SHIFT (2U) -/*! REQ98_EN0 - Writing a 1 to REQ98_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ98_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ98_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ98_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ99_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ99_EN0_SHIFT (3U) -/*! REQ99_EN0 - Writing a 1 to REQ99_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ99_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ99_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ99_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ100_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ100_EN0_SHIFT (4U) -/*! REQ100_EN0 - Writing a 1 to REQ100_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ100_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ100_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ100_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ101_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ101_EN0_SHIFT (5U) -/*! REQ101_EN0 - Writing a 1 to REQ101_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ101_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ101_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ101_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ102_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ102_EN0_SHIFT (6U) -/*! REQ102_EN0 - Writing a 1 to REQ102_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ102_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ102_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ102_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ108_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ108_EN0_SHIFT (12U) -/*! REQ108_EN0 - Writing a 1 to REQ108_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ108_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ108_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ108_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ109_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ109_EN0_SHIFT (13U) -/*! REQ109_EN0 - Writing a 1 to REQ109_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ109_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ109_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ109_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ110_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ110_EN0_SHIFT (14U) -/*! REQ110_EN0 - Writing a 1 to REQ110_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ110_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ110_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ110_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ111_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ111_EN0_SHIFT (15U) -/*! REQ111_EN0 - Writing a 1 to REQ111_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ111_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ111_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ111_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ112_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ112_EN0_SHIFT (16U) -/*! REQ112_EN0 - Writing a 1 to REQ112_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ112_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ112_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ112_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ113_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ113_EN0_SHIFT (17U) -/*! REQ113_EN0 - Writing a 1 to REQ113_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ113_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ113_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ113_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ114_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ114_EN0_SHIFT (18U) -/*! REQ114_EN0 - Writing a 1 to REQ114_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ114_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ114_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ114_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ115_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ115_EN0_SHIFT (19U) -/*! REQ115_EN0 - Writing a 1 to REQ115_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ115_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ115_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ115_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ116_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ116_EN0_SHIFT (20U) -/*! REQ116_EN0 - Writing a 1 to REQ116_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ116_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ116_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ116_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ117_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ117_EN0_SHIFT (21U) -/*! REQ117_EN0 - Writing a 1 to REQ117_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ117_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ117_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ117_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ118_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ118_EN0_SHIFT (22U) -/*! REQ118_EN0 - Writing a 1 to REQ118_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ118_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ118_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ118_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ119_EN0_MASK (0x800000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ119_EN0_SHIFT (23U) -/*! REQ119_EN0 - Writing a 1 to REQ119_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ119_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ119_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ119_EN0_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE0 - DMA1 Request Enable0 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ3_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ3_EN1_SHIFT (3U) -/*! REQ3_EN1 - This register is used to enable and disable PINT0 INT0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ3_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ3_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ3_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ4_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ4_EN1_SHIFT (4U) -/*! REQ4_EN1 - This register is used to enable and disable PINT0 INT1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ4_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ4_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ4_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ5_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ5_EN1_SHIFT (5U) -/*! REQ5_EN1 - This register is used to enable and disable PINT0 INT2 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ5_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ5_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ5_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ6_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ6_EN1_SHIFT (6U) -/*! REQ6_EN1 - This register is used to enable and disable PINT0 INT3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ6_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ6_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ6_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ7_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ7_EN1_SHIFT (7U) -/*! REQ7_EN1 - This register is used to enable and disable CTIMER0 DMAREQ_M0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ7_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ7_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ7_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ8_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ8_EN1_SHIFT (8U) -/*! REQ8_EN1 - This register is used to enable and disable CTIMER0 DMAREQ_M1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ8_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ8_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ8_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ9_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ9_EN1_SHIFT (9U) -/*! REQ9_EN1 - This register is used to enable and disable CTIMER1 DMAREQ_M0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ9_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ9_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ9_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ10_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ10_EN1_SHIFT (10U) -/*! REQ10_EN1 - This register is used to enable and disable CTIMER1 DMAREQ_M1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ10_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ10_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ10_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ11_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ11_EN1_SHIFT (11U) -/*! REQ11_EN1 - This register is used to enable and disable CTIMER2 DMAREQ_M0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ11_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ11_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ11_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ12_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ12_EN1_SHIFT (12U) -/*! REQ12_EN1 - This register is used to enable and disable CTIMER2 DMAREQ_M1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ12_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ12_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ12_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ13_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ13_EN1_SHIFT (13U) -/*! REQ13_EN1 - This register is used to enable and disable CTIMER3 DMAREQ_M0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ13_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ13_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ13_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ14_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ14_EN1_SHIFT (14U) -/*! REQ14_EN1 - This register is used to enable and disable CTIMER3 DMAREQ_M1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ14_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ14_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ14_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ15_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ15_EN1_SHIFT (15U) -/*! REQ15_EN1 - This register is used to enable and disable CTIMER4 DMAREQ_M0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ15_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ15_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ15_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ16_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ16_EN1_SHIFT (16U) -/*! REQ16_EN1 - This register is used to enable and disable CTIMER4 DMAREQ_M1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ16_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ16_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ16_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ17_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ17_EN1_SHIFT (17U) -/*! REQ17_EN1 - This register is used to enable and disable WUU0 wake up event request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ17_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ17_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ17_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ18_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ18_EN1_SHIFT (18U) -/*! REQ18_EN1 - This register is used to enable and disable MICFIL0 FIFO_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ18_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ18_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ18_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ21_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ21_EN1_SHIFT (21U) -/*! REQ21_EN1 - This register is used to enable and disable ADC0 FIFO A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ21_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ21_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ21_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ22_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ22_EN1_SHIFT (22U) -/*! REQ22_EN1 - This register is used to enable and disable ADC0 FIFO B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ22_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ22_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ22_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ23_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ23_EN1_SHIFT (23U) -/*! REQ23_EN1 - This register is used to enable and disable ADC1 FIFO A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ23_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ23_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ23_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ24_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ24_EN1_SHIFT (24U) -/*! REQ24_EN1 - This register is used to enable and disable ADC1 FIFO B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ24_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ24_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ24_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ28_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ28_EN1_SHIFT (28U) -/*! REQ28_EN1 - This register is used to enable and disable CMP0 DMA_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ28_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ28_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ28_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ29_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ29_EN1_SHIFT (29U) -/*! REQ29_EN1 - This register is used to enable and disable CMP1 DMA_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ29_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ29_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ29_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ31_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ31_EN1_SHIFT (31U) -/*! REQ31_EN1 - This register is used to enable and disable EVTG0 OUT0A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ31_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ31_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ31_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE0_SET - DMA1 Request Enable0 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ3_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ3_EN1_SHIFT (3U) -/*! REQ3_EN1 - Writing a 1 to REQ3_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ3_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ3_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ3_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ4_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ4_EN1_SHIFT (4U) -/*! REQ4_EN1 - Writing a 1 to REQ4_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ4_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ4_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ4_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ5_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ5_EN1_SHIFT (5U) -/*! REQ5_EN1 - Writing a 1 to REQ5_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ5_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ5_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ5_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ6_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ6_EN1_SHIFT (6U) -/*! REQ6_EN1 - Writing a 1 to REQ6_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ6_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ6_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ6_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ7_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ7_EN1_SHIFT (7U) -/*! REQ7_EN1 - Writing a 1 to REQ7_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ7_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ7_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ7_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ8_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ8_EN1_SHIFT (8U) -/*! REQ8_EN1 - Writing a 1 to REQ8_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ8_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ8_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ8_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ9_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ9_EN1_SHIFT (9U) -/*! REQ9_EN1 - Writing a 1 to REQ9_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ9_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ9_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ9_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ10_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ10_EN1_SHIFT (10U) -/*! REQ10_EN1 - Writing a 1 to REQ10_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ10_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ10_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ10_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ11_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ11_EN1_SHIFT (11U) -/*! REQ11_EN1 - Writing a 1 to REQ11_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ11_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ11_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ11_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ12_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ12_EN1_SHIFT (12U) -/*! REQ12_EN1 - Writing a 1 to REQ12_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ12_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ12_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ12_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ13_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ13_EN1_SHIFT (13U) -/*! REQ13_EN1 - Writing a 1 to REQ13_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ13_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ13_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ13_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ14_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ14_EN1_SHIFT (14U) -/*! REQ14_EN1 - Writing a 1 to REQ14_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ14_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ14_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ14_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ15_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ15_EN1_SHIFT (15U) -/*! REQ15_EN1 - Writing a 1 to REQ15_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ15_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ15_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ15_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ16_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ16_EN1_SHIFT (16U) -/*! REQ16_EN1 - Writing a 1 to REQ16_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ16_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ16_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ16_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ17_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ17_EN1_SHIFT (17U) -/*! REQ17_EN1 - Writing a 1 to REQ17_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ17_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ17_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ17_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ18_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ18_EN1_SHIFT (18U) -/*! REQ18_EN1 - Writing a 1 to REQ18_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ18_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ18_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ18_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ21_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ21_EN1_SHIFT (21U) -/*! REQ21_EN1 - Writing a 1 to REQ21_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ21_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ21_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ21_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ22_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ22_EN1_SHIFT (22U) -/*! REQ22_EN1 - Writing a 1 to REQ22_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ22_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ22_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ22_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ23_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ23_EN1_SHIFT (23U) -/*! REQ23_EN1 - Writing a 1 to REQ23_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ23_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ23_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ23_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ24_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ24_EN1_SHIFT (24U) -/*! REQ24_EN1 - Writing a 1 to REQ24_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ24_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ24_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ24_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ28_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ28_EN1_SHIFT (28U) -/*! REQ28_EN1 - Writing a 1 to REQ28_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ28_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ28_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ28_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ29_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ29_EN1_SHIFT (29U) -/*! REQ29_EN1 - Writing a 1 to REQ29_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ29_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ29_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ29_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ31_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ31_EN1_SHIFT (31U) -/*! REQ31_EN1 - Writing a 1 to REQ31_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ31_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ31_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ31_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE0_CLR - DMA1 Request Enable0 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ3_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ3_EN1_SHIFT (3U) -/*! REQ3_EN1 - Writing a 1 to REQ3_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ3_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ3_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ3_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ4_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ4_EN1_SHIFT (4U) -/*! REQ4_EN1 - Writing a 1 to REQ4_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ4_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ4_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ4_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ5_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ5_EN1_SHIFT (5U) -/*! REQ5_EN1 - Writing a 1 to REQ5_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ5_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ5_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ5_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ6_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ6_EN1_SHIFT (6U) -/*! REQ6_EN1 - Writing a 1 to REQ6_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ6_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ6_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ6_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ7_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ7_EN1_SHIFT (7U) -/*! REQ7_EN1 - Writing a 1 to REQ7_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ7_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ7_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ7_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ8_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ8_EN1_SHIFT (8U) -/*! REQ8_EN1 - Writing a 1 to REQ8_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ8_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ8_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ8_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ9_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ9_EN1_SHIFT (9U) -/*! REQ9_EN1 - Writing a 1 to REQ9_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ9_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ9_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ9_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ10_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ10_EN1_SHIFT (10U) -/*! REQ10_EN1 - Writing a 1 to REQ10_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ10_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ10_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ10_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ11_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ11_EN1_SHIFT (11U) -/*! REQ11_EN1 - Writing a 1 to REQ11_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ11_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ11_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ11_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ12_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ12_EN1_SHIFT (12U) -/*! REQ12_EN1 - Writing a 1 to REQ12_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ12_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ12_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ12_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ13_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ13_EN1_SHIFT (13U) -/*! REQ13_EN1 - Writing a 1 to REQ13_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ13_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ13_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ13_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ14_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ14_EN1_SHIFT (14U) -/*! REQ14_EN1 - Writing a 1 to REQ14_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ14_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ14_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ14_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ15_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ15_EN1_SHIFT (15U) -/*! REQ15_EN1 - Writing a 1 to REQ15_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ15_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ15_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ15_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ16_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ16_EN1_SHIFT (16U) -/*! REQ16_EN1 - Writing a 1 to REQ16_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ16_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ16_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ16_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ17_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ17_EN1_SHIFT (17U) -/*! REQ17_EN1 - Writing a 1 to REQ17_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ17_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ17_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ17_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ18_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ18_EN1_SHIFT (18U) -/*! REQ18_EN1 - Writing a 1 to REQ18_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ18_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ18_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ18_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ21_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ21_EN1_SHIFT (21U) -/*! REQ21_EN1 - Writing a 1 to REQ21_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ21_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ21_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ21_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ22_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ22_EN1_SHIFT (22U) -/*! REQ22_EN1 - Writing a 1 to REQ22_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ22_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ22_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ22_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ23_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ23_EN1_SHIFT (23U) -/*! REQ23_EN1 - Writing a 1 to REQ23_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ23_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ23_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ23_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ24_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ24_EN1_SHIFT (24U) -/*! REQ24_EN1 - Writing a 1 to REQ24_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ24_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ24_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ24_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ28_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ28_EN1_SHIFT (28U) -/*! REQ28_EN1 - Writing a 1 to REQ28_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ28_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ28_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ28_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ29_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ29_EN1_SHIFT (29U) -/*! REQ29_EN1 - Writing a 1 to REQ29_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ29_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ29_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ29_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ31_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ31_EN1_SHIFT (31U) -/*! REQ31_EN1 - Writing a 1 to REQ31_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ31_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ31_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ31_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE0_TOG - DMA1 Request Enable0 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ3_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ3_EN1_SHIFT (3U) -/*! REQ3_EN1 - Writing a 1 to REQ3_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ3_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ3_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ3_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ4_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ4_EN1_SHIFT (4U) -/*! REQ4_EN1 - Writing a 1 to REQ4_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ4_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ4_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ4_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ5_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ5_EN1_SHIFT (5U) -/*! REQ5_EN1 - Writing a 1 to REQ5_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ5_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ5_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ5_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ6_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ6_EN1_SHIFT (6U) -/*! REQ6_EN1 - Writing a 1 to REQ6_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ6_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ6_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ6_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ7_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ7_EN1_SHIFT (7U) -/*! REQ7_EN1 - Writing a 1 to REQ7_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ7_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ7_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ7_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ8_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ8_EN1_SHIFT (8U) -/*! REQ8_EN1 - Writing a 1 to REQ8_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ8_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ8_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ8_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ9_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ9_EN1_SHIFT (9U) -/*! REQ9_EN1 - Writing a 1 to RE9_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ9_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ9_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ9_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ10_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ10_EN1_SHIFT (10U) -/*! REQ10_EN1 - Writing a 1 to REQ10_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ10_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ10_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ10_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ11_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ11_EN1_SHIFT (11U) -/*! REQ11_EN1 - Writing a 1 to REQ11_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ11_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ11_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ11_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ12_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ12_EN1_SHIFT (12U) -/*! REQ12_EN1 - Writing a 1 to REQ12_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ12_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ12_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ12_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ13_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ13_EN1_SHIFT (13U) -/*! REQ13_EN1 - Writing a 1 to REQ13_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ13_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ13_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ13_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ14_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ14_EN1_SHIFT (14U) -/*! REQ14_EN1 - Writing a 1 to REQ14_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ14_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ14_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ14_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ15_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ15_EN1_SHIFT (15U) -/*! REQ15_EN1 - Writing a 1 to REQ15_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ15_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ15_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ15_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ16_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ16_EN1_SHIFT (16U) -/*! REQ16_EN1 - Writing a 1 to REQ16_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ16_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ16_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ16_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ17_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ17_EN1_SHIFT (17U) -/*! REQ17_EN1 - Writing a 1 to REQ17_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ17_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ17_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ17_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ18_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ18_EN1_SHIFT (18U) -/*! REQ18_EN1 - Writing a 1 to REQ18_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ18_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ18_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ18_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ21_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ21_EN1_SHIFT (21U) -/*! REQ21_EN1 - Writing a 1 to REQ21_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ21_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ21_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ21_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ22_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ22_EN1_SHIFT (22U) -/*! REQ22_EN1 - Writing a 1 to REQ22_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ22_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ22_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ22_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ23_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ23_EN1_SHIFT (23U) -/*! REQ23_EN1 - Writing a 1 to REQ23_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ23_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ23_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ23_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ24_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ24_EN1_SHIFT (24U) -/*! REQ24_EN1 - Writing a 1 to REQ24_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ24_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ24_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ24_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ28_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ28_EN1_SHIFT (28U) -/*! REQ28_EN1 - Writing a 1 to REQ28_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ28_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ28_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ28_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ29_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ29_EN1_SHIFT (29U) -/*! REQ29_EN1 - Writing a 1 to REQ29_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ29_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ29_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ29_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ31_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ31_EN1_SHIFT (31U) -/*! REQ31_EN1 - Writing a 1 to REQ31_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ31_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ31_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ31_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE1 - DMA1 Request Enable1 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ32_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ32_EN1_SHIFT (0U) -/*! REQ32_EN1 - This register is used to enable and disable EVTG0 OUT0B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ32_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ32_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ32_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ33_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ33_EN1_SHIFT (1U) -/*! REQ33_EN1 - This register is used to enable and disable EVTG0 OUT1A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ33_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ33_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ33_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ34_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ34_EN1_SHIFT (2U) -/*! REQ34_EN1 - This register is used to enable and disable EVTG0 OUT1B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ34_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ34_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ34_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ35_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ35_EN1_SHIFT (3U) -/*! REQ35_EN1 - This register is used to enable and disable EVTG0 OUT2A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ35_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ35_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ35_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ36_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ36_EN1_SHIFT (4U) -/*! REQ36_EN1 - This register is used to enable and disable EVTG0 OUT2B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ36_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ36_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ36_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ37_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ37_EN1_SHIFT (5U) -/*! REQ37_EN1 - This register is used to enable and disable EVTG0 OUT3A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ37_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ37_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ37_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ38_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ38_EN1_SHIFT (6U) -/*! REQ38_EN1 - This register is used to enable and disable EVTG0 OUT3B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ38_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ38_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ38_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ39_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ39_EN1_SHIFT (7U) -/*! REQ39_EN1 - This register is used to enable and disable PWM0 Req_capt0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ39_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ39_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ39_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ40_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ40_EN1_SHIFT (8U) -/*! REQ40_EN1 - This register is used to enable and disable PWM0 Req_capt1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ40_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ40_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ40_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ41_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ41_EN1_SHIFT (9U) -/*! REQ41_EN1 - This register is used to enable and disable PWM0 Req_capt2 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ41_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ41_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ41_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ42_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ42_EN1_SHIFT (10U) -/*! REQ42_EN1 - This register is used to enable and disable PWM0 Req_capt3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ42_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ42_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ42_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ43_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ43_EN1_SHIFT (11U) -/*! REQ43_EN1 - This register is used to enable and disable PWM0 Req_val0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ43_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ43_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ43_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ44_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ44_EN1_SHIFT (12U) -/*! REQ44_EN1 - This register is used to enable and disable PWM0 Req_val1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ44_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ44_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ44_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ45_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ45_EN1_SHIFT (13U) -/*! REQ45_EN1 - This register is used to enable and disable PWM0 Req_val2 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ45_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ45_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ45_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ46_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ46_EN1_SHIFT (14U) -/*! REQ46_EN1 - This register is used to enable and disable PWM0 Req_val3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ46_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ46_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ46_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ47_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ47_EN1_SHIFT (15U) -/*! REQ47_EN1 - This register is used to enable and disable PWM1 Req_capt0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ47_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ47_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ47_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ48_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ48_EN1_SHIFT (16U) -/*! REQ48_EN1 - This register is used to enable and disable PWM1 Req_capt1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ48_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ48_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ48_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ49_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ49_EN1_SHIFT (17U) -/*! REQ49_EN1 - This register is used to enable and disable PWM1 Req_capt2 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ49_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ49_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ49_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ50_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ50_EN1_SHIFT (18U) -/*! REQ50_EN1 - This register is used to enable and disable PWM1 Req_capt3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ50_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ50_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ50_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ51_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ51_EN1_SHIFT (19U) -/*! REQ51_EN1 - This register is used to enable and disable PWM1 Req_val0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ51_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ51_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ51_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ52_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ52_EN1_SHIFT (20U) -/*! REQ52_EN1 - This register is used to enable and disable PWM1 Req_val1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ52_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ52_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ52_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ53_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ53_EN1_SHIFT (21U) -/*! REQ53_EN1 - This register is used to enable and disable PWM1 Req_val2 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ53_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ53_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ53_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ54_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ54_EN1_SHIFT (22U) -/*! REQ54_EN1 - This register is used to enable and disable PWM1 Req_val3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ54_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ54_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ54_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ57_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ57_EN1_SHIFT (25U) -/*! REQ57_EN1 - This register is used to enable and disable LPTMR0 counter match event request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ57_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ57_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ57_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ58_EN1_MASK (0x4000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ58_EN1_SHIFT (26U) -/*! REQ58_EN1 - This register is used to enable and disable LPTMR1 counter match event request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ58_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ58_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ58_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ59_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ59_EN1_SHIFT (27U) -/*! REQ59_EN1 - This register is used to enable and disable CAN0 DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ59_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ59_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ59_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ60_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ60_EN1_SHIFT (28U) -/*! REQ60_EN1 - This register is used to enable and disable CAN1 DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ60_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ60_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ60_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ61_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ61_EN1_SHIFT (29U) -/*! REQ61_EN1 - This register is used to enable and disable FlexIO0 Shifter0 Status DMA request OR Timer0 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ61_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ61_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ61_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ62_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ62_EN1_SHIFT (30U) -/*! REQ62_EN1 - This register is used to enable and disable FlexIO0 Shifter1 Status DMA request OR Timer1 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ62_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ62_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ62_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ63_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ63_EN1_SHIFT (31U) -/*! REQ63_EN1 - This register is used to enable and disable FlexIO0 Shifter2 Status DMA request OR Timer2 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ63_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ63_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ63_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE1_SET - DMA1 Request Enable1 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ32_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ32_EN1_SHIFT (0U) -/*! REQ32_EN1 - Writing a 1 to REQ32_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ32_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ32_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ32_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ33_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ33_EN1_SHIFT (1U) -/*! REQ33_EN1 - Writing a 1 to REQ33_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ33_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ33_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ33_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ34_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ34_EN1_SHIFT (2U) -/*! REQ34_EN1 - Writing a 1 to REQ34_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ34_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ34_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ34_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ35_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ35_EN1_SHIFT (3U) -/*! REQ35_EN1 - Writing a 1 to REQ35_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ35_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ35_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ35_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ36_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ36_EN1_SHIFT (4U) -/*! REQ36_EN1 - Writing a 1 to REQ36_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ36_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ36_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ36_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ37_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ37_EN1_SHIFT (5U) -/*! REQ37_EN1 - Writing a 1 to REQ37_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ37_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ37_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ37_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ38_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ38_EN1_SHIFT (6U) -/*! REQ38_EN1 - Writing a 1 to REQ38_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ38_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ38_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ38_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ39_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ39_EN1_SHIFT (7U) -/*! REQ39_EN1 - Writing a 1 to REQ39_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ39_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ39_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ39_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ40_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ40_EN1_SHIFT (8U) -/*! REQ40_EN1 - Writing a 1 to REQ40_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ40_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ40_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ40_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ41_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ41_EN1_SHIFT (9U) -/*! REQ41_EN1 - Writing a 1 to REQ41_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ41_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ41_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ41_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ42_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ42_EN1_SHIFT (10U) -/*! REQ42_EN1 - Writing a 1 to REQ42_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ42_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ42_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ42_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ43_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ43_EN1_SHIFT (11U) -/*! REQ43_EN1 - Writing a 1 to REQ43_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ43_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ43_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ43_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ44_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ44_EN1_SHIFT (12U) -/*! REQ44_EN1 - Writing a 1 to REQ44_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ44_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ44_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ44_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ45_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ45_EN1_SHIFT (13U) -/*! REQ45_EN1 - Writing a 1 to REQ45_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ45_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ45_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ45_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ46_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ46_EN1_SHIFT (14U) -/*! REQ46_EN1 - Writing a 1 to REQ46_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ46_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ46_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ46_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ47_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ47_EN1_SHIFT (15U) -/*! REQ47_EN1 - Writing a 1 to REQ47_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ47_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ47_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ47_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ48_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ48_EN1_SHIFT (16U) -/*! REQ48_EN1 - Writing a 1 to REQ48_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ48_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ48_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ48_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ49_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ49_EN1_SHIFT (17U) -/*! REQ49_EN1 - Writing a 1 to REQ49_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ49_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ49_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ49_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ50_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ50_EN1_SHIFT (18U) -/*! REQ50_EN1 - Writing a 1 to REQ50_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ50_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ50_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ50_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ51_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ51_EN1_SHIFT (19U) -/*! REQ51_EN1 - Writing a 1 to REQ51_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ51_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ51_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ51_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ52_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ52_EN1_SHIFT (20U) -/*! REQ52_EN1 - Writing a 1 to REQ52_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ52_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ52_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ52_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ53_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ53_EN1_SHIFT (21U) -/*! REQ53_EN1 - Writing a 1 to REQ53_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ53_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ53_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ53_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ54_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ54_EN1_SHIFT (22U) -/*! REQ54_EN1 - Writing a 1 to REQ54_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ54_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ54_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ54_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ57_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ57_EN1_SHIFT (25U) -/*! REQ57_EN1 - Writing a 1 to REQ57_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ57_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ57_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ57_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ58_EN1_MASK (0x4000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ58_EN1_SHIFT (26U) -/*! REQ58_EN1 - Writing a 1 to REQ58_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ58_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ58_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ58_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ59_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ59_EN1_SHIFT (27U) -/*! REQ59_EN1 - Writing a 1 to REQ59_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ59_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ59_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ59_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ60_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ60_EN1_SHIFT (28U) -/*! REQ60_EN1 - Writing a 1 to REQ60_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ60_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ60_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ60_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ61_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ61_EN1_SHIFT (29U) -/*! REQ61_EN1 - Writing a 1 to REQ61_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ61_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ61_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ61_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ62_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ62_EN1_SHIFT (30U) -/*! REQ62_EN1 - Writing a 1 to REQ62_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ62_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ62_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ62_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ63_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ63_EN1_SHIFT (31U) -/*! REQ63_EN1 - Writing a 1 to REQ63_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ63_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ63_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ63_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE1_CLR - DMA1 Request Enable1 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ32_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ32_EN1_SHIFT (0U) -/*! REQ32_EN1 - Writing a 1 to REQ32_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ32_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ32_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ32_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ33_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ33_EN1_SHIFT (1U) -/*! REQ33_EN1 - Writing a 1 to REQ33_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ33_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ33_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ33_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ34_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ34_EN1_SHIFT (2U) -/*! REQ34_EN1 - Writing a 1 to REQ34_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ34_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ34_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ34_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ35_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ35_EN1_SHIFT (3U) -/*! REQ35_EN1 - Writing a 1 to REQ35_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ35_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ35_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ35_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ36_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ36_EN1_SHIFT (4U) -/*! REQ36_EN1 - Writing a 1 to REQ36_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ36_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ36_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ36_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ37_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ37_EN1_SHIFT (5U) -/*! REQ37_EN1 - Writing a 1 to REQ37_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ37_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ37_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ37_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ38_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ38_EN1_SHIFT (6U) -/*! REQ38_EN1 - Writing a 1 to REQ38_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ38_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ38_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ38_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ39_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ39_EN1_SHIFT (7U) -/*! REQ39_EN1 - Writing a 1 to REQ39_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ39_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ39_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ39_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ40_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ40_EN1_SHIFT (8U) -/*! REQ40_EN1 - Writing a 1 to REQ40_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ40_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ40_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ40_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ41_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ41_EN1_SHIFT (9U) -/*! REQ41_EN1 - Writing a 1 to REQ41_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ41_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ41_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ41_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ42_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ42_EN1_SHIFT (10U) -/*! REQ42_EN1 - Writing a 1 to REQ42_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ42_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ42_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ42_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ43_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ43_EN1_SHIFT (11U) -/*! REQ43_EN1 - Writing a 1 to REQ43_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ43_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ43_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ43_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ44_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ44_EN1_SHIFT (12U) -/*! REQ44_EN1 - Writing a 1 to REQ44_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ44_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ44_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ44_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ45_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ45_EN1_SHIFT (13U) -/*! REQ45_EN1 - Writing a 1 to REQ45_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ45_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ45_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ45_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ46_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ46_EN1_SHIFT (14U) -/*! REQ46_EN1 - Writing a 1 to REQ46_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ46_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ46_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ46_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ47_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ47_EN1_SHIFT (15U) -/*! REQ47_EN1 - Writing a 1 to REQ47_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ47_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ47_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ47_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ48_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ48_EN1_SHIFT (16U) -/*! REQ48_EN1 - Writing a 1 to REQ48_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ48_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ48_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ48_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ49_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ49_EN1_SHIFT (17U) -/*! REQ49_EN1 - Writing a 1 to REQ49_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ49_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ49_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ49_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ50_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ50_EN1_SHIFT (18U) -/*! REQ50_EN1 - Writing a 1 to REQ50_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ50_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ50_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ50_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ51_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ51_EN1_SHIFT (19U) -/*! REQ51_EN1 - Writing a 1 to REQ51_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ51_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ51_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ51_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ52_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ52_EN1_SHIFT (20U) -/*! REQ52_EN1 - Writing a 1 to REQ52_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ52_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ52_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ52_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ53_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ53_EN1_SHIFT (21U) -/*! REQ53_EN1 - Writing a 1 to REQ53_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ53_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ53_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ53_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ54_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ54_EN1_SHIFT (22U) -/*! REQ54_EN1 - Writing a 1 to REQ54_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ54_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ54_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ54_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ57_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ57_EN1_SHIFT (25U) -/*! REQ57_EN1 - Writing a 1 to REQ57_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ57_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ57_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ57_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ58_EN1_MASK (0x4000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ58_EN1_SHIFT (26U) -/*! REQ58_EN1 - Writing a 1 to REQ58_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ58_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ58_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ58_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ59_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ59_EN1_SHIFT (27U) -/*! REQ59_EN1 - Writing a 1 to REQ59_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ59_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ59_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ59_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ60_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ60_EN1_SHIFT (28U) -/*! REQ60_EN1 - Writing a 1 to REQ60_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ60_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ60_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ60_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ61_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ61_EN1_SHIFT (29U) -/*! REQ61_EN1 - Writing a 1 to REQ61_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ61_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ61_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ61_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ62_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ62_EN1_SHIFT (30U) -/*! REQ62_EN1 - Writing a 1 to REQ62_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ62_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ62_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ62_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ63_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ63_EN1_SHIFT (31U) -/*! REQ63_EN1 - Writing a 1 to REQ63_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ63_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ63_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ63_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE1_TOG - DMA1 Request Enable1 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ32_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ32_EN1_SHIFT (0U) -/*! REQ32_EN1 - Writing a 1 to REQ32_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ32_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ32_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ32_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ33_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ33_EN1_SHIFT (1U) -/*! REQ33_EN1 - Writing a 1 to REQ33_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ33_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ33_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ33_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ34_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ34_EN1_SHIFT (2U) -/*! REQ34_EN1 - Writing a 1 to REQ34_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ34_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ34_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ34_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ35_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ35_EN1_SHIFT (3U) -/*! REQ35_EN1 - Writing a 1 to REQ35_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ35_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ35_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ35_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ36_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ36_EN1_SHIFT (4U) -/*! REQ36_EN1 - Writing a 1 to REQ36_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ36_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ36_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ36_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ37_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ37_EN1_SHIFT (5U) -/*! REQ37_EN1 - Writing a 1 to REQ37_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ37_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ37_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ37_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ38_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ38_EN1_SHIFT (6U) -/*! REQ38_EN1 - Writing a 1 to REQ38_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ38_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ38_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ38_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ39_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ39_EN1_SHIFT (7U) -/*! REQ39_EN1 - Writing a 1 to REQ39_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ39_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ39_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ39_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ40_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ40_EN1_SHIFT (8U) -/*! REQ40_EN1 - Writing a 1 to REQ40_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ40_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ40_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ40_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ41_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ41_EN1_SHIFT (9U) -/*! REQ41_EN1 - Writing a 1 to REQ41_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ41_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ41_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ41_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ42_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ42_EN1_SHIFT (10U) -/*! REQ42_EN1 - Writing a 1 to REQ42_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ42_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ42_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ42_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ43_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ43_EN1_SHIFT (11U) -/*! REQ43_EN1 - Writing a 1 to REQ43_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ43_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ43_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ43_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ44_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ44_EN1_SHIFT (12U) -/*! REQ44_EN1 - Writing a 1 to REQ44_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ44_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ44_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ44_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ45_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ45_EN1_SHIFT (13U) -/*! REQ45_EN1 - Writing a 1 to REQ55_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ45_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ45_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ45_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ46_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ46_EN1_SHIFT (14U) -/*! REQ46_EN1 - Writing a 1 to REQ46_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ46_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ46_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ46_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ47_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ47_EN1_SHIFT (15U) -/*! REQ47_EN1 - Writing a 1 to REQ47_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ47_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ47_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ47_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ48_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ48_EN1_SHIFT (16U) -/*! REQ48_EN1 - Writing a 1 to REQ48_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ48_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ48_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ48_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ49_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ49_EN1_SHIFT (17U) -/*! REQ49_EN1 - Writing a 1 to REQ49_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ49_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ49_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ49_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ50_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ50_EN1_SHIFT (18U) -/*! REQ50_EN1 - Writing a 1 to REQ50_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ50_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ50_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ50_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ51_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ51_EN1_SHIFT (19U) -/*! REQ51_EN1 - Writing a 1 to REQ51_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ51_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ51_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ51_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ52_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ52_EN1_SHIFT (20U) -/*! REQ52_EN1 - Writing a 1 to REQ52_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ52_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ52_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ52_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ53_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ53_EN1_SHIFT (21U) -/*! REQ53_EN1 - Writing a 1 to REQ53_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ53_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ53_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ53_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ54_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ54_EN1_SHIFT (22U) -/*! REQ54_EN1 - Writing a 1 to REQ54_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ54_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ54_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ54_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ57_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ57_EN1_SHIFT (25U) -/*! REQ57_EN1 - Writing a 1 to REQ57_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ57_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ57_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ57_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ58_EN1_MASK (0x4000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ58_EN1_SHIFT (26U) -/*! REQ58_EN1 - Writing a 1 to REQ58_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ58_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ58_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ58_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ59_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ59_EN1_SHIFT (27U) -/*! REQ59_EN1 - Writing a 1 to REQ59_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ59_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ59_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ59_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ60_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ60_EN1_SHIFT (28U) -/*! REQ60_EN1 - Writing a 1 to REQ60_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ60_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ60_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ60_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ61_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ61_EN1_SHIFT (29U) -/*! REQ61_EN1 - Writing a 1 to REQ61_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ61_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ61_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ61_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ62_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ62_EN1_SHIFT (30U) -/*! REQ62_EN1 - Writing a 1 to REQ62_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ62_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ62_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ62_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ63_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ63_EN1_SHIFT (31U) -/*! REQ63_EN1 - Writing a 1 to REQ63_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ63_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ63_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ63_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE2 - DMA1 Request Enable2 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ64_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ64_EN1_SHIFT (0U) -/*! REQ64_EN1 - This register is used to enable and disable FlexIO0 Shifter3 Status DMA request OR Timer3 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ64_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ64_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ64_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ65_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ65_EN1_SHIFT (1U) -/*! REQ65_EN1 - This register is used to enable and disable FlexIO0 Shifter4 Status DMA request OR Timer4 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ65_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ65_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ65_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ66_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ66_EN1_SHIFT (2U) -/*! REQ66_EN1 - This register is used to enable and disable FlexIO0 Shifter5 Status DMA request OR Timer5 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ66_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ66_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ66_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ67_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ67_EN1_SHIFT (3U) -/*! REQ67_EN1 - This register is used to enable and disable FlexIO0 Shifter6 Status DMA request OR Timer6 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ67_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ67_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ67_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ68_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ68_EN1_SHIFT (4U) -/*! REQ68_EN1 - This register is used to enable and disable FlexIO0 Shifter7 Status DMA request OR Timer7 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ68_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ68_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ68_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ69_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ69_EN1_SHIFT (5U) -/*! REQ69_EN1 - This register is used to enable and disable LP_FLEXCOMM0 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ69_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ69_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ69_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ70_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ70_EN1_SHIFT (6U) -/*! REQ70_EN1 - This register is used to enable and disable LP_FLEXCOMM0 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ70_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ70_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ70_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ71_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ71_EN1_SHIFT (7U) -/*! REQ71_EN1 - This register is used to enable and disable LP_FLEXCOMM1 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ71_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ71_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ71_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ72_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ72_EN1_SHIFT (8U) -/*! REQ72_EN1 - This register is used to enable and disable LP_FLEXCOMM1 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ72_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ72_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ72_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ73_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ73_EN1_SHIFT (9U) -/*! REQ73_EN1 - This register is used to enable and disable LP_FLEXCOMM2 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ73_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ73_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ73_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ74_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ74_EN1_SHIFT (10U) -/*! REQ74_EN1 - This register is used to enable and disable LP_FLEXCOMM2 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ74_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ74_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ74_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ75_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ75_EN1_SHIFT (11U) -/*! REQ75_EN1 - This register is used to enable and disable LP_FLEXCOMM3 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ75_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ75_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ75_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ76_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ76_EN1_SHIFT (12U) -/*! REQ76_EN1 - This register is used to enable and disable LP_FLEXCOMM3 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ76_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ76_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ76_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ77_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ77_EN1_SHIFT (13U) -/*! REQ77_EN1 - This register is used to enable and disable LP_FLEXCOMM4 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ77_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ77_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ77_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ78_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ78_EN1_SHIFT (14U) -/*! REQ78_EN1 - This register is used to enable and disable LP_FLEXCOMM4 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ78_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ78_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ78_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ79_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ79_EN1_SHIFT (15U) -/*! REQ79_EN1 - This register is used to enable and disable LP_FLEXCOMM5 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ79_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ79_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ79_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ80_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ80_EN1_SHIFT (16U) -/*! REQ80_EN1 - This register is used to enable and disable LP_FLEXCOMM5 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ80_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ80_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ80_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ81_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ81_EN1_SHIFT (17U) -/*! REQ81_EN1 - This register is used to enable and disable LP_FLEXCOMM6 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ81_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ81_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ81_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ82_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ82_EN1_SHIFT (18U) -/*! REQ82_EN1 - This register is used to enable and disable LP_FLEXCOMM6 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ82_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ82_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ82_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ83_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ83_EN1_SHIFT (19U) -/*! REQ83_EN1 - This register is used to enable and disable LP_FLEXCOMM7 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ83_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ83_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ83_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ84_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ84_EN1_SHIFT (20U) -/*! REQ84_EN1 - This register is used to enable and disable LP_FLEXCOMM7 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ84_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ84_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ84_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ95_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ95_EN1_SHIFT (31U) -/*! REQ95_EN1 - This register is used to enable and disable I3C0 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ95_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ95_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ95_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE2_SET - DMA1 Request Enable2 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ64_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ64_EN1_SHIFT (0U) -/*! REQ64_EN1 - Writing a 1 to REQ64_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ64_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ64_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ64_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ65_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ65_EN1_SHIFT (1U) -/*! REQ65_EN1 - Writing a 1 to REQ65_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ65_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ65_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ65_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ66_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ66_EN1_SHIFT (2U) -/*! REQ66_EN1 - Writing a 1 to REQ66_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ66_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ66_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ66_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ67_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ67_EN1_SHIFT (3U) -/*! REQ67_EN1 - Writing a 1 to REQ67_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ67_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ67_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ67_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ68_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ68_EN1_SHIFT (4U) -/*! REQ68_EN1 - Writing a 1 to REQ68_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ68_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ68_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ68_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ69_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ69_EN1_SHIFT (5U) -/*! REQ69_EN1 - Writing a 1 to REQ69_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ69_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ69_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ69_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ70_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ70_EN1_SHIFT (6U) -/*! REQ70_EN1 - Writing a 1 to REQ70_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ70_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ70_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ70_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ71_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ71_EN1_SHIFT (7U) -/*! REQ71_EN1 - Writing a 1 to REQ71_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ71_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ71_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ71_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ72_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ72_EN1_SHIFT (8U) -/*! REQ72_EN1 - Writing a 1 to REQ72_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ72_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ72_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ72_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ73_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ73_EN1_SHIFT (9U) -/*! REQ73_EN1 - Writing a 1 to REQ73_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ73_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ73_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ73_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ74_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ74_EN1_SHIFT (10U) -/*! REQ74_EN1 - Writing a 1 to REQ74_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ74_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ74_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ74_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ75_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ75_EN1_SHIFT (11U) -/*! REQ75_EN1 - Writing a 1 to REQ75_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ75_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ75_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ75_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ76_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ76_EN1_SHIFT (12U) -/*! REQ76_EN1 - Writing a 1 to REQ876_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ76_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ76_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ76_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ77_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ77_EN1_SHIFT (13U) -/*! REQ77_EN1 - Writing a 1 to REQ77_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ77_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ77_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ77_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ78_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ78_EN1_SHIFT (14U) -/*! REQ78_EN1 - Writing a 1 to REQ78_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ78_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ78_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ78_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ79_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ79_EN1_SHIFT (15U) -/*! REQ79_EN1 - Writing a 1 to REQ79_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ79_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ79_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ79_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ80_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ80_EN1_SHIFT (16U) -/*! REQ80_EN1 - Writing a 1 to REQ80_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ80_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ80_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ80_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ81_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ81_EN1_SHIFT (17U) -/*! REQ81_EN1 - Writing a 1 to REQ81_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ81_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ81_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ81_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ82_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ82_EN1_SHIFT (18U) -/*! REQ82_EN1 - Writing a 1 to REQ82_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ82_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ82_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ82_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ83_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ83_EN1_SHIFT (19U) -/*! REQ83_EN1 - Writing a 1 to REQ83_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ83_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ83_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ83_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ84_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ84_EN1_SHIFT (20U) -/*! REQ84_EN1 - Writing a 1 to REQ84_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ84_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ84_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ84_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ85_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ85_EN1_SHIFT (21U) -/*! REQ85_EN1 - Writing a 1 to REQ85_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ85_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ85_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ85_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ86_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ86_EN1_SHIFT (22U) -/*! REQ86_EN1 - Writing a 1 to REQ86_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ86_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ86_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ86_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ87_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ87_EN1_SHIFT (23U) -/*! REQ87_EN1 - Writing a 1 to REQ87_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ87_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ87_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ87_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ88_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ88_EN1_SHIFT (24U) -/*! REQ88_EN1 - Writing a 1 to REQ88_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ88_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ88_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ88_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ89_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ89_EN1_SHIFT (25U) -/*! REQ89_EN1 - Writing a 1 to REQ89_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ89_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ89_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ89_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ90_EN1_MASK (0x4000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ90_EN1_SHIFT (26U) -/*! REQ90_EN1 - Writing a 1 to REQ90_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ90_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ90_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ90_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ91_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ91_EN1_SHIFT (27U) -/*! REQ91_EN1 - Writing a 1 to REQ91_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ91_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ91_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ91_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ92_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ92_EN1_SHIFT (28U) -/*! REQ92_EN1 - Writing a 1 to REQ92_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ92_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ92_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ92_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ93_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ93_EN1_SHIFT (29U) -/*! REQ93_EN1 - Writing a 1 to REQ93_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ93_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ93_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ93_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ94_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ94_EN1_SHIFT (30U) -/*! REQ94_EN1 - Writing a 1 to REQ94_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ94_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ94_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ94_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ95_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ95_EN1_SHIFT (31U) -/*! REQ95_EN1 - Writing a 1 to REQ95_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ95_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ95_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ95_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE2_CLR - DMA1 Request Enable2 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ64_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ64_EN1_SHIFT (0U) -/*! REQ64_EN1 - Writing a 1 to REQ64_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ64_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ64_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ64_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ65_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ65_EN1_SHIFT (1U) -/*! REQ65_EN1 - Writing a 1 to REQ65_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ65_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ65_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ65_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ66_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ66_EN1_SHIFT (2U) -/*! REQ66_EN1 - Writing a 1 to REQ66_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ66_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ66_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ66_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ67_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ67_EN1_SHIFT (3U) -/*! REQ67_EN1 - Writing a 1 to REQ67_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ67_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ67_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ67_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ68_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ68_EN1_SHIFT (4U) -/*! REQ68_EN1 - Writing a 1 to REQ68_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ68_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ68_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ68_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ69_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ69_EN1_SHIFT (5U) -/*! REQ69_EN1 - Writing a 1 to REQ69_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ69_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ69_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ69_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ70_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ70_EN1_SHIFT (6U) -/*! REQ70_EN1 - Writing a 1 to REQ70_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ70_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ70_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ70_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ71_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ71_EN1_SHIFT (7U) -/*! REQ71_EN1 - Writing a 1 to REQ71_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ71_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ71_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ71_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ72_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ72_EN1_SHIFT (8U) -/*! REQ72_EN1 - Writing a 1 to REQ72_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ72_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ72_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ72_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ73_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ73_EN1_SHIFT (9U) -/*! REQ73_EN1 - Writing a 1 to REQ73_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ73_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ73_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ73_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ74_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ74_EN1_SHIFT (10U) -/*! REQ74_EN1 - Writing a 1 to REQ74_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ74_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ74_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ74_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ75_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ75_EN1_SHIFT (11U) -/*! REQ75_EN1 - Writing a 1 to REQ75_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ75_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ75_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ75_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ76_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ76_EN1_SHIFT (12U) -/*! REQ76_EN1 - Writing a 1 to REQ76_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ76_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ76_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ76_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ77_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ77_EN1_SHIFT (13U) -/*! REQ77_EN1 - Writing a 1 to REQ77_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ77_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ77_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ77_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ78_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ78_EN1_SHIFT (14U) -/*! REQ78_EN1 - Writing a 1 to REQ78_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ78_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ78_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ78_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ79_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ79_EN1_SHIFT (15U) -/*! REQ79_EN1 - Writing a 1 to REQ79_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ79_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ79_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ79_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ80_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ80_EN1_SHIFT (16U) -/*! REQ80_EN1 - Writing a 1 to REQ80_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ80_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ80_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ80_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ81_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ81_EN1_SHIFT (17U) -/*! REQ81_EN1 - Writing a 1 to REQ81_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ81_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ81_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ81_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ82_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ82_EN1_SHIFT (18U) -/*! REQ82_EN1 - Writing a 1 to REQ82_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ82_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ82_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ82_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ83_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ83_EN1_SHIFT (19U) -/*! REQ83_EN1 - Writing a 1 to REQ83_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ83_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ83_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ83_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ84_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ84_EN1_SHIFT (20U) -/*! REQ84_EN1 - Writing a 1 to REQ84_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ84_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ84_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ84_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ85_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ85_EN1_SHIFT (21U) -/*! REQ85_EN1 - Writing a 1 to REQ85_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ85_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ85_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ85_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ86_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ86_EN1_SHIFT (22U) -/*! REQ86_EN1 - Writing a 1 to REQ86_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ86_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ86_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ86_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ87_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ87_EN1_SHIFT (23U) -/*! REQ87_EN1 - Writing a 1 to REQ87_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ87_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ87_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ87_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ88_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ88_EN1_SHIFT (24U) -/*! REQ88_EN1 - Writing a 1 to REQ88_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ88_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ88_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ88_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ89_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ89_EN1_SHIFT (25U) -/*! REQ89_EN1 - Writing a 1 to REQ89_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ89_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ89_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ89_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ90_EN1_MASK (0x4000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ90_EN1_SHIFT (26U) -/*! REQ90_EN1 - Writing a 1 to REQ90_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ90_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ90_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ90_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ91_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ91_EN1_SHIFT (27U) -/*! REQ91_EN1 - Writing a 1 to REQ91_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ91_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ91_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ91_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ92_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ92_EN1_SHIFT (28U) -/*! REQ92_EN1 - Writing a 1 to REQ92_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ92_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ92_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ92_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ93_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ93_EN1_SHIFT (29U) -/*! REQ93_EN1 - Writing a 1 to REQ93_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ93_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ93_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ93_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ94_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ94_EN1_SHIFT (30U) -/*! REQ94_EN1 - Writing a 1 to REQ94_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ94_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ94_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ94_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ95_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ95_EN1_SHIFT (31U) -/*! REQ95_EN1 - Writing a 1 to REQ95_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ95_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ95_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ95_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE2_TOG - DMA1 Request Enable2 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ64_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ64_EN1_SHIFT (0U) -/*! REQ64_EN1 - Writing a 1 to REQ64_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ64_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ64_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ64_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ65_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ65_EN1_SHIFT (1U) -/*! REQ65_EN1 - Writing a 1 to REQ65_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ65_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ65_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ65_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ66_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ66_EN1_SHIFT (2U) -/*! REQ66_EN1 - Writing a 1 to REQ66_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ66_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ66_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ66_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ67_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ67_EN1_SHIFT (3U) -/*! REQ67_EN1 - Writing a 1 to REQ67_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ67_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ67_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ67_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ68_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ68_EN1_SHIFT (4U) -/*! REQ68_EN1 - Writing a 1 to REQ68_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ68_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ68_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ68_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ69_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ69_EN1_SHIFT (5U) -/*! REQ69_EN1 - Writing a 1 to REQ69_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ69_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ69_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ69_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ70_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ70_EN1_SHIFT (6U) -/*! REQ70_EN1 - Writing a 1 to REQ70_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ70_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ70_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ70_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ71_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ71_EN1_SHIFT (7U) -/*! REQ71_EN1 - Writing a 1 to REQ71_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ71_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ71_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ71_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ72_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ72_EN1_SHIFT (8U) -/*! REQ72_EN1 - Writing a 1 to REQ72_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ72_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ72_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ72_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ73_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ73_EN1_SHIFT (9U) -/*! REQ73_EN1 - Writing a 1 to REQ73_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ73_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ73_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ73_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ74_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ74_EN1_SHIFT (10U) -/*! REQ74_EN1 - Writing a 1 to REQ74_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ74_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ74_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ74_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ75_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ75_EN1_SHIFT (11U) -/*! REQ75_EN1 - Writing a 1 to REQ75_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ75_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ75_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ75_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ76_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ76_EN1_SHIFT (12U) -/*! REQ76_EN1 - Writing a 1 to REQ76_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ76_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ76_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ76_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ77_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ77_EN1_SHIFT (13U) -/*! REQ77_EN1 - Writing a 1 to REQ77_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ77_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ77_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ77_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ78_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ78_EN1_SHIFT (14U) -/*! REQ78_EN1 - Writing a 1 to REQ78_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ78_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ78_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ78_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ79_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ79_EN1_SHIFT (15U) -/*! REQ79_EN1 - Writing a 1 to REQ79_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ79_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ79_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ79_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ80_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ80_EN1_SHIFT (16U) -/*! REQ80_EN1 - Writing a 1 to REQ80_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ80_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ80_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ80_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ81_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ81_EN1_SHIFT (17U) -/*! REQ81_EN1 - Writing a 1 to REQ81_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ81_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ81_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ81_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ82_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ82_EN1_SHIFT (18U) -/*! REQ82_EN1 - Writing a 1 to REQ82_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ82_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ82_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ82_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ83_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ83_EN1_SHIFT (19U) -/*! REQ83_EN1 - Writing a 1 to REQ83_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ83_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ83_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ83_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ84_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ84_EN1_SHIFT (20U) -/*! REQ84_EN1 - Writing a 1 to REQ84_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ84_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ84_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ84_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ85_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ85_EN1_SHIFT (21U) -/*! REQ85_EN1 - Writing a 1 to REQ85_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ85_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ85_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ85_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ86_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ86_EN1_SHIFT (22U) -/*! REQ86_EN1 - Writing a 1 to REQ86_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ86_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ86_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ86_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ87_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ87_EN1_SHIFT (23U) -/*! REQ87_EN1 - Writing a 1 to REQ87_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ87_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ87_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ87_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ88_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ88_EN1_SHIFT (24U) -/*! REQ88_EN1 - Writing a 1 to REQ88_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ88_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ88_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ88_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ89_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ89_EN1_SHIFT (25U) -/*! REQ89_EN1 - Writing a 1 to REQ89_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ89_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ89_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ89_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ90_EN1_MASK (0x4000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ90_EN1_SHIFT (26U) -/*! REQ90_EN1 - Writing a 1 to REQ90_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ90_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ90_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ90_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ91_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ91_EN1_SHIFT (27U) -/*! REQ91_EN1 - Writing a 1 to REQ91_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ91_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ91_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ91_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ92_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ92_EN1_SHIFT (28U) -/*! REQ92_EN1 - Writing a 1 to REQ92_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ92_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ92_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ92_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ93_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ93_EN1_SHIFT (29U) -/*! REQ93_EN1 - Writing a 1 to REQ93_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ93_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ93_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ93_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ94_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ94_EN1_SHIFT (30U) -/*! REQ94_EN1 - Writing a 1 to REQ94_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ94_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ94_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ94_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ95_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ95_EN1_SHIFT (31U) -/*! REQ95_EN1 - Writing a 1 to REQ95_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ95_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ95_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ95_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE3 - DMA1 Request Enable3 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ96_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ96_EN1_SHIFT (0U) -/*! REQ96_EN1 - This register is used to enable and disable I3C0 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ96_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ96_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ96_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ97_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ97_EN1_SHIFT (1U) -/*! REQ97_EN1 - This register is used to enable and disable I3C1 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ97_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ97_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ97_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ98_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ98_EN1_SHIFT (2U) -/*! REQ98_EN1 - This register is used to enable and disable I3C1 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ98_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ98_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ98_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ99_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ99_EN1_SHIFT (3U) -/*! REQ99_EN1 - This register is used to enable and disable SAI0 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ99_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ99_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ99_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ100_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ100_EN1_SHIFT (4U) -/*! REQ100_EN1 - This register is used to enable and disable SAI0 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ100_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ100_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ100_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ101_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ101_EN1_SHIFT (5U) -/*! REQ101_EN1 - This register is used to enable and disable SAI1 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ101_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ101_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ101_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ102_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ102_EN1_SHIFT (6U) -/*! REQ102_EN1 - This register is used to enable and disable SAI1 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ102_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ102_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ102_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ108_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ108_EN1_SHIFT (12U) -/*! REQ108_EN1 - This register is used to enable and disable GPIO0 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ108_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ108_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ108_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ109_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ109_EN1_SHIFT (13U) -/*! REQ109_EN1 - This register is used to enable and disable GPIO0 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ109_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ109_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ109_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ110_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ110_EN1_SHIFT (14U) -/*! REQ110_EN1 - This register is used to enable and disable GPIO1 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ110_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ110_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ110_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ111_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ111_EN1_SHIFT (15U) -/*! REQ111_EN1 - This register is used to enable and disable GPIO1 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ111_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ111_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ111_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ112_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ112_EN1_SHIFT (16U) -/*! REQ112_EN1 - This register is used to enable and disable GPIO2 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ112_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ112_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ112_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ113_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ113_EN1_SHIFT (17U) -/*! REQ113_EN1 - This register is used to enable and disable GPIO2 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ113_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ113_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ113_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ114_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ114_EN1_SHIFT (18U) -/*! REQ114_EN1 - This register is used to enable and disable GPIO3 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ114_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ114_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ114_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ115_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ115_EN1_SHIFT (19U) -/*! REQ115_EN1 - This register is used to enable and disable GPIO3 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ115_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ115_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ115_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ116_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ116_EN1_SHIFT (20U) -/*! REQ116_EN1 - This register is used to enable and disable GPIO4 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ116_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ116_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ116_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ117_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ117_EN1_SHIFT (21U) -/*! REQ117_EN1 - This register is used to enable and disable GPIO4 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ117_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ117_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ117_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ118_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ118_EN1_SHIFT (22U) -/*! REQ118_EN1 - This register is used to enable and disable GPIO5 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ118_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ118_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ118_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ119_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ119_EN1_SHIFT (23U) -/*! REQ119_EN1 - This register is used to enable and disable GPIO5 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ119_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ119_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ119_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE3_SET - DMA1 Request Enable3 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ96_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ96_EN1_SHIFT (0U) -/*! REQ96_EN1 - Writing a 1 to REQ96_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ96_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ96_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ96_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ97_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ97_EN1_SHIFT (1U) -/*! REQ97_EN1 - Writing a 1 to REQ97_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ97_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ97_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ97_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ98_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ98_EN1_SHIFT (2U) -/*! REQ98_EN1 - Writing a 1 to REQ98_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ98_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ98_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ98_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ99_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ99_EN1_SHIFT (3U) -/*! REQ99_EN1 - Writing a 1 to REQ99_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ99_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ99_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ99_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ100_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ100_EN1_SHIFT (4U) -/*! REQ100_EN1 - Writing a 1 to REQ100_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ100_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ100_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ100_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ101_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ101_EN1_SHIFT (5U) -/*! REQ101_EN1 - Writing a 1 to REQ101_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ101_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ101_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ101_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ102_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ102_EN1_SHIFT (6U) -/*! REQ102_EN1 - Writing a 1 to REQ102_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ102_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ102_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ102_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ103_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ103_EN1_SHIFT (7U) -/*! REQ103_EN1 - Writing a 1 to REQ103_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ103_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ103_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ103_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ104_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ104_EN1_SHIFT (8U) -/*! REQ104_EN1 - Writing a 1 to REQ104_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ104_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ104_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ104_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ105_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ105_EN1_SHIFT (9U) -/*! REQ105_EN1 - Writing a 1 to REQ105_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ105_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ105_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ105_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ106_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ106_EN1_SHIFT (10U) -/*! REQ106_EN1 - Writing a 1 to REQ106_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ106_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ106_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ106_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ107_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ107_EN1_SHIFT (11U) -/*! REQ107_EN1 - Writing a 1 to REQ107_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ107_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ107_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ107_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ108_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ108_EN1_SHIFT (12U) -/*! REQ108_EN1 - Writing a 1 to REQ108_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ108_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ108_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ108_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ109_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ109_EN1_SHIFT (13U) -/*! REQ109_EN1 - Writing a 1 to REQ109_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ109_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ109_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ109_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ110_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ110_EN1_SHIFT (14U) -/*! REQ110_EN1 - Writing a 1 to REQ110_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ110_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ110_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ110_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ111_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ111_EN1_SHIFT (15U) -/*! REQ111_EN1 - Writing a 1 to REQ111_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ111_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ111_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ111_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ112_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ112_EN1_SHIFT (16U) -/*! REQ112_EN1 - Writing a 1 to REQ112_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ112_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ112_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ112_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ113_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ113_EN1_SHIFT (17U) -/*! REQ113_EN1 - Writing a 1 to REQ113_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ113_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ113_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ113_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ114_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ114_EN1_SHIFT (18U) -/*! REQ114_EN1 - Writing a 1 to REQ114_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ114_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ114_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ114_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ115_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ115_EN1_SHIFT (19U) -/*! REQ115_EN1 - Writing a 1 to REQ115_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ115_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ115_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ115_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ116_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ116_EN1_SHIFT (20U) -/*! REQ116_EN1 - Writing a 1 to REQ116_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ116_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ116_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ116_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ117_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ117_EN1_SHIFT (21U) -/*! REQ117_EN1 - Writing a 1 to REQ117_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ117_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ117_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ117_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ118_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ118_EN1_SHIFT (22U) -/*! REQ118_EN1 - Writing a 1 to REQ118_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ118_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ118_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ118_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ119_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ119_EN1_SHIFT (23U) -/*! REQ119_EN1 - Writing a 1 to REQ119_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ119_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ119_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ119_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ120_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ120_EN1_SHIFT (24U) -/*! REQ120_EN1 - Writing a 1 to REQ120_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ120_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ120_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ120_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ121_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ121_EN1_SHIFT (25U) -/*! REQ121_EN1 - Writing a 1 to REQ121_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ121_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ121_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ121_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE3_CLR - DMA1 Request Enable3 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ96_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ96_EN1_SHIFT (0U) -/*! REQ96_EN1 - Writing a 1 to REQ96_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ96_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ96_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ96_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ97_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ97_EN1_SHIFT (1U) -/*! REQ97_EN1 - Writing a 1 to REQ97_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ97_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ97_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ97_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ98_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ98_EN1_SHIFT (2U) -/*! REQ98_EN1 - Writing a 1 to REQ98_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ98_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ98_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ98_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ99_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ99_EN1_SHIFT (3U) -/*! REQ99_EN1 - Writing a 1 to REQ99_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ99_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ99_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ99_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ100_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ100_EN1_SHIFT (4U) -/*! REQ100_EN1 - Writing a 1 to REQ100_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ100_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ100_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ100_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ101_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ101_EN1_SHIFT (5U) -/*! REQ101_EN1 - Writing a 1 to REQ101_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ101_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ101_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ101_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ102_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ102_EN1_SHIFT (6U) -/*! REQ102_EN1 - Writing a 1 to REQ102_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ102_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ102_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ102_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ103_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ103_EN1_SHIFT (7U) -/*! REQ103_EN1 - Writing a 1 to REQ103_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ103_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ103_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ103_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ104_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ104_EN1_SHIFT (8U) -/*! REQ104_EN1 - Writing a 1 to REQ104_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ104_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ104_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ104_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ105_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ105_EN1_SHIFT (9U) -/*! REQ105_EN1 - Writing a 1 to REQ105_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ105_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ105_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ105_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ106_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ106_EN1_SHIFT (10U) -/*! REQ106_EN1 - Writing a 1 to REQ106_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ106_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ106_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ106_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ107_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ107_EN1_SHIFT (11U) -/*! REQ107_EN1 - Writing a 1 to REQ107_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ107_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ107_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ107_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ108_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ108_EN1_SHIFT (12U) -/*! REQ108_EN1 - Writing a 1 to REQ108_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ108_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ108_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ108_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ109_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ109_EN1_SHIFT (13U) -/*! REQ109_EN1 - Writing a 1 to REQ109_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ109_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ109_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ109_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ110_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ110_EN1_SHIFT (14U) -/*! REQ110_EN1 - Writing a 1 to REQ110_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ110_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ110_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ110_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ111_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ111_EN1_SHIFT (15U) -/*! REQ111_EN1 - Writing a 1 to REQ111_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ111_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ111_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ111_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ112_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ112_EN1_SHIFT (16U) -/*! REQ112_EN1 - Writing a 1 to REQ112_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ112_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ112_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ112_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ113_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ113_EN1_SHIFT (17U) -/*! REQ113_EN1 - Writing a 1 to REQ113_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ113_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ113_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ113_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ114_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ114_EN1_SHIFT (18U) -/*! REQ114_EN1 - Writing a 1 to REQ114_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ114_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ114_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ114_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ115_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ115_EN1_SHIFT (19U) -/*! REQ115_EN1 - Writing a 1 to REQ115_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ115_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ115_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ115_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ116_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ116_EN1_SHIFT (20U) -/*! REQ116_EN1 - Writing a 1 to REQ116_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ116_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ116_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ116_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ117_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ117_EN1_SHIFT (21U) -/*! REQ117_EN1 - Writing a 1 to REQ117_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ117_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ117_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ117_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ118_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ118_EN1_SHIFT (22U) -/*! REQ118_EN1 - Writing a 1 to REQ118_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ118_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ118_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ118_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ119_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ119_EN1_SHIFT (23U) -/*! REQ119_EN1 - Writing a 1 to REQ119_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ119_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ119_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ119_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ120_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ120_EN1_SHIFT (24U) -/*! REQ120_EN1 - Writing a 1 to REQ120_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ120_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ120_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ120_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ121_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ121_EN1_SHIFT (25U) -/*! REQ121_EN1 - Writing a 1 to REQ121_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3. */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ121_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ121_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ121_EN1_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group INPUTMUX_Register_Masks */ - - -/* INPUTMUX - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral INPUTMUX0 base address */ - #define INPUTMUX0_BASE (0x50006000u) - /** Peripheral INPUTMUX0 base address */ - #define INPUTMUX0_BASE_NS (0x40006000u) - /** Peripheral INPUTMUX0 base pointer */ - #define INPUTMUX0 ((INPUTMUX_Type *)INPUTMUX0_BASE) - /** Peripheral INPUTMUX0 base pointer */ - #define INPUTMUX0_NS ((INPUTMUX_Type *)INPUTMUX0_BASE_NS) - /** Array initializer of INPUTMUX peripheral base addresses */ - #define INPUTMUX_BASE_ADDRS { INPUTMUX0_BASE } - /** Array initializer of INPUTMUX peripheral base pointers */ - #define INPUTMUX_BASE_PTRS { INPUTMUX0 } - /** Array initializer of INPUTMUX peripheral base addresses */ - #define INPUTMUX_BASE_ADDRS_NS { INPUTMUX0_BASE_NS } - /** Array initializer of INPUTMUX peripheral base pointers */ - #define INPUTMUX_BASE_PTRS_NS { INPUTMUX0_NS } -#else - /** Peripheral INPUTMUX0 base address */ - #define INPUTMUX0_BASE (0x40006000u) - /** Peripheral INPUTMUX0 base pointer */ - #define INPUTMUX0 ((INPUTMUX_Type *)INPUTMUX0_BASE) - /** Array initializer of INPUTMUX peripheral base addresses */ - #define INPUTMUX_BASE_ADDRS { INPUTMUX0_BASE } - /** Array initializer of INPUTMUX peripheral base pointers */ - #define INPUTMUX_BASE_PTRS { INPUTMUX0 } -#endif -/* Backward compatibility for INPUTMUX */ -#define INPUTMUX INPUTMUX0 - - -/*! - * @} - */ /* end of group INPUTMUX_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- INTM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup INTM_Peripheral_Access_Layer INTM Peripheral Access Layer - * @{ - */ - -/** INTM - Register Layout Typedef */ -typedef struct { - __IO uint32_t INTM_MM; /**< Monitor Mode, offset: 0x0 */ - __O uint32_t INTM_IACK; /**< Interrupt Acknowledge, offset: 0x4 */ - struct { /* offset: 0x8, array step: 0x10 */ - __IO uint32_t INTM_IRQSEL; /**< Interrupt Request Select for Monitor 0..Interrupt Request Select for Monitor 3, array offset: 0x8, array step: 0x10 */ - __IO uint32_t INTM_LATENCY; /**< Interrupt Latency for Monitor 0..Interrupt Latency for Monitor 3, array offset: 0xC, array step: 0x10 */ - __IO uint32_t INTM_TIMER; /**< Timer for Monitor 0..Timer for Monitor 3, array offset: 0x10, array step: 0x10 */ - __I uint32_t INTM_STATUS; /**< Status for Monitor 0..Status for Monitor 3, array offset: 0x14, array step: 0x10 */ - } MON[4]; -} INTM_Type; - -/* ---------------------------------------------------------------------------- - -- INTM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup INTM_Register_Masks INTM Register Masks - * @{ - */ - -/*! @name INTM_MM - Monitor Mode */ -/*! @{ */ - -#define INTM_INTM_MM_MM_MASK (0x1U) -#define INTM_INTM_MM_MM_SHIFT (0U) -/*! MM - Monitor Mode - * 0b1..Enable - * 0b0..Disable - */ -#define INTM_INTM_MM_MM(x) (((uint32_t)(((uint32_t)(x)) << INTM_INTM_MM_MM_SHIFT)) & INTM_INTM_MM_MM_MASK) -/*! @} */ - -/*! @name INTM_IACK - Interrupt Acknowledge */ -/*! @{ */ - -#define INTM_INTM_IACK_IRQ_MASK (0x3FFU) -#define INTM_INTM_IACK_IRQ_SHIFT (0U) -/*! IRQ - Interrupt Request */ -#define INTM_INTM_IACK_IRQ(x) (((uint32_t)(((uint32_t)(x)) << INTM_INTM_IACK_IRQ_SHIFT)) & INTM_INTM_IACK_IRQ_MASK) -/*! @} */ - -/*! @name MON_INTM_IRQSEL - Interrupt Request Select for Monitor 0..Interrupt Request Select for Monitor 3 */ -/*! @{ */ - -#define INTM_MON_INTM_IRQSEL_IRQ_MASK (0x3FFU) -#define INTM_MON_INTM_IRQSEL_IRQ_SHIFT (0U) -/*! IRQ - Interrupt Request */ -#define INTM_MON_INTM_IRQSEL_IRQ(x) (((uint32_t)(((uint32_t)(x)) << INTM_MON_INTM_IRQSEL_IRQ_SHIFT)) & INTM_MON_INTM_IRQSEL_IRQ_MASK) -/*! @} */ - -/* The count of INTM_MON_INTM_IRQSEL */ -#define INTM_MON_INTM_IRQSEL_COUNT (4U) - -/*! @name MON_INTM_LATENCY - Interrupt Latency for Monitor 0..Interrupt Latency for Monitor 3 */ -/*! @{ */ - -#define INTM_MON_INTM_LATENCY_LAT_MASK (0xFFFFFFU) -#define INTM_MON_INTM_LATENCY_LAT_SHIFT (0U) -/*! LAT - Latency */ -#define INTM_MON_INTM_LATENCY_LAT(x) (((uint32_t)(((uint32_t)(x)) << INTM_MON_INTM_LATENCY_LAT_SHIFT)) & INTM_MON_INTM_LATENCY_LAT_MASK) -/*! @} */ - -/* The count of INTM_MON_INTM_LATENCY */ -#define INTM_MON_INTM_LATENCY_COUNT (4U) - -/*! @name MON_INTM_TIMER - Timer for Monitor 0..Timer for Monitor 3 */ -/*! @{ */ - -#define INTM_MON_INTM_TIMER_TIMER_MASK (0xFFFFFFU) -#define INTM_MON_INTM_TIMER_TIMER_SHIFT (0U) -/*! TIMER - Timer */ -#define INTM_MON_INTM_TIMER_TIMER(x) (((uint32_t)(((uint32_t)(x)) << INTM_MON_INTM_TIMER_TIMER_SHIFT)) & INTM_MON_INTM_TIMER_TIMER_MASK) -/*! @} */ - -/* The count of INTM_MON_INTM_TIMER */ -#define INTM_MON_INTM_TIMER_COUNT (4U) - -/*! @name MON_INTM_STATUS - Status for Monitor 0..Status for Monitor 3 */ -/*! @{ */ - -#define INTM_MON_INTM_STATUS_STATUS_MASK (0x1U) -#define INTM_MON_INTM_STATUS_STATUS_SHIFT (0U) -/*! STATUS - Monitor status - * 0b1..Exceeded - * 0b0..Did not exceed - */ -#define INTM_MON_INTM_STATUS_STATUS(x) (((uint32_t)(((uint32_t)(x)) << INTM_MON_INTM_STATUS_STATUS_SHIFT)) & INTM_MON_INTM_STATUS_STATUS_MASK) -/*! @} */ - -/* The count of INTM_MON_INTM_STATUS */ -#define INTM_MON_INTM_STATUS_COUNT (4U) - - -/*! - * @} - */ /* end of group INTM_Register_Masks */ - - -/* INTM - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral INTM0 base address */ - #define INTM0_BASE (0x5005D000u) - /** Peripheral INTM0 base address */ - #define INTM0_BASE_NS (0x4005D000u) - /** Peripheral INTM0 base pointer */ - #define INTM0 ((INTM_Type *)INTM0_BASE) - /** Peripheral INTM0 base pointer */ - #define INTM0_NS ((INTM_Type *)INTM0_BASE_NS) - /** Array initializer of INTM peripheral base addresses */ - #define INTM_BASE_ADDRS { INTM0_BASE } - /** Array initializer of INTM peripheral base pointers */ - #define INTM_BASE_PTRS { INTM0 } - /** Array initializer of INTM peripheral base addresses */ - #define INTM_BASE_ADDRS_NS { INTM0_BASE_NS } - /** Array initializer of INTM peripheral base pointers */ - #define INTM_BASE_PTRS_NS { INTM0_NS } -#else - /** Peripheral INTM0 base address */ - #define INTM0_BASE (0x4005D000u) - /** Peripheral INTM0 base pointer */ - #define INTM0 ((INTM_Type *)INTM0_BASE) - /** Array initializer of INTM peripheral base addresses */ - #define INTM_BASE_ADDRS { INTM0_BASE } - /** Array initializer of INTM peripheral base pointers */ - #define INTM_BASE_PTRS { INTM0 } -#endif - -/*! - * @} - */ /* end of group INTM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- ITRC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ITRC_Peripheral_Access_Layer ITRC Peripheral Access Layer - * @{ - */ - -/** ITRC - Register Layout Typedef */ -typedef struct { - __IO uint32_t STATUS; /**< ITRC outputs and IN0 to IN15 Status, offset: 0x0 */ - __IO uint32_t STATUS1; /**< ITRC IN16 to IN47 Status, offset: 0x4 */ - __IO uint32_t OUT_SEL[7][2]; /**< Trigger Source IN0 to IN15 selector, array offset: 0x8, array step: index*0x8, index2*0x4 */ - uint8_t RESERVED_0[8]; - __IO uint32_t OUT_SEL_1[7][2]; /**< Trigger Source IN16 to IN31 selector, array offset: 0x48, array step: index*0x8, index2*0x4 */ - uint8_t RESERVED_1[8]; - __IO uint32_t OUT_SEL_2[7][2]; /**< Trigger source IN32 to IN47 selector, array offset: 0x88, array step: index*0x8, index2*0x4 */ - uint8_t RESERVED_2[48]; - __O uint32_t SW_EVENT0; /**< Software event 0, offset: 0xF0 */ - __O uint32_t SW_EVENT1; /**< Software event 1, offset: 0xF4 */ -} ITRC_Type; - -/* ---------------------------------------------------------------------------- - -- ITRC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ITRC_Register_Masks ITRC Register Masks - * @{ - */ - -/*! @name STATUS - ITRC outputs and IN0 to IN15 Status */ -/*! @{ */ - -#define ITRC_STATUS_IN0_STATUS_MASK (0x1U) -#define ITRC_STATUS_IN0_STATUS_SHIFT (0U) -/*! IN0_STATUS - GDET0 & 1 interrupt. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN0_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN0_STATUS_SHIFT)) & ITRC_STATUS_IN0_STATUS_MASK) - -#define ITRC_STATUS_IN1_STATUS_MASK (0x2U) -#define ITRC_STATUS_IN1_STATUS_SHIFT (1U) -/*! IN1_STATUS - TDET tamper output. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN1_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN1_STATUS_SHIFT)) & ITRC_STATUS_IN1_STATUS_MASK) - -#define ITRC_STATUS_IN2_STATUS_MASK (0x4U) -#define ITRC_STATUS_IN2_STATUS_SHIFT (2U) -/*! IN2_STATUS - Code Watchdog 0 interrupt. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN2_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN2_STATUS_SHIFT)) & ITRC_STATUS_IN2_STATUS_MASK) - -#define ITRC_STATUS_IN3_STATUS_MASK (0x8U) -#define ITRC_STATUS_IN3_STATUS_SHIFT (3U) -/*! IN3_STATUS - VDD_MAIN volt tamper output. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN3_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN3_STATUS_SHIFT)) & ITRC_STATUS_IN3_STATUS_MASK) - -#define ITRC_STATUS_IN4_STATUS_MASK (0x10U) -#define ITRC_STATUS_IN4_STATUS_SHIFT (4U) -/*! IN4_STATUS - SPC VDD_CORE_LVD detect. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN4_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN4_STATUS_SHIFT)) & ITRC_STATUS_IN4_STATUS_MASK) - -#define ITRC_STATUS_IN5_STATUS_MASK (0x20U) -#define ITRC_STATUS_IN5_STATUS_SHIFT (5U) -/*! IN5_STATUS - Watch Dog timer event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN5_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN5_STATUS_SHIFT)) & ITRC_STATUS_IN5_STATUS_MASK) - -#define ITRC_STATUS_IN6_STATUS_MASK (0x40U) -#define ITRC_STATUS_IN6_STATUS_SHIFT (6U) -/*! IN6_STATUS - Flash ECC mismatch event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN6_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN6_STATUS_SHIFT)) & ITRC_STATUS_IN6_STATUS_MASK) - -#define ITRC_STATUS_IN7_STATUS_MASK (0x80U) -#define ITRC_STATUS_IN7_STATUS_SHIFT (7U) -/*! IN7_STATUS - AHB secure bus checkers detected illegal access. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN7_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN7_STATUS_SHIFT)) & ITRC_STATUS_IN7_STATUS_MASK) - -#define ITRC_STATUS_IN8_STATUS_MASK (0x100U) -#define ITRC_STATUS_IN8_STATUS_SHIFT (8U) -/*! IN8_STATUS - ELS error event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN8_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN8_STATUS_SHIFT)) & ITRC_STATUS_IN8_STATUS_MASK) - -#define ITRC_STATUS_IN9_STATUS_MASK (0x200U) -#define ITRC_STATUS_IN9_STATUS_SHIFT (9U) -/*! IN9_STATUS - SPC VDD_CORE glitch detect event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN9_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN9_STATUS_SHIFT)) & ITRC_STATUS_IN9_STATUS_MASK) - -#define ITRC_STATUS_IN10_STATUS_MASK (0x400U) -#define ITRC_STATUS_IN10_STATUS_SHIFT (10U) -/*! IN10_STATUS - PKC module detected an error event. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN10_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN10_STATUS_SHIFT)) & ITRC_STATUS_IN10_STATUS_MASK) - -#define ITRC_STATUS_IN11_STATUS_MASK (0x800U) -#define ITRC_STATUS_IN11_STATUS_SHIFT (11U) -/*! IN11_STATUS - Code Watchdog 1 interrupt. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN11_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN11_STATUS_SHIFT)) & ITRC_STATUS_IN11_STATUS_MASK) - -#define ITRC_STATUS_IN112_STATUS_MASK (0x1000U) -#define ITRC_STATUS_IN112_STATUS_SHIFT (12U) -/*! IN112_STATUS - Watchdog 1 timer event interrupt. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN112_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN112_STATUS_SHIFT)) & ITRC_STATUS_IN112_STATUS_MASK) - -#define ITRC_STATUS_IN113_STATUS_MASK (0x2000U) -#define ITRC_STATUS_IN113_STATUS_SHIFT (13U) -/*! IN113_STATUS - FREQME out of range status output. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN113_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN113_STATUS_SHIFT)) & ITRC_STATUS_IN113_STATUS_MASK) - -#define ITRC_STATUS_IN14_STATUS_MASK (0x4000U) -#define ITRC_STATUS_IN14_STATUS_SHIFT (14U) -/*! IN14_STATUS - Software event 0 occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN14_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN14_STATUS_SHIFT)) & ITRC_STATUS_IN14_STATUS_MASK) - -#define ITRC_STATUS_IN15_STATUS_MASK (0x8000U) -#define ITRC_STATUS_IN15_STATUS_SHIFT (15U) -/*! IN15_STATUS - Software event 1 occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN15_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN15_STATUS_SHIFT)) & ITRC_STATUS_IN15_STATUS_MASK) - -#define ITRC_STATUS_OUT0_STATUS_MASK (0x10000U) -#define ITRC_STATUS_OUT0_STATUS_SHIFT (16U) -/*! OUT0_STATUS - ITRC triggered ITRC_IRQ output. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_OUT0_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_OUT0_STATUS_SHIFT)) & ITRC_STATUS_OUT0_STATUS_MASK) - -#define ITRC_STATUS_OUT1_STATUS_MASK (0x20000U) -#define ITRC_STATUS_OUT1_STATUS_SHIFT (17U) -/*! OUT1_STATUS - ITRC triggered ELS_RESET to clear ELS key store. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_OUT1_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_OUT1_STATUS_SHIFT)) & ITRC_STATUS_OUT1_STATUS_MASK) - -#define ITRC_STATUS_OUT2_STATUS_MASK (0x40000U) -#define ITRC_STATUS_OUT2_STATUS_SHIFT (18U) -/*! OUT2_STATUS - ITRC triggered PUF_ZEROIZE to clear PUF key store and RAM. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_OUT2_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_OUT2_STATUS_SHIFT)) & ITRC_STATUS_OUT2_STATUS_MASK) - -#define ITRC_STATUS_OUT3_STATUS_MASK (0x80000U) -#define ITRC_STATUS_OUT3_STATUS_SHIFT (19U) -/*! OUT3_STATUS - ITRC triggered RAM_ZEROIZE. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_OUT3_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_OUT3_STATUS_SHIFT)) & ITRC_STATUS_OUT3_STATUS_MASK) - -#define ITRC_STATUS_OUT4_STATUS_MASK (0x100000U) -#define ITRC_STATUS_OUT4_STATUS_SHIFT (20U) -/*! OUT4_STATUS - ITRC triggered CHIP_RESET to reset the chip after all other response process finished. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_OUT4_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_OUT4_STATUS_SHIFT)) & ITRC_STATUS_OUT4_STATUS_MASK) - -#define ITRC_STATUS_OUT5_STATUS_MASK (0x200000U) -#define ITRC_STATUS_OUT5_STATUS_SHIFT (21U) -/*! OUT5_STATUS - ITRC triggered TMPR_OUT0 internal signal connected to various on-chip multiplexers. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_OUT5_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_OUT5_STATUS_SHIFT)) & ITRC_STATUS_OUT5_STATUS_MASK) - -#define ITRC_STATUS_OUT6_STATUS_MASK (0x400000U) -#define ITRC_STATUS_OUT6_STATUS_SHIFT (22U) -/*! OUT6_STATUS - ITRC triggered TMPR_OUT1 internal signal connected to various on-chip multiplexers. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_OUT6_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_OUT6_STATUS_SHIFT)) & ITRC_STATUS_OUT6_STATUS_MASK) -/*! @} */ - -/*! @name STATUS1 - ITRC IN16 to IN47 Status */ -/*! @{ */ - -#define ITRC_STATUS1_IN16_STATUS_MASK (0x1U) -#define ITRC_STATUS1_IN16_STATUS_SHIFT (0U) -/*! IN16_STATUS - SSPC VDD_SYS_LVD detect event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN16_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN16_STATUS_SHIFT)) & ITRC_STATUS1_IN16_STATUS_MASK) - -#define ITRC_STATUS1_IN17_STATUS_MASK (0x2U) -#define ITRC_STATUS1_IN17_STATUS_SHIFT (1U) -/*! IN17_STATUS - SPC VDD_IO_LVD detect event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN17_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN17_STATUS_SHIFT)) & ITRC_STATUS1_IN17_STATUS_MASK) - -#define ITRC_STATUS1_IN18_STATUS_MASK (0x4U) -#define ITRC_STATUS1_IN18_STATUS_SHIFT (2U) -/*! IN18_STATUS - Reserved - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN18_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN18_STATUS_SHIFT)) & ITRC_STATUS1_IN18_STATUS_MASK) - -#define ITRC_STATUS1_IN19_STATUS_MASK (0x8U) -#define ITRC_STATUS1_IN19_STATUS_SHIFT (3U) -/*! IN19_STATUS - Reserved - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN19_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN19_STATUS_SHIFT)) & ITRC_STATUS1_IN19_STATUS_MASK) - -#define ITRC_STATUS1_IN20_STATUS_MASK (0x10U) -#define ITRC_STATUS1_IN20_STATUS_SHIFT (4U) -/*! IN20_STATUS - VDD_MAIN clock tamper output event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN20_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN20_STATUS_SHIFT)) & ITRC_STATUS1_IN20_STATUS_MASK) - -#define ITRC_STATUS1_IN24_21_STATUS_MASK (0x1E0U) -#define ITRC_STATUS1_IN24_21_STATUS_SHIFT (5U) -/*! IN24_21_STATUS - INTM interrupt monitor error 3~0 event occurred. - * 0b0000..Output not triggered. - * 0b0001..Output has been triggered. - */ -#define ITRC_STATUS1_IN24_21_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN24_21_STATUS_SHIFT)) & ITRC_STATUS1_IN24_21_STATUS_MASK) - -#define ITRC_STATUS1_IN32_25_STATUS_MASK (0x1FE00U) -#define ITRC_STATUS1_IN32_25_STATUS_SHIFT (9U) -/*! IN32_25_STATUS - MSF SOCTRIM 7~0 ECC error event occurred. - * 0b00000000..Output not triggered. - * 0b00000001..Output has been triggered. - */ -#define ITRC_STATUS1_IN32_25_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN32_25_STATUS_SHIFT)) & ITRC_STATUS1_IN32_25_STATUS_MASK) - -#define ITRC_STATUS1_IN33_STATUS_MASK (0x20000U) -#define ITRC_STATUS1_IN33_STATUS_SHIFT (17U) -/*! IN33_STATUS - GDET0/1 SFR error event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN33_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN33_STATUS_SHIFT)) & ITRC_STATUS1_IN33_STATUS_MASK) - -#define ITRC_STATUS1_IN34_STATUS_MASK (0x40000U) -#define ITRC_STATUS1_IN34_STATUS_SHIFT (18U) -/*! IN34_STATUS - SPC VDD_CORE high voltage detect event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN34_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN34_STATUS_SHIFT)) & ITRC_STATUS1_IN34_STATUS_MASK) - -#define ITRC_STATUS1_IN35_STATUS_MASK (0x80000U) -#define ITRC_STATUS1_IN35_STATUS_SHIFT (19U) -/*! IN35_STATUS - SPC VDD_SYS_HVD high voltage detect event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN35_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN35_STATUS_SHIFT)) & ITRC_STATUS1_IN35_STATUS_MASK) - -#define ITRC_STATUS1_IN36_STATUS_MASK (0x100000U) -#define ITRC_STATUS1_IN36_STATUS_SHIFT (20U) -/*! IN36_STATUS - SPC VDD_IO high voltage detect event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN36_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN36_STATUS_SHIFT)) & ITRC_STATUS1_IN36_STATUS_MASK) - -#define ITRC_STATUS1_IN37_STATUS_MASK (0x200000U) -#define ITRC_STATUS1_IN37_STATUS_SHIFT (21U) -/*! IN37_STATUS - FLEXSPI GCM error event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN37_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN37_STATUS_SHIFT)) & ITRC_STATUS1_IN37_STATUS_MASK) - -#define ITRC_STATUS1_IN46_STATUS_MASK (0x40000000U) -#define ITRC_STATUS1_IN46_STATUS_SHIFT (30U) -/*! IN46_STATUS - SM3 SGI error event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN46_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN46_STATUS_SHIFT)) & ITRC_STATUS1_IN46_STATUS_MASK) - -#define ITRC_STATUS1_IN47_STATUS_MASK (0x80000000U) -#define ITRC_STATUS1_IN47_STATUS_SHIFT (31U) -/*! IN47_STATUS - TRNG HW error event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN47_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN47_STATUS_SHIFT)) & ITRC_STATUS1_IN47_STATUS_MASK) -/*! @} */ - -/*! @name OUTX_SEL_OUTX_SELY_OUT_SEL - Trigger Source IN0 to IN15 selector */ -/*! @{ */ - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN0_SELn_MASK (0x3U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN0_SELn_SHIFT (0U) -/*! IN0_SELn - Selects digital glitch detector as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN0_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN0_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN0_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN1_SELn_MASK (0xCU) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN1_SELn_SHIFT (2U) -/*! IN1_SELn - Selects TDET event as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN1_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN1_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN1_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN2_SELn_MASK (0x30U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN2_SELn_SHIFT (4U) -/*! IN2_SELn - Selects Code Watchdog 0 event as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN2_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN2_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN2_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN3_SELn_MASK (0xC0U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN3_SELn_SHIFT (6U) -/*! IN3_SELn - Selects VDD_MAIN voltage tamper event as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN3_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN3_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN3_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN4_SELn_MASK (0x300U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN4_SELn_SHIFT (8U) -/*! IN4_SELn - Selects low-voltage event on VDD_CORE rail as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN4_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN4_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN4_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN5_SELn_MASK (0xC00U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN5_SELn_SHIFT (10U) -/*! IN5_SELn - Selects Watchdog 0 timer event as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN5_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN5_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN5_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN6_SELn_MASK (0x3000U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN6_SELn_SHIFT (12U) -/*! IN6_SELn - Selects Flash ECC mismatch event as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN6_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN6_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN6_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN7_SELn_MASK (0xC000U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN7_SELn_SHIFT (14U) -/*! IN7_SELn - Selects AHB secure bus or MBC bus illegal access event as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN7_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN7_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN7_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN8_SELn_MASK (0x30000U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN8_SELn_SHIFT (16U) -/*! IN8_SELn - Selects ELS error event as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN8_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN8_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN8_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN9_SELn_MASK (0xC0000U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN9_SELn_SHIFT (18U) -/*! IN9_SELn - Selects SPC VDD_CORE glitch detector as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN9_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN9_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN9_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN10_SELn_MASK (0x300000U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN10_SELn_SHIFT (20U) -/*! IN10_SELn - Selects PKC error event as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN10_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN10_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN10_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN11_SELn_MASK (0xC00000U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN11_SELn_SHIFT (22U) -/*! IN11_SELn - Selects Code Watchdog 1 event as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN11_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN11_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN11_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN12_SELn_MASK (0x3000000U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN12_SELn_SHIFT (24U) -/*! IN12_SELn - Selects Watchdog 1 timer event as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN12_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN12_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN12_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN13_SELn_MASK (0xC000000U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN13_SELn_SHIFT (26U) -/*! IN13_SELn - Selects FREQME out of range status output as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN13_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN13_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN13_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN14_SELn_MASK (0x30000000U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN14_SELn_SHIFT (28U) -/*! IN14_SELn - Selects software event 0 as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN14_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN14_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN14_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN15_SELn_MASK (0xC0000000U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN15_SELn_SHIFT (30U) -/*! IN15_SELn - Selects software event 1 as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN15_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN15_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN15_SELn_MASK) -/*! @} */ - -/* The count of ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_COUNT (7U) - -/* The count of ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_COUNT2 (2U) - -/*! @name OUTX_SEL_1_OUTX_SELY_OUT_SEL_1 - Trigger Source IN16 to IN31 selector */ -/*! @{ */ - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN16_SELn_MASK (0x3U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN16_SELn_SHIFT (0U) -/*! IN16_SELn - Selects SPC VDD_SYS_LVD detect as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN16_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN16_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN16_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN17_SELn_MASK (0xCU) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN17_SELn_SHIFT (2U) -/*! IN17_SELn - Selects SPC VDD_IO_LVD detect as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN17_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN17_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN17_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN18_SELn_MASK (0x30U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN18_SELn_SHIFT (4U) -/*! IN18_SELn - Reserved. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN18_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN18_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN18_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN19_SELn_MASK (0xC0U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN19_SELn_SHIFT (6U) -/*! IN19_SELn - Selects VDD_MAIN temperature tamper output event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN19_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN19_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN19_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN20_SELn_MASK (0x300U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN20_SELn_SHIFT (8U) -/*! IN20_SELn - Selects VDD_MAIN clock tamper output event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN20_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN20_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN20_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN21_SELn_MASK (0xC00U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN21_SELn_SHIFT (10U) -/*! IN21_SELn - Selects INTM interrupt monitor error 0 event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN21_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN21_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN21_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN22_SELn_MASK (0x3000U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN22_SELn_SHIFT (12U) -/*! IN22_SELn - Selects INTM interrupt monitor error 1 event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN22_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN22_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN22_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN23_SELn_MASK (0xC000U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN23_SELn_SHIFT (14U) -/*! IN23_SELn - Selects INTM interrupt monitor error 2 event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN23_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN23_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN23_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN24_SELn_MASK (0x30000U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN24_SELn_SHIFT (16U) -/*! IN24_SELn - Selects INTM interrupt monitor error 3 event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN24_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN24_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN24_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN25_SELn_MASK (0xC0000U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN25_SELn_SHIFT (18U) -/*! IN25_SELn - Selects MSF SOCTRIM 0 ECC error event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN25_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN25_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN25_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN26_SELn_MASK (0x300000U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN26_SELn_SHIFT (20U) -/*! IN26_SELn - Selects MSF SOCTRIM 1 ECC error event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN26_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN26_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN26_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN27_SELn_MASK (0xC00000U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN27_SELn_SHIFT (22U) -/*! IN27_SELn - Selects MSF SOCTRIM 2 ECC error event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN27_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN27_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN27_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN28_SELn_MASK (0x3000000U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN28_SELn_SHIFT (24U) -/*! IN28_SELn - Selects MSF SOCTRIM 3 ECC error event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN28_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN28_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN28_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN29_SELn_MASK (0xC000000U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN29_SELn_SHIFT (26U) -/*! IN29_SELn - Selects MSF SOCTRIM 4 ECC error event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN29_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN29_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN29_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN30_SELn_MASK (0x30000000U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN30_SELn_SHIFT (28U) -/*! IN30_SELn - Selects MSF SOCTRIM 5 ECC error event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN30_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN30_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN30_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN31_SELn_MASK (0xC0000000U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN31_SELn_SHIFT (30U) -/*! IN31_SELn - Selects MSF SOCTRIM 6 ECC error event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN31_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN31_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN31_SELn_MASK) -/*! @} */ - -/* The count of ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1 */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_COUNT (7U) - -/* The count of ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1 */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_COUNT2 (2U) - -/*! @name OUTX_SEL_2_OUTX_SELY_OUT_SEL_2 - Trigger source IN32 to IN47 selector */ -/*! @{ */ - -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN32_SELn_MASK (0x3U) -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN32_SELn_SHIFT (0U) -/*! IN32_SELn - Selects MSF SOCTRIM 7 ECC error event as a trigger source. */ -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN32_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN32_SELn_SHIFT)) & ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN32_SELn_MASK) - -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN33_SELn_MASK (0xCU) -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN33_SELn_SHIFT (2U) -/*! IN33_SELn - Selects GDET0 & 1 SFR error detect as a trigger source. */ -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN33_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN33_SELn_SHIFT)) & ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN33_SELn_MASK) - -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN34_SELn_MASK (0x30U) -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN34_SELn_SHIFT (4U) -/*! IN34_SELn - Selects SPC VDD_CORE_HVD as a trigger source. */ -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN34_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN34_SELn_SHIFT)) & ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN34_SELn_MASK) - -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN35_SELn_MASK (0xC0U) -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN35_SELn_SHIFT (6U) -/*! IN35_SELn - Selects VDD_SYS_HVD as a trigger source. */ -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN35_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN35_SELn_SHIFT)) & ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN35_SELn_MASK) - -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN36_SELn_MASK (0x300U) -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN36_SELn_SHIFT (8U) -/*! IN36_SELn - Selects VDD_IO_HVD as a trigger source. */ -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN36_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN36_SELn_SHIFT)) & ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN36_SELn_MASK) - -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN37_SELn_MASK (0xC00U) -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN37_SELn_SHIFT (10U) -/*! IN37_SELn - Selects FLEXSPI GCM error as a trigger source. */ -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN37_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN37_SELn_SHIFT)) & ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN37_SELn_MASK) - -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN46_SELn_MASK (0x30000000U) -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN46_SELn_SHIFT (28U) -/*! IN46_SELn - Selects SM3 SGI error as a trigger source. */ -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN46_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN46_SELn_SHIFT)) & ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN46_SELn_MASK) - -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN47_SELn_MASK (0xC0000000U) -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN47_SELn_SHIFT (30U) -/*! IN47_SELn - Selects TRNG HW Error as a trigger source. */ -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN47_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN47_SELn_SHIFT)) & ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN47_SELn_MASK) -/*! @} */ - -/* The count of ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2 */ -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_COUNT (7U) - -/* The count of ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2 */ -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_COUNT2 (2U) - -/*! @name SW_EVENT0 - Software event 0 */ -/*! @{ */ - -#define ITRC_SW_EVENT0_TRIGGER_SW_EVENT_0_MASK (0xFFFFFFFFU) -#define ITRC_SW_EVENT0_TRIGGER_SW_EVENT_0_SHIFT (0U) -/*! TRIGGER_SW_EVENT_0 - Trigger software event 0. */ -#define ITRC_SW_EVENT0_TRIGGER_SW_EVENT_0(x) (((uint32_t)(((uint32_t)(x)) << ITRC_SW_EVENT0_TRIGGER_SW_EVENT_0_SHIFT)) & ITRC_SW_EVENT0_TRIGGER_SW_EVENT_0_MASK) -/*! @} */ - -/*! @name SW_EVENT1 - Software event 1 */ -/*! @{ */ - -#define ITRC_SW_EVENT1_TRIGGER_SW_EVENT_1_MASK (0xFFFFFFFFU) -#define ITRC_SW_EVENT1_TRIGGER_SW_EVENT_1_SHIFT (0U) -/*! TRIGGER_SW_EVENT_1 - Trigger software event 1. */ -#define ITRC_SW_EVENT1_TRIGGER_SW_EVENT_1(x) (((uint32_t)(((uint32_t)(x)) << ITRC_SW_EVENT1_TRIGGER_SW_EVENT_1_SHIFT)) & ITRC_SW_EVENT1_TRIGGER_SW_EVENT_1_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group ITRC_Register_Masks */ - - -/* ITRC - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral ITRC0 base address */ - #define ITRC0_BASE (0x50026000u) - /** Peripheral ITRC0 base address */ - #define ITRC0_BASE_NS (0x40026000u) - /** Peripheral ITRC0 base pointer */ - #define ITRC0 ((ITRC_Type *)ITRC0_BASE) - /** Peripheral ITRC0 base pointer */ - #define ITRC0_NS ((ITRC_Type *)ITRC0_BASE_NS) - /** Array initializer of ITRC peripheral base addresses */ - #define ITRC_BASE_ADDRS { ITRC0_BASE } - /** Array initializer of ITRC peripheral base pointers */ - #define ITRC_BASE_PTRS { ITRC0 } - /** Array initializer of ITRC peripheral base addresses */ - #define ITRC_BASE_ADDRS_NS { ITRC0_BASE_NS } - /** Array initializer of ITRC peripheral base pointers */ - #define ITRC_BASE_PTRS_NS { ITRC0_NS } -#else - /** Peripheral ITRC0 base address */ - #define ITRC0_BASE (0x40026000u) - /** Peripheral ITRC0 base pointer */ - #define ITRC0 ((ITRC_Type *)ITRC0_BASE) - /** Array initializer of ITRC peripheral base addresses */ - #define ITRC_BASE_ADDRS { ITRC0_BASE } - /** Array initializer of ITRC peripheral base pointers */ - #define ITRC_BASE_PTRS { ITRC0 } -#endif - -/*! - * @} - */ /* end of group ITRC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LPCMP Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPCMP_Peripheral_Access_Layer LPCMP Peripheral Access Layer - * @{ - */ - -/** LPCMP - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - __IO uint32_t CCR0; /**< Comparator Control Register 0, offset: 0x8 */ - __IO uint32_t CCR1; /**< Comparator Control Register 1, offset: 0xC */ - __IO uint32_t CCR2; /**< Comparator Control Register 2, offset: 0x10 */ - uint8_t RESERVED_0[4]; - __IO uint32_t DCR; /**< DAC Control, offset: 0x18 */ - __IO uint32_t IER; /**< Interrupt Enable, offset: 0x1C */ - __IO uint32_t CSR; /**< Comparator Status, offset: 0x20 */ - __IO uint32_t RRCR0; /**< Round Robin Control Register 0, offset: 0x24 */ - __IO uint32_t RRCR1; /**< Round Robin Control Register 1, offset: 0x28 */ - __IO uint32_t RRCSR; /**< Round Robin Control and Status, offset: 0x2C */ - __IO uint32_t RRSR; /**< Round Robin Status, offset: 0x30 */ - uint8_t RESERVED_1[4]; - __IO uint32_t RRCR2; /**< Round Robin Control Register 2, offset: 0x38 */ -} LPCMP_Type; - -/* ---------------------------------------------------------------------------- - -- LPCMP Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPCMP_Register_Masks LPCMP Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define LPCMP_VERID_FEATURE_MASK (0xFFFFU) -#define LPCMP_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000001..Round robin feature - */ -#define LPCMP_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_VERID_FEATURE_SHIFT)) & LPCMP_VERID_FEATURE_MASK) - -#define LPCMP_VERID_MINOR_MASK (0xFF0000U) -#define LPCMP_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define LPCMP_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_VERID_MINOR_SHIFT)) & LPCMP_VERID_MINOR_MASK) - -#define LPCMP_VERID_MAJOR_MASK (0xFF000000U) -#define LPCMP_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define LPCMP_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_VERID_MAJOR_SHIFT)) & LPCMP_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define LPCMP_PARAM_DAC_RES_MASK (0xFU) -#define LPCMP_PARAM_DAC_RES_SHIFT (0U) -/*! DAC_RES - DAC Resolution - * 0b0000..4-bit DAC - * 0b0001..6-bit DAC - * 0b0010..8-bit DAC - * 0b0011..10-bit DAC - * 0b0100..12-bit DAC - * 0b0101..14-bit DAC - * 0b0110..16-bit DAC - */ -#define LPCMP_PARAM_DAC_RES(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_PARAM_DAC_RES_SHIFT)) & LPCMP_PARAM_DAC_RES_MASK) -/*! @} */ - -/*! @name CCR0 - Comparator Control Register 0 */ -/*! @{ */ - -#define LPCMP_CCR0_CMP_EN_MASK (0x1U) -#define LPCMP_CCR0_CMP_EN_SHIFT (0U) -/*! CMP_EN - Comparator Enable - * 0b0..Disable (The analog logic remains off and consumes no power.) - * 0b1..Enable - */ -#define LPCMP_CCR0_CMP_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR0_CMP_EN_SHIFT)) & LPCMP_CCR0_CMP_EN_MASK) -/*! @} */ - -/*! @name CCR1 - Comparator Control Register 1 */ -/*! @{ */ - -#define LPCMP_CCR1_WINDOW_EN_MASK (0x1U) -#define LPCMP_CCR1_WINDOW_EN_SHIFT (0U) -/*! WINDOW_EN - Windowing Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPCMP_CCR1_WINDOW_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_WINDOW_EN_SHIFT)) & LPCMP_CCR1_WINDOW_EN_MASK) - -#define LPCMP_CCR1_SAMPLE_EN_MASK (0x2U) -#define LPCMP_CCR1_SAMPLE_EN_SHIFT (1U) -/*! SAMPLE_EN - Sampling Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPCMP_CCR1_SAMPLE_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_SAMPLE_EN_SHIFT)) & LPCMP_CCR1_SAMPLE_EN_MASK) - -#define LPCMP_CCR1_DMA_EN_MASK (0x4U) -#define LPCMP_CCR1_DMA_EN_SHIFT (2U) -/*! DMA_EN - DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPCMP_CCR1_DMA_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_DMA_EN_SHIFT)) & LPCMP_CCR1_DMA_EN_MASK) - -#define LPCMP_CCR1_COUT_INV_MASK (0x8U) -#define LPCMP_CCR1_COUT_INV_SHIFT (3U) -/*! COUT_INV - Comparator Invert - * 0b0..Do not invert - * 0b1..Invert - */ -#define LPCMP_CCR1_COUT_INV(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_COUT_INV_SHIFT)) & LPCMP_CCR1_COUT_INV_MASK) - -#define LPCMP_CCR1_COUT_SEL_MASK (0x10U) -#define LPCMP_CCR1_COUT_SEL_SHIFT (4U) -/*! COUT_SEL - Comparator Output Select - * 0b0..Use COUT (filtered) - * 0b1..Use COUTA (unfiltered) - */ -#define LPCMP_CCR1_COUT_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_COUT_SEL_SHIFT)) & LPCMP_CCR1_COUT_SEL_MASK) - -#define LPCMP_CCR1_COUT_PEN_MASK (0x20U) -#define LPCMP_CCR1_COUT_PEN_SHIFT (5U) -/*! COUT_PEN - Comparator Output Pin Enable - * 0b0..Not available - * 0b1..Available - */ -#define LPCMP_CCR1_COUT_PEN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_COUT_PEN_SHIFT)) & LPCMP_CCR1_COUT_PEN_MASK) - -#define LPCMP_CCR1_COUTA_OWEN_MASK (0x40U) -#define LPCMP_CCR1_COUTA_OWEN_SHIFT (6U) -/*! COUTA_OWEN - COUTA_OW Enable - * 0b0..COUTA holds the last sampled value. - * 0b1..Enables the COUTA signal value to be defined by COUTA_OW. - */ -#define LPCMP_CCR1_COUTA_OWEN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_COUTA_OWEN_SHIFT)) & LPCMP_CCR1_COUTA_OWEN_MASK) - -#define LPCMP_CCR1_COUTA_OW_MASK (0x80U) -#define LPCMP_CCR1_COUTA_OW_SHIFT (7U) -/*! COUTA_OW - COUTA Output Level for Closed Window - * 0b0..COUTA is 0 - * 0b1..COUTA is 1 - */ -#define LPCMP_CCR1_COUTA_OW(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_COUTA_OW_SHIFT)) & LPCMP_CCR1_COUTA_OW_MASK) - -#define LPCMP_CCR1_WINDOW_INV_MASK (0x100U) -#define LPCMP_CCR1_WINDOW_INV_SHIFT (8U) -/*! WINDOW_INV - WINDOW/SAMPLE Signal Invert - * 0b0..Do not invert - * 0b1..Invert - */ -#define LPCMP_CCR1_WINDOW_INV(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_WINDOW_INV_SHIFT)) & LPCMP_CCR1_WINDOW_INV_MASK) - -#define LPCMP_CCR1_WINDOW_CLS_MASK (0x200U) -#define LPCMP_CCR1_WINDOW_CLS_SHIFT (9U) -/*! WINDOW_CLS - COUT Event Window Close - * 0b0..COUT event cannot close the window - * 0b1..COUT event can close the window - */ -#define LPCMP_CCR1_WINDOW_CLS(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_WINDOW_CLS_SHIFT)) & LPCMP_CCR1_WINDOW_CLS_MASK) - -#define LPCMP_CCR1_EVT_SEL_MASK (0xC00U) -#define LPCMP_CCR1_EVT_SEL_SHIFT (10U) -/*! EVT_SEL - COUT Event Select - * 0b00..Rising edge - * 0b01..Falling edge - * 0b1x..Both edges - */ -#define LPCMP_CCR1_EVT_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_EVT_SEL_SHIFT)) & LPCMP_CCR1_EVT_SEL_MASK) - -#define LPCMP_CCR1_FUNC_CLK_SEL_MASK (0x3000U) -#define LPCMP_CCR1_FUNC_CLK_SEL_SHIFT (12U) -/*! FUNC_CLK_SEL - Functional Clock Source Select - * 0b00..Select functional clock source 0 - * 0b01..Select functional clock source 1 - * 0b10..Select functional clock source 2 - * 0b11..Select functional clock source 3 - */ -#define LPCMP_CCR1_FUNC_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_FUNC_CLK_SEL_SHIFT)) & LPCMP_CCR1_FUNC_CLK_SEL_MASK) - -#define LPCMP_CCR1_FILT_CNT_MASK (0x70000U) -#define LPCMP_CCR1_FILT_CNT_SHIFT (16U) -/*! FILT_CNT - Filter Sample Count - * 0b000..Filter is bypassed: COUT = COUTA - * 0b001..1 consecutive sample (Comparator output is simply sampled.) - * 0b010..2 consecutive samples - * 0b011..3 consecutive samples - * 0b100..4 consecutive samples - * 0b101..5 consecutive samples - * 0b110..6 consecutive samples - * 0b111..7 consecutive samples - */ -#define LPCMP_CCR1_FILT_CNT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_FILT_CNT_SHIFT)) & LPCMP_CCR1_FILT_CNT_MASK) - -#define LPCMP_CCR1_FILT_PER_MASK (0xFF000000U) -#define LPCMP_CCR1_FILT_PER_SHIFT (24U) -/*! FILT_PER - Filter Sample Period */ -#define LPCMP_CCR1_FILT_PER(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_FILT_PER_SHIFT)) & LPCMP_CCR1_FILT_PER_MASK) -/*! @} */ - -/*! @name CCR2 - Comparator Control Register 2 */ -/*! @{ */ - -#define LPCMP_CCR2_CMP_HPMD_MASK (0x1U) -#define LPCMP_CCR2_CMP_HPMD_SHIFT (0U) -/*! CMP_HPMD - CMP High Power Mode Select - * 0b0..Low power (speed) comparison mode - * 0b1..High power (speed) comparison mode - */ -#define LPCMP_CCR2_CMP_HPMD(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR2_CMP_HPMD_SHIFT)) & LPCMP_CCR2_CMP_HPMD_MASK) - -#define LPCMP_CCR2_CMP_NPMD_MASK (0x2U) -#define LPCMP_CCR2_CMP_NPMD_SHIFT (1U) -/*! CMP_NPMD - CMP Nano Power Mode Select - * 0b0..Disables CMP Nano power mode. CCR2[CMP_HPMD] determines the mode for the comparator. - * 0b1..Enables CMP Nano power mode. - */ -#define LPCMP_CCR2_CMP_NPMD(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR2_CMP_NPMD_SHIFT)) & LPCMP_CCR2_CMP_NPMD_MASK) - -#define LPCMP_CCR2_HYSTCTR_MASK (0x30U) -#define LPCMP_CCR2_HYSTCTR_SHIFT (4U) -/*! HYSTCTR - Comparator Hysteresis Control - * 0b00..Level 0: Analog comparator hysteresis 0 mV. - * 0b01..Level 1: Analog comparator hysteresis 10 mV. - * 0b10..Level 2: Analog comparator hysteresis 20 mV. - * 0b11..Level 3: Analog comparator hysteresis 30 mV. - */ -#define LPCMP_CCR2_HYSTCTR(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR2_HYSTCTR_SHIFT)) & LPCMP_CCR2_HYSTCTR_MASK) - -#define LPCMP_CCR2_PSEL_MASK (0x70000U) -#define LPCMP_CCR2_PSEL_SHIFT (16U) -/*! PSEL - Plus Input MUX Select - * 0b000..Input 0p - * 0b001..Input 1p - * 0b010..Input 2p - * 0b011..Input 3p - * 0b100..Input 4p - * 0b101..Input 5p - * 0b110..Reserved - * 0b111..Internal DAC output - */ -#define LPCMP_CCR2_PSEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR2_PSEL_SHIFT)) & LPCMP_CCR2_PSEL_MASK) - -#define LPCMP_CCR2_MSEL_MASK (0x700000U) -#define LPCMP_CCR2_MSEL_SHIFT (20U) -/*! MSEL - Minus Input MUX Select - * 0b000..Input 0m - * 0b001..Input 1m - * 0b010..Input 2m - * 0b011..Input 3m - * 0b100..Input 4m - * 0b101..Input 5m - * 0b110..Reserved - * 0b111..Internal DAC output - */ -#define LPCMP_CCR2_MSEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR2_MSEL_SHIFT)) & LPCMP_CCR2_MSEL_MASK) -/*! @} */ - -/*! @name DCR - DAC Control */ -/*! @{ */ - -#define LPCMP_DCR_DAC_EN_MASK (0x1U) -#define LPCMP_DCR_DAC_EN_SHIFT (0U) -/*! DAC_EN - DAC Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPCMP_DCR_DAC_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_DCR_DAC_EN_SHIFT)) & LPCMP_DCR_DAC_EN_MASK) - -#define LPCMP_DCR_DAC_HPMD_MASK (0x2U) -#define LPCMP_DCR_DAC_HPMD_SHIFT (1U) -/*! DAC_HPMD - DAC High Power Mode - * 0b0..Disable - * 0b1..Enable - */ -#define LPCMP_DCR_DAC_HPMD(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_DCR_DAC_HPMD_SHIFT)) & LPCMP_DCR_DAC_HPMD_MASK) - -#define LPCMP_DCR_VRSEL_MASK (0x100U) -#define LPCMP_DCR_VRSEL_SHIFT (8U) -/*! VRSEL - DAC Reference High Voltage Source Select - * 0b0..VREFH0 - * 0b1..VREFH1 - */ -#define LPCMP_DCR_VRSEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_DCR_VRSEL_SHIFT)) & LPCMP_DCR_VRSEL_MASK) - -#define LPCMP_DCR_DAC_DATA_MASK (0xFF0000U) -#define LPCMP_DCR_DAC_DATA_SHIFT (16U) -/*! DAC_DATA - DAC Output Voltage Select */ -#define LPCMP_DCR_DAC_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_DCR_DAC_DATA_SHIFT)) & LPCMP_DCR_DAC_DATA_MASK) -/*! @} */ - -/*! @name IER - Interrupt Enable */ -/*! @{ */ - -#define LPCMP_IER_CFR_IE_MASK (0x1U) -#define LPCMP_IER_CFR_IE_SHIFT (0U) -/*! CFR_IE - Comparator Flag Rising Interrupt Enable - * 0b0..Disables the comparator flag rising interrupt. - * 0b1..Enables the comparator flag rising interrupt when CFR is set. - */ -#define LPCMP_IER_CFR_IE(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_IER_CFR_IE_SHIFT)) & LPCMP_IER_CFR_IE_MASK) - -#define LPCMP_IER_CFF_IE_MASK (0x2U) -#define LPCMP_IER_CFF_IE_SHIFT (1U) -/*! CFF_IE - Comparator Flag Falling Interrupt Enable - * 0b0..Disables the comparator flag falling interrupt. - * 0b1..Enables the comparator flag falling interrupt when CFF is set. - */ -#define LPCMP_IER_CFF_IE(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_IER_CFF_IE_SHIFT)) & LPCMP_IER_CFF_IE_MASK) - -#define LPCMP_IER_RRF_IE_MASK (0x4U) -#define LPCMP_IER_RRF_IE_SHIFT (2U) -/*! RRF_IE - Round-Robin Flag Interrupt Enable - * 0b0..Disables the round-robin flag interrupt. - * 0b1..Enables the round-robin flag interrupt when the comparison result changes for a given channel. - */ -#define LPCMP_IER_RRF_IE(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_IER_RRF_IE_SHIFT)) & LPCMP_IER_RRF_IE_MASK) -/*! @} */ - -/*! @name CSR - Comparator Status */ -/*! @{ */ - -#define LPCMP_CSR_CFR_MASK (0x1U) -#define LPCMP_CSR_CFR_SHIFT (0U) -/*! CFR - Analog Comparator Flag Rising - * 0b0..Not detected - * 0b1..Detected - */ -#define LPCMP_CSR_CFR(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CSR_CFR_SHIFT)) & LPCMP_CSR_CFR_MASK) - -#define LPCMP_CSR_CFF_MASK (0x2U) -#define LPCMP_CSR_CFF_SHIFT (1U) -/*! CFF - Analog Comparator Flag Falling - * 0b0..Not detected - * 0b1..Detected - */ -#define LPCMP_CSR_CFF(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CSR_CFF_SHIFT)) & LPCMP_CSR_CFF_MASK) - -#define LPCMP_CSR_RRF_MASK (0x4U) -#define LPCMP_CSR_RRF_SHIFT (2U) -/*! RRF - Round-Robin Flag - * 0b0..Not detected - * 0b1..Detected - */ -#define LPCMP_CSR_RRF(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CSR_RRF_SHIFT)) & LPCMP_CSR_RRF_MASK) - -#define LPCMP_CSR_COUT_MASK (0x100U) -#define LPCMP_CSR_COUT_SHIFT (8U) -/*! COUT - Analog Comparator Output */ -#define LPCMP_CSR_COUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CSR_COUT_SHIFT)) & LPCMP_CSR_COUT_MASK) -/*! @} */ - -/*! @name RRCR0 - Round Robin Control Register 0 */ -/*! @{ */ - -#define LPCMP_RRCR0_RR_EN_MASK (0x1U) -#define LPCMP_RRCR0_RR_EN_SHIFT (0U) -/*! RR_EN - Round-Robin Enable - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR0_RR_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_EN_SHIFT)) & LPCMP_RRCR0_RR_EN_MASK) - -#define LPCMP_RRCR0_RR_TRG_SEL_MASK (0x2U) -#define LPCMP_RRCR0_RR_TRG_SEL_SHIFT (1U) -/*! RR_TRG_SEL - Round-Robin Trigger Select - * 0b0..External trigger - * 0b1..Internal trigger - */ -#define LPCMP_RRCR0_RR_TRG_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_TRG_SEL_SHIFT)) & LPCMP_RRCR0_RR_TRG_SEL_MASK) - -#define LPCMP_RRCR0_RR_NSAM_MASK (0x300U) -#define LPCMP_RRCR0_RR_NSAM_SHIFT (8U) -/*! RR_NSAM - Number of Sample Clocks - * 0b00..0 clock - * 0b01..1 clock - * 0b10..2 clocks - * 0b11..3 clocks - */ -#define LPCMP_RRCR0_RR_NSAM(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_NSAM_SHIFT)) & LPCMP_RRCR0_RR_NSAM_MASK) - -#define LPCMP_RRCR0_RR_CLK_SEL_MASK (0x3000U) -#define LPCMP_RRCR0_RR_CLK_SEL_SHIFT (12U) -/*! RR_CLK_SEL - Round Robin Clock Source Select - * 0b00..Select Round Robin clock Source 0 - * 0b01..Select Round Robin clock Source 1 - * 0b10..Select Round Robin clock Source 2 - * 0b11..Select Round Robin clock Source 3 - */ -#define LPCMP_RRCR0_RR_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_CLK_SEL_SHIFT)) & LPCMP_RRCR0_RR_CLK_SEL_MASK) - -#define LPCMP_RRCR0_RR_INITMOD_MASK (0x3F0000U) -#define LPCMP_RRCR0_RR_INITMOD_SHIFT (16U) -/*! RR_INITMOD - Initialization Delay Modulus - * 0b000000..63 cycles (same as 111111b) - * 0b000001-0b111111..1 to 63 cycles - */ -#define LPCMP_RRCR0_RR_INITMOD(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_INITMOD_SHIFT)) & LPCMP_RRCR0_RR_INITMOD_MASK) - -#define LPCMP_RRCR0_RR_SAMPLE_CNT_MASK (0xF000000U) -#define LPCMP_RRCR0_RR_SAMPLE_CNT_SHIFT (24U) -/*! RR_SAMPLE_CNT - Number of Sample for One Channel - * 0b0000..1 samples - * 0b0001..2 samples - * 0b0010..3 samples - * 0b0011..4 samples - * 0b0100..5 samples - * 0b0101..6 samples - * 0b0110..7 samples - * 0b0111..8 samples - * 0b1000..9 samples - * 0b1001..10 samples - * 0b1010..11 samples - * 0b1011..12 samples - * 0b1100..13 samples - * 0b1101..14 samples - * 0b1110..15 samples - * 0b1111..16 samples - */ -#define LPCMP_RRCR0_RR_SAMPLE_CNT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_SAMPLE_CNT_SHIFT)) & LPCMP_RRCR0_RR_SAMPLE_CNT_MASK) - -#define LPCMP_RRCR0_RR_SAMPLE_THRESHOLD_MASK (0xF0000000U) -#define LPCMP_RRCR0_RR_SAMPLE_THRESHOLD_SHIFT (28U) -/*! RR_SAMPLE_THRESHOLD - Sample Time Threshold - * 0b0000..At least 1 sampled "1", the final result is "1" - * 0b0001..At least 2 sampled "1", the final result is "1" - * 0b0010..At least 3 sampled "1", the final result is "1" - * 0b0011..At least 4 sampled "1", the final result is "1" - * 0b0100..At least 5 sampled "1", the final result is "1" - * 0b0101..At least 6 sampled "1", the final result is "1" - * 0b0110..At least 7 sampled "1", the final result is "1" - * 0b0111..At least 8 sampled "1", the final result is "1" - * 0b1000..At least 9 sampled "1", the final result is "1" - * 0b1001..At least 10 sampled "1", the final result is "1" - * 0b1010..At least 11 sampled "1", the final result is "1" - * 0b1011..At least 12 sampled "1", the final result is "1" - * 0b1100..At least 13 sampled "1", the final result is "1" - * 0b1101..At least 14 sampled "1", the final result is "1" - * 0b1110..At least 15 sampled "1", the final result is "1" - * 0b1111..At least 16 sampled "1", the final result is "1" - */ -#define LPCMP_RRCR0_RR_SAMPLE_THRESHOLD(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_SAMPLE_THRESHOLD_SHIFT)) & LPCMP_RRCR0_RR_SAMPLE_THRESHOLD_MASK) -/*! @} */ - -/*! @name RRCR1 - Round Robin Control Register 1 */ -/*! @{ */ - -#define LPCMP_RRCR1_RR_CH0EN_MASK (0x1U) -#define LPCMP_RRCR1_RR_CH0EN_SHIFT (0U) -/*! RR_CH0EN - Channel 0 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH0EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH0EN_SHIFT)) & LPCMP_RRCR1_RR_CH0EN_MASK) - -#define LPCMP_RRCR1_RR_CH1EN_MASK (0x2U) -#define LPCMP_RRCR1_RR_CH1EN_SHIFT (1U) -/*! RR_CH1EN - Channel 1 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH1EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH1EN_SHIFT)) & LPCMP_RRCR1_RR_CH1EN_MASK) - -#define LPCMP_RRCR1_RR_CH2EN_MASK (0x4U) -#define LPCMP_RRCR1_RR_CH2EN_SHIFT (2U) -/*! RR_CH2EN - Channel 2 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH2EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH2EN_SHIFT)) & LPCMP_RRCR1_RR_CH2EN_MASK) - -#define LPCMP_RRCR1_RR_CH3EN_MASK (0x8U) -#define LPCMP_RRCR1_RR_CH3EN_SHIFT (3U) -/*! RR_CH3EN - Channel 3 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH3EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH3EN_SHIFT)) & LPCMP_RRCR1_RR_CH3EN_MASK) - -#define LPCMP_RRCR1_RR_CH4EN_MASK (0x10U) -#define LPCMP_RRCR1_RR_CH4EN_SHIFT (4U) -/*! RR_CH4EN - Channel 4 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH4EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH4EN_SHIFT)) & LPCMP_RRCR1_RR_CH4EN_MASK) - -#define LPCMP_RRCR1_RR_CH5EN_MASK (0x20U) -#define LPCMP_RRCR1_RR_CH5EN_SHIFT (5U) -/*! RR_CH5EN - Channel 5 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH5EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH5EN_SHIFT)) & LPCMP_RRCR1_RR_CH5EN_MASK) - -#define LPCMP_RRCR1_RR_CH6EN_MASK (0x40U) -#define LPCMP_RRCR1_RR_CH6EN_SHIFT (6U) -/*! RR_CH6EN - Channel 6 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH6EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH6EN_SHIFT)) & LPCMP_RRCR1_RR_CH6EN_MASK) - -#define LPCMP_RRCR1_RR_CH7EN_MASK (0x80U) -#define LPCMP_RRCR1_RR_CH7EN_SHIFT (7U) -/*! RR_CH7EN - Channel 7 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH7EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH7EN_SHIFT)) & LPCMP_RRCR1_RR_CH7EN_MASK) - -#define LPCMP_RRCR1_FIXP_MASK (0x10000U) -#define LPCMP_RRCR1_FIXP_SHIFT (16U) -/*! FIXP - Fixed Port - * 0b0..Fix the plus port. Sweep only the inputs to the minus port. - * 0b1..Fix the minus port. Sweep only the inputs to the plus port. - */ -#define LPCMP_RRCR1_FIXP(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_FIXP_SHIFT)) & LPCMP_RRCR1_FIXP_MASK) - -#define LPCMP_RRCR1_FIXCH_MASK (0x700000U) -#define LPCMP_RRCR1_FIXCH_SHIFT (20U) -/*! FIXCH - Fixed Channel Select - * 0b000..Channel 0 - * 0b001..Channel 1 - * 0b010..Channel 2 - * 0b011..Channel 3 - * 0b100..Channel 4 - * 0b101..Channel 5 - * 0b110..Channel 6 - * 0b111..Channel 7 - */ -#define LPCMP_RRCR1_FIXCH(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_FIXCH_SHIFT)) & LPCMP_RRCR1_FIXCH_MASK) -/*! @} */ - -/*! @name RRCSR - Round Robin Control and Status */ -/*! @{ */ - -#define LPCMP_RRCSR_RR_CH0OUT_MASK (0x1U) -#define LPCMP_RRCSR_RR_CH0OUT_SHIFT (0U) -/*! RR_CH0OUT - Comparison Result for Channel 0 */ -#define LPCMP_RRCSR_RR_CH0OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH0OUT_SHIFT)) & LPCMP_RRCSR_RR_CH0OUT_MASK) - -#define LPCMP_RRCSR_RR_CH1OUT_MASK (0x2U) -#define LPCMP_RRCSR_RR_CH1OUT_SHIFT (1U) -/*! RR_CH1OUT - Comparison Result for Channel 1 */ -#define LPCMP_RRCSR_RR_CH1OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH1OUT_SHIFT)) & LPCMP_RRCSR_RR_CH1OUT_MASK) - -#define LPCMP_RRCSR_RR_CH2OUT_MASK (0x4U) -#define LPCMP_RRCSR_RR_CH2OUT_SHIFT (2U) -/*! RR_CH2OUT - Comparison Result for Channel 2 */ -#define LPCMP_RRCSR_RR_CH2OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH2OUT_SHIFT)) & LPCMP_RRCSR_RR_CH2OUT_MASK) - -#define LPCMP_RRCSR_RR_CH3OUT_MASK (0x8U) -#define LPCMP_RRCSR_RR_CH3OUT_SHIFT (3U) -/*! RR_CH3OUT - Comparison Result for Channel 3 */ -#define LPCMP_RRCSR_RR_CH3OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH3OUT_SHIFT)) & LPCMP_RRCSR_RR_CH3OUT_MASK) - -#define LPCMP_RRCSR_RR_CH4OUT_MASK (0x10U) -#define LPCMP_RRCSR_RR_CH4OUT_SHIFT (4U) -/*! RR_CH4OUT - Comparison Result for Channel 4 */ -#define LPCMP_RRCSR_RR_CH4OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH4OUT_SHIFT)) & LPCMP_RRCSR_RR_CH4OUT_MASK) - -#define LPCMP_RRCSR_RR_CH5OUT_MASK (0x20U) -#define LPCMP_RRCSR_RR_CH5OUT_SHIFT (5U) -/*! RR_CH5OUT - Comparison Result for Channel 5 */ -#define LPCMP_RRCSR_RR_CH5OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH5OUT_SHIFT)) & LPCMP_RRCSR_RR_CH5OUT_MASK) - -#define LPCMP_RRCSR_RR_CH6OUT_MASK (0x40U) -#define LPCMP_RRCSR_RR_CH6OUT_SHIFT (6U) -/*! RR_CH6OUT - Comparison Result for Channel 6 */ -#define LPCMP_RRCSR_RR_CH6OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH6OUT_SHIFT)) & LPCMP_RRCSR_RR_CH6OUT_MASK) - -#define LPCMP_RRCSR_RR_CH7OUT_MASK (0x80U) -#define LPCMP_RRCSR_RR_CH7OUT_SHIFT (7U) -/*! RR_CH7OUT - Comparison Result for Channel 7 */ -#define LPCMP_RRCSR_RR_CH7OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH7OUT_SHIFT)) & LPCMP_RRCSR_RR_CH7OUT_MASK) -/*! @} */ - -/*! @name RRSR - Round Robin Status */ -/*! @{ */ - -#define LPCMP_RRSR_RR_CH0F_MASK (0x1U) -#define LPCMP_RRSR_RR_CH0F_SHIFT (0U) -/*! RR_CH0F - Channel 0 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH0F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH0F_SHIFT)) & LPCMP_RRSR_RR_CH0F_MASK) - -#define LPCMP_RRSR_RR_CH1F_MASK (0x2U) -#define LPCMP_RRSR_RR_CH1F_SHIFT (1U) -/*! RR_CH1F - Channel 1 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH1F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH1F_SHIFT)) & LPCMP_RRSR_RR_CH1F_MASK) - -#define LPCMP_RRSR_RR_CH2F_MASK (0x4U) -#define LPCMP_RRSR_RR_CH2F_SHIFT (2U) -/*! RR_CH2F - Channel 2 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH2F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH2F_SHIFT)) & LPCMP_RRSR_RR_CH2F_MASK) - -#define LPCMP_RRSR_RR_CH3F_MASK (0x8U) -#define LPCMP_RRSR_RR_CH3F_SHIFT (3U) -/*! RR_CH3F - Channel 3 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH3F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH3F_SHIFT)) & LPCMP_RRSR_RR_CH3F_MASK) - -#define LPCMP_RRSR_RR_CH4F_MASK (0x10U) -#define LPCMP_RRSR_RR_CH4F_SHIFT (4U) -/*! RR_CH4F - Channel 4 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH4F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH4F_SHIFT)) & LPCMP_RRSR_RR_CH4F_MASK) - -#define LPCMP_RRSR_RR_CH5F_MASK (0x20U) -#define LPCMP_RRSR_RR_CH5F_SHIFT (5U) -/*! RR_CH5F - Channel 5 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH5F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH5F_SHIFT)) & LPCMP_RRSR_RR_CH5F_MASK) - -#define LPCMP_RRSR_RR_CH6F_MASK (0x40U) -#define LPCMP_RRSR_RR_CH6F_SHIFT (6U) -/*! RR_CH6F - Channel 6 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH6F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH6F_SHIFT)) & LPCMP_RRSR_RR_CH6F_MASK) - -#define LPCMP_RRSR_RR_CH7F_MASK (0x80U) -#define LPCMP_RRSR_RR_CH7F_SHIFT (7U) -/*! RR_CH7F - Channel 7 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH7F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH7F_SHIFT)) & LPCMP_RRSR_RR_CH7F_MASK) -/*! @} */ - -/*! @name RRCR2 - Round Robin Control Register 2 */ -/*! @{ */ - -#define LPCMP_RRCR2_RR_TIMER_RELOAD_MASK (0xFFFFFFFU) -#define LPCMP_RRCR2_RR_TIMER_RELOAD_SHIFT (0U) -/*! RR_TIMER_RELOAD - Number of Sample Clocks */ -#define LPCMP_RRCR2_RR_TIMER_RELOAD(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR2_RR_TIMER_RELOAD_SHIFT)) & LPCMP_RRCR2_RR_TIMER_RELOAD_MASK) - -#define LPCMP_RRCR2_RR_TIMER_EN_MASK (0x80000000U) -#define LPCMP_RRCR2_RR_TIMER_EN_SHIFT (31U) -/*! RR_TIMER_EN - Round-Robin Internal Timer Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPCMP_RRCR2_RR_TIMER_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR2_RR_TIMER_EN_SHIFT)) & LPCMP_RRCR2_RR_TIMER_EN_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group LPCMP_Register_Masks */ - - -/* LPCMP - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral CMP0 base address */ - #define CMP0_BASE (0x50051000u) - /** Peripheral CMP0 base address */ - #define CMP0_BASE_NS (0x40051000u) - /** Peripheral CMP0 base pointer */ - #define CMP0 ((LPCMP_Type *)CMP0_BASE) - /** Peripheral CMP0 base pointer */ - #define CMP0_NS ((LPCMP_Type *)CMP0_BASE_NS) - /** Peripheral CMP1 base address */ - #define CMP1_BASE (0x50052000u) - /** Peripheral CMP1 base address */ - #define CMP1_BASE_NS (0x40052000u) - /** Peripheral CMP1 base pointer */ - #define CMP1 ((LPCMP_Type *)CMP1_BASE) - /** Peripheral CMP1 base pointer */ - #define CMP1_NS ((LPCMP_Type *)CMP1_BASE_NS) - /** Array initializer of LPCMP peripheral base addresses */ - #define LPCMP_BASE_ADDRS { CMP0_BASE, CMP1_BASE } - /** Array initializer of LPCMP peripheral base pointers */ - #define LPCMP_BASE_PTRS { CMP0, CMP1 } - /** Array initializer of LPCMP peripheral base addresses */ - #define LPCMP_BASE_ADDRS_NS { CMP0_BASE_NS, CMP1_BASE_NS } - /** Array initializer of LPCMP peripheral base pointers */ - #define LPCMP_BASE_PTRS_NS { CMP0_NS, CMP1_NS } -#else - /** Peripheral CMP0 base address */ - #define CMP0_BASE (0x40051000u) - /** Peripheral CMP0 base pointer */ - #define CMP0 ((LPCMP_Type *)CMP0_BASE) - /** Peripheral CMP1 base address */ - #define CMP1_BASE (0x40052000u) - /** Peripheral CMP1 base pointer */ - #define CMP1 ((LPCMP_Type *)CMP1_BASE) - /** Array initializer of LPCMP peripheral base addresses */ - #define LPCMP_BASE_ADDRS { CMP0_BASE, CMP1_BASE } - /** Array initializer of LPCMP peripheral base pointers */ - #define LPCMP_BASE_PTRS { CMP0, CMP1 } -#endif -/** Interrupt vectors for the LPCMP peripheral type */ -#define LPCMP_IRQS { HSCMP0_IRQn, HSCMP1_IRQn } - -/*! - * @} - */ /* end of group LPCMP_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LPI2C Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPI2C_Peripheral_Access_Layer LPI2C Peripheral Access Layer - * @{ - */ - -/** LPI2C - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - uint8_t RESERVED_0[8]; - __IO uint32_t MCR; /**< Controller Control, offset: 0x10 */ - __IO uint32_t MSR; /**< Controller Status, offset: 0x14 */ - __IO uint32_t MIER; /**< Controller Interrupt Enable, offset: 0x18 */ - __IO uint32_t MDER; /**< Controller DMA Enable, offset: 0x1C */ - __IO uint32_t MCFGR0; /**< Controller Configuration 0, offset: 0x20 */ - __IO uint32_t MCFGR1; /**< Controller Configuration 1, offset: 0x24 */ - __IO uint32_t MCFGR2; /**< Controller Configuration 2, offset: 0x28 */ - __IO uint32_t MCFGR3; /**< Controller Configuration 3, offset: 0x2C */ - uint8_t RESERVED_1[16]; - __IO uint32_t MDMR; /**< Controller Data Match, offset: 0x40 */ - uint8_t RESERVED_2[4]; - __IO uint32_t MCCR0; /**< Controller Clock Configuration 0, offset: 0x48 */ - uint8_t RESERVED_3[4]; - __IO uint32_t MCCR1; /**< Controller Clock Configuration 1, offset: 0x50 */ - uint8_t RESERVED_4[4]; - __IO uint32_t MFCR; /**< Controller FIFO Control, offset: 0x58 */ - __I uint32_t MFSR; /**< Controller FIFO Status, offset: 0x5C */ - __O uint32_t MTDR; /**< Controller Transmit Data, offset: 0x60 */ - uint8_t RESERVED_5[12]; - __I uint32_t MRDR; /**< Controller Receive Data, offset: 0x70 */ - uint8_t RESERVED_6[4]; - __I uint32_t MRDROR; /**< Controller Receive Data Read Only, offset: 0x78 */ - uint8_t RESERVED_7[148]; - __IO uint32_t SCR; /**< Target Control, offset: 0x110 */ - __IO uint32_t SSR; /**< Target Status, offset: 0x114 */ - __IO uint32_t SIER; /**< Target Interrupt Enable, offset: 0x118 */ - __IO uint32_t SDER; /**< Target DMA Enable, offset: 0x11C */ - __IO uint32_t SCFGR0; /**< Target Configuration 0, offset: 0x120 */ - __IO uint32_t SCFGR1; /**< Target Configuration 1, offset: 0x124 */ - __IO uint32_t SCFGR2; /**< Target Configuration 2, offset: 0x128 */ - uint8_t RESERVED_8[20]; - __IO uint32_t SAMR; /**< Target Address Match, offset: 0x140 */ - uint8_t RESERVED_9[12]; - __I uint32_t SASR; /**< Target Address Status, offset: 0x150 */ - __IO uint32_t STAR; /**< Target Transmit ACK, offset: 0x154 */ - uint8_t RESERVED_10[8]; - __O uint32_t STDR; /**< Target Transmit Data, offset: 0x160 */ - uint8_t RESERVED_11[12]; - __I uint32_t SRDR; /**< Target Receive Data, offset: 0x170 */ - uint8_t RESERVED_12[4]; - __I uint32_t SRDROR; /**< Target Receive Data Read Only, offset: 0x178 */ - uint8_t RESERVED_13[132]; - __O uint32_t MTCBR[128]; /**< Controller Transmit Command Burst, array offset: 0x200, array step: 0x4 */ - __O uint32_t MTDBR[253]; /**< Transmit Data Burst, array offset: 0x400, array step: 0x4 */ -} LPI2C_Type; - -/* ---------------------------------------------------------------------------- - -- LPI2C Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPI2C_Register_Masks LPI2C Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define LPI2C_VERID_FEATURE_MASK (0xFFFFU) -#define LPI2C_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000010..Controller only, with standard feature set - * 0b0000000000000011..Controller and target, with standard feature set - */ -#define LPI2C_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_VERID_FEATURE_SHIFT)) & LPI2C_VERID_FEATURE_MASK) - -#define LPI2C_VERID_MINOR_MASK (0xFF0000U) -#define LPI2C_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define LPI2C_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_VERID_MINOR_SHIFT)) & LPI2C_VERID_MINOR_MASK) - -#define LPI2C_VERID_MAJOR_MASK (0xFF000000U) -#define LPI2C_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define LPI2C_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_VERID_MAJOR_SHIFT)) & LPI2C_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define LPI2C_PARAM_MTXFIFO_MASK (0xFU) -#define LPI2C_PARAM_MTXFIFO_SHIFT (0U) -/*! MTXFIFO - Controller Transmit FIFO Size */ -#define LPI2C_PARAM_MTXFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_PARAM_MTXFIFO_SHIFT)) & LPI2C_PARAM_MTXFIFO_MASK) - -#define LPI2C_PARAM_MRXFIFO_MASK (0xF00U) -#define LPI2C_PARAM_MRXFIFO_SHIFT (8U) -/*! MRXFIFO - Controller Receive FIFO Size */ -#define LPI2C_PARAM_MRXFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_PARAM_MRXFIFO_SHIFT)) & LPI2C_PARAM_MRXFIFO_MASK) -/*! @} */ - -/*! @name MCR - Controller Control */ -/*! @{ */ - -#define LPI2C_MCR_MEN_MASK (0x1U) -#define LPI2C_MCR_MEN_SHIFT (0U) -/*! MEN - Controller Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MCR_MEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCR_MEN_SHIFT)) & LPI2C_MCR_MEN_MASK) - -#define LPI2C_MCR_RST_MASK (0x2U) -#define LPI2C_MCR_RST_SHIFT (1U) -/*! RST - Software Reset - * 0b0..No effect - * 0b1..Reset - */ -#define LPI2C_MCR_RST(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCR_RST_SHIFT)) & LPI2C_MCR_RST_MASK) - -#define LPI2C_MCR_DOZEN_MASK (0x4U) -#define LPI2C_MCR_DOZEN_SHIFT (2U) -/*! DOZEN - Doze Mode Enable - * 0b0..Enable - * 0b1..Disable - */ -#define LPI2C_MCR_DOZEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCR_DOZEN_SHIFT)) & LPI2C_MCR_DOZEN_MASK) - -#define LPI2C_MCR_DBGEN_MASK (0x8U) -#define LPI2C_MCR_DBGEN_SHIFT (3U) -/*! DBGEN - Debug Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MCR_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCR_DBGEN_SHIFT)) & LPI2C_MCR_DBGEN_MASK) - -#define LPI2C_MCR_RTF_MASK (0x100U) -#define LPI2C_MCR_RTF_SHIFT (8U) -/*! RTF - Reset Transmit FIFO - * 0b0..No effect - * 0b1..Reset transmit FIFO - */ -#define LPI2C_MCR_RTF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCR_RTF_SHIFT)) & LPI2C_MCR_RTF_MASK) - -#define LPI2C_MCR_RRF_MASK (0x200U) -#define LPI2C_MCR_RRF_SHIFT (9U) -/*! RRF - Reset Receive FIFO - * 0b0..No effect - * 0b1..Reset receive FIFO - */ -#define LPI2C_MCR_RRF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCR_RRF_SHIFT)) & LPI2C_MCR_RRF_MASK) -/*! @} */ - -/*! @name MSR - Controller Status */ -/*! @{ */ - -#define LPI2C_MSR_TDF_MASK (0x1U) -#define LPI2C_MSR_TDF_SHIFT (0U) -/*! TDF - Transmit Data Flag - * 0b0..Transmit data not requested - * 0b1..Transmit data requested - */ -#define LPI2C_MSR_TDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_TDF_SHIFT)) & LPI2C_MSR_TDF_MASK) - -#define LPI2C_MSR_RDF_MASK (0x2U) -#define LPI2C_MSR_RDF_SHIFT (1U) -/*! RDF - Receive Data Flag - * 0b0..Receive data not ready - * 0b1..Receive data ready - */ -#define LPI2C_MSR_RDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_RDF_SHIFT)) & LPI2C_MSR_RDF_MASK) - -#define LPI2C_MSR_EPF_MASK (0x100U) -#define LPI2C_MSR_EPF_SHIFT (8U) -/*! EPF - End Packet Flag - * 0b0..No Stop or repeated Start generated - * 0b1..Stop or repeated Start generated - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_EPF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_EPF_SHIFT)) & LPI2C_MSR_EPF_MASK) - -#define LPI2C_MSR_SDF_MASK (0x200U) -#define LPI2C_MSR_SDF_SHIFT (9U) -/*! SDF - Stop Detect Flag - * 0b0..No Stop condition generated - * 0b1..Stop condition generated - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_SDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_SDF_SHIFT)) & LPI2C_MSR_SDF_MASK) - -#define LPI2C_MSR_NDF_MASK (0x400U) -#define LPI2C_MSR_NDF_SHIFT (10U) -/*! NDF - NACK Detect Flag - * 0b0..No unexpected NACK detected - * 0b1..Unexpected NACK detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_NDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_NDF_SHIFT)) & LPI2C_MSR_NDF_MASK) - -#define LPI2C_MSR_ALF_MASK (0x800U) -#define LPI2C_MSR_ALF_SHIFT (11U) -/*! ALF - Arbitration Lost Flag - * 0b0..Controller did not lose arbitration - * 0b1..Controller lost arbitration - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_ALF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_ALF_SHIFT)) & LPI2C_MSR_ALF_MASK) - -#define LPI2C_MSR_FEF_MASK (0x1000U) -#define LPI2C_MSR_FEF_SHIFT (12U) -/*! FEF - FIFO Error Flag - * 0b0..No FIFO error - * 0b1..FIFO error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_FEF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_FEF_SHIFT)) & LPI2C_MSR_FEF_MASK) - -#define LPI2C_MSR_PLTF_MASK (0x2000U) -#define LPI2C_MSR_PLTF_SHIFT (13U) -/*! PLTF - Pin Low Timeout Flag - * 0b0..Pin low timeout did not occur - * 0b1..Pin low timeout occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_PLTF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_PLTF_SHIFT)) & LPI2C_MSR_PLTF_MASK) - -#define LPI2C_MSR_DMF_MASK (0x4000U) -#define LPI2C_MSR_DMF_SHIFT (14U) -/*! DMF - Data Match Flag - * 0b0..Matching data not received - * 0b1..Matching data received - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_DMF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_DMF_SHIFT)) & LPI2C_MSR_DMF_MASK) - -#define LPI2C_MSR_STF_MASK (0x8000U) -#define LPI2C_MSR_STF_SHIFT (15U) -/*! STF - Start Flag - * 0b0..Start condition not detected - * 0b1..Start condition detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_STF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_STF_SHIFT)) & LPI2C_MSR_STF_MASK) - -#define LPI2C_MSR_MBF_MASK (0x1000000U) -#define LPI2C_MSR_MBF_SHIFT (24U) -/*! MBF - Controller Busy Flag - * 0b0..Idle - * 0b1..Busy - */ -#define LPI2C_MSR_MBF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_MBF_SHIFT)) & LPI2C_MSR_MBF_MASK) - -#define LPI2C_MSR_BBF_MASK (0x2000000U) -#define LPI2C_MSR_BBF_SHIFT (25U) -/*! BBF - Bus Busy Flag - * 0b0..Idle - * 0b1..Busy - */ -#define LPI2C_MSR_BBF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_BBF_SHIFT)) & LPI2C_MSR_BBF_MASK) -/*! @} */ - -/*! @name MIER - Controller Interrupt Enable */ -/*! @{ */ - -#define LPI2C_MIER_TDIE_MASK (0x1U) -#define LPI2C_MIER_TDIE_SHIFT (0U) -/*! TDIE - Transmit Data Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_TDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_TDIE_SHIFT)) & LPI2C_MIER_TDIE_MASK) - -#define LPI2C_MIER_RDIE_MASK (0x2U) -#define LPI2C_MIER_RDIE_SHIFT (1U) -/*! RDIE - Receive Data Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_RDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_RDIE_SHIFT)) & LPI2C_MIER_RDIE_MASK) - -#define LPI2C_MIER_EPIE_MASK (0x100U) -#define LPI2C_MIER_EPIE_SHIFT (8U) -/*! EPIE - End Packet Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_EPIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_EPIE_SHIFT)) & LPI2C_MIER_EPIE_MASK) - -#define LPI2C_MIER_SDIE_MASK (0x200U) -#define LPI2C_MIER_SDIE_SHIFT (9U) -/*! SDIE - Stop Detect Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_SDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_SDIE_SHIFT)) & LPI2C_MIER_SDIE_MASK) - -#define LPI2C_MIER_NDIE_MASK (0x400U) -#define LPI2C_MIER_NDIE_SHIFT (10U) -/*! NDIE - NACK Detect Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_NDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_NDIE_SHIFT)) & LPI2C_MIER_NDIE_MASK) - -#define LPI2C_MIER_ALIE_MASK (0x800U) -#define LPI2C_MIER_ALIE_SHIFT (11U) -/*! ALIE - Arbitration Lost Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_ALIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_ALIE_SHIFT)) & LPI2C_MIER_ALIE_MASK) - -#define LPI2C_MIER_FEIE_MASK (0x1000U) -#define LPI2C_MIER_FEIE_SHIFT (12U) -/*! FEIE - FIFO Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_FEIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_FEIE_SHIFT)) & LPI2C_MIER_FEIE_MASK) - -#define LPI2C_MIER_PLTIE_MASK (0x2000U) -#define LPI2C_MIER_PLTIE_SHIFT (13U) -/*! PLTIE - Pin Low Timeout Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_PLTIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_PLTIE_SHIFT)) & LPI2C_MIER_PLTIE_MASK) - -#define LPI2C_MIER_DMIE_MASK (0x4000U) -#define LPI2C_MIER_DMIE_SHIFT (14U) -/*! DMIE - Data Match Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_DMIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_DMIE_SHIFT)) & LPI2C_MIER_DMIE_MASK) - -#define LPI2C_MIER_STIE_MASK (0x8000U) -#define LPI2C_MIER_STIE_SHIFT (15U) -/*! STIE - Start Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_STIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_STIE_SHIFT)) & LPI2C_MIER_STIE_MASK) -/*! @} */ - -/*! @name MDER - Controller DMA Enable */ -/*! @{ */ - -#define LPI2C_MDER_TDDE_MASK (0x1U) -#define LPI2C_MDER_TDDE_SHIFT (0U) -/*! TDDE - Transmit Data DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MDER_TDDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MDER_TDDE_SHIFT)) & LPI2C_MDER_TDDE_MASK) - -#define LPI2C_MDER_RDDE_MASK (0x2U) -#define LPI2C_MDER_RDDE_SHIFT (1U) -/*! RDDE - Receive Data DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MDER_RDDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MDER_RDDE_SHIFT)) & LPI2C_MDER_RDDE_MASK) -/*! @} */ - -/*! @name MCFGR0 - Controller Configuration 0 */ -/*! @{ */ - -#define LPI2C_MCFGR0_HREN_MASK (0x1U) -#define LPI2C_MCFGR0_HREN_SHIFT (0U) -/*! HREN - Host Request Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MCFGR0_HREN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_HREN_SHIFT)) & LPI2C_MCFGR0_HREN_MASK) - -#define LPI2C_MCFGR0_HRPOL_MASK (0x2U) -#define LPI2C_MCFGR0_HRPOL_SHIFT (1U) -/*! HRPOL - Host Request Polarity - * 0b0..Active low - * 0b1..Active high - */ -#define LPI2C_MCFGR0_HRPOL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_HRPOL_SHIFT)) & LPI2C_MCFGR0_HRPOL_MASK) - -#define LPI2C_MCFGR0_HRSEL_MASK (0x4U) -#define LPI2C_MCFGR0_HRSEL_SHIFT (2U) -/*! HRSEL - Host Request Select - * 0b0..Host request input is pin HREQ - * 0b1..Host request input is input trigger - */ -#define LPI2C_MCFGR0_HRSEL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_HRSEL_SHIFT)) & LPI2C_MCFGR0_HRSEL_MASK) - -#define LPI2C_MCFGR0_HRDIR_MASK (0x8U) -#define LPI2C_MCFGR0_HRDIR_SHIFT (3U) -/*! HRDIR - Host Request Direction - * 0b0..HREQ pin is input (for LPI2C controller) - * 0b1..HREQ pin is output (for LPI2C target) - */ -#define LPI2C_MCFGR0_HRDIR(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_HRDIR_SHIFT)) & LPI2C_MCFGR0_HRDIR_MASK) - -#define LPI2C_MCFGR0_CIRFIFO_MASK (0x100U) -#define LPI2C_MCFGR0_CIRFIFO_SHIFT (8U) -/*! CIRFIFO - Circular FIFO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MCFGR0_CIRFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_CIRFIFO_SHIFT)) & LPI2C_MCFGR0_CIRFIFO_MASK) - -#define LPI2C_MCFGR0_RDMO_MASK (0x200U) -#define LPI2C_MCFGR0_RDMO_SHIFT (9U) -/*! RDMO - Receive Data Match Only - * 0b0..Received data is stored in the receive FIFO - * 0b1..Received data is discarded unless MSR[DMF] is set - */ -#define LPI2C_MCFGR0_RDMO(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_RDMO_SHIFT)) & LPI2C_MCFGR0_RDMO_MASK) - -#define LPI2C_MCFGR0_RELAX_MASK (0x10000U) -#define LPI2C_MCFGR0_RELAX_SHIFT (16U) -/*! RELAX - Relaxed Mode - * 0b0..Normal transfer - * 0b1..Relaxed transfer - */ -#define LPI2C_MCFGR0_RELAX(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_RELAX_SHIFT)) & LPI2C_MCFGR0_RELAX_MASK) - -#define LPI2C_MCFGR0_ABORT_MASK (0x20000U) -#define LPI2C_MCFGR0_ABORT_SHIFT (17U) -/*! ABORT - Abort Transfer - * 0b0..Normal transfer - * 0b1..Abort existing transfer and do not start a new one - */ -#define LPI2C_MCFGR0_ABORT(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_ABORT_SHIFT)) & LPI2C_MCFGR0_ABORT_MASK) -/*! @} */ - -/*! @name MCFGR1 - Controller Configuration 1 */ -/*! @{ */ - -#define LPI2C_MCFGR1_PRESCALE_MASK (0x7U) -#define LPI2C_MCFGR1_PRESCALE_SHIFT (0U) -/*! PRESCALE - Prescaler - * 0b000..Divide by 1 - * 0b001..Divide by 2 - * 0b010..Divide by 4 - * 0b011..Divide by 8 - * 0b100..Divide by 16 - * 0b101..Divide by 32 - * 0b110..Divide by 64 - * 0b111..Divide by 128 - */ -#define LPI2C_MCFGR1_PRESCALE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_PRESCALE_SHIFT)) & LPI2C_MCFGR1_PRESCALE_MASK) - -#define LPI2C_MCFGR1_AUTOSTOP_MASK (0x100U) -#define LPI2C_MCFGR1_AUTOSTOP_SHIFT (8U) -/*! AUTOSTOP - Automatic Stop Generation - * 0b0..No effect - * 0b1..Stop automatically generated - */ -#define LPI2C_MCFGR1_AUTOSTOP(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_AUTOSTOP_SHIFT)) & LPI2C_MCFGR1_AUTOSTOP_MASK) - -#define LPI2C_MCFGR1_IGNACK_MASK (0x200U) -#define LPI2C_MCFGR1_IGNACK_SHIFT (9U) -/*! IGNACK - Ignore NACK - * 0b0..No effect - * 0b1..Treat a received NACK as an ACK - */ -#define LPI2C_MCFGR1_IGNACK(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_IGNACK_SHIFT)) & LPI2C_MCFGR1_IGNACK_MASK) - -#define LPI2C_MCFGR1_TIMECFG_MASK (0x400U) -#define LPI2C_MCFGR1_TIMECFG_SHIFT (10U) -/*! TIMECFG - Timeout Configuration - * 0b0..SCL - * 0b1..SCL or SDA - */ -#define LPI2C_MCFGR1_TIMECFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_TIMECFG_SHIFT)) & LPI2C_MCFGR1_TIMECFG_MASK) - -#define LPI2C_MCFGR1_STOPCFG_MASK (0x800U) -#define LPI2C_MCFGR1_STOPCFG_SHIFT (11U) -/*! STOPCFG - Stop Configuration - * 0b0..Any Stop condition - * 0b1..Last Stop condition - */ -#define LPI2C_MCFGR1_STOPCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_STOPCFG_SHIFT)) & LPI2C_MCFGR1_STOPCFG_MASK) - -#define LPI2C_MCFGR1_STARTCFG_MASK (0x1000U) -#define LPI2C_MCFGR1_STARTCFG_SHIFT (12U) -/*! STARTCFG - Start Configuration - * 0b0..Sets when both I2C bus and LPI2C controller are idle - * 0b1..Sets when I2C bus is idle - */ -#define LPI2C_MCFGR1_STARTCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_STARTCFG_SHIFT)) & LPI2C_MCFGR1_STARTCFG_MASK) - -#define LPI2C_MCFGR1_MATCFG_MASK (0x70000U) -#define LPI2C_MCFGR1_MATCFG_SHIFT (16U) -/*! MATCFG - Match Configuration - * 0b000..Match is disabled - * 0b001..Reserved - * 0b010..Match is enabled: first data word equals MDMR[MATCH0] OR MDMR[MATCH1] - * 0b011..Match is enabled: any data word equals MDMR[MATCH0] OR MDMR[MATCH1] - * 0b100..Match is enabled: (first data word equals MDMR[MATCH0]) AND (second data word equals MDMR[MATCH1) - * 0b101..Match is enabled: (any data word equals MDMR[MATCH0]) AND (next data word equals MDMR[MATCH1) - * 0b110..Match is enabled: (first data word AND MDMR[MATCH1]) equals (MDMR[MATCH0] AND MDMR[MATCH1]) - * 0b111..Match is enabled: (any data word AND MDMR[MATCH1]) equals (MDMR[MATCH0] AND MDMR[MATCH1]) - */ -#define LPI2C_MCFGR1_MATCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_MATCFG_SHIFT)) & LPI2C_MCFGR1_MATCFG_MASK) - -#define LPI2C_MCFGR1_PINCFG_MASK (0x7000000U) -#define LPI2C_MCFGR1_PINCFG_SHIFT (24U) -/*! PINCFG - Pin Configuration - * 0b000..Two-pin open drain mode - * 0b001..Two-pin output only mode (Ultra-Fast mode) - * 0b010..Two-pin push-pull mode - * 0b011..Four-pin push-pull mode - * 0b100..Two-pin open-drain mode with separate LPI2C target - * 0b101..Two-pin output only mode (Ultra-Fast mode) with separate LPI2C target - * 0b110..Two-pin push-pull mode with separate LPI2C target - * 0b111..Four-pin push-pull mode (inverted outputs) - */ -#define LPI2C_MCFGR1_PINCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_PINCFG_SHIFT)) & LPI2C_MCFGR1_PINCFG_MASK) -/*! @} */ - -/*! @name MCFGR2 - Controller Configuration 2 */ -/*! @{ */ - -#define LPI2C_MCFGR2_BUSIDLE_MASK (0xFFFU) -#define LPI2C_MCFGR2_BUSIDLE_SHIFT (0U) -/*! BUSIDLE - Bus Idle Timeout */ -#define LPI2C_MCFGR2_BUSIDLE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR2_BUSIDLE_SHIFT)) & LPI2C_MCFGR2_BUSIDLE_MASK) - -#define LPI2C_MCFGR2_FILTSCL_MASK (0xF0000U) -#define LPI2C_MCFGR2_FILTSCL_SHIFT (16U) -/*! FILTSCL - Glitch Filter SCL */ -#define LPI2C_MCFGR2_FILTSCL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR2_FILTSCL_SHIFT)) & LPI2C_MCFGR2_FILTSCL_MASK) - -#define LPI2C_MCFGR2_FILTSDA_MASK (0xF000000U) -#define LPI2C_MCFGR2_FILTSDA_SHIFT (24U) -/*! FILTSDA - Glitch Filter SDA */ -#define LPI2C_MCFGR2_FILTSDA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR2_FILTSDA_SHIFT)) & LPI2C_MCFGR2_FILTSDA_MASK) -/*! @} */ - -/*! @name MCFGR3 - Controller Configuration 3 */ -/*! @{ */ - -#define LPI2C_MCFGR3_PINLOW_MASK (0xFFF00U) -#define LPI2C_MCFGR3_PINLOW_SHIFT (8U) -/*! PINLOW - Pin Low Timeout */ -#define LPI2C_MCFGR3_PINLOW(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR3_PINLOW_SHIFT)) & LPI2C_MCFGR3_PINLOW_MASK) -/*! @} */ - -/*! @name MDMR - Controller Data Match */ -/*! @{ */ - -#define LPI2C_MDMR_MATCH0_MASK (0xFFU) -#define LPI2C_MDMR_MATCH0_SHIFT (0U) -/*! MATCH0 - Match 0 Value */ -#define LPI2C_MDMR_MATCH0(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MDMR_MATCH0_SHIFT)) & LPI2C_MDMR_MATCH0_MASK) - -#define LPI2C_MDMR_MATCH1_MASK (0xFF0000U) -#define LPI2C_MDMR_MATCH1_SHIFT (16U) -/*! MATCH1 - Match 1 Value */ -#define LPI2C_MDMR_MATCH1(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MDMR_MATCH1_SHIFT)) & LPI2C_MDMR_MATCH1_MASK) -/*! @} */ - -/*! @name MCCR0 - Controller Clock Configuration 0 */ -/*! @{ */ - -#define LPI2C_MCCR0_CLKLO_MASK (0x3FU) -#define LPI2C_MCCR0_CLKLO_SHIFT (0U) -/*! CLKLO - Clock Low Period */ -#define LPI2C_MCCR0_CLKLO(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR0_CLKLO_SHIFT)) & LPI2C_MCCR0_CLKLO_MASK) - -#define LPI2C_MCCR0_CLKHI_MASK (0x3F00U) -#define LPI2C_MCCR0_CLKHI_SHIFT (8U) -/*! CLKHI - Clock High Period */ -#define LPI2C_MCCR0_CLKHI(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR0_CLKHI_SHIFT)) & LPI2C_MCCR0_CLKHI_MASK) - -#define LPI2C_MCCR0_SETHOLD_MASK (0x3F0000U) -#define LPI2C_MCCR0_SETHOLD_SHIFT (16U) -/*! SETHOLD - Setup Hold Delay */ -#define LPI2C_MCCR0_SETHOLD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR0_SETHOLD_SHIFT)) & LPI2C_MCCR0_SETHOLD_MASK) - -#define LPI2C_MCCR0_DATAVD_MASK (0x3F000000U) -#define LPI2C_MCCR0_DATAVD_SHIFT (24U) -/*! DATAVD - Data Valid Delay */ -#define LPI2C_MCCR0_DATAVD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR0_DATAVD_SHIFT)) & LPI2C_MCCR0_DATAVD_MASK) -/*! @} */ - -/*! @name MCCR1 - Controller Clock Configuration 1 */ -/*! @{ */ - -#define LPI2C_MCCR1_CLKLO_MASK (0x3FU) -#define LPI2C_MCCR1_CLKLO_SHIFT (0U) -/*! CLKLO - Clock Low Period */ -#define LPI2C_MCCR1_CLKLO(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR1_CLKLO_SHIFT)) & LPI2C_MCCR1_CLKLO_MASK) - -#define LPI2C_MCCR1_CLKHI_MASK (0x3F00U) -#define LPI2C_MCCR1_CLKHI_SHIFT (8U) -/*! CLKHI - Clock High Period */ -#define LPI2C_MCCR1_CLKHI(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR1_CLKHI_SHIFT)) & LPI2C_MCCR1_CLKHI_MASK) - -#define LPI2C_MCCR1_SETHOLD_MASK (0x3F0000U) -#define LPI2C_MCCR1_SETHOLD_SHIFT (16U) -/*! SETHOLD - Setup Hold Delay */ -#define LPI2C_MCCR1_SETHOLD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR1_SETHOLD_SHIFT)) & LPI2C_MCCR1_SETHOLD_MASK) - -#define LPI2C_MCCR1_DATAVD_MASK (0x3F000000U) -#define LPI2C_MCCR1_DATAVD_SHIFT (24U) -/*! DATAVD - Data Valid Delay */ -#define LPI2C_MCCR1_DATAVD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR1_DATAVD_SHIFT)) & LPI2C_MCCR1_DATAVD_MASK) -/*! @} */ - -/*! @name MFCR - Controller FIFO Control */ -/*! @{ */ - -#define LPI2C_MFCR_TXWATER_MASK (0x7U) -#define LPI2C_MFCR_TXWATER_SHIFT (0U) -/*! TXWATER - Transmit FIFO Watermark */ -#define LPI2C_MFCR_TXWATER(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MFCR_TXWATER_SHIFT)) & LPI2C_MFCR_TXWATER_MASK) - -#define LPI2C_MFCR_RXWATER_MASK (0x70000U) -#define LPI2C_MFCR_RXWATER_SHIFT (16U) -/*! RXWATER - Receive FIFO Watermark */ -#define LPI2C_MFCR_RXWATER(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MFCR_RXWATER_SHIFT)) & LPI2C_MFCR_RXWATER_MASK) -/*! @} */ - -/*! @name MFSR - Controller FIFO Status */ -/*! @{ */ - -#define LPI2C_MFSR_TXCOUNT_MASK (0xFU) -#define LPI2C_MFSR_TXCOUNT_SHIFT (0U) -/*! TXCOUNT - Transmit FIFO Count */ -#define LPI2C_MFSR_TXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MFSR_TXCOUNT_SHIFT)) & LPI2C_MFSR_TXCOUNT_MASK) - -#define LPI2C_MFSR_RXCOUNT_MASK (0xF0000U) -#define LPI2C_MFSR_RXCOUNT_SHIFT (16U) -/*! RXCOUNT - Receive FIFO Count */ -#define LPI2C_MFSR_RXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MFSR_RXCOUNT_SHIFT)) & LPI2C_MFSR_RXCOUNT_MASK) -/*! @} */ - -/*! @name MTDR - Controller Transmit Data */ -/*! @{ */ - -#define LPI2C_MTDR_DATA_MASK (0xFFU) -#define LPI2C_MTDR_DATA_SHIFT (0U) -/*! DATA - Transmit Data */ -#define LPI2C_MTDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MTDR_DATA_SHIFT)) & LPI2C_MTDR_DATA_MASK) - -#define LPI2C_MTDR_CMD_MASK (0x700U) -#define LPI2C_MTDR_CMD_SHIFT (8U) -/*! CMD - Command Data - * 0b000..Transmit the value in DATA[7:0] - * 0b001..Receive (DATA[7:0] + 1) bytes - * 0b010..Generate Stop condition on I2C bus - * 0b011..Receive and discard (DATA[7:0] + 1) bytes - * 0b100..Generate (repeated) Start on the I2C bus and transmit the address in DATA[7:0] - * 0b101..Generate (repeated) Start on the I2C bus and transmit the address in DATA[7:0] (this transfer expects a NACK to be returned) - * 0b110..Generate (repeated) Start on the I2C bus and transmit the address in DATA[7:0] using HS mode - * 0b111..Generate (repeated) Start on the I2C bus and transmit the address in DATA[7:0] using HS mode (this transfer expects a NACK to be returned) - */ -#define LPI2C_MTDR_CMD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MTDR_CMD_SHIFT)) & LPI2C_MTDR_CMD_MASK) -/*! @} */ - -/*! @name MRDR - Controller Receive Data */ -/*! @{ */ - -#define LPI2C_MRDR_DATA_MASK (0xFFU) -#define LPI2C_MRDR_DATA_SHIFT (0U) -/*! DATA - Receive Data */ -#define LPI2C_MRDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MRDR_DATA_SHIFT)) & LPI2C_MRDR_DATA_MASK) - -#define LPI2C_MRDR_RXEMPTY_MASK (0x4000U) -#define LPI2C_MRDR_RXEMPTY_SHIFT (14U) -/*! RXEMPTY - Receive Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPI2C_MRDR_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MRDR_RXEMPTY_SHIFT)) & LPI2C_MRDR_RXEMPTY_MASK) -/*! @} */ - -/*! @name MRDROR - Controller Receive Data Read Only */ -/*! @{ */ - -#define LPI2C_MRDROR_DATA_MASK (0xFFU) -#define LPI2C_MRDROR_DATA_SHIFT (0U) -/*! DATA - Receive Data */ -#define LPI2C_MRDROR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MRDROR_DATA_SHIFT)) & LPI2C_MRDROR_DATA_MASK) - -#define LPI2C_MRDROR_RXEMPTY_MASK (0x4000U) -#define LPI2C_MRDROR_RXEMPTY_SHIFT (14U) -/*! RXEMPTY - RX Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPI2C_MRDROR_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MRDROR_RXEMPTY_SHIFT)) & LPI2C_MRDROR_RXEMPTY_MASK) -/*! @} */ - -/*! @name SCR - Target Control */ -/*! @{ */ - -#define LPI2C_SCR_SEN_MASK (0x1U) -#define LPI2C_SCR_SEN_SHIFT (0U) -/*! SEN - Target Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCR_SEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCR_SEN_SHIFT)) & LPI2C_SCR_SEN_MASK) - -#define LPI2C_SCR_RST_MASK (0x2U) -#define LPI2C_SCR_RST_SHIFT (1U) -/*! RST - Software Reset - * 0b0..Not reset - * 0b1..Reset - */ -#define LPI2C_SCR_RST(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCR_RST_SHIFT)) & LPI2C_SCR_RST_MASK) - -#define LPI2C_SCR_FILTEN_MASK (0x10U) -#define LPI2C_SCR_FILTEN_SHIFT (4U) -/*! FILTEN - Filter Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCR_FILTEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCR_FILTEN_SHIFT)) & LPI2C_SCR_FILTEN_MASK) - -#define LPI2C_SCR_FILTDZ_MASK (0x20U) -#define LPI2C_SCR_FILTDZ_SHIFT (5U) -/*! FILTDZ - Filter Doze Enable - * 0b0..Enable - * 0b1..Disable - */ -#define LPI2C_SCR_FILTDZ(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCR_FILTDZ_SHIFT)) & LPI2C_SCR_FILTDZ_MASK) - -#define LPI2C_SCR_RTF_MASK (0x100U) -#define LPI2C_SCR_RTF_SHIFT (8U) -/*! RTF - Reset Transmit FIFO - * 0b0..No effect - * 0b1..STDR is now empty - */ -#define LPI2C_SCR_RTF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCR_RTF_SHIFT)) & LPI2C_SCR_RTF_MASK) - -#define LPI2C_SCR_RRF_MASK (0x200U) -#define LPI2C_SCR_RRF_SHIFT (9U) -/*! RRF - Reset Receive FIFO - * 0b0..No effect - * 0b1..SRDR is now empty - */ -#define LPI2C_SCR_RRF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCR_RRF_SHIFT)) & LPI2C_SCR_RRF_MASK) -/*! @} */ - -/*! @name SSR - Target Status */ -/*! @{ */ - -#define LPI2C_SSR_TDF_MASK (0x1U) -#define LPI2C_SSR_TDF_SHIFT (0U) -/*! TDF - Transmit Data Flag - * 0b0..Transmit data not requested - * 0b1..Transmit data is requested - */ -#define LPI2C_SSR_TDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_TDF_SHIFT)) & LPI2C_SSR_TDF_MASK) - -#define LPI2C_SSR_RDF_MASK (0x2U) -#define LPI2C_SSR_RDF_SHIFT (1U) -/*! RDF - Receive Data Flag - * 0b0..Not ready - * 0b1..Ready - */ -#define LPI2C_SSR_RDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_RDF_SHIFT)) & LPI2C_SSR_RDF_MASK) - -#define LPI2C_SSR_AVF_MASK (0x4U) -#define LPI2C_SSR_AVF_SHIFT (2U) -/*! AVF - Address Valid Flag - * 0b0..Not valid - * 0b1..Valid - */ -#define LPI2C_SSR_AVF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_AVF_SHIFT)) & LPI2C_SSR_AVF_MASK) - -#define LPI2C_SSR_TAF_MASK (0x8U) -#define LPI2C_SSR_TAF_SHIFT (3U) -/*! TAF - Transmit ACK Flag - * 0b0..Not required - * 0b1..Required - */ -#define LPI2C_SSR_TAF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_TAF_SHIFT)) & LPI2C_SSR_TAF_MASK) - -#define LPI2C_SSR_RSF_MASK (0x100U) -#define LPI2C_SSR_RSF_SHIFT (8U) -/*! RSF - Repeated Start Flag - * 0b0..No repeated Start detected - * 0b1..Repeated Start detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_SSR_RSF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_RSF_SHIFT)) & LPI2C_SSR_RSF_MASK) - -#define LPI2C_SSR_SDF_MASK (0x200U) -#define LPI2C_SSR_SDF_SHIFT (9U) -/*! SDF - Stop Detect Flag - * 0b0..No Stop detected - * 0b1..Stop detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_SSR_SDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_SDF_SHIFT)) & LPI2C_SSR_SDF_MASK) - -#define LPI2C_SSR_BEF_MASK (0x400U) -#define LPI2C_SSR_BEF_SHIFT (10U) -/*! BEF - Bit Error Flag - * 0b0..No bit error occurred - * 0b1..Bit error occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_SSR_BEF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_BEF_SHIFT)) & LPI2C_SSR_BEF_MASK) - -#define LPI2C_SSR_FEF_MASK (0x800U) -#define LPI2C_SSR_FEF_SHIFT (11U) -/*! FEF - FIFO Error Flag - * 0b0..No FIFO error - * 0b1..FIFO error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_SSR_FEF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_FEF_SHIFT)) & LPI2C_SSR_FEF_MASK) - -#define LPI2C_SSR_AM0F_MASK (0x1000U) -#define LPI2C_SSR_AM0F_SHIFT (12U) -/*! AM0F - Address Match 0 Flag - * 0b0..ADDR0 matching address not received - * 0b1..ADDR0 matching address received - */ -#define LPI2C_SSR_AM0F(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_AM0F_SHIFT)) & LPI2C_SSR_AM0F_MASK) - -#define LPI2C_SSR_AM1F_MASK (0x2000U) -#define LPI2C_SSR_AM1F_SHIFT (13U) -/*! AM1F - Address Match 1 Flag - * 0b0..Matching address not received - * 0b1..Matching address received - */ -#define LPI2C_SSR_AM1F(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_AM1F_SHIFT)) & LPI2C_SSR_AM1F_MASK) - -#define LPI2C_SSR_GCF_MASK (0x4000U) -#define LPI2C_SSR_GCF_SHIFT (14U) -/*! GCF - General Call Flag - * 0b0..General call address disabled or not detected - * 0b1..General call address detected - */ -#define LPI2C_SSR_GCF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_GCF_SHIFT)) & LPI2C_SSR_GCF_MASK) - -#define LPI2C_SSR_SARF_MASK (0x8000U) -#define LPI2C_SSR_SARF_SHIFT (15U) -/*! SARF - SMBus Alert Response Flag - * 0b0..Disabled or not detected - * 0b1..Enabled and detected - */ -#define LPI2C_SSR_SARF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_SARF_SHIFT)) & LPI2C_SSR_SARF_MASK) - -#define LPI2C_SSR_SBF_MASK (0x1000000U) -#define LPI2C_SSR_SBF_SHIFT (24U) -/*! SBF - Target Busy Flag - * 0b0..Idle - * 0b1..Busy - */ -#define LPI2C_SSR_SBF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_SBF_SHIFT)) & LPI2C_SSR_SBF_MASK) - -#define LPI2C_SSR_BBF_MASK (0x2000000U) -#define LPI2C_SSR_BBF_SHIFT (25U) -/*! BBF - Bus Busy Flag - * 0b0..Idle - * 0b1..Busy - */ -#define LPI2C_SSR_BBF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_BBF_SHIFT)) & LPI2C_SSR_BBF_MASK) -/*! @} */ - -/*! @name SIER - Target Interrupt Enable */ -/*! @{ */ - -#define LPI2C_SIER_TDIE_MASK (0x1U) -#define LPI2C_SIER_TDIE_SHIFT (0U) -/*! TDIE - Transmit Data Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_TDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_TDIE_SHIFT)) & LPI2C_SIER_TDIE_MASK) - -#define LPI2C_SIER_RDIE_MASK (0x2U) -#define LPI2C_SIER_RDIE_SHIFT (1U) -/*! RDIE - Receive Data Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_RDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_RDIE_SHIFT)) & LPI2C_SIER_RDIE_MASK) - -#define LPI2C_SIER_AVIE_MASK (0x4U) -#define LPI2C_SIER_AVIE_SHIFT (2U) -/*! AVIE - Address Valid Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_AVIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_AVIE_SHIFT)) & LPI2C_SIER_AVIE_MASK) - -#define LPI2C_SIER_TAIE_MASK (0x8U) -#define LPI2C_SIER_TAIE_SHIFT (3U) -/*! TAIE - Transmit ACK Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_TAIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_TAIE_SHIFT)) & LPI2C_SIER_TAIE_MASK) - -#define LPI2C_SIER_RSIE_MASK (0x100U) -#define LPI2C_SIER_RSIE_SHIFT (8U) -/*! RSIE - Repeated Start Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_RSIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_RSIE_SHIFT)) & LPI2C_SIER_RSIE_MASK) - -#define LPI2C_SIER_SDIE_MASK (0x200U) -#define LPI2C_SIER_SDIE_SHIFT (9U) -/*! SDIE - Stop Detect Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_SDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_SDIE_SHIFT)) & LPI2C_SIER_SDIE_MASK) - -#define LPI2C_SIER_BEIE_MASK (0x400U) -#define LPI2C_SIER_BEIE_SHIFT (10U) -/*! BEIE - Bit Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_BEIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_BEIE_SHIFT)) & LPI2C_SIER_BEIE_MASK) - -#define LPI2C_SIER_FEIE_MASK (0x800U) -#define LPI2C_SIER_FEIE_SHIFT (11U) -/*! FEIE - FIFO Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_FEIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_FEIE_SHIFT)) & LPI2C_SIER_FEIE_MASK) - -#define LPI2C_SIER_AM0IE_MASK (0x1000U) -#define LPI2C_SIER_AM0IE_SHIFT (12U) -/*! AM0IE - Address Match 0 Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_AM0IE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_AM0IE_SHIFT)) & LPI2C_SIER_AM0IE_MASK) - -#define LPI2C_SIER_AM1IE_MASK (0x2000U) -#define LPI2C_SIER_AM1IE_SHIFT (13U) -/*! AM1IE - Address Match 1 Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_AM1IE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_AM1IE_SHIFT)) & LPI2C_SIER_AM1IE_MASK) - -#define LPI2C_SIER_GCIE_MASK (0x4000U) -#define LPI2C_SIER_GCIE_SHIFT (14U) -/*! GCIE - General Call Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define LPI2C_SIER_GCIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_GCIE_SHIFT)) & LPI2C_SIER_GCIE_MASK) - -#define LPI2C_SIER_SARIE_MASK (0x8000U) -#define LPI2C_SIER_SARIE_SHIFT (15U) -/*! SARIE - SMBus Alert Response Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_SARIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_SARIE_SHIFT)) & LPI2C_SIER_SARIE_MASK) -/*! @} */ - -/*! @name SDER - Target DMA Enable */ -/*! @{ */ - -#define LPI2C_SDER_TDDE_MASK (0x1U) -#define LPI2C_SDER_TDDE_SHIFT (0U) -/*! TDDE - Transmit Data DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SDER_TDDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SDER_TDDE_SHIFT)) & LPI2C_SDER_TDDE_MASK) - -#define LPI2C_SDER_RDDE_MASK (0x2U) -#define LPI2C_SDER_RDDE_SHIFT (1U) -/*! RDDE - Receive Data DMA Enable - * 0b0..Disable DMA request - * 0b1..Enable DMA request - */ -#define LPI2C_SDER_RDDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SDER_RDDE_SHIFT)) & LPI2C_SDER_RDDE_MASK) - -#define LPI2C_SDER_AVDE_MASK (0x4U) -#define LPI2C_SDER_AVDE_SHIFT (2U) -/*! AVDE - Address Valid DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SDER_AVDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SDER_AVDE_SHIFT)) & LPI2C_SDER_AVDE_MASK) - -#define LPI2C_SDER_RSDE_MASK (0x100U) -#define LPI2C_SDER_RSDE_SHIFT (8U) -/*! RSDE - Repeated Start DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SDER_RSDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SDER_RSDE_SHIFT)) & LPI2C_SDER_RSDE_MASK) - -#define LPI2C_SDER_SDDE_MASK (0x200U) -#define LPI2C_SDER_SDDE_SHIFT (9U) -/*! SDDE - Stop Detect DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SDER_SDDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SDER_SDDE_SHIFT)) & LPI2C_SDER_SDDE_MASK) -/*! @} */ - -/*! @name SCFGR0 - Target Configuration 0 */ -/*! @{ */ - -#define LPI2C_SCFGR0_RDREQ_MASK (0x1U) -#define LPI2C_SCFGR0_RDREQ_SHIFT (0U) -/*! RDREQ - Read Request - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR0_RDREQ(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR0_RDREQ_SHIFT)) & LPI2C_SCFGR0_RDREQ_MASK) - -#define LPI2C_SCFGR0_RDACK_MASK (0x2U) -#define LPI2C_SCFGR0_RDACK_SHIFT (1U) -/*! RDACK - Read Acknowledge Flag - * 0b0..Read Request not acknowledged - * 0b1..Read Request acknowledged - */ -#define LPI2C_SCFGR0_RDACK(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR0_RDACK_SHIFT)) & LPI2C_SCFGR0_RDACK_MASK) -/*! @} */ - -/*! @name SCFGR1 - Target Configuration 1 */ -/*! @{ */ - -#define LPI2C_SCFGR1_ADRSTALL_MASK (0x1U) -#define LPI2C_SCFGR1_ADRSTALL_SHIFT (0U) -/*! ADRSTALL - Address SCL Stall - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_ADRSTALL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_ADRSTALL_SHIFT)) & LPI2C_SCFGR1_ADRSTALL_MASK) - -#define LPI2C_SCFGR1_RXSTALL_MASK (0x2U) -#define LPI2C_SCFGR1_RXSTALL_SHIFT (1U) -/*! RXSTALL - RX SCL Stall - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_RXSTALL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_RXSTALL_SHIFT)) & LPI2C_SCFGR1_RXSTALL_MASK) - -#define LPI2C_SCFGR1_TXDSTALL_MASK (0x4U) -#define LPI2C_SCFGR1_TXDSTALL_SHIFT (2U) -/*! TXDSTALL - Transmit Data SCL Stall - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_TXDSTALL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_TXDSTALL_SHIFT)) & LPI2C_SCFGR1_TXDSTALL_MASK) - -#define LPI2C_SCFGR1_ACKSTALL_MASK (0x8U) -#define LPI2C_SCFGR1_ACKSTALL_SHIFT (3U) -/*! ACKSTALL - ACK SCL Stall - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_ACKSTALL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_ACKSTALL_SHIFT)) & LPI2C_SCFGR1_ACKSTALL_MASK) - -#define LPI2C_SCFGR1_RXNACK_MASK (0x10U) -#define LPI2C_SCFGR1_RXNACK_SHIFT (4U) -/*! RXNACK - Receive NACK - * 0b0..ACK or NACK always determined by STAR[TXNACK] - * 0b1..NACK always generated on address overrun or receive data overrun, otherwise ACK or NACK is determined by STAR[TXNACK] - */ -#define LPI2C_SCFGR1_RXNACK(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_RXNACK_SHIFT)) & LPI2C_SCFGR1_RXNACK_MASK) - -#define LPI2C_SCFGR1_GCEN_MASK (0x100U) -#define LPI2C_SCFGR1_GCEN_SHIFT (8U) -/*! GCEN - General Call Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_GCEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_GCEN_SHIFT)) & LPI2C_SCFGR1_GCEN_MASK) - -#define LPI2C_SCFGR1_SAEN_MASK (0x200U) -#define LPI2C_SCFGR1_SAEN_SHIFT (9U) -/*! SAEN - SMBus Alert Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_SAEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_SAEN_SHIFT)) & LPI2C_SCFGR1_SAEN_MASK) - -#define LPI2C_SCFGR1_TXCFG_MASK (0x400U) -#define LPI2C_SCFGR1_TXCFG_SHIFT (10U) -/*! TXCFG - Transmit Flag Configuration - * 0b0..MSR[TDF] is set only during a target-transmit transfer when STDR is empty - * 0b1..MSR[TDF] is set whenever STDR is empty - */ -#define LPI2C_SCFGR1_TXCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_TXCFG_SHIFT)) & LPI2C_SCFGR1_TXCFG_MASK) - -#define LPI2C_SCFGR1_RXCFG_MASK (0x800U) -#define LPI2C_SCFGR1_RXCFG_SHIFT (11U) -/*! RXCFG - Receive Data Configuration - * 0b0..Return received data, clear MSR[RDF] - * 0b1..Return SASR and clear SSR[AVF] when SSR[AVF] is set, return received data and clear MSR[RDF] when SSR[AFV] is not set - */ -#define LPI2C_SCFGR1_RXCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_RXCFG_SHIFT)) & LPI2C_SCFGR1_RXCFG_MASK) - -#define LPI2C_SCFGR1_IGNACK_MASK (0x1000U) -#define LPI2C_SCFGR1_IGNACK_SHIFT (12U) -/*! IGNACK - Ignore NACK - * 0b0..End transfer on NACK - * 0b1..Do not end transfer on NACK - */ -#define LPI2C_SCFGR1_IGNACK(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_IGNACK_SHIFT)) & LPI2C_SCFGR1_IGNACK_MASK) - -#define LPI2C_SCFGR1_HSMEN_MASK (0x2000U) -#define LPI2C_SCFGR1_HSMEN_SHIFT (13U) -/*! HSMEN - HS Mode Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_HSMEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_HSMEN_SHIFT)) & LPI2C_SCFGR1_HSMEN_MASK) - -#define LPI2C_SCFGR1_ADDRCFG_MASK (0x70000U) -#define LPI2C_SCFGR1_ADDRCFG_SHIFT (16U) -/*! ADDRCFG - Address Configuration - * 0b000..Address match 0 (7-bit) - * 0b001..Address match 0 (10-bit) - * 0b010..Address match 0 (7-bit) or address match 1 (7-bit) - * 0b011..Address match 0 (10-bit) or address match 1 (10-bit) - * 0b100..Address match 0 (7-bit) or address match 1 (10-bit) - * 0b101..Address match 0 (10-bit) or address match 1 (7-bit) - * 0b110..From address match 0 (7-bit) to address match 1 (7-bit) - * 0b111..From address match 0 (10-bit) to address match 1 (10-bit) - */ -#define LPI2C_SCFGR1_ADDRCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_ADDRCFG_SHIFT)) & LPI2C_SCFGR1_ADDRCFG_MASK) - -#define LPI2C_SCFGR1_RXALL_MASK (0x1000000U) -#define LPI2C_SCFGR1_RXALL_SHIFT (24U) -/*! RXALL - Receive All - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_RXALL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_RXALL_SHIFT)) & LPI2C_SCFGR1_RXALL_MASK) - -#define LPI2C_SCFGR1_RSCFG_MASK (0x2000000U) -#define LPI2C_SCFGR1_RSCFG_SHIFT (25U) -/*! RSCFG - Repeated Start Configuration - * 0b0..Any repeated Start condition following an address match - * 0b1..Any repeated Start condition - */ -#define LPI2C_SCFGR1_RSCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_RSCFG_SHIFT)) & LPI2C_SCFGR1_RSCFG_MASK) - -#define LPI2C_SCFGR1_SDCFG_MASK (0x4000000U) -#define LPI2C_SCFGR1_SDCFG_SHIFT (26U) -/*! SDCFG - Stop Detect Configuration - * 0b0..Any Stop condition following an address match - * 0b1..Any Stop condition - */ -#define LPI2C_SCFGR1_SDCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_SDCFG_SHIFT)) & LPI2C_SCFGR1_SDCFG_MASK) -/*! @} */ - -/*! @name SCFGR2 - Target Configuration 2 */ -/*! @{ */ - -#define LPI2C_SCFGR2_CLKHOLD_MASK (0xFU) -#define LPI2C_SCFGR2_CLKHOLD_SHIFT (0U) -/*! CLKHOLD - Clock Hold Time */ -#define LPI2C_SCFGR2_CLKHOLD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR2_CLKHOLD_SHIFT)) & LPI2C_SCFGR2_CLKHOLD_MASK) - -#define LPI2C_SCFGR2_DATAVD_MASK (0x3F00U) -#define LPI2C_SCFGR2_DATAVD_SHIFT (8U) -/*! DATAVD - Data Valid Delay */ -#define LPI2C_SCFGR2_DATAVD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR2_DATAVD_SHIFT)) & LPI2C_SCFGR2_DATAVD_MASK) - -#define LPI2C_SCFGR2_FILTSCL_MASK (0xF0000U) -#define LPI2C_SCFGR2_FILTSCL_SHIFT (16U) -/*! FILTSCL - Glitch Filter SCL */ -#define LPI2C_SCFGR2_FILTSCL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR2_FILTSCL_SHIFT)) & LPI2C_SCFGR2_FILTSCL_MASK) - -#define LPI2C_SCFGR2_FILTSDA_MASK (0xF000000U) -#define LPI2C_SCFGR2_FILTSDA_SHIFT (24U) -/*! FILTSDA - Glitch Filter SDA */ -#define LPI2C_SCFGR2_FILTSDA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR2_FILTSDA_SHIFT)) & LPI2C_SCFGR2_FILTSDA_MASK) -/*! @} */ - -/*! @name SAMR - Target Address Match */ -/*! @{ */ - -#define LPI2C_SAMR_ADDR0_MASK (0x7FEU) -#define LPI2C_SAMR_ADDR0_SHIFT (1U) -/*! ADDR0 - Address 0 Value */ -#define LPI2C_SAMR_ADDR0(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SAMR_ADDR0_SHIFT)) & LPI2C_SAMR_ADDR0_MASK) - -#define LPI2C_SAMR_ADDR1_MASK (0x7FE0000U) -#define LPI2C_SAMR_ADDR1_SHIFT (17U) -/*! ADDR1 - Address 1 Value */ -#define LPI2C_SAMR_ADDR1(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SAMR_ADDR1_SHIFT)) & LPI2C_SAMR_ADDR1_MASK) -/*! @} */ - -/*! @name SASR - Target Address Status */ -/*! @{ */ - -#define LPI2C_SASR_RADDR_MASK (0x7FFU) -#define LPI2C_SASR_RADDR_SHIFT (0U) -/*! RADDR - Received Address */ -#define LPI2C_SASR_RADDR(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SASR_RADDR_SHIFT)) & LPI2C_SASR_RADDR_MASK) - -#define LPI2C_SASR_ANV_MASK (0x4000U) -#define LPI2C_SASR_ANV_SHIFT (14U) -/*! ANV - Address Not Valid - * 0b0..Valid - * 0b1..Not valid - */ -#define LPI2C_SASR_ANV(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SASR_ANV_SHIFT)) & LPI2C_SASR_ANV_MASK) -/*! @} */ - -/*! @name STAR - Target Transmit ACK */ -/*! @{ */ - -#define LPI2C_STAR_TXNACK_MASK (0x1U) -#define LPI2C_STAR_TXNACK_SHIFT (0U) -/*! TXNACK - Transmit NACK - * 0b0..Transmit ACK - * 0b1..Transmit NACK - */ -#define LPI2C_STAR_TXNACK(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_STAR_TXNACK_SHIFT)) & LPI2C_STAR_TXNACK_MASK) -/*! @} */ - -/*! @name STDR - Target Transmit Data */ -/*! @{ */ - -#define LPI2C_STDR_DATA_MASK (0xFFU) -#define LPI2C_STDR_DATA_SHIFT (0U) -/*! DATA - Transmit Data */ -#define LPI2C_STDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_STDR_DATA_SHIFT)) & LPI2C_STDR_DATA_MASK) -/*! @} */ - -/*! @name SRDR - Target Receive Data */ -/*! @{ */ - -#define LPI2C_SRDR_DATA_MASK (0xFFU) -#define LPI2C_SRDR_DATA_SHIFT (0U) -/*! DATA - Received Data */ -#define LPI2C_SRDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDR_DATA_SHIFT)) & LPI2C_SRDR_DATA_MASK) - -#define LPI2C_SRDR_RADDR_MASK (0x700U) -#define LPI2C_SRDR_RADDR_SHIFT (8U) -/*! RADDR - Received Address */ -#define LPI2C_SRDR_RADDR(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDR_RADDR_SHIFT)) & LPI2C_SRDR_RADDR_MASK) - -#define LPI2C_SRDR_RXEMPTY_MASK (0x4000U) -#define LPI2C_SRDR_RXEMPTY_SHIFT (14U) -/*! RXEMPTY - Receive Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPI2C_SRDR_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDR_RXEMPTY_SHIFT)) & LPI2C_SRDR_RXEMPTY_MASK) - -#define LPI2C_SRDR_SOF_MASK (0x8000U) -#define LPI2C_SRDR_SOF_SHIFT (15U) -/*! SOF - Start of Frame - * 0b0..Not first - * 0b1..First - */ -#define LPI2C_SRDR_SOF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDR_SOF_SHIFT)) & LPI2C_SRDR_SOF_MASK) -/*! @} */ - -/*! @name SRDROR - Target Receive Data Read Only */ -/*! @{ */ - -#define LPI2C_SRDROR_DATA_MASK (0xFFU) -#define LPI2C_SRDROR_DATA_SHIFT (0U) -/*! DATA - Receive Data */ -#define LPI2C_SRDROR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDROR_DATA_SHIFT)) & LPI2C_SRDROR_DATA_MASK) - -#define LPI2C_SRDROR_RADDR_MASK (0x700U) -#define LPI2C_SRDROR_RADDR_SHIFT (8U) -/*! RADDR - Received Address */ -#define LPI2C_SRDROR_RADDR(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDROR_RADDR_SHIFT)) & LPI2C_SRDROR_RADDR_MASK) - -#define LPI2C_SRDROR_RXEMPTY_MASK (0x4000U) -#define LPI2C_SRDROR_RXEMPTY_SHIFT (14U) -/*! RXEMPTY - Receive Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPI2C_SRDROR_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDROR_RXEMPTY_SHIFT)) & LPI2C_SRDROR_RXEMPTY_MASK) - -#define LPI2C_SRDROR_SOF_MASK (0x8000U) -#define LPI2C_SRDROR_SOF_SHIFT (15U) -/*! SOF - Start of Frame - * 0b0..Not the first - * 0b1..First - */ -#define LPI2C_SRDROR_SOF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDROR_SOF_SHIFT)) & LPI2C_SRDROR_SOF_MASK) -/*! @} */ - -/*! @name MTCBR - Controller Transmit Command Burst */ -/*! @{ */ - -#define LPI2C_MTCBR_DATA_MASK (0xFFU) -#define LPI2C_MTCBR_DATA_SHIFT (0U) -/*! DATA - Data */ -#define LPI2C_MTCBR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MTCBR_DATA_SHIFT)) & LPI2C_MTCBR_DATA_MASK) - -#define LPI2C_MTCBR_CMD_MASK (0x700U) -#define LPI2C_MTCBR_CMD_SHIFT (8U) -/*! CMD - Command */ -#define LPI2C_MTCBR_CMD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MTCBR_CMD_SHIFT)) & LPI2C_MTCBR_CMD_MASK) -/*! @} */ - -/* The count of LPI2C_MTCBR */ -#define LPI2C_MTCBR_COUNT (128U) - -/*! @name MTDBR - Transmit Data Burst */ -/*! @{ */ - -#define LPI2C_MTDBR_DATA0_MASK (0xFFU) -#define LPI2C_MTDBR_DATA0_SHIFT (0U) -/*! DATA0 - Data */ -#define LPI2C_MTDBR_DATA0(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MTDBR_DATA0_SHIFT)) & LPI2C_MTDBR_DATA0_MASK) - -#define LPI2C_MTDBR_DATA1_MASK (0xFF00U) -#define LPI2C_MTDBR_DATA1_SHIFT (8U) -/*! DATA1 - Data */ -#define LPI2C_MTDBR_DATA1(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MTDBR_DATA1_SHIFT)) & LPI2C_MTDBR_DATA1_MASK) - -#define LPI2C_MTDBR_DATA2_MASK (0xFF0000U) -#define LPI2C_MTDBR_DATA2_SHIFT (16U) -/*! DATA2 - Data */ -#define LPI2C_MTDBR_DATA2(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MTDBR_DATA2_SHIFT)) & LPI2C_MTDBR_DATA2_MASK) - -#define LPI2C_MTDBR_DATA3_MASK (0xFF000000U) -#define LPI2C_MTDBR_DATA3_SHIFT (24U) -/*! DATA3 - Data */ -#define LPI2C_MTDBR_DATA3(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MTDBR_DATA3_SHIFT)) & LPI2C_MTDBR_DATA3_MASK) -/*! @} */ - -/* The count of LPI2C_MTDBR */ -#define LPI2C_MTDBR_COUNT (253U) - - -/*! - * @} - */ /* end of group LPI2C_Register_Masks */ - - -/* LPI2C - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral LPI2C0 base address */ - #define LPI2C0_BASE (0x50092800u) - /** Peripheral LPI2C0 base address */ - #define LPI2C0_BASE_NS (0x40092800u) - /** Peripheral LPI2C0 base pointer */ - #define LPI2C0 ((LPI2C_Type *)LPI2C0_BASE) - /** Peripheral LPI2C0 base pointer */ - #define LPI2C0_NS ((LPI2C_Type *)LPI2C0_BASE_NS) - /** Peripheral LPI2C1 base address */ - #define LPI2C1_BASE (0x50093800u) - /** Peripheral LPI2C1 base address */ - #define LPI2C1_BASE_NS (0x40093800u) - /** Peripheral LPI2C1 base pointer */ - #define LPI2C1 ((LPI2C_Type *)LPI2C1_BASE) - /** Peripheral LPI2C1 base pointer */ - #define LPI2C1_NS ((LPI2C_Type *)LPI2C1_BASE_NS) - /** Peripheral LPI2C2 base address */ - #define LPI2C2_BASE (0x50094800u) - /** Peripheral LPI2C2 base address */ - #define LPI2C2_BASE_NS (0x40094800u) - /** Peripheral LPI2C2 base pointer */ - #define LPI2C2 ((LPI2C_Type *)LPI2C2_BASE) - /** Peripheral LPI2C2 base pointer */ - #define LPI2C2_NS ((LPI2C_Type *)LPI2C2_BASE_NS) - /** Peripheral LPI2C3 base address */ - #define LPI2C3_BASE (0x50095800u) - /** Peripheral LPI2C3 base address */ - #define LPI2C3_BASE_NS (0x40095800u) - /** Peripheral LPI2C3 base pointer */ - #define LPI2C3 ((LPI2C_Type *)LPI2C3_BASE) - /** Peripheral LPI2C3 base pointer */ - #define LPI2C3_NS ((LPI2C_Type *)LPI2C3_BASE_NS) - /** Peripheral LPI2C4 base address */ - #define LPI2C4_BASE (0x500B4800u) - /** Peripheral LPI2C4 base address */ - #define LPI2C4_BASE_NS (0x400B4800u) - /** Peripheral LPI2C4 base pointer */ - #define LPI2C4 ((LPI2C_Type *)LPI2C4_BASE) - /** Peripheral LPI2C4 base pointer */ - #define LPI2C4_NS ((LPI2C_Type *)LPI2C4_BASE_NS) - /** Peripheral LPI2C5 base address */ - #define LPI2C5_BASE (0x500B5800u) - /** Peripheral LPI2C5 base address */ - #define LPI2C5_BASE_NS (0x400B5800u) - /** Peripheral LPI2C5 base pointer */ - #define LPI2C5 ((LPI2C_Type *)LPI2C5_BASE) - /** Peripheral LPI2C5 base pointer */ - #define LPI2C5_NS ((LPI2C_Type *)LPI2C5_BASE_NS) - /** Peripheral LPI2C6 base address */ - #define LPI2C6_BASE (0x500B6800u) - /** Peripheral LPI2C6 base address */ - #define LPI2C6_BASE_NS (0x400B6800u) - /** Peripheral LPI2C6 base pointer */ - #define LPI2C6 ((LPI2C_Type *)LPI2C6_BASE) - /** Peripheral LPI2C6 base pointer */ - #define LPI2C6_NS ((LPI2C_Type *)LPI2C6_BASE_NS) - /** Peripheral LPI2C7 base address */ - #define LPI2C7_BASE (0x500B7800u) - /** Peripheral LPI2C7 base address */ - #define LPI2C7_BASE_NS (0x400B7800u) - /** Peripheral LPI2C7 base pointer */ - #define LPI2C7 ((LPI2C_Type *)LPI2C7_BASE) - /** Peripheral LPI2C7 base pointer */ - #define LPI2C7_NS ((LPI2C_Type *)LPI2C7_BASE_NS) - /** Array initializer of LPI2C peripheral base addresses */ - #define LPI2C_BASE_ADDRS { LPI2C0_BASE, LPI2C1_BASE, LPI2C2_BASE, LPI2C3_BASE, LPI2C4_BASE, LPI2C5_BASE, LPI2C6_BASE, LPI2C7_BASE } - /** Array initializer of LPI2C peripheral base pointers */ - #define LPI2C_BASE_PTRS { LPI2C0, LPI2C1, LPI2C2, LPI2C3, LPI2C4, LPI2C5, LPI2C6, LPI2C7 } - /** Array initializer of LPI2C peripheral base addresses */ - #define LPI2C_BASE_ADDRS_NS { LPI2C0_BASE_NS, LPI2C1_BASE_NS, LPI2C2_BASE_NS, LPI2C3_BASE_NS, LPI2C4_BASE_NS, LPI2C5_BASE_NS, LPI2C6_BASE_NS, LPI2C7_BASE_NS } - /** Array initializer of LPI2C peripheral base pointers */ - #define LPI2C_BASE_PTRS_NS { LPI2C0_NS, LPI2C1_NS, LPI2C2_NS, LPI2C3_NS, LPI2C4_NS, LPI2C5_NS, LPI2C6_NS, LPI2C7_NS } -#else - /** Peripheral LPI2C0 base address */ - #define LPI2C0_BASE (0x40092800u) - /** Peripheral LPI2C0 base pointer */ - #define LPI2C0 ((LPI2C_Type *)LPI2C0_BASE) - /** Peripheral LPI2C1 base address */ - #define LPI2C1_BASE (0x40093800u) - /** Peripheral LPI2C1 base pointer */ - #define LPI2C1 ((LPI2C_Type *)LPI2C1_BASE) - /** Peripheral LPI2C2 base address */ - #define LPI2C2_BASE (0x40094800u) - /** Peripheral LPI2C2 base pointer */ - #define LPI2C2 ((LPI2C_Type *)LPI2C2_BASE) - /** Peripheral LPI2C3 base address */ - #define LPI2C3_BASE (0x40095800u) - /** Peripheral LPI2C3 base pointer */ - #define LPI2C3 ((LPI2C_Type *)LPI2C3_BASE) - /** Peripheral LPI2C4 base address */ - #define LPI2C4_BASE (0x400B4800u) - /** Peripheral LPI2C4 base pointer */ - #define LPI2C4 ((LPI2C_Type *)LPI2C4_BASE) - /** Peripheral LPI2C5 base address */ - #define LPI2C5_BASE (0x400B5800u) - /** Peripheral LPI2C5 base pointer */ - #define LPI2C5 ((LPI2C_Type *)LPI2C5_BASE) - /** Peripheral LPI2C6 base address */ - #define LPI2C6_BASE (0x400B6800u) - /** Peripheral LPI2C6 base pointer */ - #define LPI2C6 ((LPI2C_Type *)LPI2C6_BASE) - /** Peripheral LPI2C7 base address */ - #define LPI2C7_BASE (0x400B7800u) - /** Peripheral LPI2C7 base pointer */ - #define LPI2C7 ((LPI2C_Type *)LPI2C7_BASE) - /** Array initializer of LPI2C peripheral base addresses */ - #define LPI2C_BASE_ADDRS { LPI2C0_BASE, LPI2C1_BASE, LPI2C2_BASE, LPI2C3_BASE, LPI2C4_BASE, LPI2C5_BASE, LPI2C6_BASE, LPI2C7_BASE } - /** Array initializer of LPI2C peripheral base pointers */ - #define LPI2C_BASE_PTRS { LPI2C0, LPI2C1, LPI2C2, LPI2C3, LPI2C4, LPI2C5, LPI2C6, LPI2C7 } -#endif -/** Interrupt vectors for the LPI2C peripheral type */ -#define LPI2C_IRQS { LP_FLEXCOMM0_IRQn, LP_FLEXCOMM1_IRQn, LP_FLEXCOMM2_IRQn, LP_FLEXCOMM3_IRQn, LP_FLEXCOMM4_IRQn, LP_FLEXCOMM5_IRQn, LP_FLEXCOMM6_IRQn, LP_FLEXCOMM7_IRQn } - -/*! - * @} - */ /* end of group LPI2C_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LPSPI Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPSPI_Peripheral_Access_Layer LPSPI Peripheral Access Layer - * @{ - */ - -/** LPSPI - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - uint8_t RESERVED_0[8]; - __IO uint32_t CR; /**< Control, offset: 0x10 */ - __IO uint32_t SR; /**< Status, offset: 0x14 */ - __IO uint32_t IER; /**< Interrupt Enable, offset: 0x18 */ - __IO uint32_t DER; /**< DMA Enable, offset: 0x1C */ - __IO uint32_t CFGR0; /**< Configuration 0, offset: 0x20 */ - __IO uint32_t CFGR1; /**< Configuration 1, offset: 0x24 */ - uint8_t RESERVED_1[8]; - __IO uint32_t DMR0; /**< Data Match 0, offset: 0x30 */ - __IO uint32_t DMR1; /**< Data Match 1, offset: 0x34 */ - uint8_t RESERVED_2[8]; - __IO uint32_t CCR; /**< Clock Configuration, offset: 0x40 */ - __IO uint32_t CCR1; /**< Clock Configuration 1, offset: 0x44 */ - uint8_t RESERVED_3[16]; - __IO uint32_t FCR; /**< FIFO Control, offset: 0x58 */ - __I uint32_t FSR; /**< FIFO Status, offset: 0x5C */ - __IO uint32_t TCR; /**< Transmit Command, offset: 0x60 */ - __O uint32_t TDR; /**< Transmit Data, offset: 0x64 */ - uint8_t RESERVED_4[8]; - __I uint32_t RSR; /**< Receive Status, offset: 0x70 */ - __I uint32_t RDR; /**< Receive Data, offset: 0x74 */ - __I uint32_t RDROR; /**< Receive Data Read Only, offset: 0x78 */ - uint8_t RESERVED_5[896]; - __O uint32_t TCBR; /**< Transmit Command Burst, offset: 0x3FC */ - __O uint32_t TDBR[128]; /**< Transmit Data Burst, array offset: 0x400, array step: 0x4 */ - __I uint32_t RDBR[128]; /**< Receive Data Burst, array offset: 0x600, array step: 0x4 */ -} LPSPI_Type; - -/* ---------------------------------------------------------------------------- - -- LPSPI Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPSPI_Register_Masks LPSPI Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define LPSPI_VERID_FEATURE_MASK (0xFFFFU) -#define LPSPI_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Module Identification Number - * 0b0000000000000100..Standard feature set supporting a 32-bit shift register. - * *.. - */ -#define LPSPI_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_VERID_FEATURE_SHIFT)) & LPSPI_VERID_FEATURE_MASK) - -#define LPSPI_VERID_MINOR_MASK (0xFF0000U) -#define LPSPI_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define LPSPI_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_VERID_MINOR_SHIFT)) & LPSPI_VERID_MINOR_MASK) - -#define LPSPI_VERID_MAJOR_MASK (0xFF000000U) -#define LPSPI_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define LPSPI_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_VERID_MAJOR_SHIFT)) & LPSPI_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define LPSPI_PARAM_TXFIFO_MASK (0xFFU) -#define LPSPI_PARAM_TXFIFO_SHIFT (0U) -/*! TXFIFO - Transmit FIFO Size */ -#define LPSPI_PARAM_TXFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_PARAM_TXFIFO_SHIFT)) & LPSPI_PARAM_TXFIFO_MASK) - -#define LPSPI_PARAM_RXFIFO_MASK (0xFF00U) -#define LPSPI_PARAM_RXFIFO_SHIFT (8U) -/*! RXFIFO - Receive FIFO Size */ -#define LPSPI_PARAM_RXFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_PARAM_RXFIFO_SHIFT)) & LPSPI_PARAM_RXFIFO_MASK) - -#define LPSPI_PARAM_PCSNUM_MASK (0xFF0000U) -#define LPSPI_PARAM_PCSNUM_SHIFT (16U) -/*! PCSNUM - PCS Number */ -#define LPSPI_PARAM_PCSNUM(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_PARAM_PCSNUM_SHIFT)) & LPSPI_PARAM_PCSNUM_MASK) -/*! @} */ - -/*! @name CR - Control */ -/*! @{ */ - -#define LPSPI_CR_MEN_MASK (0x1U) -#define LPSPI_CR_MEN_SHIFT (0U) -/*! MEN - Module Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CR_MEN(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CR_MEN_SHIFT)) & LPSPI_CR_MEN_MASK) - -#define LPSPI_CR_RST_MASK (0x2U) -#define LPSPI_CR_RST_SHIFT (1U) -/*! RST - Software Reset - * 0b0..Not reset - * 0b1..Reset - */ -#define LPSPI_CR_RST(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CR_RST_SHIFT)) & LPSPI_CR_RST_MASK) - -#define LPSPI_CR_DBGEN_MASK (0x8U) -#define LPSPI_CR_DBGEN_SHIFT (3U) -/*! DBGEN - Debug Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CR_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CR_DBGEN_SHIFT)) & LPSPI_CR_DBGEN_MASK) - -#define LPSPI_CR_RTF_MASK (0x100U) -#define LPSPI_CR_RTF_SHIFT (8U) -/*! RTF - Reset Transmit FIFO - * 0b0..No effect - * 0b1..Reset - */ -#define LPSPI_CR_RTF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CR_RTF_SHIFT)) & LPSPI_CR_RTF_MASK) - -#define LPSPI_CR_RRF_MASK (0x200U) -#define LPSPI_CR_RRF_SHIFT (9U) -/*! RRF - Reset Receive FIFO - * 0b0..No effect - * 0b1..Reset - */ -#define LPSPI_CR_RRF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CR_RRF_SHIFT)) & LPSPI_CR_RRF_MASK) -/*! @} */ - -/*! @name SR - Status */ -/*! @{ */ - -#define LPSPI_SR_TDF_MASK (0x1U) -#define LPSPI_SR_TDF_SHIFT (0U) -/*! TDF - Transmit Data Flag - * 0b0..Transmit data not requested - * 0b1..Transmit data requested - */ -#define LPSPI_SR_TDF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_TDF_SHIFT)) & LPSPI_SR_TDF_MASK) - -#define LPSPI_SR_RDF_MASK (0x2U) -#define LPSPI_SR_RDF_SHIFT (1U) -/*! RDF - Receive Data Flag - * 0b0..Receive data not ready - * 0b1..Receive data ready - */ -#define LPSPI_SR_RDF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_RDF_SHIFT)) & LPSPI_SR_RDF_MASK) - -#define LPSPI_SR_WCF_MASK (0x100U) -#define LPSPI_SR_WCF_SHIFT (8U) -/*! WCF - Word Complete Flag - * 0b0..Not complete - * 0b1..Complete - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPSPI_SR_WCF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_WCF_SHIFT)) & LPSPI_SR_WCF_MASK) - -#define LPSPI_SR_FCF_MASK (0x200U) -#define LPSPI_SR_FCF_SHIFT (9U) -/*! FCF - Frame Complete Flag - * 0b0..Not complete - * 0b1..Complete - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPSPI_SR_FCF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_FCF_SHIFT)) & LPSPI_SR_FCF_MASK) - -#define LPSPI_SR_TCF_MASK (0x400U) -#define LPSPI_SR_TCF_SHIFT (10U) -/*! TCF - Transfer Complete Flag - * 0b0..Not complete - * 0b1..Complete - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPSPI_SR_TCF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_TCF_SHIFT)) & LPSPI_SR_TCF_MASK) - -#define LPSPI_SR_TEF_MASK (0x800U) -#define LPSPI_SR_TEF_SHIFT (11U) -/*! TEF - Transmit Error Flag - * 0b0..No underrun - * 0b1..Underrun - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPSPI_SR_TEF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_TEF_SHIFT)) & LPSPI_SR_TEF_MASK) - -#define LPSPI_SR_REF_MASK (0x1000U) -#define LPSPI_SR_REF_SHIFT (12U) -/*! REF - Receive Error Flag - * 0b0..No overflow - * 0b1..Overflow - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPSPI_SR_REF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_REF_SHIFT)) & LPSPI_SR_REF_MASK) - -#define LPSPI_SR_DMF_MASK (0x2000U) -#define LPSPI_SR_DMF_SHIFT (13U) -/*! DMF - Data Match Flag - * 0b0..No match - * 0b1..Match - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPSPI_SR_DMF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_DMF_SHIFT)) & LPSPI_SR_DMF_MASK) - -#define LPSPI_SR_MBF_MASK (0x1000000U) -#define LPSPI_SR_MBF_SHIFT (24U) -/*! MBF - Module Busy Flag - * 0b0..LPSPI is idle - * 0b1..LPSPI is busy - */ -#define LPSPI_SR_MBF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_MBF_SHIFT)) & LPSPI_SR_MBF_MASK) -/*! @} */ - -/*! @name IER - Interrupt Enable */ -/*! @{ */ - -#define LPSPI_IER_TDIE_MASK (0x1U) -#define LPSPI_IER_TDIE_SHIFT (0U) -/*! TDIE - Transmit Data Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_TDIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_TDIE_SHIFT)) & LPSPI_IER_TDIE_MASK) - -#define LPSPI_IER_RDIE_MASK (0x2U) -#define LPSPI_IER_RDIE_SHIFT (1U) -/*! RDIE - Receive Data Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_RDIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_RDIE_SHIFT)) & LPSPI_IER_RDIE_MASK) - -#define LPSPI_IER_WCIE_MASK (0x100U) -#define LPSPI_IER_WCIE_SHIFT (8U) -/*! WCIE - Word Complete Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_WCIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_WCIE_SHIFT)) & LPSPI_IER_WCIE_MASK) - -#define LPSPI_IER_FCIE_MASK (0x200U) -#define LPSPI_IER_FCIE_SHIFT (9U) -/*! FCIE - Frame Complete Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_FCIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_FCIE_SHIFT)) & LPSPI_IER_FCIE_MASK) - -#define LPSPI_IER_TCIE_MASK (0x400U) -#define LPSPI_IER_TCIE_SHIFT (10U) -/*! TCIE - Transfer Complete Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_TCIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_TCIE_SHIFT)) & LPSPI_IER_TCIE_MASK) - -#define LPSPI_IER_TEIE_MASK (0x800U) -#define LPSPI_IER_TEIE_SHIFT (11U) -/*! TEIE - Transmit Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_TEIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_TEIE_SHIFT)) & LPSPI_IER_TEIE_MASK) - -#define LPSPI_IER_REIE_MASK (0x1000U) -#define LPSPI_IER_REIE_SHIFT (12U) -/*! REIE - Receive Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_REIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_REIE_SHIFT)) & LPSPI_IER_REIE_MASK) - -#define LPSPI_IER_DMIE_MASK (0x2000U) -#define LPSPI_IER_DMIE_SHIFT (13U) -/*! DMIE - Data Match Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_DMIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_DMIE_SHIFT)) & LPSPI_IER_DMIE_MASK) -/*! @} */ - -/*! @name DER - DMA Enable */ -/*! @{ */ - -#define LPSPI_DER_TDDE_MASK (0x1U) -#define LPSPI_DER_TDDE_SHIFT (0U) -/*! TDDE - Transmit Data DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_DER_TDDE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_DER_TDDE_SHIFT)) & LPSPI_DER_TDDE_MASK) - -#define LPSPI_DER_RDDE_MASK (0x2U) -#define LPSPI_DER_RDDE_SHIFT (1U) -/*! RDDE - Receive Data DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_DER_RDDE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_DER_RDDE_SHIFT)) & LPSPI_DER_RDDE_MASK) - -#define LPSPI_DER_FCDE_MASK (0x200U) -#define LPSPI_DER_FCDE_SHIFT (9U) -/*! FCDE - Frame Complete DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_DER_FCDE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_DER_FCDE_SHIFT)) & LPSPI_DER_FCDE_MASK) -/*! @} */ - -/*! @name CFGR0 - Configuration 0 */ -/*! @{ */ - -#define LPSPI_CFGR0_HREN_MASK (0x1U) -#define LPSPI_CFGR0_HREN_SHIFT (0U) -/*! HREN - Host Request Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CFGR0_HREN(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR0_HREN_SHIFT)) & LPSPI_CFGR0_HREN_MASK) - -#define LPSPI_CFGR0_HRPOL_MASK (0x2U) -#define LPSPI_CFGR0_HRPOL_SHIFT (1U) -/*! HRPOL - Host Request Polarity - * 0b0..Active high - * 0b1..Active low - */ -#define LPSPI_CFGR0_HRPOL(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR0_HRPOL_SHIFT)) & LPSPI_CFGR0_HRPOL_MASK) - -#define LPSPI_CFGR0_HRSEL_MASK (0x4U) -#define LPSPI_CFGR0_HRSEL_SHIFT (2U) -/*! HRSEL - Host Request Select - * 0b0..HREQ pin - * 0b1..Input trigger - */ -#define LPSPI_CFGR0_HRSEL(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR0_HRSEL_SHIFT)) & LPSPI_CFGR0_HRSEL_MASK) - -#define LPSPI_CFGR0_HRDIR_MASK (0x8U) -#define LPSPI_CFGR0_HRDIR_SHIFT (3U) -/*! HRDIR - Host Request Direction - * 0b0..Input - * 0b1..Output - */ -#define LPSPI_CFGR0_HRDIR(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR0_HRDIR_SHIFT)) & LPSPI_CFGR0_HRDIR_MASK) - -#define LPSPI_CFGR0_CIRFIFO_MASK (0x100U) -#define LPSPI_CFGR0_CIRFIFO_SHIFT (8U) -/*! CIRFIFO - Circular FIFO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CFGR0_CIRFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR0_CIRFIFO_SHIFT)) & LPSPI_CFGR0_CIRFIFO_MASK) - -#define LPSPI_CFGR0_RDMO_MASK (0x200U) -#define LPSPI_CFGR0_RDMO_SHIFT (9U) -/*! RDMO - Receive Data Match Only - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CFGR0_RDMO(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR0_RDMO_SHIFT)) & LPSPI_CFGR0_RDMO_MASK) -/*! @} */ - -/*! @name CFGR1 - Configuration 1 */ -/*! @{ */ - -#define LPSPI_CFGR1_MASTER_MASK (0x1U) -#define LPSPI_CFGR1_MASTER_SHIFT (0U) -/*! MASTER - Master Mode - * 0b0..Slave mode - * 0b1..Master mode - */ -#define LPSPI_CFGR1_MASTER(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_MASTER_SHIFT)) & LPSPI_CFGR1_MASTER_MASK) - -#define LPSPI_CFGR1_SAMPLE_MASK (0x2U) -#define LPSPI_CFGR1_SAMPLE_SHIFT (1U) -/*! SAMPLE - Sample Point - * 0b0..SCK edge - * 0b1..Delayed SCK edge - */ -#define LPSPI_CFGR1_SAMPLE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_SAMPLE_SHIFT)) & LPSPI_CFGR1_SAMPLE_MASK) - -#define LPSPI_CFGR1_AUTOPCS_MASK (0x4U) -#define LPSPI_CFGR1_AUTOPCS_SHIFT (2U) -/*! AUTOPCS - Automatic PCS - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CFGR1_AUTOPCS(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_AUTOPCS_SHIFT)) & LPSPI_CFGR1_AUTOPCS_MASK) - -#define LPSPI_CFGR1_NOSTALL_MASK (0x8U) -#define LPSPI_CFGR1_NOSTALL_SHIFT (3U) -/*! NOSTALL - No Stall - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CFGR1_NOSTALL(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_NOSTALL_SHIFT)) & LPSPI_CFGR1_NOSTALL_MASK) - -#define LPSPI_CFGR1_PARTIAL_MASK (0x10U) -#define LPSPI_CFGR1_PARTIAL_SHIFT (4U) -/*! PARTIAL - Partial Enable - * 0b0..Discard - * 0b1..Store - */ -#define LPSPI_CFGR1_PARTIAL(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_PARTIAL_SHIFT)) & LPSPI_CFGR1_PARTIAL_MASK) - -#define LPSPI_CFGR1_PCSPOL_MASK (0xF00U) -#define LPSPI_CFGR1_PCSPOL_SHIFT (8U) -/*! PCSPOL - Peripheral Chip Select Polarity - * 0b0000..Active low - * 0b0001..Active high - */ -#define LPSPI_CFGR1_PCSPOL(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_PCSPOL_SHIFT)) & LPSPI_CFGR1_PCSPOL_MASK) - -#define LPSPI_CFGR1_MATCFG_MASK (0x70000U) -#define LPSPI_CFGR1_MATCFG_SHIFT (16U) -/*! MATCFG - Match Configuration - * 0b000..Match is disabled - * 0b001.. - * 0b010..Match first data word with compare word - * 0b011..Match any data word with compare word - * 0b100..Sequential match, first data word - * 0b101..Sequential match, any data word - * 0b110..Match first data word (masked) with compare word (masked) - * 0b111..Match any data word (masked) with compare word (masked) - */ -#define LPSPI_CFGR1_MATCFG(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_MATCFG_SHIFT)) & LPSPI_CFGR1_MATCFG_MASK) - -#define LPSPI_CFGR1_PINCFG_MASK (0x3000000U) -#define LPSPI_CFGR1_PINCFG_SHIFT (24U) -/*! PINCFG - Pin Configuration - * 0b00..SIN is used for input data; SOUT is used for output data - * 0b01..SIN is used for both input and output data; only half-duplex serial transfers are supported - * 0b10..SOUT is used for both input and output data; only half-duplex serial transfers are supported - * 0b11..SOUT is used for input data; SIN is used for output data - */ -#define LPSPI_CFGR1_PINCFG(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_PINCFG_SHIFT)) & LPSPI_CFGR1_PINCFG_MASK) - -#define LPSPI_CFGR1_OUTCFG_MASK (0x4000000U) -#define LPSPI_CFGR1_OUTCFG_SHIFT (26U) -/*! OUTCFG - Output Configuration - * 0b0..Retain last value - * 0b1..3-stated - */ -#define LPSPI_CFGR1_OUTCFG(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_OUTCFG_SHIFT)) & LPSPI_CFGR1_OUTCFG_MASK) - -#define LPSPI_CFGR1_PCSCFG_MASK (0x8000000U) -#define LPSPI_CFGR1_PCSCFG_SHIFT (27U) -/*! PCSCFG - Peripheral Chip Select Configuration - * 0b0..PCS[3:2] configured for chip select function - * 0b1..PCS[3:2] configured for half-duplex 4-bit transfers (PCS[3:2] = DATA[3:2]) - */ -#define LPSPI_CFGR1_PCSCFG(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_PCSCFG_SHIFT)) & LPSPI_CFGR1_PCSCFG_MASK) -/*! @} */ - -/*! @name DMR0 - Data Match 0 */ -/*! @{ */ - -#define LPSPI_DMR0_MATCH0_MASK (0xFFFFFFFFU) -#define LPSPI_DMR0_MATCH0_SHIFT (0U) -/*! MATCH0 - Match 0 Value */ -#define LPSPI_DMR0_MATCH0(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_DMR0_MATCH0_SHIFT)) & LPSPI_DMR0_MATCH0_MASK) -/*! @} */ - -/*! @name DMR1 - Data Match 1 */ -/*! @{ */ - -#define LPSPI_DMR1_MATCH1_MASK (0xFFFFFFFFU) -#define LPSPI_DMR1_MATCH1_SHIFT (0U) -/*! MATCH1 - Match 1 Value */ -#define LPSPI_DMR1_MATCH1(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_DMR1_MATCH1_SHIFT)) & LPSPI_DMR1_MATCH1_MASK) -/*! @} */ - -/*! @name CCR - Clock Configuration */ -/*! @{ */ - -#define LPSPI_CCR_SCKDIV_MASK (0xFFU) -#define LPSPI_CCR_SCKDIV_SHIFT (0U) -/*! SCKDIV - SCK Divider */ -#define LPSPI_CCR_SCKDIV(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR_SCKDIV_SHIFT)) & LPSPI_CCR_SCKDIV_MASK) - -#define LPSPI_CCR_DBT_MASK (0xFF00U) -#define LPSPI_CCR_DBT_SHIFT (8U) -/*! DBT - Delay Between Transfers */ -#define LPSPI_CCR_DBT(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR_DBT_SHIFT)) & LPSPI_CCR_DBT_MASK) - -#define LPSPI_CCR_PCSSCK_MASK (0xFF0000U) -#define LPSPI_CCR_PCSSCK_SHIFT (16U) -/*! PCSSCK - PCS-to-SCK Delay */ -#define LPSPI_CCR_PCSSCK(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR_PCSSCK_SHIFT)) & LPSPI_CCR_PCSSCK_MASK) - -#define LPSPI_CCR_SCKPCS_MASK (0xFF000000U) -#define LPSPI_CCR_SCKPCS_SHIFT (24U) -/*! SCKPCS - SCK-to-PCS Delay */ -#define LPSPI_CCR_SCKPCS(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR_SCKPCS_SHIFT)) & LPSPI_CCR_SCKPCS_MASK) -/*! @} */ - -/*! @name CCR1 - Clock Configuration 1 */ -/*! @{ */ - -#define LPSPI_CCR1_SCKSET_MASK (0xFFU) -#define LPSPI_CCR1_SCKSET_SHIFT (0U) -/*! SCKSET - SCK Setup */ -#define LPSPI_CCR1_SCKSET(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR1_SCKSET_SHIFT)) & LPSPI_CCR1_SCKSET_MASK) - -#define LPSPI_CCR1_SCKHLD_MASK (0xFF00U) -#define LPSPI_CCR1_SCKHLD_SHIFT (8U) -/*! SCKHLD - SCK Hold */ -#define LPSPI_CCR1_SCKHLD(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR1_SCKHLD_SHIFT)) & LPSPI_CCR1_SCKHLD_MASK) - -#define LPSPI_CCR1_PCSPCS_MASK (0xFF0000U) -#define LPSPI_CCR1_PCSPCS_SHIFT (16U) -/*! PCSPCS - PCS to PCS Delay */ -#define LPSPI_CCR1_PCSPCS(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR1_PCSPCS_SHIFT)) & LPSPI_CCR1_PCSPCS_MASK) - -#define LPSPI_CCR1_SCKSCK_MASK (0xFF000000U) -#define LPSPI_CCR1_SCKSCK_SHIFT (24U) -/*! SCKSCK - SCK Inter-Frame Delay */ -#define LPSPI_CCR1_SCKSCK(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR1_SCKSCK_SHIFT)) & LPSPI_CCR1_SCKSCK_MASK) -/*! @} */ - -/*! @name FCR - FIFO Control */ -/*! @{ */ - -#define LPSPI_FCR_TXWATER_MASK (0x7U) -#define LPSPI_FCR_TXWATER_SHIFT (0U) -/*! TXWATER - Transmit FIFO Watermark */ -#define LPSPI_FCR_TXWATER(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_FCR_TXWATER_SHIFT)) & LPSPI_FCR_TXWATER_MASK) - -#define LPSPI_FCR_RXWATER_MASK (0x70000U) -#define LPSPI_FCR_RXWATER_SHIFT (16U) -/*! RXWATER - Receive FIFO Watermark */ -#define LPSPI_FCR_RXWATER(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_FCR_RXWATER_SHIFT)) & LPSPI_FCR_RXWATER_MASK) -/*! @} */ - -/*! @name FSR - FIFO Status */ -/*! @{ */ - -#define LPSPI_FSR_TXCOUNT_MASK (0xFU) -#define LPSPI_FSR_TXCOUNT_SHIFT (0U) -/*! TXCOUNT - Transmit FIFO Count */ -#define LPSPI_FSR_TXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_FSR_TXCOUNT_SHIFT)) & LPSPI_FSR_TXCOUNT_MASK) - -#define LPSPI_FSR_RXCOUNT_MASK (0xF0000U) -#define LPSPI_FSR_RXCOUNT_SHIFT (16U) -/*! RXCOUNT - Receive FIFO Count */ -#define LPSPI_FSR_RXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_FSR_RXCOUNT_SHIFT)) & LPSPI_FSR_RXCOUNT_MASK) -/*! @} */ - -/*! @name TCR - Transmit Command */ -/*! @{ */ - -#define LPSPI_TCR_FRAMESZ_MASK (0xFFFU) -#define LPSPI_TCR_FRAMESZ_SHIFT (0U) -/*! FRAMESZ - Frame Size */ -#define LPSPI_TCR_FRAMESZ(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_FRAMESZ_SHIFT)) & LPSPI_TCR_FRAMESZ_MASK) - -#define LPSPI_TCR_WIDTH_MASK (0x30000U) -#define LPSPI_TCR_WIDTH_SHIFT (16U) -/*! WIDTH - Transfer Width - * 0b00..1-bit transfer - * 0b01..2-bit transfer - * 0b10..4-bit transfer - * 0b11..Reserved - */ -#define LPSPI_TCR_WIDTH(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_WIDTH_SHIFT)) & LPSPI_TCR_WIDTH_MASK) - -#define LPSPI_TCR_TXMSK_MASK (0x40000U) -#define LPSPI_TCR_TXMSK_SHIFT (18U) -/*! TXMSK - Transmit Data Mask - * 0b0..Normal transfer - * 0b1..Mask transmit data - */ -#define LPSPI_TCR_TXMSK(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_TXMSK_SHIFT)) & LPSPI_TCR_TXMSK_MASK) - -#define LPSPI_TCR_RXMSK_MASK (0x80000U) -#define LPSPI_TCR_RXMSK_SHIFT (19U) -/*! RXMSK - Receive Data Mask - * 0b0..Normal transfer - * 0b1..Mask receive data - */ -#define LPSPI_TCR_RXMSK(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_RXMSK_SHIFT)) & LPSPI_TCR_RXMSK_MASK) - -#define LPSPI_TCR_CONTC_MASK (0x100000U) -#define LPSPI_TCR_CONTC_SHIFT (20U) -/*! CONTC - Continuing Command - * 0b0..Command word for start of new transfer - * 0b1..Command word for continuing transfer - */ -#define LPSPI_TCR_CONTC(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_CONTC_SHIFT)) & LPSPI_TCR_CONTC_MASK) - -#define LPSPI_TCR_CONT_MASK (0x200000U) -#define LPSPI_TCR_CONT_SHIFT (21U) -/*! CONT - Continuous Transfer - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_TCR_CONT(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_CONT_SHIFT)) & LPSPI_TCR_CONT_MASK) - -#define LPSPI_TCR_BYSW_MASK (0x400000U) -#define LPSPI_TCR_BYSW_SHIFT (22U) -/*! BYSW - Byte Swap - * 0b0..Disable byte swap - * 0b1..Enable byte swap - */ -#define LPSPI_TCR_BYSW(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_BYSW_SHIFT)) & LPSPI_TCR_BYSW_MASK) - -#define LPSPI_TCR_LSBF_MASK (0x800000U) -#define LPSPI_TCR_LSBF_SHIFT (23U) -/*! LSBF - LSB First - * 0b0..MSB first - * 0b1..LSB first - */ -#define LPSPI_TCR_LSBF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_LSBF_SHIFT)) & LPSPI_TCR_LSBF_MASK) - -#define LPSPI_TCR_PCS_MASK (0x3000000U) -#define LPSPI_TCR_PCS_SHIFT (24U) -/*! PCS - Peripheral Chip Select - * 0b00..Transfer using PCS[0] - * 0b01..Transfer using PCS[1] - * 0b10..Transfer using PCS[2] - * 0b11..Transfer using PCS[3] - */ -#define LPSPI_TCR_PCS(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_PCS_SHIFT)) & LPSPI_TCR_PCS_MASK) - -#define LPSPI_TCR_PRESCALE_MASK (0x38000000U) -#define LPSPI_TCR_PRESCALE_SHIFT (27U) -/*! PRESCALE - Prescaler Value - * 0b000..Divide by 1 - * 0b001..Divide by 2 - * 0b010..Divide by 4 - * 0b011..Divide by 8 - * 0b100..Divide by 16 - * 0b101..Divide by 32 - * 0b110..Divide by 64 - * 0b111..Divide by 128 - */ -#define LPSPI_TCR_PRESCALE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_PRESCALE_SHIFT)) & LPSPI_TCR_PRESCALE_MASK) - -#define LPSPI_TCR_CPHA_MASK (0x40000000U) -#define LPSPI_TCR_CPHA_SHIFT (30U) -/*! CPHA - Clock Phase - * 0b0..Captured - * 0b1..Changed - */ -#define LPSPI_TCR_CPHA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_CPHA_SHIFT)) & LPSPI_TCR_CPHA_MASK) - -#define LPSPI_TCR_CPOL_MASK (0x80000000U) -#define LPSPI_TCR_CPOL_SHIFT (31U) -/*! CPOL - Clock Polarity - * 0b0..Inactive low - * 0b1..Inactive high - */ -#define LPSPI_TCR_CPOL(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_CPOL_SHIFT)) & LPSPI_TCR_CPOL_MASK) -/*! @} */ - -/*! @name TDR - Transmit Data */ -/*! @{ */ - -#define LPSPI_TDR_DATA_MASK (0xFFFFFFFFU) -#define LPSPI_TDR_DATA_SHIFT (0U) -/*! DATA - Transmit Data */ -#define LPSPI_TDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TDR_DATA_SHIFT)) & LPSPI_TDR_DATA_MASK) -/*! @} */ - -/*! @name RSR - Receive Status */ -/*! @{ */ - -#define LPSPI_RSR_SOF_MASK (0x1U) -#define LPSPI_RSR_SOF_SHIFT (0U) -/*! SOF - Start of Frame - * 0b0..Subsequent data word - * 0b1..First data word - */ -#define LPSPI_RSR_SOF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_RSR_SOF_SHIFT)) & LPSPI_RSR_SOF_MASK) - -#define LPSPI_RSR_RXEMPTY_MASK (0x2U) -#define LPSPI_RSR_RXEMPTY_SHIFT (1U) -/*! RXEMPTY - RX FIFO Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPSPI_RSR_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_RSR_RXEMPTY_SHIFT)) & LPSPI_RSR_RXEMPTY_MASK) -/*! @} */ - -/*! @name RDR - Receive Data */ -/*! @{ */ - -#define LPSPI_RDR_DATA_MASK (0xFFFFFFFFU) -#define LPSPI_RDR_DATA_SHIFT (0U) -/*! DATA - Receive Data */ -#define LPSPI_RDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_RDR_DATA_SHIFT)) & LPSPI_RDR_DATA_MASK) -/*! @} */ - -/*! @name RDROR - Receive Data Read Only */ -/*! @{ */ - -#define LPSPI_RDROR_DATA_MASK (0xFFFFFFFFU) -#define LPSPI_RDROR_DATA_SHIFT (0U) -/*! DATA - Receive Data */ -#define LPSPI_RDROR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_RDROR_DATA_SHIFT)) & LPSPI_RDROR_DATA_MASK) -/*! @} */ - -/*! @name TCBR - Transmit Command Burst */ -/*! @{ */ - -#define LPSPI_TCBR_DATA_MASK (0xFFFFFFFFU) -#define LPSPI_TCBR_DATA_SHIFT (0U) -/*! DATA - Command Data */ -#define LPSPI_TCBR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCBR_DATA_SHIFT)) & LPSPI_TCBR_DATA_MASK) -/*! @} */ - -/*! @name TDBR - Transmit Data Burst */ -/*! @{ */ - -#define LPSPI_TDBR_DATA_MASK (0xFFFFFFFFU) -#define LPSPI_TDBR_DATA_SHIFT (0U) -/*! DATA - Data */ -#define LPSPI_TDBR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TDBR_DATA_SHIFT)) & LPSPI_TDBR_DATA_MASK) -/*! @} */ - -/* The count of LPSPI_TDBR */ -#define LPSPI_TDBR_COUNT (128U) - -/*! @name RDBR - Receive Data Burst */ -/*! @{ */ - -#define LPSPI_RDBR_DATA_MASK (0xFFFFFFFFU) -#define LPSPI_RDBR_DATA_SHIFT (0U) -/*! DATA - Data */ -#define LPSPI_RDBR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_RDBR_DATA_SHIFT)) & LPSPI_RDBR_DATA_MASK) -/*! @} */ - -/* The count of LPSPI_RDBR */ -#define LPSPI_RDBR_COUNT (128U) - - -/*! - * @} - */ /* end of group LPSPI_Register_Masks */ - - -/* LPSPI - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral LPSPI0 base address */ - #define LPSPI0_BASE (0x50092000u) - /** Peripheral LPSPI0 base address */ - #define LPSPI0_BASE_NS (0x40092000u) - /** Peripheral LPSPI0 base pointer */ - #define LPSPI0 ((LPSPI_Type *)LPSPI0_BASE) - /** Peripheral LPSPI0 base pointer */ - #define LPSPI0_NS ((LPSPI_Type *)LPSPI0_BASE_NS) - /** Peripheral LPSPI1 base address */ - #define LPSPI1_BASE (0x50093000u) - /** Peripheral LPSPI1 base address */ - #define LPSPI1_BASE_NS (0x40093000u) - /** Peripheral LPSPI1 base pointer */ - #define LPSPI1 ((LPSPI_Type *)LPSPI1_BASE) - /** Peripheral LPSPI1 base pointer */ - #define LPSPI1_NS ((LPSPI_Type *)LPSPI1_BASE_NS) - /** Peripheral LPSPI2 base address */ - #define LPSPI2_BASE (0x50094000u) - /** Peripheral LPSPI2 base address */ - #define LPSPI2_BASE_NS (0x40094000u) - /** Peripheral LPSPI2 base pointer */ - #define LPSPI2 ((LPSPI_Type *)LPSPI2_BASE) - /** Peripheral LPSPI2 base pointer */ - #define LPSPI2_NS ((LPSPI_Type *)LPSPI2_BASE_NS) - /** Peripheral LPSPI3 base address */ - #define LPSPI3_BASE (0x50095000u) - /** Peripheral LPSPI3 base address */ - #define LPSPI3_BASE_NS (0x40095000u) - /** Peripheral LPSPI3 base pointer */ - #define LPSPI3 ((LPSPI_Type *)LPSPI3_BASE) - /** Peripheral LPSPI3 base pointer */ - #define LPSPI3_NS ((LPSPI_Type *)LPSPI3_BASE_NS) - /** Peripheral LPSPI4 base address */ - #define LPSPI4_BASE (0x500B4000u) - /** Peripheral LPSPI4 base address */ - #define LPSPI4_BASE_NS (0x400B4000u) - /** Peripheral LPSPI4 base pointer */ - #define LPSPI4 ((LPSPI_Type *)LPSPI4_BASE) - /** Peripheral LPSPI4 base pointer */ - #define LPSPI4_NS ((LPSPI_Type *)LPSPI4_BASE_NS) - /** Peripheral LPSPI5 base address */ - #define LPSPI5_BASE (0x500B5000u) - /** Peripheral LPSPI5 base address */ - #define LPSPI5_BASE_NS (0x400B5000u) - /** Peripheral LPSPI5 base pointer */ - #define LPSPI5 ((LPSPI_Type *)LPSPI5_BASE) - /** Peripheral LPSPI5 base pointer */ - #define LPSPI5_NS ((LPSPI_Type *)LPSPI5_BASE_NS) - /** Peripheral LPSPI6 base address */ - #define LPSPI6_BASE (0x500B6000u) - /** Peripheral LPSPI6 base address */ - #define LPSPI6_BASE_NS (0x400B6000u) - /** Peripheral LPSPI6 base pointer */ - #define LPSPI6 ((LPSPI_Type *)LPSPI6_BASE) - /** Peripheral LPSPI6 base pointer */ - #define LPSPI6_NS ((LPSPI_Type *)LPSPI6_BASE_NS) - /** Peripheral LPSPI7 base address */ - #define LPSPI7_BASE (0x500B7000u) - /** Peripheral LPSPI7 base address */ - #define LPSPI7_BASE_NS (0x400B7000u) - /** Peripheral LPSPI7 base pointer */ - #define LPSPI7 ((LPSPI_Type *)LPSPI7_BASE) - /** Peripheral LPSPI7 base pointer */ - #define LPSPI7_NS ((LPSPI_Type *)LPSPI7_BASE_NS) - /** Array initializer of LPSPI peripheral base addresses */ - #define LPSPI_BASE_ADDRS { LPSPI0_BASE, LPSPI1_BASE, LPSPI2_BASE, LPSPI3_BASE, LPSPI4_BASE, LPSPI5_BASE, LPSPI6_BASE, LPSPI7_BASE } - /** Array initializer of LPSPI peripheral base pointers */ - #define LPSPI_BASE_PTRS { LPSPI0, LPSPI1, LPSPI2, LPSPI3, LPSPI4, LPSPI5, LPSPI6, LPSPI7 } - /** Array initializer of LPSPI peripheral base addresses */ - #define LPSPI_BASE_ADDRS_NS { LPSPI0_BASE_NS, LPSPI1_BASE_NS, LPSPI2_BASE_NS, LPSPI3_BASE_NS, LPSPI4_BASE_NS, LPSPI5_BASE_NS, LPSPI6_BASE_NS, LPSPI7_BASE_NS } - /** Array initializer of LPSPI peripheral base pointers */ - #define LPSPI_BASE_PTRS_NS { LPSPI0_NS, LPSPI1_NS, LPSPI2_NS, LPSPI3_NS, LPSPI4_NS, LPSPI5_NS, LPSPI6_NS, LPSPI7_NS } -#else - /** Peripheral LPSPI0 base address */ - #define LPSPI0_BASE (0x40092000u) - /** Peripheral LPSPI0 base pointer */ - #define LPSPI0 ((LPSPI_Type *)LPSPI0_BASE) - /** Peripheral LPSPI1 base address */ - #define LPSPI1_BASE (0x40093000u) - /** Peripheral LPSPI1 base pointer */ - #define LPSPI1 ((LPSPI_Type *)LPSPI1_BASE) - /** Peripheral LPSPI2 base address */ - #define LPSPI2_BASE (0x40094000u) - /** Peripheral LPSPI2 base pointer */ - #define LPSPI2 ((LPSPI_Type *)LPSPI2_BASE) - /** Peripheral LPSPI3 base address */ - #define LPSPI3_BASE (0x40095000u) - /** Peripheral LPSPI3 base pointer */ - #define LPSPI3 ((LPSPI_Type *)LPSPI3_BASE) - /** Peripheral LPSPI4 base address */ - #define LPSPI4_BASE (0x400B4000u) - /** Peripheral LPSPI4 base pointer */ - #define LPSPI4 ((LPSPI_Type *)LPSPI4_BASE) - /** Peripheral LPSPI5 base address */ - #define LPSPI5_BASE (0x400B5000u) - /** Peripheral LPSPI5 base pointer */ - #define LPSPI5 ((LPSPI_Type *)LPSPI5_BASE) - /** Peripheral LPSPI6 base address */ - #define LPSPI6_BASE (0x400B6000u) - /** Peripheral LPSPI6 base pointer */ - #define LPSPI6 ((LPSPI_Type *)LPSPI6_BASE) - /** Peripheral LPSPI7 base address */ - #define LPSPI7_BASE (0x400B7000u) - /** Peripheral LPSPI7 base pointer */ - #define LPSPI7 ((LPSPI_Type *)LPSPI7_BASE) - /** Array initializer of LPSPI peripheral base addresses */ - #define LPSPI_BASE_ADDRS { LPSPI0_BASE, LPSPI1_BASE, LPSPI2_BASE, LPSPI3_BASE, LPSPI4_BASE, LPSPI5_BASE, LPSPI6_BASE, LPSPI7_BASE } - /** Array initializer of LPSPI peripheral base pointers */ - #define LPSPI_BASE_PTRS { LPSPI0, LPSPI1, LPSPI2, LPSPI3, LPSPI4, LPSPI5, LPSPI6, LPSPI7 } -#endif -/** Interrupt vectors for the LPSPI peripheral type */ -#define LPSPI_IRQS { LP_FLEXCOMM0_IRQn, LP_FLEXCOMM1_IRQn, LP_FLEXCOMM2_IRQn, LP_FLEXCOMM3_IRQn, LP_FLEXCOMM4_IRQn, LP_FLEXCOMM5_IRQn, LP_FLEXCOMM6_IRQn, LP_FLEXCOMM7_IRQn } - -/*! - * @} - */ /* end of group LPSPI_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LPTMR Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPTMR_Peripheral_Access_Layer LPTMR Peripheral Access Layer - * @{ - */ - -/** LPTMR - Register Layout Typedef */ -typedef struct { - __IO uint32_t CSR; /**< Control Status, offset: 0x0 */ - __IO uint32_t PSR; /**< Prescaler and Glitch Filter, offset: 0x4 */ - __IO uint32_t CMR; /**< Compare, offset: 0x8 */ - __IO uint32_t CNR; /**< Counter, offset: 0xC */ -} LPTMR_Type; - -/* ---------------------------------------------------------------------------- - -- LPTMR Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPTMR_Register_Masks LPTMR Register Masks - * @{ - */ - -/*! @name CSR - Control Status */ -/*! @{ */ - -#define LPTMR_CSR_TEN_MASK (0x1U) -#define LPTMR_CSR_TEN_SHIFT (0U) -/*! TEN - Timer Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPTMR_CSR_TEN(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TEN_SHIFT)) & LPTMR_CSR_TEN_MASK) - -#define LPTMR_CSR_TMS_MASK (0x2U) -#define LPTMR_CSR_TMS_SHIFT (1U) -/*! TMS - Timer Mode Select - * 0b0..Time Counter - * 0b1..Pulse Counter - */ -#define LPTMR_CSR_TMS(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TMS_SHIFT)) & LPTMR_CSR_TMS_MASK) - -#define LPTMR_CSR_TFC_MASK (0x4U) -#define LPTMR_CSR_TFC_SHIFT (2U) -/*! TFC - Timer Free-Running Counter - * 0b0..Reset when TCF asserts - * 0b1..Reset on overflow - */ -#define LPTMR_CSR_TFC(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TFC_SHIFT)) & LPTMR_CSR_TFC_MASK) - -#define LPTMR_CSR_TPP_MASK (0x8U) -#define LPTMR_CSR_TPP_SHIFT (3U) -/*! TPP - Timer Pin Polarity - * 0b0..Active-high - * 0b1..Active-low - */ -#define LPTMR_CSR_TPP(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TPP_SHIFT)) & LPTMR_CSR_TPP_MASK) - -#define LPTMR_CSR_TPS_MASK (0x30U) -#define LPTMR_CSR_TPS_SHIFT (4U) -/*! TPS - Timer Pin Select - * 0b00..Input 0 - * 0b01..Input 1 - * 0b10..Input 2 - * 0b11..Input 3 - */ -#define LPTMR_CSR_TPS(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TPS_SHIFT)) & LPTMR_CSR_TPS_MASK) - -#define LPTMR_CSR_TIE_MASK (0x40U) -#define LPTMR_CSR_TIE_SHIFT (6U) -/*! TIE - Timer Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPTMR_CSR_TIE(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TIE_SHIFT)) & LPTMR_CSR_TIE_MASK) - -#define LPTMR_CSR_TCF_MASK (0x80U) -#define LPTMR_CSR_TCF_SHIFT (7U) -/*! TCF - Timer Compare Flag - * 0b0..CNR != (CMR + 1) - * 0b1..CNR = (CMR + 1) - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPTMR_CSR_TCF(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TCF_SHIFT)) & LPTMR_CSR_TCF_MASK) - -#define LPTMR_CSR_TDRE_MASK (0x100U) -#define LPTMR_CSR_TDRE_SHIFT (8U) -/*! TDRE - Timer DMA Request Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPTMR_CSR_TDRE(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TDRE_SHIFT)) & LPTMR_CSR_TDRE_MASK) -/*! @} */ - -/*! @name PSR - Prescaler and Glitch Filter */ -/*! @{ */ - -#define LPTMR_PSR_PCS_MASK (0x3U) -#define LPTMR_PSR_PCS_SHIFT (0U) -/*! PCS - Prescaler and Glitch Filter Clock Select - * 0b00..Clock 0 - * 0b01..Clock 1 - * 0b10..Clock 2 - * 0b11..Clock 3 - */ -#define LPTMR_PSR_PCS(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_PSR_PCS_SHIFT)) & LPTMR_PSR_PCS_MASK) - -#define LPTMR_PSR_PBYP_MASK (0x4U) -#define LPTMR_PSR_PBYP_SHIFT (2U) -/*! PBYP - Prescaler and Glitch Filter Bypass - * 0b0..Prescaler and glitch filter enable - * 0b1..Prescaler and glitch filter bypass - */ -#define LPTMR_PSR_PBYP(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_PSR_PBYP_SHIFT)) & LPTMR_PSR_PBYP_MASK) - -#define LPTMR_PSR_PRESCALE_MASK (0x78U) -#define LPTMR_PSR_PRESCALE_SHIFT (3U) -/*! PRESCALE - Prescaler and Glitch Filter Value - * 0b0000..Prescaler divides the prescaler clock by 2; glitch filter does not support this configuration - * 0b0001..Prescaler divides the prescaler clock by 4; glitch filter recognizes change on input pin after two rising clock edges - * 0b0010..Prescaler divides the prescaler clock by 8; glitch filter recognizes change on input pin after four rising clock edges - * 0b0011..Prescaler divides the prescaler clock by 16; glitch filter recognizes change on input pin after eight rising clock edges - * 0b0100..Prescaler divides the prescaler clock by 32; glitch filter recognizes change on input pin after 16 rising clock edges - * 0b0101..Prescaler divides the prescaler clock by 64; glitch filter recognizes change on input pin after 32 rising clock edges - * 0b0110..Prescaler divides the prescaler clock by 128; glitch filter recognizes change on input pin after 64 rising clock edges - * 0b0111..Prescaler divides the prescaler clock by 256; glitch filter recognizes change on input pin after 128 rising clock edges - * 0b1000..Prescaler divides the prescaler clock by 512; glitch filter recognizes change on input pin after 256 rising clock edges - * 0b1001..Prescaler divides the prescaler clock by 1024; glitch filter recognizes change on input pin after 512 rising clock edges - * 0b1010..Prescaler divides the prescaler clock by 2048; glitch filter recognizes change on input pin after 1024 rising clock edges - * 0b1011..Prescaler divides the prescaler clock by 4096; glitch filter recognizes change on input pin after 2048 rising clock edges - * 0b1100..Prescaler divides the prescaler clock by 8192; glitch filter recognizes change on input pin after 4096 rising clock edges - * 0b1101..Prescaler divides the prescaler clock by 16,384; glitch filter recognizes change on input pin after 8192 rising clock edges - * 0b1110..Prescaler divides the prescaler clock by 32,768; glitch filter recognizes change on input pin after 16,384 rising clock edges - * 0b1111..Prescaler divides the prescaler clock by 65,536; glitch filter recognizes change on input pin after 32,768 rising clock edges - */ -#define LPTMR_PSR_PRESCALE(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_PSR_PRESCALE_SHIFT)) & LPTMR_PSR_PRESCALE_MASK) -/*! @} */ - -/*! @name CMR - Compare */ -/*! @{ */ - -#define LPTMR_CMR_COMPARE_MASK (0xFFFFFFFFU) -#define LPTMR_CMR_COMPARE_SHIFT (0U) -/*! COMPARE - Compare Value */ -#define LPTMR_CMR_COMPARE(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CMR_COMPARE_SHIFT)) & LPTMR_CMR_COMPARE_MASK) -/*! @} */ - -/*! @name CNR - Counter */ -/*! @{ */ - -#define LPTMR_CNR_COUNTER_MASK (0xFFFFFFFFU) -#define LPTMR_CNR_COUNTER_SHIFT (0U) -/*! COUNTER - Counter Value */ -#define LPTMR_CNR_COUNTER(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CNR_COUNTER_SHIFT)) & LPTMR_CNR_COUNTER_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group LPTMR_Register_Masks */ - - -/* LPTMR - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral LPTMR0 base address */ - #define LPTMR0_BASE (0x5004A000u) - /** Peripheral LPTMR0 base address */ - #define LPTMR0_BASE_NS (0x4004A000u) - /** Peripheral LPTMR0 base pointer */ - #define LPTMR0 ((LPTMR_Type *)LPTMR0_BASE) - /** Peripheral LPTMR0 base pointer */ - #define LPTMR0_NS ((LPTMR_Type *)LPTMR0_BASE_NS) - /** Peripheral LPTMR1 base address */ - #define LPTMR1_BASE (0x5004B000u) - /** Peripheral LPTMR1 base address */ - #define LPTMR1_BASE_NS (0x4004B000u) - /** Peripheral LPTMR1 base pointer */ - #define LPTMR1 ((LPTMR_Type *)LPTMR1_BASE) - /** Peripheral LPTMR1 base pointer */ - #define LPTMR1_NS ((LPTMR_Type *)LPTMR1_BASE_NS) - /** Array initializer of LPTMR peripheral base addresses */ - #define LPTMR_BASE_ADDRS { LPTMR0_BASE, LPTMR1_BASE } - /** Array initializer of LPTMR peripheral base pointers */ - #define LPTMR_BASE_PTRS { LPTMR0, LPTMR1 } - /** Array initializer of LPTMR peripheral base addresses */ - #define LPTMR_BASE_ADDRS_NS { LPTMR0_BASE_NS, LPTMR1_BASE_NS } - /** Array initializer of LPTMR peripheral base pointers */ - #define LPTMR_BASE_PTRS_NS { LPTMR0_NS, LPTMR1_NS } -#else - /** Peripheral LPTMR0 base address */ - #define LPTMR0_BASE (0x4004A000u) - /** Peripheral LPTMR0 base pointer */ - #define LPTMR0 ((LPTMR_Type *)LPTMR0_BASE) - /** Peripheral LPTMR1 base address */ - #define LPTMR1_BASE (0x4004B000u) - /** Peripheral LPTMR1 base pointer */ - #define LPTMR1 ((LPTMR_Type *)LPTMR1_BASE) - /** Array initializer of LPTMR peripheral base addresses */ - #define LPTMR_BASE_ADDRS { LPTMR0_BASE, LPTMR1_BASE } - /** Array initializer of LPTMR peripheral base pointers */ - #define LPTMR_BASE_PTRS { LPTMR0, LPTMR1 } -#endif -/** Interrupt vectors for the LPTMR peripheral type */ -#define LPTMR_IRQS { LPTMR0_IRQn, LPTMR1_IRQn } - -/*! - * @} - */ /* end of group LPTMR_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LPUART Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPUART_Peripheral_Access_Layer LPUART Peripheral Access Layer - * @{ - */ - -/** LPUART - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - __IO uint32_t GLOBAL; /**< Global, offset: 0x8 */ - __IO uint32_t PINCFG; /**< Pin Configuration, offset: 0xC */ - __IO uint32_t BAUD; /**< Baud Rate, offset: 0x10 */ - __IO uint32_t STAT; /**< Status, offset: 0x14 */ - __IO uint32_t CTRL; /**< Control, offset: 0x18 */ - __IO uint32_t DATA; /**< Data, offset: 0x1C */ - __IO uint32_t MATCH; /**< Match Address, offset: 0x20 */ - __IO uint32_t MODIR; /**< MODEM IrDA, offset: 0x24 */ - __IO uint32_t FIFO; /**< FIFO, offset: 0x28 */ - __IO uint32_t WATER; /**< Watermark, offset: 0x2C */ - __I uint32_t DATARO; /**< Data Read-Only, offset: 0x30 */ - uint8_t RESERVED_0[12]; - __IO uint32_t MCR; /**< MODEM Control, offset: 0x40 */ - __IO uint32_t MSR; /**< MODEM Status, offset: 0x44 */ - __IO uint32_t REIR; /**< Receiver Extended Idle, offset: 0x48 */ - __IO uint32_t TEIR; /**< Transmitter Extended Idle, offset: 0x4C */ - __IO uint32_t HDCR; /**< Half Duplex Control, offset: 0x50 */ - uint8_t RESERVED_1[4]; - __IO uint32_t TOCR; /**< Timeout Control, offset: 0x58 */ - __IO uint32_t TOSR; /**< Timeout Status, offset: 0x5C */ - __IO uint32_t TIMEOUT[4]; /**< Timeout N, array offset: 0x60, array step: 0x4 */ - uint8_t RESERVED_2[400]; - __O uint32_t TCBR[128]; /**< Transmit Command Burst, array offset: 0x200, array step: 0x4 */ - __O uint32_t TDBR[256]; /**< Transmit Data Burst, array offset: 0x400, array step: 0x4 */ -} LPUART_Type; - -/* ---------------------------------------------------------------------------- - -- LPUART Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPUART_Register_Masks LPUART Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define LPUART_VERID_FEATURE_MASK (0xFFFFU) -#define LPUART_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Identification Number - * 0b0000000000000001..Standard feature set - * 0b0000000000000011..Standard feature set with MODEM and IrDA support - * 0b0000000000000111..Enhanced feature set with full MODEM, IrDA, and enhanced idle detection - */ -#define LPUART_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_VERID_FEATURE_SHIFT)) & LPUART_VERID_FEATURE_MASK) - -#define LPUART_VERID_MINOR_MASK (0xFF0000U) -#define LPUART_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define LPUART_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_VERID_MINOR_SHIFT)) & LPUART_VERID_MINOR_MASK) - -#define LPUART_VERID_MAJOR_MASK (0xFF000000U) -#define LPUART_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define LPUART_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_VERID_MAJOR_SHIFT)) & LPUART_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define LPUART_PARAM_TXFIFO_MASK (0xFFU) -#define LPUART_PARAM_TXFIFO_SHIFT (0U) -/*! TXFIFO - Transmit FIFO Size */ -#define LPUART_PARAM_TXFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPUART_PARAM_TXFIFO_SHIFT)) & LPUART_PARAM_TXFIFO_MASK) - -#define LPUART_PARAM_RXFIFO_MASK (0xFF00U) -#define LPUART_PARAM_RXFIFO_SHIFT (8U) -/*! RXFIFO - Receive FIFO Size */ -#define LPUART_PARAM_RXFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPUART_PARAM_RXFIFO_SHIFT)) & LPUART_PARAM_RXFIFO_MASK) -/*! @} */ - -/*! @name GLOBAL - Global */ -/*! @{ */ - -#define LPUART_GLOBAL_RST_MASK (0x2U) -#define LPUART_GLOBAL_RST_SHIFT (1U) -/*! RST - Software Reset - * 0b0..Not reset - * 0b1..Reset - */ -#define LPUART_GLOBAL_RST(x) (((uint32_t)(((uint32_t)(x)) << LPUART_GLOBAL_RST_SHIFT)) & LPUART_GLOBAL_RST_MASK) -/*! @} */ - -/*! @name PINCFG - Pin Configuration */ -/*! @{ */ - -#define LPUART_PINCFG_TRGSEL_MASK (0x3U) -#define LPUART_PINCFG_TRGSEL_SHIFT (0U) -/*! TRGSEL - Trigger Select - * 0b00..Input trigger disabled - * 0b01..Input trigger used instead of the RXD pin input - * 0b10..Input trigger used instead of the CTS_B pin input - * 0b11..Input trigger used to modulate the TXD pin output, which (after TXINV configuration) is internally ANDed with the input trigger - */ -#define LPUART_PINCFG_TRGSEL(x) (((uint32_t)(((uint32_t)(x)) << LPUART_PINCFG_TRGSEL_SHIFT)) & LPUART_PINCFG_TRGSEL_MASK) -/*! @} */ - -/*! @name BAUD - Baud Rate */ -/*! @{ */ - -#define LPUART_BAUD_SBR_MASK (0x1FFFU) -#define LPUART_BAUD_SBR_SHIFT (0U) -/*! SBR - Baud Rate Modulo Divisor */ -#define LPUART_BAUD_SBR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_SBR_SHIFT)) & LPUART_BAUD_SBR_MASK) - -#define LPUART_BAUD_SBNS_MASK (0x2000U) -#define LPUART_BAUD_SBNS_SHIFT (13U) -/*! SBNS - Stop Bit Number Select - * 0b0..One stop bit - * 0b1..Two stop bits - */ -#define LPUART_BAUD_SBNS(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_SBNS_SHIFT)) & LPUART_BAUD_SBNS_MASK) - -#define LPUART_BAUD_RXEDGIE_MASK (0x4000U) -#define LPUART_BAUD_RXEDGIE_SHIFT (14U) -/*! RXEDGIE - RX Input Active Edge Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_RXEDGIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_RXEDGIE_SHIFT)) & LPUART_BAUD_RXEDGIE_MASK) - -#define LPUART_BAUD_LBKDIE_MASK (0x8000U) -#define LPUART_BAUD_LBKDIE_SHIFT (15U) -/*! LBKDIE - LIN Break Detect Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_LBKDIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_LBKDIE_SHIFT)) & LPUART_BAUD_LBKDIE_MASK) - -#define LPUART_BAUD_RESYNCDIS_MASK (0x10000U) -#define LPUART_BAUD_RESYNCDIS_SHIFT (16U) -/*! RESYNCDIS - Resynchronization Disable - * 0b0..Enable - * 0b1..Disable - */ -#define LPUART_BAUD_RESYNCDIS(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_RESYNCDIS_SHIFT)) & LPUART_BAUD_RESYNCDIS_MASK) - -#define LPUART_BAUD_BOTHEDGE_MASK (0x20000U) -#define LPUART_BAUD_BOTHEDGE_SHIFT (17U) -/*! BOTHEDGE - Both Edge Sampling - * 0b0..Rising edge - * 0b1..Both rising and falling edges - */ -#define LPUART_BAUD_BOTHEDGE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_BOTHEDGE_SHIFT)) & LPUART_BAUD_BOTHEDGE_MASK) - -#define LPUART_BAUD_MATCFG_MASK (0xC0000U) -#define LPUART_BAUD_MATCFG_SHIFT (18U) -/*! MATCFG - Match Configuration - * 0b00..Address match wake-up - * 0b01..Idle match wake-up - * 0b10..Match on and match off - * 0b11..Enables RWU on data match and match on or off for the transmitter CTS input - */ -#define LPUART_BAUD_MATCFG(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_MATCFG_SHIFT)) & LPUART_BAUD_MATCFG_MASK) - -#define LPUART_BAUD_RIDMAE_MASK (0x100000U) -#define LPUART_BAUD_RIDMAE_SHIFT (20U) -/*! RIDMAE - Receiver Idle DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_RIDMAE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_RIDMAE_SHIFT)) & LPUART_BAUD_RIDMAE_MASK) - -#define LPUART_BAUD_RDMAE_MASK (0x200000U) -#define LPUART_BAUD_RDMAE_SHIFT (21U) -/*! RDMAE - Receiver Full DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_RDMAE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_RDMAE_SHIFT)) & LPUART_BAUD_RDMAE_MASK) - -#define LPUART_BAUD_TDMAE_MASK (0x800000U) -#define LPUART_BAUD_TDMAE_SHIFT (23U) -/*! TDMAE - Transmitter DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_TDMAE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_TDMAE_SHIFT)) & LPUART_BAUD_TDMAE_MASK) - -#define LPUART_BAUD_OSR_MASK (0x1F000000U) -#define LPUART_BAUD_OSR_SHIFT (24U) -/*! OSR - Oversampling Ratio - * 0b00000..Results in an OSR of 16 - * 0b00001..Reserved - * 0b00010..Reserved - * 0b00011..Results in an OSR of 4 (requires BAUD[BOTHEDGE] to be 1) - * 0b00100..Results in an OSR of 5 (requires BAUD[BOTHEDGE] to be 1) - * 0b00101..Results in an OSR of 6 (requires BAUD[BOTHEDGE] to be 1) - * 0b00110..Results in an OSR of 7 (requires BAUD[BOTHEDGE] to be 1) - * 0b00111..Results in an OSR of 8 - * 0b01000..Results in an OSR of 9 - * 0b01001..Results in an OSR of 10 - * 0b01010..Results in an OSR of 11 - * 0b01011..Results in an OSR of 12 - * 0b01100..Results in an OSR of 13 - * 0b01101..Results in an OSR of 14 - * 0b01110..Results in an OSR of 15 - * 0b01111..Results in an OSR of 16 - * 0b10000..Results in an OSR of 17 - * 0b10001..Results in an OSR of 18 - * 0b10010..Results in an OSR of 19 - * 0b10011..Results in an OSR of 20 - * 0b10100..Results in an OSR of 21 - * 0b10101..Results in an OSR of 22 - * 0b10110..Results in an OSR of 23 - * 0b10111..Results in an OSR of 24 - * 0b11000..Results in an OSR of 25 - * 0b11001..Results in an OSR of 26 - * 0b11010..Results in an OSR of 27 - * 0b11011..Results in an OSR of 28 - * 0b11100..Results in an OSR of 29 - * 0b11101..Results in an OSR of 30 - * 0b11110..Results in an OSR of 31 - * 0b11111..Results in an OSR of 32 - */ -#define LPUART_BAUD_OSR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_OSR_SHIFT)) & LPUART_BAUD_OSR_MASK) - -#define LPUART_BAUD_M10_MASK (0x20000000U) -#define LPUART_BAUD_M10_SHIFT (29U) -/*! M10 - 10-Bit Mode Select - * 0b0..Receiver and transmitter use 7-bit to 9-bit data characters - * 0b1..Receiver and transmitter use 10-bit data characters - */ -#define LPUART_BAUD_M10(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_M10_SHIFT)) & LPUART_BAUD_M10_MASK) - -#define LPUART_BAUD_MAEN2_MASK (0x40000000U) -#define LPUART_BAUD_MAEN2_SHIFT (30U) -/*! MAEN2 - Match Address Mode Enable 2 - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_MAEN2(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_MAEN2_SHIFT)) & LPUART_BAUD_MAEN2_MASK) - -#define LPUART_BAUD_MAEN1_MASK (0x80000000U) -#define LPUART_BAUD_MAEN1_SHIFT (31U) -/*! MAEN1 - Match Address Mode Enable 1 - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_MAEN1(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_MAEN1_SHIFT)) & LPUART_BAUD_MAEN1_MASK) -/*! @} */ - -/*! @name STAT - Status */ -/*! @{ */ - -#define LPUART_STAT_LBKFE_MASK (0x1U) -#define LPUART_STAT_LBKFE_SHIFT (0U) -/*! LBKFE - LIN Break Flag Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_STAT_LBKFE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_LBKFE_SHIFT)) & LPUART_STAT_LBKFE_MASK) - -#define LPUART_STAT_AME_MASK (0x2U) -#define LPUART_STAT_AME_SHIFT (1U) -/*! AME - Address Mark Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_STAT_AME(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_AME_SHIFT)) & LPUART_STAT_AME_MASK) - -#define LPUART_STAT_MSF_MASK (0x100U) -#define LPUART_STAT_MSF_SHIFT (8U) -/*! MSF - MODEM Status Flag - * 0b0..Field is 0 - * 0b1..Field is 1 - */ -#define LPUART_STAT_MSF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_MSF_SHIFT)) & LPUART_STAT_MSF_MASK) - -#define LPUART_STAT_TSF_MASK (0x200U) -#define LPUART_STAT_TSF_SHIFT (9U) -/*! TSF - Timeout Status Flag - * 0b0..Field is 0 - * 0b1..Field is 1 - */ -#define LPUART_STAT_TSF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_TSF_SHIFT)) & LPUART_STAT_TSF_MASK) - -#define LPUART_STAT_MA2F_MASK (0x4000U) -#define LPUART_STAT_MA2F_SHIFT (14U) -/*! MA2F - Match 2 Flag - * 0b0..Not equal to MA2 - * 0b1..Equal to MA2 - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_MA2F(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_MA2F_SHIFT)) & LPUART_STAT_MA2F_MASK) - -#define LPUART_STAT_MA1F_MASK (0x8000U) -#define LPUART_STAT_MA1F_SHIFT (15U) -/*! MA1F - Match 1 Flag - * 0b0..Not equal to MA1 - * 0b1..Equal to MA1 - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_MA1F(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_MA1F_SHIFT)) & LPUART_STAT_MA1F_MASK) - -#define LPUART_STAT_PF_MASK (0x10000U) -#define LPUART_STAT_PF_SHIFT (16U) -/*! PF - Parity Error Flag - * 0b0..No parity error detected - * 0b1..Parity error detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_PF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_PF_SHIFT)) & LPUART_STAT_PF_MASK) - -#define LPUART_STAT_FE_MASK (0x20000U) -#define LPUART_STAT_FE_SHIFT (17U) -/*! FE - Framing Error Flag - * 0b0..No framing error detected (this does not guarantee that the framing is correct) - * 0b1..Framing error detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_FE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_FE_SHIFT)) & LPUART_STAT_FE_MASK) - -#define LPUART_STAT_NF_MASK (0x40000U) -#define LPUART_STAT_NF_SHIFT (18U) -/*! NF - Noise Flag - * 0b0..No noise detected - * 0b1..Noise detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_NF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_NF_SHIFT)) & LPUART_STAT_NF_MASK) - -#define LPUART_STAT_OR_MASK (0x80000U) -#define LPUART_STAT_OR_SHIFT (19U) -/*! OR - Receiver Overrun Flag - * 0b0..No overrun - * 0b1..Receive overrun (new LPUART data is lost) - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_OR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_OR_SHIFT)) & LPUART_STAT_OR_MASK) - -#define LPUART_STAT_IDLE_MASK (0x100000U) -#define LPUART_STAT_IDLE_SHIFT (20U) -/*! IDLE - Idle Line Flag - * 0b0..Idle line detected - * 0b1..Idle line not detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_IDLE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_IDLE_SHIFT)) & LPUART_STAT_IDLE_MASK) - -#define LPUART_STAT_RDRF_MASK (0x200000U) -#define LPUART_STAT_RDRF_SHIFT (21U) -/*! RDRF - Receive Data Register Full Flag - * 0b0..Equal to or less than watermark - * 0b1..Greater than watermark - */ -#define LPUART_STAT_RDRF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_RDRF_SHIFT)) & LPUART_STAT_RDRF_MASK) - -#define LPUART_STAT_TC_MASK (0x400000U) -#define LPUART_STAT_TC_SHIFT (22U) -/*! TC - Transmission Complete Flag - * 0b0..Transmitter active - * 0b1..Transmitter idle - */ -#define LPUART_STAT_TC(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_TC_SHIFT)) & LPUART_STAT_TC_MASK) - -#define LPUART_STAT_TDRE_MASK (0x800000U) -#define LPUART_STAT_TDRE_SHIFT (23U) -/*! TDRE - Transmit Data Register Empty Flag - * 0b0..Greater than watermark - * 0b1..Equal to or less than watermark - */ -#define LPUART_STAT_TDRE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_TDRE_SHIFT)) & LPUART_STAT_TDRE_MASK) - -#define LPUART_STAT_RAF_MASK (0x1000000U) -#define LPUART_STAT_RAF_SHIFT (24U) -/*! RAF - Receiver Active Flag - * 0b0..Idle, waiting for a start bit - * 0b1..Receiver active (RXD pin input not idle) - */ -#define LPUART_STAT_RAF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_RAF_SHIFT)) & LPUART_STAT_RAF_MASK) - -#define LPUART_STAT_LBKDE_MASK (0x2000000U) -#define LPUART_STAT_LBKDE_SHIFT (25U) -/*! LBKDE - LIN Break Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_STAT_LBKDE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_LBKDE_SHIFT)) & LPUART_STAT_LBKDE_MASK) - -#define LPUART_STAT_BRK13_MASK (0x4000000U) -#define LPUART_STAT_BRK13_SHIFT (26U) -/*! BRK13 - Break Character Generation Length - * 0b0..9 to 13 bit times - * 0b1..12 to 15 bit times - */ -#define LPUART_STAT_BRK13(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_BRK13_SHIFT)) & LPUART_STAT_BRK13_MASK) - -#define LPUART_STAT_RWUID_MASK (0x8000000U) -#define LPUART_STAT_RWUID_SHIFT (27U) -/*! RWUID - Receive Wake Up Idle Detect - * 0b0..STAT[IDLE] does not become 1 - * 0b1..STAT[IDLE] becomes 1 - */ -#define LPUART_STAT_RWUID(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_RWUID_SHIFT)) & LPUART_STAT_RWUID_MASK) - -#define LPUART_STAT_RXINV_MASK (0x10000000U) -#define LPUART_STAT_RXINV_SHIFT (28U) -/*! RXINV - Receive Data Inversion - * 0b0..Inverted - * 0b1..Not inverted - */ -#define LPUART_STAT_RXINV(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_RXINV_SHIFT)) & LPUART_STAT_RXINV_MASK) - -#define LPUART_STAT_MSBF_MASK (0x20000000U) -#define LPUART_STAT_MSBF_SHIFT (29U) -/*! MSBF - MSB First - * 0b0..LSB - * 0b1..MSB - */ -#define LPUART_STAT_MSBF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_MSBF_SHIFT)) & LPUART_STAT_MSBF_MASK) - -#define LPUART_STAT_RXEDGIF_MASK (0x40000000U) -#define LPUART_STAT_RXEDGIF_SHIFT (30U) -/*! RXEDGIF - RXD Pin Active Edge Interrupt Flag - * 0b0..Not occurred - * 0b1..Occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_RXEDGIF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_RXEDGIF_SHIFT)) & LPUART_STAT_RXEDGIF_MASK) - -#define LPUART_STAT_LBKDIF_MASK (0x80000000U) -#define LPUART_STAT_LBKDIF_SHIFT (31U) -/*! LBKDIF - LIN Break Detect Interrupt Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_LBKDIF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_LBKDIF_SHIFT)) & LPUART_STAT_LBKDIF_MASK) -/*! @} */ - -/*! @name CTRL - Control */ -/*! @{ */ - -#define LPUART_CTRL_PT_MASK (0x1U) -#define LPUART_CTRL_PT_SHIFT (0U) -/*! PT - Parity Type - * 0b0..Even parity - * 0b1..Odd parity - */ -#define LPUART_CTRL_PT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_PT_SHIFT)) & LPUART_CTRL_PT_MASK) - -#define LPUART_CTRL_PE_MASK (0x2U) -#define LPUART_CTRL_PE_SHIFT (1U) -/*! PE - Parity Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_PE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_PE_SHIFT)) & LPUART_CTRL_PE_MASK) - -#define LPUART_CTRL_ILT_MASK (0x4U) -#define LPUART_CTRL_ILT_SHIFT (2U) -/*! ILT - Idle Line Type Select - * 0b0..After the start bit - * 0b1..After the stop bit - */ -#define LPUART_CTRL_ILT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_ILT_SHIFT)) & LPUART_CTRL_ILT_MASK) - -#define LPUART_CTRL_WAKE_MASK (0x8U) -#define LPUART_CTRL_WAKE_SHIFT (3U) -/*! WAKE - Receiver Wake-Up Method Select - * 0b0..Idle - * 0b1..Mark - */ -#define LPUART_CTRL_WAKE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_WAKE_SHIFT)) & LPUART_CTRL_WAKE_MASK) - -#define LPUART_CTRL_M_MASK (0x10U) -#define LPUART_CTRL_M_SHIFT (4U) -/*! M - 9-Bit Or 8-Bit Mode Select - * 0b0..8-bit - * 0b1..9-bit - */ -#define LPUART_CTRL_M(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_M_SHIFT)) & LPUART_CTRL_M_MASK) - -#define LPUART_CTRL_RSRC_MASK (0x20U) -#define LPUART_CTRL_RSRC_SHIFT (5U) -/*! RSRC - Receiver Source Select - * 0b0..Internal Loopback mode - * 0b1..Single-wire mode - */ -#define LPUART_CTRL_RSRC(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_RSRC_SHIFT)) & LPUART_CTRL_RSRC_MASK) - -#define LPUART_CTRL_DOZEEN_MASK (0x40U) -#define LPUART_CTRL_DOZEEN_SHIFT (6U) -/*! DOZEEN - Doze Mode - * 0b0..Enable - * 0b1..Disable - */ -#define LPUART_CTRL_DOZEEN(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_DOZEEN_SHIFT)) & LPUART_CTRL_DOZEEN_MASK) - -#define LPUART_CTRL_LOOPS_MASK (0x80U) -#define LPUART_CTRL_LOOPS_SHIFT (7U) -/*! LOOPS - Loop Mode Select - * 0b0..Normal operation: RXD and TXD use separate pins - * 0b1..Loop mode or Single-Wire mode - */ -#define LPUART_CTRL_LOOPS(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_LOOPS_SHIFT)) & LPUART_CTRL_LOOPS_MASK) - -#define LPUART_CTRL_IDLECFG_MASK (0x700U) -#define LPUART_CTRL_IDLECFG_SHIFT (8U) -/*! IDLECFG - Idle Configuration - * 0b000..1 - * 0b001..2 - * 0b010..4 - * 0b011..8 - * 0b100..16 - * 0b101..32 - * 0b110..64 - * 0b111..128 - */ -#define LPUART_CTRL_IDLECFG(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_IDLECFG_SHIFT)) & LPUART_CTRL_IDLECFG_MASK) - -#define LPUART_CTRL_M7_MASK (0x800U) -#define LPUART_CTRL_M7_SHIFT (11U) -/*! M7 - 7-Bit Mode Select - * 0b0..8-bit to 10-bit - * 0b1..7-bit - */ -#define LPUART_CTRL_M7(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_M7_SHIFT)) & LPUART_CTRL_M7_MASK) - -#define LPUART_CTRL_MA2IE_MASK (0x4000U) -#define LPUART_CTRL_MA2IE_SHIFT (14U) -/*! MA2IE - Match 2 (MA2F) Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_MA2IE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_MA2IE_SHIFT)) & LPUART_CTRL_MA2IE_MASK) - -#define LPUART_CTRL_MA1IE_MASK (0x8000U) -#define LPUART_CTRL_MA1IE_SHIFT (15U) -/*! MA1IE - Match 1 (MA1F) Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_MA1IE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_MA1IE_SHIFT)) & LPUART_CTRL_MA1IE_MASK) - -#define LPUART_CTRL_SBK_MASK (0x10000U) -#define LPUART_CTRL_SBK_SHIFT (16U) -/*! SBK - Send Break - * 0b0..Normal transmitter operation - * 0b1..Queue break character(s) to be sent - */ -#define LPUART_CTRL_SBK(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_SBK_SHIFT)) & LPUART_CTRL_SBK_MASK) - -#define LPUART_CTRL_RWU_MASK (0x20000U) -#define LPUART_CTRL_RWU_SHIFT (17U) -/*! RWU - Receiver Wake-Up Control - * 0b0..Normal receiver operation - * 0b1..LPUART receiver in standby, waiting for a wake-up condition - */ -#define LPUART_CTRL_RWU(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_RWU_SHIFT)) & LPUART_CTRL_RWU_MASK) - -#define LPUART_CTRL_RE_MASK (0x40000U) -#define LPUART_CTRL_RE_SHIFT (18U) -/*! RE - Receiver Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_RE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_RE_SHIFT)) & LPUART_CTRL_RE_MASK) - -#define LPUART_CTRL_TE_MASK (0x80000U) -#define LPUART_CTRL_TE_SHIFT (19U) -/*! TE - Transmitter Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_TE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_TE_SHIFT)) & LPUART_CTRL_TE_MASK) - -#define LPUART_CTRL_ILIE_MASK (0x100000U) -#define LPUART_CTRL_ILIE_SHIFT (20U) -/*! ILIE - Idle Line Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_ILIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_ILIE_SHIFT)) & LPUART_CTRL_ILIE_MASK) - -#define LPUART_CTRL_RIE_MASK (0x200000U) -#define LPUART_CTRL_RIE_SHIFT (21U) -/*! RIE - Receiver Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_RIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_RIE_SHIFT)) & LPUART_CTRL_RIE_MASK) - -#define LPUART_CTRL_TCIE_MASK (0x400000U) -#define LPUART_CTRL_TCIE_SHIFT (22U) -/*! TCIE - Transmission Complete Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_TCIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_TCIE_SHIFT)) & LPUART_CTRL_TCIE_MASK) - -#define LPUART_CTRL_TIE_MASK (0x800000U) -#define LPUART_CTRL_TIE_SHIFT (23U) -/*! TIE - Transmit Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_TIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_TIE_SHIFT)) & LPUART_CTRL_TIE_MASK) - -#define LPUART_CTRL_PEIE_MASK (0x1000000U) -#define LPUART_CTRL_PEIE_SHIFT (24U) -/*! PEIE - Parity Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_PEIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_PEIE_SHIFT)) & LPUART_CTRL_PEIE_MASK) - -#define LPUART_CTRL_FEIE_MASK (0x2000000U) -#define LPUART_CTRL_FEIE_SHIFT (25U) -/*! FEIE - Framing Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_FEIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_FEIE_SHIFT)) & LPUART_CTRL_FEIE_MASK) - -#define LPUART_CTRL_NEIE_MASK (0x4000000U) -#define LPUART_CTRL_NEIE_SHIFT (26U) -/*! NEIE - Noise Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_NEIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_NEIE_SHIFT)) & LPUART_CTRL_NEIE_MASK) - -#define LPUART_CTRL_ORIE_MASK (0x8000000U) -#define LPUART_CTRL_ORIE_SHIFT (27U) -/*! ORIE - Overrun Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_ORIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_ORIE_SHIFT)) & LPUART_CTRL_ORIE_MASK) - -#define LPUART_CTRL_TXINV_MASK (0x10000000U) -#define LPUART_CTRL_TXINV_SHIFT (28U) -/*! TXINV - Transmit Data Inversion - * 0b0..Not inverted - * 0b1..Inverted - */ -#define LPUART_CTRL_TXINV(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_TXINV_SHIFT)) & LPUART_CTRL_TXINV_MASK) - -#define LPUART_CTRL_TXDIR_MASK (0x20000000U) -#define LPUART_CTRL_TXDIR_SHIFT (29U) -/*! TXDIR - TXD Pin Direction in Single-Wire Mode - * 0b0..Input - * 0b1..Output - */ -#define LPUART_CTRL_TXDIR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_TXDIR_SHIFT)) & LPUART_CTRL_TXDIR_MASK) - -#define LPUART_CTRL_R9T8_MASK (0x40000000U) -#define LPUART_CTRL_R9T8_SHIFT (30U) -/*! R9T8 - Receive Bit 9 Transmit Bit 8 */ -#define LPUART_CTRL_R9T8(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_R9T8_SHIFT)) & LPUART_CTRL_R9T8_MASK) - -#define LPUART_CTRL_R8T9_MASK (0x80000000U) -#define LPUART_CTRL_R8T9_SHIFT (31U) -/*! R8T9 - Receive Bit 8 Transmit Bit 9 */ -#define LPUART_CTRL_R8T9(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_R8T9_SHIFT)) & LPUART_CTRL_R8T9_MASK) -/*! @} */ - -/*! @name DATA - Data */ -/*! @{ */ - -#define LPUART_DATA_R0T0_MASK (0x1U) -#define LPUART_DATA_R0T0_SHIFT (0U) -/*! R0T0 - Read receive FIFO bit 0 or write transmit FIFO bit 0 */ -#define LPUART_DATA_R0T0(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R0T0_SHIFT)) & LPUART_DATA_R0T0_MASK) - -#define LPUART_DATA_R1T1_MASK (0x2U) -#define LPUART_DATA_R1T1_SHIFT (1U) -/*! R1T1 - Read receive FIFO bit 1 or write transmit FIFO bit 1 */ -#define LPUART_DATA_R1T1(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R1T1_SHIFT)) & LPUART_DATA_R1T1_MASK) - -#define LPUART_DATA_R2T2_MASK (0x4U) -#define LPUART_DATA_R2T2_SHIFT (2U) -/*! R2T2 - Read receive FIFO bit 2 or write transmit FIFO bit 2 */ -#define LPUART_DATA_R2T2(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R2T2_SHIFT)) & LPUART_DATA_R2T2_MASK) - -#define LPUART_DATA_R3T3_MASK (0x8U) -#define LPUART_DATA_R3T3_SHIFT (3U) -/*! R3T3 - Read receive FIFO bit 3 or write transmit FIFO bit 3 */ -#define LPUART_DATA_R3T3(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R3T3_SHIFT)) & LPUART_DATA_R3T3_MASK) - -#define LPUART_DATA_R4T4_MASK (0x10U) -#define LPUART_DATA_R4T4_SHIFT (4U) -/*! R4T4 - Read receive FIFO bit 4 or write transmit FIFO bit 4 */ -#define LPUART_DATA_R4T4(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R4T4_SHIFT)) & LPUART_DATA_R4T4_MASK) - -#define LPUART_DATA_R5T5_MASK (0x20U) -#define LPUART_DATA_R5T5_SHIFT (5U) -/*! R5T5 - Read receive FIFO bit 5 or write transmit FIFO bit 5 */ -#define LPUART_DATA_R5T5(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R5T5_SHIFT)) & LPUART_DATA_R5T5_MASK) - -#define LPUART_DATA_R6T6_MASK (0x40U) -#define LPUART_DATA_R6T6_SHIFT (6U) -/*! R6T6 - Read receive FIFO bit 6 or write transmit FIFO bit 6 */ -#define LPUART_DATA_R6T6(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R6T6_SHIFT)) & LPUART_DATA_R6T6_MASK) - -#define LPUART_DATA_R7T7_MASK (0x80U) -#define LPUART_DATA_R7T7_SHIFT (7U) -/*! R7T7 - Read receive FIFO bit 7 or write transmit FIFO bit 7 */ -#define LPUART_DATA_R7T7(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R7T7_SHIFT)) & LPUART_DATA_R7T7_MASK) - -#define LPUART_DATA_R8T8_MASK (0x100U) -#define LPUART_DATA_R8T8_SHIFT (8U) -/*! R8T8 - Read receive FIFO bit 8 or write transmit FIFO bit 8 */ -#define LPUART_DATA_R8T8(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R8T8_SHIFT)) & LPUART_DATA_R8T8_MASK) - -#define LPUART_DATA_R9T9_MASK (0x200U) -#define LPUART_DATA_R9T9_SHIFT (9U) -/*! R9T9 - Read receive FIFO bit 9 or write transmit FIFO bit 9 */ -#define LPUART_DATA_R9T9(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R9T9_SHIFT)) & LPUART_DATA_R9T9_MASK) - -#define LPUART_DATA_LINBRK_MASK (0x400U) -#define LPUART_DATA_LINBRK_SHIFT (10U) -/*! LINBRK - LIN Break - * 0b0..Not detected - * 0b1..Detected - */ -#define LPUART_DATA_LINBRK(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_LINBRK_SHIFT)) & LPUART_DATA_LINBRK_MASK) - -#define LPUART_DATA_IDLINE_MASK (0x800U) -#define LPUART_DATA_IDLINE_SHIFT (11U) -/*! IDLINE - Idle Line - * 0b0..Not idle - * 0b1..Idle - */ -#define LPUART_DATA_IDLINE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_IDLINE_SHIFT)) & LPUART_DATA_IDLINE_MASK) - -#define LPUART_DATA_RXEMPT_MASK (0x1000U) -#define LPUART_DATA_RXEMPT_SHIFT (12U) -/*! RXEMPT - Receive Buffer Empty - * 0b0..Valid data - * 0b1..Invalid data and empty - */ -#define LPUART_DATA_RXEMPT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_RXEMPT_SHIFT)) & LPUART_DATA_RXEMPT_MASK) - -#define LPUART_DATA_FRETSC_MASK (0x2000U) -#define LPUART_DATA_FRETSC_SHIFT (13U) -/*! FRETSC - Frame Error Transmit Special Character - * 0b0..Received without a frame error on reads or transmits a normal character on writes - * 0b1..Received with a frame error on reads or transmits an idle or break character on writes - */ -#define LPUART_DATA_FRETSC(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_FRETSC_SHIFT)) & LPUART_DATA_FRETSC_MASK) - -#define LPUART_DATA_PARITYE_MASK (0x4000U) -#define LPUART_DATA_PARITYE_SHIFT (14U) -/*! PARITYE - Parity Error - * 0b0..Received without a parity error - * 0b1..Received with a parity error - */ -#define LPUART_DATA_PARITYE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_PARITYE_SHIFT)) & LPUART_DATA_PARITYE_MASK) - -#define LPUART_DATA_NOISY_MASK (0x8000U) -#define LPUART_DATA_NOISY_SHIFT (15U) -/*! NOISY - Noisy Data Received - * 0b0..Received without noise - * 0b1..Received with noise - */ -#define LPUART_DATA_NOISY(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_NOISY_SHIFT)) & LPUART_DATA_NOISY_MASK) -/*! @} */ - -/*! @name MATCH - Match Address */ -/*! @{ */ - -#define LPUART_MATCH_MA1_MASK (0x3FFU) -#define LPUART_MATCH_MA1_SHIFT (0U) -/*! MA1 - Match Address 1 */ -#define LPUART_MATCH_MA1(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MATCH_MA1_SHIFT)) & LPUART_MATCH_MA1_MASK) - -#define LPUART_MATCH_MA2_MASK (0x3FF0000U) -#define LPUART_MATCH_MA2_SHIFT (16U) -/*! MA2 - Match Address 2 */ -#define LPUART_MATCH_MA2(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MATCH_MA2_SHIFT)) & LPUART_MATCH_MA2_MASK) -/*! @} */ - -/*! @name MODIR - MODEM IrDA */ -/*! @{ */ - -#define LPUART_MODIR_TXCTSE_MASK (0x1U) -#define LPUART_MODIR_TXCTSE_SHIFT (0U) -/*! TXCTSE - Transmitter CTS Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_MODIR_TXCTSE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_TXCTSE_SHIFT)) & LPUART_MODIR_TXCTSE_MASK) - -#define LPUART_MODIR_TXRTSE_MASK (0x2U) -#define LPUART_MODIR_TXRTSE_SHIFT (1U) -/*! TXRTSE - Transmitter RTS Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_MODIR_TXRTSE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_TXRTSE_SHIFT)) & LPUART_MODIR_TXRTSE_MASK) - -#define LPUART_MODIR_TXRTSPOL_MASK (0x4U) -#define LPUART_MODIR_TXRTSPOL_SHIFT (2U) -/*! TXRTSPOL - Transmitter RTS Polarity - * 0b0..Active low - * 0b1..Active high - */ -#define LPUART_MODIR_TXRTSPOL(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_TXRTSPOL_SHIFT)) & LPUART_MODIR_TXRTSPOL_MASK) - -#define LPUART_MODIR_RXRTSE_MASK (0x8U) -#define LPUART_MODIR_RXRTSE_SHIFT (3U) -/*! RXRTSE - Receiver RTS Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_MODIR_RXRTSE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_RXRTSE_SHIFT)) & LPUART_MODIR_RXRTSE_MASK) - -#define LPUART_MODIR_TXCTSC_MASK (0x10U) -#define LPUART_MODIR_TXCTSC_SHIFT (4U) -/*! TXCTSC - Transmit CTS Configuration - * 0b0..Sampled at the start of each character - * 0b1..Sampled when the transmitter is idle - */ -#define LPUART_MODIR_TXCTSC(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_TXCTSC_SHIFT)) & LPUART_MODIR_TXCTSC_MASK) - -#define LPUART_MODIR_TXCTSSRC_MASK (0x20U) -#define LPUART_MODIR_TXCTSSRC_SHIFT (5U) -/*! TXCTSSRC - Transmit CTS Source - * 0b0..The CTS_B pin - * 0b1..An internal connection to the receiver address match result - */ -#define LPUART_MODIR_TXCTSSRC(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_TXCTSSRC_SHIFT)) & LPUART_MODIR_TXCTSSRC_MASK) - -#define LPUART_MODIR_RTSWATER_MASK (0x700U) -#define LPUART_MODIR_RTSWATER_SHIFT (8U) -/*! RTSWATER - Receive RTS Configuration */ -#define LPUART_MODIR_RTSWATER(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_RTSWATER_SHIFT)) & LPUART_MODIR_RTSWATER_MASK) - -#define LPUART_MODIR_TNP_MASK (0x30000U) -#define LPUART_MODIR_TNP_SHIFT (16U) -/*! TNP - Transmitter Narrow Pulse - * 0b00..1 / OSR - * 0b01..2 / OSR - * 0b10..3 / OSR - * 0b11..4 / OSR - */ -#define LPUART_MODIR_TNP(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_TNP_SHIFT)) & LPUART_MODIR_TNP_MASK) - -#define LPUART_MODIR_IREN_MASK (0x40000U) -#define LPUART_MODIR_IREN_SHIFT (18U) -/*! IREN - IR Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_MODIR_IREN(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_IREN_SHIFT)) & LPUART_MODIR_IREN_MASK) -/*! @} */ - -/*! @name FIFO - FIFO */ -/*! @{ */ - -#define LPUART_FIFO_RXFIFOSIZE_MASK (0x7U) -#define LPUART_FIFO_RXFIFOSIZE_SHIFT (0U) -/*! RXFIFOSIZE - Receive FIFO Buffer Depth - * 0b000..1 - * 0b001..4 - * 0b010..8 - * 0b011..16 - * 0b100..32 - * 0b101..64 - * 0b110..128 - * 0b111..256 - */ -#define LPUART_FIFO_RXFIFOSIZE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXFIFOSIZE_SHIFT)) & LPUART_FIFO_RXFIFOSIZE_MASK) - -#define LPUART_FIFO_RXFE_MASK (0x8U) -#define LPUART_FIFO_RXFE_SHIFT (3U) -/*! RXFE - Receive FIFO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_FIFO_RXFE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXFE_SHIFT)) & LPUART_FIFO_RXFE_MASK) - -#define LPUART_FIFO_TXFIFOSIZE_MASK (0x70U) -#define LPUART_FIFO_TXFIFOSIZE_SHIFT (4U) -/*! TXFIFOSIZE - Transmit FIFO Buffer Depth - * 0b000..1 - * 0b001..4 - * 0b010..8 - * 0b011..16 - * 0b100..32 - * 0b101..64 - * 0b110..128 - * 0b111..256 - */ -#define LPUART_FIFO_TXFIFOSIZE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_TXFIFOSIZE_SHIFT)) & LPUART_FIFO_TXFIFOSIZE_MASK) - -#define LPUART_FIFO_TXFE_MASK (0x80U) -#define LPUART_FIFO_TXFE_SHIFT (7U) -/*! TXFE - Transmit FIFO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_FIFO_TXFE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_TXFE_SHIFT)) & LPUART_FIFO_TXFE_MASK) - -#define LPUART_FIFO_RXUFE_MASK (0x100U) -#define LPUART_FIFO_RXUFE_SHIFT (8U) -/*! RXUFE - Receive FIFO Underflow Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_FIFO_RXUFE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXUFE_SHIFT)) & LPUART_FIFO_RXUFE_MASK) - -#define LPUART_FIFO_TXOFE_MASK (0x200U) -#define LPUART_FIFO_TXOFE_SHIFT (9U) -/*! TXOFE - Transmit FIFO Overflow Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_FIFO_TXOFE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_TXOFE_SHIFT)) & LPUART_FIFO_TXOFE_MASK) - -#define LPUART_FIFO_RXIDEN_MASK (0x1C00U) -#define LPUART_FIFO_RXIDEN_SHIFT (10U) -/*! RXIDEN - Receiver Idle Empty Enable - * 0b000..Disable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle - * 0b001..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for one character - * 0b010..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for two characters - * 0b011..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for four characters - * 0b100..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for eight characters - * 0b101..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for 16 characters - * 0b110..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for 32 characters - * 0b111..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for 64 characters - */ -#define LPUART_FIFO_RXIDEN(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXIDEN_SHIFT)) & LPUART_FIFO_RXIDEN_MASK) - -#define LPUART_FIFO_RXFLUSH_MASK (0x4000U) -#define LPUART_FIFO_RXFLUSH_SHIFT (14U) -/*! RXFLUSH - Receive FIFO Flush - * 0b0..No effect - * 0b1..All data flushed out - */ -#define LPUART_FIFO_RXFLUSH(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXFLUSH_SHIFT)) & LPUART_FIFO_RXFLUSH_MASK) - -#define LPUART_FIFO_TXFLUSH_MASK (0x8000U) -#define LPUART_FIFO_TXFLUSH_SHIFT (15U) -/*! TXFLUSH - Transmit FIFO Flush - * 0b0..No effect - * 0b1..All data flushed out - */ -#define LPUART_FIFO_TXFLUSH(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_TXFLUSH_SHIFT)) & LPUART_FIFO_TXFLUSH_MASK) - -#define LPUART_FIFO_RXUF_MASK (0x10000U) -#define LPUART_FIFO_RXUF_SHIFT (16U) -/*! RXUF - Receiver FIFO Underflow Flag - * 0b0..No underflow - * 0b1..Underflow - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_FIFO_RXUF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXUF_SHIFT)) & LPUART_FIFO_RXUF_MASK) - -#define LPUART_FIFO_TXOF_MASK (0x20000U) -#define LPUART_FIFO_TXOF_SHIFT (17U) -/*! TXOF - Transmitter FIFO Overflow Flag - * 0b0..No overflow - * 0b1..Overflow - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_FIFO_TXOF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_TXOF_SHIFT)) & LPUART_FIFO_TXOF_MASK) - -#define LPUART_FIFO_RXEMPT_MASK (0x400000U) -#define LPUART_FIFO_RXEMPT_SHIFT (22U) -/*! RXEMPT - Receive FIFO Or Buffer Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPUART_FIFO_RXEMPT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXEMPT_SHIFT)) & LPUART_FIFO_RXEMPT_MASK) - -#define LPUART_FIFO_TXEMPT_MASK (0x800000U) -#define LPUART_FIFO_TXEMPT_SHIFT (23U) -/*! TXEMPT - Transmit FIFO Or Buffer Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPUART_FIFO_TXEMPT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_TXEMPT_SHIFT)) & LPUART_FIFO_TXEMPT_MASK) -/*! @} */ - -/*! @name WATER - Watermark */ -/*! @{ */ - -#define LPUART_WATER_TXWATER_MASK (0x7U) -#define LPUART_WATER_TXWATER_SHIFT (0U) -/*! TXWATER - Transmit Watermark */ -#define LPUART_WATER_TXWATER(x) (((uint32_t)(((uint32_t)(x)) << LPUART_WATER_TXWATER_SHIFT)) & LPUART_WATER_TXWATER_MASK) - -#define LPUART_WATER_TXCOUNT_MASK (0xF00U) -#define LPUART_WATER_TXCOUNT_SHIFT (8U) -/*! TXCOUNT - Transmit Counter */ -#define LPUART_WATER_TXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_WATER_TXCOUNT_SHIFT)) & LPUART_WATER_TXCOUNT_MASK) - -#define LPUART_WATER_RXWATER_MASK (0x70000U) -#define LPUART_WATER_RXWATER_SHIFT (16U) -/*! RXWATER - Receive Watermark */ -#define LPUART_WATER_RXWATER(x) (((uint32_t)(((uint32_t)(x)) << LPUART_WATER_RXWATER_SHIFT)) & LPUART_WATER_RXWATER_MASK) - -#define LPUART_WATER_RXCOUNT_MASK (0xF000000U) -#define LPUART_WATER_RXCOUNT_SHIFT (24U) -/*! RXCOUNT - Receive Counter */ -#define LPUART_WATER_RXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_WATER_RXCOUNT_SHIFT)) & LPUART_WATER_RXCOUNT_MASK) -/*! @} */ - -/*! @name DATARO - Data Read-Only */ -/*! @{ */ - -#define LPUART_DATARO_DATA_MASK (0xFFFFU) -#define LPUART_DATARO_DATA_SHIFT (0U) -/*! DATA - Receive Data */ -#define LPUART_DATARO_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATARO_DATA_SHIFT)) & LPUART_DATARO_DATA_MASK) -/*! @} */ - -/*! @name MCR - MODEM Control */ -/*! @{ */ - -#define LPUART_MCR_CTS_MASK (0x1U) -#define LPUART_MCR_CTS_SHIFT (0U) -/*! CTS - Clear To Send - * 0b0..Disable interrupt - * 0b1..Enable interrupt - */ -#define LPUART_MCR_CTS(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MCR_CTS_SHIFT)) & LPUART_MCR_CTS_MASK) - -#define LPUART_MCR_DSR_MASK (0x2U) -#define LPUART_MCR_DSR_SHIFT (1U) -/*! DSR - Data Set Ready - * 0b0..Disable interrupt - * 0b1..Enable interrupt - */ -#define LPUART_MCR_DSR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MCR_DSR_SHIFT)) & LPUART_MCR_DSR_MASK) - -#define LPUART_MCR_RIN_MASK (0x4U) -#define LPUART_MCR_RIN_SHIFT (2U) -/*! RIN - Ring Indicator - * 0b0..Disable interrupt - * 0b1..Enable interrupt - */ -#define LPUART_MCR_RIN(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MCR_RIN_SHIFT)) & LPUART_MCR_RIN_MASK) - -#define LPUART_MCR_DCD_MASK (0x8U) -#define LPUART_MCR_DCD_SHIFT (3U) -/*! DCD - Data Carrier Detect - * 0b0..Disable interrupt - * 0b1..Enable interrupt - */ -#define LPUART_MCR_DCD(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MCR_DCD_SHIFT)) & LPUART_MCR_DCD_MASK) - -#define LPUART_MCR_DTR_MASK (0x100U) -#define LPUART_MCR_DTR_SHIFT (8U) -/*! DTR - Data Terminal Ready - * 0b0..Logic one - * 0b1..Logic zero - */ -#define LPUART_MCR_DTR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MCR_DTR_SHIFT)) & LPUART_MCR_DTR_MASK) - -#define LPUART_MCR_RTS_MASK (0x200U) -#define LPUART_MCR_RTS_SHIFT (9U) -/*! RTS - Request To Send - * 0b0..Logic one - * 0b1..Logic zero - */ -#define LPUART_MCR_RTS(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MCR_RTS_SHIFT)) & LPUART_MCR_RTS_MASK) -/*! @} */ - -/*! @name MSR - MODEM Status */ -/*! @{ */ - -#define LPUART_MSR_DCTS_MASK (0x1U) -#define LPUART_MSR_DCTS_SHIFT (0U) -/*! DCTS - Delta Clear To Send - * 0b0..Did not change state - * 0b1..Changed state - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_MSR_DCTS(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MSR_DCTS_SHIFT)) & LPUART_MSR_DCTS_MASK) - -#define LPUART_MSR_DDSR_MASK (0x2U) -#define LPUART_MSR_DDSR_SHIFT (1U) -/*! DDSR - Delta Data Set Ready - * 0b0..Did not change state - * 0b1..Changed state - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_MSR_DDSR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MSR_DDSR_SHIFT)) & LPUART_MSR_DDSR_MASK) - -#define LPUART_MSR_DRI_MASK (0x4U) -#define LPUART_MSR_DRI_SHIFT (2U) -/*! DRI - Delta Ring Indicator - * 0b0..Did not change state - * 0b1..Changed state - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_MSR_DRI(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MSR_DRI_SHIFT)) & LPUART_MSR_DRI_MASK) - -#define LPUART_MSR_DDCD_MASK (0x8U) -#define LPUART_MSR_DDCD_SHIFT (3U) -/*! DDCD - Delta Data Carrier Detect - * 0b0..Did not change state - * 0b1..Changed state - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_MSR_DDCD(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MSR_DDCD_SHIFT)) & LPUART_MSR_DDCD_MASK) - -#define LPUART_MSR_CTS_MASK (0x10U) -#define LPUART_MSR_CTS_SHIFT (4U) -/*! CTS - Clear To Send - * 0b0..Logic one - * 0b1..Logic zero - */ -#define LPUART_MSR_CTS(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MSR_CTS_SHIFT)) & LPUART_MSR_CTS_MASK) - -#define LPUART_MSR_DSR_MASK (0x20U) -#define LPUART_MSR_DSR_SHIFT (5U) -/*! DSR - Data Set Ready - * 0b0..Logic one - * 0b1..Logic zero - */ -#define LPUART_MSR_DSR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MSR_DSR_SHIFT)) & LPUART_MSR_DSR_MASK) - -#define LPUART_MSR_RIN_MASK (0x40U) -#define LPUART_MSR_RIN_SHIFT (6U) -/*! RIN - Ring Indicator - * 0b0..Logic one - * 0b1..Logic zero - */ -#define LPUART_MSR_RIN(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MSR_RIN_SHIFT)) & LPUART_MSR_RIN_MASK) - -#define LPUART_MSR_DCD_MASK (0x80U) -#define LPUART_MSR_DCD_SHIFT (7U) -/*! DCD - Data Carrier Detect - * 0b0..Logic one - * 0b1..Logic zero - */ -#define LPUART_MSR_DCD(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MSR_DCD_SHIFT)) & LPUART_MSR_DCD_MASK) -/*! @} */ - -/*! @name REIR - Receiver Extended Idle */ -/*! @{ */ - -#define LPUART_REIR_IDTIME_MASK (0x3FFFU) -#define LPUART_REIR_IDTIME_SHIFT (0U) -/*! IDTIME - Idle Time */ -#define LPUART_REIR_IDTIME(x) (((uint32_t)(((uint32_t)(x)) << LPUART_REIR_IDTIME_SHIFT)) & LPUART_REIR_IDTIME_MASK) -/*! @} */ - -/*! @name TEIR - Transmitter Extended Idle */ -/*! @{ */ - -#define LPUART_TEIR_IDTIME_MASK (0x3FFFU) -#define LPUART_TEIR_IDTIME_SHIFT (0U) -/*! IDTIME - Idle Time */ -#define LPUART_TEIR_IDTIME(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TEIR_IDTIME_SHIFT)) & LPUART_TEIR_IDTIME_MASK) -/*! @} */ - -/*! @name HDCR - Half Duplex Control */ -/*! @{ */ - -#define LPUART_HDCR_TXSTALL_MASK (0x1U) -#define LPUART_HDCR_TXSTALL_SHIFT (0U) -/*! TXSTALL - Transmit Stall - * 0b0..No effect - * 0b1..Does not become busy - */ -#define LPUART_HDCR_TXSTALL(x) (((uint32_t)(((uint32_t)(x)) << LPUART_HDCR_TXSTALL_SHIFT)) & LPUART_HDCR_TXSTALL_MASK) - -#define LPUART_HDCR_RXSEL_MASK (0x2U) -#define LPUART_HDCR_RXSEL_SHIFT (1U) -/*! RXSEL - Receive Select - * 0b0..RXD - * 0b1..TXD - */ -#define LPUART_HDCR_RXSEL(x) (((uint32_t)(((uint32_t)(x)) << LPUART_HDCR_RXSEL_SHIFT)) & LPUART_HDCR_RXSEL_MASK) - -#define LPUART_HDCR_RXWRMSK_MASK (0x4U) -#define LPUART_HDCR_RXWRMSK_SHIFT (2U) -/*! RXWRMSK - Receive FIFO Write Mask - * 0b0..Do not mask - * 0b1..Mask - */ -#define LPUART_HDCR_RXWRMSK(x) (((uint32_t)(((uint32_t)(x)) << LPUART_HDCR_RXWRMSK_SHIFT)) & LPUART_HDCR_RXWRMSK_MASK) - -#define LPUART_HDCR_RXMSK_MASK (0x8U) -#define LPUART_HDCR_RXMSK_SHIFT (3U) -/*! RXMSK - Receive Mask - * 0b0..Do not mask - * 0b1..Mask - */ -#define LPUART_HDCR_RXMSK(x) (((uint32_t)(((uint32_t)(x)) << LPUART_HDCR_RXMSK_SHIFT)) & LPUART_HDCR_RXMSK_MASK) - -#define LPUART_HDCR_RTSEXT_MASK (0xFF00U) -#define LPUART_HDCR_RTSEXT_SHIFT (8U) -/*! RTSEXT - RTS Extended */ -#define LPUART_HDCR_RTSEXT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_HDCR_RTSEXT_SHIFT)) & LPUART_HDCR_RTSEXT_MASK) -/*! @} */ - -/*! @name TOCR - Timeout Control */ -/*! @{ */ - -#define LPUART_TOCR_TOEN_MASK (0xFU) -#define LPUART_TOCR_TOEN_SHIFT (0U) -/*! TOEN - Timeout Enable */ -#define LPUART_TOCR_TOEN(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TOCR_TOEN_SHIFT)) & LPUART_TOCR_TOEN_MASK) - -#define LPUART_TOCR_TOIE_MASK (0xF00U) -#define LPUART_TOCR_TOIE_SHIFT (8U) -/*! TOIE - Timeout Interrupt Enable */ -#define LPUART_TOCR_TOIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TOCR_TOIE_SHIFT)) & LPUART_TOCR_TOIE_MASK) -/*! @} */ - -/*! @name TOSR - Timeout Status */ -/*! @{ */ - -#define LPUART_TOSR_TOZ_MASK (0xFU) -#define LPUART_TOSR_TOZ_SHIFT (0U) -/*! TOZ - Timeout Zero */ -#define LPUART_TOSR_TOZ(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TOSR_TOZ_SHIFT)) & LPUART_TOSR_TOZ_MASK) - -#define LPUART_TOSR_TOF_MASK (0xF00U) -#define LPUART_TOSR_TOF_SHIFT (8U) -/*! TOF - Timeout Flag - * 0b0000..Not occurred - * 0b0001..Occurred - * 0b0000..No effect - * 0b0001..Clear the flag - */ -#define LPUART_TOSR_TOF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TOSR_TOF_SHIFT)) & LPUART_TOSR_TOF_MASK) -/*! @} */ - -/*! @name TIMEOUT - Timeout N */ -/*! @{ */ - -#define LPUART_TIMEOUT_TIMEOUT_MASK (0x3FFFU) -#define LPUART_TIMEOUT_TIMEOUT_SHIFT (0U) -/*! TIMEOUT - Timeout Value */ -#define LPUART_TIMEOUT_TIMEOUT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TIMEOUT_TIMEOUT_SHIFT)) & LPUART_TIMEOUT_TIMEOUT_MASK) - -#define LPUART_TIMEOUT_CFG_MASK (0xC0000000U) -#define LPUART_TIMEOUT_CFG_SHIFT (30U) -/*! CFG - Idle Configuration - * 0b00..Becomes 1 after timeout characters are received - * 0b01..Becomes 1 when idle for timeout bit clocks - * 0b10..Becomes 1 when idle for timeout bit clocks following the next character - * 0b11..Becomes 1 when idle for at least timeout bit clocks, but a new character is detected before the extended idle timeout is reached - */ -#define LPUART_TIMEOUT_CFG(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TIMEOUT_CFG_SHIFT)) & LPUART_TIMEOUT_CFG_MASK) -/*! @} */ - -/* The count of LPUART_TIMEOUT */ -#define LPUART_TIMEOUT_COUNT (4U) - -/*! @name TCBR - Transmit Command Burst */ -/*! @{ */ - -#define LPUART_TCBR_DATA_MASK (0xFFFFU) -#define LPUART_TCBR_DATA_SHIFT (0U) -/*! DATA - Data */ -#define LPUART_TCBR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TCBR_DATA_SHIFT)) & LPUART_TCBR_DATA_MASK) -/*! @} */ - -/* The count of LPUART_TCBR */ -#define LPUART_TCBR_COUNT (128U) - -/*! @name TDBR - Transmit Data Burst */ -/*! @{ */ - -#define LPUART_TDBR_DATA0_MASK (0xFFU) -#define LPUART_TDBR_DATA0_SHIFT (0U) -/*! DATA0 - Data0 */ -#define LPUART_TDBR_DATA0(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TDBR_DATA0_SHIFT)) & LPUART_TDBR_DATA0_MASK) - -#define LPUART_TDBR_DATA1_MASK (0xFF00U) -#define LPUART_TDBR_DATA1_SHIFT (8U) -/*! DATA1 - Data1 */ -#define LPUART_TDBR_DATA1(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TDBR_DATA1_SHIFT)) & LPUART_TDBR_DATA1_MASK) - -#define LPUART_TDBR_DATA2_MASK (0xFF0000U) -#define LPUART_TDBR_DATA2_SHIFT (16U) -/*! DATA2 - Data2 */ -#define LPUART_TDBR_DATA2(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TDBR_DATA2_SHIFT)) & LPUART_TDBR_DATA2_MASK) - -#define LPUART_TDBR_DATA3_MASK (0xFF000000U) -#define LPUART_TDBR_DATA3_SHIFT (24U) -/*! DATA3 - Data3 */ -#define LPUART_TDBR_DATA3(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TDBR_DATA3_SHIFT)) & LPUART_TDBR_DATA3_MASK) -/*! @} */ - -/* The count of LPUART_TDBR */ -#define LPUART_TDBR_COUNT (256U) - - -/*! - * @} - */ /* end of group LPUART_Register_Masks */ - - -/* LPUART - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral LPUART0 base address */ - #define LPUART0_BASE (0x50092000u) - /** Peripheral LPUART0 base address */ - #define LPUART0_BASE_NS (0x40092000u) - /** Peripheral LPUART0 base pointer */ - #define LPUART0 ((LPUART_Type *)LPUART0_BASE) - /** Peripheral LPUART0 base pointer */ - #define LPUART0_NS ((LPUART_Type *)LPUART0_BASE_NS) - /** Peripheral LPUART1 base address */ - #define LPUART1_BASE (0x50093000u) - /** Peripheral LPUART1 base address */ - #define LPUART1_BASE_NS (0x40093000u) - /** Peripheral LPUART1 base pointer */ - #define LPUART1 ((LPUART_Type *)LPUART1_BASE) - /** Peripheral LPUART1 base pointer */ - #define LPUART1_NS ((LPUART_Type *)LPUART1_BASE_NS) - /** Peripheral LPUART2 base address */ - #define LPUART2_BASE (0x50094000u) - /** Peripheral LPUART2 base address */ - #define LPUART2_BASE_NS (0x40094000u) - /** Peripheral LPUART2 base pointer */ - #define LPUART2 ((LPUART_Type *)LPUART2_BASE) - /** Peripheral LPUART2 base pointer */ - #define LPUART2_NS ((LPUART_Type *)LPUART2_BASE_NS) - /** Peripheral LPUART3 base address */ - #define LPUART3_BASE (0x50095000u) - /** Peripheral LPUART3 base address */ - #define LPUART3_BASE_NS (0x40095000u) - /** Peripheral LPUART3 base pointer */ - #define LPUART3 ((LPUART_Type *)LPUART3_BASE) - /** Peripheral LPUART3 base pointer */ - #define LPUART3_NS ((LPUART_Type *)LPUART3_BASE_NS) - /** Peripheral LPUART4 base address */ - #define LPUART4_BASE (0x500B4000u) - /** Peripheral LPUART4 base address */ - #define LPUART4_BASE_NS (0x400B4000u) - /** Peripheral LPUART4 base pointer */ - #define LPUART4 ((LPUART_Type *)LPUART4_BASE) - /** Peripheral LPUART4 base pointer */ - #define LPUART4_NS ((LPUART_Type *)LPUART4_BASE_NS) - /** Peripheral LPUART5 base address */ - #define LPUART5_BASE (0x500B5000u) - /** Peripheral LPUART5 base address */ - #define LPUART5_BASE_NS (0x400B5000u) - /** Peripheral LPUART5 base pointer */ - #define LPUART5 ((LPUART_Type *)LPUART5_BASE) - /** Peripheral LPUART5 base pointer */ - #define LPUART5_NS ((LPUART_Type *)LPUART5_BASE_NS) - /** Peripheral LPUART6 base address */ - #define LPUART6_BASE (0x500B6000u) - /** Peripheral LPUART6 base address */ - #define LPUART6_BASE_NS (0x400B6000u) - /** Peripheral LPUART6 base pointer */ - #define LPUART6 ((LPUART_Type *)LPUART6_BASE) - /** Peripheral LPUART6 base pointer */ - #define LPUART6_NS ((LPUART_Type *)LPUART6_BASE_NS) - /** Peripheral LPUART7 base address */ - #define LPUART7_BASE (0x500B7000u) - /** Peripheral LPUART7 base address */ - #define LPUART7_BASE_NS (0x400B7000u) - /** Peripheral LPUART7 base pointer */ - #define LPUART7 ((LPUART_Type *)LPUART7_BASE) - /** Peripheral LPUART7 base pointer */ - #define LPUART7_NS ((LPUART_Type *)LPUART7_BASE_NS) - /** Array initializer of LPUART peripheral base addresses */ - #define LPUART_BASE_ADDRS { LPUART0_BASE, LPUART1_BASE, LPUART2_BASE, LPUART3_BASE, LPUART4_BASE, LPUART5_BASE, LPUART6_BASE, LPUART7_BASE } - /** Array initializer of LPUART peripheral base pointers */ - #define LPUART_BASE_PTRS { LPUART0, LPUART1, LPUART2, LPUART3, LPUART4, LPUART5, LPUART6, LPUART7 } - /** Array initializer of LPUART peripheral base addresses */ - #define LPUART_BASE_ADDRS_NS { LPUART0_BASE_NS, LPUART1_BASE_NS, LPUART2_BASE_NS, LPUART3_BASE_NS, LPUART4_BASE_NS, LPUART5_BASE_NS, LPUART6_BASE_NS, LPUART7_BASE_NS } - /** Array initializer of LPUART peripheral base pointers */ - #define LPUART_BASE_PTRS_NS { LPUART0_NS, LPUART1_NS, LPUART2_NS, LPUART3_NS, LPUART4_NS, LPUART5_NS, LPUART6_NS, LPUART7_NS } -#else - /** Peripheral LPUART0 base address */ - #define LPUART0_BASE (0x40092000u) - /** Peripheral LPUART0 base pointer */ - #define LPUART0 ((LPUART_Type *)LPUART0_BASE) - /** Peripheral LPUART1 base address */ - #define LPUART1_BASE (0x40093000u) - /** Peripheral LPUART1 base pointer */ - #define LPUART1 ((LPUART_Type *)LPUART1_BASE) - /** Peripheral LPUART2 base address */ - #define LPUART2_BASE (0x40094000u) - /** Peripheral LPUART2 base pointer */ - #define LPUART2 ((LPUART_Type *)LPUART2_BASE) - /** Peripheral LPUART3 base address */ - #define LPUART3_BASE (0x40095000u) - /** Peripheral LPUART3 base pointer */ - #define LPUART3 ((LPUART_Type *)LPUART3_BASE) - /** Peripheral LPUART4 base address */ - #define LPUART4_BASE (0x400B4000u) - /** Peripheral LPUART4 base pointer */ - #define LPUART4 ((LPUART_Type *)LPUART4_BASE) - /** Peripheral LPUART5 base address */ - #define LPUART5_BASE (0x400B5000u) - /** Peripheral LPUART5 base pointer */ - #define LPUART5 ((LPUART_Type *)LPUART5_BASE) - /** Peripheral LPUART6 base address */ - #define LPUART6_BASE (0x400B6000u) - /** Peripheral LPUART6 base pointer */ - #define LPUART6 ((LPUART_Type *)LPUART6_BASE) - /** Peripheral LPUART7 base address */ - #define LPUART7_BASE (0x400B7000u) - /** Peripheral LPUART7 base pointer */ - #define LPUART7 ((LPUART_Type *)LPUART7_BASE) - /** Array initializer of LPUART peripheral base addresses */ - #define LPUART_BASE_ADDRS { LPUART0_BASE, LPUART1_BASE, LPUART2_BASE, LPUART3_BASE, LPUART4_BASE, LPUART5_BASE, LPUART6_BASE, LPUART7_BASE } - /** Array initializer of LPUART peripheral base pointers */ - #define LPUART_BASE_PTRS { LPUART0, LPUART1, LPUART2, LPUART3, LPUART4, LPUART5, LPUART6, LPUART7 } -#endif -/** Interrupt vectors for the LPUART peripheral type */ -#define LPUART_RX_TX_IRQS { LP_FLEXCOMM0_IRQn, LP_FLEXCOMM1_IRQn, LP_FLEXCOMM2_IRQn, LP_FLEXCOMM3_IRQn, LP_FLEXCOMM4_IRQn, LP_FLEXCOMM5_IRQn, LP_FLEXCOMM6_IRQn, LP_FLEXCOMM7_IRQn } -#define LPUART_ERR_IRQS { LP_FLEXCOMM0_IRQn, LP_FLEXCOMM1_IRQn, LP_FLEXCOMM2_IRQn, LP_FLEXCOMM3_IRQn, LP_FLEXCOMM4_IRQn, LP_FLEXCOMM5_IRQn, LP_FLEXCOMM6_IRQn, LP_FLEXCOMM7_IRQn } - -/*! - * @} - */ /* end of group LPUART_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LP_FLEXCOMM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LP_FLEXCOMM_Peripheral_Access_Layer LP_FLEXCOMM Peripheral Access Layer - * @{ - */ - -/** LP_FLEXCOMM - Register Layout Typedef */ -typedef struct { - uint8_t RESERVED_0[4084]; - __I uint32_t ISTAT; /**< Interrupt Status, offset: 0xFF4 */ - __IO uint32_t PSELID; /**< Peripheral Select and ID, offset: 0xFF8 */ -} LP_FLEXCOMM_Type; - -/* ---------------------------------------------------------------------------- - -- LP_FLEXCOMM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LP_FLEXCOMM_Register_Masks LP_FLEXCOMM Register Masks - * @{ - */ - -/*! @name ISTAT - Interrupt Status */ -/*! @{ */ - -#define LP_FLEXCOMM_ISTAT_UARTTX_MASK (0x1U) -#define LP_FLEXCOMM_ISTAT_UARTTX_SHIFT (0U) -/*! UARTTX - UART TX Interrupt - * 0b0..Clear - * 0b1..Set - */ -#define LP_FLEXCOMM_ISTAT_UARTTX(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_ISTAT_UARTTX_SHIFT)) & LP_FLEXCOMM_ISTAT_UARTTX_MASK) - -#define LP_FLEXCOMM_ISTAT_UARTRX_MASK (0x2U) -#define LP_FLEXCOMM_ISTAT_UARTRX_SHIFT (1U) -/*! UARTRX - UART RX Interrupt - * 0b0..Clear - * 0b1..Set - */ -#define LP_FLEXCOMM_ISTAT_UARTRX(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_ISTAT_UARTRX_SHIFT)) & LP_FLEXCOMM_ISTAT_UARTRX_MASK) - -#define LP_FLEXCOMM_ISTAT_SPI_MASK (0x4U) -#define LP_FLEXCOMM_ISTAT_SPI_SHIFT (2U) -/*! SPI - SPI Interrupt - * 0b0..Clear - * 0b1..Set - */ -#define LP_FLEXCOMM_ISTAT_SPI(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_ISTAT_SPI_SHIFT)) & LP_FLEXCOMM_ISTAT_SPI_MASK) - -#define LP_FLEXCOMM_ISTAT_I2CM_MASK (0x10U) -#define LP_FLEXCOMM_ISTAT_I2CM_SHIFT (4U) -/*! I2CM - I2C Controller Interrupt - * 0b0..Clear - * 0b1..Set - */ -#define LP_FLEXCOMM_ISTAT_I2CM(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_ISTAT_I2CM_SHIFT)) & LP_FLEXCOMM_ISTAT_I2CM_MASK) - -#define LP_FLEXCOMM_ISTAT_I2CS_MASK (0x20U) -#define LP_FLEXCOMM_ISTAT_I2CS_SHIFT (5U) -/*! I2CS - I2C Subordinate Interrupt - * 0b0..Clear - * 0b1..Set - */ -#define LP_FLEXCOMM_ISTAT_I2CS(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_ISTAT_I2CS_SHIFT)) & LP_FLEXCOMM_ISTAT_I2CS_MASK) -/*! @} */ - -/*! @name PSELID - Peripheral Select and ID */ -/*! @{ */ - -#define LP_FLEXCOMM_PSELID_PERSEL_MASK (0x7U) -#define LP_FLEXCOMM_PSELID_PERSEL_SHIFT (0U) -/*! PERSEL - Peripheral Select - * 0b000..No peripheral selected - * 0b001..UART - * 0b011..I2C - * 0b111..UART and I2C - * 0b010..SPI - */ -#define LP_FLEXCOMM_PSELID_PERSEL(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_PSELID_PERSEL_SHIFT)) & LP_FLEXCOMM_PSELID_PERSEL_MASK) - -#define LP_FLEXCOMM_PSELID_LOCK_MASK (0x8U) -#define LP_FLEXCOMM_PSELID_LOCK_SHIFT (3U) -/*! LOCK - Lock - * 0b0..PERSEL is writable - * 0b1..PERSEL is not writable - */ -#define LP_FLEXCOMM_PSELID_LOCK(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_PSELID_LOCK_SHIFT)) & LP_FLEXCOMM_PSELID_LOCK_MASK) - -#define LP_FLEXCOMM_PSELID_UARTPRESENT_MASK (0x10U) -#define LP_FLEXCOMM_PSELID_UARTPRESENT_SHIFT (4U) -/*! UARTPRESENT - UART Present - * 0b0..Not supported - * 0b1..Supported - */ -#define LP_FLEXCOMM_PSELID_UARTPRESENT(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_PSELID_UARTPRESENT_SHIFT)) & LP_FLEXCOMM_PSELID_UARTPRESENT_MASK) - -#define LP_FLEXCOMM_PSELID_SPIPRESENT_MASK (0x20U) -#define LP_FLEXCOMM_PSELID_SPIPRESENT_SHIFT (5U) -/*! SPIPRESENT - SPI Present - * 0b0..Not supported - * 0b1..Supported - */ -#define LP_FLEXCOMM_PSELID_SPIPRESENT(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_PSELID_SPIPRESENT_SHIFT)) & LP_FLEXCOMM_PSELID_SPIPRESENT_MASK) - -#define LP_FLEXCOMM_PSELID_I2CPRESENT_MASK (0x40U) -#define LP_FLEXCOMM_PSELID_I2CPRESENT_SHIFT (6U) -/*! I2CPRESENT - I2C Present - * 0b0..Not supported - * 0b1..Supported - */ -#define LP_FLEXCOMM_PSELID_I2CPRESENT(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_PSELID_I2CPRESENT_SHIFT)) & LP_FLEXCOMM_PSELID_I2CPRESENT_MASK) - -#define LP_FLEXCOMM_PSELID_ID_MASK (0xFFFFF000U) -#define LP_FLEXCOMM_PSELID_ID_SHIFT (12U) -/*! ID - LP_FLEXCOMM interface ID */ -#define LP_FLEXCOMM_PSELID_ID(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_PSELID_ID_SHIFT)) & LP_FLEXCOMM_PSELID_ID_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group LP_FLEXCOMM_Register_Masks */ - - -/* LP_FLEXCOMM - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral LP_FLEXCOMM0 base address */ - #define LP_FLEXCOMM0_BASE (0x50092000u) - /** Peripheral LP_FLEXCOMM0 base address */ - #define LP_FLEXCOMM0_BASE_NS (0x40092000u) - /** Peripheral LP_FLEXCOMM0 base pointer */ - #define LP_FLEXCOMM0 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM0_BASE) - /** Peripheral LP_FLEXCOMM0 base pointer */ - #define LP_FLEXCOMM0_NS ((LP_FLEXCOMM_Type *)LP_FLEXCOMM0_BASE_NS) - /** Peripheral LP_FLEXCOMM1 base address */ - #define LP_FLEXCOMM1_BASE (0x50093000u) - /** Peripheral LP_FLEXCOMM1 base address */ - #define LP_FLEXCOMM1_BASE_NS (0x40093000u) - /** Peripheral LP_FLEXCOMM1 base pointer */ - #define LP_FLEXCOMM1 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM1_BASE) - /** Peripheral LP_FLEXCOMM1 base pointer */ - #define LP_FLEXCOMM1_NS ((LP_FLEXCOMM_Type *)LP_FLEXCOMM1_BASE_NS) - /** Peripheral LP_FLEXCOMM2 base address */ - #define LP_FLEXCOMM2_BASE (0x50094000u) - /** Peripheral LP_FLEXCOMM2 base address */ - #define LP_FLEXCOMM2_BASE_NS (0x40094000u) - /** Peripheral LP_FLEXCOMM2 base pointer */ - #define LP_FLEXCOMM2 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM2_BASE) - /** Peripheral LP_FLEXCOMM2 base pointer */ - #define LP_FLEXCOMM2_NS ((LP_FLEXCOMM_Type *)LP_FLEXCOMM2_BASE_NS) - /** Peripheral LP_FLEXCOMM3 base address */ - #define LP_FLEXCOMM3_BASE (0x50095000u) - /** Peripheral LP_FLEXCOMM3 base address */ - #define LP_FLEXCOMM3_BASE_NS (0x40095000u) - /** Peripheral LP_FLEXCOMM3 base pointer */ - #define LP_FLEXCOMM3 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM3_BASE) - /** Peripheral LP_FLEXCOMM3 base pointer */ - #define LP_FLEXCOMM3_NS ((LP_FLEXCOMM_Type *)LP_FLEXCOMM3_BASE_NS) - /** Peripheral LP_FLEXCOMM4 base address */ - #define LP_FLEXCOMM4_BASE (0x500B4000u) - /** Peripheral LP_FLEXCOMM4 base address */ - #define LP_FLEXCOMM4_BASE_NS (0x400B4000u) - /** Peripheral LP_FLEXCOMM4 base pointer */ - #define LP_FLEXCOMM4 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM4_BASE) - /** Peripheral LP_FLEXCOMM4 base pointer */ - #define LP_FLEXCOMM4_NS ((LP_FLEXCOMM_Type *)LP_FLEXCOMM4_BASE_NS) - /** Peripheral LP_FLEXCOMM5 base address */ - #define LP_FLEXCOMM5_BASE (0x500B5000u) - /** Peripheral LP_FLEXCOMM5 base address */ - #define LP_FLEXCOMM5_BASE_NS (0x400B5000u) - /** Peripheral LP_FLEXCOMM5 base pointer */ - #define LP_FLEXCOMM5 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM5_BASE) - /** Peripheral LP_FLEXCOMM5 base pointer */ - #define LP_FLEXCOMM5_NS ((LP_FLEXCOMM_Type *)LP_FLEXCOMM5_BASE_NS) - /** Peripheral LP_FLEXCOMM6 base address */ - #define LP_FLEXCOMM6_BASE (0x500B6000u) - /** Peripheral LP_FLEXCOMM6 base address */ - #define LP_FLEXCOMM6_BASE_NS (0x400B6000u) - /** Peripheral LP_FLEXCOMM6 base pointer */ - #define LP_FLEXCOMM6 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM6_BASE) - /** Peripheral LP_FLEXCOMM6 base pointer */ - #define LP_FLEXCOMM6_NS ((LP_FLEXCOMM_Type *)LP_FLEXCOMM6_BASE_NS) - /** Peripheral LP_FLEXCOMM7 base address */ - #define LP_FLEXCOMM7_BASE (0x500B7000u) - /** Peripheral LP_FLEXCOMM7 base address */ - #define LP_FLEXCOMM7_BASE_NS (0x400B7000u) - /** Peripheral LP_FLEXCOMM7 base pointer */ - #define LP_FLEXCOMM7 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM7_BASE) - /** Peripheral LP_FLEXCOMM7 base pointer */ - #define LP_FLEXCOMM7_NS ((LP_FLEXCOMM_Type *)LP_FLEXCOMM7_BASE_NS) - /** Array initializer of LP_FLEXCOMM peripheral base addresses */ - #define LP_FLEXCOMM_BASE_ADDRS { LP_FLEXCOMM0_BASE, LP_FLEXCOMM1_BASE, LP_FLEXCOMM2_BASE, LP_FLEXCOMM3_BASE, LP_FLEXCOMM4_BASE, LP_FLEXCOMM5_BASE, LP_FLEXCOMM6_BASE, LP_FLEXCOMM7_BASE } - /** Array initializer of LP_FLEXCOMM peripheral base pointers */ - #define LP_FLEXCOMM_BASE_PTRS { LP_FLEXCOMM0, LP_FLEXCOMM1, LP_FLEXCOMM2, LP_FLEXCOMM3, LP_FLEXCOMM4, LP_FLEXCOMM5, LP_FLEXCOMM6, LP_FLEXCOMM7 } - /** Array initializer of LP_FLEXCOMM peripheral base addresses */ - #define LP_FLEXCOMM_BASE_ADDRS_NS { LP_FLEXCOMM0_BASE_NS, LP_FLEXCOMM1_BASE_NS, LP_FLEXCOMM2_BASE_NS, LP_FLEXCOMM3_BASE_NS, LP_FLEXCOMM4_BASE_NS, LP_FLEXCOMM5_BASE_NS, LP_FLEXCOMM6_BASE_NS, LP_FLEXCOMM7_BASE_NS } - /** Array initializer of LP_FLEXCOMM peripheral base pointers */ - #define LP_FLEXCOMM_BASE_PTRS_NS { LP_FLEXCOMM0_NS, LP_FLEXCOMM1_NS, LP_FLEXCOMM2_NS, LP_FLEXCOMM3_NS, LP_FLEXCOMM4_NS, LP_FLEXCOMM5_NS, LP_FLEXCOMM6_NS, LP_FLEXCOMM7_NS } -#else - /** Peripheral LP_FLEXCOMM0 base address */ - #define LP_FLEXCOMM0_BASE (0x40092000u) - /** Peripheral LP_FLEXCOMM0 base pointer */ - #define LP_FLEXCOMM0 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM0_BASE) - /** Peripheral LP_FLEXCOMM1 base address */ - #define LP_FLEXCOMM1_BASE (0x40093000u) - /** Peripheral LP_FLEXCOMM1 base pointer */ - #define LP_FLEXCOMM1 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM1_BASE) - /** Peripheral LP_FLEXCOMM2 base address */ - #define LP_FLEXCOMM2_BASE (0x40094000u) - /** Peripheral LP_FLEXCOMM2 base pointer */ - #define LP_FLEXCOMM2 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM2_BASE) - /** Peripheral LP_FLEXCOMM3 base address */ - #define LP_FLEXCOMM3_BASE (0x40095000u) - /** Peripheral LP_FLEXCOMM3 base pointer */ - #define LP_FLEXCOMM3 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM3_BASE) - /** Peripheral LP_FLEXCOMM4 base address */ - #define LP_FLEXCOMM4_BASE (0x400B4000u) - /** Peripheral LP_FLEXCOMM4 base pointer */ - #define LP_FLEXCOMM4 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM4_BASE) - /** Peripheral LP_FLEXCOMM5 base address */ - #define LP_FLEXCOMM5_BASE (0x400B5000u) - /** Peripheral LP_FLEXCOMM5 base pointer */ - #define LP_FLEXCOMM5 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM5_BASE) - /** Peripheral LP_FLEXCOMM6 base address */ - #define LP_FLEXCOMM6_BASE (0x400B6000u) - /** Peripheral LP_FLEXCOMM6 base pointer */ - #define LP_FLEXCOMM6 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM6_BASE) - /** Peripheral LP_FLEXCOMM7 base address */ - #define LP_FLEXCOMM7_BASE (0x400B7000u) - /** Peripheral LP_FLEXCOMM7 base pointer */ - #define LP_FLEXCOMM7 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM7_BASE) - /** Array initializer of LP_FLEXCOMM peripheral base addresses */ - #define LP_FLEXCOMM_BASE_ADDRS { LP_FLEXCOMM0_BASE, LP_FLEXCOMM1_BASE, LP_FLEXCOMM2_BASE, LP_FLEXCOMM3_BASE, LP_FLEXCOMM4_BASE, LP_FLEXCOMM5_BASE, LP_FLEXCOMM6_BASE, LP_FLEXCOMM7_BASE } - /** Array initializer of LP_FLEXCOMM peripheral base pointers */ - #define LP_FLEXCOMM_BASE_PTRS { LP_FLEXCOMM0, LP_FLEXCOMM1, LP_FLEXCOMM2, LP_FLEXCOMM3, LP_FLEXCOMM4, LP_FLEXCOMM5, LP_FLEXCOMM6, LP_FLEXCOMM7 } -#endif -/** Interrupt vectors for the LP_FLEXCOMM peripheral type */ -#define LP_FLEXCOMM_IRQS { LP_FLEXCOMM0_IRQn, LP_FLEXCOMM1_IRQn, LP_FLEXCOMM2_IRQn, LP_FLEXCOMM3_IRQn, LP_FLEXCOMM4_IRQn, LP_FLEXCOMM5_IRQn, LP_FLEXCOMM6_IRQn, LP_FLEXCOMM7_IRQn } - -/*! - * @} - */ /* end of group LP_FLEXCOMM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- MRT Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup MRT_Peripheral_Access_Layer MRT Peripheral Access Layer - * @{ - */ - -/** MRT - Register Layout Typedef */ -typedef struct { - struct { /* offset: 0x0, array step: 0x10 */ - __IO uint32_t INTVAL; /**< Time Interval Value, array offset: 0x0, array step: 0x10 */ - __I uint32_t TIMER; /**< Timer, array offset: 0x4, array step: 0x10 */ - __IO uint32_t CTRL; /**< Control, array offset: 0x8, array step: 0x10 */ - __IO uint32_t STAT; /**< Status, array offset: 0xC, array step: 0x10 */ - } CHANNEL[4]; - uint8_t RESERVED_0[176]; - __IO uint32_t MODCFG; /**< Module Configuration, offset: 0xF0 */ - __I uint32_t IDLE_CH; /**< Idle Channel, offset: 0xF4 */ - __IO uint32_t IRQ_FLAG; /**< Global Interrupt Flag, offset: 0xF8 */ -} MRT_Type; - -/* ---------------------------------------------------------------------------- - -- MRT Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup MRT_Register_Masks MRT Register Masks - * @{ - */ - -/*! @name CHANNEL_INTVAL - Time Interval Value */ -/*! @{ */ - -#define MRT_CHANNEL_INTVAL_IVALUE_MASK (0xFFFFFFU) -#define MRT_CHANNEL_INTVAL_IVALUE_SHIFT (0U) -/*! IVALUE - Time Interval Load Value. */ -#define MRT_CHANNEL_INTVAL_IVALUE(x) (((uint32_t)(((uint32_t)(x)) << MRT_CHANNEL_INTVAL_IVALUE_SHIFT)) & MRT_CHANNEL_INTVAL_IVALUE_MASK) - -#define MRT_CHANNEL_INTVAL_LOAD_MASK (0x80000000U) -#define MRT_CHANNEL_INTVAL_LOAD_SHIFT (31U) -/*! LOAD - Force Load Enable - * 0b0..No force load - * 0b1..Force load - */ -#define MRT_CHANNEL_INTVAL_LOAD(x) (((uint32_t)(((uint32_t)(x)) << MRT_CHANNEL_INTVAL_LOAD_SHIFT)) & MRT_CHANNEL_INTVAL_LOAD_MASK) -/*! @} */ - -/* The count of MRT_CHANNEL_INTVAL */ -#define MRT_CHANNEL_INTVAL_COUNT (4U) - -/*! @name CHANNEL_TIMER - Timer */ -/*! @{ */ - -#define MRT_CHANNEL_TIMER_VALUE_MASK (0xFFFFFFU) -#define MRT_CHANNEL_TIMER_VALUE_SHIFT (0U) -/*! VALUE - Current Timer Value */ -#define MRT_CHANNEL_TIMER_VALUE(x) (((uint32_t)(((uint32_t)(x)) << MRT_CHANNEL_TIMER_VALUE_SHIFT)) & MRT_CHANNEL_TIMER_VALUE_MASK) -/*! @} */ - -/* The count of MRT_CHANNEL_TIMER */ -#define MRT_CHANNEL_TIMER_COUNT (4U) - -/*! @name CHANNEL_CTRL - Control */ -/*! @{ */ - -#define MRT_CHANNEL_CTRL_INTEN_MASK (0x1U) -#define MRT_CHANNEL_CTRL_INTEN_SHIFT (0U) -/*! INTEN - Interrupt request - * 0b0..Disabled - * 0b1..Enabled - */ -#define MRT_CHANNEL_CTRL_INTEN(x) (((uint32_t)(((uint32_t)(x)) << MRT_CHANNEL_CTRL_INTEN_SHIFT)) & MRT_CHANNEL_CTRL_INTEN_MASK) - -#define MRT_CHANNEL_CTRL_MODE_MASK (0x6U) -#define MRT_CHANNEL_CTRL_MODE_SHIFT (1U) -/*! MODE - MRT Operating mode - * 0b00..Repeat Interrupt mode - * 0b01..One-Shot Interrupt mode - * 0b10..One-Shot Stall mode - * 0b11..Reserved - */ -#define MRT_CHANNEL_CTRL_MODE(x) (((uint32_t)(((uint32_t)(x)) << MRT_CHANNEL_CTRL_MODE_SHIFT)) & MRT_CHANNEL_CTRL_MODE_MASK) -/*! @} */ - -/* The count of MRT_CHANNEL_CTRL */ -#define MRT_CHANNEL_CTRL_COUNT (4U) - -/*! @name CHANNEL_STAT - Status */ -/*! @{ */ - -#define MRT_CHANNEL_STAT_INTFLAG_MASK (0x1U) -#define MRT_CHANNEL_STAT_INTFLAG_SHIFT (0U) -/*! INTFLAG - Interrupt Flag - * 0b0..No pending interrupt. - * 0b1..Pending interrupt. - */ -#define MRT_CHANNEL_STAT_INTFLAG(x) (((uint32_t)(((uint32_t)(x)) << MRT_CHANNEL_STAT_INTFLAG_SHIFT)) & MRT_CHANNEL_STAT_INTFLAG_MASK) - -#define MRT_CHANNEL_STAT_RUN_MASK (0x2U) -#define MRT_CHANNEL_STAT_RUN_SHIFT (1U) -/*! RUN - Timer n State - * 0b0..Idle state. - * 0b1..Running. - */ -#define MRT_CHANNEL_STAT_RUN(x) (((uint32_t)(((uint32_t)(x)) << MRT_CHANNEL_STAT_RUN_SHIFT)) & MRT_CHANNEL_STAT_RUN_MASK) - -#define MRT_CHANNEL_STAT_INUSE_MASK (0x4U) -#define MRT_CHANNEL_STAT_INUSE_SHIFT (2U) -/*! INUSE - Channel-In-Use flag - * 0b0..This timer channel is not in use. - * 0b1..This timer channel is in use. - */ -#define MRT_CHANNEL_STAT_INUSE(x) (((uint32_t)(((uint32_t)(x)) << MRT_CHANNEL_STAT_INUSE_SHIFT)) & MRT_CHANNEL_STAT_INUSE_MASK) -/*! @} */ - -/* The count of MRT_CHANNEL_STAT */ -#define MRT_CHANNEL_STAT_COUNT (4U) - -/*! @name MODCFG - Module Configuration */ -/*! @{ */ - -#define MRT_MODCFG_NOC_MASK (0xFU) -#define MRT_MODCFG_NOC_SHIFT (0U) -/*! NOC - Number of Channels */ -#define MRT_MODCFG_NOC(x) (((uint32_t)(((uint32_t)(x)) << MRT_MODCFG_NOC_SHIFT)) & MRT_MODCFG_NOC_MASK) - -#define MRT_MODCFG_NOB_MASK (0x1F0U) -#define MRT_MODCFG_NOB_SHIFT (4U) -/*! NOB - Number of Bits */ -#define MRT_MODCFG_NOB(x) (((uint32_t)(((uint32_t)(x)) << MRT_MODCFG_NOB_SHIFT)) & MRT_MODCFG_NOB_MASK) - -#define MRT_MODCFG_MULTITASK_MASK (0x80000000U) -#define MRT_MODCFG_MULTITASK_SHIFT (31U) -/*! MULTITASK - MULTITASK - * 0b0..Hardware status mode. - * 0b1..Multitask mode - */ -#define MRT_MODCFG_MULTITASK(x) (((uint32_t)(((uint32_t)(x)) << MRT_MODCFG_MULTITASK_SHIFT)) & MRT_MODCFG_MULTITASK_MASK) -/*! @} */ - -/*! @name IDLE_CH - Idle Channel */ -/*! @{ */ - -#define MRT_IDLE_CH_CHAN_MASK (0xF0U) -#define MRT_IDLE_CH_CHAN_SHIFT (4U) -/*! CHAN - Idle Channel */ -#define MRT_IDLE_CH_CHAN(x) (((uint32_t)(((uint32_t)(x)) << MRT_IDLE_CH_CHAN_SHIFT)) & MRT_IDLE_CH_CHAN_MASK) -/*! @} */ - -/*! @name IRQ_FLAG - Global Interrupt Flag */ -/*! @{ */ - -#define MRT_IRQ_FLAG_GFLAG0_MASK (0x1U) -#define MRT_IRQ_FLAG_GFLAG0_SHIFT (0U) -/*! GFLAG0 - Interrupt Flag - * 0b0..No pending interrupt. - * 0b1..Pending interrupt - */ -#define MRT_IRQ_FLAG_GFLAG0(x) (((uint32_t)(((uint32_t)(x)) << MRT_IRQ_FLAG_GFLAG0_SHIFT)) & MRT_IRQ_FLAG_GFLAG0_MASK) - -#define MRT_IRQ_FLAG_GFLAG1_MASK (0x2U) -#define MRT_IRQ_FLAG_GFLAG1_SHIFT (1U) -/*! GFLAG1 - Interrupt Flag */ -#define MRT_IRQ_FLAG_GFLAG1(x) (((uint32_t)(((uint32_t)(x)) << MRT_IRQ_FLAG_GFLAG1_SHIFT)) & MRT_IRQ_FLAG_GFLAG1_MASK) - -#define MRT_IRQ_FLAG_GFLAG2_MASK (0x4U) -#define MRT_IRQ_FLAG_GFLAG2_SHIFT (2U) -/*! GFLAG2 - Interrupt Flag */ -#define MRT_IRQ_FLAG_GFLAG2(x) (((uint32_t)(((uint32_t)(x)) << MRT_IRQ_FLAG_GFLAG2_SHIFT)) & MRT_IRQ_FLAG_GFLAG2_MASK) - -#define MRT_IRQ_FLAG_GFLAG3_MASK (0x8U) -#define MRT_IRQ_FLAG_GFLAG3_SHIFT (3U) -/*! GFLAG3 - Interrupt Flag */ -#define MRT_IRQ_FLAG_GFLAG3(x) (((uint32_t)(((uint32_t)(x)) << MRT_IRQ_FLAG_GFLAG3_SHIFT)) & MRT_IRQ_FLAG_GFLAG3_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group MRT_Register_Masks */ - - -/* MRT - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral MRT0 base address */ - #define MRT0_BASE (0x50013000u) - /** Peripheral MRT0 base address */ - #define MRT0_BASE_NS (0x40013000u) - /** Peripheral MRT0 base pointer */ - #define MRT0 ((MRT_Type *)MRT0_BASE) - /** Peripheral MRT0 base pointer */ - #define MRT0_NS ((MRT_Type *)MRT0_BASE_NS) - /** Array initializer of MRT peripheral base addresses */ - #define MRT_BASE_ADDRS { MRT0_BASE } - /** Array initializer of MRT peripheral base pointers */ - #define MRT_BASE_PTRS { MRT0 } - /** Array initializer of MRT peripheral base addresses */ - #define MRT_BASE_ADDRS_NS { MRT0_BASE_NS } - /** Array initializer of MRT peripheral base pointers */ - #define MRT_BASE_PTRS_NS { MRT0_NS } -#else - /** Peripheral MRT0 base address */ - #define MRT0_BASE (0x40013000u) - /** Peripheral MRT0 base pointer */ - #define MRT0 ((MRT_Type *)MRT0_BASE) - /** Array initializer of MRT peripheral base addresses */ - #define MRT_BASE_ADDRS { MRT0_BASE } - /** Array initializer of MRT peripheral base pointers */ - #define MRT_BASE_PTRS { MRT0 } -#endif -/** Interrupt vectors for the MRT peripheral type */ -#define MRT_IRQS { MRT0_IRQn } - -/*! - * @} - */ /* end of group MRT_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- NPX Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup NPX_Peripheral_Access_Layer NPX Peripheral Access Layer - * @{ - */ - -/** NPX - Register Layout Typedef */ -typedef struct { - __IO uint32_t NPXCR; /**< NPX Control Register, offset: 0x0 */ - uint8_t RESERVED_0[4]; - __I uint32_t NPXSR; /**< NPX Status Register, offset: 0x8 */ - uint8_t RESERVED_1[4]; - __O uint32_t CACMSK; /**< Flash Cache Obfuscation Mask, offset: 0x10 */ - uint8_t RESERVED_2[12]; - __IO uint32_t REMAP; /**< Data Remap, offset: 0x20 */ - uint8_t RESERVED_3[28]; - struct { /* offset: 0x40, array step: 0x10 */ - __IO uint32_t VMAPCTX_WD[2]; /**< Bitmap of Valid Control for Memory Context 0..Bitmap of Valid Control for Memory Context 3, array offset: 0x40, array step: index*0x10, index2*0x4 */ - __O uint32_t BIVCTX_WD[2]; /**< Block Initial Vector for Memory Context 0..Block Initial Vector for Memory Context 3, array offset: 0x48, array step: index*0x10, index2*0x4 */ - } CTX_VALID_IV_ARRAY[4]; -} NPX_Type; - -/* ---------------------------------------------------------------------------- - -- NPX Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup NPX_Register_Masks NPX Register Masks - * @{ - */ - -/*! @name NPXCR - NPX Control Register */ -/*! @{ */ - -#define NPX_NPXCR_GEE_MASK (0x1U) -#define NPX_NPXCR_GEE_SHIFT (0U) -/*! GEE - Global Encryption Enable - * 0b1..Global encryption enabled. NPX on-the-fly encryption is enabled if the flash access hits in a valid - * memory context. Subsequent reads return 1. - * 0b0..Global encryption disabled. NPX on-the-fly encryption is disabled. Subsequent reads return 0. - */ -#define NPX_NPXCR_GEE(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXCR_GEE_SHIFT)) & NPX_NPXCR_GEE_MASK) - -#define NPX_NPXCR_GDE_MASK (0x4U) -#define NPX_NPXCR_GDE_SHIFT (2U) -/*! GDE - Global Decryption Enable - * 0b1..Global decryption enabled. NPX on-the-fly decryption is globally enabled. Subsequent reads return 1. - * 0b0..Global decryption disabled. NPX on-the-fly decryption is globally disabled. Subsequent reads return 0. - */ -#define NPX_NPXCR_GDE(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXCR_GDE_SHIFT)) & NPX_NPXCR_GDE_MASK) - -#define NPX_NPXCR_GLK_MASK (0x10U) -#define NPX_NPXCR_GLK_SHIFT (4U) -/*! GLK - Global Lock Enable - * 0b1..Lock enabled: cannot write to VMAPCTXn, NPXCR, or CACMSK. Subsequent reads return 1. - * 0b0..Lock disabled. Subsequent reads return 0. - */ -#define NPX_NPXCR_GLK(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXCR_GLK_SHIFT)) & NPX_NPXCR_GLK_MASK) - -#define NPX_NPXCR_MLK_MASK (0x40U) -#define NPX_NPXCR_MLK_SHIFT (6U) -/*! MLK - Mask Lock Enable - * 0b1..Lock enabled: cannot write to mask. Subsequent reads return 1. - * 0b0..Lock disabled. Subsequent reads return 0. - */ -#define NPX_NPXCR_MLK(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXCR_MLK_SHIFT)) & NPX_NPXCR_MLK_MASK) - -#define NPX_NPXCR_CTX0LK_MASK (0x100U) -#define NPX_NPXCR_CTX0LK_SHIFT (8U) -/*! CTX0LK - Lock Enable for Context 0 - * 0b1..Lock enabled: cannot write to VMAPCTX0 (becomes read-only) - * 0b0..Lock disabled: VMAPCTX0 remains read-write - */ -#define NPX_NPXCR_CTX0LK(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXCR_CTX0LK_SHIFT)) & NPX_NPXCR_CTX0LK_MASK) - -#define NPX_NPXCR_CTX1LK_MASK (0x400U) -#define NPX_NPXCR_CTX1LK_SHIFT (10U) -/*! CTX1LK - Lock Enable for Context 1 - * 0b1..Lock enabled: cannot write to VMAPCTX1 (becomes read-only) - * 0b0..Lock disabled: VMAPCTX1 remains read-write - */ -#define NPX_NPXCR_CTX1LK(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXCR_CTX1LK_SHIFT)) & NPX_NPXCR_CTX1LK_MASK) - -#define NPX_NPXCR_CTX2LK_MASK (0x1000U) -#define NPX_NPXCR_CTX2LK_SHIFT (12U) -/*! CTX2LK - Lock Enable for Context 2 - * 0b1..Lock enabled: cannot write to VMAPCTX2 (becomes read-only) - * 0b0..Lock disabled: VMAPCTX2 remains read-write - */ -#define NPX_NPXCR_CTX2LK(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXCR_CTX2LK_SHIFT)) & NPX_NPXCR_CTX2LK_MASK) - -#define NPX_NPXCR_CTX3LK_MASK (0x4000U) -#define NPX_NPXCR_CTX3LK_SHIFT (14U) -/*! CTX3LK - Lock Enable for Context 3 - * 0b1..Lock enabled: cannot write to VMAPCTX3 (becomes read-only) - * 0b0..Lock disabled: VMAPCTX3 remains read-write - */ -#define NPX_NPXCR_CTX3LK(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXCR_CTX3LK_SHIFT)) & NPX_NPXCR_CTX3LK_MASK) -/*! @} */ - -/*! @name NPXSR - NPX Status Register */ -/*! @{ */ - -#define NPX_NPXSR_NUMCTX_MASK (0xFU) -#define NPX_NPXSR_NUMCTX_SHIFT (0U) -/*! NUMCTX - Number of implemented memory contexts - * 0b0000..No (zero) implemented memory contexts - * 0b0001..1 implemented memory contexts - * 0b0010..2 implemented memory contexts - * 0b0011..3 implemented memory contexts - * 0b0100..4 implemented memory contexts - */ -#define NPX_NPXSR_NUMCTX(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXSR_NUMCTX_SHIFT)) & NPX_NPXSR_NUMCTX_MASK) - -#define NPX_NPXSR_V0_MASK (0x100U) -#define NPX_NPXSR_V0_SHIFT (8U) -/*! V0 - Key n Valid - * 0b0..Not valid - * 0b1..Valid - */ -#define NPX_NPXSR_V0(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXSR_V0_SHIFT)) & NPX_NPXSR_V0_MASK) - -#define NPX_NPXSR_V1_MASK (0x200U) -#define NPX_NPXSR_V1_SHIFT (9U) -/*! V1 - Key n Valid - * 0b0..Not valid - * 0b1..Valid - */ -#define NPX_NPXSR_V1(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXSR_V1_SHIFT)) & NPX_NPXSR_V1_MASK) - -#define NPX_NPXSR_V2_MASK (0x400U) -#define NPX_NPXSR_V2_SHIFT (10U) -/*! V2 - Key n Valid - * 0b0..Not valid - * 0b1..Valid - */ -#define NPX_NPXSR_V2(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXSR_V2_SHIFT)) & NPX_NPXSR_V2_MASK) - -#define NPX_NPXSR_V3_MASK (0x800U) -#define NPX_NPXSR_V3_SHIFT (11U) -/*! V3 - Key n Valid - * 0b0..Not valid - * 0b1..Valid - */ -#define NPX_NPXSR_V3(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXSR_V3_SHIFT)) & NPX_NPXSR_V3_MASK) -/*! @} */ - -/*! @name CACMSK - Flash Cache Obfuscation Mask */ -/*! @{ */ - -#define NPX_CACMSK_OBMASK_MASK (0xFFFFFFFFU) -#define NPX_CACMSK_OBMASK_SHIFT (0U) -/*! OBMASK - Obfuscation Mask */ -#define NPX_CACMSK_OBMASK(x) (((uint32_t)(((uint32_t)(x)) << NPX_CACMSK_OBMASK_SHIFT)) & NPX_CACMSK_OBMASK_MASK) -/*! @} */ - -/*! @name REMAP - Data Remap */ -/*! @{ */ - -#define NPX_REMAP_REMAPLK_MASK (0x1U) -#define NPX_REMAP_REMAPLK_SHIFT (0U) -/*! REMAPLK - Remap Lock Enable - * 0b1..Lock enabled: cannot write to REMAP - * 0b0..Lock disabled: can write to REMAP - */ -#define NPX_REMAP_REMAPLK(x) (((uint32_t)(((uint32_t)(x)) << NPX_REMAP_REMAPLK_SHIFT)) & NPX_REMAP_REMAPLK_MASK) - -#define NPX_REMAP_LIM_MASK (0x1F0000U) -#define NPX_REMAP_LIM_SHIFT (16U) -/*! LIM - LIM Remapping Address */ -#define NPX_REMAP_LIM(x) (((uint32_t)(((uint32_t)(x)) << NPX_REMAP_LIM_SHIFT)) & NPX_REMAP_LIM_MASK) - -#define NPX_REMAP_LIMDP_MASK (0x1F000000U) -#define NPX_REMAP_LIMDP_SHIFT (24U) -/*! LIMDP - LIMDP Remapping Address */ -#define NPX_REMAP_LIMDP(x) (((uint32_t)(((uint32_t)(x)) << NPX_REMAP_LIMDP_SHIFT)) & NPX_REMAP_LIMDP_MASK) -/*! @} */ - -/*! @name CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD - Bitmap of Valid Control for Memory Context 0..Bitmap of Valid Control for Memory Context 3 */ -/*! @{ */ - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL0_MASK (0x1U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL0_SHIFT (0U) -/*! VAL0 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL0(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL0_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL0_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL32_MASK (0x1U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL32_SHIFT (0U) -/*! VAL32 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL32(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL32_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL32_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL1_MASK (0x2U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL1_SHIFT (1U) -/*! VAL1 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL1(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL1_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL1_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL33_MASK (0x2U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL33_SHIFT (1U) -/*! VAL33 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL33(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL33_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL33_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL2_MASK (0x4U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL2_SHIFT (2U) -/*! VAL2 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL2(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL2_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL2_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL34_MASK (0x4U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL34_SHIFT (2U) -/*! VAL34 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL34(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL34_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL34_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL3_MASK (0x8U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL3_SHIFT (3U) -/*! VAL3 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL3(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL3_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL3_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL35_MASK (0x8U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL35_SHIFT (3U) -/*! VAL35 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL35(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL35_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL35_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL4_MASK (0x10U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL4_SHIFT (4U) -/*! VAL4 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL4(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL4_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL4_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL36_MASK (0x10U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL36_SHIFT (4U) -/*! VAL36 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL36(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL36_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL36_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL5_MASK (0x20U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL5_SHIFT (5U) -/*! VAL5 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL5(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL5_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL5_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL37_MASK (0x20U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL37_SHIFT (5U) -/*! VAL37 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL37(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL37_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL37_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL6_MASK (0x40U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL6_SHIFT (6U) -/*! VAL6 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL6(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL6_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL6_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL38_MASK (0x40U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL38_SHIFT (6U) -/*! VAL38 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL38(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL38_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL38_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL7_MASK (0x80U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL7_SHIFT (7U) -/*! VAL7 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL7(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL7_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL7_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL39_MASK (0x80U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL39_SHIFT (7U) -/*! VAL39 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL39(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL39_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL39_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL8_MASK (0x100U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL8_SHIFT (8U) -/*! VAL8 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL8(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL8_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL8_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL40_MASK (0x100U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL40_SHIFT (8U) -/*! VAL40 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL40(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL40_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL40_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL9_MASK (0x200U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL9_SHIFT (9U) -/*! VAL9 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL9(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL9_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL9_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL41_MASK (0x200U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL41_SHIFT (9U) -/*! VAL41 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL41(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL41_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL41_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL10_MASK (0x400U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL10_SHIFT (10U) -/*! VAL10 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL10(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL10_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL10_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL42_MASK (0x400U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL42_SHIFT (10U) -/*! VAL42 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL42(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL42_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL42_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL11_MASK (0x800U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL11_SHIFT (11U) -/*! VAL11 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL11(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL11_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL11_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL43_MASK (0x800U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL43_SHIFT (11U) -/*! VAL43 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL43(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL43_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL43_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL12_MASK (0x1000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL12_SHIFT (12U) -/*! VAL12 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL12(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL12_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL12_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL44_MASK (0x1000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL44_SHIFT (12U) -/*! VAL44 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL44(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL44_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL44_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL13_MASK (0x2000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL13_SHIFT (13U) -/*! VAL13 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL13(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL13_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL13_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL45_MASK (0x2000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL45_SHIFT (13U) -/*! VAL45 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL45(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL45_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL45_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL14_MASK (0x4000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL14_SHIFT (14U) -/*! VAL14 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL14(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL14_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL14_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL46_MASK (0x4000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL46_SHIFT (14U) -/*! VAL46 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL46(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL46_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL46_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL15_MASK (0x8000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL15_SHIFT (15U) -/*! VAL15 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL15(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL15_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL15_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL47_MASK (0x8000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL47_SHIFT (15U) -/*! VAL47 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL47(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL47_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL47_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL16_MASK (0x10000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL16_SHIFT (16U) -/*! VAL16 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL16(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL16_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL16_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL48_MASK (0x10000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL48_SHIFT (16U) -/*! VAL48 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL48(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL48_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL48_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL17_MASK (0x20000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL17_SHIFT (17U) -/*! VAL17 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL17(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL17_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL17_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL49_MASK (0x20000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL49_SHIFT (17U) -/*! VAL49 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL49(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL49_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL49_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL18_MASK (0x40000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL18_SHIFT (18U) -/*! VAL18 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL18(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL18_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL18_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL50_MASK (0x40000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL50_SHIFT (18U) -/*! VAL50 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL50(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL50_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL50_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL19_MASK (0x80000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL19_SHIFT (19U) -/*! VAL19 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL19(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL19_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL19_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL51_MASK (0x80000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL51_SHIFT (19U) -/*! VAL51 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL51(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL51_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL51_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL20_MASK (0x100000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL20_SHIFT (20U) -/*! VAL20 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL20(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL20_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL20_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL52_MASK (0x100000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL52_SHIFT (20U) -/*! VAL52 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL52(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL52_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL52_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL21_MASK (0x200000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL21_SHIFT (21U) -/*! VAL21 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL21(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL21_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL21_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL53_MASK (0x200000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL53_SHIFT (21U) -/*! VAL53 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL53(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL53_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL53_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL22_MASK (0x400000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL22_SHIFT (22U) -/*! VAL22 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL22(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL22_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL22_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL54_MASK (0x400000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL54_SHIFT (22U) -/*! VAL54 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL54(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL54_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL54_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL23_MASK (0x800000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL23_SHIFT (23U) -/*! VAL23 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL23(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL23_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL23_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL55_MASK (0x800000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL55_SHIFT (23U) -/*! VAL55 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL55(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL55_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL55_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL24_MASK (0x1000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL24_SHIFT (24U) -/*! VAL24 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL24(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL24_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL24_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL56_MASK (0x1000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL56_SHIFT (24U) -/*! VAL56 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL56(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL56_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL56_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL25_MASK (0x2000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL25_SHIFT (25U) -/*! VAL25 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL25(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL25_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL25_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL57_MASK (0x2000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL57_SHIFT (25U) -/*! VAL57 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL57(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL57_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL57_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL26_MASK (0x4000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL26_SHIFT (26U) -/*! VAL26 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL26(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL26_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL26_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL58_MASK (0x4000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL58_SHIFT (26U) -/*! VAL58 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL58(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL58_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL58_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL27_MASK (0x8000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL27_SHIFT (27U) -/*! VAL27 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL27(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL27_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL27_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL59_MASK (0x8000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL59_SHIFT (27U) -/*! VAL59 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL59(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL59_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL59_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL28_MASK (0x10000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL28_SHIFT (28U) -/*! VAL28 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL28(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL28_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL28_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL60_MASK (0x10000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL60_SHIFT (28U) -/*! VAL60 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL60(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL60_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL60_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL29_MASK (0x20000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL29_SHIFT (29U) -/*! VAL29 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL29(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL29_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL29_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL61_MASK (0x20000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL61_SHIFT (29U) -/*! VAL61 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL61(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL61_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL61_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL30_MASK (0x40000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL30_SHIFT (30U) -/*! VAL30 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL30(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL30_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL30_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL62_MASK (0x40000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL62_SHIFT (30U) -/*! VAL62 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL62(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL62_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL62_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL31_MASK (0x80000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL31_SHIFT (31U) -/*! VAL31 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL31(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL31_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL31_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL63_MASK (0x80000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL63_SHIFT (31U) -/*! VAL63 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL63(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL63_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL63_MASK) -/*! @} */ - -/* The count of NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_COUNT (4U) - -/* The count of NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_COUNT2 (2U) - -/*! @name CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD - Block Initial Vector for Memory Context 0..Block Initial Vector for Memory Context 3 */ -/*! @{ */ - -#define NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_BIV_WD0_MASK (0xFFFFFFFFU) -#define NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_BIV_WD0_SHIFT (0U) -/*! BIV_WD0 - Block Initial Vector Word0 */ -#define NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_BIV_WD0(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_BIV_WD0_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_BIV_WD0_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_BIV_WD1_MASK (0xFFFFFFFFU) -#define NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_BIV_WD1_SHIFT (0U) -/*! BIV_WD1 - Block Initial Vector Word1 */ -#define NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_BIV_WD1(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_BIV_WD1_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_BIV_WD1_MASK) -/*! @} */ - -/* The count of NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD */ -#define NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_COUNT (4U) - -/* The count of NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD */ -#define NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_COUNT2 (2U) - - -/*! - * @} - */ /* end of group NPX_Register_Masks */ - - -/* NPX - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral NPX0 base address */ - #define NPX0_BASE (0x500CC000u) - /** Peripheral NPX0 base address */ - #define NPX0_BASE_NS (0x400CC000u) - /** Peripheral NPX0 base pointer */ - #define NPX0 ((NPX_Type *)NPX0_BASE) - /** Peripheral NPX0 base pointer */ - #define NPX0_NS ((NPX_Type *)NPX0_BASE_NS) - /** Array initializer of NPX peripheral base addresses */ - #define NPX_BASE_ADDRS { NPX0_BASE } - /** Array initializer of NPX peripheral base pointers */ - #define NPX_BASE_PTRS { NPX0 } - /** Array initializer of NPX peripheral base addresses */ - #define NPX_BASE_ADDRS_NS { NPX0_BASE_NS } - /** Array initializer of NPX peripheral base pointers */ - #define NPX_BASE_PTRS_NS { NPX0_NS } -#else - /** Peripheral NPX0 base address */ - #define NPX0_BASE (0x400CC000u) - /** Peripheral NPX0 base pointer */ - #define NPX0 ((NPX_Type *)NPX0_BASE) - /** Array initializer of NPX peripheral base addresses */ - #define NPX_BASE_ADDRS { NPX0_BASE } - /** Array initializer of NPX peripheral base pointers */ - #define NPX_BASE_PTRS { NPX0 } -#endif - -/*! - * @} - */ /* end of group NPX_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- OSTIMER Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup OSTIMER_Peripheral_Access_Layer OSTIMER Peripheral Access Layer - * @{ - */ - -/** OSTIMER - Register Layout Typedef */ -typedef struct { - __I uint32_t EVTIMERL; /**< EVTIMER Low, offset: 0x0 */ - __I uint32_t EVTIMERH; /**< EVTIMER High, offset: 0x4 */ - __I uint32_t CAPTURE_L; /**< Local Capture Low for CPU, offset: 0x8 */ - __I uint32_t CAPTURE_H; /**< Local Capture High for CPU, offset: 0xC */ - __IO uint32_t MATCH_L; /**< Local Match Low for CPU, offset: 0x10 */ - __IO uint32_t MATCH_H; /**< Local Match High for CPU, offset: 0x14 */ - uint8_t RESERVED_0[4]; - __IO uint32_t OSEVENT_CTRL; /**< OSTIMER Control for CPU, offset: 0x1C */ -} OSTIMER_Type; - -/* ---------------------------------------------------------------------------- - -- OSTIMER Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup OSTIMER_Register_Masks OSTIMER Register Masks - * @{ - */ - -/*! @name EVTIMERL - EVTIMER Low */ -/*! @{ */ - -#define OSTIMER_EVTIMERL_EVTIMER_COUNT_VALUE_MASK (0xFFFFFFFFU) -#define OSTIMER_EVTIMERL_EVTIMER_COUNT_VALUE_SHIFT (0U) -/*! EVTIMER_COUNT_VALUE - EVTimer Count Value */ -#define OSTIMER_EVTIMERL_EVTIMER_COUNT_VALUE(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_EVTIMERL_EVTIMER_COUNT_VALUE_SHIFT)) & OSTIMER_EVTIMERL_EVTIMER_COUNT_VALUE_MASK) -/*! @} */ - -/*! @name EVTIMERH - EVTIMER High */ -/*! @{ */ - -#define OSTIMER_EVTIMERH_EVTIMER_COUNT_VALUE_MASK (0x3FFU) -#define OSTIMER_EVTIMERH_EVTIMER_COUNT_VALUE_SHIFT (0U) -/*! EVTIMER_COUNT_VALUE - EVTimer Count Value */ -#define OSTIMER_EVTIMERH_EVTIMER_COUNT_VALUE(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_EVTIMERH_EVTIMER_COUNT_VALUE_SHIFT)) & OSTIMER_EVTIMERH_EVTIMER_COUNT_VALUE_MASK) -/*! @} */ - -/*! @name CAPTURE_L - Local Capture Low for CPU */ -/*! @{ */ - -#define OSTIMER_CAPTURE_L_CAPTURE_VALUE_MASK (0xFFFFFFFFU) -#define OSTIMER_CAPTURE_L_CAPTURE_VALUE_SHIFT (0U) -/*! CAPTURE_VALUE - EVTimer Capture Value */ -#define OSTIMER_CAPTURE_L_CAPTURE_VALUE(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_CAPTURE_L_CAPTURE_VALUE_SHIFT)) & OSTIMER_CAPTURE_L_CAPTURE_VALUE_MASK) -/*! @} */ - -/*! @name CAPTURE_H - Local Capture High for CPU */ -/*! @{ */ - -#define OSTIMER_CAPTURE_H_CAPTURE_VALUE_MASK (0x3FFU) -#define OSTIMER_CAPTURE_H_CAPTURE_VALUE_SHIFT (0U) -/*! CAPTURE_VALUE - EVTimer Capture Value */ -#define OSTIMER_CAPTURE_H_CAPTURE_VALUE(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_CAPTURE_H_CAPTURE_VALUE_SHIFT)) & OSTIMER_CAPTURE_H_CAPTURE_VALUE_MASK) -/*! @} */ - -/*! @name MATCH_L - Local Match Low for CPU */ -/*! @{ */ - -#define OSTIMER_MATCH_L_MATCH_VALUE_MASK (0xFFFFFFFFU) -#define OSTIMER_MATCH_L_MATCH_VALUE_SHIFT (0U) -/*! MATCH_VALUE - EVTimer Match Value */ -#define OSTIMER_MATCH_L_MATCH_VALUE(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_MATCH_L_MATCH_VALUE_SHIFT)) & OSTIMER_MATCH_L_MATCH_VALUE_MASK) -/*! @} */ - -/*! @name MATCH_H - Local Match High for CPU */ -/*! @{ */ - -#define OSTIMER_MATCH_H_MATCH_VALUE_MASK (0x3FFU) -#define OSTIMER_MATCH_H_MATCH_VALUE_SHIFT (0U) -/*! MATCH_VALUE - EVTimer Match Value */ -#define OSTIMER_MATCH_H_MATCH_VALUE(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_MATCH_H_MATCH_VALUE_SHIFT)) & OSTIMER_MATCH_H_MATCH_VALUE_MASK) -/*! @} */ - -/*! @name OSEVENT_CTRL - OSTIMER Control for CPU */ -/*! @{ */ - -#define OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG_MASK (0x1U) -#define OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG_SHIFT (0U) -/*! OSTIMER_INTRFLAG - Interrupt Flag */ -#define OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG_SHIFT)) & OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG_MASK) - -#define OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_MASK (0x2U) -#define OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_SHIFT (1U) -/*! OSTIMER_INTENA - Interrupt or Wake-Up Request - * 0b0..Interrupts blocked - * 0b1..Interrupts enabled - */ -#define OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_SHIFT)) & OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_MASK) - -#define OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK (0x4U) -#define OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_SHIFT (2U) -/*! MATCH_WR_RDY - EVTimer Match Write Ready */ -#define OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_SHIFT)) & OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group OSTIMER_Register_Masks */ - - -/* OSTIMER - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral OSTIMER0 base address */ - #define OSTIMER0_BASE (0x50049000u) - /** Peripheral OSTIMER0 base address */ - #define OSTIMER0_BASE_NS (0x40049000u) - /** Peripheral OSTIMER0 base pointer */ - #define OSTIMER0 ((OSTIMER_Type *)OSTIMER0_BASE) - /** Peripheral OSTIMER0 base pointer */ - #define OSTIMER0_NS ((OSTIMER_Type *)OSTIMER0_BASE_NS) - /** Array initializer of OSTIMER peripheral base addresses */ - #define OSTIMER_BASE_ADDRS { OSTIMER0_BASE } - /** Array initializer of OSTIMER peripheral base pointers */ - #define OSTIMER_BASE_PTRS { OSTIMER0 } - /** Array initializer of OSTIMER peripheral base addresses */ - #define OSTIMER_BASE_ADDRS_NS { OSTIMER0_BASE_NS } - /** Array initializer of OSTIMER peripheral base pointers */ - #define OSTIMER_BASE_PTRS_NS { OSTIMER0_NS } -#else - /** Peripheral OSTIMER0 base address */ - #define OSTIMER0_BASE (0x40049000u) - /** Peripheral OSTIMER0 base pointer */ - #define OSTIMER0 ((OSTIMER_Type *)OSTIMER0_BASE) - /** Array initializer of OSTIMER peripheral base addresses */ - #define OSTIMER_BASE_ADDRS { OSTIMER0_BASE } - /** Array initializer of OSTIMER peripheral base pointers */ - #define OSTIMER_BASE_PTRS { OSTIMER0 } -#endif -/** Interrupt vectors for the OSTIMER peripheral type */ -#define OSTIMER_IRQS { OS_EVENT_IRQn } - -/*! - * @} - */ /* end of group OSTIMER_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- OTPC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup OTPC_Peripheral_Access_Layer OTPC Peripheral Access Layer - * @{ - */ - -/** OTPC - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameters, offset: 0x4 */ - __IO uint32_t SR; /**< Status, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __IO uint32_t RWC; /**< Read and Write Control, offset: 0x10 */ - __IO uint32_t RLC; /**< Reload Control, offset: 0x14 */ - __IO uint32_t PCR; /**< Power Control, offset: 0x18 */ - uint8_t RESERVED_1[4]; - __IO uint32_t WDATA; /**< Write Data, offset: 0x20 */ - __I uint32_t RDATA; /**< Read Data, offset: 0x24 */ - uint8_t RESERVED_2[8]; - __IO uint32_t TIMING1; /**< Timing1, offset: 0x30 */ - __IO uint32_t TIMING2; /**< Timing2, offset: 0x34 */ - uint8_t RESERVED_3[456]; - __I uint32_t LOCK; /**< Lock, offset: 0x200 */ - __I uint32_t SECURE; /**< Secure, offset: 0x204 */ - __I uint32_t SECURE_INV; /**< Inverted Secure, offset: 0x208 */ - __I uint32_t DBG_KEY; /**< Debug and Key, offset: 0x20C */ - __IO uint32_t MISC_CFG; /**< MISC Config, offset: 0x210 */ - __IO uint32_t PHANTOM_CFG; /**< PHANTOM Config, offset: 0x214 */ - __IO uint32_t FLEX_CFG0; /**< Flexible Config 0, offset: 0x218 */ - __IO uint32_t FLEX_CFG1; /**< Flexible Config 1, offset: 0x21C */ -} OTPC_Type; - -/* ---------------------------------------------------------------------------- - -- OTPC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup OTPC_Register_Masks OTPC Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define OTPC_VERID_FEATURE_MASK (0xFFFFU) -#define OTPC_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Standard feature set - */ -#define OTPC_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << OTPC_VERID_FEATURE_SHIFT)) & OTPC_VERID_FEATURE_MASK) - -#define OTPC_VERID_MINOR_MASK (0xFF0000U) -#define OTPC_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define OTPC_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << OTPC_VERID_MINOR_SHIFT)) & OTPC_VERID_MINOR_MASK) - -#define OTPC_VERID_MAJOR_MASK (0xFF000000U) -#define OTPC_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define OTPC_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << OTPC_VERID_MAJOR_SHIFT)) & OTPC_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameters */ -/*! @{ */ - -#define OTPC_PARAM_NUM_FUSE_MASK (0xFFFFU) -#define OTPC_PARAM_NUM_FUSE_SHIFT (0U) -/*! NUM_FUSE - Number of fuse bytes */ -#define OTPC_PARAM_NUM_FUSE(x) (((uint32_t)(((uint32_t)(x)) << OTPC_PARAM_NUM_FUSE_SHIFT)) & OTPC_PARAM_NUM_FUSE_MASK) -/*! @} */ - -/*! @name SR - Status */ -/*! @{ */ - -#define OTPC_SR_BUSY_MASK (0x1U) -#define OTPC_SR_BUSY_SHIFT (0U) -/*! BUSY - Busy status - * 0b0..Not busy (transaction complete) - * 0b1..Busy - */ -#define OTPC_SR_BUSY(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_BUSY_SHIFT)) & OTPC_SR_BUSY_MASK) - -#define OTPC_SR_ERROR_MASK (0x2U) -#define OTPC_SR_ERROR_SHIFT (1U) -/*! ERROR - Error flag - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_ERROR(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_ERROR_SHIFT)) & OTPC_SR_ERROR_MASK) - -#define OTPC_SR_ECC_SF_MASK (0x4U) -#define OTPC_SR_ECC_SF_SHIFT (2U) -/*! ECC_SF - ECC single fault - * 0b0..No fault - * 0b1..Fault - */ -#define OTPC_SR_ECC_SF(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_ECC_SF_SHIFT)) & OTPC_SR_ECC_SF_MASK) - -#define OTPC_SR_ECC_DF_MASK (0x8U) -#define OTPC_SR_ECC_DF_SHIFT (3U) -/*! ECC_DF - ECC double fault - * 0b0..No fault - * 0b1..Fault - */ -#define OTPC_SR_ECC_DF(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_ECC_DF_SHIFT)) & OTPC_SR_ECC_DF_MASK) - -#define OTPC_SR_TRI_F_MASK (0x10U) -#define OTPC_SR_TRI_F_SHIFT (4U) -/*! TRI_F - Triple voting fault - * 0b0..No fault - * 0b1..Fault - */ -#define OTPC_SR_TRI_F(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_TRI_F_SHIFT)) & OTPC_SR_TRI_F_MASK) - -#define OTPC_SR_RD_FUSE_LOCK_MASK (0x100U) -#define OTPC_SR_RD_FUSE_LOCK_SHIFT (8U) -/*! RD_FUSE_LOCK - Read fuse lock error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_RD_FUSE_LOCK(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_RD_FUSE_LOCK_SHIFT)) & OTPC_SR_RD_FUSE_LOCK_MASK) - -#define OTPC_SR_WR_FUSE_LOCK_MASK (0x200U) -#define OTPC_SR_WR_FUSE_LOCK_SHIFT (9U) -/*! WR_FUSE_LOCK - Write fuse lock error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_WR_FUSE_LOCK(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_WR_FUSE_LOCK_SHIFT)) & OTPC_SR_WR_FUSE_LOCK_MASK) - -#define OTPC_SR_RD_REG_LOCK_MASK (0x400U) -#define OTPC_SR_RD_REG_LOCK_SHIFT (10U) -/*! RD_REG_LOCK - Read register lock error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_RD_REG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_RD_REG_LOCK_SHIFT)) & OTPC_SR_RD_REG_LOCK_MASK) - -#define OTPC_SR_WR_REG_LOCK_MASK (0x800U) -#define OTPC_SR_WR_REG_LOCK_SHIFT (11U) -/*! WR_REG_LOCK - Write register lock error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_WR_REG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_WR_REG_LOCK_SHIFT)) & OTPC_SR_WR_REG_LOCK_MASK) - -#define OTPC_SR_WR_REG_BUSY_MASK (0x1000U) -#define OTPC_SR_WR_REG_BUSY_SHIFT (12U) -/*! WR_REG_BUSY - Write register when busy error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_WR_REG_BUSY(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_WR_REG_BUSY_SHIFT)) & OTPC_SR_WR_REG_BUSY_MASK) - -#define OTPC_SR_WR_POWER_OFF_MASK (0x2000U) -#define OTPC_SR_WR_POWER_OFF_SHIFT (13U) -/*! WR_POWER_OFF - Write when power off error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_WR_POWER_OFF(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_WR_POWER_OFF_SHIFT)) & OTPC_SR_WR_POWER_OFF_MASK) - -#define OTPC_SR_FSM_MASK (0x10000U) -#define OTPC_SR_FSM_SHIFT (16U) -/*! FSM - Finite-state machine error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_FSM(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_FSM_SHIFT)) & OTPC_SR_FSM_MASK) - -#define OTPC_SR_FLC_MASK (0x20000U) -#define OTPC_SR_FLC_SHIFT (17U) -/*! FLC - Fuse load counter error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_FLC(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_FLC_SHIFT)) & OTPC_SR_FLC_MASK) - -#define OTPC_SR_ADC_MASK (0x40000U) -#define OTPC_SR_ADC_SHIFT (18U) -/*! ADC - Address and data compare error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_ADC(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_ADC_SHIFT)) & OTPC_SR_ADC_MASK) - -#define OTPC_SR_IRC_MASK (0x80000U) -#define OTPC_SR_IRC_SHIFT (19U) -/*! IRC - Inverted register compare error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_IRC(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_IRC_SHIFT)) & OTPC_SR_IRC_MASK) - -#define OTPC_SR_FSC_MASK (0x100000U) -#define OTPC_SR_FSC_SHIFT (20U) -/*! FSC - Fuse and shadow register compare error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_FSC(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_FSC_SHIFT)) & OTPC_SR_FSC_MASK) -/*! @} */ - -/*! @name RWC - Read and Write Control */ -/*! @{ */ - -#define OTPC_RWC_ADDR_MASK (0x7FU) -#define OTPC_RWC_ADDR_SHIFT (0U) -/*! ADDR - EFUSE address */ -#define OTPC_RWC_ADDR(x) (((uint32_t)(((uint32_t)(x)) << OTPC_RWC_ADDR_SHIFT)) & OTPC_RWC_ADDR_MASK) - -#define OTPC_RWC_WR_ALL1S_MASK (0x1000U) -#define OTPC_RWC_WR_ALL1S_SHIFT (12U) -/*! WR_ALL1S - Write all 1s - * 0b0..Uses the WDATA value - * 0b1..Writes all 1s - */ -#define OTPC_RWC_WR_ALL1S(x) (((uint32_t)(((uint32_t)(x)) << OTPC_RWC_WR_ALL1S_SHIFT)) & OTPC_RWC_WR_ALL1S_MASK) - -#define OTPC_RWC_READ_EFUSE_MASK (0x2000U) -#define OTPC_RWC_READ_EFUSE_SHIFT (13U) -/*! READ_EFUSE - Read EFUSE - * 0b0..Starts program operation when the WR_UNLOCK value is 0x9527; otherwise, takes no action. - * 0b1..Starts read operation - */ -#define OTPC_RWC_READ_EFUSE(x) (((uint32_t)(((uint32_t)(x)) << OTPC_RWC_READ_EFUSE_SHIFT)) & OTPC_RWC_READ_EFUSE_MASK) - -#define OTPC_RWC_READ_UPDATE_MASK (0x4000U) -#define OTPC_RWC_READ_UPDATE_SHIFT (14U) -/*! READ_UPDATE - Read update - * 0b0..Shadow register does not update - * 0b1..Shadow register updates - */ -#define OTPC_RWC_READ_UPDATE(x) (((uint32_t)(((uint32_t)(x)) << OTPC_RWC_READ_UPDATE_SHIFT)) & OTPC_RWC_READ_UPDATE_MASK) - -#define OTPC_RWC_WR_UNLOCK_MASK (0xFFFF0000U) -#define OTPC_RWC_WR_UNLOCK_SHIFT (16U) -/*! WR_UNLOCK - Write Unlock */ -#define OTPC_RWC_WR_UNLOCK(x) (((uint32_t)(((uint32_t)(x)) << OTPC_RWC_WR_UNLOCK_SHIFT)) & OTPC_RWC_WR_UNLOCK_MASK) -/*! @} */ - -/*! @name RLC - Reload Control */ -/*! @{ */ - -#define OTPC_RLC_RELOAD_SHADOWS_MASK (0x1U) -#define OTPC_RLC_RELOAD_SHADOWS_SHIFT (0U) -/*! RELOAD_SHADOWS - Reload shadow registers - * 0b0..No action (when writing) or reload complete (when reading) - * 0b1..Reload - */ -#define OTPC_RLC_RELOAD_SHADOWS(x) (((uint32_t)(((uint32_t)(x)) << OTPC_RLC_RELOAD_SHADOWS_SHIFT)) & OTPC_RLC_RELOAD_SHADOWS_MASK) -/*! @} */ - -/*! @name PCR - Power Control */ -/*! @{ */ - -#define OTPC_PCR_HVREQ_MASK (0x1U) -#define OTPC_PCR_HVREQ_SHIFT (0U) -/*! HVREQ - Strong switch request - * 0b0..Turn off - * 0b1..Turn on - */ -#define OTPC_PCR_HVREQ(x) (((uint32_t)(((uint32_t)(x)) << OTPC_PCR_HVREQ_SHIFT)) & OTPC_PCR_HVREQ_MASK) - -#define OTPC_PCR_LVREQ_MASK (0x2U) -#define OTPC_PCR_LVREQ_SHIFT (1U) -/*! LVREQ - Weak switch request - * 0b0..Turn off - * 0b1..Turn on - */ -#define OTPC_PCR_LVREQ(x) (((uint32_t)(((uint32_t)(x)) << OTPC_PCR_LVREQ_SHIFT)) & OTPC_PCR_LVREQ_MASK) - -#define OTPC_PCR_PDREQ_MASK (0x4U) -#define OTPC_PCR_PDREQ_SHIFT (2U) -/*! PDREQ - Power down request - * 0b0..PD pin is set to low when OTPC is in idle state. It means EFUSE hardmacro is in standby mode. Idle state - * means OTPC is not in read and program modes. - * 0b1..PD pin is set to high when OTPC is in idle state. It means EFUSE hardmacro is in power down mode. - */ -#define OTPC_PCR_PDREQ(x) (((uint32_t)(((uint32_t)(x)) << OTPC_PCR_PDREQ_SHIFT)) & OTPC_PCR_PDREQ_MASK) -/*! @} */ - -/*! @name WDATA - Write Data */ -/*! @{ */ - -#define OTPC_WDATA_DAT_MASK (0xFFFFFFFFU) -#define OTPC_WDATA_DAT_SHIFT (0U) -/*! DAT - Write data */ -#define OTPC_WDATA_DAT(x) (((uint32_t)(((uint32_t)(x)) << OTPC_WDATA_DAT_SHIFT)) & OTPC_WDATA_DAT_MASK) -/*! @} */ - -/*! @name RDATA - Read Data */ -/*! @{ */ - -#define OTPC_RDATA_DAT_MASK (0xFFFFFFFFU) -#define OTPC_RDATA_DAT_SHIFT (0U) -/*! DAT - Read data */ -#define OTPC_RDATA_DAT(x) (((uint32_t)(((uint32_t)(x)) << OTPC_RDATA_DAT_SHIFT)) & OTPC_RDATA_DAT_MASK) -/*! @} */ - -/*! @name TIMING1 - Timing1 */ -/*! @{ */ - -#define OTPC_TIMING1_TADDR_MASK (0xFU) -#define OTPC_TIMING1_TADDR_SHIFT (0U) -/*! TADDR - Address to STROBE setup and hold time */ -#define OTPC_TIMING1_TADDR(x) (((uint32_t)(((uint32_t)(x)) << OTPC_TIMING1_TADDR_SHIFT)) & OTPC_TIMING1_TADDR_MASK) - -#define OTPC_TIMING1_TRELAX_MASK (0xF0U) -#define OTPC_TIMING1_TRELAX_SHIFT (4U) -/*! TRELAX - CSB, PGENB and LOAD to STROBE setup and hold time */ -#define OTPC_TIMING1_TRELAX(x) (((uint32_t)(((uint32_t)(x)) << OTPC_TIMING1_TRELAX_SHIFT)) & OTPC_TIMING1_TRELAX_MASK) - -#define OTPC_TIMING1_TRD_MASK (0x3F00U) -#define OTPC_TIMING1_TRD_SHIFT (8U) -/*! TRD - Read strobe pulse width time */ -#define OTPC_TIMING1_TRD(x) (((uint32_t)(((uint32_t)(x)) << OTPC_TIMING1_TRD_SHIFT)) & OTPC_TIMING1_TRD_MASK) - -#define OTPC_TIMING1_TPS_MASK (0x3F0000U) -#define OTPC_TIMING1_TPS_SHIFT (16U) -/*! TPS - PS to CSB setup and hold time between power switch and chip select assertion */ -#define OTPC_TIMING1_TPS(x) (((uint32_t)(((uint32_t)(x)) << OTPC_TIMING1_TPS_SHIFT)) & OTPC_TIMING1_TPS_MASK) - -#define OTPC_TIMING1_TPD_MASK (0xFF000000U) -#define OTPC_TIMING1_TPD_SHIFT (24U) -/*! TPD - PD to CSB setup time between power down signal deassertion and chip select signal assertion */ -#define OTPC_TIMING1_TPD(x) (((uint32_t)(((uint32_t)(x)) << OTPC_TIMING1_TPD_SHIFT)) & OTPC_TIMING1_TPD_MASK) -/*! @} */ - -/*! @name TIMING2 - Timing2 */ -/*! @{ */ - -#define OTPC_TIMING2_TPGM_MASK (0xFFFU) -#define OTPC_TIMING2_TPGM_SHIFT (0U) -/*! TPGM - Typical program strobe pulse width time */ -#define OTPC_TIMING2_TPGM(x) (((uint32_t)(((uint32_t)(x)) << OTPC_TIMING2_TPGM_SHIFT)) & OTPC_TIMING2_TPGM_MASK) -/*! @} */ - -/*! @name LOCK - Lock */ -/*! @{ */ - -#define OTPC_LOCK_NXP_PART_CFG_LOCK_MASK (0x7U) -#define OTPC_LOCK_NXP_PART_CFG_LOCK_SHIFT (0U) -/*! NXP_PART_CFG_LOCK - NXP Part Config Lock */ -#define OTPC_LOCK_NXP_PART_CFG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << OTPC_LOCK_NXP_PART_CFG_LOCK_SHIFT)) & OTPC_LOCK_NXP_PART_CFG_LOCK_MASK) - -#define OTPC_LOCK_NXP_EXT_LOCK_MASK (0x38U) -#define OTPC_LOCK_NXP_EXT_LOCK_SHIFT (3U) -/*! NXP_EXT_LOCK - NXP EXT Lock */ -#define OTPC_LOCK_NXP_EXT_LOCK(x) (((uint32_t)(((uint32_t)(x)) << OTPC_LOCK_NXP_EXT_LOCK_SHIFT)) & OTPC_LOCK_NXP_EXT_LOCK_MASK) - -#define OTPC_LOCK_BOOT_CFG_LOCK_MASK (0xE00U) -#define OTPC_LOCK_BOOT_CFG_LOCK_SHIFT (9U) -/*! BOOT_CFG_LOCK - Boot config Lock */ -#define OTPC_LOCK_BOOT_CFG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << OTPC_LOCK_BOOT_CFG_LOCK_SHIFT)) & OTPC_LOCK_BOOT_CFG_LOCK_MASK) - -#define OTPC_LOCK_PRINCE_CFG_LOCK_MASK (0x7000U) -#define OTPC_LOCK_PRINCE_CFG_LOCK_SHIFT (12U) -/*! PRINCE_CFG_LOCK - Prince Config Lock */ -#define OTPC_LOCK_PRINCE_CFG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << OTPC_LOCK_PRINCE_CFG_LOCK_SHIFT)) & OTPC_LOCK_PRINCE_CFG_LOCK_MASK) - -#define OTPC_LOCK_OSCAA_KEY_LOCK_MASK (0x38000U) -#define OTPC_LOCK_OSCAA_KEY_LOCK_SHIFT (15U) -/*! OSCAA_KEY_LOCK - OSCAA Key Lock */ -#define OTPC_LOCK_OSCAA_KEY_LOCK(x) (((uint32_t)(((uint32_t)(x)) << OTPC_LOCK_OSCAA_KEY_LOCK_SHIFT)) & OTPC_LOCK_OSCAA_KEY_LOCK_MASK) - -#define OTPC_LOCK_CUST_LOCK0_MASK (0x1C0000U) -#define OTPC_LOCK_CUST_LOCK0_SHIFT (18U) -/*! CUST_LOCK0 - CUST Lock 0 */ -#define OTPC_LOCK_CUST_LOCK0(x) (((uint32_t)(((uint32_t)(x)) << OTPC_LOCK_CUST_LOCK0_SHIFT)) & OTPC_LOCK_CUST_LOCK0_MASK) - -#define OTPC_LOCK_CUST_LOCK1_MASK (0xE00000U) -#define OTPC_LOCK_CUST_LOCK1_SHIFT (21U) -/*! CUST_LOCK1 - CUST Lock 1 */ -#define OTPC_LOCK_CUST_LOCK1(x) (((uint32_t)(((uint32_t)(x)) << OTPC_LOCK_CUST_LOCK1_SHIFT)) & OTPC_LOCK_CUST_LOCK1_MASK) - -#define OTPC_LOCK_CUST_LOCK2_MASK (0x7000000U) -#define OTPC_LOCK_CUST_LOCK2_SHIFT (24U) -/*! CUST_LOCK2 - CUST Lock 2 */ -#define OTPC_LOCK_CUST_LOCK2(x) (((uint32_t)(((uint32_t)(x)) << OTPC_LOCK_CUST_LOCK2_SHIFT)) & OTPC_LOCK_CUST_LOCK2_MASK) - -#define OTPC_LOCK_CUST_LOCK3_MASK (0x38000000U) -#define OTPC_LOCK_CUST_LOCK3_SHIFT (27U) -/*! CUST_LOCK3 - CUST Lock 3 */ -#define OTPC_LOCK_CUST_LOCK3(x) (((uint32_t)(((uint32_t)(x)) << OTPC_LOCK_CUST_LOCK3_SHIFT)) & OTPC_LOCK_CUST_LOCK3_MASK) -/*! @} */ - -/*! @name SECURE - Secure */ -/*! @{ */ - -#define OTPC_SECURE_DAT_MASK (0xFFFFFFFFU) -#define OTPC_SECURE_DAT_SHIFT (0U) -/*! DAT - Data */ -#define OTPC_SECURE_DAT(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SECURE_DAT_SHIFT)) & OTPC_SECURE_DAT_MASK) -/*! @} */ - -/*! @name SECURE_INV - Inverted Secure */ -/*! @{ */ - -#define OTPC_SECURE_INV_DAT_MASK (0xFFFFFFFFU) -#define OTPC_SECURE_INV_DAT_SHIFT (0U) -/*! DAT - Data */ -#define OTPC_SECURE_INV_DAT(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SECURE_INV_DAT_SHIFT)) & OTPC_SECURE_INV_DAT_MASK) -/*! @} */ - -/*! @name DBG_KEY - Debug and Key */ -/*! @{ */ - -#define OTPC_DBG_KEY_DAT_MASK (0xFFFFFFFFU) -#define OTPC_DBG_KEY_DAT_SHIFT (0U) -/*! DAT - Data */ -#define OTPC_DBG_KEY_DAT(x) (((uint32_t)(((uint32_t)(x)) << OTPC_DBG_KEY_DAT_SHIFT)) & OTPC_DBG_KEY_DAT_MASK) -/*! @} */ - -/*! @name MISC_CFG - MISC Config */ -/*! @{ */ - -#define OTPC_MISC_CFG_DAT_MASK (0xFFFFFFFFU) -#define OTPC_MISC_CFG_DAT_SHIFT (0U) -/*! DAT - Data */ -#define OTPC_MISC_CFG_DAT(x) (((uint32_t)(((uint32_t)(x)) << OTPC_MISC_CFG_DAT_SHIFT)) & OTPC_MISC_CFG_DAT_MASK) -/*! @} */ - -/*! @name PHANTOM_CFG - PHANTOM Config */ -/*! @{ */ - -#define OTPC_PHANTOM_CFG_DAT_MASK (0xFFFFFFFFU) -#define OTPC_PHANTOM_CFG_DAT_SHIFT (0U) -/*! DAT - Data */ -#define OTPC_PHANTOM_CFG_DAT(x) (((uint32_t)(((uint32_t)(x)) << OTPC_PHANTOM_CFG_DAT_SHIFT)) & OTPC_PHANTOM_CFG_DAT_MASK) -/*! @} */ - -/*! @name FLEX_CFG0 - Flexible Config 0 */ -/*! @{ */ - -#define OTPC_FLEX_CFG0_DAT_MASK (0xFFFFFFFFU) -#define OTPC_FLEX_CFG0_DAT_SHIFT (0U) -/*! DAT - Data */ -#define OTPC_FLEX_CFG0_DAT(x) (((uint32_t)(((uint32_t)(x)) << OTPC_FLEX_CFG0_DAT_SHIFT)) & OTPC_FLEX_CFG0_DAT_MASK) -/*! @} */ - -/*! @name FLEX_CFG1 - Flexible Config 1 */ -/*! @{ */ - -#define OTPC_FLEX_CFG1_DAT_MASK (0xFFFFFFFFU) -#define OTPC_FLEX_CFG1_DAT_SHIFT (0U) -/*! DAT - Data */ -#define OTPC_FLEX_CFG1_DAT(x) (((uint32_t)(((uint32_t)(x)) << OTPC_FLEX_CFG1_DAT_SHIFT)) & OTPC_FLEX_CFG1_DAT_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group OTPC_Register_Masks */ - - -/* OTPC - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral OTPC0 base address */ - #define OTPC0_BASE (0x500C9000u) - /** Peripheral OTPC0 base address */ - #define OTPC0_BASE_NS (0x400C9000u) - /** Peripheral OTPC0 base pointer */ - #define OTPC0 ((OTPC_Type *)OTPC0_BASE) - /** Peripheral OTPC0 base pointer */ - #define OTPC0_NS ((OTPC_Type *)OTPC0_BASE_NS) - /** Array initializer of OTPC peripheral base addresses */ - #define OTPC_BASE_ADDRS { OTPC0_BASE } - /** Array initializer of OTPC peripheral base pointers */ - #define OTPC_BASE_PTRS { OTPC0 } - /** Array initializer of OTPC peripheral base addresses */ - #define OTPC_BASE_ADDRS_NS { OTPC0_BASE_NS } - /** Array initializer of OTPC peripheral base pointers */ - #define OTPC_BASE_PTRS_NS { OTPC0_NS } -#else - /** Peripheral OTPC0 base address */ - #define OTPC0_BASE (0x400C9000u) - /** Peripheral OTPC0 base pointer */ - #define OTPC0 ((OTPC_Type *)OTPC0_BASE) - /** Array initializer of OTPC peripheral base addresses */ - #define OTPC_BASE_ADDRS { OTPC0_BASE } - /** Array initializer of OTPC peripheral base pointers */ - #define OTPC_BASE_PTRS { OTPC0 } -#endif - -/*! - * @} - */ /* end of group OTPC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- PDM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PDM_Peripheral_Access_Layer PDM Peripheral Access Layer - * @{ - */ - -/** PDM - Register Layout Typedef */ -typedef struct { - __IO uint32_t CTRL_1; /**< MICFIL Control 1, offset: 0x0 */ - __IO uint32_t CTRL_2; /**< MICFIL Control 2, offset: 0x4 */ - __IO uint32_t STAT; /**< MICFIL Status, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __IO uint32_t FIFO_CTRL; /**< MICFIL FIFO Control, offset: 0x10 */ - __IO uint32_t FIFO_STAT; /**< MICFIL FIFO Status, offset: 0x14 */ - uint8_t RESERVED_1[12]; - __I uint32_t DATACH[4]; /**< MICFIL Output Result, array offset: 0x24, array step: 0x4 */ - uint8_t RESERVED_2[48]; - __I uint32_t DC_CTRL; /**< MICFIL DC Remover Control, offset: 0x64 */ - __IO uint32_t DC_OUT_CTRL; /**< MICFIL Output DC Remover Control, offset: 0x68 */ - uint8_t RESERVED_3[8]; - __IO uint32_t RANGE_CTRL; /**< MICFIL Range Control, offset: 0x74 */ - uint8_t RESERVED_4[4]; - __IO uint32_t RANGE_STAT; /**< MICFIL Range Status, offset: 0x7C */ - __IO uint32_t FSYNC_CTRL; /**< Frame Synchronization Control, offset: 0x80 */ - __I uint32_t VERID; /**< Version ID, offset: 0x84 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x88 */ -} PDM_Type; - -/* ---------------------------------------------------------------------------- - -- PDM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PDM_Register_Masks PDM Register Masks - * @{ - */ - -/*! @name CTRL_1 - MICFIL Control 1 */ -/*! @{ */ - -#define PDM_CTRL_1_CH0EN_MASK (0x1U) -#define PDM_CTRL_1_CH0EN_SHIFT (0U) -/*! CH0EN - Channel 0 Enable */ -#define PDM_CTRL_1_CH0EN(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_CH0EN_SHIFT)) & PDM_CTRL_1_CH0EN_MASK) - -#define PDM_CTRL_1_CH1EN_MASK (0x2U) -#define PDM_CTRL_1_CH1EN_SHIFT (1U) -/*! CH1EN - Channel 1 Enable */ -#define PDM_CTRL_1_CH1EN(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_CH1EN_SHIFT)) & PDM_CTRL_1_CH1EN_MASK) - -#define PDM_CTRL_1_CH2EN_MASK (0x4U) -#define PDM_CTRL_1_CH2EN_SHIFT (2U) -/*! CH2EN - Channel 2 Enable */ -#define PDM_CTRL_1_CH2EN(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_CH2EN_SHIFT)) & PDM_CTRL_1_CH2EN_MASK) - -#define PDM_CTRL_1_CH3EN_MASK (0x8U) -#define PDM_CTRL_1_CH3EN_SHIFT (3U) -/*! CH3EN - Channel 3 Enable */ -#define PDM_CTRL_1_CH3EN(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_CH3EN_SHIFT)) & PDM_CTRL_1_CH3EN_MASK) - -#define PDM_CTRL_1_FSYNCEN_MASK (0x10000U) -#define PDM_CTRL_1_FSYNCEN_SHIFT (16U) -/*! FSYNCEN - Frame Synchronization Enable - * 0b0..Disables - * 0b1..Enables - */ -#define PDM_CTRL_1_FSYNCEN(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_FSYNCEN_SHIFT)) & PDM_CTRL_1_FSYNCEN_MASK) - -#define PDM_CTRL_1_DECFILS_MASK (0x100000U) -#define PDM_CTRL_1_DECFILS_SHIFT (20U) -/*! DECFILS - Decimation Filter Enable in Stop - * 0b0..Stops decimation filter - * 0b1..Keeps decimation filter running - */ -#define PDM_CTRL_1_DECFILS(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_DECFILS_SHIFT)) & PDM_CTRL_1_DECFILS_MASK) - -#define PDM_CTRL_1_ERREN_MASK (0x800000U) -#define PDM_CTRL_1_ERREN_SHIFT (23U) -/*! ERREN - Error Interruption Enable - * 0b0..Disables - * 0b1..Enables - */ -#define PDM_CTRL_1_ERREN(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_ERREN_SHIFT)) & PDM_CTRL_1_ERREN_MASK) - -#define PDM_CTRL_1_DISEL_MASK (0x3000000U) -#define PDM_CTRL_1_DISEL_SHIFT (24U) -/*! DISEL - DMA Interrupt Selection - * 0b00..Disables DMA and interrupt requests - * 0b01..Enables DMA requests - * 0b10..Enables interrupt requests - * 0b11..Reserved - */ -#define PDM_CTRL_1_DISEL(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_DISEL_SHIFT)) & PDM_CTRL_1_DISEL_MASK) - -#define PDM_CTRL_1_DBGE_MASK (0x4000000U) -#define PDM_CTRL_1_DBGE_SHIFT (26U) -/*! DBGE - Module Enable in Debug - * 0b0..Disables after completing the current frame - * 0b1..Enables operation - */ -#define PDM_CTRL_1_DBGE(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_DBGE_SHIFT)) & PDM_CTRL_1_DBGE_MASK) - -#define PDM_CTRL_1_SRES_MASK (0x8000000U) -#define PDM_CTRL_1_SRES_SHIFT (27U) -/*! SRES - Software Reset - * 0b0..No action - * 0b1..Software reset - */ -#define PDM_CTRL_1_SRES(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_SRES_SHIFT)) & PDM_CTRL_1_SRES_MASK) - -#define PDM_CTRL_1_DBG_MASK (0x10000000U) -#define PDM_CTRL_1_DBG_SHIFT (28U) -/*! DBG - Debug Mode - * 0b0..Normal - * 0b1..Debug - */ -#define PDM_CTRL_1_DBG(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_DBG_SHIFT)) & PDM_CTRL_1_DBG_MASK) - -#define PDM_CTRL_1_PDMIEN_MASK (0x20000000U) -#define PDM_CTRL_1_PDMIEN_SHIFT (29U) -/*! PDMIEN - MICFIL Enable - * 0b0..Stops MICFIL operation - * 0b1..Starts MICFIL operation - */ -#define PDM_CTRL_1_PDMIEN(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_PDMIEN_SHIFT)) & PDM_CTRL_1_PDMIEN_MASK) - -#define PDM_CTRL_1_DOZEN_MASK (0x40000000U) -#define PDM_CTRL_1_DOZEN_SHIFT (30U) -/*! DOZEN - Stop Enable - * 0b0..Disables - * 0b1..Enables - */ -#define PDM_CTRL_1_DOZEN(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_DOZEN_SHIFT)) & PDM_CTRL_1_DOZEN_MASK) - -#define PDM_CTRL_1_MDIS_MASK (0x80000000U) -#define PDM_CTRL_1_MDIS_SHIFT (31U) -/*! MDIS - Module Disable - * 0b0..Normal mode - * 0b1..DLL mode - */ -#define PDM_CTRL_1_MDIS(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_MDIS_SHIFT)) & PDM_CTRL_1_MDIS_MASK) -/*! @} */ - -/*! @name CTRL_2 - MICFIL Control 2 */ -/*! @{ */ - -#define PDM_CTRL_2_CLKDIV_MASK (0xFFU) -#define PDM_CTRL_2_CLKDIV_SHIFT (0U) -/*! CLKDIV - Clock Divider - * 0b00000000..Internal clock divider value = 0 - * 0b00000001..Internal clock divider value = 1 - * 0b00000010-0b11111110..... - * 0b11111111..Internal clock divider value = 255 - */ -#define PDM_CTRL_2_CLKDIV(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_2_CLKDIV_SHIFT)) & PDM_CTRL_2_CLKDIV_MASK) - -#define PDM_CTRL_2_CLKDIVDIS_MASK (0x8000U) -#define PDM_CTRL_2_CLKDIVDIS_SHIFT (15U) -/*! CLKDIVDIS - Clock Divider Disable - * 0b0..Enables - * 0b1..Disables - */ -#define PDM_CTRL_2_CLKDIVDIS(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_2_CLKDIVDIS_SHIFT)) & PDM_CTRL_2_CLKDIVDIS_MASK) - -#define PDM_CTRL_2_CICOSR_MASK (0xF0000U) -#define PDM_CTRL_2_CICOSR_SHIFT (16U) -/*! CICOSR - CIC Decimation Rate - * 0b0000..CIC oversampling rate = 0 - * 0b0001..CIC oversampling rate = 1 - * 0b0010-0b1110..... - * 0b1111..CIC oversampling rate = 15 - */ -#define PDM_CTRL_2_CICOSR(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_2_CICOSR_SHIFT)) & PDM_CTRL_2_CICOSR_MASK) - -#define PDM_CTRL_2_QSEL_MASK (0xE000000U) -#define PDM_CTRL_2_QSEL_SHIFT (25U) -/*! QSEL - Quality Mode - * 0b001..High-Quality mode - * 0b000..Medium-Quality mode - * 0b111..Low-Quality mode - * 0b110..Very-Low-Quality 0 mode - * 0b101..Very-Low-Quality 1 mode - * 0b100..Very-Low-Quality 2 mode - */ -#define PDM_CTRL_2_QSEL(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_2_QSEL_SHIFT)) & PDM_CTRL_2_QSEL_MASK) -/*! @} */ - -/*! @name STAT - MICFIL Status */ -/*! @{ */ - -#define PDM_STAT_CH0F_MASK (0x1U) -#define PDM_STAT_CH0F_SHIFT (0U) -/*! CH0F - Channel 0 Output Data Flag - * 0b0..Not surpassed - * 0b1..Surpassed - */ -#define PDM_STAT_CH0F(x) (((uint32_t)(((uint32_t)(x)) << PDM_STAT_CH0F_SHIFT)) & PDM_STAT_CH0F_MASK) - -#define PDM_STAT_CH1F_MASK (0x2U) -#define PDM_STAT_CH1F_SHIFT (1U) -/*! CH1F - Channel 1 Output Data Flag - * 0b0..Not surpassed - * 0b1..Surpassed - */ -#define PDM_STAT_CH1F(x) (((uint32_t)(((uint32_t)(x)) << PDM_STAT_CH1F_SHIFT)) & PDM_STAT_CH1F_MASK) - -#define PDM_STAT_CH2F_MASK (0x4U) -#define PDM_STAT_CH2F_SHIFT (2U) -/*! CH2F - Channel 2 Output Data Flag - * 0b0..Not surpassed - * 0b1..Surpassed - */ -#define PDM_STAT_CH2F(x) (((uint32_t)(((uint32_t)(x)) << PDM_STAT_CH2F_SHIFT)) & PDM_STAT_CH2F_MASK) - -#define PDM_STAT_CH3F_MASK (0x8U) -#define PDM_STAT_CH3F_SHIFT (3U) -/*! CH3F - Channel 3 Output Data Flag - * 0b0..Not surpassed - * 0b1..Surpassed - */ -#define PDM_STAT_CH3F(x) (((uint32_t)(((uint32_t)(x)) << PDM_STAT_CH3F_SHIFT)) & PDM_STAT_CH3F_MASK) - -#define PDM_STAT_BSY_FIL_MASK (0x80000000U) -#define PDM_STAT_BSY_FIL_SHIFT (31U) -/*! BSY_FIL - Busy Flag - * 0b1..MICFIL is running - * 0b0..MICFIL is stopped - */ -#define PDM_STAT_BSY_FIL(x) (((uint32_t)(((uint32_t)(x)) << PDM_STAT_BSY_FIL_SHIFT)) & PDM_STAT_BSY_FIL_MASK) -/*! @} */ - -/*! @name FIFO_CTRL - MICFIL FIFO Control */ -/*! @{ */ - -#define PDM_FIFO_CTRL_FIFOWMK_MASK (0xFU) -#define PDM_FIFO_CTRL_FIFOWMK_SHIFT (0U) -/*! FIFOWMK - FIFO Watermark Control */ -#define PDM_FIFO_CTRL_FIFOWMK(x) (((uint32_t)(((uint32_t)(x)) << PDM_FIFO_CTRL_FIFOWMK_SHIFT)) & PDM_FIFO_CTRL_FIFOWMK_MASK) -/*! @} */ - -/*! @name FIFO_STAT - MICFIL FIFO Status */ -/*! @{ */ - -#define PDM_FIFO_STAT_FIFOOVF0_MASK (0x1U) -#define PDM_FIFO_STAT_FIFOOVF0_SHIFT (0U) -/*! FIFOOVF0 - FIFO Overflow Exception Flag for Channel 0 - * 0b0..No exception by FIFO overflow - * 0b1..Exception by FIFO overflow - */ -#define PDM_FIFO_STAT_FIFOOVF0(x) (((uint32_t)(((uint32_t)(x)) << PDM_FIFO_STAT_FIFOOVF0_SHIFT)) & PDM_FIFO_STAT_FIFOOVF0_MASK) - -#define PDM_FIFO_STAT_FIFOOVF1_MASK (0x2U) -#define PDM_FIFO_STAT_FIFOOVF1_SHIFT (1U) -/*! FIFOOVF1 - FIFO Overflow Exception Flag for Channel 1 - * 0b0..No exception by FIFO overflow - * 0b1..Exception by FIFO overflow - */ -#define PDM_FIFO_STAT_FIFOOVF1(x) (((uint32_t)(((uint32_t)(x)) << PDM_FIFO_STAT_FIFOOVF1_SHIFT)) & PDM_FIFO_STAT_FIFOOVF1_MASK) - -#define PDM_FIFO_STAT_FIFOOVF2_MASK (0x4U) -#define PDM_FIFO_STAT_FIFOOVF2_SHIFT (2U) -/*! FIFOOVF2 - FIFO Overflow Exception Flag for Channel 2 - * 0b0..No exception by FIFO overflow - * 0b1..Exception by FIFO overflow - */ -#define PDM_FIFO_STAT_FIFOOVF2(x) (((uint32_t)(((uint32_t)(x)) << PDM_FIFO_STAT_FIFOOVF2_SHIFT)) & PDM_FIFO_STAT_FIFOOVF2_MASK) - -#define PDM_FIFO_STAT_FIFOOVF3_MASK (0x8U) -#define PDM_FIFO_STAT_FIFOOVF3_SHIFT (3U) -/*! FIFOOVF3 - FIFO Overflow Exception Flag for Channel 3 - * 0b0..No exception by FIFO overflow - * 0b1..Exception by FIFO overflow - */ -#define PDM_FIFO_STAT_FIFOOVF3(x) (((uint32_t)(((uint32_t)(x)) << PDM_FIFO_STAT_FIFOOVF3_SHIFT)) & PDM_FIFO_STAT_FIFOOVF3_MASK) - -#define PDM_FIFO_STAT_FIFOUND0_MASK (0x100U) -#define PDM_FIFO_STAT_FIFOUND0_SHIFT (8U) -/*! FIFOUND0 - FIFO Underflow Exception Flag for Channel 0 - * 0b0..No exception by FIFO underflow - * 0b1..Exception by FIFO underflow - */ -#define PDM_FIFO_STAT_FIFOUND0(x) (((uint32_t)(((uint32_t)(x)) << PDM_FIFO_STAT_FIFOUND0_SHIFT)) & PDM_FIFO_STAT_FIFOUND0_MASK) - -#define PDM_FIFO_STAT_FIFOUND1_MASK (0x200U) -#define PDM_FIFO_STAT_FIFOUND1_SHIFT (9U) -/*! FIFOUND1 - FIFO Underflow Exception Flag for Channel 1 - * 0b0..No exception by FIFO underflow - * 0b1..Exception by FIFO underflow - */ -#define PDM_FIFO_STAT_FIFOUND1(x) (((uint32_t)(((uint32_t)(x)) << PDM_FIFO_STAT_FIFOUND1_SHIFT)) & PDM_FIFO_STAT_FIFOUND1_MASK) - -#define PDM_FIFO_STAT_FIFOUND2_MASK (0x400U) -#define PDM_FIFO_STAT_FIFOUND2_SHIFT (10U) -/*! FIFOUND2 - FIFO Underflow Exception Flag for Channel 2 - * 0b0..No exception by FIFO underflow - * 0b1..Exception by FIFO underflow - */ -#define PDM_FIFO_STAT_FIFOUND2(x) (((uint32_t)(((uint32_t)(x)) << PDM_FIFO_STAT_FIFOUND2_SHIFT)) & PDM_FIFO_STAT_FIFOUND2_MASK) - -#define PDM_FIFO_STAT_FIFOUND3_MASK (0x800U) -#define PDM_FIFO_STAT_FIFOUND3_SHIFT (11U) -/*! FIFOUND3 - FIFO Underflow Exception Flag for Channel 3 - * 0b0..No exception by FIFO underflow - * 0b1..Exception by FIFO underflow - */ -#define PDM_FIFO_STAT_FIFOUND3(x) (((uint32_t)(((uint32_t)(x)) << PDM_FIFO_STAT_FIFOUND3_SHIFT)) & PDM_FIFO_STAT_FIFOUND3_MASK) -/*! @} */ - -/*! @name DATACHN_DATACH - MICFIL Output Result */ -/*! @{ */ - -#define PDM_DATACHN_DATACH_DATA_MASK (0xFFFFFFFFU) -#define PDM_DATACHN_DATACH_DATA_SHIFT (0U) -/*! DATA - Channel n Data */ -#define PDM_DATACHN_DATACH_DATA(x) (((uint32_t)(((uint32_t)(x)) << PDM_DATACHN_DATACH_DATA_SHIFT)) & PDM_DATACHN_DATACH_DATA_MASK) -/*! @} */ - -/* The count of PDM_DATACHN_DATACH */ -#define PDM_DATACHN_DATACH_COUNT (4U) - -/*! @name DC_CTRL - MICFIL DC Remover Control */ -/*! @{ */ - -#define PDM_DC_CTRL_DCCONFIG0_MASK (0x3U) -#define PDM_DC_CTRL_DCCONFIG0_SHIFT (0U) -/*! DCCONFIG0 - Channel 0 DC Remover Configuration - * 0b11..DC remover is bypassed - * 0b00..20 Hz (PDM_CLK = 3.072 MHz) - * 0b01..13.3 Hz (PDM_CLK = 3.072 MHz) - * 0b10..40 Hz (PDM_CLK = 3.072 MHz) - */ -#define PDM_DC_CTRL_DCCONFIG0(x) (((uint32_t)(((uint32_t)(x)) << PDM_DC_CTRL_DCCONFIG0_SHIFT)) & PDM_DC_CTRL_DCCONFIG0_MASK) - -#define PDM_DC_CTRL_DCCONFIG1_MASK (0xCU) -#define PDM_DC_CTRL_DCCONFIG1_SHIFT (2U) -/*! DCCONFIG1 - Channel 1 DC Remover Configuration - * 0b11..DC remover is bypassed - * 0b00..20 Hz (PDM_CLK = 3.072 MHz) - * 0b01..13.3 Hz (PDM_CLK = 3.072 MHz) - * 0b10..40 Hz (PDM_CLK = 3.072 MHz) - */ -#define PDM_DC_CTRL_DCCONFIG1(x) (((uint32_t)(((uint32_t)(x)) << PDM_DC_CTRL_DCCONFIG1_SHIFT)) & PDM_DC_CTRL_DCCONFIG1_MASK) - -#define PDM_DC_CTRL_DCCONFIG2_MASK (0x30U) -#define PDM_DC_CTRL_DCCONFIG2_SHIFT (4U) -/*! DCCONFIG2 - Channel 2 DC Remover Configuration - * 0b11..DC remover is bypassed - * 0b00..20 Hz (PDM_CLK = 3.072 MHz) - * 0b01..13.3 Hz (PDM_CLK = 3.072 MHz) - * 0b10..40 Hz (PDM_CLK = 3.072 MHz) - */ -#define PDM_DC_CTRL_DCCONFIG2(x) (((uint32_t)(((uint32_t)(x)) << PDM_DC_CTRL_DCCONFIG2_SHIFT)) & PDM_DC_CTRL_DCCONFIG2_MASK) - -#define PDM_DC_CTRL_DCCONFIG3_MASK (0xC0U) -#define PDM_DC_CTRL_DCCONFIG3_SHIFT (6U) -/*! DCCONFIG3 - Channel 3 DC Remover Configuration - * 0b11..DC remover is bypassed - * 0b00..20 Hz (PDM_CLK = 3.072 MHz) - * 0b01..13.3 Hz (PDM_CLK = 3.072 MHz) - * 0b10..40 Hz (PDM_CLK = 3.072 MHz) - */ -#define PDM_DC_CTRL_DCCONFIG3(x) (((uint32_t)(((uint32_t)(x)) << PDM_DC_CTRL_DCCONFIG3_SHIFT)) & PDM_DC_CTRL_DCCONFIG3_MASK) -/*! @} */ - -/*! @name DC_OUT_CTRL - MICFIL Output DC Remover Control */ -/*! @{ */ - -#define PDM_DC_OUT_CTRL_DCCONFIG0_MASK (0x3U) -#define PDM_DC_OUT_CTRL_DCCONFIG0_SHIFT (0U) -/*! DCCONFIG0 - Channel 0 DC Remover Configuration - * 0b11..DC remover is bypassed - * 0b00..20 Hz (FS = 48 kHz) - * 0b01..13.3 Hz (FS = 48 kHz) - * 0b10..40 Hz (FS = 48 kHz) - */ -#define PDM_DC_OUT_CTRL_DCCONFIG0(x) (((uint32_t)(((uint32_t)(x)) << PDM_DC_OUT_CTRL_DCCONFIG0_SHIFT)) & PDM_DC_OUT_CTRL_DCCONFIG0_MASK) - -#define PDM_DC_OUT_CTRL_DCCONFIG1_MASK (0xCU) -#define PDM_DC_OUT_CTRL_DCCONFIG1_SHIFT (2U) -/*! DCCONFIG1 - Channel 1 DC Remover Configuration - * 0b11..DC remover is bypassed - * 0b00..20 Hz (FS = 48 kHz) - * 0b01..13.3 Hz (FS = 48 kHz) - * 0b10..40 Hz (FS = 48 kHz) - */ -#define PDM_DC_OUT_CTRL_DCCONFIG1(x) (((uint32_t)(((uint32_t)(x)) << PDM_DC_OUT_CTRL_DCCONFIG1_SHIFT)) & PDM_DC_OUT_CTRL_DCCONFIG1_MASK) - -#define PDM_DC_OUT_CTRL_DCCONFIG2_MASK (0x30U) -#define PDM_DC_OUT_CTRL_DCCONFIG2_SHIFT (4U) -/*! DCCONFIG2 - Channel 2 DC Remover Configuration - * 0b11..DC remover is bypassed - * 0b00..20 Hz (FS = 48 kHz) - * 0b01..13.3 Hz (FS = 48 kHz) - * 0b10..40 Hz (FS = 48 kHz) - */ -#define PDM_DC_OUT_CTRL_DCCONFIG2(x) (((uint32_t)(((uint32_t)(x)) << PDM_DC_OUT_CTRL_DCCONFIG2_SHIFT)) & PDM_DC_OUT_CTRL_DCCONFIG2_MASK) - -#define PDM_DC_OUT_CTRL_DCCONFIG3_MASK (0xC0U) -#define PDM_DC_OUT_CTRL_DCCONFIG3_SHIFT (6U) -/*! DCCONFIG3 - Channel 3 DC Remover Configuration - * 0b11..DC remover is bypassed - * 0b00..20 Hz (FS = 48 kHz) - * 0b01..13.3 Hz (FS = 48 kHz) - * 0b10..40 Hz (FS = 48 kHz) - */ -#define PDM_DC_OUT_CTRL_DCCONFIG3(x) (((uint32_t)(((uint32_t)(x)) << PDM_DC_OUT_CTRL_DCCONFIG3_SHIFT)) & PDM_DC_OUT_CTRL_DCCONFIG3_MASK) -/*! @} */ - -/*! @name RANGE_CTRL - MICFIL Range Control */ -/*! @{ */ - -#define PDM_RANGE_CTRL_RANGEADJ0_MASK (0xFU) -#define PDM_RANGE_CTRL_RANGEADJ0_SHIFT (0U) -/*! RANGEADJ0 - Channel 0 Range Adjustment */ -#define PDM_RANGE_CTRL_RANGEADJ0(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_CTRL_RANGEADJ0_SHIFT)) & PDM_RANGE_CTRL_RANGEADJ0_MASK) - -#define PDM_RANGE_CTRL_RANGEADJ1_MASK (0xF0U) -#define PDM_RANGE_CTRL_RANGEADJ1_SHIFT (4U) -/*! RANGEADJ1 - Channel 1 Range Adjustment */ -#define PDM_RANGE_CTRL_RANGEADJ1(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_CTRL_RANGEADJ1_SHIFT)) & PDM_RANGE_CTRL_RANGEADJ1_MASK) - -#define PDM_RANGE_CTRL_RANGEADJ2_MASK (0xF00U) -#define PDM_RANGE_CTRL_RANGEADJ2_SHIFT (8U) -/*! RANGEADJ2 - Channel 2 Range Adjustment */ -#define PDM_RANGE_CTRL_RANGEADJ2(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_CTRL_RANGEADJ2_SHIFT)) & PDM_RANGE_CTRL_RANGEADJ2_MASK) - -#define PDM_RANGE_CTRL_RANGEADJ3_MASK (0xF000U) -#define PDM_RANGE_CTRL_RANGEADJ3_SHIFT (12U) -/*! RANGEADJ3 - Channel 3 Range Adjustment */ -#define PDM_RANGE_CTRL_RANGEADJ3(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_CTRL_RANGEADJ3_SHIFT)) & PDM_RANGE_CTRL_RANGEADJ3_MASK) -/*! @} */ - -/*! @name RANGE_STAT - MICFIL Range Status */ -/*! @{ */ - -#define PDM_RANGE_STAT_RANGEOVF0_MASK (0x1U) -#define PDM_RANGE_STAT_RANGEOVF0_SHIFT (0U) -/*! RANGEOVF0 - Channel 0 Range Overflow Error Flag - * 0b0..No exception by range overflow - * 0b1..Exception by range overflow - */ -#define PDM_RANGE_STAT_RANGEOVF0(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_STAT_RANGEOVF0_SHIFT)) & PDM_RANGE_STAT_RANGEOVF0_MASK) - -#define PDM_RANGE_STAT_RANGEOVF1_MASK (0x2U) -#define PDM_RANGE_STAT_RANGEOVF1_SHIFT (1U) -/*! RANGEOVF1 - Channel 1 Range Overflow Error Flag - * 0b0..No exception by range overflow - * 0b1..Exception by range overflow - */ -#define PDM_RANGE_STAT_RANGEOVF1(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_STAT_RANGEOVF1_SHIFT)) & PDM_RANGE_STAT_RANGEOVF1_MASK) - -#define PDM_RANGE_STAT_RANGEOVF2_MASK (0x4U) -#define PDM_RANGE_STAT_RANGEOVF2_SHIFT (2U) -/*! RANGEOVF2 - Channel 2 Range Overflow Error Flag - * 0b0..No exception by range overflow - * 0b1..Exception by range overflow - */ -#define PDM_RANGE_STAT_RANGEOVF2(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_STAT_RANGEOVF2_SHIFT)) & PDM_RANGE_STAT_RANGEOVF2_MASK) - -#define PDM_RANGE_STAT_RANGEOVF3_MASK (0x8U) -#define PDM_RANGE_STAT_RANGEOVF3_SHIFT (3U) -/*! RANGEOVF3 - Channel 3 Range Overflow Error Flag - * 0b0..No exception by range overflow - * 0b1..Exception by range overflow - */ -#define PDM_RANGE_STAT_RANGEOVF3(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_STAT_RANGEOVF3_SHIFT)) & PDM_RANGE_STAT_RANGEOVF3_MASK) - -#define PDM_RANGE_STAT_RANGEUNF0_MASK (0x10000U) -#define PDM_RANGE_STAT_RANGEUNF0_SHIFT (16U) -/*! RANGEUNF0 - Channel 0 Range Underflow Error Flag - * 0b0..No exception by range underflow - * 0b1..Exception by range underflow - */ -#define PDM_RANGE_STAT_RANGEUNF0(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_STAT_RANGEUNF0_SHIFT)) & PDM_RANGE_STAT_RANGEUNF0_MASK) - -#define PDM_RANGE_STAT_RANGEUNF1_MASK (0x20000U) -#define PDM_RANGE_STAT_RANGEUNF1_SHIFT (17U) -/*! RANGEUNF1 - Channel 1 Range Underflow Error Flag - * 0b0..No exception by range underflow - * 0b1..Exception by range underflow - */ -#define PDM_RANGE_STAT_RANGEUNF1(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_STAT_RANGEUNF1_SHIFT)) & PDM_RANGE_STAT_RANGEUNF1_MASK) - -#define PDM_RANGE_STAT_RANGEUNF2_MASK (0x40000U) -#define PDM_RANGE_STAT_RANGEUNF2_SHIFT (18U) -/*! RANGEUNF2 - Channel 2 Range Underflow Error Flag - * 0b0..No exception by range underflow - * 0b1..Exception by range underflow - */ -#define PDM_RANGE_STAT_RANGEUNF2(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_STAT_RANGEUNF2_SHIFT)) & PDM_RANGE_STAT_RANGEUNF2_MASK) - -#define PDM_RANGE_STAT_RANGEUNF3_MASK (0x80000U) -#define PDM_RANGE_STAT_RANGEUNF3_SHIFT (19U) -/*! RANGEUNF3 - Channel 3 Range Underflow Error Flag - * 0b0..No exception by range underflow - * 0b1..Exception by range underflow - */ -#define PDM_RANGE_STAT_RANGEUNF3(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_STAT_RANGEUNF3_SHIFT)) & PDM_RANGE_STAT_RANGEUNF3_MASK) -/*! @} */ - -/*! @name FSYNC_CTRL - Frame Synchronization Control */ -/*! @{ */ - -#define PDM_FSYNC_CTRL_FSYNCLEN_MASK (0xFFFFFFFFU) -#define PDM_FSYNC_CTRL_FSYNCLEN_SHIFT (0U) -/*! FSYNCLEN - Frame Synchronization Window Length */ -#define PDM_FSYNC_CTRL_FSYNCLEN(x) (((uint32_t)(((uint32_t)(x)) << PDM_FSYNC_CTRL_FSYNCLEN_SHIFT)) & PDM_FSYNC_CTRL_FSYNCLEN_MASK) -/*! @} */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define PDM_VERID_FEATURE_MASK (0xFFFFU) -#define PDM_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number */ -#define PDM_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << PDM_VERID_FEATURE_SHIFT)) & PDM_VERID_FEATURE_MASK) - -#define PDM_VERID_MINOR_MASK (0xFF0000U) -#define PDM_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define PDM_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << PDM_VERID_MINOR_SHIFT)) & PDM_VERID_MINOR_MASK) - -#define PDM_VERID_MAJOR_MASK (0xFF000000U) -#define PDM_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define PDM_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << PDM_VERID_MAJOR_SHIFT)) & PDM_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define PDM_PARAM_NPAIR_MASK (0xFU) -#define PDM_PARAM_NPAIR_SHIFT (0U) -/*! NPAIR - Number of Microphone Pairs - * 0b0000..None - * 0b0001..1 pair - * 0b0010..2 pairs - * 0b0011-0b1110..... - * 0b1111..15 pairs - */ -#define PDM_PARAM_NPAIR(x) (((uint32_t)(((uint32_t)(x)) << PDM_PARAM_NPAIR_SHIFT)) & PDM_PARAM_NPAIR_MASK) - -#define PDM_PARAM_FIFO_PTRWID_MASK (0xF0U) -#define PDM_PARAM_FIFO_PTRWID_SHIFT (4U) -/*! FIFO_PTRWID - FIFO Pointer Width - * 0b0000..0 bits - * 0b0001..1 bit - * 0b0010..2 bits - * 0b0011-0b1110..... - * 0b1111..15 bits - */ -#define PDM_PARAM_FIFO_PTRWID(x) (((uint32_t)(((uint32_t)(x)) << PDM_PARAM_FIFO_PTRWID_SHIFT)) & PDM_PARAM_FIFO_PTRWID_MASK) - -#define PDM_PARAM_FIL_OUT_WIDTH_24B_MASK (0x100U) -#define PDM_PARAM_FIL_OUT_WIDTH_24B_SHIFT (8U) -/*! FIL_OUT_WIDTH_24B - Filter Output Width - * 0b0..16 bits - * 0b1..24 bits - */ -#define PDM_PARAM_FIL_OUT_WIDTH_24B(x) (((uint32_t)(((uint32_t)(x)) << PDM_PARAM_FIL_OUT_WIDTH_24B_SHIFT)) & PDM_PARAM_FIL_OUT_WIDTH_24B_MASK) - -#define PDM_PARAM_LOW_POWER_MASK (0x200U) -#define PDM_PARAM_LOW_POWER_SHIFT (9U) -/*! LOW_POWER - Low-Power Decimation Filter - * 0b0..Disables - * 0b1..Enables - */ -#define PDM_PARAM_LOW_POWER(x) (((uint32_t)(((uint32_t)(x)) << PDM_PARAM_LOW_POWER_SHIFT)) & PDM_PARAM_LOW_POWER_MASK) - -#define PDM_PARAM_DC_BYPASS_MASK (0x400U) -#define PDM_PARAM_DC_BYPASS_SHIFT (10U) -/*! DC_BYPASS - Input DC Remover Bypass - * 0b0..Active - * 0b1..Disabled - */ -#define PDM_PARAM_DC_BYPASS(x) (((uint32_t)(((uint32_t)(x)) << PDM_PARAM_DC_BYPASS_SHIFT)) & PDM_PARAM_DC_BYPASS_MASK) - -#define PDM_PARAM_DC_OUT_BYPASS_MASK (0x800U) -#define PDM_PARAM_DC_OUT_BYPASS_SHIFT (11U) -/*! DC_OUT_BYPASS - Output DC Remover Bypass - * 0b0..Active - * 0b1..Disabled - */ -#define PDM_PARAM_DC_OUT_BYPASS(x) (((uint32_t)(((uint32_t)(x)) << PDM_PARAM_DC_OUT_BYPASS_SHIFT)) & PDM_PARAM_DC_OUT_BYPASS_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group PDM_Register_Masks */ - - -/* PDM - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral PDM base address */ - #define PDM_BASE (0x5010C000u) - /** Peripheral PDM base address */ - #define PDM_BASE_NS (0x4010C000u) - /** Peripheral PDM base pointer */ - #define PDM ((PDM_Type *)PDM_BASE) - /** Peripheral PDM base pointer */ - #define PDM_NS ((PDM_Type *)PDM_BASE_NS) - /** Array initializer of PDM peripheral base addresses */ - #define PDM_BASE_ADDRS { PDM_BASE } - /** Array initializer of PDM peripheral base pointers */ - #define PDM_BASE_PTRS { PDM } - /** Array initializer of PDM peripheral base addresses */ - #define PDM_BASE_ADDRS_NS { PDM_BASE_NS } - /** Array initializer of PDM peripheral base pointers */ - #define PDM_BASE_PTRS_NS { PDM_NS } -#else - /** Peripheral PDM base address */ - #define PDM_BASE (0x4010C000u) - /** Peripheral PDM base pointer */ - #define PDM ((PDM_Type *)PDM_BASE) - /** Array initializer of PDM peripheral base addresses */ - #define PDM_BASE_ADDRS { PDM_BASE } - /** Array initializer of PDM peripheral base pointers */ - #define PDM_BASE_PTRS { PDM } -#endif -/** Interrupt vectors for the PDM peripheral type */ -#define PDM_IRQS { PDM_EVENT_IRQn } - -/*! - * @} - */ /* end of group PDM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- PINT Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PINT_Peripheral_Access_Layer PINT Peripheral Access Layer - * @{ - */ - -/** PINT - Register Layout Typedef */ -typedef struct { - __IO uint32_t ISEL; /**< Pin Interrupt Mode, offset: 0x0 */ - __IO uint32_t IENR; /**< Pin Interrupt Level or Rising-Edge Interrupt Enable, offset: 0x4 */ - __O uint32_t SIENR; /**< Pin Interrupt Level or Rising-Edge Interrupt Set, offset: 0x8 */ - __IO uint32_t CIENR; /**< Pin Interrupt Level (Rising-Edge Interrupt) Clear, offset: 0xC */ - __IO uint32_t IENF; /**< Pin Interrupt Active Level or Falling-Edge Interrupt Enable, offset: 0x10 */ - __O uint32_t SIENF; /**< Pin Interrupt Active Level or Falling-Edge Interrupt Set, offset: 0x14 */ - __O uint32_t CIENF; /**< Pin Interrupt Active Level or Falling-Edge Interrupt Clear, offset: 0x18 */ - __IO uint32_t RISE; /**< Pin Interrupt Rising Edge, offset: 0x1C */ - __IO uint32_t FALL; /**< Pin Interrupt Falling Edge, offset: 0x20 */ - __IO uint32_t IST; /**< Pin Interrupt Status, offset: 0x24 */ - __IO uint32_t PMCTRL; /**< Pattern-Match Interrupt Control, offset: 0x28 */ - __IO uint32_t PMSRC; /**< Pattern-Match Interrupt Bit-Slice Source, offset: 0x2C */ - __IO uint32_t PMCFG; /**< Pattern-Match Interrupt Bit Slice Configuration, offset: 0x30 */ -} PINT_Type; - -/* ---------------------------------------------------------------------------- - -- PINT Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PINT_Register_Masks PINT Register Masks - * @{ - */ - -/*! @name ISEL - Pin Interrupt Mode */ -/*! @{ */ - -#define PINT_ISEL_PMODE_MASK (0xFFU) -#define PINT_ISEL_PMODE_SHIFT (0U) -/*! PMODE - Interrupt mode - * 0b00000000..In bit n configures the interrupt to be edge-sensitive - * 0b00000001..In bit n configures the interrupt to be level-sensitive - */ -#define PINT_ISEL_PMODE(x) (((uint32_t)(((uint32_t)(x)) << PINT_ISEL_PMODE_SHIFT)) & PINT_ISEL_PMODE_MASK) -/*! @} */ - -/*! @name IENR - Pin Interrupt Level or Rising-Edge Interrupt Enable */ -/*! @{ */ - -#define PINT_IENR_ENRL_MASK (0xFFU) -#define PINT_IENR_ENRL_SHIFT (0U) -/*! ENRL - Enables Interrupt - * 0b00000000..In bit n disables the corresponding interrupt - * 0b00000001..In bit n enables the corresponding interrupt - */ -#define PINT_IENR_ENRL(x) (((uint32_t)(((uint32_t)(x)) << PINT_IENR_ENRL_SHIFT)) & PINT_IENR_ENRL_MASK) -/*! @} */ - -/*! @name SIENR - Pin Interrupt Level or Rising-Edge Interrupt Set */ -/*! @{ */ - -#define PINT_SIENR_SETENRL_MASK (0xFFU) -#define PINT_SIENR_SETENRL_SHIFT (0U) -/*! SETENRL - Configures IENR - * 0b00000000..No operation for interrupt n - * 0b00000001..Enable rising edge or level interrupt for interrupt n - */ -#define PINT_SIENR_SETENRL(x) (((uint32_t)(((uint32_t)(x)) << PINT_SIENR_SETENRL_SHIFT)) & PINT_SIENR_SETENRL_MASK) -/*! @} */ - -/*! @name CIENR - Pin Interrupt Level (Rising-Edge Interrupt) Clear */ -/*! @{ */ - -#define PINT_CIENR_CENRL_MASK (0xFFU) -#define PINT_CIENR_CENRL_SHIFT (0U) -/*! CENRL - Clear bits in IENR - * 0b00000000..No operation - * 0b00000001..Disable rising edge or level interrupt - */ -#define PINT_CIENR_CENRL(x) (((uint32_t)(((uint32_t)(x)) << PINT_CIENR_CENRL_SHIFT)) & PINT_CIENR_CENRL_MASK) -/*! @} */ - -/*! @name IENF - Pin Interrupt Active Level or Falling-Edge Interrupt Enable */ -/*! @{ */ - -#define PINT_IENF_ENAF_MASK (0xFFU) -#define PINT_IENF_ENAF_SHIFT (0U) -/*! ENAF - Enables Interrupt - * 0b00000000..Disable (set active interrupt level LOW) - * 0b00000001..Enable (set active interrupt level HIGH) - */ -#define PINT_IENF_ENAF(x) (((uint32_t)(((uint32_t)(x)) << PINT_IENF_ENAF_SHIFT)) & PINT_IENF_ENAF_MASK) -/*! @} */ - -/*! @name SIENF - Pin Interrupt Active Level or Falling-Edge Interrupt Set */ -/*! @{ */ - -#define PINT_SIENF_SETENAF_MASK (0xFFU) -#define PINT_SIENF_SETENAF_SHIFT (0U) -/*! SETENAF - * 0b00000000..Writes 0 to IENF. - * 0b00000001..Select HIGH-active interrupt or enable falling-edge interrupt - */ -#define PINT_SIENF_SETENAF(x) (((uint32_t)(((uint32_t)(x)) << PINT_SIENF_SETENAF_SHIFT)) & PINT_SIENF_SETENAF_MASK) -/*! @} */ - -/*! @name CIENF - Pin Interrupt Active Level or Falling-Edge Interrupt Clear */ -/*! @{ */ - -#define PINT_CIENF_CENAF_MASK (0xFFU) -#define PINT_CIENF_CENAF_SHIFT (0U) -/*! CENAF - Writes 0 to IENF - * 0b00000000..No operation - * 0b00000001..LOW-active interrupt selected or falling-edge interrupt disabled - */ -#define PINT_CIENF_CENAF(x) (((uint32_t)(((uint32_t)(x)) << PINT_CIENF_CENAF_SHIFT)) & PINT_CIENF_CENAF_MASK) -/*! @} */ - -/*! @name RISE - Pin Interrupt Rising Edge */ -/*! @{ */ - -#define PINT_RISE_RDET_MASK (0xFFU) -#define PINT_RISE_RDET_SHIFT (0U) -/*! RDET - Rising-Edge Detect - * 0b00000000..Read 0- No rising edge (since Reset or you wrote a 1 to this field last time), Write 0- No operation - * 0b00000001..Read 1- Rising edge (since Reset or you wrote a 1 to this field last time), Write 1- Clear rising-edge detection for this pin - */ -#define PINT_RISE_RDET(x) (((uint32_t)(((uint32_t)(x)) << PINT_RISE_RDET_SHIFT)) & PINT_RISE_RDET_MASK) -/*! @} */ - -/*! @name FALL - Pin Interrupt Falling Edge */ -/*! @{ */ - -#define PINT_FALL_FDET_MASK (0xFFU) -#define PINT_FALL_FDET_SHIFT (0U) -/*! FDET - Falling-Edge Detect - * 0b00000000..Read 0- No falling edge (since Reset or you wrote a 1 to this field last time), Write 0- No operation - * 0b00000001..Read 1- Falling edge (since Reset or you wrote a 1 to this field last time), Write 1- Clear falling-edge detection for this bit - */ -#define PINT_FALL_FDET(x) (((uint32_t)(((uint32_t)(x)) << PINT_FALL_FDET_SHIFT)) & PINT_FALL_FDET_MASK) -/*! @} */ - -/*! @name IST - Pin Interrupt Status */ -/*! @{ */ - -#define PINT_IST_PSTAT_MASK (0xFFU) -#define PINT_IST_PSTAT_SHIFT (0U) -/*! PSTAT - Pin Interrupt Status - * 0b00000000..Read 0- Interrupt is not requested, Write 0- No operation - * 0b00000001..Read 1- Interrupt is requested, Write 1 (edge-sensitive)- clear rising- and falling-edge detection - * for this pin, Write 1 (level-sensitive)- switch the active level for this pin in - */ -#define PINT_IST_PSTAT(x) (((uint32_t)(((uint32_t)(x)) << PINT_IST_PSTAT_SHIFT)) & PINT_IST_PSTAT_MASK) -/*! @} */ - -/*! @name PMCTRL - Pattern-Match Interrupt Control */ -/*! @{ */ - -#define PINT_PMCTRL_SEL_PMATCH_MASK (0x1U) -#define PINT_PMCTRL_SEL_PMATCH_SHIFT (0U) -/*! SEL_PMATCH - Specifies whether the pin interrupts are controlled by the pin interrupt function - * or by the pattern-match function. If this value is 0b, interrupts are driven in response to the - * standard pin interrupt function. If this value is 1b, interrupts are driven in response to - * pattern matches. - * 0b0..Pin interrupt - * 0b1..Pattern match - */ -#define PINT_PMCTRL_SEL_PMATCH(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCTRL_SEL_PMATCH_SHIFT)) & PINT_PMCTRL_SEL_PMATCH_MASK) - -#define PINT_PMCTRL_ENA_RXEV_MASK (0x2U) -#define PINT_PMCTRL_ENA_RXEV_SHIFT (1U) -/*! ENA_RXEV - Enables the RXEV output to the CPU and/or to a GPIO output, when the specified - * Boolean expression evaluates to true. If this value is 0b, RXEV output to the CPU is disabled. If - * this value is 1b, RXEV output to the CPU is enabled. - * 0b0..Disabled - * 0b1..Enabled - */ -#define PINT_PMCTRL_ENA_RXEV(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCTRL_ENA_RXEV_SHIFT)) & PINT_PMCTRL_ENA_RXEV_MASK) - -#define PINT_PMCTRL_PMAT_MASK (0xFF000000U) -#define PINT_PMCTRL_PMAT_SHIFT (24U) -/*! PMAT - Pattern Matches - * 0b00000001..The corresponding product term is matched by the current state of the appropriate inputs - */ -#define PINT_PMCTRL_PMAT(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCTRL_PMAT_SHIFT)) & PINT_PMCTRL_PMAT_MASK) -/*! @} */ - -/*! @name PMSRC - Pattern-Match Interrupt Bit-Slice Source */ -/*! @{ */ - -#define PINT_PMSRC_SRC0_MASK (0x700U) -#define PINT_PMSRC_SRC0_SHIFT (8U) -/*! SRC0 - Selects the input source for bit slice 0 - * 0b000..Input 0 (selects the pin identified in PINTSEL0) - * 0b001..Input 1 (selects the pin identified in PINTSEL1) - * 0b010..Input 2 (selects the pin identified in PINTSEL2) - * 0b011..Input 3 (selects the pin identified in PINTSEL3) - * 0b100..Input 4 (selects the pin identified in PINTSEL4) - * 0b101..Input 5 (selects the pin identified in PINTSEL5) - * 0b110..Input 6 (selects the pin identified in PINTSEL6) - * 0b111..Input 7 (selects the pin identified in PINTSEL7) - */ -#define PINT_PMSRC_SRC0(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMSRC_SRC0_SHIFT)) & PINT_PMSRC_SRC0_MASK) - -#define PINT_PMSRC_SRC1_MASK (0x3800U) -#define PINT_PMSRC_SRC1_SHIFT (11U) -/*! SRC1 - Selects the input source for bit slice 1 - * 0b000..Input 0 (selects the pin identified in PINTSEL0) - * 0b001..Input 1 (selects the pin identified in PINTSEL1) - * 0b010..Input 2 (selects the pin identified in PINTSEL2) - * 0b011..Input 3 (selects the pin identified in PINTSEL3) - * 0b100..Input 4 (selects the pin identified in PINTSEL4) - * 0b101..Input 5 (selects the pin identified in PINTSEL5) - * 0b110..Input 6 (selects the pin identified in PINTSEL6) - * 0b111..Input 7 (selects the pin identified in PINTSEL7) - */ -#define PINT_PMSRC_SRC1(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMSRC_SRC1_SHIFT)) & PINT_PMSRC_SRC1_MASK) - -#define PINT_PMSRC_SRC2_MASK (0x1C000U) -#define PINT_PMSRC_SRC2_SHIFT (14U) -/*! SRC2 - Selects the input source for bit slice 2 - * 0b000..Input 0 (selects the pin identified in PINTSEL0) - * 0b001..Input 1 (selects the pin identified in PINTSEL1) - * 0b010..Input 2 (selects the pin identified in PINTSEL2) - * 0b011..Input 3 (selects the pin identified in PINTSEL3) - * 0b100..Input 4 (selects the pin identified in PINTSEL4) - * 0b101..Input 5 (selects the pin identified in PINTSEL5) - * 0b110..Input 6 (selects the pin identified in PINTSEL6) - * 0b111..Input 7 (selects the pin identified in PINTSEL7) - */ -#define PINT_PMSRC_SRC2(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMSRC_SRC2_SHIFT)) & PINT_PMSRC_SRC2_MASK) - -#define PINT_PMSRC_SRC3_MASK (0xE0000U) -#define PINT_PMSRC_SRC3_SHIFT (17U) -/*! SRC3 - Selects the input source for bit slice 3 - * 0b000..Input 0 (selects the pin identified in PINTSEL0) - * 0b001..Input 1 (selects the pin identified in PINTSEL1) - * 0b010..Input 2 (selects the pin identified in PINTSEL2) - * 0b011..Input 3 (selects the pin identified in PINTSEL3) - * 0b100..Input 4 (selects the pin identified in PINTSEL4) - * 0b101..Input 5 (selects the pin identified in PINTSEL5) - * 0b110..Input 6 (selects the pin identified in PINTSEL6) - * 0b111..Input 7 (selects the pin identified in PINTSEL7) - */ -#define PINT_PMSRC_SRC3(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMSRC_SRC3_SHIFT)) & PINT_PMSRC_SRC3_MASK) - -#define PINT_PMSRC_SRC4_MASK (0x700000U) -#define PINT_PMSRC_SRC4_SHIFT (20U) -/*! SRC4 - Selects the input source for bit slice 4 - * 0b000..Input 0 (selects the pin identified in PINTSEL0) - * 0b001..Input 1 (selects the pin identified in PINTSEL1) - * 0b010..Input 2 (selects the pin identified in PINTSEL2) - * 0b011..Input 3 (selects the pin identified in PINTSEL3) - * 0b100..Input 4 (selects the pin identified in PINTSEL4) - * 0b101..Input 5 (selects the pin identified in PINTSEL5) - * 0b110..Input 6 (selects the pin identified in PINTSEL6) - * 0b111..Input 7 (selects the pin identified in PINTSEL7) - */ -#define PINT_PMSRC_SRC4(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMSRC_SRC4_SHIFT)) & PINT_PMSRC_SRC4_MASK) - -#define PINT_PMSRC_SRC5_MASK (0x3800000U) -#define PINT_PMSRC_SRC5_SHIFT (23U) -/*! SRC5 - Selects the input source for bit slice 5 - * 0b000..Input 0 (selects the pin identified in PINTSEL0) - * 0b001..Input 1 (selects the pin identified in PINTSEL1) - * 0b010..Input 2 (selects the pin identified in PINTSEL2) - * 0b011..Input 3 (selects the pin identified in PINTSEL3) - * 0b100..Input 4 (selects the pin identified in PINTSEL4) - * 0b101..Input 5 (selects the pin identified in PINTSEL5) - * 0b110..Input 6 (selects the pin identified in PINTSEL6) - * 0b111..Input 7 (selects the pin identified in PINTSEL7) - */ -#define PINT_PMSRC_SRC5(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMSRC_SRC5_SHIFT)) & PINT_PMSRC_SRC5_MASK) - -#define PINT_PMSRC_SRC6_MASK (0x1C000000U) -#define PINT_PMSRC_SRC6_SHIFT (26U) -/*! SRC6 - Selects the input source for bit slice 6 - * 0b000..Input 0 (selects the pin identified in PINTSEL0) - * 0b001..Input 1 (selects the pin identified in PINTSEL1) - * 0b010..Input 2 (selects the pin identified in PINTSEL2) - * 0b011..Input 3 (selects the pin identified in PINTSEL3) - * 0b100..Input 4 (selects the pin identified in PINTSEL4) - * 0b101..Input 5 (selects the pin identified in PINTSEL5) - * 0b110..Input 6 (selects the pin identified in PINTSEL6) - * 0b111..Input 7 (selects the pin identified in PINTSEL7) - */ -#define PINT_PMSRC_SRC6(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMSRC_SRC6_SHIFT)) & PINT_PMSRC_SRC6_MASK) - -#define PINT_PMSRC_SRC7_MASK (0xE0000000U) -#define PINT_PMSRC_SRC7_SHIFT (29U) -/*! SRC7 - Selects the input source for bit slice 7 - * 0b000..Input 0 (selects the pin identified in PINTSEL0) - * 0b001..Input 1 (selects the pin identified in PINTSEL1) - * 0b010..Input 2 (selects the pin identified in PINTSEL2) - * 0b011..Input 3 (selects the pin identified in PINTSEL3) - * 0b100..Input 4 (selects the pin identified in PINTSEL4) - * 0b101..Input 5 (selects the pin identified in PINTSEL5) - * 0b110..Input 6 (selects the pin identified in PINTSEL6) - * 0b111..Input 7 (selects the pin identified in PINTSEL7) - */ -#define PINT_PMSRC_SRC7(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMSRC_SRC7_SHIFT)) & PINT_PMSRC_SRC7_MASK) -/*! @} */ - -/*! @name PMCFG - Pattern-Match Interrupt Bit Slice Configuration */ -/*! @{ */ - -#define PINT_PMCFG_PROD_ENDPTS0_MASK (0x1U) -#define PINT_PMCFG_PROD_ENDPTS0_SHIFT (0U) -/*! PROD_ENDPTS0 - Determines whether slice 0 is an endpoint. Slice 0 is not an endpoint. Slice 0 is - * the endpoint of a product term (minterm). Pin interrupt 0 in the NVIC is raised if the - * minterm evaluates as true. - * 0b0..No effect - * 0b1..Endpoint - */ -#define PINT_PMCFG_PROD_ENDPTS0(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_PROD_ENDPTS0_SHIFT)) & PINT_PMCFG_PROD_ENDPTS0_MASK) - -#define PINT_PMCFG_PROD_ENDPTS1_MASK (0x2U) -#define PINT_PMCFG_PROD_ENDPTS1_SHIFT (1U) -/*! PROD_ENDPTS1 - Determines whether slice 1 is an endpoint. Slice 1 is not an endpoint. Slice 1 is - * the endpoint of a product term (minterm). Pin interrupt 1 in the NVIC is raised if the - * minterm evaluates as true. - * 0b0..No effect - * 0b1..Endpoint - */ -#define PINT_PMCFG_PROD_ENDPTS1(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_PROD_ENDPTS1_SHIFT)) & PINT_PMCFG_PROD_ENDPTS1_MASK) - -#define PINT_PMCFG_PROD_ENDPTS2_MASK (0x4U) -#define PINT_PMCFG_PROD_ENDPTS2_SHIFT (2U) -/*! PROD_ENDPTS2 - Determines whether slice 2 is an endpoint. Slice 2 is not an endpoint. Slice 2 is - * the endpoint of a product term (minterm). Pin interrupt 2 in the NVIC is raised if the - * minterm evaluates as true. - * 0b0..No effect - * 0b1..Endpoint - */ -#define PINT_PMCFG_PROD_ENDPTS2(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_PROD_ENDPTS2_SHIFT)) & PINT_PMCFG_PROD_ENDPTS2_MASK) - -#define PINT_PMCFG_PROD_ENDPTS3_MASK (0x8U) -#define PINT_PMCFG_PROD_ENDPTS3_SHIFT (3U) -/*! PROD_ENDPTS3 - Determines whether slice 3 is an endpoint. Slice 3 is not an endpoint. Slice 3 is - * the endpoint of a product term (minterm). Pin interrupt 3 in the NVIC is raised if the - * minterm evaluates as true. - * 0b0..No effect - * 0b1..Endpoint - */ -#define PINT_PMCFG_PROD_ENDPTS3(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_PROD_ENDPTS3_SHIFT)) & PINT_PMCFG_PROD_ENDPTS3_MASK) - -#define PINT_PMCFG_PROD_ENDPTS4_MASK (0x10U) -#define PINT_PMCFG_PROD_ENDPTS4_SHIFT (4U) -/*! PROD_ENDPTS4 - Determines whether slice 4 is an endpoint. Slice 4 is not an endpoint. Slice 4 is - * the endpoint of a product term (minterm). Pin interrupt 4 in the NVIC is raised if the - * minterm evaluates as true. - * 0b0..No effect - * 0b1..Endpoint - */ -#define PINT_PMCFG_PROD_ENDPTS4(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_PROD_ENDPTS4_SHIFT)) & PINT_PMCFG_PROD_ENDPTS4_MASK) - -#define PINT_PMCFG_PROD_ENDPTS5_MASK (0x20U) -#define PINT_PMCFG_PROD_ENDPTS5_SHIFT (5U) -/*! PROD_ENDPTS5 - Determines whether slice 5 is an endpoint. Slice 5 is not an endpoint. Slice 5 is - * the endpoint of a product term (minterm). Pin interrupt 5 in the NVIC is raised if the - * minterm evaluates as true. - * 0b0..No effect - * 0b1..Endpoint - */ -#define PINT_PMCFG_PROD_ENDPTS5(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_PROD_ENDPTS5_SHIFT)) & PINT_PMCFG_PROD_ENDPTS5_MASK) - -#define PINT_PMCFG_PROD_ENDPTS6_MASK (0x40U) -#define PINT_PMCFG_PROD_ENDPTS6_SHIFT (6U) -/*! PROD_ENDPTS6 - Determines whether slice 6 is an endpoint. Slice 6 is not an endpoint. Slice 6 is - * the endpoint of a product term (minterm). Pin interrupt 6 in the NVIC is raised if the - * minterm evaluates as true. - * 0b0..No effect - * 0b1..Endpoint - */ -#define PINT_PMCFG_PROD_ENDPTS6(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_PROD_ENDPTS6_SHIFT)) & PINT_PMCFG_PROD_ENDPTS6_MASK) - -#define PINT_PMCFG_CFG0_MASK (0x700U) -#define PINT_PMCFG_CFG0_SHIFT (8U) -/*! CFG0 - Match Configuration - * 0b000..Constant HIGH - * 0b001..Sticky rising edge - * 0b010..Sticky falling edge - * 0b011..Sticky rising or falling edge - * 0b100..High level - * 0b101..Low level - * 0b110..Constant 0 - * 0b111..Event (Nonsticky rising or falling edge) - */ -#define PINT_PMCFG_CFG0(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_CFG0_SHIFT)) & PINT_PMCFG_CFG0_MASK) - -#define PINT_PMCFG_CFG1_MASK (0x3800U) -#define PINT_PMCFG_CFG1_SHIFT (11U) -/*! CFG1 - Match Configuration - * 0b000..Constant HIGH - * 0b001..Sticky rising edge - * 0b010..Sticky falling edge - * 0b011..Sticky rising or falling edge - * 0b100..High level - * 0b101..Low level - * 0b110..Constant 0 - * 0b111..Event (Nonsticky rising or falling edge) - */ -#define PINT_PMCFG_CFG1(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_CFG1_SHIFT)) & PINT_PMCFG_CFG1_MASK) - -#define PINT_PMCFG_CFG2_MASK (0x1C000U) -#define PINT_PMCFG_CFG2_SHIFT (14U) -/*! CFG2 - Match Configuration - * 0b000..Constant HIGH - * 0b001..Sticky rising edge - * 0b010..Sticky falling edge - * 0b011..Sticky rising or falling edge - * 0b100..High level - * 0b101..Low level - * 0b110..Constant 0 - * 0b111..Event (Nonsticky rising or falling edge) - */ -#define PINT_PMCFG_CFG2(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_CFG2_SHIFT)) & PINT_PMCFG_CFG2_MASK) - -#define PINT_PMCFG_CFG3_MASK (0xE0000U) -#define PINT_PMCFG_CFG3_SHIFT (17U) -/*! CFG3 - Match Configuration - * 0b000..Constant HIGH - * 0b001..Sticky rising edge - * 0b010..Sticky falling edge - * 0b011..Sticky rising or falling edge - * 0b100..High level - * 0b101..Low level - * 0b110..Constant 0 - * 0b111..Event (Nonsticky rising or falling edge) - */ -#define PINT_PMCFG_CFG3(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_CFG3_SHIFT)) & PINT_PMCFG_CFG3_MASK) - -#define PINT_PMCFG_CFG4_MASK (0x700000U) -#define PINT_PMCFG_CFG4_SHIFT (20U) -/*! CFG4 - Match Configuration - * 0b000..Constant HIGH - * 0b001..Sticky rising edge - * 0b010..Sticky falling edge - * 0b011..Sticky rising or falling edge - * 0b100..High level - * 0b101..Low level - * 0b110..Constant 0 - * 0b111..Event (Nonsticky rising or falling edge) - */ -#define PINT_PMCFG_CFG4(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_CFG4_SHIFT)) & PINT_PMCFG_CFG4_MASK) - -#define PINT_PMCFG_CFG5_MASK (0x3800000U) -#define PINT_PMCFG_CFG5_SHIFT (23U) -/*! CFG5 - Match Configuration - * 0b000..Constant HIGH - * 0b001..Sticky rising edge - * 0b010..Sticky falling edge - * 0b011..Sticky rising or falling edge - * 0b100..High level - * 0b101..Low level - * 0b110..Constant 0 - * 0b111..Event (Nonsticky rising or falling edge) - */ -#define PINT_PMCFG_CFG5(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_CFG5_SHIFT)) & PINT_PMCFG_CFG5_MASK) - -#define PINT_PMCFG_CFG6_MASK (0x1C000000U) -#define PINT_PMCFG_CFG6_SHIFT (26U) -/*! CFG6 - Match Configuration - * 0b000..Constant HIGH - * 0b001..Sticky rising edge - * 0b010..Sticky falling edge - * 0b011..Sticky rising or falling edge - * 0b100..High level - * 0b101..Low level - * 0b110..Constant 0 - * 0b111..Event (Nonsticky rising or falling edge) - */ -#define PINT_PMCFG_CFG6(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_CFG6_SHIFT)) & PINT_PMCFG_CFG6_MASK) - -#define PINT_PMCFG_CFG7_MASK (0xE0000000U) -#define PINT_PMCFG_CFG7_SHIFT (29U) -/*! CFG7 - Match Configuration - * 0b000..Constant HIGH - * 0b001..Sticky rising edge - * 0b010..Sticky falling edge - * 0b011..Sticky rising or falling edge - * 0b100..High level - * 0b101..Low level - * 0b110..Constant 0 - * 0b111..Event (Nonsticky rising or falling edge) - */ -#define PINT_PMCFG_CFG7(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_CFG7_SHIFT)) & PINT_PMCFG_CFG7_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group PINT_Register_Masks */ - - -/* PINT - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral PINT0 base address */ - #define PINT0_BASE (0x50004000u) - /** Peripheral PINT0 base address */ - #define PINT0_BASE_NS (0x40004000u) - /** Peripheral PINT0 base pointer */ - #define PINT0 ((PINT_Type *)PINT0_BASE) - /** Peripheral PINT0 base pointer */ - #define PINT0_NS ((PINT_Type *)PINT0_BASE_NS) - /** Array initializer of PINT peripheral base addresses */ - #define PINT_BASE_ADDRS { PINT0_BASE } - /** Array initializer of PINT peripheral base pointers */ - #define PINT_BASE_PTRS { PINT0 } - /** Array initializer of PINT peripheral base addresses */ - #define PINT_BASE_ADDRS_NS { PINT0_BASE_NS } - /** Array initializer of PINT peripheral base pointers */ - #define PINT_BASE_PTRS_NS { PINT0_NS } -#else - /** Peripheral PINT0 base address */ - #define PINT0_BASE (0x40004000u) - /** Peripheral PINT0 base pointer */ - #define PINT0 ((PINT_Type *)PINT0_BASE) - /** Array initializer of PINT peripheral base addresses */ - #define PINT_BASE_ADDRS { PINT0_BASE } - /** Array initializer of PINT peripheral base pointers */ - #define PINT_BASE_PTRS { PINT0 } -#endif -/** Interrupt vectors for the PINT peripheral type */ -#define PINT_IRQS { PINT0_IRQn } -/* Backward compatibility */ -#define PINT PINT0 - - -/*! - * @} - */ /* end of group PINT_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- PKC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PKC_Peripheral_Access_Layer PKC Peripheral Access Layer - * @{ - */ - -/** PKC - Register Layout Typedef */ -typedef struct { - __I uint32_t PKC_STATUS; /**< Status Register, offset: 0x0 */ - __IO uint32_t PKC_CTRL; /**< Control Register, offset: 0x4 */ - __IO uint32_t PKC_CFG; /**< Configuration register, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __IO uint32_t PKC_MODE1; /**< Mode register, parameter set 1, offset: 0x10 */ - __IO uint32_t PKC_XYPTR1; /**< X+Y pointer register, parameter set 1, offset: 0x14 */ - __IO uint32_t PKC_ZRPTR1; /**< Z+R pointer register, parameter set 1, offset: 0x18 */ - __IO uint32_t PKC_LEN1; /**< Length register, parameter set 1, offset: 0x1C */ - __IO uint32_t PKC_MODE2; /**< Mode register, parameter set 2, offset: 0x20 */ - __IO uint32_t PKC_XYPTR2; /**< X+Y pointer register, parameter set 2, offset: 0x24 */ - __IO uint32_t PKC_ZRPTR2; /**< Z+R pointer register, parameter set 2, offset: 0x28 */ - __IO uint32_t PKC_LEN2; /**< Length register, parameter set 2, offset: 0x2C */ - uint8_t RESERVED_1[16]; - __IO uint32_t PKC_UPTR; /**< Universal pointer FUP program, offset: 0x40 */ - __IO uint32_t PKC_UPTRT; /**< Universal pointer FUP table, offset: 0x44 */ - __IO uint32_t PKC_ULEN; /**< Universal pointer length, offset: 0x48 */ - uint8_t RESERVED_2[4]; - __IO uint32_t PKC_MCDATA; /**< MC pattern data interface, offset: 0x50 */ - uint8_t RESERVED_3[12]; - __I uint32_t PKC_VERSION; /**< PKC version register, offset: 0x60 */ - uint8_t RESERVED_4[3916]; - __O uint32_t PKC_SOFT_RST; /**< Software reset, offset: 0xFB0 */ - uint8_t RESERVED_5[12]; - __I uint32_t PKC_ACCESS_ERR; /**< Access Error, offset: 0xFC0 */ - __O uint32_t PKC_ACCESS_ERR_CLR; /**< Clear Access Error, offset: 0xFC4 */ - uint8_t RESERVED_6[16]; - __O uint32_t PKC_INT_CLR_ENABLE; /**< Interrupt enable clear, offset: 0xFD8 */ - __O uint32_t PKC_INT_SET_ENABLE; /**< Interrupt enable set, offset: 0xFDC */ - __I uint32_t PKC_INT_STATUS; /**< Interrupt status, offset: 0xFE0 */ - __I uint32_t PKC_INT_ENABLE; /**< Interrupt enable, offset: 0xFE4 */ - __O uint32_t PKC_INT_CLR_STATUS; /**< Interrupt status clear, offset: 0xFE8 */ - __O uint32_t PKC_INT_SET_STATUS; /**< Interrupt status set, offset: 0xFEC */ - uint8_t RESERVED_7[12]; - __I uint32_t PKC_MODULE_ID; /**< Module ID, offset: 0xFFC */ -} PKC_Type; - -/* ---------------------------------------------------------------------------- - -- PKC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PKC_Register_Masks PKC Register Masks - * @{ - */ - -/*! @name PKC_STATUS - Status Register */ -/*! @{ */ - -#define PKC_PKC_STATUS_ACTIV_MASK (0x1U) -#define PKC_PKC_STATUS_ACTIV_SHIFT (0U) -/*! ACTIV - PKC ACTIV */ -#define PKC_PKC_STATUS_ACTIV(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_STATUS_ACTIV_SHIFT)) & PKC_PKC_STATUS_ACTIV_MASK) - -#define PKC_PKC_STATUS_CARRY_MASK (0x2U) -#define PKC_PKC_STATUS_CARRY_SHIFT (1U) -/*! CARRY - Carry overflow flag */ -#define PKC_PKC_STATUS_CARRY(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_STATUS_CARRY_SHIFT)) & PKC_PKC_STATUS_CARRY_MASK) - -#define PKC_PKC_STATUS_ZERO_MASK (0x4U) -#define PKC_PKC_STATUS_ZERO_SHIFT (2U) -/*! ZERO - Zero result flag */ -#define PKC_PKC_STATUS_ZERO(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_STATUS_ZERO_SHIFT)) & PKC_PKC_STATUS_ZERO_MASK) - -#define PKC_PKC_STATUS_GOANY_MASK (0x8U) -#define PKC_PKC_STATUS_GOANY_SHIFT (3U) -/*! GOANY - Combined GO status flag */ -#define PKC_PKC_STATUS_GOANY(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_STATUS_GOANY_SHIFT)) & PKC_PKC_STATUS_GOANY_MASK) - -#define PKC_PKC_STATUS_LOCKED_MASK (0x60U) -#define PKC_PKC_STATUS_LOCKED_SHIFT (5U) -/*! LOCKED - Parameter set locked */ -#define PKC_PKC_STATUS_LOCKED(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_STATUS_LOCKED_SHIFT)) & PKC_PKC_STATUS_LOCKED_MASK) -/*! @} */ - -/*! @name PKC_CTRL - Control Register */ -/*! @{ */ - -#define PKC_PKC_CTRL_RESET_MASK (0x1U) -#define PKC_PKC_CTRL_RESET_SHIFT (0U) -/*! RESET - PKC reset control bit */ -#define PKC_PKC_CTRL_RESET(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_RESET_SHIFT)) & PKC_PKC_CTRL_RESET_MASK) - -#define PKC_PKC_CTRL_STOP_MASK (0x2U) -#define PKC_PKC_CTRL_STOP_SHIFT (1U) -/*! STOP - Freeze PKC calculation */ -#define PKC_PKC_CTRL_STOP(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_STOP_SHIFT)) & PKC_PKC_CTRL_STOP_MASK) - -#define PKC_PKC_CTRL_GOD1_MASK (0x4U) -#define PKC_PKC_CTRL_GOD1_SHIFT (2U) -/*! GOD1 - Control bit to start direct operation using parameter set 1 */ -#define PKC_PKC_CTRL_GOD1(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_GOD1_SHIFT)) & PKC_PKC_CTRL_GOD1_MASK) - -#define PKC_PKC_CTRL_GOD2_MASK (0x8U) -#define PKC_PKC_CTRL_GOD2_SHIFT (3U) -/*! GOD2 - Control bit to start direct operation using parameter set 2 */ -#define PKC_PKC_CTRL_GOD2(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_GOD2_SHIFT)) & PKC_PKC_CTRL_GOD2_MASK) - -#define PKC_PKC_CTRL_GOM1_MASK (0x10U) -#define PKC_PKC_CTRL_GOM1_SHIFT (4U) -/*! GOM1 - Control bit to start MC pattern using parameter set 1 */ -#define PKC_PKC_CTRL_GOM1(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_GOM1_SHIFT)) & PKC_PKC_CTRL_GOM1_MASK) - -#define PKC_PKC_CTRL_GOM2_MASK (0x20U) -#define PKC_PKC_CTRL_GOM2_SHIFT (5U) -/*! GOM2 - Control bit to start MC pattern using parameter set 2 */ -#define PKC_PKC_CTRL_GOM2(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_GOM2_SHIFT)) & PKC_PKC_CTRL_GOM2_MASK) - -#define PKC_PKC_CTRL_GOU_MASK (0x40U) -#define PKC_PKC_CTRL_GOU_SHIFT (6U) -/*! GOU - Control bit to start pipe operation */ -#define PKC_PKC_CTRL_GOU(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_GOU_SHIFT)) & PKC_PKC_CTRL_GOU_MASK) - -#define PKC_PKC_CTRL_GF2CONV_MASK (0x80U) -#define PKC_PKC_CTRL_GF2CONV_SHIFT (7U) -/*! GF2CONV - Convert to GF2 calculation modes */ -#define PKC_PKC_CTRL_GF2CONV(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_GF2CONV_SHIFT)) & PKC_PKC_CTRL_GF2CONV_MASK) - -#define PKC_PKC_CTRL_CLRCACHE_MASK (0x100U) -#define PKC_PKC_CTRL_CLRCACHE_SHIFT (8U) -/*! CLRCACHE - Clear universal pointer cache */ -#define PKC_PKC_CTRL_CLRCACHE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_CLRCACHE_SHIFT)) & PKC_PKC_CTRL_CLRCACHE_MASK) - -#define PKC_PKC_CTRL_CACHE_EN_MASK (0x200U) -#define PKC_PKC_CTRL_CACHE_EN_SHIFT (9U) -/*! CACHE_EN - Enable universal pointer cache */ -#define PKC_PKC_CTRL_CACHE_EN(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_CACHE_EN_SHIFT)) & PKC_PKC_CTRL_CACHE_EN_MASK) - -#define PKC_PKC_CTRL_REDMUL_MASK (0xC00U) -#define PKC_PKC_CTRL_REDMUL_SHIFT (10U) -/*! REDMUL - Reduced multiplier mode - * 0b00..full size mode, 3 least significant bits of pointer and length are ignored, minimum supported length 0x0008 - * 0b01..Reserved - Error Generated if selected - * 0b10..64-bit mode, 3 least significant bits of pointer and length are ignored, minimum supported length 0x0008 - * 0b11..Reserved - Error Generated if selected - */ -#define PKC_PKC_CTRL_REDMUL(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_REDMUL_SHIFT)) & PKC_PKC_CTRL_REDMUL_MASK) -/*! @} */ - -/*! @name PKC_CFG - Configuration register */ -/*! @{ */ - -#define PKC_PKC_CFG_IDLEOP_MASK (0x1U) -#define PKC_PKC_CFG_IDLEOP_SHIFT (0U) -#define PKC_PKC_CFG_IDLEOP(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CFG_IDLEOP_SHIFT)) & PKC_PKC_CFG_IDLEOP_MASK) - -#define PKC_PKC_CFG_RFU1_MASK (0x2U) -#define PKC_PKC_CFG_RFU1_SHIFT (1U) -#define PKC_PKC_CFG_RFU1(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CFG_RFU1_SHIFT)) & PKC_PKC_CFG_RFU1_MASK) - -#define PKC_PKC_CFG_RFU2_MASK (0x4U) -#define PKC_PKC_CFG_RFU2_SHIFT (2U) -#define PKC_PKC_CFG_RFU2(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CFG_RFU2_SHIFT)) & PKC_PKC_CFG_RFU2_MASK) - -#define PKC_PKC_CFG_CLKRND_MASK (0x8U) -#define PKC_PKC_CFG_CLKRND_SHIFT (3U) -#define PKC_PKC_CFG_CLKRND(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CFG_CLKRND_SHIFT)) & PKC_PKC_CFG_CLKRND_MASK) - -#define PKC_PKC_CFG_REDMULNOISE_MASK (0x10U) -#define PKC_PKC_CFG_REDMULNOISE_SHIFT (4U) -#define PKC_PKC_CFG_REDMULNOISE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CFG_REDMULNOISE_SHIFT)) & PKC_PKC_CFG_REDMULNOISE_MASK) - -#define PKC_PKC_CFG_RNDDLY_MASK (0xE0U) -#define PKC_PKC_CFG_RNDDLY_SHIFT (5U) -#define PKC_PKC_CFG_RNDDLY(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CFG_RNDDLY_SHIFT)) & PKC_PKC_CFG_RNDDLY_MASK) - -#define PKC_PKC_CFG_SBXNOISE_MASK (0x100U) -#define PKC_PKC_CFG_SBXNOISE_SHIFT (8U) -#define PKC_PKC_CFG_SBXNOISE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CFG_SBXNOISE_SHIFT)) & PKC_PKC_CFG_SBXNOISE_MASK) - -#define PKC_PKC_CFG_ALPNOISE_MASK (0x200U) -#define PKC_PKC_CFG_ALPNOISE_SHIFT (9U) -#define PKC_PKC_CFG_ALPNOISE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CFG_ALPNOISE_SHIFT)) & PKC_PKC_CFG_ALPNOISE_MASK) - -#define PKC_PKC_CFG_FMULNOISE_MASK (0x400U) -#define PKC_PKC_CFG_FMULNOISE_SHIFT (10U) -#define PKC_PKC_CFG_FMULNOISE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CFG_FMULNOISE_SHIFT)) & PKC_PKC_CFG_FMULNOISE_MASK) -/*! @} */ - -/*! @name PKC_MODE1 - Mode register, parameter set 1 */ -/*! @{ */ - -#define PKC_PKC_MODE1_MODE_MASK (0xFFU) -#define PKC_PKC_MODE1_MODE_SHIFT (0U) -/*! MODE - Calculation Mode / MC Start address */ -#define PKC_PKC_MODE1_MODE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_MODE1_MODE_SHIFT)) & PKC_PKC_MODE1_MODE_MASK) -/*! @} */ - -/*! @name PKC_XYPTR1 - X+Y pointer register, parameter set 1 */ -/*! @{ */ - -#define PKC_PKC_XYPTR1_XPTR_MASK (0xFFFFU) -#define PKC_PKC_XYPTR1_XPTR_SHIFT (0U) -/*! XPTR - Start address of X operand in PKCRAM with byte granularity */ -#define PKC_PKC_XYPTR1_XPTR(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_XYPTR1_XPTR_SHIFT)) & PKC_PKC_XYPTR1_XPTR_MASK) - -#define PKC_PKC_XYPTR1_YPTR_MASK (0xFFFF0000U) -#define PKC_PKC_XYPTR1_YPTR_SHIFT (16U) -/*! YPTR - Start address of Y operand in PKCRAM with byte granularity */ -#define PKC_PKC_XYPTR1_YPTR(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_XYPTR1_YPTR_SHIFT)) & PKC_PKC_XYPTR1_YPTR_MASK) -/*! @} */ - -/*! @name PKC_ZRPTR1 - Z+R pointer register, parameter set 1 */ -/*! @{ */ - -#define PKC_PKC_ZRPTR1_ZPTR_MASK (0xFFFFU) -#define PKC_PKC_ZRPTR1_ZPTR_SHIFT (0U) -/*! ZPTR - Start address of Z operand in PKCRAM with byte granularity or constant for calculation modes using CONST */ -#define PKC_PKC_ZRPTR1_ZPTR(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ZRPTR1_ZPTR_SHIFT)) & PKC_PKC_ZRPTR1_ZPTR_MASK) - -#define PKC_PKC_ZRPTR1_RPTR_MASK (0xFFFF0000U) -#define PKC_PKC_ZRPTR1_RPTR_SHIFT (16U) -/*! RPTR - Start address of R result in PKCRAM with byte granularity */ -#define PKC_PKC_ZRPTR1_RPTR(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ZRPTR1_RPTR_SHIFT)) & PKC_PKC_ZRPTR1_RPTR_MASK) -/*! @} */ - -/*! @name PKC_LEN1 - Length register, parameter set 1 */ -/*! @{ */ - -#define PKC_PKC_LEN1_LEN_MASK (0xFFFFU) -#define PKC_PKC_LEN1_LEN_SHIFT (0U) -/*! LEN - Operand length */ -#define PKC_PKC_LEN1_LEN(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_LEN1_LEN_SHIFT)) & PKC_PKC_LEN1_LEN_MASK) - -#define PKC_PKC_LEN1_MCLEN_MASK (0xFFFF0000U) -#define PKC_PKC_LEN1_MCLEN_SHIFT (16U) -/*! MCLEN - Loop counter for microcode pattern */ -#define PKC_PKC_LEN1_MCLEN(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_LEN1_MCLEN_SHIFT)) & PKC_PKC_LEN1_MCLEN_MASK) -/*! @} */ - -/*! @name PKC_MODE2 - Mode register, parameter set 2 */ -/*! @{ */ - -#define PKC_PKC_MODE2_MODE_MASK (0xFFU) -#define PKC_PKC_MODE2_MODE_SHIFT (0U) -/*! MODE - Calculation Mode / MC Start address */ -#define PKC_PKC_MODE2_MODE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_MODE2_MODE_SHIFT)) & PKC_PKC_MODE2_MODE_MASK) -/*! @} */ - -/*! @name PKC_XYPTR2 - X+Y pointer register, parameter set 2 */ -/*! @{ */ - -#define PKC_PKC_XYPTR2_XPTR_MASK (0xFFFFU) -#define PKC_PKC_XYPTR2_XPTR_SHIFT (0U) -/*! XPTR - Start address of X operand in PKCRAM with byte granularity */ -#define PKC_PKC_XYPTR2_XPTR(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_XYPTR2_XPTR_SHIFT)) & PKC_PKC_XYPTR2_XPTR_MASK) - -#define PKC_PKC_XYPTR2_YPTR_MASK (0xFFFF0000U) -#define PKC_PKC_XYPTR2_YPTR_SHIFT (16U) -/*! YPTR - Start address of Y operand in PKCRAM with byte granularity */ -#define PKC_PKC_XYPTR2_YPTR(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_XYPTR2_YPTR_SHIFT)) & PKC_PKC_XYPTR2_YPTR_MASK) -/*! @} */ - -/*! @name PKC_ZRPTR2 - Z+R pointer register, parameter set 2 */ -/*! @{ */ - -#define PKC_PKC_ZRPTR2_ZPT_MASK (0xFFFFU) -#define PKC_PKC_ZRPTR2_ZPT_SHIFT (0U) -/*! ZPT - Start address of Z operand in PKCRAM with byte granularity or constant for calculation modes using CONST */ -#define PKC_PKC_ZRPTR2_ZPT(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ZRPTR2_ZPT_SHIFT)) & PKC_PKC_ZRPTR2_ZPT_MASK) - -#define PKC_PKC_ZRPTR2_RPTR_MASK (0xFFFF0000U) -#define PKC_PKC_ZRPTR2_RPTR_SHIFT (16U) -/*! RPTR - Start address of R result in PKCRAM with byte granularity */ -#define PKC_PKC_ZRPTR2_RPTR(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ZRPTR2_RPTR_SHIFT)) & PKC_PKC_ZRPTR2_RPTR_MASK) -/*! @} */ - -/*! @name PKC_LEN2 - Length register, parameter set 2 */ -/*! @{ */ - -#define PKC_PKC_LEN2_LEN_MASK (0xFFFFU) -#define PKC_PKC_LEN2_LEN_SHIFT (0U) -/*! LEN - Operand length */ -#define PKC_PKC_LEN2_LEN(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_LEN2_LEN_SHIFT)) & PKC_PKC_LEN2_LEN_MASK) - -#define PKC_PKC_LEN2_MCLEN_MASK (0xFFFF0000U) -#define PKC_PKC_LEN2_MCLEN_SHIFT (16U) -/*! MCLEN - Loop counter for microcode pattern */ -#define PKC_PKC_LEN2_MCLEN(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_LEN2_MCLEN_SHIFT)) & PKC_PKC_LEN2_MCLEN_MASK) -/*! @} */ - -/*! @name PKC_UPTR - Universal pointer FUP program */ -/*! @{ */ - -#define PKC_PKC_UPTR_PTR_MASK (0xFFFFFFFFU) -#define PKC_PKC_UPTR_PTR_SHIFT (0U) -/*! PTR - Pointer to start address of PKC FUP program */ -#define PKC_PKC_UPTR_PTR(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_UPTR_PTR_SHIFT)) & PKC_PKC_UPTR_PTR_MASK) -/*! @} */ - -/*! @name PKC_UPTRT - Universal pointer FUP table */ -/*! @{ */ - -#define PKC_PKC_UPTRT_PTR_MASK (0xFFFFFFFFU) -#define PKC_PKC_UPTRT_PTR_SHIFT (0U) -/*! PTR - Pointer to start address of PKC FUP table */ -#define PKC_PKC_UPTRT_PTR(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_UPTRT_PTR_SHIFT)) & PKC_PKC_UPTRT_PTR_MASK) -/*! @} */ - -/*! @name PKC_ULEN - Universal pointer length */ -/*! @{ */ - -#define PKC_PKC_ULEN_LEN_MASK (0xFFU) -#define PKC_PKC_ULEN_LEN_SHIFT (0U) -/*! LEN - Length of universal pointer calculation */ -#define PKC_PKC_ULEN_LEN(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ULEN_LEN_SHIFT)) & PKC_PKC_ULEN_LEN_MASK) -/*! @} */ - -/*! @name PKC_MCDATA - MC pattern data interface */ -/*! @{ */ - -#define PKC_PKC_MCDATA_MCDATA_MASK (0xFFFFFFFFU) -#define PKC_PKC_MCDATA_MCDATA_SHIFT (0U) -/*! MCDATA - Microcode read/write data */ -#define PKC_PKC_MCDATA_MCDATA(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_MCDATA_MCDATA_SHIFT)) & PKC_PKC_MCDATA_MCDATA_MASK) -/*! @} */ - -/*! @name PKC_VERSION - PKC version register */ -/*! @{ */ - -#define PKC_PKC_VERSION_MULSIZE_MASK (0x3U) -#define PKC_PKC_VERSION_MULSIZE_SHIFT (0U) -/*! MULSIZE - * 0b01..32-bit multiplier - * 0b10..64-bit multiplier - * 0b11..128-bit multiplier - * 0b10..128-bit multiplier - * 0b01..64-bit multiplier - */ -#define PKC_PKC_VERSION_MULSIZE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_MULSIZE_SHIFT)) & PKC_PKC_VERSION_MULSIZE_MASK) - -#define PKC_PKC_VERSION_MCAVAIL_MASK (0x4U) -#define PKC_PKC_VERSION_MCAVAIL_SHIFT (2U) -#define PKC_PKC_VERSION_MCAVAIL(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_MCAVAIL_SHIFT)) & PKC_PKC_VERSION_MCAVAIL_MASK) - -#define PKC_PKC_VERSION_UPAVAIL_MASK (0x8U) -#define PKC_PKC_VERSION_UPAVAIL_SHIFT (3U) -#define PKC_PKC_VERSION_UPAVAIL(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_UPAVAIL_SHIFT)) & PKC_PKC_VERSION_UPAVAIL_MASK) - -#define PKC_PKC_VERSION_UPCACHEAVAIL_MASK (0x10U) -#define PKC_PKC_VERSION_UPCACHEAVAIL_SHIFT (4U) -#define PKC_PKC_VERSION_UPCACHEAVAIL(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_UPCACHEAVAIL_SHIFT)) & PKC_PKC_VERSION_UPCACHEAVAIL_MASK) - -#define PKC_PKC_VERSION_GF2AVAIL_MASK (0x20U) -#define PKC_PKC_VERSION_GF2AVAIL_SHIFT (5U) -#define PKC_PKC_VERSION_GF2AVAIL(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_GF2AVAIL_SHIFT)) & PKC_PKC_VERSION_GF2AVAIL_MASK) - -#define PKC_PKC_VERSION_PARAMNUM_MASK (0xC0U) -#define PKC_PKC_VERSION_PARAMNUM_SHIFT (6U) -#define PKC_PKC_VERSION_PARAMNUM(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_PARAMNUM_SHIFT)) & PKC_PKC_VERSION_PARAMNUM_MASK) - -#define PKC_PKC_VERSION_SBX0AVAIL_MASK (0x100U) -#define PKC_PKC_VERSION_SBX0AVAIL_SHIFT (8U) -#define PKC_PKC_VERSION_SBX0AVAIL(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_SBX0AVAIL_SHIFT)) & PKC_PKC_VERSION_SBX0AVAIL_MASK) - -#define PKC_PKC_VERSION_SBX1AVAIL_MASK (0x200U) -#define PKC_PKC_VERSION_SBX1AVAIL_SHIFT (9U) -#define PKC_PKC_VERSION_SBX1AVAIL(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_SBX1AVAIL_SHIFT)) & PKC_PKC_VERSION_SBX1AVAIL_MASK) - -#define PKC_PKC_VERSION_SBX2AVAIL_MASK (0x400U) -#define PKC_PKC_VERSION_SBX2AVAIL_SHIFT (10U) -#define PKC_PKC_VERSION_SBX2AVAIL(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_SBX2AVAIL_SHIFT)) & PKC_PKC_VERSION_SBX2AVAIL_MASK) - -#define PKC_PKC_VERSION_SBX3AVAIL_MASK (0x800U) -#define PKC_PKC_VERSION_SBX3AVAIL_SHIFT (11U) -#define PKC_PKC_VERSION_SBX3AVAIL(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_SBX3AVAIL_SHIFT)) & PKC_PKC_VERSION_SBX3AVAIL_MASK) - -#define PKC_PKC_VERSION_MCRECONF_SIZE_MASK (0xFF000U) -#define PKC_PKC_VERSION_MCRECONF_SIZE_SHIFT (12U) -#define PKC_PKC_VERSION_MCRECONF_SIZE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_MCRECONF_SIZE_SHIFT)) & PKC_PKC_VERSION_MCRECONF_SIZE_MASK) -/*! @} */ - -/*! @name PKC_SOFT_RST - Software reset */ -/*! @{ */ - -#define PKC_PKC_SOFT_RST_SOFT_RST_MASK (0x1U) -#define PKC_PKC_SOFT_RST_SOFT_RST_SHIFT (0U) -#define PKC_PKC_SOFT_RST_SOFT_RST(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_SOFT_RST_SOFT_RST_SHIFT)) & PKC_PKC_SOFT_RST_SOFT_RST_MASK) -/*! @} */ - -/*! @name PKC_ACCESS_ERR - Access Error */ -/*! @{ */ - -#define PKC_PKC_ACCESS_ERR_APB_NOTAV_MASK (0x1U) -#define PKC_PKC_ACCESS_ERR_APB_NOTAV_SHIFT (0U) -/*! APB_NOTAV - APB Error */ -#define PKC_PKC_ACCESS_ERR_APB_NOTAV(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ACCESS_ERR_APB_NOTAV_SHIFT)) & PKC_PKC_ACCESS_ERR_APB_NOTAV_MASK) - -#define PKC_PKC_ACCESS_ERR_APB_WRGMD_MASK (0x2U) -#define PKC_PKC_ACCESS_ERR_APB_WRGMD_SHIFT (1U) -/*! APB_WRGMD - APB Error */ -#define PKC_PKC_ACCESS_ERR_APB_WRGMD(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ACCESS_ERR_APB_WRGMD_SHIFT)) & PKC_PKC_ACCESS_ERR_APB_WRGMD_MASK) - -#define PKC_PKC_ACCESS_ERR_APB_MASTER_MASK (0xF0U) -#define PKC_PKC_ACCESS_ERR_APB_MASTER_SHIFT (4U) -#define PKC_PKC_ACCESS_ERR_APB_MASTER(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ACCESS_ERR_APB_MASTER_SHIFT)) & PKC_PKC_ACCESS_ERR_APB_MASTER_MASK) - -#define PKC_PKC_ACCESS_ERR_AHB_MASK (0x400U) -#define PKC_PKC_ACCESS_ERR_AHB_SHIFT (10U) -/*! AHB - AHB Error */ -#define PKC_PKC_ACCESS_ERR_AHB(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ACCESS_ERR_AHB_SHIFT)) & PKC_PKC_ACCESS_ERR_AHB_MASK) - -#define PKC_PKC_ACCESS_ERR_PKCC_MASK (0x10000U) -#define PKC_PKC_ACCESS_ERR_PKCC_SHIFT (16U) -#define PKC_PKC_ACCESS_ERR_PKCC(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ACCESS_ERR_PKCC_SHIFT)) & PKC_PKC_ACCESS_ERR_PKCC_MASK) - -#define PKC_PKC_ACCESS_ERR_FDET_MASK (0x20000U) -#define PKC_PKC_ACCESS_ERR_FDET_SHIFT (17U) -#define PKC_PKC_ACCESS_ERR_FDET(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ACCESS_ERR_FDET_SHIFT)) & PKC_PKC_ACCESS_ERR_FDET_MASK) - -#define PKC_PKC_ACCESS_ERR_CTRL_MASK (0x40000U) -#define PKC_PKC_ACCESS_ERR_CTRL_SHIFT (18U) -#define PKC_PKC_ACCESS_ERR_CTRL(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ACCESS_ERR_CTRL_SHIFT)) & PKC_PKC_ACCESS_ERR_CTRL_MASK) - -#define PKC_PKC_ACCESS_ERR_UCRC_MASK (0x80000U) -#define PKC_PKC_ACCESS_ERR_UCRC_SHIFT (19U) -#define PKC_PKC_ACCESS_ERR_UCRC(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ACCESS_ERR_UCRC_SHIFT)) & PKC_PKC_ACCESS_ERR_UCRC_MASK) -/*! @} */ - -/*! @name PKC_ACCESS_ERR_CLR - Clear Access Error */ -/*! @{ */ - -#define PKC_PKC_ACCESS_ERR_CLR_ERR_CLR_MASK (0x1U) -#define PKC_PKC_ACCESS_ERR_CLR_ERR_CLR_SHIFT (0U) -#define PKC_PKC_ACCESS_ERR_CLR_ERR_CLR(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ACCESS_ERR_CLR_ERR_CLR_SHIFT)) & PKC_PKC_ACCESS_ERR_CLR_ERR_CLR_MASK) -/*! @} */ - -/*! @name PKC_INT_CLR_ENABLE - Interrupt enable clear */ -/*! @{ */ - -#define PKC_PKC_INT_CLR_ENABLE_EN_PDONE_MASK (0x1U) -#define PKC_PKC_INT_CLR_ENABLE_EN_PDONE_SHIFT (0U) -#define PKC_PKC_INT_CLR_ENABLE_EN_PDONE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_INT_CLR_ENABLE_EN_PDONE_SHIFT)) & PKC_PKC_INT_CLR_ENABLE_EN_PDONE_MASK) -/*! @} */ - -/*! @name PKC_INT_SET_ENABLE - Interrupt enable set */ -/*! @{ */ - -#define PKC_PKC_INT_SET_ENABLE_EN_PDONE_MASK (0x1U) -#define PKC_PKC_INT_SET_ENABLE_EN_PDONE_SHIFT (0U) -#define PKC_PKC_INT_SET_ENABLE_EN_PDONE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_INT_SET_ENABLE_EN_PDONE_SHIFT)) & PKC_PKC_INT_SET_ENABLE_EN_PDONE_MASK) -/*! @} */ - -/*! @name PKC_INT_STATUS - Interrupt status */ -/*! @{ */ - -#define PKC_PKC_INT_STATUS_INT_PDONE_MASK (0x1U) -#define PKC_PKC_INT_STATUS_INT_PDONE_SHIFT (0U) -/*! INT_PDONE - End-of-computation status flag */ -#define PKC_PKC_INT_STATUS_INT_PDONE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_INT_STATUS_INT_PDONE_SHIFT)) & PKC_PKC_INT_STATUS_INT_PDONE_MASK) -/*! @} */ - -/*! @name PKC_INT_ENABLE - Interrupt enable */ -/*! @{ */ - -#define PKC_PKC_INT_ENABLE_EN_PDONE_MASK (0x1U) -#define PKC_PKC_INT_ENABLE_EN_PDONE_SHIFT (0U) -/*! EN_PDONE - PDONE interrupt enable flag */ -#define PKC_PKC_INT_ENABLE_EN_PDONE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_INT_ENABLE_EN_PDONE_SHIFT)) & PKC_PKC_INT_ENABLE_EN_PDONE_MASK) -/*! @} */ - -/*! @name PKC_INT_CLR_STATUS - Interrupt status clear */ -/*! @{ */ - -#define PKC_PKC_INT_CLR_STATUS_INT_PDONE_MASK (0x1U) -#define PKC_PKC_INT_CLR_STATUS_INT_PDONE_SHIFT (0U) -#define PKC_PKC_INT_CLR_STATUS_INT_PDONE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_INT_CLR_STATUS_INT_PDONE_SHIFT)) & PKC_PKC_INT_CLR_STATUS_INT_PDONE_MASK) -/*! @} */ - -/*! @name PKC_INT_SET_STATUS - Interrupt status set */ -/*! @{ */ - -#define PKC_PKC_INT_SET_STATUS_INT_PDONE_MASK (0x1U) -#define PKC_PKC_INT_SET_STATUS_INT_PDONE_SHIFT (0U) -#define PKC_PKC_INT_SET_STATUS_INT_PDONE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_INT_SET_STATUS_INT_PDONE_SHIFT)) & PKC_PKC_INT_SET_STATUS_INT_PDONE_MASK) -/*! @} */ - -/*! @name PKC_MODULE_ID - Module ID */ -/*! @{ */ - -#define PKC_PKC_MODULE_ID_SIZE_MASK (0xFFU) -#define PKC_PKC_MODULE_ID_SIZE_SHIFT (0U) -#define PKC_PKC_MODULE_ID_SIZE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_MODULE_ID_SIZE_SHIFT)) & PKC_PKC_MODULE_ID_SIZE_MASK) - -#define PKC_PKC_MODULE_ID_MINOR_REV_MASK (0xF00U) -#define PKC_PKC_MODULE_ID_MINOR_REV_SHIFT (8U) -#define PKC_PKC_MODULE_ID_MINOR_REV(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_MODULE_ID_MINOR_REV_SHIFT)) & PKC_PKC_MODULE_ID_MINOR_REV_MASK) - -#define PKC_PKC_MODULE_ID_MAJOR_REV_MASK (0xF000U) -#define PKC_PKC_MODULE_ID_MAJOR_REV_SHIFT (12U) -#define PKC_PKC_MODULE_ID_MAJOR_REV(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_MODULE_ID_MAJOR_REV_SHIFT)) & PKC_PKC_MODULE_ID_MAJOR_REV_MASK) - -#define PKC_PKC_MODULE_ID_ID_MASK (0xFFFF0000U) -#define PKC_PKC_MODULE_ID_ID_SHIFT (16U) -#define PKC_PKC_MODULE_ID_ID(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_MODULE_ID_ID_SHIFT)) & PKC_PKC_MODULE_ID_ID_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group PKC_Register_Masks */ - - -/* PKC - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral PKC0 base address */ - #define PKC0_BASE (0x5002B000u) - /** Peripheral PKC0 base address */ - #define PKC0_BASE_NS (0x4002B000u) - /** Peripheral PKC0 base pointer */ - #define PKC0 ((PKC_Type *)PKC0_BASE) - /** Peripheral PKC0 base pointer */ - #define PKC0_NS ((PKC_Type *)PKC0_BASE_NS) - /** Array initializer of PKC peripheral base addresses */ - #define PKC_BASE_ADDRS { PKC0_BASE } - /** Array initializer of PKC peripheral base pointers */ - #define PKC_BASE_PTRS { PKC0 } - /** Array initializer of PKC peripheral base addresses */ - #define PKC_BASE_ADDRS_NS { PKC0_BASE_NS } - /** Array initializer of PKC peripheral base pointers */ - #define PKC_BASE_PTRS_NS { PKC0_NS } -#else - /** Peripheral PKC0 base address */ - #define PKC0_BASE (0x4002B000u) - /** Peripheral PKC0 base pointer */ - #define PKC0 ((PKC_Type *)PKC0_BASE) - /** Array initializer of PKC peripheral base addresses */ - #define PKC_BASE_ADDRS { PKC0_BASE } - /** Array initializer of PKC peripheral base pointers */ - #define PKC_BASE_PTRS { PKC0 } -#endif - -/*! - * @} - */ /* end of group PKC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- PORT Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PORT_Peripheral_Access_Layer PORT Peripheral Access Layer - * @{ - */ - -/** PORT - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - uint8_t RESERVED_0[12]; - __O uint32_t GPCLR; /**< Global Pin Control Low, offset: 0x10 */ - __O uint32_t GPCHR; /**< Global Pin Control High, offset: 0x14 */ - uint8_t RESERVED_1[8]; - __IO uint32_t CONFIG; /**< Configuration, offset: 0x20 */ - uint8_t RESERVED_2[28]; - __I uint32_t EDFR; /**< EFT Detect Flag, offset: 0x40 */ - __IO uint32_t EDIER; /**< EFT Detect Interrupt Enable, offset: 0x44 */ - __IO uint32_t EDCR; /**< EFT Detect Clear, offset: 0x48 */ - uint8_t RESERVED_3[20]; - __IO uint32_t CALIB0; /**< Calibration 0, offset: 0x60, available only on: PORT0, PORT1, PORT2, PORT3 (missing on PORT4, PORT5) */ - __IO uint32_t CALIB1; /**< Calibration 1, offset: 0x64, available only on: PORT0, PORT1, PORT2, PORT3 (missing on PORT4, PORT5) */ - uint8_t RESERVED_4[24]; - __IO uint32_t PCR[32]; /**< Pin Control 0..Pin Control 31, array offset: 0x80, array step: 0x4, irregular array, not all indices are valid */ -} PORT_Type; - -/* ---------------------------------------------------------------------------- - -- PORT Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PORT_Register_Masks PORT Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define PORT_VERID_FEATURE_MASK (0xFFFFU) -#define PORT_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Basic implementation - */ -#define PORT_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << PORT_VERID_FEATURE_SHIFT)) & PORT_VERID_FEATURE_MASK) - -#define PORT_VERID_MINOR_MASK (0xFF0000U) -#define PORT_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define PORT_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << PORT_VERID_MINOR_SHIFT)) & PORT_VERID_MINOR_MASK) - -#define PORT_VERID_MAJOR_MASK (0xFF000000U) -#define PORT_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define PORT_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << PORT_VERID_MAJOR_SHIFT)) & PORT_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name GPCLR - Global Pin Control Low */ -/*! @{ */ - -#define PORT_GPCLR_GPWD_MASK (0xFFFFU) -#define PORT_GPCLR_GPWD_SHIFT (0U) -/*! GPWD - Global Pin Write Data */ -#define PORT_GPCLR_GPWD(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWD_SHIFT)) & PORT_GPCLR_GPWD_MASK) - -#define PORT_GPCLR_GPWE0_MASK (0x10000U) -#define PORT_GPCLR_GPWE0_SHIFT (16U) -/*! GPWE0 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE0(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE0_SHIFT)) & PORT_GPCLR_GPWE0_MASK) - -#define PORT_GPCLR_GPWE1_MASK (0x20000U) -#define PORT_GPCLR_GPWE1_SHIFT (17U) -/*! GPWE1 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE1(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE1_SHIFT)) & PORT_GPCLR_GPWE1_MASK) - -#define PORT_GPCLR_GPWE2_MASK (0x40000U) -#define PORT_GPCLR_GPWE2_SHIFT (18U) -/*! GPWE2 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE2(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE2_SHIFT)) & PORT_GPCLR_GPWE2_MASK) - -#define PORT_GPCLR_GPWE3_MASK (0x80000U) -#define PORT_GPCLR_GPWE3_SHIFT (19U) -/*! GPWE3 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE3(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE3_SHIFT)) & PORT_GPCLR_GPWE3_MASK) - -#define PORT_GPCLR_GPWE4_MASK (0x100000U) -#define PORT_GPCLR_GPWE4_SHIFT (20U) -/*! GPWE4 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE4(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE4_SHIFT)) & PORT_GPCLR_GPWE4_MASK) - -#define PORT_GPCLR_GPWE5_MASK (0x200000U) -#define PORT_GPCLR_GPWE5_SHIFT (21U) -/*! GPWE5 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE5(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE5_SHIFT)) & PORT_GPCLR_GPWE5_MASK) - -#define PORT_GPCLR_GPWE6_MASK (0x400000U) -#define PORT_GPCLR_GPWE6_SHIFT (22U) -/*! GPWE6 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE6(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE6_SHIFT)) & PORT_GPCLR_GPWE6_MASK) - -#define PORT_GPCLR_GPWE7_MASK (0x800000U) -#define PORT_GPCLR_GPWE7_SHIFT (23U) -/*! GPWE7 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE7(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE7_SHIFT)) & PORT_GPCLR_GPWE7_MASK) - -#define PORT_GPCLR_GPWE8_MASK (0x1000000U) -#define PORT_GPCLR_GPWE8_SHIFT (24U) -/*! GPWE8 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE8(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE8_SHIFT)) & PORT_GPCLR_GPWE8_MASK) - -#define PORT_GPCLR_GPWE9_MASK (0x2000000U) -#define PORT_GPCLR_GPWE9_SHIFT (25U) -/*! GPWE9 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE9(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE9_SHIFT)) & PORT_GPCLR_GPWE9_MASK) - -#define PORT_GPCLR_GPWE10_MASK (0x4000000U) -#define PORT_GPCLR_GPWE10_SHIFT (26U) -/*! GPWE10 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE10(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE10_SHIFT)) & PORT_GPCLR_GPWE10_MASK) - -#define PORT_GPCLR_GPWE11_MASK (0x8000000U) -#define PORT_GPCLR_GPWE11_SHIFT (27U) -/*! GPWE11 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE11(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE11_SHIFT)) & PORT_GPCLR_GPWE11_MASK) - -#define PORT_GPCLR_GPWE12_MASK (0x10000000U) -#define PORT_GPCLR_GPWE12_SHIFT (28U) -/*! GPWE12 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE12(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE12_SHIFT)) & PORT_GPCLR_GPWE12_MASK) - -#define PORT_GPCLR_GPWE13_MASK (0x20000000U) -#define PORT_GPCLR_GPWE13_SHIFT (29U) -/*! GPWE13 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE13(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE13_SHIFT)) & PORT_GPCLR_GPWE13_MASK) - -#define PORT_GPCLR_GPWE14_MASK (0x40000000U) -#define PORT_GPCLR_GPWE14_SHIFT (30U) -/*! GPWE14 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE14(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE14_SHIFT)) & PORT_GPCLR_GPWE14_MASK) - -#define PORT_GPCLR_GPWE15_MASK (0x80000000U) -#define PORT_GPCLR_GPWE15_SHIFT (31U) -/*! GPWE15 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE15(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE15_SHIFT)) & PORT_GPCLR_GPWE15_MASK) -/*! @} */ - -/*! @name GPCHR - Global Pin Control High */ -/*! @{ */ - -#define PORT_GPCHR_GPWD_MASK (0xFFFFU) -#define PORT_GPCHR_GPWD_SHIFT (0U) -/*! GPWD - Global Pin Write Data */ -#define PORT_GPCHR_GPWD(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWD_SHIFT)) & PORT_GPCHR_GPWD_MASK) - -#define PORT_GPCHR_GPWE16_MASK (0x10000U) -#define PORT_GPCHR_GPWE16_SHIFT (16U) -/*! GPWE16 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE16(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE16_SHIFT)) & PORT_GPCHR_GPWE16_MASK) - -#define PORT_GPCHR_GPWE17_MASK (0x20000U) -#define PORT_GPCHR_GPWE17_SHIFT (17U) -/*! GPWE17 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE17(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE17_SHIFT)) & PORT_GPCHR_GPWE17_MASK) - -#define PORT_GPCHR_GPWE18_MASK (0x40000U) -#define PORT_GPCHR_GPWE18_SHIFT (18U) -/*! GPWE18 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE18(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE18_SHIFT)) & PORT_GPCHR_GPWE18_MASK) - -#define PORT_GPCHR_GPWE19_MASK (0x80000U) -#define PORT_GPCHR_GPWE19_SHIFT (19U) -/*! GPWE19 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE19(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE19_SHIFT)) & PORT_GPCHR_GPWE19_MASK) - -#define PORT_GPCHR_GPWE20_MASK (0x100000U) -#define PORT_GPCHR_GPWE20_SHIFT (20U) -/*! GPWE20 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE20(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE20_SHIFT)) & PORT_GPCHR_GPWE20_MASK) - -#define PORT_GPCHR_GPWE21_MASK (0x200000U) -#define PORT_GPCHR_GPWE21_SHIFT (21U) -/*! GPWE21 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE21(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE21_SHIFT)) & PORT_GPCHR_GPWE21_MASK) - -#define PORT_GPCHR_GPWE22_MASK (0x400000U) -#define PORT_GPCHR_GPWE22_SHIFT (22U) -/*! GPWE22 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE22(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE22_SHIFT)) & PORT_GPCHR_GPWE22_MASK) - -#define PORT_GPCHR_GPWE23_MASK (0x800000U) -#define PORT_GPCHR_GPWE23_SHIFT (23U) -/*! GPWE23 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE23(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE23_SHIFT)) & PORT_GPCHR_GPWE23_MASK) - -#define PORT_GPCHR_GPWE24_MASK (0x1000000U) -#define PORT_GPCHR_GPWE24_SHIFT (24U) -/*! GPWE24 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE24(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE24_SHIFT)) & PORT_GPCHR_GPWE24_MASK) - -#define PORT_GPCHR_GPWE25_MASK (0x2000000U) -#define PORT_GPCHR_GPWE25_SHIFT (25U) -/*! GPWE25 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE25(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE25_SHIFT)) & PORT_GPCHR_GPWE25_MASK) - -#define PORT_GPCHR_GPWE26_MASK (0x4000000U) -#define PORT_GPCHR_GPWE26_SHIFT (26U) -/*! GPWE26 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE26(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE26_SHIFT)) & PORT_GPCHR_GPWE26_MASK) - -#define PORT_GPCHR_GPWE27_MASK (0x8000000U) -#define PORT_GPCHR_GPWE27_SHIFT (27U) -/*! GPWE27 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE27(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE27_SHIFT)) & PORT_GPCHR_GPWE27_MASK) - -#define PORT_GPCHR_GPWE28_MASK (0x10000000U) -#define PORT_GPCHR_GPWE28_SHIFT (28U) -/*! GPWE28 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE28(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE28_SHIFT)) & PORT_GPCHR_GPWE28_MASK) - -#define PORT_GPCHR_GPWE29_MASK (0x20000000U) -#define PORT_GPCHR_GPWE29_SHIFT (29U) -/*! GPWE29 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE29(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE29_SHIFT)) & PORT_GPCHR_GPWE29_MASK) - -#define PORT_GPCHR_GPWE30_MASK (0x40000000U) -#define PORT_GPCHR_GPWE30_SHIFT (30U) -/*! GPWE30 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE30(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE30_SHIFT)) & PORT_GPCHR_GPWE30_MASK) - -#define PORT_GPCHR_GPWE31_MASK (0x80000000U) -#define PORT_GPCHR_GPWE31_SHIFT (31U) -/*! GPWE31 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE31(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE31_SHIFT)) & PORT_GPCHR_GPWE31_MASK) -/*! @} */ - -/*! @name CONFIG - Configuration */ -/*! @{ */ - -#define PORT_CONFIG_RANGE_MASK (0x1U) -#define PORT_CONFIG_RANGE_SHIFT (0U) -/*! RANGE - Port Voltage Range - * 0b0..1.71 V-3.6 V - * 0b1..2.70 V-3.6 V - */ -#define PORT_CONFIG_RANGE(x) (((uint32_t)(((uint32_t)(x)) << PORT_CONFIG_RANGE_SHIFT)) & PORT_CONFIG_RANGE_MASK) -/*! @} */ - -/*! @name EDFR - EFT Detect Flag */ -/*! @{ */ - -#define PORT_EDFR_EDF0_MASK (0x1U) -#define PORT_EDFR_EDF0_SHIFT (0U) -/*! EDF0 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF0(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF0_SHIFT)) & PORT_EDFR_EDF0_MASK) - -#define PORT_EDFR_EDF1_MASK (0x2U) -#define PORT_EDFR_EDF1_SHIFT (1U) -/*! EDF1 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF1(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF1_SHIFT)) & PORT_EDFR_EDF1_MASK) - -#define PORT_EDFR_EDF2_MASK (0x4U) -#define PORT_EDFR_EDF2_SHIFT (2U) -/*! EDF2 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF2(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF2_SHIFT)) & PORT_EDFR_EDF2_MASK) - -#define PORT_EDFR_EDF3_MASK (0x8U) -#define PORT_EDFR_EDF3_SHIFT (3U) -/*! EDF3 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF3(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF3_SHIFT)) & PORT_EDFR_EDF3_MASK) - -#define PORT_EDFR_EDF4_MASK (0x10U) -#define PORT_EDFR_EDF4_SHIFT (4U) -/*! EDF4 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF4(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF4_SHIFT)) & PORT_EDFR_EDF4_MASK) - -#define PORT_EDFR_EDF5_MASK (0x20U) -#define PORT_EDFR_EDF5_SHIFT (5U) -/*! EDF5 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF5(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF5_SHIFT)) & PORT_EDFR_EDF5_MASK) - -#define PORT_EDFR_EDF6_MASK (0x40U) -#define PORT_EDFR_EDF6_SHIFT (6U) -/*! EDF6 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF6(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF6_SHIFT)) & PORT_EDFR_EDF6_MASK) - -#define PORT_EDFR_EDF7_MASK (0x80U) -#define PORT_EDFR_EDF7_SHIFT (7U) -/*! EDF7 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF7(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF7_SHIFT)) & PORT_EDFR_EDF7_MASK) - -#define PORT_EDFR_EDF8_MASK (0x100U) -#define PORT_EDFR_EDF8_SHIFT (8U) -/*! EDF8 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF8(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF8_SHIFT)) & PORT_EDFR_EDF8_MASK) - -#define PORT_EDFR_EDF9_MASK (0x200U) -#define PORT_EDFR_EDF9_SHIFT (9U) -/*! EDF9 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF9(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF9_SHIFT)) & PORT_EDFR_EDF9_MASK) - -#define PORT_EDFR_EDF10_MASK (0x400U) -#define PORT_EDFR_EDF10_SHIFT (10U) -/*! EDF10 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF10(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF10_SHIFT)) & PORT_EDFR_EDF10_MASK) - -#define PORT_EDFR_EDF11_MASK (0x800U) -#define PORT_EDFR_EDF11_SHIFT (11U) -/*! EDF11 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF11(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF11_SHIFT)) & PORT_EDFR_EDF11_MASK) - -#define PORT_EDFR_EDF12_MASK (0x1000U) -#define PORT_EDFR_EDF12_SHIFT (12U) -/*! EDF12 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF12(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF12_SHIFT)) & PORT_EDFR_EDF12_MASK) - -#define PORT_EDFR_EDF13_MASK (0x2000U) -#define PORT_EDFR_EDF13_SHIFT (13U) -/*! EDF13 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF13(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF13_SHIFT)) & PORT_EDFR_EDF13_MASK) - -#define PORT_EDFR_EDF14_MASK (0x4000U) -#define PORT_EDFR_EDF14_SHIFT (14U) -/*! EDF14 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF14(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF14_SHIFT)) & PORT_EDFR_EDF14_MASK) - -#define PORT_EDFR_EDF15_MASK (0x8000U) -#define PORT_EDFR_EDF15_SHIFT (15U) -/*! EDF15 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF15(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF15_SHIFT)) & PORT_EDFR_EDF15_MASK) - -#define PORT_EDFR_EDF16_MASK (0x10000U) -#define PORT_EDFR_EDF16_SHIFT (16U) -/*! EDF16 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF16(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF16_SHIFT)) & PORT_EDFR_EDF16_MASK) - -#define PORT_EDFR_EDF17_MASK (0x20000U) -#define PORT_EDFR_EDF17_SHIFT (17U) -/*! EDF17 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF17(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF17_SHIFT)) & PORT_EDFR_EDF17_MASK) - -#define PORT_EDFR_EDF18_MASK (0x40000U) -#define PORT_EDFR_EDF18_SHIFT (18U) -/*! EDF18 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF18(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF18_SHIFT)) & PORT_EDFR_EDF18_MASK) - -#define PORT_EDFR_EDF19_MASK (0x80000U) -#define PORT_EDFR_EDF19_SHIFT (19U) -/*! EDF19 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF19(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF19_SHIFT)) & PORT_EDFR_EDF19_MASK) - -#define PORT_EDFR_EDF20_MASK (0x100000U) -#define PORT_EDFR_EDF20_SHIFT (20U) -/*! EDF20 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF20(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF20_SHIFT)) & PORT_EDFR_EDF20_MASK) - -#define PORT_EDFR_EDF21_MASK (0x200000U) -#define PORT_EDFR_EDF21_SHIFT (21U) -/*! EDF21 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF21(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF21_SHIFT)) & PORT_EDFR_EDF21_MASK) - -#define PORT_EDFR_EDF22_MASK (0x400000U) -#define PORT_EDFR_EDF22_SHIFT (22U) -/*! EDF22 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF22(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF22_SHIFT)) & PORT_EDFR_EDF22_MASK) - -#define PORT_EDFR_EDF23_MASK (0x800000U) -#define PORT_EDFR_EDF23_SHIFT (23U) -/*! EDF23 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF23(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF23_SHIFT)) & PORT_EDFR_EDF23_MASK) - -#define PORT_EDFR_EDF24_MASK (0x1000000U) -#define PORT_EDFR_EDF24_SHIFT (24U) -/*! EDF24 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF24(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF24_SHIFT)) & PORT_EDFR_EDF24_MASK) - -#define PORT_EDFR_EDF25_MASK (0x2000000U) -#define PORT_EDFR_EDF25_SHIFT (25U) -/*! EDF25 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF25(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF25_SHIFT)) & PORT_EDFR_EDF25_MASK) - -#define PORT_EDFR_EDF26_MASK (0x4000000U) -#define PORT_EDFR_EDF26_SHIFT (26U) -/*! EDF26 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF26(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF26_SHIFT)) & PORT_EDFR_EDF26_MASK) - -#define PORT_EDFR_EDF27_MASK (0x8000000U) -#define PORT_EDFR_EDF27_SHIFT (27U) -/*! EDF27 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF27(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF27_SHIFT)) & PORT_EDFR_EDF27_MASK) - -#define PORT_EDFR_EDF28_MASK (0x10000000U) -#define PORT_EDFR_EDF28_SHIFT (28U) -/*! EDF28 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF28(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF28_SHIFT)) & PORT_EDFR_EDF28_MASK) - -#define PORT_EDFR_EDF29_MASK (0x20000000U) -#define PORT_EDFR_EDF29_SHIFT (29U) -/*! EDF29 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF29(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF29_SHIFT)) & PORT_EDFR_EDF29_MASK) - -#define PORT_EDFR_EDF30_MASK (0x40000000U) -#define PORT_EDFR_EDF30_SHIFT (30U) -/*! EDF30 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF30(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF30_SHIFT)) & PORT_EDFR_EDF30_MASK) - -#define PORT_EDFR_EDF31_MASK (0x80000000U) -#define PORT_EDFR_EDF31_SHIFT (31U) -/*! EDF31 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF31(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF31_SHIFT)) & PORT_EDFR_EDF31_MASK) -/*! @} */ - -/*! @name EDIER - EFT Detect Interrupt Enable */ -/*! @{ */ - -#define PORT_EDIER_EDIE0_MASK (0x1U) -#define PORT_EDIER_EDIE0_SHIFT (0U) -/*! EDIE0 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE0(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE0_SHIFT)) & PORT_EDIER_EDIE0_MASK) - -#define PORT_EDIER_EDIE1_MASK (0x2U) -#define PORT_EDIER_EDIE1_SHIFT (1U) -/*! EDIE1 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE1(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE1_SHIFT)) & PORT_EDIER_EDIE1_MASK) - -#define PORT_EDIER_EDIE2_MASK (0x4U) -#define PORT_EDIER_EDIE2_SHIFT (2U) -/*! EDIE2 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE2(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE2_SHIFT)) & PORT_EDIER_EDIE2_MASK) - -#define PORT_EDIER_EDIE3_MASK (0x8U) -#define PORT_EDIER_EDIE3_SHIFT (3U) -/*! EDIE3 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE3(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE3_SHIFT)) & PORT_EDIER_EDIE3_MASK) - -#define PORT_EDIER_EDIE4_MASK (0x10U) -#define PORT_EDIER_EDIE4_SHIFT (4U) -/*! EDIE4 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE4(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE4_SHIFT)) & PORT_EDIER_EDIE4_MASK) - -#define PORT_EDIER_EDIE5_MASK (0x20U) -#define PORT_EDIER_EDIE5_SHIFT (5U) -/*! EDIE5 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE5(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE5_SHIFT)) & PORT_EDIER_EDIE5_MASK) - -#define PORT_EDIER_EDIE6_MASK (0x40U) -#define PORT_EDIER_EDIE6_SHIFT (6U) -/*! EDIE6 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE6(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE6_SHIFT)) & PORT_EDIER_EDIE6_MASK) - -#define PORT_EDIER_EDIE7_MASK (0x80U) -#define PORT_EDIER_EDIE7_SHIFT (7U) -/*! EDIE7 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE7(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE7_SHIFT)) & PORT_EDIER_EDIE7_MASK) - -#define PORT_EDIER_EDIE8_MASK (0x100U) -#define PORT_EDIER_EDIE8_SHIFT (8U) -/*! EDIE8 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE8(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE8_SHIFT)) & PORT_EDIER_EDIE8_MASK) - -#define PORT_EDIER_EDIE9_MASK (0x200U) -#define PORT_EDIER_EDIE9_SHIFT (9U) -/*! EDIE9 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE9(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE9_SHIFT)) & PORT_EDIER_EDIE9_MASK) - -#define PORT_EDIER_EDIE10_MASK (0x400U) -#define PORT_EDIER_EDIE10_SHIFT (10U) -/*! EDIE10 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE10(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE10_SHIFT)) & PORT_EDIER_EDIE10_MASK) - -#define PORT_EDIER_EDIE11_MASK (0x800U) -#define PORT_EDIER_EDIE11_SHIFT (11U) -/*! EDIE11 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE11(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE11_SHIFT)) & PORT_EDIER_EDIE11_MASK) - -#define PORT_EDIER_EDIE12_MASK (0x1000U) -#define PORT_EDIER_EDIE12_SHIFT (12U) -/*! EDIE12 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE12(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE12_SHIFT)) & PORT_EDIER_EDIE12_MASK) - -#define PORT_EDIER_EDIE13_MASK (0x2000U) -#define PORT_EDIER_EDIE13_SHIFT (13U) -/*! EDIE13 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE13(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE13_SHIFT)) & PORT_EDIER_EDIE13_MASK) - -#define PORT_EDIER_EDIE14_MASK (0x4000U) -#define PORT_EDIER_EDIE14_SHIFT (14U) -/*! EDIE14 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE14(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE14_SHIFT)) & PORT_EDIER_EDIE14_MASK) - -#define PORT_EDIER_EDIE15_MASK (0x8000U) -#define PORT_EDIER_EDIE15_SHIFT (15U) -/*! EDIE15 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE15(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE15_SHIFT)) & PORT_EDIER_EDIE15_MASK) - -#define PORT_EDIER_EDIE16_MASK (0x10000U) -#define PORT_EDIER_EDIE16_SHIFT (16U) -/*! EDIE16 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE16(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE16_SHIFT)) & PORT_EDIER_EDIE16_MASK) - -#define PORT_EDIER_EDIE17_MASK (0x20000U) -#define PORT_EDIER_EDIE17_SHIFT (17U) -/*! EDIE17 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE17(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE17_SHIFT)) & PORT_EDIER_EDIE17_MASK) - -#define PORT_EDIER_EDIE18_MASK (0x40000U) -#define PORT_EDIER_EDIE18_SHIFT (18U) -/*! EDIE18 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE18(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE18_SHIFT)) & PORT_EDIER_EDIE18_MASK) - -#define PORT_EDIER_EDIE19_MASK (0x80000U) -#define PORT_EDIER_EDIE19_SHIFT (19U) -/*! EDIE19 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE19(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE19_SHIFT)) & PORT_EDIER_EDIE19_MASK) - -#define PORT_EDIER_EDIE20_MASK (0x100000U) -#define PORT_EDIER_EDIE20_SHIFT (20U) -/*! EDIE20 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE20(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE20_SHIFT)) & PORT_EDIER_EDIE20_MASK) - -#define PORT_EDIER_EDIE21_MASK (0x200000U) -#define PORT_EDIER_EDIE21_SHIFT (21U) -/*! EDIE21 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE21(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE21_SHIFT)) & PORT_EDIER_EDIE21_MASK) - -#define PORT_EDIER_EDIE22_MASK (0x400000U) -#define PORT_EDIER_EDIE22_SHIFT (22U) -/*! EDIE22 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE22(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE22_SHIFT)) & PORT_EDIER_EDIE22_MASK) - -#define PORT_EDIER_EDIE23_MASK (0x800000U) -#define PORT_EDIER_EDIE23_SHIFT (23U) -/*! EDIE23 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE23(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE23_SHIFT)) & PORT_EDIER_EDIE23_MASK) - -#define PORT_EDIER_EDIE24_MASK (0x1000000U) -#define PORT_EDIER_EDIE24_SHIFT (24U) -/*! EDIE24 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE24(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE24_SHIFT)) & PORT_EDIER_EDIE24_MASK) - -#define PORT_EDIER_EDIE25_MASK (0x2000000U) -#define PORT_EDIER_EDIE25_SHIFT (25U) -/*! EDIE25 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE25(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE25_SHIFT)) & PORT_EDIER_EDIE25_MASK) - -#define PORT_EDIER_EDIE26_MASK (0x4000000U) -#define PORT_EDIER_EDIE26_SHIFT (26U) -/*! EDIE26 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE26(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE26_SHIFT)) & PORT_EDIER_EDIE26_MASK) - -#define PORT_EDIER_EDIE27_MASK (0x8000000U) -#define PORT_EDIER_EDIE27_SHIFT (27U) -/*! EDIE27 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE27(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE27_SHIFT)) & PORT_EDIER_EDIE27_MASK) - -#define PORT_EDIER_EDIE28_MASK (0x10000000U) -#define PORT_EDIER_EDIE28_SHIFT (28U) -/*! EDIE28 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE28(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE28_SHIFT)) & PORT_EDIER_EDIE28_MASK) - -#define PORT_EDIER_EDIE29_MASK (0x20000000U) -#define PORT_EDIER_EDIE29_SHIFT (29U) -/*! EDIE29 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE29(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE29_SHIFT)) & PORT_EDIER_EDIE29_MASK) - -#define PORT_EDIER_EDIE30_MASK (0x40000000U) -#define PORT_EDIER_EDIE30_SHIFT (30U) -/*! EDIE30 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE30(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE30_SHIFT)) & PORT_EDIER_EDIE30_MASK) - -#define PORT_EDIER_EDIE31_MASK (0x80000000U) -#define PORT_EDIER_EDIE31_SHIFT (31U) -/*! EDIE31 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE31(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE31_SHIFT)) & PORT_EDIER_EDIE31_MASK) -/*! @} */ - -/*! @name EDCR - EFT Detect Clear */ -/*! @{ */ - -#define PORT_EDCR_EDHC_MASK (0x1U) -#define PORT_EDCR_EDHC_SHIFT (0U) -/*! EDHC - EFT Detect High Clear - * 0b0..Does not clear - * 0b1..Clears - */ -#define PORT_EDCR_EDHC(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDCR_EDHC_SHIFT)) & PORT_EDCR_EDHC_MASK) - -#define PORT_EDCR_EDLC_MASK (0x2U) -#define PORT_EDCR_EDLC_SHIFT (1U) -/*! EDLC - EFT Detect Low Clear - * 0b0..Does not clear - * 0b1..Clears - */ -#define PORT_EDCR_EDLC(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDCR_EDLC_SHIFT)) & PORT_EDCR_EDLC_MASK) -/*! @} */ - -/*! @name CALIB0 - Calibration 0 */ -/*! @{ */ - -#define PORT_CALIB0_NCAL_MASK (0x3FU) -#define PORT_CALIB0_NCAL_SHIFT (0U) -/*! NCAL - Calibration of NMOS Output Driver */ -#define PORT_CALIB0_NCAL(x) (((uint32_t)(((uint32_t)(x)) << PORT_CALIB0_NCAL_SHIFT)) & PORT_CALIB0_NCAL_MASK) - -#define PORT_CALIB0_PCAL_MASK (0x3F0000U) -#define PORT_CALIB0_PCAL_SHIFT (16U) -/*! PCAL - Calibration of PMOS Output Driver */ -#define PORT_CALIB0_PCAL(x) (((uint32_t)(((uint32_t)(x)) << PORT_CALIB0_PCAL_SHIFT)) & PORT_CALIB0_PCAL_MASK) -/*! @} */ - -/*! @name CALIB1 - Calibration 1 */ -/*! @{ */ - -#define PORT_CALIB1_NCAL_MASK (0x3FU) -#define PORT_CALIB1_NCAL_SHIFT (0U) -/*! NCAL - Calibration of NMOS Output Driver */ -#define PORT_CALIB1_NCAL(x) (((uint32_t)(((uint32_t)(x)) << PORT_CALIB1_NCAL_SHIFT)) & PORT_CALIB1_NCAL_MASK) - -#define PORT_CALIB1_PCAL_MASK (0x3F0000U) -#define PORT_CALIB1_PCAL_SHIFT (16U) -/*! PCAL - Calibration of PMOS Output Driver */ -#define PORT_CALIB1_PCAL(x) (((uint32_t)(((uint32_t)(x)) << PORT_CALIB1_PCAL_SHIFT)) & PORT_CALIB1_PCAL_MASK) -/*! @} */ - -/*! @name PCR - Pin Control 0..Pin Control 31 */ -/*! @{ */ - -#define PORT_PCR_PS_MASK (0x1U) -#define PORT_PCR_PS_SHIFT (0U) -/*! PS - Pull Select - * 0b0..Enables internal pulldown resistor - * 0b1..Enables internal pullup resistor - */ -#define PORT_PCR_PS(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_PS_SHIFT)) & PORT_PCR_PS_MASK) - -#define PORT_PCR_PE_MASK (0x2U) -#define PORT_PCR_PE_SHIFT (1U) -/*! PE - Pull Enable - * 0b0..Disables - * 0b1..Enables - */ -#define PORT_PCR_PE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_PE_SHIFT)) & PORT_PCR_PE_MASK) - -#define PORT_PCR_PV_MASK (0x4U) -#define PORT_PCR_PV_SHIFT (2U) -/*! PV - Pull Value - * 0b0..Low - * 0b1..High - */ -#define PORT_PCR_PV(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_PV_SHIFT)) & PORT_PCR_PV_MASK) - -#define PORT_PCR_SRE_MASK (0x8U) -#define PORT_PCR_SRE_SHIFT (3U) -/*! SRE - Slew Rate Enable - * 0b0..Fast - * 0b1..Slow - */ -#define PORT_PCR_SRE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_SRE_SHIFT)) & PORT_PCR_SRE_MASK) - -#define PORT_PCR_PFE_MASK (0x10U) -#define PORT_PCR_PFE_SHIFT (4U) -/*! PFE - Passive Filter Enable - * 0b0..Disables - * 0b1..Enables - */ -#define PORT_PCR_PFE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_PFE_SHIFT)) & PORT_PCR_PFE_MASK) - -#define PORT_PCR_ODE_MASK (0x20U) -#define PORT_PCR_ODE_SHIFT (5U) -/*! ODE - Open Drain Enable - * 0b0..Disables - * 0b1..Enables - */ -#define PORT_PCR_ODE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_ODE_SHIFT)) & PORT_PCR_ODE_MASK) - -#define PORT_PCR_DSE_MASK (0x40U) -#define PORT_PCR_DSE_SHIFT (6U) -/*! DSE - Drive Strength Enable - * 0b0..Low - * 0b1..High - */ -#define PORT_PCR_DSE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_DSE_SHIFT)) & PORT_PCR_DSE_MASK) - -#define PORT_PCR_MUX_MASK (0xF00U) /* Merged from fields with different position or width, of widths (2, 4), largest definition used */ -#define PORT_PCR_MUX_SHIFT (8U) -/*! MUX - Pin Multiplex Control - * 0b0000..Alternative 0 (GPIO) - * 0b0001..Alternative 1 (chip-specific) - * 0b0010..Alternative 2 (chip-specific) - * 0b0011..Alternative 3 (chip-specific) - * 0b0100..Alternative 4 (chip-specific) - * 0b0101..Alternative 5 (chip-specific) - * 0b0110..Alternative 6 (chip-specific) - * 0b0111..Alternative 7 (chip-specific) - * 0b1000..Alternative 8 (chip-specific) - * 0b1001..Alternative 9 (chip-specific) - * 0b1010..Alternative 10 (chip-specific) - * 0b1011..Alternative 11 (chip-specific) - * 0b1100..Alternative 12 (chip-specific) - * 0b1101..Alternative 13 (chip-specific) - */ -#define PORT_PCR_MUX(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_MUX_SHIFT)) & PORT_PCR_MUX_MASK) /* Merged from fields with different position or width, of widths (2, 4), largest definition used */ - -#define PORT_PCR_IBE_MASK (0x1000U) -#define PORT_PCR_IBE_SHIFT (12U) -/*! IBE - Input Buffer Enable - * 0b0..Disables - * 0b1..Enables - */ -#define PORT_PCR_IBE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_IBE_SHIFT)) & PORT_PCR_IBE_MASK) - -#define PORT_PCR_INV_MASK (0x2000U) -#define PORT_PCR_INV_SHIFT (13U) -/*! INV - Invert Input - * 0b0..Does not invert - * 0b1..Inverts - */ -#define PORT_PCR_INV(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_INV_SHIFT)) & PORT_PCR_INV_MASK) - -#define PORT_PCR_LK_MASK (0x8000U) -#define PORT_PCR_LK_SHIFT (15U) -/*! LK - Lock Register - * 0b0..Does not lock - * 0b1..Locks - */ -#define PORT_PCR_LK(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_LK_SHIFT)) & PORT_PCR_LK_MASK) -/*! @} */ - -/* The count of PORT_PCR */ -#define PORT_PCR_COUNT (32U) - - -/*! - * @} - */ /* end of group PORT_Register_Masks */ - - -/* PORT - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral PORT0 base address */ - #define PORT0_BASE (0x50116000u) - /** Peripheral PORT0 base address */ - #define PORT0_BASE_NS (0x40116000u) - /** Peripheral PORT0 base pointer */ - #define PORT0 ((PORT_Type *)PORT0_BASE) - /** Peripheral PORT0 base pointer */ - #define PORT0_NS ((PORT_Type *)PORT0_BASE_NS) - /** Peripheral PORT1 base address */ - #define PORT1_BASE (0x50117000u) - /** Peripheral PORT1 base address */ - #define PORT1_BASE_NS (0x40117000u) - /** Peripheral PORT1 base pointer */ - #define PORT1 ((PORT_Type *)PORT1_BASE) - /** Peripheral PORT1 base pointer */ - #define PORT1_NS ((PORT_Type *)PORT1_BASE_NS) - /** Peripheral PORT2 base address */ - #define PORT2_BASE (0x50118000u) - /** Peripheral PORT2 base address */ - #define PORT2_BASE_NS (0x40118000u) - /** Peripheral PORT2 base pointer */ - #define PORT2 ((PORT_Type *)PORT2_BASE) - /** Peripheral PORT2 base pointer */ - #define PORT2_NS ((PORT_Type *)PORT2_BASE_NS) - /** Peripheral PORT3 base address */ - #define PORT3_BASE (0x50119000u) - /** Peripheral PORT3 base address */ - #define PORT3_BASE_NS (0x40119000u) - /** Peripheral PORT3 base pointer */ - #define PORT3 ((PORT_Type *)PORT3_BASE) - /** Peripheral PORT3 base pointer */ - #define PORT3_NS ((PORT_Type *)PORT3_BASE_NS) - /** Peripheral PORT4 base address */ - #define PORT4_BASE (0x5011A000u) - /** Peripheral PORT4 base address */ - #define PORT4_BASE_NS (0x4011A000u) - /** Peripheral PORT4 base pointer */ - #define PORT4 ((PORT_Type *)PORT4_BASE) - /** Peripheral PORT4 base pointer */ - #define PORT4_NS ((PORT_Type *)PORT4_BASE_NS) - /** Peripheral PORT5 base address */ - #define PORT5_BASE (0x50042000u) - /** Peripheral PORT5 base address */ - #define PORT5_BASE_NS (0x40042000u) - /** Peripheral PORT5 base pointer */ - #define PORT5 ((PORT_Type *)PORT5_BASE) - /** Peripheral PORT5 base pointer */ - #define PORT5_NS ((PORT_Type *)PORT5_BASE_NS) - /** Array initializer of PORT peripheral base addresses */ - #define PORT_BASE_ADDRS { PORT0_BASE, PORT1_BASE, PORT2_BASE, PORT3_BASE, PORT4_BASE, PORT5_BASE } - /** Array initializer of PORT peripheral base pointers */ - #define PORT_BASE_PTRS { PORT0, PORT1, PORT2, PORT3, PORT4, PORT5 } - /** Array initializer of PORT peripheral base addresses */ - #define PORT_BASE_ADDRS_NS { PORT0_BASE_NS, PORT1_BASE_NS, PORT2_BASE_NS, PORT3_BASE_NS, PORT4_BASE_NS, PORT5_BASE_NS } - /** Array initializer of PORT peripheral base pointers */ - #define PORT_BASE_PTRS_NS { PORT0_NS, PORT1_NS, PORT2_NS, PORT3_NS, PORT4_NS, PORT5_NS } -#else - /** Peripheral PORT0 base address */ - #define PORT0_BASE (0x40116000u) - /** Peripheral PORT0 base pointer */ - #define PORT0 ((PORT_Type *)PORT0_BASE) - /** Peripheral PORT1 base address */ - #define PORT1_BASE (0x40117000u) - /** Peripheral PORT1 base pointer */ - #define PORT1 ((PORT_Type *)PORT1_BASE) - /** Peripheral PORT2 base address */ - #define PORT2_BASE (0x40118000u) - /** Peripheral PORT2 base pointer */ - #define PORT2 ((PORT_Type *)PORT2_BASE) - /** Peripheral PORT3 base address */ - #define PORT3_BASE (0x40119000u) - /** Peripheral PORT3 base pointer */ - #define PORT3 ((PORT_Type *)PORT3_BASE) - /** Peripheral PORT4 base address */ - #define PORT4_BASE (0x4011A000u) - /** Peripheral PORT4 base pointer */ - #define PORT4 ((PORT_Type *)PORT4_BASE) - /** Peripheral PORT5 base address */ - #define PORT5_BASE (0x40042000u) - /** Peripheral PORT5 base pointer */ - #define PORT5 ((PORT_Type *)PORT5_BASE) - /** Array initializer of PORT peripheral base addresses */ - #define PORT_BASE_ADDRS { PORT0_BASE, PORT1_BASE, PORT2_BASE, PORT3_BASE, PORT4_BASE, PORT5_BASE } - /** Array initializer of PORT peripheral base pointers */ - #define PORT_BASE_PTRS { PORT0, PORT1, PORT2, PORT3, PORT4, PORT5 } -#endif - -/*! - * @} - */ /* end of group PORT_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- PUF Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PUF_Peripheral_Access_Layer PUF Peripheral Access Layer - * @{ - */ - -/** PUF - Register Layout Typedef */ -typedef struct { - __IO uint32_t CR; /**< Control, offset: 0x0 */ - __I uint32_t ORR; /**< Operation Result, offset: 0x4 */ - __IO uint32_t SR; /**< Status, offset: 0x8 */ - __I uint32_t AR; /**< Allow, offset: 0xC */ - __IO uint32_t IER; /**< Interrupt Enable, offset: 0x10 */ - __IO uint32_t IMR; /**< Interrupt Mask, offset: 0x14 */ - __IO uint32_t ISR; /**< Interrupt Status, offset: 0x18 */ - uint8_t RESERVED_0[4]; - __IO uint32_t DATA_DEST; /**< Data Destination, offset: 0x20 */ - __IO uint32_t DATA_SRC; /**< Data Source, offset: 0x24 */ - uint8_t RESERVED_1[120]; - __O uint32_t DIR; /**< Data Input, offset: 0xA0 */ - uint8_t RESERVED_2[4]; - __I uint32_t DOR; /**< Data Output, offset: 0xA8 */ - uint8_t RESERVED_3[20]; - __IO uint32_t MISC; /**< Miscellaneous, offset: 0xC0 */ - uint8_t RESERVED_4[12]; - __IO uint32_t IF_SR; /**< Interface Status, offset: 0xD0 */ - uint8_t RESERVED_5[8]; - __I uint32_t PSR; /**< PUF Score, offset: 0xDC */ - __I uint32_t HW_RUC0; /**< Hardware Restrict User Context 0, offset: 0xE0 */ - __I uint32_t HW_RUC1; /**< Hardware Restrict User Context 1, offset: 0xE4 */ - uint8_t RESERVED_6[12]; - __I uint32_t HW_INFO; /**< Hardware Information, offset: 0xF4 */ - __I uint32_t HW_ID; /**< Hardware Identifier, offset: 0xF8 */ - __I uint32_t HW_VER; /**< Hardware Version, offset: 0xFC */ - __IO uint32_t CONFIG; /**< PUF command blocking configuration, offset: 0x100 */ - __IO uint32_t SEC_LOCK; /**< Security level lock, offset: 0x104 */ - __IO uint32_t APP_CTX_MASK; /**< Application defined context mask, offset: 0x108 */ - uint8_t RESERVED_7[500]; - __IO uint32_t SRAM_CFG; /**< SRAM Configuration, offset: 0x300 */ - __I uint32_t SRAM_STATUS; /**< Status, offset: 0x304 */ - uint8_t RESERVED_8[208]; - __O uint32_t SRAM_INT_CLR_ENABLE; /**< Interrupt Enable Clear, offset: 0x3D8 */ - __O uint32_t SRAM_INT_SET_ENABLE; /**< Interrupt Enable Set, offset: 0x3DC */ - __I uint32_t SRAM_INT_STATUS; /**< Interrupt Status, offset: 0x3E0 */ - __I uint32_t SRAM_INT_ENABLE; /**< Interrupt Enable, offset: 0x3E4 */ - __O uint32_t SRAM_INT_CLR_STATUS; /**< Interrupt Status Clear, offset: 0x3E8 */ - __O uint32_t SRAM_INT_SET_STATUS; /**< Interrupt Status set, offset: 0x3EC */ -} PUF_Type; - -/* ---------------------------------------------------------------------------- - -- PUF Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PUF_Register_Masks PUF Register Masks - * @{ - */ - -/*! @name CR - Control */ -/*! @{ */ - -#define PUF_CR_ZEROIZE_MASK (0x1U) -#define PUF_CR_ZEROIZE_SHIFT (0U) -/*! ZEROIZE - Zeroize operation */ -#define PUF_CR_ZEROIZE(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_ZEROIZE_SHIFT)) & PUF_CR_ZEROIZE_MASK) - -#define PUF_CR_ENROLL_MASK (0x2U) -#define PUF_CR_ENROLL_SHIFT (1U) -/*! ENROLL - Enroll operation */ -#define PUF_CR_ENROLL(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_ENROLL_SHIFT)) & PUF_CR_ENROLL_MASK) - -#define PUF_CR_START_MASK (0x4U) -#define PUF_CR_START_SHIFT (2U) -/*! START - Start operation */ -#define PUF_CR_START(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_START_SHIFT)) & PUF_CR_START_MASK) - -#define PUF_CR_RECONSTRUCT_MASK (0x8U) -#define PUF_CR_RECONSTRUCT_SHIFT (3U) -/*! RECONSTRUCT - Reconstruct operation */ -#define PUF_CR_RECONSTRUCT(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_RECONSTRUCT_SHIFT)) & PUF_CR_RECONSTRUCT_MASK) - -#define PUF_CR_STOP_MASK (0x20U) -#define PUF_CR_STOP_SHIFT (5U) -/*! STOP - Stop operation */ -#define PUF_CR_STOP(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_STOP_SHIFT)) & PUF_CR_STOP_MASK) - -#define PUF_CR_GET_KEY_MASK (0x40U) -#define PUF_CR_GET_KEY_SHIFT (6U) -/*! GET_KEY - Get Key operation */ -#define PUF_CR_GET_KEY(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_GET_KEY_SHIFT)) & PUF_CR_GET_KEY_MASK) - -#define PUF_CR_UNWRAP_MASK (0x80U) -#define PUF_CR_UNWRAP_SHIFT (7U) -/*! UNWRAP - Unwrap operation */ -#define PUF_CR_UNWRAP(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_UNWRAP_SHIFT)) & PUF_CR_UNWRAP_MASK) - -#define PUF_CR_WRAP_GENERATED_RANDOM_MASK (0x100U) -#define PUF_CR_WRAP_GENERATED_RANDOM_SHIFT (8U) -/*! WRAP_GENERATED_RANDOM - Wrap Generated Random operation */ -#define PUF_CR_WRAP_GENERATED_RANDOM(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_WRAP_GENERATED_RANDOM_SHIFT)) & PUF_CR_WRAP_GENERATED_RANDOM_MASK) - -#define PUF_CR_WRAP_MASK (0x200U) -#define PUF_CR_WRAP_SHIFT (9U) -/*! WRAP - Wrap operation */ -#define PUF_CR_WRAP(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_WRAP_SHIFT)) & PUF_CR_WRAP_MASK) - -#define PUF_CR_GENERATE_RANDOM_MASK (0x8000U) -#define PUF_CR_GENERATE_RANDOM_SHIFT (15U) -/*! GENERATE_RANDOM - Generate Random operation */ -#define PUF_CR_GENERATE_RANDOM(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_GENERATE_RANDOM_SHIFT)) & PUF_CR_GENERATE_RANDOM_MASK) - -#define PUF_CR_TEST_MEMORY_MASK (0x40000000U) -#define PUF_CR_TEST_MEMORY_SHIFT (30U) -/*! TEST_MEMORY - Test memory operation */ -#define PUF_CR_TEST_MEMORY(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_TEST_MEMORY_SHIFT)) & PUF_CR_TEST_MEMORY_MASK) - -#define PUF_CR_TEST_PUF_MASK (0x80000000U) -#define PUF_CR_TEST_PUF_SHIFT (31U) -/*! TEST_PUF - Test PUF operation */ -#define PUF_CR_TEST_PUF(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_TEST_PUF_SHIFT)) & PUF_CR_TEST_PUF_MASK) -/*! @} */ - -/*! @name ORR - Operation Result */ -/*! @{ */ - -#define PUF_ORR_RESULT_CODE_MASK (0xFFU) -#define PUF_ORR_RESULT_CODE_SHIFT (0U) -/*! RESULT_CODE - Result code of last operation - * 0b00000000..Indicates that the last operation was successful or operation is in progress. - * 0b11110000..Indicates that the AC is not for the current product/version. - * 0b11110001..Indicates that the AC in the second phase is not for the current product/version. - * 0b11110010..Indicates that the AC is corrupted. - * 0b11110011..Indicates that the AC in the second phase is corrupted. - * 0b11110100..Indicates that the authentication of the provided AC failed. - * 0b11110101..Indicates that the authentication of the provided AC failed in the second phase. - * 0b11110110..Indicates that the SRAM PUF quality verification fails. - * 0b11110111..Indicates that the incorrect or unsupported context is provided. - * 0b11111000..Indicates that a data destination was set that is not allowed according to other settings and the current PUF state. - * 0b11111111..Indicates that the PUF SRAM access has failed. - */ -#define PUF_ORR_RESULT_CODE(x) (((uint32_t)(((uint32_t)(x)) << PUF_ORR_RESULT_CODE_SHIFT)) & PUF_ORR_RESULT_CODE_MASK) - -#define PUF_ORR_LAST_OPERATION_MASK (0xFF000000U) -#define PUF_ORR_LAST_OPERATION_SHIFT (24U) -/*! LAST_OPERATION - Last operation type - * 0b00000000..Indicates that the operation is in progress. - * 0b00000001..Indicates that the last operation was Enroll. - * 0b00000010..Indicates that the last operation was Start. - * 0b00000011..Indicates that the last operation was Reconstruct - * 0b00000101..Indicates that the last operation was Stop. - * 0b00000110..Indicates that the last operation was Get Key. - * 0b00000111..Indicates that the last operation was Unwrap. - * 0b00001000..Indicates that the last operation was Wrap Generated Random. - * 0b00001001..Indicates that the last operation was Wrap. - * 0b00001111..Indicates that the last operation was Generate Random. - * 0b00011110..Indicates that the last operation was Test Memory. - * 0b00011111..Indicates that the last operation was Test PUF. - * 0b00100000..Indicates that the last operation was Initialization. - * 0b00101111..Indicates that the last operation was Zeroize. - */ -#define PUF_ORR_LAST_OPERATION(x) (((uint32_t)(((uint32_t)(x)) << PUF_ORR_LAST_OPERATION_SHIFT)) & PUF_ORR_LAST_OPERATION_MASK) -/*! @} */ - -/*! @name SR - Status */ -/*! @{ */ - -#define PUF_SR_BUSY_MASK (0x1U) -#define PUF_SR_BUSY_SHIFT (0U) -/*! BUSY - Operation in progress */ -#define PUF_SR_BUSY(x) (((uint32_t)(((uint32_t)(x)) << PUF_SR_BUSY_SHIFT)) & PUF_SR_BUSY_MASK) - -#define PUF_SR_OK_MASK (0x2U) -#define PUF_SR_OK_SHIFT (1U) -/*! OK - Last operation successful */ -#define PUF_SR_OK(x) (((uint32_t)(((uint32_t)(x)) << PUF_SR_OK_SHIFT)) & PUF_SR_OK_MASK) - -#define PUF_SR_ERROR_MASK (0x4U) -#define PUF_SR_ERROR_SHIFT (2U) -/*! ERROR - Last operation failed */ -#define PUF_SR_ERROR(x) (((uint32_t)(((uint32_t)(x)) << PUF_SR_ERROR_SHIFT)) & PUF_SR_ERROR_MASK) - -#define PUF_SR_ZEROIZED_MASK (0x8U) -#define PUF_SR_ZEROIZED_SHIFT (3U) -/*! ZEROIZED - Zeroized or Locked state */ -#define PUF_SR_ZEROIZED(x) (((uint32_t)(((uint32_t)(x)) << PUF_SR_ZEROIZED_SHIFT)) & PUF_SR_ZEROIZED_MASK) - -#define PUF_SR_REJECTED_MASK (0x10U) -#define PUF_SR_REJECTED_SHIFT (4U) -/*! REJECTED - Operation rejected */ -#define PUF_SR_REJECTED(x) (((uint32_t)(((uint32_t)(x)) << PUF_SR_REJECTED_SHIFT)) & PUF_SR_REJECTED_MASK) - -#define PUF_SR_DI_REQUEST_MASK (0x20U) -#define PUF_SR_DI_REQUEST_SHIFT (5U) -/*! DI_REQUEST - Indicates the request for data in transfer via the DIR register */ -#define PUF_SR_DI_REQUEST(x) (((uint32_t)(((uint32_t)(x)) << PUF_SR_DI_REQUEST_SHIFT)) & PUF_SR_DI_REQUEST_MASK) - -#define PUF_SR_DO_REQUEST_MASK (0x40U) -#define PUF_SR_DO_REQUEST_SHIFT (6U) -/*! DO_REQUEST - Indicates the request for data out transfer via the DOR register */ -#define PUF_SR_DO_REQUEST(x) (((uint32_t)(((uint32_t)(x)) << PUF_SR_DO_REQUEST_SHIFT)) & PUF_SR_DO_REQUEST_MASK) -/*! @} */ - -/*! @name AR - Allow */ -/*! @{ */ - -#define PUF_AR_ALLOW_ENROLL_MASK (0x2U) -#define PUF_AR_ALLOW_ENROLL_SHIFT (1U) -/*! ALLOW_ENROLL - Enroll operation - * 0b0..Indicates that the Enroll operation is not allowed - * 0b1..Indicates that the Enroll operation is allowed - */ -#define PUF_AR_ALLOW_ENROLL(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_ENROLL_SHIFT)) & PUF_AR_ALLOW_ENROLL_MASK) - -#define PUF_AR_ALLOW_START_MASK (0x4U) -#define PUF_AR_ALLOW_START_SHIFT (2U) -/*! ALLOW_START - Start operation - * 0b0..Indicates that the Start operation is not allowed - * 0b1..Indicates that the Start operation is allowed - */ -#define PUF_AR_ALLOW_START(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_START_SHIFT)) & PUF_AR_ALLOW_START_MASK) - -#define PUF_AR_ALLOW_RECONSTRUCT_MASK (0x8U) -#define PUF_AR_ALLOW_RECONSTRUCT_SHIFT (3U) -/*! ALLOW_RECONSTRUCT - Reconstruct operation - * 0b0..Indicates that the Reconstruct operation is not allowed - * 0b1..Indicates that the Reconstruct operation is allowed - */ -#define PUF_AR_ALLOW_RECONSTRUCT(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_RECONSTRUCT_SHIFT)) & PUF_AR_ALLOW_RECONSTRUCT_MASK) - -#define PUF_AR_ALLOW_STOP_MASK (0x20U) -#define PUF_AR_ALLOW_STOP_SHIFT (5U) -/*! ALLOW_STOP - Stop operation - * 0b0..Indicates that the Stop operation is not allowed - * 0b1..Indicates that the Stop operation is allowed - */ -#define PUF_AR_ALLOW_STOP(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_STOP_SHIFT)) & PUF_AR_ALLOW_STOP_MASK) - -#define PUF_AR_ALLOW_GET_KEY_MASK (0x40U) -#define PUF_AR_ALLOW_GET_KEY_SHIFT (6U) -/*! ALLOW_GET_KEY - Get Key operation - * 0b0..Indicates that the Get Key operation is not allowed - * 0b1..Indicates that the Get Key operation is allowed - */ -#define PUF_AR_ALLOW_GET_KEY(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_GET_KEY_SHIFT)) & PUF_AR_ALLOW_GET_KEY_MASK) - -#define PUF_AR_ALLOW_UNWRAP_MASK (0x80U) -#define PUF_AR_ALLOW_UNWRAP_SHIFT (7U) -/*! ALLOW_UNWRAP - Unwrap operation - * 0b0..Indicates that the Unwrap operation is not allowed - * 0b1..Indicates that the Unwrap operation is allowed - */ -#define PUF_AR_ALLOW_UNWRAP(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_UNWRAP_SHIFT)) & PUF_AR_ALLOW_UNWRAP_MASK) - -#define PUF_AR_ALLOW_WRAP_GENERATED_RANDOM_MASK (0x100U) -#define PUF_AR_ALLOW_WRAP_GENERATED_RANDOM_SHIFT (8U) -/*! ALLOW_WRAP_GENERATED_RANDOM - Wrap Generated Random operation - * 0b0..Indicates that the Wrap Generated Random operation is not allowed - * 0b1..Indicates that the Wrap Generated Random operation is allowed - */ -#define PUF_AR_ALLOW_WRAP_GENERATED_RANDOM(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_WRAP_GENERATED_RANDOM_SHIFT)) & PUF_AR_ALLOW_WRAP_GENERATED_RANDOM_MASK) - -#define PUF_AR_ALLOW_WRAP_MASK (0x200U) -#define PUF_AR_ALLOW_WRAP_SHIFT (9U) -/*! ALLOW_WRAP - Wrap operation - * 0b0..Indicates that the Wrap operation is not allowed - * 0b1..Indicates that the Wrap operation is allowed - */ -#define PUF_AR_ALLOW_WRAP(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_WRAP_SHIFT)) & PUF_AR_ALLOW_WRAP_MASK) - -#define PUF_AR_ALLOW_GENERATE_RANDOM_MASK (0x8000U) -#define PUF_AR_ALLOW_GENERATE_RANDOM_SHIFT (15U) -/*! ALLOW_GENERATE_RANDOM - Generate Random operation - * 0b0..Indicates that the Generate Random operation is not allowed - * 0b1..Indicates that the Generate Random operation is allowed - */ -#define PUF_AR_ALLOW_GENERATE_RANDOM(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_GENERATE_RANDOM_SHIFT)) & PUF_AR_ALLOW_GENERATE_RANDOM_MASK) - -#define PUF_AR_ALLOW_TEST_MEMORY_MASK (0x40000000U) -#define PUF_AR_ALLOW_TEST_MEMORY_SHIFT (30U) -/*! ALLOW_TEST_MEMORY - * 0b0..Indicates that the Test Memory operation is not allowed - * 0b1..Indicates that the Test Memory operation is allowed - */ -#define PUF_AR_ALLOW_TEST_MEMORY(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_TEST_MEMORY_SHIFT)) & PUF_AR_ALLOW_TEST_MEMORY_MASK) - -#define PUF_AR_ALLOW_TEST_PUF_MASK (0x80000000U) -#define PUF_AR_ALLOW_TEST_PUF_SHIFT (31U) -/*! ALLOW_TEST_PUF - Test PUF operation - * 0b0..Test PUF operation is not allowed - * 0b1..Test PUF operation is allowed - */ -#define PUF_AR_ALLOW_TEST_PUF(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_TEST_PUF_SHIFT)) & PUF_AR_ALLOW_TEST_PUF_MASK) -/*! @} */ - -/*! @name IER - Interrupt Enable */ -/*! @{ */ - -#define PUF_IER_INT_EN_MASK (0x1U) -#define PUF_IER_INT_EN_SHIFT (0U) -/*! INT_EN - Interrupt enable - * 0b0..Disables all PUF interrupts - * 0b1..Enables all PUF interrupts that are enabled in the Interrupt Mask register - */ -#define PUF_IER_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << PUF_IER_INT_EN_SHIFT)) & PUF_IER_INT_EN_MASK) -/*! @} */ - -/*! @name IMR - Interrupt Mask */ -/*! @{ */ - -#define PUF_IMR_INT_EN_BUSY_MASK (0x1U) -#define PUF_IMR_INT_EN_BUSY_SHIFT (0U) -/*! INT_EN_BUSY - Busy interrupt */ -#define PUF_IMR_INT_EN_BUSY(x) (((uint32_t)(((uint32_t)(x)) << PUF_IMR_INT_EN_BUSY_SHIFT)) & PUF_IMR_INT_EN_BUSY_MASK) - -#define PUF_IMR_INT_EN_OK_MASK (0x2U) -#define PUF_IMR_INT_EN_OK_SHIFT (1U) -/*! INT_EN_OK - Ok interrupt */ -#define PUF_IMR_INT_EN_OK(x) (((uint32_t)(((uint32_t)(x)) << PUF_IMR_INT_EN_OK_SHIFT)) & PUF_IMR_INT_EN_OK_MASK) - -#define PUF_IMR_INT_EN_ERROR_MASK (0x4U) -#define PUF_IMR_INT_EN_ERROR_SHIFT (2U) -/*! INT_EN_ERROR - Error interrupt */ -#define PUF_IMR_INT_EN_ERROR(x) (((uint32_t)(((uint32_t)(x)) << PUF_IMR_INT_EN_ERROR_SHIFT)) & PUF_IMR_INT_EN_ERROR_MASK) - -#define PUF_IMR_INT_EN_ZEROIZED_MASK (0x8U) -#define PUF_IMR_INT_EN_ZEROIZED_SHIFT (3U) -/*! INT_EN_ZEROIZED - Zeroized interrupt */ -#define PUF_IMR_INT_EN_ZEROIZED(x) (((uint32_t)(((uint32_t)(x)) << PUF_IMR_INT_EN_ZEROIZED_SHIFT)) & PUF_IMR_INT_EN_ZEROIZED_MASK) - -#define PUF_IMR_INT_EN_REJECTED_MASK (0x10U) -#define PUF_IMR_INT_EN_REJECTED_SHIFT (4U) -/*! INT_EN_REJECTED - Rejected interrupt */ -#define PUF_IMR_INT_EN_REJECTED(x) (((uint32_t)(((uint32_t)(x)) << PUF_IMR_INT_EN_REJECTED_SHIFT)) & PUF_IMR_INT_EN_REJECTED_MASK) - -#define PUF_IMR_INT_EN_DI_REQUEST_MASK (0x20U) -#define PUF_IMR_INT_EN_DI_REQUEST_SHIFT (5U) -/*! INT_EN_DI_REQUEST - Data in request interrupt */ -#define PUF_IMR_INT_EN_DI_REQUEST(x) (((uint32_t)(((uint32_t)(x)) << PUF_IMR_INT_EN_DI_REQUEST_SHIFT)) & PUF_IMR_INT_EN_DI_REQUEST_MASK) - -#define PUF_IMR_INT_EN_DO_REQUEST_MASK (0x40U) -#define PUF_IMR_INT_EN_DO_REQUEST_SHIFT (6U) -/*! INT_EN_DO_REQUEST - Data out request interrupt */ -#define PUF_IMR_INT_EN_DO_REQUEST(x) (((uint32_t)(((uint32_t)(x)) << PUF_IMR_INT_EN_DO_REQUEST_SHIFT)) & PUF_IMR_INT_EN_DO_REQUEST_MASK) -/*! @} */ - -/*! @name ISR - Interrupt Status */ -/*! @{ */ - -#define PUF_ISR_INT_BUSY_MASK (0x1U) -#define PUF_ISR_INT_BUSY_SHIFT (0U) -/*! INT_BUSY - Negative edge occurred on Busy */ -#define PUF_ISR_INT_BUSY(x) (((uint32_t)(((uint32_t)(x)) << PUF_ISR_INT_BUSY_SHIFT)) & PUF_ISR_INT_BUSY_MASK) - -#define PUF_ISR_INT_OK_MASK (0x2U) -#define PUF_ISR_INT_OK_SHIFT (1U) -/*! INT_OK - Positive edge occurred on Ok */ -#define PUF_ISR_INT_OK(x) (((uint32_t)(((uint32_t)(x)) << PUF_ISR_INT_OK_SHIFT)) & PUF_ISR_INT_OK_MASK) - -#define PUF_ISR_INT_ERROR_MASK (0x4U) -#define PUF_ISR_INT_ERROR_SHIFT (2U) -/*! INT_ERROR - Positive edge occurred on Error */ -#define PUF_ISR_INT_ERROR(x) (((uint32_t)(((uint32_t)(x)) << PUF_ISR_INT_ERROR_SHIFT)) & PUF_ISR_INT_ERROR_MASK) - -#define PUF_ISR_INT_ZEROIZED_MASK (0x8U) -#define PUF_ISR_INT_ZEROIZED_SHIFT (3U) -/*! INT_ZEROIZED - Positive edge occurred on Zeroized */ -#define PUF_ISR_INT_ZEROIZED(x) (((uint32_t)(((uint32_t)(x)) << PUF_ISR_INT_ZEROIZED_SHIFT)) & PUF_ISR_INT_ZEROIZED_MASK) - -#define PUF_ISR_INT_REJECTED_MASK (0x10U) -#define PUF_ISR_INT_REJECTED_SHIFT (4U) -/*! INT_REJECTED - Positive edge occurred on Rejected */ -#define PUF_ISR_INT_REJECTED(x) (((uint32_t)(((uint32_t)(x)) << PUF_ISR_INT_REJECTED_SHIFT)) & PUF_ISR_INT_REJECTED_MASK) - -#define PUF_ISR_INT_DI_REQUEST_MASK (0x20U) -#define PUF_ISR_INT_DI_REQUEST_SHIFT (5U) -/*! INT_DI_REQUEST - Positive edge occurred on di_request */ -#define PUF_ISR_INT_DI_REQUEST(x) (((uint32_t)(((uint32_t)(x)) << PUF_ISR_INT_DI_REQUEST_SHIFT)) & PUF_ISR_INT_DI_REQUEST_MASK) - -#define PUF_ISR_INT_DO_REQUEST_MASK (0x40U) -#define PUF_ISR_INT_DO_REQUEST_SHIFT (6U) -/*! INT_DO_REQUEST - Positive edge occurred on do_request */ -#define PUF_ISR_INT_DO_REQUEST(x) (((uint32_t)(((uint32_t)(x)) << PUF_ISR_INT_DO_REQUEST_SHIFT)) & PUF_ISR_INT_DO_REQUEST_MASK) -/*! @} */ - -/*! @name DATA_DEST - Data Destination */ -/*! @{ */ - -#define PUF_DATA_DEST_DEST_DOR_MASK (0x1U) -#define PUF_DATA_DEST_DEST_DOR_SHIFT (0U) -/*! DEST_DOR - Key available via the DOR register */ -#define PUF_DATA_DEST_DEST_DOR(x) (((uint32_t)(((uint32_t)(x)) << PUF_DATA_DEST_DEST_DOR_SHIFT)) & PUF_DATA_DEST_DEST_DOR_MASK) - -#define PUF_DATA_DEST_DEST_SO_MASK (0x2U) -#define PUF_DATA_DEST_DEST_SO_SHIFT (1U) -/*! DEST_SO - Key available to ELS */ -#define PUF_DATA_DEST_DEST_SO(x) (((uint32_t)(((uint32_t)(x)) << PUF_DATA_DEST_DEST_SO_SHIFT)) & PUF_DATA_DEST_DEST_SO_MASK) -/*! @} */ - -/*! @name DATA_SRC - Data Source */ -/*! @{ */ - -#define PUF_DATA_SRC_SRC_DIR_MASK (0x1U) -#define PUF_DATA_SRC_SRC_DIR_SHIFT (0U) -/*! SRC_DIR - Data provided via the DIR register */ -#define PUF_DATA_SRC_SRC_DIR(x) (((uint32_t)(((uint32_t)(x)) << PUF_DATA_SRC_SRC_DIR_SHIFT)) & PUF_DATA_SRC_SRC_DIR_MASK) - -#define PUF_DATA_SRC_SRC_SI_MASK (0x2U) -#define PUF_DATA_SRC_SRC_SI_SHIFT (1U) -/*! SRC_SI - Data provided via the SI interface */ -#define PUF_DATA_SRC_SRC_SI(x) (((uint32_t)(((uint32_t)(x)) << PUF_DATA_SRC_SRC_SI_SHIFT)) & PUF_DATA_SRC_SRC_SI_MASK) -/*! @} */ - -/*! @name DIR - Data Input */ -/*! @{ */ - -#define PUF_DIR_DI_MASK (0xFFFFFFFFU) -#define PUF_DIR_DI_SHIFT (0U) -/*! DI - Input data */ -#define PUF_DIR_DI(x) (((uint32_t)(((uint32_t)(x)) << PUF_DIR_DI_SHIFT)) & PUF_DIR_DI_MASK) -/*! @} */ - -/*! @name DOR - Data Output */ -/*! @{ */ - -#define PUF_DOR_DO_MASK (0xFFFFFFFFU) -#define PUF_DOR_DO_SHIFT (0U) -/*! DO - Output data */ -#define PUF_DOR_DO(x) (((uint32_t)(((uint32_t)(x)) << PUF_DOR_DO_SHIFT)) & PUF_DOR_DO_MASK) -/*! @} */ - -/*! @name MISC - Miscellaneous */ -/*! @{ */ - -#define PUF_MISC_DATA_ENDIANNESS_MASK (0x1U) -#define PUF_MISC_DATA_ENDIANNESS_SHIFT (0U) -/*! DATA_ENDIANNESS - Defines the endianness of data in DIR and DOR: - * 0b0..Little endian - * 0b1..Big endian (default) - */ -#define PUF_MISC_DATA_ENDIANNESS(x) (((uint32_t)(((uint32_t)(x)) << PUF_MISC_DATA_ENDIANNESS_SHIFT)) & PUF_MISC_DATA_ENDIANNESS_MASK) -/*! @} */ - -/*! @name IF_SR - Interface Status */ -/*! @{ */ - -#define PUF_IF_SR_APB_ERROR_MASK (0x1U) -#define PUF_IF_SR_APB_ERROR_SHIFT (0U) -/*! APB_ERROR - APB error */ -#define PUF_IF_SR_APB_ERROR(x) (((uint32_t)(((uint32_t)(x)) << PUF_IF_SR_APB_ERROR_SHIFT)) & PUF_IF_SR_APB_ERROR_MASK) -/*! @} */ - -/*! @name PSR - PUF Score */ -/*! @{ */ - -#define PUF_PSR_PUF_SCORE_MASK (0xFU) -#define PUF_PSR_PUF_SCORE_SHIFT (0U) -/*! PUF_SCORE - Provides the PUF score obtained during the last Test PUF, Enroll or Start operation. */ -#define PUF_PSR_PUF_SCORE(x) (((uint32_t)(((uint32_t)(x)) << PUF_PSR_PUF_SCORE_SHIFT)) & PUF_PSR_PUF_SCORE_MASK) -/*! @} */ - -/*! @name HW_RUC0 - Hardware Restrict User Context 0 */ -/*! @{ */ - -#define PUF_HW_RUC0_LC_STATE_MASK (0xFFU) -#define PUF_HW_RUC0_LC_STATE_SHIFT (0U) -/*! LC_STATE - Life cycle state based restrictions - * 0b00000011..OEM Develop - * 0b00000111..OEM Develop 2 - * 0b00001111..OEM In-field - * 0b00011111..OEM Field return - * 0b00111111..NXP Field Return/Failure Analysis - * 0b11001111..In-field Locked - * 0b11111111..Bricked - */ -#define PUF_HW_RUC0_LC_STATE(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_RUC0_LC_STATE_SHIFT)) & PUF_HW_RUC0_LC_STATE_MASK) - -#define PUF_HW_RUC0_BOOT_STATE_MASK (0xFFFF00U) -#define PUF_HW_RUC0_BOOT_STATE_SHIFT (8U) -/*! BOOT_STATE - Temporal boot state */ -#define PUF_HW_RUC0_BOOT_STATE(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_RUC0_BOOT_STATE_SHIFT)) & PUF_HW_RUC0_BOOT_STATE_MASK) - -#define PUF_HW_RUC0_CPU0_DEBUG_MASK (0x1000000U) -#define PUF_HW_RUC0_CPU0_DEBUG_SHIFT (24U) -/*! CPU0_DEBUG - Disable key access when debugger is attached to CPU0 after power-up */ -#define PUF_HW_RUC0_CPU0_DEBUG(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_RUC0_CPU0_DEBUG_SHIFT)) & PUF_HW_RUC0_CPU0_DEBUG_MASK) - -#define PUF_HW_RUC0_COOLFLUX_DEBUG_MASK (0x2000000U) -#define PUF_HW_RUC0_COOLFLUX_DEBUG_SHIFT (25U) -/*! COOLFLUX_DEBUG - Disable key access when debugger is attached to COOLFLUX after power-up */ -#define PUF_HW_RUC0_COOLFLUX_DEBUG(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_RUC0_COOLFLUX_DEBUG_SHIFT)) & PUF_HW_RUC0_COOLFLUX_DEBUG_MASK) - -#define PUF_HW_RUC0_dsp_debug_MASK (0x4000000U) -#define PUF_HW_RUC0_dsp_debug_SHIFT (26U) -/*! dsp_debug - DSP debug status. */ -#define PUF_HW_RUC0_dsp_debug(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_RUC0_dsp_debug_SHIFT)) & PUF_HW_RUC0_dsp_debug_MASK) - -#define PUF_HW_RUC0_ACCESS_LEVEL_MASK (0xF0000000U) -#define PUF_HW_RUC0_ACCESS_LEVEL_SHIFT (28U) -/*! ACCESS_LEVEL - Restrict the key access based on TrustZone security level */ -#define PUF_HW_RUC0_ACCESS_LEVEL(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_RUC0_ACCESS_LEVEL_SHIFT)) & PUF_HW_RUC0_ACCESS_LEVEL_MASK) -/*! @} */ - -/*! @name HW_RUC1 - Hardware Restrict User Context 1 */ -/*! @{ */ - -#define PUF_HW_RUC1_APP_CTX_MASK (0xFFFFFFFFU) -#define PUF_HW_RUC1_APP_CTX_SHIFT (0U) -/*! APP_CTX - Application customizable context */ -#define PUF_HW_RUC1_APP_CTX(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_RUC1_APP_CTX_SHIFT)) & PUF_HW_RUC1_APP_CTX_MASK) -/*! @} */ - -/*! @name HW_INFO - Hardware Information */ -/*! @{ */ - -#define PUF_HW_INFO_CONFIG_WRAP_MASK (0x1000000U) -#define PUF_HW_INFO_CONFIG_WRAP_SHIFT (24U) -/*! CONFIG_WRAP - Wrap configuration - * 0b0..Indicates that Wrap is not included - * 0b1..Indicates that Wrap is included - */ -#define PUF_HW_INFO_CONFIG_WRAP(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_INFO_CONFIG_WRAP_SHIFT)) & PUF_HW_INFO_CONFIG_WRAP_MASK) - -#define PUF_HW_INFO_CONFIG_TYPE_MASK (0xF0000000U) -#define PUF_HW_INFO_CONFIG_TYPE_SHIFT (28U) -/*! CONFIG_TYPE - PUF configuration - * 0b0001..Indicates that PUF configuration is Safe. - * 0b0010..Indicates that PUF configuration is Plus. - */ -#define PUF_HW_INFO_CONFIG_TYPE(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_INFO_CONFIG_TYPE_SHIFT)) & PUF_HW_INFO_CONFIG_TYPE_MASK) -/*! @} */ - -/*! @name HW_ID - Hardware Identifier */ -/*! @{ */ - -#define PUF_HW_ID_HW_ID_MASK (0xFFFFFFFFU) -#define PUF_HW_ID_HW_ID_SHIFT (0U) -/*! HW_ID - Provides the hardware identifier */ -#define PUF_HW_ID_HW_ID(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_ID_HW_ID_SHIFT)) & PUF_HW_ID_HW_ID_MASK) -/*! @} */ - -/*! @name HW_VER - Hardware Version */ -/*! @{ */ - -#define PUF_HW_VER_HW_REV_MASK (0xFFU) -#define PUF_HW_VER_HW_REV_SHIFT (0U) -/*! HW_REV - Provides the hardware version, patch part */ -#define PUF_HW_VER_HW_REV(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_VER_HW_REV_SHIFT)) & PUF_HW_VER_HW_REV_MASK) - -#define PUF_HW_VER_HW_VERSION_MINOR_MASK (0xFF00U) -#define PUF_HW_VER_HW_VERSION_MINOR_SHIFT (8U) -/*! HW_VERSION_MINOR - Provides the hardware version, minor part */ -#define PUF_HW_VER_HW_VERSION_MINOR(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_VER_HW_VERSION_MINOR_SHIFT)) & PUF_HW_VER_HW_VERSION_MINOR_MASK) - -#define PUF_HW_VER_HW_VERSION_MAJOR_MASK (0xFF0000U) -#define PUF_HW_VER_HW_VERSION_MAJOR_SHIFT (16U) -/*! HW_VERSION_MAJOR - Provides the hardware version, major part */ -#define PUF_HW_VER_HW_VERSION_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_VER_HW_VERSION_MAJOR_SHIFT)) & PUF_HW_VER_HW_VERSION_MAJOR_MASK) -/*! @} */ - -/*! @name CONFIG - PUF command blocking configuration */ -/*! @{ */ - -#define PUF_CONFIG_DIS_PUF_ENROLL_MASK (0x2U) -#define PUF_CONFIG_DIS_PUF_ENROLL_SHIFT (1U) -/*! DIS_PUF_ENROLL - Disable PUF enroll command - * 0b0..Command enabled - * 0b1..Command disabled - */ -#define PUF_CONFIG_DIS_PUF_ENROLL(x) (((uint32_t)(((uint32_t)(x)) << PUF_CONFIG_DIS_PUF_ENROLL_SHIFT)) & PUF_CONFIG_DIS_PUF_ENROLL_MASK) - -#define PUF_CONFIG_DIS_PUF_START_MASK (0x4U) -#define PUF_CONFIG_DIS_PUF_START_SHIFT (2U) -/*! DIS_PUF_START - Disable PUF start command - * 0b0..Command enabled - * 0b1..Command disabled - */ -#define PUF_CONFIG_DIS_PUF_START(x) (((uint32_t)(((uint32_t)(x)) << PUF_CONFIG_DIS_PUF_START_SHIFT)) & PUF_CONFIG_DIS_PUF_START_MASK) - -#define PUF_CONFIG_DIS_PUF_STOP_MASK (0x20U) -#define PUF_CONFIG_DIS_PUF_STOP_SHIFT (5U) -/*! DIS_PUF_STOP - Disable PUF stop command - * 0b0..Command enabled - * 0b1..Command disabled - */ -#define PUF_CONFIG_DIS_PUF_STOP(x) (((uint32_t)(((uint32_t)(x)) << PUF_CONFIG_DIS_PUF_STOP_SHIFT)) & PUF_CONFIG_DIS_PUF_STOP_MASK) - -#define PUF_CONFIG_DIS_PUF_GET_KEY_MASK (0x40U) -#define PUF_CONFIG_DIS_PUF_GET_KEY_SHIFT (6U) -/*! DIS_PUF_GET_KEY - Disable PUF get key command - * 0b0..Command enabled - * 0b1..Command disabled - */ -#define PUF_CONFIG_DIS_PUF_GET_KEY(x) (((uint32_t)(((uint32_t)(x)) << PUF_CONFIG_DIS_PUF_GET_KEY_SHIFT)) & PUF_CONFIG_DIS_PUF_GET_KEY_MASK) - -#define PUF_CONFIG_DIS_PUF_UNWRAP_KEY_MASK (0x80U) -#define PUF_CONFIG_DIS_PUF_UNWRAP_KEY_SHIFT (7U) -/*! DIS_PUF_UNWRAP_KEY - Disable PUF unwrap key command - * 0b0..Command enabled - * 0b1..Command disabled - */ -#define PUF_CONFIG_DIS_PUF_UNWRAP_KEY(x) (((uint32_t)(((uint32_t)(x)) << PUF_CONFIG_DIS_PUF_UNWRAP_KEY_SHIFT)) & PUF_CONFIG_DIS_PUF_UNWRAP_KEY_MASK) - -#define PUF_CONFIG_DIS_PUF_GEN_WRAP_KEY_MASK (0x100U) -#define PUF_CONFIG_DIS_PUF_GEN_WRAP_KEY_SHIFT (8U) -/*! DIS_PUF_GEN_WRAP_KEY - Disable PUF generate and wrap key command - * 0b0..Command enabled - * 0b1..Command disabled - */ -#define PUF_CONFIG_DIS_PUF_GEN_WRAP_KEY(x) (((uint32_t)(((uint32_t)(x)) << PUF_CONFIG_DIS_PUF_GEN_WRAP_KEY_SHIFT)) & PUF_CONFIG_DIS_PUF_GEN_WRAP_KEY_MASK) - -#define PUF_CONFIG_DIS_PUF_WRAP_KEY_MASK (0x200U) -#define PUF_CONFIG_DIS_PUF_WRAP_KEY_SHIFT (9U) -/*! DIS_PUF_WRAP_KEY - Disable PUF wrap key command - * 0b0..Command enabled - * 0b1..Command disabled - */ -#define PUF_CONFIG_DIS_PUF_WRAP_KEY(x) (((uint32_t)(((uint32_t)(x)) << PUF_CONFIG_DIS_PUF_WRAP_KEY_SHIFT)) & PUF_CONFIG_DIS_PUF_WRAP_KEY_MASK) - -#define PUF_CONFIG_DIS_PUF_GEN_RANDOM_NUMBER_MASK (0x8000U) -#define PUF_CONFIG_DIS_PUF_GEN_RANDOM_NUMBER_SHIFT (15U) -/*! DIS_PUF_GEN_RANDOM_NUMBER - Disable PUF generate and wrap key command - * 0b0..Command enabled - * 0b1..Command disabled - */ -#define PUF_CONFIG_DIS_PUF_GEN_RANDOM_NUMBER(x) (((uint32_t)(((uint32_t)(x)) << PUF_CONFIG_DIS_PUF_GEN_RANDOM_NUMBER_SHIFT)) & PUF_CONFIG_DIS_PUF_GEN_RANDOM_NUMBER_MASK) - -#define PUF_CONFIG_DIS_PUF_TEST_MASK (0x80000000U) -#define PUF_CONFIG_DIS_PUF_TEST_SHIFT (31U) -/*! DIS_PUF_TEST - Disable PUF test command - * 0b0..Command enabled - * 0b1..Command disabled - */ -#define PUF_CONFIG_DIS_PUF_TEST(x) (((uint32_t)(((uint32_t)(x)) << PUF_CONFIG_DIS_PUF_TEST_SHIFT)) & PUF_CONFIG_DIS_PUF_TEST_MASK) -/*! @} */ - -/*! @name SEC_LOCK - Security level lock */ -/*! @{ */ - -#define PUF_SEC_LOCK_SEC_LEVEL_MASK (0x3U) -#define PUF_SEC_LOCK_SEC_LEVEL_SHIFT (0U) -/*! SEC_LEVEL - Security Level - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define PUF_SEC_LOCK_SEC_LEVEL(x) (((uint32_t)(((uint32_t)(x)) << PUF_SEC_LOCK_SEC_LEVEL_SHIFT)) & PUF_SEC_LOCK_SEC_LEVEL_MASK) - -#define PUF_SEC_LOCK_ANTI_POLE_SEC_LEVEL_MASK (0xCU) -#define PUF_SEC_LOCK_ANTI_POLE_SEC_LEVEL_SHIFT (2U) -/*! ANTI_POLE_SEC_LEVEL - Anti-pole of security level - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define PUF_SEC_LOCK_ANTI_POLE_SEC_LEVEL(x) (((uint32_t)(((uint32_t)(x)) << PUF_SEC_LOCK_ANTI_POLE_SEC_LEVEL_SHIFT)) & PUF_SEC_LOCK_ANTI_POLE_SEC_LEVEL_MASK) - -#define PUF_SEC_LOCK_PATTERN_MASK (0xFFF0U) -#define PUF_SEC_LOCK_PATTERN_SHIFT (4U) -/*! PATTERN - Pattern */ -#define PUF_SEC_LOCK_PATTERN(x) (((uint32_t)(((uint32_t)(x)) << PUF_SEC_LOCK_PATTERN_SHIFT)) & PUF_SEC_LOCK_PATTERN_MASK) -/*! @} */ - -/*! @name APP_CTX_MASK - Application defined context mask */ -/*! @{ */ - -#define PUF_APP_CTX_MASK_APP_CTX_MASK_MASK (0xFFFFFFFFU) -#define PUF_APP_CTX_MASK_APP_CTX_MASK_SHIFT (0U) -/*! APP_CTX_MASK - Application defined context */ -#define PUF_APP_CTX_MASK_APP_CTX_MASK(x) (((uint32_t)(((uint32_t)(x)) << PUF_APP_CTX_MASK_APP_CTX_MASK_SHIFT)) & PUF_APP_CTX_MASK_APP_CTX_MASK_MASK) -/*! @} */ - -/*! @name SRAM_CFG - SRAM Configuration */ -/*! @{ */ - -#define PUF_SRAM_CFG_ENABLE_MASK (0x1U) -#define PUF_SRAM_CFG_ENABLE_SHIFT (0U) -/*! ENABLE - PUF SRAM Controller activation - * 0b0..Disabled - * 0b1..Enabled - */ -#define PUF_SRAM_CFG_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_CFG_ENABLE_SHIFT)) & PUF_SRAM_CFG_ENABLE_MASK) - -#define PUF_SRAM_CFG_CKGATING_MASK (0x4U) -#define PUF_SRAM_CFG_CKGATING_SHIFT (2U) -/*! CKGATING - PUF SRAM Clock Gating control - * 0b0..Disabled - * 0b1..Enabled - */ -#define PUF_SRAM_CFG_CKGATING(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_CFG_CKGATING_SHIFT)) & PUF_SRAM_CFG_CKGATING_MASK) -/*! @} */ - -/*! @name SRAM_STATUS - Status */ -/*! @{ */ - -#define PUF_SRAM_STATUS_READY_MASK (0x1U) -#define PUF_SRAM_STATUS_READY_SHIFT (0U) -/*! READY - PUF SRAM Controller State */ -#define PUF_SRAM_STATUS_READY(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_STATUS_READY_SHIFT)) & PUF_SRAM_STATUS_READY_MASK) -/*! @} */ - -/*! @name SRAM_INT_CLR_ENABLE - Interrupt Enable Clear */ -/*! @{ */ - -#define PUF_SRAM_INT_CLR_ENABLE_READY_MASK (0x1U) -#define PUF_SRAM_INT_CLR_ENABLE_READY_SHIFT (0U) -/*! READY - READY Interrupt Enable clear */ -#define PUF_SRAM_INT_CLR_ENABLE_READY(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_CLR_ENABLE_READY_SHIFT)) & PUF_SRAM_INT_CLR_ENABLE_READY_MASK) - -#define PUF_SRAM_INT_CLR_ENABLE_APB_ERR_MASK (0x2U) -#define PUF_SRAM_INT_CLR_ENABLE_APB_ERR_SHIFT (1U) -/*! APB_ERR - APB_ERR Interrupt Enable clear */ -#define PUF_SRAM_INT_CLR_ENABLE_APB_ERR(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_CLR_ENABLE_APB_ERR_SHIFT)) & PUF_SRAM_INT_CLR_ENABLE_APB_ERR_MASK) -/*! @} */ - -/*! @name SRAM_INT_SET_ENABLE - Interrupt Enable Set */ -/*! @{ */ - -#define PUF_SRAM_INT_SET_ENABLE_READY_MASK (0x1U) -#define PUF_SRAM_INT_SET_ENABLE_READY_SHIFT (0U) -/*! READY - READY Interrupt Enable set */ -#define PUF_SRAM_INT_SET_ENABLE_READY(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_SET_ENABLE_READY_SHIFT)) & PUF_SRAM_INT_SET_ENABLE_READY_MASK) - -#define PUF_SRAM_INT_SET_ENABLE_APB_ERR_MASK (0x2U) -#define PUF_SRAM_INT_SET_ENABLE_APB_ERR_SHIFT (1U) -/*! APB_ERR - APB_ERR Interrupt Enable set */ -#define PUF_SRAM_INT_SET_ENABLE_APB_ERR(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_SET_ENABLE_APB_ERR_SHIFT)) & PUF_SRAM_INT_SET_ENABLE_APB_ERR_MASK) -/*! @} */ - -/*! @name SRAM_INT_STATUS - Interrupt Status */ -/*! @{ */ - -#define PUF_SRAM_INT_STATUS_READY_MASK (0x1U) -#define PUF_SRAM_INT_STATUS_READY_SHIFT (0U) -/*! READY - READY Interrupt Status */ -#define PUF_SRAM_INT_STATUS_READY(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_STATUS_READY_SHIFT)) & PUF_SRAM_INT_STATUS_READY_MASK) - -#define PUF_SRAM_INT_STATUS_APB_ERR_MASK (0x2U) -#define PUF_SRAM_INT_STATUS_APB_ERR_SHIFT (1U) -/*! APB_ERR - APB_ERR Interrupt Status */ -#define PUF_SRAM_INT_STATUS_APB_ERR(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_STATUS_APB_ERR_SHIFT)) & PUF_SRAM_INT_STATUS_APB_ERR_MASK) -/*! @} */ - -/*! @name SRAM_INT_ENABLE - Interrupt Enable */ -/*! @{ */ - -#define PUF_SRAM_INT_ENABLE_READY_MASK (0x1U) -#define PUF_SRAM_INT_ENABLE_READY_SHIFT (0U) -/*! READY - READY Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define PUF_SRAM_INT_ENABLE_READY(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_ENABLE_READY_SHIFT)) & PUF_SRAM_INT_ENABLE_READY_MASK) - -#define PUF_SRAM_INT_ENABLE_SRAM_APB_ERR_MASK (0x2U) -#define PUF_SRAM_INT_ENABLE_SRAM_APB_ERR_SHIFT (1U) -/*! SRAM_APB_ERR - APB_ERR Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define PUF_SRAM_INT_ENABLE_SRAM_APB_ERR(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_ENABLE_SRAM_APB_ERR_SHIFT)) & PUF_SRAM_INT_ENABLE_SRAM_APB_ERR_MASK) -/*! @} */ - -/*! @name SRAM_INT_CLR_STATUS - Interrupt Status Clear */ -/*! @{ */ - -#define PUF_SRAM_INT_CLR_STATUS_READY_MASK (0x1U) -#define PUF_SRAM_INT_CLR_STATUS_READY_SHIFT (0U) -/*! READY - READY Interrupt Status clear */ -#define PUF_SRAM_INT_CLR_STATUS_READY(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_CLR_STATUS_READY_SHIFT)) & PUF_SRAM_INT_CLR_STATUS_READY_MASK) - -#define PUF_SRAM_INT_CLR_STATUS_APB_ERR_MASK (0x2U) -#define PUF_SRAM_INT_CLR_STATUS_APB_ERR_SHIFT (1U) -/*! APB_ERR - APB_ERR Interrupt Status Clear - * 0b0..No effect - * 0b1..Clears the APB_ERR bit field in register INT_STATUS. Automatically reset by the Hardware - */ -#define PUF_SRAM_INT_CLR_STATUS_APB_ERR(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_CLR_STATUS_APB_ERR_SHIFT)) & PUF_SRAM_INT_CLR_STATUS_APB_ERR_MASK) -/*! @} */ - -/*! @name SRAM_INT_SET_STATUS - Interrupt Status set */ -/*! @{ */ - -#define PUF_SRAM_INT_SET_STATUS_READY_MASK (0x1U) -#define PUF_SRAM_INT_SET_STATUS_READY_SHIFT (0U) -/*! READY - READY Interrupt Status set */ -#define PUF_SRAM_INT_SET_STATUS_READY(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_SET_STATUS_READY_SHIFT)) & PUF_SRAM_INT_SET_STATUS_READY_MASK) - -#define PUF_SRAM_INT_SET_STATUS_APB_ERR_MASK (0x2U) -#define PUF_SRAM_INT_SET_STATUS_APB_ERR_SHIFT (1U) -/*! APB_ERR - APB_ERR Interrupt Status Set - * 0b0..No effect - * 0b1..Clears the APB_ERR bit field in register INT_STATUS. Automatically reset by the Hardware - */ -#define PUF_SRAM_INT_SET_STATUS_APB_ERR(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_SET_STATUS_APB_ERR_SHIFT)) & PUF_SRAM_INT_SET_STATUS_APB_ERR_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group PUF_Register_Masks */ - - -/* PUF - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral PUF base address */ - #define PUF_BASE (0x5002C000u) - /** Peripheral PUF base address */ - #define PUF_BASE_NS (0x4002C000u) - /** Peripheral PUF base pointer */ - #define PUF ((PUF_Type *)PUF_BASE) - /** Peripheral PUF base pointer */ - #define PUF_NS ((PUF_Type *)PUF_BASE_NS) - /** Peripheral PUF_ALIAS1 base address */ - #define PUF_ALIAS1_BASE (0x5002D000u) - /** Peripheral PUF_ALIAS1 base address */ - #define PUF_ALIAS1_BASE_NS (0x4002D000u) - /** Peripheral PUF_ALIAS1 base pointer */ - #define PUF_ALIAS1 ((PUF_Type *)PUF_ALIAS1_BASE) - /** Peripheral PUF_ALIAS1 base pointer */ - #define PUF_ALIAS1_NS ((PUF_Type *)PUF_ALIAS1_BASE_NS) - /** Peripheral PUF_ALIAS2 base address */ - #define PUF_ALIAS2_BASE (0x5002E000u) - /** Peripheral PUF_ALIAS2 base address */ - #define PUF_ALIAS2_BASE_NS (0x4002E000u) - /** Peripheral PUF_ALIAS2 base pointer */ - #define PUF_ALIAS2 ((PUF_Type *)PUF_ALIAS2_BASE) - /** Peripheral PUF_ALIAS2 base pointer */ - #define PUF_ALIAS2_NS ((PUF_Type *)PUF_ALIAS2_BASE_NS) - /** Peripheral PUF_ALIAS3 base address */ - #define PUF_ALIAS3_BASE (0x5002F000u) - /** Peripheral PUF_ALIAS3 base address */ - #define PUF_ALIAS3_BASE_NS (0x4002F000u) - /** Peripheral PUF_ALIAS3 base pointer */ - #define PUF_ALIAS3 ((PUF_Type *)PUF_ALIAS3_BASE) - /** Peripheral PUF_ALIAS3 base pointer */ - #define PUF_ALIAS3_NS ((PUF_Type *)PUF_ALIAS3_BASE_NS) - /** Array initializer of PUF peripheral base addresses */ - #define PUF_BASE_ADDRS { PUF_BASE, PUF_ALIAS1_BASE, PUF_ALIAS2_BASE, PUF_ALIAS3_BASE } - /** Array initializer of PUF peripheral base pointers */ - #define PUF_BASE_PTRS { PUF, PUF_ALIAS1, PUF_ALIAS2, PUF_ALIAS3 } - /** Array initializer of PUF peripheral base addresses */ - #define PUF_BASE_ADDRS_NS { PUF_BASE_NS, PUF_ALIAS1_BASE_NS, PUF_ALIAS2_BASE_NS, PUF_ALIAS3_BASE_NS } - /** Array initializer of PUF peripheral base pointers */ - #define PUF_BASE_PTRS_NS { PUF_NS, PUF_ALIAS1_NS, PUF_ALIAS2_NS, PUF_ALIAS3_NS } -#else - /** Peripheral PUF base address */ - #define PUF_BASE (0x4002C000u) - /** Peripheral PUF base pointer */ - #define PUF ((PUF_Type *)PUF_BASE) - /** Peripheral PUF_ALIAS1 base address */ - #define PUF_ALIAS1_BASE (0x4002D000u) - /** Peripheral PUF_ALIAS1 base pointer */ - #define PUF_ALIAS1 ((PUF_Type *)PUF_ALIAS1_BASE) - /** Peripheral PUF_ALIAS2 base address */ - #define PUF_ALIAS2_BASE (0x4002E000u) - /** Peripheral PUF_ALIAS2 base pointer */ - #define PUF_ALIAS2 ((PUF_Type *)PUF_ALIAS2_BASE) - /** Peripheral PUF_ALIAS3 base address */ - #define PUF_ALIAS3_BASE (0x4002F000u) - /** Peripheral PUF_ALIAS3 base pointer */ - #define PUF_ALIAS3 ((PUF_Type *)PUF_ALIAS3_BASE) - /** Array initializer of PUF peripheral base addresses */ - #define PUF_BASE_ADDRS { PUF_BASE, PUF_ALIAS1_BASE, PUF_ALIAS2_BASE, PUF_ALIAS3_BASE } - /** Array initializer of PUF peripheral base pointers */ - #define PUF_BASE_PTRS { PUF, PUF_ALIAS1, PUF_ALIAS2, PUF_ALIAS3 } -#endif - -/*! - * @} - */ /* end of group PUF_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- PWM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PWM_Peripheral_Access_Layer PWM Peripheral Access Layer - * @{ - */ - -/** PWM - Register Layout Typedef */ -typedef struct { - struct { /* offset: 0x0, array step: 0x60 */ - __I uint16_t CNT; /**< Counter Register, array offset: 0x0, array step: 0x60 */ - __IO uint16_t INIT; /**< Initial Count Register, array offset: 0x2, array step: 0x60 */ - __IO uint16_t CTRL2; /**< Control 2 Register, array offset: 0x4, array step: 0x60 */ - __IO uint16_t CTRL; /**< Control Register, array offset: 0x6, array step: 0x60 */ - uint8_t RESERVED_0[2]; - __IO uint16_t VAL0; /**< Value Register 0, array offset: 0xA, array step: 0x60 */ - __IO uint16_t FRACVAL1; /**< Fractional Value Register 1, array offset: 0xC, array step: 0x60 */ - __IO uint16_t VAL1; /**< Value Register 1, array offset: 0xE, array step: 0x60 */ - __IO uint16_t FRACVAL2; /**< Fractional Value Register 2, array offset: 0x10, array step: 0x60 */ - __IO uint16_t VAL2; /**< Value Register 2, array offset: 0x12, array step: 0x60 */ - __IO uint16_t FRACVAL3; /**< Fractional Value Register 3, array offset: 0x14, array step: 0x60 */ - __IO uint16_t VAL3; /**< Value Register 3, array offset: 0x16, array step: 0x60 */ - __IO uint16_t FRACVAL4; /**< Fractional Value Register 4, array offset: 0x18, array step: 0x60 */ - __IO uint16_t VAL4; /**< Value Register 4, array offset: 0x1A, array step: 0x60 */ - __IO uint16_t FRACVAL5; /**< Fractional Value Register 5, array offset: 0x1C, array step: 0x60 */ - __IO uint16_t VAL5; /**< Value Register 5, array offset: 0x1E, array step: 0x60 */ - __IO uint16_t FRCTRL; /**< Fractional Control Register, array offset: 0x20, array step: 0x60 */ - __IO uint16_t OCTRL; /**< Output Control Register, array offset: 0x22, array step: 0x60 */ - __IO uint16_t STS; /**< Status Register, array offset: 0x24, array step: 0x60 */ - __IO uint16_t INTEN; /**< Interrupt Enable Register, array offset: 0x26, array step: 0x60 */ - __IO uint16_t DMAEN; /**< DMA Enable Register, array offset: 0x28, array step: 0x60 */ - __IO uint16_t TCTRL; /**< Output Trigger Control Register, array offset: 0x2A, array step: 0x60 */ - __IO uint16_t DISMAP[1]; /**< Fault Disable Mapping Register 0, array offset: 0x2C, array step: index*0x60, index2*0x2 */ - uint8_t RESERVED_1[2]; - __IO uint16_t DTCNT0; /**< Deadtime Count Register 0, array offset: 0x30, array step: 0x60 */ - __IO uint16_t DTCNT1; /**< Deadtime Count Register 1, array offset: 0x32, array step: 0x60 */ - __IO uint16_t CAPTCTRLA; /**< Capture Control A Register, array offset: 0x34, array step: 0x60 */ - __IO uint16_t CAPTCOMPA; /**< Capture Compare A Register, array offset: 0x36, array step: 0x60 */ - __IO uint16_t CAPTCTRLB; /**< Capture Control B Register, array offset: 0x38, array step: 0x60 */ - __IO uint16_t CAPTCOMPB; /**< Capture Compare B Register, array offset: 0x3A, array step: 0x60 */ - __IO uint16_t CAPTCTRLX; /**< Capture Control X Register, array offset: 0x3C, array step: 0x60 */ - __IO uint16_t CAPTCOMPX; /**< Capture Compare X Register, array offset: 0x3E, array step: 0x60 */ - __I uint16_t CVAL0; /**< Capture Value 0 Register, array offset: 0x40, array step: 0x60 */ - __I uint16_t CVAL0CYC; /**< Capture Value 0 Cycle Register, array offset: 0x42, array step: 0x60 */ - __I uint16_t CVAL1; /**< Capture Value 1 Register, array offset: 0x44, array step: 0x60 */ - __I uint16_t CVAL1CYC; /**< Capture Value 1 Cycle Register, array offset: 0x46, array step: 0x60 */ - __I uint16_t CVAL2; /**< Capture Value 2 Register, array offset: 0x48, array step: 0x60 */ - __I uint16_t CVAL2CYC; /**< Capture Value 2 Cycle Register, array offset: 0x4A, array step: 0x60 */ - __I uint16_t CVAL3; /**< Capture Value 3 Register, array offset: 0x4C, array step: 0x60 */ - __I uint16_t CVAL3CYC; /**< Capture Value 3 Cycle Register, array offset: 0x4E, array step: 0x60 */ - __I uint16_t CVAL4; /**< Capture Value 4 Register, array offset: 0x50, array step: 0x60 */ - __I uint16_t CVAL4CYC; /**< Capture Value 4 Cycle Register, array offset: 0x52, array step: 0x60 */ - __I uint16_t CVAL5; /**< Capture Value 5 Register, array offset: 0x54, array step: 0x60 */ - __I uint16_t CVAL5CYC; /**< Capture Value 5 Cycle Register, array offset: 0x56, array step: 0x60 */ - __IO uint16_t PHASEDLY; /**< Phase Delay Register, array offset: 0x58, array step: 0x60, valid indices: [1-3] */ - __IO uint16_t CAPTFILTA; /**< Capture PWM_A Input Filter Register, array offset: 0x5A, array step: 0x60 */ - __IO uint16_t CAPTFILTB; /**< Capture PWM_B Input Filter Register, array offset: 0x5C, array step: 0x60 */ - __IO uint16_t CAPTFILTX; /**< Capture PWM_X Input Filter Register, array offset: 0x5E, array step: 0x60 */ - } SM[4]; - __IO uint16_t OUTEN; /**< Output Enable Register, offset: 0x180 */ - __IO uint16_t MASK; /**< Mask Register, offset: 0x182 */ - __IO uint16_t SWCOUT; /**< Software Controlled Output Register, offset: 0x184 */ - __IO uint16_t DTSRCSEL; /**< PWM Source Select Register, offset: 0x186 */ - __IO uint16_t MCTRL; /**< Master Control Register, offset: 0x188 */ - __IO uint16_t MCTRL2; /**< Master Control 2 Register, offset: 0x18A */ - __IO uint16_t FCTRL; /**< Fault Control Register, offset: 0x18C */ - __IO uint16_t FSTS; /**< Fault Status Register, offset: 0x18E */ - __IO uint16_t FFILT; /**< Fault Filter Register, offset: 0x190 */ - __IO uint16_t FTST; /**< Fault Test Register, offset: 0x192 */ - __IO uint16_t FCTRL2; /**< Fault Control 2 Register, offset: 0x194 */ -} PWM_Type; - -/* ---------------------------------------------------------------------------- - -- PWM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PWM_Register_Masks PWM Register Masks - * @{ - */ - -/*! @name CNT - Counter Register */ -/*! @{ */ - -#define PWM_CNT_CNT_MASK (0xFFFFU) -#define PWM_CNT_CNT_SHIFT (0U) -/*! CNT - Counter Register Bits */ -#define PWM_CNT_CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CNT_CNT_SHIFT)) & PWM_CNT_CNT_MASK) -/*! @} */ - -/* The count of PWM_CNT */ -#define PWM_CNT_COUNT (4U) - -/*! @name INIT - Initial Count Register */ -/*! @{ */ - -#define PWM_INIT_INIT_MASK (0xFFFFU) -#define PWM_INIT_INIT_SHIFT (0U) -/*! INIT - Initial Count Register Bits */ -#define PWM_INIT_INIT(x) (((uint16_t)(((uint16_t)(x)) << PWM_INIT_INIT_SHIFT)) & PWM_INIT_INIT_MASK) -/*! @} */ - -/* The count of PWM_INIT */ -#define PWM_INIT_COUNT (4U) - -/*! @name CTRL2 - Control 2 Register */ -/*! @{ */ - -#define PWM_CTRL2_CLK_SEL_MASK (0x3U) -#define PWM_CTRL2_CLK_SEL_SHIFT (0U) -/*! CLK_SEL - Clock Source Select - * 0b00..The IPBus clock is used as the clock for the local prescaler and counter. - * 0b01..EXT_CLK is used as the clock for the local prescaler and counter. - * 0b10..Submodule 0's clock (AUX_CLK) is used as the source clock for the local prescaler and counter. This - * setting should not be used in submodule 0 as it forces the clock to logic 0. - * 0b11..Reserved - */ -#define PWM_CTRL2_CLK_SEL(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_CLK_SEL_SHIFT)) & PWM_CTRL2_CLK_SEL_MASK) - -#define PWM_CTRL2_RELOAD_SEL_MASK (0x4U) -#define PWM_CTRL2_RELOAD_SEL_SHIFT (2U) -/*! RELOAD_SEL - Reload Source Select - * 0b0..The local RELOAD signal is used to reload registers. - * 0b1..The master RELOAD signal (from submodule 0) is used to reload registers. This setting should not be used - * in submodule 0 as it forces the RELOAD signal to logic 0. - */ -#define PWM_CTRL2_RELOAD_SEL(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_RELOAD_SEL_SHIFT)) & PWM_CTRL2_RELOAD_SEL_MASK) - -#define PWM_CTRL2_FORCE_SEL_MASK (0x38U) -#define PWM_CTRL2_FORCE_SEL_SHIFT (3U) -/*! FORCE_SEL - Force Select - * 0b000..The local force signal, CTRL2[FORCE], from this submodule is used to force updates. - * 0b001..The master force signal from submodule 0 is used to force updates. This setting should not be used in - * submodule 0 as it holds the FORCE OUTPUT signal to logic 0. - * 0b010..The local reload signal from this submodule is used to force updates without regard to the state of LDOK. - * 0b011..The master reload signal from submodule0 is used to force updates if LDOK is set. This setting should - * not be used in submodule0 as it holds the FORCE OUTPUT signal to logic 0. - * 0b100..The local sync signal from this submodule is used to force updates. - * 0b101..The master sync signal from submodule0 is used to force updates. This setting should not be used in - * submodule0 as it holds the FORCE OUTPUT signal to logic 0. - * 0b110..The external force signal, EXT_FORCE, from outside the PWM module causes updates. - * 0b111..The external sync signal, EXT_SYNC, from outside the PWM module causes updates. - */ -#define PWM_CTRL2_FORCE_SEL(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_FORCE_SEL_SHIFT)) & PWM_CTRL2_FORCE_SEL_MASK) - -#define PWM_CTRL2_FORCE_MASK (0x40U) -#define PWM_CTRL2_FORCE_SHIFT (6U) -/*! FORCE - Force Initialization */ -#define PWM_CTRL2_FORCE(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_FORCE_SHIFT)) & PWM_CTRL2_FORCE_MASK) - -#define PWM_CTRL2_FRCEN_MASK (0x80U) -#define PWM_CTRL2_FRCEN_SHIFT (7U) -/*! FRCEN - Force Enable - * 0b0..Initialization from a FORCE_OUT is disabled. - * 0b1..Initialization from a FORCE_OUT is enabled. - */ -#define PWM_CTRL2_FRCEN(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_FRCEN_SHIFT)) & PWM_CTRL2_FRCEN_MASK) - -#define PWM_CTRL2_INIT_SEL_MASK (0x300U) -#define PWM_CTRL2_INIT_SEL_SHIFT (8U) -/*! INIT_SEL - Initialization Control Select - * 0b00..Local sync (PWM_X) causes initialization. - * 0b01..Master reload from submodule 0 causes initialization. This setting should not be used in submodule 0 as - * it forces the INIT signal to logic 0. The submodule counter will only re-initialize when a master reload - * occurs. - * 0b10..Master sync from submodule 0 causes initialization. This setting should not be used in submodule 0 as it forces the INIT signal to logic 0. - * 0b11..EXT_SYNC causes initialization. - */ -#define PWM_CTRL2_INIT_SEL(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_INIT_SEL_SHIFT)) & PWM_CTRL2_INIT_SEL_MASK) - -#define PWM_CTRL2_PWMX_INIT_MASK (0x400U) -#define PWM_CTRL2_PWMX_INIT_SHIFT (10U) -/*! PWMX_INIT - PWM_X Initial Value */ -#define PWM_CTRL2_PWMX_INIT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_PWMX_INIT_SHIFT)) & PWM_CTRL2_PWMX_INIT_MASK) - -#define PWM_CTRL2_PWM45_INIT_MASK (0x800U) -#define PWM_CTRL2_PWM45_INIT_SHIFT (11U) -/*! PWM45_INIT - PWM45 Initial Value */ -#define PWM_CTRL2_PWM45_INIT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_PWM45_INIT_SHIFT)) & PWM_CTRL2_PWM45_INIT_MASK) - -#define PWM_CTRL2_PWM23_INIT_MASK (0x1000U) -#define PWM_CTRL2_PWM23_INIT_SHIFT (12U) -/*! PWM23_INIT - PWM23 Initial Value */ -#define PWM_CTRL2_PWM23_INIT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_PWM23_INIT_SHIFT)) & PWM_CTRL2_PWM23_INIT_MASK) - -#define PWM_CTRL2_INDEP_MASK (0x2000U) -#define PWM_CTRL2_INDEP_SHIFT (13U) -/*! INDEP - Independent or Complementary Pair Operation - * 0b0..PWM_A and PWM_B form a complementary PWM pair. - * 0b1..PWM_A and PWM_B outputs are independent PWMs. - */ -#define PWM_CTRL2_INDEP(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_INDEP_SHIFT)) & PWM_CTRL2_INDEP_MASK) - -#define PWM_CTRL2_DBGEN_MASK (0x8000U) -#define PWM_CTRL2_DBGEN_SHIFT (15U) -/*! DBGEN - Debug Enable */ -#define PWM_CTRL2_DBGEN(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_DBGEN_SHIFT)) & PWM_CTRL2_DBGEN_MASK) -/*! @} */ - -/* The count of PWM_CTRL2 */ -#define PWM_CTRL2_COUNT (4U) - -/*! @name CTRL - Control Register */ -/*! @{ */ - -#define PWM_CTRL_DBLEN_MASK (0x1U) -#define PWM_CTRL_DBLEN_SHIFT (0U) -/*! DBLEN - Double Switching Enable - * 0b0..Double switching disabled. - * 0b1..Double switching enabled. - */ -#define PWM_CTRL_DBLEN(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_DBLEN_SHIFT)) & PWM_CTRL_DBLEN_MASK) - -#define PWM_CTRL_DBLX_MASK (0x2U) -#define PWM_CTRL_DBLX_SHIFT (1U) -/*! DBLX - PWM_X Double Switching Enable - * 0b0..PWM_X double pulse disabled. - * 0b1..PWM_X double pulse enabled. - */ -#define PWM_CTRL_DBLX(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_DBLX_SHIFT)) & PWM_CTRL_DBLX_MASK) - -#define PWM_CTRL_LDMOD_MASK (0x4U) -#define PWM_CTRL_LDMOD_SHIFT (2U) -/*! LDMOD - Load Mode Select - * 0b0..Buffered registers of this submodule are loaded and take effect at the next PWM reload if MCTRL[LDOK] is set. - * 0b1..Buffered registers of this submodule are loaded and take effect immediately upon MCTRL[LDOK] being set. - * In this case, it is not necessary to set CTRL[FULL] or CTRL[HALF]. - */ -#define PWM_CTRL_LDMOD(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_LDMOD_SHIFT)) & PWM_CTRL_LDMOD_MASK) - -#define PWM_CTRL_SPLIT_MASK (0x8U) -#define PWM_CTRL_SPLIT_SHIFT (3U) -/*! SPLIT - Split the DBLPWM signal to PWM_A and PWM_B - * 0b0..DBLPWM is not split. PWM_A and PWM_B each have double pulses. - * 0b1..DBLPWM is split to PWM_A and PWM_B. - */ -#define PWM_CTRL_SPLIT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_SPLIT_SHIFT)) & PWM_CTRL_SPLIT_MASK) - -#define PWM_CTRL_PRSC_MASK (0x70U) -#define PWM_CTRL_PRSC_SHIFT (4U) -/*! PRSC - Prescaler - * 0b000..Prescaler 1 - * 0b001..Prescaler 2 - * 0b010..Prescaler 4 - * 0b011..Prescaler 8 - * 0b100..Prescaler 16 - * 0b101..Prescaler 32 - * 0b110..Prescaler 64 - * 0b111..Prescaler 128 - */ -#define PWM_CTRL_PRSC(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_PRSC_SHIFT)) & PWM_CTRL_PRSC_MASK) - -#define PWM_CTRL_COMPMODE_MASK (0x80U) -#define PWM_CTRL_COMPMODE_SHIFT (7U) -/*! COMPMODE - Compare Mode - * 0b0..The VAL* registers and the PWM counter are compared using an "equal to" method. This means that PWM edges - * are only produced when the counter is equal to one of the VAL* register values. This implies that a PWM_A - * output that is high at the end of a period maintains this state until a match with VAL3 clears the output - * in the following period. - * 0b1..The VAL* registers and the PWM counter are compared using an "equal to or greater than" method. This - * means that PWM edges are produced when the counter is equal to or greater than one of the VAL* register - * values. This implies that a PWM_A output that is high at the end of a period could go low at the start of the - * next period if the starting counter value is greater than (but not necessarily equal to) the new VAL3 value. - */ -#define PWM_CTRL_COMPMODE(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_COMPMODE_SHIFT)) & PWM_CTRL_COMPMODE_MASK) - -#define PWM_CTRL_DT_MASK (0x300U) -#define PWM_CTRL_DT_SHIFT (8U) -/*! DT - Deadtime */ -#define PWM_CTRL_DT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_DT_SHIFT)) & PWM_CTRL_DT_MASK) - -#define PWM_CTRL_FULL_MASK (0x400U) -#define PWM_CTRL_FULL_SHIFT (10U) -/*! FULL - Full Cycle Reload - * 0b0..Full-cycle reloads disabled. - * 0b1..Full-cycle reloads enabled. - */ -#define PWM_CTRL_FULL(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_FULL_SHIFT)) & PWM_CTRL_FULL_MASK) - -#define PWM_CTRL_HALF_MASK (0x800U) -#define PWM_CTRL_HALF_SHIFT (11U) -/*! HALF - Half Cycle Reload - * 0b0..Half-cycle reloads disabled. - * 0b1..Half-cycle reloads enabled. - */ -#define PWM_CTRL_HALF(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_HALF_SHIFT)) & PWM_CTRL_HALF_MASK) - -#define PWM_CTRL_LDFQ_MASK (0xF000U) -#define PWM_CTRL_LDFQ_SHIFT (12U) -/*! LDFQ - Load Frequency - * 0b0000..Every PWM opportunity - * 0b0001..Every 2 PWM opportunities - * 0b0010..Every 3 PWM opportunities - * 0b0011..Every 4 PWM opportunities - * 0b0100..Every 5 PWM opportunities - * 0b0101..Every 6 PWM opportunities - * 0b0110..Every 7 PWM opportunities - * 0b0111..Every 8 PWM opportunities - * 0b1000..Every 9 PWM opportunities - * 0b1001..Every 10 PWM opportunities - * 0b1010..Every 11 PWM opportunities - * 0b1011..Every 12 PWM opportunities - * 0b1100..Every 13 PWM opportunities - * 0b1101..Every 14 PWM opportunities - * 0b1110..Every 15 PWM opportunities - * 0b1111..Every 16 PWM opportunities - */ -#define PWM_CTRL_LDFQ(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_LDFQ_SHIFT)) & PWM_CTRL_LDFQ_MASK) -/*! @} */ - -/* The count of PWM_CTRL */ -#define PWM_CTRL_COUNT (4U) - -/*! @name VAL0 - Value Register 0 */ -/*! @{ */ - -#define PWM_VAL0_VAL0_MASK (0xFFFFU) -#define PWM_VAL0_VAL0_SHIFT (0U) -/*! VAL0 - Value 0 */ -#define PWM_VAL0_VAL0(x) (((uint16_t)(((uint16_t)(x)) << PWM_VAL0_VAL0_SHIFT)) & PWM_VAL0_VAL0_MASK) -/*! @} */ - -/* The count of PWM_VAL0 */ -#define PWM_VAL0_COUNT (4U) - -/*! @name FRACVAL1 - Fractional Value Register 1 */ -/*! @{ */ - -#define PWM_FRACVAL1_FRACVAL1_MASK (0xF800U) -#define PWM_FRACVAL1_FRACVAL1_SHIFT (11U) -/*! FRACVAL1 - Fractional Value 1 */ -#define PWM_FRACVAL1_FRACVAL1(x) (((uint16_t)(((uint16_t)(x)) << PWM_FRACVAL1_FRACVAL1_SHIFT)) & PWM_FRACVAL1_FRACVAL1_MASK) -/*! @} */ - -/* The count of PWM_FRACVAL1 */ -#define PWM_FRACVAL1_COUNT (4U) - -/*! @name VAL1 - Value Register 1 */ -/*! @{ */ - -#define PWM_VAL1_VAL1_MASK (0xFFFFU) -#define PWM_VAL1_VAL1_SHIFT (0U) -/*! VAL1 - Value 1 */ -#define PWM_VAL1_VAL1(x) (((uint16_t)(((uint16_t)(x)) << PWM_VAL1_VAL1_SHIFT)) & PWM_VAL1_VAL1_MASK) -/*! @} */ - -/* The count of PWM_VAL1 */ -#define PWM_VAL1_COUNT (4U) - -/*! @name FRACVAL2 - Fractional Value Register 2 */ -/*! @{ */ - -#define PWM_FRACVAL2_FRACVAL2_MASK (0xF800U) -#define PWM_FRACVAL2_FRACVAL2_SHIFT (11U) -/*! FRACVAL2 - Fractional Value 2 */ -#define PWM_FRACVAL2_FRACVAL2(x) (((uint16_t)(((uint16_t)(x)) << PWM_FRACVAL2_FRACVAL2_SHIFT)) & PWM_FRACVAL2_FRACVAL2_MASK) -/*! @} */ - -/* The count of PWM_FRACVAL2 */ -#define PWM_FRACVAL2_COUNT (4U) - -/*! @name VAL2 - Value Register 2 */ -/*! @{ */ - -#define PWM_VAL2_VAL2_MASK (0xFFFFU) -#define PWM_VAL2_VAL2_SHIFT (0U) -/*! VAL2 - Value 2 */ -#define PWM_VAL2_VAL2(x) (((uint16_t)(((uint16_t)(x)) << PWM_VAL2_VAL2_SHIFT)) & PWM_VAL2_VAL2_MASK) -/*! @} */ - -/* The count of PWM_VAL2 */ -#define PWM_VAL2_COUNT (4U) - -/*! @name FRACVAL3 - Fractional Value Register 3 */ -/*! @{ */ - -#define PWM_FRACVAL3_FRACVAL3_MASK (0xF800U) -#define PWM_FRACVAL3_FRACVAL3_SHIFT (11U) -/*! FRACVAL3 - Fractional Value 3 */ -#define PWM_FRACVAL3_FRACVAL3(x) (((uint16_t)(((uint16_t)(x)) << PWM_FRACVAL3_FRACVAL3_SHIFT)) & PWM_FRACVAL3_FRACVAL3_MASK) -/*! @} */ - -/* The count of PWM_FRACVAL3 */ -#define PWM_FRACVAL3_COUNT (4U) - -/*! @name VAL3 - Value Register 3 */ -/*! @{ */ - -#define PWM_VAL3_VAL3_MASK (0xFFFFU) -#define PWM_VAL3_VAL3_SHIFT (0U) -/*! VAL3 - Value 3 */ -#define PWM_VAL3_VAL3(x) (((uint16_t)(((uint16_t)(x)) << PWM_VAL3_VAL3_SHIFT)) & PWM_VAL3_VAL3_MASK) -/*! @} */ - -/* The count of PWM_VAL3 */ -#define PWM_VAL3_COUNT (4U) - -/*! @name FRACVAL4 - Fractional Value Register 4 */ -/*! @{ */ - -#define PWM_FRACVAL4_FRACVAL4_MASK (0xF800U) -#define PWM_FRACVAL4_FRACVAL4_SHIFT (11U) -/*! FRACVAL4 - Fractional Value 4 */ -#define PWM_FRACVAL4_FRACVAL4(x) (((uint16_t)(((uint16_t)(x)) << PWM_FRACVAL4_FRACVAL4_SHIFT)) & PWM_FRACVAL4_FRACVAL4_MASK) -/*! @} */ - -/* The count of PWM_FRACVAL4 */ -#define PWM_FRACVAL4_COUNT (4U) - -/*! @name VAL4 - Value Register 4 */ -/*! @{ */ - -#define PWM_VAL4_VAL4_MASK (0xFFFFU) -#define PWM_VAL4_VAL4_SHIFT (0U) -/*! VAL4 - Value 4 */ -#define PWM_VAL4_VAL4(x) (((uint16_t)(((uint16_t)(x)) << PWM_VAL4_VAL4_SHIFT)) & PWM_VAL4_VAL4_MASK) -/*! @} */ - -/* The count of PWM_VAL4 */ -#define PWM_VAL4_COUNT (4U) - -/*! @name FRACVAL5 - Fractional Value Register 5 */ -/*! @{ */ - -#define PWM_FRACVAL5_FRACVAL5_MASK (0xF800U) -#define PWM_FRACVAL5_FRACVAL5_SHIFT (11U) -/*! FRACVAL5 - Fractional Value 5 */ -#define PWM_FRACVAL5_FRACVAL5(x) (((uint16_t)(((uint16_t)(x)) << PWM_FRACVAL5_FRACVAL5_SHIFT)) & PWM_FRACVAL5_FRACVAL5_MASK) -/*! @} */ - -/* The count of PWM_FRACVAL5 */ -#define PWM_FRACVAL5_COUNT (4U) - -/*! @name VAL5 - Value Register 5 */ -/*! @{ */ - -#define PWM_VAL5_VAL5_MASK (0xFFFFU) -#define PWM_VAL5_VAL5_SHIFT (0U) -/*! VAL5 - Value 5 */ -#define PWM_VAL5_VAL5(x) (((uint16_t)(((uint16_t)(x)) << PWM_VAL5_VAL5_SHIFT)) & PWM_VAL5_VAL5_MASK) -/*! @} */ - -/* The count of PWM_VAL5 */ -#define PWM_VAL5_COUNT (4U) - -/*! @name FRCTRL - Fractional Control Register */ -/*! @{ */ - -#define PWM_FRCTRL_FRAC1_EN_MASK (0x2U) -#define PWM_FRCTRL_FRAC1_EN_SHIFT (1U) -/*! FRAC1_EN - Fractional Cycle PWM Period Enable - * 0b0..Disable fractional cycle length for the PWM period. - * 0b1..Enable fractional cycle length for the PWM period. - */ -#define PWM_FRCTRL_FRAC1_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_FRCTRL_FRAC1_EN_SHIFT)) & PWM_FRCTRL_FRAC1_EN_MASK) - -#define PWM_FRCTRL_FRAC23_EN_MASK (0x4U) -#define PWM_FRCTRL_FRAC23_EN_SHIFT (2U) -/*! FRAC23_EN - Fractional Cycle Placement Enable for PWM_A - * 0b0..Disable fractional cycle placement for PWM_A. - * 0b1..Enable fractional cycle placement for PWM_A. - */ -#define PWM_FRCTRL_FRAC23_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_FRCTRL_FRAC23_EN_SHIFT)) & PWM_FRCTRL_FRAC23_EN_MASK) - -#define PWM_FRCTRL_FRAC45_EN_MASK (0x10U) -#define PWM_FRCTRL_FRAC45_EN_SHIFT (4U) -/*! FRAC45_EN - Fractional Cycle Placement Enable for PWM_B - * 0b0..Disable fractional cycle placement for PWM_B. - * 0b1..Enable fractional cycle placement for PWM_B. - */ -#define PWM_FRCTRL_FRAC45_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_FRCTRL_FRAC45_EN_SHIFT)) & PWM_FRCTRL_FRAC45_EN_MASK) - -#define PWM_FRCTRL_TEST_MASK (0x8000U) -#define PWM_FRCTRL_TEST_SHIFT (15U) -/*! TEST - Test Status Bit */ -#define PWM_FRCTRL_TEST(x) (((uint16_t)(((uint16_t)(x)) << PWM_FRCTRL_TEST_SHIFT)) & PWM_FRCTRL_TEST_MASK) -/*! @} */ - -/* The count of PWM_FRCTRL */ -#define PWM_FRCTRL_COUNT (4U) - -/*! @name OCTRL - Output Control Register */ -/*! @{ */ - -#define PWM_OCTRL_PWMXFS_MASK (0x3U) -#define PWM_OCTRL_PWMXFS_SHIFT (0U) -/*! PWMXFS - PWM_X Fault State - * 0b00..Output is forced to logic 0 state prior to consideration of output polarity control. - * 0b01..Output is forced to logic 1 state prior to consideration of output polarity control. - * 0b10, 0b11..Output is put in a high-impedance state. - */ -#define PWM_OCTRL_PWMXFS(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_PWMXFS_SHIFT)) & PWM_OCTRL_PWMXFS_MASK) - -#define PWM_OCTRL_PWMBFS_MASK (0xCU) -#define PWM_OCTRL_PWMBFS_SHIFT (2U) -/*! PWMBFS - PWM_B Fault State - * 0b00..Output is forced to logic 0 state prior to consideration of output polarity control. - * 0b01..Output is forced to logic 1 state prior to consideration of output polarity control. - * 0b10, 0b11..Output is put in a high-impedance state. - */ -#define PWM_OCTRL_PWMBFS(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_PWMBFS_SHIFT)) & PWM_OCTRL_PWMBFS_MASK) - -#define PWM_OCTRL_PWMAFS_MASK (0x30U) -#define PWM_OCTRL_PWMAFS_SHIFT (4U) -/*! PWMAFS - PWM_A Fault State - * 0b00..Output is forced to logic 0 state prior to consideration of output polarity control. - * 0b01..Output is forced to logic 1 state prior to consideration of output polarity control. - * 0b10, 0b11..Output is put in a high-impedance state. - */ -#define PWM_OCTRL_PWMAFS(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_PWMAFS_SHIFT)) & PWM_OCTRL_PWMAFS_MASK) - -#define PWM_OCTRL_POLX_MASK (0x100U) -#define PWM_OCTRL_POLX_SHIFT (8U) -/*! POLX - PWM_X Output Polarity - * 0b0..PWM_X output not inverted. A high level on the PWM_X pin represents the "on" or "active" state. - * 0b1..PWM_X output inverted. A low level on the PWM_X pin represents the "on" or "active" state. - */ -#define PWM_OCTRL_POLX(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_POLX_SHIFT)) & PWM_OCTRL_POLX_MASK) - -#define PWM_OCTRL_POLB_MASK (0x200U) -#define PWM_OCTRL_POLB_SHIFT (9U) -/*! POLB - PWM_B Output Polarity - * 0b0..PWM_B output not inverted. A high level on the PWM_B pin represents the "on" or "active" state. - * 0b1..PWM_B output inverted. A low level on the PWM_B pin represents the "on" or "active" state. - */ -#define PWM_OCTRL_POLB(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_POLB_SHIFT)) & PWM_OCTRL_POLB_MASK) - -#define PWM_OCTRL_POLA_MASK (0x400U) -#define PWM_OCTRL_POLA_SHIFT (10U) -/*! POLA - PWM_A Output Polarity - * 0b0..PWM_A output not inverted. A high level on the PWM_A pin represents the "on" or "active" state. - * 0b1..PWM_A output inverted. A low level on the PWM_A pin represents the "on" or "active" state. - */ -#define PWM_OCTRL_POLA(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_POLA_SHIFT)) & PWM_OCTRL_POLA_MASK) - -#define PWM_OCTRL_PWMX_IN_MASK (0x2000U) -#define PWM_OCTRL_PWMX_IN_SHIFT (13U) -/*! PWMX_IN - PWM_X Input */ -#define PWM_OCTRL_PWMX_IN(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_PWMX_IN_SHIFT)) & PWM_OCTRL_PWMX_IN_MASK) - -#define PWM_OCTRL_PWMB_IN_MASK (0x4000U) -#define PWM_OCTRL_PWMB_IN_SHIFT (14U) -/*! PWMB_IN - PWM_B Input */ -#define PWM_OCTRL_PWMB_IN(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_PWMB_IN_SHIFT)) & PWM_OCTRL_PWMB_IN_MASK) - -#define PWM_OCTRL_PWMA_IN_MASK (0x8000U) -#define PWM_OCTRL_PWMA_IN_SHIFT (15U) -/*! PWMA_IN - PWM_A Input */ -#define PWM_OCTRL_PWMA_IN(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_PWMA_IN_SHIFT)) & PWM_OCTRL_PWMA_IN_MASK) -/*! @} */ - -/* The count of PWM_OCTRL */ -#define PWM_OCTRL_COUNT (4U) - -/*! @name STS - Status Register */ -/*! @{ */ - -#define PWM_STS_CMPF_MASK (0x3FU) -#define PWM_STS_CMPF_SHIFT (0U) -/*! CMPF - Compare Flags - * 0b000000..No compare event has occurred for a particular VALx value. - * 0b000001..A compare event has occurred for a particular VALx value. - */ -#define PWM_STS_CMPF(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_CMPF_SHIFT)) & PWM_STS_CMPF_MASK) - -#define PWM_STS_CFX0_MASK (0x40U) -#define PWM_STS_CFX0_SHIFT (6U) -/*! CFX0 - Capture Flag X0 */ -#define PWM_STS_CFX0(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_CFX0_SHIFT)) & PWM_STS_CFX0_MASK) - -#define PWM_STS_CFX1_MASK (0x80U) -#define PWM_STS_CFX1_SHIFT (7U) -/*! CFX1 - Capture Flag X1 */ -#define PWM_STS_CFX1(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_CFX1_SHIFT)) & PWM_STS_CFX1_MASK) - -#define PWM_STS_CFB0_MASK (0x100U) -#define PWM_STS_CFB0_SHIFT (8U) -/*! CFB0 - Capture Flag B0 */ -#define PWM_STS_CFB0(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_CFB0_SHIFT)) & PWM_STS_CFB0_MASK) - -#define PWM_STS_CFB1_MASK (0x200U) -#define PWM_STS_CFB1_SHIFT (9U) -/*! CFB1 - Capture Flag B1 */ -#define PWM_STS_CFB1(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_CFB1_SHIFT)) & PWM_STS_CFB1_MASK) - -#define PWM_STS_CFA0_MASK (0x400U) -#define PWM_STS_CFA0_SHIFT (10U) -/*! CFA0 - Capture Flag A0 */ -#define PWM_STS_CFA0(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_CFA0_SHIFT)) & PWM_STS_CFA0_MASK) - -#define PWM_STS_CFA1_MASK (0x800U) -#define PWM_STS_CFA1_SHIFT (11U) -/*! CFA1 - Capture Flag A1 */ -#define PWM_STS_CFA1(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_CFA1_SHIFT)) & PWM_STS_CFA1_MASK) - -#define PWM_STS_RF_MASK (0x1000U) -#define PWM_STS_RF_SHIFT (12U) -/*! RF - Reload Flag - * 0b0..No new reload cycle since last STS[RF] clearing - * 0b1..New reload cycle since last STS[RF] clearing - */ -#define PWM_STS_RF(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_RF_SHIFT)) & PWM_STS_RF_MASK) - -#define PWM_STS_REF_MASK (0x2000U) -#define PWM_STS_REF_SHIFT (13U) -/*! REF - Reload Error Flag - * 0b0..No reload error occurred. - * 0b1..Reload signal occurred with non-coherent data and MCTRL[LDOK] = 0. - */ -#define PWM_STS_REF(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_REF_SHIFT)) & PWM_STS_REF_MASK) - -#define PWM_STS_RUF_MASK (0x4000U) -#define PWM_STS_RUF_SHIFT (14U) -/*! RUF - Registers Updated Flag - * 0b0..No register update has occurred since last reload. - * 0b1..At least one of the double buffered registers has been updated since the last reload. - */ -#define PWM_STS_RUF(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_RUF_SHIFT)) & PWM_STS_RUF_MASK) -/*! @} */ - -/* The count of PWM_STS */ -#define PWM_STS_COUNT (4U) - -/*! @name INTEN - Interrupt Enable Register */ -/*! @{ */ - -#define PWM_INTEN_CMPIE_MASK (0x3FU) -#define PWM_INTEN_CMPIE_SHIFT (0U) -/*! CMPIE - Compare Interrupt Enables - * 0b000000..The corresponding STS[CMPF] bit will not cause an interrupt request. - * 0b000001..The corresponding STS[CMPF] bit will cause an interrupt request. - */ -#define PWM_INTEN_CMPIE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_CMPIE_SHIFT)) & PWM_INTEN_CMPIE_MASK) - -#define PWM_INTEN_CX0IE_MASK (0x40U) -#define PWM_INTEN_CX0IE_SHIFT (6U) -/*! CX0IE - Capture X 0 Interrupt Enable - * 0b0..Interrupt request disabled for STS[CFX0]. - * 0b1..Interrupt request enabled for STS[CFX0]. - */ -#define PWM_INTEN_CX0IE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_CX0IE_SHIFT)) & PWM_INTEN_CX0IE_MASK) - -#define PWM_INTEN_CX1IE_MASK (0x80U) -#define PWM_INTEN_CX1IE_SHIFT (7U) -/*! CX1IE - Capture X 1 Interrupt Enable - * 0b0..Interrupt request disabled for STS[CFX1]. - * 0b1..Interrupt request enabled for STS[CFX1]. - */ -#define PWM_INTEN_CX1IE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_CX1IE_SHIFT)) & PWM_INTEN_CX1IE_MASK) - -#define PWM_INTEN_CB0IE_MASK (0x100U) -#define PWM_INTEN_CB0IE_SHIFT (8U) -/*! CB0IE - Capture B 0 Interrupt Enable - * 0b0..Interrupt request disabled for STS[CFB0]. - * 0b1..Interrupt request enabled for STS[CFB0]. - */ -#define PWM_INTEN_CB0IE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_CB0IE_SHIFT)) & PWM_INTEN_CB0IE_MASK) - -#define PWM_INTEN_CB1IE_MASK (0x200U) -#define PWM_INTEN_CB1IE_SHIFT (9U) -/*! CB1IE - Capture B 1 Interrupt Enable - * 0b0..Interrupt request disabled for STS[CFB1]. - * 0b1..Interrupt request enabled for STS[CFB1]. - */ -#define PWM_INTEN_CB1IE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_CB1IE_SHIFT)) & PWM_INTEN_CB1IE_MASK) - -#define PWM_INTEN_CA0IE_MASK (0x400U) -#define PWM_INTEN_CA0IE_SHIFT (10U) -/*! CA0IE - Capture A 0 Interrupt Enable - * 0b0..Interrupt request disabled for STS[CFA0]. - * 0b1..Interrupt request enabled for STS[CFA0]. - */ -#define PWM_INTEN_CA0IE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_CA0IE_SHIFT)) & PWM_INTEN_CA0IE_MASK) - -#define PWM_INTEN_CA1IE_MASK (0x800U) -#define PWM_INTEN_CA1IE_SHIFT (11U) -/*! CA1IE - Capture A 1 Interrupt Enable - * 0b0..Interrupt request disabled for STS[CFA1] - * 0b1..Interrupt request enabled for STS[CFA1] - */ -#define PWM_INTEN_CA1IE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_CA1IE_SHIFT)) & PWM_INTEN_CA1IE_MASK) - -#define PWM_INTEN_RIE_MASK (0x1000U) -#define PWM_INTEN_RIE_SHIFT (12U) -/*! RIE - Reload Interrupt Enable - * 0b0..STS[RF] CPU interrupt requests disabled - * 0b1..STS[RF] CPU interrupt requests enabled - */ -#define PWM_INTEN_RIE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_RIE_SHIFT)) & PWM_INTEN_RIE_MASK) - -#define PWM_INTEN_REIE_MASK (0x2000U) -#define PWM_INTEN_REIE_SHIFT (13U) -/*! REIE - Reload Error Interrupt Enable - * 0b0..STS[REF] CPU interrupt requests disabled - * 0b1..STS[REF] CPU interrupt requests enabled - */ -#define PWM_INTEN_REIE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_REIE_SHIFT)) & PWM_INTEN_REIE_MASK) -/*! @} */ - -/* The count of PWM_INTEN */ -#define PWM_INTEN_COUNT (4U) - -/*! @name DMAEN - DMA Enable Register */ -/*! @{ */ - -#define PWM_DMAEN_CX0DE_MASK (0x1U) -#define PWM_DMAEN_CX0DE_SHIFT (0U) -/*! CX0DE - Capture X0 FIFO DMA Enable */ -#define PWM_DMAEN_CX0DE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_CX0DE_SHIFT)) & PWM_DMAEN_CX0DE_MASK) - -#define PWM_DMAEN_CX1DE_MASK (0x2U) -#define PWM_DMAEN_CX1DE_SHIFT (1U) -/*! CX1DE - Capture X1 FIFO DMA Enable */ -#define PWM_DMAEN_CX1DE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_CX1DE_SHIFT)) & PWM_DMAEN_CX1DE_MASK) - -#define PWM_DMAEN_CB0DE_MASK (0x4U) -#define PWM_DMAEN_CB0DE_SHIFT (2U) -/*! CB0DE - Capture B0 FIFO DMA Enable */ -#define PWM_DMAEN_CB0DE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_CB0DE_SHIFT)) & PWM_DMAEN_CB0DE_MASK) - -#define PWM_DMAEN_CB1DE_MASK (0x8U) -#define PWM_DMAEN_CB1DE_SHIFT (3U) -/*! CB1DE - Capture B1 FIFO DMA Enable */ -#define PWM_DMAEN_CB1DE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_CB1DE_SHIFT)) & PWM_DMAEN_CB1DE_MASK) - -#define PWM_DMAEN_CA0DE_MASK (0x10U) -#define PWM_DMAEN_CA0DE_SHIFT (4U) -/*! CA0DE - Capture A0 FIFO DMA Enable */ -#define PWM_DMAEN_CA0DE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_CA0DE_SHIFT)) & PWM_DMAEN_CA0DE_MASK) - -#define PWM_DMAEN_CA1DE_MASK (0x20U) -#define PWM_DMAEN_CA1DE_SHIFT (5U) -/*! CA1DE - Capture A1 FIFO DMA Enable */ -#define PWM_DMAEN_CA1DE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_CA1DE_SHIFT)) & PWM_DMAEN_CA1DE_MASK) - -#define PWM_DMAEN_CAPTDE_MASK (0xC0U) -#define PWM_DMAEN_CAPTDE_SHIFT (6U) -/*! CAPTDE - Capture DMA Enable Source Select - * 0b00..Read DMA requests disabled. - * 0b01..Exceeding a FIFO watermark sets the DMA read request. This requires at least one of DMAEN[CA1DE], - * DMAEN[CA0DE], DMAEN[CB1DE], DMAEN[CB0DE], DMAEN[CX1DE], or DMAEN[CX0DE] to be set to determine which - * watermark(s) the DMA request is sensitive. - * 0b10..A local synchronization (VAL1 matches counter) sets the read DMA request. - * 0b11..A local reload (STS[RF] being set) sets the read DMA request. - */ -#define PWM_DMAEN_CAPTDE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_CAPTDE_SHIFT)) & PWM_DMAEN_CAPTDE_MASK) - -#define PWM_DMAEN_FAND_MASK (0x100U) -#define PWM_DMAEN_FAND_SHIFT (8U) -/*! FAND - FIFO Watermark AND Control - * 0b0..Selected FIFO watermarks are OR'ed together. - * 0b1..Selected FIFO watermarks are AND'ed together. - */ -#define PWM_DMAEN_FAND(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_FAND_SHIFT)) & PWM_DMAEN_FAND_MASK) - -#define PWM_DMAEN_VALDE_MASK (0x200U) -#define PWM_DMAEN_VALDE_SHIFT (9U) -/*! VALDE - Value Registers DMA Enable - * 0b0..DMA write requests disabled - * 0b1..Enabled - */ -#define PWM_DMAEN_VALDE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_VALDE_SHIFT)) & PWM_DMAEN_VALDE_MASK) -/*! @} */ - -/* The count of PWM_DMAEN */ -#define PWM_DMAEN_COUNT (4U) - -/*! @name TCTRL - Output Trigger Control Register */ -/*! @{ */ - -#define PWM_TCTRL_OUT_TRIG_EN_MASK (0x3FU) -#define PWM_TCTRL_OUT_TRIG_EN_SHIFT (0U) -/*! OUT_TRIG_EN - Output Trigger Enables - * 0bxxxxx1..PWM_OUT_TRIG0 will set when the counter value matches the VAL0 value. - * 0bxxxx1x..PWM_OUT_TRIG1 will set when the counter value matches the VAL1 value. - * 0bxxx1xx..PWM_OUT_TRIG0 will set when the counter value matches the VAL2 value. - * 0bxx1xxx..PWM_OUT_TRIG1 will set when the counter value matches the VAL3 value. - * 0bx1xxxx..PWM_OUT_TRIG0 will set when the counter value matches the VAL4 value. - * 0b1xxxxx..PWM_OUT_TRIG1 will set when the counter value matches the VAL5 value. - */ -#define PWM_TCTRL_OUT_TRIG_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_TCTRL_OUT_TRIG_EN_SHIFT)) & PWM_TCTRL_OUT_TRIG_EN_MASK) - -#define PWM_TCTRL_TRGFRQ_MASK (0x1000U) -#define PWM_TCTRL_TRGFRQ_SHIFT (12U) -/*! TRGFRQ - Trigger Frequency - * 0b0..Trigger outputs are generated during every PWM period even if the PWM is not reloaded every period due to CTRL[LDFQ] being non-zero. - * 0b1..Trigger outputs are generated only during the final PWM period prior to a reload opportunity when the PWM - * is not reloaded every period due to CTRL[LDFQ] being non-zero. - */ -#define PWM_TCTRL_TRGFRQ(x) (((uint16_t)(((uint16_t)(x)) << PWM_TCTRL_TRGFRQ_SHIFT)) & PWM_TCTRL_TRGFRQ_MASK) - -#define PWM_TCTRL_PWBOT1_MASK (0x4000U) -#define PWM_TCTRL_PWBOT1_SHIFT (14U) -/*! PWBOT1 - Mux Output Trigger 1 Source Select - * 0b0..Route the PWM_OUT_TRIG1 signal to PWM_MUX_TRIG1 port. - * 0b1..Route the PWM_B output to the PWM_MUX_TRIG1 port. - */ -#define PWM_TCTRL_PWBOT1(x) (((uint16_t)(((uint16_t)(x)) << PWM_TCTRL_PWBOT1_SHIFT)) & PWM_TCTRL_PWBOT1_MASK) - -#define PWM_TCTRL_PWAOT0_MASK (0x8000U) -#define PWM_TCTRL_PWAOT0_SHIFT (15U) -/*! PWAOT0 - Mux Output Trigger 0 Source Select - * 0b0..Route the PWM_OUT_TRIG0 signal to PWM_MUX_TRIG0 port. - * 0b1..Route the PWM_A output to the PWM_MUX_TRIG0 port. - */ -#define PWM_TCTRL_PWAOT0(x) (((uint16_t)(((uint16_t)(x)) << PWM_TCTRL_PWAOT0_SHIFT)) & PWM_TCTRL_PWAOT0_MASK) -/*! @} */ - -/* The count of PWM_TCTRL */ -#define PWM_TCTRL_COUNT (4U) - -/*! @name DISMAP - Fault Disable Mapping Register 0 */ -/*! @{ */ - -#define PWM_DISMAP_DIS0A_MASK (0xFU) -#define PWM_DISMAP_DIS0A_SHIFT (0U) -/*! DIS0A - PWM_A Fault Disable Mask 0 */ -#define PWM_DISMAP_DIS0A(x) (((uint16_t)(((uint16_t)(x)) << PWM_DISMAP_DIS0A_SHIFT)) & PWM_DISMAP_DIS0A_MASK) - -#define PWM_DISMAP_DIS0B_MASK (0xF0U) -#define PWM_DISMAP_DIS0B_SHIFT (4U) -/*! DIS0B - PWM_B Fault Disable Mask 0 */ -#define PWM_DISMAP_DIS0B(x) (((uint16_t)(((uint16_t)(x)) << PWM_DISMAP_DIS0B_SHIFT)) & PWM_DISMAP_DIS0B_MASK) - -#define PWM_DISMAP_DIS0X_MASK (0xF00U) -#define PWM_DISMAP_DIS0X_SHIFT (8U) -/*! DIS0X - PWM_X Fault Disable Mask 0 */ -#define PWM_DISMAP_DIS0X(x) (((uint16_t)(((uint16_t)(x)) << PWM_DISMAP_DIS0X_SHIFT)) & PWM_DISMAP_DIS0X_MASK) -/*! @} */ - -/* The count of PWM_DISMAP */ -#define PWM_DISMAP_COUNT (4U) - -/* The count of PWM_DISMAP */ -#define PWM_DISMAP_COUNT2 (1U) - -/*! @name DTCNT0 - Deadtime Count Register 0 */ -/*! @{ */ - -#define PWM_DTCNT0_DTCNT0_MASK (0x7FFU) -#define PWM_DTCNT0_DTCNT0_SHIFT (0U) -/*! DTCNT0 - Deadtime Count Register 0 */ -#define PWM_DTCNT0_DTCNT0(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTCNT0_DTCNT0_SHIFT)) & PWM_DTCNT0_DTCNT0_MASK) -/*! @} */ - -/* The count of PWM_DTCNT0 */ -#define PWM_DTCNT0_COUNT (4U) - -/*! @name DTCNT1 - Deadtime Count Register 1 */ -/*! @{ */ - -#define PWM_DTCNT1_DTCNT1_MASK (0x7FFU) -#define PWM_DTCNT1_DTCNT1_SHIFT (0U) -/*! DTCNT1 - Deadtime Count Register 1 */ -#define PWM_DTCNT1_DTCNT1(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTCNT1_DTCNT1_SHIFT)) & PWM_DTCNT1_DTCNT1_MASK) -/*! @} */ - -/* The count of PWM_DTCNT1 */ -#define PWM_DTCNT1_COUNT (4U) - -/*! @name CAPTCTRLA - Capture Control A Register */ -/*! @{ */ - -#define PWM_CAPTCTRLA_ARMA_MASK (0x1U) -#define PWM_CAPTCTRLA_ARMA_SHIFT (0U) -/*! ARMA - Arm A - * 0b0..Input capture operation is disabled. - * 0b1..Input capture operation as specified by CAPTCTRLA[EDGAx] is enabled. - */ -#define PWM_CAPTCTRLA_ARMA(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLA_ARMA_SHIFT)) & PWM_CAPTCTRLA_ARMA_MASK) - -#define PWM_CAPTCTRLA_ONESHOTA_MASK (0x2U) -#define PWM_CAPTCTRLA_ONESHOTA_SHIFT (1U) -/*! ONESHOTA - One Shot Mode A - * 0b0..Free Running - * 0b1..One Shot - */ -#define PWM_CAPTCTRLA_ONESHOTA(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLA_ONESHOTA_SHIFT)) & PWM_CAPTCTRLA_ONESHOTA_MASK) - -#define PWM_CAPTCTRLA_EDGA0_MASK (0xCU) -#define PWM_CAPTCTRLA_EDGA0_SHIFT (2U) -/*! EDGA0 - Edge A 0 - * 0b00..Disabled - * 0b01..Capture falling edges - * 0b10..Capture rising edges - * 0b11..Capture any edge - */ -#define PWM_CAPTCTRLA_EDGA0(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLA_EDGA0_SHIFT)) & PWM_CAPTCTRLA_EDGA0_MASK) - -#define PWM_CAPTCTRLA_EDGA1_MASK (0x30U) -#define PWM_CAPTCTRLA_EDGA1_SHIFT (4U) -/*! EDGA1 - Edge A 1 - * 0b00..Disabled - * 0b01..Capture falling edges - * 0b10..Capture rising edges - * 0b11..Capture any edge - */ -#define PWM_CAPTCTRLA_EDGA1(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLA_EDGA1_SHIFT)) & PWM_CAPTCTRLA_EDGA1_MASK) - -#define PWM_CAPTCTRLA_INP_SELA_MASK (0x40U) -#define PWM_CAPTCTRLA_INP_SELA_SHIFT (6U) -/*! INP_SELA - Input Select A - * 0b0..Raw PWM_A input signal selected as source. - * 0b1..Edge Counter - */ -#define PWM_CAPTCTRLA_INP_SELA(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLA_INP_SELA_SHIFT)) & PWM_CAPTCTRLA_INP_SELA_MASK) - -#define PWM_CAPTCTRLA_EDGCNTA_EN_MASK (0x80U) -#define PWM_CAPTCTRLA_EDGCNTA_EN_SHIFT (7U) -/*! EDGCNTA_EN - Edge Counter A Enable - * 0b0..Edge counter disabled and held in reset - * 0b1..Edge counter enabled - */ -#define PWM_CAPTCTRLA_EDGCNTA_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLA_EDGCNTA_EN_SHIFT)) & PWM_CAPTCTRLA_EDGCNTA_EN_MASK) - -#define PWM_CAPTCTRLA_CFAWM_MASK (0x300U) -#define PWM_CAPTCTRLA_CFAWM_SHIFT (8U) -/*! CFAWM - Capture A FIFOs Water Mark */ -#define PWM_CAPTCTRLA_CFAWM(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLA_CFAWM_SHIFT)) & PWM_CAPTCTRLA_CFAWM_MASK) - -#define PWM_CAPTCTRLA_CA0CNT_MASK (0x1C00U) -#define PWM_CAPTCTRLA_CA0CNT_SHIFT (10U) -/*! CA0CNT - Capture A0 FIFO Word Count */ -#define PWM_CAPTCTRLA_CA0CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLA_CA0CNT_SHIFT)) & PWM_CAPTCTRLA_CA0CNT_MASK) - -#define PWM_CAPTCTRLA_CA1CNT_MASK (0xE000U) -#define PWM_CAPTCTRLA_CA1CNT_SHIFT (13U) -/*! CA1CNT - Capture A1 FIFO Word Count */ -#define PWM_CAPTCTRLA_CA1CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLA_CA1CNT_SHIFT)) & PWM_CAPTCTRLA_CA1CNT_MASK) -/*! @} */ - -/* The count of PWM_CAPTCTRLA */ -#define PWM_CAPTCTRLA_COUNT (4U) - -/*! @name CAPTCOMPA - Capture Compare A Register */ -/*! @{ */ - -#define PWM_CAPTCOMPA_EDGCMPA_MASK (0xFFU) -#define PWM_CAPTCOMPA_EDGCMPA_SHIFT (0U) -/*! EDGCMPA - Edge Compare A */ -#define PWM_CAPTCOMPA_EDGCMPA(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCOMPA_EDGCMPA_SHIFT)) & PWM_CAPTCOMPA_EDGCMPA_MASK) - -#define PWM_CAPTCOMPA_EDGCNTA_MASK (0xFF00U) -#define PWM_CAPTCOMPA_EDGCNTA_SHIFT (8U) -/*! EDGCNTA - Edge Counter A */ -#define PWM_CAPTCOMPA_EDGCNTA(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCOMPA_EDGCNTA_SHIFT)) & PWM_CAPTCOMPA_EDGCNTA_MASK) -/*! @} */ - -/* The count of PWM_CAPTCOMPA */ -#define PWM_CAPTCOMPA_COUNT (4U) - -/*! @name CAPTCTRLB - Capture Control B Register */ -/*! @{ */ - -#define PWM_CAPTCTRLB_ARMB_MASK (0x1U) -#define PWM_CAPTCTRLB_ARMB_SHIFT (0U) -/*! ARMB - Arm B - * 0b0..Input capture operation is disabled. - * 0b1..Input capture operation as specified by CAPTCTRLB[EDGBx] is enabled. - */ -#define PWM_CAPTCTRLB_ARMB(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLB_ARMB_SHIFT)) & PWM_CAPTCTRLB_ARMB_MASK) - -#define PWM_CAPTCTRLB_ONESHOTB_MASK (0x2U) -#define PWM_CAPTCTRLB_ONESHOTB_SHIFT (1U) -/*! ONESHOTB - One Shot Mode B - * 0b0..Free Running - * 0b1..One Shot - */ -#define PWM_CAPTCTRLB_ONESHOTB(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLB_ONESHOTB_SHIFT)) & PWM_CAPTCTRLB_ONESHOTB_MASK) - -#define PWM_CAPTCTRLB_EDGB0_MASK (0xCU) -#define PWM_CAPTCTRLB_EDGB0_SHIFT (2U) -/*! EDGB0 - Edge B 0 - * 0b00..Disabled - * 0b01..Capture falling edges - * 0b10..Capture rising edges - * 0b11..Capture any edge - */ -#define PWM_CAPTCTRLB_EDGB0(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLB_EDGB0_SHIFT)) & PWM_CAPTCTRLB_EDGB0_MASK) - -#define PWM_CAPTCTRLB_EDGB1_MASK (0x30U) -#define PWM_CAPTCTRLB_EDGB1_SHIFT (4U) -/*! EDGB1 - Edge B 1 - * 0b00..Disabled - * 0b01..Capture falling edges - * 0b10..Capture rising edges - * 0b11..Capture any edge - */ -#define PWM_CAPTCTRLB_EDGB1(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLB_EDGB1_SHIFT)) & PWM_CAPTCTRLB_EDGB1_MASK) - -#define PWM_CAPTCTRLB_INP_SELB_MASK (0x40U) -#define PWM_CAPTCTRLB_INP_SELB_SHIFT (6U) -/*! INP_SELB - Input Select B - * 0b0..Raw PWM_B input signal selected as source. - * 0b1..Edge Counter - */ -#define PWM_CAPTCTRLB_INP_SELB(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLB_INP_SELB_SHIFT)) & PWM_CAPTCTRLB_INP_SELB_MASK) - -#define PWM_CAPTCTRLB_EDGCNTB_EN_MASK (0x80U) -#define PWM_CAPTCTRLB_EDGCNTB_EN_SHIFT (7U) -/*! EDGCNTB_EN - Edge Counter B Enable - * 0b0..Edge counter disabled and held in reset - * 0b1..Edge counter enabled - */ -#define PWM_CAPTCTRLB_EDGCNTB_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLB_EDGCNTB_EN_SHIFT)) & PWM_CAPTCTRLB_EDGCNTB_EN_MASK) - -#define PWM_CAPTCTRLB_CFBWM_MASK (0x300U) -#define PWM_CAPTCTRLB_CFBWM_SHIFT (8U) -/*! CFBWM - Capture B FIFOs Water Mark */ -#define PWM_CAPTCTRLB_CFBWM(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLB_CFBWM_SHIFT)) & PWM_CAPTCTRLB_CFBWM_MASK) - -#define PWM_CAPTCTRLB_CB0CNT_MASK (0x1C00U) -#define PWM_CAPTCTRLB_CB0CNT_SHIFT (10U) -/*! CB0CNT - Capture B0 FIFO Word Count */ -#define PWM_CAPTCTRLB_CB0CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLB_CB0CNT_SHIFT)) & PWM_CAPTCTRLB_CB0CNT_MASK) - -#define PWM_CAPTCTRLB_CB1CNT_MASK (0xE000U) -#define PWM_CAPTCTRLB_CB1CNT_SHIFT (13U) -/*! CB1CNT - Capture B1 FIFO Word Count */ -#define PWM_CAPTCTRLB_CB1CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLB_CB1CNT_SHIFT)) & PWM_CAPTCTRLB_CB1CNT_MASK) -/*! @} */ - -/* The count of PWM_CAPTCTRLB */ -#define PWM_CAPTCTRLB_COUNT (4U) - -/*! @name CAPTCOMPB - Capture Compare B Register */ -/*! @{ */ - -#define PWM_CAPTCOMPB_EDGCMPB_MASK (0xFFU) -#define PWM_CAPTCOMPB_EDGCMPB_SHIFT (0U) -/*! EDGCMPB - Edge Compare B */ -#define PWM_CAPTCOMPB_EDGCMPB(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCOMPB_EDGCMPB_SHIFT)) & PWM_CAPTCOMPB_EDGCMPB_MASK) - -#define PWM_CAPTCOMPB_EDGCNTB_MASK (0xFF00U) -#define PWM_CAPTCOMPB_EDGCNTB_SHIFT (8U) -/*! EDGCNTB - Edge Counter B */ -#define PWM_CAPTCOMPB_EDGCNTB(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCOMPB_EDGCNTB_SHIFT)) & PWM_CAPTCOMPB_EDGCNTB_MASK) -/*! @} */ - -/* The count of PWM_CAPTCOMPB */ -#define PWM_CAPTCOMPB_COUNT (4U) - -/*! @name CAPTCTRLX - Capture Control X Register */ -/*! @{ */ - -#define PWM_CAPTCTRLX_ARMX_MASK (0x1U) -#define PWM_CAPTCTRLX_ARMX_SHIFT (0U) -/*! ARMX - Arm X - * 0b0..Input capture operation is disabled. - * 0b1..Input capture operation as specified by CAPTCTRLX[EDGXx] is enabled. - */ -#define PWM_CAPTCTRLX_ARMX(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_ARMX_SHIFT)) & PWM_CAPTCTRLX_ARMX_MASK) - -#define PWM_CAPTCTRLX_ONESHOTX_MASK (0x2U) -#define PWM_CAPTCTRLX_ONESHOTX_SHIFT (1U) -/*! ONESHOTX - One Shot Mode Aux - * 0b0..Free Running - * 0b1..One Shot - */ -#define PWM_CAPTCTRLX_ONESHOTX(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_ONESHOTX_SHIFT)) & PWM_CAPTCTRLX_ONESHOTX_MASK) - -#define PWM_CAPTCTRLX_EDGX0_MASK (0xCU) -#define PWM_CAPTCTRLX_EDGX0_SHIFT (2U) -/*! EDGX0 - Edge X 0 - * 0b00..Disabled - * 0b01..Capture falling edges - * 0b10..Capture rising edges - * 0b11..Capture any edge - */ -#define PWM_CAPTCTRLX_EDGX0(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_EDGX0_SHIFT)) & PWM_CAPTCTRLX_EDGX0_MASK) - -#define PWM_CAPTCTRLX_EDGX1_MASK (0x30U) -#define PWM_CAPTCTRLX_EDGX1_SHIFT (4U) -/*! EDGX1 - Edge X 1 - * 0b00..Disabled - * 0b01..Capture falling edges - * 0b10..Capture rising edges - * 0b11..Capture any edge - */ -#define PWM_CAPTCTRLX_EDGX1(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_EDGX1_SHIFT)) & PWM_CAPTCTRLX_EDGX1_MASK) - -#define PWM_CAPTCTRLX_INP_SELX_MASK (0x40U) -#define PWM_CAPTCTRLX_INP_SELX_SHIFT (6U) -/*! INP_SELX - Input Select X - * 0b0..Raw PWM_X input signal selected as source. - * 0b1..Edge Counter - */ -#define PWM_CAPTCTRLX_INP_SELX(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_INP_SELX_SHIFT)) & PWM_CAPTCTRLX_INP_SELX_MASK) - -#define PWM_CAPTCTRLX_EDGCNTX_EN_MASK (0x80U) -#define PWM_CAPTCTRLX_EDGCNTX_EN_SHIFT (7U) -/*! EDGCNTX_EN - Edge Counter X Enable - * 0b0..Edge counter disabled and held in reset - * 0b1..Edge counter enabled - */ -#define PWM_CAPTCTRLX_EDGCNTX_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_EDGCNTX_EN_SHIFT)) & PWM_CAPTCTRLX_EDGCNTX_EN_MASK) - -#define PWM_CAPTCTRLX_CFXWM_MASK (0x300U) -#define PWM_CAPTCTRLX_CFXWM_SHIFT (8U) -/*! CFXWM - Capture X FIFOs Water Mark */ -#define PWM_CAPTCTRLX_CFXWM(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_CFXWM_SHIFT)) & PWM_CAPTCTRLX_CFXWM_MASK) - -#define PWM_CAPTCTRLX_CX0CNT_MASK (0x1C00U) -#define PWM_CAPTCTRLX_CX0CNT_SHIFT (10U) -/*! CX0CNT - Capture X0 FIFO Word Count */ -#define PWM_CAPTCTRLX_CX0CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_CX0CNT_SHIFT)) & PWM_CAPTCTRLX_CX0CNT_MASK) - -#define PWM_CAPTCTRLX_CX1CNT_MASK (0xE000U) -#define PWM_CAPTCTRLX_CX1CNT_SHIFT (13U) -/*! CX1CNT - Capture X1 FIFO Word Count */ -#define PWM_CAPTCTRLX_CX1CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_CX1CNT_SHIFT)) & PWM_CAPTCTRLX_CX1CNT_MASK) -/*! @} */ - -/* The count of PWM_CAPTCTRLX */ -#define PWM_CAPTCTRLX_COUNT (4U) - -/*! @name CAPTCOMPX - Capture Compare X Register */ -/*! @{ */ - -#define PWM_CAPTCOMPX_EDGCMPX_MASK (0xFFU) -#define PWM_CAPTCOMPX_EDGCMPX_SHIFT (0U) -/*! EDGCMPX - Edge Compare X */ -#define PWM_CAPTCOMPX_EDGCMPX(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCOMPX_EDGCMPX_SHIFT)) & PWM_CAPTCOMPX_EDGCMPX_MASK) - -#define PWM_CAPTCOMPX_EDGCNTX_MASK (0xFF00U) -#define PWM_CAPTCOMPX_EDGCNTX_SHIFT (8U) -/*! EDGCNTX - Edge Counter X */ -#define PWM_CAPTCOMPX_EDGCNTX(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCOMPX_EDGCNTX_SHIFT)) & PWM_CAPTCOMPX_EDGCNTX_MASK) -/*! @} */ - -/* The count of PWM_CAPTCOMPX */ -#define PWM_CAPTCOMPX_COUNT (4U) - -/*! @name CVAL0 - Capture Value 0 Register */ -/*! @{ */ - -#define PWM_CVAL0_CAPTVAL0_MASK (0xFFFFU) -#define PWM_CVAL0_CAPTVAL0_SHIFT (0U) -/*! CAPTVAL0 - Capture Value 0 */ -#define PWM_CVAL0_CAPTVAL0(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL0_CAPTVAL0_SHIFT)) & PWM_CVAL0_CAPTVAL0_MASK) -/*! @} */ - -/* The count of PWM_CVAL0 */ -#define PWM_CVAL0_COUNT (4U) - -/*! @name CVAL0CYC - Capture Value 0 Cycle Register */ -/*! @{ */ - -#define PWM_CVAL0CYC_CVAL0CYC_MASK (0xFU) -#define PWM_CVAL0CYC_CVAL0CYC_SHIFT (0U) -/*! CVAL0CYC - Capture Value 0 Cycle */ -#define PWM_CVAL0CYC_CVAL0CYC(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL0CYC_CVAL0CYC_SHIFT)) & PWM_CVAL0CYC_CVAL0CYC_MASK) -/*! @} */ - -/* The count of PWM_CVAL0CYC */ -#define PWM_CVAL0CYC_COUNT (4U) - -/*! @name CVAL1 - Capture Value 1 Register */ -/*! @{ */ - -#define PWM_CVAL1_CAPTVAL1_MASK (0xFFFFU) -#define PWM_CVAL1_CAPTVAL1_SHIFT (0U) -/*! CAPTVAL1 - Capture Value 1 */ -#define PWM_CVAL1_CAPTVAL1(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL1_CAPTVAL1_SHIFT)) & PWM_CVAL1_CAPTVAL1_MASK) -/*! @} */ - -/* The count of PWM_CVAL1 */ -#define PWM_CVAL1_COUNT (4U) - -/*! @name CVAL1CYC - Capture Value 1 Cycle Register */ -/*! @{ */ - -#define PWM_CVAL1CYC_CVAL1CYC_MASK (0xFU) -#define PWM_CVAL1CYC_CVAL1CYC_SHIFT (0U) -/*! CVAL1CYC - Capture Value 1 Cycle */ -#define PWM_CVAL1CYC_CVAL1CYC(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL1CYC_CVAL1CYC_SHIFT)) & PWM_CVAL1CYC_CVAL1CYC_MASK) -/*! @} */ - -/* The count of PWM_CVAL1CYC */ -#define PWM_CVAL1CYC_COUNT (4U) - -/*! @name CVAL2 - Capture Value 2 Register */ -/*! @{ */ - -#define PWM_CVAL2_CAPTVAL2_MASK (0xFFFFU) -#define PWM_CVAL2_CAPTVAL2_SHIFT (0U) -/*! CAPTVAL2 - Capture Value 2 */ -#define PWM_CVAL2_CAPTVAL2(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL2_CAPTVAL2_SHIFT)) & PWM_CVAL2_CAPTVAL2_MASK) -/*! @} */ - -/* The count of PWM_CVAL2 */ -#define PWM_CVAL2_COUNT (4U) - -/*! @name CVAL2CYC - Capture Value 2 Cycle Register */ -/*! @{ */ - -#define PWM_CVAL2CYC_CVAL2CYC_MASK (0xFU) -#define PWM_CVAL2CYC_CVAL2CYC_SHIFT (0U) -/*! CVAL2CYC - Capture Value 2 Cycle */ -#define PWM_CVAL2CYC_CVAL2CYC(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL2CYC_CVAL2CYC_SHIFT)) & PWM_CVAL2CYC_CVAL2CYC_MASK) -/*! @} */ - -/* The count of PWM_CVAL2CYC */ -#define PWM_CVAL2CYC_COUNT (4U) - -/*! @name CVAL3 - Capture Value 3 Register */ -/*! @{ */ - -#define PWM_CVAL3_CAPTVAL3_MASK (0xFFFFU) -#define PWM_CVAL3_CAPTVAL3_SHIFT (0U) -/*! CAPTVAL3 - Capture Value 3 */ -#define PWM_CVAL3_CAPTVAL3(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL3_CAPTVAL3_SHIFT)) & PWM_CVAL3_CAPTVAL3_MASK) -/*! @} */ - -/* The count of PWM_CVAL3 */ -#define PWM_CVAL3_COUNT (4U) - -/*! @name CVAL3CYC - Capture Value 3 Cycle Register */ -/*! @{ */ - -#define PWM_CVAL3CYC_CVAL3CYC_MASK (0xFU) -#define PWM_CVAL3CYC_CVAL3CYC_SHIFT (0U) -/*! CVAL3CYC - Capture Value 3 Cycle */ -#define PWM_CVAL3CYC_CVAL3CYC(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL3CYC_CVAL3CYC_SHIFT)) & PWM_CVAL3CYC_CVAL3CYC_MASK) -/*! @} */ - -/* The count of PWM_CVAL3CYC */ -#define PWM_CVAL3CYC_COUNT (4U) - -/*! @name CVAL4 - Capture Value 4 Register */ -/*! @{ */ - -#define PWM_CVAL4_CAPTVAL4_MASK (0xFFFFU) -#define PWM_CVAL4_CAPTVAL4_SHIFT (0U) -/*! CAPTVAL4 - Capture Value 4 */ -#define PWM_CVAL4_CAPTVAL4(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL4_CAPTVAL4_SHIFT)) & PWM_CVAL4_CAPTVAL4_MASK) -/*! @} */ - -/* The count of PWM_CVAL4 */ -#define PWM_CVAL4_COUNT (4U) - -/*! @name CVAL4CYC - Capture Value 4 Cycle Register */ -/*! @{ */ - -#define PWM_CVAL4CYC_CVAL4CYC_MASK (0xFU) -#define PWM_CVAL4CYC_CVAL4CYC_SHIFT (0U) -/*! CVAL4CYC - Capture Value 4 Cycle */ -#define PWM_CVAL4CYC_CVAL4CYC(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL4CYC_CVAL4CYC_SHIFT)) & PWM_CVAL4CYC_CVAL4CYC_MASK) -/*! @} */ - -/* The count of PWM_CVAL4CYC */ -#define PWM_CVAL4CYC_COUNT (4U) - -/*! @name CVAL5 - Capture Value 5 Register */ -/*! @{ */ - -#define PWM_CVAL5_CAPTVAL5_MASK (0xFFFFU) -#define PWM_CVAL5_CAPTVAL5_SHIFT (0U) -/*! CAPTVAL5 - Capture Value 5 */ -#define PWM_CVAL5_CAPTVAL5(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL5_CAPTVAL5_SHIFT)) & PWM_CVAL5_CAPTVAL5_MASK) -/*! @} */ - -/* The count of PWM_CVAL5 */ -#define PWM_CVAL5_COUNT (4U) - -/*! @name CVAL5CYC - Capture Value 5 Cycle Register */ -/*! @{ */ - -#define PWM_CVAL5CYC_CVAL5CYC_MASK (0xFU) -#define PWM_CVAL5CYC_CVAL5CYC_SHIFT (0U) -/*! CVAL5CYC - Capture Value 5 Cycle */ -#define PWM_CVAL5CYC_CVAL5CYC(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL5CYC_CVAL5CYC_SHIFT)) & PWM_CVAL5CYC_CVAL5CYC_MASK) -/*! @} */ - -/* The count of PWM_CVAL5CYC */ -#define PWM_CVAL5CYC_COUNT (4U) - -/*! @name PHASEDLY - Phase Delay Register */ -/*! @{ */ - -#define PWM_PHASEDLY_PHASEDLY_MASK (0xFFFFU) -#define PWM_PHASEDLY_PHASEDLY_SHIFT (0U) -/*! PHASEDLY - Initial Count Register Bits */ -#define PWM_PHASEDLY_PHASEDLY(x) (((uint16_t)(((uint16_t)(x)) << PWM_PHASEDLY_PHASEDLY_SHIFT)) & PWM_PHASEDLY_PHASEDLY_MASK) -/*! @} */ - -/* The count of PWM_PHASEDLY */ -#define PWM_PHASEDLY_COUNT (4U) - -/*! @name CAPTFILTA - Capture PWM_A Input Filter Register */ -/*! @{ */ - -#define PWM_CAPTFILTA_CAPTA_FILT_PER_MASK (0xFFU) -#define PWM_CAPTFILTA_CAPTA_FILT_PER_SHIFT (0U) -/*! CAPTA_FILT_PER - Input Capture Filter Period */ -#define PWM_CAPTFILTA_CAPTA_FILT_PER(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTFILTA_CAPTA_FILT_PER_SHIFT)) & PWM_CAPTFILTA_CAPTA_FILT_PER_MASK) - -#define PWM_CAPTFILTA_CAPTA_FILT_CNT_MASK (0x700U) -#define PWM_CAPTFILTA_CAPTA_FILT_CNT_SHIFT (8U) -/*! CAPTA_FILT_CNT - Input Capture Filter Count */ -#define PWM_CAPTFILTA_CAPTA_FILT_CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTFILTA_CAPTA_FILT_CNT_SHIFT)) & PWM_CAPTFILTA_CAPTA_FILT_CNT_MASK) -/*! @} */ - -/* The count of PWM_CAPTFILTA */ -#define PWM_CAPTFILTA_COUNT (4U) - -/*! @name CAPTFILTB - Capture PWM_B Input Filter Register */ -/*! @{ */ - -#define PWM_CAPTFILTB_CAPTB_FILT_PER_MASK (0xFFU) -#define PWM_CAPTFILTB_CAPTB_FILT_PER_SHIFT (0U) -/*! CAPTB_FILT_PER - Input Capture Filter Period */ -#define PWM_CAPTFILTB_CAPTB_FILT_PER(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTFILTB_CAPTB_FILT_PER_SHIFT)) & PWM_CAPTFILTB_CAPTB_FILT_PER_MASK) - -#define PWM_CAPTFILTB_CAPTB_FILT_CNT_MASK (0x700U) -#define PWM_CAPTFILTB_CAPTB_FILT_CNT_SHIFT (8U) -/*! CAPTB_FILT_CNT - Input Capture Filter Count */ -#define PWM_CAPTFILTB_CAPTB_FILT_CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTFILTB_CAPTB_FILT_CNT_SHIFT)) & PWM_CAPTFILTB_CAPTB_FILT_CNT_MASK) -/*! @} */ - -/* The count of PWM_CAPTFILTB */ -#define PWM_CAPTFILTB_COUNT (4U) - -/*! @name CAPTFILTX - Capture PWM_X Input Filter Register */ -/*! @{ */ - -#define PWM_CAPTFILTX_CAPTX_FILT_PER_MASK (0xFFU) -#define PWM_CAPTFILTX_CAPTX_FILT_PER_SHIFT (0U) -/*! CAPTX_FILT_PER - Input Capture Filter Period */ -#define PWM_CAPTFILTX_CAPTX_FILT_PER(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTFILTX_CAPTX_FILT_PER_SHIFT)) & PWM_CAPTFILTX_CAPTX_FILT_PER_MASK) - -#define PWM_CAPTFILTX_CAPTX_FILT_CNT_MASK (0x700U) -#define PWM_CAPTFILTX_CAPTX_FILT_CNT_SHIFT (8U) -/*! CAPTX_FILT_CNT - Input Capture Filter Count */ -#define PWM_CAPTFILTX_CAPTX_FILT_CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTFILTX_CAPTX_FILT_CNT_SHIFT)) & PWM_CAPTFILTX_CAPTX_FILT_CNT_MASK) -/*! @} */ - -/* The count of PWM_CAPTFILTX */ -#define PWM_CAPTFILTX_COUNT (4U) - -/*! @name OUTEN - Output Enable Register */ -/*! @{ */ - -#define PWM_OUTEN_PWMX_EN_MASK (0xFU) -#define PWM_OUTEN_PWMX_EN_SHIFT (0U) -/*! PWMX_EN - PWM_X Output Enables */ -#define PWM_OUTEN_PWMX_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_OUTEN_PWMX_EN_SHIFT)) & PWM_OUTEN_PWMX_EN_MASK) - -#define PWM_OUTEN_PWMB_EN_MASK (0xF0U) -#define PWM_OUTEN_PWMB_EN_SHIFT (4U) -/*! PWMB_EN - PWM_B Output Enables */ -#define PWM_OUTEN_PWMB_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_OUTEN_PWMB_EN_SHIFT)) & PWM_OUTEN_PWMB_EN_MASK) - -#define PWM_OUTEN_PWMA_EN_MASK (0xF00U) -#define PWM_OUTEN_PWMA_EN_SHIFT (8U) -/*! PWMA_EN - PWM_A Output Enables */ -#define PWM_OUTEN_PWMA_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_OUTEN_PWMA_EN_SHIFT)) & PWM_OUTEN_PWMA_EN_MASK) -/*! @} */ - -/*! @name MASK - Mask Register */ -/*! @{ */ - -#define PWM_MASK_MASKX_MASK (0xFU) -#define PWM_MASK_MASKX_SHIFT (0U) -/*! MASKX - PWM_X Masks */ -#define PWM_MASK_MASKX(x) (((uint16_t)(((uint16_t)(x)) << PWM_MASK_MASKX_SHIFT)) & PWM_MASK_MASKX_MASK) - -#define PWM_MASK_MASKB_MASK (0xF0U) -#define PWM_MASK_MASKB_SHIFT (4U) -/*! MASKB - PWM_B Masks */ -#define PWM_MASK_MASKB(x) (((uint16_t)(((uint16_t)(x)) << PWM_MASK_MASKB_SHIFT)) & PWM_MASK_MASKB_MASK) - -#define PWM_MASK_MASKA_MASK (0xF00U) -#define PWM_MASK_MASKA_SHIFT (8U) -/*! MASKA - PWM_A Masks */ -#define PWM_MASK_MASKA(x) (((uint16_t)(((uint16_t)(x)) << PWM_MASK_MASKA_SHIFT)) & PWM_MASK_MASKA_MASK) - -#define PWM_MASK_UPDATE_MASK_MASK (0xF000U) -#define PWM_MASK_UPDATE_MASK_SHIFT (12U) -/*! UPDATE_MASK - Update Mask Bits Immediately */ -#define PWM_MASK_UPDATE_MASK(x) (((uint16_t)(((uint16_t)(x)) << PWM_MASK_UPDATE_MASK_SHIFT)) & PWM_MASK_UPDATE_MASK_MASK) -/*! @} */ - -/*! @name SWCOUT - Software Controlled Output Register */ -/*! @{ */ - -#define PWM_SWCOUT_SM0OUT45_MASK (0x1U) -#define PWM_SWCOUT_SM0OUT45_SHIFT (0U) -/*! SM0OUT45 - Submodule 0 Software Controlled Output 45 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 0 instead of PWM45. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 0 instead of PWM45. - */ -#define PWM_SWCOUT_SM0OUT45(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM0OUT45_SHIFT)) & PWM_SWCOUT_SM0OUT45_MASK) - -#define PWM_SWCOUT_SM0OUT23_MASK (0x2U) -#define PWM_SWCOUT_SM0OUT23_SHIFT (1U) -/*! SM0OUT23 - Submodule 0 Software Controlled Output 23 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 0 instead of PWM23. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 0 instead of PWM23. - */ -#define PWM_SWCOUT_SM0OUT23(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM0OUT23_SHIFT)) & PWM_SWCOUT_SM0OUT23_MASK) - -#define PWM_SWCOUT_SM1OUT45_MASK (0x4U) -#define PWM_SWCOUT_SM1OUT45_SHIFT (2U) -/*! SM1OUT45 - Submodule 1 Software Controlled Output 45 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 1 instead of PWM45. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 1 instead of PWM45. - */ -#define PWM_SWCOUT_SM1OUT45(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM1OUT45_SHIFT)) & PWM_SWCOUT_SM1OUT45_MASK) - -#define PWM_SWCOUT_SM1OUT23_MASK (0x8U) -#define PWM_SWCOUT_SM1OUT23_SHIFT (3U) -/*! SM1OUT23 - Submodule 1 Software Controlled Output 23 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 1 instead of PWM23. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 1 instead of PWM23. - */ -#define PWM_SWCOUT_SM1OUT23(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM1OUT23_SHIFT)) & PWM_SWCOUT_SM1OUT23_MASK) - -#define PWM_SWCOUT_SM2OUT45_MASK (0x10U) -#define PWM_SWCOUT_SM2OUT45_SHIFT (4U) -/*! SM2OUT45 - Submodule 2 Software Controlled Output 45 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 2 instead of PWM45. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 2 instead of PWM45. - */ -#define PWM_SWCOUT_SM2OUT45(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM2OUT45_SHIFT)) & PWM_SWCOUT_SM2OUT45_MASK) - -#define PWM_SWCOUT_SM2OUT23_MASK (0x20U) -#define PWM_SWCOUT_SM2OUT23_SHIFT (5U) -/*! SM2OUT23 - Submodule 2 Software Controlled Output 23 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 2 instead of PWM23. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 2 instead of PWM23. - */ -#define PWM_SWCOUT_SM2OUT23(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM2OUT23_SHIFT)) & PWM_SWCOUT_SM2OUT23_MASK) - -#define PWM_SWCOUT_SM3OUT45_MASK (0x40U) -#define PWM_SWCOUT_SM3OUT45_SHIFT (6U) -/*! SM3OUT45 - Submodule 3 Software Controlled Output 45 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 3 instead of PWM45. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 3 instead of PWM45. - */ -#define PWM_SWCOUT_SM3OUT45(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM3OUT45_SHIFT)) & PWM_SWCOUT_SM3OUT45_MASK) - -#define PWM_SWCOUT_SM3OUT23_MASK (0x80U) -#define PWM_SWCOUT_SM3OUT23_SHIFT (7U) -/*! SM3OUT23 - Submodule 3 Software Controlled Output 23 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 3 instead of PWM23. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 3 instead of PWM23. - */ -#define PWM_SWCOUT_SM3OUT23(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM3OUT23_SHIFT)) & PWM_SWCOUT_SM3OUT23_MASK) -/*! @} */ - -/*! @name DTSRCSEL - PWM Source Select Register */ -/*! @{ */ - -#define PWM_DTSRCSEL_SM0SEL45_MASK (0x3U) -#define PWM_DTSRCSEL_SM0SEL45_SHIFT (0U) -/*! SM0SEL45 - Submodule 0 PWM45 Control Select - * 0b00..Generated SM0PWM45 signal used by the deadtime logic. - * 0b01..Inverted generated SM0PWM45 signal used by the deadtime logic. - * 0b10..SWCOUT[SM0OUT45] used by the deadtime logic. - * 0b11..Reserved - */ -#define PWM_DTSRCSEL_SM0SEL45(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM0SEL45_SHIFT)) & PWM_DTSRCSEL_SM0SEL45_MASK) - -#define PWM_DTSRCSEL_SM0SEL23_MASK (0xCU) -#define PWM_DTSRCSEL_SM0SEL23_SHIFT (2U) -/*! SM0SEL23 - Submodule 0 PWM23 Control Select - * 0b00..Generated SM0PWM23 signal used by the deadtime logic. - * 0b01..Inverted generated SM0PWM23 signal used by the deadtime logic. - * 0b10..SWCOUT[SM0OUT23] used by the deadtime logic. - * 0b11..PWM0_EXTA signal used by the deadtime logic. - */ -#define PWM_DTSRCSEL_SM0SEL23(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM0SEL23_SHIFT)) & PWM_DTSRCSEL_SM0SEL23_MASK) - -#define PWM_DTSRCSEL_SM1SEL45_MASK (0x30U) -#define PWM_DTSRCSEL_SM1SEL45_SHIFT (4U) -/*! SM1SEL45 - Submodule 1 PWM45 Control Select - * 0b00..Generated SM1PWM45 signal used by the deadtime logic. - * 0b01..Inverted generated SM1PWM45 signal used by the deadtime logic. - * 0b10..SWCOUT[SM1OUT45] used by the deadtime logic. - * 0b11..Reserved - */ -#define PWM_DTSRCSEL_SM1SEL45(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM1SEL45_SHIFT)) & PWM_DTSRCSEL_SM1SEL45_MASK) - -#define PWM_DTSRCSEL_SM1SEL23_MASK (0xC0U) -#define PWM_DTSRCSEL_SM1SEL23_SHIFT (6U) -/*! SM1SEL23 - Submodule 1 PWM23 Control Select - * 0b00..Generated SM1PWM23 signal used by the deadtime logic. - * 0b01..Inverted generated SM1PWM23 signal used by the deadtime logic. - * 0b10..SWCOUT[SM1OUT23] used by the deadtime logic. - * 0b11..PWM1_EXTA signal used by the deadtime logic. - */ -#define PWM_DTSRCSEL_SM1SEL23(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM1SEL23_SHIFT)) & PWM_DTSRCSEL_SM1SEL23_MASK) - -#define PWM_DTSRCSEL_SM2SEL45_MASK (0x300U) -#define PWM_DTSRCSEL_SM2SEL45_SHIFT (8U) -/*! SM2SEL45 - Submodule 2 PWM45 Control Select - * 0b00..Generated SM2PWM45 signal used by the deadtime logic. - * 0b01..Inverted generated SM2PWM45 signal used by the deadtime logic. - * 0b10..SWCOUT[SM2OUT45] used by the deadtime logic. - * 0b11..Reserved - */ -#define PWM_DTSRCSEL_SM2SEL45(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM2SEL45_SHIFT)) & PWM_DTSRCSEL_SM2SEL45_MASK) - -#define PWM_DTSRCSEL_SM2SEL23_MASK (0xC00U) -#define PWM_DTSRCSEL_SM2SEL23_SHIFT (10U) -/*! SM2SEL23 - Submodule 2 PWM23 Control Select - * 0b00..Generated SM2PWM23 signal used by the deadtime logic. - * 0b01..Inverted generated SM2PWM23 signal used by the deadtime logic. - * 0b10..SWCOUT[SM2OUT23] used by the deadtime logic. - * 0b11..PWM2_EXTA signal used by the deadtime logic. - */ -#define PWM_DTSRCSEL_SM2SEL23(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM2SEL23_SHIFT)) & PWM_DTSRCSEL_SM2SEL23_MASK) - -#define PWM_DTSRCSEL_SM3SEL45_MASK (0x3000U) -#define PWM_DTSRCSEL_SM3SEL45_SHIFT (12U) -/*! SM3SEL45 - Submodule 3 PWM45 Control Select - * 0b00..Generated SM3PWM45 signal used by the deadtime logic. - * 0b01..Inverted generated SM3PWM45 signal used by the deadtime logic. - * 0b10..SWCOUT[SM3OUT45] used by the deadtime logic. - * 0b11..Reserved - */ -#define PWM_DTSRCSEL_SM3SEL45(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM3SEL45_SHIFT)) & PWM_DTSRCSEL_SM3SEL45_MASK) - -#define PWM_DTSRCSEL_SM3SEL23_MASK (0xC000U) -#define PWM_DTSRCSEL_SM3SEL23_SHIFT (14U) -/*! SM3SEL23 - Submodule 3 PWM23 Control Select - * 0b00..Generated SM3PWM23 signal used by the deadtime logic. - * 0b01..Inverted generated SM3PWM23 signal used by the deadtime logic. - * 0b10..SWCOUT[SM3OUT23] used by the deadtime logic. - * 0b11..PWM3_EXTA signal used by the deadtime logic. - */ -#define PWM_DTSRCSEL_SM3SEL23(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM3SEL23_SHIFT)) & PWM_DTSRCSEL_SM3SEL23_MASK) -/*! @} */ - -/*! @name MCTRL - Master Control Register */ -/*! @{ */ - -#define PWM_MCTRL_LDOK_MASK (0xFU) -#define PWM_MCTRL_LDOK_SHIFT (0U) -/*! LDOK - Load Okay - * 0b0000..Do not load new values. - * 0b0001..Load prescaler, modulus, and PWM values of the corresponding submodule. - */ -#define PWM_MCTRL_LDOK(x) (((uint16_t)(((uint16_t)(x)) << PWM_MCTRL_LDOK_SHIFT)) & PWM_MCTRL_LDOK_MASK) - -#define PWM_MCTRL_CLDOK_MASK (0xF0U) -#define PWM_MCTRL_CLDOK_SHIFT (4U) -/*! CLDOK - Clear Load Okay */ -#define PWM_MCTRL_CLDOK(x) (((uint16_t)(((uint16_t)(x)) << PWM_MCTRL_CLDOK_SHIFT)) & PWM_MCTRL_CLDOK_MASK) - -#define PWM_MCTRL_RUN_MASK (0xF00U) -#define PWM_MCTRL_RUN_SHIFT (8U) -/*! RUN - Run - * 0b0000..PWM counter is stopped, but PWM outputs hold the current state. - * 0b0001..PWM counter is started in the corresponding submodule. - */ -#define PWM_MCTRL_RUN(x) (((uint16_t)(((uint16_t)(x)) << PWM_MCTRL_RUN_SHIFT)) & PWM_MCTRL_RUN_MASK) - -#define PWM_MCTRL_IPOL_MASK (0xF000U) -#define PWM_MCTRL_IPOL_SHIFT (12U) -/*! IPOL - Current Polarity - * 0b0000..PWM23 is used to generate complementary PWM pair in the corresponding submodule. - * 0b0001..PWM45 is used to generate complementary PWM pair in the corresponding submodule. - */ -#define PWM_MCTRL_IPOL(x) (((uint16_t)(((uint16_t)(x)) << PWM_MCTRL_IPOL_SHIFT)) & PWM_MCTRL_IPOL_MASK) -/*! @} */ - -/*! @name MCTRL2 - Master Control 2 Register */ -/*! @{ */ - -#define PWM_MCTRL2_WRPROT_MASK (0xCU) -#define PWM_MCTRL2_WRPROT_SHIFT (2U) -/*! WRPROT - Write protect - * 0b00..Write protection off (default). - * 0b01..Write protection on. - * 0b10..Write protection off and locked until chip reset. - * 0b11..Write protection on and locked until chip reset. - */ -#define PWM_MCTRL2_WRPROT(x) (((uint16_t)(((uint16_t)(x)) << PWM_MCTRL2_WRPROT_SHIFT)) & PWM_MCTRL2_WRPROT_MASK) - -#define PWM_MCTRL2_STRETCH_CNT_PRSC_MASK (0xC0U) -#define PWM_MCTRL2_STRETCH_CNT_PRSC_SHIFT (6U) -/*! STRETCH_CNT_PRSC - Stretch IPBus clock count prescaler for mux0_trig/mux1_trig/out0_trig/out1_trig/pwma_trig/pwmb_trig - * 0b00..Stretch count is zero, no stretch. - * 0b01..Stretch mux0_trig/mux1_trig/out0_trig/out1_trig/pwma_trig/pwmb_trig for 2 IPBus clock period. - * 0b10..Stretch mux0_trig/mux1_trig/out0_trig/out1_trig/pwma_trig/pwmb_trig for 4 IPBus clock period. - * 0b11..Stretch mux0_trig/mux1_trig/out0_trig/out1_trig/pwma_trig/pwmb_trig for 8 IPBus clock period. - */ -#define PWM_MCTRL2_STRETCH_CNT_PRSC(x) (((uint16_t)(((uint16_t)(x)) << PWM_MCTRL2_STRETCH_CNT_PRSC_SHIFT)) & PWM_MCTRL2_STRETCH_CNT_PRSC_MASK) -/*! @} */ - -/*! @name FCTRL - Fault Control Register */ -/*! @{ */ - -#define PWM_FCTRL_FIE_MASK (0xFU) -#define PWM_FCTRL_FIE_SHIFT (0U) -/*! FIE - Fault Interrupt Enables - * 0b0000..FAULTx CPU interrupt requests disabled. - * 0b0001..FAULTx CPU interrupt requests enabled. - */ -#define PWM_FCTRL_FIE(x) (((uint16_t)(((uint16_t)(x)) << PWM_FCTRL_FIE_SHIFT)) & PWM_FCTRL_FIE_MASK) - -#define PWM_FCTRL_FSAFE_MASK (0xF0U) -#define PWM_FCTRL_FSAFE_SHIFT (4U) -/*! FSAFE - Fault Safety Mode - * 0b0000..Normal mode. PWM outputs disabled by this fault are not enabled until FSTS[FFLAGx] is clear at the - * start of a half cycle or full cycle depending on the states of FSTS[FHALF] and FSTS[FFULL] without regard - * to the state of FSTS[FFPINx]. If neither FHALF nor FFULL is set, then the fault condition cannot be - * cleared. The PWM outputs disabled by this fault input will not be re-enabled until the actual FAULTx input - * signal de-asserts since the fault input will combinationally disable the PWM outputs (as programmed in - * DISMAPn). - * 0b0001..Safe mode. PWM outputs disabled by this fault are not enabled until FSTS[FFLAGx] is clear and - * FSTS[FFPINx] is clear at the start of a half cycle or full cycle depending on the states of FSTS[FHALF] and - * FSTS[FFULL]. If neither FHLAF nor FFULL is set, then the fault condition cannot be cleared. - */ -#define PWM_FCTRL_FSAFE(x) (((uint16_t)(((uint16_t)(x)) << PWM_FCTRL_FSAFE_SHIFT)) & PWM_FCTRL_FSAFE_MASK) - -#define PWM_FCTRL_FAUTO_MASK (0xF00U) -#define PWM_FCTRL_FAUTO_SHIFT (8U) -/*! FAUTO - Automatic Fault Clearing - * 0b0000..Manual fault clearing. PWM outputs disabled by this fault are not enabled until FSTS[FFLAGx] is clear - * at the start of a half cycle or full cycle depending on the states of FSTS[FHALF] and FSTS[FFULL]. If - * neither FFULL nor FHALF is set, then the fault condition cannot be cleared. This is further controlled - * by FCTRL[FSAFE]. - * 0b0001..Automatic fault clearing. PWM outputs disabled by this fault are enabled when FSTS[FFPINx] is clear at - * the start of a half cycle or full cycle depending on the states of FSTS[FHALF] and FSTS[FFULL] without - * regard to the state of FSTS[FFLAGx]. If neither FFULL nor FHALF is set, then the fault condition - * cannot be cleared. - */ -#define PWM_FCTRL_FAUTO(x) (((uint16_t)(((uint16_t)(x)) << PWM_FCTRL_FAUTO_SHIFT)) & PWM_FCTRL_FAUTO_MASK) - -#define PWM_FCTRL_FLVL_MASK (0xF000U) -#define PWM_FCTRL_FLVL_SHIFT (12U) -/*! FLVL - Fault Level - * 0b0000..A logic 0 on the fault input indicates a fault condition. - * 0b0001..A logic 1 on the fault input indicates a fault condition. - */ -#define PWM_FCTRL_FLVL(x) (((uint16_t)(((uint16_t)(x)) << PWM_FCTRL_FLVL_SHIFT)) & PWM_FCTRL_FLVL_MASK) -/*! @} */ - -/*! @name FSTS - Fault Status Register */ -/*! @{ */ - -#define PWM_FSTS_FFLAG_MASK (0xFU) -#define PWM_FSTS_FFLAG_SHIFT (0U) -/*! FFLAG - Fault Flags - * 0b0000..No fault on the FAULTx pin. - * 0b0001..Fault on the FAULTx pin. - */ -#define PWM_FSTS_FFLAG(x) (((uint16_t)(((uint16_t)(x)) << PWM_FSTS_FFLAG_SHIFT)) & PWM_FSTS_FFLAG_MASK) - -#define PWM_FSTS_FFULL_MASK (0xF0U) -#define PWM_FSTS_FFULL_SHIFT (4U) -/*! FFULL - Full Cycle - * 0b0000..PWM outputs are not re-enabled at the start of a full cycle - * 0b0001..PWM outputs are re-enabled at the start of a full cycle - */ -#define PWM_FSTS_FFULL(x) (((uint16_t)(((uint16_t)(x)) << PWM_FSTS_FFULL_SHIFT)) & PWM_FSTS_FFULL_MASK) - -#define PWM_FSTS_FFPIN_MASK (0xF00U) -#define PWM_FSTS_FFPIN_SHIFT (8U) -/*! FFPIN - Filtered Fault Pins */ -#define PWM_FSTS_FFPIN(x) (((uint16_t)(((uint16_t)(x)) << PWM_FSTS_FFPIN_SHIFT)) & PWM_FSTS_FFPIN_MASK) - -#define PWM_FSTS_FHALF_MASK (0xF000U) -#define PWM_FSTS_FHALF_SHIFT (12U) -/*! FHALF - Half Cycle Fault Recovery - * 0b0000..PWM outputs are not re-enabled at the start of a half cycle. - * 0b0001..PWM outputs are re-enabled at the start of a half cycle (as defined by VAL0). - */ -#define PWM_FSTS_FHALF(x) (((uint16_t)(((uint16_t)(x)) << PWM_FSTS_FHALF_SHIFT)) & PWM_FSTS_FHALF_MASK) -/*! @} */ - -/*! @name FFILT - Fault Filter Register */ -/*! @{ */ - -#define PWM_FFILT_FILT_PER_MASK (0xFFU) -#define PWM_FFILT_FILT_PER_SHIFT (0U) -/*! FILT_PER - Fault Filter Period */ -#define PWM_FFILT_FILT_PER(x) (((uint16_t)(((uint16_t)(x)) << PWM_FFILT_FILT_PER_SHIFT)) & PWM_FFILT_FILT_PER_MASK) - -#define PWM_FFILT_FILT_CNT_MASK (0x700U) -#define PWM_FFILT_FILT_CNT_SHIFT (8U) -/*! FILT_CNT - Fault Filter Count */ -#define PWM_FFILT_FILT_CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_FFILT_FILT_CNT_SHIFT)) & PWM_FFILT_FILT_CNT_MASK) - -#define PWM_FFILT_GSTR_MASK (0x8000U) -#define PWM_FFILT_GSTR_SHIFT (15U) -/*! GSTR - Fault Glitch Stretch Enable - * 0b0..Fault input glitch stretching is disabled. - * 0b1..Input fault signals are stretched to at least 2 IPBus clock cycles. - */ -#define PWM_FFILT_GSTR(x) (((uint16_t)(((uint16_t)(x)) << PWM_FFILT_GSTR_SHIFT)) & PWM_FFILT_GSTR_MASK) -/*! @} */ - -/*! @name FTST - Fault Test Register */ -/*! @{ */ - -#define PWM_FTST_FTEST_MASK (0x1U) -#define PWM_FTST_FTEST_SHIFT (0U) -/*! FTEST - Fault Test - * 0b0..No fault - * 0b1..Cause a simulated fault - */ -#define PWM_FTST_FTEST(x) (((uint16_t)(((uint16_t)(x)) << PWM_FTST_FTEST_SHIFT)) & PWM_FTST_FTEST_MASK) -/*! @} */ - -/*! @name FCTRL2 - Fault Control 2 Register */ -/*! @{ */ - -#define PWM_FCTRL2_NOCOMB_MASK (0xFU) -#define PWM_FCTRL2_NOCOMB_SHIFT (0U) -/*! NOCOMB - No Combinational Path From Fault Input To PWM Output - * 0b0000..There is a combinational link from the fault inputs to the PWM outputs. The fault inputs are combined - * with the filtered and latched fault signals to disable the PWM outputs. - * 0b0001..The direct combinational path from the fault inputs to the PWM outputs is disabled and the filtered - * and latched fault signals are used to disable the PWM outputs. - */ -#define PWM_FCTRL2_NOCOMB(x) (((uint16_t)(((uint16_t)(x)) << PWM_FCTRL2_NOCOMB_SHIFT)) & PWM_FCTRL2_NOCOMB_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group PWM_Register_Masks */ - - -/* PWM - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral PWM0 base address */ - #define PWM0_BASE (0x500CE000u) - /** Peripheral PWM0 base address */ - #define PWM0_BASE_NS (0x400CE000u) - /** Peripheral PWM0 base pointer */ - #define PWM0 ((PWM_Type *)PWM0_BASE) - /** Peripheral PWM0 base pointer */ - #define PWM0_NS ((PWM_Type *)PWM0_BASE_NS) - /** Peripheral PWM1 base address */ - #define PWM1_BASE (0x500D0000u) - /** Peripheral PWM1 base address */ - #define PWM1_BASE_NS (0x400D0000u) - /** Peripheral PWM1 base pointer */ - #define PWM1 ((PWM_Type *)PWM1_BASE) - /** Peripheral PWM1 base pointer */ - #define PWM1_NS ((PWM_Type *)PWM1_BASE_NS) - /** Array initializer of PWM peripheral base addresses */ - #define PWM_BASE_ADDRS { PWM0_BASE, PWM1_BASE } - /** Array initializer of PWM peripheral base pointers */ - #define PWM_BASE_PTRS { PWM0, PWM1 } - /** Array initializer of PWM peripheral base addresses */ - #define PWM_BASE_ADDRS_NS { PWM0_BASE_NS, PWM1_BASE_NS } - /** Array initializer of PWM peripheral base pointers */ - #define PWM_BASE_PTRS_NS { PWM0_NS, PWM1_NS } -#else - /** Peripheral PWM0 base address */ - #define PWM0_BASE (0x400CE000u) - /** Peripheral PWM0 base pointer */ - #define PWM0 ((PWM_Type *)PWM0_BASE) - /** Peripheral PWM1 base address */ - #define PWM1_BASE (0x400D0000u) - /** Peripheral PWM1 base pointer */ - #define PWM1 ((PWM_Type *)PWM1_BASE) - /** Array initializer of PWM peripheral base addresses */ - #define PWM_BASE_ADDRS { PWM0_BASE, PWM1_BASE } - /** Array initializer of PWM peripheral base pointers */ - #define PWM_BASE_PTRS { PWM0, PWM1 } -#endif -/** Interrupt vectors for the PWM peripheral type */ -#define PWM_CMP_IRQS { { FLEXPWM0_SUBMODULE0_IRQn, FLEXPWM0_SUBMODULE1_IRQn, FLEXPWM0_SUBMODULE2_IRQn, FLEXPWM0_SUBMODULE3_IRQn }, { FLEXPWM1_SUBMODULE0_IRQn, FLEXPWM1_SUBMODULE1_IRQn, FLEXPWM1_SUBMODULE2_IRQn, FLEXPWM1_SUBMODULE3_IRQn } } -#define PWM_RELOAD_IRQS { { FLEXPWM0_SUBMODULE0_IRQn, FLEXPWM0_SUBMODULE1_IRQn, FLEXPWM0_SUBMODULE2_IRQn, FLEXPWM0_SUBMODULE3_IRQn }, { FLEXPWM1_SUBMODULE0_IRQn, FLEXPWM1_SUBMODULE1_IRQn, FLEXPWM1_SUBMODULE2_IRQn, FLEXPWM1_SUBMODULE3_IRQn } } -#define PWM_CAPTURE_IRQS { { FLEXPWM0_SUBMODULE0_IRQn, FLEXPWM0_SUBMODULE1_IRQn, FLEXPWM0_SUBMODULE2_IRQn, FLEXPWM0_SUBMODULE3_IRQn }, { FLEXPWM1_SUBMODULE0_IRQn, FLEXPWM1_SUBMODULE1_IRQn, FLEXPWM1_SUBMODULE2_IRQn, FLEXPWM1_SUBMODULE3_IRQn } } -#define PWM_FAULT_IRQS { FLEXPWM0_FAULT_IRQn, FLEXPWM1_FAULT_IRQn } -#define PWM_RELOAD_ERROR_IRQS { FLEXPWM0_RELOAD_ERROR_IRQn, FLEXPWM1_RELOAD_ERROR_IRQn } - -/*! - * @} - */ /* end of group PWM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- QDC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup QDC_Peripheral_Access_Layer QDC Peripheral Access Layer - * @{ - */ - -/** QDC - Register Layout Typedef */ -typedef struct { - __IO uint16_t CTRL; /**< Control, offset: 0x0 */ - __IO uint16_t FILT; /**< Input Filter, offset: 0x2 */ - __IO uint16_t WTR; /**< Watchdog Timeout, offset: 0x4 */ - __IO uint16_t POSD; /**< Position Difference Counter, offset: 0x6 */ - __I uint16_t POSDH; /**< Position Difference Hold, offset: 0x8 */ - __IO uint16_t REV; /**< Revolution Counter, offset: 0xA */ - __I uint16_t REVH; /**< Revolution Hold, offset: 0xC */ - __IO uint16_t UPOS; /**< Upper Position Counter, offset: 0xE */ - __IO uint16_t LPOS; /**< Lower Position Counter, offset: 0x10 */ - __I uint16_t UPOSH; /**< Upper Position Hold, offset: 0x12 */ - __I uint16_t LPOSH; /**< Lower Position Hold, offset: 0x14 */ - __IO uint16_t UINIT; /**< Upper Initialization, offset: 0x16 */ - __IO uint16_t LINIT; /**< Lower Initialization, offset: 0x18 */ - __I uint16_t IMR; /**< Input Monitor, offset: 0x1A */ - __IO uint16_t TST; /**< Test, offset: 0x1C */ - __IO uint16_t CTRL2; /**< Control 2, offset: 0x1E */ - __IO uint16_t UMOD; /**< Upper Modulus, offset: 0x20 */ - __IO uint16_t LMOD; /**< Lower Modulus, offset: 0x22 */ - __IO uint16_t UCOMP; /**< Upper Position Compare, offset: 0x24 */ - __IO uint16_t LCOMP; /**< Lower Position Compare, offset: 0x26 */ - __I uint16_t LASTEDGE; /**< Last Edge Time, offset: 0x28 */ - __I uint16_t LASTEDGEH; /**< Last Edge Time Hold, offset: 0x2A */ - __I uint16_t POSDPER; /**< Position Difference Period Counter, offset: 0x2C */ - __I uint16_t POSDPERBFR; /**< Position Difference Period Buffer, offset: 0x2E */ - __I uint16_t POSDPERH; /**< Position Difference Period Hold, offset: 0x30 */ - __IO uint16_t CTRL3; /**< Control 3, offset: 0x32 */ -} QDC_Type; - -/* ---------------------------------------------------------------------------- - -- QDC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup QDC_Register_Masks QDC Register Masks - * @{ - */ - -/*! @name CTRL - Control */ -/*! @{ */ - -#define QDC_CTRL_CMPIE_MASK (0x1U) -#define QDC_CTRL_CMPIE_SHIFT (0U) -/*! CMPIE - Compare Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL_CMPIE(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_CMPIE_SHIFT)) & QDC_CTRL_CMPIE_MASK) - -#define QDC_CTRL_CMPIRQ_MASK (0x2U) -#define QDC_CTRL_CMPIRQ_SHIFT (1U) -/*! CMPIRQ - Compare Interrupt Request - * 0b0..No match has occurred - * 0b1..COMP match has occurred - */ -#define QDC_CTRL_CMPIRQ(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_CMPIRQ_SHIFT)) & QDC_CTRL_CMPIRQ_MASK) - -#define QDC_CTRL_WDE_MASK (0x4U) -#define QDC_CTRL_WDE_SHIFT (2U) -/*! WDE - Watchdog Enable - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL_WDE(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_WDE_SHIFT)) & QDC_CTRL_WDE_MASK) - -#define QDC_CTRL_DIE_MASK (0x8U) -#define QDC_CTRL_DIE_SHIFT (3U) -/*! DIE - Watchdog Timeout Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL_DIE(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_DIE_SHIFT)) & QDC_CTRL_DIE_MASK) - -#define QDC_CTRL_DIRQ_MASK (0x10U) -#define QDC_CTRL_DIRQ_SHIFT (4U) -/*! DIRQ - Watchdog Timeout Interrupt Request - * 0b0..Not occurred - * 0b1..Occurred - */ -#define QDC_CTRL_DIRQ(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_DIRQ_SHIFT)) & QDC_CTRL_DIRQ_MASK) - -#define QDC_CTRL_XNE_MASK (0x20U) -#define QDC_CTRL_XNE_SHIFT (5U) -/*! XNE - Select Positive and Negative Edge of INDEX Pulse - * 0b0..Use positive edge - * 0b1..Use negative edge - */ -#define QDC_CTRL_XNE(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_XNE_SHIFT)) & QDC_CTRL_XNE_MASK) - -#define QDC_CTRL_XIP_MASK (0x40U) -#define QDC_CTRL_XIP_SHIFT (6U) -/*! XIP - INDEX Triggered Initialization of Position Counters UPOS and LPOS - * 0b0..Does not initialize - * 0b1..Initializes - */ -#define QDC_CTRL_XIP(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_XIP_SHIFT)) & QDC_CTRL_XIP_MASK) - -#define QDC_CTRL_XIE_MASK (0x80U) -#define QDC_CTRL_XIE_SHIFT (7U) -/*! XIE - INDEX Pulse Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL_XIE(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_XIE_SHIFT)) & QDC_CTRL_XIE_MASK) - -#define QDC_CTRL_XIRQ_MASK (0x100U) -#define QDC_CTRL_XIRQ_SHIFT (8U) -/*! XIRQ - INDEX Pulse Interrupt Request - * 0b0..Not occurred - * 0b1..Occurred - */ -#define QDC_CTRL_XIRQ(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_XIRQ_SHIFT)) & QDC_CTRL_XIRQ_MASK) - -#define QDC_CTRL_PH1_MASK (0x200U) -#define QDC_CTRL_PH1_SHIFT (9U) -/*! PH1 - Enable Signal Phase Count Mode - * 0b0..Uses the standard quadrature decoder, where PHASEA and PHASEB represent a two-phase quadrature signal. - * 0b1..Bypasses the quadrature decoder. A positive transition of the PHASEA input generates a count signal. - * PHASEB input and CTRL[REV] controls the counter direction. If the value of CTRL[REV] and PHASEB are identical; - * then count is up. If the value of CTRL[REV] and PHASEB is different, then count is down. - */ -#define QDC_CTRL_PH1(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_PH1_SHIFT)) & QDC_CTRL_PH1_MASK) - -#define QDC_CTRL_REV_MASK (0x400U) -#define QDC_CTRL_REV_SHIFT (10U) -/*! REV - Enable Reverse Direction Counting - * 0b0..Counts normally - * 0b1..Counts in the reverse direction - */ -#define QDC_CTRL_REV(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_REV_SHIFT)) & QDC_CTRL_REV_MASK) - -#define QDC_CTRL_SWIP_MASK (0x800U) -#define QDC_CTRL_SWIP_SHIFT (11U) -/*! SWIP - Software-Triggered Initialization of Position Counters UPOS and LPOS - * 0b0..No action - * 0b1..Initialize position counter - */ -#define QDC_CTRL_SWIP(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_SWIP_SHIFT)) & QDC_CTRL_SWIP_MASK) - -#define QDC_CTRL_HNE_MASK (0x1000U) -#define QDC_CTRL_HNE_SHIFT (12U) -/*! HNE - Use Negative Edge of HOME Input - * 0b0..Use positive-going edge-to-trigger initialization of position counters UPOS and LPOS - * 0b1..Use negative-going edge-to-trigger initialization of position counters UPOS and LPOS - */ -#define QDC_CTRL_HNE(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_HNE_SHIFT)) & QDC_CTRL_HNE_MASK) - -#define QDC_CTRL_HIP_MASK (0x2000U) -#define QDC_CTRL_HIP_SHIFT (13U) -/*! HIP - Enable HOME to Initialize Position Counters UPOS and LPOS - * 0b0..No action - * 0b1..HOME signal initializes the position counter - */ -#define QDC_CTRL_HIP(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_HIP_SHIFT)) & QDC_CTRL_HIP_MASK) - -#define QDC_CTRL_HIE_MASK (0x4000U) -#define QDC_CTRL_HIE_SHIFT (14U) -/*! HIE - HOME Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL_HIE(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_HIE_SHIFT)) & QDC_CTRL_HIE_MASK) - -#define QDC_CTRL_HIRQ_MASK (0x8000U) -#define QDC_CTRL_HIRQ_SHIFT (15U) -/*! HIRQ - HOME Signal Transition Interrupt Request - * 0b0..Not occurred - * 0b1..Occurred - */ -#define QDC_CTRL_HIRQ(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_HIRQ_SHIFT)) & QDC_CTRL_HIRQ_MASK) -/*! @} */ - -/*! @name FILT - Input Filter */ -/*! @{ */ - -#define QDC_FILT_FILT_PER_MASK (0xFFU) -#define QDC_FILT_FILT_PER_SHIFT (0U) -/*! FILT_PER - Input Filter Sample Period */ -#define QDC_FILT_FILT_PER(x) (((uint16_t)(((uint16_t)(x)) << QDC_FILT_FILT_PER_SHIFT)) & QDC_FILT_FILT_PER_MASK) - -#define QDC_FILT_FILT_CNT_MASK (0x700U) -#define QDC_FILT_FILT_CNT_SHIFT (8U) -/*! FILT_CNT - Input Filter Sample Count */ -#define QDC_FILT_FILT_CNT(x) (((uint16_t)(((uint16_t)(x)) << QDC_FILT_FILT_CNT_SHIFT)) & QDC_FILT_FILT_CNT_MASK) - -#define QDC_FILT_FILT_PRSC_MASK (0xE000U) -#define QDC_FILT_FILT_PRSC_SHIFT (13U) -/*! FILT_PRSC - Prescaler Divide IPBus Clock to FILT Clock */ -#define QDC_FILT_FILT_PRSC(x) (((uint16_t)(((uint16_t)(x)) << QDC_FILT_FILT_PRSC_SHIFT)) & QDC_FILT_FILT_PRSC_MASK) -/*! @} */ - -/*! @name WTR - Watchdog Timeout */ -/*! @{ */ - -#define QDC_WTR_WDOG_MASK (0xFFFFU) -#define QDC_WTR_WDOG_SHIFT (0U) -/*! WDOG - WDOG */ -#define QDC_WTR_WDOG(x) (((uint16_t)(((uint16_t)(x)) << QDC_WTR_WDOG_SHIFT)) & QDC_WTR_WDOG_MASK) -/*! @} */ - -/*! @name POSD - Position Difference Counter */ -/*! @{ */ - -#define QDC_POSD_POSD_MASK (0xFFFFU) -#define QDC_POSD_POSD_SHIFT (0U) -/*! POSD - POSD */ -#define QDC_POSD_POSD(x) (((uint16_t)(((uint16_t)(x)) << QDC_POSD_POSD_SHIFT)) & QDC_POSD_POSD_MASK) -/*! @} */ - -/*! @name POSDH - Position Difference Hold */ -/*! @{ */ - -#define QDC_POSDH_POSDH_MASK (0xFFFFU) -#define QDC_POSDH_POSDH_SHIFT (0U) -/*! POSDH - POSDH */ -#define QDC_POSDH_POSDH(x) (((uint16_t)(((uint16_t)(x)) << QDC_POSDH_POSDH_SHIFT)) & QDC_POSDH_POSDH_MASK) -/*! @} */ - -/*! @name REV - Revolution Counter */ -/*! @{ */ - -#define QDC_REV_REV_MASK (0xFFFFU) -#define QDC_REV_REV_SHIFT (0U) -/*! REV - REV */ -#define QDC_REV_REV(x) (((uint16_t)(((uint16_t)(x)) << QDC_REV_REV_SHIFT)) & QDC_REV_REV_MASK) -/*! @} */ - -/*! @name REVH - Revolution Hold */ -/*! @{ */ - -#define QDC_REVH_REVH_MASK (0xFFFFU) -#define QDC_REVH_REVH_SHIFT (0U) -/*! REVH - REVH */ -#define QDC_REVH_REVH(x) (((uint16_t)(((uint16_t)(x)) << QDC_REVH_REVH_SHIFT)) & QDC_REVH_REVH_MASK) -/*! @} */ - -/*! @name UPOS - Upper Position Counter */ -/*! @{ */ - -#define QDC_UPOS_POS_MASK (0xFFFFU) -#define QDC_UPOS_POS_SHIFT (0U) -/*! POS - POS */ -#define QDC_UPOS_POS(x) (((uint16_t)(((uint16_t)(x)) << QDC_UPOS_POS_SHIFT)) & QDC_UPOS_POS_MASK) -/*! @} */ - -/*! @name LPOS - Lower Position Counter */ -/*! @{ */ - -#define QDC_LPOS_POS_MASK (0xFFFFU) -#define QDC_LPOS_POS_SHIFT (0U) -/*! POS - POS */ -#define QDC_LPOS_POS(x) (((uint16_t)(((uint16_t)(x)) << QDC_LPOS_POS_SHIFT)) & QDC_LPOS_POS_MASK) -/*! @} */ - -/*! @name UPOSH - Upper Position Hold */ -/*! @{ */ - -#define QDC_UPOSH_POSH_MASK (0xFFFFU) -#define QDC_UPOSH_POSH_SHIFT (0U) -/*! POSH - POSH */ -#define QDC_UPOSH_POSH(x) (((uint16_t)(((uint16_t)(x)) << QDC_UPOSH_POSH_SHIFT)) & QDC_UPOSH_POSH_MASK) -/*! @} */ - -/*! @name LPOSH - Lower Position Hold */ -/*! @{ */ - -#define QDC_LPOSH_POSH_MASK (0xFFFFU) -#define QDC_LPOSH_POSH_SHIFT (0U) -/*! POSH - POSH */ -#define QDC_LPOSH_POSH(x) (((uint16_t)(((uint16_t)(x)) << QDC_LPOSH_POSH_SHIFT)) & QDC_LPOSH_POSH_MASK) -/*! @} */ - -/*! @name UINIT - Upper Initialization */ -/*! @{ */ - -#define QDC_UINIT_INIT_MASK (0xFFFFU) -#define QDC_UINIT_INIT_SHIFT (0U) -/*! INIT - INIT */ -#define QDC_UINIT_INIT(x) (((uint16_t)(((uint16_t)(x)) << QDC_UINIT_INIT_SHIFT)) & QDC_UINIT_INIT_MASK) -/*! @} */ - -/*! @name LINIT - Lower Initialization */ -/*! @{ */ - -#define QDC_LINIT_INIT_MASK (0xFFFFU) -#define QDC_LINIT_INIT_SHIFT (0U) -/*! INIT - INIT */ -#define QDC_LINIT_INIT(x) (((uint16_t)(((uint16_t)(x)) << QDC_LINIT_INIT_SHIFT)) & QDC_LINIT_INIT_MASK) -/*! @} */ - -/*! @name IMR - Input Monitor */ -/*! @{ */ - -#define QDC_IMR_HOME_MASK (0x1U) -#define QDC_IMR_HOME_SHIFT (0U) -/*! HOME - HOME */ -#define QDC_IMR_HOME(x) (((uint16_t)(((uint16_t)(x)) << QDC_IMR_HOME_SHIFT)) & QDC_IMR_HOME_MASK) - -#define QDC_IMR_INDEX_MASK (0x2U) -#define QDC_IMR_INDEX_SHIFT (1U) -/*! INDEX - INDEX */ -#define QDC_IMR_INDEX(x) (((uint16_t)(((uint16_t)(x)) << QDC_IMR_INDEX_SHIFT)) & QDC_IMR_INDEX_MASK) - -#define QDC_IMR_PHB_MASK (0x4U) -#define QDC_IMR_PHB_SHIFT (2U) -/*! PHB - PHB */ -#define QDC_IMR_PHB(x) (((uint16_t)(((uint16_t)(x)) << QDC_IMR_PHB_SHIFT)) & QDC_IMR_PHB_MASK) - -#define QDC_IMR_PHA_MASK (0x8U) -#define QDC_IMR_PHA_SHIFT (3U) -/*! PHA - PHA */ -#define QDC_IMR_PHA(x) (((uint16_t)(((uint16_t)(x)) << QDC_IMR_PHA_SHIFT)) & QDC_IMR_PHA_MASK) - -#define QDC_IMR_FHOM_MASK (0x10U) -#define QDC_IMR_FHOM_SHIFT (4U) -/*! FHOM - FHOM */ -#define QDC_IMR_FHOM(x) (((uint16_t)(((uint16_t)(x)) << QDC_IMR_FHOM_SHIFT)) & QDC_IMR_FHOM_MASK) - -#define QDC_IMR_FIND_MASK (0x20U) -#define QDC_IMR_FIND_SHIFT (5U) -/*! FIND - FIND */ -#define QDC_IMR_FIND(x) (((uint16_t)(((uint16_t)(x)) << QDC_IMR_FIND_SHIFT)) & QDC_IMR_FIND_MASK) - -#define QDC_IMR_FPHB_MASK (0x40U) -#define QDC_IMR_FPHB_SHIFT (6U) -/*! FPHB - FPHB */ -#define QDC_IMR_FPHB(x) (((uint16_t)(((uint16_t)(x)) << QDC_IMR_FPHB_SHIFT)) & QDC_IMR_FPHB_MASK) - -#define QDC_IMR_FPHA_MASK (0x80U) -#define QDC_IMR_FPHA_SHIFT (7U) -/*! FPHA - FPHA */ -#define QDC_IMR_FPHA(x) (((uint16_t)(((uint16_t)(x)) << QDC_IMR_FPHA_SHIFT)) & QDC_IMR_FPHA_MASK) -/*! @} */ - -/*! @name TST - Test */ -/*! @{ */ - -#define QDC_TST_TEST_COUNT_MASK (0xFFU) -#define QDC_TST_TEST_COUNT_SHIFT (0U) -/*! TEST_COUNT - TEST_COUNT */ -#define QDC_TST_TEST_COUNT(x) (((uint16_t)(((uint16_t)(x)) << QDC_TST_TEST_COUNT_SHIFT)) & QDC_TST_TEST_COUNT_MASK) - -#define QDC_TST_TEST_PERIOD_MASK (0x1F00U) -#define QDC_TST_TEST_PERIOD_SHIFT (8U) -/*! TEST_PERIOD - TEST_PERIOD */ -#define QDC_TST_TEST_PERIOD(x) (((uint16_t)(((uint16_t)(x)) << QDC_TST_TEST_PERIOD_SHIFT)) & QDC_TST_TEST_PERIOD_MASK) - -#define QDC_TST_QDN_MASK (0x2000U) -#define QDC_TST_QDN_SHIFT (13U) -/*! QDN - Quadrature Decoder Negative Signal - * 0b0..Positive quadrature decoder signal - * 0b1..Negative quadrature decoder signal - */ -#define QDC_TST_QDN(x) (((uint16_t)(((uint16_t)(x)) << QDC_TST_QDN_SHIFT)) & QDC_TST_QDN_MASK) - -#define QDC_TST_TCE_MASK (0x4000U) -#define QDC_TST_TCE_SHIFT (14U) -/*! TCE - Test Counter Enable - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_TST_TCE(x) (((uint16_t)(((uint16_t)(x)) << QDC_TST_TCE_SHIFT)) & QDC_TST_TCE_MASK) - -#define QDC_TST_TEN_MASK (0x8000U) -#define QDC_TST_TEN_SHIFT (15U) -/*! TEN - Test Mode Enable - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_TST_TEN(x) (((uint16_t)(((uint16_t)(x)) << QDC_TST_TEN_SHIFT)) & QDC_TST_TEN_MASK) -/*! @} */ - -/*! @name CTRL2 - Control 2 */ -/*! @{ */ - -#define QDC_CTRL2_UPDHLD_MASK (0x1U) -#define QDC_CTRL2_UPDHLD_SHIFT (0U) -/*! UPDHLD - Update Hold Registers - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL2_UPDHLD(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_UPDHLD_SHIFT)) & QDC_CTRL2_UPDHLD_MASK) - -#define QDC_CTRL2_UPDPOS_MASK (0x2U) -#define QDC_CTRL2_UPDPOS_SHIFT (1U) -/*! UPDPOS - Update Position Registers - * 0b0..No action - * 0b1..Clear - */ -#define QDC_CTRL2_UPDPOS(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_UPDPOS_SHIFT)) & QDC_CTRL2_UPDPOS_MASK) - -#define QDC_CTRL2_MOD_MASK (0x4U) -#define QDC_CTRL2_MOD_SHIFT (2U) -/*! MOD - Enable Modulo Counting - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL2_MOD(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_MOD_SHIFT)) & QDC_CTRL2_MOD_MASK) - -#define QDC_CTRL2_DIR_MASK (0x8U) -#define QDC_CTRL2_DIR_SHIFT (3U) -/*! DIR - Count Direction Flag - * 0b0..Down direction - * 0b1..Up direction - */ -#define QDC_CTRL2_DIR(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_DIR_SHIFT)) & QDC_CTRL2_DIR_MASK) - -#define QDC_CTRL2_RUIE_MASK (0x10U) -#define QDC_CTRL2_RUIE_SHIFT (4U) -/*! RUIE - Roll-under Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL2_RUIE(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_RUIE_SHIFT)) & QDC_CTRL2_RUIE_MASK) - -#define QDC_CTRL2_RUIRQ_MASK (0x20U) -#define QDC_CTRL2_RUIRQ_SHIFT (5U) -/*! RUIRQ - Roll-under Interrupt Request - * 0b0..No roll-under has occurred - * 0b1..Roll-under has occurred - */ -#define QDC_CTRL2_RUIRQ(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_RUIRQ_SHIFT)) & QDC_CTRL2_RUIRQ_MASK) - -#define QDC_CTRL2_ROIE_MASK (0x40U) -#define QDC_CTRL2_ROIE_SHIFT (6U) -/*! ROIE - Roll-over Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL2_ROIE(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_ROIE_SHIFT)) & QDC_CTRL2_ROIE_MASK) - -#define QDC_CTRL2_ROIRQ_MASK (0x80U) -#define QDC_CTRL2_ROIRQ_SHIFT (7U) -/*! ROIRQ - Roll-over Interrupt Request - * 0b0..Did not occur - * 0b1..Occurred - */ -#define QDC_CTRL2_ROIRQ(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_ROIRQ_SHIFT)) & QDC_CTRL2_ROIRQ_MASK) - -#define QDC_CTRL2_REVMOD_MASK (0x100U) -#define QDC_CTRL2_REVMOD_SHIFT (8U) -/*! REVMOD - Revolution Counter Modulus Enable - * 0b0..Use INDEX pulse - * 0b1..Use modulus counting roll-over or roll-under - */ -#define QDC_CTRL2_REVMOD(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_REVMOD_SHIFT)) & QDC_CTRL2_REVMOD_MASK) - -#define QDC_CTRL2_OUTCTL_MASK (0x200U) -#define QDC_CTRL2_OUTCTL_SHIFT (9U) -/*! OUTCTL - Output Control - * 0b0..POSMATCH pulses when a match occurs between the position counters (POS) and the corresponding compare value (COMP ) - * 0b1..POSMATCH pulses when the UPOS, LPOS, REV, or POSD registers are read - */ -#define QDC_CTRL2_OUTCTL(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_OUTCTL_SHIFT)) & QDC_CTRL2_OUTCTL_MASK) - -#define QDC_CTRL2_SABIE_MASK (0x400U) -#define QDC_CTRL2_SABIE_SHIFT (10U) -/*! SABIE - Simultaneous PHASEA and PHASEB Change Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL2_SABIE(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_SABIE_SHIFT)) & QDC_CTRL2_SABIE_MASK) - -#define QDC_CTRL2_SABIRQ_MASK (0x800U) -#define QDC_CTRL2_SABIRQ_SHIFT (11U) -/*! SABIRQ - Simultaneous PHASEA and PHASEB Change Interrupt Request - * 0b0..No simultaneous change has occurred - * 0b1..A simultaneous change has occurred - */ -#define QDC_CTRL2_SABIRQ(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_SABIRQ_SHIFT)) & QDC_CTRL2_SABIRQ_MASK) - -#define QDC_CTRL2_INITPOS_MASK (0x1000U) -#define QDC_CTRL2_INITPOS_SHIFT (12U) -/*! INITPOS - Initialize Position Registers - * 0b0..Don't initialize position counter - * 0b1..Initialize position counter - */ -#define QDC_CTRL2_INITPOS(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_INITPOS_SHIFT)) & QDC_CTRL2_INITPOS_MASK) - -#define QDC_CTRL2_EMIP_MASK (0x2000U) -#define QDC_CTRL2_EMIP_SHIFT (13U) -/*! EMIP - Enables/disables the position counter to be initialized by Index Event Edge Mark - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL2_EMIP(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_EMIP_SHIFT)) & QDC_CTRL2_EMIP_MASK) -/*! @} */ - -/*! @name UMOD - Upper Modulus */ -/*! @{ */ - -#define QDC_UMOD_MOD_MASK (0xFFFFU) -#define QDC_UMOD_MOD_SHIFT (0U) -/*! MOD - MOD */ -#define QDC_UMOD_MOD(x) (((uint16_t)(((uint16_t)(x)) << QDC_UMOD_MOD_SHIFT)) & QDC_UMOD_MOD_MASK) -/*! @} */ - -/*! @name LMOD - Lower Modulus */ -/*! @{ */ - -#define QDC_LMOD_MOD_MASK (0xFFFFU) -#define QDC_LMOD_MOD_SHIFT (0U) -/*! MOD - MOD */ -#define QDC_LMOD_MOD(x) (((uint16_t)(((uint16_t)(x)) << QDC_LMOD_MOD_SHIFT)) & QDC_LMOD_MOD_MASK) -/*! @} */ - -/*! @name UCOMP - Upper Position Compare */ -/*! @{ */ - -#define QDC_UCOMP_COMP_MASK (0xFFFFU) -#define QDC_UCOMP_COMP_SHIFT (0U) -/*! COMP - COMP */ -#define QDC_UCOMP_COMP(x) (((uint16_t)(((uint16_t)(x)) << QDC_UCOMP_COMP_SHIFT)) & QDC_UCOMP_COMP_MASK) -/*! @} */ - -/*! @name LCOMP - Lower Position Compare */ -/*! @{ */ - -#define QDC_LCOMP_COMP_MASK (0xFFFFU) -#define QDC_LCOMP_COMP_SHIFT (0U) -/*! COMP - COMP */ -#define QDC_LCOMP_COMP(x) (((uint16_t)(((uint16_t)(x)) << QDC_LCOMP_COMP_SHIFT)) & QDC_LCOMP_COMP_MASK) -/*! @} */ - -/*! @name LASTEDGE - Last Edge Time */ -/*! @{ */ - -#define QDC_LASTEDGE_LASTEDGE_MASK (0xFFFFU) -#define QDC_LASTEDGE_LASTEDGE_SHIFT (0U) -/*! LASTEDGE - Last Edge Time Counter */ -#define QDC_LASTEDGE_LASTEDGE(x) (((uint16_t)(((uint16_t)(x)) << QDC_LASTEDGE_LASTEDGE_SHIFT)) & QDC_LASTEDGE_LASTEDGE_MASK) -/*! @} */ - -/*! @name LASTEDGEH - Last Edge Time Hold */ -/*! @{ */ - -#define QDC_LASTEDGEH_LASTEDGEH_MASK (0xFFFFU) -#define QDC_LASTEDGEH_LASTEDGEH_SHIFT (0U) -/*! LASTEDGEH - Last Edge Time Hold */ -#define QDC_LASTEDGEH_LASTEDGEH(x) (((uint16_t)(((uint16_t)(x)) << QDC_LASTEDGEH_LASTEDGEH_SHIFT)) & QDC_LASTEDGEH_LASTEDGEH_MASK) -/*! @} */ - -/*! @name POSDPER - Position Difference Period Counter */ -/*! @{ */ - -#define QDC_POSDPER_POSDPER_MASK (0xFFFFU) -#define QDC_POSDPER_POSDPER_SHIFT (0U) -/*! POSDPER - Position difference period */ -#define QDC_POSDPER_POSDPER(x) (((uint16_t)(((uint16_t)(x)) << QDC_POSDPER_POSDPER_SHIFT)) & QDC_POSDPER_POSDPER_MASK) -/*! @} */ - -/*! @name POSDPERBFR - Position Difference Period Buffer */ -/*! @{ */ - -#define QDC_POSDPERBFR_POSDPERBFR_MASK (0xFFFFU) -#define QDC_POSDPERBFR_POSDPERBFR_SHIFT (0U) -/*! POSDPERBFR - Position difference period buffer */ -#define QDC_POSDPERBFR_POSDPERBFR(x) (((uint16_t)(((uint16_t)(x)) << QDC_POSDPERBFR_POSDPERBFR_SHIFT)) & QDC_POSDPERBFR_POSDPERBFR_MASK) -/*! @} */ - -/*! @name POSDPERH - Position Difference Period Hold */ -/*! @{ */ - -#define QDC_POSDPERH_POSDPERH_MASK (0xFFFFU) -#define QDC_POSDPERH_POSDPERH_SHIFT (0U) -/*! POSDPERH - Position difference period hold */ -#define QDC_POSDPERH_POSDPERH(x) (((uint16_t)(((uint16_t)(x)) << QDC_POSDPERH_POSDPERH_SHIFT)) & QDC_POSDPERH_POSDPERH_MASK) -/*! @} */ - -/*! @name CTRL3 - Control 3 */ -/*! @{ */ - -#define QDC_CTRL3_PMEN_MASK (0x1U) -#define QDC_CTRL3_PMEN_SHIFT (0U) -/*! PMEN - Period Measurement Function Enable - * 0b0..Not used - * 0b1..Used - */ -#define QDC_CTRL3_PMEN(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL3_PMEN_SHIFT)) & QDC_CTRL3_PMEN_MASK) - -#define QDC_CTRL3_PRSC_MASK (0xF0U) -#define QDC_CTRL3_PRSC_SHIFT (4U) -/*! PRSC - Prescaler */ -#define QDC_CTRL3_PRSC(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL3_PRSC_SHIFT)) & QDC_CTRL3_PRSC_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group QDC_Register_Masks */ - - -/* QDC - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral QDC0 base address */ - #define QDC0_BASE (0x500CF000u) - /** Peripheral QDC0 base address */ - #define QDC0_BASE_NS (0x400CF000u) - /** Peripheral QDC0 base pointer */ - #define QDC0 ((QDC_Type *)QDC0_BASE) - /** Peripheral QDC0 base pointer */ - #define QDC0_NS ((QDC_Type *)QDC0_BASE_NS) - /** Peripheral QDC1 base address */ - #define QDC1_BASE (0x500D1000u) - /** Peripheral QDC1 base address */ - #define QDC1_BASE_NS (0x400D1000u) - /** Peripheral QDC1 base pointer */ - #define QDC1 ((QDC_Type *)QDC1_BASE) - /** Peripheral QDC1 base pointer */ - #define QDC1_NS ((QDC_Type *)QDC1_BASE_NS) - /** Array initializer of QDC peripheral base addresses */ - #define QDC_BASE_ADDRS { QDC0_BASE, QDC1_BASE } - /** Array initializer of QDC peripheral base pointers */ - #define QDC_BASE_PTRS { QDC0, QDC1 } - /** Array initializer of QDC peripheral base addresses */ - #define QDC_BASE_ADDRS_NS { QDC0_BASE_NS, QDC1_BASE_NS } - /** Array initializer of QDC peripheral base pointers */ - #define QDC_BASE_PTRS_NS { QDC0_NS, QDC1_NS } -#else - /** Peripheral QDC0 base address */ - #define QDC0_BASE (0x400CF000u) - /** Peripheral QDC0 base pointer */ - #define QDC0 ((QDC_Type *)QDC0_BASE) - /** Peripheral QDC1 base address */ - #define QDC1_BASE (0x400D1000u) - /** Peripheral QDC1 base pointer */ - #define QDC1 ((QDC_Type *)QDC1_BASE) - /** Array initializer of QDC peripheral base addresses */ - #define QDC_BASE_ADDRS { QDC0_BASE, QDC1_BASE } - /** Array initializer of QDC peripheral base pointers */ - #define QDC_BASE_PTRS { QDC0, QDC1 } -#endif -/** Interrupt vectors for the QDC peripheral type */ -#define QDC_COMPARE_IRQS { QDC0_COMPARE_IRQn, QDC1_COMPARE_IRQn } -#define QDC_HOME_IRQS { QDC0_HOME_IRQn, QDC1_HOME_IRQn } -#define QDC_WDOG_IRQS { QDC0_WDG_SAB_IRQn, QDC1_WDG_SAB_IRQn } -#define QDC_INDEX_IRQS { QDC0_IDX_IRQn, QDC1_IDX_IRQn } - -/*! - * @} - */ /* end of group QDC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- RTC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup RTC_Peripheral_Access_Layer RTC Peripheral Access Layer - * @{ - */ - -/** RTC - Register Layout Typedef */ -typedef struct { - __IO uint16_t YEARMON; /**< Year and Month Counters, offset: 0x0 */ - __IO uint16_t DAYS; /**< Days and Day-of-Week Counters, offset: 0x2 */ - __IO uint16_t HOURMIN; /**< Hours and Minutes Counters, offset: 0x4 */ - __IO uint16_t SECONDS; /**< Seconds Counters, offset: 0x6 */ - __IO uint16_t ALM_YEARMON; /**< Year and Months Alarm, offset: 0x8 */ - __IO uint16_t ALM_DAYS; /**< Days Alarm, offset: 0xA */ - __IO uint16_t ALM_HOURMIN; /**< Hours and Minutes Alarm, offset: 0xC */ - __IO uint16_t ALM_SECONDS; /**< Seconds Alarm, offset: 0xE */ - __IO uint16_t CTRL; /**< Control, offset: 0x10 */ - __IO uint16_t STATUS; /**< Status, offset: 0x12 */ - __IO uint16_t ISR; /**< Interrupt Status, offset: 0x14 */ - __IO uint16_t IER; /**< Interrupt Enable, offset: 0x16 */ - uint8_t RESERVED_0[4]; - __I uint16_t RTC_TEST2; /**< Sub Second Counter, offset: 0x1C */ - uint8_t RESERVED_1[4]; - __IO uint16_t DST_HOUR; /**< Daylight Saving Hour, offset: 0x22 */ - __IO uint16_t DST_MONTH; /**< Daylight Saving Month, offset: 0x24 */ - __IO uint16_t DST_DAY; /**< Daylight Saving Day, offset: 0x26 */ - __IO uint16_t COMPEN; /**< Compensation, offset: 0x28 */ - uint8_t RESERVED_2[2006]; - __IO uint32_t SUBSECOND_CTRL; /**< Subsecond Control, offset: 0x800 */ - __I uint32_t SUBSECOND_CNT; /**< Subsecond Counter, offset: 0x804 */ - uint8_t RESERVED_3[1016]; - __IO uint32_t WAKE_TIMER_CTRL; /**< Wake Timer Control, offset: 0xC00 */ - uint8_t RESERVED_4[8]; - __IO uint32_t WAKE_TIMER_CNT; /**< Wake Timer Counter, offset: 0xC0C */ -} RTC_Type; - -/* ---------------------------------------------------------------------------- - -- RTC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup RTC_Register_Masks RTC Register Masks - * @{ - */ - -/*! @name YEARMON - Year and Month Counters */ -/*! @{ */ - -#define RTC_YEARMON_MON_CNT_MASK (0xFU) -#define RTC_YEARMON_MON_CNT_SHIFT (0U) -/*! MON_CNT - Month Counter - * 0b0000, 0b1101, 0b1110, 0b1111..Illegal Value - * 0b0001..January - * 0b0010..February - * 0b0011..March - * 0b0100..April - * 0b0101..May - * 0b0110..June - * 0b0111..July - * 0b1000..August - * 0b1001..September - * 0b1010..October - * 0b1011..November - * 0b1100..December - */ -#define RTC_YEARMON_MON_CNT(x) (((uint16_t)(((uint16_t)(x)) << RTC_YEARMON_MON_CNT_SHIFT)) & RTC_YEARMON_MON_CNT_MASK) - -#define RTC_YEARMON_YROFST_MASK (0xFF00U) -#define RTC_YEARMON_YROFST_SHIFT (8U) -/*! YROFST - Year Offset Count Value */ -#define RTC_YEARMON_YROFST(x) (((uint16_t)(((uint16_t)(x)) << RTC_YEARMON_YROFST_SHIFT)) & RTC_YEARMON_YROFST_MASK) -/*! @} */ - -/*! @name DAYS - Days and Day-of-Week Counters */ -/*! @{ */ - -#define RTC_DAYS_DAY_CNT_MASK (0x1FU) -#define RTC_DAYS_DAY_CNT_SHIFT (0U) -/*! DAY_CNT - Days Counter Value */ -#define RTC_DAYS_DAY_CNT(x) (((uint16_t)(((uint16_t)(x)) << RTC_DAYS_DAY_CNT_SHIFT)) & RTC_DAYS_DAY_CNT_MASK) - -#define RTC_DAYS_DOW_MASK (0x700U) -#define RTC_DAYS_DOW_SHIFT (8U) -/*! DOW - Day of Week Counter Value - * 0b000..Sunday - * 0b001..Monday - * 0b010..Tuesday - * 0b011..Wednesday - * 0b100..Thursday - * 0b101..Friday - * 0b110..Saturday - * 0b111.. - */ -#define RTC_DAYS_DOW(x) (((uint16_t)(((uint16_t)(x)) << RTC_DAYS_DOW_SHIFT)) & RTC_DAYS_DOW_MASK) -/*! @} */ - -/*! @name HOURMIN - Hours and Minutes Counters */ -/*! @{ */ - -#define RTC_HOURMIN_MIN_CNT_MASK (0x3FU) -#define RTC_HOURMIN_MIN_CNT_SHIFT (0U) -/*! MIN_CNT - Minutes Counter Value */ -#define RTC_HOURMIN_MIN_CNT(x) (((uint16_t)(((uint16_t)(x)) << RTC_HOURMIN_MIN_CNT_SHIFT)) & RTC_HOURMIN_MIN_CNT_MASK) - -#define RTC_HOURMIN_HOUR_CNT_MASK (0x1F00U) -#define RTC_HOURMIN_HOUR_CNT_SHIFT (8U) -/*! HOUR_CNT - Hours Counter Value */ -#define RTC_HOURMIN_HOUR_CNT(x) (((uint16_t)(((uint16_t)(x)) << RTC_HOURMIN_HOUR_CNT_SHIFT)) & RTC_HOURMIN_HOUR_CNT_MASK) -/*! @} */ - -/*! @name SECONDS - Seconds Counters */ -/*! @{ */ - -#define RTC_SECONDS_SEC_CNT_MASK (0x3FU) -#define RTC_SECONDS_SEC_CNT_SHIFT (0U) -/*! SEC_CNT - Seconds Counter Value */ -#define RTC_SECONDS_SEC_CNT(x) (((uint16_t)(((uint16_t)(x)) << RTC_SECONDS_SEC_CNT_SHIFT)) & RTC_SECONDS_SEC_CNT_MASK) -/*! @} */ - -/*! @name ALM_YEARMON - Year and Months Alarm */ -/*! @{ */ - -#define RTC_ALM_YEARMON_ALM_MON_MASK (0xFU) -#define RTC_ALM_YEARMON_ALM_MON_SHIFT (0U) -/*! ALM_MON - Months Value for Alarm */ -#define RTC_ALM_YEARMON_ALM_MON(x) (((uint16_t)(((uint16_t)(x)) << RTC_ALM_YEARMON_ALM_MON_SHIFT)) & RTC_ALM_YEARMON_ALM_MON_MASK) - -#define RTC_ALM_YEARMON_ALM_YEAR_MASK (0xFF00U) -#define RTC_ALM_YEARMON_ALM_YEAR_SHIFT (8U) -/*! ALM_YEAR - Year Value for Alarm */ -#define RTC_ALM_YEARMON_ALM_YEAR(x) (((uint16_t)(((uint16_t)(x)) << RTC_ALM_YEARMON_ALM_YEAR_SHIFT)) & RTC_ALM_YEARMON_ALM_YEAR_MASK) -/*! @} */ - -/*! @name ALM_DAYS - Days Alarm */ -/*! @{ */ - -#define RTC_ALM_DAYS_ALM_DAY_MASK (0x1FU) -#define RTC_ALM_DAYS_ALM_DAY_SHIFT (0U) -/*! ALM_DAY - Days Value for Alarm */ -#define RTC_ALM_DAYS_ALM_DAY(x) (((uint16_t)(((uint16_t)(x)) << RTC_ALM_DAYS_ALM_DAY_SHIFT)) & RTC_ALM_DAYS_ALM_DAY_MASK) -/*! @} */ - -/*! @name ALM_HOURMIN - Hours and Minutes Alarm */ -/*! @{ */ - -#define RTC_ALM_HOURMIN_ALM_MIN_MASK (0x3FU) -#define RTC_ALM_HOURMIN_ALM_MIN_SHIFT (0U) -/*! ALM_MIN - Minutes Value for Alarm */ -#define RTC_ALM_HOURMIN_ALM_MIN(x) (((uint16_t)(((uint16_t)(x)) << RTC_ALM_HOURMIN_ALM_MIN_SHIFT)) & RTC_ALM_HOURMIN_ALM_MIN_MASK) - -#define RTC_ALM_HOURMIN_ALM_HOUR_MASK (0x1F00U) -#define RTC_ALM_HOURMIN_ALM_HOUR_SHIFT (8U) -/*! ALM_HOUR - Hours Value for Alarm */ -#define RTC_ALM_HOURMIN_ALM_HOUR(x) (((uint16_t)(((uint16_t)(x)) << RTC_ALM_HOURMIN_ALM_HOUR_SHIFT)) & RTC_ALM_HOURMIN_ALM_HOUR_MASK) -/*! @} */ - -/*! @name ALM_SECONDS - Seconds Alarm */ -/*! @{ */ - -#define RTC_ALM_SECONDS_ALM_SEC_MASK (0x3FU) -#define RTC_ALM_SECONDS_ALM_SEC_SHIFT (0U) -/*! ALM_SEC - Seconds Alarm Value */ -#define RTC_ALM_SECONDS_ALM_SEC(x) (((uint16_t)(((uint16_t)(x)) << RTC_ALM_SECONDS_ALM_SEC_SHIFT)) & RTC_ALM_SECONDS_ALM_SEC_MASK) - -#define RTC_ALM_SECONDS_DEC_SEC_MASK (0x100U) -#define RTC_ALM_SECONDS_DEC_SEC_SHIFT (8U) -/*! DEC_SEC - Decrement Seconds Counter by 1. */ -#define RTC_ALM_SECONDS_DEC_SEC(x) (((uint16_t)(((uint16_t)(x)) << RTC_ALM_SECONDS_DEC_SEC_SHIFT)) & RTC_ALM_SECONDS_DEC_SEC_MASK) - -#define RTC_ALM_SECONDS_INC_SEC_MASK (0x200U) -#define RTC_ALM_SECONDS_INC_SEC_SHIFT (9U) -/*! INC_SEC - Increment Seconds Counter by 1. */ -#define RTC_ALM_SECONDS_INC_SEC(x) (((uint16_t)(((uint16_t)(x)) << RTC_ALM_SECONDS_INC_SEC_SHIFT)) & RTC_ALM_SECONDS_INC_SEC_MASK) -/*! @} */ - -/*! @name CTRL - Control */ -/*! @{ */ - -#define RTC_CTRL_FINEEN_MASK (0x1U) -#define RTC_CTRL_FINEEN_SHIFT (0U) -/*! FINEEN - Fine Compensation Enable - * 0b1..Fine compensation is enabled. - * 0b0..Fine compensation is disabled - */ -#define RTC_CTRL_FINEEN(x) (((uint16_t)(((uint16_t)(x)) << RTC_CTRL_FINEEN_SHIFT)) & RTC_CTRL_FINEEN_MASK) - -#define RTC_CTRL_COMP_EN_MASK (0x2U) -#define RTC_CTRL_COMP_EN_SHIFT (1U) -/*! COMP_EN - Compensation Enable - * 0b0..Coarse compensation is disabled. - * 0b1..Coarse compensation is enabled. - */ -#define RTC_CTRL_COMP_EN(x) (((uint16_t)(((uint16_t)(x)) << RTC_CTRL_COMP_EN_SHIFT)) & RTC_CTRL_COMP_EN_MASK) - -#define RTC_CTRL_ALM_MATCH_MASK (0xCU) -#define RTC_CTRL_ALM_MATCH_SHIFT (2U) -/*! ALM_MATCH - Alarm Match - * 0b00..Only seconds, minutes, and hours matched. - * 0b01..Only seconds, minutes, hours, and days matched. - * 0b10..Only seconds, minutes, hours, days, and months matched. - * 0b11..Only seconds, minutes, hours, days, months, and year (offset) matched. - */ -#define RTC_CTRL_ALM_MATCH(x) (((uint16_t)(((uint16_t)(x)) << RTC_CTRL_ALM_MATCH_SHIFT)) & RTC_CTRL_ALM_MATCH_MASK) - -#define RTC_CTRL_DST_EN_MASK (0x40U) -#define RTC_CTRL_DST_EN_SHIFT (6U) -/*! DST_EN - Daylight Saving Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define RTC_CTRL_DST_EN(x) (((uint16_t)(((uint16_t)(x)) << RTC_CTRL_DST_EN_SHIFT)) & RTC_CTRL_DST_EN_MASK) - -#define RTC_CTRL_SWR_MASK (0x100U) -#define RTC_CTRL_SWR_SHIFT (8U) -/*! SWR - Software Reset - * 0b0..Software Reset cleared - * 0b1..Software Reset asserted - */ -#define RTC_CTRL_SWR(x) (((uint16_t)(((uint16_t)(x)) << RTC_CTRL_SWR_SHIFT)) & RTC_CTRL_SWR_MASK) - -#define RTC_CTRL_CLK_SEL_MASK (0x200U) -#define RTC_CTRL_CLK_SEL_SHIFT (9U) -/*! CLK_SEL - RTC Clock Select - * 0b0..16.384 kHz clock is selected - * 0b1..32.768 kHz clock is selected - */ -#define RTC_CTRL_CLK_SEL(x) (((uint16_t)(((uint16_t)(x)) << RTC_CTRL_CLK_SEL_SHIFT)) & RTC_CTRL_CLK_SEL_MASK) - -#define RTC_CTRL_CLKO_DIS_MASK (0x400U) -#define RTC_CTRL_CLKO_DIS_SHIFT (10U) -/*! CLKO_DIS - Clock Output Disable - * 0b0..The selected clock is output to other peripherals. - * 0b1..The selected clock is not output to other peripherals. - */ -#define RTC_CTRL_CLKO_DIS(x) (((uint16_t)(((uint16_t)(x)) << RTC_CTRL_CLKO_DIS_SHIFT)) & RTC_CTRL_CLKO_DIS_MASK) - -#define RTC_CTRL_CLKOUT_MASK (0x6000U) -#define RTC_CTRL_CLKOUT_SHIFT (13U) -/*! CLKOUT - RTC Clock Output Selection - * 0b00..No output clock - * 0b01..Fine 1 Hz clock with both precise edges - * 0b10..32.768 or 16.384 kHz clock - * 0b11..Coarse 1 Hz clock with both precise edges - */ -#define RTC_CTRL_CLKOUT(x) (((uint16_t)(((uint16_t)(x)) << RTC_CTRL_CLKOUT_SHIFT)) & RTC_CTRL_CLKOUT_MASK) -/*! @} */ - -/*! @name STATUS - Status */ -/*! @{ */ - -#define RTC_STATUS_INVAL_BIT_MASK (0x1U) -#define RTC_STATUS_INVAL_BIT_SHIFT (0U) -/*! INVAL_BIT - Invalidate CPU Read/Write Access - * 0b0..Time and date counters can be read or written. Time and date is valid. - * 0b1..Time and date counter values are changing or time and date is invalid and cannot be read or written. - */ -#define RTC_STATUS_INVAL_BIT(x) (((uint16_t)(((uint16_t)(x)) << RTC_STATUS_INVAL_BIT_SHIFT)) & RTC_STATUS_INVAL_BIT_MASK) - -#define RTC_STATUS_WRITE_PROT_EN_MASK (0x2U) -#define RTC_STATUS_WRITE_PROT_EN_SHIFT (1U) -/*! WRITE_PROT_EN - Write Protect Enable Status - * 0b0..Registers are unlocked and can be accessed. - * 0b1..Registers are locked and in read-only mode. - */ -#define RTC_STATUS_WRITE_PROT_EN(x) (((uint16_t)(((uint16_t)(x)) << RTC_STATUS_WRITE_PROT_EN_SHIFT)) & RTC_STATUS_WRITE_PROT_EN_MASK) - -#define RTC_STATUS_CMP_INT_MASK (0x20U) -#define RTC_STATUS_CMP_INT_SHIFT (5U) -/*! CMP_INT - Compensation Interval */ -#define RTC_STATUS_CMP_INT(x) (((uint16_t)(((uint16_t)(x)) << RTC_STATUS_CMP_INT_SHIFT)) & RTC_STATUS_CMP_INT_MASK) - -#define RTC_STATUS_WE_MASK (0xC0U) -#define RTC_STATUS_WE_SHIFT (6U) -/*! WE - Write Enable - * 0b10..Enable Write Protection - Registers are locked. - */ -#define RTC_STATUS_WE(x) (((uint16_t)(((uint16_t)(x)) << RTC_STATUS_WE_SHIFT)) & RTC_STATUS_WE_MASK) - -#define RTC_STATUS_BUS_ERR_MASK (0x100U) -#define RTC_STATUS_BUS_ERR_SHIFT (8U) -/*! BUS_ERR - Bus Error - * 0b0..Read and write accesses are normal. - * 0b1..Read or write accesses occurred when STATUS[INVAL_BIT] was asserted. - */ -#define RTC_STATUS_BUS_ERR(x) (((uint16_t)(((uint16_t)(x)) << RTC_STATUS_BUS_ERR_SHIFT)) & RTC_STATUS_BUS_ERR_MASK) - -#define RTC_STATUS_CMP_DONE_MASK (0x800U) -#define RTC_STATUS_CMP_DONE_SHIFT (11U) -/*! CMP_DONE - Compensation Done - * 0b0..Compensation busy or not enabled - * 0b1..Compensation completed - */ -#define RTC_STATUS_CMP_DONE(x) (((uint16_t)(((uint16_t)(x)) << RTC_STATUS_CMP_DONE_SHIFT)) & RTC_STATUS_CMP_DONE_MASK) -/*! @} */ - -/*! @name ISR - Interrupt Status */ -/*! @{ */ - -#define RTC_ISR_ALM_IS_MASK (0x4U) -#define RTC_ISR_ALM_IS_SHIFT (2U) -/*! ALM_IS - Alarm Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_ALM_IS(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_ALM_IS_SHIFT)) & RTC_ISR_ALM_IS_MASK) - -#define RTC_ISR_DAY_IS_MASK (0x8U) -#define RTC_ISR_DAY_IS_SHIFT (3U) -/*! DAY_IS - Days Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_DAY_IS(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_DAY_IS_SHIFT)) & RTC_ISR_DAY_IS_MASK) - -#define RTC_ISR_HOUR_IS_MASK (0x10U) -#define RTC_ISR_HOUR_IS_SHIFT (4U) -/*! HOUR_IS - Hours Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_HOUR_IS(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_HOUR_IS_SHIFT)) & RTC_ISR_HOUR_IS_MASK) - -#define RTC_ISR_MIN_IS_MASK (0x20U) -#define RTC_ISR_MIN_IS_SHIFT (5U) -/*! MIN_IS - Minutes Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_MIN_IS(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_MIN_IS_SHIFT)) & RTC_ISR_MIN_IS_MASK) - -#define RTC_ISR_IS_1HZ_MASK (0x40U) -#define RTC_ISR_IS_1HZ_SHIFT (6U) -/*! IS_1HZ - 1 Hz Interval Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_IS_1HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_IS_1HZ_SHIFT)) & RTC_ISR_IS_1HZ_MASK) - -#define RTC_ISR_IS_2HZ_MASK (0x80U) -#define RTC_ISR_IS_2HZ_SHIFT (7U) -/*! IS_2HZ - 2 Hz Interval Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_IS_2HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_IS_2HZ_SHIFT)) & RTC_ISR_IS_2HZ_MASK) - -#define RTC_ISR_IS_4HZ_MASK (0x100U) -#define RTC_ISR_IS_4HZ_SHIFT (8U) -/*! IS_4HZ - 4 Hz Interval Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_IS_4HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_IS_4HZ_SHIFT)) & RTC_ISR_IS_4HZ_MASK) - -#define RTC_ISR_IS_8HZ_MASK (0x200U) -#define RTC_ISR_IS_8HZ_SHIFT (9U) -/*! IS_8HZ - 8 Hz Interval Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_IS_8HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_IS_8HZ_SHIFT)) & RTC_ISR_IS_8HZ_MASK) - -#define RTC_ISR_IS_16HZ_MASK (0x400U) -#define RTC_ISR_IS_16HZ_SHIFT (10U) -/*! IS_16HZ - 16 Hz Interval Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_IS_16HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_IS_16HZ_SHIFT)) & RTC_ISR_IS_16HZ_MASK) - -#define RTC_ISR_IS_32HZ_MASK (0x800U) -#define RTC_ISR_IS_32HZ_SHIFT (11U) -/*! IS_32HZ - 32 Hz Interval Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_IS_32HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_IS_32HZ_SHIFT)) & RTC_ISR_IS_32HZ_MASK) - -#define RTC_ISR_IS_64HZ_MASK (0x1000U) -#define RTC_ISR_IS_64HZ_SHIFT (12U) -/*! IS_64HZ - 64 Hz Interval Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_IS_64HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_IS_64HZ_SHIFT)) & RTC_ISR_IS_64HZ_MASK) - -#define RTC_ISR_IS_128HZ_MASK (0x2000U) -#define RTC_ISR_IS_128HZ_SHIFT (13U) -/*! IS_128HZ - 128 Hz Interval Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_IS_128HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_IS_128HZ_SHIFT)) & RTC_ISR_IS_128HZ_MASK) - -#define RTC_ISR_IS_256HZ_MASK (0x4000U) -#define RTC_ISR_IS_256HZ_SHIFT (14U) -/*! IS_256HZ - 256 Hz Interval Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_IS_256HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_IS_256HZ_SHIFT)) & RTC_ISR_IS_256HZ_MASK) - -#define RTC_ISR_IS_512HZ_MASK (0x8000U) -#define RTC_ISR_IS_512HZ_SHIFT (15U) -/*! IS_512HZ - 512 Hz Interval Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_IS_512HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_IS_512HZ_SHIFT)) & RTC_ISR_IS_512HZ_MASK) -/*! @} */ - -/*! @name IER - Interrupt Enable */ -/*! @{ */ - -#define RTC_IER_ALM_IE_MASK (0x4U) -#define RTC_IER_ALM_IE_SHIFT (2U) -/*! ALM_IE - Alarm Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_ALM_IE(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_ALM_IE_SHIFT)) & RTC_IER_ALM_IE_MASK) - -#define RTC_IER_DAY_IE_MASK (0x8U) -#define RTC_IER_DAY_IE_SHIFT (3U) -/*! DAY_IE - Days Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_DAY_IE(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_DAY_IE_SHIFT)) & RTC_IER_DAY_IE_MASK) - -#define RTC_IER_HOUR_IE_MASK (0x10U) -#define RTC_IER_HOUR_IE_SHIFT (4U) -/*! HOUR_IE - Hours Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_HOUR_IE(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_HOUR_IE_SHIFT)) & RTC_IER_HOUR_IE_MASK) - -#define RTC_IER_MIN_IE_MASK (0x20U) -#define RTC_IER_MIN_IE_SHIFT (5U) -/*! MIN_IE - Minutes Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_MIN_IE(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_MIN_IE_SHIFT)) & RTC_IER_MIN_IE_MASK) - -#define RTC_IER_IE_1HZ_MASK (0x40U) -#define RTC_IER_IE_1HZ_SHIFT (6U) -/*! IE_1HZ - 1 Hz Interval Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_IE_1HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_IE_1HZ_SHIFT)) & RTC_IER_IE_1HZ_MASK) - -#define RTC_IER_IE_2HZ_MASK (0x80U) -#define RTC_IER_IE_2HZ_SHIFT (7U) -/*! IE_2HZ - 2 Hz Interval Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_IE_2HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_IE_2HZ_SHIFT)) & RTC_IER_IE_2HZ_MASK) - -#define RTC_IER_IE_4HZ_MASK (0x100U) -#define RTC_IER_IE_4HZ_SHIFT (8U) -/*! IE_4HZ - 4 Hz Interval Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_IE_4HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_IE_4HZ_SHIFT)) & RTC_IER_IE_4HZ_MASK) - -#define RTC_IER_IE_8HZ_MASK (0x200U) -#define RTC_IER_IE_8HZ_SHIFT (9U) -/*! IE_8HZ - 8 Hz Interval Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_IE_8HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_IE_8HZ_SHIFT)) & RTC_IER_IE_8HZ_MASK) - -#define RTC_IER_IE_16HZ_MASK (0x400U) -#define RTC_IER_IE_16HZ_SHIFT (10U) -/*! IE_16HZ - 16 Hz Interval Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_IE_16HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_IE_16HZ_SHIFT)) & RTC_IER_IE_16HZ_MASK) - -#define RTC_IER_IE_32HZ_MASK (0x800U) -#define RTC_IER_IE_32HZ_SHIFT (11U) -/*! IE_32HZ - 32 Hz Interval Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_IE_32HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_IE_32HZ_SHIFT)) & RTC_IER_IE_32HZ_MASK) - -#define RTC_IER_IE_64HZ_MASK (0x1000U) -#define RTC_IER_IE_64HZ_SHIFT (12U) -/*! IE_64HZ - 64 Hz Interval Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_IE_64HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_IE_64HZ_SHIFT)) & RTC_IER_IE_64HZ_MASK) - -#define RTC_IER_IE_128HZ_MASK (0x2000U) -#define RTC_IER_IE_128HZ_SHIFT (13U) -/*! IE_128HZ - 128 Hz Interval Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_IE_128HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_IE_128HZ_SHIFT)) & RTC_IER_IE_128HZ_MASK) - -#define RTC_IER_IE_256HZ_MASK (0x4000U) -#define RTC_IER_IE_256HZ_SHIFT (14U) -/*! IE_256HZ - 256 Hz Interval Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_IE_256HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_IE_256HZ_SHIFT)) & RTC_IER_IE_256HZ_MASK) - -#define RTC_IER_IE_512HZ_MASK (0x8000U) -#define RTC_IER_IE_512HZ_SHIFT (15U) -/*! IE_512HZ - 512 Hz Interval Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_IE_512HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_IE_512HZ_SHIFT)) & RTC_IER_IE_512HZ_MASK) -/*! @} */ - -/*! @name RTC_TEST2 - Sub Second Counter */ -/*! @{ */ - -#define RTC_RTC_TEST2_SUB_SECOND_COUNT_MASK (0xFFFFU) -#define RTC_RTC_TEST2_SUB_SECOND_COUNT_SHIFT (0U) -/*! SUB_SECOND_COUNT - Sub Second Counter Value */ -#define RTC_RTC_TEST2_SUB_SECOND_COUNT(x) (((uint16_t)(((uint16_t)(x)) << RTC_RTC_TEST2_SUB_SECOND_COUNT_SHIFT)) & RTC_RTC_TEST2_SUB_SECOND_COUNT_MASK) -/*! @} */ - -/*! @name DST_HOUR - Daylight Saving Hour */ -/*! @{ */ - -#define RTC_DST_HOUR_DST_END_HOUR_MASK (0x1FU) -#define RTC_DST_HOUR_DST_END_HOUR_SHIFT (0U) -/*! DST_END_HOUR - Daylight Saving Time (DST) Hours End Value */ -#define RTC_DST_HOUR_DST_END_HOUR(x) (((uint16_t)(((uint16_t)(x)) << RTC_DST_HOUR_DST_END_HOUR_SHIFT)) & RTC_DST_HOUR_DST_END_HOUR_MASK) - -#define RTC_DST_HOUR_DST_START_HOUR_MASK (0x1F00U) -#define RTC_DST_HOUR_DST_START_HOUR_SHIFT (8U) -/*! DST_START_HOUR - Daylight Saving Time (DST) Hours Start Value */ -#define RTC_DST_HOUR_DST_START_HOUR(x) (((uint16_t)(((uint16_t)(x)) << RTC_DST_HOUR_DST_START_HOUR_SHIFT)) & RTC_DST_HOUR_DST_START_HOUR_MASK) -/*! @} */ - -/*! @name DST_MONTH - Daylight Saving Month */ -/*! @{ */ - -#define RTC_DST_MONTH_DST_END_MONTH_MASK (0xFU) -#define RTC_DST_MONTH_DST_END_MONTH_SHIFT (0U) -/*! DST_END_MONTH - Daylight Saving Time (DST) Month End Value */ -#define RTC_DST_MONTH_DST_END_MONTH(x) (((uint16_t)(((uint16_t)(x)) << RTC_DST_MONTH_DST_END_MONTH_SHIFT)) & RTC_DST_MONTH_DST_END_MONTH_MASK) - -#define RTC_DST_MONTH_DST_START_MONTH_MASK (0xF00U) -#define RTC_DST_MONTH_DST_START_MONTH_SHIFT (8U) -/*! DST_START_MONTH - Daylight Saving Time (DST) Month Start Value */ -#define RTC_DST_MONTH_DST_START_MONTH(x) (((uint16_t)(((uint16_t)(x)) << RTC_DST_MONTH_DST_START_MONTH_SHIFT)) & RTC_DST_MONTH_DST_START_MONTH_MASK) -/*! @} */ - -/*! @name DST_DAY - Daylight Saving Day */ -/*! @{ */ - -#define RTC_DST_DAY_DST_END_DAY_MASK (0x1FU) -#define RTC_DST_DAY_DST_END_DAY_SHIFT (0U) -/*! DST_END_DAY - Daylight Saving Time (DST) Day End Value */ -#define RTC_DST_DAY_DST_END_DAY(x) (((uint16_t)(((uint16_t)(x)) << RTC_DST_DAY_DST_END_DAY_SHIFT)) & RTC_DST_DAY_DST_END_DAY_MASK) - -#define RTC_DST_DAY_DST_START_DAY_MASK (0x1F00U) -#define RTC_DST_DAY_DST_START_DAY_SHIFT (8U) -/*! DST_START_DAY - Daylight Saving Time (DST) Day Start Value */ -#define RTC_DST_DAY_DST_START_DAY(x) (((uint16_t)(((uint16_t)(x)) << RTC_DST_DAY_DST_START_DAY_SHIFT)) & RTC_DST_DAY_DST_START_DAY_MASK) -/*! @} */ - -/*! @name COMPEN - Compensation */ -/*! @{ */ - -#define RTC_COMPEN_COMPEN_VAL_MASK (0xFFFFU) -#define RTC_COMPEN_COMPEN_VAL_SHIFT (0U) -/*! COMPEN_VAL - Compensation Value */ -#define RTC_COMPEN_COMPEN_VAL(x) (((uint16_t)(((uint16_t)(x)) << RTC_COMPEN_COMPEN_VAL_SHIFT)) & RTC_COMPEN_COMPEN_VAL_MASK) -/*! @} */ - -/*! @name SUBSECOND_CTRL - Subsecond Control */ -/*! @{ */ - -#define RTC_SUBSECOND_CTRL_SUB_SECOND_CNT_EN_MASK (0x1U) -#define RTC_SUBSECOND_CTRL_SUB_SECOND_CNT_EN_SHIFT (0U) -/*! SUB_SECOND_CNT_EN - Subsecond Counter Enable - * 0b0..Disable - * 0b1..Enable - */ -#define RTC_SUBSECOND_CTRL_SUB_SECOND_CNT_EN(x) (((uint32_t)(((uint32_t)(x)) << RTC_SUBSECOND_CTRL_SUB_SECOND_CNT_EN_SHIFT)) & RTC_SUBSECOND_CTRL_SUB_SECOND_CNT_EN_MASK) -/*! @} */ - -/*! @name SUBSECOND_CNT - Subsecond Counter */ -/*! @{ */ - -#define RTC_SUBSECOND_CNT_SUBSECOND_CNT_MASK (0xFFFFU) -#define RTC_SUBSECOND_CNT_SUBSECOND_CNT_SHIFT (0U) -/*! SUBSECOND_CNT - Current Subsecond Counter Value */ -#define RTC_SUBSECOND_CNT_SUBSECOND_CNT(x) (((uint32_t)(((uint32_t)(x)) << RTC_SUBSECOND_CNT_SUBSECOND_CNT_SHIFT)) & RTC_SUBSECOND_CNT_SUBSECOND_CNT_MASK) -/*! @} */ - -/*! @name WAKE_TIMER_CTRL - Wake Timer Control */ -/*! @{ */ - -#define RTC_WAKE_TIMER_CTRL_WAKE_FLAG_MASK (0x2U) -#define RTC_WAKE_TIMER_CTRL_WAKE_FLAG_SHIFT (1U) -/*! WAKE_FLAG - Wake Timer Status Flag - * 0b0..Not timed out - * 0b1..Timed out - */ -#define RTC_WAKE_TIMER_CTRL_WAKE_FLAG(x) (((uint32_t)(((uint32_t)(x)) << RTC_WAKE_TIMER_CTRL_WAKE_FLAG_SHIFT)) & RTC_WAKE_TIMER_CTRL_WAKE_FLAG_MASK) - -#define RTC_WAKE_TIMER_CTRL_CLR_WAKE_TIMER_MASK (0x4U) -#define RTC_WAKE_TIMER_CTRL_CLR_WAKE_TIMER_SHIFT (2U) -/*! CLR_WAKE_TIMER - Clear Wake Timer - * 0b0..No effect - * 0b1..Clear the wake timer counter - */ -#define RTC_WAKE_TIMER_CTRL_CLR_WAKE_TIMER(x) (((uint32_t)(((uint32_t)(x)) << RTC_WAKE_TIMER_CTRL_CLR_WAKE_TIMER_SHIFT)) & RTC_WAKE_TIMER_CTRL_CLR_WAKE_TIMER_MASK) - -#define RTC_WAKE_TIMER_CTRL_OSC_DIV_ENA_MASK (0x10U) -#define RTC_WAKE_TIMER_CTRL_OSC_DIV_ENA_SHIFT (4U) -/*! OSC_DIV_ENA - OSC Divide Enable - * 0b0..Disable - * 0b1..Enable - */ -#define RTC_WAKE_TIMER_CTRL_OSC_DIV_ENA(x) (((uint32_t)(((uint32_t)(x)) << RTC_WAKE_TIMER_CTRL_OSC_DIV_ENA_SHIFT)) & RTC_WAKE_TIMER_CTRL_OSC_DIV_ENA_MASK) - -#define RTC_WAKE_TIMER_CTRL_INTR_EN_MASK (0x20U) -#define RTC_WAKE_TIMER_CTRL_INTR_EN_SHIFT (5U) -/*! INTR_EN - Enable Interrupt - * 0b0..Disable - * 0b1..Enable - */ -#define RTC_WAKE_TIMER_CTRL_INTR_EN(x) (((uint32_t)(((uint32_t)(x)) << RTC_WAKE_TIMER_CTRL_INTR_EN_SHIFT)) & RTC_WAKE_TIMER_CTRL_INTR_EN_MASK) -/*! @} */ - -/*! @name WAKE_TIMER_CNT - Wake Timer Counter */ -/*! @{ */ - -#define RTC_WAKE_TIMER_CNT_WAKE_CNT_MASK (0xFFFFFFFFU) -#define RTC_WAKE_TIMER_CNT_WAKE_CNT_SHIFT (0U) -/*! WAKE_CNT - Wake Counter */ -#define RTC_WAKE_TIMER_CNT_WAKE_CNT(x) (((uint32_t)(((uint32_t)(x)) << RTC_WAKE_TIMER_CNT_WAKE_CNT_SHIFT)) & RTC_WAKE_TIMER_CNT_WAKE_CNT_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group RTC_Register_Masks */ - - -/* RTC - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral RTC0 base address */ - #define RTC0_BASE (0x5004C000u) - /** Peripheral RTC0 base address */ - #define RTC0_BASE_NS (0x4004C000u) - /** Peripheral RTC0 base pointer */ - #define RTC0 ((RTC_Type *)RTC0_BASE) - /** Peripheral RTC0 base pointer */ - #define RTC0_NS ((RTC_Type *)RTC0_BASE_NS) - /** Array initializer of RTC peripheral base addresses */ - #define RTC_BASE_ADDRS { RTC0_BASE } - /** Array initializer of RTC peripheral base pointers */ - #define RTC_BASE_PTRS { RTC0 } - /** Array initializer of RTC peripheral base addresses */ - #define RTC_BASE_ADDRS_NS { RTC0_BASE_NS } - /** Array initializer of RTC peripheral base pointers */ - #define RTC_BASE_PTRS_NS { RTC0_NS } -#else - /** Peripheral RTC0 base address */ - #define RTC0_BASE (0x4004C000u) - /** Peripheral RTC0 base pointer */ - #define RTC0 ((RTC_Type *)RTC0_BASE) - /** Array initializer of RTC peripheral base addresses */ - #define RTC_BASE_ADDRS { RTC0_BASE } - /** Array initializer of RTC peripheral base pointers */ - #define RTC_BASE_PTRS { RTC0 } -#endif -/** Interrupt vectors for the RTC peripheral type */ -#define RTC_IRQS { RTC_IRQn } -/* Backward compatibility for RTC */ -#define RTC RTC0 - - -/*! - * @} - */ /* end of group RTC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- S50 Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup S50_Peripheral_Access_Layer S50 Peripheral Access Layer - * @{ - */ - -/** S50 - Register Layout Typedef */ -typedef struct { - __I uint32_t ELS_STATUS; /**< Status Register, offset: 0x0 */ - __IO uint32_t ELS_CTRL; /**< Control Register, offset: 0x4 */ - __IO uint32_t ELS_CMDCFG0; /**< Command Configuration, offset: 0x8 */ - __IO uint32_t ELS_CFG; /**< Configuration Register, offset: 0xC */ - __IO uint32_t ELS_KIDX0; /**< Keystore Index 0, offset: 0x10 */ - __IO uint32_t ELS_KIDX1; /**< Keystore Index 1, offset: 0x14 */ - __IO uint32_t ELS_KPROPIN; /**< Key Properties Request, offset: 0x18 */ - uint8_t RESERVED_0[4]; - __IO uint32_t ELS_DMA_SRC0; /**< DMA Source 0, offset: 0x20 */ - __IO uint32_t ELS_DMA_SRC0_LEN; /**< DMA Source 0 Length, offset: 0x24 */ - __IO uint32_t ELS_DMA_SRC1; /**< DMA Source 1, offset: 0x28 */ - uint8_t RESERVED_1[4]; - __IO uint32_t ELS_DMA_SRC2; /**< DMA Source 2, offset: 0x30 */ - __IO uint32_t ELS_DMA_SRC2_LEN; /**< DMA Source 2 Length, offset: 0x34 */ - __IO uint32_t ELS_DMA_RES0; /**< DMA Result 0, offset: 0x38 */ - __IO uint32_t ELS_DMA_RES0_LEN; /**< DMA Result 0 Length, offset: 0x3C */ - __IO uint32_t ELS_INT_ENABLE; /**< Interrupt Enable, offset: 0x40 */ - __O uint32_t ELS_INT_STATUS_CLR; /**< Interrupt Status Clear, offset: 0x44 */ - __O uint32_t ELS_INT_STATUS_SET; /**< Interrupt Status Set, offset: 0x48 */ - __I uint32_t ELS_ERR_STATUS; /**< Error Status, offset: 0x4C */ - __O uint32_t ELS_ERR_STATUS_CLR; /**< Error Status Clear, offset: 0x50 */ - __I uint32_t ELS_VERSION; /**< Version Register, offset: 0x54 */ - uint8_t RESERVED_2[4]; - __I uint32_t ELS_PRNG_DATOUT; /**< PRNG SW Read Out, offset: 0x5C */ - __IO uint32_t ELS_CMDCRC_CTRL; /**< CRC Configuration, offset: 0x60 */ - __I uint32_t ELS_CMDCRC; /**< Command CRC Value, offset: 0x64 */ - __IO uint32_t ELS_SESSION_ID; /**< Session ID, offset: 0x68 */ - uint8_t RESERVED_3[4]; - __I uint32_t ELS_DMA_FIN_ADDR; /**< Final DMA Address, offset: 0x70 */ - __IO uint32_t ELS_MASTER_ID; /**< Master ID, offset: 0x74 */ - __IO uint32_t ELS_KIDX2; /**< Keystore Index 2, offset: 0x78 */ - uint8_t RESERVED_4[212]; - __I uint32_t ELS_KS0; /**< Status Register, offset: 0x150 */ - __I uint32_t ELS_KS1; /**< Status Register, offset: 0x154 */ - __I uint32_t ELS_KS2; /**< Status Register, offset: 0x158 */ - __I uint32_t ELS_KS3; /**< Status Register, offset: 0x15C */ - __I uint32_t ELS_KS4; /**< Status Register, offset: 0x160 */ - __I uint32_t ELS_KS5; /**< Status Register, offset: 0x164 */ - __I uint32_t ELS_KS6; /**< Status Register, offset: 0x168 */ - __I uint32_t ELS_KS7; /**< Status Register, offset: 0x16C */ - __I uint32_t ELS_KS8; /**< Status Register, offset: 0x170 */ - __I uint32_t ELS_KS9; /**< Status Register, offset: 0x174 */ - __I uint32_t ELS_KS10; /**< Status Register, offset: 0x178 */ - __I uint32_t ELS_KS11; /**< Status Register, offset: 0x17C */ - __I uint32_t ELS_KS12; /**< Status Register, offset: 0x180 */ - __I uint32_t ELS_KS13; /**< Status Register, offset: 0x184 */ - __I uint32_t ELS_KS14; /**< Status Register, offset: 0x188 */ - __I uint32_t ELS_KS15; /**< Status Register, offset: 0x18C */ - __I uint32_t ELS_KS16; /**< Status Register, offset: 0x190 */ - __I uint32_t ELS_KS17; /**< Status Register, offset: 0x194 */ - __I uint32_t ELS_KS18; /**< Status Register, offset: 0x198 */ - __I uint32_t ELS_KS19; /**< Status Register, offset: 0x19C */ -} S50_Type; - -/* ---------------------------------------------------------------------------- - -- S50 Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup S50_Register_Masks S50 Register Masks - * @{ - */ - -/*! @name ELS_STATUS - Status Register */ -/*! @{ */ - -#define S50_ELS_STATUS_ELS_BUSY_MASK (0x1U) -#define S50_ELS_STATUS_ELS_BUSY_SHIFT (0U) -/*! ELS_BUSY - * 0b1..Crypto sequence executing - * 0b0..Crypto sequence not executing - */ -#define S50_ELS_STATUS_ELS_BUSY(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_STATUS_ELS_BUSY_SHIFT)) & S50_ELS_STATUS_ELS_BUSY_MASK) - -#define S50_ELS_STATUS_ELS_IRQ_MASK (0x2U) -#define S50_ELS_STATUS_ELS_IRQ_SHIFT (1U) -/*! ELS_IRQ - * 0b1..Active interrupt - * 0b0..No active interrupt - */ -#define S50_ELS_STATUS_ELS_IRQ(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_STATUS_ELS_IRQ_SHIFT)) & S50_ELS_STATUS_ELS_IRQ_MASK) - -#define S50_ELS_STATUS_ELS_ERR_MASK (0x4U) -#define S50_ELS_STATUS_ELS_ERR_SHIFT (2U) -/*! ELS_ERR - * 0b1..Internal error detected - * 0b0..Internal error not detected - */ -#define S50_ELS_STATUS_ELS_ERR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_STATUS_ELS_ERR_SHIFT)) & S50_ELS_STATUS_ELS_ERR_MASK) - -#define S50_ELS_STATUS_PRNG_RDY_MASK (0x8U) -#define S50_ELS_STATUS_PRNG_RDY_SHIFT (3U) -/*! PRNG_RDY - * 0b0..Internal PRNG not ready - * 0b1..Internal PRNG ready - */ -#define S50_ELS_STATUS_PRNG_RDY(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_STATUS_PRNG_RDY_SHIFT)) & S50_ELS_STATUS_PRNG_RDY_MASK) - -#define S50_ELS_STATUS_ECDSA_VFY_STATUS_MASK (0x30U) -#define S50_ELS_STATUS_ECDSA_VFY_STATUS_SHIFT (4U) -/*! ECDSA_VFY_STATUS - * 0b11..Invalid, Error - * 0b00..No verify run - * 0b01..Signature verify failed - * 0b10..Signature verify passed - */ -#define S50_ELS_STATUS_ECDSA_VFY_STATUS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_STATUS_ECDSA_VFY_STATUS_SHIFT)) & S50_ELS_STATUS_ECDSA_VFY_STATUS_MASK) - -#define S50_ELS_STATUS_PPROT_MASK (0xC0U) -#define S50_ELS_STATUS_PPROT_SHIFT (6U) -/*! PPROT - * 0b10..Non-secure, non-privileged - * 0b11..Non-secure, privileged - * 0b00..Secure, non-privileged - * 0b01..Secure, privileged - */ -#define S50_ELS_STATUS_PPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_STATUS_PPROT_SHIFT)) & S50_ELS_STATUS_PPROT_MASK) - -#define S50_ELS_STATUS_DRBG_ENT_LVL_MASK (0x300U) -#define S50_ELS_STATUS_DRBG_ENT_LVL_SHIFT (8U) -/*! DRBG_ENT_LVL - * 0b10..HIGH, DRBG generates random numbers of high quality entropy - * 0b01..LOW, DRBG generates random numbers of low quality entropy - * 0b00..NONE - * 0b11..RFU, Reserved for Future Use - */ -#define S50_ELS_STATUS_DRBG_ENT_LVL(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_STATUS_DRBG_ENT_LVL_SHIFT)) & S50_ELS_STATUS_DRBG_ENT_LVL_MASK) - -#define S50_ELS_STATUS_DTRNG_BUSY_MASK (0x400U) -#define S50_ELS_STATUS_DTRNG_BUSY_SHIFT (10U) -/*! DTRNG_BUSY - * 0b1..Gathering entropy - * 0b0..Not gathering entropy - */ -#define S50_ELS_STATUS_DTRNG_BUSY(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_STATUS_DTRNG_BUSY_SHIFT)) & S50_ELS_STATUS_DTRNG_BUSY_MASK) - -#define S50_ELS_STATUS_ELS_LOCKED_MASK (0x10000U) -#define S50_ELS_STATUS_ELS_LOCKED_SHIFT (16U) -/*! ELS_LOCKED - * 0b1..Locked by master - * 0b0..Not locked by master - */ -#define S50_ELS_STATUS_ELS_LOCKED(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_STATUS_ELS_LOCKED_SHIFT)) & S50_ELS_STATUS_ELS_LOCKED_MASK) -/*! @} */ - -/*! @name ELS_CTRL - Control Register */ -/*! @{ */ - -#define S50_ELS_CTRL_ELS_EN_MASK (0x1U) -#define S50_ELS_CTRL_ELS_EN_SHIFT (0U) -/*! ELS_EN - * 0b0..Disabled - * 0b1..Enabled - */ -#define S50_ELS_CTRL_ELS_EN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_CTRL_ELS_EN_SHIFT)) & S50_ELS_CTRL_ELS_EN_MASK) - -#define S50_ELS_CTRL_ELS_START_MASK (0x2U) -#define S50_ELS_CTRL_ELS_START_SHIFT (1U) -#define S50_ELS_CTRL_ELS_START(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_CTRL_ELS_START_SHIFT)) & S50_ELS_CTRL_ELS_START_MASK) - -#define S50_ELS_CTRL_ELS_RESET_MASK (0x4U) -#define S50_ELS_CTRL_ELS_RESET_SHIFT (2U) -#define S50_ELS_CTRL_ELS_RESET(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_CTRL_ELS_RESET_SHIFT)) & S50_ELS_CTRL_ELS_RESET_MASK) - -#define S50_ELS_CTRL_ELS_CMD_MASK (0xF8U) -#define S50_ELS_CTRL_ELS_CMD_SHIFT (3U) -/*! ELS_CMD - ELS Command ID */ -#define S50_ELS_CTRL_ELS_CMD(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_CTRL_ELS_CMD_SHIFT)) & S50_ELS_CTRL_ELS_CMD_MASK) - -#define S50_ELS_CTRL_BYTE_ORDER_MASK (0x100U) -#define S50_ELS_CTRL_BYTE_ORDER_SHIFT (8U) -/*! BYTE_ORDER - * 0b1..Big endian - * 0b0..Little endian - */ -#define S50_ELS_CTRL_BYTE_ORDER(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_CTRL_BYTE_ORDER_SHIFT)) & S50_ELS_CTRL_BYTE_ORDER_MASK) -/*! @} */ - -/*! @name ELS_CMDCFG0 - Command Configuration */ -/*! @{ */ - -#define S50_ELS_CMDCFG0_CMDCFG0_MASK (0xFFFFFFFFU) -#define S50_ELS_CMDCFG0_CMDCFG0_SHIFT (0U) -#define S50_ELS_CMDCFG0_CMDCFG0(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_CMDCFG0_CMDCFG0_SHIFT)) & S50_ELS_CMDCFG0_CMDCFG0_MASK) -/*! @} */ - -/*! @name ELS_CFG - Configuration Register */ -/*! @{ */ - -#define S50_ELS_CFG_ADCTRL_MASK (0x3FF0000U) -#define S50_ELS_CFG_ADCTRL_SHIFT (16U) -#define S50_ELS_CFG_ADCTRL(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_CFG_ADCTRL_SHIFT)) & S50_ELS_CFG_ADCTRL_MASK) -/*! @} */ - -/*! @name ELS_KIDX0 - Keystore Index 0 */ -/*! @{ */ - -#define S50_ELS_KIDX0_KIDX0_MASK (0x1FU) -#define S50_ELS_KIDX0_KIDX0_SHIFT (0U) -#define S50_ELS_KIDX0_KIDX0(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KIDX0_KIDX0_SHIFT)) & S50_ELS_KIDX0_KIDX0_MASK) -/*! @} */ - -/*! @name ELS_KIDX1 - Keystore Index 1 */ -/*! @{ */ - -#define S50_ELS_KIDX1_KIDX1_MASK (0x1FU) -#define S50_ELS_KIDX1_KIDX1_SHIFT (0U) -#define S50_ELS_KIDX1_KIDX1(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KIDX1_KIDX1_SHIFT)) & S50_ELS_KIDX1_KIDX1_MASK) -/*! @} */ - -/*! @name ELS_KPROPIN - Key Properties Request */ -/*! @{ */ - -#define S50_ELS_KPROPIN_KPROPIN_MASK (0xFFFFFFFFU) -#define S50_ELS_KPROPIN_KPROPIN_SHIFT (0U) -#define S50_ELS_KPROPIN_KPROPIN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KPROPIN_KPROPIN_SHIFT)) & S50_ELS_KPROPIN_KPROPIN_MASK) -/*! @} */ - -/*! @name ELS_DMA_SRC0 - DMA Source 0 */ -/*! @{ */ - -#define S50_ELS_DMA_SRC0_ADDR_SRC0_MASK (0xFFFFFFFFU) -#define S50_ELS_DMA_SRC0_ADDR_SRC0_SHIFT (0U) -#define S50_ELS_DMA_SRC0_ADDR_SRC0(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_DMA_SRC0_ADDR_SRC0_SHIFT)) & S50_ELS_DMA_SRC0_ADDR_SRC0_MASK) -/*! @} */ - -/*! @name ELS_DMA_SRC0_LEN - DMA Source 0 Length */ -/*! @{ */ - -#define S50_ELS_DMA_SRC0_LEN_SIZE_SRC0_LEN_MASK (0xFFFFFFFFU) -#define S50_ELS_DMA_SRC0_LEN_SIZE_SRC0_LEN_SHIFT (0U) -#define S50_ELS_DMA_SRC0_LEN_SIZE_SRC0_LEN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_DMA_SRC0_LEN_SIZE_SRC0_LEN_SHIFT)) & S50_ELS_DMA_SRC0_LEN_SIZE_SRC0_LEN_MASK) -/*! @} */ - -/*! @name ELS_DMA_SRC1 - DMA Source 1 */ -/*! @{ */ - -#define S50_ELS_DMA_SRC1_ADDR_SRC1_MASK (0xFFFFFFFFU) -#define S50_ELS_DMA_SRC1_ADDR_SRC1_SHIFT (0U) -#define S50_ELS_DMA_SRC1_ADDR_SRC1(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_DMA_SRC1_ADDR_SRC1_SHIFT)) & S50_ELS_DMA_SRC1_ADDR_SRC1_MASK) -/*! @} */ - -/*! @name ELS_DMA_SRC2 - DMA Source 2 */ -/*! @{ */ - -#define S50_ELS_DMA_SRC2_ADDR_SRC2_MASK (0xFFFFFFFFU) -#define S50_ELS_DMA_SRC2_ADDR_SRC2_SHIFT (0U) -#define S50_ELS_DMA_SRC2_ADDR_SRC2(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_DMA_SRC2_ADDR_SRC2_SHIFT)) & S50_ELS_DMA_SRC2_ADDR_SRC2_MASK) -/*! @} */ - -/*! @name ELS_DMA_SRC2_LEN - DMA Source 2 Length */ -/*! @{ */ - -#define S50_ELS_DMA_SRC2_LEN_SIZE_SRC2_LEN_MASK (0xFFFFFFFFU) -#define S50_ELS_DMA_SRC2_LEN_SIZE_SRC2_LEN_SHIFT (0U) -#define S50_ELS_DMA_SRC2_LEN_SIZE_SRC2_LEN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_DMA_SRC2_LEN_SIZE_SRC2_LEN_SHIFT)) & S50_ELS_DMA_SRC2_LEN_SIZE_SRC2_LEN_MASK) -/*! @} */ - -/*! @name ELS_DMA_RES0 - DMA Result 0 */ -/*! @{ */ - -#define S50_ELS_DMA_RES0_ADDR_RES0_MASK (0xFFFFFFFFU) -#define S50_ELS_DMA_RES0_ADDR_RES0_SHIFT (0U) -#define S50_ELS_DMA_RES0_ADDR_RES0(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_DMA_RES0_ADDR_RES0_SHIFT)) & S50_ELS_DMA_RES0_ADDR_RES0_MASK) -/*! @} */ - -/*! @name ELS_DMA_RES0_LEN - DMA Result 0 Length */ -/*! @{ */ - -#define S50_ELS_DMA_RES0_LEN_SIZE_RES0_LEN_MASK (0xFFFFFFFFU) -#define S50_ELS_DMA_RES0_LEN_SIZE_RES0_LEN_SHIFT (0U) -#define S50_ELS_DMA_RES0_LEN_SIZE_RES0_LEN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_DMA_RES0_LEN_SIZE_RES0_LEN_SHIFT)) & S50_ELS_DMA_RES0_LEN_SIZE_RES0_LEN_MASK) -/*! @} */ - -/*! @name ELS_INT_ENABLE - Interrupt Enable */ -/*! @{ */ - -#define S50_ELS_INT_ENABLE_INT_EN_MASK (0x1U) -#define S50_ELS_INT_ENABLE_INT_EN_SHIFT (0U) -/*! INT_EN - * 0b0..Disables - * 0b1..Enables - */ -#define S50_ELS_INT_ENABLE_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_INT_ENABLE_INT_EN_SHIFT)) & S50_ELS_INT_ENABLE_INT_EN_MASK) -/*! @} */ - -/*! @name ELS_INT_STATUS_CLR - Interrupt Status Clear */ -/*! @{ */ - -#define S50_ELS_INT_STATUS_CLR_INT_CLR_MASK (0x1U) -#define S50_ELS_INT_STATUS_CLR_INT_CLR_SHIFT (0U) -#define S50_ELS_INT_STATUS_CLR_INT_CLR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_INT_STATUS_CLR_INT_CLR_SHIFT)) & S50_ELS_INT_STATUS_CLR_INT_CLR_MASK) -/*! @} */ - -/*! @name ELS_INT_STATUS_SET - Interrupt Status Set */ -/*! @{ */ - -#define S50_ELS_INT_STATUS_SET_INT_SET_MASK (0x1U) -#define S50_ELS_INT_STATUS_SET_INT_SET_SHIFT (0U) -#define S50_ELS_INT_STATUS_SET_INT_SET(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_INT_STATUS_SET_INT_SET_SHIFT)) & S50_ELS_INT_STATUS_SET_INT_SET_MASK) -/*! @} */ - -/*! @name ELS_ERR_STATUS - Error Status */ -/*! @{ */ - -#define S50_ELS_ERR_STATUS_BUS_ERR_MASK (0x1U) -#define S50_ELS_ERR_STATUS_BUS_ERR_SHIFT (0U) -/*! BUS_ERR - * 0b0..No error - * 0b1..Error occurred - */ -#define S50_ELS_ERR_STATUS_BUS_ERR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_ERR_STATUS_BUS_ERR_SHIFT)) & S50_ELS_ERR_STATUS_BUS_ERR_MASK) - -#define S50_ELS_ERR_STATUS_OPN_ERR_MASK (0x2U) -#define S50_ELS_ERR_STATUS_OPN_ERR_SHIFT (1U) -/*! OPN_ERR - * 0b0..No error - * 0b1..Error occurred - */ -#define S50_ELS_ERR_STATUS_OPN_ERR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_ERR_STATUS_OPN_ERR_SHIFT)) & S50_ELS_ERR_STATUS_OPN_ERR_MASK) - -#define S50_ELS_ERR_STATUS_ALG_ERR_MASK (0x4U) -#define S50_ELS_ERR_STATUS_ALG_ERR_SHIFT (2U) -/*! ALG_ERR - * 0b0..No error - * 0b1..Error occurred - */ -#define S50_ELS_ERR_STATUS_ALG_ERR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_ERR_STATUS_ALG_ERR_SHIFT)) & S50_ELS_ERR_STATUS_ALG_ERR_MASK) - -#define S50_ELS_ERR_STATUS_ITG_ERR_MASK (0x8U) -#define S50_ELS_ERR_STATUS_ITG_ERR_SHIFT (3U) -/*! ITG_ERR - * 0b0..No error - * 0b1..Error occurred - */ -#define S50_ELS_ERR_STATUS_ITG_ERR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_ERR_STATUS_ITG_ERR_SHIFT)) & S50_ELS_ERR_STATUS_ITG_ERR_MASK) - -#define S50_ELS_ERR_STATUS_FLT_ERR_MASK (0x10U) -#define S50_ELS_ERR_STATUS_FLT_ERR_SHIFT (4U) -/*! FLT_ERR - * 0b0..No error - * 0b1..Error occurred - */ -#define S50_ELS_ERR_STATUS_FLT_ERR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_ERR_STATUS_FLT_ERR_SHIFT)) & S50_ELS_ERR_STATUS_FLT_ERR_MASK) - -#define S50_ELS_ERR_STATUS_PRNG_ERR_MASK (0x20U) -#define S50_ELS_ERR_STATUS_PRNG_ERR_SHIFT (5U) -/*! PRNG_ERR - * 0b0..No error - * 0b1..Error occurred - */ -#define S50_ELS_ERR_STATUS_PRNG_ERR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_ERR_STATUS_PRNG_ERR_SHIFT)) & S50_ELS_ERR_STATUS_PRNG_ERR_MASK) - -#define S50_ELS_ERR_STATUS_ERR_LVL_MASK (0xC0U) -#define S50_ELS_ERR_STATUS_ERR_LVL_SHIFT (6U) -#define S50_ELS_ERR_STATUS_ERR_LVL(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_ERR_STATUS_ERR_LVL_SHIFT)) & S50_ELS_ERR_STATUS_ERR_LVL_MASK) - -#define S50_ELS_ERR_STATUS_DTRNG_ERR_MASK (0x100U) -#define S50_ELS_ERR_STATUS_DTRNG_ERR_SHIFT (8U) -/*! DTRNG_ERR - * 0b0..No error - * 0b1..TRNG error occurred - */ -#define S50_ELS_ERR_STATUS_DTRNG_ERR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_ERR_STATUS_DTRNG_ERR_SHIFT)) & S50_ELS_ERR_STATUS_DTRNG_ERR_MASK) -/*! @} */ - -/*! @name ELS_ERR_STATUS_CLR - Error Status Clear */ -/*! @{ */ - -#define S50_ELS_ERR_STATUS_CLR_ERR_CLR_MASK (0x1U) -#define S50_ELS_ERR_STATUS_CLR_ERR_CLR_SHIFT (0U) -/*! ERR_CLR - * 0b1..Clears ELS error state - * 0b0..Exits ELS error state - */ -#define S50_ELS_ERR_STATUS_CLR_ERR_CLR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_ERR_STATUS_CLR_ERR_CLR_SHIFT)) & S50_ELS_ERR_STATUS_CLR_ERR_CLR_MASK) -/*! @} */ - -/*! @name ELS_VERSION - Version Register */ -/*! @{ */ - -#define S50_ELS_VERSION_Z_MASK (0xFU) -#define S50_ELS_VERSION_Z_SHIFT (0U) -#define S50_ELS_VERSION_Z(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_VERSION_Z_SHIFT)) & S50_ELS_VERSION_Z_MASK) - -#define S50_ELS_VERSION_Y2_MASK (0xF0U) -#define S50_ELS_VERSION_Y2_SHIFT (4U) -#define S50_ELS_VERSION_Y2(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_VERSION_Y2_SHIFT)) & S50_ELS_VERSION_Y2_MASK) - -#define S50_ELS_VERSION_Y1_MASK (0xF00U) -#define S50_ELS_VERSION_Y1_SHIFT (8U) -#define S50_ELS_VERSION_Y1(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_VERSION_Y1_SHIFT)) & S50_ELS_VERSION_Y1_MASK) - -#define S50_ELS_VERSION_X_MASK (0xF000U) -#define S50_ELS_VERSION_X_SHIFT (12U) -#define S50_ELS_VERSION_X(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_VERSION_X_SHIFT)) & S50_ELS_VERSION_X_MASK) - -#define S50_ELS_VERSION_SW_Z_MASK (0xF0000U) -#define S50_ELS_VERSION_SW_Z_SHIFT (16U) -#define S50_ELS_VERSION_SW_Z(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_VERSION_SW_Z_SHIFT)) & S50_ELS_VERSION_SW_Z_MASK) - -#define S50_ELS_VERSION_SW_Y2_MASK (0xF00000U) -#define S50_ELS_VERSION_SW_Y2_SHIFT (20U) -#define S50_ELS_VERSION_SW_Y2(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_VERSION_SW_Y2_SHIFT)) & S50_ELS_VERSION_SW_Y2_MASK) - -#define S50_ELS_VERSION_SW_Y1_MASK (0xF000000U) -#define S50_ELS_VERSION_SW_Y1_SHIFT (24U) -#define S50_ELS_VERSION_SW_Y1(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_VERSION_SW_Y1_SHIFT)) & S50_ELS_VERSION_SW_Y1_MASK) - -#define S50_ELS_VERSION_SW_X_MASK (0xF0000000U) -#define S50_ELS_VERSION_SW_X_SHIFT (28U) -#define S50_ELS_VERSION_SW_X(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_VERSION_SW_X_SHIFT)) & S50_ELS_VERSION_SW_X_MASK) -/*! @} */ - -/*! @name ELS_PRNG_DATOUT - PRNG SW Read Out */ -/*! @{ */ - -#define S50_ELS_PRNG_DATOUT_PRNG_DATOUT_MASK (0xFFFFFFFFU) -#define S50_ELS_PRNG_DATOUT_PRNG_DATOUT_SHIFT (0U) -#define S50_ELS_PRNG_DATOUT_PRNG_DATOUT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_PRNG_DATOUT_PRNG_DATOUT_SHIFT)) & S50_ELS_PRNG_DATOUT_PRNG_DATOUT_MASK) -/*! @} */ - -/*! @name ELS_CMDCRC_CTRL - CRC Configuration */ -/*! @{ */ - -#define S50_ELS_CMDCRC_CTRL_CMDCRC_RST_MASK (0x1U) -#define S50_ELS_CMDCRC_CTRL_CMDCRC_RST_SHIFT (0U) -/*! CMDCRC_RST - * 0b1..Resets the CRC command to its default value - * 0b0..No effect - */ -#define S50_ELS_CMDCRC_CTRL_CMDCRC_RST(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_CMDCRC_CTRL_CMDCRC_RST_SHIFT)) & S50_ELS_CMDCRC_CTRL_CMDCRC_RST_MASK) - -#define S50_ELS_CMDCRC_CTRL_CMDCRC_EN_MASK (0x2U) -#define S50_ELS_CMDCRC_CTRL_CMDCRC_EN_SHIFT (1U) -/*! CMDCRC_EN - * 0b1..Enables the CRC command. The CRC command will be updated on completion of each ELS command. - * 0b0..Disables the CRC command CRC. The CRC command will not be updated on completion of each ELS command. - */ -#define S50_ELS_CMDCRC_CTRL_CMDCRC_EN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_CMDCRC_CTRL_CMDCRC_EN_SHIFT)) & S50_ELS_CMDCRC_CTRL_CMDCRC_EN_MASK) -/*! @} */ - -/*! @name ELS_CMDCRC - Command CRC Value */ -/*! @{ */ - -#define S50_ELS_CMDCRC_CMDCRC_MASK (0xFFFFFFFFU) -#define S50_ELS_CMDCRC_CMDCRC_SHIFT (0U) -#define S50_ELS_CMDCRC_CMDCRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_CMDCRC_CMDCRC_SHIFT)) & S50_ELS_CMDCRC_CMDCRC_MASK) -/*! @} */ - -/*! @name ELS_SESSION_ID - Session ID */ -/*! @{ */ - -#define S50_ELS_SESSION_ID_SESSION_ID_MASK (0xFFFFFFFFU) -#define S50_ELS_SESSION_ID_SESSION_ID_SHIFT (0U) -#define S50_ELS_SESSION_ID_SESSION_ID(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_SESSION_ID_SESSION_ID_SHIFT)) & S50_ELS_SESSION_ID_SESSION_ID_MASK) -/*! @} */ - -/*! @name ELS_DMA_FIN_ADDR - Final DMA Address */ -/*! @{ */ - -#define S50_ELS_DMA_FIN_ADDR_DMA_FIN_ADDR_MASK (0xFFFFFFFFU) -#define S50_ELS_DMA_FIN_ADDR_DMA_FIN_ADDR_SHIFT (0U) -#define S50_ELS_DMA_FIN_ADDR_DMA_FIN_ADDR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_DMA_FIN_ADDR_DMA_FIN_ADDR_SHIFT)) & S50_ELS_DMA_FIN_ADDR_DMA_FIN_ADDR_MASK) -/*! @} */ - -/*! @name ELS_MASTER_ID - Master ID */ -/*! @{ */ - -#define S50_ELS_MASTER_ID_MASTER_ID_MASK (0x1FU) -#define S50_ELS_MASTER_ID_MASTER_ID_SHIFT (0U) -#define S50_ELS_MASTER_ID_MASTER_ID(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_MASTER_ID_MASTER_ID_SHIFT)) & S50_ELS_MASTER_ID_MASTER_ID_MASK) -/*! @} */ - -/*! @name ELS_KIDX2 - Keystore Index 2 */ -/*! @{ */ - -#define S50_ELS_KIDX2_KIDX2_MASK (0x1FU) -#define S50_ELS_KIDX2_KIDX2_SHIFT (0U) -#define S50_ELS_KIDX2_KIDX2(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KIDX2_KIDX2_SHIFT)) & S50_ELS_KIDX2_KIDX2_MASK) -/*! @} */ - -/*! @name ELS_KS0 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS0_KS0_KSIZE_MASK (0x3U) -#define S50_ELS_KS0_KS0_KSIZE_SHIFT (0U) -/*! KS0_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS0_KS0_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_KSIZE_SHIFT)) & S50_ELS_KS0_KS0_KSIZE_MASK) - -#define S50_ELS_KS0_KS0_KACT_MASK (0x20U) -#define S50_ELS_KS0_KS0_KACT_SHIFT (5U) -#define S50_ELS_KS0_KS0_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_KACT_SHIFT)) & S50_ELS_KS0_KS0_KACT_MASK) - -#define S50_ELS_KS0_KS0_KBASE_MASK (0x40U) -#define S50_ELS_KS0_KS0_KBASE_SHIFT (6U) -#define S50_ELS_KS0_KS0_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_KBASE_SHIFT)) & S50_ELS_KS0_KS0_KBASE_MASK) - -#define S50_ELS_KS0_KS0_FGP_MASK (0x80U) -#define S50_ELS_KS0_KS0_FGP_SHIFT (7U) -#define S50_ELS_KS0_KS0_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_FGP_SHIFT)) & S50_ELS_KS0_KS0_FGP_MASK) - -#define S50_ELS_KS0_KS0_FRTN_MASK (0x100U) -#define S50_ELS_KS0_KS0_FRTN_SHIFT (8U) -#define S50_ELS_KS0_KS0_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_FRTN_SHIFT)) & S50_ELS_KS0_KS0_FRTN_MASK) - -#define S50_ELS_KS0_KS0_FHWO_MASK (0x200U) -#define S50_ELS_KS0_KS0_FHWO_SHIFT (9U) -#define S50_ELS_KS0_KS0_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_FHWO_SHIFT)) & S50_ELS_KS0_KS0_FHWO_MASK) - -#define S50_ELS_KS0_KS0_UKPUK_MASK (0x800U) -#define S50_ELS_KS0_KS0_UKPUK_SHIFT (11U) -#define S50_ELS_KS0_KS0_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UKPUK_SHIFT)) & S50_ELS_KS0_KS0_UKPUK_MASK) - -#define S50_ELS_KS0_KS0_UTECDH_MASK (0x1000U) -#define S50_ELS_KS0_KS0_UTECDH_SHIFT (12U) -#define S50_ELS_KS0_KS0_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UTECDH_SHIFT)) & S50_ELS_KS0_KS0_UTECDH_MASK) - -#define S50_ELS_KS0_KS0_UCMAC_MASK (0x2000U) -#define S50_ELS_KS0_KS0_UCMAC_SHIFT (13U) -#define S50_ELS_KS0_KS0_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UCMAC_SHIFT)) & S50_ELS_KS0_KS0_UCMAC_MASK) - -#define S50_ELS_KS0_KS0_UKSK_MASK (0x4000U) -#define S50_ELS_KS0_KS0_UKSK_SHIFT (14U) -#define S50_ELS_KS0_KS0_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UKSK_SHIFT)) & S50_ELS_KS0_KS0_UKSK_MASK) - -#define S50_ELS_KS0_KS0_URTF_MASK (0x8000U) -#define S50_ELS_KS0_KS0_URTF_SHIFT (15U) -#define S50_ELS_KS0_KS0_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_URTF_SHIFT)) & S50_ELS_KS0_KS0_URTF_MASK) - -#define S50_ELS_KS0_KS0_UCKDF_MASK (0x10000U) -#define S50_ELS_KS0_KS0_UCKDF_SHIFT (16U) -#define S50_ELS_KS0_KS0_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UCKDF_SHIFT)) & S50_ELS_KS0_KS0_UCKDF_MASK) - -#define S50_ELS_KS0_KS0_UHKDF_MASK (0x20000U) -#define S50_ELS_KS0_KS0_UHKDF_SHIFT (17U) -#define S50_ELS_KS0_KS0_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UHKDF_SHIFT)) & S50_ELS_KS0_KS0_UHKDF_MASK) - -#define S50_ELS_KS0_KS0_UECSG_MASK (0x40000U) -#define S50_ELS_KS0_KS0_UECSG_SHIFT (18U) -#define S50_ELS_KS0_KS0_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UECSG_SHIFT)) & S50_ELS_KS0_KS0_UECSG_MASK) - -#define S50_ELS_KS0_KS0_UECDH_MASK (0x80000U) -#define S50_ELS_KS0_KS0_UECDH_SHIFT (19U) -#define S50_ELS_KS0_KS0_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UECDH_SHIFT)) & S50_ELS_KS0_KS0_UECDH_MASK) - -#define S50_ELS_KS0_KS0_UAES_MASK (0x100000U) -#define S50_ELS_KS0_KS0_UAES_SHIFT (20U) -#define S50_ELS_KS0_KS0_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UAES_SHIFT)) & S50_ELS_KS0_KS0_UAES_MASK) - -#define S50_ELS_KS0_KS0_UHMAC_MASK (0x200000U) -#define S50_ELS_KS0_KS0_UHMAC_SHIFT (21U) -#define S50_ELS_KS0_KS0_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UHMAC_SHIFT)) & S50_ELS_KS0_KS0_UHMAC_MASK) - -#define S50_ELS_KS0_KS0_UKWK_MASK (0x400000U) -#define S50_ELS_KS0_KS0_UKWK_SHIFT (22U) -#define S50_ELS_KS0_KS0_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UKWK_SHIFT)) & S50_ELS_KS0_KS0_UKWK_MASK) - -#define S50_ELS_KS0_KS0_UKUOK_MASK (0x800000U) -#define S50_ELS_KS0_KS0_UKUOK_SHIFT (23U) -#define S50_ELS_KS0_KS0_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UKUOK_SHIFT)) & S50_ELS_KS0_KS0_UKUOK_MASK) - -#define S50_ELS_KS0_KS0_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS0_KS0_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS0_KS0_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UTLSPMS_SHIFT)) & S50_ELS_KS0_KS0_UTLSPMS_MASK) - -#define S50_ELS_KS0_KS0_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS0_KS0_UTLSMS_SHIFT (25U) -#define S50_ELS_KS0_KS0_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UTLSMS_SHIFT)) & S50_ELS_KS0_KS0_UTLSMS_MASK) - -#define S50_ELS_KS0_KS0_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS0_KS0_UKGSRC_SHIFT (26U) -#define S50_ELS_KS0_KS0_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UKGSRC_SHIFT)) & S50_ELS_KS0_KS0_UKGSRC_MASK) - -#define S50_ELS_KS0_KS0_UHWO_MASK (0x8000000U) -#define S50_ELS_KS0_KS0_UHWO_SHIFT (27U) -#define S50_ELS_KS0_KS0_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UHWO_SHIFT)) & S50_ELS_KS0_KS0_UHWO_MASK) - -#define S50_ELS_KS0_KS0_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS0_KS0_UWRPOK_SHIFT (28U) -#define S50_ELS_KS0_KS0_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UWRPOK_SHIFT)) & S50_ELS_KS0_KS0_UWRPOK_MASK) - -#define S50_ELS_KS0_KS0_UDUK_MASK (0x20000000U) -#define S50_ELS_KS0_KS0_UDUK_SHIFT (29U) -#define S50_ELS_KS0_KS0_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UDUK_SHIFT)) & S50_ELS_KS0_KS0_UDUK_MASK) - -#define S50_ELS_KS0_KS0_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS0_KS0_UPPROT_SHIFT (30U) -#define S50_ELS_KS0_KS0_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UPPROT_SHIFT)) & S50_ELS_KS0_KS0_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS1 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS1_KS1_KSIZE_MASK (0x3U) -#define S50_ELS_KS1_KS1_KSIZE_SHIFT (0U) -/*! KS1_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS1_KS1_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_KSIZE_SHIFT)) & S50_ELS_KS1_KS1_KSIZE_MASK) - -#define S50_ELS_KS1_KS1_KACT_MASK (0x20U) -#define S50_ELS_KS1_KS1_KACT_SHIFT (5U) -#define S50_ELS_KS1_KS1_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_KACT_SHIFT)) & S50_ELS_KS1_KS1_KACT_MASK) - -#define S50_ELS_KS1_KS1_KBASE_MASK (0x40U) -#define S50_ELS_KS1_KS1_KBASE_SHIFT (6U) -#define S50_ELS_KS1_KS1_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_KBASE_SHIFT)) & S50_ELS_KS1_KS1_KBASE_MASK) - -#define S50_ELS_KS1_KS1_FGP_MASK (0x80U) -#define S50_ELS_KS1_KS1_FGP_SHIFT (7U) -#define S50_ELS_KS1_KS1_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_FGP_SHIFT)) & S50_ELS_KS1_KS1_FGP_MASK) - -#define S50_ELS_KS1_KS1_FRTN_MASK (0x100U) -#define S50_ELS_KS1_KS1_FRTN_SHIFT (8U) -#define S50_ELS_KS1_KS1_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_FRTN_SHIFT)) & S50_ELS_KS1_KS1_FRTN_MASK) - -#define S50_ELS_KS1_KS1_FHWO_MASK (0x200U) -#define S50_ELS_KS1_KS1_FHWO_SHIFT (9U) -#define S50_ELS_KS1_KS1_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_FHWO_SHIFT)) & S50_ELS_KS1_KS1_FHWO_MASK) - -#define S50_ELS_KS1_KS1_UKPUK_MASK (0x800U) -#define S50_ELS_KS1_KS1_UKPUK_SHIFT (11U) -#define S50_ELS_KS1_KS1_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UKPUK_SHIFT)) & S50_ELS_KS1_KS1_UKPUK_MASK) - -#define S50_ELS_KS1_KS1_UTECDH_MASK (0x1000U) -#define S50_ELS_KS1_KS1_UTECDH_SHIFT (12U) -#define S50_ELS_KS1_KS1_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UTECDH_SHIFT)) & S50_ELS_KS1_KS1_UTECDH_MASK) - -#define S50_ELS_KS1_KS1_UCMAC_MASK (0x2000U) -#define S50_ELS_KS1_KS1_UCMAC_SHIFT (13U) -#define S50_ELS_KS1_KS1_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UCMAC_SHIFT)) & S50_ELS_KS1_KS1_UCMAC_MASK) - -#define S50_ELS_KS1_KS1_UKSK_MASK (0x4000U) -#define S50_ELS_KS1_KS1_UKSK_SHIFT (14U) -#define S50_ELS_KS1_KS1_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UKSK_SHIFT)) & S50_ELS_KS1_KS1_UKSK_MASK) - -#define S50_ELS_KS1_KS1_URTF_MASK (0x8000U) -#define S50_ELS_KS1_KS1_URTF_SHIFT (15U) -#define S50_ELS_KS1_KS1_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_URTF_SHIFT)) & S50_ELS_KS1_KS1_URTF_MASK) - -#define S50_ELS_KS1_KS1_UCKDF_MASK (0x10000U) -#define S50_ELS_KS1_KS1_UCKDF_SHIFT (16U) -#define S50_ELS_KS1_KS1_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UCKDF_SHIFT)) & S50_ELS_KS1_KS1_UCKDF_MASK) - -#define S50_ELS_KS1_KS1_UHKDF_MASK (0x20000U) -#define S50_ELS_KS1_KS1_UHKDF_SHIFT (17U) -#define S50_ELS_KS1_KS1_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UHKDF_SHIFT)) & S50_ELS_KS1_KS1_UHKDF_MASK) - -#define S50_ELS_KS1_KS1_UECSG_MASK (0x40000U) -#define S50_ELS_KS1_KS1_UECSG_SHIFT (18U) -#define S50_ELS_KS1_KS1_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UECSG_SHIFT)) & S50_ELS_KS1_KS1_UECSG_MASK) - -#define S50_ELS_KS1_KS1_UECDH_MASK (0x80000U) -#define S50_ELS_KS1_KS1_UECDH_SHIFT (19U) -#define S50_ELS_KS1_KS1_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UECDH_SHIFT)) & S50_ELS_KS1_KS1_UECDH_MASK) - -#define S50_ELS_KS1_KS1_UAES_MASK (0x100000U) -#define S50_ELS_KS1_KS1_UAES_SHIFT (20U) -#define S50_ELS_KS1_KS1_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UAES_SHIFT)) & S50_ELS_KS1_KS1_UAES_MASK) - -#define S50_ELS_KS1_KS1_UHMAC_MASK (0x200000U) -#define S50_ELS_KS1_KS1_UHMAC_SHIFT (21U) -#define S50_ELS_KS1_KS1_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UHMAC_SHIFT)) & S50_ELS_KS1_KS1_UHMAC_MASK) - -#define S50_ELS_KS1_KS1_UKWK_MASK (0x400000U) -#define S50_ELS_KS1_KS1_UKWK_SHIFT (22U) -#define S50_ELS_KS1_KS1_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UKWK_SHIFT)) & S50_ELS_KS1_KS1_UKWK_MASK) - -#define S50_ELS_KS1_KS1_UKUOK_MASK (0x800000U) -#define S50_ELS_KS1_KS1_UKUOK_SHIFT (23U) -#define S50_ELS_KS1_KS1_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UKUOK_SHIFT)) & S50_ELS_KS1_KS1_UKUOK_MASK) - -#define S50_ELS_KS1_KS1_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS1_KS1_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS1_KS1_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UTLSPMS_SHIFT)) & S50_ELS_KS1_KS1_UTLSPMS_MASK) - -#define S50_ELS_KS1_KS1_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS1_KS1_UTLSMS_SHIFT (25U) -#define S50_ELS_KS1_KS1_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UTLSMS_SHIFT)) & S50_ELS_KS1_KS1_UTLSMS_MASK) - -#define S50_ELS_KS1_KS1_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS1_KS1_UKGSRC_SHIFT (26U) -#define S50_ELS_KS1_KS1_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UKGSRC_SHIFT)) & S50_ELS_KS1_KS1_UKGSRC_MASK) - -#define S50_ELS_KS1_KS1_UHWO_MASK (0x8000000U) -#define S50_ELS_KS1_KS1_UHWO_SHIFT (27U) -#define S50_ELS_KS1_KS1_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UHWO_SHIFT)) & S50_ELS_KS1_KS1_UHWO_MASK) - -#define S50_ELS_KS1_KS1_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS1_KS1_UWRPOK_SHIFT (28U) -#define S50_ELS_KS1_KS1_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UWRPOK_SHIFT)) & S50_ELS_KS1_KS1_UWRPOK_MASK) - -#define S50_ELS_KS1_KS1_UDUK_MASK (0x20000000U) -#define S50_ELS_KS1_KS1_UDUK_SHIFT (29U) -#define S50_ELS_KS1_KS1_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UDUK_SHIFT)) & S50_ELS_KS1_KS1_UDUK_MASK) - -#define S50_ELS_KS1_KS1_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS1_KS1_UPPROT_SHIFT (30U) -#define S50_ELS_KS1_KS1_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UPPROT_SHIFT)) & S50_ELS_KS1_KS1_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS2 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS2_KS2_KSIZE_MASK (0x3U) -#define S50_ELS_KS2_KS2_KSIZE_SHIFT (0U) -/*! KS2_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS2_KS2_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_KSIZE_SHIFT)) & S50_ELS_KS2_KS2_KSIZE_MASK) - -#define S50_ELS_KS2_KS2_KACT_MASK (0x20U) -#define S50_ELS_KS2_KS2_KACT_SHIFT (5U) -#define S50_ELS_KS2_KS2_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_KACT_SHIFT)) & S50_ELS_KS2_KS2_KACT_MASK) - -#define S50_ELS_KS2_KS2_KBASE_MASK (0x40U) -#define S50_ELS_KS2_KS2_KBASE_SHIFT (6U) -#define S50_ELS_KS2_KS2_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_KBASE_SHIFT)) & S50_ELS_KS2_KS2_KBASE_MASK) - -#define S50_ELS_KS2_KS2_FGP_MASK (0x80U) -#define S50_ELS_KS2_KS2_FGP_SHIFT (7U) -#define S50_ELS_KS2_KS2_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_FGP_SHIFT)) & S50_ELS_KS2_KS2_FGP_MASK) - -#define S50_ELS_KS2_KS2_FRTN_MASK (0x100U) -#define S50_ELS_KS2_KS2_FRTN_SHIFT (8U) -#define S50_ELS_KS2_KS2_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_FRTN_SHIFT)) & S50_ELS_KS2_KS2_FRTN_MASK) - -#define S50_ELS_KS2_KS2_FHWO_MASK (0x200U) -#define S50_ELS_KS2_KS2_FHWO_SHIFT (9U) -#define S50_ELS_KS2_KS2_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_FHWO_SHIFT)) & S50_ELS_KS2_KS2_FHWO_MASK) - -#define S50_ELS_KS2_KS2_UKPUK_MASK (0x800U) -#define S50_ELS_KS2_KS2_UKPUK_SHIFT (11U) -#define S50_ELS_KS2_KS2_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UKPUK_SHIFT)) & S50_ELS_KS2_KS2_UKPUK_MASK) - -#define S50_ELS_KS2_KS2_UTECDH_MASK (0x1000U) -#define S50_ELS_KS2_KS2_UTECDH_SHIFT (12U) -#define S50_ELS_KS2_KS2_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UTECDH_SHIFT)) & S50_ELS_KS2_KS2_UTECDH_MASK) - -#define S50_ELS_KS2_KS2_UCMAC_MASK (0x2000U) -#define S50_ELS_KS2_KS2_UCMAC_SHIFT (13U) -#define S50_ELS_KS2_KS2_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UCMAC_SHIFT)) & S50_ELS_KS2_KS2_UCMAC_MASK) - -#define S50_ELS_KS2_KS2_UKSK_MASK (0x4000U) -#define S50_ELS_KS2_KS2_UKSK_SHIFT (14U) -#define S50_ELS_KS2_KS2_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UKSK_SHIFT)) & S50_ELS_KS2_KS2_UKSK_MASK) - -#define S50_ELS_KS2_KS2_URTF_MASK (0x8000U) -#define S50_ELS_KS2_KS2_URTF_SHIFT (15U) -#define S50_ELS_KS2_KS2_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_URTF_SHIFT)) & S50_ELS_KS2_KS2_URTF_MASK) - -#define S50_ELS_KS2_KS2_UCKDF_MASK (0x10000U) -#define S50_ELS_KS2_KS2_UCKDF_SHIFT (16U) -#define S50_ELS_KS2_KS2_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UCKDF_SHIFT)) & S50_ELS_KS2_KS2_UCKDF_MASK) - -#define S50_ELS_KS2_KS2_UHKDF_MASK (0x20000U) -#define S50_ELS_KS2_KS2_UHKDF_SHIFT (17U) -#define S50_ELS_KS2_KS2_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UHKDF_SHIFT)) & S50_ELS_KS2_KS2_UHKDF_MASK) - -#define S50_ELS_KS2_KS2_UECSG_MASK (0x40000U) -#define S50_ELS_KS2_KS2_UECSG_SHIFT (18U) -#define S50_ELS_KS2_KS2_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UECSG_SHIFT)) & S50_ELS_KS2_KS2_UECSG_MASK) - -#define S50_ELS_KS2_KS2_UECDH_MASK (0x80000U) -#define S50_ELS_KS2_KS2_UECDH_SHIFT (19U) -#define S50_ELS_KS2_KS2_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UECDH_SHIFT)) & S50_ELS_KS2_KS2_UECDH_MASK) - -#define S50_ELS_KS2_KS2_UAES_MASK (0x100000U) -#define S50_ELS_KS2_KS2_UAES_SHIFT (20U) -#define S50_ELS_KS2_KS2_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UAES_SHIFT)) & S50_ELS_KS2_KS2_UAES_MASK) - -#define S50_ELS_KS2_KS2_UHMAC_MASK (0x200000U) -#define S50_ELS_KS2_KS2_UHMAC_SHIFT (21U) -#define S50_ELS_KS2_KS2_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UHMAC_SHIFT)) & S50_ELS_KS2_KS2_UHMAC_MASK) - -#define S50_ELS_KS2_KS2_UKWK_MASK (0x400000U) -#define S50_ELS_KS2_KS2_UKWK_SHIFT (22U) -#define S50_ELS_KS2_KS2_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UKWK_SHIFT)) & S50_ELS_KS2_KS2_UKWK_MASK) - -#define S50_ELS_KS2_KS2_UKUOK_MASK (0x800000U) -#define S50_ELS_KS2_KS2_UKUOK_SHIFT (23U) -#define S50_ELS_KS2_KS2_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UKUOK_SHIFT)) & S50_ELS_KS2_KS2_UKUOK_MASK) - -#define S50_ELS_KS2_KS2_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS2_KS2_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS2_KS2_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UTLSPMS_SHIFT)) & S50_ELS_KS2_KS2_UTLSPMS_MASK) - -#define S50_ELS_KS2_KS2_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS2_KS2_UTLSMS_SHIFT (25U) -#define S50_ELS_KS2_KS2_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UTLSMS_SHIFT)) & S50_ELS_KS2_KS2_UTLSMS_MASK) - -#define S50_ELS_KS2_KS2_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS2_KS2_UKGSRC_SHIFT (26U) -#define S50_ELS_KS2_KS2_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UKGSRC_SHIFT)) & S50_ELS_KS2_KS2_UKGSRC_MASK) - -#define S50_ELS_KS2_KS2_UHWO_MASK (0x8000000U) -#define S50_ELS_KS2_KS2_UHWO_SHIFT (27U) -#define S50_ELS_KS2_KS2_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UHWO_SHIFT)) & S50_ELS_KS2_KS2_UHWO_MASK) - -#define S50_ELS_KS2_KS2_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS2_KS2_UWRPOK_SHIFT (28U) -#define S50_ELS_KS2_KS2_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UWRPOK_SHIFT)) & S50_ELS_KS2_KS2_UWRPOK_MASK) - -#define S50_ELS_KS2_KS2_UDUK_MASK (0x20000000U) -#define S50_ELS_KS2_KS2_UDUK_SHIFT (29U) -#define S50_ELS_KS2_KS2_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UDUK_SHIFT)) & S50_ELS_KS2_KS2_UDUK_MASK) - -#define S50_ELS_KS2_KS2_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS2_KS2_UPPROT_SHIFT (30U) -#define S50_ELS_KS2_KS2_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UPPROT_SHIFT)) & S50_ELS_KS2_KS2_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS3 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS3_KS3_KSIZE_MASK (0x3U) -#define S50_ELS_KS3_KS3_KSIZE_SHIFT (0U) -/*! KS3_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS3_KS3_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_KSIZE_SHIFT)) & S50_ELS_KS3_KS3_KSIZE_MASK) - -#define S50_ELS_KS3_KS3_KACT_MASK (0x20U) -#define S50_ELS_KS3_KS3_KACT_SHIFT (5U) -#define S50_ELS_KS3_KS3_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_KACT_SHIFT)) & S50_ELS_KS3_KS3_KACT_MASK) - -#define S50_ELS_KS3_KS3_KBASE_MASK (0x40U) -#define S50_ELS_KS3_KS3_KBASE_SHIFT (6U) -#define S50_ELS_KS3_KS3_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_KBASE_SHIFT)) & S50_ELS_KS3_KS3_KBASE_MASK) - -#define S50_ELS_KS3_KS3_FGP_MASK (0x80U) -#define S50_ELS_KS3_KS3_FGP_SHIFT (7U) -#define S50_ELS_KS3_KS3_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_FGP_SHIFT)) & S50_ELS_KS3_KS3_FGP_MASK) - -#define S50_ELS_KS3_KS3_FRTN_MASK (0x100U) -#define S50_ELS_KS3_KS3_FRTN_SHIFT (8U) -#define S50_ELS_KS3_KS3_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_FRTN_SHIFT)) & S50_ELS_KS3_KS3_FRTN_MASK) - -#define S50_ELS_KS3_KS3_FHWO_MASK (0x200U) -#define S50_ELS_KS3_KS3_FHWO_SHIFT (9U) -#define S50_ELS_KS3_KS3_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_FHWO_SHIFT)) & S50_ELS_KS3_KS3_FHWO_MASK) - -#define S50_ELS_KS3_KS3_UKPUK_MASK (0x800U) -#define S50_ELS_KS3_KS3_UKPUK_SHIFT (11U) -#define S50_ELS_KS3_KS3_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UKPUK_SHIFT)) & S50_ELS_KS3_KS3_UKPUK_MASK) - -#define S50_ELS_KS3_KS3_UTECDH_MASK (0x1000U) -#define S50_ELS_KS3_KS3_UTECDH_SHIFT (12U) -#define S50_ELS_KS3_KS3_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UTECDH_SHIFT)) & S50_ELS_KS3_KS3_UTECDH_MASK) - -#define S50_ELS_KS3_KS3_UCMAC_MASK (0x2000U) -#define S50_ELS_KS3_KS3_UCMAC_SHIFT (13U) -#define S50_ELS_KS3_KS3_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UCMAC_SHIFT)) & S50_ELS_KS3_KS3_UCMAC_MASK) - -#define S50_ELS_KS3_KS3_UKSK_MASK (0x4000U) -#define S50_ELS_KS3_KS3_UKSK_SHIFT (14U) -#define S50_ELS_KS3_KS3_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UKSK_SHIFT)) & S50_ELS_KS3_KS3_UKSK_MASK) - -#define S50_ELS_KS3_KS3_URTF_MASK (0x8000U) -#define S50_ELS_KS3_KS3_URTF_SHIFT (15U) -#define S50_ELS_KS3_KS3_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_URTF_SHIFT)) & S50_ELS_KS3_KS3_URTF_MASK) - -#define S50_ELS_KS3_KS3_UCKDF_MASK (0x10000U) -#define S50_ELS_KS3_KS3_UCKDF_SHIFT (16U) -#define S50_ELS_KS3_KS3_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UCKDF_SHIFT)) & S50_ELS_KS3_KS3_UCKDF_MASK) - -#define S50_ELS_KS3_KS3_UHKDF_MASK (0x20000U) -#define S50_ELS_KS3_KS3_UHKDF_SHIFT (17U) -#define S50_ELS_KS3_KS3_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UHKDF_SHIFT)) & S50_ELS_KS3_KS3_UHKDF_MASK) - -#define S50_ELS_KS3_KS3_UECSG_MASK (0x40000U) -#define S50_ELS_KS3_KS3_UECSG_SHIFT (18U) -#define S50_ELS_KS3_KS3_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UECSG_SHIFT)) & S50_ELS_KS3_KS3_UECSG_MASK) - -#define S50_ELS_KS3_KS3_UECDH_MASK (0x80000U) -#define S50_ELS_KS3_KS3_UECDH_SHIFT (19U) -#define S50_ELS_KS3_KS3_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UECDH_SHIFT)) & S50_ELS_KS3_KS3_UECDH_MASK) - -#define S50_ELS_KS3_KS3_UAES_MASK (0x100000U) -#define S50_ELS_KS3_KS3_UAES_SHIFT (20U) -#define S50_ELS_KS3_KS3_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UAES_SHIFT)) & S50_ELS_KS3_KS3_UAES_MASK) - -#define S50_ELS_KS3_KS3_UHMAC_MASK (0x200000U) -#define S50_ELS_KS3_KS3_UHMAC_SHIFT (21U) -#define S50_ELS_KS3_KS3_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UHMAC_SHIFT)) & S50_ELS_KS3_KS3_UHMAC_MASK) - -#define S50_ELS_KS3_KS3_UKWK_MASK (0x400000U) -#define S50_ELS_KS3_KS3_UKWK_SHIFT (22U) -#define S50_ELS_KS3_KS3_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UKWK_SHIFT)) & S50_ELS_KS3_KS3_UKWK_MASK) - -#define S50_ELS_KS3_KS3_UKUOK_MASK (0x800000U) -#define S50_ELS_KS3_KS3_UKUOK_SHIFT (23U) -#define S50_ELS_KS3_KS3_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UKUOK_SHIFT)) & S50_ELS_KS3_KS3_UKUOK_MASK) - -#define S50_ELS_KS3_KS3_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS3_KS3_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS3_KS3_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UTLSPMS_SHIFT)) & S50_ELS_KS3_KS3_UTLSPMS_MASK) - -#define S50_ELS_KS3_KS3_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS3_KS3_UTLSMS_SHIFT (25U) -#define S50_ELS_KS3_KS3_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UTLSMS_SHIFT)) & S50_ELS_KS3_KS3_UTLSMS_MASK) - -#define S50_ELS_KS3_KS3_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS3_KS3_UKGSRC_SHIFT (26U) -#define S50_ELS_KS3_KS3_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UKGSRC_SHIFT)) & S50_ELS_KS3_KS3_UKGSRC_MASK) - -#define S50_ELS_KS3_KS3_UHWO_MASK (0x8000000U) -#define S50_ELS_KS3_KS3_UHWO_SHIFT (27U) -#define S50_ELS_KS3_KS3_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UHWO_SHIFT)) & S50_ELS_KS3_KS3_UHWO_MASK) - -#define S50_ELS_KS3_KS3_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS3_KS3_UWRPOK_SHIFT (28U) -#define S50_ELS_KS3_KS3_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UWRPOK_SHIFT)) & S50_ELS_KS3_KS3_UWRPOK_MASK) - -#define S50_ELS_KS3_KS3_UDUK_MASK (0x20000000U) -#define S50_ELS_KS3_KS3_UDUK_SHIFT (29U) -#define S50_ELS_KS3_KS3_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UDUK_SHIFT)) & S50_ELS_KS3_KS3_UDUK_MASK) - -#define S50_ELS_KS3_KS3_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS3_KS3_UPPROT_SHIFT (30U) -#define S50_ELS_KS3_KS3_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UPPROT_SHIFT)) & S50_ELS_KS3_KS3_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS4 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS4_KS4_KSIZE_MASK (0x3U) -#define S50_ELS_KS4_KS4_KSIZE_SHIFT (0U) -/*! KS4_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS4_KS4_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_KSIZE_SHIFT)) & S50_ELS_KS4_KS4_KSIZE_MASK) - -#define S50_ELS_KS4_KS4_KACT_MASK (0x20U) -#define S50_ELS_KS4_KS4_KACT_SHIFT (5U) -#define S50_ELS_KS4_KS4_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_KACT_SHIFT)) & S50_ELS_KS4_KS4_KACT_MASK) - -#define S50_ELS_KS4_KS4_KBASE_MASK (0x40U) -#define S50_ELS_KS4_KS4_KBASE_SHIFT (6U) -#define S50_ELS_KS4_KS4_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_KBASE_SHIFT)) & S50_ELS_KS4_KS4_KBASE_MASK) - -#define S50_ELS_KS4_KS4_FGP_MASK (0x80U) -#define S50_ELS_KS4_KS4_FGP_SHIFT (7U) -#define S50_ELS_KS4_KS4_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_FGP_SHIFT)) & S50_ELS_KS4_KS4_FGP_MASK) - -#define S50_ELS_KS4_KS4_FRTN_MASK (0x100U) -#define S50_ELS_KS4_KS4_FRTN_SHIFT (8U) -#define S50_ELS_KS4_KS4_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_FRTN_SHIFT)) & S50_ELS_KS4_KS4_FRTN_MASK) - -#define S50_ELS_KS4_KS4_FHWO_MASK (0x200U) -#define S50_ELS_KS4_KS4_FHWO_SHIFT (9U) -#define S50_ELS_KS4_KS4_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_FHWO_SHIFT)) & S50_ELS_KS4_KS4_FHWO_MASK) - -#define S50_ELS_KS4_KS4_UKPUK_MASK (0x800U) -#define S50_ELS_KS4_KS4_UKPUK_SHIFT (11U) -#define S50_ELS_KS4_KS4_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UKPUK_SHIFT)) & S50_ELS_KS4_KS4_UKPUK_MASK) - -#define S50_ELS_KS4_KS4_UTECDH_MASK (0x1000U) -#define S50_ELS_KS4_KS4_UTECDH_SHIFT (12U) -#define S50_ELS_KS4_KS4_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UTECDH_SHIFT)) & S50_ELS_KS4_KS4_UTECDH_MASK) - -#define S50_ELS_KS4_KS4_UCMAC_MASK (0x2000U) -#define S50_ELS_KS4_KS4_UCMAC_SHIFT (13U) -#define S50_ELS_KS4_KS4_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UCMAC_SHIFT)) & S50_ELS_KS4_KS4_UCMAC_MASK) - -#define S50_ELS_KS4_KS4_UKSK_MASK (0x4000U) -#define S50_ELS_KS4_KS4_UKSK_SHIFT (14U) -#define S50_ELS_KS4_KS4_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UKSK_SHIFT)) & S50_ELS_KS4_KS4_UKSK_MASK) - -#define S50_ELS_KS4_KS4_URTF_MASK (0x8000U) -#define S50_ELS_KS4_KS4_URTF_SHIFT (15U) -#define S50_ELS_KS4_KS4_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_URTF_SHIFT)) & S50_ELS_KS4_KS4_URTF_MASK) - -#define S50_ELS_KS4_KS4_UCKDF_MASK (0x10000U) -#define S50_ELS_KS4_KS4_UCKDF_SHIFT (16U) -#define S50_ELS_KS4_KS4_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UCKDF_SHIFT)) & S50_ELS_KS4_KS4_UCKDF_MASK) - -#define S50_ELS_KS4_KS4_UHKDF_MASK (0x20000U) -#define S50_ELS_KS4_KS4_UHKDF_SHIFT (17U) -#define S50_ELS_KS4_KS4_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UHKDF_SHIFT)) & S50_ELS_KS4_KS4_UHKDF_MASK) - -#define S50_ELS_KS4_KS4_UECSG_MASK (0x40000U) -#define S50_ELS_KS4_KS4_UECSG_SHIFT (18U) -#define S50_ELS_KS4_KS4_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UECSG_SHIFT)) & S50_ELS_KS4_KS4_UECSG_MASK) - -#define S50_ELS_KS4_KS4_UECDH_MASK (0x80000U) -#define S50_ELS_KS4_KS4_UECDH_SHIFT (19U) -#define S50_ELS_KS4_KS4_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UECDH_SHIFT)) & S50_ELS_KS4_KS4_UECDH_MASK) - -#define S50_ELS_KS4_KS4_UAES_MASK (0x100000U) -#define S50_ELS_KS4_KS4_UAES_SHIFT (20U) -#define S50_ELS_KS4_KS4_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UAES_SHIFT)) & S50_ELS_KS4_KS4_UAES_MASK) - -#define S50_ELS_KS4_KS4_UHMAC_MASK (0x200000U) -#define S50_ELS_KS4_KS4_UHMAC_SHIFT (21U) -#define S50_ELS_KS4_KS4_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UHMAC_SHIFT)) & S50_ELS_KS4_KS4_UHMAC_MASK) - -#define S50_ELS_KS4_KS4_UKWK_MASK (0x400000U) -#define S50_ELS_KS4_KS4_UKWK_SHIFT (22U) -#define S50_ELS_KS4_KS4_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UKWK_SHIFT)) & S50_ELS_KS4_KS4_UKWK_MASK) - -#define S50_ELS_KS4_KS4_UKUOK_MASK (0x800000U) -#define S50_ELS_KS4_KS4_UKUOK_SHIFT (23U) -#define S50_ELS_KS4_KS4_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UKUOK_SHIFT)) & S50_ELS_KS4_KS4_UKUOK_MASK) - -#define S50_ELS_KS4_KS4_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS4_KS4_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS4_KS4_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UTLSPMS_SHIFT)) & S50_ELS_KS4_KS4_UTLSPMS_MASK) - -#define S50_ELS_KS4_KS4_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS4_KS4_UTLSMS_SHIFT (25U) -#define S50_ELS_KS4_KS4_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UTLSMS_SHIFT)) & S50_ELS_KS4_KS4_UTLSMS_MASK) - -#define S50_ELS_KS4_KS4_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS4_KS4_UKGSRC_SHIFT (26U) -#define S50_ELS_KS4_KS4_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UKGSRC_SHIFT)) & S50_ELS_KS4_KS4_UKGSRC_MASK) - -#define S50_ELS_KS4_KS4_UHWO_MASK (0x8000000U) -#define S50_ELS_KS4_KS4_UHWO_SHIFT (27U) -#define S50_ELS_KS4_KS4_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UHWO_SHIFT)) & S50_ELS_KS4_KS4_UHWO_MASK) - -#define S50_ELS_KS4_KS4_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS4_KS4_UWRPOK_SHIFT (28U) -#define S50_ELS_KS4_KS4_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UWRPOK_SHIFT)) & S50_ELS_KS4_KS4_UWRPOK_MASK) - -#define S50_ELS_KS4_KS4_UDUK_MASK (0x20000000U) -#define S50_ELS_KS4_KS4_UDUK_SHIFT (29U) -#define S50_ELS_KS4_KS4_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UDUK_SHIFT)) & S50_ELS_KS4_KS4_UDUK_MASK) - -#define S50_ELS_KS4_KS4_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS4_KS4_UPPROT_SHIFT (30U) -#define S50_ELS_KS4_KS4_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UPPROT_SHIFT)) & S50_ELS_KS4_KS4_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS5 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS5_KS5_KSIZE_MASK (0x3U) -#define S50_ELS_KS5_KS5_KSIZE_SHIFT (0U) -/*! KS5_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS5_KS5_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_KSIZE_SHIFT)) & S50_ELS_KS5_KS5_KSIZE_MASK) - -#define S50_ELS_KS5_KS5_KACT_MASK (0x20U) -#define S50_ELS_KS5_KS5_KACT_SHIFT (5U) -#define S50_ELS_KS5_KS5_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_KACT_SHIFT)) & S50_ELS_KS5_KS5_KACT_MASK) - -#define S50_ELS_KS5_KS5_KBASE_MASK (0x40U) -#define S50_ELS_KS5_KS5_KBASE_SHIFT (6U) -#define S50_ELS_KS5_KS5_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_KBASE_SHIFT)) & S50_ELS_KS5_KS5_KBASE_MASK) - -#define S50_ELS_KS5_KS5_FGP_MASK (0x80U) -#define S50_ELS_KS5_KS5_FGP_SHIFT (7U) -#define S50_ELS_KS5_KS5_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_FGP_SHIFT)) & S50_ELS_KS5_KS5_FGP_MASK) - -#define S50_ELS_KS5_KS5_FRTN_MASK (0x100U) -#define S50_ELS_KS5_KS5_FRTN_SHIFT (8U) -#define S50_ELS_KS5_KS5_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_FRTN_SHIFT)) & S50_ELS_KS5_KS5_FRTN_MASK) - -#define S50_ELS_KS5_KS5_FHWO_MASK (0x200U) -#define S50_ELS_KS5_KS5_FHWO_SHIFT (9U) -#define S50_ELS_KS5_KS5_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_FHWO_SHIFT)) & S50_ELS_KS5_KS5_FHWO_MASK) - -#define S50_ELS_KS5_KS5_UKPUK_MASK (0x800U) -#define S50_ELS_KS5_KS5_UKPUK_SHIFT (11U) -#define S50_ELS_KS5_KS5_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UKPUK_SHIFT)) & S50_ELS_KS5_KS5_UKPUK_MASK) - -#define S50_ELS_KS5_KS5_UTECDH_MASK (0x1000U) -#define S50_ELS_KS5_KS5_UTECDH_SHIFT (12U) -#define S50_ELS_KS5_KS5_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UTECDH_SHIFT)) & S50_ELS_KS5_KS5_UTECDH_MASK) - -#define S50_ELS_KS5_KS5_UCMAC_MASK (0x2000U) -#define S50_ELS_KS5_KS5_UCMAC_SHIFT (13U) -#define S50_ELS_KS5_KS5_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UCMAC_SHIFT)) & S50_ELS_KS5_KS5_UCMAC_MASK) - -#define S50_ELS_KS5_KS5_UKSK_MASK (0x4000U) -#define S50_ELS_KS5_KS5_UKSK_SHIFT (14U) -#define S50_ELS_KS5_KS5_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UKSK_SHIFT)) & S50_ELS_KS5_KS5_UKSK_MASK) - -#define S50_ELS_KS5_KS5_URTF_MASK (0x8000U) -#define S50_ELS_KS5_KS5_URTF_SHIFT (15U) -#define S50_ELS_KS5_KS5_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_URTF_SHIFT)) & S50_ELS_KS5_KS5_URTF_MASK) - -#define S50_ELS_KS5_KS5_UCKDF_MASK (0x10000U) -#define S50_ELS_KS5_KS5_UCKDF_SHIFT (16U) -#define S50_ELS_KS5_KS5_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UCKDF_SHIFT)) & S50_ELS_KS5_KS5_UCKDF_MASK) - -#define S50_ELS_KS5_KS5_UHKDF_MASK (0x20000U) -#define S50_ELS_KS5_KS5_UHKDF_SHIFT (17U) -#define S50_ELS_KS5_KS5_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UHKDF_SHIFT)) & S50_ELS_KS5_KS5_UHKDF_MASK) - -#define S50_ELS_KS5_KS5_UECSG_MASK (0x40000U) -#define S50_ELS_KS5_KS5_UECSG_SHIFT (18U) -#define S50_ELS_KS5_KS5_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UECSG_SHIFT)) & S50_ELS_KS5_KS5_UECSG_MASK) - -#define S50_ELS_KS5_KS5_UECDH_MASK (0x80000U) -#define S50_ELS_KS5_KS5_UECDH_SHIFT (19U) -#define S50_ELS_KS5_KS5_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UECDH_SHIFT)) & S50_ELS_KS5_KS5_UECDH_MASK) - -#define S50_ELS_KS5_KS5_UAES_MASK (0x100000U) -#define S50_ELS_KS5_KS5_UAES_SHIFT (20U) -#define S50_ELS_KS5_KS5_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UAES_SHIFT)) & S50_ELS_KS5_KS5_UAES_MASK) - -#define S50_ELS_KS5_KS5_UHMAC_MASK (0x200000U) -#define S50_ELS_KS5_KS5_UHMAC_SHIFT (21U) -#define S50_ELS_KS5_KS5_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UHMAC_SHIFT)) & S50_ELS_KS5_KS5_UHMAC_MASK) - -#define S50_ELS_KS5_KS5_UKWK_MASK (0x400000U) -#define S50_ELS_KS5_KS5_UKWK_SHIFT (22U) -#define S50_ELS_KS5_KS5_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UKWK_SHIFT)) & S50_ELS_KS5_KS5_UKWK_MASK) - -#define S50_ELS_KS5_KS5_UKUOK_MASK (0x800000U) -#define S50_ELS_KS5_KS5_UKUOK_SHIFT (23U) -#define S50_ELS_KS5_KS5_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UKUOK_SHIFT)) & S50_ELS_KS5_KS5_UKUOK_MASK) - -#define S50_ELS_KS5_KS5_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS5_KS5_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS5_KS5_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UTLSPMS_SHIFT)) & S50_ELS_KS5_KS5_UTLSPMS_MASK) - -#define S50_ELS_KS5_KS5_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS5_KS5_UTLSMS_SHIFT (25U) -#define S50_ELS_KS5_KS5_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UTLSMS_SHIFT)) & S50_ELS_KS5_KS5_UTLSMS_MASK) - -#define S50_ELS_KS5_KS5_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS5_KS5_UKGSRC_SHIFT (26U) -#define S50_ELS_KS5_KS5_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UKGSRC_SHIFT)) & S50_ELS_KS5_KS5_UKGSRC_MASK) - -#define S50_ELS_KS5_KS5_UHWO_MASK (0x8000000U) -#define S50_ELS_KS5_KS5_UHWO_SHIFT (27U) -#define S50_ELS_KS5_KS5_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UHWO_SHIFT)) & S50_ELS_KS5_KS5_UHWO_MASK) - -#define S50_ELS_KS5_KS5_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS5_KS5_UWRPOK_SHIFT (28U) -#define S50_ELS_KS5_KS5_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UWRPOK_SHIFT)) & S50_ELS_KS5_KS5_UWRPOK_MASK) - -#define S50_ELS_KS5_KS5_UDUK_MASK (0x20000000U) -#define S50_ELS_KS5_KS5_UDUK_SHIFT (29U) -#define S50_ELS_KS5_KS5_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UDUK_SHIFT)) & S50_ELS_KS5_KS5_UDUK_MASK) - -#define S50_ELS_KS5_KS5_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS5_KS5_UPPROT_SHIFT (30U) -#define S50_ELS_KS5_KS5_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UPPROT_SHIFT)) & S50_ELS_KS5_KS5_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS6 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS6_KS6_KSIZE_MASK (0x3U) -#define S50_ELS_KS6_KS6_KSIZE_SHIFT (0U) -/*! KS6_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS6_KS6_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_KSIZE_SHIFT)) & S50_ELS_KS6_KS6_KSIZE_MASK) - -#define S50_ELS_KS6_KS6_KACT_MASK (0x20U) -#define S50_ELS_KS6_KS6_KACT_SHIFT (5U) -#define S50_ELS_KS6_KS6_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_KACT_SHIFT)) & S50_ELS_KS6_KS6_KACT_MASK) - -#define S50_ELS_KS6_KS6_KBASE_MASK (0x40U) -#define S50_ELS_KS6_KS6_KBASE_SHIFT (6U) -#define S50_ELS_KS6_KS6_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_KBASE_SHIFT)) & S50_ELS_KS6_KS6_KBASE_MASK) - -#define S50_ELS_KS6_KS6_FGP_MASK (0x80U) -#define S50_ELS_KS6_KS6_FGP_SHIFT (7U) -#define S50_ELS_KS6_KS6_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_FGP_SHIFT)) & S50_ELS_KS6_KS6_FGP_MASK) - -#define S50_ELS_KS6_KS6_FRTN_MASK (0x100U) -#define S50_ELS_KS6_KS6_FRTN_SHIFT (8U) -#define S50_ELS_KS6_KS6_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_FRTN_SHIFT)) & S50_ELS_KS6_KS6_FRTN_MASK) - -#define S50_ELS_KS6_KS6_FHWO_MASK (0x200U) -#define S50_ELS_KS6_KS6_FHWO_SHIFT (9U) -#define S50_ELS_KS6_KS6_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_FHWO_SHIFT)) & S50_ELS_KS6_KS6_FHWO_MASK) - -#define S50_ELS_KS6_KS6_UKPUK_MASK (0x800U) -#define S50_ELS_KS6_KS6_UKPUK_SHIFT (11U) -#define S50_ELS_KS6_KS6_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UKPUK_SHIFT)) & S50_ELS_KS6_KS6_UKPUK_MASK) - -#define S50_ELS_KS6_KS6_UTECDH_MASK (0x1000U) -#define S50_ELS_KS6_KS6_UTECDH_SHIFT (12U) -#define S50_ELS_KS6_KS6_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UTECDH_SHIFT)) & S50_ELS_KS6_KS6_UTECDH_MASK) - -#define S50_ELS_KS6_KS6_UCMAC_MASK (0x2000U) -#define S50_ELS_KS6_KS6_UCMAC_SHIFT (13U) -#define S50_ELS_KS6_KS6_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UCMAC_SHIFT)) & S50_ELS_KS6_KS6_UCMAC_MASK) - -#define S50_ELS_KS6_KS6_UKSK_MASK (0x4000U) -#define S50_ELS_KS6_KS6_UKSK_SHIFT (14U) -#define S50_ELS_KS6_KS6_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UKSK_SHIFT)) & S50_ELS_KS6_KS6_UKSK_MASK) - -#define S50_ELS_KS6_KS6_URTF_MASK (0x8000U) -#define S50_ELS_KS6_KS6_URTF_SHIFT (15U) -#define S50_ELS_KS6_KS6_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_URTF_SHIFT)) & S50_ELS_KS6_KS6_URTF_MASK) - -#define S50_ELS_KS6_KS6_UCKDF_MASK (0x10000U) -#define S50_ELS_KS6_KS6_UCKDF_SHIFT (16U) -#define S50_ELS_KS6_KS6_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UCKDF_SHIFT)) & S50_ELS_KS6_KS6_UCKDF_MASK) - -#define S50_ELS_KS6_KS6_UHKDF_MASK (0x20000U) -#define S50_ELS_KS6_KS6_UHKDF_SHIFT (17U) -#define S50_ELS_KS6_KS6_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UHKDF_SHIFT)) & S50_ELS_KS6_KS6_UHKDF_MASK) - -#define S50_ELS_KS6_KS6_UECSG_MASK (0x40000U) -#define S50_ELS_KS6_KS6_UECSG_SHIFT (18U) -#define S50_ELS_KS6_KS6_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UECSG_SHIFT)) & S50_ELS_KS6_KS6_UECSG_MASK) - -#define S50_ELS_KS6_KS6_UECDH_MASK (0x80000U) -#define S50_ELS_KS6_KS6_UECDH_SHIFT (19U) -#define S50_ELS_KS6_KS6_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UECDH_SHIFT)) & S50_ELS_KS6_KS6_UECDH_MASK) - -#define S50_ELS_KS6_KS6_UAES_MASK (0x100000U) -#define S50_ELS_KS6_KS6_UAES_SHIFT (20U) -#define S50_ELS_KS6_KS6_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UAES_SHIFT)) & S50_ELS_KS6_KS6_UAES_MASK) - -#define S50_ELS_KS6_KS6_UHMAC_MASK (0x200000U) -#define S50_ELS_KS6_KS6_UHMAC_SHIFT (21U) -#define S50_ELS_KS6_KS6_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UHMAC_SHIFT)) & S50_ELS_KS6_KS6_UHMAC_MASK) - -#define S50_ELS_KS6_KS6_UKWK_MASK (0x400000U) -#define S50_ELS_KS6_KS6_UKWK_SHIFT (22U) -#define S50_ELS_KS6_KS6_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UKWK_SHIFT)) & S50_ELS_KS6_KS6_UKWK_MASK) - -#define S50_ELS_KS6_KS6_UKUOK_MASK (0x800000U) -#define S50_ELS_KS6_KS6_UKUOK_SHIFT (23U) -#define S50_ELS_KS6_KS6_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UKUOK_SHIFT)) & S50_ELS_KS6_KS6_UKUOK_MASK) - -#define S50_ELS_KS6_KS6_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS6_KS6_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS6_KS6_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UTLSPMS_SHIFT)) & S50_ELS_KS6_KS6_UTLSPMS_MASK) - -#define S50_ELS_KS6_KS6_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS6_KS6_UTLSMS_SHIFT (25U) -#define S50_ELS_KS6_KS6_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UTLSMS_SHIFT)) & S50_ELS_KS6_KS6_UTLSMS_MASK) - -#define S50_ELS_KS6_KS6_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS6_KS6_UKGSRC_SHIFT (26U) -#define S50_ELS_KS6_KS6_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UKGSRC_SHIFT)) & S50_ELS_KS6_KS6_UKGSRC_MASK) - -#define S50_ELS_KS6_KS6_UHWO_MASK (0x8000000U) -#define S50_ELS_KS6_KS6_UHWO_SHIFT (27U) -#define S50_ELS_KS6_KS6_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UHWO_SHIFT)) & S50_ELS_KS6_KS6_UHWO_MASK) - -#define S50_ELS_KS6_KS6_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS6_KS6_UWRPOK_SHIFT (28U) -#define S50_ELS_KS6_KS6_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UWRPOK_SHIFT)) & S50_ELS_KS6_KS6_UWRPOK_MASK) - -#define S50_ELS_KS6_KS6_UDUK_MASK (0x20000000U) -#define S50_ELS_KS6_KS6_UDUK_SHIFT (29U) -#define S50_ELS_KS6_KS6_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UDUK_SHIFT)) & S50_ELS_KS6_KS6_UDUK_MASK) - -#define S50_ELS_KS6_KS6_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS6_KS6_UPPROT_SHIFT (30U) -#define S50_ELS_KS6_KS6_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UPPROT_SHIFT)) & S50_ELS_KS6_KS6_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS7 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS7_KS7_KSIZE_MASK (0x3U) -#define S50_ELS_KS7_KS7_KSIZE_SHIFT (0U) -/*! KS7_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS7_KS7_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_KSIZE_SHIFT)) & S50_ELS_KS7_KS7_KSIZE_MASK) - -#define S50_ELS_KS7_KS7_KACT_MASK (0x20U) -#define S50_ELS_KS7_KS7_KACT_SHIFT (5U) -#define S50_ELS_KS7_KS7_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_KACT_SHIFT)) & S50_ELS_KS7_KS7_KACT_MASK) - -#define S50_ELS_KS7_KS7_KBASE_MASK (0x40U) -#define S50_ELS_KS7_KS7_KBASE_SHIFT (6U) -#define S50_ELS_KS7_KS7_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_KBASE_SHIFT)) & S50_ELS_KS7_KS7_KBASE_MASK) - -#define S50_ELS_KS7_KS7_FGP_MASK (0x80U) -#define S50_ELS_KS7_KS7_FGP_SHIFT (7U) -#define S50_ELS_KS7_KS7_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_FGP_SHIFT)) & S50_ELS_KS7_KS7_FGP_MASK) - -#define S50_ELS_KS7_KS7_FRTN_MASK (0x100U) -#define S50_ELS_KS7_KS7_FRTN_SHIFT (8U) -#define S50_ELS_KS7_KS7_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_FRTN_SHIFT)) & S50_ELS_KS7_KS7_FRTN_MASK) - -#define S50_ELS_KS7_KS7_FHWO_MASK (0x200U) -#define S50_ELS_KS7_KS7_FHWO_SHIFT (9U) -#define S50_ELS_KS7_KS7_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_FHWO_SHIFT)) & S50_ELS_KS7_KS7_FHWO_MASK) - -#define S50_ELS_KS7_KS7_UKPUK_MASK (0x800U) -#define S50_ELS_KS7_KS7_UKPUK_SHIFT (11U) -#define S50_ELS_KS7_KS7_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UKPUK_SHIFT)) & S50_ELS_KS7_KS7_UKPUK_MASK) - -#define S50_ELS_KS7_KS7_UTECDH_MASK (0x1000U) -#define S50_ELS_KS7_KS7_UTECDH_SHIFT (12U) -#define S50_ELS_KS7_KS7_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UTECDH_SHIFT)) & S50_ELS_KS7_KS7_UTECDH_MASK) - -#define S50_ELS_KS7_KS7_UCMAC_MASK (0x2000U) -#define S50_ELS_KS7_KS7_UCMAC_SHIFT (13U) -#define S50_ELS_KS7_KS7_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UCMAC_SHIFT)) & S50_ELS_KS7_KS7_UCMAC_MASK) - -#define S50_ELS_KS7_KS7_UKSK_MASK (0x4000U) -#define S50_ELS_KS7_KS7_UKSK_SHIFT (14U) -#define S50_ELS_KS7_KS7_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UKSK_SHIFT)) & S50_ELS_KS7_KS7_UKSK_MASK) - -#define S50_ELS_KS7_KS7_URTF_MASK (0x8000U) -#define S50_ELS_KS7_KS7_URTF_SHIFT (15U) -#define S50_ELS_KS7_KS7_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_URTF_SHIFT)) & S50_ELS_KS7_KS7_URTF_MASK) - -#define S50_ELS_KS7_KS7_UCKDF_MASK (0x10000U) -#define S50_ELS_KS7_KS7_UCKDF_SHIFT (16U) -#define S50_ELS_KS7_KS7_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UCKDF_SHIFT)) & S50_ELS_KS7_KS7_UCKDF_MASK) - -#define S50_ELS_KS7_KS7_UHKDF_MASK (0x20000U) -#define S50_ELS_KS7_KS7_UHKDF_SHIFT (17U) -#define S50_ELS_KS7_KS7_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UHKDF_SHIFT)) & S50_ELS_KS7_KS7_UHKDF_MASK) - -#define S50_ELS_KS7_KS7_UECSG_MASK (0x40000U) -#define S50_ELS_KS7_KS7_UECSG_SHIFT (18U) -#define S50_ELS_KS7_KS7_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UECSG_SHIFT)) & S50_ELS_KS7_KS7_UECSG_MASK) - -#define S50_ELS_KS7_KS7_UECDH_MASK (0x80000U) -#define S50_ELS_KS7_KS7_UECDH_SHIFT (19U) -#define S50_ELS_KS7_KS7_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UECDH_SHIFT)) & S50_ELS_KS7_KS7_UECDH_MASK) - -#define S50_ELS_KS7_KS7_UAES_MASK (0x100000U) -#define S50_ELS_KS7_KS7_UAES_SHIFT (20U) -#define S50_ELS_KS7_KS7_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UAES_SHIFT)) & S50_ELS_KS7_KS7_UAES_MASK) - -#define S50_ELS_KS7_KS7_UHMAC_MASK (0x200000U) -#define S50_ELS_KS7_KS7_UHMAC_SHIFT (21U) -#define S50_ELS_KS7_KS7_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UHMAC_SHIFT)) & S50_ELS_KS7_KS7_UHMAC_MASK) - -#define S50_ELS_KS7_KS7_UKWK_MASK (0x400000U) -#define S50_ELS_KS7_KS7_UKWK_SHIFT (22U) -#define S50_ELS_KS7_KS7_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UKWK_SHIFT)) & S50_ELS_KS7_KS7_UKWK_MASK) - -#define S50_ELS_KS7_KS7_UKUOK_MASK (0x800000U) -#define S50_ELS_KS7_KS7_UKUOK_SHIFT (23U) -#define S50_ELS_KS7_KS7_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UKUOK_SHIFT)) & S50_ELS_KS7_KS7_UKUOK_MASK) - -#define S50_ELS_KS7_KS7_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS7_KS7_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS7_KS7_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UTLSPMS_SHIFT)) & S50_ELS_KS7_KS7_UTLSPMS_MASK) - -#define S50_ELS_KS7_KS7_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS7_KS7_UTLSMS_SHIFT (25U) -#define S50_ELS_KS7_KS7_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UTLSMS_SHIFT)) & S50_ELS_KS7_KS7_UTLSMS_MASK) - -#define S50_ELS_KS7_KS7_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS7_KS7_UKGSRC_SHIFT (26U) -#define S50_ELS_KS7_KS7_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UKGSRC_SHIFT)) & S50_ELS_KS7_KS7_UKGSRC_MASK) - -#define S50_ELS_KS7_KS7_UHWO_MASK (0x8000000U) -#define S50_ELS_KS7_KS7_UHWO_SHIFT (27U) -#define S50_ELS_KS7_KS7_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UHWO_SHIFT)) & S50_ELS_KS7_KS7_UHWO_MASK) - -#define S50_ELS_KS7_KS7_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS7_KS7_UWRPOK_SHIFT (28U) -#define S50_ELS_KS7_KS7_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UWRPOK_SHIFT)) & S50_ELS_KS7_KS7_UWRPOK_MASK) - -#define S50_ELS_KS7_KS7_UDUK_MASK (0x20000000U) -#define S50_ELS_KS7_KS7_UDUK_SHIFT (29U) -#define S50_ELS_KS7_KS7_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UDUK_SHIFT)) & S50_ELS_KS7_KS7_UDUK_MASK) - -#define S50_ELS_KS7_KS7_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS7_KS7_UPPROT_SHIFT (30U) -#define S50_ELS_KS7_KS7_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UPPROT_SHIFT)) & S50_ELS_KS7_KS7_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS8 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS8_KS8_KSIZE_MASK (0x3U) -#define S50_ELS_KS8_KS8_KSIZE_SHIFT (0U) -/*! KS8_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS8_KS8_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_KSIZE_SHIFT)) & S50_ELS_KS8_KS8_KSIZE_MASK) - -#define S50_ELS_KS8_KS8_KACT_MASK (0x20U) -#define S50_ELS_KS8_KS8_KACT_SHIFT (5U) -#define S50_ELS_KS8_KS8_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_KACT_SHIFT)) & S50_ELS_KS8_KS8_KACT_MASK) - -#define S50_ELS_KS8_KS8_KBASE_MASK (0x40U) -#define S50_ELS_KS8_KS8_KBASE_SHIFT (6U) -#define S50_ELS_KS8_KS8_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_KBASE_SHIFT)) & S50_ELS_KS8_KS8_KBASE_MASK) - -#define S50_ELS_KS8_KS8_FGP_MASK (0x80U) -#define S50_ELS_KS8_KS8_FGP_SHIFT (7U) -#define S50_ELS_KS8_KS8_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_FGP_SHIFT)) & S50_ELS_KS8_KS8_FGP_MASK) - -#define S50_ELS_KS8_KS8_FRTN_MASK (0x100U) -#define S50_ELS_KS8_KS8_FRTN_SHIFT (8U) -#define S50_ELS_KS8_KS8_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_FRTN_SHIFT)) & S50_ELS_KS8_KS8_FRTN_MASK) - -#define S50_ELS_KS8_KS8_FHWO_MASK (0x200U) -#define S50_ELS_KS8_KS8_FHWO_SHIFT (9U) -#define S50_ELS_KS8_KS8_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_FHWO_SHIFT)) & S50_ELS_KS8_KS8_FHWO_MASK) - -#define S50_ELS_KS8_KS8_UKPUK_MASK (0x800U) -#define S50_ELS_KS8_KS8_UKPUK_SHIFT (11U) -#define S50_ELS_KS8_KS8_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UKPUK_SHIFT)) & S50_ELS_KS8_KS8_UKPUK_MASK) - -#define S50_ELS_KS8_KS8_UTECDH_MASK (0x1000U) -#define S50_ELS_KS8_KS8_UTECDH_SHIFT (12U) -#define S50_ELS_KS8_KS8_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UTECDH_SHIFT)) & S50_ELS_KS8_KS8_UTECDH_MASK) - -#define S50_ELS_KS8_KS8_UCMAC_MASK (0x2000U) -#define S50_ELS_KS8_KS8_UCMAC_SHIFT (13U) -#define S50_ELS_KS8_KS8_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UCMAC_SHIFT)) & S50_ELS_KS8_KS8_UCMAC_MASK) - -#define S50_ELS_KS8_KS8_UKSK_MASK (0x4000U) -#define S50_ELS_KS8_KS8_UKSK_SHIFT (14U) -#define S50_ELS_KS8_KS8_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UKSK_SHIFT)) & S50_ELS_KS8_KS8_UKSK_MASK) - -#define S50_ELS_KS8_KS8_URTF_MASK (0x8000U) -#define S50_ELS_KS8_KS8_URTF_SHIFT (15U) -#define S50_ELS_KS8_KS8_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_URTF_SHIFT)) & S50_ELS_KS8_KS8_URTF_MASK) - -#define S50_ELS_KS8_KS8_UCKDF_MASK (0x10000U) -#define S50_ELS_KS8_KS8_UCKDF_SHIFT (16U) -#define S50_ELS_KS8_KS8_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UCKDF_SHIFT)) & S50_ELS_KS8_KS8_UCKDF_MASK) - -#define S50_ELS_KS8_KS8_UHKDF_MASK (0x20000U) -#define S50_ELS_KS8_KS8_UHKDF_SHIFT (17U) -#define S50_ELS_KS8_KS8_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UHKDF_SHIFT)) & S50_ELS_KS8_KS8_UHKDF_MASK) - -#define S50_ELS_KS8_KS8_UECSG_MASK (0x40000U) -#define S50_ELS_KS8_KS8_UECSG_SHIFT (18U) -#define S50_ELS_KS8_KS8_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UECSG_SHIFT)) & S50_ELS_KS8_KS8_UECSG_MASK) - -#define S50_ELS_KS8_KS8_UECDH_MASK (0x80000U) -#define S50_ELS_KS8_KS8_UECDH_SHIFT (19U) -#define S50_ELS_KS8_KS8_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UECDH_SHIFT)) & S50_ELS_KS8_KS8_UECDH_MASK) - -#define S50_ELS_KS8_KS8_UAES_MASK (0x100000U) -#define S50_ELS_KS8_KS8_UAES_SHIFT (20U) -#define S50_ELS_KS8_KS8_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UAES_SHIFT)) & S50_ELS_KS8_KS8_UAES_MASK) - -#define S50_ELS_KS8_KS8_UHMAC_MASK (0x200000U) -#define S50_ELS_KS8_KS8_UHMAC_SHIFT (21U) -#define S50_ELS_KS8_KS8_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UHMAC_SHIFT)) & S50_ELS_KS8_KS8_UHMAC_MASK) - -#define S50_ELS_KS8_KS8_UKWK_MASK (0x400000U) -#define S50_ELS_KS8_KS8_UKWK_SHIFT (22U) -#define S50_ELS_KS8_KS8_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UKWK_SHIFT)) & S50_ELS_KS8_KS8_UKWK_MASK) - -#define S50_ELS_KS8_KS8_UKUOK_MASK (0x800000U) -#define S50_ELS_KS8_KS8_UKUOK_SHIFT (23U) -#define S50_ELS_KS8_KS8_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UKUOK_SHIFT)) & S50_ELS_KS8_KS8_UKUOK_MASK) - -#define S50_ELS_KS8_KS8_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS8_KS8_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS8_KS8_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UTLSPMS_SHIFT)) & S50_ELS_KS8_KS8_UTLSPMS_MASK) - -#define S50_ELS_KS8_KS8_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS8_KS8_UTLSMS_SHIFT (25U) -#define S50_ELS_KS8_KS8_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UTLSMS_SHIFT)) & S50_ELS_KS8_KS8_UTLSMS_MASK) - -#define S50_ELS_KS8_KS8_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS8_KS8_UKGSRC_SHIFT (26U) -#define S50_ELS_KS8_KS8_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UKGSRC_SHIFT)) & S50_ELS_KS8_KS8_UKGSRC_MASK) - -#define S50_ELS_KS8_KS8_UHWO_MASK (0x8000000U) -#define S50_ELS_KS8_KS8_UHWO_SHIFT (27U) -#define S50_ELS_KS8_KS8_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UHWO_SHIFT)) & S50_ELS_KS8_KS8_UHWO_MASK) - -#define S50_ELS_KS8_KS8_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS8_KS8_UWRPOK_SHIFT (28U) -#define S50_ELS_KS8_KS8_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UWRPOK_SHIFT)) & S50_ELS_KS8_KS8_UWRPOK_MASK) - -#define S50_ELS_KS8_KS8_UDUK_MASK (0x20000000U) -#define S50_ELS_KS8_KS8_UDUK_SHIFT (29U) -#define S50_ELS_KS8_KS8_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UDUK_SHIFT)) & S50_ELS_KS8_KS8_UDUK_MASK) - -#define S50_ELS_KS8_KS8_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS8_KS8_UPPROT_SHIFT (30U) -#define S50_ELS_KS8_KS8_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UPPROT_SHIFT)) & S50_ELS_KS8_KS8_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS9 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS9_KS9_KSIZE_MASK (0x3U) -#define S50_ELS_KS9_KS9_KSIZE_SHIFT (0U) -/*! KS9_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS9_KS9_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_KSIZE_SHIFT)) & S50_ELS_KS9_KS9_KSIZE_MASK) - -#define S50_ELS_KS9_KS9_KACT_MASK (0x20U) -#define S50_ELS_KS9_KS9_KACT_SHIFT (5U) -#define S50_ELS_KS9_KS9_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_KACT_SHIFT)) & S50_ELS_KS9_KS9_KACT_MASK) - -#define S50_ELS_KS9_KS9_KBASE_MASK (0x40U) -#define S50_ELS_KS9_KS9_KBASE_SHIFT (6U) -#define S50_ELS_KS9_KS9_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_KBASE_SHIFT)) & S50_ELS_KS9_KS9_KBASE_MASK) - -#define S50_ELS_KS9_KS9_FGP_MASK (0x80U) -#define S50_ELS_KS9_KS9_FGP_SHIFT (7U) -#define S50_ELS_KS9_KS9_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_FGP_SHIFT)) & S50_ELS_KS9_KS9_FGP_MASK) - -#define S50_ELS_KS9_KS9_FRTN_MASK (0x100U) -#define S50_ELS_KS9_KS9_FRTN_SHIFT (8U) -#define S50_ELS_KS9_KS9_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_FRTN_SHIFT)) & S50_ELS_KS9_KS9_FRTN_MASK) - -#define S50_ELS_KS9_KS9_FHWO_MASK (0x200U) -#define S50_ELS_KS9_KS9_FHWO_SHIFT (9U) -#define S50_ELS_KS9_KS9_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_FHWO_SHIFT)) & S50_ELS_KS9_KS9_FHWO_MASK) - -#define S50_ELS_KS9_KS9_UKPUK_MASK (0x800U) -#define S50_ELS_KS9_KS9_UKPUK_SHIFT (11U) -#define S50_ELS_KS9_KS9_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UKPUK_SHIFT)) & S50_ELS_KS9_KS9_UKPUK_MASK) - -#define S50_ELS_KS9_KS9_UTECDH_MASK (0x1000U) -#define S50_ELS_KS9_KS9_UTECDH_SHIFT (12U) -#define S50_ELS_KS9_KS9_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UTECDH_SHIFT)) & S50_ELS_KS9_KS9_UTECDH_MASK) - -#define S50_ELS_KS9_KS9_UCMAC_MASK (0x2000U) -#define S50_ELS_KS9_KS9_UCMAC_SHIFT (13U) -#define S50_ELS_KS9_KS9_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UCMAC_SHIFT)) & S50_ELS_KS9_KS9_UCMAC_MASK) - -#define S50_ELS_KS9_KS9_UKSK_MASK (0x4000U) -#define S50_ELS_KS9_KS9_UKSK_SHIFT (14U) -#define S50_ELS_KS9_KS9_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UKSK_SHIFT)) & S50_ELS_KS9_KS9_UKSK_MASK) - -#define S50_ELS_KS9_KS9_URTF_MASK (0x8000U) -#define S50_ELS_KS9_KS9_URTF_SHIFT (15U) -#define S50_ELS_KS9_KS9_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_URTF_SHIFT)) & S50_ELS_KS9_KS9_URTF_MASK) - -#define S50_ELS_KS9_KS9_UCKDF_MASK (0x10000U) -#define S50_ELS_KS9_KS9_UCKDF_SHIFT (16U) -#define S50_ELS_KS9_KS9_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UCKDF_SHIFT)) & S50_ELS_KS9_KS9_UCKDF_MASK) - -#define S50_ELS_KS9_KS9_UHKDF_MASK (0x20000U) -#define S50_ELS_KS9_KS9_UHKDF_SHIFT (17U) -#define S50_ELS_KS9_KS9_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UHKDF_SHIFT)) & S50_ELS_KS9_KS9_UHKDF_MASK) - -#define S50_ELS_KS9_KS9_UECSG_MASK (0x40000U) -#define S50_ELS_KS9_KS9_UECSG_SHIFT (18U) -#define S50_ELS_KS9_KS9_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UECSG_SHIFT)) & S50_ELS_KS9_KS9_UECSG_MASK) - -#define S50_ELS_KS9_KS9_UECDH_MASK (0x80000U) -#define S50_ELS_KS9_KS9_UECDH_SHIFT (19U) -#define S50_ELS_KS9_KS9_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UECDH_SHIFT)) & S50_ELS_KS9_KS9_UECDH_MASK) - -#define S50_ELS_KS9_KS9_UAES_MASK (0x100000U) -#define S50_ELS_KS9_KS9_UAES_SHIFT (20U) -#define S50_ELS_KS9_KS9_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UAES_SHIFT)) & S50_ELS_KS9_KS9_UAES_MASK) - -#define S50_ELS_KS9_KS9_UHMAC_MASK (0x200000U) -#define S50_ELS_KS9_KS9_UHMAC_SHIFT (21U) -#define S50_ELS_KS9_KS9_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UHMAC_SHIFT)) & S50_ELS_KS9_KS9_UHMAC_MASK) - -#define S50_ELS_KS9_KS9_UKWK_MASK (0x400000U) -#define S50_ELS_KS9_KS9_UKWK_SHIFT (22U) -#define S50_ELS_KS9_KS9_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UKWK_SHIFT)) & S50_ELS_KS9_KS9_UKWK_MASK) - -#define S50_ELS_KS9_KS9_UKUOK_MASK (0x800000U) -#define S50_ELS_KS9_KS9_UKUOK_SHIFT (23U) -#define S50_ELS_KS9_KS9_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UKUOK_SHIFT)) & S50_ELS_KS9_KS9_UKUOK_MASK) - -#define S50_ELS_KS9_KS9_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS9_KS9_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS9_KS9_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UTLSPMS_SHIFT)) & S50_ELS_KS9_KS9_UTLSPMS_MASK) - -#define S50_ELS_KS9_KS9_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS9_KS9_UTLSMS_SHIFT (25U) -#define S50_ELS_KS9_KS9_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UTLSMS_SHIFT)) & S50_ELS_KS9_KS9_UTLSMS_MASK) - -#define S50_ELS_KS9_KS9_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS9_KS9_UKGSRC_SHIFT (26U) -#define S50_ELS_KS9_KS9_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UKGSRC_SHIFT)) & S50_ELS_KS9_KS9_UKGSRC_MASK) - -#define S50_ELS_KS9_KS9_UHWO_MASK (0x8000000U) -#define S50_ELS_KS9_KS9_UHWO_SHIFT (27U) -#define S50_ELS_KS9_KS9_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UHWO_SHIFT)) & S50_ELS_KS9_KS9_UHWO_MASK) - -#define S50_ELS_KS9_KS9_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS9_KS9_UWRPOK_SHIFT (28U) -#define S50_ELS_KS9_KS9_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UWRPOK_SHIFT)) & S50_ELS_KS9_KS9_UWRPOK_MASK) - -#define S50_ELS_KS9_KS9_UDUK_MASK (0x20000000U) -#define S50_ELS_KS9_KS9_UDUK_SHIFT (29U) -#define S50_ELS_KS9_KS9_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UDUK_SHIFT)) & S50_ELS_KS9_KS9_UDUK_MASK) - -#define S50_ELS_KS9_KS9_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS9_KS9_UPPROT_SHIFT (30U) -#define S50_ELS_KS9_KS9_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UPPROT_SHIFT)) & S50_ELS_KS9_KS9_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS10 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS10_KS10_KSIZE_MASK (0x3U) -#define S50_ELS_KS10_KS10_KSIZE_SHIFT (0U) -/*! KS10_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS10_KS10_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_KSIZE_SHIFT)) & S50_ELS_KS10_KS10_KSIZE_MASK) - -#define S50_ELS_KS10_KS10_KACT_MASK (0x20U) -#define S50_ELS_KS10_KS10_KACT_SHIFT (5U) -#define S50_ELS_KS10_KS10_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_KACT_SHIFT)) & S50_ELS_KS10_KS10_KACT_MASK) - -#define S50_ELS_KS10_KS10_KBASE_MASK (0x40U) -#define S50_ELS_KS10_KS10_KBASE_SHIFT (6U) -#define S50_ELS_KS10_KS10_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_KBASE_SHIFT)) & S50_ELS_KS10_KS10_KBASE_MASK) - -#define S50_ELS_KS10_KS10_FGP_MASK (0x80U) -#define S50_ELS_KS10_KS10_FGP_SHIFT (7U) -#define S50_ELS_KS10_KS10_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_FGP_SHIFT)) & S50_ELS_KS10_KS10_FGP_MASK) - -#define S50_ELS_KS10_KS10_FRTN_MASK (0x100U) -#define S50_ELS_KS10_KS10_FRTN_SHIFT (8U) -#define S50_ELS_KS10_KS10_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_FRTN_SHIFT)) & S50_ELS_KS10_KS10_FRTN_MASK) - -#define S50_ELS_KS10_KS10_FHWO_MASK (0x200U) -#define S50_ELS_KS10_KS10_FHWO_SHIFT (9U) -#define S50_ELS_KS10_KS10_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_FHWO_SHIFT)) & S50_ELS_KS10_KS10_FHWO_MASK) - -#define S50_ELS_KS10_KS10_UKPUK_MASK (0x800U) -#define S50_ELS_KS10_KS10_UKPUK_SHIFT (11U) -#define S50_ELS_KS10_KS10_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UKPUK_SHIFT)) & S50_ELS_KS10_KS10_UKPUK_MASK) - -#define S50_ELS_KS10_KS10_UTECDH_MASK (0x1000U) -#define S50_ELS_KS10_KS10_UTECDH_SHIFT (12U) -#define S50_ELS_KS10_KS10_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UTECDH_SHIFT)) & S50_ELS_KS10_KS10_UTECDH_MASK) - -#define S50_ELS_KS10_KS10_UCMAC_MASK (0x2000U) -#define S50_ELS_KS10_KS10_UCMAC_SHIFT (13U) -#define S50_ELS_KS10_KS10_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UCMAC_SHIFT)) & S50_ELS_KS10_KS10_UCMAC_MASK) - -#define S50_ELS_KS10_KS10_UKSK_MASK (0x4000U) -#define S50_ELS_KS10_KS10_UKSK_SHIFT (14U) -#define S50_ELS_KS10_KS10_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UKSK_SHIFT)) & S50_ELS_KS10_KS10_UKSK_MASK) - -#define S50_ELS_KS10_KS10_URTF_MASK (0x8000U) -#define S50_ELS_KS10_KS10_URTF_SHIFT (15U) -#define S50_ELS_KS10_KS10_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_URTF_SHIFT)) & S50_ELS_KS10_KS10_URTF_MASK) - -#define S50_ELS_KS10_KS10_UCKDF_MASK (0x10000U) -#define S50_ELS_KS10_KS10_UCKDF_SHIFT (16U) -#define S50_ELS_KS10_KS10_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UCKDF_SHIFT)) & S50_ELS_KS10_KS10_UCKDF_MASK) - -#define S50_ELS_KS10_KS10_UHKDF_MASK (0x20000U) -#define S50_ELS_KS10_KS10_UHKDF_SHIFT (17U) -#define S50_ELS_KS10_KS10_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UHKDF_SHIFT)) & S50_ELS_KS10_KS10_UHKDF_MASK) - -#define S50_ELS_KS10_KS10_UECSG_MASK (0x40000U) -#define S50_ELS_KS10_KS10_UECSG_SHIFT (18U) -#define S50_ELS_KS10_KS10_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UECSG_SHIFT)) & S50_ELS_KS10_KS10_UECSG_MASK) - -#define S50_ELS_KS10_KS10_UECDH_MASK (0x80000U) -#define S50_ELS_KS10_KS10_UECDH_SHIFT (19U) -#define S50_ELS_KS10_KS10_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UECDH_SHIFT)) & S50_ELS_KS10_KS10_UECDH_MASK) - -#define S50_ELS_KS10_KS10_UAES_MASK (0x100000U) -#define S50_ELS_KS10_KS10_UAES_SHIFT (20U) -#define S50_ELS_KS10_KS10_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UAES_SHIFT)) & S50_ELS_KS10_KS10_UAES_MASK) - -#define S50_ELS_KS10_KS10_UHMAC_MASK (0x200000U) -#define S50_ELS_KS10_KS10_UHMAC_SHIFT (21U) -#define S50_ELS_KS10_KS10_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UHMAC_SHIFT)) & S50_ELS_KS10_KS10_UHMAC_MASK) - -#define S50_ELS_KS10_KS10_UKWK_MASK (0x400000U) -#define S50_ELS_KS10_KS10_UKWK_SHIFT (22U) -#define S50_ELS_KS10_KS10_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UKWK_SHIFT)) & S50_ELS_KS10_KS10_UKWK_MASK) - -#define S50_ELS_KS10_KS10_UKUOK_MASK (0x800000U) -#define S50_ELS_KS10_KS10_UKUOK_SHIFT (23U) -#define S50_ELS_KS10_KS10_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UKUOK_SHIFT)) & S50_ELS_KS10_KS10_UKUOK_MASK) - -#define S50_ELS_KS10_KS10_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS10_KS10_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS10_KS10_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UTLSPMS_SHIFT)) & S50_ELS_KS10_KS10_UTLSPMS_MASK) - -#define S50_ELS_KS10_KS10_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS10_KS10_UTLSMS_SHIFT (25U) -#define S50_ELS_KS10_KS10_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UTLSMS_SHIFT)) & S50_ELS_KS10_KS10_UTLSMS_MASK) - -#define S50_ELS_KS10_KS10_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS10_KS10_UKGSRC_SHIFT (26U) -#define S50_ELS_KS10_KS10_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UKGSRC_SHIFT)) & S50_ELS_KS10_KS10_UKGSRC_MASK) - -#define S50_ELS_KS10_KS10_UHWO_MASK (0x8000000U) -#define S50_ELS_KS10_KS10_UHWO_SHIFT (27U) -#define S50_ELS_KS10_KS10_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UHWO_SHIFT)) & S50_ELS_KS10_KS10_UHWO_MASK) - -#define S50_ELS_KS10_KS10_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS10_KS10_UWRPOK_SHIFT (28U) -#define S50_ELS_KS10_KS10_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UWRPOK_SHIFT)) & S50_ELS_KS10_KS10_UWRPOK_MASK) - -#define S50_ELS_KS10_KS10_UDUK_MASK (0x20000000U) -#define S50_ELS_KS10_KS10_UDUK_SHIFT (29U) -#define S50_ELS_KS10_KS10_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UDUK_SHIFT)) & S50_ELS_KS10_KS10_UDUK_MASK) - -#define S50_ELS_KS10_KS10_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS10_KS10_UPPROT_SHIFT (30U) -#define S50_ELS_KS10_KS10_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UPPROT_SHIFT)) & S50_ELS_KS10_KS10_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS11 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS11_KS11_KSIZE_MASK (0x3U) -#define S50_ELS_KS11_KS11_KSIZE_SHIFT (0U) -/*! KS11_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS11_KS11_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_KSIZE_SHIFT)) & S50_ELS_KS11_KS11_KSIZE_MASK) - -#define S50_ELS_KS11_KS11_KACT_MASK (0x20U) -#define S50_ELS_KS11_KS11_KACT_SHIFT (5U) -#define S50_ELS_KS11_KS11_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_KACT_SHIFT)) & S50_ELS_KS11_KS11_KACT_MASK) - -#define S50_ELS_KS11_KS11_KBASE_MASK (0x40U) -#define S50_ELS_KS11_KS11_KBASE_SHIFT (6U) -#define S50_ELS_KS11_KS11_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_KBASE_SHIFT)) & S50_ELS_KS11_KS11_KBASE_MASK) - -#define S50_ELS_KS11_KS11_FGP_MASK (0x80U) -#define S50_ELS_KS11_KS11_FGP_SHIFT (7U) -#define S50_ELS_KS11_KS11_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_FGP_SHIFT)) & S50_ELS_KS11_KS11_FGP_MASK) - -#define S50_ELS_KS11_KS11_FRTN_MASK (0x100U) -#define S50_ELS_KS11_KS11_FRTN_SHIFT (8U) -#define S50_ELS_KS11_KS11_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_FRTN_SHIFT)) & S50_ELS_KS11_KS11_FRTN_MASK) - -#define S50_ELS_KS11_KS11_FHWO_MASK (0x200U) -#define S50_ELS_KS11_KS11_FHWO_SHIFT (9U) -#define S50_ELS_KS11_KS11_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_FHWO_SHIFT)) & S50_ELS_KS11_KS11_FHWO_MASK) - -#define S50_ELS_KS11_KS11_UKPUK_MASK (0x800U) -#define S50_ELS_KS11_KS11_UKPUK_SHIFT (11U) -#define S50_ELS_KS11_KS11_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UKPUK_SHIFT)) & S50_ELS_KS11_KS11_UKPUK_MASK) - -#define S50_ELS_KS11_KS11_UTECDH_MASK (0x1000U) -#define S50_ELS_KS11_KS11_UTECDH_SHIFT (12U) -#define S50_ELS_KS11_KS11_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UTECDH_SHIFT)) & S50_ELS_KS11_KS11_UTECDH_MASK) - -#define S50_ELS_KS11_KS11_UCMAC_MASK (0x2000U) -#define S50_ELS_KS11_KS11_UCMAC_SHIFT (13U) -#define S50_ELS_KS11_KS11_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UCMAC_SHIFT)) & S50_ELS_KS11_KS11_UCMAC_MASK) - -#define S50_ELS_KS11_KS11_UKSK_MASK (0x4000U) -#define S50_ELS_KS11_KS11_UKSK_SHIFT (14U) -#define S50_ELS_KS11_KS11_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UKSK_SHIFT)) & S50_ELS_KS11_KS11_UKSK_MASK) - -#define S50_ELS_KS11_KS11_URTF_MASK (0x8000U) -#define S50_ELS_KS11_KS11_URTF_SHIFT (15U) -#define S50_ELS_KS11_KS11_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_URTF_SHIFT)) & S50_ELS_KS11_KS11_URTF_MASK) - -#define S50_ELS_KS11_KS11_UCKDF_MASK (0x10000U) -#define S50_ELS_KS11_KS11_UCKDF_SHIFT (16U) -#define S50_ELS_KS11_KS11_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UCKDF_SHIFT)) & S50_ELS_KS11_KS11_UCKDF_MASK) - -#define S50_ELS_KS11_KS11_UHKDF_MASK (0x20000U) -#define S50_ELS_KS11_KS11_UHKDF_SHIFT (17U) -#define S50_ELS_KS11_KS11_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UHKDF_SHIFT)) & S50_ELS_KS11_KS11_UHKDF_MASK) - -#define S50_ELS_KS11_KS11_UECSG_MASK (0x40000U) -#define S50_ELS_KS11_KS11_UECSG_SHIFT (18U) -#define S50_ELS_KS11_KS11_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UECSG_SHIFT)) & S50_ELS_KS11_KS11_UECSG_MASK) - -#define S50_ELS_KS11_KS11_UECDH_MASK (0x80000U) -#define S50_ELS_KS11_KS11_UECDH_SHIFT (19U) -#define S50_ELS_KS11_KS11_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UECDH_SHIFT)) & S50_ELS_KS11_KS11_UECDH_MASK) - -#define S50_ELS_KS11_KS11_UAES_MASK (0x100000U) -#define S50_ELS_KS11_KS11_UAES_SHIFT (20U) -#define S50_ELS_KS11_KS11_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UAES_SHIFT)) & S50_ELS_KS11_KS11_UAES_MASK) - -#define S50_ELS_KS11_KS11_UHMAC_MASK (0x200000U) -#define S50_ELS_KS11_KS11_UHMAC_SHIFT (21U) -#define S50_ELS_KS11_KS11_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UHMAC_SHIFT)) & S50_ELS_KS11_KS11_UHMAC_MASK) - -#define S50_ELS_KS11_KS11_UKWK_MASK (0x400000U) -#define S50_ELS_KS11_KS11_UKWK_SHIFT (22U) -#define S50_ELS_KS11_KS11_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UKWK_SHIFT)) & S50_ELS_KS11_KS11_UKWK_MASK) - -#define S50_ELS_KS11_KS11_UKUOK_MASK (0x800000U) -#define S50_ELS_KS11_KS11_UKUOK_SHIFT (23U) -#define S50_ELS_KS11_KS11_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UKUOK_SHIFT)) & S50_ELS_KS11_KS11_UKUOK_MASK) - -#define S50_ELS_KS11_KS11_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS11_KS11_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS11_KS11_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UTLSPMS_SHIFT)) & S50_ELS_KS11_KS11_UTLSPMS_MASK) - -#define S50_ELS_KS11_KS11_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS11_KS11_UTLSMS_SHIFT (25U) -#define S50_ELS_KS11_KS11_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UTLSMS_SHIFT)) & S50_ELS_KS11_KS11_UTLSMS_MASK) - -#define S50_ELS_KS11_KS11_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS11_KS11_UKGSRC_SHIFT (26U) -#define S50_ELS_KS11_KS11_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UKGSRC_SHIFT)) & S50_ELS_KS11_KS11_UKGSRC_MASK) - -#define S50_ELS_KS11_KS11_UHWO_MASK (0x8000000U) -#define S50_ELS_KS11_KS11_UHWO_SHIFT (27U) -#define S50_ELS_KS11_KS11_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UHWO_SHIFT)) & S50_ELS_KS11_KS11_UHWO_MASK) - -#define S50_ELS_KS11_KS11_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS11_KS11_UWRPOK_SHIFT (28U) -#define S50_ELS_KS11_KS11_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UWRPOK_SHIFT)) & S50_ELS_KS11_KS11_UWRPOK_MASK) - -#define S50_ELS_KS11_KS11_UDUK_MASK (0x20000000U) -#define S50_ELS_KS11_KS11_UDUK_SHIFT (29U) -#define S50_ELS_KS11_KS11_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UDUK_SHIFT)) & S50_ELS_KS11_KS11_UDUK_MASK) - -#define S50_ELS_KS11_KS11_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS11_KS11_UPPROT_SHIFT (30U) -#define S50_ELS_KS11_KS11_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UPPROT_SHIFT)) & S50_ELS_KS11_KS11_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS12 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS12_KS12_KSIZE_MASK (0x3U) -#define S50_ELS_KS12_KS12_KSIZE_SHIFT (0U) -/*! KS12_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS12_KS12_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_KSIZE_SHIFT)) & S50_ELS_KS12_KS12_KSIZE_MASK) - -#define S50_ELS_KS12_KS12_KACT_MASK (0x20U) -#define S50_ELS_KS12_KS12_KACT_SHIFT (5U) -#define S50_ELS_KS12_KS12_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_KACT_SHIFT)) & S50_ELS_KS12_KS12_KACT_MASK) - -#define S50_ELS_KS12_KS12_KBASE_MASK (0x40U) -#define S50_ELS_KS12_KS12_KBASE_SHIFT (6U) -#define S50_ELS_KS12_KS12_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_KBASE_SHIFT)) & S50_ELS_KS12_KS12_KBASE_MASK) - -#define S50_ELS_KS12_KS12_FGP_MASK (0x80U) -#define S50_ELS_KS12_KS12_FGP_SHIFT (7U) -#define S50_ELS_KS12_KS12_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_FGP_SHIFT)) & S50_ELS_KS12_KS12_FGP_MASK) - -#define S50_ELS_KS12_KS12_FRTN_MASK (0x100U) -#define S50_ELS_KS12_KS12_FRTN_SHIFT (8U) -#define S50_ELS_KS12_KS12_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_FRTN_SHIFT)) & S50_ELS_KS12_KS12_FRTN_MASK) - -#define S50_ELS_KS12_KS12_FHWO_MASK (0x200U) -#define S50_ELS_KS12_KS12_FHWO_SHIFT (9U) -#define S50_ELS_KS12_KS12_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_FHWO_SHIFT)) & S50_ELS_KS12_KS12_FHWO_MASK) - -#define S50_ELS_KS12_KS12_UKPUK_MASK (0x800U) -#define S50_ELS_KS12_KS12_UKPUK_SHIFT (11U) -#define S50_ELS_KS12_KS12_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UKPUK_SHIFT)) & S50_ELS_KS12_KS12_UKPUK_MASK) - -#define S50_ELS_KS12_KS12_UTECDH_MASK (0x1000U) -#define S50_ELS_KS12_KS12_UTECDH_SHIFT (12U) -#define S50_ELS_KS12_KS12_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UTECDH_SHIFT)) & S50_ELS_KS12_KS12_UTECDH_MASK) - -#define S50_ELS_KS12_KS12_UCMAC_MASK (0x2000U) -#define S50_ELS_KS12_KS12_UCMAC_SHIFT (13U) -#define S50_ELS_KS12_KS12_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UCMAC_SHIFT)) & S50_ELS_KS12_KS12_UCMAC_MASK) - -#define S50_ELS_KS12_KS12_UKSK_MASK (0x4000U) -#define S50_ELS_KS12_KS12_UKSK_SHIFT (14U) -#define S50_ELS_KS12_KS12_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UKSK_SHIFT)) & S50_ELS_KS12_KS12_UKSK_MASK) - -#define S50_ELS_KS12_KS12_URTF_MASK (0x8000U) -#define S50_ELS_KS12_KS12_URTF_SHIFT (15U) -#define S50_ELS_KS12_KS12_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_URTF_SHIFT)) & S50_ELS_KS12_KS12_URTF_MASK) - -#define S50_ELS_KS12_KS12_UCKDF_MASK (0x10000U) -#define S50_ELS_KS12_KS12_UCKDF_SHIFT (16U) -#define S50_ELS_KS12_KS12_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UCKDF_SHIFT)) & S50_ELS_KS12_KS12_UCKDF_MASK) - -#define S50_ELS_KS12_KS12_UHKDF_MASK (0x20000U) -#define S50_ELS_KS12_KS12_UHKDF_SHIFT (17U) -#define S50_ELS_KS12_KS12_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UHKDF_SHIFT)) & S50_ELS_KS12_KS12_UHKDF_MASK) - -#define S50_ELS_KS12_KS12_UECSG_MASK (0x40000U) -#define S50_ELS_KS12_KS12_UECSG_SHIFT (18U) -#define S50_ELS_KS12_KS12_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UECSG_SHIFT)) & S50_ELS_KS12_KS12_UECSG_MASK) - -#define S50_ELS_KS12_KS12_UECDH_MASK (0x80000U) -#define S50_ELS_KS12_KS12_UECDH_SHIFT (19U) -#define S50_ELS_KS12_KS12_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UECDH_SHIFT)) & S50_ELS_KS12_KS12_UECDH_MASK) - -#define S50_ELS_KS12_KS12_UAES_MASK (0x100000U) -#define S50_ELS_KS12_KS12_UAES_SHIFT (20U) -#define S50_ELS_KS12_KS12_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UAES_SHIFT)) & S50_ELS_KS12_KS12_UAES_MASK) - -#define S50_ELS_KS12_KS12_UHMAC_MASK (0x200000U) -#define S50_ELS_KS12_KS12_UHMAC_SHIFT (21U) -#define S50_ELS_KS12_KS12_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UHMAC_SHIFT)) & S50_ELS_KS12_KS12_UHMAC_MASK) - -#define S50_ELS_KS12_KS12_UKWK_MASK (0x400000U) -#define S50_ELS_KS12_KS12_UKWK_SHIFT (22U) -#define S50_ELS_KS12_KS12_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UKWK_SHIFT)) & S50_ELS_KS12_KS12_UKWK_MASK) - -#define S50_ELS_KS12_KS12_UKUOK_MASK (0x800000U) -#define S50_ELS_KS12_KS12_UKUOK_SHIFT (23U) -#define S50_ELS_KS12_KS12_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UKUOK_SHIFT)) & S50_ELS_KS12_KS12_UKUOK_MASK) - -#define S50_ELS_KS12_KS12_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS12_KS12_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS12_KS12_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UTLSPMS_SHIFT)) & S50_ELS_KS12_KS12_UTLSPMS_MASK) - -#define S50_ELS_KS12_KS12_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS12_KS12_UTLSMS_SHIFT (25U) -#define S50_ELS_KS12_KS12_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UTLSMS_SHIFT)) & S50_ELS_KS12_KS12_UTLSMS_MASK) - -#define S50_ELS_KS12_KS12_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS12_KS12_UKGSRC_SHIFT (26U) -#define S50_ELS_KS12_KS12_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UKGSRC_SHIFT)) & S50_ELS_KS12_KS12_UKGSRC_MASK) - -#define S50_ELS_KS12_KS12_UHWO_MASK (0x8000000U) -#define S50_ELS_KS12_KS12_UHWO_SHIFT (27U) -#define S50_ELS_KS12_KS12_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UHWO_SHIFT)) & S50_ELS_KS12_KS12_UHWO_MASK) - -#define S50_ELS_KS12_KS12_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS12_KS12_UWRPOK_SHIFT (28U) -#define S50_ELS_KS12_KS12_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UWRPOK_SHIFT)) & S50_ELS_KS12_KS12_UWRPOK_MASK) - -#define S50_ELS_KS12_KS12_UDUK_MASK (0x20000000U) -#define S50_ELS_KS12_KS12_UDUK_SHIFT (29U) -#define S50_ELS_KS12_KS12_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UDUK_SHIFT)) & S50_ELS_KS12_KS12_UDUK_MASK) - -#define S50_ELS_KS12_KS12_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS12_KS12_UPPROT_SHIFT (30U) -#define S50_ELS_KS12_KS12_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UPPROT_SHIFT)) & S50_ELS_KS12_KS12_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS13 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS13_KS13_KSIZE_MASK (0x3U) -#define S50_ELS_KS13_KS13_KSIZE_SHIFT (0U) -/*! KS13_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS13_KS13_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_KSIZE_SHIFT)) & S50_ELS_KS13_KS13_KSIZE_MASK) - -#define S50_ELS_KS13_KS13_KACT_MASK (0x20U) -#define S50_ELS_KS13_KS13_KACT_SHIFT (5U) -#define S50_ELS_KS13_KS13_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_KACT_SHIFT)) & S50_ELS_KS13_KS13_KACT_MASK) - -#define S50_ELS_KS13_KS13_KBASE_MASK (0x40U) -#define S50_ELS_KS13_KS13_KBASE_SHIFT (6U) -#define S50_ELS_KS13_KS13_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_KBASE_SHIFT)) & S50_ELS_KS13_KS13_KBASE_MASK) - -#define S50_ELS_KS13_KS13_FGP_MASK (0x80U) -#define S50_ELS_KS13_KS13_FGP_SHIFT (7U) -#define S50_ELS_KS13_KS13_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_FGP_SHIFT)) & S50_ELS_KS13_KS13_FGP_MASK) - -#define S50_ELS_KS13_KS13_FRTN_MASK (0x100U) -#define S50_ELS_KS13_KS13_FRTN_SHIFT (8U) -#define S50_ELS_KS13_KS13_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_FRTN_SHIFT)) & S50_ELS_KS13_KS13_FRTN_MASK) - -#define S50_ELS_KS13_KS13_FHWO_MASK (0x200U) -#define S50_ELS_KS13_KS13_FHWO_SHIFT (9U) -#define S50_ELS_KS13_KS13_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_FHWO_SHIFT)) & S50_ELS_KS13_KS13_FHWO_MASK) - -#define S50_ELS_KS13_KS13_UKPUK_MASK (0x800U) -#define S50_ELS_KS13_KS13_UKPUK_SHIFT (11U) -#define S50_ELS_KS13_KS13_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UKPUK_SHIFT)) & S50_ELS_KS13_KS13_UKPUK_MASK) - -#define S50_ELS_KS13_KS13_UTECDH_MASK (0x1000U) -#define S50_ELS_KS13_KS13_UTECDH_SHIFT (12U) -#define S50_ELS_KS13_KS13_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UTECDH_SHIFT)) & S50_ELS_KS13_KS13_UTECDH_MASK) - -#define S50_ELS_KS13_KS13_UCMAC_MASK (0x2000U) -#define S50_ELS_KS13_KS13_UCMAC_SHIFT (13U) -#define S50_ELS_KS13_KS13_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UCMAC_SHIFT)) & S50_ELS_KS13_KS13_UCMAC_MASK) - -#define S50_ELS_KS13_KS13_UKSK_MASK (0x4000U) -#define S50_ELS_KS13_KS13_UKSK_SHIFT (14U) -#define S50_ELS_KS13_KS13_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UKSK_SHIFT)) & S50_ELS_KS13_KS13_UKSK_MASK) - -#define S50_ELS_KS13_KS13_URTF_MASK (0x8000U) -#define S50_ELS_KS13_KS13_URTF_SHIFT (15U) -#define S50_ELS_KS13_KS13_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_URTF_SHIFT)) & S50_ELS_KS13_KS13_URTF_MASK) - -#define S50_ELS_KS13_KS13_UCKDF_MASK (0x10000U) -#define S50_ELS_KS13_KS13_UCKDF_SHIFT (16U) -#define S50_ELS_KS13_KS13_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UCKDF_SHIFT)) & S50_ELS_KS13_KS13_UCKDF_MASK) - -#define S50_ELS_KS13_KS13_UHKDF_MASK (0x20000U) -#define S50_ELS_KS13_KS13_UHKDF_SHIFT (17U) -#define S50_ELS_KS13_KS13_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UHKDF_SHIFT)) & S50_ELS_KS13_KS13_UHKDF_MASK) - -#define S50_ELS_KS13_KS13_UECSG_MASK (0x40000U) -#define S50_ELS_KS13_KS13_UECSG_SHIFT (18U) -#define S50_ELS_KS13_KS13_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UECSG_SHIFT)) & S50_ELS_KS13_KS13_UECSG_MASK) - -#define S50_ELS_KS13_KS13_UECDH_MASK (0x80000U) -#define S50_ELS_KS13_KS13_UECDH_SHIFT (19U) -#define S50_ELS_KS13_KS13_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UECDH_SHIFT)) & S50_ELS_KS13_KS13_UECDH_MASK) - -#define S50_ELS_KS13_KS13_UAES_MASK (0x100000U) -#define S50_ELS_KS13_KS13_UAES_SHIFT (20U) -#define S50_ELS_KS13_KS13_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UAES_SHIFT)) & S50_ELS_KS13_KS13_UAES_MASK) - -#define S50_ELS_KS13_KS13_UHMAC_MASK (0x200000U) -#define S50_ELS_KS13_KS13_UHMAC_SHIFT (21U) -#define S50_ELS_KS13_KS13_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UHMAC_SHIFT)) & S50_ELS_KS13_KS13_UHMAC_MASK) - -#define S50_ELS_KS13_KS13_UKWK_MASK (0x400000U) -#define S50_ELS_KS13_KS13_UKWK_SHIFT (22U) -#define S50_ELS_KS13_KS13_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UKWK_SHIFT)) & S50_ELS_KS13_KS13_UKWK_MASK) - -#define S50_ELS_KS13_KS13_UKUOK_MASK (0x800000U) -#define S50_ELS_KS13_KS13_UKUOK_SHIFT (23U) -#define S50_ELS_KS13_KS13_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UKUOK_SHIFT)) & S50_ELS_KS13_KS13_UKUOK_MASK) - -#define S50_ELS_KS13_KS13_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS13_KS13_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS13_KS13_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UTLSPMS_SHIFT)) & S50_ELS_KS13_KS13_UTLSPMS_MASK) - -#define S50_ELS_KS13_KS13_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS13_KS13_UTLSMS_SHIFT (25U) -#define S50_ELS_KS13_KS13_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UTLSMS_SHIFT)) & S50_ELS_KS13_KS13_UTLSMS_MASK) - -#define S50_ELS_KS13_KS13_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS13_KS13_UKGSRC_SHIFT (26U) -#define S50_ELS_KS13_KS13_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UKGSRC_SHIFT)) & S50_ELS_KS13_KS13_UKGSRC_MASK) - -#define S50_ELS_KS13_KS13_UHWO_MASK (0x8000000U) -#define S50_ELS_KS13_KS13_UHWO_SHIFT (27U) -#define S50_ELS_KS13_KS13_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UHWO_SHIFT)) & S50_ELS_KS13_KS13_UHWO_MASK) - -#define S50_ELS_KS13_KS13_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS13_KS13_UWRPOK_SHIFT (28U) -#define S50_ELS_KS13_KS13_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UWRPOK_SHIFT)) & S50_ELS_KS13_KS13_UWRPOK_MASK) - -#define S50_ELS_KS13_KS13_UDUK_MASK (0x20000000U) -#define S50_ELS_KS13_KS13_UDUK_SHIFT (29U) -#define S50_ELS_KS13_KS13_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UDUK_SHIFT)) & S50_ELS_KS13_KS13_UDUK_MASK) - -#define S50_ELS_KS13_KS13_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS13_KS13_UPPROT_SHIFT (30U) -#define S50_ELS_KS13_KS13_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UPPROT_SHIFT)) & S50_ELS_KS13_KS13_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS14 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS14_KS14_KSIZE_MASK (0x3U) -#define S50_ELS_KS14_KS14_KSIZE_SHIFT (0U) -/*! KS14_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS14_KS14_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_KSIZE_SHIFT)) & S50_ELS_KS14_KS14_KSIZE_MASK) - -#define S50_ELS_KS14_KS14_KACT_MASK (0x20U) -#define S50_ELS_KS14_KS14_KACT_SHIFT (5U) -#define S50_ELS_KS14_KS14_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_KACT_SHIFT)) & S50_ELS_KS14_KS14_KACT_MASK) - -#define S50_ELS_KS14_KS14_KBASE_MASK (0x40U) -#define S50_ELS_KS14_KS14_KBASE_SHIFT (6U) -#define S50_ELS_KS14_KS14_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_KBASE_SHIFT)) & S50_ELS_KS14_KS14_KBASE_MASK) - -#define S50_ELS_KS14_KS14_FGP_MASK (0x80U) -#define S50_ELS_KS14_KS14_FGP_SHIFT (7U) -#define S50_ELS_KS14_KS14_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_FGP_SHIFT)) & S50_ELS_KS14_KS14_FGP_MASK) - -#define S50_ELS_KS14_KS14_FRTN_MASK (0x100U) -#define S50_ELS_KS14_KS14_FRTN_SHIFT (8U) -#define S50_ELS_KS14_KS14_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_FRTN_SHIFT)) & S50_ELS_KS14_KS14_FRTN_MASK) - -#define S50_ELS_KS14_KS14_FHWO_MASK (0x200U) -#define S50_ELS_KS14_KS14_FHWO_SHIFT (9U) -#define S50_ELS_KS14_KS14_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_FHWO_SHIFT)) & S50_ELS_KS14_KS14_FHWO_MASK) - -#define S50_ELS_KS14_KS14_UKPUK_MASK (0x800U) -#define S50_ELS_KS14_KS14_UKPUK_SHIFT (11U) -#define S50_ELS_KS14_KS14_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UKPUK_SHIFT)) & S50_ELS_KS14_KS14_UKPUK_MASK) - -#define S50_ELS_KS14_KS14_UTECDH_MASK (0x1000U) -#define S50_ELS_KS14_KS14_UTECDH_SHIFT (12U) -#define S50_ELS_KS14_KS14_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UTECDH_SHIFT)) & S50_ELS_KS14_KS14_UTECDH_MASK) - -#define S50_ELS_KS14_KS14_UCMAC_MASK (0x2000U) -#define S50_ELS_KS14_KS14_UCMAC_SHIFT (13U) -#define S50_ELS_KS14_KS14_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UCMAC_SHIFT)) & S50_ELS_KS14_KS14_UCMAC_MASK) - -#define S50_ELS_KS14_KS14_UKSK_MASK (0x4000U) -#define S50_ELS_KS14_KS14_UKSK_SHIFT (14U) -#define S50_ELS_KS14_KS14_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UKSK_SHIFT)) & S50_ELS_KS14_KS14_UKSK_MASK) - -#define S50_ELS_KS14_KS14_URTF_MASK (0x8000U) -#define S50_ELS_KS14_KS14_URTF_SHIFT (15U) -#define S50_ELS_KS14_KS14_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_URTF_SHIFT)) & S50_ELS_KS14_KS14_URTF_MASK) - -#define S50_ELS_KS14_KS14_UCKDF_MASK (0x10000U) -#define S50_ELS_KS14_KS14_UCKDF_SHIFT (16U) -#define S50_ELS_KS14_KS14_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UCKDF_SHIFT)) & S50_ELS_KS14_KS14_UCKDF_MASK) - -#define S50_ELS_KS14_KS14_UHKDF_MASK (0x20000U) -#define S50_ELS_KS14_KS14_UHKDF_SHIFT (17U) -#define S50_ELS_KS14_KS14_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UHKDF_SHIFT)) & S50_ELS_KS14_KS14_UHKDF_MASK) - -#define S50_ELS_KS14_KS14_UECSG_MASK (0x40000U) -#define S50_ELS_KS14_KS14_UECSG_SHIFT (18U) -#define S50_ELS_KS14_KS14_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UECSG_SHIFT)) & S50_ELS_KS14_KS14_UECSG_MASK) - -#define S50_ELS_KS14_KS14_UECDH_MASK (0x80000U) -#define S50_ELS_KS14_KS14_UECDH_SHIFT (19U) -#define S50_ELS_KS14_KS14_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UECDH_SHIFT)) & S50_ELS_KS14_KS14_UECDH_MASK) - -#define S50_ELS_KS14_KS14_UAES_MASK (0x100000U) -#define S50_ELS_KS14_KS14_UAES_SHIFT (20U) -#define S50_ELS_KS14_KS14_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UAES_SHIFT)) & S50_ELS_KS14_KS14_UAES_MASK) - -#define S50_ELS_KS14_KS14_UHMAC_MASK (0x200000U) -#define S50_ELS_KS14_KS14_UHMAC_SHIFT (21U) -#define S50_ELS_KS14_KS14_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UHMAC_SHIFT)) & S50_ELS_KS14_KS14_UHMAC_MASK) - -#define S50_ELS_KS14_KS14_UKWK_MASK (0x400000U) -#define S50_ELS_KS14_KS14_UKWK_SHIFT (22U) -#define S50_ELS_KS14_KS14_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UKWK_SHIFT)) & S50_ELS_KS14_KS14_UKWK_MASK) - -#define S50_ELS_KS14_KS14_UKUOK_MASK (0x800000U) -#define S50_ELS_KS14_KS14_UKUOK_SHIFT (23U) -#define S50_ELS_KS14_KS14_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UKUOK_SHIFT)) & S50_ELS_KS14_KS14_UKUOK_MASK) - -#define S50_ELS_KS14_KS14_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS14_KS14_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS14_KS14_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UTLSPMS_SHIFT)) & S50_ELS_KS14_KS14_UTLSPMS_MASK) - -#define S50_ELS_KS14_KS14_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS14_KS14_UTLSMS_SHIFT (25U) -#define S50_ELS_KS14_KS14_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UTLSMS_SHIFT)) & S50_ELS_KS14_KS14_UTLSMS_MASK) - -#define S50_ELS_KS14_KS14_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS14_KS14_UKGSRC_SHIFT (26U) -#define S50_ELS_KS14_KS14_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UKGSRC_SHIFT)) & S50_ELS_KS14_KS14_UKGSRC_MASK) - -#define S50_ELS_KS14_KS14_UHWO_MASK (0x8000000U) -#define S50_ELS_KS14_KS14_UHWO_SHIFT (27U) -#define S50_ELS_KS14_KS14_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UHWO_SHIFT)) & S50_ELS_KS14_KS14_UHWO_MASK) - -#define S50_ELS_KS14_KS14_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS14_KS14_UWRPOK_SHIFT (28U) -#define S50_ELS_KS14_KS14_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UWRPOK_SHIFT)) & S50_ELS_KS14_KS14_UWRPOK_MASK) - -#define S50_ELS_KS14_KS14_UDUK_MASK (0x20000000U) -#define S50_ELS_KS14_KS14_UDUK_SHIFT (29U) -#define S50_ELS_KS14_KS14_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UDUK_SHIFT)) & S50_ELS_KS14_KS14_UDUK_MASK) - -#define S50_ELS_KS14_KS14_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS14_KS14_UPPROT_SHIFT (30U) -#define S50_ELS_KS14_KS14_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UPPROT_SHIFT)) & S50_ELS_KS14_KS14_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS15 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS15_KS15_KSIZE_MASK (0x3U) -#define S50_ELS_KS15_KS15_KSIZE_SHIFT (0U) -/*! KS15_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS15_KS15_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_KSIZE_SHIFT)) & S50_ELS_KS15_KS15_KSIZE_MASK) - -#define S50_ELS_KS15_KS15_KACT_MASK (0x20U) -#define S50_ELS_KS15_KS15_KACT_SHIFT (5U) -#define S50_ELS_KS15_KS15_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_KACT_SHIFT)) & S50_ELS_KS15_KS15_KACT_MASK) - -#define S50_ELS_KS15_KS15_KBASE_MASK (0x40U) -#define S50_ELS_KS15_KS15_KBASE_SHIFT (6U) -#define S50_ELS_KS15_KS15_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_KBASE_SHIFT)) & S50_ELS_KS15_KS15_KBASE_MASK) - -#define S50_ELS_KS15_KS15_FGP_MASK (0x80U) -#define S50_ELS_KS15_KS15_FGP_SHIFT (7U) -#define S50_ELS_KS15_KS15_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_FGP_SHIFT)) & S50_ELS_KS15_KS15_FGP_MASK) - -#define S50_ELS_KS15_KS15_FRTN_MASK (0x100U) -#define S50_ELS_KS15_KS15_FRTN_SHIFT (8U) -#define S50_ELS_KS15_KS15_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_FRTN_SHIFT)) & S50_ELS_KS15_KS15_FRTN_MASK) - -#define S50_ELS_KS15_KS15_FHWO_MASK (0x200U) -#define S50_ELS_KS15_KS15_FHWO_SHIFT (9U) -#define S50_ELS_KS15_KS15_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_FHWO_SHIFT)) & S50_ELS_KS15_KS15_FHWO_MASK) - -#define S50_ELS_KS15_KS15_UKPUK_MASK (0x800U) -#define S50_ELS_KS15_KS15_UKPUK_SHIFT (11U) -#define S50_ELS_KS15_KS15_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UKPUK_SHIFT)) & S50_ELS_KS15_KS15_UKPUK_MASK) - -#define S50_ELS_KS15_KS15_UTECDH_MASK (0x1000U) -#define S50_ELS_KS15_KS15_UTECDH_SHIFT (12U) -#define S50_ELS_KS15_KS15_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UTECDH_SHIFT)) & S50_ELS_KS15_KS15_UTECDH_MASK) - -#define S50_ELS_KS15_KS15_UCMAC_MASK (0x2000U) -#define S50_ELS_KS15_KS15_UCMAC_SHIFT (13U) -#define S50_ELS_KS15_KS15_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UCMAC_SHIFT)) & S50_ELS_KS15_KS15_UCMAC_MASK) - -#define S50_ELS_KS15_KS15_UKSK_MASK (0x4000U) -#define S50_ELS_KS15_KS15_UKSK_SHIFT (14U) -#define S50_ELS_KS15_KS15_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UKSK_SHIFT)) & S50_ELS_KS15_KS15_UKSK_MASK) - -#define S50_ELS_KS15_KS15_URTF_MASK (0x8000U) -#define S50_ELS_KS15_KS15_URTF_SHIFT (15U) -#define S50_ELS_KS15_KS15_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_URTF_SHIFT)) & S50_ELS_KS15_KS15_URTF_MASK) - -#define S50_ELS_KS15_KS15_UCKDF_MASK (0x10000U) -#define S50_ELS_KS15_KS15_UCKDF_SHIFT (16U) -#define S50_ELS_KS15_KS15_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UCKDF_SHIFT)) & S50_ELS_KS15_KS15_UCKDF_MASK) - -#define S50_ELS_KS15_KS15_UHKDF_MASK (0x20000U) -#define S50_ELS_KS15_KS15_UHKDF_SHIFT (17U) -#define S50_ELS_KS15_KS15_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UHKDF_SHIFT)) & S50_ELS_KS15_KS15_UHKDF_MASK) - -#define S50_ELS_KS15_KS15_UECSG_MASK (0x40000U) -#define S50_ELS_KS15_KS15_UECSG_SHIFT (18U) -#define S50_ELS_KS15_KS15_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UECSG_SHIFT)) & S50_ELS_KS15_KS15_UECSG_MASK) - -#define S50_ELS_KS15_KS15_UECDH_MASK (0x80000U) -#define S50_ELS_KS15_KS15_UECDH_SHIFT (19U) -#define S50_ELS_KS15_KS15_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UECDH_SHIFT)) & S50_ELS_KS15_KS15_UECDH_MASK) - -#define S50_ELS_KS15_KS15_UAES_MASK (0x100000U) -#define S50_ELS_KS15_KS15_UAES_SHIFT (20U) -#define S50_ELS_KS15_KS15_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UAES_SHIFT)) & S50_ELS_KS15_KS15_UAES_MASK) - -#define S50_ELS_KS15_KS15_UHMAC_MASK (0x200000U) -#define S50_ELS_KS15_KS15_UHMAC_SHIFT (21U) -#define S50_ELS_KS15_KS15_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UHMAC_SHIFT)) & S50_ELS_KS15_KS15_UHMAC_MASK) - -#define S50_ELS_KS15_KS15_UKWK_MASK (0x400000U) -#define S50_ELS_KS15_KS15_UKWK_SHIFT (22U) -#define S50_ELS_KS15_KS15_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UKWK_SHIFT)) & S50_ELS_KS15_KS15_UKWK_MASK) - -#define S50_ELS_KS15_KS15_UKUOK_MASK (0x800000U) -#define S50_ELS_KS15_KS15_UKUOK_SHIFT (23U) -#define S50_ELS_KS15_KS15_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UKUOK_SHIFT)) & S50_ELS_KS15_KS15_UKUOK_MASK) - -#define S50_ELS_KS15_KS15_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS15_KS15_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS15_KS15_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UTLSPMS_SHIFT)) & S50_ELS_KS15_KS15_UTLSPMS_MASK) - -#define S50_ELS_KS15_KS15_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS15_KS15_UTLSMS_SHIFT (25U) -#define S50_ELS_KS15_KS15_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UTLSMS_SHIFT)) & S50_ELS_KS15_KS15_UTLSMS_MASK) - -#define S50_ELS_KS15_KS15_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS15_KS15_UKGSRC_SHIFT (26U) -#define S50_ELS_KS15_KS15_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UKGSRC_SHIFT)) & S50_ELS_KS15_KS15_UKGSRC_MASK) - -#define S50_ELS_KS15_KS15_UHWO_MASK (0x8000000U) -#define S50_ELS_KS15_KS15_UHWO_SHIFT (27U) -#define S50_ELS_KS15_KS15_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UHWO_SHIFT)) & S50_ELS_KS15_KS15_UHWO_MASK) - -#define S50_ELS_KS15_KS15_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS15_KS15_UWRPOK_SHIFT (28U) -#define S50_ELS_KS15_KS15_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UWRPOK_SHIFT)) & S50_ELS_KS15_KS15_UWRPOK_MASK) - -#define S50_ELS_KS15_KS15_UDUK_MASK (0x20000000U) -#define S50_ELS_KS15_KS15_UDUK_SHIFT (29U) -#define S50_ELS_KS15_KS15_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UDUK_SHIFT)) & S50_ELS_KS15_KS15_UDUK_MASK) - -#define S50_ELS_KS15_KS15_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS15_KS15_UPPROT_SHIFT (30U) -#define S50_ELS_KS15_KS15_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UPPROT_SHIFT)) & S50_ELS_KS15_KS15_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS16 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS16_KS16_KSIZE_MASK (0x3U) -#define S50_ELS_KS16_KS16_KSIZE_SHIFT (0U) -/*! KS16_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS16_KS16_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_KSIZE_SHIFT)) & S50_ELS_KS16_KS16_KSIZE_MASK) - -#define S50_ELS_KS16_KS16_KACT_MASK (0x20U) -#define S50_ELS_KS16_KS16_KACT_SHIFT (5U) -#define S50_ELS_KS16_KS16_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_KACT_SHIFT)) & S50_ELS_KS16_KS16_KACT_MASK) - -#define S50_ELS_KS16_KS16_KBASE_MASK (0x40U) -#define S50_ELS_KS16_KS16_KBASE_SHIFT (6U) -#define S50_ELS_KS16_KS16_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_KBASE_SHIFT)) & S50_ELS_KS16_KS16_KBASE_MASK) - -#define S50_ELS_KS16_KS16_FGP_MASK (0x80U) -#define S50_ELS_KS16_KS16_FGP_SHIFT (7U) -#define S50_ELS_KS16_KS16_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_FGP_SHIFT)) & S50_ELS_KS16_KS16_FGP_MASK) - -#define S50_ELS_KS16_KS16_FRTN_MASK (0x100U) -#define S50_ELS_KS16_KS16_FRTN_SHIFT (8U) -#define S50_ELS_KS16_KS16_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_FRTN_SHIFT)) & S50_ELS_KS16_KS16_FRTN_MASK) - -#define S50_ELS_KS16_KS16_FHWO_MASK (0x200U) -#define S50_ELS_KS16_KS16_FHWO_SHIFT (9U) -#define S50_ELS_KS16_KS16_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_FHWO_SHIFT)) & S50_ELS_KS16_KS16_FHWO_MASK) - -#define S50_ELS_KS16_KS16_UKPUK_MASK (0x800U) -#define S50_ELS_KS16_KS16_UKPUK_SHIFT (11U) -#define S50_ELS_KS16_KS16_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UKPUK_SHIFT)) & S50_ELS_KS16_KS16_UKPUK_MASK) - -#define S50_ELS_KS16_KS16_UTECDH_MASK (0x1000U) -#define S50_ELS_KS16_KS16_UTECDH_SHIFT (12U) -#define S50_ELS_KS16_KS16_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UTECDH_SHIFT)) & S50_ELS_KS16_KS16_UTECDH_MASK) - -#define S50_ELS_KS16_KS16_UCMAC_MASK (0x2000U) -#define S50_ELS_KS16_KS16_UCMAC_SHIFT (13U) -#define S50_ELS_KS16_KS16_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UCMAC_SHIFT)) & S50_ELS_KS16_KS16_UCMAC_MASK) - -#define S50_ELS_KS16_KS16_UKSK_MASK (0x4000U) -#define S50_ELS_KS16_KS16_UKSK_SHIFT (14U) -#define S50_ELS_KS16_KS16_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UKSK_SHIFT)) & S50_ELS_KS16_KS16_UKSK_MASK) - -#define S50_ELS_KS16_KS16_URTF_MASK (0x8000U) -#define S50_ELS_KS16_KS16_URTF_SHIFT (15U) -#define S50_ELS_KS16_KS16_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_URTF_SHIFT)) & S50_ELS_KS16_KS16_URTF_MASK) - -#define S50_ELS_KS16_KS16_UCKDF_MASK (0x10000U) -#define S50_ELS_KS16_KS16_UCKDF_SHIFT (16U) -#define S50_ELS_KS16_KS16_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UCKDF_SHIFT)) & S50_ELS_KS16_KS16_UCKDF_MASK) - -#define S50_ELS_KS16_KS16_UHKDF_MASK (0x20000U) -#define S50_ELS_KS16_KS16_UHKDF_SHIFT (17U) -#define S50_ELS_KS16_KS16_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UHKDF_SHIFT)) & S50_ELS_KS16_KS16_UHKDF_MASK) - -#define S50_ELS_KS16_KS16_UECSG_MASK (0x40000U) -#define S50_ELS_KS16_KS16_UECSG_SHIFT (18U) -#define S50_ELS_KS16_KS16_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UECSG_SHIFT)) & S50_ELS_KS16_KS16_UECSG_MASK) - -#define S50_ELS_KS16_KS16_UECDH_MASK (0x80000U) -#define S50_ELS_KS16_KS16_UECDH_SHIFT (19U) -#define S50_ELS_KS16_KS16_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UECDH_SHIFT)) & S50_ELS_KS16_KS16_UECDH_MASK) - -#define S50_ELS_KS16_KS16_UAES_MASK (0x100000U) -#define S50_ELS_KS16_KS16_UAES_SHIFT (20U) -#define S50_ELS_KS16_KS16_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UAES_SHIFT)) & S50_ELS_KS16_KS16_UAES_MASK) - -#define S50_ELS_KS16_KS16_UHMAC_MASK (0x200000U) -#define S50_ELS_KS16_KS16_UHMAC_SHIFT (21U) -#define S50_ELS_KS16_KS16_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UHMAC_SHIFT)) & S50_ELS_KS16_KS16_UHMAC_MASK) - -#define S50_ELS_KS16_KS16_UKWK_MASK (0x400000U) -#define S50_ELS_KS16_KS16_UKWK_SHIFT (22U) -#define S50_ELS_KS16_KS16_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UKWK_SHIFT)) & S50_ELS_KS16_KS16_UKWK_MASK) - -#define S50_ELS_KS16_KS16_UKUOK_MASK (0x800000U) -#define S50_ELS_KS16_KS16_UKUOK_SHIFT (23U) -#define S50_ELS_KS16_KS16_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UKUOK_SHIFT)) & S50_ELS_KS16_KS16_UKUOK_MASK) - -#define S50_ELS_KS16_KS16_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS16_KS16_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS16_KS16_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UTLSPMS_SHIFT)) & S50_ELS_KS16_KS16_UTLSPMS_MASK) - -#define S50_ELS_KS16_KS16_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS16_KS16_UTLSMS_SHIFT (25U) -#define S50_ELS_KS16_KS16_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UTLSMS_SHIFT)) & S50_ELS_KS16_KS16_UTLSMS_MASK) - -#define S50_ELS_KS16_KS16_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS16_KS16_UKGSRC_SHIFT (26U) -#define S50_ELS_KS16_KS16_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UKGSRC_SHIFT)) & S50_ELS_KS16_KS16_UKGSRC_MASK) - -#define S50_ELS_KS16_KS16_UHWO_MASK (0x8000000U) -#define S50_ELS_KS16_KS16_UHWO_SHIFT (27U) -#define S50_ELS_KS16_KS16_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UHWO_SHIFT)) & S50_ELS_KS16_KS16_UHWO_MASK) - -#define S50_ELS_KS16_KS16_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS16_KS16_UWRPOK_SHIFT (28U) -#define S50_ELS_KS16_KS16_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UWRPOK_SHIFT)) & S50_ELS_KS16_KS16_UWRPOK_MASK) - -#define S50_ELS_KS16_KS16_UDUK_MASK (0x20000000U) -#define S50_ELS_KS16_KS16_UDUK_SHIFT (29U) -#define S50_ELS_KS16_KS16_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UDUK_SHIFT)) & S50_ELS_KS16_KS16_UDUK_MASK) - -#define S50_ELS_KS16_KS16_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS16_KS16_UPPROT_SHIFT (30U) -#define S50_ELS_KS16_KS16_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UPPROT_SHIFT)) & S50_ELS_KS16_KS16_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS17 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS17_KS17_KSIZE_MASK (0x3U) -#define S50_ELS_KS17_KS17_KSIZE_SHIFT (0U) -/*! KS17_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS17_KS17_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_KSIZE_SHIFT)) & S50_ELS_KS17_KS17_KSIZE_MASK) - -#define S50_ELS_KS17_KS17_KACT_MASK (0x20U) -#define S50_ELS_KS17_KS17_KACT_SHIFT (5U) -#define S50_ELS_KS17_KS17_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_KACT_SHIFT)) & S50_ELS_KS17_KS17_KACT_MASK) - -#define S50_ELS_KS17_KS17_KBASE_MASK (0x40U) -#define S50_ELS_KS17_KS17_KBASE_SHIFT (6U) -#define S50_ELS_KS17_KS17_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_KBASE_SHIFT)) & S50_ELS_KS17_KS17_KBASE_MASK) - -#define S50_ELS_KS17_KS17_FGP_MASK (0x80U) -#define S50_ELS_KS17_KS17_FGP_SHIFT (7U) -#define S50_ELS_KS17_KS17_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_FGP_SHIFT)) & S50_ELS_KS17_KS17_FGP_MASK) - -#define S50_ELS_KS17_KS17_FRTN_MASK (0x100U) -#define S50_ELS_KS17_KS17_FRTN_SHIFT (8U) -#define S50_ELS_KS17_KS17_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_FRTN_SHIFT)) & S50_ELS_KS17_KS17_FRTN_MASK) - -#define S50_ELS_KS17_KS17_FHWO_MASK (0x200U) -#define S50_ELS_KS17_KS17_FHWO_SHIFT (9U) -#define S50_ELS_KS17_KS17_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_FHWO_SHIFT)) & S50_ELS_KS17_KS17_FHWO_MASK) - -#define S50_ELS_KS17_KS17_UKPUK_MASK (0x800U) -#define S50_ELS_KS17_KS17_UKPUK_SHIFT (11U) -#define S50_ELS_KS17_KS17_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UKPUK_SHIFT)) & S50_ELS_KS17_KS17_UKPUK_MASK) - -#define S50_ELS_KS17_KS17_UTECDH_MASK (0x1000U) -#define S50_ELS_KS17_KS17_UTECDH_SHIFT (12U) -#define S50_ELS_KS17_KS17_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UTECDH_SHIFT)) & S50_ELS_KS17_KS17_UTECDH_MASK) - -#define S50_ELS_KS17_KS17_UCMAC_MASK (0x2000U) -#define S50_ELS_KS17_KS17_UCMAC_SHIFT (13U) -#define S50_ELS_KS17_KS17_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UCMAC_SHIFT)) & S50_ELS_KS17_KS17_UCMAC_MASK) - -#define S50_ELS_KS17_KS17_UKSK_MASK (0x4000U) -#define S50_ELS_KS17_KS17_UKSK_SHIFT (14U) -#define S50_ELS_KS17_KS17_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UKSK_SHIFT)) & S50_ELS_KS17_KS17_UKSK_MASK) - -#define S50_ELS_KS17_KS17_URTF_MASK (0x8000U) -#define S50_ELS_KS17_KS17_URTF_SHIFT (15U) -#define S50_ELS_KS17_KS17_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_URTF_SHIFT)) & S50_ELS_KS17_KS17_URTF_MASK) - -#define S50_ELS_KS17_KS17_UCKDF_MASK (0x10000U) -#define S50_ELS_KS17_KS17_UCKDF_SHIFT (16U) -#define S50_ELS_KS17_KS17_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UCKDF_SHIFT)) & S50_ELS_KS17_KS17_UCKDF_MASK) - -#define S50_ELS_KS17_KS17_UHKDF_MASK (0x20000U) -#define S50_ELS_KS17_KS17_UHKDF_SHIFT (17U) -#define S50_ELS_KS17_KS17_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UHKDF_SHIFT)) & S50_ELS_KS17_KS17_UHKDF_MASK) - -#define S50_ELS_KS17_KS17_UECSG_MASK (0x40000U) -#define S50_ELS_KS17_KS17_UECSG_SHIFT (18U) -#define S50_ELS_KS17_KS17_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UECSG_SHIFT)) & S50_ELS_KS17_KS17_UECSG_MASK) - -#define S50_ELS_KS17_KS17_UECDH_MASK (0x80000U) -#define S50_ELS_KS17_KS17_UECDH_SHIFT (19U) -#define S50_ELS_KS17_KS17_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UECDH_SHIFT)) & S50_ELS_KS17_KS17_UECDH_MASK) - -#define S50_ELS_KS17_KS17_UAES_MASK (0x100000U) -#define S50_ELS_KS17_KS17_UAES_SHIFT (20U) -#define S50_ELS_KS17_KS17_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UAES_SHIFT)) & S50_ELS_KS17_KS17_UAES_MASK) - -#define S50_ELS_KS17_KS17_UHMAC_MASK (0x200000U) -#define S50_ELS_KS17_KS17_UHMAC_SHIFT (21U) -#define S50_ELS_KS17_KS17_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UHMAC_SHIFT)) & S50_ELS_KS17_KS17_UHMAC_MASK) - -#define S50_ELS_KS17_KS17_UKWK_MASK (0x400000U) -#define S50_ELS_KS17_KS17_UKWK_SHIFT (22U) -#define S50_ELS_KS17_KS17_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UKWK_SHIFT)) & S50_ELS_KS17_KS17_UKWK_MASK) - -#define S50_ELS_KS17_KS17_UKUOK_MASK (0x800000U) -#define S50_ELS_KS17_KS17_UKUOK_SHIFT (23U) -#define S50_ELS_KS17_KS17_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UKUOK_SHIFT)) & S50_ELS_KS17_KS17_UKUOK_MASK) - -#define S50_ELS_KS17_KS17_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS17_KS17_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS17_KS17_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UTLSPMS_SHIFT)) & S50_ELS_KS17_KS17_UTLSPMS_MASK) - -#define S50_ELS_KS17_KS17_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS17_KS17_UTLSMS_SHIFT (25U) -#define S50_ELS_KS17_KS17_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UTLSMS_SHIFT)) & S50_ELS_KS17_KS17_UTLSMS_MASK) - -#define S50_ELS_KS17_KS17_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS17_KS17_UKGSRC_SHIFT (26U) -#define S50_ELS_KS17_KS17_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UKGSRC_SHIFT)) & S50_ELS_KS17_KS17_UKGSRC_MASK) - -#define S50_ELS_KS17_KS17_UHWO_MASK (0x8000000U) -#define S50_ELS_KS17_KS17_UHWO_SHIFT (27U) -#define S50_ELS_KS17_KS17_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UHWO_SHIFT)) & S50_ELS_KS17_KS17_UHWO_MASK) - -#define S50_ELS_KS17_KS17_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS17_KS17_UWRPOK_SHIFT (28U) -#define S50_ELS_KS17_KS17_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UWRPOK_SHIFT)) & S50_ELS_KS17_KS17_UWRPOK_MASK) - -#define S50_ELS_KS17_KS17_UDUK_MASK (0x20000000U) -#define S50_ELS_KS17_KS17_UDUK_SHIFT (29U) -#define S50_ELS_KS17_KS17_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UDUK_SHIFT)) & S50_ELS_KS17_KS17_UDUK_MASK) - -#define S50_ELS_KS17_KS17_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS17_KS17_UPPROT_SHIFT (30U) -#define S50_ELS_KS17_KS17_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UPPROT_SHIFT)) & S50_ELS_KS17_KS17_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS18 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS18_KS18_KSIZE_MASK (0x3U) -#define S50_ELS_KS18_KS18_KSIZE_SHIFT (0U) -/*! KS18_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS18_KS18_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_KSIZE_SHIFT)) & S50_ELS_KS18_KS18_KSIZE_MASK) - -#define S50_ELS_KS18_KS18_KACT_MASK (0x20U) -#define S50_ELS_KS18_KS18_KACT_SHIFT (5U) -#define S50_ELS_KS18_KS18_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_KACT_SHIFT)) & S50_ELS_KS18_KS18_KACT_MASK) - -#define S50_ELS_KS18_KS18_KBASE_MASK (0x40U) -#define S50_ELS_KS18_KS18_KBASE_SHIFT (6U) -#define S50_ELS_KS18_KS18_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_KBASE_SHIFT)) & S50_ELS_KS18_KS18_KBASE_MASK) - -#define S50_ELS_KS18_KS18_FGP_MASK (0x80U) -#define S50_ELS_KS18_KS18_FGP_SHIFT (7U) -#define S50_ELS_KS18_KS18_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_FGP_SHIFT)) & S50_ELS_KS18_KS18_FGP_MASK) - -#define S50_ELS_KS18_KS18_FRTN_MASK (0x100U) -#define S50_ELS_KS18_KS18_FRTN_SHIFT (8U) -#define S50_ELS_KS18_KS18_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_FRTN_SHIFT)) & S50_ELS_KS18_KS18_FRTN_MASK) - -#define S50_ELS_KS18_KS18_FHWO_MASK (0x200U) -#define S50_ELS_KS18_KS18_FHWO_SHIFT (9U) -#define S50_ELS_KS18_KS18_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_FHWO_SHIFT)) & S50_ELS_KS18_KS18_FHWO_MASK) - -#define S50_ELS_KS18_KS18_UKPUK_MASK (0x800U) -#define S50_ELS_KS18_KS18_UKPUK_SHIFT (11U) -#define S50_ELS_KS18_KS18_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UKPUK_SHIFT)) & S50_ELS_KS18_KS18_UKPUK_MASK) - -#define S50_ELS_KS18_KS18_UTECDH_MASK (0x1000U) -#define S50_ELS_KS18_KS18_UTECDH_SHIFT (12U) -#define S50_ELS_KS18_KS18_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UTECDH_SHIFT)) & S50_ELS_KS18_KS18_UTECDH_MASK) - -#define S50_ELS_KS18_KS18_UCMAC_MASK (0x2000U) -#define S50_ELS_KS18_KS18_UCMAC_SHIFT (13U) -#define S50_ELS_KS18_KS18_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UCMAC_SHIFT)) & S50_ELS_KS18_KS18_UCMAC_MASK) - -#define S50_ELS_KS18_KS18_UKSK_MASK (0x4000U) -#define S50_ELS_KS18_KS18_UKSK_SHIFT (14U) -#define S50_ELS_KS18_KS18_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UKSK_SHIFT)) & S50_ELS_KS18_KS18_UKSK_MASK) - -#define S50_ELS_KS18_KS18_URTF_MASK (0x8000U) -#define S50_ELS_KS18_KS18_URTF_SHIFT (15U) -#define S50_ELS_KS18_KS18_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_URTF_SHIFT)) & S50_ELS_KS18_KS18_URTF_MASK) - -#define S50_ELS_KS18_KS18_UCKDF_MASK (0x10000U) -#define S50_ELS_KS18_KS18_UCKDF_SHIFT (16U) -#define S50_ELS_KS18_KS18_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UCKDF_SHIFT)) & S50_ELS_KS18_KS18_UCKDF_MASK) - -#define S50_ELS_KS18_KS18_UHKDF_MASK (0x20000U) -#define S50_ELS_KS18_KS18_UHKDF_SHIFT (17U) -#define S50_ELS_KS18_KS18_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UHKDF_SHIFT)) & S50_ELS_KS18_KS18_UHKDF_MASK) - -#define S50_ELS_KS18_KS18_UECSG_MASK (0x40000U) -#define S50_ELS_KS18_KS18_UECSG_SHIFT (18U) -#define S50_ELS_KS18_KS18_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UECSG_SHIFT)) & S50_ELS_KS18_KS18_UECSG_MASK) - -#define S50_ELS_KS18_KS18_UECDH_MASK (0x80000U) -#define S50_ELS_KS18_KS18_UECDH_SHIFT (19U) -#define S50_ELS_KS18_KS18_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UECDH_SHIFT)) & S50_ELS_KS18_KS18_UECDH_MASK) - -#define S50_ELS_KS18_KS18_UAES_MASK (0x100000U) -#define S50_ELS_KS18_KS18_UAES_SHIFT (20U) -#define S50_ELS_KS18_KS18_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UAES_SHIFT)) & S50_ELS_KS18_KS18_UAES_MASK) - -#define S50_ELS_KS18_KS18_UHMAC_MASK (0x200000U) -#define S50_ELS_KS18_KS18_UHMAC_SHIFT (21U) -#define S50_ELS_KS18_KS18_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UHMAC_SHIFT)) & S50_ELS_KS18_KS18_UHMAC_MASK) - -#define S50_ELS_KS18_KS18_UKWK_MASK (0x400000U) -#define S50_ELS_KS18_KS18_UKWK_SHIFT (22U) -#define S50_ELS_KS18_KS18_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UKWK_SHIFT)) & S50_ELS_KS18_KS18_UKWK_MASK) - -#define S50_ELS_KS18_KS18_UKUOK_MASK (0x800000U) -#define S50_ELS_KS18_KS18_UKUOK_SHIFT (23U) -#define S50_ELS_KS18_KS18_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UKUOK_SHIFT)) & S50_ELS_KS18_KS18_UKUOK_MASK) - -#define S50_ELS_KS18_KS18_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS18_KS18_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS18_KS18_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UTLSPMS_SHIFT)) & S50_ELS_KS18_KS18_UTLSPMS_MASK) - -#define S50_ELS_KS18_KS18_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS18_KS18_UTLSMS_SHIFT (25U) -#define S50_ELS_KS18_KS18_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UTLSMS_SHIFT)) & S50_ELS_KS18_KS18_UTLSMS_MASK) - -#define S50_ELS_KS18_KS18_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS18_KS18_UKGSRC_SHIFT (26U) -#define S50_ELS_KS18_KS18_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UKGSRC_SHIFT)) & S50_ELS_KS18_KS18_UKGSRC_MASK) - -#define S50_ELS_KS18_KS18_UHWO_MASK (0x8000000U) -#define S50_ELS_KS18_KS18_UHWO_SHIFT (27U) -#define S50_ELS_KS18_KS18_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UHWO_SHIFT)) & S50_ELS_KS18_KS18_UHWO_MASK) - -#define S50_ELS_KS18_KS18_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS18_KS18_UWRPOK_SHIFT (28U) -#define S50_ELS_KS18_KS18_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UWRPOK_SHIFT)) & S50_ELS_KS18_KS18_UWRPOK_MASK) - -#define S50_ELS_KS18_KS18_UDUK_MASK (0x20000000U) -#define S50_ELS_KS18_KS18_UDUK_SHIFT (29U) -#define S50_ELS_KS18_KS18_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UDUK_SHIFT)) & S50_ELS_KS18_KS18_UDUK_MASK) - -#define S50_ELS_KS18_KS18_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS18_KS18_UPPROT_SHIFT (30U) -#define S50_ELS_KS18_KS18_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UPPROT_SHIFT)) & S50_ELS_KS18_KS18_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS19 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS19_KS19_KSIZE_MASK (0x3U) -#define S50_ELS_KS19_KS19_KSIZE_SHIFT (0U) -/*! KS19_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS19_KS19_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_KSIZE_SHIFT)) & S50_ELS_KS19_KS19_KSIZE_MASK) - -#define S50_ELS_KS19_KS19_KACT_MASK (0x20U) -#define S50_ELS_KS19_KS19_KACT_SHIFT (5U) -#define S50_ELS_KS19_KS19_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_KACT_SHIFT)) & S50_ELS_KS19_KS19_KACT_MASK) - -#define S50_ELS_KS19_KS19_KBASE_MASK (0x40U) -#define S50_ELS_KS19_KS19_KBASE_SHIFT (6U) -#define S50_ELS_KS19_KS19_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_KBASE_SHIFT)) & S50_ELS_KS19_KS19_KBASE_MASK) - -#define S50_ELS_KS19_KS19_FGP_MASK (0x80U) -#define S50_ELS_KS19_KS19_FGP_SHIFT (7U) -#define S50_ELS_KS19_KS19_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_FGP_SHIFT)) & S50_ELS_KS19_KS19_FGP_MASK) - -#define S50_ELS_KS19_KS19_FRTN_MASK (0x100U) -#define S50_ELS_KS19_KS19_FRTN_SHIFT (8U) -#define S50_ELS_KS19_KS19_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_FRTN_SHIFT)) & S50_ELS_KS19_KS19_FRTN_MASK) - -#define S50_ELS_KS19_KS19_FHWO_MASK (0x200U) -#define S50_ELS_KS19_KS19_FHWO_SHIFT (9U) -#define S50_ELS_KS19_KS19_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_FHWO_SHIFT)) & S50_ELS_KS19_KS19_FHWO_MASK) - -#define S50_ELS_KS19_KS19_UKPUK_MASK (0x800U) -#define S50_ELS_KS19_KS19_UKPUK_SHIFT (11U) -#define S50_ELS_KS19_KS19_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UKPUK_SHIFT)) & S50_ELS_KS19_KS19_UKPUK_MASK) - -#define S50_ELS_KS19_KS19_UTECDH_MASK (0x1000U) -#define S50_ELS_KS19_KS19_UTECDH_SHIFT (12U) -#define S50_ELS_KS19_KS19_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UTECDH_SHIFT)) & S50_ELS_KS19_KS19_UTECDH_MASK) - -#define S50_ELS_KS19_KS19_UCMAC_MASK (0x2000U) -#define S50_ELS_KS19_KS19_UCMAC_SHIFT (13U) -#define S50_ELS_KS19_KS19_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UCMAC_SHIFT)) & S50_ELS_KS19_KS19_UCMAC_MASK) - -#define S50_ELS_KS19_KS19_UKSK_MASK (0x4000U) -#define S50_ELS_KS19_KS19_UKSK_SHIFT (14U) -#define S50_ELS_KS19_KS19_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UKSK_SHIFT)) & S50_ELS_KS19_KS19_UKSK_MASK) - -#define S50_ELS_KS19_KS19_URTF_MASK (0x8000U) -#define S50_ELS_KS19_KS19_URTF_SHIFT (15U) -#define S50_ELS_KS19_KS19_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_URTF_SHIFT)) & S50_ELS_KS19_KS19_URTF_MASK) - -#define S50_ELS_KS19_KS19_UCKDF_MASK (0x10000U) -#define S50_ELS_KS19_KS19_UCKDF_SHIFT (16U) -#define S50_ELS_KS19_KS19_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UCKDF_SHIFT)) & S50_ELS_KS19_KS19_UCKDF_MASK) - -#define S50_ELS_KS19_KS19_UHKDF_MASK (0x20000U) -#define S50_ELS_KS19_KS19_UHKDF_SHIFT (17U) -#define S50_ELS_KS19_KS19_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UHKDF_SHIFT)) & S50_ELS_KS19_KS19_UHKDF_MASK) - -#define S50_ELS_KS19_KS19_UECSG_MASK (0x40000U) -#define S50_ELS_KS19_KS19_UECSG_SHIFT (18U) -#define S50_ELS_KS19_KS19_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UECSG_SHIFT)) & S50_ELS_KS19_KS19_UECSG_MASK) - -#define S50_ELS_KS19_KS19_UECDH_MASK (0x80000U) -#define S50_ELS_KS19_KS19_UECDH_SHIFT (19U) -#define S50_ELS_KS19_KS19_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UECDH_SHIFT)) & S50_ELS_KS19_KS19_UECDH_MASK) - -#define S50_ELS_KS19_KS19_UAES_MASK (0x100000U) -#define S50_ELS_KS19_KS19_UAES_SHIFT (20U) -#define S50_ELS_KS19_KS19_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UAES_SHIFT)) & S50_ELS_KS19_KS19_UAES_MASK) - -#define S50_ELS_KS19_KS19_UHMAC_MASK (0x200000U) -#define S50_ELS_KS19_KS19_UHMAC_SHIFT (21U) -#define S50_ELS_KS19_KS19_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UHMAC_SHIFT)) & S50_ELS_KS19_KS19_UHMAC_MASK) - -#define S50_ELS_KS19_KS19_UKWK_MASK (0x400000U) -#define S50_ELS_KS19_KS19_UKWK_SHIFT (22U) -#define S50_ELS_KS19_KS19_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UKWK_SHIFT)) & S50_ELS_KS19_KS19_UKWK_MASK) - -#define S50_ELS_KS19_KS19_UKUOK_MASK (0x800000U) -#define S50_ELS_KS19_KS19_UKUOK_SHIFT (23U) -#define S50_ELS_KS19_KS19_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UKUOK_SHIFT)) & S50_ELS_KS19_KS19_UKUOK_MASK) - -#define S50_ELS_KS19_KS19_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS19_KS19_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS19_KS19_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UTLSPMS_SHIFT)) & S50_ELS_KS19_KS19_UTLSPMS_MASK) - -#define S50_ELS_KS19_KS19_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS19_KS19_UTLSMS_SHIFT (25U) -#define S50_ELS_KS19_KS19_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UTLSMS_SHIFT)) & S50_ELS_KS19_KS19_UTLSMS_MASK) - -#define S50_ELS_KS19_KS19_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS19_KS19_UKGSRC_SHIFT (26U) -#define S50_ELS_KS19_KS19_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UKGSRC_SHIFT)) & S50_ELS_KS19_KS19_UKGSRC_MASK) - -#define S50_ELS_KS19_KS19_UHWO_MASK (0x8000000U) -#define S50_ELS_KS19_KS19_UHWO_SHIFT (27U) -#define S50_ELS_KS19_KS19_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UHWO_SHIFT)) & S50_ELS_KS19_KS19_UHWO_MASK) - -#define S50_ELS_KS19_KS19_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS19_KS19_UWRPOK_SHIFT (28U) -#define S50_ELS_KS19_KS19_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UWRPOK_SHIFT)) & S50_ELS_KS19_KS19_UWRPOK_MASK) - -#define S50_ELS_KS19_KS19_UDUK_MASK (0x20000000U) -#define S50_ELS_KS19_KS19_UDUK_SHIFT (29U) -#define S50_ELS_KS19_KS19_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UDUK_SHIFT)) & S50_ELS_KS19_KS19_UDUK_MASK) - -#define S50_ELS_KS19_KS19_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS19_KS19_UPPROT_SHIFT (30U) -#define S50_ELS_KS19_KS19_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UPPROT_SHIFT)) & S50_ELS_KS19_KS19_UPPROT_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group S50_Register_Masks */ - - -/* S50 - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral ELS base address */ - #define ELS_BASE (0x50054000u) - /** Peripheral ELS base address */ - #define ELS_BASE_NS (0x40054000u) - /** Peripheral ELS base pointer */ - #define ELS ((S50_Type *)ELS_BASE) - /** Peripheral ELS base pointer */ - #define ELS_NS ((S50_Type *)ELS_BASE_NS) - /** Peripheral ELS_ALIAS1 base address */ - #define ELS_ALIAS1_BASE (0x50055000u) - /** Peripheral ELS_ALIAS1 base address */ - #define ELS_ALIAS1_BASE_NS (0x40055000u) - /** Peripheral ELS_ALIAS1 base pointer */ - #define ELS_ALIAS1 ((S50_Type *)ELS_ALIAS1_BASE) - /** Peripheral ELS_ALIAS1 base pointer */ - #define ELS_ALIAS1_NS ((S50_Type *)ELS_ALIAS1_BASE_NS) - /** Peripheral ELS_ALIAS2 base address */ - #define ELS_ALIAS2_BASE (0x50056000u) - /** Peripheral ELS_ALIAS2 base address */ - #define ELS_ALIAS2_BASE_NS (0x40056000u) - /** Peripheral ELS_ALIAS2 base pointer */ - #define ELS_ALIAS2 ((S50_Type *)ELS_ALIAS2_BASE) - /** Peripheral ELS_ALIAS2 base pointer */ - #define ELS_ALIAS2_NS ((S50_Type *)ELS_ALIAS2_BASE_NS) - /** Peripheral ELS_ALIAS3 base address */ - #define ELS_ALIAS3_BASE (0x50057000u) - /** Peripheral ELS_ALIAS3 base address */ - #define ELS_ALIAS3_BASE_NS (0x40057000u) - /** Peripheral ELS_ALIAS3 base pointer */ - #define ELS_ALIAS3 ((S50_Type *)ELS_ALIAS3_BASE) - /** Peripheral ELS_ALIAS3 base pointer */ - #define ELS_ALIAS3_NS ((S50_Type *)ELS_ALIAS3_BASE_NS) - /** Array initializer of S50 peripheral base addresses */ - #define S50_BASE_ADDRS { ELS_BASE, ELS_ALIAS1_BASE, ELS_ALIAS2_BASE, ELS_ALIAS3_BASE } - /** Array initializer of S50 peripheral base pointers */ - #define S50_BASE_PTRS { ELS, ELS_ALIAS1, ELS_ALIAS2, ELS_ALIAS3 } - /** Array initializer of S50 peripheral base addresses */ - #define S50_BASE_ADDRS_NS { ELS_BASE_NS, ELS_ALIAS1_BASE_NS, ELS_ALIAS2_BASE_NS, ELS_ALIAS3_BASE_NS } - /** Array initializer of S50 peripheral base pointers */ - #define S50_BASE_PTRS_NS { ELS_NS, ELS_ALIAS1_NS, ELS_ALIAS2_NS, ELS_ALIAS3_NS } -#else - /** Peripheral ELS base address */ - #define ELS_BASE (0x40054000u) - /** Peripheral ELS base pointer */ - #define ELS ((S50_Type *)ELS_BASE) - /** Peripheral ELS_ALIAS1 base address */ - #define ELS_ALIAS1_BASE (0x40055000u) - /** Peripheral ELS_ALIAS1 base pointer */ - #define ELS_ALIAS1 ((S50_Type *)ELS_ALIAS1_BASE) - /** Peripheral ELS_ALIAS2 base address */ - #define ELS_ALIAS2_BASE (0x40056000u) - /** Peripheral ELS_ALIAS2 base pointer */ - #define ELS_ALIAS2 ((S50_Type *)ELS_ALIAS2_BASE) - /** Peripheral ELS_ALIAS3 base address */ - #define ELS_ALIAS3_BASE (0x40057000u) - /** Peripheral ELS_ALIAS3 base pointer */ - #define ELS_ALIAS3 ((S50_Type *)ELS_ALIAS3_BASE) - /** Array initializer of S50 peripheral base addresses */ - #define S50_BASE_ADDRS { ELS_BASE, ELS_ALIAS1_BASE, ELS_ALIAS2_BASE, ELS_ALIAS3_BASE } - /** Array initializer of S50 peripheral base pointers */ - #define S50_BASE_PTRS { ELS, ELS_ALIAS1, ELS_ALIAS2, ELS_ALIAS3 } -#endif - -/*! - * @} - */ /* end of group S50_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- SCG Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SCG_Peripheral_Access_Layer SCG Peripheral Access Layer - * @{ - */ - -/** SCG - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID Register, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter Register, offset: 0x4 */ - __IO uint32_t TRIM_LOCK; /**< Trim Lock register, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __I uint32_t CSR; /**< Clock Status Register, offset: 0x10 */ - __IO uint32_t RCCR; /**< Run Clock Control Register, offset: 0x14 */ - uint8_t RESERVED_1[232]; - __IO uint32_t SOSCCSR; /**< SOSC Control Status Register, offset: 0x100 */ - uint8_t RESERVED_2[4]; - __IO uint32_t SOSCCFG; /**< SOSC Configuration Register, offset: 0x108 */ - uint8_t RESERVED_3[244]; - __IO uint32_t SIRCCSR; /**< SIRC Control Status Register, offset: 0x200 */ - uint8_t RESERVED_4[8]; - __IO uint32_t SIRCTCFG; /**< SIRC Trim Configuration Register, offset: 0x20C */ - __IO uint32_t SIRCTRIM; /**< SIRC Trim Register, offset: 0x210 */ - uint8_t RESERVED_5[4]; - __IO uint32_t SIRCSTAT; /**< SIRC Auto-trimming Status Register, offset: 0x218 */ - uint8_t RESERVED_6[228]; - __IO uint32_t FIRCCSR; /**< FIRC Control Status Register, offset: 0x300 */ - uint8_t RESERVED_7[4]; - __IO uint32_t FIRCCFG; /**< FIRC Configuration Register, offset: 0x308 */ - __IO uint32_t FIRCTCFG; /**< FIRC Trim Configuration Register, offset: 0x30C */ - __IO uint32_t FIRCTRIM; /**< FIRC Trim Register, offset: 0x310 */ - uint8_t RESERVED_8[4]; - __IO uint32_t FIRCSTAT; /**< FIRC Auto-trimming Status Register, offset: 0x318 */ - uint8_t RESERVED_9[228]; - __IO uint32_t ROSCCSR; /**< ROSC Control Status Register, offset: 0x400 */ - uint8_t RESERVED_10[252]; - __IO uint32_t APLLCSR; /**< APLL Control Status Register, offset: 0x500 */ - __IO uint32_t APLLCTRL; /**< APLL Control Register, offset: 0x504 */ - __I uint32_t APLLSTAT; /**< APLL Status Register, offset: 0x508 */ - __IO uint32_t APLLNDIV; /**< APLL N Divider Register, offset: 0x50C */ - __IO uint32_t APLLMDIV; /**< APLL M Divider Register, offset: 0x510 */ - __IO uint32_t APLLPDIV; /**< APLL P Divider Register, offset: 0x514 */ - __IO uint32_t APLLLOCK_CNFG; /**< APLL LOCK Configuration Register, offset: 0x518 */ - uint8_t RESERVED_11[4]; - __I uint32_t APLLSSCGSTAT; /**< APLL SSCG Status Register, offset: 0x520 */ - __IO uint32_t APLLSSCG0; /**< APLL Spread Spectrum Control 0 Register, offset: 0x524 */ - __IO uint32_t APLLSSCG1; /**< APLL Spread Spectrum Control 1 Register, offset: 0x528 */ - uint8_t RESERVED_12[200]; - __IO uint32_t APLL_OVRD; /**< APLL Override Register, offset: 0x5F4 */ - uint8_t RESERVED_13[8]; - __IO uint32_t SPLLCSR; /**< SPLL Control Status Register, offset: 0x600 */ - __IO uint32_t SPLLCTRL; /**< SPLL Control Register, offset: 0x604 */ - __I uint32_t SPLLSTAT; /**< SPLL Status Register, offset: 0x608 */ - __IO uint32_t SPLLNDIV; /**< SPLL N Divider Register, offset: 0x60C */ - __IO uint32_t SPLLMDIV; /**< SPLL M Divider Register, offset: 0x610 */ - __IO uint32_t SPLLPDIV; /**< SPLL P Divider Register, offset: 0x614 */ - __IO uint32_t SPLLLOCK_CNFG; /**< SPLL LOCK Configuration Register, offset: 0x618 */ - uint8_t RESERVED_14[4]; - __I uint32_t SPLLSSCGSTAT; /**< SPLL SSCG Status Register, offset: 0x620 */ - __IO uint32_t SPLLSSCG0; /**< SPLL Spread Spectrum Control 0 Register, offset: 0x624 */ - __IO uint32_t SPLLSSCG1; /**< SPLL Spread Spectrum Control 1 Register, offset: 0x628 */ - uint8_t RESERVED_15[200]; - __IO uint32_t SPLL_OVRD; /**< SPLL Override Register, offset: 0x6F4 */ - uint8_t RESERVED_16[8]; - __IO uint32_t UPLLCSR; /**< UPLL Control Status Register, offset: 0x700 */ - uint8_t RESERVED_17[252]; - __IO uint32_t LDOCSR; /**< LDO Control and Status Register, offset: 0x800 */ - uint8_t RESERVED_18[252]; - __IO uint32_t TROCSR; /**< TRO Control Status Register, offset: 0x900 */ -} SCG_Type; - -/* ---------------------------------------------------------------------------- - -- SCG Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SCG_Register_Masks SCG Register Masks - * @{ - */ - -/*! @name VERID - Version ID Register */ -/*! @{ */ - -#define SCG_VERID_VERSION_MASK (0xFFFFFFFFU) -#define SCG_VERID_VERSION_SHIFT (0U) -/*! VERSION - SCG Version Number */ -#define SCG_VERID_VERSION(x) (((uint32_t)(((uint32_t)(x)) << SCG_VERID_VERSION_SHIFT)) & SCG_VERID_VERSION_MASK) -/*! @} */ - -/*! @name PARAM - Parameter Register */ -/*! @{ */ - -#define SCG_PARAM_SOSCCLKPRES_MASK (0x2U) -#define SCG_PARAM_SOSCCLKPRES_SHIFT (1U) -/*! SOSCCLKPRES - SOSC Clock Present - * 0b1..SOSC clock source is present - * 0b0..SOSC clock source is not present - */ -#define SCG_PARAM_SOSCCLKPRES(x) (((uint32_t)(((uint32_t)(x)) << SCG_PARAM_SOSCCLKPRES_SHIFT)) & SCG_PARAM_SOSCCLKPRES_MASK) - -#define SCG_PARAM_SIRCCLKPRES_MASK (0x4U) -#define SCG_PARAM_SIRCCLKPRES_SHIFT (2U) -/*! SIRCCLKPRES - SIRC Clock Present - * 0b1..SIRC clock source is present - * 0b0..SIRC clock source is not present - */ -#define SCG_PARAM_SIRCCLKPRES(x) (((uint32_t)(((uint32_t)(x)) << SCG_PARAM_SIRCCLKPRES_SHIFT)) & SCG_PARAM_SIRCCLKPRES_MASK) - -#define SCG_PARAM_FIRCCLKPRES_MASK (0x8U) -#define SCG_PARAM_FIRCCLKPRES_SHIFT (3U) -/*! FIRCCLKPRES - FIRC Clock Present - * 0b1..FIRC clock source is present - * 0b0..FIRC clock source is not present - */ -#define SCG_PARAM_FIRCCLKPRES(x) (((uint32_t)(((uint32_t)(x)) << SCG_PARAM_FIRCCLKPRES_SHIFT)) & SCG_PARAM_FIRCCLKPRES_MASK) - -#define SCG_PARAM_ROSCCLKPRES_MASK (0x10U) -#define SCG_PARAM_ROSCCLKPRES_SHIFT (4U) -/*! ROSCCLKPRES - ROSC Clock Present - * 0b1..ROSC clock source is present - * 0b0..ROSC clock source is not present - */ -#define SCG_PARAM_ROSCCLKPRES(x) (((uint32_t)(((uint32_t)(x)) << SCG_PARAM_ROSCCLKPRES_SHIFT)) & SCG_PARAM_ROSCCLKPRES_MASK) - -#define SCG_PARAM_APLLCLKPRES_MASK (0x20U) -#define SCG_PARAM_APLLCLKPRES_SHIFT (5U) -/*! APLLCLKPRES - APLL Clock Present - * 0b1..APLL clock source is present - * 0b0..APLL clock source is not present - */ -#define SCG_PARAM_APLLCLKPRES(x) (((uint32_t)(((uint32_t)(x)) << SCG_PARAM_APLLCLKPRES_SHIFT)) & SCG_PARAM_APLLCLKPRES_MASK) - -#define SCG_PARAM_SPLLCLKPRES_MASK (0x40U) -#define SCG_PARAM_SPLLCLKPRES_SHIFT (6U) -/*! SPLLCLKPRES - SPLL Clock Present - * 0b1..SPLL clock source is present - * 0b0..SPLL clock source is not present - */ -#define SCG_PARAM_SPLLCLKPRES(x) (((uint32_t)(((uint32_t)(x)) << SCG_PARAM_SPLLCLKPRES_SHIFT)) & SCG_PARAM_SPLLCLKPRES_MASK) - -#define SCG_PARAM_UPLLCLKPRES_MASK (0x80U) -#define SCG_PARAM_UPLLCLKPRES_SHIFT (7U) -/*! UPLLCLKPRES - UPLL Clock Present - * 0b1..UPLL clock source is present - * 0b0..UPLL clock source is not present - */ -#define SCG_PARAM_UPLLCLKPRES(x) (((uint32_t)(((uint32_t)(x)) << SCG_PARAM_UPLLCLKPRES_SHIFT)) & SCG_PARAM_UPLLCLKPRES_MASK) - -#define SCG_PARAM_TROCLKPRES_MASK (0x100U) -#define SCG_PARAM_TROCLKPRES_SHIFT (8U) -/*! TROCLKPRES - TRO Clock Present - * 0b1..TRO clock source is present - * 0b0..TRO clock source is not present - */ -#define SCG_PARAM_TROCLKPRES(x) (((uint32_t)(((uint32_t)(x)) << SCG_PARAM_TROCLKPRES_SHIFT)) & SCG_PARAM_TROCLKPRES_MASK) -/*! @} */ - -/*! @name TRIM_LOCK - Trim Lock register */ -/*! @{ */ - -#define SCG_TRIM_LOCK_TRIM_UNLOCK_MASK (0x1U) -#define SCG_TRIM_LOCK_TRIM_UNLOCK_SHIFT (0U) -/*! TRIM_UNLOCK - TRIM_UNLOCK - * 0b0..SCG Trim registers are locked and not writable. - * 0b1..SCG Trim registers are unlocked and writable. - */ -#define SCG_TRIM_LOCK_TRIM_UNLOCK(x) (((uint32_t)(((uint32_t)(x)) << SCG_TRIM_LOCK_TRIM_UNLOCK_SHIFT)) & SCG_TRIM_LOCK_TRIM_UNLOCK_MASK) - -#define SCG_TRIM_LOCK_IFR_DISABLE_MASK (0x2U) -#define SCG_TRIM_LOCK_IFR_DISABLE_SHIFT (1U) -/*! IFR_DISABLE - IFR_DISABLE - * 0b0..IFR write access to SCG trim registers not disabled. The SCG Trim registers are reprogrammed with the IFR values after any system reset. - * 0b1..IFR write access to SCG trim registers during system reset is blocked. - */ -#define SCG_TRIM_LOCK_IFR_DISABLE(x) (((uint32_t)(((uint32_t)(x)) << SCG_TRIM_LOCK_IFR_DISABLE_SHIFT)) & SCG_TRIM_LOCK_IFR_DISABLE_MASK) - -#define SCG_TRIM_LOCK_TRIM_LOCK_KEY_MASK (0xFFFF0000U) -#define SCG_TRIM_LOCK_TRIM_LOCK_KEY_SHIFT (16U) -/*! TRIM_LOCK_KEY - TRIM_LOCK_KEY */ -#define SCG_TRIM_LOCK_TRIM_LOCK_KEY(x) (((uint32_t)(((uint32_t)(x)) << SCG_TRIM_LOCK_TRIM_LOCK_KEY_SHIFT)) & SCG_TRIM_LOCK_TRIM_LOCK_KEY_MASK) -/*! @} */ - -/*! @name CSR - Clock Status Register */ -/*! @{ */ - -#define SCG_CSR_SCS_MASK (0xF000000U) -#define SCG_CSR_SCS_SHIFT (24U) -/*! SCS - System Clock Source - * 0b0000..Reserved - * 0b0001..SOSC - * 0b0010..SIRC - * 0b0011..FIRC - * 0b0100..ROSC - * 0b0101..APLL - * 0b0110..SPLL - * 0b0111..UPLL - * 0b1000..TRO - * 0b1001-0b1111..Reserved - */ -#define SCG_CSR_SCS(x) (((uint32_t)(((uint32_t)(x)) << SCG_CSR_SCS_SHIFT)) & SCG_CSR_SCS_MASK) -/*! @} */ - -/*! @name RCCR - Run Clock Control Register */ -/*! @{ */ - -#define SCG_RCCR_SCS_MASK (0xF000000U) -#define SCG_RCCR_SCS_SHIFT (24U) -/*! SCS - System Clock Source - * 0b0000..Reserved - * 0b0001..SOSC - * 0b0010..SIRC - * 0b0011..FIRC - * 0b0100..ROSC - * 0b0101..APLL - * 0b0110..SPLL - * 0b0111..UPLL - * 0b1000..TRO - * 0b1001-0b1111..Reserved - */ -#define SCG_RCCR_SCS(x) (((uint32_t)(((uint32_t)(x)) << SCG_RCCR_SCS_SHIFT)) & SCG_RCCR_SCS_MASK) -/*! @} */ - -/*! @name SOSCCSR - SOSC Control Status Register */ -/*! @{ */ - -#define SCG_SOSCCSR_SOSCEN_MASK (0x1U) -#define SCG_SOSCCSR_SOSCEN_SHIFT (0U) -/*! SOSCEN - SOSC Enable - * 0b0..SOSC is disabled - * 0b1..SOSC is enabled - */ -#define SCG_SOSCCSR_SOSCEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCEN_SHIFT)) & SCG_SOSCCSR_SOSCEN_MASK) - -#define SCG_SOSCCSR_SOSCSTEN_MASK (0x2U) -#define SCG_SOSCCSR_SOSCSTEN_SHIFT (1U) -/*! SOSCSTEN - SOSC Stop Enable - * 0b0..SOSC is disabled in Deep Sleep mode - * 0b1..SOSC is enabled in Deep Sleep mode only if SOSCEN is set - */ -#define SCG_SOSCCSR_SOSCSTEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCSTEN_SHIFT)) & SCG_SOSCCSR_SOSCSTEN_MASK) - -#define SCG_SOSCCSR_SOSCCM_MASK (0x10000U) -#define SCG_SOSCCSR_SOSCCM_SHIFT (16U) -/*! SOSCCM - SOSC Clock Monitor Enable - * 0b0..SOSC Clock Monitor is disabled - * 0b1..SOSC Clock Monitor is enabled - */ -#define SCG_SOSCCSR_SOSCCM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCCM_SHIFT)) & SCG_SOSCCSR_SOSCCM_MASK) - -#define SCG_SOSCCSR_SOSCCMRE_MASK (0x20000U) -#define SCG_SOSCCSR_SOSCCMRE_SHIFT (17U) -/*! SOSCCMRE - SOSC Clock Monitor Reset Enable - * 0b0..Clock monitor generates an interrupt when an error is detected - * 0b1..Clock monitor generates a reset when an error is detected - */ -#define SCG_SOSCCSR_SOSCCMRE(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCCMRE_SHIFT)) & SCG_SOSCCSR_SOSCCMRE_MASK) - -#define SCG_SOSCCSR_LK_MASK (0x800000U) -#define SCG_SOSCCSR_LK_SHIFT (23U) -/*! LK - Lock Register - * 0b0..This Control Status Register can be written - * 0b1..This Control Status Register cannot be written - */ -#define SCG_SOSCCSR_LK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_LK_SHIFT)) & SCG_SOSCCSR_LK_MASK) - -#define SCG_SOSCCSR_SOSCVLD_MASK (0x1000000U) -#define SCG_SOSCCSR_SOSCVLD_SHIFT (24U) -/*! SOSCVLD - SOSC Valid - * 0b0..SOSC is not enabled or clock is not valid - * 0b1..SOSC is enabled and output clock is valid - */ -#define SCG_SOSCCSR_SOSCVLD(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCVLD_SHIFT)) & SCG_SOSCCSR_SOSCVLD_MASK) - -#define SCG_SOSCCSR_SOSCSEL_MASK (0x2000000U) -#define SCG_SOSCCSR_SOSCSEL_SHIFT (25U) -/*! SOSCSEL - SOSC Selected - * 0b0..SOSC is not the system clock source - * 0b1..SOSC is the system clock source - */ -#define SCG_SOSCCSR_SOSCSEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCSEL_SHIFT)) & SCG_SOSCCSR_SOSCSEL_MASK) - -#define SCG_SOSCCSR_SOSCERR_MASK (0x4000000U) -#define SCG_SOSCCSR_SOSCERR_SHIFT (26U) -/*! SOSCERR - SOSC Clock Error - * 0b0..SOSC Clock Monitor is disabled or has not detected an error - * 0b1..SOSC Clock Monitor is enabled and detected an error - */ -#define SCG_SOSCCSR_SOSCERR(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCERR_SHIFT)) & SCG_SOSCCSR_SOSCERR_MASK) - -#define SCG_SOSCCSR_SOSCVLD_IE_MASK (0x40000000U) -#define SCG_SOSCCSR_SOSCVLD_IE_SHIFT (30U) -/*! SOSCVLD_IE - SOSC Valid Interrupt Enable - * 0b0..SOSCVLD interrupt is not enabled - * 0b1..SOSCVLD interrupt is enabled - */ -#define SCG_SOSCCSR_SOSCVLD_IE(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCVLD_IE_SHIFT)) & SCG_SOSCCSR_SOSCVLD_IE_MASK) -/*! @} */ - -/*! @name SOSCCFG - SOSC Configuration Register */ -/*! @{ */ - -#define SCG_SOSCCFG_EREFS_MASK (0x4U) -#define SCG_SOSCCFG_EREFS_SHIFT (2U) -/*! EREFS - External Reference Select - * 0b0..External reference clock selected. LDO can be disabled in this case. - * 0b1..Internal crystal oscillator of OSC selected. - */ -#define SCG_SOSCCFG_EREFS(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCFG_EREFS_SHIFT)) & SCG_SOSCCFG_EREFS_MASK) - -#define SCG_SOSCCFG_RANGE_MASK (0x30U) -#define SCG_SOSCCFG_RANGE_SHIFT (4U) -/*! RANGE - SOSC Range Select - * 0b00..Frequency range select of 16-20 MHz. - * 0b01..Frequency range select of 20-30 MHz. - * 0b10..Frequency range select of 30-50 MHz. - * 0b11..Frequency range select of 50-66 MHz. - */ -#define SCG_SOSCCFG_RANGE(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCFG_RANGE_SHIFT)) & SCG_SOSCCFG_RANGE_MASK) -/*! @} */ - -/*! @name SIRCCSR - SIRC Control Status Register */ -/*! @{ */ - -#define SCG_SIRCCSR_SIRCSTEN_MASK (0x2U) -#define SCG_SIRCCSR_SIRCSTEN_SHIFT (1U) -/*! SIRCSTEN - SIRC Stop Enable - * 0b0..SIRC is disabled in Deep Sleep mode - * 0b1..SIRC is enabled in Deep Sleep mode - */ -#define SCG_SIRCCSR_SIRCSTEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCSTEN_SHIFT)) & SCG_SIRCCSR_SIRCSTEN_MASK) - -#define SCG_SIRCCSR_SIRC_CLK_PERIPH_EN_MASK (0x20U) -#define SCG_SIRCCSR_SIRC_CLK_PERIPH_EN_SHIFT (5U) -/*! SIRC_CLK_PERIPH_EN - SIRC Clock to Peripherals Enable - * 0b0..SIRC clock to peripherals is disabled - * 0b1..SIRC clock to peripherals is enabled - */ -#define SCG_SIRCCSR_SIRC_CLK_PERIPH_EN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRC_CLK_PERIPH_EN_SHIFT)) & SCG_SIRCCSR_SIRC_CLK_PERIPH_EN_MASK) - -#define SCG_SIRCCSR_SIRCTREN_MASK (0x100U) -#define SCG_SIRCCSR_SIRCTREN_SHIFT (8U) -/*! SIRCTREN - SIRC 12 MHz Trim Enable (SIRCCFG[RANGE]=1) - * 0b0..Disables trimming SIRC to an external clock source - * 0b1..Enables trimming SIRC to an external clock source - */ -#define SCG_SIRCCSR_SIRCTREN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCTREN_SHIFT)) & SCG_SIRCCSR_SIRCTREN_MASK) - -#define SCG_SIRCCSR_SIRCTRUP_MASK (0x200U) -#define SCG_SIRCCSR_SIRCTRUP_SHIFT (9U) -/*! SIRCTRUP - SIRC Trim Update - * 0b0..Disables SIRC trimming updates - * 0b1..Enables SIRC trimming updates - */ -#define SCG_SIRCCSR_SIRCTRUP(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCTRUP_SHIFT)) & SCG_SIRCCSR_SIRCTRUP_MASK) - -#define SCG_SIRCCSR_TRIM_LOCK_MASK (0x400U) -#define SCG_SIRCCSR_TRIM_LOCK_SHIFT (10U) -/*! TRIM_LOCK - SIRC TRIM LOCK - * 0b0..SIRC auto trim not locked to target frequency range - * 0b1..SIRC auto trim locked to target frequency range - */ -#define SCG_SIRCCSR_TRIM_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_TRIM_LOCK_SHIFT)) & SCG_SIRCCSR_TRIM_LOCK_MASK) - -#define SCG_SIRCCSR_COARSE_TRIM_BYPASS_MASK (0x800U) -#define SCG_SIRCCSR_COARSE_TRIM_BYPASS_SHIFT (11U) -/*! COARSE_TRIM_BYPASS - Coarse Auto Trim Bypass - * 0b0..SIRC coarse auto-trim is not bypassed - * 0b1..SIRC coarse auto-trim is bypassed - */ -#define SCG_SIRCCSR_COARSE_TRIM_BYPASS(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_COARSE_TRIM_BYPASS_SHIFT)) & SCG_SIRCCSR_COARSE_TRIM_BYPASS_MASK) - -#define SCG_SIRCCSR_LK_MASK (0x800000U) -#define SCG_SIRCCSR_LK_SHIFT (23U) -/*! LK - Lock Register - * 0b0..Control Status Register can be written - * 0b1..Control Status Register cannot be written - */ -#define SCG_SIRCCSR_LK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_LK_SHIFT)) & SCG_SIRCCSR_LK_MASK) - -#define SCG_SIRCCSR_SIRCVLD_MASK (0x1000000U) -#define SCG_SIRCCSR_SIRCVLD_SHIFT (24U) -/*! SIRCVLD - SIRC Valid - * 0b0..SIRC is not enabled or clock is not valid - * 0b1..SIRC is enabled and output clock is valid - */ -#define SCG_SIRCCSR_SIRCVLD(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCVLD_SHIFT)) & SCG_SIRCCSR_SIRCVLD_MASK) - -#define SCG_SIRCCSR_SIRCSEL_MASK (0x2000000U) -#define SCG_SIRCCSR_SIRCSEL_SHIFT (25U) -/*! SIRCSEL - SIRC Selected - * 0b0..SIRC is not the system clock source - * 0b1..SIRC is the system clock source - */ -#define SCG_SIRCCSR_SIRCSEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCSEL_SHIFT)) & SCG_SIRCCSR_SIRCSEL_MASK) - -#define SCG_SIRCCSR_SIRCERR_MASK (0x4000000U) -#define SCG_SIRCCSR_SIRCERR_SHIFT (26U) -/*! SIRCERR - SIRC Clock Error - * 0b0..Error not detected with the SIRC trimming - * 0b1..Error detected with the SIRC trimming - */ -#define SCG_SIRCCSR_SIRCERR(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCERR_SHIFT)) & SCG_SIRCCSR_SIRCERR_MASK) - -#define SCG_SIRCCSR_SIRCERR_IE_MASK (0x8000000U) -#define SCG_SIRCCSR_SIRCERR_IE_SHIFT (27U) -/*! SIRCERR_IE - SIRC Clock Error Interrupt Enable - * 0b0..SIRCERR interrupt is not enabled - * 0b1..SIRCERR interrupt is enabled - */ -#define SCG_SIRCCSR_SIRCERR_IE(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCERR_IE_SHIFT)) & SCG_SIRCCSR_SIRCERR_IE_MASK) -/*! @} */ - -/*! @name SIRCTCFG - SIRC Trim Configuration Register */ -/*! @{ */ - -#define SCG_SIRCTCFG_TRIMSRC_MASK (0x3U) -#define SCG_SIRCTCFG_TRIMSRC_SHIFT (0U) -/*! TRIMSRC - Trim Source - * 0b00..Reserved - * 0b01..Reserved - * 0b10..SOSC - * 0b11..ROSC (32.768 kHz) - */ -#define SCG_SIRCTCFG_TRIMSRC(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCTCFG_TRIMSRC_SHIFT)) & SCG_SIRCTCFG_TRIMSRC_MASK) - -#define SCG_SIRCTCFG_TRIMDIV_MASK (0x7F0000U) -#define SCG_SIRCTCFG_TRIMDIV_SHIFT (16U) -/*! TRIMDIV - SIRC Trim Predivider */ -#define SCG_SIRCTCFG_TRIMDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCTCFG_TRIMDIV_SHIFT)) & SCG_SIRCTCFG_TRIMDIV_MASK) -/*! @} */ - -/*! @name SIRCTRIM - SIRC Trim Register */ -/*! @{ */ - -#define SCG_SIRCTRIM_CCOTRIM_MASK (0x3FU) -#define SCG_SIRCTRIM_CCOTRIM_SHIFT (0U) -/*! CCOTRIM - CCO Trim */ -#define SCG_SIRCTRIM_CCOTRIM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCTRIM_CCOTRIM_SHIFT)) & SCG_SIRCTRIM_CCOTRIM_MASK) - -#define SCG_SIRCTRIM_CLTRIM_MASK (0x3F00U) -#define SCG_SIRCTRIM_CLTRIM_SHIFT (8U) -/*! CLTRIM - CL Trim */ -#define SCG_SIRCTRIM_CLTRIM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCTRIM_CLTRIM_SHIFT)) & SCG_SIRCTRIM_CLTRIM_MASK) - -#define SCG_SIRCTRIM_TCTRIM_MASK (0x1F0000U) -#define SCG_SIRCTRIM_TCTRIM_SHIFT (16U) -/*! TCTRIM - Trim Temp */ -#define SCG_SIRCTRIM_TCTRIM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCTRIM_TCTRIM_SHIFT)) & SCG_SIRCTRIM_TCTRIM_MASK) - -#define SCG_SIRCTRIM_FVCHTRIM_MASK (0x1F000000U) -#define SCG_SIRCTRIM_FVCHTRIM_SHIFT (24U) -#define SCG_SIRCTRIM_FVCHTRIM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCTRIM_FVCHTRIM_SHIFT)) & SCG_SIRCTRIM_FVCHTRIM_MASK) -/*! @} */ - -/*! @name SIRCSTAT - SIRC Auto-trimming Status Register */ -/*! @{ */ - -#define SCG_SIRCSTAT_CCOTRIM_MASK (0x3FU) -#define SCG_SIRCSTAT_CCOTRIM_SHIFT (0U) -/*! CCOTRIM - CCO Trim */ -#define SCG_SIRCSTAT_CCOTRIM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCSTAT_CCOTRIM_SHIFT)) & SCG_SIRCSTAT_CCOTRIM_MASK) - -#define SCG_SIRCSTAT_CLTRIM_MASK (0x3F00U) -#define SCG_SIRCSTAT_CLTRIM_SHIFT (8U) -/*! CLTRIM - CL Trim */ -#define SCG_SIRCSTAT_CLTRIM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCSTAT_CLTRIM_SHIFT)) & SCG_SIRCSTAT_CLTRIM_MASK) -/*! @} */ - -/*! @name FIRCCSR - FIRC Control Status Register */ -/*! @{ */ - -#define SCG_FIRCCSR_FIRCEN_MASK (0x1U) -#define SCG_FIRCCSR_FIRCEN_SHIFT (0U) -/*! FIRCEN - FIRC Enable - * 0b0..FIRC is disabled - * 0b1..FIRC is enabled - */ -#define SCG_FIRCCSR_FIRCEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCEN_SHIFT)) & SCG_FIRCCSR_FIRCEN_MASK) - -#define SCG_FIRCCSR_FIRCSTEN_MASK (0x2U) -#define SCG_FIRCCSR_FIRCSTEN_SHIFT (1U) -/*! FIRCSTEN - FIRC Stop Enable - * 0b0..FIRC is disabled in Deep Sleep mode - * 0b1..FIRC is enabled in Deep Sleep mode - */ -#define SCG_FIRCCSR_FIRCSTEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCSTEN_SHIFT)) & SCG_FIRCCSR_FIRCSTEN_MASK) - -#define SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_MASK (0x10U) -#define SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_SHIFT (4U) -/*! FIRC_SCLK_PERIPH_EN - FIRC 48 MHz Clock to peripherals Enable - * 0b0..FIRC 48 MHz to peripherals is disabled - * 0b1..FIRC 48 MHz to peripherals is enabled - */ -#define SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_SHIFT)) & SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_MASK) - -#define SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN_MASK (0x20U) -#define SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN_SHIFT (5U) -/*! FIRC_FCLK_PERIPH_EN - FIRC 144 MHz Clock to peripherals Enable - * 0b0..FIRC 144 MHz to peripherals is disabled - * 0b1..FIRC 144 MHz to peripherals is enabled - */ -#define SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN_SHIFT)) & SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN_MASK) - -#define SCG_FIRCCSR_FIRCTREN_MASK (0x100U) -#define SCG_FIRCCSR_FIRCTREN_SHIFT (8U) -/*! FIRCTREN - FIRC 144 MHz Trim Enable (FIRCCFG[RANGE]=1) - * 0b0..Disables trimming FIRC to an external clock source - * 0b1..Enables trimming FIRC to an external clock source - */ -#define SCG_FIRCCSR_FIRCTREN(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCTREN_SHIFT)) & SCG_FIRCCSR_FIRCTREN_MASK) - -#define SCG_FIRCCSR_FIRCTRUP_MASK (0x200U) -#define SCG_FIRCCSR_FIRCTRUP_SHIFT (9U) -/*! FIRCTRUP - FIRC Trim Update - * 0b0..Disables FIRC trimming updates - * 0b1..Enables FIRC trimming updates - */ -#define SCG_FIRCCSR_FIRCTRUP(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCTRUP_SHIFT)) & SCG_FIRCCSR_FIRCTRUP_MASK) - -#define SCG_FIRCCSR_TRIM_LOCK_MASK (0x400U) -#define SCG_FIRCCSR_TRIM_LOCK_SHIFT (10U) -/*! TRIM_LOCK - FIRC TRIM LOCK - * 0b0..FIRC auto trim not locked to target frequency range - * 0b1..FIRC auto trim locked to target frequency range - */ -#define SCG_FIRCCSR_TRIM_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_TRIM_LOCK_SHIFT)) & SCG_FIRCCSR_TRIM_LOCK_MASK) - -#define SCG_FIRCCSR_COARSE_TRIM_BYPASS_MASK (0x800U) -#define SCG_FIRCCSR_COARSE_TRIM_BYPASS_SHIFT (11U) -/*! COARSE_TRIM_BYPASS - Coarse Auto Trim Bypass - * 0b0..FIRC coarse auto trim is not bypassed - * 0b1..FIRC coarse auto trim is bypassed - */ -#define SCG_FIRCCSR_COARSE_TRIM_BYPASS(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_COARSE_TRIM_BYPASS_SHIFT)) & SCG_FIRCCSR_COARSE_TRIM_BYPASS_MASK) - -#define SCG_FIRCCSR_LK_MASK (0x800000U) -#define SCG_FIRCCSR_LK_SHIFT (23U) -/*! LK - Lock Register - * 0b0..Control Status Register can be written - * 0b1..Control Status Register cannot be written - */ -#define SCG_FIRCCSR_LK(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_LK_SHIFT)) & SCG_FIRCCSR_LK_MASK) - -#define SCG_FIRCCSR_FIRCVLD_MASK (0x1000000U) -#define SCG_FIRCCSR_FIRCVLD_SHIFT (24U) -/*! FIRCVLD - FIRC Valid status - * 0b0..FIRC is not enabled or clock is not valid. - * 0b1..FIRC is enabled and output clock is valid. The clock is valid after there is an output clock from the FIRC analog. - */ -#define SCG_FIRCCSR_FIRCVLD(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCVLD_SHIFT)) & SCG_FIRCCSR_FIRCVLD_MASK) - -#define SCG_FIRCCSR_FIRCSEL_MASK (0x2000000U) -#define SCG_FIRCCSR_FIRCSEL_SHIFT (25U) -/*! FIRCSEL - FIRC Selected - * 0b0..FIRC is not the system clock source - * 0b1..FIRC is the system clock source - */ -#define SCG_FIRCCSR_FIRCSEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCSEL_SHIFT)) & SCG_FIRCCSR_FIRCSEL_MASK) - -#define SCG_FIRCCSR_FIRCERR_MASK (0x4000000U) -#define SCG_FIRCCSR_FIRCERR_SHIFT (26U) -/*! FIRCERR - FIRC Clock Error - * 0b0..Error not detected with the FIRC trimming - * 0b1..Error detected with the FIRC trimming - */ -#define SCG_FIRCCSR_FIRCERR(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCERR_SHIFT)) & SCG_FIRCCSR_FIRCERR_MASK) - -#define SCG_FIRCCSR_FIRCERR_IE_MASK (0x8000000U) -#define SCG_FIRCCSR_FIRCERR_IE_SHIFT (27U) -/*! FIRCERR_IE - FIRC Clock Error Interrupt Enable - * 0b0..FIRCERR interrupt is not enabled - * 0b1..FIRCERR interrupt is enabled - */ -#define SCG_FIRCCSR_FIRCERR_IE(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCERR_IE_SHIFT)) & SCG_FIRCCSR_FIRCERR_IE_MASK) - -#define SCG_FIRCCSR_FIRCACC_IE_MASK (0x40000000U) -#define SCG_FIRCCSR_FIRCACC_IE_SHIFT (30U) -/*! FIRCACC_IE - FIRC Accurate Interrupt Enable - * 0b0..FIRCACC interrupt is not enabled - * 0b1..FIRCACC interrupt is enabled - */ -#define SCG_FIRCCSR_FIRCACC_IE(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCACC_IE_SHIFT)) & SCG_FIRCCSR_FIRCACC_IE_MASK) - -#define SCG_FIRCCSR_FIRCACC_MASK (0x80000000U) -#define SCG_FIRCCSR_FIRCACC_SHIFT (31U) -/*! FIRCACC - FIRC Frequency Accurate - * 0b0..FIRC is not enabled or clock is not accurate. - * 0b1..FIRC is enabled and output clock is accurate. The clock is accurate after 4096 clock cycles of 144 MHz - * (RANGE=1) or 1365 clock cycles of 48 MHz(RANGE=0) from the FIRC analog. - */ -#define SCG_FIRCCSR_FIRCACC(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCACC_SHIFT)) & SCG_FIRCCSR_FIRCACC_MASK) -/*! @} */ - -/*! @name FIRCCFG - FIRC Configuration Register */ -/*! @{ */ - -#define SCG_FIRCCFG_RANGE_MASK (0x1U) -#define SCG_FIRCCFG_RANGE_SHIFT (0U) -/*! RANGE - Frequency Range - * 0b0..48 MHz FIRC clock selected - * 0b1..144 MHz FIRC clock selected - */ -#define SCG_FIRCCFG_RANGE(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCFG_RANGE_SHIFT)) & SCG_FIRCCFG_RANGE_MASK) -/*! @} */ - -/*! @name FIRCTCFG - FIRC Trim Configuration Register */ -/*! @{ */ - -#define SCG_FIRCTCFG_TRIMSRC_MASK (0x3U) -#define SCG_FIRCTCFG_TRIMSRC_SHIFT (0U) -/*! TRIMSRC - Trim Source - * 0b00..USB0 Start of Frame (1 kHz). This option does not use TRIMDIV - * 0b01..Reserved - * 0b10..SOSC - * 0b11..ROSC - */ -#define SCG_FIRCTCFG_TRIMSRC(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTCFG_TRIMSRC_SHIFT)) & SCG_FIRCTCFG_TRIMSRC_MASK) - -#define SCG_FIRCTCFG_TRIMDIV_MASK (0x7F0000U) -#define SCG_FIRCTCFG_TRIMDIV_SHIFT (16U) -/*! TRIMDIV - FIRC Trim Predivider */ -#define SCG_FIRCTCFG_TRIMDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTCFG_TRIMDIV_SHIFT)) & SCG_FIRCTCFG_TRIMDIV_MASK) -/*! @} */ - -/*! @name FIRCTRIM - FIRC Trim Register */ -/*! @{ */ - -#define SCG_FIRCTRIM_TRIMFINE_MASK (0xFFU) -#define SCG_FIRCTRIM_TRIMFINE_SHIFT (0U) -/*! TRIMFINE - Trim Fine */ -#define SCG_FIRCTRIM_TRIMFINE(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTRIM_TRIMFINE_SHIFT)) & SCG_FIRCTRIM_TRIMFINE_MASK) - -#define SCG_FIRCTRIM_TRIMCOAR_MASK (0x3F00U) -#define SCG_FIRCTRIM_TRIMCOAR_SHIFT (8U) -/*! TRIMCOAR - Trim Coarse */ -#define SCG_FIRCTRIM_TRIMCOAR(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTRIM_TRIMCOAR_SHIFT)) & SCG_FIRCTRIM_TRIMCOAR_MASK) - -#define SCG_FIRCTRIM_TRIMTEMP_MASK (0x30000U) -#define SCG_FIRCTRIM_TRIMTEMP_SHIFT (16U) -/*! TRIMTEMP - Trim Temperature */ -#define SCG_FIRCTRIM_TRIMTEMP(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTRIM_TRIMTEMP_SHIFT)) & SCG_FIRCTRIM_TRIMTEMP_MASK) - -#define SCG_FIRCTRIM_TRIMSTART_MASK (0x3F000000U) -#define SCG_FIRCTRIM_TRIMSTART_SHIFT (24U) -/*! TRIMSTART - Trim Start */ -#define SCG_FIRCTRIM_TRIMSTART(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTRIM_TRIMSTART_SHIFT)) & SCG_FIRCTRIM_TRIMSTART_MASK) -/*! @} */ - -/*! @name FIRCSTAT - FIRC Auto-trimming Status Register */ -/*! @{ */ - -#define SCG_FIRCSTAT_TRIMFINE_MASK (0xFFU) -#define SCG_FIRCSTAT_TRIMFINE_SHIFT (0U) -/*! TRIMFINE - Trim Fine */ -#define SCG_FIRCSTAT_TRIMFINE(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCSTAT_TRIMFINE_SHIFT)) & SCG_FIRCSTAT_TRIMFINE_MASK) - -#define SCG_FIRCSTAT_TRIMCOAR_MASK (0x3F00U) -#define SCG_FIRCSTAT_TRIMCOAR_SHIFT (8U) -/*! TRIMCOAR - Trim Coarse */ -#define SCG_FIRCSTAT_TRIMCOAR(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCSTAT_TRIMCOAR_SHIFT)) & SCG_FIRCSTAT_TRIMCOAR_MASK) -/*! @} */ - -/*! @name ROSCCSR - ROSC Control Status Register */ -/*! @{ */ - -#define SCG_ROSCCSR_ROSCCM_MASK (0x10000U) -#define SCG_ROSCCSR_ROSCCM_SHIFT (16U) -/*! ROSCCM - ROSC Clock Monitor - * 0b0..ROSC clock monitor is disabled - * 0b1..ROSC clock monitor is enabled - */ -#define SCG_ROSCCSR_ROSCCM(x) (((uint32_t)(((uint32_t)(x)) << SCG_ROSCCSR_ROSCCM_SHIFT)) & SCG_ROSCCSR_ROSCCM_MASK) - -#define SCG_ROSCCSR_ROSCCMRE_MASK (0x20000U) -#define SCG_ROSCCSR_ROSCCMRE_SHIFT (17U) -/*! ROSCCMRE - ROSC Clock Monitor Reset Enable - * 0b0..Clock monitor generates an interrupt when an error is detected - * 0b1..Clock monitor generates a reset when an error is detected - */ -#define SCG_ROSCCSR_ROSCCMRE(x) (((uint32_t)(((uint32_t)(x)) << SCG_ROSCCSR_ROSCCMRE_SHIFT)) & SCG_ROSCCSR_ROSCCMRE_MASK) - -#define SCG_ROSCCSR_LK_MASK (0x800000U) -#define SCG_ROSCCSR_LK_SHIFT (23U) -/*! LK - Lock Register - * 0b0..Control Status Register can be written - * 0b1..Control Status Register cannot be written - */ -#define SCG_ROSCCSR_LK(x) (((uint32_t)(((uint32_t)(x)) << SCG_ROSCCSR_LK_SHIFT)) & SCG_ROSCCSR_LK_MASK) - -#define SCG_ROSCCSR_ROSCVLD_MASK (0x1000000U) -#define SCG_ROSCCSR_ROSCVLD_SHIFT (24U) -/*! ROSCVLD - ROSC Valid - * 0b0..ROSC is not enabled or clock is not valid - * 0b1..ROSC is enabled and output clock is valid - */ -#define SCG_ROSCCSR_ROSCVLD(x) (((uint32_t)(((uint32_t)(x)) << SCG_ROSCCSR_ROSCVLD_SHIFT)) & SCG_ROSCCSR_ROSCVLD_MASK) - -#define SCG_ROSCCSR_ROSCSEL_MASK (0x2000000U) -#define SCG_ROSCCSR_ROSCSEL_SHIFT (25U) -/*! ROSCSEL - ROSC Selected - * 0b0..ROSC is not the system clock source - * 0b1..ROSC is the system clock source - */ -#define SCG_ROSCCSR_ROSCSEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_ROSCCSR_ROSCSEL_SHIFT)) & SCG_ROSCCSR_ROSCSEL_MASK) - -#define SCG_ROSCCSR_ROSCERR_MASK (0x4000000U) -#define SCG_ROSCCSR_ROSCERR_SHIFT (26U) -/*! ROSCERR - ROSC Clock Error - * 0b0..ROSC Clock Monitor is disabled or has not detected an error - * 0b1..ROSC Clock Monitor is enabled and detected an RTC loss of clock error - */ -#define SCG_ROSCCSR_ROSCERR(x) (((uint32_t)(((uint32_t)(x)) << SCG_ROSCCSR_ROSCERR_SHIFT)) & SCG_ROSCCSR_ROSCERR_MASK) -/*! @} */ - -/*! @name APLLCSR - APLL Control Status Register */ -/*! @{ */ - -#define SCG_APLLCSR_APLLPWREN_MASK (0x1U) -#define SCG_APLLCSR_APLLPWREN_SHIFT (0U) -/*! APLLPWREN - APLL Power Enable - * 0b0..APLL clock is powered off - * 0b1..APLL clock is powered on - */ -#define SCG_APLLCSR_APLLPWREN(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_APLLPWREN_SHIFT)) & SCG_APLLCSR_APLLPWREN_MASK) - -#define SCG_APLLCSR_APLLCLKEN_MASK (0x2U) -#define SCG_APLLCSR_APLLCLKEN_SHIFT (1U) -/*! APLLCLKEN - APLL Clock Enable - * 0b0..APLL clock is disabled - * 0b1..APLL clock is enabled - */ -#define SCG_APLLCSR_APLLCLKEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_APLLCLKEN_SHIFT)) & SCG_APLLCSR_APLLCLKEN_MASK) - -#define SCG_APLLCSR_APLLSTEN_MASK (0x4U) -#define SCG_APLLCSR_APLLSTEN_SHIFT (2U) -/*! APLLSTEN - APLL Stop Enable - * 0b0..APLL is disabled in Deep Sleep mode - * 0b1..APLL is enabled in Deep Sleep mode - */ -#define SCG_APLLCSR_APLLSTEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_APLLSTEN_SHIFT)) & SCG_APLLCSR_APLLSTEN_MASK) - -#define SCG_APLLCSR_FRM_CLOCKSTABLE_MASK (0x8U) -#define SCG_APLLCSR_FRM_CLOCKSTABLE_SHIFT (3U) -/*! FRM_CLOCKSTABLE - Free running mode clock stable - * 0b0..Free running mode clockstable is disabled - * 0b1..Free running mode clockstable is enabled - */ -#define SCG_APLLCSR_FRM_CLOCKSTABLE(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_FRM_CLOCKSTABLE_SHIFT)) & SCG_APLLCSR_FRM_CLOCKSTABLE_MASK) - -#define SCG_APLLCSR_APLLCM_MASK (0x10000U) -#define SCG_APLLCSR_APLLCM_SHIFT (16U) -/*! APLLCM - APLL Clock Monitor - * 0b0..APLL Clock Monitor is disabled - * 0b1..APLL Clock Monitor is enabled - */ -#define SCG_APLLCSR_APLLCM(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_APLLCM_SHIFT)) & SCG_APLLCSR_APLLCM_MASK) - -#define SCG_APLLCSR_APLLCMRE_MASK (0x20000U) -#define SCG_APLLCSR_APLLCMRE_SHIFT (17U) -/*! APLLCMRE - APLL Clock Monitor Reset Enable - * 0b0..Clock monitor generates an interrupt when an error is detected - * 0b1..Clock monitor generates a reset when an error is detected - */ -#define SCG_APLLCSR_APLLCMRE(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_APLLCMRE_SHIFT)) & SCG_APLLCSR_APLLCMRE_MASK) - -#define SCG_APLLCSR_LK_MASK (0x800000U) -#define SCG_APLLCSR_LK_SHIFT (23U) -/*! LK - Lock Register - * 0b0..Control Status Register can be written - * 0b1..Control Status Register cannot be written - */ -#define SCG_APLLCSR_LK(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_LK_SHIFT)) & SCG_APLLCSR_LK_MASK) - -#define SCG_APLLCSR_APLL_LOCK_MASK (0x1000000U) -#define SCG_APLLCSR_APLL_LOCK_SHIFT (24U) -/*! APLL_LOCK - APLL LOCK - * 0b0..APLL is not powered on or not locked - * 0b1..APLL is locked - */ -#define SCG_APLLCSR_APLL_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_APLL_LOCK_SHIFT)) & SCG_APLLCSR_APLL_LOCK_MASK) - -#define SCG_APLLCSR_APLLSEL_MASK (0x2000000U) -#define SCG_APLLCSR_APLLSEL_SHIFT (25U) -/*! APLLSEL - APLL Selected - * 0b0..APLL is not the system clock source - * 0b1..APLL is the system clock source - */ -#define SCG_APLLCSR_APLLSEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_APLLSEL_SHIFT)) & SCG_APLLCSR_APLLSEL_MASK) - -#define SCG_APLLCSR_APLLERR_MASK (0x4000000U) -#define SCG_APLLCSR_APLLERR_SHIFT (26U) -/*! APLLERR - APLL Clock Error - * 0b0..APLL Clock Monitor is disabled or has not detected an error - * 0b1..APLL Clock Monitor is enabled and detected an error - */ -#define SCG_APLLCSR_APLLERR(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_APLLERR_SHIFT)) & SCG_APLLCSR_APLLERR_MASK) - -#define SCG_APLLCSR_APLL_LOCK_IE_MASK (0x40000000U) -#define SCG_APLLCSR_APLL_LOCK_IE_SHIFT (30U) -/*! APLL_LOCK_IE - APLL LOCK Interrupt Enable - * 0b0..APLL_LOCK interrupt is not enabled - * 0b1..APLL_LOCK interrupt is enabled - */ -#define SCG_APLLCSR_APLL_LOCK_IE(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_APLL_LOCK_IE_SHIFT)) & SCG_APLLCSR_APLL_LOCK_IE_MASK) -/*! @} */ - -/*! @name APLLCTRL - APLL Control Register */ -/*! @{ */ - -#define SCG_APLLCTRL_SELR_MASK (0xFU) -#define SCG_APLLCTRL_SELR_SHIFT (0U) -/*! SELR - Bandwidth select R (resistor) value. */ -#define SCG_APLLCTRL_SELR(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCTRL_SELR_SHIFT)) & SCG_APLLCTRL_SELR_MASK) - -#define SCG_APLLCTRL_SELI_MASK (0x3F0U) -#define SCG_APLLCTRL_SELI_SHIFT (4U) -/*! SELI - Bandwidth select I (integration) value. */ -#define SCG_APLLCTRL_SELI(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCTRL_SELI_SHIFT)) & SCG_APLLCTRL_SELI_MASK) - -#define SCG_APLLCTRL_SELP_MASK (0x7C00U) -#define SCG_APLLCTRL_SELP_SHIFT (10U) -/*! SELP - Bandwidth select P (proportional) value. */ -#define SCG_APLLCTRL_SELP(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCTRL_SELP_SHIFT)) & SCG_APLLCTRL_SELP_MASK) - -#define SCG_APLLCTRL_BYPASSPOSTDIV2_MASK (0x10000U) -#define SCG_APLLCTRL_BYPASSPOSTDIV2_SHIFT (16U) -/*! BYPASSPOSTDIV2 - Bypass of Divide-by-2 Divider - * 0b0..Use the divide-by-2 divider in the postdivider - * 0b1..Bypass of the divide-by-2 divider in the postdivider - */ -#define SCG_APLLCTRL_BYPASSPOSTDIV2(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCTRL_BYPASSPOSTDIV2_SHIFT)) & SCG_APLLCTRL_BYPASSPOSTDIV2_MASK) - -#define SCG_APLLCTRL_LIMUPOFF_MASK (0x20000U) -#define SCG_APLLCTRL_LIMUPOFF_SHIFT (17U) -/*! LIMUPOFF - Up Limiter - * 0b0..Application set to non-Spectrum and Fractional applications. - * 0b1..Application set to Spectrum and Fractional applications. - */ -#define SCG_APLLCTRL_LIMUPOFF(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCTRL_LIMUPOFF_SHIFT)) & SCG_APLLCTRL_LIMUPOFF_MASK) - -#define SCG_APLLCTRL_BANDDIRECT_MASK (0x40000U) -#define SCG_APLLCTRL_BANDDIRECT_SHIFT (18U) -/*! BANDDIRECT - Control of the bandwidth of the PLL. - * 0b0..The bandwidth is changed synchronously with the feedback-divider - * 0b1..Modifies the bandwidth of the PLL directly - */ -#define SCG_APLLCTRL_BANDDIRECT(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCTRL_BANDDIRECT_SHIFT)) & SCG_APLLCTRL_BANDDIRECT_MASK) - -#define SCG_APLLCTRL_BYPASSPREDIV_MASK (0x80000U) -#define SCG_APLLCTRL_BYPASSPREDIV_SHIFT (19U) -/*! BYPASSPREDIV - Bypass of the predivider - * 0b0..Use the predivider. - * 0b1..Bypass of the predivider. - */ -#define SCG_APLLCTRL_BYPASSPREDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCTRL_BYPASSPREDIV_SHIFT)) & SCG_APLLCTRL_BYPASSPREDIV_MASK) - -#define SCG_APLLCTRL_BYPASSPOSTDIV_MASK (0x100000U) -#define SCG_APLLCTRL_BYPASSPOSTDIV_SHIFT (20U) -/*! BYPASSPOSTDIV - Bypass of the postdivider - * 0b0..Use the postdivider. - * 0b1..Bypass of the postdivider - */ -#define SCG_APLLCTRL_BYPASSPOSTDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCTRL_BYPASSPOSTDIV_SHIFT)) & SCG_APLLCTRL_BYPASSPOSTDIV_MASK) - -#define SCG_APLLCTRL_FRM_MASK (0x400000U) -#define SCG_APLLCTRL_FRM_SHIFT (22U) -/*! FRM - Free Running Mode Enable - * 0b0..Free running mode disabled - * 0b1..Free running mode enabled - */ -#define SCG_APLLCTRL_FRM(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCTRL_FRM_SHIFT)) & SCG_APLLCTRL_FRM_MASK) - -#define SCG_APLLCTRL_SOURCE_MASK (0x6000000U) -#define SCG_APLLCTRL_SOURCE_SHIFT (25U) -/*! SOURCE - Clock Source - * 0b00..SOSC - * 0b01..FIRC 48 MHz clock. FIRC_SCLK_PERIPH_EN must be set to use FIRC 48 MHz clock. - * 0b10..ROSC - * 0b11..No clock - */ -#define SCG_APLLCTRL_SOURCE(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCTRL_SOURCE_SHIFT)) & SCG_APLLCTRL_SOURCE_MASK) -/*! @} */ - -/*! @name APLLSTAT - APLL Status Register */ -/*! @{ */ - -#define SCG_APLLSTAT_NDIVACK_MASK (0x2U) -#define SCG_APLLSTAT_NDIVACK_SHIFT (1U) -/*! NDIVACK - Predivider(N) ratio change acknowledge. - * 0b0..The predivider (N) ratio change is not accepted by the analog PLL - * 0b1..The predivider (N) ratio change is accepted by the analog PLL - */ -#define SCG_APLLSTAT_NDIVACK(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSTAT_NDIVACK_SHIFT)) & SCG_APLLSTAT_NDIVACK_MASK) - -#define SCG_APLLSTAT_MDIVACK_MASK (0x4U) -#define SCG_APLLSTAT_MDIVACK_SHIFT (2U) -/*! MDIVACK - Feedback(M) divider ratio change acknowledge. - * 0b0..The feedback (M) ratio change is not accepted by the analog PLL - * 0b1..The feedback (M) ratio change is accepted by the analog PLL - */ -#define SCG_APLLSTAT_MDIVACK(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSTAT_MDIVACK_SHIFT)) & SCG_APLLSTAT_MDIVACK_MASK) - -#define SCG_APLLSTAT_PDIVACK_MASK (0x8U) -#define SCG_APLLSTAT_PDIVACK_SHIFT (3U) -/*! PDIVACK - Postdivider(P) ratio change acknowledge. - * 0b0..The postdivider (P) ratio change is not accepted by the analog PLL - * 0b1..The postdivider (P) ratio change is accepted by the analog PLL - */ -#define SCG_APLLSTAT_PDIVACK(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSTAT_PDIVACK_SHIFT)) & SCG_APLLSTAT_PDIVACK_MASK) - -#define SCG_APLLSTAT_FRMDET_MASK (0x10U) -#define SCG_APLLSTAT_FRMDET_SHIFT (4U) -/*! FRMDET - Free running detector (active high) - * 0b0..Free running is not detected - * 0b1..Free running is detected - */ -#define SCG_APLLSTAT_FRMDET(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSTAT_FRMDET_SHIFT)) & SCG_APLLSTAT_FRMDET_MASK) -/*! @} */ - -/*! @name APLLNDIV - APLL N Divider Register */ -/*! @{ */ - -#define SCG_APLLNDIV_NDIV_MASK (0xFFU) -#define SCG_APLLNDIV_NDIV_SHIFT (0U) -/*! NDIV - Predivider divider ratio (N-divider). */ -#define SCG_APLLNDIV_NDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLNDIV_NDIV_SHIFT)) & SCG_APLLNDIV_NDIV_MASK) - -#define SCG_APLLNDIV_NREQ_MASK (0x80000000U) -#define SCG_APLLNDIV_NREQ_SHIFT (31U) -/*! NREQ - Predivider ratio change request. - * 0b0..Predivider ratio change is not requested - * 0b1..Predivider ratio change is requested - */ -#define SCG_APLLNDIV_NREQ(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLNDIV_NREQ_SHIFT)) & SCG_APLLNDIV_NREQ_MASK) -/*! @} */ - -/*! @name APLLMDIV - APLL M Divider Register */ -/*! @{ */ - -#define SCG_APLLMDIV_MDIV_MASK (0xFFFFU) -#define SCG_APLLMDIV_MDIV_SHIFT (0U) -/*! MDIV - Feedback divider divider ratio (M-divider). */ -#define SCG_APLLMDIV_MDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLMDIV_MDIV_SHIFT)) & SCG_APLLMDIV_MDIV_MASK) - -#define SCG_APLLMDIV_MREQ_MASK (0x80000000U) -#define SCG_APLLMDIV_MREQ_SHIFT (31U) -/*! MREQ - Feedback ratio change request. - * 0b0..Feedback ratio change is not requested - * 0b1..Feedback ratio change is requested - */ -#define SCG_APLLMDIV_MREQ(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLMDIV_MREQ_SHIFT)) & SCG_APLLMDIV_MREQ_MASK) -/*! @} */ - -/*! @name APLLPDIV - APLL P Divider Register */ -/*! @{ */ - -#define SCG_APLLPDIV_PDIV_MASK (0x1FU) -#define SCG_APLLPDIV_PDIV_SHIFT (0U) -/*! PDIV - Postdivider divider ratio (P-divider) */ -#define SCG_APLLPDIV_PDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLPDIV_PDIV_SHIFT)) & SCG_APLLPDIV_PDIV_MASK) - -#define SCG_APLLPDIV_PREQ_MASK (0x80000000U) -#define SCG_APLLPDIV_PREQ_SHIFT (31U) -/*! PREQ - Postdivider ratio change request - * 0b0..Postdivider ratio change is not requested - * 0b1..Postdivider ratio change is requested - */ -#define SCG_APLLPDIV_PREQ(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLPDIV_PREQ_SHIFT)) & SCG_APLLPDIV_PREQ_MASK) -/*! @} */ - -/*! @name APLLLOCK_CNFG - APLL LOCK Configuration Register */ -/*! @{ */ - -#define SCG_APLLLOCK_CNFG_LOCK_TIME_MASK (0x1FFFFU) -#define SCG_APLLLOCK_CNFG_LOCK_TIME_SHIFT (0U) -/*! LOCK_TIME - Configures the number of reference clocks to count before APLL is considered locked. */ -#define SCG_APLLLOCK_CNFG_LOCK_TIME(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLLOCK_CNFG_LOCK_TIME_SHIFT)) & SCG_APLLLOCK_CNFG_LOCK_TIME_MASK) -/*! @} */ - -/*! @name APLLSSCGSTAT - APLL SSCG Status Register */ -/*! @{ */ - -#define SCG_APLLSSCGSTAT_SS_MDIV_ACK_MASK (0x1U) -#define SCG_APLLSSCGSTAT_SS_MDIV_ACK_SHIFT (0U) -/*! SS_MDIV_ACK - SS_MDIV change acknowledge - * 0b0..The SS_MDIV, MF, MR, and MC ratio change is not accepted by the analog PLL - * 0b1..The SS_MDIV, MF, MR, and MC ratio change is accepted by the analog PLL - */ -#define SCG_APLLSSCGSTAT_SS_MDIV_ACK(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSSCGSTAT_SS_MDIV_ACK_SHIFT)) & SCG_APLLSSCGSTAT_SS_MDIV_ACK_MASK) -/*! @} */ - -/*! @name APLLSSCG0 - APLL Spread Spectrum Control 0 Register */ -/*! @{ */ - -#define SCG_APLLSSCG0_SS_MDIV_LSB_MASK (0xFFFFFFFFU) -#define SCG_APLLSSCG0_SS_MDIV_LSB_SHIFT (0U) -/*! SS_MDIV_LSB - SS_MDIV */ -#define SCG_APLLSSCG0_SS_MDIV_LSB(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSSCG0_SS_MDIV_LSB_SHIFT)) & SCG_APLLSSCG0_SS_MDIV_LSB_MASK) -/*! @} */ - -/*! @name APLLSSCG1 - APLL Spread Spectrum Control 1 Register */ -/*! @{ */ - -#define SCG_APLLSSCG1_SS_MDIV_MSB_MASK (0x1U) -#define SCG_APLLSSCG1_SS_MDIV_MSB_SHIFT (0U) -/*! SS_MDIV_MSB - SS_MDIV[32] */ -#define SCG_APLLSSCG1_SS_MDIV_MSB(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSSCG1_SS_MDIV_MSB_SHIFT)) & SCG_APLLSSCG1_SS_MDIV_MSB_MASK) - -#define SCG_APLLSSCG1_SS_MDIV_REQ_MASK (0x2U) -#define SCG_APLLSSCG1_SS_MDIV_REQ_SHIFT (1U) -/*! SS_MDIV_REQ - SS_MDIV[32:0] change request. - * 0b0..SS_MDIV change is not requested - * 0b1..SS_MDIV change is requested - */ -#define SCG_APLLSSCG1_SS_MDIV_REQ(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSSCG1_SS_MDIV_REQ_SHIFT)) & SCG_APLLSSCG1_SS_MDIV_REQ_MASK) - -#define SCG_APLLSSCG1_MF_MASK (0x1CU) -#define SCG_APLLSSCG1_MF_SHIFT (2U) -/*! MF - Modulation Frequency Control */ -#define SCG_APLLSSCG1_MF(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSSCG1_MF_SHIFT)) & SCG_APLLSSCG1_MF_MASK) - -#define SCG_APLLSSCG1_MR_MASK (0xE0U) -#define SCG_APLLSSCG1_MR_SHIFT (5U) -/*! MR - Modulation Depth Control */ -#define SCG_APLLSSCG1_MR(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSSCG1_MR_SHIFT)) & SCG_APLLSSCG1_MR_MASK) - -#define SCG_APLLSSCG1_MC_MASK (0x300U) -#define SCG_APLLSSCG1_MC_SHIFT (8U) -/*! MC - Modulation Waveform Control - * 0b00..MC[1:0] no compensation - * 0b11..MC[1:0] maximum compensation - */ -#define SCG_APLLSSCG1_MC(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSSCG1_MC_SHIFT)) & SCG_APLLSSCG1_MC_MASK) - -#define SCG_APLLSSCG1_DITHER_MASK (0x400U) -#define SCG_APLLSSCG1_DITHER_SHIFT (10U) -/*! DITHER - Dither Enable - * 0b0..Dither is not enabled - * 0b1..Dither is enabled - */ -#define SCG_APLLSSCG1_DITHER(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSSCG1_DITHER_SHIFT)) & SCG_APLLSSCG1_DITHER_MASK) - -#define SCG_APLLSSCG1_SEL_SS_MDIV_MASK (0x800U) -#define SCG_APLLSSCG1_SEL_SS_MDIV_SHIFT (11U) -/*! SEL_SS_MDIV - SS_MDIV select. - * 0b0..Feedback divider ratio is MDIV[15:0] - * 0b1..Feedback divider ratio is SS_MDIV[32:0] - */ -#define SCG_APLLSSCG1_SEL_SS_MDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSSCG1_SEL_SS_MDIV_SHIFT)) & SCG_APLLSSCG1_SEL_SS_MDIV_MASK) - -#define SCG_APLLSSCG1_SS_PD_MASK (0x80000000U) -#define SCG_APLLSSCG1_SS_PD_SHIFT (31U) -/*! SS_PD - SSCG Power Down - * 0b0..SSCG is powered on - * 0b1..SSCG is powered off - */ -#define SCG_APLLSSCG1_SS_PD(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSSCG1_SS_PD_SHIFT)) & SCG_APLLSSCG1_SS_PD_MASK) -/*! @} */ - -/*! @name APLL_OVRD - APLL Override Register */ -/*! @{ */ - -#define SCG_APLL_OVRD_APLLPWREN_OVRD_MASK (0x1U) -#define SCG_APLL_OVRD_APLLPWREN_OVRD_SHIFT (0U) -/*! APLLPWREN_OVRD - APLL Power Enable Override if APLL_OVRD_EN=1 - * 0b0..APLL clock is powered off - * 0b1..APLL clock is powered on - */ -#define SCG_APLL_OVRD_APLLPWREN_OVRD(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLL_OVRD_APLLPWREN_OVRD_SHIFT)) & SCG_APLL_OVRD_APLLPWREN_OVRD_MASK) - -#define SCG_APLL_OVRD_APLLCLKEN_OVRD_MASK (0x2U) -#define SCG_APLL_OVRD_APLLCLKEN_OVRD_SHIFT (1U) -/*! APLLCLKEN_OVRD - APLL Clock Enable Override if APLL_OVRD_EN=1 - * 0b0..APLL clock is disabled - * 0b1..APLL clock is enabled - */ -#define SCG_APLL_OVRD_APLLCLKEN_OVRD(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLL_OVRD_APLLCLKEN_OVRD_SHIFT)) & SCG_APLL_OVRD_APLLCLKEN_OVRD_MASK) - -#define SCG_APLL_OVRD_APLL_OVRD_EN_MASK (0x80000000U) -#define SCG_APLL_OVRD_APLL_OVRD_EN_SHIFT (31U) -/*! APLL_OVRD_EN - APLL Override Enable - * 0b0..APLL override is disabled - * 0b1..APLL override is enabled - */ -#define SCG_APLL_OVRD_APLL_OVRD_EN(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLL_OVRD_APLL_OVRD_EN_SHIFT)) & SCG_APLL_OVRD_APLL_OVRD_EN_MASK) -/*! @} */ - -/*! @name SPLLCSR - SPLL Control Status Register */ -/*! @{ */ - -#define SCG_SPLLCSR_SPLLPWREN_MASK (0x1U) -#define SCG_SPLLCSR_SPLLPWREN_SHIFT (0U) -/*! SPLLPWREN - SPLL Power Enable - * 0b0..SPLL clock is powered off - * 0b1..SPLL clock is powered on - */ -#define SCG_SPLLCSR_SPLLPWREN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_SPLLPWREN_SHIFT)) & SCG_SPLLCSR_SPLLPWREN_MASK) - -#define SCG_SPLLCSR_SPLLCLKEN_MASK (0x2U) -#define SCG_SPLLCSR_SPLLCLKEN_SHIFT (1U) -/*! SPLLCLKEN - SPLL Clock Enable - * 0b0..SPLL clock is disabled - * 0b1..SPLL clock is enabled - */ -#define SCG_SPLLCSR_SPLLCLKEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_SPLLCLKEN_SHIFT)) & SCG_SPLLCSR_SPLLCLKEN_MASK) - -#define SCG_SPLLCSR_SPLLSTEN_MASK (0x4U) -#define SCG_SPLLCSR_SPLLSTEN_SHIFT (2U) -/*! SPLLSTEN - SPLL Stop Enable - * 0b0..SPLL is disabled in Deep Sleep mode - * 0b1..SPLL is enabled in Deep Sleep mode - */ -#define SCG_SPLLCSR_SPLLSTEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_SPLLSTEN_SHIFT)) & SCG_SPLLCSR_SPLLSTEN_MASK) - -#define SCG_SPLLCSR_FRM_CLOCKSTABLE_MASK (0x8U) -#define SCG_SPLLCSR_FRM_CLOCKSTABLE_SHIFT (3U) -/*! FRM_CLOCKSTABLE - Free running mode clock stable - * 0b0..Free running mode clockstable is disabled - * 0b1..Free running mode clockstable is enabled - */ -#define SCG_SPLLCSR_FRM_CLOCKSTABLE(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_FRM_CLOCKSTABLE_SHIFT)) & SCG_SPLLCSR_FRM_CLOCKSTABLE_MASK) - -#define SCG_SPLLCSR_SPLLCM_MASK (0x10000U) -#define SCG_SPLLCSR_SPLLCM_SHIFT (16U) -/*! SPLLCM - SPLL Clock Monitor - * 0b0..SPLL Clock Monitor is disabled - * 0b1..SPLL Clock Monitor is enabled - */ -#define SCG_SPLLCSR_SPLLCM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_SPLLCM_SHIFT)) & SCG_SPLLCSR_SPLLCM_MASK) - -#define SCG_SPLLCSR_SPLLCMRE_MASK (0x20000U) -#define SCG_SPLLCSR_SPLLCMRE_SHIFT (17U) -/*! SPLLCMRE - SPLL Clock Monitor Reset Enable - * 0b0..Clock monitor generates an interrupt when an error is detected - * 0b1..Clock monitor generates a reset when an error is detected - */ -#define SCG_SPLLCSR_SPLLCMRE(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_SPLLCMRE_SHIFT)) & SCG_SPLLCSR_SPLLCMRE_MASK) - -#define SCG_SPLLCSR_LK_MASK (0x800000U) -#define SCG_SPLLCSR_LK_SHIFT (23U) -/*! LK - Lock Register - * 0b0..Control Status Register can be written - * 0b1..Control Status Register cannot be written - */ -#define SCG_SPLLCSR_LK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_LK_SHIFT)) & SCG_SPLLCSR_LK_MASK) - -#define SCG_SPLLCSR_SPLL_LOCK_MASK (0x1000000U) -#define SCG_SPLLCSR_SPLL_LOCK_SHIFT (24U) -/*! SPLL_LOCK - SPLL LOCK - * 0b0..SPLL is not powered on or not locked - * 0b1..SPLL is locked - */ -#define SCG_SPLLCSR_SPLL_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_SPLL_LOCK_SHIFT)) & SCG_SPLLCSR_SPLL_LOCK_MASK) - -#define SCG_SPLLCSR_SPLLSEL_MASK (0x2000000U) -#define SCG_SPLLCSR_SPLLSEL_SHIFT (25U) -/*! SPLLSEL - SPLL Selected - * 0b0..SPLL is not the system clock source - * 0b1..SPLL is the system clock source - */ -#define SCG_SPLLCSR_SPLLSEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_SPLLSEL_SHIFT)) & SCG_SPLLCSR_SPLLSEL_MASK) - -#define SCG_SPLLCSR_SPLLERR_MASK (0x4000000U) -#define SCG_SPLLCSR_SPLLERR_SHIFT (26U) -/*! SPLLERR - SPLL Clock Error - * 0b0..SPLL Clock Monitor is disabled or has not detected an error - * 0b1..SPLL Clock Monitor is enabled and detected an error - */ -#define SCG_SPLLCSR_SPLLERR(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_SPLLERR_SHIFT)) & SCG_SPLLCSR_SPLLERR_MASK) - -#define SCG_SPLLCSR_SPLL_LOCK_IE_MASK (0x40000000U) -#define SCG_SPLLCSR_SPLL_LOCK_IE_SHIFT (30U) -/*! SPLL_LOCK_IE - SPLL LOCK Interrupt Enable - * 0b0..SPLL_LOCK interrupt is not enabled - * 0b1..SPLL_LOCK interrupt is enabled - */ -#define SCG_SPLLCSR_SPLL_LOCK_IE(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_SPLL_LOCK_IE_SHIFT)) & SCG_SPLLCSR_SPLL_LOCK_IE_MASK) -/*! @} */ - -/*! @name SPLLCTRL - SPLL Control Register */ -/*! @{ */ - -#define SCG_SPLLCTRL_SELR_MASK (0xFU) -#define SCG_SPLLCTRL_SELR_SHIFT (0U) -/*! SELR - Bandwidth select R (resistor) value. */ -#define SCG_SPLLCTRL_SELR(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCTRL_SELR_SHIFT)) & SCG_SPLLCTRL_SELR_MASK) - -#define SCG_SPLLCTRL_SELI_MASK (0x3F0U) -#define SCG_SPLLCTRL_SELI_SHIFT (4U) -/*! SELI - Bandwidth select I (integration) value. */ -#define SCG_SPLLCTRL_SELI(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCTRL_SELI_SHIFT)) & SCG_SPLLCTRL_SELI_MASK) - -#define SCG_SPLLCTRL_SELP_MASK (0x7C00U) -#define SCG_SPLLCTRL_SELP_SHIFT (10U) -/*! SELP - Bandwidth select P (proportional) value. */ -#define SCG_SPLLCTRL_SELP(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCTRL_SELP_SHIFT)) & SCG_SPLLCTRL_SELP_MASK) - -#define SCG_SPLLCTRL_BYPASSPOSTDIV2_MASK (0x10000U) -#define SCG_SPLLCTRL_BYPASSPOSTDIV2_SHIFT (16U) -/*! BYPASSPOSTDIV2 - Bypass of Divide-by-2 Divider - * 0b0..Use the divide-by-2 divider in the postdivider. - * 0b1..Bypass of the divide-by-2 divider in the postdivider - */ -#define SCG_SPLLCTRL_BYPASSPOSTDIV2(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCTRL_BYPASSPOSTDIV2_SHIFT)) & SCG_SPLLCTRL_BYPASSPOSTDIV2_MASK) - -#define SCG_SPLLCTRL_LIMUPOFF_MASK (0x20000U) -#define SCG_SPLLCTRL_LIMUPOFF_SHIFT (17U) -/*! LIMUPOFF - Up Limiter. - * 0b0..Application set to non-Spectrum and Fractional applications. - * 0b1..Application set to Spectrum and Fractional applications. - */ -#define SCG_SPLLCTRL_LIMUPOFF(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCTRL_LIMUPOFF_SHIFT)) & SCG_SPLLCTRL_LIMUPOFF_MASK) - -#define SCG_SPLLCTRL_BANDDIRECT_MASK (0x40000U) -#define SCG_SPLLCTRL_BANDDIRECT_SHIFT (18U) -/*! BANDDIRECT - Control of the bandwidth of the PLL. - * 0b0..The bandwidth is changed synchronously with the feedback-divider - * 0b1..Modifies the bandwidth of the PLL directly - */ -#define SCG_SPLLCTRL_BANDDIRECT(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCTRL_BANDDIRECT_SHIFT)) & SCG_SPLLCTRL_BANDDIRECT_MASK) - -#define SCG_SPLLCTRL_BYPASSPREDIV_MASK (0x80000U) -#define SCG_SPLLCTRL_BYPASSPREDIV_SHIFT (19U) -/*! BYPASSPREDIV - Bypass of the predivider. - * 0b0..Use the predivider - * 0b1..Bypass of the predivider - */ -#define SCG_SPLLCTRL_BYPASSPREDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCTRL_BYPASSPREDIV_SHIFT)) & SCG_SPLLCTRL_BYPASSPREDIV_MASK) - -#define SCG_SPLLCTRL_BYPASSPOSTDIV_MASK (0x100000U) -#define SCG_SPLLCTRL_BYPASSPOSTDIV_SHIFT (20U) -/*! BYPASSPOSTDIV - Bypass of the postdivider. - * 0b0..Use the postdivider - * 0b1..Bypass of the postdivider - */ -#define SCG_SPLLCTRL_BYPASSPOSTDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCTRL_BYPASSPOSTDIV_SHIFT)) & SCG_SPLLCTRL_BYPASSPOSTDIV_MASK) - -#define SCG_SPLLCTRL_FRM_MASK (0x400000U) -#define SCG_SPLLCTRL_FRM_SHIFT (22U) -/*! FRM - Free Running Mode Enable - * 0b0..Free running mode disabled - * 0b1..Free running mode enabled - */ -#define SCG_SPLLCTRL_FRM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCTRL_FRM_SHIFT)) & SCG_SPLLCTRL_FRM_MASK) - -#define SCG_SPLLCTRL_SOURCE_MASK (0x6000000U) -#define SCG_SPLLCTRL_SOURCE_SHIFT (25U) -/*! SOURCE - Clock Source - * 0b00..SOSC - * 0b01..FIRC 48 MHz clock. FIRC_SCLK_PERIPH_EN must be set to use FIRC 48 MHz clock. - * 0b10..ROSC - * 0b11..No clock - */ -#define SCG_SPLLCTRL_SOURCE(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCTRL_SOURCE_SHIFT)) & SCG_SPLLCTRL_SOURCE_MASK) -/*! @} */ - -/*! @name SPLLSTAT - SPLL Status Register */ -/*! @{ */ - -#define SCG_SPLLSTAT_NDIVACK_MASK (0x2U) -#define SCG_SPLLSTAT_NDIVACK_SHIFT (1U) -/*! NDIVACK - Predivider (N) ratio change acknowledge - * 0b0..The predivider (N) ratio change is not accepted by the analog PLL. - * 0b1..The predivider (N) ratio change is accepted by the analog PLL. - */ -#define SCG_SPLLSTAT_NDIVACK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSTAT_NDIVACK_SHIFT)) & SCG_SPLLSTAT_NDIVACK_MASK) - -#define SCG_SPLLSTAT_MDIVACK_MASK (0x4U) -#define SCG_SPLLSTAT_MDIVACK_SHIFT (2U) -/*! MDIVACK - Feedback (M) divider ratio change acknowledge - * 0b0..The feedback (M) ratio change is not accepted by the analog PLL. - * 0b1..The feedback (M) ratio change is accepted by the analog PLL. - */ -#define SCG_SPLLSTAT_MDIVACK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSTAT_MDIVACK_SHIFT)) & SCG_SPLLSTAT_MDIVACK_MASK) - -#define SCG_SPLLSTAT_PDIVACK_MASK (0x8U) -#define SCG_SPLLSTAT_PDIVACK_SHIFT (3U) -/*! PDIVACK - Postdivider (P) ratio change acknowledge - * 0b0..The postdivider (P) ratio change is not accepted by the analog PLL - * 0b1..The postdivider (P) ratio change is accepted by the analog PLL - */ -#define SCG_SPLLSTAT_PDIVACK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSTAT_PDIVACK_SHIFT)) & SCG_SPLLSTAT_PDIVACK_MASK) - -#define SCG_SPLLSTAT_FRMDET_MASK (0x10U) -#define SCG_SPLLSTAT_FRMDET_SHIFT (4U) -/*! FRMDET - Free running detector (active high) - * 0b0..Free running is not detected - * 0b1..Free running is detected - */ -#define SCG_SPLLSTAT_FRMDET(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSTAT_FRMDET_SHIFT)) & SCG_SPLLSTAT_FRMDET_MASK) -/*! @} */ - -/*! @name SPLLNDIV - SPLL N Divider Register */ -/*! @{ */ - -#define SCG_SPLLNDIV_NDIV_MASK (0xFFU) -#define SCG_SPLLNDIV_NDIV_SHIFT (0U) -/*! NDIV - Predivider divider ratio (N-divider). */ -#define SCG_SPLLNDIV_NDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLNDIV_NDIV_SHIFT)) & SCG_SPLLNDIV_NDIV_MASK) - -#define SCG_SPLLNDIV_NREQ_MASK (0x80000000U) -#define SCG_SPLLNDIV_NREQ_SHIFT (31U) -/*! NREQ - Predivider ratio change request. - * 0b0..Predivider ratio change is not requested - * 0b1..Predivider ratio change is requested - */ -#define SCG_SPLLNDIV_NREQ(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLNDIV_NREQ_SHIFT)) & SCG_SPLLNDIV_NREQ_MASK) -/*! @} */ - -/*! @name SPLLMDIV - SPLL M Divider Register */ -/*! @{ */ - -#define SCG_SPLLMDIV_MDIV_MASK (0xFFFFU) -#define SCG_SPLLMDIV_MDIV_SHIFT (0U) -/*! MDIV - Feedback divider divider ratio (M-divider). */ -#define SCG_SPLLMDIV_MDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLMDIV_MDIV_SHIFT)) & SCG_SPLLMDIV_MDIV_MASK) - -#define SCG_SPLLMDIV_MREQ_MASK (0x80000000U) -#define SCG_SPLLMDIV_MREQ_SHIFT (31U) -/*! MREQ - Feedback ratio change request. - * 0b0..Feedback ratio change is not requested - * 0b1..Feedback ratio change is requested - */ -#define SCG_SPLLMDIV_MREQ(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLMDIV_MREQ_SHIFT)) & SCG_SPLLMDIV_MREQ_MASK) -/*! @} */ - -/*! @name SPLLPDIV - SPLL P Divider Register */ -/*! @{ */ - -#define SCG_SPLLPDIV_PDIV_MASK (0x1FU) -#define SCG_SPLLPDIV_PDIV_SHIFT (0U) -/*! PDIV - Postdivider divider ratio (P-divider) */ -#define SCG_SPLLPDIV_PDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLPDIV_PDIV_SHIFT)) & SCG_SPLLPDIV_PDIV_MASK) - -#define SCG_SPLLPDIV_PREQ_MASK (0x80000000U) -#define SCG_SPLLPDIV_PREQ_SHIFT (31U) -/*! PREQ - Postdivider ratio change request - * 0b0..Postdivider ratio change is not requested - * 0b1..Postdivider ratio change is requested - */ -#define SCG_SPLLPDIV_PREQ(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLPDIV_PREQ_SHIFT)) & SCG_SPLLPDIV_PREQ_MASK) -/*! @} */ - -/*! @name SPLLLOCK_CNFG - SPLL LOCK Configuration Register */ -/*! @{ */ - -#define SCG_SPLLLOCK_CNFG_LOCK_TIME_MASK (0x1FFFFU) -#define SCG_SPLLLOCK_CNFG_LOCK_TIME_SHIFT (0U) -/*! LOCK_TIME - Configures the number of reference clocks to count before SPLL is considered locked. */ -#define SCG_SPLLLOCK_CNFG_LOCK_TIME(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLLOCK_CNFG_LOCK_TIME_SHIFT)) & SCG_SPLLLOCK_CNFG_LOCK_TIME_MASK) -/*! @} */ - -/*! @name SPLLSSCGSTAT - SPLL SSCG Status Register */ -/*! @{ */ - -#define SCG_SPLLSSCGSTAT_SS_MDIV_ACK_MASK (0x1U) -#define SCG_SPLLSSCGSTAT_SS_MDIV_ACK_SHIFT (0U) -/*! SS_MDIV_ACK - SS_MDIV change acknowledge - * 0b0..The SS_MDIV, MF, MR, and MC ratio change is not accepted by the analog PLL - * 0b1..The SS_MDIV, MF, MR, and MC ratio change is accepted by the analog PLL - */ -#define SCG_SPLLSSCGSTAT_SS_MDIV_ACK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSSCGSTAT_SS_MDIV_ACK_SHIFT)) & SCG_SPLLSSCGSTAT_SS_MDIV_ACK_MASK) -/*! @} */ - -/*! @name SPLLSSCG0 - SPLL Spread Spectrum Control 0 Register */ -/*! @{ */ - -#define SCG_SPLLSSCG0_SS_MDIV_LSB_MASK (0xFFFFFFFFU) -#define SCG_SPLLSSCG0_SS_MDIV_LSB_SHIFT (0U) -/*! SS_MDIV_LSB - SS_MDIV[31:0] */ -#define SCG_SPLLSSCG0_SS_MDIV_LSB(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSSCG0_SS_MDIV_LSB_SHIFT)) & SCG_SPLLSSCG0_SS_MDIV_LSB_MASK) -/*! @} */ - -/*! @name SPLLSSCG1 - SPLL Spread Spectrum Control 1 Register */ -/*! @{ */ - -#define SCG_SPLLSSCG1_SS_MDIV_MSB_MASK (0x1U) -#define SCG_SPLLSSCG1_SS_MDIV_MSB_SHIFT (0U) -/*! SS_MDIV_MSB - SS_MDIV[32] */ -#define SCG_SPLLSSCG1_SS_MDIV_MSB(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSSCG1_SS_MDIV_MSB_SHIFT)) & SCG_SPLLSSCG1_SS_MDIV_MSB_MASK) - -#define SCG_SPLLSSCG1_SS_MDIV_REQ_MASK (0x2U) -#define SCG_SPLLSSCG1_SS_MDIV_REQ_SHIFT (1U) -/*! SS_MDIV_REQ - SS_MDIV[32:0] change request. - * 0b0..SS_MDIV change is not requested - * 0b1..SS_MDIV change is requested - */ -#define SCG_SPLLSSCG1_SS_MDIV_REQ(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSSCG1_SS_MDIV_REQ_SHIFT)) & SCG_SPLLSSCG1_SS_MDIV_REQ_MASK) - -#define SCG_SPLLSSCG1_MF_MASK (0x1CU) -#define SCG_SPLLSSCG1_MF_SHIFT (2U) -/*! MF - Modulation Frequency Control */ -#define SCG_SPLLSSCG1_MF(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSSCG1_MF_SHIFT)) & SCG_SPLLSSCG1_MF_MASK) - -#define SCG_SPLLSSCG1_MR_MASK (0xE0U) -#define SCG_SPLLSSCG1_MR_SHIFT (5U) -/*! MR - Modulation Depth Control */ -#define SCG_SPLLSSCG1_MR(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSSCG1_MR_SHIFT)) & SCG_SPLLSSCG1_MR_MASK) - -#define SCG_SPLLSSCG1_MC_MASK (0x300U) -#define SCG_SPLLSSCG1_MC_SHIFT (8U) -/*! MC - Modulation Waveform Control - * 0b00..MC[1:0] no compensation - * 0b11..MC[1:0] maximum compensation - */ -#define SCG_SPLLSSCG1_MC(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSSCG1_MC_SHIFT)) & SCG_SPLLSSCG1_MC_MASK) - -#define SCG_SPLLSSCG1_DITHER_MASK (0x400U) -#define SCG_SPLLSSCG1_DITHER_SHIFT (10U) -/*! DITHER - Dither Enable - * 0b0..Dither is not enabled - * 0b1..Dither is enabled - */ -#define SCG_SPLLSSCG1_DITHER(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSSCG1_DITHER_SHIFT)) & SCG_SPLLSSCG1_DITHER_MASK) - -#define SCG_SPLLSSCG1_SEL_SS_MDIV_MASK (0x800U) -#define SCG_SPLLSSCG1_SEL_SS_MDIV_SHIFT (11U) -/*! SEL_SS_MDIV - SS_MDIV select. - * 0b0..Feedback divider ratio is MDIV[15:0] - * 0b1..Feedback divider ratio is SS_MDIV[32:0] - */ -#define SCG_SPLLSSCG1_SEL_SS_MDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSSCG1_SEL_SS_MDIV_SHIFT)) & SCG_SPLLSSCG1_SEL_SS_MDIV_MASK) - -#define SCG_SPLLSSCG1_SS_PD_MASK (0x80000000U) -#define SCG_SPLLSSCG1_SS_PD_SHIFT (31U) -/*! SS_PD - SSCG Power Down - * 0b0..SSCG is powered on - * 0b1..SSCG is powered off - */ -#define SCG_SPLLSSCG1_SS_PD(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSSCG1_SS_PD_SHIFT)) & SCG_SPLLSSCG1_SS_PD_MASK) -/*! @} */ - -/*! @name SPLL_OVRD - SPLL Override Register */ -/*! @{ */ - -#define SCG_SPLL_OVRD_SPLLPWREN_OVRD_MASK (0x1U) -#define SCG_SPLL_OVRD_SPLLPWREN_OVRD_SHIFT (0U) -/*! SPLLPWREN_OVRD - SPLL Power Enable Override if SPLL_OVRD_EN=1 - * 0b0..SPLL clock is powered off - * 0b1..SPLL clock is powered on - */ -#define SCG_SPLL_OVRD_SPLLPWREN_OVRD(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLL_OVRD_SPLLPWREN_OVRD_SHIFT)) & SCG_SPLL_OVRD_SPLLPWREN_OVRD_MASK) - -#define SCG_SPLL_OVRD_SPLLCLKEN_OVRD_MASK (0x2U) -#define SCG_SPLL_OVRD_SPLLCLKEN_OVRD_SHIFT (1U) -/*! SPLLCLKEN_OVRD - SPLL Clock Enable Override if SPLL_OVRD_EN=1 - * 0b0..SPLL clock is disabled - * 0b1..SPLL clock is enabled - */ -#define SCG_SPLL_OVRD_SPLLCLKEN_OVRD(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLL_OVRD_SPLLCLKEN_OVRD_SHIFT)) & SCG_SPLL_OVRD_SPLLCLKEN_OVRD_MASK) - -#define SCG_SPLL_OVRD_SPLL_OVRD_EN_MASK (0x80000000U) -#define SCG_SPLL_OVRD_SPLL_OVRD_EN_SHIFT (31U) -/*! SPLL_OVRD_EN - SPLL Override Enable - * 0b0..SPLL override is disabled - * 0b1..SPLL override is enabled - */ -#define SCG_SPLL_OVRD_SPLL_OVRD_EN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLL_OVRD_SPLL_OVRD_EN_SHIFT)) & SCG_SPLL_OVRD_SPLL_OVRD_EN_MASK) -/*! @} */ - -/*! @name UPLLCSR - UPLL Control Status Register */ -/*! @{ */ - -#define SCG_UPLLCSR_UPLLCM_MASK (0x10000U) -#define SCG_UPLLCSR_UPLLCM_SHIFT (16U) -/*! UPLLCM - UPLL Clock Monitor - * 0b0..UPLL Clock Monitor is disabled - * 0b1..UPLL Clock Monitor is enabled - */ -#define SCG_UPLLCSR_UPLLCM(x) (((uint32_t)(((uint32_t)(x)) << SCG_UPLLCSR_UPLLCM_SHIFT)) & SCG_UPLLCSR_UPLLCM_MASK) - -#define SCG_UPLLCSR_UPLLCMRE_MASK (0x20000U) -#define SCG_UPLLCSR_UPLLCMRE_SHIFT (17U) -/*! UPLLCMRE - UPLL Clock Monitor Reset Enable - * 0b0..Clock monitor generates an interrupt when an error is detected - * 0b1..Clock monitor generates a reset when an error is detected - */ -#define SCG_UPLLCSR_UPLLCMRE(x) (((uint32_t)(((uint32_t)(x)) << SCG_UPLLCSR_UPLLCMRE_SHIFT)) & SCG_UPLLCSR_UPLLCMRE_MASK) - -#define SCG_UPLLCSR_LK_MASK (0x800000U) -#define SCG_UPLLCSR_LK_SHIFT (23U) -/*! LK - Lock Register - * 0b0..Control Status Register can be written - * 0b1..Control Status Register cannot be written - */ -#define SCG_UPLLCSR_LK(x) (((uint32_t)(((uint32_t)(x)) << SCG_UPLLCSR_LK_SHIFT)) & SCG_UPLLCSR_LK_MASK) - -#define SCG_UPLLCSR_UPLLVLD_MASK (0x1000000U) -#define SCG_UPLLCSR_UPLLVLD_SHIFT (24U) -/*! UPLLVLD - UPLL Valid - * 0b0..UPLL is not enabled or clock is not valid - * 0b1..UPLL is enabled and output clock is valid - */ -#define SCG_UPLLCSR_UPLLVLD(x) (((uint32_t)(((uint32_t)(x)) << SCG_UPLLCSR_UPLLVLD_SHIFT)) & SCG_UPLLCSR_UPLLVLD_MASK) - -#define SCG_UPLLCSR_UPLLSEL_MASK (0x2000000U) -#define SCG_UPLLCSR_UPLLSEL_SHIFT (25U) -/*! UPLLSEL - UPLL Selected - * 0b0..UPLL is not the system clock source - * 0b1..UPLL is the system clock source - */ -#define SCG_UPLLCSR_UPLLSEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_UPLLCSR_UPLLSEL_SHIFT)) & SCG_UPLLCSR_UPLLSEL_MASK) - -#define SCG_UPLLCSR_UPLLERR_MASK (0x4000000U) -#define SCG_UPLLCSR_UPLLERR_SHIFT (26U) -/*! UPLLERR - UPLL Clock Error - * 0b0..UPLL Clock Monitor is disabled or has not detected an error - * 0b1..UPLL Clock Monitor is enabled and detected an error - */ -#define SCG_UPLLCSR_UPLLERR(x) (((uint32_t)(((uint32_t)(x)) << SCG_UPLLCSR_UPLLERR_SHIFT)) & SCG_UPLLCSR_UPLLERR_MASK) - -#define SCG_UPLLCSR_UPLLVOR_MASK (0x40000000U) -#define SCG_UPLLCSR_UPLLVOR_SHIFT (30U) -/*! UPLLVOR - USB PLL Valid Flag Override Value - * 0b0..Override to 0b - * 0b1..Override to 1b - */ -#define SCG_UPLLCSR_UPLLVOR(x) (((uint32_t)(((uint32_t)(x)) << SCG_UPLLCSR_UPLLVOR_SHIFT)) & SCG_UPLLCSR_UPLLVOR_MASK) - -#define SCG_UPLLCSR_UPLLVORE_MASK (0x80000000U) -#define SCG_UPLLCSR_UPLLVORE_SHIFT (31U) -/*! UPLLVORE - USB PLL Valid Flag Override Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SCG_UPLLCSR_UPLLVORE(x) (((uint32_t)(((uint32_t)(x)) << SCG_UPLLCSR_UPLLVORE_SHIFT)) & SCG_UPLLCSR_UPLLVORE_MASK) -/*! @} */ - -/*! @name LDOCSR - LDO Control and Status Register */ -/*! @{ */ - -#define SCG_LDOCSR_LDOEN_MASK (0x1U) -#define SCG_LDOCSR_LDOEN_SHIFT (0U) -/*! LDOEN - LDO Enable - * 0b0..LDO is disabled - * 0b1..LDO is enabled - */ -#define SCG_LDOCSR_LDOEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_LDOCSR_LDOEN_SHIFT)) & SCG_LDOCSR_LDOEN_MASK) - -#define SCG_LDOCSR_VOUT_SEL_MASK (0xEU) -#define SCG_LDOCSR_VOUT_SEL_SHIFT (1U) -/*! VOUT_SEL - LDO output voltage select - * 0b000..VOUT = 1V - * 0b001..VOUT = 1V - * 0b010..VOUT = 1V - * 0b011..VOUT = 1.05V - * 0b100..VOUT = 1.1V - * 0b101..VOUT = 1.15V - * 0b110..VOUT = 1.2V - * 0b111..VOUT = 1.25V - */ -#define SCG_LDOCSR_VOUT_SEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_LDOCSR_VOUT_SEL_SHIFT)) & SCG_LDOCSR_VOUT_SEL_MASK) - -#define SCG_LDOCSR_LDOBYPASS_MASK (0x10U) -#define SCG_LDOCSR_LDOBYPASS_SHIFT (4U) -/*! LDOBYPASS - LDO Bypass - * 0b0..LDO is not bypassed - * 0b1..LDO is bypassed - */ -#define SCG_LDOCSR_LDOBYPASS(x) (((uint32_t)(((uint32_t)(x)) << SCG_LDOCSR_LDOBYPASS_SHIFT)) & SCG_LDOCSR_LDOBYPASS_MASK) - -#define SCG_LDOCSR_VOUT_OK_MASK (0x80000000U) -#define SCG_LDOCSR_VOUT_OK_SHIFT (31U) -/*! VOUT_OK - LDO VOUT OK Inform. - * 0b0..LDO output VOUT is not OK - * 0b1..LDO output VOUT is OK - */ -#define SCG_LDOCSR_VOUT_OK(x) (((uint32_t)(((uint32_t)(x)) << SCG_LDOCSR_VOUT_OK_SHIFT)) & SCG_LDOCSR_VOUT_OK_MASK) -/*! @} */ - -/*! @name TROCSR - TRO Control Status Register */ -/*! @{ */ - -#define SCG_TROCSR_TROCM_MASK (0x10000U) -#define SCG_TROCSR_TROCM_SHIFT (16U) -/*! TROCM - TRO Clock Monitor - * 0b0..TRO Clock Monitor is disabled - * 0b1..TRO Clock Monitor is enabled - */ -#define SCG_TROCSR_TROCM(x) (((uint32_t)(((uint32_t)(x)) << SCG_TROCSR_TROCM_SHIFT)) & SCG_TROCSR_TROCM_MASK) - -#define SCG_TROCSR_TROCMRE_MASK (0x20000U) -#define SCG_TROCSR_TROCMRE_SHIFT (17U) -/*! TROCMRE - TRO Clock Monitor Reset Enable - * 0b0..Clock monitor generates an interrupt when an error is detected - * 0b1..Clock monitor generates a reset when an error is detected - */ -#define SCG_TROCSR_TROCMRE(x) (((uint32_t)(((uint32_t)(x)) << SCG_TROCSR_TROCMRE_SHIFT)) & SCG_TROCSR_TROCMRE_MASK) - -#define SCG_TROCSR_TRO_REFCLK_SEL_MASK (0xC0000U) -#define SCG_TROCSR_TRO_REFCLK_SEL_SHIFT (18U) -/*! TRO_REFCLK_SEL - TRO reference clock selection - * 0b00..SOSC - * 0b01..SIRC - * 0b10..FIRC (144 MHz or 48 MHz, based on RANGE selection) - * 0b11..Reserved - */ -#define SCG_TROCSR_TRO_REFCLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_TROCSR_TRO_REFCLK_SEL_SHIFT)) & SCG_TROCSR_TRO_REFCLK_SEL_MASK) - -#define SCG_TROCSR_LK_MASK (0x800000U) -#define SCG_TROCSR_LK_SHIFT (23U) -/*! LK - Lock Register - * 0b0..Control Status Register can be written - * 0b1..Control Status Register cannot be written - */ -#define SCG_TROCSR_LK(x) (((uint32_t)(((uint32_t)(x)) << SCG_TROCSR_LK_SHIFT)) & SCG_TROCSR_LK_MASK) - -#define SCG_TROCSR_TROVLD_MASK (0x1000000U) -#define SCG_TROCSR_TROVLD_SHIFT (24U) -/*! TROVLD - TRO Valid - * 0b0..TRO is not enabled or clock is not valid - * 0b1..TRO is enabled and output clock is valid - */ -#define SCG_TROCSR_TROVLD(x) (((uint32_t)(((uint32_t)(x)) << SCG_TROCSR_TROVLD_SHIFT)) & SCG_TROCSR_TROVLD_MASK) - -#define SCG_TROCSR_TROSEL_MASK (0x2000000U) -#define SCG_TROCSR_TROSEL_SHIFT (25U) -/*! TROSEL - TRO Selected - * 0b0..TRO is not the system clock source - * 0b1..TRO is the system clock source - */ -#define SCG_TROCSR_TROSEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_TROCSR_TROSEL_SHIFT)) & SCG_TROCSR_TROSEL_MASK) - -#define SCG_TROCSR_TROERR_MASK (0x4000000U) -#define SCG_TROCSR_TROERR_SHIFT (26U) -/*! TROERR - TRO Clock Error - * 0b0..TRO clock monitor is disabled or has not detected an error - * 0b1..TRO clock monitor is enabled and detected an error - */ -#define SCG_TROCSR_TROERR(x) (((uint32_t)(((uint32_t)(x)) << SCG_TROCSR_TROERR_SHIFT)) & SCG_TROCSR_TROERR_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group SCG_Register_Masks */ - - -/* SCG - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral SCG0 base address */ - #define SCG0_BASE (0x50044000u) - /** Peripheral SCG0 base address */ - #define SCG0_BASE_NS (0x40044000u) - /** Peripheral SCG0 base pointer */ - #define SCG0 ((SCG_Type *)SCG0_BASE) - /** Peripheral SCG0 base pointer */ - #define SCG0_NS ((SCG_Type *)SCG0_BASE_NS) - /** Array initializer of SCG peripheral base addresses */ - #define SCG_BASE_ADDRS { SCG0_BASE } - /** Array initializer of SCG peripheral base pointers */ - #define SCG_BASE_PTRS { SCG0 } - /** Array initializer of SCG peripheral base addresses */ - #define SCG_BASE_ADDRS_NS { SCG0_BASE_NS } - /** Array initializer of SCG peripheral base pointers */ - #define SCG_BASE_PTRS_NS { SCG0_NS } -#else - /** Peripheral SCG0 base address */ - #define SCG0_BASE (0x40044000u) - /** Peripheral SCG0 base pointer */ - #define SCG0 ((SCG_Type *)SCG0_BASE) - /** Array initializer of SCG peripheral base addresses */ - #define SCG_BASE_ADDRS { SCG0_BASE } - /** Array initializer of SCG peripheral base pointers */ - #define SCG_BASE_PTRS { SCG0 } -#endif - -/*! - * @} - */ /* end of group SCG_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- SMARTDMA Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SMARTDMA_Peripheral_Access_Layer SMARTDMA Peripheral Access Layer - * @{ - */ - -/** SMARTDMA - Register Layout Typedef */ -typedef struct { - uint8_t RESERVED_0[32]; - __IO uint32_t BOOTADR; /**< Boot Address, offset: 0x20 */ - __IO uint32_t CTRL; /**< Control, offset: 0x24 */ - __I uint32_t PC; /**< Program Counter, offset: 0x28 */ - __I uint32_t SP; /**< Stack Pointer, offset: 0x2C */ - __IO uint32_t BREAK_ADDR; /**< Breakpoint Address, offset: 0x30 */ - __IO uint32_t BREAK_VECT; /**< Breakpoint Vector, offset: 0x34 */ - __IO uint32_t EMER_VECT; /**< Emergency Vector, offset: 0x38 */ - __IO uint32_t EMER_SEL; /**< Emergency Select, offset: 0x3C */ - __IO uint32_t ARM2EZH; /**< ARM to EZH Interrupt Control, offset: 0x40 */ - __IO uint32_t EZH2ARM; /**< EZH to ARM Trigger, offset: 0x44 */ - __IO uint32_t PENDTRAP; /**< Pending Trap Control, offset: 0x48 */ -} SMARTDMA_Type; - -/* ---------------------------------------------------------------------------- - -- SMARTDMA Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SMARTDMA_Register_Masks SMARTDMA Register Masks - * @{ - */ - -/*! @name BOOTADR - Boot Address */ -/*! @{ */ - -#define SMARTDMA_BOOTADR_ADDR_MASK (0xFFFFFFFCU) -#define SMARTDMA_BOOTADR_ADDR_SHIFT (2U) -/*! ADDR - 32-bit boot address, the boot address should be 4-byte aligned. */ -#define SMARTDMA_BOOTADR_ADDR(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_BOOTADR_ADDR_SHIFT)) & SMARTDMA_BOOTADR_ADDR_MASK) -/*! @} */ - -/*! @name CTRL - Control */ -/*! @{ */ - -#define SMARTDMA_CTRL_START_MASK (0x1U) -#define SMARTDMA_CTRL_START_SHIFT (0U) -/*! START - Start Bit Ignition */ -#define SMARTDMA_CTRL_START(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_CTRL_START_SHIFT)) & SMARTDMA_CTRL_START_MASK) - -#define SMARTDMA_CTRL_EXF_MASK (0x2U) -#define SMARTDMA_CTRL_EXF_SHIFT (1U) -/*! EXF - External Flag */ -#define SMARTDMA_CTRL_EXF(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_CTRL_EXF_SHIFT)) & SMARTDMA_CTRL_EXF_MASK) - -#define SMARTDMA_CTRL_ERRDIS_MASK (0x4U) -#define SMARTDMA_CTRL_ERRDIS_SHIFT (2U) -/*! ERRDIS - Error Disable */ -#define SMARTDMA_CTRL_ERRDIS(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_CTRL_ERRDIS_SHIFT)) & SMARTDMA_CTRL_ERRDIS_MASK) - -#define SMARTDMA_CTRL_BUFEN_MASK (0x8U) -#define SMARTDMA_CTRL_BUFEN_SHIFT (3U) -/*! BUFEN - Buffer Enable */ -#define SMARTDMA_CTRL_BUFEN(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_CTRL_BUFEN_SHIFT)) & SMARTDMA_CTRL_BUFEN_MASK) - -#define SMARTDMA_CTRL_SYNCEN_MASK (0x10U) -#define SMARTDMA_CTRL_SYNCEN_SHIFT (4U) -/*! SYNCEN - Sync Enable */ -#define SMARTDMA_CTRL_SYNCEN(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_CTRL_SYNCEN_SHIFT)) & SMARTDMA_CTRL_SYNCEN_MASK) - -#define SMARTDMA_CTRL_WKEY_MASK (0xFFFF0000U) -#define SMARTDMA_CTRL_WKEY_SHIFT (16U) -/*! WKEY - Write Key */ -#define SMARTDMA_CTRL_WKEY(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_CTRL_WKEY_SHIFT)) & SMARTDMA_CTRL_WKEY_MASK) -/*! @} */ - -/*! @name PC - Program Counter */ -/*! @{ */ - -#define SMARTDMA_PC_PC_MASK (0xFFFFFFFFU) -#define SMARTDMA_PC_PC_SHIFT (0U) -/*! PC - Program Counter */ -#define SMARTDMA_PC_PC(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_PC_PC_SHIFT)) & SMARTDMA_PC_PC_MASK) -/*! @} */ - -/*! @name SP - Stack Pointer */ -/*! @{ */ - -#define SMARTDMA_SP_SP_MASK (0xFFFFFFFFU) -#define SMARTDMA_SP_SP_SHIFT (0U) -/*! SP - Stack Pointer */ -#define SMARTDMA_SP_SP(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_SP_SP_SHIFT)) & SMARTDMA_SP_SP_MASK) -/*! @} */ - -/*! @name BREAK_ADDR - Breakpoint Address */ -/*! @{ */ - -#define SMARTDMA_BREAK_ADDR_ADDR_MASK (0xFFFFFFFCU) -#define SMARTDMA_BREAK_ADDR_ADDR_SHIFT (2U) -/*! ADDR - 32-bit address to swap to EZHB_BREAK_VECT location */ -#define SMARTDMA_BREAK_ADDR_ADDR(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_BREAK_ADDR_ADDR_SHIFT)) & SMARTDMA_BREAK_ADDR_ADDR_MASK) -/*! @} */ - -/*! @name BREAK_VECT - Breakpoint Vector */ -/*! @{ */ - -#define SMARTDMA_BREAK_VECT_VEC_MASK (0xFFFFFFFCU) -#define SMARTDMA_BREAK_VECT_VEC_SHIFT (2U) -/*! VEC - Vector address of user debug routine. */ -#define SMARTDMA_BREAK_VECT_VEC(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_BREAK_VECT_VEC_SHIFT)) & SMARTDMA_BREAK_VECT_VEC_MASK) -/*! @} */ - -/*! @name EMER_VECT - Emergency Vector */ -/*! @{ */ - -#define SMARTDMA_EMER_VECT_VEC_MASK (0xFFFFFFFCU) -#define SMARTDMA_EMER_VECT_VEC_SHIFT (2U) -/*! VEC - Vector address of emergency code routine */ -#define SMARTDMA_EMER_VECT_VEC(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_EMER_VECT_VEC_SHIFT)) & SMARTDMA_EMER_VECT_VEC_MASK) -/*! @} */ - -/*! @name EMER_SEL - Emergency Select */ -/*! @{ */ - -#define SMARTDMA_EMER_SEL_EN_MASK (0x100U) -#define SMARTDMA_EMER_SEL_EN_SHIFT (8U) -/*! EN - Emergency code routine */ -#define SMARTDMA_EMER_SEL_EN(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_EMER_SEL_EN_SHIFT)) & SMARTDMA_EMER_SEL_EN_MASK) - -#define SMARTDMA_EMER_SEL_RQ_MASK (0x200U) -#define SMARTDMA_EMER_SEL_RQ_SHIFT (9U) -/*! RQ - Software emergency request */ -#define SMARTDMA_EMER_SEL_RQ(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_EMER_SEL_RQ_SHIFT)) & SMARTDMA_EMER_SEL_RQ_MASK) -/*! @} */ - -/*! @name ARM2EZH - ARM to EZH Interrupt Control */ -/*! @{ */ - -#define SMARTDMA_ARM2EZH_IE_MASK (0x3U) -#define SMARTDMA_ARM2EZH_IE_SHIFT (0U) -/*! IE - Interrupt Enable */ -#define SMARTDMA_ARM2EZH_IE(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_ARM2EZH_IE_SHIFT)) & SMARTDMA_ARM2EZH_IE_MASK) - -#define SMARTDMA_ARM2EZH_GP_MASK (0xFFFFFFFCU) -#define SMARTDMA_ARM2EZH_GP_SHIFT (2U) -/*! GP - General purpose register bits */ -#define SMARTDMA_ARM2EZH_GP(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_ARM2EZH_GP_SHIFT)) & SMARTDMA_ARM2EZH_GP_MASK) -/*! @} */ - -/*! @name EZH2ARM - EZH to ARM Trigger */ -/*! @{ */ - -#define SMARTDMA_EZH2ARM_GP_MASK (0xFFFFFFFFU) -#define SMARTDMA_EZH2ARM_GP_SHIFT (0U) -/*! GP - General purpose register bits Writing to EZH2ARM triggers the ARM interrupt when ARM2EZH [1:0] == 2h */ -#define SMARTDMA_EZH2ARM_GP(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_EZH2ARM_GP_SHIFT)) & SMARTDMA_EZH2ARM_GP_MASK) -/*! @} */ - -/*! @name PENDTRAP - Pending Trap Control */ -/*! @{ */ - -#define SMARTDMA_PENDTRAP_STATUS_MASK (0xFFU) -#define SMARTDMA_PENDTRAP_STATUS_SHIFT (0U) -/*! STATUS - Status Flag or Pending Trap Request */ -#define SMARTDMA_PENDTRAP_STATUS(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_PENDTRAP_STATUS_SHIFT)) & SMARTDMA_PENDTRAP_STATUS_MASK) - -#define SMARTDMA_PENDTRAP_POL_MASK (0xFF00U) -#define SMARTDMA_PENDTRAP_POL_SHIFT (8U) -/*! POL - Polarity */ -#define SMARTDMA_PENDTRAP_POL(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_PENDTRAP_POL_SHIFT)) & SMARTDMA_PENDTRAP_POL_MASK) - -#define SMARTDMA_PENDTRAP_EN_MASK (0xFF0000U) -#define SMARTDMA_PENDTRAP_EN_SHIFT (16U) -/*! EN - Enable Pending Trap */ -#define SMARTDMA_PENDTRAP_EN(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_PENDTRAP_EN_SHIFT)) & SMARTDMA_PENDTRAP_EN_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group SMARTDMA_Register_Masks */ - - -/* SMARTDMA - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral SMARTDMA0 base address */ - #define SMARTDMA0_BASE (0x50033000u) - /** Peripheral SMARTDMA0 base address */ - #define SMARTDMA0_BASE_NS (0x40033000u) - /** Peripheral SMARTDMA0 base pointer */ - #define SMARTDMA0 ((SMARTDMA_Type *)SMARTDMA0_BASE) - /** Peripheral SMARTDMA0 base pointer */ - #define SMARTDMA0_NS ((SMARTDMA_Type *)SMARTDMA0_BASE_NS) - /** Array initializer of SMARTDMA peripheral base addresses */ - #define SMARTDMA_BASE_ADDRS { SMARTDMA0_BASE } - /** Array initializer of SMARTDMA peripheral base pointers */ - #define SMARTDMA_BASE_PTRS { SMARTDMA0 } - /** Array initializer of SMARTDMA peripheral base addresses */ - #define SMARTDMA_BASE_ADDRS_NS { SMARTDMA0_BASE_NS } - /** Array initializer of SMARTDMA peripheral base pointers */ - #define SMARTDMA_BASE_PTRS_NS { SMARTDMA0_NS } -#else - /** Peripheral SMARTDMA0 base address */ - #define SMARTDMA0_BASE (0x40033000u) - /** Peripheral SMARTDMA0 base pointer */ - #define SMARTDMA0 ((SMARTDMA_Type *)SMARTDMA0_BASE) - /** Array initializer of SMARTDMA peripheral base addresses */ - #define SMARTDMA_BASE_ADDRS { SMARTDMA0_BASE } - /** Array initializer of SMARTDMA peripheral base pointers */ - #define SMARTDMA_BASE_PTRS { SMARTDMA0 } -#endif - -/*! - * @} - */ /* end of group SMARTDMA_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- SPC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SPC_Peripheral_Access_Layer SPC Peripheral Access Layer - * @{ - */ - -/** SPC - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - uint8_t RESERVED_0[12]; - __IO uint32_t SC; /**< Status Control, offset: 0x10 */ - __IO uint32_t CNTRL; /**< SPC Regulator Control, offset: 0x14 */ - uint8_t RESERVED_1[4]; - __IO uint32_t LPREQ_CFG; /**< Low-Power Request Configuration, offset: 0x1C */ - uint8_t RESERVED_2[16]; - __IO uint32_t PD_STATUS[2]; /**< SPC Power Domain Mode Status, array offset: 0x30, array step: 0x4 */ - uint8_t RESERVED_3[8]; - __IO uint32_t SRAMCTL; /**< SRAM Control, offset: 0x40 */ - uint8_t RESERVED_4[188]; - __IO uint32_t ACTIVE_CFG; /**< Active Power Mode Configuration, offset: 0x100 */ - __IO uint32_t ACTIVE_CFG1; /**< Active Power Mode Configuration 1, offset: 0x104 */ - __IO uint32_t LP_CFG; /**< Low-Power Mode Configuration, offset: 0x108 */ - __IO uint32_t LP_CFG1; /**< Low Power Mode Configuration 1, offset: 0x10C */ - uint8_t RESERVED_5[16]; - __IO uint32_t LPWKUP_DELAY; /**< Low Power Wake-Up Delay, offset: 0x120 */ - __IO uint32_t ACTIVE_VDELAY; /**< Active Voltage Trim Delay, offset: 0x124 */ - uint8_t RESERVED_6[8]; - __IO uint32_t VD_STAT; /**< Voltage Detect Status, offset: 0x130 */ - __IO uint32_t VD_CORE_CFG; /**< Core Voltage Detect Configuration, offset: 0x134 */ - __IO uint32_t VD_SYS_CFG; /**< System Voltage Detect Configuration, offset: 0x138 */ - __IO uint32_t VD_IO_CFG; /**< IO Voltage Detect Configuration, offset: 0x13C */ - __IO uint32_t EVD_CFG; /**< External Voltage Domain Configuration, offset: 0x140 */ - __IO uint32_t GLITCH_DETECT_SC; /**< Glitch Detect Status Control, offset: 0x144 */ - uint8_t RESERVED_7[440]; - __IO uint32_t CORELDO_CFG; /**< LDO_CORE Configuration, offset: 0x300 */ - uint8_t RESERVED_8[252]; - __IO uint32_t SYSLDO_CFG; /**< LDO_SYS Configuration, offset: 0x400 */ - uint8_t RESERVED_9[252]; - __IO uint32_t DCDC_CFG; /**< DCDC Configuration, offset: 0x500 */ - __IO uint32_t DCDC_BURST_CFG; /**< DCDC Burst Configuration, offset: 0x504 */ -} SPC_Type; - -/* ---------------------------------------------------------------------------- - -- SPC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SPC_Register_Masks SPC Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define SPC_VERID_FEATURE_MASK (0xFFFFU) -#define SPC_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Standard features - * *.. - */ -#define SPC_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VERID_FEATURE_SHIFT)) & SPC_VERID_FEATURE_MASK) - -#define SPC_VERID_MINOR_MASK (0xFF0000U) -#define SPC_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define SPC_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << SPC_VERID_MINOR_SHIFT)) & SPC_VERID_MINOR_MASK) - -#define SPC_VERID_MAJOR_MASK (0xFF000000U) -#define SPC_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define SPC_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << SPC_VERID_MAJOR_SHIFT)) & SPC_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name SC - Status Control */ -/*! @{ */ - -#define SPC_SC_BUSY_MASK (0x1U) -#define SPC_SC_BUSY_SHIFT (0U) -/*! BUSY - SPC Busy Status Flag - * 0b0..Not busy - * 0b1..Busy - */ -#define SPC_SC_BUSY(x) (((uint32_t)(((uint32_t)(x)) << SPC_SC_BUSY_SHIFT)) & SPC_SC_BUSY_MASK) - -#define SPC_SC_SPC_LP_REQ_MASK (0x2U) -#define SPC_SC_SPC_LP_REQ_SHIFT (1U) -/*! SPC_LP_REQ - SPC Power Mode Configuration Status Flag - * 0b0..SPC is in Active or Sleep mode; the ACTIVE_CFG register has control - * 0b1..All power domains requested low-power mode; SPC entered a low-power state; power-mode configuration based on the LP_CFG register - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_SC_SPC_LP_REQ(x) (((uint32_t)(((uint32_t)(x)) << SPC_SC_SPC_LP_REQ_SHIFT)) & SPC_SC_SPC_LP_REQ_MASK) - -#define SPC_SC_SPC_LP_MODE_MASK (0xF0U) -#define SPC_SC_SPC_LP_MODE_SHIFT (4U) -/*! SPC_LP_MODE - Power Domain Low-Power Mode Request - * 0b0000..Sleep mode with system clock running - * 0b0001..DSLEEP with system clock off - * 0b0010..PDOWN with system clock off - * 0b0100.. - * 0b1000..DPDOWN with system clock off - */ -#define SPC_SC_SPC_LP_MODE(x) (((uint32_t)(((uint32_t)(x)) << SPC_SC_SPC_LP_MODE_SHIFT)) & SPC_SC_SPC_LP_MODE_MASK) - -#define SPC_SC_ISO_CLR_MASK (0x30000U) -#define SPC_SC_ISO_CLR_SHIFT (16U) -/*! ISO_CLR - Isolation Clear Flags */ -#define SPC_SC_ISO_CLR(x) (((uint32_t)(((uint32_t)(x)) << SPC_SC_ISO_CLR_SHIFT)) & SPC_SC_ISO_CLR_MASK) -/*! @} */ - -/*! @name CNTRL - SPC Regulator Control */ -/*! @{ */ - -#define SPC_CNTRL_CORELDO_EN_MASK (0x1U) -#define SPC_CNTRL_CORELDO_EN_SHIFT (0U) -/*! CORELDO_EN - LDO_CORE Regulator Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_CNTRL_CORELDO_EN(x) (((uint32_t)(((uint32_t)(x)) << SPC_CNTRL_CORELDO_EN_SHIFT)) & SPC_CNTRL_CORELDO_EN_MASK) - -#define SPC_CNTRL_SYSLDO_EN_MASK (0x2U) -#define SPC_CNTRL_SYSLDO_EN_SHIFT (1U) -/*! SYSLDO_EN - LDO_SYS Regulator Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_CNTRL_SYSLDO_EN(x) (((uint32_t)(((uint32_t)(x)) << SPC_CNTRL_SYSLDO_EN_SHIFT)) & SPC_CNTRL_SYSLDO_EN_MASK) - -#define SPC_CNTRL_DCDC_EN_MASK (0x4U) -#define SPC_CNTRL_DCDC_EN_SHIFT (2U) -/*! DCDC_EN - DCDC_CORE Regulator Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_CNTRL_DCDC_EN(x) (((uint32_t)(((uint32_t)(x)) << SPC_CNTRL_DCDC_EN_SHIFT)) & SPC_CNTRL_DCDC_EN_MASK) -/*! @} */ - -/*! @name LPREQ_CFG - Low-Power Request Configuration */ -/*! @{ */ - -#define SPC_LPREQ_CFG_LPREQOE_MASK (0x1U) -#define SPC_LPREQ_CFG_LPREQOE_SHIFT (0U) -/*! LPREQOE - Low-Power Request Output Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LPREQ_CFG_LPREQOE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LPREQ_CFG_LPREQOE_SHIFT)) & SPC_LPREQ_CFG_LPREQOE_MASK) - -#define SPC_LPREQ_CFG_LPREQPOL_MASK (0x2U) -#define SPC_LPREQ_CFG_LPREQPOL_SHIFT (1U) -/*! LPREQPOL - Low-Power Request Output Pin Polarity Control - * 0b0..High - * 0b1..Low - */ -#define SPC_LPREQ_CFG_LPREQPOL(x) (((uint32_t)(((uint32_t)(x)) << SPC_LPREQ_CFG_LPREQPOL_SHIFT)) & SPC_LPREQ_CFG_LPREQPOL_MASK) - -#define SPC_LPREQ_CFG_LPREQOV_MASK (0xCU) -#define SPC_LPREQ_CFG_LPREQOV_SHIFT (2U) -/*! LPREQOV - Low-Power Request Output Override - * 0b00..Not forced - * 0b01.. - * 0b10..Forced low (ignore LPREQPOL settings) - * 0b11..Forced high (ignore LPREQPOL settings) - */ -#define SPC_LPREQ_CFG_LPREQOV(x) (((uint32_t)(((uint32_t)(x)) << SPC_LPREQ_CFG_LPREQOV_SHIFT)) & SPC_LPREQ_CFG_LPREQOV_MASK) -/*! @} */ - -/*! @name PD_STATUS - SPC Power Domain Mode Status */ -/*! @{ */ - -#define SPC_PD_STATUS_PWR_REQ_STATUS_MASK (0x1U) -#define SPC_PD_STATUS_PWR_REQ_STATUS_SHIFT (0U) -/*! PWR_REQ_STATUS - Power Request Status Flag - * 0b0..Did not request - * 0b1..Requested - */ -#define SPC_PD_STATUS_PWR_REQ_STATUS(x) (((uint32_t)(((uint32_t)(x)) << SPC_PD_STATUS_PWR_REQ_STATUS_SHIFT)) & SPC_PD_STATUS_PWR_REQ_STATUS_MASK) - -#define SPC_PD_STATUS_PD_LP_REQ_MASK (0x10U) -#define SPC_PD_STATUS_PD_LP_REQ_SHIFT (4U) -/*! PD_LP_REQ - Power Domain Low Power Request Flag - * 0b0..Did not request - * 0b1..Requested - */ -#define SPC_PD_STATUS_PD_LP_REQ(x) (((uint32_t)(((uint32_t)(x)) << SPC_PD_STATUS_PD_LP_REQ_SHIFT)) & SPC_PD_STATUS_PD_LP_REQ_MASK) - -#define SPC_PD_STATUS_LP_MODE_MASK (0xF00U) -#define SPC_PD_STATUS_LP_MODE_SHIFT (8U) -/*! LP_MODE - Power Domain Low Power Mode Request - * 0b0000..SLEEP with system clock running - * 0b0001..DSLEEP with system clock off - * 0b0010..PDOWN with system clock off - * 0b0100.. - * 0b1000..DPDOWN with system clock off - */ -#define SPC_PD_STATUS_LP_MODE(x) (((uint32_t)(((uint32_t)(x)) << SPC_PD_STATUS_LP_MODE_SHIFT)) & SPC_PD_STATUS_LP_MODE_MASK) -/*! @} */ - -/* The count of SPC_PD_STATUS */ -#define SPC_PD_STATUS_COUNT (2U) - -/*! @name SRAMCTL - SRAM Control */ -/*! @{ */ - -#define SPC_SRAMCTL_VSM_MASK (0x3U) -#define SPC_SRAMCTL_VSM_SHIFT (0U) -/*! VSM - Voltage Select Margin - * 0b00.. - * 0b01..1.0 V - * 0b10..1.1 V - * 0b11.. - */ -#define SPC_SRAMCTL_VSM(x) (((uint32_t)(((uint32_t)(x)) << SPC_SRAMCTL_VSM_SHIFT)) & SPC_SRAMCTL_VSM_MASK) - -#define SPC_SRAMCTL_REQ_MASK (0x40000000U) -#define SPC_SRAMCTL_REQ_SHIFT (30U) -/*! REQ - SRAM Voltage Update Request - * 0b0..Do not request - * 0b1..Request - */ -#define SPC_SRAMCTL_REQ(x) (((uint32_t)(((uint32_t)(x)) << SPC_SRAMCTL_REQ_SHIFT)) & SPC_SRAMCTL_REQ_MASK) - -#define SPC_SRAMCTL_ACK_MASK (0x80000000U) -#define SPC_SRAMCTL_ACK_SHIFT (31U) -/*! ACK - SRAM Voltage Update Request Acknowledge - * 0b0..Not acknowledged - * 0b1..Acknowledged - */ -#define SPC_SRAMCTL_ACK(x) (((uint32_t)(((uint32_t)(x)) << SPC_SRAMCTL_ACK_SHIFT)) & SPC_SRAMCTL_ACK_MASK) -/*! @} */ - -/*! @name ACTIVE_CFG - Active Power Mode Configuration */ -/*! @{ */ - -#define SPC_ACTIVE_CFG_CORELDO_VDD_DS_MASK (0x1U) -#define SPC_ACTIVE_CFG_CORELDO_VDD_DS_SHIFT (0U) -/*! CORELDO_VDD_DS - LDO_CORE VDD Drive Strength - * 0b0..Low - * 0b1..Normal - */ -#define SPC_ACTIVE_CFG_CORELDO_VDD_DS(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_CORELDO_VDD_DS_SHIFT)) & SPC_ACTIVE_CFG_CORELDO_VDD_DS_MASK) - -#define SPC_ACTIVE_CFG_CORELDO_VDD_LVL_MASK (0xCU) -#define SPC_ACTIVE_CFG_CORELDO_VDD_LVL_SHIFT (2U) -/*! CORELDO_VDD_LVL - LDO_CORE VDD Regulator Voltage Level - * 0b00.. - * 0b01..Regulate to mid voltage (1.0 V) - * 0b10..Regulate to normal voltage (1.1 V) - * 0b11..Reserved - */ -#define SPC_ACTIVE_CFG_CORELDO_VDD_LVL(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_CORELDO_VDD_LVL_SHIFT)) & SPC_ACTIVE_CFG_CORELDO_VDD_LVL_MASK) - -#define SPC_ACTIVE_CFG_SYSLDO_VDD_DS_MASK (0x10U) -#define SPC_ACTIVE_CFG_SYSLDO_VDD_DS_SHIFT (4U) -/*! SYSLDO_VDD_DS - LDO_SYS VDD Drive Strength - * 0b0..Low - * 0b1..Normal - */ -#define SPC_ACTIVE_CFG_SYSLDO_VDD_DS(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_SYSLDO_VDD_DS_SHIFT)) & SPC_ACTIVE_CFG_SYSLDO_VDD_DS_MASK) - -#define SPC_ACTIVE_CFG_SYSLDO_VDD_LVL_MASK (0x40U) -#define SPC_ACTIVE_CFG_SYSLDO_VDD_LVL_SHIFT (6U) -/*! SYSLDO_VDD_LVL - LDO_SYS VDD Regulator Voltage Level - * 0b0..Normal voltage (1.8 V) - * 0b1..Overdrive voltage (2.5 V) - */ -#define SPC_ACTIVE_CFG_SYSLDO_VDD_LVL(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_SYSLDO_VDD_LVL_SHIFT)) & SPC_ACTIVE_CFG_SYSLDO_VDD_LVL_MASK) - -#define SPC_ACTIVE_CFG_DCDC_VDD_DS_MASK (0x300U) -#define SPC_ACTIVE_CFG_DCDC_VDD_DS_SHIFT (8U) -/*! DCDC_VDD_DS - DCDC VDD Drive Strength - * 0b01..Low - * 0b10..Normal - * *.. - */ -#define SPC_ACTIVE_CFG_DCDC_VDD_DS(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_DCDC_VDD_DS_SHIFT)) & SPC_ACTIVE_CFG_DCDC_VDD_DS_MASK) - -#define SPC_ACTIVE_CFG_DCDC_VDD_LVL_MASK (0xC00U) -#define SPC_ACTIVE_CFG_DCDC_VDD_LVL_SHIFT (10U) -/*! DCDC_VDD_LVL - DCDC VDD Regulator Voltage Level - * 0b00..Reserved - * 0b01..Midvoltage (1.0 V) - * 0b10..Normal voltage (1.1 V) - * 0b11..Overdrive voltage (1.2 V) - */ -#define SPC_ACTIVE_CFG_DCDC_VDD_LVL(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_DCDC_VDD_LVL_SHIFT)) & SPC_ACTIVE_CFG_DCDC_VDD_LVL_MASK) - -#define SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE_MASK (0x1000U) -#define SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE_SHIFT (12U) -/*! GLITCH_DETECT_DISABLE - Glitch Detect Disable - * 0b0..Low Voltage Glitch Detect enabled - * 0b1..Low Voltage Glitch Detect disabled - */ -#define SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE_SHIFT)) & SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE_MASK) - -#define SPC_ACTIVE_CFG_LPBUFF_EN_MASK (0x40000U) -#define SPC_ACTIVE_CFG_LPBUFF_EN_SHIFT (18U) -/*! LPBUFF_EN - CMP Bandgap Buffer Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_ACTIVE_CFG_LPBUFF_EN(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_LPBUFF_EN_SHIFT)) & SPC_ACTIVE_CFG_LPBUFF_EN_MASK) - -#define SPC_ACTIVE_CFG_BGMODE_MASK (0x300000U) -#define SPC_ACTIVE_CFG_BGMODE_SHIFT (20U) -/*! BGMODE - Bandgap Mode - * 0b00..Bandgap disabled - * 0b01..Bandgap enabled, buffer disabled - * 0b10..Bandgap enabled, buffer enabled - * 0b11.. - */ -#define SPC_ACTIVE_CFG_BGMODE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_BGMODE_SHIFT)) & SPC_ACTIVE_CFG_BGMODE_MASK) - -#define SPC_ACTIVE_CFG_VDD_VD_DISABLE_MASK (0x800000U) -#define SPC_ACTIVE_CFG_VDD_VD_DISABLE_SHIFT (23U) -/*! VDD_VD_DISABLE - VDD Voltage Detect Disable - * 0b0..Enable - * 0b1..Disable - */ -#define SPC_ACTIVE_CFG_VDD_VD_DISABLE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_VDD_VD_DISABLE_SHIFT)) & SPC_ACTIVE_CFG_VDD_VD_DISABLE_MASK) - -#define SPC_ACTIVE_CFG_CORE_LVDE_MASK (0x1000000U) -#define SPC_ACTIVE_CFG_CORE_LVDE_SHIFT (24U) -/*! CORE_LVDE - Core Low-Voltage Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_ACTIVE_CFG_CORE_LVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_CORE_LVDE_SHIFT)) & SPC_ACTIVE_CFG_CORE_LVDE_MASK) - -#define SPC_ACTIVE_CFG_SYS_LVDE_MASK (0x2000000U) -#define SPC_ACTIVE_CFG_SYS_LVDE_SHIFT (25U) -/*! SYS_LVDE - System Low-Voltage Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_ACTIVE_CFG_SYS_LVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_SYS_LVDE_SHIFT)) & SPC_ACTIVE_CFG_SYS_LVDE_MASK) - -#define SPC_ACTIVE_CFG_IO_LVDE_MASK (0x4000000U) -#define SPC_ACTIVE_CFG_IO_LVDE_SHIFT (26U) -/*! IO_LVDE - IO Low-Voltage Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_ACTIVE_CFG_IO_LVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_IO_LVDE_SHIFT)) & SPC_ACTIVE_CFG_IO_LVDE_MASK) - -#define SPC_ACTIVE_CFG_CORE_HVDE_MASK (0x8000000U) -#define SPC_ACTIVE_CFG_CORE_HVDE_SHIFT (27U) -/*! CORE_HVDE - Core High-Voltage Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_ACTIVE_CFG_CORE_HVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_CORE_HVDE_SHIFT)) & SPC_ACTIVE_CFG_CORE_HVDE_MASK) - -#define SPC_ACTIVE_CFG_SYS_HVDE_MASK (0x10000000U) -#define SPC_ACTIVE_CFG_SYS_HVDE_SHIFT (28U) -/*! SYS_HVDE - System High-Voltage Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_ACTIVE_CFG_SYS_HVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_SYS_HVDE_SHIFT)) & SPC_ACTIVE_CFG_SYS_HVDE_MASK) - -#define SPC_ACTIVE_CFG_IO_HVDE_MASK (0x20000000U) -#define SPC_ACTIVE_CFG_IO_HVDE_SHIFT (29U) -/*! IO_HVDE - IO High-Voltage Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_ACTIVE_CFG_IO_HVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_IO_HVDE_SHIFT)) & SPC_ACTIVE_CFG_IO_HVDE_MASK) -/*! @} */ - -/*! @name ACTIVE_CFG1 - Active Power Mode Configuration 1 */ -/*! @{ */ - -#define SPC_ACTIVE_CFG1_SOC_CNTRL_MASK (0xFFFFFFFFU) -#define SPC_ACTIVE_CFG1_SOC_CNTRL_SHIFT (0U) -/*! SOC_CNTRL - Active Config Chip Control */ -#define SPC_ACTIVE_CFG1_SOC_CNTRL(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG1_SOC_CNTRL_SHIFT)) & SPC_ACTIVE_CFG1_SOC_CNTRL_MASK) -/*! @} */ - -/*! @name LP_CFG - Low-Power Mode Configuration */ -/*! @{ */ - -#define SPC_LP_CFG_CORELDO_VDD_DS_MASK (0x1U) -#define SPC_LP_CFG_CORELDO_VDD_DS_SHIFT (0U) -/*! CORELDO_VDD_DS - LDO_CORE VDD Drive Strength - * 0b0..Low - * 0b1..Normal - */ -#define SPC_LP_CFG_CORELDO_VDD_DS(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_CORELDO_VDD_DS_SHIFT)) & SPC_LP_CFG_CORELDO_VDD_DS_MASK) - -#define SPC_LP_CFG_CORELDO_VDD_LVL_MASK (0xCU) -#define SPC_LP_CFG_CORELDO_VDD_LVL_SHIFT (2U) -/*! CORELDO_VDD_LVL - LDO_CORE VDD Regulator Voltage Level - * 0b00..Retention voltage - * 0b01..Mid voltage (1.0 V) - * 0b10..Normal voltage (1.1 V) - * 0b11..Overdrive voltage (1.15 V) - */ -#define SPC_LP_CFG_CORELDO_VDD_LVL(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_CORELDO_VDD_LVL_SHIFT)) & SPC_LP_CFG_CORELDO_VDD_LVL_MASK) - -#define SPC_LP_CFG_SYSLDO_VDD_DS_MASK (0x10U) -#define SPC_LP_CFG_SYSLDO_VDD_DS_SHIFT (4U) -/*! SYSLDO_VDD_DS - LDO_SYS VDD Drive Strength - * 0b0..Low - * 0b1..Normal - */ -#define SPC_LP_CFG_SYSLDO_VDD_DS(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_SYSLDO_VDD_DS_SHIFT)) & SPC_LP_CFG_SYSLDO_VDD_DS_MASK) - -#define SPC_LP_CFG_DCDC_VDD_DS_MASK (0x300U) -#define SPC_LP_CFG_DCDC_VDD_DS_SHIFT (8U) -/*! DCDC_VDD_DS - DCDC VDD Drive Strength - * 0b00..Pulse refresh - * 0b01..Low - * 0b10..Normal - * 0b11.. - */ -#define SPC_LP_CFG_DCDC_VDD_DS(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_DCDC_VDD_DS_SHIFT)) & SPC_LP_CFG_DCDC_VDD_DS_MASK) - -#define SPC_LP_CFG_DCDC_VDD_LVL_MASK (0xC00U) -#define SPC_LP_CFG_DCDC_VDD_LVL_SHIFT (10U) -/*! DCDC_VDD_LVL - DCDC VDD Regulator Voltage Level - * 0b00..Retention voltage (0.7 V) - * 0b01..Mid voltage (1.0 V) - * 0b10..Normal voltage (1.1 V) - * 0b11..Overdrive voltage (1.2 V) - */ -#define SPC_LP_CFG_DCDC_VDD_LVL(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_DCDC_VDD_LVL_SHIFT)) & SPC_LP_CFG_DCDC_VDD_LVL_MASK) - -#define SPC_LP_CFG_GLITCH_DETECT_DISABLE_MASK (0x1000U) -#define SPC_LP_CFG_GLITCH_DETECT_DISABLE_SHIFT (12U) -/*! GLITCH_DETECT_DISABLE - Glitch Detect Disable - * 0b0..Enable - * 0b1..Disable - */ -#define SPC_LP_CFG_GLITCH_DETECT_DISABLE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_GLITCH_DETECT_DISABLE_SHIFT)) & SPC_LP_CFG_GLITCH_DETECT_DISABLE_MASK) - -#define SPC_LP_CFG_COREVDD_IVS_EN_MASK (0x20000U) -#define SPC_LP_CFG_COREVDD_IVS_EN_SHIFT (17U) -/*! COREVDD_IVS_EN - CORE VDD Internal Voltage Scaling (IVS) Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LP_CFG_COREVDD_IVS_EN(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_COREVDD_IVS_EN_SHIFT)) & SPC_LP_CFG_COREVDD_IVS_EN_MASK) - -#define SPC_LP_CFG_LPBUFF_EN_MASK (0x40000U) -#define SPC_LP_CFG_LPBUFF_EN_SHIFT (18U) -/*! LPBUFF_EN - CMP Bandgap Buffer Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LP_CFG_LPBUFF_EN(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_LPBUFF_EN_SHIFT)) & SPC_LP_CFG_LPBUFF_EN_MASK) - -#define SPC_LP_CFG_BGMODE_MASK (0x300000U) -#define SPC_LP_CFG_BGMODE_SHIFT (20U) -/*! BGMODE - Bandgap Mode - * 0b00..Bandgap disabled - * 0b01..Bandgap enabled, buffer disabled - * 0b10..Bandgap enabled, buffer enabled - * 0b11.. - */ -#define SPC_LP_CFG_BGMODE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_BGMODE_SHIFT)) & SPC_LP_CFG_BGMODE_MASK) - -#define SPC_LP_CFG_LP_IREFEN_MASK (0x800000U) -#define SPC_LP_CFG_LP_IREFEN_SHIFT (23U) -/*! LP_IREFEN - Low-Power IREF Enable - * 0b0..Disable for power saving in Deep Power Down mode - * 0b1..Enable - */ -#define SPC_LP_CFG_LP_IREFEN(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_LP_IREFEN_SHIFT)) & SPC_LP_CFG_LP_IREFEN_MASK) - -#define SPC_LP_CFG_CORE_LVDE_MASK (0x1000000U) -#define SPC_LP_CFG_CORE_LVDE_SHIFT (24U) -/*! CORE_LVDE - Core Low Voltage Detect Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LP_CFG_CORE_LVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_CORE_LVDE_SHIFT)) & SPC_LP_CFG_CORE_LVDE_MASK) - -#define SPC_LP_CFG_SYS_LVDE_MASK (0x2000000U) -#define SPC_LP_CFG_SYS_LVDE_SHIFT (25U) -/*! SYS_LVDE - System Low Voltage Detect Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LP_CFG_SYS_LVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_SYS_LVDE_SHIFT)) & SPC_LP_CFG_SYS_LVDE_MASK) - -#define SPC_LP_CFG_IO_LVDE_MASK (0x4000000U) -#define SPC_LP_CFG_IO_LVDE_SHIFT (26U) -/*! IO_LVDE - IO Low Voltage Detect Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LP_CFG_IO_LVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_IO_LVDE_SHIFT)) & SPC_LP_CFG_IO_LVDE_MASK) - -#define SPC_LP_CFG_CORE_HVDE_MASK (0x8000000U) -#define SPC_LP_CFG_CORE_HVDE_SHIFT (27U) -/*! CORE_HVDE - Core High Voltage Detect Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LP_CFG_CORE_HVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_CORE_HVDE_SHIFT)) & SPC_LP_CFG_CORE_HVDE_MASK) - -#define SPC_LP_CFG_SYS_HVDE_MASK (0x10000000U) -#define SPC_LP_CFG_SYS_HVDE_SHIFT (28U) -/*! SYS_HVDE - System High Voltage Detect Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LP_CFG_SYS_HVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_SYS_HVDE_SHIFT)) & SPC_LP_CFG_SYS_HVDE_MASK) - -#define SPC_LP_CFG_IO_HVDE_MASK (0x20000000U) -#define SPC_LP_CFG_IO_HVDE_SHIFT (29U) -/*! IO_HVDE - IO High Voltage Detect Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LP_CFG_IO_HVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_IO_HVDE_SHIFT)) & SPC_LP_CFG_IO_HVDE_MASK) -/*! @} */ - -/*! @name LP_CFG1 - Low Power Mode Configuration 1 */ -/*! @{ */ - -#define SPC_LP_CFG1_SOC_CNTRL_MASK (0xFFFFFFFFU) -#define SPC_LP_CFG1_SOC_CNTRL_SHIFT (0U) -/*! SOC_CNTRL - Low-Power Configuration Chip Control */ -#define SPC_LP_CFG1_SOC_CNTRL(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG1_SOC_CNTRL_SHIFT)) & SPC_LP_CFG1_SOC_CNTRL_MASK) -/*! @} */ - -/*! @name LPWKUP_DELAY - Low Power Wake-Up Delay */ -/*! @{ */ - -#define SPC_LPWKUP_DELAY_LPWKUP_DELAY_MASK (0xFFFFU) -#define SPC_LPWKUP_DELAY_LPWKUP_DELAY_SHIFT (0U) -/*! LPWKUP_DELAY - Low-Power Wake-Up Delay */ -#define SPC_LPWKUP_DELAY_LPWKUP_DELAY(x) (((uint32_t)(((uint32_t)(x)) << SPC_LPWKUP_DELAY_LPWKUP_DELAY_SHIFT)) & SPC_LPWKUP_DELAY_LPWKUP_DELAY_MASK) -/*! @} */ - -/*! @name ACTIVE_VDELAY - Active Voltage Trim Delay */ -/*! @{ */ - -#define SPC_ACTIVE_VDELAY_ACTIVE_VDELAY_MASK (0xFFFFU) -#define SPC_ACTIVE_VDELAY_ACTIVE_VDELAY_SHIFT (0U) -/*! ACTIVE_VDELAY - Active Voltage Delay */ -#define SPC_ACTIVE_VDELAY_ACTIVE_VDELAY(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_VDELAY_ACTIVE_VDELAY_SHIFT)) & SPC_ACTIVE_VDELAY_ACTIVE_VDELAY_MASK) -/*! @} */ - -/*! @name VD_STAT - Voltage Detect Status */ -/*! @{ */ - -#define SPC_VD_STAT_COREVDD_LVDF_MASK (0x1U) -#define SPC_VD_STAT_COREVDD_LVDF_SHIFT (0U) -/*! COREVDD_LVDF - Core Low-Voltage Detect Flag - * 0b0..Event not detected - * 0b1..Event detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_VD_STAT_COREVDD_LVDF(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_STAT_COREVDD_LVDF_SHIFT)) & SPC_VD_STAT_COREVDD_LVDF_MASK) - -#define SPC_VD_STAT_SYSVDD_LVDF_MASK (0x2U) -#define SPC_VD_STAT_SYSVDD_LVDF_SHIFT (1U) -/*! SYSVDD_LVDF - System Low-Voltage Detect Flag - * 0b0..Event not detected - * 0b1..Event detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_VD_STAT_SYSVDD_LVDF(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_STAT_SYSVDD_LVDF_SHIFT)) & SPC_VD_STAT_SYSVDD_LVDF_MASK) - -#define SPC_VD_STAT_IOVDD_LVDF_MASK (0x4U) -#define SPC_VD_STAT_IOVDD_LVDF_SHIFT (2U) -/*! IOVDD_LVDF - IO VDD LVD Flag - * 0b0..Event not detected - * 0b1..Event detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_VD_STAT_IOVDD_LVDF(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_STAT_IOVDD_LVDF_SHIFT)) & SPC_VD_STAT_IOVDD_LVDF_MASK) - -#define SPC_VD_STAT_COREVDD_HVDF_MASK (0x10U) -#define SPC_VD_STAT_COREVDD_HVDF_SHIFT (4U) -/*! COREVDD_HVDF - Core VDD HVD Flag - * 0b0..Event not detected - * 0b1..Event detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_VD_STAT_COREVDD_HVDF(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_STAT_COREVDD_HVDF_SHIFT)) & SPC_VD_STAT_COREVDD_HVDF_MASK) - -#define SPC_VD_STAT_SYSVDD_HVDF_MASK (0x20U) -#define SPC_VD_STAT_SYSVDD_HVDF_SHIFT (5U) -/*! SYSVDD_HVDF - System HVD Flag - * 0b0..Event not detected - * 0b1..Event detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_VD_STAT_SYSVDD_HVDF(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_STAT_SYSVDD_HVDF_SHIFT)) & SPC_VD_STAT_SYSVDD_HVDF_MASK) - -#define SPC_VD_STAT_IOVDD_HVDF_MASK (0x40U) -#define SPC_VD_STAT_IOVDD_HVDF_SHIFT (6U) -/*! IOVDD_HVDF - IO VDD HVD Flag - * 0b0..Event not detected - * 0b1..Event detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_VD_STAT_IOVDD_HVDF(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_STAT_IOVDD_HVDF_SHIFT)) & SPC_VD_STAT_IOVDD_HVDF_MASK) -/*! @} */ - -/*! @name VD_CORE_CFG - Core Voltage Detect Configuration */ -/*! @{ */ - -#define SPC_VD_CORE_CFG_LVDRE_MASK (0x1U) -#define SPC_VD_CORE_CFG_LVDRE_SHIFT (0U) -/*! LVDRE - Core LVD Reset Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_CORE_CFG_LVDRE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_CORE_CFG_LVDRE_SHIFT)) & SPC_VD_CORE_CFG_LVDRE_MASK) - -#define SPC_VD_CORE_CFG_LVDIE_MASK (0x2U) -#define SPC_VD_CORE_CFG_LVDIE_SHIFT (1U) -/*! LVDIE - Core LVD Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_CORE_CFG_LVDIE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_CORE_CFG_LVDIE_SHIFT)) & SPC_VD_CORE_CFG_LVDIE_MASK) - -#define SPC_VD_CORE_CFG_HVDRE_MASK (0x4U) -#define SPC_VD_CORE_CFG_HVDRE_SHIFT (2U) -/*! HVDRE - Core VDD HVD Reset Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_CORE_CFG_HVDRE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_CORE_CFG_HVDRE_SHIFT)) & SPC_VD_CORE_CFG_HVDRE_MASK) - -#define SPC_VD_CORE_CFG_HVDIE_MASK (0x8U) -#define SPC_VD_CORE_CFG_HVDIE_SHIFT (3U) -/*! HVDIE - Core VDD HVD Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_CORE_CFG_HVDIE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_CORE_CFG_HVDIE_SHIFT)) & SPC_VD_CORE_CFG_HVDIE_MASK) - -#define SPC_VD_CORE_CFG_LOCK_MASK (0x10000U) -#define SPC_VD_CORE_CFG_LOCK_SHIFT (16U) -/*! LOCK - Core Voltage Detect Reset Enable Lock - * 0b0..Allow - * 0b1..Deny - */ -#define SPC_VD_CORE_CFG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_CORE_CFG_LOCK_SHIFT)) & SPC_VD_CORE_CFG_LOCK_MASK) -/*! @} */ - -/*! @name VD_SYS_CFG - System Voltage Detect Configuration */ -/*! @{ */ - -#define SPC_VD_SYS_CFG_LVDRE_MASK (0x1U) -#define SPC_VD_SYS_CFG_LVDRE_SHIFT (0U) -/*! LVDRE - System LVD Reset Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_SYS_CFG_LVDRE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_SYS_CFG_LVDRE_SHIFT)) & SPC_VD_SYS_CFG_LVDRE_MASK) - -#define SPC_VD_SYS_CFG_LVDIE_MASK (0x2U) -#define SPC_VD_SYS_CFG_LVDIE_SHIFT (1U) -/*! LVDIE - System LVD Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_SYS_CFG_LVDIE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_SYS_CFG_LVDIE_SHIFT)) & SPC_VD_SYS_CFG_LVDIE_MASK) - -#define SPC_VD_SYS_CFG_HVDRE_MASK (0x4U) -#define SPC_VD_SYS_CFG_HVDRE_SHIFT (2U) -/*! HVDRE - System HVD Reset Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_SYS_CFG_HVDRE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_SYS_CFG_HVDRE_SHIFT)) & SPC_VD_SYS_CFG_HVDRE_MASK) - -#define SPC_VD_SYS_CFG_HVDIE_MASK (0x8U) -#define SPC_VD_SYS_CFG_HVDIE_SHIFT (3U) -/*! HVDIE - System HVD Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_SYS_CFG_HVDIE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_SYS_CFG_HVDIE_SHIFT)) & SPC_VD_SYS_CFG_HVDIE_MASK) - -#define SPC_VD_SYS_CFG_LVSEL_MASK (0x100U) -#define SPC_VD_SYS_CFG_LVSEL_SHIFT (8U) -/*! LVSEL - System Low-Voltage Level Select - * 0b0..Normal - * 0b1..Safe - */ -#define SPC_VD_SYS_CFG_LVSEL(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_SYS_CFG_LVSEL_SHIFT)) & SPC_VD_SYS_CFG_LVSEL_MASK) - -#define SPC_VD_SYS_CFG_LOCK_MASK (0x10000U) -#define SPC_VD_SYS_CFG_LOCK_SHIFT (16U) -/*! LOCK - System Voltage Detect Reset Enable Lock - * 0b0..Allow - * 0b1..Deny - */ -#define SPC_VD_SYS_CFG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_SYS_CFG_LOCK_SHIFT)) & SPC_VD_SYS_CFG_LOCK_MASK) -/*! @} */ - -/*! @name VD_IO_CFG - IO Voltage Detect Configuration */ -/*! @{ */ - -#define SPC_VD_IO_CFG_LVDRE_MASK (0x1U) -#define SPC_VD_IO_CFG_LVDRE_SHIFT (0U) -/*! LVDRE - IO VDD LVD Reset Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_IO_CFG_LVDRE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_IO_CFG_LVDRE_SHIFT)) & SPC_VD_IO_CFG_LVDRE_MASK) - -#define SPC_VD_IO_CFG_LVDIE_MASK (0x2U) -#define SPC_VD_IO_CFG_LVDIE_SHIFT (1U) -/*! LVDIE - IO VDD LVD Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_IO_CFG_LVDIE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_IO_CFG_LVDIE_SHIFT)) & SPC_VD_IO_CFG_LVDIE_MASK) - -#define SPC_VD_IO_CFG_HVDRE_MASK (0x4U) -#define SPC_VD_IO_CFG_HVDRE_SHIFT (2U) -/*! HVDRE - IO VDD HVD Reset Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_IO_CFG_HVDRE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_IO_CFG_HVDRE_SHIFT)) & SPC_VD_IO_CFG_HVDRE_MASK) - -#define SPC_VD_IO_CFG_HVDIE_MASK (0x8U) -#define SPC_VD_IO_CFG_HVDIE_SHIFT (3U) -/*! HVDIE - IO VDD HVD Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_IO_CFG_HVDIE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_IO_CFG_HVDIE_SHIFT)) & SPC_VD_IO_CFG_HVDIE_MASK) - -#define SPC_VD_IO_CFG_LVSEL_MASK (0x100U) -#define SPC_VD_IO_CFG_LVSEL_SHIFT (8U) -/*! LVSEL - IO VDD Low-Voltage Level Select - * 0b0..Normal - * 0b1..Safe - */ -#define SPC_VD_IO_CFG_LVSEL(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_IO_CFG_LVSEL_SHIFT)) & SPC_VD_IO_CFG_LVSEL_MASK) - -#define SPC_VD_IO_CFG_LOCK_MASK (0x10000U) -#define SPC_VD_IO_CFG_LOCK_SHIFT (16U) -/*! LOCK - IO Voltage Detect Reset Enable Lock - * 0b0..Allow - * 0b1..Deny - */ -#define SPC_VD_IO_CFG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_IO_CFG_LOCK_SHIFT)) & SPC_VD_IO_CFG_LOCK_MASK) -/*! @} */ - -/*! @name EVD_CFG - External Voltage Domain Configuration */ -/*! @{ */ - -#define SPC_EVD_CFG_EVDISO_MASK (0x3FU) -#define SPC_EVD_CFG_EVDISO_SHIFT (0U) -/*! EVDISO - External Voltage Domain Isolation */ -#define SPC_EVD_CFG_EVDISO(x) (((uint32_t)(((uint32_t)(x)) << SPC_EVD_CFG_EVDISO_SHIFT)) & SPC_EVD_CFG_EVDISO_MASK) - -#define SPC_EVD_CFG_EVDLPISO_MASK (0x3F00U) -#define SPC_EVD_CFG_EVDLPISO_SHIFT (8U) -/*! EVDLPISO - External Voltage Domain Low-Power Isolation */ -#define SPC_EVD_CFG_EVDLPISO(x) (((uint32_t)(((uint32_t)(x)) << SPC_EVD_CFG_EVDLPISO_SHIFT)) & SPC_EVD_CFG_EVDLPISO_MASK) - -#define SPC_EVD_CFG_EVDSTAT_MASK (0x3F0000U) -#define SPC_EVD_CFG_EVDSTAT_SHIFT (16U) -/*! EVDSTAT - External Voltage Domain Status */ -#define SPC_EVD_CFG_EVDSTAT(x) (((uint32_t)(((uint32_t)(x)) << SPC_EVD_CFG_EVDSTAT_SHIFT)) & SPC_EVD_CFG_EVDSTAT_MASK) -/*! @} */ - -/*! @name GLITCH_DETECT_SC - Glitch Detect Status Control */ -/*! @{ */ - -#define SPC_GLITCH_DETECT_SC_CNT_SELECT_MASK (0x3U) -#define SPC_GLITCH_DETECT_SC_CNT_SELECT_SHIFT (0U) -/*! CNT_SELECT - Counter Select - * 0b00..0 - * 0b01..1 - * 0b10..2 - * 0b11..3 - */ -#define SPC_GLITCH_DETECT_SC_CNT_SELECT(x) (((uint32_t)(((uint32_t)(x)) << SPC_GLITCH_DETECT_SC_CNT_SELECT_SHIFT)) & SPC_GLITCH_DETECT_SC_CNT_SELECT_MASK) - -#define SPC_GLITCH_DETECT_SC_TIMEOUT_MASK (0x3CU) -#define SPC_GLITCH_DETECT_SC_TIMEOUT_SHIFT (2U) -/*! TIMEOUT - Timeout */ -#define SPC_GLITCH_DETECT_SC_TIMEOUT(x) (((uint32_t)(((uint32_t)(x)) << SPC_GLITCH_DETECT_SC_TIMEOUT_SHIFT)) & SPC_GLITCH_DETECT_SC_TIMEOUT_MASK) - -#define SPC_GLITCH_DETECT_SC_RE_MASK (0x40U) -#define SPC_GLITCH_DETECT_SC_RE_SHIFT (6U) -/*! RE - Glitch Detect Reset Enable - * 0b0..GLITCH_DETECT_FLAG[CNT_SELECT] does not generate POR/LVD reset - * 0b1..GLITCH_DETECT_FLAG[CNT_SELECT] does generate POR/LVD reset - */ -#define SPC_GLITCH_DETECT_SC_RE(x) (((uint32_t)(((uint32_t)(x)) << SPC_GLITCH_DETECT_SC_RE_SHIFT)) & SPC_GLITCH_DETECT_SC_RE_MASK) - -#define SPC_GLITCH_DETECT_SC_IE_MASK (0x80U) -#define SPC_GLITCH_DETECT_SC_IE_SHIFT (7U) -/*! IE - Glitch Detect Interrupt Enable - * 0b0..GLITCH_DETECT_FLAG[CNT_SELECT] does not generate hardware interrupt (user polling) - * 0b1..GLITCH_DETECT_FLAG[CNT_SELECT] does generate hardware interrupt - */ -#define SPC_GLITCH_DETECT_SC_IE(x) (((uint32_t)(((uint32_t)(x)) << SPC_GLITCH_DETECT_SC_IE_SHIFT)) & SPC_GLITCH_DETECT_SC_IE_MASK) - -#define SPC_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG_MASK (0xF00U) -#define SPC_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG_SHIFT (8U) -/*! GLITCH_DETECT_FLAG - GLITCH_DETECT_FLAG */ -#define SPC_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG(x) (((uint32_t)(((uint32_t)(x)) << SPC_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG_SHIFT)) & SPC_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG_MASK) - -#define SPC_GLITCH_DETECT_SC_LOCK_MASK (0x10000U) -#define SPC_GLITCH_DETECT_SC_LOCK_SHIFT (16U) -/*! LOCK - Glitch Detect Reset Enable Lock Bit - * 0b0..Writes to RE are allowed. - * 0b1..Writes to RE are ignored. - */ -#define SPC_GLITCH_DETECT_SC_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SPC_GLITCH_DETECT_SC_LOCK_SHIFT)) & SPC_GLITCH_DETECT_SC_LOCK_MASK) -/*! @} */ - -/*! @name CORELDO_CFG - LDO_CORE Configuration */ -/*! @{ */ - -#define SPC_CORELDO_CFG_DPDOWN_PULLDOWN_DISABLE_MASK (0x10000U) -#define SPC_CORELDO_CFG_DPDOWN_PULLDOWN_DISABLE_SHIFT (16U) -/*! DPDOWN_PULLDOWN_DISABLE - LDO_CORE Deep Power Down Pulldown Disable - * 0b0..LDO_CORE pulldown in Deep Power Down not disabled - * 0b1..LDO_CORE pulldown in Deep Power Down disabled - */ -#define SPC_CORELDO_CFG_DPDOWN_PULLDOWN_DISABLE(x) (((uint32_t)(((uint32_t)(x)) << SPC_CORELDO_CFG_DPDOWN_PULLDOWN_DISABLE_SHIFT)) & SPC_CORELDO_CFG_DPDOWN_PULLDOWN_DISABLE_MASK) -/*! @} */ - -/*! @name SYSLDO_CFG - LDO_SYS Configuration */ -/*! @{ */ - -#define SPC_SYSLDO_CFG_ISINKEN_MASK (0x1U) -#define SPC_SYSLDO_CFG_ISINKEN_SHIFT (0U) -/*! ISINKEN - Current Sink Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_SYSLDO_CFG_ISINKEN(x) (((uint32_t)(((uint32_t)(x)) << SPC_SYSLDO_CFG_ISINKEN_SHIFT)) & SPC_SYSLDO_CFG_ISINKEN_MASK) -/*! @} */ - -/*! @name DCDC_CFG - DCDC Configuration */ -/*! @{ */ - -#define SPC_DCDC_CFG_FREQ_CNTRL_ON_MASK (0x1U) -#define SPC_DCDC_CFG_FREQ_CNTRL_ON_SHIFT (0U) -/*! FREQ_CNTRL_ON - DCDC Burst Frequency Control Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_DCDC_CFG_FREQ_CNTRL_ON(x) (((uint32_t)(((uint32_t)(x)) << SPC_DCDC_CFG_FREQ_CNTRL_ON_SHIFT)) & SPC_DCDC_CFG_FREQ_CNTRL_ON_MASK) - -#define SPC_DCDC_CFG_FREQ_CNTRL_MASK (0x3F00U) -#define SPC_DCDC_CFG_FREQ_CNTRL_SHIFT (8U) -/*! FREQ_CNTRL - DCDC Burst Frequency Control */ -#define SPC_DCDC_CFG_FREQ_CNTRL(x) (((uint32_t)(((uint32_t)(x)) << SPC_DCDC_CFG_FREQ_CNTRL_SHIFT)) & SPC_DCDC_CFG_FREQ_CNTRL_MASK) - -#define SPC_DCDC_CFG_BLEED_EN_MASK (0x80000U) -#define SPC_DCDC_CFG_BLEED_EN_SHIFT (19U) -/*! BLEED_EN - DCDC Bleed Enable - * 0b0..Do not add - * 0b1..Add - */ -#define SPC_DCDC_CFG_BLEED_EN(x) (((uint32_t)(((uint32_t)(x)) << SPC_DCDC_CFG_BLEED_EN_SHIFT)) & SPC_DCDC_CFG_BLEED_EN_MASK) -/*! @} */ - -/*! @name DCDC_BURST_CFG - DCDC Burst Configuration */ -/*! @{ */ - -#define SPC_DCDC_BURST_CFG_BURST_REQ_MASK (0x1U) -#define SPC_DCDC_BURST_CFG_BURST_REQ_SHIFT (0U) -/*! BURST_REQ - Software Burst Request - * 0b0..Do not generate - * 0b1..Generate - */ -#define SPC_DCDC_BURST_CFG_BURST_REQ(x) (((uint32_t)(((uint32_t)(x)) << SPC_DCDC_BURST_CFG_BURST_REQ_SHIFT)) & SPC_DCDC_BURST_CFG_BURST_REQ_MASK) - -#define SPC_DCDC_BURST_CFG_EXT_BURST_EN_MASK (0x2U) -#define SPC_DCDC_BURST_CFG_EXT_BURST_EN_SHIFT (1U) -/*! EXT_BURST_EN - External Burst Request Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_DCDC_BURST_CFG_EXT_BURST_EN(x) (((uint32_t)(((uint32_t)(x)) << SPC_DCDC_BURST_CFG_EXT_BURST_EN_SHIFT)) & SPC_DCDC_BURST_CFG_EXT_BURST_EN_MASK) - -#define SPC_DCDC_BURST_CFG_BURST_ACK_MASK (0x8U) -#define SPC_DCDC_BURST_CFG_BURST_ACK_SHIFT (3U) -/*! BURST_ACK - Burst Acknowledge Flag - * 0b0..Did not complete - * 0b1..Completed - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_DCDC_BURST_CFG_BURST_ACK(x) (((uint32_t)(((uint32_t)(x)) << SPC_DCDC_BURST_CFG_BURST_ACK_SHIFT)) & SPC_DCDC_BURST_CFG_BURST_ACK_MASK) - -#define SPC_DCDC_BURST_CFG_PULSE_REFRESH_CNT_MASK (0xFFFF0000U) -#define SPC_DCDC_BURST_CFG_PULSE_REFRESH_CNT_SHIFT (16U) -/*! PULSE_REFRESH_CNT - Refresh Count Value */ -#define SPC_DCDC_BURST_CFG_PULSE_REFRESH_CNT(x) (((uint32_t)(((uint32_t)(x)) << SPC_DCDC_BURST_CFG_PULSE_REFRESH_CNT_SHIFT)) & SPC_DCDC_BURST_CFG_PULSE_REFRESH_CNT_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group SPC_Register_Masks */ - - -/* SPC - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral SPC0 base address */ - #define SPC0_BASE (0x50045000u) - /** Peripheral SPC0 base address */ - #define SPC0_BASE_NS (0x40045000u) - /** Peripheral SPC0 base pointer */ - #define SPC0 ((SPC_Type *)SPC0_BASE) - /** Peripheral SPC0 base pointer */ - #define SPC0_NS ((SPC_Type *)SPC0_BASE_NS) - /** Array initializer of SPC peripheral base addresses */ - #define SPC_BASE_ADDRS { SPC0_BASE } - /** Array initializer of SPC peripheral base pointers */ - #define SPC_BASE_PTRS { SPC0 } - /** Array initializer of SPC peripheral base addresses */ - #define SPC_BASE_ADDRS_NS { SPC0_BASE_NS } - /** Array initializer of SPC peripheral base pointers */ - #define SPC_BASE_PTRS_NS { SPC0_NS } -#else - /** Peripheral SPC0 base address */ - #define SPC0_BASE (0x40045000u) - /** Peripheral SPC0 base pointer */ - #define SPC0 ((SPC_Type *)SPC0_BASE) - /** Array initializer of SPC peripheral base addresses */ - #define SPC_BASE_ADDRS { SPC0_BASE } - /** Array initializer of SPC peripheral base pointers */ - #define SPC_BASE_PTRS { SPC0 } -#endif - -/*! - * @} - */ /* end of group SPC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- SYSCON Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SYSCON_Peripheral_Access_Layer SYSCON Peripheral Access Layer - * @{ - */ - -/** SYSCON - Register Layout Typedef */ -typedef struct { - uint8_t RESERVED_0[16]; - __IO uint32_t AHBMATPRIO; /**< AHB Matrix Priority Control, offset: 0x10 */ - uint8_t RESERVED_1[36]; - __IO uint32_t CPU0STCKCAL; /**< Secure CPU0 System Tick Calibration, offset: 0x38 */ - __IO uint32_t CPU0NSTCKCAL; /**< Non-Secure CPU0 System Tick Calibration, offset: 0x3C */ - uint8_t RESERVED_2[8]; - __IO uint32_t NMISRC; /**< NMI Source Select, offset: 0x48 */ - uint8_t RESERVED_3[180]; - __IO uint32_t PRESETCTRL0; /**< Peripheral Reset Control 0, offset: 0x100 */ - __IO uint32_t PRESETCTRL1; /**< Peripheral Reset Control 1, offset: 0x104 */ - __IO uint32_t PRESETCTRL2; /**< Peripheral Reset Control 2, offset: 0x108 */ - __IO uint32_t PRESETCTRL3; /**< Peripheral Reset Control 3, offset: 0x10C */ - uint8_t RESERVED_4[16]; - __O uint32_t PRESETCTRLSET[4]; /**< Peripheral Reset Control Set, array offset: 0x120, array step: 0x4 */ - uint8_t RESERVED_5[16]; - __O uint32_t PRESETCTRLCLR[4]; /**< Peripheral Reset Control Clear, array offset: 0x140, array step: 0x4 */ - uint8_t RESERVED_6[176]; - __IO uint32_t AHBCLKCTRL0; /**< AHB Clock Control 0, offset: 0x200 */ - __IO uint32_t AHBCLKCTRL1; /**< AHB Clock Control 1, offset: 0x204 */ - __IO uint32_t AHBCLKCTRL2; /**< AHB Clock Control 2, offset: 0x208 */ - __IO uint32_t AHBCLKCTRL3; /**< AHB Clock Control 3, offset: 0x20C */ - uint8_t RESERVED_7[16]; - __O uint32_t AHBCLKCTRLSET[4]; /**< AHB Clock Control Set, array offset: 0x220, array step: 0x4 */ - uint8_t RESERVED_8[16]; - __O uint32_t AHBCLKCTRLCLR[4]; /**< AHB Clock Control Clear, array offset: 0x240, array step: 0x4 */ - uint8_t RESERVED_9[16]; - __IO uint32_t SYSTICKCLKSEL0; /**< CPU0 System Tick Timer Source Select, offset: 0x260 */ - uint8_t RESERVED_10[4]; - __IO uint32_t TRACECLKSEL; /**< Trace Clock Source Select, offset: 0x268 */ - __IO uint32_t CTIMERCLKSEL[5]; /**< CTIMER Clock Source Select, array offset: 0x26C, array step: 0x4 */ - uint8_t RESERVED_11[8]; - __IO uint32_t CLKOUTSEL; /**< CLKOUT Clock Source Select, offset: 0x288 */ - uint8_t RESERVED_12[24]; - __IO uint32_t ADC0CLKSEL; /**< ADC0 Clock Source Select, offset: 0x2A4 */ - uint8_t RESERVED_13[8]; - __IO uint32_t FCCLKSEL[8]; /**< LP_FLEXCOMM Clock Source Select for Fractional Rate Divider, array offset: 0x2B0, array step: 0x4 */ - uint8_t RESERVED_14[48]; - __IO uint32_t SYSTICKCLKDIV[1]; /**< CPU0 System Tick Timer Divider, array offset: 0x300, array step: 0x4 */ - uint8_t RESERVED_15[4]; - __IO uint32_t TRACECLKDIV; /**< TRACE Clock Divider, offset: 0x308 */ - uint8_t RESERVED_16[108]; - __IO uint32_t SLOWCLKDIV; /**< SLOW_CLK Clock Divider, offset: 0x378 */ - uint8_t RESERVED_17[4]; - __IO uint32_t AHBCLKDIV; /**< System Clock Divider, offset: 0x380 */ - __IO uint32_t CLKOUTDIV; /**< CLKOUT Clock Divider, offset: 0x384 */ - __IO uint32_t FROHFDIV; /**< FRO_HF_DIV Clock Divider, offset: 0x388 */ - __IO uint32_t WDT0CLKDIV; /**< WDT0 Clock Divider, offset: 0x38C */ - uint8_t RESERVED_18[4]; - __IO uint32_t ADC0CLKDIV; /**< ADC0 Clock Divider, offset: 0x394 */ - uint8_t RESERVED_19[44]; - __IO uint32_t PLLCLKDIV; /**< PLL Clock Divider, offset: 0x3C4 */ - uint8_t RESERVED_20[8]; - __IO uint32_t CTIMERCLKDIV[5]; /**< CTimer Clock Divider, array offset: 0x3D0, array step: 0x4 */ - __IO uint32_t PLL1CLK0DIV; /**< PLL1 Clock 0 Divider, offset: 0x3E4 */ - __IO uint32_t PLL1CLK1DIV; /**< PLL1 Clock 1 Divider, offset: 0x3E8 */ - uint8_t RESERVED_21[4]; - __IO uint32_t UTICKCLKDIV; /**< UTICK Clock Divider, offset: 0x3F0 */ - __IO uint32_t CLKOUT_FRGCTRL; /**< CLKOUT FRG Control, offset: 0x3F4 */ - uint8_t RESERVED_22[4]; - __IO uint32_t CLKUNLOCK; /**< Clock Configuration Unlock, offset: 0x3FC */ - __IO uint32_t NVM_CTRL; /**< NVM Control, offset: 0x400 */ - __IO uint32_t ROMCR; /**< ROM Wait State, offset: 0x404 */ - uint8_t RESERVED_23[12]; - __IO uint32_t SMARTDMAINT; /**< SmartDMA Interrupt Hijack, offset: 0x414 */ - uint8_t RESERVED_24[76]; - __IO uint32_t ADC1CLKSEL; /**< ADC1 Clock Source Select, offset: 0x464 */ - __IO uint32_t ADC1CLKDIV; /**< ADC1 Clock Divider, offset: 0x468 */ - uint8_t RESERVED_25[4]; - __IO uint32_t RAM_INTERLEAVE; /**< Control PKC RAM Interleave Access, offset: 0x470 */ - uint8_t RESERVED_26[184]; - __IO uint32_t PLLCLKDIVSEL; /**< PLL Clock Divider Clock Selection, offset: 0x52C */ - __IO uint32_t I3C0FCLKSEL; /**< I3C0 Functional Clock Selection, offset: 0x530 */ - uint8_t RESERVED_27[12]; - __IO uint32_t I3C0FCLKDIV; /**< I3C0 Functional Clock FCLK Divider, offset: 0x540 */ - uint8_t RESERVED_28[4]; - __IO uint32_t MICFILFCLKSEL; /**< MICFIL Clock Selection, offset: 0x548 */ - __IO uint32_t MICFILFCLKDIV; /**< MICFIL Clock Division, offset: 0x54C */ - uint8_t RESERVED_29[16]; - __IO uint32_t FLEXIOCLKSEL; /**< FLEXIO Clock Selection, offset: 0x560 */ - __IO uint32_t FLEXIOCLKDIV; /**< FLEXIO Function Clock Divider, offset: 0x564 */ - uint8_t RESERVED_30[56]; - __IO uint32_t FLEXCAN0CLKSEL; /**< FLEXCAN0 Clock Selection, offset: 0x5A0 */ - __IO uint32_t FLEXCAN0CLKDIV; /**< FLEXCAN0 Function Clock Divider, offset: 0x5A4 */ - __IO uint32_t FLEXCAN1CLKSEL; /**< FLEXCAN1 Clock Selection, offset: 0x5A8 */ - __IO uint32_t FLEXCAN1CLKDIV; /**< FLEXCAN1 Function Clock Divider, offset: 0x5AC */ - uint8_t RESERVED_31[36]; - __IO uint32_t EWM0CLKSEL; /**< EWM0 Clock Selection, offset: 0x5D4 */ - __IO uint32_t WDT1CLKSEL; /**< WDT1 Clock Selection, offset: 0x5D8 */ - __IO uint32_t WDT1CLKDIV; /**< WDT1 Function Clock Divider, offset: 0x5DC */ - __IO uint32_t OSTIMERCLKSEL; /**< OSTIMER Clock Selection, offset: 0x5E0 */ - uint8_t RESERVED_32[12]; - __IO uint32_t CMP0FCLKSEL; /**< CMP0 Function Clock Selection, offset: 0x5F0 */ - __IO uint32_t CMP0FCLKDIV; /**< CMP0 Function Clock Divider, offset: 0x5F4 */ - __IO uint32_t CMP0RRCLKSEL; /**< CMP0 Round Robin Clock Selection, offset: 0x5F8 */ - __IO uint32_t CMP0RRCLKDIV; /**< CMP0 Round Robin Clock Divider, offset: 0x5FC */ - __IO uint32_t CMP1FCLKSEL; /**< CMP1 Function Clock Selection, offset: 0x600 */ - __IO uint32_t CMP1FCLKDIV; /**< CMP1 Function Clock Divider, offset: 0x604 */ - __IO uint32_t CMP1RRCLKSEL; /**< CMP1 Round Robin Clock Source Select, offset: 0x608 */ - __IO uint32_t CMP1RRCLKDIV; /**< CMP1 Round Robin Clock Division, offset: 0x60C */ - uint8_t RESERVED_33[508]; - __I uint32_t CPUSTAT; /**< CPU Status, offset: 0x80C */ - uint8_t RESERVED_34[20]; - __IO uint32_t LPCAC_CTRL; /**< LPCAC Control, offset: 0x824 */ - uint8_t RESERVED_35[40]; - __IO uint32_t FLEXCOMMCLKDIV[8]; /**< LP_FLEXCOMM Clock Divider, array offset: 0x850, array step: 0x4 */ - uint8_t RESERVED_36[8]; - __IO uint32_t UTICKCLKSEL; /**< UTICK Function Clock Source Select, offset: 0x878 */ - uint8_t RESERVED_37[4]; - __IO uint32_t SAI0CLKSEL; /**< SAI0 Function Clock Source Select, offset: 0x880 */ - __IO uint32_t SAI1CLKSEL; /**< SAI1 Function Clock Source Select, offset: 0x884 */ - __IO uint32_t SAI0CLKDIV; /**< SAI0 Function Clock Division, offset: 0x888 */ - __IO uint32_t SAI1CLKDIV; /**< SAI1 Function Clock Division, offset: 0x88C */ - uint8_t RESERVED_38[192]; - __IO uint32_t KEY_RETAIN_CTRL; /**< Key Retain Control, offset: 0x950 */ - uint8_t RESERVED_39[12]; - __IO uint32_t REF_CLK_CTRL; /**< FRO 48MHz Reference Clock Control, offset: 0x960 */ - __O uint32_t REF_CLK_CTRL_SET; /**< FRO 48MHz Reference Clock Control Set, offset: 0x964 */ - __O uint32_t REF_CLK_CTRL_CLR; /**< FRO 48MHz Reference Clock Control Clear, offset: 0x968 */ - __IO uint32_t GDET_CTRL[2]; /**< GDET Control Register, array offset: 0x96C, array step: 0x4 */ - __IO uint32_t ELS_ASSET_PROT; /**< ELS Asset Protection Register, offset: 0x974 */ - __IO uint32_t ELS_LOCK_CTRL; /**< ELS Lock Control, offset: 0x978 */ - __IO uint32_t ELS_LOCK_CTRL_DP; /**< ELS Lock Control DP, offset: 0x97C */ - __I uint32_t ELS_OTP_LC_STATE; /**< Life Cycle State Register, offset: 0x980 */ - __I uint32_t ELS_OTP_LC_STATE_DP; /**< Life Cycle State Register (Duplicate), offset: 0x984 */ - __IO uint32_t ELS_TEMPORAL_STATE; /**< ELS Temporal State, offset: 0x988 */ - __IO uint32_t ELS_KDF_MASK; /**< Key Derivation Function Mask, offset: 0x98C */ - uint8_t RESERVED_40[64]; - __I uint32_t ELS_AS_CFG0; /**< ELS AS Configuration, offset: 0x9D0 */ - __I uint32_t ELS_AS_CFG1; /**< ELS AS Configuration1, offset: 0x9D4 */ - __I uint32_t ELS_AS_CFG2; /**< ELS AS Configuration2, offset: 0x9D8 */ - __I uint32_t ELS_AS_CFG3; /**< ELS AS Configuration3, offset: 0x9DC */ - __I uint32_t ELS_AS_ST0; /**< ELS AS State Register, offset: 0x9E0 */ - __I uint32_t ELS_AS_ST1; /**< ELS AS State1, offset: 0x9E4 */ - __I uint32_t ELS_AS_BOOT_LOG0; /**< Boot state captured during boot: Main ROM log, offset: 0x9E8 */ - __I uint32_t ELS_AS_BOOT_LOG1; /**< Boot state captured during boot: Library log, offset: 0x9EC */ - __I uint32_t ELS_AS_BOOT_LOG2; /**< Boot state captured during boot: Hardware status signals log, offset: 0x9F0 */ - __I uint32_t ELS_AS_BOOT_LOG3; /**< Boot state captured during boot: Security log, offset: 0x9F4 */ - __I uint32_t ELS_AS_FLAG0; /**< ELS AS Flag0, offset: 0x9F8 */ - __I uint32_t ELS_AS_FLAG1; /**< ELS AS Flag1, offset: 0x9FC */ - uint8_t RESERVED_41[24]; - __IO uint32_t CLOCK_CTRL; /**< Clock Control, offset: 0xA18 */ - uint8_t RESERVED_42[276]; - __IO uint32_t I3C1FCLKSEL; /**< I3C1 Functional Clock Selection, offset: 0xB30 */ - uint8_t RESERVED_43[12]; - __IO uint32_t I3C1FCLKDIV; /**< I3C1 Functional Clock FCLK Divider, offset: 0xB40 */ - uint8_t RESERVED_44[28]; - __IO uint32_t GRAY_CODE_LSB; /**< Gray to Binary Converter Gray code_gray[31:0], offset: 0xB60 */ - __IO uint32_t GRAY_CODE_MSB; /**< Gray to Binary Converter Gray code_gray[41:32], offset: 0xB64 */ - __I uint32_t BINARY_CODE_LSB; /**< Gray to Binary Converter Binary Code [31:0], offset: 0xB68 */ - __I uint32_t BINARY_CODE_MSB; /**< Gray to Binary Converter Binary Code [41:32], offset: 0xB6C */ - uint8_t RESERVED_45[660]; - __IO uint32_t AUTOCLKGATEOVERRIDE; /**< Control Automatic Clock Gating, offset: 0xE04 */ - uint8_t RESERVED_46[36]; - __IO uint32_t AUTOCLKGATEOVERRIDEC; /**< Control Automatic Clock Gating C, offset: 0xE2C */ - uint8_t RESERVED_47[8]; - __IO uint32_t PWM0SUBCTL; /**< PWM0 Submodule Control, offset: 0xE38 */ - __IO uint32_t PWM1SUBCTL; /**< PWM1 Submodule Control, offset: 0xE3C */ - __IO uint32_t CTIMERGLOBALSTARTEN; /**< CTIMER Global Start Enable, offset: 0xE40 */ - __IO uint32_t ECC_ENABLE_CTRL; /**< RAM ECC Enable Control, offset: 0xE44 */ - uint8_t RESERVED_48[344]; - __IO uint32_t DEBUG_LOCK_EN; /**< Control Write Access to Security, offset: 0xFA0 */ - __IO uint32_t DEBUG_FEATURES; /**< Cortex Debug Features Control, offset: 0xFA4 */ - __IO uint32_t DEBUG_FEATURES_DP; /**< Cortex Debug Features Control (Duplicate), offset: 0xFA8 */ - uint8_t RESERVED_49[8]; - __IO uint32_t SWD_ACCESS_CPU[1]; /**< CPU0 Software Debug Access, array offset: 0xFB4, array step: 0x4 */ - uint8_t RESERVED_50[8]; - __IO uint32_t DEBUG_AUTH_BEACON; /**< Debug Authentication BEACON, offset: 0xFC0 */ - uint8_t RESERVED_51[44]; - __I uint32_t JTAG_ID; /**< JTAG Chip ID, offset: 0xFF0 */ - __I uint32_t DEVICE_TYPE; /**< Device Type, offset: 0xFF4 */ - __I uint32_t DEVICE_ID0; /**< Device ID, offset: 0xFF8 */ - __I uint32_t DIEID; /**< Chip Revision ID and Number, offset: 0xFFC */ -} SYSCON_Type; - -/* ---------------------------------------------------------------------------- - -- SYSCON Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SYSCON_Register_Masks SYSCON Register Masks - * @{ - */ - -/*! @name AHBMATPRIO - AHB Matrix Priority Control */ -/*! @{ */ - -#define SYSCON_AHBMATPRIO_PRI_CPU0_CBUS_MASK (0x3U) -#define SYSCON_AHBMATPRIO_PRI_CPU0_CBUS_SHIFT (0U) -/*! PRI_CPU0_CBUS - CPU0 C-AHB bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_PRI_CPU0_CBUS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_PRI_CPU0_CBUS_SHIFT)) & SYSCON_AHBMATPRIO_PRI_CPU0_CBUS_MASK) - -#define SYSCON_AHBMATPRIO_PRI_CPU0_SBUS_MASK (0xCU) -#define SYSCON_AHBMATPRIO_PRI_CPU0_SBUS_SHIFT (2U) -/*! PRI_CPU0_SBUS - CPU0 S-AHB bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_PRI_CPU0_SBUS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_PRI_CPU0_SBUS_SHIFT)) & SYSCON_AHBMATPRIO_PRI_CPU0_SBUS_MASK) - -#define SYSCON_AHBMATPRIO_DMA0_MASK (0x300U) -#define SYSCON_AHBMATPRIO_DMA0_SHIFT (8U) -/*! DMA0 - DMA0 controller bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_DMA0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_DMA0_SHIFT)) & SYSCON_AHBMATPRIO_DMA0_MASK) - -#define SYSCON_AHBMATPRIO_DMA1_MASK (0xC00U) -#define SYSCON_AHBMATPRIO_DMA1_SHIFT (10U) -/*! DMA1 - DMA1 controller bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_DMA1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_DMA1_SHIFT)) & SYSCON_AHBMATPRIO_DMA1_MASK) - -#define SYSCON_AHBMATPRIO_PRI_PKC_ELS_MASK (0x3000U) -#define SYSCON_AHBMATPRIO_PRI_PKC_ELS_SHIFT (12U) -/*! PRI_PKC_ELS - PKC and ELS bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_PRI_PKC_ELS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_PRI_PKC_ELS_SHIFT)) & SYSCON_AHBMATPRIO_PRI_PKC_ELS_MASK) - -#define SYSCON_AHBMATPRIO_PRI_USB_HS_MASK (0xC000000U) -#define SYSCON_AHBMATPRIO_PRI_USB_HS_SHIFT (26U) -/*! PRI_USB_HS - USB-HS bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_PRI_USB_HS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_PRI_USB_HS_SHIFT)) & SYSCON_AHBMATPRIO_PRI_USB_HS_MASK) -/*! @} */ - -/*! @name CPU0STCKCAL - Secure CPU0 System Tick Calibration */ -/*! @{ */ - -#define SYSCON_CPU0STCKCAL_TENMS_MASK (0xFFFFFFU) -#define SYSCON_CPU0STCKCAL_TENMS_SHIFT (0U) -/*! TENMS - Reload value for 10 ms (100 Hz) timing, subject to system clock skew errors. If the - * value reads as zero, the calibration value is not known. - */ -#define SYSCON_CPU0STCKCAL_TENMS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPU0STCKCAL_TENMS_SHIFT)) & SYSCON_CPU0STCKCAL_TENMS_MASK) - -#define SYSCON_CPU0STCKCAL_SKEW_MASK (0x1000000U) -#define SYSCON_CPU0STCKCAL_SKEW_SHIFT (24U) -/*! SKEW - Whether the TENMS value is exact. - * 0b0..TENMS value is exact - * 0b1..TENMS value is not exact or not given - */ -#define SYSCON_CPU0STCKCAL_SKEW(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPU0STCKCAL_SKEW_SHIFT)) & SYSCON_CPU0STCKCAL_SKEW_MASK) - -#define SYSCON_CPU0STCKCAL_NOREF_MASK (0x2000000U) -#define SYSCON_CPU0STCKCAL_NOREF_SHIFT (25U) -/*! NOREF - Whether the device provides a reference clock to the processor. - * 0b0..Reference clock is provided - * 0b1..No reference clock is provided - */ -#define SYSCON_CPU0STCKCAL_NOREF(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPU0STCKCAL_NOREF_SHIFT)) & SYSCON_CPU0STCKCAL_NOREF_MASK) -/*! @} */ - -/*! @name CPU0NSTCKCAL - Non-Secure CPU0 System Tick Calibration */ -/*! @{ */ - -#define SYSCON_CPU0NSTCKCAL_TENMS_MASK (0xFFFFFFU) -#define SYSCON_CPU0NSTCKCAL_TENMS_SHIFT (0U) -/*! TENMS - Reload value for 10 ms (100 Hz) timing, subject to system clock skew errors. If the - * value reads as zero, the calibration value is not known. - */ -#define SYSCON_CPU0NSTCKCAL_TENMS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPU0NSTCKCAL_TENMS_SHIFT)) & SYSCON_CPU0NSTCKCAL_TENMS_MASK) - -#define SYSCON_CPU0NSTCKCAL_SKEW_MASK (0x1000000U) -#define SYSCON_CPU0NSTCKCAL_SKEW_SHIFT (24U) -/*! SKEW - Indicates whether the TENMS value is exact. - * 0b0..TENMS value is exact - * 0b1..TENMS value is not exact or not given - */ -#define SYSCON_CPU0NSTCKCAL_SKEW(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPU0NSTCKCAL_SKEW_SHIFT)) & SYSCON_CPU0NSTCKCAL_SKEW_MASK) - -#define SYSCON_CPU0NSTCKCAL_NOREF_MASK (0x2000000U) -#define SYSCON_CPU0NSTCKCAL_NOREF_SHIFT (25U) -/*! NOREF - Indicates whether the device provides a reference clock to the processor. - * 0b0..Reference clock is provided - * 0b1..No reference clock is provided - */ -#define SYSCON_CPU0NSTCKCAL_NOREF(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPU0NSTCKCAL_NOREF_SHIFT)) & SYSCON_CPU0NSTCKCAL_NOREF_MASK) -/*! @} */ - -/*! @name NMISRC - NMI Source Select */ -/*! @{ */ - -#define SYSCON_NMISRC_IRQCPU0_MASK (0xFFU) -#define SYSCON_NMISRC_IRQCPU0_SHIFT (0U) -/*! IRQCPU0 - The IRQ number of the interrupt that acts as the Non-Maskable Interrupt (NMI) for CPU0, if enabled by NMIENCPU0. */ -#define SYSCON_NMISRC_IRQCPU0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NMISRC_IRQCPU0_SHIFT)) & SYSCON_NMISRC_IRQCPU0_MASK) - -#define SYSCON_NMISRC_NMIENCPU0_MASK (0x80000000U) -#define SYSCON_NMISRC_NMIENCPU0_SHIFT (31U) -/*! NMIENCPU0 - Enables the Non-Maskable Interrupt (NMI) source selected by IRQCPU0. - * 0b1..Enable. - * 0b0..Disable. - */ -#define SYSCON_NMISRC_NMIENCPU0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NMISRC_NMIENCPU0_SHIFT)) & SYSCON_NMISRC_NMIENCPU0_MASK) -/*! @} */ - -/*! @name PRESETCTRL0 - Peripheral Reset Control 0 */ -/*! @{ */ - -#define SYSCON_PRESETCTRL0_FMU_RST_MASK (0x200U) -#define SYSCON_PRESETCTRL0_FMU_RST_SHIFT (9U) -/*! FMU_RST - Flash management unit reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_FMU_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_FMU_RST_SHIFT)) & SYSCON_PRESETCTRL0_FMU_RST_MASK) - -#define SYSCON_PRESETCTRL0_MUX_RST_MASK (0x1000U) -#define SYSCON_PRESETCTRL0_MUX_RST_SHIFT (12U) -/*! MUX_RST - INPUTMUX reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_MUX_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_MUX_RST_SHIFT)) & SYSCON_PRESETCTRL0_MUX_RST_MASK) - -#define SYSCON_PRESETCTRL0_PORT0_RST_MASK (0x2000U) -#define SYSCON_PRESETCTRL0_PORT0_RST_SHIFT (13U) -/*! PORT0_RST - PORT0 controller reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_PORT0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_PORT0_RST_SHIFT)) & SYSCON_PRESETCTRL0_PORT0_RST_MASK) - -#define SYSCON_PRESETCTRL0_PORT1_RST_MASK (0x4000U) -#define SYSCON_PRESETCTRL0_PORT1_RST_SHIFT (14U) -/*! PORT1_RST - PORT1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_PORT1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_PORT1_RST_SHIFT)) & SYSCON_PRESETCTRL0_PORT1_RST_MASK) - -#define SYSCON_PRESETCTRL0_PORT2_RST_MASK (0x8000U) -#define SYSCON_PRESETCTRL0_PORT2_RST_SHIFT (15U) -/*! PORT2_RST - PORT2 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_PORT2_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_PORT2_RST_SHIFT)) & SYSCON_PRESETCTRL0_PORT2_RST_MASK) - -#define SYSCON_PRESETCTRL0_PORT3_RST_MASK (0x10000U) -#define SYSCON_PRESETCTRL0_PORT3_RST_SHIFT (16U) -/*! PORT3_RST - PORT3 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_PORT3_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_PORT3_RST_SHIFT)) & SYSCON_PRESETCTRL0_PORT3_RST_MASK) - -#define SYSCON_PRESETCTRL0_PORT4_RST_MASK (0x20000U) -#define SYSCON_PRESETCTRL0_PORT4_RST_SHIFT (17U) -/*! PORT4_RST - PORT4 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_PORT4_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_PORT4_RST_SHIFT)) & SYSCON_PRESETCTRL0_PORT4_RST_MASK) - -#define SYSCON_PRESETCTRL0_GPIO0_RST_MASK (0x80000U) -#define SYSCON_PRESETCTRL0_GPIO0_RST_SHIFT (19U) -/*! GPIO0_RST - GPIO0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_GPIO0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_GPIO0_RST_SHIFT)) & SYSCON_PRESETCTRL0_GPIO0_RST_MASK) - -#define SYSCON_PRESETCTRL0_GPIO1_RST_MASK (0x100000U) -#define SYSCON_PRESETCTRL0_GPIO1_RST_SHIFT (20U) -/*! GPIO1_RST - GPIO1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_GPIO1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_GPIO1_RST_SHIFT)) & SYSCON_PRESETCTRL0_GPIO1_RST_MASK) - -#define SYSCON_PRESETCTRL0_GPIO2_RST_MASK (0x200000U) -#define SYSCON_PRESETCTRL0_GPIO2_RST_SHIFT (21U) -/*! GPIO2_RST - GPIO2 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_GPIO2_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_GPIO2_RST_SHIFT)) & SYSCON_PRESETCTRL0_GPIO2_RST_MASK) - -#define SYSCON_PRESETCTRL0_GPIO3_RST_MASK (0x400000U) -#define SYSCON_PRESETCTRL0_GPIO3_RST_SHIFT (22U) -/*! GPIO3_RST - GPIO3 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_GPIO3_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_GPIO3_RST_SHIFT)) & SYSCON_PRESETCTRL0_GPIO3_RST_MASK) - -#define SYSCON_PRESETCTRL0_GPIO4_RST_MASK (0x800000U) -#define SYSCON_PRESETCTRL0_GPIO4_RST_SHIFT (23U) -/*! GPIO4_RST - GPIO4 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_GPIO4_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_GPIO4_RST_SHIFT)) & SYSCON_PRESETCTRL0_GPIO4_RST_MASK) - -#define SYSCON_PRESETCTRL0_PINT_RST_MASK (0x2000000U) -#define SYSCON_PRESETCTRL0_PINT_RST_SHIFT (25U) -/*! PINT_RST - PINT reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_PINT_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_PINT_RST_SHIFT)) & SYSCON_PRESETCTRL0_PINT_RST_MASK) - -#define SYSCON_PRESETCTRL0_DMA0_RST_MASK (0x4000000U) -#define SYSCON_PRESETCTRL0_DMA0_RST_SHIFT (26U) -/*! DMA0_RST - DMA0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_DMA0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_DMA0_RST_SHIFT)) & SYSCON_PRESETCTRL0_DMA0_RST_MASK) - -#define SYSCON_PRESETCTRL0_CRC_RST_MASK (0x8000000U) -#define SYSCON_PRESETCTRL0_CRC_RST_SHIFT (27U) -/*! CRC_RST - CRC reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_CRC_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_CRC_RST_SHIFT)) & SYSCON_PRESETCTRL0_CRC_RST_MASK) -/*! @} */ - -/*! @name PRESETCTRL1 - Peripheral Reset Control 1 */ -/*! @{ */ - -#define SYSCON_PRESETCTRL1_MRT_RST_MASK (0x1U) -#define SYSCON_PRESETCTRL1_MRT_RST_SHIFT (0U) -/*! MRT_RST - MRT reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_MRT_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_MRT_RST_SHIFT)) & SYSCON_PRESETCTRL1_MRT_RST_MASK) - -#define SYSCON_PRESETCTRL1_OSTIMER_RST_MASK (0x2U) -#define SYSCON_PRESETCTRL1_OSTIMER_RST_SHIFT (1U) -/*! OSTIMER_RST - OS Event Timer reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_OSTIMER_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_OSTIMER_RST_SHIFT)) & SYSCON_PRESETCTRL1_OSTIMER_RST_MASK) - -#define SYSCON_PRESETCTRL1_ADC0_RST_MASK (0x8U) -#define SYSCON_PRESETCTRL1_ADC0_RST_SHIFT (3U) -/*! ADC0_RST - ADC0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_ADC0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_ADC0_RST_SHIFT)) & SYSCON_PRESETCTRL1_ADC0_RST_MASK) - -#define SYSCON_PRESETCTRL1_ADC1_RST_MASK (0x10U) -#define SYSCON_PRESETCTRL1_ADC1_RST_SHIFT (4U) -/*! ADC1_RST - ADC1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_ADC1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_ADC1_RST_SHIFT)) & SYSCON_PRESETCTRL1_ADC1_RST_MASK) - -#define SYSCON_PRESETCTRL1_RTC_RST_MASK (0x40U) -#define SYSCON_PRESETCTRL1_RTC_RST_SHIFT (6U) -/*! RTC_RST - RTC reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_RTC_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_RTC_RST_SHIFT)) & SYSCON_PRESETCTRL1_RTC_RST_MASK) - -#define SYSCON_PRESETCTRL1_UTICK_RST_MASK (0x400U) -#define SYSCON_PRESETCTRL1_UTICK_RST_SHIFT (10U) -/*! UTICK_RST - UTICK reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_UTICK_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_UTICK_RST_SHIFT)) & SYSCON_PRESETCTRL1_UTICK_RST_MASK) - -#define SYSCON_PRESETCTRL1_FC0_RST_MASK (0x800U) -#define SYSCON_PRESETCTRL1_FC0_RST_SHIFT (11U) -/*! FC0_RST - LP_FLEXCOMM0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_FC0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_FC0_RST_SHIFT)) & SYSCON_PRESETCTRL1_FC0_RST_MASK) - -#define SYSCON_PRESETCTRL1_FC1_RST_MASK (0x1000U) -#define SYSCON_PRESETCTRL1_FC1_RST_SHIFT (12U) -/*! FC1_RST - LP_FLEXCOMM1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_FC1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_FC1_RST_SHIFT)) & SYSCON_PRESETCTRL1_FC1_RST_MASK) - -#define SYSCON_PRESETCTRL1_FC2_RST_MASK (0x2000U) -#define SYSCON_PRESETCTRL1_FC2_RST_SHIFT (13U) -/*! FC2_RST - LP_FLEXCOMM2 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_FC2_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_FC2_RST_SHIFT)) & SYSCON_PRESETCTRL1_FC2_RST_MASK) - -#define SYSCON_PRESETCTRL1_FC3_RST_MASK (0x4000U) -#define SYSCON_PRESETCTRL1_FC3_RST_SHIFT (14U) -/*! FC3_RST - LP_FLEXCOMM3 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_FC3_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_FC3_RST_SHIFT)) & SYSCON_PRESETCTRL1_FC3_RST_MASK) - -#define SYSCON_PRESETCTRL1_FC4_RST_MASK (0x8000U) -#define SYSCON_PRESETCTRL1_FC4_RST_SHIFT (15U) -/*! FC4_RST - LP_FLEXCOMM4 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_FC4_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_FC4_RST_SHIFT)) & SYSCON_PRESETCTRL1_FC4_RST_MASK) - -#define SYSCON_PRESETCTRL1_FC5_RST_MASK (0x10000U) -#define SYSCON_PRESETCTRL1_FC5_RST_SHIFT (16U) -/*! FC5_RST - LP_FLEXCOMM5 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_FC5_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_FC5_RST_SHIFT)) & SYSCON_PRESETCTRL1_FC5_RST_MASK) - -#define SYSCON_PRESETCTRL1_FC6_RST_MASK (0x20000U) -#define SYSCON_PRESETCTRL1_FC6_RST_SHIFT (17U) -/*! FC6_RST - LP_FLEXCOMM6 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_FC6_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_FC6_RST_SHIFT)) & SYSCON_PRESETCTRL1_FC6_RST_MASK) - -#define SYSCON_PRESETCTRL1_FC7_RST_MASK (0x40000U) -#define SYSCON_PRESETCTRL1_FC7_RST_SHIFT (18U) -/*! FC7_RST - LP_FLEXCOMM7 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_FC7_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_FC7_RST_SHIFT)) & SYSCON_PRESETCTRL1_FC7_RST_MASK) - -#define SYSCON_PRESETCTRL1_MICFIL_RST_MASK (0x200000U) -#define SYSCON_PRESETCTRL1_MICFIL_RST_SHIFT (21U) -/*! MICFIL_RST - MICFIL reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_MICFIL_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_MICFIL_RST_SHIFT)) & SYSCON_PRESETCTRL1_MICFIL_RST_MASK) - -#define SYSCON_PRESETCTRL1_TIMER2_RST_MASK (0x400000U) -#define SYSCON_PRESETCTRL1_TIMER2_RST_SHIFT (22U) -/*! TIMER2_RST - CTIMER2 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_TIMER2_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_TIMER2_RST_SHIFT)) & SYSCON_PRESETCTRL1_TIMER2_RST_MASK) - -#define SYSCON_PRESETCTRL1_TIMER0_RST_MASK (0x4000000U) -#define SYSCON_PRESETCTRL1_TIMER0_RST_SHIFT (26U) -/*! TIMER0_RST - CTIMER0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_TIMER0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_TIMER0_RST_SHIFT)) & SYSCON_PRESETCTRL1_TIMER0_RST_MASK) - -#define SYSCON_PRESETCTRL1_TIMER1_RST_MASK (0x8000000U) -#define SYSCON_PRESETCTRL1_TIMER1_RST_SHIFT (27U) -/*! TIMER1_RST - CTIMER1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_TIMER1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_TIMER1_RST_SHIFT)) & SYSCON_PRESETCTRL1_TIMER1_RST_MASK) - -#define SYSCON_PRESETCTRL1_SmartDMA_RST_MASK (0x80000000U) -#define SYSCON_PRESETCTRL1_SmartDMA_RST_SHIFT (31U) -/*! SmartDMA_RST - SmartDMA reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_SmartDMA_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_SmartDMA_RST_SHIFT)) & SYSCON_PRESETCTRL1_SmartDMA_RST_MASK) -/*! @} */ - -/*! @name PRESETCTRL2 - Peripheral Reset Control 2 */ -/*! @{ */ - -#define SYSCON_PRESETCTRL2_DMA1_RST_MASK (0x2U) -#define SYSCON_PRESETCTRL2_DMA1_RST_SHIFT (1U) -/*! DMA1_RST - DMA1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_DMA1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_DMA1_RST_SHIFT)) & SYSCON_PRESETCTRL2_DMA1_RST_MASK) - -#define SYSCON_PRESETCTRL2_FLEXIO_RST_MASK (0x10U) -#define SYSCON_PRESETCTRL2_FLEXIO_RST_SHIFT (4U) -/*! FLEXIO_RST - FLEXIO reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_FLEXIO_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_FLEXIO_RST_SHIFT)) & SYSCON_PRESETCTRL2_FLEXIO_RST_MASK) - -#define SYSCON_PRESETCTRL2_SAI0_RST_MASK (0x20U) -#define SYSCON_PRESETCTRL2_SAI0_RST_SHIFT (5U) -/*! SAI0_RST - SAI0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_SAI0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_SAI0_RST_SHIFT)) & SYSCON_PRESETCTRL2_SAI0_RST_MASK) - -#define SYSCON_PRESETCTRL2_SAI1_RST_MASK (0x40U) -#define SYSCON_PRESETCTRL2_SAI1_RST_SHIFT (6U) -/*! SAI1_RST - SAI1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_SAI1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_SAI1_RST_SHIFT)) & SYSCON_PRESETCTRL2_SAI1_RST_MASK) - -#define SYSCON_PRESETCTRL2_TRO_RST_MASK (0x80U) -#define SYSCON_PRESETCTRL2_TRO_RST_SHIFT (7U) -/*! TRO_RST - TRO reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_TRO_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_TRO_RST_SHIFT)) & SYSCON_PRESETCTRL2_TRO_RST_MASK) - -#define SYSCON_PRESETCTRL2_FREQME_RST_MASK (0x100U) -#define SYSCON_PRESETCTRL2_FREQME_RST_SHIFT (8U) -/*! FREQME_RST - FREQME reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_FREQME_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_FREQME_RST_SHIFT)) & SYSCON_PRESETCTRL2_FREQME_RST_MASK) - -#define SYSCON_PRESETCTRL2_FLEXCAN0_RST_MASK (0x4000U) -#define SYSCON_PRESETCTRL2_FLEXCAN0_RST_SHIFT (14U) -/*! FLEXCAN0_RST - CAN0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_FLEXCAN0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_FLEXCAN0_RST_SHIFT)) & SYSCON_PRESETCTRL2_FLEXCAN0_RST_MASK) - -#define SYSCON_PRESETCTRL2_FLEXCAN1_RST_MASK (0x8000U) -#define SYSCON_PRESETCTRL2_FLEXCAN1_RST_SHIFT (15U) -/*! FLEXCAN1_RST - CAN1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_FLEXCAN1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_FLEXCAN1_RST_SHIFT)) & SYSCON_PRESETCTRL2_FLEXCAN1_RST_MASK) - -#define SYSCON_PRESETCTRL2_USB_HS_RST_MASK (0x10000U) -#define SYSCON_PRESETCTRL2_USB_HS_RST_SHIFT (16U) -/*! USB_HS_RST - USB HS reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_USB_HS_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_USB_HS_RST_SHIFT)) & SYSCON_PRESETCTRL2_USB_HS_RST_MASK) - -#define SYSCON_PRESETCTRL2_USB_HS_PHY_RST_MASK (0x20000U) -#define SYSCON_PRESETCTRL2_USB_HS_PHY_RST_SHIFT (17U) -/*! USB_HS_PHY_RST - USB HS PHY reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_USB_HS_PHY_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_USB_HS_PHY_RST_SHIFT)) & SYSCON_PRESETCTRL2_USB_HS_PHY_RST_MASK) - -#define SYSCON_PRESETCTRL2_TIMER3_RST_MASK (0x200000U) -#define SYSCON_PRESETCTRL2_TIMER3_RST_SHIFT (21U) -/*! TIMER3_RST - CTIMER3 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_TIMER3_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_TIMER3_RST_SHIFT)) & SYSCON_PRESETCTRL2_TIMER3_RST_MASK) - -#define SYSCON_PRESETCTRL2_TIMER4_RST_MASK (0x400000U) -#define SYSCON_PRESETCTRL2_TIMER4_RST_SHIFT (22U) -/*! TIMER4_RST - CTIMER4 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_TIMER4_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_TIMER4_RST_SHIFT)) & SYSCON_PRESETCTRL2_TIMER4_RST_MASK) - -#define SYSCON_PRESETCTRL2_PUF_RST_MASK (0x800000U) -#define SYSCON_PRESETCTRL2_PUF_RST_SHIFT (23U) -/*! PUF_RST - PUF reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_PUF_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_PUF_RST_SHIFT)) & SYSCON_PRESETCTRL2_PUF_RST_MASK) - -#define SYSCON_PRESETCTRL2_PKC_RST_MASK (0x1000000U) -#define SYSCON_PRESETCTRL2_PKC_RST_SHIFT (24U) -/*! PKC_RST - PKC reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_PKC_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_PKC_RST_SHIFT)) & SYSCON_PRESETCTRL2_PKC_RST_MASK) -/*! @} */ - -/*! @name PRESETCTRL3 - Peripheral Reset Control 3 */ -/*! @{ */ - -#define SYSCON_PRESETCTRL3_I3C0_RST_MASK (0x1U) -#define SYSCON_PRESETCTRL3_I3C0_RST_SHIFT (0U) -/*! I3C0_RST - I3C0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_I3C0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_I3C0_RST_SHIFT)) & SYSCON_PRESETCTRL3_I3C0_RST_MASK) - -#define SYSCON_PRESETCTRL3_I3C1_RST_MASK (0x2U) -#define SYSCON_PRESETCTRL3_I3C1_RST_SHIFT (1U) -/*! I3C1_RST - I3C1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_I3C1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_I3C1_RST_SHIFT)) & SYSCON_PRESETCTRL3_I3C1_RST_MASK) - -#define SYSCON_PRESETCTRL3_QDC0_RST_MASK (0x10U) -#define SYSCON_PRESETCTRL3_QDC0_RST_SHIFT (4U) -/*! QDC0_RST - QDC0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_QDC0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_QDC0_RST_SHIFT)) & SYSCON_PRESETCTRL3_QDC0_RST_MASK) - -#define SYSCON_PRESETCTRL3_QDC1_RST_MASK (0x20U) -#define SYSCON_PRESETCTRL3_QDC1_RST_SHIFT (5U) -/*! QDC1_RST - QDC1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_QDC1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_QDC1_RST_SHIFT)) & SYSCON_PRESETCTRL3_QDC1_RST_MASK) - -#define SYSCON_PRESETCTRL3_PWM0_RST_MASK (0x40U) -#define SYSCON_PRESETCTRL3_PWM0_RST_SHIFT (6U) -/*! PWM0_RST - PWM0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_PWM0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_PWM0_RST_SHIFT)) & SYSCON_PRESETCTRL3_PWM0_RST_MASK) - -#define SYSCON_PRESETCTRL3_PWM1_RST_MASK (0x80U) -#define SYSCON_PRESETCTRL3_PWM1_RST_SHIFT (7U) -/*! PWM1_RST - PWM1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_PWM1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_PWM1_RST_SHIFT)) & SYSCON_PRESETCTRL3_PWM1_RST_MASK) - -#define SYSCON_PRESETCTRL3_AOI0_RST_MASK (0x100U) -#define SYSCON_PRESETCTRL3_AOI0_RST_SHIFT (8U) -/*! AOI0_RST - AOI0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_AOI0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_AOI0_RST_SHIFT)) & SYSCON_PRESETCTRL3_AOI0_RST_MASK) - -#define SYSCON_PRESETCTRL3_VREF_RST_MASK (0x80000U) -#define SYSCON_PRESETCTRL3_VREF_RST_SHIFT (19U) -/*! VREF_RST - VREF reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_VREF_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_VREF_RST_SHIFT)) & SYSCON_PRESETCTRL3_VREF_RST_MASK) - -#define SYSCON_PRESETCTRL3_EWM_RST_MASK (0x800000U) -#define SYSCON_PRESETCTRL3_EWM_RST_SHIFT (23U) -/*! EWM_RST - EWM reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_EWM_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_EWM_RST_SHIFT)) & SYSCON_PRESETCTRL3_EWM_RST_MASK) - -#define SYSCON_PRESETCTRL3_EIM_RST_MASK (0x1000000U) -#define SYSCON_PRESETCTRL3_EIM_RST_SHIFT (24U) -/*! EIM_RST - EIM reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_EIM_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_EIM_RST_SHIFT)) & SYSCON_PRESETCTRL3_EIM_RST_MASK) -/*! @} */ - -/*! @name PRESETCTRLSET - Peripheral Reset Control Set */ -/*! @{ */ - -#define SYSCON_PRESETCTRLSET_DATA_MASK (0xFFFFFFFFU) -#define SYSCON_PRESETCTRLSET_DATA_SHIFT (0U) -/*! DATA - Data array value, refer to corresponding position in PRESETCTRLn. */ -#define SYSCON_PRESETCTRLSET_DATA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRLSET_DATA_SHIFT)) & SYSCON_PRESETCTRLSET_DATA_MASK) -/*! @} */ - -/* The count of SYSCON_PRESETCTRLSET */ -#define SYSCON_PRESETCTRLSET_COUNT (4U) - -/*! @name PRESETCTRLCLR - Peripheral Reset Control Clear */ -/*! @{ */ - -#define SYSCON_PRESETCTRLCLR_DATA_MASK (0xFFFFFFFFU) -#define SYSCON_PRESETCTRLCLR_DATA_SHIFT (0U) -/*! DATA - Data array value, refer to corresponding position in PRESETCTRLn. */ -#define SYSCON_PRESETCTRLCLR_DATA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRLCLR_DATA_SHIFT)) & SYSCON_PRESETCTRLCLR_DATA_MASK) -/*! @} */ - -/* The count of SYSCON_PRESETCTRLCLR */ -#define SYSCON_PRESETCTRLCLR_COUNT (4U) - -/*! @name AHBCLKCTRL0 - AHB Clock Control 0 */ -/*! @{ */ - -#define SYSCON_AHBCLKCTRL0_ROM_MASK (0x2U) -#define SYSCON_AHBCLKCTRL0_ROM_SHIFT (1U) -/*! ROM - Enables the clock for the ROM - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_ROM(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_ROM_SHIFT)) & SYSCON_AHBCLKCTRL0_ROM_MASK) - -#define SYSCON_AHBCLKCTRL0_RAMB_CTRL_MASK (0x4U) -#define SYSCON_AHBCLKCTRL0_RAMB_CTRL_SHIFT (2U) -/*! RAMB_CTRL - Enables the clock for the RAMB Controller - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_RAMB_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_RAMB_CTRL_SHIFT)) & SYSCON_AHBCLKCTRL0_RAMB_CTRL_MASK) - -#define SYSCON_AHBCLKCTRL0_RAMC_CTRL_MASK (0x8U) -#define SYSCON_AHBCLKCTRL0_RAMC_CTRL_SHIFT (3U) -/*! RAMC_CTRL - Enables the clock for the RAMC Controller - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_RAMC_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_RAMC_CTRL_SHIFT)) & SYSCON_AHBCLKCTRL0_RAMC_CTRL_MASK) - -#define SYSCON_AHBCLKCTRL0_RAMD_CTRL_MASK (0x10U) -#define SYSCON_AHBCLKCTRL0_RAMD_CTRL_SHIFT (4U) -/*! RAMD_CTRL - Enables the clock for the RAMD Controller - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_RAMD_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_RAMD_CTRL_SHIFT)) & SYSCON_AHBCLKCTRL0_RAMD_CTRL_MASK) - -#define SYSCON_AHBCLKCTRL0_RAME_CTRL_MASK (0x20U) -#define SYSCON_AHBCLKCTRL0_RAME_CTRL_SHIFT (5U) -/*! RAME_CTRL - Enables the clock for the RAME Controller - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_RAME_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_RAME_CTRL_SHIFT)) & SYSCON_AHBCLKCTRL0_RAME_CTRL_MASK) - -#define SYSCON_AHBCLKCTRL0_FMU_MASK (0x200U) -#define SYSCON_AHBCLKCTRL0_FMU_SHIFT (9U) -/*! FMU - Enables the clock for the Flash Management Unit - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_FMU(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_FMU_SHIFT)) & SYSCON_AHBCLKCTRL0_FMU_MASK) - -#define SYSCON_AHBCLKCTRL0_FMC_MASK (0x400U) -#define SYSCON_AHBCLKCTRL0_FMC_SHIFT (10U) -/*! FMC - Enables the clock for the Flash Memory Controller - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_FMC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_FMC_SHIFT)) & SYSCON_AHBCLKCTRL0_FMC_MASK) - -#define SYSCON_AHBCLKCTRL0_MUX_MASK (0x1000U) -#define SYSCON_AHBCLKCTRL0_MUX_SHIFT (12U) -/*! MUX - Enables the clock for INPUTMUX - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_MUX(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_MUX_SHIFT)) & SYSCON_AHBCLKCTRL0_MUX_MASK) - -#define SYSCON_AHBCLKCTRL0_PORT0_MASK (0x2000U) -#define SYSCON_AHBCLKCTRL0_PORT0_SHIFT (13U) -/*! PORT0 - Enables the clock for PORT0 controller - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_PORT0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_PORT0_SHIFT)) & SYSCON_AHBCLKCTRL0_PORT0_MASK) - -#define SYSCON_AHBCLKCTRL0_PORT1_MASK (0x4000U) -#define SYSCON_AHBCLKCTRL0_PORT1_SHIFT (14U) -/*! PORT1 - Enables the clock for PORT1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_PORT1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_PORT1_SHIFT)) & SYSCON_AHBCLKCTRL0_PORT1_MASK) - -#define SYSCON_AHBCLKCTRL0_PORT2_MASK (0x8000U) -#define SYSCON_AHBCLKCTRL0_PORT2_SHIFT (15U) -/*! PORT2 - Enables the clock for PORT2 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_PORT2(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_PORT2_SHIFT)) & SYSCON_AHBCLKCTRL0_PORT2_MASK) - -#define SYSCON_AHBCLKCTRL0_PORT3_MASK (0x10000U) -#define SYSCON_AHBCLKCTRL0_PORT3_SHIFT (16U) -/*! PORT3 - Enables the clock for PORT3 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_PORT3(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_PORT3_SHIFT)) & SYSCON_AHBCLKCTRL0_PORT3_MASK) - -#define SYSCON_AHBCLKCTRL0_PORT4_MASK (0x20000U) -#define SYSCON_AHBCLKCTRL0_PORT4_SHIFT (17U) -/*! PORT4 - Enables the clock for PORT4 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_PORT4(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_PORT4_SHIFT)) & SYSCON_AHBCLKCTRL0_PORT4_MASK) - -#define SYSCON_AHBCLKCTRL0_GPIO0_MASK (0x80000U) -#define SYSCON_AHBCLKCTRL0_GPIO0_SHIFT (19U) -/*! GPIO0 - Enables the clock for GPIO0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_GPIO0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_GPIO0_SHIFT)) & SYSCON_AHBCLKCTRL0_GPIO0_MASK) - -#define SYSCON_AHBCLKCTRL0_GPIO1_MASK (0x100000U) -#define SYSCON_AHBCLKCTRL0_GPIO1_SHIFT (20U) -/*! GPIO1 - Enables the clock for GPIO1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_GPIO1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_GPIO1_SHIFT)) & SYSCON_AHBCLKCTRL0_GPIO1_MASK) - -#define SYSCON_AHBCLKCTRL0_GPIO2_MASK (0x200000U) -#define SYSCON_AHBCLKCTRL0_GPIO2_SHIFT (21U) -/*! GPIO2 - Enables the clock for GPIO2 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_GPIO2(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_GPIO2_SHIFT)) & SYSCON_AHBCLKCTRL0_GPIO2_MASK) - -#define SYSCON_AHBCLKCTRL0_GPIO3_MASK (0x400000U) -#define SYSCON_AHBCLKCTRL0_GPIO3_SHIFT (22U) -/*! GPIO3 - Enables the clock for GPIO3 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_GPIO3(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_GPIO3_SHIFT)) & SYSCON_AHBCLKCTRL0_GPIO3_MASK) - -#define SYSCON_AHBCLKCTRL0_GPIO4_MASK (0x800000U) -#define SYSCON_AHBCLKCTRL0_GPIO4_SHIFT (23U) -/*! GPIO4 - Enables the clock for GPIO4 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_GPIO4(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_GPIO4_SHIFT)) & SYSCON_AHBCLKCTRL0_GPIO4_MASK) - -#define SYSCON_AHBCLKCTRL0_PINT_MASK (0x2000000U) -#define SYSCON_AHBCLKCTRL0_PINT_SHIFT (25U) -/*! PINT - Enables the clock for PINT - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_PINT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_PINT_SHIFT)) & SYSCON_AHBCLKCTRL0_PINT_MASK) - -#define SYSCON_AHBCLKCTRL0_DMA0_MASK (0x4000000U) -#define SYSCON_AHBCLKCTRL0_DMA0_SHIFT (26U) -/*! DMA0 - Enables the clock for DMA0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_DMA0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_DMA0_SHIFT)) & SYSCON_AHBCLKCTRL0_DMA0_MASK) - -#define SYSCON_AHBCLKCTRL0_CRC_MASK (0x8000000U) -#define SYSCON_AHBCLKCTRL0_CRC_SHIFT (27U) -/*! CRC - Enables the clock for CRC - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_CRC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_CRC_SHIFT)) & SYSCON_AHBCLKCTRL0_CRC_MASK) - -#define SYSCON_AHBCLKCTRL0_WWDT0_MASK (0x10000000U) -#define SYSCON_AHBCLKCTRL0_WWDT0_SHIFT (28U) -/*! WWDT0 - Enables the clock for WWDT0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_WWDT0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_WWDT0_SHIFT)) & SYSCON_AHBCLKCTRL0_WWDT0_MASK) - -#define SYSCON_AHBCLKCTRL0_WWDT1_MASK (0x20000000U) -#define SYSCON_AHBCLKCTRL0_WWDT1_SHIFT (29U) -/*! WWDT1 - Enables the clock for WWDT1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_WWDT1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_WWDT1_SHIFT)) & SYSCON_AHBCLKCTRL0_WWDT1_MASK) -/*! @} */ - -/*! @name AHBCLKCTRL1 - AHB Clock Control 1 */ -/*! @{ */ - -#define SYSCON_AHBCLKCTRL1_MRT_MASK (0x1U) -#define SYSCON_AHBCLKCTRL1_MRT_SHIFT (0U) -/*! MRT - Enables the clock for MRT - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_MRT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_MRT_SHIFT)) & SYSCON_AHBCLKCTRL1_MRT_MASK) - -#define SYSCON_AHBCLKCTRL1_OSTIMER_MASK (0x2U) -#define SYSCON_AHBCLKCTRL1_OSTIMER_SHIFT (1U) -/*! OSTIMER - Enables the clock for the OS Event Timer - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_OSTIMER(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_OSTIMER_SHIFT)) & SYSCON_AHBCLKCTRL1_OSTIMER_MASK) - -#define SYSCON_AHBCLKCTRL1_ADC0_MASK (0x8U) -#define SYSCON_AHBCLKCTRL1_ADC0_SHIFT (3U) -/*! ADC0 - Enables the clock for ADC0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_ADC0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_ADC0_SHIFT)) & SYSCON_AHBCLKCTRL1_ADC0_MASK) - -#define SYSCON_AHBCLKCTRL1_ADC1_MASK (0x10U) -#define SYSCON_AHBCLKCTRL1_ADC1_SHIFT (4U) -/*! ADC1 - Enables the clock for ADC1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_ADC1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_ADC1_SHIFT)) & SYSCON_AHBCLKCTRL1_ADC1_MASK) - -#define SYSCON_AHBCLKCTRL1_RTC_MASK (0x40U) -#define SYSCON_AHBCLKCTRL1_RTC_SHIFT (6U) -/*! RTC - Enables the clock for RTC - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_RTC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_RTC_SHIFT)) & SYSCON_AHBCLKCTRL1_RTC_MASK) - -#define SYSCON_AHBCLKCTRL1_UTICK_MASK (0x400U) -#define SYSCON_AHBCLKCTRL1_UTICK_SHIFT (10U) -/*! UTICK - Enables the clock for UTICK - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_UTICK(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_UTICK_SHIFT)) & SYSCON_AHBCLKCTRL1_UTICK_MASK) - -#define SYSCON_AHBCLKCTRL1_FC0_MASK (0x800U) -#define SYSCON_AHBCLKCTRL1_FC0_SHIFT (11U) -/*! FC0 - Enables the clock for LP_FLEXCOMM0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_FC0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_FC0_SHIFT)) & SYSCON_AHBCLKCTRL1_FC0_MASK) - -#define SYSCON_AHBCLKCTRL1_FC1_MASK (0x1000U) -#define SYSCON_AHBCLKCTRL1_FC1_SHIFT (12U) -/*! FC1 - Enables the clock for LP_FLEXCOMM1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_FC1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_FC1_SHIFT)) & SYSCON_AHBCLKCTRL1_FC1_MASK) - -#define SYSCON_AHBCLKCTRL1_FC2_MASK (0x2000U) -#define SYSCON_AHBCLKCTRL1_FC2_SHIFT (13U) -/*! FC2 - Enables the clock for LP_FLEXCOMM2 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_FC2(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_FC2_SHIFT)) & SYSCON_AHBCLKCTRL1_FC2_MASK) - -#define SYSCON_AHBCLKCTRL1_FC3_MASK (0x4000U) -#define SYSCON_AHBCLKCTRL1_FC3_SHIFT (14U) -/*! FC3 - Enables the clock for LP_FLEXCOMM3 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_FC3(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_FC3_SHIFT)) & SYSCON_AHBCLKCTRL1_FC3_MASK) - -#define SYSCON_AHBCLKCTRL1_FC4_MASK (0x8000U) -#define SYSCON_AHBCLKCTRL1_FC4_SHIFT (15U) -/*! FC4 - Enables the clock for LP_FLEXCOMM4 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_FC4(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_FC4_SHIFT)) & SYSCON_AHBCLKCTRL1_FC4_MASK) - -#define SYSCON_AHBCLKCTRL1_FC5_MASK (0x10000U) -#define SYSCON_AHBCLKCTRL1_FC5_SHIFT (16U) -/*! FC5 - Enables the clock for LP_FLEXCOMM5 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_FC5(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_FC5_SHIFT)) & SYSCON_AHBCLKCTRL1_FC5_MASK) - -#define SYSCON_AHBCLKCTRL1_FC6_MASK (0x20000U) -#define SYSCON_AHBCLKCTRL1_FC6_SHIFT (17U) -/*! FC6 - Enables the clock for LP_FLEXCOMM6 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_FC6(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_FC6_SHIFT)) & SYSCON_AHBCLKCTRL1_FC6_MASK) - -#define SYSCON_AHBCLKCTRL1_FC7_MASK (0x40000U) -#define SYSCON_AHBCLKCTRL1_FC7_SHIFT (18U) -/*! FC7 - Enables the clock for LP_FLEXCOMM7 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_FC7(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_FC7_SHIFT)) & SYSCON_AHBCLKCTRL1_FC7_MASK) - -#define SYSCON_AHBCLKCTRL1_MICFIL_MASK (0x200000U) -#define SYSCON_AHBCLKCTRL1_MICFIL_SHIFT (21U) -/*! MICFIL - Enables the clock for MICFIL - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_MICFIL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_MICFIL_SHIFT)) & SYSCON_AHBCLKCTRL1_MICFIL_MASK) - -#define SYSCON_AHBCLKCTRL1_TIMER2_MASK (0x400000U) -#define SYSCON_AHBCLKCTRL1_TIMER2_SHIFT (22U) -/*! TIMER2 - Enables the clock for CTIMER2 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_TIMER2(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_TIMER2_SHIFT)) & SYSCON_AHBCLKCTRL1_TIMER2_MASK) - -#define SYSCON_AHBCLKCTRL1_TIMER0_MASK (0x4000000U) -#define SYSCON_AHBCLKCTRL1_TIMER0_SHIFT (26U) -/*! TIMER0 - Enables the clock for CTIMER0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_TIMER0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_TIMER0_SHIFT)) & SYSCON_AHBCLKCTRL1_TIMER0_MASK) - -#define SYSCON_AHBCLKCTRL1_TIMER1_MASK (0x8000000U) -#define SYSCON_AHBCLKCTRL1_TIMER1_SHIFT (27U) -/*! TIMER1 - Enables the clock for CTIMER1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_TIMER1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_TIMER1_SHIFT)) & SYSCON_AHBCLKCTRL1_TIMER1_MASK) - -#define SYSCON_AHBCLKCTRL1_PKC_RAM_MASK (0x20000000U) -#define SYSCON_AHBCLKCTRL1_PKC_RAM_SHIFT (29U) -/*! PKC_RAM - Enables the clock for PKC RAM - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_PKC_RAM(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_PKC_RAM_SHIFT)) & SYSCON_AHBCLKCTRL1_PKC_RAM_MASK) - -#define SYSCON_AHBCLKCTRL1_SmartDMA_MASK (0x80000000U) -#define SYSCON_AHBCLKCTRL1_SmartDMA_SHIFT (31U) -/*! SmartDMA - Enables the clock for SmartDMA - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_SmartDMA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_SmartDMA_SHIFT)) & SYSCON_AHBCLKCTRL1_SmartDMA_MASK) -/*! @} */ - -/*! @name AHBCLKCTRL2 - AHB Clock Control 2 */ -/*! @{ */ - -#define SYSCON_AHBCLKCTRL2_DMA1_MASK (0x2U) -#define SYSCON_AHBCLKCTRL2_DMA1_SHIFT (1U) -/*! DMA1 - Enables the clock for DMA1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_DMA1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_DMA1_SHIFT)) & SYSCON_AHBCLKCTRL2_DMA1_MASK) - -#define SYSCON_AHBCLKCTRL2_FLEXIO_MASK (0x10U) -#define SYSCON_AHBCLKCTRL2_FLEXIO_SHIFT (4U) -/*! FLEXIO - Enables the clock for Flexio - * 0b1..Enable clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_FLEXIO(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_FLEXIO_SHIFT)) & SYSCON_AHBCLKCTRL2_FLEXIO_MASK) - -#define SYSCON_AHBCLKCTRL2_SAI0_MASK (0x20U) -#define SYSCON_AHBCLKCTRL2_SAI0_SHIFT (5U) -/*! SAI0 - Enables the clock for SAI0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_SAI0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_SAI0_SHIFT)) & SYSCON_AHBCLKCTRL2_SAI0_MASK) - -#define SYSCON_AHBCLKCTRL2_SAI1_MASK (0x40U) -#define SYSCON_AHBCLKCTRL2_SAI1_SHIFT (6U) -/*! SAI1 - Enables the clock for SAI1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_SAI1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_SAI1_SHIFT)) & SYSCON_AHBCLKCTRL2_SAI1_MASK) - -#define SYSCON_AHBCLKCTRL2_TRO_MASK (0x80U) -#define SYSCON_AHBCLKCTRL2_TRO_SHIFT (7U) -/*! TRO - Enables the clock for TRO - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_TRO(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_TRO_SHIFT)) & SYSCON_AHBCLKCTRL2_TRO_MASK) - -#define SYSCON_AHBCLKCTRL2_FREQME_MASK (0x100U) -#define SYSCON_AHBCLKCTRL2_FREQME_SHIFT (8U) -/*! FREQME - Enables the clock for the Frequency meter - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_FREQME(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_FREQME_SHIFT)) & SYSCON_AHBCLKCTRL2_FREQME_MASK) - -#define SYSCON_AHBCLKCTRL2_FLEXCAN0_MASK (0x4000U) -#define SYSCON_AHBCLKCTRL2_FLEXCAN0_SHIFT (14U) -/*! FLEXCAN0 - Enables the clock for FLEXCAN0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_FLEXCAN0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_FLEXCAN0_SHIFT)) & SYSCON_AHBCLKCTRL2_FLEXCAN0_MASK) - -#define SYSCON_AHBCLKCTRL2_FLEXCAN1_MASK (0x8000U) -#define SYSCON_AHBCLKCTRL2_FLEXCAN1_SHIFT (15U) -/*! FLEXCAN1 - Enables the clock for FLEXCAN1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_FLEXCAN1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_FLEXCAN1_SHIFT)) & SYSCON_AHBCLKCTRL2_FLEXCAN1_MASK) - -#define SYSCON_AHBCLKCTRL2_USB_HS_MASK (0x10000U) -#define SYSCON_AHBCLKCTRL2_USB_HS_SHIFT (16U) -/*! USB_HS - Enables the clock for USB HS - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_USB_HS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_USB_HS_SHIFT)) & SYSCON_AHBCLKCTRL2_USB_HS_MASK) - -#define SYSCON_AHBCLKCTRL2_USB_HS_PHY_MASK (0x20000U) -#define SYSCON_AHBCLKCTRL2_USB_HS_PHY_SHIFT (17U) -/*! USB_HS_PHY - Enables the clock for USB HS PHY - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_USB_HS_PHY(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_USB_HS_PHY_SHIFT)) & SYSCON_AHBCLKCTRL2_USB_HS_PHY_MASK) - -#define SYSCON_AHBCLKCTRL2_ELS_MASK (0x40000U) -#define SYSCON_AHBCLKCTRL2_ELS_SHIFT (18U) -/*! ELS - Enables the clock for ELS - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_ELS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_ELS_SHIFT)) & SYSCON_AHBCLKCTRL2_ELS_MASK) - -#define SYSCON_AHBCLKCTRL2_TIMER3_MASK (0x200000U) -#define SYSCON_AHBCLKCTRL2_TIMER3_SHIFT (21U) -/*! TIMER3 - Enables the clock for CTIMER3 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_TIMER3(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_TIMER3_SHIFT)) & SYSCON_AHBCLKCTRL2_TIMER3_MASK) - -#define SYSCON_AHBCLKCTRL2_TIMER4_MASK (0x400000U) -#define SYSCON_AHBCLKCTRL2_TIMER4_SHIFT (22U) -/*! TIMER4 - Enables the clock for CTIMER4 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_TIMER4(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_TIMER4_SHIFT)) & SYSCON_AHBCLKCTRL2_TIMER4_MASK) - -#define SYSCON_AHBCLKCTRL2_PUF_MASK (0x800000U) -#define SYSCON_AHBCLKCTRL2_PUF_SHIFT (23U) -/*! PUF - Enables the clock for PUF - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_PUF(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_PUF_SHIFT)) & SYSCON_AHBCLKCTRL2_PUF_MASK) - -#define SYSCON_AHBCLKCTRL2_PKC_MASK (0x1000000U) -#define SYSCON_AHBCLKCTRL2_PKC_SHIFT (24U) -/*! PKC - Enables the clock for PKC - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_PKC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_PKC_SHIFT)) & SYSCON_AHBCLKCTRL2_PKC_MASK) - -#define SYSCON_AHBCLKCTRL2_SCG_MASK (0x4000000U) -#define SYSCON_AHBCLKCTRL2_SCG_SHIFT (26U) -/*! SCG - Enables the clock for SCG - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_SCG(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_SCG_SHIFT)) & SYSCON_AHBCLKCTRL2_SCG_MASK) - -#define SYSCON_AHBCLKCTRL2_GDET_MASK (0x20000000U) -#define SYSCON_AHBCLKCTRL2_GDET_SHIFT (29U) -/*! GDET - Enables the clock for GDET0 and GDET1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_GDET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_GDET_SHIFT)) & SYSCON_AHBCLKCTRL2_GDET_MASK) -/*! @} */ - -/*! @name AHBCLKCTRL3 - AHB Clock Control 3 */ -/*! @{ */ - -#define SYSCON_AHBCLKCTRL3_I3C0_MASK (0x1U) -#define SYSCON_AHBCLKCTRL3_I3C0_SHIFT (0U) -/*! I3C0 - Enables the clock for I3C0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_I3C0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_I3C0_SHIFT)) & SYSCON_AHBCLKCTRL3_I3C0_MASK) - -#define SYSCON_AHBCLKCTRL3_I3C1_MASK (0x2U) -#define SYSCON_AHBCLKCTRL3_I3C1_SHIFT (1U) -/*! I3C1 - Enables the clock for I3C1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_I3C1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_I3C1_SHIFT)) & SYSCON_AHBCLKCTRL3_I3C1_MASK) - -#define SYSCON_AHBCLKCTRL3_QDC0_MASK (0x10U) -#define SYSCON_AHBCLKCTRL3_QDC0_SHIFT (4U) -/*! QDC0 - Enables the clock for QDC0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_QDC0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_QDC0_SHIFT)) & SYSCON_AHBCLKCTRL3_QDC0_MASK) - -#define SYSCON_AHBCLKCTRL3_QDC1_MASK (0x20U) -#define SYSCON_AHBCLKCTRL3_QDC1_SHIFT (5U) -/*! QDC1 - Enables the clock for QDC1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_QDC1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_QDC1_SHIFT)) & SYSCON_AHBCLKCTRL3_QDC1_MASK) - -#define SYSCON_AHBCLKCTRL3_PWM0_MASK (0x40U) -#define SYSCON_AHBCLKCTRL3_PWM0_SHIFT (6U) -/*! PWM0 - Enables the clock for PWM0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_PWM0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_PWM0_SHIFT)) & SYSCON_AHBCLKCTRL3_PWM0_MASK) - -#define SYSCON_AHBCLKCTRL3_PWM1_MASK (0x80U) -#define SYSCON_AHBCLKCTRL3_PWM1_SHIFT (7U) -/*! PWM1 - Enables the clock for PWM1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_PWM1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_PWM1_SHIFT)) & SYSCON_AHBCLKCTRL3_PWM1_MASK) - -#define SYSCON_AHBCLKCTRL3_EVTG_MASK (0x100U) -#define SYSCON_AHBCLKCTRL3_EVTG_SHIFT (8U) -/*! EVTG - Enables the clock for EVTG - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_EVTG(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_EVTG_SHIFT)) & SYSCON_AHBCLKCTRL3_EVTG_MASK) - -#define SYSCON_AHBCLKCTRL3_VREF_MASK (0x80000U) -#define SYSCON_AHBCLKCTRL3_VREF_SHIFT (19U) -/*! VREF - Enables the clock for VREF - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_VREF(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_VREF_SHIFT)) & SYSCON_AHBCLKCTRL3_VREF_MASK) - -#define SYSCON_AHBCLKCTRL3_EWM_MASK (0x800000U) -#define SYSCON_AHBCLKCTRL3_EWM_SHIFT (23U) -/*! EWM - Enables the clock for EWM - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_EWM(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_EWM_SHIFT)) & SYSCON_AHBCLKCTRL3_EWM_MASK) - -#define SYSCON_AHBCLKCTRL3_EIM_MASK (0x1000000U) -#define SYSCON_AHBCLKCTRL3_EIM_SHIFT (24U) -/*! EIM - Enables the clock for EIM - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_EIM(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_EIM_SHIFT)) & SYSCON_AHBCLKCTRL3_EIM_MASK) - -#define SYSCON_AHBCLKCTRL3_ERM_MASK (0x2000000U) -#define SYSCON_AHBCLKCTRL3_ERM_SHIFT (25U) -/*! ERM - Enables the clock for ERM - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_ERM(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_ERM_SHIFT)) & SYSCON_AHBCLKCTRL3_ERM_MASK) - -#define SYSCON_AHBCLKCTRL3_INTM_MASK (0x4000000U) -#define SYSCON_AHBCLKCTRL3_INTM_SHIFT (26U) -/*! INTM - Enables the clock for INTM - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_INTM(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_INTM_SHIFT)) & SYSCON_AHBCLKCTRL3_INTM_MASK) -/*! @} */ - -/*! @name AHBCLKCTRLSET - AHB Clock Control Set */ -/*! @{ */ - -#define SYSCON_AHBCLKCTRLSET_DATA_MASK (0xFFFFFFFFU) -#define SYSCON_AHBCLKCTRLSET_DATA_SHIFT (0U) -/*! DATA - Data array value */ -#define SYSCON_AHBCLKCTRLSET_DATA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRLSET_DATA_SHIFT)) & SYSCON_AHBCLKCTRLSET_DATA_MASK) -/*! @} */ - -/* The count of SYSCON_AHBCLKCTRLSET */ -#define SYSCON_AHBCLKCTRLSET_COUNT (4U) - -/*! @name AHBCLKCTRLCLR - AHB Clock Control Clear */ -/*! @{ */ - -#define SYSCON_AHBCLKCTRLCLR_DATA_MASK (0xFFFFFFFFU) -#define SYSCON_AHBCLKCTRLCLR_DATA_SHIFT (0U) -/*! DATA - Data array value */ -#define SYSCON_AHBCLKCTRLCLR_DATA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRLCLR_DATA_SHIFT)) & SYSCON_AHBCLKCTRLCLR_DATA_MASK) -/*! @} */ - -/* The count of SYSCON_AHBCLKCTRLCLR */ -#define SYSCON_AHBCLKCTRLCLR_COUNT (4U) - -/*! @name SYSTICKCLKSEL0 - CPU0 System Tick Timer Source Select */ -/*! @{ */ - -#define SYSCON_SYSTICKCLKSEL0_SEL_MASK (0x7U) -#define SYSCON_SYSTICKCLKSEL0_SEL_SHIFT (0U) -/*! SEL - Selects the System Tick Timer for CPU0 source - * 0b000..SYSTICKCLKDIV0 output - * 0b001..Clk 1 MHz clock - * 0b010..LP Oscillator clock - * 0b011..No clock - * 0b100..No clock - * 0b101..No clock - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_SYSTICKCLKSEL0_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SYSTICKCLKSEL0_SEL_SHIFT)) & SYSCON_SYSTICKCLKSEL0_SEL_MASK) -/*! @} */ - -/*! @name TRACECLKSEL - Trace Clock Source Select */ -/*! @{ */ - -#define SYSCON_TRACECLKSEL_SEL_MASK (0x7U) -#define SYSCON_TRACECLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the trace clock source. - * 0b000..TRACECLKDIV output - * 0b001..Clk 1 MHz clock - * 0b010..LP Oscillator clock - * 0b011..No clock - * 0b100..No clock - * 0b101..No clock - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_TRACECLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_TRACECLKSEL_SEL_SHIFT)) & SYSCON_TRACECLKSEL_SEL_MASK) -/*! @} */ - -/*! @name CTIMERCLKSEL - CTIMER Clock Source Select */ -/*! @{ */ - -#define SYSCON_CTIMERCLKSEL_SEL_MASK (0xFU) -#define SYSCON_CTIMERCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the CTIMER clock source. - * 0b0000..FRO_1M clock - * 0b0001..PLL0 clock - * 0b0010..PLL1_clk0 clock - * 0b0011..FRO_HF clock - * 0b0100..FRO 12MHz clock - * 0b0101..SAI0 MCLK IN clock - * 0b0110..LP Oscillator clock - * 0b0111..No clock - * 0b1000..SAI1 MCLK IN clock - * 0b1001..SAI0 TX_BCLK clock - * 0b1010..SAI0 RX_BCLK clock - * 0b1011..SAI1 TX_BCLK clock - * 0b1100..SAI1 RX_BCLK clock - * 0b1101..No clock - * 0b1110..No clock - * 0b1111..No clock - */ -#define SYSCON_CTIMERCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERCLKSEL_SEL_SHIFT)) & SYSCON_CTIMERCLKSEL_SEL_MASK) -/*! @} */ - -/* The count of SYSCON_CTIMERCLKSEL */ -#define SYSCON_CTIMERCLKSEL_COUNT (5U) - -/*! @name CLKOUTSEL - CLKOUT Clock Source Select */ -/*! @{ */ - -#define SYSCON_CLKOUTSEL_SEL_MASK (0xFU) -#define SYSCON_CLKOUTSEL_SEL_SHIFT (0U) -/*! SEL - Selects the CLKOUT clock source. - * 0b0000..Main clock (main_clk) - * 0b0001..PLL0 clock (pll0_clk) - * 0b0010..CLKIN clock (clk_in) - * 0b0011..FRO_HF clock (fro_hf) - * 0b0100..FRO 12 MHz clock (fro_12m) - * 0b0101..PLL1_clk0 clock (pll1_clk) - * 0b0110..LP Oscillator clock (lp_osc) - * 0b0111..USB PLL clock (usb_pll_clk) - * 0b1000..No clock - * 0b1001..No clock - * 0b1010..No clock - * 0b1011..No clock - * 0b1100..No clock - * 0b1101..No clock - * 0b1110..No clock - * 0b1111..No clock - */ -#define SYSCON_CLKOUTSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLKOUTSEL_SEL_SHIFT)) & SYSCON_CLKOUTSEL_SEL_MASK) -/*! @} */ - -/*! @name ADC0CLKSEL - ADC0 Clock Source Select */ -/*! @{ */ - -#define SYSCON_ADC0CLKSEL_SEL_MASK (0x7U) -#define SYSCON_ADC0CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the ADC0 clock source. - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..FRO_HF clock - * 0b011..FRO 12 MHz clock - * 0b100..Clk_in - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_ADC0CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ADC0CLKSEL_SEL_SHIFT)) & SYSCON_ADC0CLKSEL_SEL_MASK) -/*! @} */ - -/*! @name FCCLKSEL - LP_FLEXCOMM Clock Source Select for Fractional Rate Divider */ -/*! @{ */ - -#define SYSCON_FCCLKSEL_SEL_MASK (0x7U) -#define SYSCON_FCCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the LP_FLEXCOMM clock source for Fractional Rate Divider. - * 0b000..No clock - * 0b001..PLL divided clock - * 0b010..FRO 12 MHz clock - * 0b011..fro_hf_div clock - * 0b100..clk_1m clock - * 0b101..USB PLL clock - * 0b110..LP Oscillator clock - * 0b111..No clock - */ -#define SYSCON_FCCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FCCLKSEL_SEL_SHIFT)) & SYSCON_FCCLKSEL_SEL_MASK) -/*! @} */ - -/* The count of SYSCON_FCCLKSEL */ -#define SYSCON_FCCLKSEL_COUNT (8U) - -/*! @name SYSTICKCLKDIV - CPU0 System Tick Timer Divider */ -/*! @{ */ - -#define SYSCON_SYSTICKCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_SYSTICKCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_SYSTICKCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SYSTICKCLKDIV_DIV_SHIFT)) & SYSCON_SYSTICKCLKDIV_DIV_MASK) - -#define SYSCON_SYSTICKCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_SYSTICKCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset. - * 0b0..Divider is not reset - */ -#define SYSCON_SYSTICKCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SYSTICKCLKDIV_RESET_SHIFT)) & SYSCON_SYSTICKCLKDIV_RESET_MASK) - -#define SYSCON_SYSTICKCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_SYSTICKCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_SYSTICKCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SYSTICKCLKDIV_HALT_SHIFT)) & SYSCON_SYSTICKCLKDIV_HALT_MASK) - -#define SYSCON_SYSTICKCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_SYSTICKCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_SYSTICKCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SYSTICKCLKDIV_UNSTAB_SHIFT)) & SYSCON_SYSTICKCLKDIV_UNSTAB_MASK) -/*! @} */ - -/* The count of SYSCON_SYSTICKCLKDIV */ -#define SYSCON_SYSTICKCLKDIV_COUNT (1U) - -/*! @name TRACECLKDIV - TRACE Clock Divider */ -/*! @{ */ - -#define SYSCON_TRACECLKDIV_DIV_MASK (0xFFU) -#define SYSCON_TRACECLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_TRACECLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_TRACECLKDIV_DIV_SHIFT)) & SYSCON_TRACECLKDIV_DIV_MASK) - -#define SYSCON_TRACECLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_TRACECLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_TRACECLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_TRACECLKDIV_RESET_SHIFT)) & SYSCON_TRACECLKDIV_RESET_MASK) - -#define SYSCON_TRACECLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_TRACECLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_TRACECLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_TRACECLKDIV_HALT_SHIFT)) & SYSCON_TRACECLKDIV_HALT_MASK) - -#define SYSCON_TRACECLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_TRACECLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_TRACECLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_TRACECLKDIV_UNSTAB_SHIFT)) & SYSCON_TRACECLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name SLOWCLKDIV - SLOW_CLK Clock Divider */ -/*! @{ */ - -#define SYSCON_SLOWCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_SLOWCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_SLOWCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SLOWCLKDIV_RESET_SHIFT)) & SYSCON_SLOWCLKDIV_RESET_MASK) - -#define SYSCON_SLOWCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_SLOWCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_SLOWCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SLOWCLKDIV_HALT_SHIFT)) & SYSCON_SLOWCLKDIV_HALT_MASK) - -#define SYSCON_SLOWCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_SLOWCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_SLOWCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SLOWCLKDIV_UNSTAB_SHIFT)) & SYSCON_SLOWCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name AHBCLKDIV - System Clock Divider */ -/*! @{ */ - -#define SYSCON_AHBCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_AHBCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_AHBCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKDIV_DIV_SHIFT)) & SYSCON_AHBCLKDIV_DIV_MASK) - -#define SYSCON_AHBCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_AHBCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_AHBCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKDIV_UNSTAB_SHIFT)) & SYSCON_AHBCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name CLKOUTDIV - CLKOUT Clock Divider */ -/*! @{ */ - -#define SYSCON_CLKOUTDIV_DIV_MASK (0xFFU) -#define SYSCON_CLKOUTDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_CLKOUTDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLKOUTDIV_DIV_SHIFT)) & SYSCON_CLKOUTDIV_DIV_MASK) - -#define SYSCON_CLKOUTDIV_RESET_MASK (0x20000000U) -#define SYSCON_CLKOUTDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_CLKOUTDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLKOUTDIV_RESET_SHIFT)) & SYSCON_CLKOUTDIV_RESET_MASK) - -#define SYSCON_CLKOUTDIV_HALT_MASK (0x40000000U) -#define SYSCON_CLKOUTDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_CLKOUTDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLKOUTDIV_HALT_SHIFT)) & SYSCON_CLKOUTDIV_HALT_MASK) - -#define SYSCON_CLKOUTDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_CLKOUTDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_CLKOUTDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLKOUTDIV_UNSTAB_SHIFT)) & SYSCON_CLKOUTDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name FROHFDIV - FRO_HF_DIV Clock Divider */ -/*! @{ */ - -#define SYSCON_FROHFDIV_DIV_MASK (0xFFU) -#define SYSCON_FROHFDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_FROHFDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FROHFDIV_DIV_SHIFT)) & SYSCON_FROHFDIV_DIV_MASK) - -#define SYSCON_FROHFDIV_HALT_MASK (0x40000000U) -#define SYSCON_FROHFDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running, this bit is set to 0 when the register is written. - */ -#define SYSCON_FROHFDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FROHFDIV_HALT_SHIFT)) & SYSCON_FROHFDIV_HALT_MASK) - -#define SYSCON_FROHFDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_FROHFDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_FROHFDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FROHFDIV_UNSTAB_SHIFT)) & SYSCON_FROHFDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name WDT0CLKDIV - WDT0 Clock Divider */ -/*! @{ */ - -#define SYSCON_WDT0CLKDIV_DIV_MASK (0x3FU) -#define SYSCON_WDT0CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_WDT0CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_WDT0CLKDIV_DIV_SHIFT)) & SYSCON_WDT0CLKDIV_DIV_MASK) - -#define SYSCON_WDT0CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_WDT0CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_WDT0CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_WDT0CLKDIV_RESET_SHIFT)) & SYSCON_WDT0CLKDIV_RESET_MASK) - -#define SYSCON_WDT0CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_WDT0CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_WDT0CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_WDT0CLKDIV_HALT_SHIFT)) & SYSCON_WDT0CLKDIV_HALT_MASK) - -#define SYSCON_WDT0CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_WDT0CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_WDT0CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_WDT0CLKDIV_UNSTAB_SHIFT)) & SYSCON_WDT0CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name ADC0CLKDIV - ADC0 Clock Divider */ -/*! @{ */ - -#define SYSCON_ADC0CLKDIV_DIV_MASK (0x7U) -#define SYSCON_ADC0CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_ADC0CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ADC0CLKDIV_DIV_SHIFT)) & SYSCON_ADC0CLKDIV_DIV_MASK) - -#define SYSCON_ADC0CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_ADC0CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_ADC0CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ADC0CLKDIV_RESET_SHIFT)) & SYSCON_ADC0CLKDIV_RESET_MASK) - -#define SYSCON_ADC0CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_ADC0CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_ADC0CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ADC0CLKDIV_HALT_SHIFT)) & SYSCON_ADC0CLKDIV_HALT_MASK) - -#define SYSCON_ADC0CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_ADC0CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_ADC0CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ADC0CLKDIV_UNSTAB_SHIFT)) & SYSCON_ADC0CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name PLLCLKDIV - PLL Clock Divider */ -/*! @{ */ - -#define SYSCON_PLLCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_PLLCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_PLLCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLLCLKDIV_DIV_SHIFT)) & SYSCON_PLLCLKDIV_DIV_MASK) - -#define SYSCON_PLLCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_PLLCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_PLLCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLLCLKDIV_RESET_SHIFT)) & SYSCON_PLLCLKDIV_RESET_MASK) - -#define SYSCON_PLLCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_PLLCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_PLLCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLLCLKDIV_HALT_SHIFT)) & SYSCON_PLLCLKDIV_HALT_MASK) - -#define SYSCON_PLLCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_PLLCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_PLLCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLLCLKDIV_UNSTAB_SHIFT)) & SYSCON_PLLCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name CTIMERXCLKDIV_CTIMERCLKDIV - CTimer Clock Divider */ -/*! @{ */ - -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_DIV_SHIFT)) & SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_DIV_MASK) - -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b0..Divider is not reset - * 0b1..Divider is reset - */ -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_RESET_SHIFT)) & SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_RESET_MASK) - -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock has stopped - */ -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_HALT_SHIFT)) & SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_HALT_MASK) - -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Stable divider clock - * 0b1..Unstable clock frequency - */ -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_UNSTAB_SHIFT)) & SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_UNSTAB_MASK) -/*! @} */ - -/* The count of SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV */ -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_COUNT (5U) - -/*! @name PLL1CLK0DIV - PLL1 Clock 0 Divider */ -/*! @{ */ - -#define SYSCON_PLL1CLK0DIV_DIV_MASK (0xFFU) -#define SYSCON_PLL1CLK0DIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_PLL1CLK0DIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLL1CLK0DIV_DIV_SHIFT)) & SYSCON_PLL1CLK0DIV_DIV_MASK) - -#define SYSCON_PLL1CLK0DIV_RESET_MASK (0x20000000U) -#define SYSCON_PLL1CLK0DIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_PLL1CLK0DIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLL1CLK0DIV_RESET_SHIFT)) & SYSCON_PLL1CLK0DIV_RESET_MASK) - -#define SYSCON_PLL1CLK0DIV_HALT_MASK (0x40000000U) -#define SYSCON_PLL1CLK0DIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_PLL1CLK0DIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLL1CLK0DIV_HALT_SHIFT)) & SYSCON_PLL1CLK0DIV_HALT_MASK) - -#define SYSCON_PLL1CLK0DIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_PLL1CLK0DIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_PLL1CLK0DIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLL1CLK0DIV_UNSTAB_SHIFT)) & SYSCON_PLL1CLK0DIV_UNSTAB_MASK) -/*! @} */ - -/*! @name PLL1CLK1DIV - PLL1 Clock 1 Divider */ -/*! @{ */ - -#define SYSCON_PLL1CLK1DIV_DIV_MASK (0xFFU) -#define SYSCON_PLL1CLK1DIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_PLL1CLK1DIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLL1CLK1DIV_DIV_SHIFT)) & SYSCON_PLL1CLK1DIV_DIV_MASK) - -#define SYSCON_PLL1CLK1DIV_RESET_MASK (0x20000000U) -#define SYSCON_PLL1CLK1DIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_PLL1CLK1DIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLL1CLK1DIV_RESET_SHIFT)) & SYSCON_PLL1CLK1DIV_RESET_MASK) - -#define SYSCON_PLL1CLK1DIV_HALT_MASK (0x40000000U) -#define SYSCON_PLL1CLK1DIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_PLL1CLK1DIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLL1CLK1DIV_HALT_SHIFT)) & SYSCON_PLL1CLK1DIV_HALT_MASK) - -#define SYSCON_PLL1CLK1DIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_PLL1CLK1DIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_PLL1CLK1DIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLL1CLK1DIV_UNSTAB_SHIFT)) & SYSCON_PLL1CLK1DIV_UNSTAB_MASK) -/*! @} */ - -/*! @name UTICKCLKDIV - UTICK Clock Divider */ -/*! @{ */ - -#define SYSCON_UTICKCLKDIV_DIV_MASK (0x3FU) -#define SYSCON_UTICKCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_UTICKCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_UTICKCLKDIV_DIV_SHIFT)) & SYSCON_UTICKCLKDIV_DIV_MASK) - -#define SYSCON_UTICKCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_UTICKCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_UTICKCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_UTICKCLKDIV_RESET_SHIFT)) & SYSCON_UTICKCLKDIV_RESET_MASK) - -#define SYSCON_UTICKCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_UTICKCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_UTICKCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_UTICKCLKDIV_HALT_SHIFT)) & SYSCON_UTICKCLKDIV_HALT_MASK) - -#define SYSCON_UTICKCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_UTICKCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_UTICKCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_UTICKCLKDIV_UNSTAB_SHIFT)) & SYSCON_UTICKCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name CLKOUT_FRGCTRL - CLKOUT FRG Control */ -/*! @{ */ - -#define SYSCON_CLKOUT_FRGCTRL_DIV_MASK (0xFFU) -#define SYSCON_CLKOUT_FRGCTRL_DIV_SHIFT (0U) -/*! DIV - Divider value */ -#define SYSCON_CLKOUT_FRGCTRL_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLKOUT_FRGCTRL_DIV_SHIFT)) & SYSCON_CLKOUT_FRGCTRL_DIV_MASK) - -#define SYSCON_CLKOUT_FRGCTRL_MULT_MASK (0xFF00U) -#define SYSCON_CLKOUT_FRGCTRL_MULT_SHIFT (8U) -/*! MULT - Numerator value */ -#define SYSCON_CLKOUT_FRGCTRL_MULT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLKOUT_FRGCTRL_MULT_SHIFT)) & SYSCON_CLKOUT_FRGCTRL_MULT_MASK) -/*! @} */ - -/*! @name CLKUNLOCK - Clock Configuration Unlock */ -/*! @{ */ - -#define SYSCON_CLKUNLOCK_UNLOCK_MASK (0x1U) -#define SYSCON_CLKUNLOCK_UNLOCK_SHIFT (0U) -/*! UNLOCK - Controls clock configuration registers access (for example, xxxDIV, xxxSEL) - * 0b1..Freezes all clock configuration registers update - * 0b0..Updates are allowed to all clock configuration registers - */ -#define SYSCON_CLKUNLOCK_UNLOCK(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLKUNLOCK_UNLOCK_SHIFT)) & SYSCON_CLKUNLOCK_UNLOCK_MASK) -/*! @} */ - -/*! @name NVM_CTRL - NVM Control */ -/*! @{ */ - -#define SYSCON_NVM_CTRL_DIS_FLASH_SPEC_MASK (0x1U) -#define SYSCON_NVM_CTRL_DIS_FLASH_SPEC_SHIFT (0U) -/*! DIS_FLASH_SPEC - Flash speculation control - * 0b0..Enables flash speculation - * 0b1..Disables flash speculation - */ -#define SYSCON_NVM_CTRL_DIS_FLASH_SPEC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_DIS_FLASH_SPEC_SHIFT)) & SYSCON_NVM_CTRL_DIS_FLASH_SPEC_MASK) - -#define SYSCON_NVM_CTRL_DIS_DATA_SPEC_MASK (0x2U) -#define SYSCON_NVM_CTRL_DIS_DATA_SPEC_SHIFT (1U) -/*! DIS_DATA_SPEC - Flash data speculation control - * 0b0..Enables data speculation - * 0b1..Disables data speculation - */ -#define SYSCON_NVM_CTRL_DIS_DATA_SPEC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_DIS_DATA_SPEC_SHIFT)) & SYSCON_NVM_CTRL_DIS_DATA_SPEC_MASK) - -#define SYSCON_NVM_CTRL_DIS_FLASH_CACHE_MASK (0x4U) -#define SYSCON_NVM_CTRL_DIS_FLASH_CACHE_SHIFT (2U) -/*! DIS_FLASH_CACHE - Flash cache control - * 0b0..Enables flash cache - * 0b1..Disables flash cache - */ -#define SYSCON_NVM_CTRL_DIS_FLASH_CACHE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_DIS_FLASH_CACHE_SHIFT)) & SYSCON_NVM_CTRL_DIS_FLASH_CACHE_MASK) - -#define SYSCON_NVM_CTRL_DIS_FLASH_INST_MASK (0x8U) -#define SYSCON_NVM_CTRL_DIS_FLASH_INST_SHIFT (3U) -/*! DIS_FLASH_INST - Flash instruction cache control - * 0b0..Enables flash instruction cache when DIS_FLASH_CACHE=0 - * 0b1..Disables flash instruction cache - */ -#define SYSCON_NVM_CTRL_DIS_FLASH_INST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_DIS_FLASH_INST_SHIFT)) & SYSCON_NVM_CTRL_DIS_FLASH_INST_MASK) - -#define SYSCON_NVM_CTRL_DIS_FLASH_DATA_MASK (0x10U) -#define SYSCON_NVM_CTRL_DIS_FLASH_DATA_SHIFT (4U) -/*! DIS_FLASH_DATA - Flash data cache control - * 0b0..Enables flash data cache when DIS_FLASH_CACHE=0 - * 0b1..Disables flash data cache - */ -#define SYSCON_NVM_CTRL_DIS_FLASH_DATA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_DIS_FLASH_DATA_SHIFT)) & SYSCON_NVM_CTRL_DIS_FLASH_DATA_MASK) - -#define SYSCON_NVM_CTRL_CLR_FLASH_CACHE_MASK (0x20U) -#define SYSCON_NVM_CTRL_CLR_FLASH_CACHE_SHIFT (5U) -/*! CLR_FLASH_CACHE - Clear flash cache control - * 0b0..No clear flash cache - * 0b1..Clears flash cache - */ -#define SYSCON_NVM_CTRL_CLR_FLASH_CACHE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_CLR_FLASH_CACHE_SHIFT)) & SYSCON_NVM_CTRL_CLR_FLASH_CACHE_MASK) - -#define SYSCON_NVM_CTRL_FLASH_STALL_EN_MASK (0x400U) -#define SYSCON_NVM_CTRL_FLASH_STALL_EN_SHIFT (10U) -/*! FLASH_STALL_EN - FLASH stall on busy control - * 0b0..No stall on FLASH busy - * 0b1..Stall on FLASH busy - */ -#define SYSCON_NVM_CTRL_FLASH_STALL_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_FLASH_STALL_EN_SHIFT)) & SYSCON_NVM_CTRL_FLASH_STALL_EN_MASK) - -#define SYSCON_NVM_CTRL_DIS_MBECC_ERR_INST_MASK (0x10000U) -#define SYSCON_NVM_CTRL_DIS_MBECC_ERR_INST_SHIFT (16U) -/*! DIS_MBECC_ERR_INST - * 0b0..Enables bus error on multi-bit ECC error for instruction - * 0b1..Disables bus error on multi-bit ECC error for instruction - */ -#define SYSCON_NVM_CTRL_DIS_MBECC_ERR_INST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_DIS_MBECC_ERR_INST_SHIFT)) & SYSCON_NVM_CTRL_DIS_MBECC_ERR_INST_MASK) - -#define SYSCON_NVM_CTRL_DIS_MBECC_ERR_DATA_MASK (0x20000U) -#define SYSCON_NVM_CTRL_DIS_MBECC_ERR_DATA_SHIFT (17U) -/*! DIS_MBECC_ERR_DATA - * 0b0..Enables bus error on multi-bit ECC error for data - * 0b1..Disables bus error on multi-bit ECC error for data - */ -#define SYSCON_NVM_CTRL_DIS_MBECC_ERR_DATA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_DIS_MBECC_ERR_DATA_SHIFT)) & SYSCON_NVM_CTRL_DIS_MBECC_ERR_DATA_MASK) -/*! @} */ - -/*! @name ROMCR - ROM Wait State */ -/*! @{ */ - -#define SYSCON_ROMCR_ROM_WAIT_MASK (0x1U) -#define SYSCON_ROMCR_ROM_WAIT_SHIFT (0U) -/*! ROM_WAIT - ROM waiting Arm core and other masters for one cycle - * 0b0..Disabled - * 0b1..Enabled - */ -#define SYSCON_ROMCR_ROM_WAIT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ROMCR_ROM_WAIT_SHIFT)) & SYSCON_ROMCR_ROM_WAIT_MASK) -/*! @} */ - -/*! @name SMARTDMAINT - SmartDMA Interrupt Hijack */ -/*! @{ */ - -#define SYSCON_SMARTDMAINT_INT0_MASK (0x1U) -#define SYSCON_SMARTDMAINT_INT0_SHIFT (0U) -/*! INT0 - SmartDMA hijack NVIC IRQ1 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT0_SHIFT)) & SYSCON_SMARTDMAINT_INT0_MASK) - -#define SYSCON_SMARTDMAINT_INT1_MASK (0x2U) -#define SYSCON_SMARTDMAINT_INT1_SHIFT (1U) -/*! INT1 - SmartDMA hijack NVIC IRQ17 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT1_SHIFT)) & SYSCON_SMARTDMAINT_INT1_MASK) - -#define SYSCON_SMARTDMAINT_INT2_MASK (0x4U) -#define SYSCON_SMARTDMAINT_INT2_SHIFT (2U) -/*! INT2 - SmartDMA hijack NVIC IRQ18 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT2(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT2_SHIFT)) & SYSCON_SMARTDMAINT_INT2_MASK) - -#define SYSCON_SMARTDMAINT_INT3_MASK (0x8U) -#define SYSCON_SMARTDMAINT_INT3_SHIFT (3U) -/*! INT3 - SmartDMA hijack NVIC IRQ29 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT3(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT3_SHIFT)) & SYSCON_SMARTDMAINT_INT3_MASK) - -#define SYSCON_SMARTDMAINT_INT4_MASK (0x10U) -#define SYSCON_SMARTDMAINT_INT4_SHIFT (4U) -/*! INT4 - SmartDMA hijack NVIC IRQ30 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT4(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT4_SHIFT)) & SYSCON_SMARTDMAINT_INT4_MASK) - -#define SYSCON_SMARTDMAINT_INT5_MASK (0x20U) -#define SYSCON_SMARTDMAINT_INT5_SHIFT (5U) -/*! INT5 - SmartDMA hijack NVIC IRQ31 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT5(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT5_SHIFT)) & SYSCON_SMARTDMAINT_INT5_MASK) - -#define SYSCON_SMARTDMAINT_INT6_MASK (0x40U) -#define SYSCON_SMARTDMAINT_INT6_SHIFT (6U) -/*! INT6 - SmartDMA hijack NVIC IRQ32 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT6(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT6_SHIFT)) & SYSCON_SMARTDMAINT_INT6_MASK) - -#define SYSCON_SMARTDMAINT_INT7_MASK (0x80U) -#define SYSCON_SMARTDMAINT_INT7_SHIFT (7U) -/*! INT7 - SmartDMA hijack NVIC IRQ33 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT7(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT7_SHIFT)) & SYSCON_SMARTDMAINT_INT7_MASK) - -#define SYSCON_SMARTDMAINT_INT8_MASK (0x100U) -#define SYSCON_SMARTDMAINT_INT8_SHIFT (8U) -/*! INT8 - SmartDMA hijack NVIC IRQ34 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT8(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT8_SHIFT)) & SYSCON_SMARTDMAINT_INT8_MASK) - -#define SYSCON_SMARTDMAINT_INT9_MASK (0x200U) -#define SYSCON_SMARTDMAINT_INT9_SHIFT (9U) -/*! INT9 - SmartDMA hijack NVIC IRQ35 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT9(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT9_SHIFT)) & SYSCON_SMARTDMAINT_INT9_MASK) - -#define SYSCON_SMARTDMAINT_INT10_MASK (0x400U) -#define SYSCON_SMARTDMAINT_INT10_SHIFT (10U) -/*! INT10 - SmartDMA hijack NVIC IRQ36 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT10(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT10_SHIFT)) & SYSCON_SMARTDMAINT_INT10_MASK) - -#define SYSCON_SMARTDMAINT_INT11_MASK (0x800U) -#define SYSCON_SMARTDMAINT_INT11_SHIFT (11U) -/*! INT11 - SmartDMA hijack NVIC IRQ37 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT11(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT11_SHIFT)) & SYSCON_SMARTDMAINT_INT11_MASK) - -#define SYSCON_SMARTDMAINT_INT12_MASK (0x1000U) -#define SYSCON_SMARTDMAINT_INT12_SHIFT (12U) -/*! INT12 - SmartDMA hijack NVIC IRQ38 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT12(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT12_SHIFT)) & SYSCON_SMARTDMAINT_INT12_MASK) - -#define SYSCON_SMARTDMAINT_INT13_MASK (0x2000U) -#define SYSCON_SMARTDMAINT_INT13_SHIFT (13U) -/*! INT13 - SmartDMA hijack NVIC IRQ39 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT13(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT13_SHIFT)) & SYSCON_SMARTDMAINT_INT13_MASK) - -#define SYSCON_SMARTDMAINT_INT14_MASK (0x4000U) -#define SYSCON_SMARTDMAINT_INT14_SHIFT (14U) -/*! INT14 - SmartDMA hijack NVIC IRQ40 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT14(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT14_SHIFT)) & SYSCON_SMARTDMAINT_INT14_MASK) - -#define SYSCON_SMARTDMAINT_INT15_MASK (0x8000U) -#define SYSCON_SMARTDMAINT_INT15_SHIFT (15U) -/*! INT15 - SmartDMA hijack NVIC IRQ41 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT15(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT15_SHIFT)) & SYSCON_SMARTDMAINT_INT15_MASK) - -#define SYSCON_SMARTDMAINT_INT16_MASK (0x10000U) -#define SYSCON_SMARTDMAINT_INT16_SHIFT (16U) -/*! INT16 - SmartDMA hijack NVIC IRQ42 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT16(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT16_SHIFT)) & SYSCON_SMARTDMAINT_INT16_MASK) - -#define SYSCON_SMARTDMAINT_INT17_MASK (0x20000U) -#define SYSCON_SMARTDMAINT_INT17_SHIFT (17U) -/*! INT17 - SmartDMA hijack NVIC IRQ45 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT17(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT17_SHIFT)) & SYSCON_SMARTDMAINT_INT17_MASK) - -#define SYSCON_SMARTDMAINT_INT18_MASK (0x40000U) -#define SYSCON_SMARTDMAINT_INT18_SHIFT (18U) -/*! INT18 - SmartDMA hijack NVIC IRQ47 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT18(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT18_SHIFT)) & SYSCON_SMARTDMAINT_INT18_MASK) - -#define SYSCON_SMARTDMAINT_INT19_MASK (0x80000U) -#define SYSCON_SMARTDMAINT_INT19_SHIFT (19U) -/*! INT19 - SmartDMA hijack NVIC IRQ50 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT19(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT19_SHIFT)) & SYSCON_SMARTDMAINT_INT19_MASK) - -#define SYSCON_SMARTDMAINT_INT20_MASK (0x100000U) -#define SYSCON_SMARTDMAINT_INT20_SHIFT (20U) -/*! INT20 - SmartDMA hijack NVIC IRQ51 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT20(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT20_SHIFT)) & SYSCON_SMARTDMAINT_INT20_MASK) - -#define SYSCON_SMARTDMAINT_INT21_MASK (0x200000U) -#define SYSCON_SMARTDMAINT_INT21_SHIFT (21U) -/*! INT21 - SmartDMA hijack NVIC IRQ66 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT21(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT21_SHIFT)) & SYSCON_SMARTDMAINT_INT21_MASK) - -#define SYSCON_SMARTDMAINT_INT22_MASK (0x400000U) -#define SYSCON_SMARTDMAINT_INT22_SHIFT (22U) -/*! INT22 - SmartDMA hijack NVIC IRQ67 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT22(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT22_SHIFT)) & SYSCON_SMARTDMAINT_INT22_MASK) - -#define SYSCON_SMARTDMAINT_INT23_MASK (0x800000U) -#define SYSCON_SMARTDMAINT_INT23_SHIFT (23U) -/*! INT23 - SmartDMA hijack NVIC IRQ77 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT23(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT23_SHIFT)) & SYSCON_SMARTDMAINT_INT23_MASK) -/*! @} */ - -/*! @name ADC1CLKSEL - ADC1 Clock Source Select */ -/*! @{ */ - -#define SYSCON_ADC1CLKSEL_SEL_MASK (0x7U) -#define SYSCON_ADC1CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the ADC1 clock source - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..FRO_HF clock - * 0b011..FRO 12 MHz clock - * 0b100..Clk_in clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_ADC1CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ADC1CLKSEL_SEL_SHIFT)) & SYSCON_ADC1CLKSEL_SEL_MASK) -/*! @} */ - -/*! @name ADC1CLKDIV - ADC1 Clock Divider */ -/*! @{ */ - -#define SYSCON_ADC1CLKDIV_DIV_MASK (0x7U) -#define SYSCON_ADC1CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_ADC1CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ADC1CLKDIV_DIV_SHIFT)) & SYSCON_ADC1CLKDIV_DIV_MASK) - -#define SYSCON_ADC1CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_ADC1CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_ADC1CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ADC1CLKDIV_RESET_SHIFT)) & SYSCON_ADC1CLKDIV_RESET_MASK) - -#define SYSCON_ADC1CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_ADC1CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_ADC1CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ADC1CLKDIV_HALT_SHIFT)) & SYSCON_ADC1CLKDIV_HALT_MASK) - -#define SYSCON_ADC1CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_ADC1CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_ADC1CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ADC1CLKDIV_UNSTAB_SHIFT)) & SYSCON_ADC1CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name RAM_INTERLEAVE - Control PKC RAM Interleave Access */ -/*! @{ */ - -#define SYSCON_RAM_INTERLEAVE_INTERLEAVE_MASK (0x1U) -#define SYSCON_RAM_INTERLEAVE_INTERLEAVE_SHIFT (0U) -/*! INTERLEAVE - Controls PKC RAM access for PKC RAM 0 and PKC RAM 1 - * 0b1..RAM access to PKC RAM 0 and PKC RAM 1 is interleaved. This setting is need for PKC L0 memory access. - * 0b0..RAM access to PKC RAM 0 and PKC RAM 1 is consecutive. - */ -#define SYSCON_RAM_INTERLEAVE_INTERLEAVE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_RAM_INTERLEAVE_INTERLEAVE_SHIFT)) & SYSCON_RAM_INTERLEAVE_INTERLEAVE_MASK) -/*! @} */ - -/*! @name PLLCLKDIVSEL - PLL Clock Divider Clock Selection */ -/*! @{ */ - -#define SYSCON_PLLCLKDIVSEL_SEL_MASK (0x7U) -#define SYSCON_PLLCLKDIVSEL_SEL_SHIFT (0U) -/*! SEL - Selects the PLL Clock Divider source clock - * 0b000..PLL0 clock - * 0b001..pll1_clk0 - * 0b010..No clock - * 0b011..No clock - * 0b100..No clock - * 0b101..No clock - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_PLLCLKDIVSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLLCLKDIVSEL_SEL_SHIFT)) & SYSCON_PLLCLKDIVSEL_SEL_MASK) -/*! @} */ - -/*! @name I3C0FCLKSEL - I3C0 Functional Clock Selection */ -/*! @{ */ - -#define SYSCON_I3C0FCLKSEL_SEL_MASK (0x7U) -#define SYSCON_I3C0FCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the I3C0 clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..FRO_HF clock - * 0b100..clk_1m clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_I3C0FCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKSEL_SEL_SHIFT)) & SYSCON_I3C0FCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name I3C0FCLKDIV - I3C0 Functional Clock FCLK Divider */ -/*! @{ */ - -#define SYSCON_I3C0FCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_I3C0FCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_I3C0FCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKDIV_DIV_SHIFT)) & SYSCON_I3C0FCLKDIV_DIV_MASK) - -#define SYSCON_I3C0FCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_I3C0FCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_I3C0FCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKDIV_RESET_SHIFT)) & SYSCON_I3C0FCLKDIV_RESET_MASK) - -#define SYSCON_I3C0FCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_I3C0FCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_I3C0FCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKDIV_HALT_SHIFT)) & SYSCON_I3C0FCLKDIV_HALT_MASK) - -#define SYSCON_I3C0FCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_I3C0FCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_I3C0FCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKDIV_UNSTAB_SHIFT)) & SYSCON_I3C0FCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name MICFILFCLKSEL - MICFIL Clock Selection */ -/*! @{ */ - -#define SYSCON_MICFILFCLKSEL_SEL_MASK (0xFU) -#define SYSCON_MICFILFCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the MICFIL clock - * 0b0000..FRO_12M clock - * 0b0001..PLL0 clock - * 0b0010..CLKIN clock - * 0b0011..FRO_HF clock - * 0b0100..PLL1_clk0 clock - * 0b0101..SAI0_MCLK clock - * 0b0110..USB PLL clock - * 0b0111..No clock - * 0b1000..SAI1_MCLK clock - * 0b1001..No clock - * 0b1010..No clock - * 0b1011..No clock - * 0b1100..No clock - * 0b1101..No clock - * 0b1110..No clock - * 0b1111..No clock - */ -#define SYSCON_MICFILFCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_MICFILFCLKSEL_SEL_SHIFT)) & SYSCON_MICFILFCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name MICFILFCLKDIV - MICFIL Clock Division */ -/*! @{ */ - -#define SYSCON_MICFILFCLKDIV_DIV_MASK (0x7U) -#define SYSCON_MICFILFCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_MICFILFCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_MICFILFCLKDIV_DIV_SHIFT)) & SYSCON_MICFILFCLKDIV_DIV_MASK) - -#define SYSCON_MICFILFCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_MICFILFCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_MICFILFCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_MICFILFCLKDIV_RESET_SHIFT)) & SYSCON_MICFILFCLKDIV_RESET_MASK) - -#define SYSCON_MICFILFCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_MICFILFCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_MICFILFCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_MICFILFCLKDIV_HALT_SHIFT)) & SYSCON_MICFILFCLKDIV_HALT_MASK) - -#define SYSCON_MICFILFCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_MICFILFCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_MICFILFCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_MICFILFCLKDIV_UNSTAB_SHIFT)) & SYSCON_MICFILFCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name FLEXIOCLKSEL - FLEXIO Clock Selection */ -/*! @{ */ - -#define SYSCON_FLEXIOCLKSEL_SEL_MASK (0x7U) -#define SYSCON_FLEXIOCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the FLEXIO clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..FRO_HF clock - * 0b100..FRO_12M clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_FLEXIOCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXIOCLKSEL_SEL_SHIFT)) & SYSCON_FLEXIOCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name FLEXIOCLKDIV - FLEXIO Function Clock Divider */ -/*! @{ */ - -#define SYSCON_FLEXIOCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_FLEXIOCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_FLEXIOCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXIOCLKDIV_DIV_SHIFT)) & SYSCON_FLEXIOCLKDIV_DIV_MASK) - -#define SYSCON_FLEXIOCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_FLEXIOCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_FLEXIOCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXIOCLKDIV_RESET_SHIFT)) & SYSCON_FLEXIOCLKDIV_RESET_MASK) - -#define SYSCON_FLEXIOCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_FLEXIOCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_FLEXIOCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXIOCLKDIV_HALT_SHIFT)) & SYSCON_FLEXIOCLKDIV_HALT_MASK) - -#define SYSCON_FLEXIOCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_FLEXIOCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_FLEXIOCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXIOCLKDIV_UNSTAB_SHIFT)) & SYSCON_FLEXIOCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name FLEXCAN0CLKSEL - FLEXCAN0 Clock Selection */ -/*! @{ */ - -#define SYSCON_FLEXCAN0CLKSEL_SEL_MASK (0x7U) -#define SYSCON_FLEXCAN0CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the FLEXCAN0 clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..FRO_HF clock - * 0b100..No clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_FLEXCAN0CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCAN0CLKSEL_SEL_SHIFT)) & SYSCON_FLEXCAN0CLKSEL_SEL_MASK) -/*! @} */ - -/*! @name FLEXCAN0CLKDIV - FLEXCAN0 Function Clock Divider */ -/*! @{ */ - -#define SYSCON_FLEXCAN0CLKDIV_DIV_MASK (0xFFU) -#define SYSCON_FLEXCAN0CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_FLEXCAN0CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCAN0CLKDIV_DIV_SHIFT)) & SYSCON_FLEXCAN0CLKDIV_DIV_MASK) - -#define SYSCON_FLEXCAN0CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_FLEXCAN0CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_FLEXCAN0CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCAN0CLKDIV_RESET_SHIFT)) & SYSCON_FLEXCAN0CLKDIV_RESET_MASK) - -#define SYSCON_FLEXCAN0CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_FLEXCAN0CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_FLEXCAN0CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCAN0CLKDIV_HALT_SHIFT)) & SYSCON_FLEXCAN0CLKDIV_HALT_MASK) - -#define SYSCON_FLEXCAN0CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_FLEXCAN0CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_FLEXCAN0CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCAN0CLKDIV_UNSTAB_SHIFT)) & SYSCON_FLEXCAN0CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name FLEXCAN1CLKSEL - FLEXCAN1 Clock Selection */ -/*! @{ */ - -#define SYSCON_FLEXCAN1CLKSEL_SEL_MASK (0x7U) -#define SYSCON_FLEXCAN1CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the FLEXCAN1 clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..FRO_HF clock - * 0b100..No clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_FLEXCAN1CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCAN1CLKSEL_SEL_SHIFT)) & SYSCON_FLEXCAN1CLKSEL_SEL_MASK) -/*! @} */ - -/*! @name FLEXCAN1CLKDIV - FLEXCAN1 Function Clock Divider */ -/*! @{ */ - -#define SYSCON_FLEXCAN1CLKDIV_DIV_MASK (0xFFU) -#define SYSCON_FLEXCAN1CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_FLEXCAN1CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCAN1CLKDIV_DIV_SHIFT)) & SYSCON_FLEXCAN1CLKDIV_DIV_MASK) - -#define SYSCON_FLEXCAN1CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_FLEXCAN1CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_FLEXCAN1CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCAN1CLKDIV_RESET_SHIFT)) & SYSCON_FLEXCAN1CLKDIV_RESET_MASK) - -#define SYSCON_FLEXCAN1CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_FLEXCAN1CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_FLEXCAN1CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCAN1CLKDIV_HALT_SHIFT)) & SYSCON_FLEXCAN1CLKDIV_HALT_MASK) - -#define SYSCON_FLEXCAN1CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_FLEXCAN1CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_FLEXCAN1CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCAN1CLKDIV_UNSTAB_SHIFT)) & SYSCON_FLEXCAN1CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name EWM0CLKSEL - EWM0 Clock Selection */ -/*! @{ */ - -#define SYSCON_EWM0CLKSEL_SEL_MASK (0x1U) -#define SYSCON_EWM0CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the EWM0 clock - * 0b0..clk_16k[2] - * 0b1..xtal32k[2] - */ -#define SYSCON_EWM0CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_EWM0CLKSEL_SEL_SHIFT)) & SYSCON_EWM0CLKSEL_SEL_MASK) -/*! @} */ - -/*! @name WDT1CLKSEL - WDT1 Clock Selection */ -/*! @{ */ - -#define SYSCON_WDT1CLKSEL_SEL_MASK (0x3U) -#define SYSCON_WDT1CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the WDT1 clock - * 0b00..FRO16K clock 2 - * 0b01..fro_hf_div clock - * 0b10..clk_1m clock - * 0b11..clk_1m clock - */ -#define SYSCON_WDT1CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_WDT1CLKSEL_SEL_SHIFT)) & SYSCON_WDT1CLKSEL_SEL_MASK) -/*! @} */ - -/*! @name WDT1CLKDIV - WDT1 Function Clock Divider */ -/*! @{ */ - -#define SYSCON_WDT1CLKDIV_DIV_MASK (0x3FU) -#define SYSCON_WDT1CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_WDT1CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_WDT1CLKDIV_DIV_SHIFT)) & SYSCON_WDT1CLKDIV_DIV_MASK) - -#define SYSCON_WDT1CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_WDT1CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_WDT1CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_WDT1CLKDIV_RESET_SHIFT)) & SYSCON_WDT1CLKDIV_RESET_MASK) - -#define SYSCON_WDT1CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_WDT1CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_WDT1CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_WDT1CLKDIV_HALT_SHIFT)) & SYSCON_WDT1CLKDIV_HALT_MASK) - -#define SYSCON_WDT1CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_WDT1CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_WDT1CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_WDT1CLKDIV_UNSTAB_SHIFT)) & SYSCON_WDT1CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name OSTIMERCLKSEL - OSTIMER Clock Selection */ -/*! @{ */ - -#define SYSCON_OSTIMERCLKSEL_SEL_MASK (0x3U) -#define SYSCON_OSTIMERCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the OS Event Timer clock - * 0b00..clk_16k[2] - * 0b01..xtal32k[2] - * 0b10..clk_1m clock - * 0b11..No clock - */ -#define SYSCON_OSTIMERCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_OSTIMERCLKSEL_SEL_SHIFT)) & SYSCON_OSTIMERCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name CMP0FCLKSEL - CMP0 Function Clock Selection */ -/*! @{ */ - -#define SYSCON_CMP0FCLKSEL_SEL_MASK (0x7U) -#define SYSCON_CMP0FCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the CMP0 function clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..FRO_HF clock - * 0b011..FRO_12M clock - * 0b100..CLKIN clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_CMP0FCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP0FCLKSEL_SEL_SHIFT)) & SYSCON_CMP0FCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name CMP0FCLKDIV - CMP0 Function Clock Divider */ -/*! @{ */ - -#define SYSCON_CMP0FCLKDIV_DIV_MASK (0xFU) -#define SYSCON_CMP0FCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_CMP0FCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP0FCLKDIV_DIV_SHIFT)) & SYSCON_CMP0FCLKDIV_DIV_MASK) - -#define SYSCON_CMP0FCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_CMP0FCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_CMP0FCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP0FCLKDIV_RESET_SHIFT)) & SYSCON_CMP0FCLKDIV_RESET_MASK) - -#define SYSCON_CMP0FCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_CMP0FCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_CMP0FCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP0FCLKDIV_HALT_SHIFT)) & SYSCON_CMP0FCLKDIV_HALT_MASK) - -#define SYSCON_CMP0FCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_CMP0FCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_CMP0FCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP0FCLKDIV_UNSTAB_SHIFT)) & SYSCON_CMP0FCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name CMP0RRCLKSEL - CMP0 Round Robin Clock Selection */ -/*! @{ */ - -#define SYSCON_CMP0RRCLKSEL_SEL_MASK (0x7U) -#define SYSCON_CMP0RRCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the CMP0 round robin clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..FRO_HF clock - * 0b011..FRO_12M clock - * 0b100..CLKIN clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_CMP0RRCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP0RRCLKSEL_SEL_SHIFT)) & SYSCON_CMP0RRCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name CMP0RRCLKDIV - CMP0 Round Robin Clock Divider */ -/*! @{ */ - -#define SYSCON_CMP0RRCLKDIV_DIV_MASK (0xFU) -#define SYSCON_CMP0RRCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_CMP0RRCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP0RRCLKDIV_DIV_SHIFT)) & SYSCON_CMP0RRCLKDIV_DIV_MASK) - -#define SYSCON_CMP0RRCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_CMP0RRCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_CMP0RRCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP0RRCLKDIV_RESET_SHIFT)) & SYSCON_CMP0RRCLKDIV_RESET_MASK) - -#define SYSCON_CMP0RRCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_CMP0RRCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_CMP0RRCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP0RRCLKDIV_HALT_SHIFT)) & SYSCON_CMP0RRCLKDIV_HALT_MASK) - -#define SYSCON_CMP0RRCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_CMP0RRCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_CMP0RRCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP0RRCLKDIV_UNSTAB_SHIFT)) & SYSCON_CMP0RRCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name CMP1FCLKSEL - CMP1 Function Clock Selection */ -/*! @{ */ - -#define SYSCON_CMP1FCLKSEL_SEL_MASK (0x7U) -#define SYSCON_CMP1FCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the CMP1 function clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..FRO_HF clock - * 0b011..FRO_12M clock - * 0b100..CLKIN clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_CMP1FCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP1FCLKSEL_SEL_SHIFT)) & SYSCON_CMP1FCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name CMP1FCLKDIV - CMP1 Function Clock Divider */ -/*! @{ */ - -#define SYSCON_CMP1FCLKDIV_DIV_MASK (0xFU) -#define SYSCON_CMP1FCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_CMP1FCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP1FCLKDIV_DIV_SHIFT)) & SYSCON_CMP1FCLKDIV_DIV_MASK) - -#define SYSCON_CMP1FCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_CMP1FCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_CMP1FCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP1FCLKDIV_RESET_SHIFT)) & SYSCON_CMP1FCLKDIV_RESET_MASK) - -#define SYSCON_CMP1FCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_CMP1FCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_CMP1FCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP1FCLKDIV_HALT_SHIFT)) & SYSCON_CMP1FCLKDIV_HALT_MASK) - -#define SYSCON_CMP1FCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_CMP1FCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_CMP1FCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP1FCLKDIV_UNSTAB_SHIFT)) & SYSCON_CMP1FCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name CMP1RRCLKSEL - CMP1 Round Robin Clock Source Select */ -/*! @{ */ - -#define SYSCON_CMP1RRCLKSEL_SEL_MASK (0x7U) -#define SYSCON_CMP1RRCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the CMP1 round robin clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..FRO_HF clock - * 0b011..FRO_12M clock - * 0b100..CLKIN clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_CMP1RRCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP1RRCLKSEL_SEL_SHIFT)) & SYSCON_CMP1RRCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name CMP1RRCLKDIV - CMP1 Round Robin Clock Division */ -/*! @{ */ - -#define SYSCON_CMP1RRCLKDIV_DIV_MASK (0xFU) -#define SYSCON_CMP1RRCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_CMP1RRCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP1RRCLKDIV_DIV_SHIFT)) & SYSCON_CMP1RRCLKDIV_DIV_MASK) - -#define SYSCON_CMP1RRCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_CMP1RRCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_CMP1RRCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP1RRCLKDIV_RESET_SHIFT)) & SYSCON_CMP1RRCLKDIV_RESET_MASK) - -#define SYSCON_CMP1RRCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_CMP1RRCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_CMP1RRCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP1RRCLKDIV_HALT_SHIFT)) & SYSCON_CMP1RRCLKDIV_HALT_MASK) - -#define SYSCON_CMP1RRCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_CMP1RRCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_CMP1RRCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP1RRCLKDIV_UNSTAB_SHIFT)) & SYSCON_CMP1RRCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name CPUSTAT - CPU Status */ -/*! @{ */ - -#define SYSCON_CPUSTAT_CPU0SLEEPING_MASK (0x1U) -#define SYSCON_CPUSTAT_CPU0SLEEPING_SHIFT (0U) -/*! CPU0SLEEPING - CPU0 sleeping state - * 0b1..CPU is sleeping - * 0b0..CPU is not sleeping - */ -#define SYSCON_CPUSTAT_CPU0SLEEPING(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPUSTAT_CPU0SLEEPING_SHIFT)) & SYSCON_CPUSTAT_CPU0SLEEPING_MASK) - -#define SYSCON_CPUSTAT_CPU0LOCKUP_MASK (0x4U) -#define SYSCON_CPUSTAT_CPU0LOCKUP_SHIFT (2U) -/*! CPU0LOCKUP - CPU0 lockup state - * 0b1..CPU is in lockup - * 0b0..CPU is not in lockup - */ -#define SYSCON_CPUSTAT_CPU0LOCKUP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPUSTAT_CPU0LOCKUP_SHIFT)) & SYSCON_CPUSTAT_CPU0LOCKUP_MASK) -/*! @} */ - -/*! @name LPCAC_CTRL - LPCAC Control */ -/*! @{ */ - -#define SYSCON_LPCAC_CTRL_DIS_LPCAC_MASK (0x1U) -#define SYSCON_LPCAC_CTRL_DIS_LPCAC_SHIFT (0U) -/*! DIS_LPCAC - Disables/enables the cache function. - * 0b0..Enabled - * 0b1..Disabled - */ -#define SYSCON_LPCAC_CTRL_DIS_LPCAC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_DIS_LPCAC_SHIFT)) & SYSCON_LPCAC_CTRL_DIS_LPCAC_MASK) - -#define SYSCON_LPCAC_CTRL_CLR_LPCAC_MASK (0x2U) -#define SYSCON_LPCAC_CTRL_CLR_LPCAC_SHIFT (1U) -/*! CLR_LPCAC - Clears the cache function. - * 0b0..Unclears the cache - * 0b1..Clears the cache - */ -#define SYSCON_LPCAC_CTRL_CLR_LPCAC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_CLR_LPCAC_SHIFT)) & SYSCON_LPCAC_CTRL_CLR_LPCAC_MASK) - -#define SYSCON_LPCAC_CTRL_FRC_NO_ALLOC_MASK (0x4U) -#define SYSCON_LPCAC_CTRL_FRC_NO_ALLOC_SHIFT (2U) -/*! FRC_NO_ALLOC - Forces no allocation. - * 0b0..Forces allocation - * 0b1..Forces no allocation - */ -#define SYSCON_LPCAC_CTRL_FRC_NO_ALLOC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_FRC_NO_ALLOC_SHIFT)) & SYSCON_LPCAC_CTRL_FRC_NO_ALLOC_MASK) - -#define SYSCON_LPCAC_CTRL_PARITY_MISS_EN_MASK (0x8U) -#define SYSCON_LPCAC_CTRL_PARITY_MISS_EN_SHIFT (3U) -/*! PARITY_MISS_EN - Enables parity miss. - * 0b0..Disabled - * 0b1..Enables parity, miss on parity error - */ -#define SYSCON_LPCAC_CTRL_PARITY_MISS_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_PARITY_MISS_EN_SHIFT)) & SYSCON_LPCAC_CTRL_PARITY_MISS_EN_MASK) - -#define SYSCON_LPCAC_CTRL_DIS_LPCAC_WTBF_MASK (0x10U) -#define SYSCON_LPCAC_CTRL_DIS_LPCAC_WTBF_SHIFT (4U) -/*! DIS_LPCAC_WTBF - Disable LPCAC Write Through Buffer. - * 0b1..Disables write through buffer - * 0b0..Enables write through buffer - */ -#define SYSCON_LPCAC_CTRL_DIS_LPCAC_WTBF(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_DIS_LPCAC_WTBF_SHIFT)) & SYSCON_LPCAC_CTRL_DIS_LPCAC_WTBF_MASK) - -#define SYSCON_LPCAC_CTRL_LIM_LPCAC_WTBF_MASK (0x20U) -#define SYSCON_LPCAC_CTRL_LIM_LPCAC_WTBF_SHIFT (5U) -/*! LIM_LPCAC_WTBF - Limit LPCAC Write Through Buffer. - * 0b1..Write buffer enabled when transaction is cacheable and bufferable - * 0b0..Write buffer enabled when transaction is bufferable. - */ -#define SYSCON_LPCAC_CTRL_LIM_LPCAC_WTBF(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_LIM_LPCAC_WTBF_SHIFT)) & SYSCON_LPCAC_CTRL_LIM_LPCAC_WTBF_MASK) - -#define SYSCON_LPCAC_CTRL_PARITY_FAULT_EN_MASK (0x40U) -#define SYSCON_LPCAC_CTRL_PARITY_FAULT_EN_SHIFT (6U) -/*! PARITY_FAULT_EN - Enable parity error report. - * 0b1..Enables parity error report - * 0b0..Disables parity error report - */ -#define SYSCON_LPCAC_CTRL_PARITY_FAULT_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_PARITY_FAULT_EN_SHIFT)) & SYSCON_LPCAC_CTRL_PARITY_FAULT_EN_MASK) - -#define SYSCON_LPCAC_CTRL_LPCAC_XOM_MASK (0x80U) -#define SYSCON_LPCAC_CTRL_LPCAC_XOM_SHIFT (7U) -/*! LPCAC_XOM - LPCAC XOM(eXecute-Only-Memory) attribute control - * 0b1..Enabled. - * 0b0..Disabled. - */ -#define SYSCON_LPCAC_CTRL_LPCAC_XOM(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_LPCAC_XOM_SHIFT)) & SYSCON_LPCAC_CTRL_LPCAC_XOM_MASK) -/*! @} */ - -/*! @name FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV - LP_FLEXCOMM Clock Divider */ -/*! @{ */ - -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_DIV_SHIFT)) & SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_DIV_MASK) - -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_RESET_SHIFT)) & SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_RESET_MASK) - -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_HALT_SHIFT)) & SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_HALT_MASK) - -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_UNSTAB_SHIFT)) & SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_UNSTAB_MASK) -/*! @} */ - -/* The count of SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV */ -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_COUNT (8U) - -/*! @name UTICKCLKSEL - UTICK Function Clock Source Select */ -/*! @{ */ - -#define SYSCON_UTICKCLKSEL_SEL_MASK (0x3U) -#define SYSCON_UTICKCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the clock source - * 0b00..clk_in - * 0b01..xtal32k[2] - * 0b10..clk_1m clock - * 0b11..No clock - */ -#define SYSCON_UTICKCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_UTICKCLKSEL_SEL_SHIFT)) & SYSCON_UTICKCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name SAI0CLKSEL - SAI0 Function Clock Source Select */ -/*! @{ */ - -#define SYSCON_SAI0CLKSEL_SEL_MASK (0x7U) -#define SYSCON_SAI0CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the clock source - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..FRO_HF clock - * 0b100..PLL1_CLK0 clock - * 0b101..No clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_SAI0CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SAI0CLKSEL_SEL_SHIFT)) & SYSCON_SAI0CLKSEL_SEL_MASK) -/*! @} */ - -/*! @name SAI1CLKSEL - SAI1 Function Clock Source Select */ -/*! @{ */ - -#define SYSCON_SAI1CLKSEL_SEL_MASK (0x7U) -#define SYSCON_SAI1CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the clock source - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..FRO_HF clock - * 0b100..PLL1_CLK0 clock - * 0b101..No clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_SAI1CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SAI1CLKSEL_SEL_SHIFT)) & SYSCON_SAI1CLKSEL_SEL_MASK) -/*! @} */ - -/*! @name SAI0CLKDIV - SAI0 Function Clock Division */ -/*! @{ */ - -#define SYSCON_SAI0CLKDIV_DIV_MASK (0x7U) -#define SYSCON_SAI0CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_SAI0CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SAI0CLKDIV_DIV_SHIFT)) & SYSCON_SAI0CLKDIV_DIV_MASK) - -#define SYSCON_SAI0CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_SAI0CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_SAI0CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SAI0CLKDIV_RESET_SHIFT)) & SYSCON_SAI0CLKDIV_RESET_MASK) - -#define SYSCON_SAI0CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_SAI0CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_SAI0CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SAI0CLKDIV_HALT_SHIFT)) & SYSCON_SAI0CLKDIV_HALT_MASK) - -#define SYSCON_SAI0CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_SAI0CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_SAI0CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SAI0CLKDIV_UNSTAB_SHIFT)) & SYSCON_SAI0CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name SAI1CLKDIV - SAI1 Function Clock Division */ -/*! @{ */ - -#define SYSCON_SAI1CLKDIV_DIV_MASK (0x7U) -#define SYSCON_SAI1CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_SAI1CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SAI1CLKDIV_DIV_SHIFT)) & SYSCON_SAI1CLKDIV_DIV_MASK) - -#define SYSCON_SAI1CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_SAI1CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_SAI1CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SAI1CLKDIV_RESET_SHIFT)) & SYSCON_SAI1CLKDIV_RESET_MASK) - -#define SYSCON_SAI1CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_SAI1CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_SAI1CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SAI1CLKDIV_HALT_SHIFT)) & SYSCON_SAI1CLKDIV_HALT_MASK) - -#define SYSCON_SAI1CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_SAI1CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_SAI1CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SAI1CLKDIV_UNSTAB_SHIFT)) & SYSCON_SAI1CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name KEY_RETAIN_CTRL - Key Retain Control */ -/*! @{ */ - -#define SYSCON_KEY_RETAIN_CTRL_KEY_RETAIN_VALID_MASK (0x1U) -#define SYSCON_KEY_RETAIN_CTRL_KEY_RETAIN_VALID_SHIFT (0U) -/*! KEY_RETAIN_VALID - Indicates if the PUF key has been retained in the VBAT domain and has not - * been reset or otherwise invalidated by software. - * 0b0..PUF key is not retained in VBAT domain. - * 0b1..PUF key is retained in VBAT domain. - */ -#define SYSCON_KEY_RETAIN_CTRL_KEY_RETAIN_VALID(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_KEY_RETAIN_CTRL_KEY_RETAIN_VALID_SHIFT)) & SYSCON_KEY_RETAIN_CTRL_KEY_RETAIN_VALID_MASK) - -#define SYSCON_KEY_RETAIN_CTRL_KEY_RETAIN_DONE_MASK (0x2U) -#define SYSCON_KEY_RETAIN_CTRL_KEY_RETAIN_DONE_SHIFT (1U) -/*! KEY_RETAIN_DONE - Indicates the successful completion of the key_save or key_load routine. Once - * set, to clear the key_retain_done flag, both key_save and key_load should be cleared by - * software. - * 0b0..Key save / load sequence has not completed. - * 0b1..Key save / load sequence has completed. - */ -#define SYSCON_KEY_RETAIN_CTRL_KEY_RETAIN_DONE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_KEY_RETAIN_CTRL_KEY_RETAIN_DONE_SHIFT)) & SYSCON_KEY_RETAIN_CTRL_KEY_RETAIN_DONE_MASK) - -#define SYSCON_KEY_RETAIN_CTRL_KEY_SAVE_MASK (0x10000U) -#define SYSCON_KEY_RETAIN_CTRL_KEY_SAVE_SHIFT (16U) -/*! KEY_SAVE - * 0b0..Key save sequence is disabled. - * 0b1..Key save sequence is enabled. - */ -#define SYSCON_KEY_RETAIN_CTRL_KEY_SAVE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_KEY_RETAIN_CTRL_KEY_SAVE_SHIFT)) & SYSCON_KEY_RETAIN_CTRL_KEY_SAVE_MASK) - -#define SYSCON_KEY_RETAIN_CTRL_KEY_LOAD_MASK (0x20000U) -#define SYSCON_KEY_RETAIN_CTRL_KEY_LOAD_SHIFT (17U) -/*! KEY_LOAD - * 0b0..Key load sequence is disabled. - * 0b1..Key load sequence is enabled. - */ -#define SYSCON_KEY_RETAIN_CTRL_KEY_LOAD(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_KEY_RETAIN_CTRL_KEY_LOAD_SHIFT)) & SYSCON_KEY_RETAIN_CTRL_KEY_LOAD_MASK) -/*! @} */ - -/*! @name REF_CLK_CTRL - FRO 48MHz Reference Clock Control */ -/*! @{ */ - -#define SYSCON_REF_CLK_CTRL_GDET_REFCLK_EN_MASK (0x1U) -#define SYSCON_REF_CLK_CTRL_GDET_REFCLK_EN_SHIFT (0U) -/*! GDET_REFCLK_EN - GDET reference clock enable bit - * 0b1..Enabled - * 0b0..Disabled. - */ -#define SYSCON_REF_CLK_CTRL_GDET_REFCLK_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_REF_CLK_CTRL_GDET_REFCLK_EN_SHIFT)) & SYSCON_REF_CLK_CTRL_GDET_REFCLK_EN_MASK) - -#define SYSCON_REF_CLK_CTRL_TRNG_REFCLK_EN_MASK (0x2U) -#define SYSCON_REF_CLK_CTRL_TRNG_REFCLK_EN_SHIFT (1U) -/*! TRNG_REFCLK_EN - ELS TRNG reference clock enable bit - * 0b1..Enabled - * 0b0..Disabled. - */ -#define SYSCON_REF_CLK_CTRL_TRNG_REFCLK_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_REF_CLK_CTRL_TRNG_REFCLK_EN_SHIFT)) & SYSCON_REF_CLK_CTRL_TRNG_REFCLK_EN_MASK) -/*! @} */ - -/*! @name REF_CLK_CTRL_SET - FRO 48MHz Reference Clock Control Set */ -/*! @{ */ - -#define SYSCON_REF_CLK_CTRL_SET_GDET_REFCLK_EN_SET_MASK (0x1U) -#define SYSCON_REF_CLK_CTRL_SET_GDET_REFCLK_EN_SET_SHIFT (0U) -/*! GDET_REFCLK_EN_SET - GDET reference clock enable set bit - * 0b1..Set to 1 - * 0b0..No effect. - */ -#define SYSCON_REF_CLK_CTRL_SET_GDET_REFCLK_EN_SET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_REF_CLK_CTRL_SET_GDET_REFCLK_EN_SET_SHIFT)) & SYSCON_REF_CLK_CTRL_SET_GDET_REFCLK_EN_SET_MASK) - -#define SYSCON_REF_CLK_CTRL_SET_TRNG_REFCLK_EN_SET_MASK (0x2U) -#define SYSCON_REF_CLK_CTRL_SET_TRNG_REFCLK_EN_SET_SHIFT (1U) -/*! TRNG_REFCLK_EN_SET - ELS TRNG reference clock enable set bit - * 0b1..Set to 1 - * 0b0..No effect. - */ -#define SYSCON_REF_CLK_CTRL_SET_TRNG_REFCLK_EN_SET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_REF_CLK_CTRL_SET_TRNG_REFCLK_EN_SET_SHIFT)) & SYSCON_REF_CLK_CTRL_SET_TRNG_REFCLK_EN_SET_MASK) -/*! @} */ - -/*! @name REF_CLK_CTRL_CLR - FRO 48MHz Reference Clock Control Clear */ -/*! @{ */ - -#define SYSCON_REF_CLK_CTRL_CLR_GDET_REFCLK_EN_CLR_MASK (0x1U) -#define SYSCON_REF_CLK_CTRL_CLR_GDET_REFCLK_EN_CLR_SHIFT (0U) -/*! GDET_REFCLK_EN_CLR - GDET reference clock enable clear bit - * 0b1..Set to 0 - * 0b0..No effect. - */ -#define SYSCON_REF_CLK_CTRL_CLR_GDET_REFCLK_EN_CLR(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_REF_CLK_CTRL_CLR_GDET_REFCLK_EN_CLR_SHIFT)) & SYSCON_REF_CLK_CTRL_CLR_GDET_REFCLK_EN_CLR_MASK) - -#define SYSCON_REF_CLK_CTRL_CLR_TRNG_REFCLK_EN_CLR_MASK (0x2U) -#define SYSCON_REF_CLK_CTRL_CLR_TRNG_REFCLK_EN_CLR_SHIFT (1U) -/*! TRNG_REFCLK_EN_CLR - ELS TRNG reference clock enable clear bit - * 0b1..Set to 0 - * 0b0..No effect. - */ -#define SYSCON_REF_CLK_CTRL_CLR_TRNG_REFCLK_EN_CLR(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_REF_CLK_CTRL_CLR_TRNG_REFCLK_EN_CLR_SHIFT)) & SYSCON_REF_CLK_CTRL_CLR_TRNG_REFCLK_EN_CLR_MASK) -/*! @} */ - -/*! @name GDETX_CTRL_GDET_CTRL - GDET Control Register */ -/*! @{ */ - -#define SYSCON_GDETX_CTRL_GDET_CTRL_GDET_EVTCNT_CLR_MASK (0x1U) -#define SYSCON_GDETX_CTRL_GDET_CTRL_GDET_EVTCNT_CLR_SHIFT (0U) -/*! GDET_EVTCNT_CLR - Controls the GDET clean event counter - * 0b1..Clears event counter - * 0b0..Event counter not cleared - */ -#define SYSCON_GDETX_CTRL_GDET_CTRL_GDET_EVTCNT_CLR(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GDETX_CTRL_GDET_CTRL_GDET_EVTCNT_CLR_SHIFT)) & SYSCON_GDETX_CTRL_GDET_CTRL_GDET_EVTCNT_CLR_MASK) - -#define SYSCON_GDETX_CTRL_GDET_CTRL_GDET_ERR_CLR_MASK (0x2U) -#define SYSCON_GDETX_CTRL_GDET_CTRL_GDET_ERR_CLR_SHIFT (1U) -/*! GDET_ERR_CLR - Clears GDET error status - * 0b1..Clears error status - * 0b0..Error status not cleared - */ -#define SYSCON_GDETX_CTRL_GDET_CTRL_GDET_ERR_CLR(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GDETX_CTRL_GDET_CTRL_GDET_ERR_CLR_SHIFT)) & SYSCON_GDETX_CTRL_GDET_CTRL_GDET_ERR_CLR_MASK) - -#define SYSCON_GDETX_CTRL_GDET_CTRL_GDET_ISO_SW_MASK (0xCU) -#define SYSCON_GDETX_CTRL_GDET_CTRL_GDET_ISO_SW_SHIFT (2U) -/*! GDET_ISO_SW - GDET isolation control - * 0b10..Isolation is enabled. When both GDET0_CTRL/GDET1_CTRL GDET_ISO_SW are "10", isolation_on is asserted. - * 0b00..Isolation is disabled - * 0b01..Isolation is disabled - * 0b11..Isolation is disabled - */ -#define SYSCON_GDETX_CTRL_GDET_CTRL_GDET_ISO_SW(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GDETX_CTRL_GDET_CTRL_GDET_ISO_SW_SHIFT)) & SYSCON_GDETX_CTRL_GDET_CTRL_GDET_ISO_SW_MASK) - -#define SYSCON_GDETX_CTRL_GDET_CTRL_EVENT_CNT_MASK (0xFF00U) -#define SYSCON_GDETX_CTRL_GDET_CTRL_EVENT_CNT_SHIFT (8U) -/*! EVENT_CNT - Event count value */ -#define SYSCON_GDETX_CTRL_GDET_CTRL_EVENT_CNT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GDETX_CTRL_GDET_CTRL_EVENT_CNT_SHIFT)) & SYSCON_GDETX_CTRL_GDET_CTRL_EVENT_CNT_MASK) - -#define SYSCON_GDETX_CTRL_GDET_CTRL_POS_SYNC_MASK (0x10000U) -#define SYSCON_GDETX_CTRL_GDET_CTRL_POS_SYNC_SHIFT (16U) -/*! POS_SYNC - Positive glitch detected - * 0b1..Positive glitch detected - * 0b0..Positive glitch not detected - */ -#define SYSCON_GDETX_CTRL_GDET_CTRL_POS_SYNC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GDETX_CTRL_GDET_CTRL_POS_SYNC_SHIFT)) & SYSCON_GDETX_CTRL_GDET_CTRL_POS_SYNC_MASK) - -#define SYSCON_GDETX_CTRL_GDET_CTRL_NEG_SYNC_MASK (0x20000U) -#define SYSCON_GDETX_CTRL_GDET_CTRL_NEG_SYNC_SHIFT (17U) -/*! NEG_SYNC - Negative glitch detected - * 0b1..Negative glitch detected - * 0b0..Negative glitch not detected - */ -#define SYSCON_GDETX_CTRL_GDET_CTRL_NEG_SYNC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GDETX_CTRL_GDET_CTRL_NEG_SYNC_SHIFT)) & SYSCON_GDETX_CTRL_GDET_CTRL_NEG_SYNC_MASK) - -#define SYSCON_GDETX_CTRL_GDET_CTRL_EVENT_CLR_FLAG_MASK (0x40000U) -#define SYSCON_GDETX_CTRL_GDET_CTRL_EVENT_CLR_FLAG_SHIFT (18U) -/*! EVENT_CLR_FLAG - Event counter cleared - * 0b1..Event counter cleared - * 0b0..Event counter not cleared - */ -#define SYSCON_GDETX_CTRL_GDET_CTRL_EVENT_CLR_FLAG(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GDETX_CTRL_GDET_CTRL_EVENT_CLR_FLAG_SHIFT)) & SYSCON_GDETX_CTRL_GDET_CTRL_EVENT_CLR_FLAG_MASK) -/*! @} */ - -/* The count of SYSCON_GDETX_CTRL_GDET_CTRL */ -#define SYSCON_GDETX_CTRL_GDET_CTRL_COUNT (2U) - -/*! @name ELS_ASSET_PROT - ELS Asset Protection Register */ -/*! @{ */ - -#define SYSCON_ELS_ASSET_PROT_ASSET_PROTECTION_MASK (0x3U) -#define SYSCON_ELS_ASSET_PROT_ASSET_PROTECTION_SHIFT (0U) -/*! ASSET_PROTECTION - ELS asset protection. This field controls the asset protection port to the - * ELS module. Refer to the ELS chapter in the SRM for more details. - * 0b00..ELS asset is protected - * 0b10..ELS asset is protected - * 0b11..ELS asset is protected - * 0b01..ELS asset is not protected - */ -#define SYSCON_ELS_ASSET_PROT_ASSET_PROTECTION(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_ASSET_PROT_ASSET_PROTECTION_SHIFT)) & SYSCON_ELS_ASSET_PROT_ASSET_PROTECTION_MASK) -/*! @} */ - -/*! @name ELS_LOCK_CTRL - ELS Lock Control */ -/*! @{ */ - -#define SYSCON_ELS_LOCK_CTRL_LOCK_CTRL_MASK (0x3U) -#define SYSCON_ELS_LOCK_CTRL_LOCK_CTRL_SHIFT (0U) -/*! LOCK_CTRL - ELS Lock Control */ -#define SYSCON_ELS_LOCK_CTRL_LOCK_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_LOCK_CTRL_LOCK_CTRL_SHIFT)) & SYSCON_ELS_LOCK_CTRL_LOCK_CTRL_MASK) -/*! @} */ - -/*! @name ELS_LOCK_CTRL_DP - ELS Lock Control DP */ -/*! @{ */ - -#define SYSCON_ELS_LOCK_CTRL_DP_LOCK_CTRL_DP_MASK (0x3U) -#define SYSCON_ELS_LOCK_CTRL_DP_LOCK_CTRL_DP_SHIFT (0U) -/*! LOCK_CTRL_DP - Refer to ELS_LOCK_CTRL[1:0] */ -#define SYSCON_ELS_LOCK_CTRL_DP_LOCK_CTRL_DP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_LOCK_CTRL_DP_LOCK_CTRL_DP_SHIFT)) & SYSCON_ELS_LOCK_CTRL_DP_LOCK_CTRL_DP_MASK) -/*! @} */ - -/*! @name ELS_OTP_LC_STATE - Life Cycle State Register */ -/*! @{ */ - -#define SYSCON_ELS_OTP_LC_STATE_OTP_LC_STATE_MASK (0xFFU) -#define SYSCON_ELS_OTP_LC_STATE_OTP_LC_STATE_SHIFT (0U) -/*! OTP_LC_STATE - OTP life cycle state */ -#define SYSCON_ELS_OTP_LC_STATE_OTP_LC_STATE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_OTP_LC_STATE_OTP_LC_STATE_SHIFT)) & SYSCON_ELS_OTP_LC_STATE_OTP_LC_STATE_MASK) -/*! @} */ - -/*! @name ELS_OTP_LC_STATE_DP - Life Cycle State Register (Duplicate) */ -/*! @{ */ - -#define SYSCON_ELS_OTP_LC_STATE_DP_OTP_LC_STATE_DP_MASK (0xFFU) -#define SYSCON_ELS_OTP_LC_STATE_DP_OTP_LC_STATE_DP_SHIFT (0U) -/*! OTP_LC_STATE_DP - OTP life cycle state */ -#define SYSCON_ELS_OTP_LC_STATE_DP_OTP_LC_STATE_DP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_OTP_LC_STATE_DP_OTP_LC_STATE_DP_SHIFT)) & SYSCON_ELS_OTP_LC_STATE_DP_OTP_LC_STATE_DP_MASK) -/*! @} */ - -/*! @name ELS_TEMPORAL_STATE - ELS Temporal State */ -/*! @{ */ - -#define SYSCON_ELS_TEMPORAL_STATE_TEMPORAL_STATE_MASK (0xFU) -#define SYSCON_ELS_TEMPORAL_STATE_TEMPORAL_STATE_SHIFT (0U) -/*! TEMPORAL_STATE - Temporal state */ -#define SYSCON_ELS_TEMPORAL_STATE_TEMPORAL_STATE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_TEMPORAL_STATE_TEMPORAL_STATE_SHIFT)) & SYSCON_ELS_TEMPORAL_STATE_TEMPORAL_STATE_MASK) -/*! @} */ - -/*! @name ELS_KDF_MASK - Key Derivation Function Mask */ -/*! @{ */ - -#define SYSCON_ELS_KDF_MASK_KDF_MASK_MASK (0xFFFFFFFFU) -#define SYSCON_ELS_KDF_MASK_KDF_MASK_SHIFT (0U) -/*! KDF_MASK - Key derivation function mask */ -#define SYSCON_ELS_KDF_MASK_KDF_MASK(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_KDF_MASK_KDF_MASK_SHIFT)) & SYSCON_ELS_KDF_MASK_KDF_MASK_MASK) -/*! @} */ - -/*! @name ELS_AS_CFG0 - ELS AS Configuration */ -/*! @{ */ - -#define SYSCON_ELS_AS_CFG0_CFG_LC_STATE_MASK (0xFFU) -#define SYSCON_ELS_AS_CFG0_CFG_LC_STATE_SHIFT (0U) -/*! CFG_LC_STATE - LC state configuration bit */ -#define SYSCON_ELS_AS_CFG0_CFG_LC_STATE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_LC_STATE_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_LC_STATE_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_LVD_CORE_RESET_ENABLED_MASK (0x200U) -#define SYSCON_ELS_AS_CFG0_CFG_LVD_CORE_RESET_ENABLED_SHIFT (9U) -/*! CFG_LVD_CORE_RESET_ENABLED - When SPC CORE LVD analog detector are turned on, and CORE LVD reset are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_LVD_CORE_RESET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_LVD_CORE_RESET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_LVD_CORE_RESET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_LVD_CORE_IRQ_ENABLED_MASK (0x800U) -#define SYSCON_ELS_AS_CFG0_CFG_LVD_CORE_IRQ_ENABLED_SHIFT (11U) -/*! CFG_LVD_CORE_IRQ_ENABLED - When SPC CORE LVD analog detector are turned on, and CORE LVD IRQ are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_LVD_CORE_IRQ_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_LVD_CORE_IRQ_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_LVD_CORE_IRQ_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_WDT0_ENABLED_MASK (0x1000U) -#define SYSCON_ELS_AS_CFG0_CFG_WDT0_ENABLED_SHIFT (12U) -/*! CFG_WDT0_ENABLED - When WatchDog Timer 0 is activated, this bit indicates state 1 */ -#define SYSCON_ELS_AS_CFG0_CFG_WDT0_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_WDT0_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_WDT0_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_CWDT0_ENABLED_MASK (0x2000U) -#define SYSCON_ELS_AS_CFG0_CFG_CWDT0_ENABLED_SHIFT (13U) -/*! CFG_CWDT0_ENABLED - When Code WatchDog Timer 0 is activated, this bit indicates state 1 */ -#define SYSCON_ELS_AS_CFG0_CFG_CWDT0_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_CWDT0_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_CWDT0_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_ELS_GDET_ENABLED_MASK (0x4000U) -#define SYSCON_ELS_AS_CFG0_CFG_ELS_GDET_ENABLED_SHIFT (14U) -/*! CFG_ELS_GDET_ENABLED - When either GDET is enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_ELS_GDET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_ELS_GDET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_ELS_GDET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_ANA_GDET_RESET_ENABLED_MASK (0x8000U) -#define SYSCON_ELS_AS_CFG0_CFG_ANA_GDET_RESET_ENABLED_SHIFT (15U) -/*! CFG_ANA_GDET_RESET_ENABLED - When SPC analog glitch detect reset is enabled, this bit indicates state 1 */ -#define SYSCON_ELS_AS_CFG0_CFG_ANA_GDET_RESET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_ANA_GDET_RESET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_ANA_GDET_RESET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_ANA_GDET_IRQ_ENABLED_MASK (0x10000U) -#define SYSCON_ELS_AS_CFG0_CFG_ANA_GDET_IRQ_ENABLED_SHIFT (16U) -/*! CFG_ANA_GDET_IRQ_ENABLED - When SPC analog glitch detect IRQ is enabled, this bit indicates state 1 */ -#define SYSCON_ELS_AS_CFG0_CFG_ANA_GDET_IRQ_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_ANA_GDET_IRQ_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_ANA_GDET_IRQ_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_TAMPER_DET_ENABLED_MASK (0x20000U) -#define SYSCON_ELS_AS_CFG0_CFG_TAMPER_DET_ENABLED_SHIFT (17U) -/*! CFG_TAMPER_DET_ENABLED - When tamper detector is enabled in TDET, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_TAMPER_DET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_TAMPER_DET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_TAMPER_DET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VSYS_RESET_ENABLED_MASK (0x40000U) -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VSYS_RESET_ENABLED_SHIFT (18U) -/*! CFG_LVD_VSYS_RESET_ENABLED - When SPC VSYS LVD analog detector are turned on and VSYS LVD reset are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VSYS_RESET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_LVD_VSYS_RESET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_LVD_VSYS_RESET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VDDIO_RESET_ENABLED_MASK (0x80000U) -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VDDIO_RESET_ENABLED_SHIFT (19U) -/*! CFG_LVD_VDDIO_RESET_ENABLED - When SPC VDDIO LVD analog detector are turned on and VDDIO LVD reset are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VDDIO_RESET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_LVD_VDDIO_RESET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_LVD_VDDIO_RESET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VSYS_IRQ_ENABLED_MASK (0x100000U) -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VSYS_IRQ_ENABLED_SHIFT (20U) -/*! CFG_LVD_VSYS_IRQ_ENABLED - When SPC VSYS LVD analog detector are turned on and VSYS LVD irq are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VSYS_IRQ_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_LVD_VSYS_IRQ_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_LVD_VSYS_IRQ_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VDDIO_IRQ_ENABLED_MASK (0x200000U) -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VDDIO_IRQ_ENABLED_SHIFT (21U) -/*! CFG_LVD_VDDIO_IRQ_ENABLED - When SPC VDDIO LVD analog detector are turned on and VDDIO LVD irq are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VDDIO_IRQ_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_LVD_VDDIO_IRQ_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_LVD_VDDIO_IRQ_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_WDT1_ENABLED_MASK (0x400000U) -#define SYSCON_ELS_AS_CFG0_CFG_WDT1_ENABLED_SHIFT (22U) -/*! CFG_WDT1_ENABLED - When WatchDog Timer 1 is activated, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_WDT1_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_WDT1_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_WDT1_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_CWDT1_ENABLED_MASK (0x800000U) -#define SYSCON_ELS_AS_CFG0_CFG_CWDT1_ENABLED_SHIFT (23U) -/*! CFG_CWDT1_ENABLED - When Code WatchDog Timer 1 is activated, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_CWDT1_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_CWDT1_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_CWDT1_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_TEMPTAMPER_DET_ENABLED_MASK (0x1000000U) -#define SYSCON_ELS_AS_CFG0_CFG_TEMPTAMPER_DET_ENABLED_SHIFT (24U) -/*! CFG_TEMPTAMPER_DET_ENABLED - When temperature tamper detector is enabled in VBAT, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_TEMPTAMPER_DET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_TEMPTAMPER_DET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_TEMPTAMPER_DET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_VOLTAMPER_DET_ENABLED_MASK (0x2000000U) -#define SYSCON_ELS_AS_CFG0_CFG_VOLTAMPER_DET_ENABLED_SHIFT (25U) -/*! CFG_VOLTAMPER_DET_ENABLED - When voltage tamper detector is enabled in VBAT, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_VOLTAMPER_DET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_VOLTAMPER_DET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_VOLTAMPER_DET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_LHTTAMPER_DET_ENABLED_MASK (0x4000000U) -#define SYSCON_ELS_AS_CFG0_CFG_LHTTAMPER_DET_ENABLED_SHIFT (26U) -/*! CFG_LHTTAMPER_DET_ENABLED - When light tamper detector is enabled in VBAT, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_LHTTAMPER_DET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_LHTTAMPER_DET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_LHTTAMPER_DET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_CLKTAMPER_DET_ENABLED_MASK (0x8000000U) -#define SYSCON_ELS_AS_CFG0_CFG_CLKTAMPER_DET_ENABLED_SHIFT (27U) -/*! CFG_CLKTAMPER_DET_ENABLED - When clk tamper detector is enabled in VBAT, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_CLKTAMPER_DET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_CLKTAMPER_DET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_CLKTAMPER_DET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_QK_DISABLE_ENROLL_MASK (0x10000000U) -#define SYSCON_ELS_AS_CFG0_CFG_QK_DISABLE_ENROLL_SHIFT (28U) -/*! CFG_QK_DISABLE_ENROLL - When QK PUF "qk_disable_enroll" input is driven 1, this bit indicates state 1 */ -#define SYSCON_ELS_AS_CFG0_CFG_QK_DISABLE_ENROLL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_QK_DISABLE_ENROLL_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_QK_DISABLE_ENROLL_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_QK_DISABLE_WRAP_MASK (0x20000000U) -#define SYSCON_ELS_AS_CFG0_CFG_QK_DISABLE_WRAP_SHIFT (29U) -/*! CFG_QK_DISABLE_WRAP - When QK PUF "qk_disable_wrap" input is driven 1, this bit indicates state 1 */ -#define SYSCON_ELS_AS_CFG0_CFG_QK_DISABLE_WRAP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_QK_DISABLE_WRAP_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_QK_DISABLE_WRAP_MASK) -/*! @} */ - -/*! @name ELS_AS_CFG1 - ELS AS Configuration1 */ -/*! @{ */ - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_DIS_STRICT_MODE_MASK (0x2U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_DIS_STRICT_MODE_SHIFT (1U) -/*! CFG_SEC_DIS_STRICT_MODE - When CFG_SEC_ENA_SEC_CHK indicates state 0 or when DISABLE_STRICT_MODE - * bits in MISC_CTRL_REG and MISC_CTRL_DP_REG on the AHB secure controller are equal to 01, this - * bit indicates state 1 - */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_DIS_STRICT_MODE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_DIS_STRICT_MODE_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_DIS_STRICT_MODE_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_DIS_VIOL_ABORT_MASK (0x4U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_DIS_VIOL_ABORT_SHIFT (2U) -/*! CFG_SEC_DIS_VIOL_ABORT - When the DISABLE_VIOLATION_ABORT bits in MISC_CTRL_REG and - * MISC_CTRL_DP_REG on the AHB secure controller are not equal to 10, this bit indicates state 1 - */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_DIS_VIOL_ABORT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_DIS_VIOL_ABORT_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_DIS_VIOL_ABORT_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_NS_PRIV_CHK_MASK (0x8U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_NS_PRIV_CHK_SHIFT (3U) -/*! CFG_SEC_ENA_NS_PRIV_CHK - When the ENABLE_NS_PRIV_CHECK bits in MISC_CTRL_REG and - * MISC_CTRL_DP_REG on the AHB secure controller are not equal to 10, this bit indicates state 1 - */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_NS_PRIV_CHK(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_NS_PRIV_CHK_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_NS_PRIV_CHK_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_S_PRIV_CHK_MASK (0x10U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_S_PRIV_CHK_SHIFT (4U) -/*! CFG_SEC_ENA_S_PRIV_CHK - When the ENABLE_S_PRIV_CHECK bits in MISC_CTRL_REG and MISC_CTRL_DP_REG - * on the AHB secure controller are not equal to 10, this bit indicates state 1 - */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_S_PRIV_CHK(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_S_PRIV_CHK_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_S_PRIV_CHK_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_SEC_CHK_MASK (0x20U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_SEC_CHK_SHIFT (5U) -/*! CFG_SEC_ENA_SEC_CHK - When the ENABLE_SECURE_CHECKING bits in MISC_CTRL_REG and MISC_CTRL_DP_REG - * on the AHB secure controller are not equal to 10, this bit indicates state 1 - */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_SEC_CHK(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_SEC_CHK_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_SEC_CHK_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_IDAU_ALLNS_MASK (0x40U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_IDAU_ALLNS_SHIFT (6U) -/*! CFG_SEC_IDAU_ALLNS - When the IDAU_ALL_NS bits in MISC_CTRL_REG and MISC_CTRL_DP_REG on the AHB - * secure controller are equal to 01, this bit indicates state 1 - */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_IDAU_ALLNS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_IDAU_ALLNS_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_IDAU_ALLNS_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_NS_MPU_MASK (0x100U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_NS_MPU_SHIFT (8U) -/*! CFG_SEC_LOCK_NS_MPU - When the LOCK_NS_MPU bits in CPU0_LOCK_REG on the AHB secure controller are not equal to 10, this bit indicates state 1 */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_NS_MPU(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_NS_MPU_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_NS_MPU_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_NS_VTOR_MASK (0x200U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_NS_VTOR_SHIFT (9U) -/*! CFG_SEC_LOCK_NS_VTOR - When the LOCK_NS_VTOR bits in CPU0_LOCK_REG on the AHB secure controller are not equal to 10, this bit indicates state 1 */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_NS_VTOR(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_NS_VTOR_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_NS_VTOR_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_S_MPU_MASK (0x400U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_S_MPU_SHIFT (10U) -/*! CFG_SEC_LOCK_S_MPU - When the LOCK_S_MPU bits in CPU0_LOCK_REG on the AHB secure controller are not equal to 10, this bit indicates state 1 */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_S_MPU(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_S_MPU_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_S_MPU_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_S_VTAIRCR_MASK (0x800U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_S_VTAIRCR_SHIFT (11U) -/*! CFG_SEC_LOCK_S_VTAIRCR - When the LOCK_S_VTAIRCR bits in CPU0_LOCK_REG on the AHB secure - * controller are not equal to 10, this bit indicates state 1 - */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_S_VTAIRCR(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_S_VTAIRCR_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_S_VTAIRCR_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_SAU_MASK (0x1000U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_SAU_SHIFT (12U) -/*! CFG_SEC_LOCK_SAU - When the LOCK_SAU bits in CPU0_LOCK_REG on the AHB secure controller are not equal to 10, this bit indicates state 1 */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_SAU(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_SAU_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_SAU_MASK) - -#define SYSCON_ELS_AS_CFG1_METAL_VERSION_MASK (0x1FE000U) -#define SYSCON_ELS_AS_CFG1_METAL_VERSION_SHIFT (13U) -/*! METAL_VERSION - metal version */ -#define SYSCON_ELS_AS_CFG1_METAL_VERSION(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_METAL_VERSION_SHIFT)) & SYSCON_ELS_AS_CFG1_METAL_VERSION_MASK) - -#define SYSCON_ELS_AS_CFG1_ROM_PATCH_VERSION_MASK (0x1E00000U) -#define SYSCON_ELS_AS_CFG1_ROM_PATCH_VERSION_SHIFT (21U) -/*! ROM_PATCH_VERSION - ROM patch version */ -#define SYSCON_ELS_AS_CFG1_ROM_PATCH_VERSION(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_ROM_PATCH_VERSION_SHIFT)) & SYSCON_ELS_AS_CFG1_ROM_PATCH_VERSION_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_HVD_CORE_RESET_ENABLED_MASK (0x4000000U) -#define SYSCON_ELS_AS_CFG1_CFG_HVD_CORE_RESET_ENABLED_SHIFT (26U) -/*! CFG_HVD_CORE_RESET_ENABLED - When SPC CORE HVD analog detector are turned on, and CORE HVD reset are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG1_CFG_HVD_CORE_RESET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_HVD_CORE_RESET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_HVD_CORE_RESET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_HVD_CORE_IRQ_ENABLED_MASK (0x8000000U) -#define SYSCON_ELS_AS_CFG1_CFG_HVD_CORE_IRQ_ENABLED_SHIFT (27U) -/*! CFG_HVD_CORE_IRQ_ENABLED - When SPC CORE HVD analog detector are turned on, and CORE HVD IRQ are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG1_CFG_HVD_CORE_IRQ_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_HVD_CORE_IRQ_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_HVD_CORE_IRQ_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VSYS_RESET_ENABLED_MASK (0x10000000U) -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VSYS_RESET_ENABLED_SHIFT (28U) -/*! CFG_HVD_VSYS_RESET_ENABLED - When SPC VSYS HVD analog detector are turned on and VSYS HVD reset are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VSYS_RESET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_HVD_VSYS_RESET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_HVD_VSYS_RESET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VDDIO_RESET_ENABLED_MASK (0x20000000U) -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VDDIO_RESET_ENABLED_SHIFT (29U) -/*! CFG_HVD_VDDIO_RESET_ENABLED - When SPC VDDIO HVD analog detector are turned on and VDDIO HVD reset are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VDDIO_RESET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_HVD_VDDIO_RESET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_HVD_VDDIO_RESET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VSYS_IRQ_ENABLED_MASK (0x40000000U) -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VSYS_IRQ_ENABLED_SHIFT (30U) -/*! CFG_HVD_VSYS_IRQ_ENABLED - When SPC VSYS HVD analog detector are turned on and VSYS HVD irq are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VSYS_IRQ_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_HVD_VSYS_IRQ_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_HVD_VSYS_IRQ_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VDDIO_IRQ_ENABLED_MASK (0x80000000U) -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VDDIO_IRQ_ENABLED_SHIFT (31U) -/*! CFG_HVD_VDDIO_IRQ_ENABLED - When SPC VDDIO HVD analog detector are turned on and VDDIO HVD irq are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VDDIO_IRQ_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_HVD_VDDIO_IRQ_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_HVD_VDDIO_IRQ_ENABLED_MASK) -/*! @} */ - -/*! @name ELS_AS_CFG2 - ELS AS Configuration2 */ -/*! @{ */ - -#define SYSCON_ELS_AS_CFG2_CFG_ELS_CMD_EN_MASK (0xFFFFFFFFU) -#define SYSCON_ELS_AS_CFG2_CFG_ELS_CMD_EN_SHIFT (0U) -/*! CFG_ELS_CMD_EN - ELS configuration command enable bit */ -#define SYSCON_ELS_AS_CFG2_CFG_ELS_CMD_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG2_CFG_ELS_CMD_EN_SHIFT)) & SYSCON_ELS_AS_CFG2_CFG_ELS_CMD_EN_MASK) -/*! @} */ - -/*! @name ELS_AS_CFG3 - ELS AS Configuration3 */ -/*! @{ */ - -#define SYSCON_ELS_AS_CFG3_DEVICE_TYPE_MASK (0xFFFFFFFFU) -#define SYSCON_ELS_AS_CFG3_DEVICE_TYPE_SHIFT (0U) -/*! DEVICE_TYPE - Device type identification data */ -#define SYSCON_ELS_AS_CFG3_DEVICE_TYPE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG3_DEVICE_TYPE_SHIFT)) & SYSCON_ELS_AS_CFG3_DEVICE_TYPE_MASK) -/*! @} */ - -/*! @name ELS_AS_ST0 - ELS AS State Register */ -/*! @{ */ - -#define SYSCON_ELS_AS_ST0_ST_TEMPORAL_STATE_MASK (0xFU) -#define SYSCON_ELS_AS_ST0_ST_TEMPORAL_STATE_SHIFT (0U) -/*! ST_TEMPORAL_STATE - TEMPORAL_STATE[3:0] in the ELS_TEMPORAL_STATE register reflects this register */ -#define SYSCON_ELS_AS_ST0_ST_TEMPORAL_STATE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_TEMPORAL_STATE_SHIFT)) & SYSCON_ELS_AS_ST0_ST_TEMPORAL_STATE_MASK) - -#define SYSCON_ELS_AS_ST0_ST_CPU0_DBGEN_MASK (0x10U) -#define SYSCON_ELS_AS_ST0_ST_CPU0_DBGEN_SHIFT (4U) -/*! ST_CPU0_DBGEN - When CPU0 (CM33) "deben" input is state 1, this bit indicates state 1 */ -#define SYSCON_ELS_AS_ST0_ST_CPU0_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_CPU0_DBGEN_SHIFT)) & SYSCON_ELS_AS_ST0_ST_CPU0_DBGEN_MASK) - -#define SYSCON_ELS_AS_ST0_ST_CPU0_NIDEN_MASK (0x20U) -#define SYSCON_ELS_AS_ST0_ST_CPU0_NIDEN_SHIFT (5U) -/*! ST_CPU0_NIDEN - When CPU0 (CM33) "niden" input is state 1, this bit indicates state 1 */ -#define SYSCON_ELS_AS_ST0_ST_CPU0_NIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_CPU0_NIDEN_SHIFT)) & SYSCON_ELS_AS_ST0_ST_CPU0_NIDEN_MASK) - -#define SYSCON_ELS_AS_ST0_ST_CPU0_SPIDEN_MASK (0x40U) -#define SYSCON_ELS_AS_ST0_ST_CPU0_SPIDEN_SHIFT (6U) -/*! ST_CPU0_SPIDEN - When CPU0 (CM33) "spiden" input is state 1, this bit indicates state 1 */ -#define SYSCON_ELS_AS_ST0_ST_CPU0_SPIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_CPU0_SPIDEN_SHIFT)) & SYSCON_ELS_AS_ST0_ST_CPU0_SPIDEN_MASK) - -#define SYSCON_ELS_AS_ST0_ST_CPU0_SPNIDEN_MASK (0x80U) -#define SYSCON_ELS_AS_ST0_ST_CPU0_SPNIDEN_SHIFT (7U) -/*! ST_CPU0_SPNIDEN - When CPU0 (CM33) "spniden" input is state 1, this bit indicates state 1 */ -#define SYSCON_ELS_AS_ST0_ST_CPU0_SPNIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_CPU0_SPNIDEN_SHIFT)) & SYSCON_ELS_AS_ST0_ST_CPU0_SPNIDEN_MASK) - -#define SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_CPU0_MASK (0x400U) -#define SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_CPU0_SHIFT (10U) -/*! ST_DAP_ENABLE_CPU0 - When DAP to AP0 for CPU0 (CM33) debug access is allowed, this bit indicates state 1 */ -#define SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_CPU0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_CPU0_SHIFT)) & SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_CPU0_MASK) - -#define SYSCON_ELS_AS_ST0_ST_ALLOW_TEST_ACCESS_MASK (0x4000U) -#define SYSCON_ELS_AS_ST0_ST_ALLOW_TEST_ACCESS_SHIFT (14U) -/*! ST_ALLOW_TEST_ACCESS - When JTAG TAP access is allowed, this bit indicates state 1. */ -#define SYSCON_ELS_AS_ST0_ST_ALLOW_TEST_ACCESS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_ALLOW_TEST_ACCESS_SHIFT)) & SYSCON_ELS_AS_ST0_ST_ALLOW_TEST_ACCESS_MASK) - -#define SYSCON_ELS_AS_ST0_ST_XO32K_FAILED_MASK (0x8000U) -#define SYSCON_ELS_AS_ST0_ST_XO32K_FAILED_SHIFT (15U) -/*! ST_XO32K_FAILED - When XO32K oscillation fail flag is state 1, this bit indicates state 1 */ -#define SYSCON_ELS_AS_ST0_ST_XO32K_FAILED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_XO32K_FAILED_SHIFT)) & SYSCON_ELS_AS_ST0_ST_XO32K_FAILED_MASK) - -#define SYSCON_ELS_AS_ST0_ST_XO40M_FAILED_MASK (0x10000U) -#define SYSCON_ELS_AS_ST0_ST_XO40M_FAILED_SHIFT (16U) -/*! ST_XO40M_FAILED - When XO40M oscillation fail flag is state 1, this bit indicates state 1 */ -#define SYSCON_ELS_AS_ST0_ST_XO40M_FAILED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_XO40M_FAILED_SHIFT)) & SYSCON_ELS_AS_ST0_ST_XO40M_FAILED_MASK) - -#define SYSCON_ELS_AS_ST0_ST_IFR_LOAD_FAILED_MASK (0x20000U) -#define SYSCON_ELS_AS_ST0_ST_IFR_LOAD_FAILED_SHIFT (17U) -/*! ST_IFR_LOAD_FAILED - When IFR load fail flag is state 1, this bit indicates state 1 */ -#define SYSCON_ELS_AS_ST0_ST_IFR_LOAD_FAILED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_IFR_LOAD_FAILED_SHIFT)) & SYSCON_ELS_AS_ST0_ST_IFR_LOAD_FAILED_MASK) - -#define SYSCON_ELS_AS_ST0_ST_GLITCH_DETECT_FLAG_MASK (0x3C0000U) -#define SYSCON_ELS_AS_ST0_ST_GLITCH_DETECT_FLAG_SHIFT (18U) -/*! ST_GLITCH_DETECT_FLAG - GLITCH_DETECT_FLAG is state of 4-bit Glitch Ripple Counter output. */ -#define SYSCON_ELS_AS_ST0_ST_GLITCH_DETECT_FLAG(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_GLITCH_DETECT_FLAG_SHIFT)) & SYSCON_ELS_AS_ST0_ST_GLITCH_DETECT_FLAG_MASK) -/*! @} */ - -/*! @name ELS_AS_ST1 - ELS AS State1 */ -/*! @{ */ - -#define SYSCON_ELS_AS_ST1_ST_QK_PUF_SCORE_MASK (0xFU) -#define SYSCON_ELS_AS_ST1_ST_QK_PUF_SCORE_SHIFT (0U) -/*! ST_QK_PUF_SCORE - These register bits indicate the state of "qk_puf_score[3:0]" outputs from QK PUF block */ -#define SYSCON_ELS_AS_ST1_ST_QK_PUF_SCORE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST1_ST_QK_PUF_SCORE_SHIFT)) & SYSCON_ELS_AS_ST1_ST_QK_PUF_SCORE_MASK) - -#define SYSCON_ELS_AS_ST1_ST_QK_ZEROIZED_MASK (0x10U) -#define SYSCON_ELS_AS_ST1_ST_QK_ZEROIZED_SHIFT (4U) -/*! ST_QK_ZEROIZED - This register bit indicates the state of "qk_zeroized" output from QK PUF block */ -#define SYSCON_ELS_AS_ST1_ST_QK_ZEROIZED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST1_ST_QK_ZEROIZED_SHIFT)) & SYSCON_ELS_AS_ST1_ST_QK_ZEROIZED_MASK) - -#define SYSCON_ELS_AS_ST1_ST_MAIN_CLK_IS_EXT_MASK (0x20U) -#define SYSCON_ELS_AS_ST1_ST_MAIN_CLK_IS_EXT_SHIFT (5U) -/*! ST_MAIN_CLK_IS_EXT - When MAIN_CLK is running from external clock source either XO32M, XO32K or GPIO CLKIN, this bit indicates state 1 */ -#define SYSCON_ELS_AS_ST1_ST_MAIN_CLK_IS_EXT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST1_ST_MAIN_CLK_IS_EXT_SHIFT)) & SYSCON_ELS_AS_ST1_ST_MAIN_CLK_IS_EXT_MASK) - -#define SYSCON_ELS_AS_ST1_ST_DCDC_VOUT_MASK (0xC0U) -#define SYSCON_ELS_AS_ST1_ST_DCDC_VOUT_SHIFT (6U) -/*! ST_DCDC_VOUT - VOUT[1:0] setting on DCDC0 register in SPC block will reflect to this register. Default is 1.0V */ -#define SYSCON_ELS_AS_ST1_ST_DCDC_VOUT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST1_ST_DCDC_VOUT_SHIFT)) & SYSCON_ELS_AS_ST1_ST_DCDC_VOUT_MASK) - -#define SYSCON_ELS_AS_ST1_ST_DCDC_DS_MASK (0x300U) -#define SYSCON_ELS_AS_ST1_ST_DCDC_DS_SHIFT (8U) -/*! ST_DCDC_DS - DCDC drive strength setting. Default is normal drive. */ -#define SYSCON_ELS_AS_ST1_ST_DCDC_DS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST1_ST_DCDC_DS_SHIFT)) & SYSCON_ELS_AS_ST1_ST_DCDC_DS_MASK) - -#define SYSCON_ELS_AS_ST1_ST_BOOT_MODE_MASK (0xC00U) -#define SYSCON_ELS_AS_ST1_ST_BOOT_MODE_SHIFT (10U) -/*! ST_BOOT_MODE - ISP pin status during boot. By default ISP pin is pulled up. If want to enter ISP - * mode during boot, ISP pin should be pull down when out of reset. - */ -#define SYSCON_ELS_AS_ST1_ST_BOOT_MODE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST1_ST_BOOT_MODE_SHIFT)) & SYSCON_ELS_AS_ST1_ST_BOOT_MODE_MASK) - -#define SYSCON_ELS_AS_ST1_ST_BOOT_RETRY_CNT_MASK (0xF000U) -#define SYSCON_ELS_AS_ST1_ST_BOOT_RETRY_CNT_SHIFT (12U) -/*! ST_BOOT_RETRY_CNT - BOOT_RETRY_CNT[3:0] in the ELS_BOOT_RETRY_CNT register reflects this register */ -#define SYSCON_ELS_AS_ST1_ST_BOOT_RETRY_CNT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST1_ST_BOOT_RETRY_CNT_SHIFT)) & SYSCON_ELS_AS_ST1_ST_BOOT_RETRY_CNT_MASK) - -#define SYSCON_ELS_AS_ST1_ST_LDO_CORE_VOUT_MASK (0x30000U) -#define SYSCON_ELS_AS_ST1_ST_LDO_CORE_VOUT_SHIFT (16U) -/*! ST_LDO_CORE_VOUT - VOUT[1:0] setting on LDO Core register in SPC block will reflect to this register. Default is 1.0V */ -#define SYSCON_ELS_AS_ST1_ST_LDO_CORE_VOUT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST1_ST_LDO_CORE_VOUT_SHIFT)) & SYSCON_ELS_AS_ST1_ST_LDO_CORE_VOUT_MASK) - -#define SYSCON_ELS_AS_ST1_ST_LDO_CORE_DS_MASK (0xC0000U) -#define SYSCON_ELS_AS_ST1_ST_LDO_CORE_DS_SHIFT (18U) -/*! ST_LDO_CORE_DS - LDO_CORE drive strength setting. Default is normal drive. */ -#define SYSCON_ELS_AS_ST1_ST_LDO_CORE_DS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST1_ST_LDO_CORE_DS_SHIFT)) & SYSCON_ELS_AS_ST1_ST_LDO_CORE_DS_MASK) -/*! @} */ - -/*! @name ELS_AS_BOOT_LOG0 - Boot state captured during boot: Main ROM log */ -/*! @{ */ - -#define SYSCON_ELS_AS_BOOT_LOG0_BOOT_IMAGE_MASK (0xFU) -#define SYSCON_ELS_AS_BOOT_LOG0_BOOT_IMAGE_SHIFT (0U) -/*! BOOT_IMAGE - Boot image source used during this boot. - * 0b0000..Internal flash image 0 - * 0b0001..Internal flash image 1 - * 0b0010..FlexSPI flash image 0 - * 0b0011..FlexSPI flash image 1 - * 0b0100..Recovery SPI flash image - * 0b0101..Serial boot image (write-memory and execute ISP command used) - * 0b0110..Receive SB3 containing SB_JUMP command is used. - * 0b0111..Customer SBL/recovery image (Bank1 IFR0). - * 0b1000..NXP MAD recovery image (Bank1 IFR0). - * 0b1001..NXP ROM extension (NMPA - Bank0 IFR0). - * 0b1010..Reserved. - * 0b1011..Reserved. - * 0b1100..Reserved. - * 0b1101..Reserved. - * 0b1110..Reserved. - * 0b1111..Reserved. - */ -#define SYSCON_ELS_AS_BOOT_LOG0_BOOT_IMAGE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_BOOT_IMAGE_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_BOOT_IMAGE_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_CMAC_MASK (0x10U) -#define SYSCON_ELS_AS_BOOT_LOG0_CMAC_SHIFT (4U) -/*! CMAC - CMAC verify is used instead of ECDSA verify on this boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_CMAC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_CMAC_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_CMAC_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_ECDSA_MASK (0x40U) -#define SYSCON_ELS_AS_BOOT_LOG0_ECDSA_SHIFT (6U) -/*! ECDSA - ECDSA P-384 verification is done on this boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_ECDSA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_ECDSA_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_ECDSA_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_OFF_CHIP_MASK (0x80U) -#define SYSCON_ELS_AS_BOOT_LOG0_OFF_CHIP_SHIFT (7U) -/*! OFF_CHIP - Off-chip Prince is enabled during boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_OFF_CHIP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_OFF_CHIP_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_OFF_CHIP_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_ON_CHIP_MASK (0x100U) -#define SYSCON_ELS_AS_BOOT_LOG0_ON_CHIP_SHIFT (8U) -/*! ON_CHIP - On-chip Prince is enabled during boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_ON_CHIP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_ON_CHIP_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_ON_CHIP_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_CDI_CSR_MASK (0x200U) -#define SYSCON_ELS_AS_BOOT_LOG0_CDI_CSR_SHIFT (9U) -/*! CDI_CSR - CDI based device keys are derived for CSR harvesting on this boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_CDI_CSR(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_CDI_CSR_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_CDI_CSR_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_CDI_DICE_MASK (0x400U) -#define SYSCON_ELS_AS_BOOT_LOG0_CDI_DICE_SHIFT (10U) -/*! CDI_DICE - CDI per DICE specification is computed on this boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_CDI_DICE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_CDI_DICE_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_CDI_DICE_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_TRUSTZONE_MASK (0x800U) -#define SYSCON_ELS_AS_BOOT_LOG0_TRUSTZONE_SHIFT (11U) -/*! TRUSTZONE - TrustZone preset data is loaded during this boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_TRUSTZONE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_TRUSTZONE_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_TRUSTZONE_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_DEBUG_AUTH_MASK (0x1000U) -#define SYSCON_ELS_AS_BOOT_LOG0_DEBUG_AUTH_SHIFT (12U) -/*! DEBUG_AUTH - Debug authentication done in this session prior to boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_DEBUG_AUTH(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_DEBUG_AUTH_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_DEBUG_AUTH_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_ITRC_MASK (0x2000U) -#define SYSCON_ELS_AS_BOOT_LOG0_ITRC_SHIFT (13U) -/*! ITRC - ITRC zeroize event is handled in this session of boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_ITRC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_ITRC_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_ITRC_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_DIG_GDET_MASK (0x4000U) -#define SYSCON_ELS_AS_BOOT_LOG0_DIG_GDET_SHIFT (14U) -/*! DIG_GDET - Digital glitch detector is enabled during boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_DIG_GDET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_DIG_GDET_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_DIG_GDET_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_ANA_GDET_MASK (0x8000U) -#define SYSCON_ELS_AS_BOOT_LOG0_ANA_GDET_SHIFT (15U) -/*! ANA_GDET - Analog glitch detector is enabled during boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_ANA_GDET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_ANA_GDET_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_ANA_GDET_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_DEEP_PD_MASK (0x10000U) -#define SYSCON_ELS_AS_BOOT_LOG0_DEEP_PD_SHIFT (16U) -/*! DEEP_PD - Boot from deep-power down state. */ -#define SYSCON_ELS_AS_BOOT_LOG0_DEEP_PD(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_DEEP_PD_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_DEEP_PD_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_LOW_POWER_MASK (0xF000000U) -#define SYSCON_ELS_AS_BOOT_LOG0_LOW_POWER_SHIFT (24U) -/*! LOW_POWER - Last low-power mode value. ROM copies SPC_LP_MODE field from SPC->SC[7:4]. */ -#define SYSCON_ELS_AS_BOOT_LOG0_LOW_POWER(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_LOW_POWER_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_LOW_POWER_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_ISP_MASK (0x80000000U) -#define SYSCON_ELS_AS_BOOT_LOG0_ISP_SHIFT (31U) -/*! ISP - ISP pin state at boot time. ROM copies CMC->MR0[0]. */ -#define SYSCON_ELS_AS_BOOT_LOG0_ISP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_ISP_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_ISP_MASK) -/*! @} */ - -/*! @name ELS_AS_BOOT_LOG1 - Boot state captured during boot: Library log */ -/*! @{ */ - -#define SYSCON_ELS_AS_BOOT_LOG1_RoTK_MASK (0x3U) -#define SYSCON_ELS_AS_BOOT_LOG1_RoTK_SHIFT (0U) -/*! RoTK - RoTK index used for this boot. */ -#define SYSCON_ELS_AS_BOOT_LOG1_RoTK(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG1_RoTK_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG1_RoTK_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG1_FIPS_MASK (0x3FCU) -#define SYSCON_ELS_AS_BOOT_LOG1_FIPS_SHIFT (2U) -/*! FIPS - FIPS self-test is executed and PASS during this boot. When a bit is set, means self-test - * is executed and it FAILS. When a bit is clear, means corresponding self-test is executed and - * PASS or it is not executed. - */ -#define SYSCON_ELS_AS_BOOT_LOG1_FIPS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG1_FIPS_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG1_FIPS_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG1_SB3_MASK (0xC00U) -#define SYSCON_ELS_AS_BOOT_LOG1_SB3_SHIFT (10U) -/*! SB3 - SB3 type (valid after nboot_sb3_load_manifest()). - * 0b00..customer fw load/update file. - * 0b01..NXP Provisioning FW. - * 0b10..ELS signed OEM Provisioning FW. - */ -#define SYSCON_ELS_AS_BOOT_LOG1_SB3(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG1_SB3_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG1_SB3_MASK) -/*! @} */ - -/*! @name ELS_AS_BOOT_LOG2 - Boot state captured during boot: Hardware status signals log */ -/*! @{ */ - -#define SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS0_MASK (0x3FU) -#define SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS0_SHIFT (0U) -/*! CMC_SRS0 - CMC->SRS[5:0] */ -#define SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS0_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS0_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG2_VBAT_STATUS0_MASK (0xC0U) -#define SYSCON_ELS_AS_BOOT_LOG2_VBAT_STATUS0_SHIFT (6U) -/*! VBAT_STATUS0 - VBAT->STATUSA[1:0] | ~VBAT->STATUSB[1:0] */ -#define SYSCON_ELS_AS_BOOT_LOG2_VBAT_STATUS0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG2_VBAT_STATUS0_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG2_VBAT_STATUS0_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS1_MASK (0x1FF00U) -#define SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS1_SHIFT (8U) -/*! CMC_SRS1 - CMC->SRS[16:8] */ -#define SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS1_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS1_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG2_VBAT_STATUS1_MASK (0xFC0000U) -#define SYSCON_ELS_AS_BOOT_LOG2_VBAT_STATUS1_SHIFT (18U) -/*! VBAT_STATUS1 - VBAT->STATUSA[11:6] | ~VBAT->STATUSB[11:6] */ -#define SYSCON_ELS_AS_BOOT_LOG2_VBAT_STATUS1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG2_VBAT_STATUS1_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG2_VBAT_STATUS1_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS2_MASK (0xFF000000U) -#define SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS2_SHIFT (24U) -/*! CMC_SRS2 - CMC->SRS[31:24] */ -#define SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS2(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS2_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS2_MASK) -/*! @} */ - -/*! @name ELS_AS_BOOT_LOG3 - Boot state captured during boot: Security log */ -/*! @{ */ - -#define SYSCON_ELS_AS_BOOT_LOG3_ERR_AUTH_FAIL_COUNT_MASK (0xFFU) -#define SYSCON_ELS_AS_BOOT_LOG3_ERR_AUTH_FAIL_COUNT_SHIFT (0U) -/*! ERR_AUTH_FAIL_COUNT - CFPA->ERR_AUTH_FAIL_COUNT[7:0] */ -#define SYSCON_ELS_AS_BOOT_LOG3_ERR_AUTH_FAIL_COUNT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG3_ERR_AUTH_FAIL_COUNT_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG3_ERR_AUTH_FAIL_COUNT_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG3_ERR_ITRC_COUNT_MASK (0xFF00U) -#define SYSCON_ELS_AS_BOOT_LOG3_ERR_ITRC_COUNT_SHIFT (8U) -/*! ERR_ITRC_COUNT - CFPA->ERR_ITRC_COUNT[7:0] */ -#define SYSCON_ELS_AS_BOOT_LOG3_ERR_ITRC_COUNT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG3_ERR_ITRC_COUNT_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG3_ERR_ITRC_COUNT_MASK) -/*! @} */ - -/*! @name ELS_AS_FLAG0 - ELS AS Flag0 */ -/*! @{ */ - -#define SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_CPU0_MASK (0x1U) -#define SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_CPU0_SHIFT (0U) -/*! FLAG_AP_ENABLE_CPU0 - This flag bit is set as 1 when DAP enables AP0 for CPU0 (CM33) debug - * access. The register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_CPU0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_CPU0_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_CPU0_MASK) - -#define SYSCON_ELS_AS_FLAG0_EFUSE_ATTACK_DETECT_MASK (0x8U) -#define SYSCON_ELS_AS_FLAG0_EFUSE_ATTACK_DETECT_SHIFT (3U) -/*! EFUSE_ATTACK_DETECT - OTPC can output attack_detect signal when it detects attack when load - * shadow registers. The output will be cleared by reset. ELS_AS_FLAG is reset by PoR, so the status - * can be recorded. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_EFUSE_ATTACK_DETECT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_EFUSE_ATTACK_DETECT_SHIFT)) & SYSCON_ELS_AS_FLAG0_EFUSE_ATTACK_DETECT_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_LVD_CORE_OCCURED_MASK (0x20U) -#define SYSCON_ELS_AS_FLAG0_FLAG_LVD_CORE_OCCURED_SHIFT (5U) -/*! FLAG_LVD_CORE_OCCURED - This flag register is set 1 when VDD_CORE LVD event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_LVD_CORE_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_LVD_CORE_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_LVD_CORE_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT0_RESET_OCCURED_MASK (0x100U) -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT0_RESET_OCCURED_SHIFT (8U) -/*! FLAG_WDT0_RESET_OCCURED - This flag bit is set as 1 when WatchDog Timer 0 reset is enabled and - * reset event is triggered. This register is cleared 0 by AO domain POR. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT0_RESET_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_WDT0_RESET_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_WDT0_RESET_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT0_RESET_OCCURED_MASK (0x200U) -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT0_RESET_OCCURED_SHIFT (9U) -/*! FLAG_CWDT0_RESET_OCCURED - This flag bit is set as 1 when Code WatchDog Timer 0 reset is enabled - * and reset event is triggered. This register is cleared 0 by AO domain POR. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT0_RESET_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_CWDT0_RESET_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_CWDT0_RESET_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT0_IRQ_OCCURED_MASK (0x400U) -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT0_IRQ_OCCURED_SHIFT (10U) -/*! FLAG_WDT0_IRQ_OCCURED - This flag bit is set as 1 when WatchDog Timer 0 IRQ is enabled and IRQ - * event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT0_IRQ_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_WDT0_IRQ_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_WDT0_IRQ_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT0_IRQ_OCCURED_MASK (0x800U) -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT0_IRQ_OCCURED_SHIFT (11U) -/*! FLAG_CWDT0_IRQ_OCCURED - This flag bit is set as 1 when Code WatchDog Timer 0 IRQ is enabled and - * IRQ event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT0_IRQ_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_CWDT0_IRQ_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_CWDT0_IRQ_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_QK_ERROR_MASK (0x1000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_QK_ERROR_SHIFT (12U) -/*! FLAG_QK_ERROR - This flag bit is set as 1 when QK_ERROR is flagged from QK PUF block. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_QK_ERROR(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_QK_ERROR_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_QK_ERROR_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_ELS_GLITCH_DETECTED_MASK (0x2000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_ELS_GLITCH_DETECTED_SHIFT (13U) -/*! FLAG_ELS_GLITCH_DETECTED - This flag bit is set as 1 when GDET error is flagged. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_ELS_GLITCH_DETECTED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_ELS_GLITCH_DETECTED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_ELS_GLITCH_DETECTED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_ANA_GLITCH_DETECTED_MASK (0x4000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_ANA_GLITCH_DETECTED_SHIFT (14U) -/*! FLAG_ANA_GLITCH_DETECTED - This flag bit is set as 1 when ANALOG GDET error is flagged in SYSCON - * block. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_ANA_GLITCH_DETECTED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_ANA_GLITCH_DETECTED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_ANA_GLITCH_DETECTED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_TAMPER_EVENT_DETECTED_MASK (0x8000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_TAMPER_EVENT_DETECTED_SHIFT (15U) -/*! FLAG_TAMPER_EVENT_DETECTED - This flag bit is set as 1 when tamper event is flagged from TDET. - * This register is cleared 0 by AO domain POR or by PMC reset event, if tamper detection event is - * cleared by software. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_TAMPER_EVENT_DETECTED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_TAMPER_EVENT_DETECTED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_TAMPER_EVENT_DETECTED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_FLASH_ECC_INVALID_MASK (0x10000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_FLASH_ECC_INVALID_SHIFT (16U) -/*! FLAG_FLASH_ECC_INVALID - This flag bit is set as 1 when FLASH controller indicates ECC error. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_FLASH_ECC_INVALID(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_FLASH_ECC_INVALID_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_FLASH_ECC_INVALID_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_SEC_VIOL_IRQ_OCURRED_MASK (0x20000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_SEC_VIOL_IRQ_OCURRED_SHIFT (17U) -/*! FLAG_SEC_VIOL_IRQ_OCURRED - This flag bit is set as 1 when security violation is indicated from FLASH sub-system or AHB bus matrix. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_SEC_VIOL_IRQ_OCURRED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_SEC_VIOL_IRQ_OCURRED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_SEC_VIOL_IRQ_OCURRED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_CPU0_NS_C_ACC_OCCURED_MASK (0x40000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_CPU0_NS_C_ACC_OCCURED_SHIFT (18U) -/*! FLAG_CPU0_NS_C_ACC_OCCURED - This flag bit is set as 1 when CPU0 (CM33) makes non-secure code - * transactions. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_CPU0_NS_C_ACC_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_CPU0_NS_C_ACC_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_CPU0_NS_C_ACC_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_CPU0_NS_D_ACC_OCCURED_MASK (0x80000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_CPU0_NS_D_ACC_OCCURED_SHIFT (19U) -/*! FLAG_CPU0_NS_D_ACC_OCCURED - This flag bit is set as 1 when CPU0 (CM33) makes non-secure data - * transactions. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_CPU0_NS_D_ACC_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_CPU0_NS_D_ACC_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_CPU0_NS_D_ACC_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_LVD_VSYS_OCCURED_MASK (0x100000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_LVD_VSYS_OCCURED_SHIFT (20U) -/*! FLAG_LVD_VSYS_OCCURED - This flag register is set 1 when VDD_SYS LVD event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_LVD_VSYS_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_LVD_VSYS_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_LVD_VSYS_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_LVD_VDDIO_OCCURED_MASK (0x200000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_LVD_VDDIO_OCCURED_SHIFT (21U) -/*! FLAG_LVD_VDDIO_OCCURED - This flag register is set 1 when VDD LVD event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_LVD_VDDIO_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_LVD_VDDIO_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_LVD_VDDIO_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT1_RESET_OCCURED_MASK (0x400000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT1_RESET_OCCURED_SHIFT (22U) -/*! FLAG_WDT1_RESET_OCCURED - This flag bit is set as 1 when WatchDog Timer 1 reset is enabled and - * reset event is triggered. This register is cleared 0 by AO domain POR. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT1_RESET_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_WDT1_RESET_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_WDT1_RESET_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT1_RESET_OCCURED_MASK (0x800000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT1_RESET_OCCURED_SHIFT (23U) -/*! FLAG_CWDT1_RESET_OCCURED - This flag bit is set as 1 when Code WatchDog Timer 1 reset is enabled - * and reset event is triggered. This register is cleared 0 by AO domain POR. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT1_RESET_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_CWDT1_RESET_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_CWDT1_RESET_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT1_IRQ_OCCURED_MASK (0x1000000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT1_IRQ_OCCURED_SHIFT (24U) -/*! FLAG_WDT1_IRQ_OCCURED - This flag bit is set as 1 when WatchDog Timer 1 IRQ is enabled and IRQ - * event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT1_IRQ_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_WDT1_IRQ_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_WDT1_IRQ_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT1_IRQ_OCCURED_MASK (0x2000000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT1_IRQ_OCCURED_SHIFT (25U) -/*! FLAG_CWDT1_IRQ_OCCURED - This flag bit is set as 1 when Code WatchDog Timer 1 IRQ is enabled and - * IRQ event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT1_IRQ_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_CWDT1_IRQ_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_CWDT1_IRQ_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_TEMPTAMPER_DET_IRQ_OCCURED_MASK (0x4000000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_TEMPTAMPER_DET_IRQ_OCCURED_SHIFT (26U) -/*! FLAG_TEMPTAMPER_DET_IRQ_OCCURED - This flag bit is set as 1 when temperature temper IRQ is - * enabled and IRQ event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_TEMPTAMPER_DET_IRQ_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_TEMPTAMPER_DET_IRQ_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_TEMPTAMPER_DET_IRQ_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_VOLTAMPER_DET_IRQ_OCCURED_MASK (0x8000000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_VOLTAMPER_DET_IRQ_OCCURED_SHIFT (27U) -/*! FLAG_VOLTAMPER_DET_IRQ_OCCURED - This flag bit is set as 1 when voltage temper IRQ is enabled - * and IRQ event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_VOLTAMPER_DET_IRQ_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_VOLTAMPER_DET_IRQ_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_VOLTAMPER_DET_IRQ_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_LHTTAMPER_DET_IRQ_OCCURED_MASK (0x10000000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_LHTTAMPER_DET_IRQ_OCCURED_SHIFT (28U) -/*! FLAG_LHTTAMPER_DET_IRQ_OCCURED - This flag bit is set as 1 when light temper IRQ is enabled and - * IRQ event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_LHTTAMPER_DET_IRQ_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_LHTTAMPER_DET_IRQ_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_LHTTAMPER_DET_IRQ_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_CLKTAMPER_DET_IRQ_OCCURED_MASK (0x20000000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_CLKTAMPER_DET_IRQ_OCCURED_SHIFT (29U) -/*! FLAG_CLKTAMPER_DET_IRQ_OCCURED - This flag bit is set as 1 when clock temper IRQ is enabled and - * IRQ event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_CLKTAMPER_DET_IRQ_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_CLKTAMPER_DET_IRQ_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_CLKTAMPER_DET_IRQ_OCCURED_MASK) -/*! @} */ - -/*! @name ELS_AS_FLAG1 - ELS AS Flag1 */ -/*! @{ */ - -#define SYSCON_ELS_AS_FLAG1_FLAG_HVD_CORE_OCCURED_MASK (0x20000000U) -#define SYSCON_ELS_AS_FLAG1_FLAG_HVD_CORE_OCCURED_SHIFT (29U) -/*! FLAG_HVD_CORE_OCCURED - This flag bit is set as 1 when HVD from VDD_CORE power domain is triggered. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG1_FLAG_HVD_CORE_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG1_FLAG_HVD_CORE_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG1_FLAG_HVD_CORE_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG1_FLAG_HVD_VSYS_OCCURED_MASK (0x40000000U) -#define SYSCON_ELS_AS_FLAG1_FLAG_HVD_VSYS_OCCURED_SHIFT (30U) -/*! FLAG_HVD_VSYS_OCCURED - This flag bit is set as 1 when HVD from VDD_SYS power domain is triggered - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG1_FLAG_HVD_VSYS_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG1_FLAG_HVD_VSYS_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG1_FLAG_HVD_VSYS_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG1_FLAG_HVD_VDDIO_OCCURED_MASK (0x80000000U) -#define SYSCON_ELS_AS_FLAG1_FLAG_HVD_VDDIO_OCCURED_SHIFT (31U) -/*! FLAG_HVD_VDDIO_OCCURED - This flag bit is set as 1 when HVD from VDD power domain is triggered - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG1_FLAG_HVD_VDDIO_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG1_FLAG_HVD_VDDIO_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG1_FLAG_HVD_VDDIO_OCCURED_MASK) -/*! @} */ - -/*! @name CLOCK_CTRL - Clock Control */ -/*! @{ */ - -#define SYSCON_CLOCK_CTRL_CLKIN_ENA_FM_USBH_LPT_MASK (0x2U) -#define SYSCON_CLOCK_CTRL_CLKIN_ENA_FM_USBH_LPT_SHIFT (1U) -/*! CLKIN_ENA_FM_USBH_LPT - Enables the clk_in clock for the Frequency Measurement, USB HS and LPTMR0/1 modules. - * 0b1..Clock is enabled - * 0b0..Clock is not enabled - */ -#define SYSCON_CLOCK_CTRL_CLKIN_ENA_FM_USBH_LPT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLOCK_CTRL_CLKIN_ENA_FM_USBH_LPT_SHIFT)) & SYSCON_CLOCK_CTRL_CLKIN_ENA_FM_USBH_LPT_MASK) - -#define SYSCON_CLOCK_CTRL_FRO1MHZ_ENA_MASK (0x4U) -#define SYSCON_CLOCK_CTRL_FRO1MHZ_ENA_SHIFT (2U) -/*! FRO1MHZ_ENA - Enables the FRO_1MHz clock for RTC module and for UTICK - * 0b1..Clock is enabled - * 0b0..Clock is not enabled - */ -#define SYSCON_CLOCK_CTRL_FRO1MHZ_ENA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLOCK_CTRL_FRO1MHZ_ENA_SHIFT)) & SYSCON_CLOCK_CTRL_FRO1MHZ_ENA_MASK) - -#define SYSCON_CLOCK_CTRL_FRO12MHZ_ENA_MASK (0x8U) -#define SYSCON_CLOCK_CTRL_FRO12MHZ_ENA_SHIFT (3U) -/*! FRO12MHZ_ENA - Enables the FRO_12MHz clock for the Flash, LPTMR0/1, and Frequency Measurement modules - * 0b1..Clock is enabled - * 0b0..Clock is not enabled - */ -#define SYSCON_CLOCK_CTRL_FRO12MHZ_ENA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLOCK_CTRL_FRO12MHZ_ENA_SHIFT)) & SYSCON_CLOCK_CTRL_FRO12MHZ_ENA_MASK) - -#define SYSCON_CLOCK_CTRL_FRO_HF_ENA_MASK (0x10U) -#define SYSCON_CLOCK_CTRL_FRO_HF_ENA_SHIFT (4U) -/*! FRO_HF_ENA - Enables FRO HF clock for the Frequency Measure module - * 0b1..Clock is enabled - * 0b0..Clock is not enabled - */ -#define SYSCON_CLOCK_CTRL_FRO_HF_ENA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLOCK_CTRL_FRO_HF_ENA_SHIFT)) & SYSCON_CLOCK_CTRL_FRO_HF_ENA_MASK) - -#define SYSCON_CLOCK_CTRL_CLKIN_ENA_MASK (0x20U) -#define SYSCON_CLOCK_CTRL_CLKIN_ENA_SHIFT (5U) -/*! CLKIN_ENA - Enables clk_in clock for MICFIL, CAN0/1, I3C0/1, SAI0/1, clkout. - * 0b1..Clock is enabled - * 0b0..Clock is not enabled - */ -#define SYSCON_CLOCK_CTRL_CLKIN_ENA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLOCK_CTRL_CLKIN_ENA_SHIFT)) & SYSCON_CLOCK_CTRL_CLKIN_ENA_MASK) - -#define SYSCON_CLOCK_CTRL_FRO1MHZ_CLK_ENA_MASK (0x40U) -#define SYSCON_CLOCK_CTRL_FRO1MHZ_CLK_ENA_SHIFT (6U) -/*! FRO1MHZ_CLK_ENA - Enables FRO_1MHz clock for clock muxing in clock gen - * 0b1..Clock is enabled - * 0b0..Clock is not enabled - */ -#define SYSCON_CLOCK_CTRL_FRO1MHZ_CLK_ENA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLOCK_CTRL_FRO1MHZ_CLK_ENA_SHIFT)) & SYSCON_CLOCK_CTRL_FRO1MHZ_CLK_ENA_MASK) -/*! @} */ - -/*! @name I3C1FCLKSEL - I3C1 Functional Clock Selection */ -/*! @{ */ - -#define SYSCON_I3C1FCLKSEL_SEL_MASK (0x7U) -#define SYSCON_I3C1FCLKSEL_SEL_SHIFT (0U) -/*! SEL - I3C1 clock select - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..FRO_HF clock - * 0b100..clk_1m clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_I3C1FCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKSEL_SEL_SHIFT)) & SYSCON_I3C1FCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name I3C1FCLKDIV - I3C1 Functional Clock FCLK Divider */ -/*! @{ */ - -#define SYSCON_I3C1FCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_I3C1FCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_I3C1FCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKDIV_DIV_SHIFT)) & SYSCON_I3C1FCLKDIV_DIV_MASK) - -#define SYSCON_I3C1FCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_I3C1FCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_I3C1FCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKDIV_RESET_SHIFT)) & SYSCON_I3C1FCLKDIV_RESET_MASK) - -#define SYSCON_I3C1FCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_I3C1FCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_I3C1FCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKDIV_HALT_SHIFT)) & SYSCON_I3C1FCLKDIV_HALT_MASK) - -#define SYSCON_I3C1FCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_I3C1FCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_I3C1FCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKDIV_UNSTAB_SHIFT)) & SYSCON_I3C1FCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name GRAY_CODE_LSB - Gray to Binary Converter Gray code_gray[31:0] */ -/*! @{ */ - -#define SYSCON_GRAY_CODE_LSB_code_gray_31_0_MASK (0xFFFFFFFFU) -#define SYSCON_GRAY_CODE_LSB_code_gray_31_0_SHIFT (0U) -/*! code_gray_31_0 - Gray code [31:0] */ -#define SYSCON_GRAY_CODE_LSB_code_gray_31_0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GRAY_CODE_LSB_code_gray_31_0_SHIFT)) & SYSCON_GRAY_CODE_LSB_code_gray_31_0_MASK) -/*! @} */ - -/*! @name GRAY_CODE_MSB - Gray to Binary Converter Gray code_gray[41:32] */ -/*! @{ */ - -#define SYSCON_GRAY_CODE_MSB_code_gray_41_32_MASK (0x3FFU) -#define SYSCON_GRAY_CODE_MSB_code_gray_41_32_SHIFT (0U) -/*! code_gray_41_32 - Gray code [41:32] */ -#define SYSCON_GRAY_CODE_MSB_code_gray_41_32(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GRAY_CODE_MSB_code_gray_41_32_SHIFT)) & SYSCON_GRAY_CODE_MSB_code_gray_41_32_MASK) -/*! @} */ - -/*! @name BINARY_CODE_LSB - Gray to Binary Converter Binary Code [31:0] */ -/*! @{ */ - -#define SYSCON_BINARY_CODE_LSB_code_bin_31_0_MASK (0xFFFFFFFFU) -#define SYSCON_BINARY_CODE_LSB_code_bin_31_0_SHIFT (0U) -/*! code_bin_31_0 - Binary code [31:0] */ -#define SYSCON_BINARY_CODE_LSB_code_bin_31_0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_BINARY_CODE_LSB_code_bin_31_0_SHIFT)) & SYSCON_BINARY_CODE_LSB_code_bin_31_0_MASK) -/*! @} */ - -/*! @name BINARY_CODE_MSB - Gray to Binary Converter Binary Code [41:32] */ -/*! @{ */ - -#define SYSCON_BINARY_CODE_MSB_code_bin_41_32_MASK (0x3FFU) -#define SYSCON_BINARY_CODE_MSB_code_bin_41_32_SHIFT (0U) -/*! code_bin_41_32 - Binary code [41:32] */ -#define SYSCON_BINARY_CODE_MSB_code_bin_41_32(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_BINARY_CODE_MSB_code_bin_41_32_SHIFT)) & SYSCON_BINARY_CODE_MSB_code_bin_41_32_MASK) -/*! @} */ - -/*! @name AUTOCLKGATEOVERRIDE - Control Automatic Clock Gating */ -/*! @{ */ - -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMB_CTRL_MASK (0x4U) -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMB_CTRL_SHIFT (2U) -/*! RAMB_CTRL - Controls automatic clock gating for the RAMB Controller - * 0b1..Automatic clock gating is overridden (Automatic clock gating is disabled). - * 0b0..Automatic clock gating is not overridden - */ -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMB_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AUTOCLKGATEOVERRIDE_RAMB_CTRL_SHIFT)) & SYSCON_AUTOCLKGATEOVERRIDE_RAMB_CTRL_MASK) - -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMC_CTRL_MASK (0x8U) -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMC_CTRL_SHIFT (3U) -/*! RAMC_CTRL - Controls automatic clock gating for the RAMC Controller - * 0b1..Automatic clock gating is overridden (Automatic clock gating is disabled). - * 0b0..Automatic clock gating is not overridden - */ -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMC_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AUTOCLKGATEOVERRIDE_RAMC_CTRL_SHIFT)) & SYSCON_AUTOCLKGATEOVERRIDE_RAMC_CTRL_MASK) - -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMD_CTRL_MASK (0x10U) -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMD_CTRL_SHIFT (4U) -/*! RAMD_CTRL - Controls automatic clock gating for the RAMD Controller - * 0b1..Automatic clock gating is overridden (Automatic clock gating is disabled). - * 0b0..Automatic clock gating is not overridden - */ -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMD_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AUTOCLKGATEOVERRIDE_RAMD_CTRL_SHIFT)) & SYSCON_AUTOCLKGATEOVERRIDE_RAMD_CTRL_MASK) - -#define SYSCON_AUTOCLKGATEOVERRIDE_RAME_CTRL_MASK (0x20U) -#define SYSCON_AUTOCLKGATEOVERRIDE_RAME_CTRL_SHIFT (5U) -/*! RAME_CTRL - Controls automatic clock gating for the RAMD Controller. - * 0b1..Automatic clock gating is overridden (Automatic clock gating is disabled). - * 0b0..Automatic clock gating is not overridden - */ -#define SYSCON_AUTOCLKGATEOVERRIDE_RAME_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AUTOCLKGATEOVERRIDE_RAME_CTRL_SHIFT)) & SYSCON_AUTOCLKGATEOVERRIDE_RAME_CTRL_MASK) -/*! @} */ - -/*! @name AUTOCLKGATEOVERRIDEC - Control Automatic Clock Gating C */ -/*! @{ */ - -#define SYSCON_AUTOCLKGATEOVERRIDEC_RAMX_MASK (0x40000000U) -#define SYSCON_AUTOCLKGATEOVERRIDEC_RAMX_SHIFT (30U) -/*! RAMX - Controls automatic clock gating of the RAMX controller - * 0b1..Automatic clock gating is overridden (Automatic clock gating is disabled). - * 0b0..Automatic clock gating is not overridden - */ -#define SYSCON_AUTOCLKGATEOVERRIDEC_RAMX(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AUTOCLKGATEOVERRIDEC_RAMX_SHIFT)) & SYSCON_AUTOCLKGATEOVERRIDEC_RAMX_MASK) - -#define SYSCON_AUTOCLKGATEOVERRIDEC_RAMA_MASK (0x80000000U) -#define SYSCON_AUTOCLKGATEOVERRIDEC_RAMA_SHIFT (31U) -/*! RAMA - Controls automatic clock gating of the RAMA controller - * 0b1..Automatic clock gating is overridden (Automatic clock gating is disabled). - * 0b0..Automatic clock gating is not overridden - */ -#define SYSCON_AUTOCLKGATEOVERRIDEC_RAMA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AUTOCLKGATEOVERRIDEC_RAMA_SHIFT)) & SYSCON_AUTOCLKGATEOVERRIDEC_RAMA_MASK) -/*! @} */ - -/*! @name PWM0SUBCTL - PWM0 Submodule Control */ -/*! @{ */ - -#define SYSCON_PWM0SUBCTL_CLK0_EN_MASK (0x1U) -#define SYSCON_PWM0SUBCTL_CLK0_EN_SHIFT (0U) -/*! CLK0_EN - Enables PWM0 SUB Clock0 */ -#define SYSCON_PWM0SUBCTL_CLK0_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_CLK0_EN_SHIFT)) & SYSCON_PWM0SUBCTL_CLK0_EN_MASK) - -#define SYSCON_PWM0SUBCTL_CLK1_EN_MASK (0x2U) -#define SYSCON_PWM0SUBCTL_CLK1_EN_SHIFT (1U) -/*! CLK1_EN - Enables PWM0 SUB Clock1 */ -#define SYSCON_PWM0SUBCTL_CLK1_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_CLK1_EN_SHIFT)) & SYSCON_PWM0SUBCTL_CLK1_EN_MASK) - -#define SYSCON_PWM0SUBCTL_CLK2_EN_MASK (0x4U) -#define SYSCON_PWM0SUBCTL_CLK2_EN_SHIFT (2U) -/*! CLK2_EN - Enables PWM0 SUB Clock2 */ -#define SYSCON_PWM0SUBCTL_CLK2_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_CLK2_EN_SHIFT)) & SYSCON_PWM0SUBCTL_CLK2_EN_MASK) - -#define SYSCON_PWM0SUBCTL_CLK3_EN_MASK (0x8U) -#define SYSCON_PWM0SUBCTL_CLK3_EN_SHIFT (3U) -/*! CLK3_EN - Enables PWM0 SUB Clock3 */ -#define SYSCON_PWM0SUBCTL_CLK3_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_CLK3_EN_SHIFT)) & SYSCON_PWM0SUBCTL_CLK3_EN_MASK) - -#define SYSCON_PWM0SUBCTL_DMAVALM0_MASK (0x1000U) -#define SYSCON_PWM0SUBCTL_DMAVALM0_SHIFT (12U) -/*! DMAVALM0 - PWM0 submodule 0 DMA compare value done mask */ -#define SYSCON_PWM0SUBCTL_DMAVALM0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_DMAVALM0_SHIFT)) & SYSCON_PWM0SUBCTL_DMAVALM0_MASK) - -#define SYSCON_PWM0SUBCTL_DMAVALM1_MASK (0x2000U) -#define SYSCON_PWM0SUBCTL_DMAVALM1_SHIFT (13U) -/*! DMAVALM1 - PWM0 submodule 1 DMA compare value done mask */ -#define SYSCON_PWM0SUBCTL_DMAVALM1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_DMAVALM1_SHIFT)) & SYSCON_PWM0SUBCTL_DMAVALM1_MASK) - -#define SYSCON_PWM0SUBCTL_DMAVALM2_MASK (0x4000U) -#define SYSCON_PWM0SUBCTL_DMAVALM2_SHIFT (14U) -/*! DMAVALM2 - PWM0 submodule 2 DMA compare value done mask */ -#define SYSCON_PWM0SUBCTL_DMAVALM2(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_DMAVALM2_SHIFT)) & SYSCON_PWM0SUBCTL_DMAVALM2_MASK) - -#define SYSCON_PWM0SUBCTL_DMAVALM3_MASK (0x8000U) -#define SYSCON_PWM0SUBCTL_DMAVALM3_SHIFT (15U) -/*! DMAVALM3 - PWM0 submodule 3 DMA compare value done mask */ -#define SYSCON_PWM0SUBCTL_DMAVALM3(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_DMAVALM3_SHIFT)) & SYSCON_PWM0SUBCTL_DMAVALM3_MASK) -/*! @} */ - -/*! @name PWM1SUBCTL - PWM1 Submodule Control */ -/*! @{ */ - -#define SYSCON_PWM1SUBCTL_CLK0_EN_MASK (0x1U) -#define SYSCON_PWM1SUBCTL_CLK0_EN_SHIFT (0U) -/*! CLK0_EN - Enables PWM1 SUB Clock0 */ -#define SYSCON_PWM1SUBCTL_CLK0_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM1SUBCTL_CLK0_EN_SHIFT)) & SYSCON_PWM1SUBCTL_CLK0_EN_MASK) - -#define SYSCON_PWM1SUBCTL_CLK1_EN_MASK (0x2U) -#define SYSCON_PWM1SUBCTL_CLK1_EN_SHIFT (1U) -/*! CLK1_EN - Enables PWM1 SUB Clock1 */ -#define SYSCON_PWM1SUBCTL_CLK1_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM1SUBCTL_CLK1_EN_SHIFT)) & SYSCON_PWM1SUBCTL_CLK1_EN_MASK) - -#define SYSCON_PWM1SUBCTL_CLK2_EN_MASK (0x4U) -#define SYSCON_PWM1SUBCTL_CLK2_EN_SHIFT (2U) -/*! CLK2_EN - Enables PWM1 SUB Clock2 */ -#define SYSCON_PWM1SUBCTL_CLK2_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM1SUBCTL_CLK2_EN_SHIFT)) & SYSCON_PWM1SUBCTL_CLK2_EN_MASK) - -#define SYSCON_PWM1SUBCTL_CLK3_EN_MASK (0x8U) -#define SYSCON_PWM1SUBCTL_CLK3_EN_SHIFT (3U) -/*! CLK3_EN - Enables PWM1 SUB Clock3 */ -#define SYSCON_PWM1SUBCTL_CLK3_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM1SUBCTL_CLK3_EN_SHIFT)) & SYSCON_PWM1SUBCTL_CLK3_EN_MASK) - -#define SYSCON_PWM1SUBCTL_DMAVALM0_MASK (0x1000U) -#define SYSCON_PWM1SUBCTL_DMAVALM0_SHIFT (12U) -/*! DMAVALM0 - PWM1 submodule 0 DMA compare value done mask */ -#define SYSCON_PWM1SUBCTL_DMAVALM0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM1SUBCTL_DMAVALM0_SHIFT)) & SYSCON_PWM1SUBCTL_DMAVALM0_MASK) - -#define SYSCON_PWM1SUBCTL_DMAVALM1_MASK (0x2000U) -#define SYSCON_PWM1SUBCTL_DMAVALM1_SHIFT (13U) -/*! DMAVALM1 - PWM1 submodule 1 DMA compare value done mask */ -#define SYSCON_PWM1SUBCTL_DMAVALM1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM1SUBCTL_DMAVALM1_SHIFT)) & SYSCON_PWM1SUBCTL_DMAVALM1_MASK) - -#define SYSCON_PWM1SUBCTL_DMAVALM2_MASK (0x4000U) -#define SYSCON_PWM1SUBCTL_DMAVALM2_SHIFT (14U) -/*! DMAVALM2 - PWM1 submodule 2 DMA compare value done mask */ -#define SYSCON_PWM1SUBCTL_DMAVALM2(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM1SUBCTL_DMAVALM2_SHIFT)) & SYSCON_PWM1SUBCTL_DMAVALM2_MASK) - -#define SYSCON_PWM1SUBCTL_DMAVALM3_MASK (0x8000U) -#define SYSCON_PWM1SUBCTL_DMAVALM3_SHIFT (15U) -/*! DMAVALM3 - PWM1 submodule 3 DMA compare value done mask */ -#define SYSCON_PWM1SUBCTL_DMAVALM3(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM1SUBCTL_DMAVALM3_SHIFT)) & SYSCON_PWM1SUBCTL_DMAVALM3_MASK) -/*! @} */ - -/*! @name CTIMERGLOBALSTARTEN - CTIMER Global Start Enable */ -/*! @{ */ - -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER0_CLK_EN_MASK (0x1U) -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER0_CLK_EN_SHIFT (0U) -/*! CTIMER0_CLK_EN - Enables the CTIMER0 function clock - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER0_CLK_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERGLOBALSTARTEN_CTIMER0_CLK_EN_SHIFT)) & SYSCON_CTIMERGLOBALSTARTEN_CTIMER0_CLK_EN_MASK) - -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER1_CLK_EN_MASK (0x2U) -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER1_CLK_EN_SHIFT (1U) -/*! CTIMER1_CLK_EN - Enables the CTIMER1 function clock - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER1_CLK_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERGLOBALSTARTEN_CTIMER1_CLK_EN_SHIFT)) & SYSCON_CTIMERGLOBALSTARTEN_CTIMER1_CLK_EN_MASK) - -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER2_CLK_EN_MASK (0x4U) -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER2_CLK_EN_SHIFT (2U) -/*! CTIMER2_CLK_EN - Enables the CTIMER2 function clock - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER2_CLK_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERGLOBALSTARTEN_CTIMER2_CLK_EN_SHIFT)) & SYSCON_CTIMERGLOBALSTARTEN_CTIMER2_CLK_EN_MASK) - -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER3_CLK_EN_MASK (0x8U) -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER3_CLK_EN_SHIFT (3U) -/*! CTIMER3_CLK_EN - Enables the CTIMER3 function clock - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER3_CLK_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERGLOBALSTARTEN_CTIMER3_CLK_EN_SHIFT)) & SYSCON_CTIMERGLOBALSTARTEN_CTIMER3_CLK_EN_MASK) - -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER4_CLK_EN_MASK (0x10U) -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER4_CLK_EN_SHIFT (4U) -/*! CTIMER4_CLK_EN - Enables the CTIMER4 function clock - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER4_CLK_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERGLOBALSTARTEN_CTIMER4_CLK_EN_SHIFT)) & SYSCON_CTIMERGLOBALSTARTEN_CTIMER4_CLK_EN_MASK) -/*! @} */ - -/*! @name ECC_ENABLE_CTRL - RAM ECC Enable Control */ -/*! @{ */ - -#define SYSCON_ECC_ENABLE_CTRL_RAMA_ECC_ENABLE_MASK (0x1U) -#define SYSCON_ECC_ENABLE_CTRL_RAMA_ECC_ENABLE_SHIFT (0U) -/*! RAMA_ECC_ENABLE - RAMA ECC enable - * 0b1..ECC is enabled - * 0b0..ECC is disabled - */ -#define SYSCON_ECC_ENABLE_CTRL_RAMA_ECC_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ECC_ENABLE_CTRL_RAMA_ECC_ENABLE_SHIFT)) & SYSCON_ECC_ENABLE_CTRL_RAMA_ECC_ENABLE_MASK) - -#define SYSCON_ECC_ENABLE_CTRL_RAMB_RAMX_ECC_ENABLE_MASK (0x2U) -#define SYSCON_ECC_ENABLE_CTRL_RAMB_RAMX_ECC_ENABLE_SHIFT (1U) -/*! RAMB_RAMX_ECC_ENABLE - RAMB and RAMX ECC enable - * 0b1..ECC is enabled - * 0b0..ECC is disabled - */ -#define SYSCON_ECC_ENABLE_CTRL_RAMB_RAMX_ECC_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ECC_ENABLE_CTRL_RAMB_RAMX_ECC_ENABLE_SHIFT)) & SYSCON_ECC_ENABLE_CTRL_RAMB_RAMX_ECC_ENABLE_MASK) - -#define SYSCON_ECC_ENABLE_CTRL_RAMD_RAMC_ECC_ENABLE_MASK (0x4U) -#define SYSCON_ECC_ENABLE_CTRL_RAMD_RAMC_ECC_ENABLE_SHIFT (2U) -/*! RAMD_RAMC_ECC_ENABLE - RAMD and RAMC ECC enable - * 0b1..ECC is enabled - * 0b0..ECC is disabled - */ -#define SYSCON_ECC_ENABLE_CTRL_RAMD_RAMC_ECC_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ECC_ENABLE_CTRL_RAMD_RAMC_ECC_ENABLE_SHIFT)) & SYSCON_ECC_ENABLE_CTRL_RAMD_RAMC_ECC_ENABLE_MASK) -/*! @} */ - -/*! @name DEBUG_LOCK_EN - Control Write Access to Security */ -/*! @{ */ - -#define SYSCON_DEBUG_LOCK_EN_LOCK_ALL_MASK (0xFU) -#define SYSCON_DEBUG_LOCK_EN_LOCK_ALL_SHIFT (0U) -/*! LOCK_ALL - Controls write access to the security registers - * 0b1010..Enables write access to all registers - * 0b0000..Any other value than b1010: disables write access to all registers - */ -#define SYSCON_DEBUG_LOCK_EN_LOCK_ALL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_LOCK_EN_LOCK_ALL_SHIFT)) & SYSCON_DEBUG_LOCK_EN_LOCK_ALL_MASK) -/*! @} */ - -/*! @name DEBUG_FEATURES - Cortex Debug Features Control */ -/*! @{ */ - -#define SYSCON_DEBUG_FEATURES_CPU0_DBGEN_MASK (0x3U) -#define SYSCON_DEBUG_FEATURES_CPU0_DBGEN_SHIFT (0U) -/*! CPU0_DBGEN - CPU0 invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_CPU0_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_CPU0_DBGEN_SHIFT)) & SYSCON_DEBUG_FEATURES_CPU0_DBGEN_MASK) - -#define SYSCON_DEBUG_FEATURES_CPU0_NIDEN_MASK (0xCU) -#define SYSCON_DEBUG_FEATURES_CPU0_NIDEN_SHIFT (2U) -/*! CPU0_NIDEN - CPU0 non-invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_CPU0_NIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_CPU0_NIDEN_SHIFT)) & SYSCON_DEBUG_FEATURES_CPU0_NIDEN_MASK) - -#define SYSCON_DEBUG_FEATURES_CPU0_SPIDEN_MASK (0x30U) -#define SYSCON_DEBUG_FEATURES_CPU0_SPIDEN_SHIFT (4U) -/*! CPU0_SPIDEN - CPU0 secure privileged invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_CPU0_SPIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_CPU0_SPIDEN_SHIFT)) & SYSCON_DEBUG_FEATURES_CPU0_SPIDEN_MASK) - -#define SYSCON_DEBUG_FEATURES_CPU0_SPNIDEN_MASK (0xC0U) -#define SYSCON_DEBUG_FEATURES_CPU0_SPNIDEN_SHIFT (6U) -/*! CPU0_SPNIDEN - CPU0 secure privileged non-invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_CPU0_SPNIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_CPU0_SPNIDEN_SHIFT)) & SYSCON_DEBUG_FEATURES_CPU0_SPNIDEN_MASK) -/*! @} */ - -/*! @name DEBUG_FEATURES_DP - Cortex Debug Features Control (Duplicate) */ -/*! @{ */ - -#define SYSCON_DEBUG_FEATURES_DP_CPU0_DBGEN_MASK (0x3U) -#define SYSCON_DEBUG_FEATURES_DP_CPU0_DBGEN_SHIFT (0U) -/*! CPU0_DBGEN - CPU0 invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_DP_CPU0_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_DP_CPU0_DBGEN_SHIFT)) & SYSCON_DEBUG_FEATURES_DP_CPU0_DBGEN_MASK) - -#define SYSCON_DEBUG_FEATURES_DP_CPU0_NIDEN_MASK (0xCU) -#define SYSCON_DEBUG_FEATURES_DP_CPU0_NIDEN_SHIFT (2U) -/*! CPU0_NIDEN - CPU0 non-invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_DP_CPU0_NIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_DP_CPU0_NIDEN_SHIFT)) & SYSCON_DEBUG_FEATURES_DP_CPU0_NIDEN_MASK) - -#define SYSCON_DEBUG_FEATURES_DP_CPU0_SPIDEN_MASK (0x30U) -#define SYSCON_DEBUG_FEATURES_DP_CPU0_SPIDEN_SHIFT (4U) -/*! CPU0_SPIDEN - CPU0 secure privileged invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_DP_CPU0_SPIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_DP_CPU0_SPIDEN_SHIFT)) & SYSCON_DEBUG_FEATURES_DP_CPU0_SPIDEN_MASK) - -#define SYSCON_DEBUG_FEATURES_DP_CPU0_SPNIDEN_MASK (0xC0U) -#define SYSCON_DEBUG_FEATURES_DP_CPU0_SPNIDEN_SHIFT (6U) -/*! CPU0_SPNIDEN - CPU0 secure privileged non-invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_DP_CPU0_SPNIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_DP_CPU0_SPNIDEN_SHIFT)) & SYSCON_DEBUG_FEATURES_DP_CPU0_SPNIDEN_MASK) -/*! @} */ - -/*! @name SWD_ACCESS_CPU - CPU0 Software Debug Access */ -/*! @{ */ - -#define SYSCON_SWD_ACCESS_CPU_SEC_CODE_MASK (0xFFFFFFFFU) -#define SYSCON_SWD_ACCESS_CPU_SEC_CODE_SHIFT (0U) -/*! SEC_CODE - CPU0 SWD-AP: 0x12345678 - * 0b00010010001101000101011001111000..Value to write to enable CPU0 SWD access. Reading back register is read as 0xA. - * 0b00000000000000000000000000000000..CPU0 DAP is not allowed. Reading back register is read as 0x5. - */ -#define SYSCON_SWD_ACCESS_CPU_SEC_CODE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SWD_ACCESS_CPU_SEC_CODE_SHIFT)) & SYSCON_SWD_ACCESS_CPU_SEC_CODE_MASK) -/*! @} */ - -/* The count of SYSCON_SWD_ACCESS_CPU */ -#define SYSCON_SWD_ACCESS_CPU_COUNT (1U) - -/*! @name DEBUG_AUTH_BEACON - Debug Authentication BEACON */ -/*! @{ */ - -#define SYSCON_DEBUG_AUTH_BEACON_BEACON_MASK (0xFFFFFFFFU) -#define SYSCON_DEBUG_AUTH_BEACON_BEACON_SHIFT (0U) -/*! BEACON - Sets by the debug authentication code in ROM to pass the debug beacons (Credential - * Beacon and Authentication Beacon) to the application code. - */ -#define SYSCON_DEBUG_AUTH_BEACON_BEACON(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_AUTH_BEACON_BEACON_SHIFT)) & SYSCON_DEBUG_AUTH_BEACON_BEACON_MASK) -/*! @} */ - -/*! @name JTAG_ID - JTAG Chip ID */ -/*! @{ */ - -#define SYSCON_JTAG_ID_JTAG_ID_MASK (0xFFFFFFFFU) -#define SYSCON_JTAG_ID_JTAG_ID_SHIFT (0U) -/*! JTAG_ID - Indicates the device ID */ -#define SYSCON_JTAG_ID_JTAG_ID(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_JTAG_ID_JTAG_ID_SHIFT)) & SYSCON_JTAG_ID_JTAG_ID_MASK) -/*! @} */ - -/*! @name DEVICE_TYPE - Device Type */ -/*! @{ */ - -#define SYSCON_DEVICE_TYPE_DEVICE_TYPE_MASK (0xFFFFFFFFU) -#define SYSCON_DEVICE_TYPE_DEVICE_TYPE_SHIFT (0U) -/*! DEVICE_TYPE - Indicates DEVICE TYPE. */ -#define SYSCON_DEVICE_TYPE_DEVICE_TYPE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEVICE_TYPE_DEVICE_TYPE_SHIFT)) & SYSCON_DEVICE_TYPE_DEVICE_TYPE_MASK) -/*! @} */ - -/*! @name DEVICE_ID0 - Device ID */ -/*! @{ */ - -#define SYSCON_DEVICE_ID0_ROM_REV_MINOR_MASK (0xF00000U) -#define SYSCON_DEVICE_ID0_ROM_REV_MINOR_SHIFT (20U) -/*! ROM_REV_MINOR - ROM revision. */ -#define SYSCON_DEVICE_ID0_ROM_REV_MINOR(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEVICE_ID0_ROM_REV_MINOR_SHIFT)) & SYSCON_DEVICE_ID0_ROM_REV_MINOR_MASK) -/*! @} */ - -/*! @name DIEID - Chip Revision ID and Number */ -/*! @{ */ - -#define SYSCON_DIEID_MINOR_REVISION_MASK (0xFU) -#define SYSCON_DIEID_MINOR_REVISION_SHIFT (0U) -/*! MINOR_REVISION - Chip minor revision */ -#define SYSCON_DIEID_MINOR_REVISION(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DIEID_MINOR_REVISION_SHIFT)) & SYSCON_DIEID_MINOR_REVISION_MASK) - -#define SYSCON_DIEID_MAJOR_REVISION_MASK (0xF0U) -#define SYSCON_DIEID_MAJOR_REVISION_SHIFT (4U) -/*! MAJOR_REVISION - Chip major revision */ -#define SYSCON_DIEID_MAJOR_REVISION(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DIEID_MAJOR_REVISION_SHIFT)) & SYSCON_DIEID_MAJOR_REVISION_MASK) - -#define SYSCON_DIEID_MCO_NUM_IN_DIE_ID_MASK (0xFFFFF00U) -#define SYSCON_DIEID_MCO_NUM_IN_DIE_ID_SHIFT (8U) -/*! MCO_NUM_IN_DIE_ID - Chip number */ -#define SYSCON_DIEID_MCO_NUM_IN_DIE_ID(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DIEID_MCO_NUM_IN_DIE_ID_SHIFT)) & SYSCON_DIEID_MCO_NUM_IN_DIE_ID_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group SYSCON_Register_Masks */ - - -/* SYSCON - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral SYSCON0 base address */ - #define SYSCON0_BASE (0x50000000u) - /** Peripheral SYSCON0 base address */ - #define SYSCON0_BASE_NS (0x40000000u) - /** Peripheral SYSCON0 base pointer */ - #define SYSCON0 ((SYSCON_Type *)SYSCON0_BASE) - /** Peripheral SYSCON0 base pointer */ - #define SYSCON0_NS ((SYSCON_Type *)SYSCON0_BASE_NS) - /** Array initializer of SYSCON peripheral base addresses */ - #define SYSCON_BASE_ADDRS { SYSCON0_BASE } - /** Array initializer of SYSCON peripheral base pointers */ - #define SYSCON_BASE_PTRS { SYSCON0 } - /** Array initializer of SYSCON peripheral base addresses */ - #define SYSCON_BASE_ADDRS_NS { SYSCON0_BASE_NS } - /** Array initializer of SYSCON peripheral base pointers */ - #define SYSCON_BASE_PTRS_NS { SYSCON0_NS } -#else - /** Peripheral SYSCON0 base address */ - #define SYSCON0_BASE (0x40000000u) - /** Peripheral SYSCON0 base pointer */ - #define SYSCON0 ((SYSCON_Type *)SYSCON0_BASE) - /** Array initializer of SYSCON peripheral base addresses */ - #define SYSCON_BASE_ADDRS { SYSCON0_BASE } - /** Array initializer of SYSCON peripheral base pointers */ - #define SYSCON_BASE_PTRS { SYSCON0 } -#endif -/* Backward compatibility */ -#define SYSCON SYSCON0 - - -/*! - * @} - */ /* end of group SYSCON_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- SYSPM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SYSPM_Peripheral_Access_Layer SYSPM Peripheral Access Layer - * @{ - */ - -/** SYSPM - Register Layout Typedef */ -typedef struct { - struct { /* offset: 0x0, array step: 0x30 */ - __IO uint32_t PMCR; /**< Performance Monitor Control, array offset: 0x0, array step: 0x30 */ - uint8_t RESERVED_0[20]; - struct { /* offset: 0x18, array step: index*0x30, index2*0x8 */ - __I uint8_t HI; /**< Performance Monitor Event Counter, array offset: 0x18, array step: index*0x30, index2*0x8 */ - uint8_t RESERVED_0[3]; - __I uint32_t LO; /**< Performance Monitor Event Counter, array offset: 0x1C, array step: index*0x30, index2*0x8 */ - } PMECTR[3]; - } PMCR[1]; -} SYSPM_Type; - -/* ---------------------------------------------------------------------------- - -- SYSPM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SYSPM_Register_Masks SYSPM Register Masks - * @{ - */ - -/*! @name PMCR - Performance Monitor Control */ -/*! @{ */ - -#define SYSPM_PMCR_MENB_MASK (0x1U) -#define SYSPM_PMCR_MENB_SHIFT (0U) -/*! MENB - Module Is Enabled - * 0b0..Disabled - * 0b1..Enabled - */ -#define SYSPM_PMCR_MENB(x) (((uint32_t)(((uint32_t)(x)) << SYSPM_PMCR_MENB_SHIFT)) & SYSPM_PMCR_MENB_MASK) - -#define SYSPM_PMCR_SSC_MASK (0xEU) -#define SYSPM_PMCR_SSC_SHIFT (1U) -/*! SSC - Start and Stop Control - * 0b000..Idle or no-op - * 0b001..Local stop - * 0b010, 0b011..Local start - * 0b100.. - * 0b101.. - * 0b110, 0b111.. - */ -#define SYSPM_PMCR_SSC(x) (((uint32_t)(((uint32_t)(x)) << SYSPM_PMCR_SSC_SHIFT)) & SYSPM_PMCR_SSC_MASK) - -#define SYSPM_PMCR_CMODE_MASK (0x30U) -#define SYSPM_PMCR_CMODE_SHIFT (4U) -/*! CMODE - Count Mode - * 0b00..Counted in both User and Privileged modes - * 0b01.. - * 0b10..Counted only in User mode - * 0b11..Counted only in Privileged mode - */ -#define SYSPM_PMCR_CMODE(x) (((uint32_t)(((uint32_t)(x)) << SYSPM_PMCR_CMODE_SHIFT)) & SYSPM_PMCR_CMODE_MASK) - -#define SYSPM_PMCR_RECTR1_MASK (0x100U) -#define SYSPM_PMCR_RECTR1_SHIFT (8U) -/*! RECTR1 - Reset Event Counter 1 - * 0b0..Run normally - * 0b1..Reset - */ -#define SYSPM_PMCR_RECTR1(x) (((uint32_t)(((uint32_t)(x)) << SYSPM_PMCR_RECTR1_SHIFT)) & SYSPM_PMCR_RECTR1_MASK) - -#define SYSPM_PMCR_RECTR2_MASK (0x200U) -#define SYSPM_PMCR_RECTR2_SHIFT (9U) -/*! RECTR2 - Reset Event Counter 2 - * 0b0..Run normally - * 0b1..Reset - */ -#define SYSPM_PMCR_RECTR2(x) (((uint32_t)(((uint32_t)(x)) << SYSPM_PMCR_RECTR2_SHIFT)) & SYSPM_PMCR_RECTR2_MASK) - -#define SYSPM_PMCR_RECTR3_MASK (0x400U) -#define SYSPM_PMCR_RECTR3_SHIFT (10U) -/*! RECTR3 - Reset Event Counter 3 - * 0b0..Run normally - * 0b1..Reset - */ -#define SYSPM_PMCR_RECTR3(x) (((uint32_t)(((uint32_t)(x)) << SYSPM_PMCR_RECTR3_SHIFT)) & SYSPM_PMCR_RECTR3_MASK) - -#define SYSPM_PMCR_SELEVT1_MASK (0x3F800U) -#define SYSPM_PMCR_SELEVT1_SHIFT (11U) -/*! SELEVT1 - Select Event 1 */ -#define SYSPM_PMCR_SELEVT1(x) (((uint32_t)(((uint32_t)(x)) << SYSPM_PMCR_SELEVT1_SHIFT)) & SYSPM_PMCR_SELEVT1_MASK) - -#define SYSPM_PMCR_SELEVT2_MASK (0x1FC0000U) -#define SYSPM_PMCR_SELEVT2_SHIFT (18U) -/*! SELEVT2 - Select Event 2 */ -#define SYSPM_PMCR_SELEVT2(x) (((uint32_t)(((uint32_t)(x)) << SYSPM_PMCR_SELEVT2_SHIFT)) & SYSPM_PMCR_SELEVT2_MASK) - -#define SYSPM_PMCR_SELEVT3_MASK (0xFE000000U) -#define SYSPM_PMCR_SELEVT3_SHIFT (25U) -/*! SELEVT3 - Select Event 3 */ -#define SYSPM_PMCR_SELEVT3(x) (((uint32_t)(((uint32_t)(x)) << SYSPM_PMCR_SELEVT3_SHIFT)) & SYSPM_PMCR_SELEVT3_MASK) -/*! @} */ - -/* The count of SYSPM_PMCR */ -#define SYSPM_PMCR_COUNT (1U) - -/*! @name PMCR_PMECTR_HI - Performance Monitor Event Counter */ -/*! @{ */ - -#define SYSPM_PMCR_PMECTR_HI_ECTR_MASK (0xFFU) -#define SYSPM_PMCR_PMECTR_HI_ECTR_SHIFT (0U) -/*! ECTR - Event Counter */ -#define SYSPM_PMCR_PMECTR_HI_ECTR(x) (((uint8_t)(((uint8_t)(x)) << SYSPM_PMCR_PMECTR_HI_ECTR_SHIFT)) & SYSPM_PMCR_PMECTR_HI_ECTR_MASK) -/*! @} */ - -/* The count of SYSPM_PMCR_PMECTR_HI */ -#define SYSPM_PMCR_PMECTR_HI_COUNT (1U) - -/* The count of SYSPM_PMCR_PMECTR_HI */ -#define SYSPM_PMCR_PMECTR_HI_COUNT2 (3U) - -/*! @name PMCR_PMECTR_LO - Performance Monitor Event Counter */ -/*! @{ */ - -#define SYSPM_PMCR_PMECTR_LO_ECTR_MASK (0xFFFFFFFFU) -#define SYSPM_PMCR_PMECTR_LO_ECTR_SHIFT (0U) -/*! ECTR - Event Counter */ -#define SYSPM_PMCR_PMECTR_LO_ECTR(x) (((uint32_t)(((uint32_t)(x)) << SYSPM_PMCR_PMECTR_LO_ECTR_SHIFT)) & SYSPM_PMCR_PMECTR_LO_ECTR_MASK) -/*! @} */ - -/* The count of SYSPM_PMCR_PMECTR_LO */ -#define SYSPM_PMCR_PMECTR_LO_COUNT (1U) - -/* The count of SYSPM_PMCR_PMECTR_LO */ -#define SYSPM_PMCR_PMECTR_LO_COUNT2 (3U) - - -/*! - * @} - */ /* end of group SYSPM_Register_Masks */ - - -/* SYSPM - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral CMX_PERFMON0 base address */ - #define CMX_PERFMON0_BASE (0x500C1000u) - /** Peripheral CMX_PERFMON0 base address */ - #define CMX_PERFMON0_BASE_NS (0x400C1000u) - /** Peripheral CMX_PERFMON0 base pointer */ - #define CMX_PERFMON0 ((SYSPM_Type *)CMX_PERFMON0_BASE) - /** Peripheral CMX_PERFMON0 base pointer */ - #define CMX_PERFMON0_NS ((SYSPM_Type *)CMX_PERFMON0_BASE_NS) - /** Array initializer of SYSPM peripheral base addresses */ - #define SYSPM_BASE_ADDRS { CMX_PERFMON0_BASE } - /** Array initializer of SYSPM peripheral base pointers */ - #define SYSPM_BASE_PTRS { CMX_PERFMON0 } - /** Array initializer of SYSPM peripheral base addresses */ - #define SYSPM_BASE_ADDRS_NS { CMX_PERFMON0_BASE_NS } - /** Array initializer of SYSPM peripheral base pointers */ - #define SYSPM_BASE_PTRS_NS { CMX_PERFMON0_NS } -#else - /** Peripheral CMX_PERFMON0 base address */ - #define CMX_PERFMON0_BASE (0x400C1000u) - /** Peripheral CMX_PERFMON0 base pointer */ - #define CMX_PERFMON0 ((SYSPM_Type *)CMX_PERFMON0_BASE) - /** Array initializer of SYSPM peripheral base addresses */ - #define SYSPM_BASE_ADDRS { CMX_PERFMON0_BASE } - /** Array initializer of SYSPM peripheral base pointers */ - #define SYSPM_BASE_PTRS { CMX_PERFMON0 } -#endif - -/*! - * @} - */ /* end of group SYSPM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- TRDC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup TRDC_Peripheral_Access_Layer TRDC Peripheral Access Layer - * @{ - */ - -/** TRDC - Register Layout Typedef */ -typedef struct { - struct { /* offset: 0x0, array step: 0x1CC */ - __IO uint32_t MBC_MEM_GLBCFG[4]; /**< MBC Global Configuration Register, array offset: 0x0, array step: index*0x1CC, index2*0x4 */ - __IO uint32_t MBC_NSE_BLK_INDEX; /**< MBC NonSecure Enable Block Index, array offset: 0x10, array step: 0x1CC */ - __O uint32_t MBC_NSE_BLK_SET; /**< MBC NonSecure Enable Block Set, array offset: 0x14, array step: 0x1CC */ - __O uint32_t MBC_NSE_BLK_CLR; /**< MBC NonSecure Enable Block Clear, array offset: 0x18, array step: 0x1CC */ - __O uint32_t MBC_NSE_BLK_CLR_ALL; /**< MBC NonSecure Enable Block Clear All, array offset: 0x1C, array step: 0x1CC */ - __IO uint32_t MBC_MEMN_GLBAC[8]; /**< MBC Global Access Control, array offset: 0x20, array step: index*0x1CC, index2*0x4 */ - __IO uint32_t MBC_DOM0_MEM0_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x40, array step: index*0x1CC, index2*0x4 */ - uint8_t RESERVED_0[224]; - __IO uint32_t MBC_DOM0_MEM0_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x140, array step: index*0x1CC, index2*0x4 */ - uint8_t RESERVED_1[56]; - __IO uint32_t MBC_DOM0_MEM1_BLK_CFG_W[1]; /**< MBC Memory Block Configuration Word, array offset: 0x180, array step: index*0x1CC, index2*0x4 */ - uint8_t RESERVED_2[28]; - __IO uint32_t MBC_DOM0_MEM1_BLK_NSE_W[1]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x1A0, array step: index*0x1CC, index2*0x4 */ - uint8_t RESERVED_3[4]; - __IO uint32_t MBC_DOM0_MEM2_BLK_CFG_W[1]; /**< MBC Memory Block Configuration Word, array offset: 0x1A8, array step: index*0x1CC, index2*0x4 */ - uint8_t RESERVED_4[28]; - __IO uint32_t MBC_DOM0_MEM2_BLK_NSE_W[1]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x1C8, array step: index*0x1CC, index2*0x4 */ - } MBC_INDEX[1]; -} TRDC_Type; - -/* ---------------------------------------------------------------------------- - -- TRDC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup TRDC_Register_Masks TRDC Register Masks - * @{ - */ - -/*! @name MBC_INDEX_MBC_MEM_GLBCFG - MBC Global Configuration Register */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_NBLKS_MASK (0x3FFU) -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_NBLKS_SHIFT (0U) -/*! NBLKS - Number of blocks in this memory */ -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_NBLKS(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEM_GLBCFG_NBLKS_SHIFT)) & TRDC_MBC_INDEX_MBC_MEM_GLBCFG_NBLKS_MASK) - -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_SIZE_LOG2_MASK (0x1F0000U) -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_SIZE_LOG2_SHIFT (16U) -/*! SIZE_LOG2 - Log2 size per block */ -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_SIZE_LOG2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEM_GLBCFG_SIZE_LOG2_SHIFT)) & TRDC_MBC_INDEX_MBC_MEM_GLBCFG_SIZE_LOG2_MASK) - -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_CLRE_MASK (0xC0000000U) -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_CLRE_SHIFT (30U) -/*! CLRE - Clear Error */ -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_CLRE(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEM_GLBCFG_CLRE_SHIFT)) & TRDC_MBC_INDEX_MBC_MEM_GLBCFG_CLRE_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_MEM_GLBCFG */ -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_MEM_GLBCFG */ -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_COUNT2 (4U) - -/*! @name MBC_INDEX_MBC_NSE_BLK_INDEX - MBC NonSecure Enable Block Index */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_WNDX_MASK (0x3CU) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_WNDX_SHIFT (2U) -/*! WNDX - Word index into the block NSE bitmap. It selects the BLK_NSE_Wn register, where WNDX determines the value of n. */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_WNDX(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_WNDX_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_WNDX_MASK) - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_MEM_SEL_MASK (0xF00U) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_MEM_SEL_SHIFT (8U) -/*! MEM_SEL - Memory Select */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_MEM_SEL(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_MEM_SEL_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_MEM_SEL_MASK) - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_DID_SEL0_MASK (0x10000U) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_DID_SEL0_SHIFT (16U) -/*! DID_SEL0 - DID Select - * 0b0..No effect. - * 0b1..Selects NSE bits for this domain. - */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_DID_SEL0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_DID_SEL0_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_DID_SEL0_MASK) - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_AI_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_AI_SHIFT (31U) -/*! AI - Auto Increment - * 0b0..No effect. - * 0b1..Add 1 to the WNDX field after the register write. - */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_AI(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_AI_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_AI_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_COUNT (1U) - -/*! @name MBC_INDEX_MBC_NSE_BLK_SET - MBC NonSecure Enable Block Set */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_SET_W1SET_MASK (0xFFFFFFFFU) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_SET_W1SET_SHIFT (0U) -/*! W1SET - Write-1 Set */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_SET_W1SET(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_SET_W1SET_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_SET_W1SET_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_NSE_BLK_SET */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_SET_COUNT (1U) - -/*! @name MBC_INDEX_MBC_NSE_BLK_CLR - MBC NonSecure Enable Block Clear */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_W1CLR_MASK (0xFFFFFFFFU) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_W1CLR_SHIFT (0U) -/*! W1CLR - Write-1 Clear */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_W1CLR(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_W1CLR_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_W1CLR_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_NSE_BLK_CLR */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_COUNT (1U) - -/*! @name MBC_INDEX_MBC_NSE_BLK_CLR_ALL - MBC NonSecure Enable Block Clear All */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_MEMSEL_MASK (0xF00U) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_MEMSEL_SHIFT (8U) -/*! MEMSEL - Memory Select */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_MEMSEL(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_MEMSEL_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_MEMSEL_MASK) - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_DID_SEL0_MASK (0x10000U) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_DID_SEL0_SHIFT (16U) -/*! DID_SEL0 - DID Select - * 0b0..No effect. - * 0b1..Clear all NSE bits for this domain. - */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_DID_SEL0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_DID_SEL0_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_DID_SEL0_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_COUNT (1U) - -/*! @name MBC_INDEX_MBC_MEMN_GLBAC - MBC Global Access Control */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUX_MASK (0x1U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUX_SHIFT (0U) -/*! NUX - NonsecureUser Execute - * 0b0..Execute access is not allowed in Nonsecure User mode. - * 0b1..Execute access is allowed in Nonsecure User mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUX(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUX_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUX_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUW_MASK (0x2U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUW_SHIFT (1U) -/*! NUW - NonsecureUser Write - * 0b0..Write access is not allowed in Nonsecure User mode. - * 0b1..Write access is allowed in Nonsecure User mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUW(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUW_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUW_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUR_MASK (0x4U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUR_SHIFT (2U) -/*! NUR - NonsecureUser Read - * 0b0..Read access is not allowed in Nonsecure User mode. - * 0b1..Read access is allowed in Nonsecure User mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUR(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUR_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUR_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPX_MASK (0x10U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPX_SHIFT (4U) -/*! NPX - NonsecurePriv Execute - * 0b0..Execute access is not allowed in Nonsecure Privilege mode. - * 0b1..Execute access is allowed in Nonsecure Privilege mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPX(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPX_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPX_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPW_MASK (0x20U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPW_SHIFT (5U) -/*! NPW - NonsecurePriv Write - * 0b0..Write access is not allowed in Nonsecure Privilege mode. - * 0b1..Write access is allowed in Nonsecure Privilege mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPW(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPW_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPW_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPR_MASK (0x40U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPR_SHIFT (6U) -/*! NPR - NonsecurePriv Read - * 0b0..Read access is not allowed in Nonsecure Privilege mode. - * 0b1..Read access is allowed in Nonsecure Privilege mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPR(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPR_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPR_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUX_MASK (0x100U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUX_SHIFT (8U) -/*! SUX - SecureUser Execute - * 0b0..Execute access is not allowed in Secure User mode. - * 0b1..Execute access is allowed in Secure User mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUX(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUX_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUX_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUW_MASK (0x200U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUW_SHIFT (9U) -/*! SUW - SecureUser Write - * 0b0..Write access is not allowed in Secure User mode. - * 0b1..Write access is allowed in Secure User mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUW(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUW_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUW_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUR_MASK (0x400U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUR_SHIFT (10U) -/*! SUR - SecureUser Read - * 0b0..Read access is not allowed in Secure User mode. - * 0b1..Read access is allowed in Secure User mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUR(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUR_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUR_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPX_MASK (0x1000U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPX_SHIFT (12U) -/*! SPX - SecurePriv Execute - * 0b0..Execute access is not allowed in Secure Privilege mode. - * 0b1..Execute access is allowed in Secure Privilege mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPX(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPX_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPX_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPW_MASK (0x2000U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPW_SHIFT (13U) -/*! SPW - SecurePriv Write - * 0b0..Write access is not allowed in Secure Privilege mode. - * 0b1..Write access is allowed in Secure Privilege mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPW(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPW_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPW_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPR_MASK (0x4000U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPR_SHIFT (14U) -/*! SPR - SecurePriv Read - * 0b0..Read access is not allowed in Secure Privilege mode. - * 0b1..Read access is allowed in Secure Privilege mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPR(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPR_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPR_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_LK_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_LK_SHIFT (31U) -/*! LK - LOCK - * 0b0..This register is not locked and can be altered. - * 0b1..This register is locked and cannot be altered. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_LK(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_LK_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_LK_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_MEMN_GLBAC */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_MEMN_GLBAC */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_COUNT2 (8U) - -/*! @name MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W - MBC Memory Block Configuration Word */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL0_MASK (0x7U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL0_SHIFT (0U) -/*! MBACSEL0 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE0_MASK (0x8U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE0_SHIFT (3U) -/*! NSE0 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL1_MASK (0x70U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL1_SHIFT (4U) -/*! MBACSEL1 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE1_MASK (0x80U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE1_SHIFT (7U) -/*! NSE1 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL2_MASK (0x700U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL2_SHIFT (8U) -/*! MBACSEL2 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE2_MASK (0x800U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE2_SHIFT (11U) -/*! NSE2 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL3_MASK (0x7000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL3_SHIFT (12U) -/*! MBACSEL3 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE3_MASK (0x8000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE3_SHIFT (15U) -/*! NSE3 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL4_MASK (0x70000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL4_SHIFT (16U) -/*! MBACSEL4 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE4_MASK (0x80000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE4_SHIFT (19U) -/*! NSE4 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL5_MASK (0x700000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL5_SHIFT (20U) -/*! MBACSEL5 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE5_MASK (0x800000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE5_SHIFT (23U) -/*! NSE5 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL6_MASK (0x7000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL6_SHIFT (24U) -/*! MBACSEL6 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE6_MASK (0x8000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE6_SHIFT (27U) -/*! NSE6 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL7_MASK (0x70000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL7_SHIFT (28U) -/*! MBACSEL7 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL7_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE7_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE7_SHIFT (31U) -/*! NSE7 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE7_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_COUNT2 (8U) - -/*! @name MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W - MBC Memory Block NonSecure Enable Word */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT0_MASK (0x1U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT0_SHIFT (0U) -/*! BIT0 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT1_MASK (0x2U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT1_SHIFT (1U) -/*! BIT1 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT2_MASK (0x4U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT2_SHIFT (2U) -/*! BIT2 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT3_MASK (0x8U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT3_SHIFT (3U) -/*! BIT3 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT4_MASK (0x10U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT4_SHIFT (4U) -/*! BIT4 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT5_MASK (0x20U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT5_SHIFT (5U) -/*! BIT5 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT6_MASK (0x40U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT6_SHIFT (6U) -/*! BIT6 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT7_MASK (0x80U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT7_SHIFT (7U) -/*! BIT7 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT7_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT8_MASK (0x100U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT8_SHIFT (8U) -/*! BIT8 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT8(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT8_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT8_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT9_MASK (0x200U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT9_SHIFT (9U) -/*! BIT9 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT9(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT9_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT9_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT10_MASK (0x400U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT10_SHIFT (10U) -/*! BIT10 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT10(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT10_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT10_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT11_MASK (0x800U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT11_SHIFT (11U) -/*! BIT11 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT11(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT11_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT11_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT12_MASK (0x1000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT12_SHIFT (12U) -/*! BIT12 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT12(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT12_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT12_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT13_MASK (0x2000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT13_SHIFT (13U) -/*! BIT13 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT13(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT13_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT13_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT14_MASK (0x4000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT14_SHIFT (14U) -/*! BIT14 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT14(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT14_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT14_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT15_MASK (0x8000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT15_SHIFT (15U) -/*! BIT15 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT15(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT15_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT15_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT16_MASK (0x10000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT16_SHIFT (16U) -/*! BIT16 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT16(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT16_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT16_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT17_MASK (0x20000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT17_SHIFT (17U) -/*! BIT17 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT17(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT17_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT17_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT18_MASK (0x40000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT18_SHIFT (18U) -/*! BIT18 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT18(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT18_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT18_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT19_MASK (0x80000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT19_SHIFT (19U) -/*! BIT19 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT19(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT19_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT19_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT20_MASK (0x100000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT20_SHIFT (20U) -/*! BIT20 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT20(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT20_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT20_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT21_MASK (0x200000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT21_SHIFT (21U) -/*! BIT21 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT21(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT21_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT21_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT22_MASK (0x400000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT22_SHIFT (22U) -/*! BIT22 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT22(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT22_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT22_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT23_MASK (0x800000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT23_SHIFT (23U) -/*! BIT23 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT23(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT23_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT23_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT24_MASK (0x1000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT24_SHIFT (24U) -/*! BIT24 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT24(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT24_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT24_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT25_MASK (0x2000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT25_SHIFT (25U) -/*! BIT25 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT25(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT25_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT25_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT26_MASK (0x4000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT26_SHIFT (26U) -/*! BIT26 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT26(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT26_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT26_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT27_MASK (0x8000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT27_SHIFT (27U) -/*! BIT27 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT27(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT27_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT27_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT28_MASK (0x10000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT28_SHIFT (28U) -/*! BIT28 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT28(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT28_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT28_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT29_MASK (0x20000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT29_SHIFT (29U) -/*! BIT29 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT29(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT29_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT29_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT30_MASK (0x40000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT30_SHIFT (30U) -/*! BIT30 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT30(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT30_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT30_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT31_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT31_SHIFT (31U) -/*! BIT31 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT31(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT31_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT31_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_COUNT2 (2U) - -/*! @name MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W - MBC Memory Block Configuration Word */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL0_MASK (0x7U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL0_SHIFT (0U) -/*! MBACSEL0 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE0_MASK (0x8U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE0_SHIFT (3U) -/*! NSE0 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL1_MASK (0x70U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL1_SHIFT (4U) -/*! MBACSEL1 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE1_MASK (0x80U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE1_SHIFT (7U) -/*! NSE1 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL2_MASK (0x700U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL2_SHIFT (8U) -/*! MBACSEL2 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE2_MASK (0x800U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE2_SHIFT (11U) -/*! NSE2 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL3_MASK (0x7000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL3_SHIFT (12U) -/*! MBACSEL3 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE3_MASK (0x8000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE3_SHIFT (15U) -/*! NSE3 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL4_MASK (0x70000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL4_SHIFT (16U) -/*! MBACSEL4 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE4_MASK (0x80000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE4_SHIFT (19U) -/*! NSE4 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL5_MASK (0x700000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL5_SHIFT (20U) -/*! MBACSEL5 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE5_MASK (0x800000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE5_SHIFT (23U) -/*! NSE5 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL6_MASK (0x7000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL6_SHIFT (24U) -/*! MBACSEL6 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE6_MASK (0x8000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE6_SHIFT (27U) -/*! NSE6 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL7_MASK (0x70000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL7_SHIFT (28U) -/*! MBACSEL7 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL7_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE7_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE7_SHIFT (31U) -/*! NSE7 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE7_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_COUNT2 (1U) - -/*! @name MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W - MBC Memory Block NonSecure Enable Word */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT0_MASK (0x1U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT0_SHIFT (0U) -/*! BIT0 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT1_MASK (0x2U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT1_SHIFT (1U) -/*! BIT1 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT2_MASK (0x4U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT2_SHIFT (2U) -/*! BIT2 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT3_MASK (0x8U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT3_SHIFT (3U) -/*! BIT3 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT4_MASK (0x10U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT4_SHIFT (4U) -/*! BIT4 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT5_MASK (0x20U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT5_SHIFT (5U) -/*! BIT5 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT6_MASK (0x40U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT6_SHIFT (6U) -/*! BIT6 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT7_MASK (0x80U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT7_SHIFT (7U) -/*! BIT7 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT7_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT8_MASK (0x100U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT8_SHIFT (8U) -/*! BIT8 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT8(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT8_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT8_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT9_MASK (0x200U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT9_SHIFT (9U) -/*! BIT9 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT9(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT9_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT9_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT10_MASK (0x400U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT10_SHIFT (10U) -/*! BIT10 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT10(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT10_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT10_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT11_MASK (0x800U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT11_SHIFT (11U) -/*! BIT11 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT11(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT11_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT11_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT12_MASK (0x1000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT12_SHIFT (12U) -/*! BIT12 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT12(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT12_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT12_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT13_MASK (0x2000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT13_SHIFT (13U) -/*! BIT13 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT13(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT13_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT13_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT14_MASK (0x4000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT14_SHIFT (14U) -/*! BIT14 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT14(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT14_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT14_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT15_MASK (0x8000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT15_SHIFT (15U) -/*! BIT15 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT15(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT15_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT15_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT16_MASK (0x10000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT16_SHIFT (16U) -/*! BIT16 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT16(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT16_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT16_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT17_MASK (0x20000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT17_SHIFT (17U) -/*! BIT17 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT17(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT17_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT17_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT18_MASK (0x40000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT18_SHIFT (18U) -/*! BIT18 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT18(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT18_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT18_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT19_MASK (0x80000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT19_SHIFT (19U) -/*! BIT19 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT19(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT19_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT19_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT20_MASK (0x100000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT20_SHIFT (20U) -/*! BIT20 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT20(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT20_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT20_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT21_MASK (0x200000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT21_SHIFT (21U) -/*! BIT21 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT21(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT21_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT21_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT22_MASK (0x400000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT22_SHIFT (22U) -/*! BIT22 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT22(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT22_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT22_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT23_MASK (0x800000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT23_SHIFT (23U) -/*! BIT23 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT23(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT23_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT23_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT24_MASK (0x1000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT24_SHIFT (24U) -/*! BIT24 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT24(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT24_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT24_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT25_MASK (0x2000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT25_SHIFT (25U) -/*! BIT25 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT25(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT25_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT25_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT26_MASK (0x4000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT26_SHIFT (26U) -/*! BIT26 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT26(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT26_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT26_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT27_MASK (0x8000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT27_SHIFT (27U) -/*! BIT27 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT27(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT27_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT27_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT28_MASK (0x10000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT28_SHIFT (28U) -/*! BIT28 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT28(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT28_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT28_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT29_MASK (0x20000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT29_SHIFT (29U) -/*! BIT29 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT29(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT29_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT29_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT30_MASK (0x40000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT30_SHIFT (30U) -/*! BIT30 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT30(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT30_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT30_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT31_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT31_SHIFT (31U) -/*! BIT31 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT31(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT31_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT31_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_COUNT2 (1U) - -/*! @name MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W - MBC Memory Block Configuration Word */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL0_MASK (0x7U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL0_SHIFT (0U) -/*! MBACSEL0 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE0_MASK (0x8U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE0_SHIFT (3U) -/*! NSE0 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL1_MASK (0x70U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL1_SHIFT (4U) -/*! MBACSEL1 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE1_MASK (0x80U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE1_SHIFT (7U) -/*! NSE1 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL2_MASK (0x700U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL2_SHIFT (8U) -/*! MBACSEL2 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE2_MASK (0x800U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE2_SHIFT (11U) -/*! NSE2 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL3_MASK (0x7000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL3_SHIFT (12U) -/*! MBACSEL3 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE3_MASK (0x8000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE3_SHIFT (15U) -/*! NSE3 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL4_MASK (0x70000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL4_SHIFT (16U) -/*! MBACSEL4 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE4_MASK (0x80000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE4_SHIFT (19U) -/*! NSE4 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL5_MASK (0x700000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL5_SHIFT (20U) -/*! MBACSEL5 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE5_MASK (0x800000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE5_SHIFT (23U) -/*! NSE5 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL6_MASK (0x7000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL6_SHIFT (24U) -/*! MBACSEL6 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE6_MASK (0x8000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE6_SHIFT (27U) -/*! NSE6 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL7_MASK (0x70000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL7_SHIFT (28U) -/*! MBACSEL7 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL7_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE7_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE7_SHIFT (31U) -/*! NSE7 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE7_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_COUNT2 (1U) - -/*! @name MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W - MBC Memory Block NonSecure Enable Word */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT0_MASK (0x1U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT0_SHIFT (0U) -/*! BIT0 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT1_MASK (0x2U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT1_SHIFT (1U) -/*! BIT1 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT2_MASK (0x4U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT2_SHIFT (2U) -/*! BIT2 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT3_MASK (0x8U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT3_SHIFT (3U) -/*! BIT3 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT4_MASK (0x10U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT4_SHIFT (4U) -/*! BIT4 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT5_MASK (0x20U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT5_SHIFT (5U) -/*! BIT5 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT6_MASK (0x40U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT6_SHIFT (6U) -/*! BIT6 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT7_MASK (0x80U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT7_SHIFT (7U) -/*! BIT7 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT7_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT8_MASK (0x100U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT8_SHIFT (8U) -/*! BIT8 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT8(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT8_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT8_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT9_MASK (0x200U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT9_SHIFT (9U) -/*! BIT9 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT9(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT9_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT9_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT10_MASK (0x400U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT10_SHIFT (10U) -/*! BIT10 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT10(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT10_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT10_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT11_MASK (0x800U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT11_SHIFT (11U) -/*! BIT11 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT11(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT11_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT11_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT12_MASK (0x1000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT12_SHIFT (12U) -/*! BIT12 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT12(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT12_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT12_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT13_MASK (0x2000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT13_SHIFT (13U) -/*! BIT13 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT13(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT13_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT13_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT14_MASK (0x4000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT14_SHIFT (14U) -/*! BIT14 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT14(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT14_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT14_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT15_MASK (0x8000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT15_SHIFT (15U) -/*! BIT15 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT15(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT15_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT15_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT16_MASK (0x10000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT16_SHIFT (16U) -/*! BIT16 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT16(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT16_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT16_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT17_MASK (0x20000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT17_SHIFT (17U) -/*! BIT17 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT17(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT17_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT17_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT18_MASK (0x40000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT18_SHIFT (18U) -/*! BIT18 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT18(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT18_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT18_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT19_MASK (0x80000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT19_SHIFT (19U) -/*! BIT19 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT19(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT19_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT19_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT20_MASK (0x100000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT20_SHIFT (20U) -/*! BIT20 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT20(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT20_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT20_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT21_MASK (0x200000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT21_SHIFT (21U) -/*! BIT21 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT21(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT21_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT21_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT22_MASK (0x400000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT22_SHIFT (22U) -/*! BIT22 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT22(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT22_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT22_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT23_MASK (0x800000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT23_SHIFT (23U) -/*! BIT23 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT23(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT23_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT23_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT24_MASK (0x1000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT24_SHIFT (24U) -/*! BIT24 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT24(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT24_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT24_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT25_MASK (0x2000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT25_SHIFT (25U) -/*! BIT25 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT25(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT25_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT25_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT26_MASK (0x4000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT26_SHIFT (26U) -/*! BIT26 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT26(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT26_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT26_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT27_MASK (0x8000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT27_SHIFT (27U) -/*! BIT27 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT27(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT27_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT27_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT28_MASK (0x10000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT28_SHIFT (28U) -/*! BIT28 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT28(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT28_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT28_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT29_MASK (0x20000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT29_SHIFT (29U) -/*! BIT29 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT29(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT29_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT29_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT30_MASK (0x40000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT30_SHIFT (30U) -/*! BIT30 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT30(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT30_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT30_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT31_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT31_SHIFT (31U) -/*! BIT31 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT31(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT31_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT31_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_COUNT2 (1U) - - -/*! - * @} - */ /* end of group TRDC_Register_Masks */ - - -/* TRDC - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral TRDC base address */ - #define TRDC_BASE (0x500C7000u) - /** Peripheral TRDC base address */ - #define TRDC_BASE_NS (0x400C7000u) - /** Peripheral TRDC base pointer */ - #define TRDC ((TRDC_Type *)TRDC_BASE) - /** Peripheral TRDC base pointer */ - #define TRDC_NS ((TRDC_Type *)TRDC_BASE_NS) - /** Array initializer of TRDC peripheral base addresses */ - #define TRDC_BASE_ADDRS { TRDC_BASE } - /** Array initializer of TRDC peripheral base pointers */ - #define TRDC_BASE_PTRS { TRDC } - /** Array initializer of TRDC peripheral base addresses */ - #define TRDC_BASE_ADDRS_NS { TRDC_BASE_NS } - /** Array initializer of TRDC peripheral base pointers */ - #define TRDC_BASE_PTRS_NS { TRDC_NS } -#else - /** Peripheral TRDC base address */ - #define TRDC_BASE (0x400C7000u) - /** Peripheral TRDC base pointer */ - #define TRDC ((TRDC_Type *)TRDC_BASE) - /** Array initializer of TRDC peripheral base addresses */ - #define TRDC_BASE_ADDRS { TRDC_BASE } - /** Array initializer of TRDC peripheral base pointers */ - #define TRDC_BASE_PTRS { TRDC } -#endif -#define MBC0_MEMORY_CFG_WORD_COUNT {1,2,4,1} -#define MBC1_MEMORY_CFG_WORD_COUNT {1,1,1,1} -#define MBC2_MEMORY_CFG_WORD_COUNT {9,6,1,1} -#define MBC3_MEMORY_CFG_WORD_COUNT {3,0,0,0} -#define MBC_MEMORY_CFG_WORD_COUNT {MBC0_MEMORY_CFG_WORD_COUNT , MBC1_MEMORY_CFG_WORD_COUNT, MBC2_MEMORY_CFG_WORD_COUNT, MBC3_MEMORY_CFG_WORD_COUNT} -#define MBC0_MEMORY_NSE_WORD_COUNT {1,1,1,1} -#define MBC1_MEMORY_NSE_WORD_COUNT {1,1,1,1} -#define MBC2_MEMORY_NSE_WORD_COUNT {3,2,1,1} -#define MBC3_MEMORY_NSE_WORD_COUNT {1,0,0,0} -#define MBC_MEMORY_NSE_WORD_COUNT {MBC0_MEMORY_NSE_WORD_COUNT , MBC1_MEMORY_NSE_WORD_COUNT, MBC2_MEMORY_NSE_WORD_COUNT, MBC3_MEMORY_NSE_WORD_COUNT} - - -/*! - * @} - */ /* end of group TRDC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- USBHS Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USBHS_Peripheral_Access_Layer USBHS Peripheral Access Layer - * @{ - */ - -/** USBHS - Register Layout Typedef */ -typedef struct { - __I uint32_t ID; /**< Identification, offset: 0x0 */ - __I uint32_t HWGENERAL; /**< Hardware General, offset: 0x4 */ - __I uint32_t HWHOST; /**< Host Hardware Parameters, offset: 0x8 */ - __I uint32_t HWDEVICE; /**< Device Hardware Parameters, offset: 0xC */ - __I uint32_t HWTXBUF; /**< TX Buffer Hardware Parameters, offset: 0x10 */ - __I uint32_t HWRXBUF; /**< RX Buffer Hardware Parameters, offset: 0x14 */ - uint8_t RESERVED_0[104]; - __IO uint32_t GPTIMER0LD; /**< General Purpose Timer #0 Load, offset: 0x80 */ - __IO uint32_t GPTIMER0CTRL; /**< General Purpose Timer #0 Controller, offset: 0x84 */ - __IO uint32_t GPTIMER1LD; /**< General Purpose Timer #1 Load, offset: 0x88 */ - __IO uint32_t GPTIMER1CTRL; /**< General Purpose Timer #1 Controller, offset: 0x8C */ - __IO uint32_t SBUSCFG; /**< System Bus Config, offset: 0x90 */ - uint8_t RESERVED_1[108]; - __I uint8_t CAPLENGTH; /**< Capability Registers Length, offset: 0x100 */ - uint8_t RESERVED_2[1]; - __I uint16_t HCIVERSION; /**< Host Controller Interface Version, offset: 0x102 */ - __I uint32_t HCSPARAMS; /**< Host Controller Structural Parameters, offset: 0x104 */ - __I uint32_t HCCPARAMS; /**< Host Controller Capability Parameters, offset: 0x108 */ - uint8_t RESERVED_3[20]; - __I uint16_t DCIVERSION; /**< Device Controller Interface Version, offset: 0x120 */ - uint8_t RESERVED_4[2]; - __I uint32_t DCCPARAMS; /**< Device Controller Capability Parameters, offset: 0x124 */ - uint8_t RESERVED_5[24]; - __IO uint32_t USBCMD; /**< USB Command, offset: 0x140 */ - __IO uint32_t USBSTS; /**< USB Status, offset: 0x144 */ - __IO uint32_t USBINTR; /**< Interrupt Enable, offset: 0x148 */ - __IO uint32_t FRINDEX; /**< USB Frame Index, offset: 0x14C */ - uint8_t RESERVED_6[4]; - union { /* offset: 0x154 */ - __IO uint32_t DEVICEADDR; /**< Device Address, offset: 0x154 */ - __IO uint32_t PERIODICLISTBASE; /**< Frame List Base Address, offset: 0x154 */ - }; - union { /* offset: 0x158 */ - __IO uint32_t ASYNCLISTADDR; /**< Next Asynch. Address, offset: 0x158 */ - __IO uint32_t ENDPTLISTADDR; /**< Endpoint List Address, offset: 0x158 */ - }; - uint8_t RESERVED_7[4]; - __IO uint32_t BURSTSIZE; /**< Programmable Burst Size, offset: 0x160 */ - __IO uint32_t TXFILLTUNING; /**< TX FIFO Fill Tuning, offset: 0x164 */ - uint8_t RESERVED_8[16]; - __IO uint32_t ENDPTNAK; /**< Endpoint NAK, offset: 0x178 */ - __IO uint32_t ENDPTNAKEN; /**< Endpoint NAK Enable, offset: 0x17C */ - __I uint32_t CONFIGFLAG; /**< Configure Flag, offset: 0x180 */ - __IO uint32_t PORTSC1; /**< Port Status & Control, offset: 0x184 */ - uint8_t RESERVED_9[28]; - __IO uint32_t OTGSC; /**< On-The-Go Status & Control, offset: 0x1A4 */ - __IO uint32_t USBMODE; /**< USB Device Mode, offset: 0x1A8 */ - __IO uint32_t ENDPTSETUPSTAT; /**< Endpoint Setup Status, offset: 0x1AC */ - __IO uint32_t ENDPTPRIME; /**< Endpoint Prime, offset: 0x1B0 */ - __IO uint32_t ENDPTFLUSH; /**< Endpoint Flush, offset: 0x1B4 */ - __I uint32_t ENDPTSTAT; /**< Endpoint Status, offset: 0x1B8 */ - __IO uint32_t ENDPTCOMPLETE; /**< Endpoint Complete, offset: 0x1BC */ - __IO uint32_t ENDPTCTRL0; /**< Endpoint Control 0, offset: 0x1C0 */ - __IO uint32_t ENDPTCTRL[7]; /**< Endpoint Control 1..Endpoint Control 7, array offset: 0x1C4, array step: 0x4 */ -} USBHS_Type; - -/* ---------------------------------------------------------------------------- - -- USBHS Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USBHS_Register_Masks USBHS Register Masks - * @{ - */ - -/*! @name ID - Identification */ -/*! @{ */ - -#define USBHS_ID_ID_MASK (0x3FU) -#define USBHS_ID_ID_SHIFT (0U) -/*! ID - Configuration Number */ -#define USBHS_ID_ID(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ID_ID_SHIFT)) & USBHS_ID_ID_MASK) - -#define USBHS_ID_NID_MASK (0x3F00U) -#define USBHS_ID_NID_SHIFT (8U) -/*! NID - Complement Version of ID */ -#define USBHS_ID_NID(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ID_NID_SHIFT)) & USBHS_ID_NID_MASK) - -#define USBHS_ID_REVISION_MASK (0xFF0000U) -#define USBHS_ID_REVISION_SHIFT (16U) -/*! REVISION - Revision Number of the Controller Core */ -#define USBHS_ID_REVISION(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ID_REVISION_SHIFT)) & USBHS_ID_REVISION_MASK) -/*! @} */ - -/*! @name HWGENERAL - Hardware General */ -/*! @{ */ - -#define USBHS_HWGENERAL_PHYW_MASK (0x30U) -#define USBHS_HWGENERAL_PHYW_SHIFT (4U) -/*! PHYW - Data width of the transceiver connected to the controller core - * 0b00..8 bit wide data bus (Software non-programmable) - * 0b01..16 bit wide data bus (Software non-programmable) - * 0b10..Reset to 8 bit wide data bus (Software programmable) - * 0b11..Reset to 16 bit wide data bus (Software programmable) - */ -#define USBHS_HWGENERAL_PHYW(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWGENERAL_PHYW_SHIFT)) & USBHS_HWGENERAL_PHYW_MASK) - -#define USBHS_HWGENERAL_PHYM_MASK (0x1C0U) -#define USBHS_HWGENERAL_PHYM_SHIFT (6U) -/*! PHYM - Transceiver Type - * 0b000..UTMI/UMTI+ - * 0b001..ULPI DDR - * 0b010..ULPI - * 0b011..Serial Only - * 0b100..Software programmable - reset to UTMI/UTMI+ - * 0b101..Software programmable - reset to ULPI DDR - * 0b110..Software programmable - reset to ULPI - * 0b111..Software programmable - reset to Serial - */ -#define USBHS_HWGENERAL_PHYM(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWGENERAL_PHYM_SHIFT)) & USBHS_HWGENERAL_PHYM_MASK) - -#define USBHS_HWGENERAL_SM_MASK (0x600U) -#define USBHS_HWGENERAL_SM_SHIFT (9U) -/*! SM - Serial interface mode capability - * 0b00..No Serial Engine, always use parallel signalling - * 0b01..Serial Engine present, always use serial signalling for FS/LS - * 0b10..Software programmable - Reset to use parallel signalling for FS/LS - * 0b11..Software programmable - Reset to use serial signalling for FS/LS - */ -#define USBHS_HWGENERAL_SM(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWGENERAL_SM_SHIFT)) & USBHS_HWGENERAL_SM_MASK) -/*! @} */ - -/*! @name HWHOST - Host Hardware Parameters */ -/*! @{ */ - -#define USBHS_HWHOST_HC_MASK (0x1U) -#define USBHS_HWHOST_HC_SHIFT (0U) -/*! HC - Host Capable - * 0b1..Supported - * 0b0..Not supported - */ -#define USBHS_HWHOST_HC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWHOST_HC_SHIFT)) & USBHS_HWHOST_HC_MASK) - -#define USBHS_HWHOST_NPORT_MASK (0xEU) -#define USBHS_HWHOST_NPORT_SHIFT (1U) -/*! NPORT - The Number of downstream ports supported by the host controller is (NPORT+1) */ -#define USBHS_HWHOST_NPORT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWHOST_NPORT_SHIFT)) & USBHS_HWHOST_NPORT_MASK) -/*! @} */ - -/*! @name HWDEVICE - Device Hardware Parameters */ -/*! @{ */ - -#define USBHS_HWDEVICE_DC_MASK (0x1U) -#define USBHS_HWDEVICE_DC_SHIFT (0U) -/*! DC - Device Capable - * 0b1..Supported - * 0b0..Not supported - */ -#define USBHS_HWDEVICE_DC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWDEVICE_DC_SHIFT)) & USBHS_HWDEVICE_DC_MASK) - -#define USBHS_HWDEVICE_DEVEP_MASK (0x3EU) -#define USBHS_HWDEVICE_DEVEP_SHIFT (1U) -/*! DEVEP - Device Endpoint Number */ -#define USBHS_HWDEVICE_DEVEP(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWDEVICE_DEVEP_SHIFT)) & USBHS_HWDEVICE_DEVEP_MASK) -/*! @} */ - -/*! @name HWTXBUF - TX Buffer Hardware Parameters */ -/*! @{ */ - -#define USBHS_HWTXBUF_TXBURST_MASK (0xFFU) -#define USBHS_HWTXBUF_TXBURST_SHIFT (0U) -/*! TXBURST - Default burst size for memory to TX buffer transfer */ -#define USBHS_HWTXBUF_TXBURST(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWTXBUF_TXBURST_SHIFT)) & USBHS_HWTXBUF_TXBURST_MASK) - -#define USBHS_HWTXBUF_TXCHANADD_MASK (0xFF0000U) -#define USBHS_HWTXBUF_TXCHANADD_SHIFT (16U) -/*! TXCHANADD - TX FIFO Buffer size is: (2^TXCHANADD) * 4 Bytes */ -#define USBHS_HWTXBUF_TXCHANADD(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWTXBUF_TXCHANADD_SHIFT)) & USBHS_HWTXBUF_TXCHANADD_MASK) -/*! @} */ - -/*! @name HWRXBUF - RX Buffer Hardware Parameters */ -/*! @{ */ - -#define USBHS_HWRXBUF_RXBURST_MASK (0xFFU) -#define USBHS_HWRXBUF_RXBURST_SHIFT (0U) -/*! RXBURST - Default burst size for memory to RX buffer transfer */ -#define USBHS_HWRXBUF_RXBURST(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWRXBUF_RXBURST_SHIFT)) & USBHS_HWRXBUF_RXBURST_MASK) - -#define USBHS_HWRXBUF_RXADD_MASK (0xFF00U) -#define USBHS_HWRXBUF_RXADD_SHIFT (8U) -/*! RXADD - Buffer total size for all receive endpoints is (2^RXADD) */ -#define USBHS_HWRXBUF_RXADD(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWRXBUF_RXADD_SHIFT)) & USBHS_HWRXBUF_RXADD_MASK) -/*! @} */ - -/*! @name GPTIMER0LD - General Purpose Timer #0 Load */ -/*! @{ */ - -#define USBHS_GPTIMER0LD_GPTLD_MASK (0xFFFFFFU) -#define USBHS_GPTIMER0LD_GPTLD_SHIFT (0U) -/*! GPTLD - General Purpose Timer Load Value */ -#define USBHS_GPTIMER0LD_GPTLD(x) (((uint32_t)(((uint32_t)(x)) << USBHS_GPTIMER0LD_GPTLD_SHIFT)) & USBHS_GPTIMER0LD_GPTLD_MASK) -/*! @} */ - -/*! @name GPTIMER0CTRL - General Purpose Timer #0 Controller */ -/*! @{ */ - -#define USBHS_GPTIMER0CTRL_GPTCNT_MASK (0xFFFFFFU) -#define USBHS_GPTIMER0CTRL_GPTCNT_SHIFT (0U) -/*! GPTCNT - General Purpose Timer Counter */ -#define USBHS_GPTIMER0CTRL_GPTCNT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_GPTIMER0CTRL_GPTCNT_SHIFT)) & USBHS_GPTIMER0CTRL_GPTCNT_MASK) - -#define USBHS_GPTIMER0CTRL_GPTMODE_MASK (0x1000000U) -#define USBHS_GPTIMER0CTRL_GPTMODE_SHIFT (24U) -/*! GPTMODE - General Purpose Timer Mode - * 0b0..One Shot Mode - * 0b1..Repeat Mode - */ -#define USBHS_GPTIMER0CTRL_GPTMODE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_GPTIMER0CTRL_GPTMODE_SHIFT)) & USBHS_GPTIMER0CTRL_GPTMODE_MASK) - -#define USBHS_GPTIMER0CTRL_GPTRST_MASK (0x40000000U) -#define USBHS_GPTIMER0CTRL_GPTRST_SHIFT (30U) -/*! GPTRST - General Purpose Timer Reset - * 0b0..No action - * 0b1..Load counter value from GPTLD bits in n_GPTIMER0LD - */ -#define USBHS_GPTIMER0CTRL_GPTRST(x) (((uint32_t)(((uint32_t)(x)) << USBHS_GPTIMER0CTRL_GPTRST_SHIFT)) & USBHS_GPTIMER0CTRL_GPTRST_MASK) - -#define USBHS_GPTIMER0CTRL_GPTRUN_MASK (0x80000000U) -#define USBHS_GPTIMER0CTRL_GPTRUN_SHIFT (31U) -/*! GPTRUN - General Purpose Timer Run - * 0b0..Stop counting - * 0b1..Run - */ -#define USBHS_GPTIMER0CTRL_GPTRUN(x) (((uint32_t)(((uint32_t)(x)) << USBHS_GPTIMER0CTRL_GPTRUN_SHIFT)) & USBHS_GPTIMER0CTRL_GPTRUN_MASK) -/*! @} */ - -/*! @name GPTIMER1LD - General Purpose Timer #1 Load */ -/*! @{ */ - -#define USBHS_GPTIMER1LD_GPTLD_MASK (0xFFFFFFU) -#define USBHS_GPTIMER1LD_GPTLD_SHIFT (0U) -/*! GPTLD - General Purpose Timer Load Value */ -#define USBHS_GPTIMER1LD_GPTLD(x) (((uint32_t)(((uint32_t)(x)) << USBHS_GPTIMER1LD_GPTLD_SHIFT)) & USBHS_GPTIMER1LD_GPTLD_MASK) -/*! @} */ - -/*! @name GPTIMER1CTRL - General Purpose Timer #1 Controller */ -/*! @{ */ - -#define USBHS_GPTIMER1CTRL_GPTCNT_MASK (0xFFFFFFU) -#define USBHS_GPTIMER1CTRL_GPTCNT_SHIFT (0U) -/*! GPTCNT - General Purpose Timer Counter */ -#define USBHS_GPTIMER1CTRL_GPTCNT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_GPTIMER1CTRL_GPTCNT_SHIFT)) & USBHS_GPTIMER1CTRL_GPTCNT_MASK) - -#define USBHS_GPTIMER1CTRL_GPTMODE_MASK (0x1000000U) -#define USBHS_GPTIMER1CTRL_GPTMODE_SHIFT (24U) -/*! GPTMODE - General Purpose Timer Mode - * 0b0..One Shot Mode - * 0b1..Repeat Mode - */ -#define USBHS_GPTIMER1CTRL_GPTMODE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_GPTIMER1CTRL_GPTMODE_SHIFT)) & USBHS_GPTIMER1CTRL_GPTMODE_MASK) - -#define USBHS_GPTIMER1CTRL_GPTRST_MASK (0x40000000U) -#define USBHS_GPTIMER1CTRL_GPTRST_SHIFT (30U) -/*! GPTRST - General Purpose Timer Reset - * 0b0..No action - * 0b1..Load counter value from GPTLD bits in USB_n_GPTIMER0LD - */ -#define USBHS_GPTIMER1CTRL_GPTRST(x) (((uint32_t)(((uint32_t)(x)) << USBHS_GPTIMER1CTRL_GPTRST_SHIFT)) & USBHS_GPTIMER1CTRL_GPTRST_MASK) - -#define USBHS_GPTIMER1CTRL_GPTRUN_MASK (0x80000000U) -#define USBHS_GPTIMER1CTRL_GPTRUN_SHIFT (31U) -/*! GPTRUN - General Purpose Timer Run - * 0b0..Stop counting - * 0b1..Run - */ -#define USBHS_GPTIMER1CTRL_GPTRUN(x) (((uint32_t)(((uint32_t)(x)) << USBHS_GPTIMER1CTRL_GPTRUN_SHIFT)) & USBHS_GPTIMER1CTRL_GPTRUN_MASK) -/*! @} */ - -/*! @name SBUSCFG - System Bus Config */ -/*! @{ */ - -#define USBHS_SBUSCFG_AHBBRST_MASK (0x7U) -#define USBHS_SBUSCFG_AHBBRST_SHIFT (0U) -/*! AHBBRST - AHB master interface Burst configuration - * 0b000..Incremental burst of unspecified length only - * 0b001..INCR4 burst, then single transfer - * 0b010..INCR8 burst, INCR4 burst, then single transfer - * 0b011..INCR16 burst, INCR8 burst, INCR4 burst, then single transfer - * 0b100..Reserved, don't use - * 0b101..INCR4 burst, then incremental burst of unspecified length - * 0b110..INCR8 burst, INCR4 burst, then incremental burst of unspecified length - * 0b111..INCR16 burst, INCR8 burst, INCR4 burst, then incremental burst of unspecified length - */ -#define USBHS_SBUSCFG_AHBBRST(x) (((uint32_t)(((uint32_t)(x)) << USBHS_SBUSCFG_AHBBRST_SHIFT)) & USBHS_SBUSCFG_AHBBRST_MASK) -/*! @} */ - -/*! @name CAPLENGTH - Capability Registers Length */ -/*! @{ */ - -#define USBHS_CAPLENGTH_CAPLENGTH_MASK (0xFFU) -#define USBHS_CAPLENGTH_CAPLENGTH_SHIFT (0U) -/*! CAPLENGTH - These bits are used as an offset to add to register base to find the beginning of - * the Operational Register. Default value is '40h'. - */ -#define USBHS_CAPLENGTH_CAPLENGTH(x) (((uint8_t)(((uint8_t)(x)) << USBHS_CAPLENGTH_CAPLENGTH_SHIFT)) & USBHS_CAPLENGTH_CAPLENGTH_MASK) -/*! @} */ - -/*! @name HCIVERSION - Host Controller Interface Version */ -/*! @{ */ - -#define USBHS_HCIVERSION_HCIVERSION_MASK (0xFFFFU) -#define USBHS_HCIVERSION_HCIVERSION_SHIFT (0U) -/*! HCIVERSION - Host Controller Interface Version Number */ -#define USBHS_HCIVERSION_HCIVERSION(x) (((uint16_t)(((uint16_t)(x)) << USBHS_HCIVERSION_HCIVERSION_SHIFT)) & USBHS_HCIVERSION_HCIVERSION_MASK) -/*! @} */ - -/*! @name HCSPARAMS - Host Controller Structural Parameters */ -/*! @{ */ - -#define USBHS_HCSPARAMS_N_PORTS_MASK (0xFU) -#define USBHS_HCSPARAMS_N_PORTS_SHIFT (0U) -/*! N_PORTS - Number of Downstream Ports */ -#define USBHS_HCSPARAMS_N_PORTS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCSPARAMS_N_PORTS_SHIFT)) & USBHS_HCSPARAMS_N_PORTS_MASK) - -#define USBHS_HCSPARAMS_PPC_MASK (0x10U) -#define USBHS_HCSPARAMS_PPC_SHIFT (4U) -/*! PPC - Port Power Control */ -#define USBHS_HCSPARAMS_PPC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCSPARAMS_PPC_SHIFT)) & USBHS_HCSPARAMS_PPC_MASK) - -#define USBHS_HCSPARAMS_N_PCC_MASK (0xF00U) -#define USBHS_HCSPARAMS_N_PCC_SHIFT (8U) -/*! N_PCC - Number of Ports per Companion Controller */ -#define USBHS_HCSPARAMS_N_PCC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCSPARAMS_N_PCC_SHIFT)) & USBHS_HCSPARAMS_N_PCC_MASK) - -#define USBHS_HCSPARAMS_N_CC_MASK (0xF000U) -#define USBHS_HCSPARAMS_N_CC_SHIFT (12U) -/*! N_CC - Number of Companion Controller - * 0b0000..There is no internal Companion Controller and port-ownership hand-off is not supported - * 0b0001..There are internal companion controller(s) and port-ownership hand-offs is supported - */ -#define USBHS_HCSPARAMS_N_CC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCSPARAMS_N_CC_SHIFT)) & USBHS_HCSPARAMS_N_CC_MASK) - -#define USBHS_HCSPARAMS_PI_MASK (0x10000U) -#define USBHS_HCSPARAMS_PI_SHIFT (16U) -/*! PI - Port Indicators (P INDICATOR) */ -#define USBHS_HCSPARAMS_PI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCSPARAMS_PI_SHIFT)) & USBHS_HCSPARAMS_PI_MASK) - -#define USBHS_HCSPARAMS_N_PTT_MASK (0xF00000U) -#define USBHS_HCSPARAMS_N_PTT_SHIFT (20U) -/*! N_PTT - Number of Ports per Transaction Translator */ -#define USBHS_HCSPARAMS_N_PTT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCSPARAMS_N_PTT_SHIFT)) & USBHS_HCSPARAMS_N_PTT_MASK) - -#define USBHS_HCSPARAMS_N_TT_MASK (0xF000000U) -#define USBHS_HCSPARAMS_N_TT_SHIFT (24U) -/*! N_TT - Number of Transaction Translators */ -#define USBHS_HCSPARAMS_N_TT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCSPARAMS_N_TT_SHIFT)) & USBHS_HCSPARAMS_N_TT_MASK) -/*! @} */ - -/*! @name HCCPARAMS - Host Controller Capability Parameters */ -/*! @{ */ - -#define USBHS_HCCPARAMS_ADC_MASK (0x1U) -#define USBHS_HCCPARAMS_ADC_SHIFT (0U) -/*! ADC - 64-bit Addressing Capability */ -#define USBHS_HCCPARAMS_ADC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCCPARAMS_ADC_SHIFT)) & USBHS_HCCPARAMS_ADC_MASK) - -#define USBHS_HCCPARAMS_PFL_MASK (0x2U) -#define USBHS_HCCPARAMS_PFL_SHIFT (1U) -/*! PFL - Programmable Frame List Flag */ -#define USBHS_HCCPARAMS_PFL(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCCPARAMS_PFL_SHIFT)) & USBHS_HCCPARAMS_PFL_MASK) - -#define USBHS_HCCPARAMS_ASP_MASK (0x4U) -#define USBHS_HCCPARAMS_ASP_SHIFT (2U) -/*! ASP - Asynchronous Schedule Park Capability */ -#define USBHS_HCCPARAMS_ASP(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCCPARAMS_ASP_SHIFT)) & USBHS_HCCPARAMS_ASP_MASK) - -#define USBHS_HCCPARAMS_IST_MASK (0xF0U) -#define USBHS_HCCPARAMS_IST_SHIFT (4U) -/*! IST - Isochronous Scheduling Threshold */ -#define USBHS_HCCPARAMS_IST(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCCPARAMS_IST_SHIFT)) & USBHS_HCCPARAMS_IST_MASK) - -#define USBHS_HCCPARAMS_EECP_MASK (0xFF00U) -#define USBHS_HCCPARAMS_EECP_SHIFT (8U) -/*! EECP - EHCI Extended Capabilities Pointer */ -#define USBHS_HCCPARAMS_EECP(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCCPARAMS_EECP_SHIFT)) & USBHS_HCCPARAMS_EECP_MASK) -/*! @} */ - -/*! @name DCIVERSION - Device Controller Interface Version */ -/*! @{ */ - -#define USBHS_DCIVERSION_DCIVERSION_MASK (0xFFFFU) -#define USBHS_DCIVERSION_DCIVERSION_SHIFT (0U) -/*! DCIVERSION - Device Controller Interface Version Number */ -#define USBHS_DCIVERSION_DCIVERSION(x) (((uint16_t)(((uint16_t)(x)) << USBHS_DCIVERSION_DCIVERSION_SHIFT)) & USBHS_DCIVERSION_DCIVERSION_MASK) -/*! @} */ - -/*! @name DCCPARAMS - Device Controller Capability Parameters */ -/*! @{ */ - -#define USBHS_DCCPARAMS_DEN_MASK (0x1FU) -#define USBHS_DCCPARAMS_DEN_SHIFT (0U) -/*! DEN - Device Endpoint Number */ -#define USBHS_DCCPARAMS_DEN(x) (((uint32_t)(((uint32_t)(x)) << USBHS_DCCPARAMS_DEN_SHIFT)) & USBHS_DCCPARAMS_DEN_MASK) - -#define USBHS_DCCPARAMS_DC_MASK (0x80U) -#define USBHS_DCCPARAMS_DC_SHIFT (7U) -/*! DC - Device Capable */ -#define USBHS_DCCPARAMS_DC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_DCCPARAMS_DC_SHIFT)) & USBHS_DCCPARAMS_DC_MASK) - -#define USBHS_DCCPARAMS_HC_MASK (0x100U) -#define USBHS_DCCPARAMS_HC_SHIFT (8U) -/*! HC - Host Capable */ -#define USBHS_DCCPARAMS_HC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_DCCPARAMS_HC_SHIFT)) & USBHS_DCCPARAMS_HC_MASK) -/*! @} */ - -/*! @name USBCMD - USB Command */ -/*! @{ */ - -#define USBHS_USBCMD_RS_MASK (0x1U) -#define USBHS_USBCMD_RS_SHIFT (0U) -/*! RS - Run/Stop - * 0b0..Stop - * 0b1..Run - */ -#define USBHS_USBCMD_RS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_RS_SHIFT)) & USBHS_USBCMD_RS_MASK) - -#define USBHS_USBCMD_RST_MASK (0x2U) -#define USBHS_USBCMD_RST_SHIFT (1U) -/*! RST - Controller Reset */ -#define USBHS_USBCMD_RST(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_RST_SHIFT)) & USBHS_USBCMD_RST_MASK) - -#define USBHS_USBCMD_FS_1_MASK (0xCU) -#define USBHS_USBCMD_FS_1_SHIFT (2U) -/*! FS_1 - Frame List Size */ -#define USBHS_USBCMD_FS_1(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_FS_1_SHIFT)) & USBHS_USBCMD_FS_1_MASK) - -#define USBHS_USBCMD_PSE_MASK (0x10U) -#define USBHS_USBCMD_PSE_SHIFT (4U) -/*! PSE - Periodic Schedule Enable - * 0b0..Do not process the Periodic Schedule - * 0b1..Use the PERIODICLISTBASE register to access the Periodic Schedule - */ -#define USBHS_USBCMD_PSE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_PSE_SHIFT)) & USBHS_USBCMD_PSE_MASK) - -#define USBHS_USBCMD_ASE_MASK (0x20U) -#define USBHS_USBCMD_ASE_SHIFT (5U) -/*! ASE - Asynchronous Schedule Enable - * 0b0..Do not process the Asynchronous Schedule - * 0b1..Use the ASYNCLISTADDR register to access the Asynchronous Schedule - */ -#define USBHS_USBCMD_ASE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_ASE_SHIFT)) & USBHS_USBCMD_ASE_MASK) - -#define USBHS_USBCMD_IAA_MASK (0x40U) -#define USBHS_USBCMD_IAA_SHIFT (6U) -/*! IAA - Interrupt on Async Advance Doorbell */ -#define USBHS_USBCMD_IAA(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_IAA_SHIFT)) & USBHS_USBCMD_IAA_MASK) - -#define USBHS_USBCMD_ASP_MASK (0x300U) -#define USBHS_USBCMD_ASP_SHIFT (8U) -/*! ASP - Asynchronous Schedule Park Mode Count */ -#define USBHS_USBCMD_ASP(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_ASP_SHIFT)) & USBHS_USBCMD_ASP_MASK) - -#define USBHS_USBCMD_ASPE_MASK (0x800U) -#define USBHS_USBCMD_ASPE_SHIFT (11U) -/*! ASPE - Asynchronous Schedule Park Mode Enable */ -#define USBHS_USBCMD_ASPE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_ASPE_SHIFT)) & USBHS_USBCMD_ASPE_MASK) - -#define USBHS_USBCMD_SUTW_MASK (0x2000U) -#define USBHS_USBCMD_SUTW_SHIFT (13U) -/*! SUTW - Setup TripWire [device mode only] */ -#define USBHS_USBCMD_SUTW(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_SUTW_SHIFT)) & USBHS_USBCMD_SUTW_MASK) - -#define USBHS_USBCMD_ATDTW_MASK (0x4000U) -#define USBHS_USBCMD_ATDTW_SHIFT (14U) -/*! ATDTW - Add dTD TripWire[device mode only] */ -#define USBHS_USBCMD_ATDTW(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_ATDTW_SHIFT)) & USBHS_USBCMD_ATDTW_MASK) - -#define USBHS_USBCMD_FS_2_MASK (0x8000U) -#define USBHS_USBCMD_FS_2_SHIFT (15U) -/*! FS_2 - Frame List Size [host mode only] */ -#define USBHS_USBCMD_FS_2(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_FS_2_SHIFT)) & USBHS_USBCMD_FS_2_MASK) - -#define USBHS_USBCMD_ITC_MASK (0xFF0000U) -#define USBHS_USBCMD_ITC_SHIFT (16U) -/*! ITC - Interrupt Threshold Control - * 0b00000000..Immediate (no threshold) - * 0b00000001..1 micro-frame - * 0b00000010..2 micro-frames - * 0b00000100..4 micro-frames - * 0b00001000..8 micro-frames - * 0b00010000..16 micro-frames - * 0b00100000..32 micro-frames - * 0b01000000..64 micro-frames - */ -#define USBHS_USBCMD_ITC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_ITC_SHIFT)) & USBHS_USBCMD_ITC_MASK) -/*! @} */ - -/*! @name USBSTS - USB Status */ -/*! @{ */ - -#define USBHS_USBSTS_UI_MASK (0x1U) -#define USBHS_USBSTS_UI_SHIFT (0U) -/*! UI - USB Interrupt (USBINT) */ -#define USBHS_USBSTS_UI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_UI_SHIFT)) & USBHS_USBSTS_UI_MASK) - -#define USBHS_USBSTS_UEI_MASK (0x2U) -#define USBHS_USBSTS_UEI_SHIFT (1U) -/*! UEI - USB Error Interrupt (USBERRINT) */ -#define USBHS_USBSTS_UEI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_UEI_SHIFT)) & USBHS_USBSTS_UEI_MASK) - -#define USBHS_USBSTS_PCI_MASK (0x4U) -#define USBHS_USBSTS_PCI_SHIFT (2U) -/*! PCI - Port Change Detect */ -#define USBHS_USBSTS_PCI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_PCI_SHIFT)) & USBHS_USBSTS_PCI_MASK) - -#define USBHS_USBSTS_FRI_MASK (0x8U) -#define USBHS_USBSTS_FRI_SHIFT (3U) -/*! FRI - Frame List Rollover */ -#define USBHS_USBSTS_FRI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_FRI_SHIFT)) & USBHS_USBSTS_FRI_MASK) - -#define USBHS_USBSTS_SEI_MASK (0x10U) -#define USBHS_USBSTS_SEI_SHIFT (4U) -/*! SEI - System Error */ -#define USBHS_USBSTS_SEI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_SEI_SHIFT)) & USBHS_USBSTS_SEI_MASK) - -#define USBHS_USBSTS_AAI_MASK (0x20U) -#define USBHS_USBSTS_AAI_SHIFT (5U) -/*! AAI - Interrupt on Async Advance */ -#define USBHS_USBSTS_AAI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_AAI_SHIFT)) & USBHS_USBSTS_AAI_MASK) - -#define USBHS_USBSTS_URI_MASK (0x40U) -#define USBHS_USBSTS_URI_SHIFT (6U) -/*! URI - USB Reset Received */ -#define USBHS_USBSTS_URI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_URI_SHIFT)) & USBHS_USBSTS_URI_MASK) - -#define USBHS_USBSTS_SRI_MASK (0x80U) -#define USBHS_USBSTS_SRI_SHIFT (7U) -/*! SRI - SOF Received */ -#define USBHS_USBSTS_SRI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_SRI_SHIFT)) & USBHS_USBSTS_SRI_MASK) - -#define USBHS_USBSTS_SLI_MASK (0x100U) -#define USBHS_USBSTS_SLI_SHIFT (8U) -/*! SLI - DCSuspend */ -#define USBHS_USBSTS_SLI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_SLI_SHIFT)) & USBHS_USBSTS_SLI_MASK) - -#define USBHS_USBSTS_ULPII_MASK (0x400U) -#define USBHS_USBSTS_ULPII_SHIFT (10U) -/*! ULPII - ULPI Interrupt */ -#define USBHS_USBSTS_ULPII(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_ULPII_SHIFT)) & USBHS_USBSTS_ULPII_MASK) - -#define USBHS_USBSTS_HCH_MASK (0x1000U) -#define USBHS_USBSTS_HCH_SHIFT (12U) -/*! HCH - HCHaIted */ -#define USBHS_USBSTS_HCH(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_HCH_SHIFT)) & USBHS_USBSTS_HCH_MASK) - -#define USBHS_USBSTS_RCL_MASK (0x2000U) -#define USBHS_USBSTS_RCL_SHIFT (13U) -/*! RCL - Reclamation */ -#define USBHS_USBSTS_RCL(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_RCL_SHIFT)) & USBHS_USBSTS_RCL_MASK) - -#define USBHS_USBSTS_PS_MASK (0x4000U) -#define USBHS_USBSTS_PS_SHIFT (14U) -/*! PS - Periodic Schedule Status */ -#define USBHS_USBSTS_PS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_PS_SHIFT)) & USBHS_USBSTS_PS_MASK) - -#define USBHS_USBSTS_AS_MASK (0x8000U) -#define USBHS_USBSTS_AS_SHIFT (15U) -/*! AS - Asynchronous Schedule Status */ -#define USBHS_USBSTS_AS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_AS_SHIFT)) & USBHS_USBSTS_AS_MASK) - -#define USBHS_USBSTS_NAKI_MASK (0x10000U) -#define USBHS_USBSTS_NAKI_SHIFT (16U) -/*! NAKI - NAK Interrupt Bit */ -#define USBHS_USBSTS_NAKI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_NAKI_SHIFT)) & USBHS_USBSTS_NAKI_MASK) - -#define USBHS_USBSTS_TI0_MASK (0x1000000U) -#define USBHS_USBSTS_TI0_SHIFT (24U) -/*! TI0 - General Purpose Timer Interrupt 0 (GPTINT0) */ -#define USBHS_USBSTS_TI0(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_TI0_SHIFT)) & USBHS_USBSTS_TI0_MASK) - -#define USBHS_USBSTS_TI1_MASK (0x2000000U) -#define USBHS_USBSTS_TI1_SHIFT (25U) -/*! TI1 - General Purpose Timer Interrupt 1 (GPTINT1) */ -#define USBHS_USBSTS_TI1(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_TI1_SHIFT)) & USBHS_USBSTS_TI1_MASK) -/*! @} */ - -/*! @name USBINTR - Interrupt Enable */ -/*! @{ */ - -#define USBHS_USBINTR_UE_MASK (0x1U) -#define USBHS_USBINTR_UE_SHIFT (0U) -/*! UE - USB Interrupt Enable */ -#define USBHS_USBINTR_UE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_UE_SHIFT)) & USBHS_USBINTR_UE_MASK) - -#define USBHS_USBINTR_UEE_MASK (0x2U) -#define USBHS_USBINTR_UEE_SHIFT (1U) -/*! UEE - USB Error Interrupt Enable */ -#define USBHS_USBINTR_UEE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_UEE_SHIFT)) & USBHS_USBINTR_UEE_MASK) - -#define USBHS_USBINTR_PCE_MASK (0x4U) -#define USBHS_USBINTR_PCE_SHIFT (2U) -/*! PCE - Port Change Detect Interrupt Enable */ -#define USBHS_USBINTR_PCE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_PCE_SHIFT)) & USBHS_USBINTR_PCE_MASK) - -#define USBHS_USBINTR_FRE_MASK (0x8U) -#define USBHS_USBINTR_FRE_SHIFT (3U) -/*! FRE - Frame List Rollover Interrupt Enable */ -#define USBHS_USBINTR_FRE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_FRE_SHIFT)) & USBHS_USBINTR_FRE_MASK) - -#define USBHS_USBINTR_SEE_MASK (0x10U) -#define USBHS_USBINTR_SEE_SHIFT (4U) -/*! SEE - System Error Interrupt Enable */ -#define USBHS_USBINTR_SEE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_SEE_SHIFT)) & USBHS_USBINTR_SEE_MASK) - -#define USBHS_USBINTR_AAE_MASK (0x20U) -#define USBHS_USBINTR_AAE_SHIFT (5U) -/*! AAE - Async Advance Interrupt Enable */ -#define USBHS_USBINTR_AAE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_AAE_SHIFT)) & USBHS_USBINTR_AAE_MASK) - -#define USBHS_USBINTR_URE_MASK (0x40U) -#define USBHS_USBINTR_URE_SHIFT (6U) -/*! URE - USB Reset Interrupt Enable */ -#define USBHS_USBINTR_URE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_URE_SHIFT)) & USBHS_USBINTR_URE_MASK) - -#define USBHS_USBINTR_SRE_MASK (0x80U) -#define USBHS_USBINTR_SRE_SHIFT (7U) -/*! SRE - SOF Received Interrupt Enable */ -#define USBHS_USBINTR_SRE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_SRE_SHIFT)) & USBHS_USBINTR_SRE_MASK) - -#define USBHS_USBINTR_SLE_MASK (0x100U) -#define USBHS_USBINTR_SLE_SHIFT (8U) -/*! SLE - Sleep Interrupt Enable */ -#define USBHS_USBINTR_SLE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_SLE_SHIFT)) & USBHS_USBINTR_SLE_MASK) - -#define USBHS_USBINTR_NAKE_MASK (0x10000U) -#define USBHS_USBINTR_NAKE_SHIFT (16U) -/*! NAKE - NAK Interrupt Enable */ -#define USBHS_USBINTR_NAKE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_NAKE_SHIFT)) & USBHS_USBINTR_NAKE_MASK) - -#define USBHS_USBINTR_UAIE_MASK (0x40000U) -#define USBHS_USBINTR_UAIE_SHIFT (18U) -/*! UAIE - USB Host Asynchronous Interrupt Enable */ -#define USBHS_USBINTR_UAIE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_UAIE_SHIFT)) & USBHS_USBINTR_UAIE_MASK) - -#define USBHS_USBINTR_UPIE_MASK (0x80000U) -#define USBHS_USBINTR_UPIE_SHIFT (19U) -/*! UPIE - USB Host Periodic Interrupt Enable */ -#define USBHS_USBINTR_UPIE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_UPIE_SHIFT)) & USBHS_USBINTR_UPIE_MASK) - -#define USBHS_USBINTR_TIE0_MASK (0x1000000U) -#define USBHS_USBINTR_TIE0_SHIFT (24U) -/*! TIE0 - General Purpose Timer #0 Interrupt Enable */ -#define USBHS_USBINTR_TIE0(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_TIE0_SHIFT)) & USBHS_USBINTR_TIE0_MASK) - -#define USBHS_USBINTR_TIE1_MASK (0x2000000U) -#define USBHS_USBINTR_TIE1_SHIFT (25U) -/*! TIE1 - General Purpose Timer #1 Interrupt Enable */ -#define USBHS_USBINTR_TIE1(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_TIE1_SHIFT)) & USBHS_USBINTR_TIE1_MASK) -/*! @} */ - -/*! @name FRINDEX - USB Frame Index */ -/*! @{ */ - -#define USBHS_FRINDEX_FRINDEX_MASK (0x3FFFU) -#define USBHS_FRINDEX_FRINDEX_SHIFT (0U) -/*! FRINDEX - Frame Index - * 0b00000000000000..(1024) 12 - * 0b00000000000001..(512) 11 - * 0b00000000000010..(256) 10 - * 0b00000000000011..(128) 9 - * 0b00000000000100..(64) 8 - * 0b00000000000101..(32) 7 - * 0b00000000000110..(16) 6 - * 0b00000000000111..(8) 5 - */ -#define USBHS_FRINDEX_FRINDEX(x) (((uint32_t)(((uint32_t)(x)) << USBHS_FRINDEX_FRINDEX_SHIFT)) & USBHS_FRINDEX_FRINDEX_MASK) -/*! @} */ - -/*! @name DEVICEADDR - Device Address */ -/*! @{ */ - -#define USBHS_DEVICEADDR_USBADRA_MASK (0x1000000U) -#define USBHS_DEVICEADDR_USBADRA_SHIFT (24U) -/*! USBADRA - Device Address Advance */ -#define USBHS_DEVICEADDR_USBADRA(x) (((uint32_t)(((uint32_t)(x)) << USBHS_DEVICEADDR_USBADRA_SHIFT)) & USBHS_DEVICEADDR_USBADRA_MASK) - -#define USBHS_DEVICEADDR_USBADR_MASK (0xFE000000U) -#define USBHS_DEVICEADDR_USBADR_SHIFT (25U) -/*! USBADR - Device Address */ -#define USBHS_DEVICEADDR_USBADR(x) (((uint32_t)(((uint32_t)(x)) << USBHS_DEVICEADDR_USBADR_SHIFT)) & USBHS_DEVICEADDR_USBADR_MASK) -/*! @} */ - -/*! @name PERIODICLISTBASE - Frame List Base Address */ -/*! @{ */ - -#define USBHS_PERIODICLISTBASE_BASEADR_MASK (0xFFFFF000U) -#define USBHS_PERIODICLISTBASE_BASEADR_SHIFT (12U) -/*! BASEADR - Base Address (Low) */ -#define USBHS_PERIODICLISTBASE_BASEADR(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PERIODICLISTBASE_BASEADR_SHIFT)) & USBHS_PERIODICLISTBASE_BASEADR_MASK) -/*! @} */ - -/*! @name ASYNCLISTADDR - Next Asynch. Address */ -/*! @{ */ - -#define USBHS_ASYNCLISTADDR_ASYBASE_MASK (0xFFFFFFE0U) -#define USBHS_ASYNCLISTADDR_ASYBASE_SHIFT (5U) -/*! ASYBASE - Link Pointer Low (LPL) */ -#define USBHS_ASYNCLISTADDR_ASYBASE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ASYNCLISTADDR_ASYBASE_SHIFT)) & USBHS_ASYNCLISTADDR_ASYBASE_MASK) -/*! @} */ - -/*! @name ENDPTLISTADDR - Endpoint List Address */ -/*! @{ */ - -#define USBHS_ENDPTLISTADDR_EPBASE_MASK (0xFFFFF800U) -#define USBHS_ENDPTLISTADDR_EPBASE_SHIFT (11U) -/*! EPBASE - Endpoint List Pointer (Low) */ -#define USBHS_ENDPTLISTADDR_EPBASE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTLISTADDR_EPBASE_SHIFT)) & USBHS_ENDPTLISTADDR_EPBASE_MASK) -/*! @} */ - -/*! @name BURSTSIZE - Programmable Burst Size */ -/*! @{ */ - -#define USBHS_BURSTSIZE_RXPBURST_MASK (0xFFU) -#define USBHS_BURSTSIZE_RXPBURST_SHIFT (0U) -/*! RXPBURST - Programmable RX Burst Size */ -#define USBHS_BURSTSIZE_RXPBURST(x) (((uint32_t)(((uint32_t)(x)) << USBHS_BURSTSIZE_RXPBURST_SHIFT)) & USBHS_BURSTSIZE_RXPBURST_MASK) - -#define USBHS_BURSTSIZE_TXPBURST_MASK (0xFF00U) -#define USBHS_BURSTSIZE_TXPBURST_SHIFT (8U) -/*! TXPBURST - Programmable TX Burst Size */ -#define USBHS_BURSTSIZE_TXPBURST(x) (((uint32_t)(((uint32_t)(x)) << USBHS_BURSTSIZE_TXPBURST_SHIFT)) & USBHS_BURSTSIZE_TXPBURST_MASK) -/*! @} */ - -/*! @name TXFILLTUNING - TX FIFO Fill Tuning */ -/*! @{ */ - -#define USBHS_TXFILLTUNING_TXSCHOH_MASK (0x7FU) -#define USBHS_TXFILLTUNING_TXSCHOH_SHIFT (0U) -/*! TXSCHOH - Scheduler Overhead */ -#define USBHS_TXFILLTUNING_TXSCHOH(x) (((uint32_t)(((uint32_t)(x)) << USBHS_TXFILLTUNING_TXSCHOH_SHIFT)) & USBHS_TXFILLTUNING_TXSCHOH_MASK) - -#define USBHS_TXFILLTUNING_TXSCHHEALTH_MASK (0x1F00U) -#define USBHS_TXFILLTUNING_TXSCHHEALTH_SHIFT (8U) -/*! TXSCHHEALTH - Scheduler Health Counter */ -#define USBHS_TXFILLTUNING_TXSCHHEALTH(x) (((uint32_t)(((uint32_t)(x)) << USBHS_TXFILLTUNING_TXSCHHEALTH_SHIFT)) & USBHS_TXFILLTUNING_TXSCHHEALTH_MASK) - -#define USBHS_TXFILLTUNING_TXFIFOTHRES_MASK (0x3F0000U) -#define USBHS_TXFILLTUNING_TXFIFOTHRES_SHIFT (16U) -/*! TXFIFOTHRES - FIFO Burst Threshold */ -#define USBHS_TXFILLTUNING_TXFIFOTHRES(x) (((uint32_t)(((uint32_t)(x)) << USBHS_TXFILLTUNING_TXFIFOTHRES_SHIFT)) & USBHS_TXFILLTUNING_TXFIFOTHRES_MASK) -/*! @} */ - -/*! @name ENDPTNAK - Endpoint NAK */ -/*! @{ */ - -#define USBHS_ENDPTNAK_EPRN_MASK (0xFFU) -#define USBHS_ENDPTNAK_EPRN_SHIFT (0U) -/*! EPRN - RX Endpoint NAK */ -#define USBHS_ENDPTNAK_EPRN(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTNAK_EPRN_SHIFT)) & USBHS_ENDPTNAK_EPRN_MASK) - -#define USBHS_ENDPTNAK_EPTN_MASK (0xFF0000U) -#define USBHS_ENDPTNAK_EPTN_SHIFT (16U) -/*! EPTN - TX Endpoint NAK */ -#define USBHS_ENDPTNAK_EPTN(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTNAK_EPTN_SHIFT)) & USBHS_ENDPTNAK_EPTN_MASK) -/*! @} */ - -/*! @name ENDPTNAKEN - Endpoint NAK Enable */ -/*! @{ */ - -#define USBHS_ENDPTNAKEN_EPRNE_MASK (0xFFU) -#define USBHS_ENDPTNAKEN_EPRNE_SHIFT (0U) -/*! EPRNE - RX Endpoint NAK Enable */ -#define USBHS_ENDPTNAKEN_EPRNE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTNAKEN_EPRNE_SHIFT)) & USBHS_ENDPTNAKEN_EPRNE_MASK) - -#define USBHS_ENDPTNAKEN_EPTNE_MASK (0xFF0000U) -#define USBHS_ENDPTNAKEN_EPTNE_SHIFT (16U) -/*! EPTNE - TX Endpoint NAK Enable */ -#define USBHS_ENDPTNAKEN_EPTNE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTNAKEN_EPTNE_SHIFT)) & USBHS_ENDPTNAKEN_EPTNE_MASK) -/*! @} */ - -/*! @name CONFIGFLAG - Configure Flag */ -/*! @{ */ - -#define USBHS_CONFIGFLAG_CF_MASK (0x1U) -#define USBHS_CONFIGFLAG_CF_SHIFT (0U) -/*! CF - Configure Flag - * 0b0..Port routing control logic default-routes each port to an implementation dependent classic host controller - * 0b1..Port routing control logic default-routes all ports to this host controller - */ -#define USBHS_CONFIGFLAG_CF(x) (((uint32_t)(((uint32_t)(x)) << USBHS_CONFIGFLAG_CF_SHIFT)) & USBHS_CONFIGFLAG_CF_MASK) -/*! @} */ - -/*! @name PORTSC1 - Port Status & Control */ -/*! @{ */ - -#define USBHS_PORTSC1_CCS_MASK (0x1U) -#define USBHS_PORTSC1_CCS_SHIFT (0U) -/*! CCS - Current Connect Status - * 0b0..In Host mode: No device is present. In Device mode: Not attached - * 0b1..In Host mode: Device is present on port. In Device mode: Attached - */ -#define USBHS_PORTSC1_CCS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_CCS_SHIFT)) & USBHS_PORTSC1_CCS_MASK) - -#define USBHS_PORTSC1_CSC_MASK (0x2U) -#define USBHS_PORTSC1_CSC_SHIFT (1U) -/*! CSC - Connect Status Change - * 0b0..No change - * 0b1..Change in current connect status - */ -#define USBHS_PORTSC1_CSC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_CSC_SHIFT)) & USBHS_PORTSC1_CSC_MASK) - -#define USBHS_PORTSC1_PE_MASK (0x4U) -#define USBHS_PORTSC1_PE_SHIFT (2U) -/*! PE - Port Enabled/Disabled - * 0b0..Disable - * 0b1..Enable - */ -#define USBHS_PORTSC1_PE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PE_SHIFT)) & USBHS_PORTSC1_PE_MASK) - -#define USBHS_PORTSC1_PEC_MASK (0x8U) -#define USBHS_PORTSC1_PEC_SHIFT (3U) -/*! PEC - Port Enable/Disable Change - * 0b0..No change - * 0b1..Port enabled/disabled status has changed - */ -#define USBHS_PORTSC1_PEC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PEC_SHIFT)) & USBHS_PORTSC1_PEC_MASK) - -#define USBHS_PORTSC1_OCA_MASK (0x10U) -#define USBHS_PORTSC1_OCA_SHIFT (4U) -/*! OCA - Over-Current Active - * 0b1..This port currently has an over-current condition - * 0b0..This port does not have an over-current condition - */ -#define USBHS_PORTSC1_OCA(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_OCA_SHIFT)) & USBHS_PORTSC1_OCA_MASK) - -#define USBHS_PORTSC1_OCC_MASK (0x20U) -#define USBHS_PORTSC1_OCC_SHIFT (5U) -/*! OCC - Over-current Change */ -#define USBHS_PORTSC1_OCC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_OCC_SHIFT)) & USBHS_PORTSC1_OCC_MASK) - -#define USBHS_PORTSC1_FPR_MASK (0x40U) -#define USBHS_PORTSC1_FPR_SHIFT (6U) -/*! FPR - Force Port Resume - * 0b0..No resume (K-state) detected/driven on port - * 0b1..Resume detected/driven on port - */ -#define USBHS_PORTSC1_FPR(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_FPR_SHIFT)) & USBHS_PORTSC1_FPR_MASK) - -#define USBHS_PORTSC1_SUSP_MASK (0x80U) -#define USBHS_PORTSC1_SUSP_SHIFT (7U) -/*! SUSP - Suspend - * 0b0..Port not in suspend state - * 0b1..Port in suspend state - */ -#define USBHS_PORTSC1_SUSP(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_SUSP_SHIFT)) & USBHS_PORTSC1_SUSP_MASK) - -#define USBHS_PORTSC1_PR_MASK (0x100U) -#define USBHS_PORTSC1_PR_SHIFT (8U) -/*! PR - Port Reset - * 0b0..Port is not in reset - * 0b1..Port is in reset - */ -#define USBHS_PORTSC1_PR(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PR_SHIFT)) & USBHS_PORTSC1_PR_MASK) - -#define USBHS_PORTSC1_HSP_MASK (0x200U) -#define USBHS_PORTSC1_HSP_SHIFT (9U) -/*! HSP - High-Speed Port */ -#define USBHS_PORTSC1_HSP(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_HSP_SHIFT)) & USBHS_PORTSC1_HSP_MASK) - -#define USBHS_PORTSC1_LS_MASK (0xC00U) -#define USBHS_PORTSC1_LS_SHIFT (10U) -/*! LS - Line Status - * 0b00..SE0 - * 0b10..J-state - * 0b01..K-state - * 0b11..Undefined - */ -#define USBHS_PORTSC1_LS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_LS_SHIFT)) & USBHS_PORTSC1_LS_MASK) - -#define USBHS_PORTSC1_PP_MASK (0x1000U) -#define USBHS_PORTSC1_PP_SHIFT (12U) -/*! PP - Port Power */ -#define USBHS_PORTSC1_PP(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PP_SHIFT)) & USBHS_PORTSC1_PP_MASK) - -#define USBHS_PORTSC1_PO_MASK (0x2000U) -#define USBHS_PORTSC1_PO_SHIFT (13U) -/*! PO - Port Owner */ -#define USBHS_PORTSC1_PO(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PO_SHIFT)) & USBHS_PORTSC1_PO_MASK) - -#define USBHS_PORTSC1_PIC_MASK (0xC000U) -#define USBHS_PORTSC1_PIC_SHIFT (14U) -/*! PIC - Port Indicator Control - * 0b00..Port indicators are off - * 0b01..Amber - * 0b10..Green - * 0b11..Undefined - */ -#define USBHS_PORTSC1_PIC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PIC_SHIFT)) & USBHS_PORTSC1_PIC_MASK) - -#define USBHS_PORTSC1_PTC_MASK (0xF0000U) -#define USBHS_PORTSC1_PTC_SHIFT (16U) -/*! PTC - Port Test Control - * 0b0000..TEST_MODE_DISABLE - * 0b0001..J_STATE - * 0b0010..K_STATE - * 0b0011..SE0 (host) / NAK (device) - * 0b0100..Packet - * 0b0101..FORCE_ENABLE_HS - * 0b0110..FORCE_ENABLE_FS - * 0b0111..FORCE_ENABLE_LS - * 0b1000-0b1111..Reserved - */ -#define USBHS_PORTSC1_PTC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PTC_SHIFT)) & USBHS_PORTSC1_PTC_MASK) - -#define USBHS_PORTSC1_WKCN_MASK (0x100000U) -#define USBHS_PORTSC1_WKCN_SHIFT (20U) -/*! WKCN - Wake on Connect Enable (WKCNNT_E) */ -#define USBHS_PORTSC1_WKCN(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_WKCN_SHIFT)) & USBHS_PORTSC1_WKCN_MASK) - -#define USBHS_PORTSC1_WKDC_MASK (0x200000U) -#define USBHS_PORTSC1_WKDC_SHIFT (21U) -/*! WKDC - Wake on Disconnect Enable (WKDSCNNT_E) */ -#define USBHS_PORTSC1_WKDC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_WKDC_SHIFT)) & USBHS_PORTSC1_WKDC_MASK) - -#define USBHS_PORTSC1_WKOC_MASK (0x400000U) -#define USBHS_PORTSC1_WKOC_SHIFT (22U) -/*! WKOC - Wake on Over-current Enable (WKOC_E) */ -#define USBHS_PORTSC1_WKOC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_WKOC_SHIFT)) & USBHS_PORTSC1_WKOC_MASK) - -#define USBHS_PORTSC1_PHCD_MASK (0x800000U) -#define USBHS_PORTSC1_PHCD_SHIFT (23U) -/*! PHCD - PHY Low Power Suspend - Clock Disable (PLPSCD) - * 0b1..Disable PHY clock - * 0b0..Enable PHY clock - */ -#define USBHS_PORTSC1_PHCD(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PHCD_SHIFT)) & USBHS_PORTSC1_PHCD_MASK) - -#define USBHS_PORTSC1_PFSC_MASK (0x1000000U) -#define USBHS_PORTSC1_PFSC_SHIFT (24U) -/*! PFSC - Port Force Full Speed Connect - * 0b1..Forced to full speed - * 0b0..Normal operation - */ -#define USBHS_PORTSC1_PFSC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PFSC_SHIFT)) & USBHS_PORTSC1_PFSC_MASK) - -#define USBHS_PORTSC1_PTS_2_MASK (0x2000000U) -#define USBHS_PORTSC1_PTS_2_SHIFT (25U) -/*! PTS_2 - Parallel Transceiver Select */ -#define USBHS_PORTSC1_PTS_2(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PTS_2_SHIFT)) & USBHS_PORTSC1_PTS_2_MASK) - -#define USBHS_PORTSC1_PSPD_MASK (0xC000000U) -#define USBHS_PORTSC1_PSPD_SHIFT (26U) -/*! PSPD - Port Speed - * 0b00..Full Speed - * 0b01..Low Speed - * 0b10..High Speed - * 0b11..Undefined - */ -#define USBHS_PORTSC1_PSPD(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PSPD_SHIFT)) & USBHS_PORTSC1_PSPD_MASK) - -#define USBHS_PORTSC1_PTW_MASK (0x10000000U) -#define USBHS_PORTSC1_PTW_SHIFT (28U) -/*! PTW - Parallel Transceiver Width - Read/Write - * 0b0..Select the 8-bit UTMI interface [60 MHz] - * 0b1..Select the 16-bit UTMI interface [30 MHz] - */ -#define USBHS_PORTSC1_PTW(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PTW_SHIFT)) & USBHS_PORTSC1_PTW_MASK) - -#define USBHS_PORTSC1_STS_MASK (0x20000000U) -#define USBHS_PORTSC1_STS_SHIFT (29U) -/*! STS - Serial Transceiver Select - * 0b0..Parallel Interface signals is selected - * 0b1..Serial Interface Engine is selected - */ -#define USBHS_PORTSC1_STS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_STS_SHIFT)) & USBHS_PORTSC1_STS_MASK) - -#define USBHS_PORTSC1_PTS_1_MASK (0xC0000000U) -#define USBHS_PORTSC1_PTS_1_SHIFT (30U) -/*! PTS_1 - Parallel Transceiver Select */ -#define USBHS_PORTSC1_PTS_1(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PTS_1_SHIFT)) & USBHS_PORTSC1_PTS_1_MASK) -/*! @} */ - -/*! @name OTGSC - On-The-Go Status & Control */ -/*! @{ */ - -#define USBHS_OTGSC_VD_MASK (0x1U) -#define USBHS_OTGSC_VD_SHIFT (0U) -/*! VD - VBUS Discharge */ -#define USBHS_OTGSC_VD(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_VD_SHIFT)) & USBHS_OTGSC_VD_MASK) - -#define USBHS_OTGSC_VC_MASK (0x2U) -#define USBHS_OTGSC_VC_SHIFT (1U) -/*! VC - VBUS Charge */ -#define USBHS_OTGSC_VC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_VC_SHIFT)) & USBHS_OTGSC_VC_MASK) - -#define USBHS_OTGSC_OT_MASK (0x8U) -#define USBHS_OTGSC_OT_SHIFT (3U) -/*! OT - OTG Termination */ -#define USBHS_OTGSC_OT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_OT_SHIFT)) & USBHS_OTGSC_OT_MASK) - -#define USBHS_OTGSC_DP_MASK (0x10U) -#define USBHS_OTGSC_DP_SHIFT (4U) -/*! DP - Data Pulsing */ -#define USBHS_OTGSC_DP(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_DP_SHIFT)) & USBHS_OTGSC_DP_MASK) - -#define USBHS_OTGSC_IDPU_MASK (0x20U) -#define USBHS_OTGSC_IDPU_SHIFT (5U) -/*! IDPU - ID Pullup - * 0b0..Off - * 0b1..On - */ -#define USBHS_OTGSC_IDPU(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_IDPU_SHIFT)) & USBHS_OTGSC_IDPU_MASK) - -#define USBHS_OTGSC_ID_MASK (0x100U) -#define USBHS_OTGSC_ID_SHIFT (8U) -/*! ID - USB ID - * 0b0..A device - * 0b1..B device - */ -#define USBHS_OTGSC_ID(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_ID_SHIFT)) & USBHS_OTGSC_ID_MASK) - -#define USBHS_OTGSC_AVV_MASK (0x200U) -#define USBHS_OTGSC_AVV_SHIFT (9U) -/*! AVV - A VBus Valid */ -#define USBHS_OTGSC_AVV(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_AVV_SHIFT)) & USBHS_OTGSC_AVV_MASK) - -#define USBHS_OTGSC_ASV_MASK (0x400U) -#define USBHS_OTGSC_ASV_SHIFT (10U) -/*! ASV - A Session Valid */ -#define USBHS_OTGSC_ASV(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_ASV_SHIFT)) & USBHS_OTGSC_ASV_MASK) - -#define USBHS_OTGSC_BSV_MASK (0x800U) -#define USBHS_OTGSC_BSV_SHIFT (11U) -/*! BSV - B Session Valid */ -#define USBHS_OTGSC_BSV(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_BSV_SHIFT)) & USBHS_OTGSC_BSV_MASK) - -#define USBHS_OTGSC_BSE_MASK (0x1000U) -#define USBHS_OTGSC_BSE_SHIFT (12U) -/*! BSE - B Session End */ -#define USBHS_OTGSC_BSE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_BSE_SHIFT)) & USBHS_OTGSC_BSE_MASK) - -#define USBHS_OTGSC_TOG_1MS_MASK (0x2000U) -#define USBHS_OTGSC_TOG_1MS_SHIFT (13U) -/*! TOG_1MS - 1 Millisecond Timer Toggle */ -#define USBHS_OTGSC_TOG_1MS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_TOG_1MS_SHIFT)) & USBHS_OTGSC_TOG_1MS_MASK) - -#define USBHS_OTGSC_DPS_MASK (0x4000U) -#define USBHS_OTGSC_DPS_SHIFT (14U) -/*! DPS - Data Bus Pulsing Status */ -#define USBHS_OTGSC_DPS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_DPS_SHIFT)) & USBHS_OTGSC_DPS_MASK) - -#define USBHS_OTGSC_IDIS_MASK (0x10000U) -#define USBHS_OTGSC_IDIS_SHIFT (16U) -/*! IDIS - USB ID Interrupt Status */ -#define USBHS_OTGSC_IDIS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_IDIS_SHIFT)) & USBHS_OTGSC_IDIS_MASK) - -#define USBHS_OTGSC_AVVIS_MASK (0x20000U) -#define USBHS_OTGSC_AVVIS_SHIFT (17U) -/*! AVVIS - A VBus Valid Interrupt Status */ -#define USBHS_OTGSC_AVVIS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_AVVIS_SHIFT)) & USBHS_OTGSC_AVVIS_MASK) - -#define USBHS_OTGSC_ASVIS_MASK (0x40000U) -#define USBHS_OTGSC_ASVIS_SHIFT (18U) -/*! ASVIS - A Session Valid Interrupt Status */ -#define USBHS_OTGSC_ASVIS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_ASVIS_SHIFT)) & USBHS_OTGSC_ASVIS_MASK) - -#define USBHS_OTGSC_BSVIS_MASK (0x80000U) -#define USBHS_OTGSC_BSVIS_SHIFT (19U) -/*! BSVIS - B Session Valid Interrupt Status */ -#define USBHS_OTGSC_BSVIS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_BSVIS_SHIFT)) & USBHS_OTGSC_BSVIS_MASK) - -#define USBHS_OTGSC_BSEIS_MASK (0x100000U) -#define USBHS_OTGSC_BSEIS_SHIFT (20U) -/*! BSEIS - B Session End Interrupt Status */ -#define USBHS_OTGSC_BSEIS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_BSEIS_SHIFT)) & USBHS_OTGSC_BSEIS_MASK) - -#define USBHS_OTGSC_STATUS_1MS_MASK (0x200000U) -#define USBHS_OTGSC_STATUS_1MS_SHIFT (21U) -/*! STATUS_1MS - 1 Millisecond Timer Interrupt Status */ -#define USBHS_OTGSC_STATUS_1MS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_STATUS_1MS_SHIFT)) & USBHS_OTGSC_STATUS_1MS_MASK) - -#define USBHS_OTGSC_DPIS_MASK (0x400000U) -#define USBHS_OTGSC_DPIS_SHIFT (22U) -/*! DPIS - Data Pulse Interrupt Status */ -#define USBHS_OTGSC_DPIS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_DPIS_SHIFT)) & USBHS_OTGSC_DPIS_MASK) - -#define USBHS_OTGSC_IDIE_MASK (0x1000000U) -#define USBHS_OTGSC_IDIE_SHIFT (24U) -/*! IDIE - USB ID Interrupt Enable */ -#define USBHS_OTGSC_IDIE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_IDIE_SHIFT)) & USBHS_OTGSC_IDIE_MASK) - -#define USBHS_OTGSC_AVVIE_MASK (0x2000000U) -#define USBHS_OTGSC_AVVIE_SHIFT (25U) -/*! AVVIE - A VBus Valid Interrupt Enable */ -#define USBHS_OTGSC_AVVIE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_AVVIE_SHIFT)) & USBHS_OTGSC_AVVIE_MASK) - -#define USBHS_OTGSC_ASVIE_MASK (0x4000000U) -#define USBHS_OTGSC_ASVIE_SHIFT (26U) -/*! ASVIE - A Session Valid Interrupt Enable */ -#define USBHS_OTGSC_ASVIE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_ASVIE_SHIFT)) & USBHS_OTGSC_ASVIE_MASK) - -#define USBHS_OTGSC_BSVIE_MASK (0x8000000U) -#define USBHS_OTGSC_BSVIE_SHIFT (27U) -/*! BSVIE - B Session Valid Interrupt Enable */ -#define USBHS_OTGSC_BSVIE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_BSVIE_SHIFT)) & USBHS_OTGSC_BSVIE_MASK) - -#define USBHS_OTGSC_BSEIE_MASK (0x10000000U) -#define USBHS_OTGSC_BSEIE_SHIFT (28U) -/*! BSEIE - B Session End Interrupt Enable */ -#define USBHS_OTGSC_BSEIE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_BSEIE_SHIFT)) & USBHS_OTGSC_BSEIE_MASK) - -#define USBHS_OTGSC_EN_1MS_MASK (0x20000000U) -#define USBHS_OTGSC_EN_1MS_SHIFT (29U) -/*! EN_1MS - 1 Millisecond Timer Interrupt Enable */ -#define USBHS_OTGSC_EN_1MS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_EN_1MS_SHIFT)) & USBHS_OTGSC_EN_1MS_MASK) - -#define USBHS_OTGSC_DPIE_MASK (0x40000000U) -#define USBHS_OTGSC_DPIE_SHIFT (30U) -/*! DPIE - Data Pulse Interrupt Enable */ -#define USBHS_OTGSC_DPIE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_DPIE_SHIFT)) & USBHS_OTGSC_DPIE_MASK) -/*! @} */ - -/*! @name USBMODE - USB Device Mode */ -/*! @{ */ - -#define USBHS_USBMODE_CM_MASK (0x3U) -#define USBHS_USBMODE_CM_SHIFT (0U) -/*! CM - Controller Mode - * 0b00..Idle [Default for combination host/device] - * 0b01..Reserved - * 0b10..Device Controller [Default for device only controller] - * 0b11..Host Controller [Default for host only controller] - */ -#define USBHS_USBMODE_CM(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBMODE_CM_SHIFT)) & USBHS_USBMODE_CM_MASK) - -#define USBHS_USBMODE_ES_MASK (0x4U) -#define USBHS_USBMODE_ES_SHIFT (2U) -/*! ES - Endian Select - * 0b0..Little Endian - * 0b1..Big Endian - */ -#define USBHS_USBMODE_ES(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBMODE_ES_SHIFT)) & USBHS_USBMODE_ES_MASK) - -#define USBHS_USBMODE_SLOM_MASK (0x8U) -#define USBHS_USBMODE_SLOM_SHIFT (3U) -/*! SLOM - Setup Lockout Mode - * 0b0..Setup Lockouts On (default); - * 0b1..Setup Lockouts Off - */ -#define USBHS_USBMODE_SLOM(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBMODE_SLOM_SHIFT)) & USBHS_USBMODE_SLOM_MASK) - -#define USBHS_USBMODE_SDIS_MASK (0x10U) -#define USBHS_USBMODE_SDIS_SHIFT (4U) -/*! SDIS - Stream Disable Mode - * 0b0..Inactive - * 0b1..Active - */ -#define USBHS_USBMODE_SDIS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBMODE_SDIS_SHIFT)) & USBHS_USBMODE_SDIS_MASK) -/*! @} */ - -/*! @name ENDPTSETUPSTAT - Endpoint Setup Status */ -/*! @{ */ - -#define USBHS_ENDPTSETUPSTAT_ENDPTSETUPSTAT_MASK (0xFFFFU) -#define USBHS_ENDPTSETUPSTAT_ENDPTSETUPSTAT_SHIFT (0U) -/*! ENDPTSETUPSTAT - Setup Endpoint Status */ -#define USBHS_ENDPTSETUPSTAT_ENDPTSETUPSTAT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTSETUPSTAT_ENDPTSETUPSTAT_SHIFT)) & USBHS_ENDPTSETUPSTAT_ENDPTSETUPSTAT_MASK) -/*! @} */ - -/*! @name ENDPTPRIME - Endpoint Prime */ -/*! @{ */ - -#define USBHS_ENDPTPRIME_PERB_MASK (0xFFU) -#define USBHS_ENDPTPRIME_PERB_SHIFT (0U) -/*! PERB - Prime Endpoint Receive Buffer */ -#define USBHS_ENDPTPRIME_PERB(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTPRIME_PERB_SHIFT)) & USBHS_ENDPTPRIME_PERB_MASK) - -#define USBHS_ENDPTPRIME_PETB_MASK (0xFF0000U) -#define USBHS_ENDPTPRIME_PETB_SHIFT (16U) -/*! PETB - Prime Endpoint Transmit Buffer */ -#define USBHS_ENDPTPRIME_PETB(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTPRIME_PETB_SHIFT)) & USBHS_ENDPTPRIME_PETB_MASK) -/*! @} */ - -/*! @name ENDPTFLUSH - Endpoint Flush */ -/*! @{ */ - -#define USBHS_ENDPTFLUSH_FERB_MASK (0xFFU) -#define USBHS_ENDPTFLUSH_FERB_SHIFT (0U) -/*! FERB - Flush Endpoint Receive Buffer */ -#define USBHS_ENDPTFLUSH_FERB(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTFLUSH_FERB_SHIFT)) & USBHS_ENDPTFLUSH_FERB_MASK) - -#define USBHS_ENDPTFLUSH_FETB_MASK (0xFF0000U) -#define USBHS_ENDPTFLUSH_FETB_SHIFT (16U) -/*! FETB - Flush Endpoint Transmit Buffer */ -#define USBHS_ENDPTFLUSH_FETB(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTFLUSH_FETB_SHIFT)) & USBHS_ENDPTFLUSH_FETB_MASK) -/*! @} */ - -/*! @name ENDPTSTAT - Endpoint Status */ -/*! @{ */ - -#define USBHS_ENDPTSTAT_ERBR_MASK (0xFFU) -#define USBHS_ENDPTSTAT_ERBR_SHIFT (0U) -/*! ERBR - Endpoint Receive Buffer Ready */ -#define USBHS_ENDPTSTAT_ERBR(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTSTAT_ERBR_SHIFT)) & USBHS_ENDPTSTAT_ERBR_MASK) - -#define USBHS_ENDPTSTAT_ETBR_MASK (0xFF0000U) -#define USBHS_ENDPTSTAT_ETBR_SHIFT (16U) -/*! ETBR - Endpoint Transmit Buffer Ready */ -#define USBHS_ENDPTSTAT_ETBR(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTSTAT_ETBR_SHIFT)) & USBHS_ENDPTSTAT_ETBR_MASK) -/*! @} */ - -/*! @name ENDPTCOMPLETE - Endpoint Complete */ -/*! @{ */ - -#define USBHS_ENDPTCOMPLETE_ERCE_MASK (0xFFU) -#define USBHS_ENDPTCOMPLETE_ERCE_SHIFT (0U) -/*! ERCE - Endpoint Receive Complete Event */ -#define USBHS_ENDPTCOMPLETE_ERCE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCOMPLETE_ERCE_SHIFT)) & USBHS_ENDPTCOMPLETE_ERCE_MASK) - -#define USBHS_ENDPTCOMPLETE_ETCE_MASK (0xFF0000U) -#define USBHS_ENDPTCOMPLETE_ETCE_SHIFT (16U) -/*! ETCE - Endpoint Transmit Complete Event */ -#define USBHS_ENDPTCOMPLETE_ETCE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCOMPLETE_ETCE_SHIFT)) & USBHS_ENDPTCOMPLETE_ETCE_MASK) -/*! @} */ - -/*! @name ENDPTCTRL0 - Endpoint Control 0 */ -/*! @{ */ - -#define USBHS_ENDPTCTRL0_RXS_MASK (0x1U) -#define USBHS_ENDPTCTRL0_RXS_SHIFT (0U) -/*! RXS - RX Endpoint Stall - * 0b0..Endpoint OK - * 0b1..Endpoint stalled - */ -#define USBHS_ENDPTCTRL0_RXS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL0_RXS_SHIFT)) & USBHS_ENDPTCTRL0_RXS_MASK) - -#define USBHS_ENDPTCTRL0_RXT_MASK (0xCU) -#define USBHS_ENDPTCTRL0_RXT_SHIFT (2U) -/*! RXT - RX Endpoint Type - * 0b00..Control - */ -#define USBHS_ENDPTCTRL0_RXT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL0_RXT_SHIFT)) & USBHS_ENDPTCTRL0_RXT_MASK) - -#define USBHS_ENDPTCTRL0_RXE_MASK (0x80U) -#define USBHS_ENDPTCTRL0_RXE_SHIFT (7U) -/*! RXE - RX Endpoint Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define USBHS_ENDPTCTRL0_RXE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL0_RXE_SHIFT)) & USBHS_ENDPTCTRL0_RXE_MASK) - -#define USBHS_ENDPTCTRL0_TXS_MASK (0x10000U) -#define USBHS_ENDPTCTRL0_TXS_SHIFT (16U) -/*! TXS - TX Endpoint Stall - * 0b0..Endpoint OK - * 0b1..Endpoint stalled - */ -#define USBHS_ENDPTCTRL0_TXS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL0_TXS_SHIFT)) & USBHS_ENDPTCTRL0_TXS_MASK) - -#define USBHS_ENDPTCTRL0_TXT_MASK (0xC0000U) -#define USBHS_ENDPTCTRL0_TXT_SHIFT (18U) -/*! TXT - TX Endpoint Type - * 0b00..Control - */ -#define USBHS_ENDPTCTRL0_TXT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL0_TXT_SHIFT)) & USBHS_ENDPTCTRL0_TXT_MASK) - -#define USBHS_ENDPTCTRL0_TXE_MASK (0x800000U) -#define USBHS_ENDPTCTRL0_TXE_SHIFT (23U) -/*! TXE - TX Endpoint Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define USBHS_ENDPTCTRL0_TXE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL0_TXE_SHIFT)) & USBHS_ENDPTCTRL0_TXE_MASK) -/*! @} */ - -/*! @name ENDPTCTRL - Endpoint Control 1..Endpoint Control 7 */ -/*! @{ */ - -#define USBHS_ENDPTCTRL_RXS_MASK (0x1U) -#define USBHS_ENDPTCTRL_RXS_SHIFT (0U) -/*! RXS - RX Endpoint Stall - * 0b0..Endpoint OK - * 0b1..Endpoint stalled - */ -#define USBHS_ENDPTCTRL_RXS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_RXS_SHIFT)) & USBHS_ENDPTCTRL_RXS_MASK) - -#define USBHS_ENDPTCTRL_RXD_MASK (0x2U) -#define USBHS_ENDPTCTRL_RXD_SHIFT (1U) -/*! RXD - RX Endpoint Data Sink - * 0b0..Dual Port Memory Buffer/DMA Engine - */ -#define USBHS_ENDPTCTRL_RXD(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_RXD_SHIFT)) & USBHS_ENDPTCTRL_RXD_MASK) - -#define USBHS_ENDPTCTRL_RXT_MASK (0xCU) -#define USBHS_ENDPTCTRL_RXT_SHIFT (2U) -/*! RXT - RX Endpoint Type - * 0b00..Control - * 0b01..Isochronous - * 0b10..Bulk - * 0b11..Interrupt - */ -#define USBHS_ENDPTCTRL_RXT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_RXT_SHIFT)) & USBHS_ENDPTCTRL_RXT_MASK) - -#define USBHS_ENDPTCTRL_RXI_MASK (0x20U) -#define USBHS_ENDPTCTRL_RXI_SHIFT (5U) -/*! RXI - RX Data Toggle Inhibit - * 0b0..Disabled - * 0b1..Enabled - */ -#define USBHS_ENDPTCTRL_RXI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_RXI_SHIFT)) & USBHS_ENDPTCTRL_RXI_MASK) - -#define USBHS_ENDPTCTRL_RXR_MASK (0x40U) -#define USBHS_ENDPTCTRL_RXR_SHIFT (6U) -/*! RXR - RX Data Toggle Reset (WS) - * 0b1..Reset PID sequence - */ -#define USBHS_ENDPTCTRL_RXR(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_RXR_SHIFT)) & USBHS_ENDPTCTRL_RXR_MASK) - -#define USBHS_ENDPTCTRL_RXE_MASK (0x80U) -#define USBHS_ENDPTCTRL_RXE_SHIFT (7U) -/*! RXE - RX Endpoint Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define USBHS_ENDPTCTRL_RXE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_RXE_SHIFT)) & USBHS_ENDPTCTRL_RXE_MASK) - -#define USBHS_ENDPTCTRL_TXS_MASK (0x10000U) -#define USBHS_ENDPTCTRL_TXS_SHIFT (16U) -/*! TXS - TX Endpoint Stall - * 0b0..Endpoint OK - * 0b1..Endpoint stalled - */ -#define USBHS_ENDPTCTRL_TXS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_TXS_SHIFT)) & USBHS_ENDPTCTRL_TXS_MASK) - -#define USBHS_ENDPTCTRL_TXD_MASK (0x20000U) -#define USBHS_ENDPTCTRL_TXD_SHIFT (17U) -/*! TXD - TX Endpoint Data Source - * 0b0..Dual Port Memory Buffer/DMA Engine - */ -#define USBHS_ENDPTCTRL_TXD(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_TXD_SHIFT)) & USBHS_ENDPTCTRL_TXD_MASK) - -#define USBHS_ENDPTCTRL_TXT_MASK (0xC0000U) -#define USBHS_ENDPTCTRL_TXT_SHIFT (18U) -/*! TXT - TX Endpoint Type - * 0b00..Control - * 0b01..Isochronous - * 0b10..Bulk - * 0b11..Interrupt - */ -#define USBHS_ENDPTCTRL_TXT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_TXT_SHIFT)) & USBHS_ENDPTCTRL_TXT_MASK) - -#define USBHS_ENDPTCTRL_TXI_MASK (0x200000U) -#define USBHS_ENDPTCTRL_TXI_SHIFT (21U) -/*! TXI - TX Data Toggle Inhibit - * 0b0..PID sequencing enabled - * 0b1..PID sequencing disabled - */ -#define USBHS_ENDPTCTRL_TXI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_TXI_SHIFT)) & USBHS_ENDPTCTRL_TXI_MASK) - -#define USBHS_ENDPTCTRL_TXR_MASK (0x400000U) -#define USBHS_ENDPTCTRL_TXR_SHIFT (22U) -/*! TXR - TX Data Toggle Reset (WS) - * 0b1..Reset PID sequence - */ -#define USBHS_ENDPTCTRL_TXR(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_TXR_SHIFT)) & USBHS_ENDPTCTRL_TXR_MASK) - -#define USBHS_ENDPTCTRL_TXE_MASK (0x800000U) -#define USBHS_ENDPTCTRL_TXE_SHIFT (23U) -/*! TXE - TX Endpoint Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define USBHS_ENDPTCTRL_TXE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_TXE_SHIFT)) & USBHS_ENDPTCTRL_TXE_MASK) -/*! @} */ - -/* The count of USBHS_ENDPTCTRL */ -#define USBHS_ENDPTCTRL_COUNT (7U) - - -/*! - * @} - */ /* end of group USBHS_Register_Masks */ - - -/* USBHS - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral USBHS1__USBC base address */ - #define USBHS1__USBC_BASE (0x5010B000u) - /** Peripheral USBHS1__USBC base address */ - #define USBHS1__USBC_BASE_NS (0x4010B000u) - /** Peripheral USBHS1__USBC base pointer */ - #define USBHS1__USBC ((USBHS_Type *)USBHS1__USBC_BASE) - /** Peripheral USBHS1__USBC base pointer */ - #define USBHS1__USBC_NS ((USBHS_Type *)USBHS1__USBC_BASE_NS) - /** Array initializer of USBHS peripheral base addresses */ - #define USBHS_BASE_ADDRS { USBHS1__USBC_BASE } - /** Array initializer of USBHS peripheral base pointers */ - #define USBHS_BASE_PTRS { USBHS1__USBC } - /** Array initializer of USBHS peripheral base addresses */ - #define USBHS_BASE_ADDRS_NS { USBHS1__USBC_BASE_NS } - /** Array initializer of USBHS peripheral base pointers */ - #define USBHS_BASE_PTRS_NS { USBHS1__USBC_NS } -#else - /** Peripheral USBHS1__USBC base address */ - #define USBHS1__USBC_BASE (0x4010B000u) - /** Peripheral USBHS1__USBC base pointer */ - #define USBHS1__USBC ((USBHS_Type *)USBHS1__USBC_BASE) - /** Array initializer of USBHS peripheral base addresses */ - #define USBHS_BASE_ADDRS { USBHS1__USBC_BASE } - /** Array initializer of USBHS peripheral base pointers */ - #define USBHS_BASE_PTRS { USBHS1__USBC } -#endif -/** Interrupt vectors for the USBHS peripheral type */ -#define USBHS_IRQS { USB1_HS_IRQn } -/* Backward compatibility */ -#define GPTIMER0CTL GPTIMER0CTRL -#define GPTIMER1CTL GPTIMER1CTRL -#define USB_SBUSCFG SBUSCFG -#define EPLISTADDR ENDPTLISTADDR -#define EPSETUPSR ENDPTSETUPSTAT -#define EPPRIME ENDPTPRIME -#define EPFLUSH ENDPTFLUSH -#define EPSR ENDPTSTAT -#define EPCOMPLETE ENDPTCOMPLETE -#define EPCR ENDPTCTRL -#define EPCR0 ENDPTCTRL0 -#define USBHS_GPTIMER0CTL_GPTCNT_MASK USBHS_GPTIMER0CTRL_GPTCNT_MASK -#define USBHS_GPTIMER0CTL_GPTCNT_SHIFT USBHS_GPTIMER0CTRL_GPTCNT_SHIFT -#define USBHS_GPTIMER0CTL_GPTCNT(x) USBHS_GPTIMER0CTRL_GPTCNT(x) -#define USBHS_GPTIMER0CTL_MODE_MASK USBHS_GPTIMER0CTRL_GPTMODE_MASK -#define USBHS_GPTIMER0CTL_MODE_SHIFT USBHS_GPTIMER0CTRL_GPTMODE_SHIFT -#define USBHS_GPTIMER0CTL_MODE(x) USBHS_GPTIMER0CTRL_GPTMODE(x) -#define USBHS_GPTIMER0CTL_RST_MASK USBHS_GPTIMER0CTRL_GPTRST_MASK -#define USBHS_GPTIMER0CTL_RST_SHIFT USBHS_GPTIMER0CTRL_GPTRST_SHIFT -#define USBHS_GPTIMER0CTL_RST(x) USBHS_GPTIMER0CTRL_GPTRST(x) -#define USBHS_GPTIMER0CTL_RUN_MASK USBHS_GPTIMER0CTRL_GPTRUN_MASK -#define USBHS_GPTIMER0CTL_RUN_SHIFT USBHS_GPTIMER0CTRL_GPTRUN_SHIFT -#define USBHS_GPTIMER0CTL_RUN(x) USBHS_GPTIMER0CTRL_GPTRUN(x) -#define USBHS_GPTIMER1CTL_GPTCNT_MASK USBHS_GPTIMER1CTRL_GPTCNT_MASK -#define USBHS_GPTIMER1CTL_GPTCNT_SHIFT USBHS_GPTIMER1CTRL_GPTCNT_SHIFT -#define USBHS_GPTIMER1CTL_GPTCNT(x) USBHS_GPTIMER1CTRL_GPTCNT(x) -#define USBHS_GPTIMER1CTL_MODE_MASK USBHS_GPTIMER1CTRL_GPTMODE_MASK -#define USBHS_GPTIMER1CTL_MODE_SHIFT USBHS_GPTIMER1CTRL_GPTMODE_SHIFT -#define USBHS_GPTIMER1CTL_MODE(x) USBHS_GPTIMER1CTRL_GPTMODE(x) -#define USBHS_GPTIMER1CTL_RST_MASK USBHS_GPTIMER1CTRL_GPTRST_MASK -#define USBHS_GPTIMER1CTL_RST_SHIFT USBHS_GPTIMER1CTRL_GPTRST_SHIFT -#define USBHS_GPTIMER1CTL_RST(x) USBHS_GPTIMER1CTRL_GPTRST(x) -#define USBHS_GPTIMER1CTL_RUN_MASK USBHS_GPTIMER1CTRL_GPTRUN_MASK -#define USBHS_GPTIMER1CTL_RUN_SHIFT USBHS_GPTIMER1CTRL_GPTRUN_SHIFT -#define USBHS_GPTIMER1CTL_RUN(x) USBHS_GPTIMER1CTRL_GPTRUN(x) -#define USBHS_USB_SBUSCFG_BURSTMODE_MASK USBHS_SBUSCFG_AHBBRST_MASK -#define USBHS_USB_SBUSCFG_BURSTMODE_SHIFT USBHS_SBUSCFG_AHBBRST_SHIFT -#define USBHS_USB_SBUSCFG_BURSTMODE(x) USBHS_SBUSCFG_AHBBRST(x) -#define USBHS_USBCMD_FS_MASK USBHS_USBCMD_FS_1_MASK -#define USBHS_USBCMD_FS_SHIFT USBHS_USBCMD_FS_1_SHIFT -#define USBHS_USBCMD_FS(x) USBHS_USBCMD_FS_1(x) -#define USBHS_EPLISTADDR_EPBASE_MASK USBHS_ENDPTLISTADDR_EPBASE_MASK -#define USBHS_EPLISTADDR_EPBASE_SHIFT USBHS_ENDPTLISTADDR_EPBASE_SHIFT -#define USBHS_EPLISTADDR_EPBASE(x) USBHS_ENDPTLISTADDR_EPBASE(x) -#define USBHS_EPSETUPSR_EPSETUPSTAT_MASK USBHS_ENDPTSETUPSTAT_ENDPTSETUPSTAT_MASK -#define USBHS_EPSETUPSR_EPSETUPSTAT_SHIFT USBHS_ENDPTSETUPSTAT_ENDPTSETUPSTAT_SHIFT -#define USBHS_EPSETUPSR_EPSETUPSTAT(x) USBHS_ENDPTSETUPSTAT_ENDPTSETUPSTAT(x) -#define USBHS_EPPRIME_PERB_MASK USBHS_ENDPTPRIME_PERB_MASK -#define USBHS_EPPRIME_PERB_SHIFT USBHS_ENDPTPRIME_PERB_SHIFT -#define USBHS_EPPRIME_PERB(x) USBHS_ENDPTPRIME_PERB(x) -#define USBHS_EPPRIME_PETB_MASK USBHS_ENDPTPRIME_PETB_MASK -#define USBHS_EPPRIME_PETB_SHIFT USBHS_ENDPTPRIME_PETB_SHIFT -#define USBHS_EPPRIME_PETB(x) USBHS_ENDPTPRIME_PETB(x) -#define USBHS_EPFLUSH_FERB_MASK USBHS_ENDPTFLUSH_FERB_MASK -#define USBHS_EPFLUSH_FERB_SHIFT USBHS_ENDPTFLUSH_FERB_SHIFT -#define USBHS_EPFLUSH_FERB(x) USBHS_ENDPTFLUSH_FERB(x) -#define USBHS_EPFLUSH_FETB_MASK USBHS_ENDPTFLUSH_FETB_MASK -#define USBHS_EPFLUSH_FETB_SHIFT USBHS_ENDPTFLUSH_FETB_SHIFT -#define USBHS_EPFLUSH_FETB(x) USBHS_ENDPTFLUSH_FETB(x) -#define USBHS_EPSR_ERBR_MASK USBHS_ENDPTSTAT_ERBR_MASK -#define USBHS_EPSR_ERBR_SHIFT USBHS_ENDPTSTAT_ERBR_SHIFT -#define USBHS_EPSR_ERBR(x) USBHS_ENDPTSTAT_ERBR(x) -#define USBHS_EPSR_ETBR_MASK USBHS_ENDPTSTAT_ETBR_MASK -#define USBHS_EPSR_ETBR_SHIFT USBHS_ENDPTSTAT_ETBR_SHIFT -#define USBHS_EPSR_ETBR(x) USBHS_ENDPTSTAT_ETBR(x) -#define USBHS_EPCOMPLETE_ERCE_MASK USBHS_ENDPTCOMPLETE_ERCE_MASK -#define USBHS_EPCOMPLETE_ERCE_SHIFT USBHS_ENDPTCOMPLETE_ERCE_SHIFT -#define USBHS_EPCOMPLETE_ERCE(x) USBHS_ENDPTCOMPLETE_ERCE(x) -#define USBHS_EPCOMPLETE_ETCE_MASK USBHS_ENDPTCOMPLETE_ETCE_MASK -#define USBHS_EPCOMPLETE_ETCE_SHIFT USBHS_ENDPTCOMPLETE_ETCE_SHIFT -#define USBHS_EPCOMPLETE_ETCE(x) USBHS_ENDPTCOMPLETE_ETCE(x) -#define USBHS_EPCR0_RXS_MASK USBHS_ENDPTCTRL0_RXS_MASK -#define USBHS_EPCR0_RXS_SHIFT USBHS_ENDPTCTRL0_RXS_SHIFT -#define USBHS_EPCR0_RXS(x) USBHS_ENDPTCTRL0_RXS(x) -#define USBHS_EPCR0_RXT_MASK USBHS_ENDPTCTRL0_RXT_MASK -#define USBHS_EPCR0_RXT_SHIFT USBHS_ENDPTCTRL0_RXT_SHIFT -#define USBHS_EPCR0_RXT(x) USBHS_ENDPTCTRL0_RXT(x) -#define USBHS_EPCR0_RXE_MASK USBHS_ENDPTCTRL0_RXE_MASK -#define USBHS_EPCR0_RXE_SHIFT USBHS_ENDPTCTRL0_RXE_SHIFT -#define USBHS_EPCR0_RXE(x) USBHS_ENDPTCTRL0_RXE(x) -#define USBHS_EPCR0_TXS_MASK USBHS_ENDPTCTRL0_TXS_MASK -#define USBHS_EPCR0_TXS_SHIFT USBHS_ENDPTCTRL0_TXS_SHIFT -#define USBHS_EPCR0_TXS(x) USBHS_ENDPTCTRL0_TXS(x) -#define USBHS_EPCR0_TXT_MASK USBHS_ENDPTCTRL0_TXT_MASK -#define USBHS_EPCR0_TXT_SHIFT USBHS_ENDPTCTRL0_TXT_SHIFT -#define USBHS_EPCR0_TXT(x) USBHS_ENDPTCTRL0_TXT(x) -#define USBHS_EPCR0_TXE_MASK USBHS_ENDPTCTRL0_TXE_MASK -#define USBHS_EPCR0_TXE_SHIFT USBHS_ENDPTCTRL0_TXE_SHIFT -#define USBHS_EPCR0_TXE(x) USBHS_ENDPTCTRL0_TXE(x) -#define USBHS_EPCR_RXS_MASK USBHS_ENDPTCTRL_RXS_MASK -#define USBHS_EPCR_RXS_SHIFT USBHS_ENDPTCTRL_RXS_SHIFT -#define USBHS_EPCR_RXS(x) USBHS_ENDPTCTRL_RXS(x) -#define USBHS_EPCR_RXD_MASK USBHS_ENDPTCTRL_RXD_MASK -#define USBHS_EPCR_RXD_SHIFT USBHS_ENDPTCTRL_RXD_SHIFT -#define USBHS_EPCR_RXD(x) USBHS_ENDPTCTRL_RXD(x) -#define USBHS_EPCR_RXT_MASK USBHS_ENDPTCTRL_RXT_MASK -#define USBHS_EPCR_RXT_SHIFT USBHS_ENDPTCTRL_RXT_SHIFT -#define USBHS_EPCR_RXT(x) USBHS_ENDPTCTRL_RXT(x) -#define USBHS_EPCR_RXI_MASK USBHS_ENDPTCTRL_RXI_MASK -#define USBHS_EPCR_RXI_SHIFT USBHS_ENDPTCTRL_RXI_SHIFT -#define USBHS_EPCR_RXI(x) USBHS_ENDPTCTRL_RXI(x) -#define USBHS_EPCR_RXR_MASK USBHS_ENDPTCTRL_RXR_MASK -#define USBHS_EPCR_RXR_SHIFT USBHS_ENDPTCTRL_RXR_SHIFT -#define USBHS_EPCR_RXR(x) USBHS_ENDPTCTRL_RXR(x) -#define USBHS_EPCR_RXE_MASK USBHS_ENDPTCTRL_RXE_MASK -#define USBHS_EPCR_RXE_SHIFT USBHS_ENDPTCTRL_RXE_SHIFT -#define USBHS_EPCR_RXE(x) USBHS_ENDPTCTRL_RXE(x) -#define USBHS_EPCR_TXS_MASK USBHS_ENDPTCTRL_TXS_MASK -#define USBHS_EPCR_TXS_SHIFT USBHS_ENDPTCTRL_TXS_SHIFT -#define USBHS_EPCR_TXS(x) USBHS_ENDPTCTRL_TXS(x) -#define USBHS_EPCR_TXD_MASK USBHS_ENDPTCTRL_TXD_MASK -#define USBHS_EPCR_TXD_SHIFT USBHS_ENDPTCTRL_TXD_SHIFT -#define USBHS_EPCR_TXD(x) USBHS_ENDPTCTRL_TXD(x) -#define USBHS_EPCR_TXT_MASK USBHS_ENDPTCTRL_TXT_MASK -#define USBHS_EPCR_TXT_SHIFT USBHS_ENDPTCTRL_TXT_SHIFT -#define USBHS_EPCR_TXT(x) USBHS_ENDPTCTRL_TXT(x) -#define USBHS_EPCR_TXI_MASK USBHS_ENDPTCTRL_TXI_MASK -#define USBHS_EPCR_TXI_SHIFT USBHS_ENDPTCTRL_TXI_SHIFT -#define USBHS_EPCR_TXI(x) USBHS_ENDPTCTRL_TXI(x) -#define USBHS_EPCR_TXR_MASK USBHS_ENDPTCTRL_TXR_MASK -#define USBHS_EPCR_TXR_SHIFT USBHS_ENDPTCTRL_TXR_SHIFT -#define USBHS_EPCR_TXR(x) USBHS_ENDPTCTRL_TXR(x) -#define USBHS_EPCR_TXE_MASK USBHS_ENDPTCTRL_TXE_MASK -#define USBHS_EPCR_TXE_SHIFT USBHS_ENDPTCTRL_TXE_SHIFT -#define USBHS_EPCR_TXE(x) USBHS_ENDPTCTRL_TXE(x) -#define USBHS_EPCR_COUNT USBHS_ENDPTCTRL_COUNT -#define USBHS_PORTSC1_WKDS_MASK USBHS_PORTSC1_WKDC_MASK -#define USBHS_PORTSC1_WKDS_SHIFT USBHS_PORTSC1_WKDC_SHIFT -#define USBHS_PORTSC1_WKDS(x) USBHS_PORTSC1_WKDC(x) -#define USBHS_IRQHandler USB1_HS_IRQHandler - - -/*! - * @} - */ /* end of group USBHS_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- USBHSDCD Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USBHSDCD_Peripheral_Access_Layer USBHSDCD Peripheral Access Layer - * @{ - */ - -/** USBHSDCD - Register Layout Typedef */ -typedef struct { - __IO uint32_t CONTROL; /**< Control, offset: 0x0 */ - __IO uint32_t CLOCK; /**< Clock, offset: 0x4 */ - __I uint32_t STATUS; /**< Status, offset: 0x8 */ - __IO uint32_t SIGNAL_OVERRIDE; /**< Signal Override, offset: 0xC */ - __IO uint32_t TIMER0; /**< TIMER0, offset: 0x10 */ - __IO uint32_t TIMER1; /**< TIMER1, offset: 0x14 */ - union { /* offset: 0x18 */ - __IO uint32_t TIMER2_BC11; /**< TIMER2_BC11, offset: 0x18 */ - __IO uint32_t TIMER2_BC12; /**< TIMER2_BC12, offset: 0x18 */ - }; -} USBHSDCD_Type; - -/* ---------------------------------------------------------------------------- - -- USBHSDCD Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USBHSDCD_Register_Masks USBHSDCD Register Masks - * @{ - */ - -/*! @name CONTROL - Control */ -/*! @{ */ - -#define USBHSDCD_CONTROL_IACK_MASK (0x1U) -#define USBHSDCD_CONTROL_IACK_SHIFT (0U) -/*! IACK - Interrupt Acknowledge - * 0b0..Do not clear the interrupt. - * 0b1..Clear the IF field (interrupt flag). - */ -#define USBHSDCD_CONTROL_IACK(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_CONTROL_IACK_SHIFT)) & USBHSDCD_CONTROL_IACK_MASK) - -#define USBHSDCD_CONTROL_IF_MASK (0x100U) -#define USBHSDCD_CONTROL_IF_SHIFT (8U) -/*! IF - Interrupt Flag - * 0b0..No interrupt is pending. - * 0b1..An interrupt is pending. - */ -#define USBHSDCD_CONTROL_IF(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_CONTROL_IF_SHIFT)) & USBHSDCD_CONTROL_IF_MASK) - -#define USBHSDCD_CONTROL_IE_MASK (0x10000U) -#define USBHSDCD_CONTROL_IE_SHIFT (16U) -/*! IE - Interrupt Enable - * 0b0..Disable interrupts to the system. - * 0b1..Enable interrupts to the system. - */ -#define USBHSDCD_CONTROL_IE(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_CONTROL_IE_SHIFT)) & USBHSDCD_CONTROL_IE_MASK) - -#define USBHSDCD_CONTROL_BC12_MASK (0x20000U) -#define USBHSDCD_CONTROL_BC12_SHIFT (17U) -/*! BC12 - Battery Charging Revision 1.2 Compatibility - * 0b0..Compatible with BC1.1 - * 0b1..Compatible with BC1.2 (default) - */ -#define USBHSDCD_CONTROL_BC12(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_CONTROL_BC12_SHIFT)) & USBHSDCD_CONTROL_BC12_MASK) - -#define USBHSDCD_CONTROL_START_MASK (0x1000000U) -#define USBHSDCD_CONTROL_START_SHIFT (24U) -/*! START - Start Change Detection Sequence - * 0b0..Do not start the sequence. Writes of this value have no effect. - * 0b1..Initiate the charger detection sequence. If the sequence is already running, writes of this value have no effect. - */ -#define USBHSDCD_CONTROL_START(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_CONTROL_START_SHIFT)) & USBHSDCD_CONTROL_START_MASK) - -#define USBHSDCD_CONTROL_SR_MASK (0x2000000U) -#define USBHSDCD_CONTROL_SR_SHIFT (25U) -/*! SR - Software Reset - * 0b0..Do not perform a software reset. - * 0b1..Perform a software reset. - */ -#define USBHSDCD_CONTROL_SR(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_CONTROL_SR_SHIFT)) & USBHSDCD_CONTROL_SR_MASK) -/*! @} */ - -/*! @name CLOCK - Clock */ -/*! @{ */ - -#define USBHSDCD_CLOCK_CLOCK_UNIT_MASK (0x1U) -#define USBHSDCD_CLOCK_CLOCK_UNIT_SHIFT (0U) -/*! CLOCK_UNIT - Unit of Measurement Encoding for Clock Speed - * 0b0..kHz Speed (between 4 kHz and 1023 kHz) - * 0b1..MHz Speed (between 1 MHz and 1023 MHz) - */ -#define USBHSDCD_CLOCK_CLOCK_UNIT(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_CLOCK_CLOCK_UNIT_SHIFT)) & USBHSDCD_CLOCK_CLOCK_UNIT_MASK) - -#define USBHSDCD_CLOCK_CLOCK_SPEED_MASK (0xFFCU) -#define USBHSDCD_CLOCK_CLOCK_SPEED_SHIFT (2U) -/*! CLOCK_SPEED - Numerical Value of Clock Speed in Binary */ -#define USBHSDCD_CLOCK_CLOCK_SPEED(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_CLOCK_CLOCK_SPEED_SHIFT)) & USBHSDCD_CLOCK_CLOCK_SPEED_MASK) -/*! @} */ - -/*! @name STATUS - Status */ -/*! @{ */ - -#define USBHSDCD_STATUS_SEQ_RES_MASK (0x30000U) -#define USBHSDCD_STATUS_SEQ_RES_SHIFT (16U) -/*! SEQ_RES - Charger Detection Sequence Results - * 0b00..No results to report. - * 0b01..Attached to an SDP. Must comply with USB 2.0 by drawing only 2.5 mA (max) until connected. - * 0b10..Attached to a charging port. The exact meaning depends on the STATUS[SEQ_STAT] field (value 0: Attached - * to either a CDP or a DCP. The charger type detection has not completed. value 1: Attached to a CDP. The - * charger type detection has completed.) - * 0b11..Attached to a DCP. - */ -#define USBHSDCD_STATUS_SEQ_RES(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_STATUS_SEQ_RES_SHIFT)) & USBHSDCD_STATUS_SEQ_RES_MASK) - -#define USBHSDCD_STATUS_SEQ_STAT_MASK (0xC0000U) -#define USBHSDCD_STATUS_SEQ_STAT_SHIFT (18U) -/*! SEQ_STAT - Charger Detection Sequence Status - * 0b00..The module is either not enabled, or the module is enabled but the data pins have not yet been detected. - * 0b01..Data pin contact detection is complete. - * 0b10..Charging port detection is complete. - * 0b11..Charger type detection is complete. - */ -#define USBHSDCD_STATUS_SEQ_STAT(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_STATUS_SEQ_STAT_SHIFT)) & USBHSDCD_STATUS_SEQ_STAT_MASK) - -#define USBHSDCD_STATUS_ERR_MASK (0x100000U) -#define USBHSDCD_STATUS_ERR_SHIFT (20U) -/*! ERR - Error Flag - * 0b0..No sequence errors. - * 0b1..Error in the detection sequence. - */ -#define USBHSDCD_STATUS_ERR(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_STATUS_ERR_SHIFT)) & USBHSDCD_STATUS_ERR_MASK) - -#define USBHSDCD_STATUS_TO_MASK (0x200000U) -#define USBHSDCD_STATUS_TO_SHIFT (21U) -/*! TO - Timeout Flag - * 0b0..The detection sequence is not running for over 1 s. - * 0b1..It is over 1 s since the data pin contact was detected and debounced. - */ -#define USBHSDCD_STATUS_TO(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_STATUS_TO_SHIFT)) & USBHSDCD_STATUS_TO_MASK) - -#define USBHSDCD_STATUS_ACTIVE_MASK (0x400000U) -#define USBHSDCD_STATUS_ACTIVE_SHIFT (22U) -/*! ACTIVE - Active Status Indicator - * 0b0..The sequence is not running. - * 0b1..The sequence is running. - */ -#define USBHSDCD_STATUS_ACTIVE(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_STATUS_ACTIVE_SHIFT)) & USBHSDCD_STATUS_ACTIVE_MASK) -/*! @} */ - -/*! @name SIGNAL_OVERRIDE - Signal Override */ -/*! @{ */ - -#define USBHSDCD_SIGNAL_OVERRIDE_PS_MASK (0x7U) -#define USBHSDCD_SIGNAL_OVERRIDE_PS_SHIFT (0U) -/*! PS - Phase Selection - * 0b000..No overrides. Field must remain at this value during normal USB data communication to prevent - * unexpected conditions on USB_DP and USB_DM pins. (Default) - * 0b001..Reserved, not for customer use. - * 0b010..Enables VDP_SRC voltage source for the USB_DP pin and IDM_SINK current source for the USB_DM pin. - * 0b011..Reserved, not for customer use. - * 0b100..Enables VDM_SRC voltage source only. - * 0b101..Reserved, not for customer use. - * 0b110..Reserved, not for customer use. - * 0b111..Reserved, not for customer use. - */ -#define USBHSDCD_SIGNAL_OVERRIDE_PS(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_SIGNAL_OVERRIDE_PS_SHIFT)) & USBHSDCD_SIGNAL_OVERRIDE_PS_MASK) -/*! @} */ - -/*! @name TIMER0 - TIMER0 */ -/*! @{ */ - -#define USBHSDCD_TIMER0_TUNITCON_MASK (0xFFFU) -#define USBHSDCD_TIMER0_TUNITCON_SHIFT (0U) -/*! TUNITCON - Unit Connection Timer Elapse (in ms) */ -#define USBHSDCD_TIMER0_TUNITCON(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_TIMER0_TUNITCON_SHIFT)) & USBHSDCD_TIMER0_TUNITCON_MASK) - -#define USBHSDCD_TIMER0_TSEQ_INIT_MASK (0x3FF0000U) -#define USBHSDCD_TIMER0_TSEQ_INIT_SHIFT (16U) -/*! TSEQ_INIT - Sequence Initiation Time - * 0b0000000000-0b1111111111..0 ms - 1023 ms - */ -#define USBHSDCD_TIMER0_TSEQ_INIT(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_TIMER0_TSEQ_INIT_SHIFT)) & USBHSDCD_TIMER0_TSEQ_INIT_MASK) -/*! @} */ - -/*! @name TIMER1 - TIMER1 */ -/*! @{ */ - -#define USBHSDCD_TIMER1_TVDPSRC_ON_MASK (0x3FFU) -#define USBHSDCD_TIMER1_TVDPSRC_ON_SHIFT (0U) -/*! TVDPSRC_ON - Time Period Comparator Enabled - * 0b0000000001-0b1111111111..1 ms - 1023 ms - */ -#define USBHSDCD_TIMER1_TVDPSRC_ON(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_TIMER1_TVDPSRC_ON_SHIFT)) & USBHSDCD_TIMER1_TVDPSRC_ON_MASK) - -#define USBHSDCD_TIMER1_TDCD_DBNC_MASK (0x3FF0000U) -#define USBHSDCD_TIMER1_TDCD_DBNC_SHIFT (16U) -/*! TDCD_DBNC - Time Period to Debounce D+ Signal - * 0b0000000001-0b1111111111..1 ms - 1023 ms - */ -#define USBHSDCD_TIMER1_TDCD_DBNC(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_TIMER1_TDCD_DBNC_SHIFT)) & USBHSDCD_TIMER1_TDCD_DBNC_MASK) -/*! @} */ - -/*! @name TIMER2_BC11 - TIMER2_BC11 */ -/*! @{ */ - -#define USBHSDCD_TIMER2_BC11_CHECK_DM_MASK (0xFU) -#define USBHSDCD_TIMER2_BC11_CHECK_DM_SHIFT (0U) -/*! CHECK_DM - Time Before Check of D- Line - * 0b0001-0b1111..1 ms - 15 ms - */ -#define USBHSDCD_TIMER2_BC11_CHECK_DM(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_TIMER2_BC11_CHECK_DM_SHIFT)) & USBHSDCD_TIMER2_BC11_CHECK_DM_MASK) - -#define USBHSDCD_TIMER2_BC11_TVDPSRC_CON_MASK (0x3FF0000U) -#define USBHSDCD_TIMER2_BC11_TVDPSRC_CON_SHIFT (16U) -/*! TVDPSRC_CON - Time Period Before Enabling D+ Pullup - * 0b0000000001-0b1111111111..1 ms - 1023 ms - */ -#define USBHSDCD_TIMER2_BC11_TVDPSRC_CON(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_TIMER2_BC11_TVDPSRC_CON_SHIFT)) & USBHSDCD_TIMER2_BC11_TVDPSRC_CON_MASK) -/*! @} */ - -/*! @name TIMER2_BC12 - TIMER2_BC12 */ -/*! @{ */ - -#define USBHSDCD_TIMER2_BC12_TVDMSRC_ON_MASK (0x3FFU) -#define USBHSDCD_TIMER2_BC12_TVDMSRC_ON_SHIFT (0U) -/*! TVDMSRC_ON - TVDMSRC_ON - * 0b0000000000-0b0000101000..0 ms - 40 ms - */ -#define USBHSDCD_TIMER2_BC12_TVDMSRC_ON(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_TIMER2_BC12_TVDMSRC_ON_SHIFT)) & USBHSDCD_TIMER2_BC12_TVDMSRC_ON_MASK) - -#define USBHSDCD_TIMER2_BC12_TWAIT_AFTER_PRD_MASK (0x3FF0000U) -#define USBHSDCD_TIMER2_BC12_TWAIT_AFTER_PRD_SHIFT (16U) -/*! TWAIT_AFTER_PRD - TWAIT_AFTER_PRD - * 0b0000000001-0b1111111111..1 ms - 1023 ms - */ -#define USBHSDCD_TIMER2_BC12_TWAIT_AFTER_PRD(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_TIMER2_BC12_TWAIT_AFTER_PRD_SHIFT)) & USBHSDCD_TIMER2_BC12_TWAIT_AFTER_PRD_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group USBHSDCD_Register_Masks */ - - -/* USBHSDCD - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral USBHS1_PHY_DCD base address */ - #define USBHS1_PHY_DCD_BASE (0x5010A000u) - /** Peripheral USBHS1_PHY_DCD base address */ - #define USBHS1_PHY_DCD_BASE_NS (0x4010A000u) - /** Peripheral USBHS1_PHY_DCD base pointer */ - #define USBHS1_PHY_DCD ((USBHSDCD_Type *)USBHS1_PHY_DCD_BASE) - /** Peripheral USBHS1_PHY_DCD base pointer */ - #define USBHS1_PHY_DCD_NS ((USBHSDCD_Type *)USBHS1_PHY_DCD_BASE_NS) - /** Array initializer of USBHSDCD peripheral base addresses */ - #define USBHSDCD_BASE_ADDRS { USBHS1_PHY_DCD_BASE } - /** Array initializer of USBHSDCD peripheral base pointers */ - #define USBHSDCD_BASE_PTRS { USBHS1_PHY_DCD } - /** Array initializer of USBHSDCD peripheral base addresses */ - #define USBHSDCD_BASE_ADDRS_NS { USBHS1_PHY_DCD_BASE_NS } - /** Array initializer of USBHSDCD peripheral base pointers */ - #define USBHSDCD_BASE_PTRS_NS { USBHS1_PHY_DCD_NS } -#else - /** Peripheral USBHS1_PHY_DCD base address */ - #define USBHS1_PHY_DCD_BASE (0x4010A000u) - /** Peripheral USBHS1_PHY_DCD base pointer */ - #define USBHS1_PHY_DCD ((USBHSDCD_Type *)USBHS1_PHY_DCD_BASE) - /** Array initializer of USBHSDCD peripheral base addresses */ - #define USBHSDCD_BASE_ADDRS { USBHS1_PHY_DCD_BASE } - /** Array initializer of USBHSDCD peripheral base pointers */ - #define USBHSDCD_BASE_PTRS { USBHS1_PHY_DCD } -#endif -/* Backward compatibility */ -#define USBHSDCD_IRQS { USB1_HS_PHY_IRQn } -#define USB1_HS_PHY_IRQS USBPHY_IRQS - - -/*! - * @} - */ /* end of group USBHSDCD_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- USBNC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USBNC_Peripheral_Access_Layer USBNC Peripheral Access Layer - * @{ - */ - -/** USBNC - Register Layout Typedef */ -typedef struct { - __IO uint32_t CTRL1; /**< USB OTG Control 1, offset: 0x0 */ - __IO uint32_t CTRL2; /**< USB OTG Control 2, offset: 0x4 */ - uint8_t RESERVED_0[8]; - __IO uint32_t HSIC_CTRL; /**< USB Host HSIC Control, offset: 0x10 */ -} USBNC_Type; - -/* ---------------------------------------------------------------------------- - -- USBNC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USBNC_Register_Masks USBNC Register Masks - * @{ - */ - -/*! @name CTRL1 - USB OTG Control 1 */ -/*! @{ */ - -#define USBNC_CTRL1_OVER_CUR_DIS_MASK (0x80U) -#define USBNC_CTRL1_OVER_CUR_DIS_SHIFT (7U) -/*! OVER_CUR_DIS - Disable Overcurrent Detection - * 0b1..Disables - * 0b0..Enables - */ -#define USBNC_CTRL1_OVER_CUR_DIS(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL1_OVER_CUR_DIS_SHIFT)) & USBNC_CTRL1_OVER_CUR_DIS_MASK) - -#define USBNC_CTRL1_OVER_CUR_POL_MASK (0x100U) -#define USBNC_CTRL1_OVER_CUR_POL_SHIFT (8U) -/*! OVER_CUR_POL - Polarity of Overcurrent - * 0b1..Low active (low on this signal represents an overcurrent condition) - * 0b0..High active (high on this signal represents an overcurrent condition) - */ -#define USBNC_CTRL1_OVER_CUR_POL(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL1_OVER_CUR_POL_SHIFT)) & USBNC_CTRL1_OVER_CUR_POL_MASK) - -#define USBNC_CTRL1_PWR_POL_MASK (0x200U) -#define USBNC_CTRL1_PWR_POL_SHIFT (9U) -/*! PWR_POL - Power Polarity - * 0b1..PMIC Power Pin is High active. - * 0b0..PMIC Power Pin is Low active. - */ -#define USBNC_CTRL1_PWR_POL(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL1_PWR_POL_SHIFT)) & USBNC_CTRL1_PWR_POL_MASK) - -#define USBNC_CTRL1_WIE_MASK (0x400U) -#define USBNC_CTRL1_WIE_SHIFT (10U) -/*! WIE - Wake-up Interrupt Enable - * 0b1..Interrupt Enabled - * 0b0..Interrupt Disabled - */ -#define USBNC_CTRL1_WIE(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL1_WIE_SHIFT)) & USBNC_CTRL1_WIE_MASK) - -#define USBNC_CTRL1_WKUP_SW_EN_MASK (0x4000U) -#define USBNC_CTRL1_WKUP_SW_EN_SHIFT (14U) -/*! WKUP_SW_EN - Software Wake-up Enable - * 0b1..Enables - * 0b0..Disables - */ -#define USBNC_CTRL1_WKUP_SW_EN(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL1_WKUP_SW_EN_SHIFT)) & USBNC_CTRL1_WKUP_SW_EN_MASK) - -#define USBNC_CTRL1_WKUP_SW_MASK (0x8000U) -#define USBNC_CTRL1_WKUP_SW_SHIFT (15U) -/*! WKUP_SW - Software Wake-up - * 0b1..Force wake-up - * 0b0..Inactive - */ -#define USBNC_CTRL1_WKUP_SW(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL1_WKUP_SW_SHIFT)) & USBNC_CTRL1_WKUP_SW_MASK) - -#define USBNC_CTRL1_WKUP_ID_EN_MASK (0x10000U) -#define USBNC_CTRL1_WKUP_ID_EN_SHIFT (16U) -/*! WKUP_ID_EN - Wake-up on ID Change Enable - * 0b1..Enables - * 0b0..Disables - */ -#define USBNC_CTRL1_WKUP_ID_EN(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL1_WKUP_ID_EN_SHIFT)) & USBNC_CTRL1_WKUP_ID_EN_MASK) - -#define USBNC_CTRL1_WKUP_VBUS_EN_MASK (0x20000U) -#define USBNC_CTRL1_WKUP_VBUS_EN_SHIFT (17U) -/*! WKUP_VBUS_EN - Wake-up on VBUS Change Enable - * 0b1..Enables - * 0b0..Disables - */ -#define USBNC_CTRL1_WKUP_VBUS_EN(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL1_WKUP_VBUS_EN_SHIFT)) & USBNC_CTRL1_WKUP_VBUS_EN_MASK) - -#define USBNC_CTRL1_WKUP_DPDM_EN_MASK (0x20000000U) -#define USBNC_CTRL1_WKUP_DPDM_EN_SHIFT (29U) -/*! WKUP_DPDM_EN - Wake-up on DPDM Change Enable - * 0b1..DPDM changes wake-up to be enabled, it is for device only - * 0b0..DPDM changes wake-up to be disabled only when VBUS is 0 - */ -#define USBNC_CTRL1_WKUP_DPDM_EN(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL1_WKUP_DPDM_EN_SHIFT)) & USBNC_CTRL1_WKUP_DPDM_EN_MASK) - -#define USBNC_CTRL1_WIR_MASK (0x80000000U) -#define USBNC_CTRL1_WIR_SHIFT (31U) -/*! WIR - Wake-up Interrupt Request - * 0b1..Request received - * 0b0..No request received - */ -#define USBNC_CTRL1_WIR(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL1_WIR_SHIFT)) & USBNC_CTRL1_WIR_MASK) -/*! @} */ - -/*! @name CTRL2 - USB OTG Control 2 */ -/*! @{ */ - -#define USBNC_CTRL2_VBUS_SOURCE_SEL_MASK (0x3U) -#define USBNC_CTRL2_VBUS_SOURCE_SEL_SHIFT (0U) -/*! VBUS_SOURCE_SEL - VBUS Source Select - * 0b00..vbus_valid - * 0b01..sess_valid - * 0b10..sess_valid - * 0b11..sess_valid - */ -#define USBNC_CTRL2_VBUS_SOURCE_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL2_VBUS_SOURCE_SEL_SHIFT)) & USBNC_CTRL2_VBUS_SOURCE_SEL_MASK) - -#define USBNC_CTRL2_AUTURESUME_EN_MASK (0x4U) -#define USBNC_CTRL2_AUTURESUME_EN_SHIFT (2U) -/*! AUTURESUME_EN - Auto Resume Enable - * 0b0..Default - */ -#define USBNC_CTRL2_AUTURESUME_EN(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL2_AUTURESUME_EN_SHIFT)) & USBNC_CTRL2_AUTURESUME_EN_MASK) - -#define USBNC_CTRL2_LOWSPEED_EN_MASK (0x8U) -#define USBNC_CTRL2_LOWSPEED_EN_SHIFT (3U) -/*! LOWSPEED_EN - Low Speed Enable - * 0b0..Default - */ -#define USBNC_CTRL2_LOWSPEED_EN(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL2_LOWSPEED_EN_SHIFT)) & USBNC_CTRL2_LOWSPEED_EN_MASK) - -#define USBNC_CTRL2_UTMI_CLK_VLD_MASK (0x80000000U) -#define USBNC_CTRL2_UTMI_CLK_VLD_SHIFT (31U) -/*! UTMI_CLK_VLD - UTMI Clock Valid - * 0b0..Default - */ -#define USBNC_CTRL2_UTMI_CLK_VLD(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL2_UTMI_CLK_VLD_SHIFT)) & USBNC_CTRL2_UTMI_CLK_VLD_MASK) -/*! @} */ - -/*! @name HSIC_CTRL - USB Host HSIC Control */ -/*! @{ */ - -#define USBNC_HSIC_CTRL_HSIC_CLK_ON_MASK (0x800U) -#define USBNC_HSIC_CTRL_HSIC_CLK_ON_SHIFT (11U) -/*! HSIC_CLK_ON - HSIC Clock ON - * 0b1..Active - * 0b0..Inactive - */ -#define USBNC_HSIC_CTRL_HSIC_CLK_ON(x) (((uint32_t)(((uint32_t)(x)) << USBNC_HSIC_CTRL_HSIC_CLK_ON_SHIFT)) & USBNC_HSIC_CTRL_HSIC_CLK_ON_MASK) - -#define USBNC_HSIC_CTRL_HSIC_EN_MASK (0x1000U) -#define USBNC_HSIC_CTRL_HSIC_EN_SHIFT (12U) -/*! HSIC_EN - Host HSIC Enable - * 0b1..Enabled - * 0b0..Disabled - */ -#define USBNC_HSIC_CTRL_HSIC_EN(x) (((uint32_t)(((uint32_t)(x)) << USBNC_HSIC_CTRL_HSIC_EN_SHIFT)) & USBNC_HSIC_CTRL_HSIC_EN_MASK) - -#define USBNC_HSIC_CTRL_CLK_VLD_MASK (0x80000000U) -#define USBNC_HSIC_CTRL_CLK_VLD_SHIFT (31U) -/*! CLK_VLD - Clock Valid - * 0b1..Valid - * 0b0..Invalid - */ -#define USBNC_HSIC_CTRL_CLK_VLD(x) (((uint32_t)(((uint32_t)(x)) << USBNC_HSIC_CTRL_CLK_VLD_SHIFT)) & USBNC_HSIC_CTRL_CLK_VLD_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group USBNC_Register_Masks */ - - -/* USBNC - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral USBHS1__USBNC base address */ - #define USBHS1__USBNC_BASE (0x5010B200u) - /** Peripheral USBHS1__USBNC base address */ - #define USBHS1__USBNC_BASE_NS (0x4010B200u) - /** Peripheral USBHS1__USBNC base pointer */ - #define USBHS1__USBNC ((USBNC_Type *)USBHS1__USBNC_BASE) - /** Peripheral USBHS1__USBNC base pointer */ - #define USBHS1__USBNC_NS ((USBNC_Type *)USBHS1__USBNC_BASE_NS) - /** Array initializer of USBNC peripheral base addresses */ - #define USBNC_BASE_ADDRS { USBHS1__USBNC_BASE } - /** Array initializer of USBNC peripheral base pointers */ - #define USBNC_BASE_PTRS { USBHS1__USBNC } - /** Array initializer of USBNC peripheral base addresses */ - #define USBNC_BASE_ADDRS_NS { USBHS1__USBNC_BASE_NS } - /** Array initializer of USBNC peripheral base pointers */ - #define USBNC_BASE_PTRS_NS { USBHS1__USBNC_NS } -#else - /** Peripheral USBHS1__USBNC base address */ - #define USBHS1__USBNC_BASE (0x4010B200u) - /** Peripheral USBHS1__USBNC base pointer */ - #define USBHS1__USBNC ((USBNC_Type *)USBHS1__USBNC_BASE) - /** Array initializer of USBNC peripheral base addresses */ - #define USBNC_BASE_ADDRS { USBHS1__USBNC_BASE } - /** Array initializer of USBNC peripheral base pointers */ - #define USBNC_BASE_PTRS { USBHS1__USBNC } -#endif -/* Backward compatibility */ -#define USB_OTGn_CTRL CTRL1 -#define USBNC_USB_OTGn_CTRL_OVER_CUR_DIS_MASK USBNC_CTRL1_OVER_CUR_DIS_MASK -#define USBNC_USB_OTGn_CTRL_OVER_CUR_DIS_SHIFT USBNC_CTRL1_OVER_CUR_DIS_SHIFT -#define USBNC_USB_OTGn_CTRL_OVER_CUR_DIS(x) USBNC_CTRL1_OVER_CUR_DIS(x) -#define USBNC_USB_OTGn_CTRL_OVER_CUR_POL_MASK USBNC_CTRL1_OVER_CUR_POL_MASK -#define USBNC_USB_OTGn_CTRL_OVER_CUR_POL_SHIFT USBNC_CTRL1_OVER_CUR_POL_SHIFT -#define USBNC_USB_OTGn_CTRL_OVER_CUR_POL(x) USBNC_CTRL1_OVER_CUR_POL(x) -#define USBNC_USB_OTGn_CTRL_PWR_POL_MASK USBNC_CTRL1_PWR_POL_MASK -#define USBNC_USB_OTGn_CTRL_PWR_POL_SHIFT USBNC_CTRL1_PWR_POL_SHIFT -#define USBNC_USB_OTGn_CTRL_PWR_POL(x) USBNC_CTRL1_PWR_POL(x) -#define USBNC_USB_OTGn_CTRL_WIE_MASK USBNC_CTRL1_WIE_MASK -#define USBNC_USB_OTGn_CTRL_WIE_SHIFT USBNC_CTRL1_WIE_SHIFT -#define USBNC_USB_OTGn_CTRL_WIE(x) USBNC_CTRL1_WIE(x) -#define USBNC_USB_OTGn_CTRL_WKUP_SW_EN_MASK USBNC_CTRL1_WKUP_SW_EN_MASK -#define USBNC_USB_OTGn_CTRL_WKUP_SW_EN_SHIFT USBNC_CTRL1_WKUP_SW_EN_SHIFT -#define USBNC_USB_OTGn_CTRL_WKUP_SW_EN(x) USBNC_CTRL1_WKUP_SW_EN(x) -#define USBNC_USB_OTGn_CTRL_WKUP_SW_MASK USBNC_CTRL1_WKUP_SW_MASK -#define USBNC_USB_OTGn_CTRL_WKUP_SW_SHIFT USBNC_CTRL1_WKUP_SW_SHIFT -#define USBNC_USB_OTGn_CTRL_WKUP_SW(x) USBNC_CTRL1_WKUP_SW(x) -#define USBNC_USB_OTGn_CTRL_WKUP_ID_EN_MASK USBNC_CTRL1_WKUP_ID_EN_MASK -#define USBNC_USB_OTGn_CTRL_WKUP_ID_EN_SHIFT USBNC_CTRL1_WKUP_ID_EN_SHIFT -#define USBNC_USB_OTGn_CTRL_WKUP_ID_EN(x) USBNC_CTRL1_WKUP_ID_EN(x) -#define USBNC_USB_OTGn_CTRL_WKUP_VBUS_EN_MASK USBNC_CTRL1_WKUP_VBUS_EN_MASK -#define USBNC_USB_OTGn_CTRL_WKUP_VBUS_EN_SHIFT USBNC_CTRL1_WKUP_VBUS_EN_SHIFT -#define USBNC_USB_OTGn_CTRL_WKUP_VBUS_EN(x) USBNC_CTRL1_WKUP_VBUS_EN(x) -#define USBNC_USB_OTGn_CTRL_WKUP_DPDM_EN_MASK USBNC_CTRL1_WKUP_DPDM_EN_MASK -#define USBNC_USB_OTGn_CTRL_WKUP_DPDM_EN_SHIFT USBNC_CTRL1_WKUP_DPDM_EN_SHIFT -#define USBNC_USB_OTGn_CTRL_WKUP_DPDM_EN(x) USBNC_CTRL1_WKUP_DPDM_EN(x) -#define USBNC_USB_OTGn_CTRL_WIR_MASK USBNC_CTRL1_WIR_MASK -#define USBNC_USB_OTGn_CTRL_WIR_SHIFT USBNC_CTRL1_WIR_SHIFT -#define USBNC_USB_OTGn_CTRL_WIR(x) USBNC_CTRL1_WIR(x) - - -/*! - * @} - */ /* end of group USBNC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- USBPHY Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USBPHY_Peripheral_Access_Layer USBPHY Peripheral Access Layer - * @{ - */ - -/** USBPHY - Register Layout Typedef */ -typedef struct { - __IO uint32_t PWD; /**< Power Down, offset: 0x0 */ - __IO uint32_t PWD_SET; /**< Power Down, offset: 0x4 */ - __IO uint32_t PWD_CLR; /**< Power Down, offset: 0x8 */ - __IO uint32_t PWD_TOG; /**< Power Down, offset: 0xC */ - __IO uint32_t TX; /**< TX Control, offset: 0x10 */ - __IO uint32_t TX_SET; /**< TX Control, offset: 0x14 */ - __IO uint32_t TX_CLR; /**< TX Control, offset: 0x18 */ - __IO uint32_t TX_TOG; /**< TX Control, offset: 0x1C */ - __IO uint32_t RX; /**< RX Control, offset: 0x20 */ - __IO uint32_t RX_SET; /**< RX Control, offset: 0x24 */ - __IO uint32_t RX_CLR; /**< RX Control, offset: 0x28 */ - __IO uint32_t RX_TOG; /**< RX Control, offset: 0x2C */ - __IO uint32_t CTRL; /**< General Purpose Control, offset: 0x30 */ - __IO uint32_t CTRL_SET; /**< General Purpose Control, offset: 0x34 */ - __IO uint32_t CTRL_CLR; /**< General Purpose Control, offset: 0x38 */ - __IO uint32_t CTRL_TOG; /**< General Purpose Control, offset: 0x3C */ - __IO uint32_t STATUS; /**< Status, offset: 0x40 */ - uint8_t RESERVED_0[12]; - __IO uint32_t DEBUG0; /**< Debug 0, offset: 0x50 */ - __IO uint32_t DEBUG0_SET; /**< Debug 0, offset: 0x54 */ - __IO uint32_t DEBUG0_CLR; /**< Debug 0, offset: 0x58 */ - __IO uint32_t DEBUG0_TOG; /**< Debug 0, offset: 0x5C */ - uint8_t RESERVED_1[32]; - __I uint32_t VERSION; /**< Version, offset: 0x80 */ - uint8_t RESERVED_2[12]; - __IO uint32_t IP; /**< IP Block, offset: 0x90 */ - __IO uint32_t IP_SET; /**< IP Block, offset: 0x94 */ - __IO uint32_t IP_CLR; /**< IP Block, offset: 0x98 */ - __IO uint32_t IP_TOG; /**< IP Block, offset: 0x9C */ - __IO uint32_t PLL_SIC; /**< PLL SIC, offset: 0xA0 */ - __IO uint32_t PLL_SIC_SET; /**< PLL SIC, offset: 0xA4 */ - __IO uint32_t PLL_SIC_CLR; /**< PLL SIC, offset: 0xA8 */ - __IO uint32_t PLL_SIC_TOG; /**< PLL SIC, offset: 0xAC */ - uint8_t RESERVED_3[16]; - __IO uint32_t USB1_VBUS_DETECT; /**< VBUS Detect, offset: 0xC0 */ - __IO uint32_t USB1_VBUS_DETECT_SET; /**< VBUS Detect, offset: 0xC4 */ - __IO uint32_t USB1_VBUS_DETECT_CLR; /**< VBUS Detect, offset: 0xC8 */ - __IO uint32_t USB1_VBUS_DETECT_TOG; /**< VBUS Detect, offset: 0xCC */ - __I uint32_t USB1_VBUS_DET_STAT; /**< VBUS Detect Status, offset: 0xD0 */ - __I uint32_t USB1_VBUS_DET_STAT_SET; /**< VBUS Detect Status, offset: 0xD4 */ - __I uint32_t USB1_VBUS_DET_STAT_CLR; /**< VBUS Detect Status, offset: 0xD8 */ - __I uint32_t USB1_VBUS_DET_STAT_TOG; /**< VBUS Detect Status, offset: 0xDC */ - __IO uint32_t USB1_CHRG_DETECT; /**< Charger Detect, offset: 0xE0 */ - __IO uint32_t USB1_CHRG_DETECT_SET; /**< Charger Detect, offset: 0xE4 */ - __IO uint32_t USB1_CHRG_DETECT_CLR; /**< Charger Detect, offset: 0xE8 */ - __IO uint32_t USB1_CHRG_DETECT_TOG; /**< Charger Detect, offset: 0xEC */ - __I uint32_t USB1_CHRG_DET_STAT; /**< Charger Detect Status, offset: 0xF0 */ - __I uint32_t USB1_CHRG_DET_STAT_SET; /**< Charger Detect Status, offset: 0xF4 */ - __I uint32_t USB1_CHRG_DET_STAT_CLR; /**< Charger Detect Status, offset: 0xF8 */ - __I uint32_t USB1_CHRG_DET_STAT_TOG; /**< Charger Detect Status, offset: 0xFC */ - __IO uint32_t ANACTRL; /**< Analog Control, offset: 0x100 */ - __IO uint32_t ANACTRL_SET; /**< Analog Control, offset: 0x104 */ - __IO uint32_t ANACTRL_CLR; /**< Analog Control, offset: 0x108 */ - __IO uint32_t ANACTRL_TOG; /**< Analog Control, offset: 0x10C */ - uint8_t RESERVED_4[32]; - __IO uint32_t TRIM_OVERRIDE_EN; /**< Trim, offset: 0x130 */ - __IO uint32_t TRIM_OVERRIDE_EN_SET; /**< Trim, offset: 0x134 */ - __IO uint32_t TRIM_OVERRIDE_EN_CLR; /**< Trim, offset: 0x138 */ - __IO uint32_t TRIM_OVERRIDE_EN_TOG; /**< Trim, offset: 0x13C */ - __IO uint32_t PFDA; /**< PFD A, offset: 0x140 */ - __IO uint32_t PFDA_SET; /**< PFD A, offset: 0x144 */ - __IO uint32_t PFDA_CLR; /**< PFD A, offset: 0x148 */ - __IO uint32_t PFDA_TOG; /**< PFD A, offset: 0x14C */ -} USBPHY_Type; - -/* ---------------------------------------------------------------------------- - -- USBPHY Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USBPHY_Register_Masks USBPHY Register Masks - * @{ - */ - -/*! @name PWD - Power Down */ -/*! @{ */ - -#define USBPHY_PWD_TXPWDFS_MASK (0x400U) -#define USBPHY_PWD_TXPWDFS_SHIFT (10U) -/*! TXPWDFS - Power Down USB FS TX Drivers - * 0b0..Provide bias to enable - * 0b1..Disable or power down - */ -#define USBPHY_PWD_TXPWDFS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_TXPWDFS_SHIFT)) & USBPHY_PWD_TXPWDFS_MASK) - -#define USBPHY_PWD_TXPWDIBIAS_MASK (0x800U) -#define USBPHY_PWD_TXPWDIBIAS_SHIFT (11U) -/*! TXPWDIBIAS - Power Down USBPHY TX Current Bias Block - * 0b0..Enable - * 0b1..Disable or power down - */ -#define USBPHY_PWD_TXPWDIBIAS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_TXPWDIBIAS_SHIFT)) & USBPHY_PWD_TXPWDIBIAS_MASK) - -#define USBPHY_PWD_TXPWDV2I_MASK (0x1000U) -#define USBPHY_PWD_TXPWDV2I_SHIFT (12U) -/*! TXPWDV2I - Power Down USBPHY TX V-I Converter and Current Mirror - * 0b0..Enable - * 0b1..Disable or power down - */ -#define USBPHY_PWD_TXPWDV2I(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_TXPWDV2I_SHIFT)) & USBPHY_PWD_TXPWDV2I_MASK) - -#define USBPHY_PWD_RXPWDENV_MASK (0x20000U) -#define USBPHY_PWD_RXPWDENV_SHIFT (17U) -/*! RXPWDENV - Power Down USB HS RX Envelope Detector - * 0b0..Enable - * 0b1..Disable or power down - */ -#define USBPHY_PWD_RXPWDENV(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_RXPWDENV_SHIFT)) & USBPHY_PWD_RXPWDENV_MASK) - -#define USBPHY_PWD_RXPWD1PT1_MASK (0x40000U) -#define USBPHY_PWD_RXPWD1PT1_SHIFT (18U) -/*! RXPWD1PT1 - Power Down USB FS Differential Receiver - * 0b0..Enable - * 0b1..Disable or power down - */ -#define USBPHY_PWD_RXPWD1PT1(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_RXPWD1PT1_SHIFT)) & USBPHY_PWD_RXPWD1PT1_MASK) - -#define USBPHY_PWD_RXPWDDIFF_MASK (0x80000U) -#define USBPHY_PWD_RXPWDDIFF_SHIFT (19U) -/*! RXPWDDIFF - Power Down USB HS Differential Receiver - * 0b0..Enable - * 0b1..Disable or power down - */ -#define USBPHY_PWD_RXPWDDIFF(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_RXPWDDIFF_SHIFT)) & USBPHY_PWD_RXPWDDIFF_MASK) - -#define USBPHY_PWD_RXPWDRX_MASK (0x100000U) -#define USBPHY_PWD_RXPWDRX_SHIFT (20U) -/*! RXPWDRX - Power Down USBPHY Receiver Circuits - * 0b0..Enable - * 0b1..Disable or power down - */ -#define USBPHY_PWD_RXPWDRX(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_RXPWDRX_SHIFT)) & USBPHY_PWD_RXPWDRX_MASK) -/*! @} */ - -/*! @name PWD_SET - Power Down */ -/*! @{ */ - -#define USBPHY_PWD_SET_TXPWDFS_MASK (0x400U) -#define USBPHY_PWD_SET_TXPWDFS_SHIFT (10U) -/*! TXPWDFS - Power Down USB FS TX Drivers */ -#define USBPHY_PWD_SET_TXPWDFS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_SET_TXPWDFS_SHIFT)) & USBPHY_PWD_SET_TXPWDFS_MASK) - -#define USBPHY_PWD_SET_TXPWDIBIAS_MASK (0x800U) -#define USBPHY_PWD_SET_TXPWDIBIAS_SHIFT (11U) -/*! TXPWDIBIAS - Power Down USBPHY TX Current Bias Block */ -#define USBPHY_PWD_SET_TXPWDIBIAS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_SET_TXPWDIBIAS_SHIFT)) & USBPHY_PWD_SET_TXPWDIBIAS_MASK) - -#define USBPHY_PWD_SET_TXPWDV2I_MASK (0x1000U) -#define USBPHY_PWD_SET_TXPWDV2I_SHIFT (12U) -/*! TXPWDV2I - Power Down USBPHY TX V-I Converter and Current Mirror */ -#define USBPHY_PWD_SET_TXPWDV2I(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_SET_TXPWDV2I_SHIFT)) & USBPHY_PWD_SET_TXPWDV2I_MASK) - -#define USBPHY_PWD_SET_RXPWDENV_MASK (0x20000U) -#define USBPHY_PWD_SET_RXPWDENV_SHIFT (17U) -/*! RXPWDENV - Power Down USB HS RX Envelope Detector */ -#define USBPHY_PWD_SET_RXPWDENV(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_SET_RXPWDENV_SHIFT)) & USBPHY_PWD_SET_RXPWDENV_MASK) - -#define USBPHY_PWD_SET_RXPWD1PT1_MASK (0x40000U) -#define USBPHY_PWD_SET_RXPWD1PT1_SHIFT (18U) -/*! RXPWD1PT1 - Power Down USB FS Differential Receiver */ -#define USBPHY_PWD_SET_RXPWD1PT1(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_SET_RXPWD1PT1_SHIFT)) & USBPHY_PWD_SET_RXPWD1PT1_MASK) - -#define USBPHY_PWD_SET_RXPWDDIFF_MASK (0x80000U) -#define USBPHY_PWD_SET_RXPWDDIFF_SHIFT (19U) -/*! RXPWDDIFF - Power Down USB HS Differential Receiver */ -#define USBPHY_PWD_SET_RXPWDDIFF(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_SET_RXPWDDIFF_SHIFT)) & USBPHY_PWD_SET_RXPWDDIFF_MASK) - -#define USBPHY_PWD_SET_RXPWDRX_MASK (0x100000U) -#define USBPHY_PWD_SET_RXPWDRX_SHIFT (20U) -/*! RXPWDRX - Power Down USBPHY Receiver Circuits */ -#define USBPHY_PWD_SET_RXPWDRX(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_SET_RXPWDRX_SHIFT)) & USBPHY_PWD_SET_RXPWDRX_MASK) -/*! @} */ - -/*! @name PWD_CLR - Power Down */ -/*! @{ */ - -#define USBPHY_PWD_CLR_TXPWDFS_MASK (0x400U) -#define USBPHY_PWD_CLR_TXPWDFS_SHIFT (10U) -/*! TXPWDFS - Power Down USB FS TX Drivers */ -#define USBPHY_PWD_CLR_TXPWDFS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_CLR_TXPWDFS_SHIFT)) & USBPHY_PWD_CLR_TXPWDFS_MASK) - -#define USBPHY_PWD_CLR_TXPWDIBIAS_MASK (0x800U) -#define USBPHY_PWD_CLR_TXPWDIBIAS_SHIFT (11U) -/*! TXPWDIBIAS - Power Down USBPHY TX Current Bias Block */ -#define USBPHY_PWD_CLR_TXPWDIBIAS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_CLR_TXPWDIBIAS_SHIFT)) & USBPHY_PWD_CLR_TXPWDIBIAS_MASK) - -#define USBPHY_PWD_CLR_TXPWDV2I_MASK (0x1000U) -#define USBPHY_PWD_CLR_TXPWDV2I_SHIFT (12U) -/*! TXPWDV2I - Power Down USBPHY TX V-I Converter and Current Mirror */ -#define USBPHY_PWD_CLR_TXPWDV2I(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_CLR_TXPWDV2I_SHIFT)) & USBPHY_PWD_CLR_TXPWDV2I_MASK) - -#define USBPHY_PWD_CLR_RXPWDENV_MASK (0x20000U) -#define USBPHY_PWD_CLR_RXPWDENV_SHIFT (17U) -/*! RXPWDENV - Power Down USB HS RX Envelope Detector */ -#define USBPHY_PWD_CLR_RXPWDENV(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_CLR_RXPWDENV_SHIFT)) & USBPHY_PWD_CLR_RXPWDENV_MASK) - -#define USBPHY_PWD_CLR_RXPWD1PT1_MASK (0x40000U) -#define USBPHY_PWD_CLR_RXPWD1PT1_SHIFT (18U) -/*! RXPWD1PT1 - Power Down USB FS Differential Receiver */ -#define USBPHY_PWD_CLR_RXPWD1PT1(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_CLR_RXPWD1PT1_SHIFT)) & USBPHY_PWD_CLR_RXPWD1PT1_MASK) - -#define USBPHY_PWD_CLR_RXPWDDIFF_MASK (0x80000U) -#define USBPHY_PWD_CLR_RXPWDDIFF_SHIFT (19U) -/*! RXPWDDIFF - Power Down USB HS Differential Receiver */ -#define USBPHY_PWD_CLR_RXPWDDIFF(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_CLR_RXPWDDIFF_SHIFT)) & USBPHY_PWD_CLR_RXPWDDIFF_MASK) - -#define USBPHY_PWD_CLR_RXPWDRX_MASK (0x100000U) -#define USBPHY_PWD_CLR_RXPWDRX_SHIFT (20U) -/*! RXPWDRX - Power Down USBPHY Receiver Circuits */ -#define USBPHY_PWD_CLR_RXPWDRX(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_CLR_RXPWDRX_SHIFT)) & USBPHY_PWD_CLR_RXPWDRX_MASK) -/*! @} */ - -/*! @name PWD_TOG - Power Down */ -/*! @{ */ - -#define USBPHY_PWD_TOG_TXPWDFS_MASK (0x400U) -#define USBPHY_PWD_TOG_TXPWDFS_SHIFT (10U) -/*! TXPWDFS - Power Down USB FS TX Drivers */ -#define USBPHY_PWD_TOG_TXPWDFS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_TOG_TXPWDFS_SHIFT)) & USBPHY_PWD_TOG_TXPWDFS_MASK) - -#define USBPHY_PWD_TOG_TXPWDIBIAS_MASK (0x800U) -#define USBPHY_PWD_TOG_TXPWDIBIAS_SHIFT (11U) -/*! TXPWDIBIAS - Power Down USBPHY TX Current Bias Block */ -#define USBPHY_PWD_TOG_TXPWDIBIAS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_TOG_TXPWDIBIAS_SHIFT)) & USBPHY_PWD_TOG_TXPWDIBIAS_MASK) - -#define USBPHY_PWD_TOG_TXPWDV2I_MASK (0x1000U) -#define USBPHY_PWD_TOG_TXPWDV2I_SHIFT (12U) -/*! TXPWDV2I - Power Down USBPHY TX V-I Converter and Current Mirror */ -#define USBPHY_PWD_TOG_TXPWDV2I(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_TOG_TXPWDV2I_SHIFT)) & USBPHY_PWD_TOG_TXPWDV2I_MASK) - -#define USBPHY_PWD_TOG_RXPWDENV_MASK (0x20000U) -#define USBPHY_PWD_TOG_RXPWDENV_SHIFT (17U) -/*! RXPWDENV - Power Down USB HS RX Envelope Detector */ -#define USBPHY_PWD_TOG_RXPWDENV(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_TOG_RXPWDENV_SHIFT)) & USBPHY_PWD_TOG_RXPWDENV_MASK) - -#define USBPHY_PWD_TOG_RXPWD1PT1_MASK (0x40000U) -#define USBPHY_PWD_TOG_RXPWD1PT1_SHIFT (18U) -/*! RXPWD1PT1 - Power Down USB FS Differential Receiver */ -#define USBPHY_PWD_TOG_RXPWD1PT1(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_TOG_RXPWD1PT1_SHIFT)) & USBPHY_PWD_TOG_RXPWD1PT1_MASK) - -#define USBPHY_PWD_TOG_RXPWDDIFF_MASK (0x80000U) -#define USBPHY_PWD_TOG_RXPWDDIFF_SHIFT (19U) -/*! RXPWDDIFF - Power Down USB HS Differential Receiver */ -#define USBPHY_PWD_TOG_RXPWDDIFF(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_TOG_RXPWDDIFF_SHIFT)) & USBPHY_PWD_TOG_RXPWDDIFF_MASK) - -#define USBPHY_PWD_TOG_RXPWDRX_MASK (0x100000U) -#define USBPHY_PWD_TOG_RXPWDRX_SHIFT (20U) -/*! RXPWDRX - Power Down USBPHY Receiver Circuits */ -#define USBPHY_PWD_TOG_RXPWDRX(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_TOG_RXPWDRX_SHIFT)) & USBPHY_PWD_TOG_RXPWDRX_MASK) -/*! @} */ - -/*! @name TX - TX Control */ -/*! @{ */ - -#define USBPHY_TX_D_CAL_MASK (0xFU) -#define USBPHY_TX_D_CAL_SHIFT (0U) -/*! D_CAL - HS TX Output Current Trim - * 0b0000..Maximum current, approximately 19% above nominal - * 0b0111..Nominal - * 0b1111..Minimum current, approximately 19% below nominal - */ -#define USBPHY_TX_D_CAL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_D_CAL_SHIFT)) & USBPHY_TX_D_CAL_MASK) - -#define USBPHY_TX_TXCAL45DN_MASK (0xF00U) -#define USBPHY_TX_TXCAL45DN_SHIFT (8U) -/*! TXCAL45DN - DM Series Termination Resistance Trim */ -#define USBPHY_TX_TXCAL45DN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_TXCAL45DN_SHIFT)) & USBPHY_TX_TXCAL45DN_MASK) - -#define USBPHY_TX_TXCAL45DP_MASK (0xF0000U) -#define USBPHY_TX_TXCAL45DP_SHIFT (16U) -/*! TXCAL45DP - DP Series Termination Resistance Trim */ -#define USBPHY_TX_TXCAL45DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_TXCAL45DP_SHIFT)) & USBPHY_TX_TXCAL45DP_MASK) -/*! @} */ - -/*! @name TX_SET - TX Control */ -/*! @{ */ - -#define USBPHY_TX_SET_D_CAL_MASK (0xFU) -#define USBPHY_TX_SET_D_CAL_SHIFT (0U) -/*! D_CAL - HS TX Output Current Trim */ -#define USBPHY_TX_SET_D_CAL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_SET_D_CAL_SHIFT)) & USBPHY_TX_SET_D_CAL_MASK) - -#define USBPHY_TX_SET_TXCAL45DN_MASK (0xF00U) -#define USBPHY_TX_SET_TXCAL45DN_SHIFT (8U) -/*! TXCAL45DN - DM Series Termination Resistance Trim */ -#define USBPHY_TX_SET_TXCAL45DN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_SET_TXCAL45DN_SHIFT)) & USBPHY_TX_SET_TXCAL45DN_MASK) - -#define USBPHY_TX_SET_TXCAL45DP_MASK (0xF0000U) -#define USBPHY_TX_SET_TXCAL45DP_SHIFT (16U) -/*! TXCAL45DP - DP Series Termination Resistance Trim */ -#define USBPHY_TX_SET_TXCAL45DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_SET_TXCAL45DP_SHIFT)) & USBPHY_TX_SET_TXCAL45DP_MASK) -/*! @} */ - -/*! @name TX_CLR - TX Control */ -/*! @{ */ - -#define USBPHY_TX_CLR_D_CAL_MASK (0xFU) -#define USBPHY_TX_CLR_D_CAL_SHIFT (0U) -/*! D_CAL - HS TX Output Current Trim */ -#define USBPHY_TX_CLR_D_CAL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_CLR_D_CAL_SHIFT)) & USBPHY_TX_CLR_D_CAL_MASK) - -#define USBPHY_TX_CLR_TXCAL45DN_MASK (0xF00U) -#define USBPHY_TX_CLR_TXCAL45DN_SHIFT (8U) -/*! TXCAL45DN - DM Series Termination Resistance Trim */ -#define USBPHY_TX_CLR_TXCAL45DN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_CLR_TXCAL45DN_SHIFT)) & USBPHY_TX_CLR_TXCAL45DN_MASK) - -#define USBPHY_TX_CLR_TXCAL45DP_MASK (0xF0000U) -#define USBPHY_TX_CLR_TXCAL45DP_SHIFT (16U) -/*! TXCAL45DP - DP Series Termination Resistance Trim */ -#define USBPHY_TX_CLR_TXCAL45DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_CLR_TXCAL45DP_SHIFT)) & USBPHY_TX_CLR_TXCAL45DP_MASK) -/*! @} */ - -/*! @name TX_TOG - TX Control */ -/*! @{ */ - -#define USBPHY_TX_TOG_D_CAL_MASK (0xFU) -#define USBPHY_TX_TOG_D_CAL_SHIFT (0U) -/*! D_CAL - HS TX Output Current Trim */ -#define USBPHY_TX_TOG_D_CAL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_TOG_D_CAL_SHIFT)) & USBPHY_TX_TOG_D_CAL_MASK) - -#define USBPHY_TX_TOG_TXCAL45DN_MASK (0xF00U) -#define USBPHY_TX_TOG_TXCAL45DN_SHIFT (8U) -/*! TXCAL45DN - DM Series Termination Resistance Trim */ -#define USBPHY_TX_TOG_TXCAL45DN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_TOG_TXCAL45DN_SHIFT)) & USBPHY_TX_TOG_TXCAL45DN_MASK) - -#define USBPHY_TX_TOG_TXCAL45DP_MASK (0xF0000U) -#define USBPHY_TX_TOG_TXCAL45DP_SHIFT (16U) -/*! TXCAL45DP - DP Series Termination Resistance Trim */ -#define USBPHY_TX_TOG_TXCAL45DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_TOG_TXCAL45DP_SHIFT)) & USBPHY_TX_TOG_TXCAL45DP_MASK) -/*! @} */ - -/*! @name RX - RX Control */ -/*! @{ */ - -#define USBPHY_RX_ENVADJ_MASK (0x7U) -#define USBPHY_RX_ENVADJ_SHIFT (0U) -/*! ENVADJ - Envelope Detector Trip Point - * 0b000..0.1000 V - * 0b001..0.1125 V - * 0b010..0.1250 V - * 0b011..0.0875 V - * 0b1xx.. - */ -#define USBPHY_RX_ENVADJ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_RX_ENVADJ_SHIFT)) & USBPHY_RX_ENVADJ_MASK) - -#define USBPHY_RX_DISCONADJ_MASK (0x70U) -#define USBPHY_RX_DISCONADJ_SHIFT (4U) -/*! DISCONADJ - Disconnect Detector Trip Point - * 0b000..0.56875 V - * 0b001..0.55000 V - * 0b010..0.58125 V - * 0b011..0.60000 V - * 0b1xx.. - */ -#define USBPHY_RX_DISCONADJ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_RX_DISCONADJ_SHIFT)) & USBPHY_RX_DISCONADJ_MASK) -/*! @} */ - -/*! @name RX_SET - RX Control */ -/*! @{ */ - -#define USBPHY_RX_SET_ENVADJ_MASK (0x7U) -#define USBPHY_RX_SET_ENVADJ_SHIFT (0U) -/*! ENVADJ - Envelope Detector Trip Point */ -#define USBPHY_RX_SET_ENVADJ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_RX_SET_ENVADJ_SHIFT)) & USBPHY_RX_SET_ENVADJ_MASK) - -#define USBPHY_RX_SET_DISCONADJ_MASK (0x70U) -#define USBPHY_RX_SET_DISCONADJ_SHIFT (4U) -/*! DISCONADJ - Disconnect Detector Trip Point */ -#define USBPHY_RX_SET_DISCONADJ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_RX_SET_DISCONADJ_SHIFT)) & USBPHY_RX_SET_DISCONADJ_MASK) -/*! @} */ - -/*! @name RX_CLR - RX Control */ -/*! @{ */ - -#define USBPHY_RX_CLR_ENVADJ_MASK (0x7U) -#define USBPHY_RX_CLR_ENVADJ_SHIFT (0U) -/*! ENVADJ - Envelope Detector Trip Point */ -#define USBPHY_RX_CLR_ENVADJ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_RX_CLR_ENVADJ_SHIFT)) & USBPHY_RX_CLR_ENVADJ_MASK) - -#define USBPHY_RX_CLR_DISCONADJ_MASK (0x70U) -#define USBPHY_RX_CLR_DISCONADJ_SHIFT (4U) -/*! DISCONADJ - Disconnect Detector Trip Point */ -#define USBPHY_RX_CLR_DISCONADJ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_RX_CLR_DISCONADJ_SHIFT)) & USBPHY_RX_CLR_DISCONADJ_MASK) -/*! @} */ - -/*! @name RX_TOG - RX Control */ -/*! @{ */ - -#define USBPHY_RX_TOG_ENVADJ_MASK (0x7U) -#define USBPHY_RX_TOG_ENVADJ_SHIFT (0U) -/*! ENVADJ - Envelope Detector Trip Point */ -#define USBPHY_RX_TOG_ENVADJ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_RX_TOG_ENVADJ_SHIFT)) & USBPHY_RX_TOG_ENVADJ_MASK) - -#define USBPHY_RX_TOG_DISCONADJ_MASK (0x70U) -#define USBPHY_RX_TOG_DISCONADJ_SHIFT (4U) -/*! DISCONADJ - Disconnect Detector Trip Point */ -#define USBPHY_RX_TOG_DISCONADJ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_RX_TOG_DISCONADJ_SHIFT)) & USBPHY_RX_TOG_DISCONADJ_MASK) -/*! @} */ - -/*! @name CTRL - General Purpose Control */ -/*! @{ */ - -#define USBPHY_CTRL_ENOTG_ID_CHG_IRQ_MASK (0x1U) -#define USBPHY_CTRL_ENOTG_ID_CHG_IRQ_SHIFT (0U) -/*! ENOTG_ID_CHG_IRQ - OTG ID Change Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENOTG_ID_CHG_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENOTG_ID_CHG_IRQ_SHIFT)) & USBPHY_CTRL_ENOTG_ID_CHG_IRQ_MASK) - -#define USBPHY_CTRL_ENHOSTDISCONDETECT_MASK (0x2U) -#define USBPHY_CTRL_ENHOSTDISCONDETECT_SHIFT (1U) -/*! ENHOSTDISCONDETECT - Host Disconnect Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENHOSTDISCONDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENHOSTDISCONDETECT_SHIFT)) & USBPHY_CTRL_ENHOSTDISCONDETECT_MASK) - -#define USBPHY_CTRL_ENIRQHOSTDISCON_MASK (0x4U) -#define USBPHY_CTRL_ENIRQHOSTDISCON_SHIFT (2U) -/*! ENIRQHOSTDISCON - Enable Interrupt for Host Disconnect - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENIRQHOSTDISCON(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENIRQHOSTDISCON_SHIFT)) & USBPHY_CTRL_ENIRQHOSTDISCON_MASK) - -#define USBPHY_CTRL_HOSTDISCONDETECT_IRQ_MASK (0x8U) -#define USBPHY_CTRL_HOSTDISCONDETECT_IRQ_SHIFT (3U) -/*! HOSTDISCONDETECT_IRQ - Host Disconnect Detection Interrupt - * 0b0..Connected - * 0b1..Disconnected - */ -#define USBPHY_CTRL_HOSTDISCONDETECT_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_HOSTDISCONDETECT_IRQ_SHIFT)) & USBPHY_CTRL_HOSTDISCONDETECT_IRQ_MASK) - -#define USBPHY_CTRL_ENDEVPLUGINDETECT_MASK (0x10U) -#define USBPHY_CTRL_ENDEVPLUGINDETECT_SHIFT (4U) -/*! ENDEVPLUGINDETECT - Enable Nonstandard Resistive Plugged-In Detection - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENDEVPLUGINDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENDEVPLUGINDETECT_SHIFT)) & USBPHY_CTRL_ENDEVPLUGINDETECT_MASK) - -#define USBPHY_CTRL_DEVPLUGIN_POLARITY_MASK (0x20U) -#define USBPHY_CTRL_DEVPLUGIN_POLARITY_SHIFT (5U) -/*! DEVPLUGIN_POLARITY - Device Plug-In Polarity - * 0b0..Plugged in - * 0b1..Unplugged - */ -#define USBPHY_CTRL_DEVPLUGIN_POLARITY(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_DEVPLUGIN_POLARITY_SHIFT)) & USBPHY_CTRL_DEVPLUGIN_POLARITY_MASK) - -#define USBPHY_CTRL_OTG_ID_CHG_IRQ_MASK (0x40U) -#define USBPHY_CTRL_OTG_ID_CHG_IRQ_SHIFT (6U) -/*! OTG_ID_CHG_IRQ - OTG ID Change Interrupt - * 0b0..No ID change interrupt - * 0b1..ID change interrupt - */ -#define USBPHY_CTRL_OTG_ID_CHG_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_OTG_ID_CHG_IRQ_SHIFT)) & USBPHY_CTRL_OTG_ID_CHG_IRQ_MASK) - -#define USBPHY_CTRL_ENOTGIDDETECT_MASK (0x80U) -#define USBPHY_CTRL_ENOTGIDDETECT_SHIFT (7U) -/*! ENOTGIDDETECT - Enable Internal OTG ID Detector - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENOTGIDDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENOTGIDDETECT_SHIFT)) & USBPHY_CTRL_ENOTGIDDETECT_MASK) - -#define USBPHY_CTRL_RESUMEIRQSTICKY_MASK (0x100U) -#define USBPHY_CTRL_RESUMEIRQSTICKY_SHIFT (8U) -/*! RESUMEIRQSTICKY - Resume Interrupt Sticky - * 0b0..During the resume or reset state signaling period - * 0b1..Until you write 0 to it - */ -#define USBPHY_CTRL_RESUMEIRQSTICKY(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_RESUMEIRQSTICKY_SHIFT)) & USBPHY_CTRL_RESUMEIRQSTICKY_MASK) - -#define USBPHY_CTRL_ENIRQRESUMEDETECT_MASK (0x200U) -#define USBPHY_CTRL_ENIRQRESUMEDETECT_SHIFT (9U) -/*! ENIRQRESUMEDETECT - Resume Detection Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENIRQRESUMEDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENIRQRESUMEDETECT_SHIFT)) & USBPHY_CTRL_ENIRQRESUMEDETECT_MASK) - -#define USBPHY_CTRL_RESUME_IRQ_MASK (0x400U) -#define USBPHY_CTRL_RESUME_IRQ_SHIFT (10U) -/*! RESUME_IRQ - Resume Interrupt - * 0b0..No resume interrupt - * 0b1..Resume interrupt - */ -#define USBPHY_CTRL_RESUME_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_RESUME_IRQ_SHIFT)) & USBPHY_CTRL_RESUME_IRQ_MASK) - -#define USBPHY_CTRL_ENIRQDEVPLUGIN_MASK (0x800U) -#define USBPHY_CTRL_ENIRQDEVPLUGIN_SHIFT (11U) -/*! ENIRQDEVPLUGIN - Enable Interrupt for Nonstandard Resistive Plugged-In Detection - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENIRQDEVPLUGIN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENIRQDEVPLUGIN_SHIFT)) & USBPHY_CTRL_ENIRQDEVPLUGIN_MASK) - -#define USBPHY_CTRL_DEVPLUGIN_IRQ_MASK (0x1000U) -#define USBPHY_CTRL_DEVPLUGIN_IRQ_SHIFT (12U) -/*! DEVPLUGIN_IRQ - Device Plug-In Interrupt */ -#define USBPHY_CTRL_DEVPLUGIN_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_DEVPLUGIN_IRQ_SHIFT)) & USBPHY_CTRL_DEVPLUGIN_IRQ_MASK) - -#define USBPHY_CTRL_DATA_ON_LRADC_MASK (0x2000U) -#define USBPHY_CTRL_DATA_ON_LRADC_SHIFT (13U) -/*! DATA_ON_LRADC - APB Clock Switch Option */ -#define USBPHY_CTRL_DATA_ON_LRADC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_DATA_ON_LRADC_SHIFT)) & USBPHY_CTRL_DATA_ON_LRADC_MASK) - -#define USBPHY_CTRL_ENUTMILEVEL2_MASK (0x4000U) -#define USBPHY_CTRL_ENUTMILEVEL2_SHIFT (14U) -/*! ENUTMILEVEL2 - UTMI Level 2 Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENUTMILEVEL2(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENUTMILEVEL2_SHIFT)) & USBPHY_CTRL_ENUTMILEVEL2_MASK) - -#define USBPHY_CTRL_ENUTMILEVEL3_MASK (0x8000U) -#define USBPHY_CTRL_ENUTMILEVEL3_SHIFT (15U) -/*! ENUTMILEVEL3 - UTMI Level 3 Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENUTMILEVEL3(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENUTMILEVEL3_SHIFT)) & USBPHY_CTRL_ENUTMILEVEL3_MASK) - -#define USBPHY_CTRL_ENIRQWAKEUP_MASK (0x10000U) -#define USBPHY_CTRL_ENIRQWAKEUP_SHIFT (16U) -/*! ENIRQWAKEUP - Wake-Up Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENIRQWAKEUP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENIRQWAKEUP_SHIFT)) & USBPHY_CTRL_ENIRQWAKEUP_MASK) - -#define USBPHY_CTRL_WAKEUP_IRQ_MASK (0x20000U) -#define USBPHY_CTRL_WAKEUP_IRQ_SHIFT (17U) -/*! WAKEUP_IRQ - Wake-Up Interrupt */ -#define USBPHY_CTRL_WAKEUP_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_WAKEUP_IRQ_SHIFT)) & USBPHY_CTRL_WAKEUP_IRQ_MASK) - -#define USBPHY_CTRL_AUTORESUME_EN_MASK (0x40000U) -#define USBPHY_CTRL_AUTORESUME_EN_SHIFT (18U) -/*! AUTORESUME_EN - Autoresume Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_AUTORESUME_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_AUTORESUME_EN_SHIFT)) & USBPHY_CTRL_AUTORESUME_EN_MASK) - -#define USBPHY_CTRL_ENAUTOCLR_CLKGATE_MASK (0x80000U) -#define USBPHY_CTRL_ENAUTOCLR_CLKGATE_SHIFT (19U) -/*! ENAUTOCLR_CLKGATE - Autoclear Clock Gate Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENAUTOCLR_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENAUTOCLR_CLKGATE_SHIFT)) & USBPHY_CTRL_ENAUTOCLR_CLKGATE_MASK) - -#define USBPHY_CTRL_ENAUTOCLR_PHY_PWD_MASK (0x100000U) -#define USBPHY_CTRL_ENAUTOCLR_PHY_PWD_SHIFT (20U) -/*! ENAUTOCLR_PHY_PWD - PHY PWD Autoclear Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENAUTOCLR_PHY_PWD(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENAUTOCLR_PHY_PWD_SHIFT)) & USBPHY_CTRL_ENAUTOCLR_PHY_PWD_MASK) - -#define USBPHY_CTRL_OTG_ID_VALUE_MASK (0x8000000U) -#define USBPHY_CTRL_OTG_ID_VALUE_SHIFT (27U) -/*! OTG_ID_VALUE - OTG ID Value - * 0b0..Host - * 0b1..Device - */ -#define USBPHY_CTRL_OTG_ID_VALUE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_OTG_ID_VALUE_SHIFT)) & USBPHY_CTRL_OTG_ID_VALUE_MASK) - -#define USBPHY_CTRL_UTMI_SUSPENDM_MASK (0x20000000U) -#define USBPHY_CTRL_UTMI_SUSPENDM_SHIFT (29U) -/*! UTMI_SUSPENDM - UTMI Suspend - * 0b0..Not suspended - * 0b1..Suspended - */ -#define USBPHY_CTRL_UTMI_SUSPENDM(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_UTMI_SUSPENDM_SHIFT)) & USBPHY_CTRL_UTMI_SUSPENDM_MASK) - -#define USBPHY_CTRL_CLKGATE_MASK (0x40000000U) -#define USBPHY_CTRL_CLKGATE_SHIFT (30U) -/*! CLKGATE - UTMI Clock Gate - * 0b0..Run clocks - * 0b1..Gate clocks - */ -#define USBPHY_CTRL_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLKGATE_SHIFT)) & USBPHY_CTRL_CLKGATE_MASK) - -#define USBPHY_CTRL_SFTRST_MASK (0x80000000U) -#define USBPHY_CTRL_SFTRST_SHIFT (31U) -/*! SFTRST - Software Reset - * 0b0..Release from reset - * 0b1..Soft-reset - */ -#define USBPHY_CTRL_SFTRST(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SFTRST_SHIFT)) & USBPHY_CTRL_SFTRST_MASK) -/*! @} */ - -/*! @name CTRL_SET - General Purpose Control */ -/*! @{ */ - -#define USBPHY_CTRL_SET_ENOTG_ID_CHG_IRQ_MASK (0x1U) -#define USBPHY_CTRL_SET_ENOTG_ID_CHG_IRQ_SHIFT (0U) -/*! ENOTG_ID_CHG_IRQ - OTG ID Change Interrupt Enable */ -#define USBPHY_CTRL_SET_ENOTG_ID_CHG_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENOTG_ID_CHG_IRQ_SHIFT)) & USBPHY_CTRL_SET_ENOTG_ID_CHG_IRQ_MASK) - -#define USBPHY_CTRL_SET_ENHOSTDISCONDETECT_MASK (0x2U) -#define USBPHY_CTRL_SET_ENHOSTDISCONDETECT_SHIFT (1U) -/*! ENHOSTDISCONDETECT - Host Disconnect Detection Enable */ -#define USBPHY_CTRL_SET_ENHOSTDISCONDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENHOSTDISCONDETECT_SHIFT)) & USBPHY_CTRL_SET_ENHOSTDISCONDETECT_MASK) - -#define USBPHY_CTRL_SET_ENIRQHOSTDISCON_MASK (0x4U) -#define USBPHY_CTRL_SET_ENIRQHOSTDISCON_SHIFT (2U) -/*! ENIRQHOSTDISCON - Enable Interrupt for Host Disconnect */ -#define USBPHY_CTRL_SET_ENIRQHOSTDISCON(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENIRQHOSTDISCON_SHIFT)) & USBPHY_CTRL_SET_ENIRQHOSTDISCON_MASK) - -#define USBPHY_CTRL_SET_HOSTDISCONDETECT_IRQ_MASK (0x8U) -#define USBPHY_CTRL_SET_HOSTDISCONDETECT_IRQ_SHIFT (3U) -/*! HOSTDISCONDETECT_IRQ - Host Disconnect Detection Interrupt */ -#define USBPHY_CTRL_SET_HOSTDISCONDETECT_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_HOSTDISCONDETECT_IRQ_SHIFT)) & USBPHY_CTRL_SET_HOSTDISCONDETECT_IRQ_MASK) - -#define USBPHY_CTRL_SET_ENDEVPLUGINDETECT_MASK (0x10U) -#define USBPHY_CTRL_SET_ENDEVPLUGINDETECT_SHIFT (4U) -/*! ENDEVPLUGINDETECT - Enable Nonstandard Resistive Plugged-In Detection */ -#define USBPHY_CTRL_SET_ENDEVPLUGINDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENDEVPLUGINDETECT_SHIFT)) & USBPHY_CTRL_SET_ENDEVPLUGINDETECT_MASK) - -#define USBPHY_CTRL_SET_DEVPLUGIN_POLARITY_MASK (0x20U) -#define USBPHY_CTRL_SET_DEVPLUGIN_POLARITY_SHIFT (5U) -/*! DEVPLUGIN_POLARITY - Device Plug-In Polarity */ -#define USBPHY_CTRL_SET_DEVPLUGIN_POLARITY(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_DEVPLUGIN_POLARITY_SHIFT)) & USBPHY_CTRL_SET_DEVPLUGIN_POLARITY_MASK) - -#define USBPHY_CTRL_SET_OTG_ID_CHG_IRQ_MASK (0x40U) -#define USBPHY_CTRL_SET_OTG_ID_CHG_IRQ_SHIFT (6U) -/*! OTG_ID_CHG_IRQ - OTG ID Change Interrupt */ -#define USBPHY_CTRL_SET_OTG_ID_CHG_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_OTG_ID_CHG_IRQ_SHIFT)) & USBPHY_CTRL_SET_OTG_ID_CHG_IRQ_MASK) - -#define USBPHY_CTRL_SET_ENOTGIDDETECT_MASK (0x80U) -#define USBPHY_CTRL_SET_ENOTGIDDETECT_SHIFT (7U) -/*! ENOTGIDDETECT - Enable Internal OTG ID Detector */ -#define USBPHY_CTRL_SET_ENOTGIDDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENOTGIDDETECT_SHIFT)) & USBPHY_CTRL_SET_ENOTGIDDETECT_MASK) - -#define USBPHY_CTRL_SET_RESUMEIRQSTICKY_MASK (0x100U) -#define USBPHY_CTRL_SET_RESUMEIRQSTICKY_SHIFT (8U) -/*! RESUMEIRQSTICKY - Resume Interrupt Sticky */ -#define USBPHY_CTRL_SET_RESUMEIRQSTICKY(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_RESUMEIRQSTICKY_SHIFT)) & USBPHY_CTRL_SET_RESUMEIRQSTICKY_MASK) - -#define USBPHY_CTRL_SET_ENIRQRESUMEDETECT_MASK (0x200U) -#define USBPHY_CTRL_SET_ENIRQRESUMEDETECT_SHIFT (9U) -/*! ENIRQRESUMEDETECT - Resume Detection Interrupt Enable */ -#define USBPHY_CTRL_SET_ENIRQRESUMEDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENIRQRESUMEDETECT_SHIFT)) & USBPHY_CTRL_SET_ENIRQRESUMEDETECT_MASK) - -#define USBPHY_CTRL_SET_RESUME_IRQ_MASK (0x400U) -#define USBPHY_CTRL_SET_RESUME_IRQ_SHIFT (10U) -/*! RESUME_IRQ - Resume Interrupt */ -#define USBPHY_CTRL_SET_RESUME_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_RESUME_IRQ_SHIFT)) & USBPHY_CTRL_SET_RESUME_IRQ_MASK) - -#define USBPHY_CTRL_SET_ENIRQDEVPLUGIN_MASK (0x800U) -#define USBPHY_CTRL_SET_ENIRQDEVPLUGIN_SHIFT (11U) -/*! ENIRQDEVPLUGIN - Enable Interrupt for Nonstandard Resistive Plugged-In Detection */ -#define USBPHY_CTRL_SET_ENIRQDEVPLUGIN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENIRQDEVPLUGIN_SHIFT)) & USBPHY_CTRL_SET_ENIRQDEVPLUGIN_MASK) - -#define USBPHY_CTRL_SET_DEVPLUGIN_IRQ_MASK (0x1000U) -#define USBPHY_CTRL_SET_DEVPLUGIN_IRQ_SHIFT (12U) -/*! DEVPLUGIN_IRQ - Device Plug-In Interrupt */ -#define USBPHY_CTRL_SET_DEVPLUGIN_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_DEVPLUGIN_IRQ_SHIFT)) & USBPHY_CTRL_SET_DEVPLUGIN_IRQ_MASK) - -#define USBPHY_CTRL_SET_DATA_ON_LRADC_MASK (0x2000U) -#define USBPHY_CTRL_SET_DATA_ON_LRADC_SHIFT (13U) -/*! DATA_ON_LRADC - APB Clock Switch Option */ -#define USBPHY_CTRL_SET_DATA_ON_LRADC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_DATA_ON_LRADC_SHIFT)) & USBPHY_CTRL_SET_DATA_ON_LRADC_MASK) - -#define USBPHY_CTRL_SET_ENUTMILEVEL2_MASK (0x4000U) -#define USBPHY_CTRL_SET_ENUTMILEVEL2_SHIFT (14U) -/*! ENUTMILEVEL2 - UTMI Level 2 Enable */ -#define USBPHY_CTRL_SET_ENUTMILEVEL2(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENUTMILEVEL2_SHIFT)) & USBPHY_CTRL_SET_ENUTMILEVEL2_MASK) - -#define USBPHY_CTRL_SET_ENUTMILEVEL3_MASK (0x8000U) -#define USBPHY_CTRL_SET_ENUTMILEVEL3_SHIFT (15U) -/*! ENUTMILEVEL3 - UTMI Level 3 Enable */ -#define USBPHY_CTRL_SET_ENUTMILEVEL3(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENUTMILEVEL3_SHIFT)) & USBPHY_CTRL_SET_ENUTMILEVEL3_MASK) - -#define USBPHY_CTRL_SET_ENIRQWAKEUP_MASK (0x10000U) -#define USBPHY_CTRL_SET_ENIRQWAKEUP_SHIFT (16U) -/*! ENIRQWAKEUP - Wake-Up Interrupt Enable */ -#define USBPHY_CTRL_SET_ENIRQWAKEUP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENIRQWAKEUP_SHIFT)) & USBPHY_CTRL_SET_ENIRQWAKEUP_MASK) - -#define USBPHY_CTRL_SET_WAKEUP_IRQ_MASK (0x20000U) -#define USBPHY_CTRL_SET_WAKEUP_IRQ_SHIFT (17U) -/*! WAKEUP_IRQ - Wake-Up Interrupt */ -#define USBPHY_CTRL_SET_WAKEUP_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_WAKEUP_IRQ_SHIFT)) & USBPHY_CTRL_SET_WAKEUP_IRQ_MASK) - -#define USBPHY_CTRL_SET_AUTORESUME_EN_MASK (0x40000U) -#define USBPHY_CTRL_SET_AUTORESUME_EN_SHIFT (18U) -/*! AUTORESUME_EN - Autoresume Enable */ -#define USBPHY_CTRL_SET_AUTORESUME_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_AUTORESUME_EN_SHIFT)) & USBPHY_CTRL_SET_AUTORESUME_EN_MASK) - -#define USBPHY_CTRL_SET_ENAUTOCLR_CLKGATE_MASK (0x80000U) -#define USBPHY_CTRL_SET_ENAUTOCLR_CLKGATE_SHIFT (19U) -/*! ENAUTOCLR_CLKGATE - Autoclear Clock Gate Enable */ -#define USBPHY_CTRL_SET_ENAUTOCLR_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENAUTOCLR_CLKGATE_SHIFT)) & USBPHY_CTRL_SET_ENAUTOCLR_CLKGATE_MASK) - -#define USBPHY_CTRL_SET_ENAUTOCLR_PHY_PWD_MASK (0x100000U) -#define USBPHY_CTRL_SET_ENAUTOCLR_PHY_PWD_SHIFT (20U) -/*! ENAUTOCLR_PHY_PWD - PHY PWD Autoclear Enable */ -#define USBPHY_CTRL_SET_ENAUTOCLR_PHY_PWD(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENAUTOCLR_PHY_PWD_SHIFT)) & USBPHY_CTRL_SET_ENAUTOCLR_PHY_PWD_MASK) - -#define USBPHY_CTRL_SET_OTG_ID_VALUE_MASK (0x8000000U) -#define USBPHY_CTRL_SET_OTG_ID_VALUE_SHIFT (27U) -/*! OTG_ID_VALUE - OTG ID Value */ -#define USBPHY_CTRL_SET_OTG_ID_VALUE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_OTG_ID_VALUE_SHIFT)) & USBPHY_CTRL_SET_OTG_ID_VALUE_MASK) - -#define USBPHY_CTRL_SET_UTMI_SUSPENDM_MASK (0x20000000U) -#define USBPHY_CTRL_SET_UTMI_SUSPENDM_SHIFT (29U) -/*! UTMI_SUSPENDM - UTMI Suspend */ -#define USBPHY_CTRL_SET_UTMI_SUSPENDM(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_UTMI_SUSPENDM_SHIFT)) & USBPHY_CTRL_SET_UTMI_SUSPENDM_MASK) - -#define USBPHY_CTRL_SET_CLKGATE_MASK (0x40000000U) -#define USBPHY_CTRL_SET_CLKGATE_SHIFT (30U) -/*! CLKGATE - UTMI Clock Gate */ -#define USBPHY_CTRL_SET_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_CLKGATE_SHIFT)) & USBPHY_CTRL_SET_CLKGATE_MASK) - -#define USBPHY_CTRL_SET_SFTRST_MASK (0x80000000U) -#define USBPHY_CTRL_SET_SFTRST_SHIFT (31U) -/*! SFTRST - Software Reset */ -#define USBPHY_CTRL_SET_SFTRST(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_SFTRST_SHIFT)) & USBPHY_CTRL_SET_SFTRST_MASK) -/*! @} */ - -/*! @name CTRL_CLR - General Purpose Control */ -/*! @{ */ - -#define USBPHY_CTRL_CLR_ENOTG_ID_CHG_IRQ_MASK (0x1U) -#define USBPHY_CTRL_CLR_ENOTG_ID_CHG_IRQ_SHIFT (0U) -/*! ENOTG_ID_CHG_IRQ - OTG ID Change Interrupt Enable */ -#define USBPHY_CTRL_CLR_ENOTG_ID_CHG_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENOTG_ID_CHG_IRQ_SHIFT)) & USBPHY_CTRL_CLR_ENOTG_ID_CHG_IRQ_MASK) - -#define USBPHY_CTRL_CLR_ENHOSTDISCONDETECT_MASK (0x2U) -#define USBPHY_CTRL_CLR_ENHOSTDISCONDETECT_SHIFT (1U) -/*! ENHOSTDISCONDETECT - Host Disconnect Detection Enable */ -#define USBPHY_CTRL_CLR_ENHOSTDISCONDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENHOSTDISCONDETECT_SHIFT)) & USBPHY_CTRL_CLR_ENHOSTDISCONDETECT_MASK) - -#define USBPHY_CTRL_CLR_ENIRQHOSTDISCON_MASK (0x4U) -#define USBPHY_CTRL_CLR_ENIRQHOSTDISCON_SHIFT (2U) -/*! ENIRQHOSTDISCON - Enable Interrupt for Host Disconnect */ -#define USBPHY_CTRL_CLR_ENIRQHOSTDISCON(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENIRQHOSTDISCON_SHIFT)) & USBPHY_CTRL_CLR_ENIRQHOSTDISCON_MASK) - -#define USBPHY_CTRL_CLR_HOSTDISCONDETECT_IRQ_MASK (0x8U) -#define USBPHY_CTRL_CLR_HOSTDISCONDETECT_IRQ_SHIFT (3U) -/*! HOSTDISCONDETECT_IRQ - Host Disconnect Detection Interrupt */ -#define USBPHY_CTRL_CLR_HOSTDISCONDETECT_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_HOSTDISCONDETECT_IRQ_SHIFT)) & USBPHY_CTRL_CLR_HOSTDISCONDETECT_IRQ_MASK) - -#define USBPHY_CTRL_CLR_ENDEVPLUGINDETECT_MASK (0x10U) -#define USBPHY_CTRL_CLR_ENDEVPLUGINDETECT_SHIFT (4U) -/*! ENDEVPLUGINDETECT - Enable Nonstandard Resistive Plugged-In Detection */ -#define USBPHY_CTRL_CLR_ENDEVPLUGINDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENDEVPLUGINDETECT_SHIFT)) & USBPHY_CTRL_CLR_ENDEVPLUGINDETECT_MASK) - -#define USBPHY_CTRL_CLR_DEVPLUGIN_POLARITY_MASK (0x20U) -#define USBPHY_CTRL_CLR_DEVPLUGIN_POLARITY_SHIFT (5U) -/*! DEVPLUGIN_POLARITY - Device Plug-In Polarity */ -#define USBPHY_CTRL_CLR_DEVPLUGIN_POLARITY(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_DEVPLUGIN_POLARITY_SHIFT)) & USBPHY_CTRL_CLR_DEVPLUGIN_POLARITY_MASK) - -#define USBPHY_CTRL_CLR_OTG_ID_CHG_IRQ_MASK (0x40U) -#define USBPHY_CTRL_CLR_OTG_ID_CHG_IRQ_SHIFT (6U) -/*! OTG_ID_CHG_IRQ - OTG ID Change Interrupt */ -#define USBPHY_CTRL_CLR_OTG_ID_CHG_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_OTG_ID_CHG_IRQ_SHIFT)) & USBPHY_CTRL_CLR_OTG_ID_CHG_IRQ_MASK) - -#define USBPHY_CTRL_CLR_ENOTGIDDETECT_MASK (0x80U) -#define USBPHY_CTRL_CLR_ENOTGIDDETECT_SHIFT (7U) -/*! ENOTGIDDETECT - Enable Internal OTG ID Detector */ -#define USBPHY_CTRL_CLR_ENOTGIDDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENOTGIDDETECT_SHIFT)) & USBPHY_CTRL_CLR_ENOTGIDDETECT_MASK) - -#define USBPHY_CTRL_CLR_RESUMEIRQSTICKY_MASK (0x100U) -#define USBPHY_CTRL_CLR_RESUMEIRQSTICKY_SHIFT (8U) -/*! RESUMEIRQSTICKY - Resume Interrupt Sticky */ -#define USBPHY_CTRL_CLR_RESUMEIRQSTICKY(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_RESUMEIRQSTICKY_SHIFT)) & USBPHY_CTRL_CLR_RESUMEIRQSTICKY_MASK) - -#define USBPHY_CTRL_CLR_ENIRQRESUMEDETECT_MASK (0x200U) -#define USBPHY_CTRL_CLR_ENIRQRESUMEDETECT_SHIFT (9U) -/*! ENIRQRESUMEDETECT - Resume Detection Interrupt Enable */ -#define USBPHY_CTRL_CLR_ENIRQRESUMEDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENIRQRESUMEDETECT_SHIFT)) & USBPHY_CTRL_CLR_ENIRQRESUMEDETECT_MASK) - -#define USBPHY_CTRL_CLR_RESUME_IRQ_MASK (0x400U) -#define USBPHY_CTRL_CLR_RESUME_IRQ_SHIFT (10U) -/*! RESUME_IRQ - Resume Interrupt */ -#define USBPHY_CTRL_CLR_RESUME_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_RESUME_IRQ_SHIFT)) & USBPHY_CTRL_CLR_RESUME_IRQ_MASK) - -#define USBPHY_CTRL_CLR_ENIRQDEVPLUGIN_MASK (0x800U) -#define USBPHY_CTRL_CLR_ENIRQDEVPLUGIN_SHIFT (11U) -/*! ENIRQDEVPLUGIN - Enable Interrupt for Nonstandard Resistive Plugged-In Detection */ -#define USBPHY_CTRL_CLR_ENIRQDEVPLUGIN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENIRQDEVPLUGIN_SHIFT)) & USBPHY_CTRL_CLR_ENIRQDEVPLUGIN_MASK) - -#define USBPHY_CTRL_CLR_DEVPLUGIN_IRQ_MASK (0x1000U) -#define USBPHY_CTRL_CLR_DEVPLUGIN_IRQ_SHIFT (12U) -/*! DEVPLUGIN_IRQ - Device Plug-In Interrupt */ -#define USBPHY_CTRL_CLR_DEVPLUGIN_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_DEVPLUGIN_IRQ_SHIFT)) & USBPHY_CTRL_CLR_DEVPLUGIN_IRQ_MASK) - -#define USBPHY_CTRL_CLR_DATA_ON_LRADC_MASK (0x2000U) -#define USBPHY_CTRL_CLR_DATA_ON_LRADC_SHIFT (13U) -/*! DATA_ON_LRADC - APB Clock Switch Option */ -#define USBPHY_CTRL_CLR_DATA_ON_LRADC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_DATA_ON_LRADC_SHIFT)) & USBPHY_CTRL_CLR_DATA_ON_LRADC_MASK) - -#define USBPHY_CTRL_CLR_ENUTMILEVEL2_MASK (0x4000U) -#define USBPHY_CTRL_CLR_ENUTMILEVEL2_SHIFT (14U) -/*! ENUTMILEVEL2 - UTMI Level 2 Enable */ -#define USBPHY_CTRL_CLR_ENUTMILEVEL2(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENUTMILEVEL2_SHIFT)) & USBPHY_CTRL_CLR_ENUTMILEVEL2_MASK) - -#define USBPHY_CTRL_CLR_ENUTMILEVEL3_MASK (0x8000U) -#define USBPHY_CTRL_CLR_ENUTMILEVEL3_SHIFT (15U) -/*! ENUTMILEVEL3 - UTMI Level 3 Enable */ -#define USBPHY_CTRL_CLR_ENUTMILEVEL3(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENUTMILEVEL3_SHIFT)) & USBPHY_CTRL_CLR_ENUTMILEVEL3_MASK) - -#define USBPHY_CTRL_CLR_ENIRQWAKEUP_MASK (0x10000U) -#define USBPHY_CTRL_CLR_ENIRQWAKEUP_SHIFT (16U) -/*! ENIRQWAKEUP - Wake-Up Interrupt Enable */ -#define USBPHY_CTRL_CLR_ENIRQWAKEUP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENIRQWAKEUP_SHIFT)) & USBPHY_CTRL_CLR_ENIRQWAKEUP_MASK) - -#define USBPHY_CTRL_CLR_WAKEUP_IRQ_MASK (0x20000U) -#define USBPHY_CTRL_CLR_WAKEUP_IRQ_SHIFT (17U) -/*! WAKEUP_IRQ - Wake-Up Interrupt */ -#define USBPHY_CTRL_CLR_WAKEUP_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_WAKEUP_IRQ_SHIFT)) & USBPHY_CTRL_CLR_WAKEUP_IRQ_MASK) - -#define USBPHY_CTRL_CLR_AUTORESUME_EN_MASK (0x40000U) -#define USBPHY_CTRL_CLR_AUTORESUME_EN_SHIFT (18U) -/*! AUTORESUME_EN - Autoresume Enable */ -#define USBPHY_CTRL_CLR_AUTORESUME_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_AUTORESUME_EN_SHIFT)) & USBPHY_CTRL_CLR_AUTORESUME_EN_MASK) - -#define USBPHY_CTRL_CLR_ENAUTOCLR_CLKGATE_MASK (0x80000U) -#define USBPHY_CTRL_CLR_ENAUTOCLR_CLKGATE_SHIFT (19U) -/*! ENAUTOCLR_CLKGATE - Autoclear Clock Gate Enable */ -#define USBPHY_CTRL_CLR_ENAUTOCLR_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENAUTOCLR_CLKGATE_SHIFT)) & USBPHY_CTRL_CLR_ENAUTOCLR_CLKGATE_MASK) - -#define USBPHY_CTRL_CLR_ENAUTOCLR_PHY_PWD_MASK (0x100000U) -#define USBPHY_CTRL_CLR_ENAUTOCLR_PHY_PWD_SHIFT (20U) -/*! ENAUTOCLR_PHY_PWD - PHY PWD Autoclear Enable */ -#define USBPHY_CTRL_CLR_ENAUTOCLR_PHY_PWD(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENAUTOCLR_PHY_PWD_SHIFT)) & USBPHY_CTRL_CLR_ENAUTOCLR_PHY_PWD_MASK) - -#define USBPHY_CTRL_CLR_OTG_ID_VALUE_MASK (0x8000000U) -#define USBPHY_CTRL_CLR_OTG_ID_VALUE_SHIFT (27U) -/*! OTG_ID_VALUE - OTG ID Value */ -#define USBPHY_CTRL_CLR_OTG_ID_VALUE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_OTG_ID_VALUE_SHIFT)) & USBPHY_CTRL_CLR_OTG_ID_VALUE_MASK) - -#define USBPHY_CTRL_CLR_UTMI_SUSPENDM_MASK (0x20000000U) -#define USBPHY_CTRL_CLR_UTMI_SUSPENDM_SHIFT (29U) -/*! UTMI_SUSPENDM - UTMI Suspend */ -#define USBPHY_CTRL_CLR_UTMI_SUSPENDM(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_UTMI_SUSPENDM_SHIFT)) & USBPHY_CTRL_CLR_UTMI_SUSPENDM_MASK) - -#define USBPHY_CTRL_CLR_CLKGATE_MASK (0x40000000U) -#define USBPHY_CTRL_CLR_CLKGATE_SHIFT (30U) -/*! CLKGATE - UTMI Clock Gate */ -#define USBPHY_CTRL_CLR_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_CLKGATE_SHIFT)) & USBPHY_CTRL_CLR_CLKGATE_MASK) - -#define USBPHY_CTRL_CLR_SFTRST_MASK (0x80000000U) -#define USBPHY_CTRL_CLR_SFTRST_SHIFT (31U) -/*! SFTRST - Software Reset */ -#define USBPHY_CTRL_CLR_SFTRST(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_SFTRST_SHIFT)) & USBPHY_CTRL_CLR_SFTRST_MASK) -/*! @} */ - -/*! @name CTRL_TOG - General Purpose Control */ -/*! @{ */ - -#define USBPHY_CTRL_TOG_ENOTG_ID_CHG_IRQ_MASK (0x1U) -#define USBPHY_CTRL_TOG_ENOTG_ID_CHG_IRQ_SHIFT (0U) -/*! ENOTG_ID_CHG_IRQ - OTG ID Change Interrupt Enable */ -#define USBPHY_CTRL_TOG_ENOTG_ID_CHG_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENOTG_ID_CHG_IRQ_SHIFT)) & USBPHY_CTRL_TOG_ENOTG_ID_CHG_IRQ_MASK) - -#define USBPHY_CTRL_TOG_ENHOSTDISCONDETECT_MASK (0x2U) -#define USBPHY_CTRL_TOG_ENHOSTDISCONDETECT_SHIFT (1U) -/*! ENHOSTDISCONDETECT - Host Disconnect Detection Enable */ -#define USBPHY_CTRL_TOG_ENHOSTDISCONDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENHOSTDISCONDETECT_SHIFT)) & USBPHY_CTRL_TOG_ENHOSTDISCONDETECT_MASK) - -#define USBPHY_CTRL_TOG_ENIRQHOSTDISCON_MASK (0x4U) -#define USBPHY_CTRL_TOG_ENIRQHOSTDISCON_SHIFT (2U) -/*! ENIRQHOSTDISCON - Enable Interrupt for Host Disconnect */ -#define USBPHY_CTRL_TOG_ENIRQHOSTDISCON(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENIRQHOSTDISCON_SHIFT)) & USBPHY_CTRL_TOG_ENIRQHOSTDISCON_MASK) - -#define USBPHY_CTRL_TOG_HOSTDISCONDETECT_IRQ_MASK (0x8U) -#define USBPHY_CTRL_TOG_HOSTDISCONDETECT_IRQ_SHIFT (3U) -/*! HOSTDISCONDETECT_IRQ - Host Disconnect Detection Interrupt */ -#define USBPHY_CTRL_TOG_HOSTDISCONDETECT_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_HOSTDISCONDETECT_IRQ_SHIFT)) & USBPHY_CTRL_TOG_HOSTDISCONDETECT_IRQ_MASK) - -#define USBPHY_CTRL_TOG_ENDEVPLUGINDETECT_MASK (0x10U) -#define USBPHY_CTRL_TOG_ENDEVPLUGINDETECT_SHIFT (4U) -/*! ENDEVPLUGINDETECT - Enable Nonstandard Resistive Plugged-In Detection */ -#define USBPHY_CTRL_TOG_ENDEVPLUGINDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENDEVPLUGINDETECT_SHIFT)) & USBPHY_CTRL_TOG_ENDEVPLUGINDETECT_MASK) - -#define USBPHY_CTRL_TOG_DEVPLUGIN_POLARITY_MASK (0x20U) -#define USBPHY_CTRL_TOG_DEVPLUGIN_POLARITY_SHIFT (5U) -/*! DEVPLUGIN_POLARITY - Device Plug-In Polarity */ -#define USBPHY_CTRL_TOG_DEVPLUGIN_POLARITY(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_DEVPLUGIN_POLARITY_SHIFT)) & USBPHY_CTRL_TOG_DEVPLUGIN_POLARITY_MASK) - -#define USBPHY_CTRL_TOG_OTG_ID_CHG_IRQ_MASK (0x40U) -#define USBPHY_CTRL_TOG_OTG_ID_CHG_IRQ_SHIFT (6U) -/*! OTG_ID_CHG_IRQ - OTG ID Change Interrupt */ -#define USBPHY_CTRL_TOG_OTG_ID_CHG_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_OTG_ID_CHG_IRQ_SHIFT)) & USBPHY_CTRL_TOG_OTG_ID_CHG_IRQ_MASK) - -#define USBPHY_CTRL_TOG_ENOTGIDDETECT_MASK (0x80U) -#define USBPHY_CTRL_TOG_ENOTGIDDETECT_SHIFT (7U) -/*! ENOTGIDDETECT - Enable Internal OTG ID Detector */ -#define USBPHY_CTRL_TOG_ENOTGIDDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENOTGIDDETECT_SHIFT)) & USBPHY_CTRL_TOG_ENOTGIDDETECT_MASK) - -#define USBPHY_CTRL_TOG_RESUMEIRQSTICKY_MASK (0x100U) -#define USBPHY_CTRL_TOG_RESUMEIRQSTICKY_SHIFT (8U) -/*! RESUMEIRQSTICKY - Resume Interrupt Sticky */ -#define USBPHY_CTRL_TOG_RESUMEIRQSTICKY(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_RESUMEIRQSTICKY_SHIFT)) & USBPHY_CTRL_TOG_RESUMEIRQSTICKY_MASK) - -#define USBPHY_CTRL_TOG_ENIRQRESUMEDETECT_MASK (0x200U) -#define USBPHY_CTRL_TOG_ENIRQRESUMEDETECT_SHIFT (9U) -/*! ENIRQRESUMEDETECT - Resume Detection Interrupt Enable */ -#define USBPHY_CTRL_TOG_ENIRQRESUMEDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENIRQRESUMEDETECT_SHIFT)) & USBPHY_CTRL_TOG_ENIRQRESUMEDETECT_MASK) - -#define USBPHY_CTRL_TOG_RESUME_IRQ_MASK (0x400U) -#define USBPHY_CTRL_TOG_RESUME_IRQ_SHIFT (10U) -/*! RESUME_IRQ - Resume Interrupt */ -#define USBPHY_CTRL_TOG_RESUME_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_RESUME_IRQ_SHIFT)) & USBPHY_CTRL_TOG_RESUME_IRQ_MASK) - -#define USBPHY_CTRL_TOG_ENIRQDEVPLUGIN_MASK (0x800U) -#define USBPHY_CTRL_TOG_ENIRQDEVPLUGIN_SHIFT (11U) -/*! ENIRQDEVPLUGIN - Enable Interrupt for Nonstandard Resistive Plugged-In Detection */ -#define USBPHY_CTRL_TOG_ENIRQDEVPLUGIN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENIRQDEVPLUGIN_SHIFT)) & USBPHY_CTRL_TOG_ENIRQDEVPLUGIN_MASK) - -#define USBPHY_CTRL_TOG_DEVPLUGIN_IRQ_MASK (0x1000U) -#define USBPHY_CTRL_TOG_DEVPLUGIN_IRQ_SHIFT (12U) -/*! DEVPLUGIN_IRQ - Device Plug-In Interrupt */ -#define USBPHY_CTRL_TOG_DEVPLUGIN_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_DEVPLUGIN_IRQ_SHIFT)) & USBPHY_CTRL_TOG_DEVPLUGIN_IRQ_MASK) - -#define USBPHY_CTRL_TOG_DATA_ON_LRADC_MASK (0x2000U) -#define USBPHY_CTRL_TOG_DATA_ON_LRADC_SHIFT (13U) -/*! DATA_ON_LRADC - APB Clock Switch Option */ -#define USBPHY_CTRL_TOG_DATA_ON_LRADC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_DATA_ON_LRADC_SHIFT)) & USBPHY_CTRL_TOG_DATA_ON_LRADC_MASK) - -#define USBPHY_CTRL_TOG_ENUTMILEVEL2_MASK (0x4000U) -#define USBPHY_CTRL_TOG_ENUTMILEVEL2_SHIFT (14U) -/*! ENUTMILEVEL2 - UTMI Level 2 Enable */ -#define USBPHY_CTRL_TOG_ENUTMILEVEL2(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENUTMILEVEL2_SHIFT)) & USBPHY_CTRL_TOG_ENUTMILEVEL2_MASK) - -#define USBPHY_CTRL_TOG_ENUTMILEVEL3_MASK (0x8000U) -#define USBPHY_CTRL_TOG_ENUTMILEVEL3_SHIFT (15U) -/*! ENUTMILEVEL3 - UTMI Level 3 Enable */ -#define USBPHY_CTRL_TOG_ENUTMILEVEL3(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENUTMILEVEL3_SHIFT)) & USBPHY_CTRL_TOG_ENUTMILEVEL3_MASK) - -#define USBPHY_CTRL_TOG_ENIRQWAKEUP_MASK (0x10000U) -#define USBPHY_CTRL_TOG_ENIRQWAKEUP_SHIFT (16U) -/*! ENIRQWAKEUP - Wake-Up Interrupt Enable */ -#define USBPHY_CTRL_TOG_ENIRQWAKEUP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENIRQWAKEUP_SHIFT)) & USBPHY_CTRL_TOG_ENIRQWAKEUP_MASK) - -#define USBPHY_CTRL_TOG_WAKEUP_IRQ_MASK (0x20000U) -#define USBPHY_CTRL_TOG_WAKEUP_IRQ_SHIFT (17U) -/*! WAKEUP_IRQ - Wake-Up Interrupt */ -#define USBPHY_CTRL_TOG_WAKEUP_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_WAKEUP_IRQ_SHIFT)) & USBPHY_CTRL_TOG_WAKEUP_IRQ_MASK) - -#define USBPHY_CTRL_TOG_AUTORESUME_EN_MASK (0x40000U) -#define USBPHY_CTRL_TOG_AUTORESUME_EN_SHIFT (18U) -/*! AUTORESUME_EN - Autoresume Enable */ -#define USBPHY_CTRL_TOG_AUTORESUME_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_AUTORESUME_EN_SHIFT)) & USBPHY_CTRL_TOG_AUTORESUME_EN_MASK) - -#define USBPHY_CTRL_TOG_ENAUTOCLR_CLKGATE_MASK (0x80000U) -#define USBPHY_CTRL_TOG_ENAUTOCLR_CLKGATE_SHIFT (19U) -/*! ENAUTOCLR_CLKGATE - Autoclear Clock Gate Enable */ -#define USBPHY_CTRL_TOG_ENAUTOCLR_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENAUTOCLR_CLKGATE_SHIFT)) & USBPHY_CTRL_TOG_ENAUTOCLR_CLKGATE_MASK) - -#define USBPHY_CTRL_TOG_ENAUTOCLR_PHY_PWD_MASK (0x100000U) -#define USBPHY_CTRL_TOG_ENAUTOCLR_PHY_PWD_SHIFT (20U) -/*! ENAUTOCLR_PHY_PWD - PHY PWD Autoclear Enable */ -#define USBPHY_CTRL_TOG_ENAUTOCLR_PHY_PWD(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENAUTOCLR_PHY_PWD_SHIFT)) & USBPHY_CTRL_TOG_ENAUTOCLR_PHY_PWD_MASK) - -#define USBPHY_CTRL_TOG_OTG_ID_VALUE_MASK (0x8000000U) -#define USBPHY_CTRL_TOG_OTG_ID_VALUE_SHIFT (27U) -/*! OTG_ID_VALUE - OTG ID Value */ -#define USBPHY_CTRL_TOG_OTG_ID_VALUE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_OTG_ID_VALUE_SHIFT)) & USBPHY_CTRL_TOG_OTG_ID_VALUE_MASK) - -#define USBPHY_CTRL_TOG_UTMI_SUSPENDM_MASK (0x20000000U) -#define USBPHY_CTRL_TOG_UTMI_SUSPENDM_SHIFT (29U) -/*! UTMI_SUSPENDM - UTMI Suspend */ -#define USBPHY_CTRL_TOG_UTMI_SUSPENDM(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_UTMI_SUSPENDM_SHIFT)) & USBPHY_CTRL_TOG_UTMI_SUSPENDM_MASK) - -#define USBPHY_CTRL_TOG_CLKGATE_MASK (0x40000000U) -#define USBPHY_CTRL_TOG_CLKGATE_SHIFT (30U) -/*! CLKGATE - UTMI Clock Gate */ -#define USBPHY_CTRL_TOG_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_CLKGATE_SHIFT)) & USBPHY_CTRL_TOG_CLKGATE_MASK) - -#define USBPHY_CTRL_TOG_SFTRST_MASK (0x80000000U) -#define USBPHY_CTRL_TOG_SFTRST_SHIFT (31U) -/*! SFTRST - Software Reset */ -#define USBPHY_CTRL_TOG_SFTRST(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_SFTRST_SHIFT)) & USBPHY_CTRL_TOG_SFTRST_MASK) -/*! @} */ - -/*! @name STATUS - Status */ -/*! @{ */ - -#define USBPHY_STATUS_OK_STATUS_3V_MASK (0x1U) -#define USBPHY_STATUS_OK_STATUS_3V_SHIFT (0U) -/*! OK_STATUS_3V - USB 3.3 V and 1.8 V Supply Status - * 0b0..Not powered - * 0b1..Powered - */ -#define USBPHY_STATUS_OK_STATUS_3V(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_STATUS_OK_STATUS_3V_SHIFT)) & USBPHY_STATUS_OK_STATUS_3V_MASK) - -#define USBPHY_STATUS_HOSTDISCONDETECT_STATUS_MASK (0x8U) -#define USBPHY_STATUS_HOSTDISCONDETECT_STATUS_SHIFT (3U) -/*! HOSTDISCONDETECT_STATUS - Host Disconnect Status - * 0b0..Not detected - * 0b1..Detected - */ -#define USBPHY_STATUS_HOSTDISCONDETECT_STATUS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_STATUS_HOSTDISCONDETECT_STATUS_SHIFT)) & USBPHY_STATUS_HOSTDISCONDETECT_STATUS_MASK) - -#define USBPHY_STATUS_DEVPLUGIN_STATUS_MASK (0x40U) -#define USBPHY_STATUS_DEVPLUGIN_STATUS_SHIFT (6U) -/*! DEVPLUGIN_STATUS - Status Indicator for Nonstandard Resistive Plugged-In Detection - * 0b0..No attachment detected - * 0b1..Cable attachment detected - */ -#define USBPHY_STATUS_DEVPLUGIN_STATUS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_STATUS_DEVPLUGIN_STATUS_SHIFT)) & USBPHY_STATUS_DEVPLUGIN_STATUS_MASK) - -#define USBPHY_STATUS_OTGID_STATUS_MASK (0x100U) -#define USBPHY_STATUS_OTGID_STATUS_SHIFT (8U) -/*! OTGID_STATUS - OTG ID Status - * 0b0..Host - * 0b1..Device - */ -#define USBPHY_STATUS_OTGID_STATUS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_STATUS_OTGID_STATUS_SHIFT)) & USBPHY_STATUS_OTGID_STATUS_MASK) - -#define USBPHY_STATUS_RESUME_STATUS_MASK (0x400U) -#define USBPHY_STATUS_RESUME_STATUS_SHIFT (10U) -/*! RESUME_STATUS - Resume Status */ -#define USBPHY_STATUS_RESUME_STATUS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_STATUS_RESUME_STATUS_SHIFT)) & USBPHY_STATUS_RESUME_STATUS_MASK) -/*! @} */ - -/*! @name DEBUG0 - Debug 0 */ -/*! @{ */ - -#define USBPHY_DEBUG0_OTGIDPIOLOCK_MASK (0x1U) -#define USBPHY_DEBUG0_OTGIDPIOLOCK_SHIFT (0U) -/*! OTGIDPIOLOCK - Hold OTG_ID */ -#define USBPHY_DEBUG0_OTGIDPIOLOCK(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_OTGIDPIOLOCK_SHIFT)) & USBPHY_DEBUG0_OTGIDPIOLOCK_MASK) - -#define USBPHY_DEBUG0_HSTPULLDOWN_MASK (0xCU) -#define USBPHY_DEBUG0_HSTPULLDOWN_SHIFT (2U) -/*! HSTPULLDOWN - Host Pulldown Overdrive Mode - * 0b00..Disconnect - * 0b01..Connect - */ -#define USBPHY_DEBUG0_HSTPULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_HSTPULLDOWN_SHIFT)) & USBPHY_DEBUG0_HSTPULLDOWN_MASK) - -#define USBPHY_DEBUG0_ENHSTPULLDOWN_MASK (0x30U) -#define USBPHY_DEBUG0_ENHSTPULLDOWN_SHIFT (4U) -/*! ENHSTPULLDOWN - Enable Host Pulldown Overdrive Mode - * 0b00..Disable - * 0b01..Enable - */ -#define USBPHY_DEBUG0_ENHSTPULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_ENHSTPULLDOWN_SHIFT)) & USBPHY_DEBUG0_ENHSTPULLDOWN_MASK) -/*! @} */ - -/*! @name DEBUG0_SET - Debug 0 */ -/*! @{ */ - -#define USBPHY_DEBUG0_SET_OTGIDPIOLOCK_MASK (0x1U) -#define USBPHY_DEBUG0_SET_OTGIDPIOLOCK_SHIFT (0U) -/*! OTGIDPIOLOCK - Hold OTG_ID */ -#define USBPHY_DEBUG0_SET_OTGIDPIOLOCK(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_SET_OTGIDPIOLOCK_SHIFT)) & USBPHY_DEBUG0_SET_OTGIDPIOLOCK_MASK) - -#define USBPHY_DEBUG0_SET_HSTPULLDOWN_MASK (0xCU) -#define USBPHY_DEBUG0_SET_HSTPULLDOWN_SHIFT (2U) -/*! HSTPULLDOWN - Host Pulldown Overdrive Mode */ -#define USBPHY_DEBUG0_SET_HSTPULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_SET_HSTPULLDOWN_SHIFT)) & USBPHY_DEBUG0_SET_HSTPULLDOWN_MASK) - -#define USBPHY_DEBUG0_SET_ENHSTPULLDOWN_MASK (0x30U) -#define USBPHY_DEBUG0_SET_ENHSTPULLDOWN_SHIFT (4U) -/*! ENHSTPULLDOWN - Enable Host Pulldown Overdrive Mode */ -#define USBPHY_DEBUG0_SET_ENHSTPULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_SET_ENHSTPULLDOWN_SHIFT)) & USBPHY_DEBUG0_SET_ENHSTPULLDOWN_MASK) -/*! @} */ - -/*! @name DEBUG0_CLR - Debug 0 */ -/*! @{ */ - -#define USBPHY_DEBUG0_CLR_OTGIDPIOLOCK_MASK (0x1U) -#define USBPHY_DEBUG0_CLR_OTGIDPIOLOCK_SHIFT (0U) -/*! OTGIDPIOLOCK - Hold OTG_ID */ -#define USBPHY_DEBUG0_CLR_OTGIDPIOLOCK(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_CLR_OTGIDPIOLOCK_SHIFT)) & USBPHY_DEBUG0_CLR_OTGIDPIOLOCK_MASK) - -#define USBPHY_DEBUG0_CLR_HSTPULLDOWN_MASK (0xCU) -#define USBPHY_DEBUG0_CLR_HSTPULLDOWN_SHIFT (2U) -/*! HSTPULLDOWN - Host Pulldown Overdrive Mode */ -#define USBPHY_DEBUG0_CLR_HSTPULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_CLR_HSTPULLDOWN_SHIFT)) & USBPHY_DEBUG0_CLR_HSTPULLDOWN_MASK) - -#define USBPHY_DEBUG0_CLR_ENHSTPULLDOWN_MASK (0x30U) -#define USBPHY_DEBUG0_CLR_ENHSTPULLDOWN_SHIFT (4U) -/*! ENHSTPULLDOWN - Enable Host Pulldown Overdrive Mode */ -#define USBPHY_DEBUG0_CLR_ENHSTPULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_CLR_ENHSTPULLDOWN_SHIFT)) & USBPHY_DEBUG0_CLR_ENHSTPULLDOWN_MASK) -/*! @} */ - -/*! @name DEBUG0_TOG - Debug 0 */ -/*! @{ */ - -#define USBPHY_DEBUG0_TOG_OTGIDPIOLOCK_MASK (0x1U) -#define USBPHY_DEBUG0_TOG_OTGIDPIOLOCK_SHIFT (0U) -/*! OTGIDPIOLOCK - Hold OTG_ID */ -#define USBPHY_DEBUG0_TOG_OTGIDPIOLOCK(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_TOG_OTGIDPIOLOCK_SHIFT)) & USBPHY_DEBUG0_TOG_OTGIDPIOLOCK_MASK) - -#define USBPHY_DEBUG0_TOG_HSTPULLDOWN_MASK (0xCU) -#define USBPHY_DEBUG0_TOG_HSTPULLDOWN_SHIFT (2U) -/*! HSTPULLDOWN - Host Pulldown Overdrive Mode */ -#define USBPHY_DEBUG0_TOG_HSTPULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_TOG_HSTPULLDOWN_SHIFT)) & USBPHY_DEBUG0_TOG_HSTPULLDOWN_MASK) - -#define USBPHY_DEBUG0_TOG_ENHSTPULLDOWN_MASK (0x30U) -#define USBPHY_DEBUG0_TOG_ENHSTPULLDOWN_SHIFT (4U) -/*! ENHSTPULLDOWN - Enable Host Pulldown Overdrive Mode */ -#define USBPHY_DEBUG0_TOG_ENHSTPULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_TOG_ENHSTPULLDOWN_SHIFT)) & USBPHY_DEBUG0_TOG_ENHSTPULLDOWN_MASK) -/*! @} */ - -/*! @name VERSION - Version */ -/*! @{ */ - -#define USBPHY_VERSION_STEP_MASK (0xFFFFU) -#define USBPHY_VERSION_STEP_SHIFT (0U) -/*! STEP - Step */ -#define USBPHY_VERSION_STEP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_VERSION_STEP_SHIFT)) & USBPHY_VERSION_STEP_MASK) - -#define USBPHY_VERSION_MINOR_MASK (0xFF0000U) -#define USBPHY_VERSION_MINOR_SHIFT (16U) -/*! MINOR - Minor */ -#define USBPHY_VERSION_MINOR(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_VERSION_MINOR_SHIFT)) & USBPHY_VERSION_MINOR_MASK) - -#define USBPHY_VERSION_MAJOR_MASK (0xFF000000U) -#define USBPHY_VERSION_MAJOR_SHIFT (24U) -/*! MAJOR - Major */ -#define USBPHY_VERSION_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_VERSION_MAJOR_SHIFT)) & USBPHY_VERSION_MAJOR_MASK) -/*! @} */ - -/*! @name IP - IP Block */ -/*! @{ */ - -#define USBPHY_IP_POWER_CONTROL_SUSPEND_OPTION_MASK (0x1U) -#define USBPHY_IP_POWER_CONTROL_SUSPEND_OPTION_SHIFT (0U) -/*! POWER_CONTROL_SUSPEND_OPTION - Power Control Suspend Option */ -#define USBPHY_IP_POWER_CONTROL_SUSPEND_OPTION(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_IP_POWER_CONTROL_SUSPEND_OPTION_SHIFT)) & USBPHY_IP_POWER_CONTROL_SUSPEND_OPTION_MASK) -/*! @} */ - -/*! @name IP_SET - IP Block */ -/*! @{ */ - -#define USBPHY_IP_SET_POWER_CONTROL_SUSPEND_OPTION_MASK (0x1U) -#define USBPHY_IP_SET_POWER_CONTROL_SUSPEND_OPTION_SHIFT (0U) -/*! POWER_CONTROL_SUSPEND_OPTION - Power Control Suspend Option */ -#define USBPHY_IP_SET_POWER_CONTROL_SUSPEND_OPTION(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_IP_SET_POWER_CONTROL_SUSPEND_OPTION_SHIFT)) & USBPHY_IP_SET_POWER_CONTROL_SUSPEND_OPTION_MASK) -/*! @} */ - -/*! @name IP_CLR - IP Block */ -/*! @{ */ - -#define USBPHY_IP_CLR_POWER_CONTROL_SUSPEND_OPTION_MASK (0x1U) -#define USBPHY_IP_CLR_POWER_CONTROL_SUSPEND_OPTION_SHIFT (0U) -/*! POWER_CONTROL_SUSPEND_OPTION - Power Control Suspend Option */ -#define USBPHY_IP_CLR_POWER_CONTROL_SUSPEND_OPTION(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_IP_CLR_POWER_CONTROL_SUSPEND_OPTION_SHIFT)) & USBPHY_IP_CLR_POWER_CONTROL_SUSPEND_OPTION_MASK) -/*! @} */ - -/*! @name IP_TOG - IP Block */ -/*! @{ */ - -#define USBPHY_IP_TOG_POWER_CONTROL_SUSPEND_OPTION_MASK (0x1U) -#define USBPHY_IP_TOG_POWER_CONTROL_SUSPEND_OPTION_SHIFT (0U) -/*! POWER_CONTROL_SUSPEND_OPTION - Power Control Suspend Option */ -#define USBPHY_IP_TOG_POWER_CONTROL_SUSPEND_OPTION(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_IP_TOG_POWER_CONTROL_SUSPEND_OPTION_SHIFT)) & USBPHY_IP_TOG_POWER_CONTROL_SUSPEND_OPTION_MASK) -/*! @} */ - -/*! @name PLL_SIC - PLL SIC */ -/*! @{ */ - -#define USBPHY_PLL_SIC_MISC2_CONTROL0_MASK (0x20U) -#define USBPHY_PLL_SIC_MISC2_CONTROL0_SHIFT (5U) -/*! MISC2_CONTROL0 - Miscellaneous Control - * 0b0..Power up PLL - * 0b1..Power down PLL - */ -#define USBPHY_PLL_SIC_MISC2_CONTROL0(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_MISC2_CONTROL0_SHIFT)) & USBPHY_PLL_SIC_MISC2_CONTROL0_MASK) - -#define USBPHY_PLL_SIC_PLL_EN_USB_CLKS_MASK (0x40U) -#define USBPHY_PLL_SIC_PLL_EN_USB_CLKS_SHIFT (6U) -/*! PLL_EN_USB_CLKS - PLL Multi-Phase Clock Outputs Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_PLL_SIC_PLL_EN_USB_CLKS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_PLL_EN_USB_CLKS_SHIFT)) & USBPHY_PLL_SIC_PLL_EN_USB_CLKS_MASK) - -#define USBPHY_PLL_SIC_PLL_POWER_MASK (0x1000U) -#define USBPHY_PLL_SIC_PLL_POWER_SHIFT (12U) -/*! PLL_POWER - USB PLL Powerup Control - * 0b0..Power down - * 0b1..Allow powerup - */ -#define USBPHY_PLL_SIC_PLL_POWER(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_PLL_POWER_SHIFT)) & USBPHY_PLL_SIC_PLL_POWER_MASK) - -#define USBPHY_PLL_SIC_PLL_ENABLE_MASK (0x2000U) -#define USBPHY_PLL_SIC_PLL_ENABLE_SHIFT (13U) -/*! PLL_ENABLE - PLL Output Clock Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_PLL_SIC_PLL_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_PLL_ENABLE_SHIFT)) & USBPHY_PLL_SIC_PLL_ENABLE_MASK) - -#define USBPHY_PLL_SIC_PLL_BYPASS_MASK (0x10000U) -#define USBPHY_PLL_SIC_PLL_BYPASS_SHIFT (16U) -/*! PLL_BYPASS - Bypass USB PLL - * 0b0..480 MHz output clock - * 0b1..Input reference clock - */ -#define USBPHY_PLL_SIC_PLL_BYPASS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_PLL_BYPASS_SHIFT)) & USBPHY_PLL_SIC_PLL_BYPASS_MASK) - -#define USBPHY_PLL_SIC_REFBIAS_PWD_SEL_MASK (0x80000U) -#define USBPHY_PLL_SIC_REFBIAS_PWD_SEL_SHIFT (19U) -/*! REFBIAS_PWD_SEL - Reference Bias Power Control - * 0b0..PLL_POWER internal state signal - * 0b1..REFBIAS_PWD - */ -#define USBPHY_PLL_SIC_REFBIAS_PWD_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_REFBIAS_PWD_SEL_SHIFT)) & USBPHY_PLL_SIC_REFBIAS_PWD_SEL_MASK) - -#define USBPHY_PLL_SIC_REFBIAS_PWD_MASK (0x100000U) -#define USBPHY_PLL_SIC_REFBIAS_PWD_SHIFT (20U) -/*! REFBIAS_PWD - Power Down Reference Bias - * 0b0..Enable - * 0b1..Disable or power down - */ -#define USBPHY_PLL_SIC_REFBIAS_PWD(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_REFBIAS_PWD_SHIFT)) & USBPHY_PLL_SIC_REFBIAS_PWD_MASK) - -#define USBPHY_PLL_SIC_PLL_REG_ENABLE_MASK (0x200000U) -#define USBPHY_PLL_SIC_PLL_REG_ENABLE_SHIFT (21U) -/*! PLL_REG_ENABLE - Enable PLL Regulator - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_PLL_SIC_PLL_REG_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_PLL_REG_ENABLE_SHIFT)) & USBPHY_PLL_SIC_PLL_REG_ENABLE_MASK) - -#define USBPHY_PLL_SIC_PLL_DIV_SEL_MASK (0x1C00000U) -#define USBPHY_PLL_SIC_PLL_DIV_SEL_SHIFT (22U) -/*! PLL_DIV_SEL - PLL Divider Value Configuration - * 0b000..Configure for a 32 MHz input clock (divide by 15) - * 0b001..Configure for a 30 MHz input clock (divide by 16) - * 0b010..Configure for a 24 MHz input clock (divide by 20) - * 0b011..Reserved, not usable for USB operation (divide by 22) - * 0b100..Configure for a 20 MHz input clock (divide by 24) - * 0b101..Configure for a 19.2 MHz input clock (divide by 25) - * 0b110..Configure for a 16 MHz input clock (divide by 30) - * 0b111..Configure for a 12 MHz input clock (divide by 40) - */ -#define USBPHY_PLL_SIC_PLL_DIV_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_PLL_DIV_SEL_SHIFT)) & USBPHY_PLL_SIC_PLL_DIV_SEL_MASK) - -#define USBPHY_PLL_SIC_PLL_LOCK_MASK (0x80000000U) -#define USBPHY_PLL_SIC_PLL_LOCK_SHIFT (31U) -/*! PLL_LOCK - USB PLL Lock Status Indicator - * 0b0..Not locked - * 0b1..Locked - */ -#define USBPHY_PLL_SIC_PLL_LOCK(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_PLL_LOCK_SHIFT)) & USBPHY_PLL_SIC_PLL_LOCK_MASK) -/*! @} */ - -/*! @name PLL_SIC_SET - PLL SIC */ -/*! @{ */ - -#define USBPHY_PLL_SIC_SET_MISC2_CONTROL0_MASK (0x20U) -#define USBPHY_PLL_SIC_SET_MISC2_CONTROL0_SHIFT (5U) -/*! MISC2_CONTROL0 - Miscellaneous Control */ -#define USBPHY_PLL_SIC_SET_MISC2_CONTROL0(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_SET_MISC2_CONTROL0_SHIFT)) & USBPHY_PLL_SIC_SET_MISC2_CONTROL0_MASK) - -#define USBPHY_PLL_SIC_SET_PLL_EN_USB_CLKS_MASK (0x40U) -#define USBPHY_PLL_SIC_SET_PLL_EN_USB_CLKS_SHIFT (6U) -/*! PLL_EN_USB_CLKS - PLL Multi-Phase Clock Outputs Enable */ -#define USBPHY_PLL_SIC_SET_PLL_EN_USB_CLKS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_SET_PLL_EN_USB_CLKS_SHIFT)) & USBPHY_PLL_SIC_SET_PLL_EN_USB_CLKS_MASK) - -#define USBPHY_PLL_SIC_SET_PLL_POWER_MASK (0x1000U) -#define USBPHY_PLL_SIC_SET_PLL_POWER_SHIFT (12U) -/*! PLL_POWER - USB PLL Powerup Control */ -#define USBPHY_PLL_SIC_SET_PLL_POWER(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_SET_PLL_POWER_SHIFT)) & USBPHY_PLL_SIC_SET_PLL_POWER_MASK) - -#define USBPHY_PLL_SIC_SET_PLL_ENABLE_MASK (0x2000U) -#define USBPHY_PLL_SIC_SET_PLL_ENABLE_SHIFT (13U) -/*! PLL_ENABLE - PLL Output Clock Enable */ -#define USBPHY_PLL_SIC_SET_PLL_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_SET_PLL_ENABLE_SHIFT)) & USBPHY_PLL_SIC_SET_PLL_ENABLE_MASK) - -#define USBPHY_PLL_SIC_SET_PLL_BYPASS_MASK (0x10000U) -#define USBPHY_PLL_SIC_SET_PLL_BYPASS_SHIFT (16U) -/*! PLL_BYPASS - Bypass USB PLL */ -#define USBPHY_PLL_SIC_SET_PLL_BYPASS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_SET_PLL_BYPASS_SHIFT)) & USBPHY_PLL_SIC_SET_PLL_BYPASS_MASK) - -#define USBPHY_PLL_SIC_SET_REFBIAS_PWD_SEL_MASK (0x80000U) -#define USBPHY_PLL_SIC_SET_REFBIAS_PWD_SEL_SHIFT (19U) -/*! REFBIAS_PWD_SEL - Reference Bias Power Control */ -#define USBPHY_PLL_SIC_SET_REFBIAS_PWD_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_SET_REFBIAS_PWD_SEL_SHIFT)) & USBPHY_PLL_SIC_SET_REFBIAS_PWD_SEL_MASK) - -#define USBPHY_PLL_SIC_SET_REFBIAS_PWD_MASK (0x100000U) -#define USBPHY_PLL_SIC_SET_REFBIAS_PWD_SHIFT (20U) -/*! REFBIAS_PWD - Power Down Reference Bias */ -#define USBPHY_PLL_SIC_SET_REFBIAS_PWD(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_SET_REFBIAS_PWD_SHIFT)) & USBPHY_PLL_SIC_SET_REFBIAS_PWD_MASK) - -#define USBPHY_PLL_SIC_SET_PLL_REG_ENABLE_MASK (0x200000U) -#define USBPHY_PLL_SIC_SET_PLL_REG_ENABLE_SHIFT (21U) -/*! PLL_REG_ENABLE - Enable PLL Regulator */ -#define USBPHY_PLL_SIC_SET_PLL_REG_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_SET_PLL_REG_ENABLE_SHIFT)) & USBPHY_PLL_SIC_SET_PLL_REG_ENABLE_MASK) - -#define USBPHY_PLL_SIC_SET_PLL_DIV_SEL_MASK (0x1C00000U) -#define USBPHY_PLL_SIC_SET_PLL_DIV_SEL_SHIFT (22U) -/*! PLL_DIV_SEL - PLL Divider Value Configuration */ -#define USBPHY_PLL_SIC_SET_PLL_DIV_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_SET_PLL_DIV_SEL_SHIFT)) & USBPHY_PLL_SIC_SET_PLL_DIV_SEL_MASK) - -#define USBPHY_PLL_SIC_SET_PLL_LOCK_MASK (0x80000000U) -#define USBPHY_PLL_SIC_SET_PLL_LOCK_SHIFT (31U) -/*! PLL_LOCK - USB PLL Lock Status Indicator */ -#define USBPHY_PLL_SIC_SET_PLL_LOCK(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_SET_PLL_LOCK_SHIFT)) & USBPHY_PLL_SIC_SET_PLL_LOCK_MASK) -/*! @} */ - -/*! @name PLL_SIC_CLR - PLL SIC */ -/*! @{ */ - -#define USBPHY_PLL_SIC_CLR_MISC2_CONTROL0_MASK (0x20U) -#define USBPHY_PLL_SIC_CLR_MISC2_CONTROL0_SHIFT (5U) -/*! MISC2_CONTROL0 - Miscellaneous Control */ -#define USBPHY_PLL_SIC_CLR_MISC2_CONTROL0(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_CLR_MISC2_CONTROL0_SHIFT)) & USBPHY_PLL_SIC_CLR_MISC2_CONTROL0_MASK) - -#define USBPHY_PLL_SIC_CLR_PLL_EN_USB_CLKS_MASK (0x40U) -#define USBPHY_PLL_SIC_CLR_PLL_EN_USB_CLKS_SHIFT (6U) -/*! PLL_EN_USB_CLKS - PLL Multi-Phase Clock Outputs Enable */ -#define USBPHY_PLL_SIC_CLR_PLL_EN_USB_CLKS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_CLR_PLL_EN_USB_CLKS_SHIFT)) & USBPHY_PLL_SIC_CLR_PLL_EN_USB_CLKS_MASK) - -#define USBPHY_PLL_SIC_CLR_PLL_POWER_MASK (0x1000U) -#define USBPHY_PLL_SIC_CLR_PLL_POWER_SHIFT (12U) -/*! PLL_POWER - USB PLL Powerup Control */ -#define USBPHY_PLL_SIC_CLR_PLL_POWER(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_CLR_PLL_POWER_SHIFT)) & USBPHY_PLL_SIC_CLR_PLL_POWER_MASK) - -#define USBPHY_PLL_SIC_CLR_PLL_ENABLE_MASK (0x2000U) -#define USBPHY_PLL_SIC_CLR_PLL_ENABLE_SHIFT (13U) -/*! PLL_ENABLE - PLL Output Clock Enable */ -#define USBPHY_PLL_SIC_CLR_PLL_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_CLR_PLL_ENABLE_SHIFT)) & USBPHY_PLL_SIC_CLR_PLL_ENABLE_MASK) - -#define USBPHY_PLL_SIC_CLR_PLL_BYPASS_MASK (0x10000U) -#define USBPHY_PLL_SIC_CLR_PLL_BYPASS_SHIFT (16U) -/*! PLL_BYPASS - Bypass USB PLL */ -#define USBPHY_PLL_SIC_CLR_PLL_BYPASS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_CLR_PLL_BYPASS_SHIFT)) & USBPHY_PLL_SIC_CLR_PLL_BYPASS_MASK) - -#define USBPHY_PLL_SIC_CLR_REFBIAS_PWD_SEL_MASK (0x80000U) -#define USBPHY_PLL_SIC_CLR_REFBIAS_PWD_SEL_SHIFT (19U) -/*! REFBIAS_PWD_SEL - Reference Bias Power Control */ -#define USBPHY_PLL_SIC_CLR_REFBIAS_PWD_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_CLR_REFBIAS_PWD_SEL_SHIFT)) & USBPHY_PLL_SIC_CLR_REFBIAS_PWD_SEL_MASK) - -#define USBPHY_PLL_SIC_CLR_REFBIAS_PWD_MASK (0x100000U) -#define USBPHY_PLL_SIC_CLR_REFBIAS_PWD_SHIFT (20U) -/*! REFBIAS_PWD - Power Down Reference Bias */ -#define USBPHY_PLL_SIC_CLR_REFBIAS_PWD(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_CLR_REFBIAS_PWD_SHIFT)) & USBPHY_PLL_SIC_CLR_REFBIAS_PWD_MASK) - -#define USBPHY_PLL_SIC_CLR_PLL_REG_ENABLE_MASK (0x200000U) -#define USBPHY_PLL_SIC_CLR_PLL_REG_ENABLE_SHIFT (21U) -/*! PLL_REG_ENABLE - Enable PLL Regulator */ -#define USBPHY_PLL_SIC_CLR_PLL_REG_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_CLR_PLL_REG_ENABLE_SHIFT)) & USBPHY_PLL_SIC_CLR_PLL_REG_ENABLE_MASK) - -#define USBPHY_PLL_SIC_CLR_PLL_DIV_SEL_MASK (0x1C00000U) -#define USBPHY_PLL_SIC_CLR_PLL_DIV_SEL_SHIFT (22U) -/*! PLL_DIV_SEL - PLL Divider Value Configuration */ -#define USBPHY_PLL_SIC_CLR_PLL_DIV_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_CLR_PLL_DIV_SEL_SHIFT)) & USBPHY_PLL_SIC_CLR_PLL_DIV_SEL_MASK) - -#define USBPHY_PLL_SIC_CLR_PLL_LOCK_MASK (0x80000000U) -#define USBPHY_PLL_SIC_CLR_PLL_LOCK_SHIFT (31U) -/*! PLL_LOCK - USB PLL Lock Status Indicator */ -#define USBPHY_PLL_SIC_CLR_PLL_LOCK(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_CLR_PLL_LOCK_SHIFT)) & USBPHY_PLL_SIC_CLR_PLL_LOCK_MASK) -/*! @} */ - -/*! @name PLL_SIC_TOG - PLL SIC */ -/*! @{ */ - -#define USBPHY_PLL_SIC_TOG_MISC2_CONTROL0_MASK (0x20U) -#define USBPHY_PLL_SIC_TOG_MISC2_CONTROL0_SHIFT (5U) -/*! MISC2_CONTROL0 - Miscellaneous Control */ -#define USBPHY_PLL_SIC_TOG_MISC2_CONTROL0(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_TOG_MISC2_CONTROL0_SHIFT)) & USBPHY_PLL_SIC_TOG_MISC2_CONTROL0_MASK) - -#define USBPHY_PLL_SIC_TOG_PLL_EN_USB_CLKS_MASK (0x40U) -#define USBPHY_PLL_SIC_TOG_PLL_EN_USB_CLKS_SHIFT (6U) -/*! PLL_EN_USB_CLKS - PLL Multi-Phase Clock Outputs Enable */ -#define USBPHY_PLL_SIC_TOG_PLL_EN_USB_CLKS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_TOG_PLL_EN_USB_CLKS_SHIFT)) & USBPHY_PLL_SIC_TOG_PLL_EN_USB_CLKS_MASK) - -#define USBPHY_PLL_SIC_TOG_PLL_POWER_MASK (0x1000U) -#define USBPHY_PLL_SIC_TOG_PLL_POWER_SHIFT (12U) -/*! PLL_POWER - USB PLL Powerup Control */ -#define USBPHY_PLL_SIC_TOG_PLL_POWER(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_TOG_PLL_POWER_SHIFT)) & USBPHY_PLL_SIC_TOG_PLL_POWER_MASK) - -#define USBPHY_PLL_SIC_TOG_PLL_ENABLE_MASK (0x2000U) -#define USBPHY_PLL_SIC_TOG_PLL_ENABLE_SHIFT (13U) -/*! PLL_ENABLE - PLL Output Clock Enable */ -#define USBPHY_PLL_SIC_TOG_PLL_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_TOG_PLL_ENABLE_SHIFT)) & USBPHY_PLL_SIC_TOG_PLL_ENABLE_MASK) - -#define USBPHY_PLL_SIC_TOG_PLL_BYPASS_MASK (0x10000U) -#define USBPHY_PLL_SIC_TOG_PLL_BYPASS_SHIFT (16U) -/*! PLL_BYPASS - Bypass USB PLL */ -#define USBPHY_PLL_SIC_TOG_PLL_BYPASS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_TOG_PLL_BYPASS_SHIFT)) & USBPHY_PLL_SIC_TOG_PLL_BYPASS_MASK) - -#define USBPHY_PLL_SIC_TOG_REFBIAS_PWD_SEL_MASK (0x80000U) -#define USBPHY_PLL_SIC_TOG_REFBIAS_PWD_SEL_SHIFT (19U) -/*! REFBIAS_PWD_SEL - Reference Bias Power Control */ -#define USBPHY_PLL_SIC_TOG_REFBIAS_PWD_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_TOG_REFBIAS_PWD_SEL_SHIFT)) & USBPHY_PLL_SIC_TOG_REFBIAS_PWD_SEL_MASK) - -#define USBPHY_PLL_SIC_TOG_REFBIAS_PWD_MASK (0x100000U) -#define USBPHY_PLL_SIC_TOG_REFBIAS_PWD_SHIFT (20U) -/*! REFBIAS_PWD - Power Down Reference Bias */ -#define USBPHY_PLL_SIC_TOG_REFBIAS_PWD(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_TOG_REFBIAS_PWD_SHIFT)) & USBPHY_PLL_SIC_TOG_REFBIAS_PWD_MASK) - -#define USBPHY_PLL_SIC_TOG_PLL_REG_ENABLE_MASK (0x200000U) -#define USBPHY_PLL_SIC_TOG_PLL_REG_ENABLE_SHIFT (21U) -/*! PLL_REG_ENABLE - Enable PLL Regulator */ -#define USBPHY_PLL_SIC_TOG_PLL_REG_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_TOG_PLL_REG_ENABLE_SHIFT)) & USBPHY_PLL_SIC_TOG_PLL_REG_ENABLE_MASK) - -#define USBPHY_PLL_SIC_TOG_PLL_DIV_SEL_MASK (0x1C00000U) -#define USBPHY_PLL_SIC_TOG_PLL_DIV_SEL_SHIFT (22U) -/*! PLL_DIV_SEL - PLL Divider Value Configuration */ -#define USBPHY_PLL_SIC_TOG_PLL_DIV_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_TOG_PLL_DIV_SEL_SHIFT)) & USBPHY_PLL_SIC_TOG_PLL_DIV_SEL_MASK) - -#define USBPHY_PLL_SIC_TOG_PLL_LOCK_MASK (0x80000000U) -#define USBPHY_PLL_SIC_TOG_PLL_LOCK_SHIFT (31U) -/*! PLL_LOCK - USB PLL Lock Status Indicator */ -#define USBPHY_PLL_SIC_TOG_PLL_LOCK(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_TOG_PLL_LOCK_SHIFT)) & USBPHY_PLL_SIC_TOG_PLL_LOCK_MASK) -/*! @} */ - -/*! @name USB1_VBUS_DETECT - VBUS Detect */ -/*! @{ */ - -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_THRESH_MASK (0x7U) -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_THRESH_SHIFT (0U) -/*! VBUSVALID_THRESH - VBUS Comparator Threshold - * 0b000..4.0 V - * 0b001..4.1 V - * 0b010..4.2 V - * 0b011..4.3 V - * 0b100..4.4 V - * 0b101..4.5 V - * 0b110..4.6 V - * 0b111..4.7 V - */ -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_THRESH(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_VBUSVALID_THRESH_SHIFT)) & USBPHY_USB1_VBUS_DETECT_VBUSVALID_THRESH_MASK) - -#define USBPHY_USB1_VBUS_DETECT_VBUS_OVERRIDE_EN_MASK (0x8U) -#define USBPHY_USB1_VBUS_DETECT_VBUS_OVERRIDE_EN_SHIFT (3U) -/*! VBUS_OVERRIDE_EN - VBUS Detect Signal Local Override Enable - * 0b0..Results of VBUS_VALID and session valid comparators for VBUS_VALID, AVALID, BVALID, and SESSEND - * 0b1..Override values for VBUS_VALID, AVALID, BVALID, and SESSEND - */ -#define USBPHY_USB1_VBUS_DETECT_VBUS_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_VBUS_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_VBUS_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SESSEND_OVERRIDE_MASK (0x10U) -#define USBPHY_USB1_VBUS_DETECT_SESSEND_OVERRIDE_SHIFT (4U) -/*! SESSEND_OVERRIDE - Override Value for SESSEND */ -#define USBPHY_USB1_VBUS_DETECT_SESSEND_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SESSEND_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SESSEND_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_BVALID_OVERRIDE_MASK (0x20U) -#define USBPHY_USB1_VBUS_DETECT_BVALID_OVERRIDE_SHIFT (5U) -/*! BVALID_OVERRIDE - Override Value for B-Device Session Valid */ -#define USBPHY_USB1_VBUS_DETECT_BVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_BVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_BVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_AVALID_OVERRIDE_MASK (0x40U) -#define USBPHY_USB1_VBUS_DETECT_AVALID_OVERRIDE_SHIFT (6U) -/*! AVALID_OVERRIDE - Override Value for A-Device Session Valid */ -#define USBPHY_USB1_VBUS_DETECT_AVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_AVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_AVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_OVERRIDE_MASK (0x80U) -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_OVERRIDE_SHIFT (7U) -/*! VBUSVALID_OVERRIDE - Override Value for the VBUS_VALID Signal */ -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_VBUSVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_VBUSVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_SEL_MASK (0x100U) -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_SEL_SHIFT (8U) -/*! VBUSVALID_SEL - VBUS_VALID Selection - * 0b0..VBUS_VALID comparator result - * 0b1..VBUS_VALID_3V comparator result - */ -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_VBUSVALID_SEL_SHIFT)) & USBPHY_USB1_VBUS_DETECT_VBUSVALID_SEL_MASK) - -#define USBPHY_USB1_VBUS_DETECT_VBUS_SOURCE_SEL_MASK (0x600U) -#define USBPHY_USB1_VBUS_DETECT_VBUS_SOURCE_SEL_SHIFT (9U) -/*! VBUS_SOURCE_SEL - VBUS_VALID Source Selection - * 0b00..VBUS_VALID comparator result - * 0b01..Session valid comparator result - * 0b10..Session valid comparator result - * 0b11.. - */ -#define USBPHY_USB1_VBUS_DETECT_VBUS_SOURCE_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_VBUS_SOURCE_SEL_SHIFT)) & USBPHY_USB1_VBUS_DETECT_VBUS_SOURCE_SEL_MASK) - -#define USBPHY_USB1_VBUS_DETECT_ID_OVERRIDE_EN_MASK (0x800U) -#define USBPHY_USB1_VBUS_DETECT_ID_OVERRIDE_EN_SHIFT (11U) -/*! ID_OVERRIDE_EN - Enable Local ID Pin Status Override - * 0b0..Use ID pin detector or external override - * 0b1..Allow local override of ID pin detection status - */ -#define USBPHY_USB1_VBUS_DETECT_ID_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_ID_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_ID_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_ID_OVERRIDE_MASK (0x1000U) -#define USBPHY_USB1_VBUS_DETECT_ID_OVERRIDE_SHIFT (12U) -/*! ID_OVERRIDE - ID Pin Status Local Override */ -#define USBPHY_USB1_VBUS_DETECT_ID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_ID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_ID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_EXT_ID_OVERRIDE_EN_MASK (0x2000U) -#define USBPHY_USB1_VBUS_DETECT_EXT_ID_OVERRIDE_EN_SHIFT (13U) -/*! EXT_ID_OVERRIDE_EN - External ID Override Enable - * 0b0..Internal detector or local override - * 0b1..External ID signal value - */ -#define USBPHY_USB1_VBUS_DETECT_EXT_ID_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_EXT_ID_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_EXT_ID_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_EXT_VBUS_OVERRIDE_EN_MASK (0x4000U) -#define USBPHY_USB1_VBUS_DETECT_EXT_VBUS_OVERRIDE_EN_SHIFT (14U) -/*! EXT_VBUS_OVERRIDE_EN - External VBUS Override Enable - * 0b0..Internal detector or local override - * 0b1..External VBUS_VALID value - */ -#define USBPHY_USB1_VBUS_DETECT_EXT_VBUS_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_EXT_VBUS_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_EXT_VBUS_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_TO_B_MASK (0x40000U) -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_TO_B_SHIFT (18U) -/*! VBUSVALID_TO_B - VBUS_VALID Comparator Selection - * 0b0..VBUS_VALID comparator - * 0b1..Session valid detector - */ -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_TO_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_VBUSVALID_TO_B_SHIFT)) & USBPHY_USB1_VBUS_DETECT_VBUSVALID_TO_B_MASK) - -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_PWRUP_CMPS_MASK (0x700000U) -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_PWRUP_CMPS_SHIFT (20U) -/*! VBUSVALID_PWRUP_CMPS - VBUS_VALID Comparator Enable - * 0bxx0..Disable or power down the VBUS_VALID comparator - * 0bxx1..Enable the VBUS_VALID comparator - * 0bx0x..Disable or power down the session valid detector - * 0bx1x..Enable the session valid detector - * 0b0xx..Disable or power down the VBUS_VALID_3V detector - * 0b1xx..Enable the VBUS_VALID_3V detector - */ -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_PWRUP_CMPS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_VBUSVALID_PWRUP_CMPS_SHIFT)) & USBPHY_USB1_VBUS_DETECT_VBUSVALID_PWRUP_CMPS_MASK) - -#define USBPHY_USB1_VBUS_DETECT_DISCHARGE_VBUS_MASK (0x4000000U) -#define USBPHY_USB1_VBUS_DETECT_DISCHARGE_VBUS_SHIFT (26U) -/*! DISCHARGE_VBUS - VBUS Discharge Resistor - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_USB1_VBUS_DETECT_DISCHARGE_VBUS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_DISCHARGE_VBUS_SHIFT)) & USBPHY_USB1_VBUS_DETECT_DISCHARGE_VBUS_MASK) -/*! @} */ - -/*! @name USB1_VBUS_DETECT_SET - VBUS Detect */ -/*! @{ */ - -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_THRESH_MASK (0x7U) -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_THRESH_SHIFT (0U) -/*! VBUSVALID_THRESH - VBUS Comparator Threshold */ -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_THRESH(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_THRESH_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_THRESH_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_VBUS_OVERRIDE_EN_MASK (0x8U) -#define USBPHY_USB1_VBUS_DETECT_SET_VBUS_OVERRIDE_EN_SHIFT (3U) -/*! VBUS_OVERRIDE_EN - VBUS Detect Signal Local Override Enable */ -#define USBPHY_USB1_VBUS_DETECT_SET_VBUS_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_VBUS_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_VBUS_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_SESSEND_OVERRIDE_MASK (0x10U) -#define USBPHY_USB1_VBUS_DETECT_SET_SESSEND_OVERRIDE_SHIFT (4U) -/*! SESSEND_OVERRIDE - Override Value for SESSEND */ -#define USBPHY_USB1_VBUS_DETECT_SET_SESSEND_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_SESSEND_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_SESSEND_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_BVALID_OVERRIDE_MASK (0x20U) -#define USBPHY_USB1_VBUS_DETECT_SET_BVALID_OVERRIDE_SHIFT (5U) -/*! BVALID_OVERRIDE - Override Value for B-Device Session Valid */ -#define USBPHY_USB1_VBUS_DETECT_SET_BVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_BVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_BVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_AVALID_OVERRIDE_MASK (0x40U) -#define USBPHY_USB1_VBUS_DETECT_SET_AVALID_OVERRIDE_SHIFT (6U) -/*! AVALID_OVERRIDE - Override Value for A-Device Session Valid */ -#define USBPHY_USB1_VBUS_DETECT_SET_AVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_AVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_AVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_OVERRIDE_MASK (0x80U) -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_OVERRIDE_SHIFT (7U) -/*! VBUSVALID_OVERRIDE - Override Value for the VBUS_VALID Signal */ -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_SEL_MASK (0x100U) -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_SEL_SHIFT (8U) -/*! VBUSVALID_SEL - VBUS_VALID Selection */ -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_SEL_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_SEL_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_VBUS_SOURCE_SEL_MASK (0x600U) -#define USBPHY_USB1_VBUS_DETECT_SET_VBUS_SOURCE_SEL_SHIFT (9U) -/*! VBUS_SOURCE_SEL - VBUS_VALID Source Selection */ -#define USBPHY_USB1_VBUS_DETECT_SET_VBUS_SOURCE_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_VBUS_SOURCE_SEL_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_VBUS_SOURCE_SEL_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_ID_OVERRIDE_EN_MASK (0x800U) -#define USBPHY_USB1_VBUS_DETECT_SET_ID_OVERRIDE_EN_SHIFT (11U) -/*! ID_OVERRIDE_EN - Enable Local ID Pin Status Override */ -#define USBPHY_USB1_VBUS_DETECT_SET_ID_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_ID_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_ID_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_ID_OVERRIDE_MASK (0x1000U) -#define USBPHY_USB1_VBUS_DETECT_SET_ID_OVERRIDE_SHIFT (12U) -/*! ID_OVERRIDE - ID Pin Status Local Override */ -#define USBPHY_USB1_VBUS_DETECT_SET_ID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_ID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_ID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_EXT_ID_OVERRIDE_EN_MASK (0x2000U) -#define USBPHY_USB1_VBUS_DETECT_SET_EXT_ID_OVERRIDE_EN_SHIFT (13U) -/*! EXT_ID_OVERRIDE_EN - External ID Override Enable */ -#define USBPHY_USB1_VBUS_DETECT_SET_EXT_ID_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_EXT_ID_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_EXT_ID_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_EXT_VBUS_OVERRIDE_EN_MASK (0x4000U) -#define USBPHY_USB1_VBUS_DETECT_SET_EXT_VBUS_OVERRIDE_EN_SHIFT (14U) -/*! EXT_VBUS_OVERRIDE_EN - External VBUS Override Enable */ -#define USBPHY_USB1_VBUS_DETECT_SET_EXT_VBUS_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_EXT_VBUS_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_EXT_VBUS_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_TO_B_MASK (0x40000U) -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_TO_B_SHIFT (18U) -/*! VBUSVALID_TO_B - VBUS_VALID Comparator Selection */ -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_TO_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_TO_B_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_TO_B_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_PWRUP_CMPS_MASK (0x700000U) -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_PWRUP_CMPS_SHIFT (20U) -/*! VBUSVALID_PWRUP_CMPS - VBUS_VALID Comparator Enable */ -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_PWRUP_CMPS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_PWRUP_CMPS_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_PWRUP_CMPS_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_DISCHARGE_VBUS_MASK (0x4000000U) -#define USBPHY_USB1_VBUS_DETECT_SET_DISCHARGE_VBUS_SHIFT (26U) -/*! DISCHARGE_VBUS - VBUS Discharge Resistor */ -#define USBPHY_USB1_VBUS_DETECT_SET_DISCHARGE_VBUS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_DISCHARGE_VBUS_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_DISCHARGE_VBUS_MASK) -/*! @} */ - -/*! @name USB1_VBUS_DETECT_CLR - VBUS Detect */ -/*! @{ */ - -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_THRESH_MASK (0x7U) -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_THRESH_SHIFT (0U) -/*! VBUSVALID_THRESH - VBUS Comparator Threshold */ -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_THRESH(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_THRESH_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_THRESH_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUS_OVERRIDE_EN_MASK (0x8U) -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUS_OVERRIDE_EN_SHIFT (3U) -/*! VBUS_OVERRIDE_EN - VBUS Detect Signal Local Override Enable */ -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUS_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_VBUS_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_VBUS_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_SESSEND_OVERRIDE_MASK (0x10U) -#define USBPHY_USB1_VBUS_DETECT_CLR_SESSEND_OVERRIDE_SHIFT (4U) -/*! SESSEND_OVERRIDE - Override Value for SESSEND */ -#define USBPHY_USB1_VBUS_DETECT_CLR_SESSEND_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_SESSEND_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_SESSEND_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_BVALID_OVERRIDE_MASK (0x20U) -#define USBPHY_USB1_VBUS_DETECT_CLR_BVALID_OVERRIDE_SHIFT (5U) -/*! BVALID_OVERRIDE - Override Value for B-Device Session Valid */ -#define USBPHY_USB1_VBUS_DETECT_CLR_BVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_BVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_BVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_AVALID_OVERRIDE_MASK (0x40U) -#define USBPHY_USB1_VBUS_DETECT_CLR_AVALID_OVERRIDE_SHIFT (6U) -/*! AVALID_OVERRIDE - Override Value for A-Device Session Valid */ -#define USBPHY_USB1_VBUS_DETECT_CLR_AVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_AVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_AVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_OVERRIDE_MASK (0x80U) -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_OVERRIDE_SHIFT (7U) -/*! VBUSVALID_OVERRIDE - Override Value for the VBUS_VALID Signal */ -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_SEL_MASK (0x100U) -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_SEL_SHIFT (8U) -/*! VBUSVALID_SEL - VBUS_VALID Selection */ -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_SEL_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_SEL_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUS_SOURCE_SEL_MASK (0x600U) -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUS_SOURCE_SEL_SHIFT (9U) -/*! VBUS_SOURCE_SEL - VBUS_VALID Source Selection */ -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUS_SOURCE_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_VBUS_SOURCE_SEL_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_VBUS_SOURCE_SEL_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_ID_OVERRIDE_EN_MASK (0x800U) -#define USBPHY_USB1_VBUS_DETECT_CLR_ID_OVERRIDE_EN_SHIFT (11U) -/*! ID_OVERRIDE_EN - Enable Local ID Pin Status Override */ -#define USBPHY_USB1_VBUS_DETECT_CLR_ID_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_ID_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_ID_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_ID_OVERRIDE_MASK (0x1000U) -#define USBPHY_USB1_VBUS_DETECT_CLR_ID_OVERRIDE_SHIFT (12U) -/*! ID_OVERRIDE - ID Pin Status Local Override */ -#define USBPHY_USB1_VBUS_DETECT_CLR_ID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_ID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_ID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_EXT_ID_OVERRIDE_EN_MASK (0x2000U) -#define USBPHY_USB1_VBUS_DETECT_CLR_EXT_ID_OVERRIDE_EN_SHIFT (13U) -/*! EXT_ID_OVERRIDE_EN - External ID Override Enable */ -#define USBPHY_USB1_VBUS_DETECT_CLR_EXT_ID_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_EXT_ID_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_EXT_ID_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_EXT_VBUS_OVERRIDE_EN_MASK (0x4000U) -#define USBPHY_USB1_VBUS_DETECT_CLR_EXT_VBUS_OVERRIDE_EN_SHIFT (14U) -/*! EXT_VBUS_OVERRIDE_EN - External VBUS Override Enable */ -#define USBPHY_USB1_VBUS_DETECT_CLR_EXT_VBUS_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_EXT_VBUS_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_EXT_VBUS_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_TO_B_MASK (0x40000U) -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_TO_B_SHIFT (18U) -/*! VBUSVALID_TO_B - VBUS_VALID Comparator Selection */ -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_TO_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_TO_B_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_TO_B_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_PWRUP_CMPS_MASK (0x700000U) -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_PWRUP_CMPS_SHIFT (20U) -/*! VBUSVALID_PWRUP_CMPS - VBUS_VALID Comparator Enable */ -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_PWRUP_CMPS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_PWRUP_CMPS_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_PWRUP_CMPS_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_DISCHARGE_VBUS_MASK (0x4000000U) -#define USBPHY_USB1_VBUS_DETECT_CLR_DISCHARGE_VBUS_SHIFT (26U) -/*! DISCHARGE_VBUS - VBUS Discharge Resistor */ -#define USBPHY_USB1_VBUS_DETECT_CLR_DISCHARGE_VBUS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_DISCHARGE_VBUS_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_DISCHARGE_VBUS_MASK) -/*! @} */ - -/*! @name USB1_VBUS_DETECT_TOG - VBUS Detect */ -/*! @{ */ - -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_THRESH_MASK (0x7U) -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_THRESH_SHIFT (0U) -/*! VBUSVALID_THRESH - VBUS Comparator Threshold */ -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_THRESH(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_THRESH_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_THRESH_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUS_OVERRIDE_EN_MASK (0x8U) -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUS_OVERRIDE_EN_SHIFT (3U) -/*! VBUS_OVERRIDE_EN - VBUS Detect Signal Local Override Enable */ -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUS_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_VBUS_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_VBUS_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_SESSEND_OVERRIDE_MASK (0x10U) -#define USBPHY_USB1_VBUS_DETECT_TOG_SESSEND_OVERRIDE_SHIFT (4U) -/*! SESSEND_OVERRIDE - Override Value for SESSEND */ -#define USBPHY_USB1_VBUS_DETECT_TOG_SESSEND_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_SESSEND_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_SESSEND_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_BVALID_OVERRIDE_MASK (0x20U) -#define USBPHY_USB1_VBUS_DETECT_TOG_BVALID_OVERRIDE_SHIFT (5U) -/*! BVALID_OVERRIDE - Override Value for B-Device Session Valid */ -#define USBPHY_USB1_VBUS_DETECT_TOG_BVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_BVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_BVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_AVALID_OVERRIDE_MASK (0x40U) -#define USBPHY_USB1_VBUS_DETECT_TOG_AVALID_OVERRIDE_SHIFT (6U) -/*! AVALID_OVERRIDE - Override Value for A-Device Session Valid */ -#define USBPHY_USB1_VBUS_DETECT_TOG_AVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_AVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_AVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_OVERRIDE_MASK (0x80U) -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_OVERRIDE_SHIFT (7U) -/*! VBUSVALID_OVERRIDE - Override Value for the VBUS_VALID Signal */ -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_SEL_MASK (0x100U) -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_SEL_SHIFT (8U) -/*! VBUSVALID_SEL - VBUS_VALID Selection */ -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_SEL_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_SEL_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUS_SOURCE_SEL_MASK (0x600U) -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUS_SOURCE_SEL_SHIFT (9U) -/*! VBUS_SOURCE_SEL - VBUS_VALID Source Selection */ -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUS_SOURCE_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_VBUS_SOURCE_SEL_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_VBUS_SOURCE_SEL_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_ID_OVERRIDE_EN_MASK (0x800U) -#define USBPHY_USB1_VBUS_DETECT_TOG_ID_OVERRIDE_EN_SHIFT (11U) -/*! ID_OVERRIDE_EN - Enable Local ID Pin Status Override */ -#define USBPHY_USB1_VBUS_DETECT_TOG_ID_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_ID_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_ID_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_ID_OVERRIDE_MASK (0x1000U) -#define USBPHY_USB1_VBUS_DETECT_TOG_ID_OVERRIDE_SHIFT (12U) -/*! ID_OVERRIDE - ID Pin Status Local Override */ -#define USBPHY_USB1_VBUS_DETECT_TOG_ID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_ID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_ID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_EXT_ID_OVERRIDE_EN_MASK (0x2000U) -#define USBPHY_USB1_VBUS_DETECT_TOG_EXT_ID_OVERRIDE_EN_SHIFT (13U) -/*! EXT_ID_OVERRIDE_EN - External ID Override Enable */ -#define USBPHY_USB1_VBUS_DETECT_TOG_EXT_ID_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_EXT_ID_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_EXT_ID_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_EXT_VBUS_OVERRIDE_EN_MASK (0x4000U) -#define USBPHY_USB1_VBUS_DETECT_TOG_EXT_VBUS_OVERRIDE_EN_SHIFT (14U) -/*! EXT_VBUS_OVERRIDE_EN - External VBUS Override Enable */ -#define USBPHY_USB1_VBUS_DETECT_TOG_EXT_VBUS_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_EXT_VBUS_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_EXT_VBUS_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_TO_B_MASK (0x40000U) -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_TO_B_SHIFT (18U) -/*! VBUSVALID_TO_B - VBUS_VALID Comparator Selection */ -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_TO_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_TO_B_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_TO_B_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_PWRUP_CMPS_MASK (0x700000U) -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_PWRUP_CMPS_SHIFT (20U) -/*! VBUSVALID_PWRUP_CMPS - VBUS_VALID Comparator Enable */ -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_PWRUP_CMPS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_PWRUP_CMPS_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_PWRUP_CMPS_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_DISCHARGE_VBUS_MASK (0x4000000U) -#define USBPHY_USB1_VBUS_DETECT_TOG_DISCHARGE_VBUS_SHIFT (26U) -/*! DISCHARGE_VBUS - VBUS Discharge Resistor */ -#define USBPHY_USB1_VBUS_DETECT_TOG_DISCHARGE_VBUS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_DISCHARGE_VBUS_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_DISCHARGE_VBUS_MASK) -/*! @} */ - -/*! @name USB1_VBUS_DET_STAT - VBUS Detect Status */ -/*! @{ */ - -#define USBPHY_USB1_VBUS_DET_STAT_SESSEND_MASK (0x1U) -#define USBPHY_USB1_VBUS_DET_STAT_SESSEND_SHIFT (0U) -/*! SESSEND - Session End Indicator - * 0b0..Above threshold - * 0b1..Below threshold - */ -#define USBPHY_USB1_VBUS_DET_STAT_SESSEND(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_SESSEND_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_SESSEND_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_BVALID_MASK (0x2U) -#define USBPHY_USB1_VBUS_DET_STAT_BVALID_SHIFT (1U) -/*! BVALID - B-Device Session Valid Status - * 0b0..Below threshold - * 0b1..Above threshold - */ -#define USBPHY_USB1_VBUS_DET_STAT_BVALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_BVALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_BVALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_AVALID_MASK (0x4U) -#define USBPHY_USB1_VBUS_DET_STAT_AVALID_SHIFT (2U) -/*! AVALID - A-Device Session Valid Status - * 0b0..Below threshold - * 0b1..Above threshold - */ -#define USBPHY_USB1_VBUS_DET_STAT_AVALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_AVALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_AVALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID_MASK (0x8U) -#define USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID_SHIFT (3U) -/*! VBUS_VALID - VBUS Voltage Status - * 0b0..Below threshold - * 0b1..Above threshold - */ -#define USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID_3V_MASK (0x10U) -#define USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID_3V_SHIFT (4U) -/*! VBUS_VALID_3V - VBUS_VALID_3V Detector Status - * 0b0..Below threshold - * 0b1..Above threshold - */ -#define USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID_3V(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID_3V_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID_3V_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_EXT_ID_MASK (0x20U) -#define USBPHY_USB1_VBUS_DET_STAT_EXT_ID_SHIFT (5U) -/*! EXT_ID - OTG ID External Override Status */ -#define USBPHY_USB1_VBUS_DET_STAT_EXT_ID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_EXT_ID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_EXT_ID_MASK) -/*! @} */ - -/*! @name USB1_VBUS_DET_STAT_SET - VBUS Detect Status */ -/*! @{ */ - -#define USBPHY_USB1_VBUS_DET_STAT_SET_SESSEND_MASK (0x1U) -#define USBPHY_USB1_VBUS_DET_STAT_SET_SESSEND_SHIFT (0U) -/*! SESSEND - Session End Indicator */ -#define USBPHY_USB1_VBUS_DET_STAT_SET_SESSEND(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_SET_SESSEND_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_SET_SESSEND_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_SET_BVALID_MASK (0x2U) -#define USBPHY_USB1_VBUS_DET_STAT_SET_BVALID_SHIFT (1U) -/*! BVALID - B-Device Session Valid Status */ -#define USBPHY_USB1_VBUS_DET_STAT_SET_BVALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_SET_BVALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_SET_BVALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_SET_AVALID_MASK (0x4U) -#define USBPHY_USB1_VBUS_DET_STAT_SET_AVALID_SHIFT (2U) -/*! AVALID - A-Device Session Valid Status */ -#define USBPHY_USB1_VBUS_DET_STAT_SET_AVALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_SET_AVALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_SET_AVALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_SET_VBUS_VALID_MASK (0x8U) -#define USBPHY_USB1_VBUS_DET_STAT_SET_VBUS_VALID_SHIFT (3U) -/*! VBUS_VALID - VBUS Voltage Status */ -#define USBPHY_USB1_VBUS_DET_STAT_SET_VBUS_VALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_SET_VBUS_VALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_SET_VBUS_VALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_SET_VBUS_VALID_3V_MASK (0x10U) -#define USBPHY_USB1_VBUS_DET_STAT_SET_VBUS_VALID_3V_SHIFT (4U) -/*! VBUS_VALID_3V - VBUS_VALID_3V Detector Status */ -#define USBPHY_USB1_VBUS_DET_STAT_SET_VBUS_VALID_3V(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_SET_VBUS_VALID_3V_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_SET_VBUS_VALID_3V_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_SET_EXT_ID_MASK (0x20U) -#define USBPHY_USB1_VBUS_DET_STAT_SET_EXT_ID_SHIFT (5U) -/*! EXT_ID - OTG ID External Override Status */ -#define USBPHY_USB1_VBUS_DET_STAT_SET_EXT_ID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_SET_EXT_ID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_SET_EXT_ID_MASK) -/*! @} */ - -/*! @name USB1_VBUS_DET_STAT_CLR - VBUS Detect Status */ -/*! @{ */ - -#define USBPHY_USB1_VBUS_DET_STAT_CLR_SESSEND_MASK (0x1U) -#define USBPHY_USB1_VBUS_DET_STAT_CLR_SESSEND_SHIFT (0U) -/*! SESSEND - Session End Indicator */ -#define USBPHY_USB1_VBUS_DET_STAT_CLR_SESSEND(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_CLR_SESSEND_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_CLR_SESSEND_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_CLR_BVALID_MASK (0x2U) -#define USBPHY_USB1_VBUS_DET_STAT_CLR_BVALID_SHIFT (1U) -/*! BVALID - B-Device Session Valid Status */ -#define USBPHY_USB1_VBUS_DET_STAT_CLR_BVALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_CLR_BVALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_CLR_BVALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_CLR_AVALID_MASK (0x4U) -#define USBPHY_USB1_VBUS_DET_STAT_CLR_AVALID_SHIFT (2U) -/*! AVALID - A-Device Session Valid Status */ -#define USBPHY_USB1_VBUS_DET_STAT_CLR_AVALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_CLR_AVALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_CLR_AVALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_CLR_VBUS_VALID_MASK (0x8U) -#define USBPHY_USB1_VBUS_DET_STAT_CLR_VBUS_VALID_SHIFT (3U) -/*! VBUS_VALID - VBUS Voltage Status */ -#define USBPHY_USB1_VBUS_DET_STAT_CLR_VBUS_VALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_CLR_VBUS_VALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_CLR_VBUS_VALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_CLR_VBUS_VALID_3V_MASK (0x10U) -#define USBPHY_USB1_VBUS_DET_STAT_CLR_VBUS_VALID_3V_SHIFT (4U) -/*! VBUS_VALID_3V - VBUS_VALID_3V Detector Status */ -#define USBPHY_USB1_VBUS_DET_STAT_CLR_VBUS_VALID_3V(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_CLR_VBUS_VALID_3V_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_CLR_VBUS_VALID_3V_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_CLR_EXT_ID_MASK (0x20U) -#define USBPHY_USB1_VBUS_DET_STAT_CLR_EXT_ID_SHIFT (5U) -/*! EXT_ID - OTG ID External Override Status */ -#define USBPHY_USB1_VBUS_DET_STAT_CLR_EXT_ID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_CLR_EXT_ID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_CLR_EXT_ID_MASK) -/*! @} */ - -/*! @name USB1_VBUS_DET_STAT_TOG - VBUS Detect Status */ -/*! @{ */ - -#define USBPHY_USB1_VBUS_DET_STAT_TOG_SESSEND_MASK (0x1U) -#define USBPHY_USB1_VBUS_DET_STAT_TOG_SESSEND_SHIFT (0U) -/*! SESSEND - Session End Indicator */ -#define USBPHY_USB1_VBUS_DET_STAT_TOG_SESSEND(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_TOG_SESSEND_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_TOG_SESSEND_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_TOG_BVALID_MASK (0x2U) -#define USBPHY_USB1_VBUS_DET_STAT_TOG_BVALID_SHIFT (1U) -/*! BVALID - B-Device Session Valid Status */ -#define USBPHY_USB1_VBUS_DET_STAT_TOG_BVALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_TOG_BVALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_TOG_BVALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_TOG_AVALID_MASK (0x4U) -#define USBPHY_USB1_VBUS_DET_STAT_TOG_AVALID_SHIFT (2U) -/*! AVALID - A-Device Session Valid Status */ -#define USBPHY_USB1_VBUS_DET_STAT_TOG_AVALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_TOG_AVALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_TOG_AVALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_TOG_VBUS_VALID_MASK (0x8U) -#define USBPHY_USB1_VBUS_DET_STAT_TOG_VBUS_VALID_SHIFT (3U) -/*! VBUS_VALID - VBUS Voltage Status */ -#define USBPHY_USB1_VBUS_DET_STAT_TOG_VBUS_VALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_TOG_VBUS_VALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_TOG_VBUS_VALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_TOG_VBUS_VALID_3V_MASK (0x10U) -#define USBPHY_USB1_VBUS_DET_STAT_TOG_VBUS_VALID_3V_SHIFT (4U) -/*! VBUS_VALID_3V - VBUS_VALID_3V Detector Status */ -#define USBPHY_USB1_VBUS_DET_STAT_TOG_VBUS_VALID_3V(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_TOG_VBUS_VALID_3V_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_TOG_VBUS_VALID_3V_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_TOG_EXT_ID_MASK (0x20U) -#define USBPHY_USB1_VBUS_DET_STAT_TOG_EXT_ID_SHIFT (5U) -/*! EXT_ID - OTG ID External Override Status */ -#define USBPHY_USB1_VBUS_DET_STAT_TOG_EXT_ID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_TOG_EXT_ID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_TOG_EXT_ID_MASK) -/*! @} */ - -/*! @name USB1_CHRG_DETECT - Charger Detect */ -/*! @{ */ - -#define USBPHY_USB1_CHRG_DETECT_DETECT_SEC_MASK (0x2U) -#define USBPHY_USB1_CHRG_DETECT_DETECT_SEC_SHIFT (1U) -/*! DETECT_SEC - Secondary Detection Function Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_USB1_CHRG_DETECT_DETECT_SEC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_DETECT_SEC_SHIFT)) & USBPHY_USB1_CHRG_DETECT_DETECT_SEC_MASK) - -#define USBPHY_USB1_CHRG_DETECT_PULLUP_DP_MASK (0x4U) -#define USBPHY_USB1_CHRG_DETECT_PULLUP_DP_SHIFT (2U) -/*! PULLUP_DP - DP Pullup Resistor Enable Override Control - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_USB1_CHRG_DETECT_PULLUP_DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_PULLUP_DP_SHIFT)) & USBPHY_USB1_CHRG_DETECT_PULLUP_DP_MASK) - -#define USBPHY_USB1_CHRG_DETECT_VDM_SRC_ENABLE_MASK (0x10U) -#define USBPHY_USB1_CHRG_DETECT_VDM_SRC_ENABLE_SHIFT (4U) -/*! VDM_SRC_ENABLE - VDM_SRC Function Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_USB1_CHRG_DETECT_VDM_SRC_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_VDM_SRC_ENABLE_SHIFT)) & USBPHY_USB1_CHRG_DETECT_VDM_SRC_ENABLE_MASK) - -#define USBPHY_USB1_CHRG_DETECT_CHK_CONTACT_MASK (0x40000U) -#define USBPHY_USB1_CHRG_DETECT_CHK_CONTACT_SHIFT (18U) -/*! CHK_CONTACT - BC Data Contact Detect Function Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_USB1_CHRG_DETECT_CHK_CONTACT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_CHK_CONTACT_SHIFT)) & USBPHY_USB1_CHRG_DETECT_CHK_CONTACT_MASK) - -#define USBPHY_USB1_CHRG_DETECT_CHK_CHRG_B_MASK (0x80000U) -#define USBPHY_USB1_CHRG_DETECT_CHK_CHRG_B_SHIFT (19U) -/*! CHK_CHRG_B - BC Charger Detection Function Enable - * 0b0..Enable - * 0b1..Disable - */ -#define USBPHY_USB1_CHRG_DETECT_CHK_CHRG_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_CHK_CHRG_B_SHIFT)) & USBPHY_USB1_CHRG_DETECT_CHK_CHRG_B_MASK) - -#define USBPHY_USB1_CHRG_DETECT_EN_B_MASK (0x100000U) -#define USBPHY_USB1_CHRG_DETECT_EN_B_SHIFT (20U) -/*! EN_B - Selection of BC v1.2 Function Enable - * 0b0..Enable - * 0b1..Disable - */ -#define USBPHY_USB1_CHRG_DETECT_EN_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_EN_B_SHIFT)) & USBPHY_USB1_CHRG_DETECT_EN_B_MASK) - -#define USBPHY_USB1_CHRG_DETECT_DCDSEL_MASK (0x80000000U) -#define USBPHY_USB1_CHRG_DETECT_DCDSEL_SHIFT (31U) -/*! DCDSEL - DCD Selection - * 0b0..Fields in USB1_CHRG_DETECT - * 0b1..Fields and state machines in the USBHSDCD module - */ -#define USBPHY_USB1_CHRG_DETECT_DCDSEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_DCDSEL_SHIFT)) & USBPHY_USB1_CHRG_DETECT_DCDSEL_MASK) -/*! @} */ - -/*! @name USB1_CHRG_DETECT_SET - Charger Detect */ -/*! @{ */ - -#define USBPHY_USB1_CHRG_DETECT_SET_DETECT_SEC_MASK (0x2U) -#define USBPHY_USB1_CHRG_DETECT_SET_DETECT_SEC_SHIFT (1U) -/*! DETECT_SEC - Secondary Detection Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_SET_DETECT_SEC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_SET_DETECT_SEC_SHIFT)) & USBPHY_USB1_CHRG_DETECT_SET_DETECT_SEC_MASK) - -#define USBPHY_USB1_CHRG_DETECT_SET_PULLUP_DP_MASK (0x4U) -#define USBPHY_USB1_CHRG_DETECT_SET_PULLUP_DP_SHIFT (2U) -/*! PULLUP_DP - DP Pullup Resistor Enable Override Control */ -#define USBPHY_USB1_CHRG_DETECT_SET_PULLUP_DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_SET_PULLUP_DP_SHIFT)) & USBPHY_USB1_CHRG_DETECT_SET_PULLUP_DP_MASK) - -#define USBPHY_USB1_CHRG_DETECT_SET_VDM_SRC_ENABLE_MASK (0x10U) -#define USBPHY_USB1_CHRG_DETECT_SET_VDM_SRC_ENABLE_SHIFT (4U) -/*! VDM_SRC_ENABLE - VDM_SRC Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_SET_VDM_SRC_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_SET_VDM_SRC_ENABLE_SHIFT)) & USBPHY_USB1_CHRG_DETECT_SET_VDM_SRC_ENABLE_MASK) - -#define USBPHY_USB1_CHRG_DETECT_SET_CHK_CONTACT_MASK (0x40000U) -#define USBPHY_USB1_CHRG_DETECT_SET_CHK_CONTACT_SHIFT (18U) -/*! CHK_CONTACT - BC Data Contact Detect Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_SET_CHK_CONTACT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_SET_CHK_CONTACT_SHIFT)) & USBPHY_USB1_CHRG_DETECT_SET_CHK_CONTACT_MASK) - -#define USBPHY_USB1_CHRG_DETECT_SET_CHK_CHRG_B_MASK (0x80000U) -#define USBPHY_USB1_CHRG_DETECT_SET_CHK_CHRG_B_SHIFT (19U) -/*! CHK_CHRG_B - BC Charger Detection Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_SET_CHK_CHRG_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_SET_CHK_CHRG_B_SHIFT)) & USBPHY_USB1_CHRG_DETECT_SET_CHK_CHRG_B_MASK) - -#define USBPHY_USB1_CHRG_DETECT_SET_EN_B_MASK (0x100000U) -#define USBPHY_USB1_CHRG_DETECT_SET_EN_B_SHIFT (20U) -/*! EN_B - Selection of BC v1.2 Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_SET_EN_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_SET_EN_B_SHIFT)) & USBPHY_USB1_CHRG_DETECT_SET_EN_B_MASK) - -#define USBPHY_USB1_CHRG_DETECT_SET_DCDSEL_MASK (0x80000000U) -#define USBPHY_USB1_CHRG_DETECT_SET_DCDSEL_SHIFT (31U) -/*! DCDSEL - DCD Selection */ -#define USBPHY_USB1_CHRG_DETECT_SET_DCDSEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_SET_DCDSEL_SHIFT)) & USBPHY_USB1_CHRG_DETECT_SET_DCDSEL_MASK) -/*! @} */ - -/*! @name USB1_CHRG_DETECT_CLR - Charger Detect */ -/*! @{ */ - -#define USBPHY_USB1_CHRG_DETECT_CLR_DETECT_SEC_MASK (0x2U) -#define USBPHY_USB1_CHRG_DETECT_CLR_DETECT_SEC_SHIFT (1U) -/*! DETECT_SEC - Secondary Detection Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_CLR_DETECT_SEC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_CLR_DETECT_SEC_SHIFT)) & USBPHY_USB1_CHRG_DETECT_CLR_DETECT_SEC_MASK) - -#define USBPHY_USB1_CHRG_DETECT_CLR_PULLUP_DP_MASK (0x4U) -#define USBPHY_USB1_CHRG_DETECT_CLR_PULLUP_DP_SHIFT (2U) -/*! PULLUP_DP - DP Pullup Resistor Enable Override Control */ -#define USBPHY_USB1_CHRG_DETECT_CLR_PULLUP_DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_CLR_PULLUP_DP_SHIFT)) & USBPHY_USB1_CHRG_DETECT_CLR_PULLUP_DP_MASK) - -#define USBPHY_USB1_CHRG_DETECT_CLR_VDM_SRC_ENABLE_MASK (0x10U) -#define USBPHY_USB1_CHRG_DETECT_CLR_VDM_SRC_ENABLE_SHIFT (4U) -/*! VDM_SRC_ENABLE - VDM_SRC Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_CLR_VDM_SRC_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_CLR_VDM_SRC_ENABLE_SHIFT)) & USBPHY_USB1_CHRG_DETECT_CLR_VDM_SRC_ENABLE_MASK) - -#define USBPHY_USB1_CHRG_DETECT_CLR_CHK_CONTACT_MASK (0x40000U) -#define USBPHY_USB1_CHRG_DETECT_CLR_CHK_CONTACT_SHIFT (18U) -/*! CHK_CONTACT - BC Data Contact Detect Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_CLR_CHK_CONTACT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_CLR_CHK_CONTACT_SHIFT)) & USBPHY_USB1_CHRG_DETECT_CLR_CHK_CONTACT_MASK) - -#define USBPHY_USB1_CHRG_DETECT_CLR_CHK_CHRG_B_MASK (0x80000U) -#define USBPHY_USB1_CHRG_DETECT_CLR_CHK_CHRG_B_SHIFT (19U) -/*! CHK_CHRG_B - BC Charger Detection Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_CLR_CHK_CHRG_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_CLR_CHK_CHRG_B_SHIFT)) & USBPHY_USB1_CHRG_DETECT_CLR_CHK_CHRG_B_MASK) - -#define USBPHY_USB1_CHRG_DETECT_CLR_EN_B_MASK (0x100000U) -#define USBPHY_USB1_CHRG_DETECT_CLR_EN_B_SHIFT (20U) -/*! EN_B - Selection of BC v1.2 Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_CLR_EN_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_CLR_EN_B_SHIFT)) & USBPHY_USB1_CHRG_DETECT_CLR_EN_B_MASK) - -#define USBPHY_USB1_CHRG_DETECT_CLR_DCDSEL_MASK (0x80000000U) -#define USBPHY_USB1_CHRG_DETECT_CLR_DCDSEL_SHIFT (31U) -/*! DCDSEL - DCD Selection */ -#define USBPHY_USB1_CHRG_DETECT_CLR_DCDSEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_CLR_DCDSEL_SHIFT)) & USBPHY_USB1_CHRG_DETECT_CLR_DCDSEL_MASK) -/*! @} */ - -/*! @name USB1_CHRG_DETECT_TOG - Charger Detect */ -/*! @{ */ - -#define USBPHY_USB1_CHRG_DETECT_TOG_DETECT_SEC_MASK (0x2U) -#define USBPHY_USB1_CHRG_DETECT_TOG_DETECT_SEC_SHIFT (1U) -/*! DETECT_SEC - Secondary Detection Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_TOG_DETECT_SEC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_TOG_DETECT_SEC_SHIFT)) & USBPHY_USB1_CHRG_DETECT_TOG_DETECT_SEC_MASK) - -#define USBPHY_USB1_CHRG_DETECT_TOG_PULLUP_DP_MASK (0x4U) -#define USBPHY_USB1_CHRG_DETECT_TOG_PULLUP_DP_SHIFT (2U) -/*! PULLUP_DP - DP Pullup Resistor Enable Override Control */ -#define USBPHY_USB1_CHRG_DETECT_TOG_PULLUP_DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_TOG_PULLUP_DP_SHIFT)) & USBPHY_USB1_CHRG_DETECT_TOG_PULLUP_DP_MASK) - -#define USBPHY_USB1_CHRG_DETECT_TOG_VDM_SRC_ENABLE_MASK (0x10U) -#define USBPHY_USB1_CHRG_DETECT_TOG_VDM_SRC_ENABLE_SHIFT (4U) -/*! VDM_SRC_ENABLE - VDM_SRC Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_TOG_VDM_SRC_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_TOG_VDM_SRC_ENABLE_SHIFT)) & USBPHY_USB1_CHRG_DETECT_TOG_VDM_SRC_ENABLE_MASK) - -#define USBPHY_USB1_CHRG_DETECT_TOG_CHK_CONTACT_MASK (0x40000U) -#define USBPHY_USB1_CHRG_DETECT_TOG_CHK_CONTACT_SHIFT (18U) -/*! CHK_CONTACT - BC Data Contact Detect Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_TOG_CHK_CONTACT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_TOG_CHK_CONTACT_SHIFT)) & USBPHY_USB1_CHRG_DETECT_TOG_CHK_CONTACT_MASK) - -#define USBPHY_USB1_CHRG_DETECT_TOG_CHK_CHRG_B_MASK (0x80000U) -#define USBPHY_USB1_CHRG_DETECT_TOG_CHK_CHRG_B_SHIFT (19U) -/*! CHK_CHRG_B - BC Charger Detection Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_TOG_CHK_CHRG_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_TOG_CHK_CHRG_B_SHIFT)) & USBPHY_USB1_CHRG_DETECT_TOG_CHK_CHRG_B_MASK) - -#define USBPHY_USB1_CHRG_DETECT_TOG_EN_B_MASK (0x100000U) -#define USBPHY_USB1_CHRG_DETECT_TOG_EN_B_SHIFT (20U) -/*! EN_B - Selection of BC v1.2 Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_TOG_EN_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_TOG_EN_B_SHIFT)) & USBPHY_USB1_CHRG_DETECT_TOG_EN_B_MASK) - -#define USBPHY_USB1_CHRG_DETECT_TOG_DCDSEL_MASK (0x80000000U) -#define USBPHY_USB1_CHRG_DETECT_TOG_DCDSEL_SHIFT (31U) -/*! DCDSEL - DCD Selection */ -#define USBPHY_USB1_CHRG_DETECT_TOG_DCDSEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_TOG_DCDSEL_SHIFT)) & USBPHY_USB1_CHRG_DETECT_TOG_DCDSEL_MASK) -/*! @} */ - -/*! @name USB1_CHRG_DET_STAT - Charger Detect Status */ -/*! @{ */ - -#define USBPHY_USB1_CHRG_DET_STAT_PLUG_CONTACT_MASK (0x1U) -#define USBPHY_USB1_CHRG_DET_STAT_PLUG_CONTACT_SHIFT (0U) -/*! PLUG_CONTACT - Battery Charging Data Contact Detection Phase Output - * 0b0..Not detected - * 0b1..Detected - */ -#define USBPHY_USB1_CHRG_DET_STAT_PLUG_CONTACT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_PLUG_CONTACT_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_PLUG_CONTACT_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_CHRG_DETECTED_MASK (0x2U) -#define USBPHY_USB1_CHRG_DET_STAT_CHRG_DETECTED_SHIFT (1U) -/*! CHRG_DETECTED - Battery Charging Primary Detection Phase Output - * 0b0..SDP detected - * 0b1..Charging port detected - */ -#define USBPHY_USB1_CHRG_DET_STAT_CHRG_DETECTED(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_CHRG_DETECTED_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_CHRG_DETECTED_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_DM_STATE_MASK (0x4U) -#define USBPHY_USB1_CHRG_DET_STAT_DM_STATE_SHIFT (2U) -/*! DM_STATE - DM Voltage - * 0b0..USB_DM pin voltage is <= 0.8 V - * 0b1..USB_DM pin voltage is >= 2.0 V - */ -#define USBPHY_USB1_CHRG_DET_STAT_DM_STATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_DM_STATE_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_DM_STATE_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_DP_STATE_MASK (0x8U) -#define USBPHY_USB1_CHRG_DET_STAT_DP_STATE_SHIFT (3U) -/*! DP_STATE - DP Voltage - * 0b0..USB_DP pin voltage is <= 0.8 V - * 0b1..USB_DP pin voltage is >= 2.0 V - */ -#define USBPHY_USB1_CHRG_DET_STAT_DP_STATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_DP_STATE_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_DP_STATE_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_SECDET_DCP_MASK (0x10U) -#define USBPHY_USB1_CHRG_DET_STAT_SECDET_DCP_SHIFT (4U) -/*! SECDET_DCP - Battery Charging Secondary Detection Phase Output - * 0b0..CDP detected - * 0b1..DCP detected - */ -#define USBPHY_USB1_CHRG_DET_STAT_SECDET_DCP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_SECDET_DCP_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_SECDET_DCP_MASK) -/*! @} */ - -/*! @name USB1_CHRG_DET_STAT_SET - Charger Detect Status */ -/*! @{ */ - -#define USBPHY_USB1_CHRG_DET_STAT_SET_PLUG_CONTACT_MASK (0x1U) -#define USBPHY_USB1_CHRG_DET_STAT_SET_PLUG_CONTACT_SHIFT (0U) -/*! PLUG_CONTACT - Battery Charging Data Contact Detection Phase Output */ -#define USBPHY_USB1_CHRG_DET_STAT_SET_PLUG_CONTACT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_SET_PLUG_CONTACT_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_SET_PLUG_CONTACT_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_SET_CHRG_DETECTED_MASK (0x2U) -#define USBPHY_USB1_CHRG_DET_STAT_SET_CHRG_DETECTED_SHIFT (1U) -/*! CHRG_DETECTED - Battery Charging Primary Detection Phase Output */ -#define USBPHY_USB1_CHRG_DET_STAT_SET_CHRG_DETECTED(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_SET_CHRG_DETECTED_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_SET_CHRG_DETECTED_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_SET_DM_STATE_MASK (0x4U) -#define USBPHY_USB1_CHRG_DET_STAT_SET_DM_STATE_SHIFT (2U) -/*! DM_STATE - DM Voltage */ -#define USBPHY_USB1_CHRG_DET_STAT_SET_DM_STATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_SET_DM_STATE_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_SET_DM_STATE_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_SET_DP_STATE_MASK (0x8U) -#define USBPHY_USB1_CHRG_DET_STAT_SET_DP_STATE_SHIFT (3U) -/*! DP_STATE - DP Voltage */ -#define USBPHY_USB1_CHRG_DET_STAT_SET_DP_STATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_SET_DP_STATE_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_SET_DP_STATE_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_SET_SECDET_DCP_MASK (0x10U) -#define USBPHY_USB1_CHRG_DET_STAT_SET_SECDET_DCP_SHIFT (4U) -/*! SECDET_DCP - Battery Charging Secondary Detection Phase Output */ -#define USBPHY_USB1_CHRG_DET_STAT_SET_SECDET_DCP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_SET_SECDET_DCP_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_SET_SECDET_DCP_MASK) -/*! @} */ - -/*! @name USB1_CHRG_DET_STAT_CLR - Charger Detect Status */ -/*! @{ */ - -#define USBPHY_USB1_CHRG_DET_STAT_CLR_PLUG_CONTACT_MASK (0x1U) -#define USBPHY_USB1_CHRG_DET_STAT_CLR_PLUG_CONTACT_SHIFT (0U) -/*! PLUG_CONTACT - Battery Charging Data Contact Detection Phase Output */ -#define USBPHY_USB1_CHRG_DET_STAT_CLR_PLUG_CONTACT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_CLR_PLUG_CONTACT_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_CLR_PLUG_CONTACT_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_CLR_CHRG_DETECTED_MASK (0x2U) -#define USBPHY_USB1_CHRG_DET_STAT_CLR_CHRG_DETECTED_SHIFT (1U) -/*! CHRG_DETECTED - Battery Charging Primary Detection Phase Output */ -#define USBPHY_USB1_CHRG_DET_STAT_CLR_CHRG_DETECTED(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_CLR_CHRG_DETECTED_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_CLR_CHRG_DETECTED_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_CLR_DM_STATE_MASK (0x4U) -#define USBPHY_USB1_CHRG_DET_STAT_CLR_DM_STATE_SHIFT (2U) -/*! DM_STATE - DM Voltage */ -#define USBPHY_USB1_CHRG_DET_STAT_CLR_DM_STATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_CLR_DM_STATE_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_CLR_DM_STATE_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_CLR_DP_STATE_MASK (0x8U) -#define USBPHY_USB1_CHRG_DET_STAT_CLR_DP_STATE_SHIFT (3U) -/*! DP_STATE - DP Voltage */ -#define USBPHY_USB1_CHRG_DET_STAT_CLR_DP_STATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_CLR_DP_STATE_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_CLR_DP_STATE_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_CLR_SECDET_DCP_MASK (0x10U) -#define USBPHY_USB1_CHRG_DET_STAT_CLR_SECDET_DCP_SHIFT (4U) -/*! SECDET_DCP - Battery Charging Secondary Detection Phase Output */ -#define USBPHY_USB1_CHRG_DET_STAT_CLR_SECDET_DCP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_CLR_SECDET_DCP_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_CLR_SECDET_DCP_MASK) -/*! @} */ - -/*! @name USB1_CHRG_DET_STAT_TOG - Charger Detect Status */ -/*! @{ */ - -#define USBPHY_USB1_CHRG_DET_STAT_TOG_PLUG_CONTACT_MASK (0x1U) -#define USBPHY_USB1_CHRG_DET_STAT_TOG_PLUG_CONTACT_SHIFT (0U) -/*! PLUG_CONTACT - Battery Charging Data Contact Detection Phase Output */ -#define USBPHY_USB1_CHRG_DET_STAT_TOG_PLUG_CONTACT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_TOG_PLUG_CONTACT_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_TOG_PLUG_CONTACT_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_TOG_CHRG_DETECTED_MASK (0x2U) -#define USBPHY_USB1_CHRG_DET_STAT_TOG_CHRG_DETECTED_SHIFT (1U) -/*! CHRG_DETECTED - Battery Charging Primary Detection Phase Output */ -#define USBPHY_USB1_CHRG_DET_STAT_TOG_CHRG_DETECTED(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_TOG_CHRG_DETECTED_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_TOG_CHRG_DETECTED_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_TOG_DM_STATE_MASK (0x4U) -#define USBPHY_USB1_CHRG_DET_STAT_TOG_DM_STATE_SHIFT (2U) -/*! DM_STATE - DM Voltage */ -#define USBPHY_USB1_CHRG_DET_STAT_TOG_DM_STATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_TOG_DM_STATE_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_TOG_DM_STATE_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_TOG_DP_STATE_MASK (0x8U) -#define USBPHY_USB1_CHRG_DET_STAT_TOG_DP_STATE_SHIFT (3U) -/*! DP_STATE - DP Voltage */ -#define USBPHY_USB1_CHRG_DET_STAT_TOG_DP_STATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_TOG_DP_STATE_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_TOG_DP_STATE_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_TOG_SECDET_DCP_MASK (0x10U) -#define USBPHY_USB1_CHRG_DET_STAT_TOG_SECDET_DCP_SHIFT (4U) -/*! SECDET_DCP - Battery Charging Secondary Detection Phase Output */ -#define USBPHY_USB1_CHRG_DET_STAT_TOG_SECDET_DCP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_TOG_SECDET_DCP_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_TOG_SECDET_DCP_MASK) -/*! @} */ - -/*! @name ANACTRL - Analog Control */ -/*! @{ */ - -#define USBPHY_ANACTRL_LVI_EN_MASK (0x2U) -#define USBPHY_ANACTRL_LVI_EN_SHIFT (1U) -/*! LVI_EN - Internal Low Voltage Detector Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_ANACTRL_LVI_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_LVI_EN_SHIFT)) & USBPHY_ANACTRL_LVI_EN_MASK) - -#define USBPHY_ANACTRL_PFD_CLK_SEL_MASK (0xCU) -#define USBPHY_ANACTRL_PFD_CLK_SEL_SHIFT (2U) -/*! PFD_CLK_SEL - PFD Clock Selection - * 0b00..USB1PFDCLK = USB PLL reference clock - * 0b01..USB1PFDCLK = pfd_clk / 4 - * 0b10..USB1PFDCLK frequency = pfd_clk / 2 - * 0b11..USB1PFDCLK = pfd_clk - */ -#define USBPHY_ANACTRL_PFD_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_PFD_CLK_SEL_SHIFT)) & USBPHY_ANACTRL_PFD_CLK_SEL_MASK) - -#define USBPHY_ANACTRL_DEV_PULLDOWN_MASK (0x400U) -#define USBPHY_ANACTRL_DEV_PULLDOWN_SHIFT (10U) -/*! DEV_PULLDOWN - Device Pulldown Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_ANACTRL_DEV_PULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_DEV_PULLDOWN_SHIFT)) & USBPHY_ANACTRL_DEV_PULLDOWN_MASK) -/*! @} */ - -/*! @name ANACTRL_SET - Analog Control */ -/*! @{ */ - -#define USBPHY_ANACTRL_SET_LVI_EN_MASK (0x2U) -#define USBPHY_ANACTRL_SET_LVI_EN_SHIFT (1U) -/*! LVI_EN - Internal Low Voltage Detector Enable */ -#define USBPHY_ANACTRL_SET_LVI_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_SET_LVI_EN_SHIFT)) & USBPHY_ANACTRL_SET_LVI_EN_MASK) - -#define USBPHY_ANACTRL_SET_PFD_CLK_SEL_MASK (0xCU) -#define USBPHY_ANACTRL_SET_PFD_CLK_SEL_SHIFT (2U) -/*! PFD_CLK_SEL - PFD Clock Selection */ -#define USBPHY_ANACTRL_SET_PFD_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_SET_PFD_CLK_SEL_SHIFT)) & USBPHY_ANACTRL_SET_PFD_CLK_SEL_MASK) - -#define USBPHY_ANACTRL_SET_DEV_PULLDOWN_MASK (0x400U) -#define USBPHY_ANACTRL_SET_DEV_PULLDOWN_SHIFT (10U) -/*! DEV_PULLDOWN - Device Pulldown Enable */ -#define USBPHY_ANACTRL_SET_DEV_PULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_SET_DEV_PULLDOWN_SHIFT)) & USBPHY_ANACTRL_SET_DEV_PULLDOWN_MASK) -/*! @} */ - -/*! @name ANACTRL_CLR - Analog Control */ -/*! @{ */ - -#define USBPHY_ANACTRL_CLR_LVI_EN_MASK (0x2U) -#define USBPHY_ANACTRL_CLR_LVI_EN_SHIFT (1U) -/*! LVI_EN - Internal Low Voltage Detector Enable */ -#define USBPHY_ANACTRL_CLR_LVI_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_CLR_LVI_EN_SHIFT)) & USBPHY_ANACTRL_CLR_LVI_EN_MASK) - -#define USBPHY_ANACTRL_CLR_PFD_CLK_SEL_MASK (0xCU) -#define USBPHY_ANACTRL_CLR_PFD_CLK_SEL_SHIFT (2U) -/*! PFD_CLK_SEL - PFD Clock Selection */ -#define USBPHY_ANACTRL_CLR_PFD_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_CLR_PFD_CLK_SEL_SHIFT)) & USBPHY_ANACTRL_CLR_PFD_CLK_SEL_MASK) - -#define USBPHY_ANACTRL_CLR_DEV_PULLDOWN_MASK (0x400U) -#define USBPHY_ANACTRL_CLR_DEV_PULLDOWN_SHIFT (10U) -/*! DEV_PULLDOWN - Device Pulldown Enable */ -#define USBPHY_ANACTRL_CLR_DEV_PULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_CLR_DEV_PULLDOWN_SHIFT)) & USBPHY_ANACTRL_CLR_DEV_PULLDOWN_MASK) -/*! @} */ - -/*! @name ANACTRL_TOG - Analog Control */ -/*! @{ */ - -#define USBPHY_ANACTRL_TOG_LVI_EN_MASK (0x2U) -#define USBPHY_ANACTRL_TOG_LVI_EN_SHIFT (1U) -/*! LVI_EN - Internal Low Voltage Detector Enable */ -#define USBPHY_ANACTRL_TOG_LVI_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_TOG_LVI_EN_SHIFT)) & USBPHY_ANACTRL_TOG_LVI_EN_MASK) - -#define USBPHY_ANACTRL_TOG_PFD_CLK_SEL_MASK (0xCU) -#define USBPHY_ANACTRL_TOG_PFD_CLK_SEL_SHIFT (2U) -/*! PFD_CLK_SEL - PFD Clock Selection */ -#define USBPHY_ANACTRL_TOG_PFD_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_TOG_PFD_CLK_SEL_SHIFT)) & USBPHY_ANACTRL_TOG_PFD_CLK_SEL_MASK) - -#define USBPHY_ANACTRL_TOG_DEV_PULLDOWN_MASK (0x400U) -#define USBPHY_ANACTRL_TOG_DEV_PULLDOWN_SHIFT (10U) -/*! DEV_PULLDOWN - Device Pulldown Enable */ -#define USBPHY_ANACTRL_TOG_DEV_PULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_TOG_DEV_PULLDOWN_SHIFT)) & USBPHY_ANACTRL_TOG_DEV_PULLDOWN_MASK) -/*! @} */ - -/*! @name TRIM_OVERRIDE_EN - Trim */ -/*! @{ */ - -#define USBPHY_TRIM_OVERRIDE_EN_DIV_SEL_OVERRIDE_MASK (0x1U) -#define USBPHY_TRIM_OVERRIDE_EN_DIV_SEL_OVERRIDE_SHIFT (0U) -/*! DIV_SEL_OVERRIDE - Override Enable for PLL Divider Value - * 0b0..TRIM_OVERRIDE_EN - * 0b1..PLL_SIC - */ -#define USBPHY_TRIM_OVERRIDE_EN_DIV_SEL_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_DIV_SEL_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_DIV_SEL_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_TX_D_CAL_OVERRIDE_MASK (0x4U) -#define USBPHY_TRIM_OVERRIDE_EN_TX_D_CAL_OVERRIDE_SHIFT (2U) -/*! TX_D_CAL_OVERRIDE - Override Enable for HS TX Output Current Trim - * 0b0..TRIM_OVERRIDE_EN - * 0b1..TX - */ -#define USBPHY_TRIM_OVERRIDE_EN_TX_D_CAL_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TX_D_CAL_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TX_D_CAL_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_TX_CAL45DP_OVERRIDE_MASK (0x8U) -#define USBPHY_TRIM_OVERRIDE_EN_TX_CAL45DP_OVERRIDE_SHIFT (3U) -/*! TX_CAL45DP_OVERRIDE - Override Enable for USB_DP Series Termination Trim - * 0b0..TRIM_OVERRIDE_EN - * 0b1..TX - */ -#define USBPHY_TRIM_OVERRIDE_EN_TX_CAL45DP_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TX_CAL45DP_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TX_CAL45DP_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_TX_CAL45DM_OVERRIDE_MASK (0x10U) -#define USBPHY_TRIM_OVERRIDE_EN_TX_CAL45DM_OVERRIDE_SHIFT (4U) -/*! TX_CAL45DM_OVERRIDE - Override Enable for USB_DM Series Termination Trim - * 0b0..TRIM_OVERRIDE_EN - * 0b1..TX - */ -#define USBPHY_TRIM_OVERRIDE_EN_TX_CAL45DM_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TX_CAL45DM_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TX_CAL45DM_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_PLL_CTRL0_DIV_SEL_MASK (0x38000U) -#define USBPHY_TRIM_OVERRIDE_EN_PLL_CTRL0_DIV_SEL_SHIFT (15U) -/*! PLL_CTRL0_DIV_SEL - PLL Divider Value Configuration Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_PLL_CTRL0_DIV_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_PLL_CTRL0_DIV_SEL_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_PLL_CTRL0_DIV_SEL_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_D_CAL_MASK (0xF00000U) -#define USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_D_CAL_SHIFT (20U) -/*! USBPHY_TX_D_CAL - HS TX Output Current Trim Bits from Outside USBPHY - * 0b0000..Maximum current, approximately 19% above nominal - * 0b0111..Nominal - * 0b1111..Minimum current, approximately 19% below nominal - */ -#define USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_D_CAL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_D_CAL_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_D_CAL_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_CAL45DP_MASK (0xF000000U) -#define USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_CAL45DP_SHIFT (24U) -/*! USBPHY_TX_CAL45DP - DP Series Termination Resistance Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_CAL45DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_CAL45DP_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_CAL45DP_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_CAL45DN_MASK (0xF0000000U) -#define USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_CAL45DN_SHIFT (28U) -/*! USBPHY_TX_CAL45DN - DM Series Termination Resistance Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_CAL45DN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_CAL45DN_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_CAL45DN_MASK) -/*! @} */ - -/*! @name TRIM_OVERRIDE_EN_SET - Trim */ -/*! @{ */ - -#define USBPHY_TRIM_OVERRIDE_EN_SET_DIV_SEL_OVERRIDE_MASK (0x1U) -#define USBPHY_TRIM_OVERRIDE_EN_SET_DIV_SEL_OVERRIDE_SHIFT (0U) -/*! DIV_SEL_OVERRIDE - Override Enable for PLL Divider Value */ -#define USBPHY_TRIM_OVERRIDE_EN_SET_DIV_SEL_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_SET_DIV_SEL_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_SET_DIV_SEL_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_SET_TX_D_CAL_OVERRIDE_MASK (0x4U) -#define USBPHY_TRIM_OVERRIDE_EN_SET_TX_D_CAL_OVERRIDE_SHIFT (2U) -/*! TX_D_CAL_OVERRIDE - Override Enable for HS TX Output Current Trim */ -#define USBPHY_TRIM_OVERRIDE_EN_SET_TX_D_CAL_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_SET_TX_D_CAL_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_SET_TX_D_CAL_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_SET_TX_CAL45DP_OVERRIDE_MASK (0x8U) -#define USBPHY_TRIM_OVERRIDE_EN_SET_TX_CAL45DP_OVERRIDE_SHIFT (3U) -/*! TX_CAL45DP_OVERRIDE - Override Enable for USB_DP Series Termination Trim */ -#define USBPHY_TRIM_OVERRIDE_EN_SET_TX_CAL45DP_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_SET_TX_CAL45DP_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_SET_TX_CAL45DP_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_SET_TX_CAL45DM_OVERRIDE_MASK (0x10U) -#define USBPHY_TRIM_OVERRIDE_EN_SET_TX_CAL45DM_OVERRIDE_SHIFT (4U) -/*! TX_CAL45DM_OVERRIDE - Override Enable for USB_DM Series Termination Trim */ -#define USBPHY_TRIM_OVERRIDE_EN_SET_TX_CAL45DM_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_SET_TX_CAL45DM_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_SET_TX_CAL45DM_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_SET_PLL_CTRL0_DIV_SEL_MASK (0x38000U) -#define USBPHY_TRIM_OVERRIDE_EN_SET_PLL_CTRL0_DIV_SEL_SHIFT (15U) -/*! PLL_CTRL0_DIV_SEL - PLL Divider Value Configuration Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_SET_PLL_CTRL0_DIV_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_SET_PLL_CTRL0_DIV_SEL_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_SET_PLL_CTRL0_DIV_SEL_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_D_CAL_MASK (0xF00000U) -#define USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_D_CAL_SHIFT (20U) -/*! USBPHY_TX_D_CAL - HS TX Output Current Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_D_CAL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_D_CAL_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_D_CAL_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_CAL45DP_MASK (0xF000000U) -#define USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_CAL45DP_SHIFT (24U) -/*! USBPHY_TX_CAL45DP - DP Series Termination Resistance Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_CAL45DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_CAL45DP_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_CAL45DP_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_CAL45DN_MASK (0xF0000000U) -#define USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_CAL45DN_SHIFT (28U) -/*! USBPHY_TX_CAL45DN - DM Series Termination Resistance Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_CAL45DN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_CAL45DN_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_CAL45DN_MASK) -/*! @} */ - -/*! @name TRIM_OVERRIDE_EN_CLR - Trim */ -/*! @{ */ - -#define USBPHY_TRIM_OVERRIDE_EN_CLR_DIV_SEL_OVERRIDE_MASK (0x1U) -#define USBPHY_TRIM_OVERRIDE_EN_CLR_DIV_SEL_OVERRIDE_SHIFT (0U) -/*! DIV_SEL_OVERRIDE - Override Enable for PLL Divider Value */ -#define USBPHY_TRIM_OVERRIDE_EN_CLR_DIV_SEL_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_CLR_DIV_SEL_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_CLR_DIV_SEL_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_CLR_TX_D_CAL_OVERRIDE_MASK (0x4U) -#define USBPHY_TRIM_OVERRIDE_EN_CLR_TX_D_CAL_OVERRIDE_SHIFT (2U) -/*! TX_D_CAL_OVERRIDE - Override Enable for HS TX Output Current Trim */ -#define USBPHY_TRIM_OVERRIDE_EN_CLR_TX_D_CAL_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_CLR_TX_D_CAL_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_CLR_TX_D_CAL_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_CLR_TX_CAL45DP_OVERRIDE_MASK (0x8U) -#define USBPHY_TRIM_OVERRIDE_EN_CLR_TX_CAL45DP_OVERRIDE_SHIFT (3U) -/*! TX_CAL45DP_OVERRIDE - Override Enable for USB_DP Series Termination Trim */ -#define USBPHY_TRIM_OVERRIDE_EN_CLR_TX_CAL45DP_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_CLR_TX_CAL45DP_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_CLR_TX_CAL45DP_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_CLR_TX_CAL45DM_OVERRIDE_MASK (0x10U) -#define USBPHY_TRIM_OVERRIDE_EN_CLR_TX_CAL45DM_OVERRIDE_SHIFT (4U) -/*! TX_CAL45DM_OVERRIDE - Override Enable for USB_DM Series Termination Trim */ -#define USBPHY_TRIM_OVERRIDE_EN_CLR_TX_CAL45DM_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_CLR_TX_CAL45DM_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_CLR_TX_CAL45DM_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_CLR_PLL_CTRL0_DIV_SEL_MASK (0x38000U) -#define USBPHY_TRIM_OVERRIDE_EN_CLR_PLL_CTRL0_DIV_SEL_SHIFT (15U) -/*! PLL_CTRL0_DIV_SEL - PLL Divider Value Configuration Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_CLR_PLL_CTRL0_DIV_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_CLR_PLL_CTRL0_DIV_SEL_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_CLR_PLL_CTRL0_DIV_SEL_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_D_CAL_MASK (0xF00000U) -#define USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_D_CAL_SHIFT (20U) -/*! USBPHY_TX_D_CAL - HS TX Output Current Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_D_CAL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_D_CAL_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_D_CAL_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_CAL45DP_MASK (0xF000000U) -#define USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_CAL45DP_SHIFT (24U) -/*! USBPHY_TX_CAL45DP - DP Series Termination Resistance Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_CAL45DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_CAL45DP_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_CAL45DP_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_CAL45DN_MASK (0xF0000000U) -#define USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_CAL45DN_SHIFT (28U) -/*! USBPHY_TX_CAL45DN - DM Series Termination Resistance Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_CAL45DN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_CAL45DN_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_CAL45DN_MASK) -/*! @} */ - -/*! @name TRIM_OVERRIDE_EN_TOG - Trim */ -/*! @{ */ - -#define USBPHY_TRIM_OVERRIDE_EN_TOG_DIV_SEL_OVERRIDE_MASK (0x1U) -#define USBPHY_TRIM_OVERRIDE_EN_TOG_DIV_SEL_OVERRIDE_SHIFT (0U) -/*! DIV_SEL_OVERRIDE - Override Enable for PLL Divider Value */ -#define USBPHY_TRIM_OVERRIDE_EN_TOG_DIV_SEL_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TOG_DIV_SEL_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TOG_DIV_SEL_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_TOG_TX_D_CAL_OVERRIDE_MASK (0x4U) -#define USBPHY_TRIM_OVERRIDE_EN_TOG_TX_D_CAL_OVERRIDE_SHIFT (2U) -/*! TX_D_CAL_OVERRIDE - Override Enable for HS TX Output Current Trim */ -#define USBPHY_TRIM_OVERRIDE_EN_TOG_TX_D_CAL_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TOG_TX_D_CAL_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TOG_TX_D_CAL_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_TOG_TX_CAL45DP_OVERRIDE_MASK (0x8U) -#define USBPHY_TRIM_OVERRIDE_EN_TOG_TX_CAL45DP_OVERRIDE_SHIFT (3U) -/*! TX_CAL45DP_OVERRIDE - Override Enable for USB_DP Series Termination Trim */ -#define USBPHY_TRIM_OVERRIDE_EN_TOG_TX_CAL45DP_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TOG_TX_CAL45DP_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TOG_TX_CAL45DP_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_TOG_TX_CAL45DM_OVERRIDE_MASK (0x10U) -#define USBPHY_TRIM_OVERRIDE_EN_TOG_TX_CAL45DM_OVERRIDE_SHIFT (4U) -/*! TX_CAL45DM_OVERRIDE - Override Enable for USB_DM Series Termination Trim */ -#define USBPHY_TRIM_OVERRIDE_EN_TOG_TX_CAL45DM_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TOG_TX_CAL45DM_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TOG_TX_CAL45DM_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_TOG_PLL_CTRL0_DIV_SEL_MASK (0x38000U) -#define USBPHY_TRIM_OVERRIDE_EN_TOG_PLL_CTRL0_DIV_SEL_SHIFT (15U) -/*! PLL_CTRL0_DIV_SEL - PLL Divider Value Configuration Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_TOG_PLL_CTRL0_DIV_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TOG_PLL_CTRL0_DIV_SEL_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TOG_PLL_CTRL0_DIV_SEL_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_D_CAL_MASK (0xF00000U) -#define USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_D_CAL_SHIFT (20U) -/*! USBPHY_TX_D_CAL - HS TX Output Current Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_D_CAL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_D_CAL_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_D_CAL_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_CAL45DP_MASK (0xF000000U) -#define USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_CAL45DP_SHIFT (24U) -/*! USBPHY_TX_CAL45DP - DP Series Termination Resistance Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_CAL45DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_CAL45DP_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_CAL45DP_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_CAL45DN_MASK (0xF0000000U) -#define USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_CAL45DN_SHIFT (28U) -/*! USBPHY_TX_CAL45DN - DM Series Termination Resistance Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_CAL45DN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_CAL45DN_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_CAL45DN_MASK) -/*! @} */ - -/*! @name PFDA - PFD A */ -/*! @{ */ - -#define USBPHY_PFDA_PFD0_CLKGATE_MASK (0x1U) -#define USBPHY_PFDA_PFD0_CLKGATE_SHIFT (0U) -/*! PFD0_CLKGATE - PFD0 Clock Gate - * 0b0..Enable - * 0b1..Disable - */ -#define USBPHY_PFDA_PFD0_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_PFD0_CLKGATE_SHIFT)) & USBPHY_PFDA_PFD0_CLKGATE_MASK) - -#define USBPHY_PFDA_PFD0_FRAC_MASK (0x7EU) -#define USBPHY_PFDA_PFD0_FRAC_SHIFT (1U) -/*! PFD0_FRAC - PFD0 Fractional Divider */ -#define USBPHY_PFDA_PFD0_FRAC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_PFD0_FRAC_SHIFT)) & USBPHY_PFDA_PFD0_FRAC_MASK) - -#define USBPHY_PFDA_PFD0_STABLE_MASK (0x80U) -#define USBPHY_PFDA_PFD0_STABLE_SHIFT (7U) -/*! PFD0_STABLE - PFD0 Stable Signal - * 0b0..Not stable - * 0b1..Stable - */ -#define USBPHY_PFDA_PFD0_STABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_PFD0_STABLE_SHIFT)) & USBPHY_PFDA_PFD0_STABLE_MASK) -/*! @} */ - -/*! @name PFDA_SET - PFD A */ -/*! @{ */ - -#define USBPHY_PFDA_SET_PFD0_CLKGATE_MASK (0x1U) -#define USBPHY_PFDA_SET_PFD0_CLKGATE_SHIFT (0U) -/*! PFD0_CLKGATE - PFD0 Clock Gate */ -#define USBPHY_PFDA_SET_PFD0_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_SET_PFD0_CLKGATE_SHIFT)) & USBPHY_PFDA_SET_PFD0_CLKGATE_MASK) - -#define USBPHY_PFDA_SET_PFD0_FRAC_MASK (0x7EU) -#define USBPHY_PFDA_SET_PFD0_FRAC_SHIFT (1U) -/*! PFD0_FRAC - PFD0 Fractional Divider */ -#define USBPHY_PFDA_SET_PFD0_FRAC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_SET_PFD0_FRAC_SHIFT)) & USBPHY_PFDA_SET_PFD0_FRAC_MASK) - -#define USBPHY_PFDA_SET_PFD0_STABLE_MASK (0x80U) -#define USBPHY_PFDA_SET_PFD0_STABLE_SHIFT (7U) -/*! PFD0_STABLE - PFD0 Stable Signal */ -#define USBPHY_PFDA_SET_PFD0_STABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_SET_PFD0_STABLE_SHIFT)) & USBPHY_PFDA_SET_PFD0_STABLE_MASK) -/*! @} */ - -/*! @name PFDA_CLR - PFD A */ -/*! @{ */ - -#define USBPHY_PFDA_CLR_PFD0_CLKGATE_MASK (0x1U) -#define USBPHY_PFDA_CLR_PFD0_CLKGATE_SHIFT (0U) -/*! PFD0_CLKGATE - PFD0 Clock Gate */ -#define USBPHY_PFDA_CLR_PFD0_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_CLR_PFD0_CLKGATE_SHIFT)) & USBPHY_PFDA_CLR_PFD0_CLKGATE_MASK) - -#define USBPHY_PFDA_CLR_PFD0_FRAC_MASK (0x7EU) -#define USBPHY_PFDA_CLR_PFD0_FRAC_SHIFT (1U) -/*! PFD0_FRAC - PFD0 Fractional Divider */ -#define USBPHY_PFDA_CLR_PFD0_FRAC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_CLR_PFD0_FRAC_SHIFT)) & USBPHY_PFDA_CLR_PFD0_FRAC_MASK) - -#define USBPHY_PFDA_CLR_PFD0_STABLE_MASK (0x80U) -#define USBPHY_PFDA_CLR_PFD0_STABLE_SHIFT (7U) -/*! PFD0_STABLE - PFD0 Stable Signal */ -#define USBPHY_PFDA_CLR_PFD0_STABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_CLR_PFD0_STABLE_SHIFT)) & USBPHY_PFDA_CLR_PFD0_STABLE_MASK) -/*! @} */ - -/*! @name PFDA_TOG - PFD A */ -/*! @{ */ - -#define USBPHY_PFDA_TOG_PFD0_CLKGATE_MASK (0x1U) -#define USBPHY_PFDA_TOG_PFD0_CLKGATE_SHIFT (0U) -/*! PFD0_CLKGATE - PFD0 Clock Gate */ -#define USBPHY_PFDA_TOG_PFD0_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_TOG_PFD0_CLKGATE_SHIFT)) & USBPHY_PFDA_TOG_PFD0_CLKGATE_MASK) - -#define USBPHY_PFDA_TOG_PFD0_FRAC_MASK (0x7EU) -#define USBPHY_PFDA_TOG_PFD0_FRAC_SHIFT (1U) -/*! PFD0_FRAC - PFD0 Fractional Divider */ -#define USBPHY_PFDA_TOG_PFD0_FRAC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_TOG_PFD0_FRAC_SHIFT)) & USBPHY_PFDA_TOG_PFD0_FRAC_MASK) - -#define USBPHY_PFDA_TOG_PFD0_STABLE_MASK (0x80U) -#define USBPHY_PFDA_TOG_PFD0_STABLE_SHIFT (7U) -/*! PFD0_STABLE - PFD0 Stable Signal */ -#define USBPHY_PFDA_TOG_PFD0_STABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_TOG_PFD0_STABLE_SHIFT)) & USBPHY_PFDA_TOG_PFD0_STABLE_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group USBPHY_Register_Masks */ - - -/* USBPHY - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral USBPHY base address */ - #define USBPHY_BASE (0x5010A000u) - /** Peripheral USBPHY base address */ - #define USBPHY_BASE_NS (0x4010A000u) - /** Peripheral USBPHY base pointer */ - #define USBPHY ((USBPHY_Type *)USBPHY_BASE) - /** Peripheral USBPHY base pointer */ - #define USBPHY_NS ((USBPHY_Type *)USBPHY_BASE_NS) - /** Array initializer of USBPHY peripheral base addresses */ - #define USBPHY_BASE_ADDRS { USBPHY_BASE } - /** Array initializer of USBPHY peripheral base pointers */ - #define USBPHY_BASE_PTRS { USBPHY } - /** Array initializer of USBPHY peripheral base addresses */ - #define USBPHY_BASE_ADDRS_NS { USBPHY_BASE_NS } - /** Array initializer of USBPHY peripheral base pointers */ - #define USBPHY_BASE_PTRS_NS { USBPHY_NS } -#else - /** Peripheral USBPHY base address */ - #define USBPHY_BASE (0x4010A000u) - /** Peripheral USBPHY base pointer */ - #define USBPHY ((USBPHY_Type *)USBPHY_BASE) - /** Array initializer of USBPHY peripheral base addresses */ - #define USBPHY_BASE_ADDRS { USBPHY_BASE } - /** Array initializer of USBPHY peripheral base pointers */ - #define USBPHY_BASE_PTRS { USBPHY } -#endif -/** Interrupt vectors for the USBPHY peripheral type */ -#define USBPHY_IRQS { USB1_HS_PHY_IRQn } -/* Backward compatibility */ -#define USBPHY_CTRL_ENDEVPLUGINDET_MASK USBPHY_CTRL_ENDEVPLUGINDETECT_MASK -#define USBPHY_CTRL_ENDEVPLUGINDET_SHIFT USBPHY_CTRL_ENDEVPLUGINDETECT_SHIFT -#define USBPHY_CTRL_ENDEVPLUGINDET(x) USBPHY_CTRL_ENDEVPLUGINDETECT(x) -#define USBPHY_TX_TXCAL45DM_MASK USBPHY_TX_TXCAL45DN_MASK -#define USBPHY_TX_TXCAL45DM_SHIFT USBPHY_TX_TXCAL45DN_SHIFT -#define USBPHY_TX_TXCAL45DM(x) USBPHY_TX_TXCAL45DN(x) - - - -/*! - * @} - */ /* end of group USBPHY_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- UTICK Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup UTICK_Peripheral_Access_Layer UTICK Peripheral Access Layer - * @{ - */ - -/** UTICK - Register Layout Typedef */ -typedef struct { - __IO uint32_t CTRL; /**< Control, offset: 0x0 */ - __IO uint32_t STAT; /**< Status, offset: 0x4 */ - __IO uint32_t CFG; /**< Capture Configuration, offset: 0x8 */ - __O uint32_t CAPCLR; /**< Capture Clear, offset: 0xC */ - __I uint32_t CAP[4]; /**< Capture, array offset: 0x10, array step: 0x4 */ -} UTICK_Type; - -/* ---------------------------------------------------------------------------- - -- UTICK Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup UTICK_Register_Masks UTICK Register Masks - * @{ - */ - -/*! @name CTRL - Control */ -/*! @{ */ - -#define UTICK_CTRL_DELAYVAL_MASK (0x7FFFFFFFU) -#define UTICK_CTRL_DELAYVAL_SHIFT (0U) -/*! DELAYVAL - Tick Interval - * 0b0000000000000000000000000000000.. - * *..Clock cycles as defined in the description - */ -#define UTICK_CTRL_DELAYVAL(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CTRL_DELAYVAL_SHIFT)) & UTICK_CTRL_DELAYVAL_MASK) - -#define UTICK_CTRL_REPEAT_MASK (0x80000000U) -#define UTICK_CTRL_REPEAT_SHIFT (31U) -/*! REPEAT - Repeat Delay - * 0b0..One-time delay - * 0b1..Delay repeats continuously - */ -#define UTICK_CTRL_REPEAT(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CTRL_REPEAT_SHIFT)) & UTICK_CTRL_REPEAT_MASK) -/*! @} */ - -/*! @name STAT - Status */ -/*! @{ */ - -#define UTICK_STAT_INTR_MASK (0x1U) -#define UTICK_STAT_INTR_SHIFT (0U) -/*! INTR - Interrupt Flag - * 0b0..Not pending - * 0b1..Pending - */ -#define UTICK_STAT_INTR(x) (((uint32_t)(((uint32_t)(x)) << UTICK_STAT_INTR_SHIFT)) & UTICK_STAT_INTR_MASK) - -#define UTICK_STAT_ACTIVE_MASK (0x2U) -#define UTICK_STAT_ACTIVE_SHIFT (1U) -/*! ACTIVE - Timer Active Flag - * 0b0..Inactive (stopped) - * 0b1..Active - */ -#define UTICK_STAT_ACTIVE(x) (((uint32_t)(((uint32_t)(x)) << UTICK_STAT_ACTIVE_SHIFT)) & UTICK_STAT_ACTIVE_MASK) -/*! @} */ - -/*! @name CFG - Capture Configuration */ -/*! @{ */ - -#define UTICK_CFG_CAPEN0_MASK (0x1U) -#define UTICK_CFG_CAPEN0_SHIFT (0U) -/*! CAPEN0 - Enable Capture 0 - * 0b0..Disable - * 0b1..Enable - */ -#define UTICK_CFG_CAPEN0(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPEN0_SHIFT)) & UTICK_CFG_CAPEN0_MASK) - -#define UTICK_CFG_CAPEN1_MASK (0x2U) -#define UTICK_CFG_CAPEN1_SHIFT (1U) -/*! CAPEN1 - Enable Capture 1 - * 0b0..Disable - * 0b1..Enable - */ -#define UTICK_CFG_CAPEN1(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPEN1_SHIFT)) & UTICK_CFG_CAPEN1_MASK) - -#define UTICK_CFG_CAPEN2_MASK (0x4U) -#define UTICK_CFG_CAPEN2_SHIFT (2U) -/*! CAPEN2 - Enable Capture 2 - * 0b0..Disable - * 0b1..Enable - */ -#define UTICK_CFG_CAPEN2(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPEN2_SHIFT)) & UTICK_CFG_CAPEN2_MASK) - -#define UTICK_CFG_CAPEN3_MASK (0x8U) -#define UTICK_CFG_CAPEN3_SHIFT (3U) -/*! CAPEN3 - Enable Capture 3 - * 0b0..Disable - * 0b1..Enable - */ -#define UTICK_CFG_CAPEN3(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPEN3_SHIFT)) & UTICK_CFG_CAPEN3_MASK) - -#define UTICK_CFG_CAPPOL0_MASK (0x100U) -#define UTICK_CFG_CAPPOL0_SHIFT (8U) -/*! CAPPOL0 - Capture Polarity 0 - * 0b0..Positive - * 0b1..Negative - */ -#define UTICK_CFG_CAPPOL0(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPPOL0_SHIFT)) & UTICK_CFG_CAPPOL0_MASK) - -#define UTICK_CFG_CAPPOL1_MASK (0x200U) -#define UTICK_CFG_CAPPOL1_SHIFT (9U) -/*! CAPPOL1 - Capture-Polarity 1 - * 0b0..Positive - * 0b1..Negative - */ -#define UTICK_CFG_CAPPOL1(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPPOL1_SHIFT)) & UTICK_CFG_CAPPOL1_MASK) - -#define UTICK_CFG_CAPPOL2_MASK (0x400U) -#define UTICK_CFG_CAPPOL2_SHIFT (10U) -/*! CAPPOL2 - Capture Polarity 2 - * 0b0..Positive - * 0b1..Negative - */ -#define UTICK_CFG_CAPPOL2(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPPOL2_SHIFT)) & UTICK_CFG_CAPPOL2_MASK) - -#define UTICK_CFG_CAPPOL3_MASK (0x800U) -#define UTICK_CFG_CAPPOL3_SHIFT (11U) -/*! CAPPOL3 - Capture Polarity 3 - * 0b0..Positive - * 0b1..Negative - */ -#define UTICK_CFG_CAPPOL3(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPPOL3_SHIFT)) & UTICK_CFG_CAPPOL3_MASK) -/*! @} */ - -/*! @name CAPCLR - Capture Clear */ -/*! @{ */ - -#define UTICK_CAPCLR_CAPCLR0_MASK (0x1U) -#define UTICK_CAPCLR_CAPCLR0_SHIFT (0U) -/*! CAPCLR0 - Clear Capture 0 - * 0b0..Does nothing - * 0b1..Clears the CAP0 register value - */ -#define UTICK_CAPCLR_CAPCLR0(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CAPCLR_CAPCLR0_SHIFT)) & UTICK_CAPCLR_CAPCLR0_MASK) - -#define UTICK_CAPCLR_CAPCLR1_MASK (0x2U) -#define UTICK_CAPCLR_CAPCLR1_SHIFT (1U) -/*! CAPCLR1 - Clear Capture 1 - * 0b0..Does nothing - * 0b1..Clears the CAP1 register value - */ -#define UTICK_CAPCLR_CAPCLR1(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CAPCLR_CAPCLR1_SHIFT)) & UTICK_CAPCLR_CAPCLR1_MASK) - -#define UTICK_CAPCLR_CAPCLR2_MASK (0x4U) -#define UTICK_CAPCLR_CAPCLR2_SHIFT (2U) -/*! CAPCLR2 - Clear Capture 2 - * 0b0..Does nothing - * 0b1..Clears the CAP2 register value - */ -#define UTICK_CAPCLR_CAPCLR2(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CAPCLR_CAPCLR2_SHIFT)) & UTICK_CAPCLR_CAPCLR2_MASK) - -#define UTICK_CAPCLR_CAPCLR3_MASK (0x8U) -#define UTICK_CAPCLR_CAPCLR3_SHIFT (3U) -/*! CAPCLR3 - Clear Capture 3 - * 0b0..Does nothing - * 0b1..Clears the CAP3 register value - */ -#define UTICK_CAPCLR_CAPCLR3(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CAPCLR_CAPCLR3_SHIFT)) & UTICK_CAPCLR_CAPCLR3_MASK) -/*! @} */ - -/*! @name CAP - Capture */ -/*! @{ */ - -#define UTICK_CAP_CAP_VALUE_MASK (0x7FFFFFFFU) -#define UTICK_CAP_CAP_VALUE_SHIFT (0U) -/*! CAP_VALUE - Captured Value for the Related Capture Event */ -#define UTICK_CAP_CAP_VALUE(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CAP_CAP_VALUE_SHIFT)) & UTICK_CAP_CAP_VALUE_MASK) - -#define UTICK_CAP_VALID_MASK (0x80000000U) -#define UTICK_CAP_VALID_SHIFT (31U) -/*! VALID - Captured Value Valid Flag - * 0b0..Valid value not captured - * 0b1..Valid value captured - */ -#define UTICK_CAP_VALID(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CAP_VALID_SHIFT)) & UTICK_CAP_VALID_MASK) -/*! @} */ - -/* The count of UTICK_CAP */ -#define UTICK_CAP_COUNT (4U) - - -/*! - * @} - */ /* end of group UTICK_Register_Masks */ - - -/* UTICK - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral UTICK0 base address */ - #define UTICK0_BASE (0x50012000u) - /** Peripheral UTICK0 base address */ - #define UTICK0_BASE_NS (0x40012000u) - /** Peripheral UTICK0 base pointer */ - #define UTICK0 ((UTICK_Type *)UTICK0_BASE) - /** Peripheral UTICK0 base pointer */ - #define UTICK0_NS ((UTICK_Type *)UTICK0_BASE_NS) - /** Array initializer of UTICK peripheral base addresses */ - #define UTICK_BASE_ADDRS { UTICK0_BASE } - /** Array initializer of UTICK peripheral base pointers */ - #define UTICK_BASE_PTRS { UTICK0 } - /** Array initializer of UTICK peripheral base addresses */ - #define UTICK_BASE_ADDRS_NS { UTICK0_BASE_NS } - /** Array initializer of UTICK peripheral base pointers */ - #define UTICK_BASE_PTRS_NS { UTICK0_NS } -#else - /** Peripheral UTICK0 base address */ - #define UTICK0_BASE (0x40012000u) - /** Peripheral UTICK0 base pointer */ - #define UTICK0 ((UTICK_Type *)UTICK0_BASE) - /** Array initializer of UTICK peripheral base addresses */ - #define UTICK_BASE_ADDRS { UTICK0_BASE } - /** Array initializer of UTICK peripheral base pointers */ - #define UTICK_BASE_PTRS { UTICK0 } -#endif -/** Interrupt vectors for the UTICK peripheral type */ -#define UTICK_IRQS { UTICK0_IRQn } - -/*! - * @} - */ /* end of group UTICK_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- VBAT Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup VBAT_Peripheral_Access_Layer VBAT Peripheral Access Layer - * @{ - */ - -/** VBAT - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - uint8_t RESERVED_0[12]; - __IO uint32_t STATUSA; /**< Status A, offset: 0x10 */ - __IO uint32_t STATUSB; /**< Status B, offset: 0x14 */ - __IO uint32_t IRQENA; /**< Interrupt Enable A, offset: 0x18 */ - __IO uint32_t IRQENB; /**< Interrupt Enable B, offset: 0x1C */ - __IO uint32_t WAKENA; /**< Wake-up Enable A, offset: 0x20 */ - __IO uint32_t WAKENB; /**< Wake-up Enable B, offset: 0x24 */ - __IO uint32_t TAMPERA; /**< Tamper Enable A, offset: 0x28 */ - __IO uint32_t TAMPERB; /**< Tamper Enable B, offset: 0x2C */ - __IO uint32_t LOCKA; /**< Lock A, offset: 0x30 */ - __IO uint32_t LOCKB; /**< Lock B, offset: 0x34 */ - __IO uint32_t WAKECFG; /**< Wake-up Configuration, offset: 0x38 */ - uint8_t RESERVED_1[196]; - __IO uint32_t OSCCTLA; /**< Oscillator Control A, offset: 0x100 */ - __IO uint32_t OSCCTLB; /**< Oscillator Control B, offset: 0x104 */ - __IO uint32_t OSCCFGA; /**< Oscillator Configuration A, offset: 0x108 */ - __IO uint32_t OSCCFGB; /**< Oscillator Configuration B, offset: 0x10C */ - uint8_t RESERVED_2[8]; - __IO uint32_t OSCLCKA; /**< Oscillator Lock A, offset: 0x118 */ - __IO uint32_t OSCLCKB; /**< Oscillator Lock B, offset: 0x11C */ - __IO uint32_t OSCCLKE; /**< Oscillator Clock Enable, offset: 0x120 */ - uint8_t RESERVED_3[220]; - __IO uint32_t FROCTLA; /**< FRO16K Control A, offset: 0x200 */ - __IO uint32_t FROCTLB; /**< FRO16K Control B, offset: 0x204 */ - uint8_t RESERVED_4[16]; - __IO uint32_t FROLCKA; /**< FRO16K Lock A, offset: 0x218 */ - __IO uint32_t FROLCKB; /**< FRO16K Lock B, offset: 0x21C */ - __IO uint32_t FROCLKE; /**< FRO16K Clock Enable, offset: 0x220 */ - uint8_t RESERVED_5[220]; - __IO uint32_t LDOCTLA; /**< LDO_RAM Control A, offset: 0x300 */ - __IO uint32_t LDOCTLB; /**< LDO_RAM Control B, offset: 0x304 */ - uint8_t RESERVED_6[16]; - __IO uint32_t LDOLCKA; /**< LDO_RAM Lock A, offset: 0x318 */ - __IO uint32_t LDOLCKB; /**< LDO_RAM Lock B, offset: 0x31C */ - __IO uint32_t LDORAMC; /**< RAM Control, offset: 0x320 */ - uint8_t RESERVED_7[12]; - __IO uint32_t LDOTIMER0; /**< Bandgap Timer 0, offset: 0x330 */ - uint8_t RESERVED_8[4]; - __IO uint32_t LDOTIMER1; /**< Bandgap Timer 1, offset: 0x338 */ - uint8_t RESERVED_9[196]; - __IO uint32_t MONCTLA; /**< CLKMON Control A, offset: 0x400 */ - __IO uint32_t MONCTLB; /**< CLKMON Control B, offset: 0x404 */ - __IO uint32_t MONCFGA; /**< CLKMON Configuration A, offset: 0x408 */ - __IO uint32_t MONCFGB; /**< CLKMON Configuration B, offset: 0x40C */ - uint8_t RESERVED_10[8]; - __IO uint32_t MONLCKA; /**< CLKMON Lock A, offset: 0x418 */ - __IO uint32_t MONLCKB; /**< CLKMON Lock B, offset: 0x41C */ - uint8_t RESERVED_11[224]; - __IO uint32_t TAMCTLA; /**< TAMPER Control A, offset: 0x500 */ - __IO uint32_t TAMCTLB; /**< TAMPER Control B, offset: 0x504 */ - uint8_t RESERVED_12[16]; - __IO uint32_t TAMLCKA; /**< TAMPER Lock A, offset: 0x518 */ - __IO uint32_t TAMLCKB; /**< TAMPER Lock B, offset: 0x51C */ - uint8_t RESERVED_13[224]; - __IO uint32_t SWICTLA; /**< Switch Control A, offset: 0x600 */ - __IO uint32_t SWICTLB; /**< Switch Control B, offset: 0x604 */ - uint8_t RESERVED_14[16]; - __IO uint32_t SWILCKA; /**< Switch Lock A, offset: 0x618 */ - __IO uint32_t SWILCKB; /**< Switch Lock B, offset: 0x61C */ - uint8_t RESERVED_15[224]; - struct { /* offset: 0x700, array step: 0x8 */ - __IO uint32_t WAKEUPA; /**< Wakeup 0 Register A, array offset: 0x700, array step: 0x8 */ - __IO uint32_t WAKEUPB; /**< Wakeup 0 Register B, array offset: 0x704, array step: 0x8 */ - } WAKEUP[2]; - uint8_t RESERVED_16[232]; - __IO uint32_t WAKLCKA; /**< Wakeup Lock A, offset: 0x7F8 */ - __IO uint32_t WAKLCKB; /**< Wakeup Lock B, offset: 0x7FC */ -} VBAT_Type; - -/* ---------------------------------------------------------------------------- - -- VBAT Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup VBAT_Register_Masks VBAT Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define VBAT_VERID_FEATURE_MASK (0xFFFFU) -#define VBAT_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number */ -#define VBAT_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_VERID_FEATURE_SHIFT)) & VBAT_VERID_FEATURE_MASK) - -#define VBAT_VERID_MINOR_MASK (0xFF0000U) -#define VBAT_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define VBAT_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << VBAT_VERID_MINOR_SHIFT)) & VBAT_VERID_MINOR_MASK) - -#define VBAT_VERID_MAJOR_MASK (0xFF000000U) -#define VBAT_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define VBAT_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << VBAT_VERID_MAJOR_SHIFT)) & VBAT_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name STATUSA - Status A */ -/*! @{ */ - -#define VBAT_STATUSA_POR_DET_MASK (0x1U) -#define VBAT_STATUSA_POR_DET_SHIFT (0U) -/*! POR_DET - POR Detect Flag - * 0b0..Not reset - * 0b1..Reset - * 0b0..No effect - * 0b1..Clear the flag - */ -#define VBAT_STATUSA_POR_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_POR_DET_SHIFT)) & VBAT_STATUSA_POR_DET_MASK) - -#define VBAT_STATUSA_WAKEUP_FLAG_MASK (0x2U) -#define VBAT_STATUSA_WAKEUP_FLAG_SHIFT (1U) -/*! WAKEUP_FLAG - Wakeup Pin Flag - * 0b0..Not asserted - * 0b1..Asserted - * 0b0..No effect - * 0b1..Clear the flag - */ -#define VBAT_STATUSA_WAKEUP_FLAG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_WAKEUP_FLAG_SHIFT)) & VBAT_STATUSA_WAKEUP_FLAG_MASK) - -#define VBAT_STATUSA_TIMER0_FLAG_MASK (0x4U) -#define VBAT_STATUSA_TIMER0_FLAG_SHIFT (2U) -/*! TIMER0_FLAG - Bandgap Timer 0 Flag - * 0b0..Not reached - * 0b1..Reached - * 0b0..No effect - * 0b1..Clear the flag - */ -#define VBAT_STATUSA_TIMER0_FLAG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_TIMER0_FLAG_SHIFT)) & VBAT_STATUSA_TIMER0_FLAG_MASK) - -#define VBAT_STATUSA_TIMER1_FLAG_MASK (0x8U) -#define VBAT_STATUSA_TIMER1_FLAG_SHIFT (3U) -/*! TIMER1_FLAG - Bandgap Timer 1 Flag - * 0b0..Not reached - * 0b1..Reached - * 0b0..No effect - * 0b1..Clear the flag - */ -#define VBAT_STATUSA_TIMER1_FLAG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_TIMER1_FLAG_SHIFT)) & VBAT_STATUSA_TIMER1_FLAG_MASK) - -#define VBAT_STATUSA_LDO_RDY_MASK (0x10U) -#define VBAT_STATUSA_LDO_RDY_SHIFT (4U) -/*! LDO_RDY - LDO Ready - * 0b0..Disabled (not ready) - * 0b1..Enabled (ready) - */ -#define VBAT_STATUSA_LDO_RDY(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_LDO_RDY_SHIFT)) & VBAT_STATUSA_LDO_RDY_MASK) - -#define VBAT_STATUSA_OSC_RDY_MASK (0x20U) -#define VBAT_STATUSA_OSC_RDY_SHIFT (5U) -/*! OSC_RDY - OSC32k Ready - * 0b0..Disabled (clock not ready) - * 0b1..Enabled (clock ready) - */ -#define VBAT_STATUSA_OSC_RDY(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_OSC_RDY_SHIFT)) & VBAT_STATUSA_OSC_RDY_MASK) - -#define VBAT_STATUSA_CLOCK_DET_MASK (0x40U) -#define VBAT_STATUSA_CLOCK_DET_SHIFT (6U) -/*! CLOCK_DET - Clock Detect - * 0b0..Clock error not detected - * 0b1..Clock error detected - */ -#define VBAT_STATUSA_CLOCK_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_CLOCK_DET_SHIFT)) & VBAT_STATUSA_CLOCK_DET_MASK) - -#define VBAT_STATUSA_CONFIG_DET_MASK (0x80U) -#define VBAT_STATUSA_CONFIG_DET_SHIFT (7U) -/*! CONFIG_DET - Configuration Detect Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define VBAT_STATUSA_CONFIG_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_CONFIG_DET_SHIFT)) & VBAT_STATUSA_CONFIG_DET_MASK) - -#define VBAT_STATUSA_VOLT_DET_MASK (0x100U) -#define VBAT_STATUSA_VOLT_DET_SHIFT (8U) -/*! VOLT_DET - Voltage Detect - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define VBAT_STATUSA_VOLT_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_VOLT_DET_SHIFT)) & VBAT_STATUSA_VOLT_DET_MASK) - -#define VBAT_STATUSA_TEMP_DET_MASK (0x200U) -#define VBAT_STATUSA_TEMP_DET_SHIFT (9U) -/*! TEMP_DET - Temperature Detect - * 0b0..Temperature error not detected - * 0b1..Temperature error detected - */ -#define VBAT_STATUSA_TEMP_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_TEMP_DET_SHIFT)) & VBAT_STATUSA_TEMP_DET_MASK) - -#define VBAT_STATUSA_LIGHT_DET_MASK (0x400U) -#define VBAT_STATUSA_LIGHT_DET_SHIFT (10U) -/*! LIGHT_DET - Light Detect - * 0b0..Light error not detected - * 0b1..Light error detected - */ -#define VBAT_STATUSA_LIGHT_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_LIGHT_DET_SHIFT)) & VBAT_STATUSA_LIGHT_DET_MASK) - -#define VBAT_STATUSA_SEC0_DET_MASK (0x1000U) -#define VBAT_STATUSA_SEC0_DET_SHIFT (12U) -/*! SEC0_DET - Input 0 Detect - * 0b0..Security input 0 not detected - * 0b1..Security input 0 detected - */ -#define VBAT_STATUSA_SEC0_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_SEC0_DET_SHIFT)) & VBAT_STATUSA_SEC0_DET_MASK) - -#define VBAT_STATUSA_IRQ0_DET_MASK (0x10000U) -#define VBAT_STATUSA_IRQ0_DET_SHIFT (16U) -/*! IRQ0_DET - Interrupt 0 Detect - * 0b0..Not asserted - * 0b1..Asserted - */ -#define VBAT_STATUSA_IRQ0_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_IRQ0_DET_SHIFT)) & VBAT_STATUSA_IRQ0_DET_MASK) - -#define VBAT_STATUSA_IRQ1_DET_MASK (0x20000U) -#define VBAT_STATUSA_IRQ1_DET_SHIFT (17U) -/*! IRQ1_DET - Interrupt 1 Detect - * 0b0..Not asserted - * 0b1..Asserted - */ -#define VBAT_STATUSA_IRQ1_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_IRQ1_DET_SHIFT)) & VBAT_STATUSA_IRQ1_DET_MASK) - -#define VBAT_STATUSA_IRQ2_DET_MASK (0x40000U) -#define VBAT_STATUSA_IRQ2_DET_SHIFT (18U) -/*! IRQ2_DET - Interrupt 2 Detect - * 0b0..Not asserted - * 0b1..Asserted - */ -#define VBAT_STATUSA_IRQ2_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_IRQ2_DET_SHIFT)) & VBAT_STATUSA_IRQ2_DET_MASK) - -#define VBAT_STATUSA_IRQ3_DET_MASK (0x80000U) -#define VBAT_STATUSA_IRQ3_DET_SHIFT (19U) -/*! IRQ3_DET - Interrupt 3 Detect - * 0b0..Not asserted - * 0b1..Asserted - */ -#define VBAT_STATUSA_IRQ3_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_IRQ3_DET_SHIFT)) & VBAT_STATUSA_IRQ3_DET_MASK) -/*! @} */ - -/*! @name STATUSB - Status B */ -/*! @{ */ - -#define VBAT_STATUSB_INVERSE_MASK (0xFFFFFU) -#define VBAT_STATUSB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse value */ -#define VBAT_STATUSB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSB_INVERSE_SHIFT)) & VBAT_STATUSB_INVERSE_MASK) -/*! @} */ - -/*! @name IRQENA - Interrupt Enable A */ -/*! @{ */ - -#define VBAT_IRQENA_POR_DET_MASK (0x1U) -#define VBAT_IRQENA_POR_DET_SHIFT (0U) -/*! POR_DET - POR Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_POR_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_POR_DET_SHIFT)) & VBAT_IRQENA_POR_DET_MASK) - -#define VBAT_IRQENA_WAKEUP_FLAG_MASK (0x2U) -#define VBAT_IRQENA_WAKEUP_FLAG_SHIFT (1U) -/*! WAKEUP_FLAG - Wakeup Pin Flag - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_WAKEUP_FLAG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_WAKEUP_FLAG_SHIFT)) & VBAT_IRQENA_WAKEUP_FLAG_MASK) - -#define VBAT_IRQENA_TIMER0_FLAG_MASK (0x4U) -#define VBAT_IRQENA_TIMER0_FLAG_SHIFT (2U) -/*! TIMER0_FLAG - Bandgap Timer 0 - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_TIMER0_FLAG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_TIMER0_FLAG_SHIFT)) & VBAT_IRQENA_TIMER0_FLAG_MASK) - -#define VBAT_IRQENA_TIMER1_FLAG_MASK (0x8U) -#define VBAT_IRQENA_TIMER1_FLAG_SHIFT (3U) -/*! TIMER1_FLAG - Bandgap Timer 2 - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_TIMER1_FLAG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_TIMER1_FLAG_SHIFT)) & VBAT_IRQENA_TIMER1_FLAG_MASK) - -#define VBAT_IRQENA_LDO_RDY_MASK (0x10U) -#define VBAT_IRQENA_LDO_RDY_SHIFT (4U) -/*! LDO_RDY - LDO Ready - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_LDO_RDY(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_LDO_RDY_SHIFT)) & VBAT_IRQENA_LDO_RDY_MASK) - -#define VBAT_IRQENA_OSC_RDY_MASK (0x20U) -#define VBAT_IRQENA_OSC_RDY_SHIFT (5U) -/*! OSC_RDY - OSC32k Ready - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_OSC_RDY(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_OSC_RDY_SHIFT)) & VBAT_IRQENA_OSC_RDY_MASK) - -#define VBAT_IRQENA_CLOCK_DET_MASK (0x40U) -#define VBAT_IRQENA_CLOCK_DET_SHIFT (6U) -/*! CLOCK_DET - Clock Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_CLOCK_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_CLOCK_DET_SHIFT)) & VBAT_IRQENA_CLOCK_DET_MASK) - -#define VBAT_IRQENA_CONFIG_DET_MASK (0x80U) -#define VBAT_IRQENA_CONFIG_DET_SHIFT (7U) -/*! CONFIG_DET - Configuration Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_CONFIG_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_CONFIG_DET_SHIFT)) & VBAT_IRQENA_CONFIG_DET_MASK) - -#define VBAT_IRQENA_VOLT_DET_MASK (0x100U) -#define VBAT_IRQENA_VOLT_DET_SHIFT (8U) -/*! VOLT_DET - Voltage Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_VOLT_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_VOLT_DET_SHIFT)) & VBAT_IRQENA_VOLT_DET_MASK) - -#define VBAT_IRQENA_TEMP_DET_MASK (0x200U) -#define VBAT_IRQENA_TEMP_DET_SHIFT (9U) -/*! TEMP_DET - Temperature Detect - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define VBAT_IRQENA_TEMP_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_TEMP_DET_SHIFT)) & VBAT_IRQENA_TEMP_DET_MASK) - -#define VBAT_IRQENA_LIGHT_DET_MASK (0x400U) -#define VBAT_IRQENA_LIGHT_DET_SHIFT (10U) -/*! LIGHT_DET - Light Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_LIGHT_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_LIGHT_DET_SHIFT)) & VBAT_IRQENA_LIGHT_DET_MASK) - -#define VBAT_IRQENA_SEC0_DET_MASK (0x1000U) -#define VBAT_IRQENA_SEC0_DET_SHIFT (12U) -/*! SEC0_DET - Input 0 Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_SEC0_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_SEC0_DET_SHIFT)) & VBAT_IRQENA_SEC0_DET_MASK) - -#define VBAT_IRQENA_IRQ0_DET_MASK (0x10000U) -#define VBAT_IRQENA_IRQ0_DET_SHIFT (16U) -/*! IRQ0_DET - Interrupt 0 Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_IRQ0_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_IRQ0_DET_SHIFT)) & VBAT_IRQENA_IRQ0_DET_MASK) - -#define VBAT_IRQENA_IRQ1_DET_MASK (0x20000U) -#define VBAT_IRQENA_IRQ1_DET_SHIFT (17U) -/*! IRQ1_DET - Interrupt 1 Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_IRQ1_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_IRQ1_DET_SHIFT)) & VBAT_IRQENA_IRQ1_DET_MASK) - -#define VBAT_IRQENA_IRQ2_DET_MASK (0x40000U) -#define VBAT_IRQENA_IRQ2_DET_SHIFT (18U) -/*! IRQ2_DET - Interrupt 2 Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_IRQ2_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_IRQ2_DET_SHIFT)) & VBAT_IRQENA_IRQ2_DET_MASK) - -#define VBAT_IRQENA_IRQ3_DET_MASK (0x80000U) -#define VBAT_IRQENA_IRQ3_DET_SHIFT (19U) -/*! IRQ3_DET - Interrupt 3 Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_IRQ3_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_IRQ3_DET_SHIFT)) & VBAT_IRQENA_IRQ3_DET_MASK) -/*! @} */ - -/*! @name IRQENB - Interrupt Enable B */ -/*! @{ */ - -#define VBAT_IRQENB_INVERSE_MASK (0xFFFFFU) -#define VBAT_IRQENB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse Value */ -#define VBAT_IRQENB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENB_INVERSE_SHIFT)) & VBAT_IRQENB_INVERSE_MASK) -/*! @} */ - -/*! @name WAKENA - Wake-up Enable A */ -/*! @{ */ - -#define VBAT_WAKENA_POR_DET_MASK (0x1U) -#define VBAT_WAKENA_POR_DET_SHIFT (0U) -/*! POR_DET - POR Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_POR_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_POR_DET_SHIFT)) & VBAT_WAKENA_POR_DET_MASK) - -#define VBAT_WAKENA_WAKEUP_FLAG_MASK (0x2U) -#define VBAT_WAKENA_WAKEUP_FLAG_SHIFT (1U) -/*! WAKEUP_FLAG - Wake-up Pin Flag - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_WAKEUP_FLAG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_WAKEUP_FLAG_SHIFT)) & VBAT_WAKENA_WAKEUP_FLAG_MASK) - -#define VBAT_WAKENA_TIMER0_FLAG_MASK (0x4U) -#define VBAT_WAKENA_TIMER0_FLAG_SHIFT (2U) -/*! TIMER0_FLAG - Bandgap Timer 0 - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_TIMER0_FLAG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_TIMER0_FLAG_SHIFT)) & VBAT_WAKENA_TIMER0_FLAG_MASK) - -#define VBAT_WAKENA_TIMER1_FLAG_MASK (0x8U) -#define VBAT_WAKENA_TIMER1_FLAG_SHIFT (3U) -/*! TIMER1_FLAG - Bandgap Timer 2 - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_TIMER1_FLAG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_TIMER1_FLAG_SHIFT)) & VBAT_WAKENA_TIMER1_FLAG_MASK) - -#define VBAT_WAKENA_LDO_RDY_MASK (0x10U) -#define VBAT_WAKENA_LDO_RDY_SHIFT (4U) -/*! LDO_RDY - LDO Ready - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_LDO_RDY(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_LDO_RDY_SHIFT)) & VBAT_WAKENA_LDO_RDY_MASK) - -#define VBAT_WAKENA_OSC_RDY_MASK (0x20U) -#define VBAT_WAKENA_OSC_RDY_SHIFT (5U) -/*! OSC_RDY - OSC32K Ready - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_OSC_RDY(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_OSC_RDY_SHIFT)) & VBAT_WAKENA_OSC_RDY_MASK) - -#define VBAT_WAKENA_CLOCK_DET_MASK (0x40U) -#define VBAT_WAKENA_CLOCK_DET_SHIFT (6U) -/*! CLOCK_DET - Clock Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_CLOCK_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_CLOCK_DET_SHIFT)) & VBAT_WAKENA_CLOCK_DET_MASK) - -#define VBAT_WAKENA_CONFIG_DET_MASK (0x80U) -#define VBAT_WAKENA_CONFIG_DET_SHIFT (7U) -/*! CONFIG_DET - Configuration Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_CONFIG_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_CONFIG_DET_SHIFT)) & VBAT_WAKENA_CONFIG_DET_MASK) - -#define VBAT_WAKENA_VOLT_DET_MASK (0x100U) -#define VBAT_WAKENA_VOLT_DET_SHIFT (8U) -/*! VOLT_DET - Voltage Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_VOLT_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_VOLT_DET_SHIFT)) & VBAT_WAKENA_VOLT_DET_MASK) - -#define VBAT_WAKENA_TEMP_DET_MASK (0x200U) -#define VBAT_WAKENA_TEMP_DET_SHIFT (9U) -/*! TEMP_DET - Temperature Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_TEMP_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_TEMP_DET_SHIFT)) & VBAT_WAKENA_TEMP_DET_MASK) - -#define VBAT_WAKENA_LIGHT_DET_MASK (0x400U) -#define VBAT_WAKENA_LIGHT_DET_SHIFT (10U) -/*! LIGHT_DET - Light Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_LIGHT_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_LIGHT_DET_SHIFT)) & VBAT_WAKENA_LIGHT_DET_MASK) - -#define VBAT_WAKENA_SEC0_DET_MASK (0x1000U) -#define VBAT_WAKENA_SEC0_DET_SHIFT (12U) -/*! SEC0_DET - Input 0 Detect - * 0b0..Disabled - * 0b1..Enabled - */ -#define VBAT_WAKENA_SEC0_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_SEC0_DET_SHIFT)) & VBAT_WAKENA_SEC0_DET_MASK) - -#define VBAT_WAKENA_IRQ0_DET_MASK (0x10000U) -#define VBAT_WAKENA_IRQ0_DET_SHIFT (16U) -/*! IRQ0_DET - Interrupt 0 Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_IRQ0_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_IRQ0_DET_SHIFT)) & VBAT_WAKENA_IRQ0_DET_MASK) - -#define VBAT_WAKENA_IRQ1_DET_MASK (0x20000U) -#define VBAT_WAKENA_IRQ1_DET_SHIFT (17U) -/*! IRQ1_DET - Interrupt 1 Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_IRQ1_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_IRQ1_DET_SHIFT)) & VBAT_WAKENA_IRQ1_DET_MASK) - -#define VBAT_WAKENA_IRQ2_DET_MASK (0x40000U) -#define VBAT_WAKENA_IRQ2_DET_SHIFT (18U) -/*! IRQ2_DET - Interrupt 2 Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_IRQ2_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_IRQ2_DET_SHIFT)) & VBAT_WAKENA_IRQ2_DET_MASK) - -#define VBAT_WAKENA_IRQ3_DET_MASK (0x80000U) -#define VBAT_WAKENA_IRQ3_DET_SHIFT (19U) -/*! IRQ3_DET - Interrupt 3 Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_IRQ3_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_IRQ3_DET_SHIFT)) & VBAT_WAKENA_IRQ3_DET_MASK) -/*! @} */ - -/*! @name WAKENB - Wake-up Enable B */ -/*! @{ */ - -#define VBAT_WAKENB_INVERSE_MASK (0xFFFFFU) -#define VBAT_WAKENB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse Value */ -#define VBAT_WAKENB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENB_INVERSE_SHIFT)) & VBAT_WAKENB_INVERSE_MASK) -/*! @} */ - -/*! @name TAMPERA - Tamper Enable A */ -/*! @{ */ - -#define VBAT_TAMPERA_POR_DET_MASK (0x1U) -#define VBAT_TAMPERA_POR_DET_SHIFT (0U) -/*! POR_DET - POR Detect - * 0b0..Tamper disabled - * 0b1..Tamper enabled - */ -#define VBAT_TAMPERA_POR_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMPERA_POR_DET_SHIFT)) & VBAT_TAMPERA_POR_DET_MASK) - -#define VBAT_TAMPERA_CLOCK_DET_MASK (0x40U) -#define VBAT_TAMPERA_CLOCK_DET_SHIFT (6U) -/*! CLOCK_DET - Clock Detect - * 0b0..Tamper disabled - * 0b1..Tamper enabled - */ -#define VBAT_TAMPERA_CLOCK_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMPERA_CLOCK_DET_SHIFT)) & VBAT_TAMPERA_CLOCK_DET_MASK) - -#define VBAT_TAMPERA_CONFIG_DET_MASK (0x80U) -#define VBAT_TAMPERA_CONFIG_DET_SHIFT (7U) -/*! CONFIG_DET - Configuration Detect - * 0b0..Tamper disabled - * 0b1..Tamper enabled - */ -#define VBAT_TAMPERA_CONFIG_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMPERA_CONFIG_DET_SHIFT)) & VBAT_TAMPERA_CONFIG_DET_MASK) - -#define VBAT_TAMPERA_VOLT_DET_MASK (0x100U) -#define VBAT_TAMPERA_VOLT_DET_SHIFT (8U) -/*! VOLT_DET - Voltage Detect - * 0b0..Tamper disabled - * 0b1..Tamper enabled - */ -#define VBAT_TAMPERA_VOLT_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMPERA_VOLT_DET_SHIFT)) & VBAT_TAMPERA_VOLT_DET_MASK) - -#define VBAT_TAMPERA_TEMP_DET_MASK (0x200U) -#define VBAT_TAMPERA_TEMP_DET_SHIFT (9U) -/*! TEMP_DET - Temperature Detect - * 0b0..Tamper disabled - * 0b1..Tamper enabled - */ -#define VBAT_TAMPERA_TEMP_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMPERA_TEMP_DET_SHIFT)) & VBAT_TAMPERA_TEMP_DET_MASK) - -#define VBAT_TAMPERA_LIGHT_DET_MASK (0x400U) -#define VBAT_TAMPERA_LIGHT_DET_SHIFT (10U) -/*! LIGHT_DET - Light Detect - * 0b0..Tamper disabled - * 0b1..Tamper enabled - */ -#define VBAT_TAMPERA_LIGHT_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMPERA_LIGHT_DET_SHIFT)) & VBAT_TAMPERA_LIGHT_DET_MASK) - -#define VBAT_TAMPERA_SEC0_DET_MASK (0x1000U) -#define VBAT_TAMPERA_SEC0_DET_SHIFT (12U) -/*! SEC0_DET - Input 0 Detect - * 0b0..Tamper disabled - * 0b1..Tamper enabled - */ -#define VBAT_TAMPERA_SEC0_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMPERA_SEC0_DET_SHIFT)) & VBAT_TAMPERA_SEC0_DET_MASK) -/*! @} */ - -/*! @name TAMPERB - Tamper Enable B */ -/*! @{ */ - -#define VBAT_TAMPERB_INVERSE_MASK (0xFFFFU) -#define VBAT_TAMPERB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse value */ -#define VBAT_TAMPERB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMPERB_INVERSE_SHIFT)) & VBAT_TAMPERB_INVERSE_MASK) -/*! @} */ - -/*! @name LOCKA - Lock A */ -/*! @{ */ - -#define VBAT_LOCKA_LOCK_MASK (0x1U) -#define VBAT_LOCKA_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b0..Disables lock - * 0b1..Enables lock. Cleared by VBAT POR. - */ -#define VBAT_LOCKA_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LOCKA_LOCK_SHIFT)) & VBAT_LOCKA_LOCK_MASK) -/*! @} */ - -/*! @name LOCKB - Lock B */ -/*! @{ */ - -#define VBAT_LOCKB_LOCK_MASK (0x1U) -#define VBAT_LOCKB_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b1..Disables lock - * 0b0..Enables lock - */ -#define VBAT_LOCKB_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LOCKB_LOCK_SHIFT)) & VBAT_LOCKB_LOCK_MASK) -/*! @} */ - -/*! @name WAKECFG - Wake-up Configuration */ -/*! @{ */ - -#define VBAT_WAKECFG_OUT_MASK (0x1U) -#define VBAT_WAKECFG_OUT_SHIFT (0U) -/*! OUT - Output - * 0b0..Logic zero (asserted) - * 0b1..Logic one - */ -#define VBAT_WAKECFG_OUT(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKECFG_OUT_SHIFT)) & VBAT_WAKECFG_OUT_MASK) -/*! @} */ - -/*! @name OSCCTLA - Oscillator Control A */ -/*! @{ */ - -#define VBAT_OSCCTLA_OSC_EN_MASK (0x1U) -#define VBAT_OSCCTLA_OSC_EN_SHIFT (0U) -/*! OSC_EN - Crystal Oscillator Enable - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_OSCCTLA_OSC_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCTLA_OSC_EN_SHIFT)) & VBAT_OSCCTLA_OSC_EN_MASK) - -#define VBAT_OSCCTLA_OSC_BYP_EN_MASK (0x2U) -#define VBAT_OSCCTLA_OSC_BYP_EN_SHIFT (1U) -/*! OSC_BYP_EN - Crystal Oscillator Bypass Enable - * 0b0..Does not bypass - * 0b1..Bypass - */ -#define VBAT_OSCCTLA_OSC_BYP_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCTLA_OSC_BYP_EN_SHIFT)) & VBAT_OSCCTLA_OSC_BYP_EN_MASK) - -#define VBAT_OSCCTLA_COARSE_AMP_GAIN_MASK (0xCU) -#define VBAT_OSCCTLA_COARSE_AMP_GAIN_SHIFT (2U) -/*! COARSE_AMP_GAIN - Amplifier gain adjustment bits to allow the use of a wide range of external - * crystal ESR values See the device datasheet for the ranges supported by this device - * 0b00..ESR Range 0 - * 0b01..ESR Range 1 - * 0b10..ESR Range 2 - * 0b11..ESR Range 3 - */ -#define VBAT_OSCCTLA_COARSE_AMP_GAIN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCTLA_COARSE_AMP_GAIN_SHIFT)) & VBAT_OSCCTLA_COARSE_AMP_GAIN_MASK) - -#define VBAT_OSCCTLA_CAP_SEL_EN_MASK (0x80U) -#define VBAT_OSCCTLA_CAP_SEL_EN_SHIFT (7U) -/*! CAP_SEL_EN - Crystal Load Capacitance Selection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_OSCCTLA_CAP_SEL_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCTLA_CAP_SEL_EN_SHIFT)) & VBAT_OSCCTLA_CAP_SEL_EN_MASK) - -#define VBAT_OSCCTLA_EXTAL_CAP_SEL_MASK (0xF00U) -#define VBAT_OSCCTLA_EXTAL_CAP_SEL_SHIFT (8U) -/*! EXTAL_CAP_SEL - Crystal Load Capacitance Selection - * 0b0000..0 pF - * 0b0001..2 pF - * 0b0010..4 pF - * 0b0011..6 pF - * 0b0100..8 pF - * 0b0101..10 pF - * 0b0110..12 pF - * 0b0111..14 pF - * 0b1000..16 pF - * 0b1001..18 pF - * 0b1010..20 pF - * 0b1011..22 pF - * 0b1100..24 pF - * 0b1101..26 pF - * 0b1110..28 pF - * 0b1111..30 pF - */ -#define VBAT_OSCCTLA_EXTAL_CAP_SEL(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCTLA_EXTAL_CAP_SEL_SHIFT)) & VBAT_OSCCTLA_EXTAL_CAP_SEL_MASK) - -#define VBAT_OSCCTLA_XTAL_CAP_SEL_MASK (0xF000U) -#define VBAT_OSCCTLA_XTAL_CAP_SEL_SHIFT (12U) -/*! XTAL_CAP_SEL - Crystal Load Capacitance Selection - * 0b0000..0 pF - * 0b0001..2 pF - * 0b0010..4 pF - * 0b0011..6 pF - * 0b0100..8 pF - * 0b0101..10 pF - * 0b0110..12 pF - * 0b0111..14 pF - * 0b1000..16 pF - * 0b1001..18 pF - * 0b1010..20 pF - * 0b1011..22 pF - * 0b1100..24 pF - * 0b1101..26 pF - * 0b1110..28 pF - * 0b1111..30 pF - */ -#define VBAT_OSCCTLA_XTAL_CAP_SEL(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCTLA_XTAL_CAP_SEL_SHIFT)) & VBAT_OSCCTLA_XTAL_CAP_SEL_MASK) - -#define VBAT_OSCCTLA_MODE_EN_MASK (0x30000U) -#define VBAT_OSCCTLA_MODE_EN_SHIFT (16U) -/*! MODE_EN - Mode Enable - * 0b00..Normal mode - * 0b01..Startup mode - * 0b11..Low power mode - */ -#define VBAT_OSCCTLA_MODE_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCTLA_MODE_EN_SHIFT)) & VBAT_OSCCTLA_MODE_EN_MASK) - -#define VBAT_OSCCTLA_SUPPLY_DET_MASK (0xC0000U) -#define VBAT_OSCCTLA_SUPPLY_DET_SHIFT (18U) -/*! SUPPLY_DET - Supply Detector Trim - * 0b00..VBAT supply is less than 3V - * 0b01..VBAT supply is greater than 3V - */ -#define VBAT_OSCCTLA_SUPPLY_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCTLA_SUPPLY_DET_SHIFT)) & VBAT_OSCCTLA_SUPPLY_DET_MASK) -/*! @} */ - -/*! @name OSCCTLB - Oscillator Control B */ -/*! @{ */ - -#define VBAT_OSCCTLB_INVERSE_MASK (0xFFFFFU) -#define VBAT_OSCCTLB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse Value */ -#define VBAT_OSCCTLB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCTLB_INVERSE_SHIFT)) & VBAT_OSCCTLB_INVERSE_MASK) -/*! @} */ - -/*! @name OSCCFGA - Oscillator Configuration A */ -/*! @{ */ - -#define VBAT_OSCCFGA_CMP_TRIM_MASK (0x3U) -#define VBAT_OSCCFGA_CMP_TRIM_SHIFT (0U) -/*! CMP_TRIM - Comparator Trim - * 0b00..760 mV - * 0b01..770 mV - * 0b11..740 mV - */ -#define VBAT_OSCCFGA_CMP_TRIM(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCFGA_CMP_TRIM_SHIFT)) & VBAT_OSCCFGA_CMP_TRIM_MASK) - -#define VBAT_OSCCFGA_CAP2_TRIM_MASK (0x4U) -#define VBAT_OSCCFGA_CAP2_TRIM_SHIFT (2U) -/*! CAP2_TRIM - CAP2_TRIM */ -#define VBAT_OSCCFGA_CAP2_TRIM(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCFGA_CAP2_TRIM_SHIFT)) & VBAT_OSCCFGA_CAP2_TRIM_MASK) - -#define VBAT_OSCCFGA_DLY_TRIM_MASK (0x78U) -#define VBAT_OSCCFGA_DLY_TRIM_SHIFT (3U) -/*! DLY_TRIM - Delay Trim - * 0b0000..P current 9(nA) and N Current 6(nA) - * 0b0001..P current 13(nA) and N Current 6(nA) - * 0b0011..P current 4(nA) and N Current 6(nA) - * 0b0100..P current 9(nA) and N Current 4(nA) - * 0b0101..P current 13(nA) and N Current 4(nA) - * 0b0111..P current 4(nA) and N Current 4(nA) - * 0b1000..P current 9(nA) and N Current 2(nA) - * 0b1001..P current 13(nA) and N Current 2(nA) - * 0b1011..P current 4(nA) and N Current 2(nA) - */ -#define VBAT_OSCCFGA_DLY_TRIM(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCFGA_DLY_TRIM_SHIFT)) & VBAT_OSCCFGA_DLY_TRIM_MASK) - -#define VBAT_OSCCFGA_CAP_TRIM_MASK (0x180U) -#define VBAT_OSCCFGA_CAP_TRIM_SHIFT (7U) -/*! CAP_TRIM - Capacitor Trim - * 0b00..Default (when CAP2_TRIM = 0 and CAP_TRIM[1:0] = 00 ) - * 0b01..-1us (when CAP2_TRIM = 0 and CAP_TRIM[1:0] = 01) - * 0b10..-2us (when CAP2_TRIM = 0 and CAP_TRIM[1:0] = 10) or or +3.5us (when CAP2_TRIM = 1 and CAP_TRIM[1:0] = 10) - * 0b11..-2.5us (when CAP2_TRIM = 0 and CAP_TRIM[1:0] = 11) or +1us (when CAP2_TRIM = 1 and CAP_TRIM[1:0] = 11) - */ -#define VBAT_OSCCFGA_CAP_TRIM(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCFGA_CAP_TRIM_SHIFT)) & VBAT_OSCCFGA_CAP_TRIM_MASK) - -#define VBAT_OSCCFGA_INIT_TRIM_MASK (0xE00U) -#define VBAT_OSCCFGA_INIT_TRIM_SHIFT (9U) -/*! INIT_TRIM - Initialization Trim - * 0b000..8 s - * 0b001..4 s - * 0b010..2 s - * 0b011..1 s - * 0b100..0.5 s - * 0b101..0.25 s - * 0b110..0.125 s - * 0b111..0.5 ms - */ -#define VBAT_OSCCFGA_INIT_TRIM(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCFGA_INIT_TRIM_SHIFT)) & VBAT_OSCCFGA_INIT_TRIM_MASK) -/*! @} */ - -/*! @name OSCCFGB - Oscillator Configuration B */ -/*! @{ */ - -#define VBAT_OSCCFGB_INVERSE_MASK (0xFFFU) -#define VBAT_OSCCFGB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse Value */ -#define VBAT_OSCCFGB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCFGB_INVERSE_SHIFT)) & VBAT_OSCCFGB_INVERSE_MASK) -/*! @} */ - -/*! @name OSCLCKA - Oscillator Lock A */ -/*! @{ */ - -#define VBAT_OSCLCKA_LOCK_MASK (0x1U) -#define VBAT_OSCLCKA_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b0..Do not block - * 0b1..Block - */ -#define VBAT_OSCLCKA_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCLCKA_LOCK_SHIFT)) & VBAT_OSCLCKA_LOCK_MASK) -/*! @} */ - -/*! @name OSCLCKB - Oscillator Lock B */ -/*! @{ */ - -#define VBAT_OSCLCKB_LOCK_MASK (0x1U) -#define VBAT_OSCLCKB_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b1..Do not block - * 0b0..Block - */ -#define VBAT_OSCLCKB_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCLCKB_LOCK_SHIFT)) & VBAT_OSCLCKB_LOCK_MASK) -/*! @} */ - -/*! @name OSCCLKE - Oscillator Clock Enable */ -/*! @{ */ - -#define VBAT_OSCCLKE_CLKE_MASK (0xFU) -#define VBAT_OSCCLKE_CLKE_SHIFT (0U) -/*! CLKE - Clock Enable */ -#define VBAT_OSCCLKE_CLKE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCLKE_CLKE_SHIFT)) & VBAT_OSCCLKE_CLKE_MASK) -/*! @} */ - -/*! @name FROCTLA - FRO16K Control A */ -/*! @{ */ - -#define VBAT_FROCTLA_FRO_EN_MASK (0x1U) -#define VBAT_FROCTLA_FRO_EN_SHIFT (0U) -/*! FRO_EN - FRO16K Enable - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_FROCTLA_FRO_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_FROCTLA_FRO_EN_SHIFT)) & VBAT_FROCTLA_FRO_EN_MASK) -/*! @} */ - -/*! @name FROCTLB - FRO16K Control B */ -/*! @{ */ - -#define VBAT_FROCTLB_INVERSE_MASK (0x1U) -#define VBAT_FROCTLB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse Value */ -#define VBAT_FROCTLB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_FROCTLB_INVERSE_SHIFT)) & VBAT_FROCTLB_INVERSE_MASK) -/*! @} */ - -/*! @name FROLCKA - FRO16K Lock A */ -/*! @{ */ - -#define VBAT_FROLCKA_LOCK_MASK (0x1U) -#define VBAT_FROLCKA_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b0..Do not block - * 0b1..Block - */ -#define VBAT_FROLCKA_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_FROLCKA_LOCK_SHIFT)) & VBAT_FROLCKA_LOCK_MASK) -/*! @} */ - -/*! @name FROLCKB - FRO16K Lock B */ -/*! @{ */ - -#define VBAT_FROLCKB_LOCK_MASK (0x1U) -#define VBAT_FROLCKB_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b1..Do not block - * 0b0..Block - */ -#define VBAT_FROLCKB_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_FROLCKB_LOCK_SHIFT)) & VBAT_FROLCKB_LOCK_MASK) -/*! @} */ - -/*! @name FROCLKE - FRO16K Clock Enable */ -/*! @{ */ - -#define VBAT_FROCLKE_CLKE_MASK (0xFU) -#define VBAT_FROCLKE_CLKE_SHIFT (0U) -/*! CLKE - Clock Enable */ -#define VBAT_FROCLKE_CLKE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_FROCLKE_CLKE_SHIFT)) & VBAT_FROCLKE_CLKE_MASK) -/*! @} */ - -/*! @name LDOCTLA - LDO_RAM Control A */ -/*! @{ */ - -#define VBAT_LDOCTLA_BG_EN_MASK (0x1U) -#define VBAT_LDOCTLA_BG_EN_SHIFT (0U) -/*! BG_EN - Bandgap Enable - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_LDOCTLA_BG_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDOCTLA_BG_EN_SHIFT)) & VBAT_LDOCTLA_BG_EN_MASK) - -#define VBAT_LDOCTLA_LDO_EN_MASK (0x2U) -#define VBAT_LDOCTLA_LDO_EN_SHIFT (1U) -/*! LDO_EN - LDO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_LDOCTLA_LDO_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDOCTLA_LDO_EN_SHIFT)) & VBAT_LDOCTLA_LDO_EN_MASK) - -#define VBAT_LDOCTLA_REFRESH_EN_MASK (0x4U) -#define VBAT_LDOCTLA_REFRESH_EN_SHIFT (2U) -/*! REFRESH_EN - Refresh Enable - * 0b0..Refresh mode is disabled - * 0b1..Refresh mode is enabled for low power operation - */ -#define VBAT_LDOCTLA_REFRESH_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDOCTLA_REFRESH_EN_SHIFT)) & VBAT_LDOCTLA_REFRESH_EN_MASK) -/*! @} */ - -/*! @name LDOCTLB - LDO_RAM Control B */ -/*! @{ */ - -#define VBAT_LDOCTLB_INVERSE_MASK (0x7U) -#define VBAT_LDOCTLB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse Value */ -#define VBAT_LDOCTLB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDOCTLB_INVERSE_SHIFT)) & VBAT_LDOCTLB_INVERSE_MASK) -/*! @} */ - -/*! @name LDOLCKA - LDO_RAM Lock A */ -/*! @{ */ - -#define VBAT_LDOLCKA_LOCK_MASK (0x1U) -#define VBAT_LDOLCKA_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b0..Do not block - * 0b1..Block - */ -#define VBAT_LDOLCKA_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDOLCKA_LOCK_SHIFT)) & VBAT_LDOLCKA_LOCK_MASK) -/*! @} */ - -/*! @name LDOLCKB - LDO_RAM Lock B */ -/*! @{ */ - -#define VBAT_LDOLCKB_LOCK_MASK (0x1U) -#define VBAT_LDOLCKB_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b1..Do not block - * 0b0..Block - */ -#define VBAT_LDOLCKB_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDOLCKB_LOCK_SHIFT)) & VBAT_LDOLCKB_LOCK_MASK) -/*! @} */ - -/*! @name LDORAMC - RAM Control */ -/*! @{ */ - -#define VBAT_LDORAMC_ISO_MASK (0x1U) -#define VBAT_LDORAMC_ISO_SHIFT (0U) -/*! ISO - Isolate SRAM - * 0b0..State follows the chip power modes - * 0b1..Isolates SRAM and places it in Low-Power Retention mode - */ -#define VBAT_LDORAMC_ISO(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDORAMC_ISO_SHIFT)) & VBAT_LDORAMC_ISO_MASK) - -#define VBAT_LDORAMC_SWI_MASK (0x2U) -#define VBAT_LDORAMC_SWI_SHIFT (1U) -/*! SWI - Switch SRAM - * 0b0..Supply follows the chip power modes - * 0b1..LDO_RAM powers the array - */ -#define VBAT_LDORAMC_SWI(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDORAMC_SWI_SHIFT)) & VBAT_LDORAMC_SWI_MASK) - -#define VBAT_LDORAMC_RET0_MASK (0x100U) -#define VBAT_LDORAMC_RET0_SHIFT (8U) -/*! RET0 - Retention - * 0b0..Corresponding SRAM array is retained in low-power modes - * 0b1..Corresponding SRAM array is not retained in low-power modes - */ -#define VBAT_LDORAMC_RET0(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDORAMC_RET0_SHIFT)) & VBAT_LDORAMC_RET0_MASK) - -#define VBAT_LDORAMC_RET1_MASK (0x200U) -#define VBAT_LDORAMC_RET1_SHIFT (9U) -/*! RET1 - Retention - * 0b0..Corresponding SRAM array is retained in low-power modes - * 0b1..Corresponding SRAM array is not retained in low-power modes - */ -#define VBAT_LDORAMC_RET1(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDORAMC_RET1_SHIFT)) & VBAT_LDORAMC_RET1_MASK) - -#define VBAT_LDORAMC_RET2_MASK (0x400U) -#define VBAT_LDORAMC_RET2_SHIFT (10U) -/*! RET2 - Retention - * 0b0..Corresponding SRAM array is retained in low-power modes - * 0b1..Corresponding SRAM array is not retained in low-power modes - */ -#define VBAT_LDORAMC_RET2(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDORAMC_RET2_SHIFT)) & VBAT_LDORAMC_RET2_MASK) - -#define VBAT_LDORAMC_RET3_MASK (0x800U) -#define VBAT_LDORAMC_RET3_SHIFT (11U) -/*! RET3 - Retention - * 0b0..Corresponding SRAM array is retained in low-power modes - * 0b1..Corresponding SRAM array is not retained in low-power modes - */ -#define VBAT_LDORAMC_RET3(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDORAMC_RET3_SHIFT)) & VBAT_LDORAMC_RET3_MASK) -/*! @} */ - -/*! @name LDOTIMER0 - Bandgap Timer 0 */ -/*! @{ */ - -#define VBAT_LDOTIMER0_TIMCFG_MASK (0x7U) -#define VBAT_LDOTIMER0_TIMCFG_SHIFT (0U) -/*! TIMCFG - Timeout Configuration - * 0b111..7.8125 ms - * 0b110..15.625 ms - * 0b101..31.25 ms - * 0b100..62.5 ms - * 0b011..125 ms - * 0b010..250 ms - * 0b001..500 ms - * 0b000..1 s - */ -#define VBAT_LDOTIMER0_TIMCFG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDOTIMER0_TIMCFG_SHIFT)) & VBAT_LDOTIMER0_TIMCFG_MASK) - -#define VBAT_LDOTIMER0_TIMEN_MASK (0x80000000U) -#define VBAT_LDOTIMER0_TIMEN_SHIFT (31U) -/*! TIMEN - Bandgap Timeout Period Enable - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_LDOTIMER0_TIMEN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDOTIMER0_TIMEN_SHIFT)) & VBAT_LDOTIMER0_TIMEN_MASK) -/*! @} */ - -/*! @name LDOTIMER1 - Bandgap Timer 1 */ -/*! @{ */ - -#define VBAT_LDOTIMER1_TIMCFG_MASK (0xFFFFFFU) -#define VBAT_LDOTIMER1_TIMCFG_SHIFT (0U) -/*! TIMCFG - Timeout Configuration */ -#define VBAT_LDOTIMER1_TIMCFG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDOTIMER1_TIMCFG_SHIFT)) & VBAT_LDOTIMER1_TIMCFG_MASK) - -#define VBAT_LDOTIMER1_TIMEN_MASK (0x80000000U) -#define VBAT_LDOTIMER1_TIMEN_SHIFT (31U) -/*! TIMEN - Bandgap Timeout Period Enable - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_LDOTIMER1_TIMEN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDOTIMER1_TIMEN_SHIFT)) & VBAT_LDOTIMER1_TIMEN_MASK) -/*! @} */ - -/*! @name MONCTLA - CLKMON Control A */ -/*! @{ */ - -#define VBAT_MONCTLA_MON_EN_MASK (0x1U) -#define VBAT_MONCTLA_MON_EN_SHIFT (0U) -/*! MON_EN - CLKMON Enable - * 0b0..CLKMON is disabled - * 0b1..CLKMON is enabled - */ -#define VBAT_MONCTLA_MON_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_MONCTLA_MON_EN_SHIFT)) & VBAT_MONCTLA_MON_EN_MASK) -/*! @} */ - -/*! @name MONCTLB - CLKMON Control B */ -/*! @{ */ - -#define VBAT_MONCTLB_INVERSE_MASK (0x1U) -#define VBAT_MONCTLB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse value */ -#define VBAT_MONCTLB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_MONCTLB_INVERSE_SHIFT)) & VBAT_MONCTLB_INVERSE_MASK) -/*! @} */ - -/*! @name MONCFGA - CLKMON Configuration A */ -/*! @{ */ - -#define VBAT_MONCFGA_FREQ_TRIM_MASK (0x3U) -#define VBAT_MONCFGA_FREQ_TRIM_SHIFT (0U) -/*! FREQ_TRIM - Frequency Trim - * 0b00..Clock monitor asserts 2 cycle after expected edge - * 0b01..Clock monitor asserts 4 cycles after expected edge - * 0b10..Clock monitor asserts 6 cycles after expected edge - * 0b11..Clock monitor asserts 8 cycles after expected edge - */ -#define VBAT_MONCFGA_FREQ_TRIM(x) (((uint32_t)(((uint32_t)(x)) << VBAT_MONCFGA_FREQ_TRIM_SHIFT)) & VBAT_MONCFGA_FREQ_TRIM_MASK) - -#define VBAT_MONCFGA_DIVIDE_TRIM_MASK (0x4U) -#define VBAT_MONCFGA_DIVIDE_TRIM_SHIFT (2U) -/*! DIVIDE_TRIM - Divide Trim - * 0b0..Clock monitor operates at 1 kHz - * 0b1..Clock monitor operates at 64 Hz - */ -#define VBAT_MONCFGA_DIVIDE_TRIM(x) (((uint32_t)(((uint32_t)(x)) << VBAT_MONCFGA_DIVIDE_TRIM_SHIFT)) & VBAT_MONCFGA_DIVIDE_TRIM_MASK) - -#define VBAT_MONCFGA_RSVD_TRIM_MASK (0xF8U) -#define VBAT_MONCFGA_RSVD_TRIM_SHIFT (3U) -/*! RSVD_TRIM - Reserved Trim */ -#define VBAT_MONCFGA_RSVD_TRIM(x) (((uint32_t)(((uint32_t)(x)) << VBAT_MONCFGA_RSVD_TRIM_SHIFT)) & VBAT_MONCFGA_RSVD_TRIM_MASK) -/*! @} */ - -/*! @name MONCFGB - CLKMON Configuration B */ -/*! @{ */ - -#define VBAT_MONCFGB_INVERSE_MASK (0xFFU) -#define VBAT_MONCFGB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse value */ -#define VBAT_MONCFGB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_MONCFGB_INVERSE_SHIFT)) & VBAT_MONCFGB_INVERSE_MASK) -/*! @} */ - -/*! @name MONLCKA - CLKMON Lock A */ -/*! @{ */ - -#define VBAT_MONLCKA_LOCK_MASK (0x1U) -#define VBAT_MONLCKA_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b0..Lock is disabled - * 0b1..Lock is enabled - */ -#define VBAT_MONLCKA_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_MONLCKA_LOCK_SHIFT)) & VBAT_MONLCKA_LOCK_MASK) -/*! @} */ - -/*! @name MONLCKB - CLKMON Lock B */ -/*! @{ */ - -#define VBAT_MONLCKB_LOCK_MASK (0x1U) -#define VBAT_MONLCKB_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b1..Lock is disabled - * 0b0..Lock is enabled - */ -#define VBAT_MONLCKB_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_MONLCKB_LOCK_SHIFT)) & VBAT_MONLCKB_LOCK_MASK) -/*! @} */ - -/*! @name TAMCTLA - TAMPER Control A */ -/*! @{ */ - -#define VBAT_TAMCTLA_VOLT_EN_MASK (0x1U) -#define VBAT_TAMCTLA_VOLT_EN_SHIFT (0U) -/*! VOLT_EN - Voltage Detect Enable - * 0b0..Voltage detect is disabled - * 0b1..Voltage detect is enabled - */ -#define VBAT_TAMCTLA_VOLT_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMCTLA_VOLT_EN_SHIFT)) & VBAT_TAMCTLA_VOLT_EN_MASK) - -#define VBAT_TAMCTLA_TEMP_EN_MASK (0x2U) -#define VBAT_TAMCTLA_TEMP_EN_SHIFT (1U) -/*! TEMP_EN - Temperature Detect Enable - * 0b0..Temperature detect is disabled - * 0b1..Temperature detect is enabled - */ -#define VBAT_TAMCTLA_TEMP_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMCTLA_TEMP_EN_SHIFT)) & VBAT_TAMCTLA_TEMP_EN_MASK) - -#define VBAT_TAMCTLA_LIGHT_EN_MASK (0x4U) -#define VBAT_TAMCTLA_LIGHT_EN_SHIFT (2U) -/*! LIGHT_EN - Light Detect Enable - * 0b0..Light detect is disabled - * 0b1..Light detect is enabled - */ -#define VBAT_TAMCTLA_LIGHT_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMCTLA_LIGHT_EN_SHIFT)) & VBAT_TAMCTLA_LIGHT_EN_MASK) -/*! @} */ - -/*! @name TAMCTLB - TAMPER Control B */ -/*! @{ */ - -#define VBAT_TAMCTLB_INVERSE_MASK (0xFU) -#define VBAT_TAMCTLB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse value */ -#define VBAT_TAMCTLB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMCTLB_INVERSE_SHIFT)) & VBAT_TAMCTLB_INVERSE_MASK) -/*! @} */ - -/*! @name TAMLCKA - TAMPER Lock A */ -/*! @{ */ - -#define VBAT_TAMLCKA_LOCK_MASK (0x1U) -#define VBAT_TAMLCKA_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b0..Lock is disabled - * 0b1..Lock is enabled - */ -#define VBAT_TAMLCKA_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMLCKA_LOCK_SHIFT)) & VBAT_TAMLCKA_LOCK_MASK) -/*! @} */ - -/*! @name TAMLCKB - TAMPER Lock B */ -/*! @{ */ - -#define VBAT_TAMLCKB_LOCK_MASK (0x1U) -#define VBAT_TAMLCKB_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b1..Lock is disabled - * 0b0..Lock is enabled - */ -#define VBAT_TAMLCKB_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMLCKB_LOCK_SHIFT)) & VBAT_TAMLCKB_LOCK_MASK) -/*! @} */ - -/*! @name SWICTLA - Switch Control A */ -/*! @{ */ - -#define VBAT_SWICTLA_SWI_EN_MASK (0x1U) -#define VBAT_SWICTLA_SWI_EN_SHIFT (0U) -/*! SWI_EN - Switch Enable - * 0b0..VDD_BAT - * 0b1..VDD_SYS - */ -#define VBAT_SWICTLA_SWI_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_SWICTLA_SWI_EN_SHIFT)) & VBAT_SWICTLA_SWI_EN_MASK) - -#define VBAT_SWICTLA_LP_EN_MASK (0x2U) -#define VBAT_SWICTLA_LP_EN_SHIFT (1U) -/*! LP_EN - Low Power Enable - * 0b0..VDD_BAT always supplies VBAT modules in low-power modes - * 0b1..VDD_SYS always supplies VBAT modules if SWI_EN is also 1 - */ -#define VBAT_SWICTLA_LP_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_SWICTLA_LP_EN_SHIFT)) & VBAT_SWICTLA_LP_EN_MASK) -/*! @} */ - -/*! @name SWICTLB - Switch Control B */ -/*! @{ */ - -#define VBAT_SWICTLB_INVERSE_MASK (0x3U) -#define VBAT_SWICTLB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse Value */ -#define VBAT_SWICTLB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_SWICTLB_INVERSE_SHIFT)) & VBAT_SWICTLB_INVERSE_MASK) -/*! @} */ - -/*! @name SWILCKA - Switch Lock A */ -/*! @{ */ - -#define VBAT_SWILCKA_LOCK_MASK (0x1U) -#define VBAT_SWILCKA_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b0..Do not block - * 0b1..Block - */ -#define VBAT_SWILCKA_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_SWILCKA_LOCK_SHIFT)) & VBAT_SWILCKA_LOCK_MASK) -/*! @} */ - -/*! @name SWILCKB - Switch Lock B */ -/*! @{ */ - -#define VBAT_SWILCKB_LOCK_MASK (0x1U) -#define VBAT_SWILCKB_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b1..Do not block - * 0b0..Block - */ -#define VBAT_SWILCKB_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_SWILCKB_LOCK_SHIFT)) & VBAT_SWILCKB_LOCK_MASK) -/*! @} */ - -/*! @name WAKEUP_WAKEUPA - Wakeup 0 Register A */ -/*! @{ */ - -#define VBAT_WAKEUP_WAKEUPA_REG_MASK (0xFFFFFFFFU) -#define VBAT_WAKEUP_WAKEUPA_REG_SHIFT (0U) -/*! REG - Register */ -#define VBAT_WAKEUP_WAKEUPA_REG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKEUP_WAKEUPA_REG_SHIFT)) & VBAT_WAKEUP_WAKEUPA_REG_MASK) -/*! @} */ - -/* The count of VBAT_WAKEUP_WAKEUPA */ -#define VBAT_WAKEUP_WAKEUPA_COUNT (2U) - -/*! @name WAKEUP_WAKEUPB - Wakeup 0 Register B */ -/*! @{ */ - -#define VBAT_WAKEUP_WAKEUPB_INVERSE_MASK (0xFFFFFFFFU) -#define VBAT_WAKEUP_WAKEUPB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse value */ -#define VBAT_WAKEUP_WAKEUPB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKEUP_WAKEUPB_INVERSE_SHIFT)) & VBAT_WAKEUP_WAKEUPB_INVERSE_MASK) -/*! @} */ - -/* The count of VBAT_WAKEUP_WAKEUPB */ -#define VBAT_WAKEUP_WAKEUPB_COUNT (2U) - -/*! @name WAKLCKA - Wakeup Lock A */ -/*! @{ */ - -#define VBAT_WAKLCKA_LOCK_MASK (0x1U) -#define VBAT_WAKLCKA_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b0..Lock is disabled - * 0b1..Lock is enabled - */ -#define VBAT_WAKLCKA_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKLCKA_LOCK_SHIFT)) & VBAT_WAKLCKA_LOCK_MASK) -/*! @} */ - -/*! @name WAKLCKB - Wakeup Lock B */ -/*! @{ */ - -#define VBAT_WAKLCKB_LOCK_MASK (0x1U) -#define VBAT_WAKLCKB_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b1..Lock is disabled - * 0b0..Lock is enabled - */ -#define VBAT_WAKLCKB_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKLCKB_LOCK_SHIFT)) & VBAT_WAKLCKB_LOCK_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group VBAT_Register_Masks */ - - -/* VBAT - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral VBAT0 base address */ - #define VBAT0_BASE (0x50059000u) - /** Peripheral VBAT0 base address */ - #define VBAT0_BASE_NS (0x40059000u) - /** Peripheral VBAT0 base pointer */ - #define VBAT0 ((VBAT_Type *)VBAT0_BASE) - /** Peripheral VBAT0 base pointer */ - #define VBAT0_NS ((VBAT_Type *)VBAT0_BASE_NS) - /** Array initializer of VBAT peripheral base addresses */ - #define VBAT_BASE_ADDRS { VBAT0_BASE } - /** Array initializer of VBAT peripheral base pointers */ - #define VBAT_BASE_PTRS { VBAT0 } - /** Array initializer of VBAT peripheral base addresses */ - #define VBAT_BASE_ADDRS_NS { VBAT0_BASE_NS } - /** Array initializer of VBAT peripheral base pointers */ - #define VBAT_BASE_PTRS_NS { VBAT0_NS } -#else - /** Peripheral VBAT0 base address */ - #define VBAT0_BASE (0x40059000u) - /** Peripheral VBAT0 base pointer */ - #define VBAT0 ((VBAT_Type *)VBAT0_BASE) - /** Array initializer of VBAT peripheral base addresses */ - #define VBAT_BASE_ADDRS { VBAT0_BASE } - /** Array initializer of VBAT peripheral base pointers */ - #define VBAT_BASE_PTRS { VBAT0 } -#endif - -/*! - * @} - */ /* end of group VBAT_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- VREF Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup VREF_Peripheral_Access_Layer VREF Peripheral Access Layer - * @{ - */ - -/** VREF - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - uint8_t RESERVED_0[4]; - __IO uint32_t CSR; /**< Control and Status, offset: 0x8 */ - uint8_t RESERVED_1[4]; - __IO uint32_t UTRIM; /**< User Trim, offset: 0x10 */ -} VREF_Type; - -/* ---------------------------------------------------------------------------- - -- VREF Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup VREF_Register_Masks VREF Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define VREF_VERID_FEATURE_MASK (0xFFFFU) -#define VREF_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number */ -#define VREF_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << VREF_VERID_FEATURE_SHIFT)) & VREF_VERID_FEATURE_MASK) - -#define VREF_VERID_MINOR_MASK (0xFF0000U) -#define VREF_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define VREF_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << VREF_VERID_MINOR_SHIFT)) & VREF_VERID_MINOR_MASK) - -#define VREF_VERID_MAJOR_MASK (0xFF000000U) -#define VREF_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define VREF_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << VREF_VERID_MAJOR_SHIFT)) & VREF_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name CSR - Control and Status */ -/*! @{ */ - -#define VREF_CSR_HCBGEN_MASK (0x1U) -#define VREF_CSR_HCBGEN_SHIFT (0U) -/*! HCBGEN - HC Bandgap Enabled - * 0b0..Disables - * 0b1..Enables - */ -#define VREF_CSR_HCBGEN(x) (((uint32_t)(((uint32_t)(x)) << VREF_CSR_HCBGEN_SHIFT)) & VREF_CSR_HCBGEN_MASK) - -#define VREF_CSR_LPBGEN_MASK (0x2U) -#define VREF_CSR_LPBGEN_SHIFT (1U) -/*! LPBGEN - Low-Power Bandgap Enable - * 0b0..Disables - * 0b1..Enables - */ -#define VREF_CSR_LPBGEN(x) (((uint32_t)(((uint32_t)(x)) << VREF_CSR_LPBGEN_SHIFT)) & VREF_CSR_LPBGEN_MASK) - -#define VREF_CSR_LPBG_BUF_EN_MASK (0x4U) -#define VREF_CSR_LPBG_BUF_EN_SHIFT (2U) -/*! LPBG_BUF_EN - Low-Power Bandgap Buffer Enable - * 0b0..Disables - * 0b1..Enables - */ -#define VREF_CSR_LPBG_BUF_EN(x) (((uint32_t)(((uint32_t)(x)) << VREF_CSR_LPBG_BUF_EN_SHIFT)) & VREF_CSR_LPBG_BUF_EN_MASK) - -#define VREF_CSR_CHOPEN_MASK (0x8U) -#define VREF_CSR_CHOPEN_SHIFT (3U) -/*! CHOPEN - Chop Oscillator Enable - * 0b0..Disables - * 0b1..Enables - */ -#define VREF_CSR_CHOPEN(x) (((uint32_t)(((uint32_t)(x)) << VREF_CSR_CHOPEN_SHIFT)) & VREF_CSR_CHOPEN_MASK) - -#define VREF_CSR_ICOMPEN_MASK (0x10U) -#define VREF_CSR_ICOMPEN_SHIFT (4U) -/*! ICOMPEN - Current Compensation Enable - * 0b0..Disables - * 0b1..Enables - */ -#define VREF_CSR_ICOMPEN(x) (((uint32_t)(((uint32_t)(x)) << VREF_CSR_ICOMPEN_SHIFT)) & VREF_CSR_ICOMPEN_MASK) - -#define VREF_CSR_REGEN_MASK (0x20U) -#define VREF_CSR_REGEN_SHIFT (5U) -/*! REGEN - Regulator Enable - * 0b0..Disables - * 0b1..Enables - */ -#define VREF_CSR_REGEN(x) (((uint32_t)(((uint32_t)(x)) << VREF_CSR_REGEN_SHIFT)) & VREF_CSR_REGEN_MASK) - -#define VREF_CSR_HI_PWR_LV_MASK (0x800U) -#define VREF_CSR_HI_PWR_LV_SHIFT (11U) -/*! HI_PWR_LV - High-Power Level - * 0b0..Low-power - * 0b1..High-power - */ -#define VREF_CSR_HI_PWR_LV(x) (((uint32_t)(((uint32_t)(x)) << VREF_CSR_HI_PWR_LV_SHIFT)) & VREF_CSR_HI_PWR_LV_MASK) - -#define VREF_CSR_BUF21EN_MASK (0x10000U) -#define VREF_CSR_BUF21EN_SHIFT (16U) -/*! BUF21EN - Internal Buffer21 Enable - * 0b0..Disables - * 0b1..Enables - */ -#define VREF_CSR_BUF21EN(x) (((uint32_t)(((uint32_t)(x)) << VREF_CSR_BUF21EN_SHIFT)) & VREF_CSR_BUF21EN_MASK) - -#define VREF_CSR_VREFST_MASK (0x80000000U) -#define VREF_CSR_VREFST_SHIFT (31U) -/*! VREFST - Internal HC Voltage Reference Stable - * 0b0..Disabled and unstable - * 0b1..Stable - */ -#define VREF_CSR_VREFST(x) (((uint32_t)(((uint32_t)(x)) << VREF_CSR_VREFST_SHIFT)) & VREF_CSR_VREFST_MASK) -/*! @} */ - -/*! @name UTRIM - User Trim */ -/*! @{ */ - -#define VREF_UTRIM_TRIM2V1_MASK (0xFU) -#define VREF_UTRIM_TRIM2V1_SHIFT (0U) -/*! TRIM2V1 - VREF 2.1 V Trim */ -#define VREF_UTRIM_TRIM2V1(x) (((uint32_t)(((uint32_t)(x)) << VREF_UTRIM_TRIM2V1_SHIFT)) & VREF_UTRIM_TRIM2V1_MASK) - -#define VREF_UTRIM_VREFTRIM_MASK (0x3F00U) -#define VREF_UTRIM_VREFTRIM_SHIFT (8U) -/*! VREFTRIM - VREF Trim */ -#define VREF_UTRIM_VREFTRIM(x) (((uint32_t)(((uint32_t)(x)) << VREF_UTRIM_VREFTRIM_SHIFT)) & VREF_UTRIM_VREFTRIM_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group VREF_Register_Masks */ - - -/* VREF - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral VREF0 base address */ - #define VREF0_BASE (0x50111000u) - /** Peripheral VREF0 base address */ - #define VREF0_BASE_NS (0x40111000u) - /** Peripheral VREF0 base pointer */ - #define VREF0 ((VREF_Type *)VREF0_BASE) - /** Peripheral VREF0 base pointer */ - #define VREF0_NS ((VREF_Type *)VREF0_BASE_NS) - /** Array initializer of VREF peripheral base addresses */ - #define VREF_BASE_ADDRS { VREF0_BASE } - /** Array initializer of VREF peripheral base pointers */ - #define VREF_BASE_PTRS { VREF0 } - /** Array initializer of VREF peripheral base addresses */ - #define VREF_BASE_ADDRS_NS { VREF0_BASE_NS } - /** Array initializer of VREF peripheral base pointers */ - #define VREF_BASE_PTRS_NS { VREF0_NS } -#else - /** Peripheral VREF0 base address */ - #define VREF0_BASE (0x40111000u) - /** Peripheral VREF0 base pointer */ - #define VREF0 ((VREF_Type *)VREF0_BASE) - /** Array initializer of VREF peripheral base addresses */ - #define VREF_BASE_ADDRS { VREF0_BASE } - /** Array initializer of VREF peripheral base pointers */ - #define VREF_BASE_PTRS { VREF0 } -#endif - -/*! - * @} - */ /* end of group VREF_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- WUU Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup WUU_Peripheral_Access_Layer WUU Peripheral Access Layer - * @{ - */ - -/** WUU - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - __IO uint32_t PE1; /**< Pin Enable 1, offset: 0x8 */ - __IO uint32_t PE2; /**< Pin Enable 2, offset: 0xC */ - uint8_t RESERVED_0[8]; - __IO uint32_t ME; /**< Module Interrupt Enable, offset: 0x18 */ - __IO uint32_t DE; /**< Module DMA/Trigger Enable, offset: 0x1C */ - __IO uint32_t PF; /**< Pin Flag, offset: 0x20 */ - uint8_t RESERVED_1[12]; - __IO uint32_t FILT; /**< Pin Filter, offset: 0x30 */ - uint8_t RESERVED_2[4]; - __IO uint32_t PDC1; /**< Pin DMA/Trigger Configuration 1, offset: 0x38 */ - __IO uint32_t PDC2; /**< Pin DMA/Trigger Configuration 2, offset: 0x3C */ - uint8_t RESERVED_3[8]; - __IO uint32_t FDC; /**< Pin Filter DMA/Trigger Configuration, offset: 0x48 */ - uint8_t RESERVED_4[4]; - __IO uint32_t PMC; /**< Pin Mode Configuration, offset: 0x50 */ - uint8_t RESERVED_5[4]; - __IO uint32_t FMC; /**< Pin Filter Mode Configuration, offset: 0x58 */ -} WUU_Type; - -/* ---------------------------------------------------------------------------- - -- WUU Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup WUU_Register_Masks WUU Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define WUU_VERID_FEATURE_MASK (0xFFFFU) -#define WUU_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Standard features implemented - * 0b0000000000000001..Support for DMA/Trigger generation from wake-up pins and filters enabled. Support for - * external pin/filter detection during all power modes enabled. - * *.. - */ -#define WUU_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << WUU_VERID_FEATURE_SHIFT)) & WUU_VERID_FEATURE_MASK) - -#define WUU_VERID_MINOR_MASK (0xFF0000U) -#define WUU_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define WUU_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << WUU_VERID_MINOR_SHIFT)) & WUU_VERID_MINOR_MASK) - -#define WUU_VERID_MAJOR_MASK (0xFF000000U) -#define WUU_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define WUU_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << WUU_VERID_MAJOR_SHIFT)) & WUU_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define WUU_PARAM_FILTERS_MASK (0xFFU) -#define WUU_PARAM_FILTERS_SHIFT (0U) -/*! FILTERS - Filter Number */ -#define WUU_PARAM_FILTERS(x) (((uint32_t)(((uint32_t)(x)) << WUU_PARAM_FILTERS_SHIFT)) & WUU_PARAM_FILTERS_MASK) - -#define WUU_PARAM_DMAS_MASK (0xFF00U) -#define WUU_PARAM_DMAS_SHIFT (8U) -/*! DMAS - DMA Number */ -#define WUU_PARAM_DMAS(x) (((uint32_t)(((uint32_t)(x)) << WUU_PARAM_DMAS_SHIFT)) & WUU_PARAM_DMAS_MASK) - -#define WUU_PARAM_MODULES_MASK (0xFF0000U) -#define WUU_PARAM_MODULES_SHIFT (16U) -/*! MODULES - Module Number */ -#define WUU_PARAM_MODULES(x) (((uint32_t)(((uint32_t)(x)) << WUU_PARAM_MODULES_SHIFT)) & WUU_PARAM_MODULES_MASK) - -#define WUU_PARAM_PINS_MASK (0xFF000000U) -#define WUU_PARAM_PINS_SHIFT (24U) -/*! PINS - Pin Number */ -#define WUU_PARAM_PINS(x) (((uint32_t)(((uint32_t)(x)) << WUU_PARAM_PINS_SHIFT)) & WUU_PARAM_PINS_MASK) -/*! @} */ - -/*! @name PE1 - Pin Enable 1 */ -/*! @{ */ - -#define WUU_PE1_WUPE0_MASK (0x3U) -#define WUU_PE1_WUPE0_SHIFT (0U) -/*! WUPE0 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE0(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE0_SHIFT)) & WUU_PE1_WUPE0_MASK) - -#define WUU_PE1_WUPE1_MASK (0xCU) -#define WUU_PE1_WUPE1_SHIFT (2U) -/*! WUPE1 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE1(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE1_SHIFT)) & WUU_PE1_WUPE1_MASK) - -#define WUU_PE1_WUPE2_MASK (0x30U) -#define WUU_PE1_WUPE2_SHIFT (4U) -/*! WUPE2 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE2(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE2_SHIFT)) & WUU_PE1_WUPE2_MASK) - -#define WUU_PE1_WUPE3_MASK (0xC0U) -#define WUU_PE1_WUPE3_SHIFT (6U) -/*! WUPE3 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE3(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE3_SHIFT)) & WUU_PE1_WUPE3_MASK) - -#define WUU_PE1_WUPE4_MASK (0x300U) -#define WUU_PE1_WUPE4_SHIFT (8U) -/*! WUPE4 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE4(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE4_SHIFT)) & WUU_PE1_WUPE4_MASK) - -#define WUU_PE1_WUPE5_MASK (0xC00U) -#define WUU_PE1_WUPE5_SHIFT (10U) -/*! WUPE5 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE5(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE5_SHIFT)) & WUU_PE1_WUPE5_MASK) - -#define WUU_PE1_WUPE6_MASK (0x3000U) -#define WUU_PE1_WUPE6_SHIFT (12U) -/*! WUPE6 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE6(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE6_SHIFT)) & WUU_PE1_WUPE6_MASK) - -#define WUU_PE1_WUPE7_MASK (0xC000U) -#define WUU_PE1_WUPE7_SHIFT (14U) -/*! WUPE7 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE7(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE7_SHIFT)) & WUU_PE1_WUPE7_MASK) - -#define WUU_PE1_WUPE8_MASK (0x30000U) -#define WUU_PE1_WUPE8_SHIFT (16U) -/*! WUPE8 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE8(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE8_SHIFT)) & WUU_PE1_WUPE8_MASK) - -#define WUU_PE1_WUPE9_MASK (0xC0000U) -#define WUU_PE1_WUPE9_SHIFT (18U) -/*! WUPE9 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE9(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE9_SHIFT)) & WUU_PE1_WUPE9_MASK) - -#define WUU_PE1_WUPE10_MASK (0x300000U) -#define WUU_PE1_WUPE10_SHIFT (20U) -/*! WUPE10 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE10(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE10_SHIFT)) & WUU_PE1_WUPE10_MASK) - -#define WUU_PE1_WUPE11_MASK (0xC00000U) -#define WUU_PE1_WUPE11_SHIFT (22U) -/*! WUPE11 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE11(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE11_SHIFT)) & WUU_PE1_WUPE11_MASK) - -#define WUU_PE1_WUPE12_MASK (0x3000000U) -#define WUU_PE1_WUPE12_SHIFT (24U) -/*! WUPE12 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE12(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE12_SHIFT)) & WUU_PE1_WUPE12_MASK) - -#define WUU_PE1_WUPE13_MASK (0xC000000U) -#define WUU_PE1_WUPE13_SHIFT (26U) -/*! WUPE13 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE13(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE13_SHIFT)) & WUU_PE1_WUPE13_MASK) - -#define WUU_PE1_WUPE14_MASK (0x30000000U) -#define WUU_PE1_WUPE14_SHIFT (28U) -/*! WUPE14 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE14(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE14_SHIFT)) & WUU_PE1_WUPE14_MASK) - -#define WUU_PE1_WUPE15_MASK (0xC0000000U) -#define WUU_PE1_WUPE15_SHIFT (30U) -/*! WUPE15 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE15(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE15_SHIFT)) & WUU_PE1_WUPE15_MASK) -/*! @} */ - -/*! @name PE2 - Pin Enable 2 */ -/*! @{ */ - -#define WUU_PE2_WUPE16_MASK (0x3U) -#define WUU_PE2_WUPE16_SHIFT (0U) -/*! WUPE16 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE16(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE16_SHIFT)) & WUU_PE2_WUPE16_MASK) - -#define WUU_PE2_WUPE17_MASK (0xCU) -#define WUU_PE2_WUPE17_SHIFT (2U) -/*! WUPE17 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE17(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE17_SHIFT)) & WUU_PE2_WUPE17_MASK) - -#define WUU_PE2_WUPE18_MASK (0x30U) -#define WUU_PE2_WUPE18_SHIFT (4U) -/*! WUPE18 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE18(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE18_SHIFT)) & WUU_PE2_WUPE18_MASK) - -#define WUU_PE2_WUPE19_MASK (0xC0U) -#define WUU_PE2_WUPE19_SHIFT (6U) -/*! WUPE19 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE19(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE19_SHIFT)) & WUU_PE2_WUPE19_MASK) - -#define WUU_PE2_WUPE20_MASK (0x300U) -#define WUU_PE2_WUPE20_SHIFT (8U) -/*! WUPE20 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE20(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE20_SHIFT)) & WUU_PE2_WUPE20_MASK) - -#define WUU_PE2_WUPE21_MASK (0xC00U) -#define WUU_PE2_WUPE21_SHIFT (10U) -/*! WUPE21 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE21(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE21_SHIFT)) & WUU_PE2_WUPE21_MASK) - -#define WUU_PE2_WUPE22_MASK (0x3000U) -#define WUU_PE2_WUPE22_SHIFT (12U) -/*! WUPE22 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE22(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE22_SHIFT)) & WUU_PE2_WUPE22_MASK) - -#define WUU_PE2_WUPE23_MASK (0xC000U) -#define WUU_PE2_WUPE23_SHIFT (14U) -/*! WUPE23 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE23(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE23_SHIFT)) & WUU_PE2_WUPE23_MASK) - -#define WUU_PE2_WUPE24_MASK (0x30000U) -#define WUU_PE2_WUPE24_SHIFT (16U) -/*! WUPE24 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE24(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE24_SHIFT)) & WUU_PE2_WUPE24_MASK) - -#define WUU_PE2_WUPE25_MASK (0xC0000U) -#define WUU_PE2_WUPE25_SHIFT (18U) -/*! WUPE25 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE25(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE25_SHIFT)) & WUU_PE2_WUPE25_MASK) - -#define WUU_PE2_WUPE26_MASK (0x300000U) -#define WUU_PE2_WUPE26_SHIFT (20U) -/*! WUPE26 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE26(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE26_SHIFT)) & WUU_PE2_WUPE26_MASK) - -#define WUU_PE2_WUPE27_MASK (0xC00000U) -#define WUU_PE2_WUPE27_SHIFT (22U) -/*! WUPE27 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE27(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE27_SHIFT)) & WUU_PE2_WUPE27_MASK) - -#define WUU_PE2_Reserved28_MASK (0x3000000U) -#define WUU_PE2_Reserved28_SHIFT (24U) -/*! Reserved28 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PE2_Reserved28(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_Reserved28_SHIFT)) & WUU_PE2_Reserved28_MASK) - -#define WUU_PE2_Reserved29_MASK (0xC000000U) -#define WUU_PE2_Reserved29_SHIFT (26U) -/*! Reserved29 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PE2_Reserved29(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_Reserved29_SHIFT)) & WUU_PE2_Reserved29_MASK) - -#define WUU_PE2_Reserved30_MASK (0x30000000U) -#define WUU_PE2_Reserved30_SHIFT (28U) -/*! Reserved30 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PE2_Reserved30(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_Reserved30_SHIFT)) & WUU_PE2_Reserved30_MASK) - -#define WUU_PE2_Reserved31_MASK (0xC0000000U) -#define WUU_PE2_Reserved31_SHIFT (30U) -/*! Reserved31 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PE2_Reserved31(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_Reserved31_SHIFT)) & WUU_PE2_Reserved31_MASK) -/*! @} */ - -/*! @name ME - Module Interrupt Enable */ -/*! @{ */ - -#define WUU_ME_WUME0_MASK (0x1U) -#define WUU_ME_WUME0_SHIFT (0U) -/*! WUME0 - Module Interrupt Wake-up Enable for Module 0 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME0(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME0_SHIFT)) & WUU_ME_WUME0_MASK) - -#define WUU_ME_WUME1_MASK (0x2U) -#define WUU_ME_WUME1_SHIFT (1U) -/*! WUME1 - Module Interrupt Wake-up Enable for Module 1 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME1(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME1_SHIFT)) & WUU_ME_WUME1_MASK) - -#define WUU_ME_WUME2_MASK (0x4U) -#define WUU_ME_WUME2_SHIFT (2U) -/*! WUME2 - Module Interrupt Wake-up Enable for Module 2 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME2(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME2_SHIFT)) & WUU_ME_WUME2_MASK) - -#define WUU_ME_WUME3_MASK (0x8U) -#define WUU_ME_WUME3_SHIFT (3U) -/*! WUME3 - Module Interrupt Wake-up Enable for Module 3 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME3(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME3_SHIFT)) & WUU_ME_WUME3_MASK) - -#define WUU_ME_WUME4_MASK (0x10U) -#define WUU_ME_WUME4_SHIFT (4U) -/*! WUME4 - Module Interrupt Wake-up Enable for Module 4 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME4(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME4_SHIFT)) & WUU_ME_WUME4_MASK) - -#define WUU_ME_WUME5_MASK (0x20U) -#define WUU_ME_WUME5_SHIFT (5U) -/*! WUME5 - Module Interrupt Wake-up Enable for Module 5 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME5(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME5_SHIFT)) & WUU_ME_WUME5_MASK) - -#define WUU_ME_WUME6_MASK (0x40U) -#define WUU_ME_WUME6_SHIFT (6U) -/*! WUME6 - Module Interrupt Wake-up Enable for Module 6 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME6(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME6_SHIFT)) & WUU_ME_WUME6_MASK) - -#define WUU_ME_WUME7_MASK (0x80U) -#define WUU_ME_WUME7_SHIFT (7U) -/*! WUME7 - Module Interrupt Wake-up Enable for Module 7 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME7(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME7_SHIFT)) & WUU_ME_WUME7_MASK) - -#define WUU_ME_WUME8_MASK (0x100U) -#define WUU_ME_WUME8_SHIFT (8U) -/*! WUME8 - Module Interrupt Wake-up Enable for Module 8 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME8(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME8_SHIFT)) & WUU_ME_WUME8_MASK) - -#define WUU_ME_WUME9_MASK (0x200U) -#define WUU_ME_WUME9_SHIFT (9U) -/*! WUME9 - Module Interrupt Wake-up Enable for Module 9 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME9(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME9_SHIFT)) & WUU_ME_WUME9_MASK) -/*! @} */ - -/*! @name DE - Module DMA/Trigger Enable */ -/*! @{ */ - -#define WUU_DE_WUDE0_MASK (0x1U) -#define WUU_DE_WUDE0_SHIFT (0U) -/*! WUDE0 - DMA/Trigger Wake-up Enable for Module 0 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE0(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE0_SHIFT)) & WUU_DE_WUDE0_MASK) - -#define WUU_DE_WUDE1_MASK (0x2U) -#define WUU_DE_WUDE1_SHIFT (1U) -/*! WUDE1 - DMA/Trigger Wake-up Enable for Module 1 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE1(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE1_SHIFT)) & WUU_DE_WUDE1_MASK) - -#define WUU_DE_WUDE2_MASK (0x4U) -#define WUU_DE_WUDE2_SHIFT (2U) -/*! WUDE2 - DMA/Trigger Wake-up Enable for Module 2 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE2(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE2_SHIFT)) & WUU_DE_WUDE2_MASK) - -#define WUU_DE_WUDE3_MASK (0x8U) -#define WUU_DE_WUDE3_SHIFT (3U) -/*! WUDE3 - DMA/Trigger Wake-up Enable for Module 3 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE3(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE3_SHIFT)) & WUU_DE_WUDE3_MASK) - -#define WUU_DE_WUDE4_MASK (0x10U) -#define WUU_DE_WUDE4_SHIFT (4U) -/*! WUDE4 - DMA/Trigger Wake-up Enable for Module 4 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE4(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE4_SHIFT)) & WUU_DE_WUDE4_MASK) - -#define WUU_DE_WUDE5_MASK (0x20U) -#define WUU_DE_WUDE5_SHIFT (5U) -/*! WUDE5 - DMA/Trigger Wake-up Enable for Module 5 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE5(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE5_SHIFT)) & WUU_DE_WUDE5_MASK) - -#define WUU_DE_WUDE6_MASK (0x40U) -#define WUU_DE_WUDE6_SHIFT (6U) -/*! WUDE6 - DMA/Trigger Wake-up Enable for Module 6 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE6(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE6_SHIFT)) & WUU_DE_WUDE6_MASK) - -#define WUU_DE_WUDE7_MASK (0x80U) -#define WUU_DE_WUDE7_SHIFT (7U) -/*! WUDE7 - DMA/Trigger Wake-up Enable for Module 7 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE7(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE7_SHIFT)) & WUU_DE_WUDE7_MASK) - -#define WUU_DE_WUDE8_MASK (0x100U) -#define WUU_DE_WUDE8_SHIFT (8U) -/*! WUDE8 - DMA/Trigger Wake-up Enable for Module 8 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE8(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE8_SHIFT)) & WUU_DE_WUDE8_MASK) - -#define WUU_DE_WUDE9_MASK (0x200U) -#define WUU_DE_WUDE9_SHIFT (9U) -/*! WUDE9 - DMA/Trigger Wake-up Enable for Module 9 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE9(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE9_SHIFT)) & WUU_DE_WUDE9_MASK) -/*! @} */ - -/*! @name PF - Pin Flag */ -/*! @{ */ - -#define WUU_PF_WUF0_MASK (0x1U) -#define WUU_PF_WUF0_SHIFT (0U) -/*! WUF0 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF0(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF0_SHIFT)) & WUU_PF_WUF0_MASK) - -#define WUU_PF_WUF1_MASK (0x2U) -#define WUU_PF_WUF1_SHIFT (1U) -/*! WUF1 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF1(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF1_SHIFT)) & WUU_PF_WUF1_MASK) - -#define WUU_PF_WUF2_MASK (0x4U) -#define WUU_PF_WUF2_SHIFT (2U) -/*! WUF2 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF2(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF2_SHIFT)) & WUU_PF_WUF2_MASK) - -#define WUU_PF_WUF3_MASK (0x8U) -#define WUU_PF_WUF3_SHIFT (3U) -/*! WUF3 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF3(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF3_SHIFT)) & WUU_PF_WUF3_MASK) - -#define WUU_PF_WUF4_MASK (0x10U) -#define WUU_PF_WUF4_SHIFT (4U) -/*! WUF4 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF4(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF4_SHIFT)) & WUU_PF_WUF4_MASK) - -#define WUU_PF_WUF5_MASK (0x20U) -#define WUU_PF_WUF5_SHIFT (5U) -/*! WUF5 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF5(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF5_SHIFT)) & WUU_PF_WUF5_MASK) - -#define WUU_PF_WUF6_MASK (0x40U) -#define WUU_PF_WUF6_SHIFT (6U) -/*! WUF6 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF6(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF6_SHIFT)) & WUU_PF_WUF6_MASK) - -#define WUU_PF_WUF7_MASK (0x80U) -#define WUU_PF_WUF7_SHIFT (7U) -/*! WUF7 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF7(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF7_SHIFT)) & WUU_PF_WUF7_MASK) - -#define WUU_PF_WUF8_MASK (0x100U) -#define WUU_PF_WUF8_SHIFT (8U) -/*! WUF8 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF8(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF8_SHIFT)) & WUU_PF_WUF8_MASK) - -#define WUU_PF_WUF9_MASK (0x200U) -#define WUU_PF_WUF9_SHIFT (9U) -/*! WUF9 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF9(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF9_SHIFT)) & WUU_PF_WUF9_MASK) - -#define WUU_PF_WUF10_MASK (0x400U) -#define WUU_PF_WUF10_SHIFT (10U) -/*! WUF10 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF10(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF10_SHIFT)) & WUU_PF_WUF10_MASK) - -#define WUU_PF_WUF11_MASK (0x800U) -#define WUU_PF_WUF11_SHIFT (11U) -/*! WUF11 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF11(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF11_SHIFT)) & WUU_PF_WUF11_MASK) - -#define WUU_PF_WUF12_MASK (0x1000U) -#define WUU_PF_WUF12_SHIFT (12U) -/*! WUF12 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF12(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF12_SHIFT)) & WUU_PF_WUF12_MASK) - -#define WUU_PF_WUF13_MASK (0x2000U) -#define WUU_PF_WUF13_SHIFT (13U) -/*! WUF13 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF13(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF13_SHIFT)) & WUU_PF_WUF13_MASK) - -#define WUU_PF_WUF14_MASK (0x4000U) -#define WUU_PF_WUF14_SHIFT (14U) -/*! WUF14 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF14(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF14_SHIFT)) & WUU_PF_WUF14_MASK) - -#define WUU_PF_WUF15_MASK (0x8000U) -#define WUU_PF_WUF15_SHIFT (15U) -/*! WUF15 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF15(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF15_SHIFT)) & WUU_PF_WUF15_MASK) - -#define WUU_PF_WUF16_MASK (0x10000U) -#define WUU_PF_WUF16_SHIFT (16U) -/*! WUF16 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF16(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF16_SHIFT)) & WUU_PF_WUF16_MASK) - -#define WUU_PF_WUF17_MASK (0x20000U) -#define WUU_PF_WUF17_SHIFT (17U) -/*! WUF17 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF17(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF17_SHIFT)) & WUU_PF_WUF17_MASK) - -#define WUU_PF_WUF18_MASK (0x40000U) -#define WUU_PF_WUF18_SHIFT (18U) -/*! WUF18 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF18(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF18_SHIFT)) & WUU_PF_WUF18_MASK) - -#define WUU_PF_WUF19_MASK (0x80000U) -#define WUU_PF_WUF19_SHIFT (19U) -/*! WUF19 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF19(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF19_SHIFT)) & WUU_PF_WUF19_MASK) - -#define WUU_PF_WUF20_MASK (0x100000U) -#define WUU_PF_WUF20_SHIFT (20U) -/*! WUF20 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF20(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF20_SHIFT)) & WUU_PF_WUF20_MASK) - -#define WUU_PF_WUF21_MASK (0x200000U) -#define WUU_PF_WUF21_SHIFT (21U) -/*! WUF21 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF21(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF21_SHIFT)) & WUU_PF_WUF21_MASK) - -#define WUU_PF_WUF22_MASK (0x400000U) -#define WUU_PF_WUF22_SHIFT (22U) -/*! WUF22 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF22(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF22_SHIFT)) & WUU_PF_WUF22_MASK) - -#define WUU_PF_WUF23_MASK (0x800000U) -#define WUU_PF_WUF23_SHIFT (23U) -/*! WUF23 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF23(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF23_SHIFT)) & WUU_PF_WUF23_MASK) - -#define WUU_PF_WUF24_MASK (0x1000000U) -#define WUU_PF_WUF24_SHIFT (24U) -/*! WUF24 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF24(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF24_SHIFT)) & WUU_PF_WUF24_MASK) - -#define WUU_PF_WUF25_MASK (0x2000000U) -#define WUU_PF_WUF25_SHIFT (25U) -/*! WUF25 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF25(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF25_SHIFT)) & WUU_PF_WUF25_MASK) - -#define WUU_PF_WUF26_MASK (0x4000000U) -#define WUU_PF_WUF26_SHIFT (26U) -/*! WUF26 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF26(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF26_SHIFT)) & WUU_PF_WUF26_MASK) - -#define WUU_PF_WUF27_MASK (0x8000000U) -#define WUU_PF_WUF27_SHIFT (27U) -/*! WUF27 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF27(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF27_SHIFT)) & WUU_PF_WUF27_MASK) - -#define WUU_PF_Reserved28_MASK (0x10000000U) -#define WUU_PF_Reserved28_SHIFT (28U) -/*! Reserved28 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PF_Reserved28(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_Reserved28_SHIFT)) & WUU_PF_Reserved28_MASK) - -#define WUU_PF_Reserved29_MASK (0x20000000U) -#define WUU_PF_Reserved29_SHIFT (29U) -/*! Reserved29 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PF_Reserved29(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_Reserved29_SHIFT)) & WUU_PF_Reserved29_MASK) - -#define WUU_PF_Reserved30_MASK (0x40000000U) -#define WUU_PF_Reserved30_SHIFT (30U) -/*! Reserved30 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PF_Reserved30(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_Reserved30_SHIFT)) & WUU_PF_Reserved30_MASK) - -#define WUU_PF_Reserved31_MASK (0x80000000U) -#define WUU_PF_Reserved31_SHIFT (31U) -/*! Reserved31 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PF_Reserved31(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_Reserved31_SHIFT)) & WUU_PF_Reserved31_MASK) -/*! @} */ - -/*! @name FILT - Pin Filter */ -/*! @{ */ - -#define WUU_FILT_FILTSEL1_MASK (0x1FU) -#define WUU_FILT_FILTSEL1_SHIFT (0U) -/*! FILTSEL1 - Filter 1 Pin Select */ -#define WUU_FILT_FILTSEL1(x) (((uint32_t)(((uint32_t)(x)) << WUU_FILT_FILTSEL1_SHIFT)) & WUU_FILT_FILTSEL1_MASK) - -#define WUU_FILT_FILTE1_MASK (0x60U) -#define WUU_FILT_FILTE1_SHIFT (5U) -/*! FILTE1 - Filter 1 Enable - * 0b00..Disable - * 0b01..Enable (Detect on rising edge or high level) - * 0b10..Enable (Detect on falling edge or low level) - * 0b11..Enable (Detect on any edge) - */ -#define WUU_FILT_FILTE1(x) (((uint32_t)(((uint32_t)(x)) << WUU_FILT_FILTE1_SHIFT)) & WUU_FILT_FILTE1_MASK) - -#define WUU_FILT_FILTF1_MASK (0x80U) -#define WUU_FILT_FILTF1_SHIFT (7U) -/*! FILTF1 - Filter 1 Flag - * 0b0..No - * 0b1..Yes - */ -#define WUU_FILT_FILTF1(x) (((uint32_t)(((uint32_t)(x)) << WUU_FILT_FILTF1_SHIFT)) & WUU_FILT_FILTF1_MASK) - -#define WUU_FILT_FILTSEL2_MASK (0x1F00U) -#define WUU_FILT_FILTSEL2_SHIFT (8U) -/*! FILTSEL2 - Filter 2 Pin Select */ -#define WUU_FILT_FILTSEL2(x) (((uint32_t)(((uint32_t)(x)) << WUU_FILT_FILTSEL2_SHIFT)) & WUU_FILT_FILTSEL2_MASK) - -#define WUU_FILT_FILTE2_MASK (0x6000U) -#define WUU_FILT_FILTE2_SHIFT (13U) -/*! FILTE2 - Filter 2 Enable - * 0b00..Disable - * 0b01..Enable (Detect on rising edge or high level) - * 0b10..Enable (Detect on falling edge or low level) - * 0b11..Enable (Detect on any edge) - */ -#define WUU_FILT_FILTE2(x) (((uint32_t)(((uint32_t)(x)) << WUU_FILT_FILTE2_SHIFT)) & WUU_FILT_FILTE2_MASK) - -#define WUU_FILT_FILTF2_MASK (0x8000U) -#define WUU_FILT_FILTF2_SHIFT (15U) -/*! FILTF2 - Filter 2 Flag - * 0b0..No - * 0b1..Yes - */ -#define WUU_FILT_FILTF2(x) (((uint32_t)(((uint32_t)(x)) << WUU_FILT_FILTF2_SHIFT)) & WUU_FILT_FILTF2_MASK) -/*! @} */ - -/*! @name PDC1 - Pin DMA/Trigger Configuration 1 */ -/*! @{ */ - -#define WUU_PDC1_WUPDC0_MASK (0x3U) -#define WUU_PDC1_WUPDC0_SHIFT (0U) -/*! WUPDC0 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC0(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC0_SHIFT)) & WUU_PDC1_WUPDC0_MASK) - -#define WUU_PDC1_WUPDC1_MASK (0xCU) -#define WUU_PDC1_WUPDC1_SHIFT (2U) -/*! WUPDC1 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC1(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC1_SHIFT)) & WUU_PDC1_WUPDC1_MASK) - -#define WUU_PDC1_WUPDC2_MASK (0x30U) -#define WUU_PDC1_WUPDC2_SHIFT (4U) -/*! WUPDC2 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC2(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC2_SHIFT)) & WUU_PDC1_WUPDC2_MASK) - -#define WUU_PDC1_WUPDC3_MASK (0xC0U) -#define WUU_PDC1_WUPDC3_SHIFT (6U) -/*! WUPDC3 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC3(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC3_SHIFT)) & WUU_PDC1_WUPDC3_MASK) - -#define WUU_PDC1_WUPDC4_MASK (0x300U) -#define WUU_PDC1_WUPDC4_SHIFT (8U) -/*! WUPDC4 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC4(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC4_SHIFT)) & WUU_PDC1_WUPDC4_MASK) - -#define WUU_PDC1_WUPDC5_MASK (0xC00U) -#define WUU_PDC1_WUPDC5_SHIFT (10U) -/*! WUPDC5 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC5(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC5_SHIFT)) & WUU_PDC1_WUPDC5_MASK) - -#define WUU_PDC1_WUPDC6_MASK (0x3000U) -#define WUU_PDC1_WUPDC6_SHIFT (12U) -/*! WUPDC6 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC6(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC6_SHIFT)) & WUU_PDC1_WUPDC6_MASK) - -#define WUU_PDC1_WUPDC7_MASK (0xC000U) -#define WUU_PDC1_WUPDC7_SHIFT (14U) -/*! WUPDC7 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC7(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC7_SHIFT)) & WUU_PDC1_WUPDC7_MASK) - -#define WUU_PDC1_WUPDC8_MASK (0x30000U) -#define WUU_PDC1_WUPDC8_SHIFT (16U) -/*! WUPDC8 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC8(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC8_SHIFT)) & WUU_PDC1_WUPDC8_MASK) - -#define WUU_PDC1_WUPDC9_MASK (0xC0000U) -#define WUU_PDC1_WUPDC9_SHIFT (18U) -/*! WUPDC9 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC9(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC9_SHIFT)) & WUU_PDC1_WUPDC9_MASK) - -#define WUU_PDC1_WUPDC10_MASK (0x300000U) -#define WUU_PDC1_WUPDC10_SHIFT (20U) -/*! WUPDC10 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC10(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC10_SHIFT)) & WUU_PDC1_WUPDC10_MASK) - -#define WUU_PDC1_WUPDC11_MASK (0xC00000U) -#define WUU_PDC1_WUPDC11_SHIFT (22U) -/*! WUPDC11 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC11(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC11_SHIFT)) & WUU_PDC1_WUPDC11_MASK) - -#define WUU_PDC1_WUPDC12_MASK (0x3000000U) -#define WUU_PDC1_WUPDC12_SHIFT (24U) -/*! WUPDC12 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC12(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC12_SHIFT)) & WUU_PDC1_WUPDC12_MASK) - -#define WUU_PDC1_WUPDC13_MASK (0xC000000U) -#define WUU_PDC1_WUPDC13_SHIFT (26U) -/*! WUPDC13 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC13(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC13_SHIFT)) & WUU_PDC1_WUPDC13_MASK) - -#define WUU_PDC1_WUPDC14_MASK (0x30000000U) -#define WUU_PDC1_WUPDC14_SHIFT (28U) -/*! WUPDC14 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC14(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC14_SHIFT)) & WUU_PDC1_WUPDC14_MASK) - -#define WUU_PDC1_WUPDC15_MASK (0xC0000000U) -#define WUU_PDC1_WUPDC15_SHIFT (30U) -/*! WUPDC15 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC15(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC15_SHIFT)) & WUU_PDC1_WUPDC15_MASK) -/*! @} */ - -/*! @name PDC2 - Pin DMA/Trigger Configuration 2 */ -/*! @{ */ - -#define WUU_PDC2_WUPDC16_MASK (0x3U) -#define WUU_PDC2_WUPDC16_SHIFT (0U) -/*! WUPDC16 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC16(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC16_SHIFT)) & WUU_PDC2_WUPDC16_MASK) - -#define WUU_PDC2_WUPDC17_MASK (0xCU) -#define WUU_PDC2_WUPDC17_SHIFT (2U) -/*! WUPDC17 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC17(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC17_SHIFT)) & WUU_PDC2_WUPDC17_MASK) - -#define WUU_PDC2_WUPDC18_MASK (0x30U) -#define WUU_PDC2_WUPDC18_SHIFT (4U) -/*! WUPDC18 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC18(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC18_SHIFT)) & WUU_PDC2_WUPDC18_MASK) - -#define WUU_PDC2_WUPDC19_MASK (0xC0U) -#define WUU_PDC2_WUPDC19_SHIFT (6U) -/*! WUPDC19 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC19(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC19_SHIFT)) & WUU_PDC2_WUPDC19_MASK) - -#define WUU_PDC2_WUPDC20_MASK (0x300U) -#define WUU_PDC2_WUPDC20_SHIFT (8U) -/*! WUPDC20 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC20(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC20_SHIFT)) & WUU_PDC2_WUPDC20_MASK) - -#define WUU_PDC2_WUPDC21_MASK (0xC00U) -#define WUU_PDC2_WUPDC21_SHIFT (10U) -/*! WUPDC21 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC21(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC21_SHIFT)) & WUU_PDC2_WUPDC21_MASK) - -#define WUU_PDC2_WUPDC22_MASK (0x3000U) -#define WUU_PDC2_WUPDC22_SHIFT (12U) -/*! WUPDC22 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC22(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC22_SHIFT)) & WUU_PDC2_WUPDC22_MASK) - -#define WUU_PDC2_WUPDC23_MASK (0xC000U) -#define WUU_PDC2_WUPDC23_SHIFT (14U) -/*! WUPDC23 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC23(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC23_SHIFT)) & WUU_PDC2_WUPDC23_MASK) - -#define WUU_PDC2_WUPDC24_MASK (0x30000U) -#define WUU_PDC2_WUPDC24_SHIFT (16U) -/*! WUPDC24 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC24(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC24_SHIFT)) & WUU_PDC2_WUPDC24_MASK) - -#define WUU_PDC2_WUPDC25_MASK (0xC0000U) -#define WUU_PDC2_WUPDC25_SHIFT (18U) -/*! WUPDC25 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC25(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC25_SHIFT)) & WUU_PDC2_WUPDC25_MASK) - -#define WUU_PDC2_WUPDC26_MASK (0x300000U) -#define WUU_PDC2_WUPDC26_SHIFT (20U) -/*! WUPDC26 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC26(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC26_SHIFT)) & WUU_PDC2_WUPDC26_MASK) - -#define WUU_PDC2_WUPDC27_MASK (0xC00000U) -#define WUU_PDC2_WUPDC27_SHIFT (22U) -/*! WUPDC27 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC27(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC27_SHIFT)) & WUU_PDC2_WUPDC27_MASK) - -#define WUU_PDC2_Reserved28_MASK (0x3000000U) -#define WUU_PDC2_Reserved28_SHIFT (24U) -/*! Reserved28 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PDC2_Reserved28(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_Reserved28_SHIFT)) & WUU_PDC2_Reserved28_MASK) - -#define WUU_PDC2_Reserved29_MASK (0xC000000U) -#define WUU_PDC2_Reserved29_SHIFT (26U) -/*! Reserved29 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PDC2_Reserved29(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_Reserved29_SHIFT)) & WUU_PDC2_Reserved29_MASK) - -#define WUU_PDC2_Reserved30_MASK (0x30000000U) -#define WUU_PDC2_Reserved30_SHIFT (28U) -/*! Reserved30 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PDC2_Reserved30(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_Reserved30_SHIFT)) & WUU_PDC2_Reserved30_MASK) - -#define WUU_PDC2_Reserved31_MASK (0xC0000000U) -#define WUU_PDC2_Reserved31_SHIFT (30U) -/*! Reserved31 - Reserved - * 0b00..Not supported - * 0b01..Not supported - * 0b10..Not supported - * 0b11..Not supported - */ -#define WUU_PDC2_Reserved31(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_Reserved31_SHIFT)) & WUU_PDC2_Reserved31_MASK) -/*! @} */ - -/*! @name FDC - Pin Filter DMA/Trigger Configuration */ -/*! @{ */ - -#define WUU_FDC_FILTC1_MASK (0x3U) -#define WUU_FDC_FILTC1_SHIFT (0U) -/*! FILTC1 - Filter Configuration for FILTn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_FDC_FILTC1(x) (((uint32_t)(((uint32_t)(x)) << WUU_FDC_FILTC1_SHIFT)) & WUU_FDC_FILTC1_MASK) - -#define WUU_FDC_FILTC2_MASK (0xCU) -#define WUU_FDC_FILTC2_SHIFT (2U) -/*! FILTC2 - Filter Configuration for FILTn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_FDC_FILTC2(x) (((uint32_t)(((uint32_t)(x)) << WUU_FDC_FILTC2_SHIFT)) & WUU_FDC_FILTC2_MASK) -/*! @} */ - -/*! @name PMC - Pin Mode Configuration */ -/*! @{ */ - -#define WUU_PMC_WUPMC0_MASK (0x1U) -#define WUU_PMC_WUPMC0_SHIFT (0U) -/*! WUPMC0 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC0(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC0_SHIFT)) & WUU_PMC_WUPMC0_MASK) - -#define WUU_PMC_WUPMC1_MASK (0x2U) -#define WUU_PMC_WUPMC1_SHIFT (1U) -/*! WUPMC1 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC1(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC1_SHIFT)) & WUU_PMC_WUPMC1_MASK) - -#define WUU_PMC_WUPMC2_MASK (0x4U) -#define WUU_PMC_WUPMC2_SHIFT (2U) -/*! WUPMC2 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC2(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC2_SHIFT)) & WUU_PMC_WUPMC2_MASK) - -#define WUU_PMC_WUPMC3_MASK (0x8U) -#define WUU_PMC_WUPMC3_SHIFT (3U) -/*! WUPMC3 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC3(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC3_SHIFT)) & WUU_PMC_WUPMC3_MASK) - -#define WUU_PMC_WUPMC4_MASK (0x10U) -#define WUU_PMC_WUPMC4_SHIFT (4U) -/*! WUPMC4 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC4(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC4_SHIFT)) & WUU_PMC_WUPMC4_MASK) - -#define WUU_PMC_WUPMC5_MASK (0x20U) -#define WUU_PMC_WUPMC5_SHIFT (5U) -/*! WUPMC5 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC5(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC5_SHIFT)) & WUU_PMC_WUPMC5_MASK) - -#define WUU_PMC_WUPMC6_MASK (0x40U) -#define WUU_PMC_WUPMC6_SHIFT (6U) -/*! WUPMC6 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC6(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC6_SHIFT)) & WUU_PMC_WUPMC6_MASK) - -#define WUU_PMC_WUPMC7_MASK (0x80U) -#define WUU_PMC_WUPMC7_SHIFT (7U) -/*! WUPMC7 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC7(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC7_SHIFT)) & WUU_PMC_WUPMC7_MASK) - -#define WUU_PMC_WUPMC8_MASK (0x100U) -#define WUU_PMC_WUPMC8_SHIFT (8U) -/*! WUPMC8 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC8(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC8_SHIFT)) & WUU_PMC_WUPMC8_MASK) - -#define WUU_PMC_WUPMC9_MASK (0x200U) -#define WUU_PMC_WUPMC9_SHIFT (9U) -/*! WUPMC9 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC9(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC9_SHIFT)) & WUU_PMC_WUPMC9_MASK) - -#define WUU_PMC_WUPMC10_MASK (0x400U) -#define WUU_PMC_WUPMC10_SHIFT (10U) -/*! WUPMC10 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC10(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC10_SHIFT)) & WUU_PMC_WUPMC10_MASK) - -#define WUU_PMC_WUPMC11_MASK (0x800U) -#define WUU_PMC_WUPMC11_SHIFT (11U) -/*! WUPMC11 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC11(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC11_SHIFT)) & WUU_PMC_WUPMC11_MASK) - -#define WUU_PMC_WUPMC12_MASK (0x1000U) -#define WUU_PMC_WUPMC12_SHIFT (12U) -/*! WUPMC12 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC12(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC12_SHIFT)) & WUU_PMC_WUPMC12_MASK) - -#define WUU_PMC_WUPMC13_MASK (0x2000U) -#define WUU_PMC_WUPMC13_SHIFT (13U) -/*! WUPMC13 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC13(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC13_SHIFT)) & WUU_PMC_WUPMC13_MASK) - -#define WUU_PMC_WUPMC14_MASK (0x4000U) -#define WUU_PMC_WUPMC14_SHIFT (14U) -/*! WUPMC14 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC14(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC14_SHIFT)) & WUU_PMC_WUPMC14_MASK) - -#define WUU_PMC_WUPMC15_MASK (0x8000U) -#define WUU_PMC_WUPMC15_SHIFT (15U) -/*! WUPMC15 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC15(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC15_SHIFT)) & WUU_PMC_WUPMC15_MASK) - -#define WUU_PMC_WUPMC16_MASK (0x10000U) -#define WUU_PMC_WUPMC16_SHIFT (16U) -/*! WUPMC16 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC16(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC16_SHIFT)) & WUU_PMC_WUPMC16_MASK) - -#define WUU_PMC_WUPMC17_MASK (0x20000U) -#define WUU_PMC_WUPMC17_SHIFT (17U) -/*! WUPMC17 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC17(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC17_SHIFT)) & WUU_PMC_WUPMC17_MASK) - -#define WUU_PMC_WUPMC18_MASK (0x40000U) -#define WUU_PMC_WUPMC18_SHIFT (18U) -/*! WUPMC18 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC18(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC18_SHIFT)) & WUU_PMC_WUPMC18_MASK) - -#define WUU_PMC_WUPMC19_MASK (0x80000U) -#define WUU_PMC_WUPMC19_SHIFT (19U) -/*! WUPMC19 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC19(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC19_SHIFT)) & WUU_PMC_WUPMC19_MASK) - -#define WUU_PMC_WUPMC20_MASK (0x100000U) -#define WUU_PMC_WUPMC20_SHIFT (20U) -/*! WUPMC20 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC20(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC20_SHIFT)) & WUU_PMC_WUPMC20_MASK) - -#define WUU_PMC_WUPMC21_MASK (0x200000U) -#define WUU_PMC_WUPMC21_SHIFT (21U) -/*! WUPMC21 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC21(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC21_SHIFT)) & WUU_PMC_WUPMC21_MASK) - -#define WUU_PMC_WUPMC22_MASK (0x400000U) -#define WUU_PMC_WUPMC22_SHIFT (22U) -/*! WUPMC22 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC22(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC22_SHIFT)) & WUU_PMC_WUPMC22_MASK) - -#define WUU_PMC_WUPMC23_MASK (0x800000U) -#define WUU_PMC_WUPMC23_SHIFT (23U) -/*! WUPMC23 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC23(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC23_SHIFT)) & WUU_PMC_WUPMC23_MASK) - -#define WUU_PMC_WUPMC24_MASK (0x1000000U) -#define WUU_PMC_WUPMC24_SHIFT (24U) -/*! WUPMC24 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC24(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC24_SHIFT)) & WUU_PMC_WUPMC24_MASK) - -#define WUU_PMC_WUPMC25_MASK (0x2000000U) -#define WUU_PMC_WUPMC25_SHIFT (25U) -/*! WUPMC25 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC25(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC25_SHIFT)) & WUU_PMC_WUPMC25_MASK) - -#define WUU_PMC_WUPMC26_MASK (0x4000000U) -#define WUU_PMC_WUPMC26_SHIFT (26U) -/*! WUPMC26 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC26(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC26_SHIFT)) & WUU_PMC_WUPMC26_MASK) - -#define WUU_PMC_WUPMC27_MASK (0x8000000U) -#define WUU_PMC_WUPMC27_SHIFT (27U) -/*! WUPMC27 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC27(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC27_SHIFT)) & WUU_PMC_WUPMC27_MASK) - -#define WUU_PMC_Reserved28_MASK (0x10000000U) -#define WUU_PMC_Reserved28_SHIFT (28U) -/*! Reserved28 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PMC_Reserved28(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_Reserved28_SHIFT)) & WUU_PMC_Reserved28_MASK) - -#define WUU_PMC_Reserved29_MASK (0x20000000U) -#define WUU_PMC_Reserved29_SHIFT (29U) -/*! Reserved29 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PMC_Reserved29(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_Reserved29_SHIFT)) & WUU_PMC_Reserved29_MASK) - -#define WUU_PMC_Reserved30_MASK (0x40000000U) -#define WUU_PMC_Reserved30_SHIFT (30U) -/*! Reserved30 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PMC_Reserved30(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_Reserved30_SHIFT)) & WUU_PMC_Reserved30_MASK) - -#define WUU_PMC_Reserved31_MASK (0x80000000U) -#define WUU_PMC_Reserved31_SHIFT (31U) -/*! Reserved31 - Reserved - * 0b0..Not supported - * 0b1..Not supported - */ -#define WUU_PMC_Reserved31(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_Reserved31_SHIFT)) & WUU_PMC_Reserved31_MASK) -/*! @} */ - -/*! @name FMC - Pin Filter Mode Configuration */ -/*! @{ */ - -#define WUU_FMC_FILTM1_MASK (0x1U) -#define WUU_FMC_FILTM1_SHIFT (0U) -/*! FILTM1 - Filter Mode for FILTn - * 0b0..Active only during Power Down/Deep Power Down mode - * 0b1..Active during all power modes - */ -#define WUU_FMC_FILTM1(x) (((uint32_t)(((uint32_t)(x)) << WUU_FMC_FILTM1_SHIFT)) & WUU_FMC_FILTM1_MASK) - -#define WUU_FMC_FILTM2_MASK (0x2U) -#define WUU_FMC_FILTM2_SHIFT (1U) -/*! FILTM2 - Filter Mode for FILTn - * 0b0..Active only during Power Down/Deep Power Down mode - * 0b1..Active during all power modes - */ -#define WUU_FMC_FILTM2(x) (((uint32_t)(((uint32_t)(x)) << WUU_FMC_FILTM2_SHIFT)) & WUU_FMC_FILTM2_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group WUU_Register_Masks */ - - -/* WUU - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral WUU0 base address */ - #define WUU0_BASE (0x50046000u) - /** Peripheral WUU0 base address */ - #define WUU0_BASE_NS (0x40046000u) - /** Peripheral WUU0 base pointer */ - #define WUU0 ((WUU_Type *)WUU0_BASE) - /** Peripheral WUU0 base pointer */ - #define WUU0_NS ((WUU_Type *)WUU0_BASE_NS) - /** Array initializer of WUU peripheral base addresses */ - #define WUU_BASE_ADDRS { WUU0_BASE } - /** Array initializer of WUU peripheral base pointers */ - #define WUU_BASE_PTRS { WUU0 } - /** Array initializer of WUU peripheral base addresses */ - #define WUU_BASE_ADDRS_NS { WUU0_BASE_NS } - /** Array initializer of WUU peripheral base pointers */ - #define WUU_BASE_PTRS_NS { WUU0_NS } -#else - /** Peripheral WUU0 base address */ - #define WUU0_BASE (0x40046000u) - /** Peripheral WUU0 base pointer */ - #define WUU0 ((WUU_Type *)WUU0_BASE) - /** Array initializer of WUU peripheral base addresses */ - #define WUU_BASE_ADDRS { WUU0_BASE } - /** Array initializer of WUU peripheral base pointers */ - #define WUU_BASE_PTRS { WUU0 } -#endif - -/*! - * @} - */ /* end of group WUU_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- WWDT Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup WWDT_Peripheral_Access_Layer WWDT Peripheral Access Layer - * @{ - */ - -/** WWDT - Register Layout Typedef */ -typedef struct { - __IO uint32_t MOD; /**< Mode, offset: 0x0 */ - __IO uint32_t TC; /**< Timer Constant, offset: 0x4 */ - __O uint32_t FEED; /**< Feed Sequence, offset: 0x8 */ - __I uint32_t TV; /**< Timer Value, offset: 0xC */ - uint8_t RESERVED_0[4]; - __IO uint32_t WARNINT; /**< Warning Interrupt Compare Value, offset: 0x14 */ - __IO uint32_t WINDOW; /**< Window Compare Value, offset: 0x18 */ -} WWDT_Type; - -/* ---------------------------------------------------------------------------- - -- WWDT Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup WWDT_Register_Masks WWDT Register Masks - * @{ - */ - -/*! @name MOD - Mode */ -/*! @{ */ - -#define WWDT_MOD_WDEN_MASK (0x1U) -#define WWDT_MOD_WDEN_SHIFT (0U) -/*! WDEN - Watchdog Enable - * 0b0..Timer stopped - * 0b1..Timer running - */ -#define WWDT_MOD_WDEN(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_WDEN_SHIFT)) & WWDT_MOD_WDEN_MASK) - -#define WWDT_MOD_WDRESET_MASK (0x2U) -#define WWDT_MOD_WDRESET_SHIFT (1U) -/*! WDRESET - Watchdog Reset Enable - * 0b0..Interrupt - * 0b1..Reset - */ -#define WWDT_MOD_WDRESET(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_WDRESET_SHIFT)) & WWDT_MOD_WDRESET_MASK) - -#define WWDT_MOD_WDTOF_MASK (0x4U) -#define WWDT_MOD_WDTOF_SHIFT (2U) -/*! WDTOF - Watchdog Timeout Flag - * 0b0..Watchdog event has not occurred. - * 0b1..Watchdog event has occurred (causes a chip reset if WDRESET = 1). - */ -#define WWDT_MOD_WDTOF(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_WDTOF_SHIFT)) & WWDT_MOD_WDTOF_MASK) - -#define WWDT_MOD_WDINT_MASK (0x8U) -#define WWDT_MOD_WDINT_SHIFT (3U) -/*! WDINT - Warning Interrupt Flag - * 0b0..No flag - * 0b1..Flag - */ -#define WWDT_MOD_WDINT(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_WDINT_SHIFT)) & WWDT_MOD_WDINT_MASK) - -#define WWDT_MOD_WDPROTECT_MASK (0x10U) -#define WWDT_MOD_WDPROTECT_SHIFT (4U) -/*! WDPROTECT - Watchdog Update Mode - * 0b0..Flexible - * 0b1..Threshold - */ -#define WWDT_MOD_WDPROTECT(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_WDPROTECT_SHIFT)) & WWDT_MOD_WDPROTECT_MASK) - -#define WWDT_MOD_LOCK_MASK (0x20U) -#define WWDT_MOD_LOCK_SHIFT (5U) -/*! LOCK - Lock - * 0b0..No Lock - * 0b1..Lock - */ -#define WWDT_MOD_LOCK(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_LOCK_SHIFT)) & WWDT_MOD_LOCK_MASK) - -#define WWDT_MOD_DEBUG_EN_MASK (0x40U) -#define WWDT_MOD_DEBUG_EN_SHIFT (6U) -/*! DEBUG_EN - Debug Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define WWDT_MOD_DEBUG_EN(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_DEBUG_EN_SHIFT)) & WWDT_MOD_DEBUG_EN_MASK) -/*! @} */ - -/*! @name TC - Timer Constant */ -/*! @{ */ - -#define WWDT_TC_COUNT_MASK (0xFFFFFFU) -#define WWDT_TC_COUNT_SHIFT (0U) -/*! COUNT - Watchdog Timeout Value */ -#define WWDT_TC_COUNT(x) (((uint32_t)(((uint32_t)(x)) << WWDT_TC_COUNT_SHIFT)) & WWDT_TC_COUNT_MASK) -/*! @} */ - -/*! @name FEED - Feed Sequence */ -/*! @{ */ - -#define WWDT_FEED_FEED_MASK (0xFFU) -#define WWDT_FEED_FEED_SHIFT (0U) -/*! FEED - Feed Value */ -#define WWDT_FEED_FEED(x) (((uint32_t)(((uint32_t)(x)) << WWDT_FEED_FEED_SHIFT)) & WWDT_FEED_FEED_MASK) -/*! @} */ - -/*! @name TV - Timer Value */ -/*! @{ */ - -#define WWDT_TV_COUNT_MASK (0xFFFFFFU) -#define WWDT_TV_COUNT_SHIFT (0U) -/*! COUNT - Counter Timer Value */ -#define WWDT_TV_COUNT(x) (((uint32_t)(((uint32_t)(x)) << WWDT_TV_COUNT_SHIFT)) & WWDT_TV_COUNT_MASK) -/*! @} */ - -/*! @name WARNINT - Warning Interrupt Compare Value */ -/*! @{ */ - -#define WWDT_WARNINT_WARNINT_MASK (0x3FFU) -#define WWDT_WARNINT_WARNINT_SHIFT (0U) -/*! WARNINT - Watchdog Warning Interrupt Compare Value */ -#define WWDT_WARNINT_WARNINT(x) (((uint32_t)(((uint32_t)(x)) << WWDT_WARNINT_WARNINT_SHIFT)) & WWDT_WARNINT_WARNINT_MASK) -/*! @} */ - -/*! @name WINDOW - Window Compare Value */ -/*! @{ */ - -#define WWDT_WINDOW_WINDOW_MASK (0xFFFFFFU) -#define WWDT_WINDOW_WINDOW_SHIFT (0U) -/*! WINDOW - Watchdog Window Value */ -#define WWDT_WINDOW_WINDOW(x) (((uint32_t)(((uint32_t)(x)) << WWDT_WINDOW_WINDOW_SHIFT)) & WWDT_WINDOW_WINDOW_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group WWDT_Register_Masks */ - - -/* WWDT - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral WWDT0 base address */ - #define WWDT0_BASE (0x50016000u) - /** Peripheral WWDT0 base address */ - #define WWDT0_BASE_NS (0x40016000u) - /** Peripheral WWDT0 base pointer */ - #define WWDT0 ((WWDT_Type *)WWDT0_BASE) - /** Peripheral WWDT0 base pointer */ - #define WWDT0_NS ((WWDT_Type *)WWDT0_BASE_NS) - /** Peripheral WWDT1 base address */ - #define WWDT1_BASE (0x50017000u) - /** Peripheral WWDT1 base address */ - #define WWDT1_BASE_NS (0x40017000u) - /** Peripheral WWDT1 base pointer */ - #define WWDT1 ((WWDT_Type *)WWDT1_BASE) - /** Peripheral WWDT1 base pointer */ - #define WWDT1_NS ((WWDT_Type *)WWDT1_BASE_NS) - /** Array initializer of WWDT peripheral base addresses */ - #define WWDT_BASE_ADDRS { WWDT0_BASE, WWDT1_BASE } - /** Array initializer of WWDT peripheral base pointers */ - #define WWDT_BASE_PTRS { WWDT0, WWDT1 } - /** Array initializer of WWDT peripheral base addresses */ - #define WWDT_BASE_ADDRS_NS { WWDT0_BASE_NS, WWDT1_BASE_NS } - /** Array initializer of WWDT peripheral base pointers */ - #define WWDT_BASE_PTRS_NS { WWDT0_NS, WWDT1_NS } -#else - /** Peripheral WWDT0 base address */ - #define WWDT0_BASE (0x40016000u) - /** Peripheral WWDT0 base pointer */ - #define WWDT0 ((WWDT_Type *)WWDT0_BASE) - /** Peripheral WWDT1 base address */ - #define WWDT1_BASE (0x40017000u) - /** Peripheral WWDT1 base pointer */ - #define WWDT1 ((WWDT_Type *)WWDT1_BASE) - /** Array initializer of WWDT peripheral base addresses */ - #define WWDT_BASE_ADDRS { WWDT0_BASE, WWDT1_BASE } - /** Array initializer of WWDT peripheral base pointers */ - #define WWDT_BASE_PTRS { WWDT0, WWDT1 } -#endif -/** Interrupt vectors for the WWDT peripheral type */ -#define WWDT_IRQS { WWDT0_IRQn, WWDT1_IRQn } - -/*! - * @} - */ /* end of group WWDT_Peripheral_Access_Layer */ - - -/* -** End of section using anonymous unions -*/ - -#if defined(__ARMCC_VERSION) - #if (__ARMCC_VERSION >= 6010050) - #pragma clang diagnostic pop - #else - #pragma pop - #endif -#elif defined(__GNUC__) - /* leave anonymous unions enabled */ -#elif defined(__IAR_SYSTEMS_ICC__) - #pragma language=default -#else - #error Not supported compiler type -#endif - -/*! - * @} - */ /* end of group Peripheral_access_layer */ - - -/* ---------------------------------------------------------------------------- - -- Macros for use with bit field definitions (xxx_SHIFT, xxx_MASK). - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup Bit_Field_Generic_Macros Macros for use with bit field definitions (xxx_SHIFT, xxx_MASK). - * @{ - */ - -#if defined(__ARMCC_VERSION) - #if (__ARMCC_VERSION >= 6010050) - #pragma clang system_header - #endif -#elif defined(__IAR_SYSTEMS_ICC__) - #pragma system_include -#endif - -/** - * @brief Mask and left-shift a bit field value for use in a register bit range. - * @param field Name of the register bit field. - * @param value Value of the bit field. - * @return Masked and shifted value. - */ -#define NXP_VAL2FLD(field, value) (((value) << (field ## _SHIFT)) & (field ## _MASK)) -/** - * @brief Mask and right-shift a register value to extract a bit field value. - * @param field Name of the register bit field. - * @param value Value of the register. - * @return Masked and shifted bit field value. - */ -#define NXP_FLD2VAL(field, value) (((value) & (field ## _MASK)) >> (field ## _SHIFT)) - -/*! - * @} - */ /* end of group Bit_Field_Generic_Macros */ - - -/* ---------------------------------------------------------------------------- - -- SDK Compatibility - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SDK_Compatibility_Symbols SDK Compatibility - * @{ - */ - -/** High Speed SPI (Flexcomm 8) interrupt name */ -#define LSPI_HS_IRQn FLEXCOMM8_IRQn - - -/*! - * @} - */ /* end of group SDK_Compatibility_Symbols */ - - -#endif /* MCXN236_H_ */ - diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/MCXN236_features.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/MCXN236_features.h deleted file mode 100644 index d343f88e855..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/MCXN236_features.h +++ /dev/null @@ -1,900 +0,0 @@ -/* -** ################################################################### -** Version: rev. 1.0, 2021-08-03 -** Build: b240407 -** -** Abstract: -** Chip specific module features. -** -** Copyright 2016 Freescale Semiconductor, Inc. -** Copyright 2016-2024 NXP -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** Revisions: -** - rev. 1.0 (2021-08-03) -** Initial version based on SPEC1.6 -** -** ################################################################### -*/ - -#ifndef _MCXN236_FEATURES_H_ -#define _MCXN236_FEATURES_H_ - -/* SOC module features */ - -/* @brief CDOG availability on the SoC. */ -#define FSL_FEATURE_SOC_CDOG_COUNT (2) -/* @brief CMC availability on the SoC. */ -#define FSL_FEATURE_SOC_CMC_COUNT (1) -/* @brief CRC availability on the SoC. */ -#define FSL_FEATURE_SOC_CRC_COUNT (1) -/* @brief CTIMER availability on the SoC. */ -#define FSL_FEATURE_SOC_CTIMER_COUNT (5) -/* @brief EDMA availability on the SoC. */ -#define FSL_FEATURE_SOC_EDMA_COUNT (2) -/* @brief EIM availability on the SoC. */ -#define FSL_FEATURE_SOC_EIM_COUNT (1) -/* @brief EVTG availability on the SoC. */ -#define FSL_FEATURE_SOC_EVTG_COUNT (1) -/* @brief EWM availability on the SoC. */ -#define FSL_FEATURE_SOC_EWM_COUNT (1) -/* @brief FLEXCAN availability on the SoC. */ -#define FSL_FEATURE_SOC_FLEXCAN_COUNT (2) -/* @brief FLEXIO availability on the SoC. */ -#define FSL_FEATURE_SOC_FLEXIO_COUNT (1) -/* @brief FMC availability on the SoC. */ -#define FSL_FEATURE_SOC_FMC_COUNT (1) -/* @brief FREQME availability on the SoC. */ -#define FSL_FEATURE_SOC_FREQME_COUNT (1) -/* @brief GPIO availability on the SoC. */ -#define FSL_FEATURE_SOC_GPIO_COUNT (12) -/* @brief SPC availability on the SoC. */ -#define FSL_FEATURE_SOC_SPC_COUNT (1) -/* @brief I3C availability on the SoC. */ -#define FSL_FEATURE_SOC_I3C_COUNT (2) -/* @brief I2S availability on the SoC. */ -#define FSL_FEATURE_SOC_I2S_COUNT (2) -/* @brief INPUTMUX availability on the SoC. */ -#define FSL_FEATURE_SOC_INPUTMUX_COUNT (1) -/* @brief ITRC availability on the SoC. */ -#define FSL_FEATURE_SOC_ITRC_COUNT (1) -/* @brief LPADC availability on the SoC. */ -#define FSL_FEATURE_SOC_LPADC_COUNT (2) -/* @brief LPCMP availability on the SoC. */ -#define FSL_FEATURE_SOC_LPCMP_COUNT (2) -/* @brief LPI2C availability on the SoC. */ -#define FSL_FEATURE_SOC_LPI2C_COUNT (8) -/* @brief LPSPI availability on the SoC. */ -#define FSL_FEATURE_SOC_LPSPI_COUNT (8) -/* @brief LPTMR availability on the SoC. */ -#define FSL_FEATURE_SOC_LPTMR_COUNT (2) -/* @brief LPUART availability on the SoC. */ -#define FSL_FEATURE_SOC_LPUART_COUNT (8) -/* @brief MPU availability on the SoC. */ -#define FSL_FEATURE_SOC_MPU_COUNT (1) -/* @brief MRT availability on the SoC. */ -#define FSL_FEATURE_SOC_MRT_COUNT (1) -/* @brief OSTIMER availability on the SoC. */ -#define FSL_FEATURE_SOC_OSTIMER_COUNT (1) -/* @brief PDM availability on the SoC. */ -#define FSL_FEATURE_SOC_PDM_COUNT (1) -/* @brief PINT availability on the SoC. */ -#define FSL_FEATURE_SOC_PINT_COUNT (1) -/* @brief PKC availability on the SoC. */ -#define FSL_FEATURE_SOC_PKC_COUNT (1) -/* @brief PORT availability on the SoC. */ -#define FSL_FEATURE_SOC_PORT_COUNT (6) -/* @brief PWM availability on the SoC. */ -#define FSL_FEATURE_SOC_PWM_COUNT (2) -/* @brief PUF availability on the SoC. */ -#define FSL_FEATURE_SOC_PUF_COUNT (4) -/* @brief QDC availability on the SoC. */ -#define FSL_FEATURE_SOC_QDC_COUNT (2) -/* @brief RTC availability on the SoC. */ -#define FSL_FEATURE_SOC_RTC_COUNT (1) -/* @brief SCG availability on the SoC. */ -#define FSL_FEATURE_SOC_SCG_COUNT (1) -/* @brief SMARTDMA availability on the SoC. */ -#define FSL_FEATURE_SOC_SMARTDMA_COUNT (1) -/* @brief SYSCON availability on the SoC. */ -#define FSL_FEATURE_SOC_SYSCON_COUNT (1) -/* @brief SYSPM availability on the SoC. */ -#define FSL_FEATURE_SOC_SYSPM_COUNT (1) -/* @brief USBHS availability on the SoC. */ -#define FSL_FEATURE_SOC_USBHS_COUNT (1) -/* @brief USBHSDCD availability on the SoC. */ -#define FSL_FEATURE_SOC_USBHSDCD_COUNT (1) -/* @brief USBNC availability on the SoC. */ -#define FSL_FEATURE_SOC_USBNC_COUNT (1) -/* @brief USBPHY availability on the SoC. */ -#define FSL_FEATURE_SOC_USBPHY_COUNT (1) -/* @brief UTICK availability on the SoC. */ -#define FSL_FEATURE_SOC_UTICK_COUNT (1) -/* @brief VREF availability on the SoC. */ -#define FSL_FEATURE_SOC_VREF_COUNT (1) -/* @brief WWDT availability on the SoC. */ -#define FSL_FEATURE_SOC_WWDT_COUNT (2) -/* @brief WUU availability on the SoC. */ -#define FSL_FEATURE_SOC_WUU_COUNT (1) - -/* LPADC module features */ - -/* @brief FIFO availability on the SoC. */ -#define FSL_FEATURE_LPADC_FIFO_COUNT (2) -/* @brief Has subsequent trigger priority (bitfield CFG[TPRICTRL]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_SUBSEQUENT_PRIORITY (1) -/* @brief Has differential mode (bitfield CMDLn[DIFF]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_DIFF (0) -/* @brief Has channel scale (bitfield CMDLn[CSCALE]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_CSCALE (0) -/* @brief Has conversion type select (bitfield CMDLn[CTYPE]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_CTYPE (1) -/* @brief Has conversion resolution select (bitfield CMDLn[MODE]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_MODE (1) -/* @brief Has compare function enable (bitfield CMDHn[CMPEN]). */ -#define FSL_FEATURE_LPADC_HAS_CMDH_CMPEN (1) -/* @brief Has Wait for trigger assertion before execution (bitfield CMDHn[WAIT_TRIG]). */ -#define FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG (1) -/* @brief Has offset calibration (bitfield CTRL[CALOFS]). */ -#define FSL_FEATURE_LPADC_HAS_CTRL_CALOFS (1) -/* @brief Has gain calibration (bitfield CTRL[CAL_REQ]). */ -#define FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ (1) -/* @brief Has calibration average (bitfield CTRL[CAL_AVGS]). */ -#define FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS (1) -/* @brief Has internal clock (bitfield CFG[ADCKEN]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_ADCKEN (0) -/* @brief Enable support for low voltage reference on option 1 reference (bitfield CFG[VREF1RNG]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG (0) -/* @brief Has calibration (bitfield CFG[CALOFS]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_CALOFS (0) -/* @brief Has offset trim (register OFSTRIM). */ -#define FSL_FEATURE_LPADC_HAS_OFSTRIM (1) -/* @brief OFSTRIM availability on the SoC. */ -#define FSL_FEATURE_LPADC_OFSTRIM_COUNT (2) -/* @brief Has Trigger status register. */ -#define FSL_FEATURE_LPADC_HAS_TSTAT (1) -/* @brief Has power select (bitfield CFG[PWRSEL]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_PWRSEL (1) -/* @brief Has alternate channel B scale (bitfield CMDLn[ALTB_CSCALE]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE (0) -/* @brief Has alternate channel B select enable (bitfield CMDLn[ALTBEN]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN (1) -/* @brief Has alternate channel input (bitfield CMDLn[ALTB_ADCH]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_ALTB_ADCH (1) -/* @brief Has offset calibration mode (bitfield CTRL[CALOFSMODE]). */ -#define FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE (0) -/* @brief Conversion averaged bitfiled width. */ -#define FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH (4) -/* @brief Has B side channels. */ -#define FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS (1) -/* @brief Indicate whether the LPADC STAT register has trigger exception interrupt function (bitfield STAT[TEXC_INT]). */ -#define FSL_FEATURE_LPADC_HAS_STAT_TEXC_INT (1) -/* @brief Indicate whether the LPADC STAT register has trigger completion interrupt function (bitfield STAT[TCOMP_INT]). */ -#define FSL_FEATURE_LPADC_HAS_STAT_TCOMP_INT (1) -/* @brief Indicate whether the LPADC STAT register has calibration ready function (bitfield STAT[CAL_RDY]). */ -#define FSL_FEATURE_LPADC_HAS_STAT_CAL_RDY (1) -/* @brief Indicate whether the LPADC STAT register has ADC active function (bitfield STAT[ADC_ACTIVE]). */ -#define FSL_FEATURE_LPADC_HAS_STAT_ADC_ACTIVE (1) -/* @brief Indicate whether the LPADC IE register has trigger exception interrupt enable function (bitfield IE[TEXC_IE]). */ -#define FSL_FEATURE_LPADC_HAS_IE_TEXC_IE (1) -/* @brief Indicate whether the LPADC IE register has trigger completion interrupt enable function (bitfield IE[TCOMP_IE]). */ -#define FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE (1) -/* @brief Indicate whether the LPADC CFG register has trigger resume/restart enable function (bitfield CFG[TRES]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_TRES (1) -/* @brief Indicate whether the LPADC CFG register has trigger command resume/restart enable function (bitfield CFG[TCMDRES]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_TCMDRES (1) -/* @brief Indicate whether the LPADC CFG register has high priority trigger exception disable function (bitfield CFG[HPT_EXDI]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI (1) -/* @brief Indicate LPADC CFG register TPRICTRL bitfield width. */ -#define FSL_FEATURE_LPADC_CFG_TPRICTRL_BITFIELD_WIDTH (2) -/* @brief Temperature sensor parameter A (slope). */ -#define FSL_FEATURE_LPADC_TEMP_PARAMETER_A (783U) -/* @brief Temperature sensor parameter B (offset). */ -#define FSL_FEATURE_LPADC_TEMP_PARAMETER_B (297U) -/* @brief Temperature sensor parameter Alpha. */ -#define FSL_FEATURE_LPADC_TEMP_PARAMETER_ALPHA (9.63f) -/* @brief The buffer size of temperature sensor. */ -#define FSL_FEATURE_LPADC_TEMP_SENS_BUFFER_SIZE (2U) - -/* FLEXCAN module features */ - -/* @brief Has more than 64 MBs. */ -#define FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB (0) -/* @brief Message buffer size */ -#define FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(x) (32) -/* @brief Has doze mode support (register bit field MCR[DOZE]). */ -#define FSL_FEATURE_FLEXCAN_HAS_DOZE_MODE_SUPPORT (0) -/* @brief Insatnce has doze mode support (register bit field MCR[DOZE]). */ -#define FSL_FEATURE_FLEXCAN_INSTANCE_HAS_DOZE_MODE_SUPPORTn(x) (0) -/* @brief Has a glitch filter on the receive pin (register bit field MCR[WAKSRC]). */ -#define FSL_FEATURE_FLEXCAN_HAS_GLITCH_FILTER (1) -/* @brief Has extended interrupt mask and flag register (register IMASK2, IFLAG2). */ -#define FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER (0) -/* @brief Instance has extended bit timing register (register CBT). */ -#define FSL_FEATURE_FLEXCAN_INSTANCE_HAS_EXTENDED_TIMING_REGISTERn(x) (1) -/* @brief Has a receive FIFO DMA feature (register bit field MCR[DMA]). */ -#define FSL_FEATURE_FLEXCAN_HAS_RX_FIFO_DMA (1) -/* @brief Instance has a receive FIFO DMA feature (register bit field MCR[DMA]). */ -#define FSL_FEATURE_FLEXCAN_INSTANCE_HAS_RX_FIFO_DMAn(x) (1) -/* @brief Remove CAN Engine Clock Source Selection from unsupported part. */ -#define FSL_FEATURE_FLEXCAN_SUPPORT_ENGINE_CLK_SEL_REMOVE (1) -/* @brief Instance remove CAN Engine Clock Source Selection from unsupported part. */ -#define FSL_FEATURE_FLEXCAN_INSTANCE_SUPPORT_ENGINE_CLK_SEL_REMOVEn(x) (1) -/* @brief Is affected by errata with ID 5641 (Module does not transmit a message that is enabled to be transmitted at a specific moment during the arbitration process). */ -#define FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641 (0) -/* @brief Is affected by errata with ID 5829 (FlexCAN: FlexCAN does not transmit a message that is enabled to be transmitted in a specific moment during the arbitration process). */ -#define FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829 (0) -/* @brief Is affected by errata with ID 6032 (FlexCAN: A frame with wrong ID or payload is transmitted into the CAN bus when the Message Buffer under transmission is either aborted or deactivated while the CAN bus is in the Bus Idle state). */ -#define FSL_FEATURE_FLEXCAN_HAS_ERRATA_6032 (0) -/* @brief Is affected by errata with ID 9595 (FlexCAN: Corrupt frame possible if the Freeze Mode or the Low-Power Mode are entered during a Bus-Off state). */ -#define FSL_FEATURE_FLEXCAN_HAS_ERRATA_9595 (0) -/* @brief Has CAN with Flexible Data rate (CAN FD) protocol. */ -#define FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE (1) -/* @brief CAN instance support Flexible Data rate (CAN FD) protocol. */ -#define FSL_FEATURE_FLEXCAN_INSTANCE_HAS_FLEXIBLE_DATA_RATEn(x) (1) -/* @brief Has memory error control (register MECR). */ -#define FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL (0) -/* @brief Has enhanced bit timing register (register EPRS, ENCBT, EDCBT and ETDC). */ -#define FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG (1) -/* @brief Has Pretended Networking mode support. */ -#define FSL_FEATURE_FLEXCAN_HAS_PN_MODE (1) -/* @brief Has Enhanced Rx FIFO. */ -#define FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO (1) -/* @brief Enhanced Rx FIFO size (Indicates how many CAN FD messages can be stored). */ -#define FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO_SIZE (12) -/* @brief The number of enhanced Rx FIFO filter element registers. */ -#define FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO_FILTER_MAX_NUMBER (32) -/* @brief Does not support Supervisor Mode (bitfield MCR[SUPV]. */ -#define FSL_FEATURE_FLEXCAN_HAS_NO_SUPV_SUPPORT (1) -/* @brief FlexCAN maximum data rate. */ -#define FSL_FEATURE_FLEXCAN_MAX_CANFD_BITRATE (10000000) - -/* CDOG module features */ - -/* @brief CDOG Has No Reset */ -#define FSL_FEATURE_CDOG_HAS_NO_RESET (1) - -/* CMC module features */ - -/* @brief Has SRAM_DIS register */ -#define FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG (1) -/* @brief Has BSR register */ -#define FSL_FEATURE_MCX_CMC_HAS_BSR_REG (1) -/* @brief Has RSTCNT register */ -#define FSL_FEATURE_MCX_CMC_HAS_RSTCNT_REG (1) -/* @brief Has BLR register */ -#define FSL_FEATURE_MCX_CMC_HAS_BLR_REG (1) -/* @brief Has no bitfield FLASHWAKE in FLASHCR register */ -#define FSL_FEATURE_MCX_CMC_HAS_NO_FLASHCR_WAKE (1) - -/* LPCMP module features */ - -/* @brief Has CCR1 FUNC_CLK_SEL bitfield. */ -#define FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL (1) -/* @brief Has IER RRF_IE bitfield. */ -#define FSL_FEATURE_LPCMP_HAS_IER_RRF_IE (1) -/* @brief Has CSR RRF bitfield. */ -#define FSL_FEATURE_LPCMP_HAS_CSR_RRF (1) -/* @brief Has Round Robin mode (related to existence of registers RRCR0). */ -#define FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE (1) -/* @brief Has window mode (related to existence of CCR1.WINDOW_CLS). */ -#define FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL (1) -/* @brief Has no CCR0 CMP_STOP_EN bitfield. */ -#define FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN (1) - -/* SYSPM module features */ - -/* @brief Temperature sensor parameter A (slope). */ -#define FSL_FEATURE_SYSPM_HAS_PMCR_DCIFSH (0) -/* @brief Temperature sensor parameter B (offset). */ -#define FSL_FEATURE_SYSPM_HAS_PMCR_RICTR (0) -/* @brief Number of PMCR registers signals number of performance monitors available in single SYSPM instance. */ -#define FSL_FEATURE_SYSPM_PMCR_COUNT (1) - -/* CTIMER module features */ - -/* @brief CTIMER has no capture channel. */ -#define FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE (0) -/* @brief CTIMER has no capture 2 interrupt. */ -#define FSL_FEATURE_CTIMER_HAS_NO_IR_CR2INT (0) -/* @brief CTIMER capture 3 interrupt. */ -#define FSL_FEATURE_CTIMER_HAS_IR_CR3INT (1) -/* @brief Has CTIMER CCR_CAP2 (register bits CCR[CAP2RE][CAP2FE][CAP2I]. */ -#define FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2 (0) -/* @brief Has CTIMER CCR_CAP3 (register bits CCR[CAP3RE][CAP3FE][CAP3I]). */ -#define FSL_FEATURE_CTIMER_HAS_CCR_CAP3 (1) -/* @brief CTIMER Has register MSR */ -#define FSL_FEATURE_CTIMER_HAS_MSR (1) - -/* EDMA module features */ - -/* @brief Number of DMA channels (related to number of registers TCD, DCHPRI, bit fields ERQ[ERQn], EEI[EEIn], INT[INTn], ERR[ERRn], HRS[HRSn] and bit field widths ES[ERRCHN], CEEI[CEEI], SEEI[SEEI], CERQ[CERQ], SERQ[SERQ], CDNE[CDNE], SSRT[SSRT], CERR[CERR], CINT[CINT], TCDn_CITER_ELINKYES[LINKCH], TCDn_CSR[MAJORLINKCH], TCDn_BITER_ELINKYES[LINKCH]). (Valid only for eDMA modules.) */ -#define FSL_FEATURE_EDMA_MODULE_CHANNEL (16) -/* @brief If 8 bytes transfer supported. */ -#define FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER (1) -/* @brief Number of DMA channel groups (register bit fields CR[ERGA], CR[GRPnPRI], ES[GPE], DCHPRIn[GRPPRI]). (Valid only for eDMA modules.) */ -#define FSL_FEATURE_EDMA_CHANNEL_GROUP_COUNT (1) -/* @brief If 16 bytes transfer supported. */ -#define FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER (1) -/* @brief Has DMA_Error interrupt vector. */ -#define FSL_FEATURE_EDMA_HAS_ERROR_IRQ (1) -/* @brief If 64 bytes transfer supported. */ -#define FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER (0) -/* @brief whether has prot register */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_PROT_REGISTERn(x) (0) -/* @brief If 128 bytes transfer supported. */ -#define FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER (0) -/* @brief whether has MP channel mux */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_MP_CHANNEL_MUXn(x) (0) -/* @brief If 128 bytes transfer supported. */ -#define FSL_FEATURE_EDMA_INSTANCE_SUPPORT_128_BYTES_TRANSFERn(x) (0) -/* @brief If channel clock controlled independently */ -#define FSL_FEATURE_EDMA_CHANNEL_HAS_OWN_CLOCK_GATE (1) -/* @brief Has register CH_CSR. */ -#define FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG (1) -/* @brief Number of channel for each EDMA instance, (only defined for soc with different channel numbers for difference instance) */ -#define FSL_FEATURE_EDMA_INSTANCE_CHANNELn(x) \ - (((x) == DMA0) ? (16) : \ - (((x) == DMA1) ? (8) : (-1))) -/* @brief Has channel mux */ -#define FSL_FEATURE_EDMA_HAS_CHANNEL_MUX (1) -/* @brief Has no register bit fields MP_CSR[EBW]. */ -#define FSL_FEATURE_EDMA_HAS_NO_MP_CSR_EBW (1) -/* @brief Instance has channel mux */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_MUXn(x) (1) -/* @brief If dma has common clock gate */ -#define FSL_FEATURE_EDMA_HAS_COMMON_CLOCK_GATE (0) -/* @brief Has register CH_SBR. */ -#define FSL_FEATURE_EDMA_HAS_SBR (1) -/* @brief If dma channel IRQ support parameter */ -#define FSL_FEATURE_EDMA_MODULE_CHANNEL_IRQ_ENTRY_SUPPORT_PARAMETER (0) -/* @brief Has no register bit fields CH_SBR[ATTR]. */ -#define FSL_FEATURE_EDMA_HAS_NO_CH_SBR_ATTR (1) -/* @brief NBYTES must be multiple of 8 when using scatter gather. */ -#define FSL_FEATURE_EDMA_HAS_ERRATA_51327 (0) -/* @brief Has register bit field CH_CSR[SWAP]. */ -#define FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE (0) -/* @brief NBYTES must be multiple of 8 when using scatter gather. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_ERRATA_51327n(x) (0) -/* @brief Instance has register bit field CH_CSR[SWAP]. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_SWAP_SIZEn(x) (0) -/* @brief Has register bit fields MP_CSR[GMRC]. */ -#define FSL_FEATURE_EDMA_HAS_GLOBAL_MASTER_ID_REPLICATION (1) -/* @brief Has register bit field CH_SBR[INSTR]. */ -#define FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE (0) -/* @brief Instance has register bit field CH_SBR[INSTR]. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_ACCESS_TYPEn(x) (0) -/* @brief Has register bit fields CH_MATTR[WCACHE], CH_MATTR[RCACHE]. */ -#define FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE (0) -/* @brief Instance has register CH_MATTR. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_MEMORY_ATTRIBUTEn(x) (0) -/* @brief Has register bit field CH_CSR[SIGNEXT]. */ -#define FSL_FEATURE_EDMA_HAS_CHANNEL_SIGN_EXTENSION (0) -/* @brief Instance Has register bit field CH_CSR[SIGNEXT]. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_SIGN_EXTENSIONn(x) (0) -/* @brief Has register bit field TCD_CSR[BWC]. */ -#define FSL_FEATURE_EDMA_HAS_BANDWIDTH (1) -/* @brief Instance has register bit field TCD_CSR[BWC]. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_BANDWIDTHn(x) (1) -/* @brief Has register bit fields TCD_CSR[TMC]. */ -#define FSL_FEATURE_EDMA_HAS_TRANSFER_MODE (0) -/* @brief Instance has register bit fields TCD_CSR[TMC]. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_TRANSFER_MODEn(x) (0) -/* @brief Has no register bit fields CH_SBR[SEC]. */ -#define FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC (0) -/* @brief edma5 has different tcd type. */ -#define FSL_FEATURE_EDMA_TCD_TYPEn(x) (0) -/* @brief Number of DMA channels with asynchronous request capability. (Valid only for eDMA modules.) */ -#define FSL_FEATURE_EDMA_ASYNCHRO_REQUEST_CHANNEL_COUNT (16) - -/* EVTG module features */ - -/* @brief OPAMP support force bypass */ -#define FSL_FEATURE_EVTG_HAS_FORCE_BYPASS_FLIPFLOP (1) - -/* FLEXIO module features */ - -/* @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) */ -#define FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_HALF_WORD_SWAP (1) -/* @brief Has Shifter Buffer N Nibble Swapped Register (FLEXIO_SHIFTBUFNISn) */ -#define FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_SWAP (1) -/* @brief Supports Shifter State Mode (FLEXIO_SHIFTCTLn[SMOD]) */ -#define FSL_FEATURE_FLEXIO_HAS_STATE_MODE (1) -/* @brief Supports Shifter Logic Mode (FLEXIO_SHIFTCTLn[SMOD]) */ -#define FSL_FEATURE_FLEXIO_HAS_LOGIC_MODE (1) -/* @brief Supports paralle width (FLEXIO_SHIFTCFGn[PWIDTH]) */ -#define FSL_FEATURE_FLEXIO_HAS_PARALLEL_WIDTH (1) -/* @brief Reset value of the FLEXIO_VERID register */ -#define FSL_FEATURE_FLEXIO_VERID_RESET_VALUE (0x2010003) -/* @brief Reset value of the FLEXIO_PARAM register */ -#define FSL_FEATURE_FLEXIO_PARAM_RESET_VALUE (0x8200808) -/* @brief Represent the bit width of the TIMDCE field (FLEXIO_TIMCFGLn[TIMDEC]) */ -#define FSL_FEATURE_FLEXIO_TIMCFG_TIMDCE_FIELD_WIDTH (3) - -/* GPIO module features */ - -/* @brief Has GPIO attribute checker register (GACR). */ -#define FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER (0) -/* @brief Has GPIO version ID register (VERID). */ -#define FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER (1) -/* @brief Has secure/non-secure access protection registers (LOCK, PCNS, PCNP, ICNS, ICNP). */ -#define FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL (1) -/* @brief Has GPIO port input disable register (PIDR). */ -#define FSL_FEATURE_GPIO_HAS_PORT_INPUT_CONTROL (1) -/* @brief Has GPIO interrupt/DMA request/trigger output selection. */ -#define FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT (1) - -/* I3C module features */ - -/* @brief Has TERM bitfile in MERRWARN register. */ -#define FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM (0) -/* @brief SOC has no reset driver. */ -#define FSL_FEATURE_I3C_HAS_NO_RESET (0) -/* @brief Use fixed BAMATCH count, do not provide editable BAMATCH. */ -#define FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH (0) -/* @brief Register SCONFIG do not have IDRAND bitfield. */ -#define FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND (1) -/* @brief Register SCONFIG has HDROK bitfield. */ -#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 (1) - -/* INPUTMUX module features */ - -/* @brief Inputmux has DMA Request Enable */ -#define FSL_FEATURE_INPUTMUX_HAS_SIGNAL_ENA (1) -/* @brief Inputmux has channel mux control */ -#define FSL_FEATURE_INPUTMUX_HAS_CHANNEL_MUX (0) - -/* INTM module features */ - -/* @brief Up to 4 programmable interrupt monitors */ -#define FSL_FEATURE_INTM_MONITOR_COUNT (4) - -/* LPI2C module features */ - -/* @brief Has separate DMA RX and TX requests. */ -#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) - -/* LPSPI module features */ - -/* @brief Capacity (number of entries) of the transmit/receive FIFO (or zero if no FIFO is available). */ -#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 */ -#define FSL_FEATURE_LPSPI_HAS_NO_PCSCFG (0) -/* @brief Has no WIDTH bits in TCR register */ -#define FSL_FEATURE_LPSPI_HAS_NO_MULTI_WIDTH (0) - -/* LPTMR module features */ - -/* @brief Has shared interrupt handler with another LPTMR module. */ -#define FSL_FEATURE_LPTMR_HAS_SHARED_IRQ_HANDLER (0) -/* @brief Whether LPTMR counter is 32 bits width. */ -#define FSL_FEATURE_LPTMR_CNR_WIDTH_IS_32B (1) -/* @brief Has timer DMA request enable (register bit CSR[TDRE]). */ -#define FSL_FEATURE_LPTMR_HAS_CSR_TDRE (1) -/* @brief Do not has prescaler clock source 0. */ -#define FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_0_SUPPORT (0) -/* @brief Do not has prescaler clock source 1. */ -#define FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT (0) -/* @brief Do not has prescaler clock source 2. */ -#define FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_2_SUPPORT (0) -/* @brief Do not has prescaler clock source 3. */ -#define FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_3_SUPPORT (0) - -/* LPUART module features */ - -/* @brief Has receive FIFO overflow detection (bit field CFIFO[RXOFE]). */ -#define FSL_FEATURE_LPUART_HAS_IRQ_EXTENDED_FUNCTIONS (0) -/* @brief Has low power features (can be enabled in wait mode via register bit C1[DOZEEN] or CTRL[DOZEEN] if the registers are 32-bit wide). */ -#define FSL_FEATURE_LPUART_HAS_LOW_POWER_UART_SUPPORT (1) -/* @brief Has extended data register ED (or extra flags in the DATA register if the registers are 32-bit wide). */ -#define FSL_FEATURE_LPUART_HAS_EXTENDED_DATA_REGISTER_FLAGS (1) -/* @brief Capacity (number of entries) of the transmit/receive FIFO (or zero if no FIFO is available). */ -#define FSL_FEATURE_LPUART_HAS_FIFO (1) -/* @brief Has 32-bit register MODIR */ -#define FSL_FEATURE_LPUART_HAS_MODIR (1) -/* @brief Hardware flow control (RTS, CTS) is supported. */ -#define FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT (1) -/* @brief Infrared (modulation) is supported. */ -#define FSL_FEATURE_LPUART_HAS_IR_SUPPORT (1) -/* @brief 2 bits long stop bit is available. */ -#define FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT (1) -/* @brief If 10-bit mode is supported. */ -#define FSL_FEATURE_LPUART_HAS_10BIT_DATA_SUPPORT (1) -/* @brief If 7-bit mode is supported. */ -#define FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT (1) -/* @brief Baud rate fine adjustment is available. */ -#define FSL_FEATURE_LPUART_HAS_BAUD_RATE_FINE_ADJUST_SUPPORT (0) -/* @brief Baud rate oversampling is available (has bit fields C4[OSR], C5[BOTHEDGE], C5[RESYNCDIS] or BAUD[OSR], BAUD[BOTHEDGE], BAUD[RESYNCDIS] if the registers are 32-bit wide). */ -#define FSL_FEATURE_LPUART_HAS_BAUD_RATE_OVER_SAMPLING_SUPPORT (1) -/* @brief Baud rate oversampling is available. */ -#define FSL_FEATURE_LPUART_HAS_RX_RESYNC_SUPPORT (1) -/* @brief Baud rate oversampling is available. */ -#define FSL_FEATURE_LPUART_HAS_BOTH_EDGE_SAMPLING_SUPPORT (1) -/* @brief Peripheral type. */ -#define FSL_FEATURE_LPUART_IS_SCI (1) -/* @brief Capacity (number of entries) of the transmit/receive FIFO (or zero if no FIFO is available). */ -#define FSL_FEATURE_LPUART_FIFO_SIZEn(x) (8) -/* @brief Supports two match addresses to filter incoming frames. */ -#define FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING (1) -/* @brief Has transmitter/receiver DMA enable bits C5[TDMAE]/C5[RDMAE] (or BAUD[TDMAE]/BAUD[RDMAE] if the registers are 32-bit wide). */ -#define FSL_FEATURE_LPUART_HAS_DMA_ENABLE (1) -/* @brief Has transmitter/receiver DMA select bits C4[TDMAS]/C4[RDMAS], resp. C5[TDMAS]/C5[RDMAS] if IS_SCI = 0. */ -#define FSL_FEATURE_LPUART_HAS_DMA_SELECT (0) -/* @brief Data character bit order selection is supported (bit field S2[MSBF] or STAT[MSBF] if the registers are 32-bit wide). */ -#define FSL_FEATURE_LPUART_HAS_BIT_ORDER_SELECT (1) -/* @brief Has smart card (ISO7816 protocol) support and no improved smart card support. */ -#define FSL_FEATURE_LPUART_HAS_SMART_CARD_SUPPORT (0) -/* @brief Has improved smart card (ISO7816 protocol) support. */ -#define FSL_FEATURE_LPUART_HAS_IMPROVED_SMART_CARD_SUPPORT (0) -/* @brief Has local operation network (CEA709.1-B protocol) support. */ -#define FSL_FEATURE_LPUART_HAS_LOCAL_OPERATION_NETWORK_SUPPORT (0) -/* @brief Has 32-bit registers (BAUD, STAT, CTRL, DATA, MATCH, MODIR) instead of 8-bit (BDH, BDL, C1, S1, D, etc.). */ -#define FSL_FEATURE_LPUART_HAS_32BIT_REGISTERS (1) -/* @brief Lin break detect available (has bit BAUD[LBKDIE]). */ -#define FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT (1) -/* @brief UART stops in Wait mode available (has bit C1[UARTSWAI]). */ -#define FSL_FEATURE_LPUART_HAS_WAIT_MODE_OPERATION (0) -/* @brief Has separate DMA RX and TX requests. */ -#define FSL_FEATURE_LPUART_HAS_SEPARATE_DMA_RX_TX_REQn(x) (1) -/* @brief Has separate RX and TX interrupts. */ -#define FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ (0) -/* @brief Has LPAURT_PARAM. */ -#define FSL_FEATURE_LPUART_HAS_PARAM (1) -/* @brief Has LPUART_VERID. */ -#define FSL_FEATURE_LPUART_HAS_VERID (1) -/* @brief Has LPUART_GLOBAL. */ -#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 (1) -/* @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) - -/* LP_FLEXCOMM module features */ - -/* No feature definitions */ - -/* MRT module features */ - -/* @brief number of channels. */ -#define FSL_FEATURE_MRT_NUMBER_OF_CHANNELS (4) - -/* PDM module features */ - -/* @brief PDM FIFO offset */ -#define FSL_FEATURE_PDM_FIFO_OFFSET (4) -/* @brief PDM Channel Number */ -#define FSL_FEATURE_PDM_CHANNEL_NUM (4) -/* @brief PDM FIFO WIDTH Size */ -#define FSL_FEATURE_PDM_FIFO_WIDTH (4) -/* @brief PDM FIFO DEPTH Size */ -#define FSL_FEATURE_PDM_FIFO_DEPTH (16) -/* @brief PDM has RANGE_CTRL register */ -#define FSL_FEATURE_PDM_HAS_RANGE_CTRL (1) -/* @brief PDM Has Low Frequency */ -#define FSL_FEATURE_PDM_HAS_STATUS_LOW_FREQ (0) -/* @brief PDM Has No VADEF Bitfield In PDM VAD0_STAT Register */ -#define FSL_FEATURE_PDM_HAS_NO_VADEF (1) -/* @brief PDM Has no minimum clkdiv */ -#define FSL_FEATURE_PDM_HAS_NO_MINIMUM_CLKDIV (1) -/* @brief PDM Has no FIR_RDY Bitfield In PDM STAT Register */ -#define FSL_FEATURE_PDM_HAS_NO_FIR_RDY (1) -/* @brief PDM Has no DOZEN Bitfield In PDM CTRL_1 Register */ -#define FSL_FEATURE_PDM_HAS_NO_DOZEN (0) -/* @brief PDM Has DEC_BYPASS Bitfield In PDM CTRL_2 Register */ -#define FSL_FEATURE_PDM_HAS_DECIMATION_FILTER_BYPASS (0) -/* @brief PDM Has DC_OUT_CTRL */ -#define FSL_FEATURE_PDM_HAS_DC_OUT_CTRL (1) -/* @brief PDM Has Fixed DC CTRL VALUE. */ -#define FSL_FEATURE_PDM_DC_CTRL_VALUE_FIXED (1) -/* @brief PDM Has no independent error IRQ */ -#define FSL_FEATURE_PDM_HAS_NO_INDEPENDENT_ERROR_IRQ (1) -/* @brief PDM has no hardware Voice Activity Detector */ -#define FSL_FEATURE_PDM_HAS_NO_HWVAD (1) - -/* PINT module features */ - -/* @brief Number of connected outputs */ -#define FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS (8) -/* @brief PINT Interrupt Combine */ -#define FSL_FEATURE_PINT_INTERRUPT_COMBINE (1) - -/* PORT module features */ - -/* @brief Has control lock (register bit PCR[LK]). */ -#define FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK (1) -/* @brief Has open drain control (register bit PCR[ODE]). */ -#define FSL_FEATURE_PORT_HAS_OPEN_DRAIN (1) -/* @brief Has digital filter (registers DFER, DFCR and DFWR). */ -#define FSL_FEATURE_PORT_HAS_DIGITAL_FILTER (0) -/* @brief Has DMA request (register bit field PCR[IRQC] or ICR[IRQC] values). */ -#define FSL_FEATURE_PORT_HAS_DMA_REQUEST (0) -/* @brief Has pull resistor selection available. */ -#define FSL_FEATURE_PORT_HAS_PULL_SELECTION (1) -/* @brief Has pull resistor enable (register bit PCR[PE]). */ -#define FSL_FEATURE_PORT_HAS_PULL_ENABLE (1) -/* @brief Has slew rate control (register bit PCR[SRE]). */ -#define FSL_FEATURE_PORT_HAS_SLEW_RATE (1) -/* @brief Has passive filter (register bit field PCR[PFE]). */ -#define FSL_FEATURE_PORT_HAS_PASSIVE_FILTER (1) -/* @brief Do not has interrupt control (register ISFR). */ -#define FSL_FEATURE_PORT_HAS_NO_INTERRUPT (1) -/* @brief Has pull value (register bit field PCR[PV]). */ -#define FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE (1) -/* @brief Has drive strength1 control (register bit PCR[DSE1]). */ -#define FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1 (0) -/* @brief Has version ID register (register VERID). */ -#define FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER (1) -/* @brief Has voltage range control (register bit CONFIG[RANGE]). */ -#define FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE (1) -/* @brief Has EFT detect (registers EDFR, EDIER and EDCR). */ -#define FSL_FEATURE_PORT_SUPPORT_EFT (1) -/* @brief Function 0 is GPIO. */ -#define FSL_FEATURE_PORT_PCR_MUX_GPIO (0) -/* @brief Has drive strength control (register bit PCR[DSE]). */ -#define FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH (1) -/* @brief Defines width of PCR[MUX] field. */ -#define FSL_FEATURE_PORT_PCR_MUX_WIDTH (4) -/* @brief Has dedicated interrupt vector. */ -#define FSL_FEATURE_PORT_HAS_INTERRUPT_VECTOR (1) -/* @brief Has independent interrupt control(register ICR). */ -#define FSL_FEATURE_PORT_HAS_INDEPENDENT_INTERRUPT_CONTROL (0) -/* @brief Has multiple pin IRQ configuration (register GICLR and GICHR). */ -#define FSL_FEATURE_PORT_HAS_MULTIPLE_IRQ_CONFIG (0) -/* @brief Has Input Buffer Enable (register bit field PCR[IBE]). */ -#define FSL_FEATURE_PORT_HAS_INPUT_BUFFER (1) -/* @brief Has Invert Input (register bit field PCR[IBE]). */ -#define FSL_FEATURE_PORT_HAS_INVERT_INPUT (1) -/* @brief Defines whether PCR[IRQC] bit-field has flag states. */ -#define FSL_FEATURE_PORT_HAS_IRQC_FLAG (0) -/* @brief Defines whether PCR[IRQC] bit-field has trigger states. */ -#define FSL_FEATURE_PORT_HAS_IRQC_TRIGGER (0) - -/* PUF module features */ - -/* @brief Puf Activation Code Address. */ -#define FSL_FEATURE_PUF_ACTIVATION_CODE_ADDRESS (17826304) -/* @brief Puf Activation Code Size. */ -#define FSL_FEATURE_PUF_ACTIVATION_CODE_SIZE (1000) - -/* PWM module features */ - -/* @brief If (e)FlexPWM has module A channels (outputs). */ -#define FSL_FEATURE_PWM_HAS_CHANNELA (1) -/* @brief If (e)FlexPWM has module B channels (outputs). */ -#define FSL_FEATURE_PWM_HAS_CHANNELB (1) -/* @brief If (e)FlexPWM has module X channels (outputs). */ -#define FSL_FEATURE_PWM_HAS_CHANNELX (1) -/* @brief If (e)FlexPWM has fractional feature. */ -#define FSL_FEATURE_PWM_HAS_FRACTIONAL (1) -/* @brief If (e)FlexPWM has mux trigger source select bit field. */ -#define FSL_FEATURE_PWM_HAS_MUX_TRIGGER_SOURCE_SEL (1) -/* @brief Number of submodules in each (e)FlexPWM module. */ -#define FSL_FEATURE_PWM_SUBMODULE_COUNT (4) -/* @brief Number of fault channel in each (e)FlexPWM module. */ -#define FSL_FEATURE_PWM_FAULT_CH_COUNT (1) -/* @brief (e)FlexPWM has no WAITEN Bitfield In CTRL2 Register. */ -#define FSL_FEATURE_PWM_HAS_NO_WAITEN (1) -/* @brief If (e)FlexPWM has phase delay feature. */ -#define FSL_FEATURE_PWM_HAS_PHASE_DELAY (1) -/* @brief If (e)FlexPWM has input filter capture feature. */ -#define FSL_FEATURE_PWM_HAS_INPUT_FILTER_CAPTURE (1) -/* @brief If (e)FlexPWM has module capture functionality on A channels (inputs). */ -#define FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA (1) -/* @brief If (e)FlexPWM has module capture functionality on B channels (inputs). */ -#define FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB (1) -/* @brief If (e)FlexPWM has module capture functionality on X channels (inputs). */ -#define FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX (1) - -/* QDC module features */ - -/* @brief Has no simultaneous PHASEA and PHASEB change interrupt (register bit field CTRL2[SABIE] and CTRL2[SABIRQ]). */ -#define FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT (0) -/* @brief Has register CTRL3. */ -#define FSL_FEATURE_QDC_HAS_CTRL3 (1) -/* @brief Has register LASTEDGE or LASTEDGEH. */ -#define FSL_FEATURE_QDC_HAS_LASTEDGE (1) -/* @brief Has register POSDPERBFR, POSDPERH, or POSDPER. */ -#define FSL_FEATURE_QDC_HAS_POSDPER (1) -/* @brief Has bitfiled FILT[FILT_PRSC]. */ -#define FSL_FEATURE_QDC_HAS_FILT_PRSC (1) - -/* RTC module features */ - -/* @brief Has Tamper Direction Register support. */ -#define FSL_FEATURE_RTC_HAS_TAMPER_DIRECTION (0) -/* @brief Has Tamper Queue Status and Control Register support. */ -#define FSL_FEATURE_RTC_HAS_TAMPER_QUEUE (0) -/* @brief Has RTC subsystem. */ -#define FSL_FEATURE_RTC_HAS_SUBSYSTEM (1) -/* @brief Has RTC Tamper 23 Filter Configuration Register support. */ -#define FSL_FEATURE_RTC_HAS_FILTER23_CFG (0) -/* @brief Has WAKEUP_MODE bitfile in CTRL2 register. */ -#define FSL_FEATURE_RTC_HAS_NO_CTRL2_WAKEUP_MODE (1) -/* @brief Has CLK_SEL bitfile in CTRL register. */ -#define FSL_FEATURE_RTC_HAS_CLOCK_SELECT (1) -/* @brief Has CLKO_DIS bitfile in CTRL register. */ -#define FSL_FEATURE_RTC_HAS_CLOCK_OUTPUT_DISABLE (1) -/* @brief Has No Tamper in RTC. */ -#define FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE (1) -/* @brief Has CPU_LOW_VOLT bitfile in STATUS register. */ -#define FSL_FEATURE_RTC_HAS_NO_CPU_LOW_VOLT_FLAG (1) -/* @brief Has RST_SRC bitfile in STATUS register. */ -#define FSL_FEATURE_RTC_HAS_NO_RST_SRC_FLAG (1) -/* @brief Has GP_DATA_REG register. */ -#define FSL_FEATURE_RTC_HAS_NO_GP_DATA_REG (1) -/* @brief Has TIMER_STB_MASK bitfile in CTRL register. */ -#define FSL_FEATURE_RTC_HAS_NO_TIMER_STB_MASK (1) - -/* SAI module features */ - -/* @brief SAI has FIFO in this soc (register bit fields TCR1[TFW]. */ -#define FSL_FEATURE_SAI_HAS_FIFO (1) -/* @brief Receive/transmit FIFO size in item count (register bit fields TCSR[FRDE], TCSR[FRIE], TCSR[FRF], TCR1[TFW], RCSR[FRDE], RCSR[FRIE], RCSR[FRF], RCR1[RFW], registers TFRn, RFRn). */ -#define FSL_FEATURE_SAI_FIFO_COUNTn(x) (8) -/* @brief Receive/transmit channel number (register bit fields TCR3[TCE], RCR3[RCE], registers TDRn and RDRn). */ -#define FSL_FEATURE_SAI_CHANNEL_COUNTn(x) (2) -/* @brief Maximum words per frame (register bit fields TCR3[WDFL], TCR4[FRSZ], TMR[TWM], RCR3[WDFL], RCR4[FRSZ], RMR[RWM]). */ -#define FSL_FEATURE_SAI_MAX_WORDS_PER_FRAME (32) -/* @brief Has support of combining multiple data channel FIFOs into single channel FIFO (register bit fields TCR3[CFR], TCR4[FCOMB], TFR0[WCP], TFR1[WCP], RCR3[CFR], RCR4[FCOMB], RFR0[RCP], RFR1[RCP]). */ -#define FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE (1) -/* @brief Has packing of 8-bit and 16-bit data into each 32-bit FIFO word (register bit fields TCR4[FPACK], RCR4[FPACK]). */ -#define FSL_FEATURE_SAI_HAS_FIFO_PACKING (1) -/* @brief Configures when the SAI will continue transmitting after a FIFO error has been detected (register bit fields TCR4[FCONT], RCR4[FCONT]). */ -#define FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR (1) -/* @brief Configures if the frame sync is generated internally, a frame sync is only generated when the FIFO warning flag is clear or continuously (register bit fields TCR4[ONDEM], RCR4[ONDEM]). */ -#define FSL_FEATURE_SAI_HAS_ON_DEMAND_MODE (1) -/* @brief Simplified bit clock source and asynchronous/synchronous mode selection (register bit fields TCR2[CLKMODE], RCR2[CLKMODE]), in comparison with the exclusively implemented TCR2[SYNC,BCS,BCI,MSEL], RCR2[SYNC,BCS,BCI,MSEL]. */ -#define FSL_FEATURE_SAI_HAS_CLOCKING_MODE (0) -/* @brief Has register for configuration of the MCLK divide ratio (register bit fields MDR[FRACT], MDR[DIVIDE]). */ -#define FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER (0) -/* @brief Interrupt source number */ -#define FSL_FEATURE_SAI_INT_SOURCE_NUM (1) -/* @brief Has register of MCR. */ -#define FSL_FEATURE_SAI_HAS_MCR (1) -/* @brief Has bit field MICS of the MCR register. */ -#define FSL_FEATURE_SAI_HAS_NO_MCR_MICS (1) -/* @brief Has register of MDR */ -#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]. */ -#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 (1) - -/* SPC module features */ - -/* @brief Has DCDC */ -#define FSL_FEATURE_MCX_SPC_HAS_DCDC (1) -/* @brief Has SYS LDO */ -#define FSL_FEATURE_MCX_SPC_HAS_SYS_LDO (1) -/* @brief Has IOVDD_LVDF */ -#define FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD (1) -/* @brief Has COREVDD_HVDF */ -#define FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD (1) -/* @brief Has CORELDO_VDD_DS */ -#define FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS (1) -/* @brief Has LPBUFF_EN */ -#define FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT (1) -/* @brief Has COREVDD_IVS_EN */ -#define FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT (1) -/* @brief Has SWITCH_STATE */ -#define FSL_FEATURE_MCX_SPC_HAS_SWITCH_STATE_BIT (0) -/* @brief Has SRAMRETLDO */ -#define FSL_FEATURE_MCX_SPC_HAS_SRAMRETLDO_REG (0) -/* @brief Has CFG register */ -#define FSL_FEATURE_MCX_SPC_HAS_CFG_REG (0) -/* @brief Has SRAMLDO_DPD_ON */ -#define FSL_FEATURE_MCX_SPC_HAS_SRAMLDO_DPD_ON_BIT (0) -/* @brief Has CNTRL register */ -#define FSL_FEATURE_MCX_SPC_HAS_CNTRL_REG (1) -/* @brief Has DPDOWN_PULLDOWN_DISABLE */ -#define FSL_FEATURE_MCX_SPC_HAS_DPDOWN_PULLDOWN_DISABLE_BIT (1) -/* @brief Has BLEED_EN */ -#define FSL_FEATURE_MCX_SPC_HAS_DCDC_CFG_BLEED_EN (1) - -/* SYSCON module features */ - -/* @brief Flash page size in bytes */ -#define FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES (128) -/* @brief Flash sector size in bytes */ -#define FSL_FEATURE_SYSCON_FLASH_SECTOR_SIZE_BYTES (8192) -/* @brief Flash size in bytes */ -#define FSL_FEATURE_SYSCON_FLASH_SIZE_BYTES (1048576) -/* @brief Starter register discontinuous. */ -#define FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS (1) -/* @brief Support ROMAPI. */ -#define FSL_FEATURE_SYSCON_ROMAPI (1) -/* @brief Powerlib API is different with other series devices.. */ -#define FSL_FEATURE_POWERLIB_EXTEND (1) - -/* TRDC module features */ - -/* @brief Process master count. */ -#define FSL_FEATURE_TRDC_PROCESSOR_MASTER_COUNT (2) -/* @brief TRDC instance has PID configuration or not. */ -#define FSL_FEATURE_TRDC_INSTANCE_HAS_PID_CONFIGURATIONn(x) (0) -/* @brief TRDC instance has MBC. */ -#define FSL_FEATURE_TRDC_HAS_MBC (1) -/* @brief TRDC instance has MRC. */ -#define FSL_FEATURE_TRDC_HAS_MRC (0) -/* @brief TRDC instance has TRDC_CR. */ -#define FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG (0) -/* @brief TRDC instance has MDA_Wx_y_DFMT. */ -#define FSL_FEATURE_TRDC_HAS_DOMAIN_ASSIGNMENT (0) -/* @brief TRDC instance has TRDC_FDID. */ -#define FSL_FEATURE_TRDC_HAS_DOMAIN_ERROR (0) -/* @brief TRDC instance has TRDC_FLW_CTL. */ -#define FSL_FEATURE_TRDC_HAS_FLW (0) - -/* USBPHY module features */ - -/* @brief USBPHY contain DCD analog module */ -#define FSL_FEATURE_USBPHY_HAS_DCD_ANALOG (0) -/* @brief USBPHY has register TRIM_OVERRIDE_EN */ -#define FSL_FEATURE_USBPHY_HAS_TRIM_OVERRIDE_EN (1) -/* @brief USBPHY is 28FDSOI */ -#define FSL_FEATURE_USBPHY_28FDSOI (0) - -/* UTICK module features */ - -/* @brief UTICK does not support PD configure. */ -#define FSL_FEATURE_UTICK_HAS_NO_PDCFG (1) - -/* VBAT module features */ - -/* @brief Has STATUS register */ -#define FSL_FEATURE_MCX_VBAT_HAS_STATUS_REG (1) -/* @brief Has TAMPER register */ -#define FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG (1) -/* @brief Has BANDGAP register */ -#define FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER (1) -/* @brief Has LDOCTL register */ -#define FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG (1) -/* @brief Has OSCCTL register */ -#define FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG (1) -/* @brief Has SWICTL register */ -#define FSL_FEATURE_MCX_VBAT_HAS_SWICTL_REG (1) -/* @brief Has CLKMON register */ -#define FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG (0) -/* @brief Has FINE_AMP_GAIN bitfield in register OSCCTLA */ -#define FSL_FEATURE_MCX_VBAT_HAS_OSCCTLA_FINE_AMP_GAIN_BIT (0) - -/* WWDT module features */ - -/* @brief Has no RESET register. */ -#define FSL_FEATURE_WWDT_HAS_NO_RESET (1) -/* @brief WWDT does not support power down configure */ -#define FSL_FEATURE_WWDT_HAS_NO_PDCFG (1) - -#endif /* _MCXN236_FEATURES_H_ */ - diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/arm/startup_MCXN236.S b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/arm/startup_MCXN236.S deleted file mode 100644 index 2868c3a127e..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/arm/startup_MCXN236.S +++ /dev/null @@ -1,1858 +0,0 @@ -/* ------------------------------------------------------------------------- */ -/* @file: startup_MCXN236.s */ -/* @purpose: CMSIS Cortex-M33 Core Device Startup File */ -/* MCXN236 */ -/* @version: 1.0 */ -/* @date: 2023-10-1 */ -/* @build: b240409 */ -/* ------------------------------------------------------------------------- */ -/* */ -/* Copyright 1997-2016 Freescale Semiconductor, Inc. */ -/* Copyright 2016-2024 NXP */ -/* SPDX-License-Identifier: BSD-3-Clause */ -/*****************************************************************************/ -/* Version: GCC for ARM Embedded Processors */ -/*****************************************************************************/ - .syntax unified - .arch armv8-m.main - .eabi_attribute Tag_ABI_align_preserved, 1 /*8-byte alignment */ - - .section .isr_vector, "a" - .align 2 - .globl __Vectors -__Vectors: - .long Image$$ARM_LIB_STACK$$ZI$$Limit /* Top of Stack */ - .long Reset_Handler /* Reset Handler */ - .long NMI_Handler /* NMI Handler*/ - .long HardFault_Handler /* Hard Fault Handler*/ - .long MemManage_Handler /* MPU Fault Handler*/ - .long BusFault_Handler /* Bus Fault Handler*/ - .long UsageFault_Handler /* Usage Fault Handler*/ - .long SecureFault_Handler /* Secure Fault Handler*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long SVC_Handler /* SVCall Handler*/ - .long DebugMon_Handler /* Debug Monitor Handler*/ - .long 0 /* Reserved*/ - .long PendSV_Handler /* PendSV Handler*/ - .long SysTick_Handler /* SysTick Handler*/ - - /* External Interrupts*/ - .long OR_IRQHandler /* OR IRQ*/ - .long EDMA_0_CH0_IRQHandler /* eDMA_0_CH0 error or transfer complete*/ - .long EDMA_0_CH1_IRQHandler /* eDMA_0_CH1 error or transfer complete*/ - .long EDMA_0_CH2_IRQHandler /* eDMA_0_CH2 error or transfer complete*/ - .long EDMA_0_CH3_IRQHandler /* eDMA_0_CH3 error or transfer complete*/ - .long EDMA_0_CH4_IRQHandler /* eDMA_0_CH4 error or transfer complete*/ - .long EDMA_0_CH5_IRQHandler /* eDMA_0_CH5 error or transfer complete*/ - .long EDMA_0_CH6_IRQHandler /* eDMA_0_CH6 error or transfer complete*/ - .long EDMA_0_CH7_IRQHandler /* eDMA_0_CH7 error or transfer complete*/ - .long EDMA_0_CH8_IRQHandler /* eDMA_0_CH8 error or transfer complete*/ - .long EDMA_0_CH9_IRQHandler /* eDMA_0_CH9 error or transfer complete*/ - .long EDMA_0_CH10_IRQHandler /* eDMA_0_CH10 error or transfer complete*/ - .long EDMA_0_CH11_IRQHandler /* eDMA_0_CH11 error or transfer complete*/ - .long EDMA_0_CH12_IRQHandler /* eDMA_0_CH12 error or transfer complete*/ - .long EDMA_0_CH13_IRQHandler /* eDMA_0_CH13 error or transfer complete*/ - .long EDMA_0_CH14_IRQHandler /* eDMA_0_CH14 error or transfer complete*/ - .long EDMA_0_CH15_IRQHandler /* eDMA_0_CH15 error or transfer complete*/ - .long GPIO00_IRQHandler /* GPIO0 interrupt 0*/ - .long GPIO01_IRQHandler /* GPIO0 interrupt 1*/ - .long GPIO10_IRQHandler /* GPIO1 interrupt 0*/ - .long GPIO11_IRQHandler /* GPIO1 interrupt 1*/ - .long GPIO20_IRQHandler /* GPIO2 interrupt 0*/ - .long GPIO21_IRQHandler /* GPIO2 interrupt 1*/ - .long GPIO30_IRQHandler /* GPIO3 interrupt 0*/ - .long GPIO31_IRQHandler /* GPIO3 interrupt 1*/ - .long GPIO40_IRQHandler /* GPIO4 interrupt 0*/ - .long GPIO41_IRQHandler /* GPIO4 interrupt 1*/ - .long GPIO50_IRQHandler /* GPIO5 interrupt 0*/ - .long GPIO51_IRQHandler /* GPIO5 interrupt 1*/ - .long UTICK0_IRQHandler /* Micro-Tick Timer interrupt*/ - .long MRT0_IRQHandler /* Multi-Rate Timer interrupt*/ - .long CTIMER0_IRQHandler /* Standard counter/timer 0 interrupt*/ - .long CTIMER1_IRQHandler /* Standard counter/timer 1 interrupt*/ - .long Reserved49_IRQHandler /* Reserved interrupt*/ - .long CTIMER2_IRQHandler /* Standard counter/timer 2 interrupt*/ - .long LP_FLEXCOMM0_IRQHandler /* LP_FLEXCOMM0 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM1_IRQHandler /* LP_FLEXCOMM1 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM2_IRQHandler /* LP_FLEXCOMM2 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM3_IRQHandler /* LP_FLEXCOMM3 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM4_IRQHandler /* LP_FLEXCOMM4 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM5_IRQHandler /* LP_FLEXCOMM5 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM6_IRQHandler /* LP_FLEXCOMM6 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM7_IRQHandler /* LP_FLEXCOMM7 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long Reserved59_IRQHandler /* Reserved interrupt*/ - .long Reserved60_IRQHandler /* Reserved interrupt*/ - .long ADC0_IRQHandler /* Analog-to-Digital Converter 0 - General Purpose interrupt*/ - .long ADC1_IRQHandler /* Analog-to-Digital Converter 1 - General Purpose interrupt*/ - .long PINT0_IRQHandler /* Pin Interrupt Pattern Match Interrupt*/ - .long PDM_EVENT_IRQHandler /* Microphone Interface interrupt */ - .long Reserved65_IRQHandler /* Reserved interrupt*/ - .long Reserved66_IRQHandler /* Reserved interrupt*/ - .long USB0_DCD_IRQHandler /* Universal Serial Bus - Device Charge Detect interrupt*/ - .long RTC_IRQHandler /* RTC Subsystem interrupt (RTC interrupt or Wake timer interrupt)*/ - .long SMARTDMA_IRQHandler /* SmartDMA_IRQ*/ - .long Reserved70_IRQHandler /* Reserved interrupt*/ - .long CTIMER3_IRQHandler /* Standard counter/timer 3 interrupt*/ - .long CTIMER4_IRQHandler /* Standard counter/timer 4 interrupt*/ - .long OS_EVENT_IRQHandler /* OS event timer interrupt*/ - .long Reserved74_IRQHandler /* Reserved interrupt*/ - .long SAI0_IRQHandler /* Serial Audio Interface 0 interrupt*/ - .long SAI1_IRQHandler /* Serial Audio Interface 1 interrupt*/ - .long Reserved77_IRQHandler /* Reserved interrupt*/ - .long CAN0_IRQHandler /* Controller Area Network 0 interrupt*/ - .long CAN1_IRQHandler /* Controller Area Network 1 interrupt*/ - .long Reserved80_IRQHandler /* Reserved interrupt*/ - .long Reserved81_IRQHandler /* Reserved interrupt*/ - .long USB1_HS_PHY_IRQHandler /* USBHS DCD or USBHS Phy interrupt*/ - .long USB1_HS_IRQHandler /* USB High Speed OTG Controller interrupt */ - .long SEC_HYPERVISOR_CALL_IRQHandler /* AHB Secure Controller hypervisor call interrupt*/ - .long Reserved85_IRQHandler /* Reserved interrupt*/ - .long Reserved86_IRQHandler /* Reserved interrupt*/ - .long Freqme_IRQHandler /* Frequency Measurement interrupt*/ - .long SEC_VIO_IRQHandler /* Secure violation interrupt (Memory Block Checker interrupt or secure AHB matrix violation interrupt)*/ - .long ELS_IRQHandler /* ELS interrupt*/ - .long PKC_IRQHandler /* PKC interrupt*/ - .long PUF_IRQHandler /* Physical Unclonable Function interrupt*/ - .long Reserved92_IRQHandler /* Reserved interrupt*/ - .long EDMA_1_CH0_IRQHandler /* eDMA_1_CH0 error or transfer complete*/ - .long EDMA_1_CH1_IRQHandler /* eDMA_1_CH1 error or transfer complete*/ - .long EDMA_1_CH2_IRQHandler /* eDMA_1_CH2 error or transfer complete*/ - .long EDMA_1_CH3_IRQHandler /* eDMA_1_CH3 error or transfer complete*/ - .long EDMA_1_CH4_IRQHandler /* eDMA_1_CH4 error or transfer complete*/ - .long EDMA_1_CH5_IRQHandler /* eDMA_1_CH5 error or transfer complete*/ - .long EDMA_1_CH6_IRQHandler /* eDMA_1_CH6 error or transfer complete*/ - .long EDMA_1_CH7_IRQHandler /* eDMA_1_CH7 error or transfer complete*/ - .long Reserved101_IRQHandler /* Reserved interrupt*/ - .long Reserved102_IRQHandler /* Reserved interrupt*/ - .long Reserved103_IRQHandler /* Reserved interrupt*/ - .long Reserved104_IRQHandler /* Reserved interrupt*/ - .long Reserved105_IRQHandler /* Reserved interrupt*/ - .long Reserved106_IRQHandler /* Reserved interrupt*/ - .long Reserved107_IRQHandler /* Reserved interrupt*/ - .long Reserved108_IRQHandler /* Reserved interrupt*/ - .long CDOG0_IRQHandler /* Code Watchdog Timer 0 interrupt*/ - .long CDOG1_IRQHandler /* Code Watchdog Timer 1 interrupt*/ - .long I3C0_IRQHandler /* Improved Inter Integrated Circuit interrupt 0*/ - .long I3C1_IRQHandler /* Improved Inter Integrated Circuit interrupt 1*/ - .long Reserved113_IRQHandler /* Reserved interrupt*/ - .long GDET_IRQHandler /* Digital Glitch Detect 0 interrupt or Digital Glitch Detect 1 interrupt*/ - .long VBAT0_IRQHandler /* VBAT interrupt( VBAT interrupt or digital tamper interrupt)*/ - .long EWM0_IRQHandler /* External Watchdog Monitor interrupt*/ - .long Reserved117_IRQHandler /* Reserved interrupt*/ - .long Reserved118_IRQHandler /* Reserved interrupt*/ - .long Reserved119_IRQHandler /* Reserved interrupt*/ - .long Reserved120_IRQHandler /* Reserved interrupt*/ - .long FLEXIO_IRQHandler /* Flexible Input/Output interrupt*/ - .long Reserved122_IRQHandler /* Reserved interrupt*/ - .long Reserved123_IRQHandler /* Reserved interrupt*/ - .long Reserved124_IRQHandler /* Reserved interrupt*/ - .long HSCMP0_IRQHandler /* High-Speed comparator0 interrupt*/ - .long HSCMP1_IRQHandler /* High-Speed comparator1 interrupt*/ - .long Reserved127_IRQHandler /* Reserved interrupt*/ - .long FLEXPWM0_RELOAD_ERROR_IRQHandler /* FlexPWM0_reload_error interrupt*/ - .long FLEXPWM0_FAULT_IRQHandler /* FlexPWM0_fault interrupt*/ - .long FLEXPWM0_SUBMODULE0_IRQHandler /* FlexPWM0 Submodule 0 capture/compare/reload interrupt*/ - .long FLEXPWM0_SUBMODULE1_IRQHandler /* FlexPWM0 Submodule 1 capture/compare/reload interrupt*/ - .long FLEXPWM0_SUBMODULE2_IRQHandler /* FlexPWM0 Submodule 2 capture/compare/reload interrupt*/ - .long FLEXPWM0_SUBMODULE3_IRQHandler /* FlexPWM0 Submodule 3 capture/compare/reload interrupt*/ - .long FLEXPWM1_RELOAD_ERROR_IRQHandler /* FlexPWM1_reload_error interrupt*/ - .long FLEXPWM1_FAULT_IRQHandler /* FlexPWM1_fault interrupt*/ - .long FLEXPWM1_SUBMODULE0_IRQHandler /* FlexPWM1 Submodule 0 capture/compare/reload interrupt*/ - .long FLEXPWM1_SUBMODULE1_IRQHandler /* FlexPWM1 Submodule 1 capture/compare/reload interrupt*/ - .long FLEXPWM1_SUBMODULE2_IRQHandler /* FlexPWM1 Submodule 2 capture/compare/reload interrupt*/ - .long FLEXPWM1_SUBMODULE3_IRQHandler /* FlexPWM1 Submodule 3 capture/compare/reload interrupt*/ - .long QDC0_COMPARE_IRQHandler /* QDC0_Compare interrupt*/ - .long QDC0_HOME_IRQHandler /* QDC0_Home interrupt*/ - .long QDC0_WDG_SAB_IRQHandler /* QDC0_WDG_IRQ/SAB interrupt*/ - .long QDC0_IDX_IRQHandler /* QDC0_IDX interrupt*/ - .long QDC1_COMPARE_IRQHandler /* QDC1_Compare interrupt*/ - .long QDC1_HOME_IRQHandler /* QDC1_Home interrupt*/ - .long QDC1_WDG_SAB_IRQHandler /* QDC1_WDG_IRQ/SAB interrupt*/ - .long QDC1_IDX_IRQHandler /* QDC1_IDX interrupt*/ - .long ITRC0_IRQHandler /* Intrusion and Tamper Response Controller interrupt*/ - .long Reserved149_IRQHandler /* Reserved interrupt*/ - .long ELS_ERR_IRQHandler /* ELS error interrupt*/ - .long PKC_ERR_IRQHandler /* PKC error interrupt*/ - .long ERM_SINGLE_BIT_ERROR_IRQHandler /* ERM Single Bit error interrupt*/ - .long ERM_MULTI_BIT_ERROR_IRQHandler /* ERM Multi Bit error interrupt*/ - .long FMU0_IRQHandler /* Flash Management Unit interrupt*/ - .long Reserved155_IRQHandler /* Reserved interrupt*/ - .long Reserved156_IRQHandler /* Reserved interrupt*/ - .long Reserved157_IRQHandler /* Reserved interrupt*/ - .long Reserved158_IRQHandler /* Reserved interrupt*/ - .long LPTMR0_IRQHandler /* Low Power Timer 0 interrupt*/ - .long LPTMR1_IRQHandler /* Low Power Timer 1 interrupt*/ - .long SCG_IRQHandler /* System Clock Generator interrupt*/ - .long SPC_IRQHandler /* System Power Controller interrupt*/ - .long WUU_IRQHandler /* Wake Up Unit interrupt*/ - .long PORT_EFT_IRQHandler /* PORT0~5 EFT interrupt*/ - .long Reserved165_IRQHandler /* Reserved interrupt*/ - .long Reserved166_IRQHandler /* Reserved interrupt*/ - .long Reserved167_IRQHandler /* Reserved interrupt*/ - .long WWDT0_IRQHandler /* Windowed Watchdog Timer 0 interrupt*/ - .long WWDT1_IRQHandler /* Windowed Watchdog Timer 1 interrupt*/ - .long CMC0_IRQHandler /* Core Mode Controller interrupt*/ - .long Reserved171_IRQHandler /* Reserved interrupt*/ - - .size __Vectors, . - __Vectors - - .text - .thumb - -/* Reset Handler */ - - .thumb_func - .align 2 - .weak Reset_Handler - .type Reset_Handler, %function -Reset_Handler: - cpsid i /* Mask interrupts */ - .equ VTOR, 0xE000ED08 - ldr r0, =VTOR - ldr r1, =__Vectors - str r1, [r0] - ldr r2, [r1] - msr msp, r2 - ldr r0, =Image$$ARM_LIB_STACK$$ZI$$Base - msr msplim, r0 - ldr r0,=SystemInit - blx r0 - cpsie i /* Unmask interrupts */ - ldr r0,=__main - bx r0 - - .pool - .size Reset_Handler, . - Reset_Handler - - .align 1 - .thumb_func - .weak DefaultISR - .type DefaultISR, %function -DefaultISR: - b DefaultISR - .size DefaultISR, . - DefaultISR - - .align 1 - .thumb_func - .weak NMI_Handler - .type NMI_Handler, %function -NMI_Handler: - ldr r0,=NMI_Handler - bx r0 - .size NMI_Handler, . - NMI_Handler - - .align 1 - .thumb_func - .weak HardFault_Handler - .type HardFault_Handler, %function -HardFault_Handler: - ldr r0,=HardFault_Handler - bx r0 - .size HardFault_Handler, . - HardFault_Handler - - .align 1 - .thumb_func - .weak SVC_Handler - .type SVC_Handler, %function -SVC_Handler: - ldr r0,=SVC_Handler - bx r0 - .size SVC_Handler, . - SVC_Handler - - .align 1 - .thumb_func - .weak PendSV_Handler - .type PendSV_Handler, %function -PendSV_Handler: - ldr r0,=PendSV_Handler - bx r0 - .size PendSV_Handler, . - PendSV_Handler - - .align 1 - .thumb_func - .weak SysTick_Handler - .type SysTick_Handler, %function -SysTick_Handler: - ldr r0,=SysTick_Handler - bx r0 - .size SysTick_Handler, . - SysTick_Handler - - .align 1 - .thumb_func - .weak OR_IRQHandler - .type OR_IRQHandler, %function -OR_IRQHandler: - ldr r0,=OR_DriverIRQHandler - bx r0 - .size OR_IRQHandler, . - OR_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH0_IRQHandler - .type EDMA_0_CH0_IRQHandler, %function -EDMA_0_CH0_IRQHandler: - ldr r0,=EDMA_0_CH0_DriverIRQHandler - bx r0 - .size EDMA_0_CH0_IRQHandler, . - EDMA_0_CH0_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH1_IRQHandler - .type EDMA_0_CH1_IRQHandler, %function -EDMA_0_CH1_IRQHandler: - ldr r0,=EDMA_0_CH1_DriverIRQHandler - bx r0 - .size EDMA_0_CH1_IRQHandler, . - EDMA_0_CH1_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH2_IRQHandler - .type EDMA_0_CH2_IRQHandler, %function -EDMA_0_CH2_IRQHandler: - ldr r0,=EDMA_0_CH2_DriverIRQHandler - bx r0 - .size EDMA_0_CH2_IRQHandler, . - EDMA_0_CH2_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH3_IRQHandler - .type EDMA_0_CH3_IRQHandler, %function -EDMA_0_CH3_IRQHandler: - ldr r0,=EDMA_0_CH3_DriverIRQHandler - bx r0 - .size EDMA_0_CH3_IRQHandler, . - EDMA_0_CH3_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH4_IRQHandler - .type EDMA_0_CH4_IRQHandler, %function -EDMA_0_CH4_IRQHandler: - ldr r0,=EDMA_0_CH4_DriverIRQHandler - bx r0 - .size EDMA_0_CH4_IRQHandler, . - EDMA_0_CH4_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH5_IRQHandler - .type EDMA_0_CH5_IRQHandler, %function -EDMA_0_CH5_IRQHandler: - ldr r0,=EDMA_0_CH5_DriverIRQHandler - bx r0 - .size EDMA_0_CH5_IRQHandler, . - EDMA_0_CH5_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH6_IRQHandler - .type EDMA_0_CH6_IRQHandler, %function -EDMA_0_CH6_IRQHandler: - ldr r0,=EDMA_0_CH6_DriverIRQHandler - bx r0 - .size EDMA_0_CH6_IRQHandler, . - EDMA_0_CH6_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH7_IRQHandler - .type EDMA_0_CH7_IRQHandler, %function -EDMA_0_CH7_IRQHandler: - ldr r0,=EDMA_0_CH7_DriverIRQHandler - bx r0 - .size EDMA_0_CH7_IRQHandler, . - EDMA_0_CH7_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH8_IRQHandler - .type EDMA_0_CH8_IRQHandler, %function -EDMA_0_CH8_IRQHandler: - ldr r0,=EDMA_0_CH8_DriverIRQHandler - bx r0 - .size EDMA_0_CH8_IRQHandler, . - EDMA_0_CH8_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH9_IRQHandler - .type EDMA_0_CH9_IRQHandler, %function -EDMA_0_CH9_IRQHandler: - ldr r0,=EDMA_0_CH9_DriverIRQHandler - bx r0 - .size EDMA_0_CH9_IRQHandler, . - EDMA_0_CH9_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH10_IRQHandler - .type EDMA_0_CH10_IRQHandler, %function -EDMA_0_CH10_IRQHandler: - ldr r0,=EDMA_0_CH10_DriverIRQHandler - bx r0 - .size EDMA_0_CH10_IRQHandler, . - EDMA_0_CH10_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH11_IRQHandler - .type EDMA_0_CH11_IRQHandler, %function -EDMA_0_CH11_IRQHandler: - ldr r0,=EDMA_0_CH11_DriverIRQHandler - bx r0 - .size EDMA_0_CH11_IRQHandler, . - EDMA_0_CH11_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH12_IRQHandler - .type EDMA_0_CH12_IRQHandler, %function -EDMA_0_CH12_IRQHandler: - ldr r0,=EDMA_0_CH12_DriverIRQHandler - bx r0 - .size EDMA_0_CH12_IRQHandler, . - EDMA_0_CH12_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH13_IRQHandler - .type EDMA_0_CH13_IRQHandler, %function -EDMA_0_CH13_IRQHandler: - ldr r0,=EDMA_0_CH13_DriverIRQHandler - bx r0 - .size EDMA_0_CH13_IRQHandler, . - EDMA_0_CH13_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH14_IRQHandler - .type EDMA_0_CH14_IRQHandler, %function -EDMA_0_CH14_IRQHandler: - ldr r0,=EDMA_0_CH14_DriverIRQHandler - bx r0 - .size EDMA_0_CH14_IRQHandler, . - EDMA_0_CH14_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH15_IRQHandler - .type EDMA_0_CH15_IRQHandler, %function -EDMA_0_CH15_IRQHandler: - ldr r0,=EDMA_0_CH15_DriverIRQHandler - bx r0 - .size EDMA_0_CH15_IRQHandler, . - EDMA_0_CH15_IRQHandler - - .align 1 - .thumb_func - .weak GPIO00_IRQHandler - .type GPIO00_IRQHandler, %function -GPIO00_IRQHandler: - ldr r0,=GPIO00_DriverIRQHandler - bx r0 - .size GPIO00_IRQHandler, . - GPIO00_IRQHandler - - .align 1 - .thumb_func - .weak GPIO01_IRQHandler - .type GPIO01_IRQHandler, %function -GPIO01_IRQHandler: - ldr r0,=GPIO01_DriverIRQHandler - bx r0 - .size GPIO01_IRQHandler, . - GPIO01_IRQHandler - - .align 1 - .thumb_func - .weak GPIO10_IRQHandler - .type GPIO10_IRQHandler, %function -GPIO10_IRQHandler: - ldr r0,=GPIO10_DriverIRQHandler - bx r0 - .size GPIO10_IRQHandler, . - GPIO10_IRQHandler - - .align 1 - .thumb_func - .weak GPIO11_IRQHandler - .type GPIO11_IRQHandler, %function -GPIO11_IRQHandler: - ldr r0,=GPIO11_DriverIRQHandler - bx r0 - .size GPIO11_IRQHandler, . - GPIO11_IRQHandler - - .align 1 - .thumb_func - .weak GPIO20_IRQHandler - .type GPIO20_IRQHandler, %function -GPIO20_IRQHandler: - ldr r0,=GPIO20_DriverIRQHandler - bx r0 - .size GPIO20_IRQHandler, . - GPIO20_IRQHandler - - .align 1 - .thumb_func - .weak GPIO21_IRQHandler - .type GPIO21_IRQHandler, %function -GPIO21_IRQHandler: - ldr r0,=GPIO21_DriverIRQHandler - bx r0 - .size GPIO21_IRQHandler, . - GPIO21_IRQHandler - - .align 1 - .thumb_func - .weak GPIO30_IRQHandler - .type GPIO30_IRQHandler, %function -GPIO30_IRQHandler: - ldr r0,=GPIO30_DriverIRQHandler - bx r0 - .size GPIO30_IRQHandler, . - GPIO30_IRQHandler - - .align 1 - .thumb_func - .weak GPIO31_IRQHandler - .type GPIO31_IRQHandler, %function -GPIO31_IRQHandler: - ldr r0,=GPIO31_DriverIRQHandler - bx r0 - .size GPIO31_IRQHandler, . - GPIO31_IRQHandler - - .align 1 - .thumb_func - .weak GPIO40_IRQHandler - .type GPIO40_IRQHandler, %function -GPIO40_IRQHandler: - ldr r0,=GPIO40_DriverIRQHandler - bx r0 - .size GPIO40_IRQHandler, . - GPIO40_IRQHandler - - .align 1 - .thumb_func - .weak GPIO41_IRQHandler - .type GPIO41_IRQHandler, %function -GPIO41_IRQHandler: - ldr r0,=GPIO41_DriverIRQHandler - bx r0 - .size GPIO41_IRQHandler, . - GPIO41_IRQHandler - - .align 1 - .thumb_func - .weak GPIO50_IRQHandler - .type GPIO50_IRQHandler, %function -GPIO50_IRQHandler: - ldr r0,=GPIO50_DriverIRQHandler - bx r0 - .size GPIO50_IRQHandler, . - GPIO50_IRQHandler - - .align 1 - .thumb_func - .weak GPIO51_IRQHandler - .type GPIO51_IRQHandler, %function -GPIO51_IRQHandler: - ldr r0,=GPIO51_DriverIRQHandler - bx r0 - .size GPIO51_IRQHandler, . - GPIO51_IRQHandler - - .align 1 - .thumb_func - .weak UTICK0_IRQHandler - .type UTICK0_IRQHandler, %function -UTICK0_IRQHandler: - ldr r0,=UTICK0_DriverIRQHandler - bx r0 - .size UTICK0_IRQHandler, . - UTICK0_IRQHandler - - .align 1 - .thumb_func - .weak MRT0_IRQHandler - .type MRT0_IRQHandler, %function -MRT0_IRQHandler: - ldr r0,=MRT0_DriverIRQHandler - bx r0 - .size MRT0_IRQHandler, . - MRT0_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER0_IRQHandler - .type CTIMER0_IRQHandler, %function -CTIMER0_IRQHandler: - ldr r0,=CTIMER0_DriverIRQHandler - bx r0 - .size CTIMER0_IRQHandler, . - CTIMER0_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER1_IRQHandler - .type CTIMER1_IRQHandler, %function -CTIMER1_IRQHandler: - ldr r0,=CTIMER1_DriverIRQHandler - bx r0 - .size CTIMER1_IRQHandler, . - CTIMER1_IRQHandler - - .align 1 - .thumb_func - .weak Reserved49_IRQHandler - .type Reserved49_IRQHandler, %function -Reserved49_IRQHandler: - ldr r0,=Reserved49_DriverIRQHandler - bx r0 - .size Reserved49_IRQHandler, . - Reserved49_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER2_IRQHandler - .type CTIMER2_IRQHandler, %function -CTIMER2_IRQHandler: - ldr r0,=CTIMER2_DriverIRQHandler - bx r0 - .size CTIMER2_IRQHandler, . - CTIMER2_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM0_IRQHandler - .type LP_FLEXCOMM0_IRQHandler, %function -LP_FLEXCOMM0_IRQHandler: - ldr r0,=LP_FLEXCOMM0_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM0_IRQHandler, . - LP_FLEXCOMM0_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM1_IRQHandler - .type LP_FLEXCOMM1_IRQHandler, %function -LP_FLEXCOMM1_IRQHandler: - ldr r0,=LP_FLEXCOMM1_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM1_IRQHandler, . - LP_FLEXCOMM1_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM2_IRQHandler - .type LP_FLEXCOMM2_IRQHandler, %function -LP_FLEXCOMM2_IRQHandler: - ldr r0,=LP_FLEXCOMM2_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM2_IRQHandler, . - LP_FLEXCOMM2_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM3_IRQHandler - .type LP_FLEXCOMM3_IRQHandler, %function -LP_FLEXCOMM3_IRQHandler: - ldr r0,=LP_FLEXCOMM3_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM3_IRQHandler, . - LP_FLEXCOMM3_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM4_IRQHandler - .type LP_FLEXCOMM4_IRQHandler, %function -LP_FLEXCOMM4_IRQHandler: - ldr r0,=LP_FLEXCOMM4_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM4_IRQHandler, . - LP_FLEXCOMM4_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM5_IRQHandler - .type LP_FLEXCOMM5_IRQHandler, %function -LP_FLEXCOMM5_IRQHandler: - ldr r0,=LP_FLEXCOMM5_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM5_IRQHandler, . - LP_FLEXCOMM5_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM6_IRQHandler - .type LP_FLEXCOMM6_IRQHandler, %function -LP_FLEXCOMM6_IRQHandler: - ldr r0,=LP_FLEXCOMM6_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM6_IRQHandler, . - LP_FLEXCOMM6_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM7_IRQHandler - .type LP_FLEXCOMM7_IRQHandler, %function -LP_FLEXCOMM7_IRQHandler: - ldr r0,=LP_FLEXCOMM7_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM7_IRQHandler, . - LP_FLEXCOMM7_IRQHandler - - .align 1 - .thumb_func - .weak Reserved59_IRQHandler - .type Reserved59_IRQHandler, %function -Reserved59_IRQHandler: - ldr r0,=Reserved59_DriverIRQHandler - bx r0 - .size Reserved59_IRQHandler, . - Reserved59_IRQHandler - - .align 1 - .thumb_func - .weak Reserved60_IRQHandler - .type Reserved60_IRQHandler, %function -Reserved60_IRQHandler: - ldr r0,=Reserved60_DriverIRQHandler - bx r0 - .size Reserved60_IRQHandler, . - Reserved60_IRQHandler - - .align 1 - .thumb_func - .weak ADC0_IRQHandler - .type ADC0_IRQHandler, %function -ADC0_IRQHandler: - ldr r0,=ADC0_DriverIRQHandler - bx r0 - .size ADC0_IRQHandler, . - ADC0_IRQHandler - - .align 1 - .thumb_func - .weak ADC1_IRQHandler - .type ADC1_IRQHandler, %function -ADC1_IRQHandler: - ldr r0,=ADC1_DriverIRQHandler - bx r0 - .size ADC1_IRQHandler, . - ADC1_IRQHandler - - .align 1 - .thumb_func - .weak PINT0_IRQHandler - .type PINT0_IRQHandler, %function -PINT0_IRQHandler: - ldr r0,=PINT0_DriverIRQHandler - bx r0 - .size PINT0_IRQHandler, . - PINT0_IRQHandler - - .align 1 - .thumb_func - .weak PDM_EVENT_IRQHandler - .type PDM_EVENT_IRQHandler, %function -PDM_EVENT_IRQHandler: - ldr r0,=PDM_EVENT_DriverIRQHandler - bx r0 - .size PDM_EVENT_IRQHandler, . - PDM_EVENT_IRQHandler - - .align 1 - .thumb_func - .weak Reserved65_IRQHandler - .type Reserved65_IRQHandler, %function -Reserved65_IRQHandler: - ldr r0,=Reserved65_DriverIRQHandler - bx r0 - .size Reserved65_IRQHandler, . - Reserved65_IRQHandler - - .align 1 - .thumb_func - .weak Reserved66_IRQHandler - .type Reserved66_IRQHandler, %function -Reserved66_IRQHandler: - ldr r0,=Reserved66_DriverIRQHandler - bx r0 - .size Reserved66_IRQHandler, . - Reserved66_IRQHandler - - .align 1 - .thumb_func - .weak USB0_DCD_IRQHandler - .type USB0_DCD_IRQHandler, %function -USB0_DCD_IRQHandler: - ldr r0,=USB0_DCD_DriverIRQHandler - bx r0 - .size USB0_DCD_IRQHandler, . - USB0_DCD_IRQHandler - - .align 1 - .thumb_func - .weak RTC_IRQHandler - .type RTC_IRQHandler, %function -RTC_IRQHandler: - ldr r0,=RTC_DriverIRQHandler - bx r0 - .size RTC_IRQHandler, . - RTC_IRQHandler - - .align 1 - .thumb_func - .weak SMARTDMA_IRQHandler - .type SMARTDMA_IRQHandler, %function -SMARTDMA_IRQHandler: - ldr r0,=SMARTDMA_DriverIRQHandler - bx r0 - .size SMARTDMA_IRQHandler, . - SMARTDMA_IRQHandler - - .align 1 - .thumb_func - .weak Reserved70_IRQHandler - .type Reserved70_IRQHandler, %function -Reserved70_IRQHandler: - ldr r0,=Reserved70_DriverIRQHandler - bx r0 - .size Reserved70_IRQHandler, . - Reserved70_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER3_IRQHandler - .type CTIMER3_IRQHandler, %function -CTIMER3_IRQHandler: - ldr r0,=CTIMER3_DriverIRQHandler - bx r0 - .size CTIMER3_IRQHandler, . - CTIMER3_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER4_IRQHandler - .type CTIMER4_IRQHandler, %function -CTIMER4_IRQHandler: - ldr r0,=CTIMER4_DriverIRQHandler - bx r0 - .size CTIMER4_IRQHandler, . - CTIMER4_IRQHandler - - .align 1 - .thumb_func - .weak OS_EVENT_IRQHandler - .type OS_EVENT_IRQHandler, %function -OS_EVENT_IRQHandler: - ldr r0,=OS_EVENT_DriverIRQHandler - bx r0 - .size OS_EVENT_IRQHandler, . - OS_EVENT_IRQHandler - - .align 1 - .thumb_func - .weak Reserved74_IRQHandler - .type Reserved74_IRQHandler, %function -Reserved74_IRQHandler: - ldr r0,=Reserved74_DriverIRQHandler - bx r0 - .size Reserved74_IRQHandler, . - Reserved74_IRQHandler - - .align 1 - .thumb_func - .weak SAI0_IRQHandler - .type SAI0_IRQHandler, %function -SAI0_IRQHandler: - ldr r0,=SAI0_DriverIRQHandler - bx r0 - .size SAI0_IRQHandler, . - SAI0_IRQHandler - - .align 1 - .thumb_func - .weak SAI1_IRQHandler - .type SAI1_IRQHandler, %function -SAI1_IRQHandler: - ldr r0,=SAI1_DriverIRQHandler - bx r0 - .size SAI1_IRQHandler, . - SAI1_IRQHandler - - .align 1 - .thumb_func - .weak Reserved77_IRQHandler - .type Reserved77_IRQHandler, %function -Reserved77_IRQHandler: - ldr r0,=Reserved77_DriverIRQHandler - bx r0 - .size Reserved77_IRQHandler, . - Reserved77_IRQHandler - - .align 1 - .thumb_func - .weak CAN0_IRQHandler - .type CAN0_IRQHandler, %function -CAN0_IRQHandler: - ldr r0,=CAN0_DriverIRQHandler - bx r0 - .size CAN0_IRQHandler, . - CAN0_IRQHandler - - .align 1 - .thumb_func - .weak CAN1_IRQHandler - .type CAN1_IRQHandler, %function -CAN1_IRQHandler: - ldr r0,=CAN1_DriverIRQHandler - bx r0 - .size CAN1_IRQHandler, . - CAN1_IRQHandler - - .align 1 - .thumb_func - .weak Reserved80_IRQHandler - .type Reserved80_IRQHandler, %function -Reserved80_IRQHandler: - ldr r0,=Reserved80_DriverIRQHandler - bx r0 - .size Reserved80_IRQHandler, . - Reserved80_IRQHandler - - .align 1 - .thumb_func - .weak Reserved81_IRQHandler - .type Reserved81_IRQHandler, %function -Reserved81_IRQHandler: - ldr r0,=Reserved81_DriverIRQHandler - bx r0 - .size Reserved81_IRQHandler, . - Reserved81_IRQHandler - - .align 1 - .thumb_func - .weak USB1_HS_PHY_IRQHandler - .type USB1_HS_PHY_IRQHandler, %function -USB1_HS_PHY_IRQHandler: - ldr r0,=USB1_HS_PHY_DriverIRQHandler - bx r0 - .size USB1_HS_PHY_IRQHandler, . - USB1_HS_PHY_IRQHandler - - .align 1 - .thumb_func - .weak USB1_HS_IRQHandler - .type USB1_HS_IRQHandler, %function -USB1_HS_IRQHandler: - ldr r0,=USB1_HS_DriverIRQHandler - bx r0 - .size USB1_HS_IRQHandler, . - USB1_HS_IRQHandler - - .align 1 - .thumb_func - .weak SEC_HYPERVISOR_CALL_IRQHandler - .type SEC_HYPERVISOR_CALL_IRQHandler, %function -SEC_HYPERVISOR_CALL_IRQHandler: - ldr r0,=SEC_HYPERVISOR_CALL_DriverIRQHandler - bx r0 - .size SEC_HYPERVISOR_CALL_IRQHandler, . - SEC_HYPERVISOR_CALL_IRQHandler - - .align 1 - .thumb_func - .weak Reserved85_IRQHandler - .type Reserved85_IRQHandler, %function -Reserved85_IRQHandler: - ldr r0,=Reserved85_DriverIRQHandler - bx r0 - .size Reserved85_IRQHandler, . - Reserved85_IRQHandler - - .align 1 - .thumb_func - .weak Reserved86_IRQHandler - .type Reserved86_IRQHandler, %function -Reserved86_IRQHandler: - ldr r0,=Reserved86_DriverIRQHandler - bx r0 - .size Reserved86_IRQHandler, . - Reserved86_IRQHandler - - .align 1 - .thumb_func - .weak Freqme_IRQHandler - .type Freqme_IRQHandler, %function -Freqme_IRQHandler: - ldr r0,=Freqme_DriverIRQHandler - bx r0 - .size Freqme_IRQHandler, . - Freqme_IRQHandler - - .align 1 - .thumb_func - .weak SEC_VIO_IRQHandler - .type SEC_VIO_IRQHandler, %function -SEC_VIO_IRQHandler: - ldr r0,=SEC_VIO_DriverIRQHandler - bx r0 - .size SEC_VIO_IRQHandler, . - SEC_VIO_IRQHandler - - .align 1 - .thumb_func - .weak ELS_IRQHandler - .type ELS_IRQHandler, %function -ELS_IRQHandler: - ldr r0,=ELS_DriverIRQHandler - bx r0 - .size ELS_IRQHandler, . - ELS_IRQHandler - - .align 1 - .thumb_func - .weak PKC_IRQHandler - .type PKC_IRQHandler, %function -PKC_IRQHandler: - ldr r0,=PKC_DriverIRQHandler - bx r0 - .size PKC_IRQHandler, . - PKC_IRQHandler - - .align 1 - .thumb_func - .weak PUF_IRQHandler - .type PUF_IRQHandler, %function -PUF_IRQHandler: - ldr r0,=PUF_DriverIRQHandler - bx r0 - .size PUF_IRQHandler, . - PUF_IRQHandler - - .align 1 - .thumb_func - .weak Reserved92_IRQHandler - .type Reserved92_IRQHandler, %function -Reserved92_IRQHandler: - ldr r0,=Reserved92_DriverIRQHandler - bx r0 - .size Reserved92_IRQHandler, . - Reserved92_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH0_IRQHandler - .type EDMA_1_CH0_IRQHandler, %function -EDMA_1_CH0_IRQHandler: - ldr r0,=EDMA_1_CH0_DriverIRQHandler - bx r0 - .size EDMA_1_CH0_IRQHandler, . - EDMA_1_CH0_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH1_IRQHandler - .type EDMA_1_CH1_IRQHandler, %function -EDMA_1_CH1_IRQHandler: - ldr r0,=EDMA_1_CH1_DriverIRQHandler - bx r0 - .size EDMA_1_CH1_IRQHandler, . - EDMA_1_CH1_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH2_IRQHandler - .type EDMA_1_CH2_IRQHandler, %function -EDMA_1_CH2_IRQHandler: - ldr r0,=EDMA_1_CH2_DriverIRQHandler - bx r0 - .size EDMA_1_CH2_IRQHandler, . - EDMA_1_CH2_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH3_IRQHandler - .type EDMA_1_CH3_IRQHandler, %function -EDMA_1_CH3_IRQHandler: - ldr r0,=EDMA_1_CH3_DriverIRQHandler - bx r0 - .size EDMA_1_CH3_IRQHandler, . - EDMA_1_CH3_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH4_IRQHandler - .type EDMA_1_CH4_IRQHandler, %function -EDMA_1_CH4_IRQHandler: - ldr r0,=EDMA_1_CH4_DriverIRQHandler - bx r0 - .size EDMA_1_CH4_IRQHandler, . - EDMA_1_CH4_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH5_IRQHandler - .type EDMA_1_CH5_IRQHandler, %function -EDMA_1_CH5_IRQHandler: - ldr r0,=EDMA_1_CH5_DriverIRQHandler - bx r0 - .size EDMA_1_CH5_IRQHandler, . - EDMA_1_CH5_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH6_IRQHandler - .type EDMA_1_CH6_IRQHandler, %function -EDMA_1_CH6_IRQHandler: - ldr r0,=EDMA_1_CH6_DriverIRQHandler - bx r0 - .size EDMA_1_CH6_IRQHandler, . - EDMA_1_CH6_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH7_IRQHandler - .type EDMA_1_CH7_IRQHandler, %function -EDMA_1_CH7_IRQHandler: - ldr r0,=EDMA_1_CH7_DriverIRQHandler - bx r0 - .size EDMA_1_CH7_IRQHandler, . - EDMA_1_CH7_IRQHandler - - .align 1 - .thumb_func - .weak Reserved101_IRQHandler - .type Reserved101_IRQHandler, %function -Reserved101_IRQHandler: - ldr r0,=Reserved101_DriverIRQHandler - bx r0 - .size Reserved101_IRQHandler, . - Reserved101_IRQHandler - - .align 1 - .thumb_func - .weak Reserved102_IRQHandler - .type Reserved102_IRQHandler, %function -Reserved102_IRQHandler: - ldr r0,=Reserved102_DriverIRQHandler - bx r0 - .size Reserved102_IRQHandler, . - Reserved102_IRQHandler - - .align 1 - .thumb_func - .weak Reserved103_IRQHandler - .type Reserved103_IRQHandler, %function -Reserved103_IRQHandler: - ldr r0,=Reserved103_DriverIRQHandler - bx r0 - .size Reserved103_IRQHandler, . - Reserved103_IRQHandler - - .align 1 - .thumb_func - .weak Reserved104_IRQHandler - .type Reserved104_IRQHandler, %function -Reserved104_IRQHandler: - ldr r0,=Reserved104_DriverIRQHandler - bx r0 - .size Reserved104_IRQHandler, . - Reserved104_IRQHandler - - .align 1 - .thumb_func - .weak Reserved105_IRQHandler - .type Reserved105_IRQHandler, %function -Reserved105_IRQHandler: - ldr r0,=Reserved105_DriverIRQHandler - bx r0 - .size Reserved105_IRQHandler, . - Reserved105_IRQHandler - - .align 1 - .thumb_func - .weak Reserved106_IRQHandler - .type Reserved106_IRQHandler, %function -Reserved106_IRQHandler: - ldr r0,=Reserved106_DriverIRQHandler - bx r0 - .size Reserved106_IRQHandler, . - Reserved106_IRQHandler - - .align 1 - .thumb_func - .weak Reserved107_IRQHandler - .type Reserved107_IRQHandler, %function -Reserved107_IRQHandler: - ldr r0,=Reserved107_DriverIRQHandler - bx r0 - .size Reserved107_IRQHandler, . - Reserved107_IRQHandler - - .align 1 - .thumb_func - .weak Reserved108_IRQHandler - .type Reserved108_IRQHandler, %function -Reserved108_IRQHandler: - ldr r0,=Reserved108_DriverIRQHandler - bx r0 - .size Reserved108_IRQHandler, . - Reserved108_IRQHandler - - .align 1 - .thumb_func - .weak CDOG0_IRQHandler - .type CDOG0_IRQHandler, %function -CDOG0_IRQHandler: - ldr r0,=CDOG0_DriverIRQHandler - bx r0 - .size CDOG0_IRQHandler, . - CDOG0_IRQHandler - - .align 1 - .thumb_func - .weak CDOG1_IRQHandler - .type CDOG1_IRQHandler, %function -CDOG1_IRQHandler: - ldr r0,=CDOG1_DriverIRQHandler - bx r0 - .size CDOG1_IRQHandler, . - CDOG1_IRQHandler - - .align 1 - .thumb_func - .weak I3C0_IRQHandler - .type I3C0_IRQHandler, %function -I3C0_IRQHandler: - ldr r0,=I3C0_DriverIRQHandler - bx r0 - .size I3C0_IRQHandler, . - I3C0_IRQHandler - - .align 1 - .thumb_func - .weak I3C1_IRQHandler - .type I3C1_IRQHandler, %function -I3C1_IRQHandler: - ldr r0,=I3C1_DriverIRQHandler - bx r0 - .size I3C1_IRQHandler, . - I3C1_IRQHandler - - .align 1 - .thumb_func - .weak Reserved113_IRQHandler - .type Reserved113_IRQHandler, %function -Reserved113_IRQHandler: - ldr r0,=Reserved113_DriverIRQHandler - bx r0 - .size Reserved113_IRQHandler, . - Reserved113_IRQHandler - - .align 1 - .thumb_func - .weak GDET_IRQHandler - .type GDET_IRQHandler, %function -GDET_IRQHandler: - ldr r0,=GDET_DriverIRQHandler - bx r0 - .size GDET_IRQHandler, . - GDET_IRQHandler - - .align 1 - .thumb_func - .weak VBAT0_IRQHandler - .type VBAT0_IRQHandler, %function -VBAT0_IRQHandler: - ldr r0,=VBAT0_DriverIRQHandler - bx r0 - .size VBAT0_IRQHandler, . - VBAT0_IRQHandler - - .align 1 - .thumb_func - .weak EWM0_IRQHandler - .type EWM0_IRQHandler, %function -EWM0_IRQHandler: - ldr r0,=EWM0_DriverIRQHandler - bx r0 - .size EWM0_IRQHandler, . - EWM0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved117_IRQHandler - .type Reserved117_IRQHandler, %function -Reserved117_IRQHandler: - ldr r0,=Reserved117_DriverIRQHandler - bx r0 - .size Reserved117_IRQHandler, . - Reserved117_IRQHandler - - .align 1 - .thumb_func - .weak Reserved118_IRQHandler - .type Reserved118_IRQHandler, %function -Reserved118_IRQHandler: - ldr r0,=Reserved118_DriverIRQHandler - bx r0 - .size Reserved118_IRQHandler, . - Reserved118_IRQHandler - - .align 1 - .thumb_func - .weak Reserved119_IRQHandler - .type Reserved119_IRQHandler, %function -Reserved119_IRQHandler: - ldr r0,=Reserved119_DriverIRQHandler - bx r0 - .size Reserved119_IRQHandler, . - Reserved119_IRQHandler - - .align 1 - .thumb_func - .weak Reserved120_IRQHandler - .type Reserved120_IRQHandler, %function -Reserved120_IRQHandler: - ldr r0,=Reserved120_DriverIRQHandler - bx r0 - .size Reserved120_IRQHandler, . - Reserved120_IRQHandler - - .align 1 - .thumb_func - .weak FLEXIO_IRQHandler - .type FLEXIO_IRQHandler, %function -FLEXIO_IRQHandler: - ldr r0,=FLEXIO_DriverIRQHandler - bx r0 - .size FLEXIO_IRQHandler, . - FLEXIO_IRQHandler - - .align 1 - .thumb_func - .weak Reserved122_IRQHandler - .type Reserved122_IRQHandler, %function -Reserved122_IRQHandler: - ldr r0,=Reserved122_DriverIRQHandler - bx r0 - .size Reserved122_IRQHandler, . - Reserved122_IRQHandler - - .align 1 - .thumb_func - .weak Reserved123_IRQHandler - .type Reserved123_IRQHandler, %function -Reserved123_IRQHandler: - ldr r0,=Reserved123_DriverIRQHandler - bx r0 - .size Reserved123_IRQHandler, . - Reserved123_IRQHandler - - .align 1 - .thumb_func - .weak Reserved124_IRQHandler - .type Reserved124_IRQHandler, %function -Reserved124_IRQHandler: - ldr r0,=Reserved124_DriverIRQHandler - bx r0 - .size Reserved124_IRQHandler, . - Reserved124_IRQHandler - - .align 1 - .thumb_func - .weak HSCMP0_IRQHandler - .type HSCMP0_IRQHandler, %function -HSCMP0_IRQHandler: - ldr r0,=HSCMP0_DriverIRQHandler - bx r0 - .size HSCMP0_IRQHandler, . - HSCMP0_IRQHandler - - .align 1 - .thumb_func - .weak HSCMP1_IRQHandler - .type HSCMP1_IRQHandler, %function -HSCMP1_IRQHandler: - ldr r0,=HSCMP1_DriverIRQHandler - bx r0 - .size HSCMP1_IRQHandler, . - HSCMP1_IRQHandler - - .align 1 - .thumb_func - .weak Reserved127_IRQHandler - .type Reserved127_IRQHandler, %function -Reserved127_IRQHandler: - ldr r0,=Reserved127_DriverIRQHandler - bx r0 - .size Reserved127_IRQHandler, . - Reserved127_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_RELOAD_ERROR_IRQHandler - .type FLEXPWM0_RELOAD_ERROR_IRQHandler, %function -FLEXPWM0_RELOAD_ERROR_IRQHandler: - ldr r0,=FLEXPWM0_RELOAD_ERROR_DriverIRQHandler - bx r0 - .size FLEXPWM0_RELOAD_ERROR_IRQHandler, . - FLEXPWM0_RELOAD_ERROR_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_FAULT_IRQHandler - .type FLEXPWM0_FAULT_IRQHandler, %function -FLEXPWM0_FAULT_IRQHandler: - ldr r0,=FLEXPWM0_FAULT_DriverIRQHandler - bx r0 - .size FLEXPWM0_FAULT_IRQHandler, . - FLEXPWM0_FAULT_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE0_IRQHandler - .type FLEXPWM0_SUBMODULE0_IRQHandler, %function -FLEXPWM0_SUBMODULE0_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE0_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE0_IRQHandler, . - FLEXPWM0_SUBMODULE0_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE1_IRQHandler - .type FLEXPWM0_SUBMODULE1_IRQHandler, %function -FLEXPWM0_SUBMODULE1_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE1_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE1_IRQHandler, . - FLEXPWM0_SUBMODULE1_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE2_IRQHandler - .type FLEXPWM0_SUBMODULE2_IRQHandler, %function -FLEXPWM0_SUBMODULE2_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE2_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE2_IRQHandler, . - FLEXPWM0_SUBMODULE2_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE3_IRQHandler - .type FLEXPWM0_SUBMODULE3_IRQHandler, %function -FLEXPWM0_SUBMODULE3_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE3_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE3_IRQHandler, . - FLEXPWM0_SUBMODULE3_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_RELOAD_ERROR_IRQHandler - .type FLEXPWM1_RELOAD_ERROR_IRQHandler, %function -FLEXPWM1_RELOAD_ERROR_IRQHandler: - ldr r0,=FLEXPWM1_RELOAD_ERROR_DriverIRQHandler - bx r0 - .size FLEXPWM1_RELOAD_ERROR_IRQHandler, . - FLEXPWM1_RELOAD_ERROR_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_FAULT_IRQHandler - .type FLEXPWM1_FAULT_IRQHandler, %function -FLEXPWM1_FAULT_IRQHandler: - ldr r0,=FLEXPWM1_FAULT_DriverIRQHandler - bx r0 - .size FLEXPWM1_FAULT_IRQHandler, . - FLEXPWM1_FAULT_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_SUBMODULE0_IRQHandler - .type FLEXPWM1_SUBMODULE0_IRQHandler, %function -FLEXPWM1_SUBMODULE0_IRQHandler: - ldr r0,=FLEXPWM1_SUBMODULE0_DriverIRQHandler - bx r0 - .size FLEXPWM1_SUBMODULE0_IRQHandler, . - FLEXPWM1_SUBMODULE0_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_SUBMODULE1_IRQHandler - .type FLEXPWM1_SUBMODULE1_IRQHandler, %function -FLEXPWM1_SUBMODULE1_IRQHandler: - ldr r0,=FLEXPWM1_SUBMODULE1_DriverIRQHandler - bx r0 - .size FLEXPWM1_SUBMODULE1_IRQHandler, . - FLEXPWM1_SUBMODULE1_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_SUBMODULE2_IRQHandler - .type FLEXPWM1_SUBMODULE2_IRQHandler, %function -FLEXPWM1_SUBMODULE2_IRQHandler: - ldr r0,=FLEXPWM1_SUBMODULE2_DriverIRQHandler - bx r0 - .size FLEXPWM1_SUBMODULE2_IRQHandler, . - FLEXPWM1_SUBMODULE2_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_SUBMODULE3_IRQHandler - .type FLEXPWM1_SUBMODULE3_IRQHandler, %function -FLEXPWM1_SUBMODULE3_IRQHandler: - ldr r0,=FLEXPWM1_SUBMODULE3_DriverIRQHandler - bx r0 - .size FLEXPWM1_SUBMODULE3_IRQHandler, . - FLEXPWM1_SUBMODULE3_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_COMPARE_IRQHandler - .type QDC0_COMPARE_IRQHandler, %function -QDC0_COMPARE_IRQHandler: - ldr r0,=QDC0_COMPARE_DriverIRQHandler - bx r0 - .size QDC0_COMPARE_IRQHandler, . - QDC0_COMPARE_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_HOME_IRQHandler - .type QDC0_HOME_IRQHandler, %function -QDC0_HOME_IRQHandler: - ldr r0,=QDC0_HOME_DriverIRQHandler - bx r0 - .size QDC0_HOME_IRQHandler, . - QDC0_HOME_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_WDG_SAB_IRQHandler - .type QDC0_WDG_SAB_IRQHandler, %function -QDC0_WDG_SAB_IRQHandler: - ldr r0,=QDC0_WDG_SAB_DriverIRQHandler - bx r0 - .size QDC0_WDG_SAB_IRQHandler, . - QDC0_WDG_SAB_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_IDX_IRQHandler - .type QDC0_IDX_IRQHandler, %function -QDC0_IDX_IRQHandler: - ldr r0,=QDC0_IDX_DriverIRQHandler - bx r0 - .size QDC0_IDX_IRQHandler, . - QDC0_IDX_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_COMPARE_IRQHandler - .type QDC1_COMPARE_IRQHandler, %function -QDC1_COMPARE_IRQHandler: - ldr r0,=QDC1_COMPARE_DriverIRQHandler - bx r0 - .size QDC1_COMPARE_IRQHandler, . - QDC1_COMPARE_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_HOME_IRQHandler - .type QDC1_HOME_IRQHandler, %function -QDC1_HOME_IRQHandler: - ldr r0,=QDC1_HOME_DriverIRQHandler - bx r0 - .size QDC1_HOME_IRQHandler, . - QDC1_HOME_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_WDG_SAB_IRQHandler - .type QDC1_WDG_SAB_IRQHandler, %function -QDC1_WDG_SAB_IRQHandler: - ldr r0,=QDC1_WDG_SAB_DriverIRQHandler - bx r0 - .size QDC1_WDG_SAB_IRQHandler, . - QDC1_WDG_SAB_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_IDX_IRQHandler - .type QDC1_IDX_IRQHandler, %function -QDC1_IDX_IRQHandler: - ldr r0,=QDC1_IDX_DriverIRQHandler - bx r0 - .size QDC1_IDX_IRQHandler, . - QDC1_IDX_IRQHandler - - .align 1 - .thumb_func - .weak ITRC0_IRQHandler - .type ITRC0_IRQHandler, %function -ITRC0_IRQHandler: - ldr r0,=ITRC0_DriverIRQHandler - bx r0 - .size ITRC0_IRQHandler, . - ITRC0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved149_IRQHandler - .type Reserved149_IRQHandler, %function -Reserved149_IRQHandler: - ldr r0,=Reserved149_DriverIRQHandler - bx r0 - .size Reserved149_IRQHandler, . - Reserved149_IRQHandler - - .align 1 - .thumb_func - .weak ELS_ERR_IRQHandler - .type ELS_ERR_IRQHandler, %function -ELS_ERR_IRQHandler: - ldr r0,=ELS_ERR_DriverIRQHandler - bx r0 - .size ELS_ERR_IRQHandler, . - ELS_ERR_IRQHandler - - .align 1 - .thumb_func - .weak PKC_ERR_IRQHandler - .type PKC_ERR_IRQHandler, %function -PKC_ERR_IRQHandler: - ldr r0,=PKC_ERR_DriverIRQHandler - bx r0 - .size PKC_ERR_IRQHandler, . - PKC_ERR_IRQHandler - - .align 1 - .thumb_func - .weak ERM_SINGLE_BIT_ERROR_IRQHandler - .type ERM_SINGLE_BIT_ERROR_IRQHandler, %function -ERM_SINGLE_BIT_ERROR_IRQHandler: - ldr r0,=ERM_SINGLE_BIT_ERROR_DriverIRQHandler - bx r0 - .size ERM_SINGLE_BIT_ERROR_IRQHandler, . - ERM_SINGLE_BIT_ERROR_IRQHandler - - .align 1 - .thumb_func - .weak ERM_MULTI_BIT_ERROR_IRQHandler - .type ERM_MULTI_BIT_ERROR_IRQHandler, %function -ERM_MULTI_BIT_ERROR_IRQHandler: - ldr r0,=ERM_MULTI_BIT_ERROR_DriverIRQHandler - bx r0 - .size ERM_MULTI_BIT_ERROR_IRQHandler, . - ERM_MULTI_BIT_ERROR_IRQHandler - - .align 1 - .thumb_func - .weak FMU0_IRQHandler - .type FMU0_IRQHandler, %function -FMU0_IRQHandler: - ldr r0,=FMU0_DriverIRQHandler - bx r0 - .size FMU0_IRQHandler, . - FMU0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved155_IRQHandler - .type Reserved155_IRQHandler, %function -Reserved155_IRQHandler: - ldr r0,=Reserved155_DriverIRQHandler - bx r0 - .size Reserved155_IRQHandler, . - Reserved155_IRQHandler - - .align 1 - .thumb_func - .weak Reserved156_IRQHandler - .type Reserved156_IRQHandler, %function -Reserved156_IRQHandler: - ldr r0,=Reserved156_DriverIRQHandler - bx r0 - .size Reserved156_IRQHandler, . - Reserved156_IRQHandler - - .align 1 - .thumb_func - .weak Reserved157_IRQHandler - .type Reserved157_IRQHandler, %function -Reserved157_IRQHandler: - ldr r0,=Reserved157_DriverIRQHandler - bx r0 - .size Reserved157_IRQHandler, . - Reserved157_IRQHandler - - .align 1 - .thumb_func - .weak Reserved158_IRQHandler - .type Reserved158_IRQHandler, %function -Reserved158_IRQHandler: - ldr r0,=Reserved158_DriverIRQHandler - bx r0 - .size Reserved158_IRQHandler, . - Reserved158_IRQHandler - - .align 1 - .thumb_func - .weak LPTMR0_IRQHandler - .type LPTMR0_IRQHandler, %function -LPTMR0_IRQHandler: - ldr r0,=LPTMR0_DriverIRQHandler - bx r0 - .size LPTMR0_IRQHandler, . - LPTMR0_IRQHandler - - .align 1 - .thumb_func - .weak LPTMR1_IRQHandler - .type LPTMR1_IRQHandler, %function -LPTMR1_IRQHandler: - ldr r0,=LPTMR1_DriverIRQHandler - bx r0 - .size LPTMR1_IRQHandler, . - LPTMR1_IRQHandler - - .align 1 - .thumb_func - .weak SCG_IRQHandler - .type SCG_IRQHandler, %function -SCG_IRQHandler: - ldr r0,=SCG_DriverIRQHandler - bx r0 - .size SCG_IRQHandler, . - SCG_IRQHandler - - .align 1 - .thumb_func - .weak SPC_IRQHandler - .type SPC_IRQHandler, %function -SPC_IRQHandler: - ldr r0,=SPC_DriverIRQHandler - bx r0 - .size SPC_IRQHandler, . - SPC_IRQHandler - - .align 1 - .thumb_func - .weak WUU_IRQHandler - .type WUU_IRQHandler, %function -WUU_IRQHandler: - ldr r0,=WUU_DriverIRQHandler - bx r0 - .size WUU_IRQHandler, . - WUU_IRQHandler - - .align 1 - .thumb_func - .weak PORT_EFT_IRQHandler - .type PORT_EFT_IRQHandler, %function -PORT_EFT_IRQHandler: - ldr r0,=PORT_EFT_DriverIRQHandler - bx r0 - .size PORT_EFT_IRQHandler, . - PORT_EFT_IRQHandler - - .align 1 - .thumb_func - .weak Reserved165_IRQHandler - .type Reserved165_IRQHandler, %function -Reserved165_IRQHandler: - ldr r0,=Reserved165_DriverIRQHandler - bx r0 - .size Reserved165_IRQHandler, . - Reserved165_IRQHandler - - .align 1 - .thumb_func - .weak Reserved166_IRQHandler - .type Reserved166_IRQHandler, %function -Reserved166_IRQHandler: - ldr r0,=Reserved166_DriverIRQHandler - bx r0 - .size Reserved166_IRQHandler, . - Reserved166_IRQHandler - - .align 1 - .thumb_func - .weak Reserved167_IRQHandler - .type Reserved167_IRQHandler, %function -Reserved167_IRQHandler: - ldr r0,=Reserved167_DriverIRQHandler - bx r0 - .size Reserved167_IRQHandler, . - Reserved167_IRQHandler - - .align 1 - .thumb_func - .weak WWDT0_IRQHandler - .type WWDT0_IRQHandler, %function -WWDT0_IRQHandler: - ldr r0,=WWDT0_DriverIRQHandler - bx r0 - .size WWDT0_IRQHandler, . - WWDT0_IRQHandler - - .align 1 - .thumb_func - .weak WWDT1_IRQHandler - .type WWDT1_IRQHandler, %function -WWDT1_IRQHandler: - ldr r0,=WWDT1_DriverIRQHandler - bx r0 - .size WWDT1_IRQHandler, . - WWDT1_IRQHandler - - .align 1 - .thumb_func - .weak CMC0_IRQHandler - .type CMC0_IRQHandler, %function -CMC0_IRQHandler: - ldr r0,=CMC0_DriverIRQHandler - bx r0 - .size CMC0_IRQHandler, . - CMC0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved171_IRQHandler - .type Reserved171_IRQHandler, %function -Reserved171_IRQHandler: - ldr r0,=Reserved171_DriverIRQHandler - bx r0 - .size Reserved171_IRQHandler, . - Reserved171_IRQHandler - - -/* Macro to define default handlers. Default handler - * will be weak symbol and just dead loops. They can be - * overwritten by other handlers */ - .macro def_irq_handler handler_name - .weak \handler_name - .set \handler_name, DefaultISR - .endm - -/* Exception Handlers */ - def_irq_handler MemManage_Handler - def_irq_handler BusFault_Handler - def_irq_handler UsageFault_Handler - def_irq_handler SecureFault_Handler - def_irq_handler DebugMon_Handler - def_irq_handler OR_DriverIRQHandler - def_irq_handler EDMA_0_CH0_DriverIRQHandler - def_irq_handler EDMA_0_CH1_DriverIRQHandler - def_irq_handler EDMA_0_CH2_DriverIRQHandler - def_irq_handler EDMA_0_CH3_DriverIRQHandler - def_irq_handler EDMA_0_CH4_DriverIRQHandler - def_irq_handler EDMA_0_CH5_DriverIRQHandler - def_irq_handler EDMA_0_CH6_DriverIRQHandler - def_irq_handler EDMA_0_CH7_DriverIRQHandler - def_irq_handler EDMA_0_CH8_DriverIRQHandler - def_irq_handler EDMA_0_CH9_DriverIRQHandler - def_irq_handler EDMA_0_CH10_DriverIRQHandler - def_irq_handler EDMA_0_CH11_DriverIRQHandler - def_irq_handler EDMA_0_CH12_DriverIRQHandler - def_irq_handler EDMA_0_CH13_DriverIRQHandler - def_irq_handler EDMA_0_CH14_DriverIRQHandler - def_irq_handler EDMA_0_CH15_DriverIRQHandler - def_irq_handler GPIO00_DriverIRQHandler - def_irq_handler GPIO01_DriverIRQHandler - def_irq_handler GPIO10_DriverIRQHandler - def_irq_handler GPIO11_DriverIRQHandler - def_irq_handler GPIO20_DriverIRQHandler - def_irq_handler GPIO21_DriverIRQHandler - def_irq_handler GPIO30_DriverIRQHandler - def_irq_handler GPIO31_DriverIRQHandler - def_irq_handler GPIO40_DriverIRQHandler - def_irq_handler GPIO41_DriverIRQHandler - def_irq_handler GPIO50_DriverIRQHandler - def_irq_handler GPIO51_DriverIRQHandler - def_irq_handler UTICK0_DriverIRQHandler - def_irq_handler MRT0_DriverIRQHandler - def_irq_handler CTIMER0_DriverIRQHandler - def_irq_handler CTIMER1_DriverIRQHandler - def_irq_handler Reserved49_DriverIRQHandler - def_irq_handler CTIMER2_DriverIRQHandler - def_irq_handler LP_FLEXCOMM0_DriverIRQHandler - def_irq_handler LP_FLEXCOMM1_DriverIRQHandler - def_irq_handler LP_FLEXCOMM2_DriverIRQHandler - def_irq_handler LP_FLEXCOMM3_DriverIRQHandler - def_irq_handler LP_FLEXCOMM4_DriverIRQHandler - def_irq_handler LP_FLEXCOMM5_DriverIRQHandler - def_irq_handler LP_FLEXCOMM6_DriverIRQHandler - def_irq_handler LP_FLEXCOMM7_DriverIRQHandler - def_irq_handler Reserved59_DriverIRQHandler - def_irq_handler Reserved60_DriverIRQHandler - def_irq_handler ADC0_DriverIRQHandler - def_irq_handler ADC1_DriverIRQHandler - def_irq_handler PINT0_DriverIRQHandler - def_irq_handler PDM_EVENT_DriverIRQHandler - def_irq_handler Reserved65_DriverIRQHandler - def_irq_handler Reserved66_DriverIRQHandler - def_irq_handler USB0_DCD_DriverIRQHandler - def_irq_handler RTC_DriverIRQHandler - def_irq_handler SMARTDMA_DriverIRQHandler - def_irq_handler Reserved70_DriverIRQHandler - def_irq_handler CTIMER3_DriverIRQHandler - def_irq_handler CTIMER4_DriverIRQHandler - def_irq_handler OS_EVENT_DriverIRQHandler - def_irq_handler Reserved74_DriverIRQHandler - def_irq_handler SAI0_DriverIRQHandler - def_irq_handler SAI1_DriverIRQHandler - def_irq_handler Reserved77_DriverIRQHandler - def_irq_handler CAN0_DriverIRQHandler - def_irq_handler CAN1_DriverIRQHandler - def_irq_handler Reserved80_DriverIRQHandler - def_irq_handler Reserved81_DriverIRQHandler - def_irq_handler USB1_HS_PHY_DriverIRQHandler - def_irq_handler USB1_HS_DriverIRQHandler - def_irq_handler SEC_HYPERVISOR_CALL_DriverIRQHandler - def_irq_handler Reserved85_DriverIRQHandler - def_irq_handler Reserved86_DriverIRQHandler - def_irq_handler Freqme_DriverIRQHandler - def_irq_handler SEC_VIO_DriverIRQHandler - def_irq_handler ELS_DriverIRQHandler - def_irq_handler PKC_DriverIRQHandler - def_irq_handler PUF_DriverIRQHandler - def_irq_handler Reserved92_DriverIRQHandler - def_irq_handler EDMA_1_CH0_DriverIRQHandler - def_irq_handler EDMA_1_CH1_DriverIRQHandler - def_irq_handler EDMA_1_CH2_DriverIRQHandler - def_irq_handler EDMA_1_CH3_DriverIRQHandler - def_irq_handler EDMA_1_CH4_DriverIRQHandler - def_irq_handler EDMA_1_CH5_DriverIRQHandler - def_irq_handler EDMA_1_CH6_DriverIRQHandler - def_irq_handler EDMA_1_CH7_DriverIRQHandler - def_irq_handler Reserved101_DriverIRQHandler - def_irq_handler Reserved102_DriverIRQHandler - def_irq_handler Reserved103_DriverIRQHandler - def_irq_handler Reserved104_DriverIRQHandler - def_irq_handler Reserved105_DriverIRQHandler - def_irq_handler Reserved106_DriverIRQHandler - def_irq_handler Reserved107_DriverIRQHandler - def_irq_handler Reserved108_DriverIRQHandler - def_irq_handler CDOG0_DriverIRQHandler - def_irq_handler CDOG1_DriverIRQHandler - def_irq_handler I3C0_DriverIRQHandler - def_irq_handler I3C1_DriverIRQHandler - def_irq_handler Reserved113_DriverIRQHandler - def_irq_handler GDET_DriverIRQHandler - def_irq_handler VBAT0_DriverIRQHandler - def_irq_handler EWM0_DriverIRQHandler - def_irq_handler Reserved117_DriverIRQHandler - def_irq_handler Reserved118_DriverIRQHandler - def_irq_handler Reserved119_DriverIRQHandler - def_irq_handler Reserved120_DriverIRQHandler - def_irq_handler FLEXIO_DriverIRQHandler - def_irq_handler Reserved122_DriverIRQHandler - def_irq_handler Reserved123_DriverIRQHandler - def_irq_handler Reserved124_DriverIRQHandler - def_irq_handler HSCMP0_DriverIRQHandler - def_irq_handler HSCMP1_DriverIRQHandler - def_irq_handler Reserved127_DriverIRQHandler - def_irq_handler FLEXPWM0_RELOAD_ERROR_DriverIRQHandler - def_irq_handler FLEXPWM0_FAULT_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE0_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE1_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE2_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE3_DriverIRQHandler - def_irq_handler FLEXPWM1_RELOAD_ERROR_DriverIRQHandler - def_irq_handler FLEXPWM1_FAULT_DriverIRQHandler - def_irq_handler FLEXPWM1_SUBMODULE0_DriverIRQHandler - def_irq_handler FLEXPWM1_SUBMODULE1_DriverIRQHandler - def_irq_handler FLEXPWM1_SUBMODULE2_DriverIRQHandler - def_irq_handler FLEXPWM1_SUBMODULE3_DriverIRQHandler - def_irq_handler QDC0_COMPARE_DriverIRQHandler - def_irq_handler QDC0_HOME_DriverIRQHandler - def_irq_handler QDC0_WDG_SAB_DriverIRQHandler - def_irq_handler QDC0_IDX_DriverIRQHandler - def_irq_handler QDC1_COMPARE_DriverIRQHandler - def_irq_handler QDC1_HOME_DriverIRQHandler - def_irq_handler QDC1_WDG_SAB_DriverIRQHandler - def_irq_handler QDC1_IDX_DriverIRQHandler - def_irq_handler ITRC0_DriverIRQHandler - def_irq_handler Reserved149_DriverIRQHandler - def_irq_handler ELS_ERR_DriverIRQHandler - def_irq_handler PKC_ERR_DriverIRQHandler - def_irq_handler ERM_SINGLE_BIT_ERROR_DriverIRQHandler - def_irq_handler ERM_MULTI_BIT_ERROR_DriverIRQHandler - def_irq_handler FMU0_DriverIRQHandler - def_irq_handler Reserved155_DriverIRQHandler - def_irq_handler Reserved156_DriverIRQHandler - def_irq_handler Reserved157_DriverIRQHandler - def_irq_handler Reserved158_DriverIRQHandler - def_irq_handler LPTMR0_DriverIRQHandler - def_irq_handler LPTMR1_DriverIRQHandler - def_irq_handler SCG_DriverIRQHandler - def_irq_handler SPC_DriverIRQHandler - def_irq_handler WUU_DriverIRQHandler - def_irq_handler PORT_EFT_DriverIRQHandler - def_irq_handler Reserved165_DriverIRQHandler - def_irq_handler Reserved166_DriverIRQHandler - def_irq_handler Reserved167_DriverIRQHandler - def_irq_handler WWDT0_DriverIRQHandler - def_irq_handler WWDT1_DriverIRQHandler - def_irq_handler CMC0_DriverIRQHandler - def_irq_handler Reserved171_DriverIRQHandler - - .end diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_cache_lpcac.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_cache_lpcac.c deleted file mode 100644 index 31b4415e130..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_cache_lpcac.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2021-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_cache_lpcac.h" -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.cache_lpcac" -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_cache_lpcac.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_cache_lpcac.h deleted file mode 100644 index 54dd1fd8407..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_cache_lpcac.h +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright 2021-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_CACHE_LPCAC_H_ -#define FSL_CACHE_LPCAC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup cache_lpcac - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief cache driver version */ -#define FSL_CACHE_LPCAC_DRIVER_VERSION (MAKE_VERSION(2, 1, 1)) -/*@}*/ -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name cache control for the L1 low power cache controller - *@{ - */ - -/*! - * @brief Enables the processor code bus cache. - * - */ -static inline void L1CACHE_EnableCodeCache(void) -{ - SYSCON->LPCAC_CTRL &= ~SYSCON_LPCAC_CTRL_DIS_LPCAC_MASK; -} - -/*! - * @brief Disables the processor code bus cache. - * - */ -static inline void L1CACHE_DisableCodeCache(void) -{ - SYSCON->LPCAC_CTRL |= SYSCON_LPCAC_CTRL_DIS_LPCAC_MASK; -} - -/*! - * @brief Clears cache. - * - */ -static inline void L1CACHE_InvalidateCodeCache(void) -{ - SYSCON->LPCAC_CTRL |= SYSCON_LPCAC_CTRL_CLR_LPCAC_MASK; -} - -/*! - * @brief Enables allocation. - * - */ -static inline void L1CACHE_EnableAllocation(void) -{ - SYSCON->LPCAC_CTRL &= ~SYSCON_LPCAC_CTRL_FRC_NO_ALLOC_MASK; -} - -/*! - * @brief Disables allocation. - * - */ -static inline void L1CACHE_DisableAllocation(void) -{ - SYSCON->LPCAC_CTRL |= SYSCON_LPCAC_CTRL_FRC_NO_ALLOC_MASK; -} - -/*! - * @brief Enables parity. - * - */ -static inline void L1CACHE_EnableParity(void) -{ - SYSCON->LPCAC_CTRL |= SYSCON_LPCAC_CTRL_PARITY_MISS_EN_MASK; -} - -/*! - * @brief Disable parity. - * - */ -static inline void L1CACHE_DisableParity(void) -{ - SYSCON->LPCAC_CTRL &= ~SYSCON_LPCAC_CTRL_PARITY_MISS_EN_MASK; -} - -#if defined(FSL_FEATURE_LPCAC_SUPPORT_WRITE_BUFFER_CONTROL) && FSL_FEATURE_LPCAC_SUPPORT_WRITE_BUFFER_CONTROL -/*! - * @brief Enables write through buffer. - * - */ -static inline void L1CACHE_EnableWriteBuffer(void) -{ - SYSCON->LPCAC_CTRL &= ~SYSCON_LPCAC_CTRL_DIS_LPCAC_WTBF_MASK; -} - -/*! - * @brief Disables write through buffer. - * - */ -static inline void L1CACHE_DisableWriteBuffer(void) -{ - SYSCON->LPCAC_CTRL |= SYSCON_LPCAC_CTRL_DIS_LPCAC_WTBF_MASK; -} - -/*! - * @brief Limits write through buffer. - * - */ -static inline void L1CACHE_LimitWriteBuffer(void) -{ - SYSCON->LPCAC_CTRL &= ~SYSCON_LPCAC_CTRL_LIM_LPCAC_WTBF_MASK; -} - -/*! - * @brief Unlimits write through buffer. - * - */ -static inline void L1CACHE_UnlimitParity(void) -{ - SYSCON->LPCAC_CTRL |= SYSCON_LPCAC_CTRL_LIM_LPCAC_WTBF_MASK; -} - -/*! - * @brief Enables parity error report. - * - */ -static inline void L1CACHE_EnableParityErrorReport(void) -{ - SYSCON->LPCAC_CTRL |= SYSCON_LPCAC_CTRL_PARITY_FAULT_EN_MASK; -} - -/*! - * @brief Disables parity error report. - * - */ -static inline void L1CACHE_DisableParityErrorReport(void) -{ - SYSCON->LPCAC_CTRL &= ~SYSCON_LPCAC_CTRL_PARITY_FAULT_EN_MASK; -} - -/*! - * @brief Enables XOM(eXecute-Only-Memory) control. - * - */ -static inline void L1CACHE_EnableXOMControl(void) -{ - SYSCON->LPCAC_CTRL |= SYSCON_LPCAC_CTRL_LPCAC_XOM_MASK; -} - -/*! - * @brief Disables XOM(eXecute-Only-Memory) control. - * - */ -static inline void L1CACHE_DisableXOMControl(void) -{ - SYSCON->LPCAC_CTRL &= ~SYSCON_LPCAC_CTRL_LPCAC_XOM_MASK; -} -#endif - -/*@}*/ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_CACHE_LPCAC_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_cdog.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_cdog.c deleted file mode 100644 index 69de5bbc564..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_cdog.c +++ /dev/null @@ -1,396 +0,0 @@ -/* - * Copyright 2020-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_cdog.h" - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.cdog" -#endif - -/* Reset CONTROL mask */ -#define RESERVED_CTRL_MASK 0x800u - -#if defined(CDOG_IRQS) -/* Array of IRQs */ -static const IRQn_Type s_CdogIrqs[] = CDOG_IRQS; -#endif /* CDOG_IRQS */ - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ -#if defined(CDOG) -/*! - * Weak implementation of CDOG IRQ, should be re-defined by user when using CDOG IRQ - */ -__WEAK void CDOG_DriverIRQHandler(void) -{ - /* NVIC_DisableIRQ(CDOG_IRQn); - * CDOG_Stop(CDOG, s_start); - * CDOG->FLAGS = 0x0U; - * CDOG_Start(CDOG, 0xFFFFFFU, s_start); - * NVIC_EnableIRQ(CDOG_IRQn); - */ -} -#endif - -#if defined(CDOG0) -/*! - * Weak implementation of CDOG0 IRQ, should be re-defined by user when using CDOG IRQ - */ -__WEAK void CDOG0_DriverIRQHandler(void) -{ - /* NVIC_DisableIRQ(CDOG0_IRQn); - * CDOG_Stop(CDOG0, s_start); - * CDOG0->FLAGS = 0x0U; - * CDOG_Start(CDOG0, 0xFFFFFFU, s_start); - * NVIC_EnableIRQ(CDOG0_IRQn); - */ -} -#endif - -#if defined(CDOG1) -/*! - * Weak implementation of CDOG1 IRQ, should be re-defined by user when using CDOG IRQ - */ -__WEAK void CDOG1_DriverIRQHandler(void) -{ - /* NVIC_DisableIRQ(CDOG1_IRQn); - * CDOG_Stop(CDOG1, s_start); - * CDOG1->FLAGS = 0x0U; - * CDOG_Start(CDOG1, 0xFFFFFFU, s_start); - * NVIC_EnableIRQ(CDOG1_IRQn); - */ -} -#endif - -/*! - * brief Sets the default configuration of CDOG - * - * This function initialize CDOG config structure to default values. - * - * param conf CDOG configuration structure - */ -void CDOG_GetDefaultConfig(cdog_config_t *conf) -{ - /* Default configuration after reset */ - conf->lock = (uint8_t)kCDOG_LockCtrl_Unlock; /* Lock control */ - conf->timeout = (uint8_t)kCDOG_FaultCtrl_NoAction; /* Timeout control */ - conf->miscompare = (uint8_t)kCDOG_FaultCtrl_NoAction; /* Miscompare control */ - conf->sequence = (uint8_t)kCDOG_FaultCtrl_NoAction; /* Sequence control */ - conf->state = (uint8_t)kCDOG_FaultCtrl_NoAction; /* State control */ - conf->address = (uint8_t)kCDOG_FaultCtrl_NoAction; /* Address control */ - conf->irq_pause = (uint8_t)kCDOG_IrqPauseCtrl_Run; /* IRQ pause control */ - conf->debug_halt = (uint8_t)kCDOG_DebugHaltCtrl_Run; /* Debug halt control */ - return; -} - -/*! - * brief Sets secure counter and instruction timer values - * - * This function sets value in RELOAD and START registers for instruction timer. - * - * param base CDOG peripheral base address - * param reload reload value - * param start start value - */ -void CDOG_Start(CDOG_Type *base, uint32_t reload, uint32_t start) -{ - base->RELOAD = reload; - base->START = start; -} - -/*! - * brief Stops secure counter and instruction timer - * - * This function stops instruction timer and secure counter. - * This also change state of CDOG to IDLE. - * - * param base CDOG peripheral base address - * param stop expected value which will be compared with value of secure counter - */ -void CDOG_Stop(CDOG_Type *base, uint32_t stop) -{ - base->STOP = stop; -} - -/*! - * brief Sets secure counter and instruction timer values - * - * This function sets value in STOP, RELOAD and START registers - * for instruction timer and secure counter. - * - * param base CDOG peripheral base address - * param stop expected value which will be compared with value of secure counter - * param reload reload value for instruction timer - * param start start value for secure timer - */ -void CDOG_Set(CDOG_Type *base, uint32_t stop, uint32_t reload, uint32_t start) -{ - base->STOP = stop; - base->RELOAD = reload; - base->START = start; -} - -/*! - * brief Add value to secure counter - * - * This function add specified value to secure counter. - * - * param base CDOG peripheral base address. - * param add Value to be added. - */ -void CDOG_Add(CDOG_Type *base, uint32_t add) -{ - base->ADD = (secure_counter_t)add; -} - -/*! - * brief Add 1 to secure counter - * - * This function add 1 to secure counter. - * - * param base CDOG peripheral base address. - * param add Value to be added. - */ -void CDOG_Add1(CDOG_Type *base) -{ - base->ADD1 = (secure_counter_t)0x1U; -} - -/*! - * brief Add 16 to secure counter - * - * This function add 16 to secure counter. - * - * param base CDOG peripheral base address. - * param add Value to be added. - */ -void CDOG_Add16(CDOG_Type *base) -{ - base->ADD16 = (secure_counter_t)0x1U; -} - -/*! - * brief Add 256 to secure counter - * - * This function add 256 to secure counter. - * - * param base CDOG peripheral base address. - * param add Value to be added. - */ -void CDOG_Add256(CDOG_Type *base) -{ - base->ADD256 = (secure_counter_t)0x1U; -} - -/*! - * brief Substract value to secure counter - * - * This function substract specified value to secure counter. - * - * param base CDOG peripheral base address. - * param sub Value to be substracted. - */ -void CDOG_Sub(CDOG_Type *base, uint32_t sub) -{ - base->SUB = (secure_counter_t)sub; -} - -/*! - * brief Substract 1 from secure counter - * - * This function substract specified 1 from secure counter. - * - * param base CDOG peripheral base address. - */ -void CDOG_Sub1(CDOG_Type *base) -{ - base->SUB1 = (secure_counter_t)0x1U; -} - -/*! - * brief Substract 16 from secure counter - * - * This function substract specified 16 from secure counter. - * - * param base CDOG peripheral base address. - */ -void CDOG_Sub16(CDOG_Type *base) -{ - base->SUB16 = (secure_counter_t)0x1U; -} - -/*! - * brief Substract 256 from secure counter - * - * This function substract specified 256 from secure counter. - * - * param base CDOG peripheral base address. - */ -void CDOG_Sub256(CDOG_Type *base) -{ - base->SUB256 = (secure_counter_t)0x1U; -} - -/*! - * brief Checks secure counter. - * - * This function compares stop value with secure counter value - * by writting to RELOAD refister. - * - * param base CDOG peripheral base address - * param check expected (stop) value. - */ -void CDOG_Check(CDOG_Type *base, uint32_t check) -{ - base->RESTART = check; -} - -/*! - * brief Set the CDOG persistent word. - * - * param base CDOG peripheral base address. - * param value The value to be written. - */ -void CDOG_WritePersistent(CDOG_Type *base, uint32_t value) -{ - base->PERSISTENT = value; -} - -/*! - * brief Get the CDOG persistent word. - * - * param base CDOG peripheral base address. - * return The persistent word. - */ -uint32_t CDOG_ReadPersistent(CDOG_Type *base) -{ - return base->PERSISTENT; -} - -/*! - * brief Initialize CDOG - * - * This function initializes CDOG setting and enable all interrupts. - * - * param base CDOG peripheral base address - * param conf CDOG configuration structure - * return Status of the init operation - */ -status_t CDOG_Init(CDOG_Type *base, cdog_config_t *conf) -{ - /* Ungate clock to CDOG engine and reset it */ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#ifdef CDOG_CLOCKS - CLOCK_EnableClock(kCLOCK_Cdog); -#endif /* CDOG_CLOCKS */ -#endif /* !FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_FEATURE_CDOG_HAS_NO_RESET) && FSL_FEATURE_CDOG_HAS_NO_RESET) - RESET_PeripheralReset(kCDOG_RST_SHIFT_RSTn); -#endif /* !FSL_FEATURE_CDOG_HAS_NO_RESET */ - - if (base->CONTROL == 0x0U) - { - /* CDOG is not in IDLE mode, which may be cause after SW reset. */ - /* Writing to CONTROL register will trigger fault. */ - return kStatus_Fail; - } - - /* Clear pending errors, otherwise the device will reset */ - /* itself immediately after enable Code Watchdog */ - if ((uint32_t)kCDOG_LockCtrl_Lock == - ((base->CONTROL & CDOG_CONTROL_LOCK_CTRL_MASK) >> CDOG_CONTROL_LOCK_CTRL_SHIFT)) - - { - base->FLAGS = CDOG_FLAGS_TO_FLAG(1U) | CDOG_FLAGS_MISCOM_FLAG(1U) | CDOG_FLAGS_SEQ_FLAG(1U) | - CDOG_FLAGS_CNT_FLAG(1U) | CDOG_FLAGS_STATE_FLAG(1U) | CDOG_FLAGS_ADDR_FLAG(1U) | - CDOG_FLAGS_POR_FLAG(1U); - } - else - { -/* load default values for CDOG->CONTROL before flags clear */ -#if defined(FSL_FEATURE_CDOG_NEED_LOAD_DEFAULT_CONF) && (FSL_FEATURE_CDOG_NEED_LOAD_DEFAULT_CONF > 0) - cdog_config_t default_conf; - - /* Initialize CDOG */ - CDOG_GetDefaultConfig(&default_conf); - - /* Write default value to CDOG->CONTROL*/ - base->CONTROL = - CDOG_CONTROL_TIMEOUT_CTRL(default_conf.timeout) | /* Action if the timeout event is triggered */ - CDOG_CONTROL_MISCOMPARE_CTRL(default_conf.miscompare) | /* Action if the miscompare error event is triggered */ - CDOG_CONTROL_SEQUENCE_CTRL(default_conf.sequence) | /* Action if the sequence error event is triggered */ - CDOG_CONTROL_STATE_CTRL(default_conf.state) | /* Action if the state error event is triggered */ - CDOG_CONTROL_ADDRESS_CTRL(default_conf.address) | /* Action if the address error event is triggered */ - CDOG_CONTROL_IRQ_PAUSE(default_conf.irq_pause) | /* Pause running during interrupts setup */ - CDOG_CONTROL_DEBUG_HALT_CTRL(default_conf.debug_halt) | /* Halt CDOG timer during debug */ - CDOG_CONTROL_LOCK_CTRL(default_conf.lock) | RESERVED_CTRL_MASK; /* Lock control register, RESERVED */ -#endif /* FSL_FEATURE_CDOG_NEED_LOAD_DEFAULT_CONF */ - - base->FLAGS = CDOG_FLAGS_TO_FLAG(0U) | CDOG_FLAGS_MISCOM_FLAG(0U) | CDOG_FLAGS_SEQ_FLAG(0U) | - CDOG_FLAGS_CNT_FLAG(0U) | CDOG_FLAGS_STATE_FLAG(0U) | CDOG_FLAGS_ADDR_FLAG(0U) | - CDOG_FLAGS_POR_FLAG(0U); - } - - base->CONTROL = - CDOG_CONTROL_TIMEOUT_CTRL(conf->timeout) | /* Action if the timeout event is triggered */ - CDOG_CONTROL_MISCOMPARE_CTRL(conf->miscompare) | /* Action if the miscompare error event is triggered */ - CDOG_CONTROL_SEQUENCE_CTRL(conf->sequence) | /* Action if the sequence error event is triggered */ - CDOG_CONTROL_STATE_CTRL(conf->state) | /* Action if the state error event is triggered */ - CDOG_CONTROL_ADDRESS_CTRL(conf->address) | /* Action if the address error event is triggered */ - CDOG_CONTROL_IRQ_PAUSE(conf->irq_pause) | /* Pause running during interrupts setup */ - CDOG_CONTROL_DEBUG_HALT_CTRL(conf->debug_halt) | /* Halt CDOG timer during debug */ - CDOG_CONTROL_LOCK_CTRL(conf->lock) | RESERVED_CTRL_MASK; /* Lock control register, RESERVED */ - -#if defined(CDOG_IRQS) - /* Enable peripheral IRQs, if defined in array */ - for (uint32_t i = 0; i < ARRAY_SIZE(s_CdogIrqs); i++) - { - NVIC_EnableIRQ(s_CdogIrqs[i]); - } -#endif /* CDOG_IRQS */ - - return kStatus_Success; -} - -/*! - * brief Deinitialize CDOG - * - * This function stops CDOG secure counter. - * - * param base CDOG peripheral base address - */ -void CDOG_Deinit(CDOG_Type *base) -{ -#if defined(CDOG_IRQS) - /* Enable peripheral IRQs, if defined in array */ - for (uint32_t i = 0; i < ARRAY_SIZE(s_CdogIrqs); i++) - { - NVIC_DisableIRQ(s_CdogIrqs[i]); - } -#endif /* CDOG_IRQS */ - -#if !(defined(FSL_FEATURE_CDOG_HAS_NO_RESET) && FSL_FEATURE_CDOG_HAS_NO_RESET) - RESET_SetPeripheralReset(kCDOG_RST_SHIFT_RSTn); -#endif /* !FSL_FEATURE_CDOG_HAS_NO_RESET */ - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#ifdef CDOG_CLOCKS - CLOCK_DisableClock(kCLOCK_Cdog); -#endif /* CDOG_CLOCKS */ -#endif /* !FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_cdog.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_cdog.h deleted file mode 100644 index 924ac5684cb..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_cdog.h +++ /dev/null @@ -1,337 +0,0 @@ -/* - * Copyright 2020-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_CDOG_H_ -#define FSL_CDOG_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup CDOG - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief Defines CDOG driver version 2.1.2. - * - * Change log: - * - Version 2.1.2 - * - Support multiple IRQs - * - Fix default CONTROL values - * - Version 2.1.1 - * - Remove bit CONTROL[CONTROL_CTRL] - * - Version 2.1.0 - * - Rename CWT to CDOG - * - Version 2.0.2 - * - Fix MISRA-2012 issues - * - Version 2.0.1 - * - Fix doxygen issues - * - Version 2.0.0 - * - initial version - */ -#define FSL_CDOG_DRIVER_VERSION (MAKE_VERSION(2, 1, 2)) -/*@}*/ - -typedef struct -{ - uint8_t lock : 2; - uint8_t timeout : 3; - uint8_t miscompare : 3; - uint8_t sequence : 3; - uint8_t state : 3; - uint8_t address : 3; - uint8_t reserved : 8; - uint8_t irq_pause : 2; - uint8_t debug_halt : 2; -} cdog_config_t; - -enum __cdog_debug_Action_ctrl_enum -{ - kCDOG_DebugHaltCtrl_Run = 0x1, - kCDOG_DebugHaltCtrl_Pause = 0x2, -}; - -enum __cdog_irq_pause_ctrl_enum -{ - kCDOG_IrqPauseCtrl_Run = 0x1, - kCDOG_IrqPauseCtrl_Pause = 0x2, -}; - -enum __cdog_fault_ctrl_enum -{ - kCDOG_FaultCtrl_EnableReset = 0x1U, - kCDOG_FaultCtrl_EnableInterrupt = 0x2U, - kCDOG_FaultCtrl_NoAction = 0x4U, -}; - -enum __code_lock_ctrl_enum -{ - kCDOG_LockCtrl_Lock = 0x1, - kCDOG_LockCtrl_Unlock = 0x2, -}; - -typedef uint32_t secure_counter_t; - -#define SC_ADD(add) \ - do \ - { \ - CDOG->ADD = (secure_counter_t)(add); \ - } while (0) - -#define SC_ADD1 \ - do \ - { \ - CDOG->ADD1 = (secure_counter_t)0x1U; \ - } while (0) - -#define SC_ADD16 \ - do \ - { \ - CDOG->ADD16 = (secure_counter_t)0x1U; \ - } while (0) - -#define SC_ADD256 \ - do \ - { \ - CDOG->ADD256 = (secure_counter_t)0x1U; \ - } while (0) - -#define SC_SUB(sub) \ - do \ - { \ - CDOG->SUB = (secure_counter_t)(sub); \ - } while (0) - -#define SC_SUB1 \ - do \ - { \ - CDOG->SUB1 = (secure_counter_t)0x1U; \ - } while (0) - -#define SC_SUB16 \ - do \ - { \ - CDOG->SUB16 = (secure_counter_t)0x1U; \ - } while (0) - -#define SC_SUB256 \ - do \ - { \ - CDOG->SUB256 = (secure_counter_t)0x1U; \ - } while (0) - -#define SC_CHECK(val) \ - do \ - { \ - CDOG->RESTART = (secure_counter_t)val; \ - } while (0) - -/******************************************************************************* - * API - *******************************************************************************/ -#if defined(CDOG) -extern void CDOG_DriverIRQHandler(void); -#endif - -#if defined(CDOG0) -extern void CDOG0_DriverIRQHandler(void); -#endif - -#if defined(CDOG1) -extern void CDOG1_DriverIRQHandler(void); -#endif - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name CDOG Functional Operation - * @{ - */ - -/*! - * @brief Initialize CDOG - * - * This function initializes CDOG block and setting. - * - * @param base CDOG peripheral base address - * @param conf CDOG configuration structure - * @return Status of the init operation - */ -status_t CDOG_Init(CDOG_Type *base, cdog_config_t *conf); - -/*! - * @brief Deinitialize CDOG - * - * This function deinitializes CDOG secure counter. - * - * @param base CDOG peripheral base address - */ -void CDOG_Deinit(CDOG_Type *base); - -/*! - * @brief Sets the default configuration of CDOG - * - * This function initialize CDOG config structure to default values. - * - * @param conf CDOG configuration structure - */ -void CDOG_GetDefaultConfig(cdog_config_t *conf); - -/*! - * @brief Stops secure counter and instruction timer - * - * This function stops instruction timer and secure counter. - * This also change state od CDOG to IDLE. - * - * @param base CDOG peripheral base address - * @param stop expected value which will be compared with value of secure counter - */ -void CDOG_Stop(CDOG_Type *base, uint32_t stop); - -/*! - * @brief Sets secure counter and instruction timer values - * - * This function sets value in RELOAD and START registers - * for instruction timer and secure counter - * - * @param base CDOG peripheral base address - * @param reload reload value - * @param start start value - */ -void CDOG_Start(CDOG_Type *base, uint32_t reload, uint32_t start); - -/*! - * @brief Checks secure counter. - * - * This function compares stop value in handler with secure counter value - * by writting to RELOAD refister. - * - * @param base CDOG peripheral base address - * @param check expected (stop) value - */ -void CDOG_Check(CDOG_Type *base, uint32_t check); - -/*! - * @brief Sets secure counter and instruction timer values - * - * This function sets value in STOP, RELOAD and START registers - * for instruction timer and secure counter. - * - * @param base CDOG peripheral base address - * @param stop expected value which will be compared with value of secure counter - * @param reload reload value for instruction timer - * @param start start value for secure timer - */ -void CDOG_Set(CDOG_Type *base, uint32_t stop, uint32_t reload, uint32_t start); - -/*! - * @brief Add value to secure counter - * - * This function add specified value to secure counter. - * - * @param base CDOG peripheral base address. - * @param add Value to be added. - */ -void CDOG_Add(CDOG_Type *base, uint32_t add); - -/*! - * @brief Add 1 to secure counter - * - * This function add 1 to secure counter. - * - * @param base CDOG peripheral base address. - */ -void CDOG_Add1(CDOG_Type *base); - -/*! - * @brief Add 16 to secure counter - * - * This function add 16 to secure counter. - * - * @param base CDOG peripheral base address. - */ -void CDOG_Add16(CDOG_Type *base); - -/*! - * @brief Add 256 to secure counter - * - * This function add 256 to secure counter. - * - * @param base CDOG peripheral base address. - */ -void CDOG_Add256(CDOG_Type *base); - -/*! - * brief Substract value to secure counter - * - * This function substract specified value to secure counter. - * - * param base CDOG peripheral base address. - * param sub Value to be substracted. - */ -void CDOG_Sub(CDOG_Type *base, uint32_t sub); - -/*! - * @brief Substract 1 from secure counter - * - * This function substract specified 1 from secure counter. - * - * @param base CDOG peripheral base address. - */ -void CDOG_Sub1(CDOG_Type *base); - -/*! - * @brief Substract 16 from secure counter - * - * This function substract specified 16 from secure counter. - * - * @param base CDOG peripheral base address. - */ -void CDOG_Sub16(CDOG_Type *base); - -/*! - * @brief Substract 256 from secure counter - * - * This function substract specified 256 from secure counter. - * - * @param base CDOG peripheral base address. - */ -void CDOG_Sub256(CDOG_Type *base); - -/*! - * @brief Set the CDOG persistent word. - * - * @param base CDOG peripheral base address. - * @param value The value to be written. - */ -void CDOG_WritePersistent(CDOG_Type *base, uint32_t value); - -/*! - * @brief Get the CDOG persistent word. - * - * @param base CDOG peripheral base address. - * @return The persistent word. - */ -uint32_t CDOG_ReadPersistent(CDOG_Type *base); - -/*! @}*/ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @}*/ /* end of group cdog */ - -#endif /* FSL_CDOG_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_clock.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_clock.c deleted file mode 100644 index da70be49f06..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_clock.c +++ /dev/null @@ -1,2695 +0,0 @@ -/* - * Copyright 2022-2023, NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_clock.h" -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.clock" -#endif - -#define NVALMAX (0x100U) -#define PVALMAX (0x20U) -#define MVALMAX (0x10000U) - -#define PLL_MAX_N_DIV 0x100U - -/*-------------------------------------------------------------------------- -!!! If required these #defines can be moved to chip library file -----------------------------------------------------------------------------*/ - -#define PLL_NDIV_VAL_P (0U) /* NDIV is in bits 7:0 */ -#define PLL_NDIV_VAL_M (0xFFUL << PLL_NDIV_VAL_P) -#define PLL_MDIV_VAL_P (0U) /* MDIV is in bits 15:0 */ -#define PLL_MDIV_VAL_M (0xFFFFULL << PLL_MDIV_VAL_P) -#define PLL_PDIV_VAL_P (0U) /* PDIV is in bits 4:0 */ -#define PLL_PDIV_VAL_M (0x1FUL << PLL_PDIV_VAL_P) - -#define PLL_MIN_CCO_FREQ_MHZ (275000000U) -#define PLL_MAX_CCO_FREQ_MHZ (550000000U) -#define PLL_LOWER_IN_LIMIT (32000U) /*!< Minimum PLL input rate */ -#define PLL_HIGHER_IN_LIMIT (150000000U) /*!< Maximum PLL input rate */ -#define PLL_MIN_IN_SSMODE (3000000U) -#define PLL_MAX_IN_SSMODE \ - (100000000U) /*!< Not find the value in UM, Just use the maximum frequency which device support */ - -/* PLL NDIV reg */ -#define PLL_NDIV_VAL_SET(value) (((unsigned long)(value) << PLL_NDIV_VAL_P) & PLL_NDIV_VAL_M) -/* PLL MDIV reg */ -#define PLL_MDIV_VAL_SET(value) (((unsigned long long)(value) << PLL_MDIV_VAL_P) & PLL_MDIV_VAL_M) -/* PLL PDIV reg */ -#define PLL_PDIV_VAL_SET(value) (((unsigned long)(value) << PLL_PDIV_VAL_P) & PLL_PDIV_VAL_M) - -/* PLL SSCG control1 */ -#define PLL_SSCG_MD_FRACT_P 0U -#define PLL_SSCG_MD_INT_P 25U -#define PLL_SSCG_MD_FRACT_M (0x1FFFFFFUL << PLL_SSCG_MD_FRACT_P) -#define PLL_SSCG_MD_INT_M ((uint64_t)0xFFUL << PLL_SSCG_MD_INT_P) - -#define PLL_SSCG_MD_FRACT_SET(value) (((uint64_t)(value) << PLL_SSCG_MD_FRACT_P) & PLL_SSCG_MD_FRACT_M) -#define PLL_SSCG_MD_INT_SET(value) (((uint64_t)(value) << PLL_SSCG_MD_INT_P) & PLL_SSCG_MD_INT_M) - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/** External clock rate on the CLKIN pin in Hz. If not used, - set this to 0. Otherwise, set it to the exact rate in Hz this pin is - being driven at. */ -volatile static uint32_t s_Ext_Clk_Freq = 16000000U; -/*! @brief External XTAL32K clock frequency. */ -volatile static uint32_t s_Xtal32_Freq = 32768U; -/*! @brief SAI MCLK clock frequency. */ -volatile static uint32_t s_Sai_Mclk_Freq[2] = {0U}; -/*! @brief SAI TX BCLK clock frequency. */ -volatile static uint32_t s_Sai_Tx_Bclk_Freq[2] = {0U}; -/*! @brief SAI RX BCLK clock frequency. */ -volatile static uint32_t s_Sai_Rx_Bclk_Freq[2] = {0U}; - -/*! @brief external UPLL clock frequency. */ -static uint32_t s_extUpllFreq = 0U; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/* Get FRO 12M Clk */ -static uint32_t CLOCK_GetFro12MFreq(void); -/* Get CLK 1M Clk */ -static uint32_t CLOCK_GetClk1MFreq(void); -/* Get HF FRO Clk */ -static uint32_t CLOCK_GetFroHfFreq(void); -/* Get CLK 48M Clk */ -static uint32_t CLOCK_GetClk48MFreq(void); -/* Get CLK 144M Clk */ -static uint32_t CLOCK_GetClk144MFreq(void); -/* Get CLK 16K Clk */ -static uint32_t CLOCK_GetClk16KFreq(uint32_t id); -/* Get EXT OSC Clk */ -static uint32_t CLOCK_GetExtClkFreq(void); -/* Get OSC 32K Clk */ -static uint32_t CLOCK_GetOsc32KFreq(uint32_t id); -/* Get Systick Clk */ -static uint32_t CLOCK_GetSystickClkFreq(uint32_t id); -/* Get CLOCK OUT Clk */ -static uint32_t CLOCK_GetClockOutClkFreq(void); -/* Get LP_OSC Clk */ -static uint32_t CLOCK_GetLposcFreq(void); - -/* Find SELP, SELI, and SELR values for raw M value, max M = MVALMAX */ -static void pllFindSel(uint32_t M, uint32_t *pSelP, uint32_t *pSelI, uint32_t *pSelR); -/* Get predivider (N) from PLL0 NDIV setting */ -static uint32_t findPll0PreDiv(void); -/* Get predivider (N) from PLL1 NDIV setting */ -static uint32_t findPll1PreDiv(void); -/* Get postdivider (P) from PLL0 PDIV setting */ -static uint32_t findPll0PostDiv(void); -/* Get postdivider (P) from PLL1 PDIV setting */ -static uint32_t findPll1PostDiv(void); -/* Get multiplier (M) from PLL0 MDIV and SSCG settings */ -static float findPll0MMult(void); -/* Get multiplier (M) from PLL1 MDIV and SSCG settings */ -static float findPll1MMult(void); -/* Get the greatest common divisor */ -static uint32_t FindGreatestCommonDivisor(uint32_t m, uint32_t n); -/* Set PLL output based on desired output rate */ -static pll_error_t CLOCK_GetPllConfig(uint32_t finHz, uint32_t foutHz, pll_setup_t *pSetup, bool useSS); -/* Set PLL0 output based on desired output rate */ -static pll_error_t CLOCK_GetPllConfigInternal(uint32_t finHz, uint32_t foutHz, pll_setup_t *pSetup, bool useSS); -/* Get PLL input clock rate from setup structure */ -static uint32_t CLOCK_GetPLLInClockRateFromSetup(pll_setup_t *pSetup); -/* Get predivider (N) from setup structure */ -static uint32_t findPllPreDivFromSetup(pll_setup_t *pSetup); -/* Get postdivider (P) from setup structure */ -static uint32_t findPllPostDivFromSetup(pll_setup_t *pSetup); -/* Get multiplier (M) from setup structure */ -static float findPllMMultFromSetup(pll_setup_t *pSetup); - -/******************************************************************************* - * Code - ******************************************************************************/ - -/** - * @brief Initialize the Core clock to given frequency (48 or 144 MHz). - * This function turns on FIRC and select the given frequency as the source of fro_hf - * @param iFreq : Desired frequency (must be one of CLK_FRO_48MHZ or CLK_FRO_144MHZ) - * @return returns success or fail status. - */ -status_t CLOCK_SetupFROHFClocking(uint32_t iFreq) -{ - if ((iFreq != 48000000U) && (iFreq != 144000000U)) - { - return kStatus_Fail; - } - - /* Select 48MHz or 144MHz for FIRC clock */ - SCG0->FIRCCFG = SCG_FIRCCFG_RANGE((iFreq == 48000000U) ? 0 : 1); - - /* Unlock FIRCCSR */ - SCG0->FIRCCSR &= ~SCG_FIRCCSR_LK_MASK; - - /* Enable FIRC 48 MHz clock for peripheral use */ - SCG0->FIRCCSR |= SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_MASK; - /* Enable FIRC 144 MHz clock for peripheral use */ - SCG0->FIRCCSR |= SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN_MASK; - - /* Enable FIRC */ - SCG0->FIRCCSR |= SCG_FIRCCSR_FIRCEN_MASK; - - /* Wait for FIRC clock to be valid. */ - while ((SCG0->FIRCCSR & SCG_FIRCCSR_FIRCVLD_MASK) == 0U) - { - } - - return kStatus_Success; -} - -/** - * @brief Initialize the external osc clock to given frequency. - * @param iFreq : Desired frequency (must be equal to exact rate in Hz) - * @return returns success or fail status. - */ -status_t CLOCK_SetupExtClocking(uint32_t iFreq) -{ - uint8_t range = 0U; - - if ((iFreq >= 16000000U) && (iFreq < 20000000U)) - { - range = 0U; - } - else if ((iFreq >= 20000000U) && (iFreq < 30000000U)) - { - range = 1U; - } - else if ((iFreq >= 30000000U) && (iFreq < 50000000U)) - { - range = 2U; - } - else if ((iFreq >= 50000000U) && (iFreq < 66000000U)) - { - range = 3U; - } - else - { - return kStatus_InvalidArgument; - } - - /* If clock is used by system, return error. */ - if ((SCG0->SOSCCSR & SCG_SOSCCSR_SOSCSEL_MASK) != 0U) - { - return (status_t)kStatus_SCG_Busy; - } - - /* If configure register is locked, return error. */ - if ((SCG0->SOSCCSR & SCG_SOSCCSR_LK_MASK) != 0U) - { - return kStatus_ReadOnly; - } - - /* De-initializes the SCG SOSC */ - SCG0->SOSCCSR = SCG_SOSCCSR_SOSCERR_MASK; - - /* Enable LDO */ - SCG0->LDOCSR |= SCG_LDOCSR_LDOEN_MASK; - - /* Select SOSC source (internal crystal oscillator) and Configure SOSC range */ - SCG0->SOSCCFG = SCG_SOSCCFG_EREFS_MASK | SCG_SOSCCFG_RANGE(range); - - /* Unlock SOSCCSR */ - SCG0->SOSCCSR &= ~SCG_SOSCCSR_LK_MASK; - - /* Enable SOSC clock monitor and Enable SOSC */ - SCG0->SOSCCSR |= (SCG_SOSCCSR_SOSCCM_MASK | SCG_SOSCCSR_SOSCEN_MASK); - - /* Wait for SOSC clock to be valid. */ - while ((SCG0->SOSCCSR & SCG_SOSCCSR_SOSCVLD_MASK) == 0U) - { - } - - s_Ext_Clk_Freq = iFreq; - - return kStatus_Success; -} - -/** - * @brief Initialize the external reference clock to given frequency. - * @param iFreq : Desired frequency (must be equal to exact rate in Hz) - * @return returns success or fail status. - */ -status_t CLOCK_SetupExtRefClocking(uint32_t iFreq) -{ - uint8_t range = 0U; - - if ((iFreq >= 16000000U) && (iFreq < 20000000U)) - { - range = 0U; - } - else if ((iFreq >= 20000000U) && (iFreq < 30000000U)) - { - range = 1U; - } - else if ((iFreq >= 30000000U) && (iFreq < 50000000U)) - { - range = 2U; - } - else if ((iFreq >= 50000000U) && (iFreq < 66000000U)) - { - range = 3U; - } - else - { - return kStatus_InvalidArgument; - } - - /* If clock is used by system, return error. */ - if ((SCG0->SOSCCSR & SCG_SOSCCSR_SOSCSEL_MASK) != 0U) - { - return (status_t)kStatus_SCG_Busy; - } - - /* If configure register is locked, return error. */ - if ((SCG0->SOSCCSR & SCG_SOSCCSR_LK_MASK) != 0U) - { - return kStatus_ReadOnly; - } - - /* De-initializes the SCG SOSC */ - SCG0->SOSCCSR = SCG_SOSCCSR_SOSCERR_MASK; - - /* Enable LDO */ - SCG0->LDOCSR |= SCG_LDOCSR_LDOEN_MASK; - - /* Select SOSC source (external reference clock)*/ - SCG0->SOSCCFG &= ~SCG_SOSCCFG_EREFS_MASK; - - /*Configure SOSC range */ - SCG0->SOSCCFG |= SCG_SOSCCFG_RANGE(range); - - /* Unlock SOSCCSR */ - SCG0->SOSCCSR &= ~SCG_SOSCCSR_LK_MASK; - - /* Enable SOSC clock monitor and Enable SOSC */ - SCG0->SOSCCSR |= (SCG_SOSCCSR_SOSCCM_MASK | SCG_SOSCCSR_SOSCEN_MASK); - - /* Wait for SOSC clock to be valid. */ - while ((SCG0->SOSCCSR & SCG_SOSCCSR_SOSCVLD_MASK) == 0U) - { - } - - s_Ext_Clk_Freq = iFreq; - - return kStatus_Success; -} - -/** - * @brief Initialize the OSC 32K. - * @param id : OSC 32 kHz output clock to specified modules - * @return returns success or fail status. - */ -status_t CLOCK_SetupOsc32KClocking(uint32_t id) -{ - /* Enable LDO */ - SCG0->LDOCSR |= SCG_LDOCSR_LDOEN_MASK | SCG_LDOCSR_VOUT_OK_MASK; - - VBAT0->OSCCTLA = - (VBAT0->OSCCTLA & ~(VBAT_OSCCTLA_MODE_EN_MASK | VBAT_OSCCTLA_CAP_SEL_EN_MASK | VBAT_OSCCTLA_OSC_EN_MASK)) | - VBAT_OSCCTLA_MODE_EN(0x2) | VBAT_OSCCTLA_OSC_EN_MASK | VBAT_OSCCTLA_OSC_EN_MASK; - VBAT0->OSCCTLB = VBAT_OSCCTLB_INVERSE(0xDFF7E); - /* Wait for STATUSA[OSC_RDY] to set. */ - while ((VBAT0->STATUSA & VBAT_STATUSA_OSC_RDY_MASK) == 0U) - { - } - VBAT0->OSCLCKA = VBAT_OSCLCKA_LOCK_MASK; - VBAT0->OSCLCKB &= ~VBAT_OSCLCKA_LOCK_MASK; - - VBAT0->OSCCLKE |= VBAT_OSCCLKE_CLKE(id); - - /* De-initializes the SCG ROSC */ - SCG0->ROSCCSR = SCG_ROSCCSR_ROSCERR_MASK; - - /* Unlock ROSCCSR */ - SCG0->ROSCCSR &= ~SCG_ROSCCSR_LK_MASK; - - /* Enable SOSC clock monitor and Enable ROSC */ - SCG0->ROSCCSR |= SCG_ROSCCSR_ROSCCM_MASK; - - /* Wait for ROSC clock to be valid. */ - while ((SCG0->ROSCCSR & SCG_ROSCCSR_ROSCVLD_MASK) == 0U) - { - } - - s_Xtal32_Freq = 32768U; - - return kStatus_Success; -} - -/** - * @brief Initialize the CLK16K clock. - * @param id : CLK 16 kHz output clock to specified modules - * @return returns success or fail status. - */ -status_t CLOCK_SetupClk16KClocking(uint32_t id) -{ - VBAT0->FROCTLA |= VBAT_FROCTLA_FRO_EN_MASK; - VBAT0->FROCTLB &= ~VBAT_FROCTLB_INVERSE_MASK; - - VBAT0->FROLCKA |= VBAT_FROLCKA_LOCK_MASK; - VBAT0->FROLCKB &= ~VBAT_FROLCKB_LOCK_MASK; - - VBAT0->FROCLKE |= VBAT_FROCLKE_CLKE(id); - - return kStatus_Success; -} - -/** - * @brief Setup FROHF trim. - * @param config : FROHF trim value - * @return returns success or fail status. - */ -status_t CLOCK_FROHFTrimConfig(firc_trim_config_t config) -{ - SCG0->FIRCTCFG = SCG_FIRCTCFG_TRIMDIV(config.trimDiv) | SCG_FIRCTCFG_TRIMSRC(config.trimSrc); - - if (kSCG_FircTrimNonUpdate == config.trimMode) - { - SCG0->FIRCSTAT = SCG_FIRCSTAT_TRIMFINE(config.trimFine); - } - - /* Set trim mode. */ - SCG0->FIRCCSR = (uint32_t)config.trimMode; - - if ((SCG0->FIRCCSR & SCG_FIRCCSR_FIRCERR_MASK) == SCG_FIRCCSR_FIRCERR_MASK) - { - return (status_t)kStatus_Fail; - } - - return (status_t)kStatus_Success; -} - -/** - * @brief Setup FRO 12M trim. - * @param config : FRO 12M trim value - * @return returns success or fail status. - */ -status_t CLOCK_FRO12MTrimConfig(sirc_trim_config_t config) -{ - SCG0->SIRCTCFG = SCG_SIRCTCFG_TRIMDIV(config.trimDiv) | SCG_SIRCTCFG_TRIMSRC(config.trimSrc); - - if (kSCG_SircTrimNonUpdate == config.trimMode) - { - SCG0->SIRCSTAT = SCG_SIRCSTAT_CCOTRIM(config.cltrim); - SCG0->SIRCSTAT = SCG_SIRCSTAT_CCOTRIM(config.ccotrim); - } - - /* Set trim mode. */ - SCG0->SIRCCSR = (uint32_t)config.trimMode; - - if ((SCG0->SIRCCSR & SCG_SIRCCSR_SIRCERR_MASK) == SCG_SIRCCSR_SIRCERR_MASK) - { - return (status_t)kStatus_Fail; - } - - return (status_t)kStatus_Success; -} - -/*! - * @brief Sets the system OSC monitor mode. - * - * This function sets the system OSC monitor mode. The mode can be disabled, - * it can generate an interrupt when the error is disabled, or reset when the error is detected. - * - * @param mode Monitor mode to set. - */ -void CLOCK_SetSysOscMonitorMode(scg_sosc_monitor_mode_t mode) -{ - uint32_t reg = SCG0->SOSCCSR; - - reg &= ~(SCG_SOSCCSR_SOSCCM_MASK | SCG_SOSCCSR_SOSCCMRE_MASK); - - reg |= (uint32_t)mode; - - SCG0->SOSCCSR = reg; -} - -/*! - * @brief Sets the ROSC monitor mode. - * - * This function sets the ROSC monitor mode. The mode can be disabled, - * it can generate an interrupt when the error is disabled, or reset when the error is detected. - * - * @param mode Monitor mode to set. - */ -void CLOCK_SetRoscMonitorMode(scg_rosc_monitor_mode_t mode) -{ - uint32_t reg = SCG0->ROSCCSR; - - reg &= ~(SCG_ROSCCSR_ROSCCM_MASK | SCG_ROSCCSR_ROSCCMRE_MASK); - - reg |= (uint32_t)mode; - - SCG0->ROSCCSR = reg; -} - -/*! - * @brief Sets the UPLL monitor mode. - * - * This function sets the UPLL monitor mode. The mode can be disabled, - * it can generate an interrupt when the error is disabled, or reset when the error is detected. - * - * @param mode Monitor mode to set. - */ -void CLOCK_SetUpllMonitorMode(scg_upll_monitor_mode_t mode) -{ - uint32_t reg = SCG0->UPLLCSR; - - reg &= ~(SCG_UPLLCSR_UPLLCM_MASK | SCG_UPLLCSR_UPLLCMRE_MASK); - - reg |= (uint32_t)mode; - - SCG0->UPLLCSR = reg; -} - -/*! - * @brief Sets the PLL0 monitor mode. - * - * This function sets the PLL0 monitor mode. The mode can be disabled, - * it can generate an interrupt when the error is disabled, or reset when the error is detected. - * - * @param mode Monitor mode to set. - */ -void CLOCK_SetPll0MonitorMode(scg_pll0_monitor_mode_t mode) -{ - uint32_t reg = SCG0->APLLCSR; - - reg &= ~(SCG_APLLCSR_APLLCM_MASK | SCG_APLLCSR_APLLCMRE_MASK); - - reg |= (uint32_t)mode; - - SCG0->APLLCSR = reg; -} - -/*! - * @brief Sets the PLL1 monitor mode. - * - * This function sets the PLL1 monitor mode. The mode can be disabled, - * it can generate an interrupt when the error is disabled, or reset when the error is detected. - * - * @param mode Monitor mode to set. - */ -void CLOCK_SetPll1MonitorMode(scg_pll1_monitor_mode_t mode) -{ - uint32_t reg = SCG0->SPLLCSR; - - reg &= ~(SCG_SPLLCSR_SPLLCM_MASK | SCG_SPLLCSR_SPLLCMRE_MASK); - - reg |= (uint32_t)mode; - - SCG0->SPLLCSR = reg; -} - -/*! - * @brief Set the additional number of wait-states added to account for the ratio of system clock period to flash access time during full speed power mode. - * @param system_freq_hz : Input frequency - * @param mode : Active run mode (voltage level). - * @return success or fail status - */ -status_t CLOCK_SetFLASHAccessCyclesForFreq(uint32_t system_freq_hz, run_mode_t mode) -{ - uint32_t num_wait_states_added = 3UL; /* Default 3 additional wait states */ - switch ( mode ) - { - case kMD_Mode: - { - if (system_freq_hz > 50000000) - { - return kStatus_Fail; - } - if (system_freq_hz >24000000) - { - num_wait_states_added = 1U; - } - else - { - num_wait_states_added = 0U; - } - break; - } - case kSD_Mode: - { - if (system_freq_hz > 100000000) - { - return kStatus_Fail; - } - if (system_freq_hz > 64000000) - { - num_wait_states_added = 2U; - } - else if (system_freq_hz > 36000000) - { - num_wait_states_added = 1U; - } - else - { - num_wait_states_added = 0U; - } - break; - } - case kOD_Mode: - { - if (system_freq_hz > 150000000) - { - return kStatus_Fail; - } - if (system_freq_hz > 100000000) - { - num_wait_states_added = 3U; - } - else if (system_freq_hz > 64000000) - { - num_wait_states_added = 2U; - } - else if (system_freq_hz > 36000000) - { - num_wait_states_added = 1U; - } - else - { - num_wait_states_added = 0U; - } - } - } - - /* additional wait-states are added */ - FMU0 -> FCTRL = (FMU0 -> FCTRL & 0xFFFFFFF0UL) | (num_wait_states_added & 0xFUL); - - return kStatus_Success; -} - -/*! - * @brief Config 32k Crystal Oscillator. - * - * @param base VBAT peripheral base address. - * @param config The pointer to the structure \ref vbat_osc_config_t. - */ -void VBAT_SetOscConfig(VBAT_Type *base, const vbat_osc_config_t *config) -{ - uint32_t tmp32; - - if (config->enableCrystalOscillatorBypass == true) - { - base->OSCCTLA |= VBAT_OSCCTLA_OSC_BYP_EN_MASK; - while ((VBAT0->STATUSA & VBAT_STATUSA_OSC_RDY_MASK) == 0U) - { - } - } - else - { - tmp32 = base->OSCCTLA; - - if (config != NULL) - { - if (config->enableInternalCapBank) - { - tmp32 &= ~(VBAT_OSCCTLA_EXTAL_CAP_SEL_MASK | VBAT_OSCCTLA_XTAL_CAP_SEL_MASK); - tmp32 |= VBAT_OSCCTLA_EXTAL_CAP_SEL(config->extalCap) | VBAT_OSCCTLA_XTAL_CAP_SEL(config->xtalCap); - tmp32 |= VBAT_OSCCTLA_CAP_SEL_EN_MASK; - } - else - { - /* Disable the internal capacitance bank. */ - tmp32 &= ~VBAT_OSCCTLA_CAP_SEL_EN_MASK; - } - - tmp32 &= ~(VBAT_OSCCTLA_COARSE_AMP_GAIN_MASK); - tmp32 |= VBAT_OSCCTLA_COARSE_AMP_GAIN(config->coarseAdjustment); - } - base->OSCCTLA = tmp32; - while ((VBAT0->STATUSA & VBAT_STATUSA_OSC_RDY_MASK) == 0U) - { - } - } -} - -/* Clock Selection for IP */ -/** - * brief Configure the clock selection muxes. - * param connection : Clock to be configured. - * return Nothing - */ -void CLOCK_AttachClk(clock_attach_id_t connection) -{ - uint16_t mux; - uint8_t sel; - uint16_t item; - uint32_t tmp32 = (uint32_t)connection; - uint32_t i; - volatile uint32_t *pClkSel; - - pClkSel = &(SYSCON->SYSTICKCLKSEL0); - - if (kNONE_to_NONE != connection) - { - for (i = 0U; i < 2U; i++) - { - if (tmp32 == 0U) - { - break; - } - item = (uint16_t)GET_ID_ITEM(tmp32); - if (item != 0U) - { - mux = (uint16_t)GET_ID_ITEM_MUX(item); - sel = (uint8_t)GET_ID_ITEM_SEL(item); - if (mux == CM_SCGRCCRSCSCLKSEL) - { - SCG0->RCCR = (SCG0->RCCR & ~(SCG_RCCR_SCS_MASK)) | SCG_RCCR_SCS(sel); - while ((SCG0->CSR & SCG_CSR_SCS_MASK) != SCG_CSR_SCS(sel)) - { - } - } - else - { - ((volatile uint32_t *)pClkSel)[mux] = sel; - } - } - tmp32 = GET_ID_NEXT_ITEM(tmp32); /* pick up next descriptor */ - } - } -} - -/* Return the actual clock attach id */ -/** - * brief Get the actual clock attach id. - * This fuction uses the offset in input attach id, then it reads the actual source value in - * the register and combine the offset to obtain an actual attach id. - * param attachId : Clock attach id to get. - * return Clock source value. - */ -clock_attach_id_t CLOCK_GetClockAttachId(clock_attach_id_t attachId) -{ - uint16_t mux; - uint32_t actualSel; - uint32_t tmp32 = (uint32_t)attachId; - uint32_t i; - uint32_t actualAttachId = 0U; - uint32_t selector = GET_ID_SELECTOR(tmp32); - volatile uint32_t *pClkSel; - - pClkSel = &(SYSCON->SYSTICKCLKSEL0); - - if (kNONE_to_NONE == attachId) - { - return kNONE_to_NONE; - } - - for (i = 0U; i < 2U; i++) - { - mux = (uint16_t)GET_ID_ITEM_MUX(tmp32); - if (tmp32 != 0UL) - { - if (mux == CM_SCGRCCRSCSCLKSEL) - { - actualSel = (uint32_t)((SCG0->RCCR & SCG_RCCR_SCS_MASK) >> SCG_RCCR_SCS_SHIFT); - } - else - { - actualSel = (uint32_t)((volatile uint32_t *)pClkSel)[mux]; - } - - /* Consider the combination of two registers */ - actualAttachId |= CLK_ATTACH_ID(mux, actualSel, i); - } - tmp32 = GET_ID_NEXT_ITEM(tmp32); /*!< pick up next descriptor */ - } - - actualAttachId |= selector; - - return (clock_attach_id_t)actualAttachId; -} - -/* Set IP Clock Divider */ -/** - * brief Setup peripheral clock dividers. - * param div_name : Clock divider name - * param divided_by_value: Value to be divided - * return Nothing - */ -void CLOCK_SetClkDiv(clock_div_name_t div_name, uint32_t divided_by_value) -{ - volatile uint32_t *pClkDiv; - - pClkDiv = &(SYSCON->SYSTICKCLKDIV[0]); - /* halt and reset clock dividers */ - ((volatile uint32_t *)pClkDiv)[(uint32_t)div_name] = 0x3UL << 29U; - - if (divided_by_value == 0U) /*!< halt */ - { - ((volatile uint32_t *)pClkDiv)[(uint32_t)div_name] = 1UL << 30U; - } - else - { - ((volatile uint32_t *)pClkDiv)[(uint32_t)div_name] = (divided_by_value - 1U); - } -} - -/* Get IP clock dividers */ -/** - * brief Get peripheral clock dividers. - * param div_name : Clock divider name - * return peripheral clock dividers - */ -uint32_t CLOCK_GetClkDiv(clock_div_name_t div_name) -{ - uint32_t div; - volatile uint32_t *pClkDiv; - - pClkDiv = &(SYSCON->SYSTICKCLKDIV[0]); - - if ((uint32_t)(((volatile uint32_t *)pClkDiv)[(uint32_t)div_name] & (0x3UL << 29U)) != 0UL) - { - div = 0U; - } - else - { - div = (uint32_t)((((volatile uint32_t *)pClkDiv)[(uint32_t)div_name] & 0xFFU) + 1U); - } - - return div; -} - -/* Halt IP Clock Divider */ -/** - * brief Setup peripheral clock dividers. - * param Halt : Clock divider name - * return Nothing - */ -void CLOCK_HaltClkDiv(clock_div_name_t div_name) -{ - volatile uint32_t *pClkDiv; - - pClkDiv = &(SYSCON->SYSTICKCLKDIV[0]); - - /* halt clock dividers */ - ((volatile uint32_t *)pClkDiv)[(uint32_t)div_name] = 1UL << 30U; - - return; -} - -/* enable system clocks */ -/** - * brief system clocks enable controls. - * param mask : system clocks enable value - * return Nothing - */ -void CLOCK_SetupClockCtrl(uint32_t mask) -{ - SYSCON->CLOCK_CTRL |= mask; - - return; -} - -/* Get IP Clk */ -/*! brief Return Frequency of selected clock - * return Frequency of selected clock - */ -uint32_t CLOCK_GetFreq(clock_name_t clockName) -{ - uint32_t freq = 0U; - - switch (clockName) - { - case kCLOCK_CoreSysClk: - freq = CLOCK_GetCoreSysClkFreq(); - break; - case kCLOCK_BusClk: - freq = CLOCK_GetCoreSysClkFreq() / ((SYSCON->AHBCLKDIV & 0xffU) + 1U); - break; - case kCLOCK_SystickClk0: - freq = CLOCK_GetSystickClkFreq(0U); - break; - case kCLOCK_ClockOut: - freq = CLOCK_GetClockOutClkFreq(); - break; - case kCLOCK_Clk1M: - freq = CLOCK_GetClk1MFreq(); - break; - case kCLOCK_Fro12M: - freq = CLOCK_GetFro12MFreq(); - break; - case kCLOCK_FroHf: - freq = CLOCK_GetFroHfFreq(); - break; - case kCLOCK_Clk48M: - freq = CLOCK_GetClk48MFreq(); - break; - case kCLOCK_Clk144M: - freq = CLOCK_GetClk144MFreq(); - break; - case kCLOCK_Clk16K0: - freq = CLOCK_GetClk16KFreq((uint32_t)kCLOCK_Clk16KToVbat); - break; - case kCLOCK_Clk16K1: - freq = CLOCK_GetClk16KFreq((uint32_t)kCLOCK_Clk16KToVsys); - break; - case kCLOCK_Clk16K2: - freq = CLOCK_GetClk16KFreq((uint32_t)kCLOCK_Clk16KToWake); - break; - case kCLOCK_Clk16K3: - freq = CLOCK_GetClk16KFreq((uint32_t)kCLOCK_Clk16KToMain); - break; - case kCLOCK_ExtClk: - freq = CLOCK_GetExtClkFreq(); - break; - case kCLOCK_Osc32K0: - freq = CLOCK_GetOsc32KFreq((uint32_t)kCLOCK_Osc32kToVbat); - break; - case kCLOCK_Osc32K1: - freq = CLOCK_GetOsc32KFreq((uint32_t)kCLOCK_Osc32kToVsys); - break; - case kCLOCK_Osc32K2: - freq = CLOCK_GetOsc32KFreq((uint32_t)kCLOCK_Osc32kToWake); - break; - case kCLOCK_Osc32K3: - freq = CLOCK_GetOsc32KFreq((uint32_t)kCLOCK_Osc32kToMain); - break; - case kCLOCK_Pll0Out: - freq = CLOCK_GetPll0OutFreq(); - break; - case kCLOCK_Pll1Out: - freq = CLOCK_GetPll1OutFreq(); - break; - case kCLOCK_UsbPllOut: - /* freq = CLOCK_GetPll0OutFreq();*/ - break; - case kCLOCK_LpOsc: - freq = CLOCK_GetLposcFreq(); - break; - default: - freq = 0U; - break; - } - return freq; -} - -/* Get CTimer Clk */ -/*! brief Return Frequency of CTimer functional Clock - * return Frequency of CTimer functional Clock - */ -uint32_t CLOCK_GetCTimerClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - - switch (SYSCON->CTIMERCLKSEL[id]) - { - case 0U: - freq = CLOCK_GetClk1MFreq(); - break; - case 1U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 2U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK0DIV) & 0xffU) + 1U); - break; - case 3U: - freq = CLOCK_GetFroHfFreq(); - break; - case 4U: - freq = CLOCK_GetFro12MFreq(); - break; - case 5U: - freq = CLOCK_GetSaiMclkFreq(0U); - break; - case 6U: - freq = CLOCK_GetLposcFreq(); - break; - case 8U: - freq = CLOCK_GetSaiMclkFreq(1U); - break; - case 9U: - freq = CLOCK_GetSaiTxBclkFreq(0U); - break; - case 10U: - freq = CLOCK_GetSaiRxBclkFreq(0U); - break; - case 11U: - freq = CLOCK_GetSaiTxBclkFreq(1U); - break; - case 12U: - freq = CLOCK_GetSaiRxBclkFreq(1U); - break; - default: - freq = 0U; - break; - } - - return freq / ((SYSCON->CTIMERCLKDIV[id] & 0xffU) + 1U); -} - -/* Get ADC Clk */ -/*! brief Return Frequency of Adc Clock - * return Frequency of Adc. - */ -uint32_t CLOCK_GetAdcClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - uint32_t div = 0U; - - switch ((id == 0U) ? (SYSCON->ADC0CLKSEL) : (SYSCON->ADC1CLKSEL)) - { - case 1U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 2U: - freq = CLOCK_GetFroHfFreq(); - break; - case 3U: - freq = CLOCK_GetFro12MFreq(); - break; - case 4U: - freq = CLOCK_GetExtClkFreq(); - break; - case 5U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK0DIV) & 0xffU) + 1U); - break; - case 6U: - /* freq = CLOCK_GetUPllOutFreq();*/ - break; - default: - freq = 0U; - break; - } - - div = ((id == 0U) ? ((SYSCON->ADC0CLKDIV & SYSCON_ADC0CLKDIV_DIV_MASK) + 1U) : - ((SYSCON->ADC1CLKDIV & SYSCON_ADC1CLKDIV_DIV_MASK) + 1U)); - - return freq / div; -} - -/* Get LPFLEXCOMM Clk */ -/*! brief Return Frequency of LPFLEXCOMM Clock - * return Frequency of LPFLEXCOMM Clock. - */ -uint32_t CLOCK_GetLPFlexCommClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - - switch (SYSCON->FCCLKSEL[id]) - { - case 1U: - freq = CLOCK_GetPllClkDivFreq(); - break; - case 2U: - freq = CLOCK_GetFro12MFreq(); - break; - case 3U: - freq = CLOCK_GetFroHfFreq() / ((SYSCON->FROHFDIV & 0xffU) + 1U); - break; - case 4U: - freq = CLOCK_GetClk1MFreq(); - break; - case 5U: - /* freq = CLOCK_GetUPllOutFreq();*/ - break; - case 6U: - freq = CLOCK_GetLposcFreq(); - break; - default: - freq = 0U; - break; - } - - return freq / ((SYSCON->FLEXCOMMCLKDIV[id] & 0xffU) + 1U); -} - - -/* Get SYSTEM PLL0 Clk */ -/*! brief Return Frequency of PLL0 - * return Frequency of PLL0 - */ -uint32_t CLOCK_GetPll0OutFreq(void) -{ - uint32_t clkRate = 0; - uint32_t prediv, postdiv; - float workRate = 0.0F; - - /* Get the input clock frequency of PLL. */ - clkRate = CLOCK_GetPLL0InClockRate(); - - /* If PLL0 is work */ - if (CLOCK_IsPLL0Locked() == true) - { - prediv = findPll0PreDiv(); - postdiv = findPll0PostDiv(); - /* Adjust input clock */ - clkRate = clkRate / prediv; - /* MDEC used for rate */ - workRate = (float)clkRate * (float)findPll0MMult(); - workRate /= (float)postdiv; - } - - return (uint32_t)workRate; -} - -/* Get SYSTEM PLL1 Clk */ -/*! brief Return Frequency of PLL1 - * return Frequency of PLL1 - */ -uint32_t CLOCK_GetPll1OutFreq(void) -{ - uint32_t clkRate = 0; - uint32_t prediv, postdiv; - float workRate = 0.0F; - - /* Get the input clock frequency of PLL. */ - clkRate = CLOCK_GetPLL1InClockRate(); - - /* If PLL1 is work */ - if (CLOCK_IsPLL1Locked() == true) - { - prediv = findPll1PreDiv(); - postdiv = findPll1PostDiv(); - /* Adjust input clock */ - clkRate = clkRate / prediv; - /* MDEC used for rate */ - workRate = (float)clkRate * (float)findPll1MMult(); - workRate /= (float)postdiv; - } - - return (uint32_t)workRate; -} - -/* Get PLLClkDiv Clk */ -/*! brief Return Frequency of PLLClkDiv - * return Frequency of PLLClkDiv - */ -uint32_t CLOCK_GetPllClkDivFreq(void) -{ - uint32_t freq = 0U; - - switch (SYSCON->PLLCLKDIVSEL) - { - case 0U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 1U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK0DIV) & 0xffU) + 1U); - break; - default: - freq = 0U; - break; - } - - return freq / ((SYSCON->PLLCLKDIV & SYSCON_PLLCLKDIV_DIV_MASK) + 1U); -} - -/*! - * brief Gets the external UPLL frequency. - * - * This function gets the external UPLL frequency in Hz. - * - * return The frequency of the external UPLL. - */ -uint32_t CLOCK_GetExtUpllFreq(void) -{ - return s_extUpllFreq; -} - -/*! - * brief Sets the external UPLL frequency. - * - * This function sets the external UPLL frequency in Hz. - * Call this function after the external PLL frequency is changed. - * Otherwise, the APIs, which are used to get the frequency, may return an incorrect value. - * - * param The frequency of external UPLL. - */ -void CLOCK_SetExtUpllFreq(uint32_t freq) -{ - s_extUpllFreq = freq; -} - -/* Get I3C function Clk */ -/*! brief Return Frequency of I3C function clock - * return Frequency of I3C function Clock - */ -uint32_t CLOCK_GetI3cClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - uint32_t div = 0U; - - switch ((id == 0U) ? (SYSCON->I3C0FCLKSEL) : (SYSCON->I3C1FCLKSEL)) - { - case 1U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 3U: - freq = CLOCK_GetFroHfFreq(); - break; - case 4U: - freq = CLOCK_GetClk1MFreq(); - break; - case 5U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK0DIV) & 0xffU) + 1U); - break; - case 6U: - /* freq = CLOCK_GetUPllOutFreq();*/ - default: - freq = 0U; - break; - } - - div = ((id == 0U) ? ((SYSCON->I3C0FCLKDIV & SYSCON_I3C0FCLKDIV_DIV_MASK) + 1U) : - ((SYSCON->I3C1FCLKDIV & SYSCON_I3C1FCLKDIV_DIV_MASK) + 1U)); - - return freq / div; -} - -/* Get MICFIL Clk */ -/*! brief Return Frequency of MICFIL - * return Frequency of MICFIL - */ -uint32_t CLOCK_GetMicfilClkFreq(void) -{ - uint32_t freq = 0U; - - switch (SYSCON->MICFILFCLKSEL) - { - case 0U: - freq = CLOCK_GetFro12MFreq(); - break; - case 1U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 2U: - freq = CLOCK_GetExtClkFreq(); - break; - case 3U: - freq = CLOCK_GetFroHfFreq(); - break; - case 4U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK0DIV) & 0xffU) + 1U); - break; - case 5U: - freq = CLOCK_GetSaiMclkFreq(0U); - break; - case 6U: - /* freq = CLOCK_GetUPllOutFreq();*/ - case 8U: - freq = CLOCK_GetSaiMclkFreq(1U); - break; - default: - freq = 0U; - break; - } - - return freq / ((SYSCON->MICFILFCLKDIV & SYSCON_MICFILFCLKDIV_DIV_MASK) + 1U); -} - -/* Get FLEXIO Clk */ -/*! brief Return Frequency of FLEXIO - * return Frequency of FLEXIO - */ -uint32_t CLOCK_GetFlexioClkFreq(void) -{ - uint32_t freq = 0U; - - switch (SYSCON->FLEXIOCLKSEL) - { - case 1U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 2U: - freq = CLOCK_GetExtClkFreq(); - break; - case 3U: - freq = CLOCK_GetFroHfFreq(); - break; - case 4U: - freq = CLOCK_GetFro12MFreq(); - break; - case 5U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK0DIV) & 0xffU) + 1U); - break; - case 6U: - /* freq = CLOCK_GetUPllOutFreq();*/ - default: - freq = 0U; - break; - } - - return freq / ((SYSCON->FLEXIOCLKDIV & SYSCON_FLEXIOCLKDIV_DIV_MASK) + 1U); -} - -/* Get FLEXCAN Clk */ -/*! brief Return Frequency of FLEXCAN - * return Frequency of FLEXCAN - */ -uint32_t CLOCK_GetFlexcanClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - uint32_t div = 0U; - - switch ((id == 0U) ? (SYSCON->FLEXCAN0CLKSEL) : (SYSCON->FLEXCAN1CLKSEL)) - { - case 1U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 2U: - freq = CLOCK_GetExtClkFreq(); - break; - case 3U: - freq = CLOCK_GetFroHfFreq(); - break; - case 5U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK0DIV) & 0xffU) + 1U); - break; - case 6U: - /* freq = CLOCK_GetUPllOutFreq();*/ - default: - freq = 0U; - break; - } - - div = ((id == 0U) ? ((SYSCON->FLEXCAN0CLKDIV & SYSCON_FLEXCAN0CLKDIV_DIV_MASK) + 1U) : - ((SYSCON->FLEXCAN1CLKDIV & SYSCON_FLEXCAN1CLKDIV_DIV_MASK) + 1U)); - - return freq / div; -} - -/* Get EWM0 Clk */ -/*! brief Return Frequency of EWM0 - * return Frequency of EWM0 - */ -uint32_t CLOCK_GetEwm0ClkFreq(void) -{ - uint32_t freq = 0U; - - switch (SYSCON->EWM0CLKSEL) - { - case 1U: - freq = CLOCK_GetClk16KFreq((uint32_t)kCLOCK_Clk16KToWake); - break; - case 2U: - freq = CLOCK_GetOsc32KFreq((uint32_t)kCLOCK_Osc32kToWake); - break; - default: - freq = 0U; - break; - } - - return freq; -} - -/* Get Watchdog Clk */ -/*! brief Return Frequency of Watchdog - * return Frequency of Watchdog - */ -uint32_t CLOCK_GetWdtClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - uint32_t div = 0U; - - if (id == 0U) - { - freq = CLOCK_GetClk1MFreq(); - } - else - { - switch (SYSCON->WDT1CLKSEL) - { - case 0U: - freq = CLOCK_GetClk16KFreq((uint32_t)kCLOCK_Clk16KToWake); - break; - case 1U: - freq = CLOCK_GetFroHfFreq() / ((SYSCON->FROHFDIV & 0xffU) + 1U); - break; - case 2U: - freq = CLOCK_GetClk1MFreq(); - break; - case 3U: - freq = CLOCK_GetClk1MFreq(); - break; - default: - freq = 0U; - break; - } - } - - div = ((id == 0U) ? ((SYSCON->WDT0CLKDIV & SYSCON_WDT0CLKDIV_DIV_MASK) + 1U) : - ((SYSCON->WDT1CLKDIV & SYSCON_WDT1CLKDIV_DIV_MASK) + 1U)); - - return freq / div; -} - -/* Get OSTIMER Clk */ -/*! brief Return Frequency of OSTIMER - * return Frequency of OSTIMER - */ -uint32_t CLOCK_GetOstimerClkFreq(void) -{ - uint32_t freq = 0U; - - switch (SYSCON->OSTIMERCLKSEL) - { - case 0U: - freq = CLOCK_GetClk16KFreq((uint32_t)kCLOCK_Clk16KToWake); - break; - case 1U: - freq = CLOCK_GetOsc32KFreq((uint32_t)kCLOCK_Osc32kToWake); - break; - case 2U: - freq = CLOCK_GetClk1MFreq(); - break; - default: - freq = 0U; - break; - } - - return freq; -} - -/* Get CMP Function Clk */ -/*! brief Return Frequency of CMP Function - * return Frequency of CMP Function - */ -uint32_t CLOCK_GetCmpFClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - uint32_t div = 0U; - - switch ((id == 0U) ? (SYSCON->CMP0FCLKSEL) : (SYSCON->CMP1FCLKSEL)) - { - case 1U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 2U: - freq = CLOCK_GetFroHfFreq(); - break; - case 3U: - freq = CLOCK_GetFro12MFreq(); - break; - case 4U: - freq = CLOCK_GetExtClkFreq(); - break; - case 5U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK0DIV) & 0xffU) + 1U); - break; - case 6U: - /* freq = CLOCK_GetUPllOutFreq();*/ - default: - freq = 0U; - break; - } - - div = ((id == 0U) ? ((SYSCON->CMP0FCLKDIV & SYSCON_CMP0FCLKDIV_DIV_MASK) + 1U) : - ((SYSCON->CMP1FCLKDIV & SYSCON_CMP1FCLKDIV_DIV_MASK) + 1U)); - - return freq / div; -} - -/* Get CMP Round Robin Clk */ -/*! brief Return Frequency of CMP Round Robin - * return Frequency of CMP Round Robin - */ -uint32_t CLOCK_GetCmpRRClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - uint32_t div = 0U; - - switch ((id == 0U) ? (SYSCON->CMP0RRCLKSEL) : (SYSCON->CMP1RRCLKSEL)) - { - case 1U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 2U: - freq = CLOCK_GetFroHfFreq(); - break; - case 3U: - freq = CLOCK_GetFro12MFreq(); - break; - case 4U: - freq = CLOCK_GetExtClkFreq(); - break; - case 5U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK0DIV) & 0xffU) + 1U); - break; - case 6U: - /* freq = CLOCK_GetUPllOutFreq();*/ - default: - freq = 0U; - break; - } - - div = ((id == 0U) ? ((SYSCON->CMP0RRCLKDIV & SYSCON_CMP0RRCLKDIV_DIV_MASK) + 1U) : - ((SYSCON->CMP1RRCLKDIV & SYSCON_CMP1RRCLKDIV_DIV_MASK) + 1U)); - - return freq / div; -} - -/* Get UTICK Clk */ -/*! brief Return Frequency of UTICK - * return Frequency of UTICK - */ -uint32_t CLOCK_GetUtickClkFreq(void) -{ - uint32_t freq = 0U; - uint32_t div = ((SYSCON->UTICKCLKDIV & SYSCON_UTICKCLKDIV_DIV_MASK) + 1U); - - switch (SYSCON->UTICKCLKSEL) - { - case 0U: - freq = CLOCK_GetExtClkFreq(); - break; - case 1U: - freq = CLOCK_GetOsc32KFreq((uint32_t)kCLOCK_Osc32kToWake); - break; - case 2U: - freq = CLOCK_GetClk1MFreq(); - break; - default: - freq = 0U; - break; - } - return freq / div; -} - -/* Get SAI Clk */ -/*! brief Return Frequency of SAI - * return Frequency of SAI - */ -uint32_t CLOCK_GetSaiClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - uint32_t div = 0U; - - switch ((id == 0U) ? (SYSCON->SAI0CLKSEL) : (SYSCON->SAI1CLKSEL)) - { - case 1U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 2U: - freq = CLOCK_GetExtClkFreq(); - break; - case 3U: - freq = CLOCK_GetFroHfFreq(); - break; - case 4U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK0DIV) & 0xffU) + 1U); - break; - case 6U: - /* freq = CLOCK_GetUPllOutFreq();*/ - default: - freq = 0U; - break; - } - - div = ((id == 0U) ? ((SYSCON->SAI0CLKDIV & SYSCON_SAI0CLKDIV_DIV_MASK) + 1U) : - ((SYSCON->SAI1CLKDIV & SYSCON_SAI1CLKDIV_DIV_MASK) + 1U)); - - return freq / div; -} - -/* Get SAI MCLK */ -/*! brief Initialize the SAI MCLK to given frequency. - * return Nothing - */ -void CLOCK_SetupSaiMclk(uint32_t id, uint32_t iFreq) -{ - s_Sai_Mclk_Freq[id] = iFreq; - - return; -} - -/* Get SAI TX BCLK */ -/*! brief Initialize the SAI TX BCLK to given frequency. - * return Nothing - */ -void CLOCK_SetupSaiTxBclk(uint32_t id, uint32_t iFreq) -{ - s_Sai_Tx_Bclk_Freq[id] = iFreq; - - return; -} - -/* Get SAI RX BCLK */ -/*! brief Initialize the SAI RX BCLK to given frequency. - * return Nothing - */ -void CLOCK_SetupSaiRxBclk(uint32_t id, uint32_t iFreq) -{ - s_Sai_Rx_Bclk_Freq[id] = iFreq; - - return; -} - -/* Get SAI MCLK */ -/*! brief Return Frequency of SAI MCLK - * return Frequency of SAI MCLK - */ -uint32_t CLOCK_GetSaiMclkFreq(uint32_t id) -{ - return s_Sai_Mclk_Freq[id]; -} - -/* Get SAI TX BCLK */ -/*! brief Return Frequency of SAI TX BCLK - * return Frequency of SAI TX BCLK - */ -uint32_t CLOCK_GetSaiTxBclkFreq(uint32_t id) -{ - return s_Sai_Tx_Bclk_Freq[id]; -} - -/* Get SAI RX BCLK */ -/*! brief Return Frequency of SAI RX BCLK - * return Frequency of SAI RX BCLK - */ -uint32_t CLOCK_GetSaiRxBclkFreq(uint32_t id) -{ - return s_Sai_Rx_Bclk_Freq[id]; -} - -/* Return System PLL input clock rate */ -/*! brief Return PLL0 input clock rate - * return PLL0 input clock rate - */ -uint32_t CLOCK_GetPLL0InClockRate(void) -{ - uint32_t clkRate = 0U; - - switch ((SCG0->APLLCTRL & SCG_APLLCTRL_SOURCE_MASK) >> SCG_APLLCTRL_SOURCE_SHIFT) - { - case 0x00U: - clkRate = CLOCK_GetExtClkFreq(); - break; - case 0x01U: - clkRate = CLOCK_GetClk48MFreq(); - break; - case 0x02U: - clkRate = CLOCK_GetOsc32KFreq((uint32_t)kCLOCK_Osc32kToVbat); - break; - default: - clkRate = 0U; - break; - } - - return clkRate; -} - -/* Return PLL1 input clock rate */ -uint32_t CLOCK_GetPLL1InClockRate(void) -{ - uint32_t clkRate = 0U; - - switch ((SCG0->SPLLCTRL & SCG_SPLLCTRL_SOURCE_MASK) >> SCG_SPLLCTRL_SOURCE_SHIFT) - { - case 0x00U: - clkRate = CLOCK_GetExtClkFreq(); - break; - case 0x01U: - clkRate = CLOCK_GetClk48MFreq(); - break; - case 0x02U: - clkRate = CLOCK_GetOsc32KFreq((uint32_t)kCLOCK_Osc32kToVbat); - break; - default: - clkRate = 0U; - break; - } - - return clkRate; -} - -/* Return PLL output clock rate from setup structure */ -/*! brief Return PLL0 output clock rate from setup structure - * param pSetup : Pointer to a PLL setup structure - * return PLL0 output clock rate the setup structure will generate - */ -uint32_t CLOCK_GetPLLOutFromSetup(pll_setup_t *pSetup) -{ - uint32_t clkRate = 0; - uint32_t prediv, postdiv; - float workRate = 0.0F; - - /* Get the input clock frequency of PLL. */ - clkRate = CLOCK_GetPLLInClockRateFromSetup(pSetup); - - prediv = findPllPreDivFromSetup(pSetup); - postdiv = findPllPostDivFromSetup(pSetup); - /* Adjust input clock */ - clkRate = clkRate / prediv; - /* MDEC used for rate */ - workRate = (float)clkRate * (float)findPllMMultFromSetup(pSetup); - workRate /= (float)postdiv; - - return (uint32_t)workRate; -} - -/* Set PLL output based on the passed PLL setup data */ -/*! brief Set PLL output based on the passed PLL setup data - * param pControl : Pointer to populated PLL control structure to generate setup with - * param pSetup : Pointer to PLL setup structure to be filled - * return PLL_ERROR_SUCCESS on success, or PLL setup error code - * note Actual frequency for setup may vary from the desired frequency based on the - * accuracy of input clocks, rounding, non-fractional PLL mode, etc. - */ -pll_error_t CLOCK_SetupPLLData(pll_config_t *pControl, pll_setup_t *pSetup) -{ - uint32_t inRate; - bool useSS = (bool)((pControl->flags & PLL_CONFIGFLAG_FORCENOFRACT) == 0UL); - - pll_error_t pllError; - - /* Get PLL Input Clock Rate */ - switch (pControl->inputSource) - { - case (uint32_t)kPll_ClkSrcSysOsc: - inRate = CLOCK_GetExtClkFreq(); - break; - case (uint32_t)kPll_ClkSrcFirc: - inRate = CLOCK_GetClk48MFreq(); - break; - case (uint32_t)kPll_ClkSrcRosc: - inRate = CLOCK_GetOsc32KFreq((uint32_t)kCLOCK_Osc32kToVbat); - break; - default: - inRate = 0U; - break; - } - - /* PLL flag options */ - pllError = CLOCK_GetPllConfig(inRate, pControl->desiredRate, pSetup, useSS); - pSetup->pllctrl |= (uint32_t)pControl->inputSource; - if ((useSS) && (pllError == kStatus_PLL_Success)) - { - /* If using SS mode, then some tweaks are made to the generated setup */ - pSetup->pllsscg[1] |= (uint32_t)pControl->ss_mf | (uint32_t)pControl->ss_mr | (uint32_t)pControl->ss_mc; - if (pControl->mfDither) - { - pSetup->pllsscg[1] |= (1UL << SCG_APLLSSCG1_DITHER_SHIFT); - } - } - - return pllError; -} - -/* Setup PLL Frequency from pre-calculated value */ -/** - * brief Set PLL0 output from PLL setup structure (precise frequency) - * param pSetup : Pointer to populated PLL setup structure - * return kStatus_PLL_Success on success, or PLL setup error code - * note This function will power off the PLL, setup the PLL with the - * new setup data, and then optionally powerup the PLL, wait for PLL lock, - * and adjust system voltages to the new PLL rate. The function will not - * alter any source clocks (ie, main systen clock) that may use the PLL, - * so these should be setup prior to and after exiting the function. - */ -pll_error_t CLOCK_SetPLL0Freq(const pll_setup_t *pSetup) -{ - uint32_t inRate, clkRate, prediv; - - /* Enable LDO */ - SCG0->LDOCSR |= SCG_LDOCSR_LDOEN_MASK; - - /* Power off PLL0 and disable PLL0 clock during setup changes */ - SCG0->APLLCSR &= ~(SCG_APLLCSR_APLLPWREN_MASK | SCG_APLLCSR_APLLCLKEN_MASK); - - /* Write PLL setup data */ - SCG0->APLLCTRL = pSetup->pllctrl; - SCG0->APLLNDIV = pSetup->pllndiv; - SCG0->APLLNDIV = pSetup->pllndiv | (1UL << SCG_APLLNDIV_NREQ_SHIFT); /* latch */ - SCG0->APLLPDIV = pSetup->pllpdiv; - SCG0->APLLPDIV = pSetup->pllpdiv | (1UL << SCG_APLLPDIV_PREQ_SHIFT); /* latch */ - SCG0->APLLMDIV = pSetup->pllmdiv; - SCG0->APLLMDIV = pSetup->pllmdiv | (1UL << SCG_APLLMDIV_MREQ_SHIFT); /* latch */ - SCG0->APLLSSCG0 = pSetup->pllsscg[0]; - SCG0->APLLSSCG1 = pSetup->pllsscg[1]; - - /* Unlock APLLLOCK_CNFG register */ - SCG0->TRIM_LOCK = 0x5a5a0001; - - /* Configure lock time of APLL stable, value = 500us/x+300, where x is the period of clk_ref (clk_in/N). */ - inRate = CLOCK_GetPLL0InClockRate(); - prediv = findPll0PreDiv(); - /* Adjust input clock */ - clkRate = inRate / prediv; - SCG0->APLLLOCK_CNFG = SCG_APLLLOCK_CNFG_LOCK_TIME(clkRate / 2000U + 300U); - - /* Power on PLL0 and enable PLL0 clock */ - SCG0->APLLCSR |= (SCG_APLLCSR_APLLPWREN_MASK | SCG_APLLCSR_APLLCLKEN_MASK); - - /* Wait for APLL lock */ - while (CLOCK_IsPLL0Locked() == false) - { - } - - if (pSetup->pllRate != CLOCK_GetPll0OutFreq()) - { - return kStatus_PLL_OutputError; - } - - return kStatus_PLL_Success; -} - -/* Setup PLL1 Frequency from pre-calculated value */ -/** - * brief Set PLL1 output from PLL setup structure (precise frequency) - * param pSetup : Pointer to populated PLL setup structure - * return kStatus_PLL_Success on success, or PLL setup error code - * note This function will power off the PLL, setup the PLL with the - * new setup data, and then optionally powerup the PLL, wait for PLL lock, - * and adjust system voltages to the new PLL rate. The function will not - * alter any source clocks (ie, main systen clock) that may use the PLL, - * so these should be setup prior to and after exiting the function. - */ -pll_error_t CLOCK_SetPLL1Freq(const pll_setup_t *pSetup) -{ - uint32_t inRate, clkRate, prediv; - - /* Enable LDO */ - SCG0->LDOCSR |= SCG_LDOCSR_LDOEN_MASK; - - /* Power off PLL1 and disable PLL1 clock during setup changes */ - SCG0->SPLLCSR &= ~(SCG_SPLLCSR_SPLLPWREN_MASK | SCG_SPLLCSR_SPLLCLKEN_MASK); - - /* Write PLL setup data */ - SCG0->SPLLCTRL = pSetup->pllctrl; - SCG0->SPLLNDIV = pSetup->pllndiv; - SCG0->SPLLNDIV = pSetup->pllndiv | (1UL << SCG_SPLLNDIV_NREQ_SHIFT); /* latch */ - SCG0->SPLLPDIV = pSetup->pllpdiv; - SCG0->SPLLPDIV = pSetup->pllpdiv | (1UL << SCG_SPLLPDIV_PREQ_SHIFT); /* latch */ - SCG0->SPLLMDIV = pSetup->pllmdiv; - SCG0->SPLLMDIV = pSetup->pllmdiv | (1UL << SCG_SPLLMDIV_MREQ_SHIFT); /* latch */ - SCG0->SPLLSSCG0 = pSetup->pllsscg[0]; - SCG0->SPLLSSCG1 = pSetup->pllsscg[1]; - - /* Unlock SPLLLOCK_CNFG register */ - SCG0->TRIM_LOCK = 0x5a5a0001; - - /* Configure lock time of APLL stable, value = 500μs/x+300, where x is the period of clk_ref (clk_in/N). */ - inRate = CLOCK_GetPLL1InClockRate(); - prediv = findPll1PreDiv(); - /* Adjust input clock */ - clkRate = inRate / prediv; - SCG0->SPLLLOCK_CNFG = SCG_SPLLLOCK_CNFG_LOCK_TIME(clkRate / 2000U + 300U); - - /* Power on PLL1 and enable PLL1 clock */ - SCG0->SPLLCSR |= (SCG_SPLLCSR_SPLLPWREN_MASK | SCG_SPLLCSR_SPLLCLKEN_MASK); - - /* Wait for APLL lock */ - while (CLOCK_IsPLL1Locked() == false) - { - } - - if (pSetup->pllRate != CLOCK_GetPll1OutFreq()) - { - return kStatus_PLL_OutputError; - } - - return kStatus_PLL_Success; -} - -/*! @brief Enable the OSTIMER 32k clock. - * @return Nothing - */ -void CLOCK_EnableOstimer32kClock(void) -{ - /* PMC->OSEVENTTIMER |= PMC_OSEVENTTIMER_CLOCKENABLE_MASK;*/ -} - -/* Get FRO 12M Clk */ -/*! brief Return Frequency of FRO 12MHz - * return Frequency of FRO 12MHz - */ -static uint32_t CLOCK_GetFro12MFreq(void) -{ - return ((SCG0->SIRCCSR & SCG_SIRCCSR_SIRC_CLK_PERIPH_EN_MASK) != 0UL) ? 12000000U : 0U; -} - -/* Get CLK 1M Clk */ -/*! brief Return Frequency of CLK 1MHz - * return Frequency of CLK 1MHz - */ -static uint32_t CLOCK_GetClk1MFreq(void) -{ - return 1000000U; -} - -/* Get HF FRO Clk */ -/*! brief Return Frequency of High-Freq output of FRO - * return Frequency of High-Freq output of FRO - */ -static uint32_t CLOCK_GetFroHfFreq(void) -{ - uint32_t freq; - - if ((SCG0->FIRCCSR & SCG_FIRCCSR_FIRCEN_MASK) == 0UL) - { - freq = 0; - } - else if ((SCG0->FIRCCFG & SCG_FIRCCFG_RANGE_MASK) != 0UL) - { - freq = 144000000U; - } - else - { - freq = 48000000U; - } - - return freq; -} - -/* Get CLK 48M Clk */ -/*! brief Return Frequency of CLK 48MHz - * return Frequency of CLK 48MHz - */ -static uint32_t CLOCK_GetClk48MFreq(void) -{ - return ((SCG0->FIRCCSR & SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_MASK) != 0U) ? 48000000U : 0U; -} - -/* Get CLK 144M Clk */ -/*! brief Return Frequency of CLK 144MHz - * return Frequency of CLK 144MHz - */ -static uint32_t CLOCK_GetClk144MFreq(void) -{ - return ((SCG0->FIRCCSR & SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN_MASK) != 0U) ? 144000000U : 0U; -} - -/* Get CLK 16K Clk */ -/*! brief Return Frequency of CLK 16KHz - * return Frequency of CLK 16KHz - */ -static uint32_t CLOCK_GetClk16KFreq(uint32_t id) -{ - return ((VBAT0->FROCTLA & VBAT_FROCTLA_FRO_EN_MASK) != 0U) ? - (((VBAT0->FROCLKE & VBAT_FROCLKE_CLKE(id)) != 0UL) ? 16000U : 0U) : - 0U; -} - -/* Get EXT OSC Clk */ -/*! brief Return Frequency of External Clock - * return Frequency of External Clock. If no external clock is used returns 0. - */ -static uint32_t CLOCK_GetExtClkFreq(void) -{ - return ((SCG0->SOSCCSR & SCG_SOSCCSR_SOSCVLD_MASK) != 0UL) ? s_Ext_Clk_Freq : 0U; -} - -/* Get RTC OSC Clk */ -/*! brief Return Frequency of 32kHz osc - * return Frequency of 32kHz osc - */ -static uint32_t CLOCK_GetOsc32KFreq(uint32_t id) -{ - return ((SCG0->ROSCCSR & SCG_ROSCCSR_ROSCVLD_MASK) != 0UL) ? - (((VBAT0->OSCCLKE & VBAT_OSCCLKE_CLKE(id)) != 0UL) ? s_Xtal32_Freq : 0U) : - 0U; -} - -/* Get MAIN Clk */ -/*! brief Return Frequency of Core System - * return Frequency of Core System - */ -uint32_t CLOCK_GetCoreSysClkFreq(void) -{ - uint32_t freq = 0U; - - switch ((SCG0->CSR & SCG_CSR_SCS_MASK) >> SCG_CSR_SCS_SHIFT) - { - case 1U: - freq = CLOCK_GetExtClkFreq(); - break; - case 2U: - freq = CLOCK_GetFro12MFreq(); - break; - case 3U: - freq = CLOCK_GetFroHfFreq(); - break; - case 4U: - freq = CLOCK_GetOsc32KFreq((uint32_t)kCLOCK_Osc32kToWake); - break; - case 5U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 6U: - freq = CLOCK_GetPll1OutFreq(); - break; - case 7U: - /* freq = CLOCK_GetUPllOutFreq();*/ - break; - default: - freq = 0U; - break; - } - - return freq; -} - -/* Get Systick Clk */ -/*! brief Return Frequency of SystickClock - * return Frequency of Systick Clock - */ -static uint32_t CLOCK_GetSystickClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - - switch (SYSCON->SYSTICKCLKSEL0) - { - case 0U: - freq = CLOCK_GetCoreSysClkFreq() / (((SYSCON->SYSTICKCLKDIV[id]) & 0xffU) + 1U); - break; - case 1U: - freq = CLOCK_GetClk1MFreq(); - break; - case 2U: - freq = CLOCK_GetLposcFreq(); - break; - default: - freq = 0U; - break; - } - - return freq; -} - -/* Get CLOCK OUT Clk */ -/*! brief Return Frequency of ClockOut - * return Frequency of ClockOut - */ -static uint32_t CLOCK_GetClockOutClkFreq(void) -{ - uint32_t freq = 0U; - - switch (SYSCON->CLKOUTSEL) - { - case 0U: - freq = CLOCK_GetCoreSysClkFreq(); - break; - case 1U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 2U: - freq = CLOCK_GetExtClkFreq(); - break; - case 3U: - freq = CLOCK_GetFroHfFreq(); - break; - case 4U: - freq = CLOCK_GetFro12MFreq(); - break; - case 5U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK0DIV) & 0xffU) + 1U); - break; - case 6U: - freq = CLOCK_GetLposcFreq(); - break; - case 7U: - /* freq = CLOCK_GetUPllOutFreq();*/ - break; - default: - freq = 0U; - break; - } - return freq / ((SYSCON->CLKOUTDIV & 0xffU) + 1U); -} - -/* Get LP_OSC Clk */ -/*! brief Return Frequency of LP_OSC - * return Frequency of LP_OSC - */ -static uint32_t CLOCK_GetLposcFreq(void) -{ - uint32_t freq = 0U; - - switch ((RTC0->CTRL & RTC_CTRL_CLK_SEL_MASK) >> RTC_CTRL_CLK_SEL_SHIFT) - { - case 1U: - freq = CLOCK_GetOsc32KFreq((uint32_t)kCLOCK_Osc32kToVbat); - break; - case 2U: - freq = CLOCK_GetClk16KFreq((uint32_t)kCLOCK_Clk16KToVbat); - break; - default: - freq = 0U; - break; - } - - return freq; -} - -/* Find SELP, SELI, and SELR values for raw M value, max M = MVALMAX */ -static void pllFindSel(uint32_t M, uint32_t *pSelP, uint32_t *pSelI, uint32_t *pSelR) -{ - uint32_t seli, selp; - /* bandwidth: compute selP from Multiplier */ - if ((SCG0->APLLCTRL & SCG_APLLCTRL_LIMUPOFF_MASK) == 0UL) /* normal mode */ - { - selp = (M >> 2U) + 1U; - if (selp >= 31U) - { - selp = 31U; - } - *pSelP = selp; - - if (M >= 8000UL) - { - seli = 1UL; - } - else if (M >= 122UL) - { - seli = (uint32_t)(8000UL / M); /*floor(8000/M) */ - } - else - { - seli = 2UL * ((uint32_t)(M / 4UL)) + 3UL; /* 2*floor(M/4) + 3 */ - } - - if (seli >= 63UL) - { - seli = 63UL; - } - *pSelI = seli; - - *pSelR = 0U; - } - else - { - /* Note: If the spread spectrum and fractional mode, choose N to ensure 3 MHz < Fin/N < 5 MHz */ - *pSelP = 3U; - *pSelI = 4U; - *pSelR = 4U; - } -} - -/* Get predivider (N) from PLL0 NDIV setting */ -static uint32_t findPll0PreDiv(void) -{ - uint32_t preDiv = 1UL; - - /* Direct input is not used? */ - if ((SCG0->APLLCTRL & SCG_APLLCTRL_BYPASSPREDIV_MASK) == 0UL) - { - preDiv = SCG0->APLLNDIV & SCG_APLLNDIV_NDIV_MASK; - if (preDiv == 0UL) - { - preDiv = 1UL; - } - } - return preDiv; -} - -/* Get predivider (N) from PLL1 NDIV setting */ -static uint32_t findPll1PreDiv(void) -{ - uint32_t preDiv = 1UL; - - /* Direct input is not used? */ - if ((SCG0->SPLLCTRL & SCG_SPLLCTRL_BYPASSPREDIV_MASK) == 0UL) - { - preDiv = SCG0->SPLLNDIV & SCG_SPLLNDIV_NDIV_MASK; - if (preDiv == 0UL) - { - preDiv = 1UL; - } - } - return preDiv; -} - -/* Get postdivider (P) from PLL0 PDIV setting */ -static uint32_t findPll0PostDiv(void) -{ - uint32_t postDiv = 1UL; - - if ((SCG0->APLLCTRL & SCG_APLLCTRL_BYPASSPOSTDIV_MASK) == 0UL) - { - if ((SCG0->APLLCTRL & SCG_APLLCTRL_BYPASSPOSTDIV2_MASK) != 0UL) - { - postDiv = SCG0->APLLPDIV & SCG_APLLPDIV_PDIV_MASK; - } - else - { - postDiv = 2UL * (SCG0->APLLPDIV & SCG_APLLPDIV_PDIV_MASK); - } - if (postDiv == 0UL) - { - postDiv = 2UL; - } - } - - return postDiv; -} - -/* Get postdivider (P) from PLL1 PDIV setting. */ -static uint32_t findPll1PostDiv(void) -{ - uint32_t postDiv = 1UL; - - if ((SCG0->SPLLCTRL & SCG_SPLLCTRL_BYPASSPOSTDIV_MASK) == 0UL) - { - if ((SCG0->SPLLCTRL & SCG_SPLLCTRL_BYPASSPOSTDIV2_MASK) != 0UL) - { - postDiv = SCG0->SPLLPDIV & SCG_SPLLPDIV_PDIV_MASK; - } - else - { - postDiv = 2UL * (SCG0->SPLLPDIV & SCG_SPLLPDIV_PDIV_MASK); - } - if (postDiv == 0UL) - { - postDiv = 2UL; - } - } - - return postDiv; -} - -/* Get multiplier (M) from PLL0 SSCG and SEL_EXT settings */ -static float findPll0MMult(void) -{ - float mMult = 1.0F; - float mMult_fract; - uint32_t mMult_int; - - if ((SCG0->APLLSSCG1 & SCG_APLLSSCG1_SEL_SS_MDIV_MASK) == 0UL) - { - mMult = (float)(uint32_t)(SCG0->APLLMDIV & SCG_APLLMDIV_MDIV_MASK); - } - else - { - mMult_int = ((SCG0->APLLSSCG1 & SCG_APLLSSCG1_SS_MDIV_MSB_MASK) << 7U); - mMult_int = mMult_int | ((SCG0->APLLSSCG0) >> PLL_SSCG_MD_INT_P); - mMult_fract = - ((float)(uint32_t)((SCG0->APLLSSCG0) & PLL_SSCG_MD_FRACT_M) / (float)(uint32_t)(1UL << PLL_SSCG_MD_INT_P)); - mMult = (float)mMult_int + mMult_fract; - } - if (0ULL == ((uint64_t)mMult)) - { - mMult = 1.0F; - } - return mMult; -} - -/* Get multiplier (M) from PLL1 MDEC. */ -static float findPll1MMult(void) -{ - float mMult = 1.0F; - float mMult_fract; - uint32_t mMult_int; - - if ((SCG0->SPLLSSCG1 & SCG_SPLLSSCG1_SEL_SS_MDIV_MASK) == 0UL) - { - mMult = (float)(uint32_t)(SCG0->SPLLMDIV & SCG_SPLLMDIV_MDIV_MASK); - } - else - { - mMult_int = ((SCG0->SPLLSSCG1 & SCG_SPLLSSCG1_SS_MDIV_MSB_MASK) << 7U); - mMult_int = mMult_int | ((SCG0->SPLLSSCG0) >> PLL_SSCG_MD_INT_P); - mMult_fract = - ((float)(uint32_t)((SCG0->SPLLSSCG0) & PLL_SSCG_MD_FRACT_M) / (float)(uint32_t)(1UL << PLL_SSCG_MD_INT_P)); - mMult = (float)mMult_int + mMult_fract; - } - if (0ULL == ((uint64_t)mMult)) - { - mMult = 1.0F; - } - return mMult; -} - -/* Find greatest common divisor between m and n */ -static uint32_t FindGreatestCommonDivisor(uint32_t m, uint32_t n) -{ - uint32_t tmp; - - while (n != 0U) - { - tmp = n; - n = m % n; - m = tmp; - } - - return m; -} - -#if (defined(CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT) && CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT) -/* Alloct the static buffer for cache. */ -static pll_setup_t s_PllSetupCacheStruct[CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT]; -static uint32_t s_FinHzCache[CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT] = {0}; -static uint32_t s_FoutHzCache[CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT] = {0}; -static bool s_UseSSCache[CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT] = {false}; -static uint32_t s_PllSetupCacheIdx = 0U; -#endif /* CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT */ - -/* - * Calculate the PLL setting values from input clock freq to output freq. - */ -static pll_error_t CLOCK_GetPllConfig(uint32_t finHz, uint32_t foutHz, pll_setup_t *pSetup, bool useSS) -{ - pll_error_t retErr; -#if (defined(CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT) && CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT) - uint32_t i; - - for (i = 0U; i < CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT; i++) - { - if ((finHz == s_FinHzCache[i]) && (foutHz == s_FoutHzCache[i]) && (useSS == s_UseSSCache[i])) - { - /* Hit the target in cache buffer. */ - pSetup->pllctrl = s_PllSetupCacheStruct[i].pllctrl; - pSetup->pllndiv = s_PllSetupCacheStruct[i].pllndiv; - pSetup->pllmdiv = s_PllSetupCacheStruct[i].pllmdiv; - pSetup->pllpdiv = s_PllSetupCacheStruct[i].pllpdiv; - pSetup->pllsscg[0] = s_PllSetupCacheStruct[i].pllsscg[0]; - pSetup->pllsscg[1] = s_PllSetupCacheStruct[i].pllsscg[1]; - retErr = kStatus_PLL_Success; - break; - } - } - - if (i < CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT) - { - return retErr; - } -#endif /* CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT */ - - retErr = CLOCK_GetPllConfigInternal(finHz, foutHz, pSetup, useSS); - -#if (defined(CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT) && CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT) - /* Cache the most recent calulation result into buffer. */ - s_FinHzCache[s_PllSetupCacheIdx] = finHz; - s_FoutHzCache[s_PllSetupCacheIdx] = foutHz; - s_UseSSCache[s_PllSetupCacheIdx] = useSS; - - s_PllSetupCacheStruct[s_PllSetupCacheIdx].pllctrl = pSetup->pllctrl; - s_PllSetupCacheStruct[s_PllSetupCacheIdx].pllndiv = pSetup->pllndiv; - s_PllSetupCacheStruct[s_PllSetupCacheIdx].pllmdiv = pSetup->pllmdiv; - s_PllSetupCacheStruct[s_PllSetupCacheIdx].pllpdiv = pSetup->pllpdiv; - s_PllSetupCacheStruct[s_PllSetupCacheIdx].pllsscg[0] = pSetup->pllsscg[0]; - s_PllSetupCacheStruct[s_PllSetupCacheIdx].pllsscg[1] = pSetup->pllsscg[1]; - /* Update the index for next available buffer. */ - s_PllSetupCacheIdx = (s_PllSetupCacheIdx + 1U) % CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT; -#endif /* CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT */ - - return retErr; -} - -/* - * Set PLL output based on desired output rate. - * In this function, the it calculates the PLL0 setting for output frequency from input clock - * frequency. The calculation would cost a few time. So it is not recommaned to use it frequently. - * the "pllctrl", "pllndiv", "pllpdiv", "pllmdiv" would updated in this function. - */ -static pll_error_t CLOCK_GetPllConfigInternal(uint32_t finHz, uint32_t foutHz, pll_setup_t *pSetup, bool useSS) -{ - uint32_t nDivOutHz, fccoHz; - uint32_t pllPreDivider, pllMultiplier, pllPostDivider; - uint32_t pllDirectInput, pllDirectOutput; - uint32_t pllSelP, pllSelI, pllSelR, uplimoff; - - /* Baseline parameters (no input or output dividers) */ - pllPreDivider = 1U; /* 1 implies pre-divider will be disabled */ - pllPostDivider = 1U; /* 1 implies post-divider will be disabled */ - pllDirectOutput = 1U; - - /* Verify output rate parameter */ - if (foutHz > PLL_MAX_CCO_FREQ_MHZ) - { - /* Maximum PLL output with post divider=1 cannot go above this frequency */ - return kStatus_PLL_OutputTooHigh; - } - if (foutHz < (PLL_MIN_CCO_FREQ_MHZ / (PVALMAX << 1U))) - { - /* Minmum PLL output with maximum post divider cannot go below this frequency */ - return kStatus_PLL_OutputTooLow; - } - - /* If using SS mode, input clock needs to be between 3MHz and 20MHz */ - if (useSS) - { - /* Verify input rate parameter */ - if (finHz < PLL_MIN_IN_SSMODE) - { - /* Input clock into the PLL cannot be lower than this */ - return kStatus_PLL_InputTooLow; - } - /* PLL input in SS mode must be under 20MHz */ - if (finHz > (PLL_MAX_IN_SSMODE * NVALMAX)) - { - return kStatus_PLL_InputTooHigh; - } - } - else - { - /* Verify input rate parameter */ - if (finHz < PLL_LOWER_IN_LIMIT) - { - /* Input clock into the PLL cannot be lower than this */ - return kStatus_PLL_InputTooLow; - } - if (finHz > PLL_HIGHER_IN_LIMIT) - { - /* Input clock into the PLL cannot be higher than this */ - return kStatus_PLL_InputTooHigh; - } - } - - /* Find the optimal CCO frequency for the output and input that - will keep it inside the PLL CCO range. This may require - tweaking the post-divider for the PLL. */ - fccoHz = foutHz; - while (fccoHz < PLL_MIN_CCO_FREQ_MHZ) - { - /* CCO output is less than minimum CCO range, so the CCO output - needs to be bumped up and the post-divider is used to bring - the PLL output back down. */ - pllPostDivider++; - if (pllPostDivider > PVALMAX) - { - return kStatus_PLL_OutsideIntLimit; - } - - /* Target CCO goes up, PLL output goes down */ - /* divide-by-2 divider in the post-divider is always work*/ - fccoHz = foutHz * (pllPostDivider * 2U); - pllDirectOutput = 0U; - } - - /* Determine if a pre-divider is needed to get the best frequency */ - if ((finHz > PLL_LOWER_IN_LIMIT) && (fccoHz >= finHz) && (useSS == false)) - { - uint32_t a = FindGreatestCommonDivisor(fccoHz, finHz); - - if (a > PLL_LOWER_IN_LIMIT) - { - a = finHz / a; - if ((a != 0U) && (a < PLL_MAX_N_DIV)) - { - pllPreDivider = a; - } - } - } - - /* Bypass pre-divider hardware if pre-divider is 1 */ - if (pllPreDivider > 1U) - { - pllDirectInput = 0U; - } - else - { - pllDirectInput = 1U; - } - - /* Determine PLL multipler */ - nDivOutHz = (finHz / pllPreDivider); - pllMultiplier = (fccoHz / nDivOutHz); - - /* Find optimal values for filter */ - if (useSS == false) - { - /* Will bumping up M by 1 get us closer to the desired CCO frequency? */ - if ((nDivOutHz * ((pllMultiplier * 2U) + 1U)) < (fccoHz * 2U)) - { - pllMultiplier++; - } - - /* Setup filtering */ - pllFindSel(pllMultiplier, &pllSelP, &pllSelI, &pllSelR); - uplimoff = 0U; - - /* Get encoded value for M (mult) and use manual filter, disable SS mode */ - pSetup->pllmdiv = (uint32_t)PLL_MDIV_VAL_SET(pllMultiplier); - pSetup->pllsscg[1] &= ~SCG_APLLSSCG1_SEL_SS_MDIV_MASK; - } - else - { - uint64_t fc; - - /* Filtering will be handled by SSC */ - pllSelR = 0UL; - pllSelI = 0UL; - pllSelP = 0UL; - uplimoff = 1U; - - /* The PLL multiplier will get very close and slightly under the - desired target frequency. A small fractional component can be - added to fine tune the frequency upwards to the target. */ - fc = ((uint64_t)(uint32_t)(fccoHz % nDivOutHz) << 25UL) / nDivOutHz; - - /* Set multiplier */ - pSetup->pllsscg[0] = (uint32_t)(PLL_SSCG_MD_INT_SET(pllMultiplier) | PLL_SSCG_MD_FRACT_SET((uint32_t)fc)); - pSetup->pllsscg[1] = (uint32_t)(PLL_SSCG_MD_INT_SET(pllMultiplier) >> 32U) | SCG_APLLSSCG1_SEL_SS_MDIV_MASK; - } - - /* Get encoded values for N (prediv) and P (postdiv) */ - pSetup->pllndiv = PLL_NDIV_VAL_SET(pllPreDivider); - pSetup->pllpdiv = PLL_PDIV_VAL_SET(pllPostDivider); - - /* PLL control */ - pSetup->pllctrl = (pllSelR << SCG_APLLCTRL_SELR_SHIFT) | /* Filter coefficient */ - (pllSelI << SCG_APLLCTRL_SELI_SHIFT) | /* Filter coefficient */ - (pllSelP << SCG_APLLCTRL_SELP_SHIFT) | /* Filter coefficient */ - (uplimoff << SCG_APLLCTRL_LIMUPOFF_SHIFT) | /* SS/fractional mode disabled */ - (pllDirectInput << SCG_APLLCTRL_BYPASSPREDIV_SHIFT) | /* Bypass pre-divider? */ - (pllDirectOutput << SCG_APLLCTRL_BYPASSPOSTDIV_SHIFT); /* Bypass post-divider? */ - - return kStatus_PLL_Success; -} - -/* Get PLL input clock rate from setup structure */ -static uint32_t CLOCK_GetPLLInClockRateFromSetup(pll_setup_t *pSetup) -{ - uint32_t clkRate = 0U; - - switch ((pSetup->pllctrl & SCG_APLLCTRL_SOURCE_MASK) >> SCG_APLLCTRL_SOURCE_SHIFT) - { - case 0x00U: - clkRate = CLOCK_GetExtClkFreq(); - break; - case 0x01U: - clkRate = CLOCK_GetClk48MFreq(); - break; - case 0x02U: - clkRate = CLOCK_GetOsc32KFreq((uint32_t)kCLOCK_Osc32kToVbat); - break; - default: - clkRate = 0U; - break; - } - - return clkRate; -} - -/* Get predivider (N) from from setup structure */ -static uint32_t findPllPreDivFromSetup(pll_setup_t *pSetup) -{ - uint32_t preDiv = 1UL; - - /* Direct input is not used? */ - if ((pSetup->pllctrl & SCG_APLLCTRL_BYPASSPREDIV_MASK) == 0UL) - { - preDiv = pSetup->pllndiv & SCG_APLLNDIV_NDIV_MASK; - if (preDiv == 0UL) - { - preDiv = 1UL; - } - } - return preDiv; -} - -/* Get postdivider (P) from from setup structure */ -static uint32_t findPllPostDivFromSetup(pll_setup_t *pSetup) -{ - uint32_t postDiv = 1UL; - - if ((pSetup->pllctrl & SCG_APLLCTRL_BYPASSPOSTDIV_MASK) == 0UL) - { - if ((pSetup->pllctrl & SCG_APLLCTRL_BYPASSPOSTDIV2_MASK) != 0UL) - { - postDiv = pSetup->pllpdiv & SCG_APLLPDIV_PDIV_MASK; - } - else - { - postDiv = 2UL * (pSetup->pllpdiv & SCG_APLLPDIV_PDIV_MASK); - } - if (postDiv == 0UL) - { - postDiv = 2UL; - } - } - - return postDiv; -} - -/* Get multiplier (M) from from setup structure */ -static float findPllMMultFromSetup(pll_setup_t *pSetup) -{ - float mMult = 1.0F; - float mMult_fract; - uint32_t mMult_int; - - if ((pSetup->pllsscg[1] & SCG_APLLSSCG1_SEL_SS_MDIV_MASK) == 0UL) - { - mMult = (float)(uint32_t)(pSetup->pllmdiv & SCG_APLLMDIV_MDIV_MASK); - } - else - { - mMult_int = ((pSetup->pllsscg[1] & SCG_APLLSSCG1_SS_MDIV_MSB_MASK) << 7U); - mMult_int = mMult_int | ((pSetup->pllsscg[0]) >> PLL_SSCG_MD_INT_P); - mMult_fract = ((float)(uint32_t)((pSetup->pllsscg[0]) & PLL_SSCG_MD_FRACT_M) / - (float)(uint32_t)(1UL << PLL_SSCG_MD_INT_P)); - mMult = (float)mMult_int + mMult_fract; - } - if (0ULL == ((uint64_t)mMult)) - { - mMult = 1.0F; - } - return mMult; -} - -/*! brief Enable USB HS PHY PLL clock. - * - * This function enables the internal 480MHz USB PHY PLL clock. - * - * param src USB HS PHY PLL clock source. - * param freq The frequency specified by src. - * retval true The clock is set successfully. - * retval false The clock source is invalid to get proper USB HS clock. - */ -bool CLOCK_EnableUsbhsPhyPllClock(clock_usb_phy_src_t src, uint32_t freq) -{ - uint32_t phyPllDiv = 0U; - uint16_t multiplier = 0U; - bool err = false; - - USBPHY->CTRL_CLR = USBPHY_CTRL_SFTRST_MASK; - USBPHY->ANACTRL_SET = USBPHY_ANACTRL_LVI_EN_MASK; - USBPHY->PLL_SIC_SET = (USBPHY_PLL_SIC_PLL_POWER(1) | USBPHY_PLL_SIC_PLL_REG_ENABLE_MASK); - if ((480000000UL % freq) != 0UL) - { - return false; - } - multiplier = (uint16_t)(480000000UL / freq); - - switch (multiplier) - { - case 15: - { - phyPllDiv = USBPHY_PLL_SIC_PLL_DIV_SEL(0U); - break; - } - case 16: - { - phyPllDiv = USBPHY_PLL_SIC_PLL_DIV_SEL(1U); - break; - } - case 20: - { - phyPllDiv = USBPHY_PLL_SIC_PLL_DIV_SEL(2U); - break; - } - case 22: - { - phyPllDiv = USBPHY_PLL_SIC_PLL_DIV_SEL(3U); - break; - } - case 24: - { - phyPllDiv = USBPHY_PLL_SIC_PLL_DIV_SEL(4U); - break; - } - case 25: - { - phyPllDiv = USBPHY_PLL_SIC_PLL_DIV_SEL(5U); - break; - } - case 30: - { - phyPllDiv = USBPHY_PLL_SIC_PLL_DIV_SEL(6U); - break; - } - case 40: - { - phyPllDiv = USBPHY_PLL_SIC_PLL_DIV_SEL(7U); - break; - } - default: - { - err = true; - break; - } - } - - if (err) - { - return false; - } - - USBPHY->PLL_SIC = (USBPHY->PLL_SIC & ~(USBPHY_PLL_SIC_PLL_DIV_SEL_MASK)) | phyPllDiv; - - USBPHY->PLL_SIC_CLR = USBPHY_PLL_SIC_PLL_BYPASS_MASK; - USBPHY->PLL_SIC_SET = (USBPHY_PLL_SIC_PLL_EN_USB_CLKS_MASK); - - USBPHY->CTRL_CLR = USBPHY_CTRL_CLR_CLKGATE_MASK; - USBPHY->PWD = 0x0U; - - while (0UL == (USBPHY->PLL_SIC & USBPHY_PLL_SIC_PLL_LOCK_MASK)) - { - } - - return true; -} - -/*! brief Disable USB HS PHY PLL clock. - * - * This function disables USB HS PHY PLL clock. - */ -void CLOCK_DisableUsbhsPhyPllClock(void) -{ - USBPHY->CTRL |= USBPHY_CTRL_CLKGATE_MASK; /* Set to 1U to gate clocks */ -} - -/*! brief Enable USB HS clock. - * retval true The clock is set successfully. - * retval false The clock source is invalid to get proper USB HS clock. - */ -bool CLOCK_EnableUsbhsClock(void) -{ - USBHS1__USBC->USBCMD |= USBHS_USBCMD_RST_MASK; - /* Add a delay between RST and RS so make sure there is a DP pullup sequence*/ - for (uint32_t i = 0; i < 400000U; i++) - { - __ASM("nop"); - } - return true; -} - -/** - * @brief FIRC Auto Trim With SOF. - * @return returns success or fail status. - */ -status_t CLOCK_FIRCAutoTrimWithSOF(void) -{ - /* System OSC Clock Monitor is disabled */ - CLOCK_SetSysOscMonitorMode(kSCG_SysOscMonitorDisable); - - firc_trim_config_t fircAutoTrimConfig = { - .trimMode = kSCG_FircTrimUpdate, /* FIRC trim is enabled and trim value update is enabled */ - .trimSrc = kSCG_FircTrimSrcUsb0, /* Trim source is USB0 start of frame (1kHz) */ - .trimDiv = 1U, /* Divided value */ - .trimCoar = 0U, /* Trim value, see Reference Manual for more information */ - .trimFine = 0U, /* Trim value, see Reference Manual for more information */ - }; - CLOCK_FROHFTrimConfig(fircAutoTrimConfig); - - /* Wait for FIRC clock to be valid. */ - while ((SCG0->FIRCCSR & SCG_FIRCCSR_FIRCVLD_MASK) == 0U) - { - } - - return (status_t)kStatus_Success; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_clock.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_clock.h deleted file mode 100644 index 07f1e161e08..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_clock.h +++ /dev/null @@ -1,1726 +0,0 @@ -/* - * Copyright 2022-2023, NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _FSL_CLOCK_H_ -#define _FSL_CLOCK_H_ - -#include "fsl_common.h" - -/*! @addtogroup clock */ -/*! @{ */ - -/*! @file */ - -/******************************************************************************* - * Definitions - *****************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief CLOCK driver version 2.0.0. */ -#define FSL_CLOCK_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) -/*@}*/ - -/*! @brief Configure whether driver controls clock - * - * When set to 0, peripheral drivers will enable clock in initialize function - * and disable clock in de-initialize function. When set to 1, peripheral - * driver will not control the clock, application could control the clock out of - * the driver. - * - * @note All drivers share this feature switcher. If it is set to 1, application - * should handle clock enable and disable for all drivers. - */ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)) -#define FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL 0 -#endif - -/*! - * @brief User-defined the size of cache for CLOCK_PllGetConfig() function. - * - * Once define this MACRO to be non-zero value, CLOCK_PllGetConfig() function - * would cache the recent calulation and accelerate the execution to get the - * right settings. - */ -#ifndef CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT -#define CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT 2U -#endif - -/* Definition for delay API in clock driver, users can redefine it to the real application. */ -#ifndef SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY -#define SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY (150000000UL) -#endif - -/*! @brief Clock ip name array for ROM. */ -#define ROM_CLOCKS \ - { \ - kCLOCK_Rom \ - } -/*! @brief Clock ip name array for SRAM. */ -#define SRAM_CLOCKS \ - { \ - kCLOCK_Sram1, kCLOCK_Sram2, kCLOCK_Sram3, kCLOCK_Sram4, kCLOCK_Sram5, kCLOCK_Sram6, kCLOCK_Sram7 \ - } -/*! @brief Clock ip name array for FMC. */ -#define FMC_CLOCKS \ - { \ - kCLOCK_Fmc \ - } -/*! @brief Clock ip name array for INPUTMUX. */ -#define INPUTMUX_CLOCKS \ - { \ - kCLOCK_InputMux0 \ - } -/*! @brief Clock ip name array for GPIO. */ -#define GPIO_CLOCKS \ - { \ - kCLOCK_Gpio0, kCLOCK_Gpio1, kCLOCK_Gpio2, kCLOCK_Gpio3, kCLOCK_Gpio4 \ - } -/*! @brief Clock ip name array for PINT. */ -#define PINT_CLOCKS \ - { \ - kCLOCK_Pint \ - } -/*! @brief Clock ip name array for DMA. */ -#define DMA_CLOCKS \ - { \ - kCLOCK_Dma0, kCLOCK_Dma1 \ - } -/*! @brief Clock gate name array for EDMA. */ -#define EDMA_CLOCKS \ - { \ - kCLOCK_Dma0, kCLOCK_Dma1 \ - } -/*! @brief Clock ip name array for CRC. */ -#define CRC_CLOCKS \ - { \ - kCLOCK_Crc0 \ - } -/*! @brief Clock ip name array for WWDT. */ -#define WWDT_CLOCKS \ - { \ - kCLOCK_Wwdt0, kCLOCK_Wwdt1 \ - } -/*! @brief Clock ip name array for LPADC. */ -#define LPADC_CLOCKS \ - { \ - kCLOCK_Adc0, kCLOCK_Adc1 \ - } -/*! @brief Clock ip name array for MRT. */ -#define MRT_CLOCKS \ - { \ - kCLOCK_Mrt \ - } -/*! @brief Clock ip name array for OSTIMER. */ -#define OSTIMER_CLOCKS \ - { \ - kCLOCK_OsTimer \ - } -/*! @brief Clock ip name array for UTICK. */ -#define UTICK_CLOCKS \ - { \ - kCLOCK_Utick \ - } -/*! @brief Clock ip name array for LP_FLEXCOMM. */ -#define LP_FLEXCOMM_CLOCKS \ - { \ - kCLOCK_LPFlexComm0, kCLOCK_LPFlexComm1, kCLOCK_LPFlexComm2, kCLOCK_LPFlexComm3, kCLOCK_LPFlexComm4, \ - kCLOCK_LPFlexComm5, kCLOCK_LPFlexComm6, kCLOCK_LPFlexComm7 \ - } -/*! @brief Clock ip name array for LPUART. */ -#define LPUART_CLOCKS \ - { \ - kCLOCK_LPUart0, kCLOCK_LPUart1, kCLOCK_LPUart2, kCLOCK_LPUart3, kCLOCK_LPUart4, kCLOCK_LPUart5, \ - kCLOCK_LPUart6, kCLOCK_LPUart7 \ - } -/*! @brief Clock ip name array for LPI2C. */ -#define LPI2C_CLOCKS \ - { \ - kCLOCK_LPI2c0, kCLOCK_LPI2c1, kCLOCK_LPI2c2, kCLOCK_LPI2c3, kCLOCK_LPI2c4, kCLOCK_LPI2c5, kCLOCK_LPI2c6, \ - kCLOCK_LPI2c7 \ - } -/*! @brief Clock ip name array for LSPI. */ -#define LPSPI_CLOCKS \ - { \ - kCLOCK_LPSpi0, kCLOCK_LPSpi1, kCLOCK_LPSpi2, kCLOCK_LPSpi3, kCLOCK_LPSpi4, kCLOCK_LPSpi5, kCLOCK_LPSpi6, \ - kCLOCK_LPSpi7 \ - } -/*! @brief Clock ip name array for CTIMER. */ -#define CTIMER_CLOCKS \ - { \ - kCLOCK_Timer0, kCLOCK_Timer1, kCLOCK_Timer2, kCLOCK_Timer3, kCLOCK_Timer4 \ - } -/*! @brief Clock ip name array for FREQME. */ -#define FREQME_CLOCKS \ - { \ - kCLOCK_Freqme \ - } -/*! @brief Clock ip name array for PUF. */ -#define PUF_CLOCKS \ - { \ - kCLOCK_Puf \ - } -/*! @brief Clock ip name array for VREF. */ -#define VREF_CLOCKS \ - { \ - kCLOCK_Vref \ - } -/*! @brief Clock ip name array for PWM. */ -#define PWM_CLOCKS \ - { \ - {kCLOCK_Pwm0_Sm0, kCLOCK_Pwm0_Sm1, kCLOCK_Pwm0_Sm2, kCLOCK_Pwm0_Sm3}, \ - { \ - kCLOCK_Pwm1_Sm0, kCLOCK_Pwm1_Sm1, kCLOCK_Pwm1_Sm2, kCLOCK_Pwm1_Sm3 \ - } \ - } -/*! @brief Clock ip name array for QDC. */ -#define QDC_CLOCKS \ - { \ - kCLOCK_Qdc0, kCLOCK_Qdc1 \ - } -/*! @brief Clock ip name array for FLEXIO. */ -#define FLEXIO_CLOCKS \ - { \ - kCLOCK_Flexio \ - } -/*! @brief Clock ip name array for FLEXCAN. */ -#define FLEXCAN_CLOCKS \ - { \ - kCLOCK_Flexcan0, kCLOCK_Flexcan1 \ - } -/*! @brief Clock ip name array for I3C */ -#define I3C_CLOCKS \ - { \ - kCLOCK_I3c0, kCLOCK_I3c1 \ - } -/*! @brief Clock ip name array for USDHC. */ -#define USDHC_CLOCKS \ - { \ - kCLOCK_uSdhc \ - } -/*! @brief Clock ip name array for SAI. */ -#define SAI_CLOCKS \ - { \ - kCLOCK_Sai0, kCLOCK_Sai1 \ - } -/*! @brief Clock ip name array for RTC. */ -#define RTC_CLOCKS \ - { \ - kCLOCK_Rtc0 \ - } -/*! @brief Clock ip name array for PDM. */ -#define PDM_CLOCKS \ - { \ - kCLOCK_Micfil \ - } -/*! @brief Clock ip name array for ERM. */ -#define ERM_CLOCKS \ - { \ - kCLOCK_Erm \ - } -/*! @brief Clock ip name array for EIM. */ -#define EIM_CLOCKS \ - { \ - kCLOCK_Eim \ - } -/*! @brief Clock ip name array for TRNG. */ -#define TRNG_CLOCKS \ - { \ - kCLOCK_Trng \ - } -/*! @brief Clock ip name array for LPCMP. */ -#define LPCMP_CLOCKS \ - { \ - kCLOCK_None, kCLOCK_None, kCLOCK_Cmp2 \ - } -/*! @brief Clock gate name used for CLOCK_EnableClock/CLOCK_DisableClock. */ -/*------------------------------------------------------------------------------ - clock_ip_name_t definition: -------------------------------------------------------------------------------*/ - -#define CLK_GATE_REG_OFFSET_SHIFT 8U -#define CLK_GATE_REG_OFFSET_MASK 0xFFFFFF00U -#define CLK_GATE_BIT_SHIFT_SHIFT 0U -#define CLK_GATE_BIT_SHIFT_MASK 0x000000FFU - -#define CLK_GATE_DEFINE(reg_offset, bit_shift) \ - ((((reg_offset) << CLK_GATE_REG_OFFSET_SHIFT) & CLK_GATE_REG_OFFSET_MASK) | \ - (((bit_shift) << CLK_GATE_BIT_SHIFT_SHIFT) & CLK_GATE_BIT_SHIFT_MASK)) - -#define CLK_GATE_ABSTRACT_REG_OFFSET(x) (((uint32_t)(x)&CLK_GATE_REG_OFFSET_MASK) >> CLK_GATE_REG_OFFSET_SHIFT) -#define CLK_GATE_ABSTRACT_BITS_SHIFT(x) (((uint32_t)(x)&CLK_GATE_BIT_SHIFT_MASK) >> CLK_GATE_BIT_SHIFT_SHIFT) - -#define AHB_CLK_CTRL0 0 -#define AHB_CLK_CTRL1 1 -#define AHB_CLK_CTRL2 2 -#define AHB_CLK_CTRL3 3 -#define REG_PWM0SUBCTL 250 -#define REG_PWM1SUBCTL 251 - -/*! @brief Clock gate name used for CLOCK_EnableClock/CLOCK_DisableClock. */ -typedef enum _clock_ip_name -{ - kCLOCK_IpInvalid = 0U, /*!< Invalid Ip Name. */ - kCLOCK_None = 0U, /*!< None clock gate. */ - - kCLOCK_Rom = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 1), /*!< Clock gate name: Rom. */ - kCLOCK_Sram1 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 2), /*!< Clock gate name: Sram1. */ - kCLOCK_Sram2 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 3), /*!< Clock gate name: Sram2. */ - kCLOCK_Sram3 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 4), /*!< Clock gate name: Sram3. */ - kCLOCK_Sram4 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 5), /*!< Clock gate name: Sram4. */ - kCLOCK_Sram5 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 6), /*!< Clock gate name: Sram5. */ - kCLOCK_Sram6 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 7), /*!< Clock gate name: Sram6. */ - kCLOCK_Sram7 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 8), /*!< Clock gate name: Sram7. */ - kCLOCK_Fmu = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 9), /*!< Clock gate name: Fmu. */ - kCLOCK_Fmc = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 10), /*!< Clock gate name: Fmc. */ - kCLOCK_InputMux0 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 12), /*!< Clock gate name: InputMux0. */ - kCLOCK_InputMux = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 12), /*!< Clock gate name: InputMux0. */ - kCLOCK_Port0 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 13), /*!< Clock gate name: Port0. */ - kCLOCK_Port1 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 14), /*!< Clock gate name: Port1. */ - kCLOCK_Port2 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 15), /*!< Clock gate name: Port2. */ - kCLOCK_Port3 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 16), /*!< Clock gate name: Port3. */ - kCLOCK_Port4 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 17), /*!< Clock gate name: Port4. */ - kCLOCK_Gpio0 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 19), /*!< Clock gate name: Gpio0. */ - kCLOCK_Gpio1 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 20), /*!< Clock gate name: Gpio1. */ - kCLOCK_Gpio2 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 21), /*!< Clock gate name: Gpio2. */ - kCLOCK_Gpio3 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 22), /*!< Clock gate name: Gpio3. */ - kCLOCK_Gpio4 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 23), /*!< Clock gate name: Gpio4. */ - kCLOCK_Pint = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 25), /*!< Clock gate name: Pint. */ - kCLOCK_Dma0 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 26), /*!< Clock gate name: Dma0. */ - kCLOCK_Crc0 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 27), /*!< Clock gate name: Crc. */ - kCLOCK_Wwdt0 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 28), /*!< Clock gate name: Wwdt0. */ - kCLOCK_Wwdt1 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 29), /*!< Clock gate name: Wwdt1. */ - - kCLOCK_Mrt = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 0), /*!< Clock gate name: Mrt. */ - kCLOCK_OsTimer = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 1), /*!< Clock gate name: OsTimer. */ - kCLOCK_Sct = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 2), /*!< Clock gate name: Sct. */ - kCLOCK_Adc0 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 3), /*!< Clock gate name: Adc0. */ - kCLOCK_Adc1 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 4), /*!< Clock gate name: Adc1. */ - kCLOCK_Rtc0 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 6), /*!< Clock gate name: Rtc. */ - kCLOCK_Utick = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 10), /*!< Clock gate name: Utick. */ - kCLOCK_LPFlexComm0 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 11), /*!< Clock gate name: LPFlexComm0. */ - kCLOCK_LPFlexComm1 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 12), /*!< Clock gate name: LPFlexComm1. */ - kCLOCK_LPFlexComm2 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 13), /*!< Clock gate name: LPFlexComm2. */ - kCLOCK_LPFlexComm3 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 14), /*!< Clock gate name: LPFlexComm3. */ - kCLOCK_LPFlexComm4 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 15), /*!< Clock gate name: LPFlexComm4. */ - kCLOCK_LPFlexComm5 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 16), /*!< Clock gate name: LPFlexComm5. */ - kCLOCK_LPFlexComm6 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 17), /*!< Clock gate name: LPFlexComm6. */ - kCLOCK_LPFlexComm7 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 18), /*!< Clock gate name: LPFlexComm7. */ - kCLOCK_LPUart0 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 11), /*!< Clock gate name: LPUart0. */ - kCLOCK_LPUart1 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 12), /*!< Clock gate name: LPUart1. */ - kCLOCK_LPUart2 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 13), /*!< Clock gate name: LPUart2. */ - kCLOCK_LPUart3 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 14), /*!< Clock gate name: LPUart3. */ - kCLOCK_LPUart4 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 15), /*!< Clock gate name: LPUart4. */ - kCLOCK_LPUart5 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 16), /*!< Clock gate name: LPUart5. */ - kCLOCK_LPUart6 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 17), /*!< Clock gate name: LPUart6. */ - kCLOCK_LPUart7 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 18), /*!< Clock gate name: LPUart7. */ - kCLOCK_LPSpi0 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 11), /*!< Clock gate name: LPSpi0. */ - kCLOCK_LPSpi1 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 12), /*!< Clock gate name: LPSpi1. */ - kCLOCK_LPSpi2 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 13), /*!< Clock gate name: LPSpi2. */ - kCLOCK_LPSpi3 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 14), /*!< Clock gate name: LPSpi3. */ - kCLOCK_LPSpi4 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 15), /*!< Clock gate name: LPSpi4. */ - kCLOCK_LPSpi5 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 16), /*!< Clock gate name: LPSpi5. */ - kCLOCK_LPSpi6 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 17), /*!< Clock gate name: LPSpi6. */ - kCLOCK_LPSpi7 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 18), /*!< Clock gate name: LPSpi7. */ - kCLOCK_LPI2c0 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 11), /*!< Clock gate name: LPI2c0. */ - kCLOCK_LPI2c1 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 12), /*!< Clock gate name: LPI2c1. */ - kCLOCK_LPI2c2 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 13), /*!< Clock gate name: LPI2c2. */ - kCLOCK_LPI2c3 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 14), /*!< Clock gate name: LPI2c3. */ - kCLOCK_LPI2c4 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 15), /*!< Clock gate name: LPI2c4. */ - kCLOCK_LPI2c5 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 16), /*!< Clock gate name: LPI2c5. */ - kCLOCK_LPI2c6 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 17), /*!< Clock gate name: LPI2c6. */ - kCLOCK_LPI2c7 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 18), /*!< Clock gate name: LPI2c7. */ - kCLOCK_Micfil = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 21), /*!< Clock gate name: Micfil. */ - kCLOCK_Timer2 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 22), /*!< Clock gate name: Timer2. */ - kCLOCK_Usb0FsDcd = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 24), /*!< Clock gate name: Usb0FsDcd. */ - kCLOCK_Timer0 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 26), /*!< Clock gate name: Timer0. */ - kCLOCK_Timer1 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 27), /*!< Clock gate name: Timer1. */ - kCLOCK_PkcRam = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 29), /*!< Clock gate name: PkcRam. */ - kCLOCK_Smartdma = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 31), /*!< Clock gate name: SmartDma. */ - - kCLOCK_Espi = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 0), /*!< Clock gate name: Espi. */ - kCLOCK_Dma1 = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 1), /*!< Clock gate name: Dma1. */ - kCLOCK_Flexio = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 4), /*!< Clock gate name: Flexio. */ - kCLOCK_Sai0 = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 5), /*!< Clock gate name: Sai0. */ - kCLOCK_Sai1 = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 6), /*!< Clock gate name: Sai1. */ - kCLOCK_Tro = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 7), /*!< Clock gate name: Tro. */ - kCLOCK_Freqme = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 8), /*!< Clock gate name: Freqme. */ - kCLOCK_Trng = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 13), /*!< Clock gate name: Trng. */ - kCLOCK_Flexcan0 = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 14), /*!< Clock gate name: Flexcan0. */ - kCLOCK_Flexcan1 = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 15), /*!< Clock gate name: Flexcan1. */ - kCLOCK_UsbHs = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 16), /*!< Clock gate name: UsbHs. */ - kCLOCK_UsbHsPhy = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 17), /*!< Clock gate name: UsbHsPhy. */ - kCLOCK_Css = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 18), /*!< Clock gate name: Css. */ - kCLOCK_Timer3 = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 21), /*!< Clock gate name: Timer3. */ - kCLOCK_Timer4 = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 22), /*!< Clock gate name: Timer4. */ - kCLOCK_Puf = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 23), /*!< Clock gate name: Puf. */ - kCLOCK_Pkc = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 24), /*!< Clock gate name: Pkc. */ - kCLOCK_Scg = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 26), /*!< Clock gate name: Scg. */ - kCLOCK_Gdet = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 29), /*!< Clock gate name: Gdet. */ - kCLOCK_Sm3 = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 30), /*!< Clock gate name: Sm3. */ - - kCLOCK_I3c0 = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 0), /*!< Clock gate name: I3c0. */ - kCLOCK_I3c1 = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 1), /*!< Clock gate name: I3c1. */ - kCLOCK_Qdc0 = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 4), /*!< Clock gate name: Qdc0. */ - kCLOCK_Qdc1 = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 5), /*!< Clock gate name: Qdc1. */ - kCLOCK_Pwm0 = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 6), /*!< Clock gate name: Pwm0. */ - kCLOCK_Pwm1 = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 7), /*!< Clock gate name: Pwm1. */ - kCLOCK_Evtg = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 8), /*!< Clock gate name: Evtg. */ - kCLOCK_Cmp2 = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 18), /*!< Clock gate name: Cmp2. */ - kCLOCK_Vref = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 19), /*!< Clock gate name: Vref. */ - kCLOCK_Ewm = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 23), /*!< Clock gate name: Ewm. */ - kCLOCK_Ewm0 = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 23), /*!< Clock gate name: Ewm. */ - kCLOCK_Eim = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 24), /*!< Clock gate name: Eim. */ - kCLOCK_Erm = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 25), /*!< Clock gate name: Erm. */ - kCLOCK_Intm = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 26), /*!< Clock gate name: Intm. */ - - kCLOCK_Pwm0_Sm0 = CLK_GATE_DEFINE(REG_PWM0SUBCTL, 0U), /*!< Clock gate name: PWM0 SM0. */ - kCLOCK_Pwm0_Sm1 = CLK_GATE_DEFINE(REG_PWM0SUBCTL, 1U), /*!< Clock gate name: PWM0 SM1. */ - kCLOCK_Pwm0_Sm2 = CLK_GATE_DEFINE(REG_PWM0SUBCTL, 2U), /*!< Clock gate name: PWM0 SM2. */ - kCLOCK_Pwm0_Sm3 = CLK_GATE_DEFINE(REG_PWM0SUBCTL, 3U), /*!< Clock gate name: PWM0 SM3. */ - - kCLOCK_Pwm1_Sm0 = CLK_GATE_DEFINE(REG_PWM1SUBCTL, 0U), /*!< Clock gate name: PWM1 SM0. */ - kCLOCK_Pwm1_Sm1 = CLK_GATE_DEFINE(REG_PWM1SUBCTL, 1U), /*!< Clock gate name: PWM1 SM1. */ - kCLOCK_Pwm1_Sm2 = CLK_GATE_DEFINE(REG_PWM1SUBCTL, 2U), /*!< Clock gate name: PWM1 SM2. */ - kCLOCK_Pwm1_Sm3 = CLK_GATE_DEFINE(REG_PWM1SUBCTL, 3U) /*!< Clock gate name: PWM1 SM3. */ - -} clock_ip_name_t; - -/*! @brief Peripherals clock source definition. */ -#define BUS_CLK kCLOCK_BusClk - -#define I2C0_CLK_SRC BUS_CLK - -/*! @brief Clock name used to get clock frequency. */ -typedef enum _clock_name -{ - kCLOCK_CoreSysClk, /*!< Core/system clock (aka MAIN_CLK) */ - kCLOCK_BusClk, /*!< Bus clock (AHB clock) */ - kCLOCK_SystickClk0, /*!< Systick clock0 */ - kCLOCK_ClockOut, /*!< CLOCKOUT */ - kCLOCK_Fro12M, /*!< FRO12M */ - kCLOCK_Clk1M, /*!< CLK1M */ - kCLOCK_FroHf, /*!< FRO48/144 */ - kCLOCK_Clk48M, /*!< CLK48M */ - kCLOCK_Clk144M, /*!< CLK144M */ - kCLOCK_Clk16K0, /*!< CLK16K[0] */ - kCLOCK_Clk16K1, /*!< CLK16K[1] */ - kCLOCK_Clk16K2, /*!< CLK16K[2] */ - kCLOCK_Clk16K3, /*!< CLK16K[3] */ - kCLOCK_ExtClk, /*!< External Clock */ - kCLOCK_Osc32K0, /*!< OSC32K[0] */ - kCLOCK_Osc32K1, /*!< OSC32K[1] */ - kCLOCK_Osc32K2, /*!< OSC32K[2] */ - kCLOCK_Osc32K3, /*!< OSC32K[3] */ - kCLOCK_Pll0Out, /*!< PLL0 Output */ - kCLOCK_Pll1Out, /*!< PLL1 Output */ - kCLOCK_UsbPllOut, /*!< USB PLL Output */ - kCLOCK_LpOsc, /*!< lp_osc */ -} clock_name_t; - -/*! @brief Clock Mux Switches - * The encoding is as follows each connection identified is 32bits wide while 24bits are valuable - * starting from LSB upwards - * - * [4 bits for choice, 0 means invalid choice] [8 bits mux ID]* - * - */ - -#define CLK_ATTACH_ID(mux, sel, pos) \ - ((((uint32_t)(mux) << 0U) | (((uint32_t)(sel) + 1U) & 0xFU) << 12U) << ((uint32_t)(pos)*16U)) -#define MUX_A(mux, sel) CLK_ATTACH_ID((mux), (sel), 0U) -#define MUX_B(mux, sel, selector) (CLK_ATTACH_ID((mux), (sel), 1U) | ((selector) << 24U)) - -#define GET_ID_ITEM(connection) ((connection)&0xFFFFU) -#define GET_ID_NEXT_ITEM(connection) ((connection) >> 16U) -#define GET_ID_ITEM_MUX(connection) (((uint16_t)connection) & 0xFFFU) -#define GET_ID_ITEM_SEL(connection) ((uint8_t)((((uint32_t)(connection)&0xF000U) >> 12U) - 1U)) -#define GET_ID_SELECTOR(connection) ((connection)&0xF000000U) - -#define CM_SYSTICKCLKSEL0 0U -#define CM_TRACECLKSEL ((0x268 - 0x260) / 4) -#define CM_CTIMERCLKSEL0 ((0x26C - 0x260) / 4) -#define CM_CTIMERCLKSEL1 ((0x270 - 0x260) / 4) -#define CM_CTIMERCLKSEL2 ((0x274 - 0x260) / 4) -#define CM_CTIMERCLKSEL3 ((0x278 - 0x260) / 4) -#define CM_CTIMERCLKSEL4 ((0x27C - 0x260) / 4) -#define CM_CLKOUTCLKSEL ((0x288 - 0x260) / 4) -#define CM_ADC0CLKSEL ((0x2A4 - 0x260) / 4) -#define CM_FCCLKSEL0 ((0x2B0 - 0x260) / 4) -#define CM_FCCLKSEL1 ((0x2B4 - 0x260) / 4) -#define CM_FCCLKSEL2 ((0x2B8 - 0x260) / 4) -#define CM_FCCLKSEL3 ((0x2BC - 0x260) / 4) -#define CM_FCCLKSEL4 ((0x2C0 - 0x260) / 4) -#define CM_FCCLKSEL5 ((0x2C4 - 0x260) / 4) -#define CM_FCCLKSEL6 ((0x2C8 - 0x260) / 4) -#define CM_FCCLKSEL7 ((0x2CC - 0x260) / 4) -#define CM_ADC1CLKSEL ((0x464 - 0x260) / 4) -#define CM_PLLCLKDIVSEL ((0x52C - 0x260) / 4) -#define CM_I3C0FCLKSEL ((0x530 - 0x260) / 4) -#define CM_MICFILFCLKSEL ((0x548 - 0x260) / 4) -#define CM_FLEXIOCLKSEL ((0x560 - 0x260) / 4) -#define CM_FLEXCAN0CLKSEL ((0x5A0 - 0x260) / 4) -#define CM_FLEXCAN1CLKSEL ((0x5A8 - 0x260) / 4) -#define CM_EWM0CLKSEL ((0x5D4 - 0x260) / 4) -#define CM_WDT1CLKSEL ((0x5D8 - 0x260) / 4) -#define CM_OSTIMERCLKSEL ((0x5E0 - 0x260) / 4) -#define CM_CMP0FCLKSEL ((0x5F0 - 0x260) / 4) -#define CM_CMP0RRCLKSEL ((0x5F8 - 0x260) / 4) -#define CM_CMP1FCLKSEL ((0x600 - 0x260) / 4) -#define CM_CMP1RRCLKSEL ((0x608 - 0x260) / 4) -#define CM_UTICKCLKSEL ((0x878 - 0x260) / 4) -#define CM_SAI0CLKSEL ((0x880 - 0x260) / 4) -#define CM_SAI1CLKSEL ((0x884 - 0x260) / 4) -#define CM_I3C1FCLKSEL ((0xB30 - 0x260) / 4) - -#define CM_SCGRCCRSCSCLKSEL 0x3FEU - -/*! - * @brief The enumerator of clock attach Id. - */ -typedef enum _clock_attach_id -{ - kCLK_IN_to_MAIN_CLK = MUX_A(CM_SCGRCCRSCSCLKSEL, 1), /*!< Attach clk_in to MAIN_CLK. */ - kFRO12M_to_MAIN_CLK = MUX_A(CM_SCGRCCRSCSCLKSEL, 2), /*!< Attach FRO_12M to MAIN_CLK. */ - kFRO_HF_to_MAIN_CLK = MUX_A(CM_SCGRCCRSCSCLKSEL, 3), /*!< Attach FRO_HF to MAIN_CLK. */ - kXTAL32K2_to_MAIN_CLK = MUX_A(CM_SCGRCCRSCSCLKSEL, 4), /*!< Attach xtal32k[2] to MAIN_CLK. */ - kPLL0_to_MAIN_CLK = MUX_A(CM_SCGRCCRSCSCLKSEL, 5), /*!< Attach PLL0 to MAIN_CLK. */ - kPLL1_to_MAIN_CLK = MUX_A(CM_SCGRCCRSCSCLKSEL, 6), /*!< Attach PLL1 to MAIN_CLK. */ - kUSB_PLL_to_MAIN_CLK = MUX_A(CM_SCGRCCRSCSCLKSEL, 7), /*!< Attach USB PLL to MAIN_CLK. */ - kNONE_to_MAIN_CLK = MUX_A(CM_SCGRCCRSCSCLKSEL, 15), /*!< Attach NONE to MAIN_CLK. */ - - kSYSTICK_DIV0_to_SYSTICK0 = MUX_A(CM_SYSTICKCLKSEL0, 0), /*!< Attach SYSTICK_DIV0 to SYSTICK0. */ - kCLK_1M_to_SYSTICK0 = MUX_A(CM_SYSTICKCLKSEL0, 1), /*!< Attach Clk 1 MHz to SYSTICK0. */ - kLPOSC_to_SYSTICK0 = MUX_A(CM_SYSTICKCLKSEL0, 2), /*!< Attach LP Oscillator to SYSTICK0. */ - kNONE_to_SYSTICK0 = MUX_A(CM_SYSTICKCLKSEL0, 7), /*!< Attach NONE to SYSTICK0. */ - - kTRACE_DIV_to_TRACE = MUX_A(CM_TRACECLKSEL, 0), /*!< Attach TRACE_DIV to TRACE. */ - kCLK_1M_to_TRACE = MUX_A(CM_TRACECLKSEL, 1), /*!< Attach Clk 1 MHz to TRACE. */ - kLPOSC_to_TRACE = MUX_A(CM_TRACECLKSEL, 2), /*!< Attach LP Oscillator to TRACE. */ - kNONE_to_TRACE = MUX_A(CM_TRACECLKSEL, 7), /*!< Attach NONE to TRACE. */ - - kCLK_1M_to_CTIMER0 = MUX_A(CM_CTIMERCLKSEL0, 0), /*!< Attach CLK_1M to CTIMER0. */ - kPLL0_to_CTIMER0 = MUX_A(CM_CTIMERCLKSEL0, 1), /*!< Attach PLL0 to CTIMER0. */ - kPLL1_CLK0_to_CTIMER0 = MUX_A(CM_CTIMERCLKSEL0, 2), /*!< Attach PLL1_clk0 to CTIMER0. */ - kFRO_HF_to_CTIMER0 = MUX_A(CM_CTIMERCLKSEL0, 3), /*!< Attach FRO_HF to CTIMER0. */ - kFRO12M_to_CTIMER0 = MUX_A(CM_CTIMERCLKSEL0, 4), /*!< Attach FRO 12MHz to CTIMER0. */ - kSAI0_MCLK_IN_to_CTIMER0 = MUX_A(CM_CTIMERCLKSEL0, 5), /*!< Attach SAI0 MCLK IN to CTIMER0. */ - kLPOSC_to_CTIMER0 = MUX_A(CM_CTIMERCLKSEL0, 6), /*!< Attach LP Oscillator to CTIMER0. */ - kSAI1_MCLK_IN_to_CTIMER0 = MUX_A(CM_CTIMERCLKSEL0, 8), /*!< Attach SAI1 MCLK IN to CTIMER0. */ - kSAI0_TX_BCLK_to_CTIMER0 = MUX_A(CM_CTIMERCLKSEL0, 9), /*!< Attach SAI0 TX_BCLK to CTIMER0. */ - kSAI0_RX_BCLK_to_CTIMER0 = MUX_A(CM_CTIMERCLKSEL0, 10), /*!< Attach SAI0 RX_BCLK to CTIMER0. */ - kSAI1_TX_BCLK_to_CTIMER0 = MUX_A(CM_CTIMERCLKSEL0, 11), /*!< Attach SAI1 TX_BCLK to CTIMER0. */ - kSAI1_RX_BCLK_to_CTIMER0 = MUX_A(CM_CTIMERCLKSEL0, 12), /*!< Attach SAI1 RX_BCLK to CTIMER0. */ - kNONE_to_CTIMER0 = MUX_A(CM_CTIMERCLKSEL0, 15), /*!< Attach NONE to CTIMER0. */ - - kCLK_1M_to_CTIMER1 = MUX_A(CM_CTIMERCLKSEL1, 0), /*!< Attach CLK_1M to CTIMER1. */ - kPLL0_to_CTIMER1 = MUX_A(CM_CTIMERCLKSEL1, 1), /*!< Attach PLL0 to CTIMER1. */ - kPLL1_CLK0_to_CTIMER1 = MUX_A(CM_CTIMERCLKSEL1, 2), /*!< Attach PLL1_clk0 to CTIMER1. */ - kFRO_HF_to_CTIMER1 = MUX_A(CM_CTIMERCLKSEL1, 3), /*!< Attach FRO_HF to CTIMER1. */ - kFRO12M_to_CTIMER1 = MUX_A(CM_CTIMERCLKSEL1, 4), /*!< Attach FRO 12MHz to CTIMER1. */ - kSAI0_MCLK_IN_to_CTIMER1 = MUX_A(CM_CTIMERCLKSEL1, 5), /*!< Attach SAI0 MCLK IN to CTIMER1. */ - kLPOSC_to_CTIMER1 = MUX_A(CM_CTIMERCLKSEL1, 6), /*!< Attach LP Oscillator to CTIMER1. */ - kSAI1_MCLK_IN_to_CTIMER1 = MUX_A(CM_CTIMERCLKSEL1, 8), /*!< Attach SAI1 MCLK IN to CTIMER1. */ - kSAI0_TX_BCLK_to_CTIMER1 = MUX_A(CM_CTIMERCLKSEL1, 9), /*!< Attach SAI0 TX_BCLK to CTIMER1. */ - kSAI0_RX_BCLK_to_CTIMER1 = MUX_A(CM_CTIMERCLKSEL1, 10), /*!< Attach SAI0 RX_BCLK to CTIMER1. */ - kSAI1_TX_BCLK_to_CTIMER1 = MUX_A(CM_CTIMERCLKSEL1, 11), /*!< Attach SAI1 TX_BCLK to CTIMER1. */ - kSAI1_RX_BCLK_to_CTIMER1 = MUX_A(CM_CTIMERCLKSEL1, 12), /*!< Attach SAI1 RX_BCLK to CTIMER1. */ - kNONE_to_CTIMER1 = MUX_A(CM_CTIMERCLKSEL1, 15), /*!< Attach NONE to CTIMER1. */ - - kCLK_1M_to_CTIMER2 = MUX_A(CM_CTIMERCLKSEL2, 0), /*!< Attach CLK_1M to CTIMER2. */ - kPLL0_to_CTIMER2 = MUX_A(CM_CTIMERCLKSEL2, 1), /*!< Attach PLL0 to CTIMER2. */ - kPLL1_CLK0_to_CTIMER2 = MUX_A(CM_CTIMERCLKSEL2, 2), /*!< Attach PLL1_clk0 to CTIMER2. */ - kFRO_HF_to_CTIMER2 = MUX_A(CM_CTIMERCLKSEL2, 3), /*!< Attach FRO_HF to CTIMER2. */ - kFRO12M_to_CTIMER2 = MUX_A(CM_CTIMERCLKSEL2, 4), /*!< Attach FRO 12MHz to CTIMER2. */ - kSAI0_MCLK_IN_to_CTIMER2 = MUX_A(CM_CTIMERCLKSEL2, 5), /*!< Attach SAI0 MCLK IN to CTIMER2. */ - kLPOSC_to_CTIMER2 = MUX_A(CM_CTIMERCLKSEL2, 6), /*!< Attach LP Oscillator to CTIMER2. */ - kSAI1_MCLK_IN_to_CTIMER2 = MUX_A(CM_CTIMERCLKSEL2, 8), /*!< Attach SAI1 MCLK IN to CTIMER2. */ - kSAI0_TX_BCLK_to_CTIMER2 = MUX_A(CM_CTIMERCLKSEL2, 9), /*!< Attach SAI0 TX_BCLK to CTIMER2. */ - kSAI0_RX_BCLK_to_CTIMER2 = MUX_A(CM_CTIMERCLKSEL2, 10), /*!< Attach SAI0 RX_BCLK to CTIMER2. */ - kSAI1_TX_BCLK_to_CTIMER2 = MUX_A(CM_CTIMERCLKSEL2, 11), /*!< Attach SAI1 TX_BCLK to CTIMER2. */ - kSAI1_RX_BCLK_to_CTIMER2 = MUX_A(CM_CTIMERCLKSEL2, 12), /*!< Attach SAI1 RX_BCLK to CTIMER2. */ - kNONE_to_CTIMER2 = MUX_A(CM_CTIMERCLKSEL2, 15), /*!< Attach NONE to CTIMER2. */ - - kCLK_1M_to_CTIMER3 = MUX_A(CM_CTIMERCLKSEL3, 0), /*!< Attach CLK_1M to CTIMER3. */ - kPLL0_to_CTIMER3 = MUX_A(CM_CTIMERCLKSEL3, 1), /*!< Attach PLL0 to CTIMER3. */ - kPLL1_CLK0_to_CTIMER3 = MUX_A(CM_CTIMERCLKSEL3, 2), /*!< Attach PLL1_clk0 to CTIMER3. */ - kFRO_HF_to_CTIMER3 = MUX_A(CM_CTIMERCLKSEL3, 3), /*!< Attach FRO_HF to CTIMER3. */ - kFRO12M_to_CTIMER3 = MUX_A(CM_CTIMERCLKSEL3, 4), /*!< Attach FRO 12MHz to CTIMER3. */ - kSAI0_MCLK_IN_to_CTIMER3 = MUX_A(CM_CTIMERCLKSEL3, 5), /*!< Attach SAI0 MCLK IN to CTIMER3. */ - kLPOSC_to_CTIMER3 = MUX_A(CM_CTIMERCLKSEL3, 6), /*!< Attach LP Oscillator to CTIMER3. */ - kSAI1_MCLK_IN_to_CTIMER3 = MUX_A(CM_CTIMERCLKSEL3, 8), /*!< Attach SAI1 MCLK IN to CTIMER3. */ - kSAI0_TX_BCLK_to_CTIMER3 = MUX_A(CM_CTIMERCLKSEL3, 9), /*!< Attach SAI0 TX_BCLK to CTIMER3. */ - kSAI0_RX_BCLK_to_CTIMER3 = MUX_A(CM_CTIMERCLKSEL3, 10), /*!< Attach SAI0 RX_BCLK to CTIMER3. */ - kSAI1_TX_BCLK_to_CTIMER3 = MUX_A(CM_CTIMERCLKSEL3, 11), /*!< Attach SAI1 TX_BCLK to CTIMER3. */ - kSAI1_RX_BCLK_to_CTIMER3 = MUX_A(CM_CTIMERCLKSEL3, 12), /*!< Attach SAI1 RX_BCLK to CTIMER3. */ - kNONE_to_CTIMER3 = MUX_A(CM_CTIMERCLKSEL3, 15), /*!< Attach NONE to CTIMER3. */ - - kCLK_1M_to_CTIMER4 = MUX_A(CM_CTIMERCLKSEL4, 0), /*!< Attach CLK_1M to CTIMER4. */ - kPLL0_to_CTIMER4 = MUX_A(CM_CTIMERCLKSEL4, 1), /*!< Attach PLL0 to CTIMER4. */ - kPLL1_CLK0_to_CTIMER4 = MUX_A(CM_CTIMERCLKSEL4, 2), /*!< Attach PLL1_clk0 to CTIMER4. */ - kFRO_HF_to_CTIMER4 = MUX_A(CM_CTIMERCLKSEL4, 3), /*!< Attach FRO_HF to CTIMER4. */ - kFRO12M_to_CTIMER4 = MUX_A(CM_CTIMERCLKSEL4, 4), /*!< Attach FRO 12MHz to CTIMER4. */ - kSAI0_MCLK_IN_to_CTIMER4 = MUX_A(CM_CTIMERCLKSEL4, 5), /*!< Attach SAI0 MCLK IN to CTIMER4. */ - kLPOSC_to_CTIMER4 = MUX_A(CM_CTIMERCLKSEL4, 6), /*!< Attach LP Oscillator to CTIMER4. */ - kSAI1_MCLK_IN_to_CTIMER4 = MUX_A(CM_CTIMERCLKSEL4, 8), /*!< Attach SAI1 MCLK IN to CTIMER4. */ - kSAI0_TX_BCLK_to_CTIMER4 = MUX_A(CM_CTIMERCLKSEL4, 9), /*!< Attach SAI0 TX_BCLK to CTIMER4. */ - kSAI0_RX_BCLK_to_CTIMER4 = MUX_A(CM_CTIMERCLKSEL4, 10), /*!< Attach SAI0 RX_BCLK to CTIMER4. */ - kSAI1_TX_BCLK_to_CTIMER4 = MUX_A(CM_CTIMERCLKSEL4, 11), /*!< Attach SAI1 TX_BCLK to CTIMER4. */ - kSAI1_RX_BCLK_to_CTIMER4 = MUX_A(CM_CTIMERCLKSEL4, 12), /*!< Attach SAI1 RX_BCLK to CTIMER4. */ - kNONE_to_CTIMER4 = MUX_A(CM_CTIMERCLKSEL4, 15), /*!< Attach NONE to CTIMER4. */ - - kMAIN_CLK_to_CLKOUT = MUX_A(CM_CLKOUTCLKSEL, 0), /*!< Attach MAIN_CLK to CLKOUT. */ - kPLL0_to_CLKOUT = MUX_A(CM_CLKOUTCLKSEL, 1), /*!< Attach PLL0 to CLKOUT. */ - kCLK_IN_to_CLKOUT = MUX_A(CM_CLKOUTCLKSEL, 2), /*!< Attach Clk_in to CLKOUT. */ - kFRO_HF_to_CLKOUT = MUX_A(CM_CLKOUTCLKSEL, 3), /*!< Attach FRO_HF to CLKOUT. */ - kFRO12M_to_CLKOUT = MUX_A(CM_CLKOUTCLKSEL, 4), /*!< Attach FRO 12 MHz to CLKOUT. */ - kPLL1_CLK0_to_CLKOUT = MUX_A(CM_CLKOUTCLKSEL, 5), /*!< Attach PLL1_clk0 to CLKOUT. */ - kLPOSC_to_CLKOUT = MUX_A(CM_CLKOUTCLKSEL, 6), /*!< Attach LP Oscillator to CLKOUT. */ - kUSB_PLL_to_CLKOUT = MUX_A(CM_CLKOUTCLKSEL, 7), /*!< Attach USB_PLL to CLKOUT. */ - kNONE_to_CLKOUT = MUX_A(CM_CLKOUTCLKSEL, 15), /*!< Attach NONE to CLKOUT. */ - - kPLL0_to_ADC0 = MUX_A(CM_ADC0CLKSEL, 1), /*!< Attach PLL0 to ADC0. */ - kFRO_HF_to_ADC0 = MUX_A(CM_ADC0CLKSEL, 2), /*!< Attach FRO_HF to ADC0. */ - kFRO12M_to_ADC0 = MUX_A(CM_ADC0CLKSEL, 3), /*!< Attach FRO 12 MHz to ADC0. */ - kCLK_IN_to_ADC0 = MUX_A(CM_ADC0CLKSEL, 4), /*!< Attach Clk_in to ADC0. */ - kPLL1_CLK0_to_ADC0 = MUX_A(CM_ADC0CLKSEL, 5), /*!< Attach PLL1_clk0 to ADC0. */ - kUSB_PLL_to_ADC0 = MUX_A(CM_ADC0CLKSEL, 6), /*!< Attach USB PLL to ADC0. */ - kNONE_to_ADC0 = MUX_A(CM_ADC0CLKSEL, 7), /*!< Attach NONE to ADC0. */ - - kPLL_DIV_to_FLEXCOMM0 = MUX_A(CM_FCCLKSEL0, 1), /*!< Attach PLL_DIV to FLEXCOMM0. */ - kFRO12M_to_FLEXCOMM0 = MUX_A(CM_FCCLKSEL0, 2), /*!< Attach FRO12M to FLEXCOMM0. */ - kFRO_HF_DIV_to_FLEXCOMM0 = MUX_A(CM_FCCLKSEL0, 3), /*!< Attach FRO_HF_DIV to FLEXCOMM0. */ - kCLK_1M_to_FLEXCOMM0 = MUX_A(CM_FCCLKSEL0, 4), /*!< Attach CLK_1MHz to FLEXCOMM0. */ - kUSB_PLL_to_FLEXCOMM0 = MUX_A(CM_FCCLKSEL0, 5), /*!< Attach USB_PLL to FLEXCOMM0. */ - kLPOSC_to_FLEXCOMM0 = MUX_A(CM_FCCLKSEL0, 6), /*!< Attach LP Oscillator to FLEXCOMM0. */ - kNONE_to_FLEXCOMM0 = MUX_A(CM_FCCLKSEL0, 7), /*!< Attach NONE to FLEXCOMM0. */ - - kPLL_DIV_to_FLEXCOMM1 = MUX_A(CM_FCCLKSEL1, 1), /*!< Attach PLL_DIV to FLEXCOMM1. */ - kFRO12M_to_FLEXCOMM1 = MUX_A(CM_FCCLKSEL1, 2), /*!< Attach FRO12M to FLEXCOMM1. */ - kFRO_HF_DIV_to_FLEXCOMM1 = MUX_A(CM_FCCLKSEL1, 3), /*!< Attach FRO_HF_DIV to FLEXCOMM1. */ - kCLK_1M_to_FLEXCOMM1 = MUX_A(CM_FCCLKSEL1, 4), /*!< Attach CLK_1MHz to FLEXCOMM1. */ - kUSB_PLL_to_FLEXCOMM1 = MUX_A(CM_FCCLKSEL1, 5), /*!< Attach USB_PLL to FLEXCOMM1. */ - kLPOSC_to_FLEXCOMM1 = MUX_A(CM_FCCLKSEL1, 6), /*!< Attach LP Oscillator to FLEXCOMM1. */ - kNONE_to_FLEXCOMM1 = MUX_A(CM_FCCLKSEL1, 7), /*!< Attach NONE to FLEXCOMM1. */ - - kPLL_DIV_to_FLEXCOMM2 = MUX_A(CM_FCCLKSEL2, 1), /*!< Attach PLL_DIV to FLEXCOMM2. */ - kFRO12M_to_FLEXCOMM2 = MUX_A(CM_FCCLKSEL2, 2), /*!< Attach FRO12M to FLEXCOMM2. */ - kFRO_HF_DIV_to_FLEXCOMM2 = MUX_A(CM_FCCLKSEL2, 3), /*!< Attach FRO_HF_DIV to FLEXCOMM2. */ - kCLK_1M_to_FLEXCOMM2 = MUX_A(CM_FCCLKSEL2, 4), /*!< Attach CLK_1MHz to FLEXCOMM2. */ - kUSB_PLL_to_FLEXCOMM2 = MUX_A(CM_FCCLKSEL2, 5), /*!< Attach USB_PLL to FLEXCOMM2. */ - kLPOSC_to_FLEXCOMM2 = MUX_A(CM_FCCLKSEL2, 6), /*!< Attach LP Oscillator to FLEXCOMM2. */ - kNONE_to_FLEXCOMM2 = MUX_A(CM_FCCLKSEL2, 7), /*!< Attach NONE to FLEXCOMM2. */ - - kPLL_DIV_to_FLEXCOMM3 = MUX_A(CM_FCCLKSEL3, 1), /*!< Attach PLL_DIV to FLEXCOMM3. */ - kFRO12M_to_FLEXCOMM3 = MUX_A(CM_FCCLKSEL3, 2), /*!< Attach FRO12M to FLEXCOMM3. */ - kFRO_HF_DIV_to_FLEXCOMM3 = MUX_A(CM_FCCLKSEL3, 3), /*!< Attach FRO_HF_DIV to FLEXCOMM3. */ - kCLK_1M_to_FLEXCOMM3 = MUX_A(CM_FCCLKSEL3, 4), /*!< Attach CLK_1MHz to FLEXCOMM3. */ - kUSB_PLL_to_FLEXCOMM3 = MUX_A(CM_FCCLKSEL3, 5), /*!< Attach USB_PLL to FLEXCOMM3. */ - kLPOSC_to_FLEXCOMM3 = MUX_A(CM_FCCLKSEL3, 6), /*!< Attach LP Oscillator to FLEXCOMM3. */ - kNONE_to_FLEXCOMM3 = MUX_A(CM_FCCLKSEL3, 7), /*!< Attach NONE to FLEXCOMM3. */ - - kPLL_DIV_to_FLEXCOMM4 = MUX_A(CM_FCCLKSEL4, 1), /*!< Attach PLL_DIV to FLEXCOMM4. */ - kFRO12M_to_FLEXCOMM4 = MUX_A(CM_FCCLKSEL4, 2), /*!< Attach FRO12M to FLEXCOMM4. */ - kFRO_HF_DIV_to_FLEXCOMM4 = MUX_A(CM_FCCLKSEL4, 3), /*!< Attach FRO_HF_DIV to FLEXCOMM4. */ - kCLK_1M_to_FLEXCOMM4 = MUX_A(CM_FCCLKSEL4, 4), /*!< Attach CLK_1MHz to FLEXCOMM4. */ - kUSB_PLL_to_FLEXCOMM4 = MUX_A(CM_FCCLKSEL4, 5), /*!< Attach USB_PLL to FLEXCOMM4. */ - kLPOSC_to_FLEXCOMM4 = MUX_A(CM_FCCLKSEL4, 6), /*!< Attach LP Oscillator to FLEXCOMM4. */ - kNONE_to_FLEXCOMM4 = MUX_A(CM_FCCLKSEL4, 7), /*!< Attach NONE to FLEXCOMM4. */ - - kPLL_DIV_to_FLEXCOMM5 = MUX_A(CM_FCCLKSEL5, 1), /*!< Attach PLL_DIV to FLEXCOMM5. */ - kFRO12M_to_FLEXCOMM5 = MUX_A(CM_FCCLKSEL5, 2), /*!< Attach FRO12M to FLEXCOMM5. */ - kFRO_HF_DIV_to_FLEXCOMM5 = MUX_A(CM_FCCLKSEL5, 3), /*!< Attach FRO_HF_DIV to FLEXCOMM5. */ - kCLK_1M_to_FLEXCOMM5 = MUX_A(CM_FCCLKSEL5, 4), /*!< Attach CLK_1MHz to FLEXCOMM5. */ - kUSB_PLL_to_FLEXCOMM5 = MUX_A(CM_FCCLKSEL5, 5), /*!< Attach USB_PLL to FLEXCOMM5. */ - kLPOSC_to_FLEXCOMM5 = MUX_A(CM_FCCLKSEL5, 6), /*!< Attach LP Oscillator to FLEXCOMM5. */ - kNONE_to_FLEXCOMM5 = MUX_A(CM_FCCLKSEL5, 7), /*!< Attach NONE to FLEXCOMM5. */ - - kPLL_DIV_to_FLEXCOMM6 = MUX_A(CM_FCCLKSEL6, 1), /*!< Attach PLL_DIV to FLEXCOMM6. */ - kFRO12M_to_FLEXCOMM6 = MUX_A(CM_FCCLKSEL6, 2), /*!< Attach FRO12M to FLEXCOMM6. */ - kFRO_HF_DIV_to_FLEXCOMM6 = MUX_A(CM_FCCLKSEL6, 3), /*!< Attach FRO_HF_DIV to FLEXCOMM6. */ - kCLK_1M_to_FLEXCOMM6 = MUX_A(CM_FCCLKSEL6, 4), /*!< Attach CLK_1MHz to FLEXCOMM6. */ - kUSB_PLL_to_FLEXCOMM6 = MUX_A(CM_FCCLKSEL6, 5), /*!< Attach USB_PLL to FLEXCOMM6. */ - kLPOSC_to_FLEXCOMM6 = MUX_A(CM_FCCLKSEL6, 6), /*!< Attach LP Oscillator to FLEXCOMM6. */ - kNONE_to_FLEXCOMM6 = MUX_A(CM_FCCLKSEL6, 7), /*!< Attach NONE to FLEXCOMM6. */ - - kPLL_DIV_to_FLEXCOMM7 = MUX_A(CM_FCCLKSEL7, 1), /*!< Attach PLL_DIV to FLEXCOMM7. */ - kFRO12M_to_FLEXCOMM7 = MUX_A(CM_FCCLKSEL7, 2), /*!< Attach FRO12M to FLEXCOMM7. */ - kFRO_HF_DIV_to_FLEXCOMM7 = MUX_A(CM_FCCLKSEL7, 3), /*!< Attach FRO_HF_DIV to FLEXCOMM7. */ - kCLK_1M_to_FLEXCOMM7 = MUX_A(CM_FCCLKSEL7, 4), /*!< Attach CLK_1MHz to FLEXCOMM7. */ - kUSB_PLL_to_FLEXCOMM7 = MUX_A(CM_FCCLKSEL7, 5), /*!< Attach USB_PLL to FLEXCOMM7. */ - kLPOSC_to_FLEXCOMM7 = MUX_A(CM_FCCLKSEL7, 6), /*!< Attach LP Oscillator to FLEXCOMM7. */ - kNONE_to_FLEXCOMM7 = MUX_A(CM_FCCLKSEL7, 7), /*!< Attach NONE to FLEXCOMM7. */ - - kPLL0_to_ADC1 = MUX_A(CM_ADC1CLKSEL, 1), /*!< Attach PLL0 to ADC1. */ - kFRO_HF_to_ADC1 = MUX_A(CM_ADC1CLKSEL, 2), /*!< Attach FRO_HF to ADC1. */ - kFRO12M_to_ADC1 = MUX_A(CM_ADC1CLKSEL, 3), /*!< Attach FRO12M to ADC1. */ - kCLK_IN_to_ADC1 = MUX_A(CM_ADC1CLKSEL, 4), /*!< Attach clk_in to ADC1. */ - kPLL1_CLK0_to_ADC1 = MUX_A(CM_ADC1CLKSEL, 5), /*!< Attach PLL1_clk0 to ADC1. */ - kUSB_PLL_to_ADC1 = MUX_A(CM_ADC1CLKSEL, 6), /*!< Attach USB PLL to ADC1. */ - kNONE_to_ADC1 = MUX_A(CM_ADC1CLKSEL, 7), /*!< Attach NONE to ADC1. */ - - kPLL0_to_PLLCLKDIV = MUX_A(CM_PLLCLKDIVSEL, 0), /*!< Attach PLL0 to PLLCLKDIV. */ - kPLL1_CLK0_to_PLLCLKDIV = MUX_A(CM_PLLCLKDIVSEL, 1), /*!< Attach pll1_clk0 to PLLCLKDIV. */ - kNONE_to_PLLCLKDIV = MUX_A(CM_PLLCLKDIVSEL, 1), /*!< Attach NONE to PLLCLKDIV. */ - - kPLL0_to_I3C0FCLK = MUX_A(CM_I3C0FCLKSEL, 1), /*!< Attach PLL0 to I3C0FCLK. */ - kFRO_HF_to_I3C0FCLK = MUX_A(CM_I3C0FCLKSEL, 3), /*!< Attach FRO_HF to I3C0FCLK. */ - kCLK_1M_to_I3C0FCLK = MUX_A(CM_I3C0FCLKSEL, 4), /*!< Attach CLK_1M to I3C0FCLK. */ - kPLL1_CLK0_to_I3C0FCLK = MUX_A(CM_I3C0FCLKSEL, 5), /*!< Attach PLL1_clk0 to I3C0FCLK. */ - kUSB_PLL_to_I3C0FCLK = MUX_A(CM_I3C0FCLKSEL, 6), /*!< Attach USB PLL to I3C0FCLK. */ - kNONE_to_I3C0FCLK = MUX_A(CM_I3C0FCLKSEL, 7), /*!< Attach NONE to I3C0FCLK. */ - - kPLL0_to_I3C0FCLKSTC = MUX_A(CM_I3C0FCLKSEL, 1), /*!< Attach PLL0 to I3C0FCLKSTC. */ - kFRO_HF_to_I3C0FCLKSTC = MUX_A(CM_I3C0FCLKSEL, 3), /*!< Attach FRO_HF to I3C0FCLKSTC. */ - kCLK_1M_to_I3C0FCLKSTC = MUX_A(CM_I3C0FCLKSEL, 4), /*!< Attach CLK_1M to I3C0FCLKSTC. */ - kPLL1_CLK0_to_I3C0FCLKSTC = MUX_A(CM_I3C0FCLKSEL, 5), /*!< Attach PLL1_clk0 to I3C0FCLKSTC. */ - kUSB_PLL_to_I3C0FCLKSTC = MUX_A(CM_I3C0FCLKSEL, 6), /*!< Attach USB PLL to I3C0FCLKSTC. */ - kNONE_to_I3C0FCLKSTC = MUX_A(CM_I3C0FCLKSEL, 7), /*!< Attach NONE to I3C0FCLKSTC. */ - - kPLL0_to_I3C0FCLKSlow = MUX_A(CM_I3C0FCLKSEL, 1), /*!< Attach PLL0 to I3C0FCLKS. */ - kFRO_HF_to_I3C0FCLKSlow = MUX_A(CM_I3C0FCLKSEL, 3), /*!< Attach FRO_HF to I3C0FCLKS. */ - kCLK_1M_to_I3C0FCLKSlow = MUX_A(CM_I3C0FCLKSEL, 4), /*!< Attach CLK_1M to I3C0FCLKS. */ - kPLL1_CLK0_to_I3C0FCLKSlow = MUX_A(CM_I3C0FCLKSEL, 5), /*!< Attach PLL1_clk0 to I3C0FCLKS. */ - kUSB_PLL_to_I3C0FCLKSlow = MUX_A(CM_I3C0FCLKSEL, 6), /*!< Attach USB PLL to I3C0FCLKS. */ - kNONE_to_I3C0FCLKSlow = MUX_A(CM_I3C0FCLKSEL, 7), /*!< Attach NONE to I3C0FCLKS. */ - - kFRO12M_to_MICFILF = MUX_A(CM_MICFILFCLKSEL, 0), /*!< Attach FRO_12M to MICFILF. */ - kPLL0_to_MICFILF = MUX_A(CM_MICFILFCLKSEL, 1), /*!< Attach PLL0 to MICFILF. */ - kCLK_IN_to_MICFILF = MUX_A(CM_MICFILFCLKSEL, 2), /*!< Attach Clk_in to MICFILF. */ - kFRO_HF_to_MICFILF = MUX_A(CM_MICFILFCLKSEL, 3), /*!< Attach FRO_HF to MICFILF. */ - kPLL1_CLK0_to_MICFILF = MUX_A(CM_MICFILFCLKSEL, 4), /*!< Attach PLL1_clk0 to MICFILF. */ - kSAI0_MCLK_IN_to_MICFILF = MUX_A(CM_MICFILFCLKSEL, 5), /*!< Attach SAI0_MCLK to MICFILF. */ - kUSB_PLL_to_MICFILF = MUX_A(CM_MICFILFCLKSEL, 6), /*!< Attach USB PLL to MICFILF. */ - kSAI1_MCLK_IN_to_MICFILF = MUX_A(CM_MICFILFCLKSEL, 8), /*!< Attach SAI1_MCLK to MICFILF. */ - kNONE_to_MICFILF = MUX_A(CM_MICFILFCLKSEL, 15), /*!< Attach NONE to MICFILF. */ - - kPLL0_to_FLEXIO = MUX_A(CM_FLEXIOCLKSEL, 1), /*!< Attach PLL0 to FLEXIO. */ - kCLK_IN_to_FLEXIO = MUX_A(CM_FLEXIOCLKSEL, 2), /*!< Attach Clk_in to FLEXIO. */ - kFRO_HF_to_FLEXIO = MUX_A(CM_FLEXIOCLKSEL, 3), /*!< Attach FRO_HF to FLEXIO. */ - kFRO12M_to_FLEXIO = MUX_A(CM_FLEXIOCLKSEL, 4), /*!< Attach FRO_12M to FLEXIO. */ - kPLL1_CLK0_to_FLEXIO = MUX_A(CM_FLEXIOCLKSEL, 5), /*!< Attach pll1_clk0 to FLEXIO. */ - kUSB_PLL_to_FLEXIO = MUX_A(CM_FLEXIOCLKSEL, 6), /*!< Attach USB PLL to FLEXIO. */ - kNONE_to_FLEXIO = MUX_A(CM_FLEXIOCLKSEL, 7), /*!< Attach NONE to FLEXIO. */ - - kPLL0_to_FLEXCAN0 = MUX_A(CM_FLEXCAN0CLKSEL, 1), /*!< Attach PLL0 to FLEXCAN0. */ - kCLK_IN_to_FLEXCAN0 = MUX_A(CM_FLEXCAN0CLKSEL, 2), /*!< Attach Clk_in to FLEXCAN0. */ - kFRO_HF_to_FLEXCAN0 = MUX_A(CM_FLEXCAN0CLKSEL, 3), /*!< Attach FRO_HF to FLEXCAN0. */ - kPLL1_CLK0_to_FLEXCAN0 = MUX_A(CM_FLEXCAN0CLKSEL, 5), /*!< Attach pll1_clk0 to FLEXCAN0. */ - kUSB_PLL_to_FLEXCAN0 = MUX_A(CM_FLEXCAN0CLKSEL, 6), /*!< Attach USB PLL to FLEXCAN0. */ - kNONE_to_FLEXCAN0 = MUX_A(CM_FLEXCAN0CLKSEL, 7), /*!< Attach NONE to FLEXCAN0. */ - - kPLL0_to_FLEXCAN1 = MUX_A(CM_FLEXCAN1CLKSEL, 1), /*!< Attach PLL0 to FLEXCAN1. */ - kCLK_IN_to_FLEXCAN1 = MUX_A(CM_FLEXCAN1CLKSEL, 2), /*!< Attach Clk_in to FLEXCAN1. */ - kFRO_HF_to_FLEXCAN1 = MUX_A(CM_FLEXCAN1CLKSEL, 3), /*!< Attach FRO_HF to FLEXCAN1. */ - kPLL1_CLK0_to_FLEXCAN1 = MUX_A(CM_FLEXCAN1CLKSEL, 5), /*!< Attach pll1_clk0 to FLEXCAN1. */ - kUSB_PLL_to_FLEXCAN1 = MUX_A(CM_FLEXCAN1CLKSEL, 6), /*!< Attach USB PLL to FLEXCAN1. */ - kNONE_to_FLEXCAN1 = MUX_A(CM_FLEXCAN1CLKSEL, 7), /*!< Attach NONE to FLEXCAN1. */ - - kCLK_16K2_to_EWM0 = MUX_A(CM_EWM0CLKSEL, 0), /*!< Attach clk_16k[2] to EWM0. */ - kXTAL32K2_to_EWM0 = MUX_A(CM_EWM0CLKSEL, 1), /*!< Attach xtal32k[2] to EWM0. */ - - kCLK_16K2_to_WDT1 = MUX_A(CM_WDT1CLKSEL, 0), /*!< Attach FRO16K clock 2 to WDT1. */ - kFRO_HF_DIV_to_WDT1 = MUX_A(CM_WDT1CLKSEL, 1), /*!< Attach FRO_HF_DIV to WDT1. */ - kCLK_1M_to_WDT1 = MUX_A(CM_WDT1CLKSEL, 2), /*!< Attach clk_1m to WDT1. */ - kCLK_1M_2_to_WDT1 = MUX_A(CM_WDT1CLKSEL, 3), /*!< Attach clk_1m to WDT1. */ - - kCLK_16K2_to_OSTIMER = MUX_A(CM_OSTIMERCLKSEL, 0), /*!< Attach clk_16k[2] to OSTIMER. */ - kXTAL32K2_to_OSTIMER = MUX_A(CM_OSTIMERCLKSEL, 1), /*!< Attach xtal32k[2] to OSTIMER. */ - kCLK_1M_to_OSTIMER = MUX_A(CM_OSTIMERCLKSEL, 2), /*!< Attach clk_1m to OSTIMER. */ - kNONE_to_OSTIMER = MUX_A(CM_OSTIMERCLKSEL, 3), /*!< Attach NONE to OSTIMER. */ - - kPLL0_to_CMP0F = MUX_A(CM_CMP0FCLKSEL, 1), /*!< Attach PLL0 to CMP0F. */ - kFRO_HF_to_CMP0F = MUX_A(CM_CMP0FCLKSEL, 2), /*!< Attach FRO_HF to CMP0F. */ - kFRO12M_to_CMP0F = MUX_A(CM_CMP0FCLKSEL, 3), /*!< Attach FRO_12M to CMP0F. */ - kCLK_IN_to_CMP0F = MUX_A(CM_CMP0FCLKSEL, 4), /*!< Attach Clk_in to CMP0F. */ - kPLL1_CLK0_to_CMP0F = MUX_A(CM_CMP0FCLKSEL, 5), /*!< Attach PLL1_clk0 to CMP0F. */ - kUSB_PLL_to_CMP0F = MUX_A(CM_CMP0FCLKSEL, 6), /*!< Attach USB PLL to CMP0F. */ - kNONE_to_CMP0F = MUX_A(CM_CMP0FCLKSEL, 7), /*!< Attach NONE to CMP0F. */ - - kPLL0_to_CMP0RR = MUX_A(CM_CMP0RRCLKSEL, 1), /*!< Attach PLL0 to CMP0RR. */ - kFRO_HF_to_CMP0RR = MUX_A(CM_CMP0RRCLKSEL, 2), /*!< Attach FRO_HF to CMP0RR. */ - kFRO12M_to_CMP0RR = MUX_A(CM_CMP0RRCLKSEL, 3), /*!< Attach FRO_12M to CMP0RR. */ - kCLK_IN_to_CMP0RR = MUX_A(CM_CMP0RRCLKSEL, 4), /*!< Attach Clk_in to CMP0RR. */ - kPLL1_CLK0_to_CMP0RR = MUX_A(CM_CMP0RRCLKSEL, 5), /*!< Attach PLL1_clk0 to CMP0RR. */ - kUSB_PLL_to_CMP0RR = MUX_A(CM_CMP0RRCLKSEL, 6), /*!< Attach USB PLL to CMP0RR. */ - kNONE_to_CMP0RR = MUX_A(CM_CMP0RRCLKSEL, 7), /*!< Attach NONE to CMP0RR. */ - - kPLL0_to_CMP1F = MUX_A(CM_CMP1FCLKSEL, 1), /*!< Attach PLL0 to CMP1F. */ - kFRO_HF_to_CMP1F = MUX_A(CM_CMP1FCLKSEL, 2), /*!< Attach FRO_HF to CMP1F. */ - kFRO12M_to_CMP1F = MUX_A(CM_CMP1FCLKSEL, 3), /*!< Attach FRO_12M to CMP1F. */ - kCLK_IN_to_CMP1F = MUX_A(CM_CMP1FCLKSEL, 4), /*!< Attach Clk_in to CMP1F. */ - kPLL1_CLK0_to_CMP1F = MUX_A(CM_CMP1FCLKSEL, 5), /*!< Attach PLL1_clk0 to CMP1F. */ - kUSB_PLL_to_CMP1F = MUX_A(CM_CMP1FCLKSEL, 6), /*!< Attach USB PLL to CMP1F. */ - kNONE_to_CMP1F = MUX_A(CM_CMP1FCLKSEL, 7), /*!< Attach NONE to CMP1F. */ - - kPLL0_to_CMP1RR = MUX_A(CM_CMP1RRCLKSEL, 1), /*!< Attach PLL0 to CMP1RR. */ - kFRO_HF_to_CMP1RR = MUX_A(CM_CMP1RRCLKSEL, 2), /*!< Attach FRO_HF to CMP1RR. */ - kFRO12M_to_CMP1RR = MUX_A(CM_CMP1RRCLKSEL, 3), /*!< Attach FRO_12M to CMP1RR. */ - kCLK_IN_to_CMP1RR = MUX_A(CM_CMP1RRCLKSEL, 4), /*!< Attach Clk_in to CMP1RR. */ - kPLL1_CLK0_to_CMP1RR = MUX_A(CM_CMP1RRCLKSEL, 5), /*!< Attach PLL1_clk0 to CMP1RR. */ - kUSB_PLL_to_CMP1RR = MUX_A(CM_CMP1RRCLKSEL, 6), /*!< Attach USB PLL to CMP1RR. */ - kNONE_to_CMP1RR = MUX_A(CM_CMP1RRCLKSEL, 7), /*!< Attach NONE to CMP1RR. */ - - kCLK_IN_to_UTICK = MUX_A(CM_UTICKCLKSEL, 0), /*!< Attach Clk_in to UTICK. */ - kXTAL32K2_to_UTICK = MUX_A(CM_UTICKCLKSEL, 1), /*!< Attach xtal32k[2] to UTICK. */ - kCLK_1M_to_UTICK = MUX_A(CM_UTICKCLKSEL, 2), /*!< Attach clk_1m to UTICK. */ - kNONE_to_UTICK = MUX_A(CM_UTICKCLKSEL, 3), /*!< Attach NONE to UTICK. */ - - kPLL0_to_SAI0 = MUX_A(CM_SAI0CLKSEL, 1), /*!< Attach PLL0 to SAI0. */ - kCLK_IN_to_SAI0 = MUX_A(CM_SAI0CLKSEL, 2), /*!< Attach Clk_in to SAI0. */ - kFRO_HF_to_SAI0 = MUX_A(CM_SAI0CLKSEL, 3), /*!< Attach FRO_HF to SAI0. */ - kPLL1_CLK0_to_SAI0 = MUX_A(CM_SAI0CLKSEL, 4), /*!< Attach PLL1_clk0 to SAI0. */ - kUSB_PLL_to_SAI0 = MUX_A(CM_SAI0CLKSEL, 6), /*!< Attach USB PLL to SAI0. */ - kNONE_to_SAI0 = MUX_A(CM_SAI0CLKSEL, 7), /*!< Attach NONE to SAI0. */ - - kPLL0_to_SAI1 = MUX_A(CM_SAI1CLKSEL, 1), /*!< Attach PLL0 to SAI1. */ - kCLK_IN_to_SAI1 = MUX_A(CM_SAI1CLKSEL, 2), /*!< Attach Clk_in to SAI1. */ - kFRO_HF_to_SAI1 = MUX_A(CM_SAI1CLKSEL, 3), /*!< Attach FRO_HF to SAI1. */ - kPLL1_CLK0_to_SAI1 = MUX_A(CM_SAI1CLKSEL, 4), /*!< Attach PLL1_clk0 to SAI1. */ - kUSB_PLL_to_SAI1 = MUX_A(CM_SAI1CLKSEL, 6), /*!< Attach USB PLL to SAI1. */ - kNONE_to_SAI1 = MUX_A(CM_SAI1CLKSEL, 7), /*!< Attach NONE to SAI1. */ - - kPLL0_to_I3C1FCLK = MUX_A(CM_I3C1FCLKSEL, 1), /*!< Attach PLL0 to I3C1FCLK. */ - kFRO_HF_to_I3C1FCLK = MUX_A(CM_I3C1FCLKSEL, 3), /*!< Attach FRO_HF to I3C1FCLK. */ - kCLK_1M_to_I3C1FCLK = MUX_A(CM_I3C1FCLKSEL, 4), /*!< Attach CLK_1M to I3C1FCLK. */ - kPLL1_CLK0_to_I3C1FCLK = MUX_A(CM_I3C1FCLKSEL, 5), /*!< Attach PLL1_clk0 to I3C1FCLK. */ - kUSB_PLL_to_I3C1FCLK = MUX_A(CM_I3C1FCLKSEL, 6), /*!< Attach USB PLL to I3C1FCLK. */ - kNONE_to_I3C1FCLK = MUX_A(CM_I3C1FCLKSEL, 7), /*!< Attach NONE to I3C1FCLK. */ - - kPLL0_to_I3C1FCLKSTC = MUX_A(CM_I3C1FCLKSEL, 1), /*!< Attach PLL0 to I3C1FCLKSTC. */ - kFRO_HF_to_I3C1FCLKSTC = MUX_A(CM_I3C1FCLKSEL, 3), /*!< Attach FRO_HF to I3C1FCLKSTC. */ - kCLK_1M_to_I3C1FCLKSTC = MUX_A(CM_I3C1FCLKSEL, 4), /*!< Attach CLK_1M to I3C1FCLKSTC. */ - kPLL1_CLK0_to_I3C1FCLKSTC = MUX_A(CM_I3C1FCLKSEL, 5), /*!< Attach PLL1_clk0 to I3C1FCLKSTC. */ - kUSB_PLL_to_I3C1FCLKSTC = MUX_A(CM_I3C1FCLKSEL, 6), /*!< Attach USB PLL to I3C1FCLKSTC. */ - kNONE_to_I3C1FCLKSTC = MUX_A(CM_I3C1FCLKSEL, 7), /*!< Attach NONE to I3C1FCLKSTC. */ - - kPLL0_to_I3C1FCLKSlow = MUX_A(CM_I3C1FCLKSEL, 1), /*!< Attach PLL0 to I3C1FCLKS. */ - kFRO_HF_to_I3C1FCLKSlow = MUX_A(CM_I3C1FCLKSEL, 3), /*!< Attach FRO_HF to I3C1FCLKS. */ - kCLK_1M_to_I3C1FCLKSlow = MUX_A(CM_I3C1FCLKSEL, 4), /*!< Attach CLK_1M to I3C1FCLKS. */ - kPLL1_CLK0_to_I3C1FCLKSlow = MUX_A(CM_I3C1FCLKSEL, 5), /*!< Attach PLL1_clk0 to I3C1FCLKS. */ - kUSB_PLL_to_I3C1FCLKSlow = MUX_A(CM_I3C1FCLKSEL, 6), /*!< Attach USB PLL to I3C1FCLKS. */ - kNONE_to_I3C1FCLKSlow = MUX_A(CM_I3C1FCLKSEL, 7), /*!< Attach NONE to I3C1FCLKS. */ - - kNONE_to_NONE = (int)0x80000000U, /*!< Attach NONE to NONE. */ - -} clock_attach_id_t; - -/*! @brief Clock dividers */ -typedef enum _clock_div_name -{ - kCLOCK_DivSystickClk0 = 0, /*!< Systick Clk0 Divider. */ - kCLOCK_DivTraceClk = ((0x308 - 0x300) / 4), /*!< Trace Clk Divider. */ - kCLOCK_DivSlowClk = ((0x378 - 0x300) / 4), /*!< SLOW CLK Divider. */ - kCLOCK_DivAhbClk = ((0x380 - 0x300) / 4), /*!< Ahb Clk Divider. */ - kCLOCK_DivClkOut = ((0x384 - 0x300) / 4), /*!< ClkOut Clk Divider. */ - kCLOCK_DivFrohfClk = ((0x388 - 0x300) / 4), /*!< Frohf Clk Divider. */ - kCLOCK_DivWdt0Clk = ((0x38C - 0x300) / 4), /*!< Wdt0 Clk Divider. */ - kCLOCK_DivAdc0Clk = ((0x394 - 0x300) / 4), /*!< Adc0 Clk Divider. */ - kCLOCK_DivPllClk = ((0x3C4 - 0x300) / 4), /*!< Pll Clk Divider. */ - kCLOCK_DivCtimer0Clk = ((0x3D0 - 0x300) / 4), /*!< Ctimer0 Clk Divider. */ - kCLOCK_DivCtimer1Clk = ((0x3D4 - 0x300) / 4), /*!< Ctimer1 Clk Divider. */ - kCLOCK_DivCtimer2Clk = ((0x3D8 - 0x300) / 4), /*!< Ctimer2 Clk Divider. */ - kCLOCK_DivCtimer3Clk = ((0x3DC - 0x300) / 4), /*!< Ctimer3 Clk Divider. */ - kCLOCK_DivCtimer4Clk = ((0x3E0 - 0x300) / 4), /*!< Ctimer4 Clk Divider. */ - kCLOCK_DivPLL1Clk0 = ((0x3E4 - 0x300) / 4), /*!< PLL1 Clk0 Divider. */ - kCLOCK_DivPLL1Clk1 = ((0x3E8 - 0x300) / 4), /*!< Pll1 Clk1 Divider. */ - kCLOCK_DivUtickClk = ((0x3F0 - 0x300) / 4), /*!< Utick Clk Divider. */ - kCLOCK_DivFrg = ((0x3F4 - 0x300) / 4), /*!< CLKOUT FRG Clk Divider. */ - kCLOCK_DivAdc1Clk = ((0x468 - 0x300) / 4), /*!< Adc1 Clk Divider. */ - kCLOCK_DivI3c0FClk = ((0x540 - 0x300) / 4), /*!< I3C0 FClk Divider. */ - kCLOCK_DivMicfilFClk = ((0x54C - 0x300) / 4), /*!< MICFILFCLK Divider. */ - kCLOCK_DivFlexioClk = ((0x564 - 0x300) / 4), /*!< Flexio Clk Divider. */ - kCLOCK_DivFlexcan0Clk = ((0x5A4 - 0x300) / 4), /*!< Flexcan0 Clk Divider. */ - kCLOCK_DivFlexcan1Clk = ((0x5AC - 0x300) / 4), /*!< Flexcan1 Clk Divider. */ - kCLOCK_DivWdt1Clk = ((0x5DC - 0x300) / 4), /*!< Wdt1 Clk Divider. */ - kCLOCK_DivCmp0FClk = ((0x5F4 - 0x300) / 4), /*!< Cmp0 FClk Divider. */ - kCLOCK_DivCmp0rrClk = ((0x5FC - 0x300) / 4), /*!< Cmp0rr Clk Divider. */ - kCLOCK_DivCmp1FClk = ((0x604 - 0x300) / 4), /*!< Cmp1 FClk Divider. */ - kCLOCK_DivCmp1rrClk = ((0x60C - 0x300) / 4), /*!< Cmp1rr Clk Divider. */ - kCLOCK_DivFlexcom0Clk = ((0x850 - 0x300) / 4), /*!< Flexcom0 Clk Divider. */ - kCLOCK_DivFlexcom1Clk = ((0x854 - 0x300) / 4), /*!< Flexcom1 Clk Divider. */ - kCLOCK_DivFlexcom2Clk = ((0x858 - 0x300) / 4), /*!< Flexcom2 Clk Divider. */ - kCLOCK_DivFlexcom3Clk = ((0x85C - 0x300) / 4), /*!< Flexcom3 Clk Divider. */ - kCLOCK_DivFlexcom4Clk = ((0x860 - 0x300) / 4), /*!< Flexcom4 Clk Divider. */ - kCLOCK_DivFlexcom5Clk = ((0x864 - 0x300) / 4), /*!< Flexcom5 Clk Divider. */ - kCLOCK_DivFlexcom6Clk = ((0x868 - 0x300) / 4), /*!< Flexcom6 Clk Divider. */ - kCLOCK_DivFlexcom7Clk = ((0x86C - 0x300) / 4), /*!< Flexcom7 Clk Divider. */ - kCLOCK_DivSai0Clk = ((0x888 - 0x300) / 4), /*!< Sai0 Clk Divider. */ - kCLOCK_DivSai1Clk = ((0x88C - 0x300) / 4), /*!< Sai1 Clk Divider. */ - kCLOCK_DivI3c1FClk = ((0xB40 - 0x300) / 4), /*!< I3C1 FClk Divider. */ -} clock_div_name_t; - -/*! @brief OSC32K clock gate */ -typedef enum _osc32k_clk_gate_id -{ - kCLOCK_Osc32kToVbat = 0x1, /*!< OSC32K[0] to VBAT domain. */ - kCLOCK_Osc32kToVsys = 0x2, /*!< OSC32K[1] to VSYS domain. */ - kCLOCK_Osc32kToWake = 0x4, /*!< OSC32K[2] to WAKE domain. */ - kCLOCK_Osc32kToMain = 0x8, /*!< OSC32K[3] to MAIN domain. */ - kCLOCK_Osc32kToAll = 0xF, /*!< OSC32K to VBAT,VSYS,WAKE,MAIN domain. */ -} osc32k_clk_gate_id_t; - -/*! @brief CLK16K clock gate */ -typedef enum _clk16k_clk_gate_id -{ - kCLOCK_Clk16KToVbat = 0x1, /*!< Clk16k[0] to VBAT domain. */ - kCLOCK_Clk16KToVsys = 0x2, /*!< Clk16k[1] to VSYS domain. */ - kCLOCK_Clk16KToWake = 0x4, /*!< Clk16k[2] to WAKE domain. */ - kCLOCK_Clk16KToMain = 0x8, /*!< Clk16k[3] to MAIN domain. */ - kCLOCK_Clk16KToAll = 0xF, /*!< Clk16k to VBAT,VSYS,WAKE,MAIN domain. */ -} clk16k_clk_gate_id_t; - -/*! @brief system clocks enable controls */ -typedef enum _clock_ctrl_enable -{ - kCLOCK_FRO1MHZ_CLK_ENA = - SYSCON_CLOCK_CTRL_FRO1MHZ_CLK_ENA_MASK, /*!< Enables FRO_1MHz clock for clock muxing in clock gen. */ - kCLOCK_CLKIN_ENA = SYSCON_CLOCK_CTRL_CLKIN_ENA_MASK, /*!< Enables clk_in clock for MICD, EMVSIM0/1, CAN0/1, I3C0/1, - SAI0/1, clkout */ - kCLOCK_FRO_HF_ENA = - SYSCON_CLOCK_CTRL_FRO_HF_ENA_MASK, /*!< Enables FRO HF clock for the Frequency Measure module. */ - kCLOCK_FRO12MHZ_ENA = SYSCON_CLOCK_CTRL_FRO12MHZ_ENA_MASK, /*!< Enables the FRO_12MHz clock for the Flash, - LPTIMER0/1, and Frequency Measurement modules. */ - kCLOCK_FRO1MHZ_ENA = - SYSCON_CLOCK_CTRL_FRO1MHZ_ENA_MASK, /*!< Enables the FRO_1MHz clock for RTC module and for UTICK. */ - kCLOCK_CLKIN_ENA_FM_USBH_LPT = - SYSCON_CLOCK_CTRL_CLKIN_ENA_FM_USBH_LPT_MASK, /*!< Enables the clk_in clock for the Frequency Measurement, USB - HS and LPTIMER0/1 modules. */ -} clock_ctrl_enable_t; - -/*! @brief Source of the USB HS PHY. */ -typedef enum _clock_usb_phy_src -{ - kCLOCK_Usbphy480M = 0, /*!< Use 480M. */ -} clock_usb_phy_src_t; - -/*! - * @brief SCG status return codes. - */ -enum _scg_status -{ - kStatus_SCG_Busy = MAKE_STATUS(kStatusGroup_SCG, 1), /*!< Clock is busy. */ - kStatus_SCG_InvalidSrc = MAKE_STATUS(kStatusGroup_SCG, 2) /*!< Invalid source. */ -}; - -/*! - * @brief firc trim mode. - */ -typedef enum _firc_trim_mode -{ - kSCG_FircTrimNonUpdate = SCG_FIRCCSR_FIRCTREN_MASK, - /*!< Trim enable but not enable trim value update. In this mode, the - trim value is fixed to the initialized value which is defined by - trimCoar and trimFine in configure structure \ref trim_config_t.*/ - - kSCG_FircTrimUpdate = SCG_FIRCCSR_FIRCTREN_MASK | SCG_FIRCCSR_FIRCTRUP_MASK - /*!< Trim enable and trim value update enable. In this mode, the trim - value is auto update. */ - -} firc_trim_mode_t; - -/*! - * @brief firc trim source. - */ -typedef enum _firc_trim_src -{ - kSCG_FircTrimSrcUsb0 = 0U, /*!< USB0 start of frame (1kHz). */ - kSCG_FircTrimSrcSysOsc = 2U, /*!< System OSC. */ - kSCG_FircTrimSrcRtcOsc = 3U, /*!< RTC OSC (32.768 kHz). */ -} firc_trim_src_t; - -/*! - * @brief firc trim configuration. - */ -typedef struct _firc_trim_config -{ - firc_trim_mode_t trimMode; /*!< Trim mode. */ - firc_trim_src_t trimSrc; /*!< Trim source. */ - uint16_t trimDiv; /*!< Divider of SOSC. */ - - uint8_t trimCoar; /*!< Trim coarse value; Irrelevant if trimMode is kSCG_TrimUpdate. */ - uint8_t trimFine; /*!< Trim fine value; Irrelevant if trimMode is kSCG_TrimUpdate. */ -} firc_trim_config_t; - -/*! - * @brief sirc trim mode. - */ -typedef enum _sirc_trim_mode -{ - kSCG_SircTrimNonUpdate = SCG_SIRCCSR_SIRCTREN_MASK, - /*!< Trim enable but not enable trim value update. In this mode, the - trim value is fixed to the initialized value which is defined by - trimCoar and trimFine in configure structure \ref trim_config_t.*/ - - kSCG_SircTrimUpdate = SCG_SIRCCSR_SIRCTREN_MASK | SCG_SIRCCSR_SIRCTRUP_MASK - /*!< Trim enable and trim value update enable. In this mode, the trim - value is auto update. */ - -} sirc_trim_mode_t; - -/*! - * @brief sirc trim source. - */ -typedef enum _sirc_trim_src -{ - kSCG_SircTrimSrcSysOsc = 2U, /*!< System OSC. */ - kSCG_SircTrimSrcRtcOsc = 3U, /*!< RTC OSC (32.768 kHz). */ -} sirc_trim_src_t; - -/*! - * @brief sirc trim configuration. - */ -typedef struct _sirc_trim_config -{ - sirc_trim_mode_t trimMode; /*!< Trim mode. */ - sirc_trim_src_t trimSrc; /*!< Trim source. */ - uint16_t trimDiv; /*!< Divider of SOSC. */ - - uint8_t cltrim; /*!< Trim coarse value; Irrelevant if trimMode is kSCG_TrimUpdate. */ - uint8_t ccotrim; /*!< Trim fine value; Irrelevant if trimMode is kSCG_TrimUpdate. */ -} sirc_trim_config_t; - -/*! - * @brief SCG system OSC monitor mode. - */ -typedef enum _scg_sosc_monitor_mode -{ - kSCG_SysOscMonitorDisable = 0U, /*!< Monitor disabled. */ - kSCG_SysOscMonitorInt = SCG_SOSCCSR_SOSCCM_MASK, /*!< Interrupt when the SOSC error is detected. */ - kSCG_SysOscMonitorReset = - SCG_SOSCCSR_SOSCCM_MASK | SCG_SOSCCSR_SOSCCMRE_MASK /*!< Reset when the SOSC error is detected. */ -} scg_sosc_monitor_mode_t; - -/*! - * @brief SCG ROSC monitor mode. - */ -typedef enum _scg_rosc_monitor_mode -{ - kSCG_RoscMonitorDisable = 0U, /*!< Monitor disabled. */ - kSCG_RoscMonitorInt = SCG_ROSCCSR_ROSCCM_MASK, /*!< Interrupt when the RTC OSC error is detected. */ - kSCG_RoscMonitorReset = - SCG_ROSCCSR_ROSCCM_MASK | SCG_ROSCCSR_ROSCCMRE_MASK /*!< Reset when the RTC OSC error is detected. */ -} scg_rosc_monitor_mode_t; - -/*! - * @brief SCG UPLL monitor mode. - */ -typedef enum _scg_upll_monitor_mode -{ - kSCG_UpllMonitorDisable = 0U, /*!< Monitor disabled. */ - kSCG_UpllMonitorInt = SCG_UPLLCSR_UPLLCM_MASK, /*!< Interrupt when the UPLL error is detected. */ - kSCG_UpllMonitorReset = - SCG_UPLLCSR_UPLLCM_MASK | SCG_UPLLCSR_UPLLCMRE_MASK /*!< Reset when the UPLL error is detected. */ -} scg_upll_monitor_mode_t; - -/*! - * @brief SCG PLL0 monitor mode. - */ -typedef enum _scg_pll0_monitor_mode -{ - kSCG_Pll0MonitorDisable = 0U, /*!< Monitor disabled. */ - kSCG_Pll0MonitorInt = SCG_APLLCSR_APLLCM_MASK, /*!< Interrupt when the PLL0 Clock error is detected. */ - kSCG_Pll0MonitorReset = - SCG_APLLCSR_APLLCM_MASK | SCG_APLLCSR_APLLCMRE_MASK /*!< Reset when the PLL0 Clock error is detected. */ -} scg_pll0_monitor_mode_t; - -/*! - * @brief SCG PLL1 monitor mode. - */ -typedef enum _scg_pll1_monitor_mode -{ - kSCG_Pll1MonitorDisable = 0U, /*!< Monitor disabled. */ - kSCG_Pll1MonitorInt = SCG_SPLLCSR_SPLLCM_MASK, /*!< Interrupt when the PLL1 Clock error is detected. */ - kSCG_Pll1MonitorReset = - SCG_SPLLCSR_SPLLCM_MASK | SCG_SPLLCSR_SPLLCMRE_MASK /*!< Reset when the PLL1 Clock error is detected. */ -} scg_pll1_monitor_mode_t; - -/*! - * @brief The enumerator of internal capacitance of OSC's XTAL pin. - */ -typedef enum _vbat_osc_xtal_cap -{ - kVBAT_OscXtal0pFCap = 0x0U, /*!< The internal capacitance for XTAL pin is 0pF. */ - kVBAT_OscXtal2pFCap = 0x1U, /*!< The internal capacitance for XTAL pin is 2pF. */ - kVBAT_OscXtal4pFCap = 0x2U, /*!< The internal capacitance for XTAL pin is 4pF. */ - kVBAT_OscXtal6pFCap = 0x3U, /*!< The internal capacitance for XTAL pin is 6pF. */ - kVBAT_OscXtal8pFCap = 0x4U, /*!< The internal capacitance for XTAL pin is 8pF. */ - kVBAT_OscXtal10pFCap = 0x5U, /*!< The internal capacitance for XTAL pin is 10pF. */ - kVBAT_OscXtal12pFCap = 0x6U, /*!< The internal capacitance for XTAL pin is 12pF. */ - kVBAT_OscXtal14pFCap = 0x7U, /*!< The internal capacitance for XTAL pin is 14pF. */ - kVBAT_OscXtal16pFCap = 0x8U, /*!< The internal capacitance for XTAL pin is 16pF. */ - kVBAT_OscXtal18pFCap = 0x9U, /*!< The internal capacitance for XTAL pin is 18pF. */ - kVBAT_OscXtal20pFCap = 0xAU, /*!< The internal capacitance for XTAL pin is 20pF. */ - kVBAT_OscXtal22pFCap = 0xBU, /*!< The internal capacitance for XTAL pin is 22pF. */ - kVBAT_OscXtal24pFCap = 0xCU, /*!< The internal capacitance for XTAL pin is 24pF. */ - kVBAT_OscXtal26pFCap = 0xDU, /*!< The internal capacitance for XTAL pin is 26pF. */ - kVBAT_OscXtal28pFCap = 0xEU, /*!< The internal capacitance for XTAL pin is 28pF. */ - kVBAT_OscXtal30pFCap = 0xFU, /*!< The internal capacitance for XTAL pin is 30pF. */ -} vbat_osc_xtal_cap_t; - -/*! - * @brief The enumerator of internal capacitance of OSC's EXTAL pin. - */ -typedef enum _vbat_osc_extal_cap -{ - kVBAT_OscExtal0pFCap = 0x0U, /*!< The internal capacitance for EXTAL pin is 0pF. */ - kVBAT_OscExtal2pFCap = 0x1U, /*!< The internal capacitance for EXTAL pin is 2pF. */ - kVBAT_OscExtal4pFCap = 0x2U, /*!< The internal capacitance for EXTAL pin is 4pF. */ - kVBAT_OscExtal6pFCap = 0x3U, /*!< The internal capacitance for EXTAL pin is 6pF. */ - kVBAT_OscExtal8pFCap = 0x4U, /*!< The internal capacitance for EXTAL pin is 8pF. */ - kVBAT_OscExtal10pFCap = 0x5U, /*!< The internal capacitance for EXTAL pin is 10pF. */ - kVBAT_OscExtal12pFCap = 0x6U, /*!< The internal capacitance for EXTAL pin is 12pF. */ - kVBAT_OscExtal14pFCap = 0x7U, /*!< The internal capacitance for EXTAL pin is 14pF. */ - kVBAT_OscExtal16pFCap = 0x8U, /*!< The internal capacitance for EXTAL pin is 16pF. */ - kVBAT_OscExtal18pFCap = 0x9U, /*!< The internal capacitance for EXTAL pin is 18pF. */ - kVBAT_OscExtal20pFCap = 0xAU, /*!< The internal capacitance for EXTAL pin is 20pF. */ - kVBAT_OscExtal22pFCap = 0xBU, /*!< The internal capacitance for EXTAL pin is 22pF. */ - kVBAT_OscExtal24pFCap = 0xCU, /*!< The internal capacitance for EXTAL pin is 24pF. */ - kVBAT_OscExtal26pFCap = 0xDU, /*!< The internal capacitance for EXTAL pin is 26pF. */ - kVBAT_OscExtal28pFCap = 0xEU, /*!< The internal capacitance for EXTAL pin is 28pF. */ - kVBAT_OscExtal30pFCap = 0xFU, /*!< The internal capacitance for EXTAL pin is 30pF. */ -} vbat_osc_extal_cap_t; - -/*! - * @brief The enumerator of osc amplifier gain fine adjustment. - * Changes the oscillator amplitude by modifying the automatic gain control (AGC). - */ -typedef enum _vbat_osc_fine_adjustment_value -{ - kVBAT_OscCoarseAdjustment05 = 0U, - kVBAT_OscCoarseAdjustment10 = 1U, - kVBAT_OscCoarseAdjustment18 = 2U, - kVBAT_OscCoarseAdjustment33 = 3U, -} vbat_osc_coarse_adjustment_value_t; - -/*! - * @brief The structure of oscillator configuration. - */ -typedef struct _vbat_osc_config -{ - bool enableInternalCapBank; /*!< enable/disable the internal capacitance bank. */ - - bool enableCrystalOscillatorBypass; /*!< enable/disable the crystal oscillator bypass. */ - - vbat_osc_xtal_cap_t xtalCap; /*!< The internal capacitance for the OSC XTAL pin from the capacitor bank, - only useful when the internal capacitance bank is enabled. */ - vbat_osc_extal_cap_t extalCap; /*!< The internal capacitance for the OSC EXTAL pin from the capacitor bank, only - useful when the internal capacitance bank is enabled. */ - vbat_osc_coarse_adjustment_value_t - coarseAdjustment; /*!< 32kHz crystal oscillator amplifier coarse adjustment value. */ -} vbat_osc_config_t; - -/*! - * @brief The active run mode (voltage level). - */ -typedef enum _run_mode -{ - kMD_Mode, /*!< Midvoltage (1.0 V). */ - kSD_Mode, /*!< Normal voltage (1.1 V). */ - kOD_Mode, /*!< Overdrive voltage (1.2 V). */ -} run_mode_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/** - * @brief Enable the clock for specific IP. - * @param clk : Clock to be enabled. - * @return Nothing - */ -static inline void CLOCK_EnableClock(clock_ip_name_t clk) -{ - uint32_t index = CLK_GATE_ABSTRACT_REG_OFFSET(clk); - uint32_t bit = CLK_GATE_ABSTRACT_BITS_SHIFT(clk); - - if (clk == kCLOCK_None) - return; - - if (index == (uint32_t)REG_PWM0SUBCTL) - { - SYSCON->PWM0SUBCTL |= (1UL << bit); - SYSCON->AHBCLKCTRLSET[3] = 0x40U; - } - else if (index == (uint32_t)REG_PWM1SUBCTL) - { - SYSCON->PWM1SUBCTL |= (1UL << bit); - SYSCON->AHBCLKCTRLSET[3] = 0x80U; - } - else - { - SYSCON->AHBCLKCTRLSET[index] = (1UL << bit); - } -} - -/** - * @brief Disable the clock for specific IP. - * @param clk : Clock to be Disabled. - * @return Nothing - */ -static inline void CLOCK_DisableClock(clock_ip_name_t clk) -{ - uint32_t index = CLK_GATE_ABSTRACT_REG_OFFSET(clk); - uint32_t bit = CLK_GATE_ABSTRACT_BITS_SHIFT(clk); - - if (clk == kCLOCK_None) - return; - - if (index == (uint32_t)REG_PWM0SUBCTL) - { - SYSCON->PWM0SUBCTL &= ~(1UL << bit); - if (0U == (SYSCON->PWM0SUBCTL & 0xFU)) - { - SYSCON->AHBCLKCTRLCLR[3] = 0x20U; - } - } - else if (index == (uint32_t)REG_PWM1SUBCTL) - { - SYSCON->PWM1SUBCTL &= ~(1UL << bit); - if (0U == (SYSCON->PWM1SUBCTL & 0xFU)) - { - SYSCON->AHBCLKCTRLCLR[3] = 0x40U; - } - } - else - { - SYSCON->AHBCLKCTRLCLR[index] = (1UL << bit); - } -} - -/** - * @brief Initialize the Core clock to given frequency (48 or 144 MHz). - * This function turns on FIRC and select the given frequency as the source of fro_hf - * @param iFreq : Desired frequency (must be one of CLK_FRO_44MHZ or CLK_FRO_144MHZ) - * @return returns success or fail status. - */ -status_t CLOCK_SetupFROHFClocking(uint32_t iFreq); - -/** - * @brief Initialize the external osc clock to given frequency. - * @param iFreq : Desired frequency (must be equal to exact rate in Hz) - * @return returns success or fail status. - */ -status_t CLOCK_SetupExtClocking(uint32_t iFreq); - -/** - * @brief Initialize the external reference clock to given frequency. - * @param iFreq : Desired frequency (must be equal to exact rate in Hz) - * @return returns success or fail status. - */ -status_t CLOCK_SetupExtRefClocking(uint32_t iFreq); - -/** - * @brief Initialize the XTAL32/EXTAL32 input clock to given frequency. - * @param id : OSC 32 kHz output clock to specified modules, it should use osc32k_clk_gate_id_t value - * @return returns success or fail status. - */ -status_t CLOCK_SetupOsc32KClocking(uint32_t id); - -/** - * @brief Initialize the FRO16K input clock to given frequency. - * @param id : FRO 16 kHz output clock to specified modules, it should use clk16k_clk_gate_id_t value - * @return returns success or fail status. - */ -status_t CLOCK_SetupClk16KClocking(uint32_t id); - -/** - * @brief Setup FROHF trim. - * @param config : FROHF trim value - * @return returns success or fail status. - */ -status_t CLOCK_FROHFTrimConfig(firc_trim_config_t config); - -/** - * @brief Setup FRO 12M trim. - * @param config : FRO 12M trim value - * @return returns success or fail status. - */ -status_t CLOCK_FRO12MTrimConfig(sirc_trim_config_t config); - -/*! - * @brief Sets the system OSC monitor mode. - * - * This function sets the system OSC monitor mode. The mode can be disabled, - * it can generate an interrupt when the error is disabled, or reset when the error is detected. - * - * @param mode Monitor mode to set. - */ -void CLOCK_SetSysOscMonitorMode(scg_sosc_monitor_mode_t mode); - -/*! - * @brief Sets the ROSC monitor mode. - * - * This function sets the ROSC monitor mode. The mode can be disabled, - * it can generate an interrupt when the error is disabled, or reset when the error is detected. - * - * @param mode Monitor mode to set. - */ -void CLOCK_SetRoscMonitorMode(scg_rosc_monitor_mode_t mode); - -/*! - * @brief Sets the UPLL monitor mode. - * - * This function sets the UPLL monitor mode. The mode can be disabled, - * it can generate an interrupt when the error is disabled, or reset when the error is detected. - * - * @param mode Monitor mode to set. - */ -void CLOCK_SetUpllMonitorMode(scg_upll_monitor_mode_t mode); - -/*! - * @brief Sets the PLL0 monitor mode. - * - * This function sets the PLL0 monitor mode. The mode can be disabled, - * it can generate an interrupt when the error is disabled, or reset when the error is detected. - * - * @param mode Monitor mode to set. - */ -void CLOCK_SetPll0MonitorMode(scg_pll0_monitor_mode_t mode); - -/*! - * @brief Sets the PLL1 monitor mode. - * - * This function sets the PLL1 monitor mode. The mode can be disabled, - * it can generate an interrupt when the error is disabled, or reset when the error is detected. - * - * @param mode Monitor mode to set. - */ -void CLOCK_SetPll1MonitorMode(scg_pll1_monitor_mode_t mode); - -/*! - * @brief Config 32k Crystal Oscillator. - * - * @param base VBAT peripheral base address. - * @param config The pointer to the structure \ref vbat_osc_config_t. - */ -void VBAT_SetOscConfig(VBAT_Type *base, const vbat_osc_config_t *config); - -/*! - * @brief Set the additional number of wait-states added to account for the ratio of system clock period to flash access - * time during full speed power mode. - * @param system_freq_hz : Input frequency - * @param mode : Active run mode (voltage level). - * @return success or fail status - */ -status_t CLOCK_SetFLASHAccessCyclesForFreq(uint32_t system_freq_hz, run_mode_t mode); - -/** - * @brief Configure the clock selection muxes. - * @param connection : Clock to be configured. - * @return Nothing - */ -void CLOCK_AttachClk(clock_attach_id_t connection); - -/** - * @brief Get the actual clock attach id. - * This fuction uses the offset in input attach id, then it reads the actual source value in - * the register and combine the offset to obtain an actual attach id. - * @param attachId : Clock attach id to get. - * @return Clock source value. - */ -clock_attach_id_t CLOCK_GetClockAttachId(clock_attach_id_t attachId); - -/** - * @brief Setup peripheral clock dividers. - * @param div_name : Clock divider name - * @param divided_by_value: Value to be divided - * @return Nothing - */ -void CLOCK_SetClkDiv(clock_div_name_t div_name, uint32_t divided_by_value); - -/** - * @brief Get peripheral clock dividers. - * @param div_name : Clock divider name - * @return peripheral clock dividers - */ -uint32_t CLOCK_GetClkDiv(clock_div_name_t div_name); - -/** - * @brief Halt peripheral clock dividers. - * @param div_name : Clock divider name - * @return Nothing - */ -void CLOCK_HaltClkDiv(clock_div_name_t div_name); - -/** - * @brief system clocks enable controls. - * @param mask : system clocks enable value, it should use clock_ctrl_enable_t value - * @return Nothing - */ -void CLOCK_SetupClockCtrl(uint32_t mask); - -/*! @brief Return Frequency of selected clock - * @return Frequency of selected clock - */ -uint32_t CLOCK_GetFreq(clock_name_t clockName); - -/*! @brief Return Frequency of core - * @return Frequency of the core - */ -uint32_t CLOCK_GetCoreSysClkFreq(void); - -/*! @brief Return Frequency of CTimer functional Clock - * @return Frequency of CTimer functional Clock - */ -uint32_t CLOCK_GetCTimerClkFreq(uint32_t id); - -/*! @brief Return Frequency of Adc Clock - * @return Frequency of Adc. - */ -uint32_t CLOCK_GetAdcClkFreq(uint32_t id); - -/*! @brief Return Frequency of LPFlexComm Clock - * @return Frequency of LPFlexComm Clock - */ -uint32_t CLOCK_GetLPFlexCommClkFreq(uint32_t id); - -/*! @brief Return Frequency of PLL - * @return Frequency of PLL - */ -uint32_t CLOCK_GetPll0OutFreq(void); -/*! @brief Return Frequency of USB PLL - * @return Frequency of PLL - */ -uint32_t CLOCK_GetPll1OutFreq(void); - -/*! @brief Return Frequency of PLLCLKDIV - * @return Frequency of PLLCLKDIV Clock - */ -uint32_t CLOCK_GetPllClkDivFreq(void); - -/*! @brief Return Frequency of I3C function Clock - * @return Frequency of I3C function Clock - */ -uint32_t CLOCK_GetI3cClkFreq(uint32_t id); - -/*! @brief Return Frequency of MICFIL Clock - * @return Frequency of MICFIL. - */ -uint32_t CLOCK_GetMicfilClkFreq(void); - -/*! @brief Return Frequency of FLEXIO - * @return Frequency of FLEXIO Clock - */ -uint32_t CLOCK_GetFlexioClkFreq(void); - -/*! @brief Return Frequency of FLEXCAN - * @return Frequency of FLEXCAN Clock - */ -uint32_t CLOCK_GetFlexcanClkFreq(uint32_t id); - -/*! @brief Return Frequency of EWM0 Clock - * @return Frequency of EWM0. - */ -uint32_t CLOCK_GetEwm0ClkFreq(void); - -/*! @brief Return Frequency of Watchdog - * @return Frequency of Watchdog - */ -uint32_t CLOCK_GetWdtClkFreq(uint32_t id); - -/*! @brief Return Frequency of OSTIMER - * @return Frequency of OSTIMER Clock - */ -uint32_t CLOCK_GetOstimerClkFreq(void); - -/*! @brief Return Frequency of CMP Function Clock - * @return Frequency of CMP Function. - */ -uint32_t CLOCK_GetCmpFClkFreq(uint32_t id); - -/*! @brief Return Frequency of CMP Round Robin Clock - * @return Frequency of CMP Round Robin. - */ -uint32_t CLOCK_GetCmpRRClkFreq(uint32_t id); - -/*! @brief Return Frequency of UTICK Clock - * @return Frequency of UTICK Clock. - */ -uint32_t CLOCK_GetUtickClkFreq(void); - -/*! @brief Return Frequency of SAI Clock - * @return Frequency of SAI Clock. - */ -uint32_t CLOCK_GetSaiClkFreq(uint32_t id); - -/** - * @brief Initialize the SAI MCLK to given frequency. - * @param iFreq : Desired frequency - * @return Nothing - */ -void CLOCK_SetupSaiMclk(uint32_t id, uint32_t iFreq); - -/** - * @brief Initialize the SAI TX BCLK to given frequency. - * @param iFreq : Desired frequency - * @return Nothing - */ -void CLOCK_SetupSaiTxBclk(uint32_t id, uint32_t iFreq); - -/** - * @brief Initialize the SAI RX BCLK to given frequency. - * @param iFreq : Desired frequency - * @return Nothing - */ -void CLOCK_SetupSaiRxBclk(uint32_t id, uint32_t iFreq); - -/** - * @brief Return Frequency of SAI MCLK - * @return Frequency of SAI MCLK - */ -uint32_t CLOCK_GetSaiMclkFreq(uint32_t id); - -/** - * @brief Return Frequency of SAI TX BCLK - * @return Frequency of SAI TX BCLK - */ -uint32_t CLOCK_GetSaiTxBclkFreq(uint32_t id); - -/** - * @brief Return Frequency of SAI RX BCLK - * @return Frequency of SAI RX BCLK - */ -uint32_t CLOCK_GetSaiRxBclkFreq(uint32_t id); - -/*! @brief Return PLL0 input clock rate - * @return PLL0 input clock rate - */ -uint32_t CLOCK_GetPLL0InClockRate(void); - -/*! @brief Return PLL1 input clock rate - * @return PLL1 input clock rate - */ -uint32_t CLOCK_GetPLL1InClockRate(void); - -/*! @brief Gets the external UPLL frequency. - * @return The frequency of the external UPLL. - */ -uint32_t CLOCK_GetExtUpllFreq(void); - -/*! @brief Sets the external UPLL frequency. - * @param The frequency of external UPLL. - */ -void CLOCK_SetExtUpllFreq(uint32_t freq); - -/*! @brief Check if PLL is locked or not - * @return true if the PLL is locked, false if not locked - */ -__STATIC_INLINE bool CLOCK_IsPLL0Locked(void) -{ - return (bool)((SCG0->APLLCSR & SCG_APLLCSR_APLL_LOCK_MASK) != 0UL); -} - -/*! @brief Check if PLL1 is locked or not - * @return true if the PLL1 is locked, false if not locked - */ -__STATIC_INLINE bool CLOCK_IsPLL1Locked(void) -{ - return (bool)((SCG0->SPLLCSR & SCG_SPLLCSR_SPLL_LOCK_MASK) != 0UL); -} - -/*! @brief PLL configuration structure flags for 'flags' field - * These flags control how the PLL configuration function sets up the PLL setup structure.
- * - * When the PLL_CONFIGFLAG_FORCENOFRACT flag is selected, the PLL hardware for the - * automatic bandwidth selection, Spread Spectrum (SS) support, and fractional M-divider - * are not used.
- */ -#define PLL_CONFIGFLAG_FORCENOFRACT (1U << 2U) -/*!< Force non-fractional output mode, PLL output will not use the fractional, automatic bandwidth, or SS hardware */ - -/*! - * @brief PLL clock source. - */ -typedef enum _pll_clk_src -{ - kPll_ClkSrcSysOsc = (0 << 25), /*!< System OSC. */ - kPll_ClkSrcFirc = (1 << 25), /*!< Fast IRC. */ - kPll_ClkSrcRosc = (2 << 25), /*!< RTC OSC. */ -} pll_clk_src_t; - -/*! @brief PLL Spread Spectrum (SS) Programmable modulation frequency - * See (MF) field in the PLL0SSCG1 register in the UM. - */ -typedef enum _ss_progmodfm -{ - kSS_MF_512 = (0 << 2), /*!< Nss = 512 (fm ~= 3.9 - 7.8 kHz) */ - kSS_MF_384 = (1 << 2), /*!< Nss ~= 384 (fm ~= 5.2 - 10.4 kHz) */ - kSS_MF_256 = (2 << 2), /*!< Nss = 256 (fm ~= 7.8 - 15.6 kHz) */ - kSS_MF_128 = (3 << 2), /*!< Nss = 128 (fm ~= 15.6 - 31.3 kHz) */ - kSS_MF_64 = (4 << 2), /*!< Nss = 64 (fm ~= 32.3 - 64.5 kHz) */ - kSS_MF_32 = (5 << 2), /*!< Nss = 32 (fm ~= 62.5 - 125 kHz) */ - kSS_MF_24 = (6 << 2), /*!< Nss ~= 24 (fm ~= 83.3 - 166.6 kHz) */ - kSS_MF_16 = (7 << 2) /*!< Nss = 16 (fm ~= 125 - 250 kHz) */ -} ss_progmodfm_t; - -/*! @brief PLL Spread Spectrum (SS) Programmable frequency modulation depth - * See (MR) field in the PLL0SSCG1 register in the UM. - */ -typedef enum _ss_progmoddp -{ - kSS_MR_K0 = (0 << 5), /*!< k = 0 (no spread spectrum) */ - kSS_MR_K1 = (1 << 5), /*!< k ~= 1 */ - kSS_MR_K1_5 = (2 << 5), /*!< k ~= 1.5 */ - kSS_MR_K2 = (3 << 5), /*!< k ~= 2 */ - kSS_MR_K3 = (4 << 5), /*!< k ~= 3 */ - kSS_MR_K4 = (5 << 5), /*!< k ~= 4 */ - kSS_MR_K6 = (6 << 5), /*!< k ~= 6 */ - kSS_MR_K8 = (7 << 5) /*!< k ~= 8 */ -} ss_progmoddp_t; - -/*! @brief PLL Spread Spectrum (SS) Modulation waveform control - * See (MC) field in the PLL0SSCG1 register in the UM.
- * Compensation for low pass filtering of the PLL to get a triangular - * modulation at the output of the PLL, giving a flat frequency spectrum. - */ -typedef enum _ss_modwvctrl -{ - kSS_MC_NOC = (0 << 8), /*!< no compensation */ - kSS_MC_RECC = (2 << 8), /*!< recommended setting */ - kSS_MC_MAXC = (3 << 8), /*!< max. compensation */ -} ss_modwvctrl_t; - -/*! @brief PLL configuration structure - * - * This structure can be used to configure the settings for a PLL - * setup structure. Fill in the desired configuration for the PLL - * and call the PLL setup function to fill in a PLL setup structure. - */ -typedef struct _pll_config -{ - uint32_t desiredRate; /*!< Desired PLL rate in Hz */ - uint32_t inputSource; /*!< PLL input source */ - uint32_t flags; /*!< PLL configuration flags, Or'ed value of PLL_CONFIGFLAG_* definitions */ - ss_progmodfm_t ss_mf; /*!< SS Programmable modulation frequency, only applicable when not using - PLL_CONFIGFLAG_FORCENOFRACT flag */ - ss_progmoddp_t ss_mr; /*!< SS Programmable frequency modulation depth, only applicable when not using - PLL_CONFIGFLAG_FORCENOFRACT flag */ - ss_modwvctrl_t - ss_mc; /*!< SS Modulation waveform control, only applicable when not using PLL_CONFIGFLAG_FORCENOFRACT flag - */ - bool mfDither; /*!< false for fixed modulation frequency or true for dithering, only applicable when not using - PLL_CONFIGFLAG_FORCENOFRACT flag */ - -} pll_config_t; - -/*! @brief PLL0 setup structure - * This structure can be used to pre-build a PLL setup configuration - * at run-time and quickly set the PLL to the configuration. It can be - * populated with the PLL setup function. If powering up or waiting - * for PLL lock, the PLL input clock source should be configured prior - * to PLL setup. - */ -typedef struct _pll_setup -{ - uint32_t pllctrl; /*!< PLL Control register APLLCTRL */ - uint32_t pllndiv; /*!< PLL N Divider register APLLNDIV */ - uint32_t pllpdiv; /*!< PLL P Divider register APLLPDIV */ - uint32_t pllmdiv; /*!< PLL M Divider register APLLMDIV */ - uint32_t pllsscg[2]; /*!< PLL Spread Spectrum Control registers APLLSSCG*/ - uint32_t pllRate; /*!< Acutal PLL rate */ -} pll_setup_t; - -/*! @brief PLL status definitions - */ -typedef enum _pll_error -{ - kStatus_PLL_Success = MAKE_STATUS(kStatusGroup_Generic, 0), /*!< PLL operation was successful */ - kStatus_PLL_OutputTooLow = MAKE_STATUS(kStatusGroup_Generic, 1), /*!< PLL output rate request was too low */ - kStatus_PLL_OutputTooHigh = MAKE_STATUS(kStatusGroup_Generic, 2), /*!< PLL output rate request was too high */ - kStatus_PLL_OutputError = MAKE_STATUS(kStatusGroup_Generic, 3), /*!< PLL output rate error */ - kStatus_PLL_InputTooLow = MAKE_STATUS(kStatusGroup_Generic, 4), /*!< PLL input rate is too low */ - kStatus_PLL_InputTooHigh = MAKE_STATUS(kStatusGroup_Generic, 5), /*!< PLL input rate is too high */ - kStatus_PLL_OutsideIntLimit = MAKE_STATUS(kStatusGroup_Generic, 6), /*!< Requested output rate isn't possible */ - kStatus_PLL_CCOTooLow = MAKE_STATUS(kStatusGroup_Generic, 7), /*!< Requested CCO rate isn't possible */ - kStatus_PLL_CCOTooHigh = MAKE_STATUS(kStatusGroup_Generic, 8) /*!< Requested CCO rate isn't possible */ -} pll_error_t; - -/*! @brief Return PLL0 output clock rate from setup structure - * @param pSetup : Pointer to a PLL setup structure - * @return System PLL output clock rate the setup structure will generate - */ -uint32_t CLOCK_GetPLLOutFromSetup(pll_setup_t *pSetup); - -/*! @brief Set PLL output based on the passed PLL setup data - * @param pControl : Pointer to populated PLL control structure to generate setup with - * @param pSetup : Pointer to PLL setup structure to be filled - * @return PLL_ERROR_SUCCESS on success, or PLL setup error code - * @note Actual frequency for setup may vary from the desired frequency based on the - * accuracy of input clocks, rounding, non-fractional PLL mode, etc. - */ -pll_error_t CLOCK_SetupPLLData(pll_config_t *pControl, pll_setup_t *pSetup); - -/** - * @brief Set PLL output from PLL setup structure (precise frequency) - * @param pSetup : Pointer to populated PLL setup structure - * @return kStatus_PLL_Success on success, or PLL setup error code - * @note This function will power off the PLL, setup the PLL with the - * new setup data, and then optionally powerup the PLL, wait for PLL lock, - * and adjust system voltages to the new PLL rate. The function will not - * alter any source clocks (ie, main systen clock) that may use the PLL, - * so these should be setup prior to and after exiting the function. - */ -pll_error_t CLOCK_SetPLL0Freq(const pll_setup_t *pSetup); - -/** - * @brief Set PLL output from PLL setup structure (precise frequency) - * @param pSetup : Pointer to populated PLL setup structure - * @return kStatus_PLL_Success on success, or PLL setup error code - * @note This function will power off the PLL, setup the PLL with the - * new setup data, and then optionally powerup the PLL, wait for PLL lock, - * and adjust system voltages to the new PLL rate. The function will not - * alter any source clocks (ie, main systen clock) that may use the PLL, - * so these should be setup prior to and after exiting the function. - */ -pll_error_t CLOCK_SetPLL1Freq(const pll_setup_t *pSetup); - -/*! @brief Enable the OSTIMER 32k clock. - * @return Nothing - */ -void CLOCK_EnableOstimer32kClock(void); - -/*! brief Enable USB HS PHY PLL clock. - * - * This function enables the internal 480MHz USB PHY PLL clock. - * - * param src USB HS PHY PLL clock source. - * param freq The frequency specified by src. - * retval true The clock is set successfully. - * retval false The clock source is invalid to get proper USB HS clock. - */ -bool CLOCK_EnableUsbhsPhyPllClock(clock_usb_phy_src_t src, uint32_t freq); - -/*! brief Disable USB HS PHY PLL clock. - * - * This function disables USB HS PHY PLL clock. - */ -void CLOCK_DisableUsbhsPhyPllClock(void); - -/*! brief Enable USB HS clock. - * retval true The clock is set successfully. - * retval false The clock source is invalid to get proper USB HS clock. - */ -bool CLOCK_EnableUsbhsClock(void); - -/** - * @brief FIRC Auto Trim With SOF. - * @return returns success or fail status. - */ -status_t CLOCK_FIRCAutoTrimWithSOF(void); - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @} */ - -#endif /* _FSL_CLOCK_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_cmc.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_cmc.c deleted file mode 100644 index f2b7e064ab1..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_cmc.c +++ /dev/null @@ -1,315 +0,0 @@ -/* - * Copyright 2022 ~ 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#include "fsl_cmc.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.mcx_cmc" -#endif - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#if (defined(FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG) && FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG) -#define CMC_SRAMDIS_RESERVED_MASK \ - (~(kCMC_RAMX0 | kCMC_RAMX1 | kCMC_RAMX2 | kCMC_RAMB | kCMC_RAMC0 | kCMC_RAMC1 | kCMC_RAMD0 | kCMC_RAMD1 | \ - kCMC_RAME0 | kCMC_RAME1 | kCMC_RAMF0 | kCMC_RAMF1 | kCMC_RAMG0_RAMG1 | kCMC_RAMG2_RAMG3 | kCMC_RAMH0_RAMH1 | \ - kCMC_LPCAC | kCMC_DMA0_DMA1_PKC | kCMC_USB0 | kCMC_PQ | kCMC_CAN0_CAN1_ENET_USB1 | kCMC_FlexSPI)) - -#define CMC_SRAMRET_RESERVED_MASK (CMC_SRAMDIS_RESERVED_MASK) -#endif /* FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG */ -/******************************************************************************* - * Variables - ******************************************************************************/ -static uint32_t g_savedPrimask; - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Sets clock mode. - * - * This function configs the amount of clock gating when the core asserts - * Sleeping due to WFI, WFE or SLEEPONEXIT. - * - * param base CMC peripheral base address. - * param mode System clock mode. - */ -void CMC_SetClockMode(CMC_Type *base, cmc_clock_mode_t mode) -{ - uint32_t reg; - - reg = base->CKCTRL; - reg &= ~CMC_CKCTRL_CKMODE_MASK; - reg |= CMC_CKCTRL_CKMODE((mode)); - base->CKCTRL = reg; -} - -/*! - * brief Configures all power mode protection settings. - * - * This function configures the power mode protection settings for - * supported power modes. This should be done before setting the lowPower mode - * for each power doamin. - * - * The allowed lowpower modes are passed as bit map. For example, to allow - * Sleep and DeepSleep, use CMC_SetPowerModeProtection(CMC_base, kCMC_AllowSleepMode|kCMC_AllowDeepSleepMode). - * To allow all low power modes, use CMC_SetPowerModeProtection(CMC_base, kCMC_AllowAllLowPowerModes). - * - * param base CMC peripheral base address. - * param allowedModes Bitmaps of the allowed power modes. - */ -void CMC_SetPowerModeProtection(CMC_Type *base, uint32_t allowedModes) -{ - uint32_t reg; - - reg = base->PMPROT; - reg &= ~0xFUL; - reg |= allowedModes; - - base->PMPROT = reg; -} - -/*! - * brief Configure reset pin. - * - * This function configures reset pin. When enabled, the low power filter is enabled in both - * Active and Low power modes, the reset filter is only enabled in Active mode. When both filers - * are enabled, they operate in series. - * - * param base CMC peripheral base address. - * param config Pointer to the reset pin config structure. - */ -void CMC_ConfigResetPin(CMC_Type *base, const cmc_reset_pin_config_t *config) -{ - assert(config != NULL); - - uint32_t reg = base->RPC; - - if (config->lowpowerFilterEnable) - { - reg |= CMC_RPC_LPFEN_MASK; - } - else - { - reg &= ~CMC_RPC_LPFEN_MASK; - } - if (config->resetFilterEnable) - { - reg |= (CMC_RPC_FILTEN_MASK | CMC_RPC_FILTCFG(config->resetFilterWidth)); - } - else - { - reg &= ~(CMC_RPC_FILTEN_MASK | CMC_RPC_FILTCFG_MASK); - } - base->RPC = reg; -} - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG) && FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG) -/*! - * brief Power off the selected system SRAM always. - * - * This function powers off the selected system SRAM always. The SRAM arrays should - * not be accessed while they are shut down. SRAM array contents are not retained - * if they are powered off. - * - * param base CMC peripheral base address. - * param mask Bitmap of the SRAM arrays to be powered off all modes. - */ -void CMC_PowerOffSRAMAllMode(CMC_Type *base, uint32_t mask) -{ - uint32_t reg = base->SRAMDIS[0]; - - reg &= ~(CMC_SRAMDIS_DIS_MASK | CMC_SRAMDIS_RESERVED_MASK); - reg |= CMC_SRAMDIS_DIS(mask); - base->SRAMDIS[0] = reg; -} - -/*! - * brief Power off the selected system SRAm during low power mode only. - * - * This function powers off the selected system SRAM only during low power mode. - * SRAM array contents are not retained if they are power off. - * - * param base CMC peripheral base address. - * param mask Bitmap of the SRAM arrays to be power off during low power mode only. - */ -void CMC_PowerOffSRAMLowPowerOnly(CMC_Type *base, uint32_t mask) -{ - uint32_t reg = base->SRAMRET[0]; - - reg &= ~(CMC_SRAMRET_RET_MASK | CMC_SRAMRET_RESERVED_MASK); - reg |= CMC_SRAMRET_RET(mask); - base->SRAMRET[0] = reg; -} -#endif /* FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG */ - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_NO_FLASHCR_WAKE) && FSL_FEATURE_MCX_CMC_HAS_NO_FLASHCR_WAKE) -/*! - * brief Configs the low power mode of the on-chip flash memory. - * - * This function configs the low power mode of the on-chip flash memory. - * - * param base CMC peripheral base address. - * param doze true: Flash is disabled while core is sleeping - * false: No effect. - * param disable true: Flash memory is placed in low power state. - * false: No effect. - */ -void CMC_ConfigFlashMode(CMC_Type *base, bool doze, bool disable) -{ - uint32_t reg = 0UL; - - reg |= (disable ? CMC_FLASHCR_FLASHDIS(1U) : CMC_FLASHCR_FLASHDIS(0U)) | - (doze ? CMC_FLASHCR_FLASHDOZE(1U) : CMC_FLASHCR_FLASHDOZE(0U)); - base->FLASHCR = reg; -} -#else -/*! - * brief Configs the low power mode of the on-chip flash memory. - * - * This function config the low power mode of the on-chip flash memory. - * - * param base CMC peripheral base address. - * param wake - * true - Flash will exit low power state during the flash memory accesses. - * false - No effect. - * param doze - * true - Flash is disabled while core is sleeping - * false - No effect. - * param disable - * true - Flash memory is placed in low power state. - * false - No effect. - */ -void CMC_ConfigFlashMode(CMC_Type *base, bool wake, bool doze, bool disable) -{ - uint32_t reg = 0UL; - - reg |= (disable ? CMC_FLASHCR_FLASHDIS(1U) : CMC_FLASHCR_FLASHDIS(0U)) | - (doze ? CMC_FLASHCR_FLASHDOZE(1U) : CMC_FLASHCR_FLASHDOZE(0U)) | - (wake ? CMC_FLASHCR_FLASHWAKE(1U) : CMC_FLASHCR_FLASHWAKE(0U)); - base->FLASHCR = reg; -} -#endif /* FSL_FEATURE_MCX_CMC_HAS_NO_FLASHCR_WAKE */ - -/*! - * brief Prepares to enter stop modes. - * - * This function should be called before entering low power modes. - * - */ -void CMC_PreEnterLowPowerMode(void) -{ - g_savedPrimask = DisableGlobalIRQ(); - __ISB(); -} - -/*! - * brief Recovers after wake up from stop modes. - * - * This function should be called after waking up from low power modes. - * This function should be used with CMC_PreEnterLowPowerMode() - * - */ -void CMC_PostExitLowPowerMode(void) -{ - EnableGlobalIRQ(g_savedPrimask); - __ISB(); -} - -/*! - * brief Configs the entry into the same low power mode for each power domains. - * - * This function provides the feature to entry into the same low power mode for each power - * domains. Before invoking this function, please ensure the selected power mode have been allowed. - * - * param base CMC peripheral base address. - * param lowPowerMode The low power mode to be entered. See @ref cmc_low_power_mode_t for the details. - * - */ -void CMC_GlobalEnterLowPowerMode(CMC_Type *base, cmc_low_power_mode_t lowPowerMode) -{ - /* Note: unlock the CKCTRL register if this API will be reinvoked later. */ - CMC_SetClockMode(base, kCMC_GateAllSystemClocksEnterLowPowerMode); - CMC_SetGlobalPowerMode(base, lowPowerMode); - /* Before executing WFI instruction read back the last register to - * ensure all registers writes have completed. */ - (void)base->GPMCTRL; - /* Set the core into DeepSleep mode. */ - SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; - __DSB(); - __WFI(); - __ISB(); -} - -/*! - * brief Configs the entry into different low power modes for each of the power domains. - * - * This function provides the feature to entry into different low power modes for - * each power domains. Before invoking this function please ensure the selected - * modes are allowed. - * - * param base CMC peripheral base address. - * param base config Pointer to the cmc_power_domain_config_t structure. - */ -void CMC_EnterLowPowerMode(CMC_Type *base, const cmc_power_domain_config_t *config) -{ - assert(config != NULL); - -#if (CMC_PMCTRL_COUNT > 1U) - /* The WAKE domain must never be configured to a lower power mode compared with main power mode. */ - assert(config->wake_domain <= config->main_domain); -#endif /* (CMC_PMCTRL_COUNT > 1U) */ - - if (config->clock_mode < kCMC_GateAllSystemClocksEnterLowPowerMode) - { - /* In This case the power domain doesn't need to be placed in low power state. */ - /* Note: unlock the register if this API will be reinvoked later. */ - CMC_SetClockMode(base, config->clock_mode); - - CMC_SetMAINPowerMode(base, kCMC_ActiveOrSleepMode); -#if (CMC_PMCTRL_COUNT > 1U) - CMC_SetWAKEPowerMode(base, kCMC_ActiveOrSleepMode); -#endif /* (CMC_PMCTRL_COUNT > 1U) */ - - /* Before executing WFI instruction read back the last register to - * ensure all registers writes have completed. */ - (void)base->CKCTRL; - SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; - __DSB(); - __WFI(); - __ISB(); - } - else - { - /* Note: unlock the register if this API will be reinvoked later. */ - CMC_SetClockMode(base, kCMC_GateAllSystemClocksEnterLowPowerMode); - CMC_SetMAINPowerMode(base, config->main_domain); -#if (CMC_PMCTRL_COUNT > 1U) - CMC_SetWAKEPowerMode(base, config->wake_domain); -#endif /* (CMC_PMCTRL_COUNT > 1U) */ - - /* Before execute WFI instruction read back the last register to - * ensure all registers writes have completed. */ -#if (CMC_PMCTRL_COUNT > 1U) - if ((CMC_GetWAKEPowerMode(base) == config->wake_domain) && (CMC_GetMAINPowerMode(base) == config->main_domain)) - { -#endif /* (CMC_PMCTRL_COUNT > 1U) */ - SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; - __DSB(); - __WFI(); - __ISB(); -#if (CMC_PMCTRL_COUNT > 1U) - } -#endif /* (CMC_PMCTRL_COUNT > 1U) */ - } -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_cmc.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_cmc.h deleted file mode 100644 index 979c5dfa0ae..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_cmc.h +++ /dev/null @@ -1,911 +0,0 @@ -/* - * Copyright 2022 ~ 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_CMC_H_ -#define FSL_CMC_H_ -#include "fsl_common.h" - -/*! - * @addtogroup mcx_cmc - * @{ - */ -/******************************************************************************* - * Definitions - ******************************************************************************/ -/*! @name Driver version */ -/*@{*/ -/*! @brief CMC driver version 2.2.0. */ -#define FSL_CMC_DRIVER_VERSION (MAKE_VERSION(2, 2, 0)) -/* @} */ - -/*! - * @brief CMC power mode Protection enumeration. - */ -enum _cmc_power_mode_protection -{ - kCMC_AllowDeepSleepMode = 0x1UL, /*!< Allow Deep Sleep mode. */ - kCMC_AllowPowerDownMode = 0x2UL, /*!< Allow Power Down mode. */ - kCMC_AllowDeepPowerDownMode = 0x8UL, /*!< Allow Deep Power Down mode. */ - kCMC_AllowAllLowPowerModes = 0xFUL, /*!< Allow Deep Sleep, Power Down, Deep Power Down modes. */ -}; - -/*! - * @brief Wake up sources from the previous low power mode entry. - * - * @note #kCMC_WakeupFromUsbFs, #kCMC_WakeupFromITRC, #kCMC_WakeupFromCpu1 are not supported in MCXA family. - */ -enum _cmc_wakeup_sources -{ - kCMC_WakeupFromResetInterruptOrPowerDown = - CMC_CKSTAT_WAKEUP(1U << 0U), /*!< Wakeup source is reset interrupt, or wake up from Deep Power Down. */ - kCMC_WakeupFromDebugReuqest = CMC_CKSTAT_WAKEUP(1U << 1U), /*!< Wakeup source is debug request. */ - kCMC_WakeupFromInterrupt = CMC_CKSTAT_WAKEUP(1U << 2U), /*!< Wakeup source is interrupt. */ - kCMC_WakeupFromDMAWakeup = CMC_CKSTAT_WAKEUP(1U << 3U), /*!< Wakeup source is DMA Wakeup. */ - kCMC_WakeupFromWUURequest = CMC_CKSTAT_WAKEUP(1U << 4U), /*!< Wakeup source is WUU request. */ - kCMC_WakeupFromUsbFs = CMC_CKSTAT_WAKEUP(1U << 5U), /*!< Wakeup source is USBFS(USB0). */ - kCMC_WakeupFromITRC = CMC_CKSTAT_WAKEUP(1U << 6U), /*!< Wakeup source is ITRC. */ - kCMC_WakeupFromCpu1 = CMC_CKSTAT_WAKEUP(1U << 7U), /*!< Wakeup source is CPU1. */ -}; - -/*! - * @brief System Reset Interrupt enable enumeration. - */ -enum _cmc_system_reset_interrupt_enable -{ - kCMC_PinResetInterruptEnable = CMC_SRIE_PIN_MASK, /*!< Pin Reset interrupt enable. */ - kCMC_DAPResetInterruptEnable = CMC_SRIE_DAP_MASK, /*!< DAP Reset interrupt enable. */ - kCMC_LowPowerAcknowledgeTimeoutResetInterruptEnable = CMC_SRIE_LPACK_MASK, /*!< Low Power Acknowledge Timeout - Reset interrupt enable. */ - kCMC_WindowedWatchdog0ResetInterruptEnable = CMC_SRIE_WWDT0_MASK, /*!< Windowed Watchdog 0 reset - interrupt enable. */ - kCMC_SoftwareResetInterruptEnable = CMC_SRIE_SW_MASK, /*!< Software Reset interrupt enable. */ - kCMC_LockupResetInterruptEnable = CMC_SRIE_LOCKUP_MASK, /*!< Lockup Reset interrupt enable. */ -#if defined(CMC_SRIE_CPU1_MASK) - kCMC_Cpu1ResetInterruptEnable = CMC_SRIE_CPU1_MASK, /*!< CPU1 Reset interrupt enable. */ -#endif /* CMC_SRIE_CPU1_MASK */ -#if defined(CMC_SRIE_VBAT_MASK) - kCMC_VBATResetInterruptEnable = CMC_SRIE_VBAT_MASK, /*!< VBAT reset interrupt enable. */ -#endif /* CMC_SRIE_VBAT_MASK */ -#if defined(CMC_SRIE_WWDT1_MASK) - kCMC_WindowedWatchdog1ResetInterruptEnable = CMC_SRIE_WWDT1_MASK, /*!< Windowed Watchdog 1 reset - interrupt enable. */ -#endif /* CMC_SRIE_WWDT1_MASK */ - kCMC_CodeWatchDog0ResetInterruptEnable = CMC_SRIE_CDOG0_MASK, /*!< Code watchdog 0 reset interrupt enable. */ -#if defined(CMC_SRIE_CDOG1_MASK) - kCMC_CodeWatchDog1ResetInterruptEnable = CMC_SRIE_CDOG1_MASK, /*!< Code watchdog 1 reset interrupt enable. */ -#endif /* CMC_SRIE_CDOG1_MASK */ -}; - -/*! - * @brief CMC System Reset Interrupt Status flag. - */ -enum _cmc_system_reset_interrupt_flag -{ - kCMC_PinResetInterruptFlag = CMC_SRIF_PIN_MASK, /*!< Pin Reset interrupt flag. */ - kCMC_DAPResetInterruptFlag = CMC_SRIF_DAP_MASK, /*!< DAP Reset interrupt flag. */ - kCMC_LowPowerAcknowledgeTimeoutResetFlag = CMC_SRIF_LPACK_MASK, /*!< Low Power Acknowledge - Timeout Reset interrupt flag. */ - kCMC_WindowedWatchdog0ResetInterruptFlag = CMC_SRIF_WWDT0_MASK, /*!< Windowned Watchdog 0 Reset interrupt flag. */ - kCMC_SoftwareResetInterruptFlag = CMC_SRIF_SW_MASK, /*!< Software Reset interrupt flag. */ - kCMC_LockupResetInterruptFlag = CMC_SRIF_LOCKUP_MASK, /*!< Lock up Reset interrupt flag. */ -#if defined(CMC_SRIF_CPU1_MASK) - kCMC_Cpu1ResetInterruptFlag = CMC_SRIF_CPU1_MASK, /*!< CPU1 Reset interrupt flag. */ -#endif /* CMC_SRIF_CPU1_MASK */ -#if defined(CMC_SRIF_VBAT_MASK) - kCMC_VbatResetInterruptFlag = CMC_SRIF_VBAT_MASK, /*!< VBAT system reset interrupt flag. */ -#endif /* CMC_SRIF_VBAT_MASK */ -#if defined(CMC_SRIF_WWDT1_MASK) - kCMC_WindowedWatchdog1ResetInterruptFlag = CMC_SRIF_WWDT1_MASK, /*!< Windowned Watchdog 1 Reset interrupt flag. */ -#endif /* CMC_SRIF_WWDT1_MASK */ - kCMC_CodeWatchdog0ResetInterruptFlag = CMC_SRIF_CDOG0_MASK, /*!< Code watchdog0 reset interrupt flag. */ -#if defined(CMC_SRIF_CDOG1_MASK) - kCMC_CodeWatchdog1ResetInterruptFlag = CMC_SRIF_CDOG1_MASK, /*!< Code watchdog1 reset interrupt flag. */ -#endif /* CMC_SRIF_CDOG1_MASK */ -}; - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG) && FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG) -/*! - * @brief CMC System SRAM arrays low power mode enable enumeration. - */ -enum _cmc_system_sram_arrays -{ - kCMC_RAMX0 = 1UL << 0UL, /*!< Used to control RAMX0. */ - kCMC_RAMX1 = 1UL << 1UL, /*!< Used to control RAMX1. */ - kCMC_RAMX2 = 1UL << 2UL, /*!< Used to control RAMX2. */ - kCMC_RAMB = 1UL << 3UL, /*!< Used to control RAMB. */ - kCMC_RAMC0 = 1UL << 4UL, /*!< Used to control RAMC0. */ - kCMC_RAMC1 = 1UL << 5UL, /*!< Used to control RAMC1. */ - kCMC_RAMD0 = 1UL << 6UL, /*!< Used to control RAMD0. */ - kCMC_RAMD1 = 1UL << 7UL, /*!< Used to control RAMD1. */ - kCMC_RAME0 = 1UL << 8UL, /*!< Used to control RAME0. */ - kCMC_RAME1 = 1UL << 9UL, /*!< Used to control RAME1. */ - kCMC_RAMF0 = 1UL << 10UL, /*!< Used to control RAMF0. */ - kCMC_RAMF1 = 1UL << 11UL, /*!< Used to control RAMF1. */ - kCMC_RAMG0_RAMG1 = 1UL << 12UL, /*!< Used to control RAMG0 and RAMG1. */ - kCMC_RAMG2_RAMG3 = 1UL << 13UL, /*!< Used to control RAMG2 and RAMG3. */ - kCMC_RAMH0_RAMH1 = 1UL << 14UL, /*!< Used to control RAMH0 and RAMH1. */ - kCMC_LPCAC = 1UL << 24UL, /*!< Used to control LPCAC. */ - kCMC_DMA0_DMA1_PKC = 1UL << 25UL, /*!< Used to control DMA0, DMA1 and PKC. */ - kCMC_USB0 = 1UL << 26UL, /*!< Used to control USB0. */ - kCMC_PQ = 1UL << 27UL, /*!< Used to control PQ. */ - kCMC_CAN0_CAN1_ENET_USB1 = 1UL << 28UL, /*!< Used to control CAN0, CAN1, ENET, USB1. */ - kCMC_FlexSPI = 1UL << 29UL, /*!< Used to control FlexSPI. */ -}; -#endif /* FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG */ - -/*! - * @brief System reset sources enumeration. - */ -enum _cmc_system_reset_sources -{ - kCMC_WakeUpReset = CMC_SRS_WAKEUP_MASK, /*!< The reset caused by a wakeup from Power Down or - Deep Power Down mode. */ - kCMC_PORReset = CMC_SRS_POR_MASK, /*!< The reset caused by power on reset detection logic. */ - kCMC_VDReset = CMC_SRS_VD_MASK, /*!< The reset caused by an LVD or HVD. */ - kCMC_WarmReset = CMC_SRS_WARM_MASK, /*!< The last reset source is a warm reset source. */ - kCMC_FatalReset = CMC_SRS_FATAL_MASK, /*!< The last reset source is a fatal reset source. */ - kCMC_PinReset = CMC_SRS_PIN_MASK, /*!< The reset caused by the RESET_b pin. */ - kCMC_DAPReset = CMC_SRS_DAP_MASK, /*!< The reset caused by a reset request from the Debug Access port. */ - kCMC_ResetTimeout = CMC_SRS_RSTACK_MASK, /*!< The reset caused by a timeout or other error condition in the system - reset generation. */ - kCMC_LowPowerAcknowledgeTimeoutReset = CMC_SRS_LPACK_MASK, /*!< The reset caused by a timeout in - low power mode entry logic. */ - kCMC_SCGReset = CMC_SRS_SCG_MASK, /*!< The reset caused by a loss of clock or loss of lock event in the SCG. */ - kCMC_WindowedWatchdog0Reset = CMC_SRS_WWDT0_MASK, /*!< The reset caused by the Windowed WatchDog 0 timeout. */ - kCMC_SoftwareReset = CMC_SRS_SW_MASK, /*!< The reset caused by a software reset request. */ - kCMC_LockUoReset = CMC_SRS_LOCKUP_MASK, /*!< The reset caused by the ARM core indication of a LOCKUP event. */ -#if defined(CMC_SRS_CPU1_MASK) - kCMC_Cpu1Reset = CMC_SRS_CPU1_MASK, /*!< The reset caused by a CPU1 system reset. */ -#endif /* CMC_SRS_CPU1_MASK */ -#if defined(CMC_SRS_VBAT_MASK) - kCMC_VbatReset = CMC_SRS_VBAT_MASK, /*!< The reset caused by a VBAT POR. */ -#endif /* CMC_SRS_VBAT_MASK */ -#if defined(CMC_SRS_WWDT1_MASK) - kCMC_WindowedWatchdog1Reset = CMC_SRS_WWDT1_MASK, /*!< The reset caused by the Windowed WatchDog 1 timeout. */ -#endif /* CMC_SRS_WWDT1_MASK */ - kCMC_CodeWatchDog0Reset = CMC_SRS_CDOG0_MASK, /*!< The reset caused by the code watchdog0 fault. */ -#if defined(CMC_SRS_CDOG1_MASK) - kCMC_CodeWatchDog1Reset = CMC_SRS_CDOG1_MASK, /*!< The reset caused by the code watchdog1 fault. */ -#endif /* CMC_SRS_CDOG1_MASK */ - kCMC_JTAGSystemReset = CMC_SRS_JTAG_MASK, /*!< The reset caused by a JTAG system reset request. */ -#if defined(CMC_SRS_SECVIO_MASK) - kCMC_SecurityViolationReset = CMC_SRS_SECVIO_MASK, /*!< The reset caused by a Security Violation logic. */ -#endif /* CMC_SRS_SECVIO_MASK */ -#if defined(CMC_SRS_TAMPER_MASK) - kCMC_TapmerReset = CMC_SRS_TAMPER_MASK, /*!< The reset caused by the tamper detection logic. */ -#endif /* CMC_SRS_TAMPER_MASK */ -}; - -/*! - * @brief Indicate the core clock was gated. - */ -typedef enum _cmc_core_clock_gate_status -{ - kCMC_CoreClockNotGated = 0U, /*!< Core clock not gated. */ - kCMC_CoreClockGated = 1U /*!< Core clock was gated due to low power mode entry. */ -} cmc_core_clock_gate_status_t; - -/*! - * @brief CMC clock mode enumeration. - */ -typedef enum _cmc_clock_mode -{ - kCMC_GateNoneClock = 0x00U, /*!< No clock gating. */ - kCMC_GateCoreClock = 0x01U, /*!< Gate Core clock. */ - kCMC_GateCorePlatformClock = 0x03U, /*!< Gate Core clock and platform clock. */ - kCMC_GateAllSystemClocks = 0x07U, /*!< Gate all System clocks, without getting core entering into low power mode. */ - kCMC_GateAllSystemClocksEnterLowPowerMode = 0x0FU /*!< Gate all System clocks, with core - entering into low power mode. */ -} cmc_clock_mode_t; - -/*! - * @brief CMC power mode enumeration. - */ -typedef enum _cmc_low_power_mode -{ - kCMC_ActiveOrSleepMode = 0x0U, /*!< Select Active/Sleep mode. */ - kCMC_DeepSleepMode = 0x1U, /*!< Select Deep Sleep mode when a core executes WFI or WFE instruction. */ - kCMC_PowerDownMode = 0x3U, /*!< Select Power Down mode when a core executes WFI or WFE instruction. */ - kCMC_DeepPowerDown = 0xFU, /*!< Select Deep Power Down mode when a core executes WFI or WFE instruction. */ -} cmc_low_power_mode_t; - -/*! - * @brief CMC reset pin configuration. - */ -typedef struct _cmc_reset_pin_config -{ - bool lowpowerFilterEnable; /*!< Low Power Filter enable. */ - bool resetFilterEnable; /*!< Reset Filter enable. */ - uint8_t resetFilterWidth; /*!< Width of the Reset Filter. */ -} cmc_reset_pin_config_t; - -/*! - * @brief power mode configuration for each power domain. - */ -typedef struct _cmc_power_domain_config -{ - cmc_clock_mode_t clock_mode; /*!< Clock mode for each power domain. */ - cmc_low_power_mode_t main_domain; /*!< The low power mode of the MAIN power domain. */ -#if (CMC_PMCTRL_COUNT > 1U) - cmc_low_power_mode_t wake_domain; /*!< The low power mode of the WAKE power domain. */ -#endif /* (CMC_PMCTRL_COUNT > 1U) */ -} cmc_power_domain_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name CLOCK mode configuration. - * @{ - */ - -/*! - * @brief Sets clock mode. - * - * This function configs the amount of clock gating when the core asserts - * Sleeping due to WFI, WFE or SLEEPONEXIT. - * - * @param base CMC peripheral base address. - * @param mode System clock mode. - */ -void CMC_SetClockMode(CMC_Type *base, cmc_clock_mode_t mode); - -/*! - * @brief Locks the clock mode setting. - * - * After invoking this function, any clock mode setting will be blocked. - * - * @param base CMC peripheral base address. - */ -static inline void CMC_LockClockModeSetting(CMC_Type *base) -{ - base->CKCTRL |= CMC_CKCTRL_LOCK_MASK; -} - -/* @} */ - -/*! - * @name Gets/Clears the Clock Mode, the wake up source, the Reset source. - * @{ - */ - -/*! - * @brief Gets the core clock gated status. - * - * This function get the status to indicate whether the core clock is gated. - * The core clock gated status can be cleared by software. - * - * @param base CMC peripheral base address. - * @return The status to indicate whether the core clock is gated. - */ -static inline cmc_core_clock_gate_status_t CMC_GetCoreClockGatedStatus(CMC_Type *base) -{ - return (cmc_core_clock_gate_status_t)(uint32_t)((base->CKSTAT & CMC_CKSTAT_VALID_MASK) >> CMC_CKSTAT_VALID_SHIFT); -} - -/*! - * @brief Clears the core clock gated status. - * - * This function clear clock status flag by software. - * - * @param base CMC peripheral base address. - */ -static inline void CMC_ClearCoreClockGatedStatus(CMC_Type *base) -{ - base->CKSTAT |= CMC_CKSTAT_VALID_MASK; -} - -/*! - * @brief Gets the Wakeup Source. - * - * This function gets the Wakeup sources from the previous low power mode entry. - * - * @param base CMC peripheral base address. - * @return The Wakeup sources from the previous low power mode entry. See @ref _cmc_wakeup_sources for details. - */ -static inline uint8_t CMC_GetWakeupSource(CMC_Type *base) -{ - return ((uint8_t)((base->CKSTAT & CMC_CKSTAT_WAKEUP_MASK) >> CMC_CKSTAT_WAKEUP_SHIFT)); -} - -/*! - * @brief Gets the Clock mode. - * - * This function gets the clock mode of the previous low power mode entry. - * - * @param base CMC peripheral base address. - * @return The Low Power status. - */ -static inline cmc_clock_mode_t CMC_GetClockMode(CMC_Type *base) -{ - return (cmc_clock_mode_t)(uint32_t)((base->CKSTAT & CMC_CKSTAT_CKMODE_MASK) >> CMC_CKSTAT_CKMODE_SHIFT); -} - -/*! - * @brief Gets the System reset status. - * - * This function returns the system reset status. Those status - * updates on every MAIN Warm Reset to indicate the type/source - * of the most recent reset. - * - * @param base CMC peripheral base address. - * @return The most recent system reset status. See @ref _cmc_system_reset_sources for details. - */ -static inline uint32_t CMC_GetSystemResetStatus(CMC_Type *base) -{ - return base->SRS; -} - -/*! - * @brief Gets the sticky system reset status since the last WAKE Cold Reset. - * - * This function gets all source of system reset that have generated a - * system reset since the last WAKE Cold Reset, and that have not been - * cleared by software. - * - * @param base CMC peripheral base address. - * @return System reset status that have not been cleared by software. See @ref _cmc_system_reset_sources for details. - */ -static inline uint32_t CMC_GetStickySystemResetStatus(CMC_Type *base) -{ - return base->SSRS; -} - -/*! - * @brief Clears the sticky system reset status flags. - * - * @param base CMC peripheral base address. - * @param mask Bitmap of the sticky system reset status to be cleared. - */ -static inline void CMC_ClearStickySystemResetStatus(CMC_Type *base, uint32_t mask) -{ - base->SSRS = mask; -} - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_RSTCNT_REG) && FSL_FEATURE_MCX_CMC_HAS_RSTCNT_REG) -/*! - * @brief Gets the number of reset sequences completed since the last Cold Reset. - * - * @param base CMC peripheral base address. - * @return The number of reset sequences. - */ -static inline uint8_t CMC_GetResetCount(CMC_Type *base) -{ - return (uint8_t)(base->RSTCNT & CMC_RSTCNT_COUNT_MASK); -} -#endif /* FSL_FEATURE_MCX_CMC_HAS_RSTCNT_REG */ - -/* @} */ - -/*! - * @name Power mode configuration. - * @{ - */ - -/*! - * @brief Configures all power mode protection settings. - * - * This function configures the power mode protection settings for - * supported power modes. This should be done before set the lowPower mode - * for each power doamin. - * - * The allowed lowpower modes are passed as bit map. For example, to allow - * Sleep and DeepSleep, use CMC_SetPowerModeProtection(CMC_base, kCMC_AllowSleepMode|kCMC_AllowDeepSleepMode). - * To allow all low power modes, use CMC_SetPowerModeProtection(CMC_base, kCMC_AllowAllLowPowerModes). - * - * @param base CMC peripheral base address. - * @param allowedModes Bitmaps of the allowed power modes. See @ref _cmc_power_mode_protection for details. - */ -void CMC_SetPowerModeProtection(CMC_Type *base, uint32_t allowedModes); - -/*! - * @brief Locks the power mode protection. - * - * This function locks the power mode protection. After invoking this function, - * any power mode protection setting will be ignored. - * - * @param base CMC peripheral base address. - */ -static inline void CMC_LockPowerModeProtectionSetting(CMC_Type *base) -{ - base->PMPROT |= CMC_PMPROT_LOCK_MASK; -} - -/*! - * @brief Config the same lowPower mode for all power domain. - * - * This function configures the same low power mode for MAIN power domian and WAKE power domain. - * - * @param base CMC peripheral base address. - * @param lowPowerMode The desired lowPower mode. See @ref cmc_low_power_mode_t for details. - */ -static inline void CMC_SetGlobalPowerMode(CMC_Type *base, cmc_low_power_mode_t lowPowerMode) -{ - base->GPMCTRL = CMC_GPMCTRL_LPMODE((uint8_t)lowPowerMode); -} - -/*! - * @brief Configures entry into low power mode for the MAIN Power domain. - * - * This function configures the low power mode for the MAIN power domian, - * when the core executes WFI/WFE instruction. The available lowPower modes - * are defined in the @ref cmc_low_power_mode_t. - * - * @param base CMC peripheral base address. - * @param lowPowerMode The desired lowPower mode. See @ref cmc_low_power_mode_t for details. - * - */ -static inline void CMC_SetMAINPowerMode(CMC_Type *base, cmc_low_power_mode_t lowPowerMode) -{ - base->PMCTRL[0] = CMC_PMCTRL_LPMODE((uint8_t)lowPowerMode); -} - -/*! - * @brief Gets the power mode of the MAIN Power domain. - * - * @param base CMC peripheral base address. - * @return The power mode of MAIN Power domain. See @ref cmc_low_power_mode_t for details. - */ -static inline cmc_low_power_mode_t CMC_GetMAINPowerMode(CMC_Type *base) -{ - return (cmc_low_power_mode_t)(uint32_t)(base->PMCTRL[0] & CMC_PMCTRL_LPMODE_MASK); -} - -#if (CMC_PMCTRL_COUNT > 1U) -/*! - * @brief Configure entry into low power mode for the WAKE Power domain. - * - * This function configures the low power mode for the WAKE power domian, - * when the core executes WFI/WFE instruction. The available lowPower mode - * are defined in the @ref cmc_low_power_mode_t. - * - * @note The lowPower Mode for the WAKE domain must not be configured to a - * lower power mode than any other power domain. - * - * @param base CMC peripheral base address. - * @param lowPowerMode The desired lowPower mode. See @ref cmc_low_power_mode_t for details. - * - */ -static inline void CMC_SetWAKEPowerMode(CMC_Type *base, cmc_low_power_mode_t lowPowerMode) -{ - base->PMCTRL[1] = CMC_PMCTRL_LPMODE((uint8_t)lowPowerMode); -} - -/*! - * @brief Gets the power mode of the WAKE Power domain. - * - * @param base CMC peripheral base address. - * @return The power mode of WAKE Power domain. See @ref cmc_low_power_mode_t for details. - */ -static inline cmc_low_power_mode_t CMC_GetWAKEPowerMode(CMC_Type *base) -{ - return (cmc_low_power_mode_t)(uint32_t)(base->PMCTRL[1] & CMC_PMCTRL_LPMODE_MASK); -} -#endif /* CMC_PMCTRL_COUNT > 1U */ - -/* @} */ - -/*! - * @name Reset Pin configuration. - * @{ - */ - -/*! - * @brief Configure reset pin. - * - * This function configures reset pin. When enabled, the low power filter is enabled in both - * Active and Low power modes, the reset filter is only enabled in Active mode. When both filers - * are enabled, they operate in series. - * - * @param base CMC peripheral base address. - * @param config Pointer to the reset pin config structure. - */ -void CMC_ConfigResetPin(CMC_Type *base, const cmc_reset_pin_config_t *config); - -/* @} */ - -/*! - * @name System Reset Interrupts. - * @{ - */ - -/*! - * @brief Enable system reset interrupts. - * - * This function enables the system reset interrupts. The assertion of - * non-fatal warm reset can be delayed for 258 cycles of the 32K_CLK clock - * while an enabled interrupt is generated. Then Software can perform a graceful - * shutdown or abort the non-fatal warm reset provided the pending reset source is cleared - * by resetting the reset source and then clearing the pending flag. - * - * @param base CMC peripheral base address. - * @param mask System reset interrupts. See @ref _cmc_system_reset_interrupt_enable for details. - * - */ -static inline void CMC_EnableSystemResetInterrupt(CMC_Type *base, uint32_t mask) -{ - base->SRIE |= mask; -} - -/*! - * @brief Disable system reset interrupts. - * - * This function disables the system reset interrupts. - * - * @param base CMC peripheral base address. - * @param mask System reset interrupts. See @ref _cmc_system_reset_interrupt_enable for details. - */ -static inline void CMC_DisableSystemResetInterrupt(CMC_Type *base, uint32_t mask) -{ - base->SRIE &= (uint32_t)(~mask); -} - -/*! - * @brief Gets System Reset interrupt flags. - * - * This function returns the System reset interrupt flags. - * - * @param base CMC peripheral base address. - * @return System reset interrupt flags. See @ref _cmc_system_reset_interrupt_flag for details. - */ -static inline uint32_t CMC_GetSystemResetInterruptFlags(CMC_Type *base) -{ - return base->SRIF; -} - -/*! - * @brief Clears System Reset interrupt flags. - * - * This function clears system reset interrupt flags. The pending reset source - * can be cleared by resetting the source of the reset and then clearing the pending - * flags. - * - * @param base CMC peripheral base address. - * @param mask System Reset interrupt flags. See @ref _cmc_system_reset_interrupt_flag for details. - * - */ -static inline void CMC_ClearSystemResetInterruptFlags(CMC_Type *base, uint32_t mask) -{ - base->SRIF = mask; -} - -/* @} */ - -/*! - * @name Non Maskable Pin interrupt. - * @{ - */ - -/*! - * @brief Enable/Disable Non maskable Pin interrupt. - * - * @param base CMC peripheral base address. - * @param enable Enable or disable Non maskable pin interrupt. - * true - enable Non-maskable pin interrupt. - * false - disable Non-maskable pin interupt. - */ -static inline void CMC_EnableNonMaskablePinInterrupt(CMC_Type *base, bool enable) -{ - if (enable) - { - base->CORECTL |= CMC_CORECTL_NPIE_MASK; - } - else - { - base->CORECTL &= ~CMC_CORECTL_NPIE_MASK; - } -} - -/* @} */ - -/*! - * @name Boot Configuration. - * @{ - */ - -/*! - * @brief Gets the logic state of the ISPMODE_n pin. - * - * This function returns the logic state of the ISPMODE_n pin - * on the last negation of RESET_b pin. - * - * @param base CMC peripheral base address. - * @return The logic state of the ISPMODE_n pin on the last negation of RESET_b pin. - */ -static inline uint8_t CMC_GetISPMODEPinLogic(CMC_Type *base) -{ - return (uint8_t)((base->MR[0] & CMC_MR_ISPMODE_n_MASK) >> CMC_MR_ISPMODE_n_SHIFT); -} - -/*! - * @brief Clears ISPMODE_n pin state. - * - * @param base CMC peripheral base address. - */ -static inline void CMC_ClearISPMODEPinLogic(CMC_Type *base) -{ - base->MR[0] = CMC_MR_ISPMODE_n_MASK; -} - -/*! - * @brief Set the logic state of the BOOT_CONFIGn pin. - * - * This function force the logic state of the Boot_Confign pin to assert - * on next system reset. - * - * @param base CMC peripheral base address. - * @param assert Assert the corresponding pin or not. - * true - Assert corresponding pin on next system reset. - * false - No effect. - */ -static inline void CMC_ForceBootConfiguration(CMC_Type *base, bool assert) -{ - if (assert) - { - base->FM[0] |= CMC_FM_FORCECFG_MASK; - } - else - { - base->FM[0] &= ~CMC_FM_FORCECFG_MASK; - } -} - -/* @} */ - -/*! - * @name BootROM Status. - * @{ - */ - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_BSR_REG) && FSL_FEATURE_MCX_CMC_HAS_BSR_REG) -/*! - * @brief Gets the status information written by the BootROM. - * - * @param base CMC peripheral base address. - * @return The status information written by the BootROM. - */ -static inline uint32_t CMC_GetBootRomStatus(CMC_Type *base) -{ - return base->BSR; -} - -/*! - * @brief Sets the bootROM status value. - * - * @note This function is useful when result of CMC_CheckBootRomRegisterWrittable() is true. - * - * @param base CMC peripheral base address. - * @param stat The state value to set. - */ -static inline void CMC_SetBootRomStatus(CMC_Type *base, uint32_t statValue) -{ - base->BSR = CMC_BSR_STAT(statValue); -} -#endif /* FSL_FEATURE_MCX_CMC_HAS_BSR_REG */ - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_BLR_REG) && FSL_FEATURE_MCX_CMC_HAS_BLR_REG) -/*! - * @brief Check if BootROM status and lock registers is writtable. - * - * @param base CMC peripheral base address. - * @return The result of whether BootROM status and lock register is writtable. - * - \b true BootROM status and lock registers are writtable; - * - \b false BootROM status and lock registers are not writtable. - */ -static inline bool CMC_CheckBootRomRegisterWrittable(CMC_Type *base) -{ - return (base->BLR == 0x2UL); -} - -/*! - * @brief After invoking this function, BootROM status and lock registers cannot be written. - * - * @param base CMC peripheral base address. - */ -static inline void CMC_LockBootRomStatusWritten(CMC_Type *base) -{ - base->BLR = CMC_BLR_LOCK(0x5U); -} - -/*! - * @brief After invoking this function, BootROM status and lock register can be written.s - * - * @param base - */ -static inline void CMC_UnlockBootRomStatusWritten(CMC_Type *base) -{ - base->BLR = CMC_BLR_LOCK(0x2U); -} -#endif /* FSL_FEATURE_MCX_CMC_HAS_BLR_REG */ - -/* @} */ - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG) && FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG) -/*! - * @name System SRAM Configuration. - * @{ - */ - -/*! - * @brief Power off the selected system SRAM always. - * - * This function power off the selected system SRAM always. The SRAM arrays should - * not be accessed while they are shut down. SRAM array contents are not retained - * if they are powered off. - * - * @param base CMC peripheral base address. - * @param mask Bitmap of the SRAM arrays to be powered off all modes. - * See @ref _cmc_system_sram_arrays for details. - * Check Reference Manual for the SRAM region and mask bit relationship. - */ -void CMC_PowerOffSRAMAllMode(CMC_Type *base, uint32_t mask); - -/*! - * @brief Power on SRAM during all mode. - * - * @param base CMC peripheral base address. - * @param mask Bitmap of the SRAM arrays to be powered on all modes. - * See @ref _cmc_system_sram_arrays for details. - * Check Reference Manual for the SRAM region and mask bit relationship. - */ -static inline void CMC_PowerOnSRAMAllMode(CMC_Type *base, uint32_t mask) -{ - base->SRAMDIS[0] &= CMC_SRAMDIS_DIS((uint32_t)(~mask)); -} - -/*! - * @brief Power off the selected system SRAM during low power modes only. - * - * This function power off the selected system SRAM only during low power mode. - * SRAM array contents are not retained if they are power off. - * - * @param base CMC peripheral base address. - * @param mask Bitmap of the SRAM arrays to be power off during low power mode only. - * See @ref _cmc_system_sram_arrays for details. - * Check Reference Manual for the SRAM region and mask bit relationship. - */ -void CMC_PowerOffSRAMLowPowerOnly(CMC_Type *base, uint32_t mask); - -/*! - * @brief Power on the selected system SRAM during low power modes only. - * - * This function power on the selected system SRAM. The SRAM arrray contents are - * retained in low power modes. - * - * @param base CMC peripheral base address. - * @param mask Bitmap of the SRAM arrays to be power on during low power mode only. - * See @ref _cmc_system_sram_arrays for details. - * Check Reference Manual for the SRAM region and mask bit relationship. - */ -static inline void CMC_PowerOnSRAMLowPowerOnly(CMC_Type *base, uint32_t mask) -{ - base->SRAMRET[0] &= CMC_SRAMRET_RET((uint32_t)(~mask)); -} - -/* @} */ -#endif /* FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG */ - -/*! - * @name Flash Low Power Mode configuration. - * @{ - */ - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_NO_FLASHCR_WAKE) && FSL_FEATURE_MCX_CMC_HAS_NO_FLASHCR_WAKE) -/*! - * @brief Configs the low power mode of the on-chip flash memory. - * - * This function configs the low power mode of the on-chip flash memory. - * - * @param base CMC peripheral base address. - * @param doze true: Flash is disabled while core is sleeping - * false: No effect. - * @param disable true: Flash memory is placed in low power state. - * false: No effect. - */ -void CMC_ConfigFlashMode(CMC_Type *base, bool doze, bool disable); -#else -/*! - * @brief Configs the low power mode of the on-chip flash memory. - * - * This function configs the low power mode of the on-chip flash memory. - * - * @param base CMC peripheral base address. - * @param wake true: Flash will exit low power state during the flash memory accesses. - * false: No effect. - * @param doze true: Flash is disabled while core is sleeping - * false: No effect. - * @param disable true: Flash memory is placed in low power state. - * false: No effect. - */ -void CMC_ConfigFlashMode(CMC_Type *base, bool wake, bool doze, bool disable); -#endif /* FSL_FEATURE_MCX_CMC_HAS_NO_FLASHCR_WAKE */ -/* @} */ - -/*! - * @name Debug Configuration. - */ - -/*! - * @brief Enables/Disables debug Operation when the core sleep. - * - * This function configs what happens to debug when core sleeps. - * - * @param base CMC peripheral base address. - * @param enable Enable or disable Debug when Core is sleeping. - * true - Debug remains enabled when the core is sleeping. - * false - Debug is disabled when the core is sleeping. - */ -static inline void CMC_EnableDebugOperation(CMC_Type *base, bool enable) -{ - if (enable) - { - base->DBGCTL &= ~CMC_DBGCTL_SOD_MASK; - } - else - { - base->DBGCTL |= CMC_DBGCTL_SOD_MASK; - } -} - -/* @} */ - -/*! - * @name Low Power modes enter. - * @{ - */ -/*! - * @brief Prepares to enter low power modes. - * - * This function should be called before entering low power modes. - * - */ -void CMC_PreEnterLowPowerMode(void); - -/*! - * @brief Recovers after wake up from low power modes. - * - * This function should be called after wake up from low power modes. - * This function should be used with CMC_PreEnterLowPowerMode() - * - */ -void CMC_PostExitLowPowerMode(void); - -/*! - * @brief Configs the entry into the same low power mode for each power domains. - * - * This function provides the feature to entry into the same low power mode for each power - * domains. Before invoking this function, please ensure the selected power mode have been allowed. - * - * @param base CMC peripheral base address. - * @param lowPowerMode The low power mode to be entered. See @ref cmc_low_power_mode_t for the details. - * - */ -void CMC_GlobalEnterLowPowerMode(CMC_Type *base, cmc_low_power_mode_t lowPowerMode); - -/*! - * @brief Configs the entry into different low power modes for each power domains. - * - * This function provides the feature to entry into different low power modes for - * each power domains. Before invoking this function please ensure the selected - * modes are allowed. - * - * @param base CMC peripheral base address. - * @param config Pointer to the cmc_power_domain_config_t structure. - */ -void CMC_EnterLowPowerMode(CMC_Type *base, const cmc_power_domain_config_t *config); - -/* @} */ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @}*/ -#endif /* FSL_CMC_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_common.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_common.c deleted file mode 100644 index d3af9fdfc67..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_common.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_common.h" - -#define SDK_MEM_MAGIC_NUMBER 12345U - -typedef struct _mem_align_control_block -{ - uint16_t identifier; /*!< Identifier for the memory control block. */ - uint16_t offset; /*!< offset from aligned address to real address */ -} mem_align_cb_t; - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.common" -#endif - -#if !((defined(__DSC__) && defined(__CW__))) -void *SDK_Malloc(size_t size, size_t alignbytes) -{ - mem_align_cb_t *p_cb = NULL; - uint32_t alignedsize; - - /* Check overflow. */ - alignedsize = (uint32_t)(unsigned int)SDK_SIZEALIGN(size, alignbytes); - if (alignedsize < size) - { - return NULL; - } - - if (alignedsize > SIZE_MAX - alignbytes - sizeof(mem_align_cb_t)) - { - return NULL; - } - - alignedsize += alignbytes + (uint32_t)sizeof(mem_align_cb_t); - - union - { - void *pointer_value; - uintptr_t unsigned_value; - } p_align_addr, p_addr; - - p_addr.pointer_value = malloc((size_t)alignedsize); - - if (p_addr.pointer_value == NULL) - { - return NULL; - } - - p_align_addr.unsigned_value = SDK_SIZEALIGN(p_addr.unsigned_value + sizeof(mem_align_cb_t), alignbytes); - - p_cb = (mem_align_cb_t *)(p_align_addr.unsigned_value - 4U); - p_cb->identifier = SDK_MEM_MAGIC_NUMBER; - p_cb->offset = (uint16_t)(p_align_addr.unsigned_value - p_addr.unsigned_value); - - return p_align_addr.pointer_value; -} - -void SDK_Free(void *ptr) -{ - union - { - void *pointer_value; - uintptr_t unsigned_value; - } p_free; - p_free.pointer_value = ptr; - mem_align_cb_t *p_cb = (mem_align_cb_t *)(p_free.unsigned_value - 4U); - - if (p_cb->identifier != SDK_MEM_MAGIC_NUMBER) - { - return; - } - - p_free.unsigned_value = p_free.unsigned_value - p_cb->offset; - - free(p_free.pointer_value); -} -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_common.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_common.h deleted file mode 100644 index 6a060373753..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_common.h +++ /dev/null @@ -1,321 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_COMMON_H_ -#define FSL_COMMON_H_ - -#include -#include -#include -#include -#include - -#if defined(__ICCARM__) || (defined(__CC_ARM) || defined(__ARMCC_VERSION)) || defined(__GNUC__) -#include -#endif - -#include "fsl_device_registers.h" - -/*! - * @addtogroup ksdk_common - * @{ - */ - -/******************************************************************************* - * Configurations - ******************************************************************************/ - -/*! @brief Macro to use the default weak IRQ handler in drivers. */ -#ifndef FSL_DRIVER_TRANSFER_DOUBLE_WEAK_IRQ -#define FSL_DRIVER_TRANSFER_DOUBLE_WEAK_IRQ 1 -#endif - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @brief Construct a status code value from a group and code number. */ -#define MAKE_STATUS(group, code) ((((group)*100L) + (code))) - -/*! @brief Construct the version number for drivers. - * - * The driver version is a 32-bit number, for both 32-bit platforms(such as Cortex M) - * and 16-bit platforms(such as DSC). - * - * @verbatim - - | Unused || Major Version || Minor Version || Bug Fix | - 31 25 24 17 16 9 8 0 - - @endverbatim - */ -#define MAKE_VERSION(major, minor, bugfix) (((major)*65536L) + ((minor)*256L) + (bugfix)) - -/*! @name Driver version */ -/*@{*/ -/*! @brief common driver version. */ -#define FSL_COMMON_DRIVER_VERSION (MAKE_VERSION(2, 4, 0)) -/*@}*/ - -/* Debug console type definition. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_NONE 0U /*!< No debug console. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_UART 1U /*!< Debug console based on UART. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_LPUART 2U /*!< Debug console based on LPUART. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_LPSCI 3U /*!< Debug console based on LPSCI. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_USBCDC 4U /*!< Debug console based on USBCDC. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_FLEXCOMM 5U /*!< Debug console based on FLEXCOMM. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_IUART 6U /*!< Debug console based on i.MX UART. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_VUSART 7U /*!< Debug console based on LPC_VUSART. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_MINI_USART 8U /*!< Debug console based on LPC_USART. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_SWO 9U /*!< Debug console based on SWO. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_QSCI 10U /*!< Debug console based on QSCI. */ - -/*! @brief Status group numbers. */ -enum _status_groups -{ - kStatusGroup_Generic = 0, /*!< Group number for generic status codes. */ - kStatusGroup_FLASH = 1, /*!< Group number for FLASH status codes. */ - kStatusGroup_LPSPI = 4, /*!< Group number for LPSPI status codes. */ - kStatusGroup_FLEXIO_SPI = 5, /*!< Group number for FLEXIO SPI status codes. */ - kStatusGroup_DSPI = 6, /*!< Group number for DSPI status codes. */ - kStatusGroup_FLEXIO_UART = 7, /*!< Group number for FLEXIO UART status codes. */ - kStatusGroup_FLEXIO_I2C = 8, /*!< Group number for FLEXIO I2C status codes. */ - kStatusGroup_LPI2C = 9, /*!< Group number for LPI2C status codes. */ - kStatusGroup_UART = 10, /*!< Group number for UART status codes. */ - kStatusGroup_I2C = 11, /*!< Group number for UART status codes. */ - kStatusGroup_LPSCI = 12, /*!< Group number for LPSCI status codes. */ - kStatusGroup_LPUART = 13, /*!< Group number for LPUART status codes. */ - kStatusGroup_SPI = 14, /*!< Group number for SPI status code.*/ - kStatusGroup_XRDC = 15, /*!< Group number for XRDC status code.*/ - kStatusGroup_SEMA42 = 16, /*!< Group number for SEMA42 status code.*/ - kStatusGroup_SDHC = 17, /*!< Group number for SDHC status code */ - kStatusGroup_SDMMC = 18, /*!< Group number for SDMMC status code */ - kStatusGroup_SAI = 19, /*!< Group number for SAI status code */ - kStatusGroup_MCG = 20, /*!< Group number for MCG status codes. */ - kStatusGroup_SCG = 21, /*!< Group number for SCG status codes. */ - kStatusGroup_SDSPI = 22, /*!< Group number for SDSPI status codes. */ - kStatusGroup_FLEXIO_I2S = 23, /*!< Group number for FLEXIO I2S status codes */ - kStatusGroup_FLEXIO_MCULCD = 24, /*!< Group number for FLEXIO LCD status codes */ - kStatusGroup_FLASHIAP = 25, /*!< Group number for FLASHIAP status codes */ - kStatusGroup_FLEXCOMM_I2C = 26, /*!< Group number for FLEXCOMM I2C status codes */ - kStatusGroup_I2S = 27, /*!< Group number for I2S status codes */ - kStatusGroup_IUART = 28, /*!< Group number for IUART status codes */ - kStatusGroup_CSI = 29, /*!< Group number for CSI status codes */ - kStatusGroup_MIPI_DSI = 30, /*!< Group number for MIPI DSI status codes */ - kStatusGroup_SDRAMC = 35, /*!< Group number for SDRAMC status codes. */ - kStatusGroup_POWER = 39, /*!< Group number for POWER status codes. */ - kStatusGroup_ENET = 40, /*!< Group number for ENET status codes. */ - kStatusGroup_PHY = 41, /*!< Group number for PHY status codes. */ - kStatusGroup_TRGMUX = 42, /*!< Group number for TRGMUX status codes. */ - kStatusGroup_SMARTCARD = 43, /*!< Group number for SMARTCARD status codes. */ - kStatusGroup_LMEM = 44, /*!< Group number for LMEM status codes. */ - kStatusGroup_QSPI = 45, /*!< Group number for QSPI status codes. */ - kStatusGroup_DMA = 50, /*!< Group number for DMA status codes. */ - kStatusGroup_EDMA = 51, /*!< Group number for EDMA status codes. */ - kStatusGroup_DMAMGR = 52, /*!< Group number for DMAMGR status codes. */ - kStatusGroup_FLEXCAN = 53, /*!< Group number for FlexCAN status codes. */ - kStatusGroup_LTC = 54, /*!< Group number for LTC status codes. */ - kStatusGroup_FLEXIO_CAMERA = 55, /*!< Group number for FLEXIO CAMERA status codes. */ - kStatusGroup_LPC_SPI = 56, /*!< Group number for LPC_SPI status codes. */ - kStatusGroup_LPC_USART = 57, /*!< Group number for LPC_USART status codes. */ - kStatusGroup_DMIC = 58, /*!< Group number for DMIC status codes. */ - kStatusGroup_SDIF = 59, /*!< Group number for SDIF status codes.*/ - kStatusGroup_SPIFI = 60, /*!< Group number for SPIFI status codes. */ - kStatusGroup_OTP = 61, /*!< Group number for OTP status codes. */ - kStatusGroup_MCAN = 62, /*!< Group number for MCAN status codes. */ - kStatusGroup_CAAM = 63, /*!< Group number for CAAM status codes. */ - kStatusGroup_ECSPI = 64, /*!< Group number for ECSPI status codes. */ - kStatusGroup_USDHC = 65, /*!< Group number for USDHC status codes.*/ - kStatusGroup_LPC_I2C = 66, /*!< Group number for LPC_I2C status codes.*/ - kStatusGroup_DCP = 67, /*!< Group number for DCP status codes.*/ - kStatusGroup_MSCAN = 68, /*!< Group number for MSCAN status codes.*/ - kStatusGroup_ESAI = 69, /*!< Group number for ESAI status codes. */ - kStatusGroup_FLEXSPI = 70, /*!< Group number for FLEXSPI status codes. */ - kStatusGroup_MMDC = 71, /*!< Group number for MMDC status codes. */ - kStatusGroup_PDM = 72, /*!< Group number for MIC status codes. */ - kStatusGroup_SDMA = 73, /*!< Group number for SDMA status codes. */ - kStatusGroup_ICS = 74, /*!< Group number for ICS status codes. */ - kStatusGroup_SPDIF = 75, /*!< Group number for SPDIF status codes. */ - kStatusGroup_LPC_MINISPI = 76, /*!< Group number for LPC_MINISPI status codes. */ - kStatusGroup_HASHCRYPT = 77, /*!< Group number for Hashcrypt status codes */ - kStatusGroup_LPC_SPI_SSP = 78, /*!< Group number for LPC_SPI_SSP status codes. */ - kStatusGroup_I3C = 79, /*!< Group number for I3C status codes */ - kStatusGroup_LPC_I2C_1 = 97, /*!< Group number for LPC_I2C_1 status codes. */ - kStatusGroup_NOTIFIER = 98, /*!< Group number for NOTIFIER status codes. */ - kStatusGroup_DebugConsole = 99, /*!< Group number for debug console status codes. */ - kStatusGroup_SEMC = 100, /*!< Group number for SEMC status codes. */ - kStatusGroup_ApplicationRangeStart = 101, /*!< Starting number for application groups. */ - kStatusGroup_IAP = 102, /*!< Group number for IAP status codes */ - kStatusGroup_SFA = 103, /*!< Group number for SFA status codes*/ - kStatusGroup_SPC = 104, /*!< Group number for SPC status codes. */ - kStatusGroup_PUF = 105, /*!< Group number for PUF status codes. */ - kStatusGroup_TOUCH_PANEL = 106, /*!< Group number for touch panel status codes */ - kStatusGroup_VBAT = 107, /*!< Group number for VBAT status codes */ - - kStatusGroup_HAL_GPIO = 121, /*!< Group number for HAL GPIO status codes. */ - kStatusGroup_HAL_UART = 122, /*!< Group number for HAL UART status codes. */ - kStatusGroup_HAL_TIMER = 123, /*!< Group number for HAL TIMER status codes. */ - kStatusGroup_HAL_SPI = 124, /*!< Group number for HAL SPI status codes. */ - kStatusGroup_HAL_I2C = 125, /*!< Group number for HAL I2C status codes. */ - kStatusGroup_HAL_FLASH = 126, /*!< Group number for HAL FLASH status codes. */ - kStatusGroup_HAL_PWM = 127, /*!< Group number for HAL PWM status codes. */ - kStatusGroup_HAL_RNG = 128, /*!< Group number for HAL RNG status codes. */ - kStatusGroup_HAL_I2S = 129, /*!< Group number for HAL I2S status codes. */ - kStatusGroup_HAL_ADC_SENSOR = 130, /*!< Group number for HAL ADC SENSOR status codes. */ - kStatusGroup_TIMERMANAGER = 135, /*!< Group number for TiMER MANAGER status codes. */ - kStatusGroup_SERIALMANAGER = 136, /*!< Group number for SERIAL MANAGER status codes. */ - kStatusGroup_LED = 137, /*!< Group number for LED status codes. */ - kStatusGroup_BUTTON = 138, /*!< Group number for BUTTON status codes. */ - kStatusGroup_EXTERN_EEPROM = 139, /*!< Group number for EXTERN EEPROM status codes. */ - kStatusGroup_SHELL = 140, /*!< Group number for SHELL status codes. */ - kStatusGroup_MEM_MANAGER = 141, /*!< Group number for MEM MANAGER status codes. */ - kStatusGroup_LIST = 142, /*!< Group number for List status codes. */ - kStatusGroup_OSA = 143, /*!< Group number for OSA status codes. */ - kStatusGroup_COMMON_TASK = 144, /*!< Group number for Common task status codes. */ - kStatusGroup_MSG = 145, /*!< Group number for messaging status codes. */ - kStatusGroup_SDK_OCOTP = 146, /*!< Group number for OCOTP status codes. */ - kStatusGroup_SDK_FLEXSPINOR = 147, /*!< Group number for FLEXSPINOR status codes.*/ - kStatusGroup_CODEC = 148, /*!< Group number for codec status codes. */ - kStatusGroup_ASRC = 149, /*!< Group number for codec status ASRC. */ - kStatusGroup_OTFAD = 150, /*!< Group number for codec status codes. */ - kStatusGroup_SDIOSLV = 151, /*!< Group number for SDIOSLV status codes. */ - kStatusGroup_MECC = 152, /*!< Group number for MECC status codes. */ - kStatusGroup_ENET_QOS = 153, /*!< Group number for ENET_QOS status codes. */ - kStatusGroup_LOG = 154, /*!< Group number for LOG status codes. */ - kStatusGroup_I3CBUS = 155, /*!< Group number for I3CBUS status codes. */ - kStatusGroup_QSCI = 156, /*!< Group number for QSCI status codes. */ - kStatusGroup_ELEMU = 157, /*!< Group number for ELEMU status codes. */ - kStatusGroup_QUEUEDSPI = 158, /*!< Group number for QSPI status codes. */ - kStatusGroup_POWER_MANAGER = 159, /*!< Group number for POWER_MANAGER status codes. */ - kStatusGroup_IPED = 160, /*!< Group number for IPED status codes. */ - kStatusGroup_ELS_PKC = 161, /*!< Group number for ELS PKC status codes. */ - kStatusGroup_CSS_PKC = 162, /*!< Group number for CSS PKC status codes. */ - kStatusGroup_HOSTIF = 163, /*!< Group number for HOSTIF status codes. */ - kStatusGroup_CLIF = 164, /*!< Group number for CLIF status codes. */ - kStatusGroup_BMA = 165, /*!< Group number for BMA status codes. */ - kStatusGroup_NETC = 166, /*!< Group number for NETC status codes. */ - kStatusGroup_ELE = 167, /*!< Group number for ELE status codes. */ -}; - -/*! \public - * @brief Generic status return codes. - */ -enum -{ - kStatus_Success = MAKE_STATUS(kStatusGroup_Generic, 0), /*!< Generic status for Success. */ - kStatus_Fail = MAKE_STATUS(kStatusGroup_Generic, 1), /*!< Generic status for Fail. */ - kStatus_ReadOnly = MAKE_STATUS(kStatusGroup_Generic, 2), /*!< Generic status for read only failure. */ - kStatus_OutOfRange = MAKE_STATUS(kStatusGroup_Generic, 3), /*!< Generic status for out of range access. */ - kStatus_InvalidArgument = MAKE_STATUS(kStatusGroup_Generic, 4), /*!< Generic status for invalid argument check. */ - kStatus_Timeout = MAKE_STATUS(kStatusGroup_Generic, 5), /*!< Generic status for timeout. */ - kStatus_NoTransferInProgress = - MAKE_STATUS(kStatusGroup_Generic, 6), /*!< Generic status for no transfer in progress. */ - kStatus_Busy = MAKE_STATUS(kStatusGroup_Generic, 7), /*!< Generic status for module is busy. */ - kStatus_NoData = - MAKE_STATUS(kStatusGroup_Generic, 8), /*!< Generic status for no data is found for the operation. */ -}; - -/*! @brief Type used for all status and error return values. */ -typedef int32_t status_t; - -/*! - * @name Min/max macros - * @{ - */ -#if !defined(MIN) -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - -#if !defined(MAX) -#define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif -/* @} */ - -/*! @brief Computes the number of elements in an array. */ -#if !defined(ARRAY_SIZE) -#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) -#endif - -/*! @name UINT16_MAX/UINT32_MAX value */ -/* @{ */ -#if !defined(UINT16_MAX) -#define UINT16_MAX ((uint16_t)-1) -#endif - -#if !defined(UINT32_MAX) -#define UINT32_MAX ((uint32_t)-1) -#endif -/* @} */ - -/*! @name Suppress fallthrough warning macro */ -/* For switch case code block, if case section ends without "break;" statement, there wil be - fallthrough warning with compiler flag -Wextra or -Wimplicit-fallthrough=n when using armgcc. - To suppress this warning, "SUPPRESS_FALL_THROUGH_WARNING();" need to be added at the end of each - case section which misses "break;"statement. - */ -/* @{ */ -#if defined(__GNUC__) && !defined(__ARMCC_VERSION) -#define SUPPRESS_FALL_THROUGH_WARNING() __attribute__((fallthrough)) -#else -#define SUPPRESS_FALL_THROUGH_WARNING() -#endif -/* @} */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -#if !((defined(__DSC__) && defined(__CW__))) -/*! - * @brief Allocate memory with given alignment and aligned size. - * - * This is provided to support the dynamically allocated memory - * used in cache-able region. - * @param size The length required to malloc. - * @param alignbytes The alignment size. - * @retval The allocated memory. - */ -void *SDK_Malloc(size_t size, size_t alignbytes); - -/*! - * @brief Free memory. - * - * @param ptr The memory to be release. - */ -void SDK_Free(void *ptr); -#endif - -/*! - * @brief Delay at least for some time. - * Please note that, this API uses while loop for delay, different run-time environments make the time not precise, - * if precise delay count was needed, please implement a new delay function with hardware timer. - * - * @param delayTime_us Delay time in unit of microsecond. - * @param coreClock_Hz Core clock frequency with Hz. - */ -void SDK_DelayAtLeastUs(uint32_t delayTime_us, uint32_t coreClock_Hz); - -#if defined(__cplusplus) -} -#endif - -/*! @} */ - -#if (defined(__DSC__) && defined(__CW__)) -#include "fsl_common_dsc.h" -#elif defined(__XTENSA__) -#include "fsl_common_dsp.h" -#else -#include "fsl_common_arm.h" -#endif - -#endif /* FSL_COMMON_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_common_arm.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_common_arm.c deleted file mode 100644 index 45c7bb379ad..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_common_arm.c +++ /dev/null @@ -1,249 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_common.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.common_arm" -#endif - -#ifndef __GIC_PRIO_BITS -#if defined(ENABLE_RAM_VECTOR_TABLE) -uint32_t InstallIRQHandler(IRQn_Type irq, uint32_t irqHandler) -{ -#ifdef __VECTOR_TABLE -#undef __VECTOR_TABLE -#endif - -/* Addresses for VECTOR_TABLE and VECTOR_RAM come from the linker file */ -#if defined(__CC_ARM) || defined(__ARMCC_VERSION) - extern uint32_t Image$$VECTOR_ROM$$Base[]; - extern uint32_t Image$$VECTOR_RAM$$Base[]; - extern uint32_t Image$$VECTOR_RAM$$ZI$$Limit[]; - -#define __VECTOR_TABLE Image$$VECTOR_ROM$$Base -#define __VECTOR_RAM Image$$VECTOR_RAM$$Base -#define __RAM_VECTOR_TABLE_SIZE (((uint32_t)Image$$VECTOR_RAM$$ZI$$Limit - (uint32_t)Image$$VECTOR_RAM$$Base)) -#elif defined(__ICCARM__) - extern uint32_t __RAM_VECTOR_TABLE_SIZE[]; - extern uint32_t __VECTOR_TABLE[]; - extern uint32_t __VECTOR_RAM[]; -#elif defined(__GNUC__) - extern uint32_t __VECTOR_TABLE[]; - extern uint32_t __VECTOR_RAM[]; - extern uint32_t __RAM_VECTOR_TABLE_SIZE_BYTES[]; - uint32_t __RAM_VECTOR_TABLE_SIZE = (uint32_t)(__RAM_VECTOR_TABLE_SIZE_BYTES); -#endif /* defined(__CC_ARM) || defined(__ARMCC_VERSION) */ - uint32_t n; - uint32_t ret; - uint32_t irqMaskValue; - - irqMaskValue = DisableGlobalIRQ(); - if (SCB->VTOR != (uint32_t)__VECTOR_RAM) - { - /* Copy the vector table from ROM to RAM */ - for (n = 0; n < ((uint32_t)__RAM_VECTOR_TABLE_SIZE) / sizeof(uint32_t); n++) - { - __VECTOR_RAM[n] = __VECTOR_TABLE[n]; - } - /* Point the VTOR to the position of vector table */ - SCB->VTOR = (uint32_t)__VECTOR_RAM; - } - - ret = __VECTOR_RAM[(int32_t)irq + 16]; - /* make sure the __VECTOR_RAM is noncachable */ - __VECTOR_RAM[(int32_t)irq + 16] = irqHandler; - - EnableGlobalIRQ(irqMaskValue); - - return ret; -} -#endif /* ENABLE_RAM_VECTOR_TABLE. */ -#endif /* __GIC_PRIO_BITS. */ - -#if (defined(FSL_FEATURE_SOC_SYSCON_COUNT) && (FSL_FEATURE_SOC_SYSCON_COUNT > 0)) - -/* - * When FSL_FEATURE_POWERLIB_EXTEND is defined to non-zero value, - * powerlib should be used instead of these functions. - */ -#if !(defined(FSL_FEATURE_POWERLIB_EXTEND) && (FSL_FEATURE_POWERLIB_EXTEND != 0)) - -/* - * When the SYSCON STARTER registers are discontinuous, these functions are - * implemented in fsl_power.c. - */ -#if !(defined(FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS) && FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS) - -void EnableDeepSleepIRQ(IRQn_Type interrupt) -{ - uint32_t intNumber = (uint32_t)interrupt; - - uint32_t index = 0; - - while (intNumber >= 32u) - { - index++; - intNumber -= 32u; - } - - SYSCON->STARTERSET[index] = 1UL << intNumber; - (void)EnableIRQ(interrupt); /* also enable interrupt at NVIC */ -} - -void DisableDeepSleepIRQ(IRQn_Type interrupt) -{ - uint32_t intNumber = (uint32_t)interrupt; - - (void)DisableIRQ(interrupt); /* also disable interrupt at NVIC */ - uint32_t index = 0; - - while (intNumber >= 32u) - { - index++; - intNumber -= 32u; - } - - SYSCON->STARTERCLR[index] = 1UL << intNumber; -} -#endif /* FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS */ -#endif /* FSL_FEATURE_POWERLIB_EXTEND */ -#endif /* FSL_FEATURE_SOC_SYSCON_COUNT */ - -#if defined(DWT) -/* Use WDT. */ -void MSDK_EnableCpuCycleCounter(void) -{ - /* Make sure the DWT trace fucntion is enabled. */ - if (CoreDebug_DEMCR_TRCENA_Msk != (CoreDebug_DEMCR_TRCENA_Msk & CoreDebug->DEMCR)) - { - CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; - } - - /* CYCCNT not supported on this device. */ - assert(DWT_CTRL_NOCYCCNT_Msk != (DWT->CTRL & DWT_CTRL_NOCYCCNT_Msk)); - - /* Read CYCCNT directly if CYCCENT has already been enabled, otherwise enable CYCCENT first. */ - if (DWT_CTRL_CYCCNTENA_Msk != (DWT_CTRL_CYCCNTENA_Msk & DWT->CTRL)) - { - DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk; - } -} - -uint32_t MSDK_GetCpuCycleCount(void) -{ - return DWT->CYCCNT; -} -#endif /* defined(DWT) */ - -#if !(defined(SDK_DELAY_USE_DWT) && defined(DWT)) -/* Use software loop. */ -#if defined(__CC_ARM) /* This macro is arm v5 specific */ -/* clang-format off */ -__ASM static void DelayLoop(uint32_t count) -{ -loop - SUBS R0, R0, #1 - CMP R0, #0 - BNE loop - BX LR -} -#elif defined(__ARM_ARCH_8A__) /* This macro is ARMv8-A specific */ -static void DelayLoop(uint32_t count) -{ - __ASM volatile(" MOV X0, %0" : : "r"(count)); - __ASM volatile( - "loop: \n" - " SUB X0, X0, #1 \n" - " CMP X0, #0 \n" - - " BNE loop \n" - : - : - : "r0"); -} -/* clang-format on */ -#elif defined(__ARMCC_VERSION) || defined(__ICCARM__) || defined(__GNUC__) -/* Cortex-M0 has a smaller instruction set, SUBS isn't supported in thumb-16 mode reported from __GNUC__ compiler, - * use SUB and CMP here for compatibility */ -static void DelayLoop(uint32_t count) -{ - __ASM volatile(" MOV R0, %0" : : "r"(count)); - __ASM volatile( - "loop: \n" -#if defined(__GNUC__) && !defined(__ARMCC_VERSION) - " SUB R0, R0, #1 \n" -#else - " SUBS R0, R0, #1 \n" -#endif - " CMP R0, #0 \n" - - " BNE loop \n" - : - : - : "r0"); -} -#endif /* defined(__CC_ARM) */ -#endif /* defined(SDK_DELAY_USE_DWT) && defined(DWT) */ - -/*! - * @brief Delay at least for some time. - * Please note that, if not uses DWT, this API will use while loop for delay, different run-time environments have - * effect on the delay time. If precise delay is needed, please enable DWT delay. The two parmeters delayTime_us and - * coreClock_Hz have limitation. For example, in the platform with 1GHz coreClock_Hz, the delayTime_us only supports - * up to 4294967 in current code. If long time delay is needed, please implement a new delay function. - * - * @param delayTime_us Delay time in unit of microsecond. - * @param coreClock_Hz Core clock frequency with Hz. - */ -void SDK_DelayAtLeastUs(uint32_t delayTime_us, uint32_t coreClock_Hz) -{ - uint64_t count; - - if (delayTime_us > 0U) - { - count = USEC_TO_COUNT(delayTime_us, coreClock_Hz); - - assert(count <= UINT32_MAX); - -#if defined(SDK_DELAY_USE_DWT) && defined(DWT) /* Use DWT for better accuracy */ - - MSDK_EnableCpuCycleCounter(); - /* Calculate the count ticks. */ - count += MSDK_GetCpuCycleCount(); - - if (count > UINT32_MAX) - { - count -= UINT32_MAX; - /* Wait for cyccnt overflow. */ - while (count < MSDK_GetCpuCycleCount()) - { - } - } - - /* Wait for cyccnt reach count value. */ - while (count > MSDK_GetCpuCycleCount()) - { - } -#else - /* Divide value may be different in various environment to ensure delay is precise. - * Every loop count includes three instructions, due to Cortex-M7 sometimes executes - * two instructions in one period, through test here set divide 1.5. Other M cores use - * divide 4. By the way, divide 1.5 or 4 could let the count lose precision, but it does - * not matter because other instructions outside while loop is enough to fill the time. - */ -#if (__CORTEX_M == 7) - count = count / 3U * 2U; -#else - count = count / 4U; -#endif - DelayLoop((uint32_t)count); -#endif /* defined(SDK_DELAY_USE_DWT) && defined(DWT) */ - } -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_common_arm.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_common_arm.h deleted file mode 100644 index e5004d703be..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_common_arm.h +++ /dev/null @@ -1,842 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_COMMON_ARM_H_ -#define FSL_COMMON_ARM_H_ - -/* - * For CMSIS pack RTE. - * CMSIS pack RTE generates "RTC_Components.h" which contains the statements - * of the related element for all selected software components. - */ -#ifdef _RTE_ -#include "RTE_Components.h" -#endif - -/*! - * @addtogroup ksdk_common - * @{ - */ - -/*! @name Atomic modification - * - * These macros are used for atomic access, such as read-modify-write - * to the peripheral registers. - * - * - SDK_ATOMIC_LOCAL_ADD - * - SDK_ATOMIC_LOCAL_SET - * - SDK_ATOMIC_LOCAL_CLEAR - * - SDK_ATOMIC_LOCAL_TOGGLE - * - SDK_ATOMIC_LOCAL_CLEAR_AND_SET - * - * Take SDK_ATOMIC_LOCAL_CLEAR_AND_SET as an example: the parameter @c addr - * means the address of the peripheral register or variable you want to modify - * atomically, the parameter @c clearBits is the bits to clear, the parameter - * @c setBits it the bits to set. - * For example, to set a 32-bit register bit1:bit0 to 0b10, use like this: - * - * @code - volatile uint32_t * reg = (volatile uint32_t *)REG_ADDR; - - SDK_ATOMIC_LOCAL_CLEAR_AND_SET(reg, 0x03, 0x02); - @endcode - * - * In this example, the register bit1:bit0 are cleared and bit1 is set, as a result, - * register bit1:bit0 = 0b10. - * - * @note For the platforms don't support exclusive load and store, these macros - * disable the global interrupt to pretect the modification. - * - * @note These macros only guarantee the local processor atomic operations. For - * the multi-processor devices, use hardware semaphore such as SEMA42 to - * guarantee exclusive access if necessary. - * - * @{ - */ - -/* clang-format off */ -#if ((defined(__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined(__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined(__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined(__ARM_ARCH_8M_BASE__) && (__ARM_ARCH_8M_BASE__ == 1))) -/* clang-format on */ - -/* If the LDREX and STREX are supported, use them. */ -#define _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, val, ops) \ - do \ - { \ - (val) = __LDREXB(addr); \ - (ops); \ - } while (0UL != __STREXB((val), (addr))) - -#define _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, val, ops) \ - do \ - { \ - (val) = __LDREXH(addr); \ - (ops); \ - } while (0UL != __STREXH((val), (addr))) - -#define _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, val, ops) \ - do \ - { \ - (val) = __LDREXW(addr); \ - (ops); \ - } while (0UL != __STREXW((val), (addr))) - -static inline void _SDK_AtomicLocalAdd1Byte(volatile uint8_t *addr, uint8_t val) -{ - uint8_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, s_val, s_val += val); -} - -static inline void _SDK_AtomicLocalAdd2Byte(volatile uint16_t *addr, uint16_t val) -{ - uint16_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, s_val, s_val += val); -} - -static inline void _SDK_AtomicLocalAdd4Byte(volatile uint32_t *addr, uint32_t val) -{ - uint32_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, s_val, s_val += val); -} - -static inline void _SDK_AtomicLocalSub1Byte(volatile uint8_t *addr, uint8_t val) -{ - uint8_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, s_val, s_val -= val); -} - -static inline void _SDK_AtomicLocalSub2Byte(volatile uint16_t *addr, uint16_t val) -{ - uint16_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, s_val, s_val -= val); -} - -static inline void _SDK_AtomicLocalSub4Byte(volatile uint32_t *addr, uint32_t val) -{ - uint32_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, s_val, s_val -= val); -} - -static inline void _SDK_AtomicLocalSet1Byte(volatile uint8_t *addr, uint8_t bits) -{ - uint8_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, s_val, s_val |= bits); -} - -static inline void _SDK_AtomicLocalSet2Byte(volatile uint16_t *addr, uint16_t bits) -{ - uint16_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, s_val, s_val |= bits); -} - -static inline void _SDK_AtomicLocalSet4Byte(volatile uint32_t *addr, uint32_t bits) -{ - uint32_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, s_val, s_val |= bits); -} - -static inline void _SDK_AtomicLocalClear1Byte(volatile uint8_t *addr, uint8_t bits) -{ - uint8_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, s_val, s_val &= ~bits); -} - -static inline void _SDK_AtomicLocalClear2Byte(volatile uint16_t *addr, uint16_t bits) -{ - uint16_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, s_val, s_val &= ~bits); -} - -static inline void _SDK_AtomicLocalClear4Byte(volatile uint32_t *addr, uint32_t bits) -{ - uint32_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, s_val, s_val &= ~bits); -} - -static inline void _SDK_AtomicLocalToggle1Byte(volatile uint8_t *addr, uint8_t bits) -{ - uint8_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, s_val, s_val ^= bits); -} - -static inline void _SDK_AtomicLocalToggle2Byte(volatile uint16_t *addr, uint16_t bits) -{ - uint16_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, s_val, s_val ^= bits); -} - -static inline void _SDK_AtomicLocalToggle4Byte(volatile uint32_t *addr, uint32_t bits) -{ - uint32_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, s_val, s_val ^= bits); -} - -static inline void _SDK_AtomicLocalClearAndSet1Byte(volatile uint8_t *addr, uint8_t clearBits, uint8_t setBits) -{ - uint8_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, s_val, s_val = (s_val & ~clearBits) | setBits); -} - -static inline void _SDK_AtomicLocalClearAndSet2Byte(volatile uint16_t *addr, uint16_t clearBits, uint16_t setBits) -{ - uint16_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, s_val, s_val = (s_val & ~clearBits) | setBits); -} - -static inline void _SDK_AtomicLocalClearAndSet4Byte(volatile uint32_t *addr, uint32_t clearBits, uint32_t setBits) -{ - uint32_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, s_val, s_val = (s_val & ~clearBits) | setBits); -} - -#define SDK_ATOMIC_LOCAL_ADD(addr, val) \ - ((1UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalAdd1Byte((volatile uint8_t *)(volatile void *)(addr), (uint8_t)(val)) : \ - ((2UL == sizeof(*(addr))) ? _SDK_AtomicLocalAdd2Byte((volatile uint16_t *)(volatile void *)(addr), (uint16_t)(val)) : \ - _SDK_AtomicLocalAdd4Byte((volatile uint32_t *)(volatile void *)(addr), (uint32_t)(val)))) - -#define SDK_ATOMIC_LOCAL_SUB(addr, val) \ - ((1UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalSub1Byte((volatile uint8_t *)(volatile void *)(addr), (uint8_t)(val)) : \ - ((2UL == sizeof(*(addr))) ? _SDK_AtomicLocalSub2Byte((volatile uint16_t *)(volatile void *)(addr), (uint16_t)(val)) : \ - _SDK_AtomicLocalSub4Byte((volatile uint32_t *)(volatile void *)(addr), (uint32_t)(val)))) - -#define SDK_ATOMIC_LOCAL_SET(addr, bits) \ - ((1UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalSet1Byte((volatile uint8_t *)(volatile void *)(addr), (uint8_t)(bits)) : \ - ((2UL == sizeof(*(addr))) ? _SDK_AtomicLocalSet2Byte((volatile uint16_t *)(volatile void *)(addr), (uint16_t)(bits)) : \ - _SDK_AtomicLocalSet4Byte((volatile uint32_t *)(volatile void *)(addr), (uint32_t)(bits)))) - -#define SDK_ATOMIC_LOCAL_CLEAR(addr, bits) \ - ((1UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalClear1Byte((volatile uint8_t *)(volatile void *)(addr), (uint8_t)(bits)) : \ - ((2UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalClear2Byte((volatile uint16_t *)(volatile void *)(addr), (uint16_t)(bits)) : \ - _SDK_AtomicLocalClear4Byte((volatile uint32_t *)(volatile void *)(addr), (uint32_t)(bits)))) - -#define SDK_ATOMIC_LOCAL_TOGGLE(addr, bits) \ - ((1UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalToggle1Byte((volatile uint8_t *)(volatile void *)(addr), (uint8_t)(bits)) : \ - ((2UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalToggle2Byte((volatile uint16_t *)(volatile void *)(addr), (uint16_t)(bits)) : \ - _SDK_AtomicLocalToggle4Byte((volatile uint32_t *)(volatile void *)(addr), (uint32_t)(bits)))) - -#define SDK_ATOMIC_LOCAL_CLEAR_AND_SET(addr, clearBits, setBits) \ - ((1UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalClearAndSet1Byte((volatile uint8_t *)(volatile void *)(addr), (uint8_t)(clearBits), (uint8_t)(setBits)) : \ - ((2UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalClearAndSet2Byte((volatile uint16_t *)(volatile void *)(addr), (uint16_t)(clearBits), (uint16_t)(setBits)) : \ - _SDK_AtomicLocalClearAndSet4Byte((volatile uint32_t *)(volatile void *)(addr), (uint32_t)(clearBits), (uint32_t)(setBits)))) -#else - -#define SDK_ATOMIC_LOCAL_ADD(addr, val) \ - do \ - { \ - uint32_t s_atomicOldInt; \ - s_atomicOldInt = DisableGlobalIRQ(); \ - *(addr) += (val); \ - EnableGlobalIRQ(s_atomicOldInt); \ - } while (false) - -#define SDK_ATOMIC_LOCAL_SUB(addr, val) \ - do \ - { \ - uint32_t s_atomicOldInt; \ - s_atomicOldInt = DisableGlobalIRQ(); \ - *(addr) -= (val); \ - EnableGlobalIRQ(s_atomicOldInt); \ - } while (false) - -#define SDK_ATOMIC_LOCAL_SET(addr, bits) \ - do \ - { \ - uint32_t s_atomicOldInt; \ - s_atomicOldInt = DisableGlobalIRQ(); \ - *(addr) |= (bits); \ - EnableGlobalIRQ(s_atomicOldInt); \ - } while (false) - -#define SDK_ATOMIC_LOCAL_CLEAR(addr, bits) \ - do \ - { \ - uint32_t s_atomicOldInt; \ - s_atomicOldInt = DisableGlobalIRQ(); \ - *(addr) &= ~(bits); \ - EnableGlobalIRQ(s_atomicOldInt); \ - } while (false) - -#define SDK_ATOMIC_LOCAL_TOGGLE(addr, bits) \ - do \ - { \ - uint32_t s_atomicOldInt; \ - s_atomicOldInt = DisableGlobalIRQ(); \ - *(addr) ^= (bits); \ - EnableGlobalIRQ(s_atomicOldInt); \ - } while (false) - -#define SDK_ATOMIC_LOCAL_CLEAR_AND_SET(addr, clearBits, setBits) \ - do \ - { \ - uint32_t s_atomicOldInt; \ - s_atomicOldInt = DisableGlobalIRQ(); \ - *(addr) = (*(addr) & ~(clearBits)) | (setBits); \ - EnableGlobalIRQ(s_atomicOldInt); \ - } while (false) - -#endif -/* @} */ - -/*! @name Timer utilities */ -/* @{ */ -/*! Macro to convert a microsecond period to raw count value */ -#define USEC_TO_COUNT(us, clockFreqInHz) (uint64_t)(((uint64_t)(us) * (clockFreqInHz)) / 1000000U) -/*! Macro to convert a raw count value to microsecond */ -#define COUNT_TO_USEC(count, clockFreqInHz) (uint64_t)((uint64_t)(count)*1000000U / (clockFreqInHz)) - -/*! Macro to convert a millisecond period to raw count value */ -#define MSEC_TO_COUNT(ms, clockFreqInHz) (uint64_t)((uint64_t)(ms) * (clockFreqInHz) / 1000U) -/*! Macro to convert a raw count value to millisecond */ -#define COUNT_TO_MSEC(count, clockFreqInHz) (uint64_t)((uint64_t)(count)*1000U / (clockFreqInHz)) -/* @} */ - -/*! @name ISR exit barrier - * @{ - * - * ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping - * exception return operation might vector to incorrect interrupt. - * For Cortex-M7, if core speed much faster than peripheral register write speed, - * the peripheral interrupt flags may be still set after exiting ISR, this results to - * the same error similar with errata 83869. - */ -#if (defined __CORTEX_M) && ((__CORTEX_M == 4U) || (__CORTEX_M == 7U)) -#define SDK_ISR_EXIT_BARRIER __DSB() -#else -#define SDK_ISR_EXIT_BARRIER -#endif - -/* @} */ - -/*! @name Alignment variable definition macros */ -/* @{ */ -#if (defined(__ICCARM__)) -/* - * Workaround to disable MISRA C message suppress warnings for IAR compiler. - * http:/ /supp.iar.com/Support/?note=24725 - */ -_Pragma("diag_suppress=Pm120") -#define SDK_PRAGMA(x) _Pragma(#x) - _Pragma("diag_error=Pm120") -/*! Macro to define a variable with alignbytes alignment */ -#define SDK_ALIGN(var, alignbytes) SDK_PRAGMA(data_alignment = alignbytes) var -#elif defined(__CC_ARM) || defined(__ARMCC_VERSION) -/*! Macro to define a variable with alignbytes alignment */ -#define SDK_ALIGN(var, alignbytes) __attribute__((aligned(alignbytes))) var -#elif defined(__GNUC__) -/*! Macro to define a variable with alignbytes alignment */ -#define SDK_ALIGN(var, alignbytes) var __attribute__((aligned(alignbytes))) -#else -#error Toolchain not supported -#endif - -/*! Macro to define a variable with L1 d-cache line size alignment */ -#if defined(FSL_FEATURE_L1DCACHE_LINESIZE_BYTE) -#define SDK_L1DCACHE_ALIGN(var) SDK_ALIGN(var, FSL_FEATURE_L1DCACHE_LINESIZE_BYTE) -#endif -/*! Macro to define a variable with L2 cache line size alignment */ -#if defined(FSL_FEATURE_L2CACHE_LINESIZE_BYTE) -#define SDK_L2CACHE_ALIGN(var) SDK_ALIGN(var, FSL_FEATURE_L2CACHE_LINESIZE_BYTE) -#endif - -/*! Macro to change a value to a given size aligned value */ -#define SDK_SIZEALIGN(var, alignbytes) \ - ((unsigned int)((var) + ((alignbytes)-1U)) & (unsigned int)(~(unsigned int)((alignbytes)-1U))) -/* @} */ - -/*! @name Non-cacheable region definition macros */ -/* For initialized non-zero non-cacheable variables, please using "AT_NONCACHEABLE_SECTION_INIT(var) ={xx};" or - * "AT_NONCACHEABLE_SECTION_ALIGN_INIT(var) ={xx};" in your projects to define them, for zero-inited non-cacheable - * variables, please using "AT_NONCACHEABLE_SECTION(var);" or "AT_NONCACHEABLE_SECTION_ALIGN(var);" to define them, - * these zero-inited variables will be initialized to zero in system startup. - */ -/* @{ */ - -#if ((!(defined(FSL_FEATURE_HAS_NO_NONCACHEABLE_SECTION) && FSL_FEATURE_HAS_NO_NONCACHEABLE_SECTION)) && \ - defined(FSL_FEATURE_L1ICACHE_LINESIZE_BYTE)) - -#if (defined(__ICCARM__)) -#define AT_NONCACHEABLE_SECTION(var) var @"NonCacheable" -#define AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) SDK_PRAGMA(data_alignment = alignbytes) var @"NonCacheable" -#define AT_NONCACHEABLE_SECTION_INIT(var) var @"NonCacheable.init" -#define AT_NONCACHEABLE_SECTION_ALIGN_INIT(var, alignbytes) \ - SDK_PRAGMA(data_alignment = alignbytes) var @"NonCacheable.init" - -#elif (defined(__CC_ARM) || defined(__ARMCC_VERSION)) -#define AT_NONCACHEABLE_SECTION_INIT(var) __attribute__((section("NonCacheable.init"))) var -#define AT_NONCACHEABLE_SECTION_ALIGN_INIT(var, alignbytes) \ - __attribute__((section("NonCacheable.init"))) __attribute__((aligned(alignbytes))) var -#if (defined(__CC_ARM)) -#define AT_NONCACHEABLE_SECTION(var) __attribute__((section("NonCacheable"), zero_init)) var -#define AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) \ - __attribute__((section("NonCacheable"), zero_init)) __attribute__((aligned(alignbytes))) var -#else -#define AT_NONCACHEABLE_SECTION(var) __attribute__((section(".bss.NonCacheable"))) var -#define AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) \ - __attribute__((section(".bss.NonCacheable"))) __attribute__((aligned(alignbytes))) var -#endif - -#elif (defined(__GNUC__)) -/* For GCC, when the non-cacheable section is required, please define "__STARTUP_INITIALIZE_NONCACHEDATA" - * in your projects to make sure the non-cacheable section variables will be initialized in system startup. - */ -#define AT_NONCACHEABLE_SECTION_INIT(var) __attribute__((section("NonCacheable.init"))) var -#define AT_NONCACHEABLE_SECTION_ALIGN_INIT(var, alignbytes) \ - __attribute__((section("NonCacheable.init"))) var __attribute__((aligned(alignbytes))) -#define AT_NONCACHEABLE_SECTION(var) __attribute__((section("NonCacheable,\"aw\",%nobits @"))) var -#define AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) \ - __attribute__((section("NonCacheable,\"aw\",%nobits @"))) var __attribute__((aligned(alignbytes))) -#else -#error Toolchain not supported. -#endif - -#else - -#define AT_NONCACHEABLE_SECTION(var) var -#define AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) SDK_ALIGN(var, alignbytes) -#define AT_NONCACHEABLE_SECTION_INIT(var) var -#define AT_NONCACHEABLE_SECTION_ALIGN_INIT(var, alignbytes) SDK_ALIGN(var, alignbytes) - -#endif - -/* @} */ - -/*! - * @name Time sensitive region - * @{ - */ -#if (defined(__ICCARM__)) -#define AT_QUICKACCESS_SECTION_CODE(func) func @"CodeQuickAccess" -#define AT_QUICKACCESS_SECTION_DATA(var) var @"DataQuickAccess" -#define AT_QUICKACCESS_SECTION_DATA_ALIGN(var, alignbytes) \ - SDK_PRAGMA(data_alignment = alignbytes) var @"DataQuickAccess" -#elif (defined(__CC_ARM) || defined(__ARMCC_VERSION)) -#define AT_QUICKACCESS_SECTION_CODE(func) __attribute__((section("CodeQuickAccess"), __noinline__)) func -#define AT_QUICKACCESS_SECTION_DATA(var) __attribute__((section("DataQuickAccess"))) var -#define AT_QUICKACCESS_SECTION_DATA_ALIGN(var, alignbytes) \ - __attribute__((section("DataQuickAccess"))) __attribute__((aligned(alignbytes))) var -#elif (defined(__GNUC__)) -#define AT_QUICKACCESS_SECTION_CODE(func) __attribute__((section("CodeQuickAccess"), __noinline__)) func -#define AT_QUICKACCESS_SECTION_DATA(var) __attribute__((section("DataQuickAccess"))) var -#define AT_QUICKACCESS_SECTION_DATA_ALIGN(var, alignbytes) \ - __attribute__((section("DataQuickAccess"))) var __attribute__((aligned(alignbytes))) -#else -#error Toolchain not supported. -#endif /* defined(__ICCARM__) */ - -/*! @name Ram Function */ -#if (defined(__ICCARM__)) -#define RAMFUNCTION_SECTION_CODE(func) func @"RamFunction" -#elif (defined(__CC_ARM) || defined(__ARMCC_VERSION)) -#define RAMFUNCTION_SECTION_CODE(func) __attribute__((section("RamFunction"))) func -#elif (defined(__GNUC__)) -#define RAMFUNCTION_SECTION_CODE(func) __attribute__((section("RamFunction"))) func -#else -#error Toolchain not supported. -#endif /* defined(__ICCARM__) */ -/* @} */ - -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - void DefaultISR(void); -#endif - -/* - * The fsl_clock.h is included here because it needs MAKE_VERSION/MAKE_STATUS/status_t - * defined in previous of this file. - */ -#include "fsl_clock.h" - -/* - * Chip level peripheral reset API, for MCUs that implement peripheral reset control external to a peripheral - */ -#if ((defined(FSL_FEATURE_SOC_SYSCON_COUNT) && (FSL_FEATURE_SOC_SYSCON_COUNT > 0)) || \ - (defined(FSL_FEATURE_SOC_ASYNC_SYSCON_COUNT) && (FSL_FEATURE_SOC_ASYNC_SYSCON_COUNT > 0))) -#include "fsl_reset.h" -#endif - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus*/ - -/*! - * @brief Enable specific interrupt. - * - * Enable LEVEL1 interrupt. For some devices, there might be multiple interrupt - * levels. For example, there are NVIC and intmux. Here the interrupts connected - * to NVIC are the LEVEL1 interrupts, because they are routed to the core directly. - * The interrupts connected to intmux are the LEVEL2 interrupts, they are routed - * to NVIC first then routed to core. - * - * This function only enables the LEVEL1 interrupts. The number of LEVEL1 interrupts - * is indicated by the feature macro FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS. - * - * @param interrupt The IRQ number. - * @retval kStatus_Success Interrupt enabled successfully - * @retval kStatus_Fail Failed to enable the interrupt - */ -static inline status_t EnableIRQ(IRQn_Type interrupt) -{ - status_t status = kStatus_Success; - - if (NotAvail_IRQn == interrupt) - { - status = kStatus_Fail; - } - -#if defined(FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) && (FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS > 0) - else if ((int32_t)interrupt >= (int32_t)FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) - { - status = kStatus_Fail; - } -#endif - - else - { -#if defined(__GIC_PRIO_BITS) - GIC_EnableIRQ(interrupt); -#else - NVIC_EnableIRQ(interrupt); -#endif - } - - return status; -} - -/*! - * @brief Disable specific interrupt. - * - * Disable LEVEL1 interrupt. For some devices, there might be multiple interrupt - * levels. For example, there are NVIC and intmux. Here the interrupts connected - * to NVIC are the LEVEL1 interrupts, because they are routed to the core directly. - * The interrupts connected to intmux are the LEVEL2 interrupts, they are routed - * to NVIC first then routed to core. - * - * This function only disables the LEVEL1 interrupts. The number of LEVEL1 interrupts - * is indicated by the feature macro FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS. - * - * @param interrupt The IRQ number. - * @retval kStatus_Success Interrupt disabled successfully - * @retval kStatus_Fail Failed to disable the interrupt - */ -static inline status_t DisableIRQ(IRQn_Type interrupt) -{ - status_t status = kStatus_Success; - - if (NotAvail_IRQn == interrupt) - { - status = kStatus_Fail; - } - -#if defined(FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) && (FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS > 0) - else if ((int32_t)interrupt >= (int32_t)FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) - { - status = kStatus_Fail; - } -#endif - - else - { -#if defined(__GIC_PRIO_BITS) - GIC_DisableIRQ(interrupt); -#else - NVIC_DisableIRQ(interrupt); -#endif - } - - return status; -} - -/*! - * @brief Enable the IRQ, and also set the interrupt priority. - * - * Only handle LEVEL1 interrupt. For some devices, there might be multiple interrupt - * levels. For example, there are NVIC and intmux. Here the interrupts connected - * to NVIC are the LEVEL1 interrupts, because they are routed to the core directly. - * The interrupts connected to intmux are the LEVEL2 interrupts, they are routed - * to NVIC first then routed to core. - * - * This function only handles the LEVEL1 interrupts. The number of LEVEL1 interrupts - * is indicated by the feature macro FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS. - * - * @param interrupt The IRQ to Enable. - * @param priNum Priority number set to interrupt controller register. - * @retval kStatus_Success Interrupt priority set successfully - * @retval kStatus_Fail Failed to set the interrupt priority. - */ -static inline status_t EnableIRQWithPriority(IRQn_Type interrupt, uint8_t priNum) -{ - status_t status = kStatus_Success; - - if (NotAvail_IRQn == interrupt) - { - status = kStatus_Fail; - } - -#if defined(FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) && (FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS > 0) - else if ((int32_t)interrupt >= (int32_t)FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) - { - status = kStatus_Fail; - } -#endif - - else - { -#if defined(__GIC_PRIO_BITS) - GIC_SetPriority(interrupt, priNum); - GIC_EnableIRQ(interrupt); -#else - NVIC_SetPriority(interrupt, priNum); - NVIC_EnableIRQ(interrupt); -#endif - } - - return status; -} - -/*! - * @brief Set the IRQ priority. - * - * Only handle LEVEL1 interrupt. For some devices, there might be multiple interrupt - * levels. For example, there are NVIC and intmux. Here the interrupts connected - * to NVIC are the LEVEL1 interrupts, because they are routed to the core directly. - * The interrupts connected to intmux are the LEVEL2 interrupts, they are routed - * to NVIC first then routed to core. - * - * This function only handles the LEVEL1 interrupts. The number of LEVEL1 interrupts - * is indicated by the feature macro FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS. - * - * @param interrupt The IRQ to set. - * @param priNum Priority number set to interrupt controller register. - * - * @retval kStatus_Success Interrupt priority set successfully - * @retval kStatus_Fail Failed to set the interrupt priority. - */ -static inline status_t IRQ_SetPriority(IRQn_Type interrupt, uint8_t priNum) -{ - status_t status = kStatus_Success; - - if (NotAvail_IRQn == interrupt) - { - status = kStatus_Fail; - } - -#if defined(FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) && (FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS > 0) - else if ((int32_t)interrupt >= (int32_t)FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) - { - status = kStatus_Fail; - } -#endif - - else - { -#if defined(__GIC_PRIO_BITS) - GIC_SetPriority(interrupt, priNum); -#else - NVIC_SetPriority(interrupt, priNum); -#endif - } - - return status; -} - -/*! - * @brief Clear the pending IRQ flag. - * - * Only handle LEVEL1 interrupt. For some devices, there might be multiple interrupt - * levels. For example, there are NVIC and intmux. Here the interrupts connected - * to NVIC are the LEVEL1 interrupts, because they are routed to the core directly. - * The interrupts connected to intmux are the LEVEL2 interrupts, they are routed - * to NVIC first then routed to core. - * - * This function only handles the LEVEL1 interrupts. The number of LEVEL1 interrupts - * is indicated by the feature macro FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS. - * - * @param interrupt The flag which IRQ to clear. - * - * @retval kStatus_Success Interrupt priority set successfully - * @retval kStatus_Fail Failed to set the interrupt priority. - */ -static inline status_t IRQ_ClearPendingIRQ(IRQn_Type interrupt) -{ - status_t status = kStatus_Success; - - if (NotAvail_IRQn == interrupt) - { - status = kStatus_Fail; - } - -#if defined(FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) && (FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS > 0) - else if ((int32_t)interrupt >= (int32_t)FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) - { - status = kStatus_Fail; - } -#endif - - else - { -#if defined(__GIC_PRIO_BITS) - GIC_ClearPendingIRQ(interrupt); -#else - NVIC_ClearPendingIRQ(interrupt); -#endif - } - - return status; -} - -/*! - * @brief Disable the global IRQ - * - * Disable the global interrupt and return the current primask register. User is required to provided the primask - * register for the EnableGlobalIRQ(). - * - * @return Current primask value. - */ -static inline uint32_t DisableGlobalIRQ(void) -{ - uint32_t mask; - -#if defined(CPSR_I_Msk) - mask = __get_CPSR() & CPSR_I_Msk; -#elif defined(DAIF_I_BIT) - mask = __get_DAIF() & DAIF_I_BIT; -#else - mask = __get_PRIMASK(); -#endif - __disable_irq(); - - return mask; -} - -/*! - * @brief Enable the global IRQ - * - * Set the primask register with the provided primask value but not just enable the primask. The idea is for the - * convenience of integration of RTOS. some RTOS get its own management mechanism of primask. User is required to - * use the EnableGlobalIRQ() and DisableGlobalIRQ() in pair. - * - * @param primask value of primask register to be restored. The primask value is supposed to be provided by the - * DisableGlobalIRQ(). - */ -static inline void EnableGlobalIRQ(uint32_t primask) -{ -#if defined(CPSR_I_Msk) - __set_CPSR((__get_CPSR() & ~CPSR_I_Msk) | primask); -#elif defined(DAIF_I_BIT) - if (0UL == primask) - { - __enable_irq(); - } -#else - __set_PRIMASK(primask); -#endif -} - -#if defined(ENABLE_RAM_VECTOR_TABLE) -/*! - * @brief install IRQ handler - * - * @param irq IRQ number - * @param irqHandler IRQ handler address - * @return The old IRQ handler address - */ -uint32_t InstallIRQHandler(IRQn_Type irq, uint32_t irqHandler); -#endif /* ENABLE_RAM_VECTOR_TABLE. */ - -#if (defined(FSL_FEATURE_SOC_SYSCON_COUNT) && (FSL_FEATURE_SOC_SYSCON_COUNT > 0)) - -/* - * When FSL_FEATURE_POWERLIB_EXTEND is defined to non-zero value, - * powerlib should be used instead of these functions. - */ -#if !(defined(FSL_FEATURE_POWERLIB_EXTEND) && (FSL_FEATURE_POWERLIB_EXTEND != 0)) -/*! - * @brief Enable specific interrupt for wake-up from deep-sleep mode. - * - * Enable the interrupt for wake-up from deep sleep mode. - * Some interrupts are typically used in sleep mode only and will not occur during - * deep-sleep mode because relevant clocks are stopped. However, it is possible to enable - * those clocks (significantly increasing power consumption in the reduced power mode), - * making these wake-ups possible. - * - * @note This function also enables the interrupt in the NVIC (EnableIRQ() is called internaly). - * - * @param interrupt The IRQ number. - */ -void EnableDeepSleepIRQ(IRQn_Type interrupt); - -/*! - * @brief Disable specific interrupt for wake-up from deep-sleep mode. - * - * Disable the interrupt for wake-up from deep sleep mode. - * Some interrupts are typically used in sleep mode only and will not occur during - * deep-sleep mode because relevant clocks are stopped. However, it is possible to enable - * those clocks (significantly increasing power consumption in the reduced power mode), - * making these wake-ups possible. - * - * @note This function also disables the interrupt in the NVIC (DisableIRQ() is called internaly). - * - * @param interrupt The IRQ number. - */ -void DisableDeepSleepIRQ(IRQn_Type interrupt); -#endif /* FSL_FEATURE_POWERLIB_EXTEND */ -#endif /* FSL_FEATURE_SOC_SYSCON_COUNT */ - -#if defined(DWT) -/*! - * @brief Enable the counter to get CPU cycles. - */ -void MSDK_EnableCpuCycleCounter(void); - -/*! - * @brief Get the current CPU cycle count. - * - * @return Current CPU cycle count. - */ -uint32_t MSDK_GetCpuCycleCount(void); -#endif - -#if defined(__cplusplus) -} -#endif /* __cplusplus*/ - -/*! @} */ - -#endif /* FSL_COMMON_ARM_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_crc.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_crc.c deleted file mode 100644 index f4e303be95e..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_crc.c +++ /dev/null @@ -1,371 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2017, 2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#include "fsl_crc.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.crc" -#endif - -/*! @internal @brief Has data register with name CRC. */ -#if defined(FSL_FEATURE_CRC_HAS_CRC_REG) && FSL_FEATURE_CRC_HAS_CRC_REG -#define DATA CRC -#define DATALL CRCLL -#endif - -#if defined(CRC_DRIVER_USE_CRC16_CCIT_FALSE_AS_DEFAULT) && CRC_DRIVER_USE_CRC16_CCIT_FALSE_AS_DEFAULT -/* @brief Default user configuration structure for CRC-16-CCITT */ -#define CRC_DRIVER_DEFAULT_POLYNOMIAL 0x1021U -/*< CRC-16-CCIT polynomial x**16 + x**12 + x**5 + x**0 */ -#define CRC_DRIVER_DEFAULT_SEED 0xFFFFU -/*< Default initial checksum */ -#define CRC_DRIVER_DEFAULT_REFLECT_IN false -/*< Default is no transpose */ -#define CRC_DRIVER_DEFAULT_REFLECT_OUT false -/*< Default is transpose bytes */ -#define CRC_DRIVER_DEFAULT_COMPLEMENT_CHECKSUM false -/*< Default is without complement of CRC data register read data */ -#define CRC_DRIVER_DEFAULT_CRC_BITS kCrcBits16 -/*< Default is 16-bit CRC protocol */ -#define CRC_DRIVER_DEFAULT_CRC_RESULT kCrcFinalChecksum -/*< Default is resutl type is final checksum */ -#endif /* CRC_DRIVER_USE_CRC16_CCIT_FALSE_AS_DEFAULT */ - -#if defined(CRC_RSTS) -#define CRC_RESETS_ARRAY CRC_RSTS -#endif - -/*! @brief CRC type of transpose of read write data */ -typedef enum _crc_transpose_type -{ - kCrcTransposeNone = 0U, /*! No transpose */ - kCrcTransposeBits = 1U, /*! Tranpose bits in bytes */ - kCrcTransposeBitsAndBytes = 2U, /*! Transpose bytes and bits in bytes */ - kCrcTransposeBytes = 3U, /*! Transpose bytes */ -} crc_transpose_type_t; - -/*! - * @brief CRC module configuration. - * - * This structure holds the configuration for the CRC module. - */ -typedef struct _crc_module_config -{ - uint32_t polynomial; /*!< CRC Polynomial, MSBit first.@n - Example polynomial: 0x1021 = 1_0000_0010_0001 = x^12+x^5+1 */ - uint32_t seed; /*!< Starting checksum value */ - crc_transpose_type_t readTranspose; /*!< Type of transpose when reading CRC result. */ - crc_transpose_type_t writeTranspose; /*!< Type of transpose when writing CRC input data. */ - bool complementChecksum; /*!< True if the result shall be complement of the actual checksum. */ - crc_bits_t crcBits; /*!< Selects 16- or 32- bit CRC protocol. */ -} crc_module_config_t; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#if defined(CRC_RESETS_ARRAY) -/*! - * @brief Get instance number for CRC module. - * - * @param base CRC peripheral base address - */ -static uint32_t CRC_GetInstance(CRC_Type *base); -#endif -/******************************************************************************* - * Variables - ******************************************************************************/ -#if defined(CRC_RESETS_ARRAY) -static CRC_Type *const s_crcBases[] = CRC_BASE_PTRS; - -/* Reset array */ -static const reset_ip_name_t s_crcResets[] = CRC_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -#if defined(CRC_RESETS_ARRAY) -static uint32_t CRC_GetInstance(CRC_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_crcBases); instance++) - { - if (s_crcBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_crcBases)); - - return instance; -} -#endif - -/*! - * @brief Returns transpose type for CRC protocol reflect in parameter. - * - * This functions helps to set writeTranspose member of crc_config_t structure. Reflect in is CRC protocol parameter. - * - * @param enable True or false for the selected CRC protocol Reflect In (refin) parameter. - */ -static inline crc_transpose_type_t CRC_GetTransposeTypeFromReflectIn(bool enable) -{ - return ((enable) ? kCrcTransposeBitsAndBytes : kCrcTransposeBytes); -} - -/*! - * @brief Returns transpose type for CRC protocol reflect out parameter. - * - * This functions helps to set readTranspose member of crc_config_t structure. Reflect out is CRC protocol parameter. - * - * @param enable True or false for the selected CRC protocol Reflect Out (refout) parameter. - */ -static inline crc_transpose_type_t CRC_GetTransposeTypeFromReflectOut(bool enable) -{ - return ((enable) ? kCrcTransposeBitsAndBytes : kCrcTransposeNone); -} - -/*! - * @brief Starts checksum computation. - * - * Configures the CRC module for the specified CRC protocol. @n - * Starts the checksum computation by writing the seed value - * - * @param base CRC peripheral address. - * @param config Pointer to protocol configuration structure. - */ -static void CRC_ConfigureAndStart(CRC_Type *base, const crc_module_config_t *config) -{ - uint32_t crcControl; - - /* pre-compute value for CRC control registger based on user configuraton without WAS field */ - crcControl = 0U | CRC_CTRL_TOT(config->writeTranspose) | CRC_CTRL_TOTR(config->readTranspose) | - CRC_CTRL_FXOR(config->complementChecksum) | CRC_CTRL_TCRC(config->crcBits); - - /* make sure the control register is clear - WAS is deasserted, and protocol is set */ - base->CTRL = crcControl; - - /* write polynomial register */ - base->GPOLY = config->polynomial; - - /* write pre-computed control register value along with WAS to start checksum computation */ - base->CTRL = crcControl | CRC_CTRL_WAS(true); - - /* write seed (initial checksum) */ - base->DATA = config->seed; - - /* deassert WAS by writing pre-computed CRC control register value */ - base->CTRL = crcControl; -} - -/*! - * @brief Starts final checksum computation. - * - * Configures the CRC module for the specified CRC protocol. @n - * Starts final checksum computation by writing the seed value. - * @note CRC_Get16bitResult() or CRC_Get32bitResult() return final checksum - * (output reflection and xor functions are applied). - * - * @param base CRC peripheral address. - * @param protocolConfig Pointer to protocol configuration structure. - */ -static void CRC_SetProtocolConfig(CRC_Type *base, const crc_config_t *protocolConfig) -{ - crc_module_config_t moduleConfig; - /* convert protocol to CRC peripheral module configuration, prepare for final checksum */ - moduleConfig.polynomial = protocolConfig->polynomial; - moduleConfig.seed = protocolConfig->seed; - moduleConfig.readTranspose = CRC_GetTransposeTypeFromReflectOut(protocolConfig->reflectOut); - moduleConfig.writeTranspose = CRC_GetTransposeTypeFromReflectIn(protocolConfig->reflectIn); - moduleConfig.complementChecksum = protocolConfig->complementChecksum; - moduleConfig.crcBits = protocolConfig->crcBits; - - CRC_ConfigureAndStart(base, &moduleConfig); -} - -/*! - * @brief Starts intermediate checksum computation. - * - * Configures the CRC module for the specified CRC protocol. @n - * Starts intermediate checksum computation by writing the seed value. - * @note CRC_Get16bitResult() or CRC_Get32bitResult() return intermediate checksum (raw data register value). - * - * @param base CRC peripheral address. - * @param protocolConfig Pointer to protocol configuration structure. - */ -static void CRC_SetRawProtocolConfig(CRC_Type *base, const crc_config_t *protocolConfig) -{ - crc_module_config_t moduleConfig; - /* convert protocol to CRC peripheral module configuration, prepare for intermediate checksum */ - moduleConfig.polynomial = protocolConfig->polynomial; - moduleConfig.seed = protocolConfig->seed; - moduleConfig.readTranspose = - kCrcTransposeNone; /* intermediate checksum does no transpose of data register read value */ - moduleConfig.writeTranspose = CRC_GetTransposeTypeFromReflectIn(protocolConfig->reflectIn); - moduleConfig.complementChecksum = false; /* intermediate checksum does no xor of data register read value */ - moduleConfig.crcBits = protocolConfig->crcBits; - - CRC_ConfigureAndStart(base, &moduleConfig); -} - -/*! - * brief Enables and configures the CRC peripheral module. - * - * This function enables the clock gate in the SIM module for the CRC peripheral. - * It also configures the CRC module and starts a checksum computation by writing the seed. - * - * param base CRC peripheral address. - * param config CRC module configuration structure. - */ -void CRC_Init(CRC_Type *base, const crc_config_t *config) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* ungate clock */ - CLOCK_EnableClock(kCLOCK_Crc0); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(CRC_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_crcResets[CRC_GetInstance(base)]); -#endif - - /* configure CRC module and write the seed */ - if (config->crcResult == kCrcFinalChecksum) - { - CRC_SetProtocolConfig(base, config); - } - else - { - CRC_SetRawProtocolConfig(base, config); - } -} - -/*! - * brief Loads default values to the CRC protocol configuration structure. - * - * Loads default values to the CRC protocol configuration structure. The default values are as follows. - * code - * config->polynomial = 0x1021; - * config->seed = 0xFFFF; - * config->reflectIn = false; - * config->reflectOut = false; - * config->complementChecksum = false; - * config->crcBits = kCrcBits16; - * config->crcResult = kCrcFinalChecksum; - * endcode - * - * param config CRC protocol configuration structure. - */ -void CRC_GetDefaultConfig(crc_config_t *config) -{ - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - static const crc_config_t crc16ccit = { - CRC_DRIVER_DEFAULT_POLYNOMIAL, CRC_DRIVER_DEFAULT_SEED, - CRC_DRIVER_DEFAULT_REFLECT_IN, CRC_DRIVER_DEFAULT_REFLECT_OUT, - CRC_DRIVER_DEFAULT_COMPLEMENT_CHECKSUM, CRC_DRIVER_DEFAULT_CRC_BITS, - CRC_DRIVER_DEFAULT_CRC_RESULT, - }; - - *config = crc16ccit; -} - -/*! - * brief Writes data to the CRC module. - * - * Writes input data buffer bytes to the CRC data register. - * The configured type of transpose is applied. - * - * param base CRC peripheral address. - * param data Input data stream, MSByte in data[0]. - * param dataSize Size in bytes of the input data buffer. - */ -void CRC_WriteData(CRC_Type *base, const uint8_t *data, size_t dataSize) -{ - const uint32_t *data32; - - /* 8-bit reads and writes till source address is aligned 4 bytes */ - while ((0U != dataSize) && (0U != ((uint32_t)data & 3U))) - { - base->ACCESS8BIT.DATALL = *data; - data++; - dataSize--; - } - - /* use 32-bit reads and writes as long as possible */ - data32 = (const uint32_t *)(uint32_t)data; - while (dataSize >= sizeof(uint32_t)) - { - base->DATA = *data32; - data32++; - dataSize -= sizeof(uint32_t); - } - - data = (const uint8_t *)data32; - - /* 8-bit reads and writes till end of data buffer */ - while (dataSize != 0U) - { - base->ACCESS8BIT.DATALL = *data; - data++; - dataSize--; - } -} - -/*! - * brief Reads the 32-bit checksum from the CRC module. - * - * Reads the CRC data register (either an intermediate or the final checksum). - * The configured type of transpose and complement is applied. - * - * param base CRC peripheral address. - * return An intermediate or the final 32-bit checksum, after configured transpose and complement operations. - */ -uint32_t CRC_Get32bitResult(CRC_Type *base) -{ - return base->DATA; -} - -/*! - * brief Reads a 16-bit checksum from the CRC module. - * - * Reads the CRC data register (either an intermediate or the final checksum). - * The configured type of transpose and complement is applied. - * - * param base CRC peripheral address. - * return An intermediate or the final 16-bit checksum, after configured transpose and complement operations. - */ -uint16_t CRC_Get16bitResult(CRC_Type *base) -{ - uint32_t retval; - uint32_t totr; /* type of transpose read bitfield */ - - retval = base->DATA; - totr = (base->CTRL & CRC_CTRL_TOTR_MASK) >> CRC_CTRL_TOTR_SHIFT; - - /* check transpose type to get 16-bit out of 32-bit register */ - if (totr >= 2U) - { - /* transpose of bytes for read is set, the result CRC is in CRC_DATA[HU:HL] */ - retval &= 0xFFFF0000U; - retval = retval >> 16U; - } - else - { - /* no transpose of bytes for read, the result CRC is in CRC_DATA[LU:LL] */ - retval &= 0x0000FFFFU; - } - return (uint16_t)retval; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_crc.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_crc.h deleted file mode 100644 index fb22556da85..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_crc.h +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2017, 2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_CRC_H_ -#define FSL_CRC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup crc - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief CRC driver version. Version 2.0.4. - * - * Current version: 2.0.4 - * - * Change log: - * - * - Version 2.0.4 - * - Release peripheral from reset if necessary in init function. - * - * - Version 2.0.3 - * - Fix MISRA issues - * - * - Version 2.0.2 - * - Fix MISRA issues - * - * - Version 2.0.1 - * - move DATA and DATALL macro definition from header file to source file - */ -#define FSL_CRC_DRIVER_VERSION (MAKE_VERSION(2, 0, 4)) -/*@}*/ - -#ifndef CRC_DRIVER_CUSTOM_DEFAULTS -/*! @brief Default configuration structure filled by CRC_GetDefaultConfig(). Use CRC16-CCIT-FALSE as defeault. */ -#define CRC_DRIVER_USE_CRC16_CCIT_FALSE_AS_DEFAULT 1 -#endif - -/*! @brief CRC bit width */ -typedef enum _crc_bits -{ - kCrcBits16 = 0U, /*!< Generate 16-bit CRC code */ - kCrcBits32 = 1U /*!< Generate 32-bit CRC code */ -} crc_bits_t; - -/*! @brief CRC result type */ -typedef enum _crc_result -{ - kCrcFinalChecksum = 0U, /*!< CRC data register read value is the final checksum. - Reflect out and final xor protocol features are applied. */ - kCrcIntermediateChecksum = 1U /*!< CRC data register read value is intermediate checksum (raw value). - Reflect out and final xor protocol feature are not applied. - Intermediate checksum can be used as a seed for CRC_Init() - to continue adding data to this checksum. */ -} crc_result_t; - -/*! - * @brief CRC protocol configuration. - * - * This structure holds the configuration for the CRC protocol. - * - */ -typedef struct _crc_config -{ - uint32_t polynomial; /*!< CRC Polynomial, MSBit first. - Example polynomial: 0x1021 = 1_0000_0010_0001 = x^12+x^5+1 */ - uint32_t seed; /*!< Starting checksum value */ - bool reflectIn; /*!< Reflect bits on input. */ - bool reflectOut; /*!< Reflect bits on output. */ - bool complementChecksum; /*!< True if the result shall be complement of the actual checksum. */ - crc_bits_t crcBits; /*!< Selects 16- or 32- bit CRC protocol. */ - crc_result_t crcResult; /*!< Selects final or intermediate checksum return from CRC_Get16bitResult() or - CRC_Get32bitResult() */ -} crc_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @brief Enables and configures the CRC peripheral module. - * - * This function enables the clock gate in the SIM module for the CRC peripheral. - * It also configures the CRC module and starts a checksum computation by writing the seed. - * - * @param base CRC peripheral address. - * @param config CRC module configuration structure. - */ -void CRC_Init(CRC_Type *base, const crc_config_t *config); - -/*! - * @brief Disables the CRC peripheral module. - * - * This function disables the clock gate in the SIM module for the CRC peripheral. - * - * @param base CRC peripheral address. - */ -static inline void CRC_Deinit(CRC_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* gate clock */ - CLOCK_DisableClock(kCLOCK_Crc0); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * @brief Loads default values to the CRC protocol configuration structure. - * - * Loads default values to the CRC protocol configuration structure. The default values are as follows. - * @code - * config->polynomial = 0x1021; - * config->seed = 0xFFFF; - * config->reflectIn = false; - * config->reflectOut = false; - * config->complementChecksum = false; - * config->crcBits = kCrcBits16; - * config->crcResult = kCrcFinalChecksum; - * @endcode - * - * @param config CRC protocol configuration structure. - */ -void CRC_GetDefaultConfig(crc_config_t *config); - -/*! - * @brief Writes data to the CRC module. - * - * Writes input data buffer bytes to the CRC data register. - * The configured type of transpose is applied. - * - * @param base CRC peripheral address. - * @param data Input data stream, MSByte in data[0]. - * @param dataSize Size in bytes of the input data buffer. - */ -void CRC_WriteData(CRC_Type *base, const uint8_t *data, size_t dataSize); - -/*! - * @brief Reads the 32-bit checksum from the CRC module. - * - * Reads the CRC data register (either an intermediate or the final checksum). - * The configured type of transpose and complement is applied. - * - * @param base CRC peripheral address. - * @return An intermediate or the final 32-bit checksum, after configured transpose and complement operations. - */ -uint32_t CRC_Get32bitResult(CRC_Type *base); - -/*! - * @brief Reads a 16-bit checksum from the CRC module. - * - * Reads the CRC data register (either an intermediate or the final checksum). - * The configured type of transpose and complement is applied. - * - * @param base CRC peripheral address. - * @return An intermediate or the final 16-bit checksum, after configured transpose and complement operations. - */ -uint16_t CRC_Get16bitResult(CRC_Type *base); - -#if defined(__cplusplus) -} -#endif - -/*! - *@} - */ - -#endif /* FSL_CRC_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_ctimer.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_ctimer.c deleted file mode 100644 index e53bebdd013..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_ctimer.c +++ /dev/null @@ -1,577 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_ctimer.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.ctimer" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Gets the instance from the base address - * - * @param base Ctimer peripheral base address - * - * @return The Timer instance - */ -static uint32_t CTIMER_GetInstance(CTIMER_Type *base); - -/*! - * @brief CTIMER generic IRQ handle function. - * - * @param index FlexCAN peripheral instance index. - */ -static void CTIMER_GenericIRQHandler(uint32_t index); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to Timer bases for each instance. */ -static CTIMER_Type *const s_ctimerBases[] = CTIMER_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to Timer clocks for each instance. */ -static const clock_ip_name_t s_ctimerClocks[] = CTIMER_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_RESET) && (FSL_FEATURE_CTIMER_HAS_NO_RESET)) -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) -#if defined(FSL_FEATURE_CTIMER_WRITE_ZERO_ASSERT_RESET) && FSL_FEATURE_CTIMER_WRITE_ZERO_ASSERT_RESET -/*! @brief Pointers to Timer resets for each instance, writing a zero asserts the reset */ -static const reset_ip_name_t s_ctimerResets[] = CTIMER_RSTS_N; -#else -/*! @brief Pointers to Timer resets for each instance, writing a one asserts the reset */ -static const reset_ip_name_t s_ctimerResets[] = CTIMER_RSTS; -#endif -#endif -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ - -/*! @brief Pointers real ISRs installed by drivers for each instance. */ -static ctimer_callback_t *s_ctimerCallback[sizeof(s_ctimerBases) / sizeof(s_ctimerBases[0])] = {0}; - -/*! @brief Callback type installed by drivers for each instance. */ -static ctimer_callback_type_t ctimerCallbackType[sizeof(s_ctimerBases) / sizeof(s_ctimerBases[0])] = { - kCTIMER_SingleCallback}; - -/*! @brief Array to map timer instance to IRQ number. */ -static const IRQn_Type s_ctimerIRQ[] = CTIMER_IRQS; - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t CTIMER_GetInstance(CTIMER_Type *base) -{ - uint32_t instance; - uint32_t ctimerArrayCount = (sizeof(s_ctimerBases) / sizeof(s_ctimerBases[0])); - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ctimerArrayCount; instance++) - { - if (s_ctimerBases[instance] == base) - { - break; - } - } - - assert(instance < ctimerArrayCount); - - return instance; -} - -/*! - * brief Ungates the clock and configures the peripheral for basic operation. - * - * note This API should be called at the beginning of the application before using the driver. - * - * param base Ctimer peripheral base address - * param config Pointer to the user configuration structure. - */ -void CTIMER_Init(CTIMER_Type *base, const ctimer_config_t *config) -{ - assert(config != NULL); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the timer clock*/ - CLOCK_EnableClock(s_ctimerClocks[CTIMER_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) -/* Reset the module. */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_RESET) && (FSL_FEATURE_CTIMER_HAS_NO_RESET)) - RESET_PeripheralReset(s_ctimerResets[CTIMER_GetInstance(base)]); -#endif -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ - -/* Setup the cimer mode and count select */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && (FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE)) - base->CTCR = CTIMER_CTCR_CTMODE(config->mode) | CTIMER_CTCR_CINSEL(config->input); -#endif - /* Setup the timer prescale value */ - base->PR = CTIMER_PR_PRVAL(config->prescale); -} - -/*! - * brief Gates the timer clock. - * - * param base Ctimer peripheral base address - */ -void CTIMER_Deinit(CTIMER_Type *base) -{ - uint32_t index = CTIMER_GetInstance(base); - /* Stop the timer */ - base->TCR &= ~CTIMER_TCR_CEN_MASK; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable the timer clock*/ - CLOCK_DisableClock(s_ctimerClocks[index]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Disable IRQ at NVIC Level */ - (void)DisableIRQ(s_ctimerIRQ[index]); -} - -/*! - * brief Fills in the timers configuration structure with the default settings. - * - * The default values are: - * code - * config->mode = kCTIMER_TimerMode; - * config->input = kCTIMER_Capture_0; - * config->prescale = 0; - * endcode - * param config Pointer to the user configuration structure. - */ -void CTIMER_GetDefaultConfig(ctimer_config_t *config) -{ - assert(config != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - /* Run as a timer */ - config->mode = kCTIMER_TimerMode; - /* This field is ignored when mode is timer */ - config->input = kCTIMER_Capture_0; - /* Timer counter is incremented on every APB bus clock */ - config->prescale = 0; -} - -/*! - * brief Configures the PWM signal parameters. - * - * Enables PWM mode on the match channel passed in and will then setup the match value - * and other match parameters to generate a PWM signal. - * This function can manually assign the specified channel to set the PWM cycle. - * - * note When setting PWM output from multiple output pins, all should use the same PWM - * frequency. Please use CTIMER_SetupPwmPeriod to set up the PWM with high resolution. - * - * param base Ctimer peripheral base address - * param pwmPeriodChannel Specify the channel to control the PWM period - * param matchChannel Match pin to be used to output the PWM signal - * param dutyCyclePercent PWM pulse width; the value should be between 0 to 100 - * param pwmFreq_Hz PWM signal frequency in Hz - * param srcClock_Hz Timer counter clock in Hz - * param enableInt Enable interrupt when the timer value reaches the match value of the PWM pulse, - * if it is 0 then no interrupt will be generated. - * - * return kStatus_Success on success - * kStatus_Fail If matchChannel is equal to pwmPeriodChannel; this channel is reserved to set the PWM cycle - */ -status_t CTIMER_SetupPwm(CTIMER_Type *base, - const ctimer_match_t pwmPeriodChannel, - ctimer_match_t matchChannel, - uint8_t dutyCyclePercent, - uint32_t pwmFreq_Hz, - uint32_t srcClock_Hz, - bool enableInt) -{ - assert(pwmFreq_Hz > 0U); - - uint32_t reg; - uint32_t period, pulsePeriod = 0; - uint32_t timerClock = srcClock_Hz / (base->PR + 1U); - uint32_t index = CTIMER_GetInstance(base); - - if (matchChannel == pwmPeriodChannel) - { - return kStatus_Fail; - } - - /* Enable PWM mode on the match channel */ - base->PWMC |= (1UL << (uint32_t)matchChannel); - - /* Clear the stop, reset and interrupt bits for this channel */ - reg = base->MCR; - reg &= - ~(((uint32_t)((uint32_t)CTIMER_MCR_MR0R_MASK | (uint32_t)CTIMER_MCR_MR0S_MASK | (uint32_t)CTIMER_MCR_MR0I_MASK)) - << ((uint32_t)matchChannel * 3U)); - - /* If call back function is valid then enable match interrupt for the channel */ - if (enableInt) - { - reg |= (((uint32_t)CTIMER_MCR_MR0I_MASK) << (CTIMER_MCR_MR0I_SHIFT + ((uint32_t)matchChannel * 3U))); - } - - /* Reset the counter when match on PWM period channel (pwmPeriodChannel) */ - reg |= ((uint32_t)((uint32_t)CTIMER_MCR_MR0R_MASK) << ((uint32_t)pwmPeriodChannel * 3U)); - - base->MCR = reg; - - /* Calculate PWM period match value */ - period = (timerClock / pwmFreq_Hz) - 1U; - - /* Calculate pulse width match value */ - if (dutyCyclePercent == 0U) - { - pulsePeriod = period + 1U; - } - else - { - pulsePeriod = (period * (100U - (uint32_t)dutyCyclePercent)) / 100U; - } - - /* Specified channel pwmPeriodChannel will define the PWM period */ - base->MR[pwmPeriodChannel] = period; - - /* This will define the PWM pulse period */ - base->MR[matchChannel] = pulsePeriod; - /* Clear status flags */ - CTIMER_ClearStatusFlags(base, ((uint32_t)CTIMER_IR_MR0INT_MASK) << (uint32_t)matchChannel); - /* If call back function is valid then enable interrupt and update the call back function */ - if (enableInt) - { - (void)EnableIRQ(s_ctimerIRQ[index]); - } - - return kStatus_Success; -} - -/*! - * brief Configures the PWM signal parameters. - * - * Enables PWM mode on the match channel passed in and will then setup the match value - * and other match parameters to generate a PWM signal. - * This function can manually assign the specified channel to set the PWM cycle. - * - * note When setting PWM output from multiple output pins, all should use the same PWM - * period - * - * param base Ctimer peripheral base address - * param pwmPeriodChannel Specify the channel to control the PWM period - * param matchChannel Match pin to be used to output the PWM signal - * param pwmPeriod PWM period match value - * param pulsePeriod Pulse width match value - * param enableInt Enable interrupt when the timer value reaches the match value of the PWM pulse, - * if it is 0 then no interrupt will be generated. - * - * return kStatus_Success on success - * kStatus_Fail If matchChannel is equal to pwmPeriodChannel; this channel is reserved to set the PWM period - */ -status_t CTIMER_SetupPwmPeriod(CTIMER_Type *base, - const ctimer_match_t pwmPeriodChannel, - ctimer_match_t matchChannel, - uint32_t pwmPeriod, - uint32_t pulsePeriod, - bool enableInt) -{ -/* Some CTimers only have 16bits , so the value is limited*/ -#if defined(FSL_FEATURE_SOC_CTIMER16B) && FSL_FEATURE_SOC_CTIMER16B - assert(!((FSL_FEATURE_CTIMER_BIT_SIZEn(base) < 32) && (pulsePeriod > 0xFFFFU))); -#endif - - uint32_t reg; - uint32_t index = CTIMER_GetInstance(base); - - if (matchChannel == pwmPeriodChannel) - { - return kStatus_Fail; - } - - /* Enable PWM mode on PWM pulse channel */ - base->PWMC |= (1UL << (uint32_t)matchChannel); - - /* Clear the stop, reset and interrupt bits for PWM pulse channel */ - reg = base->MCR; - reg &= - ~((uint32_t)((uint32_t)CTIMER_MCR_MR0R_MASK | (uint32_t)CTIMER_MCR_MR0S_MASK | (uint32_t)CTIMER_MCR_MR0I_MASK) - << ((uint32_t)matchChannel * 3U)); - - /* If call back function is valid then enable match interrupt for PWM pulse channel */ - if (enableInt) - { - reg |= (((uint32_t)CTIMER_MCR_MR0I_MASK) << (CTIMER_MCR_MR0I_SHIFT + ((uint32_t)matchChannel * 3U))); - } - - /* Reset the counter when match on PWM period channel (pwmPeriodChannel) */ - reg |= ((uint32_t)((uint32_t)CTIMER_MCR_MR0R_MASK) << ((uint32_t)pwmPeriodChannel * 3U)); - - base->MCR = reg; - - /* Specified channel pwmPeriodChannel will define the PWM period */ - base->MR[pwmPeriodChannel] = pwmPeriod; - - /* This will define the PWM pulse period */ - base->MR[matchChannel] = pulsePeriod; - /* Clear status flags */ - CTIMER_ClearStatusFlags(base, ((uint32_t)CTIMER_IR_MR0INT_MASK) << (uint32_t)matchChannel); - /* If call back function is valid then enable interrupt and update the call back function */ - if (enableInt) - { - (void)EnableIRQ(s_ctimerIRQ[index]); - } - - return kStatus_Success; -} - -/*! - * brief Updates the duty cycle of an active PWM signal. - * - * note Please use CTIMER_SetupPwmPeriod to update the PWM with high resolution. - * This function can manually assign the specified channel to set the PWM cycle. - * - * param base Ctimer peripheral base address - * param pwmPeriodChannel Specify the channel to control the PWM period - * param matchChannel Match pin to be used to output the PWM signal - * param dutyCyclePercent New PWM pulse width; the value should be between 0 to 100 - */ -void CTIMER_UpdatePwmDutycycle(CTIMER_Type *base, - const ctimer_match_t pwmPeriodChannel, - ctimer_match_t matchChannel, - uint8_t dutyCyclePercent) -{ - uint32_t pulsePeriod = 0, period; - - /* Specified channel pwmPeriodChannel defines the PWM period */ - period = base->MR[pwmPeriodChannel]; - - /* For 0% dutycyle, make pulse period greater than period so the event will never occur */ - if (dutyCyclePercent == 0U) - { - pulsePeriod = period + 1U; - } - else - { - pulsePeriod = (period * (100U - (uint32_t)dutyCyclePercent)) / 100U; - } - - /* Update dutycycle */ - base->MR[matchChannel] = pulsePeriod; -} - -/*! - * brief Setup the match register. - * - * User configuration is used to setup the match value and action to be taken when a match occurs. - * - * param base Ctimer peripheral base address - * param matchChannel Match register to configure - * param config Pointer to the match configuration structure - */ -void CTIMER_SetupMatch(CTIMER_Type *base, ctimer_match_t matchChannel, const ctimer_match_config_t *config) -{ -/* Some CTimers only have 16bits , so the value is limited*/ -#if defined(FSL_FEATURE_SOC_CTIMER16B) && FSL_FEATURE_SOC_CTIMER16B - assert(!(FSL_FEATURE_CTIMER_BIT_SIZEn(base) < 32 && config->matchValue > 0xFFFFU)); -#endif - uint32_t reg; - uint32_t index = CTIMER_GetInstance(base); - - /* Set the counter operation when a match on this channel occurs */ - reg = base->MCR; - reg &= - ~((uint32_t)((uint32_t)CTIMER_MCR_MR0R_MASK | (uint32_t)CTIMER_MCR_MR0S_MASK | (uint32_t)CTIMER_MCR_MR0I_MASK) - << ((uint32_t)matchChannel * 3U)); - reg |= ((uint32_t)(config->enableCounterReset) << (CTIMER_MCR_MR0R_SHIFT + ((uint32_t)matchChannel * 3U))); - reg |= ((uint32_t)(config->enableCounterStop) << (CTIMER_MCR_MR0S_SHIFT + ((uint32_t)matchChannel * 3U))); - reg |= ((uint32_t)(config->enableInterrupt) << (CTIMER_MCR_MR0I_SHIFT + ((uint32_t)matchChannel * 3U))); - base->MCR = reg; - - reg = base->EMR; - /* Set the match output operation when a match on this channel occurs */ - reg &= ~(((uint32_t)CTIMER_EMR_EMC0_MASK) << ((uint32_t)matchChannel * 2U)); - reg |= ((uint32_t)config->outControl) << (CTIMER_EMR_EMC0_SHIFT + ((uint32_t)matchChannel * 2U)); - - /* Set the initial state of the EM bit/output */ - reg &= ~(((uint32_t)CTIMER_EMR_EM0_MASK) << (uint32_t)matchChannel); - reg |= ((uint32_t)config->outPinInitState) << (uint32_t)matchChannel; - base->EMR = reg; - - /* Set the match value */ - base->MR[matchChannel] = config->matchValue; - /* Clear status flags */ - CTIMER_ClearStatusFlags(base, ((uint32_t)CTIMER_IR_MR0INT_MASK) << (uint32_t)matchChannel); - /* If interrupt is enabled then enable interrupt and update the call back function */ - if (config->enableInterrupt) - { - (void)EnableIRQ(s_ctimerIRQ[index]); - } -} - -/*! - * brief Get the status of output match. - * - * This function gets the status of output MAT, whether or not this output is connected to a pin. - * This status is driven to the MAT pins if the match function is selected via IOCON. 0 = LOW. 1 = HIGH. - * - * param base Ctimer peripheral base address - * param matchChannel External match channel, user can obtain the status of multiple match channels - * at the same time by using the logic of "|" - * enumeration ::ctimer_external_match_t - * return The mask of external match channel status flags. Users need to use the - * _ctimer_external_match type to decode the return variables. - */ -uint32_t CTIMER_GetOutputMatchStatus(CTIMER_Type *base, uint32_t matchChannel) -{ - return (base->EMR & matchChannel); -} - -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && (FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE)) -/*! - * brief Setup the capture. - * - * param base Ctimer peripheral base address - * param capture Capture channel to configure - * param edge Edge on the channel that will trigger a capture - * param enableInt Flag to enable channel interrupts, if enabled then the registered call back - * is called upon capture - */ -void CTIMER_SetupCapture(CTIMER_Type *base, - ctimer_capture_channel_t capture, - ctimer_capture_edge_t edge, - bool enableInt) -{ - uint32_t reg = base->CCR; - uint32_t index = CTIMER_GetInstance(base); - - /* Set the capture edge */ - reg &= ~((uint32_t)((uint32_t)CTIMER_CCR_CAP0RE_MASK | (uint32_t)CTIMER_CCR_CAP0FE_MASK | - (uint32_t)CTIMER_CCR_CAP0I_MASK) - << ((uint32_t)capture * 3U)); - reg |= ((uint32_t)edge) << (CTIMER_CCR_CAP0RE_SHIFT + ((uint32_t)capture * 3U)); - /* Clear status flags */ - CTIMER_ClearStatusFlags(base, (((uint32_t)kCTIMER_Capture0Flag) << (uint32_t)capture)); - /* If call back function is valid then enable capture interrupt for the channel and update the call back function */ - if (enableInt) - { - reg |= ((uint32_t)CTIMER_CCR_CAP0I_MASK) << ((uint32_t)capture * 3U); - (void)EnableIRQ(s_ctimerIRQ[index]); - } - base->CCR = reg; -} -#endif - -/*! - * brief Register callback. - * - * param base Ctimer peripheral base address - * param cb_func callback function - * param cb_type callback function type, singular or multiple - */ -void CTIMER_RegisterCallBack(CTIMER_Type *base, ctimer_callback_t *cb_func, ctimer_callback_type_t cb_type) -{ - uint32_t index = CTIMER_GetInstance(base); - s_ctimerCallback[index] = cb_func; - ctimerCallbackType[index] = cb_type; -} - -/*! - * brief CTIMER generic IRQ handle function. - * - * param index FlexCAN peripheral instance index. - */ -static void CTIMER_GenericIRQHandler(uint32_t index) -{ - uint32_t int_stat, i, mask; - /* Get Interrupt status flags */ - int_stat = CTIMER_GetStatusFlags(s_ctimerBases[index]); - /* Clear the status flags that were set */ - CTIMER_ClearStatusFlags(s_ctimerBases[index], int_stat); - if (ctimerCallbackType[index] == kCTIMER_SingleCallback) - { - if (s_ctimerCallback[index][0] != NULL) - { - s_ctimerCallback[index][0](int_stat); - } - } - else - { -#if defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE - for (i = 0; i <= CTIMER_IR_MR3INT_SHIFT; i++) -#else -#if defined(FSL_FEATURE_CTIMER_HAS_IR_CR3INT) && FSL_FEATURE_CTIMER_HAS_IR_CR3INT - for (i = 0; i <= CTIMER_IR_CR3INT_SHIFT; i++) -#else -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_IR_CR2INT) && FSL_FEATURE_CTIMER_HAS_NO_IR_CR2INT) - for (i = 0; i <= CTIMER_IR_CR2INT_SHIFT; i++) -#else - for (i = 0; i <= CTIMER_IR_CR1INT_SHIFT; i++) -#endif /* FSL_FEATURE_CTIMER_HAS_NO_IR_CR2INT */ -#endif /* FSL_FEATURE_CTIMER_HAS_IR_CR3INT */ -#endif - { - mask = 0x01UL << i; - /* For each status flag bit that was set call the callback function if it is valid */ - if (((int_stat & mask) != 0U) && (s_ctimerCallback[index][i] != NULL)) - { - s_ctimerCallback[index][i](int_stat); - } - } - } - SDK_ISR_EXIT_BARRIER; -} - -/* IRQ handler functions overloading weak symbols in the startup */ -#if defined(CTIMER0) -void CTIMER0_DriverIRQHandler(void); -void CTIMER0_DriverIRQHandler(void) -{ - CTIMER_GenericIRQHandler(0); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CTIMER1) -void CTIMER1_DriverIRQHandler(void); -void CTIMER1_DriverIRQHandler(void) -{ - CTIMER_GenericIRQHandler(1); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CTIMER2) -void CTIMER2_DriverIRQHandler(void); -void CTIMER2_DriverIRQHandler(void) -{ - CTIMER_GenericIRQHandler(2); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CTIMER3) -void CTIMER3_DriverIRQHandler(void); -void CTIMER3_DriverIRQHandler(void) -{ - CTIMER_GenericIRQHandler(3); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CTIMER4) -void CTIMER4_DriverIRQHandler(void); -void CTIMER4_DriverIRQHandler(void) -{ - CTIMER_GenericIRQHandler(4); - SDK_ISR_EXIT_BARRIER; -} -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_ctimer.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_ctimer.h deleted file mode 100644 index 713c15a77c8..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_ctimer.h +++ /dev/null @@ -1,682 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_CTIMER_H_ -#define FSL_CTIMER_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup ctimer - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -#define FSL_CTIMER_DRIVER_VERSION (MAKE_VERSION(2, 3, 1)) /*!< Version 2.3.1 */ -/*@}*/ - -/*! @brief List of Timer capture channels */ -typedef enum _ctimer_capture_channel -{ - kCTIMER_Capture_0 = 0U, /*!< Timer capture channel 0 */ - kCTIMER_Capture_1, /*!< Timer capture channel 1 */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) && FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) - kCTIMER_Capture_2, /*!< Timer capture channel 2 */ -#endif /* FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2 */ -#if defined(FSL_FEATURE_CTIMER_HAS_CCR_CAP3) && FSL_FEATURE_CTIMER_HAS_CCR_CAP3 - kCTIMER_Capture_3 /*!< Timer capture channel 3 */ -#endif /* FSL_FEATURE_CTIMER_HAS_CCR_CAP3 */ -} ctimer_capture_channel_t; - -/*! @brief List of capture edge options */ -typedef enum _ctimer_capture_edge -{ - kCTIMER_Capture_RiseEdge = 1U, /*!< Capture on rising edge */ - kCTIMER_Capture_FallEdge = 2U, /*!< Capture on falling edge */ - kCTIMER_Capture_BothEdge = 3U, /*!< Capture on rising and falling edge */ -} ctimer_capture_edge_t; - -/*! @brief List of Timer match registers */ -typedef enum _ctimer_match -{ - kCTIMER_Match_0 = 0U, /*!< Timer match register 0 */ - kCTIMER_Match_1, /*!< Timer match register 1 */ - kCTIMER_Match_2, /*!< Timer match register 2 */ - kCTIMER_Match_3 /*!< Timer match register 3 */ -} ctimer_match_t; - -/*! @brief List of external match */ -typedef enum _ctimer_external_match -{ - kCTIMER_External_Match_0 = (1UL << 0), /*!< External match 0 */ - kCTIMER_External_Match_1 = (1UL << 1), /*!< External match 1 */ - kCTIMER_External_Match_2 = (1UL << 2), /*!< External match 2 */ - kCTIMER_External_Match_3 = (1UL << 3) /*!< External match 3 */ -} ctimer_external_match_t; - -/*! @brief List of output control options */ -typedef enum _ctimer_match_output_control -{ - kCTIMER_Output_NoAction = 0U, /*!< No action is taken */ - kCTIMER_Output_Clear, /*!< Clear the EM bit/output to 0 */ - kCTIMER_Output_Set, /*!< Set the EM bit/output to 1 */ - kCTIMER_Output_Toggle /*!< Toggle the EM bit/output */ -} ctimer_match_output_control_t; - -/*! @brief List of Timer modes */ -typedef enum _ctimer_timer_mode -{ - kCTIMER_TimerMode = 0U, /* TC is incremented every rising APB bus clock edge */ - kCTIMER_IncreaseOnRiseEdge, /* TC is incremented on rising edge of input signal */ - kCTIMER_IncreaseOnFallEdge, /* TC is incremented on falling edge of input signal */ - kCTIMER_IncreaseOnBothEdge /* TC is incremented on both edges of input signal */ -} ctimer_timer_mode_t; - -/*! @brief List of Timer interrupts */ -typedef enum _ctimer_interrupt_enable -{ - kCTIMER_Match0InterruptEnable = CTIMER_MCR_MR0I_MASK, /*!< Match 0 interrupt */ - kCTIMER_Match1InterruptEnable = CTIMER_MCR_MR1I_MASK, /*!< Match 1 interrupt */ - kCTIMER_Match2InterruptEnable = CTIMER_MCR_MR2I_MASK, /*!< Match 2 interrupt */ - kCTIMER_Match3InterruptEnable = CTIMER_MCR_MR3I_MASK, /*!< Match 3 interrupt */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && (FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE)) - kCTIMER_Capture0InterruptEnable = CTIMER_CCR_CAP0I_MASK, /*!< Capture 0 interrupt */ - kCTIMER_Capture1InterruptEnable = CTIMER_CCR_CAP1I_MASK, /*!< Capture 1 interrupt */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) && FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) - kCTIMER_Capture2InterruptEnable = CTIMER_CCR_CAP2I_MASK, /*!< Capture 2 interrupt */ -#endif /* FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2 */ -#if defined(FSL_FEATURE_CTIMER_HAS_CCR_CAP3) && FSL_FEATURE_CTIMER_HAS_CCR_CAP3 - kCTIMER_Capture3InterruptEnable = CTIMER_CCR_CAP3I_MASK, /*!< Capture 3 interrupt */ -#endif /* FSL_FEATURE_CTIMER_HAS_CCR_CAP3 */ -#endif -} ctimer_interrupt_enable_t; - -/*! @brief List of Timer flags */ -typedef enum _ctimer_status_flags -{ - kCTIMER_Match0Flag = CTIMER_IR_MR0INT_MASK, /*!< Match 0 interrupt flag */ - kCTIMER_Match1Flag = CTIMER_IR_MR1INT_MASK, /*!< Match 1 interrupt flag */ - kCTIMER_Match2Flag = CTIMER_IR_MR2INT_MASK, /*!< Match 2 interrupt flag */ - kCTIMER_Match3Flag = CTIMER_IR_MR3INT_MASK, /*!< Match 3 interrupt flag */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && (FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE)) - kCTIMER_Capture0Flag = CTIMER_IR_CR0INT_MASK, /*!< Capture 0 interrupt flag */ - kCTIMER_Capture1Flag = CTIMER_IR_CR1INT_MASK, /*!< Capture 1 interrupt flag */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_IR_CR2INT) && FSL_FEATURE_CTIMER_HAS_NO_IR_CR2INT) - kCTIMER_Capture2Flag = CTIMER_IR_CR2INT_MASK, /*!< Capture 2 interrupt flag */ -#endif /* FSL_FEATURE_CTIMER_HAS_NO_IR_CR2INT */ -#if defined(FSL_FEATURE_CTIMER_HAS_IR_CR3INT) && FSL_FEATURE_CTIMER_HAS_IR_CR3INT - kCTIMER_Capture3Flag = CTIMER_IR_CR3INT_MASK, /*!< Capture 3 interrupt flag */ -#endif /* FSL_FEATURE_CTIMER_HAS_IR_CR3INT */ -#endif -} ctimer_status_flags_t; - -typedef void (*ctimer_callback_t)(uint32_t flags); - -/*! @brief Callback type when registering for a callback. When registering a callback - * an array of function pointers is passed the size could be 1 or 8, the callback - * type will tell that. - */ -typedef enum -{ - kCTIMER_SingleCallback, /*!< Single Callback type where there is only one callback for the timer. - based on the status flags different channels needs to be handled differently */ - kCTIMER_MultipleCallback /*!< Multiple Callback type where there can be 8 valid callbacks, one per channel. - for both match/capture */ -} ctimer_callback_type_t; - -/*! - * @brief Match configuration - * - * This structure holds the configuration settings for each match register. - */ -typedef struct _ctimer_match_config -{ - uint32_t matchValue; /*!< This is stored in the match register */ - bool enableCounterReset; /*!< true: Match will reset the counter - false: Match will not reser the counter */ - bool enableCounterStop; /*!< true: Match will stop the counter - false: Match will not stop the counter */ - ctimer_match_output_control_t outControl; /*!< Action to be taken on a match on the EM bit/output */ - bool outPinInitState; /*!< Initial value of the EM bit/output */ - bool enableInterrupt; /*!< true: Generate interrupt upon match - false: Do not generate interrupt on match */ - -} ctimer_match_config_t; - -/*! - * @brief Timer configuration structure - * - * This structure holds the configuration settings for the Timer peripheral. To initialize this - * structure to reasonable defaults, call the CTIMER_GetDefaultConfig() function and pass a - * pointer to the configuration structure instance. - * - * The configuration structure can be made constant so as to reside in flash. - */ -typedef struct _ctimer_config -{ - ctimer_timer_mode_t mode; /*!< Timer mode */ - ctimer_capture_channel_t input; /*!< Input channel to increment the timer, used only in timer - modes that rely on this input signal to increment TC */ - uint32_t prescale; /*!< Prescale value */ -} ctimer_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Ungates the clock and configures the peripheral for basic operation. - * - * @note This API should be called at the beginning of the application before using the driver. - * - * @param base Ctimer peripheral base address - * @param config Pointer to the user configuration structure. - */ -void CTIMER_Init(CTIMER_Type *base, const ctimer_config_t *config); - -/*! - * @brief Gates the timer clock. - * - * @param base Ctimer peripheral base address - */ -void CTIMER_Deinit(CTIMER_Type *base); - -/*! - * @brief Fills in the timers configuration structure with the default settings. - * - * The default values are: - * @code - * config->mode = kCTIMER_TimerMode; - * config->input = kCTIMER_Capture_0; - * config->prescale = 0; - * @endcode - * @param config Pointer to the user configuration structure. - */ -void CTIMER_GetDefaultConfig(ctimer_config_t *config); - -/*! @}*/ - -/*! - * @name PWM setup operations - * @{ - */ - -/*! - * @brief Configures the PWM signal parameters. - * - * Enables PWM mode on the match channel passed in and will then setup the match value - * and other match parameters to generate a PWM signal. - * This function can manually assign the specified channel to set the PWM cycle. - * - * @note When setting PWM output from multiple output pins, all should use the same PWM - * period - * - * @param base Ctimer peripheral base address - * @param pwmPeriodChannel Specify the channel to control the PWM period - * @param matchChannel Match pin to be used to output the PWM signal - * @param pwmPeriod PWM period match value - * @param pulsePeriod Pulse width match value - * @param enableInt Enable interrupt when the timer value reaches the match value of the PWM pulse, - * if it is 0 then no interrupt will be generated. - */ -status_t CTIMER_SetupPwmPeriod(CTIMER_Type *base, - const ctimer_match_t pwmPeriodChannel, - ctimer_match_t matchChannel, - uint32_t pwmPeriod, - uint32_t pulsePeriod, - bool enableInt); - -/*! - * @brief Configures the PWM signal parameters. - * - * Enables PWM mode on the match channel passed in and will then setup the match value - * and other match parameters to generate a PWM signal. - * This function can manually assign the specified channel to set the PWM cycle. - * - * @note When setting PWM output from multiple output pins, all should use the same PWM - * frequency. Please use CTIMER_SetupPwmPeriod to set up the PWM with high resolution. - * - * @param base Ctimer peripheral base address - * @param pwmPeriodChannel Specify the channel to control the PWM period - * @param matchChannel Match pin to be used to output the PWM signal - * @param dutyCyclePercent PWM pulse width; the value should be between 0 to 100 - * @param pwmFreq_Hz PWM signal frequency in Hz - * @param srcClock_Hz Timer counter clock in Hz - * @param enableInt Enable interrupt when the timer value reaches the match value of the PWM pulse, - * if it is 0 then no interrupt will be generated. - */ -status_t CTIMER_SetupPwm(CTIMER_Type *base, - const ctimer_match_t pwmPeriodChannel, - ctimer_match_t matchChannel, - uint8_t dutyCyclePercent, - uint32_t pwmFreq_Hz, - uint32_t srcClock_Hz, - bool enableInt); - -/*! - * @brief Updates the pulse period of an active PWM signal. - * - * @param base Ctimer peripheral base address - * @param matchChannel Match pin to be used to output the PWM signal - * @param pulsePeriod New PWM pulse width match value - */ -static inline void CTIMER_UpdatePwmPulsePeriod(CTIMER_Type *base, ctimer_match_t matchChannel, uint32_t pulsePeriod) -{ - /* Update PWM pulse period match value */ - base->MR[matchChannel] = pulsePeriod; -} - -/*! - * @brief Updates the duty cycle of an active PWM signal. - * - * @note Please use CTIMER_SetupPwmPeriod to update the PWM with high resolution. - * This function can manually assign the specified channel to set the PWM cycle. - * - * @param base Ctimer peripheral base address - * @param pwmPeriodChannel Specify the channel to control the PWM period - * @param matchChannel Match pin to be used to output the PWM signal - * @param dutyCyclePercent New PWM pulse width; the value should be between 0 to 100 - */ -void CTIMER_UpdatePwmDutycycle(CTIMER_Type *base, - const ctimer_match_t pwmPeriodChannel, - ctimer_match_t matchChannel, - uint8_t dutyCyclePercent); - -/*! @}*/ - -/*! - * @brief Setup the match register. - * - * User configuration is used to setup the match value and action to be taken when a match occurs. - * - * @param base Ctimer peripheral base address - * @param matchChannel Match register to configure - * @param config Pointer to the match configuration structure - */ -void CTIMER_SetupMatch(CTIMER_Type *base, ctimer_match_t matchChannel, const ctimer_match_config_t *config); - -/*! - * @brief Get the status of output match. - * - * This function gets the status of output MAT, whether or not this output is connected to a pin. - * This status is driven to the MAT pins if the match function is selected via IOCON. 0 = LOW. 1 = HIGH. - * - * @param base Ctimer peripheral base address - * @param matchChannel External match channel, user can obtain the status of multiple match channels - * at the same time by using the logic of "|" - * enumeration ::ctimer_external_match_t - * @return The mask of external match channel status flags. Users need to use the - * _ctimer_external_match type to decode the return variables. - */ -uint32_t CTIMER_GetOutputMatchStatus(CTIMER_Type *base, uint32_t matchChannel); - -/*! - * @brief Setup the capture. - * - * @param base Ctimer peripheral base address - * @param capture Capture channel to configure - * @param edge Edge on the channel that will trigger a capture - * @param enableInt Flag to enable channel interrupts, if enabled then the registered call back - * is called upon capture - */ -void CTIMER_SetupCapture(CTIMER_Type *base, - ctimer_capture_channel_t capture, - ctimer_capture_edge_t edge, - bool enableInt); - -/*! - * @brief Get the timer count value from TC register. - * - * @param base Ctimer peripheral base address. - * @return return the timer count value. - */ -static inline uint32_t CTIMER_GetTimerCountValue(CTIMER_Type *base) -{ - return (base->TC); -} - -/*! - * @brief Register callback. - * - * @param base Ctimer peripheral base address - * @param cb_func callback function - * @param cb_type callback function type, singular or multiple - */ -void CTIMER_RegisterCallBack(CTIMER_Type *base, ctimer_callback_t *cb_func, ctimer_callback_type_t cb_type); - -/*! - * @name Interrupt Interface - * @{ - */ - -/*! - * @brief Enables the selected Timer interrupts. - * - * @param base Ctimer peripheral base address - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::ctimer_interrupt_enable_t - */ -static inline void CTIMER_EnableInterrupts(CTIMER_Type *base, uint32_t mask) -{ - /* Enable match interrupts */ - base->MCR |= mask & (CTIMER_MCR_MR0I_MASK | CTIMER_MCR_MR1I_MASK | CTIMER_MCR_MR2I_MASK | CTIMER_MCR_MR3I_MASK); - -/* Enable capture interrupts */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && (FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE)) - base->CCR |= mask & (CTIMER_CCR_CAP0I_MASK | CTIMER_CCR_CAP1I_MASK -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) && FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) - | CTIMER_CCR_CAP2I_MASK -#endif /* FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2 */ -#if defined(FSL_FEATURE_CTIMER_HAS_CCR_CAP3) && FSL_FEATURE_CTIMER_HAS_CCR_CAP3 - | CTIMER_CCR_CAP3I_MASK -#endif /* FSL_FEATURE_CTIMER_HAS_CCR_CAP3 */ - ); -#endif -} - -/*! - * @brief Disables the selected Timer interrupts. - * - * @param base Ctimer peripheral base address - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::ctimer_interrupt_enable_t - */ -static inline void CTIMER_DisableInterrupts(CTIMER_Type *base, uint32_t mask) -{ - /* Disable match interrupts */ - base->MCR &= ~(mask & (CTIMER_MCR_MR0I_MASK | CTIMER_MCR_MR1I_MASK | CTIMER_MCR_MR2I_MASK | CTIMER_MCR_MR3I_MASK)); - -/* Disable capture interrupts */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && (FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE)) - base->CCR &= ~(mask & (CTIMER_CCR_CAP0I_MASK | CTIMER_CCR_CAP1I_MASK -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) && FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) - | CTIMER_CCR_CAP2I_MASK -#endif /* FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2 */ -#if defined(FSL_FEATURE_CTIMER_HAS_CCR_CAP3) && FSL_FEATURE_CTIMER_HAS_CCR_CAP3 - | CTIMER_CCR_CAP3I_MASK -#endif /* FSL_FEATURE_CTIMER_HAS_CCR_CAP3 */ - )); -#endif -} - -/*! - * @brief Gets the enabled Timer interrupts. - * - * @param base Ctimer peripheral base address - * - * @return The enabled interrupts. This is the logical OR of members of the - * enumeration ::ctimer_interrupt_enable_t - */ -static inline uint32_t CTIMER_GetEnabledInterrupts(CTIMER_Type *base) -{ - uint32_t enabledIntrs = 0; - - /* Get all the match interrupts enabled */ - enabledIntrs = - base->MCR & (CTIMER_MCR_MR0I_MASK | CTIMER_MCR_MR1I_MASK | CTIMER_MCR_MR2I_MASK | CTIMER_MCR_MR3I_MASK); - -/* Get all the capture interrupts enabled */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && (FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE)) - enabledIntrs |= base->CCR & (CTIMER_CCR_CAP0I_MASK | CTIMER_CCR_CAP1I_MASK -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) && FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) - | CTIMER_CCR_CAP2I_MASK -#endif /* FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2 */ -#if defined(FSL_FEATURE_CTIMER_HAS_CCR_CAP3) && FSL_FEATURE_CTIMER_HAS_CCR_CAP3 - | CTIMER_CCR_CAP3I_MASK -#endif /* FSL_FEATURE_CTIMER_HAS_CCR_CAP3 */ - ); -#endif - - return enabledIntrs; -} - -/*! @}*/ - -/*! - * @name Status Interface - * @{ - */ - -/*! - * @brief Gets the Timer status flags. - * - * @param base Ctimer peripheral base address - * - * @return The status flags. This is the logical OR of members of the - * enumeration ::ctimer_status_flags_t - */ -static inline uint32_t CTIMER_GetStatusFlags(CTIMER_Type *base) -{ - return base->IR; -} - -/*! - * @brief Clears the Timer status flags. - * - * @param base Ctimer peripheral base address - * @param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::ctimer_status_flags_t - */ -static inline void CTIMER_ClearStatusFlags(CTIMER_Type *base, uint32_t mask) -{ - base->IR = mask; -} - -/*! @}*/ - -/*! - * @name Counter Start and Stop - * @{ - */ - -/*! - * @brief Starts the Timer counter. - * - * @param base Ctimer peripheral base address - */ -static inline void CTIMER_StartTimer(CTIMER_Type *base) -{ - base->TCR |= CTIMER_TCR_CEN_MASK; -} - -/*! - * @brief Stops the Timer counter. - * - * @param base Ctimer peripheral base address - */ -static inline void CTIMER_StopTimer(CTIMER_Type *base) -{ - base->TCR &= ~CTIMER_TCR_CEN_MASK; -} - -/*! @}*/ - -/*! - * @brief Reset the counter. - * - * The timer counter and prescale counter are reset on the next positive edge of the APB clock. - * - * @param base Ctimer peripheral base address - */ -static inline void CTIMER_Reset(CTIMER_Type *base) -{ - base->TCR |= CTIMER_TCR_CRST_MASK; - base->TCR &= ~CTIMER_TCR_CRST_MASK; -} - -/*! - * @brief Setup the timer prescale value. - * - * Specifies the maximum value for the Prescale Counter. - * - * @param base Ctimer peripheral base address - * @param prescale Prescale value - */ -static inline void CTIMER_SetPrescale(CTIMER_Type *base, uint32_t prescale) -{ - base->PR = CTIMER_PR_PRVAL(prescale); -} - -/*! - * @brief Get capture channel value. - * - * Get the counter/timer value on the corresponding capture channel. - * - * @param base Ctimer peripheral base address - * @param capture Select capture channel - * - * @return The timer count capture value. - */ -static inline uint32_t CTIMER_GetCaptureValue(CTIMER_Type *base, ctimer_capture_channel_t capture) -{ - return base->CR[capture]; -} - -/*! - * @brief Enable reset match channel. - * - * Set the specified match channel reset operation. - * - * @param base Ctimer peripheral base address - * @param match match channel used - * @param enable Enable match channel reset operation. - */ -static inline void CTIMER_EnableResetMatchChannel(CTIMER_Type *base, ctimer_match_t match, bool enable) -{ - if (enable) - { - base->MCR |= (1UL << (CTIMER_MCR_MR0R_SHIFT + ((uint32_t)match * 3U))); - } - else - { - base->MCR &= ~(1UL << (CTIMER_MCR_MR0R_SHIFT + ((uint32_t)match * 3U))); - } -} - -/*! - * @brief Enable stop match channel. - * - * Set the specified match channel stop operation. - * - * @param base Ctimer peripheral base address. - * @param match match channel used. - * @param enable Enable match channel stop operation. - */ -static inline void CTIMER_EnableStopMatchChannel(CTIMER_Type *base, ctimer_match_t match, bool enable) -{ - if (enable) - { - base->MCR |= (1UL << (CTIMER_MCR_MR0S_SHIFT + ((uint32_t)match * 3U))); - } - else - { - base->MCR &= ~(1UL << (CTIMER_MCR_MR0S_SHIFT + ((uint32_t)match * 3U))); - } -} - -#if (defined(FSL_FEATURE_CTIMER_HAS_MSR) && (FSL_FEATURE_CTIMER_HAS_MSR)) -/*! - * @brief Enable reload channel falling edge. - * - * Enable the specified match channel reload match shadow value. - * - * @param base Ctimer peripheral base address. - * @param match match channel used. - * @param enable Enable . - */ -static inline void CTIMER_EnableMatchChannelReload(CTIMER_Type *base, ctimer_match_t match, bool enable) -{ - if (enable) - { - base->MCR |= (1UL << (CTIMER_MCR_MR0RL_SHIFT + (uint32_t)match)); - } - else - { - base->MCR &= ~(1UL << (CTIMER_MCR_MR0RL_SHIFT + (uint32_t)match)); - } -} -#endif /* FSL_FEATURE_CTIMER_HAS_MSR */ - -/*! - * @brief Enable capture channel rising edge. - * - * Sets the specified capture channel for rising edge capture. - * - * @param base Ctimer peripheral base address. - * @param capture capture channel used. - * @param enable Enable rising edge capture. - */ -static inline void CTIMER_EnableRisingEdgeCapture(CTIMER_Type *base, ctimer_capture_channel_t capture, bool enable) -{ - if (enable) - { - base->CCR |= (1UL << (CTIMER_CCR_CAP0RE_SHIFT + ((uint32_t)capture * 3U))); - } - else - { - base->CCR &= ~(1UL << (CTIMER_CCR_CAP0RE_SHIFT + ((uint32_t)capture * 3U))); - } -} - -/*! - * @brief Enable capture channel falling edge. - * - * Sets the specified capture channel for falling edge capture. - * - * @param base Ctimer peripheral base address. - * @param capture capture channel used. - * @param enable Enable falling edge capture. - */ -static inline void CTIMER_EnableFallingEdgeCapture(CTIMER_Type *base, ctimer_capture_channel_t capture, bool enable) -{ - if (enable) - { - base->CCR |= (1UL << (CTIMER_CCR_CAP0FE_SHIFT + ((uint32_t)capture * 3U))); - } - else - { - base->CCR &= ~(1UL << (CTIMER_CCR_CAP0FE_SHIFT + ((uint32_t)capture * 3U))); - } -} - -#if (defined(FSL_FEATURE_CTIMER_HAS_MSR) && (FSL_FEATURE_CTIMER_HAS_MSR)) -/*! - * @brief Set the specified match shadow channel. - * - * @param base Ctimer peripheral base address. - * @param match match channel used. - * @param matchvalue Reload the value of the corresponding match register. - */ -static inline void CTIMER_SetShadowValue(CTIMER_Type *base, ctimer_match_t match, uint32_t matchvalue) -{ - base->MSR[match] = matchvalue; -} -#endif /* FSL_FEATURE_CTIMER_HAS_MSR */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_CTIMER_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_edma.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_edma.c deleted file mode 100644 index ae3132c14a4..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_edma.c +++ /dev/null @@ -1,2224 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_edma.h" -#if defined FSL_FEATURE_MEMORY_HAS_ADDRESS_OFFSET && FSL_FEATURE_MEMORY_HAS_ADDRESS_OFFSET -#include "fsl_memory.h" -#endif - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.edma4" -#endif -#if defined FSL_FEATURE_MEMORY_HAS_ADDRESS_OFFSET && FSL_FEATURE_MEMORY_HAS_ADDRESS_OFFSET -#define CONVERT_TO_DMA_ADDRESS(addr) (MEMORY_ConvertMemoryMapAddress((uint32_t)(addr), kMEMORY_Local2DMA)) -#else -#define CONVERT_TO_DMA_ADDRESS(addr) ((uint32_t)(addr)) -#endif -#if defined(DMA_RSTS_N) -#define EDMA_RESETS_ARRAY DMA_RSTS_N -#endif -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Map transfer width. - * - * @param width transfer width. - */ -static edma_transfer_size_t EDMA_TransferWidthMapping(uint32_t width); - -/*! - * @brief validate edma errata. - * - * @param base edma base address. - * @param tcd edma transfer content descriptor. - */ -#if defined FSL_FEATURE_EDMA_HAS_ERRATA_51327 -static inline status_t EDMA_CheckErrata(EDMA_Type *base, const edma_tcd_t *tcd); -#endif -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Array to map EDMA instance number to base pointer. */ -static EDMA_Type *const s_edmaBases[] = EDMA_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Array to map EDMA instance number to clock name. */ -static const clock_ip_name_t s_edmaClockName[] = EDMA_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(EDMA_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_edmaResets[] = EDMA_RESETS_ARRAY; -#endif - -/*! @brief Array to map EDMA instance number to IRQ number. */ -static const IRQn_Type s_edmaIRQNumber[][FSL_FEATURE_EDMA_MODULE_CHANNEL] = EDMA_CHN_IRQS; - -/*! @brief Pointers to transfer handle for each EDMA channel. */ -static edma_handle_t *s_EDMAHandle[FSL_FEATURE_SOC_EDMA_COUNT][FSL_FEATURE_EDMA_MODULE_CHANNEL]; -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t EDMA_GetInstance(EDMA_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_edmaBases); instance++) - { - if (s_edmaBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_edmaBases)); - - return instance; -} - -#if defined FSL_FEATURE_EDMA_HAS_ERRATA_51327 -static inline status_t EDMA_CheckErrata(EDMA_Type *base, const edma_tcd_t *tcd) -{ - status_t status = kStatus_Success; - /* errata 51327: to use scatter gather feature, NBYTES must be multiple of 8 */ - if ((uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_ERRATA_51327n(base) == 1U) - { - if ((tcd->NBYTES % 8U) != 0U) - { - assert(false); - status = kStatus_InvalidArgument; - } - } - - return status; -} -#endif - -/*! - * brief Push content of TCD structure into hardware TCD register. - * - * param base EDMA peripheral base address. - * param channel EDMA channel number. - * param tcd Point to TCD structure. - */ -void EDMA_InstallTCD(EDMA_Type *base, uint32_t channel, const edma_tcd_t *tcd) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - - edma_tcd_t *tcdRegs = EDMA_TCD_BASE(base, channel); - -#if defined FSL_FEATURE_EDMA_HAS_ERRATA_51327 - if ((tcd->DLAST_SGA != 0U) && ((tcd->CSR & (uint16_t)DMA_CSR_ESG_MASK) != 0U) && - (EDMA_CheckErrata(base, tcd) != kStatus_Success)) - { - assert(false); - } -#endif - - /* Clear DONE bit first, otherwise ESG cannot be set */ - DMA_CLEAR_DONE_STATUS(base, channel); - - /* Push tcd into hardware TCD register */ - tcdRegs->SADDR = tcd->SADDR; - tcdRegs->SOFF = tcd->SOFF; - tcdRegs->ATTR = tcd->ATTR; - tcdRegs->NBYTES = tcd->NBYTES; - tcdRegs->SLAST = (uint32_t)tcd->SLAST; - tcdRegs->DADDR = tcd->DADDR; - tcdRegs->DOFF = tcd->DOFF; - tcdRegs->CITER = tcd->CITER; - tcdRegs->DLAST_SGA = (uint32_t)tcd->DLAST_SGA; - tcdRegs->CSR = tcd->CSR; - tcdRegs->BITER = tcd->BITER; -} - -/*! - * brief Initializes the eDMA peripheral. - * - * This function ungates the eDMA clock and configures the eDMA peripheral according - * to the configuration structure. - * - * param base eDMA peripheral base address. - * param config A pointer to the configuration structure, see "edma_config_t". - * note This function enables the minor loop map feature. - */ -void EDMA_Init(EDMA_Type *base, const edma_config_t *config) -{ - assert(config != NULL); - assert(FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base) != -1); - - uint32_t tmpreg, i = 0U; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate EDMA peripheral clock */ - CLOCK_EnableClock(s_edmaClockName[EDMA_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(EDMA_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_edmaResets[EDMA_GetInstance(base)]); -#endif - -#if defined(FSL_EDMA_SOC_IP_EDMA) && FSL_EDMA_SOC_IP_EDMA - /* clear all the enabled request, status to make sure EDMA status is in normal condition */ - EDMA_BASE(base)->ERQ = 0U; - EDMA_BASE(base)->INT = 0xFFFFFFFFU; - EDMA_BASE(base)->ERR = 0xFFFFFFFFU; - /* Configure EDMA peripheral according to the configuration structure. */ - tmpreg = EDMA_BASE(base)->CR; - tmpreg &= ~(DMA_CR_ERCA_MASK | DMA_CR_HOE_MASK | DMA_CR_CLM_MASK | DMA_CR_EDBG_MASK); - tmpreg |= (DMA_CR_ERCA(config->enableRoundRobinArbitration) | DMA_CR_HOE(config->enableHaltOnError) | - DMA_CR_CLM(config->enableContinuousLinkMode) | DMA_CR_EDBG(config->enableDebugMode) | DMA_CR_EMLM(1U)); - EDMA_BASE(base)->CR = tmpreg; -#else - tmpreg = EDMA_MP_BASE(base)->MP_CSR; -#if defined FSL_FEATURE_EDMA_HAS_GLOBAL_MASTER_ID_REPLICATION && FSL_FEATURE_EDMA_HAS_GLOBAL_MASTER_ID_REPLICATION - tmpreg = (tmpreg & ~(DMA_MP_CSR_HAE_MASK | DMA_MP_CSR_ERCA_MASK | DMA_MP_CSR_EDBG_MASK | DMA_MP_CSR_GCLC_MASK | - DMA_MP_CSR_GMRC_MASK | DMA_MP_CSR_HALT_MASK)) | - DMA_MP_CSR_GMRC(config->enableMasterIdReplication) | DMA_MP_CSR_HAE(config->enableHaltOnError) | - DMA_MP_CSR_ERCA(config->enableRoundRobinArbitration) | DMA_MP_CSR_EDBG(config->enableDebugMode) | - DMA_MP_CSR_GCLC(config->enableGlobalChannelLink); -#else - tmpreg = (tmpreg & ~(DMA_MP_CSR_HAE_MASK | DMA_MP_CSR_ERCA_MASK | DMA_MP_CSR_EDBG_MASK | DMA_MP_CSR_GCLC_MASK | - DMA_MP_CSR_HALT_MASK)) | - DMA_MP_CSR_HAE(config->enableHaltOnError) | DMA_MP_CSR_ERCA(config->enableRoundRobinArbitration) | - DMA_MP_CSR_EDBG(config->enableDebugMode) | DMA_MP_CSR_GCLC(config->enableGlobalChannelLink); -#endif - EDMA_MP_BASE(base)->MP_CSR = tmpreg; - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG && FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG - /* channel transfer configuration */ - for (i = 0U; i < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base); i++) - { - if (config->channelConfig[i] != NULL) - { - EDMA_InitChannel(base, i, config->channelConfig[i]); - } - } -#endif -#endif -} - -/*! - * brief Deinitializes the eDMA peripheral. - * - * This function gates the eDMA clock. - * - * param base eDMA peripheral base address. - */ -void EDMA_Deinit(EDMA_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate EDMA peripheral clock */ - CLOCK_DisableClock(s_edmaClockName[EDMA_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG && FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG -/*! - * brief EDMA Channel initialization - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param channelConfig pointer to user's eDMA channel config structure, see edma_channel_config_t for detail. - */ -void EDMA_InitChannel(EDMA_Type *base, uint32_t channel, edma_channel_config_t *channelConfig) -{ - assert(channelConfig != NULL); - - EDMA_SetChannelPreemptionConfig(base, channel, &channelConfig->channelPreemptionConfig); - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE && FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE - EDMA_SetChannelSwapSize(base, channel, channelConfig->channelSwapSize); -#endif - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE && FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE - EDMA_SetChannelMemoryAttribute(base, channel, channelConfig->channelWriteMemoryAttribute, - channelConfig->channelReadMemoryAttribute); -#endif -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_SIGN_EXTENSION && FSL_FEATURE_EDMA_HAS_CHANNEL_SIGN_EXTENSION - EDMA_SetChannelSignExtension(base, channel, channelConfig->channelDataSignExtensionBitPosition); -#endif -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE && FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE - EDMA_SetChannelAccessType(base, channel, channelConfig->channelAccessType); -#endif - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_CHANNEL_MUX - if (0U != (uint32_t)channelConfig->channelRequestSource) - { - /* dma request source */ - EDMA_SetChannelMux(base, channel, (int32_t)channelConfig->channelRequestSource); - } -#endif - - /* master ID replication */ - EDMA_EnableChannelMasterIDReplication(base, channel, channelConfig->enableMasterIDReplication); -#if !(defined(FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) && FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) - /* dma transfer security level */ - EDMA_SetChannelSecurityLevel(base, channel, channelConfig->securityLevel); -#endif - /* dma transfer protection level */ - EDMA_SetChannelProtectionLevel(base, channel, channelConfig->protectionLevel); -} -#endif - -/*! - * brief Gets the eDMA default configuration structure. - * - * This function sets the configuration structure to default values. - * The default configuration is set to the following values. - * code - * config.enableContinuousLinkMode = false; - * config.enableHaltOnError = true; - * config.enableRoundRobinArbitration = false; - * config.enableDebugMode = false; - * endcode - * - * param config A pointer to the eDMA configuration structure. - */ -void EDMA_GetDefaultConfig(edma_config_t *config) -{ - assert(config != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->enableRoundRobinArbitration = false; - - config->enableHaltOnError = true; - -#if defined FSL_FEATURE_EDMA_HAS_CONTINUOUS_LINK_MODE && FSL_FEATURE_EDMA_HAS_CONTINUOUS_LINK_MODE - config->enableContinuousLinkMode = false; -#endif - -#if defined FSL_FEATURE_EDMA_HAS_GLOBAL_MASTER_ID_REPLICATION && FSL_FEATURE_EDMA_HAS_GLOBAL_MASTER_ID_REPLICATION - config->enableMasterIdReplication = false; -#endif - - config->enableDebugMode = false; - - config->enableGlobalChannelLink = true; -} - -/*! - * brief Sets all TCD registers to default values. - * - * This function sets TCD registers for this channel to default values. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * note This function must not be called while the channel transfer is ongoing - * or it causes unpredictable results. - * note This function enables the auto stop request feature. - */ -void EDMA_ResetChannel(EDMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - /* reset channel CSR */ - EDMA_ClearChannelStatusFlags(base, channel, (uint32_t)kEDMA_DoneFlag | (uint32_t)kEDMA_ErrorFlag); - /* reset channel TCD */ - EDMA_TcdReset(EDMA_TCD_BASE(base, channel)); -} - -/*! - * brief Configures the eDMA transfer attribute. - * - * This function configures the transfer attribute, including source address, destination address, - * transfer size, address offset, and so on. It also configures the scatter gather feature if the - * user supplies the TCD address. - * Example: - * code - * edma_transfer_t config; - * edma_tcd_t tcd; - * config.srcAddr = ..; - * config.destAddr = ..; - * ... - * EDMA_SetTransferConfig(DMA0, channel, &config, &stcd); - * endcode - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param config Pointer to eDMA transfer configuration structure. - * param nextTcd Point to TCD structure. It can be NULL if users - * do not want to enable scatter/gather feature. - * note If nextTcd is not NULL, it means scatter gather feature is enabled - * and DREQ bit is cleared in the previous transfer configuration, which - * is set in the eDMA_ResetChannel. - */ -void EDMA_SetTransferConfig(EDMA_Type *base, - uint32_t channel, - const edma_transfer_config_t *config, - edma_tcd_t *nextTcd) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - assert(config != NULL); - assert(((uint32_t)nextTcd & 0x1FU) == 0U); - - EDMA_TcdSetTransferConfig(EDMA_TCD_BASE(base, channel), config, (edma_tcd_t *)CONVERT_TO_DMA_ADDRESS(nextTcd)); -} - -/*! - * brief Configures the eDMA minor offset feature. - * - * The minor offset means that the signed-extended value is added to the source address or destination - * address after each minor loop. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param config A pointer to the minor offset configuration structure. - */ -void EDMA_SetMinorOffsetConfig(EDMA_Type *base, uint32_t channel, const edma_minor_offset_config_t *config) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - assert(config != NULL); - - uint32_t tmpreg; - - tmpreg = EDMA_TCD_BASE(base, channel)->NBYTES; - tmpreg &= ~(DMA_NBYTES_MLOFFYES_SMLOE_MASK | DMA_NBYTES_MLOFFYES_DMLOE_MASK | DMA_NBYTES_MLOFFYES_MLOFF_MASK); - tmpreg |= - (DMA_NBYTES_MLOFFYES_SMLOE(config->enableSrcMinorOffset) | - DMA_NBYTES_MLOFFYES_DMLOE(config->enableDestMinorOffset) | DMA_NBYTES_MLOFFYES_MLOFF(config->minorOffset)); - EDMA_TCD_BASE(base, channel)->NBYTES = tmpreg; -} - -/*! - * brief Configures the eDMA channel TCD major offset feature. - * - * Adjustment value added to the source address at the completion of the major iteration count - * - * param base eDMA peripheral base address. - * param channel edma channel number. - * param sourceOffset source address offset. - * param destOffset destination address offset. - */ -void EDMA_SetMajorOffsetConfig(EDMA_Type *base, uint32_t channel, int32_t sourceOffset, int32_t destOffset) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - EDMA_TCD_BASE(base, channel)->SLAST = (uint32_t)sourceOffset; - EDMA_TCD_BASE(base, channel)->DLAST_SGA = (uint32_t)destOffset; -} - -/*! - * brief Configures the eDMA channel preemption feature. - * - * This function configures the channel preemption attribute and the priority of the channel. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number - * param config A pointer to the channel preemption configuration structure. - */ -void EDMA_SetChannelPreemptionConfig(EDMA_Type *base, uint32_t channel, const edma_channel_Preemption_config_t *config) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - assert(config != NULL); - - bool tmpEnablePreemptAbility = config->enablePreemptAbility; - bool tmpEnablchannelPreemption = config->enableChannelPreemption; - uint8_t tmpChannelPriority = config->channelPriority; - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - - volatile uint8_t *tmpReg = &EDMA_BASE(base)->DCHPRI3; - - ((volatile uint8_t *)tmpReg)[DMA_DCHPRI_INDEX(channel)] = - (DMA_DCHPRI0_DPA((true == tmpEnablePreemptAbility ? 0U : 1U)) | - DMA_DCHPRI0_ECP((true == tmpEnablchannelPreemption ? 1U : 0U)) | DMA_DCHPRI0_CHPRI(tmpChannelPriority)); -#else - EDMA_CHANNEL_BASE(base, channel)->CH_PRI = DMA_CH_PRI_ECP(tmpEnablchannelPreemption) | - DMA_CH_PRI_DPA(tmpEnablePreemptAbility) | - DMA_CH_PRI_APL(tmpChannelPriority); -#endif -} - -/*! - * brief Sets the channel link for the eDMA transfer. - * - * This function configures either the minor link or the major link mode. The minor link means that the channel link is - * triggered every time CITER decreases by 1. The major link means that the channel link is triggered when the CITER is - * exhausted. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param type A channel link type, which can be one of the following: - * arg kEDMA_LinkNone - * arg kEDMA_MinorLink - * arg kEDMA_MajorLink - * param linkedChannel The linked channel number. - * note Users should ensure that DONE flag is cleared before calling this interface, or the configuration is invalid. - */ -void EDMA_SetChannelLink(EDMA_Type *base, uint32_t channel, edma_channel_link_type_t type, uint32_t linkedChannel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - assert(linkedChannel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - EDMA_TcdSetChannelLink(EDMA_TCD_BASE(base, channel), type, linkedChannel); -} - -#if defined FSL_FEATURE_EDMA_HAS_BANDWIDTH && FSL_FEATURE_EDMA_HAS_BANDWIDTH -/*! - * brief Sets the bandwidth for the eDMA transfer. - * - * Because the eDMA processes the minor loop, it continuously generates read/write sequences - * until the minor count is exhausted. The bandwidth forces the eDMA to stall after the completion of - * each read/write access to control the bus request bandwidth seen by the crossbar switch. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param bandWidth A bandwidth setting, which can be one of the following: - * arg kEDMABandwidthStallNone - * arg kEDMABandwidthStall4Cycle - * arg kEDMABandwidthStall8Cycle - */ -void EDMA_SetBandWidth(EDMA_Type *base, uint32_t channel, edma_bandwidth_t bandWidth) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - EDMA_TCD_BASE(base, channel)->CSR = - (uint16_t)((EDMA_TCD_BASE(base, channel)->CSR & (~DMA_CSR_BWC_MASK)) | DMA_CSR_BWC(bandWidth)); -} -#endif - -/*! - * brief Sets the source modulo and the destination modulo for the eDMA transfer. - * - * This function defines a specific address range specified to be the value after (SADDR + SOFF)/(DADDR + DOFF) - * calculation is performed or the original register value. It provides the ability to implement a circular data - * queue easily. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param srcModulo A source modulo value. - * param destModulo A destination modulo value. - */ -void EDMA_SetModulo(EDMA_Type *base, uint32_t channel, edma_modulo_t srcModulo, edma_modulo_t destModulo) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - uint16_t tmpreg = EDMA_TCD_BASE(base, channel)->ATTR & (~(uint16_t)(DMA_ATTR_SMOD_MASK | DMA_ATTR_DMOD_MASK)); - EDMA_TCD_BASE(base, channel)->ATTR = tmpreg | DMA_ATTR_DMOD(destModulo) | DMA_ATTR_SMOD(srcModulo); -} - -/*! - * brief Sets all fields to default values for the TCD structure. - * - * This function sets all fields for this TCD structure to default value. - * - * param tcd Pointer to the TCD structure. - * note This function enables the auto stop request feature. - */ -void EDMA_TcdReset(edma_tcd_t *tcd) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - - /* Reset channel TCD */ - tcd->SADDR = 0U; - tcd->SOFF = 0U; - tcd->ATTR = 0U; - tcd->NBYTES = 0U; - tcd->SLAST = 0U; - tcd->DADDR = 0U; - tcd->DOFF = 0U; - tcd->CITER = 0U; - tcd->DLAST_SGA = 0U; - /* Enable auto disable request feature */ - tcd->CSR = DMA_CSR_DREQ(1U); - tcd->BITER = 0U; -} - -/*! - * brief Configures the eDMA TCD transfer attribute. - * - * The TCD is a transfer control descriptor. The content of the TCD is the same as the hardware TCD registers. - * The TCD is used in the scatter-gather mode. - * This function configures the TCD transfer attribute, including source address, destination address, - * transfer size, address offset, and so on. It also configures the scatter gather feature if the - * user supplies the next TCD address. - * Example: - * code - * edma_transfer_t config = { - * ... - * } - * edma_tcd_t tcd __aligned(32); - * edma_tcd_t nextTcd __aligned(32); - * EDMA_TcdSetTransferConfig(&tcd, &config, &nextTcd); - * endcode - * - * param tcd Pointer to the TCD structure. - * param config Pointer to eDMA transfer configuration structure. - * param nextTcd Pointer to the next TCD structure. It can be NULL if users - * do not want to enable scatter/gather feature. - * note TCD address should be 32 bytes aligned or it causes an eDMA error. - * note If the nextTcd is not NULL, the scatter gather feature is enabled - * and DREQ bit is cleared in the previous transfer configuration, which - * is set in the EDMA_TcdReset. - */ -void EDMA_TcdSetTransferConfig(edma_tcd_t *tcd, const edma_transfer_config_t *config, edma_tcd_t *nextTcd) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - assert(config != NULL); - - EDMA_ConfigChannelSoftwareTCD(tcd, config); - - if (nextTcd != NULL) - { - tcd->DLAST_SGA = CONVERT_TO_DMA_ADDRESS(nextTcd); - /* - Before call EDMA_TcdSetTransferConfig or EDMA_SetTransferConfig, - user must call EDMA_TcdReset or EDMA_ResetChannel which will set - DREQ, so must use "|" or "&" rather than "=". - - Clear the DREQ bit because scatter gather has been enabled, so the - previous transfer is not the last transfer, and channel request should - be enabled at the next transfer(the next TCD). - */ - tcd->CSR = (tcd->CSR | (uint16_t)DMA_CSR_ESG_MASK) & ~(uint16_t)DMA_CSR_DREQ_MASK; - } -} - -/*! - * brief Sets TCD fields according to the user's channel transfer configuration structure, see - * edma_transfer_config_t. - * - * Application should be careful about the TCD pool buffer storage class, - * - For the platform has cache, the software TCD should be put in non cache section - * - The TCD pool buffer should have a consistent storage class. - * - * param tcd Pointer to the TCD structure. - * param transfer channel transfer configuration pointer. - * - */ -void EDMA_ConfigChannelSoftwareTCD(edma_tcd_t *tcd, const edma_transfer_config_t *transfer) -{ - assert(transfer != NULL); - assert((transfer->minorLoopBytes % (1UL << ((uint32_t)transfer->srcTransferSize))) == 0U); - assert((transfer->minorLoopBytes % (1UL << ((uint32_t)transfer->destTransferSize))) == 0U); - assert(((uint32_t)transfer->srcOffset % (1UL << ((uint32_t)transfer->srcTransferSize))) == 0U); - assert(((uint32_t)transfer->destOffset % (1UL << ((uint32_t)transfer->destTransferSize))) == 0U); - assert((transfer->srcAddr % (1UL << ((uint32_t)transfer->srcTransferSize))) == 0U); - assert((transfer->destAddr % (1UL << ((uint32_t)transfer->destTransferSize))) == 0U); - assert((transfer->srcAddr % (1UL << ((uint32_t)transfer->srcAddrModulo))) == 0U); - assert((transfer->destAddr % (1UL << ((uint32_t)transfer->dstAddrModulo))) == 0U); - - uint16_t tmpreg; - - tcd->SADDR = CONVERT_TO_DMA_ADDRESS(transfer->srcAddr); - /* destination address */ - tcd->DADDR = CONVERT_TO_DMA_ADDRESS(transfer->destAddr); - /* Source data and destination data transfer size */ - tcd->ATTR = DMA_ATTR_SSIZE(transfer->srcTransferSize) | DMA_ATTR_DSIZE(transfer->destTransferSize); - - /* Source address signed offset */ - tcd->SOFF = (uint16_t)(transfer->srcOffset); - /* Destination address signed offset */ - tcd->DOFF = (uint16_t)(transfer->destOffset); - - if (((transfer->enableSrcMinorLoopOffset) || (transfer->enableDstMinorLoopOffset))) - { - tcd->NBYTES = DMA_NBYTES_MLOFFYES_NBYTES(transfer->minorLoopBytes) | - DMA_NBYTES_MLOFFYES_MLOFF(transfer->minorLoopOffset) | - DMA_NBYTES_MLOFFYES_DMLOE(transfer->enableDstMinorLoopOffset) | - DMA_NBYTES_MLOFFYES_SMLOE(transfer->enableSrcMinorLoopOffset); - } - else - { - tcd->NBYTES = DMA_NBYTES_MLOFFNO_NBYTES(transfer->minorLoopBytes); - } - - /* Current major iteration count */ - tcd->CITER = (uint16_t)(transfer->majorLoopCounts); - /* Starting major iteration count */ - tcd->BITER = (uint16_t)(transfer->majorLoopCounts); - /* reset CSR firstly */ - tcd->CSR = DMA_CSR_DREQ(1U); - /* Enable scatter/gather processing */ - if (transfer->linkTCD != NULL) - { - tcd->DLAST_SGA = CONVERT_TO_DMA_ADDRESS((uint32_t)((uint8_t *)transfer->linkTCD)); - tcd->CSR = (tcd->CSR | (uint16_t)DMA_CSR_ESG_MASK) & ~(uint16_t)DMA_CSR_DREQ_MASK; - } - else - { - tcd->CSR &= ~(uint16_t)DMA_CSR_ESG_MASK; - tcd->DLAST_SGA = (uint32_t)transfer->dstMajorLoopOffset; - } - - /* configure interrupt/auto disable channel request */ - tcd->CSR |= (transfer->enabledInterruptMask & (~(uint16_t)kEDMA_ErrorInterruptEnable)); - - /* Minor link config */ - if (transfer->enableChannelMinorLoopLink) - { - /* Enable minor link */ - tcd->CITER |= DMA_CITER_ELINKYES_ELINK_MASK; - tcd->BITER |= DMA_BITER_ELINKYES_ELINK_MASK; - /* Set linked channel */ - tmpreg = tcd->CITER & (~(uint16_t)DMA_CITER_ELINKYES_LINKCH_MASK); - tmpreg |= DMA_CITER_ELINKYES_LINKCH(transfer->minorLoopLinkChannel); - tcd->CITER = tmpreg; - tmpreg = tcd->BITER & (~(uint16_t)DMA_BITER_ELINKYES_LINKCH_MASK); - tmpreg |= DMA_BITER_ELINKYES_LINKCH(transfer->minorLoopLinkChannel); - tcd->BITER = tmpreg; - } - /* Major link config */ - if (transfer->enableChannelMajorLoopLink) - { - /* Enable major link */ - tcd->CSR |= DMA_CSR_MAJORELINK_MASK; - /* Set major linked channel */ - tmpreg = tcd->CSR & (~(uint16_t)DMA_CSR_MAJORLINKCH_MASK); - tcd->CSR = tmpreg | DMA_CSR_MAJORLINKCH(transfer->majorLoopLinkChannel); - } - - /* clear link relate field if no channel link enabled */ - if ((!transfer->enableChannelMajorLoopLink) && (!transfer->enableChannelMinorLoopLink)) - { - tcd->CITER &= ~(uint16_t)DMA_CITER_ELINKYES_ELINK_MASK; - tcd->BITER &= ~(uint16_t)DMA_BITER_ELINKYES_ELINK_MASK; - tcd->CSR &= ~(uint16_t)DMA_CSR_MAJORELINK_MASK; - } - - /* major loop offset */ - tcd->SLAST = (uint32_t)transfer->srcMajorLoopOffset; - /* modulo feature */ - tmpreg = tcd->ATTR & (~(uint16_t)(DMA_ATTR_SMOD_MASK | DMA_ATTR_DMOD_MASK)); - tcd->ATTR = tmpreg | DMA_ATTR_DMOD(transfer->dstAddrModulo) | DMA_ATTR_SMOD(transfer->srcAddrModulo); -} - -/*! - * brief Configures the eDMA TCD minor offset feature. - * - * A minor offset is a signed-extended value added to the source address or a destination - * address after each minor loop. - * - * param tcd A point to the TCD structure. - * param config A pointer to the minor offset configuration structure. - */ -void EDMA_TcdSetMinorOffsetConfig(edma_tcd_t *tcd, const edma_minor_offset_config_t *config) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - - uint32_t tmpreg; - - tmpreg = tcd->NBYTES & - ~(DMA_NBYTES_MLOFFYES_SMLOE_MASK | DMA_NBYTES_MLOFFYES_DMLOE_MASK | DMA_NBYTES_MLOFFYES_MLOFF_MASK); - tmpreg |= - (DMA_NBYTES_MLOFFYES_SMLOE(config->enableSrcMinorOffset) | - DMA_NBYTES_MLOFFYES_DMLOE(config->enableDestMinorOffset) | DMA_NBYTES_MLOFFYES_MLOFF(config->minorOffset)); - tcd->NBYTES = tmpreg; -} - -/*! - * brief Configures the eDMA TCD major offset feature. - * - * Adjustment value added to the source address at the completion of the major iteration count - * - * param tcd A point to the TCD structure. - * param sourceOffset source address offset. - * param destOffset destination address offset. - */ -void EDMA_TcdSetMajorOffsetConfig(edma_tcd_t *tcd, int32_t sourceOffset, int32_t destOffset) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - - tcd->SLAST = (uint32_t)sourceOffset; - tcd->DLAST_SGA = (uint32_t)destOffset; -} - -/*! - * brief Sets the channel link for the eDMA TCD. - * - * This function configures either a minor link or a major link. The minor link means the channel link is - * triggered every time CITER decreases by 1. The major link means that the channel link is triggered when the CITER is - * exhausted. - * - * note Users should ensure that DONE flag is cleared before calling this interface, or the configuration is invalid. - * param tcd Point to the TCD structure. - * param type Channel link type, it can be one of: - * arg kEDMA_LinkNone - * arg kEDMA_MinorLink - * arg kEDMA_MajorLink - * param linkedChannel The linked channel number. - */ -void EDMA_TcdSetChannelLink(edma_tcd_t *tcd, edma_channel_link_type_t type, uint32_t linkedChannel) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - assert(linkedChannel < (uint32_t)FSL_FEATURE_EDMA_MODULE_CHANNEL); - - if (type == kEDMA_MinorLink) /* Minor link config */ - { - uint16_t tmpreg; - - /* Enable minor link */ - tcd->CITER |= DMA_CITER_ELINKYES_ELINK_MASK; - tcd->BITER |= DMA_BITER_ELINKYES_ELINK_MASK; - /* Set linked channel */ - tmpreg = tcd->CITER & (~(uint16_t)DMA_CITER_ELINKYES_LINKCH_MASK); - tmpreg |= DMA_CITER_ELINKYES_LINKCH(linkedChannel); - tcd->CITER = tmpreg; - tmpreg = tcd->BITER & (~(uint16_t)DMA_BITER_ELINKYES_LINKCH_MASK); - tmpreg |= DMA_BITER_ELINKYES_LINKCH(linkedChannel); - tcd->BITER = tmpreg; - } - else if (type == kEDMA_MajorLink) /* Major link config */ - { - uint16_t tmpreg; - - /* Enable major link */ - tcd->CSR |= DMA_CSR_MAJORELINK_MASK; - /* Set major linked channel */ - tmpreg = tcd->CSR & (~(uint16_t)DMA_CSR_MAJORLINKCH_MASK); - tcd->CSR = tmpreg | DMA_CSR_MAJORLINKCH(linkedChannel); - } - else /* Link none */ - { - tcd->CITER &= ~(uint16_t)DMA_CITER_ELINKYES_ELINK_MASK; - tcd->BITER &= ~(uint16_t)DMA_BITER_ELINKYES_ELINK_MASK; - tcd->CSR &= ~(uint16_t)DMA_CSR_MAJORELINK_MASK; - } -} - -/*! - * brief Sets the source modulo and the destination modulo for the eDMA TCD. - * - * This function defines a specific address range specified to be the value after (SADDR + SOFF)/(DADDR + DOFF) - * calculation is performed or the original register value. It provides the ability to implement a circular data - * queue easily. - * - * param tcd A pointer to the TCD structure. - * param srcModulo A source modulo value. - * param destModulo A destination modulo value. - */ -void EDMA_TcdSetModulo(edma_tcd_t *tcd, edma_modulo_t srcModulo, edma_modulo_t destModulo) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - - uint16_t tmpreg; - - tmpreg = tcd->ATTR & (~(uint16_t)(DMA_ATTR_SMOD_MASK | DMA_ATTR_DMOD_MASK)); - tcd->ATTR = tmpreg | DMA_ATTR_DMOD(destModulo) | DMA_ATTR_SMOD(srcModulo); -} - -/*! - * brief Enables the interrupt source for the eDMA TCD. - * - * param tcd Point to the TCD structure. - * param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_TcdEnableInterrupts(edma_tcd_t *tcd, uint32_t mask) -{ - assert(tcd != NULL); - - /* Enable Major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_MajorInterruptEnable)) - { - tcd->CSR |= DMA_CSR_INTMAJOR_MASK; - } - - /* Enable Half major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_HalfInterruptEnable)) - { - tcd->CSR |= DMA_CSR_INTHALF_MASK; - } -} - -/*! - * brief Disables the interrupt source for the eDMA TCD. - * - * param tcd Point to the TCD structure. - * param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_TcdDisableInterrupts(edma_tcd_t *tcd, uint32_t mask) -{ - assert(tcd != NULL); - - /* Disable Major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_MajorInterruptEnable)) - { - tcd->CSR &= ~(uint16_t)DMA_CSR_INTMAJOR_MASK; - } - - /* Disable Half major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_HalfInterruptEnable)) - { - tcd->CSR &= ~(uint16_t)DMA_CSR_INTHALF_MASK; - } -} - -/*! - * brief Gets the remaining major loop count from the eDMA current channel TCD. - * - * This function checks the TCD (Task Control Descriptor) status for a specified - * eDMA channel and returns the number of major loop count that has not finished. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * return Major loop count which has not been transferred yet for the current TCD. - * note 1. This function can only be used to get unfinished major loop count of transfer without - * the next TCD, or it might be inaccuracy. - * 2. The unfinished/remaining transfer bytes cannot be obtained directly from registers while - * the channel is running. - * Because to calculate the remaining bytes, the initial NBYTES configured in DMA_TCDn_NBYTES_MLNO - * register is needed while the eDMA IP does not support getting it while a channel is active. - * In another word, the NBYTES value reading is always the actual (decrementing) NBYTES value the dma_engine - * is working with while a channel is running. - * Consequently, to get the remaining transfer bytes, a software-saved initial value of NBYTES (for example - * copied before enabling the channel) is needed. The formula to calculate it is shown below: - * RemainingBytes = RemainingMajorLoopCount * NBYTES(initially configured) - */ -uint32_t EDMA_GetRemainingMajorLoopCount(EDMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - uint32_t remainingCount = 0; - - if (0U != DMA_GET_DONE_STATUS(base, channel)) - { - remainingCount = 0; - } - else - { - /* Calculate the unfinished bytes */ - if (0U != (EDMA_TCD_BASE(base, channel)->CITER & DMA_CITER_ELINKNO_ELINK_MASK)) - { - remainingCount = (((uint32_t)EDMA_TCD_BASE(base, channel)->CITER & DMA_CITER_ELINKYES_CITER_MASK) >> - DMA_CITER_ELINKYES_CITER_SHIFT); - } - else - { - remainingCount = (((uint32_t)EDMA_TCD_BASE(base, channel)->CITER & DMA_CITER_ELINKNO_CITER_MASK) >> - DMA_CITER_ELINKNO_CITER_SHIFT); - } - } - - return remainingCount; -} - -/*! - * brief Enables the interrupt source for the eDMA transfer. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_EnableChannelInterrupts(EDMA_Type *base, uint32_t channel, uint32_t mask) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - /* Enable error interrupt */ - if (0U != (mask & (uint32_t)kEDMA_ErrorInterruptEnable)) - { - DMA_ENABLE_ERROR_INT(base, channel); - } - - /* Enable Major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_MajorInterruptEnable)) - { - DMA_ENABLE_MAJOR_INT(base, channel); - } - - /* Enable Half major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_HalfInterruptEnable)) - { - DMA_ENABLE_HALF_INT(base, channel); - } -} - -/*! - * brief Disables the interrupt source for the eDMA transfer. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param mask The mask of the interrupt source to be set. Use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_DisableChannelInterrupts(EDMA_Type *base, uint32_t channel, uint32_t mask) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - /* Disable error interrupt */ - if (0U != (mask & (uint32_t)kEDMA_ErrorInterruptEnable)) - { - DMA_DISABLE_ERROR_INT(base, channel); - } - - /* Disable Major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_MajorInterruptEnable)) - { - DMA_DISABLE_MAJOR_INT(base, channel); - } - - /* Disable Half major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_HalfInterruptEnable)) - { - DMA_DISABLE_HALF_INT(base, channel); - } -} - -/*! - * brief Gets the eDMA channel status flags. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * return The mask of channel status flags. Users need to use the - * _edma_channel_status_flags type to decode the return variables. - */ -uint32_t EDMA_GetChannelStatusFlags(EDMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - uint32_t retval = 0; - - /* Get DONE bit flag */ - retval |= DMA_GET_DONE_STATUS(base, channel); - /* Get ERROR bit flag */ - retval |= (DMA_GET_ERROR_STATUS(base, channel) << 1U); - /* Get INT bit flag */ - retval |= (DMA_GET_INT_STATUS(base, channel) << 2U); - - return retval; -} - -/*! - * brief Clears the eDMA channel status flags. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param mask The mask of channel status to be cleared. Users need to use - * the defined _edma_channel_status_flags type. - */ -void EDMA_ClearChannelStatusFlags(EDMA_Type *base, uint32_t channel, uint32_t mask) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - /* Clear DONE bit flag */ - if (0U != (mask & (uint32_t)kEDMA_DoneFlag)) - { - DMA_CLEAR_DONE_STATUS(base, channel); - } - /* Clear ERROR bit flag */ - if (0U != (mask & (uint32_t)kEDMA_ErrorFlag)) - { - DMA_CLEAR_ERROR_STATUS(base, channel); - } - /* Clear INT bit flag */ - if (0U != (mask & (uint32_t)kEDMA_InterruptFlag)) - { - DMA_CLEAR_INT_STATUS(base, channel); - } -} - -/*! - * brief Creates the eDMA handle. - * - * This function is called if using the transactional API for eDMA. This function - * initializes the internal state of the eDMA handle. - * - * param handle eDMA handle pointer. The eDMA handle stores callback function and - * parameters. - * param base eDMA peripheral base address. - * param channel eDMA channel number. - */ -void EDMA_CreateHandle(edma_handle_t *handle, EDMA_Type *base, uint32_t channel) -{ - assert(handle != NULL); - assert(FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base) != -1); - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - uint32_t edmaInstance; - edma_tcd_t *tcdRegs; - - /* Zero the handle */ - (void)memset(handle, 0, sizeof(*handle)); - - handle->channel = channel; - - /* Get the DMA instance number */ - edmaInstance = EDMA_GetInstance(base); - s_EDMAHandle[edmaInstance][channel] = handle; - /* Enable NVIC interrupt */ - (void)EnableIRQ(s_edmaIRQNumber[edmaInstance][channel]); - - handle->tcdBase = EDMA_TCD_BASE(base, channel); - handle->channelBase = EDMA_CHANNEL_BASE(base, channel); - handle->base = base; - /* - Reset TCD registers to zero. Unlike the EDMA_TcdReset(DREQ will be set), - CSR will be 0. Because in order to suit EDMA busy check mechanism in - EDMA_SubmitTransfer, CSR must be set 0. - */ - tcdRegs = handle->tcdBase; - tcdRegs->SADDR = 0; - tcdRegs->SOFF = 0; - tcdRegs->ATTR = 0; - tcdRegs->NBYTES = 0; - tcdRegs->SLAST = 0; - tcdRegs->DADDR = 0; - tcdRegs->DOFF = 0; - tcdRegs->CITER = 0; - tcdRegs->DLAST_SGA = 0; - tcdRegs->CSR = 0; - tcdRegs->BITER = 0; -} - -/*! - * brief Installs the TCDs memory pool into the eDMA handle. - * - * This function is called after the EDMA_CreateHandle to use scatter/gather feature. This function shall only be used - * while users need to use scatter gather mode. Scatter gather mode enables EDMA to load a new transfer control block - * (tcd) in hardware, and automatically reconfigure that DMA channel for a new transfer. - * Users need to prepare tcd memory and also configure tcds using interface EDMA_SubmitTransfer. - * - * param handle eDMA handle pointer. - * param tcdPool A memory pool to store TCDs. It must be 32 bytes aligned. - * param tcdSize The number of TCD slots. - */ -void EDMA_InstallTCDMemory(edma_handle_t *handle, edma_tcd_t *tcdPool, uint32_t tcdSize) -{ - assert(handle != NULL); - assert(((uint32_t)tcdPool & 0x1FU) == 0U); - - /* Initialize tcd queue attribute. */ - /* header should initial as 1, since that it is used to point to the next TCD to be loaded into TCD memory, - * In EDMA driver IRQ handler, header will be used to calculate how many tcd has done, for example, - * If application submit 4 transfer request, A->B->C->D, - * when A finshed, the header is 0, C is the next TCD to be load, since B is already loaded, - * according to EDMA driver IRQ handler, tcdDone = C - A - header = 2 - header = 2, but actually only 1 TCD done, - * so the issue will be the wrong TCD done count will pass to application in first TCD interrupt. - * During first submit, the header should be assigned to 1, since 0 is current one and 1 is next TCD to be loaded, - * but software cannot know which submission is the first one, so assign 1 to header here. - */ - handle->header = 1; - handle->tcdUsed = 0; - handle->tcdSize = (int8_t)tcdSize; - handle->tcdPool = tcdPool; -} - -/*! - * brief Installs a callback function for the eDMA transfer. - * - * This callback is called in the eDMA IRQ handler. Use the callback to do something after - * the current major loop transfer completes. This function will be called every time one tcd finished transfer. - * - * param handle eDMA handle pointer. - * param callback eDMA callback function pointer. - * param userData A parameter for the callback function. - */ -void EDMA_SetCallback(edma_handle_t *handle, edma_callback callback, void *userData) -{ - assert(handle != NULL); - - handle->callback = callback; - handle->userData = userData; -} - -static edma_transfer_size_t EDMA_TransferWidthMapping(uint32_t width) -{ - edma_transfer_size_t transferSize = kEDMA_TransferSize1Bytes; - - /* map width to register value */ - switch (width) - { - /* width 8bit */ - case 1U: - transferSize = kEDMA_TransferSize1Bytes; - break; - /* width 16bit */ - case 2U: - transferSize = kEDMA_TransferSize2Bytes; - break; - /* width 32bit */ - case 4U: - transferSize = kEDMA_TransferSize4Bytes; - break; -#if (defined(FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) - /* width 64bit */ - case 8U: - transferSize = kEDMA_TransferSize8Bytes; - break; -#endif -#if (defined(FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) - /* width 128bit */ - case 16U: - transferSize = kEDMA_TransferSize16Bytes; - break; -#endif - /* width 256bit */ - case 32U: - transferSize = kEDMA_TransferSize32Bytes; - break; -#if (defined(FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) - /* width 512bit */ - case 64U: - transferSize = kEDMA_TransferSize64Bytes; - break; -#endif -#if (defined(FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) - /* width 1024bit */ - case 128U: - transferSize = kEDMA_TransferSize128Bytes; - break; -#endif - default: - /* All the cases have been listed above, the default clause should not be reached. */ - assert(false); - break; - } - - return transferSize; -} - -/*! - * brief Prepares the eDMA transfer structure configurations. - * - * This function prepares the transfer configuration structure according to the user input. - * - * param config The user configuration structure of type edma_transfer_t. - * param srcAddr eDMA transfer source address. - * param srcWidth eDMA transfer source address width(bytes). - * param srcOffset source address offset. - * param destAddr eDMA transfer destination address. - * param destWidth eDMA transfer destination address width(bytes). - * param destOffset destination address offset. - * param bytesEachRequest eDMA transfer bytes per channel request. - * param transferBytes eDMA transfer bytes to be transferred. - * note The data address and the data width must be consistent. For example, if the SRC - * is 4 bytes, the source address must be 4 bytes aligned, or it results in - * source address error (SAE). - * User can check if 128 bytes support is available for specific instance by - * FSL_FEATURE_EDMA_INSTANCE_SUPPORT_128_BYTES_TRANSFERn. - */ -void EDMA_PrepareTransferConfig(edma_transfer_config_t *config, - void *srcAddr, - uint32_t srcWidth, - int16_t srcOffset, - void *destAddr, - uint32_t destWidth, - int16_t destOffset, - uint32_t bytesEachRequest, - uint32_t transferBytes) -{ - assert(config != NULL); - assert(srcAddr != NULL); - assert(destAddr != NULL); -#if (defined(FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) - assert((srcWidth != 0U) && (srcWidth <= 128U) && ((srcWidth & (srcWidth - 1U)) == 0U)); - assert((destWidth != 0U) && (destWidth <= 128U) && ((destWidth & (destWidth - 1U)) == 0U)); -#elif (defined(FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) - assert((srcWidth != 0U) && (srcWidth <= 64U) && ((srcWidth & (srcWidth - 1U)) == 0U)); - assert((destWidth != 0U) && (destWidth <= 64U) && ((destWidth & (destWidth - 1U)) == 0U)); -#else - assert((srcWidth != 0U) && (srcWidth <= 32U) && ((srcWidth & (srcWidth - 1U)) == 0U)); - assert((destWidth != 0U) && (destWidth <= 32U) && ((destWidth & (destWidth - 1U)) == 0U)); -#endif -#if (!defined(FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) || !FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) - assert(srcWidth != 8U); - assert(srcWidth != 8U); -#endif -#if (!defined(FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) || !FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) - assert(srcWidth != 16U); - assert(srcWidth != 16U); -#endif -#if (!defined(FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) || !FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) - assert(srcWidth != 64U); - assert(srcWidth != 64U); -#endif - assert((transferBytes % bytesEachRequest) == 0U); - assert((((uint32_t)(uint8_t *)srcAddr) % srcWidth) == 0U); - assert((((uint32_t)(uint8_t *)destAddr) % destWidth) == 0U); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->destAddr = CONVERT_TO_DMA_ADDRESS((uint32_t)(uint32_t *)destAddr); - config->srcAddr = CONVERT_TO_DMA_ADDRESS((uint32_t)(uint32_t *)srcAddr); - config->minorLoopBytes = bytesEachRequest; - config->majorLoopCounts = transferBytes / bytesEachRequest; - config->srcTransferSize = EDMA_TransferWidthMapping(srcWidth); - config->destTransferSize = EDMA_TransferWidthMapping(destWidth); - config->destOffset = destOffset; - config->srcOffset = srcOffset; - /* enable major interrupt by default */ - config->enabledInterruptMask = (uint16_t)kEDMA_MajorInterruptEnable; -} - -/*! - * brief Prepares the eDMA transfer structure. - * - * This function prepares the transfer configuration structure according to the user input. - * - * param config The user configuration structure of type edma_transfer_t. - * param srcAddr eDMA transfer source address. - * param srcWidth eDMA transfer source address width(bytes). - * param destAddr eDMA transfer destination address. - * param destWidth eDMA transfer destination address width(bytes). - * param bytesEachRequest eDMA transfer bytes per channel request. - * param transferBytes eDMA transfer bytes to be transferred. - * param type eDMA transfer type. - * note The data address and the data width must be consistent. For example, if the SRC - * is 4 bytes, the source address must be 4 bytes aligned, or it results in - * source address error (SAE). - */ -void EDMA_PrepareTransfer(edma_transfer_config_t *config, - void *srcAddr, - uint32_t srcWidth, - void *destAddr, - uint32_t destWidth, - uint32_t bytesEachRequest, - uint32_t transferBytes, - edma_transfer_type_t type) -{ - assert(config != NULL); - - int16_t srcOffset = 0, destOffset = 0; - - switch (type) - { - case kEDMA_MemoryToMemory: - destOffset = (int16_t)destWidth; - srcOffset = (int16_t)srcWidth; - break; - case kEDMA_MemoryToPeripheral: - destOffset = 0; - srcOffset = (int16_t)srcWidth; - break; - case kEDMA_PeripheralToMemory: - destOffset = (int16_t)destWidth; - srcOffset = 0; - break; - case kEDMA_PeripheralToPeripheral: - destOffset = 0; - srcOffset = 0; - break; - default: - /* All the cases have been listed above, the default clause should not be reached. */ - assert(false); - break; - } - - EDMA_PrepareTransferConfig(config, srcAddr, srcWidth, srcOffset, destAddr, destWidth, destOffset, bytesEachRequest, - transferBytes); -} - -/*! - * brief Prepares the eDMA transfer content descriptor. - * - * This function prepares the transfer content descriptor structure according to the user input. - * - * param handle eDMA handle pointer. - * param tcd Pointer to eDMA transfer content descriptor structure. - * param srcAddr eDMA transfer source address. - * param srcWidth eDMA transfer source address width(bytes). - * param srcOffset source address offset. - * param destAddr eDMA transfer destination address. - * param destWidth eDMA transfer destination address width(bytes). - * param destOffset destination address offset. - * param bytesEachRequest eDMA transfer bytes per channel request. - * param transferBytes eDMA transfer bytes to be transferred. - * param nextTcd eDMA transfer linked TCD address. - * - * note The data address and the data width must be consistent. For example, if the SRC - * is 4 bytes, the source address must be 4 bytes aligned, or it results in - * source address error (SAE). - */ -void EDMA_PrepareTransferTCD(edma_handle_t *handle, - edma_tcd_t *tcd, - void *srcAddr, - uint32_t srcWidth, - int16_t srcOffset, - void *destAddr, - uint32_t destWidth, - int16_t destOffset, - uint32_t bytesEachRequest, - uint32_t transferBytes, - edma_tcd_t *nextTcd) -{ - assert(tcd != NULL); - assert(srcAddr != NULL); - assert(destAddr != NULL); -#if (defined(FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) - assert((srcWidth != 0U) && (srcWidth <= 128U) && ((srcWidth & (srcWidth - 1U)) == 0U) && - (FSL_FEATURE_EDMA_INSTANCE_SUPPORT_128_BYTES_TRANSFERn(handle->base) == 1)); - assert((destWidth != 0U) && (destWidth <= 128U) && ((destWidth & (destWidth - 1U)) == 0U) && - (FSL_FEATURE_EDMA_INSTANCE_SUPPORT_128_BYTES_TRANSFERn(handle->base) == 1)); -#elif (defined(FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) - assert((srcWidth != 0U) && (srcWidth <= 64U) && ((srcWidth & (srcWidth - 1U)) == 0U)); - assert((destWidth != 0U) && (destWidth <= 64U) && ((destWidth & (destWidth - 1U)) == 0U)); -#else - assert((srcWidth != 0U) && (srcWidth <= 32U) && ((srcWidth & (srcWidth - 1U)) == 0U)); - assert((destWidth != 0U) && (destWidth <= 32U) && ((destWidth & (destWidth - 1U)) == 0U)); -#endif -#if (!defined(FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) || !FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) - assert(srcWidth != 8U); - assert(srcWidth != 8U); -#endif -#if (!defined(FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) || !FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) - assert(srcWidth != 16U); - assert(srcWidth != 16U); -#endif -#if (!defined(FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) || !FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) - assert(srcWidth != 64U); - assert(srcWidth != 64U); -#endif - assert((transferBytes % bytesEachRequest) == 0U); - assert((((uint32_t)(uint32_t *)srcAddr) % srcWidth) == 0U); - assert((((uint32_t)(uint32_t *)destAddr) % destWidth) == 0U); - - edma_transfer_size_t srcTransferSize = EDMA_TransferWidthMapping(srcWidth), - destTransferSize = EDMA_TransferWidthMapping(srcWidth); - - /* Initializes the configure structure to zero. */ - EDMA_TcdReset(tcd); - - assert((bytesEachRequest % (1UL << ((uint32_t)srcTransferSize))) == 0U); - assert((bytesEachRequest % (1UL << ((uint32_t)destTransferSize))) == 0U); - assert(((uint32_t)srcOffset % (1UL << ((uint32_t)srcTransferSize))) == 0U); - assert(((uint32_t)destOffset % (1UL << ((uint32_t)destTransferSize))) == 0U); - assert(((uint32_t)(uint32_t *)srcAddr % (1UL << ((uint32_t)srcTransferSize))) == 0U); - assert(((uint32_t)(uint32_t *)destAddr % (1UL << ((uint32_t)destTransferSize))) == 0U); - - tcd->SADDR = CONVERT_TO_DMA_ADDRESS((uint32_t *)srcAddr); - /* destination address */ - tcd->DADDR = CONVERT_TO_DMA_ADDRESS((uint32_t *)destAddr); - /* Source data and destination data transfer size */ - tcd->ATTR = DMA_ATTR_SSIZE(srcTransferSize) | DMA_ATTR_DSIZE(destTransferSize); - - /* Source address signed offset */ - tcd->SOFF = (uint16_t)(srcOffset); - /* Destination address signed offset */ - tcd->DOFF = (uint16_t)(destOffset); - - tcd->NBYTES = DMA_NBYTES_MLOFFNO_NBYTES(bytesEachRequest); - - /* Current major iteration count */ - tcd->CITER = (uint16_t)(transferBytes / bytesEachRequest); - /* Starting major iteration count */ - tcd->BITER = (uint16_t)(transferBytes / bytesEachRequest); - /* reset CSR firstly */ - tcd->CSR = DMA_CSR_DREQ(1U); - /* Enable scatter/gather processing */ - if (nextTcd != NULL) - { - tcd->DLAST_SGA = CONVERT_TO_DMA_ADDRESS(nextTcd); - /* - Before call EDMA_TcdSetTransferConfig or EDMA_SetTransferConfig, - user must call EDMA_TcdReset or EDMA_ResetChannel which will set - DREQ, so must use "|" or "&" rather than "=". - - Clear the DREQ bit because scatter gather has been enabled, so the - previous transfer is not the last transfer, and channel request should - be enabled at the next transfer(the next TCD). - */ - tcd->CSR = (tcd->CSR | (uint16_t)DMA_CSR_ESG_MASK) & ~(uint16_t)DMA_CSR_DREQ_MASK; - } - - /* configure interrupt/auto disable channel request, enable major interrupt by default */ - tcd->CSR |= (tcd->CSR & (~(uint16_t)kEDMA_ErrorInterruptEnable)) | (uint16_t)kEDMA_MajorInterruptEnable; -} - -/*! - * brief Submits the eDMA transfer content descriptor. - * - * This function submits the eDMA transfer request according to the transfer content descriptor. - * In scatter gather mode, call this function will add a configured tcd to the circular list of tcd pool. - * The tcd pools is setup by call function EDMA_InstallTCDMemory before. - * - * Typical user case: - * 1. submit single transfer - * code - * edma_tcd_t tcd; - * EDMA_PrepareTransferTCD(handle, tcd, ....) - * EDMA_SubmitTransferTCD(handle, tcd) - * EDMA_StartTransfer(handle) - * endcode - * - * 2. submit static link transfer, - * code - * edma_tcd_t tcd[2]; - * EDMA_PrepareTransferTCD(handle, &tcd[0], ....) - * EDMA_PrepareTransferTCD(handle, &tcd[1], ....) - * EDMA_SubmitTransferTCD(handle, &tcd[0]) - * EDMA_StartTransfer(handle) - * endcode - * - * 3. submit dynamic link transfer - * code - * edma_tcd_t tcdpool[2]; - * EDMA_InstallTCDMemory(&g_DMA_Handle, tcdpool, 2); - * edma_tcd_t tcd; - * EDMA_PrepareTransferTCD(handle, tcd, ....) - * EDMA_SubmitTransferTCD(handle, tcd) - * EDMA_PrepareTransferTCD(handle, tcd, ....) - * EDMA_SubmitTransferTCD(handle, tcd) - * EDMA_StartTransfer(handle) - * endcode - * - * 4. submit loop transfer - * code - * edma_tcd_t tcd[2]; - * EDMA_PrepareTransferTCD(handle, &tcd[0], ...,&tcd[1]) - * EDMA_PrepareTransferTCD(handle, &tcd[1], ..., &tcd[0]) - * EDMA_SubmitTransferTCD(handle, &tcd[0]) - * EDMA_StartTransfer(handle) - * endcode - * - * param handle eDMA handle pointer. - * param tcd Pointer to eDMA transfer content descriptor structure. - * - * retval kStatus_EDMA_Success It means submit transfer request succeed. - * retval kStatus_EDMA_QueueFull It means TCD queue is full. Submit transfer request is not allowed. - * retval kStatus_EDMA_Busy It means the given channel is busy, need to submit request later. - */ -status_t EDMA_SubmitTransferTCD(edma_handle_t *handle, const edma_tcd_t *tcd) -{ - assert(handle != NULL); - assert(handle->tcdBase != NULL); - - edma_tcd_t *tcdRegs = handle->tcdBase; - - if (handle->tcdPool == NULL) - { - /* - * Check if EDMA channel is busy: - * 1. if channel active bit is set, it implies that minor loop is executing, then channel is busy - * 2. if channel active bit is not set and BITER not equal to CITER, it implies that major loop is executing, - * then channel is busy - * - * There is one case can not be covered in below condition: - * When transfer request is submitted, but no request from peripheral, that is to say channel sevice doesn't - * begin, if application would like to submit another transfer , then the TCD will be overwritten, since the - * ACTIVE is 0 and BITER = CITER, for such case, it is a scatter gather(link TCD) case actually, so - * application should enabled TCD pool for dynamic scatter gather mode by calling EDMA_InstallTCDMemory. - */ -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - if (((tcdRegs->CSR & DMA_CSR_ACTIVE_MASK) != 0U) || -#else - if (((handle->channelBase->CH_CSR & DMA_CH_CSR_ACTIVE_MASK) != 0U) || -#endif - (((tcdRegs->CITER & DMA_CITER_ELINKNO_CITER_MASK) != (tcdRegs->BITER & DMA_BITER_ELINKNO_BITER_MASK)))) - { - return kStatus_EDMA_Busy; - } - else - { - EDMA_InstallTCD(handle->base, handle->channel, tcd); - /* Enable auto disable request feature */ - EDMA_EnableAutoStopRequest(handle->base, handle->channel, true); - /* Enable major interrupt */ - EDMA_EnableChannelInterrupts(handle->base, handle->channel, kEDMA_MajorInterruptEnable); - - return kStatus_Success; - } - } - else /* Use the TCD queue. */ - { - uint32_t primask; - uint16_t csr; - int8_t currentTcd; - int8_t previousTcd; - int8_t nextTcd; - int8_t tmpTcdUsed; - int8_t tmpTcdSize; - - /* Check if tcd pool is full. */ - primask = DisableGlobalIRQ(); - tmpTcdUsed = handle->tcdUsed; - tmpTcdSize = handle->tcdSize; - if (tmpTcdUsed >= tmpTcdSize) - { - EnableGlobalIRQ(primask); - - return kStatus_EDMA_QueueFull; - } - currentTcd = handle->tail; - handle->tcdUsed++; - /* Calculate index of next TCD */ - nextTcd = currentTcd + 1; - if (nextTcd == handle->tcdSize) - { - nextTcd = 0; - } - /* Advance queue tail index */ - handle->tail = nextTcd; - EnableGlobalIRQ(primask); - /* Calculate index of previous TCD */ - previousTcd = currentTcd != 0 ? currentTcd - 1 : (handle->tcdSize - 1); - - /* Configure current TCD block. */ - EDMA_TcdReset(&handle->tcdPool[currentTcd]); - (void)memcpy(&handle->tcdPool[currentTcd], tcd, sizeof(edma_tcd_t)); - - /* Enable major interrupt */ - handle->tcdPool[currentTcd].CSR |= DMA_CSR_INTMAJOR_MASK; - - if ((tcd->DLAST_SGA == 0U) || ((tcd->CSR & DMA_CSR_ESG_MASK) == 0U)) - { - /* Link current TCD with next TCD for identification of current TCD */ - handle->tcdPool[currentTcd].DLAST_SGA = CONVERT_TO_DMA_ADDRESS((uint32_t)&handle->tcdPool[nextTcd]); - } - - /* Chain from previous descriptor unless tcd pool size is 1(this descriptor is its own predecessor). */ - if (currentTcd != previousTcd) - { -#if defined FSL_FEATURE_EDMA_HAS_ERRATA_51327 - if (EDMA_CheckErrata(handle->base, &handle->tcdPool[previousTcd]) != kStatus_Success) - { - return kStatus_InvalidArgument; - } -#endif - /* Enable scatter/gather feature in the previous TCD block. */ - csr = handle->tcdPool[previousTcd].CSR | ((uint16_t)DMA_CSR_ESG_MASK); - csr &= ~((uint16_t)DMA_CSR_DREQ_MASK); - handle->tcdPool[previousTcd].CSR = csr; - /* - Check if the TCD block in the registers is the previous one (points to current TCD block). It - is used to check if the previous TCD linked has been loaded in TCD register. If so, it need to - link the TCD register in case link the current TCD with the dead chain when TCD loading occurs - before link the previous TCD block. - */ - if (tcdRegs->DLAST_SGA == CONVERT_TO_DMA_ADDRESS((uint32_t)&handle->tcdPool[currentTcd])) - { - /* Clear the DREQ bits for the dynamic scatter gather */ - tcdRegs->CSR |= DMA_CSR_DREQ_MASK; - /* Enable scatter/gather also in the TCD registers. */ - csr = tcdRegs->CSR | DMA_CSR_ESG_MASK; - /* Must write the CSR register one-time, because the transfer maybe finished anytime. */ - tcdRegs->CSR = csr; - /* - It is very important to check the ESG bit! - Because this hardware design: if DONE bit is set, the ESG bit can not be set. So it can - be used to check if the dynamic TCD link operation is successful. If ESG bit is not set - and the DLAST_SGA is not the next TCD address(it means the dynamic TCD link succeed and - the current TCD block has been loaded into TCD registers), it means transfer finished - and TCD link operation fail, so must install TCD content into TCD registers and enable - transfer again. And if ESG is set, it means transfer has not finished, so TCD dynamic - link succeed. - */ - if (0U != (tcdRegs->CSR & DMA_CSR_ESG_MASK)) - { - tcdRegs->CSR &= ~(uint16_t)DMA_CSR_DREQ_MASK; - return kStatus_Success; - } - /* - Check whether the current TCD block is already loaded in the TCD registers. It is another - condition when ESG bit is not set: it means the dynamic TCD link succeed and the current - TCD block has been loaded into TCD registers. - */ - if (tcdRegs->DLAST_SGA == CONVERT_TO_DMA_ADDRESS((uint32_t)&handle->tcdPool[nextTcd])) - { - return kStatus_Success; - } - /* - If go to this, means the previous transfer finished, and the DONE bit is set. - So shall configure TCD registers. - */ - } - else if (tcdRegs->DLAST_SGA != 0UL) - { - /* The current TCD block has been linked successfully. */ - return kStatus_Success; - } - else - { - /* - DLAST_SGA is 0 and it means the first submit transfer, so shall configure - TCD registers. - */ - } - } - /* There is no live chain, TCD block need to be installed in TCD registers. */ - EDMA_InstallTCD(handle->base, handle->channel, &handle->tcdPool[currentTcd]); - - return kStatus_Success; - } -} - -/*! - * brief Submits the eDMA transfer request. - * - * This function submits the eDMA transfer request according to the transfer configuration structure. - * In scatter gather mode, call this function will add a configured tcd to the circular list of tcd pool. - * The tcd pools is setup by call function EDMA_InstallTCDMemory before. - * - * param handle eDMA handle pointer. - * param config Pointer to eDMA transfer configuration structure. - * retval kStatus_EDMA_Success It means submit transfer request succeed. - * retval kStatus_EDMA_QueueFull It means TCD queue is full. Submit transfer request is not allowed. - * retval kStatus_EDMA_Busy It means the given channel is busy, need to submit request later. - */ -status_t EDMA_SubmitTransfer(edma_handle_t *handle, const edma_transfer_config_t *config) -{ - assert(handle != NULL); - assert(config != NULL); - assert(handle->tcdBase != NULL); -#if (defined(FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) - assert(((config->srcTransferSize != kEDMA_TransferSize128Bytes) && - (config->destTransferSize != kEDMA_TransferSize128Bytes)) || - (FSL_FEATURE_EDMA_INSTANCE_SUPPORT_128_BYTES_TRANSFERn(handle->base) == 1)); -#endif - edma_tcd_t *tcdRegs = handle->tcdBase; - - if (handle->tcdPool == NULL) - { - /* - * Check if EDMA channel is busy: - * 1. if channel active bit is set, it implies that minor loop is executing, then channel is busy - * 2. if channel active bit is not set and BITER not equal to CITER, it implies that major loop is executing, - * then channel is busy - * - * There is one case can not be covered in below condition: - * When transfer request is submitted, but no request from peripheral, that is to say channel sevice doesn't - * begin, if application would like to submit another transfer , then the TCD will be overwritten, since the - * ACTIVE is 0 and BITER = CITER, for such case, it is a scatter gather(link TCD) case actually, so - * application should enabled TCD pool for dynamic scatter gather mode by calling EDMA_InstallTCDMemory. - */ -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - if (((tcdRegs->CSR & DMA_CSR_ACTIVE_MASK) != 0U) || -#else - if (((handle->channelBase->CH_CSR & DMA_CH_CSR_ACTIVE_MASK) != 0U) || -#endif - (((tcdRegs->CITER & DMA_CITER_ELINKNO_CITER_MASK) != (tcdRegs->BITER & DMA_BITER_ELINKNO_BITER_MASK)))) - { - return kStatus_EDMA_Busy; - } - else - { - EDMA_TcdSetTransferConfig(tcdRegs, config, NULL); - /* Enable auto disable request feature */ - tcdRegs->CSR |= DMA_CSR_DREQ_MASK; - /* Enable major interrupt */ - tcdRegs->CSR |= DMA_CSR_INTMAJOR_MASK; - - return kStatus_Success; - } - } - else /* Use the TCD queue. */ - { - uint32_t primask; - uint16_t csr; - int8_t currentTcd; - int8_t previousTcd; - int8_t nextTcd; - int8_t tmpTcdUsed; - int8_t tmpTcdSize; - - /* Check if tcd pool is full. */ - primask = DisableGlobalIRQ(); - tmpTcdUsed = handle->tcdUsed; - tmpTcdSize = handle->tcdSize; - if (tmpTcdUsed >= tmpTcdSize) - { - EnableGlobalIRQ(primask); - - return kStatus_EDMA_QueueFull; - } - currentTcd = handle->tail; - handle->tcdUsed++; - /* Calculate index of next TCD */ - nextTcd = currentTcd + 1; - if (nextTcd == handle->tcdSize) - { - nextTcd = 0; - } - /* Advance queue tail index */ - handle->tail = nextTcd; - EnableGlobalIRQ(primask); - /* Calculate index of previous TCD */ - previousTcd = currentTcd != 0 ? currentTcd - 1 : (handle->tcdSize - 1); - /* Configure current TCD block. */ - EDMA_TcdReset(&handle->tcdPool[currentTcd]); - EDMA_TcdSetTransferConfig(&handle->tcdPool[currentTcd], config, NULL); - /* Enable major interrupt */ - handle->tcdPool[currentTcd].CSR |= DMA_CSR_INTMAJOR_MASK; - /* Link current TCD with next TCD for identification of current TCD */ - handle->tcdPool[currentTcd].DLAST_SGA = CONVERT_TO_DMA_ADDRESS((uint32_t)&handle->tcdPool[nextTcd]); - /* Chain from previous descriptor unless tcd pool size is 1(this descriptor is its own predecessor). */ - if (currentTcd != previousTcd) - { -#if defined FSL_FEATURE_EDMA_HAS_ERRATA_51327 - if (EDMA_CheckErrata(handle->base, &handle->tcdPool[previousTcd]) != kStatus_Success) - { - return kStatus_InvalidArgument; - } -#endif - /* Enable scatter/gather feature in the previous TCD block. */ - csr = handle->tcdPool[previousTcd].CSR | ((uint16_t)DMA_CSR_ESG_MASK); - csr &= ~((uint16_t)DMA_CSR_DREQ_MASK); - handle->tcdPool[previousTcd].CSR = csr; - /* - Check if the TCD block in the registers is the previous one (points to current TCD block). It - is used to check if the previous TCD linked has been loaded in TCD register. If so, it need to - link the TCD register in case link the current TCD with the dead chain when TCD loading occurs - before link the previous TCD block. - */ - if (tcdRegs->DLAST_SGA == CONVERT_TO_DMA_ADDRESS((uint32_t)&handle->tcdPool[currentTcd])) - { - /* Clear the DREQ bits for the dynamic scatter gather */ - tcdRegs->CSR |= DMA_CSR_DREQ_MASK; - /* Enable scatter/gather also in the TCD registers. */ - csr = tcdRegs->CSR | DMA_CSR_ESG_MASK; - /* Must write the CSR register one-time, because the transfer maybe finished anytime. */ - tcdRegs->CSR = csr; - /* - It is very important to check the ESG bit! - Because this hardware design: if DONE bit is set, the ESG bit can not be set. So it can - be used to check if the dynamic TCD link operation is successful. If ESG bit is not set - and the DLAST_SGA is not the next TCD address(it means the dynamic TCD link succeed and - the current TCD block has been loaded into TCD registers), it means transfer finished - and TCD link operation fail, so must install TCD content into TCD registers and enable - transfer again. And if ESG is set, it means transfer has not finished, so TCD dynamic - link succeed. - */ - if (0U != (tcdRegs->CSR & DMA_CSR_ESG_MASK)) - { - tcdRegs->CSR &= ~(uint16_t)DMA_CSR_DREQ_MASK; - return kStatus_Success; - } - /* - Check whether the current TCD block is already loaded in the TCD registers. It is another - condition when ESG bit is not set: it means the dynamic TCD link succeed and the current - TCD block has been loaded into TCD registers. - */ - if (tcdRegs->DLAST_SGA == CONVERT_TO_DMA_ADDRESS((uint32_t)&handle->tcdPool[nextTcd])) - { - return kStatus_Success; - } - /* - If go to this, means the previous transfer finished, and the DONE bit is set. - So shall configure TCD registers. - */ - } - else if (tcdRegs->DLAST_SGA != 0UL) - { - /* The current TCD block has been linked successfully. */ - return kStatus_Success; - } - else - { - /* - DLAST_SGA is 0 and it means the first submit transfer, so shall configure - TCD registers. - */ - } - } - /* There is no live chain, TCD block need to be installed in TCD registers. */ - EDMA_InstallTCD(handle->base, handle->channel, &handle->tcdPool[currentTcd]); - - return kStatus_Success; - } -} - -/*! - * brief Submits the eDMA scatter gather transfer configurations. - * - * The function is target for submit loop transfer request, - * the ring transfer request means that the transfer request TAIL is link to HEAD, such as, - * A->B->C->D->A, or A->A - * - * To use the ring transfer feature, the application should allocate several transfer object, such as - * @code - * edma_channel_transfer_config_t transfer[2]; - * EDMA_TransferSubmitLoopTransfer(handle, &transfer, 2U); - * @endcode - * Then eDMA driver will link transfer[0] and transfer[1] to each other - * - * note Application should check the return value of this function to avoid transfer request - * submit failed - * - * param handle eDMA handle pointer - * param transfer pointer to user's eDMA channel configure structure, see edma_channel_transfer_config_t for detail - * param transferLoopCount the count of the transfer ring, if loop count is 1, that means that the one will link to - * itself. - * - * retval #kStatus_Success It means submit transfer request succeed - * retval #kStatus_EDMA_Busy channel is in busy status - * retval #kStatus_InvalidArgument Invalid Argument - */ -status_t EDMA_SubmitLoopTransfer(edma_handle_t *handle, edma_transfer_config_t *transfer, uint32_t transferLoopCount) -{ - assert(transfer != NULL); - assert(handle != NULL); - assert(handle->tcdPool != NULL); - - uint32_t i = 0U; - - if (handle->tcdSize < (int8_t)transferLoopCount) - { - return kStatus_InvalidArgument; - } - - /* - * Check if EDMA channel is busy: - * 1. if channel active bit is set, it implies that minor loop is executing, then channel is busy - * 2. if channel active bit is not set and BITER not equal to CITER, it implies that major loop is executing, - * then channel is busy - * - * There is one case can not be covered in below condition: - * When transfer request is submitted, but no request from peripheral, that is to say channel service doesn't - * begin, if application would like to submit another transfer , then the TCD will be overwritten, since the - * ACTIVE is 0 and BITER = CITER, for such case, it is a scatter gather(link TCD) case actually, so - * application should enabled TCD pool for dynamic scatter gather mode by calling EDMA_InstallTCDMemory. - */ -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - if (((handle->tcdBase->CSR & DMA_CSR_ACTIVE_MASK) != 0U) || -#else - if (((handle->channelBase->CH_CSR & DMA_CH_CSR_ACTIVE_MASK) != 0U) || -#endif - (((handle->tcdBase->CITER & DMA_CITER_ELINKNO_CITER_MASK) != - (handle->tcdBase->BITER & DMA_BITER_ELINKNO_BITER_MASK)))) - { - return kStatus_EDMA_Busy; - } - - (void)memset(handle->tcdPool, 0, (uint32_t)handle->tcdSize * sizeof(edma_tcd_t)); - for (i = 0U; i < transferLoopCount - 1UL; i++) - { - transfer[i].linkTCD = &handle->tcdPool[i + 1UL]; - EDMA_ConfigChannelSoftwareTCD(&(handle->tcdPool[i]), &transfer[i]); -#if defined FSL_FEATURE_EDMA_HAS_ERRATA_51327 - if (EDMA_CheckErrata(handle->base, &(handle->tcdPool[i])) != kStatus_Success) - { - return kStatus_InvalidArgument; - } -#endif - } - - /* prepare last one in the ring and link it to the HEAD of the ring */ - transfer[i].linkTCD = &handle->tcdPool[0]; - EDMA_ConfigChannelSoftwareTCD(&(handle->tcdPool[i]), &transfer[i]); - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - if (((transfer->enableSrcMinorLoopOffset) || (transfer->enableDstMinorLoopOffset))) - { - EDMA_EnableMinorLoopMapping(handle->psBase, true); - } -#endif - /* There is no live chain, TCD block need to be installed in TCD registers. */ - EDMA_InstallTCD(handle->base, handle->channel, &handle->tcdPool[0U]); - - /* enable interrupt */ - EDMA_EnableChannelInterrupts(handle->base, handle->channel, - ((uint32_t)transfer->enabledInterruptMask & ~((uint32_t)kEDMA_ErrorInterruptEnable))); - - return kStatus_Success; -} - -/*! - * brief eDMA starts transfer. - * - * This function enables the channel request. Users can call this function after submitting the transfer request - * or before submitting the transfer request. - * - * param handle eDMA handle pointer. - */ -void EDMA_StartTransfer(edma_handle_t *handle) -{ - assert(handle != NULL); - - edma_tcd_t *tcdRegs = handle->tcdBase; - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - if (handle->tcdPool == NULL) - { - handle->base->SERQ = DMA_SERQ_SERQ(handle->channel); - } - else /* Use the TCD queue. */ - { - uint32_t primask; - - /* Check if there was at least one descriptor submitted since reset (TCD in registers is valid) */ - if (tcdRegs->DLAST_SGA != 0U) - { - primask = DisableGlobalIRQ(); - /* Check if channel request is actually disable. */ - if ((handle->base->ERQ & ((uint32_t)1U << handle->channel)) == 0U) - { - /* Check if transfer is paused. */ - tmpCSR = tcdRegs->CSR; - if ((0U == (tmpCSR & DMA_CSR_DONE_MASK)) || (0U != (tmpCSR & DMA_CSR_ESG_MASK))) - { - /* - Re-enable channel request must be as soon as possible, so must put it into - critical section to avoid task switching or interrupt service routine. - */ - handle->base->SERQ = DMA_SERQ_SERQ(handle->channel); - } - } - EnableGlobalIRQ(primask); - } - } -#else -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_CHANNEL_MUX - if (((uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_MUXn(handle->base) == 1U) && handle->channelBase->CH_MUX == 0U) - { - tcdRegs->CSR |= DMA_CSR_START_MASK; - } - else -#endif - if (handle->tcdPool == NULL) - { - handle->channelBase->CH_CSR |= DMA_CH_CSR_ERQ_MASK; - } - else - { - /* Check if channel request is actually disable. */ - if ((handle->channelBase->CH_CSR & DMA_CH_CSR_ERQ_MASK) == 0U) - { - /* Check if transfer is paused. */ - if ((!((handle->channelBase->CH_CSR & DMA_CH_CSR_DONE_MASK) != 0U)) || - ((tcdRegs->CSR & DMA_CSR_ESG_MASK) != 0U)) - { - /* - Re-enable channel request must be as soon as possible, so must put it into - critical section to avoid task switching or interrupt service routine. - */ - handle->channelBase->CH_CSR |= DMA_CH_CSR_ERQ_MASK; - } - } - } -#endif -} - -/*! - * brief eDMA stops transfer. - * - * This function disables the channel request to pause the transfer. Users can call EDMA_StartTransfer() - * again to resume the transfer. - * - * param handle eDMA handle pointer. - */ -void EDMA_StopTransfer(edma_handle_t *handle) -{ - assert(handle != NULL); -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - handle->base->CERQ = DMA_CERQ_CERQ(handle->channel); -#else - handle->channelBase->CH_CSR = handle->channelBase->CH_CSR & (~(DMA_CH_CSR_DONE_MASK | DMA_CH_CSR_ERQ_MASK)); -#endif -} - -/*! - * brief eDMA aborts transfer. - * - * This function disables the channel request and clear transfer status bits. - * Users can submit another transfer after calling this API. - * - * param handle DMA handle pointer. - */ -void EDMA_AbortTransfer(edma_handle_t *handle) -{ - EDMA_StopTransfer(handle); - /* - Clear CSR to release channel. Because if the given channel started transfer, - CSR will be not zero. Because if it is the last transfer, DREQ will be set. - If not, ESG will be set. - */ - EDMA_TcdReset(handle->tcdBase); - - /* Handle the tcd */ - if (handle->tcdPool != NULL) - { - handle->header = 1; - handle->tail = 0; - handle->tcdUsed = 0; - } -} - -/*! - * brief eDMA IRQ handler for the current major loop transfer completion. - * - * This function clears the channel major interrupt flag and calls - * the callback function if it is not NULL. - * - * Note: - * For the case using TCD queue, when the major iteration count is exhausted, additional operations are performed. - * These include the final address adjustments and reloading of the BITER field into the CITER. - * Assertion of an optional interrupt request also occurs at this time, as does a possible fetch of a new TCD from - * memory using the scatter/gather address pointer included in the descriptor (if scatter/gather is enabled). - * - * For instance, when the time interrupt of TCD[0] happens, the TCD[1] has already been loaded into the eDMA engine. - * As sga and sga_index are calculated based on the DLAST_SGA bitfield lies in the TCD_CSR register, the sga_index - * in this case should be 2 (DLAST_SGA of TCD[1] stores the address of TCD[2]). Thus, the "tcdUsed" updated should be - * (tcdUsed - 2U) which indicates the number of TCDs can be loaded in the memory pool (because TCD[0] and TCD[1] have - * been loaded into the eDMA engine at this point already.). - * - * For the last two continuous ISRs in a scatter/gather process, they both load the last TCD (The last ISR does not - * load a new TCD) from the memory pool to the eDMA engine when major loop completes. - * Therefore, ensure that the header and tcdUsed updated are identical for them. - * tcdUsed are both 0 in this case as no TCD to be loaded. - * - * See the "eDMA basic data flow" in the eDMA Functional description section of the Reference Manual for - * further details. - * - * param handle eDMA handle pointer. - */ -void EDMA_HandleIRQ(edma_handle_t *handle) -{ - assert(handle != NULL); - - bool transfer_done; - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - /* Check if transfer is already finished. */ - transfer_done = ((handle->tcdBase->CSR & DMA_CSR_DONE_MASK) != 0U); -#else - transfer_done = (bool)(handle->channelBase->CH_CSR & DMA_CH_CSR_DONE_MASK); -#endif - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - if ((handle->base->INT >> channel) != 0U) - { - handle->base->CINT = channel; - } -#else - if ((handle->channelBase->CH_INT & DMA_CH_INT_INT_MASK) != 0U) - { - handle->channelBase->CH_INT |= DMA_CH_INT_INT_MASK; - } -#endif - - if (handle->tcdPool == NULL) - { - if (handle->callback != NULL) - { - (handle->callback)(handle, handle->userData, transfer_done, 0); - } - } - else /* Use the TCD queue. Please refer to the API descriptions in the eDMA header file for detailed information. */ - { - uint32_t sga = (uint32_t)((edma_tcd_t *)(handle->tcdBase))->DLAST_SGA; - uint32_t sga_index; - int32_t tcds_done; - uint8_t new_header; - bool esg = ((handle->tcdBase->CSR & DMA_CSR_ESG_MASK) != 0U); - - /* Get the offset of the next transfer TCD blocks to be loaded into the eDMA engine. */ - sga -= CONVERT_TO_DMA_ADDRESS((uint32_t)handle->tcdPool); - /* Get the index of the next transfer TCD blocks to be loaded into the eDMA engine. */ - sga_index = sga / sizeof(edma_tcd_t); - /* Adjust header positions. */ - if (transfer_done) - { - /* New header shall point to the next TCD to be loaded (current one is already finished) */ - new_header = (uint8_t)sga_index; - } - else - { - /* New header shall point to this descriptor currently loaded (not finished yet) */ - new_header = sga_index != 0U ? (uint8_t)sga_index - 1U : (uint8_t)handle->tcdSize - 1U; - } - /* Calculate the number of finished TCDs */ - if (new_header == (uint8_t)handle->header) - { - int8_t tmpTcdUsed = handle->tcdUsed; - int8_t tmpTcdSize = handle->tcdSize; - - /* check esg here for the case that application submit only one request, once the request complete: - * new_header(1) = handle->header(1) - * tcdUsed(1) != tcdSize(>1) - * As the application submit only once, so scatter gather must not enabled, then tcds_done should be 1 - */ - if ((tmpTcdUsed == tmpTcdSize) || (!esg)) - { - tcds_done = handle->tcdUsed; - } - else - { - /* No TCD in the memory are going to be loaded or internal error occurs. */ - tcds_done = 0; - } - } - else - { - tcds_done = (int32_t)new_header - (int32_t)handle->header; - if (tcds_done < 0) - { - tcds_done += handle->tcdSize; - } - /* - * While code run to here, it means a TCD transfer Done and a new TCD has loaded to the hardware - * so clear DONE here to allow submit scatter gather transfer request in the callback to avoid TCD - * overwritten. - */ - if (transfer_done) - { -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - handle->base->CDNE = handle->channel; -#else - handle->channelBase->CH_CSR |= DMA_CH_CSR_DONE_MASK; -#endif - } - } - /* Advance header which points to the TCD to be loaded into the eDMA engine from memory. */ - handle->header = (int8_t)new_header; - /* Release TCD blocks. tcdUsed is the TCD number which can be used/loaded in the memory pool. */ - handle->tcdUsed -= (int8_t)tcds_done; - /* Invoke callback function. */ - if (NULL != handle->callback) - { - (handle->callback)(handle, handle->userData, transfer_done, tcds_done); - } - - /* - * 1.clear the DONE bit here is meaningful for below cases: - * A new TCD has been loaded to EDMA already: - * need to clear the DONE bit in the IRQ handler to avoid TCD in EDMA been overwritten - * if peripheral request isn't coming before next transfer request. - * 2. Don't clear DONE bit for below case, - * for the case that transfer request submitted in the privious edma callback, this is a case that doesn't - * need scatter gather, so keep DONE bit during the next transfer request submission will re-install the TCD and - * the DONE bit will be cleared together with TCD re-installation. - */ - if (transfer_done) - { - if ((handle->tcdBase->CSR & DMA_CSR_ESG_MASK) != 0U) - { -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - handle->base->CDNE = handle->channel; -#else - handle->channelBase->CH_CSR |= DMA_CH_CSR_DONE_MASK; -#endif - } - } - } -} - -void EDMA_DriverIRQHandler(uint32_t instance, uint32_t channel); -void EDMA_DriverIRQHandler(uint32_t instance, uint32_t channel) -{ -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - if ((s_edmaBases[instance]->INT >> channel) != 0U) - { - EDMA_HandleIRQ(s_EDMAHandle[instance][channel]); - } -#else - if ((EDMA_CHANNEL_BASE(s_edmaBases[instance], channel)->CH_INT & DMA_CH_INT_INT_MASK) != 0U) - { - EDMA_HandleIRQ(s_EDMAHandle[instance][channel]); - } -#endif - SDK_ISR_EXIT_BARRIER; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_edma.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_edma.h deleted file mode 100644 index 4cee503c8d4..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_edma.h +++ /dev/null @@ -1,1593 +0,0 @@ -/* - * Copyright 2022-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_EDMA_H_ -#define FSL_EDMA_H_ - -#include "fsl_common.h" -#include "fsl_edma_core.h" -/*! - * @addtogroup edma - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief eDMA driver version */ -#define FSL_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 9, 0)) /*!< Version 2.9.0. */ -/*@}*/ - -/*!@brief Macro used for allocate edma TCD */ -#define EDMA_ALLOCATE_TCD(name, number) AT_NONCACHEABLE_SECTION_ALIGN(edma_tcd_t name[number], EDMA_TCD_ALIGN_SIZE) - -/*! @brief _edma_transfer_status eDMA transfer status */ -enum -{ - kStatus_EDMA_QueueFull = MAKE_STATUS(kStatusGroup_EDMA, 0), /*!< TCD queue is full. */ - kStatus_EDMA_Busy = MAKE_STATUS(kStatusGroup_EDMA, 1), /*!< Channel is busy and can't handle the - transfer request. */ -}; - -/*! @brief Compute the offset unit from DCHPRI3 */ -#define DMA_DCHPRI_INDEX(channel) (((channel) & ~0x03U) | (3U - ((channel)&0x03U))) - -/*! @brief eDMA transfer configuration */ -typedef enum _edma_transfer_size -{ - kEDMA_TransferSize1Bytes = 0x0U, /*!< Source/Destination data transfer size is 1 byte every time */ - kEDMA_TransferSize2Bytes = 0x1U, /*!< Source/Destination data transfer size is 2 bytes every time */ - kEDMA_TransferSize4Bytes = 0x2U, /*!< Source/Destination data transfer size is 4 bytes every time */ -#if (defined(FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) - kEDMA_TransferSize8Bytes = 0x3U, /*!< Source/Destination data transfer size is 8 bytes every time */ -#endif -#if (defined(FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) - kEDMA_TransferSize16Bytes = 0x4U, /*!< Source/Destination data transfer size is 16 bytes every time */ -#endif - kEDMA_TransferSize32Bytes = 0x5U, /*!< Source/Destination data transfer size is 32 bytes every time */ -#if (defined(FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) - kEDMA_TransferSize64Bytes = 0x6U, /*!< Source/Destination data transfer size is 64 bytes every time */ -#endif -#if (defined(FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) - kEDMA_TransferSize128Bytes = 0x7U, /*!< Source/Destination data transfer size is 128 bytes every time */ -#endif -} edma_transfer_size_t; - -/*! @brief eDMA modulo configuration */ -typedef enum _edma_modulo -{ - kEDMA_ModuloDisable = 0x0U, /*!< Disable modulo */ - kEDMA_Modulo2bytes, /*!< Circular buffer size is 2 bytes. */ - kEDMA_Modulo4bytes, /*!< Circular buffer size is 4 bytes. */ - kEDMA_Modulo8bytes, /*!< Circular buffer size is 8 bytes. */ - kEDMA_Modulo16bytes, /*!< Circular buffer size is 16 bytes. */ - kEDMA_Modulo32bytes, /*!< Circular buffer size is 32 bytes. */ - kEDMA_Modulo64bytes, /*!< Circular buffer size is 64 bytes. */ - kEDMA_Modulo128bytes, /*!< Circular buffer size is 128 bytes. */ - kEDMA_Modulo256bytes, /*!< Circular buffer size is 256 bytes. */ - kEDMA_Modulo512bytes, /*!< Circular buffer size is 512 bytes. */ - kEDMA_Modulo1Kbytes, /*!< Circular buffer size is 1 K bytes. */ - kEDMA_Modulo2Kbytes, /*!< Circular buffer size is 2 K bytes. */ - kEDMA_Modulo4Kbytes, /*!< Circular buffer size is 4 K bytes. */ - kEDMA_Modulo8Kbytes, /*!< Circular buffer size is 8 K bytes. */ - kEDMA_Modulo16Kbytes, /*!< Circular buffer size is 16 K bytes. */ - kEDMA_Modulo32Kbytes, /*!< Circular buffer size is 32 K bytes. */ - kEDMA_Modulo64Kbytes, /*!< Circular buffer size is 64 K bytes. */ - kEDMA_Modulo128Kbytes, /*!< Circular buffer size is 128 K bytes. */ - kEDMA_Modulo256Kbytes, /*!< Circular buffer size is 256 K bytes. */ - kEDMA_Modulo512Kbytes, /*!< Circular buffer size is 512 K bytes. */ - kEDMA_Modulo1Mbytes, /*!< Circular buffer size is 1 M bytes. */ - kEDMA_Modulo2Mbytes, /*!< Circular buffer size is 2 M bytes. */ - kEDMA_Modulo4Mbytes, /*!< Circular buffer size is 4 M bytes. */ - kEDMA_Modulo8Mbytes, /*!< Circular buffer size is 8 M bytes. */ - kEDMA_Modulo16Mbytes, /*!< Circular buffer size is 16 M bytes. */ - kEDMA_Modulo32Mbytes, /*!< Circular buffer size is 32 M bytes. */ - kEDMA_Modulo64Mbytes, /*!< Circular buffer size is 64 M bytes. */ - kEDMA_Modulo128Mbytes, /*!< Circular buffer size is 128 M bytes. */ - kEDMA_Modulo256Mbytes, /*!< Circular buffer size is 256 M bytes. */ - kEDMA_Modulo512Mbytes, /*!< Circular buffer size is 512 M bytes. */ - kEDMA_Modulo1Gbytes, /*!< Circular buffer size is 1 G bytes. */ - kEDMA_Modulo2Gbytes, /*!< Circular buffer size is 2 G bytes. */ -} edma_modulo_t; - -#if defined FSL_FEATURE_EDMA_HAS_BANDWIDTH && FSL_FEATURE_EDMA_HAS_BANDWIDTH -/*! @brief Bandwidth control */ -typedef enum _edma_bandwidth -{ - kEDMA_BandwidthStallNone = 0x0U, /*!< No eDMA engine stalls. */ - kEDMA_BandwidthStall4Cycle = 0x2U, /*!< eDMA engine stalls for 4 cycles after each read/write. */ - kEDMA_BandwidthStall8Cycle = 0x3U, /*!< eDMA engine stalls for 8 cycles after each read/write. */ -} edma_bandwidth_t; -#endif - -/*! @brief Channel link type */ -typedef enum _edma_channel_link_type -{ - kEDMA_LinkNone = 0x0U, /*!< No channel link */ - kEDMA_MinorLink, /*!< Channel link after each minor loop */ - kEDMA_MajorLink, /*!< Channel link while major loop count exhausted */ -} edma_channel_link_type_t; - -/*!@brief _edma_channel_status_flags eDMA channel status flags. */ -enum -{ - kEDMA_DoneFlag = 0x1U, /*!< DONE flag, set while transfer finished, CITER value exhausted*/ - kEDMA_ErrorFlag = 0x2U, /*!< eDMA error flag, an error occurred in a transfer */ - kEDMA_InterruptFlag = 0x4U, /*!< eDMA interrupt flag, set while an interrupt occurred of this channel */ -}; - -/*! @brief _edma_error_status_flags eDMA channel error status flags. */ -enum -{ - kEDMA_DestinationBusErrorFlag = DMA_ERR_DBE_FLAG, /*!< Bus error on destination address */ - kEDMA_SourceBusErrorFlag = DMA_ERR_SBE_FLAG, /*!< Bus error on the source address */ - kEDMA_ScatterGatherErrorFlag = DMA_ERR_SGE_FLAG, /*!< Error on the Scatter/Gather address, not 32byte aligned. */ - kEDMA_NbytesErrorFlag = DMA_ERR_NCE_FLAG, /*!< NBYTES/CITER configuration error */ - kEDMA_DestinationOffsetErrorFlag = DMA_ERR_DOE_FLAG, /*!< Destination offset not aligned with destination size */ - kEDMA_DestinationAddressErrorFlag = DMA_ERR_DAE_FLAG, /*!< Destination address not aligned with destination size */ - kEDMA_SourceOffsetErrorFlag = DMA_ERR_SOE_FLAG, /*!< Source offset not aligned with source size */ - kEDMA_SourceAddressErrorFlag = DMA_ERR_SAE_FLAG, /*!< Source address not aligned with source size*/ - kEDMA_ErrorChannelFlag = DMA_ERR_ERRCHAN_FLAG, /*!< Error channel number of the cancelled channel number */ -#if defined(FSL_FEATURE_EDMA_HAS_PRIORITY_ERROR) && (FSL_FEATURE_EDMA_HAS_PRIORITY_ERROR > 1) - kEDMA_ChannelPriorityErrorFlag = DMA_ERR_CPE_FLAG, /*!< Channel priority is not unique. */ -#endif - kEDMA_TransferCanceledFlag = DMA_ERR_ECX_FLAG, /*!< Transfer cancelled */ -#if defined(FSL_FEATURE_EDMA_CHANNEL_GROUP_COUNT) && (FSL_FEATURE_EDMA_CHANNEL_GROUP_COUNT > 1) - kEDMA_GroupPriorityErrorFlag = DMA_ERR_GPE_FLAG, /*!< Group priority is not unique. */ -#endif - kEDMA_ValidFlag = (int)DMA_ERR_FLAG, /*!< No error occurred, this bit is 0. Otherwise, it is 1. */ -}; - -/*! @brief _edma_interrupt_enable eDMA interrupt source */ -enum -{ - kEDMA_ErrorInterruptEnable = 0x1U, /*!< Enable interrupt while channel error occurs. */ - kEDMA_MajorInterruptEnable = DMA_CSR_INTMAJOR_MASK, /*!< Enable interrupt while major count exhausted. */ - kEDMA_HalfInterruptEnable = DMA_CSR_INTHALF_MASK, /*!< Enable interrupt while major count to half value. */ -}; - -/*! @brief eDMA transfer type */ -typedef enum _edma_transfer_type -{ - kEDMA_MemoryToMemory = 0x0U, /*!< Transfer from memory to memory */ - kEDMA_PeripheralToMemory, /*!< Transfer from peripheral to memory */ - kEDMA_MemoryToPeripheral, /*!< Transfer from memory to peripheral */ - kEDMA_PeripheralToPeripheral, /*!< Transfer from Peripheral to peripheral */ -} edma_transfer_type_t; - -/*! @brief eDMA channel priority configuration */ -typedef struct _edma_channel_Preemption_config -{ - bool enableChannelPreemption; /*!< If true: a channel can be suspended by other channel with higher priority */ - bool enablePreemptAbility; /*!< If true: a channel can suspend other channel with low priority */ - uint8_t channelPriority; /*!< Channel priority */ -} edma_channel_Preemption_config_t; - -/*! @brief eDMA minor offset configuration */ -typedef struct _edma_minor_offset_config -{ - bool enableSrcMinorOffset; /*!< Enable(true) or Disable(false) source minor loop offset. */ - bool enableDestMinorOffset; /*!< Enable(true) or Disable(false) destination minor loop offset. */ - uint32_t minorOffset; /*!< Offset for a minor loop mapping. */ -} edma_minor_offset_config_t; - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG && FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE && FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE -/*! @brief eDMA channel memory attribute */ -typedef enum edma_channel_memory_attribute -{ - kEDMA_ChannelNoWriteNoReadNoCacheNoBuffer = - 0x0U, /*!< No write allocate, no read allocate, non-cacheable, non-bufferable. */ - kEDMA_ChannelNoWriteNoReadNoCacheBufferable, /*!< No write allocate, no read allocate, non-cacheable, bufferable. - */ - kEDMA_ChannelNoWriteNoReadCacheableNoBuffer, /*!< No write allocate, no read allocate, cacheable, non-bufferable. - */ - kEDMA_ChannelNoWriteNoReadCacheableBufferable, /*!< No write allocate, no read allocate, cacheable, bufferable. */ - kEDMA_ChannelNoWriteReadNoCacheNoBuffer, /*!< No write allocate, read allocate, non-cacheable, non-bufferable. */ - kEDMA_ChannelNoWriteReadNoCacheBufferable, /*!< No write allocate, read allocate, non-cacheable, bufferable. */ - kEDMA_ChannelNoWriteReadCacheableNoBuffer, /*!< No write allocate, read allocate, cacheable, non-bufferable. */ - kEDMA_ChannelNoWriteReadCacheableBufferable, /*!< No write allocate, read allocate, cacheable, bufferable. */ - kEDMA_ChannelWriteNoReadNoCacheNoBuffer, /*!< write allocate, no read allocate, non-cacheable, non-bufferable. */ - kEDMA_ChannelWriteNoReadNoCacheBufferable, /*!< write allocate, no read allocate, non-cacheable, bufferable. */ - kEDMA_ChannelWriteNoReadCacheableNoBuffer, /*!< write allocate, no read allocate, cacheable, non-bufferable. */ - kEDMA_ChannelWriteNoReadCacheableBufferable, /*!< write allocate, no read allocate, cacheable, bufferable. */ - kEDMA_ChannelWriteReadNoCacheNoBuffer, /*!< write allocate, read allocate, non-cacheable, non-bufferable. */ - kEDMA_ChannelWriteReadNoCacheBufferable, /*!< write allocate, read allocate, non-cacheable, bufferable. */ - kEDMA_ChannelWriteReadCacheableNoBuffer, /*!< write allocate, read allocate, cacheable, non-bufferable. */ - kEDMA_ChannelWriteReadCacheableBufferable, /*!< write allocate, read allocate, cacheable, bufferable. */ -} edma_channel_memory_attribute_t; -#endif - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE && FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE -/*! @brief eDMA4 channel swap size */ -typedef enum _edma_channel_swap_size -{ - kEDMA_ChannelSwapDisabled = 0x0U, /*!< Swap is disabled. */ - kEDMA_ChannelReadWith8bitSwap = 0x1U, /*!< Swap occurs with respect to the read 8bit. */ - kEDMA_ChannelReadWith16bitSwap = 0x2U, /*!< Swap occurs with respect to the read 16bit. */ - kEDMA_ChannelReadWith32bitSwap = 0x3U, /*!< Swap occurs with respect to the read 32bit. */ - kEDMA_ChannelWriteWith8bitSwap = 0x9U, /*!< Swap occurs with respect to the write 8bit. */ - kEDMA_ChannelWriteWith16bitSwap = 0x10U, /*!< Swap occurs with respect to the write 16bit. */ - kEDMA_ChannelWriteWith32bitSwap = 0x11U, /*!< Swap occurs with respect to the write 32bit. */ -} edma_channel_swap_size_t; -#endif - -/*! @brief eDMA channel system bus information, _edma_channel_sys_bus_info*/ -enum -{ -#if !(defined(FSL_FEATURE_EDMA_HAS_NO_CH_SBR_ATTR) && FSL_FEATURE_EDMA_HAS_NO_CH_SBR_ATTR) - kEDMA_AttributeOutput = DMA_CH_SBR_ATTR_MASK, /*!< DMA's AHB system bus attribute output value. */ -#endif - - kEDMA_PrivilegedAccessLevel = DMA_CH_SBR_PAL_MASK, /*!< Privileged Access Level for DMA transfers. 0b - User - protection level; 1b - Privileged protection level. */ - kEDMA_MasterId = - DMA_CH_SBR_MID_MASK, /*!< DMA's master ID when channel is active and master ID replication is enabled. */ -}; - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE && FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE -/*! @brief eDMA4 channel access type */ -typedef enum _edma_channel_access_type -{ - kEDMA_ChannelDataAccess = 0x0U, /*!< Data access for eDMA4 transfers. */ - kEDMA_ChannelInstructionAccess = 0x1U, /*!< Instruction access for eDMA4 transfers. */ -} edma_channel_access_type_t; -#endif - -/*! @brief eDMA4 channel protection level */ -typedef enum _edma_channel_protection_level -{ - kEDMA_ChannelProtectionLevelUser = 0x0U, /*!< user protection level for eDMA transfers. */ - kEDMA_ChannelProtectionLevelPrivileged = 0x1U, /*!< Privileged protection level eDMA transfers. */ -} edma_channel_protection_level_t; - -#if !(defined(FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) && FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) - -/*! @brief eDMA4 channel security level */ -typedef enum _edma_channel_security_level -{ - kEDMA_ChannelSecurityLevelNonSecure = 0x0U, /*!< non secure level for eDMA transfers. */ - kEDMA_ChannelSecurityLevelSecure = 0x1U, /*!< secure level for eDMA transfers. */ -} edma_channel_security_level_t; -#endif - -/*! @brief eDMA4 channel configuration*/ -typedef struct _edma_channel_config -{ - edma_channel_Preemption_config_t channelPreemptionConfig; /*!< channel preemption configuration */ - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE && FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE - edma_channel_memory_attribute_t channelReadMemoryAttribute; /*!< channel memory read attribute configuration */ - edma_channel_memory_attribute_t channelWriteMemoryAttribute; /*!< channel memory write attribute configuration */ -#endif - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE && FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE - edma_channel_swap_size_t channelSwapSize; /*!< channel swap size configuration */ -#endif - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE && FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE - edma_channel_access_type_t channelAccessType; /*!< channel access type configuration */ -#endif - - uint8_t channelDataSignExtensionBitPosition; /*!< channel data sign extension bit psition configuration */ - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_CHANNEL_MUX - int channelRequestSource; /*!< hardware service request source for the channel */ -#endif - - bool enableMasterIDReplication; /*!< enable master ID replication */ -#if !(defined(FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) && FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) - edma_channel_security_level_t securityLevel; /*!< security level */ -#endif - edma_channel_protection_level_t protectionLevel; /*!< protection level */ - -} edma_channel_config_t; -#endif - -/*! - * @brief eDMA TCD. - * - * This structure is same as TCD register which is described in reference manual, - * and is used to configure the scatter/gather feature as a next hardware TCD. - */ -typedef edma_core_tcd_t edma_tcd_t; - -/*! @brief edma4 channel transfer configuration - * - * The transfer configuration structure support full feature configuration of the transfer control descriptor. - * - * @note User should pay attention to the transfer size alignment limitation - * 1. the bytesEachRequest should align with the srcWidthOfEachTransfer and the dstWidthOfEachTransfer - * that is to say bytesEachRequest % srcWidthOfEachTransfer should be 0 - * 2. the srcOffsetOfEachTransfer and dstOffsetOfEachTransfer must be aligne with transfer width - * 3. the totalBytes should align with the bytesEachRequest - * 4. the srcAddr should align with the srcWidthOfEachTransfer - * 5. the dstAddr should align with the dstWidthOfEachTransfer - * 6. the srcAddr should align with srcAddrModulo if modulo feature is enabled - * 7. the dstAddr should align with dstAddrModulo if modulo feature is enabled - * If anyone of above condition can not be satisfied, the edma4 interfaces will generate assert error. - * - * 1.To perform a simple transfer, below members should be initialized at least - * .srcAddr - source address - * .dstAddr - destination address - * .srcWidthOfEachTransfer - data width of source address - * .dstWidthOfEachTransfer - data width of destination address, normally it should be as same as - * srcWidthOfEachTransfer .bytesEachRequest - bytes to be transferred in each DMA request .totalBytes - total - * bytes to be transferred .srcOffsetOfEachTransfer - offset value in bytes unit to be applied to source address as - * each source read is completed .dstOffsetOfEachTransfer - offset value in bytes unit to be applied to destination - * address as each destination write is completed enablchannelRequest - channel request can be enabled together with - * transfer configure submission - * - * 2.The transfer configuration structure also support advance feature: - * Programmable source/destination address range(MODULO) - * Programmable minor loop offset - * Programmable major loop offset - * Programmable channel chain feature - * Programmable channel transfer control descriptor link feature - * - */ -typedef struct _edma_transfer_config -{ - uint32_t srcAddr; /*!< Source data address. */ - uint32_t destAddr; /*!< Destination data address. */ - edma_transfer_size_t srcTransferSize; /*!< Source data transfer size. */ - edma_transfer_size_t destTransferSize; /*!< Destination data transfer size. */ - int16_t srcOffset; /*!< Sign-extended offset value in byte unit applied to the current source - address to form the next-state value as each source read is completed */ - int16_t destOffset; /*!< Sign-extended offset value in byte unit applied to the current destination - address to form the next-state value as each destination write is completed. */ - uint32_t minorLoopBytes; /*!< bytes in each minor loop or each request - * range: 1 - (2^30 -1) when minor loop mapping is enabled - * range: 1 - (2^10 - 1) when minor loop mapping is enabled and source or dest minor - * loop offset is enabled - * range: 1 - (2^32 - 1) when minor loop mapping is disabled - */ - uint32_t majorLoopCounts; /*!< minor loop counts in each major loop, should be 1 at least for each - * transfer range: (0 - (2^15 - 1)) when minor loop channel link is - * disabled range: (0 - (2^9 - 1)) when minor loop channel link is enabled - * total bytes in a transfer = minorLoopCountsEachMajorLoop * - * bytesEachMinorLoop - */ - - uint16_t enabledInterruptMask; /*!< channel interrupt to enable, can be OR'ed value of _edma_interrupt_enable */ - - edma_modulo_t srcAddrModulo; /*!< source circular data queue range */ - int32_t srcMajorLoopOffset; /*!< source major loop offset */ - - edma_modulo_t dstAddrModulo; /*!< destination circular data queue range */ - int32_t dstMajorLoopOffset; /*!< destination major loop offset */ - - bool enableSrcMinorLoopOffset; /*!< enable source minor loop offset */ - bool enableDstMinorLoopOffset; /*!< enable dest minor loop offset */ - int32_t minorLoopOffset; /*!< burst offset, the offset will be applied after minor loop update */ - - bool enableChannelMajorLoopLink; /*!< channel link when major loop complete */ - uint32_t majorLoopLinkChannel; /*!< major loop link channel number */ - - bool enableChannelMinorLoopLink; /*!< channel link when minor loop complete */ - uint32_t minorLoopLinkChannel; /*!< minor loop link channel number */ - - edma_tcd_t *linkTCD; /*!< pointer to the link transfer control descriptor */ -} edma_transfer_config_t; - -/*! @brief eDMA global configuration structure.*/ -typedef struct _edma_config -{ -#if defined FSL_FEATURE_EDMA_HAS_CONTINUOUS_LINK_MODE && FSL_FEATURE_EDMA_HAS_CONTINUOUS_LINK_MODE - bool enableContinuousLinkMode; /*!< Enable (true) continuous link mode. Upon minor loop completion, the channel - activates again if that channel has a minor loop channel link enabled and - the link channel is itself. */ -#endif - -#if defined FSL_FEATURE_EDMA_HAS_GLOBAL_MASTER_ID_REPLICATION && FSL_FEATURE_EDMA_HAS_GLOBAL_MASTER_ID_REPLICATION - bool enableMasterIdReplication; /*!< Enable (true) master ID replication. If Master ID replication is disabled, the - privileged protection level (supervisor mode) for eDMA4 transfers is used. */ -#endif - - bool enableGlobalChannelLink; /*!< Enable(true) channel linking is available and controlled by each channel's link - settings. */ - - bool enableHaltOnError; /*!< Enable (true) transfer halt on error. Any error causes the HALT bit to set. - Subsequently, all service requests are ignored until the HALT bit is cleared.*/ - - bool enableDebugMode; /*!< Enable(true) eDMA4 debug mode. When in debug mode, the eDMA4 stalls the start of - a new channel. Executing channels are allowed to complete. */ - - bool enableRoundRobinArbitration; /*!< Enable(true) channel linking is available and controlled by each channel's - link settings. */ -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG && FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG - edma_channel_config_t *channelConfig[FSL_FEATURE_EDMA_MODULE_CHANNEL]; /*!< channel preemption configuration */ -#endif -} edma_config_t; - -/*! @brief Callback for eDMA */ -struct _edma_handle; - -/*! @brief Define callback function for eDMA. - * - * This callback function is called in the EDMA interrupt handle. - * In normal mode, run into callback function means the transfer users need is done. - * In scatter gather mode, run into callback function means a transfer control block (tcd) is finished. Not - * all transfer finished, users can get the finished tcd numbers using interface EDMA_GetUnusedTCDNumber. - * - * @param handle EDMA handle pointer, users shall not touch the values inside. - * @param userData The callback user parameter pointer. Users can use this parameter to involve things users need to - * change in EDMA callback function. - * @param transferDone If the current loaded transfer done. In normal mode it means if all transfer done. In scatter - * gather mode, this parameter shows is the current transfer block in EDMA register is done. As the - * load of core is different, it will be different if the new tcd loaded into EDMA registers while - * this callback called. If true, it always means new tcd still not loaded into registers, while - * false means new tcd already loaded into registers. - * @param tcds How many tcds are done from the last callback. This parameter only used in scatter gather mode. It - * tells user how many tcds are finished between the last callback and this. - */ -typedef void (*edma_callback)(struct _edma_handle *handle, void *userData, bool transferDone, uint32_t tcds); - -/*! @brief eDMA transfer handle structure */ -typedef struct _edma_handle -{ - edma_callback callback; /*!< Callback function for major count exhausted. */ - void *userData; /*!< Callback function parameter. */ - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG && FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG - EDMA_ChannelType *channelBase; /*!< eDMA peripheral channel base address. */ -#endif - EDMA_Type *base; /*!< eDMA peripheral base address*/ - EDMA_TCDType *tcdBase; /*!< eDMA peripheral tcd base address. */ - - edma_tcd_t *tcdPool; /*!< Pointer to memory stored TCDs. */ - uint32_t channel; /*!< eDMA channel number. */ - - volatile int8_t header; /*!< The first TCD index. Should point to the next TCD to be loaded into the eDMA engine. */ - volatile int8_t tail; /*!< The last TCD index. Should point to the next TCD to be stored into the memory pool. */ - volatile int8_t tcdUsed; /*!< The number of used TCD slots. Should reflect the number of TCDs can be used/loaded in - the memory. */ - volatile int8_t tcdSize; /*!< The total number of TCD slots in the queue. */ -} edma_handle_t; -/******************************************************************************* - * APIs - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name eDMA initialization and de-initialization - * @{ - */ - -/*! - * @brief Initializes the eDMA peripheral. - * - * This function ungates the eDMA clock and configures the eDMA peripheral according - * to the configuration structure. - * - * @param base eDMA peripheral base address. - * @param config A pointer to the configuration structure, see "edma_config_t". - * @note This function enables the minor loop map feature. - */ -void EDMA_Init(EDMA_Type *base, const edma_config_t *config); - -/*! - * @brief Deinitializes the eDMA peripheral. - * - * This function gates the eDMA clock. - * - * @param base eDMA peripheral base address. - */ -void EDMA_Deinit(EDMA_Type *base); - -/*! - * @brief Push content of TCD structure into hardware TCD register. - * - * @param base EDMA peripheral base address. - * @param channel EDMA channel number. - * @param tcd Point to TCD structure. - */ -void EDMA_InstallTCD(EDMA_Type *base, uint32_t channel, const edma_tcd_t *tcd); - -/*! - * @brief Gets the eDMA default configuration structure. - * - * This function sets the configuration structure to default values. - * The default configuration is set to the following values. - * @code - * config.enableContinuousLinkMode = false; - * config.enableHaltOnError = true; - * config.enableRoundRobinArbitration = false; - * config.enableDebugMode = false; - * @endcode - * - * @param config A pointer to the eDMA configuration structure. - */ -void EDMA_GetDefaultConfig(edma_config_t *config); - -#if defined(FSL_FEATURE_DMA_HAS_CONTINUOUS_CHANNEL_LINK) && FSL_FEATURE_DMA_HAS_CONTINUOUS_CHANNEL_LINK -/*! - * @brief Enable/Disable continuous channel link mode. - * - * @note Do not use continuous link mode with a channel linking to itself if there is only one minor loop - * iteration per service request, for example, if the channel's NBYTES value is the same as either - * the source or destination size. The same data transfer profile can be achieved by simply - * increasing the NBYTES value, which provides more efficient, faster processing. - * - * @param base EDMA peripheral base address. - * @param enable true is enable, false is disable. - */ -static inline void EDMA_EnableContinuousChannelLinkMode(EDMA_Type *base, bool enable) -{ - if (enable) - { - EDMA_BASE(base)->CR |= DMA_CR_CLM_MASK; - } - else - { - EDMA_BASE(base)->CR &= ~DMA_CR_CLM_MASK; - } -} -#endif - -#if defined(FSL_FEATURE_DMA_HAS_MINOR_LOOP_MAPPING) && FSL_FEATURE_DMA_HAS_MINOR_LOOP_MAPPING -/*! - * @brief Enable/Disable minor loop mapping. - * - * The TCDn.word2 is redefined to include individual enable fields, an offset field, and the - * NBYTES field. - * - * @param base EDMA peripheral base address. - * @param enable true is enable, false is disable. - */ -static inline void EDMA_EnableMinorLoopMapping(EDMA_Type *base, bool enable) -{ - if (enable) - { - EDMA_BASE(base)->CR |= DMA_CR_EMLM_MASK; - } - else - { - EDMA_BASE(base)->CR &= ~DMA_CR_EMLM_MASK; - } -} -#endif - -/* @} */ -/*! - * @name eDMA Channel Operation - * @{ - */ - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG && FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG -/*! - * @brief EDMA Channel initialization - * - * @param base eDMA4 peripheral base address. - * @param channel eDMA4 channel number. - * @param channelConfig pointer to user's eDMA4 channel config structure, see edma_channel_config_t for detail. - */ -void EDMA_InitChannel(EDMA_Type *base, uint32_t channel, edma_channel_config_t *channelConfig); - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE && FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE -/*! - * @brief Set channel memory attribute. - * - * @param base eDMA4 peripheral base address. - * @param channel eDMA4 channel number. - * @param writeAttribute Attributes associated with a write transaction. - * @param readAttribute Attributes associated with a read transaction. - */ -static inline void EDMA_SetChannelMemoryAttribute(EDMA_Type *base, - uint32_t channel, - edma_channel_memory_attribute_t writeAttribute, - edma_channel_memory_attribute_t readAttribute) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - if (0U != (uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_MEMORY_ATTRIBUTEn(base)) - { - EDMA_CHANNEL_BASE(base, channel)->CH_MATTR = - DMA_CH_MATTR_WCACHE(writeAttribute) | DMA_CH_MATTR_RCACHE(readAttribute); - } -} -#endif - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_SIGN_EXTENSION && FSL_FEATURE_EDMA_HAS_CHANNEL_SIGN_EXTENSION -/*! - * @brief Set channel sign extension. - * - * @param base eDMA4 peripheral base address. - * @param channel eDMA4 channel number. - * @param position A non-zero value specifing the sign extend bit position. - * If 0, sign extension is disabled. - */ -static inline void EDMA_SetChannelSignExtension(EDMA_Type *base, uint32_t channel, uint8_t position) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - if (0U != (uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_SIGN_EXTENSIONn(base)) - { - EDMA_CHANNEL_BASE(base, channel)->CH_CSR = - (EDMA_CHANNEL_BASE(base, channel)->CH_CSR & (~DMA_CH_CSR_SIGNEXT_MASK)) | - ((uint32_t)position << DMA_CH_CSR_SIGNEXT_SHIFT); - } -} -#endif - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE && FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE -/*! - * @brief Set channel swap size. - * - * @param base eDMA4 peripheral base address. - * @param channel eDMA4 channel number. - * @param swapSize Swap occurs with respect to the specified transfer size. - * If 0, swap is disabled. - */ -static inline void EDMA_SetChannelSwapSize(EDMA_Type *base, uint32_t channel, edma_channel_swap_size_t swapSize) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - if (0U != (uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_SWAP_SIZEn(base)) - { - EDMA_CHANNEL_BASE(base, channel)->CH_CSR = - (EDMA_CHANNEL_BASE(base, channel)->CH_CSR & (~DMA_CH_CSR_SWAP_MASK)) | - ((uint32_t)swapSize << DMA_CH_CSR_SWAP_SHIFT); - } -} -#endif - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE && FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE -/*! - * @brief Set channel access type. - * - * @param base eDMA4 peripheral base address. - * @param channel eDMA4 channel number. - * @param channelAccessType eDMA4's transactions type on the system bus when the channel is active. - */ -static inline void EDMA_SetChannelAccessType(EDMA_Type *base, - uint32_t channel, - edma_channel_access_type_t channelAccessType) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - if (0U != (uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_ACCESS_TYPEn(base)) - { - EDMA_CHANNEL_BASE(base, channel)->CH_SBR = - (EDMA_CHANNEL_BASE(base, channel)->CH_SBR & (~DMA_CH_SBR_INSTR_MASK)) | - ((uint32_t)channelAccessType << DMA_CH_SBR_INSTR_SHIFT); - } -} -#endif - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_CHANNEL_MUX -/*! - * @brief Set channel request source. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param channelRequestSource eDMA hardware service request source for the channel. User need to use - * the dma_request_source_t type as the input parameter. Note that devices - * may use other enum type to express dma request source and User can fined it in - * SOC header or fsl_edma_soc.h. - */ -static inline void EDMA_SetChannelMux(EDMA_Type *base, uint32_t channel, int32_t channelRequestSource) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - if ((uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_MUXn(base) == 1U) - { - EDMA_CHANNEL_BASE(base, channel)->CH_MUX = DMA_CH_MUX_SOURCE(channelRequestSource); - } -} -#endif - -/*! - * @brief Gets the channel identification and attribute information on the system bus interface. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @return The mask of the channel system bus information. Users need to use the - * _edma_channel_sys_bus_info type to decode the return variables. - */ -static inline uint32_t EDMA_GetChannelSystemBusInformation(EDMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - return EDMA_CHANNEL_BASE(base, channel)->CH_SBR; -} - -/*! - * @brief Set channel master ID replication. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param enable true is enable, false is disable. - */ -static inline void EDMA_EnableChannelMasterIDReplication(EDMA_Type *base, uint32_t channel, bool enable) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - if (enable) - { - EDMA_CHANNEL_BASE(base, channel)->CH_SBR |= DMA_CH_SBR_EMI_MASK; - } - else - { - EDMA_CHANNEL_BASE(base, channel)->CH_SBR &= ~DMA_CH_SBR_EMI_MASK; - } -} - -#if !(defined(FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) && FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) -/*! - * @brief Set channel security level. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param level security level. - */ -static inline void EDMA_SetChannelSecurityLevel(EDMA_Type *base, uint32_t channel, edma_channel_security_level_t level) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - if (level == kEDMA_ChannelSecurityLevelSecure) - { - EDMA_CHANNEL_BASE(base, channel)->CH_SBR |= DMA_CH_SBR_SEC_MASK; - } - else - { - EDMA_CHANNEL_BASE(base, channel)->CH_SBR &= ~DMA_CH_SBR_SEC_MASK; - } -} -#endif - -/*! - * @brief Set channel security level. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param level security level. - */ -static inline void EDMA_SetChannelProtectionLevel(EDMA_Type *base, - uint32_t channel, - edma_channel_protection_level_t level) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - if (level == kEDMA_ChannelProtectionLevelPrivileged) - { - EDMA_CHANNEL_BASE(base, channel)->CH_SBR |= DMA_CH_SBR_PAL_MASK; - } - else - { - EDMA_CHANNEL_BASE(base, channel)->CH_SBR &= ~DMA_CH_SBR_PAL_MASK; - } -} - -#endif -/*! - * @brief Sets all TCD registers to default values. - * - * This function sets TCD registers for this channel to default values. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @note This function must not be called while the channel transfer is ongoing - * or it causes unpredictable results. - * @note This function enables the auto stop request feature. - */ -void EDMA_ResetChannel(EDMA_Type *base, uint32_t channel); - -/*! - * @brief Configures the eDMA transfer attribute. - * - * This function configures the transfer attribute, including source address, destination address, - * transfer size, address offset, and so on. It also configures the scatter gather feature if the - * user supplies the TCD address. - * Example: - * @code - * edma_transfer_t config; - * edma_tcd_t tcd; - * config.srcAddr = ..; - * config.destAddr = ..; - * ... - * EDMA_SetTransferConfig(DMA0, channel, &config, &stcd); - * @endcode - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param config Pointer to eDMA transfer configuration structure. - * @param nextTcd Point to TCD structure. It can be NULL if users - * do not want to enable scatter/gather feature. - * @note If nextTcd is not NULL, it means scatter gather feature is enabled - * and DREQ bit is cleared in the previous transfer configuration, which - * is set in the eDMA_ResetChannel. - */ -void EDMA_SetTransferConfig(EDMA_Type *base, - uint32_t channel, - const edma_transfer_config_t *config, - edma_tcd_t *nextTcd); - -/*! - * @brief Configures the eDMA minor offset feature. - * - * The minor offset means that the signed-extended value is added to the source address or destination - * address after each minor loop. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param config A pointer to the minor offset configuration structure. - */ -void EDMA_SetMinorOffsetConfig(EDMA_Type *base, uint32_t channel, const edma_minor_offset_config_t *config); - -/*! - * @brief Configures the eDMA channel preemption feature. - * - * This function configures the channel preemption attribute and the priority of the channel. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number - * @param config A pointer to the channel preemption configuration structure. - */ -void EDMA_SetChannelPreemptionConfig(EDMA_Type *base, uint32_t channel, const edma_channel_Preemption_config_t *config); - -/*! - * @brief Sets the channel link for the eDMA transfer. - * - * This function configures either the minor link or the major link mode. The minor link means that the channel link is - * triggered every time CITER decreases by 1. The major link means that the channel link is triggered when the CITER is - * exhausted. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param type A channel link type, which can be one of the following: - * @arg kEDMA_LinkNone - * @arg kEDMA_MinorLink - * @arg kEDMA_MajorLink - * @param linkedChannel The linked channel number. - * @note Users should ensure that DONE flag is cleared before calling this interface, or the configuration is invalid. - */ -void EDMA_SetChannelLink(EDMA_Type *base, uint32_t channel, edma_channel_link_type_t type, uint32_t linkedChannel); - -#if defined FSL_FEATURE_EDMA_HAS_BANDWIDTH && FSL_FEATURE_EDMA_HAS_BANDWIDTH -/*! - * @brief Sets the bandwidth for the eDMA transfer. - * - * Because the eDMA processes the minor loop, it continuously generates read/write sequences - * until the minor count is exhausted. The bandwidth forces the eDMA to stall after the completion of - * each read/write access to control the bus request bandwidth seen by the crossbar switch. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param bandWidth A bandwidth setting, which can be one of the following: - * @arg kEDMABandwidthStallNone - * @arg kEDMABandwidthStall4Cycle - * @arg kEDMABandwidthStall8Cycle - */ -void EDMA_SetBandWidth(EDMA_Type *base, uint32_t channel, edma_bandwidth_t bandWidth); -#endif - -/*! - * @brief Sets the source modulo and the destination modulo for the eDMA transfer. - * - * This function defines a specific address range specified to be the value after (SADDR + SOFF)/(DADDR + DOFF) - * calculation is performed or the original register value. It provides the ability to implement a circular data - * queue easily. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param srcModulo A source modulo value. - * @param destModulo A destination modulo value. - */ -void EDMA_SetModulo(EDMA_Type *base, uint32_t channel, edma_modulo_t srcModulo, edma_modulo_t destModulo); - -#if defined(FSL_FEATURE_EDMA_ASYNCHRO_REQUEST_CHANNEL_COUNT) && FSL_FEATURE_EDMA_ASYNCHRO_REQUEST_CHANNEL_COUNT -/*! - * @brief Enables an async request for the eDMA transfer. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param enable The command to enable (true) or disable (false). - */ -static inline void EDMA_EnableAsyncRequest(EDMA_Type *base, uint32_t channel, bool enable) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - EDMA_BASE(base)->EARS &= ~((uint32_t)1U << channel); - EDMA_BASE(base)->EARS |= ((uint32_t)(true == enable ? 1U : 0U) << channel); -#else - if (enable) - { - EDMA_CHANNEL_BASE(base, channel)->CH_CSR |= DMA_CH_CSR_EARQ_MASK; - } - else - { - EDMA_CHANNEL_BASE(base, channel)->CH_CSR &= ~DMA_CH_CSR_EARQ_MASK; - } -#endif -} -#endif - -/*! - * @brief Enables an auto stop request for the eDMA transfer. - * - * If enabling the auto stop request, the eDMA hardware automatically disables the hardware channel request. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param enable The command to enable (true) or disable (false). - */ -static inline void EDMA_EnableAutoStopRequest(EDMA_Type *base, uint32_t channel, bool enable) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - if (enable) - { - EDMA_TCD_BASE(base, channel)->CSR |= DMA_CSR_DREQ_MASK; - } - else - { - EDMA_TCD_BASE(base, channel)->CSR &= ~(uint16_t)DMA_CSR_DREQ_MASK; - } -} - -/*! - * @brief Enables the interrupt source for the eDMA transfer. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_EnableChannelInterrupts(EDMA_Type *base, uint32_t channel, uint32_t mask); - -/*! - * @brief Disables the interrupt source for the eDMA transfer. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param mask The mask of the interrupt source to be set. Use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_DisableChannelInterrupts(EDMA_Type *base, uint32_t channel, uint32_t mask); - -/*! - * @brief Configures the eDMA channel TCD major offset feature. - * - * Adjustment value added to the source address at the completion of the major iteration count - * - * @param base eDMA peripheral base address. - * @param channel edma channel number. - * @param sourceOffset source address offset will be applied to source address after major loop done. - * @param destOffset destination address offset will be applied to source address after major loop done. - */ -void EDMA_SetMajorOffsetConfig(EDMA_Type *base, uint32_t channel, int32_t sourceOffset, int32_t destOffset); - -/* @} */ -/*! - * @name eDMA TCD Operation - * @{ - */ -/*! - * @brief Sets TCD fields according to the user's channel transfer configuration structure, @ref - * edma_transfer_config_t. - * - * Application should be careful about the TCD pool buffer storage class, - * - For the platform has cache, the software TCD should be put in non cache section - * - The TCD pool buffer should have a consistent storage class. - * - * @param tcd Pointer to the TCD structure. - * @param transfer channel transfer configuration pointer. - * - * @note This function enables the auto stop request feature. - */ -void EDMA_ConfigChannelSoftwareTCD(edma_tcd_t *tcd, const edma_transfer_config_t *transfer); - -/*! - * @brief Sets all fields to default values for the TCD structure. - * - * This function sets all fields for this TCD structure to default value. - * - * @param tcd Pointer to the TCD structure. - * @note This function enables the auto stop request feature. - */ -void EDMA_TcdReset(edma_tcd_t *tcd); - -/*! - * @brief Configures the eDMA TCD transfer attribute. - * - * The TCD is a transfer control descriptor. The content of the TCD is the same as the hardware TCD registers. - * The TCD is used in the scatter-gather mode. - * This function configures the TCD transfer attribute, including source address, destination address, - * transfer size, address offset, and so on. It also configures the scatter gather feature if the - * user supplies the next TCD address. - * Example: - * @code - * edma_transfer_t config = { - * ... - * } - * edma_tcd_t tcd __aligned(32); - * edma_tcd_t nextTcd __aligned(32); - * EDMA_TcdSetTransferConfig(&tcd, &config, &nextTcd); - * @endcode - * - * @param tcd Pointer to the TCD structure. - * @param config Pointer to eDMA transfer configuration structure. - * @param nextTcd Pointer to the next TCD structure. It can be NULL if users - * do not want to enable scatter/gather feature. - * @note TCD address should be 32 bytes aligned or it causes an eDMA error. - * @note If the nextTcd is not NULL, the scatter gather feature is enabled - * and DREQ bit is cleared in the previous transfer configuration, which - * is set in the EDMA_TcdReset. - */ -void EDMA_TcdSetTransferConfig(edma_tcd_t *tcd, const edma_transfer_config_t *config, edma_tcd_t *nextTcd); - -/*! - * @brief Configures the eDMA TCD minor offset feature. - * - * A minor offset is a signed-extended value added to the source address or a destination - * address after each minor loop. - * - * @param tcd A point to the TCD structure. - * @param config A pointer to the minor offset configuration structure. - */ -void EDMA_TcdSetMinorOffsetConfig(edma_tcd_t *tcd, const edma_minor_offset_config_t *config); - -/*! - * @brief Sets the channel link for the eDMA TCD. - * - * This function configures either a minor link or a major link. The minor link means the channel link is - * triggered every time CITER decreases by 1. The major link means that the channel link is triggered when the CITER is - * exhausted. - * - * @note Users should ensure that DONE flag is cleared before calling this interface, or the configuration is invalid. - * @param tcd Point to the TCD structure. - * @param type Channel link type, it can be one of: - * @arg kEDMA_LinkNone - * @arg kEDMA_MinorLink - * @arg kEDMA_MajorLink - * @param linkedChannel The linked channel number. - */ -void EDMA_TcdSetChannelLink(edma_tcd_t *tcd, edma_channel_link_type_t type, uint32_t linkedChannel); - -#if defined FSL_FEATURE_EDMA_HAS_BANDWIDTH && FSL_FEATURE_EDMA_HAS_BANDWIDTH -/*! - * @brief Sets the bandwidth for the eDMA TCD. - * - * Because the eDMA processes the minor loop, it continuously generates read/write sequences - * until the minor count is exhausted. The bandwidth forces the eDMA to stall after the completion of - * each read/write access to control the bus request bandwidth seen by the crossbar switch. - * @param tcd A pointer to the TCD structure. - * @param bandWidth A bandwidth setting, which can be one of the following: - * @arg kEDMABandwidthStallNone - * @arg kEDMABandwidthStall4Cycle - * @arg kEDMABandwidthStall8Cycle - */ -static inline void EDMA_TcdSetBandWidth(edma_tcd_t *tcd, edma_bandwidth_t bandWidth) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - - tcd->CSR = (uint16_t)((tcd->CSR & (~DMA_CSR_BWC_MASK)) | DMA_CSR_BWC(bandWidth)); -} -#endif - -/*! - * @brief Sets the source modulo and the destination modulo for the eDMA TCD. - * - * This function defines a specific address range specified to be the value after (SADDR + SOFF)/(DADDR + DOFF) - * calculation is performed or the original register value. It provides the ability to implement a circular data - * queue easily. - * - * @param tcd A pointer to the TCD structure. - * @param srcModulo A source modulo value. - * @param destModulo A destination modulo value. - */ -void EDMA_TcdSetModulo(edma_tcd_t *tcd, edma_modulo_t srcModulo, edma_modulo_t destModulo); - -/*! - * @brief Sets the auto stop request for the eDMA TCD. - * - * If enabling the auto stop request, the eDMA hardware automatically disables the hardware channel request. - * - * @param tcd A pointer to the TCD structure. - * @param enable The command to enable (true) or disable (false). - */ -static inline void EDMA_TcdEnableAutoStopRequest(edma_tcd_t *tcd, bool enable) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - - tcd->CSR = (uint16_t)((tcd->CSR & (~DMA_CSR_DREQ_MASK)) | DMA_CSR_DREQ((true == enable ? 1U : 0U))); -} - -/*! - * @brief Enables the interrupt source for the eDMA TCD. - * - * @param tcd Point to the TCD structure. - * @param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_TcdEnableInterrupts(edma_tcd_t *tcd, uint32_t mask); - -/*! - * @brief Disables the interrupt source for the eDMA TCD. - * - * @param tcd Point to the TCD structure. - * @param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_TcdDisableInterrupts(edma_tcd_t *tcd, uint32_t mask); - -/*! - * @brief Configures the eDMA TCD major offset feature. - * - * Adjustment value added to the source address at the completion of the major iteration count - * - * @param tcd A point to the TCD structure. - * @param sourceOffset source address offset wiil be applied to source address after major loop done. - * @param destOffset destination address offset will be applied to source address after major loop done. - */ -void EDMA_TcdSetMajorOffsetConfig(edma_tcd_t *tcd, int32_t sourceOffset, int32_t destOffset); - -/*! @} */ -/*! - * @name eDMA Channel Transfer Operation - * @{ - */ - -/*! - * @brief Enables the eDMA hardware channel request. - * - * This function enables the hardware channel request. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - */ -static inline void EDMA_EnableChannelRequest(EDMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - EDMA_BASE(base)->SERQ = DMA_SERQ_SERQ(channel); -#else - EDMA_CHANNEL_BASE(base, channel)->CH_CSR |= DMA_CH_CSR_ERQ_MASK; -#endif -} - -/*! - * @brief Disables the eDMA hardware channel request. - * - * This function disables the hardware channel request. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - */ -static inline void EDMA_DisableChannelRequest(EDMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - EDMA_BASE(base)->CERQ = DMA_CERQ_CERQ(channel); -#else - EDMA_CHANNEL_BASE(base, channel)->CH_CSR &= ~DMA_CH_CSR_ERQ_MASK; -#endif -} - -/*! - * @brief Starts the eDMA transfer by using the software trigger. - * - * This function starts a minor loop transfer. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - */ -static inline void EDMA_TriggerChannelStart(EDMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - EDMA_BASE(base)->SSRT = DMA_SSRT_SSRT(channel); -#else - EDMA_TCD_BASE(base, channel)->CSR |= DMA_CSR_START_MASK; -#endif -} - -/*! @} */ -/*! - * @name eDMA Channel Status Operation - * @{ - */ - -/*! - * @brief Gets the remaining major loop count from the eDMA current channel TCD. - * - * This function checks the TCD (Task Control Descriptor) status for a specified - * eDMA channel and returns the number of major loop count that has not finished. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @return Major loop count which has not been transferred yet for the current TCD. - * @note 1. This function can only be used to get unfinished major loop count of transfer without - * the next TCD, or it might be inaccuracy. - * 2. The unfinished/remaining transfer bytes cannot be obtained directly from registers while - * the channel is running. - * Because to calculate the remaining bytes, the initial NBYTES configured in DMA_TCDn_NBYTES_MLNO - * register is needed while the eDMA IP does not support getting it while a channel is active. - * In another word, the NBYTES value reading is always the actual (decrementing) NBYTES value the dma_engine - * is working with while a channel is running. - * Consequently, to get the remaining transfer bytes, a software-saved initial value of NBYTES (for example - * copied before enabling the channel) is needed. The formula to calculate it is shown below: - * RemainingBytes = RemainingMajorLoopCount * NBYTES(initially configured) - */ -uint32_t EDMA_GetRemainingMajorLoopCount(EDMA_Type *base, uint32_t channel); - -/*! - * @brief Gets the eDMA channel error status flags. - * - * @param base eDMA peripheral base address. - * @return The mask of error status flags. Users need to use the - * _edma_error_status_flags type to decode the return variables. - */ -static inline uint32_t EDMA_GetErrorStatusFlags(EDMA_Type *base) -{ -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - return EDMA_BASE(base)->ES; -#else - return EDMA_MP_BASE(base)->MP_ES; -#endif -} - -/*! - * @brief Gets the eDMA channel status flags. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @return The mask of channel status flags. Users need to use the - * _edma_channel_status_flags type to decode the return variables. - */ -uint32_t EDMA_GetChannelStatusFlags(EDMA_Type *base, uint32_t channel); - -/*! - * @brief Clears the eDMA channel status flags. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param mask The mask of channel status to be cleared. Users need to use - * the defined _edma_channel_status_flags type. - */ -void EDMA_ClearChannelStatusFlags(EDMA_Type *base, uint32_t channel, uint32_t mask); - -/*! @} */ -/*! - * @name eDMA Transactional Operation - */ - -/*! - * @brief Creates the eDMA handle. - * - * This function is called if using the transactional API for eDMA. This function - * initializes the internal state of the eDMA handle. - * - * @param handle eDMA handle pointer. The eDMA handle stores callback function and - * parameters. - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - */ -void EDMA_CreateHandle(edma_handle_t *handle, EDMA_Type *base, uint32_t channel); - -/*! - * @brief Installs the TCDs memory pool into the eDMA handle. - * - * This function is called after the EDMA_CreateHandle to use scatter/gather feature. This function shall only be used - * while users need to use scatter gather mode. Scatter gather mode enables EDMA to load a new transfer control block - * (tcd) in hardware, and automatically reconfigure that DMA channel for a new transfer. - * Users need to prepare tcd memory and also configure tcds using interface EDMA_SubmitTransfer. - * - * @param handle eDMA handle pointer. - * @param tcdPool A memory pool to store TCDs. It must be 32 bytes aligned. - * @param tcdSize The number of TCD slots. - */ -void EDMA_InstallTCDMemory(edma_handle_t *handle, edma_tcd_t *tcdPool, uint32_t tcdSize); - -/*! - * @brief Installs a callback function for the eDMA transfer. - * - * This callback is called in the eDMA IRQ handler. Use the callback to do something after - * the current major loop transfer completes. This function will be called every time one tcd finished transfer. - * - * @param handle eDMA handle pointer. - * @param callback eDMA callback function pointer. - * @param userData A parameter for the callback function. - */ -void EDMA_SetCallback(edma_handle_t *handle, edma_callback callback, void *userData); - -/*! - * @brief Prepares the eDMA transfer structure configurations. - * - * This function prepares the transfer configuration structure according to the user input. - * - * @param config The user configuration structure of type edma_transfer_t. - * @param srcAddr eDMA transfer source address. - * @param srcWidth eDMA transfer source address width(bytes). - * @param srcOffset source address offset. - * @param destAddr eDMA transfer destination address. - * @param destWidth eDMA transfer destination address width(bytes). - * @param destOffset destination address offset. - * @param bytesEachRequest eDMA transfer bytes per channel request. - * @param transferBytes eDMA transfer bytes to be transferred. - * @note The data address and the data width must be consistent. For example, if the SRC - * is 4 bytes, the source address must be 4 bytes aligned, or it results in - * source address error (SAE). - * User can check if 128 bytes support is available for specific instance by - * FSL_FEATURE_EDMA_INSTANCE_SUPPORT_128_BYTES_TRANSFERn. - */ -void EDMA_PrepareTransferConfig(edma_transfer_config_t *config, - void *srcAddr, - uint32_t srcWidth, - int16_t srcOffset, - void *destAddr, - uint32_t destWidth, - int16_t destOffset, - uint32_t bytesEachRequest, - uint32_t transferBytes); - -/*! - * @brief Prepares the eDMA transfer structure. - * - * This function prepares the transfer configuration structure according to the user input. - * - * @param config The user configuration structure of type edma_transfer_t. - * @param srcAddr eDMA transfer source address. - * @param srcWidth eDMA transfer source address width(bytes). - * @param destAddr eDMA transfer destination address. - * @param destWidth eDMA transfer destination address width(bytes). - * @param bytesEachRequest eDMA transfer bytes per channel request. - * @param transferBytes eDMA transfer bytes to be transferred. - * @param type eDMA transfer type. - * @note The data address and the data width must be consistent. For example, if the SRC - * is 4 bytes, the source address must be 4 bytes aligned, or it results in - * source address error (SAE). - */ -void EDMA_PrepareTransfer(edma_transfer_config_t *config, - void *srcAddr, - uint32_t srcWidth, - void *destAddr, - uint32_t destWidth, - uint32_t bytesEachRequest, - uint32_t transferBytes, - edma_transfer_type_t type); - -/*! - * @brief Prepares the eDMA transfer content descriptor. - * - * This function prepares the transfer content descriptor structure according to the user input. - * - * @param handle eDMA handle pointer. - * @param tcd Pointer to eDMA transfer content descriptor structure. - * @param srcAddr eDMA transfer source address. - * @param srcWidth eDMA transfer source address width(bytes). - * @param srcOffset source address offset. - * @param destAddr eDMA transfer destination address. - * @param destWidth eDMA transfer destination address width(bytes). - * @param destOffset destination address offset. - * @param bytesEachRequest eDMA transfer bytes per channel request. - * @param transferBytes eDMA transfer bytes to be transferred. - * @param nextTcd eDMA transfer linked TCD address. - * - * @note The data address and the data width must be consistent. For example, if the SRC - * is 4 bytes, the source address must be 4 bytes aligned, or it results in - * source address error (SAE). - */ -void EDMA_PrepareTransferTCD(edma_handle_t *handle, - edma_tcd_t *tcd, - void *srcAddr, - uint32_t srcWidth, - int16_t srcOffset, - void *destAddr, - uint32_t destWidth, - int16_t destOffset, - uint32_t bytesEachRequest, - uint32_t transferBytes, - edma_tcd_t *nextTcd); - -/*! - * @brief Submits the eDMA transfer content descriptor. - * - * This function submits the eDMA transfer request according to the transfer content descriptor. - * In scatter gather mode, call this function will add a configured tcd to the circular list of tcd pool. - * The tcd pools is setup by call function EDMA_InstallTCDMemory before. - * - * Typical user case: - * 1. submit single transfer - * @code - * edma_tcd_t tcd; - * EDMA_PrepareTransferTCD(handle, tcd, ....) - * EDMA_SubmitTransferTCD(handle, tcd) - * EDMA_StartTransfer(handle) - * @endcode - * - * 2. submit static link transfer, - * @code - * edma_tcd_t tcd[2]; - * EDMA_PrepareTransferTCD(handle, &tcd[0], ....) - * EDMA_PrepareTransferTCD(handle, &tcd[1], ....) - * EDMA_SubmitTransferTCD(handle, &tcd[0]) - * EDMA_StartTransfer(handle) - * @endcode - * - * 3. submit dynamic link transfer - * @code - * edma_tcd_t tcdpool[2]; - * EDMA_InstallTCDMemory(&g_DMA_Handle, tcdpool, 2); - * edma_tcd_t tcd; - * EDMA_PrepareTransferTCD(handle, tcd, ....) - * EDMA_SubmitTransferTCD(handle, tcd) - * EDMA_PrepareTransferTCD(handle, tcd, ....) - * EDMA_SubmitTransferTCD(handle, tcd) - * EDMA_StartTransfer(handle) - * @endcode - * - * 4. submit loop transfer - * @code - * edma_tcd_t tcd[2]; - * EDMA_PrepareTransferTCD(handle, &tcd[0], ...,&tcd[1]) - * EDMA_PrepareTransferTCD(handle, &tcd[1], ..., &tcd[0]) - * EDMA_SubmitTransferTCD(handle, &tcd[0]) - * EDMA_StartTransfer(handle) - * @endcode - * - * @param handle eDMA handle pointer. - * @param tcd Pointer to eDMA transfer content descriptor structure. - * - * @retval kStatus_EDMA_Success It means submit transfer request succeed. - * @retval kStatus_EDMA_QueueFull It means TCD queue is full. Submit transfer request is not allowed. - * @retval kStatus_EDMA_Busy It means the given channel is busy, need to submit request later. - */ -status_t EDMA_SubmitTransferTCD(edma_handle_t *handle, const edma_tcd_t *tcd); - -/*! - * @brief Submits the eDMA transfer request. - * - * This function submits the eDMA transfer request according to the transfer configuration structure. - * In scatter gather mode, call this function will add a configured tcd to the circular list of tcd pool. - * The tcd pools is setup by call function EDMA_InstallTCDMemory before. - * - * @param handle eDMA handle pointer. - * @param config Pointer to eDMA transfer configuration structure. - * @retval kStatus_EDMA_Success It means submit transfer request succeed. - * @retval kStatus_EDMA_QueueFull It means TCD queue is full. Submit transfer request is not allowed. - * @retval kStatus_EDMA_Busy It means the given channel is busy, need to submit request later. - */ -status_t EDMA_SubmitTransfer(edma_handle_t *handle, const edma_transfer_config_t *config); - -/*! - * @brief Submits the eDMA scatter gather transfer configurations. - * - * The function is target for submit loop transfer request, - * the ring transfer request means that the transfer request TAIL is link to HEAD, such as, - * A->B->C->D->A, or A->A - * - * To use the ring transfer feature, the application should allocate several transfer object, such as - * @code - * edma_channel_transfer_config_t transfer[2]; - * EDMA_TransferSubmitLoopTransfer(psHandle, &transfer, 2U); - * @endcode - * Then eDMA driver will link transfer[0] and transfer[1] to each other - * - * @note Application should check the return value of this function to avoid transfer request - * submit failed - * - * @param handle eDMA handle pointer - * @param transfer pointer to user's eDMA channel configure structure, see edma_channel_transfer_config_t for detail - * @param transferLoopCount the count of the transfer ring, if loop count is 1, that means that the one will link to - * itself. - * - * @retval #kStatus_Success It means submit transfer request succeed - * @retval #kStatus_EDMA_Busy channel is in busy status - * @retval #kStatus_InvalidArgument Invalid Argument - */ -status_t EDMA_SubmitLoopTransfer(edma_handle_t *handle, edma_transfer_config_t *transfer, uint32_t transferLoopCount); - -/*! - * @brief eDMA starts transfer. - * - * This function enables the channel request. Users can call this function after submitting the transfer request - * or before submitting the transfer request. - * - * @param handle eDMA handle pointer. - */ -void EDMA_StartTransfer(edma_handle_t *handle); - -/*! - * @brief eDMA stops transfer. - * - * This function disables the channel request to pause the transfer. Users can call EDMA_StartTransfer() - * again to resume the transfer. - * - * @param handle eDMA handle pointer. - */ -void EDMA_StopTransfer(edma_handle_t *handle); - -/*! - * @brief eDMA aborts transfer. - * - * This function disables the channel request and clear transfer status bits. - * Users can submit another transfer after calling this API. - * - * @param handle DMA handle pointer. - */ -void EDMA_AbortTransfer(edma_handle_t *handle); - -/*! - * @brief Get unused TCD slot number. - * - * This function gets current tcd index which is run. If the TCD pool pointer is NULL, it will return 0. - * - * @param handle DMA handle pointer. - * @return The unused tcd slot number. - */ -static inline uint32_t EDMA_GetUnusedTCDNumber(edma_handle_t *handle) -{ - int8_t tmpTcdSize = handle->tcdSize; - int8_t tmpTcdUsed = handle->tcdUsed; - return ((uint32_t)tmpTcdSize - (uint32_t)tmpTcdUsed); -} - -/*! - * @brief Get the next tcd address. - * - * This function gets the next tcd address. If this is last TCD, return 0. - * - * @param handle DMA handle pointer. - * @return The next TCD address. - */ -static inline uint32_t EDMA_GetNextTCDAddress(edma_handle_t *handle) -{ - return (uint32_t)(handle->tcdBase->DLAST_SGA); -} - -/*! - * @brief eDMA IRQ handler for the current major loop transfer completion. - * - * This function clears the channel major interrupt flag and calls - * the callback function if it is not NULL. - * - * Note: - * For the case using TCD queue, when the major iteration count is exhausted, additional operations are performed. - * These include the final address adjustments and reloading of the BITER field into the CITER. - * Assertion of an optional interrupt request also occurs at this time, as does a possible fetch of a new TCD from - * memory using the scatter/gather address pointer included in the descriptor (if scatter/gather is enabled). - * - * For instance, when the time interrupt of TCD[0] happens, the TCD[1] has already been loaded into the eDMA engine. - * As sga and sga_index are calculated based on the DLAST_SGA bitfield lies in the TCD_CSR register, the sga_index - * in this case should be 2 (DLAST_SGA of TCD[1] stores the address of TCD[2]). Thus, the "tcdUsed" updated should be - * (tcdUsed - 2U) which indicates the number of TCDs can be loaded in the memory pool (because TCD[0] and TCD[1] have - * been loaded into the eDMA engine at this point already.). - * - * For the last two continuous ISRs in a scatter/gather process, they both load the last TCD (The last ISR does not - * load a new TCD) from the memory pool to the eDMA engine when major loop completes. - * Therefore, ensure that the header and tcdUsed updated are identical for them. - * tcdUsed are both 0 in this case as no TCD to be loaded. - * - * See the "eDMA basic data flow" in the eDMA Functional description section of the Reference Manual for - * further details. - * - * @param handle eDMA handle pointer. - */ -void EDMA_HandleIRQ(edma_handle_t *handle); - -/* @} */ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/* @} */ - -#endif /*FSL_EDMA_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_edma_core.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_edma_core.h deleted file mode 100644 index e76840e4ee8..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_edma_core.h +++ /dev/null @@ -1,299 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_EDMA_CORE_H_ -#define FSL_EDMA_CORE_H_ - -#include "fsl_edma_soc.h" - -/*! - * @addtogroup edma_core - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -#if defined(FSL_EDMA_SOC_IP_DMA3) && defined(FSL_EDMA_SOC_IP_DMA4) && FSL_EDMA_SOC_IP_DMA3 && FSL_EDMA_SOC_IP_DMA4 -#define DMA_CSR_INTMAJOR_MASK DMA_TCD_CSR_INTMAJOR_MASK -#define DMA_CSR_INTHALF_MASK DMA_TCD_CSR_INTHALF_MASK -#define DMA_CSR_DREQ_MASK DMA_TCD_CSR_DREQ_MASK -#define DMA_CSR_ESG_MASK DMA_TCD_CSR_ESG_MASK -#define DMA_CSR_BWC_MASK DMA_TCD_CSR_BWC_MASK -#define DMA_CSR_BWC(x) DMA_TCD_CSR_BWC(x) -#define DMA_CSR_START_MASK DMA_TCD_CSR_START_MASK -#define DMA_CITER_ELINKNO_CITER_MASK DMA_TCD_CITER_ELINKNO_CITER_MASK -#define DMA_BITER_ELINKNO_BITER_MASK DMA_TCD_BITER_ELINKNO_BITER_MASK -#define DMA_CITER_ELINKNO_CITER_SHIFT DMA_TCD_CITER_ELINKNO_CITER_SHIFT -#define DMA_CITER_ELINKYES_CITER_MASK DMA_TCD_CITER_ELINKYES_CITER_MASK -#define DMA_CITER_ELINKYES_CITER_SHIFT DMA_TCD_CITER_ELINKYES_CITER_SHIFT -#define DMA_ATTR_SMOD_MASK DMA_TCD_ATTR_SMOD_MASK -#define DMA_ATTR_DMOD_MASK DMA_TCD_ATTR_DMOD_MASK -#define DMA_CITER_ELINKNO_ELINK_MASK DMA_TCD_CITER_ELINKNO_ELINK_MASK -#define DMA_CSR_MAJORELINK_MASK DMA_TCD_CSR_MAJORELINK_MASK -#define DMA_BITER_ELINKYES_ELINK_MASK DMA_TCD_BITER_ELINKYES_ELINK_MASK -#define DMA_CITER_ELINKYES_ELINK_MASK DMA_TCD_CITER_ELINKYES_ELINK_MASK -#define DMA_CSR_MAJORLINKCH_MASK DMA_TCD_CSR_MAJORLINKCH_MASK -#define DMA_BITER_ELINKYES_LINKCH_MASK DMA_TCD_BITER_ELINKYES_LINKCH_MASK -#define DMA_CITER_ELINKYES_LINKCH_MASK DMA_TCD_CITER_ELINKYES_LINKCH_MASK -#define DMA_NBYTES_MLOFFYES_MLOFF_MASK DMA_TCD_NBYTES_MLOFFYES_MLOFF_MASK -#define DMA_NBYTES_MLOFFYES_DMLOE_MASK DMA_TCD_NBYTES_MLOFFYES_DMLOE_MASK -#define DMA_NBYTES_MLOFFYES_SMLOE_MASK DMA_TCD_NBYTES_MLOFFYES_SMLOE_MASK -#define DMA_NBYTES_MLOFFNO_NBYTES_MASK DMA_TCD_NBYTES_MLOFFNO_NBYTES_MASK -#define DMA_ATTR_DMOD(x) DMA_TCD_ATTR_DMOD(x) -#define DMA_ATTR_SMOD(X) DMA_TCD_ATTR_SMOD(X) -#define DMA_BITER_ELINKYES_LINKCH(x) DMA_TCD_BITER_ELINKYES_LINKCH(x) -#define DMA_CITER_ELINKYES_LINKCH(x) DMA_TCD_CITER_ELINKYES_LINKCH(x) -#define DMA_NBYTES_MLOFFYES_MLOFF(x) DMA_TCD_NBYTES_MLOFFYES_MLOFF(x) -#define DMA_NBYTES_MLOFFYES_DMLOE(x) DMA_TCD_NBYTES_MLOFFYES_DMLOE(x) -#define DMA_NBYTES_MLOFFYES_SMLOE(x) DMA_TCD_NBYTES_MLOFFYES_SMLOE(x) -#define DMA_NBYTES_MLOFFNO_NBYTES(x) DMA_TCD_NBYTES_MLOFFNO_NBYTES(x) -#define DMA_NBYTES_MLOFFYES_NBYTES(x) DMA_TCD_NBYTES_MLOFFYES_NBYTES(x) -#define DMA_ATTR_DSIZE(x) DMA_TCD_ATTR_DSIZE(x) -#define DMA_ATTR_SSIZE(x) DMA_TCD_ATTR_SSIZE(x) -#define DMA_CSR_DREQ(x) DMA_TCD_CSR_DREQ(x) -#define DMA_CSR_MAJORLINKCH(x) DMA_TCD_CSR_MAJORLINKCH(x) -#define DMA_CH_MATTR_WCACHE(x) DMA4_CH_MATTR_WCACHE(x) -#define DMA_CH_MATTR_RCACHE(x) DMA4_CH_MATTR_RCACHE(x) -#define DMA_CH_CSR_SIGNEXT_MASK DMA4_CH_CSR_SIGNEXT_MASK -#define DMA_CH_CSR_SIGNEXT_SHIFT DMA4_CH_CSR_SIGNEXT_SHIFT -#define DMA_CH_CSR_SWAP_MASK DMA4_CH_CSR_SWAP_MASK -#define DMA_CH_CSR_SWAP_SHIFT DMA4_CH_CSR_SWAP_SHIFT -#define DMA_CH_SBR_INSTR_MASK DMA4_CH_SBR_INSTR_MASK -#define DMA_CH_SBR_INSTR_SHIFT DMA4_CH_SBR_INSTR_SHIFT -#define DMA_CH_MUX_SOURCE(x) DMA4_CH_MUX_SRC(x) -#elif defined(FSL_EDMA_SOC_IP_DMA3) && FSL_EDMA_SOC_IP_DMA3 && \ - (!defined(FSL_EDMA_SOC_IP_DMA4) || (defined(FSL_EDMA_SOC_IP_DMA4) && !FSL_EDMA_SOC_IP_DMA4)) -#define DMA_CSR_INTMAJOR_MASK DMA_TCD_CSR_INTMAJOR_MASK -#define DMA_CSR_INTHALF_MASK DMA_TCD_CSR_INTHALF_MASK -#define DMA_CSR_DREQ_MASK DMA_TCD_CSR_DREQ_MASK -#define DMA_CSR_ESG_MASK DMA_TCD_CSR_ESG_MASK -#define DMA_CSR_BWC_MASK DMA_TCD_CSR_BWC_MASK -#define DMA_CSR_BWC(x) DMA_TCD_CSR_BWC(x) -#define DMA_CSR_START_MASK DMA_TCD_CSR_START_MASK -#define DMA_CITER_ELINKNO_CITER_MASK DMA_TCD_CITER_ELINKNO_CITER_MASK -#define DMA_BITER_ELINKNO_BITER_MASK DMA_TCD_BITER_ELINKNO_BITER_MASK -#define DMA_CITER_ELINKNO_CITER_SHIFT DMA_TCD_CITER_ELINKNO_CITER_SHIFT -#define DMA_CITER_ELINKYES_CITER_MASK DMA_TCD_CITER_ELINKYES_CITER_MASK -#define DMA_CITER_ELINKYES_CITER_SHIFT DMA_TCD_CITER_ELINKYES_CITER_SHIFT -#define DMA_ATTR_SMOD_MASK DMA_TCD_ATTR_SMOD_MASK -#define DMA_ATTR_DMOD_MASK DMA_TCD_ATTR_DMOD_MASK -#define DMA_CITER_ELINKNO_ELINK_MASK DMA_TCD_CITER_ELINKNO_ELINK_MASK -#define DMA_CSR_MAJORELINK_MASK DMA_TCD_CSR_MAJORELINK_MASK -#define DMA_BITER_ELINKYES_ELINK_MASK DMA_TCD_BITER_ELINKYES_ELINK_MASK -#define DMA_CITER_ELINKYES_ELINK_MASK DMA_TCD_CITER_ELINKYES_ELINK_MASK -#define DMA_CSR_MAJORLINKCH_MASK DMA_TCD_CSR_MAJORLINKCH_MASK -#define DMA_BITER_ELINKYES_LINKCH_MASK DMA_TCD_BITER_ELINKYES_LINKCH_MASK -#define DMA_CITER_ELINKYES_LINKCH_MASK DMA_TCD_CITER_ELINKYES_LINKCH_MASK -#define DMA_NBYTES_MLOFFYES_MLOFF_MASK DMA_TCD_NBYTES_MLOFFYES_MLOFF_MASK -#define DMA_NBYTES_MLOFFYES_DMLOE_MASK DMA_TCD_NBYTES_MLOFFYES_DMLOE_MASK -#define DMA_NBYTES_MLOFFYES_SMLOE_MASK DMA_TCD_NBYTES_MLOFFYES_SMLOE_MASK -#define DMA_ATTR_DMOD(x) DMA_TCD_ATTR_DMOD(x) -#define DMA_ATTR_SMOD(X) DMA_TCD_ATTR_SMOD(X) -#define DMA_BITER_ELINKYES_LINKCH(x) DMA_TCD_BITER_ELINKYES_LINKCH(x) -#define DMA_CITER_ELINKYES_LINKCH(x) DMA_TCD_CITER_ELINKYES_LINKCH(x) -#define DMA_NBYTES_MLOFFYES_MLOFF(x) DMA_TCD_NBYTES_MLOFFYES_MLOFF(x) -#define DMA_NBYTES_MLOFFYES_DMLOE(x) DMA_TCD_NBYTES_MLOFFYES_DMLOE(x) -#define DMA_NBYTES_MLOFFYES_SMLOE(x) DMA_TCD_NBYTES_MLOFFYES_SMLOE(x) -#define DMA_NBYTES_MLOFFNO_NBYTES(x) DMA_TCD_NBYTES_MLOFFNO_NBYTES(x) -#define DMA_NBYTES_MLOFFYES_NBYTES(x) DMA_TCD_NBYTES_MLOFFYES_NBYTES(x) -#define DMA_ATTR_DSIZE(x) DMA_TCD_ATTR_DSIZE(x) -#define DMA_ATTR_SSIZE(x) DMA_TCD_ATTR_SSIZE(x) -#define DMA_CSR_DREQ(x) DMA_TCD_CSR_DREQ(x) -#define DMA_CSR_MAJORLINKCH(x) DMA_TCD_CSR_MAJORLINKCH(x) -#define DMA_CH_MUX_SOURCE(x) DMA_CH_MUX_SRC(x) -#elif defined(FSL_EDMA_SOC_IP_DMA4) && FSL_EDMA_SOC_IP_DMA4 && \ - (!defined(FSL_EDMA_SOC_IP_DMA3) || (defined(FSL_EDMA_SOC_IP_DMA3) && !FSL_EDMA_SOC_IP_DMA3)) -#define DMA_CSR_INTMAJOR_MASK DMA4_CSR_INTMAJOR_MASK -#define DMA_CSR_INTHALF_MASK DMA4_CSR_INTHALF_MASK -#define DMA_CSR_DREQ_MASK DMA4_CSR_DREQ_MASK -#define DMA_CSR_ESG_MASK DMA4_CSR_ESG_MASK -#define DMA_CSR_BWC_MASK DMA4_CSR_BWC_MASK -#define DMA_CSR_BWC(x) DMA4_CSR_BWC(x) -#define DMA_CSR_START_MASK DMA4_CSR_START_MASK -#define DMA_CITER_ELINKNO_CITER_MASK DMA4_CITER_ELINKNO_CITER_MASK -#define DMA_BITER_ELINKNO_BITER_MASK DMA4_BITER_ELINKNO_BITER_MASK -#define DMA_CITER_ELINKNO_CITER_SHIFT DMA4_CITER_ELINKNO_CITER_SHIFT -#define DMA_CITER_ELINKYES_CITER_MASK DMA4_CITER_ELINKYES_CITER_MASK -#define DMA_CITER_ELINKYES_CITER_SHIFT DMA4_CITER_ELINKYES_CITER_SHIFT -#define DMA_ATTR_SMOD_MASK DMA4_ATTR_SMOD_MASK -#define DMA_ATTR_DMOD_MASK DMA4_ATTR_DMOD_MASK -#define DMA_CITER_ELINKNO_ELINK_MASK DMA4_CITER_ELINKNO_ELINK_MASK -#define DMA_CSR_MAJORELINK_MASK DMA4_CSR_MAJORELINK_MASK -#define DMA_BITER_ELINKYES_ELINK_MASK DMA4_BITER_ELINKYES_ELINK_MASK -#define DMA_CITER_ELINKYES_ELINK_MASK DMA4_CITER_ELINKYES_ELINK_MASK -#define DMA_CSR_MAJORLINKCH_MASK DMA4_CSR_MAJORLINKCH_MASK -#define DMA_BITER_ELINKYES_LINKCH_MASK DMA4_BITER_ELINKYES_LINKCH_MASK -#define DMA_CITER_ELINKYES_LINKCH_MASK DMA4_CITER_ELINKYES_LINKCH_MASK -#define DMA_NBYTES_MLOFFYES_MLOFF_MASK DMA4_NBYTES_MLOFFYES_MLOFF_MASK -#define DMA_NBYTES_MLOFFYES_DMLOE_MASK DMA4_NBYTES_MLOFFYES_DMLOE_MASK -#define DMA_NBYTES_MLOFFYES_SMLOE_MASK DMA4_NBYTES_MLOFFYES_SMLOE_MASK -#define DMA_ATTR_DMOD(x) DMA4_ATTR_DMOD(x) -#define DMA_ATTR_SMOD(X) DMA4_ATTR_SMOD(X) -#define DMA_BITER_ELINKYES_LINKCH(x) DMA4_BITER_ELINKYES_LINKCH(x) -#define DMA_CITER_ELINKYES_LINKCH(x) DMA4_CITER_ELINKYES_LINKCH(x) -#define DMA_NBYTES_MLOFFYES_MLOFF(x) DMA4_NBYTES_MLOFFYES_MLOFF(x) -#define DMA_NBYTES_MLOFFYES_DMLOE(x) DMA4_NBYTES_MLOFFYES_DMLOE(x) -#define DMA_NBYTES_MLOFFYES_SMLOE(x) DMA4_NBYTES_MLOFFYES_SMLOE(x) -#define DMA_NBYTES_MLOFFNO_NBYTES(x) DMA4_NBYTES_MLOFFNO_NBYTES(x) -#define DMA_NBYTES_MLOFFYES_NBYTES(x) DMA4_NBYTES_MLOFFYES_NBYTES(x) -#define DMA_ATTR_DSIZE(x) DMA4_ATTR_DSIZE(x) -#define DMA_ATTR_SSIZE(x) DMA4_ATTR_SSIZE(x) -#define DMA_CSR_DREQ(x) DMA4_CSR_DREQ(x) -#define DMA_CSR_MAJORLINKCH(x) DMA4_CSR_MAJORLINKCH(x) -#define DMA_CH_MATTR_WCACHE(x) DMA4_CH_MATTR_WCACHE(x) -#define DMA_CH_MATTR_RCACHE(x) DMA4_CH_MATTR_RCACHE(x) -#define DMA_CH_CSR_SIGNEXT_MASK DMA4_CH_CSR_SIGNEXT_MASK -#define DMA_CH_CSR_SIGNEXT_SHIFT DMA4_CH_CSR_SIGNEXT_SHIFT -#define DMA_CH_CSR_SWAP_MASK DMA4_CH_CSR_SWAP_MASK -#define DMA_CH_CSR_SWAP_SHIFT DMA4_CH_CSR_SWAP_SHIFT -#define DMA_CH_SBR_INSTR_MASK DMA4_CH_SBR_INSTR_MASK -#define DMA_CH_SBR_INSTR_SHIFT DMA4_CH_SBR_INSTR_SHIFT -#define DMA_CH_MUX_SOURCE(x) DMA4_CH_MUX_SRC(x) -#define DMA_CH_CSR_DONE_MASK DMA4_CH_CSR_DONE_MASK -#define DMA_CH_CSR_ERQ_MASK DMA4_CH_CSR_ERQ_MASK -#elif defined(FSL_EDMA_SOC_IP_EDMA) && FSL_EDMA_SOC_IP_EDMA -/*! intentional empty */ -#endif - -/*! @brief DMA error flag */ -#if defined(FSL_EDMA_SOC_IP_EDMA) && FSL_EDMA_SOC_IP_EDMA -#define DMA_ERR_DBE_FLAG DMA_ES_DBE_MASK -#define DMA_ERR_SBE_FLAG DMA_ES_SBE_MASK -#define DMA_ERR_SGE_FLAG DMA_ES_SGE_MASK -#define DMA_ERR_NCE_FLAG DMA_ES_NCE_MASK -#define DMA_ERR_DOE_FLAG DMA_ES_DOE_MASK -#define DMA_ERR_DAE_FLAG DMA_ES_DAE_MASK -#define DMA_ERR_SOE_FLAG DMA_ES_SOE_MASK -#define DMA_ERR_SAE_FLAG DMA_ES_SAE_MASK -#define DMA_ERR_ERRCHAN_FLAG DMA_ES_ERRCHN_MASK -#define DMA_ERR_CPE_FLAG DMA_ES_CPE_MASK -#define DMA_ERR_ECX_FLAG DMA_ES_ECX_MASK -#if defined(FSL_FEATURE_EDMA_CHANNEL_GROUP_COUNT) && (FSL_FEATURE_EDMA_CHANNEL_GROUP_COUNT > 1) -#define DMA_ERR_GPE_FLAG DMA_ES_GPE_MASK -#endif -#define DMA_ERR_FLAG DMA_ES_VLD_MASK - -/*! @brief get/clear DONE status*/ -#define DMA_CLEAR_DONE_STATUS(base, channel) (EDMA_BASE(base)->CDNE = (uint8_t)channel) -#define DMA_GET_DONE_STATUS(base, channel) \ - ((EDMA_TCD_BASE(base, channel)->CSR & DMA_CSR_DONE_MASK) >> DMA_CSR_DONE_SHIFT) -/*! @brief enable/disable error interrupt*/ -#define DMA_ENABLE_ERROR_INT(base, channel) (base->EEI |= ((uint32_t)0x1U << channel)) -#define DMA_DISABLE_ERROR_INT(base, channel) (base->EEI &= (~((uint32_t)0x1U << channel))) -/*! @brief get/clear error status*/ -#define DMA_GET_ERROR_STATUS(base, channel) (((uint32_t)EDMA_BASE(base)->ERR >> channel) & 0x1U) -#define DMA_CLEAR_ERROR_STATUS(base, channel) ((uint32_t)EDMA_BASE(base)->CERR = (uint8_t)channel) -/*! @brief get/clear int status*/ -#define DMA_GET_INT_STATUS(base, channel) ((((uint32_t)EDMA_BASE(base)->INT >> channel) & 0x1U)) -#define DMA_CLEAR_INT_STATUS(base, channel) ((uint32_t)EDMA_BASE(base)->CINT = (uint8_t)channel) - -#else - -#define DMA_ERR_DBE_FLAG DMA_MP_ES_DBE_MASK -#define DMA_ERR_SBE_FLAG DMA_MP_ES_SBE_MASK -#define DMA_ERR_SGE_FLAG DMA_MP_ES_SGE_MASK -#define DMA_ERR_NCE_FLAG DMA_MP_ES_NCE_MASK -#define DMA_ERR_DOE_FLAG DMA_MP_ES_DOE_MASK -#define DMA_ERR_DAE_FLAG DMA_MP_ES_DAE_MASK -#define DMA_ERR_SOE_FLAG DMA_MP_ES_SOE_MASK -#define DMA_ERR_SAE_FLAG DMA_MP_ES_SAE_MASK -#define DMA_ERR_ERRCHAN_FLAG DMA_MP_ES_ERRCHN_MASK -#define DMA_ERR_ECX_FLAG DMA_MP_ES_ECX_MASK -#define DMA_ERR_FLAG DMA_MP_ES_VLD_MASK - -/*! @brief get/clear DONE bit*/ -#define DMA_CLEAR_DONE_STATUS(base, channel) (EDMA_CHANNEL_BASE(base, channel)->CH_CSR |= DMA_CH_CSR_DONE_MASK) -#define DMA_GET_DONE_STATUS(base, channel) \ - ((EDMA_CHANNEL_BASE(base, channel)->CH_CSR & DMA_CH_CSR_DONE_MASK) >> DMA_CH_CSR_DONE_SHIFT) -/*! @brief enable/disable error interupt*/ -#define DMA_ENABLE_ERROR_INT(base, channel) (EDMA_CHANNEL_BASE(base, channel)->CH_CSR |= DMA_CH_CSR_EEI_MASK) -#define DMA_DISABLE_ERROR_INT(base, channel) (EDMA_CHANNEL_BASE(base, channel)->CH_CSR &= ~DMA_CH_CSR_EEI_MASK) -/*! @brief get/clear error status*/ -#define DMA_CLEAR_ERROR_STATUS(base, channel) (EDMA_CHANNEL_BASE(base, channel)->CH_ES |= DMA_CH_ES_ERR_MASK) -#define DMA_GET_ERROR_STATUS(base, channel) \ - (((uint32_t)EDMA_CHANNEL_BASE(base, channel)->CH_ES >> DMA_CH_ES_ERR_SHIFT) & 0x1U) -/*! @brief get/clear INT status*/ -#define DMA_CLEAR_INT_STATUS(base, channel) (EDMA_CHANNEL_BASE(base, channel)->CH_INT = DMA_CH_INT_INT_MASK) -#define DMA_GET_INT_STATUS(base, channel) ((((uint32_t)EDMA_CHANNEL_BASE(base, channel)->CH_INT) & 0x1U)) -#endif /*FSL_EDMA_SOC_IP_EDMA*/ - -/*! @brief enable/dsiable MAJOR/HALF INT*/ -#define DMA_ENABLE_MAJOR_INT(base, channel) (EDMA_TCD_BASE(base, channel)->CSR |= DMA_CSR_INTMAJOR_MASK) -#define DMA_ENABLE_HALF_INT(base, channel) (EDMA_TCD_BASE(base, channel)->CSR |= DMA_CSR_INTHALF_MASK) -#define DMA_DISABLE_MAJOR_INT(base, channel) (EDMA_TCD_BASE(base, channel)->CSR &= ~(uint16_t)DMA_CSR_INTMAJOR_MASK) -#define DMA_DISABLE_HALF_INT(base, channel) (EDMA_TCD_BASE(base, channel)->CSR &= ~(uint16_t)DMA_CSR_INTHALF_MASK) - -/*!@brief EDMA tcd align size */ -#define EDMA_TCD_ALIGN_SIZE (32U) - -/*!@brief edma core channel struture definition */ -typedef struct _edma_core_mp -{ - __IO uint32_t MP_CSR; /**< Channel Control and Status, array offset: 0x10000, array step: 0x10000 */ - __IO uint32_t MP_ES; /**< Channel Error Status, array offset: 0x10004, array step: 0x10000 */ -} edma_core_mp_t; - -/*!@brief edma core channel struture definition */ -typedef struct _edma_core_channel -{ - __IO uint32_t CH_CSR; /**< Channel Control and Status, array offset: 0x10000, array step: 0x10000 */ - __IO uint32_t CH_ES; /**< Channel Error Status, array offset: 0x10004, array step: 0x10000 */ - __IO uint32_t CH_INT; /**< Channel Interrupt Status, array offset: 0x10008, array step: 0x10000 */ - __IO uint32_t CH_SBR; /**< Channel System Bus, array offset: 0x1000C, array step: 0x10000 */ - __IO uint32_t CH_PRI; /**< Channel Priority, array offset: 0x10010, array step: 0x10000 */ - __IO uint32_t CH_MUX; /**< Channel Multiplexor Configuration, array offset: 0x10014, array step: 0x10000 */ - __IO uint16_t CH_MATTR; /**< Memory Attributes Register, array offset: 0x10018, array step: 0x8000 */ -} edma_core_channel_t; - -/*!@brief edma core TCD struture definition */ -typedef struct _edma_core_tcd -{ - __IO uint32_t SADDR; /*!< SADDR register, used to save source address */ - __IO uint16_t SOFF; /*!< SOFF register, save offset bytes every transfer */ - __IO uint16_t ATTR; /*!< ATTR register, source/destination transfer size and modulo */ - __IO uint32_t NBYTES; /*!< Nbytes register, minor loop length in bytes */ - __IO uint32_t SLAST; /*!< SLAST register */ - __IO uint32_t DADDR; /*!< DADDR register, used for destination address */ - __IO uint16_t DOFF; /*!< DOFF register, used for destination offset */ - __IO uint16_t CITER; /*!< CITER register, current minor loop numbers, for unfinished minor loop.*/ - __IO uint32_t DLAST_SGA; /*!< DLASTSGA register, next tcd address used in scatter-gather mode */ - __IO uint16_t CSR; /*!< CSR register, for TCD control status */ - __IO uint16_t BITER; /*!< BITER register, begin minor loop count. */ -} edma_core_tcd_t; - -/*!@brief EDMA typedef */ -typedef edma_core_channel_t EDMA_ChannelType; -typedef edma_core_tcd_t EDMA_TCDType; -typedef void EDMA_Type; - -/*!@brief EDMA base address convert macro */ -#define EDMA_BASE(base) -#define EDMA_CHANNEL_BASE(base, channel) \ - ((edma_core_channel_t *)((uint32_t)(uint32_t *)(base) + EDMA_CHANNEL_OFFSET + \ - (channel)*EDMA_CHANNEL_ARRAY_STEP(base))) -#define EDMA_TCD_BASE(base, channel) \ - ((edma_core_tcd_t *)((uint32_t)(uint32_t *)(base) + EDMA_CHANNEL_OFFSET + \ - (channel)*EDMA_CHANNEL_ARRAY_STEP(base) + 0x20U)) -#define EDMA_MP_BASE(base) ((edma_core_mp_t *)((uint32_t)(uint32_t *)(base))) - -/******************************************************************************* - * API - ******************************************************************************/ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif - -/*! - * @} - */ - -#endif /* FSL_EDMA_CORE_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_edma_soc.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_edma_soc.c deleted file mode 100644 index 2706eb37ec2..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_edma_soc.c +++ /dev/null @@ -1,289 +0,0 @@ -/* - * Copyright 2023 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_edma_soc.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.edma_soc" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -extern void EDMA_0_CH0_DriverIRQHandler(void); -extern void EDMA_0_CH1_DriverIRQHandler(void); -extern void EDMA_0_CH2_DriverIRQHandler(void); -extern void EDMA_0_CH3_DriverIRQHandler(void); -extern void EDMA_0_CH4_DriverIRQHandler(void); -extern void EDMA_0_CH5_DriverIRQHandler(void); -extern void EDMA_0_CH6_DriverIRQHandler(void); -extern void EDMA_0_CH7_DriverIRQHandler(void); -extern void EDMA_0_CH8_DriverIRQHandler(void); -extern void EDMA_0_CH9_DriverIRQHandler(void); -extern void EDMA_0_CH10_DriverIRQHandler(void); -extern void EDMA_0_CH11_DriverIRQHandler(void); -extern void EDMA_0_CH12_DriverIRQHandler(void); -extern void EDMA_0_CH13_DriverIRQHandler(void); -extern void EDMA_0_CH14_DriverIRQHandler(void); -extern void EDMA_0_CH15_DriverIRQHandler(void); -extern void EDMA_1_CH0_DriverIRQHandler(void); -extern void EDMA_1_CH1_DriverIRQHandler(void); -extern void EDMA_1_CH2_DriverIRQHandler(void); -extern void EDMA_1_CH3_DriverIRQHandler(void); -extern void EDMA_1_CH4_DriverIRQHandler(void); -extern void EDMA_1_CH5_DriverIRQHandler(void); -extern void EDMA_1_CH6_DriverIRQHandler(void); -extern void EDMA_1_CH7_DriverIRQHandler(void); -extern void EDMA_DriverIRQHandler(uint32_t instance, uint32_t channel); -/******************************************************************************* - * Code - ******************************************************************************/ -/*! - * brief DMA instance 0, channel 0 IRQ handler. - * - */ -void EDMA_0_CH0_DriverIRQHandler(void) -{ - /* Instance 0 channel 0 */ - EDMA_DriverIRQHandler(0U, 0U); -} - -/*! - * brief DMA instance 0, channel 1 IRQ handler. - * - */ -void EDMA_0_CH1_DriverIRQHandler(void) -{ - /* Instance 0 channel 1 */ - EDMA_DriverIRQHandler(0U, 1U); -} - -/*! - * brief DMA instance 0, channel 2 IRQ handler. - * - */ -void EDMA_0_CH2_DriverIRQHandler(void) -{ - /* Instance 0 channel 2 */ - EDMA_DriverIRQHandler(0U, 2U); -} - -/*! - * brief DMA instance 0, channel 3 IRQ handler. - * - */ -void EDMA_0_CH3_DriverIRQHandler(void) -{ - /* Instance 0 channel 3 */ - EDMA_DriverIRQHandler(0U, 3U); -} - -/*! - * brief DMA instance 0, channel 4 IRQ handler. - * - */ -void EDMA_0_CH4_DriverIRQHandler(void) -{ - /* Instance 0 channel 4 */ - EDMA_DriverIRQHandler(0U, 4U); -} - -/*! - * brief DMA instance 0, channel 5 IRQ handler. - * - */ -void EDMA_0_CH5_DriverIRQHandler(void) -{ - /* Instance 0 channel 5 */ - EDMA_DriverIRQHandler(0U, 5U); -} - -/*! - * brief DMA instance 0, channel 6 IRQ handler. - * - */ -void EDMA_0_CH6_DriverIRQHandler(void) -{ - /* Instance 0 channel 6 */ - EDMA_DriverIRQHandler(0U, 6U); -} - -/*! - * brief DMA instance 0, channel 7 IRQ handler. - * - */ -void EDMA_0_CH7_DriverIRQHandler(void) -{ - /* Instance 0 channel 7 */ - EDMA_DriverIRQHandler(0U, 7U); -} - -/*! - * brief DMA instance 0, channel 8 IRQ handler. - * - */ -void EDMA_0_CH8_DriverIRQHandler(void) -{ - /* Instance 0 channel 8 */ - EDMA_DriverIRQHandler(0U, 8U); -} - -/*! - * brief DMA instance 0, channel 9 IRQ handler. - * - */ -void EDMA_0_CH9_DriverIRQHandler(void) -{ - /* Instance 0 channel 9 */ - EDMA_DriverIRQHandler(0U, 9U); -} - -/*! - * brief DMA instance 0, channel 10 IRQ handler. - * - */ -void EDMA_0_CH10_DriverIRQHandler(void) -{ - /* Instance 0 channel 10 */ - EDMA_DriverIRQHandler(0U, 10U); -} - -/*! - * brief DMA instance 0, channel 11 IRQ handler. - * - */ -void EDMA_0_CH11_DriverIRQHandler(void) -{ - /* Instance 0 channel 11 */ - EDMA_DriverIRQHandler(0U, 11U); -} - -/*! - * brief DMA instance 0, channel 12 IRQ handler. - * - */ -void EDMA_0_CH12_DriverIRQHandler(void) -{ - /* Instance 0 channel 12 */ - EDMA_DriverIRQHandler(0U, 12U); -} - -/*! - * brief DMA instance 0, channel 13 IRQ handler. - * - */ -void EDMA_0_CH13_DriverIRQHandler(void) -{ - /* Instance 0 channel 13 */ - EDMA_DriverIRQHandler(0U, 13U); -} - -/*! - * brief DMA instance 0, channel 14 IRQ handler. - * - */ -void EDMA_0_CH14_DriverIRQHandler(void) -{ - /* Instance 0 channel 14 */ - EDMA_DriverIRQHandler(0U, 14U); -} - -/*! - * brief DMA instance 0, channel 15 IRQ handler. - * - */ -void EDMA_0_CH15_DriverIRQHandler(void) -{ - /* Instance 0 channel 15 */ - EDMA_DriverIRQHandler(0U, 15U); -} - -/*! - * brief DMA instance 1, channel 0 IRQ handler. - * - */ -void EDMA_1_CH0_DriverIRQHandler(void) -{ - /* Instance 1 channel 0 */ - EDMA_DriverIRQHandler(1U, 0U); -} - -/*! - * brief DMA instance 1, channel 1 IRQ handler. - * - */ -void EDMA_1_CH1_DriverIRQHandler(void) -{ - /* Instance 1 channel 1 */ - EDMA_DriverIRQHandler(1U, 1U); -} - -/*! - * brief DMA instance 1, channel 2 IRQ handler. - * - */ -void EDMA_1_CH2_DriverIRQHandler(void) -{ - /* Instance 1 channel 2 */ - EDMA_DriverIRQHandler(1U, 2U); -} - -/*! - * brief DMA instance 1, channel 3 IRQ handler. - * - */ -void EDMA_1_CH3_DriverIRQHandler(void) -{ - /* Instance 1 channel 3 */ - EDMA_DriverIRQHandler(1U, 3U); -} - -/*! - * brief DMA instance 1, channel 4 IRQ handler. - * - */ -void EDMA_1_CH4_DriverIRQHandler(void) -{ - /* Instance 1 channel 4 */ - EDMA_DriverIRQHandler(1U, 4U); -} - -/*! - * brief DMA instance 1, channel 5 IRQ handler. - * - */ -void EDMA_1_CH5_DriverIRQHandler(void) -{ - /* Instance 1 channel 5 */ - EDMA_DriverIRQHandler(1U, 5U); -} - -/*! - * brief DMA instance 1, channel 6 IRQ handler. - * - */ -void EDMA_1_CH6_DriverIRQHandler(void) -{ - /* Instance 1 channel 6 */ - EDMA_DriverIRQHandler(1U, 6U); -} - -/*! - * brief DMA instance 1, channel 7 IRQ handler. - * - */ -void EDMA_1_CH7_DriverIRQHandler(void) -{ - /* Instance 1 channel 7 */ - EDMA_DriverIRQHandler(1U, 7U); -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_edma_soc.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_edma_soc.h deleted file mode 100644 index 863542cff47..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_edma_soc.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef _FSL_EDMA_SOC_H_ -#define _FSL_EDMA_SOC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup edma_soc - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/*! @name Driver version */ -/*@{*/ -/*! @brief Driver version 1.0.0. */ -#define FSL_EDMA_SOC_DRIVER_VERSION (MAKE_VERSION(1, 0, 0)) -/*@}*/ - -/*!@brief DMA IP version */ -#define FSL_EDMA_SOC_IP_DMA3 (1) -#define FSL_EDMA_SOC_IP_DMA4 (0) - -/*!@brief DMA base table */ -#define EDMA_BASE_PTRS \ - { \ - DMA0, DMA1 \ - } - -#define EDMA_CHN_IRQS \ - { \ - {EDMA_0_CH0_IRQn, EDMA_0_CH1_IRQn, EDMA_0_CH2_IRQn, EDMA_0_CH3_IRQn, EDMA_0_CH4_IRQn, EDMA_0_CH5_IRQn, \ - EDMA_0_CH6_IRQn, EDMA_0_CH7_IRQn, EDMA_0_CH8_IRQn, EDMA_0_CH9_IRQn, EDMA_0_CH10_IRQn, EDMA_0_CH11_IRQn, \ - EDMA_0_CH12_IRQn, EDMA_0_CH13_IRQn, EDMA_0_CH14_IRQn, EDMA_0_CH15_IRQn}, \ - { \ - EDMA_1_CH0_IRQn, EDMA_1_CH1_IRQn, EDMA_1_CH2_IRQn, EDMA_1_CH3_IRQn, EDMA_1_CH4_IRQn, EDMA_1_CH5_IRQn, \ - EDMA_1_CH6_IRQn, EDMA_1_CH7_IRQn, NotAvail_IRQn, NotAvail_IRQn, NotAvail_IRQn, \ - NotAvail_IRQn, NotAvail_IRQn, NotAvail_IRQn, NotAvail_IRQn, NotAvail_IRQn \ - } \ - } - -/*!@brief EDMA base address convert macro */ -#define EDMA_CHANNEL_OFFSET 0x1000U -#define EDMA_CHANNEL_ARRAY_STEP(base) (0x1000U) - -/******************************************************************************* - * API - ******************************************************************************/ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif - -/*! - * @} - */ - -#endif /* _FSL_EDMA_SOC_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_eim.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_eim.c deleted file mode 100644 index bae11683f40..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_eim.c +++ /dev/null @@ -1,312 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_eim.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.eim" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to EIM bases for each instance. */ -static EIM_Type *const s_eimBases[] = EIM_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to EIM clocks for each instance. */ -static const clock_ip_name_t s_eimClocks[] = EIM_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t EIM_GetInstance(EIM_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_eimBases); instance++) - { - if (s_eimBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_eimBases)); - - return instance; -} - -/*! - * brief EIM module initialization function. - * - * param base EIM base address. - */ -void EIM_Init(EIM_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate EIM clock. */ - CLOCK_EnableClock(s_eimClocks[EIM_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - base->EIMCR = 0x00U; - base->EICHEN = 0x00U; -} - -/*! - * brief Deinitializes the EIM. - * - */ -void EIM_Deinit(EIM_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate EIM clock. */ - CLOCK_DisableClock(s_eimClocks[EIM_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -void EIM_InjectCheckBitError(EIM_Type *base, eim_memory_channel_t channel, uint8_t mask) -{ - switch ((uint8_t)channel) - { - case 0U: - base->EICHD0_WORD0 = EIM_EICHD0_WORD0_CHKBIT_MASK(mask); - break; -#ifdef EIM_EICHEN_EICH1EN_MASK - case 1U: - base->EICHD1_WORD0 = EIM_EICHD1_WORD0_CHKBIT_MASK(mask); - break; -#endif - -#ifdef EIM_EICHEN_EICH2EN_MASK - case 2U: - base->EICHD2_WORD0 = EIM_EICHD2_WORD0_CHKBIT_MASK(mask); - break; -#endif -#ifdef EIM_EICHEN_EICH3EN_MASK - case 3U: - base->EICHD3_WORD0 = EIM_EICHD3_WORD0_CHKBIT_MASK(mask); - break; -#endif -#ifdef EIM_EICHEN_EICH4EN_MASK - case 4U: - base->EICHD4_WORD0 = EIM_EICHD4_WORD0_CHKBIT_MASK(mask); - break; -#endif -#ifdef EIM_EICHEN_EICH5EN_MASK - case 5U: - base->EICHD5_WORD0 = EIM_EICHD5_WORD0_CHKBIT_MASK(mask); - break; -#endif -#ifdef EIM_EICHEN_EICH6EN_MASK - case 6U: - base->EICHD6_WORD0 = EIM_EICHD6_WORD0_CHKBIT_MASK(mask); - break; -#endif -#ifdef EIM_EICHEN_EICH7EN_MASK - case 7U: - base->EICHD7_WORD0 = EIM_EICHD7_WORD0_CHKBIT_MASK(mask); - break; -#endif -#ifdef EIM_EICHEN_EICH8EN_MASK - case 8U: - base->EICHD8_WORD0 = EIM_EICHD8_WORD0_CHKBIT_MASK(mask); - break; -#endif - default: - assert(NULL); - break; - } -} - -uint8_t EIM_GetCheckBitMask(EIM_Type *base, eim_memory_channel_t channel) -{ - uint8_t mask = 0x00U; - - switch ((uint8_t)channel) - { - case 0U: - mask = (uint8_t)((base->EICHD0_WORD0 & EIM_EICHD0_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD0_WORD0_CHKBIT_MASK_SHIFT); - break; -#ifdef EIM_EICHEN_EICH1EN_MASK - case 1U: - mask = (uint8_t)((base->EICHD1_WORD0 & EIM_EICHD1_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD1_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif -#ifdef EIM_EICHEN_EICH2EN_MASK - case 2U: - mask = (uint8_t)((base->EICHD2_WORD0 & EIM_EICHD2_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD2_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif -#ifdef EIM_EICHEN_EICH3EN_MASK - case 3U: - mask = (uint8_t)((base->EICHD3_WORD0 & EIM_EICHD3_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD3_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif -#ifdef EIM_EICHEN_EICH4EN_MASK - case 4U: - mask = (uint8_t)((base->EICHD4_WORD0 & EIM_EICHD4_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD4_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif -#ifdef EIM_EICHEN_EICH5EN_MASK - case 5U: - mask = (uint8_t)((base->EICHD5_WORD0 & EIM_EICHD5_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD5_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif -#ifdef EIM_EICHEN_EICH6EN_MASK - case 6U: - mask = (uint8_t)((base->EICHD6_WORD0 & EIM_EICHD6_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD6_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif -#ifdef EIM_EICHEN_EICH7EN_MASK - case 7U: - mask = (uint8_t)((base->EICHD7_WORD0 & EIM_EICHD7_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD7_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif -#ifdef EIM_EICHEN_EICH8EN_MASK - case 8U: - mask = (uint8_t)((base->EICHD8_WORD0 & EIM_EICHD8_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD8_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif - default: - assert(NULL); - break; - } - - return mask; -} - -void EIM_InjectDataBitError(EIM_Type *base, eim_memory_channel_t channel, uint8_t mask) -{ - switch ((uint8_t)channel) - { - case 0U: - base->EICHD0_WORD1 = mask; - break; -#ifdef EIM_EICHEN_EICH1EN_MASK - case 1U: - base->EICHD1_WORD1 = mask; - break; -#endif -#ifdef EIM_EICHEN_EICH2EN_MASK - case 2U: - base->EICHD2_WORD1 = mask; - break; -#endif -#ifdef EIM_EICHEN_EICH3EN_MASK - case kEIM_MemoryChannelRAMC: - base->EICHD3_WORD1 = mask; - break; -#endif -#ifdef EIM_EICHEN_EICH4EN_MASK - case kEIM_MemoryChannelRAMD: - base->EICHD4_WORD1 = mask; - break; -#endif -#ifdef EIM_EICHEN_EICH5EN_MASK - case kEIM_MemoryChannelRAME: - base->EICHD5_WORD1 = mask; - break; -#endif -#ifdef EIM_EICHEN_EICH6EN_MASK - case kEIM_MemoryChannelRAMF: - base->EICHD6_WORD1 = mask; - break; -#endif -#ifdef EIM_EICHEN_EICH7EN_MASK - case kEIM_MemoryChannelLPCACRAM: - base->EICHD7_WORD1 = mask; - break; -#endif -#ifdef EIM_EICHEN_EICH8EN_MASK - case kEIM_MemoryChannelPKCRAM: - base->EICHD8_WORD1 = mask; - break; -#endif - default: - assert(NULL); - break; - } -} - -uint32_t EIM_GetDataBitMask(EIM_Type *base, eim_memory_channel_t channel) -{ - uint32_t mask = 0x00U; - - switch ((uint8_t)channel) - { - case 0U: - mask = (base->EICHD0_WORD0 & EIM_EICHD0_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD0_WORD1_B0_3DATA_MASK_SHIFT; - break; - -#ifdef EIM_EICHEN_EICH1EN_MASK - case 1U: - mask = (base->EICHD1_WORD0 & EIM_EICHD1_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD1_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif -#ifdef EIM_EICHEN_EICH2EN_MASK - case 2U: - mask = (base->EICHD2_WORD0 & EIM_EICHD2_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD2_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif -#ifdef EIM_EICHEN_EICH3EN_MASK - case 3U: - mask = (base->EICHD3_WORD0 & EIM_EICHD3_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD3_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif -#ifdef EIM_EICHEN_EICH4EN_MASK - case 4U: - mask = (base->EICHD4_WORD0 & EIM_EICHD4_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD4_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif -#ifdef EIM_EICHEN_EICH5EN_MASK - case 5U: - mask = (base->EICHD5_WORD0 & EIM_EICHD5_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD5_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif -#ifdef EIM_EICHEN_EICH6EN_MASK - case 6U: - mask = (base->EICHD6_WORD0 & EIM_EICHD6_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD6_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif -#ifdef EIM_EICHEN_EICH7EN_MASK - case 7U: - mask = (base->EICHD7_WORD0 & EIM_EICHD7_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD7_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif -#ifdef EIM_EICHEN_EICH8EN_MASK - case 8U: - mask = (base->EICHD8_WORD1 & EIM_EICHD8_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD8_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif - default: - assert(NULL); - break; - } - - return mask; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_eim.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_eim.h deleted file mode 100644 index 4594136c100..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_eim.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_EIM_H_ -#define FSL_EIM_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup eim - * @{ - */ - -/****************************************************************************** - * Definitions. - *****************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief Driver version. */ -#define FSL_ERM_DRIVER_VERSION (MAKE_VERSION(2U, 0U, 1U)) -/*@}*/ - -/******************************************************************************* - * APIs - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @brief EIM module initialization function. - * - * @param base EIM base address. - */ -void EIM_Init(EIM_Type *base); - -/*! - * @brief De-initializes the EIM. - * - */ -void EIM_Deinit(EIM_Type *base); - -/* @} */ - -/*! - * @name functional - * @{ - */ - -/*! - * @brief EIM module enable global error injection. - * - * @param base EIM base address. - * @param mask The interrupts to enable. - */ -static inline void EIM_EnableGlobalErrorInjection(EIM_Type *base, bool enable) -{ - if (enable) - { - base->EIMCR = EIM_EIMCR_GEIEN_MASK; - } - else - { - base->EIMCR = ~EIM_EIMCR_GEIEN_MASK; - } -} - -/*! - * @brief EIM module enable error injection for memory channel n, this function enables the corresponding error - * injection channel. The Global Error Injection Enable function must also be called to enable error injection. - * - * @param base EIM base address. - * @param mask The interrupts to enable. Refer to "_eim_error_injection_channel_enable" enumeration. - */ -static inline void EIM_EnableErrorInjectionChannels(EIM_Type *base, uint32_t mask) -{ - base->EICHEN |= mask; -} - -/*! - * @brief EIM module disable error injection for memory channel n. - * - * @param base EIM base address. - * @param mask The interrupts to enable. Refer to "_eim_error_injection_channel_enable" enumeration. - */ -static inline void EIM_DisableErrorInjectionChannels(EIM_Type *base, uint32_t mask) -{ - base->EICHEN &= ~mask; -} - -/*! - * @brief EIM module inject checkbit error for memory channel n, an attempt to invert more than 2 bits in one operation - * might result in undefined behavior. - * - * @param base EIM base address. - * @param channel memory channel. - * @param mask The interrupts to enable. - */ -void EIM_InjectCheckBitError(EIM_Type *base, eim_memory_channel_t channel, uint8_t mask); - -/*! - * @brief EIM module get checkbit mask for memory channel n. - * - * @param base EIM base address. - * @param channel memory channel. - * @retval return checkbit mask. - */ -uint8_t EIM_GetCheckBitMask(EIM_Type *base, eim_memory_channel_t channel); - -/*! - * @brief EIM module inject databit error for memory channel n, an attempt to invert more than 2 bits in one operation - * might result in undefined behavior. - * - * @param base EIM base address. - * @param channel memory channel. - * @param mask The interrupts to enable. - */ -void EIM_InjectDataBitError(EIM_Type *base, eim_memory_channel_t channel, uint8_t mask); - -/*! - * @brief EIM module get databit mask for memory channel n. - * - * @param base EIM base address. - * @param channel memory channel. - * @retval return checkbit mask. - */ -uint32_t EIM_GetDataBitMask(EIM_Type *base, eim_memory_channel_t channel); - -/*! @}*/ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_erm.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_erm.c deleted file mode 100644 index cdd35b56b09..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_erm.c +++ /dev/null @@ -1,317 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_erm.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.erm" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to ERM bases for each instance. */ -static ERM_Type *const s_ermBases[] = ERM_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to ERM clocks for each instance. */ -static const clock_ip_name_t s_ermClocks[] = ERM_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t ERM_GetInstance(ERM_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_ermBases); instance++) - { - if (s_ermBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_ermBases)); - - return instance; -} - -/*! - * brief ERM module initialization function. - * - * param base ERM base address. - */ -void ERM_Init(ERM_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate ERM clock. */ - CLOCK_EnableClock(s_ermClocks[ERM_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - base->CR0 = 0x00U; -#ifdef ERM_CR1_ENCIE8_MASK - base->CR1 = 0x00U; -#endif - base->SR0 = 0xFFFFFFFFU; -#ifdef ERM_SR1_SBC8_MASK - base->SR1 = 0xFFFFFFFFU; -#endif -} - -/*! - * brief Deinitializes the ERM. - * - */ -void ERM_Deinit(ERM_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate ERM clock. */ - CLOCK_DisableClock(s_ermClocks[ERM_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -uint32_t ERM_GetMemoryErrorAddr(ERM_Type *base, erm_memory_channel_t channel) -{ - uint32_t absoluteErrorAddress = 0x00U; - - switch ((uint8_t)channel) - { - case 0U: - absoluteErrorAddress = base->EAR0; - break; -#ifdef ERM_EAR1_EAR_MASK - case 1U: - absoluteErrorAddress = base->EAR1; - break; -#endif -#ifdef ERM_EAR2_EAR_MASK - case 2U: - absoluteErrorAddress = base->EAR2; - break; -#endif -#ifdef ERM_EAR3_EAR_MASK - case 3U: - absoluteErrorAddress = base->EAR3; - break; -#endif -#ifdef ERM_EAR4_EAR_MASK - case 4U: - absoluteErrorAddress = base->EAR4; - break; -#endif -#ifdef ERM_EAR5_EAR_MASK - case 5U: - absoluteErrorAddress = base->EAR5; - break; -#endif -#ifdef ERM_EAR6_EAR_MASK - case 6U: - absoluteErrorAddress = base->EAR6; - break; -#endif - default: - assert(NULL); - break; - } - - return absoluteErrorAddress; -} - -uint32_t ERM_GetSyndrome(ERM_Type *base, erm_memory_channel_t channel) -{ - uint32_t syndrome = 0x00U; - - switch ((uint8_t)channel) - { - case 0U: - syndrome = (base->SYN0 & ERM_SYN0_SYNDROME_MASK) >> ERM_SYN0_SYNDROME_SHIFT; - break; -#ifdef ERM_SYN1_SYNDROME_MASK - case 1U: - syndrome = (base->SYN1 & ERM_SYN1_SYNDROME_MASK) >> ERM_SYN1_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN2_SYNDROME_MASK - case 2U: - syndrome = (base->SYN2 & ERM_SYN2_SYNDROME_MASK) >> ERM_SYN2_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN3_SYNDROME_MASK - case 3U: - syndrome = (base->SYN3 & ERM_SYN3_SYNDROME_MASK) >> ERM_SYN3_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN4_SYNDROME_MASK - case 4U: - syndrome = (base->SYN4 & ERM_SYN4_SYNDROME_MASK) >> ERM_SYN4_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN5_SYNDROME_MASK - case 5U: - syndrome = (base->SYN5 & ERM_SYN5_SYNDROME_MASK) >> ERM_SYN5_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN6_SYNDROME_MASK - case 6U: - syndrome = (base->SYN6 & ERM_SYN6_SYNDROME_MASK) >> ERM_SYN6_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN7_SYNDROME_MASK - case 7U: - syndrome = (base->SYN7 & ERM_SYN6_SYNDROME_MASK) >> ERM_SYN7_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN8_SYNDROME_MASK - case 8U: - syndrome = (base->SYN8 & ERM_SYN8_SYNDROME_MASK) >> ERM_SYN8_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN9_SYNDROME_MASK - case 8U: - syndrome = (base->SYN9 & ERM_SYN9_SYNDROME_MASK) >> ERM_SYN9_SYNDROME_SHIFT; - break; -#endif - default: - assert(NULL); - break; - } - - return syndrome; -} - -uint32_t ERM_GetErrorCount(ERM_Type *base, erm_memory_channel_t channel) -{ - uint32_t count = 0x00U; - - switch ((uint8_t)channel) - { - case 0U: - count = (base->CORR_ERR_CNT0 & ERM_CORR_ERR_CNT0_COUNT_MASK) >> ERM_CORR_ERR_CNT0_COUNT_SHIFT; - break; -#ifdef ERM_CORR_ERR_CNT1_COUNT_MASK - case 1U: - count = (base->CORR_ERR_CNT1 & ERM_CORR_ERR_CNT1_COUNT_MASK) >> ERM_CORR_ERR_CNT1_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT2_COUNT_MASK - case 2U: - count = (base->CORR_ERR_CNT2 & ERM_CORR_ERR_CNT2_COUNT_MASK) >> ERM_CORR_ERR_CNT2_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT3_COUNT_MASK - case 3U: - count = (base->CORR_ERR_CNT3 & ERM_CORR_ERR_CNT3_COUNT_MASK) >> ERM_CORR_ERR_CNT3_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT4_COUNT_MASK - case 4U: - count = (base->CORR_ERR_CNT4 & ERM_CORR_ERR_CNT4_COUNT_MASK) >> ERM_CORR_ERR_CNT4_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT5_COUNT_MASK - case 5U: - count = (base->CORR_ERR_CNT5 & ERM_CORR_ERR_CNT5_COUNT_MASK) >> ERM_CORR_ERR_CNT5_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT6_COUNT_MASK - case 6U: - count = (base->CORR_ERR_CNT6 & ERM_CORR_ERR_CNT6_COUNT_MASK) >> ERM_CORR_ERR_CNT6_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT7_COUNT_MASK - case 7U: - count = (base->CORR_ERR_CNT7 & ERM_CORR_ERR_CNT7_COUNT_MASK) >> ERM_CORR_ERR_CNT7_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT8_COUNT_MASK - case 8U: - count = (base->CORR_ERR_CNT8 & ERM_CORR_ERR_CNT8_COUNT_MASK) >> ERM_CORR_ERR_CNT8_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT9_COUNT_MASK - case 9U: - count = (base->CORR_ERR_CNT9 & ERM_CORR_ERR_CNT9_COUNT_MASK) >> ERM_CORR_ERR_CNT9_COUNT_SHIFT; - break; -#endif - default: - assert(NULL); - break; - } - - return count; -} - -void ERM_ResetErrorCount(ERM_Type *base, erm_memory_channel_t channel) -{ - switch ((uint8_t)channel) - { - case 0U: - base->CORR_ERR_CNT0 = 0x00U; - break; - -#ifdef ERM_CORR_ERR_CNT1_COUNT_MASK - case 1U: - base->CORR_ERR_CNT1 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT2_COUNT_MASK - case 2U: - base->CORR_ERR_CNT2 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT3_COUNT_MASK - case 3U: - base->CORR_ERR_CNT3 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT4_COUNT_MASK - case 4U: - base->CORR_ERR_CNT4 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT5_COUNT_MASK - case 5U: - base->CORR_ERR_CNT5 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT6_COUNT_MASK - case 6U: - base->CORR_ERR_CNT6 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT6_COUNT_MASK - case 7U: - base->CORR_ERR_CNT7 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT8_COUNT_MASK - case 8U: - base->CORR_ERR_CNT8 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT9_COUNT_MASK - case 9U: - base->CORR_ERR_CNT9 = 0x00U; - break; -#endif - default: - assert(NULL); - break; - } -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_erm.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_erm.h deleted file mode 100644 index c199e74b0e5..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_erm.h +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_ERM_H_ -#define FSL_ERM_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup erm - * @{ - */ - -/****************************************************************************** - * Definitions. - *****************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief Driver version. */ -#define FSL_ERM_DRIVER_VERSION (MAKE_VERSION(2U, 0U, 1U)) -/*@}*/ - -/*! - * @brief ERM interrupt configuration structure, default settings all disabled, _erm_interrupt_enable. - * - * This structure contains the settings for all of the ERM interrupt configurations. - */ -enum -{ - kERM_SingleCorrectionIntEnable = 0x08U, /*!< Single Correction Interrupt Notification enable.*/ - kERM_NonCorrectableIntEnable = 0x04U, /*!< Non-Correction Interrupt Notification enable.*/ - - kERM_AllInterruptsEnable = 0xFFFFFFFFUL, /*!< All Interrupts enable */ -}; - -/*! - * @brief ERM interrupt status, _erm_interrupt_flag. - * - * This provides constants for the ERM event status for use in the ERM functions. - */ -enum -{ - kERM_SingleBitCorrectionIntFlag = 0x08U, /*!< Single-Bit Correction Event.*/ - kERM_NonCorrectableErrorIntFlag = 0x04U, /*!< Non-Correctable Error Event.*/ - - kERM_AllIntsFlag = 0xFFFFFFFFUL, /*!< All Events. */ -}; - -/******************************************************************************* - * APIs - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and de-initialization - * @{ - */ - -/*! - * @brief ERM module initialization function. - * - * @param base ERM base address. - */ -void ERM_Init(ERM_Type *base); - -/*! - * @brief De-initializes the ERM. - * - */ -void ERM_Deinit(ERM_Type *base); - -/* @} */ - -/*! - * @name Interrupt - * @{ - */ -/*! - * @brief ERM enable interrupts. - * - * @param base ERM peripheral base address. - * @param channel memory channel. - * @param mask single correction interrupt or non-correction interrupt enable to disable for one specific memory region. - * Refer to "_erm_interrupt_enable" enumeration. - */ -static inline void ERM_EnableInterrupts(ERM_Type *base, erm_memory_channel_t channel, uint32_t mask) -{ - uint32_t temp = 0x00U; - if ((uint32_t)channel <= 0x07U) - { - temp = base->CR0; - base->CR0 = - (temp & ~(0x0CUL << ((0x07U - (uint32_t)channel) * 4U))) | (mask << ((0x07U - (uint32_t)channel) * 4U)); - } -#ifdef ERM_CR1_ESCIE8_MASK - else - { - temp = base->CR1; - base->CR1 = (temp & ~(0x0CUL << ((0x07U + 0x08U - (uint32_t)channel) * 4U))) | - (mask << ((0x07U + 0x08U - (uint32_t)channel) * 4U)); - } -#endif -} - -/*! - * @brief ERM module disable interrupts. - * - * @param base ERM base address. - * @param channel memory channel. - * @param mask single correction interrupt or non-correction interrupt enable to disable for one specific memory region. - * Refer to "_erm_interrupt_enable" enumeration. - */ -static inline void ERM_DisableInterrupts(ERM_Type *base, erm_memory_channel_t channel, uint32_t mask) -{ - if ((uint32_t)channel <= 0x07U) - { - base->CR0 &= ~(mask << ((0x07U - (uint32_t)channel) * 4U)); - } -#ifdef ERM_CR1_ESCIE8_MASK - else - { - base->CR1 &= ~(mask << ((0x07U + 0x08U - (uint32_t)channel) * 4U)); - } -#endif -} - -/*! - * @brief Gets ERM interrupt flags. - * - * @param base ERM peripheral base address. - * @return ERM event flags. - */ -static inline uint32_t ERM_GetInterruptStatus(ERM_Type *base, erm_memory_channel_t channel) -{ - if ((uint32_t)channel <= 0x07U) - { - return ((base->SR0 & (uint32_t)kERM_AllIntsFlag) >> (0x07U - (uint32_t)channel) * 4U); - } -#ifdef ERM_SR1_SBC8_MASK - else - { - return ((base->SR1 & (uint32_t)kERM_AllIntsFlag) >> ((0x07U + 0x08U - (uint32_t)channel) * 4U)); - } -#else - { - return 0; - } -#endif -} - -/*! - * @brief ERM module clear interrupt status flag. - * - * @param base ERM base address. - * @param mask event flag to clear. Refer to "_erm_interrupt_flag" enumeration. - */ -static inline void ERM_ClearInterruptStatus(ERM_Type *base, erm_memory_channel_t channel, uint32_t mask) -{ - if ((uint32_t)channel <= 0x07U) - { - base->SR0 = mask << ((0x07U - (uint32_t)channel) * 4U); - } -#ifdef ERM_SR1_SBC8_MASK - else - { - base->SR1 = mask << ((0x07U + 0x08U - (uint32_t)channel) * 4U); - } -#endif -} - -/* @} */ - -/*! - * @name functional - * @{ - */ - -/*! - * @brief ERM get memory error absolute address, which capturing the address of the last ECC event in Memory n. - * - * @param base ERM base address. - * @param channel memory channel. - * @retval memory error absolute address. - */ - -uint32_t ERM_GetMemoryErrorAddr(ERM_Type *base, erm_memory_channel_t channel); - -/*! - * @brief ERM get syndrome, which identifies the pertinent bit position on a correctable, single-bit data inversion or a - * non-correctable, single-bit address inversion. The syndrome value does not provide any additional diagnostic - * information on non-correctable, multi-bit inversions. - * - * @param base ERM base address. - * @param channel memory channel. - * @retval syndrome value. - */ -uint32_t ERM_GetSyndrome(ERM_Type *base, erm_memory_channel_t channel); - -/*! - * @brief ERM get error count, which records the count value of the number of correctable ECC error events for Memory - * n. Non-correctable errors are considered a serious fault, so the ERM does not provide any mechanism to count - * non-correctable errors. Only correctable errors are counted. - * - * @param base ERM base address. - * @param channel memory channel. - * @retval error count. - */ -uint32_t ERM_GetErrorCount(ERM_Type *base, erm_memory_channel_t channel); - -/*! - * @brief ERM reset error count. - * - * @param base ERM base address. - * @param channel memory channel. - */ -void ERM_ResetErrorCount(ERM_Type *base, erm_memory_channel_t channel); - -/*! @}*/ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_evtg.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_evtg.c deleted file mode 100644 index 7402c428d39..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_evtg.c +++ /dev/null @@ -1,418 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_evtg.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.evtg" -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Initialize EVTG with a user configuration structure. - * - * param base EVTG base address. - * param evtgIndex EVTG instance index. - * param psConfig EVTG initial configuration structure pointer. - */ -void EVTG_Init(EVTG_Type *base, evtg_index_t evtgIndex, evtg_config_t *psConfig) -{ - /* Configure Flip-Flop as expected mode. */ - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_CTRL = EVTG_EVTG_INST_EVTG_CTRL_MODE_SEL((uint16_t)psConfig->flipflopMode); - - if (kEVTG_FFModeJKFF == psConfig->flipflopMode) - { - /* When FF Mode is configured as JK-FF mode, need EVTG_OUTA feedback to EVTG input and replace one of the four - * inputs.*/ - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_CTRL |= - EVTG_EVTG_INST_EVTG_CTRL_FB_OVRD((uint16_t)psConfig->outfdbkOverideinput); - } - - if (psConfig->enableFlipflopInitOutput == true) - { - EVTG_ForceFlipflopInitOutput(base, evtgIndex, psConfig->flipflopInitOutputValue); - } - -#if defined(FSL_FEATURE_EVTG_HAS_FORCE_BYPASS_FLIPFLOP) && FSL_FEATURE_EVTG_HAS_FORCE_BYPASS_FLIPFLOP - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_CTRL |= EVTG_EVTG_INST_EVTG_CTRL_FORCE_BYPASS( - ((uint16_t)psConfig->enableForceBypassFlipFlopAOI1 << 1U) | (uint16_t)psConfig->enableForceBypassFlipFlopAOI0); -#endif - - /* Configure EVTG input sync. */ - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_CTRL |= EVTG_EVTG_INST_EVTG_CTRL_SYNC_CTRL( - (((uint16_t)psConfig->enableInputDSync << 3U) | ((uint16_t)psConfig->enableInputCSync << 2U) | - ((uint16_t)psConfig->enableInputBSync << 1U) | ((uint16_t)psConfig->enableInputASync))); - - /* Configure AOI0. */ - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI0_BFT01 = - (EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_AC((uint8_t)psConfig->aoi0Config.productTerm0.aInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_BC((uint8_t)psConfig->aoi0Config.productTerm0.bInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_CC((uint8_t)psConfig->aoi0Config.productTerm0.cInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_DC((uint8_t)psConfig->aoi0Config.productTerm0.dInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_AC((uint8_t)psConfig->aoi0Config.productTerm1.aInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_BC((uint8_t)psConfig->aoi0Config.productTerm1.bInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_CC((uint8_t)psConfig->aoi0Config.productTerm1.cInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_DC((uint8_t)psConfig->aoi0Config.productTerm1.dInput)); - - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI0_BFT23 = - (EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_AC((uint8_t)psConfig->aoi0Config.productTerm2.aInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_BC((uint8_t)psConfig->aoi0Config.productTerm2.bInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_CC((uint8_t)psConfig->aoi0Config.productTerm2.cInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_DC((uint8_t)psConfig->aoi0Config.productTerm2.dInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_AC((uint8_t)psConfig->aoi0Config.productTerm3.aInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_BC((uint8_t)psConfig->aoi0Config.productTerm3.bInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_CC((uint8_t)psConfig->aoi0Config.productTerm3.cInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_DC((uint8_t)psConfig->aoi0Config.productTerm3.dInput)); - - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI0_FILT |= - (EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_CNT((uint16_t)psConfig->aoi0Config.aoiOutFilterConfig.sampleCount) | - EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_PER(psConfig->aoi0Config.aoiOutFilterConfig.samplePeriod)); - - /* Configure AOI1. */ - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI1_BFT01 = - (EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_AC((uint8_t)psConfig->aoi1Config.productTerm0.aInput) | - EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_BC((uint8_t)psConfig->aoi1Config.productTerm0.bInput) | - EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_CC((uint8_t)psConfig->aoi1Config.productTerm0.cInput) | - EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_DC((uint8_t)psConfig->aoi1Config.productTerm0.dInput) | - EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_AC((uint8_t)psConfig->aoi1Config.productTerm1.aInput) | - EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_BC((uint8_t)psConfig->aoi1Config.productTerm1.bInput) | - EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_CC((uint8_t)psConfig->aoi1Config.productTerm1.cInput) | - EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_DC((uint8_t)psConfig->aoi1Config.productTerm1.dInput)); - - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI1_BFT23 = - (EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_AC((uint8_t)psConfig->aoi1Config.productTerm2.aInput) | - EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_BC((uint8_t)psConfig->aoi1Config.productTerm2.bInput) | - EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_CC((uint8_t)psConfig->aoi1Config.productTerm2.cInput) | - EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_DC((uint8_t)psConfig->aoi1Config.productTerm2.dInput) | - EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_AC((uint8_t)psConfig->aoi1Config.productTerm3.aInput) | - EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_BC((uint8_t)psConfig->aoi1Config.productTerm3.bInput) | - EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_CC((uint8_t)psConfig->aoi1Config.productTerm3.cInput) | - EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_DC((uint8_t)psConfig->aoi1Config.productTerm3.dInput)); - - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI1_FILT |= - (EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_CNT((uint16_t)psConfig->aoi1Config.aoiOutFilterConfig.sampleCount) | - EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_PER(psConfig->aoi1Config.aoiOutFilterConfig.samplePeriod)); -} - -/*! - * brief Configure AOI product term by initializing the product term - * configuration structure. - * - * param base EVTG base address. - * param evtgIndex EVTG instance index. - * param aoiIndex EVTG AOI index. see enum ref evtg_aoi_index_t - * param productTerm EVTG AOI product term index. - * param psProductTermConfig Pointer to EVTG product term configuration structure. - * see ref _evtg_product_term_config - */ -void EVTG_ConfigAOIProductTerm(EVTG_Type *base, - evtg_index_t evtgIndex, - evtg_aoi_index_t aoiIndex, - evtg_aoi_product_term_t productTerm, - evtg_aoi_product_term_config_t *psProductTermConfig) -{ - volatile uint16_t *pu16AOIPT01Config; - volatile uint16_t *pu16AOIPT23Config; - - if (kEVTG_AOI0 == aoiIndex) - { - pu16AOIPT01Config = &base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI0_BFT01; - pu16AOIPT23Config = &base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI0_BFT23; - } - else - { - pu16AOIPT01Config = &base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI1_BFT01; - pu16AOIPT23Config = &base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI1_BFT23; - } - - if (kEVTG_ProductTerm0 == productTerm) - { - *pu16AOIPT01Config &= - ~(uint16_t)(EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_AC_MASK | EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_BC_MASK | - EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_CC_MASK | EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_DC_MASK); - *pu16AOIPT01Config |= (EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_AC((uint8_t)psProductTermConfig->aInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_BC((uint8_t)psProductTermConfig->bInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_CC((uint8_t)psProductTermConfig->cInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_DC((uint8_t)psProductTermConfig->dInput)); - } - else if (kEVTG_ProductTerm1 == productTerm) - { - *pu16AOIPT01Config &= - ~(uint16_t)(EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_AC_MASK | EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_BC_MASK | - EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_CC_MASK | EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_DC_MASK); - *pu16AOIPT01Config |= (EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_AC((uint8_t)psProductTermConfig->aInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_BC((uint8_t)psProductTermConfig->bInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_CC((uint8_t)psProductTermConfig->cInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_DC((uint8_t)psProductTermConfig->dInput)); - } - else if (kEVTG_ProductTerm2 == productTerm) - { - *pu16AOIPT23Config &= - ~(uint16_t)(EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_AC_MASK | EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_BC_MASK | - EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_CC_MASK | EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_DC_MASK); - *pu16AOIPT23Config |= (EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_AC((uint8_t)psProductTermConfig->aInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_BC((uint8_t)psProductTermConfig->bInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_CC((uint8_t)psProductTermConfig->cInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_DC((uint8_t)psProductTermConfig->dInput)); - } - else - { - *pu16AOIPT23Config &= - ~(uint16_t)(EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_AC_MASK | EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_BC_MASK | - EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_CC_MASK | EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_DC_MASK); - *pu16AOIPT23Config |= (EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_AC((uint8_t)psProductTermConfig->aInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_BC((uint8_t)psProductTermConfig->bInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_CC((uint8_t)psProductTermConfig->cInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_DC((uint8_t)psProductTermConfig->dInput)); - } -} - -/*! - * @brief Loads default values to the EVTG configuration structure. - * - * The purpose of this API is to initialize the configuration structure to default value for @ref EVTG_Init() - * to use. - * The Flip-Flop can be configured as Bypass mode, RS trigger mode, T-FF mode, D-FF mode, JK-FF mode, Latch mode. - * Please check RM INTC chapter for more details. - * - * @param psConfig EVTG initial configuration structure pointer. - * @param flipflopMode EVTG flip flop mode. see @ ref _evtg_flipflop_mode - */ -void EVTG_GetDefaultConfig(evtg_config_t *psConfig, evtg_flipflop_mode_t flipflopMode) -{ - /* Initializes the configure structure to zero. */ - (void)memset(psConfig, 0, sizeof(evtg_config_t)); - - switch (flipflopMode) - { - case kEVTG_FFModeBypass: - - /* - * In this mode, filp-flop will be passed, The two AOI expressions "AOI_0" and "AOI_1" - * will be directly assigned to EVTG outputs(EVTG_OUTA and EVTG_OUTB). - * - * In this mode, user can choose to enable or disable input sync logic and filter function. - * Here disable both input sync logic and filter function. - */ - psConfig->flipflopMode = kEVTG_FFModeBypass; - - psConfig->enableInputASync = false; - psConfig->enableInputBSync = false; - psConfig->enableInputCSync = false; - psConfig->enableInputDSync = false; - - break; - - case kEVTG_FFModeRSTrigger: - - /* - * In this mode, AOI_0 expression is Reset port, and AOI_1 is Set port. Both are active - * high. When "R"(Reset) is high, whatever "S"(Set) is, EVTG_OUTA will be "0". When "R" is - * low and "S" is high, EVTG_OUTA will be "1". If both "R" and "S" are low, EVTG output - * will be kept. EVTG_OUTB is always the complement of EVTG_OUTA. - * - * In this mode, user can choose to enable or disable input sync logic and filter function. - * Here disable both input sync logic and filter function. - */ - psConfig->flipflopMode = kEVTG_FFModeRSTrigger; - - psConfig->enableInputASync = false; - psConfig->enableInputBSync = false; - psConfig->enableInputCSync = false; - psConfig->enableInputDSync = false; - - break; - - case kEVTG_FFModeTFF: - - /* - * In this mode, AOI_0 expression is T port of T-FF, AOI_1 is CLK port. When T assert, - * the Q port (EVTG_OUTA) will turnover at the rising edge of "CLK". When T dis-assert, - * Q(EVTG_OUTA) will be kept. EVTG_OUTB is always the complement of EVTG_OUTA. - * - * In this mode, input sync or filter has to be enabled to remove the possible glitch. - * Here input sync is enabled, filter is disabled. User could override corresponding fields - * depends on the actual user case to choose to enable or disable input sync logic and filter - * function. - */ - psConfig->flipflopMode = kEVTG_FFModeTFF; - - psConfig->enableInputASync = true; - psConfig->enableInputBSync = true; - psConfig->enableInputCSync = true; - psConfig->enableInputDSync = true; - - break; - - case kEVTG_FFModeJKFF: - - /* - * In general, JK Flip-Flop have four input ports: J, K , Q and CLK(Q is output of Flip-Flop). - * And the logical expression is J&~Q | ~K&Q; Here we implement the logic expression by AOI - * so that we can reuse the D-FF to implement JK-FF. Suppose we set EVTG input "An" as "J" port, - * "Cn" as "K" port, "Dn" as "CLK" port, and "Q" port of FF feed back and override "Bn". - * According to the JK logic expression, the AOI_0 expression will be "An&~Bn | Bn&~Cn", - * AOI_1 expression will be "Dn". - * - * In this mode, input sync or filter has to be enabled to remove the possible glitch. - * Here input sync is enabled, filter is disabled. User could override corresponding fields - * depends on the actual user case to choose to enable or disable input sync logic and filter - * function. - * - * When FF Mode is configured as JK-FF mode, need EVTG_OUTA feedback to EVTG input and replace - * one of the four inputs. Here input Bn is replaced, represents which EVTG input(EVTG_OUTA) - * is replaced by FF output. - */ - psConfig->flipflopMode = kEVTG_FFModeJKFF; - psConfig->outfdbkOverideinput = kEVTG_OutputOverrideInputB; - - psConfig->enableInputASync = true; - psConfig->enableInputBSync = true; - psConfig->enableInputCSync = true; - psConfig->enableInputDSync = true; - - break; - - case kEVTG_FFModeLatch: - - /* - * In this mode, AOI_0 expression is D port, AOI_1 is CLK port. Different from D-FF - * mode, in Latch mode, D port will be passed only when CLK is high, and output will be - * kept when CLK is low. EVTG_OUTB is always the complement of EVTG_OUTA. - * - * In this mode, input sync or filter has to be enabled to remove the possible glitch. - * Here input sync is enabled, filter is disabled. User could override corresponding fields - * depends on the actual user case to choose to enable or disable input sync logic and filter - * function. - */ - psConfig->flipflopMode = kEVTG_FFModeLatch; - - psConfig->enableInputASync = true; - psConfig->enableInputBSync = true; - psConfig->enableInputCSync = true; - psConfig->enableInputDSync = true; - - break; - - default: - assert(false); - break; - } - /* User could choose to enable or disable Flip-flop initial output value. */ - psConfig->enableFlipflopInitOutput = false; - psConfig->flipflopInitOutputValue = kEVTG_FFInitOut0; - - /* User could choose to override this fields to enable filter function. */ - psConfig->aoi0Config.aoiOutFilterConfig.sampleCount = kEVTG_AOIOutFilterSampleCount3; - psConfig->aoi0Config.aoiOutFilterConfig.samplePeriod = 0U; - - psConfig->aoi1Config.aoiOutFilterConfig.sampleCount = kEVTG_AOIOutFilterSampleCount3; - psConfig->aoi1Config.aoiOutFilterConfig.samplePeriod = 0U; - -#if defined(FSL_FEATURE_EVTG_HAS_FORCE_BYPASS_FLIPFLOP) && FSL_FEATURE_EVTG_HAS_FORCE_BYPASS_FLIPFLOP - psConfig->enableForceBypassFlipFlopAOI0 = false; - psConfig->enableForceBypassFlipFlopAOI1 = false; -#endif - - /* - * For JK-FF Mode, Here we implement the logic expression by AOI so that we can reuse the - * D-FF to implement JK-FF. Suppose we set EVTG input "An" as "J" port, "Cn" as "K" port, "Dn" - * as "CLK" port, and "Q" port of FF feed back and override "Bn". According to the JK logic - * expression, the AOI_0 expression will be "An&~Bn | Bn&~Cn", AOI_1 expression will be "Dn". - * - * For other FF Mode, the default input here is logical 0. User can configure to produce a logical 0 - * or 1 or pass the true or complement of the selected event input according to their requirement. - */ - if (kEVTG_FFModeJKFF == flipflopMode) - { - psConfig->aoi0Config.productTerm0.aInput = kEVTG_InputDirectPass; - psConfig->aoi0Config.productTerm0.bInput = kEVTG_InputComplement; - psConfig->aoi0Config.productTerm0.cInput = kEVTG_InputLogicOne; - psConfig->aoi0Config.productTerm0.dInput = kEVTG_InputLogicOne; - - psConfig->aoi0Config.productTerm1.aInput = kEVTG_InputLogicOne; - psConfig->aoi0Config.productTerm1.bInput = kEVTG_InputDirectPass; - psConfig->aoi0Config.productTerm1.cInput = kEVTG_InputComplement; - psConfig->aoi0Config.productTerm1.dInput = kEVTG_InputLogicOne; - - psConfig->aoi0Config.productTerm2.aInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm2.bInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm2.cInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm2.dInput = kEVTG_InputLogicZero; - - psConfig->aoi0Config.productTerm3.aInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm3.bInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm3.cInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm3.dInput = kEVTG_InputLogicZero; - - psConfig->aoi1Config.productTerm0.aInput = kEVTG_InputLogicOne; - psConfig->aoi1Config.productTerm0.bInput = kEVTG_InputLogicOne; - psConfig->aoi1Config.productTerm0.cInput = kEVTG_InputLogicOne; - psConfig->aoi1Config.productTerm0.dInput = kEVTG_InputDirectPass; - - psConfig->aoi1Config.productTerm1.aInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm1.bInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm1.cInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm1.dInput = kEVTG_InputLogicZero; - - psConfig->aoi1Config.productTerm2.aInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm2.bInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm2.cInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm2.dInput = kEVTG_InputLogicZero; - - psConfig->aoi1Config.productTerm3.aInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm3.bInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm3.cInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm3.dInput = kEVTG_InputLogicZero; - } - else - { - psConfig->aoi0Config.productTerm0.aInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm0.bInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm0.cInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm0.dInput = kEVTG_InputLogicZero; - - psConfig->aoi0Config.productTerm1.aInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm1.bInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm1.cInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm1.dInput = kEVTG_InputLogicZero; - - psConfig->aoi0Config.productTerm2.aInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm2.bInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm2.cInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm2.dInput = kEVTG_InputLogicZero; - - psConfig->aoi0Config.productTerm3.aInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm3.bInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm3.cInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm3.dInput = kEVTG_InputLogicZero; - - psConfig->aoi1Config.productTerm0.aInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm0.bInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm0.cInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm0.dInput = kEVTG_InputLogicZero; - - psConfig->aoi1Config.productTerm1.aInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm1.bInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm1.cInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm1.dInput = kEVTG_InputLogicZero; - - psConfig->aoi1Config.productTerm2.aInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm2.bInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm2.cInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm2.dInput = kEVTG_InputLogicZero; - - psConfig->aoi1Config.productTerm3.aInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm3.bInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm3.cInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm3.dInput = kEVTG_InputLogicZero; - } -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_evtg.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_evtg.h deleted file mode 100644 index 42a2a746e74..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_evtg.h +++ /dev/null @@ -1,355 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_EVTG_H_ -#define FSL_EVTG_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup evtg - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief EVTG driver version. */ -#define FSL_EVTG_DRIVER_VERSION (MAKE_VERSION(2, 0, 1)) /*!< Version 2.0.1. */ -/*@}*/ - -/*! @brief EVTG instance index. */ -typedef enum _evtg_index -{ - kEVTG_Index0 = 0x0U, /*!< EVTG instance index 0. */ - kEVTG_Index1, /*!< EVTG instance index 1. */ - kEVTG_Index2, /*!< EVTG instance index 2. */ - kEVTG_Index3, /*!< EVTG instance index 3. */ -} evtg_index_t; - -/*! @brief EVTG input index. */ -typedef enum _evtg_input_index -{ - kEVTG_InputA = 0x0U, /*!< EVTG input A. */ - kEVTG_InputB, /*!< EVTG input B. */ - kEVTG_InputC, /*!< EVTG input C. */ - kEVTG_InputD, /*!< EVTG input D. */ -} evtg_input_index_t; - -/*! @brief EVTG AOI index. */ -typedef enum _evtg_aoi_index -{ - kEVTG_AOI0 = 0x0U, /*!< EVTG AOI index 0. */ - kEVTG_AOI1 = 0x1U, /*!< EVTG AOI index 1. */ -} evtg_aoi_index_t; - -/*! @brief EVTG AOI product term index. */ -typedef enum _evtg_aoi_product_term -{ - kEVTG_ProductTerm0 = 0x0U, /*!< EVTG AOI product term index 0. */ - kEVTG_ProductTerm1, /*!< EVTG AOI product term index 1. */ - kEVTG_ProductTerm2, /*!< EVTG AOI product term index 2. */ - kEVTG_ProductTerm3, /*!< EVTG AOI product term index 3. */ -} evtg_aoi_product_term_t; - -/*! @brief EVTG input configuration. */ -typedef enum _evtg_aoi_input_config -{ - kEVTG_InputLogicZero = 0x0U, /*!< Force input in product term to a logical zero. */ - kEVTG_InputDirectPass, /*!< Pass input in product term. */ - kEVTG_InputComplement, /*!< Complement input in product term. */ - kEVTG_InputLogicOne, /*!< Force input in product term to a logical one. */ -} evtg_aoi_input_config_t; - -/*! @brief EVTG AOI Output Filter Sample Count. */ -typedef enum _evtg_aoi_outfilter_count -{ - kEVTG_AOIOutFilterSampleCount3 = 0x0U, /*!< EVTG AOI output filter sample count is 3. */ - kEVTG_AOIOutFilterSampleCount4, /*!< EVTG AOI output filter sample count is 4. */ - kEVTG_AOIOutFilterSampleCount5, /*!< EVTG AOI output filter sample count is 5. */ - kEVTG_AOIOutFilterSampleCount6, /*!< EVTG AOI output filter sample count is 6. */ - kEVTG_AOIOutFilterSampleCount7, /*!< EVTG AOI output filter sample count is 7. */ - kEVTG_AOIOutFilterSampleCount8, /*!< EVTG AOI output filter sample count is 8. */ - kEVTG_AOIOutFilterSampleCount9, /*!< EVTG AOI output filter sample count is 9. */ - kEVTG_AOIOutFilterSampleCount10, /*!< EVTG AOI output filter sample count is 10. */ -} evtg_aoi_outfilter_count_t; - -/*! - * @brief EVTG output feedback override control mode. When FF is configured as JK-FF mode, - * need EVTG_OUTA feedback to EVTG input and replace one of the four inputs. - */ -typedef enum _evtg_outfdbk_override_input -{ - kEVTG_OutputOverrideInputA = 0x0U, /*!< Replace input A. */ - kEVTG_OutputOverrideInputB, /*!< Replace input B. */ - kEVTG_OutputOverrideInputC, /*!< Replace input C. */ - kEVTG_OutputOverrideInputD, /*!< Replace input D. */ -} evtg_outfdbk_override_input_t; - -/*! @brief EVTG flip flop mode configuration. */ -typedef enum _evtg_flipflop_mode -{ - kEVTG_FFModeBypass = 0x0U, /*!< Bypass mode (default).In this mode, user can choose to enable - or disable input sync logic and filter function. */ - kEVTG_FFModeRSTrigger, /*!< RS trigger mode. In this mode, user can choose to enable - or disable input sync logic and filter function. */ - kEVTG_FFModeTFF, /*!< T-FF mode. In this mode, input sync or filter has to be enabled - to remove the possible glitch.*/ - kEVTG_FFModeDFF, /*!< D-FF mode. In this mode, input sync or filter has to be enabled - to remove the possible glitch.*/ - kEVTG_FFModeJKFF, /*!< JK-FF mode. In this mode, input sync or filter has to be enabled - to remove the possible glitch.*/ - kEVTG_FFModeLatch, /*!< Latch mode. In this mode, input sync or filter has to be enabled - to remove the possible glitch.*/ -} evtg_flipflop_mode_t; - -/*! @brief EVTG flip-flop initial value. */ -typedef enum _evtg_flipflop_init_output -{ - kEVTG_FFInitOut0 = 0x0U, /*!< Configure the positive output of flip-flop as 0. */ - kEVTG_FFInitOut1 = 0x1U, /*!< Configure the positive output of flip-flop as 1. */ -} evtg_flipflop_init_output_t; - -/*! @brief The structure for configuring an AOI output filter sample. - * - * AOI output filter sample count represent the number of consecutive samples that must agree prior to the AOI output - * filter accepting an transition. - * AOI output filter sample period represent the sampling period (in IP bus clock cycles) of the AOI output signals. - * Each AOI output is sampled multiple times at the rate specified by this period. - * - * For the modes with Filter function enabled, filter delay is "(FILT_CNT + 3) x FILT_PER + 2". - * - */ -typedef struct _evtg_aoi_outfilter_config -{ - evtg_aoi_outfilter_count_t sampleCount; /*!< EVTG AOI output filter sample count. - refer to @ref evtg_aoi_outfilter_count_t. */ - uint8_t samplePeriod; /*!< EVTG AOI output filter sample period, within 0~255. If sample period - value is 0x00 (default), then the input filter is bypassed. */ -} evtg_aoi_outfilter_config_t; - -/*! @brief The structure for configuring an AOI product term. */ -typedef struct _evtg_aoi_product_term_config -{ - evtg_aoi_input_config_t aInput; /*!< Input A configuration. */ - evtg_aoi_input_config_t bInput; /*!< Input B configuration. */ - evtg_aoi_input_config_t cInput; /*!< Input C configuration. */ - evtg_aoi_input_config_t dInput; /*!< Input D configuration. */ -} evtg_aoi_product_term_config_t; - -/*! @brief EVTG AOI configuration structure. */ -typedef struct _evtg_aoi_config -{ - /* AOI Output Filter configuration. */ - evtg_aoi_outfilter_config_t aoiOutFilterConfig; /*!< EVTG AOI output filter sample - configuration structure. */ - - /* Product term configuration. */ - evtg_aoi_product_term_config_t productTerm0; /*!< Configure AOI product term0. */ - evtg_aoi_product_term_config_t productTerm1; /*!< Configure AOI product term1. */ - evtg_aoi_product_term_config_t productTerm2; /*!< Configure AOI product term2. */ - evtg_aoi_product_term_config_t productTerm3; /*!< Configure AOI product term3. */ -} evtg_aoi_config_t; - -/*! @brief EVTG configuration covering all configurable fields. */ -typedef struct _evtg_config -{ - /* Input configuration. */ - bool enableInputASync; /*!< Enable/Disable EVTG A input synchronous with bus clk. */ - bool enableInputBSync; /*!< Enable/Disable EVTG B input synchronous with bus clk. */ - bool enableInputCSync; /*!< Enable/Disable EVTG C input synchronous with bus clk. */ - bool enableInputDSync; /*!< Enable/Disable EVTG D input synchronous with bus clk. */ - evtg_outfdbk_override_input_t outfdbkOverideinput; /*!< EVTG output feedback to EVTG input - and replace one of the four inputs. */ - - /* Flip-flop configuration. */ - evtg_flipflop_mode_t flipflopMode; /*!< Flip-Flop can be configured as one of Bypass mode, RS trigger mode, - T-FF mode, D-FF mode, JK-FF mode, Latch mode. */ - bool enableFlipflopInitOutput; /*!< Flip-flop initial output value enable/disable. */ - evtg_flipflop_init_output_t flipflopInitOutputValue; /*!< Flip-flop initial output value configuration. */ - -#if defined(FSL_FEATURE_EVTG_HAS_FORCE_BYPASS_FLIPFLOP) && FSL_FEATURE_EVTG_HAS_FORCE_BYPASS_FLIPFLOP - bool enableForceBypassFlipFlopAOI0; /*!< Enable/Disable force bypass Flip-Flop and route the AOI_0(Filter_0) - value directly to EVTG_OUTA */ - bool enableForceBypassFlipFlopAOI1; /*!< Enable/Disable force bypass Flip-Flop and route the AOI_1(Filter_1) - value directly to EVTG_OUTB */ -#endif - - /* AOI configuration. */ - evtg_aoi_config_t aoi0Config; /*!< Configure EVTG AOI0. */ - evtg_aoi_config_t aoi1Config; /*!< Configure EVTG AOI1. */ -} evtg_config_t; - -/*! @} */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @addtogroup evtg_driver - * @{ - */ - -/*! - * @name Initialization Interfaces - * @{ - */ - -/*! - * @brief Initialize EVTG with a user configuration structure. - * - * @param base EVTG base address. - * @param evtgIndex EVTG instance index. - * @param psConfig EVTG initial configuration structure pointer. - */ -void EVTG_Init(EVTG_Type *base, evtg_index_t evtgIndex, evtg_config_t *psConfig); - -/*! - * @brief Loads default values to the EVTG configuration structure. - * - * The purpose of this API is to initialize the configuration structure to default value for @ref EVTG_Init() - * to use. - * The Flip-Flop can be configured as Bypass mode, RS trigger mode, T-FF mode, D-FF mode, JK-FF mode, Latch mode. - * Please check RM INTC chapter for more details. - * - * @param psConfig EVTG initial configuration structure pointer. - * @param flipflopMode EVTG flip flop mode. see @ ref _evtg_flipflop_mode - */ -void EVTG_GetDefaultConfig(evtg_config_t *psConfig, evtg_flipflop_mode_t flipflopMode); -/*! @} */ - -/*! - * @name Force Init Flipflop Interfaces - * @{ - */ - -/*! - * @brief Force Flip-flop initial output value to be presented on flip-flop positive output. - * - * @param base EVTG base address. - * @param evtgIndex EVTG instance index. - * @param flipflopInitOutputValue EVTG flip-flop initial output control. - * see @ref evtg_flipflop_init_output_t - */ -static inline void EVTG_ForceFlipflopInitOutput(EVTG_Type *base, - evtg_index_t evtgIndex, - evtg_flipflop_init_output_t flipflopInitOutputValue) -{ - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_CTRL &= (~(uint16_t)EVTG_EVTG_INST_EVTG_CTRL_FF_INIT_MASK); - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_CTRL |= - EVTG_EVTG_INST_EVTG_CTRL_FF_INIT((uint16_t)flipflopInitOutputValue); - /* INIT_EN bit should be set after FF_INIT is set. */ - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_CTRL |= EVTG_EVTG_INST_EVTG_CTRL_INIT_EN_MASK; -} -/*! @} */ - -/*! - * @name Input Interfaces - * @{ - */ -/*! - * @brief Configure each input value of AOI product term. Each selected input term in - * each product term can be configured to produce a logical 0 or 1 or pass the - * true or complement of the selected event input. Adapt to some simple aoi - * expressions. - * - * @param base EVTG base address. - * @param evtgIndex EVTG instance index. - * @param aoiIndex EVTG AOI index. see enum ref evtg_aoi_index_t - * @param productTerm EVTG product term index. - * @param inputIndex EVTG input index. - * @param input EVTG input configuration with enum @ref evtg_aoi_input_config_t. - */ -static inline void EVTG_SetProductTermInput(EVTG_Type *base, - evtg_index_t evtgIndex, - evtg_aoi_index_t aoiIndex, - evtg_aoi_product_term_t productTerm, - evtg_input_index_t inputIndex, - evtg_aoi_input_config_t input) -{ - if (kEVTG_AOI0 == aoiIndex) - { - if ((productTerm == kEVTG_ProductTerm0) || (productTerm == kEVTG_ProductTerm1)) - { - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI0_BFT01 &= - (uint16_t)(~(3UL << ((3U - ((uint8_t)inputIndex)) * 2U + (((3U - (uint8_t)productTerm) % 2U) * 8U)))); - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI0_BFT01 |= - ((((uint16_t)(input)) << ((3U - ((uint8_t)inputIndex)) * 2U + - (((3U - (uint8_t)productTerm) % 2U) * 8U))) & - (uint16_t)(3UL << ((3U - ((uint8_t)inputIndex)) * 2U + (((3U - (uint8_t)productTerm) % 2U) * 8U)))); - } - else - { - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI0_BFT23 &= - (uint16_t)(~(3UL << ((3U - ((uint8_t)inputIndex)) * 2U + (((3U - (uint8_t)productTerm) % 2U) * 8U)))); - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI0_BFT23 |= - ((((uint16_t)(input)) << ((3U - ((uint8_t)inputIndex)) * 2U + - (((3U - (uint8_t)productTerm) % 2U) * 8U))) & - (uint16_t)(3UL << ((3U - ((uint8_t)inputIndex)) * 2U + (((3U - (uint8_t)productTerm) % 2U) * 8U)))); - } - } - else if (kEVTG_AOI1 == aoiIndex) - { - if ((productTerm == kEVTG_ProductTerm0) || (productTerm == kEVTG_ProductTerm1)) - { - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI1_BFT01 &= - (uint16_t)(~(3UL << ((3U - ((uint8_t)inputIndex)) * 2U + (((3U - (uint8_t)productTerm) % 2U) * 8U)))); - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI1_BFT01 |= - ((((uint16_t)(input)) << ((3U - ((uint8_t)inputIndex)) * 2U + - (((3U - (uint8_t)productTerm) % 2U) * 8U))) & - (uint16_t)(3UL << ((3U - ((uint8_t)inputIndex)) * 2U + (((3U - (uint8_t)productTerm) % 2U) * 8U)))); - } - else - { - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI1_BFT23 &= - (uint16_t)(~(3UL << ((3U - ((uint8_t)inputIndex)) * 2U + (((3U - (uint8_t)productTerm) % 2U) * 8U)))); - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI1_BFT23 |= - ((((uint16_t)(input)) << ((3U - ((uint8_t)inputIndex)) * 2U + - (((3U - (uint8_t)productTerm) % 2U) * 8U))) & - (uint16_t)(3UL << ((3U - ((uint8_t)inputIndex)) * 2U + (((3U - (uint8_t)productTerm) % 2U) * 8U)))); - } - } - else - { - ; /* No action*/ - } -} - -/*! - * @brief Configure AOI product term by initializing the product term - * configuration structure. - * - * @param base EVTG base address. - * @param evtgIndex EVTG instance index. - * @param aoiIndex EVTG AOI index. see enum @ref evtg_aoi_index_t - * @param productTerm EVTG AOI product term index. - * @param psProductTermConfig Pointer to EVTG product term configuration structure. - * see ref _evtg_aoi_product_term_config - */ -void EVTG_ConfigAOIProductTerm(EVTG_Type *base, - evtg_index_t evtgIndex, - evtg_aoi_index_t aoiIndex, - evtg_aoi_product_term_t productTerm, - evtg_aoi_product_term_config_t *psProductTermConfig); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @} */ - -#endif /* FSL_EVTG_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_ewm.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_ewm.c deleted file mode 100644 index 593cf87a50b..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_ewm.c +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2017, 2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_ewm.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.ewm" -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Initializes the EWM peripheral. - * - * This function is used to initialize the EWM. After calling, the EWM - * runs immediately according to the configuration. - * Note that, except for the interrupt enable control bit, other control bits and registers are write once after a - * CPU reset. Modifying them more than once generates a bus transfer error. - * - * This is an example. - * code - * ewm_config_t config; - * EWM_GetDefaultConfig(&config); - * config.compareHighValue = 0xAAU; - * EWM_Init(ewm_base,&config); - * endcode - * - * param base EWM peripheral base address - * param config The configuration of the EWM - */ -void EWM_Init(EWM_Type *base, const ewm_config_t *config) -{ - assert(NULL != config); - - uint8_t value = 0U; - -#if !((defined(FSL_FEATURE_SOC_PCC_COUNT) && FSL_FEATURE_SOC_PCC_COUNT) && \ - (defined(FSL_FEATURE_PCC_SUPPORT_EWM_CLOCK_REMOVE) && FSL_FEATURE_PCC_SUPPORT_EWM_CLOCK_REMOVE)) -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_EnableClock(kCLOCK_Ewm0); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif - value = EWM_CTRL_EWMEN(config->enableEwm) | EWM_CTRL_ASSIN(config->setInputAssertLogic) | - EWM_CTRL_INEN(config->enableEwmInput) | EWM_CTRL_INTEN(config->enableInterrupt); -#if defined(FSL_FEATURE_EWM_HAS_PRESCALER) && FSL_FEATURE_EWM_HAS_PRESCALER - base->CLKPRESCALER = config->prescaler; -#endif /* FSL_FEATURE_EWM_HAS_PRESCALER */ - -#if defined(FSL_FEATURE_EWM_HAS_CLOCK_SELECT) && FSL_FEATURE_EWM_HAS_CLOCK_SELECT - base->CLKCTRL = (uint8_t)config->clockSource; -#endif /* FSL_FEATURE_EWM_HAS_CLOCK_SELECT*/ - - base->CMPL = config->compareLowValue; - base->CMPH = config->compareHighValue; - base->CTRL = value; -} - -/*! - * brief Deinitializes the EWM peripheral. - * - * This function is used to shut down the EWM. - * - * param base EWM peripheral base address - */ -void EWM_Deinit(EWM_Type *base) -{ - EWM_DisableInterrupts(base, (uint32_t)kEWM_InterruptEnable); -#if !((defined(FSL_FEATURE_SOC_PCC_COUNT) && FSL_FEATURE_SOC_PCC_COUNT) && \ - (defined(FSL_FEATURE_PCC_SUPPORT_EWM_CLOCK_REMOVE) && FSL_FEATURE_PCC_SUPPORT_EWM_CLOCK_REMOVE)) -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_DisableClock(kCLOCK_Ewm0); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* FSL_FEATURE_PCC_SUPPORT_EWM_CLOCK_REMOVE */ -} - -/*! - * brief Initializes the EWM configuration structure. - * - * This function initializes the EWM configuration structure to default values. The default - * values are as follows. - * code - * ewmConfig->enableEwm = true; - * ewmConfig->enableEwmInput = false; - * ewmConfig->setInputAssertLogic = false; - * ewmConfig->enableInterrupt = false; - * ewmConfig->ewm_lpo_clock_source_t = kEWM_LpoClockSource0; - * ewmConfig->prescaler = 0; - * ewmConfig->compareLowValue = 0; - * ewmConfig->compareHighValue = 0xFEU; - * endcode - * - * param config Pointer to the EWM configuration structure. - * see ewm_config_t - */ -void EWM_GetDefaultConfig(ewm_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->enableEwm = true; - config->enableEwmInput = false; - config->setInputAssertLogic = false; - config->enableInterrupt = false; -#if defined(FSL_FEATURE_EWM_HAS_CLOCK_SELECT) && FSL_FEATURE_EWM_HAS_CLOCK_SELECT - config->clockSource = kEWM_LpoClockSource0; -#endif /* FSL_FEATURE_EWM_HAS_CLOCK_SELECT*/ -#if defined(FSL_FEATURE_EWM_HAS_PRESCALER) && FSL_FEATURE_EWM_HAS_PRESCALER - config->prescaler = 0U; -#endif /* FSL_FEATURE_EWM_HAS_PRESCALER */ - config->compareLowValue = 0U; - config->compareHighValue = 0xFEU; -} - -/*! - * brief Services the EWM. - * - * This function resets the EWM counter to zero. - * - * param base EWM peripheral base address - */ -void EWM_Refresh(EWM_Type *base) -{ - uint32_t primaskValue = 0U; - - /* Disable the global interrupt to protect refresh sequence */ - primaskValue = DisableGlobalIRQ(); - base->SERV = (uint8_t)0xB4U; - base->SERV = (uint8_t)0x2CU; - EnableGlobalIRQ(primaskValue); -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_ewm.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_ewm.h deleted file mode 100644 index ee3face3f18..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_ewm.h +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2017, 2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_EWM_H_ -#define FSL_EWM_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup ewm - * @{ - */ - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief EWM driver version 2.0.3. */ -#define FSL_EWM_DRIVER_VERSION (MAKE_VERSION(2, 0, 3)) -/*@}*/ - -/*! @brief Describes EWM clock source. */ -#if defined(FSL_FEATURE_EWM_HAS_CLOCK_SELECT) && FSL_FEATURE_EWM_HAS_CLOCK_SELECT -typedef enum _ewm_lpo_clock_source -{ - kEWM_LpoClockSource0 = 0U, /*!< EWM clock sourced from lpo_clk[0]*/ - kEWM_LpoClockSource1 = 1U, /*!< EWM clock sourced from lpo_clk[1]*/ - kEWM_LpoClockSource2 = 2U, /*!< EWM clock sourced from lpo_clk[2]*/ - kEWM_LpoClockSource3 = 3U, /*!< EWM clock sourced from lpo_clk[3]*/ -} ewm_lpo_clock_source_t; -#endif /* FSL_FEATURE_EWM_HAS_CLOCK_SELECT */ - -/*! - * @brief Data structure for EWM configuration. - * - * This structure is used to configure the EWM. - */ -typedef struct _ewm_config -{ - bool enableEwm; /*!< Enable EWM module */ - bool enableEwmInput; /*!< Enable EWM_in input */ - bool setInputAssertLogic; /*!< EWM_in signal assertion state */ - bool enableInterrupt; /*!< Enable EWM interrupt */ -#if defined(FSL_FEATURE_EWM_HAS_CLOCK_SELECT) && FSL_FEATURE_EWM_HAS_CLOCK_SELECT - ewm_lpo_clock_source_t clockSource; /*!< Clock source select */ -#endif /* FSL_FEATURE_EWM_HAS_CLOCK_SELECT */ -#if defined(FSL_FEATURE_EWM_HAS_PRESCALER) && FSL_FEATURE_EWM_HAS_PRESCALER - uint8_t prescaler; /*!< Clock prescaler value */ -#endif /* FSL_FEATURE_EWM_HAS_PRESCALER */ - uint8_t compareLowValue; /*!< Compare low-register value */ - uint8_t compareHighValue; /*!< Compare high-register value */ -} ewm_config_t; - -/*! - * @brief EWM interrupt configuration structure with default settings all disabled. - * - * This structure contains the settings for all of EWM interrupt configurations. - */ -enum _ewm_interrupt_enable_t -{ - kEWM_InterruptEnable = EWM_CTRL_INTEN_MASK, /*!< Enable the EWM to generate an interrupt*/ -}; - -/*! - * @brief EWM status flags. - * - * This structure contains the constants for the EWM status flags for use in the EWM functions. - */ -enum _ewm_status_flags_t -{ - kEWM_RunningFlag = EWM_CTRL_EWMEN_MASK, /*!< Running flag, set when EWM is enabled*/ -}; - -/******************************************************************************* - * API - *******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name EWM initialization and de-initialization - * @{ - */ - -/*! - * @brief Initializes the EWM peripheral. - * - * This function is used to initialize the EWM. After calling, the EWM - * runs immediately according to the configuration. - * Note that, except for the interrupt enable control bit, other control bits and registers are write once after a - * CPU reset. Modifying them more than once generates a bus transfer error. - * - * This is an example. - * @code - * ewm_config_t config; - * EWM_GetDefaultConfig(&config); - * config.compareHighValue = 0xAAU; - * EWM_Init(ewm_base,&config); - * @endcode - * - * @param base EWM peripheral base address - * @param config The configuration of the EWM - */ -void EWM_Init(EWM_Type *base, const ewm_config_t *config); - -/*! - * @brief Deinitializes the EWM peripheral. - * - * This function is used to shut down the EWM. - * - * @param base EWM peripheral base address - */ -void EWM_Deinit(EWM_Type *base); - -/*! - * @brief Initializes the EWM configuration structure. - * - * This function initializes the EWM configuration structure to default values. The default - * values are as follows. - * @code - * ewmConfig->enableEwm = true; - * ewmConfig->enableEwmInput = false; - * ewmConfig->setInputAssertLogic = false; - * ewmConfig->enableInterrupt = false; - * ewmConfig->ewm_lpo_clock_source_t = kEWM_LpoClockSource0; - * ewmConfig->prescaler = 0; - * ewmConfig->compareLowValue = 0; - * ewmConfig->compareHighValue = 0xFEU; - * @endcode - * - * @param config Pointer to the EWM configuration structure. - * @see ewm_config_t - */ -void EWM_GetDefaultConfig(ewm_config_t *config); - -/* @} */ - -/*! - * @name EWM functional Operation - * @{ - */ - -/*! - * @brief Enables the EWM interrupt. - * - * This function enables the EWM interrupt. - * - * @param base EWM peripheral base address - * @param mask The interrupts to enable - * The parameter can be combination of the following source if defined - * @arg kEWM_InterruptEnable - */ -static inline void EWM_EnableInterrupts(EWM_Type *base, uint32_t mask) -{ - base->CTRL |= (uint8_t)mask; -} - -/*! - * @brief Disables the EWM interrupt. - * - * This function enables the EWM interrupt. - * - * @param base EWM peripheral base address - * @param mask The interrupts to disable - * The parameter can be combination of the following source if defined - * @arg kEWM_InterruptEnable - */ -static inline void EWM_DisableInterrupts(EWM_Type *base, uint32_t mask) -{ - base->CTRL &= (uint8_t)(~mask); -} - -/*! - * @brief Gets all status flags. - * - * This function gets all status flags. - * - * This is an example for getting the running flag. - * @code - * uint32_t status; - * status = EWM_GetStatusFlags(ewm_base) & kEWM_RunningFlag; - * @endcode - * @param base EWM peripheral base address - * @return State of the status flag: asserted (true) or not-asserted (false).@see _ewm_status_flags_t - * - True: a related status flag has been set. - * - False: a related status flag is not set. - */ -static inline uint32_t EWM_GetStatusFlags(EWM_Type *base) -{ - return ((uint32_t)base->CTRL & EWM_CTRL_EWMEN_MASK); -} - -/*! - * @brief Services the EWM. - * - * This function resets the EWM counter to zero. - * - * @param base EWM peripheral base address - */ -void EWM_Refresh(EWM_Type *base); - -/*@}*/ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @}*/ - -#endif /* FSL_EWM_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexcan.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexcan.c deleted file mode 100644 index c3a989f3f81..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexcan.c +++ /dev/null @@ -1,4895 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexcan.h" - -/* - * $Coverage Justification Reference$ - * - * $Justification flexcan_c_ref_1$ - * The FLEXCAN_ReadRxFifo() return fail only when Rx FIFO is diabled. But in IRQ handler, will first check whether the - * FIFO is enabled, and only call FLEXCAN_ReadRxFifo if the FIFO is enabled. So to cover this line/branch, need to - * interrupt the current execution by a high priority IRQ after confirming that the FIFO is enabled, and disabled the - * FIFO in the high priority interrupt. It is difficult to simulate this situation in unit test, so add Justification. - * - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexcan" -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_6032) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_6032) -#define RXINTERMISSION (CAN_DBG1_CFSM(0x2f)) -#define TXINTERMISSION (CAN_DBG1_CFSM(0x14)) -#define BUSIDLE (CAN_DBG1_CFSM(0x02)) -#define CBN_VALUE3 (CAN_DBG1_CBN(0x03)) -#define DELAY_BUSIDLE (200) -#endif - -/* According to CiA doc 1301 v1.0.0, specified data/nominal phase sample point postion for CAN FD at 80 MHz. */ -#define IDEAL_DATA_SP_1 (800U) -#define IDEAL_DATA_SP_2 (750U) -#define IDEAL_DATA_SP_3 (700U) -#define IDEAL_DATA_SP_4 (625U) -#define IDEAL_NOMINAL_SP (800U) - -/* According to CiA doc 301 v4.2.0 and previous version. */ -#define IDEAL_SP_LOW (750U) -#define IDEAL_SP_MID (800U) -#define IDEAL_SP_HIGH (875U) - -#define IDEAL_SP_FACTOR (1000U) - -/* Define the max value of bit timing segments when use different timing register. */ -#define MAX_PROPSEG (CAN_CTRL1_PROPSEG_MASK >> CAN_CTRL1_PROPSEG_SHIFT) -#define MAX_PSEG1 (CAN_CTRL1_PSEG1_MASK >> CAN_CTRL1_PSEG1_SHIFT) -#define MAX_PSEG2 (CAN_CTRL1_PSEG2_MASK >> CAN_CTRL1_PSEG2_SHIFT) -#define MAX_RJW (CAN_CTRL1_RJW_MASK >> CAN_CTRL1_RJW_SHIFT) -#define MAX_PRESDIV (CAN_CTRL1_PRESDIV_MASK >> CAN_CTRL1_PRESDIV_SHIFT) -#define CTRL1_MAX_TIME_QUANTA (1U + MAX_PROPSEG + 1U + MAX_PSEG1 + 1U + MAX_PSEG2 + 1U) -#define CTRL1_MIN_TIME_QUANTA (8U) - -#define MAX_EPROPSEG (CAN_CBT_EPROPSEG_MASK >> CAN_CBT_EPROPSEG_SHIFT) -#define MAX_EPSEG1 (CAN_CBT_EPSEG1_MASK >> CAN_CBT_EPSEG1_SHIFT) -#define MAX_EPSEG2 (CAN_CBT_EPSEG2_MASK >> CAN_CBT_EPSEG2_SHIFT) -#define MAX_ERJW (CAN_CBT_ERJW_MASK >> CAN_CBT_ERJW_SHIFT) -#define MAX_EPRESDIV (CAN_CBT_EPRESDIV_MASK >> CAN_CBT_EPRESDIV_SHIFT) -#define CBT_MAX_TIME_QUANTA (1U + MAX_EPROPSEG + 1U + MAX_EPSEG1 + 1U + MAX_EPSEG2 + 1U) -#define CBT_MIN_TIME_QUANTA (8U) - -#define MAX_FPROPSEG (CAN_FDCBT_FPROPSEG_MASK >> CAN_FDCBT_FPROPSEG_SHIFT) -#define MAX_FPSEG1 (CAN_FDCBT_FPSEG1_MASK >> CAN_FDCBT_FPSEG1_SHIFT) -#define MAX_FPSEG2 (CAN_FDCBT_FPSEG2_MASK >> CAN_FDCBT_FPSEG2_SHIFT) -#define MAX_FRJW (CAN_FDCBT_FRJW_MASK >> CAN_FDCBT_FRJW_SHIFT) -#define MAX_FPRESDIV (CAN_FDCBT_FPRESDIV_MASK >> CAN_FDCBT_FPRESDIV_SHIFT) -#define FDCBT_MAX_TIME_QUANTA (1U + MAX_FPROPSEG + 0U + MAX_FPSEG1 + 1U + MAX_FPSEG2 + 1U) -#define FDCBT_MIN_TIME_QUANTA (5U) - -#define MAX_TDCOFF ((uint32_t)CAN_FDCTRL_TDCOFF_MASK >> CAN_FDCTRL_TDCOFF_SHIFT) - -#define MAX_NTSEG1 (CAN_ENCBT_NTSEG1_MASK >> CAN_ENCBT_NTSEG1_SHIFT) -#define MAX_NTSEG2 (CAN_ENCBT_NTSEG2_MASK >> CAN_ENCBT_NTSEG2_SHIFT) -#define MAX_NRJW (CAN_ENCBT_NRJW_MASK >> CAN_ENCBT_NRJW_SHIFT) -#define MAX_ENPRESDIV (CAN_EPRS_ENPRESDIV_MASK >> CAN_EPRS_ENPRESDIV_SHIFT) -#define ENCBT_MAX_TIME_QUANTA (1U + MAX_NTSEG1 + 1U + MAX_NTSEG2 + 1U) -#define ENCBT_MIN_TIME_QUANTA (8U) - -#define MAX_DTSEG1 (CAN_EDCBT_DTSEG1_MASK >> CAN_EDCBT_DTSEG1_SHIFT) -#define MAX_DTSEG2 (CAN_EDCBT_DTSEG2_MASK >> CAN_EDCBT_DTSEG2_SHIFT) -#define MAX_DRJW (CAN_EDCBT_DRJW_MASK >> CAN_EDCBT_DRJW_SHIFT) -#define MAX_EDPRESDIV (CAN_EPRS_EDPRESDIV_MASK >> CAN_EPRS_EDPRESDIV_SHIFT) -#define EDCBT_MAX_TIME_QUANTA (1U + MAX_DTSEG1 + 1U + MAX_DTSEG2 + 1U) -#define EDCBT_MIN_TIME_QUANTA (5U) - -#define MAX_ETDCOFF ((uint32_t)CAN_ETDC_ETDCOFF_MASK >> CAN_ETDC_ETDCOFF_SHIFT) - -/* TSEG1 corresponds to the sum of xPROPSEG and xPSEG1, TSEG2 corresponds to the xPSEG2 value. */ -#define MIN_TIME_SEGMENT1 (2U) -#define MIN_TIME_SEGMENT2 (2U) - -/* Define maximum CAN and CAN FD bit rate supported by FLEXCAN. */ -#if (defined(FSL_FEATURE_FLEXCAN_MAX_CANFD_BITRATE)) -#define MAX_CANFD_BITRATE ((uint32_t)(FSL_FEATURE_FLEXCAN_MAX_CANFD_BITRATE)) -#else -#define MAX_CANFD_BITRATE (8000000U) -#endif -#define MAX_CAN_BITRATE (1000000U) - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_9595) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_9595) -#define CAN_ESR1_FLTCONF_BUSOFF CAN_ESR1_FLTCONF(2U) -#endif - -/* Define the range of memory that needs to be initialized when the device has memory error detection feature. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -#define CAN_INIT_RXFIR ((uintptr_t)base + 0x4Cu) -#define CAN_INIT_MEMORY_BASE_1 (uint32_t *)((uintptr_t)base + (uintptr_t)FSL_FEATURE_FLEXCAN_INIT_MEMORY_BASE_1) -#define CAN_INIT_MEMORY_SIZE_1 FSL_FEATURE_FLEXCAN_INIT_MEMORY_SIZE_1 -#define CAN_INIT_MEMORY_BASE_2 (uint32_t *)((uintptr_t)base + (uintptr_t)FSL_FEATURE_FLEXCAN_INIT_MEMORY_BASE_2) -#define CAN_INIT_MEMORY_SIZE_2 FSL_FEATURE_FLEXCAN_INIT_MEMORY_SIZE_2 -#endif - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#ifndef CAN_CLOCK_CHECK_NO_AFFECTS -/* If no define such MACRO, it mean that the CAN in current device have no clock affect issue. */ -#define CAN_CLOCK_CHECK_NO_AFFECTS (true) -#endif /* CAN_CLOCK_CHECK_NO_AFFECTS */ -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(FLEXCAN_RSTS) -#define FLEXCAN_RESETS_ARRAY FLEXCAN_RSTS -#elif defined(FLEXCAN_RSTS_N) -#define FLEXCAN_RESETS_ARRAY FLEXCAN_RSTS_N -#endif - -/*! @brief FlexCAN Internal State. */ -enum _flexcan_state -{ - kFLEXCAN_StateIdle = 0x0, /*!< MB/RxFIFO idle.*/ - kFLEXCAN_StateRxData = 0x1, /*!< MB receiving.*/ - kFLEXCAN_StateRxRemote = 0x2, /*!< MB receiving remote reply.*/ - kFLEXCAN_StateTxData = 0x3, /*!< MB transmitting.*/ - kFLEXCAN_StateTxRemote = 0x4, /*!< MB transmitting remote request.*/ - kFLEXCAN_StateRxFifo = 0x5, /*!< RxFIFO receiving.*/ -}; - -/*! @brief FlexCAN message buffer CODE for Rx buffers. */ -enum _flexcan_mb_code_rx -{ - kFLEXCAN_RxMbInactive = 0x0, /*!< MB is not active.*/ - kFLEXCAN_RxMbFull = 0x2, /*!< MB is full.*/ - kFLEXCAN_RxMbEmpty = 0x4, /*!< MB is active and empty.*/ - kFLEXCAN_RxMbOverrun = 0x6, /*!< MB is overwritten into a full buffer.*/ - kFLEXCAN_RxMbBusy = 0x8, /*!< FlexCAN is updating the contents of the MB, The CPU must not access the MB.*/ - kFLEXCAN_RxMbRanswer = 0xA, /*!< A frame was configured to recognize a Remote Request Frame and transmit a - Response Frame in return.*/ - kFLEXCAN_RxMbNotUsed = 0xF, /*!< Not used.*/ -}; - -/*! @brief FlexCAN message buffer CODE FOR Tx buffers. */ -enum _flexcan_mb_code_tx -{ - kFLEXCAN_TxMbInactive = 0x8, /*!< MB is not active.*/ - kFLEXCAN_TxMbAbort = 0x9, /*!< MB is aborted.*/ - kFLEXCAN_TxMbDataOrRemote = 0xC, /*!< MB is a TX Data Frame(when MB RTR = 0) or MB is a TX Remote Request - Frame (when MB RTR = 1).*/ - kFLEXCAN_TxMbTanswer = 0xE, /*!< MB is a TX Response Request Frame from an incoming Remote Request Frame.*/ - kFLEXCAN_TxMbNotUsed = 0xF, /*!< Not used.*/ -}; - -/* Typedef for interrupt handler. */ -typedef void (*flexcan_isr_t)(CAN_Type *base, flexcan_handle_t *handle); - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -#if !defined(NDEBUG) -/*! - * @brief Check if Message Buffer is occupied by Rx FIFO. - * - * This function check if Message Buffer is occupied by Rx FIFO. - * - * @param base FlexCAN peripheral base address. - * @param mbIdx The FlexCAN Message Buffer index. - * @return TRUE if the index MB is occupied by Rx FIFO, FALSE if the index MB not occupied by Rx FIFO. - */ -static bool FLEXCAN_IsMbOccupied(CAN_Type *base, uint8_t mbIdx); -#endif - -#if ((defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829)) -/*! - * @brief Get the first valid Message buffer ID of give FlexCAN instance. - * - * This function is a helper function for Errata 5641 workaround. - * - * @param base FlexCAN peripheral base address. - * @return The first valid Message Buffer Number. - */ -static uint8_t FLEXCAN_GetFirstValidMb(CAN_Type *base); -#endif - -/*! - * @brief Reset the FlexCAN Instance. - * - * Restores the FlexCAN module to reset state, notice that this function - * will set all the registers to reset state so the FlexCAN module can not work - * after calling this API. - * - * @param base FlexCAN peripheral base address. - */ -static void FLEXCAN_Reset(CAN_Type *base); - -/*! - * @brief Calculates the segment values for a single bit time for classical CAN. - * - * This function use to calculates the Classical CAN segment values which will be set in CTRL1/CBT/ENCBT register. - * - * @param base FlexCAN peripheral base address. - * @param tqNum Number of time quantas per bit, range in 8 ~ 25 when use CTRL1, range in 8 ~ 129 when use CBT, range in - * 8 ~ 385 when use ENCBT. param pTimingConfig Pointer to the FlexCAN timing configuration structure. - */ -static void FLEXCAN_GetSegments(CAN_Type *base, - uint32_t bitRate, - uint32_t tqNum, - flexcan_timing_config_t *pTimingConfig); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * @brief Get Mailbox offset number by dword. - * - * This function gets the offset number of the specified mailbox. - * Mailbox is not consecutive between memory regions when payload is not 8 bytes - * so need to calculate the specified mailbox address. - * For example, in the first memory region, MB[0].CS address is 0x4002_4080. For 32 bytes - * payload frame, the second mailbox is ((1/12)*512 + 1%12*40)/4 = 10, meaning 10 dword - * after the 0x4002_4080, which is actually the address of mailbox MB[1].CS. - * - * @param base FlexCAN peripheral base address. - * @param mbIdx Mailbox index. - */ -static uint32_t FLEXCAN_GetFDMailboxOffset(CAN_Type *base, uint8_t mbIdx); - -/*! - * @brief Calculates the segment values for a single bit time for CAN FD data phase. - * - * This function use to calculates the CAN FD data phase segment values which will be set in CFDCBT/EDCBT - * register. - * - * @param bitRateFD Data phase bit rate - * @param tqNum Number of time quanta per bit - * @param pTimingConfig Pointer to the FlexCAN timing configuration structure. - */ -static void FLEXCAN_FDGetSegments(uint32_t bitRateFD, uint32_t tqNum, flexcan_timing_config_t *pTimingConfig); - -/*! - * @brief Calculates the improved timing values by specific bit rate for CAN FD nominal phase. - * - * This function use to calculates the CAN FD nominal phase timing values according to the given nominal phase bit rate. - * The Calculated timing values will be set in CBT/ENCBT registers. The calculation is based on the recommendation of - * the CiA 1301 v1.0.0 document. - * - * @param bitRate The CAN FD nominal phase speed in bps defined by user, should be less than or equal to 1Mbps. - * @param sourceClock_Hz The Source clock frequency in Hz. - * @param pTimingConfig Pointer to the FlexCAN timing configuration structure. - * - * @return TRUE if timing configuration found, FALSE if failed to find configuration. - */ -static bool FLEXCAN_CalculateImprovedNominalTimingValues(uint32_t bitRate, - uint32_t sourceClock_Hz, - flexcan_timing_config_t *pTimingConfig); - -#endif - -/*! - * @brief Check unhandle interrupt events - * - * @param base FlexCAN peripheral base address. - * @return TRUE if unhandled interrupt action exist, FALSE if no unhandlered interrupt action exist. - */ -static bool FLEXCAN_CheckUnhandleInterruptEvents(CAN_Type *base); - -/*! - * @brief Sub Handler Data Trasfered Events - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param pResult Pointer to the Handle result. - * - * @return the status after handle each data transfered event. - */ -static status_t FLEXCAN_SubHandlerForDataTransfered(CAN_Type *base, flexcan_handle_t *handle, uint32_t *pResult); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * @brief Sub Handler Ehanced Rx FIFO event - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param flags FlexCAN interrupt flags. - * - * @return the status after handle Ehanced Rx FIFO event. - */ -static status_t FLEXCAN_SubHandlerForEhancedRxFifo(CAN_Type *base, flexcan_handle_t *handle, uint64_t flags); -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/* Array of FlexCAN peripheral base address. */ -static CAN_Type *const s_flexcanBases[] = CAN_BASE_PTRS; - -/* Array of FlexCAN IRQ number. */ -static const IRQn_Type s_flexcanRxWarningIRQ[] = CAN_Rx_Warning_IRQS; -static const IRQn_Type s_flexcanTxWarningIRQ[] = CAN_Tx_Warning_IRQS; -static const IRQn_Type s_flexcanWakeUpIRQ[] = CAN_Wake_Up_IRQS; -static const IRQn_Type s_flexcanErrorIRQ[] = CAN_Error_IRQS; -static const IRQn_Type s_flexcanBusOffIRQ[] = CAN_Bus_Off_IRQS; -static const IRQn_Type s_flexcanMbIRQ[] = CAN_ORed_Message_buffer_IRQS; - -/* Array of FlexCAN handle. */ -static flexcan_handle_t *s_flexcanHandle[ARRAY_SIZE(s_flexcanBases)]; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/* Array of FlexCAN clock name. */ -static const clock_ip_name_t s_flexcanClock[] = FLEXCAN_CLOCKS; -#if defined(FLEXCAN_PERIPH_CLOCKS) -/* Array of FlexCAN serial clock name. */ -static const clock_ip_name_t s_flexcanPeriphClock[] = FLEXCAN_PERIPH_CLOCKS; -#endif /* FLEXCAN_PERIPH_CLOCKS */ -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(FLEXCAN_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_flexcanResets[] = FLEXCAN_RESETS_ARRAY; -#endif - -/* FlexCAN ISR for transactional APIs. */ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -static flexcan_isr_t s_flexcanIsr = (flexcan_isr_t)DefaultISR; -#else -static flexcan_isr_t s_flexcanIsr; -#endif - -/******************************************************************************* - * Implementation of 32-bit memset - ******************************************************************************/ - -static void flexcan_memset(void *s, uint32_t c, size_t n) -{ - size_t m; - uint32_t *ptr = s; - - m = n / sizeof(*ptr); - - while ((m--) != (size_t)0) - { - *ptr++ = c; - } -} - -/******************************************************************************* - * Code - ******************************************************************************/ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * brief Determine whether the FlexCAN instance support CAN FD mode at run time. - * - * note Use this API only if different soc parts share the SOC part name macro define. Otherwise, a different SOC part - * name can be used to determine at compile time whether the FlexCAN instance supports CAN FD mode or not. - * If need use this API to determine if CAN FD mode is supported, the FLEXCAN_Init function needs to be - * executed first, and then call this API and use the return to value determines whether to supports CAN FD mode, - * if return true, continue calling FLEXCAN_FDInit to enable CAN FD mode. - * - * param base FlexCAN peripheral base address. - * return return TRUE if instance support CAN FD mode, FALSE if instance only support classic CAN (2.0) mode. - */ -bool FLEXCAN_IsInstanceHasFDMode(CAN_Type *base) -{ - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - /* Enable CAN FD operation. */ - base->MCR |= CAN_MCR_FDEN_MASK; - - /* There are some SoC parts that don't support CAN FD. - * Checking if FDEN bit is really set to 1 is a way to ensure that CAN FD is supported. - * When SoC parts don't support CAN FD, FDEN bit stuck at 0 and can't be set to 1. */ - if (0U == (base->MCR & CAN_MCR_FDEN_MASK)) - { - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); - return false; - } - else - { - /* Clear CAN FD operation. */ - base->MCR &= ~CAN_MCR_FDEN_MASK; - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); - return true; - } -} -#endif - -/*! - * brief Get the FlexCAN instance from peripheral base address. - * - * param base FlexCAN peripheral base address. - * return FlexCAN instance. - */ -uint32_t FLEXCAN_GetInstance(CAN_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_flexcanBases); instance++) - { - if (s_flexcanBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_flexcanBases)); - - return instance; -} - -/*! - * brief Enter FlexCAN Freeze Mode. - * - * This function makes the FlexCAN work under Freeze Mode. - * - * param base FlexCAN peripheral base address. - */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_9595) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_9595) -void FLEXCAN_EnterFreezeMode(CAN_Type *base) -{ - uint32_t u32TimeoutCount = 0U; - uint32_t u32TempMCR = 0U; - uint32_t u32TempIMASK1 = 0U; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - uint32_t u32TempIMASK2 = 0U; -#endif - - /* Step1: set FRZ enable in MCR. */ - base->MCR |= CAN_MCR_FRZ_MASK; - - /* Step2: to check if MDIS bit set in MCR. if yes, clear it. */ - if (0U != (base->MCR & CAN_MCR_MDIS_MASK)) - { - base->MCR &= ~CAN_MCR_MDIS_MASK; - } - - /* Step3: polling LPMACK. */ - u32TimeoutCount = (uint32_t)FLEXCAN_WAIT_TIMEOUT; - while ((0U == (base->MCR & CAN_MCR_LPMACK_MASK)) && (u32TimeoutCount > 0U)) - { - u32TimeoutCount--; - } - - /* Step4: to check FLTCONF in ESR1 register */ - if (0U == (base->ESR1 & CAN_ESR1_FLTCONF_BUSOFF)) - { - /* Step5B: Set Halt bits. */ - base->MCR |= CAN_MCR_HALT_MASK; - - /* Step6B: Poll the MCR register until the Freeze Acknowledge (FRZACK) bit is set, timeout need more than 178 - * CAN bit length, so 20 multiply timeout is enough. */ - u32TimeoutCount = (uint32_t)FLEXCAN_WAIT_TIMEOUT * 20U; - while ((0U == (base->MCR & CAN_MCR_FRZACK_MASK)) && (u32TimeoutCount > 0U)) - { - u32TimeoutCount--; - } - } - else - { - /* backup MCR and IMASK register. Errata document not descript it, but we need backup for step 8A and 9A. */ - u32TempMCR = base->MCR; - u32TempIMASK1 = base->IMASK1; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - u32TempIMASK2 = base->IMASK2; -#endif - - /* Step5A: Set the Soft Reset bit ((SOFTRST) in the MCR.*/ - base->MCR |= CAN_MCR_SOFTRST_MASK; - - /* Step6A: Poll the MCR register until the Soft Reset (SOFTRST) bit is cleared. */ - u32TimeoutCount = (uint32_t)FLEXCAN_WAIT_TIMEOUT; - while ((CAN_MCR_SOFTRST_MASK == (base->MCR & CAN_MCR_SOFTRST_MASK)) && (u32TimeoutCount > 0U)) - { - u32TimeoutCount--; - } - - /* Step7A: Poll the MCR register until the Freeze Acknowledge (FRZACK) bit is set. */ - u32TimeoutCount = (uint32_t)FLEXCAN_WAIT_TIMEOUT; - while ((0U == (base->MCR & CAN_MCR_FRZACK_MASK)) && (u32TimeoutCount > 0U)) - { - u32TimeoutCount--; - } - - /* Step8A: reconfig MCR. */ - base->MCR = u32TempMCR; - - /* Step9A: reconfig IMASK. */ - base->IMASK1 = u32TempIMASK1; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - base->IMASK2 = u32TempIMASK2; -#endif - } -} -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_8341) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_8341) -void FLEXCAN_EnterFreezeMode(CAN_Type *base) -{ - uint32_t u32TimeoutCount = 0U; - uint32_t u32TempMCR = 0U; - uint32_t u32TempIMASK1 = 0U; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - uint32_t u32TempIMASK2 = 0U; -#endif - - /* Step1: set FRZ and HALT bit enable in MCR. */ - base->MCR |= CAN_MCR_FRZ_MASK; - base->MCR |= CAN_MCR_HALT_MASK; - - /* Step2: to check if MDIS bit set in MCR. if yes, clear it. */ - if (0U != (base->MCR & CAN_MCR_MDIS_MASK)) - { - base->MCR &= ~CAN_MCR_MDIS_MASK; - } - - /* Step3: Poll the MCR register until the Freeze Acknowledge (FRZACK) bit is set. */ - u32TimeoutCount = (uint32_t)FLEXCAN_WAIT_TIMEOUT * 100U; - while ((0U == (base->MCR & CAN_MCR_FRZACK_MASK)) && (u32TimeoutCount > 0U)) - { - u32TimeoutCount--; - } - - /* Step4: check whether the timeout reached. if no skip step5 to step8. */ - if (0U == u32TimeoutCount) - { - /* backup MCR and IMASK register. Errata document not descript it, but we need backup for step 8A and 9A. */ - u32TempMCR = base->MCR; - u32TempIMASK1 = base->IMASK1; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - u32TempIMASK2 = base->IMASK2; -#endif - /* Step5: Set the Soft Reset bit ((SOFTRST) in the MCR.*/ - base->MCR |= CAN_MCR_SOFTRST_MASK; - - /* Step6: Poll the MCR register until the Soft Reset (SOFTRST) bit is cleared. */ - while (CAN_MCR_SOFTRST_MASK == (base->MCR & CAN_MCR_SOFTRST_MASK)) - { - } - - /* Step7: reconfig MCR. */ - base->MCR = u32TempMCR; - - /* Step8: reconfig IMASK. */ - base->IMASK1 = u32TempIMASK1; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - base->IMASK2 = u32TempIMASK2; -#endif - } -} -#else -void FLEXCAN_EnterFreezeMode(CAN_Type *base) -{ - /* Set Freeze, Halt bits. */ - base->MCR |= CAN_MCR_FRZ_MASK; - base->MCR |= CAN_MCR_HALT_MASK; - while (0U == (base->MCR & CAN_MCR_FRZACK_MASK)) - { - } -} -#endif - -/*! - * brief Exit FlexCAN Freeze Mode. - * - * This function makes the FlexCAN leave Freeze Mode. - * - * param base FlexCAN peripheral base address. - */ -void FLEXCAN_ExitFreezeMode(CAN_Type *base) -{ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - /* Clean FlexCAN Access With Non-Correctable Error Interrupt Flag to avoid be put in freeze mode. */ - FLEXCAN_ClearStatusFlags(base, (uint64_t)kFLEXCAN_FlexCanAccessNonCorrectableErrorIntFlag | - (uint64_t)kFLEXCAN_FlexCanAccessNonCorrectableErrorOverrunFlag); -#endif - - /* Clear Freeze, Halt bits. */ - base->MCR &= ~CAN_MCR_HALT_MASK; - base->MCR &= ~CAN_MCR_FRZ_MASK; - - /* Wait until the FlexCAN Module exit freeze mode. */ - while (0U != (base->MCR & CAN_MCR_FRZACK_MASK)) - { - } -} - -#if !defined(NDEBUG) -/*! - * brief Check if Message Buffer is occupied by Rx FIFO. - * - * This function check if Message Buffer is occupied by Rx FIFO. - * - * param base FlexCAN peripheral base address. - * param mbIdx The FlexCAN Message Buffer index. - * return TRUE if the index MB is occupied by Rx FIFO, FALSE if the index MB not occupied by Rx FIFO. - */ -static bool FLEXCAN_IsMbOccupied(CAN_Type *base, uint8_t mbIdx) -{ - uint8_t lastOccupiedMb; - bool fgRet; - - /* Is Rx FIFO enabled? */ - if (0U != (base->MCR & CAN_MCR_RFEN_MASK)) - { - /* Get RFFN value. */ - lastOccupiedMb = (uint8_t)((base->CTRL2 & CAN_CTRL2_RFFN_MASK) >> CAN_CTRL2_RFFN_SHIFT); - /* Calculate the number of last Message Buffer occupied by Rx FIFO. */ - lastOccupiedMb = ((lastOccupiedMb + 1U) * 2U) + 5U; - -#if ((defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829)) - /* the first valid MB should be occupied by ERRATA 5461 or 5829. */ - lastOccupiedMb += 1U; -#endif - fgRet = (mbIdx <= lastOccupiedMb); - } - else - { -#if ((defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829)) - if (0U == mbIdx) - { - fgRet = true; - } - else -#endif - { - fgRet = false; - } - } - - return fgRet; -} -#endif - -#if ((defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829)) -/*! - * brief Get the first valid Message buffer ID of give FlexCAN instance. - * - * This function is a helper function for Errata 5641 workaround. - * - * param base FlexCAN peripheral base address. - * return The first valid Message Buffer Number. - */ -static uint8_t FLEXCAN_GetFirstValidMb(CAN_Type *base) -{ - uint8_t firstValidMbNum; - - if (0U != (base->MCR & CAN_MCR_RFEN_MASK)) - { - firstValidMbNum = (uint8_t)((base->CTRL2 & CAN_CTRL2_RFFN_MASK) >> CAN_CTRL2_RFFN_SHIFT); - firstValidMbNum = ((firstValidMbNum + 1U) * 2U) + 6U; - } - else - { - firstValidMbNum = 0U; - } - - return firstValidMbNum; -} -#endif - -/*! - * brief Reset the FlexCAN Instance. - * - * Restores the FlexCAN module to reset state, notice that this function - * will set all the registers to reset state so the FlexCAN module can not work - * after calling this API. - * - * param base FlexCAN peripheral base address. - */ -static void FLEXCAN_Reset(CAN_Type *base) -{ - /* The module must should be first exit from low power - * mode, and then soft reset can be applied. - */ - assert(0U == (base->MCR & CAN_MCR_MDIS_MASK)); - - uint8_t i; - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_DOZE_MODE_SUPPORT) && FSL_FEATURE_FLEXCAN_HAS_DOZE_MODE_SUPPORT) - if (0 != (FSL_FEATURE_FLEXCAN_INSTANCE_HAS_DOZE_MODE_SUPPORTn(base))) - { - /* De-assert DOZE Enable Bit. */ - base->MCR &= ~CAN_MCR_DOZE_MASK; - } -#endif - - /* Wait until FlexCAN exit from any Low Power Mode. */ - while (0U != (base->MCR & CAN_MCR_LPMACK_MASK)) - { - } - - /* Assert Soft Reset Signal. */ - base->MCR |= CAN_MCR_SOFTRST_MASK; - /* Wait until FlexCAN reset completes. */ - while (0U != (base->MCR & CAN_MCR_SOFTRST_MASK)) - { - } - -/* Reset MCR register. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_GLITCH_FILTER) && FSL_FEATURE_FLEXCAN_HAS_GLITCH_FILTER) - base->MCR |= CAN_MCR_WRNEN_MASK | CAN_MCR_WAKSRC_MASK | - CAN_MCR_MAXMB((uint32_t)FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(base) - 1U); -#else - base->MCR |= - CAN_MCR_WRNEN_MASK | CAN_MCR_MAXMB((uint32_t)FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(base) - 1U); -#endif - - /* Reset CTRL1 and CTRL2 register, default to eanble SMP feature which enable three sample point to determine the - * received bit's value of the. */ - base->CTRL1 = CAN_CTRL1_SMP_MASK; - base->CTRL2 = CAN_CTRL2_TASD(0x16) | CAN_CTRL2_RRS_MASK | CAN_CTRL2_EACEN_MASK; - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - /* Enable unrestricted write access to FlexCAN memory. */ - base->CTRL2 |= CAN_CTRL2_WRMFRZ_MASK; - /* Do memory initialization for all FlexCAN RAM in order to have the parity bits in memory properly - updated. */ - *(volatile uint32_t *)CAN_INIT_RXFIR = 0x0U; - flexcan_memset(CAN_INIT_MEMORY_BASE_1, 0, CAN_INIT_MEMORY_SIZE_1); - flexcan_memset(CAN_INIT_MEMORY_BASE_2, 0, CAN_INIT_MEMORY_SIZE_2); - /* Disable unrestricted write access to FlexCAN memory. */ - base->CTRL2 &= ~CAN_CTRL2_WRMFRZ_MASK; - - /* Clean all memory error flags. */ - FLEXCAN_ClearStatusFlags(base, (uint64_t)kFLEXCAN_AllMemoryErrorFlag); -#else - /* Only need clean all Message Buffer memory. */ - flexcan_memset((void *)&base->MB[0], 0, sizeof(base->MB)); -#endif - - /* Clean all individual Rx Mask of Message Buffers. */ - for (i = 0; i < (uint32_t)FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(base); i++) - { - base->RXIMR[i] = 0x3FFFFFFF; - } - - /* Clean Global Mask of Message Buffers. */ - base->RXMGMASK = 0x3FFFFFFF; - /* Clean Global Mask of Message Buffer 14. */ - base->RX14MASK = 0x3FFFFFFF; - /* Clean Global Mask of Message Buffer 15. */ - base->RX15MASK = 0x3FFFFFFF; - /* Clean Global Mask of Rx FIFO. */ - base->RXFGMASK = 0x3FFFFFFF; -} - -/*! - * brief Set bit rate of FlexCAN classical CAN frame or CAN FD frame nominal phase. - * - * This function set the bit rate of classical CAN frame or CAN FD frame nominal phase base on - * FLEXCAN_CalculateImprovedTimingValues() API calculated timing values. - * - * note Calling FLEXCAN_SetBitRate() overrides the bit rate set in FLEXCAN_Init(). - * - * param base FlexCAN peripheral base address. - * param sourceClock_Hz Source Clock in Hz. - * param bitRate_Bps Bit rate in Bps. - * return kStatus_Success - Set CAN baud rate (only Nominal phase) successfully. - */ -status_t FLEXCAN_SetBitRate(CAN_Type *base, uint32_t sourceClock_Hz, uint32_t bitRate_Bps) -{ - flexcan_timing_config_t timingCfg; - status_t result = kStatus_Fail; - - if (FLEXCAN_CalculateImprovedTimingValues(base, bitRate_Bps, sourceClock_Hz, &timingCfg)) - { - FLEXCAN_SetTimingConfig(base, &timingCfg); - result = kStatus_Success; - } - - return result; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * @brief Set bit rate of FlexCAN FD frame. - * - * This function set the baud rate of FLEXCAN FD base on FLEXCAN_FDCalculateImprovedTimingValues() API calculated timing - * values. - * - * @param base FlexCAN peripheral base address. - * @param sourceClock_Hz Source Clock in Hz. - * @param bitRateN_Bps Nominal bit Rate in Bps. - * @param bitRateD_Bps Data bit Rate in Bps. - * @return kStatus_Success - Set CAN FD bit rate (include Nominal and Data phase) successfully. - */ -status_t FLEXCAN_SetFDBitRate(CAN_Type *base, uint32_t sourceClock_Hz, uint32_t bitRateN_Bps, uint32_t bitRateD_Bps) -{ - flexcan_timing_config_t timingCfg; - status_t result = kStatus_Fail; - - if (FLEXCAN_FDCalculateImprovedTimingValues(base, bitRateN_Bps, bitRateD_Bps, sourceClock_Hz, &timingCfg)) - { - FLEXCAN_SetFDTimingConfig(base, &timingCfg); - result = kStatus_Success; - } - - return result; -} -#endif - -/*! - * brief Initializes a FlexCAN instance. - * - * This function initializes the FlexCAN module with user-defined settings. - * This example shows how to set up the flexcan_config_t parameters and how - * to call the FLEXCAN_Init function by passing in these parameters. - * code - * flexcan_config_t flexcanConfig; - * flexcanConfig.clkSrc = kFLEXCAN_ClkSrc0; - * flexcanConfig.bitRate = 1000000U; - * flexcanConfig.maxMbNum = 16; - * flexcanConfig.enableLoopBack = false; - * flexcanConfig.enableSelfWakeup = false; - * flexcanConfig.enableIndividMask = false; - * flexcanConfig.disableSelfReception = false; - * flexcanConfig.enableListenOnlyMode = false; - * flexcanConfig.enableDoze = false; - * flexcanConfig.timingConfig = timingConfig; - * FLEXCAN_Init(CAN0, &flexcanConfig, 40000000UL); - * endcode - * - * param base FlexCAN peripheral base address. - * param pConfig Pointer to the user-defined configuration structure. - * param sourceClock_Hz FlexCAN Protocol Engine clock source frequency in Hz. - */ -void FLEXCAN_Init(CAN_Type *base, const flexcan_config_t *pConfig, uint32_t sourceClock_Hz) -{ - /* Assertion. */ - assert(NULL != pConfig); - assert((pConfig->maxMbNum > 0U) && - (pConfig->maxMbNum <= (uint8_t)FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(base))); - - uint32_t mcrTemp; - uint32_t ctrl1Temp; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - uint32_t instance; -#endif - flexcan_timing_config_t timingCfg = pConfig->timingConfig; - /* FlexCAN classical CAN frame or CAN FD frame nominal phase timing setting formula: - * quantum = 1 + (phaseSeg1 + 1) + (phaseSeg2 + 1) + (propSeg + 1); - */ - uint32_t quantum = (1U + ((uint32_t)timingCfg.phaseSeg1 + 1U) + ((uint32_t)timingCfg.phaseSeg2 + 1U) + - ((uint32_t)timingCfg.propSeg + 1U)); - uint32_t tqFre = pConfig->bitRate * quantum; - uint16_t maxDivider; - - /* Assertion: Check bit rate value. */ - assert((pConfig->bitRate != 0U) && (pConfig->bitRate <= 1000000U) && (tqFre <= sourceClock_Hz)); -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0 != FSL_FEATURE_FLEXCAN_INSTANCE_HAS_FLEXIBLE_DATA_RATEn(base)) - { -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - assert((tqFre * MAX_ENPRESDIV) >= sourceClock_Hz); - maxDivider = MAX_ENPRESDIV; -#else - assert((tqFre * MAX_EPRESDIV) >= sourceClock_Hz); - maxDivider = MAX_EPRESDIV; -#endif - } - else - { - assert((tqFre * MAX_PRESDIV) >= sourceClock_Hz); - maxDivider = MAX_PRESDIV; - } -#else - assert((tqFre * MAX_PRESDIV) >= sourceClock_Hz); - maxDivider = MAX_PRESDIV; -#endif - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - instance = FLEXCAN_GetInstance(base); - /* Enable FlexCAN clock. */ - (void)CLOCK_EnableClock(s_flexcanClock[instance]); - /* - * Check the CAN clock in this device whether affected by Other clock gate - * If it affected, we'd better to change other clock source, - * If user insist on using that clock source, user need open these gate at same time, - * In this scene, User need to care the power consumption. - */ - assert(CAN_CLOCK_CHECK_NO_AFFECTS); -#if defined(FLEXCAN_PERIPH_CLOCKS) - /* Enable FlexCAN serial clock. */ - (void)CLOCK_EnableClock(s_flexcanPeriphClock[instance]); -#endif /* FLEXCAN_PERIPH_CLOCKS */ -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(FLEXCAN_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_flexcanResets[FLEXCAN_GetInstance(base)]); -#endif - -#if defined(CAN_CTRL1_CLKSRC_MASK) -#if (defined(FSL_FEATURE_FLEXCAN_SUPPORT_ENGINE_CLK_SEL_REMOVE) && FSL_FEATURE_FLEXCAN_SUPPORT_ENGINE_CLK_SEL_REMOVE) - if (0 == FSL_FEATURE_FLEXCAN_INSTANCE_SUPPORT_ENGINE_CLK_SEL_REMOVEn(base)) -#endif /* FSL_FEATURE_FLEXCAN_SUPPORT_ENGINE_CLK_SEL_REMOVE */ - { - /* Disable FlexCAN Module. */ - FLEXCAN_Enable(base, false); - - /* Protocol-Engine clock source selection, This bit must be set - * when FlexCAN Module in Disable Mode. - */ - base->CTRL1 = (kFLEXCAN_ClkSrc0 == pConfig->clkSrc) ? (base->CTRL1 & ~CAN_CTRL1_CLKSRC_MASK) : - (base->CTRL1 | CAN_CTRL1_CLKSRC_MASK); - } -#endif /* CAN_CTRL1_CLKSRC_MASK */ - - /* Enable FlexCAN Module for configuration. */ - FLEXCAN_Enable(base, true); - - /* Reset to known status. */ - FLEXCAN_Reset(base); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - /* Enable to update in MCER. */ - base->CTRL2 |= CAN_CTRL2_ECRWRE_MASK; - base->MECR &= ~CAN_MECR_ECRWRDIS_MASK; - - /* Enable/Disable Memory Error Detection and Correction.*/ - base->MECR = (pConfig->enableMemoryErrorControl) ? (base->MECR & ~CAN_MECR_ECCDIS_MASK) : - (base->MECR | CAN_MECR_ECCDIS_MASK); - - /* Enable/Disable Non-Correctable Errors In FlexCAN Access Put Device In Freeze Mode. */ - base->MECR = (pConfig->enableNonCorrectableErrorEnterFreeze) ? (base->MECR | CAN_MECR_NCEFAFRZ_MASK) : - (base->MECR & ~CAN_MECR_NCEFAFRZ_MASK); - /* Lock MCER register. */ - base->CTRL2 &= ~CAN_CTRL2_ECRWRE_MASK; -#endif - - /* Save current CTRL1 value and enable to enter Freeze mode(enabled by default). */ - ctrl1Temp = base->CTRL1; - - /* Save current MCR value and enable to enter Freeze mode(enabled by default). */ - mcrTemp = base->MCR; - - /* Enable Loop Back Mode? */ - ctrl1Temp = (pConfig->enableLoopBack) ? (ctrl1Temp | CAN_CTRL1_LPB_MASK) : (ctrl1Temp & ~CAN_CTRL1_LPB_MASK); - - /* Enable Timer Sync? */ - ctrl1Temp = (pConfig->enableTimerSync) ? (ctrl1Temp | CAN_CTRL1_TSYN_MASK) : (ctrl1Temp & ~CAN_CTRL1_TSYN_MASK); - - /* Enable Listen Only Mode? */ - ctrl1Temp = (pConfig->enableListenOnlyMode) ? ctrl1Temp | CAN_CTRL1_LOM_MASK : ctrl1Temp & ~CAN_CTRL1_LOM_MASK; - -#if !(defined(FSL_FEATURE_FLEXCAN_HAS_NO_SUPV_SUPPORT) && FSL_FEATURE_FLEXCAN_HAS_NO_SUPV_SUPPORT) - /* Enable Supervisor Mode? */ - mcrTemp = (pConfig->enableSupervisorMode) ? mcrTemp | CAN_MCR_SUPV_MASK : mcrTemp & ~CAN_MCR_SUPV_MASK; -#endif - - /* Set the maximum number of Message Buffers */ - mcrTemp = (mcrTemp & ~CAN_MCR_MAXMB_MASK) | CAN_MCR_MAXMB((uint32_t)pConfig->maxMbNum - 1U); - - /* Enable Self Wake Up Mode and configure the wake up source. */ - mcrTemp = (pConfig->enableSelfWakeup) ? (mcrTemp | CAN_MCR_SLFWAK_MASK) : (mcrTemp & ~CAN_MCR_SLFWAK_MASK); - mcrTemp = (kFLEXCAN_WakeupSrcFiltered == pConfig->wakeupSrc) ? (mcrTemp | CAN_MCR_WAKSRC_MASK) : - (mcrTemp & ~CAN_MCR_WAKSRC_MASK); -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - /* Enable Pretended Networking Mode? When Pretended Networking mode is set, Self Wake Up feature must be disabled.*/ - mcrTemp = (pConfig->enablePretendedeNetworking) ? ((mcrTemp & ~CAN_MCR_SLFWAK_MASK) | CAN_MCR_PNET_EN_MASK) : - (mcrTemp & ~CAN_MCR_PNET_EN_MASK); -#endif - - /* Enable Individual Rx Masking and Queue feature? */ - mcrTemp = (pConfig->enableIndividMask) ? (mcrTemp | CAN_MCR_IRMQ_MASK) : (mcrTemp & ~CAN_MCR_IRMQ_MASK); - - /* Disable Self Reception? */ - mcrTemp = (pConfig->disableSelfReception) ? mcrTemp | CAN_MCR_SRXDIS_MASK : mcrTemp & ~CAN_MCR_SRXDIS_MASK; - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_DOZE_MODE_SUPPORT) && FSL_FEATURE_FLEXCAN_HAS_DOZE_MODE_SUPPORT) - if (0 != FSL_FEATURE_FLEXCAN_INSTANCE_HAS_DOZE_MODE_SUPPORTn(base)) - { - /* Enable Doze Mode? */ - mcrTemp = (pConfig->enableDoze) ? (mcrTemp | CAN_MCR_DOZE_MASK) : (mcrTemp & ~CAN_MCR_DOZE_MASK); - } -#endif - - /* Write back CTRL1 Configuration to register. */ - base->CTRL1 = ctrl1Temp; - - /* Write back MCR Configuration to register. */ - base->MCR = mcrTemp; - - /* Check whether Nominal Bit Rate Prescaler is overflow. */ - if ((sourceClock_Hz / tqFre - 1U) > maxDivider) - { - timingCfg.preDivider = maxDivider; - } - else - { - timingCfg.preDivider = (uint16_t)(sourceClock_Hz / tqFre) - 1U; - } - - /* Update actual timing characteristic. */ - FLEXCAN_SetTimingConfig(base, &timingCfg); -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * brief Initializes a FlexCAN instance. - * - * This function initializes the FlexCAN module with user-defined settings. - * This example shows how to set up the flexcan_config_t parameters and how - * to call the FLEXCAN_FDInit function by passing in these parameters. - * code - * flexcan_config_t flexcanConfig; - * flexcanConfig.clkSrc = kFLEXCAN_ClkSrc0; - * flexcanConfig.bitRate = 1000000U; - * flexcanConfig.bitRateFD = 2000000U; - * flexcanConfig.maxMbNum = 16; - * flexcanConfig.enableLoopBack = false; - * flexcanConfig.enableSelfWakeup = false; - * flexcanConfig.enableIndividMask = false; - * flexcanConfig.disableSelfReception = false; - * flexcanConfig.enableListenOnlyMode = false; - * flexcanConfig.enableDoze = false; - * flexcanConfig.timingConfig = timingConfig; - * FLEXCAN_FDInit(CAN0, &flexcanConfig, 80000000UL, kFLEXCAN_16BperMB, true); - * endcode - * - * param base FlexCAN peripheral base address. - * param pConfig Pointer to the user-defined configuration structure. - * param sourceClock_Hz FlexCAN Protocol Engine clock source frequency in Hz. - * param dataSize FlexCAN Message Buffer payload size. The actual transmitted or received CAN FD frame data size needs - * to be less than or equal to this value. - * param brs True if bit rate switch is enabled in FD mode. - */ -void FLEXCAN_FDInit( - CAN_Type *base, const flexcan_config_t *pConfig, uint32_t sourceClock_Hz, flexcan_mb_size_t dataSize, bool brs) -{ - assert((uint32_t)dataSize <= 3U); - assert(((pConfig->bitRate < pConfig->bitRateFD) && brs) || ((pConfig->bitRate == pConfig->bitRateFD) && (!brs))); - - uint32_t fdctrl = 0U; - flexcan_timing_config_t timingCfg = pConfig->timingConfig; - /* FlexCAN FD frame data phase timing setting formula: - * quantum = 1 + (fphaseSeg1 + 1) + (fphaseSeg2 + 1) + fpropSeg; - */ - uint32_t quantum = (1U + ((uint32_t)timingCfg.fphaseSeg1 + 1U) + ((uint32_t)timingCfg.fphaseSeg2 + 1U) + - (uint32_t)timingCfg.fpropSeg); - uint32_t tqFre = pConfig->bitRateFD * quantum; - uint16_t maxDivider; - - /* Check bit rate value. */ - assert((pConfig->bitRateFD <= MAX_CANFD_BITRATE) && (tqFre <= sourceClock_Hz)); -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - assert((tqFre * MAX_EDPRESDIV) >= sourceClock_Hz); - maxDivider = MAX_EDPRESDIV; -#else - assert((tqFre * MAX_FPRESDIV) >= sourceClock_Hz); - maxDivider = MAX_FPRESDIV; -#endif - - /* Initialization of classical CAN. */ - FLEXCAN_Init(base, pConfig, sourceClock_Hz); - - /* Check whether Data Bit Rate Prescaler is overflow. */ - if ((sourceClock_Hz / tqFre - 1U) > maxDivider) - { - timingCfg.fpreDivider = maxDivider; - } - else - { - timingCfg.fpreDivider = (uint16_t)(sourceClock_Hz / tqFre) - 1U; - } - - /* Update actual timing characteristic. */ - FLEXCAN_SetFDTimingConfig(base, &timingCfg); - - /* read FDCTRL register. */ - fdctrl = base->FDCTRL; - - /* Enable FD operation and set bit rate switch. */ - if (brs) - { - fdctrl |= CAN_FDCTRL_FDRATE_MASK; - } - else - { - fdctrl &= ~CAN_FDCTRL_FDRATE_MASK; - } - - /* Before use "|=" operation for multi-bits field, CPU should clean previous Setting. */ - fdctrl = (fdctrl & ~CAN_FDCTRL_MBDSR0_MASK) | CAN_FDCTRL_MBDSR0(dataSize); -#if defined(CAN_FDCTRL_MBDSR1_MASK) - fdctrl = (fdctrl & ~CAN_FDCTRL_MBDSR1_MASK) | CAN_FDCTRL_MBDSR1(dataSize); -#endif -#if defined(CAN_FDCTRL_MBDSR2_MASK) - fdctrl = (fdctrl & ~CAN_FDCTRL_MBDSR2_MASK) | CAN_FDCTRL_MBDSR2(dataSize); -#endif -#if defined(CAN_FDCTRL_MBDSR3_MASK) - fdctrl = (fdctrl & ~CAN_FDCTRL_MBDSR3_MASK) | CAN_FDCTRL_MBDSR3(dataSize); -#endif - - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - /* Enable CAN FD operation. */ - base->MCR |= CAN_MCR_FDEN_MASK; - /* Clear SMP bit when CAN FD is enabled (CAN FD only can use one regular sample point plus one optional secondary - * sampling point). */ - base->CTRL1 &= ~CAN_CTRL1_SMP_MASK; - - if (brs && !(pConfig->enableLoopBack)) - { -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - /* The TDC offset should be configured as shown in this equation : offset = DTSEG1 + 2 */ - if (((uint32_t)pConfig->timingConfig.fphaseSeg1 + pConfig->timingConfig.fpropSeg + 2U) * - (pConfig->timingConfig.fpreDivider + 1U) < - MAX_ETDCOFF) - { - base->ETDC = - CAN_ETDC_ETDCEN_MASK | CAN_ETDC_TDMDIS(!pConfig->enableTransceiverDelayMeasure) | - CAN_ETDC_ETDCOFF(((uint32_t)pConfig->timingConfig.fphaseSeg1 + pConfig->timingConfig.fpropSeg + 2U) * - (pConfig->timingConfig.fpreDivider + 1U)); - } - else - { - /* Enable the Transceiver Delay Compensation */ - base->ETDC = CAN_ETDC_ETDCEN_MASK | CAN_ETDC_TDMDIS(!pConfig->enableTransceiverDelayMeasure) | - CAN_ETDC_ETDCOFF(MAX_ETDCOFF); - } -#else - /* The TDC offset should be configured as shown in this equation : offset = PSEG1 + PROPSEG + 2 */ - if (((uint32_t)pConfig->timingConfig.fphaseSeg1 + pConfig->timingConfig.fpropSeg + 2U) * - (pConfig->timingConfig.fpreDivider + 1U) < - MAX_TDCOFF) - { - fdctrl = - (fdctrl & ~CAN_FDCTRL_TDCOFF_MASK) | - CAN_FDCTRL_TDCOFF(((uint32_t)pConfig->timingConfig.fphaseSeg1 + pConfig->timingConfig.fpropSeg + 2U) * - (pConfig->timingConfig.fpreDivider + 1U)); - } - else - { - fdctrl = (fdctrl & ~CAN_FDCTRL_TDCOFF_MASK) | CAN_FDCTRL_TDCOFF(MAX_TDCOFF); - } - /* Enable the Transceiver Delay Compensation */ - fdctrl = (fdctrl & ~CAN_FDCTRL_TDCEN_MASK) | CAN_FDCTRL_TDCEN_MASK; -#endif - } - - /* update the FDCTL register. */ - base->FDCTRL = fdctrl; - - /* Enable CAN FD ISO mode by default. */ - base->CTRL2 |= CAN_CTRL2_ISOCANFDEN_MASK; - - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); -} -#endif - -/*! - * brief De-initializes a FlexCAN instance. - * - * This function disables the FlexCAN module clock and sets all register values - * to the reset value. - * - * param base FlexCAN peripheral base address. - */ -void FLEXCAN_Deinit(CAN_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - uint32_t instance; -#endif - /* Reset all Register Contents. */ - FLEXCAN_Reset(base); - - /* Disable FlexCAN module. */ - FLEXCAN_Enable(base, false); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - instance = FLEXCAN_GetInstance(base); -#if defined(FLEXCAN_PERIPH_CLOCKS) - /* Disable FlexCAN serial clock. */ - (void)CLOCK_DisableClock(s_flexcanPeriphClock[instance]); -#endif /* FLEXCAN_PERIPH_CLOCKS */ - /* Disable FlexCAN clock. */ - (void)CLOCK_DisableClock(s_flexcanClock[instance]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Gets the default configuration structure. - * - * This function initializes the FlexCAN configuration structure to default values. The default - * values are as follows. - * flexcanConfig->clkSrc = kFLEXCAN_ClkSrc0; - * flexcanConfig->bitRate = 1000000U; - * flexcanConfig->bitRateFD = 2000000U; - * flexcanConfig->maxMbNum = 16; - * flexcanConfig->enableLoopBack = false; - * flexcanConfig->enableSelfWakeup = false; - * flexcanConfig->enableIndividMask = false; - * flexcanConfig->disableSelfReception = false; - * flexcanConfig->enableListenOnlyMode = false; - * flexcanConfig->enableDoze = false; - * flexcanConfig->enablePretendedeNetworking = false; - * flexcanConfig->enableMemoryErrorControl = true; - * flexcanConfig->enableNonCorrectableErrorEnterFreeze = true; - * flexcanConfig->enableTransceiverDelayMeasure = true; - * flexcanConfig.timingConfig = timingConfig; - * - * param pConfig Pointer to the FlexCAN configuration structure. - */ -void FLEXCAN_GetDefaultConfig(flexcan_config_t *pConfig) -{ - /* Assertion. */ - assert(NULL != pConfig); - - /* Initializes the configure structure to zero. */ - (void)memset(pConfig, 0, sizeof(*pConfig)); - - /* Initialize FlexCAN Module config struct with default value. */ - pConfig->clkSrc = kFLEXCAN_ClkSrc0; - pConfig->bitRate = 1000000U; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - pConfig->bitRateFD = 2000000U; -#endif - pConfig->maxMbNum = 16; - pConfig->enableLoopBack = false; - pConfig->enableTimerSync = true; - pConfig->enableSelfWakeup = false; - pConfig->wakeupSrc = kFLEXCAN_WakeupSrcUnfiltered; - pConfig->enableIndividMask = false; - pConfig->disableSelfReception = false; - pConfig->enableListenOnlyMode = false; -#if !(defined(FSL_FEATURE_FLEXCAN_HAS_NO_SUPV_SUPPORT) && FSL_FEATURE_FLEXCAN_HAS_NO_SUPV_SUPPORT) - pConfig->enableSupervisorMode = true; -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_DOZE_MODE_SUPPORT) && FSL_FEATURE_FLEXCAN_HAS_DOZE_MODE_SUPPORT) - pConfig->enableDoze = false; -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - pConfig->enablePretendedeNetworking = false; -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - pConfig->enableMemoryErrorControl = true; - pConfig->enableNonCorrectableErrorEnterFreeze = true; -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - pConfig->enableTransceiverDelayMeasure = true; -#endif - - /* Default protocol timing configuration, nominal bit time quantum is 10 (80% SP), data bit time quantum is 5 - * (60%). Suggest use FLEXCAN_CalculateImprovedTimingValues/FLEXCAN_FDCalculateImprovedTimingValues to get the - * improved timing configuration.*/ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - pConfig->timingConfig.phaseSeg1 = 1; - pConfig->timingConfig.phaseSeg2 = 1; - pConfig->timingConfig.propSeg = 4; - pConfig->timingConfig.rJumpwidth = 1; - pConfig->timingConfig.fphaseSeg1 = 1; - pConfig->timingConfig.fphaseSeg2 = 1; - pConfig->timingConfig.fpropSeg = 0; - pConfig->timingConfig.frJumpwidth = 1; -#else - pConfig->timingConfig.phaseSeg1 = 1; - pConfig->timingConfig.phaseSeg2 = 1; - pConfig->timingConfig.propSeg = 4; - pConfig->timingConfig.rJumpwidth = 1; -#endif -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) -/*! - * brief Configures the FlexCAN Pretended Networking mode. - * - * This function configures the FlexCAN Pretended Networking mode with given configuration. - * - * param base FlexCAN peripheral base address. - * param pConfig Pointer to the FlexCAN Rx FIFO configuration structure. - */ -void FLEXCAN_SetPNConfig(CAN_Type *base, const flexcan_pn_config_t *pConfig) -{ - /* Assertion. */ - assert(NULL != pConfig); - assert(0U != pConfig->matchNum); - uint32_t pnctrl; - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - pnctrl = (pConfig->matchNum > 1U) ? CAN_CTRL1_PN_FCS(0x2U | (uint32_t)pConfig->matchSrc) : - CAN_CTRL1_PN_FCS(pConfig->matchSrc); - pnctrl |= (pConfig->enableMatch) ? (CAN_CTRL1_PN_WUMF_MSK_MASK) : 0U; - pnctrl |= (pConfig->enableTimeout) ? (CAN_CTRL1_PN_WTOF_MSK_MASK) : 0U; - pnctrl |= CAN_CTRL1_PN_NMATCH(pConfig->matchNum) | CAN_CTRL1_PN_IDFS(pConfig->idMatchMode) | - CAN_CTRL1_PN_PLFS(pConfig->dataMatchMode); - base->CTRL1_PN = pnctrl; - base->CTRL2_PN = CAN_CTRL2_PN_MATCHTO(pConfig->timeoutValue); - base->FLT_ID1 = pConfig->idLower; - base->FLT_ID2_IDMASK = pConfig->idUpper; - base->FLT_DLC = CAN_FLT_DLC_FLT_DLC_LO(pConfig->lengthLower) | CAN_FLT_DLC_FLT_DLC_HI(pConfig->lengthUpper); - base->PL1_LO = pConfig->lowerWord0; - base->PL1_HI = pConfig->lowerWord1; - base->PL2_PLMASK_LO = pConfig->upperWord0; - base->PL2_PLMASK_HI = pConfig->upperWord1; - - FLEXCAN_ClearStatusFlags(base, (uint64_t)kFLEXCAN_PNMatchIntFlag | (uint64_t)kFLEXCAN_PNTimeoutIntFlag); - - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); -} - -/*! - * brief Reads a FlexCAN Message from Wake Up MB. - * - * This function reads a CAN message from the FlexCAN Wake up Message Buffers. There are four Wake up Message Buffers - * (WMBs) used to store incoming messages in Pretended Networking mode. The WMB index indicates the arrival order. The - * last message is stored in WMB3. - * - * param base FlexCAN peripheral base address. - * param pRxFrame Pointer to CAN message frame structure for reception. - * param mbIdx The FlexCAN Wake up Message Buffer index. Range in 0x0 ~ 0x3. - * retval kStatus_Success - Read Message from Wake up Message Buffer successfully. - * retval kStatus_Fail - Wake up Message Buffer has no valid content. - */ -status_t FLEXCAN_ReadPNWakeUpMB(CAN_Type *base, uint8_t mbIdx, flexcan_frame_t *pRxFrame) -{ - /* Assertion. */ - assert(NULL != pRxFrame); - assert(mbIdx <= 0x3U); - - uint32_t cs_temp; - status_t status; - - /* Check if Wake Up MB has valid content. */ - if (CAN_WU_MTC_MCOUNTER(mbIdx) < (base->WU_MTC & CAN_WU_MTC_MCOUNTER_MASK)) - { - /* Read CS field of wake up Message Buffer. */ - cs_temp = base->WMB[mbIdx].CS; - - /* Store Message ID. */ - pRxFrame->id = base->WMB[mbIdx].ID & (CAN_ID_EXT_MASK | CAN_ID_STD_MASK); - - /* Get the message ID and format. */ - pRxFrame->format = (cs_temp & CAN_CS_IDE_MASK) != 0U ? (uint8_t)kFLEXCAN_FrameFormatExtend : - (uint8_t)kFLEXCAN_FrameFormatStandard; - - /* Get the message type. */ - pRxFrame->type = - (cs_temp & CAN_CS_RTR_MASK) != 0U ? (uint8_t)kFLEXCAN_FrameTypeRemote : (uint8_t)kFLEXCAN_FrameTypeData; - - /* Get the message length. */ - pRxFrame->length = (uint8_t)((cs_temp & CAN_CS_DLC_MASK) >> CAN_CS_DLC_SHIFT); - - /* Messages received during Pretended Networking mode don't have time stamps, and the respective field in the - WMB structure must be ignored. */ - pRxFrame->timestamp = 0x0; - - /* Store Message Payload. */ - pRxFrame->dataWord0 = base->WMB[mbIdx].D03; - pRxFrame->dataWord1 = base->WMB[mbIdx].D47; - - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} -#endif - -/*! - * brief Sets the FlexCAN classical protocol timing characteristic. - * - * This function gives user settings to classical CAN or CAN FD nominal phase timing characteristic. - * The function is for an experienced user. For less experienced users, call the FLEXCAN_GetDefaultConfig() - * and get the default timing characteristicsthe, then call FLEXCAN_Init() and fill the - * bit rate field. - * - * note Calling FLEXCAN_SetTimingConfig() overrides the bit rate set - * in FLEXCAN_Init(). - * - * param base FlexCAN peripheral base address. - * param pConfig Pointer to the timing configuration structure. - */ -void FLEXCAN_SetTimingConfig(CAN_Type *base, const flexcan_timing_config_t *pConfig) -{ - /* Assertion. */ - assert(NULL != pConfig); - - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0 != FSL_FEATURE_FLEXCAN_INSTANCE_HAS_FLEXIBLE_DATA_RATEn(base)) - { -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - /* Enable extended Bit Timing register ENCBT. */ - base->CTRL2 |= CAN_CTRL2_BTE_MASK; - - /* Updating Timing Setting according to configuration structure. */ - base->EPRS = (base->EPRS & (~CAN_EPRS_ENPRESDIV_MASK)) | CAN_EPRS_ENPRESDIV(pConfig->preDivider); - base->ENCBT = CAN_ENCBT_NRJW(pConfig->rJumpwidth) | - CAN_ENCBT_NTSEG1((uint32_t)pConfig->phaseSeg1 + pConfig->propSeg + 1U) | - CAN_ENCBT_NTSEG2(pConfig->phaseSeg2); -#else - /* On RT106x devices, a single write may be ignored, so it is necessary to read back the register value to - * determine whether the value is written successfully. */ - - do - { - /* Enable Bit Timing register CBT, updating Timing Setting according to configuration structure. */ - base->CBT = CAN_CBT_BTF_MASK | CAN_CBT_EPRESDIV(pConfig->preDivider) | CAN_CBT_ERJW(pConfig->rJumpwidth) | - CAN_CBT_EPSEG1(pConfig->phaseSeg1) | CAN_CBT_EPSEG2(pConfig->phaseSeg2) | - CAN_CBT_EPROPSEG(pConfig->propSeg); - - } while ((CAN_CBT_EPRESDIV(pConfig->preDivider) | CAN_CBT_ERJW(pConfig->rJumpwidth) | - CAN_CBT_EPSEG1(pConfig->phaseSeg1) | CAN_CBT_EPSEG2(pConfig->phaseSeg2) | - CAN_CBT_EPROPSEG(pConfig->propSeg)) != - (base->CBT & (CAN_CBT_EPRESDIV_MASK | CAN_CBT_ERJW_MASK | CAN_CBT_EPSEG1_MASK | CAN_CBT_EPSEG2_MASK | - CAN_CBT_EPROPSEG_MASK))); -#endif - } - else - { - /* Cleaning previous Timing Setting. */ - base->CTRL1 &= ~(CAN_CTRL1_PRESDIV_MASK | CAN_CTRL1_RJW_MASK | CAN_CTRL1_PSEG1_MASK | CAN_CTRL1_PSEG2_MASK | - CAN_CTRL1_PROPSEG_MASK); - - /* Updating Timing Setting according to configuration structure. */ - base->CTRL1 |= (CAN_CTRL1_PRESDIV(pConfig->preDivider) | CAN_CTRL1_RJW(pConfig->rJumpwidth) | - CAN_CTRL1_PSEG1(pConfig->phaseSeg1) | CAN_CTRL1_PSEG2(pConfig->phaseSeg2) | - CAN_CTRL1_PROPSEG(pConfig->propSeg)); - } -#else - /* Cleaning previous Timing Setting. */ - base->CTRL1 &= ~(CAN_CTRL1_PRESDIV_MASK | CAN_CTRL1_RJW_MASK | CAN_CTRL1_PSEG1_MASK | CAN_CTRL1_PSEG2_MASK | - CAN_CTRL1_PROPSEG_MASK); - - /* Updating Timing Setting according to configuration structure. */ - base->CTRL1 |= (CAN_CTRL1_PRESDIV(pConfig->preDivider) | CAN_CTRL1_RJW(pConfig->rJumpwidth) | - CAN_CTRL1_PSEG1(pConfig->phaseSeg1) | CAN_CTRL1_PSEG2(pConfig->phaseSeg2) | - CAN_CTRL1_PROPSEG(pConfig->propSeg)); -#endif - - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * brief Sets the FlexCAN FD data phase timing characteristic. - * - * This function gives user settings to CAN FD data phase timing characteristic. - * The function is for an experienced user. For less experienced users, call the FLEXCAN_GetDefaultConfig() - * and get the default timing characteristicsthe, then call FLEXCAN_FDInit() and fill the - * data phase bit rate field. - * - * note Calling FLEXCAN_SetFDTimingConfig() overrides the bit rate set - * in FLEXCAN_FDInit(). - * - * param base FlexCAN peripheral base address. - * param pConfig Pointer to the timing configuration structure. - */ -void FLEXCAN_SetFDTimingConfig(CAN_Type *base, const flexcan_timing_config_t *pConfig) -{ - /* Assertion. */ - assert(NULL != pConfig); - - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - /* Enable extended Bit Timing register EDCBT. */ - base->CTRL2 |= CAN_CTRL2_BTE_MASK; - - base->EPRS = (base->EPRS & (~CAN_EPRS_EDPRESDIV_MASK)) | CAN_EPRS_EDPRESDIV(pConfig->fpreDivider); - base->EDCBT = CAN_EDCBT_DRJW(pConfig->frJumpwidth) | CAN_EDCBT_DTSEG2(pConfig->fphaseSeg2) | - CAN_EDCBT_DTSEG1((uint32_t)pConfig->fphaseSeg1 + pConfig->fpropSeg); -#else - /* Enable Bit Timing register FDCBT,*/ - base->CBT |= CAN_CBT_BTF_MASK; - - /* On RT106x devices, a single write may be ignored, so it is necessary to read back the register value to determine - * whether the value is written successfully. */ - do - { - /* Updating Timing Setting according to configuration structure. */ - base->FDCBT = (CAN_FDCBT_FPRESDIV(pConfig->fpreDivider) | CAN_FDCBT_FRJW(pConfig->frJumpwidth) | - CAN_FDCBT_FPSEG1(pConfig->fphaseSeg1) | CAN_FDCBT_FPSEG2(pConfig->fphaseSeg2) | - CAN_FDCBT_FPROPSEG(pConfig->fpropSeg)); - } while ((CAN_FDCBT_FPRESDIV(pConfig->fpreDivider) | CAN_FDCBT_FRJW(pConfig->frJumpwidth) | - CAN_FDCBT_FPSEG1(pConfig->fphaseSeg1) | CAN_FDCBT_FPSEG2(pConfig->fphaseSeg2) | - CAN_FDCBT_FPROPSEG(pConfig->fpropSeg)) != - (base->FDCBT & (CAN_FDCBT_FPRESDIV_MASK | CAN_FDCBT_FRJW_MASK | CAN_FDCBT_FPSEG1_MASK | - CAN_FDCBT_FPSEG2_MASK | CAN_FDCBT_FPROPSEG_MASK))); -#endif - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); -} -#endif - -/*! - * brief Sets the FlexCAN receive message buffer global mask. - * - * This function sets the global mask for the FlexCAN message buffer in a matching process. - * The configuration is only effective when the Rx individual mask is disabled in the FLEXCAN_Init(). - * - * param base FlexCAN peripheral base address. - * param mask Rx Message Buffer Global Mask value. - */ -void FLEXCAN_SetRxMbGlobalMask(CAN_Type *base, uint32_t mask) -{ - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - - /* Setting Rx Message Buffer Global Mask value. */ - base->RXMGMASK = mask; - base->RX14MASK = mask; - base->RX15MASK = mask; - - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); -} - -/*! - * brief Sets the FlexCAN receive FIFO global mask. - * - * This function sets the global mask for FlexCAN FIFO in a matching process. - * - * param base FlexCAN peripheral base address. - * param mask Rx Fifo Global Mask value. - */ -void FLEXCAN_SetRxFifoGlobalMask(CAN_Type *base, uint32_t mask) -{ - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - - /* Setting Rx FIFO Global Mask value. */ - base->RXFGMASK = mask; - - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); -} - -/*! - * brief Sets the FlexCAN receive individual mask. - * - * This function sets the individual mask for the FlexCAN matching process. - * The configuration is only effective when the Rx individual mask is enabled in the FLEXCAN_Init(). - * If the Rx FIFO is disabled, the individual mask is applied to the corresponding Message Buffer. - * If the Rx FIFO is enabled, the individual mask for Rx FIFO occupied Message Buffer is applied to - * the Rx Filter with the same index. Note that only the first 32 - * individual masks can be used as the Rx FIFO filter mask. - * - * param base FlexCAN peripheral base address. - * param maskIdx The Index of individual Mask. - * param mask Rx Individual Mask value. - */ -void FLEXCAN_SetRxIndividualMask(CAN_Type *base, uint8_t maskIdx, uint32_t mask) -{ - assert(maskIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); - - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - - /* Setting Rx Individual Mask value. */ - base->RXIMR[maskIdx] = mask; - - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); -} - -/*! - * brief Configures a FlexCAN transmit message buffer. - * - * This function aborts the previous transmission, cleans the Message Buffer, and - * configures it as a Transmit Message Buffer. - * - * param base FlexCAN peripheral base address. - * param mbIdx The Message Buffer index. - * param enable Enable/disable Tx Message Buffer. - * - true: Enable Tx Message Buffer. - * - false: Disable Tx Message Buffer. - */ -void FLEXCAN_SetTxMbConfig(CAN_Type *base, uint8_t mbIdx, bool enable) -{ - /* Assertion. */ - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - /* Inactivate Message Buffer. */ - if (enable) - { - base->MB[mbIdx].CS = CAN_CS_CODE(kFLEXCAN_TxMbInactive); - } - else - { - base->MB[mbIdx].CS = 0; - } - - /* Clean Message Buffer content. */ - base->MB[mbIdx].ID = 0x0; - base->MB[mbIdx].WORD0 = 0x0; - base->MB[mbIdx].WORD1 = 0x0; -} - -/*! - * brief Calculates the segment values for a single bit time for classical CAN. - * - * This function use to calculates the Classical CAN segment values which will be set in CTRL1/CBT/ENCBT register. - * - * param bitRate The classical CAN bit rate in bps. - * param base FlexCAN peripheral base address. - * param tqNum Number of time quantas per bit, range in 8 ~ 25 when use CTRL1, range in 8 ~ 129 when use CBT, range in - * 8 ~ 385 when use ENCBT. param pTimingConfig Pointer to the FlexCAN timing configuration structure. - */ -static void FLEXCAN_GetSegments(CAN_Type *base, - uint32_t bitRate, - uint32_t tqNum, - flexcan_timing_config_t *pTimingConfig) -{ - uint32_t ideal_sp; - uint32_t seg1Max, proSegMax; - uint32_t seg1Temp; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0 != FSL_FEATURE_FLEXCAN_INSTANCE_HAS_FLEXIBLE_DATA_RATEn(base)) - { -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - /* Maximum value allowed in ENCBT register. */ - seg1Max = MAX_NTSEG2 + 1U; - proSegMax = MAX_NTSEG1 - MAX_NTSEG2; -#else - /* Maximum value allowed in CBT register. */ - seg1Max = MAX_EPSEG1 + 1U; - proSegMax = MAX_EPROPSEG + 1U; -#endif - } - else - { - /* Maximum value allowed in CTRL1 register. */ - seg1Max = MAX_PSEG1 + 1U; - proSegMax = MAX_PROPSEG + 1U; - } -#else - /* Maximum value allowed in CTRL1 register. */ - seg1Max = MAX_PSEG1 + 1U; - proSegMax = MAX_PROPSEG + 1U; -#endif - - /* Try to find the ideal sample point, according to CiA 301 doc.*/ - if (bitRate == 1000000U) - { - ideal_sp = IDEAL_SP_LOW; - } - else if (bitRate >= 800000U) - { - ideal_sp = IDEAL_SP_MID; - } - else - { - ideal_sp = IDEAL_SP_HIGH; - } - /* Calculates phaseSeg2. */ - pTimingConfig->phaseSeg2 = (uint8_t)(tqNum - (tqNum * ideal_sp) / (uint32_t)IDEAL_SP_FACTOR); - if (pTimingConfig->phaseSeg2 < MIN_TIME_SEGMENT2) - { - pTimingConfig->phaseSeg2 = MIN_TIME_SEGMENT2; - } - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0 != FSL_FEATURE_FLEXCAN_INSTANCE_HAS_FLEXIBLE_DATA_RATEn(base)) - { -#if !(defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - if (pTimingConfig->phaseSeg2 > (uint8_t)(MAX_EPSEG2 + 1U)) - { - pTimingConfig->phaseSeg2 = (uint8_t)(MAX_EPSEG2 + 1U); - } -#endif - } -#endif - - /* Calculates phaseSeg1 and propSeg and try to make phaseSeg1 equal to phaseSeg2. */ - if ((tqNum - pTimingConfig->phaseSeg2 - 1U) > (seg1Max + proSegMax)) - { - seg1Temp = seg1Max + proSegMax; - pTimingConfig->phaseSeg2 = (uint8_t)(tqNum - 1U - seg1Temp); - } - else - { - seg1Temp = tqNum - pTimingConfig->phaseSeg2 - 1U; - } - if (seg1Temp > (pTimingConfig->phaseSeg2 + proSegMax)) - { - pTimingConfig->propSeg = (uint8_t)proSegMax; - pTimingConfig->phaseSeg1 = (uint8_t)(seg1Temp - proSegMax); - } - else - { - pTimingConfig->propSeg = (uint8_t)(seg1Temp - pTimingConfig->phaseSeg2); - pTimingConfig->phaseSeg1 = pTimingConfig->phaseSeg2; - } - - /* rJumpwidth (sjw) is the minimum value of phaseSeg1 and phaseSeg2. */ - pTimingConfig->rJumpwidth = - (pTimingConfig->phaseSeg1 > pTimingConfig->phaseSeg2) ? pTimingConfig->phaseSeg2 : pTimingConfig->phaseSeg1; -#if !(defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (pTimingConfig->rJumpwidth > (MAX_RJW + 1U)) - { - pTimingConfig->rJumpwidth = (uint8_t)(MAX_RJW + 1U); - } -#else - if (0 == FSL_FEATURE_FLEXCAN_INSTANCE_HAS_FLEXIBLE_DATA_RATEn(base)) - { - if (pTimingConfig->rJumpwidth > (MAX_RJW + 1U)) - { - pTimingConfig->rJumpwidth = (uint8_t)(MAX_RJW + 1U); - } - } -#endif - - pTimingConfig->phaseSeg1 -= 1U; - pTimingConfig->phaseSeg2 -= 1U; - pTimingConfig->propSeg -= 1U; - pTimingConfig->rJumpwidth -= 1U; -} - -/*! - * brief Calculates the improved timing values by specific bit Rates for classical CAN. - * - * This function use to calculates the Classical CAN timing values according to the given bit rate. The Calculated - * timing values will be set in CTRL1/CBT/ENCBT register. The calculation is based on the recommendation of the CiA 301 - * v4.2.0 and previous version document. - * - * param base FlexCAN peripheral base address. - * param bitRate The classical CAN speed in bps defined by user, should be less than or equal to 1Mbps. - * param sourceClock_Hz The Source clock frequency in Hz. - * param pTimingConfig Pointer to the FlexCAN timing configuration structure. - * - * return TRUE if timing configuration found, FALSE if failed to find configuration. - */ -bool FLEXCAN_CalculateImprovedTimingValues(CAN_Type *base, - uint32_t bitRate, - uint32_t sourceClock_Hz, - flexcan_timing_config_t *pTimingConfig) -{ - /* Observe bit rate maximums. */ - assert(bitRate <= MAX_CAN_BITRATE); - - uint32_t clk; - uint32_t tqNum, tqMin, pdivMAX; - uint32_t spTemp = 1000U; - flexcan_timing_config_t configTemp = {0}; - bool fgRet = false; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0 != FSL_FEATURE_FLEXCAN_INSTANCE_HAS_FLEXIBLE_DATA_RATEn(base)) - { -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - /* Auto Improved Protocal timing for ENCBT. */ - tqNum = ENCBT_MAX_TIME_QUANTA; - tqMin = ENCBT_MIN_TIME_QUANTA; - pdivMAX = MAX_ENPRESDIV; -#else - /* Auto Improved Protocal timing for CBT. */ - tqNum = CBT_MAX_TIME_QUANTA; - tqMin = CBT_MIN_TIME_QUANTA; - pdivMAX = MAX_PRESDIV; -#endif - } - else - { - /* Auto Improved Protocal timing for CTRL1. */ - tqNum = CTRL1_MAX_TIME_QUANTA; - tqMin = CTRL1_MIN_TIME_QUANTA; - pdivMAX = MAX_PRESDIV; - } -#else - /* Auto Improved Protocal timing for CTRL1. */ - tqNum = CTRL1_MAX_TIME_QUANTA; - tqMin = CTRL1_MIN_TIME_QUANTA; - pdivMAX = MAX_PRESDIV; -#endif - do - { - clk = bitRate * tqNum; - if (clk > sourceClock_Hz) - { - continue; /* tqNum too large, clk has been exceed sourceClock_Hz. */ - } - - if ((sourceClock_Hz / clk * clk) != sourceClock_Hz) - { - continue; /* Non-supporting: the frequency of clock source is not divisible by target bit rate, the user - should change a divisible bit rate. */ - } - - configTemp.preDivider = (uint16_t)(sourceClock_Hz / clk) - 1U; - if (configTemp.preDivider > pdivMAX) - { - break; /* The frequency of source clock is too large or the bit rate is too small, the pre-divider could - not handle it. */ - } - - /* Calculates the best timing configuration under current tqNum. */ - FLEXCAN_GetSegments(base, bitRate, tqNum, &configTemp); - /* Determine whether the calculated timing configuration can get the optimal sampling point. */ - if (((((uint32_t)configTemp.phaseSeg2 + 1U) * 1000U) / tqNum) < spTemp) - { - spTemp = (((uint32_t)configTemp.phaseSeg2 + 1U) * 1000U) / tqNum; - pTimingConfig->preDivider = configTemp.preDivider; - pTimingConfig->rJumpwidth = configTemp.rJumpwidth; - pTimingConfig->phaseSeg1 = configTemp.phaseSeg1; - pTimingConfig->phaseSeg2 = configTemp.phaseSeg2; - pTimingConfig->propSeg = configTemp.propSeg; - } - fgRet = true; - } while (--tqNum >= tqMin); - - return fgRet; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * brief Get Mailbox offset number by dword. - * - * This function gets the offset number of the specified mailbox. - * Mailbox is not consecutive between memory regions when payload is not 8 bytes - * so need to calculate the specified mailbox address. - * For example, in the first memory region, MB[0].CS address is 0x4002_4080. For 32 bytes - * payload frame, the second mailbox is ((1/12)*512 + 1%12*40)/4 = 10, meaning 10 dword - * after the 0x4002_4080, which is actually the address of mailbox MB[1].CS. - * - * param base FlexCAN peripheral base address. - * param mbIdx Mailbox index. - */ -static uint32_t FLEXCAN_GetFDMailboxOffset(CAN_Type *base, uint8_t mbIdx) -{ - uint32_t offset = 0; - uint32_t dataSize = (base->FDCTRL & CAN_FDCTRL_MBDSR0_MASK) >> CAN_FDCTRL_MBDSR0_SHIFT; - if (dataSize == (uint32_t)kFLEXCAN_8BperMB) - { - offset = (((uint32_t)mbIdx / 32U) * 512U + ((uint32_t)mbIdx % 32U) * 16U); - } - else if (dataSize == (uint32_t)kFLEXCAN_16BperMB) - { - offset = (((uint32_t)mbIdx / 21U) * 512U + ((uint32_t)mbIdx % 21U) * 24U); - } - else if (dataSize == (uint32_t)kFLEXCAN_32BperMB) - { - offset = (((uint32_t)mbIdx / 12U) * 512U + ((uint32_t)mbIdx % 12U) * 40U); - } - else - { - offset = (((uint32_t)mbIdx / 7U) * 512U + ((uint32_t)mbIdx % 7U) * 72U); - } - - /* To get the dword aligned offset, need to divide by 4. */ - offset = offset / 4U; - return offset; -} - -/*! - * brief Calculates the segment values for a single bit time for CAN FD data phase. - * - * This function use to calculates the CAN FD data phase segment values which will be set in CFDCBT/EDCBT - * register. - * - * param bitRateFD CAN FD data phase bit rate. - * param tqNum Number of time quanta per bit - * param pTimingConfig Pointer to the FlexCAN timing configuration structure. - */ -static void FLEXCAN_FDGetSegments(uint32_t bitRateFD, uint32_t tqNum, flexcan_timing_config_t *pTimingConfig) -{ - uint32_t ideal_sp; - uint32_t seg1Max, proSegMax, seg2Max; - uint32_t seg1Temp; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - /* Maximum value allowed in EDCBT register. */ - seg1Max = MAX_DTSEG2 + 1U; - proSegMax = MAX_DTSEG1 - MAX_DTSEG2; - seg2Max = MAX_DTSEG2 + 1U; -#else - /* Maximum value allowed in FDCBT register. */ - seg1Max = MAX_FPSEG1 + 1U; - proSegMax = MAX_FPROPSEG; - seg2Max = MAX_FPSEG2 + 1U; -#endif - - /* According to CiA doc 1301 v1.0.0, which specified data phase sample point postion for CAN FD at 80 MHz. */ - if (bitRateFD <= 1000000U) - { - ideal_sp = IDEAL_DATA_SP_1; - } - else if (bitRateFD <= 2000000U) - { - ideal_sp = IDEAL_DATA_SP_2; - } - else if (bitRateFD <= 4000000U) - { - ideal_sp = IDEAL_DATA_SP_3; - } - else - { - ideal_sp = IDEAL_DATA_SP_4; - } - - /* Calculates fphaseSeg2. */ - pTimingConfig->fphaseSeg2 = (uint8_t)(tqNum - (tqNum * ideal_sp) / (uint32_t)IDEAL_SP_FACTOR); - if (pTimingConfig->fphaseSeg2 < MIN_TIME_SEGMENT2) - { - pTimingConfig->fphaseSeg2 = MIN_TIME_SEGMENT2; - } - else if (pTimingConfig->fphaseSeg2 > seg2Max) - { - pTimingConfig->fphaseSeg2 = (uint8_t)seg2Max; - } - else - { - ; /* Intentional empty */ - } - - /* Calculates fphaseSeg1 and fpropSeg and try to make phaseSeg1 equal to phaseSeg2 */ - if ((tqNum - pTimingConfig->fphaseSeg2 - 1U) > (seg1Max + proSegMax)) - { - seg1Temp = seg1Max + proSegMax; - pTimingConfig->fphaseSeg2 = (uint8_t)(tqNum - 1U - seg1Temp); - } - else - { - seg1Temp = tqNum - pTimingConfig->fphaseSeg2 - 1U; - } - if (seg1Temp > (pTimingConfig->fphaseSeg2 + proSegMax)) - { - pTimingConfig->fpropSeg = (uint8_t)proSegMax; - pTimingConfig->fphaseSeg1 = (uint8_t)(seg1Temp - proSegMax); - } - else if (seg1Temp > pTimingConfig->fphaseSeg2) - { - pTimingConfig->fpropSeg = (uint8_t)(seg1Temp - pTimingConfig->fphaseSeg2); - pTimingConfig->fphaseSeg1 = pTimingConfig->fphaseSeg2; - } - else - { - pTimingConfig->fpropSeg = 0U; - pTimingConfig->fphaseSeg1 = (uint8_t)seg1Temp; - } - - /* rJumpwidth (sjw) is the minimum value of phaseSeg1 and phaseSeg2. */ - pTimingConfig->frJumpwidth = - (pTimingConfig->fphaseSeg1 > pTimingConfig->fphaseSeg2) ? pTimingConfig->fphaseSeg2 : pTimingConfig->fphaseSeg1; - - pTimingConfig->fphaseSeg1 -= 1U; - pTimingConfig->fphaseSeg2 -= 1U; - pTimingConfig->frJumpwidth -= 1U; -} - -/*! - * brief Calculates the improved timing values by specific bit rate for CAN FD nominal phase. - * - * This function use to calculates the CAN FD nominal phase timing values according to the given nominal phase bit rate. - * The Calculated timing values will be set in CBT/ENCBT registers. The calculation is based on the recommendation of - * the CiA 1301 v1.0.0 document. - * - * param bitRate The CAN FD nominal phase speed in bps defined by user, should be less than or equal to 1Mbps. - * param sourceClock_Hz The Source clock frequency in Hz. - * param pTimingConfig Pointer to the FlexCAN timing configuration structure. - * - * return TRUE if timing configuration found, FALSE if failed to find configuration. - */ -static bool FLEXCAN_CalculateImprovedNominalTimingValues(uint32_t bitRate, - uint32_t sourceClock_Hz, - flexcan_timing_config_t *pTimingConfig) -{ - /* Observe bit rate maximums. */ - assert(bitRate <= MAX_CAN_BITRATE); - - uint32_t clk; - uint32_t tqNum, tqMin, pdivMAX, seg1Max, proSegMax, seg1Temp; - uint32_t spTemp = 1000U; - flexcan_timing_config_t configTemp = {0}; - bool fgRet = false; - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - /* Auto Improved Protocal timing for ENCBT. */ - tqNum = ENCBT_MAX_TIME_QUANTA; - tqMin = ENCBT_MIN_TIME_QUANTA; - pdivMAX = MAX_ENPRESDIV; - seg1Max = MAX_NTSEG2 + 1U; - proSegMax = MAX_NTSEG1 - MAX_NTSEG2; -#else - /* Auto Improved Protocal timing for CBT. */ - tqNum = CBT_MAX_TIME_QUANTA; - tqMin = CBT_MIN_TIME_QUANTA; - pdivMAX = MAX_PRESDIV; - seg1Max = MAX_EPSEG1 + 1U; - proSegMax = MAX_EPROPSEG + 1U; -#endif - - do - { - clk = bitRate * tqNum; - if (clk > sourceClock_Hz) - { - continue; /* tqNum too large, clk has been exceed sourceClock_Hz. */ - } - - if ((sourceClock_Hz / clk * clk) != sourceClock_Hz) - { - continue; /* Non-supporting: the frequency of clock source is not divisible by target bit rate, the user - should change a divisible bit rate. */ - } - - configTemp.preDivider = (uint16_t)(sourceClock_Hz / clk) - 1U; - if (configTemp.preDivider > pdivMAX) - { - break; /* The frequency of source clock is too large or the bit rate is too small, the pre-divider could - not handle it. */ - } - - /* Calculates the best timing configuration under current tqNum. */ - configTemp.phaseSeg2 = (uint8_t)(tqNum - (tqNum * IDEAL_NOMINAL_SP) / (uint32_t)IDEAL_SP_FACTOR); - - /* Calculates phaseSeg1 and propSeg and try to make phaseSeg1 equal to phaseSeg2. */ - if ((tqNum - configTemp.phaseSeg2 - 1U) > (seg1Max + proSegMax)) - { - seg1Temp = seg1Max + proSegMax; - configTemp.phaseSeg2 = (uint8_t)(tqNum - 1U - seg1Temp); - } - else - { - seg1Temp = tqNum - configTemp.phaseSeg2 - 1U; - } - if (seg1Temp > (configTemp.phaseSeg2 + proSegMax)) - { - configTemp.propSeg = (uint8_t)proSegMax; - configTemp.phaseSeg1 = (uint8_t)(seg1Temp - proSegMax); - } - else - { - configTemp.propSeg = (uint8_t)(seg1Temp - configTemp.phaseSeg2); - configTemp.phaseSeg1 = configTemp.phaseSeg2; - } - - /* rJumpwidth (sjw) is the minimum value of phaseSeg1 and phaseSeg2. */ - configTemp.rJumpwidth = - (configTemp.phaseSeg1 > configTemp.phaseSeg2) ? configTemp.phaseSeg2 : configTemp.phaseSeg1; - configTemp.phaseSeg1 -= 1U; - configTemp.phaseSeg2 -= 1U; - configTemp.propSeg -= 1U; - configTemp.rJumpwidth -= 1U; - - if (((((uint32_t)configTemp.phaseSeg2 + 1U) * 1000U) / tqNum) < spTemp) - { - spTemp = (((uint32_t)configTemp.phaseSeg2 + 1U) * 1000U) / tqNum; - pTimingConfig->preDivider = configTemp.preDivider; - pTimingConfig->rJumpwidth = configTemp.rJumpwidth; - pTimingConfig->phaseSeg1 = configTemp.phaseSeg1; - pTimingConfig->phaseSeg2 = configTemp.phaseSeg2; - pTimingConfig->propSeg = configTemp.propSeg; - } - fgRet = true; - } while (--tqNum >= tqMin); - - return fgRet; -} - -/*! - * brief Calculates the improved timing values by specific bit rates for CAN FD. - * - * This function use to calculates the CAN FD timing values according to the given nominal phase bit rate and data phase - * bit rate. The Calculated timing values will be set in CBT/ENCBT and FDCBT/EDCBT registers. The calculation is based - * on the recommendation of the CiA 1301 v1.0.0 document. - * - * param bitRate The CAN FD nominal phase speed in bps defined by user. - * param bitRateFD The CAN FD data phase speed in bps defined by user. Equal to bitRate means disable bit rate - * switching. param sourceClock_Hz The Source clock frequency in Hz. param pTimingConfig Pointer to the FlexCAN timing - * configuration structure. - * - * return TRUE if timing configuration found, FALSE if failed to find configuration - */ -bool FLEXCAN_FDCalculateImprovedTimingValues(CAN_Type *base, - uint32_t bitRate, - uint32_t bitRateFD, - uint32_t sourceClock_Hz, - flexcan_timing_config_t *pTimingConfig) -{ - /* Observe bit rate maximums */ - assert(bitRate <= MAX_CANFD_BITRATE); - assert(bitRateFD <= MAX_CANFD_BITRATE); - /* Data phase bit rate need greater or equal to nominal phase bit rate. */ - assert(bitRate <= bitRateFD); - - uint32_t clk; - uint32_t tqMin, pdivMAX, tqTemp; - bool fgRet = false; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - /* Auto Improved Protocal timing for EDCBT. */ - tqTemp = EDCBT_MAX_TIME_QUANTA; - tqMin = EDCBT_MIN_TIME_QUANTA; - pdivMAX = MAX_EDPRESDIV; -#else - /* Auto Improved Protocal timing for FDCBT. */ - tqTemp = FDCBT_MAX_TIME_QUANTA; - tqMin = FDCBT_MIN_TIME_QUANTA; - pdivMAX = MAX_FPRESDIV; -#endif - - if (bitRate != bitRateFD) - { - /* To minimize errors when processing FD frames, try to get the same bit rate prescaler value for nominal phase - and data phase. */ - do - { - clk = bitRateFD * tqTemp; - if (clk > sourceClock_Hz) - { - continue; /* tqTemp too large, clk x tqTemp has been exceed sourceClock_Hz. */ - } - - if ((sourceClock_Hz / clk * clk) != sourceClock_Hz) - { - continue; /* the frequency of clock source is not divisible by target bit rate. */ - } - - pTimingConfig->fpreDivider = (uint16_t)(sourceClock_Hz / clk) - 1U; - - if (pTimingConfig->fpreDivider > pdivMAX) - { - break; /* The frequency of source clock is too large or the bit rate is too small, the pre-divider - could not handle it. */ - } - - /* Calculates the best data phase timing configuration. */ - FLEXCAN_FDGetSegments(bitRateFD, tqTemp, pTimingConfig); - - if (FLEXCAN_CalculateImprovedNominalTimingValues( - bitRate, sourceClock_Hz / ((uint32_t)pTimingConfig->fpreDivider + 1U), pTimingConfig)) - { - fgRet = true; - if (pTimingConfig->preDivider == 0U) - { - pTimingConfig->preDivider = pTimingConfig->fpreDivider; - break; - } - else - { - pTimingConfig->preDivider = - (pTimingConfig->preDivider + 1U) * (pTimingConfig->fpreDivider + 1U) - 1U; - continue; - } - } - } while (--tqTemp >= tqMin); - } - else - { - if (FLEXCAN_CalculateImprovedNominalTimingValues(bitRate, sourceClock_Hz, pTimingConfig)) - { - /* No need data phase timing configuration, data phase rate equal to nominal phase rate, user don't use Brs - feature. */ - pTimingConfig->fpreDivider = 0U; - pTimingConfig->frJumpwidth = 0U; - pTimingConfig->fphaseSeg1 = 0U; - pTimingConfig->fphaseSeg2 = 0U; - pTimingConfig->fpropSeg = 0U; - fgRet = true; - } - } - return fgRet; -} - -/*! - * brief Configures a FlexCAN transmit message buffer. - * - * This function aborts the previous transmission, cleans the Message Buffer, and - * configures it as a Transmit Message Buffer. - * - * param base FlexCAN peripheral base address. - * param mbIdx The Message Buffer index. - * param enable Enable/disable Tx Message Buffer. - * - true: Enable Tx Message Buffer. - * - false: Disable Tx Message Buffer. - */ -void FLEXCAN_SetFDTxMbConfig(CAN_Type *base, uint8_t mbIdx, bool enable) -{ - /* Assertion. */ - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - uint8_t cnt = 0; - uint8_t payload_dword = 1; - uint32_t dataSize; - dataSize = (base->FDCTRL & CAN_FDCTRL_MBDSR0_MASK) >> CAN_FDCTRL_MBDSR0_SHIFT; - volatile uint32_t *mbAddr = &(base->MB[0].CS); - uint32_t offset = FLEXCAN_GetFDMailboxOffset(base, mbIdx); -#if ((defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829)) - uint32_t availoffset = FLEXCAN_GetFDMailboxOffset(base, FLEXCAN_GetFirstValidMb(base)); -#endif - - /* Inactivate Message Buffer. */ - if (enable) - { - /* Inactivate by writing CS. */ - mbAddr[offset] = CAN_CS_CODE(kFLEXCAN_TxMbInactive); - } - else - { - mbAddr[offset] = 0x0; - } - - /* Calculate the DWORD number, dataSize 0/1/2/3 corresponds to 8/16/32/64 - Bytes payload. */ - for (cnt = 0; cnt < (dataSize + 1U); cnt++) - { - payload_dword *= 2U; - } - - /* Clean ID. */ - mbAddr[offset + 1U] = 0x0U; - /* Clean Message Buffer content, DWORD by DWORD. */ - for (cnt = 0; cnt < payload_dword; cnt++) - { - mbAddr[offset + 2U + cnt] = 0x0U; - } - -#if ((defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829)) - mbAddr[availoffset] = CAN_CS_CODE(kFLEXCAN_TxMbInactive); -#endif -} -#endif /* FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE */ - -/*! - * brief Configures a FlexCAN Receive Message Buffer. - * - * This function cleans a FlexCAN build-in Message Buffer and configures it - * as a Receive Message Buffer. - * - * param base FlexCAN peripheral base address. - * param mbIdx The Message Buffer index. - * param pRxMbConfig Pointer to the FlexCAN Message Buffer configuration structure. - * param enable Enable/disable Rx Message Buffer. - * - true: Enable Rx Message Buffer. - * - false: Disable Rx Message Buffer. - */ -void FLEXCAN_SetRxMbConfig(CAN_Type *base, uint8_t mbIdx, const flexcan_rx_mb_config_t *pRxMbConfig, bool enable) -{ - /* Assertion. */ - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); - assert(((NULL != pRxMbConfig) || (false == enable))); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - uint32_t cs_temp = 0; - - /* Inactivate Message Buffer. */ - base->MB[mbIdx].CS = 0; - - /* Clean Message Buffer content. */ - base->MB[mbIdx].ID = 0x0; - base->MB[mbIdx].WORD0 = 0x0; - base->MB[mbIdx].WORD1 = 0x0; - - if (enable) - { - /* Setup Message Buffer ID. */ - base->MB[mbIdx].ID = pRxMbConfig->id; - - /* Setup Message Buffer format. */ - if (kFLEXCAN_FrameFormatExtend == pRxMbConfig->format) - { - cs_temp |= CAN_CS_IDE_MASK; - } - - /* Setup Message Buffer type. */ - if (kFLEXCAN_FrameTypeRemote == pRxMbConfig->type) - { - cs_temp |= CAN_CS_RTR_MASK; - } - - /* Activate Rx Message Buffer. */ - cs_temp |= CAN_CS_CODE(kFLEXCAN_RxMbEmpty); - base->MB[mbIdx].CS = cs_temp; - } -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * brief Configures a FlexCAN Receive Message Buffer. - * - * This function cleans a FlexCAN build-in Message Buffer and configures it - * as a Receive Message Buffer. - * - * param base FlexCAN peripheral base address. - * param mbIdx The Message Buffer index. - * param pRxMbConfig Pointer to the FlexCAN Message Buffer configuration structure. - * param enable Enable/disable Rx Message Buffer. - * - true: Enable Rx Message Buffer. - * - false: Disable Rx Message Buffer. - */ -void FLEXCAN_SetFDRxMbConfig(CAN_Type *base, uint8_t mbIdx, const flexcan_rx_mb_config_t *pRxMbConfig, bool enable) -{ - /* Assertion. */ - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); - assert(((NULL != pRxMbConfig) || (false == enable))); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - uint32_t cs_temp = 0; - uint8_t cnt = 0; - volatile uint32_t *mbAddr = &(base->MB[0].CS); - uint32_t offset = FLEXCAN_GetFDMailboxOffset(base, mbIdx); - uint8_t payload_dword; - uint32_t dataSize = (base->FDCTRL & CAN_FDCTRL_MBDSR0_MASK) >> CAN_FDCTRL_MBDSR0_SHIFT; - - /* Inactivate Message Buffer. */ - mbAddr[offset] = 0U; - - /* Clean Message Buffer content. */ - mbAddr[offset + 1U] = 0U; - /* Calculate the DWORD number, dataSize 0/1/2/3 corresponds to 8/16/32/64 - Bytes payload. */ - payload_dword = (2U << dataSize); - for (cnt = 0; cnt < payload_dword; cnt++) - { - mbAddr[offset + 2U + cnt] = 0x0; - } - - if (enable) - { - /* Setup Message Buffer ID. */ - mbAddr[offset + 1U] = pRxMbConfig->id; - - /* Setup Message Buffer format. */ - if (kFLEXCAN_FrameFormatExtend == pRxMbConfig->format) - { - cs_temp |= CAN_CS_IDE_MASK; - } - - /* Setup Message Buffer type. */ - if (kFLEXCAN_FrameTypeRemote == pRxMbConfig->type) - { - cs_temp |= CAN_CS_RTR_MASK; - } - - /* Activate Rx Message Buffer. */ - cs_temp |= CAN_CS_CODE(kFLEXCAN_RxMbEmpty); - mbAddr[offset] = cs_temp; - } -} -#endif - -/*! - * brief Configures the FlexCAN Legacy Rx FIFO. - * - * This function configures the FlexCAN Rx FIFO with given configuration. - * note Legacy Rx FIFO only can receive classic CAN message. - * - * param base FlexCAN peripheral base address. - * param pRxFifoConfig Pointer to the FlexCAN Legacy Rx FIFO configuration structure. Can be NULL when enable parameter - * is false. - * param enable Enable/disable Legacy Rx FIFO. - * - true: Enable Legacy Rx FIFO. - * - false: Disable Legacy Rx FIFO. - */ -void FLEXCAN_SetRxFifoConfig(CAN_Type *base, const flexcan_rx_fifo_config_t *pRxFifoConfig, bool enable) -{ - /* Assertion. */ - assert((NULL != pRxFifoConfig) || (false == enable)); - - volatile uint32_t *mbAddr; - uint8_t i, j, k, rffn = 0, numMbOccupy; - uint32_t setup_mb = 0; - - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - - if (enable) - { - assert(pRxFifoConfig->idFilterNum <= 128U); -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - /* Legacy Rx FIFO and Enhanced Rx FIFO cannot be enabled at the same time. */ - assert((base->ERFCR & CAN_ERFCR_ERFEN_MASK) == 0U); -#endif - - /* Get the setup_mb value. */ - setup_mb = (uint8_t)((base->MCR & CAN_MCR_MAXMB_MASK) >> CAN_MCR_MAXMB_SHIFT); - setup_mb = (setup_mb < (uint32_t)FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(base)) ? - setup_mb : - (uint32_t)FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(base); - - /* Determine RFFN value. */ - for (i = 0; i <= 0xFU; i++) - { - if ((8U * (i + 1U)) >= pRxFifoConfig->idFilterNum) - { - rffn = i; - assert(((setup_mb - 8U) - (2U * rffn)) > 0U); - - base->CTRL2 = (base->CTRL2 & ~CAN_CTRL2_RFFN_MASK) | CAN_CTRL2_RFFN(rffn); - break; - } - } - - /* caculate the Number of Mailboxes occupied by RX Legacy FIFO and the filter. */ - numMbOccupy = 6U + (rffn + 1U) * 2U; - - /* Copy ID filter table to Message Buffer Region (Fix MISRA_C-2012 Rule 18.1). */ - j = 0U; - for (i = 6U; i < numMbOccupy; i++) - { - /* Get address for current mail box. */ - mbAddr = &(base->MB[i].CS); - - /* One Mail box contain 4U DWORD registers. */ - for (k = 0; k < 4U; k++) - { - /* Fill all valid filter in the mail box occupied by filter. - * Disable unused Rx FIFO Filter, the other rest of register in the last Mail box occupied by fiter set - * as 0xffffffff. - */ - mbAddr[k] = (j < pRxFifoConfig->idFilterNum) ? (pRxFifoConfig->idFilterTable[j]) : 0xFFFFFFFFU; - - /* Try to fill next filter in current Mail Box. */ - j++; - } - } - - /* Setup ID Fitlter Type. */ - switch (pRxFifoConfig->idFilterType) - { - case kFLEXCAN_RxFifoFilterTypeA: - base->MCR = (base->MCR & ~CAN_MCR_IDAM_MASK) | CAN_MCR_IDAM(0x0); - break; - case kFLEXCAN_RxFifoFilterTypeB: - base->MCR = (base->MCR & ~CAN_MCR_IDAM_MASK) | CAN_MCR_IDAM(0x1); - break; - case kFLEXCAN_RxFifoFilterTypeC: - base->MCR = (base->MCR & ~CAN_MCR_IDAM_MASK) | CAN_MCR_IDAM(0x2); - break; - case kFLEXCAN_RxFifoFilterTypeD: - /* All frames rejected. */ - base->MCR = (base->MCR & ~CAN_MCR_IDAM_MASK) | CAN_MCR_IDAM(0x3); - break; - default: - /* All the cases have been listed above, the default clause should not be reached. */ - assert(false); - break; - } - - /* Setting Message Reception Priority. */ - base->CTRL2 = (pRxFifoConfig->priority == kFLEXCAN_RxFifoPrioHigh) ? (base->CTRL2 & ~CAN_CTRL2_MRP_MASK) : - (base->CTRL2 | CAN_CTRL2_MRP_MASK); - - /* Enable Rx Message FIFO. */ - base->MCR |= CAN_MCR_RFEN_MASK; - } - else - { - rffn = (uint8_t)((base->CTRL2 & CAN_CTRL2_RFFN_MASK) >> CAN_CTRL2_RFFN_SHIFT); - /* caculate the Number of Mailboxes occupied by RX Legacy FIFO and the filter. */ - numMbOccupy = 6U + (rffn + 1U) * 2U; - - /* Disable Rx Message FIFO. */ - base->MCR &= ~CAN_MCR_RFEN_MASK; - - /* Clean MB0 ~ MB5 and all MB occupied by ID filters (Fix MISRA_C-2012 Rule 18.1). */ - - for (i = 0; i < numMbOccupy; i++) - { - FLEXCAN_SetRxMbConfig(base, i, NULL, false); - } - } - - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * brief Configures the FlexCAN Enhanced Rx FIFO. - * - * This function configures the Enhanced Rx FIFO with given configuration. - * note Enhanced Rx FIFO support receive classic CAN or CAN FD messages, Legacy Rx FIFO and Enhanced Rx FIFO - * cannot be enabled at the same time. - * - * param base FlexCAN peripheral base address. - * param pConfig Pointer to the FlexCAN Enhanced Rx FIFO configuration structure. Can be NULL when enable parameter - * is false. - * param enable Enable/disable Enhanced Rx FIFO. - * - true: Enable Enhanced Rx FIFO. - * - false: Disable Enhanced Rx FIFO. - */ -void FLEXCAN_SetEnhancedRxFifoConfig(CAN_Type *base, const flexcan_enhanced_rx_fifo_config_t *pConfig, bool enable) -{ - /* Assertion. */ - assert((NULL != pConfig) || (false == enable)); - uint32_t i; - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - - if (enable) - { - /* Each pair of filter elements occupies 2 words and can consist of one extended ID filter element or two - * standard ID filter elements. */ - assert((((uint32_t)pConfig->idFilterPairNum * 2UL) < - (uint32_t)FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO_FILTER_MAX_NUMBER) && - (pConfig->extendIdFilterNum <= pConfig->idFilterPairNum) && (0UL != pConfig->idFilterPairNum)); - - /* The Enhanced Rx FIFO Watermark cannot be greater than the enhanced Rx FIFO size. */ - assert(pConfig->fifoWatermark < (uint32_t)FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO_SIZE); - - /* Legacy Rx FIFO and Enhanced Rx FIFO cannot be enabled at the same time. */ - assert((base->MCR & CAN_MCR_RFEN_MASK) == 0U); - - /* Reset Enhanced Rx FIFO engine and clear flags. */ - base->ERFSR |= CAN_ERFSR_ERFCLR_MASK | CAN_ERFSR_ERFUFW_MASK | CAN_ERFSR_ERFOVF_MASK | CAN_ERFSR_ERFWMI_MASK | - CAN_ERFSR_ERFDA_MASK; - /* Setting Enhanced Rx FIFO. */ - base->ERFCR = CAN_ERFCR_DMALW(pConfig->dmaPerReadLength) | CAN_ERFCR_NEXIF(pConfig->extendIdFilterNum) | - CAN_ERFCR_NFE((uint32_t)pConfig->idFilterPairNum - 1UL) | CAN_ERFCR_ERFWM(pConfig->fifoWatermark); - /* Copy ID filter table to Enhanced Rx FIFO Filter Element registers. */ - for (i = 0; i < (uint32_t)FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO_FILTER_MAX_NUMBER; i++) - { - base->ERFFEL[i] = (i < ((uint32_t)pConfig->idFilterPairNum * 2U)) ? pConfig->idFilterTable[i] : 0xFFFFFFFFU; - } - - /* Setting Message Reception Priority. */ - base->CTRL2 = (pConfig->priority == kFLEXCAN_RxFifoPrioHigh) ? (base->CTRL2 & ~CAN_CTRL2_MRP_MASK) : - (base->CTRL2 | CAN_CTRL2_MRP_MASK); - /* Enable Enhanced Rx FIFO. */ - base->ERFCR |= CAN_ERFCR_ERFEN_MASK; - } - else - { - /* Disable Enhanced Rx FIFO. */ - base->ERFCR = 0U; - /* Reset Enhanced Rx FIFO engine and clear flags. */ - base->ERFSR |= CAN_ERFSR_ERFCLR_MASK | CAN_ERFSR_ERFUFW_MASK | CAN_ERFSR_ERFOVF_MASK | CAN_ERFSR_ERFWMI_MASK | - CAN_ERFSR_ERFDA_MASK; - /* Clean all Enhanced Rx FIFO Filter Element registers. */ - for (i = 0; i < (uint32_t)FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO_FILTER_MAX_NUMBER; i++) - { - base->ERFFEL[i] = 0xFFFFFFFFU; - } - } - - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); -} -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_RX_FIFO_DMA) && FSL_FEATURE_FLEXCAN_HAS_RX_FIFO_DMA) -/*! - * brief Enables or disables the FlexCAN Legacy/Enhanced Rx FIFO DMA request. - * - * This function enables or disables the DMA feature of FlexCAN build-in Rx FIFO. - * - * param base FlexCAN peripheral base address. - * param enable true to enable, false to disable. - */ -void FLEXCAN_EnableRxFifoDMA(CAN_Type *base, bool enable) -{ - if (enable) - { - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - - /* Enable FlexCAN DMA. */ - base->MCR |= CAN_MCR_DMA_MASK; - - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); - } - else - { - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - - /* Disable FlexCAN DMA. */ - base->MCR &= ~CAN_MCR_DMA_MASK; - - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); - } -} -#endif /* FSL_FEATURE_FLEXCAN_HAS_RX_FIFO_DMA */ - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -/*! - * brief Gets the FlexCAN Memory Error Report registers status. - * - * This function gets the FlexCAN Memory Error Report registers status. - * - * param base FlexCAN peripheral base address. - * param errorStatus Pointer to FlexCAN Memory Error Report registers status structure. - */ -void FLEXCAN_GetMemoryErrorReportStatus(CAN_Type *base, flexcan_memory_error_report_status_t *errorStatus) -{ - uint32_t temp; - /* Disable updates of the error report registers. */ - base->MECR |= CAN_MECR_RERRDIS_MASK; - - errorStatus->accessAddress = (uint16_t)(base->RERRAR & CAN_RERRAR_ERRADDR_MASK); - errorStatus->errorData = base->RERRDR; - errorStatus->errorType = - (base->RERRAR & CAN_RERRAR_NCE_MASK) == 0U ? kFLEXCAN_CorrectableError : kFLEXCAN_NonCorrectableError; - - temp = (base->RERRAR & CAN_RERRAR_SAID_MASK) >> CAN_RERRAR_SAID_SHIFT; - switch (temp) - { - case (uint32_t)kFLEXCAN_MoveOutFlexCanAccess: - case (uint32_t)kFLEXCAN_MoveInAccess: - case (uint32_t)kFLEXCAN_TxArbitrationAccess: - case (uint32_t)kFLEXCAN_RxMatchingAccess: - case (uint32_t)kFLEXCAN_MoveOutHostAccess: - errorStatus->accessType = (flexcan_memory_access_type_t)temp; - break; - default: - assert(false); - break; - } - - for (uint32_t i = 0; i < 4U; i++) - { - temp = (base->RERRSYNR & ((uint32_t)CAN_RERRSYNR_SYND0_MASK << (i * 8U))) >> (i * 8U); - errorStatus->byteStatus[i].byteIsRead = (base->RERRSYNR & ((uint32_t)CAN_RERRSYNR_BE0_MASK << (i * 8U))) != 0U; - switch (temp) - { - case CAN_RERRSYNR_SYND0(kFLEXCAN_NoError): - case CAN_RERRSYNR_SYND0(kFLEXCAN_ParityBits0Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_ParityBits1Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_ParityBits2Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_ParityBits3Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_ParityBits4Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_DataBits0Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_DataBits1Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_DataBits2Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_DataBits3Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_DataBits4Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_DataBits5Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_DataBits6Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_DataBits7Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_AllZeroError): - case CAN_RERRSYNR_SYND0(kFLEXCAN_AllOneError): - errorStatus->byteStatus[i].bitAffected = (flexcan_byte_error_syndrome_t)temp; - break; - default: - errorStatus->byteStatus[i].bitAffected = kFLEXCAN_NonCorrectableErrors; - break; - } - } - - /* Re-enable updates of the error report registers. */ - base->MECR &= CAN_MECR_RERRDIS_MASK; -} -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_6032) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_6032) -/*! - * FlexCAN: A frame with wrong ID or payload is transmitted into - * the CAN bus when the Message Buffer under transmission is - * either aborted or deactivated while the CAN bus is in the Bus Idle state - * - * This function to do workaround for ERR006032 - * - * param base FlexCAN peripheral base address. - * param mbIdx The FlexCAN Message Buffer index. - */ -static void FLEXCAN_ERRATA_6032(CAN_Type *base, volatile uint32_t *mbCSAddr) -{ - uint32_t dbg_temp = 0U; - uint32_t u32TempCS = 0U; - uint32_t u32Timeout = DELAY_BUSIDLE; - /*disable ALL interrupts to prevent any context switching*/ - uint32_t irqMask = DisableGlobalIRQ(); - dbg_temp = (uint32_t)(base->DBG1); - switch (dbg_temp & CAN_DBG1_CFSM_MASK) - { - case RXINTERMISSION: - if (CBN_VALUE3 == (dbg_temp & CAN_DBG1_CBN_MASK)) - { - /*wait until CFSM is different from RXINTERMISSION */ - while (RXINTERMISSION == (base->DBG1 & CAN_DBG1_CFSM_MASK)) - { - __NOP(); - } - } - break; - case TXINTERMISSION: - if (CBN_VALUE3 == (dbg_temp & CAN_DBG1_CBN_MASK)) - { - /*wait until CFSM is different from TXINTERMISSION*/ - while (TXINTERMISSION == (base->DBG1 & CAN_DBG1_CFSM_MASK)) - { - __NOP(); - } - } - break; - default: - /* To avoid MISRA-C 2012 rule 16.4 issue. */ - break; - } - /*Anyway, BUSIDLE need to delay*/ - if (BUSIDLE == (base->DBG1 & CAN_DBG1_CFSM_MASK)) - { - while (u32Timeout-- > 0U) - { - __NOP(); - } - - /*Write 0x0 into Code field of CS word.*/ - u32TempCS = (uint32_t)(*mbCSAddr); - u32TempCS &= ~CAN_CS_CODE_MASK; - *mbCSAddr = u32TempCS; - } - /*restore interruption*/ - EnableGlobalIRQ(irqMask); -} -#endif - -/*! - * brief Writes a FlexCAN Message to the Transmit Message Buffer. - * - * This function writes a CAN Message to the specified Transmit Message Buffer - * and changes the Message Buffer state to start CAN Message transmit. After - * that the function returns immediately. - * - * param base FlexCAN peripheral base address. - * param mbIdx The FlexCAN Message Buffer index. - * param pTxFrame Pointer to CAN message frame to be sent. - * retval kStatus_Success - Write Tx Message Buffer Successfully. - * retval kStatus_Fail - Tx Message Buffer is currently in use. - */ -status_t FLEXCAN_WriteTxMb(CAN_Type *base, uint8_t mbIdx, const flexcan_frame_t *pTxFrame) -{ - /* Assertion. */ - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); - assert(NULL != pTxFrame); - assert(pTxFrame->length <= 8U); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - uint32_t cs_temp = 0; - status_t status; - - /* Check if Message Buffer is available. */ - if (CAN_CS_CODE(kFLEXCAN_TxMbDataOrRemote) != (base->MB[mbIdx].CS & CAN_CS_CODE_MASK)) - { -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_6032) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_6032) - FLEXCAN_ERRATA_6032(base, &(base->MB[mbIdx].CS)); -#endif - /* Inactive Tx Message Buffer. */ - base->MB[mbIdx].CS = (base->MB[mbIdx].CS & ~CAN_CS_CODE_MASK) | CAN_CS_CODE(kFLEXCAN_TxMbInactive); - - /* Fill Message ID field. */ - base->MB[mbIdx].ID = pTxFrame->id; - - /* Fill Message Format field. */ - if ((uint32_t)kFLEXCAN_FrameFormatExtend == pTxFrame->format) - { - cs_temp |= CAN_CS_SRR_MASK | CAN_CS_IDE_MASK; - } - - /* Fill Message Type field. */ - if ((uint32_t)kFLEXCAN_FrameTypeRemote == pTxFrame->type) - { - cs_temp |= CAN_CS_RTR_MASK; - } - - cs_temp |= CAN_CS_CODE(kFLEXCAN_TxMbDataOrRemote) | CAN_CS_DLC(pTxFrame->length); - - /* Load Message Payload. */ - base->MB[mbIdx].WORD0 = pTxFrame->dataWord0; - base->MB[mbIdx].WORD1 = pTxFrame->dataWord1; - - /* Activate Tx Message Buffer. */ - base->MB[mbIdx].CS = cs_temp; - -#if ((defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829)) - base->MB[FLEXCAN_GetFirstValidMb(base)].CS = CAN_CS_CODE(kFLEXCAN_TxMbInactive); - base->MB[FLEXCAN_GetFirstValidMb(base)].CS = CAN_CS_CODE(kFLEXCAN_TxMbInactive); -#endif - - status = kStatus_Success; - } - else - { - /* Tx Message Buffer is activated, return immediately. */ - status = kStatus_Fail; - } - - return status; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * brief Writes a FlexCAN FD Message to the Transmit Message Buffer. - * - * This function writes a CAN FD Message to the specified Transmit Message Buffer - * and changes the Message Buffer state to start CAN FD Message transmit. After - * that the function returns immediately. - * - * param base FlexCAN peripheral base address. - * param mbIdx The FlexCAN FD Message Buffer index. - * param pTxFrame Pointer to CAN FD message frame to be sent. - * retval kStatus_Success - Write Tx Message Buffer Successfully. - * retval kStatus_Fail - Tx Message Buffer is currently in use. - */ -status_t FLEXCAN_WriteFDTxMb(CAN_Type *base, uint8_t mbIdx, const flexcan_fd_frame_t *pTxFrame) -{ - /* Assertion. */ - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); - assert(NULL != pTxFrame); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - status_t status; - uint32_t cs_temp = 0; - uint8_t cnt = 0; - uint32_t can_cs = 0; - uint8_t payload_dword = 1; - uint32_t dataSize = (base->FDCTRL & CAN_FDCTRL_MBDSR0_MASK) >> CAN_FDCTRL_MBDSR0_SHIFT; -#if ((defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829)) - uint32_t availoffset = FLEXCAN_GetFDMailboxOffset(base, FLEXCAN_GetFirstValidMb(base)); -#endif - volatile uint32_t *mbAddr = &(base->MB[0].CS); - uint32_t offset = FLEXCAN_GetFDMailboxOffset(base, mbIdx); - - can_cs = mbAddr[offset]; - /* Check if Message Buffer is available. */ - if (CAN_CS_CODE(kFLEXCAN_TxMbDataOrRemote) != (can_cs & CAN_CS_CODE_MASK)) - { -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_6032) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_6032) - FLEXCAN_ERRATA_6032(base, &(mbAddr[offset])); -#endif - /* Inactive Tx Message Buffer and Fill Message ID field. */ - mbAddr[offset] = (can_cs & ~CAN_CS_CODE_MASK) | CAN_CS_CODE(kFLEXCAN_TxMbInactive); - mbAddr[offset + 1U] = pTxFrame->id; - - /* Fill Message Format field. */ - if ((uint32_t)kFLEXCAN_FrameFormatExtend == pTxFrame->format) - { - cs_temp |= CAN_CS_SRR_MASK | CAN_CS_IDE_MASK; - } - - /* Fill Message Type field. */ - if ((uint32_t)kFLEXCAN_FrameTypeRemote == pTxFrame->type) - { - cs_temp |= CAN_CS_RTR_MASK; - } - - cs_temp |= CAN_CS_CODE(kFLEXCAN_TxMbDataOrRemote) | CAN_CS_DLC(pTxFrame->length) | CAN_CS_EDL(pTxFrame->edl) | - CAN_CS_BRS(pTxFrame->brs); - - /* Calculate the DWORD number, dataSize 0/1/2/3 corresponds to 8/16/32/64 - Bytes payload. */ - for (cnt = 0; cnt < (dataSize + 1U); cnt++) - { - payload_dword *= 2U; - } - - /* Load Message Payload and Activate Tx Message Buffer. */ - for (cnt = 0; cnt < payload_dword; cnt++) - { - mbAddr[offset + 2U + cnt] = pTxFrame->dataWord[cnt]; - } - mbAddr[offset] = cs_temp; - -#if ((defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829)) - mbAddr[availoffset] = CAN_CS_CODE(kFLEXCAN_TxMbInactive); - mbAddr[availoffset] = CAN_CS_CODE(kFLEXCAN_TxMbInactive); -#endif - - status = kStatus_Success; - } - else - { - /* Tx Message Buffer is activated, return immediately. */ - status = kStatus_Fail; - } - - return status; -} -#endif - -/*! - * brief Reads a FlexCAN Message from Receive Message Buffer. - * - * This function reads a CAN message from a specified Receive Message Buffer. - * The function fills a receive CAN message frame structure with - * just received data and activates the Message Buffer again. - * The function returns immediately. - * - * param base FlexCAN peripheral base address. - * param mbIdx The FlexCAN Message Buffer index. - * param pRxFrame Pointer to CAN message frame structure for reception. - * retval kStatus_Success - Rx Message Buffer is full and has been read successfully. - * retval kStatus_FLEXCAN_RxOverflow - Rx Message Buffer is already overflowed and has been read successfully. - * retval kStatus_Fail - Rx Message Buffer is empty. - */ -status_t FLEXCAN_ReadRxMb(CAN_Type *base, uint8_t mbIdx, flexcan_frame_t *pRxFrame) -{ - /* Assertion. */ - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); - assert(NULL != pRxFrame); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - uint32_t cs_temp; - uint32_t rx_code; - status_t status; - - /* Read CS field of Rx Message Buffer to lock Message Buffer. */ - cs_temp = base->MB[mbIdx].CS; - /* Get Rx Message Buffer Code field. */ - rx_code = (cs_temp & CAN_CS_CODE_MASK) >> CAN_CS_CODE_SHIFT; - - /* Check to see if Rx Message Buffer is full. */ - if (((uint32_t)kFLEXCAN_RxMbFull == rx_code) || ((uint32_t)kFLEXCAN_RxMbOverrun == rx_code)) - { - /* Store Message ID. */ - pRxFrame->id = base->MB[mbIdx].ID & (CAN_ID_EXT_MASK | CAN_ID_STD_MASK); - - /* Get the message ID and format. */ - pRxFrame->format = (cs_temp & CAN_CS_IDE_MASK) != 0U ? (uint8_t)kFLEXCAN_FrameFormatExtend : - (uint8_t)kFLEXCAN_FrameFormatStandard; - - /* Get the message type. */ - pRxFrame->type = - (cs_temp & CAN_CS_RTR_MASK) != 0U ? (uint8_t)kFLEXCAN_FrameTypeRemote : (uint8_t)kFLEXCAN_FrameTypeData; - - /* Get the message length. */ - pRxFrame->length = (uint8_t)((cs_temp & CAN_CS_DLC_MASK) >> CAN_CS_DLC_SHIFT); - - /* Get the time stamp. */ - pRxFrame->timestamp = (uint16_t)((cs_temp & CAN_CS_TIME_STAMP_MASK) >> CAN_CS_TIME_STAMP_SHIFT); - - /* Store Message Payload. */ - pRxFrame->dataWord0 = base->MB[mbIdx].WORD0; - pRxFrame->dataWord1 = base->MB[mbIdx].WORD1; - - /* Read free-running timer to unlock Rx Message Buffer. */ - (void)base->TIMER; - - if ((uint32_t)kFLEXCAN_RxMbFull == rx_code) - { - status = kStatus_Success; - } - else - { - status = kStatus_FLEXCAN_RxOverflow; - } - } - else - { - /* Read free-running timer to unlock Rx Message Buffer. */ - (void)base->TIMER; - - status = kStatus_Fail; - } - - return status; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * brief Reads a FlexCAN FD Message from Receive Message Buffer. - * - * This function reads a CAN FD message from a specified Receive Message Buffer. - * The function fills a receive CAN FD message frame structure with - * just received data and activates the Message Buffer again. - * The function returns immediately. - * - * param base FlexCAN peripheral base address. - * param mbIdx The FlexCAN FD Message Buffer index. - * param pRxFrame Pointer to CAN FD message frame structure for reception. - * retval kStatus_Success - Rx Message Buffer is full and has been read successfully. - * retval kStatus_FLEXCAN_RxOverflow - Rx Message Buffer is already overflowed and has been read successfully. - * retval kStatus_Fail - Rx Message Buffer is empty. - */ -status_t FLEXCAN_ReadFDRxMb(CAN_Type *base, uint8_t mbIdx, flexcan_fd_frame_t *pRxFrame) -{ - /* Assertion. */ - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); - assert(NULL != pRxFrame); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - status_t status; - uint32_t cs_temp; - uint8_t rx_code; - uint8_t cnt = 0; - uint32_t can_id = 0; - uint32_t dataSize; - dataSize = (base->FDCTRL & CAN_FDCTRL_MBDSR0_MASK) >> CAN_FDCTRL_MBDSR0_SHIFT; - uint8_t payload_dword = 1; - volatile uint32_t *mbAddr = &(base->MB[0].CS); - uint32_t offset = FLEXCAN_GetFDMailboxOffset(base, mbIdx); - - /* Read CS field of Rx Message Buffer to lock Message Buffer. */ - cs_temp = mbAddr[offset]; - can_id = mbAddr[offset + 1U]; - - /* Get Rx Message Buffer Code field. */ - rx_code = (uint8_t)((cs_temp & CAN_CS_CODE_MASK) >> CAN_CS_CODE_SHIFT); - - /* Check to see if Rx Message Buffer is full. */ - if (((uint8_t)kFLEXCAN_RxMbFull == rx_code) || ((uint8_t)kFLEXCAN_RxMbOverrun == rx_code)) - { - /* Store Message ID. */ - pRxFrame->id = can_id & (CAN_ID_EXT_MASK | CAN_ID_STD_MASK); - - /* Get the message ID and format. */ - pRxFrame->format = (cs_temp & CAN_CS_IDE_MASK) != 0U ? (uint8_t)kFLEXCAN_FrameFormatExtend : - (uint8_t)kFLEXCAN_FrameFormatStandard; - - /* Get Bit Rate Switch flag. */ - pRxFrame->brs = (cs_temp & CAN_CS_BRS_MASK) != 0U ? 1U : 0U; - - /* Get Extended Data Length flag. */ - pRxFrame->edl = (cs_temp & CAN_CS_EDL_MASK) != 0U ? 1U : 0U; - - /* Get the message type. */ - pRxFrame->type = - (cs_temp & CAN_CS_RTR_MASK) != 0U ? (uint8_t)kFLEXCAN_FrameTypeRemote : (uint8_t)kFLEXCAN_FrameTypeData; - - /* Get the message length. */ - pRxFrame->length = (uint8_t)((cs_temp & CAN_CS_DLC_MASK) >> CAN_CS_DLC_SHIFT); - - /* Get the time stamp. */ - pRxFrame->timestamp = (uint16_t)((cs_temp & CAN_CS_TIME_STAMP_MASK) >> CAN_CS_TIME_STAMP_SHIFT); - - /* Calculate the DWORD number, dataSize 0/1/2/3 corresponds to 8/16/32/64 - Bytes payload. */ - for (cnt = 0; cnt < (dataSize + 1U); cnt++) - { - payload_dword *= 2U; - } - - /* Store Message Payload. */ - for (cnt = 0; cnt < payload_dword; cnt++) - { - pRxFrame->dataWord[cnt] = mbAddr[offset + 2U + cnt]; - } - - /* Read free-running timer to unlock Rx Message Buffer. */ - (void)base->TIMER; - - if ((uint32_t)kFLEXCAN_RxMbFull == rx_code) - { - status = kStatus_Success; - } - else - { - status = kStatus_FLEXCAN_RxOverflow; - } - } - else - { - /* Read free-running timer to unlock Rx Message Buffer. */ - (void)base->TIMER; - - status = kStatus_Fail; - } - - return status; -} -#endif - -/*! - * brief Reads a FlexCAN Message from Legacy Rx FIFO. - * - * This function reads a CAN message from the FlexCAN Legacy Rx FIFO. - * - * param base FlexCAN peripheral base address. - * param pRxFrame Pointer to CAN message frame structure for reception. - * retval kStatus_Success - Read Message from Rx FIFO successfully. - * retval kStatus_Fail - Rx FIFO is not enabled. - */ -status_t FLEXCAN_ReadRxFifo(CAN_Type *base, flexcan_frame_t *pRxFrame) -{ - /* Assertion. */ - assert(NULL != pRxFrame); - - uint32_t cs_temp; - status_t status; - - /* Check if Legacy Rx FIFO is Enabled. */ - if (0U != (base->MCR & CAN_MCR_RFEN_MASK)) - { - /* Read CS field of Rx Message Buffer to lock Message Buffer. */ - cs_temp = base->MB[0].CS; - - /* Read data from Rx FIFO output port. */ - /* Store Message ID. */ - pRxFrame->id = base->MB[0].ID & (CAN_ID_EXT_MASK | CAN_ID_STD_MASK); - - /* Get the message ID and format. */ - pRxFrame->format = (cs_temp & CAN_CS_IDE_MASK) != 0U ? (uint8_t)kFLEXCAN_FrameFormatExtend : - (uint8_t)kFLEXCAN_FrameFormatStandard; - - /* Get the message type. */ - pRxFrame->type = - (cs_temp & CAN_CS_RTR_MASK) != 0U ? (uint8_t)kFLEXCAN_FrameTypeRemote : (uint8_t)kFLEXCAN_FrameTypeData; - - /* Get the message length. */ - pRxFrame->length = (uint8_t)((cs_temp & CAN_CS_DLC_MASK) >> CAN_CS_DLC_SHIFT); - - /* Get the time stamp. */ - pRxFrame->timestamp = (uint16_t)((cs_temp & CAN_CS_TIME_STAMP_MASK) >> CAN_CS_TIME_STAMP_SHIFT); - - /* Store Message Payload. */ - pRxFrame->dataWord0 = base->MB[0].WORD0; - pRxFrame->dataWord1 = base->MB[0].WORD1; - - /* Store ID Filter Hit Index. */ - pRxFrame->idhit = (uint16_t)(base->RXFIR & CAN_RXFIR_IDHIT_MASK); - - /* Read free-running timer to unlock Rx Message Buffer. */ - (void)base->TIMER; - - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * brief Reads a FlexCAN Message from Enhanced Rx FIFO. - * - * This function reads a CAN or CAN FD message from the FlexCAN Enhanced Rx FIFO. - * - * param base FlexCAN peripheral base address. - * param pRxFrame Pointer to CAN FD message frame structure for reception. - * retval kStatus_Success - Read Message from Rx FIFO successfully. - * retval kStatus_Fail - Rx FIFO is not enabled. - */ -status_t FLEXCAN_ReadEnhancedRxFifo(CAN_Type *base, flexcan_fd_frame_t *pRxFrame) -{ - /* Assertion. */ - assert(NULL != pRxFrame); - - status_t status; - uint32_t idHitOff; - - /* Check if Enhanced Rx FIFO is Enabled. */ - if (0U != (base->ERFCR & CAN_ERFCR_ERFEN_MASK)) - { - /* Enhanced Rx FIFO ID HIT offset is changed dynamically according to data length code (DLC) . */ - idHitOff = (DLC_LENGTH_DECODE(((flexcan_fd_frame_t *)E_RX_FIFO(base))->length) + 3U) / 4U + 3U; - /* Copy CAN FD Message from Enhanced Rx FIFO, should use the DLC value to identify the bytes that belong to the - * message which is being read. */ - (void)memcpy((void *)pRxFrame, (void *)(uint32_t *)E_RX_FIFO(base), sizeof(uint32_t) * idHitOff); - pRxFrame->idhit = pRxFrame->dataWord[idHitOff - 3U]; - /* Clear the unused frame data. */ - for (uint32_t i = (idHitOff - 3U); i < 16U; i++) - { - pRxFrame->dataWord[i] = 0x0; - } - - /* Clear data available flag to let FlexCAN know one frame has been read from the Enhanced Rx FIFO. */ - base->ERFSR = CAN_ERFSR_ERFDA_MASK; - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} -#endif - -/*! - * brief Performs a polling send transaction on the CAN bus. - * - * note A transfer handle does not need to be created before calling this API. - * - * param base FlexCAN peripheral base pointer. - * param mbIdx The FlexCAN Message Buffer index. - * param pTxFrame Pointer to CAN message frame to be sent. - * retval kStatus_Success - Write Tx Message Buffer Successfully. - * retval kStatus_Fail - Tx Message Buffer is currently in use. - */ -status_t FLEXCAN_TransferSendBlocking(CAN_Type *base, uint8_t mbIdx, flexcan_frame_t *pTxFrame) -{ - status_t status; - - /* Write Tx Message Buffer to initiate a data sending. */ - if (kStatus_Success == FLEXCAN_WriteTxMb(base, mbIdx, (const flexcan_frame_t *)(uintptr_t)pTxFrame)) - { - /* Wait until CAN Message send out. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (mbIdx >= 64U) - { - while (0U == FLEXCAN_GetHigh64MbStatusFlags(base, (uint64_t)1U << (mbIdx - 64U))) - { - } - FLEXCAN_ClearHigh64MbStatusFlags(base, (uint64_t)1U << (mbIdx - 64U)); - } - else - { - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint64_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint64_t)1U << mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER) && FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER) - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint64_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint64_t)1U << mbIdx); -#else - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint32_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint32_t)1U << mbIdx); -#endif - - /*After TX MB tranfered success, update the Timestamp from MB[mbIdx].CS register*/ - pTxFrame->timestamp = (uint16_t)((base->MB[mbIdx].CS & CAN_CS_TIME_STAMP_MASK) >> CAN_CS_TIME_STAMP_SHIFT); - - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -/*! - * brief Performs a polling receive transaction on the CAN bus. - * - * note A transfer handle does not need to be created before calling this API. - * - * param base FlexCAN peripheral base pointer. - * param mbIdx The FlexCAN Message Buffer index. - * param pRxFrame Pointer to CAN message frame structure for reception. - * retval kStatus_Success - Rx Message Buffer is full and has been read successfully. - * retval kStatus_FLEXCAN_RxOverflow - Rx Message Buffer is already overflowed and has been read successfully. - * retval kStatus_Fail - Rx Message Buffer is empty. - */ -status_t FLEXCAN_TransferReceiveBlocking(CAN_Type *base, uint8_t mbIdx, flexcan_frame_t *pRxFrame) -{ -/* Wait until Rx Message Buffer non-empty. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (mbIdx >= 64U) - { - while (0U == FLEXCAN_GetHigh64MbStatusFlags(base, (uint64_t)1U << (mbIdx - 64U))) - { - } - FLEXCAN_ClearHigh64MbStatusFlags(base, (uint64_t)1U << (mbIdx - 64U)); - } - else - { - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint64_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint64_t)1U << mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER) && FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER) - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint64_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint64_t)1U << mbIdx); -#else - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint32_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint32_t)1U << mbIdx); -#endif - - /* Read Received CAN Message. */ - return FLEXCAN_ReadRxMb(base, mbIdx, pRxFrame); -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * brief Performs a polling send transaction on the CAN bus. - * - * note A transfer handle does not need to be created before calling this API. - * - * param base FlexCAN peripheral base pointer. - * param mbIdx The FlexCAN FD Message Buffer index. - * param pTxFrame Pointer to CAN FD message frame to be sent. - * retval kStatus_Success - Write Tx Message Buffer Successfully. - * retval kStatus_Fail - Tx Message Buffer is currently in use. - */ -status_t FLEXCAN_TransferFDSendBlocking(CAN_Type *base, uint8_t mbIdx, flexcan_fd_frame_t *pTxFrame) -{ - status_t status; - - /* Write Tx Message Buffer to initiate a data sending. */ - if (kStatus_Success == FLEXCAN_WriteFDTxMb(base, mbIdx, (const flexcan_fd_frame_t *)(uintptr_t)pTxFrame)) - { - /* Wait until CAN Message send out. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (mbIdx >= 64U) - { - while (0U == FLEXCAN_GetHigh64MbStatusFlags(base, (uint64_t)1U << (mbIdx - 64U))) - { - } - FLEXCAN_ClearHigh64MbStatusFlags(base, (uint64_t)1U << (mbIdx - 64U)); - } - else - { - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint64_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint64_t)1U << mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER) && FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER) - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint64_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint64_t)1U << mbIdx); -#else - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint32_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint32_t)1U << mbIdx); -#endif - /*After TX MB tranfered success, update the Timestamp from base->MB[offset for CAN FD].CS register*/ - volatile uint32_t *mbAddr = &(base->MB[0].CS); - uint32_t offset = FLEXCAN_GetFDMailboxOffset(base, mbIdx); - pTxFrame->timestamp = (uint16_t)((mbAddr[offset] & CAN_CS_TIME_STAMP_MASK) >> CAN_CS_TIME_STAMP_SHIFT); - - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -/*! - * brief Performs a polling receive transaction on the CAN bus. - * - * note A transfer handle does not need to be created before calling this API. - * - * param base FlexCAN peripheral base pointer. - * param mbIdx The FlexCAN FD Message Buffer index. - * param pRxFrame Pointer to CAN FD message frame structure for reception. - * retval kStatus_Success - Rx Message Buffer is full and has been read successfully. - * retval kStatus_FLEXCAN_RxOverflow - Rx Message Buffer is already overflowed and has been read successfully. - * retval kStatus_Fail - Rx Message Buffer is empty. - */ -status_t FLEXCAN_TransferFDReceiveBlocking(CAN_Type *base, uint8_t mbIdx, flexcan_fd_frame_t *pRxFrame) -{ -/* Wait until Rx Message Buffer non-empty. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (mbIdx >= 64U) - { - while (0U == FLEXCAN_GetHigh64MbStatusFlags(base, (uint64_t)1U << (mbIdx - 64U))) - { - } - FLEXCAN_ClearHigh64MbStatusFlags(base, (uint64_t)1U << (mbIdx - 64U)); - } - else - { - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint64_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint64_t)1U << mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER) && FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER) - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint64_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint64_t)1U << mbIdx); -#else - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint32_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint32_t)1U << mbIdx); -#endif - - /* Read Received CAN Message. */ - return FLEXCAN_ReadFDRxMb(base, mbIdx, pRxFrame); -} -#endif - -/*! - * brief Performs a polling receive transaction from Legacy Rx FIFO on the CAN bus. - * - * note A transfer handle does not need to be created before calling this API. - * - * param base FlexCAN peripheral base pointer. - * param pRxFrame Pointer to CAN message frame structure for reception. - * retval kStatus_Success - Read Message from Rx FIFO successfully. - * retval kStatus_Fail - Rx FIFO is not enabled. - */ -status_t FLEXCAN_TransferReceiveFifoBlocking(CAN_Type *base, flexcan_frame_t *pRxFrame) -{ - status_t rxFifoStatus; - - /* Wait until Legacy Rx FIFO non-empty. */ - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint32_t)kFLEXCAN_RxFifoFrameAvlFlag)) - { - } - - /* Read data from Legacy Rx FIFO. */ - rxFifoStatus = FLEXCAN_ReadRxFifo(base, pRxFrame); - - /* Clean Rx Fifo available flag. */ - FLEXCAN_ClearMbStatusFlags(base, (uint32_t)kFLEXCAN_RxFifoFrameAvlFlag); - - return rxFifoStatus; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * brief Performs a polling receive transaction from Enhanced Rx FIFO on the CAN bus. - * - * note A transfer handle does not need to be created before calling this API. - * - * param base FlexCAN peripheral base pointer. - * param pRxFrame Pointer to CAN FD message frame structure for reception. - * retval kStatus_Success - Read Message from Rx FIFO successfully. - * retval kStatus_Fail - Rx FIFO is not enabled. - */ -status_t FLEXCAN_TransferReceiveEnhancedFifoBlocking(CAN_Type *base, flexcan_fd_frame_t *pRxFrame) -{ - status_t rxFifoStatus; - - /* Wait until Enhanced Rx FIFO non-empty. */ - while (0U == (FLEXCAN_GetStatusFlags(base) & (uint64_t)kFLEXCAN_ERxFifoDataAvlIntFlag)) - { - } - - /* Read data from Enhanced Rx FIFO */ - rxFifoStatus = FLEXCAN_ReadEnhancedRxFifo(base, pRxFrame); - - return rxFifoStatus; -} -#endif - -/*! - * brief Initializes the FlexCAN handle. - * - * This function initializes the FlexCAN handle, which can be used for other FlexCAN - * transactional APIs. Usually, for a specified FlexCAN instance, - * call this API once to get the initialized handle. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param callback The callback function. - * param userData The parameter of the callback function. - */ -void FLEXCAN_TransferCreateHandle(CAN_Type *base, - flexcan_handle_t *handle, - flexcan_transfer_callback_t callback, - void *userData) -{ - assert(NULL != handle); - - uint8_t instance; - - /* Clean FlexCAN transfer handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Get instance from peripheral base address. */ - instance = (uint8_t)FLEXCAN_GetInstance(base); - - /* Save the context in global variables to support the double weak mechanism. */ - s_flexcanHandle[instance] = handle; - - /* Register Callback function. */ - handle->callback = callback; - handle->userData = userData; - - s_flexcanIsr = FLEXCAN_TransferHandleIRQ; - - /* We Enable Error & Status interrupt here, because this interrupt just - * report current status of FlexCAN module through Callback function. - * It is insignificance without a available callback function. - */ - if (handle->callback != NULL) - { - FLEXCAN_EnableInterrupts( - base, (uint32_t)kFLEXCAN_BusOffInterruptEnable | (uint32_t)kFLEXCAN_ErrorInterruptEnable | - (uint32_t)kFLEXCAN_RxWarningInterruptEnable | (uint32_t)kFLEXCAN_TxWarningInterruptEnable | - (uint32_t)kFLEXCAN_WakeUpInterruptEnable -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - | (uint64_t)kFLEXCAN_PNMatchWakeUpInterruptEnable | - (uint64_t)kFLEXCAN_PNTimeoutWakeUpInterruptEnable -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - | (uint64_t)kFLEXCAN_HostAccessNCErrorInterruptEnable | - (uint64_t)kFLEXCAN_FlexCanAccessNCErrorInterruptEnable | - (uint64_t)kFLEXCAN_HostOrFlexCanCErrorInterruptEnable -#endif - ); - } - else - { - FLEXCAN_DisableInterrupts( - base, (uint32_t)kFLEXCAN_BusOffInterruptEnable | (uint32_t)kFLEXCAN_ErrorInterruptEnable | - (uint32_t)kFLEXCAN_RxWarningInterruptEnable | (uint32_t)kFLEXCAN_TxWarningInterruptEnable | - (uint32_t)kFLEXCAN_WakeUpInterruptEnable -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - | (uint64_t)kFLEXCAN_PNMatchWakeUpInterruptEnable | - (uint64_t)kFLEXCAN_PNTimeoutWakeUpInterruptEnable -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - | (uint64_t)kFLEXCAN_HostAccessNCErrorInterruptEnable | - (uint64_t)kFLEXCAN_FlexCanAccessNCErrorInterruptEnable | - (uint64_t)kFLEXCAN_HostOrFlexCanCErrorInterruptEnable -#endif - ); - } - - /* Enable interrupts in NVIC. */ - (void)EnableIRQ((IRQn_Type)(s_flexcanRxWarningIRQ[instance])); - (void)EnableIRQ((IRQn_Type)(s_flexcanTxWarningIRQ[instance])); - (void)EnableIRQ((IRQn_Type)(s_flexcanWakeUpIRQ[instance])); - (void)EnableIRQ((IRQn_Type)(s_flexcanErrorIRQ[instance])); - (void)EnableIRQ((IRQn_Type)(s_flexcanBusOffIRQ[instance])); - (void)EnableIRQ((IRQn_Type)(s_flexcanMbIRQ[instance])); -} - -/*! - * brief Sends a message using IRQ. - * - * This function sends a message using IRQ. This is a non-blocking function, which returns - * right away. When messages have been sent out, the send callback function is called. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param pMbXfer FlexCAN Message Buffer transfer structure. See the #flexcan_mb_transfer_t. - * retval kStatus_Success Start Tx Message Buffer sending process successfully. - * retval kStatus_Fail Write Tx Message Buffer failed. - * retval kStatus_FLEXCAN_TxBusy Tx Message Buffer is in use. - */ -status_t FLEXCAN_TransferSendNonBlocking(CAN_Type *base, flexcan_handle_t *handle, flexcan_mb_transfer_t *pMbXfer) -{ - /* Assertion. */ - assert(NULL != handle); - assert(NULL != pMbXfer); - assert(pMbXfer->mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, pMbXfer->mbIdx)); -#endif - - status_t status; - - /* Check if Message Buffer is idle. */ - if ((uint8_t)kFLEXCAN_StateIdle == handle->mbState[pMbXfer->mbIdx]) - { - /* Distinguish transmit type. */ - if ((uint32_t)kFLEXCAN_FrameTypeRemote == pMbXfer->frame->type) - { - handle->mbState[pMbXfer->mbIdx] = (uint8_t)kFLEXCAN_StateTxRemote; - } - else - { - handle->mbState[pMbXfer->mbIdx] = (uint8_t)kFLEXCAN_StateTxData; - } - - if (kStatus_Success == - FLEXCAN_WriteTxMb(base, pMbXfer->mbIdx, (const flexcan_frame_t *)(uintptr_t)pMbXfer->frame)) - { - /* Enable Message Buffer Interrupt. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (pMbXfer->mbIdx >= 64U) - { - FLEXCAN_EnableHigh64MbInterrupts(base, (uint64_t)1U << (pMbXfer->mbIdx - 64U)); - } - else - { - FLEXCAN_EnableMbInterrupts(base, (uint64_t)1U << pMbXfer->mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - FLEXCAN_EnableMbInterrupts(base, (uint64_t)1U << pMbXfer->mbIdx); -#else - FLEXCAN_EnableMbInterrupts(base, (uint32_t)1U << pMbXfer->mbIdx); -#endif - status = kStatus_Success; - } - else - { - handle->mbState[pMbXfer->mbIdx] = (uint8_t)kFLEXCAN_StateIdle; - status = kStatus_Fail; - } - } - else - { - status = kStatus_FLEXCAN_TxBusy; - } - - return status; -} - -/*! - * brief Receives a message using IRQ. - * - * This function receives a message using IRQ. This is non-blocking function, which returns - * right away. When the message has been received, the receive callback function is called. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param pMbXfer FlexCAN Message Buffer transfer structure. See the #flexcan_mb_transfer_t. - * retval kStatus_Success - Start Rx Message Buffer receiving process successfully. - * retval kStatus_FLEXCAN_RxBusy - Rx Message Buffer is in use. - */ -status_t FLEXCAN_TransferReceiveNonBlocking(CAN_Type *base, flexcan_handle_t *handle, flexcan_mb_transfer_t *pMbXfer) -{ - status_t status; - - /* Assertion. */ - assert(NULL != handle); - assert(NULL != pMbXfer); - assert(pMbXfer->mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, pMbXfer->mbIdx)); -#endif - - /* Check if Message Buffer is idle. */ - if ((uint8_t)kFLEXCAN_StateIdle == handle->mbState[pMbXfer->mbIdx]) - { - handle->mbState[pMbXfer->mbIdx] = (uint8_t)kFLEXCAN_StateRxData; - - /* Register Message Buffer. */ - handle->mbFrameBuf[pMbXfer->mbIdx] = pMbXfer->frame; - - /* Enable Message Buffer Interrupt. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (pMbXfer->mbIdx >= 64U) - { - FLEXCAN_EnableHigh64MbInterrupts(base, (uint64_t)1U << (pMbXfer->mbIdx - 64U)); - } - else - { - FLEXCAN_EnableMbInterrupts(base, (uint64_t)1U << pMbXfer->mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - FLEXCAN_EnableMbInterrupts(base, (uint64_t)1U << pMbXfer->mbIdx); -#else - FLEXCAN_EnableMbInterrupts(base, (uint32_t)1U << pMbXfer->mbIdx); -#endif - - status = kStatus_Success; - } - else - { - status = kStatus_FLEXCAN_RxBusy; - } - - return status; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * brief Sends a message using IRQ. - * - * This function sends a message using IRQ. This is a non-blocking function, which returns - * right away. When messages have been sent out, the send callback function is called. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param pMbXfer FlexCAN FD Message Buffer transfer structure. See the #flexcan_mb_transfer_t. - * retval kStatus_Success Start Tx Message Buffer sending process successfully. - * retval kStatus_Fail Write Tx Message Buffer failed. - * retval kStatus_FLEXCAN_TxBusy Tx Message Buffer is in use. - */ -status_t FLEXCAN_TransferFDSendNonBlocking(CAN_Type *base, flexcan_handle_t *handle, flexcan_mb_transfer_t *pMbXfer) -{ - /* Assertion. */ - assert(NULL != handle); - assert(NULL != pMbXfer); - assert(pMbXfer->mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, pMbXfer->mbIdx)); -#endif - - status_t status; - - /* Check if Message Buffer is idle. */ - if ((uint8_t)kFLEXCAN_StateIdle == handle->mbState[pMbXfer->mbIdx]) - { - /* Distinguish transmit type. */ - if ((uint32_t)kFLEXCAN_FrameTypeRemote == pMbXfer->framefd->type) - { - handle->mbState[pMbXfer->mbIdx] = (uint8_t)kFLEXCAN_StateTxRemote; - } - else - { - handle->mbState[pMbXfer->mbIdx] = (uint8_t)kFLEXCAN_StateTxData; - } - - if (kStatus_Success == - FLEXCAN_WriteFDTxMb(base, pMbXfer->mbIdx, (const flexcan_fd_frame_t *)(uintptr_t)pMbXfer->framefd)) - { - /* Enable Message Buffer Interrupt. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (pMbXfer->mbIdx >= 64U) - { - FLEXCAN_EnableHigh64MbInterrupts(base, (uint64_t)1U << (pMbXfer->mbIdx - 64U)); - } - else - { - FLEXCAN_EnableMbInterrupts(base, (uint64_t)1U << pMbXfer->mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - FLEXCAN_EnableMbInterrupts(base, (uint64_t)1U << pMbXfer->mbIdx); -#else - FLEXCAN_EnableMbInterrupts(base, (uint32_t)1U << pMbXfer->mbIdx); -#endif - - status = kStatus_Success; - } - else - { - handle->mbState[pMbXfer->mbIdx] = (uint8_t)kFLEXCAN_StateIdle; - status = kStatus_Fail; - } - } - else - { - status = kStatus_FLEXCAN_TxBusy; - } - - return status; -} - -/*! - * brief Receives a message using IRQ. - * - * This function receives a message using IRQ. This is non-blocking function, which returns - * right away. When the message has been received, the receive callback function is called. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param pMbXfer FlexCAN FD Message Buffer transfer structure. See the #flexcan_mb_transfer_t. - * retval kStatus_Success - Start Rx Message Buffer receiving process successfully. - * retval kStatus_FLEXCAN_RxBusy - Rx Message Buffer is in use. - */ -status_t FLEXCAN_TransferFDReceiveNonBlocking(CAN_Type *base, flexcan_handle_t *handle, flexcan_mb_transfer_t *pMbXfer) -{ - /* Assertion. */ - assert(NULL != handle); - assert(NULL != pMbXfer); - assert(pMbXfer->mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, pMbXfer->mbIdx)); -#endif - - status_t status; - - /* Check if Message Buffer is idle. */ - if ((uint8_t)kFLEXCAN_StateIdle == handle->mbState[pMbXfer->mbIdx]) - { - handle->mbState[pMbXfer->mbIdx] = (uint8_t)kFLEXCAN_StateRxData; - - /* Register Message Buffer. */ - handle->mbFDFrameBuf[pMbXfer->mbIdx] = pMbXfer->framefd; - - /* Enable Message Buffer Interrupt. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (pMbXfer->mbIdx >= 64U) - { - FLEXCAN_EnableHigh64MbInterrupts(base, (uint64_t)1U << (pMbXfer->mbIdx - 64U)); - } - else - { - FLEXCAN_EnableMbInterrupts(base, (uint64_t)1U << pMbXfer->mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - FLEXCAN_EnableMbInterrupts(base, (uint64_t)1U << pMbXfer->mbIdx); -#else - FLEXCAN_EnableMbInterrupts(base, (uint32_t)1U << pMbXfer->mbIdx); -#endif - - status = kStatus_Success; - } - else - { - status = kStatus_FLEXCAN_RxBusy; - } - - return status; -} -#endif - -/*! - * brief Receives a message from Legacy Rx FIFO using IRQ. - * - * This function receives a message using IRQ. This is a non-blocking function, which returns - * right away. When all messages have been received, the receive callback function is called. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param pFifoXfer FlexCAN Rx FIFO transfer structure. See the ref flexcan_fifo_transfer_t. - * retval kStatus_Success - Start Rx FIFO receiving process successfully. - * retval kStatus_FLEXCAN_RxFifoBusy - Rx FIFO is currently in use. - */ -status_t FLEXCAN_TransferReceiveFifoNonBlocking(CAN_Type *base, - flexcan_handle_t *handle, - flexcan_fifo_transfer_t *pFifoXfer) -{ - /* Assertion. */ - assert(NULL != handle); - assert(NULL != pFifoXfer); - - status_t status; - uint32_t irqMask = (uint32_t)kFLEXCAN_RxFifoOverflowFlag | (uint32_t)kFLEXCAN_RxFifoWarningFlag; - - /* Check if Message Buffer is idle. */ - if ((uint8_t)kFLEXCAN_StateIdle == handle->rxFifoState) - { - handle->rxFifoState = (uint8_t)kFLEXCAN_StateRxFifo; - - /* Register Message Buffer. */ - handle->rxFifoFrameBuf = pFifoXfer->frame; - handle->rxFifoFrameNum = pFifoXfer->frameNum; - handle->rxFifoTransferTotalNum = pFifoXfer->frameNum; - - if (handle->rxFifoTransferTotalNum < 5U) - { - /* Enable data available interrupt. */ - irqMask |= (uint32_t)kFLEXCAN_RxFifoFrameAvlFlag; - } - - /* Enable Message Buffer Interrupt. */ - FLEXCAN_EnableMbInterrupts(base, irqMask); - - status = kStatus_Success; - } - else - { - status = kStatus_FLEXCAN_RxFifoBusy; - } - - return status; -} - -/*! - * brief Gets the Legacy Rx Fifo transfer status during a interrupt non-blocking receive. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param count Number of CAN messages receive so far by the non-blocking transaction. - * retval kStatus_InvalidArgument count is Invalid. - * retval kStatus_Success Successfully return the count. - */ - -status_t FLEXCAN_TransferGetReceiveFifoCount(CAN_Type *base, flexcan_handle_t *handle, size_t *count) -{ - assert(NULL != handle); - - status_t result = kStatus_Success; - - if (handle->rxFifoState == (uint32_t)kFLEXCAN_StateIdle) - { - result = kStatus_NoTransferInProgress; - } - else - { - *count = handle->rxFifoTransferTotalNum - handle->rxFifoFrameNum; - } - - return result; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * brief Receives a message from Enhanced Rx FIFO using IRQ. - * - * This function receives a message using IRQ. This is a non-blocking function, which returns - * right away. When all messages have been received, the receive callback function is called. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param pFifoXfer FlexCAN Rx FIFO transfer structure. See the ref flexcan_fifo_transfer_t. - * retval kStatus_Success - Start Rx FIFO receiving process successfully. - * retval kStatus_FLEXCAN_RxFifoBusy - Rx FIFO is currently in use. - */ -status_t FLEXCAN_TransferReceiveEnhancedFifoNonBlocking(CAN_Type *base, - flexcan_handle_t *handle, - flexcan_fifo_transfer_t *pFifoXfer) -{ - /* Assertion. */ - assert(NULL != handle); - assert(NULL != pFifoXfer); - - status_t status; - uint32_t watermark = ((base->ERFCR & CAN_ERFCR_ERFWM_MASK) >> CAN_ERFCR_ERFWM_SHIFT) + 1U; - uint64_t irqMask = - (uint64_t)kFLEXCAN_ERxFifoUnderflowInterruptEnable | (uint64_t)kFLEXCAN_ERxFifoOverflowInterruptEnable; - - /* Check if Enhanced Rx FIFO is idle. */ - if ((uint8_t)kFLEXCAN_StateIdle == handle->rxFifoState) - { - handle->rxFifoState = (uint8_t)kFLEXCAN_StateRxFifo; - - /* Register Message Buffer. */ - handle->rxFifoFDFrameBuf = pFifoXfer->framefd; - handle->rxFifoFrameNum = pFifoXfer->frameNum; - handle->rxFifoTransferTotalNum = pFifoXfer->frameNum; - - if (handle->rxFifoTransferTotalNum >= watermark) - { - /* Enable watermark interrupt. */ - irqMask |= (uint64_t)kFLEXCAN_ERxFifoWatermarkInterruptEnable; - } - else - { - /* Enable data available interrupt. */ - irqMask |= (uint64_t)kFLEXCAN_ERxFifoDataAvlInterruptEnable; - } - /* Enable Enhanced Rx FIFO Interrupt. */ - FLEXCAN_EnableInterrupts(base, irqMask); - - status = kStatus_Success; - } - else - { - status = kStatus_FLEXCAN_RxFifoBusy; - } - - return status; -} -#endif - -/*! - * brief Aborts the interrupt driven message send process. - * - * This function aborts the interrupt driven message send process. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param mbIdx The FlexCAN Message Buffer index. - */ -void FLEXCAN_TransferAbortSend(CAN_Type *base, flexcan_handle_t *handle, uint8_t mbIdx) -{ - uint16_t timestamp; - - /* Assertion. */ - assert(NULL != handle); - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - /* Disable Message Buffer Interrupt. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (mbIdx >= 64U) - { - FLEXCAN_DisableHigh64MbInterrupts(base, (uint64_t)1U << (mbIdx - 64U)); - } - else - { - FLEXCAN_DisableMbInterrupts(base, (uint64_t)1U << mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - FLEXCAN_DisableMbInterrupts(base, (uint64_t)1U << mbIdx); -#else - FLEXCAN_DisableMbInterrupts(base, (uint32_t)1U << mbIdx); -#endif - - /* Update the TX frame 's time stamp by MB[mbIdx].cs. */ - timestamp = (uint16_t)((base->MB[mbIdx].CS & CAN_CS_TIME_STAMP_MASK) >> CAN_CS_TIME_STAMP_SHIFT); - handle->timestamp[mbIdx] = timestamp; - - /* Clean Message Buffer. */ - FLEXCAN_SetTxMbConfig(base, mbIdx, true); - - handle->mbState[mbIdx] = (uint8_t)kFLEXCAN_StateIdle; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * brief Aborts the interrupt driven message send process. - * - * This function aborts the interrupt driven message send process. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param mbIdx The FlexCAN FD Message Buffer index. - */ -void FLEXCAN_TransferFDAbortSend(CAN_Type *base, flexcan_handle_t *handle, uint8_t mbIdx) -{ - volatile uint32_t *mbAddr; - uint32_t offset; - uint16_t timestamp; - - /* Assertion. */ - assert(NULL != handle); - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - /* Disable Message Buffer Interrupt. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (mbIdx >= 64U) - { - FLEXCAN_DisableHigh64MbInterrupts(base, (uint64_t)1U << (mbIdx - 64U)); - } - else - { - FLEXCAN_DisableMbInterrupts(base, (uint64_t)1U << mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - FLEXCAN_DisableMbInterrupts(base, (uint64_t)1U << mbIdx); -#else - FLEXCAN_DisableMbInterrupts(base, (uint32_t)1U << mbIdx); -#endif - - /* Update the TX frame 's time stamp by base->MB[offset for CAN FD].CS. */ - mbAddr = &(base->MB[0].CS); - offset = FLEXCAN_GetFDMailboxOffset(base, mbIdx); - timestamp = (uint16_t)((mbAddr[offset] & CAN_CS_TIME_STAMP_MASK) >> CAN_CS_TIME_STAMP_SHIFT); - handle->timestamp[mbIdx] = timestamp; - - /* Clean Message Buffer. */ - FLEXCAN_SetFDTxMbConfig(base, mbIdx, true); - - handle->mbState[mbIdx] = (uint8_t)kFLEXCAN_StateIdle; -} - -/*! - * brief Aborts the interrupt driven message receive process. - * - * This function aborts the interrupt driven message receive process. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param mbIdx The FlexCAN FD Message Buffer index. - */ -void FLEXCAN_TransferFDAbortReceive(CAN_Type *base, flexcan_handle_t *handle, uint8_t mbIdx) -{ - /* Assertion. */ - assert(NULL != handle); - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - /* Disable Message Buffer Interrupt. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (mbIdx >= 64U) - { - FLEXCAN_DisableHigh64MbInterrupts(base, (uint64_t)1U << (mbIdx - 64U)); - } - else - { - FLEXCAN_DisableMbInterrupts(base, (uint64_t)1U << mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - FLEXCAN_DisableMbInterrupts(base, (uint64_t)1U << mbIdx); -#else - FLEXCAN_DisableMbInterrupts(base, (uint32_t)1U << mbIdx); -#endif - - /* Un-register handle. */ - handle->mbFDFrameBuf[mbIdx] = NULL; - handle->mbState[mbIdx] = (uint8_t)kFLEXCAN_StateIdle; -} -#endif - -/*! - * brief Aborts the interrupt driven message receive process. - * - * This function aborts the interrupt driven message receive process. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param mbIdx The FlexCAN Message Buffer index. - */ -void FLEXCAN_TransferAbortReceive(CAN_Type *base, flexcan_handle_t *handle, uint8_t mbIdx) -{ - /* Assertion. */ - assert(NULL != handle); - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - /* Disable Message Buffer Interrupt. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (mbIdx >= 64U) - { - FLEXCAN_DisableHigh64MbInterrupts(base, (uint64_t)1U << (mbIdx - 64U)); - } - else - { - FLEXCAN_DisableMbInterrupts(base, (uint64_t)1U << mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - FLEXCAN_DisableMbInterrupts(base, (uint64_t)1U << mbIdx); -#else - FLEXCAN_DisableMbInterrupts(base, (uint32_t)1U << mbIdx); -#endif - - /* Un-register handle. */ - handle->mbFrameBuf[mbIdx] = NULL; - handle->mbState[mbIdx] = (uint8_t)kFLEXCAN_StateIdle; -} - -/*! - * brief Aborts the interrupt driven message receive from Legacy Rx FIFO process. - * - * This function aborts the interrupt driven message receive from Legacy Rx FIFO process. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - */ -void FLEXCAN_TransferAbortReceiveFifo(CAN_Type *base, flexcan_handle_t *handle) -{ - /* Assertion. */ - assert(NULL != handle); - - /* Check if Rx FIFO is enabled. */ - if (0U != (base->MCR & CAN_MCR_RFEN_MASK)) - { - /* Disable Rx Message FIFO Interrupts. */ - FLEXCAN_DisableMbInterrupts(base, (uint32_t)kFLEXCAN_RxFifoOverflowFlag | (uint32_t)kFLEXCAN_RxFifoWarningFlag | - (uint32_t)kFLEXCAN_RxFifoFrameAvlFlag); - - /* Un-register handle. */ - handle->rxFifoFrameBuf = NULL; - /* Clear transfer count. */ - handle->rxFifoFrameNum = 0U; - handle->rxFifoTransferTotalNum = 0U; - } - - handle->rxFifoState = (uint8_t)kFLEXCAN_StateIdle; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * brief Aborts the interrupt driven message receive from Enhanced Rx FIFO process. - * - * This function aborts the interrupt driven message receive from Rx FIFO process. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - */ -void FLEXCAN_TransferAbortReceiveEnhancedFifo(CAN_Type *base, flexcan_handle_t *handle) -{ - /* Assertion. */ - assert(NULL != handle); - - /* Check if Enhanced Rx FIFO is enabled. */ - if (0U != (base->ERFCR & CAN_ERFCR_ERFEN_MASK)) - { - /* Disable all Rx Message FIFO interrupts. */ - FLEXCAN_DisableInterrupts(base, (uint64_t)kFLEXCAN_ERxFifoUnderflowInterruptEnable | - (uint64_t)kFLEXCAN_ERxFifoOverflowInterruptEnable | - (uint64_t)kFLEXCAN_ERxFifoWatermarkInterruptEnable | - (uint64_t)kFLEXCAN_ERxFifoDataAvlInterruptEnable); - - /* Un-register handle. */ - handle->rxFifoFDFrameBuf = NULL; - /* Clear transfer count. */ - handle->rxFifoFrameNum = 0U; - handle->rxFifoTransferTotalNum = 0U; - } - - handle->rxFifoState = (uint8_t)kFLEXCAN_StateIdle; -} -#endif - -/*! - * brief Gets the detail index of Mailbox's Timestamp by handle. - * - * Then function can only be used when calling non-blocking Data transfer (TX/RX) API, - * After TX/RX data transfer done (User can get the status by handler's callback function), - * we can get the detail index of Mailbox's timestamp by handle, - * Detail non-blocking data transfer API (TX/RX) contain. - * -FLEXCAN_TransferSendNonBlocking - * -FLEXCAN_TransferFDSendNonBlocking - * -FLEXCAN_TransferReceiveNonBlocking - * -FLEXCAN_TransferFDReceiveNonBlocking - * -FLEXCAN_TransferReceiveFifoNonBlocking - * - * param handle FlexCAN handle pointer. - * param mbIdx The FlexCAN FD Message Buffer index. - * return the index of mailbox 's timestamp stored in the handle. - * - */ -uint32_t FLEXCAN_GetTimeStamp(flexcan_handle_t *handle, uint8_t mbIdx) -{ - /* Assertion. */ - assert(NULL != handle); - - return (uint32_t)(handle->timestamp[mbIdx]); -} - -/*! - * brief Check unhandle interrupt events - * - * param base FlexCAN peripheral base address. - * return TRUE if unhandled interrupt action exist, FALSE if no unhandlered interrupt action exist. - */ -static bool FLEXCAN_CheckUnhandleInterruptEvents(CAN_Type *base) -{ - uint64_t tempmask; - uint64_t tempflag; - bool fgRet = false; - - if (0U == (FLEXCAN_GetStatusFlags(base) & - (FLEXCAN_ERROR_AND_STATUS_INIT_FLAG | FLEXCAN_WAKE_UP_FLAG | FLEXCAN_MEMORY_ENHANCED_RX_FIFO_INIT_FLAG))) - { - /* If no error, wake_up or enhanced RX FIFO status, Checking whether exist MB interrupt status and legacy RX - * FIFO interrupt status */ - tempmask = (uint64_t)base->IMASK1; - tempflag = (uint64_t)base->IFLAG1; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - tempmask |= ((uint64_t)base->IMASK2) << 32; - tempflag |= ((uint64_t)base->IFLAG2) << 32; -#endif - fgRet = (0U != (tempmask & tempflag)); -#if defined(CAN_IMASK3_BUF95TO64M_MASK) - if (0U != (base->IMASK3 & base->IFLAG3)) - { - fgRet = true; - } -#endif -#if defined(CAN_IMASK4_BUF127TO96M_MASK) - if (0U != (base->IMASK4 & base->IFLAG4)) - { - fgRet = true; - } -#endif - } -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - else if (0U != (FLEXCAN_GetStatusFlags(base) & FLEXCAN_MEMORY_ENHANCED_RX_FIFO_INIT_FLAG)) - { - /* Checking whether exist enhanced RX FIFO interrupt status. */ - tempmask = (uint64_t)base->ERFIER; - tempflag = (uint64_t)base->ERFSR; - fgRet = (0U != (tempmask & tempflag)); - } -#endif - else - { - /* Exist error or wake up flag. */ - fgRet = true; - } - - return fgRet; -} - -/*! - * brief Sub Handler Legacy Rx FIFO Trasfered Events - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param result The MB flag number. - * - * return the status after handle transfered event. - */ -static status_t FLEXCAN_SubHandlerForLegacyRxFIFO(CAN_Type *base, flexcan_handle_t *handle, uint32_t result) -{ - uint32_t u32mask = 1; - status_t status = kStatus_FLEXCAN_UnHandled; - - switch (u32mask << result) - { - case kFLEXCAN_RxFifoOverflowFlag: - status = kStatus_FLEXCAN_RxFifoOverflow; - break; - - case kFLEXCAN_RxFifoWarningFlag: - if ((handle->rxFifoFrameNum > 5U) && (0U != (base->IFLAG1 & (uint32_t)kFLEXCAN_RxFifoFrameAvlFlag))) - { - for (uint32_t i = 0; i < 5UL; i++) - { - status = FLEXCAN_ReadRxFifo(base, handle->rxFifoFrameBuf); - /* - * $Branch Coverage Justification$ - * (kStatus_Success != status) not covered. $ref flexcan_c_ref_1$. - */ - if (kStatus_Success == status) - { - /* Align the current rxfifo timestamp to the timestamp array by handle. */ - handle->timestamp[i] = handle->rxFifoFrameBuf->timestamp; - handle->rxFifoFrameBuf++; - handle->rxFifoFrameNum--; - /* Clean Rx Fifo available flag to discard the frame that has been read. */ - FLEXCAN_ClearMbStatusFlags(base, (uint32_t)kFLEXCAN_RxFifoFrameAvlFlag); - } - else - { - /* - * $Line Coverage Justification$ - * $ref flexcan_c_ref_1$. - */ - return kStatus_FLEXCAN_RxFifoDisabled; - } - } - if (handle->rxFifoFrameNum < 5UL) - { - /* Enable data avaliable interrupt. */ - FLEXCAN_EnableMbInterrupts(base, (uint32_t)kFLEXCAN_RxFifoFrameAvlFlag); - } - status = kStatus_FLEXCAN_RxFifoBusy; - } - else - { - /* Should enter case kFLEXCAN_RxFifoFrameAvlFlag but not, means previous transfer may have - * overflow*/ - status = kStatus_FLEXCAN_RxFifoWarning; - } - break; - - case kFLEXCAN_RxFifoFrameAvlFlag: - /* Whether still has CAN messages remaining to be received. */ - if (handle->rxFifoFrameNum > 0U) - { - status = FLEXCAN_ReadRxFifo(base, handle->rxFifoFrameBuf); - /* - * $Branch Coverage Justification$ - * (kStatus_Success != status) not covered. $ref flexcan_c_ref_1$. - */ - if (kStatus_Success == status) - { - /* Align the current (index 0) rxfifo timestamp to the timestamp array by handle. */ - handle->timestamp[0] = handle->rxFifoFrameBuf->timestamp; - handle->rxFifoFrameBuf++; - handle->rxFifoFrameNum--; - } - else - { - /* - * $Line Coverage Justification$ - * $ref flexcan_c_ref_1$. - */ - return kStatus_FLEXCAN_RxFifoDisabled; - } - } - if (handle->rxFifoFrameNum == 0U) - { - /* Stop receiving Ehanced Rx FIFO when the transmission is over. */ - FLEXCAN_TransferAbortReceiveFifo(base, handle); - status = kStatus_FLEXCAN_RxFifoIdle; - } - else - { - /* Continue use data avaliable interrupt. */ - status = kStatus_FLEXCAN_RxFifoBusy; - } - break; - - default: - status = kStatus_FLEXCAN_UnHandled; - break; - } - - return status; -} - -/*! - * brief Sub Handler Message Buffer Trasfered Events - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param result The MB flag number. - * - * return the status after handle transfered event. - */ -static status_t FLEXCAN_SubHandlerForMB(CAN_Type *base, flexcan_handle_t *handle, uint32_t result) -{ - status_t status = kStatus_FLEXCAN_UnHandled; - - /* Get current State of Message Buffer. */ - switch (handle->mbState[result]) - { - /* Solve Rx Data Frame. */ - case (uint8_t)kFLEXCAN_StateRxData: -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0U != (base->MCR & CAN_MCR_FDEN_MASK)) - { - status = FLEXCAN_ReadFDRxMb(base, (uint8_t)result, handle->mbFDFrameBuf[result]); - if ((kStatus_Success == status) || (kStatus_FLEXCAN_RxOverflow == status)) - { - /* Align the current index of RX MB timestamp to the timestamp array by handle. */ - handle->timestamp[result] = handle->mbFDFrameBuf[result]->timestamp; - - if (kStatus_Success == status) - { - status = kStatus_FLEXCAN_RxIdle; - } - } - } - else -#endif - { - status = FLEXCAN_ReadRxMb(base, (uint8_t)result, handle->mbFrameBuf[result]); - if ((kStatus_Success == status) || (kStatus_FLEXCAN_RxOverflow == status)) - { - /* Align the current index of RX MB timestamp to the timestamp array by handle. */ - handle->timestamp[result] = handle->mbFrameBuf[result]->timestamp; - - if (kStatus_Success == status) - { - status = kStatus_FLEXCAN_RxIdle; - } - } - } -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0U != (base->MCR & CAN_MCR_FDEN_MASK)) - { - FLEXCAN_TransferFDAbortReceive(base, handle, (uint8_t)result); - } - else -#endif - { - FLEXCAN_TransferAbortReceive(base, handle, (uint8_t)result); - } - break; - - /* Sove Rx Remote Frame. User need to Read the frame in Mail box in time by Read from MB API. */ - case (uint8_t)kFLEXCAN_StateRxRemote: - status = kStatus_FLEXCAN_RxRemote; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0U != (base->MCR & CAN_MCR_FDEN_MASK)) - { - FLEXCAN_TransferFDAbortReceive(base, handle, (uint8_t)result); - } - else -#endif - { - FLEXCAN_TransferAbortReceive(base, handle, (uint8_t)result); - } - break; - - /* Solve Tx Data Frame. */ - case (uint8_t)kFLEXCAN_StateTxData: - status = kStatus_FLEXCAN_TxIdle; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0U != (base->MCR & CAN_MCR_FDEN_MASK)) - { - FLEXCAN_TransferFDAbortSend(base, handle, (uint8_t)result); - } - else -#endif - { - FLEXCAN_TransferAbortSend(base, handle, (uint8_t)result); - } - break; - - /* Solve Tx Remote Frame. */ - case (uint8_t)kFLEXCAN_StateTxRemote: - handle->mbState[result] = (uint8_t)kFLEXCAN_StateRxRemote; - status = kStatus_FLEXCAN_TxSwitchToRx; - break; - - default: - status = kStatus_FLEXCAN_UnHandled; - break; - } - - return status; -} - -/*! - * brief Sub Handler Data Trasfered Events - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param pResult Pointer to the Handle result. - * - * return the status after handle each data transfered event. - */ -static status_t FLEXCAN_SubHandlerForDataTransfered(CAN_Type *base, flexcan_handle_t *handle, uint32_t *pResult) -{ - status_t status = kStatus_FLEXCAN_UnHandled; - uint32_t result = 0xFFU; - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - uint32_t intflag[4] = {(base->IMASK1 & base->IFLAG1), (base->IMASK2 & base->IFLAG2), 0U, 0U}; -#if defined(CAN_IMASK3_BUF95TO64M_MASK) - intflag[2] = base->IMASK3 & base->IFLAG3; -#endif -#if defined(CAN_IMASK4_BUF127TO96M_MASK) - intflag[3] = base->IMASK4 & base->IFLAG4; -#endif -#else - uint32_t intflag = base->IMASK1 & base->IFLAG1; -#endif - - /* For this implementation, we solve the Message with lowest MB index first. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - for (uint32_t i = 0U; i < 4U; i++) - { - if (intflag[i] != 0U) - { - for (uint32_t j = 0U; j < 32U; j++) - { - if (0UL != (intflag[i] & ((uint32_t)1UL << j))) - { - result = i * 32U + j; - break; - } - } - break; - } - } -#else - for (result = 0U; result < (uint32_t)FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(base); result++) - { - if (0UL != (intflag & ((uint32_t)1UL << result))) - { - break; - } - } -#endif - - /* find Message to deal with. */ - if (result < (uint32_t)FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(base)) - { - /* Solve Legacy Rx FIFO interrupt. */ - if (((uint8_t)kFLEXCAN_StateIdle != handle->rxFifoState) && (result <= (uint32_t)CAN_IFLAG1_BUF7I_SHIFT) && - ((base->MCR & CAN_MCR_RFEN_MASK) != 0U)) - { - status = FLEXCAN_SubHandlerForLegacyRxFIFO(base, handle, result); - /* - * $Branch Coverage Justification$ - * (status == kStatus_FLEXCAN_RxFifoDisabled) not covered. $ref flexcan_c_ref_1$. - */ - if (status == kStatus_FLEXCAN_RxFifoDisabled) - { - /* - * $Line Coverage Justification$ - * $ref flexcan_c_ref_1$. - */ - return status; - } - } - else - { - status = FLEXCAN_SubHandlerForMB(base, handle, result); - } - - /* Clear resolved Message Buffer IRQ. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (result >= 64U) - { - FLEXCAN_ClearHigh64MbStatusFlags(base, (uint64_t)1U << (result - 64U)); - } - else - { - FLEXCAN_ClearMbStatusFlags(base, (uint64_t)1U << result); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - FLEXCAN_ClearMbStatusFlags(base, (uint64_t)1U << result); -#else - FLEXCAN_ClearMbStatusFlags(base, (uint32_t)1U << result); -#endif - } - - *pResult = result; - - return status; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * brief Sub Handler Ehanced Rx FIFO event - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param flags FlexCAN interrupt flags. - * - * return the status after handle Ehanced Rx FIFO event. - */ -static status_t FLEXCAN_SubHandlerForEhancedRxFifo(CAN_Type *base, flexcan_handle_t *handle, uint64_t flags) -{ - uint32_t watermark = ((base->ERFCR & CAN_ERFCR_ERFWM_MASK) >> CAN_ERFCR_ERFWM_SHIFT) + 1U; - uint32_t transferFrames; - - status_t status; - /* Solve Ehanced Rx FIFO interrupt. */ - if ((0u != (flags & (uint64_t)kFLEXCAN_ERxFifoUnderflowIntFlag)) && - (0u != (base->ERFIER & CAN_ERFIER_ERFUFWIE_MASK))) - { - status = kStatus_FLEXCAN_RxFifoUnderflow; - FLEXCAN_ClearStatusFlags(base, (uint64_t)kFLEXCAN_ERxFifoUnderflowIntFlag); - } - else if ((0u != (flags & (uint64_t)kFLEXCAN_ERxFifoOverflowIntFlag)) && - (0u != (base->ERFIER & CAN_ERFIER_ERFOVFIE_MASK))) - { - status = kStatus_FLEXCAN_RxFifoOverflow; - FLEXCAN_ClearStatusFlags(base, (uint64_t)kFLEXCAN_ERxFifoOverflowIntFlag); - } - else if ((0u != (flags & (uint64_t)kFLEXCAN_ERxFifoWatermarkIntFlag)) && - (0u != (base->ERFIER & CAN_ERFIER_ERFWMIIE_MASK))) - { - /* Whether the number of CAN messages remaining to be received is greater than the watermark. */ - transferFrames = (handle->rxFifoFrameNum > watermark) ? watermark : handle->rxFifoFrameNum; - - for (uint32_t i = 0; i < transferFrames; i++) - { - status = FLEXCAN_ReadEnhancedRxFifo(base, handle->rxFifoFDFrameBuf); - - if (kStatus_Success == status) - { - handle->rxFifoFDFrameBuf++; - handle->rxFifoFrameNum--; - /* Clear data Watermark flag due to has read back one frame. */ - base->ERFSR = CAN_ERFSR_ERFWMI_MASK; - } - else - { - return kStatus_FLEXCAN_RxFifoDisabled; - } - } - if (handle->rxFifoFrameNum == 0U) - { - /* Stop receiving Ehanced Rx FIFO when the transmission is over. */ - FLEXCAN_TransferAbortReceiveEnhancedFifo(base, handle); - status = kStatus_FLEXCAN_RxFifoIdle; - } - else if (handle->rxFifoFrameNum < watermark) - { - /* Disable watermark interrupt and enable data avaliable interrupt. */ - FLEXCAN_DisableInterrupts(base, (uint64_t)kFLEXCAN_ERxFifoWatermarkInterruptEnable); - FLEXCAN_EnableInterrupts(base, (uint64_t)kFLEXCAN_ERxFifoDataAvlInterruptEnable); - status = kStatus_FLEXCAN_RxFifoBusy; - } - else - { - /* Continue use watermark interrupt. */ - status = kStatus_FLEXCAN_RxFifoBusy; - } - } - else - { - /* Data available status, check Whether still has CAN messages remaining to be received. */ - if (handle->rxFifoFrameNum > 0U) - { - status = FLEXCAN_ReadEnhancedRxFifo(base, handle->rxFifoFDFrameBuf); - - if (kStatus_Success == status) - { - handle->rxFifoFDFrameBuf++; - handle->rxFifoFrameNum--; - } - else - { - return kStatus_FLEXCAN_RxFifoDisabled; - } - } - if (handle->rxFifoFrameNum == 0U) - { - /* Stop receiving Ehanced Rx FIFO when the transmission is over. */ - FLEXCAN_TransferAbortReceiveEnhancedFifo(base, handle); - status = kStatus_FLEXCAN_RxFifoIdle; - } - else - { - /* Continue use data avaliable interrupt. */ - status = kStatus_FLEXCAN_RxFifoBusy; - } - } - return status; -} -#endif - -/*! - * brief FlexCAN IRQ handle function. - * - * This function handles the FlexCAN Error, the Message Buffer, and the Rx FIFO IRQ request. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - */ -void FLEXCAN_TransferHandleIRQ(CAN_Type *base, flexcan_handle_t *handle) -{ - /* Assertion. */ - assert(NULL != handle); - - status_t status; - uint32_t mbNum = 0xFFU; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - uint64_t result = 0U; -#else - uint32_t result = 0U; -#endif - do - { - /* Get Current FlexCAN Module Error and Status. */ - result = FLEXCAN_GetStatusFlags(base); - - /* To handle FlexCAN Error and Status Interrupt first. */ - if (0U != (result & FLEXCAN_ERROR_AND_STATUS_INIT_FLAG)) - { - status = kStatus_FLEXCAN_ErrorStatus; - /* Clear FlexCAN Error and Status Interrupt. */ - FLEXCAN_ClearStatusFlags(base, FLEXCAN_ERROR_AND_STATUS_INIT_FLAG); - } - else if (0U != (result & FLEXCAN_WAKE_UP_FLAG)) - { - status = kStatus_FLEXCAN_WakeUp; - FLEXCAN_ClearStatusFlags(base, FLEXCAN_WAKE_UP_FLAG); - } -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - else if (0U != (FLEXCAN_EFIFO_STATUS_UNMASK(result & FLEXCAN_MEMORY_ENHANCED_RX_FIFO_INIT_FLAG) & base->ERFIER)) - { - status = FLEXCAN_SubHandlerForEhancedRxFifo(base, handle, result); - } -#endif - else - { - /* To handle Message Buffer or Legacy Rx FIFO transfer. */ - status = FLEXCAN_SubHandlerForDataTransfered(base, handle, &mbNum); - result = mbNum; - } - - /* Calling Callback Function if has one. */ - if (handle->callback != NULL) - { - handle->callback(base, handle, status, result, handle->userData); - } - } while (FLEXCAN_CheckUnhandleInterruptEvents(base)); -} - -#if defined(CAN0) -void CAN0_DriverIRQHandler(void); -void CAN0_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[0]); - - s_flexcanIsr(CAN0, s_flexcanHandle[0]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CAN1) -void CAN1_DriverIRQHandler(void); -void CAN1_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[1]); - - s_flexcanIsr(CAN1, s_flexcanHandle[1]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CAN2) -void CAN2_DriverIRQHandler(void); -void CAN2_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[2]); - - s_flexcanIsr(CAN2, s_flexcanHandle[2]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CAN3) -void CAN3_DriverIRQHandler(void); -void CAN3_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[3]); - - s_flexcanIsr(CAN3, s_flexcanHandle[3]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CAN4) -void CAN4_DriverIRQHandler(void); -void CAN4_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[4]); - - s_flexcanIsr(CAN4, s_flexcanHandle[4]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(DMA__CAN0) -void DMA_FLEXCAN0_INT_DriverIRQHandler(void); -void DMA_FLEXCAN0_INT_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[FLEXCAN_GetInstance(DMA__CAN0)]); - - s_flexcanIsr(DMA__CAN0, s_flexcanHandle[FLEXCAN_GetInstance(DMA__CAN0)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(DMA__CAN1) -void DMA_FLEXCAN1_INT_DriverIRQHandler(void); -void DMA_FLEXCAN1_INT_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[FLEXCAN_GetInstance(DMA__CAN1)]); - - s_flexcanIsr(DMA__CAN1, s_flexcanHandle[FLEXCAN_GetInstance(DMA__CAN1)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(DMA__CAN2) -void DMA_FLEXCAN2_INT_DriverIRQHandler(void); -void DMA_FLEXCAN2_INT_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[FLEXCAN_GetInstance(DMA__CAN2)]); - - s_flexcanIsr(DMA__CAN2, s_flexcanHandle[FLEXCAN_GetInstance(DMA__CAN2)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(ADMA__CAN0) -void ADMA_FLEXCAN0_INT_DriverIRQHandler(void); -void ADMA_FLEXCAN0_INT_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[FLEXCAN_GetInstance(ADMA__CAN0)]); - - s_flexcanIsr(ADMA__CAN0, s_flexcanHandle[FLEXCAN_GetInstance(ADMA__CAN0)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(ADMA__CAN1) -void ADMA_FLEXCAN1_INT_DriverIRQHandler(void); -void ADMA_FLEXCAN1_INT_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[FLEXCAN_GetInstance(ADMA__CAN1)]); - - s_flexcanIsr(ADMA__CAN1, s_flexcanHandle[FLEXCAN_GetInstance(ADMA__CAN1)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(ADMA__CAN2) -void ADMA_FLEXCAN2_INT_DriverIRQHandler(void); -void ADMA_FLEXCAN2_INT_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[FLEXCAN_GetInstance(ADMA__CAN2)]); - - s_flexcanIsr(ADMA__CAN2, s_flexcanHandle[FLEXCAN_GetInstance(ADMA__CAN2)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(FLEXCAN1) -void CAN_FD1_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[1]); - - s_flexcanIsr(FLEXCAN1, s_flexcanHandle[1]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(FLEXCAN2) -void CAN_FD2_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[2]); - - s_flexcanIsr(FLEXCAN2, s_flexcanHandle[2]); - SDK_ISR_EXIT_BARRIER; -} -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexcan.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexcan.h deleted file mode 100644 index 553e4613cde..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexcan.h +++ /dev/null @@ -1,2360 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_FLEXCAN_H_ -#define FSL_FLEXCAN_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup flexcan_driver - * @{ - */ - -/****************************************************************************** - * Definitions - *****************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief FlexCAN driver version. */ -#define FSL_FLEXCAN_DRIVER_VERSION (MAKE_VERSION(2, 11, 4)) -/*@}*/ - -#if !(defined(FLEXCAN_WAIT_TIMEOUT) && FLEXCAN_WAIT_TIMEOUT) -/* Define to 1000 means keep waiting 1000 times until the flag is assert/deassert. */ -#define FLEXCAN_WAIT_TIMEOUT (1000U) -#endif - -/*! @brief FlexCAN frame length helper macro. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -#define DLC_LENGTH_DECODE(dlc) (((dlc) <= 8U) ? (dlc) : (((dlc) <= 12U) ? (((dlc)-6U) * 4U) : (((dlc)-11U) * 16U))) -#endif - -/*! @brief FlexCAN Frame ID helper macro. */ -#define FLEXCAN_ID_STD(id) \ - (((uint32_t)(((uint32_t)(id)) << CAN_ID_STD_SHIFT)) & CAN_ID_STD_MASK) /*!< Standard Frame ID helper macro. */ -#define FLEXCAN_ID_EXT(id) \ - (((uint32_t)(((uint32_t)(id)) << CAN_ID_EXT_SHIFT)) & \ - (CAN_ID_EXT_MASK | CAN_ID_STD_MASK)) /*!< Extend Frame ID helper macro. */ - -/*! @brief FlexCAN Rx Message Buffer Mask helper macro. */ -#define FLEXCAN_RX_MB_STD_MASK(id, rtr, ide) \ - (((uint32_t)((uint32_t)(rtr) << 31) | (uint32_t)((uint32_t)(ide) << 30)) | \ - FLEXCAN_ID_STD(id)) /*!< Standard Rx Message Buffer Mask helper macro. */ -#define FLEXCAN_RX_MB_EXT_MASK(id, rtr, ide) \ - (((uint32_t)((uint32_t)(rtr) << 31) | (uint32_t)((uint32_t)(ide) << 30)) | \ - FLEXCAN_ID_EXT(id)) /*!< Extend Rx Message Buffer Mask helper macro. */ - -/*! @brief FlexCAN Legacy Rx FIFO Mask helper macro. */ -#define FLEXCAN_RX_FIFO_STD_MASK_TYPE_A(id, rtr, ide) \ - (((uint32_t)((uint32_t)(rtr) << 31) | (uint32_t)((uint32_t)(ide) << 30)) | \ - (FLEXCAN_ID_STD(id) << 1)) /*!< Standard Rx FIFO Mask helper macro Type A helper macro. */ -#define FLEXCAN_RX_FIFO_STD_MASK_TYPE_B_HIGH(id, rtr, ide) \ - (((uint32_t)((uint32_t)(rtr) << 31) | (uint32_t)((uint32_t)(ide) << 30)) | \ - (((uint32_t)(id)&0x7FF) << 19)) /*!< Standard Rx FIFO Mask helper macro Type B upper part helper macro. */ -#define FLEXCAN_RX_FIFO_STD_MASK_TYPE_B_LOW(id, rtr, ide) \ - (((uint32_t)((uint32_t)(rtr) << 15) | (uint32_t)((uint32_t)(ide) << 14)) | \ - (((uint32_t)(id)&0x7FF) << 3)) /*!< Standard Rx FIFO Mask helper macro Type B lower part helper macro. */ -#define FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_HIGH(id) \ - (((uint32_t)(id)&0x7F8) << 21) /*!< Standard Rx FIFO Mask helper macro Type C upper part helper macro. */ -#define FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_MID_HIGH(id) \ - (((uint32_t)(id)&0x7F8) << 13) /*!< Standard Rx FIFO Mask helper macro Type C mid-upper part helper macro. */ -#define FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_MID_LOW(id) \ - (((uint32_t)(id)&0x7F8) << 5) /*!< Standard Rx FIFO Mask helper macro Type C mid-lower part helper macro. */ -#define FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_LOW(id) \ - (((uint32_t)(id)&0x7F8) >> 3) /*!< Standard Rx FIFO Mask helper macro Type C lower part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_MASK_TYPE_A(id, rtr, ide) \ - (((uint32_t)((uint32_t)(rtr) << 31) | (uint32_t)((uint32_t)(ide) << 30)) | \ - (FLEXCAN_ID_EXT(id) << 1)) /*!< Extend Rx FIFO Mask helper macro Type A helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_MASK_TYPE_B_HIGH(id, rtr, ide) \ - ( \ - ((uint32_t)((uint32_t)(rtr) << 31) | (uint32_t)((uint32_t)(ide) << 30)) | \ - ((FLEXCAN_ID_EXT(id) & 0x1FFF8000) \ - << 1)) /*!< Extend Rx FIFO Mask helper macro Type B upper part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_MASK_TYPE_B_LOW(id, rtr, ide) \ - (((uint32_t)((uint32_t)(rtr) << 15) | (uint32_t)((uint32_t)(ide) << 14)) | \ - ((FLEXCAN_ID_EXT(id) & 0x1FFF8000) >> \ - 15)) /*!< Extend Rx FIFO Mask helper macro Type B lower part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_HIGH(id) \ - ((FLEXCAN_ID_EXT(id) & 0x1FE00000) << 3) /*!< Extend Rx FIFO Mask helper macro Type C upper part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_MID_HIGH(id) \ - ((FLEXCAN_ID_EXT(id) & 0x1FE00000) >> \ - 5) /*!< Extend Rx FIFO Mask helper macro Type C mid-upper part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_MID_LOW(id) \ - ((FLEXCAN_ID_EXT(id) & 0x1FE00000) >> \ - 13) /*!< Extend Rx FIFO Mask helper macro Type C mid-lower part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_LOW(id) \ - ((FLEXCAN_ID_EXT(id) & 0x1FE00000) >> 21) /*!< Extend Rx FIFO Mask helper macro Type C lower part helper macro. */ - -/*! @brief FlexCAN Rx FIFO Filter helper macro. */ -#define FLEXCAN_RX_FIFO_STD_FILTER_TYPE_A(id, rtr, ide) \ - FLEXCAN_RX_FIFO_STD_MASK_TYPE_A(id, rtr, ide) /*!< Standard Rx FIFO Filter helper macro Type A helper macro. */ -#define FLEXCAN_RX_FIFO_STD_FILTER_TYPE_B_HIGH(id, rtr, ide) \ - FLEXCAN_RX_FIFO_STD_MASK_TYPE_B_HIGH( \ - id, rtr, ide) /*!< Standard Rx FIFO Filter helper macro Type B upper part helper macro. */ -#define FLEXCAN_RX_FIFO_STD_FILTER_TYPE_B_LOW(id, rtr, ide) \ - FLEXCAN_RX_FIFO_STD_MASK_TYPE_B_LOW( \ - id, rtr, ide) /*!< Standard Rx FIFO Filter helper macro Type B lower part helper macro. */ -#define FLEXCAN_RX_FIFO_STD_FILTER_TYPE_C_HIGH(id) \ - FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_HIGH( \ - id) /*!< Standard Rx FIFO Filter helper macro Type C upper part helper macro. */ -#define FLEXCAN_RX_FIFO_STD_FILTER_TYPE_C_MID_HIGH(id) \ - FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_MID_HIGH( \ - id) /*!< Standard Rx FIFO Filter helper macro Type C mid-upper part helper macro. */ -#define FLEXCAN_RX_FIFO_STD_FILTER_TYPE_C_MID_LOW(id) \ - FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_MID_LOW( \ - id) /*!< Standard Rx FIFO Filter helper macro Type C mid-lower part helper macro. */ -#define FLEXCAN_RX_FIFO_STD_FILTER_TYPE_C_LOW(id) \ - FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_LOW( \ - id) /*!< Standard Rx FIFO Filter helper macro Type C lower part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_A(id, rtr, ide) \ - FLEXCAN_RX_FIFO_EXT_MASK_TYPE_A(id, rtr, ide) /*!< Extend Rx FIFO Filter helper macro Type A helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_B_HIGH(id, rtr, ide) \ - FLEXCAN_RX_FIFO_EXT_MASK_TYPE_B_HIGH( \ - id, rtr, ide) /*!< Extend Rx FIFO Filter helper macro Type B upper part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_B_LOW(id, rtr, ide) \ - FLEXCAN_RX_FIFO_EXT_MASK_TYPE_B_LOW( \ - id, rtr, ide) /*!< Extend Rx FIFO Filter helper macro Type B lower part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_C_HIGH(id) \ - FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_HIGH( \ - id) /*!< Extend Rx FIFO Filter helper macro Type C upper part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_C_MID_HIGH(id) \ - FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_MID_HIGH( \ - id) /*!< Extend Rx FIFO Filter helper macro Type C mid-upper part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_C_MID_LOW(id) \ - FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_MID_LOW( \ - id) /*!< Extend Rx FIFO Filter helper macro Type C mid-lower part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_C_LOW(id) \ - FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_LOW(id) /*!< Extend Rx FIFO Filter helper macro Type C lower part helper macro. */ - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! @brief FlexCAN Enhanced Rx FIFO Filter and Mask helper macro. */ -#define ENHANCED_RX_FIFO_FSCH(x) (((uint32_t)(((uint32_t)(x)) << 30)) & 0xC0000000U) -#define RTR_STD_HIGH(x) (((uint32_t)(((uint32_t)(x)) << 27)) & 0x08000000U) -#define RTR_STD_LOW(x) (((uint32_t)(((uint32_t)(x)) << 11)) & 0x00000800U) -#define RTR_EXT(x) (((uint32_t)(((uint32_t)(x)) << 29)) & 0x40000000U) -#define ID_STD_LOW(id) (((uint32_t)id) & 0x7FFU) -#define ID_STD_HIGH(id) (((uint32_t)(((uint32_t)(id)) << 16)) & 0x07FF0000U) -#define ID_EXT(id) (((uint32_t)id) & 0x1FFFFFFFU) - -/*! Standard ID filter element with filter + mask scheme. */ -#define FLEXCAN_ENHANCED_RX_FIFO_STD_MASK_AND_FILTER(id, rtr, id_mask, rtr_mask) \ - (ENHANCED_RX_FIFO_FSCH(0x0) | RTR_STD_HIGH(rtr) | ID_STD_HIGH(id) | RTR_STD_LOW(rtr_mask) | ID_STD_LOW(id_mask)) -/*! Standard ID filter element with filter range. */ -#define FLEXCAN_ENHANCED_RX_FIFO_STD_FILTER_WITH_RANGE(id_upper, rtr, id_lower, rtr_mask) \ - (ENHANCED_RX_FIFO_FSCH(0x1) | RTR_STD_HIGH(rtr) | ID_STD_HIGH(id_upper) | RTR_STD_LOW(rtr_mask) | \ - ID_STD_LOW(id_lower)) -/*! Standard ID filter element with two filters without masks. */ -#define FLEXCAN_ENHANCED_RX_FIFO_STD_TWO_FILTERS(id1, rtr1, id2, rtr2) \ - (ENHANCED_RX_FIFO_FSCH(0x2) | RTR_STD_HIGH(rtr1) | ID_STD_HIGH(id1) | RTR_STD_LOW(rtr2) | ID_STD_LOW(id2)) -/*! Extended ID filter element with filter + mask scheme low word. */ -#define FLEXCAN_ENHANCED_RX_FIFO_EXT_MASK_AND_FILTER_LOW(id, rtr) \ - (ENHANCED_RX_FIFO_FSCH(0x0) | RTR_EXT(rtr) | ID_EXT(id)) -/*! Extended ID filter element with filter + mask scheme high word. */ -#define FLEXCAN_ENHANCED_RX_FIFO_EXT_MASK_AND_FILTER_HIGH(id_mask, rtr_mask) \ - (ENHANCED_RX_FIFO_FSCH(0x0) | RTR_EXT(rtr_mask) | ID_EXT(id_mask)) -/*! Extended ID filter element with range scheme low word. */ -#define FLEXCAN_ENHANCED_RX_FIFO_EXT_FILTER_WITH_RANGE_LOW(id_upper, rtr) \ - (ENHANCED_RX_FIFO_FSCH(0x1) | RTR_EXT(rtr) | ID_EXT(id_upper)) -/*! Extended ID filter element with range scheme high word. */ -#define FLEXCAN_ENHANCED_RX_FIFO_EXT_FILTER_WITH_RANGE_HIGH(id_lower, rtr_mask) \ - (ENHANCED_RX_FIFO_FSCH(0x1) | RTR_EXT(rtr_mask) | ID_EXT(id_lower)) -/*! Extended ID filter element with two filters without masks low word. */ -#define FLEXCAN_ENHANCED_RX_FIFO_EXT_TWO_FILTERS_LOW(id2, rtr2) \ - (ENHANCED_RX_FIFO_FSCH(0x2) | RTR_EXT(rtr2) | ID_EXT(id2)) -/*! Extended ID filter element with two filters without masks high word. */ -#define FLEXCAN_ENHANCED_RX_FIFO_EXT_TWO_FILTERS_HIGH(id1, rtr1) \ - (ENHANCED_RX_FIFO_FSCH(0x2) | RTR_EXT(rtr1) | ID_EXT(id1)) -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) -/*! @brief FlexCAN Pretended Networking ID Mask helper macro. */ -#define FLEXCAN_PN_STD_MASK(id, rtr) \ - ((uint32_t)((uint32_t)(rtr) << CAN_FLT_ID1_FLT_RTR_SHIFT) | \ - FLEXCAN_ID_STD(id)) /*!< Standard Rx Message Buffer Mask helper macro. */ -#define FLEXCAN_PN_EXT_MASK(id, rtr) \ - ((uint32_t)CAN_FLT_ID1_FLT_IDE_MASK | (uint32_t)((uint32_t)(rtr) << CAN_FLT_ID1_FLT_RTR_SHIFT) | \ - FLEXCAN_ID_EXT(id)) /*!< Extend Rx Message Buffer Mask helper macro. */ -#endif - -/*! @brief FlexCAN interrupt/status flag helper macro. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) -#define FLEXCAN_PN_INT_MASK(x) (((uint64_t)(((uint64_t)(x)) << 32)) & 0x3000000000000U) -#define FLEXCAN_PN_INT_UNMASK(x) (((uint32_t)(((uint64_t)(x)) >> 32)) & 0x00030000U) -#define FLEXCAN_PN_STATUS_MASK(x) (((uint64_t)(((uint64_t)(x)) << 16)) & 0x300000000U) -#define FLEXCAN_PN_STATUS_UNMASK(x) (((uint32_t)(((uint64_t)(x)) >> 16)) & 0x00030000U) -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -#define FLEXCAN_EFIFO_INT_MASK(x) (((uint64_t)(((uint64_t)(x)) << 32)) & 0xF000000000000000U) -#define FLEXCAN_EFIFO_INT_UNMASK(x) (((uint32_t)(((uint64_t)(x)) >> 32)) & 0xF0000000U) -#define FLEXCAN_EFIFO_STATUS_MASK(x) (((uint64_t)(((uint64_t)(x)) << 32)) & 0xF003000000000000U) -#define FLEXCAN_EFIFO_STATUS_UNMASK(x) (((uint32_t)(((uint64_t)(x)) >> 32)) & 0xF0030000U) -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -#define FLEXCAN_MECR_INT_MASK(x) (((uint64_t)(((uint64_t)(x)) << 16)) & 0xD00000000U) -#define FLEXCAN_MECR_INT_UNMASK(x) (((uint32_t)(((uint64_t)(x)) >> 16)) & 0x000D0000U) -#define FLEXCAN_MECR_STATUS_MASK(x) (((uint64_t)(((uint64_t)(x)) << 34)) & 0x34003400000000U) -#define FLEXCAN_MECR_STATUS_UNMASK(x) (((uint32_t)(((uint64_t)(x)) >> 34)) & 0x000D000DU) -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -#define FLEXCAN_ERROR_AND_STATUS_INIT_FLAG \ - ((uint32_t)kFLEXCAN_ErrorOverrunFlag | (uint32_t)kFLEXCAN_FDErrorIntFlag | (uint32_t)kFLEXCAN_BusoffDoneIntFlag | \ - (uint32_t)kFLEXCAN_TxWarningIntFlag | (uint32_t)kFLEXCAN_RxWarningIntFlag | (uint32_t)kFLEXCAN_BusOffIntFlag | \ - (uint32_t)kFLEXCAN_ErrorIntFlag | FLEXCAN_MEMORY_ERROR_INIT_FLAG) -#else -#define FLEXCAN_ERROR_AND_STATUS_INIT_FLAG \ - ((uint32_t)kFLEXCAN_TxWarningIntFlag | (uint32_t)kFLEXCAN_RxWarningIntFlag | (uint32_t)kFLEXCAN_BusOffIntFlag | \ - (uint32_t)kFLEXCAN_ErrorIntFlag | FLEXCAN_MEMORY_ERROR_INIT_FLAG) -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) -#define FLEXCAN_WAKE_UP_FLAG \ - ((uint32_t)kFLEXCAN_WakeUpIntFlag | (uint64_t)kFLEXCAN_PNMatchIntFlag | (uint64_t)kFLEXCAN_PNTimeoutIntFlag) -#else -#define FLEXCAN_WAKE_UP_FLAG ((uint32_t)kFLEXCAN_WakeUpIntFlag) -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -#define FLEXCAN_MEMORY_ERROR_INIT_FLAG ((uint64_t)kFLEXCAN_AllMemoryErrorFlag) -#else -#define FLEXCAN_MEMORY_ERROR_INIT_FLAG (0U) -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -#define FLEXCAN_MEMORY_ENHANCED_RX_FIFO_INIT_FLAG \ - ((uint64_t)kFLEXCAN_ERxFifoUnderflowIntFlag | (uint64_t)kFLEXCAN_ERxFifoOverflowIntFlag | \ - (uint64_t)kFLEXCAN_ERxFifoWatermarkIntFlag | (uint64_t)kFLEXCAN_ERxFifoDataAvlIntFlag) -#endif -/*! @brief FlexCAN Enhanced Rx FIFO base address helper macro. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -#define E_RX_FIFO(base) ((uintptr_t)(base) + 0x2000U) -#else -#define FLEXCAN_MEMORY_ENHANCED_RX_FIFO_INIT_FLAG (0U) -#endif -/*! @brief FlexCAN transfer status. */ -enum -{ - kStatus_FLEXCAN_TxBusy = MAKE_STATUS(kStatusGroup_FLEXCAN, 0), /*!< Tx Message Buffer is Busy. */ - kStatus_FLEXCAN_TxIdle = MAKE_STATUS(kStatusGroup_FLEXCAN, 1), /*!< Tx Message Buffer is Idle. */ - kStatus_FLEXCAN_TxSwitchToRx = MAKE_STATUS( - kStatusGroup_FLEXCAN, 2), /*!< Remote Message is send out and Message buffer changed to Receive one. */ - kStatus_FLEXCAN_RxBusy = MAKE_STATUS(kStatusGroup_FLEXCAN, 3), /*!< Rx Message Buffer is Busy. */ - kStatus_FLEXCAN_RxIdle = MAKE_STATUS(kStatusGroup_FLEXCAN, 4), /*!< Rx Message Buffer is Idle. */ - kStatus_FLEXCAN_RxOverflow = MAKE_STATUS(kStatusGroup_FLEXCAN, 5), /*!< Rx Message Buffer is Overflowed. */ - kStatus_FLEXCAN_RxFifoBusy = MAKE_STATUS(kStatusGroup_FLEXCAN, 6), /*!< Rx Message FIFO is Busy. */ - kStatus_FLEXCAN_RxFifoIdle = MAKE_STATUS(kStatusGroup_FLEXCAN, 7), /*!< Rx Message FIFO is Idle. */ - kStatus_FLEXCAN_RxFifoOverflow = MAKE_STATUS(kStatusGroup_FLEXCAN, 8), /*!< Rx Message FIFO is overflowed. */ - kStatus_FLEXCAN_RxFifoWarning = MAKE_STATUS(kStatusGroup_FLEXCAN, 9), /*!< Rx Message FIFO is almost overflowed. */ - kStatus_FLEXCAN_RxFifoDisabled = - MAKE_STATUS(kStatusGroup_FLEXCAN, 10), /*!< Rx Message FIFO is disabled during reading. */ - kStatus_FLEXCAN_ErrorStatus = MAKE_STATUS(kStatusGroup_FLEXCAN, 11), /*!< FlexCAN Module Error and Status. */ - kStatus_FLEXCAN_WakeUp = MAKE_STATUS(kStatusGroup_FLEXCAN, 12), /*!< FlexCAN is waken up from STOP mode. */ - kStatus_FLEXCAN_UnHandled = MAKE_STATUS(kStatusGroup_FLEXCAN, 13), /*!< UnHadled Interrupt asserted. */ - kStatus_FLEXCAN_RxRemote = MAKE_STATUS(kStatusGroup_FLEXCAN, 14), /*!< Rx Remote Message Received in Mail box. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - kStatus_FLEXCAN_RxFifoUnderflow = - MAKE_STATUS(kStatusGroup_FLEXCAN, 15), /*!< Enhanced Rx Message FIFO is underflow. */ -#endif -}; - -/*! @brief FlexCAN frame format. */ -typedef enum _flexcan_frame_format -{ - kFLEXCAN_FrameFormatStandard = 0x0U, /*!< Standard frame format attribute. */ - kFLEXCAN_FrameFormatExtend = 0x1U, /*!< Extend frame format attribute. */ -} flexcan_frame_format_t; - -/*! @brief FlexCAN frame type. */ -typedef enum _flexcan_frame_type -{ - kFLEXCAN_FrameTypeData = 0x0U, /*!< Data frame type attribute. */ - kFLEXCAN_FrameTypeRemote = 0x1U, /*!< Remote frame type attribute. */ -} flexcan_frame_type_t; - -/*! @brief FlexCAN clock source. - * @deprecated Do not use the kFLEXCAN_ClkSrcOs. It has been superceded kFLEXCAN_ClkSrc0 - * @deprecated Do not use the kFLEXCAN_ClkSrcPeri. It has been superceded kFLEXCAN_ClkSrc1 - */ -typedef enum _flexcan_clock_source -{ - kFLEXCAN_ClkSrcOsc = 0x0U, /*!< FlexCAN Protocol Engine clock from Oscillator. */ - kFLEXCAN_ClkSrcPeri = 0x1U, /*!< FlexCAN Protocol Engine clock from Peripheral Clock. */ - kFLEXCAN_ClkSrc0 = 0x0U, /*!< FlexCAN Protocol Engine clock selected by user as SRC == 0. */ - kFLEXCAN_ClkSrc1 = 0x1U, /*!< FlexCAN Protocol Engine clock selected by user as SRC == 1. */ -} flexcan_clock_source_t; - -/*! @brief FlexCAN wake up source. */ -typedef enum _flexcan_wake_up_source -{ - kFLEXCAN_WakeupSrcUnfiltered = 0x0U, /*!< FlexCAN uses unfiltered Rx input to detect edge. */ - kFLEXCAN_WakeupSrcFiltered = 0x1U, /*!< FlexCAN uses filtered Rx input to detect edge. */ -} flexcan_wake_up_source_t; - -/*! @brief FlexCAN Rx Fifo Filter type. */ -typedef enum _flexcan_rx_fifo_filter_type -{ - kFLEXCAN_RxFifoFilterTypeA = 0x0U, /*!< One full ID (standard and extended) per ID Filter element. */ - kFLEXCAN_RxFifoFilterTypeB = - 0x1U, /*!< Two full standard IDs or two partial 14-bit ID slices per ID Filter Table element. */ - kFLEXCAN_RxFifoFilterTypeC = - 0x2U, /*!< Four partial 8-bit Standard or extended ID slices per ID Filter Table element. */ - kFLEXCAN_RxFifoFilterTypeD = 0x3U, /*!< All frames rejected. */ -} flexcan_rx_fifo_filter_type_t; - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * @brief FlexCAN Message Buffer Payload size. - */ -typedef enum _flexcan_mb_size -{ - kFLEXCAN_8BperMB = 0x0U, /*!< Selects 8 bytes per Message Buffer. */ - kFLEXCAN_16BperMB = 0x1U, /*!< Selects 16 bytes per Message Buffer. */ - kFLEXCAN_32BperMB = 0x2U, /*!< Selects 32 bytes per Message Buffer. */ - kFLEXCAN_64BperMB = 0x3U, /*!< Selects 64 bytes per Message Buffer. */ -} flexcan_mb_size_t; - -/*! - * @brief FlexCAN CAN FD frame supporting data length (available DLC values). - * - * For Tx, when the Data size corresponding to DLC value stored in the MB selected for transmission is larger than the - * MB Payload size, FlexCAN adds the necessary number of bytes with constant 0xCC pattern to complete the expected DLC. - * For Rx, when the Data size corresponding to DLC value received from the CAN bus is larger than the MB Payload size, - * the high order bytes that do not fit the Payload size will lose. - */ -enum _flexcan_fd_frame_length -{ - kFLEXCAN_0BperFrame = 0x0U, /*!< Frame contains 0 valid data bytes. */ - kFLEXCAN_1BperFrame, /*!< Frame contains 1 valid data bytes. */ - kFLEXCAN_2BperFrame, /*!< Frame contains 2 valid data bytes. */ - kFLEXCAN_3BperFrame, /*!< Frame contains 3 valid data bytes. */ - kFLEXCAN_4BperFrame, /*!< Frame contains 4 valid data bytes. */ - kFLEXCAN_5BperFrame, /*!< Frame contains 5 valid data bytes. */ - kFLEXCAN_6BperFrame, /*!< Frame contains 6 valid data bytes. */ - kFLEXCAN_7BperFrame, /*!< Frame contains 7 valid data bytes. */ - kFLEXCAN_8BperFrame, /*!< Frame contains 8 valid data bytes. */ - kFLEXCAN_12BperFrame, /*!< Frame contains 12 valid data bytes. */ - kFLEXCAN_16BperFrame, /*!< Frame contains 16 valid data bytes. */ - kFLEXCAN_20BperFrame, /*!< Frame contains 20 valid data bytes. */ - kFLEXCAN_24BperFrame, /*!< Frame contains 24 valid data bytes. */ - kFLEXCAN_32BperFrame, /*!< Frame contains 32 valid data bytes. */ - kFLEXCAN_48BperFrame, /*!< Frame contains 48 valid data bytes. */ - kFLEXCAN_64BperFrame, /*!< Frame contains 64 valid data bytes. */ -}; -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! @brief FlexCAN Enhanced Rx Fifo DMA transfer per read length enumerations. */ -typedef enum _flexcan_efifo_dma_per_read_length -{ - kFLEXCAN_1WordPerRead = 0x0U, /*!< Transfer 1 32-bit words (CS).*/ - kFLEXCAN_2WordPerRead, /*!< Transfer 2 32-bit words (CS + ID).*/ - kFLEXCAN_3WordPerRead, /*!< Transfer 3 32-bit words (CS + ID + 1~4 bytes data).*/ - kFLEXCAN_4WordPerRead, /*!< Transfer 4 32-bit words (CS + ID + 5~8 bytes data).*/ - kFLEXCAN_5WordPerRead, /*!< Transfer 5 32-bit words (CS + ID + 9~12 bytes data).*/ - kFLEXCAN_6WordPerRead, /*!< Transfer 6 32-bit words (CS + ID + 13~16 bytes data).*/ - kFLEXCAN_7WordPerRead, /*!< Transfer 7 32-bit words (CS + ID + 17~20 bytes data).*/ - kFLEXCAN_8WordPerRead, /*!< Transfer 8 32-bit words (CS + ID + 21~24 bytes data).*/ - kFLEXCAN_9WordPerRead, /*!< Transfer 9 32-bit words (CS + ID + 25~28 bytes data).*/ - kFLEXCAN_10WordPerRead, /*!< Transfer 10 32-bit words (CS + ID + 29~32 bytes data).*/ - kFLEXCAN_11WordPerRead, /*!< Transfer 11 32-bit words (CS + ID + 33~36 bytes data).*/ - kFLEXCAN_12WordPerRead, /*!< Transfer 12 32-bit words (CS + ID + 37~40 bytes data).*/ - kFLEXCAN_13WordPerRead, /*!< Transfer 13 32-bit words (CS + ID + 41~44 bytes data).*/ - kFLEXCAN_14WordPerRead, /*!< Transfer 14 32-bit words (CS + ID + 45~48 bytes data).*/ - kFLEXCAN_15WordPerRead, /*!< Transfer 15 32-bit words (CS + ID + 49~52 bytes data).*/ - kFLEXCAN_16WordPerRead, /*!< Transfer 16 32-bit words (CS + ID + 53~56 bytes data).*/ - kFLEXCAN_17WordPerRead, /*!< Transfer 17 32-bit words (CS + ID + 57~60 bytes data).*/ - kFLEXCAN_18WordPerRead, /*!< Transfer 18 32-bit words (CS + ID + 61~64 bytes data).*/ - kFLEXCAN_19WordPerRead /*!< Transfer 19 32-bit words (CS + ID + 64 bytes data + ID HIT).*/ -} flexcan_efifo_dma_per_read_length_t; -#endif - -/*! - * @brief FlexCAN Enhanced/Legacy Rx FIFO priority. - * - * The matching process starts from the Rx MB(or Enhanced/Legacy Rx FIFO) with higher priority. - * If no MB(or Enhanced/Legacy Rx FIFO filter) is satisfied, the matching process goes on with - * the Enhanced/Legacy Rx FIFO(or Rx MB) with lower priority. - */ -typedef enum _flexcan_rx_fifo_priority -{ - kFLEXCAN_RxFifoPrioLow = 0x0U, /*!< Matching process start from Rx Message Buffer first. */ - kFLEXCAN_RxFifoPrioHigh = 0x1U, /*!< Matching process start from Enhanced/Legacy Rx FIFO first. */ -} flexcan_rx_fifo_priority_t; - -/*! - * @brief FlexCAN interrupt enable enumerations. - * - * This provides constants for the FlexCAN interrupt enable enumerations for use in the FlexCAN functions. - * @note FlexCAN Message Buffers and Legacy Rx FIFO interrupts not included in. - */ -enum _flexcan_interrupt_enable -{ - kFLEXCAN_BusOffInterruptEnable = CAN_CTRL1_BOFFMSK_MASK, /*!< Bus Off interrupt, use bit 15. */ - kFLEXCAN_ErrorInterruptEnable = CAN_CTRL1_ERRMSK_MASK, /*!< CAN Error interrupt, use bit 14. */ - kFLEXCAN_TxWarningInterruptEnable = CAN_CTRL1_TWRNMSK_MASK, /*!< Tx Warning interrupt, use bit 11. */ - kFLEXCAN_RxWarningInterruptEnable = CAN_CTRL1_RWRNMSK_MASK, /*!< Rx Warning interrupt, use bit 10. */ - kFLEXCAN_WakeUpInterruptEnable = CAN_MCR_WAKMSK_MASK, /*!< Self Wake Up interrupt, use bit 26. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - kFLEXCAN_FDErrorInterruptEnable = CAN_CTRL2_ERRMSK_FAST_MASK, /*!< CAN FD Error interrupt, use bit 31. */ -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - /*! PN Match Wake Up interrupt, use high word bit 17. */ - kFLEXCAN_PNMatchWakeUpInterruptEnable = FLEXCAN_PN_INT_MASK(CAN_CTRL1_PN_WTOF_MSK_MASK), - /*! PN Timeout Wake Up interrupt, use high word bit 16. */ - kFLEXCAN_PNTimeoutWakeUpInterruptEnable = FLEXCAN_PN_INT_MASK(CAN_CTRL1_PN_WUMF_MSK_MASK), -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - /*!< Enhanced Rx FIFO Underflow interrupt, use high word bit 31. */ - kFLEXCAN_ERxFifoUnderflowInterruptEnable = FLEXCAN_EFIFO_INT_MASK(CAN_ERFIER_ERFUFWIE_MASK), - /*!< Enhanced Rx FIFO Overflow interrupt, use high word bit 30. */ - kFLEXCAN_ERxFifoOverflowInterruptEnable = FLEXCAN_EFIFO_INT_MASK(CAN_ERFIER_ERFOVFIE_MASK), - /*!< Enhanced Rx FIFO Watermark interrupt, use high word bit 29. */ - kFLEXCAN_ERxFifoWatermarkInterruptEnable = FLEXCAN_EFIFO_INT_MASK(CAN_ERFIER_ERFWMIIE_MASK), - /*!< Enhanced Rx FIFO Data Avilable interrupt, use high word bit 28. */ - kFLEXCAN_ERxFifoDataAvlInterruptEnable = FLEXCAN_EFIFO_INT_MASK(CAN_ERFIER_ERFDAIE_MASK), -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - /*! Host Access With Non-Correctable Errors interrupt, use high word bit 0. */ - kFLEXCAN_HostAccessNCErrorInterruptEnable = FLEXCAN_MECR_INT_MASK(CAN_MECR_HANCEI_MSK_MASK), - /*! FlexCAN Access With Non-Correctable Errors interrupt, use high word bit 2. */ - kFLEXCAN_FlexCanAccessNCErrorInterruptEnable = FLEXCAN_MECR_INT_MASK(CAN_MECR_FANCEI_MSK_MASK), - /*! Host or FlexCAN Access With Correctable Errors interrupt, use high word bit 3. */ - kFLEXCAN_HostOrFlexCanCErrorInterruptEnable = FLEXCAN_MECR_INT_MASK(CAN_MECR_CEI_MSK_MASK), -#endif -}; - -/*! - * @brief FlexCAN status flags. - * - * This provides constants for the FlexCAN status flags for use in the FlexCAN functions. - * @note The CPU read action clears the bits corresponding to the FlEXCAN_ErrorFlag macro, therefore user need to - * read status flags and distinguish which error is occur using @ref _flexcan_error_flags enumerations. - */ -enum _flexcan_flags -{ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - kFLEXCAN_ErrorOverrunFlag = CAN_ESR1_ERROVR_MASK, /*!< Error Overrun Status. */ - kFLEXCAN_FDErrorIntFlag = CAN_ESR1_ERRINT_FAST_MASK, /*!< CAN FD Error Interrupt Flag. */ - kFLEXCAN_BusoffDoneIntFlag = CAN_ESR1_BOFFDONEINT_MASK, /*!< Bus Off process completed Interrupt Flag. */ -#endif - kFLEXCAN_SynchFlag = CAN_ESR1_SYNCH_MASK, /*!< CAN Synchronization Status. */ - kFLEXCAN_TxWarningIntFlag = CAN_ESR1_TWRNINT_MASK, /*!< Tx Warning Interrupt Flag. */ - kFLEXCAN_RxWarningIntFlag = CAN_ESR1_RWRNINT_MASK, /*!< Rx Warning Interrupt Flag. */ - kFLEXCAN_IdleFlag = CAN_ESR1_IDLE_MASK, /*!< FlexCAN In IDLE Status. */ - kFLEXCAN_FaultConfinementFlag = CAN_ESR1_FLTCONF_MASK, /*!< FlexCAN Fault Confinement State. */ - kFLEXCAN_TransmittingFlag = CAN_ESR1_TX_MASK, /*!< FlexCAN In Transmission Status. */ - kFLEXCAN_ReceivingFlag = CAN_ESR1_RX_MASK, /*!< FlexCAN In Reception Status. */ - kFLEXCAN_BusOffIntFlag = CAN_ESR1_BOFFINT_MASK, /*!< Bus Off Interrupt Flag. */ - kFLEXCAN_ErrorIntFlag = CAN_ESR1_ERRINT_MASK, /*!< CAN Error Interrupt Flag. */ - kFLEXCAN_WakeUpIntFlag = CAN_ESR1_WAKINT_MASK, /*!< Self Wake-Up Interrupt Flag. */ - kFLEXCAN_ErrorFlag = - (uint32_t)(/*!< All FlexCAN Read Clear Error Status. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - CAN_ESR1_STFERR_FAST_MASK | CAN_ESR1_FRMERR_FAST_MASK | CAN_ESR1_CRCERR_FAST_MASK | - CAN_ESR1_BIT0ERR_FAST_MASK | CAN_ESR1_BIT1ERR_FAST_MASK | CAN_ESR1_ERROVR_MASK | -#endif - CAN_ESR1_TXWRN_MASK | CAN_ESR1_RXWRN_MASK | CAN_ESR1_BIT1ERR_MASK | CAN_ESR1_BIT0ERR_MASK | - CAN_ESR1_ACKERR_MASK | CAN_ESR1_CRCERR_MASK | CAN_ESR1_FRMERR_MASK | CAN_ESR1_STFERR_MASK), -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - kFLEXCAN_PNMatchIntFlag = FLEXCAN_PN_STATUS_MASK(CAN_WU_MTC_WUMF_MASK), /*!< PN Matching Event Interrupt Flag. */ - kFLEXCAN_PNTimeoutIntFlag = FLEXCAN_PN_STATUS_MASK(CAN_WU_MTC_WTOF_MASK), /*!< PN Timeout Event Interrupt Flag. */ -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - kFLEXCAN_ERxFifoUnderflowIntFlag = - FLEXCAN_EFIFO_STATUS_MASK(CAN_ERFSR_ERFUFW_MASK), /*!< Enhanced Rx FIFO underflow Interrupt Flag. */ - kFLEXCAN_ERxFifoOverflowIntFlag = - FLEXCAN_EFIFO_STATUS_MASK(CAN_ERFSR_ERFOVF_MASK), /*!< Enhanced Rx FIFO overflow Interrupt Flag. */ - kFLEXCAN_ERxFifoWatermarkIntFlag = - FLEXCAN_EFIFO_STATUS_MASK(CAN_ERFSR_ERFWMI_MASK), /*!< Enhanced Rx FIFO watermark Interrupt Flag. */ - kFLEXCAN_ERxFifoDataAvlIntFlag = - FLEXCAN_EFIFO_STATUS_MASK(CAN_ERFSR_ERFDA_MASK), /*!< Enhanced Rx FIFO data available Interrupt Flag. */ - kFLEXCAN_ERxFifoEmptyFlag = FLEXCAN_EFIFO_STATUS_MASK(CAN_ERFSR_ERFE_MASK), /*!< Enhanced Rx FIFO empty status. */ - kFLEXCAN_ERxFifoFullFlag = FLEXCAN_EFIFO_STATUS_MASK(CAN_ERFSR_ERFF_MASK), /*!< Enhanced Rx FIFO full status. */ -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - /*! Host Access With Non-Correctable Error Interrupt Flag. */ - kFLEXCAN_HostAccessNonCorrectableErrorIntFlag = FLEXCAN_MECR_INT_MASK(CAN_ERRSR_HANCEIF_MASK), - /*! FlexCAN Access With Non-Correctable Error Interrupt Flag. */ - kFLEXCAN_FlexCanAccessNonCorrectableErrorIntFlag = FLEXCAN_MECR_INT_MASK(CAN_ERRSR_FANCEIF_MASK), - /*! Correctable Error Interrupt Flag. */ - kFLEXCAN_CorrectableErrorIntFlag = FLEXCAN_MECR_INT_MASK(CAN_ERRSR_CEIF_MASK), - /*! Host Access With Non-Correctable Error Interrupt Overrun Flag. */ - kFLEXCAN_HostAccessNonCorrectableErrorOverrunFlag = FLEXCAN_MECR_INT_MASK(CAN_ERRSR_HANCEIOF_MASK), - /*! FlexCAN Access With Non-Correctable Error Interrupt Overrun Flag. */ - kFLEXCAN_FlexCanAccessNonCorrectableErrorOverrunFlag = FLEXCAN_MECR_INT_MASK(CAN_ERRSR_FANCEIOF_MASK), - /*! Correctable Error Interrupt Overrun Flag. */ - kFLEXCAN_CorrectableErrorOverrunFlag = FLEXCAN_MECR_INT_MASK(CAN_ERRSR_CEIOF_MASK), - /*! All Memory Error Flags. */ - kFLEXCAN_AllMemoryErrorFlag = - (kFLEXCAN_HostAccessNonCorrectableErrorIntFlag | kFLEXCAN_FlexCanAccessNonCorrectableErrorIntFlag | - kFLEXCAN_CorrectableErrorIntFlag | kFLEXCAN_HostAccessNonCorrectableErrorOverrunFlag | - kFLEXCAN_FlexCanAccessNonCorrectableErrorOverrunFlag | kFLEXCAN_CorrectableErrorOverrunFlag) -#endif -}; - -/*! - * @brief FlexCAN error status flags. - * - * The FlexCAN Error Status enumerations is used to report current error of the FlexCAN bus. - * This enumerations should be used with KFLEXCAN_ErrorFlag in @ref _flexcan_flags enumerations - * to ditermine which error is generated. - */ -enum _flexcan_error_flags -{ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - kFLEXCAN_FDStuffingError = CAN_ESR1_STFERR_FAST_MASK, /*!< Stuffing Error. */ - kFLEXCAN_FDFormError = CAN_ESR1_FRMERR_FAST_MASK, /*!< Form Error. */ - kFLEXCAN_FDCrcError = CAN_ESR1_CRCERR_FAST_MASK, /*!< Cyclic Redundancy Check Error. */ - kFLEXCAN_FDBit0Error = CAN_ESR1_BIT0ERR_FAST_MASK, /*!< Unable to send dominant bit. */ - kFLEXCAN_FDBit1Error = (int)CAN_ESR1_BIT1ERR_FAST_MASK, /*!< Unable to send recessive bit. */ -#endif - kFLEXCAN_TxErrorWarningFlag = CAN_ESR1_TXWRN_MASK, /*!< Tx Error Warning Status. */ - kFLEXCAN_RxErrorWarningFlag = CAN_ESR1_RXWRN_MASK, /*!< Rx Error Warning Status. */ - kFLEXCAN_StuffingError = CAN_ESR1_STFERR_MASK, /*!< Stuffing Error. */ - kFLEXCAN_FormError = CAN_ESR1_FRMERR_MASK, /*!< Form Error. */ - kFLEXCAN_CrcError = CAN_ESR1_CRCERR_MASK, /*!< Cyclic Redundancy Check Error. */ - kFLEXCAN_AckError = CAN_ESR1_ACKERR_MASK, /*!< Received no ACK on transmission. */ - kFLEXCAN_Bit0Error = CAN_ESR1_BIT0ERR_MASK, /*!< Unable to send dominant bit. */ - kFLEXCAN_Bit1Error = CAN_ESR1_BIT1ERR_MASK, /*!< Unable to send recessive bit. */ -}; - -/*! - * @brief FlexCAN Legacy Rx FIFO status flags. - * - * The FlexCAN Legacy Rx FIFO Status enumerations are used to determine the status of the - * Rx FIFO. Because Rx FIFO occupy the MB0 ~ MB7 (Rx Fifo filter also occupies - * more Message Buffer space), Rx FIFO status flags are mapped to the corresponding - * Message Buffer status flags. - */ -enum -{ - kFLEXCAN_RxFifoOverflowFlag = CAN_IFLAG1_BUF7I_MASK, /*!< Rx FIFO overflow flag. */ - kFLEXCAN_RxFifoWarningFlag = CAN_IFLAG1_BUF6I_MASK, /*!< Rx FIFO almost full flag. */ - kFLEXCAN_RxFifoFrameAvlFlag = CAN_IFLAG1_BUF5I_MASK, /*!< Frames available in Rx FIFO flag. */ -}; - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -/*! - * @brief FlexCAN Memory Error Type. - */ -typedef enum _flexcan_memory_error_type -{ - kFLEXCAN_CorrectableError = 0U, /*!< The memory error is correctable which means on bit error. */ - kFLEXCAN_NonCorrectableError /*!< The memory error is non-correctable which means two bit errors. */ -} flexcan_memory_error_type_t; - -/*! - * @brief FlexCAN Memory Access Type. - */ -typedef enum _flexcan_memory_access_type -{ - kFLEXCAN_MoveOutFlexCanAccess = 0U, /*!< The memory error was detected during move-out FlexCAN access. */ - kFLEXCAN_MoveInAccess, /*!< The memory error was detected during move-in FlexCAN access. */ - kFLEXCAN_TxArbitrationAccess, /*!< The memory error was detected during Tx Arbitration FlexCAN access. */ - kFLEXCAN_RxMatchingAccess, /*!< The memory error was detected during Rx Matching FlexCAN access. */ - kFLEXCAN_MoveOutHostAccess /*!< The memory error was detected during Rx Matching Host (CPU) access. */ -} flexcan_memory_access_type_t; - -/*! - * @brief FlexCAN Memory Error Byte Syndrome. - */ -typedef enum _flexcan_byte_error_syndrome -{ - kFLEXCAN_NoError = 0U, /*!< No bit error in this byte. */ - kFLEXCAN_ParityBits0Error = 1U, /*!< Parity bit 0 error in this byte. */ - kFLEXCAN_ParityBits1Error = 2U, /*!< Parity bit 1 error in this byte. */ - kFLEXCAN_ParityBits2Error = 4U, /*!< Parity bit 2 error in this byte. */ - kFLEXCAN_ParityBits3Error = 8U, /*!< Parity bit 3 error in this byte. */ - kFLEXCAN_ParityBits4Error = 16U, /*!< Parity bit 4 error in this byte. */ - kFLEXCAN_DataBits0Error = 28U, /*!< Data bit 0 error in this byte. */ - kFLEXCAN_DataBits1Error = 22U, /*!< Data bit 1 error in this byte. */ - kFLEXCAN_DataBits2Error = 19U, /*!< Data bit 2 error in this byte. */ - kFLEXCAN_DataBits3Error = 25U, /*!< Data bit 3 error in this byte. */ - kFLEXCAN_DataBits4Error = 26U, /*!< Data bit 4 error in this byte. */ - kFLEXCAN_DataBits5Error = 7U, /*!< Data bit 5 error in this byte. */ - kFLEXCAN_DataBits6Error = 21U, /*!< Data bit 6 error in this byte. */ - kFLEXCAN_DataBits7Error = 14U, /*!< Data bit 7 error in this byte. */ - kFLEXCAN_AllZeroError = 6U, /*!< All-zeros non-correctable error in this byte. */ - kFLEXCAN_AllOneError = 31U, /*!< All-ones non-correctable error in this byte. */ - kFLEXCAN_NonCorrectableErrors /*!< Non-correctable error in this byte. */ -} flexcan_byte_error_syndrome_t; - -/*! - * @brief FlexCAN memory error register status structure - * - * This structure contains the memory access properties that caused a memory error access. - * It is used as the parameter of FLEXCAN_GetMemoryErrorReportStatus() function. And user can - * use FLEXCAN_GetMemoryErrorReportStatus to get the status of the last memory error access. - */ -typedef struct _flexcan_memory_error_report_status -{ - flexcan_memory_error_type_t errorType; /*!< The type of memory error that giving rise to the report. */ - flexcan_memory_access_type_t accessType; /*!< The type of memory access that giving rise to the memory error. */ - uint16_t accessAddress; /*!< The address where memory error detected. */ - uint32_t errorData; /*!< The raw data word read from memory with error. */ - struct - { - bool byteIsRead; /*!< The byte n (0~3) was read or not. */ - /*!< The type of error and which bit in byte (n) is affected by the error. */ - flexcan_byte_error_syndrome_t bitAffected; - } byteStatus[4]; -} flexcan_memory_error_report_status_t; -#endif - -#if defined(__CC_ARM) -#pragma anon_unions -#endif -/*! @brief FlexCAN message frame structure. */ -typedef struct _flexcan_frame -{ - struct - { - uint32_t timestamp : 16; /*!< FlexCAN internal Free-Running Counter Time Stamp. */ - uint32_t length : 4; /*!< CAN frame data length in bytes (Range: 0~8). */ - uint32_t type : 1; /*!< CAN Frame Type(DATA or REMOTE). */ - uint32_t format : 1; /*!< CAN Frame Identifier(STD or EXT format). */ - uint32_t : 1; /*!< Reserved. */ - uint32_t idhit : 9; /*!< CAN Rx FIFO filter hit id(This value is only used in Rx FIFO receive mode). */ - }; - struct - { - uint32_t id : 29; /*!< CAN Frame Identifier, should be set using FLEXCAN_ID_EXT() or FLEXCAN_ID_STD() macro. */ - uint32_t : 3; /*!< Reserved. */ - }; - union - { - struct - { - uint32_t dataWord0; /*!< CAN Frame payload word0. */ - uint32_t dataWord1; /*!< CAN Frame payload word1. */ - }; - struct - { - uint8_t dataByte3; /*!< CAN Frame payload byte3. */ - uint8_t dataByte2; /*!< CAN Frame payload byte2. */ - uint8_t dataByte1; /*!< CAN Frame payload byte1. */ - uint8_t dataByte0; /*!< CAN Frame payload byte0. */ - uint8_t dataByte7; /*!< CAN Frame payload byte7. */ - uint8_t dataByte6; /*!< CAN Frame payload byte6. */ - uint8_t dataByte5; /*!< CAN Frame payload byte5. */ - uint8_t dataByte4; /*!< CAN Frame payload byte4. */ - }; - }; -} flexcan_frame_t; - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! @brief CAN FD message frame structure. - * - * The CAN FD message supporting up to sixty four bytes can be used for a data frame, depending on the length - * selected for the message buffers. The length should be a enumeration member, see @ref _flexcan_fd_frame_length. - */ -typedef struct _flexcan_fd_frame -{ - struct - { - uint32_t timestamp : 16; /*!< FlexCAN internal Free-Running Counter Time Stamp. */ - uint32_t length : 4; /*!< CAN FD frame data length code (DLC), range see @ref _flexcan_fd_frame_length, When the - length <= 8, it equal to the data length, otherwise the number of valid frame data is - not equal to the length value. user can - use DLC_LENGTH_DECODE(length) macro to get the number of valid data bytes. */ - uint32_t type : 1; /*!< CAN Frame Type(DATA or REMOTE). */ - uint32_t format : 1; /*!< CAN Frame Identifier(STD or EXT format). */ - uint32_t srr : 1; /*!< Substitute Remote request. */ - uint32_t : 6; - uint32_t esi : 1; /*!< Error State Indicator. */ - uint32_t brs : 1; /*!< Bit Rate Switch. */ - uint32_t edl : 1; /*!< Extended Data Length. */ - }; - struct - { - uint32_t id : 29; /*!< CAN Frame Identifier, should be set using FLEXCAN_ID_EXT() or FLEXCAN_ID_STD() macro. */ - uint32_t : 3; /*!< Reserved. */ - }; - union - { - struct - { - uint32_t dataWord[16]; /*!< CAN FD Frame payload, 16 double word maximum. */ - }; - /* Note: the maximum databyte* below is actually 64, user can add them if needed, - or just use dataWord[*] instead. */ - struct - { - uint8_t dataByte3; /*!< CAN Frame payload byte3. */ - uint8_t dataByte2; /*!< CAN Frame payload byte2. */ - uint8_t dataByte1; /*!< CAN Frame payload byte1. */ - uint8_t dataByte0; /*!< CAN Frame payload byte0. */ - uint8_t dataByte7; /*!< CAN Frame payload byte7. */ - uint8_t dataByte6; /*!< CAN Frame payload byte6. */ - uint8_t dataByte5; /*!< CAN Frame payload byte5. */ - uint8_t dataByte4; /*!< CAN Frame payload byte4. */ - }; - }; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - /*! @note ID HIT offset is changed dynamically according to data length code (DLC), when DLC is 15, they will be - * located below. Using FLEXCAN_FixEnhancedRxFifoFrameIdHit API is recommended to ensure this idhit value is - * correct.*/ - uint32_t idhit; /*!< CAN Enhanced Rx FIFO filter hit id (This value is only used in Enhanced Rx FIFO receive - mode). */ -#endif -} flexcan_fd_frame_t; -#endif - -/*! @brief FlexCAN protocol timing characteristic configuration structure. */ -typedef struct _flexcan_timing_config -{ - uint16_t preDivider; /*!< Classic CAN or CAN FD nominal phase bit rate prescaler. */ - uint8_t rJumpwidth; /*!< Classic CAN or CAN FD nominal phase Re-sync Jump Width. */ - uint8_t phaseSeg1; /*!< Classic CAN or CAN FD nominal phase Segment 1. */ - uint8_t phaseSeg2; /*!< Classic CAN or CAN FD nominal phase Segment 2. */ - uint8_t propSeg; /*!< Classic CAN or CAN FD nominal phase Propagation Segment. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - uint16_t fpreDivider; /*!< CAN FD data phase bit rate prescaler. */ - uint8_t frJumpwidth; /*!< CAN FD data phase Re-sync Jump Width. */ - uint8_t fphaseSeg1; /*!< CAN FD data phase Phase Segment 1. */ - uint8_t fphaseSeg2; /*!< CAN FD data phase Phase Segment 2. */ - uint8_t fpropSeg; /*!< CAN FD data phase Propagation Segment. */ -#endif -} flexcan_timing_config_t; - -/*! @brief FlexCAN module configuration structure. - * @deprecated Do not use the baudRate. It has been superceded bitRate - * @deprecated Do not use the baudRateFD. It has been superceded bitRateFD - */ -typedef struct _flexcan_config -{ - union - { - struct - { - uint32_t baudRate; /*!< FlexCAN bit rate in bps, for classical CAN or CANFD nominal phase. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - uint32_t baudRateFD; /*!< FlexCAN FD bit rate in bps, for CANFD data phase. */ -#endif - }; - struct - { - uint32_t bitRate; /*!< FlexCAN bit rate in bps, for classical CAN or CANFD nominal phase. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - uint32_t bitRateFD; /*!< FlexCAN FD bit rate in bps, for CANFD data phase. */ -#endif - }; - }; - flexcan_clock_source_t clkSrc; /*!< Clock source for FlexCAN Protocol Engine. */ - flexcan_wake_up_source_t wakeupSrc; /*!< Wake up source selection. */ - uint8_t maxMbNum; /*!< The maximum number of Message Buffers used by user. */ - bool enableLoopBack; /*!< Enable or Disable Loop Back Self Test Mode. */ - bool enableTimerSync; /*!< Enable or Disable Timer Synchronization. */ - bool enableSelfWakeup; /*!< Enable or Disable Self Wakeup Mode. */ - bool enableIndividMask; /*!< Enable or Disable Rx Individual Mask and Queue feature. */ - bool disableSelfReception; /*!< Enable or Disable Self Reflection. */ - bool enableListenOnlyMode; /*!< Enable or Disable Listen Only Mode. */ -#if !(defined(FSL_FEATURE_FLEXCAN_HAS_NO_SUPV_SUPPORT) && FSL_FEATURE_FLEXCAN_HAS_NO_SUPV_SUPPORT) - bool enableSupervisorMode; /*!< Enable or Disable Supervisor Mode, enable this mode will make registers allow only - Supervisor access. */ -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_DOZE_MODE_SUPPORT) && FSL_FEATURE_FLEXCAN_HAS_DOZE_MODE_SUPPORT) - bool enableDoze; /*!< Enable or Disable Doze Mode. */ -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - bool enablePretendedeNetworking; /*!< Enable or Disable the Pretended Networking mode. */ -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - bool enableMemoryErrorControl; /*!< Enable or Disable the memory errors detection and correction mechanism. */ - bool enableNonCorrectableErrorEnterFreeze; /*!< Enable or Disable Non-Correctable Errors In FlexCAN Access Put - Device In Freeze Mode. */ -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - bool enableTransceiverDelayMeasure; /*!< Enable or Disable the transceiver delay measurement, when it is enabled, - then the secondary sample point position is determined by the sum of the - transceiver delay measurement plus the enhanced TDC offset. */ -#endif - flexcan_timing_config_t timingConfig; /* Protocol timing . */ -} flexcan_config_t; - -/*! - * @brief FlexCAN Receive Message Buffer configuration structure - * - * This structure is used as the parameter of FLEXCAN_SetRxMbConfig() function. - * The FLEXCAN_SetRxMbConfig() function is used to configure FlexCAN Receive - * Message Buffer. The function abort previous receiving process, clean the - * Message Buffer and activate the Rx Message Buffer using given Message Buffer - * setting. - */ -typedef struct _flexcan_rx_mb_config -{ - uint32_t id; /*!< CAN Message Buffer Frame Identifier, should be set using - FLEXCAN_ID_EXT() or FLEXCAN_ID_STD() macro. */ - flexcan_frame_format_t format; /*!< CAN Frame Identifier format(Standard of Extend). */ - flexcan_frame_type_t type; /*!< CAN Frame Type(Data or Remote). */ -} flexcan_rx_mb_config_t; - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) -/*! @brief FlexCAN Pretended Networking match source selection. */ -typedef enum _flexcan_pn_match_source -{ - kFLEXCAN_PNMatSrcID = 0U, /*!< Message match with ID filtering. */ - kFLEXCAN_PNMatSrcIDAndData, /*!< Message match with ID filtering and payload filtering. */ -} flexcan_pn_match_source_t; - -/*! @brief FlexCAN Pretended Networking mode match type. */ -typedef enum _flexcan_pn_match_mode -{ - kFLEXCAN_PNMatModeEqual = 0x0U, /*!< Match upon ID/Payload contents against an exact target value. */ - kFLEXCAN_PNMatModeGreater, /*!< Match upon an ID/Payload value greater than or equal to a specified target value. - */ - kFLEXCAN_PNMatModeSmaller, /*!< Match upon an ID/Payload value smaller than or equal to a specified target value. - */ - kFLEXCAN_PNMatModeRange, /*!< Match upon an ID/Payload value inside a range, greater than or equal to a specified - lower limit, and smaller than or equal to a specified upper limit */ -} flexcan_pn_match_mode_t; - -/*! - * @brief FlexCAN Pretended Networking configuration structure - * - * This structure is used as the parameter of FLEXCAN_SetPNConfig() function. - * The FLEXCAN_SetPNConfig() function is used to configure FlexCAN Networking work mode. - */ -typedef struct _flexcan_pn_config -{ - bool enableTimeout; /*!< Enable or Disable timeout event trigger wakeup.*/ - uint16_t timeoutValue; /*!< The timeout value that generates a wakeup event, the counter timer is incremented based - on 64 times the CAN Bit Time unit. */ - bool enableMatch; /*!< Enable or Disable match event trigger wakeup.*/ - flexcan_pn_match_source_t matchSrc; /*!< Selects the match source (ID and/or data match) to trigger wakeup. */ - uint8_t matchNum; /*!< The number of times a given message must match the predefined ID and/or data before - generating a wakeup event, range in 0x1 ~ 0xFF. */ - flexcan_pn_match_mode_t idMatchMode; /*!< The ID match type. */ - flexcan_pn_match_mode_t dataMatchMode; /*!< The data match type. */ - uint32_t idLower; /*!< The ID target values 1 which used either for ID match "equal to", "smaller than", - "greater than" comparisons, or as the lower limit value in ID match "range detection". */ - uint32_t idUpper; /*!< The ID target values 2 which used only as the upper limit value in ID match "range - detection" or used to store the ID mask in "equal to". */ - uint8_t lengthLower; /*!< The lower limit for length of data bytes which used only in data match "range - detection". Range in 0x0 ~ 0x8.*/ - uint8_t lengthUpper; /*!< The upper limit for length of data bytes which used only in data match "range - detection". Range in 0x0 ~ 0x8.*/ - union - { - /*!< The data target values 1 which used either for data match "equal to", "smaller than", - "greater than" comparisons, or as the lower limit value in data match "range - detection". */ - struct - { - uint32_t lowerWord0; /*!< CAN Frame payload word0. */ - uint32_t lowerWord1; /*!< CAN Frame payload word1. */ - }; - struct - { - uint8_t lowerByte3; /*!< CAN Frame payload byte3. */ - uint8_t lowerByte2; /*!< CAN Frame payload byte2. */ - uint8_t lowerByte1; /*!< CAN Frame payload byte1. */ - uint8_t lowerByte0; /*!< CAN Frame payload byte0. */ - uint8_t lowerByte7; /*!< CAN Frame payload byte7. */ - uint8_t lowerByte6; /*!< CAN Frame payload byte6. */ - uint8_t lowerByte5; /*!< CAN Frame payload byte5. */ - uint8_t lowerByte4; /*!< CAN Frame payload byte4. */ - }; - }; - union - { - /*!< The data target values 2 which used only as the upper limit value in data match "range - detection" or used to store the data mask in "equal to". */ - struct - { - uint32_t upperWord0; /*!< CAN Frame payload word0. */ - uint32_t upperWord1; /*!< CAN Frame payload word1. */ - }; - struct - { - uint8_t upperByte3; /*!< CAN Frame payload byte3. */ - uint8_t upperByte2; /*!< CAN Frame payload byte2. */ - uint8_t upperByte1; /*!< CAN Frame payload byte1. */ - uint8_t upperByte0; /*!< CAN Frame payload byte0. */ - uint8_t upperByte7; /*!< CAN Frame payload byte7. */ - uint8_t upperByte6; /*!< CAN Frame payload byte6. */ - uint8_t upperByte5; /*!< CAN Frame payload byte5. */ - uint8_t upperByte4; /*!< CAN Frame payload byte4. */ - }; - }; -} flexcan_pn_config_t; -#endif - -/*! @brief FlexCAN Legacy Rx FIFO configuration structure. */ -typedef struct _flexcan_rx_fifo_config -{ - uint32_t *idFilterTable; /*!< Pointer to the FlexCAN Legacy Rx FIFO identifier filter table. */ - uint8_t idFilterNum; /*!< The FlexCAN Legacy Rx FIFO Filter elements quantity. */ - flexcan_rx_fifo_filter_type_t idFilterType; /*!< The FlexCAN Legacy Rx FIFO Filter type. */ - flexcan_rx_fifo_priority_t priority; /*!< The FlexCAN Legacy Rx FIFO receive priority. */ -} flexcan_rx_fifo_config_t; - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! @brief FlexCAN Enhanced Rx FIFO Standard ID filter element structure. */ -typedef struct _flexcan_enhanced_rx_fifo_std_id_filter -{ - uint32_t filterType : 2; /*!< FlexCAN internal Free-Running Counter Time Stamp. */ - uint32_t : 2; - uint32_t rtr1 : 1; /*!< CAN FD frame data length code (DLC), range see @ref _flexcan_fd_frame_length, When the - length <= 8, it equal to the data length, otherwise the number of valid frame data is - not equal to the length value. user can - use DLC_LENGTH_DECODE(length) macro to get the number of valid data bytes. */ - uint32_t std1 : 11; /*!< CAN Frame Type(DATA or REMOTE). */ - uint32_t : 4; - uint32_t rtr2 : 1; /*!< CAN Frame Identifier(STD or EXT format). */ - uint32_t std2 : 11; /*!< Substitute Remote request. */ -} flexcan_enhanced_rx_fifo_std_id_filter_t; - -/*! @brief FlexCAN Enhanced Rx FIFO Extended ID filter element structure. */ -typedef struct _flexcan_enhanced_rx_fifo_ext_id_filter -{ - uint32_t filterType : 2; /*!< FlexCAN internal Free-Running Counter Time Stamp. */ - uint32_t rtr1 : 1; /*!< CAN FD frame data length code (DLC), range see @ref _flexcan_fd_frame_length, When the - length <= 8, it equal to the data length, otherwise the number of valid frame data is - not equal to the length value. user can - use DLC_LENGTH_DECODE(length) macro to get the number of valid data bytes. */ - uint32_t std1 : 29; /*!< CAN Frame Type(DATA or REMOTE). */ - uint32_t : 2; - uint32_t rtr2 : 1; /*!< CAN Frame Identifier(STD or EXT format). */ - uint32_t std2 : 29; /*!< Substitute Remote request. */ -} flexcan_enhanced_rx_fifo_ext_id_filter_t; -/*! @brief FlexCAN Enhanced Rx FIFO configuration structure. */ -typedef struct _flexcan_enhanced_rx_fifo_config -{ - uint32_t *idFilterTable; /*!< Pointer to the FlexCAN Enhanced Rx FIFO identifier filter table, each table member - occupies 32 bit word, table size should be equal to idFilterNum. There are two types of - Enhanced Rx FIFO filter elements that can be stored in table : extended-ID filter element - (1 word, occupie 1 table members) and standard-ID filter element (2 words, occupies 2 table - members), the extended-ID filter element needs to be placed in front of the table. */ - uint8_t idFilterPairNum; /*!< idFilterPairNum is the Enhanced Rx FIFO identifier filter element pair numbers, - each pair of filter elements occupies 2 words and can consist of one extended ID filter - element or two standard ID filter elements. */ - uint8_t extendIdFilterNum; /*!< The number of extended ID filter element items in the FlexCAN enhanced Rx FIFO - identifier filter table, each extended-ID filter element occupies 2 words, - extendIdFilterNum need less than or equal to idFilterPairNum. */ - uint8_t fifoWatermark; /*!< (fifoWatermark + 1) is the minimum number of CAN messages stored in the Enhanced RX FIFO - which can trigger FIFO watermark interrupt or a DMA request. */ - flexcan_efifo_dma_per_read_length_t dmaPerReadLength; /*!< Define the length of each read of the Enhanced RX FIFO - element by the DAM, see @ref _flexcan_fd_frame_length. */ - flexcan_rx_fifo_priority_t priority; /*!< The FlexCAN Enhanced Rx FIFO receive priority. */ -} flexcan_enhanced_rx_fifo_config_t; -#endif - -/*! @brief FlexCAN Message Buffer transfer. */ -typedef struct _flexcan_mb_transfer -{ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - flexcan_fd_frame_t *framefd; -#endif - flexcan_frame_t *frame; /*!< The buffer of CAN Message to be transfer. */ - uint8_t mbIdx; /*!< The index of Message buffer used to transfer Message. */ -} flexcan_mb_transfer_t; - -/*! @brief FlexCAN Rx FIFO transfer. */ -typedef struct _flexcan_fifo_transfer -{ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - flexcan_fd_frame_t *framefd; /*!< The buffer of CAN Message to be received from Enhanced Rx FIFO. */ -#endif - flexcan_frame_t *frame; /*!< The buffer of CAN Message to be received from Legacy Rx FIFO. */ - size_t frameNum; /*!< Number of CAN Message need to be received from Legacy or Ehanced Rx FIFO. */ -} flexcan_fifo_transfer_t; - -/*! @brief FlexCAN handle structure definition. */ -typedef struct _flexcan_handle flexcan_handle_t; - -/*! @brief FlexCAN transfer callback function. - * - * The FlexCAN transfer callback returns a value from the underlying layer. - * If the status equals to kStatus_FLEXCAN_ErrorStatus, the result parameter is the Content of - * FlexCAN status register which can be used to get the working status(or error status) of FlexCAN module. - * If the status equals to other FlexCAN Message Buffer transfer status, the result is the index of - * Message Buffer that generate transfer event. - * If the status equals to other FlexCAN Message Buffer transfer status, the result is meaningless and should be - * Ignored. - */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -#define FLEXCAN_CALLBACK(x) \ - void(x)(CAN_Type * base, flexcan_handle_t * handle, status_t status, uint64_t result, void *userData) -typedef void (*flexcan_transfer_callback_t)( - CAN_Type *base, flexcan_handle_t *handle, status_t status, uint64_t result, void *userData); -#else -#define FLEXCAN_CALLBACK(x) \ - void(x)(CAN_Type * base, flexcan_handle_t * handle, status_t status, uint32_t result, void *userData) -typedef void (*flexcan_transfer_callback_t)( - CAN_Type *base, flexcan_handle_t *handle, status_t status, uint32_t result, void *userData); -#endif - -/*! @brief FlexCAN handle structure. */ -struct _flexcan_handle -{ - flexcan_transfer_callback_t callback; /*!< Callback function. */ - void *userData; /*!< FlexCAN callback function parameter.*/ - flexcan_frame_t - *volatile mbFrameBuf[CAN_WORD1_COUNT]; /*!< The buffer for received CAN data from Message Buffers. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - flexcan_fd_frame_t - *volatile mbFDFrameBuf[CAN_WORD1_COUNT]; /*!< The buffer for received CAN FD data from Message Buffers. */ -#endif - flexcan_frame_t *volatile rxFifoFrameBuf; /*!< The buffer for received CAN data from Legacy Rx FIFO. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - flexcan_fd_frame_t *volatile rxFifoFDFrameBuf; /*!< The buffer for received CAN FD data from Ehanced Rx FIFO. */ -#endif - size_t rxFifoFrameNum; /*!< The number of CAN messages remaining to be received from Legacy or Ehanced Rx FIFO. */ - size_t rxFifoTransferTotalNum; /*!< Total CAN Message number need to be received from Legacy or Ehanced Rx FIFO. */ - volatile uint8_t mbState[CAN_WORD1_COUNT]; /*!< Message Buffer transfer state. */ - volatile uint8_t rxFifoState; /*!< Rx FIFO transfer state. */ - volatile uint32_t timestamp[CAN_WORD1_COUNT]; /*!< Mailbox transfer timestamp. */ -}; - -/****************************************************************************** - * API - *****************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * @brief Determine whether the FlexCAN instance support CAN FD mode at run time. - * - * @note Use this API only if different soc parts share the SOC part name macro define. Otherwise, a different SOC part - * name can be used to determine at compile time whether the FlexCAN instance supports CAN FD mode or not. - * If need use this API to determine if CAN FD mode is supported, the FLEXCAN_Init function needs to be - * executed first, and then call this API and use the return to value determines whether to supports CAN FD mode, - * if return true, continue calling FLEXCAN_FDInit to enable CAN FD mode. - * - * @param base FlexCAN peripheral base address. - * @return return TRUE if instance support CAN FD mode, FALSE if instance only support classic CAN (2.0) mode. - */ -bool FLEXCAN_IsInstanceHasFDMode(CAN_Type *base); -#endif - -/*! - * @brief Enter FlexCAN Freeze Mode. - * - * This function makes the FlexCAN work under Freeze Mode. - * - * @param base FlexCAN peripheral base address. - */ -void FLEXCAN_EnterFreezeMode(CAN_Type *base); - -/*! - * @brief Exit FlexCAN Freeze Mode. - * - * This function makes the FlexCAN leave Freeze Mode. - * - * @param base FlexCAN peripheral base address. - */ -void FLEXCAN_ExitFreezeMode(CAN_Type *base); - -/*! - * @brief Get the FlexCAN instance from peripheral base address. - * - * @param base FlexCAN peripheral base address. - * @return FlexCAN instance. - */ -uint32_t FLEXCAN_GetInstance(CAN_Type *base); - -/*! - * @brief Calculates the improved timing values by specific bit Rates for classical CAN. - * - * This function use to calculates the Classical CAN timing values according to the given bit rate. The Calculated - * timing values will be set in CTRL1/CBT/ENCBT register. The calculation is based on the recommendation of the CiA 301 - * v4.2.0 and previous version document. - * - * @param base FlexCAN peripheral base address. - * @param bitRate The classical CAN speed in bps defined by user, should be less than or equal to 1Mbps. - * @param sourceClock_Hz The Source clock frequency in Hz. - * @param pTimingConfig Pointer to the FlexCAN timing configuration structure. - * - * @return TRUE if timing configuration found, FALSE if failed to find configuration. - */ -bool FLEXCAN_CalculateImprovedTimingValues(CAN_Type *base, - uint32_t bitRate, - uint32_t sourceClock_Hz, - flexcan_timing_config_t *pTimingConfig); - -/*! - * @brief Initializes a FlexCAN instance. - * - * This function initializes the FlexCAN module with user-defined settings. - * This example shows how to set up the flexcan_config_t parameters and how - * to call the FLEXCAN_Init function by passing in these parameters. - * @code - * flexcan_config_t flexcanConfig; - * flexcanConfig.clkSrc = kFLEXCAN_ClkSrc0; - * flexcanConfig.bitRate = 1000000U; - * flexcanConfig.maxMbNum = 16; - * flexcanConfig.enableLoopBack = false; - * flexcanConfig.enableSelfWakeup = false; - * flexcanConfig.enableIndividMask = false; - * flexcanConfig.enableDoze = false; - * flexcanConfig.disableSelfReception = false; - * flexcanConfig.enableListenOnlyMode = false; - * flexcanConfig.timingConfig = timingConfig; - * FLEXCAN_Init(CAN0, &flexcanConfig, 40000000UL); - * @endcode - * - * @param base FlexCAN peripheral base address. - * @param pConfig Pointer to the user-defined configuration structure. - * @param sourceClock_Hz FlexCAN Protocol Engine clock source frequency in Hz. - */ -void FLEXCAN_Init(CAN_Type *base, const flexcan_config_t *pConfig, uint32_t sourceClock_Hz); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * @brief Calculates the improved timing values by specific bit rates for CANFD. - * - * This function use to calculates the CANFD timing values according to the given nominal phase bit rate and data phase - * bit rate. The Calculated timing values will be set in CBT/ENCBT and FDCBT/EDCBT registers. The calculation is based - * on the recommendation of the CiA 1301 v1.0.0 document. - * - * @param base FlexCAN peripheral base address. - * @param bitRate The CANFD bus control speed in bps defined by user. - * @param bitRateFD The CAN FD data phase speed in bps defined by user. Equal to bitRate means disable bit rate - * switching. - * @param sourceClock_Hz The Source clock frequency in Hz. - * @param pTimingConfig Pointer to the FlexCAN timing configuration structure. - * - * @return TRUE if timing configuration found, FALSE if failed to find configuration - */ -bool FLEXCAN_FDCalculateImprovedTimingValues(CAN_Type *base, - uint32_t bitRate, - uint32_t bitRateFD, - uint32_t sourceClock_Hz, - flexcan_timing_config_t *pTimingConfig); -/*! - * @brief Initializes a FlexCAN instance. - * - * This function initializes the FlexCAN module with user-defined settings. - * This example shows how to set up the flexcan_config_t parameters and how - * to call the FLEXCAN_FDInit function by passing in these parameters. - * @code - * flexcan_config_t flexcanConfig; - * flexcanConfig.clkSrc = kFLEXCAN_ClkSrc0; - * flexcanConfig.bitRate = 1000000U; - * flexcanConfig.bitRateFD = 2000000U; - * flexcanConfig.maxMbNum = 16; - * flexcanConfig.enableLoopBack = false; - * flexcanConfig.enableSelfWakeup = false; - * flexcanConfig.enableIndividMask = false; - * flexcanConfig.disableSelfReception = false; - * flexcanConfig.enableListenOnlyMode = false; - * flexcanConfig.enableDoze = false; - * flexcanConfig.timingConfig = timingConfig; - * FLEXCAN_FDInit(CAN0, &flexcanConfig, 80000000UL, kFLEXCAN_16BperMB, true); - * @endcode - * - * @param base FlexCAN peripheral base address. - * @param pConfig Pointer to the user-defined configuration structure. - * @param sourceClock_Hz FlexCAN Protocol Engine clock source frequency in Hz. - * @param dataSize FlexCAN Message Buffer payload size. The actual transmitted or received CAN FD frame data size needs - * to be less than or equal to this value. - * @param brs True if bit rate switch is enabled in FD mode. - */ -void FLEXCAN_FDInit( - CAN_Type *base, const flexcan_config_t *pConfig, uint32_t sourceClock_Hz, flexcan_mb_size_t dataSize, bool brs); -#endif - -/*! - * @brief De-initializes a FlexCAN instance. - * - * This function disables the FlexCAN module clock and sets all register values - * to the reset value. - * - * @param base FlexCAN peripheral base address. - */ -void FLEXCAN_Deinit(CAN_Type *base); - -/*! - * @brief Gets the default configuration structure. - * - * This function initializes the FlexCAN configuration structure to default values. The default - * values are as follows. - * flexcanConfig->clkSrc = kFLEXCAN_ClkSrc0; - * flexcanConfig->bitRate = 1000000U; - * flexcanConfig->bitRateFD = 2000000U; - * flexcanConfig->maxMbNum = 16; - * flexcanConfig->enableLoopBack = false; - * flexcanConfig->enableSelfWakeup = false; - * flexcanConfig->enableIndividMask = false; - * flexcanConfig->disableSelfReception = false; - * flexcanConfig->enableListenOnlyMode = false; - * flexcanConfig->enableDoze = false; - * flexcanConfig->enableMemoryErrorControl = true; - * flexcanConfig->enableNonCorrectableErrorEnterFreeze = true; - * flexcanConfig.timingConfig = timingConfig; - * - * @param pConfig Pointer to the FlexCAN configuration structure. - */ -void FLEXCAN_GetDefaultConfig(flexcan_config_t *pConfig); - -/* @} */ - -/*! - * @name Configuration. - * @{ - */ - -/*! - * @brief Sets the FlexCAN classical CAN protocol timing characteristic. - * - * This function gives user settings to classical CAN or CAN FD nominal phase timing characteristic. - * The function is for an experienced user. For less experienced users, call the FLEXCAN_SetBitRate() instead. - * - * @note Calling FLEXCAN_SetTimingConfig() overrides the bit rate set in FLEXCAN_Init() or FLEXCAN_SetBitRate(). - * - * @param base FlexCAN peripheral base address. - * @param pConfig Pointer to the timing configuration structure. - */ -void FLEXCAN_SetTimingConfig(CAN_Type *base, const flexcan_timing_config_t *pConfig); - -/*! - * @brief Set bit rate of FlexCAN classical CAN frame or CAN FD frame nominal phase. - * - * This function set the bit rate of classical CAN frame or CAN FD frame nominal phase base on - * FLEXCAN_CalculateImprovedTimingValues() API calculated timing values. - * - * @note Calling FLEXCAN_SetBitRate() overrides the bit rate set in FLEXCAN_Init(). - * - * @param base FlexCAN peripheral base address. - * @param sourceClock_Hz Source Clock in Hz. - * @param bitRate_Bps Bit rate in Bps. - * @return kStatus_Success - Set CAN baud rate (only Nominal phase) successfully. - */ -status_t FLEXCAN_SetBitRate(CAN_Type *base, uint32_t sourceClock_Hz, uint32_t bitRate_Bps); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * @brief Sets the FlexCAN CANFD data phase timing characteristic. - * - * This function gives user settings to CANFD data phase timing characteristic. - * The function is for an experienced user. For less experienced users, call the FLEXCAN_SetFDBitRate() - * to set both Nominal/Data bit Rate instead. - * - * @note Calling FLEXCAN_SetFDTimingConfig() overrides the data phase bit rate set in - * FLEXCAN_FDInit()/FLEXCAN_SetFDBitRate(). - * - * @param base FlexCAN peripheral base address. - * @param pConfig Pointer to the timing configuration structure. - */ -void FLEXCAN_SetFDTimingConfig(CAN_Type *base, const flexcan_timing_config_t *pConfig); - -/*! - * @brief Set bit rate of FlexCAN FD frame. - * - * This function set the baud rate of FLEXCAN FD base on FLEXCAN_FDCalculateImprovedTimingValues() API calculated timing - * values. - * - * @param base FlexCAN peripheral base address. - * @param sourceClock_Hz Source Clock in Hz. - * @param bitRateN_Bps Nominal bit Rate in Bps. - * @param bitRateD_Bps Data bit Rate in Bps. - * @return kStatus_Success - Set CAN FD bit rate (include Nominal and Data phase) successfully. - */ -status_t FLEXCAN_SetFDBitRate(CAN_Type *base, uint32_t sourceClock_Hz, uint32_t bitRateN_Bps, uint32_t bitRateD_Bps); -#endif - -/*! - * @brief Sets the FlexCAN receive message buffer global mask. - * - * This function sets the global mask for the FlexCAN message buffer in a matching process. - * The configuration is only effective when the Rx individual mask is disabled in the FLEXCAN_Init(). - * - * @param base FlexCAN peripheral base address. - * @param mask Rx Message Buffer Global Mask value. - */ -void FLEXCAN_SetRxMbGlobalMask(CAN_Type *base, uint32_t mask); - -/*! - * @brief Sets the FlexCAN receive FIFO global mask. - * - * This function sets the global mask for FlexCAN FIFO in a matching process. - * - * @param base FlexCAN peripheral base address. - * @param mask Rx Fifo Global Mask value. - */ -void FLEXCAN_SetRxFifoGlobalMask(CAN_Type *base, uint32_t mask); - -/*! - * @brief Sets the FlexCAN receive individual mask. - * - * This function sets the individual mask for the FlexCAN matching process. - * The configuration is only effective when the Rx individual mask is enabled in the FLEXCAN_Init(). - * If the Rx FIFO is disabled, the individual mask is applied to the corresponding Message Buffer. - * If the Rx FIFO is enabled, the individual mask for Rx FIFO occupied Message Buffer is applied to - * the Rx Filter with the same index. Note that only the first 32 - * individual masks can be used as the Rx FIFO filter mask. - * - * @param base FlexCAN peripheral base address. - * @param maskIdx The Index of individual Mask. - * @param mask Rx Individual Mask value. - */ -void FLEXCAN_SetRxIndividualMask(CAN_Type *base, uint8_t maskIdx, uint32_t mask); - -/*! - * @brief Configures a FlexCAN transmit message buffer. - * - * This function aborts the previous transmission, cleans the Message Buffer, and - * configures it as a Transmit Message Buffer. - * - * @param base FlexCAN peripheral base address. - * @param mbIdx The Message Buffer index. - * @param enable Enable/disable Tx Message Buffer. - * - true: Enable Tx Message Buffer. - * - false: Disable Tx Message Buffer. - */ -void FLEXCAN_SetTxMbConfig(CAN_Type *base, uint8_t mbIdx, bool enable); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * @brief Configures a FlexCAN transmit message buffer. - * - * This function aborts the previous transmission, cleans the Message Buffer, and - * configures it as a Transmit Message Buffer. - * - * @param base FlexCAN peripheral base address. - * @param mbIdx The Message Buffer index. - * @param enable Enable/disable Tx Message Buffer. - * - true: Enable Tx Message Buffer. - * - false: Disable Tx Message Buffer. - */ -void FLEXCAN_SetFDTxMbConfig(CAN_Type *base, uint8_t mbIdx, bool enable); -#endif - -/*! - * @brief Configures a FlexCAN Receive Message Buffer. - * - * This function cleans a FlexCAN build-in Message Buffer and configures it - * as a Receive Message Buffer. - * - * @param base FlexCAN peripheral base address. - * @param mbIdx The Message Buffer index. - * @param pRxMbConfig Pointer to the FlexCAN Message Buffer configuration structure. - * @param enable Enable/disable Rx Message Buffer. - * - true: Enable Rx Message Buffer. - * - false: Disable Rx Message Buffer. - */ -void FLEXCAN_SetRxMbConfig(CAN_Type *base, uint8_t mbIdx, const flexcan_rx_mb_config_t *pRxMbConfig, bool enable); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * @brief Configures a FlexCAN Receive Message Buffer. - * - * This function cleans a FlexCAN build-in Message Buffer and configures it - * as a Receive Message Buffer. - * - * @param base FlexCAN peripheral base address. - * @param mbIdx The Message Buffer index. - * @param pRxMbConfig Pointer to the FlexCAN Message Buffer configuration structure. - * @param enable Enable/disable Rx Message Buffer. - * - true: Enable Rx Message Buffer. - * - false: Disable Rx Message Buffer. - */ -void FLEXCAN_SetFDRxMbConfig(CAN_Type *base, uint8_t mbIdx, const flexcan_rx_mb_config_t *pRxMbConfig, bool enable); -#endif - -/*! - * @brief Configures the FlexCAN Legacy Rx FIFO. - * - * This function configures the FlexCAN Rx FIFO with given configuration. - * @note Legacy Rx FIFO only can receive classic CAN message. - * - * @param base FlexCAN peripheral base address. - * @param pRxFifoConfig Pointer to the FlexCAN Legacy Rx FIFO configuration structure. Can be NULL when enable parameter - * is false. - * @param enable Enable/disable Legacy Rx FIFO. - * - true: Enable Legacy Rx FIFO. - * - false: Disable Legacy Rx FIFO. - */ -void FLEXCAN_SetRxFifoConfig(CAN_Type *base, const flexcan_rx_fifo_config_t *pRxFifoConfig, bool enable); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * @brief Configures the FlexCAN Enhanced Rx FIFO. - * - * This function configures the Enhanced Rx FIFO with given configuration. - * @note Enhanced Rx FIFO support receive classic CAN or CAN FD messages, Legacy Rx FIFO and Enhanced Rx FIFO - * cannot be enabled at the same time. - * - * @param base FlexCAN peripheral base address. - * @param pConfig Pointer to the FlexCAN Enhanced Rx FIFO configuration structure. Can be NULL when enable parameter - * is false. - * @param enable Enable/disable Enhanced Rx FIFO. - * - true: Enable Enhanced Rx FIFO. - * - false: Disable Enhanced Rx FIFO. - */ -void FLEXCAN_SetEnhancedRxFifoConfig(CAN_Type *base, const flexcan_enhanced_rx_fifo_config_t *pConfig, bool enable); -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) -/*! - * @brief Configures the FlexCAN Pretended Networking mode. - * - * This function configures the FlexCAN Pretended Networking mode with given configuration. - * - * @param base FlexCAN peripheral base address. - * @param pConfig Pointer to the FlexCAN Rx FIFO configuration structure. - */ -void FLEXCAN_SetPNConfig(CAN_Type *base, const flexcan_pn_config_t *pConfig); -#endif -/* @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets the FlexCAN module interrupt flags. - * - * This function gets all FlexCAN status flags. The flags are returned as the logical - * OR value of the enumerators @ref _flexcan_flags. To check the specific status, - * compare the return value with enumerators in @ref _flexcan_flags. - * - * @param base FlexCAN peripheral base address. - * @return FlexCAN status flags which are ORed by the enumerators in the _flexcan_flags. - */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -static inline uint64_t FLEXCAN_GetStatusFlags(CAN_Type *base) -{ - uint64_t tempflag = (uint64_t)base->ESR1; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - /* Get PN Wake Up status. */ - tempflag |= FLEXCAN_PN_STATUS_MASK(base->WU_MTC); -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - /* Get Enhanced Rx FIFO status. */ - tempflag |= FLEXCAN_EFIFO_STATUS_MASK(base->ERFSR); -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - /* Get Memory Error status. */ - tempflag |= FLEXCAN_MECR_STATUS_MASK(base->ERRSR); -#endif - return tempflag; -} -#else -static inline uint32_t FLEXCAN_GetStatusFlags(CAN_Type *base) -{ - return base->ESR1; -} -#endif -/*! - * @brief Clears status flags with the provided mask. - * - * This function clears the FlexCAN status flags with a provided mask. An automatically cleared flag - * can't be cleared by this function. - * - * @param base FlexCAN peripheral base address. - * @param mask The status flags to be cleared, it is logical OR value of @ref _flexcan_flags. - */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -static inline void FLEXCAN_ClearStatusFlags(CAN_Type *base, uint64_t mask) -{ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - /* Clear PN Wake Up status. */ - base->WU_MTC = FLEXCAN_PN_STATUS_UNMASK(mask); -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - /* Clear Enhanced Rx FIFO status. */ - base->ERFSR = FLEXCAN_EFIFO_STATUS_UNMASK(mask); -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - /* Clear Memory Error status. */ - base->ERRSR = FLEXCAN_MECR_STATUS_UNMASK(mask); -#endif - base->ESR1 = (uint32_t)(mask & 0xFFFFFFFFU); -} -#else -static inline void FLEXCAN_ClearStatusFlags(CAN_Type *base, uint32_t mask) -{ - /* Write 1 to clear status flag. */ - base->ESR1 = mask; -} -#endif -/*! - * @brief Gets the FlexCAN Bus Error Counter value. - * - * This function gets the FlexCAN Bus Error Counter value for both Tx and - * Rx direction. These values may be needed in the upper layer error handling. - * - * @param base FlexCAN peripheral base address. - * @param txErrBuf Buffer to store Tx Error Counter value. - * @param rxErrBuf Buffer to store Rx Error Counter value. - */ -static inline void FLEXCAN_GetBusErrCount(CAN_Type *base, uint8_t *txErrBuf, uint8_t *rxErrBuf) -{ - if (NULL != txErrBuf) - { - *txErrBuf = (uint8_t)((base->ECR & CAN_ECR_TXERRCNT_MASK) >> CAN_ECR_TXERRCNT_SHIFT); - } - - if (NULL != rxErrBuf) - { - *rxErrBuf = (uint8_t)((base->ECR & CAN_ECR_RXERRCNT_MASK) >> CAN_ECR_RXERRCNT_SHIFT); - } -} - -/*! - * @brief Gets the FlexCAN Message Buffer interrupt flags. - * - * This function gets the interrupt flags of a given Message Buffers. - * - * @param base FlexCAN peripheral base address. - * @param mask The ORed FlexCAN Message Buffer mask. - * @return The status of given Message Buffers. - */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) -static inline uint64_t FLEXCAN_GetMbStatusFlags(CAN_Type *base, uint64_t mask) -#else -static inline uint32_t FLEXCAN_GetMbStatusFlags(CAN_Type *base, uint32_t mask) -#endif -{ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - uint64_t tempflag = (uint64_t)base->IFLAG1; - return (tempflag | (((uint64_t)base->IFLAG2) << 32)) & mask; -#else - return (base->IFLAG1 & mask); -#endif -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) -/*! - * @brief Gets the FlexCAN High 64 Message Buffer interrupt flags. - * - * Valid only if the number of available MBs exceeds 64. - * - * @param base FlexCAN peripheral base address. - * @param mask The ORed FlexCAN Message Buffer mask. - * @return The status of given Message Buffers. - */ -static inline uint64_t FLEXCAN_GetHigh64MbStatusFlags(CAN_Type *base, uint64_t mask) -{ - uint64_t tempflag = 0U; -#if defined(CAN_IFLAG3_BUF95TO64_MASK) - tempflag |= (uint64_t)base->IFLAG3; -#endif -#if defined(CAN_IFLAG4_BUF127TO96_MASK) - tempflag |= (uint64_t)base->IFLAG4; -#endif - return (tempflag & mask); -} -#endif - -/*! - * @brief Clears the FlexCAN Message Buffer interrupt flags. - * - * This function clears the interrupt flags of a given Message Buffers. - * - * @param base FlexCAN peripheral base address. - * @param mask The ORed FlexCAN Message Buffer mask. - */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) -static inline void FLEXCAN_ClearMbStatusFlags(CAN_Type *base, uint64_t mask) -#else -static inline void FLEXCAN_ClearMbStatusFlags(CAN_Type *base, uint32_t mask) -#endif -{ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - base->IFLAG1 = (uint32_t)(mask & 0xFFFFFFFFU); - base->IFLAG2 = (uint32_t)(mask >> 32); -#else - base->IFLAG1 = mask; -#endif -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) -/*! - * @brief Clears the FlexCAN High 64 Message Buffer interrupt flags. - * - * Valid only if the number of available MBs exceeds 64. - * - * @param base FlexCAN peripheral base address. - * @param mask The ORed FlexCAN Message Buffer mask. - */ -static inline void FLEXCAN_ClearHigh64MbStatusFlags(CAN_Type *base, uint64_t mask) -{ -#if defined(CAN_IFLAG3_BUF95TO64_MASK) - base->IFLAG3 = (uint32_t)(mask & 0xFFFFFFFFU); -#endif -#if defined(CAN_IFLAG4_BUF127TO96_MASK) - base->IFLAG4 = (uint32_t)(mask >> 32U); -#endif -} -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -/*! - * @brief Gets the FlexCAN Memory Error Report registers status. - * - * This function gets the FlexCAN Memory Error Report registers status. - * - * @param base FlexCAN peripheral base address. - * @param errorStatus Pointer to FlexCAN Memory Error Report registers status structure. - */ -void FLEXCAN_GetMemoryErrorReportStatus(CAN_Type *base, flexcan_memory_error_report_status_t *errorStatus); -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) -/*! - * @brief Gets the FlexCAN Number of Matches when in Pretended Networking. - * - * This function gets the number of times a given message has matched the predefined filtering criteria for ID and/or PL - * before a wakeup event. - * - * @param base FlexCAN peripheral base address. - * @return The number of received wake up msessages. - */ -static inline uint8_t FLEXCAN_GetPNMatchCount(CAN_Type *base) -{ - return (uint8_t)((base->WU_MTC & CAN_WU_MTC_MCOUNTER_MASK) >> CAN_WU_MTC_MCOUNTER_SHIFT); -} -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * @brief Gets the number of FlexCAN Enhanced Rx FIFO available frames. - * - * This function gets the number of CAN messages stored in the Enhanced Rx FIFO. - * - * @param base FlexCAN peripheral base address. - * @return The number of available CAN messages stored in the Enhanced Rx FIFO. - */ -static inline uint32_t FLEXCAN_GetEnhancedFifoDataCount(CAN_Type *base) -{ - return (base->ERFSR & CAN_ERFSR_ERFEL_MASK); -} -#endif -/* @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables FlexCAN interrupts according to the provided mask. - * - * This function enables the FlexCAN interrupts according to the provided mask. The mask - * is a logical OR of enumeration members, see @ref _flexcan_interrupt_enable. - * - * @param base FlexCAN peripheral base address. - * @param mask The interrupts to enable. Logical OR of @ref _flexcan_interrupt_enable. - */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -static inline void FLEXCAN_EnableInterrupts(CAN_Type *base, uint64_t mask) -#else -static inline void FLEXCAN_EnableInterrupts(CAN_Type *base, uint32_t mask) -#endif -{ - uint32_t primask = DisableGlobalIRQ(); - - /* Solve Self Wake Up interrupt. */ - base->MCR |= (uint32_t)(mask & (uint32_t)kFLEXCAN_WakeUpInterruptEnable); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0 != FSL_FEATURE_FLEXCAN_INSTANCE_HAS_FLEXIBLE_DATA_RATEn(base)) - { - /* Solve CAN FD frames data phase error interrupt. */ - base->CTRL2 |= (uint32_t)(mask & (uint32_t)kFLEXCAN_FDErrorInterruptEnable); - } -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - /* Solve PN Wake Up interrupt. */ - base->CTRL1_PN |= FLEXCAN_PN_INT_UNMASK(mask); -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - /* Solve Enhanced Rx FIFO interrupt. */ - base->ERFIER |= FLEXCAN_EFIFO_INT_UNMASK(mask); -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - /* Solve Memory Error interrupt. */ - base->MECR |= FLEXCAN_MECR_INT_UNMASK(mask); -#endif - - /* Solve interrupt enable bits in CTRL1 register. */ - base->CTRL1 |= - (uint32_t)(mask & ((uint32_t)kFLEXCAN_BusOffInterruptEnable | (uint32_t)kFLEXCAN_ErrorInterruptEnable | - (uint32_t)kFLEXCAN_RxWarningInterruptEnable | (uint32_t)kFLEXCAN_TxWarningInterruptEnable)); - - EnableGlobalIRQ(primask); -} - -/*! - * @brief Disables FlexCAN interrupts according to the provided mask. - * - * This function disables the FlexCAN interrupts according to the provided mask. The mask - * is a logical OR of enumeration members, see @ref _flexcan_interrupt_enable. - * - * @param base FlexCAN peripheral base address. - * @param mask The interrupts to disable. Logical OR of @ref _flexcan_interrupt_enable. - */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -static inline void FLEXCAN_DisableInterrupts(CAN_Type *base, uint64_t mask) -#else -static inline void FLEXCAN_DisableInterrupts(CAN_Type *base, uint32_t mask) -#endif -{ - uint32_t primask = DisableGlobalIRQ(); - - /* Solve Wake Up Interrupt. */ - base->MCR &= ~(uint32_t)(mask & (uint32_t)kFLEXCAN_WakeUpInterruptEnable); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0 != FSL_FEATURE_FLEXCAN_INSTANCE_HAS_FLEXIBLE_DATA_RATEn(base)) - { - /* Solve CAN FD frames data phase error interrupt. */ - base->CTRL2 &= ~(uint32_t)(mask & (uint32_t)kFLEXCAN_FDErrorInterruptEnable); - } -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - /* Solve PN Wake Up Interrupt. */ - base->CTRL1_PN &= ~FLEXCAN_PN_STATUS_UNMASK(mask); -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - /* Solve Enhanced Rx FIFO interrupt. */ - base->ERFIER &= ~FLEXCAN_EFIFO_INT_UNMASK(mask); -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - /* Solve Memory Error Interrupt. */ - base->MECR &= ~FLEXCAN_MECR_STATUS_UNMASK(mask); -#endif - - /* Solve interrupt enable bits in CTRL1 register. */ - base->CTRL1 &= - ~(uint32_t)(mask & ((uint32_t)kFLEXCAN_BusOffInterruptEnable | (uint32_t)kFLEXCAN_ErrorInterruptEnable | - (uint32_t)kFLEXCAN_RxWarningInterruptEnable | (uint32_t)kFLEXCAN_TxWarningInterruptEnable)); - - EnableGlobalIRQ(primask); -} - -/*! - * @brief Enables FlexCAN Message Buffer interrupts. - * - * This function enables the interrupts of given Message Buffers. - * - * @param base FlexCAN peripheral base address. - * @param mask The ORed FlexCAN Message Buffer mask. - */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) -static inline void FLEXCAN_EnableMbInterrupts(CAN_Type *base, uint64_t mask) -#else -static inline void FLEXCAN_EnableMbInterrupts(CAN_Type *base, uint32_t mask) -#endif -{ - uint32_t primask = DisableGlobalIRQ(); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - base->IMASK1 |= (uint32_t)(mask & 0xFFFFFFFFU); - base->IMASK2 |= (uint32_t)(mask >> 32); -#else - base->IMASK1 |= mask; -#endif - EnableGlobalIRQ(primask); -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) -/*! - * @brief Enables FlexCAN high 64 Message Buffer interrupts. - * - * Valid only if the number of available MBs exceeds 64. - * - * @param base FlexCAN peripheral base address. - * @param mask The ORed FlexCAN Message Buffer mask. - */ -static inline void FLEXCAN_EnableHigh64MbInterrupts(CAN_Type *base, uint64_t mask) -{ - uint32_t primask = DisableGlobalIRQ(); - -#if defined(CAN_IMASK3_BUF95TO64M_MASK) - base->IMASK3 |= (uint32_t)(mask & 0xFFFFFFFFU); -#endif -#if defined(CAN_IMASK4_BUF127TO96_MASK) - base->IMASK4 |= (uint32_t)(mask >> 32U); -#endif - EnableGlobalIRQ(primask); -} -#endif - -/*! - * @brief Disables FlexCAN Message Buffer interrupts. - * - * This function disables the interrupts of given Message Buffers. - * - * @param base FlexCAN peripheral base address. - * @param mask The ORed FlexCAN Message Buffer mask. - */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) -static inline void FLEXCAN_DisableMbInterrupts(CAN_Type *base, uint64_t mask) -#else -static inline void FLEXCAN_DisableMbInterrupts(CAN_Type *base, uint32_t mask) -#endif -{ - uint32_t primask = DisableGlobalIRQ(); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - base->IMASK1 &= ~((uint32_t)(mask & 0xFFFFFFFFU)); - base->IMASK2 &= ~((uint32_t)(mask >> 32)); -#else - base->IMASK1 &= ~mask; -#endif - EnableGlobalIRQ(primask); -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) -/*! - * @brief Disables FlexCAN high 64 Message Buffer interrupts. - * - * Valid only if the number of available MBs exceeds 64. - * - * @param base FlexCAN peripheral base address. - * @param mask The ORed FlexCAN Message Buffer mask. - */ -static inline void FLEXCAN_DisableHigh64MbInterrupts(CAN_Type *base, uint64_t mask) -{ - uint32_t primask = DisableGlobalIRQ(); - -#if defined(CAN_IMASK3_BUF95TO64M_MASK) - base->IMASK3 &= ~((uint32_t)(mask & 0xFFFFFFFFU)); -#endif -#if defined(CAN_IMASK4_BUF127TO96_MASK) - base->IMASK4 &= ~((uint32_t)(mask >> 32U)); -#endif - EnableGlobalIRQ(primask); -} -#endif - -/* @} */ - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_RX_FIFO_DMA) && FSL_FEATURE_FLEXCAN_HAS_RX_FIFO_DMA) -/*! - * @name DMA Control - * @{ - */ - -/*! - * @brief Enables or disables the FlexCAN Rx FIFO DMA request. - * - * This function enables or disables the DMA feature of FlexCAN build-in Rx FIFO. - * - * @param base FlexCAN peripheral base address. - * @param enable true to enable, false to disable. - */ -void FLEXCAN_EnableRxFifoDMA(CAN_Type *base, bool enable); - -/*! - * @brief Gets the Rx FIFO Head address. - * - * This function returns the FlexCAN Rx FIFO Head address, which is mainly used for the DMA/eDMA use case. - * - * @param base FlexCAN peripheral base address. - * @return FlexCAN Rx FIFO Head address. - */ -static inline uintptr_t FLEXCAN_GetRxFifoHeadAddr(CAN_Type *base) -{ - return (uintptr_t) & (base->MB[0].CS); -} - -/* @} */ -#endif /* FSL_FEATURE_FLEXCAN_HAS_RX_FIFO_DMA */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Enables or disables the FlexCAN module operation. - * - * This function enables or disables the FlexCAN module. - * - * @param base FlexCAN base pointer. - * @param enable true to enable, false to disable. - */ -static inline void FLEXCAN_Enable(CAN_Type *base, bool enable) -{ - if (enable) - { - base->MCR &= ~CAN_MCR_MDIS_MASK; - - /* Wait FlexCAN exit from low-power mode. */ - while (0U != (base->MCR & CAN_MCR_LPMACK_MASK)) - { - } - } - else - { - base->MCR |= CAN_MCR_MDIS_MASK; - - /* Wait FlexCAN enter low-power mode. */ - while (0U == (base->MCR & CAN_MCR_LPMACK_MASK)) - { - } - } -} - -/*! - * @brief Writes a FlexCAN Message to the Transmit Message Buffer. - * - * This function writes a CAN Message to the specified Transmit Message Buffer - * and changes the Message Buffer state to start CAN Message transmit. After - * that the function returns immediately. - * - * @param base FlexCAN peripheral base address. - * @param mbIdx The FlexCAN Message Buffer index. - * @param pTxFrame Pointer to CAN message frame to be sent. - * @retval kStatus_Success - Write Tx Message Buffer Successfully. - * @retval kStatus_Fail - Tx Message Buffer is currently in use. - */ -status_t FLEXCAN_WriteTxMb(CAN_Type *base, uint8_t mbIdx, const flexcan_frame_t *pTxFrame); - -/*! - * @brief Reads a FlexCAN Message from Receive Message Buffer. - * - * This function reads a CAN message from a specified Receive Message Buffer. - * The function fills a receive CAN message frame structure with - * just received data and activates the Message Buffer again. - * The function returns immediately. - * - * @param base FlexCAN peripheral base address. - * @param mbIdx The FlexCAN Message Buffer index. - * @param pRxFrame Pointer to CAN message frame structure for reception. - * @retval kStatus_Success - Rx Message Buffer is full and has been read successfully. - * @retval kStatus_FLEXCAN_RxOverflow - Rx Message Buffer is already overflowed and has been read successfully. - * @retval kStatus_Fail - Rx Message Buffer is empty. - */ -status_t FLEXCAN_ReadRxMb(CAN_Type *base, uint8_t mbIdx, flexcan_frame_t *pRxFrame); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * @brief Writes a FlexCAN FD Message to the Transmit Message Buffer. - * - * This function writes a CAN FD Message to the specified Transmit Message Buffer - * and changes the Message Buffer state to start CAN FD Message transmit. After - * that the function returns immediately. - * - * @param base FlexCAN peripheral base address. - * @param mbIdx The FlexCAN FD Message Buffer index. - * @param pTxFrame Pointer to CAN FD message frame to be sent. - * @retval kStatus_Success - Write Tx Message Buffer Successfully. - * @retval kStatus_Fail - Tx Message Buffer is currently in use. - */ -status_t FLEXCAN_WriteFDTxMb(CAN_Type *base, uint8_t mbIdx, const flexcan_fd_frame_t *pTxFrame); - -/*! - * @brief Reads a FlexCAN FD Message from Receive Message Buffer. - * - * This function reads a CAN FD message from a specified Receive Message Buffer. - * The function fills a receive CAN FD message frame structure with - * just received data and activates the Message Buffer again. - * The function returns immediately. - * - * @param base FlexCAN peripheral base address. - * @param mbIdx The FlexCAN FD Message Buffer index. - * @param pRxFrame Pointer to CAN FD message frame structure for reception. - * @retval kStatus_Success - Rx Message Buffer is full and has been read successfully. - * @retval kStatus_FLEXCAN_RxOverflow - Rx Message Buffer is already overflowed and has been read successfully. - * @retval kStatus_Fail - Rx Message Buffer is empty. - */ -status_t FLEXCAN_ReadFDRxMb(CAN_Type *base, uint8_t mbIdx, flexcan_fd_frame_t *pRxFrame); -#endif - -/*! - * @brief Reads a FlexCAN Message from Legacy Rx FIFO. - * - * This function reads a CAN message from the FlexCAN Legacy Rx FIFO. - * - * @param base FlexCAN peripheral base address. - * @param pRxFrame Pointer to CAN message frame structure for reception. - * @retval kStatus_Success - Read Message from Rx FIFO successfully. - * @retval kStatus_Fail - Rx FIFO is not enabled. - */ -status_t FLEXCAN_ReadRxFifo(CAN_Type *base, flexcan_frame_t *pRxFrame); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * @brief Reads a FlexCAN Message from Enhanced Rx FIFO. - * - * This function reads a CAN or CAN FD message from the FlexCAN Enhanced Rx FIFO. - * - * @param base FlexCAN peripheral base address. - * @param pRxFrame Pointer to CAN FD message frame structure for reception. - * @retval kStatus_Success - Read Message from Rx FIFO successfully. - * @retval kStatus_Fail - Rx FIFO is not enabled. - */ -status_t FLEXCAN_ReadEnhancedRxFifo(CAN_Type *base, flexcan_fd_frame_t *pRxFrame); -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) -/*! - * @brief Reads a FlexCAN Message from Wake Up MB. - * - * This function reads a CAN message from the FlexCAN Wake up Message Buffers. There are four Wake up Message Buffers - * (WMBs) used to store incoming messages in Pretended Networking mode. The WMB index indicates the arrival order. The - * last message is stored in WMB3. - * - * @param base FlexCAN peripheral base address. - * @param pRxFrame Pointer to CAN message frame structure for reception. - * @param mbIdx The FlexCAN Wake up Message Buffer index. Range in 0x0 ~ 0x3. - * @retval kStatus_Success - Read Message from Wake up Message Buffer successfully. - * @retval kStatus_Fail - Wake up Message Buffer has no valid content. - */ -status_t FLEXCAN_ReadPNWakeUpMB(CAN_Type *base, uint8_t mbIdx, flexcan_frame_t *pRxFrame); -#endif -/* @} */ - -/*! - * @name Transactional - * @{ - */ - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * @brief Performs a polling send transaction on the CAN bus. - * - * @note A transfer handle does not need to be created before calling this API. - * - * @param base FlexCAN peripheral base pointer. - * @param mbIdx The FlexCAN FD Message Buffer index. - * @param pTxFrame Pointer to CAN FD message frame to be sent. - * @retval kStatus_Success - Write Tx Message Buffer Successfully. - * @retval kStatus_Fail - Tx Message Buffer is currently in use. - */ -status_t FLEXCAN_TransferFDSendBlocking(CAN_Type *base, uint8_t mbIdx, flexcan_fd_frame_t *pTxFrame); - -/*! - * @brief Performs a polling receive transaction on the CAN bus. - * - * @note A transfer handle does not need to be created before calling this API. - * - * @param base FlexCAN peripheral base pointer. - * @param mbIdx The FlexCAN FD Message Buffer index. - * @param pRxFrame Pointer to CAN FD message frame structure for reception. - * @retval kStatus_Success - Rx Message Buffer is full and has been read successfully. - * @retval kStatus_FLEXCAN_RxOverflow - Rx Message Buffer is already overflowed and has been read successfully. - * @retval kStatus_Fail - Rx Message Buffer is empty. - */ -status_t FLEXCAN_TransferFDReceiveBlocking(CAN_Type *base, uint8_t mbIdx, flexcan_fd_frame_t *pRxFrame); - -/*! - * @brief Sends a message using IRQ. - * - * This function sends a message using IRQ. This is a non-blocking function, which returns - * right away. When messages have been sent out, the send callback function is called. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param pMbXfer FlexCAN FD Message Buffer transfer structure. See the #flexcan_mb_transfer_t. - * @retval kStatus_Success Start Tx Message Buffer sending process successfully. - * @retval kStatus_Fail Write Tx Message Buffer failed. - * @retval kStatus_FLEXCAN_TxBusy Tx Message Buffer is in use. - */ -status_t FLEXCAN_TransferFDSendNonBlocking(CAN_Type *base, flexcan_handle_t *handle, flexcan_mb_transfer_t *pMbXfer); - -/*! - * @brief Receives a message using IRQ. - * - * This function receives a message using IRQ. This is non-blocking function, which returns - * right away. When the message has been received, the receive callback function is called. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param pMbXfer FlexCAN FD Message Buffer transfer structure. See the #flexcan_mb_transfer_t. - * @retval kStatus_Success - Start Rx Message Buffer receiving process successfully. - * @retval kStatus_FLEXCAN_RxBusy - Rx Message Buffer is in use. - */ -status_t FLEXCAN_TransferFDReceiveNonBlocking(CAN_Type *base, flexcan_handle_t *handle, flexcan_mb_transfer_t *pMbXfer); - -/*! - * @brief Aborts the interrupt driven message send process. - * - * This function aborts the interrupt driven message send process. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param mbIdx The FlexCAN FD Message Buffer index. - */ -void FLEXCAN_TransferFDAbortSend(CAN_Type *base, flexcan_handle_t *handle, uint8_t mbIdx); - -/*! - * @brief Aborts the interrupt driven message receive process. - * - * This function aborts the interrupt driven message receive process. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param mbIdx The FlexCAN FD Message Buffer index. - */ -void FLEXCAN_TransferFDAbortReceive(CAN_Type *base, flexcan_handle_t *handle, uint8_t mbIdx); -#endif - -/*! - * @brief Performs a polling send transaction on the CAN bus. - * - * @note A transfer handle does not need to be created before calling this API. - * - * @param base FlexCAN peripheral base pointer. - * @param mbIdx The FlexCAN Message Buffer index. - * @param pTxFrame Pointer to CAN message frame to be sent. - * @retval kStatus_Success - Write Tx Message Buffer Successfully. - * @retval kStatus_Fail - Tx Message Buffer is currently in use. - */ -status_t FLEXCAN_TransferSendBlocking(CAN_Type *base, uint8_t mbIdx, flexcan_frame_t *pTxFrame); - -/*! - * @brief Performs a polling receive transaction on the CAN bus. - * - * @note A transfer handle does not need to be created before calling this API. - * - * @param base FlexCAN peripheral base pointer. - * @param mbIdx The FlexCAN Message Buffer index. - * @param pRxFrame Pointer to CAN message frame structure for reception. - * @retval kStatus_Success - Rx Message Buffer is full and has been read successfully. - * @retval kStatus_FLEXCAN_RxOverflow - Rx Message Buffer is already overflowed and has been read successfully. - * @retval kStatus_Fail - Rx Message Buffer is empty. - */ -status_t FLEXCAN_TransferReceiveBlocking(CAN_Type *base, uint8_t mbIdx, flexcan_frame_t *pRxFrame); - -/*! - * @brief Performs a polling receive transaction from Legacy Rx FIFO on the CAN bus. - * - * @note A transfer handle does not need to be created before calling this API. - * - * @param base FlexCAN peripheral base pointer. - * @param pRxFrame Pointer to CAN message frame structure for reception. - * @retval kStatus_Success - Read Message from Rx FIFO successfully. - * @retval kStatus_Fail - Rx FIFO is not enabled. - */ -status_t FLEXCAN_TransferReceiveFifoBlocking(CAN_Type *base, flexcan_frame_t *pRxFrame); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * @brief Performs a polling receive transaction from Enhanced Rx FIFO on the CAN bus. - * - * @note A transfer handle does not need to be created before calling this API. - * - * @param base FlexCAN peripheral base pointer. - * @param pRxFrame Pointer to CAN FD message frame structure for reception. - * @retval kStatus_Success - Read Message from Rx FIFO successfully. - * @retval kStatus_Fail - Rx FIFO is not enabled. - */ -status_t FLEXCAN_TransferReceiveEnhancedFifoBlocking(CAN_Type *base, flexcan_fd_frame_t *pRxFrame); -#endif - -/*! - * @brief Initializes the FlexCAN handle. - * - * This function initializes the FlexCAN handle, which can be used for other FlexCAN - * transactional APIs. Usually, for a specified FlexCAN instance, - * call this API once to get the initialized handle. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param callback The callback function. - * @param userData The parameter of the callback function. - */ -void FLEXCAN_TransferCreateHandle(CAN_Type *base, - flexcan_handle_t *handle, - flexcan_transfer_callback_t callback, - void *userData); - -/*! - * @brief Sends a message using IRQ. - * - * This function sends a message using IRQ. This is a non-blocking function, which returns - * right away. When messages have been sent out, the send callback function is called. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param pMbXfer FlexCAN Message Buffer transfer structure. See the #flexcan_mb_transfer_t. - * @retval kStatus_Success Start Tx Message Buffer sending process successfully. - * @retval kStatus_Fail Write Tx Message Buffer failed. - * @retval kStatus_FLEXCAN_TxBusy Tx Message Buffer is in use. - */ -status_t FLEXCAN_TransferSendNonBlocking(CAN_Type *base, flexcan_handle_t *handle, flexcan_mb_transfer_t *pMbXfer); - -/*! - * @brief Receives a message using IRQ. - * - * This function receives a message using IRQ. This is non-blocking function, which returns - * right away. When the message has been received, the receive callback function is called. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param pMbXfer FlexCAN Message Buffer transfer structure. See the #flexcan_mb_transfer_t. - * @retval kStatus_Success - Start Rx Message Buffer receiving process successfully. - * @retval kStatus_FLEXCAN_RxBusy - Rx Message Buffer is in use. - */ -status_t FLEXCAN_TransferReceiveNonBlocking(CAN_Type *base, flexcan_handle_t *handle, flexcan_mb_transfer_t *pMbXfer); - -/*! - * @brief Receives a message from Rx FIFO using IRQ. - * - * This function receives a message using IRQ. This is a non-blocking function, which returns - * right away. When all messages have been received, the receive callback function is called. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param pFifoXfer FlexCAN Rx FIFO transfer structure. See the @ref flexcan_fifo_transfer_t. - * @retval kStatus_Success - Start Rx FIFO receiving process successfully. - * @retval kStatus_FLEXCAN_RxFifoBusy - Rx FIFO is currently in use. - */ -status_t FLEXCAN_TransferReceiveFifoNonBlocking(CAN_Type *base, - flexcan_handle_t *handle, - flexcan_fifo_transfer_t *pFifoXfer); - -/*! - * @brief Gets the Legacy Rx Fifo transfer status during a interrupt non-blocking receive. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param count Number of CAN messages receive so far by the non-blocking transaction. - * @retval kStatus_InvalidArgument count is Invalid. - * @retval kStatus_Success Successfully return the count. - */ - -status_t FLEXCAN_TransferGetReceiveFifoCount(CAN_Type *base, flexcan_handle_t *handle, size_t *count); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * @brief Receives a message from Enhanced Rx FIFO using IRQ. - * - * This function receives a message using IRQ. This is a non-blocking function, which returns - * right away. When all messages have been received, the receive callback function is called. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param pFifoXfer FlexCAN Rx FIFO transfer structure. See the ref flexcan_fifo_transfer_t.@ - * @retval kStatus_Success - Start Rx FIFO receiving process successfully. - * @retval kStatus_FLEXCAN_RxFifoBusy - Rx FIFO is currently in use. - */ -status_t FLEXCAN_TransferReceiveEnhancedFifoNonBlocking(CAN_Type *base, - flexcan_handle_t *handle, - flexcan_fifo_transfer_t *pFifoXfer); - -/*! - * @brief Gets the Enhanced Rx Fifo transfer status during a interrupt non-blocking receive. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param count Number of CAN messages receive so far by the non-blocking transaction. - * @retval kStatus_InvalidArgument count is Invalid. - * @retval kStatus_Success Successfully return the count. - */ - -static inline status_t FLEXCAN_TransferGetReceiveEnhancedFifoCount(CAN_Type *base, - flexcan_handle_t *handle, - size_t *count) -{ - return FLEXCAN_TransferGetReceiveFifoCount(base, handle, count); -} -#endif - -/*! - * @brief Gets the detail index of Mailbox's Timestamp by handle. - * - * Then function can only be used when calling non-blocking Data transfer (TX/RX) API, - * After TX/RX data transfer done (User can get the status by handler's callback function), - * we can get the detail index of Mailbox's timestamp by handle, - * Detail non-blocking data transfer API (TX/RX) contain. - * -FLEXCAN_TransferSendNonBlocking - * -FLEXCAN_TransferFDSendNonBlocking - * -FLEXCAN_TransferReceiveNonBlocking - * -FLEXCAN_TransferFDReceiveNonBlocking - * -FLEXCAN_TransferReceiveFifoNonBlocking - * - * @param handle FlexCAN handle pointer. - * @param mbIdx The FlexCAN Message Buffer index. - * @retval the index of mailbox 's timestamp stored in the handle. - * - */ -uint32_t FLEXCAN_GetTimeStamp(flexcan_handle_t *handle, uint8_t mbIdx); - -/*! - * @brief Aborts the interrupt driven message send process. - * - * This function aborts the interrupt driven message send process. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param mbIdx The FlexCAN Message Buffer index. - */ -void FLEXCAN_TransferAbortSend(CAN_Type *base, flexcan_handle_t *handle, uint8_t mbIdx); - -/*! - * @brief Aborts the interrupt driven message receive process. - * - * This function aborts the interrupt driven message receive process. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param mbIdx The FlexCAN Message Buffer index. - */ -void FLEXCAN_TransferAbortReceive(CAN_Type *base, flexcan_handle_t *handle, uint8_t mbIdx); - -/*! - * @brief Aborts the interrupt driven message receive from Rx FIFO process. - * - * This function aborts the interrupt driven message receive from Rx FIFO process. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - */ -void FLEXCAN_TransferAbortReceiveFifo(CAN_Type *base, flexcan_handle_t *handle); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * @brief Aborts the interrupt driven message receive from Enhanced Rx FIFO process. - * - * This function aborts the interrupt driven message receive from Enhanced Rx FIFO process. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - */ -void FLEXCAN_TransferAbortReceiveEnhancedFifo(CAN_Type *base, flexcan_handle_t *handle); -#endif - -/*! - * @brief FlexCAN IRQ handle function. - * - * This function handles the FlexCAN Error, the Message Buffer, and the Rx FIFO IRQ request. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - */ -void FLEXCAN_TransferHandleIRQ(CAN_Type *base, flexcan_handle_t *handle); - -/* @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_FLEXCAN_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexcan_edma.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexcan_edma.c deleted file mode 100644 index a5f68487f31..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexcan_edma.c +++ /dev/null @@ -1,381 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexcan_edma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexcan_edma" -#endif - -/*base->ERFCR & CAN_ERFCR_ERFEN_MASK)) - { - framefd = flexcanPrivateHandle->handle->framefd; - for (uint32_t i = 0; i < flexcanPrivateHandle->handle->frameNum; i++) - { - /* Enhanced Rx FIFO ID HIT offset is changed dynamically according to data length code (DLC) . */ - idHitIndex = (DLC_LENGTH_DECODE(framefd->length) + 3U) / 4U; - framefd->idhit = framefd->dataWord[idHitIndex]; - /* Clear the unused frame data. */ - for (uint32_t j = idHitIndex; j < 16U; j++) - { - framefd->dataWord[j] = 0x0U; - } - framefd++; - } - } -#endif - /* Disable transfer. */ - FLEXCAN_TransferAbortReceiveFifoEDMA(flexcanPrivateHandle->base, flexcanPrivateHandle->handle); - - if (NULL != flexcanPrivateHandle->handle->callback) - { - flexcanPrivateHandle->handle->callback(flexcanPrivateHandle->base, flexcanPrivateHandle->handle, - kStatus_FLEXCAN_RxFifoIdle, flexcanPrivateHandle->handle->userData); - } - } -} - -/*! - * brief Initializes the FlexCAN handle, which is used in transactional functions. - * - * param base FlexCAN peripheral base address. - * param handle Pointer to flexcan_edma_handle_t structure. - * param callback The callback function. - * param userData The parameter of the callback function. - * param rxFifoEdmaHandle User-requested DMA handle for Rx FIFO DMA transfer. - */ -void FLEXCAN_TransferCreateHandleEDMA(CAN_Type *base, - flexcan_edma_handle_t *handle, - flexcan_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *rxFifoEdmaHandle) -{ - assert(NULL != handle); - - uint32_t instance = FLEXCAN_GetInstance(base); - s_flexcanEdmaPrivateHandle[instance].base = base; - s_flexcanEdmaPrivateHandle[instance].handle = handle; - - (void)memset(handle, 0, sizeof(flexcan_edma_handle_t)); - - handle->rxFifoState = (uint8_t)KFLEXCAN_RxFifoIdle; - handle->rxFifoEdmaHandle = rxFifoEdmaHandle; - - /* Register Callback. */ - handle->callback = callback; - handle->userData = userData; - - /* Configure Legacy/Enhanced Rx FIFO DMA callback. */ - EDMA_SetCallback(handle->rxFifoEdmaHandle, FLEXCAN_ReceiveFifoEDMACallback, &s_flexcanEdmaPrivateHandle[instance]); -} - -/*! - * brief Prepares the eDMA transfer configuration for FLEXCAN Legacy RX FIFO. - * - * This function prepares the eDMA transfer configuration structure according to FLEXCAN Legacy RX FIFO. - * - * param base FlexCAN peripheral base address. - * param pFifoXfer FlexCAN Rx FIFO EDMA transfer structure, see #flexcan_fifo_transfer_t. - * param pEdmaConfig The user configuration structure of type edma_transfer_t. - * - */ -void FLEXCAN_PrepareTransfConfiguration(CAN_Type *base, - flexcan_fifo_transfer_t *pFifoXfer, - edma_transfer_config_t *pEdmaConfig) -{ - assert(NULL != pFifoXfer); - assert(NULL != pFifoXfer->frame); - assert(NULL != pEdmaConfig); - - flexcan_frame_t *fifoAddr = (flexcan_frame_t *)FLEXCAN_GetRxFifoHeadAddr(base); - -#if (defined(FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) - EDMA_PrepareTransfer(pEdmaConfig, (void *)fifoAddr, sizeof(flexcan_frame_t), (void *)pFifoXfer->frame, - sizeof(uint32_t), sizeof(flexcan_frame_t), sizeof(flexcan_frame_t) * pFifoXfer->frameNum, - kEDMA_PeripheralToMemory); -#else - /* The Data Size of FLEXCAN Legacy RX FIFO output port is 16 Bytes, but lots of chips not support 16Bytes width DMA - * transfer. These chips always support 4Byte width memory transfer, so we need prepare Memory to Memory mode by 4 - * Bytes width mode. - */ - EDMA_PrepareTransfer(pEdmaConfig, (void *)fifoAddr, 4U, (void *)pFifoXfer->frame, sizeof(uint32_t), - sizeof(flexcan_frame_t), sizeof(flexcan_frame_t) * pFifoXfer->frameNum, kEDMA_MemoryToMemory); -#endif -} - -/*! - * brief Start Transfer Data from the FLEXCAN Legacy Rx FIFO using eDMA. - * - * This function to Update edma transfer confiugration and Start eDMA transfer - * - * param base FlexCAN peripheral base address. - * param handle Pointer to flexcan_edma_handle_t structure. - * param pEdmaConfig The user configuration structure of type edma_transfer_t. - * retval kStatus_Success if succeed, others failed. - * retval kStatus_FLEXCAN_RxFifoBusy Previous transfer ongoing. - */ -status_t FLEXCAN_StartTransferDatafromRxFIFO(CAN_Type *base, - flexcan_edma_handle_t *handle, - edma_transfer_config_t *pEdmaConfig) -{ - assert(NULL != handle->rxFifoEdmaHandle); - assert(NULL != pEdmaConfig); - status_t status; - - /* If previous Rx FIFO receive not finished. */ - if ((uint8_t)KFLEXCAN_RxFifoBusy == handle->rxFifoState) - { - status = kStatus_FLEXCAN_RxFifoBusy; - } - else - { - handle->rxFifoState = (uint8_t)KFLEXCAN_RxFifoBusy; - - /* Enable FlexCAN Rx FIFO EDMA. */ - FLEXCAN_EnableRxFifoDMA(base, true); - - /* Submit configuration. */ - (void)EDMA_SubmitTransfer(handle->rxFifoEdmaHandle, (const edma_transfer_config_t *)pEdmaConfig); - EDMA_SetModulo(handle->rxFifoEdmaHandle->base, handle->rxFifoEdmaHandle->channel, kEDMA_Modulo16bytes, - kEDMA_ModuloDisable); - /* Start transfer. */ - EDMA_StartTransfer(handle->rxFifoEdmaHandle); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Receives the CAN Messages from the Legacy Rx FIFO using eDMA. - * - * This function receives the CAN Message using eDMA. This is a non-blocking function, which returns - * right away. After the CAN Message is received, the receive callback function is called. - * - * param base FlexCAN peripheral base address. - * param handle Pointer to flexcan_edma_handle_t structure. - * param pFifoXfer FlexCAN Rx FIFO EDMA transfer structure, see #flexcan_fifo_transfer_t. - * retval kStatus_Success if succeed, others failed. - * retval kStatus_FLEXCAN_RxFifoBusy Previous transfer ongoing. - */ -status_t FLEXCAN_TransferReceiveFifoEDMA(CAN_Type *base, - flexcan_edma_handle_t *handle, - flexcan_fifo_transfer_t *pFifoXfer) -{ - assert(NULL != handle->rxFifoEdmaHandle); - assert(NULL != pFifoXfer->frame); - - edma_transfer_config_t dmaXferConfig = {0}; - status_t status; - - handle->frameNum = pFifoXfer->frameNum; - /* Prepare transfer. */ - FLEXCAN_PrepareTransfConfiguration(base, pFifoXfer, &dmaXferConfig); - - /* Submit configuration and start edma transfer. */ - status = FLEXCAN_StartTransferDatafromRxFIFO(base, handle, &dmaXferConfig); - - return status; -} - -/*! - * brief Gets the Legacy Rx Fifo transfer status during a interrupt non-blocking receive. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param count Number of CAN messages receive so far by the non-blocking transaction. - * retval kStatus_InvalidArgument count is Invalid. - * retval kStatus_Success Successfully return the count. - */ - -status_t FLEXCAN_TransferGetReceiveFifoCountEMDA(CAN_Type *base, flexcan_edma_handle_t *handle, size_t *count) -{ - assert(NULL != handle); - - status_t result = kStatus_Success; - - if (handle->rxFifoState == (uint32_t)KFLEXCAN_RxFifoIdle) - { - result = kStatus_NoTransferInProgress; - } - else - { - *count = handle->frameNum - - EDMA_GetRemainingMajorLoopCount(handle->rxFifoEdmaHandle->base, handle->rxFifoEdmaHandle->channel); - } - - return result; -} - -/*! - * brief Aborts the receive Legacy/Enhanced Rx FIFO process which used eDMA. - * - * This function aborts the receive Legacy/Enhanced Rx FIFO process which used eDMA. - * - * param base FlexCAN peripheral base address. - * param handle Pointer to flexcan_edma_handle_t structure. - */ -void FLEXCAN_TransferAbortReceiveFifoEDMA(CAN_Type *base, flexcan_edma_handle_t *handle) -{ - assert(NULL != handle->rxFifoEdmaHandle); - - /* Stop transfer. */ - EDMA_AbortTransfer(handle->rxFifoEdmaHandle); - - handle->rxFifoState = (uint8_t)KFLEXCAN_RxFifoIdle; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - handle->framefd = NULL; -#endif - handle->frameNum = 0U; - /* Disable FlexCAN Legacy/Enhanced Rx FIFO EDMA. */ - FLEXCAN_EnableRxFifoDMA(base, false); -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * brief Receives the CAN FD Message from the Enhanced Rx FIFO using eDMA. - * - * This function receives the CAN FD Message using eDMA. This is a non-blocking function, which returns - * right away. After the CAN Message is received, the receive callback function is called. - * - * param base FlexCAN peripheral base address. - * param handle Pointer to flexcan_edma_handle_t structure. - * param pFifoXfer FlexCAN Rx FIFO EDMA transfer structure, see #flexcan_fifo_transfer_t. - * retval kStatus_Success if succeed, others failed. - * retval kStatus_FLEXCAN_RxFifoBusy Previous transfer ongoing. - * retval kStatus_InvalidArgument The watermark configuration is invalid, the watermark need be set to - 1 to do successfully EDMA transfer with this API. - */ -status_t FLEXCAN_TransferReceiveEnhancedFifoEDMA(CAN_Type *base, - flexcan_edma_handle_t *handle, - flexcan_fifo_transfer_t *pFifoXfer) -{ - assert(NULL != handle->rxFifoEdmaHandle); - assert(NULL != pFifoXfer->framefd); - - edma_transfer_config_t dmaXferConfig; - edma_minor_offset_config_t dmaMinorOffsetConfig; - status_t status; - flexcan_fd_frame_t *fifoAddr = (flexcan_fd_frame_t *)E_RX_FIFO(base); - uint32_t perReadWords = ((base->ERFCR & CAN_ERFCR_DMALW_MASK) >> CAN_ERFCR_DMALW_SHIFT) + 1U; - uint32_t watermark = ((base->ERFCR & CAN_ERFCR_ERFWM_MASK) >> CAN_ERFCR_ERFWM_SHIFT) + 1U; - - /* If previous Rx FIFO receive not finished. */ - if ((uint8_t)KFLEXCAN_RxFifoBusy == handle->rxFifoState) - { - status = kStatus_FLEXCAN_RxFifoBusy; - } - else - { - handle->frameNum = pFifoXfer->frameNum; - handle->framefd = pFifoXfer->framefd; - /*!< To reduce the complexity of DMA software configuration, need to set watermark to 1 to make that each DMA - request read once Rx FIFO. Because a DMA transfer cannot be dynamically changed, Number of words read per - transfer (ERFCR[DMALW] + 1) should be programmed so that the Enhanced Rx FIFO element can store the largest - CAN message present on the CAN bus. */ - if ((watermark != 1U) || ((sizeof(uint32_t) * perReadWords) != sizeof(flexcan_fd_frame_t))) - { - return kStatus_InvalidArgument; - } - - /* Prepare transfer. */ - EDMA_PrepareTransfer( - &dmaXferConfig, (void *)fifoAddr, sizeof(uint32_t), (void *)pFifoXfer->framefd, sizeof(uint32_t), - sizeof(uint32_t) * perReadWords, /* minor loop bytes : 4* perReadWords */ - sizeof(uint32_t) * perReadWords * handle->frameNum, /* major loop counts : handle->frameNum */ - kEDMA_MemoryToMemory); - /* Submit configuration. */ - (void)EDMA_SubmitTransfer(handle->rxFifoEdmaHandle, &dmaXferConfig); - - dmaMinorOffsetConfig.enableDestMinorOffset = false; - dmaMinorOffsetConfig.enableSrcMinorOffset = true; - dmaMinorOffsetConfig.minorOffset = 128U - sizeof(uint32_t) * perReadWords; - EDMA_SetMinorOffsetConfig(handle->rxFifoEdmaHandle->base, handle->rxFifoEdmaHandle->channel, - &dmaMinorOffsetConfig); - - EDMA_SetModulo(handle->rxFifoEdmaHandle->base, handle->rxFifoEdmaHandle->channel, kEDMA_Modulo128bytes, - kEDMA_ModuloDisable); - - handle->rxFifoState = (uint8_t)KFLEXCAN_RxFifoBusy; - - /* Enable FlexCAN Rx FIFO EDMA. */ - FLEXCAN_EnableRxFifoDMA(base, true); - /* Start transfer. */ - EDMA_StartTransfer(handle->rxFifoEdmaHandle); - - status = kStatus_Success; - } - - return status; -} -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexcan_edma.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexcan_edma.h deleted file mode 100644 index 98f1f803be2..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexcan_edma.h +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_FLEXCAN_EDMA_H_ -#define FSL_FLEXCAN_EDMA_H_ - -#include "fsl_flexcan.h" -#include "fsl_edma.h" - -/*! - * @addtogroup flexcan_edma_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief FlexCAN EDMA driver version. */ -#define FSL_FLEXCAN_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 11, 3)) -/*@}*/ - -/* Forward declaration of the handle typedef. */ -typedef struct _flexcan_edma_handle flexcan_edma_handle_t; - -/*! @brief FlexCAN transfer callback function. */ -typedef void (*flexcan_edma_transfer_callback_t)(CAN_Type *base, - flexcan_edma_handle_t *handle, - status_t status, - void *userData); - -/*! - * @brief FlexCAN eDMA handle - */ -struct _flexcan_edma_handle -{ - flexcan_edma_transfer_callback_t callback; /*!< Callback function. */ - void *userData; /*!< FlexCAN callback function parameter.*/ - edma_handle_t *rxFifoEdmaHandle; /*!< The EDMA handler for Rx FIFO. */ - volatile uint8_t rxFifoState; /*!< Rx FIFO transfer state. */ - size_t frameNum; /*!< The number of messages that need to be received. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - flexcan_fd_frame_t *framefd; /*!< Point to the buffer of CAN Message to be received from Enhanced Rx FIFO. */ -#endif -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name eDMA transactional - * @{ - */ - -/*! - * @brief Initializes the FlexCAN handle, which is used in transactional functions. - * - * @param base FlexCAN peripheral base address. - * @param handle Pointer to flexcan_edma_handle_t structure. - * @param callback The callback function. - * @param userData The parameter of the callback function. - * @param rxFifoEdmaHandle User-requested DMA handle for Rx FIFO DMA transfer. - */ -void FLEXCAN_TransferCreateHandleEDMA(CAN_Type *base, - flexcan_edma_handle_t *handle, - flexcan_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *rxFifoEdmaHandle); - -/*! - * @brief Prepares the eDMA transfer configuration for FLEXCAN Legacy RX FIFO. - * - * This function prepares the eDMA transfer configuration structure according to FLEXCAN Legacy RX FIFO. - * - * @param base FlexCAN peripheral base address. - * @param pFifoXfer FlexCAN Rx FIFO EDMA transfer structure, see #flexcan_fifo_transfer_t. - * @param pEdmaConfig The user configuration structure of type edma_transfer_t. - * - */ -void FLEXCAN_PrepareTransfConfiguration(CAN_Type *base, - flexcan_fifo_transfer_t *pFifoXfer, - edma_transfer_config_t *pEdmaConfig); - -/*! - * @brief Start Transfer Data from the FLEXCAN Legacy Rx FIFO using eDMA. - * - * This function to Update edma transfer confiugration and Start eDMA transfer - * - * @param base FlexCAN peripheral base address. - * @param handle Pointer to flexcan_edma_handle_t structure. - * @param pEdmaConfig The user configuration structure of type edma_transfer_t. - * @retval kStatus_Success if succeed, others failed. - * @retval kStatus_FLEXCAN_RxFifoBusy Previous transfer ongoing. - */ -status_t FLEXCAN_StartTransferDatafromRxFIFO(CAN_Type *base, - flexcan_edma_handle_t *handle, - edma_transfer_config_t *pEdmaConfig); - -/*! - * @brief Receives the CAN Message from the Legacy Rx FIFO using eDMA. - * - * This function receives the CAN Message using eDMA. This is a non-blocking function, which returns - * right away. After the CAN Message is received, the receive callback function is called. - * - * @param base FlexCAN peripheral base address. - * @param handle Pointer to flexcan_edma_handle_t structure. - * @param pFifoXfer FlexCAN Rx FIFO EDMA transfer structure, see #flexcan_fifo_transfer_t. - * @retval kStatus_Success if succeed, others failed. - * @retval kStatus_FLEXCAN_RxFifoBusy Previous transfer ongoing. - */ -status_t FLEXCAN_TransferReceiveFifoEDMA(CAN_Type *base, - flexcan_edma_handle_t *handle, - flexcan_fifo_transfer_t *pFifoXfer); -/*! - * @brief Gets the Legacy Rx Fifo transfer status during a interrupt non-blocking receive. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param count Number of CAN messages receive so far by the non-blocking transaction. - * @retval kStatus_InvalidArgument count is Invalid. - * @retval kStatus_Success Successfully return the count. - */ - -status_t FLEXCAN_TransferGetReceiveFifoCountEMDA(CAN_Type *base, flexcan_edma_handle_t *handle, size_t *count); -/*! - * @brief Aborts the receive Legacy/Enhanced Rx FIFO process which used eDMA. - * - * This function aborts the receive Legacy/Enhanced Rx FIFO process which used eDMA. - * - * @param base FlexCAN peripheral base address. - * @param handle Pointer to flexcan_edma_handle_t structure. - */ -void FLEXCAN_TransferAbortReceiveFifoEDMA(CAN_Type *base, flexcan_edma_handle_t *handle); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * @brief Receives the CAN FD Message from the Enhanced Rx FIFO using eDMA. - * - * This function receives the CAN FD Message using eDMA. This is a non-blocking function, which returns - * right away. After the CAN Message is received, the receive callback function is called. - * - * @param base FlexCAN peripheral base address. - * @param handle Pointer to flexcan_edma_handle_t structure. - * @param pFifoXfer FlexCAN Rx FIFO EDMA transfer structure, see #flexcan_fifo_transfer_t. - * @retval kStatus_Success if succeed, others failed. - * @retval kStatus_FLEXCAN_RxFifoBusy Previous transfer ongoing. - */ -status_t FLEXCAN_TransferReceiveEnhancedFifoEDMA(CAN_Type *base, - flexcan_edma_handle_t *handle, - flexcan_fifo_transfer_t *pFifoXfer); -/*! - * @brief Gets the Enhanced Rx Fifo transfer status during a interrupt non-blocking receive. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param count Number of CAN messages receive so far by the non-blocking transaction. - * @retval kStatus_InvalidArgument count is Invalid. - * @retval kStatus_Success Successfully return the count. - */ - -static inline status_t FLEXCAN_TransferGetReceiveEnhancedFifoCountEMDA(CAN_Type *base, - flexcan_edma_handle_t *handle, - size_t *count) -{ - return FLEXCAN_TransferGetReceiveFifoCountEMDA(base, handle, count); -} -#endif - -/*@}*/ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_FLEXCAN_EDMA_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio.c deleted file mode 100644 index fbdb4e959c7..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio.c +++ /dev/null @@ -1,511 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio" -#endif - -/*< @brief user configurable flexio handle count. */ -#define FLEXIO_HANDLE_COUNT 2 - -#if defined(FLEXIO_RSTS) -#define FLEXIO_RESETS_ARRAY FLEXIO_RSTS -#elif defined(FLEXIO_RSTS_N) -#define FLEXIO_RESETS_ARRAY FLEXIO_RSTS_N -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to flexio bases for each instance. */ -FLEXIO_Type *const s_flexioBases[] = FLEXIO_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to flexio clocks for each instance. */ -const clock_ip_name_t s_flexioClocks[] = FLEXIO_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/*< @brief pointer to array of FLEXIO handle. */ -static void *s_flexioHandle[FLEXIO_HANDLE_COUNT]; - -/*< @brief pointer to array of FLEXIO IP types. */ -static void *s_flexioType[FLEXIO_HANDLE_COUNT]; - -/*< @brief pointer to array of FLEXIO Isr. */ -static flexio_isr_t s_flexioIsr[FLEXIO_HANDLE_COUNT]; - -/* FlexIO common IRQ Handler. */ -static void FLEXIO_CommonIRQHandler(void); - -#if defined(FLEXIO_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_flexioResets[] = FLEXIO_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Codes - ******************************************************************************/ - -/*! - * brief Get instance number for FLEXIO module. - * - * param base FLEXIO peripheral base address. - */ -uint32_t FLEXIO_GetInstance(FLEXIO_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_flexioBases); instance++) - { - if (s_flexioBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_flexioBases)); - - return instance; -} - -/*! - * brief Configures the FlexIO with a FlexIO configuration. The configuration structure - * can be filled by the user or be set with default values by FLEXIO_GetDefaultConfig(). - * - * Example - code - flexio_config_t config = { - .enableFlexio = true, - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false - }; - FLEXIO_Configure(base, &config); - endcode - * - * param base FlexIO peripheral base address - * param userConfig pointer to flexio_config_t structure -*/ -void FLEXIO_Init(FLEXIO_Type *base, const flexio_config_t *userConfig) -{ - uint32_t ctrlReg = 0; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_EnableClock(s_flexioClocks[FLEXIO_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(FLEXIO_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_flexioResets[FLEXIO_GetInstance(base)]); -#endif - - FLEXIO_Reset(base); - - ctrlReg = base->CTRL; - ctrlReg &= ~(FLEXIO_CTRL_DOZEN_MASK | FLEXIO_CTRL_DBGE_MASK | FLEXIO_CTRL_FASTACC_MASK | FLEXIO_CTRL_FLEXEN_MASK); - ctrlReg |= (FLEXIO_CTRL_DBGE(userConfig->enableInDebug) | FLEXIO_CTRL_FASTACC(userConfig->enableFastAccess) | - FLEXIO_CTRL_FLEXEN(userConfig->enableFlexio)); - if (!userConfig->enableInDoze) - { - ctrlReg |= FLEXIO_CTRL_DOZEN_MASK; - } - - base->CTRL = ctrlReg; -} - -/*! - * brief Gates the FlexIO clock. Call this API to stop the FlexIO clock. - * - * note After calling this API, call the FLEXO_Init to use the FlexIO module. - * - * param base FlexIO peripheral base address - */ -void FLEXIO_Deinit(FLEXIO_Type *base) -{ - FLEXIO_Enable(base, false); -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_DisableClock(s_flexioClocks[FLEXIO_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Gets the default configuration to configure the FlexIO module. The configuration - * can used directly to call the FLEXIO_Configure(). - * - * Example: - code - flexio_config_t config; - FLEXIO_GetDefaultConfig(&config); - endcode - * - * param userConfig pointer to flexio_config_t structure -*/ -void FLEXIO_GetDefaultConfig(flexio_config_t *userConfig) -{ - assert(userConfig != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(userConfig, 0, sizeof(*userConfig)); - - userConfig->enableFlexio = true; - userConfig->enableInDoze = false; - userConfig->enableInDebug = true; - userConfig->enableFastAccess = false; -} - -/*! - * brief Resets the FlexIO module. - * - * param base FlexIO peripheral base address - */ -void FLEXIO_Reset(FLEXIO_Type *base) -{ - /*do software reset, software reset operation affect all other FLEXIO registers except CTRL*/ - base->CTRL |= FLEXIO_CTRL_SWRST_MASK; - base->CTRL = 0; -} - -/*! - * brief Gets the shifter buffer address for the DMA transfer usage. - * - * param base FlexIO peripheral base address - * param type Shifter type of flexio_shifter_buffer_type_t - * param index Shifter index - * return Corresponding shifter buffer index - */ -uint32_t FLEXIO_GetShifterBufferAddress(FLEXIO_Type *base, flexio_shifter_buffer_type_t type, uint8_t index) -{ - assert(index < FLEXIO_SHIFTBUF_COUNT); - - uint32_t address = 0; - - switch (type) - { - case kFLEXIO_ShifterBuffer: - address = (uint32_t) & (base->SHIFTBUF[index]); - break; - - case kFLEXIO_ShifterBufferBitSwapped: - address = (uint32_t) & (base->SHIFTBUFBIS[index]); - break; - - case kFLEXIO_ShifterBufferByteSwapped: - address = (uint32_t) & (base->SHIFTBUFBYS[index]); - break; - - case kFLEXIO_ShifterBufferBitByteSwapped: - address = (uint32_t) & (base->SHIFTBUFBBS[index]); - break; - -#if defined(FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_BYTE_SWAP) && FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_BYTE_SWAP - case kFLEXIO_ShifterBufferNibbleByteSwapped: - address = (uint32_t) & (base->SHIFTBUFNBS[index]); - break; - -#endif -#if defined(FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_HALF_WORD_SWAP) && FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_HALF_WORD_SWAP - case kFLEXIO_ShifterBufferHalfWordSwapped: - address = (uint32_t) & (base->SHIFTBUFHWS[index]); - break; - -#endif -#if defined(FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_SWAP) && FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_SWAP - case kFLEXIO_ShifterBufferNibbleSwapped: - address = (uint32_t) & (base->SHIFTBUFNIS[index]); - break; - -#endif - default: - address = (uint32_t) & (base->SHIFTBUF[index]); - break; - } - return address; -} - -/*! - * brief Configures the shifter with the shifter configuration. The configuration structure - * covers both the SHIFTCTL and SHIFTCFG registers. To configure the shifter to the proper - * mode, select which timer controls the shifter to shift, whether to generate start bit/stop - * bit, and the polarity of start bit and stop bit. - * - * Example - code - flexio_shifter_config_t config = { - .timerSelect = 0, - .timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive, - .pinConfig = kFLEXIO_PinConfigOpenDrainOrBidirection, - .pinPolarity = kFLEXIO_PinActiveLow, - .shifterMode = kFLEXIO_ShifterModeTransmit, - .inputSource = kFLEXIO_ShifterInputFromPin, - .shifterStop = kFLEXIO_ShifterStopBitHigh, - .shifterStart = kFLEXIO_ShifterStartBitLow - }; - FLEXIO_SetShifterConfig(base, &config); - endcode - * - * param base FlexIO peripheral base address - * param index Shifter index - * param shifterConfig Pointer to flexio_shifter_config_t structure -*/ -void FLEXIO_SetShifterConfig(FLEXIO_Type *base, uint8_t index, const flexio_shifter_config_t *shifterConfig) -{ - base->SHIFTCFG[index] = FLEXIO_SHIFTCFG_INSRC(shifterConfig->inputSource) -#if FSL_FEATURE_FLEXIO_HAS_PARALLEL_WIDTH - | FLEXIO_SHIFTCFG_PWIDTH(shifterConfig->parallelWidth) -#endif /* FSL_FEATURE_FLEXIO_HAS_PARALLEL_WIDTH */ - | FLEXIO_SHIFTCFG_SSTOP(shifterConfig->shifterStop) | - FLEXIO_SHIFTCFG_SSTART(shifterConfig->shifterStart); - - base->SHIFTCTL[index] = - FLEXIO_SHIFTCTL_TIMSEL(shifterConfig->timerSelect) | FLEXIO_SHIFTCTL_TIMPOL(shifterConfig->timerPolarity) | - FLEXIO_SHIFTCTL_PINCFG(shifterConfig->pinConfig) | FLEXIO_SHIFTCTL_PINSEL(shifterConfig->pinSelect) | - FLEXIO_SHIFTCTL_PINPOL(shifterConfig->pinPolarity) | FLEXIO_SHIFTCTL_SMOD(shifterConfig->shifterMode); -} - -/*! - * brief Configures the timer with the timer configuration. The configuration structure - * covers both the TIMCTL and TIMCFG registers. To configure the timer to the proper - * mode, select trigger source for timer and the timer pin output and the timing for timer. - * - * Example - code - flexio_timer_config_t config = { - .triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(0), - .triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow, - .triggerSource = kFLEXIO_TimerTriggerSourceInternal, - .pinConfig = kFLEXIO_PinConfigOpenDrainOrBidirection, - .pinSelect = 0, - .pinPolarity = kFLEXIO_PinActiveHigh, - .timerMode = kFLEXIO_TimerModeDual8BitBaudBit, - .timerOutput = kFLEXIO_TimerOutputZeroNotAffectedByReset, - .timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput, - .timerReset = kFLEXIO_TimerResetOnTimerPinEqualToTimerOutput, - .timerDisable = kFLEXIO_TimerDisableOnTimerCompare, - .timerEnable = kFLEXIO_TimerEnableOnTriggerHigh, - .timerStop = kFLEXIO_TimerStopBitEnableOnTimerDisable, - .timerStart = kFLEXIO_TimerStartBitEnabled - }; - FLEXIO_SetTimerConfig(base, &config); - endcode - * - * param base FlexIO peripheral base address - * param index Timer index - * param timerConfig Pointer to the flexio_timer_config_t structure -*/ -void FLEXIO_SetTimerConfig(FLEXIO_Type *base, uint8_t index, const flexio_timer_config_t *timerConfig) -{ - base->TIMCFG[index] = - FLEXIO_TIMCFG_TIMOUT(timerConfig->timerOutput) | FLEXIO_TIMCFG_TIMDEC(timerConfig->timerDecrement) | - FLEXIO_TIMCFG_TIMRST(timerConfig->timerReset) | FLEXIO_TIMCFG_TIMDIS(timerConfig->timerDisable) | - FLEXIO_TIMCFG_TIMENA(timerConfig->timerEnable) | FLEXIO_TIMCFG_TSTOP(timerConfig->timerStop) | - FLEXIO_TIMCFG_TSTART(timerConfig->timerStart); - - base->TIMCMP[index] = FLEXIO_TIMCMP_CMP(timerConfig->timerCompare); - - base->TIMCTL[index] = FLEXIO_TIMCTL_TRGSEL(timerConfig->triggerSelect) | - FLEXIO_TIMCTL_TRGPOL(timerConfig->triggerPolarity) | - FLEXIO_TIMCTL_TRGSRC(timerConfig->triggerSource) | - FLEXIO_TIMCTL_PINCFG(timerConfig->pinConfig) | FLEXIO_TIMCTL_PINSEL(timerConfig->pinSelect) | - FLEXIO_TIMCTL_PINPOL(timerConfig->pinPolarity) | FLEXIO_TIMCTL_TIMOD(timerConfig->timerMode); -} - -/*! - * brief Registers the handle and the interrupt handler for the FlexIO-simulated peripheral. - * - * param base Pointer to the FlexIO simulated peripheral type. - * param handle Pointer to the handler for FlexIO simulated peripheral. - * param isr FlexIO simulated peripheral interrupt handler. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_RegisterHandleIRQ(void *base, void *handle, flexio_isr_t isr) -{ - assert(base != NULL); - assert(handle != NULL); - assert(isr != NULL); - - uint8_t index; - - /* Find the an empty handle pointer to store the handle. */ - for (index = 0U; index < (uint8_t)FLEXIO_HANDLE_COUNT; index++) - { - if (s_flexioHandle[index] == NULL) - { - /* Register FLEXIO simulated driver base, handle and isr. */ - s_flexioType[index] = base; - s_flexioHandle[index] = handle; - s_flexioIsr[index] = isr; - break; - } - } - - if (index == (uint8_t)FLEXIO_HANDLE_COUNT) - { - return kStatus_OutOfRange; - } - else - { - return kStatus_Success; - } -} - -/*! - * brief Unregisters the handle and the interrupt handler for the FlexIO-simulated peripheral. - * - * param base Pointer to the FlexIO simulated peripheral type. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_UnregisterHandleIRQ(void *base) -{ - assert(base != NULL); - - uint8_t index; - - /* Find the index from base address mappings. */ - for (index = 0U; index < (uint8_t)FLEXIO_HANDLE_COUNT; index++) - { - if (s_flexioType[index] == base) - { - /* Unregister FLEXIO simulated driver handle and isr. */ - s_flexioType[index] = NULL; - s_flexioHandle[index] = NULL; - s_flexioIsr[index] = NULL; - break; - } - } - - if (index == (uint8_t)FLEXIO_HANDLE_COUNT) - { - return kStatus_OutOfRange; - } - else - { - return kStatus_Success; - } -} - -static void FLEXIO_CommonIRQHandler(void) -{ - uint8_t index; - - for (index = 0U; index < (uint8_t)FLEXIO_HANDLE_COUNT; index++) - { - if (s_flexioHandle[index] != NULL) - { - s_flexioIsr[index](s_flexioType[index], s_flexioHandle[index]); - } - } - SDK_ISR_EXIT_BARRIER; -} - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER) && FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER -/*! - * brief Configure a FLEXIO pin used by the board. - * - * To Config the FLEXIO PIN, define a pin configuration, as either input or output, in the user file. - * Then, call the FLEXIO_SetPinConfig() function. - * - * This is an example to define an input pin or an output pin configuration. - * code - * Define a digital input pin configuration, - * flexio_gpio_config_t config = - * { - * kFLEXIO_DigitalInput, - * 0U, - * kFLEXIO_FlagRisingEdgeEnable | kFLEXIO_InputInterruptEnable, - * } - * Define a digital output pin configuration, - * flexio_gpio_config_t config = - * { - * kFLEXIO_DigitalOutput, - * 0U, - * 0U - * } - * endcode - * param base FlexIO peripheral base address - * param pin FLEXIO pin number. - * param config FLEXIO pin configuration pointer. - */ -void FLEXIO_SetPinConfig(FLEXIO_Type *base, uint32_t pin, flexio_gpio_config_t *config) -{ - assert(NULL != config); - IRQn_Type flexio_irqs[] = FLEXIO_IRQS; - - if (config->pinDirection == kFLEXIO_DigitalInput) - { - base->PINOUTE &= ~(1UL << pin); - if (0U != (config->inputConfig & (uint8_t)kFLEXIO_InputInterruptEnable)) - { - base->PINIEN = 1UL << pin; - /* Clear pending NVIC IRQ before enable NVIC IRQ. */ - NVIC_ClearPendingIRQ(flexio_irqs[FLEXIO_GetInstance(base)]); - /* Enable interrupt in NVIC. */ - (void)EnableIRQ(flexio_irqs[FLEXIO_GetInstance(base)]); - } - - if (0U != (config->inputConfig & (uint8_t)kFLEXIO_FlagRisingEdgeEnable)) - { - base->PINREN = 1UL << pin; - } - - if (0U != (config->inputConfig & (uint8_t)kFLEXIO_FlagFallingEdgeEnable)) - { - base->PINFEN = 1UL << pin; - } - } - else - { - FLEXIO_EnablePinOutput(base, pin); - FLEXIO_PinWrite(base, pin, config->outputLogic); - } -} -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER*/ - -void FLEXIO_DriverIRQHandler(void); -void FLEXIO_DriverIRQHandler(void) -{ - FLEXIO_CommonIRQHandler(); -} - -void FLEXIO0_DriverIRQHandler(void); -void FLEXIO0_DriverIRQHandler(void) -{ - FLEXIO_CommonIRQHandler(); -} - -void FLEXIO1_DriverIRQHandler(void); -void FLEXIO1_DriverIRQHandler(void) -{ - FLEXIO_CommonIRQHandler(); -} - -void UART2_FLEXIO_DriverIRQHandler(void); -void UART2_FLEXIO_DriverIRQHandler(void) -{ - FLEXIO_CommonIRQHandler(); -} - -void FLEXIO2_DriverIRQHandler(void); -void FLEXIO2_DriverIRQHandler(void) -{ - FLEXIO_CommonIRQHandler(); -} - -void FLEXIO3_DriverIRQHandler(void); -void FLEXIO3_DriverIRQHandler(void) -{ - FLEXIO_CommonIRQHandler(); -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio.h deleted file mode 100644 index 86f65535701..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio.h +++ /dev/null @@ -1,917 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020, 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_FLEXIO_H_ -#define FSL_FLEXIO_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup flexio_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief FlexIO driver version. */ -#define FSL_FLEXIO_DRIVER_VERSION (MAKE_VERSION(2, 2, 2)) -/*@}*/ - -/*! @brief Calculate FlexIO timer trigger.*/ -#define FLEXIO_TIMER_TRIGGER_SEL_PININPUT(x) ((uint32_t)(x) << 1U) -#define FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(x) (((uint32_t)(x) << 2U) | 0x1U) -#define FLEXIO_TIMER_TRIGGER_SEL_TIMn(x) (((uint32_t)(x) << 2U) | 0x3U) - -/*! @brief Define time of timer trigger polarity.*/ -typedef enum _flexio_timer_trigger_polarity -{ - kFLEXIO_TimerTriggerPolarityActiveHigh = 0x0U, /*!< Active high. */ - kFLEXIO_TimerTriggerPolarityActiveLow = 0x1U, /*!< Active low. */ -} flexio_timer_trigger_polarity_t; - -/*! @brief Define type of timer trigger source.*/ -typedef enum _flexio_timer_trigger_source -{ - kFLEXIO_TimerTriggerSourceExternal = 0x0U, /*!< External trigger selected. */ - kFLEXIO_TimerTriggerSourceInternal = 0x1U, /*!< Internal trigger selected. */ -} flexio_timer_trigger_source_t; - -/*! @brief Define type of timer/shifter pin configuration.*/ -typedef enum _flexio_pin_config -{ - kFLEXIO_PinConfigOutputDisabled = 0x0U, /*!< Pin output disabled. */ - kFLEXIO_PinConfigOpenDrainOrBidirection = 0x1U, /*!< Pin open drain or bidirectional output enable. */ - kFLEXIO_PinConfigBidirectionOutputData = 0x2U, /*!< Pin bidirectional output data. */ - kFLEXIO_PinConfigOutput = 0x3U, /*!< Pin output. */ -} flexio_pin_config_t; - -/*! @brief Definition of pin polarity.*/ -typedef enum _flexio_pin_polarity -{ - kFLEXIO_PinActiveHigh = 0x0U, /*!< Active high. */ - kFLEXIO_PinActiveLow = 0x1U, /*!< Active low. */ -} flexio_pin_polarity_t; - -/*! @brief Define type of timer work mode.*/ -typedef enum _flexio_timer_mode -{ - kFLEXIO_TimerModeDisabled = 0x0U, /*!< Timer Disabled. */ - kFLEXIO_TimerModeDual8BitBaudBit = 0x1U, /*!< Dual 8-bit counters baud/bit mode. */ - kFLEXIO_TimerModeDual8BitPWM = 0x2U, /*!< Dual 8-bit counters PWM mode. */ - kFLEXIO_TimerModeSingle16Bit = 0x3U, /*!< Single 16-bit counter mode. */ -} flexio_timer_mode_t; - -/*! @brief Define type of timer initial output or timer reset condition.*/ -typedef enum _flexio_timer_output -{ - kFLEXIO_TimerOutputOneNotAffectedByReset = 0x0U, /*!< Logic one when enabled and is not affected by timer - reset. */ - kFLEXIO_TimerOutputZeroNotAffectedByReset = 0x1U, /*!< Logic zero when enabled and is not affected by timer - reset. */ - kFLEXIO_TimerOutputOneAffectedByReset = 0x2U, /*!< Logic one when enabled and on timer reset. */ - kFLEXIO_TimerOutputZeroAffectedByReset = 0x3U, /*!< Logic zero when enabled and on timer reset. */ -} flexio_timer_output_t; - -/*! @brief Define type of timer decrement.*/ -typedef enum _flexio_timer_decrement_source -{ - kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput = 0x0U, /*!< Decrement counter on FlexIO clock, Shift clock - equals Timer output. */ - kFLEXIO_TimerDecSrcOnTriggerInputShiftTimerOutput, /*!< Decrement counter on Trigger input (both edges), - Shift clock equals Timer output. */ - kFLEXIO_TimerDecSrcOnPinInputShiftPinInput, /*!< Decrement counter on Pin input (both edges), - Shift clock equals Pin input. */ - kFLEXIO_TimerDecSrcOnTriggerInputShiftTriggerInput /*!< Decrement counter on Trigger input (both edges), - Shift clock equals Trigger input. */ -#if (defined(FSL_FEATURE_FLEXIO_TIMCFG_TIMDCE_FIELD_WIDTH) && (FSL_FEATURE_FLEXIO_TIMCFG_TIMDCE_FIELD_WIDTH == 3)) - , - kFLEXIO_TimerDecSrcDiv16OnFlexIOClockShiftTimerOutput, /*!< Decrement counter on FlexIO clock divided by 16, - Shift clock equals Timer output. */ - kFLEXIO_TimerDecSrcDiv256OnFlexIOClockShiftTimerOutput, /*!< Decrement counter on FlexIO clock divided by 256, - Shift clock equals Timer output. */ - kFLEXIO_TimerRisSrcOnPinInputShiftPinInput, /*!< Decrement counter on Pin input (rising edges), - Shift clock equals Pin input. */ - kFLEXIO_TimerRisSrcOnTriggerInputShiftTriggerInput /*!< Decrement counter on Trigger input (rising edges), Shift - clock equals Trigger input. */ -#endif /* FSL_FEATURE_FLEXIO_TIMCFG_TIMDCE_FIELD_WIDTH */ -} flexio_timer_decrement_source_t; - -/*! @brief Define type of timer reset condition.*/ -typedef enum _flexio_timer_reset_condition -{ - kFLEXIO_TimerResetNever = 0x0U, /*!< Timer never reset. */ - kFLEXIO_TimerResetOnTimerPinEqualToTimerOutput = 0x2U, /*!< Timer reset on Timer Pin equal to Timer Output. */ - kFLEXIO_TimerResetOnTimerTriggerEqualToTimerOutput = 0x3U, /*!< Timer reset on Timer Trigger equal to - Timer Output. */ - kFLEXIO_TimerResetOnTimerPinRisingEdge = 0x4U, /*!< Timer reset on Timer Pin rising edge. */ - kFLEXIO_TimerResetOnTimerTriggerRisingEdge = 0x6U, /*!< Timer reset on Trigger rising edge. */ - kFLEXIO_TimerResetOnTimerTriggerBothEdge = 0x7U, /*!< Timer reset on Trigger rising or falling edge. */ -} flexio_timer_reset_condition_t; - -/*! @brief Define type of timer disable condition.*/ -typedef enum _flexio_timer_disable_condition -{ - kFLEXIO_TimerDisableNever = 0x0U, /*!< Timer never disabled. */ - kFLEXIO_TimerDisableOnPreTimerDisable = 0x1U, /*!< Timer disabled on Timer N-1 disable. */ - kFLEXIO_TimerDisableOnTimerCompare = 0x2U, /*!< Timer disabled on Timer compare. */ - kFLEXIO_TimerDisableOnTimerCompareTriggerLow = 0x3U, /*!< Timer disabled on Timer compare and Trigger Low. */ - kFLEXIO_TimerDisableOnPinBothEdge = 0x4U, /*!< Timer disabled on Pin rising or falling edge. */ - kFLEXIO_TimerDisableOnPinBothEdgeTriggerHigh = 0x5U, /*!< Timer disabled on Pin rising or falling edge provided - Trigger is high. */ - kFLEXIO_TimerDisableOnTriggerFallingEdge = 0x6U, /*!< Timer disabled on Trigger falling edge. */ -} flexio_timer_disable_condition_t; - -/*! @brief Define type of timer enable condition.*/ -typedef enum _flexio_timer_enable_condition -{ - kFLEXIO_TimerEnabledAlways = 0x0U, /*!< Timer always enabled. */ - kFLEXIO_TimerEnableOnPrevTimerEnable = 0x1U, /*!< Timer enabled on Timer N-1 enable. */ - kFLEXIO_TimerEnableOnTriggerHigh = 0x2U, /*!< Timer enabled on Trigger high. */ - kFLEXIO_TimerEnableOnTriggerHighPinHigh = 0x3U, /*!< Timer enabled on Trigger high and Pin high. */ - kFLEXIO_TimerEnableOnPinRisingEdge = 0x4U, /*!< Timer enabled on Pin rising edge. */ - kFLEXIO_TimerEnableOnPinRisingEdgeTriggerHigh = 0x5U, /*!< Timer enabled on Pin rising edge and Trigger high. */ - kFLEXIO_TimerEnableOnTriggerRisingEdge = 0x6U, /*!< Timer enabled on Trigger rising edge. */ - kFLEXIO_TimerEnableOnTriggerBothEdge = 0x7U, /*!< Timer enabled on Trigger rising or falling edge. */ -} flexio_timer_enable_condition_t; - -/*! @brief Define type of timer stop bit generate condition.*/ -typedef enum _flexio_timer_stop_bit_condition -{ - kFLEXIO_TimerStopBitDisabled = 0x0U, /*!< Stop bit disabled. */ - kFLEXIO_TimerStopBitEnableOnTimerCompare = 0x1U, /*!< Stop bit is enabled on timer compare. */ - kFLEXIO_TimerStopBitEnableOnTimerDisable = 0x2U, /*!< Stop bit is enabled on timer disable. */ - kFLEXIO_TimerStopBitEnableOnTimerCompareDisable = 0x3U, /*!< Stop bit is enabled on timer compare and timer - disable. */ -} flexio_timer_stop_bit_condition_t; - -/*! @brief Define type of timer start bit generate condition.*/ -typedef enum _flexio_timer_start_bit_condition -{ - kFLEXIO_TimerStartBitDisabled = 0x0U, /*!< Start bit disabled. */ - kFLEXIO_TimerStartBitEnabled = 0x1U, /*!< Start bit enabled. */ -} flexio_timer_start_bit_condition_t; - -/*! @brief FlexIO as PWM channel output state */ -typedef enum _flexio_timer_output_state -{ - kFLEXIO_PwmLow = 0, /*!< The output state of PWM channel is low */ - kFLEXIO_PwmHigh, /*!< The output state of PWM channel is high */ -} flexio_timer_output_state_t; - -/*! @brief Define type of timer polarity for shifter control. */ -typedef enum _flexio_shifter_timer_polarity -{ - kFLEXIO_ShifterTimerPolarityOnPositive = 0x0U, /*!< Shift on positive edge of shift clock. */ - kFLEXIO_ShifterTimerPolarityOnNegitive = 0x1U, /*!< Shift on negative edge of shift clock. */ -} flexio_shifter_timer_polarity_t; - -/*! @brief Define type of shifter working mode.*/ -typedef enum _flexio_shifter_mode -{ - kFLEXIO_ShifterDisabled = 0x0U, /*!< Shifter is disabled. */ - kFLEXIO_ShifterModeReceive = 0x1U, /*!< Receive mode. */ - kFLEXIO_ShifterModeTransmit = 0x2U, /*!< Transmit mode. */ - kFLEXIO_ShifterModeMatchStore = 0x4U, /*!< Match store mode. */ - kFLEXIO_ShifterModeMatchContinuous = 0x5U, /*!< Match continuous mode. */ -#if FSL_FEATURE_FLEXIO_HAS_STATE_MODE - kFLEXIO_ShifterModeState = 0x6U, /*!< SHIFTBUF contents are used for storing - programmable state attributes. */ -#endif /* FSL_FEATURE_FLEXIO_HAS_STATE_MODE */ -#if FSL_FEATURE_FLEXIO_HAS_LOGIC_MODE - kFLEXIO_ShifterModeLogic = 0x7U, /*!< SHIFTBUF contents are used for implementing - programmable logic look up table. */ -#endif /* FSL_FEATURE_FLEXIO_HAS_LOGIC_MODE */ -} flexio_shifter_mode_t; - -/*! @brief Define type of shifter input source.*/ -typedef enum _flexio_shifter_input_source -{ - kFLEXIO_ShifterInputFromPin = 0x0U, /*!< Shifter input from pin. */ - kFLEXIO_ShifterInputFromNextShifterOutput = 0x1U, /*!< Shifter input from Shifter N+1. */ -} flexio_shifter_input_source_t; - -/*! @brief Define of STOP bit configuration.*/ -typedef enum _flexio_shifter_stop_bit -{ - kFLEXIO_ShifterStopBitDisable = 0x0U, /*!< Disable shifter stop bit. */ - kFLEXIO_ShifterStopBitLow = 0x2U, /*!< Set shifter stop bit to logic low level. */ - kFLEXIO_ShifterStopBitHigh = 0x3U, /*!< Set shifter stop bit to logic high level. */ -} flexio_shifter_stop_bit_t; - -/*! @brief Define type of START bit configuration.*/ -typedef enum _flexio_shifter_start_bit -{ - kFLEXIO_ShifterStartBitDisabledLoadDataOnEnable = 0x0U, /*!< Disable shifter start bit, transmitter loads - data on enable. */ - kFLEXIO_ShifterStartBitDisabledLoadDataOnShift = 0x1U, /*!< Disable shifter start bit, transmitter loads - data on first shift. */ - kFLEXIO_ShifterStartBitLow = 0x2U, /*!< Set shifter start bit to logic low level. */ - kFLEXIO_ShifterStartBitHigh = 0x3U, /*!< Set shifter start bit to logic high level. */ -} flexio_shifter_start_bit_t; - -/*! @brief Define FlexIO shifter buffer type*/ -typedef enum _flexio_shifter_buffer_type -{ - kFLEXIO_ShifterBuffer = 0x0U, /*!< Shifter Buffer N Register. */ - kFLEXIO_ShifterBufferBitSwapped = 0x1U, /*!< Shifter Buffer N Bit Byte Swapped Register. */ - kFLEXIO_ShifterBufferByteSwapped = 0x2U, /*!< Shifter Buffer N Byte Swapped Register. */ - kFLEXIO_ShifterBufferBitByteSwapped = 0x3U, /*!< Shifter Buffer N Bit Swapped Register. */ -#if defined(FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_BYTE_SWAP) && FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_BYTE_SWAP - kFLEXIO_ShifterBufferNibbleByteSwapped = 0x4U, /*!< Shifter Buffer N Nibble Byte Swapped Register. */ -#endif /*FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_BYTE_SWAP*/ -#if defined(FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_HALF_WORD_SWAP) && FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_HALF_WORD_SWAP - kFLEXIO_ShifterBufferHalfWordSwapped = 0x5U, /*!< Shifter Buffer N Half Word Swapped Register. */ -#endif -#if defined(FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_SWAP) && FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_SWAP - kFLEXIO_ShifterBufferNibbleSwapped = 0x6U, /*!< Shifter Buffer N Nibble Swapped Register. */ -#endif -} flexio_shifter_buffer_type_t; - -/*! @brief Define FlexIO user configuration structure. */ -typedef struct _flexio_config_ -{ - bool enableFlexio; /*!< Enable/disable FlexIO module */ - bool enableInDoze; /*!< Enable/disable FlexIO operation in doze mode */ - bool enableInDebug; /*!< Enable/disable FlexIO operation in debug mode */ - bool enableFastAccess; /*!< Enable/disable fast access to FlexIO registers, fast access requires - the FlexIO clock to be at least twice the frequency of the bus clock. */ -} flexio_config_t; - -/*! @brief Define FlexIO timer configuration structure. */ -typedef struct _flexio_timer_config -{ - /* Trigger. */ - uint32_t triggerSelect; /*!< The internal trigger selection number using MACROs. */ - flexio_timer_trigger_polarity_t triggerPolarity; /*!< Trigger Polarity. */ - flexio_timer_trigger_source_t triggerSource; /*!< Trigger Source, internal (see 'trgsel') or external. */ - /* Pin. */ - flexio_pin_config_t pinConfig; /*!< Timer Pin Configuration. */ - uint32_t pinSelect; /*!< Timer Pin number Select. */ - flexio_pin_polarity_t pinPolarity; /*!< Timer Pin Polarity. */ - /* Timer. */ - flexio_timer_mode_t timerMode; /*!< Timer work Mode. */ - flexio_timer_output_t timerOutput; /*!< Configures the initial state of the Timer Output and - whether it is affected by the Timer reset. */ - flexio_timer_decrement_source_t timerDecrement; /*!< Configures the source of the Timer decrement and the - source of the Shift clock. */ - flexio_timer_reset_condition_t timerReset; /*!< Configures the condition that causes the timer counter - (and optionally the timer output) to be reset. */ - flexio_timer_disable_condition_t timerDisable; /*!< Configures the condition that causes the Timer to be - disabled and stop decrementing. */ - flexio_timer_enable_condition_t timerEnable; /*!< Configures the condition that causes the Timer to be - enabled and start decrementing. */ - flexio_timer_stop_bit_condition_t timerStop; /*!< Timer STOP Bit generation. */ - flexio_timer_start_bit_condition_t timerStart; /*!< Timer STRAT Bit generation. */ - uint32_t timerCompare; /*!< Value for Timer Compare N Register. */ -} flexio_timer_config_t; - -/*! @brief Define FlexIO shifter configuration structure. */ -typedef struct _flexio_shifter_config -{ - /* Timer. */ - uint32_t timerSelect; /*!< Selects which Timer is used for controlling the - logic/shift register and generating the Shift clock. */ - flexio_shifter_timer_polarity_t timerPolarity; /*!< Timer Polarity. */ - /* Pin. */ - flexio_pin_config_t pinConfig; /*!< Shifter Pin Configuration. */ - uint32_t pinSelect; /*!< Shifter Pin number Select. */ - flexio_pin_polarity_t pinPolarity; /*!< Shifter Pin Polarity. */ - /* Shifter. */ - flexio_shifter_mode_t shifterMode; /*!< Configures the mode of the Shifter. */ -#if FSL_FEATURE_FLEXIO_HAS_PARALLEL_WIDTH - uint32_t parallelWidth; /*!< Configures the parallel width when using parallel mode.*/ -#endif /* FSL_FEATURE_FLEXIO_HAS_PARALLEL_WIDTH */ - flexio_shifter_input_source_t inputSource; /*!< Selects the input source for the shifter. */ - flexio_shifter_stop_bit_t shifterStop; /*!< Shifter STOP bit. */ - flexio_shifter_start_bit_t shifterStart; /*!< Shifter START bit. */ -} flexio_shifter_config_t; - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER) && FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER -/*! @brief FLEXIO gpio direction definition */ -typedef enum _flexio_gpio_direction -{ - kFLEXIO_DigitalInput = 0U, /*!< Set current pin as digital input*/ - kFLEXIO_DigitalOutput = 1U, /*!< Set current pin as digital output*/ -} flexio_gpio_direction_t; - -/*! @brief FLEXIO gpio input config */ -typedef enum _flexio_pin_input_config -{ - kFLEXIO_InputInterruptDisabled = 0x0U, /*!< Interrupt request is disabled. */ - kFLEXIO_InputInterruptEnable = 0x1U, /*!< Interrupt request is enable. */ - kFLEXIO_FlagRisingEdgeEnable = 0x2U, /*!< Input pin flag on rising edge. */ - kFLEXIO_FlagFallingEdgeEnable = 0x4U, /*!< Input pin flag on falling edge. */ -} flexio_pin_input_config_t; - -/*! - * @brief The FLEXIO pin configuration structure. - * - * Each pin can only be configured as either an output pin or an input pin at a time. - * If configured as an input pin, use inputConfig param. - * If configured as an output pin, use outputLogic. - */ -typedef struct _flexio_gpio_config -{ - flexio_gpio_direction_t pinDirection; /*!< FLEXIO pin direction, input or output */ - uint8_t outputLogic; /*!< Set a default output logic, which has no use in input */ - uint8_t inputConfig; /*!< Set an input config */ -} flexio_gpio_config_t; -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER*/ - -/*! @brief typedef for FlexIO simulated driver interrupt handler.*/ -typedef void (*flexio_isr_t)(void *base, void *handle); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to flexio bases for each instance. */ -extern FLEXIO_Type *const s_flexioBases[]; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to flexio clocks for each instance. */ -extern const clock_ip_name_t s_flexioClocks[]; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus*/ - -/*! - * @name FlexIO Initialization and De-initialization - * @{ - */ - -/*! - * @brief Gets the default configuration to configure the FlexIO module. The configuration - * can used directly to call the FLEXIO_Configure(). - * - * Example: - @code - flexio_config_t config; - FLEXIO_GetDefaultConfig(&config); - @endcode - * - * @param userConfig pointer to flexio_config_t structure -*/ -void FLEXIO_GetDefaultConfig(flexio_config_t *userConfig); - -/*! - * @brief Configures the FlexIO with a FlexIO configuration. The configuration structure - * can be filled by the user or be set with default values by FLEXIO_GetDefaultConfig(). - * - * Example - @code - flexio_config_t config = { - .enableFlexio = true, - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false - }; - FLEXIO_Configure(base, &config); - @endcode - * - * @param base FlexIO peripheral base address - * @param userConfig pointer to flexio_config_t structure -*/ -void FLEXIO_Init(FLEXIO_Type *base, const flexio_config_t *userConfig); - -/*! - * @brief Gates the FlexIO clock. Call this API to stop the FlexIO clock. - * - * @note After calling this API, call the FLEXO_Init to use the FlexIO module. - * - * @param base FlexIO peripheral base address - */ -void FLEXIO_Deinit(FLEXIO_Type *base); - -/*! - * @brief Get instance number for FLEXIO module. - * - * @param base FLEXIO peripheral base address. - */ -uint32_t FLEXIO_GetInstance(FLEXIO_Type *base); - -/* @} */ - -/*! - * @name FlexIO Basic Operation - * @{ - */ - -/*! - * @brief Resets the FlexIO module. - * - * @param base FlexIO peripheral base address - */ -void FLEXIO_Reset(FLEXIO_Type *base); - -/*! - * @brief Enables the FlexIO module operation. - * - * @param base FlexIO peripheral base address - * @param enable true to enable, false to disable. - */ -static inline void FLEXIO_Enable(FLEXIO_Type *base, bool enable) -{ - if (enable) - { - base->CTRL |= FLEXIO_CTRL_FLEXEN_MASK; - } - else - { - base->CTRL &= ~FLEXIO_CTRL_FLEXEN_MASK; - } -} - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_STATUS) && FSL_FEATURE_FLEXIO_HAS_PIN_STATUS -/*! - * @brief Reads the input data on each of the FlexIO pins. - * - * @param base FlexIO peripheral base address - * @return FlexIO pin input data - */ -static inline uint32_t FLEXIO_ReadPinInput(FLEXIO_Type *base) -{ - return base->PIN; -} -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_STATUS*/ - -#if defined(FSL_FEATURE_FLEXIO_HAS_STATE_MODE) && FSL_FEATURE_FLEXIO_HAS_STATE_MODE -/*! - * @brief Gets the current state pointer for state mode use. - * - * @param base FlexIO peripheral base address - * @return current State pointer - */ -static inline uint8_t FLEXIO_GetShifterState(FLEXIO_Type *base) -{ - return ((uint8_t)(base->SHIFTSTATE) & FLEXIO_SHIFTSTATE_STATE_MASK); -} -#endif /*FSL_FEATURE_FLEXIO_HAS_STATE_MODE*/ - -/*! - * @brief Configures the shifter with the shifter configuration. The configuration structure - * covers both the SHIFTCTL and SHIFTCFG registers. To configure the shifter to the proper - * mode, select which timer controls the shifter to shift, whether to generate start bit/stop - * bit, and the polarity of start bit and stop bit. - * - * Example - @code - flexio_shifter_config_t config = { - .timerSelect = 0, - .timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive, - .pinConfig = kFLEXIO_PinConfigOpenDrainOrBidirection, - .pinPolarity = kFLEXIO_PinActiveLow, - .shifterMode = kFLEXIO_ShifterModeTransmit, - .inputSource = kFLEXIO_ShifterInputFromPin, - .shifterStop = kFLEXIO_ShifterStopBitHigh, - .shifterStart = kFLEXIO_ShifterStartBitLow - }; - FLEXIO_SetShifterConfig(base, &config); - @endcode - * - * @param base FlexIO peripheral base address - * @param index Shifter index - * @param shifterConfig Pointer to flexio_shifter_config_t structure -*/ -void FLEXIO_SetShifterConfig(FLEXIO_Type *base, uint8_t index, const flexio_shifter_config_t *shifterConfig); -/*! - * @brief Configures the timer with the timer configuration. The configuration structure - * covers both the TIMCTL and TIMCFG registers. To configure the timer to the proper - * mode, select trigger source for timer and the timer pin output and the timing for timer. - * - * Example - @code - flexio_timer_config_t config = { - .triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(0), - .triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow, - .triggerSource = kFLEXIO_TimerTriggerSourceInternal, - .pinConfig = kFLEXIO_PinConfigOpenDrainOrBidirection, - .pinSelect = 0, - .pinPolarity = kFLEXIO_PinActiveHigh, - .timerMode = kFLEXIO_TimerModeDual8BitBaudBit, - .timerOutput = kFLEXIO_TimerOutputZeroNotAffectedByReset, - .timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput, - .timerReset = kFLEXIO_TimerResetOnTimerPinEqualToTimerOutput, - .timerDisable = kFLEXIO_TimerDisableOnTimerCompare, - .timerEnable = kFLEXIO_TimerEnableOnTriggerHigh, - .timerStop = kFLEXIO_TimerStopBitEnableOnTimerDisable, - .timerStart = kFLEXIO_TimerStartBitEnabled - }; - FLEXIO_SetTimerConfig(base, &config); - @endcode - * - * @param base FlexIO peripheral base address - * @param index Timer index - * @param timerConfig Pointer to the flexio_timer_config_t structure -*/ -void FLEXIO_SetTimerConfig(FLEXIO_Type *base, uint8_t index, const flexio_timer_config_t *timerConfig); - -/*! - * @brief This function set the value of the prescaler on flexio channels - * - * @param base Pointer to the FlexIO simulated peripheral type. - * @param index Timer index - * @param clocksource Set clock value - */ -static inline void FLEXIO_SetClockMode(FLEXIO_Type *base, uint8_t index, flexio_timer_decrement_source_t clocksource) -{ - uint32_t reg = base->TIMCFG[index]; - - reg &= ~FLEXIO_TIMCFG_TIMDEC_MASK; - - reg |= FLEXIO_TIMCFG_TIMDEC(clocksource); - - base->TIMCFG[index] = reg; -} - -/* @} */ - -/*! - * @name FlexIO Interrupt Operation - * @{ - */ - -/*! - * @brief Enables the shifter status interrupt. The interrupt generates when the corresponding SSF is set. - * - * @param base FlexIO peripheral base address - * @param mask The shifter status mask which can be calculated by (1 << shifter index) - * @note For multiple shifter status interrupt enable, for example, two shifter status enable, can calculate - * the mask by using ((1 << shifter index0) | (1 << shifter index1)) - */ -static inline void FLEXIO_EnableShifterStatusInterrupts(FLEXIO_Type *base, uint32_t mask) -{ - base->SHIFTSIEN |= mask; -} - -/*! - * @brief Disables the shifter status interrupt. The interrupt won't generate when the corresponding SSF is set. - * - * @param base FlexIO peripheral base address - * @param mask The shifter status mask which can be calculated by (1 << shifter index) - * @note For multiple shifter status interrupt enable, for example, two shifter status enable, can calculate - * the mask by using ((1 << shifter index0) | (1 << shifter index1)) - */ -static inline void FLEXIO_DisableShifterStatusInterrupts(FLEXIO_Type *base, uint32_t mask) -{ - base->SHIFTSIEN &= ~mask; -} - -/*! - * @brief Enables the shifter error interrupt. The interrupt generates when the corresponding SEF is set. - * - * @param base FlexIO peripheral base address - * @param mask The shifter error mask which can be calculated by (1 << shifter index) - * @note For multiple shifter error interrupt enable, for example, two shifter error enable, can calculate - * the mask by using ((1 << shifter index0) | (1 << shifter index1)) - */ -static inline void FLEXIO_EnableShifterErrorInterrupts(FLEXIO_Type *base, uint32_t mask) -{ - base->SHIFTEIEN |= mask; -} - -/*! - * @brief Disables the shifter error interrupt. The interrupt won't generate when the corresponding SEF is set. - * - * @param base FlexIO peripheral base address - * @param mask The shifter error mask which can be calculated by (1 << shifter index) - * @note For multiple shifter error interrupt enable, for example, two shifter error enable, can calculate - * the mask by using ((1 << shifter index0) | (1 << shifter index1)) - */ -static inline void FLEXIO_DisableShifterErrorInterrupts(FLEXIO_Type *base, uint32_t mask) -{ - base->SHIFTEIEN &= ~mask; -} - -/*! - * @brief Enables the timer status interrupt. The interrupt generates when the corresponding SSF is set. - * - * @param base FlexIO peripheral base address - * @param mask The timer status mask which can be calculated by (1 << timer index) - * @note For multiple timer status interrupt enable, for example, two timer status enable, can calculate - * the mask by using ((1 << timer index0) | (1 << timer index1)) - */ -static inline void FLEXIO_EnableTimerStatusInterrupts(FLEXIO_Type *base, uint32_t mask) -{ - base->TIMIEN |= mask; -} - -/*! - * @brief Disables the timer status interrupt. The interrupt won't generate when the corresponding SSF is set. - * - * @param base FlexIO peripheral base address - * @param mask The timer status mask which can be calculated by (1 << timer index) - * @note For multiple timer status interrupt enable, for example, two timer status enable, can calculate - * the mask by using ((1 << timer index0) | (1 << timer index1)) - */ -static inline void FLEXIO_DisableTimerStatusInterrupts(FLEXIO_Type *base, uint32_t mask) -{ - base->TIMIEN &= ~mask; -} - -/* @} */ - -/*! - * @name FlexIO Status Operation - * @{ - */ - -/*! - * @brief Gets the shifter status flags. - * - * @param base FlexIO peripheral base address - * @return Shifter status flags - */ -static inline uint32_t FLEXIO_GetShifterStatusFlags(FLEXIO_Type *base) -{ - return ((base->SHIFTSTAT) & FLEXIO_SHIFTSTAT_SSF_MASK); -} - -/*! - * @brief Clears the shifter status flags. - * - * @param base FlexIO peripheral base address - * @param mask The shifter status mask which can be calculated by (1 << shifter index) - * @note For clearing multiple shifter status flags, for example, two shifter status flags, can calculate - * the mask by using ((1 << shifter index0) | (1 << shifter index1)) - */ -static inline void FLEXIO_ClearShifterStatusFlags(FLEXIO_Type *base, uint32_t mask) -{ - base->SHIFTSTAT = mask; -} - -/*! - * @brief Gets the shifter error flags. - * - * @param base FlexIO peripheral base address - * @return Shifter error flags - */ -static inline uint32_t FLEXIO_GetShifterErrorFlags(FLEXIO_Type *base) -{ - return ((base->SHIFTERR) & FLEXIO_SHIFTERR_SEF_MASK); -} - -/*! - * @brief Clears the shifter error flags. - * - * @param base FlexIO peripheral base address - * @param mask The shifter error mask which can be calculated by (1 << shifter index) - * @note For clearing multiple shifter error flags, for example, two shifter error flags, can calculate - * the mask by using ((1 << shifter index0) | (1 << shifter index1)) - */ -static inline void FLEXIO_ClearShifterErrorFlags(FLEXIO_Type *base, uint32_t mask) -{ - base->SHIFTERR = mask; -} - -/*! - * @brief Gets the timer status flags. - * - * @param base FlexIO peripheral base address - * @return Timer status flags - */ -static inline uint32_t FLEXIO_GetTimerStatusFlags(FLEXIO_Type *base) -{ - return ((base->TIMSTAT) & FLEXIO_TIMSTAT_TSF_MASK); -} - -/*! - * @brief Clears the timer status flags. - * - * @param base FlexIO peripheral base address - * @param mask The timer status mask which can be calculated by (1 << timer index) - * @note For clearing multiple timer status flags, for example, two timer status flags, can calculate - * the mask by using ((1 << timer index0) | (1 << timer index1)) - */ -static inline void FLEXIO_ClearTimerStatusFlags(FLEXIO_Type *base, uint32_t mask) -{ - base->TIMSTAT = mask; -} - -/* @} */ - -/*! - * @name FlexIO DMA Operation - * @{ - */ - -/*! - * @brief Enables/disables the shifter status DMA. The DMA request generates when the corresponding SSF is set. - * - * @note For multiple shifter status DMA enables, for example, calculate - * the mask by using ((1 << shifter index0) | (1 << shifter index1)) - * - * @param base FlexIO peripheral base address - * @param mask The shifter status mask which can be calculated by (1 << shifter index) - * @param enable True to enable, false to disable. - */ -static inline void FLEXIO_EnableShifterStatusDMA(FLEXIO_Type *base, uint32_t mask, bool enable) -{ - if (enable) - { - base->SHIFTSDEN |= mask; - } - else - { - base->SHIFTSDEN &= ~mask; - } -} - -/*! - * @brief Gets the shifter buffer address for the DMA transfer usage. - * - * @param base FlexIO peripheral base address - * @param type Shifter type of flexio_shifter_buffer_type_t - * @param index Shifter index - * @return Corresponding shifter buffer index - */ -uint32_t FLEXIO_GetShifterBufferAddress(FLEXIO_Type *base, flexio_shifter_buffer_type_t type, uint8_t index); - -/*! - * @brief Registers the handle and the interrupt handler for the FlexIO-simulated peripheral. - * - * @param base Pointer to the FlexIO simulated peripheral type. - * @param handle Pointer to the handler for FlexIO simulated peripheral. - * @param isr FlexIO simulated peripheral interrupt handler. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_RegisterHandleIRQ(void *base, void *handle, flexio_isr_t isr); - -/*! - * @brief Unregisters the handle and the interrupt handler for the FlexIO-simulated peripheral. - * - * @param base Pointer to the FlexIO simulated peripheral type. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_UnregisterHandleIRQ(void *base); -/* @} */ - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER) && FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER - -/*! - * @brief Configure a FLEXIO pin used by the board. - * - * To Config the FLEXIO PIN, define a pin configuration, as either input or output, in the user file. - * Then, call the FLEXIO_SetPinConfig() function. - * - * This is an example to define an input pin or an output pin configuration. - * @code - * Define a digital input pin configuration, - * flexio_gpio_config_t config = - * { - * kFLEXIO_DigitalInput, - * 0U, - * kFLEXIO_FlagRisingEdgeEnable | kFLEXIO_InputInterruptEnable, - * } - * Define a digital output pin configuration, - * flexio_gpio_config_t config = - * { - * kFLEXIO_DigitalOutput, - * 0U, - * 0U - * } - * @endcode - * @param base FlexIO peripheral base address - * @param pin FLEXIO pin number. - * @param config FLEXIO pin configuration pointer. - */ -void FLEXIO_SetPinConfig(FLEXIO_Type *base, uint32_t pin, flexio_gpio_config_t *config); - -/*! - * @name GPIO Output Operations - * @{ - */ - -/*! - * @brief Sets the output level of the multiple FLEXIO pins to the logic 0. - * - * @param base FlexIO peripheral base address - * @param mask FLEXIO pin number mask - */ -static inline void FLEXIO_ClearPortOutput(FLEXIO_Type *base, uint32_t mask) -{ - base->PINOUTCLR = mask; -} - -/*! - * @brief Sets the output level of the multiple FLEXIO pins to the logic 1. - * - * @param base FlexIO peripheral base address - * @param mask FLEXIO pin number mask - */ -static inline void FLEXIO_SetPortOutput(FLEXIO_Type *base, uint32_t mask) -{ - base->PINOUTSET = mask; -} - -/*! - * @brief Reverses the current output logic of the multiple FLEXIO pins. - * - * @param base FlexIO peripheral base address - * @param mask FLEXIO pin number mask - */ -static inline void FLEXIO_TogglePortOutput(FLEXIO_Type *base, uint32_t mask) -{ - base->PINOUTTOG = mask; -} - -/*! - * @brief Sets the output level of the FLEXIO pins to the logic 1 or 0. - * - * @param base FlexIO peripheral base address - * @param pin FLEXIO pin number. - * @param output FLEXIO pin output logic level. - * - 0: corresponding pin output low-logic level. - * - 1: corresponding pin output high-logic level. - */ -static inline void FLEXIO_PinWrite(FLEXIO_Type *base, uint32_t pin, uint8_t output) -{ - if (output == 0U) - { - FLEXIO_ClearPortOutput(base, 1UL << pin); - } - else - { - FLEXIO_SetPortOutput(base, 1UL << pin); - } -} - -/*! - * @brief Enables the FLEXIO output pin function. - * - * @param base FlexIO peripheral base address - * @param pin FLEXIO pin number. - */ -static inline void FLEXIO_EnablePinOutput(FLEXIO_Type *base, uint32_t pin) -{ - base->PINOUTE |= (1UL << pin); -} -/*@}*/ - -/*! - * @name FLEXIO PIN Input Operations - * @{ - */ - -/*! - * @brief Reads the current input value of the FLEXIO pin. - * - * @param base FlexIO peripheral base address - * @param pin FLEXIO pin number. - * @retval FLEXIO port input value - * - 0: corresponding pin input low-logic level. - * - 1: corresponding pin input high-logic level. - */ -static inline uint32_t FLEXIO_PinRead(FLEXIO_Type *base, uint32_t pin) -{ - return (((base->PIN) >> pin) & 0x01U); -} - -/*! - * @brief Gets the FLEXIO input pin status. - * - * @param base FlexIO peripheral base address - * @param pin FLEXIO pin number. - * @retval FLEXIO port input status - * - 0: corresponding pin input capture no status. - * - 1: corresponding pin input capture rising or falling edge. - */ -static inline uint32_t FLEXIO_GetPinStatus(FLEXIO_Type *base, uint32_t pin) -{ - return (((base->PINSTAT) >> pin) & 0x01U); -} - -/*! - * @brief Clears the multiple FLEXIO input pins status. - * - * @param base FlexIO peripheral base address - * @param mask FLEXIO pin number mask - */ -static inline void FLEXIO_ClearPortStatus(FLEXIO_Type *base, uint32_t mask) -{ - base->PINSTAT = mask; -} -/*@}*/ - -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER*/ - -#if defined(__cplusplus) -} -#endif /*_cplusplus*/ -/*@}*/ - -#endif /*FSL_FLEXIO_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_i2c_master.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_i2c_master.c deleted file mode 100644 index 9239527c6fa..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_i2c_master.c +++ /dev/null @@ -1,1377 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio_i2c_master.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio_i2c_master" -#endif - -/*! @brief FLEXIO I2C transfer state */ -enum _flexio_i2c_master_transfer_states -{ - kFLEXIO_I2C_Idle = 0x0U, /*!< I2C bus idle */ - kFLEXIO_I2C_Start = 0x1U, /*!< I2C start phase */ - kFLEXIO_I2C_SendCommand = 0x2U, /*!< Send command byte phase */ - kFLEXIO_I2C_SendData = 0x3U, /*!< Send data transfer phase*/ - kFLEXIO_I2C_ReceiveDataBegin = 0x4U, /*!< Receive data begin transfer phase*/ - kFLEXIO_I2C_ReceiveData = 0x5U, /*!< Receive data transfer phase*/ -}; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Set up master transfer, send slave address and decide the initial - * transfer state. - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param transfer pointer to flexio_i2c_master_transfer_t structure - */ -static status_t FLEXIO_I2C_MasterTransferInitStateMachine(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - flexio_i2c_master_transfer_t *xfer); - -/*! - * @brief Master run transfer state machine to perform a byte of transfer. - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param statusFlags flexio i2c hardware status - * @retval kStatus_Success Successfully run state machine - * @retval kStatus_FLEXIO_I2C_Nak Receive Nak during transfer - */ -static status_t FLEXIO_I2C_MasterTransferRunStateMachine(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags); - -/*! - * @brief Complete transfer, disable interrupt and call callback. - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param status flexio transfer status - */ -static void FLEXIO_I2C_MasterTransferComplete(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - status_t status); - -/*! - * @brief introduce function FLEXIO_I2C_MasterTransferStateMachineStart. - * This function was deal with Initial state, i2c start state. - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - */ -static void FLEXIO_I2C_MasterTransferStateMachineStart(FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle); - -/*! - * @brief introduce function FLEXIO_I2C_MasterTransferStateMachineSendCommand. - * This function was deal with Check address only needed for transfer with subaddress . - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param statusFlags flexio i2c hardware status - * - * @return default is true when No abnormality. - * @return false when time out. - */ -static bool FLEXIO_I2C_MasterTransferStateMachineSendCommand(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags); - -/*! - * @brief introduce function FLEXIO_I2C_MasterTransferStateMachineSendData. - * This function was deal with Send command byte. - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param statusFlags flexio i2c hardware status - * - * @return default is true when No abnormality. - * @return false when time out. - */ -static bool FLEXIO_I2C_MasterTransferStateMachineSendData(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags); - -/*! - * @brief introduce function FLEXIO_I2C_MasterTransferStateMachineReceiveDataBegin. - * This function was deal with Receive Data Begin. - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param statusFlags flexio i2c hardware status - * - * @return default is true when No abnormality. - * @return false when time out. - */ -static bool FLEXIO_I2C_MasterTransferStateMachineReceiveDataBegin(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags); - -/*! - * @brief introduce function Case_kFLEXIO_I2C_ReceiveDataBegin. - * This function was deal with Receive Data. - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param statusFlags flexio i2c hardware status - * - * @return default is kStatus_Success when No abnormality. - * @return kStatus_FLEXIO_I2C_Nak when ReceiveNakFlag is not set. - * @return kStatus_FLEXIO_I2C_Timeout when time out. - */ -static status_t FLEXIO_I2C_MasterTransferStateMachineReceiveData(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags); - -/******************************************************************************* - * Codes - ******************************************************************************/ - -static uint32_t FLEXIO_I2C_GetInstance(FLEXIO_I2C_Type *base) -{ - return FLEXIO_GetInstance(base->flexioBase); -} - -static status_t FLEXIO_I2C_MasterTransferInitStateMachine(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - flexio_i2c_master_transfer_t *xfer) -{ - bool needRestart; - uint32_t byteCount; - - /* Init the handle member. */ - handle->transfer.slaveAddress = xfer->slaveAddress; - handle->transfer.direction = xfer->direction; - handle->transfer.subaddress = xfer->subaddress; - handle->transfer.subaddressSize = xfer->subaddressSize; - handle->transfer.data = xfer->data; - handle->transfer.dataSize = xfer->dataSize; - handle->transfer.flags = xfer->flags; - handle->transferSize = xfer->dataSize; - - /* Initial state, i2c start state. */ - handle->state = (uint8_t)kFLEXIO_I2C_Start; - - /* Clear all status before transfer. */ - FLEXIO_I2C_MasterClearStatusFlags(base, (uint32_t)kFLEXIO_I2C_ReceiveNakFlag); - - /* Calculate whether need to send re-start. */ - needRestart = (handle->transfer.subaddressSize != 0U) && (handle->transfer.direction == kFLEXIO_I2C_Read); - handle->needRestart = needRestart; - - /* Calculate total byte count in a frame. */ - byteCount = 1U; - - if (!needRestart) - { - byteCount += handle->transfer.dataSize; - } - - if (handle->transfer.subaddressSize != 0U) - { - byteCount += handle->transfer.subaddressSize; - } - - /* Configure data count. */ - if (FLEXIO_I2C_MasterSetTransferCount(base, (uint16_t)byteCount) != kStatus_Success) - { - return kStatus_InvalidArgument; - } - - /* Configure timer1 disable condition. */ - uint32_t tmpConfig = base->flexioBase->TIMCFG[base->timerIndex[1]]; - tmpConfig &= ~FLEXIO_TIMCFG_TIMDIS_MASK; - tmpConfig |= FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnPreTimerDisable); - base->flexioBase->TIMCFG[base->timerIndex[1]] = tmpConfig; - -#if I2C_RETRY_TIMES - uint32_t waitTimes = I2C_RETRY_TIMES; - while ((0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return kStatus_FLEXIO_I2C_Timeout; - } -#else - while (0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) - { - } -#endif - - return kStatus_Success; -} - -static void FLEXIO_I2C_MasterTransferStateMachineStart(FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle) -{ - if (handle->needRestart) - { - FLEXIO_I2C_MasterStart(base, handle->transfer.slaveAddress, kFLEXIO_I2C_Write); - } - else - { - FLEXIO_I2C_MasterStart(base, handle->transfer.slaveAddress, handle->transfer.direction); - } - if (handle->transfer.subaddressSize == 0U) - { - if (handle->transfer.direction == kFLEXIO_I2C_Write) - { - /* Next state, send data. */ - handle->state = (uint8_t)kFLEXIO_I2C_SendData; - } - else - { - /* Next state, receive data begin. */ - handle->state = (uint8_t)kFLEXIO_I2C_ReceiveDataBegin; - } - } - else - { - /* Next state, send command byte. */ - handle->state = (uint8_t)kFLEXIO_I2C_SendCommand; - } -} - -static bool FLEXIO_I2C_MasterTransferStateMachineSendCommand(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags) -{ - if ((statusFlags & (uint32_t)kFLEXIO_I2C_TxEmptyFlag) != 0U) - { - if (handle->transfer.subaddressSize > 0U) - { - handle->transfer.subaddressSize--; - FLEXIO_I2C_MasterWriteByte(base, ((handle->transfer.subaddress) >> (8U * handle->transfer.subaddressSize))); - - if (handle->transfer.subaddressSize == 0U) - { - /* Load re-start in advance. */ - if (handle->transfer.direction == kFLEXIO_I2C_Read) - { -#if I2C_RETRY_TIMES - while ((0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return false; - } -#else - while (0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) - { - } -#endif - FLEXIO_I2C_MasterRepeatedStart(base); - } - } - } - else - { - if (handle->transfer.direction == kFLEXIO_I2C_Write) - { - /* Send first byte of data. */ - if (handle->transfer.dataSize > 0U) - { - /* Next state, send data. */ - handle->state = (uint8_t)kFLEXIO_I2C_SendData; - - FLEXIO_I2C_MasterWriteByte(base, *handle->transfer.data); - handle->transfer.data++; - handle->transfer.dataSize--; - } - else - { - FLEXIO_I2C_MasterStop(base); - -#if I2C_RETRY_TIMES - while ((0U == (FLEXIO_I2C_MasterGetStatusFlags(base) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return false; - } -#else - while (0U == (FLEXIO_I2C_MasterGetStatusFlags(base) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) - { - } -#endif - (void)FLEXIO_I2C_MasterReadByte(base); - - handle->state = (uint8_t)kFLEXIO_I2C_Idle; - } - } - else - { - (void)FLEXIO_I2C_MasterSetTransferCount(base, (uint16_t)(handle->transfer.dataSize + 1U)); - /* Delay at least one clock cycle so that the restart setup time is up to spec standard. */ - SDK_DelayAtLeastUs(1000000UL / base->baudrate, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY); - FLEXIO_I2C_MasterStart(base, handle->transfer.slaveAddress, kFLEXIO_I2C_Read); - - /* Next state, receive data begin. */ - handle->state = (uint8_t)kFLEXIO_I2C_ReceiveDataBegin; - } - } - } - return true; -} - -static bool FLEXIO_I2C_MasterTransferStateMachineSendData(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags) -{ - if ((statusFlags & (uint32_t)kFLEXIO_I2C_TxEmptyFlag) != 0U) - { - /* Send one byte of data. */ - if (handle->transfer.dataSize > 0U) - { - FLEXIO_I2C_MasterWriteByte(base, *handle->transfer.data); - - handle->transfer.data++; - handle->transfer.dataSize--; - } - else - { - FLEXIO_I2C_MasterStop(base); - -#if I2C_RETRY_TIMES - while ((0U == (FLEXIO_I2C_MasterGetStatusFlags(base) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return false; - } -#else - while (0U == (FLEXIO_I2C_MasterGetStatusFlags(base) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) - { - } -#endif - (void)FLEXIO_I2C_MasterReadByte(base); - - handle->state = (uint8_t)kFLEXIO_I2C_Idle; - } - } - return true; -} - -static bool FLEXIO_I2C_MasterTransferStateMachineReceiveDataBegin(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags) -{ - if ((statusFlags & (uint32_t)kFLEXIO_I2C_RxFullFlag) != 0U) - { - handle->state = (uint8_t)kFLEXIO_I2C_ReceiveData; - /* Send nak at the last receive byte. */ - if (handle->transfer.dataSize == 1U) - { - FLEXIO_I2C_MasterEnableAck(base, false); -#if I2C_RETRY_TIMES - while ((0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return false; - } -#else - while (0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) - { - } -#endif - FLEXIO_I2C_MasterStop(base); - } - else - { - FLEXIO_I2C_MasterEnableAck(base, true); - } - } - else if ((statusFlags & (uint32_t)kFLEXIO_I2C_TxEmptyFlag) != 0U) - { - /* Read one byte of data. */ - FLEXIO_I2C_MasterWriteByte(base, 0xFFFFFFFFU); - } - else - { - ; /* Avoid MISRA 2012 rule 15.7 */ - } - return true; -} - -static status_t FLEXIO_I2C_MasterTransferStateMachineReceiveData(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags) -{ - if ((statusFlags & (uint32_t)kFLEXIO_I2C_RxFullFlag) != 0U) - { - *handle->transfer.data = FLEXIO_I2C_MasterReadByte(base); - handle->transfer.data++; - if (0U != handle->transfer.dataSize--) - { - if (handle->transfer.dataSize == 0U) - { - FLEXIO_I2C_MasterDisableInterrupts(base, (uint32_t)kFLEXIO_I2C_RxFullInterruptEnable); - handle->state = (uint8_t)kFLEXIO_I2C_Idle; - /* Return nak if ReceiveNakFlag is not set */ - if ((statusFlags & (uint32_t)kFLEXIO_I2C_ReceiveNakFlag) == 0U) - { - return kStatus_FLEXIO_I2C_Nak; - } - } - - /* Send nak at the last receive byte. */ - if (handle->transfer.dataSize == 1U) - { - FLEXIO_I2C_MasterEnableAck(base, false); -#if I2C_RETRY_TIMES - while ((0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return kStatus_FLEXIO_I2C_Timeout; - } -#else - while (0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) - { - } -#endif - FLEXIO_I2C_MasterStop(base); - } - } - } - else if ((statusFlags & (uint32_t)kFLEXIO_I2C_TxEmptyFlag) != 0U) - { - if (handle->transfer.dataSize > 1U) - { - FLEXIO_I2C_MasterWriteByte(base, 0xFFFFFFFFU); - } - } - else - { - ; /* Avoid MISRA 2012 rule 15.7 */ - } - return kStatus_Success; -} - -static status_t FLEXIO_I2C_MasterTransferRunStateMachine(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags) -{ - status_t status; -#if I2C_RETRY_TIMES - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - - if ((statusFlags & (uint32_t)kFLEXIO_I2C_ReceiveNakFlag) != 0U) - { - /* Clear receive nak flag. */ - FLEXIO_ClearShifterErrorFlags(base->flexioBase, 1UL << base->shifterIndex[1]); - - if ((!((handle->state == (uint8_t)kFLEXIO_I2C_SendData) && (handle->transfer.dataSize == 0U))) && - (!(((handle->state == (uint8_t)kFLEXIO_I2C_ReceiveData) || - (handle->state == (uint8_t)kFLEXIO_I2C_ReceiveDataBegin)) && - (handle->transfer.dataSize == 1U)))) - { - (void)FLEXIO_I2C_MasterReadByte(base); - - FLEXIO_I2C_MasterAbortStop(base); - - /* Delay one clk cycle to ensure the bus is idle. */ - SDK_DelayAtLeastUs(1000000UL / base->baudrate, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY); - - handle->state = (uint8_t)kFLEXIO_I2C_Idle; - - return kStatus_FLEXIO_I2C_Nak; - } - } - - if (((statusFlags & (uint8_t)kFLEXIO_I2C_RxFullFlag) != 0U) && (handle->state != (uint8_t)kFLEXIO_I2C_ReceiveData)) - { - (void)FLEXIO_I2C_MasterReadByte(base); - } - - switch (handle->state) - { - /* Initial state, i2c start state. */ - case (uint8_t)kFLEXIO_I2C_Start: - /* Send address byte first. */ - FLEXIO_I2C_MasterTransferStateMachineStart(base, handle); - break; - - /* Check address only needed for transfer with subaddress */ - case (uint8_t)kFLEXIO_I2C_SendCommand: - if (false == FLEXIO_I2C_MasterTransferStateMachineSendCommand(base, handle, statusFlags)) - { - return kStatus_FLEXIO_I2C_Timeout; - } - break; - - /* Send command byte. */ - case (uint8_t)kFLEXIO_I2C_SendData: - if (false == FLEXIO_I2C_MasterTransferStateMachineSendData(base, handle, statusFlags)) - { - return kStatus_FLEXIO_I2C_Timeout; - } - break; - - case (uint8_t)kFLEXIO_I2C_ReceiveDataBegin: - if (false == FLEXIO_I2C_MasterTransferStateMachineReceiveDataBegin(base, handle, statusFlags)) - { - return kStatus_FLEXIO_I2C_Timeout; - } - break; - - case (uint8_t)kFLEXIO_I2C_ReceiveData: - status = FLEXIO_I2C_MasterTransferStateMachineReceiveData(base, handle, statusFlags); - if (kStatus_Success != status) - { - return status; - } - break; - - default: - /* Add comment to avoid MISRA violation */ - break; - } - - return kStatus_Success; -} - -static void FLEXIO_I2C_MasterTransferComplete(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - status_t status) -{ - FLEXIO_I2C_MasterDisableInterrupts( - base, (uint32_t)kFLEXIO_I2C_TxEmptyInterruptEnable | (uint32_t)kFLEXIO_I2C_RxFullInterruptEnable); - - if (handle->completionCallback != NULL) - { - handle->completionCallback(base, handle, status, handle->userData); - } -} - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_STATUS) && FSL_FEATURE_FLEXIO_HAS_PIN_STATUS -/*! - * brief Make sure the bus isn't already pulled down. - * - * Check the FLEXIO pin status to see whether either of SDA and SCL pin is pulled down. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * retval kStatus_Success - * retval kStatus_FLEXIO_I2C_Busy - */ -status_t FLEXIO_I2C_CheckForBusyBus(FLEXIO_I2C_Type *base) -{ - uint32_t mask; - /* If in certain loops the SDA/SCL is continuously pulled down, then return bus busy status. */ - /* The loop count is determined by maximum CPU clock frequency */ - for (uint32_t i = 0U; i < SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY / 600000U; ++i) - { - mask = 1UL << base->SDAPinIndex | 1UL << base->SCLPinIndex; - if ((FLEXIO_ReadPinInput(base->flexioBase) & mask) == mask) - { - return kStatus_Success; - } - } - return kStatus_FLEXIO_I2C_Busy; -} -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_STATUS*/ - -/*! - * brief Ungates the FlexIO clock, resets the FlexIO module, and configures the FlexIO I2C - * hardware configuration. - * - * Example - code - FLEXIO_I2C_Type base = { - .flexioBase = FLEXIO, - .SDAPinIndex = 0, - .SCLPinIndex = 1, - .shifterIndex = {0,1}, - .timerIndex = {0,1} - }; - flexio_i2c_master_config_t config = { - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .baudRate_Bps = 100000 - }; - FLEXIO_I2C_MasterInit(base, &config, srcClock_Hz); - endcode - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param masterConfig Pointer to flexio_i2c_master_config_t structure. - * param srcClock_Hz FlexIO source clock in Hz. - * retval kStatus_Success Initialization successful - * retval kStatus_InvalidArgument The source clock exceed upper range limitation -*/ -status_t FLEXIO_I2C_MasterInit(FLEXIO_I2C_Type *base, flexio_i2c_master_config_t *masterConfig, uint32_t srcClock_Hz) -{ - assert((base != NULL) && (masterConfig != NULL)); - - flexio_shifter_config_t shifterConfig; - flexio_timer_config_t timerConfig; - uint32_t controlVal = 0; - uint16_t timerDiv = 0; - status_t result = kStatus_Success; - - (void)memset(&shifterConfig, 0, sizeof(shifterConfig)); - (void)memset(&timerConfig, 0, sizeof(timerConfig)); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate flexio clock. */ - CLOCK_EnableClock(s_flexioClocks[FLEXIO_I2C_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Do hardware configuration. */ - /* 1. Configure the shifter 0 for tx. */ - shifterConfig.timerSelect = base->timerIndex[2]; - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive; - shifterConfig.pinConfig = kFLEXIO_PinConfigOpenDrainOrBidirection; - shifterConfig.pinSelect = base->SDAPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveLow; - shifterConfig.shifterMode = kFLEXIO_ShifterModeTransmit; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitHigh; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitLow; - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[0], &shifterConfig); - - /* 2. Configure the shifter 1 for rx. */ - shifterConfig.timerSelect = base->timerIndex[2]; - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnNegitive; - shifterConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - shifterConfig.pinSelect = base->SDAPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveHigh; - shifterConfig.shifterMode = kFLEXIO_ShifterModeReceive; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitLow; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnEnable; - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[1], &shifterConfig); - - /*3. Configure the timer 0 and timer 1 for generating bit clock. */ - /* timer 1 is used to config baudrate */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->shifterIndex[0]); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOpenDrainOrBidirection; - timerConfig.pinSelect = base->SCLPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveHigh; - timerConfig.timerMode = kFLEXIO_TimerModeSingle16Bit; - timerConfig.timerOutput = kFLEXIO_TimerOutputZeroNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput; - timerConfig.timerReset = kFLEXIO_TimerResetOnTimerPinEqualToTimerOutput; - timerConfig.timerDisable = kFLEXIO_TimerDisableOnPreTimerDisable; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnTriggerHigh; - timerConfig.timerStop = kFLEXIO_TimerStopBitDisabled; - timerConfig.timerStart = kFLEXIO_TimerStartBitDisabled; - - /* Set TIMCMP = (baud rate divider / 2) - 1. */ - timerDiv = (uint16_t)(srcClock_Hz / masterConfig->baudRate_Bps) / 2U - 1U; - /* Calculate and assign the actual baudrate. */ - base->baudrate = srcClock_Hz / (2U * ((uint32_t)timerDiv + 1U)); - - timerConfig.timerCompare = timerDiv; - - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[1], &timerConfig); - - /* timer 0 is used to config total shift clock edges */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->shifterIndex[0]); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - timerConfig.pinSelect = base->SCLPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveHigh; - timerConfig.timerMode = kFLEXIO_TimerModeSingle16Bit; - timerConfig.timerOutput = kFLEXIO_TimerOutputOneNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnPinInputShiftPinInput; - timerConfig.timerReset = kFLEXIO_TimerResetNever; - timerConfig.timerDisable = kFLEXIO_TimerDisableOnTimerCompare; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnTriggerHigh; - timerConfig.timerStop = kFLEXIO_TimerStopBitDisabled; - timerConfig.timerStart = kFLEXIO_TimerStartBitDisabled; - - /* Set TIMCMP when confinguring transfer bytes. */ - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[0], &timerConfig); - - /* 4. Configure the timer 2 for controlling shifters. */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->shifterIndex[0]); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - timerConfig.pinSelect = base->SCLPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveLow; - timerConfig.timerMode = kFLEXIO_TimerModeSingle16Bit; - timerConfig.timerOutput = kFLEXIO_TimerOutputOneNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnPinInputShiftPinInput; - timerConfig.timerReset = kFLEXIO_TimerResetNever; - timerConfig.timerDisable = kFLEXIO_TimerDisableOnPreTimerDisable; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnPrevTimerEnable; - timerConfig.timerStop = kFLEXIO_TimerStopBitEnableOnTimerCompare; - timerConfig.timerStart = kFLEXIO_TimerStartBitEnabled; - - /* Set TIMCMP[15:0] = (number of bits x 2) - 1. */ - timerConfig.timerCompare = 8U * 2U - 1U; - - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[2], &timerConfig); - - /* Configure FLEXIO I2C Master. */ - controlVal = base->flexioBase->CTRL; - controlVal &= - ~(FLEXIO_CTRL_DOZEN_MASK | FLEXIO_CTRL_DBGE_MASK | FLEXIO_CTRL_FASTACC_MASK | FLEXIO_CTRL_FLEXEN_MASK); - controlVal |= (FLEXIO_CTRL_DBGE(masterConfig->enableInDebug) | FLEXIO_CTRL_FASTACC(masterConfig->enableFastAccess) | - FLEXIO_CTRL_FLEXEN(masterConfig->enableMaster)); - if (!masterConfig->enableInDoze) - { - controlVal |= FLEXIO_CTRL_DOZEN_MASK; - } - - base->flexioBase->CTRL = controlVal; - /* Disable internal IRQs. */ - FLEXIO_I2C_MasterDisableInterrupts( - base, (uint32_t)kFLEXIO_I2C_TxEmptyInterruptEnable | (uint32_t)kFLEXIO_I2C_RxFullInterruptEnable); - return result; -} - -/*! - * brief De-initializes the FlexIO I2C master peripheral. Calling this API Resets the FlexIO I2C master - * shifer and timer config, module can't work unless the FLEXIO_I2C_MasterInit is called. - * - * param base pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterDeinit(FLEXIO_I2C_Type *base) -{ - base->flexioBase->SHIFTCFG[base->shifterIndex[0]] = 0; - base->flexioBase->SHIFTCTL[base->shifterIndex[0]] = 0; - base->flexioBase->SHIFTCFG[base->shifterIndex[1]] = 0; - base->flexioBase->SHIFTCTL[base->shifterIndex[1]] = 0; - base->flexioBase->TIMCFG[base->timerIndex[0]] = 0; - base->flexioBase->TIMCMP[base->timerIndex[0]] = 0; - base->flexioBase->TIMCTL[base->timerIndex[0]] = 0; - base->flexioBase->TIMCFG[base->timerIndex[1]] = 0; - base->flexioBase->TIMCMP[base->timerIndex[1]] = 0; - base->flexioBase->TIMCTL[base->timerIndex[1]] = 0; - base->flexioBase->TIMCFG[base->timerIndex[2]] = 0; - base->flexioBase->TIMCMP[base->timerIndex[2]] = 0; - base->flexioBase->TIMCTL[base->timerIndex[2]] = 0; - /* Clear the shifter flag. */ - base->flexioBase->SHIFTSTAT = (1UL << base->shifterIndex[0]); - base->flexioBase->SHIFTSTAT = (1UL << base->shifterIndex[1]); - /* Clear the timer flag. */ - base->flexioBase->TIMSTAT = (1UL << base->timerIndex[0]); - base->flexioBase->TIMSTAT = (1UL << base->timerIndex[1]); - base->flexioBase->TIMSTAT = (1UL << base->timerIndex[2]); -} - -/*! - * brief Gets the default configuration to configure the FlexIO module. The configuration - * can be used directly for calling the FLEXIO_I2C_MasterInit(). - * - * Example: - code - flexio_i2c_master_config_t config; - FLEXIO_I2C_MasterGetDefaultConfig(&config); - endcode - * param masterConfig Pointer to flexio_i2c_master_config_t structure. -*/ -void FLEXIO_I2C_MasterGetDefaultConfig(flexio_i2c_master_config_t *masterConfig) -{ - assert(masterConfig != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(masterConfig, 0, sizeof(*masterConfig)); - - masterConfig->enableMaster = true; - masterConfig->enableInDoze = false; - masterConfig->enableInDebug = true; - masterConfig->enableFastAccess = false; - - /* Default baud rate at 100kbps. */ - masterConfig->baudRate_Bps = 100000U; -} - -/*! - * brief Gets the FlexIO I2C master status flags. - * - * param base Pointer to FLEXIO_I2C_Type structure - * return Status flag, use status flag to AND #_flexio_i2c_master_status_flags can get the related status. - */ - -uint32_t FLEXIO_I2C_MasterGetStatusFlags(FLEXIO_I2C_Type *base) -{ - uint32_t status = 0; - - status = - ((FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0])) >> base->shifterIndex[0]); - status |= - (((FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[1])) >> (base->shifterIndex[1])) - << 1U); - status |= - (((FLEXIO_GetShifterErrorFlags(base->flexioBase) & (1UL << base->shifterIndex[1])) >> (base->shifterIndex[1])) - << 2U); - - return status; -} - -/*! - * brief Clears the FlexIO I2C master status flags. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param mask Status flag. - * The parameter can be any combination of the following values: - * arg kFLEXIO_I2C_RxFullFlag - * arg kFLEXIO_I2C_ReceiveNakFlag - */ - -void FLEXIO_I2C_MasterClearStatusFlags(FLEXIO_I2C_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_I2C_TxEmptyFlag) != 0U) - { - FLEXIO_ClearShifterStatusFlags(base->flexioBase, 1UL << base->shifterIndex[0]); - } - - if ((mask & (uint32_t)kFLEXIO_I2C_RxFullFlag) != 0U) - { - FLEXIO_ClearShifterStatusFlags(base->flexioBase, 1UL << base->shifterIndex[1]); - } - - if ((mask & (uint32_t)kFLEXIO_I2C_ReceiveNakFlag) != 0U) - { - FLEXIO_ClearShifterErrorFlags(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Enables the FlexIO i2c master interrupt requests. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param mask Interrupt source. - * Currently only one interrupt request source: - * arg kFLEXIO_I2C_TransferCompleteInterruptEnable - */ -void FLEXIO_I2C_MasterEnableInterrupts(FLEXIO_I2C_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_I2C_TxEmptyInterruptEnable) != 0U) - { - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_I2C_RxFullInterruptEnable) != 0U) - { - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Disables the FlexIO I2C master interrupt requests. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param mask Interrupt source. - */ -void FLEXIO_I2C_MasterDisableInterrupts(FLEXIO_I2C_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_I2C_TxEmptyInterruptEnable) != 0U) - { - FLEXIO_DisableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_I2C_RxFullInterruptEnable) != 0U) - { - FLEXIO_DisableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Sets the FlexIO I2C master transfer baudrate. - * - * param base Pointer to FLEXIO_I2C_Type structure - * param baudRate_Bps the baud rate value in HZ - * param srcClock_Hz source clock in HZ - */ -void FLEXIO_I2C_MasterSetBaudRate(FLEXIO_I2C_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz) -{ - uint16_t timerDiv = 0; - FLEXIO_Type *flexioBase = base->flexioBase; - - /* Set TIMCMP = (baud rate divider / 2) - 1.*/ - timerDiv = (uint16_t)((srcClock_Hz / baudRate_Bps) / 2U - 1U); - - flexioBase->TIMCMP[base->timerIndex[1]] = timerDiv; - - /* Calculate and assign the actual baudrate. */ - base->baudrate = srcClock_Hz / (2U * ((uint32_t)timerDiv + 1U)); -} - -/*! - * brief Sets the number of bytes to be transferred from a start signal to a stop signal. - * - * note Call this API before a transfer begins because the timer generates a number of clocks according - * to the number of bytes that need to be transferred. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param count Number of bytes need to be transferred from a start signal to a re-start/stop signal - * retval kStatus_Success Successfully configured the count. - * retval kStatus_InvalidArgument Input argument is invalid. - */ -status_t FLEXIO_I2C_MasterSetTransferCount(FLEXIO_I2C_Type *base, uint16_t count) -{ - /* Calculate whether the transfer count is larger than the max value compare register can achieve */ - if (count > ((0xFFFFUL - 1UL) / (16UL + 1UL + 1UL))) - { - return kStatus_InvalidArgument; - } - - uint32_t timerConfig = 0U; - FLEXIO_Type *flexioBase = base->flexioBase; - - flexioBase->TIMCMP[base->timerIndex[0]] = (uint32_t)count * 18U + 1U; - timerConfig = flexioBase->TIMCFG[base->timerIndex[0]]; - timerConfig &= ~FLEXIO_TIMCFG_TIMDIS_MASK; - timerConfig |= FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTimerCompare); - flexioBase->TIMCFG[base->timerIndex[0]] = timerConfig; - - return kStatus_Success; -} - -/*! - * brief Sends START + 7-bit address to the bus. - * - * note This API should be called when the transfer configuration is ready to send a START signal - * and 7-bit address to the bus. This is a non-blocking API, which returns directly after the address - * is put into the data register but the address transfer is not finished on the bus. Ensure that - * the kFLEXIO_I2C_RxFullFlag status is asserted before calling this API. - * param base Pointer to FLEXIO_I2C_Type structure. - * param address 7-bit address. - * param direction transfer direction. - * This parameter is one of the values in flexio_i2c_direction_t: - * arg kFLEXIO_I2C_Write: Transmit - * arg kFLEXIO_I2C_Read: Receive - */ - -void FLEXIO_I2C_MasterStart(FLEXIO_I2C_Type *base, uint8_t address, flexio_i2c_direction_t direction) -{ - uint32_t data; - - data = ((uint32_t)address) << 1U | ((direction == kFLEXIO_I2C_Read) ? 1U : 0U); - - FLEXIO_I2C_MasterWriteByte(base, data); -} - -/*! - * brief Sends the repeated start signal on the bus. - * - * param base Pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterRepeatedStart(FLEXIO_I2C_Type *base) -{ - /* Prepare for RESTART condition, no stop.*/ - FLEXIO_I2C_MasterWriteByte(base, 0xFFFFFFFFU); -} - -/*! - * brief Sends the stop signal on the bus. - * - * param base Pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterStop(FLEXIO_I2C_Type *base) -{ - /* Prepare normal stop. */ - (void)FLEXIO_I2C_MasterSetTransferCount(base, 0x0U); - FLEXIO_I2C_MasterWriteByte(base, 0x0U); -} - -/*! - * brief Sends the stop signal when transfer is still on-going. - * - * param base Pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterAbortStop(FLEXIO_I2C_Type *base) -{ - uint32_t tmpConfig; - - /* Prepare abort stop. */ - /* Disable timer 0. */ - tmpConfig = base->flexioBase->TIMCFG[base->timerIndex[0]]; - tmpConfig &= ~FLEXIO_TIMCFG_TIMDIS_MASK; - tmpConfig |= FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnPinBothEdge); - base->flexioBase->TIMCFG[base->timerIndex[0]] = tmpConfig; - - /* Disable timer 1. */ - tmpConfig = base->flexioBase->TIMCFG[base->timerIndex[1]]; - tmpConfig &= ~FLEXIO_TIMCFG_TIMDIS_MASK; - tmpConfig |= FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnPinBothEdge); - base->flexioBase->TIMCFG[base->timerIndex[1]] = tmpConfig; -} - -/*! - * brief Configures the sent ACK/NAK for the following byte. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param enable True to configure send ACK, false configure to send NAK. - */ -void FLEXIO_I2C_MasterEnableAck(FLEXIO_I2C_Type *base, bool enable) -{ - uint32_t tmpConfig = 0; - - tmpConfig = base->flexioBase->SHIFTCFG[base->shifterIndex[0]]; - tmpConfig &= ~FLEXIO_SHIFTCFG_SSTOP_MASK; - if (enable) - { - tmpConfig |= FLEXIO_SHIFTCFG_SSTOP(kFLEXIO_ShifterStopBitLow); - } - else - { - tmpConfig |= FLEXIO_SHIFTCFG_SSTOP(kFLEXIO_ShifterStopBitHigh); - } - base->flexioBase->SHIFTCFG[base->shifterIndex[0]] = tmpConfig; -} - -/*! - * brief Sends a buffer of data in bytes. - * - * note This function blocks via polling until all bytes have been sent. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param txBuff The data bytes to send. - * param txSize The number of data bytes to send. - * retval kStatus_Success Successfully write data. - * retval kStatus_FLEXIO_I2C_Nak Receive NAK during writing data. - * retval kStatus_FLEXIO_I2C_Timeout Timeout polling status flags. - */ -status_t FLEXIO_I2C_MasterWriteBlocking(FLEXIO_I2C_Type *base, const uint8_t *txBuff, uint8_t txSize) -{ - assert(txBuff != NULL); - assert(txSize != 0U); - - uint32_t status; -#if I2C_RETRY_TIMES - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - - while (0U != txSize--) - { - FLEXIO_I2C_MasterWriteByte(base, *txBuff++); - - /* Wait until data transfer complete. */ -#if I2C_RETRY_TIMES - waitTimes = I2C_RETRY_TIMES; - while ((0U == ((status = FLEXIO_I2C_MasterGetStatusFlags(base)) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return kStatus_FLEXIO_I2C_Timeout; - } -#else - while (0U == ((status = FLEXIO_I2C_MasterGetStatusFlags(base)) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) - { - } -#endif - - if ((status & (uint32_t)kFLEXIO_I2C_ReceiveNakFlag) != 0U) - { - FLEXIO_ClearShifterErrorFlags(base->flexioBase, 1UL << base->shifterIndex[1]); - return kStatus_FLEXIO_I2C_Nak; - } - } - return kStatus_Success; -} - -/*! - * brief Receives a buffer of bytes. - * - * note This function blocks via polling until all bytes have been received. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param rxBuff The buffer to store the received bytes. - * param rxSize The number of data bytes to be received. - * retval kStatus_Success Successfully read data. - * retval kStatus_FLEXIO_I2C_Timeout Timeout polling status flags. - */ -status_t FLEXIO_I2C_MasterReadBlocking(FLEXIO_I2C_Type *base, uint8_t *rxBuff, uint8_t rxSize) -{ - assert(rxBuff != NULL); - assert(rxSize != 0U); - -#if I2C_RETRY_TIMES - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - - while (0U != rxSize--) - { - /* Wait until data transfer complete. */ -#if I2C_RETRY_TIMES - waitTimes = I2C_RETRY_TIMES; - while ((0U == (FLEXIO_I2C_MasterGetStatusFlags(base) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return kStatus_FLEXIO_I2C_Timeout; - } -#else - while (0U == (FLEXIO_I2C_MasterGetStatusFlags(base) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) - { - } -#endif - *rxBuff++ = FLEXIO_I2C_MasterReadByte(base); - } - return kStatus_Success; -} - -/*! - * brief Performs a master polling transfer on the I2C bus. - * - * note The API does not return until the transfer succeeds or fails due - * to receiving NAK. - * - * param base pointer to FLEXIO_I2C_Type structure. - * param xfer pointer to flexio_i2c_master_transfer_t structure. - * return status of status_t. - */ -status_t FLEXIO_I2C_MasterTransferBlocking(FLEXIO_I2C_Type *base, flexio_i2c_master_transfer_t *xfer) -{ - assert(xfer != NULL); - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_STATUS) && FSL_FEATURE_FLEXIO_HAS_PIN_STATUS - /* Return an error if the bus is already in use not by us.*/ - status_t status = FLEXIO_I2C_CheckForBusyBus(base); - if (status != kStatus_Success) - { - return status; - } -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_STATUS*/ - - flexio_i2c_master_handle_t tmpHandle; - uint32_t statusFlags; - status_t result = kStatus_Success; -#if I2C_RETRY_TIMES - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - - /* Zero the handle. */ - (void)memset(&tmpHandle, 0, sizeof(tmpHandle)); - - /* Set up transfer machine. */ - result = FLEXIO_I2C_MasterTransferInitStateMachine(base, &tmpHandle, xfer); - if (result != kStatus_Success) - { - return result; - } - - do - { - /* Wait either tx empty or rx full flag is asserted. */ -#if I2C_RETRY_TIMES - waitTimes = I2C_RETRY_TIMES; - while ((0U == ((statusFlags = FLEXIO_I2C_MasterGetStatusFlags(base)) & - ((uint32_t)kFLEXIO_I2C_TxEmptyFlag | (uint32_t)kFLEXIO_I2C_RxFullFlag))) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return kStatus_FLEXIO_I2C_Timeout; - } -#else - while (0U == ((statusFlags = FLEXIO_I2C_MasterGetStatusFlags(base)) & - ((uint32_t)kFLEXIO_I2C_TxEmptyFlag | (uint32_t)kFLEXIO_I2C_RxFullFlag))) - { - } -#endif - FLEXIO_ClearTimerStatusFlags(base->flexioBase, ((1UL << base->timerIndex[0]) | (1UL << base->timerIndex[1]))); - result = FLEXIO_I2C_MasterTransferRunStateMachine(base, &tmpHandle, statusFlags); - - } while ((tmpHandle.state != (uint8_t)kFLEXIO_I2C_Idle) && (result == kStatus_Success)); - - /* Timer disable on timer compare, wait until bit clock TSF set, which means timer disable and stop has been sent. - */ - while (0U == (FLEXIO_GetTimerStatusFlags(base->flexioBase) & (1UL << base->timerIndex[1]))) - { - } - - return result; -} - -/*! - * brief Initializes the I2C handle which is used in transactional functions. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param handle Pointer to flexio_i2c_master_handle_t structure to store the transfer state. - * param callback Pointer to user callback function. - * param userData User param passed to the callback function. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO type/handle/isr table out of range. - */ -status_t FLEXIO_I2C_MasterTransferCreateHandle(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - flexio_i2c_master_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - IRQn_Type flexio_irqs[] = FLEXIO_IRQS; - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Register callback and userData. */ - handle->completionCallback = callback; - handle->userData = userData; - - /* Clear pending NVIC IRQ before enable NVIC IRQ. */ - NVIC_ClearPendingIRQ(flexio_irqs[FLEXIO_I2C_GetInstance(base)]); - (void)EnableIRQ(flexio_irqs[FLEXIO_I2C_GetInstance(base)]); - - /* Save the context in global variables to support the double weak mechanism. */ - return FLEXIO_RegisterHandleIRQ(base, handle, FLEXIO_I2C_MasterTransferHandleIRQ); -} - -/*! - * brief Performs a master interrupt non-blocking transfer on the I2C bus. - * - * note The API returns immediately after the transfer initiates. - * Call FLEXIO_I2C_MasterTransferGetCount to poll the transfer status to check whether - * the transfer is finished. If the return status is not kStatus_FLEXIO_I2C_Busy, the transfer - * is finished. - * - * param base Pointer to FLEXIO_I2C_Type structure - * param handle Pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * param xfer pointer to flexio_i2c_master_transfer_t structure - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_FLEXIO_I2C_Busy FlexIO I2C is not idle, is running another transfer. - */ -status_t FLEXIO_I2C_MasterTransferNonBlocking(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - flexio_i2c_master_transfer_t *xfer) -{ - assert(handle != NULL); - assert(xfer != NULL); - - status_t result = kStatus_Success; - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_STATUS) && FSL_FEATURE_FLEXIO_HAS_PIN_STATUS - /* Return an error if the bus is already in use not by us.*/ - result = FLEXIO_I2C_CheckForBusyBus(base); - if (result != kStatus_Success) - { - return result; - } -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_STATUS*/ - - if (handle->state != (uint8_t)kFLEXIO_I2C_Idle) - { - return kStatus_FLEXIO_I2C_Busy; - } - else - { - /* Set up transfer machine. */ - result = FLEXIO_I2C_MasterTransferInitStateMachine(base, handle, xfer); - if (result != kStatus_Success) - { - return result; - } - - /* Enable both tx empty and rxfull interrupt. */ - FLEXIO_I2C_MasterEnableInterrupts( - base, (uint32_t)kFLEXIO_I2C_TxEmptyInterruptEnable | (uint32_t)kFLEXIO_I2C_RxFullInterruptEnable); - - return kStatus_Success; - } -} - -/*! - * brief Aborts an interrupt non-blocking transfer early. - * - * note This API can be called at any time when an interrupt non-blocking transfer initiates - * to abort the transfer early. - * - * param base Pointer to FLEXIO_I2C_Type structure - * param handle Pointer to flexio_i2c_master_handle_t structure which stores the transfer state - */ -void FLEXIO_I2C_MasterTransferAbort(FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable interrupts. */ - FLEXIO_I2C_MasterDisableInterrupts( - base, (uint32_t)kFLEXIO_I2C_TxEmptyInterruptEnable | (uint32_t)kFLEXIO_I2C_RxFullInterruptEnable); - - /* Reset to idle state. */ - handle->state = (uint8_t)kFLEXIO_I2C_Idle; -} - -/*! - * brief Gets the master transfer status during a interrupt non-blocking transfer. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param handle Pointer to flexio_i2c_master_handle_t structure which stores the transfer state. - * param count Number of bytes transferred so far by the non-blocking transaction. - * retval kStatus_InvalidArgument count is Invalid. - * retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - * retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_I2C_MasterTransferGetCount(FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle, size_t *count) -{ - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (handle->state == (uint8_t)kFLEXIO_I2C_Idle) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - *count = handle->transferSize - handle->transfer.dataSize; - - return kStatus_Success; -} - -/*! - * brief Master interrupt handler. - * - * param i2cType Pointer to FLEXIO_I2C_Type structure - * param i2cHandle Pointer to flexio_i2c_master_transfer_t structure - */ -void FLEXIO_I2C_MasterTransferHandleIRQ(void *i2cType, void *i2cHandle) -{ - FLEXIO_I2C_Type *base = (FLEXIO_I2C_Type *)i2cType; - flexio_i2c_master_handle_t *handle = (flexio_i2c_master_handle_t *)i2cHandle; - uint32_t statusFlags; - status_t result; - - statusFlags = FLEXIO_I2C_MasterGetStatusFlags(base); - - result = FLEXIO_I2C_MasterTransferRunStateMachine(base, handle, statusFlags); - - if (handle->state == (uint8_t)kFLEXIO_I2C_Idle) - { - FLEXIO_I2C_MasterTransferComplete(base, handle, result); - } -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_i2c_master.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_i2c_master.h deleted file mode 100644 index 02dd10a48b6..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_i2c_master.h +++ /dev/null @@ -1,485 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_FLEXIO_I2C_MASTER_H_ -#define FSL_FLEXIO_I2C_MASTER_H_ - -#include "fsl_common.h" -#include "fsl_flexio.h" - -/*! - * @addtogroup flexio_i2c_master - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -#define FSL_FLEXIO_I2C_MASTER_DRIVER_VERSION (MAKE_VERSION(2, 5, 0)) -/*@}*/ - -/*! @brief Retry times for waiting flag. */ -#ifndef I2C_RETRY_TIMES -#define I2C_RETRY_TIMES 0U /* Define to zero means keep waiting until the flag is assert/deassert. */ -#endif - -/*! @brief FlexIO I2C transfer status*/ -enum -{ - kStatus_FLEXIO_I2C_Busy = MAKE_STATUS(kStatusGroup_FLEXIO_I2C, 0), /*!< I2C is busy doing transfer. */ - kStatus_FLEXIO_I2C_Idle = MAKE_STATUS(kStatusGroup_FLEXIO_I2C, 1), /*!< I2C is busy doing transfer. */ - kStatus_FLEXIO_I2C_Nak = MAKE_STATUS(kStatusGroup_FLEXIO_I2C, 2), /*!< NAK received during transfer. */ - kStatus_FLEXIO_I2C_Timeout = MAKE_STATUS(kStatusGroup_FLEXIO_I2C, 3), /*!< Timeout polling status flags. */ -}; - -/*! @brief Define FlexIO I2C master interrupt mask. */ -enum _flexio_i2c_master_interrupt -{ - kFLEXIO_I2C_TxEmptyInterruptEnable = 0x1U, /*!< Tx buffer empty interrupt enable. */ - kFLEXIO_I2C_RxFullInterruptEnable = 0x2U, /*!< Rx buffer full interrupt enable. */ -}; - -/*! @brief Define FlexIO I2C master status mask. */ -enum _flexio_i2c_master_status_flags -{ - kFLEXIO_I2C_TxEmptyFlag = 0x1U, /*!< Tx shifter empty flag. */ - kFLEXIO_I2C_RxFullFlag = 0x2U, /*!< Rx shifter full/Transfer complete flag. */ - kFLEXIO_I2C_ReceiveNakFlag = 0x4U, /*!< Receive NAK flag. */ -}; - -/*! @brief Direction of master transfer.*/ -typedef enum _flexio_i2c_direction -{ - kFLEXIO_I2C_Write = 0x0U, /*!< Master send to slave. */ - kFLEXIO_I2C_Read = 0x1U, /*!< Master receive from slave. */ -} flexio_i2c_direction_t; - -/*! @brief Define FlexIO I2C master access structure typedef. */ -typedef struct _flexio_i2c_type -{ - FLEXIO_Type *flexioBase; /*!< FlexIO base pointer. */ - uint8_t SDAPinIndex; /*!< Pin select for I2C SDA. */ - uint8_t SCLPinIndex; /*!< Pin select for I2C SCL. */ - uint8_t shifterIndex[2]; /*!< Shifter index used in FlexIO I2C. */ - uint8_t timerIndex[3]; /*!< Timer index used in FlexIO I2C. */ - uint32_t baudrate; /*!< Master transfer baudrate, used to calculate delay time. */ -} FLEXIO_I2C_Type; - -/*! @brief Define FlexIO I2C master user configuration structure. */ -typedef struct _flexio_i2c_master_config -{ - bool enableMaster; /*!< Enables the FlexIO I2C peripheral at initialization time. */ - bool enableInDoze; /*!< Enable/disable FlexIO operation in doze mode. */ - bool enableInDebug; /*!< Enable/disable FlexIO operation in debug mode. */ - bool enableFastAccess; /*!< Enable/disable fast access to FlexIO registers, fast access requires - the FlexIO clock to be at least twice the frequency of the bus clock. */ - uint32_t baudRate_Bps; /*!< Baud rate in Bps. */ -} flexio_i2c_master_config_t; - -/*! @brief Define FlexIO I2C master transfer structure. */ -typedef struct _flexio_i2c_master_transfer -{ - uint32_t flags; /*!< Transfer flag which controls the transfer, reserved for FlexIO I2C. */ - uint8_t slaveAddress; /*!< 7-bit slave address. */ - flexio_i2c_direction_t direction; /*!< Transfer direction, read or write. */ - uint32_t subaddress; /*!< Sub address. Transferred MSB first. */ - uint8_t subaddressSize; /*!< Size of command buffer. */ - uint8_t volatile *data; /*!< Transfer buffer. */ - volatile size_t dataSize; /*!< Transfer size. */ -} flexio_i2c_master_transfer_t; - -/*! @brief FlexIO I2C master handle typedef. */ -typedef struct _flexio_i2c_master_handle flexio_i2c_master_handle_t; - -/*! @brief FlexIO I2C master transfer callback typedef. */ -typedef void (*flexio_i2c_master_transfer_callback_t)(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - status_t status, - void *userData); - -/*! @brief Define FlexIO I2C master handle structure. */ -struct _flexio_i2c_master_handle -{ - flexio_i2c_master_transfer_t transfer; /*!< FlexIO I2C master transfer copy. */ - size_t transferSize; /*!< Total bytes to be transferred. */ - uint8_t state; /*!< Transfer state maintained during transfer. */ - flexio_i2c_master_transfer_callback_t completionCallback; /*!< Callback function called at transfer event. */ - /*!< Callback function called at transfer event. */ - void *userData; /*!< Callback parameter passed to callback function. */ - bool needRestart; /*!< Whether master needs to send re-start signal. */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus*/ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_STATUS) && FSL_FEATURE_FLEXIO_HAS_PIN_STATUS -/*! - * @brief Make sure the bus isn't already pulled down. - * - * Check the FLEXIO pin status to see whether either of SDA and SCL pin is pulled down. - * - * @param base Pointer to FLEXIO_I2C_Type structure.. - * @retval kStatus_Success - * @retval kStatus_FLEXIO_I2C_Busy - */ -status_t FLEXIO_I2C_CheckForBusyBus(FLEXIO_I2C_Type *base); -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_STATUS*/ - -/*! - * @brief Ungates the FlexIO clock, resets the FlexIO module, and configures the FlexIO I2C - * hardware configuration. - * - * Example - @code - FLEXIO_I2C_Type base = { - .flexioBase = FLEXIO, - .SDAPinIndex = 0, - .SCLPinIndex = 1, - .shifterIndex = {0,1}, - .timerIndex = {0,1} - }; - flexio_i2c_master_config_t config = { - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .baudRate_Bps = 100000 - }; - FLEXIO_I2C_MasterInit(base, &config, srcClock_Hz); - @endcode - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param masterConfig Pointer to flexio_i2c_master_config_t structure. - * @param srcClock_Hz FlexIO source clock in Hz. - * @retval kStatus_Success Initialization successful - * @retval kStatus_InvalidArgument The source clock exceed upper range limitation -*/ -status_t FLEXIO_I2C_MasterInit(FLEXIO_I2C_Type *base, flexio_i2c_master_config_t *masterConfig, uint32_t srcClock_Hz); - -/*! - * @brief De-initializes the FlexIO I2C master peripheral. Calling this API Resets the FlexIO I2C master - * shifer and timer config, module can't work unless the FLEXIO_I2C_MasterInit is called. - * - * @param base pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterDeinit(FLEXIO_I2C_Type *base); - -/*! - * @brief Gets the default configuration to configure the FlexIO module. The configuration - * can be used directly for calling the FLEXIO_I2C_MasterInit(). - * - * Example: - @code - flexio_i2c_master_config_t config; - FLEXIO_I2C_MasterGetDefaultConfig(&config); - @endcode - * @param masterConfig Pointer to flexio_i2c_master_config_t structure. -*/ -void FLEXIO_I2C_MasterGetDefaultConfig(flexio_i2c_master_config_t *masterConfig); - -/*! - * @brief Enables/disables the FlexIO module operation. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param enable Pass true to enable module, false does not have any effect. - */ -static inline void FLEXIO_I2C_MasterEnable(FLEXIO_I2C_Type *base, bool enable) -{ - if (enable) - { - base->flexioBase->CTRL |= FLEXIO_CTRL_FLEXEN_MASK; - } -} - -/* @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets the FlexIO I2C master status flags. - * - * @param base Pointer to FLEXIO_I2C_Type structure - * @return Status flag, use status flag to AND #_flexio_i2c_master_status_flags can get the related status. - */ - -uint32_t FLEXIO_I2C_MasterGetStatusFlags(FLEXIO_I2C_Type *base); - -/*! - * @brief Clears the FlexIO I2C master status flags. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param mask Status flag. - * The parameter can be any combination of the following values: - * @arg kFLEXIO_I2C_RxFullFlag - * @arg kFLEXIO_I2C_ReceiveNakFlag - */ - -void FLEXIO_I2C_MasterClearStatusFlags(FLEXIO_I2C_Type *base, uint32_t mask); - -/*@}*/ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables the FlexIO i2c master interrupt requests. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param mask Interrupt source. - * Currently only one interrupt request source: - * @arg kFLEXIO_I2C_TransferCompleteInterruptEnable - */ -void FLEXIO_I2C_MasterEnableInterrupts(FLEXIO_I2C_Type *base, uint32_t mask); - -/*! - * @brief Disables the FlexIO I2C master interrupt requests. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param mask Interrupt source. - */ -void FLEXIO_I2C_MasterDisableInterrupts(FLEXIO_I2C_Type *base, uint32_t mask); - -/*@}*/ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Sets the FlexIO I2C master transfer baudrate. - * - * @param base Pointer to FLEXIO_I2C_Type structure - * @param baudRate_Bps the baud rate value in HZ - * @param srcClock_Hz source clock in HZ - */ -void FLEXIO_I2C_MasterSetBaudRate(FLEXIO_I2C_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz); - -/*! - * @brief Sends START + 7-bit address to the bus. - * - * @note This API should be called when the transfer configuration is ready to send a START signal - * and 7-bit address to the bus. This is a non-blocking API, which returns directly after the address - * is put into the data register but the address transfer is not finished on the bus. Ensure that - * the kFLEXIO_I2C_RxFullFlag status is asserted before calling this API. - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param address 7-bit address. - * @param direction transfer direction. - * This parameter is one of the values in flexio_i2c_direction_t: - * @arg kFLEXIO_I2C_Write: Transmit - * @arg kFLEXIO_I2C_Read: Receive - */ - -void FLEXIO_I2C_MasterStart(FLEXIO_I2C_Type *base, uint8_t address, flexio_i2c_direction_t direction); - -/*! - * @brief Sends the stop signal on the bus. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterStop(FLEXIO_I2C_Type *base); - -/*! - * @brief Sends the repeated start signal on the bus. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterRepeatedStart(FLEXIO_I2C_Type *base); - -/*! - * @brief Sends the stop signal when transfer is still on-going. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterAbortStop(FLEXIO_I2C_Type *base); - -/*! - * @brief Configures the sent ACK/NAK for the following byte. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param enable True to configure send ACK, false configure to send NAK. - */ -void FLEXIO_I2C_MasterEnableAck(FLEXIO_I2C_Type *base, bool enable); - -/*! - * @brief Sets the number of bytes to be transferred from a start signal to a stop signal. - * - * @note Call this API before a transfer begins because the timer generates a number of clocks according - * to the number of bytes that need to be transferred. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param count Number of bytes need to be transferred from a start signal to a re-start/stop signal - * @retval kStatus_Success Successfully configured the count. - * @retval kStatus_InvalidArgument Input argument is invalid. - */ -status_t FLEXIO_I2C_MasterSetTransferCount(FLEXIO_I2C_Type *base, uint16_t count); - -/*! - * @brief Writes one byte of data to the I2C bus. - * - * @note This is a non-blocking API, which returns directly after the data is put into the - * data register but the data transfer is not finished on the bus. Ensure that - * the TxEmptyFlag is asserted before calling this API. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param data a byte of data. - */ -static inline void FLEXIO_I2C_MasterWriteByte(FLEXIO_I2C_Type *base, uint32_t data) -{ - base->flexioBase->SHIFTBUFBBS[base->shifterIndex[0]] = data; -} - -/*! - * @brief Reads one byte of data from the I2C bus. - * - * @note This is a non-blocking API, which returns directly after the data is read from the - * data register. Ensure that the data is ready in the register. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @return data byte read. - */ -static inline uint8_t FLEXIO_I2C_MasterReadByte(FLEXIO_I2C_Type *base) -{ - return (uint8_t)(base->flexioBase->SHIFTBUFBIS[base->shifterIndex[1]]); -} - -/*! - * @brief Sends a buffer of data in bytes. - * - * @note This function blocks via polling until all bytes have been sent. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param txBuff The data bytes to send. - * @param txSize The number of data bytes to send. - * @retval kStatus_Success Successfully write data. - * @retval kStatus_FLEXIO_I2C_Nak Receive NAK during writing data. - * @retval kStatus_FLEXIO_I2C_Timeout Timeout polling status flags. - */ -status_t FLEXIO_I2C_MasterWriteBlocking(FLEXIO_I2C_Type *base, const uint8_t *txBuff, uint8_t txSize); - -/*! - * @brief Receives a buffer of bytes. - * - * @note This function blocks via polling until all bytes have been received. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param rxBuff The buffer to store the received bytes. - * @param rxSize The number of data bytes to be received. - * @retval kStatus_Success Successfully read data. - * @retval kStatus_FLEXIO_I2C_Timeout Timeout polling status flags. - */ -status_t FLEXIO_I2C_MasterReadBlocking(FLEXIO_I2C_Type *base, uint8_t *rxBuff, uint8_t rxSize); - -/*! - * @brief Performs a master polling transfer on the I2C bus. - * - * @note The API does not return until the transfer succeeds or fails due - * to receiving NAK. - * - * @param base pointer to FLEXIO_I2C_Type structure. - * @param xfer pointer to flexio_i2c_master_transfer_t structure. - * @return status of status_t. - */ -status_t FLEXIO_I2C_MasterTransferBlocking(FLEXIO_I2C_Type *base, flexio_i2c_master_transfer_t *xfer); -/*@}*/ - -/*Transactional APIs*/ - -/*! - * @name Transactional - * @{ - */ - -/*! - * @brief Initializes the I2C handle which is used in transactional functions. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param handle Pointer to flexio_i2c_master_handle_t structure to store the transfer state. - * @param callback Pointer to user callback function. - * @param userData User param passed to the callback function. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO type/handle/isr table out of range. - */ -status_t FLEXIO_I2C_MasterTransferCreateHandle(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - flexio_i2c_master_transfer_callback_t callback, - void *userData); - -/*! - * @brief Performs a master interrupt non-blocking transfer on the I2C bus. - * - * @note The API returns immediately after the transfer initiates. - * Call FLEXIO_I2C_MasterTransferGetCount to poll the transfer status to check whether - * the transfer is finished. If the return status is not kStatus_FLEXIO_I2C_Busy, the transfer - * is finished. - * - * @param base Pointer to FLEXIO_I2C_Type structure - * @param handle Pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param xfer pointer to flexio_i2c_master_transfer_t structure - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_FLEXIO_I2C_Busy FlexIO I2C is not idle, is running another transfer. - */ -status_t FLEXIO_I2C_MasterTransferNonBlocking(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - flexio_i2c_master_transfer_t *xfer); - -/*! - * @brief Gets the master transfer status during a interrupt non-blocking transfer. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param handle Pointer to flexio_i2c_master_handle_t structure which stores the transfer state. - * @param count Number of bytes transferred so far by the non-blocking transaction. - * @retval kStatus_InvalidArgument count is Invalid. - * @retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - * @retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_I2C_MasterTransferGetCount(FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle, size_t *count); - -/*! - * @brief Aborts an interrupt non-blocking transfer early. - * - * @note This API can be called at any time when an interrupt non-blocking transfer initiates - * to abort the transfer early. - * - * @param base Pointer to FLEXIO_I2C_Type structure - * @param handle Pointer to flexio_i2c_master_handle_t structure which stores the transfer state - */ -void FLEXIO_I2C_MasterTransferAbort(FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle); - -/*! - * @brief Master interrupt handler. - * - * @param i2cType Pointer to FLEXIO_I2C_Type structure - * @param i2cHandle Pointer to flexio_i2c_master_transfer_t structure - */ -void FLEXIO_I2C_MasterTransferHandleIRQ(void *i2cType, void *i2cHandle); - -/*@}*/ - -#if defined(__cplusplus) -} -#endif /*_cplusplus*/ -/*@}*/ - -#endif /*FSL_FLEXIO_I2C_MASTER_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_mculcd.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_mculcd.c deleted file mode 100644 index e63d1a08b3b..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_mculcd.c +++ /dev/null @@ -1,1334 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio_mculcd.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio_mculcd" -#endif - -/******************************************************************************* - * Definitations - ******************************************************************************/ - -enum _mculcd_transfer_state -{ - kFLEXIO_MCULCD_StateIdle, /*!< No transfer in progress. */ - kFLEXIO_MCULCD_StateReadArray, /*!< Reading array in progress. */ - kFLEXIO_MCULCD_StateWriteArray, /*!< Writing array in progress. */ - kFLEXIO_MCULCD_StateWriteSameValue, /*!< Writing the same value in progress. */ -}; - -/* The TIMCFG[0:7] is used for baud rate divider in dual 8-bit counters baud/bit mode. */ -#define FLEXIO_BAUDRATE_DIV_MASK 0xFFU - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ -/*! - * brief Ungates the FlexIO clock, resets the FlexIO module, configures the - * FlexIO MCULCD hardware, and configures the FlexIO MCULCD with FlexIO MCULCD - * configuration. - * The configuration structure can be filled by the user, or be set with default - * values - * by the ref FLEXIO_MCULCD_GetDefaultConfig. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param config Pointer to the flexio_mculcd_config_t structure. - * param srcClock_Hz FlexIO source clock in Hz. - * retval kStatus_Success Initialization success. - * retval kStatus_InvalidArgument Initialization failed because of invalid - * argument. - */ -status_t FLEXIO_MCULCD_Init(FLEXIO_MCULCD_Type *base, flexio_mculcd_config_t *config, uint32_t srcClock_Hz) -{ - assert(NULL != config); - status_t status; - - flexio_config_t flexioConfig = {config->enable, config->enableInDoze, config->enableInDebug, - config->enableFastAccess}; - - FLEXIO_Init(base->flexioBase, &flexioConfig); - - status = FLEXIO_MCULCD_SetBaudRate(base, config->baudRate_Bps, srcClock_Hz); - - if (kStatus_Success == status) - { - base->setCSPin(true); - base->setRSPin(true); - } - - return status; -} - -/*! - * brief Resets the FLEXIO_MCULCD timer and shifter configuration. - * - * param base Pointer to the FLEXIO_MCULCD_Type. - */ -void FLEXIO_MCULCD_Deinit(FLEXIO_MCULCD_Type *base) -{ - FLEXIO_MCULCD_ClearSingleBeatWriteConfig(base); - FLEXIO_MCULCD_ClearSingleBeatReadConfig(base); -} - -/*! - * brief Gets the default configuration to configure the FlexIO MCULCD. - * - * The default configuration value is: - * code - * config->enable = true; - * config->enableInDoze = false; - * config->enableInDebug = true; - * config->enableFastAccess = true; - * config->baudRate_Bps = 96000000U; - * endcode - * param Config Pointer to the flexio_mculcd_config_t structure. - */ -void FLEXIO_MCULCD_GetDefaultConfig(flexio_mculcd_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->enable = true; - config->enableInDoze = false; - config->enableInDebug = true; - config->enableFastAccess = true; - config->baudRate_Bps = 96000000U; -} - -/*! - * brief Set desired baud rate. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param baudRate_Bps Desired baud rate in bit-per-second for all data lines combined. - * param srcClock_Hz FLEXIO clock frequency in Hz. - * retval kStatus_Success Set successfully. - * retval kStatus_InvalidArgument Could not set the baud rate. - */ -status_t FLEXIO_MCULCD_SetBaudRate(FLEXIO_MCULCD_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz) -{ - uint32_t baudRateDiv; - uint32_t baudRatePerDataLine; - uint32_t timerCompare; - status_t status; - - baudRatePerDataLine = baudRate_Bps / (uint32_t)FLEXIO_MCULCD_DATA_BUS_WIDTH; - - baudRateDiv = (srcClock_Hz + baudRatePerDataLine) / (baudRatePerDataLine * 2U); - - if ((0U == baudRateDiv) || (baudRateDiv > (FLEXIO_BAUDRATE_DIV_MASK + 1U))) - { - status = kStatus_InvalidArgument; - } - else - { - baudRateDiv--; - - timerCompare = base->flexioBase->TIMCMP[base->timerIndex]; - - timerCompare = (timerCompare & ~FLEXIO_BAUDRATE_DIV_MASK) | baudRateDiv; - - base->flexioBase->TIMCMP[base->timerIndex] = timerCompare; - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Gets FlexIO MCULCD status flags. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * return status flag; OR'ed value or the ref _flexio_mculcd_status_flags. - * - * note Don't use this function with DMA APIs. - */ -uint32_t FLEXIO_MCULCD_GetStatusFlags(FLEXIO_MCULCD_Type *base) -{ - uint32_t ret = 0U; - uint32_t flags; - - /* Get shifter status. */ - flags = FLEXIO_GetShifterStatusFlags(base->flexioBase); - - if (0U != (flags & (1UL << base->rxShifterEndIndex))) - { - ret |= (uint32_t)kFLEXIO_MCULCD_RxFullFlag; - } - - if (0U != (flags & (1UL << base->txShifterStartIndex))) - { - ret |= (uint32_t)kFLEXIO_MCULCD_TxEmptyFlag; - } - - return ret; -} - -/*! - * brief Clears FlexIO MCULCD status flags. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param mask Status to clear, it is the OR'ed value of ref - * _flexio_mculcd_status_flags. - * - * note Don't use this function with DMA APIs. - */ -void FLEXIO_MCULCD_ClearStatusFlags(FLEXIO_MCULCD_Type *base, uint32_t mask) -{ - uint32_t flags = 0U; - - /* Clear the shifter flags. */ - if (0U != (mask & (uint32_t)kFLEXIO_MCULCD_RxFullFlag)) - { - flags |= (1UL << base->rxShifterEndIndex); - } - - if (0U != (mask & (uint32_t)kFLEXIO_MCULCD_TxEmptyFlag)) - { - flags |= (1UL << base->txShifterStartIndex); - } - - FLEXIO_ClearShifterStatusFlags(base->flexioBase, flags); -} - -/*! - * brief Enables the FlexIO MCULCD interrupt. - * - * This function enables the FlexIO MCULCD interrupt. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param mask Interrupts to enable, it is the OR'ed value of ref - * _flexio_mculcd_interrupt_enable. - */ -void FLEXIO_MCULCD_EnableInterrupts(FLEXIO_MCULCD_Type *base, uint32_t mask) -{ - uint32_t interrupts = 0U; - - /* Enable shifter interrupts. */ - if (0U != (mask & (uint32_t)kFLEXIO_MCULCD_RxFullFlag)) - { - interrupts |= (1UL << base->rxShifterEndIndex); - } - - if (0U != (mask & (uint32_t)kFLEXIO_MCULCD_TxEmptyFlag)) - { - interrupts |= (1UL << base->txShifterStartIndex); - } - - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, interrupts); -} - -/*! - * brief Disables the FlexIO MCULCD interrupt. - * - * This function disables the FlexIO MCULCD interrupt. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param mask Interrupts to disable, it is the OR'ed value of ref - * _flexio_mculcd_interrupt_enable. - */ -void FLEXIO_MCULCD_DisableInterrupts(FLEXIO_MCULCD_Type *base, uint32_t mask) -{ - uint32_t interrupts = 0U; - - /* Disable shifter interrupts. */ - if (0U != (mask & (uint32_t)kFLEXIO_MCULCD_RxFullFlag)) - { - interrupts |= (1UL << base->rxShifterEndIndex); - } - - if (0U != (mask & (uint32_t)kFLEXIO_MCULCD_TxEmptyFlag)) - { - interrupts |= (1UL << base->txShifterStartIndex); - } - - FLEXIO_DisableShifterStatusInterrupts(base->flexioBase, interrupts); -} - -/*! - * brief Read data from the FLEXIO MCULCD RX shifter buffer. - * - * Read data from the RX shift buffer directly, it does no check whether the - * buffer is empty or not. - * - * If the data bus width is 8-bit: - * code - * uint8_t value; - * value = (uint8_t)FLEXIO_MCULCD_ReadData(base); - * endcode - * - * If the data bus width is 16-bit: - * code - * uint16_t value; - * value = (uint16_t)FLEXIO_MCULCD_ReadData(base); - * endcode - * - * note This function returns the RX shifter buffer value (32-bit) directly. - * The return value should be converted according to data bus width. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * return The data read out. - * - * note Don't use this function with DMA APIs. - */ -uint32_t FLEXIO_MCULCD_ReadData(FLEXIO_MCULCD_Type *base) -{ -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - return base->flexioBase->SHIFTBUFBYS[base->rxShifterEndIndex]; -#else - return base->flexioBase->SHIFTBUFHWS[base->rxShifterEndIndex]; -#endif -} - -/*! - * brief Configures the FLEXIO MCULCD to single beats write mode. - * - * At the begining multiple beats write operation, the FLEXIO MCULCD is configured to - * multiple beats write mode using this function. After write operation, the configuration - * is cleared by ref FLEXIO_MCULCD_ClearSingleBeatWriteConfig. - * - * param base Pointer to the FLEXIO_MCULCD_Type. - * - * note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_SetSingleBeatWriteConfig(FLEXIO_MCULCD_Type *base) -{ - /* - * This function will be called at the beginning of every data writing. For - * performance consideration, it access the FlexIO registers directly, but not - * call FlexIO driver APIs. - */ - - uint32_t timerCompare; - uint32_t timerControl; - - /* Enable the TX Shifter output. */ - base->flexioBase->SHIFTCFG[base->txShifterStartIndex] = - FLEXIO_SHIFTCFG_PWIDTH((uint32_t)FLEXIO_MCULCD_DATA_BUS_WIDTH - 1U) | - FLEXIO_SHIFTCFG_INSRC(kFLEXIO_ShifterInputFromNextShifterOutput); - - base->flexioBase->SHIFTCTL[base->txShifterStartIndex] = - FLEXIO_SHIFTCTL_TIMSEL(base->timerIndex) | FLEXIO_SHIFTCTL_TIMPOL(kFLEXIO_ShifterTimerPolarityOnPositive) | - FLEXIO_SHIFTCTL_PINCFG(kFLEXIO_PinConfigOutput) | FLEXIO_SHIFTCTL_PINSEL(base->dataPinStartIndex) | - FLEXIO_SHIFTCTL_PINPOL(kFLEXIO_PinActiveHigh) | FLEXIO_SHIFTCTL_SMOD(kFLEXIO_ShifterModeTransmit); - - timerCompare = base->flexioBase->TIMCMP[base->timerIndex] & 0xFFU; - - /* - * TIMCMP[15:8] = (number of beats x 2) - 1. Because the number of beat is 1, - * so the TIMCMP[15:8] is 1. - */ - base->flexioBase->TIMCMP[base->timerIndex] = (1UL << 8U) | timerCompare; - - /* Use TX shifter flag as the inverted timer trigger. Timer output to WR/EN pin. */ - base->flexioBase->TIMCFG[base->timerIndex] = - FLEXIO_TIMCFG_TIMOUT(kFLEXIO_TimerOutputOneNotAffectedByReset) | - FLEXIO_TIMCFG_TIMDEC(kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput) | - FLEXIO_TIMCFG_TIMRST(kFLEXIO_TimerResetNever) | FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTimerCompare) | - FLEXIO_TIMCFG_TIMENA(kFLEXIO_TimerEnableOnTriggerHigh) | FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitDisabled) | - FLEXIO_TIMCFG_TSTART(kFLEXIO_TimerStartBitDisabled); - - /* When initially configure the timer pin as output, the pin may be driven low causing glitch on bus. - Configure the pin as bidirection output first then perform a subsequent write to change to output to avoid the - issue. */ - timerControl = FLEXIO_TIMCTL_TRGSEL(FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->txShifterStartIndex)) | - FLEXIO_TIMCTL_TRGPOL(kFLEXIO_TimerTriggerPolarityActiveLow) | - FLEXIO_TIMCTL_TRGSRC(kFLEXIO_TimerTriggerSourceInternal) | - FLEXIO_TIMCTL_PINCFG(kFLEXIO_PinConfigBidirectionOutputData) | - FLEXIO_TIMCTL_PINSEL(base->ENWRPinIndex) | FLEXIO_TIMCTL_PINPOL(kFLEXIO_PinActiveLow) | - FLEXIO_TIMCTL_TIMOD(kFLEXIO_TimerModeDual8BitBaudBit); - - base->flexioBase->TIMCTL[base->timerIndex] = timerControl; - timerControl = (timerControl & ~FLEXIO_TIMCTL_PINCFG_MASK) | FLEXIO_TIMCTL_PINCFG(kFLEXIO_PinConfigOutput); - base->flexioBase->TIMCTL[base->timerIndex] = timerControl; -} - -/*! - * brief Clear the FLEXIO MCULCD single beats write mode configuration. - * - * Clear the write configuration set by ref FLEXIO_MCULCD_SetSingleBeatWriteConfig. - * - * param base Pointer to the FLEXIO_MCULCD_Type. - * - * note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_ClearSingleBeatWriteConfig(FLEXIO_MCULCD_Type *base) -{ - /* Disable the timer. */ - /* Set to bidirection output first then set to disable to avoid glitch on bus. */ - base->flexioBase->TIMCTL[base->timerIndex] = - (base->flexioBase->TIMCTL[base->timerIndex] & ~FLEXIO_TIMCTL_PINCFG_MASK) | - FLEXIO_TIMCTL_PINCFG(kFLEXIO_PinConfigBidirectionOutputData); - base->flexioBase->TIMCTL[base->timerIndex] = 0U; - base->flexioBase->TIMCFG[base->timerIndex] = 0U; - /* Clear the timer flag. */ - base->flexioBase->TIMSTAT = (1UL << base->timerIndex); - /* Stop the TX shifter. */ - base->flexioBase->SHIFTCTL[base->txShifterStartIndex] = 0U; - base->flexioBase->SHIFTCFG[base->txShifterStartIndex] = 0U; - /* Clear the shifter flag. */ - base->flexioBase->SHIFTSTAT = (1UL << base->txShifterStartIndex); -} - -/*! - * brief Configures the FLEXIO MCULCD to single beats read mode. - * - * At the begining or multiple beats read operation, the FLEXIO MCULCD is configured - * to multiple beats read mode using this function. After read operation, the configuration - * is cleared by ref FLEXIO_MCULCD_ClearSingleBeatReadConfig. - * - * param base Pointer to the FLEXIO_MCULCD_Type. - * - * note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_SetSingleBeatReadConfig(FLEXIO_MCULCD_Type *base) -{ - /* - * This function will be called at the beginning of every data reading. For - * performance consideration, it access the FlexIO registers directly, but not - * call FlexIO driver APIs. - */ - - uint8_t timerPin; - uint32_t timerCompare; - flexio_pin_polarity_t timerPinPolarity; - - /* Timer output to RD pin (8080 mode), to WR/EN pin in 6800 mode. */ - if (kFLEXIO_MCULCD_8080 == base->busType) - { - timerPin = base->RDPinIndex; - timerPinPolarity = kFLEXIO_PinActiveLow; - } - else - { - timerPin = base->ENWRPinIndex; - timerPinPolarity = kFLEXIO_PinActiveHigh; - } - - /* Enable the RX Shifter input. */ - base->flexioBase->SHIFTCFG[base->rxShifterEndIndex] = - FLEXIO_SHIFTCFG_PWIDTH((uint32_t)FLEXIO_MCULCD_DATA_BUS_WIDTH - 1U); - - base->flexioBase->SHIFTCTL[base->rxShifterEndIndex] = - FLEXIO_SHIFTCTL_TIMSEL(base->timerIndex) | FLEXIO_SHIFTCTL_TIMPOL(kFLEXIO_ShifterTimerPolarityOnNegitive) | - FLEXIO_SHIFTCTL_PINCFG(kFLEXIO_PinConfigOutputDisabled) | FLEXIO_SHIFTCTL_PINSEL(base->dataPinStartIndex) | - FLEXIO_SHIFTCTL_PINPOL(kFLEXIO_PinActiveHigh) | FLEXIO_SHIFTCTL_SMOD(kFLEXIO_ShifterModeReceive); - - /* Use RX shifter flag as the inverted timer trigger. */ - base->flexioBase->TIMCFG[base->timerIndex] = - FLEXIO_TIMCFG_TIMOUT(kFLEXIO_TimerOutputOneNotAffectedByReset) | - FLEXIO_TIMCFG_TIMDEC(kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput) | - FLEXIO_TIMCFG_TIMRST(kFLEXIO_TimerResetNever) | FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTimerCompare) | - FLEXIO_TIMCFG_TIMENA(kFLEXIO_TimerEnableOnTriggerHigh) | - FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitEnableOnTimerDisable) | - FLEXIO_TIMCFG_TSTART(kFLEXIO_TimerStartBitDisabled); - - timerCompare = base->flexioBase->TIMCMP[base->timerIndex] & 0xFFU; - - /* - * TIMCMP[15:8] = (number of beats x 2) - 1. Because the number of beat is 1, - * so the TIMCMP[15:8] is 1. - */ - base->flexioBase->TIMCMP[base->timerIndex] = (1UL << 8U) | timerCompare; - - base->flexioBase->TIMCTL[base->timerIndex] |= - FLEXIO_TIMCTL_TRGSEL(FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->rxShifterEndIndex)) | - FLEXIO_TIMCTL_TRGPOL(kFLEXIO_TimerTriggerPolarityActiveLow) | - FLEXIO_TIMCTL_TRGSRC(kFLEXIO_TimerTriggerSourceInternal) | FLEXIO_TIMCTL_PINCFG(kFLEXIO_PinConfigOutput) | - FLEXIO_TIMCTL_PINSEL(timerPin) | FLEXIO_TIMCTL_PINPOL(timerPinPolarity) | - FLEXIO_TIMCTL_TIMOD(kFLEXIO_TimerModeDual8BitBaudBit); -} - -/*! - * brief Clear the FLEXIO MCULCD single beats read mode configuration. - * - * Clear the read configuration set by ref FLEXIO_MCULCD_SetSingleBeatReadConfig. - * - * param base Pointer to the FLEXIO_MCULCD_Type. - * - * note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_ClearSingleBeatReadConfig(FLEXIO_MCULCD_Type *base) -{ - /* Disable the timer. */ - /* Set to bidirection output first then set to disable to avoid glitch on bus. */ - base->flexioBase->TIMCTL[base->timerIndex] = - (base->flexioBase->TIMCTL[base->timerIndex] & ~FLEXIO_TIMCTL_PINCFG_MASK) | - FLEXIO_TIMCTL_PINCFG(kFLEXIO_PinConfigBidirectionOutputData); - base->flexioBase->TIMCTL[base->timerIndex] = 0U; - base->flexioBase->TIMCFG[base->timerIndex] = 0U; - /* Clear the timer flag. */ - base->flexioBase->TIMSTAT = (1UL << base->timerIndex); - /* Stop the RX shifter. */ - base->flexioBase->SHIFTCTL[base->rxShifterEndIndex] = 0U; - base->flexioBase->SHIFTCFG[base->rxShifterEndIndex] = 0U; - /* Clear the shifter flag. */ - base->flexioBase->SHIFTSTAT = (1UL << base->rxShifterEndIndex); -} - -/*! - * brief Configures the FLEXIO MCULCD to multiple beats write mode. - * - * At the begining multiple beats write operation, the FLEXIO MCULCD is configured to - * multiple beats write mode using this function. After write operation, the configuration - * is cleared by ref FLEXIO_MCULCD_ClearMultBeatsWriteConfig. - * - * param base Pointer to the FLEXIO_MCULCD_Type. - * - * note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_SetMultiBeatsWriteConfig(FLEXIO_MCULCD_Type *base) -{ - /* - * This function will be called at the beginning of every data writing. For - * performance consideration, it access the FlexIO registers directly, but not - * call FlexIO driver APIs. - */ - - uint32_t timerCompare; - uint32_t timerControl; - uint8_t beats; - uint8_t i; - - /* Enable the TX Shifter output. */ - base->flexioBase->SHIFTCFG[base->txShifterStartIndex] = - FLEXIO_SHIFTCFG_PWIDTH((uint32_t)FLEXIO_MCULCD_DATA_BUS_WIDTH - 1U) | - FLEXIO_SHIFTCFG_INSRC(kFLEXIO_ShifterInputFromNextShifterOutput); - - base->flexioBase->SHIFTCTL[base->txShifterStartIndex] = - FLEXIO_SHIFTCTL_TIMSEL(base->timerIndex) | FLEXIO_SHIFTCTL_TIMPOL(kFLEXIO_ShifterTimerPolarityOnPositive) | - FLEXIO_SHIFTCTL_PINCFG(kFLEXIO_PinConfigOutput) | FLEXIO_SHIFTCTL_PINSEL(base->dataPinStartIndex) | - FLEXIO_SHIFTCTL_PINPOL(kFLEXIO_PinActiveHigh) | FLEXIO_SHIFTCTL_SMOD(kFLEXIO_ShifterModeTransmit); - - for (i = base->txShifterStartIndex + 1U; i <= base->txShifterEndIndex; i++) - { - base->flexioBase->SHIFTCFG[i] = FLEXIO_SHIFTCFG_PWIDTH((uint32_t)FLEXIO_MCULCD_DATA_BUS_WIDTH - 1U) | - FLEXIO_SHIFTCFG_INSRC(kFLEXIO_ShifterInputFromNextShifterOutput); - - base->flexioBase->SHIFTCTL[i] = - FLEXIO_SHIFTCTL_TIMSEL(base->timerIndex) | FLEXIO_SHIFTCTL_TIMPOL(kFLEXIO_ShifterTimerPolarityOnPositive) | - FLEXIO_SHIFTCTL_PINCFG(kFLEXIO_PinConfigOutputDisabled) | FLEXIO_SHIFTCTL_PINSEL(0) | - FLEXIO_SHIFTCTL_PINPOL(kFLEXIO_PinActiveHigh) | FLEXIO_SHIFTCTL_SMOD(kFLEXIO_ShifterModeTransmit); - } - - timerCompare = base->flexioBase->TIMCMP[base->timerIndex] & 0xFFU; - -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - beats = 4U * (base->txShifterEndIndex - base->txShifterStartIndex + 1U); -#else - beats = 2U * (base->txShifterEndIndex - base->txShifterStartIndex + 1U); -#endif - - /* - * TIMCMP[15:8] = (number of beats x 2) - 1. - */ - base->flexioBase->TIMCMP[base->timerIndex] = ((beats * 2UL - 1UL) << 8U) | timerCompare; - - /* Use TX shifter flag as the inverted timer trigger. Timer output to WR/EN pin. */ - base->flexioBase->TIMCFG[base->timerIndex] = - FLEXIO_TIMCFG_TIMOUT(kFLEXIO_TimerOutputOneNotAffectedByReset) | - FLEXIO_TIMCFG_TIMDEC(kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput) | - FLEXIO_TIMCFG_TIMRST(kFLEXIO_TimerResetNever) | FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTimerCompare) | - FLEXIO_TIMCFG_TIMENA(kFLEXIO_TimerEnableOnTriggerHigh) | FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitDisabled) | - FLEXIO_TIMCFG_TSTART(kFLEXIO_TimerStartBitDisabled); - - /* When initially configure the timer pin as output, the pin may be driven low causing glitch on bus. - Configure the pin as bidirection output first then perform a subsequent write to change to output to avoid the - issue. */ - timerControl = FLEXIO_TIMCTL_TRGSEL(FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->txShifterEndIndex)) | - FLEXIO_TIMCTL_TRGPOL(kFLEXIO_TimerTriggerPolarityActiveLow) | - FLEXIO_TIMCTL_TRGSRC(kFLEXIO_TimerTriggerSourceInternal) | - FLEXIO_TIMCTL_PINCFG(kFLEXIO_PinConfigBidirectionOutputData) | - FLEXIO_TIMCTL_PINSEL(base->ENWRPinIndex) | FLEXIO_TIMCTL_PINPOL(kFLEXIO_PinActiveLow) | - FLEXIO_TIMCTL_TIMOD(kFLEXIO_TimerModeDual8BitBaudBit); - - base->flexioBase->TIMCTL[base->timerIndex] = timerControl; - timerControl = (timerControl & ~FLEXIO_TIMCTL_PINCFG_MASK) | FLEXIO_TIMCTL_PINCFG(kFLEXIO_PinConfigOutput); - base->flexioBase->TIMCTL[base->timerIndex] = timerControl; -} - -/*! - * brief Clear the FLEXIO MCULCD multiple beats write mode configuration. - * - * Clear the write configuration set by ref FLEXIO_MCULCD_SetMultBeatsWriteConfig. - * - * param base Pointer to the FLEXIO_MCULCD_Type. - * - * note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_ClearMultiBeatsWriteConfig(FLEXIO_MCULCD_Type *base) -{ - uint8_t i; - uint32_t statusFlags = 0U; - - /* Disable the timer. */ - /* Set to bidirection output first then set to disable to avoid glitch on bus. */ - base->flexioBase->TIMCTL[base->timerIndex] = - (base->flexioBase->TIMCTL[base->timerIndex] & ~FLEXIO_TIMCTL_PINCFG_MASK) | - FLEXIO_TIMCTL_PINCFG(kFLEXIO_PinConfigBidirectionOutputData); - base->flexioBase->TIMCTL[base->timerIndex] = 0U; - base->flexioBase->TIMCFG[base->timerIndex] = 0U; - /* Clear the timer flag. */ - base->flexioBase->TIMSTAT = (1UL << base->timerIndex); - - /* Stop the TX shifter. */ - for (i = base->txShifterStartIndex; i <= base->txShifterEndIndex; i++) - { - base->flexioBase->SHIFTCFG[i] = 0U; - base->flexioBase->SHIFTCTL[i] = 0U; - statusFlags |= (1UL << i); - } - /* Clear the shifter flag. */ - base->flexioBase->SHIFTSTAT = statusFlags; -} - -/*! - * brief Configures the FLEXIO MCULCD to multiple beats read mode. - * - * At the begining or multiple beats read operation, the FLEXIO MCULCD is configured - * to multiple beats read mode using this function. After read operation, the configuration - * is cleared by ref FLEXIO_MCULCD_ClearMultBeatsReadConfig. - * - * param base Pointer to the FLEXIO_MCULCD_Type. - * - * note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_SetMultiBeatsReadConfig(FLEXIO_MCULCD_Type *base) -{ - /* - * This function will be called at the beginning of every data reading. For - * performance consideration, it access the FlexIO registers directly, but not - * call FlexIO driver APIs. - */ - - uint8_t timerPin; - uint8_t beats; - uint8_t i; - uint32_t timerCompare; - flexio_pin_polarity_t timerPinPolarity; - - /* Timer output to RD pin (8080 mode), to WR/EN pin in 6800 mode. */ - if (kFLEXIO_MCULCD_8080 == base->busType) - { - timerPin = base->RDPinIndex; - timerPinPolarity = kFLEXIO_PinActiveLow; - } - else - { - timerPin = base->ENWRPinIndex; - timerPinPolarity = kFLEXIO_PinActiveHigh; - } - - /* Enable the RX Shifter input. */ - for (i = base->rxShifterStartIndex; i < base->rxShifterEndIndex; i++) - { - base->flexioBase->SHIFTCFG[i] = FLEXIO_SHIFTCFG_PWIDTH((uint32_t)FLEXIO_MCULCD_DATA_BUS_WIDTH - 1U) | - FLEXIO_SHIFTCFG_INSRC(kFLEXIO_ShifterInputFromNextShifterOutput); - - base->flexioBase->SHIFTCTL[i] = - FLEXIO_SHIFTCTL_TIMSEL(base->timerIndex) | FLEXIO_SHIFTCTL_TIMPOL(kFLEXIO_ShifterTimerPolarityOnNegitive) | - FLEXIO_SHIFTCTL_PINCFG(kFLEXIO_PinConfigOutputDisabled) | FLEXIO_SHIFTCTL_PINSEL(base->dataPinStartIndex) | - FLEXIO_SHIFTCTL_PINPOL(kFLEXIO_PinActiveHigh) | FLEXIO_SHIFTCTL_SMOD(kFLEXIO_ShifterModeReceive); - } - - base->flexioBase->SHIFTCFG[base->rxShifterEndIndex] = - FLEXIO_SHIFTCFG_PWIDTH((uint32_t)FLEXIO_MCULCD_DATA_BUS_WIDTH - 1U); - base->flexioBase->SHIFTCTL[base->rxShifterEndIndex] = - FLEXIO_SHIFTCTL_TIMSEL(base->timerIndex) | FLEXIO_SHIFTCTL_TIMPOL(kFLEXIO_ShifterTimerPolarityOnNegitive) | - FLEXIO_SHIFTCTL_PINCFG(kFLEXIO_PinConfigOutputDisabled) | FLEXIO_SHIFTCTL_PINSEL(base->dataPinStartIndex) | - FLEXIO_SHIFTCTL_PINPOL(kFLEXIO_PinActiveHigh) | FLEXIO_SHIFTCTL_SMOD(kFLEXIO_ShifterModeReceive); - - timerCompare = base->flexioBase->TIMCMP[base->timerIndex] & 0xFFU; - -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - beats = 4U * (base->rxShifterEndIndex - base->rxShifterStartIndex + 1U); -#else - beats = 2U * (base->rxShifterEndIndex - base->rxShifterStartIndex + 1U); -#endif - - /* - * TIMCMP[15:8] = (number of beats x 2) - 1. - */ - base->flexioBase->TIMCMP[base->timerIndex] = ((beats * 2UL - 1UL) << 8U) | timerCompare; - - /* Use RX shifter flag as the inverted timer trigger. */ - base->flexioBase->TIMCFG[base->timerIndex] = - FLEXIO_TIMCFG_TIMOUT(kFLEXIO_TimerOutputOneNotAffectedByReset) | - FLEXIO_TIMCFG_TIMDEC(kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput) | - FLEXIO_TIMCFG_TIMRST(kFLEXIO_TimerResetNever) | FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTimerCompare) | - FLEXIO_TIMCFG_TIMENA(kFLEXIO_TimerEnableOnTriggerHigh) | - FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitEnableOnTimerDisable) | - FLEXIO_TIMCFG_TSTART(kFLEXIO_TimerStartBitDisabled); - - base->flexioBase->TIMCTL[base->timerIndex] |= - FLEXIO_TIMCTL_TRGSEL(FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->rxShifterEndIndex)) | - FLEXIO_TIMCTL_TRGPOL(kFLEXIO_TimerTriggerPolarityActiveLow) | - FLEXIO_TIMCTL_TRGSRC(kFLEXIO_TimerTriggerSourceInternal) | FLEXIO_TIMCTL_PINCFG(kFLEXIO_PinConfigOutput) | - FLEXIO_TIMCTL_PINSEL(timerPin) | FLEXIO_TIMCTL_PINPOL(timerPinPolarity) | - FLEXIO_TIMCTL_TIMOD(kFLEXIO_TimerModeDual8BitBaudBit); -} - -/*! - * brief Clear the FLEXIO MCULCD multiple beats read mode configuration. - * - * Clear the read configuration set by ref FLEXIO_MCULCD_SetMultBeatsReadConfig. - * - * param base Pointer to the FLEXIO_MCULCD_Type. - * - * note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_ClearMultiBeatsReadConfig(FLEXIO_MCULCD_Type *base) -{ - uint8_t i; - uint32_t statusFlags = 0U; - - /* Disable the timer. */ - /* Set to bidirection output first then set to disable to avoid glitch on bus. */ - base->flexioBase->TIMCTL[base->timerIndex] = - (base->flexioBase->TIMCTL[base->timerIndex] & ~FLEXIO_TIMCTL_PINCFG_MASK) | - FLEXIO_TIMCTL_PINCFG(kFLEXIO_PinConfigBidirectionOutputData); - base->flexioBase->TIMCTL[base->timerIndex] = 0U; - base->flexioBase->TIMCFG[base->timerIndex] = 0U; - /* Clear the timer flag. */ - base->flexioBase->TIMSTAT = (1UL << base->timerIndex); - /* Stop the RX shifter. */ - for (i = base->rxShifterStartIndex; i <= base->rxShifterEndIndex; i++) - { - base->flexioBase->SHIFTCTL[i] = 0U; - base->flexioBase->SHIFTCFG[i] = 0U; - statusFlags |= (1UL << i); - } - /* Clear the shifter flag. */ - base->flexioBase->SHIFTSTAT = statusFlags; -} - -/*! - * brief Wait for transmit data send out finished. - * - * Currently there is no effective method to wait for the data send out - * from the shiter, so here use a while loop to wait. - * - * note This is an internal used function. - */ -void FLEXIO_MCULCD_WaitTransmitComplete(void) -{ - uint32_t i = FLEXIO_MCULCD_WAIT_COMPLETE_TIME; - - while (0U != (i--)) - { - __NOP(); - } -} - -/*! - * brief Send command in blocking way. - * - * This function sends the command and returns when the command has been sent - * out. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param command The command to send. - */ -void FLEXIO_MCULCD_WriteCommandBlocking(FLEXIO_MCULCD_Type *base, uint32_t command) -{ - FLEXIO_Type *flexioBase = base->flexioBase; - - /* De-assert the RS pin. */ - base->setRSPin(false); - - /* For 6800, de-assert the RDWR pin. */ - if (kFLEXIO_MCULCD_6800 == base->busType) - { - base->setRDWRPin(false); - } - - /* Configure the timer and TX shifter. */ - FLEXIO_MCULCD_SetSingleBeatWriteConfig(base); - - /* Write command to shifter buffer. */ - flexioBase->SHIFTBUF[base->txShifterStartIndex] = command; - - /* Wait for command send out. */ - while (0U == ((1UL << base->timerIndex) & FLEXIO_GetTimerStatusFlags(flexioBase))) - { - } - - /* Stop the timer and TX shifter. */ - FLEXIO_MCULCD_ClearSingleBeatWriteConfig(base); - - /* Assert the RS pin. */ - base->setRSPin(true); - /* For 6800, assert the RDWR pin. */ - if (kFLEXIO_MCULCD_6800 == base->busType) - { - base->setRDWRPin(true); - } -} - -/*! - * brief Send data array in blocking way. - * - * This function sends the data array and returns when the data sent out. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param data The data array to send. - * param size How many bytes to write. - */ -void FLEXIO_MCULCD_WriteDataArrayBlocking(FLEXIO_MCULCD_Type *base, const void *data, size_t size) -{ - assert(size > 0U); - - uint32_t i; -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - const uint8_t *data8Bit; -#else - const uint16_t *data16Bit; -#endif - FLEXIO_Type *flexioBase = base->flexioBase; - - /* Assert the RS pin. */ - base->setRSPin(true); - /* For 6800, de-assert the RDWR pin. */ - if (kFLEXIO_MCULCD_6800 == base->busType) - { - base->setRDWRPin(false); - } - - /* Configure the timer and TX shifter. */ - FLEXIO_MCULCD_SetSingleBeatWriteConfig(base); - -/* If data bus width is 8. */ -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - data8Bit = (const uint8_t *)data; - - for (i = 0; i < size; i++) - { - flexioBase->SHIFTBUF[base->txShifterStartIndex] = data8Bit[i]; - - /* Wait for the data send out. */ - while (0U == ((1UL << base->timerIndex) & flexioBase->TIMSTAT)) - { - } - - /* Clear the timer stat. */ - flexioBase->TIMSTAT = 1UL << base->timerIndex; - } -#else - data16Bit = (const uint16_t *)data; - size /= 2U; - - for (i = 0; i < size; i++) - { - flexioBase->SHIFTBUF[base->txShifterStartIndex] = data16Bit[i]; - - /* Wait for the data send out. */ - while (0U == ((1UL << base->timerIndex) & flexioBase->TIMSTAT)) - { - } - - /* Clear the timer stat. */ - flexioBase->TIMSTAT = 1UL << base->timerIndex; - } -#endif - - /* Stop the timer and TX shifter. */ - FLEXIO_MCULCD_ClearSingleBeatWriteConfig(base); -} - -/*! - * brief Read data into array in blocking way. - * - * This function reads the data into array and returns when the data read - * finished. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param data The array to save the data. - * param size How many bytes to read. - */ -void FLEXIO_MCULCD_ReadDataArrayBlocking(FLEXIO_MCULCD_Type *base, void *data, size_t size) -{ - assert(size > 0U); - - uint32_t i; - -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - uint8_t *data8Bit = (uint8_t *)data; -#else - uint16_t *data16Bit = (uint16_t *)data; -#endif - FLEXIO_Type *flexioBase = base->flexioBase; - - /* Assert the RS pin. */ - base->setRSPin(true); - /* For 6800, de-assert the RDWR pin. */ - if (kFLEXIO_MCULCD_6800 == base->busType) - { - base->setRDWRPin(false); - } - - /* Enable the timer and RX shifter. */ - FLEXIO_MCULCD_SetSingleBeatReadConfig(base); - -/* If data bus width is 8. */ -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - for (i = 0; i < (size - 1U); i++) - { - /* Wait for shifter buffer full. */ - while (0U == ((1UL << base->rxShifterEndIndex) & FLEXIO_GetShifterStatusFlags(flexioBase))) - { - } - - data8Bit[i] = (uint8_t)flexioBase->SHIFTBUFBYS[base->rxShifterEndIndex]; - } -#else - /* Data bus width is 16. */ - size /= 2U; - - for (i = 0; i < (size - 1U); i++) - { - /* Wait for shifter buffer full. */ - while (0U == ((1UL << base->rxShifterEndIndex) & FLEXIO_GetShifterStatusFlags(flexioBase))) - { - } - - data16Bit[i] = (uint16_t)flexioBase->SHIFTBUFHWS[base->rxShifterEndIndex]; - } -#endif - - /* Wait for shifter buffer full. */ - while (0U == ((1UL << base->rxShifterEndIndex) & FLEXIO_GetShifterStatusFlags(flexioBase))) - { - } - - /* Stop the timer and disable the RX shifter. */ - FLEXIO_MCULCD_ClearSingleBeatReadConfig(base); - -/* Read out the last data. */ -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - data8Bit[i] = (uint8_t)flexioBase->SHIFTBUFBYS[base->rxShifterEndIndex]; -#else - data16Bit[i] = (uint16_t)flexioBase->SHIFTBUFHWS[base->rxShifterEndIndex]; -#endif -} - -/*! - * brief Send the same value many times in blocking way. - * - * This function sends the same value many times. It could be used to clear the - * LCD screen. If the data bus width is 8, this function will send LSB 8 bits of - * p sameValue for p size times. If the data bus is 16, this function will send - * LSB 16 bits of p sameValue for p size / 2 times. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param sameValue The same value to send. - * param size How many bytes to send. - */ -void FLEXIO_MCULCD_WriteSameValueBlocking(FLEXIO_MCULCD_Type *base, uint32_t sameValue, size_t size) -{ - assert(size > 0U); - - uint32_t i; - FLEXIO_Type *flexioBase = base->flexioBase; - -#if (16 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - size /= 2U; -#endif - - /* Assert the RS pin. */ - base->setRSPin(true); - /* For 6800, de-assert the RDWR pin. */ - if (kFLEXIO_MCULCD_6800 == base->busType) - { - base->setRDWRPin(false); - } - - /* Configure the timer and TX shifter. */ - FLEXIO_MCULCD_SetSingleBeatWriteConfig(base); - - for (i = 0; i < size; i++) - { - flexioBase->SHIFTBUF[base->txShifterStartIndex] = sameValue; - - /* Wait for the data send out. */ - while (0U == ((1UL << base->timerIndex) & flexioBase->TIMSTAT)) - { - } - - /* Clear the timer stat. */ - flexioBase->TIMSTAT = 1UL << base->timerIndex; - } - - /* Stop the timer and TX shifter. */ - FLEXIO_MCULCD_ClearSingleBeatWriteConfig(base); -} - -/*! - * brief Performs a polling transfer. - * - * note The API does not return until the transfer finished. - * - * param base pointer to FLEXIO_MCULCD_Type structure. - * param xfer pointer to flexio_mculcd_transfer_t structure. - */ -void FLEXIO_MCULCD_TransferBlocking(FLEXIO_MCULCD_Type *base, flexio_mculcd_transfer_t *xfer) -{ - FLEXIO_MCULCD_StartTransfer(base); - - if (!xfer->dataOnly) - { - FLEXIO_MCULCD_WriteCommandBlocking(base, xfer->command); - } - - if (xfer->dataSize > 0U) - { - if (kFLEXIO_MCULCD_ReadArray == xfer->mode) - { - FLEXIO_MCULCD_ReadDataArrayBlocking(base, (uint8_t *)(xfer->dataAddrOrSameValue), xfer->dataSize); - } - else if (kFLEXIO_MCULCD_WriteArray == xfer->mode) - { - FLEXIO_MCULCD_WriteDataArrayBlocking(base, (uint8_t *)(xfer->dataAddrOrSameValue), xfer->dataSize); - } - else - { - FLEXIO_MCULCD_WriteSameValueBlocking(base, xfer->dataAddrOrSameValue, xfer->dataSize); - } - } - - FLEXIO_MCULCD_StopTransfer(base); -} - -/*! - * brief Initializes the FlexIO MCULCD handle, which is used in transactional - * functions. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param handle Pointer to the flexio_mculcd_handle_t structure to store the - * transfer state. - * param callback The callback function. - * param userData The parameter of the callback function. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_MCULCD_TransferCreateHandle(FLEXIO_MCULCD_Type *base, - flexio_mculcd_handle_t *handle, - flexio_mculcd_transfer_callback_t callback, - void *userData) -{ - assert(NULL != handle); - - IRQn_Type flexio_irqs[] = FLEXIO_IRQS; - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - handle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - - /* Register callback and userData. */ - handle->completionCallback = callback; - handle->userData = userData; - - /* Enable interrupt in NVIC. */ - (void)EnableIRQ(flexio_irqs[FLEXIO_GetInstance(base->flexioBase)]); - - /* Save the context in global variables to support the double weak mechanism. - */ - return FLEXIO_RegisterHandleIRQ(base, handle, FLEXIO_MCULCD_TransferHandleIRQ); -} - -/*! - * brief Transfer data using IRQ. - * - * This function sends data using IRQ. This is a non-blocking function, which - * returns right away. When all data is sent out/received, the callback - * function is called. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param handle Pointer to the flexio_mculcd_handle_t structure to store the - * transfer state. - * param xfer FlexIO MCULCD transfer structure. See #flexio_mculcd_transfer_t. - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_InvalidArgument Input argument is invalid. - * retval kStatus_FLEXIO_MCULCD_Busy MCULCD is busy with another transfer. - */ -status_t FLEXIO_MCULCD_TransferNonBlocking(FLEXIO_MCULCD_Type *base, - flexio_mculcd_handle_t *handle, - flexio_mculcd_transfer_t *xfer) -{ - /* If previous transfer is in progress. */ - if ((uint32_t)kFLEXIO_MCULCD_StateIdle != handle->state) - { - return kStatus_FLEXIO_MCULCD_Busy; - } - - /* Set the state in handle. */ - if (kFLEXIO_MCULCD_ReadArray == xfer->mode) - { - handle->state = (uint32_t)kFLEXIO_MCULCD_StateReadArray; - } - else if (kFLEXIO_MCULCD_WriteArray == xfer->mode) - { - handle->state = (uint32_t)kFLEXIO_MCULCD_StateWriteArray; - } - else - { - handle->state = (uint32_t)kFLEXIO_MCULCD_StateWriteSameValue; - } - - /* Assert the nCS. */ - FLEXIO_MCULCD_StartTransfer(base); - - if (!xfer->dataOnly) - { - /* Send the command. */ - FLEXIO_MCULCD_WriteCommandBlocking(base, xfer->command); - } - - /* If transfer count is 0 (only to send command), return directly. */ - if (0U == xfer->dataSize) - { - handle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - - /* De-assert the nCS. */ - FLEXIO_MCULCD_StopTransfer(base); - - if (NULL != handle->completionCallback) - { - handle->completionCallback(base, handle, kStatus_FLEXIO_MCULCD_Idle, handle->userData); - } - } - else - { -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - handle->dataCount = xfer->dataSize; -#else - handle->dataCount = xfer->dataSize / 2U; -#endif - - handle->remainingCount = handle->dataCount; - - handle->dataAddrOrSameValue = xfer->dataAddrOrSameValue; - - /* Enable interrupt. */ - if (kFLEXIO_MCULCD_ReadArray == xfer->mode) - { - /* For 6800, assert the RDWR pin. */ - if (kFLEXIO_MCULCD_6800 == base->busType) - { - base->setRDWRPin(true); - } - FLEXIO_MCULCD_SetSingleBeatReadConfig(base); - FLEXIO_MCULCD_EnableInterrupts(base, (uint32_t)kFLEXIO_MCULCD_RxFullInterruptEnable); - } - else - { - /* For 6800, de-assert the RDWR pin. */ - if (kFLEXIO_MCULCD_6800 == base->busType) - { - base->setRDWRPin(false); - } - FLEXIO_MCULCD_SetSingleBeatWriteConfig(base); - FLEXIO_MCULCD_EnableInterrupts(base, (uint32_t)kFLEXIO_MCULCD_TxEmptyInterruptEnable); - } - } - - return kStatus_Success; -} - -/*! - * brief Aborts the data transfer, which used IRQ. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param handle Pointer to the flexio_mculcd_handle_t structure to store the - * transfer state. - */ -void FLEXIO_MCULCD_TransferAbort(FLEXIO_MCULCD_Type *base, flexio_mculcd_handle_t *handle) -{ - /* If no transfer in process, return directly. */ - if ((uint32_t)kFLEXIO_MCULCD_StateIdle == handle->state) - { - return; - } - - /* Disable the interrupt. */ - FLEXIO_MCULCD_DisableInterrupts( - base, (uint32_t)kFLEXIO_MCULCD_RxFullInterruptEnable | (uint32_t)kFLEXIO_MCULCD_TxEmptyInterruptEnable); - - if ((uint32_t)kFLEXIO_MCULCD_StateReadArray == handle->state) - { - /* Stop the timer and disable the RX shifter. */ - FLEXIO_MCULCD_ClearSingleBeatReadConfig(base); - } - else - { - /* Stop the timer and disable the TX shifter. */ - FLEXIO_MCULCD_ClearSingleBeatWriteConfig(base); - } - - /* Clean the flags. */ - FLEXIO_MCULCD_ClearStatusFlags(base, (uint32_t)kFLEXIO_MCULCD_TxEmptyFlag | (uint32_t)kFLEXIO_MCULCD_RxFullFlag); - - /* De-assert the nCS. */ - FLEXIO_MCULCD_StopTransfer(base); - - handle->dataCount = 0; - handle->remainingCount = 0; - handle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; -} - -/*! - * brief Gets the data transfer status which used IRQ. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param handle Pointer to the flexio_mculcd_handle_t structure to store the - * transfer state. - * param count How many bytes transferred so far by the non-blocking transaction. - * retval kStatus_Success Get the transferred count Successfully. - * retval kStatus_NoTransferInProgress No transfer in process. - */ -status_t FLEXIO_MCULCD_TransferGetCount(FLEXIO_MCULCD_Type *base, flexio_mculcd_handle_t *handle, size_t *count) -{ - assert(NULL != count); - - if ((uint32_t)kFLEXIO_MCULCD_StateIdle == handle->state) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->dataCount - handle->remainingCount; - -#if (16 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - *count *= 2U; -#endif - - return kStatus_Success; -} - -/*! - * brief FlexIO MCULCD IRQ handler function. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param handle Pointer to the flexio_mculcd_handle_t structure to store the - * transfer state. - */ -void FLEXIO_MCULCD_TransferHandleIRQ(void *base, void *handle) -{ - FLEXIO_MCULCD_Type *flexioLcdMcuBase = (FLEXIO_MCULCD_Type *)base; - flexio_mculcd_handle_t *flexioLcdMcuHandle = (flexio_mculcd_handle_t *)handle; - uint32_t statusFlags = FLEXIO_MCULCD_GetStatusFlags(flexioLcdMcuBase); - uint32_t data; - - if ((uint32_t)kFLEXIO_MCULCD_StateReadArray == flexioLcdMcuHandle->state) - { - /* Handle the reading process. */ - while ((0U != ((uint32_t)kFLEXIO_MCULCD_RxFullFlag & statusFlags)) && (flexioLcdMcuHandle->remainingCount > 0U)) - { - if (1U == flexioLcdMcuHandle->remainingCount) - { - /* If this is the last data, stop the RX shifter and timer. */ - FLEXIO_MCULCD_DisableInterrupts(flexioLcdMcuBase, (uint32_t)kFLEXIO_MCULCD_RxFullInterruptEnable); - FLEXIO_MCULCD_ClearSingleBeatReadConfig(flexioLcdMcuBase); - FLEXIO_MCULCD_StopTransfer(flexioLcdMcuBase); - } - - /* Read out the data. */ - data = FLEXIO_MCULCD_ReadData(flexioLcdMcuBase); - -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - *(uint8_t *)(flexioLcdMcuHandle->dataAddrOrSameValue) = (uint8_t)data; - flexioLcdMcuHandle->dataAddrOrSameValue++; -#else - *(uint16_t *)(flexioLcdMcuHandle->dataAddrOrSameValue) = (uint16_t)data; - flexioLcdMcuHandle->dataAddrOrSameValue += 2U; -#endif - - flexioLcdMcuHandle->remainingCount--; - - /* Transfer finished, call the callback. */ - if (0U == flexioLcdMcuHandle->remainingCount) - { - flexioLcdMcuHandle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - - if (NULL != flexioLcdMcuHandle->completionCallback) - { - flexioLcdMcuHandle->completionCallback(flexioLcdMcuBase, flexioLcdMcuHandle, - kStatus_FLEXIO_MCULCD_Idle, flexioLcdMcuHandle->userData); - } - } - - /* Is the shifter buffer ready to send the next data? */ - statusFlags = FLEXIO_MCULCD_GetStatusFlags(flexioLcdMcuBase); - } - } - else - { - /* Handle the writing process. */ - while ((0U != ((uint32_t)kFLEXIO_MCULCD_TxEmptyFlag & statusFlags)) && - (flexioLcdMcuHandle->remainingCount > 0U)) - { - /* Send the data. */ - if ((uint32_t)kFLEXIO_MCULCD_StateWriteSameValue == flexioLcdMcuHandle->state) - { - data = flexioLcdMcuHandle->dataAddrOrSameValue; - } - else - { -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - data = *(uint8_t *)(flexioLcdMcuHandle->dataAddrOrSameValue); - flexioLcdMcuHandle->dataAddrOrSameValue++; -#else - data = *(uint16_t *)(flexioLcdMcuHandle->dataAddrOrSameValue); - flexioLcdMcuHandle->dataAddrOrSameValue += 2U; -#endif - } - - /* If this is the last data to send, delay to wait for the data shift out. */ - if (1U == flexioLcdMcuHandle->remainingCount) - { - FLEXIO_MCULCD_DisableInterrupts(flexioLcdMcuBase, (uint32_t)kFLEXIO_MCULCD_TxEmptyInterruptEnable); - - /* Write the last data. */ - FLEXIO_MCULCD_WriteData(flexioLcdMcuBase, data); - - /* Wait for the last data send finished. */ - FLEXIO_MCULCD_WaitTransmitComplete(); - flexioLcdMcuHandle->remainingCount = 0; - - FLEXIO_MCULCD_ClearSingleBeatWriteConfig(flexioLcdMcuBase); - FLEXIO_MCULCD_StopTransfer(flexioLcdMcuBase); - flexioLcdMcuHandle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - - if (NULL != flexioLcdMcuHandle->completionCallback) - { - flexioLcdMcuHandle->completionCallback(flexioLcdMcuBase, flexioLcdMcuHandle, - kStatus_FLEXIO_MCULCD_Idle, flexioLcdMcuHandle->userData); - } - } - else - { - FLEXIO_MCULCD_WriteData(flexioLcdMcuBase, data); - flexioLcdMcuHandle->remainingCount--; - } - /* Is the shifter buffer ready to send the next data? */ - statusFlags = FLEXIO_MCULCD_GetStatusFlags(flexioLcdMcuBase); - } - } -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_mculcd.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_mculcd.h deleted file mode 100644 index d998b1d39f0..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_mculcd.h +++ /dev/null @@ -1,686 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_FLEXIO_MCULCD_H_ -#define FSL_FLEXIO_MCULCD_H_ - -#include "fsl_common.h" -#include "fsl_flexio.h" - -/*! - * @addtogroup flexio_mculcd - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief FlexIO MCULCD driver version. */ -#define FSL_FLEXIO_MCULCD_DRIVER_VERSION (MAKE_VERSION(2, 1, 0)) -/*@}*/ - -#ifndef FLEXIO_MCULCD_WAIT_COMPLETE_TIME -/*! - * @brief The delay time to wait for FLEXIO transmit complete. - * - * Currently there is no method to detect whether the data has been - * sent out from the shifter, so the driver use a software delay for this. When - * the data is written to shifter buffer, the driver call the delay - * function to wait for the data shift out. - * If this value is too small, then the last few bytes might be lost when writing - * data using interrupt method or DMA method. - */ -#define FLEXIO_MCULCD_WAIT_COMPLETE_TIME 512 -#endif - -#ifndef FLEXIO_MCULCD_DATA_BUS_WIDTH -/*! - * @brief The data bus width, must be 8 or 16. - */ -#define FLEXIO_MCULCD_DATA_BUS_WIDTH 16UL -#endif - -#if (16UL != FLEXIO_MCULCD_DATA_BUS_WIDTH) && (8UL != FLEXIO_MCULCD_DATA_BUS_WIDTH) -#error Only support data bus 8-bit or 16-bit -#endif - -/*! @brief FlexIO LCD transfer status */ -enum -{ - kStatus_FLEXIO_MCULCD_Idle = MAKE_STATUS(kStatusGroup_FLEXIO_MCULCD, 0), /*!< FlexIO LCD is idle. */ - kStatus_FLEXIO_MCULCD_Busy = MAKE_STATUS(kStatusGroup_FLEXIO_MCULCD, 1), /*!< FlexIO LCD is busy */ - kStatus_FLEXIO_MCULCD_Error = MAKE_STATUS(kStatusGroup_FLEXIO_MCULCD, 2), /*!< FlexIO LCD error occurred */ -}; - -/*! @brief Define FlexIO MCULCD pixel format. */ -typedef enum _flexio_mculcd_pixel_format -{ - kFLEXIO_MCULCD_RGB565 = 0, /*!< RGB565, 16-bit. */ - kFLEXIO_MCULCD_BGR565, /*!< BGR565, 16-bit. */ - kFLEXIO_MCULCD_RGB888, /*!< RGB888, 24-bit. */ - kFLEXIO_MCULCD_BGR888, /*!< BGR888, 24-bit. */ -} flexio_mculcd_pixel_format_t; - -/*! @brief Define FlexIO MCULCD bus type. */ -typedef enum _flexio_mculcd_bus -{ - kFLEXIO_MCULCD_8080, /*!< Using Intel 8080 bus. */ - kFLEXIO_MCULCD_6800, /*!< Using Motorola 6800 bus. */ -} flexio_mculcd_bus_t; - -/*! @brief Define FlexIO MCULCD interrupt mask. */ -enum _flexio_mculcd_interrupt_enable -{ - kFLEXIO_MCULCD_TxEmptyInterruptEnable = (1U << 0U), /*!< Transmit buffer empty interrupt enable. */ - kFLEXIO_MCULCD_RxFullInterruptEnable = (1U << 1U), /*!< Receive buffer full interrupt enable. */ -}; - -/*! @brief Define FlexIO MCULCD status mask. */ -enum _flexio_mculcd_status_flags -{ - kFLEXIO_MCULCD_TxEmptyFlag = (1U << 0U), /*!< Transmit buffer empty flag. */ - kFLEXIO_MCULCD_RxFullFlag = (1U << 1U), /*!< Receive buffer full flag. */ -}; - -/*! @brief Define FlexIO MCULCD DMA mask. */ -enum _flexio_mculcd_dma_enable -{ - kFLEXIO_MCULCD_TxDmaEnable = 0x1U, /*!< Tx DMA request source */ - kFLEXIO_MCULCD_RxDmaEnable = 0x2U, /*!< Rx DMA request source */ -}; - -/*! @brief Function to set or clear the CS and RS pin. */ -typedef void (*flexio_mculcd_pin_func_t)(bool set); - -/*! @brief Define FlexIO MCULCD access structure typedef. */ -typedef struct _flexio_mculcd_type -{ - FLEXIO_Type *flexioBase; /*!< FlexIO base pointer. */ - flexio_mculcd_bus_t busType; /*!< The bus type, 8080 or 6800. */ - uint8_t dataPinStartIndex; /*!< Start index of the data pin, the FlexIO pin dataPinStartIndex - to (dataPinStartIndex + FLEXIO_MCULCD_DATA_BUS_WIDTH -1) - will be used for data transfer. Only support data bus width 8 and 16. */ - uint8_t ENWRPinIndex; /*!< Pin select for WR(8080 mode), EN(6800 mode). */ - uint8_t RDPinIndex; /*!< Pin select for RD(8080 mode), not used in 6800 mode. */ - uint8_t txShifterStartIndex; /*!< Start index of shifters used for data write, it must be 0 or 4. */ - uint8_t txShifterEndIndex; /*!< End index of shifters used for data write. */ - uint8_t rxShifterStartIndex; /*!< Start index of shifters used for data read. */ - uint8_t rxShifterEndIndex; /*!< End index of shifters used for data read, it must be 3 or 7. */ - uint8_t timerIndex; /*!< Timer index used in FlexIO MCULCD. */ - flexio_mculcd_pin_func_t setCSPin; /*!< Function to set or clear the CS pin. */ - flexio_mculcd_pin_func_t setRSPin; /*!< Function to set or clear the RS pin. */ - flexio_mculcd_pin_func_t setRDWRPin; /*!< Function to set or clear the RD/WR pin, only used in 6800 mode. */ -} FLEXIO_MCULCD_Type; - -/*! @brief Define FlexIO MCULCD configuration structure. */ -typedef struct _flexio_mculcd_config -{ - bool enable; /*!< Enable/disable FlexIO MCULCD after configuration. */ - bool enableInDoze; /*!< Enable/disable FlexIO operation in doze mode. */ - bool enableInDebug; /*!< Enable/disable FlexIO operation in debug mode. */ - bool enableFastAccess; /*!< Enable/disable fast access to FlexIO registers, - fast access requires the FlexIO clock to be at least - twice the frequency of the bus clock. */ - uint32_t baudRate_Bps; /*!< Baud rate in bit-per-second for all data lines combined. */ -} flexio_mculcd_config_t; - -/*! @brief Transfer mode.*/ -typedef enum _flexio_mculcd_transfer_mode -{ - kFLEXIO_MCULCD_ReadArray, /*!< Read data into an array. */ - kFLEXIO_MCULCD_WriteArray, /*!< Write data from an array. */ - kFLEXIO_MCULCD_WriteSameValue, /*!< Write the same value many times. */ -} flexio_mculcd_transfer_mode_t; - -/*! @brief Define FlexIO MCULCD transfer structure. */ -typedef struct _flexio_mculcd_transfer -{ - uint32_t command; /*!< Command to send. */ - uint32_t dataAddrOrSameValue; /*!< When sending the same value for many times, - this is the value to send. When writing or reading array, - this is the address of the data array. */ - size_t dataSize; /*!< How many bytes to transfer. */ - flexio_mculcd_transfer_mode_t mode; /*!< Transfer mode. */ - bool dataOnly; /*!< Send data only when tx without the command. */ -} flexio_mculcd_transfer_t; - -/*! @brief typedef for flexio_mculcd_handle_t in advance. */ -typedef struct _flexio_mculcd_handle flexio_mculcd_handle_t; - -/*! @brief FlexIO MCULCD callback for finished transfer. - * - * When transfer finished, the callback function is called and returns the - * @p status as kStatus_FLEXIO_MCULCD_Idle. - */ -typedef void (*flexio_mculcd_transfer_callback_t)(FLEXIO_MCULCD_Type *base, - flexio_mculcd_handle_t *handle, - status_t status, - void *userData); - -/*! @brief Define FlexIO MCULCD handle structure. */ -struct _flexio_mculcd_handle -{ - uint32_t dataAddrOrSameValue; /*!< When sending the same value for many times, - this is the value to send. When writing or reading array, - this is the address of the data array. */ - size_t dataCount; /*!< Total count to be transferred. */ - volatile size_t remainingCount; /*!< Remaining count to transfer. */ - volatile uint32_t state; /*!< FlexIO MCULCD internal state. */ - flexio_mculcd_transfer_callback_t completionCallback; /*!< FlexIO MCULCD transfer completed callback. */ - void *userData; /*!< Callback parameter. */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus*/ - -/*! - * @name FlexIO MCULCD Configuration - * @{ - */ - -/*! - * @brief Ungates the FlexIO clock, resets the FlexIO module, configures the - * FlexIO MCULCD hardware, and configures the FlexIO MCULCD with FlexIO MCULCD - * configuration. - * The configuration structure can be filled by the user, or be set with default - * values - * by the @ref FLEXIO_MCULCD_GetDefaultConfig. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param config Pointer to the flexio_mculcd_config_t structure. - * @param srcClock_Hz FlexIO source clock in Hz. - * @retval kStatus_Success Initialization success. - * @retval kStatus_InvalidArgument Initialization failed because of invalid - * argument. - */ -status_t FLEXIO_MCULCD_Init(FLEXIO_MCULCD_Type *base, flexio_mculcd_config_t *config, uint32_t srcClock_Hz); - -/*! - * @brief Resets the FLEXIO_MCULCD timer and shifter configuration. - * - * @param base Pointer to the FLEXIO_MCULCD_Type. - */ -void FLEXIO_MCULCD_Deinit(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Gets the default configuration to configure the FlexIO MCULCD. - * - * The default configuration value is: - * @code - * config->enable = true; - * config->enableInDoze = false; - * config->enableInDebug = true; - * config->enableFastAccess = true; - * config->baudRate_Bps = 96000000U; - * @endcode - * @param config Pointer to the flexio_mculcd_config_t structure. - */ -void FLEXIO_MCULCD_GetDefaultConfig(flexio_mculcd_config_t *config); - -/*@}*/ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets FlexIO MCULCD status flags. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @return status flag; OR'ed value or the @ref _flexio_mculcd_status_flags. - * - * @note Don't use this function with DMA APIs. - */ -uint32_t FLEXIO_MCULCD_GetStatusFlags(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Clears FlexIO MCULCD status flags. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param mask Status to clear, it is the OR'ed value of @ref - * _flexio_mculcd_status_flags. - * - * @note Don't use this function with DMA APIs. - */ -void FLEXIO_MCULCD_ClearStatusFlags(FLEXIO_MCULCD_Type *base, uint32_t mask); - -/*@}*/ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables the FlexIO MCULCD interrupt. - * - * This function enables the FlexIO MCULCD interrupt. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param mask Interrupts to enable, it is the OR'ed value of @ref - * _flexio_mculcd_interrupt_enable. - */ -void FLEXIO_MCULCD_EnableInterrupts(FLEXIO_MCULCD_Type *base, uint32_t mask); - -/*! - * @brief Disables the FlexIO MCULCD interrupt. - * - * This function disables the FlexIO MCULCD interrupt. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param mask Interrupts to disable, it is the OR'ed value of @ref - * _flexio_mculcd_interrupt_enable. - */ -void FLEXIO_MCULCD_DisableInterrupts(FLEXIO_MCULCD_Type *base, uint32_t mask); - -/*@}*/ - -/*! - * @name DMA Control - * @{ - */ - -/*! - * @brief Enables/disables the FlexIO MCULCD transmit DMA. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param enable True means enable DMA, false means disable DMA. - */ -static inline void FLEXIO_MCULCD_EnableTxDMA(FLEXIO_MCULCD_Type *base, bool enable) -{ - FLEXIO_EnableShifterStatusDMA(base->flexioBase, (1UL << base->txShifterStartIndex), enable); -} - -/*! - * @brief Enables/disables the FlexIO MCULCD receive DMA. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param enable True means enable DMA, false means disable DMA. - */ -static inline void FLEXIO_MCULCD_EnableRxDMA(FLEXIO_MCULCD_Type *base, bool enable) -{ - FLEXIO_EnableShifterStatusDMA(base->flexioBase, (1UL << base->rxShifterEndIndex), enable); -} - -/*! - * @brief Gets the FlexIO MCULCD transmit data register address. - * - * This function returns the MCULCD data register address, which is mainly used - * by DMA/eDMA. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @return FlexIO MCULCD transmit data register address. - */ -static inline uint32_t FLEXIO_MCULCD_GetTxDataRegisterAddress(FLEXIO_MCULCD_Type *base) -{ - return (uint32_t) & (base->flexioBase->SHIFTBUF[base->txShifterStartIndex]); -} - -/*! - * @brief Gets the FlexIO MCULCD receive data register address. - * - * This function returns the MCULCD data register address, which is mainly used - * by DMA/eDMA. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @return FlexIO MCULCD receive data register address. - */ -static inline uint32_t FLEXIO_MCULCD_GetRxDataRegisterAddress(FLEXIO_MCULCD_Type *base) -{ - return (uint32_t) & (base->flexioBase->SHIFTBUF[base->rxShifterStartIndex]); -} - -/*@}*/ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Set desired baud rate. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param baudRate_Bps Desired baud rate in bit-per-second for all data lines combined. - * @param srcClock_Hz FLEXIO clock frequency in Hz. - * @retval kStatus_Success Set successfully. - * @retval kStatus_InvalidArgument Could not set the baud rate. - */ -status_t FLEXIO_MCULCD_SetBaudRate(FLEXIO_MCULCD_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz); - -/*! - * @brief Configures the FLEXIO MCULCD to multiple beats write mode. - * - * At the begining multiple beats write operation, the FLEXIO MCULCD is configured to - * multiple beats write mode using this function. After write operation, the configuration - * is cleared by @ref FLEXIO_MCULCD_ClearSingleBeatWriteConfig. - * - * @param base Pointer to the FLEXIO_MCULCD_Type. - * - * @note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_SetSingleBeatWriteConfig(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Clear the FLEXIO MCULCD multiple beats write mode configuration. - * - * Clear the write configuration set by @ref FLEXIO_MCULCD_SetSingleBeatWriteConfig. - * - * @param base Pointer to the FLEXIO_MCULCD_Type. - * - * @note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_ClearSingleBeatWriteConfig(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Configures the FLEXIO MCULCD to multiple beats read mode. - * - * At the begining or multiple beats read operation, the FLEXIO MCULCD is configured - * to multiple beats read mode using this function. After read operation, the configuration - * is cleared by @ref FLEXIO_MCULCD_ClearSingleBeatReadConfig. - * - * @param base Pointer to the FLEXIO_MCULCD_Type. - * - * @note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_SetSingleBeatReadConfig(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Clear the FLEXIO MCULCD multiple beats read mode configuration. - * - * Clear the read configuration set by @ref FLEXIO_MCULCD_SetSingleBeatReadConfig. - * - * @param base Pointer to the FLEXIO_MCULCD_Type. - * - * @note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_ClearSingleBeatReadConfig(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Configures the FLEXIO MCULCD to multiple beats write mode. - * - * At the begining multiple beats write operation, the FLEXIO MCULCD is configured to - * multiple beats write mode using this function. After write operation, the configuration - * is cleared by FLEXIO_MCULCD_ClearMultBeatsWriteConfig. - * - * @param base Pointer to the FLEXIO_MCULCD_Type. - * - * @note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_SetMultiBeatsWriteConfig(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Clear the FLEXIO MCULCD multiple beats write mode configuration. - * - * Clear the write configuration set by FLEXIO_MCULCD_SetMultBeatsWriteConfig. - * - * @param base Pointer to the FLEXIO_MCULCD_Type. - * - * @note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_ClearMultiBeatsWriteConfig(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Configures the FLEXIO MCULCD to multiple beats read mode. - * - * At the begining or multiple beats read operation, the FLEXIO MCULCD is configured - * to multiple beats read mode using this function. After read operation, the configuration - * is cleared by FLEXIO_MCULCD_ClearMultBeatsReadConfig. - * - * @param base Pointer to the FLEXIO_MCULCD_Type. - * - * @note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_SetMultiBeatsReadConfig(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Clear the FLEXIO MCULCD multiple beats read mode configuration. - * - * Clear the read configuration set by FLEXIO_MCULCD_SetMultBeatsReadConfig. - * - * @param base Pointer to the FLEXIO_MCULCD_Type. - * - * @note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_ClearMultiBeatsReadConfig(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Enables/disables the FlexIO MCULCD module operation. - * - * @param base Pointer to the FLEXIO_MCULCD_Type. - * @param enable True to enable, false does not have any effect. - */ -static inline void FLEXIO_MCULCD_Enable(FLEXIO_MCULCD_Type *base, bool enable) -{ - if (enable) - { - FLEXIO_Enable(base->flexioBase, enable); - } -} - -/*! - * @brief Read data from the FLEXIO MCULCD RX shifter buffer. - * - * Read data from the RX shift buffer directly, it does no check whether the - * buffer is empty or not. - * - * If the data bus width is 8-bit: - * @code - * uint8_t value; - * value = (uint8_t)FLEXIO_MCULCD_ReadData(base); - * @endcode - * - * If the data bus width is 16-bit: - * @code - * uint16_t value; - * value = (uint16_t)FLEXIO_MCULCD_ReadData(base); - * @endcode - * - * @note This function returns the RX shifter buffer value (32-bit) directly. - * The return value should be converted according to data bus width. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @return The data read out. - * - * @note Don't use this function with DMA APIs. - */ -uint32_t FLEXIO_MCULCD_ReadData(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Write data into the FLEXIO MCULCD TX shifter buffer. - * - * Write data into the TX shift buffer directly, it does no check whether the - * buffer is full or not. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param data The data to write. - * - * @note Don't use this function with DMA APIs. - */ -static inline void FLEXIO_MCULCD_WriteData(FLEXIO_MCULCD_Type *base, uint32_t data) -{ - base->flexioBase->SHIFTBUF[base->txShifterStartIndex] = data; -} - -/*! - * @brief Assert the nCS to start transfer. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - */ -static inline void FLEXIO_MCULCD_StartTransfer(FLEXIO_MCULCD_Type *base) -{ - base->setCSPin(false); -} - -/*! - * @brief De-assert the nCS to stop transfer. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - */ -static inline void FLEXIO_MCULCD_StopTransfer(FLEXIO_MCULCD_Type *base) -{ - base->setCSPin(true); -} - -/*! - * @brief Wait for transmit data send out finished. - * - * Currently there is no effective method to wait for the data send out - * from the shiter, so here use a while loop to wait. - * - * @note This is an internal used function. - */ -void FLEXIO_MCULCD_WaitTransmitComplete(void); - -/*! - * @brief Send command in blocking way. - * - * This function sends the command and returns when the command has been sent - * out. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param command The command to send. - */ -void FLEXIO_MCULCD_WriteCommandBlocking(FLEXIO_MCULCD_Type *base, uint32_t command); - -/*! - * @brief Send data array in blocking way. - * - * This function sends the data array and returns when the data sent out. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param data The data array to send. - * @param size How many bytes to write. - */ -void FLEXIO_MCULCD_WriteDataArrayBlocking(FLEXIO_MCULCD_Type *base, const void *data, size_t size); - -/*! - * @brief Read data into array in blocking way. - * - * This function reads the data into array and returns when the data read - * finished. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param data The array to save the data. - * @param size How many bytes to read. - */ -void FLEXIO_MCULCD_ReadDataArrayBlocking(FLEXIO_MCULCD_Type *base, void *data, size_t size); - -/*! - * @brief Send the same value many times in blocking way. - * - * This function sends the same value many times. It could be used to clear the - * LCD screen. If the data bus width is 8, this function will send LSB 8 bits of - * @p sameValue for @p size times. If the data bus is 16, this function will send - * LSB 16 bits of @p sameValue for @p size / 2 times. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param sameValue The same value to send. - * @param size How many bytes to send. - */ -void FLEXIO_MCULCD_WriteSameValueBlocking(FLEXIO_MCULCD_Type *base, uint32_t sameValue, size_t size); - -/*! - * @brief Performs a polling transfer. - * - * @note The API does not return until the transfer finished. - * - * @param base pointer to FLEXIO_MCULCD_Type structure. - * @param xfer pointer to flexio_mculcd_transfer_t structure. - */ -void FLEXIO_MCULCD_TransferBlocking(FLEXIO_MCULCD_Type *base, flexio_mculcd_transfer_t *xfer); -/*@}*/ - -/*! - * @name Transactional - * @{ - */ - -/*! - * @brief Initializes the FlexIO MCULCD handle, which is used in transactional - * functions. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param handle Pointer to the flexio_mculcd_handle_t structure to store the - * transfer state. - * @param callback The callback function. - * @param userData The parameter of the callback function. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_MCULCD_TransferCreateHandle(FLEXIO_MCULCD_Type *base, - flexio_mculcd_handle_t *handle, - flexio_mculcd_transfer_callback_t callback, - void *userData); - -/*! - * @brief Transfer data using IRQ. - * - * This function sends data using IRQ. This is a non-blocking function, which - * returns right away. When all data is sent out/received, the callback - * function is called. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param handle Pointer to the flexio_mculcd_handle_t structure to store the - * transfer state. - * @param xfer FlexIO MCULCD transfer structure. See #flexio_mculcd_transfer_t. - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_InvalidArgument Input argument is invalid. - * @retval kStatus_FLEXIO_MCULCD_Busy MCULCD is busy with another transfer. - */ -status_t FLEXIO_MCULCD_TransferNonBlocking(FLEXIO_MCULCD_Type *base, - flexio_mculcd_handle_t *handle, - flexio_mculcd_transfer_t *xfer); - -/*! - * @brief Aborts the data transfer, which used IRQ. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param handle Pointer to the flexio_mculcd_handle_t structure to store the - * transfer state. - */ -void FLEXIO_MCULCD_TransferAbort(FLEXIO_MCULCD_Type *base, flexio_mculcd_handle_t *handle); - -/*! - * @brief Gets the data transfer status which used IRQ. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param handle Pointer to the flexio_mculcd_handle_t structure to store the - * transfer state. - * @param count How many bytes transferred so far by the non-blocking transaction. - * @retval kStatus_Success Get the transferred count Successfully. - * @retval kStatus_NoTransferInProgress No transfer in process. - */ -status_t FLEXIO_MCULCD_TransferGetCount(FLEXIO_MCULCD_Type *base, flexio_mculcd_handle_t *handle, size_t *count); - -/*! - * @brief FlexIO MCULCD IRQ handler function. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param handle Pointer to the flexio_mculcd_handle_t structure to store the - * transfer state. - */ -void FLEXIO_MCULCD_TransferHandleIRQ(void *base, void *handle); - -/*@}*/ - -#if defined(__cplusplus) -} -#endif /*_cplusplus*/ -/*@}*/ - -#endif /*FSL_FLEXIO_MCULCD_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_mculcd_edma.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_mculcd_edma.c deleted file mode 100644 index 0c52c4e8c08..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_mculcd_edma.c +++ /dev/null @@ -1,568 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2019,2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio_mculcd_edma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio_mculcd_edma" -#endif - -#define EDMA_MAX_MAJOR_COUNT (DMA_CITER_ELINKNO_CITER_MASK >> DMA_CITER_ELINKNO_CITER_SHIFT) - -enum -{ - kFLEXIO_MCULCD_StateIdle, /*!< No transfer in progress. */ - kFLEXIO_MCULCD_StateReadArray, /*!< Reading array in progress. */ - kFLEXIO_MCULCD_StateWriteArray, /*!< Writing array in progress. */ - kFLEXIO_MCULCD_StateWriteSameValue, /*!< Writing the same value in progress. - */ -}; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief EDMA callback function for FLEXIO MCULCD TX. - * - * For details, see @ref edma_callback. - */ -static void FLEXIO_MCULCD_TxEDMACallback(edma_handle_t *DmaHandle, void *param, bool transferDone, uint32_t tcds); - -/*! - * @brief EDMA callback function for FLEXIO MCULCD RX. - * - * For details, see @ref edma_callback. - */ -static void FLEXIO_MCULCD_RxEDMACallback(edma_handle_t *DmaHandle, void *param, bool transferDone, uint32_t tcds); - -/*! - * @brief Set EDMA config for FLEXIO MCULCD transfer. - * - * @param base pointer to FLEXIO_MCULCD_Type structure. - * @param handle pointer to flexio_mculcd_edma_handle_t structure to store the - * transfer state. - */ -static void FLEXIO_MCULCD_EDMAConfig(FLEXIO_MCULCD_Type *base, flexio_mculcd_edma_handle_t *handle); - -/*! - * @brief Convert the FlexIO shifter number to eDMA modulo. - * - * @param shifterNum The FlexIO shifter number. - * @param modulo The modulo number. - * @retval Get the modulo successfully. - * @retval Could not get the modulo for the shifter number. - */ -static bool FLEXIO_MCULCD_GetEDMAModulo(uint8_t shifterNum, edma_modulo_t *modulo); - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -static void FLEXIO_MCULCD_TxEDMACallback(edma_handle_t *DmaHandle, void *param, bool transferDone, uint32_t tcds) -{ - tcds = tcds; - flexio_mculcd_edma_handle_t *flexioLcdMcuHandle = (flexio_mculcd_edma_handle_t *)param; - FLEXIO_MCULCD_Type *flexioLcdMcuBase = flexioLcdMcuHandle->base; - - if (transferDone) - { - if (flexioLcdMcuHandle->remainingCount >= flexioLcdMcuHandle->minorLoopBytes) - { - FLEXIO_MCULCD_EDMAConfig(flexioLcdMcuBase, flexioLcdMcuHandle); - EDMA_StartTransfer(flexioLcdMcuHandle->txDmaHandle); - } - else - { - FLEXIO_MCULCD_EnableTxDMA(flexioLcdMcuBase, false); - - /* Now the data are in shifter, wait for the data send out from the shifter. */ - FLEXIO_MCULCD_WaitTransmitComplete(); - - /* Disable the TX shifter and the timer. */ - FLEXIO_MCULCD_ClearMultiBeatsWriteConfig(flexioLcdMcuBase); - - /* Send the remaining data. */ - if (0U != flexioLcdMcuHandle->remainingCount) - { - if ((uint32_t)kFLEXIO_MCULCD_StateWriteSameValue == flexioLcdMcuHandle->state) - { - FLEXIO_MCULCD_WriteSameValueBlocking(flexioLcdMcuBase, flexioLcdMcuHandle->dataAddrOrSameValue, - flexioLcdMcuHandle->remainingCount); - } - else - { - FLEXIO_MCULCD_WriteDataArrayBlocking(flexioLcdMcuBase, - (uint8_t *)flexioLcdMcuHandle->dataAddrOrSameValue, - flexioLcdMcuHandle->remainingCount); - } - } - - /* De-assert nCS. */ - FLEXIO_MCULCD_StopTransfer(flexioLcdMcuBase); - - /* Change the state. */ - flexioLcdMcuHandle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - flexioLcdMcuHandle->dataCount = 0; - flexioLcdMcuHandle->remainingCount = 0; - - /* Callback to inform upper layer. */ - if (NULL != flexioLcdMcuHandle->completionCallback) - { - flexioLcdMcuHandle->completionCallback(flexioLcdMcuBase, flexioLcdMcuHandle, kStatus_FLEXIO_MCULCD_Idle, - flexioLcdMcuHandle->userData); - } - } - } -} - -static void FLEXIO_MCULCD_RxEDMACallback(edma_handle_t *DmaHandle, void *param, bool transferDone, uint32_t tcds) -{ - tcds = tcds; - uint32_t i; - uint32_t rxBufAddr; - flexio_mculcd_edma_handle_t *flexioLcdMcuHandle = (flexio_mculcd_edma_handle_t *)param; - FLEXIO_MCULCD_Type *flexioLcdMcuBase = flexioLcdMcuHandle->base; - FLEXIO_Type *flexioBase = flexioLcdMcuBase->flexioBase; - - if (transferDone) - { - if (flexioLcdMcuHandle->remainingCount >= (2U * flexioLcdMcuHandle->minorLoopBytes)) - { - FLEXIO_MCULCD_EDMAConfig(flexioLcdMcuBase, flexioLcdMcuHandle); - EDMA_StartTransfer(flexioLcdMcuHandle->rxDmaHandle); - } - else - { - FLEXIO_MCULCD_EnableRxDMA(flexioLcdMcuBase, false); - - /* Wait the data saved to the shifter buffer. */ - while (0U == ((1UL << flexioLcdMcuBase->rxShifterEndIndex) & FLEXIO_GetShifterStatusFlags(flexioBase))) - { - } - - /* Disable the RX shifter and the timer. */ - FLEXIO_MCULCD_ClearMultiBeatsReadConfig(flexioLcdMcuBase); - - rxBufAddr = FLEXIO_MCULCD_GetRxDataRegisterAddress(flexioLcdMcuBase); - -/* Read out the data. */ -#if (defined(__CORTEX_M) && (__CORTEX_M == 0)) - /* Cortex M0 and M0+ only support aligned access. */ - for (i = 0; i < flexioLcdMcuHandle->rxShifterNum * 4; i++) - { - ((uint8_t *)(flexioLcdMcuHandle->dataAddrOrSameValue))[i] = ((volatile uint8_t *)rxBufAddr)[i]; - } -#else - for (i = 0; i < flexioLcdMcuHandle->rxShifterNum; i++) - { - ((uint32_t *)(flexioLcdMcuHandle->dataAddrOrSameValue))[i] = ((volatile uint32_t *)rxBufAddr)[i]; - } -#endif - flexioLcdMcuHandle->remainingCount -= flexioLcdMcuHandle->minorLoopBytes; - - if (0U != flexioLcdMcuHandle->remainingCount) - { - FLEXIO_MCULCD_ReadDataArrayBlocking( - flexioLcdMcuBase, - (uint8_t *)(flexioLcdMcuHandle->dataAddrOrSameValue + flexioLcdMcuHandle->minorLoopBytes), - flexioLcdMcuHandle->remainingCount); - } - - /* De-assert nCS. */ - FLEXIO_MCULCD_StopTransfer(flexioLcdMcuBase); - - /* Change the state. */ - flexioLcdMcuHandle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - flexioLcdMcuHandle->dataCount = 0; - flexioLcdMcuHandle->remainingCount = 0; - - /* Callback to inform upper layer. */ - if (NULL != flexioLcdMcuHandle->completionCallback) - { - flexioLcdMcuHandle->completionCallback(flexioLcdMcuBase, flexioLcdMcuHandle, kStatus_FLEXIO_MCULCD_Idle, - flexioLcdMcuHandle->userData); - } - } - } -} - -static void FLEXIO_MCULCD_EDMAConfig(FLEXIO_MCULCD_Type *base, flexio_mculcd_edma_handle_t *handle) -{ - edma_transfer_config_t xferConfig = {0}; - edma_transfer_size_t transferSize = kEDMA_TransferSize1Bytes; - int16_t offset; - uint32_t majorLoopCounts; - uint32_t transferCount; - -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - transferSize = kEDMA_TransferSize1Bytes; - offset = 1; -#else - transferSize = kEDMA_TransferSize2Bytes; - offset = 2; -#endif - - majorLoopCounts = handle->remainingCount / handle->minorLoopBytes; - - /* For reading, the last minor loop data is not tranfered by DMA. */ - if ((uint32_t)kFLEXIO_MCULCD_StateReadArray == handle->state) - { - majorLoopCounts--; - } - - if (majorLoopCounts > EDMA_MAX_MAJOR_COUNT) - { - majorLoopCounts = EDMA_MAX_MAJOR_COUNT; - } - - transferCount = majorLoopCounts * handle->minorLoopBytes; - - if ((uint32_t)kFLEXIO_MCULCD_StateReadArray == handle->state) - { - xferConfig.srcAddr = FLEXIO_MCULCD_GetRxDataRegisterAddress(base); - xferConfig.destAddr = handle->dataAddrOrSameValue; - xferConfig.srcTransferSize = kEDMA_TransferSize4Bytes; - xferConfig.destTransferSize = transferSize; - xferConfig.srcOffset = 4; - xferConfig.destOffset = offset; - xferConfig.minorLoopBytes = handle->minorLoopBytes; - xferConfig.majorLoopCounts = majorLoopCounts; - handle->remainingCount -= transferCount; - handle->dataAddrOrSameValue += transferCount; - (void)EDMA_SubmitTransfer(handle->rxDmaHandle, &xferConfig); - EDMA_SetModulo(handle->rxDmaHandle->base, handle->rxDmaHandle->channel, handle->rxEdmaModulo, - kEDMA_ModuloDisable); - } - else - { - if ((uint32_t)kFLEXIO_MCULCD_StateWriteArray == handle->state) - { - xferConfig.srcAddr = handle->dataAddrOrSameValue; - xferConfig.srcOffset = offset; - handle->dataAddrOrSameValue += transferCount; - } - else - { - xferConfig.srcAddr = (uint32_t)(&(handle->dataAddrOrSameValue)); - xferConfig.srcOffset = 0; - } - xferConfig.destAddr = FLEXIO_MCULCD_GetTxDataRegisterAddress(base); - xferConfig.srcTransferSize = transferSize; - xferConfig.destTransferSize = kEDMA_TransferSize4Bytes; - xferConfig.destOffset = 4; - xferConfig.minorLoopBytes = handle->minorLoopBytes; - xferConfig.majorLoopCounts = majorLoopCounts; - handle->remainingCount -= transferCount; - (void)EDMA_SubmitTransfer(handle->txDmaHandle, &xferConfig); - EDMA_SetModulo(handle->txDmaHandle->base, handle->txDmaHandle->channel, kEDMA_ModuloDisable, - handle->txEdmaModulo); - } -} - -static bool FLEXIO_MCULCD_GetEDMAModulo(uint8_t shifterNum, edma_modulo_t *modulo) -{ - bool ret = true; - - switch (shifterNum) - { - case 1U: - *modulo = kEDMA_Modulo4bytes; - break; - case 2U: - *modulo = kEDMA_Modulo8bytes; - break; - case 4U: - *modulo = kEDMA_Modulo16bytes; - break; - case 8U: - *modulo = kEDMA_Modulo32bytes; - break; - default: - ret = false; - break; - } - - return ret; -} - -/*! - * brief Initializes the FLEXO MCULCD master eDMA handle. - * - * This function initializes the FLEXO MCULCD master eDMA handle which can be - * used for other FLEXO MCULCD transactional APIs. For a specified FLEXO MCULCD - * instance, call this API once to get the initialized handle. - * - * param base Pointer to FLEXIO_MCULCD_Type structure. - * param handle Pointer to flexio_mculcd_edma_handle_t structure to store the - * transfer state. - * param callback MCULCD transfer complete callback, NULL means no callback. - * param userData callback function parameter. - * param txDmaHandle User requested eDMA handle for FlexIO MCULCD eDMA TX, - * the DMA request source of this handle should be the first of TX shifters. - * param rxDmaHandle User requested eDMA handle for FlexIO MCULCD eDMA RX, - * the DMA request source of this handle should be the last of RX shifters. - * retval kStatus_Success Successfully create the handle. - */ -status_t FLEXIO_MCULCD_TransferCreateHandleEDMA(FLEXIO_MCULCD_Type *base, - flexio_mculcd_edma_handle_t *handle, - flexio_mculcd_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *txDmaHandle, - edma_handle_t *rxDmaHandle) -{ - assert(NULL != handle); - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Initialize the state. */ - handle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - - /* Register callback and userData. */ - handle->completionCallback = callback; - handle->userData = userData; - - handle->base = base; - handle->txShifterNum = base->txShifterEndIndex - base->txShifterStartIndex + 1U; - handle->rxShifterNum = base->rxShifterEndIndex - base->rxShifterStartIndex + 1U; - - if (NULL != rxDmaHandle) - { - if (!FLEXIO_MCULCD_GetEDMAModulo(handle->rxShifterNum, &handle->rxEdmaModulo)) - { - return kStatus_InvalidArgument; - } - - handle->rxDmaHandle = rxDmaHandle; - EDMA_SetCallback(rxDmaHandle, FLEXIO_MCULCD_RxEDMACallback, handle); - } - - if (NULL != txDmaHandle) - { - if (!FLEXIO_MCULCD_GetEDMAModulo(handle->txShifterNum, &handle->txEdmaModulo)) - { - return kStatus_InvalidArgument; - } - - handle->txDmaHandle = txDmaHandle; - EDMA_SetCallback(txDmaHandle, FLEXIO_MCULCD_TxEDMACallback, handle); - } - - return kStatus_Success; -} - -/*! - * brief Performs a non-blocking FlexIO MCULCD transfer using eDMA. - * - * This function returns immediately after transfer initiates. To check whether - * the transfer is completed, user could: - * 1. Use the transfer completed callback; - * 2. Polling function ref FLEXIO_MCULCD_GetTransferCountEDMA - * - * param base pointer to FLEXIO_MCULCD_Type structure. - * param handle pointer to flexio_mculcd_edma_handle_t structure to store the - * transfer state. - * param xfer Pointer to FlexIO MCULCD transfer structure. - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_InvalidArgument Input argument is invalid. - * retval kStatus_FLEXIO_MCULCD_Busy FlexIO MCULCD is not idle, it is running another - * transfer. - */ -status_t FLEXIO_MCULCD_TransferEDMA(FLEXIO_MCULCD_Type *base, - flexio_mculcd_edma_handle_t *handle, - flexio_mculcd_transfer_t *xfer) -{ - assert(NULL != handle); - assert(NULL != xfer); - - /* - * The data transfer mechanism: - * - * Read: - * Assume the data length is Lr = (n1 * minorLoopBytes + n2), where - * n2 < minorLoopBytes. - * If (n1 <= 1), then all data are sent using blocking method. - * If (n1 > 1), then the beginning ((n1-1) * minorLoopBytes) are read - * using DMA, the left (minorLoopBytes + n2) are read using blocking method. - * - * Write: - * Assume the data length is Lw = (n1 * minorLoopBytes + n2), where - * n2 < minorLoopBytes. - * If (n1 = 0), then all data are sent using blocking method. - * If (n1 >= 1), then the beginning (n1 * minorLoopBytes) are sent - * using DMA, the left n2 are sent using blocking method. - */ - - /* Check if the device is busy. */ - if ((uint32_t)kFLEXIO_MCULCD_StateIdle != handle->state) - { - return kStatus_FLEXIO_MCULCD_Busy; - } - - /* Set the state in handle. */ - if (kFLEXIO_MCULCD_ReadArray == xfer->mode) - { - handle->state = (uint32_t)kFLEXIO_MCULCD_StateReadArray; - handle->minorLoopBytes = handle->rxShifterNum * 4UL; - } - else - { - handle->minorLoopBytes = handle->txShifterNum * 4UL; - - if (kFLEXIO_MCULCD_WriteArray == xfer->mode) - { - handle->state = (uint32_t)kFLEXIO_MCULCD_StateWriteArray; - } - else - { - handle->state = (uint32_t)kFLEXIO_MCULCD_StateWriteSameValue; - } - } - - /* - * For TX, if data is less than one minor loop, then use polling method. - * For RX, if data is less than two minor loop, then use polling method. - */ - if ((xfer->dataSize < handle->minorLoopBytes) || - ((kFLEXIO_MCULCD_ReadArray == xfer->mode) && (xfer->dataSize < 2U * (handle->minorLoopBytes)))) - { - FLEXIO_MCULCD_TransferBlocking(base, xfer); - - handle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - - /* Callback to inform upper layer. */ - if (NULL != handle->completionCallback) - { - handle->completionCallback(base, handle, kStatus_FLEXIO_MCULCD_Idle, handle->userData); - } - } - else - { - handle->dataCount = xfer->dataSize; - handle->remainingCount = xfer->dataSize; - handle->dataAddrOrSameValue = xfer->dataAddrOrSameValue; - - /* Setup DMA to transfer data. */ - /* Assert the nCS. */ - FLEXIO_MCULCD_StartTransfer(base); - - if (!xfer->dataOnly) - { - /* Send the command. */ - FLEXIO_MCULCD_WriteCommandBlocking(base, xfer->command); - } - - /* Setup the DMA configuration. */ - FLEXIO_MCULCD_EDMAConfig(base, handle); - - /* Start the transfer. */ - if (kFLEXIO_MCULCD_ReadArray == xfer->mode) - { - /* For 6800, assert the RDWR pin. */ - if (kFLEXIO_MCULCD_6800 == base->busType) - { - base->setRDWRPin(true); - } - FLEXIO_MCULCD_SetMultiBeatsReadConfig(base); - FLEXIO_MCULCD_EnableRxDMA(base, true); - EDMA_StartTransfer(handle->rxDmaHandle); - } - else - { - /* For 6800, de-assert the RDWR pin. */ - if (kFLEXIO_MCULCD_6800 == base->busType) - { - base->setRDWRPin(false); - } - FLEXIO_MCULCD_SetMultiBeatsWriteConfig(base); - FLEXIO_MCULCD_EnableTxDMA(base, true); - EDMA_StartTransfer(handle->txDmaHandle); - } - } - - return kStatus_Success; -} - -/*! - * brief Aborts a FlexIO MCULCD transfer using eDMA. - * - * param base pointer to FLEXIO_MCULCD_Type structure. - * param handle FlexIO MCULCD eDMA handle pointer. - */ -void FLEXIO_MCULCD_TransferAbortEDMA(FLEXIO_MCULCD_Type *base, flexio_mculcd_edma_handle_t *handle) -{ - assert(NULL != handle); - - /* Disable dma. */ - if (NULL != handle->txDmaHandle) - { - EDMA_AbortTransfer(handle->txDmaHandle); - } - if (NULL != handle->rxDmaHandle) - { - EDMA_AbortTransfer(handle->rxDmaHandle); - } - - /* Disable DMA enable bit. */ - FLEXIO_MCULCD_EnableTxDMA(handle->base, false); - FLEXIO_MCULCD_EnableRxDMA(handle->base, false); - - /* Set the handle state. */ - handle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - handle->dataCount = 0; -} - -/*! - * brief Gets the remaining bytes for FlexIO MCULCD eDMA transfer. - * - * param base pointer to FLEXIO_MCULCD_Type structure. - * param handle FlexIO MCULCD eDMA handle pointer. - * param count Number of count transferred so far by the eDMA transaction. - * retval kStatus_Success Get the transferred count Successfully. - * retval kStatus_NoTransferInProgress No transfer in process. - */ -status_t FLEXIO_MCULCD_TransferGetCountEDMA(FLEXIO_MCULCD_Type *base, - flexio_mculcd_edma_handle_t *handle, - size_t *count) -{ - assert(NULL != handle); - assert(NULL != count); - uint32_t state = handle->state; - - if ((uint32_t)kFLEXIO_MCULCD_StateIdle == state) - { - return kStatus_NoTransferInProgress; - } - else - { - *count = handle->dataCount - handle->remainingCount; - - if ((uint32_t)kFLEXIO_MCULCD_StateReadArray == state) - { - *count -= handle->minorLoopBytes * - EDMA_GetRemainingMajorLoopCount(handle->rxDmaHandle->base, handle->rxDmaHandle->channel); - } - else - { - *count -= handle->minorLoopBytes * - EDMA_GetRemainingMajorLoopCount(handle->txDmaHandle->base, handle->txDmaHandle->channel); - } - } - - return kStatus_Success; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_mculcd_edma.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_mculcd_edma.h deleted file mode 100644 index eb2a4ce42ef..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_mculcd_edma.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2020,2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_FLEXIO_MCULCD_EDMA_H_ -#define FSL_FLEXIO_MCULCD_EDMA_H_ - -#include "fsl_edma.h" -#include "fsl_flexio_mculcd.h" - -/*! - * @addtogroup flexio_edma_mculcd - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*@{*/ -/*! @brief FlexIO MCULCD EDMA driver version. */ -#define FSL_FLEXIO_MCULCD_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 0, 5)) -/*@}*/ - -/*! @brief typedef for flexio_mculcd_edma_handle_t in advance. */ -typedef struct _flexio_mculcd_edma_handle flexio_mculcd_edma_handle_t; - -/*! @brief FlexIO MCULCD master callback for transfer complete. - * - * When transfer finished, the callback function is called and returns the - * @p status as kStatus_FLEXIO_MCULCD_Idle. - */ -typedef void (*flexio_mculcd_edma_transfer_callback_t)(FLEXIO_MCULCD_Type *base, - flexio_mculcd_edma_handle_t *handle, - status_t status, - void *userData); - -/*! @brief FlexIO MCULCD eDMA transfer handle, users should not touch the - * content of the handle.*/ -struct _flexio_mculcd_edma_handle -{ - FLEXIO_MCULCD_Type *base; /*!< Pointer to the FLEXIO_MCULCD_Type. */ - uint8_t txShifterNum; /*!< Number of shifters used for TX. */ - uint8_t rxShifterNum; /*!< Number of shifters used for RX. */ - uint32_t minorLoopBytes; /*!< eDMA transfer minor loop bytes. */ - edma_modulo_t txEdmaModulo; /*!< Modulo value for the FlexIO shifter buffer access. */ - edma_modulo_t rxEdmaModulo; /*!< Modulo value for the FlexIO shifter buffer access. */ - uint32_t dataAddrOrSameValue; /*!< When sending the same value for many times, - this is the value to send. When writing or - reading array, this is the address of the - data array. */ - size_t dataCount; /*!< Total count to be transferred. */ - volatile size_t remainingCount; /*!< Remaining count still not transfered. */ - volatile uint32_t state; /*!< FlexIO MCULCD driver internal state. */ - edma_handle_t *txDmaHandle; /*!< DMA handle for MCULCD TX */ - edma_handle_t *rxDmaHandle; /*!< DMA handle for MCULCD RX */ - flexio_mculcd_edma_transfer_callback_t completionCallback; /*!< Callback for MCULCD DMA transfer */ - void *userData; /*!< User Data for MCULCD DMA callback */ -}; - -/******************************************************************************* - * APIs - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name eDMA Transactional - * @{ - */ - -/*! - * @brief Initializes the FLEXO MCULCD master eDMA handle. - * - * This function initializes the FLEXO MCULCD master eDMA handle which can be - * used for other FLEXO MCULCD transactional APIs. For a specified FLEXO MCULCD - * instance, call this API once to get the initialized handle. - * - * @param base Pointer to FLEXIO_MCULCD_Type structure. - * @param handle Pointer to flexio_mculcd_edma_handle_t structure to store the - * transfer state. - * @param callback MCULCD transfer complete callback, NULL means no callback. - * @param userData callback function parameter. - * @param txDmaHandle User requested eDMA handle for FlexIO MCULCD eDMA TX, - * the DMA request source of this handle should be the first of TX shifters. - * @param rxDmaHandle User requested eDMA handle for FlexIO MCULCD eDMA RX, - * the DMA request source of this handle should be the last of RX shifters. - * @retval kStatus_Success Successfully create the handle. - */ -status_t FLEXIO_MCULCD_TransferCreateHandleEDMA(FLEXIO_MCULCD_Type *base, - flexio_mculcd_edma_handle_t *handle, - flexio_mculcd_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *txDmaHandle, - edma_handle_t *rxDmaHandle); - -/*! - * @brief Performs a non-blocking FlexIO MCULCD transfer using eDMA. - * - * This function returns immediately after transfer initiates. To check whether - * the transfer is completed, user could: - * 1. Use the transfer completed callback; - * 2. Polling function FLEXIO_MCULCD_GetTransferCountEDMA - * - * @param base pointer to FLEXIO_MCULCD_Type structure. - * @param handle pointer to flexio_mculcd_edma_handle_t structure to store the - * transfer state. - * @param xfer Pointer to FlexIO MCULCD transfer structure. - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_InvalidArgument Input argument is invalid. - * @retval kStatus_FLEXIO_MCULCD_Busy FlexIO MCULCD is not idle, it is running another - * transfer. - */ -status_t FLEXIO_MCULCD_TransferEDMA(FLEXIO_MCULCD_Type *base, - flexio_mculcd_edma_handle_t *handle, - flexio_mculcd_transfer_t *xfer); - -/*! - * @brief Aborts a FlexIO MCULCD transfer using eDMA. - * - * @param base pointer to FLEXIO_MCULCD_Type structure. - * @param handle FlexIO MCULCD eDMA handle pointer. - */ -void FLEXIO_MCULCD_TransferAbortEDMA(FLEXIO_MCULCD_Type *base, flexio_mculcd_edma_handle_t *handle); - -/*! - * @brief Gets the remaining bytes for FlexIO MCULCD eDMA transfer. - * - * @param base pointer to FLEXIO_MCULCD_Type structure. - * @param handle FlexIO MCULCD eDMA handle pointer. - * @param count Number of count transferred so far by the eDMA transaction. - * @retval kStatus_Success Get the transferred count Successfully. - * @retval kStatus_NoTransferInProgress No transfer in process. - */ -status_t FLEXIO_MCULCD_TransferGetCountEDMA(FLEXIO_MCULCD_Type *base, - flexio_mculcd_edma_handle_t *handle, - size_t *count); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ -#endif /* FSL_FLEXIO_MCULCD_EDMA_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_mculcd_smartdma.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_mculcd_smartdma.c deleted file mode 100644 index 3ca53150525..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_mculcd_smartdma.c +++ /dev/null @@ -1,407 +0,0 @@ -/* - * Copyright 2019-2021,2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio_mculcd_smartdma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio_mculcd_smartdma" -#endif - -#define FLEXIO_MCULCD_SMARTDMA_TX_START_SHIFTER 0U -#define FLEXIO_MCULCD_SMARTDMA_TX_END_SHIFTER 7U -#define FLEXIO_MCULCD_SMARTDMA_TX_SHIFTER_NUM \ - (FLEXIO_MCULCD_SMARTDMA_TX_END_SHIFTER - FLEXIO_MCULCD_SMARTDMA_TX_START_SHIFTER + 1) - -enum _MCULCD_transfer_state -{ - kFLEXIO_MCULCD_StateIdle, /*!< No transfer in progress. */ - kFLEXIO_MCULCD_StateReadArray, /*!< Reading array in progress. */ - kFLEXIO_MCULCD_StateWriteArray, /*!< Writing array in progress. */ - kFLEXIO_MCULCD_StateWriteSameValue, /*!< Writing the same value in progress. - */ -}; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Get the TX chunk size. - * - * The SMARTDMA TX transfer memory must be 4Byte aligned, the transfer size must - * be multiple of 64Byte. So the transfer data is devided in to three part: - * part1 + part2 + part3. - * The part2 is transfered using SMARTDMA, it should be 4Byte aligned, multiple - * of 64Byte. - * The part1 and part3 are transfered using blocking method, each of them is - * less than 64Byte, and total of them is less than (64 + 4) bytes. - * - * This function gets the size of each part. - * - * @param totalLen The total TX size in byte. - * @param startAddr The start address of the TX data. - * @param part1Len Length of the part 1 in byte. - * @param part2Len Length of the part 2 in byte. - * @param part3Len Length of the part 3 in byte. - */ -static void FLEXIO_MCULCD_SMARTDMA_GetTxChunkLen( - uint32_t totalLen, uint32_t startAddr, uint32_t *part1Len, uint32_t *part2Len, uint32_t *part3Len); - -/*! - * @brief Convert RGB565 to RGB888. - * - * @param rgb565 Input RGB565. - * @param pixelCount Pixel count. - * @param rgb888 Output RGB888. - */ -static void FLEXIO_MCULCD_RGB656ToRGB888(const uint16_t *rgb565, uint32_t pixelCount, uint8_t *rgb888); - -/*! - * @brief Callback function registered to SMARTDMA driver. - */ -static void FLEXIO_MCULCD_SMARTDMA_Callback(void *param); - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ -static void FLEXIO_MCULCD_SMARTDMA_GetTxChunkLen( - uint32_t totalLen, uint32_t startAddr, uint32_t *part1Len, uint32_t *part2Len, uint32_t *part3Len) -{ - if (totalLen < FLEXIO_MCULCD_SMARTDMA_TX_LEN_ALIGN) - { - *part1Len = totalLen; - *part2Len = 0; - *part3Len = 0; - } - else - { - *part3Len = (startAddr + totalLen) & (FLEXIO_MCULCD_SMARTDMA_TX_ADDR_ALIGN - 1U); - *part2Len = ((uint32_t)(totalLen - *part3Len)) & (~(FLEXIO_MCULCD_SMARTDMA_TX_LEN_ALIGN - 1U)); - - if (FLEXIO_MCULCD_SMARTDMA_TX_LEN_ALIGN > *part2Len) - { - *part1Len = totalLen; - *part2Len = 0; - *part3Len = 0; - } - else - { - *part1Len = totalLen - *part2Len - *part3Len; - } - } -} - -static void FLEXIO_MCULCD_RGB656ToRGB888(const uint16_t *rgb565, uint32_t pixelCount, uint8_t *rgb888) -{ - while ((pixelCount--) != 0U) - { - *rgb888 = (uint8_t)(((*rgb565) & 0x001FU) << 3U); - rgb888++; - *rgb888 = (uint8_t)(((*rgb565) & 0x07E0U) >> 3U); - rgb888++; - *rgb888 = (uint8_t)(((*rgb565) & 0xF800U) >> 8U); - rgb888++; - - rgb565++; - } -} - -/*! - * brief Initializes the FLEXO MCULCD master SMARTDMA handle. - * - * This function initializes the FLEXO MCULCD master SMARTDMA handle which can be - * used for other FLEXO MCULCD transactional APIs. For a specified FLEXO MCULCD - * instance, call this API once to get the initialized handle. - * - * param base Pointer to FLEXIO_MCULCD_Type structure. - * param handle Pointer to flexio_mculcd_smartdma_handle_t structure to store the - * transfer state. - * param config Pointer to the configuration. - * param callback MCULCD transfer complete callback, NULL means no callback. - * param userData callback function parameter. - * retval kStatus_Success Successfully create the handle. - */ -status_t FLEXIO_MCULCD_TransferCreateHandleSMARTDMA(FLEXIO_MCULCD_Type *base, - flexio_mculcd_smartdma_handle_t *handle, - const flexio_mculcd_smartdma_config_t *config, - flexio_mculcd_smartdma_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - /* The SMARTDMA firmware only support TX using shifter 0 to shifter 7 */ - if (base->txShifterStartIndex != FLEXIO_MCULCD_SMARTDMA_TX_START_SHIFTER) - { - return kStatus_InvalidArgument; - } - - if (base->txShifterEndIndex != FLEXIO_MCULCD_SMARTDMA_TX_END_SHIFTER) - { - return kStatus_InvalidArgument; - } - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - if (NULL == config) - { - handle->smartdmaApi = (uint8_t)kSMARTDMA_FlexIO_DMA; - } - else - { - if (config->inputPixelFormat == config->outputPixelFormat) - { - handle->smartdmaApi = (uint8_t)kSMARTDMA_FlexIO_DMA; - } - else if (((config->inputPixelFormat == kFLEXIO_MCULCD_RGB565) && - (config->outputPixelFormat == kFLEXIO_MCULCD_RGB888)) || - ((config->inputPixelFormat == kFLEXIO_MCULCD_BGR565) && - (config->outputPixelFormat == kFLEXIO_MCULCD_BGR888))) - { - handle->smartdmaApi = (uint8_t)kSMARTDMA_FlexIO_DMA_RGB565To888; - handle->needColorConvert = true; - } - else - { - return kStatus_InvalidArgument; - } - } - - /* Initialize the state. */ - handle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - - /* Register callback and userData. */ - handle->completionCallback = callback; - handle->userData = userData; - handle->base = base; - - SMARTDMA_InstallFirmware(SMARTDMA_DISPLAY_MEM_ADDR, s_smartdmaDisplayFirmware, SMARTDMA_DISPLAY_FIRMWARE_SIZE); - - SMARTDMA_InstallCallback(FLEXIO_MCULCD_SMARTDMA_Callback, handle); - - /* The shifter interrupt is used by the SMARTDMA. */ - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, (1UL << FLEXIO_MCULCD_SMARTDMA_TX_END_SHIFTER)); - -#if (defined(SMARTDMA_USE_FLEXIO_SHIFTER_DMA) && SMARTDMA_USE_FLEXIO_SHIFTER_DMA) - FLEXIO_EnableShifterStatusDMA(base->flexioBase, 1UL, true); -#endif - - return kStatus_Success; -} - -/*! - * brief Performs a non-blocking FlexIO MCULCD transfer using SMARTDMA. - * - * This function returns immediately after transfer initiates. Use the callback - * function to check whether the transfer is completed. - * - * param base pointer to FLEXIO_MCULCD_Type structure. - * param handle pointer to flexio_mculcd_smartdma_handle_t structure to store the - * transfer state. - * param xfer Pointer to FlexIO MCULCD transfer structure. - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_InvalidArgument Input argument is invalid. - * retval kStatus_FLEXIO_MCULCD_Busy FlexIO MCULCD is not idle, it is running another - * transfer. - */ -status_t FLEXIO_MCULCD_TransferSMARTDMA(FLEXIO_MCULCD_Type *base, - flexio_mculcd_smartdma_handle_t *handle, - flexio_mculcd_transfer_t *xfer) -{ - assert(handle != NULL); - assert(xfer != NULL); - - uint32_t part1Len, part2Len, part3Len; - - /* Check if the device is busy. */ - if ((uint32_t)kFLEXIO_MCULCD_StateIdle != handle->state) - { - return kStatus_FLEXIO_MCULCD_Busy; - } - - /* Only support write array. */ - if (kFLEXIO_MCULCD_WriteArray != xfer->mode) - { - return kStatus_InvalidArgument; - } - - FLEXIO_MCULCD_SMARTDMA_GetTxChunkLen(xfer->dataSize, xfer->dataAddrOrSameValue, &part1Len, &part2Len, &part3Len); - - handle->state = (uint32_t)kFLEXIO_MCULCD_StateWriteArray; - - /* Start transfer. */ - handle->remainingCount = xfer->dataSize; - handle->dataCount = xfer->dataSize; - handle->dataAddrOrSameValue = xfer->dataAddrOrSameValue; - - /* Assert the nCS. */ - FLEXIO_MCULCD_StartTransfer(base); - - if (!xfer->dataOnly) - { - /* Send the command. */ - FLEXIO_MCULCD_WriteCommandBlocking(base, xfer->command); - } - - if (part1Len > 0U) - { - if (handle->needColorConvert) - { - FLEXIO_MCULCD_RGB656ToRGB888((uint16_t *)xfer->dataAddrOrSameValue, part1Len >> 1U, - handle->blockingXferBuffer); - FLEXIO_MCULCD_WriteDataArrayBlocking(base, handle->blockingXferBuffer, (part1Len >> 1U) * 3U); - } - else - { - FLEXIO_MCULCD_WriteDataArrayBlocking(base, (void *)(uint8_t *)xfer->dataAddrOrSameValue, (size_t)part1Len); - } - handle->remainingCount -= part1Len; - handle->dataAddrOrSameValue += part1Len; - } - - if (0U == part2Len) - { - /* In this case, all data are sent out as part 1. Only notify upper layer here. */ - FLEXIO_MCULCD_StopTransfer(base); - handle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - - /* Callback to inform upper layer. */ - if (NULL != handle->completionCallback) - { - handle->completionCallback(base, handle, kStatus_FLEXIO_MCULCD_Idle, handle->userData); - } - } - else - { - /* For 6800, de-assert the RDWR pin. */ - if (kFLEXIO_MCULCD_6800 == base->busType) - { - base->setRDWRPin(false); - } - - FLEXIO_MCULCD_SetMultiBeatsWriteConfig(base); - - /* Save the part 3 information. */ - handle->dataCountUsingEzh = part2Len; - handle->dataAddrOrSameValue += part2Len; - - /* The part 3 is transfered using blocking method in ISR, convert the color - to save time in ISR. */ - if ((0U != part3Len) && (handle->needColorConvert)) - { - FLEXIO_MCULCD_RGB656ToRGB888((uint16_t *)xfer->dataAddrOrSameValue, part3Len >> 1U, - handle->blockingXferBuffer); - } - - handle->smartdmaParam.p_buffer = (uint32_t *)(xfer->dataAddrOrSameValue + part1Len); - handle->smartdmaParam.buffersize = part2Len; - handle->smartdmaParam.smartdma_stack = handle->smartdmaStack; - - SMARTDMA_Reset(); - SMARTDMA_Boot(handle->smartdmaApi, &(handle->smartdmaParam), 0); - } - - return kStatus_Success; -} - -/*! - * brief Aborts a FlexIO MCULCD transfer using SMARTDMA. - * - * param base pointer to FLEXIO_MCULCD_Type structure. - * param handle FlexIO MCULCD SMARTDMA handle pointer. - */ -void FLEXIO_MCULCD_TransferAbortSMARTDMA(FLEXIO_MCULCD_Type *base, flexio_mculcd_smartdma_handle_t *handle) -{ - assert(handle != NULL); - - SMARTDMA_Reset(); - - /* Set the handle state. */ - handle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - handle->dataCount = 0; -} - -/*! - * brief Gets the remaining bytes for FlexIO MCULCD SMARTDMA transfer. - * - * param base pointer to FLEXIO_MCULCD_Type structure. - * param handle FlexIO MCULCD SMARTDMA handle pointer. - * param count Number of count transferred so far by the SMARTDMA transaction. - * retval kStatus_Success Get the transferred count Successfully. - * retval kStatus_NoTransferInProgress No transfer in process. - */ -status_t FLEXIO_MCULCD_TransferGetCountSMARTDMA(FLEXIO_MCULCD_Type *base, - flexio_mculcd_smartdma_handle_t *handle, - size_t *count) -{ - assert(handle != NULL); - assert(count != NULL); - - uint32_t state = handle->state; - - if ((uint32_t)kFLEXIO_MCULCD_StateIdle == state) - { - return kStatus_NoTransferInProgress; - } - else - { - *count = handle->dataCount - handle->remainingCount; - } - - return kStatus_Success; -} - -static void FLEXIO_MCULCD_SMARTDMA_Callback(void *param) -{ - flexio_mculcd_smartdma_handle_t *flexioMculcdSmartDmaHandle = (flexio_mculcd_smartdma_handle_t *)param; - - FLEXIO_MCULCD_Type *flexioLcdMcuBase = flexioMculcdSmartDmaHandle->base; - - FLEXIO_MCULCD_WaitTransmitComplete(); - - /* Disable the TX shifter and the timer. */ - FLEXIO_MCULCD_ClearMultiBeatsWriteConfig(flexioLcdMcuBase); - - flexioMculcdSmartDmaHandle->remainingCount -= flexioMculcdSmartDmaHandle->dataCountUsingEzh; - - /* Send the part 3 */ - if (0U != flexioMculcdSmartDmaHandle->remainingCount) - { - if (flexioMculcdSmartDmaHandle->needColorConvert) - { - FLEXIO_MCULCD_WriteDataArrayBlocking(flexioLcdMcuBase, flexioMculcdSmartDmaHandle->blockingXferBuffer, - (flexioMculcdSmartDmaHandle->remainingCount >> 1U) * 3U); - } - else - { - FLEXIO_MCULCD_WriteDataArrayBlocking(flexioLcdMcuBase, - (void *)(uint8_t *)flexioMculcdSmartDmaHandle->dataAddrOrSameValue, - flexioMculcdSmartDmaHandle->remainingCount); - } - } - - flexioMculcdSmartDmaHandle->remainingCount = 0; - FLEXIO_MCULCD_StopTransfer(flexioLcdMcuBase); - flexioMculcdSmartDmaHandle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - - /* Callback to inform upper layer. */ - if (NULL != flexioMculcdSmartDmaHandle->completionCallback) - { - flexioMculcdSmartDmaHandle->completionCallback(flexioLcdMcuBase, flexioMculcdSmartDmaHandle, - kStatus_FLEXIO_MCULCD_Idle, - flexioMculcdSmartDmaHandle->userData); - } -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_mculcd_smartdma.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_mculcd_smartdma.h deleted file mode 100644 index 3500aaaed0e..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_mculcd_smartdma.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright 2019,2021,2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_FLEXIO_MCULCD_SMARTDMA_H_ -#define FSL_FLEXIO_MCULCD_SMARTDMA_H_ - -#include "fsl_smartdma.h" -#include "fsl_flexio_mculcd.h" - -/*! - * @addtogroup flexio_smartdma_mculcd - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*@{*/ -/*! @brief FlexIO MCULCD SMARTDMA driver version. */ -#define FSL_FLEXIO_MCULCD_SMARTDMA_DRIVER_VERSION (MAKE_VERSION(2, 0, 4)) -/*@}*/ - -/*! @brief SMARTDMA transfer size should be multiple of 64 bytes. */ -#define FLEXIO_MCULCD_SMARTDMA_TX_LEN_ALIGN 64U - -/*! @brief SMARTDMA transfer memory address should be 4 byte aligned. */ -#define FLEXIO_MCULCD_SMARTDMA_TX_ADDR_ALIGN 4U - -/*! @brief typedef for flexio_mculcd_smartdma_handle_t in advance. */ -typedef struct _flexio_mculcd_smartdma_handle flexio_mculcd_smartdma_handle_t; - -/*! @brief FlexIO MCULCD master callback for transfer complete. - * - * When transfer finished, the callback function is called and returns the - * @p status as kStatus_FLEXIO_MCULCD_Idle. - */ -typedef void (*flexio_mculcd_smartdma_transfer_callback_t)(FLEXIO_MCULCD_Type *base, - flexio_mculcd_smartdma_handle_t *handle, - status_t status, - void *userData); - -/*! @brief FlexIO MCULCD SMARTDMA transfer handle, users should not touch the - * content of the handle.*/ -struct _flexio_mculcd_smartdma_handle -{ - FLEXIO_MCULCD_Type *base; /*!< Pointer to the FLEXIO_MCULCD_Type. */ - size_t dataCount; /*!< Total count to be transferred. */ - uint32_t dataAddrOrSameValue; /*!< When sending the same value for many times, - this is the value to send. When writing or reading array, - this is the address of the data array. */ - size_t dataCountUsingEzh; /*!< Data transfered using SMARTDMA. */ - volatile size_t remainingCount; /*!< Remaining count to transfer. */ - volatile uint32_t state; /*!< FlexIO MCULCD driver internal state. */ - uint8_t smartdmaApi; /*!< The SMARTDMA API used during transfer. */ - bool needColorConvert; /*!< Need color convert or not. */ - uint8_t blockingXferBuffer[FLEXIO_MCULCD_SMARTDMA_TX_LEN_ALIGN * 3 / - 2]; /*!< Used for blocking method color space convet. */ - flexio_mculcd_smartdma_transfer_callback_t completionCallback; /*!< Callback for MCULCD SMARTDMA transfer */ - void *userData; /*!< User Data for MCULCD SMARTDMA callback */ - smartdma_flexio_mculcd_param_t smartdmaParam; /*!< SMARTDMA function parameters. */ - uint32_t smartdmaStack[1]; /*!< SMARTDMA function stack. */ -}; - -/*! @brief FlexIO MCULCD SMARTDMA configuration. */ -typedef struct _flexio_mculcd_smartdma_config -{ - flexio_mculcd_pixel_format_t inputPixelFormat; /*!< The pixel format in the frame buffer. */ - flexio_mculcd_pixel_format_t outputPixelFormat; /*!< The pixel format on the 8080/68k bus. */ -} flexio_mculcd_smartdma_config_t; - -/******************************************************************************* - * APIs - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name SMARTDMA Transactional - * @{ - */ - -/*! - * @brief Initializes the FLEXO MCULCD master SMARTDMA handle. - * - * This function initializes the FLEXO MCULCD master SMARTDMA handle which can be - * used for other FLEXO MCULCD transactional APIs. For a specified FLEXO MCULCD - * instance, call this API once to get the initialized handle. - * - * @param base Pointer to FLEXIO_MCULCD_Type structure. - * @param handle Pointer to flexio_mculcd_smartdma_handle_t structure to store the - * transfer state. - * @param config Pointer to the configuration. - * @param callback MCULCD transfer complete callback, NULL means no callback. - * @param userData callback function parameter. - * @retval kStatus_Success Successfully create the handle. - */ -status_t FLEXIO_MCULCD_TransferCreateHandleSMARTDMA(FLEXIO_MCULCD_Type *base, - flexio_mculcd_smartdma_handle_t *handle, - const flexio_mculcd_smartdma_config_t *config, - flexio_mculcd_smartdma_transfer_callback_t callback, - void *userData); - -/*! - * @brief Performs a non-blocking FlexIO MCULCD transfer using SMARTDMA. - * - * This function returns immediately after transfer initiates. Use the callback - * function to check whether the transfer is completed. - * - * @param base pointer to FLEXIO_MCULCD_Type structure. - * @param handle pointer to flexio_mculcd_smartdma_handle_t structure to store the - * transfer state. - * @param xfer Pointer to FlexIO MCULCD transfer structure. - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_InvalidArgument Input argument is invalid. - * @retval kStatus_FLEXIO_MCULCD_Busy FlexIO MCULCD is not idle, it is running another - * transfer. - */ -status_t FLEXIO_MCULCD_TransferSMARTDMA(FLEXIO_MCULCD_Type *base, - flexio_mculcd_smartdma_handle_t *handle, - flexio_mculcd_transfer_t *xfer); - -/*! - * @brief Aborts a FlexIO MCULCD transfer using SMARTDMA. - * - * @param base pointer to FLEXIO_MCULCD_Type structure. - * @param handle FlexIO MCULCD SMARTDMA handle pointer. - */ -void FLEXIO_MCULCD_TransferAbortSMARTDMA(FLEXIO_MCULCD_Type *base, flexio_mculcd_smartdma_handle_t *handle); - -/*! - * @brief Gets the remaining bytes for FlexIO MCULCD SMARTDMA transfer. - * - * @param base pointer to FLEXIO_MCULCD_Type structure. - * @param handle FlexIO MCULCD SMARTDMA handle pointer. - * @param count Number of count transferred so far by the SMARTDMA transaction. - * @retval kStatus_Success Get the transferred count Successfully. - * @retval kStatus_NoTransferInProgress No transfer in process. - */ -status_t FLEXIO_MCULCD_TransferGetCountSMARTDMA(FLEXIO_MCULCD_Type *base, - flexio_mculcd_smartdma_handle_t *handle, - size_t *count); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ -#endif /* FSL_FLEXIO_MCULCD_SMARTDMA_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_spi.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_spi.c deleted file mode 100644 index eaf70de644e..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_spi.c +++ /dev/null @@ -1,1565 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020, 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio_spi.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio_spi" -#endif - -/*! @brief FLEXIO SPI transfer state, which is used for SPI transactiaonl APIs' internal state. */ -enum _flexio_spi_transfer_states -{ - kFLEXIO_SPI_Idle = 0x0U, /*!< Nothing in the transmitter/receiver's queue. */ - kFLEXIO_SPI_Busy, /*!< Transmiter/Receive's queue is not finished. */ -}; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Send a piece of data for SPI. - * - * This function computes the number of data to be written into D register or Tx FIFO, - * and write the data into it. At the same time, this function updates the values in - * master handle structure. - * - * @param base pointer to FLEXIO_SPI_Type structure - * @param handle Pointer to SPI master handle structure. - */ -static void FLEXIO_SPI_TransferSendTransaction(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle); - -/*! - * @brief Receive a piece of data for SPI master. - * - * This function computes the number of data to receive from D register or Rx FIFO, - * and write the data to destination address. At the same time, this function updates - * the values in master handle structure. - * - * @param base pointer to FLEXIO_SPI_Type structure - * @param handle Pointer to SPI master handle structure. - */ -static void FLEXIO_SPI_TransferReceiveTransaction(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle); - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Codes - ******************************************************************************/ - -static uint32_t FLEXIO_SPI_GetInstance(FLEXIO_SPI_Type *base) -{ - return FLEXIO_GetInstance(base->flexioBase); -} - -static void FLEXIO_SPI_TransferSendTransaction(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle) -{ - uint32_t tmpData = FLEXIO_SPI_DUMMYDATA; - - if (handle->txData != NULL) - { - /* Transmit data and update tx size/buff. */ - if (handle->bytePerFrame == 1U) - { - tmpData = (uint32_t) * (handle->txData); - handle->txData++; - } - else if (handle->bytePerFrame == 2U) - { - if (handle->direction == kFLEXIO_SPI_MsbFirst) - { - tmpData = (uint32_t)(handle->txData[0]) << 8U; - tmpData += (uint32_t)handle->txData[1]; - } - else - { - tmpData = (uint32_t)(handle->txData[1]) << 8U; - tmpData += (uint32_t)handle->txData[0]; - } - handle->txData += 2U; - } - else - { - if (handle->direction == kFLEXIO_SPI_MsbFirst) - { - tmpData = (uint32_t)(handle->txData[0]) << 24U; - tmpData += (uint32_t)(handle->txData[1]) << 16U; - tmpData += (uint32_t)(handle->txData[2]) << 8U; - tmpData += (uint32_t)handle->txData[3]; - } - else - { - tmpData = (uint32_t)(handle->txData[3]) << 24U; - tmpData += (uint32_t)(handle->txData[2]) << 16U; - tmpData += (uint32_t)(handle->txData[1]) << 8U; - tmpData += (uint32_t)handle->txData[0]; - } - handle->txData += 4U; - } - } - else - { - tmpData = FLEXIO_SPI_DUMMYDATA; - } - - handle->txRemainingBytes -= handle->bytePerFrame; - - FLEXIO_SPI_WriteData(base, handle->direction, tmpData); - - if (0U == handle->txRemainingBytes) - { - FLEXIO_SPI_DisableInterrupts(base, (uint32_t)kFLEXIO_SPI_TxEmptyInterruptEnable); - } -} - -static void FLEXIO_SPI_TransferReceiveTransaction(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle) -{ - uint32_t tmpData; - - tmpData = FLEXIO_SPI_ReadData(base, handle->direction); - - if (handle->rxData != NULL) - { - if (handle->bytePerFrame == 1U) - { - *handle->rxData = (uint8_t)tmpData; - } - else if (handle->bytePerFrame == 2U) - { - if (handle->direction == kFLEXIO_SPI_LsbFirst) - { - *handle->rxData = (uint8_t)(tmpData >> 8); - handle->rxData++; - *handle->rxData = (uint8_t)tmpData; - } - else - { - *handle->rxData = (uint8_t)tmpData; - handle->rxData++; - *handle->rxData = (uint8_t)(tmpData >> 8); - } - } - else - { - if (handle->direction == kFLEXIO_SPI_LsbFirst) - { - *handle->rxData = (uint8_t)(tmpData >> 24U); - handle->rxData++; - *handle->rxData = (uint8_t)(tmpData >> 16U); - handle->rxData++; - *handle->rxData = (uint8_t)(tmpData >> 8U); - handle->rxData++; - *handle->rxData = (uint8_t)tmpData; - } - else - { - *handle->rxData = (uint8_t)tmpData; - handle->rxData++; - *handle->rxData = (uint8_t)(tmpData >> 8U); - handle->rxData++; - *handle->rxData = (uint8_t)(tmpData >> 16U); - handle->rxData++; - *handle->rxData = (uint8_t)(tmpData >> 24U); - } - } - handle->rxData++; - } - handle->rxRemainingBytes -= handle->bytePerFrame; -} - -/*! - * brief Ungates the FlexIO clock, resets the FlexIO module, configures the FlexIO SPI master hardware, - * and configures the FlexIO SPI with FlexIO SPI master configuration. The - * configuration structure can be filled by the user, or be set with default values - * by the FLEXIO_SPI_MasterGetDefaultConfig(). - * - * note 1.FlexIO SPI master only support CPOL = 0, which means clock inactive low. - * 2.For FlexIO SPI master, the input valid time is 1.5 clock cycles, for slave the output valid time - * is 2.5 clock cycles. So if FlexIO SPI master communicates with other spi IPs, the maximum baud - * rate is FlexIO clock frequency divided by 2*2=4. If FlexIO SPI master communicates with FlexIO - * SPI slave, the maximum baud rate is FlexIO clock frequency divided by (1.5+2.5)*2=8. - * - * Example - code - FLEXIO_SPI_Type spiDev = { - .flexioBase = FLEXIO, - .SDOPinIndex = 0, - .SDIPinIndex = 1, - .SCKPinIndex = 2, - .CSnPinIndex = 3, - .shifterIndex = {0,1}, - .timerIndex = {0,1} - }; - flexio_spi_master_config_t config = { - .enableMaster = true, - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .baudRate_Bps = 500000, - .phase = kFLEXIO_SPI_ClockPhaseFirstEdge, - .direction = kFLEXIO_SPI_MsbFirst, - .dataMode = kFLEXIO_SPI_8BitMode - }; - FLEXIO_SPI_MasterInit(&spiDev, &config, srcClock_Hz); - endcode - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param masterConfig Pointer to the flexio_spi_master_config_t structure. - * param srcClock_Hz FlexIO source clock in Hz. -*/ -void FLEXIO_SPI_MasterInit(FLEXIO_SPI_Type *base, flexio_spi_master_config_t *masterConfig, uint32_t srcClock_Hz) -{ - assert(base != NULL); - assert(masterConfig != NULL); - - flexio_shifter_config_t shifterConfig; - flexio_timer_config_t timerConfig; - uint32_t ctrlReg = 0; - uint16_t timerDiv = 0; - uint16_t timerCmp = 0; - - /* Clear the shifterConfig & timerConfig struct. */ - (void)memset(&shifterConfig, 0, sizeof(shifterConfig)); - (void)memset(&timerConfig, 0, sizeof(timerConfig)); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate flexio clock. */ - CLOCK_EnableClock(s_flexioClocks[FLEXIO_SPI_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Configure FLEXIO SPI Master */ - ctrlReg = base->flexioBase->CTRL; - ctrlReg &= ~(FLEXIO_CTRL_DOZEN_MASK | FLEXIO_CTRL_DBGE_MASK | FLEXIO_CTRL_FASTACC_MASK | FLEXIO_CTRL_FLEXEN_MASK); - ctrlReg |= (FLEXIO_CTRL_DBGE(masterConfig->enableInDebug) | FLEXIO_CTRL_FASTACC(masterConfig->enableFastAccess) | - FLEXIO_CTRL_FLEXEN(masterConfig->enableMaster)); - if (!masterConfig->enableInDoze) - { - ctrlReg |= FLEXIO_CTRL_DOZEN_MASK; - } - - base->flexioBase->CTRL = ctrlReg; - - /* Do hardware configuration. */ - /* 1. Configure the shifter 0 for tx. */ - shifterConfig.timerSelect = base->timerIndex[0]; - shifterConfig.pinConfig = kFLEXIO_PinConfigOutput; - shifterConfig.pinSelect = base->SDOPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveHigh; - shifterConfig.shifterMode = kFLEXIO_ShifterModeTransmit; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - if (masterConfig->phase == kFLEXIO_SPI_ClockPhaseFirstEdge) - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnNegitive; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitDisable; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnEnable; - } - else - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitLow; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnShift; - } - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[0], &shifterConfig); - - /* 2. Configure the shifter 1 for rx. */ - shifterConfig.timerSelect = base->timerIndex[0]; - shifterConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - shifterConfig.pinSelect = base->SDIPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveHigh; - shifterConfig.shifterMode = kFLEXIO_ShifterModeReceive; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitDisable; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnEnable; - if (masterConfig->phase == kFLEXIO_SPI_ClockPhaseFirstEdge) - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive; - } - else - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnNegitive; - } - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[1], &shifterConfig); - - /*3. Configure the timer 0 for SCK. */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->shifterIndex[0]); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOutput; - timerConfig.pinSelect = base->SCKPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveHigh; - timerConfig.timerMode = kFLEXIO_TimerModeDual8BitBaudBit; - timerConfig.timerOutput = kFLEXIO_TimerOutputZeroNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput; - timerConfig.timerReset = kFLEXIO_TimerResetNever; - timerConfig.timerDisable = kFLEXIO_TimerDisableOnTimerCompare; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnTriggerHigh; - timerConfig.timerStop = kFLEXIO_TimerStopBitEnableOnTimerDisable; - timerConfig.timerStart = kFLEXIO_TimerStartBitEnabled; - /* Low 8-bits are used to configure baudrate. */ - timerDiv = (uint16_t)(srcClock_Hz / masterConfig->baudRate_Bps); - timerDiv = timerDiv / 2U - 1U; - /* High 8-bits are used to configure shift clock edges(transfer width). */ - timerCmp = ((uint16_t)masterConfig->dataMode * 2U - 1U) << 8U; - timerCmp |= timerDiv; - - timerConfig.timerCompare = timerCmp; - - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[0], &timerConfig); - - /* 4. Configure the timer 1 for CSn. */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_TIMn(base->timerIndex[0]); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveHigh; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOutput; - timerConfig.pinSelect = base->CSnPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveLow; - timerConfig.timerMode = kFLEXIO_TimerModeSingle16Bit; - timerConfig.timerOutput = kFLEXIO_TimerOutputOneNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput; - timerConfig.timerReset = kFLEXIO_TimerResetNever; - timerConfig.timerDisable = kFLEXIO_TimerDisableOnPreTimerDisable; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnPrevTimerEnable; - timerConfig.timerStop = kFLEXIO_TimerStopBitDisabled; - timerConfig.timerStart = kFLEXIO_TimerStartBitDisabled; - - timerConfig.timerCompare = 0xFFFFU; /* Never compare. */ - - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[1], &timerConfig); -} - -/*! - * brief Resets the FlexIO SPI timer and shifter config. - * - * param base Pointer to the FLEXIO_SPI_Type. - */ -void FLEXIO_SPI_MasterDeinit(FLEXIO_SPI_Type *base) -{ - base->flexioBase->SHIFTCFG[base->shifterIndex[0]] = 0; - base->flexioBase->SHIFTCTL[base->shifterIndex[0]] = 0; - base->flexioBase->SHIFTCFG[base->shifterIndex[1]] = 0; - base->flexioBase->SHIFTCTL[base->shifterIndex[1]] = 0; - base->flexioBase->TIMCFG[base->timerIndex[0]] = 0; - base->flexioBase->TIMCMP[base->timerIndex[0]] = 0; - base->flexioBase->TIMCTL[base->timerIndex[0]] = 0; - base->flexioBase->TIMCFG[base->timerIndex[1]] = 0; - base->flexioBase->TIMCMP[base->timerIndex[1]] = 0; - base->flexioBase->TIMCTL[base->timerIndex[1]] = 0; -} - -/*! - * brief Gets the default configuration to configure the FlexIO SPI master. The configuration - * can be used directly by calling the FLEXIO_SPI_MasterConfigure(). - * Example: - code - flexio_spi_master_config_t masterConfig; - FLEXIO_SPI_MasterGetDefaultConfig(&masterConfig); - endcode - * param masterConfig Pointer to the flexio_spi_master_config_t structure. -*/ -void FLEXIO_SPI_MasterGetDefaultConfig(flexio_spi_master_config_t *masterConfig) -{ - assert(masterConfig != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(masterConfig, 0, sizeof(*masterConfig)); - - masterConfig->enableMaster = true; - masterConfig->enableInDoze = false; - masterConfig->enableInDebug = true; - masterConfig->enableFastAccess = false; - /* Default baud rate 500kbps. */ - masterConfig->baudRate_Bps = 500000U; - /* Default CPHA = 0. */ - masterConfig->phase = kFLEXIO_SPI_ClockPhaseFirstEdge; - /* Default bit count at 8. */ - masterConfig->dataMode = kFLEXIO_SPI_8BitMode; -} - -/*! - * brief Ungates the FlexIO clock, resets the FlexIO module, configures the FlexIO SPI slave hardware - * configuration, and configures the FlexIO SPI with FlexIO SPI slave configuration. The - * configuration structure can be filled by the user, or be set with default values - * by the FLEXIO_SPI_SlaveGetDefaultConfig(). - * - * note 1.Only one timer is needed in the FlexIO SPI slave. As a result, the second timer index is ignored. - * 2.FlexIO SPI slave only support CPOL = 0, which means clock inactive low. - * 3.For FlexIO SPI master, the input valid time is 1.5 clock cycles, for slave the output valid time - * is 2.5 clock cycles. So if FlexIO SPI slave communicates with other spi IPs, the maximum baud - * rate is FlexIO clock frequency divided by 3*2=6. If FlexIO SPI slave communicates with FlexIO - * SPI master, the maximum baud rate is FlexIO clock frequency divided by (1.5+2.5)*2=8. - * Example - code - FLEXIO_SPI_Type spiDev = { - .flexioBase = FLEXIO, - .SDOPinIndex = 0, - .SDIPinIndex = 1, - .SCKPinIndex = 2, - .CSnPinIndex = 3, - .shifterIndex = {0,1}, - .timerIndex = {0} - }; - flexio_spi_slave_config_t config = { - .enableSlave = true, - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .phase = kFLEXIO_SPI_ClockPhaseFirstEdge, - .direction = kFLEXIO_SPI_MsbFirst, - .dataMode = kFLEXIO_SPI_8BitMode - }; - FLEXIO_SPI_SlaveInit(&spiDev, &config); - endcode - * param base Pointer to the FLEXIO_SPI_Type structure. - * param slaveConfig Pointer to the flexio_spi_slave_config_t structure. -*/ -void FLEXIO_SPI_SlaveInit(FLEXIO_SPI_Type *base, flexio_spi_slave_config_t *slaveConfig) -{ - assert((base != NULL) && (slaveConfig != NULL)); - - flexio_shifter_config_t shifterConfig; - flexio_timer_config_t timerConfig; - uint32_t ctrlReg = 0; - - /* Clear the shifterConfig & timerConfig struct. */ - (void)memset(&shifterConfig, 0, sizeof(shifterConfig)); - (void)memset(&timerConfig, 0, sizeof(timerConfig)); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate flexio clock. */ - CLOCK_EnableClock(s_flexioClocks[FLEXIO_SPI_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Configure FLEXIO SPI Slave */ - ctrlReg = base->flexioBase->CTRL; - ctrlReg &= ~(FLEXIO_CTRL_DOZEN_MASK | FLEXIO_CTRL_DBGE_MASK | FLEXIO_CTRL_FASTACC_MASK | FLEXIO_CTRL_FLEXEN_MASK); - ctrlReg |= (FLEXIO_CTRL_DBGE(slaveConfig->enableInDebug) | FLEXIO_CTRL_FASTACC(slaveConfig->enableFastAccess) | - FLEXIO_CTRL_FLEXEN(slaveConfig->enableSlave)); - if (!slaveConfig->enableInDoze) - { - ctrlReg |= FLEXIO_CTRL_DOZEN_MASK; - } - - base->flexioBase->CTRL = ctrlReg; - - /* Do hardware configuration. */ - /* 1. Configure the shifter 0 for tx. */ - shifterConfig.timerSelect = base->timerIndex[0]; - shifterConfig.pinConfig = kFLEXIO_PinConfigOutput; - shifterConfig.pinSelect = base->SDOPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveHigh; - shifterConfig.shifterMode = kFLEXIO_ShifterModeTransmit; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitDisable; - if (slaveConfig->phase == kFLEXIO_SPI_ClockPhaseFirstEdge) - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnNegitive; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnEnable; - } - else - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnShift; - } - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[0], &shifterConfig); - - /* 2. Configure the shifter 1 for rx. */ - shifterConfig.timerSelect = base->timerIndex[0]; - shifterConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - shifterConfig.pinSelect = base->SDIPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveHigh; - shifterConfig.shifterMode = kFLEXIO_ShifterModeReceive; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitDisable; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnEnable; - if (slaveConfig->phase == kFLEXIO_SPI_ClockPhaseFirstEdge) - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive; - } - else - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnNegitive; - } - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[1], &shifterConfig); - - /*3. Configure the timer 0 for shift clock. */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_PININPUT(base->CSnPinIndex); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - timerConfig.pinSelect = base->SCKPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveHigh; - timerConfig.timerMode = kFLEXIO_TimerModeSingle16Bit; - timerConfig.timerOutput = kFLEXIO_TimerOutputZeroNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnPinInputShiftPinInput; - timerConfig.timerReset = kFLEXIO_TimerResetNever; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnTriggerRisingEdge; - timerConfig.timerStop = kFLEXIO_TimerStopBitDisabled; - if (slaveConfig->phase == kFLEXIO_SPI_ClockPhaseFirstEdge) - { - timerConfig.timerDisable = kFLEXIO_TimerDisableOnTimerCompare; - timerConfig.timerStart = kFLEXIO_TimerStartBitDisabled; - } - else - { - timerConfig.timerDisable = kFLEXIO_TimerDisableOnTriggerFallingEdge; - timerConfig.timerStart = kFLEXIO_TimerStartBitEnabled; - } - - timerConfig.timerCompare = (uint32_t)slaveConfig->dataMode * 2U - 1U; - - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[0], &timerConfig); -} - -/*! - * brief Gates the FlexIO clock. - * - * param base Pointer to the FLEXIO_SPI_Type. - */ -void FLEXIO_SPI_SlaveDeinit(FLEXIO_SPI_Type *base) -{ - FLEXIO_SPI_MasterDeinit(base); -} - -/*! - * brief Gets the default configuration to configure the FlexIO SPI slave. The configuration - * can be used directly for calling the FLEXIO_SPI_SlaveConfigure(). - * Example: - code - flexio_spi_slave_config_t slaveConfig; - FLEXIO_SPI_SlaveGetDefaultConfig(&slaveConfig); - endcode - * param slaveConfig Pointer to the flexio_spi_slave_config_t structure. -*/ -void FLEXIO_SPI_SlaveGetDefaultConfig(flexio_spi_slave_config_t *slaveConfig) -{ - assert(slaveConfig != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(slaveConfig, 0, sizeof(*slaveConfig)); - - slaveConfig->enableSlave = true; - slaveConfig->enableInDoze = false; - slaveConfig->enableInDebug = true; - slaveConfig->enableFastAccess = false; - /* Default CPHA = 0. */ - slaveConfig->phase = kFLEXIO_SPI_ClockPhaseFirstEdge; - /* Default bit count at 8. */ - slaveConfig->dataMode = kFLEXIO_SPI_8BitMode; -} - -/*! - * brief Enables the FlexIO SPI interrupt. - * - * This function enables the FlexIO SPI interrupt. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param mask interrupt source. The parameter can be any combination of the following values: - * arg kFLEXIO_SPI_RxFullInterruptEnable - * arg kFLEXIO_SPI_TxEmptyInterruptEnable - */ -void FLEXIO_SPI_EnableInterrupts(FLEXIO_SPI_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_SPI_TxEmptyInterruptEnable) != 0U) - { - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_SPI_RxFullInterruptEnable) != 0U) - { - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Disables the FlexIO SPI interrupt. - * - * This function disables the FlexIO SPI interrupt. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param mask interrupt source The parameter can be any combination of the following values: - * arg kFLEXIO_SPI_RxFullInterruptEnable - * arg kFLEXIO_SPI_TxEmptyInterruptEnable - */ -void FLEXIO_SPI_DisableInterrupts(FLEXIO_SPI_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_SPI_TxEmptyInterruptEnable) != 0U) - { - FLEXIO_DisableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_SPI_RxFullInterruptEnable) != 0U) - { - FLEXIO_DisableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Enables/disables the FlexIO SPI transmit DMA. This function enables/disables the FlexIO SPI Tx DMA, - * which means that asserting the kFLEXIO_SPI_TxEmptyFlag does/doesn't trigger the DMA request. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param mask SPI DMA source. - * param enable True means enable DMA, false means disable DMA. - */ -void FLEXIO_SPI_EnableDMA(FLEXIO_SPI_Type *base, uint32_t mask, bool enable) -{ - if ((mask & (uint32_t)kFLEXIO_SPI_TxDmaEnable) != 0U) - { - FLEXIO_EnableShifterStatusDMA(base->flexioBase, 1UL << base->shifterIndex[0], enable); - } - - if ((mask & (uint32_t)kFLEXIO_SPI_RxDmaEnable) != 0U) - { - FLEXIO_EnableShifterStatusDMA(base->flexioBase, 1UL << base->shifterIndex[1], enable); - } -} - -/*! - * brief Gets FlexIO SPI status flags. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * return status flag; Use the status flag to AND the following flag mask and get the status. - * arg kFLEXIO_SPI_TxEmptyFlag - * arg kFLEXIO_SPI_RxEmptyFlag - */ - -uint32_t FLEXIO_SPI_GetStatusFlags(FLEXIO_SPI_Type *base) -{ - uint32_t shifterStatus = FLEXIO_GetShifterStatusFlags(base->flexioBase); - uint32_t status = 0; - - status = ((shifterStatus & (1UL << base->shifterIndex[0])) >> base->shifterIndex[0]); - status |= (((shifterStatus & (1UL << base->shifterIndex[1])) >> (base->shifterIndex[1])) << 1U); - - return status; -} - -/*! - * brief Clears FlexIO SPI status flags. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param mask status flag - * The parameter can be any combination of the following values: - * arg kFLEXIO_SPI_TxEmptyFlag - * arg kFLEXIO_SPI_RxEmptyFlag - */ - -void FLEXIO_SPI_ClearStatusFlags(FLEXIO_SPI_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag) != 0U) - { - FLEXIO_ClearShifterStatusFlags(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_SPI_RxBufferFullFlag) != 0U) - { - FLEXIO_ClearShifterStatusFlags(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Sets baud rate for the FlexIO SPI transfer, which is only used for the master. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param baudRate_Bps Baud Rate needed in Hz. - * param srcClockHz SPI source clock frequency in Hz. - */ -void FLEXIO_SPI_MasterSetBaudRate(FLEXIO_SPI_Type *base, uint32_t baudRate_Bps, uint32_t srcClockHz) -{ - uint16_t timerDiv = 0; - uint16_t timerCmp = 0; - FLEXIO_Type *flexioBase = base->flexioBase; - - /* Set TIMCMP[7:0] = (baud rate divider / 2) - 1.*/ - timerDiv = (uint16_t)(srcClockHz / baudRate_Bps); - timerDiv = timerDiv / 2U - 1U; - - timerCmp = (uint16_t)(flexioBase->TIMCMP[base->timerIndex[0]]); - timerCmp &= 0xFF00U; - timerCmp |= timerDiv; - - flexioBase->TIMCMP[base->timerIndex[0]] = timerCmp; -} - -/*! - * brief Sends a buffer of data bytes. - * - * note This function blocks using the polling method until all bytes have been sent. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param direction Shift direction of MSB first or LSB first. - * param buffer The data bytes to send. - * param size The number of data bytes to send. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_FLEXIO_SPI_Timeout The transfer timed out and was aborted. - */ -status_t FLEXIO_SPI_WriteBlocking(FLEXIO_SPI_Type *base, - flexio_spi_shift_direction_t direction, - const uint8_t *buffer, - size_t size) -{ - assert(buffer != NULL); - assert(size != 0U); - -#if SPI_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != size--) - { - /* Wait until data transfer complete. */ -#if SPI_RETRY_TIMES - waitTimes = SPI_RETRY_TIMES; - while ((0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag)) && - (0U != --waitTimes)) -#else - while (0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag)) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return kStatus_FLEXIO_SPI_Timeout; - } -#endif - FLEXIO_SPI_WriteData(base, direction, *buffer++); - } - - return kStatus_Success; -} - -/*! - * brief Receives a buffer of bytes. - * - * note This function blocks using the polling method until all bytes have been received. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param direction Shift direction of MSB first or LSB first. - * param buffer The buffer to store the received bytes. - * param size The number of data bytes to be received. - * param direction Shift direction of MSB first or LSB first. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_FLEXIO_SPI_Timeout The transfer timed out and was aborted. - */ -status_t FLEXIO_SPI_ReadBlocking(FLEXIO_SPI_Type *base, - flexio_spi_shift_direction_t direction, - uint8_t *buffer, - size_t size) -{ - assert(buffer != NULL); - assert(size != 0U); - -#if SPI_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != size--) - { - /* Wait until data transfer complete. */ -#if SPI_RETRY_TIMES - waitTimes = SPI_RETRY_TIMES; - while ((0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_RxBufferFullFlag)) && - (0U != --waitTimes)) -#else - while (0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_RxBufferFullFlag)) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return kStatus_FLEXIO_SPI_Timeout; - } -#endif - *buffer++ = (uint8_t)FLEXIO_SPI_ReadData(base, direction); - } - - return kStatus_Success; -} - -/*! - * brief Receives a buffer of bytes. - * - * note This function blocks via polling until all bytes have been received. - * - * param base pointer to FLEXIO_SPI_Type structure - * param xfer FlexIO SPI transfer structure, see #flexio_spi_transfer_t. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_FLEXIO_SPI_Timeout The transfer timed out and was aborted. - */ -status_t FLEXIO_SPI_MasterTransferBlocking(FLEXIO_SPI_Type *base, flexio_spi_transfer_t *xfer) -{ - flexio_spi_shift_direction_t direction; - uint8_t bytesPerFrame; - uint32_t dataMode = 0; - uint16_t timerCmp = (uint16_t)(base->flexioBase->TIMCMP[base->timerIndex[0]]); - uint32_t tmpData = FLEXIO_SPI_DUMMYDATA; - uint8_t dataFormat = FLEXIO_SPI_XFER_DATA_FORMAT(xfer->flags); -#if SPI_RETRY_TIMES - uint32_t waitTimes; -#endif - - timerCmp &= 0x00FFU; - - if ((xfer->flags & (uint8_t)kFLEXIO_SPI_csContinuous) != 0U) - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TSTOP_MASK) | - FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitDisabled); - } - else - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TSTOP_MASK) | - FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitEnableOnTimerDisable); - } - - /* Configure the values in handle. */ - switch (dataFormat) - { - case (uint8_t)kFLEXIO_SPI_8bitMsb: - dataMode = (8UL * 2UL - 1UL) << 8U; - bytesPerFrame = 1U; - direction = kFLEXIO_SPI_MsbFirst; - break; - - case (uint8_t)kFLEXIO_SPI_8bitLsb: - dataMode = (8UL * 2UL - 1UL) << 8U; - bytesPerFrame = 1U; - direction = kFLEXIO_SPI_LsbFirst; - break; - - case (uint8_t)kFLEXIO_SPI_16bitMsb: - dataMode = (16UL * 2UL - 1UL) << 8U; - bytesPerFrame = 2U; - direction = kFLEXIO_SPI_MsbFirst; - break; - - case (uint8_t)kFLEXIO_SPI_16bitLsb: - dataMode = (16UL * 2UL - 1UL) << 8U; - bytesPerFrame = 2U; - direction = kFLEXIO_SPI_LsbFirst; - break; - - case (uint8_t)kFLEXIO_SPI_32bitMsb: - dataMode = (32UL * 2UL - 1UL) << 8U; - bytesPerFrame = 4U; - direction = kFLEXIO_SPI_MsbFirst; - break; - - case (uint8_t)kFLEXIO_SPI_32bitLsb: - dataMode = (32UL * 2UL - 1UL) << 8U; - bytesPerFrame = 4U; - direction = kFLEXIO_SPI_LsbFirst; - break; - - default: - dataMode = (8UL * 2UL - 1UL) << 8U; - bytesPerFrame = 1U; - direction = kFLEXIO_SPI_MsbFirst; - assert(true); - break; - } - - dataMode |= timerCmp; - - /* Transfer size should be bytesPerFrame divisible. */ - if ((xfer->dataSize % bytesPerFrame) != 0U) - { - return kStatus_InvalidArgument; - } - - /* Configure transfer size. */ - base->flexioBase->TIMCMP[base->timerIndex[0]] = dataMode; - - while (xfer->dataSize != 0U) - { - /* Wait until data transfer complete. */ -#if SPI_RETRY_TIMES - waitTimes = SPI_RETRY_TIMES; - while ((0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag)) && - (0U != --waitTimes)) -#else - while (0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag)) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return kStatus_FLEXIO_SPI_Timeout; - } -#endif - if (xfer->txData != NULL) - { - /* Transmit data and update tx size/buff. */ - if (bytesPerFrame == 1U) - { - tmpData = (uint32_t) * (xfer->txData); - xfer->txData++; - } - else if (bytesPerFrame == 2U) - { - if (direction == kFLEXIO_SPI_MsbFirst) - { - tmpData = (uint32_t)(xfer->txData[0]) << 8U; - tmpData += (uint32_t)xfer->txData[1]; - } - else - { - tmpData = (uint32_t)(xfer->txData[1]) << 8U; - tmpData += (uint32_t)xfer->txData[0]; - } - xfer->txData += 2U; - } - else - { - if (direction == kFLEXIO_SPI_MsbFirst) - { - tmpData = (uint32_t)(xfer->txData[0]) << 24U; - tmpData += (uint32_t)(xfer->txData[1]) << 16U; - tmpData += (uint32_t)(xfer->txData[2]) << 8U; - tmpData += (uint32_t)xfer->txData[3]; - } - else - { - tmpData = (uint32_t)(xfer->txData[3]) << 24U; - tmpData += (uint32_t)(xfer->txData[2]) << 16U; - tmpData += (uint32_t)(xfer->txData[1]) << 8U; - tmpData += (uint32_t)xfer->txData[0]; - } - xfer->txData += 4U; - } - } - else - { - tmpData = FLEXIO_SPI_DUMMYDATA; - } - - xfer->dataSize -= bytesPerFrame; - - FLEXIO_SPI_WriteData(base, direction, tmpData); - -#if SPI_RETRY_TIMES - waitTimes = SPI_RETRY_TIMES; - while ((0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_RxBufferFullFlag)) && - (0U != --waitTimes)) -#else - while (0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_RxBufferFullFlag)) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return kStatus_FLEXIO_SPI_Timeout; - } -#endif - tmpData = FLEXIO_SPI_ReadData(base, direction); - - if (xfer->rxData != NULL) - { - if (bytesPerFrame == 1U) - { - *xfer->rxData = (uint8_t)tmpData; - } - else if (bytesPerFrame == 2U) - { - if (direction == kFLEXIO_SPI_LsbFirst) - { - *xfer->rxData = (uint8_t)(tmpData >> 8); - xfer->rxData++; - *xfer->rxData = (uint8_t)tmpData; - } - else - { - *xfer->rxData = (uint8_t)tmpData; - xfer->rxData++; - *xfer->rxData = (uint8_t)(tmpData >> 8); - } - } - else - { - if (direction == kFLEXIO_SPI_LsbFirst) - { - *xfer->rxData = (uint8_t)(tmpData >> 24U); - xfer->rxData++; - *xfer->rxData = (uint8_t)(tmpData >> 16U); - xfer->rxData++; - *xfer->rxData = (uint8_t)(tmpData >> 8U); - xfer->rxData++; - *xfer->rxData = (uint8_t)tmpData; - } - else - { - *xfer->rxData = (uint8_t)tmpData; - xfer->rxData++; - *xfer->rxData = (uint8_t)(tmpData >> 8U); - xfer->rxData++; - *xfer->rxData = (uint8_t)(tmpData >> 16U); - xfer->rxData++; - *xfer->rxData = (uint8_t)(tmpData >> 24U); - } - } - xfer->rxData++; - } - } - - return kStatus_Success; -} - -/*! - * brief Initializes the FlexIO SPI Master handle, which is used in transactional functions. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - * param callback The callback function. - * param userData The parameter of the callback function. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_SPI_MasterTransferCreateHandle(FLEXIO_SPI_Type *base, - flexio_spi_master_handle_t *handle, - flexio_spi_master_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - IRQn_Type flexio_irqs[] = FLEXIO_IRQS; - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Register callback and userData. */ - handle->callback = callback; - handle->userData = userData; - - /* Clear pending NVIC IRQ before enable NVIC IRQ. */ - NVIC_ClearPendingIRQ(flexio_irqs[FLEXIO_SPI_GetInstance(base)]); - /* Enable interrupt in NVIC. */ - (void)EnableIRQ(flexio_irqs[FLEXIO_SPI_GetInstance(base)]); - - /* Save the context in global variables to support the double weak mechanism. */ - return FLEXIO_RegisterHandleIRQ(base, handle, FLEXIO_SPI_MasterTransferHandleIRQ); -} - -/*! - * brief Master transfer data using IRQ. - * - * This function sends data using IRQ. This is a non-blocking function, which returns - * right away. When all data is sent out/received, the callback function is called. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - * param xfer FlexIO SPI transfer structure. See #flexio_spi_transfer_t. - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_InvalidArgument Input argument is invalid. - * retval kStatus_FLEXIO_SPI_Busy SPI is not idle, is running another transfer. - */ -status_t FLEXIO_SPI_MasterTransferNonBlocking(FLEXIO_SPI_Type *base, - flexio_spi_master_handle_t *handle, - flexio_spi_transfer_t *xfer) -{ - assert(handle != NULL); - assert(xfer != NULL); - - uint32_t dataMode = 0; - uint16_t timerCmp = (uint16_t)base->flexioBase->TIMCMP[base->timerIndex[0]]; - uint32_t tmpData = FLEXIO_SPI_DUMMYDATA; - uint8_t dataFormat = FLEXIO_SPI_XFER_DATA_FORMAT(xfer->flags); - - timerCmp &= 0x00FFU; - - /* Check if SPI is busy. */ - if (handle->state == (uint32_t)kFLEXIO_SPI_Busy) - { - return kStatus_FLEXIO_SPI_Busy; - } - - /* Check if the argument is legal. */ - if ((xfer->txData == NULL) && (xfer->rxData == NULL)) - { - return kStatus_InvalidArgument; - } - - /* Timer1 controls the CS signal which enables/disables(asserts/deasserts) when timer0 enable/disable. Timer0 - enables when tx shifter is written and disables when timer compare. The timer compare event causes the - transmit shift registers to load which generates a tx register empty event. Since when timer stop bit is - disabled, a timer enable condition can be detected in the same cycle as a timer disable condition, so if - software writes the tx register upon the detection of tx register empty event, the timer enable condition - is triggered again, then the CS signal can remain low until software no longer writes the tx register. */ - if ((xfer->flags & (uint8_t)kFLEXIO_SPI_csContinuous) != 0U) - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TSTOP_MASK) | - FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitDisabled); - } - else - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TSTOP_MASK) | - FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitEnableOnTimerDisable); - } - - /* Configure the values in handle */ - switch (dataFormat) - { - case (uint8_t)kFLEXIO_SPI_8bitMsb: - dataMode = (8UL * 2UL - 1UL) << 8U; - handle->bytePerFrame = 1U; - handle->direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_8bitLsb: - dataMode = (8UL * 2UL - 1UL) << 8U; - handle->bytePerFrame = 1U; - handle->direction = kFLEXIO_SPI_LsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_16bitMsb: - dataMode = (16UL * 2UL - 1UL) << 8U; - handle->bytePerFrame = 2U; - handle->direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_16bitLsb: - dataMode = (16UL * 2UL - 1UL) << 8U; - handle->bytePerFrame = 2U; - handle->direction = kFLEXIO_SPI_LsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_32bitMsb: - dataMode = (32UL * 2UL - 1UL) << 8U; - handle->bytePerFrame = 4U; - handle->direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_32bitLsb: - dataMode = (32UL * 2UL - 1UL) << 8U; - handle->bytePerFrame = 4U; - handle->direction = kFLEXIO_SPI_LsbFirst; - break; - default: - dataMode = (8UL * 2UL - 1UL) << 8U; - handle->bytePerFrame = 1U; - handle->direction = kFLEXIO_SPI_MsbFirst; - assert(true); - break; - } - - dataMode |= timerCmp; - - /* Transfer size should be bytesPerFrame divisible. */ - if ((xfer->dataSize % handle->bytePerFrame) != 0U) - { - return kStatus_InvalidArgument; - } - - /* Configure transfer size. */ - base->flexioBase->TIMCMP[base->timerIndex[0]] = dataMode; - - handle->state = (uint32_t)kFLEXIO_SPI_Busy; - handle->txData = xfer->txData; - handle->rxData = xfer->rxData; - handle->rxRemainingBytes = xfer->dataSize; - - /* Save total transfer size. */ - handle->transferSize = xfer->dataSize; - - /* Send first byte of data to trigger the rx interrupt. */ - if (handle->txData != NULL) - { - /* Transmit data and update tx size/buff. */ - if (handle->bytePerFrame == 1U) - { - tmpData = (uint32_t) * (handle->txData); - handle->txData++; - } - else if (handle->bytePerFrame == 2U) - { - if (handle->direction == kFLEXIO_SPI_MsbFirst) - { - tmpData = (uint32_t)(handle->txData[0]) << 8U; - tmpData += (uint32_t)handle->txData[1]; - } - else - { - tmpData = (uint32_t)(handle->txData[1]) << 8U; - tmpData += (uint32_t)handle->txData[0]; - } - handle->txData += 2U; - } - else - { - if (handle->direction == kFLEXIO_SPI_MsbFirst) - { - tmpData = (uint32_t)(handle->txData[0]) << 24U; - tmpData += (uint32_t)(handle->txData[1]) << 16U; - tmpData += (uint32_t)(handle->txData[2]) << 8U; - tmpData += (uint32_t)handle->txData[3]; - } - else - { - tmpData = (uint32_t)(handle->txData[3]) << 24U; - tmpData += (uint32_t)(handle->txData[2]) << 16U; - tmpData += (uint32_t)(handle->txData[1]) << 8U; - tmpData += (uint32_t)handle->txData[0]; - } - handle->txData += 4U; - } - } - else - { - tmpData = FLEXIO_SPI_DUMMYDATA; - } - - handle->txRemainingBytes = xfer->dataSize - handle->bytePerFrame; - - FLEXIO_SPI_WriteData(base, handle->direction, tmpData); - - /* Enable transmit and receive interrupt to handle rx. */ - FLEXIO_SPI_EnableInterrupts(base, (uint32_t)kFLEXIO_SPI_RxFullInterruptEnable); - - if ((xfer->flags & (uint8_t)kFLEXIO_SPI_csContinuous) != 0U) - { - FLEXIO_SPI_EnableInterrupts(base, (uint32_t)kFLEXIO_SPI_TxEmptyInterruptEnable); - } - - return kStatus_Success; -} - -/*! - * brief Gets the data transfer status which used IRQ. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - * param count Number of bytes transferred so far by the non-blocking transaction. - * retval kStatus_InvalidArgument count is Invalid. - * retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_SPI_MasterTransferGetCount(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Return remaing bytes in different cases. */ - if (handle->rxData != NULL) - { - *count = handle->transferSize - handle->rxRemainingBytes; - } - else - { - *count = handle->transferSize - handle->txRemainingBytes; - } - - return kStatus_Success; -} - -/*! - * brief Aborts the master data transfer, which used IRQ. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - */ -void FLEXIO_SPI_MasterTransferAbort(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle) -{ - assert(handle != NULL); - - FLEXIO_SPI_DisableInterrupts(base, (uint32_t)kFLEXIO_SPI_RxFullInterruptEnable); - FLEXIO_SPI_DisableInterrupts(base, (uint32_t)kFLEXIO_SPI_TxEmptyInterruptEnable); - - /* Transfer finished, set the state to idle. */ - handle->state = (uint32_t)kFLEXIO_SPI_Idle; - - /* Clear the internal state. */ - handle->rxRemainingBytes = 0; - handle->txRemainingBytes = 0; -} - -/*! - * brief FlexIO SPI master IRQ handler function. - * - * param spiType Pointer to the FLEXIO_SPI_Type structure. - * param spiHandle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - */ -void FLEXIO_SPI_MasterTransferHandleIRQ(void *spiType, void *spiHandle) -{ - assert(spiHandle != NULL); - - flexio_spi_master_handle_t *handle = (flexio_spi_master_handle_t *)spiHandle; - FLEXIO_SPI_Type *base; - uint32_t status; - - if (handle->state == (uint32_t)kFLEXIO_SPI_Idle) - { - return; - } - - base = (FLEXIO_SPI_Type *)spiType; - status = FLEXIO_SPI_GetStatusFlags(base); - - /* Receive interrupt. */ - if ((status & (uint32_t)kFLEXIO_SPI_RxBufferFullFlag) == 0U) - { - FLEXIO_SPI_TransferSendTransaction(base, handle); - return; - } - - /* Handle rx. */ - if (handle->rxRemainingBytes != 0U) - { - FLEXIO_SPI_TransferReceiveTransaction(base, handle); - } - - /* Handle tx. */ - if (((status & (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag) != 0U) && (handle->txRemainingBytes != 0U)) - { - FLEXIO_SPI_TransferSendTransaction(base, handle); - } - - /* All the transfer finished. */ - if ((handle->txRemainingBytes == 0U) && (handle->rxRemainingBytes == 0U)) - { - FLEXIO_SPI_MasterTransferAbort(base, handle); - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_FLEXIO_SPI_Idle, handle->userData); - } - } -} - -/*! - * brief Initializes the FlexIO SPI Slave handle, which is used in transactional functions. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param handle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - * param callback The callback function. - * param userData The parameter of the callback function. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_SPI_SlaveTransferCreateHandle(FLEXIO_SPI_Type *base, - flexio_spi_slave_handle_t *handle, - flexio_spi_slave_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - IRQn_Type flexio_irqs[] = FLEXIO_IRQS; - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Register callback and userData. */ - handle->callback = callback; - handle->userData = userData; - - /* Clear pending NVIC IRQ before enable NVIC IRQ. */ - NVIC_ClearPendingIRQ(flexio_irqs[FLEXIO_SPI_GetInstance(base)]); - /* Enable interrupt in NVIC. */ - (void)EnableIRQ(flexio_irqs[FLEXIO_SPI_GetInstance(base)]); - - /* Save the context in global variables to support the double weak mechanism. */ - return FLEXIO_RegisterHandleIRQ(base, handle, FLEXIO_SPI_SlaveTransferHandleIRQ); -} - -/*! - * brief Slave transfer data using IRQ. - * - * This function sends data using IRQ. This is a non-blocking function, which returns - * right away. When all data is sent out/received, the callback function is called. - * param handle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param xfer FlexIO SPI transfer structure. See #flexio_spi_transfer_t. - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_InvalidArgument Input argument is invalid. - * retval kStatus_FLEXIO_SPI_Busy SPI is not idle; it is running another transfer. - */ -status_t FLEXIO_SPI_SlaveTransferNonBlocking(FLEXIO_SPI_Type *base, - flexio_spi_slave_handle_t *handle, - flexio_spi_transfer_t *xfer) -{ - assert(handle != NULL); - assert(xfer != NULL); - - uint32_t dataMode = 0; - uint8_t dataFormat = FLEXIO_SPI_XFER_DATA_FORMAT(xfer->flags); - - /* Check if SPI is busy. */ - if (handle->state == (uint32_t)kFLEXIO_SPI_Busy) - { - return kStatus_FLEXIO_SPI_Busy; - } - - /* Check if the argument is legal. */ - if ((xfer->txData == NULL) && (xfer->rxData == NULL)) - { - return kStatus_InvalidArgument; - } - - /* SCK timer use CS pin as inverted trigger so timer should be disbaled on trigger falling edge(CS re-asserts). */ - /* However if CPHA is first edge mode, timer will restart each time right after timer compare event occur and - before CS pin re-asserts, which triggers another shifter load. To avoid this, when in CS dis-continuous mode, - timer should disable in timer compare rather than trigger falling edge(CS re-asserts), and in CS continuous mode, - tx/rx shifters should be flushed after transfer finishes and before next transfer starts. */ - FLEXIO_SPI_FlushShifters(base); - if ((xfer->flags & (uint8_t)kFLEXIO_SPI_csContinuous) != 0U) - { - base->flexioBase->TIMCFG[base->timerIndex[0]] |= FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTriggerFallingEdge); - } - else - { - if ((base->flexioBase->SHIFTCTL[base->shifterIndex[0]] & FLEXIO_SHIFTCTL_TIMPOL_MASK) == - FLEXIO_SHIFTCTL_TIMPOL(kFLEXIO_ShifterTimerPolarityOnNegitive)) - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TIMDIS_MASK) | - FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTimerCompare); - } - else - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TIMDIS_MASK) | - FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTriggerFallingEdge); - } - } - - /* Configure the values in handle */ - switch (dataFormat) - { - case (uint8_t)kFLEXIO_SPI_8bitMsb: - dataMode = 8U * 2U - 1U; - handle->bytePerFrame = 1U; - handle->direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_8bitLsb: - dataMode = 8U * 2U - 1U; - handle->bytePerFrame = 1U; - handle->direction = kFLEXIO_SPI_LsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_16bitMsb: - dataMode = 16U * 2U - 1U; - handle->bytePerFrame = 2U; - handle->direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_16bitLsb: - dataMode = 16U * 2U - 1U; - handle->bytePerFrame = 2U; - handle->direction = kFLEXIO_SPI_LsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_32bitMsb: - dataMode = 32UL * 2UL - 1UL; - handle->bytePerFrame = 4U; - handle->direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_32bitLsb: - dataMode = 32UL * 2UL - 1UL; - handle->bytePerFrame = 4U; - handle->direction = kFLEXIO_SPI_LsbFirst; - break; - default: - dataMode = 8UL * 2UL - 1UL; - handle->bytePerFrame = 1U; - handle->direction = kFLEXIO_SPI_MsbFirst; - assert(true); - break; - } - - /* Transfer size should be bytesPerFrame divisible. */ - if ((xfer->dataSize % handle->bytePerFrame) != 0U) - { - return kStatus_InvalidArgument; - } - - /* Configure transfer size. */ - base->flexioBase->TIMCMP[base->timerIndex[0]] = dataMode; - - handle->state = (uint32_t)kFLEXIO_SPI_Busy; - handle->txData = xfer->txData; - handle->rxData = xfer->rxData; - handle->txRemainingBytes = xfer->dataSize; - handle->rxRemainingBytes = xfer->dataSize; - - /* Save total transfer size. */ - handle->transferSize = xfer->dataSize; - - /* Enable transmit and receive interrupt to handle tx and rx. */ - FLEXIO_SPI_EnableInterrupts(base, (uint32_t)kFLEXIO_SPI_TxEmptyInterruptEnable); - FLEXIO_SPI_EnableInterrupts(base, (uint32_t)kFLEXIO_SPI_RxFullInterruptEnable); - - return kStatus_Success; -} - -/*! - * brief FlexIO SPI slave IRQ handler function. - * - * param spiType Pointer to the FLEXIO_SPI_Type structure. - * param spiHandle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - */ -void FLEXIO_SPI_SlaveTransferHandleIRQ(void *spiType, void *spiHandle) -{ - assert(spiHandle != NULL); - - flexio_spi_master_handle_t *handle = (flexio_spi_master_handle_t *)spiHandle; - FLEXIO_SPI_Type *base; - uint32_t status; - - if (handle->state == (uint32_t)kFLEXIO_SPI_Idle) - { - return; - } - - base = (FLEXIO_SPI_Type *)spiType; - status = FLEXIO_SPI_GetStatusFlags(base); - - /* Handle tx. */ - if (((status & (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag) != 0U) && (handle->txRemainingBytes != 0U)) - { - FLEXIO_SPI_TransferSendTransaction(base, handle); - } - - /* Handle rx. */ - if (((status & (uint32_t)kFLEXIO_SPI_RxBufferFullFlag) != 0U) && (handle->rxRemainingBytes != 0U)) - { - FLEXIO_SPI_TransferReceiveTransaction(base, handle); - } - - /* All the transfer finished. */ - if ((handle->txRemainingBytes == 0U) && (handle->rxRemainingBytes == 0U)) - { - FLEXIO_SPI_SlaveTransferAbort(base, handle); - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_FLEXIO_SPI_Idle, handle->userData); - } - } -} - -/*! - * brief Flush tx/rx shifters. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - */ -void FLEXIO_SPI_FlushShifters(FLEXIO_SPI_Type *base) -{ - /* Disable then re-enable to flush the tx shifter. */ - base->flexioBase->SHIFTCTL[base->shifterIndex[0]] &= ~FLEXIO_SHIFTCTL_SMOD_MASK; - base->flexioBase->SHIFTCTL[base->shifterIndex[0]] |= FLEXIO_SHIFTCTL_SMOD(kFLEXIO_ShifterModeTransmit); - /* Read to flush the rx shifter. */ - (void)base->flexioBase->SHIFTBUF[base->shifterIndex[1]]; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_spi.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_spi.h deleted file mode 100644 index 338cf43ab35..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_spi.h +++ /dev/null @@ -1,719 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020, 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_FLEXIO_SPI_H_ -#define FSL_FLEXIO_SPI_H_ - -#include "fsl_common.h" -#include "fsl_flexio.h" - -/*! - * @addtogroup flexio_spi - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief FlexIO SPI driver version. */ -#define FSL_FLEXIO_SPI_DRIVER_VERSION (MAKE_VERSION(2, 3, 3)) -/*@}*/ - -#ifndef FLEXIO_SPI_DUMMYDATA -/*! @brief FlexIO SPI dummy transfer data, the data is sent while txData is NULL. */ -#define FLEXIO_SPI_DUMMYDATA (0x00U) -#endif - -/*! @brief Retry times for waiting flag. */ -#ifndef SPI_RETRY_TIMES -#define SPI_RETRY_TIMES 0U /* Define to zero means keep waiting until the flag is assert/deassert. */ -#endif - -/*! @brief Get the transfer data format of width and bit order. */ -#define FLEXIO_SPI_XFER_DATA_FORMAT(flag) ((flag) & (0x7U)) - -/*! @brief Error codes for the FlexIO SPI driver. */ -enum -{ - kStatus_FLEXIO_SPI_Busy = MAKE_STATUS(kStatusGroup_FLEXIO_SPI, 1), /*!< FlexIO SPI is busy. */ - kStatus_FLEXIO_SPI_Idle = MAKE_STATUS(kStatusGroup_FLEXIO_SPI, 2), /*!< SPI is idle */ - kStatus_FLEXIO_SPI_Error = MAKE_STATUS(kStatusGroup_FLEXIO_SPI, 3), /*!< FlexIO SPI error. */ - kStatus_FLEXIO_SPI_Timeout = - MAKE_STATUS(kStatusGroup_FLEXIO_SPI, 4), /*!< FlexIO SPI timeout polling status flags. */ -}; - -/*! @brief FlexIO SPI clock phase configuration. */ -typedef enum _flexio_spi_clock_phase -{ - kFLEXIO_SPI_ClockPhaseFirstEdge = 0x0U, /*!< First edge on SPSCK occurs at the middle of the first - * cycle of a data transfer. */ - kFLEXIO_SPI_ClockPhaseSecondEdge = 0x1U, /*!< First edge on SPSCK occurs at the start of the - * first cycle of a data transfer. */ -} flexio_spi_clock_phase_t; - -/*! @brief FlexIO SPI data shifter direction options. */ -typedef enum _flexio_spi_shift_direction -{ - kFLEXIO_SPI_MsbFirst = 0, /*!< Data transfers start with most significant bit. */ - kFLEXIO_SPI_LsbFirst = 1, /*!< Data transfers start with least significant bit. */ -} flexio_spi_shift_direction_t; - -/*! @brief FlexIO SPI data length mode options. */ -typedef enum _flexio_spi_data_bitcount_mode -{ - kFLEXIO_SPI_8BitMode = 0x08U, /*!< 8-bit data transmission mode. */ - kFLEXIO_SPI_16BitMode = 0x10U, /*!< 16-bit data transmission mode. */ - kFLEXIO_SPI_32BitMode = 0x20U, /*!< 32-bit data transmission mode. */ -} flexio_spi_data_bitcount_mode_t; - -/*! @brief Define FlexIO SPI interrupt mask. */ -enum _flexio_spi_interrupt_enable -{ - kFLEXIO_SPI_TxEmptyInterruptEnable = 0x1U, /*!< Transmit buffer empty interrupt enable. */ - kFLEXIO_SPI_RxFullInterruptEnable = 0x2U, /*!< Receive buffer full interrupt enable. */ -}; - -/*! @brief Define FlexIO SPI status mask. */ -enum _flexio_spi_status_flags -{ - kFLEXIO_SPI_TxBufferEmptyFlag = 0x1U, /*!< Transmit buffer empty flag. */ - kFLEXIO_SPI_RxBufferFullFlag = 0x2U, /*!< Receive buffer full flag. */ -}; - -/*! @brief Define FlexIO SPI DMA mask. */ -enum _flexio_spi_dma_enable -{ - kFLEXIO_SPI_TxDmaEnable = 0x1U, /*!< Tx DMA request source */ - kFLEXIO_SPI_RxDmaEnable = 0x2U, /*!< Rx DMA request source */ - kFLEXIO_SPI_DmaAllEnable = 0x3U, /*!< All DMA request source*/ -}; - -/*! @brief Define FlexIO SPI transfer flags. - * @note Use kFLEXIO_SPI_csContinuous and one of the other flags to OR together to form the transfer flag. */ -enum _flexio_spi_transfer_flags -{ - kFLEXIO_SPI_8bitMsb = 0x0U, /*!< FlexIO SPI 8-bit MSB first */ - kFLEXIO_SPI_8bitLsb = 0x1U, /*!< FlexIO SPI 8-bit LSB first */ - kFLEXIO_SPI_16bitMsb = 0x2U, /*!< FlexIO SPI 16-bit MSB first */ - kFLEXIO_SPI_16bitLsb = 0x3U, /*!< FlexIO SPI 16-bit LSB first */ - kFLEXIO_SPI_32bitMsb = 0x4U, /*!< FlexIO SPI 32-bit MSB first */ - kFLEXIO_SPI_32bitLsb = 0x5U, /*!< FlexIO SPI 32-bit LSB first */ - kFLEXIO_SPI_csContinuous = 0x8U, /*!< Enable the CS signal continuous mode */ -}; - -/*! @brief Define FlexIO SPI access structure typedef. */ -typedef struct _flexio_spi_type -{ - FLEXIO_Type *flexioBase; /*!< FlexIO base pointer. */ - uint8_t SDOPinIndex; /*!< Pin select for data output. To set SDO pin in Hi-Z state, user needs to mux the pin as - GPIO input and disable all pull up/down in application. */ - uint8_t SDIPinIndex; /*!< Pin select for data input. */ - uint8_t SCKPinIndex; /*!< Pin select for clock. */ - uint8_t CSnPinIndex; /*!< Pin select for enable. */ - uint8_t shifterIndex[2]; /*!< Shifter index used in FlexIO SPI. */ - uint8_t timerIndex[2]; /*!< Timer index used in FlexIO SPI. */ -} FLEXIO_SPI_Type; - -/*! @brief Define FlexIO SPI master configuration structure. */ -typedef struct _flexio_spi_master_config -{ - bool enableMaster; /*!< Enable/disable FlexIO SPI master after configuration. */ - bool enableInDoze; /*!< Enable/disable FlexIO operation in doze mode. */ - bool enableInDebug; /*!< Enable/disable FlexIO operation in debug mode. */ - bool enableFastAccess; /*!< Enable/disable fast access to FlexIO registers, - fast access requires the FlexIO clock to be at least - twice the frequency of the bus clock. */ - uint32_t baudRate_Bps; /*!< Baud rate in Bps. */ - flexio_spi_clock_phase_t phase; /*!< Clock phase. */ - flexio_spi_data_bitcount_mode_t dataMode; /*!< 8bit or 16bit mode. */ -} flexio_spi_master_config_t; - -/*! @brief Define FlexIO SPI slave configuration structure. */ -typedef struct _flexio_spi_slave_config -{ - bool enableSlave; /*!< Enable/disable FlexIO SPI slave after configuration. */ - bool enableInDoze; /*!< Enable/disable FlexIO operation in doze mode. */ - bool enableInDebug; /*!< Enable/disable FlexIO operation in debug mode. */ - bool enableFastAccess; /*!< Enable/disable fast access to FlexIO registers, - fast access requires the FlexIO clock to be at least - twice the frequency of the bus clock. */ - flexio_spi_clock_phase_t phase; /*!< Clock phase. */ - flexio_spi_data_bitcount_mode_t dataMode; /*!< 8bit or 16bit mode. */ -} flexio_spi_slave_config_t; - -/*! @brief Define FlexIO SPI transfer structure. */ -typedef struct _flexio_spi_transfer -{ - uint8_t *txData; /*!< Send buffer. */ - uint8_t *rxData; /*!< Receive buffer. */ - size_t dataSize; /*!< Transfer bytes. */ - uint8_t flags; /*!< FlexIO SPI control flag, MSB first or LSB first. */ -} flexio_spi_transfer_t; - -/*! @brief typedef for flexio_spi_master_handle_t in advance. */ -typedef struct _flexio_spi_master_handle flexio_spi_master_handle_t; - -/*! @brief Slave handle is the same with master handle. */ -typedef flexio_spi_master_handle_t flexio_spi_slave_handle_t; - -/*! @brief FlexIO SPI master callback for finished transmit */ -typedef void (*flexio_spi_master_transfer_callback_t)(FLEXIO_SPI_Type *base, - flexio_spi_master_handle_t *handle, - status_t status, - void *userData); - -/*! @brief FlexIO SPI slave callback for finished transmit */ -typedef void (*flexio_spi_slave_transfer_callback_t)(FLEXIO_SPI_Type *base, - flexio_spi_slave_handle_t *handle, - status_t status, - void *userData); - -/*! @brief Define FlexIO SPI handle structure. */ -struct _flexio_spi_master_handle -{ - uint8_t *txData; /*!< Transfer buffer. */ - uint8_t *rxData; /*!< Receive buffer. */ - size_t transferSize; /*!< Total bytes to be transferred. */ - volatile size_t txRemainingBytes; /*!< Send data remaining in bytes. */ - volatile size_t rxRemainingBytes; /*!< Receive data remaining in bytes. */ - volatile uint32_t state; /*!< FlexIO SPI internal state. */ - uint8_t bytePerFrame; /*!< SPI mode, 2bytes or 1byte in a frame */ - flexio_spi_shift_direction_t direction; /*!< Shift direction. */ - flexio_spi_master_transfer_callback_t callback; /*!< FlexIO SPI callback. */ - void *userData; /*!< Callback parameter. */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus*/ - -/*! - * @name FlexIO SPI Configuration - * @{ - */ - -/*! - * @brief Ungates the FlexIO clock, resets the FlexIO module, configures the FlexIO SPI master hardware, - * and configures the FlexIO SPI with FlexIO SPI master configuration. The - * configuration structure can be filled by the user, or be set with default values - * by the FLEXIO_SPI_MasterGetDefaultConfig(). - * - * @note 1.FlexIO SPI master only support CPOL = 0, which means clock inactive low. - * 2.For FlexIO SPI master, the input valid time is 1.5 clock cycles, for slave the output valid time - * is 2.5 clock cycles. So if FlexIO SPI master communicates with other spi IPs, the maximum baud - * rate is FlexIO clock frequency divided by 2*2=4. If FlexIO SPI master communicates with FlexIO - * SPI slave, the maximum baud rate is FlexIO clock frequency divided by (1.5+2.5)*2=8. - * - * Example - @code - FLEXIO_SPI_Type spiDev = { - .flexioBase = FLEXIO, - .SDOPinIndex = 0, - .SDIPinIndex = 1, - .SCKPinIndex = 2, - .CSnPinIndex = 3, - .shifterIndex = {0,1}, - .timerIndex = {0,1} - }; - flexio_spi_master_config_t config = { - .enableMaster = true, - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .baudRate_Bps = 500000, - .phase = kFLEXIO_SPI_ClockPhaseFirstEdge, - .direction = kFLEXIO_SPI_MsbFirst, - .dataMode = kFLEXIO_SPI_8BitMode - }; - FLEXIO_SPI_MasterInit(&spiDev, &config, srcClock_Hz); - @endcode - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param masterConfig Pointer to the flexio_spi_master_config_t structure. - * @param srcClock_Hz FlexIO source clock in Hz. -*/ -void FLEXIO_SPI_MasterInit(FLEXIO_SPI_Type *base, flexio_spi_master_config_t *masterConfig, uint32_t srcClock_Hz); - -/*! - * @brief Resets the FlexIO SPI timer and shifter config. - * - * @param base Pointer to the FLEXIO_SPI_Type. - */ -void FLEXIO_SPI_MasterDeinit(FLEXIO_SPI_Type *base); - -/*! - * @brief Gets the default configuration to configure the FlexIO SPI master. The configuration - * can be used directly by calling the FLEXIO_SPI_MasterConfigure(). - * Example: - @code - flexio_spi_master_config_t masterConfig; - FLEXIO_SPI_MasterGetDefaultConfig(&masterConfig); - @endcode - * @param masterConfig Pointer to the flexio_spi_master_config_t structure. -*/ -void FLEXIO_SPI_MasterGetDefaultConfig(flexio_spi_master_config_t *masterConfig); - -/*! - * @brief Ungates the FlexIO clock, resets the FlexIO module, configures the FlexIO SPI slave hardware - * configuration, and configures the FlexIO SPI with FlexIO SPI slave configuration. The - * configuration structure can be filled by the user, or be set with default values - * by the FLEXIO_SPI_SlaveGetDefaultConfig(). - * - * @note 1.Only one timer is needed in the FlexIO SPI slave. As a result, the second timer index is ignored. - * 2.FlexIO SPI slave only support CPOL = 0, which means clock inactive low. - * 3.For FlexIO SPI master, the input valid time is 1.5 clock cycles, for slave the output valid time - * is 2.5 clock cycles. So if FlexIO SPI slave communicates with other spi IPs, the maximum baud - * rate is FlexIO clock frequency divided by 3*2=6. If FlexIO SPI slave communicates with FlexIO - * SPI master, the maximum baud rate is FlexIO clock frequency divided by (1.5+2.5)*2=8. - * Example - @code - FLEXIO_SPI_Type spiDev = { - .flexioBase = FLEXIO, - .SDOPinIndex = 0, - .SDIPinIndex = 1, - .SCKPinIndex = 2, - .CSnPinIndex = 3, - .shifterIndex = {0,1}, - .timerIndex = {0} - }; - flexio_spi_slave_config_t config = { - .enableSlave = true, - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .phase = kFLEXIO_SPI_ClockPhaseFirstEdge, - .direction = kFLEXIO_SPI_MsbFirst, - .dataMode = kFLEXIO_SPI_8BitMode - }; - FLEXIO_SPI_SlaveInit(&spiDev, &config); - @endcode - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param slaveConfig Pointer to the flexio_spi_slave_config_t structure. -*/ -void FLEXIO_SPI_SlaveInit(FLEXIO_SPI_Type *base, flexio_spi_slave_config_t *slaveConfig); - -/*! - * @brief Gates the FlexIO clock. - * - * @param base Pointer to the FLEXIO_SPI_Type. - */ -void FLEXIO_SPI_SlaveDeinit(FLEXIO_SPI_Type *base); - -/*! - * @brief Gets the default configuration to configure the FlexIO SPI slave. The configuration - * can be used directly for calling the FLEXIO_SPI_SlaveConfigure(). - * Example: - @code - flexio_spi_slave_config_t slaveConfig; - FLEXIO_SPI_SlaveGetDefaultConfig(&slaveConfig); - @endcode - * @param slaveConfig Pointer to the flexio_spi_slave_config_t structure. -*/ -void FLEXIO_SPI_SlaveGetDefaultConfig(flexio_spi_slave_config_t *slaveConfig); - -/*@}*/ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets FlexIO SPI status flags. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @return status flag; Use the status flag to AND the following flag mask and get the status. - * @arg kFLEXIO_SPI_TxEmptyFlag - * @arg kFLEXIO_SPI_RxEmptyFlag - */ - -uint32_t FLEXIO_SPI_GetStatusFlags(FLEXIO_SPI_Type *base); - -/*! - * @brief Clears FlexIO SPI status flags. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param mask status flag - * The parameter can be any combination of the following values: - * @arg kFLEXIO_SPI_TxEmptyFlag - * @arg kFLEXIO_SPI_RxEmptyFlag - */ - -void FLEXIO_SPI_ClearStatusFlags(FLEXIO_SPI_Type *base, uint32_t mask); - -/*@}*/ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables the FlexIO SPI interrupt. - * - * This function enables the FlexIO SPI interrupt. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param mask interrupt source. The parameter can be any combination of the following values: - * @arg kFLEXIO_SPI_RxFullInterruptEnable - * @arg kFLEXIO_SPI_TxEmptyInterruptEnable - */ -void FLEXIO_SPI_EnableInterrupts(FLEXIO_SPI_Type *base, uint32_t mask); - -/*! - * @brief Disables the FlexIO SPI interrupt. - * - * This function disables the FlexIO SPI interrupt. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param mask interrupt source The parameter can be any combination of the following values: - * @arg kFLEXIO_SPI_RxFullInterruptEnable - * @arg kFLEXIO_SPI_TxEmptyInterruptEnable - */ -void FLEXIO_SPI_DisableInterrupts(FLEXIO_SPI_Type *base, uint32_t mask); - -/*@}*/ - -/*! - * @name DMA Control - * @{ - */ - -/*! - * @brief Enables/disables the FlexIO SPI transmit DMA. This function enables/disables the FlexIO SPI Tx DMA, - * which means that asserting the kFLEXIO_SPI_TxEmptyFlag does/doesn't trigger the DMA request. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param mask SPI DMA source. - * @param enable True means enable DMA, false means disable DMA. - */ -void FLEXIO_SPI_EnableDMA(FLEXIO_SPI_Type *base, uint32_t mask, bool enable); - -/*! - * @brief Gets the FlexIO SPI transmit data register address for MSB first transfer. - * - * This function returns the SPI data register address, which is mainly used by DMA/eDMA. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param direction Shift direction of MSB first or LSB first. - * @return FlexIO SPI transmit data register address. - */ -static inline uint32_t FLEXIO_SPI_GetTxDataRegisterAddress(FLEXIO_SPI_Type *base, - flexio_spi_shift_direction_t direction) -{ - if (direction == kFLEXIO_SPI_MsbFirst) - { - return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBufferBitSwapped, - base->shifterIndex[0]) + - 3U; - } - else - { - return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBuffer, base->shifterIndex[0]); - } -} - -/*! - * @brief Gets the FlexIO SPI receive data register address for the MSB first transfer. - * - * This function returns the SPI data register address, which is mainly used by DMA/eDMA. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param direction Shift direction of MSB first or LSB first. - * @return FlexIO SPI receive data register address. - */ -static inline uint32_t FLEXIO_SPI_GetRxDataRegisterAddress(FLEXIO_SPI_Type *base, - flexio_spi_shift_direction_t direction) -{ - if (direction == kFLEXIO_SPI_MsbFirst) - { - return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBufferBitSwapped, base->shifterIndex[1]); - } - else - { - return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBuffer, base->shifterIndex[1]) + 3U; - } -} - -/*@}*/ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Enables/disables the FlexIO SPI module operation. - * - * @param base Pointer to the FLEXIO_SPI_Type. - * @param enable True to enable, false does not have any effect. - */ -static inline void FLEXIO_SPI_Enable(FLEXIO_SPI_Type *base, bool enable) -{ - if (enable) - { - base->flexioBase->CTRL |= FLEXIO_CTRL_FLEXEN_MASK; - } -} - -/*! - * @brief Sets baud rate for the FlexIO SPI transfer, which is only used for the master. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param baudRate_Bps Baud Rate needed in Hz. - * @param srcClockHz SPI source clock frequency in Hz. - */ -void FLEXIO_SPI_MasterSetBaudRate(FLEXIO_SPI_Type *base, uint32_t baudRate_Bps, uint32_t srcClockHz); - -/*! - * @brief Writes one byte of data, which is sent using the MSB method. - * - * @note This is a non-blocking API, which returns directly after the data is put into the - * data register but the data transfer is not finished on the bus. Ensure that - * the TxEmptyFlag is asserted before calling this API. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param direction Shift direction of MSB first or LSB first. - * @param data 8/16/32 bit data. - */ -static inline void FLEXIO_SPI_WriteData(FLEXIO_SPI_Type *base, flexio_spi_shift_direction_t direction, uint32_t data) -{ - if (direction == kFLEXIO_SPI_MsbFirst) - { - base->flexioBase->SHIFTBUFBBS[base->shifterIndex[0]] = data; - } - else - { - base->flexioBase->SHIFTBUF[base->shifterIndex[0]] = data; - } -} - -/*! - * @brief Reads 8 bit/16 bit data. - * - * @note This is a non-blocking API, which returns directly after the data is read from the - * data register. Ensure that the RxFullFlag is asserted before calling this API. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param direction Shift direction of MSB first or LSB first. - * @return 8 bit/16 bit data received. - */ -static inline uint32_t FLEXIO_SPI_ReadData(FLEXIO_SPI_Type *base, flexio_spi_shift_direction_t direction) -{ - if (direction == kFLEXIO_SPI_MsbFirst) - { - return (uint32_t)(base->flexioBase->SHIFTBUFBIS[base->shifterIndex[1]]); - } - else - { - return (uint32_t)(base->flexioBase->SHIFTBUFBYS[base->shifterIndex[1]]); - } -} - -/*! - * @brief Sends a buffer of data bytes. - * - * @note This function blocks using the polling method until all bytes have been sent. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param direction Shift direction of MSB first or LSB first. - * @param buffer The data bytes to send. - * @param size The number of data bytes to send. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_FLEXIO_SPI_Timeout The transfer timed out and was aborted. - */ -status_t FLEXIO_SPI_WriteBlocking(FLEXIO_SPI_Type *base, - flexio_spi_shift_direction_t direction, - const uint8_t *buffer, - size_t size); - -/*! - * @brief Receives a buffer of bytes. - * - * @note This function blocks using the polling method until all bytes have been received. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param direction Shift direction of MSB first or LSB first. - * @param buffer The buffer to store the received bytes. - * @param size The number of data bytes to be received. - * @param direction Shift direction of MSB first or LSB first. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_FLEXIO_SPI_Timeout The transfer timed out and was aborted. - */ -status_t FLEXIO_SPI_ReadBlocking(FLEXIO_SPI_Type *base, - flexio_spi_shift_direction_t direction, - uint8_t *buffer, - size_t size); - -/*! - * @brief Receives a buffer of bytes. - * - * @note This function blocks via polling until all bytes have been received. - * - * @param base pointer to FLEXIO_SPI_Type structure - * @param xfer FlexIO SPI transfer structure, see #flexio_spi_transfer_t. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_FLEXIO_SPI_Timeout The transfer timed out and was aborted. - */ -status_t FLEXIO_SPI_MasterTransferBlocking(FLEXIO_SPI_Type *base, flexio_spi_transfer_t *xfer); - -/*! - * @brief Flush tx/rx shifters. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - */ -void FLEXIO_SPI_FlushShifters(FLEXIO_SPI_Type *base); -/*@}*/ - -/*Transactional APIs*/ - -/*! - * @name Transactional - * @{ - */ - -/*! - * @brief Initializes the FlexIO SPI Master handle, which is used in transactional functions. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - * @param callback The callback function. - * @param userData The parameter of the callback function. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_SPI_MasterTransferCreateHandle(FLEXIO_SPI_Type *base, - flexio_spi_master_handle_t *handle, - flexio_spi_master_transfer_callback_t callback, - void *userData); - -/*! - * @brief Master transfer data using IRQ. - * - * This function sends data using IRQ. This is a non-blocking function, which returns - * right away. When all data is sent out/received, the callback function is called. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - * @param xfer FlexIO SPI transfer structure. See #flexio_spi_transfer_t. - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_InvalidArgument Input argument is invalid. - * @retval kStatus_FLEXIO_SPI_Busy SPI is not idle, is running another transfer. - */ -status_t FLEXIO_SPI_MasterTransferNonBlocking(FLEXIO_SPI_Type *base, - flexio_spi_master_handle_t *handle, - flexio_spi_transfer_t *xfer); - -/*! - * @brief Aborts the master data transfer, which used IRQ. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - */ -void FLEXIO_SPI_MasterTransferAbort(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle); - -/*! - * @brief Gets the data transfer status which used IRQ. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - * @param count Number of bytes transferred so far by the non-blocking transaction. - * @retval kStatus_InvalidArgument count is Invalid. - * @retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_SPI_MasterTransferGetCount(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle, size_t *count); - -/*! - * @brief FlexIO SPI master IRQ handler function. - * - * @param spiType Pointer to the FLEXIO_SPI_Type structure. - * @param spiHandle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - */ -void FLEXIO_SPI_MasterTransferHandleIRQ(void *spiType, void *spiHandle); - -/*! - * @brief Initializes the FlexIO SPI Slave handle, which is used in transactional functions. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param handle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - * @param callback The callback function. - * @param userData The parameter of the callback function. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_SPI_SlaveTransferCreateHandle(FLEXIO_SPI_Type *base, - flexio_spi_slave_handle_t *handle, - flexio_spi_slave_transfer_callback_t callback, - void *userData); - -/*! - * @brief Slave transfer data using IRQ. - * - * This function sends data using IRQ. This is a non-blocking function, which returns - * right away. When all data is sent out/received, the callback function is called. - * @param handle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param xfer FlexIO SPI transfer structure. See #flexio_spi_transfer_t. - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_InvalidArgument Input argument is invalid. - * @retval kStatus_FLEXIO_SPI_Busy SPI is not idle; it is running another transfer. - */ -status_t FLEXIO_SPI_SlaveTransferNonBlocking(FLEXIO_SPI_Type *base, - flexio_spi_slave_handle_t *handle, - flexio_spi_transfer_t *xfer); - -/*! - * @brief Aborts the slave data transfer which used IRQ, share same API with master. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param handle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - */ -static inline void FLEXIO_SPI_SlaveTransferAbort(FLEXIO_SPI_Type *base, flexio_spi_slave_handle_t *handle) -{ - FLEXIO_SPI_MasterTransferAbort(base, handle); -} -/*! - * @brief Gets the data transfer status which used IRQ, share same API with master. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param handle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - * @param count Number of bytes transferred so far by the non-blocking transaction. - * @retval kStatus_InvalidArgument count is Invalid. - * @retval kStatus_Success Successfully return the count. - */ -static inline status_t FLEXIO_SPI_SlaveTransferGetCount(FLEXIO_SPI_Type *base, - flexio_spi_slave_handle_t *handle, - size_t *count) -{ - return FLEXIO_SPI_MasterTransferGetCount(base, handle, count); -} - -/*! - * @brief FlexIO SPI slave IRQ handler function. - * - * @param spiType Pointer to the FLEXIO_SPI_Type structure. - * @param spiHandle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - */ -void FLEXIO_SPI_SlaveTransferHandleIRQ(void *spiType, void *spiHandle); - -/*@}*/ - -#if defined(__cplusplus) -} -#endif /*_cplusplus*/ -/*@}*/ - -#endif /*FSL_FLEXIO_SPI_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_spi_edma.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_spi_edma.c deleted file mode 100644 index c1feba0f001..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_spi_edma.c +++ /dev/null @@ -1,565 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020, 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio_spi_edma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio_spi_edma" -#endif - -/*base, (uint32_t)kFLEXIO_SPI_TxDmaEnable, false); - - /* change the state */ - spiPrivateHandle->handle->txInProgress = false; - - /* All finished, call the callback */ - if ((spiPrivateHandle->handle->txInProgress == false) && (spiPrivateHandle->handle->rxInProgress == false)) - { - if (spiPrivateHandle->handle->callback != NULL) - { - (spiPrivateHandle->handle->callback)(spiPrivateHandle->base, spiPrivateHandle->handle, kStatus_Success, - spiPrivateHandle->handle->userData); - } - } - } -} - -static void FLEXIO_SPI_RxEDMACallback(edma_handle_t *handle, void *param, bool transferDone, uint32_t tcds) -{ - tcds = tcds; - flexio_spi_master_edma_private_handle_t *spiPrivateHandle = (flexio_spi_master_edma_private_handle_t *)param; - - if (transferDone) - { - /* Disable Rx dma */ - FLEXIO_SPI_EnableDMA(spiPrivateHandle->base, (uint32_t)kFLEXIO_SPI_RxDmaEnable, false); - - /* change the state */ - spiPrivateHandle->handle->rxInProgress = false; - - /* All finished, call the callback */ - if ((spiPrivateHandle->handle->txInProgress == false) && (spiPrivateHandle->handle->rxInProgress == false)) - { - if (spiPrivateHandle->handle->callback != NULL) - { - (spiPrivateHandle->handle->callback)(spiPrivateHandle->base, spiPrivateHandle->handle, kStatus_Success, - spiPrivateHandle->handle->userData); - } - } - } -} - -static status_t FLEXIO_SPI_EDMAConfig(FLEXIO_SPI_Type *base, - flexio_spi_master_edma_handle_t *handle, - flexio_spi_transfer_t *xfer) -{ - edma_transfer_config_t xferConfig = {0}; - flexio_spi_shift_direction_t direction = kFLEXIO_SPI_MsbFirst; - uint8_t bytesPerFrame; - uint8_t dataFormat = FLEXIO_SPI_XFER_DATA_FORMAT(xfer->flags); - - /* Configure the values in handle. */ - switch (dataFormat) - { - case (uint8_t)kFLEXIO_SPI_8bitMsb: - bytesPerFrame = 1U; - direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_8bitLsb: - bytesPerFrame = 1U; - direction = kFLEXIO_SPI_LsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_16bitMsb: - bytesPerFrame = 2U; - direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_16bitLsb: - bytesPerFrame = 2U; - direction = kFLEXIO_SPI_LsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_32bitMsb: - bytesPerFrame = 4U; - direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_32bitLsb: - bytesPerFrame = 4U; - direction = kFLEXIO_SPI_LsbFirst; - break; - default: - bytesPerFrame = 1U; - direction = kFLEXIO_SPI_MsbFirst; - assert(true); - break; - } - - /* Transfer size should be bytesPerFrame divisible. */ - if ((xfer->dataSize % bytesPerFrame) != 0U) - { - return kStatus_InvalidArgument; - } - - /* Save total transfer size. */ - handle->transferSize = xfer->dataSize; - - /* Configure tx transfer EDMA. */ - xferConfig.destAddr = FLEXIO_SPI_GetTxDataRegisterAddress(base, direction); - xferConfig.destOffset = 0; - if (bytesPerFrame == 1U) - { - xferConfig.srcTransferSize = kEDMA_TransferSize1Bytes; - xferConfig.destTransferSize = kEDMA_TransferSize1Bytes; - xferConfig.minorLoopBytes = 1U; - } - else if (bytesPerFrame == 2U) - { - if (direction == kFLEXIO_SPI_MsbFirst) - { - xferConfig.destAddr -= 1U; - } - xferConfig.srcTransferSize = kEDMA_TransferSize2Bytes; - xferConfig.destTransferSize = kEDMA_TransferSize2Bytes; - xferConfig.minorLoopBytes = 2U; - } - else - { - if (direction == kFLEXIO_SPI_MsbFirst) - { - xferConfig.destAddr -= 3U; - } - xferConfig.srcTransferSize = kEDMA_TransferSize4Bytes; - xferConfig.destTransferSize = kEDMA_TransferSize4Bytes; - xferConfig.minorLoopBytes = 4U; - } - - /* Configure DMA channel. */ - if (xfer->txData != NULL) - { - xferConfig.srcOffset = (int16_t)bytesPerFrame; - xferConfig.srcAddr = (uint32_t)(xfer->txData); - } - else - { - /* Disable the source increasement and source set to dummyData. */ - xferConfig.srcOffset = 0; - xferConfig.srcAddr = (uint32_t)(&s_dummyData); - } - - xferConfig.majorLoopCounts = (xfer->dataSize / xferConfig.minorLoopBytes); - - /* Store the initially configured eDMA minor byte transfer count into the FLEXIO SPI handle */ - handle->nbytes = (uint8_t)xferConfig.minorLoopBytes; - - if (handle->txHandle != NULL) - { - (void)EDMA_SubmitTransfer(handle->txHandle, &xferConfig); - } - - /* Configure rx transfer EDMA. */ - if (xfer->rxData != NULL) - { - xferConfig.srcAddr = FLEXIO_SPI_GetRxDataRegisterAddress(base, direction); - if (bytesPerFrame == 2U) - { - if (direction == kFLEXIO_SPI_LsbFirst) - { - xferConfig.srcAddr -= 1U; - } - } - else if (bytesPerFrame == 4U) - { - if (direction == kFLEXIO_SPI_LsbFirst) - { - xferConfig.srcAddr -= 3U; - } - } - else - { - } - xferConfig.srcOffset = 0; - xferConfig.destAddr = (uint32_t)(xfer->rxData); - xferConfig.destOffset = (int16_t)bytesPerFrame; - (void)EDMA_SubmitTransfer(handle->rxHandle, &xferConfig); - handle->rxInProgress = true; - FLEXIO_SPI_EnableDMA(base, (uint32_t)kFLEXIO_SPI_RxDmaEnable, true); - EDMA_StartTransfer(handle->rxHandle); - } - - /* Always start tx transfer. */ - if (handle->txHandle != NULL) - { - handle->txInProgress = true; - FLEXIO_SPI_EnableDMA(base, (uint32_t)kFLEXIO_SPI_TxDmaEnable, true); - EDMA_StartTransfer(handle->txHandle); - } - - return kStatus_Success; -} - -/*! - * brief Initializes the FlexIO SPI master eDMA handle. - * - * This function initializes the FlexIO SPI master eDMA handle which can be used for other FlexIO SPI master - * transactional - * APIs. - * For a specified FlexIO SPI instance, call this API once to get the initialized handle. - * - * param base Pointer to FLEXIO_SPI_Type structure. - * param handle Pointer to flexio_spi_master_edma_handle_t structure to store the transfer state. - * param callback SPI callback, NULL means no callback. - * param userData callback function parameter. - * param txHandle User requested eDMA handle for FlexIO SPI RX eDMA transfer. - * param rxHandle User requested eDMA handle for FlexIO SPI TX eDMA transfer. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO SPI eDMA type/handle table out of range. - */ -status_t FLEXIO_SPI_MasterTransferCreateHandleEDMA(FLEXIO_SPI_Type *base, - flexio_spi_master_edma_handle_t *handle, - flexio_spi_master_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *txHandle, - edma_handle_t *rxHandle) -{ - assert(handle != NULL); - - uint8_t index = 0; - - /* Find the an empty handle pointer to store the handle. */ - for (index = 0U; index < (uint8_t)FLEXIO_SPI_HANDLE_COUNT; index++) - { - if (s_edmaPrivateHandle[index].base == NULL) - { - s_edmaPrivateHandle[index].base = base; - s_edmaPrivateHandle[index].handle = handle; - break; - } - } - - if (index == (uint16_t)FLEXIO_SPI_HANDLE_COUNT) - { - return kStatus_OutOfRange; - } - - /* Set spi base to handle. */ - handle->txHandle = txHandle; - handle->rxHandle = rxHandle; - - /* Register callback and userData. */ - handle->callback = callback; - handle->userData = userData; - - /* Set SPI state to idle. */ - handle->txInProgress = false; - handle->rxInProgress = false; - - /* Install callback for Tx/Rx dma channel. */ - if (handle->txHandle != NULL) - { - EDMA_SetCallback(handle->txHandle, FLEXIO_SPI_TxEDMACallback, &s_edmaPrivateHandle[index]); - } - if (handle->rxHandle != NULL) - { - EDMA_SetCallback(handle->rxHandle, FLEXIO_SPI_RxEDMACallback, &s_edmaPrivateHandle[index]); - } - - return kStatus_Success; -} - -/*! - * brief Performs a non-blocking FlexIO SPI transfer using eDMA. - * - * note This interface returns immediately after transfer initiates. Call - * FLEXIO_SPI_MasterGetTransferCountEDMA to poll the transfer status and check - * whether the FlexIO SPI transfer is finished. - * - * param base Pointer to FLEXIO_SPI_Type structure. - * param handle Pointer to flexio_spi_master_edma_handle_t structure to store the transfer state. - * param xfer Pointer to FlexIO SPI transfer structure. - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_InvalidArgument Input argument is invalid. - * retval kStatus_FLEXIO_SPI_Busy FlexIO SPI is not idle, is running another transfer. - */ -status_t FLEXIO_SPI_MasterTransferEDMA(FLEXIO_SPI_Type *base, - flexio_spi_master_edma_handle_t *handle, - flexio_spi_transfer_t *xfer) -{ - assert(handle != NULL); - assert(xfer != NULL); - - uint32_t dataMode = 0; - uint16_t timerCmp = (uint16_t)base->flexioBase->TIMCMP[base->timerIndex[0]]; - uint8_t dataFormat = FLEXIO_SPI_XFER_DATA_FORMAT(xfer->flags); - - timerCmp &= 0x00FFU; - - /* Check if the device is busy. */ - if ((handle->txInProgress) || (handle->rxInProgress)) - { - return kStatus_FLEXIO_SPI_Busy; - } - - /* Check if input parameter invalid. */ - if (((xfer->txData == NULL) && (xfer->rxData == NULL)) || (xfer->dataSize == 0U)) - { - return kStatus_InvalidArgument; - } - - /* Timer1 controls the CS signal which enables/disables(asserts/deasserts) when timer0 enable/disable. Timer0 - enables when tx shifter is written and disables when timer compare. The timer compare event causes the - transmit shift registers to load which generates a tx register empty event. Since when timer stop bit is - disabled, a timer enable condition can be detected in the same cycle as a timer disable condition, so if - software writes the tx register upon the detection of tx register empty event, the timer enable condition - is triggered again, then the CS signal can remain low until software no longer writes the tx register. */ - if ((xfer->flags & (uint8_t)kFLEXIO_SPI_csContinuous) != 0U) - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TSTOP_MASK) | - FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitDisabled); - } - else - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TSTOP_MASK) | - FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitEnableOnTimerDisable); - } - - /* configure data mode. */ - if ((dataFormat == (uint8_t)kFLEXIO_SPI_8bitMsb) || (dataFormat == (uint8_t)kFLEXIO_SPI_8bitLsb)) - { - dataMode = (8UL * 2UL - 1UL) << 8U; - } - else if ((dataFormat == (uint8_t)kFLEXIO_SPI_16bitMsb) || (dataFormat == (uint8_t)kFLEXIO_SPI_16bitLsb)) - { - dataMode = (16UL * 2UL - 1UL) << 8U; - } - else if ((dataFormat == (uint8_t)kFLEXIO_SPI_32bitMsb) || (dataFormat == (uint8_t)kFLEXIO_SPI_32bitLsb)) - { - dataMode = (32UL * 2UL - 1UL) << 8U; - } - else - { - dataMode = (8UL * 2UL - 1UL) << 8U; - } - - dataMode |= timerCmp; - - base->flexioBase->TIMCMP[base->timerIndex[0]] = dataMode; - - return FLEXIO_SPI_EDMAConfig(base, handle, xfer); -} - -/*! - * brief Gets the remaining bytes for FlexIO SPI eDMA transfer. - * - * param base Pointer to FLEXIO_SPI_Type structure. - * param handle FlexIO SPI eDMA handle pointer. - * param count Number of bytes transferred so far by the non-blocking transaction. - */ -status_t FLEXIO_SPI_MasterTransferGetCountEDMA(FLEXIO_SPI_Type *base, - flexio_spi_master_edma_handle_t *handle, - size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - if (handle->rxInProgress) - { - *count = - (handle->transferSize - (uint32_t)handle->nbytes * EDMA_GetRemainingMajorLoopCount( - handle->rxHandle->base, handle->rxHandle->channel)); - } - else - { - *count = - (handle->transferSize - (uint32_t)handle->nbytes * EDMA_GetRemainingMajorLoopCount( - handle->txHandle->base, handle->txHandle->channel)); - } - - return kStatus_Success; -} - -/*! - * brief Aborts a FlexIO SPI transfer using eDMA. - * - * param base Pointer to FLEXIO_SPI_Type structure. - * param handle FlexIO SPI eDMA handle pointer. - */ -void FLEXIO_SPI_MasterTransferAbortEDMA(FLEXIO_SPI_Type *base, flexio_spi_master_edma_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable dma. */ - EDMA_AbortTransfer(handle->txHandle); - EDMA_AbortTransfer(handle->rxHandle); - - /* Disable DMA enable bit. */ - FLEXIO_SPI_EnableDMA(base, (uint32_t)kFLEXIO_SPI_DmaAllEnable, false); - - /* Set the handle state. */ - handle->txInProgress = false; - handle->rxInProgress = false; -} - -/*! - * brief Performs a non-blocking FlexIO SPI transfer using eDMA. - * - * note This interface returns immediately after transfer initiates. Call - * FLEXIO_SPI_SlaveGetTransferCountEDMA to poll the transfer status and - * check whether the FlexIO SPI transfer is finished. - * - * param base Pointer to FLEXIO_SPI_Type structure. - * param handle Pointer to flexio_spi_slave_edma_handle_t structure to store the transfer state. - * param xfer Pointer to FlexIO SPI transfer structure. - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_InvalidArgument Input argument is invalid. - * retval kStatus_FLEXIO_SPI_Busy FlexIO SPI is not idle, is running another transfer. - */ -status_t FLEXIO_SPI_SlaveTransferEDMA(FLEXIO_SPI_Type *base, - flexio_spi_slave_edma_handle_t *handle, - flexio_spi_transfer_t *xfer) -{ - assert(handle != NULL); - assert(xfer != NULL); - - uint32_t dataMode = 0U; - uint8_t dataFormat = FLEXIO_SPI_XFER_DATA_FORMAT(xfer->flags); - - /* Check if the device is busy. */ - if ((handle->txInProgress) || (handle->rxInProgress)) - { - return kStatus_FLEXIO_SPI_Busy; - } - - /* SCK timer use CS pin as inverted trigger so timer should be disbaled on trigger falling edge(CS re-asserts). */ - /* However if CPHA is first edge mode, timer will restart each time right after timer compare event occur and - before CS pin re-asserts, which triggers another shifter load. To avoid this, when in CS dis-continuous mode, - timer should disable in timer compare rather than trigger falling edge(CS re-asserts), and in CS continuous mode, - tx/rx shifters should be flushed after transfer finishes and before next transfer starts. */ - FLEXIO_SPI_FlushShifters(base); - if ((xfer->flags & (uint8_t)kFLEXIO_SPI_csContinuous) != 0U) - { - base->flexioBase->TIMCFG[base->timerIndex[0]] |= FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTriggerFallingEdge); - } - else - { - if ((base->flexioBase->SHIFTCTL[base->shifterIndex[0]] & FLEXIO_SHIFTCTL_TIMPOL_MASK) == - FLEXIO_SHIFTCTL_TIMPOL(kFLEXIO_ShifterTimerPolarityOnNegitive)) - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TIMDIS_MASK) | - FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTimerCompare); - } - else - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TIMDIS_MASK) | - FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTriggerFallingEdge); - } - } - - /* Check if input parameter invalid. */ - if (((xfer->txData == NULL) && (xfer->rxData == NULL)) || (xfer->dataSize == 0U)) - { - return kStatus_InvalidArgument; - } - - /* configure data mode. */ - if ((dataFormat == (uint8_t)kFLEXIO_SPI_8bitMsb) || (dataFormat == (uint8_t)kFLEXIO_SPI_8bitLsb)) - { - dataMode = 8U * 2U - 1U; - } - else if ((dataFormat == (uint8_t)kFLEXIO_SPI_16bitMsb) || (dataFormat == (uint8_t)kFLEXIO_SPI_16bitLsb)) - { - dataMode = 16U * 2U - 1U; - } - else if ((dataFormat == (uint8_t)kFLEXIO_SPI_32bitMsb) || (dataFormat == (uint8_t)kFLEXIO_SPI_32bitLsb)) - { - dataMode = 32UL * 2UL - 1UL; - } - else - { - dataMode = 8U * 2U - 1U; - } - - base->flexioBase->TIMCMP[base->timerIndex[0]] = dataMode; - - return FLEXIO_SPI_EDMAConfig(base, handle, xfer); -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_spi_edma.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_spi_edma.h deleted file mode 100644 index 67005489862..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_spi_edma.h +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020, 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_FLEXIO_SPI_EDMA_H_ -#define FSL_FLEXIO_SPI_EDMA_H_ - -#include "fsl_flexio_spi.h" -#include "fsl_edma.h" - -/*! - * @addtogroup flexio_edma_spi - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief FlexIO SPI EDMA driver version. */ -#define FSL_FLEXIO_SPI_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 3, 0)) -/*@}*/ - -/*! @brief typedef for flexio_spi_master_edma_handle_t in advance. */ -typedef struct _flexio_spi_master_edma_handle flexio_spi_master_edma_handle_t; - -/*! @brief Slave handle is the same with master handle. */ -typedef flexio_spi_master_edma_handle_t flexio_spi_slave_edma_handle_t; - -/*! @brief FlexIO SPI master callback for finished transmit */ -typedef void (*flexio_spi_master_edma_transfer_callback_t)(FLEXIO_SPI_Type *base, - flexio_spi_master_edma_handle_t *handle, - status_t status, - void *userData); - -/*! @brief FlexIO SPI slave callback for finished transmit */ -typedef void (*flexio_spi_slave_edma_transfer_callback_t)(FLEXIO_SPI_Type *base, - flexio_spi_slave_edma_handle_t *handle, - status_t status, - void *userData); - -/*! @brief FlexIO SPI eDMA transfer handle, users should not touch the content of the handle.*/ -struct _flexio_spi_master_edma_handle -{ - size_t transferSize; /*!< Total bytes to be transferred. */ - uint8_t nbytes; /*!< eDMA minor byte transfer count initially configured. */ - bool txInProgress; /*!< Send transfer in progress */ - bool rxInProgress; /*!< Receive transfer in progress */ - edma_handle_t *txHandle; /*!< DMA handler for SPI send */ - edma_handle_t *rxHandle; /*!< DMA handler for SPI receive */ - flexio_spi_master_edma_transfer_callback_t callback; /*!< Callback for SPI DMA transfer */ - void *userData; /*!< User Data for SPI DMA callback */ -}; - -/******************************************************************************* - * APIs - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name eDMA Transactional - * @{ - */ - -/*! - * @brief Initializes the FlexIO SPI master eDMA handle. - * - * This function initializes the FlexIO SPI master eDMA handle which can be used for other FlexIO SPI master - * transactional - * APIs. - * For a specified FlexIO SPI instance, call this API once to get the initialized handle. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle Pointer to flexio_spi_master_edma_handle_t structure to store the transfer state. - * @param callback SPI callback, NULL means no callback. - * @param userData callback function parameter. - * @param txHandle User requested eDMA handle for FlexIO SPI RX eDMA transfer. - * @param rxHandle User requested eDMA handle for FlexIO SPI TX eDMA transfer. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO SPI eDMA type/handle table out of range. - */ -status_t FLEXIO_SPI_MasterTransferCreateHandleEDMA(FLEXIO_SPI_Type *base, - flexio_spi_master_edma_handle_t *handle, - flexio_spi_master_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *txHandle, - edma_handle_t *rxHandle); - -/*! - * @brief Performs a non-blocking FlexIO SPI transfer using eDMA. - * - * @note This interface returns immediately after transfer initiates. Call - * FLEXIO_SPI_MasterGetTransferCountEDMA to poll the transfer status and check - * whether the FlexIO SPI transfer is finished. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle Pointer to flexio_spi_master_edma_handle_t structure to store the transfer state. - * @param xfer Pointer to FlexIO SPI transfer structure. - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_InvalidArgument Input argument is invalid. - * @retval kStatus_FLEXIO_SPI_Busy FlexIO SPI is not idle, is running another transfer. - */ -status_t FLEXIO_SPI_MasterTransferEDMA(FLEXIO_SPI_Type *base, - flexio_spi_master_edma_handle_t *handle, - flexio_spi_transfer_t *xfer); - -/*! - * @brief Aborts a FlexIO SPI transfer using eDMA. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle FlexIO SPI eDMA handle pointer. - */ -void FLEXIO_SPI_MasterTransferAbortEDMA(FLEXIO_SPI_Type *base, flexio_spi_master_edma_handle_t *handle); - -/*! - * @brief Gets the number of bytes transferred so far using FlexIO SPI master eDMA. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle FlexIO SPI eDMA handle pointer. - * @param count Number of bytes transferred so far by the non-blocking transaction. - */ -status_t FLEXIO_SPI_MasterTransferGetCountEDMA(FLEXIO_SPI_Type *base, - flexio_spi_master_edma_handle_t *handle, - size_t *count); - -/*! - * @brief Initializes the FlexIO SPI slave eDMA handle. - * - * This function initializes the FlexIO SPI slave eDMA handle. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle Pointer to flexio_spi_slave_edma_handle_t structure to store the transfer state. - * @param callback SPI callback, NULL means no callback. - * @param userData callback function parameter. - * @param txHandle User requested eDMA handle for FlexIO SPI TX eDMA transfer. - * @param rxHandle User requested eDMA handle for FlexIO SPI RX eDMA transfer. - */ -static inline void FLEXIO_SPI_SlaveTransferCreateHandleEDMA(FLEXIO_SPI_Type *base, - flexio_spi_slave_edma_handle_t *handle, - flexio_spi_slave_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *txHandle, - edma_handle_t *rxHandle) -{ - (void)FLEXIO_SPI_MasterTransferCreateHandleEDMA(base, handle, callback, userData, txHandle, rxHandle); -} - -/*! - * @brief Performs a non-blocking FlexIO SPI transfer using eDMA. - * - * @note This interface returns immediately after transfer initiates. Call - * FLEXIO_SPI_SlaveGetTransferCountEDMA to poll the transfer status and - * check whether the FlexIO SPI transfer is finished. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle Pointer to flexio_spi_slave_edma_handle_t structure to store the transfer state. - * @param xfer Pointer to FlexIO SPI transfer structure. - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_InvalidArgument Input argument is invalid. - * @retval kStatus_FLEXIO_SPI_Busy FlexIO SPI is not idle, is running another transfer. - */ -status_t FLEXIO_SPI_SlaveTransferEDMA(FLEXIO_SPI_Type *base, - flexio_spi_slave_edma_handle_t *handle, - flexio_spi_transfer_t *xfer); - -/*! - * @brief Aborts a FlexIO SPI transfer using eDMA. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle Pointer to flexio_spi_slave_edma_handle_t structure to store the transfer state. - */ -static inline void FLEXIO_SPI_SlaveTransferAbortEDMA(FLEXIO_SPI_Type *base, flexio_spi_slave_edma_handle_t *handle) -{ - FLEXIO_SPI_MasterTransferAbortEDMA(base, handle); -} - -/*! - * @brief Gets the number of bytes transferred so far using FlexIO SPI slave eDMA. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle FlexIO SPI eDMA handle pointer. - * @param count Number of bytes transferred so far by the non-blocking transaction. - */ -static inline status_t FLEXIO_SPI_SlaveTransferGetCountEDMA(FLEXIO_SPI_Type *base, - flexio_spi_slave_edma_handle_t *handle, - size_t *count) -{ - return FLEXIO_SPI_MasterTransferGetCountEDMA(base, handle, count); -} - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_uart.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_uart.c deleted file mode 100644 index 13890caee7d..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_uart.c +++ /dev/null @@ -1,1023 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio_uart.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio_uart" -#endif - -/*flexioBase); -} - -static size_t FLEXIO_UART_TransferGetRxRingBufferLength(flexio_uart_handle_t *handle) -{ - size_t size; - uint16_t rxRingBufferHead = handle->rxRingBufferHead; - uint16_t rxRingBufferTail = handle->rxRingBufferTail; - - if (rxRingBufferTail > rxRingBufferHead) - { - size = (size_t)rxRingBufferHead + handle->rxRingBufferSize - (size_t)rxRingBufferTail; - } - else - { - size = (size_t)rxRingBufferHead - (size_t)rxRingBufferTail; - } - - return size; -} - -static bool FLEXIO_UART_TransferIsRxRingBufferFull(flexio_uart_handle_t *handle) -{ - bool full; - - if (FLEXIO_UART_TransferGetRxRingBufferLength(handle) == (handle->rxRingBufferSize - 1U)) - { - full = true; - } - else - { - full = false; - } - - return full; -} - -/*! - * brief Ungates the FlexIO clock, resets the FlexIO module, configures FlexIO UART - * hardware, and configures the FlexIO UART with FlexIO UART configuration. - * The configuration structure can be filled by the user or be set with - * default values by FLEXIO_UART_GetDefaultConfig(). - * - * Example - code - FLEXIO_UART_Type base = { - .flexioBase = FLEXIO, - .TxPinIndex = 0, - .RxPinIndex = 1, - .shifterIndex = {0,1}, - .timerIndex = {0,1} - }; - flexio_uart_config_t config = { - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .baudRate_Bps = 115200U, - .bitCountPerChar = 8 - }; - FLEXIO_UART_Init(base, &config, srcClock_Hz); - endcode - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param userConfig Pointer to the flexio_uart_config_t structure. - * param srcClock_Hz FlexIO source clock in Hz. - * retval kStatus_Success Configuration success. - * retval kStatus_FLEXIO_UART_BaudrateNotSupport Baudrate is not supported for current clock source frequency. -*/ -status_t FLEXIO_UART_Init(FLEXIO_UART_Type *base, const flexio_uart_config_t *userConfig, uint32_t srcClock_Hz) -{ - assert((base != NULL) && (userConfig != NULL)); - - flexio_shifter_config_t shifterConfig; - flexio_timer_config_t timerConfig; - uint32_t ctrlReg = 0; - uint16_t timerDiv = 0; - uint16_t timerCmp = 0; - uint32_t calculatedBaud; - uint32_t diff; - status_t result = kStatus_Success; - - /* Clear the shifterConfig & timerConfig struct. */ - (void)memset(&shifterConfig, 0, sizeof(shifterConfig)); - (void)memset(&timerConfig, 0, sizeof(timerConfig)); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate flexio clock. */ - CLOCK_EnableClock(s_flexioClocks[FLEXIO_UART_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Configure FLEXIO UART */ - ctrlReg = base->flexioBase->CTRL; - ctrlReg &= ~(FLEXIO_CTRL_DOZEN_MASK | FLEXIO_CTRL_DBGE_MASK | FLEXIO_CTRL_FASTACC_MASK | FLEXIO_CTRL_FLEXEN_MASK); - ctrlReg |= (FLEXIO_CTRL_DBGE(userConfig->enableInDebug) | FLEXIO_CTRL_FASTACC(userConfig->enableFastAccess) | - FLEXIO_CTRL_FLEXEN(userConfig->enableUart)); - if (!userConfig->enableInDoze) - { - ctrlReg |= FLEXIO_CTRL_DOZEN_MASK; - } - - base->flexioBase->CTRL = ctrlReg; - - /* Do hardware configuration. */ - /* 1. Configure the shifter 0 for tx. */ - shifterConfig.timerSelect = base->timerIndex[0]; - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive; - shifterConfig.pinConfig = kFLEXIO_PinConfigOutput; - shifterConfig.pinSelect = base->TxPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveHigh; - shifterConfig.shifterMode = kFLEXIO_ShifterModeTransmit; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitHigh; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitLow; - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[0], &shifterConfig); - - /*2. Configure the timer 0 for tx. */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->shifterIndex[0]); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - timerConfig.pinSelect = base->TxPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveHigh; - timerConfig.timerMode = kFLEXIO_TimerModeDual8BitBaudBit; - timerConfig.timerOutput = kFLEXIO_TimerOutputOneNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput; - timerConfig.timerReset = kFLEXIO_TimerResetNever; - timerConfig.timerDisable = kFLEXIO_TimerDisableOnTimerCompare; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnTriggerHigh; - timerConfig.timerStop = kFLEXIO_TimerStopBitEnableOnTimerDisable; - timerConfig.timerStart = kFLEXIO_TimerStartBitEnabled; - - timerDiv = (uint16_t)(srcClock_Hz / userConfig->baudRate_Bps); - timerDiv = timerDiv / 2U - 1U; - - if (timerDiv > 0xFFU) - { - /* Check whether the calculated timerDiv is within allowed range. */ - return kStatus_FLEXIO_UART_BaudrateNotSupport; - } - else - { - /* Check to see if actual baud rate is within 3% of desired baud rate - * based on the best calculated timerDiv value */ - calculatedBaud = srcClock_Hz / (((uint32_t)timerDiv + 1U) * 2U); - /* timerDiv cannot be larger than the ideal divider, so calculatedBaud is definitely larger - than configured baud */ - diff = calculatedBaud - userConfig->baudRate_Bps; - if (diff > ((userConfig->baudRate_Bps / 100U) * 3U)) - { - return kStatus_FLEXIO_UART_BaudrateNotSupport; - } - } - - timerCmp = ((uint16_t)userConfig->bitCountPerChar * 2U - 1U) << 8U; - timerCmp |= timerDiv; - - timerConfig.timerCompare = timerCmp; - - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[0], &timerConfig); - - /* 3. Configure the shifter 1 for rx. */ - shifterConfig.timerSelect = base->timerIndex[1]; - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnNegitive; - shifterConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - shifterConfig.pinSelect = base->RxPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveHigh; - shifterConfig.shifterMode = kFLEXIO_ShifterModeReceive; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitHigh; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitLow; - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[1], &shifterConfig); - - /* 4. Configure the timer 1 for rx. */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_PININPUT(base->RxPinIndex); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveHigh; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceExternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - timerConfig.pinSelect = base->RxPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveLow; - timerConfig.timerMode = kFLEXIO_TimerModeDual8BitBaudBit; - timerConfig.timerOutput = kFLEXIO_TimerOutputOneAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput; - timerConfig.timerReset = kFLEXIO_TimerResetOnTimerPinRisingEdge; - timerConfig.timerDisable = kFLEXIO_TimerDisableOnTimerCompare; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnPinRisingEdge; - timerConfig.timerStop = kFLEXIO_TimerStopBitEnableOnTimerDisable; - timerConfig.timerStart = kFLEXIO_TimerStartBitEnabled; - - timerConfig.timerCompare = timerCmp; - - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[1], &timerConfig); - - return result; -} - -/*! - * brief Resets the FlexIO UART shifter and timer config. - * - * note After calling this API, call the FLEXO_UART_Init to use the FlexIO UART module. - * - * param base Pointer to FLEXIO_UART_Type structure - */ -void FLEXIO_UART_Deinit(FLEXIO_UART_Type *base) -{ - base->flexioBase->SHIFTCFG[base->shifterIndex[0]] = 0; - base->flexioBase->SHIFTCTL[base->shifterIndex[0]] = 0; - base->flexioBase->SHIFTCFG[base->shifterIndex[1]] = 0; - base->flexioBase->SHIFTCTL[base->shifterIndex[1]] = 0; - base->flexioBase->TIMCFG[base->timerIndex[0]] = 0; - base->flexioBase->TIMCMP[base->timerIndex[0]] = 0; - base->flexioBase->TIMCTL[base->timerIndex[0]] = 0; - base->flexioBase->TIMCFG[base->timerIndex[1]] = 0; - base->flexioBase->TIMCMP[base->timerIndex[1]] = 0; - base->flexioBase->TIMCTL[base->timerIndex[1]] = 0; - /* Clear the shifter flag. */ - base->flexioBase->SHIFTSTAT = (1UL << base->shifterIndex[0]); - base->flexioBase->SHIFTSTAT = (1UL << base->shifterIndex[1]); - /* Clear the timer flag. */ - base->flexioBase->TIMSTAT = (1UL << base->timerIndex[0]); - base->flexioBase->TIMSTAT = (1UL << base->timerIndex[1]); -} - -/*! - * brief Gets the default configuration to configure the FlexIO UART. The configuration - * can be used directly for calling the FLEXIO_UART_Init(). - * Example: - code - flexio_uart_config_t config; - FLEXIO_UART_GetDefaultConfig(&userConfig); - endcode - * param userConfig Pointer to the flexio_uart_config_t structure. -*/ -void FLEXIO_UART_GetDefaultConfig(flexio_uart_config_t *userConfig) -{ - assert(userConfig != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(userConfig, 0, sizeof(*userConfig)); - - userConfig->enableUart = true; - userConfig->enableInDoze = false; - userConfig->enableInDebug = true; - userConfig->enableFastAccess = false; - /* Default baud rate 115200. */ - userConfig->baudRate_Bps = 115200U; - /* Default bit count at 8. */ - userConfig->bitCountPerChar = kFLEXIO_UART_8BitsPerChar; -} - -/*! - * brief Enables the FlexIO UART interrupt. - * - * This function enables the FlexIO UART interrupt. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param mask Interrupt source. - */ -void FLEXIO_UART_EnableInterrupts(FLEXIO_UART_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_UART_TxDataRegEmptyInterruptEnable) != 0U) - { - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable) != 0U) - { - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Disables the FlexIO UART interrupt. - * - * This function disables the FlexIO UART interrupt. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param mask Interrupt source. - */ -void FLEXIO_UART_DisableInterrupts(FLEXIO_UART_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_UART_TxDataRegEmptyInterruptEnable) != 0U) - { - FLEXIO_DisableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable) != 0U) - { - FLEXIO_DisableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Gets the FlexIO UART status flags. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * return FlexIO UART status flags. - */ - -uint32_t FLEXIO_UART_GetStatusFlags(FLEXIO_UART_Type *base) -{ - uint32_t status = 0U; - status = - ((FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0])) >> base->shifterIndex[0]); - status |= - (((FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[1])) >> (base->shifterIndex[1])) - << 1U); - status |= - (((FLEXIO_GetShifterErrorFlags(base->flexioBase) & (1UL << base->shifterIndex[1])) >> (base->shifterIndex[1])) - << 2U); - return status; -} - -/*! - * brief Gets the FlexIO UART status flags. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param mask Status flag. - * The parameter can be any combination of the following values: - * arg kFLEXIO_UART_TxDataRegEmptyFlag - * arg kFLEXIO_UART_RxEmptyFlag - * arg kFLEXIO_UART_RxOverRunFlag - */ - -void FLEXIO_UART_ClearStatusFlags(FLEXIO_UART_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_UART_TxDataRegEmptyFlag) != 0U) - { - FLEXIO_ClearShifterStatusFlags(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_UART_RxDataRegFullFlag) != 0U) - { - FLEXIO_ClearShifterStatusFlags(base->flexioBase, 1UL << base->shifterIndex[1]); - } - if ((mask & (uint32_t)kFLEXIO_UART_RxOverRunFlag) != 0U) - { - FLEXIO_ClearShifterErrorFlags(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Sends a buffer of data bytes. - * - * note This function blocks using the polling method until all bytes have been sent. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param txData The data bytes to send. - * param txSize The number of data bytes to send. - * retval kStatus_FLEXIO_UART_Timeout Transmission timed out and was aborted. - * retval kStatus_Success Successfully wrote all data. - */ -status_t FLEXIO_UART_WriteBlocking(FLEXIO_UART_Type *base, const uint8_t *txData, size_t txSize) -{ - assert(txData != NULL); - assert(txSize != 0U); -#if UART_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != txSize--) - { - /* Wait until data transfer complete. */ -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; - while ((0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) && - (0U != --waitTimes)) -#else - while (0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) -#endif - { - } -#if UART_RETRY_TIMES - if (0U == waitTimes) - { - return kStatus_FLEXIO_UART_Timeout; - } -#endif - - base->flexioBase->SHIFTBUF[base->shifterIndex[0]] = *txData++; - } - return kStatus_Success; -} - -/*! - * brief Receives a buffer of bytes. - * - * note This function blocks using the polling method until all bytes have been received. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param rxData The buffer to store the received bytes. - * param rxSize The number of data bytes to be received. - * retval kStatus_FLEXIO_UART_Timeout Transmission timed out and was aborted. - * retval kStatus_Success Successfully received all data. - */ -status_t FLEXIO_UART_ReadBlocking(FLEXIO_UART_Type *base, uint8_t *rxData, size_t rxSize) -{ - assert(rxData != NULL); - assert(rxSize != 0U); -#if UART_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != rxSize--) - { - /* Wait until data transfer complete. */ -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; - while ((0U == (FLEXIO_UART_GetStatusFlags(base) & (uint32_t)kFLEXIO_UART_RxDataRegFullFlag)) && - (0U != --waitTimes)) -#else - while (0U == (FLEXIO_UART_GetStatusFlags(base) & (uint32_t)kFLEXIO_UART_RxDataRegFullFlag)) -#endif - { - } -#if UART_RETRY_TIMES - if (0U == waitTimes) - { - return kStatus_FLEXIO_UART_Timeout; - } -#endif - - *rxData++ = (uint8_t)(base->flexioBase->SHIFTBUFBYS[base->shifterIndex[1]]); - } - return kStatus_Success; -} - -/*! - * brief Initializes the UART handle. - * - * This function initializes the FlexIO UART handle, which can be used for other FlexIO - * UART transactional APIs. Call this API once to get the - * initialized handle. - * - * The UART driver supports the "background" receiving, which means that users can set up - * a RX ring buffer optionally. Data received is stored into the ring buffer even when - * the user doesn't call the FLEXIO_UART_TransferReceiveNonBlocking() API. If there is already data - * received in the ring buffer, users can get the received data from the ring buffer - * directly. The ring buffer is disabled if passing NULL as p ringBuffer. - * - * param base to FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * param callback The callback function. - * param userData The parameter of the callback function. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_UART_TransferCreateHandle(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - flexio_uart_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - IRQn_Type flexio_irqs[] = FLEXIO_IRQS; - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Set the TX/RX state. */ - handle->rxState = (uint8_t)kFLEXIO_UART_RxIdle; - handle->txState = (uint8_t)kFLEXIO_UART_TxIdle; - - /* Set the callback and user data. */ - handle->callback = callback; - handle->userData = userData; - - /* Clear pending NVIC IRQ before enable NVIC IRQ. */ - NVIC_ClearPendingIRQ(flexio_irqs[FLEXIO_UART_GetInstance(base)]); - /* Enable interrupt in NVIC. */ - (void)EnableIRQ(flexio_irqs[FLEXIO_UART_GetInstance(base)]); - - /* Save the context in global variables to support the double weak mechanism. */ - return FLEXIO_RegisterHandleIRQ(base, handle, FLEXIO_UART_TransferHandleIRQ); -} - -/*! - * brief Sets up the RX ring buffer. - * - * This function sets up the RX ring buffer to a specific UART handle. - * - * When the RX ring buffer is used, data received is stored into the ring buffer even when - * the user doesn't call the UART_ReceiveNonBlocking() API. If there is already data received - * in the ring buffer, users can get the received data from the ring buffer directly. - * - * note When using the RX ring buffer, one byte is reserved for internal use. In other - * words, if p ringBufferSize is 32, only 31 bytes are used for saving data. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * param ringBuffer Start address of ring buffer for background receiving. Pass NULL to disable the ring buffer. - * param ringBufferSize Size of the ring buffer. - */ -void FLEXIO_UART_TransferStartRingBuffer(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - uint8_t *ringBuffer, - size_t ringBufferSize) -{ - assert(handle != NULL); - - /* Setup the ringbuffer address */ - if (ringBuffer != NULL) - { - handle->rxRingBuffer = ringBuffer; - handle->rxRingBufferSize = ringBufferSize; - handle->rxRingBufferHead = 0U; - handle->rxRingBufferTail = 0U; - - /* Enable the interrupt to accept the data when user need the ring buffer. */ - FLEXIO_UART_EnableInterrupts(base, (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable); - } -} - -/*! - * brief Aborts the background transfer and uninstalls the ring buffer. - * - * This function aborts the background transfer and uninstalls the ring buffer. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferStopRingBuffer(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle) -{ - assert(handle != NULL); - - if (handle->rxState == (uint8_t)kFLEXIO_UART_RxIdle) - { - FLEXIO_UART_DisableInterrupts(base, (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable); - } - - handle->rxRingBuffer = NULL; - handle->rxRingBufferSize = 0U; - handle->rxRingBufferHead = 0U; - handle->rxRingBufferTail = 0U; -} - -/*! - * brief Transmits a buffer of data using the interrupt method. - * - * This function sends data using an interrupt method. This is a non-blocking function, - * which returns directly without waiting for all data to be written to the TX register. When - * all data is written to the TX register in ISR, the FlexIO UART driver calls the callback - * function and passes the ref kStatus_FLEXIO_UART_TxIdle as status parameter. - * - * note The kStatus_FLEXIO_UART_TxIdle is passed to the upper layer when all data is written - * to the TX register. However, it does not ensure that all data is sent out. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * param xfer FlexIO UART transfer structure. See #flexio_uart_transfer_t. - * retval kStatus_Success Successfully starts the data transmission. - * retval kStatus_UART_TxBusy Previous transmission still not finished, data not written to the TX register. - */ -status_t FLEXIO_UART_TransferSendNonBlocking(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - flexio_uart_transfer_t *xfer) -{ - status_t status; - - /* Return error if xfer invalid. */ - if ((0U == xfer->dataSize) || (NULL == xfer->txData)) - { - return kStatus_InvalidArgument; - } - - /* Return error if current TX busy. */ - if ((uint8_t)kFLEXIO_UART_TxBusy == handle->txState) - { - status = kStatus_FLEXIO_UART_TxBusy; - } - else - { - handle->txData = xfer->txData; - handle->txDataSize = xfer->dataSize; - handle->txDataSizeAll = xfer->dataSize; - handle->txState = (uint8_t)kFLEXIO_UART_TxBusy; - - /* Enable transmiter interrupt. */ - FLEXIO_UART_EnableInterrupts(base, (uint32_t)kFLEXIO_UART_TxDataRegEmptyInterruptEnable); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Aborts the interrupt-driven data transmit. - * - * This function aborts the interrupt-driven data sending. Get the remainBytes to find out - * how many bytes are still not sent out. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferAbortSend(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle) -{ - /* Disable the transmitter and disable the interrupt. */ - FLEXIO_UART_DisableInterrupts(base, (uint32_t)kFLEXIO_UART_TxDataRegEmptyInterruptEnable); - - handle->txDataSize = 0U; - handle->txState = (uint8_t)kFLEXIO_UART_TxIdle; -} - -/*! - * brief Gets the number of bytes sent. - * - * This function gets the number of bytes sent driven by interrupt. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * param count Number of bytes sent so far by the non-blocking transaction. - * retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetSendCount(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - assert(count != NULL); - - if ((uint8_t)kFLEXIO_UART_TxIdle == handle->txState) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->txDataSizeAll - handle->txDataSize; - - return kStatus_Success; -} - -/*! - * brief Receives a buffer of data using the interrupt method. - * - * This function receives data using the interrupt method. This is a non-blocking function, - * which returns without waiting for all data to be received. - * If the RX ring buffer is used and not empty, the data in ring buffer is copied and - * the parameter p receivedBytes shows how many bytes are copied from the ring buffer. - * After copying, if the data in ring buffer is not enough to read, the receive - * request is saved by the UART driver. When new data arrives, the receive request - * is serviced first. When all data is received, the UART driver notifies the upper layer - * through a callback function and passes the status parameter ref kStatus_UART_RxIdle. - * For example, if the upper layer needs 10 bytes but there are only 5 bytes in the ring buffer, - * the 5 bytes are copied to xfer->data. This function returns with the - * parameter p receivedBytes set to 5. For the last 5 bytes, newly arrived data is - * saved from the xfer->data[5]. When 5 bytes are received, the UART driver notifies upper layer. - * If the RX ring buffer is not enabled, this function enables the RX and RX interrupt - * to receive data to xfer->data. When all data is received, the upper layer is notified. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * param xfer UART transfer structure. See #flexio_uart_transfer_t. - * param receivedBytes Bytes received from the ring buffer directly. - * retval kStatus_Success Successfully queue the transfer into the transmit queue. - * retval kStatus_FLEXIO_UART_RxBusy Previous receive request is not finished. - */ -status_t FLEXIO_UART_TransferReceiveNonBlocking(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - flexio_uart_transfer_t *xfer, - size_t *receivedBytes) -{ - uint32_t i; - status_t status; - /* How many bytes to copy from ring buffer to user memory. */ - size_t bytesToCopy = 0U; - /* How many bytes to receive. */ - size_t bytesToReceive; - /* How many bytes currently have received. */ - size_t bytesCurrentReceived; - - /* Return error if xfer invalid. */ - if ((0U == xfer->dataSize) || (NULL == xfer->rxData)) - { - return kStatus_InvalidArgument; - } - - /* How to get data: - 1. If RX ring buffer is not enabled, then save xfer->data and xfer->dataSize - to uart handle, enable interrupt to store received data to xfer->data. When - all data received, trigger callback. - 2. If RX ring buffer is enabled and not empty, get data from ring buffer first. - If there are enough data in ring buffer, copy them to xfer->data and return. - If there are not enough data in ring buffer, copy all of them to xfer->data, - save the xfer->data remained empty space to uart handle, receive data - to this empty space and trigger callback when finished. */ - - if ((uint8_t)kFLEXIO_UART_RxBusy == handle->rxState) - { - status = kStatus_FLEXIO_UART_RxBusy; - } - else - { - bytesToReceive = xfer->dataSize; - bytesCurrentReceived = 0U; - - /* If RX ring buffer is used. */ - if (handle->rxRingBuffer != NULL) - { - /* Disable FLEXIO_UART RX IRQ, protect ring buffer. */ - FLEXIO_UART_DisableInterrupts(base, (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable); - - /* How many bytes in RX ring buffer currently. */ - bytesToCopy = FLEXIO_UART_TransferGetRxRingBufferLength(handle); - - if (bytesToCopy != 0U) - { - bytesToCopy = MIN(bytesToReceive, bytesToCopy); - - bytesToReceive -= bytesToCopy; - - /* Copy data from ring buffer to user memory. */ - for (i = 0U; i < bytesToCopy; i++) - { - xfer->rxData[bytesCurrentReceived++] = handle->rxRingBuffer[handle->rxRingBufferTail]; - - /* Wrap to 0. Not use modulo (%) because it might be large and slow. */ - if ((uint32_t)handle->rxRingBufferTail + 1U == handle->rxRingBufferSize) - { - handle->rxRingBufferTail = 0U; - } - else - { - handle->rxRingBufferTail++; - } - } - } - - /* If ring buffer does not have enough data, still need to read more data. */ - if (bytesToReceive != 0U) - { - /* No data in ring buffer, save the request to UART handle. */ - handle->rxData = xfer->rxData + bytesCurrentReceived; - handle->rxDataSize = bytesToReceive; - handle->rxDataSizeAll = xfer->dataSize; - handle->rxState = (uint8_t)kFLEXIO_UART_RxBusy; - } - - /* Enable FLEXIO_UART RX IRQ if previously enabled. */ - FLEXIO_UART_EnableInterrupts(base, (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable); - - /* Call user callback since all data are received. */ - if (0U == bytesToReceive) - { - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_FLEXIO_UART_RxIdle, handle->userData); - } - } - } - /* Ring buffer not used. */ - else - { - handle->rxData = xfer->rxData + bytesCurrentReceived; - handle->rxDataSize = bytesToReceive; - handle->rxDataSizeAll = bytesToReceive; - handle->rxState = (uint8_t)kFLEXIO_UART_RxBusy; - - /* Enable RX interrupt. */ - FLEXIO_UART_EnableInterrupts(base, (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable); - } - - /* Return the how many bytes have read. */ - if (receivedBytes != NULL) - { - *receivedBytes = bytesCurrentReceived; - } - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Aborts the receive data which was using IRQ. - * - * This function aborts the receive data which was using IRQ. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferAbortReceive(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle) -{ - /* Only abort the receive to handle->rxData, the RX ring buffer is still working. */ - if (NULL == handle->rxRingBuffer) - { - /* Disable RX interrupt. */ - FLEXIO_UART_DisableInterrupts(base, (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable); - } - - handle->rxDataSize = 0U; - handle->rxState = (uint8_t)kFLEXIO_UART_RxIdle; -} - -/*! - * brief Gets the number of bytes received. - * - * This function gets the number of bytes received driven by interrupt. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * param count Number of bytes received so far by the non-blocking transaction. - * retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetReceiveCount(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - assert(count != NULL); - - if ((uint8_t)kFLEXIO_UART_RxIdle == handle->rxState) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->rxDataSizeAll - handle->rxDataSize; - - return kStatus_Success; -} - -/*! - * brief FlexIO UART IRQ handler function. - * - * This function processes the FlexIO UART transmit and receives the IRQ request. - * - * param uartType Pointer to the FLEXIO_UART_Type structure. - * param uartHandle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferHandleIRQ(void *uartType, void *uartHandle) -{ - uint8_t count = 1; - FLEXIO_UART_Type *base = (FLEXIO_UART_Type *)uartType; - flexio_uart_handle_t *handle = (flexio_uart_handle_t *)uartHandle; - uint16_t rxRingBufferHead; - - /* Read the status back. */ - uint32_t status = FLEXIO_UART_GetStatusFlags(base); - - /* If RX overrun. */ - if (((uint32_t)kFLEXIO_UART_RxOverRunFlag & status) != 0U) - { - /* Clear Overrun flag. */ - FLEXIO_UART_ClearStatusFlags(base, (uint32_t)kFLEXIO_UART_RxOverRunFlag); - - /* Trigger callback. */ - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_FLEXIO_UART_RxHardwareOverrun, handle->userData); - } - } - - /* Receive data register full */ - if ((((uint32_t)kFLEXIO_UART_RxDataRegFullFlag & status) != 0U) && - ((base->flexioBase->SHIFTSIEN & (1UL << base->shifterIndex[1])) != 0U)) - { - /* If handle->rxDataSize is not 0, first save data to handle->rxData. */ - if (handle->rxDataSize != 0U) - { - /* Using non block API to read the data from the registers. */ - FLEXIO_UART_ReadByte(base, handle->rxData); - handle->rxDataSize--; - handle->rxData++; - count--; - - /* If all the data required for upper layer is ready, trigger callback. */ - if (0U == handle->rxDataSize) - { - handle->rxState = (uint8_t)kFLEXIO_UART_RxIdle; - - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_FLEXIO_UART_RxIdle, handle->userData); - } - } - } - - if (handle->rxRingBuffer != NULL) - { - if (count != 0U) - { - /* If RX ring buffer is full, trigger callback to notify over run. */ - if (FLEXIO_UART_TransferIsRxRingBufferFull(handle)) - { - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_FLEXIO_UART_RxRingBufferOverrun, handle->userData); - } - } - - /* If ring buffer is still full after callback function, the oldest data is overridden. */ - if (FLEXIO_UART_TransferIsRxRingBufferFull(handle)) - { - /* Increase handle->rxRingBufferTail to make room for new data. */ - if ((uint32_t)handle->rxRingBufferTail + 1U == handle->rxRingBufferSize) - { - handle->rxRingBufferTail = 0U; - } - else - { - handle->rxRingBufferTail++; - } - } - - /* Read data. */ - rxRingBufferHead = handle->rxRingBufferHead; - handle->rxRingBuffer[rxRingBufferHead] = - (uint8_t)(base->flexioBase->SHIFTBUFBYS[base->shifterIndex[1]]); - - /* Increase handle->rxRingBufferHead. */ - if ((uint32_t)handle->rxRingBufferHead + 1U == handle->rxRingBufferSize) - { - handle->rxRingBufferHead = 0U; - } - else - { - handle->rxRingBufferHead++; - } - } - } - /* If no receive requst pending, stop RX interrupt. */ - else if (0U == handle->rxDataSize) - { - FLEXIO_UART_DisableInterrupts(base, (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable); - } - else - { - } - } - - /* Send data register empty and the interrupt is enabled. */ - if ((((uint32_t)kFLEXIO_UART_TxDataRegEmptyFlag & status) != 0U) && - ((base->flexioBase->SHIFTSIEN & (1UL << base->shifterIndex[0])) != 0U)) - { - if (handle->txDataSize != 0U) - { - /* Using non block API to write the data to the registers. */ - FLEXIO_UART_WriteByte(base, handle->txData); - handle->txData++; - handle->txDataSize--; - - /* If all the data are written to data register, TX finished. */ - if (0U == handle->txDataSize) - { - handle->txState = (uint8_t)kFLEXIO_UART_TxIdle; - - /* Disable TX register empty interrupt. */ - FLEXIO_UART_DisableInterrupts(base, (uint32_t)kFLEXIO_UART_TxDataRegEmptyInterruptEnable); - - /* Trigger callback. */ - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_FLEXIO_UART_TxIdle, handle->userData); - } - } - } - } -} - -/*! - * brief Flush tx/rx shifters. - * - * param base Pointer to the FLEXIO_UART_Type structure. - */ -void FLEXIO_UART_FlushShifters(FLEXIO_UART_Type *base) -{ - /* Disable then re-enable to flush the tx shifter. */ - base->flexioBase->SHIFTCTL[base->shifterIndex[0]] &= ~FLEXIO_SHIFTCTL_SMOD_MASK; - base->flexioBase->SHIFTCTL[base->shifterIndex[0]] |= FLEXIO_SHIFTCTL_SMOD(kFLEXIO_ShifterModeTransmit); - /* Read to flush the rx shifter. */ - (void)base->flexioBase->SHIFTBUF[base->shifterIndex[1]]; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_uart.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_uart.h deleted file mode 100644 index bc82a0aee61..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_uart.h +++ /dev/null @@ -1,588 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_FLEXIO_UART_H_ -#define FSL_FLEXIO_UART_H_ - -#include "fsl_common.h" -#include "fsl_flexio.h" - -/*! - * @addtogroup flexio_uart - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief FlexIO UART driver version. */ -#define FSL_FLEXIO_UART_DRIVER_VERSION (MAKE_VERSION(2, 5, 0)) -/*@}*/ - -/*! @brief Retry times for waiting flag. */ -#ifndef UART_RETRY_TIMES -#define UART_RETRY_TIMES 0U /* Defining to zero means to keep waiting for the flag until it is assert/deassert. */ -#endif - -/*! @brief Error codes for the UART driver. */ -enum -{ - kStatus_FLEXIO_UART_TxBusy = MAKE_STATUS(kStatusGroup_FLEXIO_UART, 0), /*!< Transmitter is busy. */ - kStatus_FLEXIO_UART_RxBusy = MAKE_STATUS(kStatusGroup_FLEXIO_UART, 1), /*!< Receiver is busy. */ - kStatus_FLEXIO_UART_TxIdle = MAKE_STATUS(kStatusGroup_FLEXIO_UART, 2), /*!< UART transmitter is idle. */ - kStatus_FLEXIO_UART_RxIdle = MAKE_STATUS(kStatusGroup_FLEXIO_UART, 3), /*!< UART receiver is idle. */ - kStatus_FLEXIO_UART_ERROR = MAKE_STATUS(kStatusGroup_FLEXIO_UART, 4), /*!< ERROR happens on UART. */ - kStatus_FLEXIO_UART_RxRingBufferOverrun = - MAKE_STATUS(kStatusGroup_FLEXIO_UART, 5), /*!< UART RX software ring buffer overrun. */ - kStatus_FLEXIO_UART_RxHardwareOverrun = MAKE_STATUS(kStatusGroup_FLEXIO_UART, 6), /*!< UART RX receiver overrun. */ - kStatus_FLEXIO_UART_Timeout = MAKE_STATUS(kStatusGroup_FLEXIO_UART, 7), /*!< UART times out. */ - kStatus_FLEXIO_UART_BaudrateNotSupport = - MAKE_STATUS(kStatusGroup_FLEXIO_UART, 8) /*!< Baudrate is not supported in current clock source */ -}; - -/*! @brief FlexIO UART bit count per char. */ -typedef enum _flexio_uart_bit_count_per_char -{ - kFLEXIO_UART_7BitsPerChar = 7U, /*!< 7-bit data characters */ - kFLEXIO_UART_8BitsPerChar = 8U, /*!< 8-bit data characters */ - kFLEXIO_UART_9BitsPerChar = 9U, /*!< 9-bit data characters */ -} flexio_uart_bit_count_per_char_t; - -/*! @brief Define FlexIO UART interrupt mask. */ -enum _flexio_uart_interrupt_enable -{ - kFLEXIO_UART_TxDataRegEmptyInterruptEnable = 0x1U, /*!< Transmit buffer empty interrupt enable. */ - kFLEXIO_UART_RxDataRegFullInterruptEnable = 0x2U, /*!< Receive buffer full interrupt enable. */ -}; - -/*! @brief Define FlexIO UART status mask. */ -enum _flexio_uart_status_flags -{ - kFLEXIO_UART_TxDataRegEmptyFlag = 0x1U, /*!< Transmit buffer empty flag. */ - kFLEXIO_UART_RxDataRegFullFlag = 0x2U, /*!< Receive buffer full flag. */ - kFLEXIO_UART_RxOverRunFlag = 0x4U, /*!< Receive buffer over run flag. */ -}; - -/*! @brief Define FlexIO UART access structure typedef. */ -typedef struct _flexio_uart_type -{ - FLEXIO_Type *flexioBase; /*!< FlexIO base pointer. */ - uint8_t TxPinIndex; /*!< Pin select for UART_Tx. */ - uint8_t RxPinIndex; /*!< Pin select for UART_Rx. */ - uint8_t shifterIndex[2]; /*!< Shifter index used in FlexIO UART. */ - uint8_t timerIndex[2]; /*!< Timer index used in FlexIO UART. */ -} FLEXIO_UART_Type; - -/*! @brief Define FlexIO UART user configuration structure. */ -typedef struct _flexio_uart_config -{ - bool enableUart; /*!< Enable/disable FlexIO UART TX & RX. */ - bool enableInDoze; /*!< Enable/disable FlexIO operation in doze mode*/ - bool enableInDebug; /*!< Enable/disable FlexIO operation in debug mode*/ - bool enableFastAccess; /*!< Enable/disable fast access to FlexIO registers, - fast access requires the FlexIO clock to be at least - twice the frequency of the bus clock. */ - uint32_t baudRate_Bps; /*!< Baud rate in Bps. */ - flexio_uart_bit_count_per_char_t bitCountPerChar; /*!< number of bits, 7/8/9 -bit */ -} flexio_uart_config_t; - -/*! @brief Define FlexIO UART transfer structure. */ -typedef struct _flexio_uart_transfer -{ - /* - * Use separate TX and RX data pointer, because TX data is const data. - * The member data is kept for backward compatibility. - */ - union - { - uint8_t *data; /*!< The buffer of data to be transfer.*/ - uint8_t *rxData; /*!< The buffer to receive data. */ - const uint8_t *txData; /*!< The buffer of data to be sent. */ - }; - size_t dataSize; /*!< Transfer size*/ -} flexio_uart_transfer_t; - -/* Forward declaration of the handle typedef. */ -typedef struct _flexio_uart_handle flexio_uart_handle_t; - -/*! @brief FlexIO UART transfer callback function. */ -typedef void (*flexio_uart_transfer_callback_t)(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - status_t status, - void *userData); - -/*! @brief Define FLEXIO UART handle structure*/ -struct _flexio_uart_handle -{ - const uint8_t *volatile txData; /*!< Address of remaining data to send. */ - volatile size_t txDataSize; /*!< Size of the remaining data to send. */ - uint8_t *volatile rxData; /*!< Address of remaining data to receive. */ - volatile size_t rxDataSize; /*!< Size of the remaining data to receive. */ - size_t txDataSizeAll; /*!< Total bytes to be sent. */ - size_t rxDataSizeAll; /*!< Total bytes to be received. */ - - uint8_t *rxRingBuffer; /*!< Start address of the receiver ring buffer. */ - size_t rxRingBufferSize; /*!< Size of the ring buffer. */ - volatile uint16_t rxRingBufferHead; /*!< Index for the driver to store received data into ring buffer. */ - volatile uint16_t rxRingBufferTail; /*!< Index for the user to get data from the ring buffer. */ - - flexio_uart_transfer_callback_t callback; /*!< Callback function. */ - void *userData; /*!< UART callback function parameter.*/ - - volatile uint8_t txState; /*!< TX transfer state. */ - volatile uint8_t rxState; /*!< RX transfer state */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus*/ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Ungates the FlexIO clock, resets the FlexIO module, configures FlexIO UART - * hardware, and configures the FlexIO UART with FlexIO UART configuration. - * The configuration structure can be filled by the user or be set with - * default values by FLEXIO_UART_GetDefaultConfig(). - * - * Example - @code - FLEXIO_UART_Type base = { - .flexioBase = FLEXIO, - .TxPinIndex = 0, - .RxPinIndex = 1, - .shifterIndex = {0,1}, - .timerIndex = {0,1} - }; - flexio_uart_config_t config = { - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .baudRate_Bps = 115200U, - .bitCountPerChar = 8 - }; - FLEXIO_UART_Init(base, &config, srcClock_Hz); - @endcode - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param userConfig Pointer to the flexio_uart_config_t structure. - * @param srcClock_Hz FlexIO source clock in Hz. - * @retval kStatus_Success Configuration success. - * @retval kStatus_FLEXIO_UART_BaudrateNotSupport Baudrate is not supported for current clock source frequency. -*/ -status_t FLEXIO_UART_Init(FLEXIO_UART_Type *base, const flexio_uart_config_t *userConfig, uint32_t srcClock_Hz); - -/*! - * @brief Resets the FlexIO UART shifter and timer config. - * - * @note After calling this API, call the FLEXO_UART_Init to use the FlexIO UART module. - * - * @param base Pointer to FLEXIO_UART_Type structure - */ -void FLEXIO_UART_Deinit(FLEXIO_UART_Type *base); - -/*! - * @brief Gets the default configuration to configure the FlexIO UART. The configuration - * can be used directly for calling the FLEXIO_UART_Init(). - * Example: - @code - flexio_uart_config_t config; - FLEXIO_UART_GetDefaultConfig(&userConfig); - @endcode - * @param userConfig Pointer to the flexio_uart_config_t structure. -*/ -void FLEXIO_UART_GetDefaultConfig(flexio_uart_config_t *userConfig); - -/* @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets the FlexIO UART status flags. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @return FlexIO UART status flags. - */ - -uint32_t FLEXIO_UART_GetStatusFlags(FLEXIO_UART_Type *base); - -/*! - * @brief Gets the FlexIO UART status flags. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param mask Status flag. - * The parameter can be any combination of the following values: - * @arg kFLEXIO_UART_TxDataRegEmptyFlag - * @arg kFLEXIO_UART_RxEmptyFlag - * @arg kFLEXIO_UART_RxOverRunFlag - */ - -void FLEXIO_UART_ClearStatusFlags(FLEXIO_UART_Type *base, uint32_t mask); - -/* @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables the FlexIO UART interrupt. - * - * This function enables the FlexIO UART interrupt. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param mask Interrupt source. - */ -void FLEXIO_UART_EnableInterrupts(FLEXIO_UART_Type *base, uint32_t mask); - -/*! - * @brief Disables the FlexIO UART interrupt. - * - * This function disables the FlexIO UART interrupt. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param mask Interrupt source. - */ -void FLEXIO_UART_DisableInterrupts(FLEXIO_UART_Type *base, uint32_t mask); - -/* @} */ - -/*! - * @name DMA Control - * @{ - */ - -/*! - * @brief Gets the FlexIO UARt transmit data register address. - * - * This function returns the UART data register address, which is mainly used by DMA/eDMA. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @return FlexIO UART transmit data register address. - */ -static inline uint32_t FLEXIO_UART_GetTxDataRegisterAddress(FLEXIO_UART_Type *base) -{ - return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBuffer, base->shifterIndex[0]); -} - -/*! - * @brief Gets the FlexIO UART receive data register address. - * - * This function returns the UART data register address, which is mainly used by DMA/eDMA. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @return FlexIO UART receive data register address. - */ -static inline uint32_t FLEXIO_UART_GetRxDataRegisterAddress(FLEXIO_UART_Type *base) -{ - return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBufferByteSwapped, base->shifterIndex[1]); -} - -/*! - * @brief Enables/disables the FlexIO UART transmit DMA. - * This function enables/disables the FlexIO UART Tx DMA, - * which means asserting the kFLEXIO_UART_TxDataRegEmptyFlag does/doesn't trigger the DMA request. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param enable True to enable, false to disable. - */ -static inline void FLEXIO_UART_EnableTxDMA(FLEXIO_UART_Type *base, bool enable) -{ - FLEXIO_EnableShifterStatusDMA(base->flexioBase, 1UL << base->shifterIndex[0], enable); -} - -/*! - * @brief Enables/disables the FlexIO UART receive DMA. - * This function enables/disables the FlexIO UART Rx DMA, - * which means asserting kFLEXIO_UART_RxDataRegFullFlag does/doesn't trigger the DMA request. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param enable True to enable, false to disable. - */ -static inline void FLEXIO_UART_EnableRxDMA(FLEXIO_UART_Type *base, bool enable) -{ - FLEXIO_EnableShifterStatusDMA(base->flexioBase, 1UL << base->shifterIndex[1], enable); -} - -/* @} */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Enables/disables the FlexIO UART module operation. - * - * @param base Pointer to the FLEXIO_UART_Type. - * @param enable True to enable, false does not have any effect. - */ -static inline void FLEXIO_UART_Enable(FLEXIO_UART_Type *base, bool enable) -{ - if (enable) - { - base->flexioBase->CTRL |= FLEXIO_CTRL_FLEXEN_MASK; - } -} - -/*! - * @brief Writes one byte of data. - * - * @note This is a non-blocking API, which returns directly after the data is put into the - * data register. Ensure that the TxEmptyFlag is asserted before calling - * this API. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param buffer The data bytes to send. - */ -static inline void FLEXIO_UART_WriteByte(FLEXIO_UART_Type *base, const uint8_t *buffer) -{ - base->flexioBase->SHIFTBUF[base->shifterIndex[0]] = *buffer; -} - -/*! - * @brief Reads one byte of data. - * - * @note This is a non-blocking API, which returns directly after the data is read from the - * data register. Ensure that the RxFullFlag is asserted before calling this API. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param buffer The buffer to store the received bytes. - */ -static inline void FLEXIO_UART_ReadByte(FLEXIO_UART_Type *base, uint8_t *buffer) -{ - *buffer = (uint8_t)(base->flexioBase->SHIFTBUFBYS[base->shifterIndex[1]]); -} - -/*! - * @brief Sends a buffer of data bytes. - * - * @note This function blocks using the polling method until all bytes have been sent. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param txData The data bytes to send. - * @param txSize The number of data bytes to send. - * @retval kStatus_FLEXIO_UART_Timeout Transmission timed out and was aborted. - * @retval kStatus_Success Successfully wrote all data. - */ -status_t FLEXIO_UART_WriteBlocking(FLEXIO_UART_Type *base, const uint8_t *txData, size_t txSize); - -/*! - * @brief Receives a buffer of bytes. - * - * @note This function blocks using the polling method until all bytes have been received. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param rxData The buffer to store the received bytes. - * @param rxSize The number of data bytes to be received. - * @retval kStatus_FLEXIO_UART_Timeout Transmission timed out and was aborted. - * @retval kStatus_Success Successfully received all data. - */ -status_t FLEXIO_UART_ReadBlocking(FLEXIO_UART_Type *base, uint8_t *rxData, size_t rxSize); - -/* @} */ - -/*! - * @name Transactional - * @{ - */ - -/*! - * @brief Initializes the UART handle. - * - * This function initializes the FlexIO UART handle, which can be used for other FlexIO - * UART transactional APIs. Call this API once to get the - * initialized handle. - * - * The UART driver supports the "background" receiving, which means that users can set up - * a RX ring buffer optionally. Data received is stored into the ring buffer even when - * the user doesn't call the FLEXIO_UART_TransferReceiveNonBlocking() API. If there is already data - * received in the ring buffer, users can get the received data from the ring buffer - * directly. The ring buffer is disabled if passing NULL as @p ringBuffer. - * - * @param base to FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * @param callback The callback function. - * @param userData The parameter of the callback function. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_UART_TransferCreateHandle(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - flexio_uart_transfer_callback_t callback, - void *userData); - -/*! - * @brief Sets up the RX ring buffer. - * - * This function sets up the RX ring buffer to a specific UART handle. - * - * When the RX ring buffer is used, data received is stored into the ring buffer even when - * the user doesn't call the UART_ReceiveNonBlocking() API. If there is already data received - * in the ring buffer, users can get the received data from the ring buffer directly. - * - * @note When using the RX ring buffer, one byte is reserved for internal use. In other - * words, if @p ringBufferSize is 32, only 31 bytes are used for saving data. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * @param ringBuffer Start address of ring buffer for background receiving. Pass NULL to disable the ring buffer. - * @param ringBufferSize Size of the ring buffer. - */ -void FLEXIO_UART_TransferStartRingBuffer(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - uint8_t *ringBuffer, - size_t ringBufferSize); - -/*! - * @brief Aborts the background transfer and uninstalls the ring buffer. - * - * This function aborts the background transfer and uninstalls the ring buffer. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferStopRingBuffer(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle); - -/*! - * @brief Transmits a buffer of data using the interrupt method. - * - * This function sends data using an interrupt method. This is a non-blocking function, - * which returns directly without waiting for all data to be written to the TX register. When - * all data is written to the TX register in ISR, the FlexIO UART driver calls the callback - * function and passes the @ref kStatus_FLEXIO_UART_TxIdle as status parameter. - * - * @note The kStatus_FLEXIO_UART_TxIdle is passed to the upper layer when all data is written - * to the TX register. However, it does not ensure that all data is sent out. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * @param xfer FlexIO UART transfer structure. See #flexio_uart_transfer_t. - * @retval kStatus_Success Successfully starts the data transmission. - * @retval kStatus_UART_TxBusy Previous transmission still not finished, data not written to the TX register. - */ -status_t FLEXIO_UART_TransferSendNonBlocking(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - flexio_uart_transfer_t *xfer); - -/*! - * @brief Aborts the interrupt-driven data transmit. - * - * This function aborts the interrupt-driven data sending. Get the remainBytes to find out - * how many bytes are still not sent out. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferAbortSend(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle); - -/*! - * @brief Gets the number of bytes sent. - * - * This function gets the number of bytes sent driven by interrupt. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * @param count Number of bytes sent so far by the non-blocking transaction. - * @retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * @retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetSendCount(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle, size_t *count); - -/*! - * @brief Receives a buffer of data using the interrupt method. - * - * This function receives data using the interrupt method. This is a non-blocking function, - * which returns without waiting for all data to be received. - * If the RX ring buffer is used and not empty, the data in ring buffer is copied and - * the parameter @p receivedBytes shows how many bytes are copied from the ring buffer. - * After copying, if the data in ring buffer is not enough to read, the receive - * request is saved by the UART driver. When new data arrives, the receive request - * is serviced first. When all data is received, the UART driver notifies the upper layer - * through a callback function and passes the status parameter kStatus_UART_RxIdle. - * For example, if the upper layer needs 10 bytes but there are only 5 bytes in the ring buffer, - * the 5 bytes are copied to xfer->data. This function returns with the - * parameter @p receivedBytes set to 5. For the last 5 bytes, newly arrived data is - * saved from the xfer->data[5]. When 5 bytes are received, the UART driver notifies upper layer. - * If the RX ring buffer is not enabled, this function enables the RX and RX interrupt - * to receive data to xfer->data. When all data is received, the upper layer is notified. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * @param xfer UART transfer structure. See #flexio_uart_transfer_t. - * @param receivedBytes Bytes received from the ring buffer directly. - * @retval kStatus_Success Successfully queue the transfer into the transmit queue. - * @retval kStatus_FLEXIO_UART_RxBusy Previous receive request is not finished. - */ -status_t FLEXIO_UART_TransferReceiveNonBlocking(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - flexio_uart_transfer_t *xfer, - size_t *receivedBytes); - -/*! - * @brief Aborts the receive data which was using IRQ. - * - * This function aborts the receive data which was using IRQ. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferAbortReceive(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle); - -/*! - * @brief Gets the number of bytes received. - * - * This function gets the number of bytes received driven by interrupt. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * @param count Number of bytes received so far by the non-blocking transaction. - * @retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * @retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetReceiveCount(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle, size_t *count); - -/*! - * @brief FlexIO UART IRQ handler function. - * - * This function processes the FlexIO UART transmit and receives the IRQ request. - * - * @param uartType Pointer to the FLEXIO_UART_Type structure. - * @param uartHandle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferHandleIRQ(void *uartType, void *uartHandle); - -/*! - * @brief Flush tx/rx shifters. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - */ -void FLEXIO_UART_FlushShifters(FLEXIO_UART_Type *base); - -/*@}*/ - -#if defined(__cplusplus) -} -#endif /*_cplusplus*/ -/*@}*/ - -#endif /*FSL_FLEXIO_UART_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_uart_edma.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_uart_edma.c deleted file mode 100644 index f2502c9df20..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_uart_edma.c +++ /dev/null @@ -1,407 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio_uart_edma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio_uart_edma" -#endif - -/*handle != NULL); - - /* Avoid the warning for unused variables. */ - handle = handle; - tcds = tcds; - - if (transferDone) - { - FLEXIO_UART_TransferAbortSendEDMA(uartPrivateHandle->base, uartPrivateHandle->handle); - - if (uartPrivateHandle->handle->callback != NULL) - { - uartPrivateHandle->handle->callback(uartPrivateHandle->base, uartPrivateHandle->handle, - kStatus_FLEXIO_UART_TxIdle, uartPrivateHandle->handle->userData); - } - } -} - -static void FLEXIO_UART_TransferReceiveEDMACallback(edma_handle_t *handle, - void *param, - bool transferDone, - uint32_t tcds) -{ - flexio_uart_edma_private_handle_t *uartPrivateHandle = (flexio_uart_edma_private_handle_t *)param; - - assert(uartPrivateHandle->handle != NULL); - - /* Avoid the warning for unused variables. */ - handle = handle; - tcds = tcds; - - if (transferDone) - { - /* Disable transfer. */ - FLEXIO_UART_TransferAbortReceiveEDMA(uartPrivateHandle->base, uartPrivateHandle->handle); - - if (uartPrivateHandle->handle->callback != NULL) - { - uartPrivateHandle->handle->callback(uartPrivateHandle->base, uartPrivateHandle->handle, - kStatus_FLEXIO_UART_RxIdle, uartPrivateHandle->handle->userData); - } - } -} - -/*! - * brief Initializes the UART handle which is used in transactional functions. - * - * param base Pointer to FLEXIO_UART_Type. - * param handle Pointer to flexio_uart_edma_handle_t structure. - * param callback The callback function. - * param userData The parameter of the callback function. - * param rxEdmaHandle User requested DMA handle for RX DMA transfer. - * param txEdmaHandle User requested DMA handle for TX DMA transfer. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO SPI eDMA type/handle table out of range. - */ -status_t FLEXIO_UART_TransferCreateHandleEDMA(FLEXIO_UART_Type *base, - flexio_uart_edma_handle_t *handle, - flexio_uart_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *txEdmaHandle, - edma_handle_t *rxEdmaHandle) -{ - assert(handle != NULL); - - uint8_t index = 0U; - - /* Find the an empty handle pointer to store the handle. */ - for (index = 0U; index < (uint8_t)FLEXIO_UART_HANDLE_COUNT; index++) - { - if (s_edmaPrivateHandle[index].base == NULL) - { - s_edmaPrivateHandle[index].base = base; - s_edmaPrivateHandle[index].handle = handle; - break; - } - } - - if (index == (uint8_t)FLEXIO_UART_HANDLE_COUNT) - { - return kStatus_OutOfRange; - } - - (void)memset(handle, 0, sizeof(*handle)); - - handle->rxState = (uint8_t)kFLEXIO_UART_RxIdle; - handle->txState = (uint8_t)kFLEXIO_UART_TxIdle; - - handle->rxEdmaHandle = rxEdmaHandle; - handle->txEdmaHandle = txEdmaHandle; - - handle->callback = callback; - handle->userData = userData; - - /* Configure TX. */ - if (txEdmaHandle != NULL) - { - EDMA_SetCallback(handle->txEdmaHandle, FLEXIO_UART_TransferSendEDMACallback, &s_edmaPrivateHandle); - } - - /* Configure RX. */ - if (rxEdmaHandle != NULL) - { - EDMA_SetCallback(handle->rxEdmaHandle, FLEXIO_UART_TransferReceiveEDMACallback, &s_edmaPrivateHandle); - } - - return kStatus_Success; -} - -/*! - * brief Sends data using eDMA. - * - * This function sends data using eDMA. This is a non-blocking function, which returns - * right away. When all data is sent out, the send callback function is called. - * - * param base Pointer to FLEXIO_UART_Type - * param handle UART handle pointer. - * param xfer UART eDMA transfer structure, see #flexio_uart_transfer_t. - * retval kStatus_Success if succeed, others failed. - * retval kStatus_FLEXIO_UART_TxBusy Previous transfer on going. - */ -status_t FLEXIO_UART_TransferSendEDMA(FLEXIO_UART_Type *base, - flexio_uart_edma_handle_t *handle, - flexio_uart_transfer_t *xfer) -{ - assert(handle->txEdmaHandle != NULL); - - edma_transfer_config_t xferConfig; - status_t status; - - /* Return error if xfer invalid. */ - if ((0U == xfer->dataSize) || (NULL == xfer->data)) - { - return kStatus_InvalidArgument; - } - - /* If previous TX not finished. */ - if ((uint8_t)kFLEXIO_UART_TxBusy == handle->txState) - { - status = kStatus_FLEXIO_UART_TxBusy; - } - else - { - handle->txState = (uint8_t)kFLEXIO_UART_TxBusy; - handle->txDataSizeAll = xfer->dataSize; - - /* Prepare transfer. */ - EDMA_PrepareTransfer(&xferConfig, xfer->data, sizeof(uint8_t), - (uint32_t *)FLEXIO_UART_GetTxDataRegisterAddress(base), sizeof(uint8_t), sizeof(uint8_t), - xfer->dataSize, kEDMA_MemoryToPeripheral); - - /* Store the initially configured eDMA minor byte transfer count into the FLEXIO UART handle */ - handle->nbytes = 1U; - - /* Submit transfer. */ - (void)EDMA_SubmitTransfer(handle->txEdmaHandle, &xferConfig); - EDMA_StartTransfer(handle->txEdmaHandle); - - /* Enable UART TX EDMA. */ - FLEXIO_UART_EnableTxDMA(base, true); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Receives data using eDMA. - * - * This function receives data using eDMA. This is a non-blocking function, which returns - * right away. When all data is received, the receive callback function is called. - * - * param base Pointer to FLEXIO_UART_Type - * param handle Pointer to flexio_uart_edma_handle_t structure - * param xfer UART eDMA transfer structure, see #flexio_uart_transfer_t. - * retval kStatus_Success if succeed, others failed. - * retval kStatus_UART_RxBusy Previous transfer on going. - */ -status_t FLEXIO_UART_TransferReceiveEDMA(FLEXIO_UART_Type *base, - flexio_uart_edma_handle_t *handle, - flexio_uart_transfer_t *xfer) -{ - assert(handle->rxEdmaHandle != NULL); - - edma_transfer_config_t xferConfig; - status_t status; - - /* Return error if xfer invalid. */ - if ((0U == xfer->dataSize) || (NULL == xfer->data)) - { - return kStatus_InvalidArgument; - } - - /* If previous RX not finished. */ - if ((uint8_t)kFLEXIO_UART_RxBusy == handle->rxState) - { - status = kStatus_FLEXIO_UART_RxBusy; - } - else - { - handle->rxState = (uint8_t)kFLEXIO_UART_RxBusy; - handle->rxDataSizeAll = xfer->dataSize; - - /* Prepare transfer. */ - EDMA_PrepareTransfer(&xferConfig, (uint32_t *)FLEXIO_UART_GetRxDataRegisterAddress(base), sizeof(uint8_t), - xfer->data, sizeof(uint8_t), sizeof(uint8_t), xfer->dataSize, kEDMA_PeripheralToMemory); - - /* Store the initially configured eDMA minor byte transfer count into the FLEXIO UART handle */ - handle->nbytes = (uint8_t)sizeof(uint8_t); - - /* Submit transfer. */ - (void)EDMA_SubmitTransfer(handle->rxEdmaHandle, &xferConfig); - EDMA_StartTransfer(handle->rxEdmaHandle); - - /* Enable UART RX EDMA. */ - FLEXIO_UART_EnableRxDMA(base, true); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Aborts the sent data which using eDMA. - * - * This function aborts sent data which using eDMA. - * - * param base Pointer to FLEXIO_UART_Type - * param handle Pointer to flexio_uart_edma_handle_t structure - */ -void FLEXIO_UART_TransferAbortSendEDMA(FLEXIO_UART_Type *base, flexio_uart_edma_handle_t *handle) -{ - assert(handle->txEdmaHandle != NULL); - - /* Disable UART TX EDMA. */ - FLEXIO_UART_EnableTxDMA(base, false); - - /* Stop transfer. */ - EDMA_StopTransfer(handle->txEdmaHandle); - - handle->txState = (uint8_t)kFLEXIO_UART_TxIdle; -} - -/*! - * brief Aborts the receive data which using eDMA. - * - * This function aborts the receive data which using eDMA. - * - * param base Pointer to FLEXIO_UART_Type - * param handle Pointer to flexio_uart_edma_handle_t structure - */ -void FLEXIO_UART_TransferAbortReceiveEDMA(FLEXIO_UART_Type *base, flexio_uart_edma_handle_t *handle) -{ - assert(handle->rxEdmaHandle != NULL); - - /* Disable UART RX EDMA. */ - FLEXIO_UART_EnableRxDMA(base, false); - - /* Stop transfer. */ - EDMA_StopTransfer(handle->rxEdmaHandle); - - handle->rxState = (uint8_t)kFLEXIO_UART_RxIdle; -} - -/*! - * brief Gets the number of bytes received. - * - * This function gets the number of bytes received. - * - * param base Pointer to FLEXIO_UART_Type - * param handle Pointer to flexio_uart_edma_handle_t structure - * param count Number of bytes received so far by the non-blocking transaction. - * retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetReceiveCountEDMA(FLEXIO_UART_Type *base, - flexio_uart_edma_handle_t *handle, - size_t *count) -{ - assert(handle != NULL); - assert(handle->rxEdmaHandle != NULL); - assert(count != NULL); - - if ((uint8_t)kFLEXIO_UART_RxIdle == handle->rxState) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->rxDataSizeAll - - (uint32_t)handle->nbytes * - EDMA_GetRemainingMajorLoopCount(handle->rxEdmaHandle->base, handle->rxEdmaHandle->channel); - - return kStatus_Success; -} - -/*! - * brief Gets the number of bytes sent out. - * - * This function gets the number of bytes sent out. - * - * param base Pointer to FLEXIO_UART_Type - * param handle Pointer to flexio_uart_edma_handle_t structure - * param count Number of bytes sent so far by the non-blocking transaction. - * retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetSendCountEDMA(FLEXIO_UART_Type *base, flexio_uart_edma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - assert(handle->txEdmaHandle != NULL); - assert(count != NULL); - - if ((uint8_t)kFLEXIO_UART_TxIdle == handle->txState) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->txDataSizeAll - - (uint32_t)handle->nbytes * - EDMA_GetRemainingMajorLoopCount(handle->txEdmaHandle->base, handle->txEdmaHandle->channel); - - return kStatus_Success; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_uart_edma.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_uart_edma.h deleted file mode 100644 index 3809ad98ae2..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_flexio_uart_edma.h +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_FLEXIO_UART_EDMA_H_ -#define FSL_FLEXIO_UART_EDMA_H_ - -#include "fsl_flexio_uart.h" -#include "fsl_edma.h" - -/*! - * @addtogroup flexio_edma_uart - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief FlexIO UART EDMA driver version. */ -#define FSL_FLEXIO_UART_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 4, 1)) -/*@}*/ - -/* Forward declaration of the handle typedef. */ -typedef struct _flexio_uart_edma_handle flexio_uart_edma_handle_t; - -/*! @brief UART transfer callback function. */ -typedef void (*flexio_uart_edma_transfer_callback_t)(FLEXIO_UART_Type *base, - flexio_uart_edma_handle_t *handle, - status_t status, - void *userData); - -/*! - * @brief UART eDMA handle - */ -struct _flexio_uart_edma_handle -{ - flexio_uart_edma_transfer_callback_t callback; /*!< Callback function. */ - void *userData; /*!< UART callback function parameter.*/ - - size_t txDataSizeAll; /*!< Total bytes to be sent. */ - size_t rxDataSizeAll; /*!< Total bytes to be received. */ - - edma_handle_t *txEdmaHandle; /*!< The eDMA TX channel used. */ - edma_handle_t *rxEdmaHandle; /*!< The eDMA RX channel used. */ - - uint8_t nbytes; /*!< eDMA minor byte transfer count initially configured. */ - - volatile uint8_t txState; /*!< TX transfer state. */ - volatile uint8_t rxState; /*!< RX transfer state */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name eDMA transactional - * @{ - */ - -/*! - * @brief Initializes the UART handle which is used in transactional functions. - * - * @param base Pointer to FLEXIO_UART_Type. - * @param handle Pointer to flexio_uart_edma_handle_t structure. - * @param callback The callback function. - * @param userData The parameter of the callback function. - * @param rxEdmaHandle User requested DMA handle for RX DMA transfer. - * @param txEdmaHandle User requested DMA handle for TX DMA transfer. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO SPI eDMA type/handle table out of range. - */ -status_t FLEXIO_UART_TransferCreateHandleEDMA(FLEXIO_UART_Type *base, - flexio_uart_edma_handle_t *handle, - flexio_uart_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *txEdmaHandle, - edma_handle_t *rxEdmaHandle); - -/*! - * @brief Sends data using eDMA. - * - * This function sends data using eDMA. This is a non-blocking function, which returns - * right away. When all data is sent out, the send callback function is called. - * - * @param base Pointer to FLEXIO_UART_Type - * @param handle UART handle pointer. - * @param xfer UART eDMA transfer structure, see #flexio_uart_transfer_t. - * @retval kStatus_Success if succeed, others failed. - * @retval kStatus_FLEXIO_UART_TxBusy Previous transfer on going. - */ -status_t FLEXIO_UART_TransferSendEDMA(FLEXIO_UART_Type *base, - flexio_uart_edma_handle_t *handle, - flexio_uart_transfer_t *xfer); - -/*! - * @brief Receives data using eDMA. - * - * This function receives data using eDMA. This is a non-blocking function, which returns - * right away. When all data is received, the receive callback function is called. - * - * @param base Pointer to FLEXIO_UART_Type - * @param handle Pointer to flexio_uart_edma_handle_t structure - * @param xfer UART eDMA transfer structure, see #flexio_uart_transfer_t. - * @retval kStatus_Success if succeed, others failed. - * @retval kStatus_UART_RxBusy Previous transfer on going. - */ -status_t FLEXIO_UART_TransferReceiveEDMA(FLEXIO_UART_Type *base, - flexio_uart_edma_handle_t *handle, - flexio_uart_transfer_t *xfer); - -/*! - * @brief Aborts the sent data which using eDMA. - * - * This function aborts sent data which using eDMA. - * - * @param base Pointer to FLEXIO_UART_Type - * @param handle Pointer to flexio_uart_edma_handle_t structure - */ -void FLEXIO_UART_TransferAbortSendEDMA(FLEXIO_UART_Type *base, flexio_uart_edma_handle_t *handle); - -/*! - * @brief Aborts the receive data which using eDMA. - * - * This function aborts the receive data which using eDMA. - * - * @param base Pointer to FLEXIO_UART_Type - * @param handle Pointer to flexio_uart_edma_handle_t structure - */ -void FLEXIO_UART_TransferAbortReceiveEDMA(FLEXIO_UART_Type *base, flexio_uart_edma_handle_t *handle); - -/*! - * @brief Gets the number of bytes sent out. - * - * This function gets the number of bytes sent out. - * - * @param base Pointer to FLEXIO_UART_Type - * @param handle Pointer to flexio_uart_edma_handle_t structure - * @param count Number of bytes sent so far by the non-blocking transaction. - * @retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * @retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetSendCountEDMA(FLEXIO_UART_Type *base, flexio_uart_edma_handle_t *handle, size_t *count); - -/*! - * @brief Gets the number of bytes received. - * - * This function gets the number of bytes received. - * - * @param base Pointer to FLEXIO_UART_Type - * @param handle Pointer to flexio_uart_edma_handle_t structure - * @param count Number of bytes received so far by the non-blocking transaction. - * @retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * @retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetReceiveCountEDMA(FLEXIO_UART_Type *base, - flexio_uart_edma_handle_t *handle, - size_t *count); - -/*@}*/ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_UART_EDMA_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_freqme.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_freqme.c deleted file mode 100644 index 459bbb6f3a0..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_freqme.c +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright 2021-2022 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_freqme.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpc_freqme" -#endif - -#if defined(FREQME_RSTS_N) -#define FREQME_RESETS_ARRAY FREQME_RSTS_N -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -static uint32_t FREQME_GetInstance(FREQME_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Array to map freqme instance number to base address. */ -static FREQME_Type *const s_freqmeBases[] = FREQME_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to FREQME clocks for each instance. */ -static const clock_ip_name_t s_freqmeClocks[] = FREQME_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(FREQME_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_freqmeResets[] = FREQME_RESETS_ARRAY; -#endif -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t FREQME_GetInstance(FREQME_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0U; instance < ARRAY_SIZE(s_freqmeBases); instance++) - { - if (s_freqmeBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_freqmeBases)); - - return instance; -} - -/*! - * brief Initialize freqme module, set operate mode, operate mode attribute and initialize measurement cycle. - * - * param base FREQME peripheral base address. - * param config The pointer to module basic configuration, please refer to freq_measure_config_t. - */ -void FREQME_Init(FREQME_Type *base, const freq_measure_config_t *config) -{ - assert(config); - - uint32_t tmp32 = 0UL; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable FREQME clock. */ - CLOCK_EnableClock(s_freqmeClocks[FREQME_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(FREQME_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_freqmeResets[FREQME_GetInstance(base)]); -#endif - - if (config->startMeasurement) - { - tmp32 |= FREQME_CTRL_W_MEASURE_IN_PROGRESS_MASK; - } - tmp32 |= FREQME_CTRL_W_CONTINUOUS_MODE_EN(config->enableContinuousMode) | - FREQME_CTRL_W_PULSE_MODE(config->operateMode); - if (config->operateMode == kFREQME_FreqMeasurementMode) - { - tmp32 |= FREQME_CTRL_W_REF_SCALE(config->operateModeAttribute.refClkScaleFactor); - } - else - { - tmp32 |= FREQME_CTRL_W_PULSE_POL(config->operateModeAttribute.pulsePolarity); - } - - base->CTRL_W = tmp32; -} - -/*! - * brief Get default configuration. - * - * code - * config->operateMode = kFREQME_FreqMeasurementMode; - * config->operateModeAttribute.refClkScaleFactor = 0U; - * config->enableContinuousMode = false; - * config->startMeasurement = false; - * endcode - * - * param config The pointer to module basic configuration, please refer to freq_measure_config_t. - */ -void FREQME_GetDefaultConfig(freq_measure_config_t *config) -{ - assert(config); - - (void)memset(config, 0, sizeof(*config)); - - config->operateMode = kFREQME_FreqMeasurementMode; - config->operateModeAttribute.refClkScaleFactor = 0U; - config->enableContinuousMode = false; - config->startMeasurement = false; -} - -/*! - * brief Calculate the frequency of selected target clock. - * - * note The formula: Ftarget = (RESULT - 2) * Freference / 2 ^ REF_SCALE. - * - * note This function only useful when the operate mode is selected as frequency measurement mode. - * - * param base FREQME peripheral base address. - * param refClkFrequency The frequency of reference clock. - * return The frequency of target clock, if the output result is 0, please check the module's operate mode. - */ -uint32_t FREQME_CalculateTargetClkFreq(FREQME_Type *base, uint32_t refClkFrequency) -{ - uint32_t measureResult = 0UL; - uint32_t targetFreq = 0UL; - uint64_t tmp64 = 0ULL; - - while ((base->CTRL_R & FREQME_CTRL_R_MEASURE_IN_PROGRESS_MASK) != 0UL) - { - } - - if (!FREQME_CheckOperateMode(base)) - { - measureResult = base->CTRL_R & FREQME_CTRL_R_RESULT_MASK; - tmp64 = ((uint64_t)measureResult - 2ULL) * (uint64_t)refClkFrequency; - targetFreq = (uint32_t)(tmp64 / (1ULL << (uint64_t)FREQME_GetReferenceClkScaleValue(base))); - } - - return targetFreq; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_freqme.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_freqme.h deleted file mode 100644 index 7699d0373bc..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_freqme.h +++ /dev/null @@ -1,441 +0,0 @@ -/* - * Copyright 2021-2022 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_FREQME_H_ -#define FSL_FREQME_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup lpc_freqme - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief FREQME driver version 2.1.2. */ -#define FSL_FREQME_DRIVER_VERSION (MAKE_VERSION(2, 1, 2)) -/*@}*/ - -/*! - * @brief The enumeration of interrupt status flags. - * @anchor _freqme_interrupt_status_flags - */ -enum _freqme_interrupt_status_flags -{ - kFREQME_UnderflowInterruptStatusFlag = FREQME_CTRLSTAT_LT_MIN_STAT_MASK, /*!< Indicate the measurement is - just done and the result is less - than minimun value. */ - kFREQME_OverflowInterruptStatusFlag = FREQME_CTRLSTAT_GT_MAX_STAT_MASK, /*!< Indicate the measurement is - just done and the result is greater - than maximum value. */ - kFREQME_ReadyInterruptStatusFlag = FREQME_CTRLSTAT_RESULT_READY_STAT_MASK, /*!< Indicate the measurement is - just done and the result is ready to - read. */ - kFREQME_AllInterruptStatusFlags = FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_GT_MAX_STAT_MASK | - FREQME_CTRLSTAT_RESULT_READY_STAT_MASK, /*!< All interrupt - status flags. */ -}; - -/*! - * @brief The enumeration of interrupts, including underflow interrupt, overflow interrupt, - * and result ready interrupt. - * @anchor _freqme_interrupt_enable - */ -enum _freqme_interrupt_enable -{ - kFREQME_UnderflowInterruptEnable = FREQME_CTRL_W_LT_MIN_INT_EN_MASK, /*!< Enable interrupt when the result is - less than minimum value. */ - kFREQME_OverflowInterruptEnable = FREQME_CTRL_W_GT_MAX_INT_EN_MASK, /*!< Enable interrupt when the result is - greater than maximum value. */ - kFREQME_ReadyInterruptEnable = FREQME_CTRL_W_RESULT_READY_INT_EN_MASK, /*!< Enable interrupt when a - measurement completes and the result - is ready. */ -}; - -/*! - * @brief FREQME module operate mode enumeration, including frequency measurement mode - * and pulse width measurement mode. - */ -typedef enum _freqme_operate_mode -{ - kFREQME_FreqMeasurementMode = 0U, /*!< The module works in the frequency measurement mode. */ - kFREOME_PulseWidthMeasurementMode, /*!< The module works in the pulse width measurement mode. */ -} freqme_operate_mode_t; - -/*! - * @brief The enumeration of pulse polarity. - */ -typedef enum _freqme_pulse_polarity -{ - kFREQME_PulseHighPeriod = 0U, /*!< Select high period of the reference clock. */ - kFREQME_PulseLowPeriod, /*!< Select low period of the reference clock. */ -} freqme_pulse_polarity_t; - -/*! - * @brief The union of operate mode attribute. - * @note If the operate mode is selected as frequency measurement mode the member \b refClkScaleFactor should be used, - * if the operate mode is selected as pulse width measurement mode the member \b pulsePolarity should be used. - */ -typedef union _freqme_mode_attribute -{ - uint8_t refClkScaleFactor; /*!< Only useful in frequency measurement operate mode, - used to set the reference clock counter scaling factor. */ - freqme_pulse_polarity_t pulsePolarity; /*!< Only Useful in pulse width measurement operate mode, - used to set period polarity. */ -} freqme_mode_attribute_t; - -/*! - * @brief The structure of freqme module basic configuration, - * including operate mode, operate mode attribute and so on. - */ -typedef struct _freq_measure_config -{ - freqme_operate_mode_t operateMode; /*!< Select operate mode, please refer to @ref freqme_operate_mode_t. */ - freqme_mode_attribute_t operateModeAttribute; /*!< Used to set the attribute of the selected operate mode, if - the operate mode is selected as @ref kFREQME_FreqMeasurementMode - set freqme_mode_attribute_t::refClkScaleFactor, if operate mode is - selected as @ref kFREOME_PulseWidthMeasurementMode, please set - freqme_mode_attribute_t::pulsePolarity. */ - - bool enableContinuousMode; /*!< Enable/disable continuous mode, if continuous mode is enable, - the measurement is performed continuously and the result for the - last completed measurement is available in the result register. */ - bool startMeasurement; -} freq_measure_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Basic Control APIs - * @{ - */ -/*! - * @brief Initialize freqme module, set operate mode, operate mode attribute and initialize measurement cycle. - * - * @param base FREQME peripheral base address. - * @param config The pointer to module basic configuration, please refer to @ref freq_measure_config_t. - */ -void FREQME_Init(FREQME_Type *base, const freq_measure_config_t *config); - -/*! - * @brief Get default configuration. - * - * @code - * config->operateMode = kFREQME_FreqMeasurementMode; - * config->operateModeAttribute.refClkScaleFactor = 0U; - * config->enableContinuousMode = false; - * config->startMeasurement = false; - * @endcode - * - * @param config The pointer to module basic configuration, please refer to @ref freq_measure_config_t. - */ -void FREQME_GetDefaultConfig(freq_measure_config_t *config); - -/*! - * @brief Start frequency or pulse width measurement process. - * - * @param base FREQME peripheral base address. - */ -static inline void FREQME_StartMeasurementCycle(FREQME_Type *base) -{ - uint32_t tmp32; - - tmp32 = base->CTRLSTAT; - tmp32 &= ~(FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_MEASURE_IN_PROGRESS_MASK | - FREQME_CTRLSTAT_GT_MAX_STAT_MASK | FREQME_CTRLSTAT_RESULT_READY_STAT_MASK); - tmp32 |= FREQME_CTRL_W_MEASURE_IN_PROGRESS_MASK; - base->CTRL_W = tmp32; -} - -/*! - * @brief Force the termination of any measurement cycle currently in progress and resets RESULT or just reset - * RESULT if the module in idle state. - * - * @param base FREQME peripheral base address. - */ -static inline void FREQME_TerminateMeasurementCycle(FREQME_Type *base) -{ - uint32_t tmp32; - - tmp32 = base->CTRLSTAT; - tmp32 &= ~(FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_MEASURE_IN_PROGRESS_MASK | - FREQME_CTRLSTAT_GT_MAX_STAT_MASK | FREQME_CTRLSTAT_RESULT_READY_STAT_MASK); - base->CTRL_W = tmp32; -} - -/*! - * @brief Enable/disable Continuous mode. - * - * @param base FREQME peripheral base address. - * @param enable Used to enable/disable continuous mode, - * - \b true Enable Continuous mode. - * - \b false Disable Continuous mode. - */ -static inline void FREQME_EnableContinuousMode(FREQME_Type *base, bool enable) -{ - uint32_t tmp32; - - tmp32 = base->CTRLSTAT; - tmp32 &= ~(FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_CONTINUOUS_MODE_EN_MASK | - FREQME_CTRLSTAT_GT_MAX_STAT_MASK | FREQME_CTRLSTAT_RESULT_READY_STAT_MASK); - if (enable) - { - tmp32 |= FREQME_CTRL_W_CONTINUOUS_MODE_EN_MASK; - } - - base->CTRL_W = tmp32; -} - -/*! - * @brief Check whether continuous mode is enabled. - * - * @param base FREQME peripheral base address. - * @retval True Continuous mode is enabled, the measurement is performed continuously. - * @retval False Continuous mode is disabled. - */ -static inline bool FREQME_CheckContinuousMode(FREQME_Type *base) -{ - return (bool)((base->CTRLSTAT & FREQME_CTRLSTAT_CONTINUOUS_MODE_EN_MASK) != 0UL); -} - -/*! - * @brief Set operate mode of freqme module. - * - * @param base FREQME peripheral base address. - * @param operateMode The operate mode to be set, please refer to @ref freqme_operate_mode_t. - */ -static inline void FREQME_SetOperateMode(FREQME_Type *base, freqme_operate_mode_t operateMode) -{ - uint32_t tmp32; - - tmp32 = base->CTRLSTAT; - tmp32 &= ~(FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_PULSE_MODE_MASK | - FREQME_CTRLSTAT_GT_MAX_STAT_MASK | FREQME_CTRLSTAT_RESULT_READY_STAT_MASK); - if (operateMode == kFREOME_PulseWidthMeasurementMode) - { - tmp32 |= FREQME_CTRL_W_PULSE_MODE_MASK; - } - - base->CTRL_W = tmp32; -} - -/*! - * @brief Check module's operate mode. - * - * @param base FREQME peripheral base address. - * @retval True Pulse width measurement mode. - * @retval False Frequency measurement mode. - */ -static inline bool FREQME_CheckOperateMode(FREQME_Type *base) -{ - return (bool)((base->CTRLSTAT & FREQME_CTRLSTAT_PULSE_MODE_MASK) != 0UL); - -} - -/*! - * @brief Set the minimum expected value for the measurement result. - * - * @param base FREQME peripheral base address. - * @param minValue The minimum value to set, please note that this value is 31 bits width. - */ -static inline void FREQME_SetMinExpectedValue(FREQME_Type *base, uint32_t minValue) -{ - base->MIN = minValue; -} - -/*! - * @brief Set the maximum expected value for the measurement result. - * - * @param base FREQME peripheral base address. - * @param maxValue The maximum value to set, please note that this value is 31 bits width. - */ -static inline void FREQME_SetMaxExpectedValue(FREQME_Type *base, uint32_t maxValue) -{ - base->MAX = maxValue; -} - -/*! @} */ - -/*! - * @name Frequency Measurement Mode Control APIs - * @{ - */ - -/*! - * @brief Calculate the frequency of selected target clock。 - * - * @note The formula: Ftarget = (RESULT - 2) * Freference / 2 ^ REF_SCALE. - * - * @note This function only useful when the operate mode is selected as frequency measurement mode. - * - * @param base FREQME peripheral base address. - * @param refClkFrequency The frequency of reference clock. - * @return The frequency of target clock the unit is Hz, if the output result is 0, please check the module's - * operate mode. - */ -uint32_t FREQME_CalculateTargetClkFreq(FREQME_Type *base, uint32_t refClkFrequency); - -/*! - * @brief Get reference clock scaling factor. - * - * @param base FREQME peripheral base address. - * @return Reference clock scaling factor, the reference count cycle is 2 ^ ref_scale. - */ -static inline uint8_t FREQME_GetReferenceClkScaleValue(FREQME_Type *base) -{ - return (uint8_t)(base->CTRLSTAT & FREQME_CTRLSTAT_REF_SCALE_MASK); -} - -/*! @} */ - -/*! - * @name Pulse Width Measurement Mode Control APIs - * @{ - */ - -/*! - * @brief Set pulse polarity when operate mode is selected as Pulse Width Measurement mode. - * - * @param base FREQME peripheral base address. - * @param pulsePolarity The pulse polarity to be set, please refer to @ref freqme_pulse_polarity_t. - */ -static inline void FREQME_SetPulsePolarity(FREQME_Type *base, freqme_pulse_polarity_t pulsePolarity) -{ - uint32_t tmp32; - - tmp32 = base->CTRLSTAT; - tmp32 &= ~(FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_PULSE_POL_MASK | - FREQME_CTRLSTAT_GT_MAX_STAT_MASK | FREQME_CTRLSTAT_RESULT_READY_STAT_MASK); - - if (pulsePolarity != kFREQME_PulseHighPeriod) - { - tmp32 |= FREQME_CTRL_W_PULSE_POL_MASK; - } - - base->CTRL_W = tmp32; -} - -/*! - * @brief Check pulse polarity when the operate mode is selected as pulse width measurement mode. - * - * @param base FREQME peripheral base address. - * @retval True Low period. - * @retval False High period. - */ -static inline bool FREQME_CheckPulsePolarity(FREQME_Type *base) -{ - return (bool)((base->CTRLSTAT & FREQME_CTRLSTAT_PULSE_POL_MASK) != 0UL); -} - -/*! - * @brief Get measurement result, if operate mode is selected as pulse width measurement mode this function can - * be used to calculate pulse width. - * - * @note Pulse width = counter result / Frequency of target clock. - * - * @param base FREQME peripheral base address. - * @return Measurement result. - */ -static inline uint32_t FREQME_GetMeasurementResult(FREQME_Type *base) -{ - return base->CTRL_R & FREQME_CTRL_R_RESULT_MASK; -} - -/*! @} */ - -/*! - * @name Status Control APIs - * @{ - */ - -/*! - * @brief Get interrupt status flags, such as overflow interrupt status flag, - * underflow interrupt status flag, and so on. - * - * @param base FREQME peripheral base address. - * @return Current interrupt status flags, should be the OR'ed value of @ref _freqme_interrupt_status_flags. - */ -static inline uint32_t FREQME_GetInterruptStatusFlags(FREQME_Type *base) -{ - return (base->CTRLSTAT & (uint32_t)kFREQME_AllInterruptStatusFlags); -} - -/*! - * @brief Clear interrupt status flags. - * - * @param base FREQME peripheral base address. - * @param statusFlags The combination of interrupt status flags to clear, - * should be the OR'ed value of @ref _freqme_interrupt_status_flags. - */ -static inline void FREQME_ClearInterruptStatusFlags(FREQME_Type *base, uint32_t statusFlags) -{ - base->CTRLSTAT |= statusFlags; -} - -/*! @} */ - -/*! - * @name Interrupt Control APIs - * @{ - */ - -/*! - * @brief Enable interrupts, such as result ready interrupt, overflow interrupt and so on. - * - * @param base FREQME peripheral base address. - * @param masks The mask of interrupts to enable, should be the OR'ed value of @ref _freqme_interrupt_enable. - */ -static inline void FREQME_EnableInterrupts(FREQME_Type *base, uint32_t masks) -{ - uint32_t tmp32; - - tmp32 = base->CTRLSTAT; - tmp32 &= ~(FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_LT_MIN_INT_EN_MASK | - FREQME_CTRLSTAT_GT_MAX_STAT_MASK | FREQME_CTRLSTAT_GT_MAX_INT_EN_MASK | - FREQME_CTRLSTAT_RESULT_READY_INT_EN_MASK | FREQME_CTRLSTAT_RESULT_READY_STAT_MASK); - - tmp32 |= masks; - base->CTRL_W = tmp32; -} - -/*! - * @brief Disable interrupts, such as result ready interrupt, overflow interrupt and so on. - * - * @param base FREQME peripheral base address. - * @param masks The mask of interrupts to disable, should be the OR'ed value of @ref _freqme_interrupt_enable. - */ -static inline void FREQME_DisableInterrupts(FREQME_Type *base, uint32_t masks) -{ - uint32_t tmp32; - - tmp32 = base->CTRLSTAT; - tmp32 &= ~(FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_GT_MAX_STAT_MASK | - FREQME_CTRLSTAT_RESULT_READY_STAT_MASK | masks); - - base->CTRL_W = tmp32; -} - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ -#endif /* FSL_FREQME_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_gpio.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_gpio.c deleted file mode 100644 index 0f3b4020c23..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_gpio.c +++ /dev/null @@ -1,440 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2019, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_gpio.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.gpio" -#endif - -#if defined(GPIO_RSTS) -#define GPIO_RESETS_ARRAY GPIO_RSTS -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ - -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -static PORT_Type *const s_portBases[] = PORT_BASE_PTRS; -static GPIO_Type *const s_gpioBases[] = GPIO_BASE_PTRS; -#endif - -#if defined(FSL_FEATURE_SOC_FGPIO_COUNT) && FSL_FEATURE_SOC_FGPIO_COUNT - -#if defined(FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL) && FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Array to map FGPIO instance number to clock name. */ -static const clock_ip_name_t s_fgpioClockName[] = FGPIO_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#endif /* FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL */ - -#endif /* FSL_FEATURE_SOC_FGPIO_COUNT */ - -#if defined(GPIO_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_gpioResets[] = GPIO_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -/*! - * @brief Gets the GPIO instance according to the GPIO base - * - * @param base GPIO peripheral base pointer(PTA, PTB, PTC, etc.) - * @retval GPIO instance - */ -static uint32_t GPIO_GetInstance(GPIO_Type *base); -#endif -/******************************************************************************* - * Code - ******************************************************************************/ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) || defined(GPIO_RESETS_ARRAY) -static uint32_t GPIO_GetInstance(GPIO_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_gpioBases); instance++) - { - if (s_gpioBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_gpioBases)); - - return instance; -} -#endif -/*! - * brief Initializes a GPIO pin used by the board. - * - * To initialize the GPIO, define a pin configuration, as either input or output, in the user file. - * Then, call the GPIO_PinInit() function. - * - * This is an example to define an input pin or an output pin configuration. - * code - * Define a digital input pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalInput, - * 0, - * } - * Define a digital output pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalOutput, - * 0, - * } - * endcode - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * param pin GPIO port pin number - * param config GPIO pin configuration pointer - */ -void GPIO_PinInit(GPIO_Type *base, uint32_t pin, const gpio_pin_config_t *config) -{ - assert(NULL != config); - -#if defined(GPIO_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_gpioResets[GPIO_GetInstance(base)]); -#endif - - if (config->pinDirection == kGPIO_DigitalInput) - { - base->PDDR &= GPIO_FIT_REG(~(1UL << pin)); - } - else - { - GPIO_PinWrite(base, pin, config->outputLogic); - base->PDDR |= GPIO_FIT_REG((1UL << pin)); - } -} - -#if defined(FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER) && FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER -void GPIO_GetVersionInfo(GPIO_Type *base, gpio_version_info_t *info) -{ - info->feature = (uint16_t)base->VERID; - info->minor = (uint8_t)(base->VERID >> GPIO_VERID_MINOR_SHIFT); - info->major = (uint8_t)(base->VERID >> GPIO_VERID_MAJOR_SHIFT); -} -#endif /* FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER */ - -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -/*! - * brief Reads the GPIO port interrupt status flag. - * - * If a pin is configured to generate the DMA request, the corresponding flag - * is cleared automatically at the completion of the requested DMA transfer. - * Otherwise, the flag remains set until a logic one is written to that flag. - * If configured for a level sensitive interrupt that remains asserted, the flag - * is set again immediately. - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * retval The current GPIO port interrupt status flag, for example, 0x00010001 means the - * pin 0 and 17 have the interrupt. - */ -uint32_t GPIO_PortGetInterruptFlags(GPIO_Type *base) -{ - uint8_t instance; - PORT_Type *portBase; - instance = (uint8_t)GPIO_GetInstance(base); - portBase = s_portBases[instance]; - return portBase->ISFR; -} -#else -/*! - * brief Read the GPIO interrupt status flags. - * - * param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on.) - * return The current GPIO's interrupt status flag. - * '1' means the related pin's flag is set, '0' means the related pin's flag not set. - * For example, the return value 0x00010001 means the pin 0 and 17 have the interrupt pending. - */ -uint32_t GPIO_GpioGetInterruptFlags(GPIO_Type *base) -{ - return base->ISFR[0]; -} -#if (defined(FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) && FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) -/*! - * brief Read the GPIO interrupt status flags based on selected interrupt channel(IRQS). - * param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on.) - * param channel '0' means selete interrupt channel 0, '1' means selete interrupt channel 1. - * - * return The current GPIO's interrupt status flag based on the selected interrupt channel. - * '1' means the related pin's flag is set, '0' means the related pin's flag not set. - * For example, the return value 0x00010001 means the pin 0 and 17 have the interrupt pending. - */ -uint32_t GPIO_GpioGetInterruptChannelFlags(GPIO_Type *base, uint32_t channel) -{ - assert(channel < 2U); - return base->ISFR[channel]; -} -#endif /* FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT */ -/*! - * brief Read individual pin's interrupt status flag. - * - * param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on) - * param pin GPIO specific pin number. - * return The current selected pin's interrupt status flag. - */ -uint8_t GPIO_PinGetInterruptFlag(GPIO_Type *base, uint32_t pin) -{ - return (uint8_t)((base->ICR[pin] & GPIO_ICR_ISF_MASK) >> GPIO_ICR_ISF_SHIFT); -} -#endif /* FSL_FEATURE_PORT_HAS_NO_INTERRUPT */ - -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -/*! - * brief Clears multiple GPIO pin interrupt status flags. - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * param mask GPIO pin number macro - */ -void GPIO_PortClearInterruptFlags(GPIO_Type *base, uint32_t mask) -{ - uint8_t instance; - PORT_Type *portBase; - instance = (uint8_t)GPIO_GetInstance(base); - portBase = s_portBases[instance]; - portBase->ISFR = mask; -} -#else -/*! - * brief Clears GPIO pin interrupt status flags. - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * param mask GPIO pin number macro - */ -void GPIO_GpioClearInterruptFlags(GPIO_Type *base, uint32_t mask) -{ - base->ISFR[0] = GPIO_FIT_REG(mask); -} -#if (defined(FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) && FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) -/*! - * brief Clears GPIO pin interrupt status flags based on selected interrupt channel(IRQS). - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * param mask GPIO pin number macro - * param channel '0' means selete interrupt channel 0, '1' means selete interrupt channel 1. - */ -void GPIO_GpioClearInterruptChannelFlags(GPIO_Type *base, uint32_t mask, uint32_t channel) -{ - assert(channel < 2U); - base->ISFR[channel] = GPIO_FIT_REG(mask); -} -#endif /* FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT */ -/*! - * brief Clear GPIO individual pin's interrupt status flag. - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on). - * param pin GPIO specific pin number. - */ -void GPIO_PinClearInterruptFlag(GPIO_Type *base, uint32_t pin) -{ - base->ICR[pin] |= GPIO_FIT_REG(GPIO_ICR_ISF(1U)); -} -#endif /* FSL_FEATURE_PORT_HAS_NO_INTERRUPT */ - -#if defined(FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER) && FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER -/*! - * brief The GPIO module supports a device-specific number of data ports, organized as 32-bit - * words/8-bit Bytes. Each 32-bit/8-bit data port includes a GACR register, which defines the byte-level - * attributes required for a successful access to the GPIO programming model. If the GPIO module's GACR register - * organized as 32-bit words, the attribute controls for the 4 data bytes in the GACR follow a standard little - * endian data convention. - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * param attribute GPIO checker attribute - */ -void GPIO_CheckAttributeBytes(GPIO_Type *base, gpio_checker_attribute_t attribute) -{ -#if defined(FSL_FEATURE_GPIO_REGISTERS_WIDTH) && (FSL_FEATURE_GPIO_REGISTERS_WIDTH == 8U) - base->GACR = ((uint8_t)attribute << GPIO_GACR_ACB_SHIFT); -#else - base->GACR = ((uint32_t)attribute << GPIO_GACR_ACB0_SHIFT) | ((uint32_t)attribute << GPIO_GACR_ACB1_SHIFT) | - ((uint32_t)attribute << GPIO_GACR_ACB2_SHIFT) | ((uint32_t)attribute << GPIO_GACR_ACB3_SHIFT); -#endif /* FSL_FEATURE_GPIO_REGISTERS_WIDTH */ -} -#endif - -#if defined(FSL_FEATURE_SOC_FGPIO_COUNT) && FSL_FEATURE_SOC_FGPIO_COUNT - -/******************************************************************************* - * Variables - ******************************************************************************/ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -static FGPIO_Type *const s_fgpioBases[] = FGPIO_BASE_PTRS; -#endif -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -/*! - * @brief Gets the FGPIO instance according to the GPIO base - * - * @param base FGPIO peripheral base pointer(PTA, PTB, PTC, etc.) - * @retval FGPIO instance - */ -static uint32_t FGPIO_GetInstance(FGPIO_Type *base); -#endif -/******************************************************************************* - * Code - ******************************************************************************/ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -static uint32_t FGPIO_GetInstance(FGPIO_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_fgpioBases); instance++) - { - if (s_fgpioBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_fgpioBases)); - - return instance; -} -#endif -#if defined(FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL) && FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL -/*! - * brief Initializes the FGPIO peripheral. - * - * This function ungates the FGPIO clock. - * - * param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - */ -void FGPIO_PortInit(FGPIO_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate FGPIO periphral clock */ - CLOCK_EnableClock(s_fgpioClockName[FGPIO_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} -#endif /* FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL */ - -/*! - * brief Initializes a FGPIO pin used by the board. - * - * To initialize the FGPIO driver, define a pin configuration, as either input or output, in the user file. - * Then, call the FGPIO_PinInit() function. - * - * This is an example to define an input pin or an output pin configuration: - * code - * Define a digital input pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalInput, - * 0, - * } - * Define a digital output pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalOutput, - * 0, - * } - * endcode - * - * param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * param pin FGPIO port pin number - * param config FGPIO pin configuration pointer - */ -void FGPIO_PinInit(FGPIO_Type *base, uint32_t pin, const gpio_pin_config_t *config) -{ - assert(NULL != config); - - if (config->pinDirection == kGPIO_DigitalInput) - { - base->PDDR &= ~(1UL << pin); - } - else - { - FGPIO_PinWrite(base, pin, config->outputLogic); - base->PDDR |= (1UL << pin); - } -} -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -/*! - * brief Reads the FGPIO port interrupt status flag. - * - * If a pin is configured to generate the DMA request, the corresponding flag - * is cleared automatically at the completion of the requested DMA transfer. - * Otherwise, the flag remains set until a logic one is written to that flag. - * If configured for a level-sensitive interrupt that remains asserted, the flag - * is set again immediately. - * - * param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * retval The current FGPIO port interrupt status flags, for example, 0x00010001 means the - * pin 0 and 17 have the interrupt. - */ -uint32_t FGPIO_PortGetInterruptFlags(FGPIO_Type *base) -{ - uint8_t instance; - instance = (uint8_t)FGPIO_GetInstance(base); - PORT_Type *portBase; - portBase = s_portBases[instance]; - return portBase->ISFR; -} - -/*! - * brief Clears the multiple FGPIO pin interrupt status flag. - * - * param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * param mask FGPIO pin number macro - */ -void FGPIO_PortClearInterruptFlags(FGPIO_Type *base, uint32_t mask) -{ - uint8_t instance; - instance = (uint8_t)FGPIO_GetInstance(base); - PORT_Type *portBase; - portBase = s_portBases[instance]; - portBase->ISFR = mask; -} -#endif -#if defined(FSL_FEATURE_FGPIO_HAS_ATTRIBUTE_CHECKER) && FSL_FEATURE_FGPIO_HAS_ATTRIBUTE_CHECKER -/*! - * brief The FGPIO module supports a device-specific number of data ports, organized as 32-bit - * words. Each 32-bit data port includes a GACR register, which defines the byte-level - * attributes required for a successful access to the GPIO programming model. The attribute controls for the 4 data - * bytes in the GACR follow a standard little endian - * data convention. - * - * param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * param attribute FGPIO checker attribute - */ -void FGPIO_CheckAttributeBytes(FGPIO_Type *base, gpio_checker_attribute_t attribute) -{ - base->GACR = ((uint32_t)attribute << FGPIO_GACR_ACB0_SHIFT) | ((uint32_t)attribute << FGPIO_GACR_ACB1_SHIFT) | - ((uint32_t)attribute << FGPIO_GACR_ACB2_SHIFT) | ((uint32_t)attribute << FGPIO_GACR_ACB3_SHIFT); -} -#endif - -#endif /* FSL_FEATURE_SOC_FGPIO_COUNT */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_gpio.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_gpio.h deleted file mode 100644 index ce943c5b698..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_gpio.h +++ /dev/null @@ -1,799 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_GPIO_H_ -#define FSL_GPIO_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup gpio - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief GPIO driver version. */ -#define FSL_GPIO_DRIVER_VERSION (MAKE_VERSION(2, 7, 3)) -/*@}*/ - -#if defined(FSL_FEATURE_GPIO_REGISTERS_WIDTH) && (FSL_FEATURE_GPIO_REGISTERS_WIDTH == 8U) -#define GPIO_FIT_REG(value) \ - ((uint8_t)(value)) /*!< For some platforms with 8-bit register width, cast the type to uint8_t */ -#else -#define GPIO_FIT_REG(value) ((uint32_t)(value)) -#endif /*FSL_FEATURE_GPIO_REGISTERS_WIDTH*/ - -/*! @brief GPIO direction definition */ -typedef enum _gpio_pin_direction -{ - kGPIO_DigitalInput = 0U, /*!< Set current pin as digital input*/ - kGPIO_DigitalOutput = 1U, /*!< Set current pin as digital output*/ -} gpio_pin_direction_t; - -#if defined(FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER) && FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER -/*! @brief GPIO checker attribute */ -typedef enum _gpio_checker_attribute -{ - kGPIO_UsernonsecureRWUsersecureRWPrivilegedsecureRW = - 0x00U, /*!< User nonsecure:Read+Write; User Secure:Read+Write; Privileged Secure:Read+Write */ - kGPIO_UsernonsecureRUsersecureRWPrivilegedsecureRW = - 0x01U, /*!< User nonsecure:Read; User Secure:Read+Write; Privileged Secure:Read+Write */ - kGPIO_UsernonsecureNUsersecureRWPrivilegedsecureRW = - 0x02U, /*!< User nonsecure:None; User Secure:Read+Write; Privileged Secure:Read+Write */ - kGPIO_UsernonsecureRUsersecureRPrivilegedsecureRW = - 0x03U, /*!< User nonsecure:Read; User Secure:Read; Privileged Secure:Read+Write */ - kGPIO_UsernonsecureNUsersecureRPrivilegedsecureRW = - 0x04U, /*!< User nonsecure:None; User Secure:Read; Privileged Secure:Read+Write */ - kGPIO_UsernonsecureNUsersecureNPrivilegedsecureRW = - 0x05U, /*!< User nonsecure:None; User Secure:None; Privileged Secure:Read+Write */ - kGPIO_UsernonsecureNUsersecureNPrivilegedsecureR = - 0x06U, /*!< User nonsecure:None; User Secure:None; Privileged Secure:Read */ - kGPIO_UsernonsecureNUsersecureNPrivilegedsecureN = - 0x07U, /*!< User nonsecure:None; User Secure:None; Privileged Secure:None */ - kGPIO_IgnoreAttributeCheck = 0x80U, /*!< Ignores the attribute check */ -} gpio_checker_attribute_t; -#endif - -/*! - * @brief The GPIO pin configuration structure. - * - * Each pin can only be configured as either an output pin or an input pin at a time. - * If configured as an input pin, leave the outputConfig unused. - * Note that in some use cases, the corresponding port property should be configured in advance - * with the PORT_SetPinConfig(). - */ -typedef struct _gpio_pin_config -{ - gpio_pin_direction_t pinDirection; /*!< GPIO direction, input or output */ - /* Output configurations; ignore if configured as an input pin */ - uint8_t outputLogic; /*!< Set a default output logic, which has no use in input */ -} gpio_pin_config_t; - -#if (defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) || \ - !(defined(FSL_FEATURE_SOC_PORT_COUNT)) -/*! @brief Configures the interrupt generation condition. */ -typedef enum _gpio_interrupt_config -{ - kGPIO_InterruptStatusFlagDisabled = 0x0U, /*!< Interrupt status flag is disabled. */ - kGPIO_DMARisingEdge = 0x1U, /*!< ISF flag and DMA request on rising edge. */ - kGPIO_DMAFallingEdge = 0x2U, /*!< ISF flag and DMA request on falling edge. */ - kGPIO_DMAEitherEdge = 0x3U, /*!< ISF flag and DMA request on either edge. */ - kGPIO_FlagRisingEdge = 0x05U, /*!< Flag sets on rising edge. */ - kGPIO_FlagFallingEdge = 0x06U, /*!< Flag sets on falling edge. */ - kGPIO_FlagEitherEdge = 0x07U, /*!< Flag sets on either edge. */ - kGPIO_InterruptLogicZero = 0x8U, /*!< Interrupt when logic zero. */ - kGPIO_InterruptRisingEdge = 0x9U, /*!< Interrupt on rising edge. */ - kGPIO_InterruptFallingEdge = 0xAU, /*!< Interrupt on falling edge. */ - kGPIO_InterruptEitherEdge = 0xBU, /*!< Interrupt on either edge. */ - kGPIO_InterruptLogicOne = 0xCU, /*!< Interrupt when logic one. */ - kGPIO_ActiveHighTriggerOutputEnable = 0xDU, /*!< Enable active high-trigger output. */ - kGPIO_ActiveLowTriggerOutputEnable = 0xEU, /*!< Enable active low-trigger output. */ -} gpio_interrupt_config_t; -#endif - -#if (defined(FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) && FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) -/*! @brief Configures the selection of interrupt/DMA request/trigger output. */ -typedef enum _gpio_interrupt_selection -{ - kGPIO_InterruptOutput0 = 0x0U, /*!< Interrupt/DMA request/trigger output 0. */ - kGPIO_InterruptOutput1 = 0x1U, /*!< Interrupt/DMA request/trigger output 1. */ -} gpio_interrupt_selection_t; -#endif /* FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT */ - -#if defined(FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER) && FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER -/*! @brief GPIO version information. */ -typedef struct _gpio_version_info -{ - uint16_t feature; /*!< Feature Specification Number. */ - uint8_t minor; /*!< Minor Version Number. */ - uint8_t major; /*!< Major Version Number. */ -} gpio_version_info_t; -#endif /* FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER */ - -#if defined(FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL) && FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL -/*! @brief GPIO pin and interrupt control. */ -typedef enum -{ - kGPIO_PinControlNonSecure = 0x01U, /*!< Pin Control Non-Secure. */ - kGPIO_InterruptControlNonSecure = 0x02U, /*!< Interrupt Control Non-Secure. */ - kGPIO_PinControlNonPrivilege = 0x04U, /*!< Pin Control Non-Privilege. */ - kGPIO_InterruptControlNonPrivilege = 0x08U, /*!< Interrupt Control Non-Privilege. */ -} gpio_pin_interrupt_control_t; -#endif /* FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL */ - -/*! @} */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @addtogroup gpio_driver - * @{ - */ - -/*! @name GPIO Configuration */ -/*@{*/ - -/*! - * @brief Initializes a GPIO pin used by the board. - * - * To initialize the GPIO, define a pin configuration, as either input or output, in the user file. - * Then, call the GPIO_PinInit() function. - * - * This is an example to define an input pin or an output pin configuration. - * @code - * Define a digital input pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalInput, - * 0, - * } - * Define a digital output pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalOutput, - * 0, - * } - * @endcode - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param pin GPIO port pin number - * @param config GPIO pin configuration pointer - */ -void GPIO_PinInit(GPIO_Type *base, uint32_t pin, const gpio_pin_config_t *config); - -#if defined(FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER) && FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER -/*! - * @brief Get GPIO version information. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param info GPIO version information - */ -void GPIO_GetVersionInfo(GPIO_Type *base, gpio_version_info_t *info); -#endif /* FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER */ - -#if defined(FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL) && FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL -/*! - * @brief lock or unlock secure privilege. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask pin or interrupt macro - */ -static inline void GPIO_SecurePrivilegeLock(GPIO_Type *base, gpio_pin_interrupt_control_t mask) -{ - base->LOCK |= GPIO_FIT_REG(mask); -} - -/*! - * @brief Enable Pin Control Non-Secure. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_EnablePinControlNonSecure(GPIO_Type *base, uint32_t mask) -{ - base->PCNS |= GPIO_FIT_REG(mask); -} - -/*! - * @brief Disable Pin Control Non-Secure. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_DisablePinControlNonSecure(GPIO_Type *base, uint32_t mask) -{ - base->PCNS &= GPIO_FIT_REG(~mask); -} - -/*! - * @brief Enable Pin Control Non-Privilege. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_EnablePinControlNonPrivilege(GPIO_Type *base, uint32_t mask) -{ - base->PCNP |= GPIO_FIT_REG(mask); -} - -/*! - * @brief Disable Pin Control Non-Privilege. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_DisablePinControlNonPrivilege(GPIO_Type *base, uint32_t mask) -{ - base->PCNP &= GPIO_FIT_REG(~mask); -} - -/*! - * @brief Enable Interrupt Control Non-Secure. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_EnableInterruptControlNonSecure(GPIO_Type *base, uint32_t mask) -{ - base->ICNS |= GPIO_FIT_REG(mask); -} - -/*! - * @brief Disable Interrupt Control Non-Secure. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_DisableInterruptControlNonSecure(GPIO_Type *base, uint32_t mask) -{ - base->ICNS &= GPIO_FIT_REG(~mask); -} - -/*! - * @brief Enable Interrupt Control Non-Privilege. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_EnableInterruptControlNonPrivilege(GPIO_Type *base, uint32_t mask) -{ - base->ICNP |= GPIO_FIT_REG(mask); -} - -/*! - * @brief Disable Interrupt Control Non-Privilege. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_DisableInterruptControlNonPrivilege(GPIO_Type *base, uint32_t mask) -{ - base->ICNP &= GPIO_FIT_REG(~mask); -} -#endif /* FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL */ - -#if defined(FSL_FEATURE_GPIO_HAS_PORT_INPUT_CONTROL) && FSL_FEATURE_GPIO_HAS_PORT_INPUT_CONTROL -/*! - * @brief Enable port input. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_PortInputEnable(GPIO_Type *base, uint32_t mask) -{ - base->PIDR &= GPIO_FIT_REG(~mask); -} - -/*! - * @brief Disable port input. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_PortInputDisable(GPIO_Type *base, uint32_t mask) -{ - base->PIDR |= GPIO_FIT_REG(mask); -} -#endif /* FSL_FEATURE_GPIO_HAS_PORT_INPUT_CONTROL */ - -/*@}*/ - -/*! @name GPIO Output Operations */ -/*@{*/ - -/*! - * @brief Sets the output level of the multiple GPIO pins to the logic 1 or 0. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param pin GPIO pin number - * @param output GPIO pin output logic level. - * - 0: corresponding pin output low-logic level. - * - 1: corresponding pin output high-logic level. - */ -static inline void GPIO_PinWrite(GPIO_Type *base, uint32_t pin, uint8_t output) -{ -#if !(defined(FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) && FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) - if (output == 0U) - { - base->PCOR = GPIO_FIT_REG(1UL << pin); - } - else - { - base->PSOR = GPIO_FIT_REG(1UL << pin); - } -#else - if (output == 0U) - { - base->PDOR |= GPIO_FIT_REG(1UL << pin); - } - else - { - base->PDOR &= ~GPIO_FIT_REG(1UL << pin); - } -#endif -} - -/*! - * @brief Sets the output level of the multiple GPIO pins to the logic 1. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_PortSet(GPIO_Type *base, uint32_t mask) -{ -#if !(defined(FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) && FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) - base->PSOR = GPIO_FIT_REG(mask); -#else - base->PDOR |= GPIO_FIT_REG(mask); -#endif -} - -/*! - * @brief Sets the output level of the multiple GPIO pins to the logic 0. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_PortClear(GPIO_Type *base, uint32_t mask) -{ -#if !(defined(FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) && FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) - base->PCOR = GPIO_FIT_REG(mask); -#else - base->PDOR &= ~GPIO_FIT_REG(mask); -#endif -} - -/*! - * @brief Reverses the current output logic of the multiple GPIO pins. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_PortToggle(GPIO_Type *base, uint32_t mask) -{ -#if !(defined(FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) && FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) - base->PTOR = GPIO_FIT_REG(mask); -#else - base->PDOR ^= GPIO_FIT_REG(mask); -#endif -} - -/*@}*/ - -/*! @name GPIO Input Operations */ -/*@{*/ - -/*! - * @brief Reads the current input value of the GPIO port. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param pin GPIO pin number - * @retval GPIO port input value - * - 0: corresponding pin input low-logic level. - * - 1: corresponding pin input high-logic level. - */ -static inline uint32_t GPIO_PinRead(GPIO_Type *base, uint32_t pin) -{ - return (((uint32_t)(base->PDIR) >> pin) & 0x01UL); -} - -/*@}*/ - -/*! @name GPIO Interrupt */ -/*@{*/ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -/*! - * @brief Reads the GPIO port interrupt status flag. - * - * If a pin is configured to generate the DMA request, the corresponding flag - * is cleared automatically at the completion of the requested DMA transfer. - * Otherwise, the flag remains set until a logic one is written to that flag. - * If configured for a level sensitive interrupt that remains asserted, the flag - * is set again immediately. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @retval The current GPIO port interrupt status flag, for example, 0x00010001 means the - * pin 0 and 17 have the interrupt. - */ -uint32_t GPIO_PortGetInterruptFlags(GPIO_Type *base); - -/*! - * @brief Clears multiple GPIO pin interrupt status flags. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -void GPIO_PortClearInterruptFlags(GPIO_Type *base, uint32_t mask); -#else -/*! - * @brief Configures the gpio pin interrupt/DMA request. - * - * @param base GPIO peripheral base pointer. - * @param pin GPIO pin number. - * @param config GPIO pin interrupt configuration. - * - #kGPIO_InterruptStatusFlagDisabled: Interrupt/DMA request disabled. - * - #kGPIO_DMARisingEdge : DMA request on rising edge(if the DMA requests exit). - * - #kGPIO_DMAFallingEdge: DMA request on falling edge(if the DMA requests exit). - * - #kGPIO_DMAEitherEdge : DMA request on either edge(if the DMA requests exit). - * - #kGPIO_FlagRisingEdge : Flag sets on rising edge(if the Flag states exit). - * - #kGPIO_FlagFallingEdge : Flag sets on falling edge(if the Flag states exit). - * - #kGPIO_FlagEitherEdge : Flag sets on either edge(if the Flag states exit). - * - #kGPIO_InterruptLogicZero : Interrupt when logic zero. - * - #kGPIO_InterruptRisingEdge : Interrupt on rising edge. - * - #kGPIO_InterruptFallingEdge: Interrupt on falling edge. - * - #kGPIO_InterruptEitherEdge : Interrupt on either edge. - * - #kGPIO_InterruptLogicOne : Interrupt when logic one. - * - #kGPIO_ActiveHighTriggerOutputEnable : Enable active high-trigger output (if the trigger states exit). - * - #kGPIO_ActiveLowTriggerOutputEnable : Enable active low-trigger output (if the trigger states exit). - */ -static inline void GPIO_SetPinInterruptConfig(GPIO_Type *base, uint32_t pin, gpio_interrupt_config_t config) -{ - assert(base); - - base->ICR[pin] = GPIO_FIT_REG((base->ICR[pin] & ~GPIO_ICR_IRQC_MASK) | GPIO_ICR_IRQC(config)); -} - -#if (defined(FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) && FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) -/*! - * @brief Configures the gpio pin interrupt/DMA request/trigger output channel selection. - * - * @param base GPIO peripheral base pointer. - * @param pin GPIO pin number. - * @param selection GPIO pin interrupt output selection. - * - #kGPIO_InterruptOutput0: Interrupt/DMA request/trigger output 0. - * - #kGPIO_InterruptOutput1 : Interrupt/DMA request/trigger output 1. - */ -static inline void GPIO_SetPinInterruptChannel(GPIO_Type *base, uint32_t pin, gpio_interrupt_selection_t selection) -{ - assert(base); - - base->ICR[pin] = GPIO_FIT_REG((base->ICR[pin] & ~GPIO_ICR_IRQS_MASK) | GPIO_ICR_IRQS(selection)); -} -#endif -/*! - * @brief Read the GPIO interrupt status flags. - * - * @param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on.) - * @return The current GPIO's interrupt status flag. - * '1' means the related pin's flag is set, '0' means the related pin's flag not set. - * For example, the return value 0x00010001 means the pin 0 and 17 have the interrupt pending. - */ -uint32_t GPIO_GpioGetInterruptFlags(GPIO_Type *base); -#if (defined(FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) && FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) -/*! - * @brief Read the GPIO interrupt status flags based on selected interrupt channel(IRQS). - * - * @param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on.) - * @param channel '0' means selete interrupt channel 0, '1' means selete interrupt channel 1. - * @return The current GPIO's interrupt status flag based on the selected interrupt channel. - * '1' means the related pin's flag is set, '0' means the related pin's flag not set. - * For example, the return value 0x00010001 means the pin 0 and 17 have the interrupt pending. - */ -uint32_t GPIO_GpioGetInterruptChannelFlags(GPIO_Type *base, uint32_t channel); -#endif -/*! - * @brief Read individual pin's interrupt status flag. - * - * @param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on) - * @param pin GPIO specific pin number. - * @return The current selected pin's interrupt status flag. - */ -uint8_t GPIO_PinGetInterruptFlag(GPIO_Type *base, uint32_t pin); - -/*! - * @brief Clears GPIO pin interrupt status flags. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -void GPIO_GpioClearInterruptFlags(GPIO_Type *base, uint32_t mask); -#if (defined(FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) && FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) -/*! - * @brief Clears GPIO pin interrupt status flags based on selected interrupt channel(IRQS). - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - * @param channel '0' means selete interrupt channel 0, '1' means selete interrupt channel 1. - */ -void GPIO_GpioClearInterruptChannelFlags(GPIO_Type *base, uint32_t mask, uint32_t channel); -#endif -/*! - * @brief Clear GPIO individual pin's interrupt status flag. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on). - * @param pin GPIO specific pin number. - */ -void GPIO_PinClearInterruptFlag(GPIO_Type *base, uint32_t pin); - -/*! - * @brief Reads the GPIO DMA request flags. - * The corresponding flag will be cleared automatically at the completion of the requested - * DMA transfer - */ -static inline uint32_t GPIO_GetPinsDMARequestFlags(GPIO_Type *base) -{ - assert(base); - return (base->ISFR[1]); -} - -/*! - * @brief Sets the GPIO interrupt configuration in PCR register for multiple pins. - * - * @param base GPIO peripheral base pointer. - * @param mask GPIO pin number macro. - * @param config GPIO pin interrupt configuration. - * - #kGPIO_InterruptStatusFlagDisabled: Interrupt disabled. - * - #kGPIO_DMARisingEdge : DMA request on rising edge(if the DMA requests exit). - * - #kGPIO_DMAFallingEdge: DMA request on falling edge(if the DMA requests exit). - * - #kGPIO_DMAEitherEdge : DMA request on either edge(if the DMA requests exit). - * - #kGPIO_FlagRisingEdge : Flag sets on rising edge(if the Flag states exit). - * - #kGPIO_FlagFallingEdge : Flag sets on falling edge(if the Flag states exit). - * - #kGPIO_FlagEitherEdge : Flag sets on either edge(if the Flag states exit). - * - #kGPIO_InterruptLogicZero : Interrupt when logic zero. - * - #kGPIO_InterruptRisingEdge : Interrupt on rising edge. - * - #kGPIO_InterruptFallingEdge: Interrupt on falling edge. - * - #kGPIO_InterruptEitherEdge : Interrupt on either edge. - * - #kGPIO_InterruptLogicOne : Interrupt when logic one. - * - #kGPIO_ActiveHighTriggerOutputEnable : Enable active high-trigger output (if the trigger states exit). - * - #kGPIO_ActiveLowTriggerOutputEnable : Enable active low-trigger output (if the trigger states exit).. - */ -static inline void GPIO_SetMultipleInterruptPinsConfig(GPIO_Type *base, uint32_t mask, gpio_interrupt_config_t config) -{ - assert(base); - - if (0UL != (mask & 0xffffUL)) - { - base->GICLR = GPIO_FIT_REG((GPIO_ICR_IRQC(config)) | (mask & 0xffffU)); - } - mask = mask >> 16U; - if (mask != 0UL) - { - base->GICHR = GPIO_FIT_REG((GPIO_ICR_IRQC(config)) | (mask & 0xffffU)); - } -} -#endif - -#if defined(FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER) && FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER -/*! - * brief The GPIO module supports a device-specific number of data ports, organized as 32-bit - * words/8-bit Bytes. Each 32-bit/8-bit data port includes a GACR register, which defines the byte-level - * attributes required for a successful access to the GPIO programming model. If the GPIO module's GACR register - * organized as 32-bit words, the attribute controls for the 4 data bytes in the GACR follow a standard little - * endian data convention. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param attribute GPIO checker attribute - */ -void GPIO_CheckAttributeBytes(GPIO_Type *base, gpio_checker_attribute_t attribute); -#endif - -/*@}*/ -/*! @} */ - -/*! - * @addtogroup fgpio_driver - * @{ - */ - -/* - * Introduces the FGPIO feature. - * - * The FGPIO features are only support on some Kinetis MCUs. The FGPIO registers are aliased to the IOPORT - * interface. Accesses via the IOPORT interface occur in parallel with any instruction fetches and - * complete in a single cycle. This aliased Fast GPIO memory map is called FGPIO. - */ - -#if defined(FSL_FEATURE_SOC_FGPIO_COUNT) && FSL_FEATURE_SOC_FGPIO_COUNT - -/*! @name FGPIO Configuration */ -/*@{*/ - -#if defined(FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL) && FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL -/*! - * @brief Initializes the FGPIO peripheral. - * - * This function ungates the FGPIO clock. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - */ -void FGPIO_PortInit(FGPIO_Type *base); -#endif /* FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL */ - -/*! - * @brief Initializes a FGPIO pin used by the board. - * - * To initialize the FGPIO driver, define a pin configuration, as either input or output, in the user file. - * Then, call the FGPIO_PinInit() function. - * - * This is an example to define an input pin or an output pin configuration: - * @code - * Define a digital input pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalInput, - * 0, - * } - * Define a digital output pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalOutput, - * 0, - * } - * @endcode - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param pin FGPIO port pin number - * @param config FGPIO pin configuration pointer - */ -void FGPIO_PinInit(FGPIO_Type *base, uint32_t pin, const gpio_pin_config_t *config); - -/*@}*/ - -/*! @name FGPIO Output Operations */ -/*@{*/ - -/*! - * @brief Sets the output level of the multiple FGPIO pins to the logic 1 or 0. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param pin FGPIO pin number - * @param output FGPIOpin output logic level. - * - 0: corresponding pin output low-logic level. - * - 1: corresponding pin output high-logic level. - */ -static inline void FGPIO_PinWrite(FGPIO_Type *base, uint32_t pin, uint8_t output) -{ - if (output == 0U) - { - base->PCOR = 1UL << pin; - } - else - { - base->PSOR = 1UL << pin; - } -} - -/*! - * @brief Sets the output level of the multiple FGPIO pins to the logic 1. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param mask FGPIO pin number macro - */ -static inline void FGPIO_PortSet(FGPIO_Type *base, uint32_t mask) -{ - base->PSOR = mask; -} - -/*! - * @brief Sets the output level of the multiple FGPIO pins to the logic 0. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param mask FGPIO pin number macro - */ -static inline void FGPIO_PortClear(FGPIO_Type *base, uint32_t mask) -{ - base->PCOR = mask; -} - -/*! - * @brief Reverses the current output logic of the multiple FGPIO pins. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param mask FGPIO pin number macro - */ -static inline void FGPIO_PortToggle(FGPIO_Type *base, uint32_t mask) -{ - base->PTOR = mask; -} -/*@}*/ - -/*! @name FGPIO Input Operations */ -/*@{*/ - -/*! - * @brief Reads the current input value of the FGPIO port. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param pin FGPIO pin number - * @retval FGPIO port input value - * - 0: corresponding pin input low-logic level. - * - 1: corresponding pin input high-logic level. - */ -static inline uint32_t FGPIO_PinRead(FGPIO_Type *base, uint32_t pin) -{ - return (((base->PDIR) >> pin) & 0x01U); -} -/*@}*/ - -/*! @name FGPIO Interrupt */ -/*@{*/ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) - -/*! - * @brief Reads the FGPIO port interrupt status flag. - * - * If a pin is configured to generate the DMA request, the corresponding flag - * is cleared automatically at the completion of the requested DMA transfer. - * Otherwise, the flag remains set until a logic one is written to that flag. - * If configured for a level-sensitive interrupt that remains asserted, the flag - * is set again immediately. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @retval The current FGPIO port interrupt status flags, for example, 0x00010001 means the - * pin 0 and 17 have the interrupt. - */ -uint32_t FGPIO_PortGetInterruptFlags(FGPIO_Type *base); - -/*! - * @brief Clears the multiple FGPIO pin interrupt status flag. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param mask FGPIO pin number macro - */ -void FGPIO_PortClearInterruptFlags(FGPIO_Type *base, uint32_t mask); -#endif -#if defined(FSL_FEATURE_FGPIO_HAS_ATTRIBUTE_CHECKER) && FSL_FEATURE_FGPIO_HAS_ATTRIBUTE_CHECKER -/*! - * @brief The FGPIO module supports a device-specific number of data ports, organized as 32-bit - * words. Each 32-bit data port includes a GACR register, which defines the byte-level - * attributes required for a successful access to the GPIO programming model. The attribute controls for the 4 data - * bytes in the GACR follow a standard little endian - * data convention. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param attribute FGPIO checker attribute - */ -void FGPIO_CheckAttributeBytes(FGPIO_Type *base, gpio_checker_attribute_t attribute); -#endif /* FSL_FEATURE_FGPIO_HAS_ATTRIBUTE_CHECKER */ - -/*@}*/ - -#endif /* FSL_FEATURE_SOC_FGPIO_COUNT */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ - -#endif /* FSL_GPIO_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_i3c.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_i3c.c deleted file mode 100644 index 5862a142acc..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_i3c.c +++ /dev/null @@ -1,3493 +0,0 @@ -/* - * Copyright 2018-2023 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_i3c.h" -#if !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) -#include "fsl_reset.h" -#endif -#include -#include - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.i3c" -#endif - -#define I3C_BROADCASE_ADDR (0x7EU) - -#define NSEC_PER_SEC (1000000000UL) -#define FSL_I3C_ERROR_RATE_MAX (10U) -#define FSL_I3C_PPBAUD_DIV_MAX ((I3C_MCONFIG_PPBAUD_MASK >> I3C_MCONFIG_PPBAUD_SHIFT) + 1U) -#define FSL_I3C_ODBAUD_DIV_MAX ((I3C_MCONFIG_ODBAUD_MASK >> I3C_MCONFIG_ODBAUD_SHIFT) + 1U) -#define FSL_I3C_I2CBAUD_DIV_MAX (((I3C_MCONFIG_I2CBAUD_MASK >> I3C_MCONFIG_I2CBAUD_SHIFT) + 1U) / 2U) - -/*! @brief Common sets of flags used by the driver. */ -enum _i3c_flag_constants -{ - /*! All flags which are cleared by the driver upon starting a transfer. */ - kMasterClearFlags = kI3C_MasterSlaveStartFlag | kI3C_MasterControlDoneFlag | kI3C_MasterCompleteFlag | - kI3C_MasterArbitrationWonFlag | kI3C_MasterSlave2MasterFlag | kI3C_MasterErrorFlag, - - /*! IRQ sources enabled by the non-blocking transactional API. */ - kMasterIrqFlags = kI3C_MasterSlaveStartFlag | kI3C_MasterControlDoneFlag | kI3C_MasterCompleteFlag | - kI3C_MasterRxReadyFlag /* | kI3C_MasterTxReadyFlag */ | kI3C_MasterArbitrationWonFlag | - kI3C_MasterErrorFlag | kI3C_MasterSlave2MasterFlag, - - /*! Errors to check for. */ - kMasterErrorFlags = kI3C_MasterErrorNackFlag | kI3C_MasterErrorWriteAbortFlag | -#if !defined(FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) || (!FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) - kI3C_MasterErrorTermFlag | -#endif - kI3C_MasterErrorParityFlag | kI3C_MasterErrorCrcFlag | kI3C_MasterErrorReadFlag | - kI3C_MasterErrorWriteFlag | kI3C_MasterErrorMsgFlag | kI3C_MasterErrorInvalidReqFlag | - kI3C_MasterErrorTimeoutFlag, - /*! All flags which are cleared by the driver upon starting a transfer. */ - kSlaveClearFlags = kI3C_SlaveBusStartFlag | kI3C_SlaveMatchedFlag | kI3C_SlaveBusStopFlag, - - /*! IRQ sources enabled by the non-blocking transactional API. */ - kSlaveIrqFlags = kI3C_SlaveBusStartFlag | kI3C_SlaveMatchedFlag | kI3C_SlaveBusStopFlag | kI3C_SlaveRxReadyFlag | - kI3C_SlaveDynamicAddrChangedFlag | kI3C_SlaveReceivedCCCFlag | kI3C_SlaveErrorFlag | - kI3C_SlaveHDRCommandMatchFlag | kI3C_SlaveCCCHandledFlag | kI3C_SlaveEventSentFlag, - - /*! Errors to check for. */ - kSlaveErrorFlags = kI3C_SlaveErrorOverrunFlag | kI3C_SlaveErrorUnderrunFlag | kI3C_SlaveErrorUnderrunNakFlag | - kI3C_SlaveErrorTermFlag | kI3C_SlaveErrorInvalidStartFlag | kI3C_SlaveErrorSdrParityFlag | - kI3C_SlaveErrorHdrParityFlag | kI3C_SlaveErrorHdrCRCFlag | kI3C_SlaveErrorS0S1Flag | - kI3C_SlaveErrorOverreadFlag | kI3C_SlaveErrorOverwriteFlag, -}; - -/*! @brief States for the state machine used by transactional APIs. */ -enum _i3c_transfer_states -{ - kIdleState = 0, - kIBIWonState, - kSlaveStartState, - kSendCommandState, - kWaitRepeatedStartCompleteState, - kTransferDataState, - kStopState, - kWaitForCompletionState, -}; - -/*! - * @brief Used for conversion between `uint8_t*` and `uint32_t`. - */ -typedef union i3c_puint8_to_u32 -{ - uint8_t *puint8; - uint32_t u32; - const uint8_t *cpuint8; -} i3c_puint8_to_u32_t; - -/* - * MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - } - - return result; -} - -status_t I3C_MasterWaitForCtrlDone(I3C_Type *base, bool waitIdle) -{ - status_t result = kStatus_Success; - uint32_t status, errStatus; -#if I3C_RETRY_TIMES - uint32_t waitTimes = I3C_RETRY_TIMES; -#endif - -#if I3C_RETRY_TIMES - while ((result == kStatus_Success) && (--waitTimes)) -#else - while (result == kStatus_Success) -#endif - { - status = I3C_MasterGetStatusFlags(base); - errStatus = I3C_MasterGetErrorStatusFlags(base); - /* Check for error flags. */ - result = I3C_MasterCheckAndClearError(base, errStatus); - /* Check if the control finishes. */ - if (0UL != (status & (uint32_t)kI3C_MasterControlDoneFlag)) - { - I3C_MasterClearStatusFlags(base, (uint32_t)kI3C_MasterControlDoneFlag); - if (!waitIdle) - { - break; - } - } - /* kI3C_MasterControlDoneFlag only indicates ACK got, need to wait for SDA high. */ - if (waitIdle && I3C_MasterGetState(base) == kI3C_MasterStateIdle) - { - break; - } - } - -#if I3C_RETRY_TIMES - if (waitTimes == 0) - { - return kStatus_I3C_Timeout; - } -#endif - - return result; -} - -static status_t I3C_MasterWaitForTxReady(I3C_Type *base, uint8_t byteCounts) -{ - uint32_t errStatus; - status_t result; - size_t txCount; - size_t txFifoSize = - 2UL << ((base->SCAPABILITIES & I3C_SCAPABILITIES_FIFOTX_MASK) >> I3C_SCAPABILITIES_FIFOTX_SHIFT); - -#if I3C_RETRY_TIMES - uint32_t waitTimes = I3C_RETRY_TIMES; -#endif - do - { - /* Get the number of words in the tx fifo and compute empty slots. */ - I3C_MasterGetFifoCounts(base, NULL, &txCount); - txCount = txFifoSize - txCount; - - /* Check for error flags. */ - errStatus = I3C_MasterGetErrorStatusFlags(base); - result = I3C_MasterCheckAndClearError(base, errStatus); - if (kStatus_Success != result) - { - return result; - } -#if I3C_RETRY_TIMES - } while ((txCount < byteCounts) && (--waitTimes)); - - if (waitTimes == 0) - { - return kStatus_I3C_Timeout; - } -#else - } while (txCount < byteCounts); -#endif - - return kStatus_Success; -} - -static status_t I3C_MasterWaitForComplete(I3C_Type *base, bool waitIdle) -{ - uint32_t status, errStatus; - status_t result = kStatus_Success; -#if I3C_RETRY_TIMES - uint32_t waitTimes = I3C_RETRY_TIMES; -#endif - do - { - status = I3C_MasterGetStatusFlags(base); - errStatus = I3C_MasterGetErrorStatusFlags(base); - result = I3C_MasterCheckAndClearError(base, errStatus); -#if I3C_RETRY_TIMES - } while (((status & (uint32_t)kI3C_MasterCompleteFlag) != (uint32_t)kI3C_MasterCompleteFlag) && - (result == kStatus_Success) && --waitTimes); -#else - } while (((status & (uint32_t)kI3C_MasterCompleteFlag) != (uint32_t)kI3C_MasterCompleteFlag) && - (result == kStatus_Success)); -#endif - - I3C_MasterClearStatusFlags(base, (uint32_t)kI3C_MasterCompleteFlag); - -#if I3C_RETRY_TIMES - if (waitTimes == 0UL) - { - return kStatus_I3C_Timeout; - } -#endif - - if (waitIdle) - { -#if I3C_RETRY_TIMES - while ((I3C_MasterGetState(base) != kI3C_MasterStateIdle) && --waitTimes) -#else - while (I3C_MasterGetState(base) != kI3C_MasterStateIdle) -#endif - { - } - } - - return result; -} - -/*! - * @brief Convert provided flags to status code, and clear any errors if present. - * @param base The I3C peripheral base address. - * @param status Current status flags value that will be checked. - * @retval #kStatus_Success - * @retval #kStatus_I3C_OverrunError - * @retval #kStatus_I3C_UnderrunError - * @retval #kStatus_I3C_UnderrunNak - * @retval #kStatus_I3C_Term - * @retval #kStatus_I3C_InvalidStart - * @retval #kStatus_I3C_SdrParityError - * @retval #kStatus_I3C_HdrParityError - * @retval #kStatus_I3C_CrcError - * @retval #kStatus_I3C_S0S1Error - * @retval #kStatus_I3C_ReadFifoError - * @retval #kStatus_I3C_WriteFifoError - */ -status_t I3C_SlaveCheckAndClearError(I3C_Type *base, uint32_t status) -{ - status_t result = kStatus_Success; - - /* Check for error. These errors cause a stop to automatically be sent. We must */ - /* clear the errors before a new transfer can start. */ - status &= (uint32_t)kSlaveErrorFlags; - -#if defined(I3C_DMA_IGNORE_FIFO_ERROR) - status &= ~((uint32_t)kI3C_SlaveErrorUnderrunFlag | (uint32_t)kI3C_SlaveErrorOverwriteFlag); - I3C_SlaveClearErrorStatusFlags(base, - ((uint32_t)kI3C_SlaveErrorUnderrunFlag | (uint32_t)kI3C_SlaveErrorOverwriteFlag)); -#endif - - if (0UL != status) - { - /* Select the correct error code. Ordered by severity, with bus issues first. */ - if (0UL != (status & (uint32_t)kI3C_SlaveErrorOverrunFlag)) - { - result = kStatus_I3C_OverrunError; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorUnderrunFlag)) - { - result = kStatus_I3C_UnderrunError; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorUnderrunNakFlag)) - { - result = kStatus_I3C_UnderrunNak; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorTermFlag)) - { - result = kStatus_I3C_Term; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorInvalidStartFlag)) - { - result = kStatus_I3C_InvalidStart; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorSdrParityFlag)) - { - result = kStatus_I3C_SdrParityError; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorHdrParityFlag)) - { - result = kStatus_I3C_HdrParityError; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorHdrCRCFlag)) - { - result = kStatus_I3C_CrcError; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorS0S1Flag)) - { - result = kStatus_I3C_S0S1Error; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorOverreadFlag)) - { - result = kStatus_I3C_ReadFifoError; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorOverwriteFlag)) - { - result = kStatus_I3C_WriteFifoError; - } - else - { - assert(false); - } - - /* Clear the flags. */ - I3C_SlaveClearErrorStatusFlags(base, status); - - /* Reset fifos. These flags clear automatically. */ - base->SDATACTRL |= I3C_SDATACTRL_FLUSHTB_MASK | I3C_SDATACTRL_FLUSHFB_MASK; - } - - return result; -} - -static status_t I3C_SlaveWaitForTxReady(I3C_Type *base) -{ - uint32_t errStatus; - status_t result; - size_t txCount; - size_t txFifoSize = - 2UL << ((base->SCAPABILITIES & I3C_SCAPABILITIES_FIFOTX_MASK) >> I3C_SCAPABILITIES_FIFOTX_SHIFT); - -#if I3C_RETRY_TIMES - uint32_t waitTimes = I3C_RETRY_TIMES; -#endif - do - { - /* Get the number of words in the tx fifo and compute empty slots. */ - I3C_SlaveGetFifoCounts(base, NULL, &txCount); - txCount = txFifoSize - txCount; - - /* Check for error flags. */ - errStatus = I3C_SlaveGetErrorStatusFlags(base); - result = I3C_SlaveCheckAndClearError(base, errStatus); - if (kStatus_Success != result) - { - return result; - } -#if I3C_RETRY_TIMES - } while ((txCount == 0UL) && (--waitTimes)); - - if (waitTimes == 0) - { - return kStatus_I3C_Timeout; - } -#else - } while (txCount == 0UL); -#endif - - return kStatus_Success; -} - -static status_t I3C_MasterEmitStop(I3C_Type *base, bool waitIdle) -{ - status_t result = kStatus_Success; - - /* Return an error if the bus is not in transaction. */ - if (I3C_MasterGetState(base) != kI3C_MasterStateNormAct) - { - return kStatus_I3C_InvalidReq; - } - - /* Send the STOP signal */ - base->MCTRL = (base->MCTRL & ~(I3C_MCTRL_REQUEST_MASK | I3C_MCTRL_DIR_MASK | I3C_MCTRL_RDTERM_MASK)) | - I3C_MCTRL_REQUEST(kI3C_RequestEmitStop); - - /* Wait for the stop operation finishes. */ - /* Also check for errors while waiting. */ - result = I3C_MasterWaitForCtrlDone(base, waitIdle); - - return result; -} - -/*! - * brief I3C master get IBI Type. - * - * param base The I3C peripheral base address. - * param i3c_ibi_type_t Type of #i3c_ibi_type_t. - */ -i3c_ibi_type_t I3C_GetIBIType(I3C_Type *base) -{ - uint32_t ibiValue = (base->MSTATUS & I3C_MSTATUS_IBITYPE_MASK) >> I3C_MSTATUS_IBITYPE_SHIFT; - i3c_ibi_type_t ibiType = kI3C_IbiNormal; - - switch (ibiValue) - { - case 3L: - ibiType = kI3C_IbiHotJoin; - break; - case 2L: - ibiType = kI3C_IbiMasterRequest; - break; - default: - ibiType = kI3C_IbiNormal; - break; - } - - return ibiType; -} - -/*! - * @brief Make sure the bus isn't already busy. - * - * A busy bus is allowed if we are the one driving it. - * - * @param base The I3C peripheral base address. - * @retval #kStatus_Success - * @retval #kStatus_I3C_Busy - */ -/* Not static so it can be used from fsl_i3c_edma.c. */ -status_t I3C_CheckForBusyBus(I3C_Type *base) -{ - return (I3C_MasterGetBusIdleState(base) == true) ? kStatus_Success : kStatus_I3C_Busy; -} - -/* brief Provides a default configuration for the I3C peripheral. - * - */ -void I3C_GetDefaultConfig(i3c_config_t *config) -{ - assert(NULL != config); - - (void)memset(config, 0, sizeof(*config)); - - config->enableMaster = kI3C_MasterCapable; - config->disableTimeout = false; - config->hKeep = kI3C_MasterHighKeeperNone; - config->enableOpenDrainStop = true; - config->enableOpenDrainHigh = true; - config->baudRate_Hz.i2cBaud = 400000U; - config->baudRate_Hz.i3cPushPullBaud = 12500000U; - config->baudRate_Hz.i3cOpenDrainBaud = 2500000U; - config->masterDynamicAddress = 0x0AU; /* Default master dynamic address. */ - config->slowClock_Hz = 1000000U; /* Default slow timer clock 1MHz. */ - config->enableSlave = true; - config->vendorID = 0x11BU; -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) - config->enableRandomPart = false; -#endif - config->partNumber = 0; - config->dcr = 0; /* Generic device. */ - config->bcr = 0; /* BCR[7:6]: device role, I3C slave(2b'00), BCR[5]: SDR Only / SDR and HDR Capable, SDR and HDR - Capable(1b'1), BCR[4]: Bridge Identifier, Not a bridge device(1b'0), BCR[3]: Offline Capable, - device is offline capable(1b'1), BCR[2]: IBI Payload, No data byte following(1b'0), BCR[1]: IBI - Request Capable, capable(1b'1), BCR[0]: Max Data Speed Limitation, has limitation(1b'1). */ - config->hdrMode = (uint8_t)kI3C_HDRModeDDR; - config->nakAllRequest = false; - config->ignoreS0S1Error = false; - config->offline = false; - config->matchSlaveStartStop = false; - config->maxWriteLength = 256U; - config->maxReadLength = 256U; -} - -/*! - * @brief Initializes the I3C peripheral. - * - */ -void I3C_Init(I3C_Type *base, const i3c_config_t *config, uint32_t sourceClock_Hz) -{ - uint32_t instance = I3C_GetInstance(base); - uint32_t configValue; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate the clock. */ - CLOCK_EnableClock(kI3cClocks[instance]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) - /* Reset the I3C module */ - RESET_PeripheralReset(kI3cResets[instance]); -#endif - - if ((config->masterDynamicAddress != 0U) && (config->enableMaster == kI3C_MasterOn)) - { - base->MDYNADDR &= ~I3C_MDYNADDR_DADDR_MASK; - base->MDYNADDR |= I3C_MDYNADDR_DADDR(config->masterDynamicAddress) | I3C_MDYNADDR_DAVALID_MASK; - } - - base->MCONFIG = I3C_MCONFIG_MSTENA(config->enableMaster) | I3C_MCONFIG_DISTO(config->disableTimeout) | - I3C_MCONFIG_HKEEP(config->hKeep) | I3C_MCONFIG_ODSTOP(config->enableOpenDrainStop) | - I3C_MCONFIG_ODHPP(config->enableOpenDrainHigh); - - I3C_MasterSetWatermarks(base, kI3C_TxTriggerUntilOneLessThanFull, kI3C_RxTriggerOnNotEmpty, true, true); - - I3C_MasterSetBaudRate(base, &config->baudRate_Hz, sourceClock_Hz); - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - uint8_t matchCount; - /* Caculate bus available condition match value for current slow clock, count value provides 1us.*/ - matchCount = (uint8_t)(config->slowClock_Hz / 1000000UL); -#endif - - configValue = base->SCONFIG; - - configValue &= - ~(I3C_SCONFIG_SADDR_MASK | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - I3C_SCONFIG_BAMATCH_MASK | -#endif - I3C_SCONFIG_OFFLINE_MASK | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) - I3C_SCONFIG_IDRAND_MASK | -#endif -#if defined(FSL_FEATURE_I3C_HAS_HDROK) && FSL_FEATURE_I3C_HAS_HDROK - I3C_SCONFIG_HDROK_MASK | -#else - I3C_SCONFIG_DDROK_MASK | -#endif - I3C_SCONFIG_S0IGNORE_MASK | I3C_SCONFIG_MATCHSS_MASK | I3C_SCONFIG_NACK_MASK | I3C_SCONFIG_SLVENA_MASK); - - configValue |= I3C_SCONFIG_SADDR(config->staticAddr) | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - I3C_SCONFIG_BAMATCH(matchCount) | -#endif - I3C_SCONFIG_OFFLINE(config->offline) | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) - I3C_SCONFIG_IDRAND(config->enableRandomPart) | -#endif -#if defined(FSL_FEATURE_I3C_HAS_HDROK) && FSL_FEATURE_I3C_HAS_HDROK - I3C_SCONFIG_HDROK((0U != (config->hdrMode & (uint8_t)kI3C_HDRModeDDR)) ? 1U : 0U) | -#else - I3C_SCONFIG_DDROK((0U != (config->hdrMode & (uint8_t)kI3C_HDRModeDDR)) ? 1U : 0U) | -#endif - I3C_SCONFIG_S0IGNORE(config->ignoreS0S1Error) | I3C_SCONFIG_MATCHSS(config->matchSlaveStartStop) | - I3C_SCONFIG_NACK(config->nakAllRequest) | I3C_SCONFIG_SLVENA(config->enableSlave); - - base->SVENDORID &= ~I3C_SVENDORID_VID_MASK; - base->SVENDORID |= I3C_SVENDORID_VID(config->vendorID); - -#if defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND - base->SIDPARTNO = config->partNumber; -#else - if (!config->enableRandomPart) - { - base->SIDPARTNO = config->partNumber; - } -#endif - - base->SIDEXT &= ~(I3C_SIDEXT_BCR_MASK | I3C_SIDEXT_DCR_MASK); - base->SIDEXT |= I3C_SIDEXT_BCR(config->bcr) | I3C_SIDEXT_DCR(config->dcr); - - base->SMAXLIMITS &= ~(I3C_SMAXLIMITS_MAXRD_MASK | I3C_SMAXLIMITS_MAXWR_MASK); - base->SMAXLIMITS |= (I3C_SMAXLIMITS_MAXRD(config->maxReadLength) | I3C_SMAXLIMITS_MAXWR(config->maxWriteLength)); - - base->SCONFIG = configValue; -} - -/*! - * brief Provides a default configuration for the I3C master peripheral. - * - * This function provides the following default configuration for the I3C master peripheral: - * code - * masterConfig->enableMaster = kI3C_MasterOn; - * masterConfig->disableTimeout = false; - * masterConfig->hKeep = kI3C_MasterHighKeeperNone; - * masterConfig->enableOpenDrainStop = true; - * masterConfig->enableOpenDrainHigh = true; - * masterConfig->baudRate_Hz = 100000U; - * masterConfig->busType = kI3C_TypeI2C; - * endcode - * - * After calling this function, you can override any settings in order to customize the configuration, - * prior to initializing the master driver with I3C_MasterInit(). - * - * param[out] masterConfig User provided configuration structure for default values. Refer to #i3c_master_config_t. - */ -void I3C_MasterGetDefaultConfig(i3c_master_config_t *masterConfig) -{ - masterConfig->enableMaster = kI3C_MasterOn; - masterConfig->disableTimeout = false; - masterConfig->hKeep = kI3C_MasterHighKeeperNone; - masterConfig->enableOpenDrainStop = true; - masterConfig->enableOpenDrainHigh = true; - masterConfig->baudRate_Hz.i2cBaud = 400000U; - masterConfig->baudRate_Hz.i3cPushPullBaud = 12500000U; - masterConfig->baudRate_Hz.i3cOpenDrainBaud = 2500000U; -} - -/*! - * brief Initializes the I3C master peripheral. - * - * This function enables the peripheral clock and initializes the I3C master peripheral as described by the user - * provided configuration. A software reset is performed prior to configuration. - * - * param base The I3C peripheral base address. - * param masterConfig User provided peripheral configuration. Use I3C_MasterGetDefaultConfig() to get a set of - * defaults that you can override. - * param sourceClock_Hz Frequency in Hertz of the I3C functional clock. Used to calculate the baud rate divisors, - * filter widths, and timeout periods. - */ -void I3C_MasterInit(I3C_Type *base, const i3c_master_config_t *masterConfig, uint32_t sourceClock_Hz) -{ - uint32_t instance = I3C_GetInstance(base); -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate the clock. */ - CLOCK_EnableClock(kI3cClocks[instance]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) - /* Reset the I3C module */ - RESET_PeripheralReset(kI3cResets[instance]); -#endif - base->MCONFIG = I3C_MCONFIG_MSTENA(masterConfig->enableMaster) | I3C_MCONFIG_DISTO(masterConfig->disableTimeout) | - I3C_MCONFIG_HKEEP(masterConfig->hKeep) | I3C_MCONFIG_ODSTOP(masterConfig->enableOpenDrainStop) | - I3C_MCONFIG_ODHPP(masterConfig->enableOpenDrainHigh); - - I3C_MasterSetWatermarks(base, kI3C_TxTriggerUntilOneLessThanFull, kI3C_RxTriggerOnNotEmpty, true, true); - - I3C_MasterSetBaudRate(base, &masterConfig->baudRate_Hz, sourceClock_Hz); -} - -/*! - * @brief Gets the I3C master state. - * - * @param base The I3C peripheral base address. - * @return I3C master state. - */ -i3c_master_state_t I3C_MasterGetState(I3C_Type *base) -{ - uint32_t masterState = (base->MSTATUS & I3C_MSTATUS_STATE_MASK) >> I3C_MSTATUS_STATE_SHIFT; - i3c_master_state_t returnCode; - - switch (masterState) - { - case (uint32_t)kI3C_MasterStateIdle: - returnCode = kI3C_MasterStateIdle; - break; - case (uint32_t)kI3C_MasterStateSlvReq: - returnCode = kI3C_MasterStateSlvReq; - break; - case (uint32_t)kI3C_MasterStateMsgSdr: - returnCode = kI3C_MasterStateMsgSdr; - break; - case (uint32_t)kI3C_MasterStateNormAct: - returnCode = kI3C_MasterStateNormAct; - break; - case (uint32_t)kI3C_MasterStateDdr: - returnCode = kI3C_MasterStateDdr; - break; - case (uint32_t)kI3C_MasterStateDaa: - returnCode = kI3C_MasterStateDaa; - break; - case (uint32_t)kI3C_MasterStateIbiAck: - returnCode = kI3C_MasterStateIbiAck; - break; - case (uint32_t)kI3C_MasterStateIbiRcv: - returnCode = kI3C_MasterStateIbiRcv; - break; - default: - returnCode = kI3C_MasterStateIdle; - break; - } - - return returnCode; -} - -/*! - * brief Deinitializes the I3C master peripheral. - * - * This function disables the I3C master peripheral and gates the clock. It also performs a software - * reset to restore the peripheral to reset conditions. - * - * param base The I3C peripheral base address. - */ -void I3C_MasterDeinit(I3C_Type *base) -{ - uint32_t idx = I3C_GetInstance(base); - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) - /* Reset the I3C module */ - RESET_PeripheralReset(kI3cResets[idx]); -#endif - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate clock. */ - CLOCK_DisableClock(kI3cClocks[idx]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Reset handle pointer. */ - s_i3cMasterHandle[idx] = NULL; -} - -static uint32_t I3C_CalcErrorRatio(uint32_t curFreq, uint32_t desiredFreq) -{ - if (curFreq > desiredFreq) - { - return (curFreq - desiredFreq) * 100UL / desiredFreq; - } - else - { - return (desiredFreq - curFreq) * 100UL / desiredFreq; - } -} - -/*! - * brief Sets the I3C bus frequency for master transactions. - * - * The I3C master is automatically disabled and re-enabled as necessary to configure the baud - * rate. Do not call this function during a transfer, or the transfer is aborted. - * - * param base The I3C peripheral base address. - * param baudRate_Hz Pointer to structure of requested bus frequency in Hertz. - * param sourceClock_Hz I3C functional clock frequency in Hertz. - */ -void I3C_MasterSetBaudRate(I3C_Type *base, const i3c_baudrate_hz_t *baudRate_Hz, uint32_t sourceClock_Hz) -{ - uint32_t div, freq; - uint32_t divEven, divOdd; - uint32_t ppBaud, odBaud, i2cBaud; - uint32_t errRate0, errRate1; - uint32_t i3cPPBaud_HZ = baudRate_Hz->i3cPushPullBaud; - uint32_t i3cPPBaudMax_HZ = i3cPPBaud_HZ / 10U + i3cPPBaud_HZ; /* max is 1.1*i3cPPBaud_HZ */ - uint32_t i3cODBaud_HZ = baudRate_Hz->i3cOpenDrainBaud; - uint32_t i3cODBaudMax_HZ = i3cODBaud_HZ / 10U + i3cODBaud_HZ; /* max is 1.1*i3cODBaud_HZ */ - uint32_t i2cBaud_HZ = baudRate_Hz->i2cBaud; - uint32_t i3cPPLow_Ns, i3cOdLow_Ns; - bool isODHigh = (0U != (base->MCONFIG & I3C_MCONFIG_ODHPP_MASK)) ? true : false; - - /* Find out the div to generate target freq */ - freq = sourceClock_Hz / 2UL; - /* ppFreq = FCLK / 2 / (PPBAUD + 1)), 0 <= PPBAUD <= 15 */ - /* We need PPBAUD generate 12.5MHz or so. */ - div = freq / i3cPPBaud_HZ; - div = (div == 0UL) ? 1UL : div; - if (freq / div > i3cPPBaudMax_HZ) - { - div++; - } - assert(div <= FSL_I3C_PPBAUD_DIV_MAX); - ppBaud = div - 1UL; - freq /= div; - - i3cPPLow_Ns = (uint32_t)(NSEC_PER_SEC / (2UL * freq)); - - /* We need ODBAUD generate 2.5MHz or so. */ - if (isODHigh) - { - /* odFreq = (2*freq) / (ODBAUD + 2), 1 <= ODBAUD <= 255 */ - div = (2UL * freq) / i3cODBaud_HZ; - div = div < 2UL ? 2UL : div; - if ((2UL * freq / div) > i3cODBaudMax_HZ) - { - div++; - } - odBaud = div - 2UL; - freq = (2UL * freq) / div; - } - else - { - /* odFreq = ppFreq / (ODBAUD + 1), 1 <= ODBAUD <= 255 */ - div = freq / i3cODBaud_HZ; - div = div < 1UL ? 1UL : div; - if (freq / div > i3cODBaudMax_HZ) - { - div++; - } - odBaud = div - 1UL; - freq /= div; - } - - i3cOdLow_Ns = (odBaud + 1UL) * i3cPPLow_Ns; - - /* i2cFreq = odFreq / (I2CBAUD + 1), 0 <= I2CBAUD <= 7 (I2CBAUD need << 1 in register) */ - /* i2cFreq = NSEC_PER_SEC / (I2CBAUD + 1)*i3cOdLow_Ns */ - divEven = (sourceClock_Hz / i2cBaud_HZ) / (2UL * (ppBaud + 1UL) * (odBaud + 1UL)); - divEven = divEven == 0UL ? 1UL : divEven; - errRate0 = I3C_CalcErrorRatio((uint32_t)(NSEC_PER_SEC / (2UL * divEven * i3cOdLow_Ns)), i2cBaud_HZ); - - divOdd = ((sourceClock_Hz / i2cBaud_HZ) / ((ppBaud + 1UL) * (odBaud + 1UL) - 1UL)) / 2UL; - divOdd = divOdd == 0UL ? 1UL : divOdd; - errRate1 = I3C_CalcErrorRatio((uint32_t)(NSEC_PER_SEC / ((2UL * divOdd + 1UL) * i3cOdLow_Ns)), i2cBaud_HZ); - - if (errRate0 < FSL_I3C_ERROR_RATE_MAX || errRate1 < FSL_I3C_ERROR_RATE_MAX) - { - /* Use this div */ - i2cBaud = errRate0 < errRate1 ? (divEven - 1UL) * 2UL : (divOdd - 1UL) * 2UL + 1UL; - } - else - { - /* Use div + 1, unless current freq is already lower than desired. */ - i2cBaud = freq / divEven < i2cBaud_HZ ? (divEven - 1UL) * 2UL : divEven * 2UL; - } - - base->MCONFIG = (base->MCONFIG & ~(I3C_MCONFIG_PPBAUD_MASK | I3C_MCONFIG_PPLOW_MASK | I3C_MCONFIG_ODBAUD_MASK | - I3C_MCONFIG_I2CBAUD_MASK)) | - I3C_MCONFIG_PPBAUD(ppBaud) | I3C_MCONFIG_ODBAUD(odBaud) | I3C_MCONFIG_I2CBAUD(i2cBaud); -} - -/*! - * brief Sends a START signal and slave address on the I2C/I3C bus, receive size is also specified - * in the call. - * This function is used to initiate a new master mode transfer. First, the bus state is checked to ensure - * that another master is not occupying the bus. Then a START signal is transmitted, followed by the - * 7-bit address specified in the a address parameter. Note that this function does not actually wait - * until the START and address are successfully sent on the bus before returning. - * - * param base The I3C peripheral base address. - * param type The bus type to use in this transaction. - * param address 7-bit slave device address, in bits [6:0]. - * param dir Master transfer direction, either #kI3C_Read or #kI3C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * param rxSize Read terminate size for the followed read transfer, limit to 255 bytes. - * retval #kStatus_Success START signal and address were successfully enqueued in the transmit FIFO. - * retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - */ -status_t I3C_MasterStartWithRxSize( - I3C_Type *base, i3c_bus_type_t type, uint8_t address, i3c_direction_t dir, uint8_t rxSize) -{ - i3c_master_state_t masterState = I3C_MasterGetState(base); - bool checkDdrState = (type == kI3C_TypeI3CDdr) ? (masterState != kI3C_MasterStateDdr) : true; - if ((masterState != kI3C_MasterStateIdle) && (masterState != kI3C_MasterStateNormAct) && checkDdrState) - { - return kStatus_I3C_Busy; - } - - return I3C_MasterRepeatedStartWithRxSize(base, type, address, dir, rxSize); -} - -/*! - * brief Sends a START signal and slave address on the I2C/I3C bus. - * - * This function is used to initiate a new master mode transfer. First, the bus state is checked to ensure - * that another master is not occupying the bus. Then a START signal is transmitted, followed by the - * 7-bit address specified in the a address parameter. Note that this function does not actually wait - * until the START and address are successfully sent on the bus before returning. - * - * param base The I3C peripheral base address. - * param type The bus type to use in this transaction. - * param address 7-bit slave device address, in bits [6:0]. - * param dir Master transfer direction, either #kI3C_Read or #kI3C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * retval #kStatus_Success START signal and address were successfully enqueued in the transmit FIFO. - * retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - */ -status_t I3C_MasterStart(I3C_Type *base, i3c_bus_type_t type, uint8_t address, i3c_direction_t dir) -{ - i3c_master_state_t masterState = I3C_MasterGetState(base); - bool checkDdrState = (type == kI3C_TypeI3CDdr) ? (masterState != kI3C_MasterStateDdr) : true; - if ((masterState != kI3C_MasterStateIdle) && (masterState != kI3C_MasterStateNormAct) && checkDdrState) - { - return kStatus_I3C_Busy; - } - - return I3C_MasterStartWithRxSize(base, type, address, dir, 0); -} - -/*! - * brief Sends a repeated START signal and slave address on the I2C/I3C bus, receive size is also specified - * in the call. - * - * This function is used to send a Repeated START signal when a transfer is already in progress. Like - * I3C_MasterStart(), it also sends the specified 7-bit address. Call this API also configures the read - * terminate size for the following read transfer. For example, set the rxSize = 2, the following read transfer - * will be terminated after two bytes of data received. Write transfer will not be affected by the rxSize - * configuration. - * - * note This function exists primarily to maintain compatible APIs between I3C and I2C drivers, - * as well as to better document the intent of code that uses these APIs. - * - * param base The I3C peripheral base address. - * param type The bus type to use in this transaction. - * param address 7-bit slave device address, in bits [6:0]. - * param dir Master transfer direction, either #kI3C_Read or #kI3C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * param rxSize Read terminate size for the followed read transfer, limit to 255 bytes. - * retval #kStatus_Success Repeated START signal and address were successfully enqueued in the transmit FIFO. - */ -status_t I3C_MasterRepeatedStartWithRxSize( - I3C_Type *base, i3c_bus_type_t type, uint8_t address, i3c_direction_t dir, uint8_t rxSize) -{ - uint32_t mctrlVal; - - /* Clear all flags. */ - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - -#if defined(FSL_FEATURE_I3C_HAS_ERRATA_051617) && (FSL_FEATURE_I3C_HAS_ERRATA_051617) - /* ERRATA051617: When used as I2C controller generates repeated START randomly before the STOP under PVT condition. - This issue is caused by a glitch at the output of an internal clock MUX. The glitch when generates acts as a clock - pulse which causes the SDA line to fall early during SCL high period and creates the unintended Repeated START before - actual STOP. */ - if (type == kI3C_TypeI2C) - { - base->MCONFIG |= I3C_MCONFIG_SKEW(1); - } - else - { - base->MCONFIG &= ~I3C_MCONFIG_SKEW_MASK; - } -#endif - - /* Issue start command. */ - mctrlVal = base->MCTRL; - mctrlVal &= ~(I3C_MCTRL_TYPE_MASK | I3C_MCTRL_REQUEST_MASK | I3C_MCTRL_DIR_MASK | I3C_MCTRL_ADDR_MASK | - I3C_MCTRL_RDTERM_MASK); - mctrlVal |= I3C_MCTRL_TYPE(type) | I3C_MCTRL_REQUEST(kI3C_RequestEmitStartAddr) | I3C_MCTRL_DIR(dir) | - I3C_MCTRL_ADDR(address) | I3C_MCTRL_RDTERM(rxSize); - - base->MCTRL = mctrlVal; - - return kStatus_Success; -} -/*! - * brief Sends a STOP signal on the I2C/I3C bus. - * - * This function does not return until the STOP signal is seen on the bus, or an error occurs. - * - * param base The I3C peripheral base address. - * retval #kStatus_Success The STOP signal was successfully sent on the bus and the transaction terminated. - * retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * retval #kStatus_I3C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_I3C_FifoError FIFO under run or overrun. - * retval #kStatus_I3C_ArbitrationLost Arbitration lost error. - * retval #kStatus_I3C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t I3C_MasterStop(I3C_Type *base) -{ - return I3C_MasterEmitStop(base, true); -} - -/*! - * brief I3C master emit request. - * - * param base The I3C peripheral base address. - * param masterReq I3C master request of type #i3c_bus_request_t - */ -void I3C_MasterEmitRequest(I3C_Type *base, i3c_bus_request_t masterReq) -{ - uint32_t mctrlReg = base->MCTRL; - - mctrlReg &= ~I3C_MCTRL_REQUEST_MASK; - - if (masterReq == kI3C_RequestProcessDAA) - { - mctrlReg &= ~I3C_MCTRL_TYPE_MASK; - } - - mctrlReg |= I3C_MCTRL_REQUEST(masterReq); - - base->MCTRL = mctrlReg; -} - -/*! - * brief I3C master register IBI rule. - * - * param base The I3C peripheral base address. - * param ibiRule Pointer to ibi rule description of type #i3c_register_ibi_addr_t - */ -void I3C_MasterRegisterIBI(I3C_Type *base, i3c_register_ibi_addr_t *ibiRule) -{ - assert(NULL != ibiRule); - uint32_t ruleValue = I3C_MIBIRULES_MSB0_MASK; - - for (uint32_t count = 0; count < ARRAY_SIZE(ibiRule->address); count++) - { - ruleValue |= ((uint32_t)ibiRule->address[count]) << (count * I3C_MIBIRULES_ADDR1_SHIFT); - } - - ruleValue &= ~I3C_MIBIRULES_NOBYTE_MASK; - - if (!ibiRule->ibiHasPayload) - { - ruleValue |= I3C_MIBIRULES_NOBYTE_MASK; - } - - base->MIBIRULES = ruleValue; -} - -/*! - * brief I3C master get IBI rule. - * - * param base The I3C peripheral base address. - * param ibiRule Pointer to store the read out ibi rule description. - */ -void I3C_MasterGetIBIRules(I3C_Type *base, i3c_register_ibi_addr_t *ibiRule) -{ - assert(NULL != ibiRule); - - uint32_t ruleValue = base->MIBIRULES; - - for (uint32_t count = 0; count < ARRAY_SIZE(ibiRule->address); count++) - { - ibiRule->address[count] = - (uint8_t)(ruleValue >> (count * I3C_MIBIRULES_ADDR1_SHIFT)) & I3C_MIBIRULES_ADDR0_MASK; - } - - ibiRule->ibiHasPayload = (0U == (ruleValue & I3C_MIBIRULES_NOBYTE_MASK)); -} - -/*! - * brief Performs a polling receive transfer on the I2C/I3C bus. - * - * param base The I3C peripheral base address. - * param rxBuff The pointer to the data to be transferred. - * param rxSize The length in bytes of the data to be transferred. - * param flags Bit mask of options for the transfer. See enumeration #_i3c_master_transfer_flags for available options. - * retval #kStatus_Success Data was received successfully. - * retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * retval #kStatus_I3C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_I3C_FifoError FIFO under run or overrun. - * retval #kStatus_I3C_ArbitrationLost Arbitration lost error. - * retval #kStatus_I3C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t I3C_MasterReceive(I3C_Type *base, void *rxBuff, size_t rxSize, uint32_t flags) -{ - status_t result = kStatus_Success; - bool isRxAutoTerm = ((flags & (uint32_t)kI3C_TransferRxAutoTermFlag) != 0UL); - bool completed = false; - uint32_t status; - uint8_t *buf; - - assert(NULL != rxBuff); - - /* Handle empty read. */ - if (rxSize == 0UL) - { - return kStatus_Success; - } - -#if I3C_RETRY_TIMES - uint32_t waitTimes = I3C_RETRY_TIMES; -#endif - - /* Receive data */ - buf = (uint8_t *)rxBuff; - - while ((rxSize != 0UL) || !completed) - { -#if I3C_RETRY_TIMES - if (--waitTimes == 0) - { - return kStatus_I3C_Timeout; - } -#endif - /* Check for errors. */ - result = I3C_MasterCheckAndClearError(base, I3C_MasterGetErrorStatusFlags(base)); - if (kStatus_Success != result) - { - return result; - } - - /* Check complete flag */ - if (!completed) - { - status = I3C_MasterGetStatusFlags(base) & (uint32_t)kI3C_MasterCompleteFlag; - if (0UL != status) - { - completed = true; - /* Clear complete flag */ - I3C_MasterClearStatusFlags(base, (uint32_t)kI3C_MasterCompleteFlag); - /* Send stop if needed */ - if ((flags & (uint32_t)kI3C_TransferNoStopFlag) == 0UL) - { - if (I3C_MasterGetState(base) == kI3C_MasterStateDdr) - { - I3C_MasterEmitRequest(base, kI3C_RequestForceExit); - result = I3C_MasterWaitForCtrlDone(base, false); - } - else - { - result = I3C_MasterEmitStop(base, false); - } - if (kStatus_Success != result) - { - return result; - } - } - } - } - - /* Check RX data */ - if ((0UL != rxSize) && (0UL != (base->MDATACTRL & I3C_MDATACTRL_RXCOUNT_MASK))) - { - *buf++ = (uint8_t)(base->MRDATAB & I3C_MRDATAB_VALUE_MASK); - rxSize--; - if ((flags & (uint32_t)kI3C_TransferDisableRxTermFlag) == 0UL) - { - if ((!isRxAutoTerm) && (rxSize == 1U)) - { - base->MCTRL |= I3C_MCTRL_RDTERM(1U); - } - } - } - } - - /* Wait idle if stop is sent. */ - if ((flags & (uint32_t)kI3C_TransferNoStopFlag) == 0UL) - { -#if I3C_RETRY_TIMES - while ((I3C_MasterGetState(base) != kI3C_MasterStateIdle) && --waitTimes) -#else - while (I3C_MasterGetState(base) != kI3C_MasterStateIdle) -#endif - { - } - } - return result; -} - -/*! - * brief Performs a polling send transfer on the I2C/I3C bus. - * - * Sends up to a txSize number of bytes to the previously addressed slave device. The slave may - * reply with a NAK to any byte in order to terminate the transfer early. If this happens, this - * function returns #kStatus_I3C_Nak. - * - * param base The I3C peripheral base address. - * param txBuff The pointer to the data to be transferred. - * param txSize The length in bytes of the data to be transferred. - * param flags Bit mask of options for the transfer. See enumeration #_i3c_master_transfer_flags for available options. - * retval #kStatus_Success Data was sent successfully. - * retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * retval #kStatus_I3C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_I3C_FifoError FIFO under run or over run. - * retval #kStatus_I3C_ArbitrationLost Arbitration lost error. - * retval #kStatus_I3C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t I3C_MasterSend(I3C_Type *base, const void *txBuff, size_t txSize, uint32_t flags) -{ - i3c_puint8_to_u32_t buf; - buf.cpuint8 = (const uint8_t *)((const void *)txBuff); - status_t result = kStatus_Success; - bool enableWord = ((flags & (uint32_t)kI3C_TransferWordsFlag) == (uint32_t)kI3C_TransferWordsFlag) ? true : false; - uint8_t byteCounts = enableWord ? 2U : 1U; - - assert(NULL != txBuff); - if (enableWord) - { - assert(txSize % 2UL == 0UL); - } - - /* Send data buffer */ - while (0UL != txSize) - { - /* Wait until there is room in the fifo. This also checks for errors. */ - result = I3C_MasterWaitForTxReady(base, byteCounts); - if (kStatus_Success != result) - { - return result; - } - - /* Write byte into I3C master data register. */ - if (txSize > byteCounts) - { - if (enableWord) - { - base->MWDATAH = (uint32_t)buf.cpuint8[1] << 8UL | (uint32_t)buf.cpuint8[0]; - } - else - { - base->MWDATAB = *buf.cpuint8; - } - } - else - { - if (enableWord) - { - base->MWDATAHE = (uint32_t)buf.cpuint8[1] << 8UL | (uint32_t)buf.cpuint8[0]; - } - else - { - base->MWDATABE = *buf.cpuint8; - } - } - - buf.u32 = buf.u32 + byteCounts; - txSize = txSize - byteCounts; - } - - result = I3C_MasterWaitForComplete(base, false); - if ((result == kStatus_Success) && ((flags & (uint32_t)kI3C_TransferNoStopFlag) == 0UL)) - { - if (I3C_MasterGetState(base) == kI3C_MasterStateDdr) - { - I3C_MasterEmitRequest(base, kI3C_RequestForceExit); - result = I3C_MasterWaitForCtrlDone(base, false); - } - else - { - result = I3C_MasterEmitStop(base, true); - } - } - - return result; -} - -/*! - * brief Performs a DAA in the i3c bus with specified temporary baud rate. - * - * param base The I3C peripheral base address. - * param addressList The pointer for address list which is used to do DAA. - * param count The address count in the address list. - * param daaBaudRate The temporary baud rate in DAA process, NULL for using initial setting. - * The initial setting is set back between the completion of the DAA and the return of this function. - * retval #kStatus_Success The transaction was started successfully. - * retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - * retval #kStatus_I3C_SlaveCountExceed The I3C slave count has exceed the definition in I3C_MAX_DEVCNT. - */ -status_t I3C_MasterProcessDAASpecifiedBaudrate(I3C_Type *base, - uint8_t *addressList, - uint32_t count, - i3c_master_daa_baudrate_t *daaBaudRate) -{ - assert(addressList != NULL); - assert(count != 0U); - - status_t result = kStatus_Success; - uint8_t rxBuffer[8] = {0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU}; - uint32_t masterConfig = 0; - uint32_t devCount = 0; - uint8_t rxSize = 0; - bool mctrlDone = false; - i3c_baudrate_hz_t baudRate_Hz; - uint32_t errStatus; - uint32_t status; - size_t rxCount; - - /* Return an error if the bus is already in use not by us. */ - result = I3C_CheckForBusyBus(base); - if (kStatus_Success != result) - { - return result; - } - - /* Clear all flags. */ - I3C_MasterClearErrorStatusFlags(base, (uint32_t)kMasterErrorFlags); - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - - /* Disable I3C IRQ sources while we configure stuff. */ - uint32_t enabledInts = I3C_MasterGetEnabledInterrupts(base); - I3C_MasterDisableInterrupts(base, enabledInts); - - /* Temporarily adjust baud rate before DAA. */ - if (daaBaudRate != NULL) - { - masterConfig = base->MCONFIG; - /* Set non-zero value for I2C baud rate which is useless here. */ - baudRate_Hz.i2cBaud = 1; - baudRate_Hz.i3cOpenDrainBaud = daaBaudRate->i3cOpenDrainBaud; - baudRate_Hz.i3cPushPullBaud = daaBaudRate->i3cPushPullBaud; - I3C_MasterSetBaudRate(base, &baudRate_Hz, daaBaudRate->sourceClock_Hz); - } - - /* Emit process DAA */ - I3C_MasterEmitRequest(base, kI3C_RequestProcessDAA); - - do - { - status = I3C_MasterGetStatusFlags(base); - - /* Check for error flags. */ - errStatus = I3C_MasterGetErrorStatusFlags(base); - result = I3C_MasterCheckAndClearError(base, errStatus); - if (kStatus_Success != result) - { - break; - } - - if ((!mctrlDone) || (rxSize < 8U)) - { - I3C_MasterGetFifoCounts(base, &rxCount, NULL); - - if ((0UL != (status & (uint32_t)kI3C_MasterRxReadyFlag)) && (rxCount != 0U)) - { - rxBuffer[rxSize++] = (uint8_t)(base->MRDATAB & I3C_MRDATAB_VALUE_MASK); - } - - if ((status & (uint32_t)kI3C_MasterControlDoneFlag) != 0U) - { - I3C_MasterClearStatusFlags(base, (uint32_t)kI3C_MasterControlDoneFlag); - mctrlDone = true; - } - } - else if ((I3C_MasterGetState(base) == kI3C_MasterStateDaa) && - (0UL != (I3C_MasterGetStatusFlags(base) & (uint32_t)kI3C_MasterBetweenFlag))) - { - if (((devCount + 1UL) > count) || ((devCount + 1UL) > I3C_MAX_DEVCNT)) - { - result = kStatus_I3C_SlaveCountExceed; - break; - } - - /* Assign the dynamic address from address list. */ - devList[devCount].dynamicAddr = *addressList++; - base->MWDATAB = devList[devCount].dynamicAddr; - - /* Emit process DAA again. */ - I3C_MasterEmitRequest(base, kI3C_RequestProcessDAA); - - devList[devCount].vendorID = (((uint16_t)rxBuffer[0] << 8U | (uint16_t)rxBuffer[1]) & 0xFFFEU) >> 1U; - devList[devCount].partNumber = ((uint32_t)rxBuffer[2] << 24U | (uint32_t)rxBuffer[3] << 16U | - (uint32_t)rxBuffer[4] << 8U | (uint32_t)rxBuffer[5]); - devList[devCount].bcr = rxBuffer[6]; - devList[devCount].dcr = rxBuffer[7]; - devCount++; - usedDevCount++; - - /* Ready to handle next device. */ - mctrlDone = false; - rxSize = 0; - } - else - { - /* Intentional empty */ - } - } while ((status & (uint32_t)kI3C_MasterCompleteFlag) != (uint32_t)kI3C_MasterCompleteFlag); - - /* Master stops DAA if slave device number exceeds the prepared address number. */ - if (result == kStatus_I3C_SlaveCountExceed) - { - /* Send the STOP signal */ - base->MCTRL = (base->MCTRL & ~(I3C_MCTRL_REQUEST_MASK | I3C_MCTRL_DIR_MASK | I3C_MCTRL_RDTERM_MASK)) | - I3C_MCTRL_REQUEST(kI3C_RequestEmitStop); - } - - /* Set back initial baud rate after DAA is over. */ - if (daaBaudRate != NULL) - { - base->MCONFIG = masterConfig; - } - - /* Clear all flags. */ - I3C_MasterClearErrorStatusFlags(base, (uint32_t)kMasterErrorFlags); - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - - /* Enable I3C IRQ sources while we configure stuff. */ - I3C_MasterEnableInterrupts(base, enabledInts); - - return result; -} - -/*! - * brief Get device information list after DAA process is done. - * - * param base The I3C peripheral base address. - * param[out] count The pointer to store the available device count. - * return Pointer to the i3c_device_info_t array. - */ -i3c_device_info_t *I3C_MasterGetDeviceListAfterDAA(I3C_Type *base, uint8_t *count) -{ - assert(NULL != count); - - *count = usedDevCount; - - return devList; -} - -/*! - * @brief introduce function I3C_MasterClearFlagsAndEnableIRQ. - * - * This function was used of Clear all flags and Enable I3C IRQ sources for @param *base. - * - * @param base The I3C peripheral base address. - */ -static void I3C_MasterClearFlagsAndEnableIRQ(I3C_Type *base) -{ - /* Clear all flags. */ - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - /* Enable I3C IRQ sources. */ - I3C_MasterEnableInterrupts(base, (uint32_t)kMasterIrqFlags); -} - -/*! - * @brief introduce function I3C_MasterTransferNoStartFlag. - * - * This function was used of Check if device request wins arbitration. - * - * @param base The I3C peripheral base address. - * @param transfer Pointer to the transfer structure. - * @retval #true if the device wins arbitration. - * @retval #false if the device not wins arbitration. - */ -static bool I3C_MasterTransferNoStartFlag(I3C_Type *base, i3c_master_transfer_t *transfer) -{ - /* Wait tx fifo empty. */ - size_t txCount = 0xFFUL; - - while (txCount != 0U) - { - I3C_MasterGetFifoCounts(base, NULL, &txCount); - } - - /* Check if device request wins arbitration. */ - if (0UL != (I3C_MasterGetStatusFlags(base) & (uint32_t)kI3C_MasterArbitrationWonFlag)) - { - I3C_MasterClearFlagsAndEnableIRQ(base); - return true; - } - return false; -} - -/*! - * brief Performs a master polling transfer on the I2C/I3C bus. - * - * note The API does not return until the transfer succeeds or fails due - * to error happens during transfer. - * - * param base The I3C peripheral base address. - * param transfer Pointer to the transfer structure. - * retval #kStatus_Success Data was received successfully. - * retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * retval #kStatus_I3C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_I3C_FifoError FIFO under run or overrun. - * retval #kStatus_I3C_ArbitrationLost Arbitration lost error. - * retval #kStatus_I3C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t I3C_MasterTransferBlocking(I3C_Type *base, i3c_master_transfer_t *transfer) -{ - assert(NULL != transfer); - assert(transfer->subaddressSize <= sizeof(transfer->subaddress)); - - status_t result = kStatus_Success; - i3c_direction_t direction = transfer->direction; - i3c_master_state_t masterState = I3C_MasterGetState(base); - bool checkDdrState = false; - i3c_rx_term_ops_t rxTermOps; - - /* Return an error if the bus is already in use not by us. */ - checkDdrState = (transfer->busType == kI3C_TypeI3CDdr) ? (masterState != kI3C_MasterStateDdr) : true; - - if ((masterState != kI3C_MasterStateIdle) && (masterState != kI3C_MasterStateNormAct) && checkDdrState) - { - return kStatus_I3C_Busy; - } - - /* Clear all flags. */ - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - /* Reset fifos. These flags clear automatically. */ - base->MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - - /* Disable I3C IRQ sources while we configure stuff. */ - I3C_MasterDisableInterrupts(base, (uint32_t)kMasterIrqFlags); - - if (transfer->busType != kI3C_TypeI3CDdr) - { - direction = (0UL != transfer->subaddressSize) ? kI3C_Write : transfer->direction; - } - - /* True: Set Rx termination bytes at start point, False: Set Rx termination one bytes in advance. */ - if ((transfer->flags & (uint32_t)kI3C_TransferDisableRxTermFlag) != 0U) - { - rxTermOps = kI3C_RxTermDisable; - } - else if (transfer->dataSize <= 255U) - { - rxTermOps = kI3C_RxAutoTerm; - } - else - { - rxTermOps = kI3C_RxTermLastByte; - } - - if (0UL != (transfer->flags & (uint32_t)kI3C_TransferStartWithBroadcastAddr)) - { - if (0UL != (transfer->flags & (uint32_t)kI3C_TransferNoStartFlag)) - { - return kStatus_InvalidArgument; - } - - if (0UL != (transfer->flags & (uint32_t)kI3C_TransferRepeatedStartFlag)) - { - return kStatus_InvalidArgument; - } - - /* Issue 0x7E as start. */ - result = I3C_MasterStart(base, transfer->busType, 0x7E, kI3C_Write); - if (result != kStatus_Success) - { - return result; - } - - result = I3C_MasterWaitForCtrlDone(base, false); - if (result != kStatus_Success) - { - return result; - } - } - - if (0UL == (transfer->flags & (uint32_t)kI3C_TransferNoStartFlag)) - { - if ((direction == kI3C_Read) && (rxTermOps == kI3C_RxAutoTerm)) - { - result = I3C_MasterStartWithRxSize(base, transfer->busType, transfer->slaveAddress, direction, - (uint8_t)transfer->dataSize); - } - else - { - result = I3C_MasterStart(base, transfer->busType, transfer->slaveAddress, direction); - } - if (result != kStatus_Success) - { - return result; - } - - result = I3C_MasterWaitForCtrlDone(base, false); - if (result != kStatus_Success) - { - return result; - } - - if (true == I3C_MasterTransferNoStartFlag(base, transfer)) - { - return kStatus_I3C_IBIWon; - } - } - else - { - if ((direction == kI3C_Read) && (rxTermOps != kI3C_RxTermDisable)) - { - /* Can't set Rx termination more than one bytes in advance without START. */ - rxTermOps = kI3C_RxTermLastByte; - } - } - - /* Subaddress, MSB first. */ - if (0U != transfer->subaddressSize) - { - uint32_t subaddressRemaining = transfer->subaddressSize; - while (0UL != subaddressRemaining--) - { - uint8_t subaddressByte = (uint8_t)((transfer->subaddress >> (8UL * subaddressRemaining)) & 0xFFUL); - - result = I3C_MasterWaitForTxReady(base, 1U); - - if ((0UL == subaddressRemaining) && ((transfer->direction == kI3C_Read) || (0UL == transfer->dataSize)) && - (transfer->busType != kI3C_TypeI3CDdr)) - { - base->MWDATABE = subaddressByte; - result = I3C_MasterWaitForComplete(base, false); - if (kStatus_Success != result) - { - if (result == kStatus_I3C_Nak) - { - (void)I3C_MasterEmitStop(base, true); - } - I3C_MasterClearFlagsAndEnableIRQ(base); - return result; - } - } - else - { - base->MWDATAB = subaddressByte; - } - } - /* Need to send repeated start if switching directions to read. */ - if ((transfer->busType != kI3C_TypeI3CDdr) && (0UL != transfer->dataSize) && (transfer->direction == kI3C_Read)) - { - if (rxTermOps == kI3C_RxAutoTerm) - { - result = I3C_MasterRepeatedStartWithRxSize(base, transfer->busType, transfer->slaveAddress, kI3C_Read, - (uint8_t)transfer->dataSize); - } - else - { - result = I3C_MasterRepeatedStart(base, transfer->busType, transfer->slaveAddress, kI3C_Read); - } - - if (kStatus_Success != result) - { - I3C_MasterClearFlagsAndEnableIRQ(base); - return result; - } - - result = I3C_MasterWaitForCtrlDone(base, false); - if (result != kStatus_Success) - { - return result; - } - } - } - - if (rxTermOps == kI3C_RxAutoTerm) - { - transfer->flags |= (uint32_t)kI3C_TransferRxAutoTermFlag; - } - else - { - transfer->flags &= ~(uint32_t)kI3C_TransferRxAutoTermFlag; - } - - /* Transmit data. */ - if ((transfer->direction == kI3C_Write) && (transfer->dataSize > 0UL)) - { - /* Send Data. */ - result = I3C_MasterSend(base, transfer->data, transfer->dataSize, transfer->flags); - } - /* Receive Data. */ - else if ((transfer->direction == kI3C_Read) && (transfer->dataSize > 0UL)) - { - result = I3C_MasterReceive(base, transfer->data, transfer->dataSize, transfer->flags); - } - else - { - if ((transfer->flags & (uint32_t)kI3C_TransferNoStopFlag) == 0UL) - { - result = I3C_MasterEmitStop(base, true); - } - } - - if (result == kStatus_I3C_Nak) - { - (void)I3C_MasterEmitStop(base, true); - } - - I3C_MasterClearFlagsAndEnableIRQ(base); - - return result; -} - -/*! - * brief Creates a new handle for the I3C master non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the I3C_MasterTransferAbort() API shall be called. - * - * - * note The function also enables the NVIC IRQ for the input I3C. Need to notice - * that on some SoCs the I3C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - * - * param base The I3C peripheral base address. - * param[out] handle Pointer to the I3C master driver handle. - * param callback User provided pointer to the asynchronous callback function. - * param userData User provided pointer to the application callback data. - */ -void I3C_MasterTransferCreateHandle(I3C_Type *base, - i3c_master_handle_t *handle, - const i3c_master_transfer_callback_t *callback, - void *userData) -{ - uint32_t instance; - - assert(NULL != handle); - - /* Clear out the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Look up instance number */ - instance = I3C_GetInstance(base); - - /* Save base and instance. */ - handle->callback = *callback; - handle->userData = userData; - - /* Save this handle for IRQ use. */ - s_i3cMasterHandle[instance] = handle; - - /* Set irq handler. */ - s_i3cMasterIsr = I3C_MasterTransferHandleIRQ; - - /* Clear all flags. */ - I3C_MasterClearErrorStatusFlags(base, (uint32_t)kMasterErrorFlags); - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - /* Reset fifos. These flags clear automatically. */ - base->MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - - /* Enable NVIC IRQ, this only enables the IRQ directly connected to the NVIC. - In some cases the I3C IRQ is configured through INTMUX, user needs to enable - INTMUX IRQ in application code. */ - (void)EnableIRQ(kI3cIrqs[instance]); - - /* Clear internal IRQ enables and enable NVIC IRQ. */ - I3C_MasterEnableInterrupts(base, (uint32_t)kMasterIrqFlags); -} - -static void I3C_TransferStateMachineIBIWonState(I3C_Type *base, - i3c_master_handle_t *handle, - i3c_master_state_machine_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - if (stateParams->masterState == kI3C_MasterStateIbiAck) - { - handle->ibiType = I3C_GetIBIType(base); - if (handle->callback.ibiCallback != NULL) - { - handle->callback.ibiCallback(base, handle, handle->ibiType, kI3C_IbiAckNackPending); - } - else - { - I3C_MasterEmitIBIResponse(base, kI3C_IbiRespNack); - } - } - - /* Make sure there is data in the rx fifo. */ - if (0UL != stateParams->rxCount) - { - if ((handle->ibiBuff == NULL) && (handle->callback.ibiCallback != NULL)) - { - handle->callback.ibiCallback(base, handle, kI3C_IbiNormal, kI3C_IbiDataBuffNeed); - } - uint8_t tempData = (uint8_t)base->MRDATAB; - if (handle->ibiBuff != NULL) - { - handle->ibiBuff[handle->ibiPayloadSize++] = tempData; - } - (stateParams->rxCount)--; - return; - } - else if (0UL != (stateParams->status & (uint32_t)kI3C_MasterCompleteFlag)) - { - handle->ibiType = I3C_GetIBIType(base); - handle->ibiAddress = I3C_GetIBIAddress(base); - stateParams->state_complete = true; - stateParams->result = kStatus_I3C_IBIWon; - } - else - { - stateParams->state_complete = true; - } -} - -static void I3C_TransferStateMachineSendCommandState(I3C_Type *base, - i3c_master_handle_t *handle, - i3c_master_state_machine_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - I3C_MasterEnableInterrupts(base, (uint32_t)kI3C_MasterTxReadyFlag); - /* Make sure there is room in the tx fifo for the next command. */ - if (0UL == (stateParams->txCount)--) - { - stateParams->state_complete = true; - return; - } - if (handle->transfer.subaddressSize > 1U) - { - handle->transfer.subaddressSize--; - base->MWDATAB = (uint8_t)((handle->transfer.subaddress) >> (8U * handle->transfer.subaddressSize)); - } - else if (handle->transfer.subaddressSize == 1U) - { - handle->transfer.subaddressSize--; - - if ((handle->transfer.direction == kI3C_Read) || (0UL == handle->transfer.dataSize)) - { - base->MWDATABE = (uint8_t)((handle->transfer.subaddress) >> (8U * handle->transfer.subaddressSize)); - - if (handle->transfer.busType != kI3C_TypeI3CDdr) - { - if (0UL == handle->transfer.dataSize) - { - handle->state = (uint8_t)kWaitForCompletionState; - } - else - { - /* xfer->dataSize != 0U, xfer->direction = kI3C_Read */ - handle->state = (uint8_t)kWaitRepeatedStartCompleteState; - } - } - else - { - handle->state = (uint8_t)kTransferDataState; - } - } - else - { - /* Next state, transfer data. */ - handle->state = (uint8_t)kTransferDataState; - base->MWDATAB = (uint8_t)((handle->transfer.subaddress) >> (8U * handle->transfer.subaddressSize)); - } - } - else - { - /* Eliminate misra 15.7*/ - } -} - -static void I3C_TransferStateMachineWaitRepeatedStartCompleteState(I3C_Type *base, - i3c_master_handle_t *handle, - i3c_master_state_machine_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - /* We stay in this state until the master complete. */ - if (0UL != (stateParams->status & (uint32_t)kI3C_MasterCompleteFlag)) - { - handle->state = (uint8_t)kTransferDataState; - I3C_MasterDisableInterrupts(base, (uint32_t)kI3C_MasterTxReadyFlag); - - if (handle->remainingBytes < 256U) - { - handle->rxTermOps = (handle->rxTermOps == kI3C_RxTermDisable) ? handle->rxTermOps : kI3C_RxAutoTerm; - stateParams->result = - I3C_MasterRepeatedStartWithRxSize(base, handle->transfer.busType, handle->transfer.slaveAddress, - kI3C_Read, (uint8_t)handle->remainingBytes); - } - else - { - stateParams->result = - I3C_MasterRepeatedStart(base, handle->transfer.busType, handle->transfer.slaveAddress, kI3C_Read); - } - } - - stateParams->state_complete = true; -} - -static void I3C_TransferStateMachineTransferDataState(I3C_Type *base, - i3c_master_handle_t *handle, - i3c_master_state_machine_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - - i3c_puint8_to_u32_t dataBuff; - if (handle->transfer.direction == kI3C_Write) - { - /* Make sure there is room in the tx fifo. */ - if (0UL == (stateParams->txCount)--) - { - stateParams->state_complete = true; - return; - } - - /* Put byte to send in fifo. */ - dataBuff.puint8 = (uint8_t *)handle->transfer.data; - if (handle->transfer.dataSize > 1U) - { - base->MWDATAB = *dataBuff.puint8; - } - else - { - base->MWDATABE = *dataBuff.puint8; - } - dataBuff.u32 = dataBuff.u32 + 1U; - (handle->transfer.dataSize)--; - handle->transfer.data = (void *)(dataBuff.puint8); - - /* Move to stop when the transfer is done. */ - if (--handle->remainingBytes == 0UL) - { - handle->state = (uint8_t)kWaitForCompletionState; - } - } - else - { - /* Make sure there is data in the rx fifo. */ - if (0UL == (stateParams->rxCount)--) - { - stateParams->state_complete = true; - return; - } - - /* Read byte from fifo. */ - dataBuff.puint8 = (uint8_t *)handle->transfer.data; - *dataBuff.puint8 = (uint8_t)base->MRDATAB; - dataBuff.u32 = dataBuff.u32 + 1U; - handle->transfer.data = (void *)(dataBuff.puint8); - - /* Move to stop when the transfer is done. */ - if (--handle->remainingBytes == 0UL) - { - handle->state = (uint8_t)kWaitForCompletionState; - } - - if ((handle->rxTermOps == kI3C_RxTermLastByte) && (handle->remainingBytes == 1UL)) - { - base->MCTRL |= I3C_MCTRL_RDTERM(1UL); - } - } -} - -static void I3C_TransferStateMachineWaitForCompletionState(i3c_master_handle_t *handle, - i3c_master_state_machine_param_t *stateParams) -{ - /* We stay in this state until the maste complete. */ - if (0UL != (stateParams->status & (uint32_t)kI3C_MasterCompleteFlag)) - { - handle->state = (uint8_t)kStopState; - } - else - { - stateParams->state_complete = true; - } -} - -static void I3C_TransferStateMachineStopState(I3C_Type *base, - i3c_master_handle_t *handle, - i3c_master_state_machine_param_t *stateParams) -{ - /* Only issue a stop transition if the caller requested it. */ - if (0UL == (handle->transfer.flags & (uint32_t)kI3C_TransferNoStopFlag)) - { - /* Make sure there is room in the tx fifo for the stop command. */ - if (0UL == (stateParams->txCount)--) - { - stateParams->state_complete = true; - return; - } - if (handle->transfer.busType == kI3C_TypeI3CDdr) - { - I3C_MasterEmitRequest(base, kI3C_RequestForceExit); - } - else - { - (void)I3C_MasterEmitStop(base, false); - } - } - stateParams->state_complete = true; -} - -static status_t I3C_RunTransferStateMachine(I3C_Type *base, i3c_master_handle_t *handle, bool *isDone) -{ - i3c_master_state_machine_param_t stateParams; - (void)memset(&stateParams, 0, sizeof(stateParams)); - - stateParams.result = kStatus_Success; - stateParams.state_complete = false; - - /* Set default isDone return value. */ - *isDone = false; - - uint32_t errStatus; - size_t txFifoSize = - 2UL << ((base->SCAPABILITIES & I3C_SCAPABILITIES_FIFOTX_MASK) >> I3C_SCAPABILITIES_FIFOTX_SHIFT); - - /* Check for errors. */ - stateParams.status = (uint32_t)I3C_MasterGetPendingInterrupts(base); - I3C_MasterClearStatusFlags(base, stateParams.status); - - stateParams.masterState = I3C_MasterGetState(base); - errStatus = I3C_MasterGetErrorStatusFlags(base); - stateParams.result = I3C_MasterCheckAndClearError(base, errStatus); - if (kStatus_Success != stateParams.result) - { - return stateParams.result; - } - - if (0UL != (stateParams.status & (uint32_t)kI3C_MasterSlave2MasterFlag)) - { - if (handle->callback.slave2Master != NULL) - { - handle->callback.slave2Master(base, handle->userData); - } - } - - if ((0UL != (stateParams.status & (uint32_t)kI3C_MasterSlaveStartFlag)) && - (handle->transfer.busType != kI3C_TypeI2C)) - { - handle->state = (uint8_t)kSlaveStartState; - } - - if ((stateParams.masterState == kI3C_MasterStateIbiRcv) || (stateParams.masterState == kI3C_MasterStateIbiAck)) - { - handle->state = (uint8_t)kIBIWonState; - } - - if (handle->state == (uint8_t)kIdleState) - { - return stateParams.result; - } - - /* Get fifo counts and compute room in tx fifo. */ - I3C_MasterGetFifoCounts(base, &stateParams.rxCount, &stateParams.txCount); - stateParams.txCount = txFifoSize - stateParams.txCount; - - while (!stateParams.state_complete) - { - /* Execute the state. */ - switch (handle->state) - { - case (uint8_t)kSlaveStartState: - /* Emit start + 0x7E */ - I3C_MasterEmitRequest(base, kI3C_RequestAutoIbi); - handle->state = (uint8_t)kIBIWonState; - stateParams.state_complete = true; - break; - - case (uint8_t)kIBIWonState: - I3C_TransferStateMachineIBIWonState(base, handle, &stateParams); - break; - - case (uint8_t)kSendCommandState: - I3C_TransferStateMachineSendCommandState(base, handle, &stateParams); - break; - - case (uint8_t)kWaitRepeatedStartCompleteState: - I3C_TransferStateMachineWaitRepeatedStartCompleteState(base, handle, &stateParams); - break; - - case (uint8_t)kTransferDataState: - I3C_TransferStateMachineTransferDataState(base, handle, &stateParams); - break; - - case (uint8_t)kWaitForCompletionState: - I3C_TransferStateMachineWaitForCompletionState(handle, &stateParams); - break; - - case (uint8_t)kStopState: - I3C_TransferStateMachineStopState(base, handle, &stateParams); - *isDone = true; - break; - - default: - assert(false); - break; - } - } - return stateParams.result; -} - -static status_t I3C_InitTransferStateMachine(I3C_Type *base, i3c_master_handle_t *handle) -{ - i3c_master_transfer_t *xfer = &handle->transfer; - status_t result = kStatus_Success; - i3c_direction_t direction = xfer->direction; - - if (xfer->busType != kI3C_TypeI3CDdr) - { - direction = (0UL != xfer->subaddressSize) ? kI3C_Write : xfer->direction; - } - - if (0UL != (xfer->flags & (uint32_t)kI3C_TransferStartWithBroadcastAddr)) - { - if (0UL != (xfer->flags & (uint32_t)kI3C_TransferNoStartFlag)) - { - return kStatus_InvalidArgument; - } - - if (0UL != (xfer->flags & (uint32_t)kI3C_TransferRepeatedStartFlag)) - { - return kStatus_InvalidArgument; - } - - /* Issue 0x7E as start. */ - result = I3C_MasterStart(base, xfer->busType, 0x7E, kI3C_Write); - if (result != kStatus_Success) - { - return result; - } - - result = I3C_MasterWaitForCtrlDone(base, false); - if (result != kStatus_Success) - { - return result; - } - } - - /* Handle no start option. */ - if (0U != (xfer->flags & (uint32_t)kI3C_TransferNoStartFlag)) - { - /* No need to send start flag, directly go to send command or data */ - if (xfer->subaddressSize > 0UL) - { - handle->state = (uint8_t)kSendCommandState; - } - else - { - if (direction == kI3C_Write) - { - /* Next state, send data. */ - handle->state = (uint8_t)kTransferDataState; - } - else - { - /* Only support write with no stop signal. */ - return kStatus_InvalidArgument; - } - } - I3C_MasterTransferHandleIRQ(base, handle); - return result; - } - /* If repeated start is requested, send repeated start. */ - else if (0U != (xfer->flags & (uint32_t)kI3C_TransferRepeatedStartFlag)) - { - result = I3C_MasterRepeatedStart(base, xfer->busType, xfer->slaveAddress, direction); - } - else /* For normal transfer, send start. */ - { - result = I3C_MasterStart(base, xfer->busType, xfer->slaveAddress, direction); - } - - if (xfer->subaddressSize > 0U) - { - handle->state = (uint8_t)kSendCommandState; - } - else - { - handle->state = (uint8_t)kTransferDataState; - } - - if ((handle->remainingBytes < 256U) && (direction == kI3C_Read)) - { - handle->rxTermOps = (handle->rxTermOps == kI3C_RxTermDisable) ? handle->rxTermOps : kI3C_RxAutoTerm; - base->MCTRL |= I3C_MCTRL_RDTERM(handle->remainingBytes); - } - - return result; -} - -/*! - * brief Performs a non-blocking transaction on the I2C/I3C bus. - * - * param base The I3C peripheral base address. - * param handle Pointer to the I3C master driver handle. - * param transfer The pointer to the transfer descriptor. - * retval #kStatus_Success The transaction was started successfully. - * retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - */ -status_t I3C_MasterTransferNonBlocking(I3C_Type *base, i3c_master_handle_t *handle, i3c_master_transfer_t *transfer) -{ - assert(NULL != handle); - assert(NULL != transfer); - assert(transfer->subaddressSize <= sizeof(transfer->subaddress)); - i3c_master_state_t masterState = I3C_MasterGetState(base); - bool checkDdrState = false; - - /* Return busy if another transaction is in progress. */ - if (handle->state != (uint8_t)kIdleState) - { - return kStatus_I3C_Busy; - } - - /* Return an error if the bus is already in use not by us. */ - checkDdrState = (transfer->busType == kI3C_TypeI3CDdr) ? (masterState != kI3C_MasterStateDdr) : true; - if ((masterState != kI3C_MasterStateIdle) && (masterState != kI3C_MasterStateNormAct) && checkDdrState) - { - return kStatus_I3C_Busy; - } - - /* Disable I3C IRQ sources while we configure stuff. */ - I3C_MasterDisableInterrupts(base, (uint32_t)kMasterIrqFlags); - - /* Save transfer into handle. */ - handle->transfer = *transfer; - handle->remainingBytes = transfer->dataSize; - - /* Configure IBI response type. */ - base->MCTRL &= ~I3C_MCTRL_IBIRESP_MASK; - base->MCTRL |= I3C_MCTRL_IBIRESP(transfer->ibiResponse); - - /* Clear all flags. */ - I3C_MasterClearErrorStatusFlags(base, (uint32_t)kMasterErrorFlags); - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - /* Reset fifos. These flags clear automatically. */ - base->MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - - if ((transfer->flags & (uint32_t)kI3C_TransferDisableRxTermFlag) != 0U) - { - handle->rxTermOps = kI3C_RxTermDisable; - } - else if (transfer->dataSize <= 255U) - { - handle->rxTermOps = kI3C_RxAutoTerm; - } - else - { - handle->rxTermOps = kI3C_RxTermLastByte; - } - - /* Generate commands to send. */ - (void)I3C_InitTransferStateMachine(base, handle); - - /* Enable I3C internal IRQ sources. NVIC IRQ was enabled in CreateHandle() */ - I3C_MasterEnableInterrupts(base, (uint32_t)kMasterIrqFlags); - - if (transfer->direction == kI3C_Write) - { - I3C_MasterEnableInterrupts(base, (uint32_t)kI3C_MasterTxReadyFlag); - } - - return kStatus_Success; -} - -/*! - * brief Returns number of bytes transferred so far. - * param base The I3C peripheral base address. - * param handle Pointer to the I3C master driver handle. - * param[out] count Number of bytes transferred so far by the non-blocking transaction. - * retval #kStatus_Success - * retval #kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t I3C_MasterTransferGetCount(I3C_Type *base, i3c_master_handle_t *handle, size_t *count) -{ - assert(NULL != handle); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (handle->state == (uint8_t)kIdleState) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - uint8_t state; - uint32_t remainingBytes; - uint32_t dataSize; - - /* Cache some fields with IRQs disabled. This ensures all field values */ - /* are synchronized with each other during an ongoing transfer. */ - uint32_t irqs = I3C_MasterGetEnabledInterrupts(base); - I3C_MasterDisableInterrupts(base, irqs); - state = handle->state; - remainingBytes = handle->remainingBytes; - dataSize = handle->transfer.dataSize; - I3C_MasterEnableInterrupts(base, irqs); - - /* Get transfer count based on current transfer state. */ - switch (state) - { - case (uint8_t)kIdleState: - case (uint8_t)kSendCommandState: - *count = 0; - break; - - case (uint8_t)kTransferDataState: - *count = dataSize - remainingBytes; - break; - - case (uint8_t)kStopState: - case (uint8_t)kWaitForCompletionState: - default: - *count = dataSize; - break; - } - - return kStatus_Success; -} - -/*! - * brief Terminates a non-blocking I3C master transmission early. - * - * note It is not safe to call this function from an IRQ handler that has a higher priority than the - * I3C peripheral's IRQ priority. - * - * param base The I3C peripheral base address. - * param handle Pointer to the I3C master driver handle. - * retval #kStatus_Success A transaction was successfully aborted. - * retval #kStatus_I3C_Idle There is not a non-blocking transaction currently in progress. - */ -void I3C_MasterTransferAbort(I3C_Type *base, i3c_master_handle_t *handle) -{ - if (handle->state != (uint8_t)kIdleState) - { - /* Disable internal IRQ enables. */ - I3C_MasterDisableInterrupts(base, (uint32_t)kMasterIrqFlags); - - /* Reset fifos. These flags clear automatically. */ - base->MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - - /* Send a stop command to finalize the transfer. */ - (void)I3C_MasterStop(base); - - /* Reset handle. */ - handle->state = (uint8_t)kIdleState; - } -} - -/*! - * brief Reusable routine to handle master interrupts. - * note This function does not need to be called unless you are reimplementing the - * nonblocking API's interrupt handler routines to add special functionality. - * param base The I3C peripheral base address. - * param handle Pointer to the I3C master driver handle. - */ -void I3C_MasterTransferHandleIRQ(I3C_Type *base, void *intHandle) -{ - bool isDone; - status_t result; - - i3c_master_handle_t *handle = (i3c_master_handle_t *)intHandle; - /* Don't do anything if we don't have a valid handle. */ - if (NULL == handle) - { - return; - } - - result = I3C_RunTransferStateMachine(base, handle, &isDone); - - if (handle->state == (uint8_t)kIdleState) - { - I3C_MasterDisableInterrupts(base, (uint32_t)kI3C_MasterTxReadyFlag); - return; - } - - if (isDone || (result != kStatus_Success)) - { - /* XXX need to handle data that may be in rx fifo below watermark level? */ - - /* XXX handle error, terminate xfer */ - if ((result == kStatus_I3C_Nak) || (result == kStatus_I3C_IBIWon)) - { - (void)I3C_MasterEmitStop(base, false); - } - - /* Disable internal IRQ enables. */ - I3C_MasterDisableInterrupts(base, (uint32_t)kI3C_MasterTxReadyFlag); - - /* Set handle to idle state. */ - handle->state = (uint8_t)kIdleState; - - /* Invoke IBI user callback. */ - if ((result == kStatus_I3C_IBIWon) && (handle->callback.ibiCallback != NULL)) - { - handle->callback.ibiCallback(base, handle, handle->ibiType, kI3C_IbiReady); - handle->ibiPayloadSize = 0; - } - - /* Invoke callback. */ - if (NULL != handle->callback.transferComplete) - { - handle->callback.transferComplete(base, handle, result, handle->userData); - } - } -} - -/*! - * brief Provides a default configuration for the I3C slave peripheral. - * - * This function provides the following default configuration for the I3C slave peripheral: - * code - * slaveConfig->enableslave = true; - * endcode - * - * After calling this function, you can override any settings in order to customize the configuration, - * prior to initializing the slave driver with I3C_SlaveInit(). - * - * param[out] slaveConfig User provided configuration structure for default values. Refer to #i3c_slave_config_t. - */ -void I3C_SlaveGetDefaultConfig(i3c_slave_config_t *slaveConfig) -{ - assert(NULL != slaveConfig); - - (void)memset(slaveConfig, 0, sizeof(*slaveConfig)); - - slaveConfig->enableSlave = true; -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) && FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) - slaveConfig->isHotJoin = false; -#endif - slaveConfig->vendorID = 0x11BU; -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) - slaveConfig->enableRandomPart = false; -#endif - slaveConfig->partNumber = 0; - slaveConfig->dcr = 0; /* Generic device. */ - slaveConfig->bcr = - 0; /* BCR[7:6]: device role, I3C slave(2b'00), BCR[5]: SDR Only / SDR and HDR Capable, SDR and HDR - Capable(1b'1), BCR[4]: Bridge Identifier, Not a bridge device(1b'0), BCR[3]: Offline Capable, device is - offline capable(1b'1), BCR[2]: IBI Payload, No data byte following(1b'0), BCR[1]: IBI Request Capable, - capable(1b'1), BCR[0]: Max Data Speed Limitation, has limitation(1b'1). */ - slaveConfig->hdrMode = (uint8_t)kI3C_HDRModeDDR; - slaveConfig->nakAllRequest = false; - slaveConfig->ignoreS0S1Error = true; - slaveConfig->offline = false; - slaveConfig->matchSlaveStartStop = false; - slaveConfig->maxWriteLength = 256U; - slaveConfig->maxReadLength = 256U; -} - -/*! - * brief Initializes the I3C slave peripheral. - * - * This function enables the peripheral clock and initializes the I3C slave peripheral as described by the user - * provided configuration. - * - * param base The I3C peripheral base address. - * param slaveConfig User provided peripheral configuration. Use I3C_SlaveGetDefaultConfig() to get a set of - * defaults that you can override. - * param slowClock_Hz Frequency in Hertz of the I3C slow clock. Used to calculate the bus match condition values. - */ -void I3C_SlaveInit(I3C_Type *base, const i3c_slave_config_t *slaveConfig, uint32_t slowClock_Hz) -{ - assert(NULL != slaveConfig); - assert(0UL != slowClock_Hz); - - uint32_t configValue; - uint32_t instance = I3C_GetInstance(base); -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate the clock. */ - CLOCK_EnableClock(kI3cClocks[instance]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) - /* Reset the I3C module */ - RESET_PeripheralReset(kI3cResets[instance]); -#endif - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - uint8_t matchCount; - /* Caculate bus available condition match value for current slow clock, count value provides 1us.*/ - matchCount = (uint8_t)(slowClock_Hz / 1000000UL); -#endif - - configValue = base->SCONFIG; - configValue &= - ~(I3C_SCONFIG_SADDR_MASK | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - I3C_SCONFIG_BAMATCH_MASK | -#endif - I3C_SCONFIG_OFFLINE_MASK | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) - I3C_SCONFIG_IDRAND_MASK | -#endif -#if defined(FSL_FEATURE_I3C_HAS_HDROK) && FSL_FEATURE_I3C_HAS_HDROK - I3C_SCONFIG_HDROK_MASK | -#else - I3C_SCONFIG_DDROK_MASK | -#endif - I3C_SCONFIG_S0IGNORE_MASK | I3C_SCONFIG_MATCHSS_MASK | I3C_SCONFIG_NACK_MASK | I3C_SCONFIG_SLVENA_MASK); - configValue |= I3C_SCONFIG_SADDR(slaveConfig->staticAddr) | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - I3C_SCONFIG_BAMATCH(matchCount) | -#endif - I3C_SCONFIG_OFFLINE(slaveConfig->offline) | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) - I3C_SCONFIG_IDRAND(slaveConfig->enableRandomPart) | -#endif -#if defined(FSL_FEATURE_I3C_HAS_HDROK) && FSL_FEATURE_I3C_HAS_HDROK - I3C_SCONFIG_HDROK((0U != (slaveConfig->hdrMode & (uint8_t)kI3C_HDRModeDDR)) ? 1U : 0U) | -#else - I3C_SCONFIG_DDROK((0U != (slaveConfig->hdrMode & (uint8_t)kI3C_HDRModeDDR)) ? 1U : 0U) | -#endif - I3C_SCONFIG_S0IGNORE(slaveConfig->ignoreS0S1Error) | - I3C_SCONFIG_MATCHSS(slaveConfig->matchSlaveStartStop) | - I3C_SCONFIG_NACK(slaveConfig->nakAllRequest) | I3C_SCONFIG_SLVENA(slaveConfig->enableSlave); - - base->SVENDORID &= ~I3C_SVENDORID_VID_MASK; - base->SVENDORID |= I3C_SVENDORID_VID(slaveConfig->vendorID); - -#if defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND - base->SIDPARTNO = slaveConfig->partNumber; -#else - if (!slaveConfig->enableRandomPart) - { - base->SIDPARTNO = slaveConfig->partNumber; - } -#endif - - base->SIDEXT &= ~(I3C_SIDEXT_BCR_MASK | I3C_SIDEXT_DCR_MASK); - base->SIDEXT |= I3C_SIDEXT_BCR(slaveConfig->bcr) | I3C_SIDEXT_DCR(slaveConfig->dcr); - - base->SMAXLIMITS &= ~(I3C_SMAXLIMITS_MAXRD_MASK | I3C_SMAXLIMITS_MAXWR_MASK); - base->SMAXLIMITS |= - (I3C_SMAXLIMITS_MAXRD(slaveConfig->maxReadLength) | I3C_SMAXLIMITS_MAXWR(slaveConfig->maxWriteLength)); - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) && FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) - if (slaveConfig->isHotJoin) - { - I3C_SlaveRequestEvent(base, kI3C_SlaveEventHotJoinReq); - } -#endif - base->SCONFIG = configValue; -} - -/*! - * brief Deinitializes the I3C master peripheral. - * - * This function disables the I3C master peripheral and gates the clock. It also performs a software - * reset to restore the peripheral to reset conditions. - * - * param base The I3C peripheral base address. - */ -void I3C_SlaveDeinit(I3C_Type *base) -{ - uint32_t idx = I3C_GetInstance(base); - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) - /* Reset the I3C module */ - RESET_PeripheralReset(kI3cResets[idx]); -#endif - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate clock. */ - CLOCK_DisableClock(kI3cClocks[idx]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Reset handle pointer */ - s_i3cSlaveHandle[idx] = NULL; -} - -/*! - * @brief Gets the I3C slave state. - * - * @param base The I3C peripheral base address. - * @return I3C slave activity state, refer #i3c_slave_activity_state_t. - */ -i3c_slave_activity_state_t I3C_SlaveGetActivityState(I3C_Type *base) -{ - uint8_t activeState = (uint8_t)((base->SSTATUS & I3C_SSTATUS_ACTSTATE_MASK) >> I3C_SSTATUS_ACTSTATE_SHIFT); - i3c_slave_activity_state_t returnCode; - switch (activeState) - { - case (uint8_t)kI3C_SlaveNoLatency: - returnCode = kI3C_SlaveNoLatency; - break; - case (uint8_t)kI3C_SlaveLatency1Ms: - returnCode = kI3C_SlaveLatency1Ms; - break; - case (uint8_t)kI3C_SlaveLatency100Ms: - returnCode = kI3C_SlaveLatency100Ms; - break; - case (uint8_t)kI3C_SlaveLatency10S: - returnCode = kI3C_SlaveLatency10S; - break; - default: - returnCode = kI3C_SlaveNoLatency; - break; - } - - return returnCode; -} - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) && FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) -/*! - * brief I3C slave request event. - * - * param base The I3C peripheral base address. - * param event I3C slave event of type #i3c_slave_event_t - * param data IBI data if In-band interrupt has data, only applicable for event type #kI3C_SlaveEventIBI - */ -void I3C_SlaveRequestEvent(I3C_Type *base, i3c_slave_event_t event) -{ - uint32_t ctrlValue = base->SCTRL; - - ctrlValue &= ~I3C_SCTRL_EVENT_MASK; - ctrlValue |= I3C_SCTRL_EVENT(event); - - base->SCTRL = ctrlValue; -} - -/*! - * brief I3C slave request event. - * deprecated Do not use this function. It has been superseded by @ref I3C_SlaveRequestIBIWithData. - * - * param base The I3C peripheral base address. - * param data IBI data - * param dataSize IBI data size. - */ -void I3C_SlaveRequestIBIWithSingleData(I3C_Type *base, uint8_t data, size_t dataSize) -{ - uint32_t ctrlValue = base->SCTRL; - - ctrlValue &= ~(I3C_SCTRL_EVENT_MASK | I3C_SCTRL_IBIDATA_MASK); - ctrlValue |= I3C_SCTRL_EVENT(1U) | I3C_SCTRL_IBIDATA(data); - - base->SCTRL = ctrlValue; -} - -/*! - * brief I3C slave request IBI event with data payload(mandatory and extended). - * - * param base The I3C peripheral base address. - * param data Pointer to IBI data to be sent in the request. - * param dataSize IBI data size. - */ -void I3C_SlaveRequestIBIWithData(I3C_Type *base, uint8_t *data, size_t dataSize) -{ - assert((dataSize > 0U) && (dataSize <= 8U)); - - uint32_t ctrlValue; - -#if (defined(I3C_IBIEXT1_MAX_MASK) && I3C_IBIEXT1_MAX_MASK) - if (dataSize > 1U) - { - ctrlValue = I3C_IBIEXT1_EXT1(data[1]); - if (dataSize > 2U) - { - ctrlValue |= I3C_IBIEXT1_EXT2(data[2]); - } - if (dataSize > 3U) - { - ctrlValue |= I3C_IBIEXT1_EXT3(data[3]); - } - ctrlValue |= I3C_IBIEXT1_CNT(dataSize - 1U); - base->IBIEXT1 = ctrlValue; - } - - if (dataSize > 4U) - { - ctrlValue = I3C_IBIEXT2_EXT4(data[4]); - if (dataSize > 5U) - { - ctrlValue |= I3C_IBIEXT2_EXT5(data[5]); - } - if (dataSize > 6U) - { - ctrlValue |= I3C_IBIEXT2_EXT6(data[6]); - } - if (dataSize > 7U) - { - ctrlValue |= I3C_IBIEXT2_EXT7(data[7]); - } - base->IBIEXT2 = ctrlValue; - } -#endif - - ctrlValue = base->SCTRL; -#if (defined(I3C_IBIEXT1_MAX_MASK) && I3C_IBIEXT1_MAX_MASK) - ctrlValue &= ~(I3C_SCTRL_EVENT_MASK | I3C_SCTRL_IBIDATA_MASK | I3C_SCTRL_EXTDATA_MASK); - ctrlValue |= I3C_SCTRL_EVENT(1U) | I3C_SCTRL_IBIDATA(data[0]) | I3C_SCTRL_EXTDATA(dataSize > 1U); -#else - ctrlValue &= ~(I3C_SCTRL_EVENT_MASK | I3C_SCTRL_IBIDATA_MASK); - ctrlValue |= I3C_SCTRL_EVENT(1U) | I3C_SCTRL_IBIDATA(data[0]); -#endif - base->SCTRL = ctrlValue; -} -#endif /* !(defined(FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) && FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) */ - -/*! - * brief Performs a polling send transfer on the I3C bus. - * - * param base The I3C peripheral base address. - * param txBuff The pointer to the data to be transferred. - * param txSize The length in bytes of the data to be transferred. - * return Error or success status returned by API. - */ -status_t I3C_SlaveSend(I3C_Type *base, const void *txBuff, size_t txSize) -{ - const uint8_t *buf = (const uint8_t *)((const void *)txBuff); - status_t result = kStatus_Success; - - assert(NULL != txBuff); - - /* Send data buffer */ - while (0UL != txSize--) - { - /* Wait until there is room in the fifo. This also checks for errors. */ - result = I3C_SlaveWaitForTxReady(base); - if (kStatus_Success != result) - { - return result; - } - - /* Write byte into I3C slave data register. */ - if (0UL != txSize) - { - base->SWDATAB = *buf++; - } - else - { - base->SWDATABE = *buf++; - } - } - - return result; -} - -/*! - * brief Performs a polling receive transfer on the I3C bus. - * - * param base The I3C peripheral base address. - * param rxBuff The pointer to the data to be transferred. - * param rxSize The length in bytes of the data to be transferred. - * return Error or success status returned by API. - */ -status_t I3C_SlaveReceive(I3C_Type *base, void *rxBuff, size_t rxSize) -{ - status_t result = kStatus_Success; - uint8_t *buf; - - assert(NULL != rxBuff); - - /* Handle empty read. */ - if (0UL == rxSize) - { - return kStatus_Success; - } - -#if I3C_RETRY_TIMES - uint32_t waitTimes = I3C_RETRY_TIMES; -#endif - - /* Receive data */ - buf = (uint8_t *)rxBuff; - while (0UL != rxSize) - { -#if I3C_RETRY_TIMES - if (--waitTimes == 0) - { - return kStatus_I3C_Timeout; - } -#endif - /* Check for errors. */ - result = I3C_SlaveCheckAndClearError(base, I3C_SlaveGetErrorStatusFlags(base)); - if (kStatus_Success != result) - { - return result; - } - - /* Check RX data */ - if (0UL != (base->SDATACTRL & I3C_SDATACTRL_RXCOUNT_MASK)) - { - *buf++ = (uint8_t)(base->SRDATAB & I3C_SRDATAB_DATA0_MASK); - rxSize--; - } - } - - return result; -} - -/*! - * brief Creates a new handle for the I3C slave non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the I3C_SlaveTransferAbort() API shall be called. - * - * note The function also enables the NVIC IRQ for the input I3C. Need to notice - * that on some SoCs the I3C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - - * param base The I3C peripheral base address. - * param[out] handle Pointer to the I3C slave driver handle. - * param callback User provided pointer to the asynchronous callback function. - * param userData User provided pointer to the application callback data. - */ -void I3C_SlaveTransferCreateHandle(I3C_Type *base, - i3c_slave_handle_t *handle, - i3c_slave_transfer_callback_t callback, - void *userData) -{ - uint32_t instance; - - assert(NULL != handle); - - /* Clear out the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Look up instance number */ - instance = I3C_GetInstance(base); - - /* Save base and instance. */ - handle->callback = callback; - handle->userData = userData; - - /* Save Tx FIFO Size. */ - handle->txFifoSize = - 2U << ((base->SCAPABILITIES & I3C_SCAPABILITIES_FIFOTX_MASK) >> I3C_SCAPABILITIES_FIFOTX_SHIFT); - - /* Save this handle for IRQ use. */ - s_i3cSlaveHandle[instance] = handle; - - /* Set irq handler. */ - s_i3cSlaveIsr = I3C_SlaveTransferHandleIRQ; - - /* Clear internal IRQ enables and enable NVIC IRQ. */ - I3C_SlaveDisableInterrupts(base, (uint32_t)kSlaveIrqFlags); - (void)EnableIRQ(kI3cIrqs[instance]); -} - -/*! - * brief Starts accepting slave transfers. - * - * Call this API after calling I2C_SlaveInit() and I3C_SlaveTransferCreateHandle() to start processing - * transactions driven by an I2C master. The slave monitors the I2C bus and pass events to the - * callback that was passed into the call to I3C_SlaveTransferCreateHandle(). The callback is always invoked - * from the interrupt context. - * - * The set of events received by the callback is customizable. To do so, set the a eventMask parameter to - * the OR'd combination of #i3c_slave_transfer_event_t enumerators for the events you wish to receive. - * The #kI3C_SlaveTransmitEvent and #kI3C_SlaveReceiveEvent events are always enabled and do not need - * to be included in the mask. Alternatively, you can pass 0 to get a default set of only the transmit and - * receive events that are always enabled. In addition, the #kI3C_SlaveAllEvents constant is provided as - * a convenient way to enable all events. - * - * param base The I3C peripheral base address. - * param handle Pointer to #i3c_slave_handle_t structure which stores the transfer state. - * param eventMask Bit mask formed by OR'ing together #i3c_slave_transfer_event_t enumerators to specify - * which events to send to the callback. Other accepted values are 0 to get a default set of - * only the transmit and receive events, and #kI3C_SlaveAllEvents to enable all events. - * - * retval #kStatus_Success Slave transfers were successfully started. - * retval #kStatus_I3C_Busy Slave transfers have already been started on this handle. - */ -status_t I3C_SlaveTransferNonBlocking(I3C_Type *base, i3c_slave_handle_t *handle, uint32_t eventMask) -{ - assert(NULL != handle); - - /* Return busy if another transaction is in progress. */ - if (handle->isBusy) - { - return kStatus_I3C_Busy; - } - - /* Disable I3C IRQ sources while we configure stuff. */ - I3C_SlaveDisableInterrupts(base, (uint32_t)kSlaveIrqFlags); - - /* Clear transfer in handle. */ - (void)memset(&handle->transfer, 0, sizeof(handle->transfer)); - - /* Set up event mask. tx and rx are always enabled. */ - handle->eventMask = eventMask | (uint32_t)kI3C_SlaveTransmitEvent | (uint32_t)kI3C_SlaveReceiveEvent; - - /* Clear all flags. */ - I3C_SlaveClearStatusFlags(base, (uint32_t)kSlaveClearFlags); - - /* Enable I3C internal IRQ sources. NVIC IRQ was enabled in CreateHandle() */ - I3C_SlaveEnableInterrupts(base, (uint32_t)kSlaveIrqFlags); - - return kStatus_Success; -} - -/*! - * brief Gets the slave transfer status during a non-blocking transfer. - * param base The I3C peripheral base address. - * param handle Pointer to i2c_slave_handle_t structure. - * param[out] count Pointer to a value to hold the number of bytes transferred. May be NULL if the count is not - * required. - * retval #kStatus_Success - * retval #kStatus_NoTransferInProgress - */ -status_t I3C_SlaveTransferGetCount(I3C_Type *base, i3c_slave_handle_t *handle, size_t *count) -{ - assert(NULL != handle); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (!handle->isBusy) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - /* For an active transfer, just return the count from the handle. */ - *count = handle->transferredCount; - - return kStatus_Success; -} - -/*! - * brief Aborts the slave non-blocking transfers. - * note This API could be called at any time to stop slave for handling the bus events. - * param base The I3C peripheral base address. - * param handle Pointer to #i3c_slave_handle_t structure which stores the transfer state. - * retval #kStatus_Success - * retval #kStatus_I3C_Idle - */ -void I3C_SlaveTransferAbort(I3C_Type *base, i3c_slave_handle_t *handle) -{ - assert(NULL != handle); - - /* Return idle if no transaction is in progress. */ - if (handle->isBusy) - { - /* Disable I3C IRQ sources. */ - I3C_SlaveDisableInterrupts(base, (uint32_t)kSlaveIrqFlags); - - /* Reset transfer info. */ - (void)memset(&handle->transfer, 0, sizeof(handle->transfer)); - - /* We're no longer busy. */ - handle->isBusy = false; - } -} - -static bool I3C_SlaveTransferHandleGetStatusFlags(I3C_Type *base, - i3c_slave_handle_t *handle, - i3c_slave_handleIrq_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - /* Check for a valid handle in case of a spurious interrupt. */ - uint32_t errFlags; - stateParams->flags = I3C_SlaveGetStatusFlags(base); - errFlags = I3C_SlaveGetErrorStatusFlags(base); - - stateParams->pendingInts = I3C_SlaveGetPendingInterrupts(base); - stateParams->enabledInts = I3C_SlaveGetEnabledInterrupts(base); - - if (0UL != (errFlags & (uint32_t)kSlaveErrorFlags)) - { - handle->transfer.event = (uint32_t)kI3C_SlaveCompletionEvent; - handle->transfer.completionStatus = I3C_SlaveCheckAndClearError(base, errFlags); - - if ((0UL != (handle->eventMask & (uint32_t)kI3C_SlaveCompletionEvent)) && (NULL != handle->callback)) - { - handle->callback(base, &handle->transfer, handle->userData); - } - return false; - } - return true; -} - -static void I3C_SlaveTransferHandleBusStart(I3C_Type *base, i3c_slave_transfer_t *xfer, uint32_t *pendingInts) -{ - base->SDATACTRL |= I3C_SDATACTRL_FLUSHTB_MASK; - xfer->txDataSize = 0; - I3C_SlaveEnableInterrupts(base, (uint32_t)kI3C_SlaveTxReadyFlag); - (*pendingInts) |= (uint32_t)kI3C_SlaveTxReadyFlag; -} - -static void I3C_SlaveTransferHandleEventSent(I3C_Type *base, i3c_slave_handle_t *handle, i3c_slave_transfer_t *xfer) -{ - xfer->event = (uint32_t)kI3C_SlaveRequestSentEvent; - if ((0UL != (handle->eventMask & xfer->event)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } -} - -static void I3C_SlaveTransferHandleReceivedCCC(I3C_Type *base, i3c_slave_handle_t *handle, i3c_slave_transfer_t *xfer) -{ - handle->isBusy = true; - xfer->event = (uint32_t)kI3C_SlaveReceivedCCCEvent; - if ((0UL != (handle->eventMask & xfer->event)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } -} - -static void I3C_SlaveTransferHandleBusStop(I3C_Type *base, - i3c_slave_handle_t *handle, - i3c_slave_handleIrq_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - I3C_SlaveDisableInterrupts(base, (uint32_t)kI3C_SlaveTxReadyFlag); - stateParams->pendingInts &= ~(uint32_t)kI3C_SlaveTxReadyFlag; - base->SDATACTRL |= I3C_SDATACTRL_FLUSHTB_MASK | I3C_SDATACTRL_FLUSHFB_MASK; - if (handle->isBusy) - { - handle->transfer.event = (uint32_t)kI3C_SlaveCompletionEvent; - handle->transfer.completionStatus = kStatus_Success; - handle->transfer.transferredCount = handle->transferredCount; - handle->isBusy = false; - - if (handle->wasTransmit) - { - /* Subtract one from the transmit count to offset the fact that I3C asserts the */ - /* tx flag before it sees the nack from the master-receiver, thus causing one more */ - /* count that the master actually receives. */ - --handle->transfer.transferredCount; - handle->wasTransmit = false; - } - - if ((0UL != (handle->eventMask & handle->transfer.event)) && (NULL != handle->callback)) - { - handle->callback(base, &handle->transfer, handle->userData); - } - - /* Clean up transfer info on completion, after the callback has been invoked. */ - (void)memset(&handle->transfer, 0, sizeof(handle->transfer)); - } -} - -static void I3C_SlaveTransferHandleMatched(I3C_Type *base, i3c_slave_handle_t *handle, i3c_slave_transfer_t *xfer) -{ - assert(NULL != base && NULL != handle && NULL != xfer); - xfer->event = (uint32_t)kI3C_SlaveAddressMatchEvent; - handle->isBusy = true; - if ((0UL != (handle->eventMask & (uint32_t)kI3C_SlaveAddressMatchEvent)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } -} - -static void I3C_SlaveTransferHandleTxReady(I3C_Type *base, - i3c_slave_handle_t *handle, - i3c_slave_handleIrq_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - handle->wasTransmit = true; - - /* If we're out of data, invoke callback to get more. */ - if ((NULL == handle->transfer.txData) || (0UL == handle->transfer.txDataSize)) - { - handle->transfer.event = (uint32_t)kI3C_SlaveTransmitEvent; - if (0UL != (stateParams->flags & (uint32_t)kI3C_SlaveBusHDRModeFlag)) - { - handle->transfer.event |= (uint32_t)kI3C_SlaveHDRCommandMatchEvent; - handle->isBusy = true; - } - if (NULL != handle->callback) - { - handle->callback(base, &handle->transfer, handle->userData); - } - - /* Clear the transferred count now that we have a new buffer. */ - handle->transferredCount = 0; - } - - if ((NULL == handle->transfer.txData) || (0UL == handle->transfer.txDataSize)) - { - I3C_SlaveDisableInterrupts(base, (uint32_t)kI3C_SlaveTxReadyFlag); - (stateParams->pendingInts) &= ~(uint32_t)kI3C_SlaveTxReadyFlag; - } - - /* Transmit a byte. */ - while ((handle->transfer.txDataSize != 0UL) && ((stateParams->txCount) != 0U)) - { - if (handle->transfer.txDataSize > 1UL) - { - base->SWDATAB = *handle->transfer.txData++; - } - else - { - base->SWDATABE = *handle->transfer.txData++; - I3C_SlaveDisableInterrupts(base, (uint32_t)kI3C_SlaveTxReadyFlag); - } - --(handle->transfer.txDataSize); - ++(handle->transferredCount); - (stateParams->txCount)--; - } -} - -static void I3C_SlaveTransferHandleRxReady(I3C_Type *base, - i3c_slave_handle_t *handle, - i3c_slave_handleIrq_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - /* If we're out of room in the buffer, invoke callback to get another. */ - if ((NULL == handle->transfer.rxData) || (0UL == handle->transfer.rxDataSize)) - { - handle->transfer.event = (uint32_t)kI3C_SlaveReceiveEvent; - if (0UL != (stateParams->flags & (uint32_t)kI3C_SlaveBusHDRModeFlag)) - { - handle->transfer.event |= (uint32_t)kI3C_SlaveHDRCommandMatchEvent; - handle->isBusy = true; - } - if (NULL != handle->callback) - { - handle->callback(base, &handle->transfer, handle->userData); - } - handle->transferredCount = 0; - } - /* Receive a byte. */ - while ((stateParams->rxCount != 0U) && ((handle->transfer.rxData != NULL) && (handle->transfer.rxDataSize != 0UL))) - { - *(handle->transfer.rxData++) = (uint8_t)base->SRDATAB; - --(handle->transfer.rxDataSize); - ++(handle->transferredCount); - (stateParams->rxCount)--; - } -} - -/*! - * brief Reusable routine to handle slave interrupts. - * note This function does not need to be called unless you are reimplementing the - * non blocking API's interrupt handler routines to add special functionality. - * param base The I3C peripheral base address. - * param handle Pointer to #i3c_slave_handle_t structure which stores the transfer state. - */ -void I3C_SlaveTransferHandleIRQ(I3C_Type *base, void *intHandle) -{ - i3c_slave_handleIrq_param_t stateParams; - - (void)memset(&stateParams, 0, sizeof(stateParams)); - i3c_slave_handle_t *handle = (i3c_slave_handle_t *)intHandle; - - /* Check for a valid handle in case of a spurious interrupt. */ - if (NULL == handle) - { - return; - } - - /* Get status flags. */ - if (false == I3C_SlaveTransferHandleGetStatusFlags(base, handle, &stateParams)) - { - return; - } - - /* Clear status flags. */ - I3C_SlaveClearStatusFlags(base, stateParams.flags); - - if (0UL != (stateParams.flags & (uint32_t)kI3C_SlaveBusStartFlag)) - { - I3C_SlaveTransferHandleBusStart(base, &handle->transfer, &stateParams.pendingInts); - } - - if (0UL != (stateParams.flags & (uint32_t)kI3C_SlaveEventSentFlag)) - { - I3C_SlaveTransferHandleEventSent(base, handle, &handle->transfer); - } - - if (0UL != (stateParams.flags & (uint32_t)kI3C_SlaveReceivedCCCFlag)) - { - I3C_SlaveTransferHandleReceivedCCC(base, handle, &handle->transfer); - } - - if (0UL != (stateParams.flags & (uint32_t)kI3C_SlaveMatchedFlag)) - { - I3C_SlaveTransferHandleMatched(base, handle, &handle->transfer); - } - - /* Get fifo counts and compute room in tx fifo. */ - I3C_SlaveGetFifoCounts(base, &stateParams.rxCount, &stateParams.txCount); - stateParams.txCount = handle->txFifoSize - stateParams.txCount; - - /* Handle transmit and receive. */ - if ((0UL != (stateParams.flags & (uint32_t)kI3C_SlaveTxReadyFlag)) && - (0UL != (stateParams.pendingInts & (uint32_t)kI3C_SlaveTxReadyFlag))) - { - I3C_SlaveTransferHandleTxReady(base, handle, &stateParams); - } - - if ((0UL != (stateParams.flags & (uint32_t)kI3C_SlaveRxReadyFlag)) && - (0UL != (stateParams.enabledInts & (uint32_t)kI3C_SlaveRxReadyFlag))) - { - I3C_SlaveTransferHandleRxReady(base, handle, &stateParams); - } - - /* Handle stop event. */ - if (0UL != (stateParams.flags & (uint32_t)kI3C_SlaveBusStopFlag)) - { - I3C_SlaveTransferHandleBusStop(base, handle, &stateParams); - } -} - -static void I3C_CommonIRQHandler(I3C_Type *base, uint32_t instance) -{ - /* Check for master IRQ. */ - if (((uint32_t)kI3C_MasterOn == (base->MCONFIG & I3C_MCONFIG_MSTENA_MASK)) && (NULL != s_i3cMasterIsr)) - { - /* Master mode. */ - s_i3cMasterIsr(base, s_i3cMasterHandle[instance]); - } - - /* Check for slave IRQ. */ - if ((I3C_SCONFIG_SLVENA_MASK == (base->SCONFIG & I3C_SCONFIG_SLVENA_MASK)) && (NULL != s_i3cSlaveIsr)) - { - /* Slave mode. */ - s_i3cSlaveIsr(base, s_i3cSlaveHandle[instance]); - } - SDK_ISR_EXIT_BARRIER; -} - -#if defined(I3C) -/* Implementation of I3C handler named in startup code. */ -void I3C0_DriverIRQHandler(void); -void I3C0_DriverIRQHandler(void) -{ - I3C_CommonIRQHandler(I3C, 0); -} -#endif - -#if defined(I3C0) -/* Implementation of I3C0 handler named in startup code. */ -void I3C0_DriverIRQHandler(void); -void I3C0_DriverIRQHandler(void) -{ - I3C_CommonIRQHandler(I3C0, 0); -} -#endif - -#if defined(I3C1) -/* Implementation of I3C1 handler named in startup code. */ -void I3C1_DriverIRQHandler(void); -void I3C1_DriverIRQHandler(void) -{ - I3C_CommonIRQHandler(I3C1, 1); -} -#endif - -#if defined(I3C2) -/* Implementation of I3C2 handler named in startup code. */ -void I3C2_DriverIRQHandler(void); -void I3C2_DriverIRQHandler(void) -{ - I3C_CommonIRQHandler(I3C2, 2); -} -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_i3c.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_i3c.h deleted file mode 100644 index f6a2d7fc4d1..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_i3c.h +++ /dev/null @@ -1,1876 +0,0 @@ -/* - * Copyright 2018-2023 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_I3C_H_ -#define FSL_I3C_H_ - -#include "fsl_common.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @addtogroup i3c - * @{ - */ - -/*! @name Driver version */ -/*@{*/ -/*! @brief I3C driver version */ -#define FSL_I3C_DRIVER_VERSION (MAKE_VERSION(2, 10, 6)) -/*@}*/ - -/*! @brief Timeout times for waiting flag. */ -#ifndef I3C_RETRY_TIMES -#define I3C_RETRY_TIMES 0U /* Define to zero means keep waiting until the flag is assert/deassert. */ -#endif - -#define I3C_MAX_DEVCNT 10U - -#ifndef I3C_IBI_BUFF_SIZE -#define I3C_IBI_BUFF_SIZE 10U -#endif - -/*! @brief I3C status return codes. */ -enum -{ - kStatus_I3C_Busy = MAKE_STATUS(kStatusGroup_I3C, 0), /*!< The master is already performing a transfer. */ - kStatus_I3C_Idle = MAKE_STATUS(kStatusGroup_I3C, 1), /*!< The slave driver is idle. */ - kStatus_I3C_Nak = MAKE_STATUS(kStatusGroup_I3C, 2), /*!< The slave device sent a NAK in response to an address. */ - kStatus_I3C_WriteAbort = - MAKE_STATUS(kStatusGroup_I3C, 3), /*!< The slave device sent a NAK in response to a write. */ - kStatus_I3C_Term = MAKE_STATUS(kStatusGroup_I3C, 4), /*!< The master terminates slave read. */ - kStatus_I3C_HdrParityError = MAKE_STATUS(kStatusGroup_I3C, 5), /*!< Parity error from DDR read. */ - kStatus_I3C_CrcError = MAKE_STATUS(kStatusGroup_I3C, 6), /*!< CRC error from DDR read. */ - kStatus_I3C_ReadFifoError = MAKE_STATUS(kStatusGroup_I3C, 7), /*!< Read from M/SRDATAB register when FIFO empty. */ - kStatus_I3C_WriteFifoError = MAKE_STATUS(kStatusGroup_I3C, 8), /*!< Write to M/SWDATAB register when FIFO full. */ - kStatus_I3C_MsgError = - MAKE_STATUS(kStatusGroup_I3C, 9), /*!< Message SDR/DDR mismatch or read/write message in wrong state */ - kStatus_I3C_InvalidReq = MAKE_STATUS(kStatusGroup_I3C, 10), /*!< Invalid use of request. */ - kStatus_I3C_Timeout = MAKE_STATUS(kStatusGroup_I3C, 11), /*!< The module has stalled too long in a frame. */ - kStatus_I3C_SlaveCountExceed = - MAKE_STATUS(kStatusGroup_I3C, 12), /*!< The I3C slave count has exceed the definition in I3C_MAX_DEVCNT. */ - kStatus_I3C_IBIWon = MAKE_STATUS( - kStatusGroup_I3C, 13), /*!< The I3C slave event IBI or MR or HJ won the arbitration on a header address. */ - kStatus_I3C_OverrunError = MAKE_STATUS(kStatusGroup_I3C, 14), /*!< Slave internal from-bus buffer/FIFO overrun. */ - kStatus_I3C_UnderrunError = MAKE_STATUS(kStatusGroup_I3C, 15), /*!< Slave internal to-bus buffer/FIFO underrun */ - kStatus_I3C_UnderrunNak = - MAKE_STATUS(kStatusGroup_I3C, 16), /*!< Slave internal from-bus buffer/FIFO underrun and NACK error */ - kStatus_I3C_InvalidStart = MAKE_STATUS(kStatusGroup_I3C, 17), /*!< Slave invalid start flag */ - kStatus_I3C_SdrParityError = MAKE_STATUS(kStatusGroup_I3C, 18), /*!< SDR parity error */ - kStatus_I3C_S0S1Error = MAKE_STATUS(kStatusGroup_I3C, 19), /*!< S0 or S1 error */ -}; - -/*! @brief I3C HDR modes. */ -typedef enum _i3c_hdr_mode -{ - kI3C_HDRModeNone = 0x00U, /* Do not support HDR mode. */ - kI3C_HDRModeDDR = 0x01U, /* HDR-DDR Mode. */ - kI3C_HDRModeTSP = 0x02U, /* HDR-TSP Mode. */ - kI3C_HDRModeTSL = 0x04U, /* HDR-TSL Mode. */ -} i3c_hdr_mode_t; - -/*! @brief I3C device information. */ -typedef struct _i3c_device_info -{ - uint8_t dynamicAddr; /*!< Device dynamic address. */ - uint8_t staticAddr; /*!< Static address. */ - uint8_t dcr; /*!< Device characteristics register information. */ - uint8_t bcr; /*!< Bus characteristics register information. */ - uint16_t vendorID; /*!< Device vendor ID(manufacture ID). */ - uint32_t partNumber; /*!< Device part number info */ - uint16_t maxReadLength; /*!< Maximum read length. */ - uint16_t maxWriteLength; /*!< Maximum write length. */ - uint8_t hdrMode; /*!< Support hdr mode, could be OR logic in i3c_hdr_mode. */ -} i3c_device_info_t; - -/*! @} */ - -/*! - * @addtogroup i3c_master_driver - * @{ - */ - -/*! - * @brief I3C master peripheral flags. - * - * The following status register flags can be cleared: - * - #kI3C_MasterSlaveStartFlag - * - #kI3C_MasterControlDoneFlag - * - #kI3C_MasterCompleteFlag - * - #kI3C_MasterArbitrationWonFlag - * - #kI3C_MasterSlave2MasterFlag - * - * All flags except #kI3C_MasterBetweenFlag and #kI3C_MasterNackDetectFlag can be enabled as - * interrupts. - * - * @note These enums are meant to be OR'd together to form a bit mask. - */ -enum _i3c_master_flags -{ - kI3C_MasterBetweenFlag = I3C_MSTATUS_BETWEEN_MASK, /*!< Between messages/DAAs flag */ - kI3C_MasterNackDetectFlag = I3C_MSTATUS_NACKED_MASK, /*!< NACK detected flag */ - kI3C_MasterSlaveStartFlag = I3C_MSTATUS_SLVSTART_MASK, /*!< Slave request start flag */ - kI3C_MasterControlDoneFlag = I3C_MSTATUS_MCTRLDONE_MASK, /*!< Master request complete flag */ - kI3C_MasterCompleteFlag = I3C_MSTATUS_COMPLETE_MASK, /*!< Transfer complete flag */ - kI3C_MasterRxReadyFlag = I3C_MSTATUS_RXPEND_MASK, /*!< Rx data ready in Rx buffer flag */ - kI3C_MasterTxReadyFlag = I3C_MSTATUS_TXNOTFULL_MASK, /*!< Tx buffer ready for Tx data flag */ - kI3C_MasterArbitrationWonFlag = I3C_MSTATUS_IBIWON_MASK, /*!< Header address won arbitration flag */ - kI3C_MasterErrorFlag = I3C_MSTATUS_ERRWARN_MASK, /*!< Error occurred flag */ - kI3C_MasterSlave2MasterFlag = I3C_MSTATUS_NOWMASTER_MASK, /*!< Switch from slave to master flag */ - kI3C_MasterClearFlags = kI3C_MasterSlaveStartFlag | kI3C_MasterControlDoneFlag | kI3C_MasterCompleteFlag | - kI3C_MasterArbitrationWonFlag | kI3C_MasterSlave2MasterFlag | kI3C_MasterErrorFlag, -}; - -/*! - * @brief I3C master error flags to indicate the causes. - * - * @note These enums are meant to be OR'd together to form a bit mask. - */ -enum _i3c_master_error_flags -{ - kI3C_MasterErrorNackFlag = I3C_MERRWARN_NACK_MASK, /*!< Slave NACKed the last address */ - kI3C_MasterErrorWriteAbortFlag = I3C_MERRWARN_WRABT_MASK, /*!< Slave NACKed the write data */ -#if !defined(FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) || (!FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) - kI3C_MasterErrorTermFlag = I3C_MERRWARN_TERM_MASK, /*!< Master terminates slave read */ -#endif - kI3C_MasterErrorParityFlag = I3C_MERRWARN_HPAR_MASK, /*!< Parity error from DDR read */ - kI3C_MasterErrorCrcFlag = I3C_MERRWARN_HCRC_MASK, /*!< CRC error from DDR read */ - kI3C_MasterErrorReadFlag = I3C_MERRWARN_OREAD_MASK, /*!< Read from MRDATAB register when FIFO empty */ - kI3C_MasterErrorWriteFlag = I3C_MERRWARN_OWRITE_MASK, /*!< Write to MWDATAB register when FIFO full */ - kI3C_MasterErrorMsgFlag = I3C_MERRWARN_MSGERR_MASK, /*!< Message SDR/DDR mismatch or - read/write message in wrong state */ - kI3C_MasterErrorInvalidReqFlag = I3C_MERRWARN_INVREQ_MASK, /*!< Invalid use of request */ - kI3C_MasterErrorTimeoutFlag = I3C_MERRWARN_TIMEOUT_MASK, /*!< The module has stalled too long in a frame */ - kI3C_MasterAllErrorFlags = kI3C_MasterErrorNackFlag | kI3C_MasterErrorWriteAbortFlag | -#if !defined(FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) || (!FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) - kI3C_MasterErrorTermFlag | -#endif - kI3C_MasterErrorParityFlag | kI3C_MasterErrorCrcFlag | kI3C_MasterErrorReadFlag | - kI3C_MasterErrorWriteFlag | kI3C_MasterErrorMsgFlag | kI3C_MasterErrorInvalidReqFlag | - kI3C_MasterErrorTimeoutFlag, /*!< All error flags */ -}; - -/*! @brief I3C working master state. */ -typedef enum _i3c_master_state -{ - kI3C_MasterStateIdle = 0U, /*!< Bus stopped. */ - kI3C_MasterStateSlvReq = 1U, /*!< Bus stopped but slave holding SDA low. */ - kI3C_MasterStateMsgSdr = 2U, /*!< In SDR Message mode from using MWMSG_SDR. */ - kI3C_MasterStateNormAct = 3U, /*!< In normal active SDR mode. */ - kI3C_MasterStateDdr = 4U, /*!< In DDR Message mode. */ - kI3C_MasterStateDaa = 5U, /*!< In ENTDAA mode. */ - kI3C_MasterStateIbiAck = 6U, /*!< Waiting on IBI ACK/NACK decision. */ - kI3C_MasterStateIbiRcv = 7U, /*!< receiving IBI. */ -} i3c_master_state_t; - -/*! @brief I3C master enable configuration. */ -typedef enum _i3c_master_enable -{ - kI3C_MasterOff = 0U, /*!< Master off. */ - kI3C_MasterOn = 1U, /*!< Master on. */ - kI3C_MasterCapable = 2U /*!< Master capable. */ -} i3c_master_enable_t; - -/*! @brief I3C high keeper configuration. */ -typedef enum _i3c_master_hkeep -{ - kI3C_MasterHighKeeperNone = 0U, /*!< Use PUR to hold SCL high. */ - kI3C_MasterHighKeeperWiredIn = 1U, /*!< Use pin_HK controls. */ - kI3C_MasterPassiveSDA = 2U, /*!< Hi-Z for Bus Free and hold SDA. */ - kI3C_MasterPassiveSDASCL = 3U /*!< Hi-Z both for Bus Free, and can Hi-Z SDA for hold. */ -} i3c_master_hkeep_t; - -/*! @brief Emits the requested operation when doing in pieces vs. by message. */ -typedef enum _i3c_bus_request -{ - kI3C_RequestNone = 0U, /*!< No request. */ - kI3C_RequestEmitStartAddr = 1U, /*!< Request to emit start and address on bus. */ - kI3C_RequestEmitStop = 2U, /*!< Request to emit stop on bus. */ - kI3C_RequestIbiAckNack = 3U, /*!< Manual IBI ACK or NACK. */ - kI3C_RequestProcessDAA = 4U, /*!< Process DAA. */ - kI3C_RequestForceExit = 6U, /*!< Request to force exit. */ - kI3C_RequestAutoIbi = 7U, /*!< Hold in stopped state, but Auto-emit START,7E. */ -} i3c_bus_request_t; - -/*! @brief Bus type with EmitStartAddr. */ -typedef enum _i3c_bus_type -{ - kI3C_TypeI3CSdr = 0U, /*!< SDR mode of I3C. */ - kI3C_TypeI2C = 1U, /*!< Standard i2c protocol. */ - kI3C_TypeI3CDdr = 2U, /*!< HDR-DDR mode of I3C. */ -} i3c_bus_type_t; - -/*! @brief IBI response. */ -typedef enum _i3c_ibi_response -{ - kI3C_IbiRespAck = 0U, /*!< ACK with no mandatory byte. */ - kI3C_IbiRespNack = 1U, /*!< NACK. */ - kI3C_IbiRespAckMandatory = 2U, /*!< ACK with mandatory byte. */ - kI3C_IbiRespManual = 3U, /*!< Reserved. */ -} i3c_ibi_response_t; - -/*! @brief IBI type. */ -typedef enum _i3c_ibi_type -{ - kI3C_IbiNormal = 0U, /*!< In-band interrupt. */ - kI3C_IbiHotJoin = 1U, /*!< slave hot join. */ - kI3C_IbiMasterRequest = 2U, /*!< slave master ship request. */ -} i3c_ibi_type_t; - -/*! @brief IBI state. */ -typedef enum _i3c_ibi_state -{ - kI3C_IbiReady = 0U, /*!< In-band interrupt ready state, ready for user to handle. */ - kI3C_IbiDataBuffNeed = 1U, /*!< In-band interrupt need data buffer for data receive. */ - kI3C_IbiAckNackPending = 2U, /*!< In-band interrupt Ack/Nack pending for decision. */ -} i3c_ibi_state_t; - -/*! @brief Direction of master and slave transfers. */ -typedef enum _i3c_direction -{ - kI3C_Write = 0U, /*!< Master transmit. */ - kI3C_Read = 1U /*!< Master receive. */ -} i3c_direction_t; - -/*! @brief Watermark of TX int/dma trigger level. */ -typedef enum _i3c_tx_trigger_level -{ - kI3C_TxTriggerOnEmpty = 0U, /*!< Trigger on empty. */ - kI3C_TxTriggerUntilOneQuarterOrLess = 1U, /*!< Trigger on 1/4 full or less. */ - kI3C_TxTriggerUntilOneHalfOrLess = 2U, /*!< Trigger on 1/2 full or less. */ - kI3C_TxTriggerUntilOneLessThanFull = 3U, /*!< Trigger on 1 less than full or less. */ -} i3c_tx_trigger_level_t; - -/*! @brief Watermark of RX int/dma trigger level. */ -typedef enum _i3c_rx_trigger_level -{ - kI3C_RxTriggerOnNotEmpty = 0U, /*!< Trigger on not empty. */ - kI3C_RxTriggerUntilOneQuarterOrMore = 1U, /*!< Trigger on 1/4 full or more. */ - kI3C_RxTriggerUntilOneHalfOrMore = 2U, /*!< Trigger on 1/2 full or more. */ - kI3C_RxTriggerUntilThreeQuarterOrMore = 3U, /*!< Trigger on 3/4 full or more. */ -} i3c_rx_trigger_level_t; - -/*! @brief I3C master read termination operations. */ -typedef enum _i3c_rx_term_ops -{ - kI3C_RxTermDisable = 0U, /*!< Master doesn't terminate read, used for CCC transfer. */ - kI3C_RxAutoTerm = 1U, /*!< Master auto terminate read after receiving specified bytes(<=255). */ - kI3C_RxTermLastByte = 2U, /*!< Master terminates read at any time after START, no length limitation. */ -} i3c_rx_term_ops_t; - -/*! @brief Structure with setting master IBI rules and slave registry. */ -typedef struct _i3c_register_ibi_addr -{ - uint8_t address[5]; /*!< Address array for registry. */ - bool ibiHasPayload; /*!< Whether the address array has mandatory IBI byte. */ -} i3c_register_ibi_addr_t; - -/*! @brief Structure with I3C baudrate settings. */ -typedef struct _i3c_baudrate -{ - uint32_t i2cBaud; /*!< Desired I2C baud rate in Hertz. */ - uint32_t i3cPushPullBaud; /*!< Desired I3C push-pull baud rate in Hertz. */ - uint32_t i3cOpenDrainBaud; /*!< Desired I3C open-drain baud rate in Hertz. */ -} i3c_baudrate_hz_t; - -/*! @brief I3C DAA baud rate configuration. */ -typedef struct _i3c_master_daa_baudrate -{ - uint32_t sourceClock_Hz; /*!< FCLK, function clock in Hertz. */ - uint32_t i3cPushPullBaud; /*!< Desired I3C push-pull baud rate in Hertz. */ - uint32_t i3cOpenDrainBaud; /*!< Desired I3C open-drain baud rate in Hertz. */ -} i3c_master_daa_baudrate_t; - -/*! - * @brief Structure with settings to initialize the I3C master module. - * - * This structure holds configuration settings for the I3C peripheral. To initialize this - * structure to reasonable defaults, call the I3C_MasterGetDefaultConfig() function and - * pass a pointer to your configuration structure instance. - * - * The configuration structure can be made constant so it resides in flash. - */ -typedef struct _i3c_master_config -{ - i3c_master_enable_t enableMaster; /*!< Enable master mode. */ - bool disableTimeout; /*!< Whether to disable timeout to prevent the ERRWARN. */ - i3c_master_hkeep_t hKeep; /*!< High keeper mode setting. */ - bool enableOpenDrainStop; /*!< Whether to emit open-drain speed STOP. */ - bool enableOpenDrainHigh; /*!< Enable Open-Drain High to be 1 PPBAUD count for i3c messages, or 1 ODBAUD. */ - i3c_baudrate_hz_t baudRate_Hz; /*!< Desired baud rate settings. */ -} i3c_master_config_t; - -/* Forward declaration of the transfer descriptor and handle typedefs. */ -typedef struct _i3c_master_transfer i3c_master_transfer_t; -typedef struct _i3c_master_handle i3c_master_handle_t; - -/*! @brief i3c master callback functions. */ -typedef struct _i3c_master_transfer_callback -{ - void (*slave2Master)(I3C_Type *base, void *userData); /*!< Transfer complete callback */ - void (*ibiCallback)(I3C_Type *base, - i3c_master_handle_t *handle, - i3c_ibi_type_t ibiType, - i3c_ibi_state_t ibiState); /*!< IBI event callback */ - void (*transferComplete)(I3C_Type *base, - i3c_master_handle_t *handle, - status_t completionStatus, - void *userData); /*!< Transfer complete callback */ -} i3c_master_transfer_callback_t; -/*! - * @brief Transfer option flags. - * - * @note These enumerations are intended to be OR'd together to form a bit mask of options for - * the #_i3c_master_transfer::flags field. - */ -enum _i3c_master_transfer_flags -{ - kI3C_TransferDefaultFlag = 0x00U, /*!< Transfer starts with a start signal, stops with a stop signal. */ - kI3C_TransferNoStartFlag = 0x01U, /*!< Don't send a start condition, address, and sub address */ - kI3C_TransferRepeatedStartFlag = 0x02U, /*!< Send a repeated start condition */ - kI3C_TransferNoStopFlag = 0x04U, /*!< Don't send a stop condition. */ - kI3C_TransferWordsFlag = 0x08U, /*!< Transfer in words, else transfer in bytes. */ - kI3C_TransferDisableRxTermFlag = 0x10U, /*!< Disable Rx termination. Note: It's for I3C CCC transfer. */ - kI3C_TransferRxAutoTermFlag = - 0x20U, /*!< Set Rx auto-termination. Note: It's adaptive based on Rx size(<=255 bytes) except in I3C_MasterReceive. */ - kI3C_TransferStartWithBroadcastAddr = 0x40U, /*!< Start transfer with 0x7E, then read/write data with device address. */ -}; - -/*! - * @brief Non-blocking transfer descriptor structure. - * - * This structure is used to pass transaction parameters to the I3C_MasterTransferNonBlocking() API. - */ -struct _i3c_master_transfer -{ - uint32_t flags; /*!< Bit mask of options for the transfer. See enumeration #_i3c_master_transfer_flags for available - options. Set to 0 or #kI3C_TransferDefaultFlag for normal transfers. */ - uint8_t slaveAddress; /*!< The 7-bit slave address. */ - i3c_direction_t direction; /*!< Either #kI3C_Read or #kI3C_Write. */ - uint32_t subaddress; /*!< Sub address. Transferred MSB first. */ - size_t subaddressSize; /*!< Length of sub address to send in bytes. Maximum size is 4 bytes. */ - void *data; /*!< Pointer to data to transfer. */ - size_t dataSize; /*!< Number of bytes to transfer. */ - i3c_bus_type_t busType; /*!< bus type. */ - i3c_ibi_response_t ibiResponse; /*!< ibi response during transfer. */ -}; - -/*! - * @brief Driver handle for master non-blocking APIs. - * @note The contents of this structure are private and subject to change. - */ -struct _i3c_master_handle -{ - uint8_t state; /*!< Transfer state machine current state. */ - uint32_t remainingBytes; /*!< Remaining byte count in current state. */ - i3c_rx_term_ops_t rxTermOps; /*!< Read termination operation. */ - i3c_master_transfer_t transfer; /*!< Copy of the current transfer info. */ - uint8_t ibiAddress; /*!< Slave address which request IBI. */ - uint8_t *ibiBuff; /*!< Pointer to IBI buffer to keep ibi bytes. */ - size_t ibiPayloadSize; /*!< IBI payload size. */ - i3c_ibi_type_t ibiType; /*!< IBI type. */ - i3c_master_transfer_callback_t callback; /*!< Callback functions pointer. */ - void *userData; /*!< Application data passed to callback. */ -}; - -/*! @brief Typedef for master interrupt handler. */ -typedef void (*i3c_master_isr_t)(I3C_Type *base, void *handle); - -/*! @} */ - -/*! - * @addtogroup i3c_slave_driver - * @{ - */ - -/*! - * @brief I3C slave peripheral flags. - * - * The following status register flags can be cleared: - * - #kI3C_SlaveBusStartFlag - * - #kI3C_SlaveMatchedFlag - * - #kI3C_SlaveBusStopFlag - * - * Only below flags can be enabled as interrupts. - * - #kI3C_SlaveBusStartFlag - * - #kI3C_SlaveMatchedFlag - * - #kI3C_SlaveBusStopFlag - * - #kI3C_SlaveRxReadyFlag - * - #kI3C_SlaveTxReadyFlag - * - #kI3C_SlaveDynamicAddrChangedFlag - * - #kI3C_SlaveReceivedCCCFlag - * - #kI3C_SlaveErrorFlag - * - #kI3C_SlaveHDRCommandMatchFlag - * - #kI3C_SlaveCCCHandledFlag - * - #kI3C_SlaveEventSentFlag - - * @note These enums are meant to be OR'd together to form a bit mask. - */ -enum _i3c_slave_flags -{ - kI3C_SlaveNotStopFlag = I3C_SSTATUS_STNOTSTOP_MASK, /*!< Slave status not stop flag */ - kI3C_SlaveMessageFlag = I3C_SSTATUS_STMSG_MASK, /*!< Slave status message, indicating slave is - listening to the bus traffic or responding */ - kI3C_SlaveRequiredReadFlag = I3C_SSTATUS_STREQRD_MASK, /*!< Slave status required, either is master doing SDR - read from slave, or is IBI pushing out. */ - kI3C_SlaveRequiredWriteFlag = I3C_SSTATUS_STREQWR_MASK, /*!< Slave status request write, master is doing SDR - write to slave, except slave in ENTDAA mode */ - kI3C_SlaveBusDAAFlag = I3C_SSTATUS_STDAA_MASK, /*!< I3C bus is in ENTDAA mode */ - kI3C_SlaveBusHDRModeFlag = I3C_SSTATUS_STHDR_MASK, /*!< I3C bus is in HDR mode */ - kI3C_SlaveBusStartFlag = I3C_SSTATUS_START_MASK, /*!< Start/Re-start event is seen since the bus was last cleared */ - kI3C_SlaveMatchedFlag = I3C_SSTATUS_MATCHED_MASK, /*!< Slave address(dynamic/static) matched since last cleared */ - kI3C_SlaveBusStopFlag = I3C_SSTATUS_STOP_MASK, /*!enableMaster = kI3C_MasterCapable; - * config->disableTimeout = false; - * config->hKeep = kI3C_MasterHighKeeperNone; - * config->enableOpenDrainStop = true; - * config->enableOpenDrainHigh = true; - * config->baudRate_Hz.i2cBaud = 400000U; - * config->baudRate_Hz.i3cPushPullBaud = 12500000U; - * config->baudRate_Hz.i3cOpenDrainBaud = 2500000U; - * config->masterDynamicAddress = 0x0AU; - * config->slowClock_Hz = 1000000U; - * config->enableSlave = true; - * config->vendorID = 0x11BU; - * config->enableRandomPart = false; - * config->partNumber = 0; - * config->dcr = 0; - * config->bcr = 0; - * config->hdrMode = (uint8_t)kI3C_HDRModeDDR; - * config->nakAllRequest = false; - * config->ignoreS0S1Error = false; - * config->offline = false; - * config->matchSlaveStartStop = false; - * @endcode - * - * After calling this function, you can override any settings in order to customize the configuration, - * prior to initializing the common I3C driver with I3C_Init(). - * - * @param[out] config User provided configuration structure for default values. Refer to #i3c_config_t. - */ -void I3C_GetDefaultConfig(i3c_config_t *config); - -/*! - * @brief Initializes the I3C peripheral. - * This function enables the peripheral clock and initializes the I3C peripheral as described by the user - * provided configuration. This will initialize both the master peripheral and slave peripheral so that I3C - * module could work as pure master, pure slave or secondary master, etc. - * A software reset is performed prior to configuration. - * - * @param base The I3C peripheral base address. - * @param config User provided peripheral configuration. Use I3C_GetDefaultConfig() to get a set of - * defaults that you can override. - * @param sourceClock_Hz Frequency in Hertz of the I3C functional clock. Used to calculate the baud rate divisors, - * filter widths, and timeout periods. - */ -void I3C_Init(I3C_Type *base, const i3c_config_t *config, uint32_t sourceClock_Hz); - -/*! @} */ - -/*! - * @addtogroup i3c_master_driver - * @{ - */ - -/*! @name Initialization and deinitialization */ -/*@{*/ - -/*! - * @brief Provides a default configuration for the I3C master peripheral. - * - * This function provides the following default configuration for the I3C master peripheral: - * @code - * masterConfig->enableMaster = kI3C_MasterOn; - * masterConfig->disableTimeout = false; - * masterConfig->hKeep = kI3C_MasterHighKeeperNone; - * masterConfig->enableOpenDrainStop = true; - * masterConfig->enableOpenDrainHigh = true; - * masterConfig->baudRate_Hz = 100000U; - * masterConfig->busType = kI3C_TypeI2C; - * @endcode - * - * After calling this function, you can override any settings in order to customize the configuration, - * prior to initializing the master driver with I3C_MasterInit(). - * - * @param[out] masterConfig User provided configuration structure for default values. Refer to #i3c_master_config_t. - */ -void I3C_MasterGetDefaultConfig(i3c_master_config_t *masterConfig); - -/*! - * @brief Initializes the I3C master peripheral. - * - * This function enables the peripheral clock and initializes the I3C master peripheral as described by the user - * provided configuration. A software reset is performed prior to configuration. - * - * @param base The I3C peripheral base address. - * @param masterConfig User provided peripheral configuration. Use I3C_MasterGetDefaultConfig() to get a set of - * defaults that you can override. - * @param sourceClock_Hz Frequency in Hertz of the I3C functional clock. Used to calculate the baud rate divisors, - * filter widths, and timeout periods. - */ -void I3C_MasterInit(I3C_Type *base, const i3c_master_config_t *masterConfig, uint32_t sourceClock_Hz); - -/*! - * @brief Deinitializes the I3C master peripheral. - * - * This function disables the I3C master peripheral and gates the clock. It also performs a software - * reset to restore the peripheral to reset conditions. - * - * @param base The I3C peripheral base address. - */ -void I3C_MasterDeinit(I3C_Type *base); - -/* Not static so it can be used from fsl_i3c_dma.c. */ -status_t I3C_MasterCheckAndClearError(I3C_Type *base, uint32_t status); - -/* Not static so it can be used from fsl_i3c_dma.c. */ -status_t I3C_MasterWaitForCtrlDone(I3C_Type *base, bool waitIdle); - -/* Not static so it can be used from fsl_i3c_dma.c. */ -status_t I3C_CheckForBusyBus(I3C_Type *base); - -/*! - * @brief Set I3C module master mode. - * - * @param base The I3C peripheral base address. - * @param enable Enable master mode. - */ -static inline void I3C_MasterEnable(I3C_Type *base, i3c_master_enable_t enable) -{ - base->MCONFIG = (base->MCONFIG & ~I3C_MCONFIG_MSTENA_MASK) | I3C_MCONFIG_MSTENA(enable); -} - -/*@}*/ - -/*! @name Status */ -/*@{*/ - -/*! - * @brief Gets the I3C master status flags. - * - * A bit mask with the state of all I3C master status flags is returned. For each flag, the corresponding bit - * in the return value is set if the flag is asserted. - * - * @param base The I3C peripheral base address. - * @return State of the status flags: - * - 1: related status flag is set. - * - 0: related status flag is not set. - * @see _i3c_master_flags - */ -static inline uint32_t I3C_MasterGetStatusFlags(I3C_Type *base) -{ - return base->MSTATUS & ~(I3C_MSTATUS_STATE_MASK | I3C_MSTATUS_IBITYPE_MASK); -} - -/*! - * @brief Clears the I3C master status flag state. - * - * The following status register flags can be cleared: - * - #kI3C_MasterSlaveStartFlag - * - #kI3C_MasterControlDoneFlag - * - #kI3C_MasterCompleteFlag - * - #kI3C_MasterArbitrationWonFlag - * - #kI3C_MasterSlave2MasterFlag - * - * Attempts to clear other flags has no effect. - * - * @param base The I3C peripheral base address. - * @param statusMask A bitmask of status flags that are to be cleared. The mask is composed of - * #_i3c_master_flags enumerators OR'd together. You may pass the result of a previous call to - * I3C_MasterGetStatusFlags(). - * @see _i3c_master_flags. - */ -static inline void I3C_MasterClearStatusFlags(I3C_Type *base, uint32_t statusMask) -{ - base->MSTATUS = statusMask; -} - -/*! - * @brief Gets the I3C master error status flags. - * - * A bit mask with the state of all I3C master error status flags is returned. For each flag, the corresponding bit - * in the return value is set if the flag is asserted. - * - * @param base The I3C peripheral base address. - * @return State of the error status flags: - * - 1: related status flag is set. - * - 0: related status flag is not set. - * @see _i3c_master_error_flags - */ -static inline uint32_t I3C_MasterGetErrorStatusFlags(I3C_Type *base) -{ - return base->MERRWARN; -} - -/*! - * @brief Clears the I3C master error status flag state. - * - * @param base The I3C peripheral base address. - * @param statusMask A bitmask of error status flags that are to be cleared. The mask is composed of - * #_i3c_master_error_flags enumerators OR'd together. You may pass the result of a previous call to - * I3C_MasterGetStatusFlags(). - * @see _i3c_master_error_flags. - */ -static inline void I3C_MasterClearErrorStatusFlags(I3C_Type *base, uint32_t statusMask) -{ - while ((base->MERRWARN & statusMask) != 0U) - { - base->MERRWARN = statusMask; - } -} - -/*! - * @brief Gets the I3C master state. - * - * @param base The I3C peripheral base address. - * @return I3C master state. - */ -i3c_master_state_t I3C_MasterGetState(I3C_Type *base); - -/*@}*/ - -/*! @name Interrupts */ -/*@{*/ - -/*! - * @brief Enables the I3C master interrupt requests. - * - * All flags except #kI3C_MasterBetweenFlag and #kI3C_MasterNackDetectFlag can be enabled as - * interrupts. - * - * @param base The I3C peripheral base address. - * @param interruptMask Bit mask of interrupts to enable. See #_i3c_master_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void I3C_MasterEnableInterrupts(I3C_Type *base, uint32_t interruptMask) -{ - base->MINTSET |= interruptMask; -} - -/*! - * @brief Disables the I3C master interrupt requests. - * - * All flags except #kI3C_MasterBetweenFlag and #kI3C_MasterNackDetectFlag can be enabled as - * interrupts. - * - * @param base The I3C peripheral base address. - * @param interruptMask Bit mask of interrupts to disable. See #_i3c_master_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void I3C_MasterDisableInterrupts(I3C_Type *base, uint32_t interruptMask) -{ - base->MINTCLR = interruptMask; -} - -/*! - * @brief Returns the set of currently enabled I3C master interrupt requests. - * - * @param base The I3C peripheral base address. - * @return A bitmask composed of #_i3c_master_flags enumerators OR'd together to indicate the - * set of enabled interrupts. - */ -static inline uint32_t I3C_MasterGetEnabledInterrupts(I3C_Type *base) -{ - return base->MINTSET; -} - -/*! - * @brief Returns the set of pending I3C master interrupt requests. - * - * @param base The I3C peripheral base address. - * @return A bitmask composed of #_i3c_master_flags enumerators OR'd together to indicate the - * set of pending interrupts. - */ -static inline uint32_t I3C_MasterGetPendingInterrupts(I3C_Type *base) -{ - return base->MINTMASKED; -} - -/*@}*/ - -/*! @name DMA control */ -/*@{*/ - -/*! - * @brief Enables or disables I3C master DMA requests. - * - * @param base The I3C peripheral base address. - * @param enableTx Enable flag for transmit DMA request. Pass true for enable, false for disable. - * @param enableRx Enable flag for receive DMA request. Pass true for enable, false for disable. - * @param width DMA read/write unit in bytes. - */ -static inline void I3C_MasterEnableDMA(I3C_Type *base, bool enableTx, bool enableRx, uint32_t width) -{ - assert(width <= 2U); - base->MDMACTRL = - I3C_MDMACTRL_DMAFB(enableRx ? 2U : 0U) | I3C_MDMACTRL_DMATB(enableTx ? 2U : 0U) | I3C_MDMACTRL_DMAWIDTH(width); -} - -/*! - * @brief Gets I3C master transmit data register address for DMA transfer. - * - * @param base The I3C peripheral base address. - * @param width DMA read/write unit in bytes. - * @return The I3C Master Transmit Data Register address. - */ -static inline uint32_t I3C_MasterGetTxFifoAddress(I3C_Type *base, uint32_t width) -{ - assert(width <= 2U); - return (uint32_t)((width == 2U) ? &base->MWDATAH : &base->MWDATAB); -} - -/*! - * @brief Gets I3C master receive data register address for DMA transfer. - * - * @param base The I3C peripheral base address. - * @param width DMA read/write unit in bytes. - * @return The I3C Master Receive Data Register address. - */ -static inline uint32_t I3C_MasterGetRxFifoAddress(I3C_Type *base, uint32_t width) -{ - assert(width <= 2U); - return (uint32_t)((width == 2U) ? &base->MRDATAH : &base->MRDATAB); -} - -/*@}*/ - -/*! @name FIFO control */ -/*@{*/ - -/*! - * @brief Sets the watermarks for I3C master FIFOs. - * - * @param base The I3C peripheral base address. - * @param txLvl Transmit FIFO watermark level. The #kI3C_MasterTxReadyFlag flag is set whenever - * the number of words in the transmit FIFO reaches @a txLvl. - * @param rxLvl Receive FIFO watermark level. The #kI3C_MasterRxReadyFlag flag is set whenever - * the number of words in the receive FIFO reaches @a rxLvl. - * @param flushTx true if TX FIFO is to be cleared, otherwise TX FIFO remains unchanged. - * @param flushRx true if RX FIFO is to be cleared, otherwise RX FIFO remains unchanged. - */ -static inline void I3C_MasterSetWatermarks( - I3C_Type *base, i3c_tx_trigger_level_t txLvl, i3c_rx_trigger_level_t rxLvl, bool flushTx, bool flushRx) -{ - base->MDATACTRL = I3C_MDATACTRL_UNLOCK_MASK | I3C_MDATACTRL_TXTRIG(txLvl) | I3C_MDATACTRL_RXTRIG(rxLvl) | - (flushTx ? I3C_MDATACTRL_FLUSHTB_MASK : 0U) | (flushRx ? I3C_MDATACTRL_FLUSHFB_MASK : 0U); -} - -/*! - * @brief Gets the current number of bytes in the I3C master FIFOs. - * - * @param base The I3C peripheral base address. - * @param[out] txCount Pointer through which the current number of bytes in the transmit FIFO is returned. - * Pass NULL if this value is not required. - * @param[out] rxCount Pointer through which the current number of bytes in the receive FIFO is returned. - * Pass NULL if this value is not required. - */ -static inline void I3C_MasterGetFifoCounts(I3C_Type *base, size_t *rxCount, size_t *txCount) -{ - if (NULL != txCount) - { - *txCount = (base->MDATACTRL & I3C_MDATACTRL_TXCOUNT_MASK) >> I3C_MDATACTRL_TXCOUNT_SHIFT; - } - if (NULL != rxCount) - { - *rxCount = (base->MDATACTRL & I3C_MDATACTRL_RXCOUNT_MASK) >> I3C_MDATACTRL_RXCOUNT_SHIFT; - } -} - -/*@}*/ - -/*! @name Bus operations */ -/*@{*/ - -/*! - * @brief Sets the I3C bus frequency for master transactions. - * - * The I3C master is automatically disabled and re-enabled as necessary to configure the baud - * rate. Do not call this function during a transfer, or the transfer is aborted. - * - * @param base The I3C peripheral base address. - * @param baudRate_Hz Pointer to structure of requested bus frequency in Hertz. - * @param sourceClock_Hz I3C functional clock frequency in Hertz. - */ -void I3C_MasterSetBaudRate(I3C_Type *base, const i3c_baudrate_hz_t *baudRate_Hz, uint32_t sourceClock_Hz); - -/*! - * @brief Returns whether the bus is idle. - * - * Requires the master mode to be enabled. - * - * @param base The I3C peripheral base address. - * @retval true Bus is busy. - * @retval false Bus is idle. - */ -static inline bool I3C_MasterGetBusIdleState(I3C_Type *base) -{ - return ((base->MSTATUS & I3C_MSTATUS_STATE_MASK) == (uint32_t)kI3C_MasterStateIdle ? true : false); -} - -/*! - * @brief Sends a START signal and slave address on the I2C/I3C bus, receive size is also specified - * in the call. - * - * This function is used to initiate a new master mode transfer. First, the bus state is checked to ensure - * that another master is not occupying the bus. Then a START signal is transmitted, followed by the - * 7-bit address specified in the a address parameter. Note that this function does not actually wait - * until the START and address are successfully sent on the bus before returning. - * - * @param base The I3C peripheral base address. - * @param type The bus type to use in this transaction. - * @param address 7-bit slave device address, in bits [6:0]. - * @param dir Master transfer direction, either #kI3C_Read or #kI3C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * @param rxSize Read terminate size for the followed read transfer, limit to 255 bytes. - * @retval #kStatus_Success START signal and address were successfully enqueued in the transmit FIFO. - * @retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - */ -status_t I3C_MasterStartWithRxSize( - I3C_Type *base, i3c_bus_type_t type, uint8_t address, i3c_direction_t dir, uint8_t rxSize); - -/*! - * @brief Sends a START signal and slave address on the I2C/I3C bus. - * - * This function is used to initiate a new master mode transfer. First, the bus state is checked to ensure - * that another master is not occupying the bus. Then a START signal is transmitted, followed by the - * 7-bit address specified in the @a address parameter. Note that this function does not actually wait - * until the START and address are successfully sent on the bus before returning. - * - * @param base The I3C peripheral base address. - * @param type The bus type to use in this transaction. - * @param address 7-bit slave device address, in bits [6:0]. - * @param dir Master transfer direction, either #kI3C_Read or #kI3C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * @retval #kStatus_Success START signal and address were successfully enqueued in the transmit FIFO. - * @retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - */ -status_t I3C_MasterStart(I3C_Type *base, i3c_bus_type_t type, uint8_t address, i3c_direction_t dir); - -/*! - * @brief Sends a repeated START signal and slave address on the I2C/I3C bus, receive size is also specified - * in the call. - * - * This function is used to send a Repeated START signal when a transfer is already in progress. Like - * I3C_MasterStart(), it also sends the specified 7-bit address. Call this API also configures the read - * terminate size for the following read transfer. For example, set the rxSize = 2, the following read transfer - * will be terminated after two bytes of data received. Write transfer will not be affected by the rxSize - * configuration. - * - * @note This function exists primarily to maintain compatible APIs between I3C and I2C drivers, - * as well as to better document the intent of code that uses these APIs. - * - * @param base The I3C peripheral base address. - * @param type The bus type to use in this transaction. - * @param address 7-bit slave device address, in bits [6:0]. - * @param dir Master transfer direction, either #kI3C_Read or #kI3C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * @param rxSize Read terminate size for the followed read transfer, limit to 255 bytes. - * @retval #kStatus_Success Repeated START signal and address were successfully enqueued in the transmit FIFO. - */ -status_t I3C_MasterRepeatedStartWithRxSize( - I3C_Type *base, i3c_bus_type_t type, uint8_t address, i3c_direction_t dir, uint8_t rxSize); - -/*! - * @brief Sends a repeated START signal and slave address on the I2C/I3C bus. - * - * This function is used to send a Repeated START signal when a transfer is already in progress. Like - * I3C_MasterStart(), it also sends the specified 7-bit address. - * - * @note This function exists primarily to maintain compatible APIs between I3C and I2C drivers, - * as well as to better document the intent of code that uses these APIs. - * - * @param base The I3C peripheral base address. - * @param type The bus type to use in this transaction. - * @param address 7-bit slave device address, in bits [6:0]. - * @param dir Master transfer direction, either #kI3C_Read or #kI3C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * @retval #kStatus_Success Repeated START signal and address were successfully enqueued in the transmit FIFO. - */ -static inline status_t I3C_MasterRepeatedStart(I3C_Type *base, - i3c_bus_type_t type, - uint8_t address, - i3c_direction_t dir) -{ - return I3C_MasterRepeatedStartWithRxSize(base, type, address, dir, 0); -} - -/*! - * @brief Performs a polling send transfer on the I2C/I3C bus. - * - * Sends up to @a txSize number of bytes to the previously addressed slave device. The slave may - * reply with a NAK to any byte in order to terminate the transfer early. If this happens, this - * function returns #kStatus_I3C_Nak. - * - * @param base The I3C peripheral base address. - * @param txBuff The pointer to the data to be transferred. - * @param txSize The length in bytes of the data to be transferred. - * @param flags Bit mask of options for the transfer. See enumeration #_i3c_master_transfer_flags for available options. - * @retval #kStatus_Success Data was sent successfully. - * @retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_I3C_Timeout The module has stalled too long in a frame. - * @retval #kStatus_I3C_Nak The slave device sent a NAK in response to an address. - * @retval #kStatus_I3C_WriteAbort The slave device sent a NAK in response to a write. - * @retval #kStatus_I3C_MsgError Message SDR/DDR mismatch or read/write message in wrong state. - * @retval #kStatus_I3C_WriteFifoError Write to M/SWDATAB register when FIFO full. - * @retval #kStatus_I3C_InvalidReq Invalid use of request. - */ -status_t I3C_MasterSend(I3C_Type *base, const void *txBuff, size_t txSize, uint32_t flags); - -/*! - * @brief Performs a polling receive transfer on the I2C/I3C bus. - * - * @param base The I3C peripheral base address. - * @param rxBuff The pointer to the data to be transferred. - * @param rxSize The length in bytes of the data to be transferred. - * @param flags Bit mask of options for the transfer. See enumeration #_i3c_master_transfer_flags for available options. - * @retval #kStatus_Success Data was received successfully. - * @retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_I3C_Timeout The module has stalled too long in a frame. - * @retval #kStatus_I3C_Term The master terminates slave read. - * @retval #kStatus_I3C_HdrParityError Parity error from DDR read. - * @retval #kStatus_I3C_CrcError CRC error from DDR read. - * @retval #kStatus_I3C_MsgError Message SDR/DDR mismatch or read/write message in wrong state. - * @retval #kStatus_I3C_ReadFifoError Read from M/SRDATAB register when FIFO empty. - * @retval #kStatus_I3C_InvalidReq Invalid use of request. - */ -status_t I3C_MasterReceive(I3C_Type *base, void *rxBuff, size_t rxSize, uint32_t flags); - -/*! - * @brief Sends a STOP signal on the I2C/I3C bus. - * - * This function does not return until the STOP signal is seen on the bus, or an error occurs. - * - * @param base The I3C peripheral base address. - * @retval #kStatus_Success The STOP signal was successfully sent on the bus and the transaction terminated. - * @retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_I3C_Timeout The module has stalled too long in a frame. - * @retval #kStatus_I3C_InvalidReq Invalid use of request. - */ -status_t I3C_MasterStop(I3C_Type *base); - -/*! - * @brief I3C master emit request. - * - * @param base The I3C peripheral base address. - * @param masterReq I3C master request of type #i3c_bus_request_t - */ -void I3C_MasterEmitRequest(I3C_Type *base, i3c_bus_request_t masterReq); - -/*! - * @brief I3C master emit request. - * - * @param base The I3C peripheral base address. - * @param ibiResponse I3C master emit IBI response of type #i3c_ibi_response_t - */ -static inline void I3C_MasterEmitIBIResponse(I3C_Type *base, i3c_ibi_response_t ibiResponse) -{ - uint32_t ctrlVal = base->MCTRL; - ctrlVal &= ~(I3C_MCTRL_IBIRESP_MASK | I3C_MCTRL_REQUEST_MASK); - ctrlVal |= I3C_MCTRL_IBIRESP((uint32_t)ibiResponse) | I3C_MCTRL_REQUEST(kI3C_RequestIbiAckNack); - base->MCTRL = ctrlVal; -} - -/*! - * @brief I3C master register IBI rule. - * - * @param base The I3C peripheral base address. - * @param ibiRule Pointer to ibi rule description of type #i3c_register_ibi_addr_t - */ -void I3C_MasterRegisterIBI(I3C_Type *base, i3c_register_ibi_addr_t *ibiRule); - -/*! - * @brief I3C master get IBI rule. - * - * @param base The I3C peripheral base address. - * @param ibiRule Pointer to store the read out ibi rule description. - */ -void I3C_MasterGetIBIRules(I3C_Type *base, i3c_register_ibi_addr_t *ibiRule); - -/*! - * @brief I3C master get IBI Type. - * - * @param base The I3C peripheral base address. - * @retval i3c_ibi_type_t Type of #i3c_ibi_type_t. - */ -i3c_ibi_type_t I3C_GetIBIType(I3C_Type *base); - -/*! - * @brief I3C master get IBI Address. - * - * @param base The I3C peripheral base address. - * @retval The 8-bit IBI address. - */ -static inline uint8_t I3C_GetIBIAddress(I3C_Type *base) -{ - return (uint8_t)((base->MSTATUS & I3C_MSTATUS_IBIADDR_MASK) >> I3C_MSTATUS_IBIADDR_SHIFT); -} - -/*! - * @brief Performs a DAA in the i3c bus with specified temporary baud rate. - * - * @param base The I3C peripheral base address. - * @param addressList The pointer for address list which is used to do DAA. - * @param count The address count in the address list. - * @param daaBaudRate The temporary baud rate in DAA process, NULL for using initial setting. - * The initial setting is set back between the completion of the DAA and the return of this function. - * @retval #kStatus_Success The transaction was started successfully. - * @retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - * @retval #kStatus_I3C_SlaveCountExceed The I3C slave count has exceed the definition in I3C_MAX_DEVCNT. - */ -status_t I3C_MasterProcessDAASpecifiedBaudrate(I3C_Type *base, - uint8_t *addressList, - uint32_t count, - i3c_master_daa_baudrate_t *daaBaudRate); - -/*! - * @brief Performs a DAA in the i3c bus. - * - * @param base The I3C peripheral base address. - * @param addressList The pointer for address list which is used to do DAA. - * @param count The address count in the address list. - * The initial setting is set back between the completion of the DAA and the return of this function. - * @retval #kStatus_Success The transaction was started successfully. - * @retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - * @retval #kStatus_I3C_SlaveCountExceed The I3C slave count has exceed the definition in I3C_MAX_DEVCNT. - */ -static inline status_t I3C_MasterProcessDAA(I3C_Type *base, uint8_t *addressList, uint32_t count) -{ - return I3C_MasterProcessDAASpecifiedBaudrate(base, addressList, count, NULL); -} - -/*! - * @brief Get device information list after DAA process is done. - * - * @param base The I3C peripheral base address. - * @param[out] count The pointer to store the available device count. - * @return Pointer to the i3c_device_info_t array. - */ -i3c_device_info_t *I3C_MasterGetDeviceListAfterDAA(I3C_Type *base, uint8_t *count); -/*! - * @brief Performs a master polling transfer on the I2C/I3C bus. - * - * @note The API does not return until the transfer succeeds or fails due - * to error happens during transfer. - * - * @param base The I3C peripheral base address. - * @param transfer Pointer to the transfer structure. - * @retval #kStatus_Success Data was received successfully. - * @retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_I3C_IBIWon The I3C slave event IBI or MR or HJ won the arbitration on a header address. - * @retval #kStatus_I3C_Timeout The module has stalled too long in a frame. - * @retval #kStatus_I3C_Nak The slave device sent a NAK in response to an address. - * @retval #kStatus_I3C_WriteAbort The slave device sent a NAK in response to a write. - * @retval #kStatus_I3C_Term The master terminates slave read. - * @retval #kStatus_I3C_HdrParityError Parity error from DDR read. - * @retval #kStatus_I3C_CrcError CRC error from DDR read. - * @retval #kStatus_I3C_MsgError Message SDR/DDR mismatch or read/write message in wrong state. - * @retval #kStatus_I3C_ReadFifoError Read from M/SRDATAB register when FIFO empty. - * @retval #kStatus_I3C_WriteFifoError Write to M/SWDATAB register when FIFO full. - * @retval #kStatus_I3C_InvalidReq Invalid use of request. - */ -status_t I3C_MasterTransferBlocking(I3C_Type *base, i3c_master_transfer_t *transfer); - -/*@}*/ - -/*! @name Non-blocking */ -/*@{*/ - -/*! - * @brief Creates a new handle for the I3C master non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the I3C_MasterTransferAbort() API shall be called. - * - * - * @note The function also enables the NVIC IRQ for the input I3C. Need to notice - * that on some SoCs the I3C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - * - * @param base The I3C peripheral base address. - * @param[out] handle Pointer to the I3C master driver handle. - * @param callback User provided pointer to the asynchronous callback function. - * @param userData User provided pointer to the application callback data. - */ -void I3C_MasterTransferCreateHandle(I3C_Type *base, - i3c_master_handle_t *handle, - const i3c_master_transfer_callback_t *callback, - void *userData); - -/*! - * @brief Performs a non-blocking transaction on the I2C/I3C bus. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C master driver handle. - * @param transfer The pointer to the transfer descriptor. - * @retval #kStatus_Success The transaction was started successfully. - * @retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - */ -status_t I3C_MasterTransferNonBlocking(I3C_Type *base, i3c_master_handle_t *handle, i3c_master_transfer_t *transfer); - -/*! - * @brief Returns number of bytes transferred so far. - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C master driver handle. - * @param[out] count Number of bytes transferred so far by the non-blocking transaction. - * @retval #kStatus_Success - * @retval #kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t I3C_MasterTransferGetCount(I3C_Type *base, i3c_master_handle_t *handle, size_t *count); - -/*! - * @brief Terminates a non-blocking I3C master transmission early. - * - * @note It is not safe to call this function from an IRQ handler that has a higher priority than the - * I3C peripheral's IRQ priority. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C master driver handle. - * @retval #kStatus_Success A transaction was successfully aborted. - * @retval #kStatus_I3C_Idle There is not a non-blocking transaction currently in progress. - */ -void I3C_MasterTransferAbort(I3C_Type *base, i3c_master_handle_t *handle); - -/*@}*/ - -/*! @name IRQ handler */ -/*@{*/ - -/*! - * @brief Reusable routine to handle master interrupts. - * @note This function does not need to be called unless you are reimplementing the - * nonblocking API's interrupt handler routines to add special functionality. - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C master driver handle. - */ -void I3C_MasterTransferHandleIRQ(I3C_Type *base, void *intHandle); - -/*@}*/ - -/*! @} */ - -/*! - * @addtogroup i3c_slave_driver - * @{ - */ - -/*! @name Initialization and deinitialization */ -/*@{*/ - -/*! - * @brief Provides a default configuration for the I3C slave peripheral. - * - * This function provides the following default configuration for the I3C slave peripheral: - * @code - * slaveConfig->enableslave = true; - * @endcode - * - * After calling this function, you can override any settings in order to customize the configuration, - * prior to initializing the slave driver with I3C_SlaveInit(). - * - * @param[out] slaveConfig User provided configuration structure for default values. Refer to #i3c_slave_config_t. - */ -void I3C_SlaveGetDefaultConfig(i3c_slave_config_t *slaveConfig); - -/*! - * @brief Initializes the I3C slave peripheral. - * - * This function enables the peripheral clock and initializes the I3C slave peripheral as described by the user - * provided configuration. - * - * @param base The I3C peripheral base address. - * @param slaveConfig User provided peripheral configuration. Use I3C_SlaveGetDefaultConfig() to get a set of - * defaults that you can override. - * @param slowClock_Hz Frequency in Hertz of the I3C slow clock. Used to calculate the bus match condition values. - */ -void I3C_SlaveInit(I3C_Type *base, const i3c_slave_config_t *slaveConfig, uint32_t slowClock_Hz); - -/*! - * @brief Deinitializes the I3C slave peripheral. - * - * This function disables the I3C slave peripheral and gates the clock. - * - * @param base The I3C peripheral base address. - */ -void I3C_SlaveDeinit(I3C_Type *base); - -/*! - * @brief Enable/Disable Slave. - * - * @param base The I3C peripheral base address. - * @param isEnable Enable or disable. - */ -static inline void I3C_SlaveEnable(I3C_Type *base, bool isEnable) -{ - base->SCONFIG = (base->SCONFIG & ~I3C_SCONFIG_SLVENA_MASK) | I3C_SCONFIG_SLVENA(isEnable); -} - -/*@}*/ - -/*! @name Status */ -/*@{*/ - -/*! - * @brief Gets the I3C slave status flags. - * - * A bit mask with the state of all I3C slave status flags is returned. For each flag, the corresponding bit - * in the return value is set if the flag is asserted. - * - * @param base The I3C peripheral base address. - * @return State of the status flags: - * - 1: related status flag is set. - * - 0: related status flag is not set. - * @see _i3c_slave_flags - */ -static inline uint32_t I3C_SlaveGetStatusFlags(I3C_Type *base) -{ - return base->SSTATUS & ~(I3C_SSTATUS_EVDET_MASK | I3C_SSTATUS_ACTSTATE_MASK | I3C_SSTATUS_TIMECTRL_MASK); -} - -/*! - * @brief Clears the I3C slave status flag state. - * - * The following status register flags can be cleared: - * - #kI3C_SlaveBusStartFlag - * - #kI3C_SlaveMatchedFlag - * - #kI3C_SlaveBusStopFlag - * - * Attempts to clear other flags has no effect. - * - * @param base The I3C peripheral base address. - * @param statusMask A bitmask of status flags that are to be cleared. The mask is composed of - * #_i3c_slave_flags enumerators OR'd together. You may pass the result of a previous call to - * I3C_SlaveGetStatusFlags(). - * @see _i3c_slave_flags. - */ -static inline void I3C_SlaveClearStatusFlags(I3C_Type *base, uint32_t statusMask) -{ - base->SSTATUS = statusMask; -} - -/*! - * @brief Gets the I3C slave error status flags. - * - * A bit mask with the state of all I3C slave error status flags is returned. For each flag, the corresponding bit - * in the return value is set if the flag is asserted. - * - * @param base The I3C peripheral base address. - * @return State of the error status flags: - * - 1: related status flag is set. - * - 0: related status flag is not set. - * @see _i3c_slave_error_flags - */ -static inline uint32_t I3C_SlaveGetErrorStatusFlags(I3C_Type *base) -{ - return base->SERRWARN; -} - -/*! - * @brief Clears the I3C slave error status flag state. - * - * @param base The I3C peripheral base address. - * @param statusMask A bitmask of error status flags that are to be cleared. The mask is composed of - * #_i3c_slave_error_flags enumerators OR'd together. You may pass the result of a previous call to - * I3C_SlaveGetErrorStatusFlags(). - * @see _i3c_slave_error_flags. - */ -static inline void I3C_SlaveClearErrorStatusFlags(I3C_Type *base, uint32_t statusMask) -{ - base->SERRWARN = statusMask; -} - -/*! - * @brief Gets the I3C slave state. - * - * @param base The I3C peripheral base address. - * @return I3C slave activity state, refer #i3c_slave_activity_state_t. - */ -i3c_slave_activity_state_t I3C_SlaveGetActivityState(I3C_Type *base); - -/* Not static so it can be used from fsl_i3c_dma.c. */ -status_t I3C_SlaveCheckAndClearError(I3C_Type *base, uint32_t status); -/*@}*/ - -/*! @name Interrupts */ -/*@{*/ - -/*! - * @brief Enables the I3C slave interrupt requests. - * - * Only below flags can be enabled as interrupts. - * - #kI3C_SlaveBusStartFlag - * - #kI3C_SlaveMatchedFlag - * - #kI3C_SlaveBusStopFlag - * - #kI3C_SlaveRxReadyFlag - * - #kI3C_SlaveTxReadyFlag - * - #kI3C_SlaveDynamicAddrChangedFlag - * - #kI3C_SlaveReceivedCCCFlag - * - #kI3C_SlaveErrorFlag - * - #kI3C_SlaveHDRCommandMatchFlag - * - #kI3C_SlaveCCCHandledFlag - * - #kI3C_SlaveEventSentFlag - * - * @param base The I3C peripheral base address. - * @param interruptMask Bit mask of interrupts to enable. See #_i3c_slave_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void I3C_SlaveEnableInterrupts(I3C_Type *base, uint32_t interruptMask) -{ - base->SINTSET |= interruptMask; -} - -/*! - * @brief Disables the I3C slave interrupt requests. - * - * Only below flags can be disabled as interrupts. - * - #kI3C_SlaveBusStartFlag - * - #kI3C_SlaveMatchedFlag - * - #kI3C_SlaveBusStopFlag - * - #kI3C_SlaveRxReadyFlag - * - #kI3C_SlaveTxReadyFlag - * - #kI3C_SlaveDynamicAddrChangedFlag - * - #kI3C_SlaveReceivedCCCFlag - * - #kI3C_SlaveErrorFlag - * - #kI3C_SlaveHDRCommandMatchFlag - * - #kI3C_SlaveCCCHandledFlag - * - #kI3C_SlaveEventSentFlag - * - * @param base The I3C peripheral base address. - * @param interruptMask Bit mask of interrupts to disable. See #_i3c_slave_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void I3C_SlaveDisableInterrupts(I3C_Type *base, uint32_t interruptMask) -{ - base->SINTCLR = interruptMask; -} - -/*! - * @brief Returns the set of currently enabled I3C slave interrupt requests. - * - * @param base The I3C peripheral base address. - * @return A bitmask composed of #_i3c_slave_flags enumerators OR'd together to indicate the - * set of enabled interrupts. - */ -static inline uint32_t I3C_SlaveGetEnabledInterrupts(I3C_Type *base) -{ - return base->SINTSET; -} - -/*! - * @brief Returns the set of pending I3C slave interrupt requests. - * - * @param base The I3C peripheral base address. - * @return A bitmask composed of #_i3c_slave_flags enumerators OR'd together to indicate the - * set of pending interrupts. - */ -static inline uint32_t I3C_SlaveGetPendingInterrupts(I3C_Type *base) -{ - return base->SINTMASKED; -} - -/*@}*/ - -/*! @name DMA control */ -/*@{*/ - -/*! - * @brief Enables or disables I3C slave DMA requests. - * - * @param base The I3C peripheral base address. - * @param enableTx Enable flag for transmit DMA request. Pass true for enable, false for disable. - * @param enableRx Enable flag for receive DMA request. Pass true for enable, false for disable. - * @param width DMA read/write unit in bytes. - */ -static inline void I3C_SlaveEnableDMA(I3C_Type *base, bool enableTx, bool enableRx, uint32_t width) -{ - assert(width <= 2U); - base->SDMACTRL = - I3C_SDMACTRL_DMAFB(enableRx ? 2U : 0U) | I3C_SDMACTRL_DMATB(enableTx ? 2U : 0U) | I3C_SDMACTRL_DMAWIDTH(width); -} - -/*! - * @brief Gets I3C slave transmit data register address for DMA transfer. - * - * @param base The I3C peripheral base address. - * @param width DMA read/write unit in bytes. - * @return The I3C Slave Transmit Data Register address. - */ -static inline uint32_t I3C_SlaveGetTxFifoAddress(I3C_Type *base, uint32_t width) -{ - assert(width <= 2U); - return (uint32_t)((width == 2U) ? &base->SWDATAH : &base->SWDATAB); -} - -/*! - * @brief Gets I3C slave receive data register address for DMA transfer. - * - * @param base The I3C peripheral base address. - * @param width DMA read/write unit in bytes. - * @return The I3C Slave Receive Data Register address. - */ -static inline uint32_t I3C_SlaveGetRxFifoAddress(I3C_Type *base, uint32_t width) -{ - assert(width <= 2U); - return (uint32_t)((width == 2U) ? &base->SRDATAH : &base->SRDATAB); -} - -/*@}*/ - -/*! @name FIFO control */ -/*@{*/ - -/*! - * @brief Sets the watermarks for I3C slave FIFOs. - * - * @param base The I3C peripheral base address. - * @param txLvl Transmit FIFO watermark level. The #kI3C_SlaveTxReadyFlag flag is set whenever - * the number of words in the transmit FIFO reaches @a txLvl. - * @param rxLvl Receive FIFO watermark level. The #kI3C_SlaveRxReadyFlag flag is set whenever - * the number of words in the receive FIFO reaches @a rxLvl. - * @param flushTx true if TX FIFO is to be cleared, otherwise TX FIFO remains unchanged. - * @param flushRx true if RX FIFO is to be cleared, otherwise RX FIFO remains unchanged. - */ -static inline void I3C_SlaveSetWatermarks( - I3C_Type *base, i3c_tx_trigger_level_t txLvl, i3c_rx_trigger_level_t rxLvl, bool flushTx, bool flushRx) -{ - base->SDATACTRL = I3C_SDATACTRL_UNLOCK_MASK | I3C_SDATACTRL_TXTRIG(txLvl) | I3C_SDATACTRL_RXTRIG(rxLvl) | - (flushTx ? I3C_SDATACTRL_FLUSHTB_MASK : 0U) | (flushRx ? I3C_SDATACTRL_FLUSHFB_MASK : 0U); -} - -/*! - * @brief Gets the current number of bytes in the I3C slave FIFOs. - * - * @param base The I3C peripheral base address. - * @param[out] txCount Pointer through which the current number of bytes in the transmit FIFO is returned. - * Pass NULL if this value is not required. - * @param[out] rxCount Pointer through which the current number of bytes in the receive FIFO is returned. - * Pass NULL if this value is not required. - */ -static inline void I3C_SlaveGetFifoCounts(I3C_Type *base, size_t *rxCount, size_t *txCount) -{ - if (NULL != txCount) - { - *txCount = (base->SDATACTRL & I3C_SDATACTRL_TXCOUNT_MASK) >> I3C_SDATACTRL_TXCOUNT_SHIFT; - } - if (NULL != rxCount) - { - *rxCount = (base->SDATACTRL & I3C_SDATACTRL_RXCOUNT_MASK) >> I3C_SDATACTRL_RXCOUNT_SHIFT; - } -} - -/*@}*/ - -/*! @name Bus operations */ -/*@{*/ - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) && FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) -/*! - * @brief I3C slave request event. - * - * @param base The I3C peripheral base address. - * @param event I3C slave event of type #i3c_slave_event_t - */ -void I3C_SlaveRequestEvent(I3C_Type *base, i3c_slave_event_t event); -#endif - -/*! - * @brief Performs a polling send transfer on the I3C bus. - * - * @param base The I3C peripheral base address. - * @param txBuff The pointer to the data to be transferred. - * @param txSize The length in bytes of the data to be transferred. - * @return Error or success status returned by API. - */ -status_t I3C_SlaveSend(I3C_Type *base, const void *txBuff, size_t txSize); - -/*! - * @brief Performs a polling receive transfer on the I3C bus. - * - * @param base The I3C peripheral base address. - * @param rxBuff The pointer to the data to be transferred. - * @param rxSize The length in bytes of the data to be transferred. - * @return Error or success status returned by API. - */ -status_t I3C_SlaveReceive(I3C_Type *base, void *rxBuff, size_t rxSize); - -/*@}*/ - -/*! @name Slave non-blocking */ -/*@{*/ - -/*! - * @brief Creates a new handle for the I3C slave non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the I3C_SlaveTransferAbort() API shall be called. - * - * @note The function also enables the NVIC IRQ for the input I3C. Need to notice - * that on some SoCs the I3C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - - * @param base The I3C peripheral base address. - * @param[out] handle Pointer to the I3C slave driver handle. - * @param callback User provided pointer to the asynchronous callback function. - * @param userData User provided pointer to the application callback data. - */ -void I3C_SlaveTransferCreateHandle(I3C_Type *base, - i3c_slave_handle_t *handle, - i3c_slave_transfer_callback_t callback, - void *userData); - -/*! - * @brief Starts accepting slave transfers. - * - * Call this API after calling I2C_SlaveInit() and I3C_SlaveTransferCreateHandle() to start processing - * transactions driven by an I2C master. The slave monitors the I2C bus and pass events to the - * callback that was passed into the call to I3C_SlaveTransferCreateHandle(). The callback is always invoked - * from the interrupt context. - * - * The set of events received by the callback is customizable. To do so, set the @a eventMask parameter to - * the OR'd combination of #i3c_slave_transfer_event_t enumerators for the events you wish to receive. - * The #kI3C_SlaveTransmitEvent and #kI3C_SlaveReceiveEvent events are always enabled and do not need - * to be included in the mask. Alternatively, you can pass 0 to get a default set of only the transmit and - * receive events that are always enabled. In addition, the #kI3C_SlaveAllEvents constant is provided as - * a convenient way to enable all events. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to struct: _i3c_slave_handle structure which stores the transfer state. - * @param eventMask Bit mask formed by OR'ing together #i3c_slave_transfer_event_t enumerators to specify - * which events to send to the callback. Other accepted values are 0 to get a default set of - * only the transmit and receive events, and #kI3C_SlaveAllEvents to enable all events. - * - * @retval #kStatus_Success Slave transfers were successfully started. - * @retval #kStatus_I3C_Busy Slave transfers have already been started on this handle. - */ -status_t I3C_SlaveTransferNonBlocking(I3C_Type *base, i3c_slave_handle_t *handle, uint32_t eventMask); - -/*! - * @brief Gets the slave transfer status during a non-blocking transfer. - * @param base The I3C peripheral base address. - * @param handle Pointer to i2c_slave_handle_t structure. - * @param[out] count Pointer to a value to hold the number of bytes transferred. May be NULL if the count is not - * required. - * @retval #kStatus_Success - * @retval #kStatus_NoTransferInProgress - */ -status_t I3C_SlaveTransferGetCount(I3C_Type *base, i3c_slave_handle_t *handle, size_t *count); - -/*! - * @brief Aborts the slave non-blocking transfers. - * @note This API could be called at any time to stop slave for handling the bus events. - * @param base The I3C peripheral base address. - * @param handle Pointer to struct: _i3c_slave_handle structure which stores the transfer state. - * @retval #kStatus_Success - * @retval #kStatus_I3C_Idle - */ -void I3C_SlaveTransferAbort(I3C_Type *base, i3c_slave_handle_t *handle); - -/*@}*/ - -/*! @name Slave IRQ handler */ -/*@{*/ - -/*! - * @brief Reusable routine to handle slave interrupts. - * @note This function does not need to be called unless you are reimplementing the - * non blocking API's interrupt handler routines to add special functionality. - * @param base The I3C peripheral base address. - * @param handle Pointer to struct: _i3c_slave_handle structure which stores the transfer state. - */ -void I3C_SlaveTransferHandleIRQ(I3C_Type *base, void *intHandle); - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) && FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) -/*! - * @brief I3C slave request IBI event with data payload(mandatory and extended). - * - * @param base The I3C peripheral base address. - * @param data Pointer to IBI data to be sent in the request. - * @param dataSize IBI data size. - */ -void I3C_SlaveRequestIBIWithData(I3C_Type *base, uint8_t *data, size_t dataSize); - -/*! - * @brief I3C slave request IBI event with single data. - * @deprecated Do not use this function. It has been superseded by @ref I3C_SlaveRequestIBIWithData. - * - * @param base The I3C peripheral base address. - * @param data IBI data to be sent in the request. - * @param dataSize IBI data size. - */ -void I3C_SlaveRequestIBIWithSingleData(I3C_Type *base, uint8_t data, size_t dataSize); -#endif /* !(defined(FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) && FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) */ - -/*@}*/ -/*! @} */ -#if defined(__cplusplus) -} -#endif - -#endif /* FSL_I3C_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_i3c_edma.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_i3c_edma.c deleted file mode 100644 index 010cdc7ee05..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_i3c_edma.c +++ /dev/null @@ -1,1055 +0,0 @@ -/* - * Copyright 2022-2023 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_i3c_edma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.i3c_edma" -#endif - -/*! @brief States for the state machine used by transactional APIs. */ -enum _i3c_edma_transfer_states -{ - kIdleState = 0, - kIBIWonState, - kSlaveStartState, - kSendCommandState, - kWaitRepeatedStartCompleteState, - kTransmitDataState, - kReceiveDataState, - kStopState, - kWaitForCompletionState, - kAddressMatchState, -}; - -/*! @brief Common sets of flags used by the driver. */ -enum _i3c_edma_flag_constants -{ - /*! All flags which are cleared by the driver upon starting a transfer. */ - kMasterClearFlags = kI3C_MasterSlaveStartFlag | kI3C_MasterControlDoneFlag | kI3C_MasterCompleteFlag | - kI3C_MasterArbitrationWonFlag | kI3C_MasterSlave2MasterFlag | kI3C_MasterErrorFlag, - - /*! IRQ sources enabled by the non-blocking transactional API. */ - kMasterDMAIrqFlags = kI3C_MasterSlaveStartFlag | kI3C_MasterControlDoneFlag | kI3C_MasterCompleteFlag | - kI3C_MasterArbitrationWonFlag | kI3C_MasterErrorFlag | kI3C_MasterSlave2MasterFlag, - - /*! Errors to check for. */ - kMasterErrorFlags = kI3C_MasterErrorNackFlag | kI3C_MasterErrorWriteAbortFlag | -#if !defined(FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) || (!FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) - kI3C_MasterErrorTermFlag | -#endif - kI3C_MasterErrorParityFlag | kI3C_MasterErrorCrcFlag | kI3C_MasterErrorReadFlag | - kI3C_MasterErrorWriteFlag | kI3C_MasterErrorMsgFlag | kI3C_MasterErrorInvalidReqFlag | - kI3C_MasterErrorTimeoutFlag, - /*! All flags which are cleared by the driver upon starting a transfer. */ - kSlaveClearFlags = kI3C_SlaveBusStartFlag | kI3C_SlaveMatchedFlag | kI3C_SlaveBusStopFlag, - - /*! IRQ sources enabled by the non-blocking transactional API. */ - kSlaveDMAIrqFlags = kI3C_SlaveBusStartFlag | kI3C_SlaveMatchedFlag | - kI3C_SlaveBusStopFlag | /*kI3C_SlaveRxReadyFlag |*/ - kI3C_SlaveDynamicAddrChangedFlag | kI3C_SlaveReceivedCCCFlag | kI3C_SlaveErrorFlag | - kI3C_SlaveHDRCommandMatchFlag | kI3C_SlaveCCCHandledFlag | kI3C_SlaveEventSentFlag, - - /*! Errors to check for. */ - kSlaveErrorFlags = kI3C_SlaveErrorOverrunFlag | kI3C_SlaveErrorUnderrunFlag | kI3C_SlaveErrorUnderrunNakFlag | - kI3C_SlaveErrorTermFlag | kI3C_SlaveErrorInvalidStartFlag | kI3C_SlaveErrorSdrParityFlag | - kI3C_SlaveErrorHdrParityFlag | kI3C_SlaveErrorHdrCRCFlag | kI3C_SlaveErrorS0S1Flag | - kI3C_SlaveErrorOverreadFlag | kI3C_SlaveErrorOverwriteFlag, -}; -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Array to map I3C instance number to base pointer. */ -static I3C_Type *const kI3cBases[] = I3C_BASE_PTRS; - -/*! @brief Array to store the END byte of I3C teransfer. */ -static uint8_t i3cEndByte[ARRAY_SIZE(kI3cBases)] = {0}; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -static void I3C_MasterRunEDMATransfer( - I3C_Type *base, i3c_master_edma_handle_t *handle, void *data, size_t dataSize, i3c_direction_t direction); - -/******************************************************************************* - * Code - ******************************************************************************/ -static void I3C_MasterTransferEDMACallbackRx(edma_handle_t *dmaHandle, void *param, bool transferDone, uint32_t tcds) -{ - i3c_master_edma_handle_t *i3cHandle = (i3c_master_edma_handle_t *)param; - - if (transferDone) - { - /* Terminate following data if present. */ - i3cHandle->base->MCTRL |= I3C_MCTRL_RDTERM(1U); - -#if defined(FSL_FEATURE_I3C_HAS_ERRATA_052086) && (FSL_FEATURE_I3C_HAS_ERRATA_052086) - if (i3cHandle->transfer.dataSize > 1U) - { - size_t rxCount; - /* Read out the last byte data. */ - do - { - I3C_MasterGetFifoCounts(i3cHandle->base, &rxCount, NULL); - } while (rxCount == 0U); - *(uint8_t *)((uint32_t)(uint32_t *)i3cHandle->transfer.data + i3cHandle->transfer.dataSize - 1U) = - (uint8_t)i3cHandle->base->MRDATAB; - } -#endif - - /* Disable I3C Rx DMA. */ - i3cHandle->base->MDATACTRL &= ~I3C_MDMACTRL_DMAFB_MASK; - } -} - -static void I3C_MasterTransferEDMACallbackTx(edma_handle_t *dmaHandle, void *param, bool transferDone, uint32_t tcds) -{ - i3c_master_edma_handle_t *i3cHandle = (i3c_master_edma_handle_t *)param; - uint32_t instance; - - if (transferDone) - { - /* Disable I3C Tx DMA. */ - i3cHandle->base->MDATACTRL &= ~I3C_MDMACTRL_DMATB_MASK; - - if (i3cHandle->transferCount != 1U) - { - instance = I3C_GetInstance(i3cHandle->base); - /* Ensure there's space in the Tx FIFO. */ - while ((i3cHandle->base->MDATACTRL & I3C_MDATACTRL_TXFULL_MASK) != 0U) - { - } - i3cHandle->base->MWDATABE = i3cEndByte[instance]; - } - } -} -/*! - * brief Prepares the transfer state machine and fills in the command buffer. - * param handle Master nonblocking driver handle. - */ -static status_t I3C_MasterInitTransferStateMachineEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle) -{ - i3c_master_transfer_t *xfer = &handle->transfer; - status_t result = kStatus_Success; - i3c_direction_t direction = xfer->direction; - - /* Calculate command count and put into command buffer. */ - handle->subaddressCount = 0U; - if (xfer->subaddressSize != 0U) - { - for (uint32_t i = xfer->subaddressSize; i > 0U; i--) - { - handle->subaddressBuffer[handle->subaddressCount++] = (uint8_t)((xfer->subaddress) >> (8U * (i - 1U))); - } - } - - /* Start condition shall be ommited, switch directly to next phase */ - if (xfer->dataSize == 0U) - { - handle->state = (uint8_t)kStopState; - } - - if (0UL != (xfer->flags & (uint32_t)kI3C_TransferStartWithBroadcastAddr)) - { - if (0UL != (xfer->flags & (uint32_t)kI3C_TransferNoStartFlag)) - { - return kStatus_InvalidArgument; - } - - if (0UL != (xfer->flags & (uint32_t)kI3C_TransferRepeatedStartFlag)) - { - return kStatus_InvalidArgument; - } - - /* Issue 0x7E as start. */ - result = I3C_MasterStart(base, xfer->busType, 0x7E, kI3C_Write); - if (result != kStatus_Success) - { - return result; - } - - result = I3C_MasterWaitForCtrlDone(base, false); - if (result != kStatus_Success) - { - return result; - } - } - - /* Handle no start option. */ - if (0U != (xfer->flags & (uint32_t)kI3C_TransferNoStartFlag)) - { - /* No need to send start flag, directly go to send command or data */ - if (xfer->subaddressSize > 0UL) - { - handle->state = (uint8_t)kSendCommandState; - } - else - { - if (direction == kI3C_Write) - { - /* Next state, send data. */ - handle->state = (uint8_t)kTransmitDataState; - } - else - { - /* Only support write with no stop signal. */ - return kStatus_InvalidArgument; - } - } - } - else - { - if (xfer->subaddressSize != 0U) - { - handle->state = (uint8_t)kSendCommandState; - } - else - { - if (handle->transfer.direction == kI3C_Write) - { - handle->state = (uint8_t)kTransmitDataState; - } - else if (handle->transfer.direction == kI3C_Read) - { - handle->state = (uint8_t)kReceiveDataState; - } - else - { - return kStatus_InvalidArgument; - } - } - - if (handle->transfer.direction == kI3C_Read) - { - I3C_MasterRunEDMATransfer(base, handle, xfer->data, xfer->dataSize, kI3C_Read); - } - - if (handle->state != (uint8_t)kStopState) - { - /* If repeated start is requested, send repeated start. */ - if (0U != (xfer->flags & (uint32_t)kI3C_TransferRepeatedStartFlag)) - { - result = I3C_MasterRepeatedStart(base, xfer->busType, xfer->slaveAddress, direction); - } - else /* For normal transfer, send start. */ - { - result = I3C_MasterStart(base, xfer->busType, xfer->slaveAddress, direction); - } - } - } - - I3C_MasterTransferEDMAHandleIRQ(base, handle); - return result; -} - -static void I3C_MasterRunEDMATransfer( - I3C_Type *base, i3c_master_edma_handle_t *handle, void *data, size_t dataSize, i3c_direction_t direction) -{ - bool isEnableTxDMA = false; - bool isEnableRxDMA = false; - edma_transfer_config_t xferConfig; - uint32_t instance; - uint32_t address; - uint32_t width; - - handle->transferCount = dataSize; - - switch (direction) - { - case kI3C_Write: - if (dataSize != 1U) - { - address = (uint32_t)&base->MWDATAB1; - /* Cause controller sends command and data with same interface, need special buffer to store the END byte. */ - instance = I3C_GetInstance(base); - i3cEndByte[instance] = *(uint8_t *)((uint32_t)(uint32_t *)data + dataSize - 1U); - dataSize--; - } - else - { - address = (uint32_t)&base->MWDATABE; - } - EDMA_PrepareTransfer(&xferConfig, data, sizeof(uint8_t), (uint32_t *)address, sizeof(uint8_t), 1, dataSize, - kEDMA_MemoryToPeripheral); - (void)EDMA_SubmitTransfer(handle->txDmaHandle, &xferConfig); - EDMA_StartTransfer(handle->txDmaHandle); - isEnableTxDMA = true; - width = 1U; - break; - - case kI3C_Read: -#if defined(FSL_FEATURE_I3C_HAS_ERRATA_052086) && (FSL_FEATURE_I3C_HAS_ERRATA_052086) - /* ERRATA052086: Soc integration issue results in target misses the last DMA request to copy the - last one byte from controler when transmission data size is > 1 byte. Resolution: Triggering DMA - interrupt one byte in advance, then receive the last one byte data after DMA transmission finishes. */ - if (dataSize > 1U) - { - dataSize--; - } -#endif - address = (uint32_t)&base->MRDATAB; - EDMA_PrepareTransfer(&xferConfig, (uint32_t *)address, sizeof(uint8_t), data, sizeof(uint8_t), 1, dataSize, - kEDMA_PeripheralToMemory); - (void)EDMA_SubmitTransfer(handle->rxDmaHandle, &xferConfig); - EDMA_StartTransfer(handle->rxDmaHandle); - isEnableRxDMA = true; - width = 1U; - break; - - default: - /* This should never happen */ - assert(false); - break; - } - - I3C_MasterEnableDMA(base, isEnableTxDMA, isEnableRxDMA, width); -} - -static status_t I3C_MasterRunTransferStateMachineEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle, bool *isDone) -{ - uint32_t status; - uint32_t errStatus; - status_t result = kStatus_Success; - i3c_master_transfer_t *xfer; - size_t rxCount = 0; - bool state_complete = false; - - /* Set default isDone return value. */ - *isDone = false; - - /* Check for errors. */ - status = (uint32_t)I3C_MasterGetPendingInterrupts(base); - I3C_MasterClearStatusFlags(base, status); - - i3c_master_state_t masterState = I3C_MasterGetState(base); - errStatus = I3C_MasterGetErrorStatusFlags(base); - result = I3C_MasterCheckAndClearError(base, errStatus); - if (kStatus_Success != result) - { - return result; - } - - if (0UL != (status & (uint32_t)kI3C_MasterSlave2MasterFlag)) - { - if (handle->callback.slave2Master != NULL) - { - handle->callback.slave2Master(base, handle->userData); - } - } - - if ((0UL != (status & (uint32_t)kI3C_MasterSlaveStartFlag)) && (handle->transfer.busType != kI3C_TypeI2C)) - { - handle->state = (uint8_t)kSlaveStartState; - } - - if ((masterState == kI3C_MasterStateIbiRcv) || (masterState == kI3C_MasterStateIbiAck)) - { - handle->state = (uint8_t)kIBIWonState; - } - - if (handle->state == (uint8_t)kIdleState) - { - return result; - } - - if (handle->state == (uint8_t)kIBIWonState) - { - /* Get fifo counts and compute room in tx fifo. */ - rxCount = (base->MDATACTRL & I3C_MDATACTRL_RXCOUNT_MASK) >> I3C_MDATACTRL_RXCOUNT_SHIFT; - } - - /* Get pointer to private data. */ - xfer = &handle->transfer; - - while (!state_complete) - { - /* Execute the state. */ - switch (handle->state) - { - case (uint8_t)kSlaveStartState: - /* Emit start + 0x7E */ - I3C_MasterEmitRequest(base, kI3C_RequestAutoIbi); - handle->state = (uint8_t)kIBIWonState; - state_complete = true; - break; - - case (uint8_t)kIBIWonState: - if (masterState == kI3C_MasterStateIbiAck) - { - handle->ibiType = I3C_GetIBIType(base); - if (handle->callback.ibiCallback != NULL) - { - handle->callback.ibiCallback(base, handle, handle->ibiType, kI3C_IbiAckNackPending); - } - else - { - I3C_MasterEmitIBIResponse(base, kI3C_IbiRespNack); - } - } - - /* Make sure there is data in the rx fifo. */ - if (0UL != rxCount) - { - if ((handle->ibiBuff == NULL) && (handle->callback.ibiCallback != NULL)) - { - handle->callback.ibiCallback(base, handle, kI3C_IbiNormal, kI3C_IbiDataBuffNeed); - } - uint8_t tempData = (uint8_t)base->MRDATAB; - if (handle->ibiBuff != NULL) - { - handle->ibiBuff[handle->ibiPayloadSize++] = tempData; - } - rxCount--; - break; - } - else if (0UL != (status & (uint32_t)kI3C_MasterCompleteFlag)) - { - handle->ibiType = I3C_GetIBIType(base); - handle->ibiAddress = I3C_GetIBIAddress(base); - state_complete = true; - result = kStatus_I3C_IBIWon; - } - else - { - state_complete = true; - } - break; - - case (uint8_t)kSendCommandState: - I3C_MasterRunEDMATransfer(base, handle, handle->subaddressBuffer, handle->subaddressCount, kI3C_Write); - - if ((xfer->direction == kI3C_Read) || (0UL == xfer->dataSize)) - { - if (0UL == xfer->dataSize) - { - handle->state = (uint8_t)kWaitForCompletionState; - } - else - { - /* xfer->dataSize != 0U, xfer->direction = kI3C_Read */ - handle->state = (uint8_t)kWaitRepeatedStartCompleteState; - } - } - else - { - /* Next state, transfer data. */ - handle->state = (uint8_t)kTransmitDataState; - } - - state_complete = true; - break; - - case (uint8_t)kWaitRepeatedStartCompleteState: - /* We stay in this state until the maste complete. */ - if (0UL != (status & (uint32_t)kI3C_MasterCompleteFlag)) - { - handle->state = (uint8_t)kReceiveDataState; - /* Send repeated start and slave address. */ - result = I3C_MasterRepeatedStart(base, xfer->busType, xfer->slaveAddress, kI3C_Read); - } - - state_complete = true; - break; - - case (uint8_t)kTransmitDataState: - I3C_MasterRunEDMATransfer(base, handle, xfer->data, xfer->dataSize, kI3C_Write); - handle->state = (uint8_t)kWaitForCompletionState; - - state_complete = true; - break; - - case (uint8_t)kReceiveDataState: - /* Do DMA read. */ - handle->state = (uint8_t)kWaitForCompletionState; - - state_complete = true; - break; - - case (uint8_t)kWaitForCompletionState: - /* We stay in this state until the maste complete. */ - if (0UL != (status & (uint32_t)kI3C_MasterCompleteFlag)) - { - handle->state = (uint8_t)kStopState; - } - else - { - state_complete = true; - } - break; - - case (uint8_t)kStopState: - /* Only issue a stop transition if the caller requested it. */ - if (0UL == (xfer->flags & (uint32_t)kI3C_TransferNoStopFlag)) - { - if (xfer->busType == kI3C_TypeI3CDdr) - { - I3C_MasterEmitRequest(base, kI3C_RequestForceExit); - } - else - { - I3C_MasterEmitRequest(base, kI3C_RequestEmitStop); - } - } - *isDone = true; - state_complete = true; - break; - - default: - assert(false); - break; - } - } - return result; -} - -void I3C_MasterTransferCreateHandleEDMA(I3C_Type *base, - i3c_master_edma_handle_t *handle, - const i3c_master_edma_callback_t *callback, - void *userData, - edma_handle_t *rxDmaHandle, - edma_handle_t *txDmaHandle) -{ - uint32_t instance; - - assert(NULL != handle); - - /* Clear out the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Look up instance number */ - instance = I3C_GetInstance(base); - - handle->base = base; - handle->txDmaHandle = txDmaHandle; - handle->rxDmaHandle = rxDmaHandle; - handle->callback = *callback; - handle->userData = userData; - - /* Save this handle for IRQ use. */ - s_i3cMasterHandle[instance] = handle; - - /* Set irq handler. */ - s_i3cMasterIsr = I3C_MasterTransferEDMAHandleIRQ; - - EDMA_SetCallback(handle->rxDmaHandle, I3C_MasterTransferEDMACallbackRx, handle); - EDMA_SetCallback(handle->txDmaHandle, I3C_MasterTransferEDMACallbackTx, handle); - - /* Clear all flags. */ - I3C_MasterClearErrorStatusFlags(base, (uint32_t)kMasterErrorFlags); - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - /* Reset fifos. These flags clear automatically. */ - base->MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - - /* Enable NVIC IRQ, this only enables the IRQ directly connected to the NVIC. - In some cases the I3C IRQ is configured through INTMUX, user needs to enable - INTMUX IRQ in application code. */ - (void)EnableIRQ(kI3cIrqs[instance]); - - /* Clear internal IRQ enables and enable NVIC IRQ. */ - I3C_MasterEnableInterrupts(base, (uint32_t)kMasterDMAIrqFlags); -} - -/*! - * brief Performs a non-blocking DMA transaction on the I2C/I3C bus. - * - * param base The I3C peripheral base address. - * param handle Pointer to the I3C master driver handle. - * param transfer The pointer to the transfer descriptor. - * retval #kStatus_Success The transaction was started successfully. - * retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - */ -status_t I3C_MasterTransferEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle, i3c_master_transfer_t *transfer) -{ - assert(NULL != handle); - assert(NULL != transfer); - assert(transfer->subaddressSize <= sizeof(transfer->subaddress)); - i3c_master_state_t masterState = I3C_MasterGetState(base); - bool checkDdrState = false; - - /* Return busy if another transaction is in progress. */ - if (handle->state != (uint8_t)kIdleState) - { - return kStatus_I3C_Busy; - } - - /* Return an error if the bus is already in use not by us. */ - checkDdrState = (transfer->busType == kI3C_TypeI3CDdr) ? (masterState != kI3C_MasterStateDdr) : true; - if ((masterState != kI3C_MasterStateIdle) && (masterState != kI3C_MasterStateNormAct) && checkDdrState) - { - return kStatus_I3C_Busy; - } - - /* Disable I3C IRQ sources while we configure stuff. */ - I3C_MasterDisableInterrupts( - base, ((uint32_t)kMasterDMAIrqFlags | (uint32_t)kI3C_MasterRxReadyFlag | (uint32_t)kI3C_MasterTxReadyFlag)); - - /* Save transfer into handle. */ - handle->transfer = *transfer; - - /* Configure IBI response type. */ - base->MCTRL &= ~I3C_MCTRL_IBIRESP_MASK; - base->MCTRL |= I3C_MCTRL_IBIRESP(transfer->ibiResponse); - - /* Clear all flags. */ - I3C_MasterClearErrorStatusFlags(base, (uint32_t)kMasterErrorFlags); - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - /* Reset fifos. These flags clear automatically. */ - base->MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - - /* Generate commands to send. */ - (void)I3C_MasterInitTransferStateMachineEDMA(base, handle); - - /* Enable I3C internal IRQ sources. NVIC IRQ was enabled in CreateHandle() */ - I3C_MasterEnableInterrupts(base, (uint32_t)(kMasterDMAIrqFlags)); - - if (transfer->busType == kI3C_TypeI2C) - { - I3C_MasterDisableInterrupts(base, (uint32_t)kI3C_MasterSlaveStartFlag); - } - - return kStatus_Success; -} - -void I3C_MasterTransferEDMAHandleIRQ(I3C_Type *base, void *i3cHandle) -{ - i3c_master_edma_handle_t *handle = (i3c_master_edma_handle_t *)i3cHandle; - - bool isDone; - status_t result; - - /* Don't do anything if we don't have a valid handle. */ - if (NULL == handle) - { - return; - } - - result = I3C_MasterRunTransferStateMachineEDMA(base, handle, &isDone); - - if (handle->state == (uint8_t)kIdleState) - { - return; - } - - if (isDone || (result != kStatus_Success)) - { - /* XXX need to handle data that may be in rx fifo below watermark level? */ - - /* XXX handle error, terminate xfer */ - if ((result == kStatus_I3C_Nak) || (result == kStatus_I3C_IBIWon)) - { - I3C_MasterEmitRequest(base, kI3C_RequestEmitStop); - } - - /* Set handle to idle state. */ - handle->state = (uint8_t)kIdleState; - - /* Invoke IBI user callback. */ - if ((result == kStatus_I3C_IBIWon) && (handle->callback.ibiCallback != NULL)) - { - handle->callback.ibiCallback(base, handle, handle->ibiType, kI3C_IbiReady); - handle->ibiPayloadSize = 0; - } - - /* Invoke callback. */ - if (NULL != handle->callback.transferComplete) - { - handle->callback.transferComplete(base, handle, result, handle->userData); - } - } -} - -/*! - * brief Get master transfer status during a dma non-blocking transfer - * - * param base I3C peripheral base address - * param handle pointer to i2c_master_edma_handle_t structure - * param count Number of bytes transferred so far by the non-blocking transaction. - */ -status_t I3C_MasterTransferGetCountEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (handle->state == (uint8_t)kIdleState) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - /* There is no necessity to disable interrupts as we read a single integer value */ - i3c_direction_t dir = handle->transfer.direction; - - if (dir == kI3C_Read) - { - *count = handle->transferCount - - 1U * EDMA_GetRemainingMajorLoopCount(handle->rxDmaHandle->base, handle->rxDmaHandle->channel); - } - else - { - *count = handle->transferCount - - 1U * EDMA_GetRemainingMajorLoopCount(handle->txDmaHandle->base, handle->txDmaHandle->channel); - } - - return kStatus_Success; -} - -/*! - * brief Abort a master edma non-blocking transfer in a early time - * - * param base I3C peripheral base address - * param handle pointer to i2c_master_edma_handle_t structure - */ -void I3C_MasterTransferAbortEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle) -{ - if (handle->state != (uint8_t)kIdleState) - { - EDMA_AbortTransfer(handle->txDmaHandle); - EDMA_AbortTransfer(handle->rxDmaHandle); - - I3C_MasterEnableDMA(base, false, false, 0); - - /* Reset fifos. These flags clear automatically. */ - base->MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - - /* Send a stop command to finalize the transfer. */ - (void)I3C_MasterStop(base); - - /* Reset handle. */ - handle->state = (uint8_t)kIdleState; - } -} - -static void I3C_SlaveTransferEDMACallback(edma_handle_t *dmaHandle, void *param, bool transferDone, uint32_t tcds) -{ - i3c_slave_edma_handle_t *i3cHandle = (i3c_slave_edma_handle_t *)param; - - if (transferDone) - { - /* Simply disable dma enablement */ - if (i3cHandle->txDmaHandle == dmaHandle) - { - i3cHandle->base->SDMACTRL &= ~I3C_SDMACTRL_DMATB_MASK; - - if (i3cHandle->transfer.txDataSize > 1U) - { - /* Ensure there's space in the Tx FIFO. */ - while ((i3cHandle->base->SDATACTRL & I3C_SDATACTRL_TXFULL_MASK) != 0U) - { - } - /* Send the last byte. */ - i3cHandle->base->SWDATABE = *(uint8_t *)((uintptr_t)i3cHandle->transfer.txData + i3cHandle->transfer.txDataSize - 1U); - } - } - else - { -#if defined(FSL_FEATURE_I3C_HAS_ERRATA_052086) && (FSL_FEATURE_I3C_HAS_ERRATA_052086) - if (i3cHandle->transfer.rxDataSize > 1U) - { - size_t rxCount; - /* Read out the last byte data. */ - do - { - I3C_SlaveGetFifoCounts(i3cHandle->base, &rxCount, NULL); - } while (rxCount == 0U); - *(uint8_t *)((uint32_t)(uint32_t *)i3cHandle->transfer.rxData + i3cHandle->transfer.rxDataSize - 1U) = - (uint8_t)i3cHandle->base->SRDATAB; - } -#endif - i3cHandle->base->SDMACTRL &= ~I3C_SDMACTRL_DMAFB_MASK; - } - } -} - -/*! - * brief Create a new handle for the I3C slave DMA APIs. - * - * The creation of a handle is for use with the DMA APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the I3C_SlaveTransferAbortDMA() API shall be called. - * - * For devices where the I3C send and receive DMA requests are OR'd together, the @a txDmaHandle - * parameter is ignored and may be set to NULL. - * - * param base The I3C peripheral base address. - * param handle Pointer to the I3C slave driver handle. - * param callback User provided pointer to the asynchronous callback function. - * param userData User provided pointer to the application callback data. - * param rxDmaHandle Handle for the DMA receive channel. Created by the user prior to calling this function. - * param txDmaHandle Handle for the DMA transmit channel. Created by the user prior to calling this function. - */ -void I3C_SlaveTransferCreateHandleEDMA(I3C_Type *base, - i3c_slave_edma_handle_t *handle, - i3c_slave_edma_callback_t callback, - void *userData, - edma_handle_t *rxDmaHandle, - edma_handle_t *txDmaHandle) -{ - uint32_t instance; - - assert(NULL != handle); - - /* Clear out the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Look up instance number */ - instance = I3C_GetInstance(base); - - handle->base = base; - handle->txDmaHandle = txDmaHandle; - handle->rxDmaHandle = rxDmaHandle; - handle->callback = callback; - handle->userData = userData; - - /* Save this handle for IRQ use. */ - s_i3cSlaveHandle[instance] = handle; - - /* Set irq handler. */ - s_i3cSlaveIsr = I3C_SlaveTransferEDMAHandleIRQ; - - EDMA_SetCallback(handle->rxDmaHandle, I3C_SlaveTransferEDMACallback, handle); - EDMA_SetCallback(handle->txDmaHandle, I3C_SlaveTransferEDMACallback, handle); - - /* Clear internal IRQ enables and enable NVIC IRQ. */ - I3C_SlaveDisableInterrupts(base, (uint32_t)kSlaveDMAIrqFlags); - - /* Enable NVIC IRQ, this only enables the IRQ directly connected to the NVIC. - In some cases the I3C IRQ is configured through INTMUX, user needs to enable - INTMUX IRQ in application code. */ - (void)EnableIRQ(kI3cIrqs[instance]); - - /* Enable IRQ. */ - I3C_SlaveEnableInterrupts(base, (uint32_t)kSlaveDMAIrqFlags); -} - -static void I3C_SlavePrepareTxEDMA(I3C_Type *base, i3c_slave_edma_handle_t *handle) -{ - edma_transfer_config_t txConfig; - uint32_t *txFifoBase; - i3c_slave_edma_transfer_t *xfer = &handle->transfer; - - if (xfer->txDataSize == 1U) - { - txFifoBase = (uint32_t *)(uintptr_t)&base->SWDATABE; - EDMA_PrepareTransfer(&txConfig, xfer->txData, 1, (void *)txFifoBase, 1, 1, xfer->txDataSize, - kEDMA_MemoryToPeripheral); - } - else - { - txFifoBase = (uint32_t *)(uintptr_t)&base->SWDATAB1; - EDMA_PrepareTransfer(&txConfig, xfer->txData, 1, (void *)txFifoBase, 1, 1, xfer->txDataSize - 1U, - kEDMA_MemoryToPeripheral); - } - - (void)EDMA_SubmitTransfer(handle->txDmaHandle, &txConfig); - EDMA_StartTransfer(handle->txDmaHandle); -} - -static void I3C_SlavePrepareRxEDMA(I3C_Type *base, i3c_slave_edma_handle_t *handle) -{ - uint32_t *rxFifoBase = (uint32_t *)(uintptr_t)&base->SRDATAB; - i3c_slave_edma_transfer_t *xfer = &handle->transfer; - size_t dataSize = xfer->rxDataSize; - edma_transfer_config_t rxConfig; - -#if defined(FSL_FEATURE_I3C_HAS_ERRATA_052086) && (FSL_FEATURE_I3C_HAS_ERRATA_052086) - /* ERRATA052086: Soc integration issue results in target misses the last DMA request to copy the - last one byte from controler when transmission data size is > 1 byte. Resolution: Triggering DMA - interrupt one byte in advance, then receive the last one byte data after DMA transmission finishes. */ - if (dataSize > 1U) - { - dataSize--; - } -#endif - - EDMA_PrepareTransfer(&rxConfig, (void *)rxFifoBase, 1, xfer->rxData, 1, 1, dataSize, - kEDMA_PeripheralToMemory); - (void)EDMA_SubmitTransfer(handle->rxDmaHandle, &rxConfig); - EDMA_StartTransfer(handle->rxDmaHandle); -} - -/*! - * brief Prepares for a non-blocking DMA-based transaction on the I3C bus. - * - * The API will do DMA configuration according to the input transfer descriptor, and the data will be transferred when - * there's bus master requesting transfer from/to this slave. So the timing of call to this API need be aligned - * with master application to ensure the transfer is executed as expected. - * Callback specified when the @a handle was created is invoked when the transaction has completed. - * - * param base The I3C peripheral base address. - * param handle Pointer to the I3C slave driver handle. - * param transfer The pointer to the transfer descriptor. - * param eventMask Bit mask formed by OR'ing together #i3c_slave_transfer_event_t enumerators to specify - * which events to send to the callback. The transmit and receive events is not allowed to be enabled. - * retval kStatus_Success The transaction was started successfully. - * retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or another DMA - * transaction is already in progress. - * retval #kStatus_Fail The transaction can't be set. - */ -status_t I3C_SlaveTransferEDMA(I3C_Type *base, - i3c_slave_edma_handle_t *handle, - i3c_slave_edma_transfer_t *transfer, - uint32_t eventMask) -{ - assert(NULL != handle); - assert(NULL != transfer); - - bool txDmaEn = false, rxDmaEn = false; - uint32_t width; - - if (handle->isBusy) - { - return kStatus_I3C_Busy; - } - /* Clear all flags. */ - I3C_SlaveClearErrorStatusFlags(base, (uint32_t)kSlaveErrorFlags); - I3C_SlaveClearStatusFlags(base, (uint32_t)kSlaveClearFlags); - /* Reset fifos. These flags clear automatically. */ - base->SDATACTRL |= I3C_SDATACTRL_FLUSHTB_MASK | I3C_SDATACTRL_FLUSHFB_MASK; - - handle->transfer = *transfer; - - /* Set up event mask. */ - handle->eventMask = eventMask; - - if ((transfer->txData != NULL) && (transfer->txDataSize != 0U)) - { - I3C_SlavePrepareTxEDMA(base, handle); - txDmaEn = true; - width = 1U; - } - - if ((transfer->rxData != NULL) && (transfer->rxDataSize != 0U)) - { - I3C_SlavePrepareRxEDMA(base, handle); - rxDmaEn = true; - width = 1U; - } - - if (txDmaEn || rxDmaEn) - { - I3C_SlaveEnableDMA(base, txDmaEn, rxDmaEn, width); - return kStatus_Success; - } - else - { - return kStatus_Fail; - } -} - -void I3C_SlaveTransferEDMAHandleIRQ(I3C_Type *base, void *i3cHandle) -{ - uint32_t flags; - uint32_t errFlags; - i3c_slave_edma_transfer_t *xfer; - - i3c_slave_edma_handle_t *handle = (i3c_slave_edma_handle_t *)i3cHandle; - /* Check for a valid handle in case of a spurious interrupt. */ - if (NULL == handle) - { - return; - } - - xfer = &handle->transfer; - - /* Get status flags. */ - flags = I3C_SlaveGetStatusFlags(base); - errFlags = I3C_SlaveGetErrorStatusFlags(base); - - /* Clear status flags. */ - I3C_SlaveClearStatusFlags(base, flags); - - if (0UL != (errFlags & (uint32_t)kSlaveErrorFlags)) - { - xfer->event = (uint32_t)kI3C_SlaveCompletionEvent; - xfer->completionStatus = I3C_SlaveCheckAndClearError(base, errFlags); - - if ((0UL != (handle->eventMask & (uint32_t)kI3C_SlaveCompletionEvent)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - return; - } - - if (0UL != (flags & (uint32_t)kI3C_SlaveEventSentFlag)) - { - xfer->event = (uint32_t)kI3C_SlaveRequestSentEvent; - if ((0UL != (handle->eventMask & xfer->event)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - } - - if (0UL != (flags & (uint32_t)kI3C_SlaveReceivedCCCFlag)) - { - handle->isBusy = true; - xfer->event = (uint32_t)kI3C_SlaveReceivedCCCEvent; - if ((0UL != (handle->eventMask & xfer->event)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - } - - if (0UL != (flags & (uint32_t)kI3C_SlaveBusStopFlag)) - { - if (handle->isBusy == true) - { - xfer->event = (uint32_t)kI3C_SlaveCompletionEvent; - xfer->completionStatus = kStatus_Success; - handle->isBusy = false; - - if ((0UL != (handle->eventMask & xfer->event)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - I3C_SlaveTransferAbortEDMA(base, handle); - } - else - { - return; - } - } - - if (0UL != (flags & (uint32_t)kI3C_SlaveMatchedFlag)) - { - xfer->event = (uint32_t)kI3C_SlaveAddressMatchEvent; - handle->isBusy = true; - if ((0UL != (handle->eventMask & (uint32_t)kI3C_SlaveAddressMatchEvent)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - } -} - -/*! - * brief Abort a slave dma non-blocking transfer in a early time - * - * param base I3C peripheral base address - * param handle pointer to i3c_slave_edma_handle_t structure - */ -void I3C_SlaveTransferAbortEDMA(I3C_Type *base, i3c_slave_edma_handle_t *handle) -{ - if (handle->isBusy != false) - { - EDMA_AbortTransfer(handle->txDmaHandle); - EDMA_AbortTransfer(handle->rxDmaHandle); - - I3C_SlaveEnableDMA(base, false, false, 0); - - /* Reset fifos. These flags clear automatically. */ - base->SDATACTRL |= I3C_SDATACTRL_FLUSHTB_MASK | I3C_SDATACTRL_FLUSHFB_MASK; - } -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_i3c_edma.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_i3c_edma.h deleted file mode 100644 index 4e56e38c7be..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_i3c_edma.h +++ /dev/null @@ -1,279 +0,0 @@ -/* - * Copyright 2022-2023 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_I3C_EDMA_H_ -#define FSL_I3C_EDMA_H_ - -#include "fsl_i3c.h" -#include "fsl_edma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief I3C EDMA driver version. */ -#define FSL_I3C_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 2, 8)) -/*@}*/ - -/*! - * @addtogroup i3c_master_edma_driver - * @{ - */ - -/* Forward declaration of the transfer descriptor and handle typedefs. */ -typedef struct _i3c_master_edma_handle i3c_master_edma_handle_t; - -/*! @brief i3c master callback functions. */ -typedef struct _i3c_master_edma_callback -{ - void (*slave2Master)(I3C_Type *base, void *userData); /*!< Transfer complete callback */ - void (*ibiCallback)(I3C_Type *base, - i3c_master_edma_handle_t *handle, - i3c_ibi_type_t ibiType, - i3c_ibi_state_t ibiState); /*!< IBI event callback */ - void (*transferComplete)(I3C_Type *base, - i3c_master_edma_handle_t *handle, - status_t status, - void *userData); /*!< Transfer complete callback */ -} i3c_master_edma_callback_t; -/*! - * @brief Driver handle for master EDMA APIs. - * @note The contents of this structure are private and subject to change. - */ -struct _i3c_master_edma_handle -{ - I3C_Type *base; /*!< I3C base pointer. */ - uint8_t state; /*!< Transfer state machine current state. */ - uint32_t transferCount; /*!< Indicates progress of the transfer */ - uint8_t subaddressBuffer[4]; /*!< Saving subaddress command. */ - uint8_t subaddressCount; /*!< Saving command count. */ - i3c_master_transfer_t transfer; /*!< Copy of the current transfer info. */ - i3c_master_edma_callback_t callback; /*!< Callback function pointer. */ - void *userData; /*!< Application data passed to callback. */ - edma_handle_t *rxDmaHandle; /*!< Handle for receive DMA channel. */ - edma_handle_t *txDmaHandle; /*!< Handle for transmit DMA channel. */ - uint8_t ibiAddress; /*!< Slave address which request IBI. */ - uint8_t *ibiBuff; /*!< Pointer to IBI buffer to keep ibi bytes. */ - size_t ibiPayloadSize; /*!< IBI payload size. */ - i3c_ibi_type_t ibiType; /*!< IBI type. */ -}; - -/*! @} */ - -/*! - * @addtogroup i3c_slave_edma_driver - * @{ - */ -/* Forward declaration of the transfer descriptor and handle typedefs. */ -typedef struct _i3c_slave_edma_handle i3c_slave_edma_handle_t; - -/*! @brief I3C slave transfer structure */ -typedef struct _i3c_slave_edma_transfer -{ - uint32_t event; /*!< Reason the callback is being invoked. */ - uint8_t *txData; /*!< Transfer buffer */ - size_t txDataSize; /*!< Transfer size */ - uint8_t *rxData; /*!< Transfer buffer */ - size_t rxDataSize; /*!< Transfer size */ - status_t completionStatus; /*!< Success or error code describing how the transfer completed. Only applies for - #kI3C_SlaveCompletionEvent. */ -} i3c_slave_edma_transfer_t; - -/*! - * @brief Slave event callback function pointer type. - * - * This callback is used only for the slave DMA transfer API. - * - * @param base Base address for the I3C instance on which the event occurred. - * @param handle Pointer to slave DMA transfer handle. - * @param transfer Pointer to transfer descriptor containing values passed to and/or from the callback. - * @param userData Arbitrary pointer-sized value passed from the application. - */ -typedef void (*i3c_slave_edma_callback_t)(I3C_Type *base, i3c_slave_edma_transfer_t *transfer, void *userData); -/*! - * @brief I3C slave edma handle structure. - * @note The contents of this structure are private and subject to change. - */ -struct _i3c_slave_edma_handle -{ - I3C_Type *base; /*!< I3C base pointer. */ - i3c_slave_edma_transfer_t transfer; /*!< I3C slave transfer copy. */ - bool isBusy; /*!< Whether transfer is busy. */ - bool wasTransmit; /*!< Whether the last transfer was a transmit. */ - uint32_t eventMask; /*!< Mask of enabled events. */ - i3c_slave_edma_callback_t callback; /*!< Callback function called at transfer event. */ - edma_handle_t *rxDmaHandle; /*!< Handle for receive DMA channel. */ - edma_handle_t *txDmaHandle; /*!< Handle for transmit DMA channel. */ - void *userData; /*!< Callback parameter passed to callback. */ -}; -/*! @} */ -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @addtogroup i3c_master_edma_driver - * @{ - */ - -/*! @name Master DMA */ -/*@{*/ - -/*! - * @brief Create a new handle for the I3C master DMA APIs. - * - * The creation of a handle is for use with the DMA APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the I3C_MasterTransferAbortDMA() API shall be called. - * - * For devices where the I3C send and receive DMA requests are OR'd together, the @a txDmaHandle - * parameter is ignored and may be set to NULL. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C master driver handle. - * @param callback User provided pointer to the asynchronous callback function. - * @param userData User provided pointer to the application callback data. - * @param rxDmaHandle Handle for the DMA receive channel. Created by the user prior to calling this function. - * @param txDmaHandle Handle for the DMA transmit channel. Created by the user prior to calling this function. - */ -void I3C_MasterTransferCreateHandleEDMA(I3C_Type *base, - i3c_master_edma_handle_t *handle, - const i3c_master_edma_callback_t *callback, - void *userData, - edma_handle_t *rxDmaHandle, - edma_handle_t *txDmaHandle); - -/*! - * @brief Performs a non-blocking DMA-based transaction on the I3C bus. - * - * The callback specified when the @a handle was created is invoked when the transaction has - * completed. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C master driver handle. - * @param transfer The pointer to the transfer descriptor. - * @retval kStatus_Success The transaction was started successfully. - * @retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or another DMA - * transaction is already in progress. - */ -status_t I3C_MasterTransferEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle, i3c_master_transfer_t *transfer); - -/*! - * @brief Returns number of bytes transferred so far. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C master driver handle. - * @param[out] count Number of bytes transferred so far by the non-blocking transaction. - * @retval kStatus_Success - * @retval kStatus_NoTransferInProgress There is not a DMA transaction currently in progress. - */ -status_t I3C_MasterTransferGetCountEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle, size_t *count); - -/*! - * @brief Terminates a non-blocking I3C master transmission early. - * - * @note It is not safe to call this function from an IRQ handler that has a higher priority than the - * DMA peripheral's IRQ priority. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C master driver handle. - */ -void I3C_MasterTransferAbortEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle); - -/*! - * @brief Reusable routine to handle master interrupts. - * @note This function does not need to be called unless you are reimplementing the - * nonblocking API's interrupt handler routines to add special functionality. - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C master DMA driver handle. - */ -void I3C_MasterTransferEDMAHandleIRQ(I3C_Type *base, void *i3cHandle); -/*@}*/ - -/*! @} */ - -/*! - * @addtogroup i3c_slave_edma_driver - * @{ - */ - -/*! @name Slave DMA */ -/*@{*/ -/*! - * @brief Create a new handle for the I3C slave DMA APIs. - * - * The creation of a handle is for use with the DMA APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the I3C_SlaveTransferAbortDMA() API shall be called. - * - * For devices where the I3C send and receive DMA requests are OR'd together, the @a txDmaHandle - * parameter is ignored and may be set to NULL. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C slave driver handle. - * @param callback User provided pointer to the asynchronous callback function. - * @param userData User provided pointer to the application callback data. - * @param rxDmaHandle Handle for the DMA receive channel. Created by the user prior to calling this function. - * @param txDmaHandle Handle for the DMA transmit channel. Created by the user prior to calling this function. - */ -void I3C_SlaveTransferCreateHandleEDMA(I3C_Type *base, - i3c_slave_edma_handle_t *handle, - i3c_slave_edma_callback_t callback, - void *userData, - edma_handle_t *rxDmaHandle, - edma_handle_t *txDmaHandle); - -/*! - * @brief Prepares for a non-blocking DMA-based transaction on the I3C bus. - * - * The API will do DMA configuration according to the input transfer descriptor, and the data will be transferred when - * there's bus master requesting transfer from/to this slave. So the timing of call to this API need be aligned - * with master application to ensure the transfer is executed as expected. - * Callback specified when the @a handle was created is invoked when the transaction has completed. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C slave driver handle. - * @param transfer The pointer to the transfer descriptor. - * @param eventMask Bit mask formed by OR'ing together #i3c_slave_transfer_event_t enumerators to specify - * which events to send to the callback. The transmit and receive events is not allowed to be enabled. - * @retval kStatus_Success The transaction was started successfully. - * @retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or another DMA - * transaction is already in progress. - * @retval #kStatus_Fail The transaction can't be set. - */ -status_t I3C_SlaveTransferEDMA(I3C_Type *base, - i3c_slave_edma_handle_t *handle, - i3c_slave_edma_transfer_t *transfer, - uint32_t eventMask); -/*! - * @brief Abort a slave edma non-blocking transfer in a early time - * - * @param base I3C peripheral base address - * @param handle pointer to i3c_slave_edma_handle_t structure - */ -void I3C_SlaveTransferAbortEDMA(I3C_Type *base, i3c_slave_edma_handle_t *handle); - -/*! - * @brief Reusable routine to handle slave interrupts. - * @note This function does not need to be called unless you are reimplementing the - * nonblocking API's interrupt handler routines to add special functionality. - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C slave DMA driver handle. - */ -void I3C_SlaveTransferEDMAHandleIRQ(I3C_Type *base, void *i3cHandle); -/*@}*/ - -/*! @} */ -#if defined(__cplusplus) -} -#endif - -#endif /* FSL_I3C_EDMA_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_inputmux.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_inputmux.c deleted file mode 100644 index 3c9e2789a22..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_inputmux.c +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_inputmux.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.inputmux" -#endif - -#if defined(INPUTMUX_RSTS) -#define INPUTMUX_RESETS_ARRAY INPUTMUX_RSTS -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#if defined(INPUTMUX_RESETS_ARRAY) -/*! - * @brief Get instance number for INPUTMUX module. - * - * @param base INPUTMUX peripheral base address - */ -static uint32_t INPUTMUX_GetInstance(INPUTMUX_Type *base); -#endif -/******************************************************************************* - * Variables - ******************************************************************************/ -#if defined(INPUTMUX_RESETS_ARRAY) -/*! @brief Pointers to INPUTMUX bases for each instance. */ -static INPUTMUX_Type *const s_inputmuxBases[] = INPUTMUX_BASE_PTRS; - -/* Reset array */ -static const reset_ip_name_t s_inputmuxResets[] = INPUTMUX_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -#if defined(INPUTMUX_RESETS_ARRAY) -static uint32_t INPUTMUX_GetInstance(INPUTMUX_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_inputmuxBases); instance++) - { - if (s_inputmuxBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_inputmuxBases)); - - return instance; -} -#endif - -/*! - * brief Initialize INPUTMUX peripheral. - - * This function enables the INPUTMUX clock. - * - * param base Base address of the INPUTMUX peripheral. - * - * retval None. - */ -void INPUTMUX_Init(INPUTMUX_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#if defined(FSL_FEATURE_INPUTMUX_HAS_NO_INPUTMUX_CLOCK_SOURCE) && FSL_FEATURE_INPUTMUX_HAS_NO_INPUTMUX_CLOCK_SOURCE -#if (defined(FSL_FEATURE_SOC_SCT_COUNT) && (FSL_FEATURE_SOC_SCT_COUNT > 0)) - CLOCK_EnableClock(kCLOCK_Sct); -#endif /* FSL_FEATURE_SOC_SCT_COUNT */ - CLOCK_EnableClock(kCLOCK_Dma); -#else - CLOCK_EnableClock(kCLOCK_InputMux); -#endif /* FSL_FEATURE_INPUTMUX_HAS_NO_INPUTMUX_CLOCK_SOURCE */ -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(INPUTMUX_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_inputmuxResets[INPUTMUX_GetInstance(base)]); -#endif -} - -/*! - * brief Attaches a signal - * - * This function attaches multiplexed signals from INPUTMUX to target signals. - * For example, to attach GPIO PORT0 Pin 5 to PINT peripheral, do the following: - * code - * INPUTMUX_AttachSignal(INPUTMUX, 2, kINPUTMUX_GpioPort0Pin5ToPintsel); - * endcode - * In this example, INTMUX has 8 registers for PINT, PINT_SEL0~PINT_SEL7. - * With parameter p index specified as 2, this function configures register PINT_SEL2. - * - * param base Base address of the INPUTMUX peripheral. - * param index The serial number of destination register in the group of INPUTMUX registers with same name. - * param connection Applies signal from source signals collection to target signal. - * - * retval None. - */ -void INPUTMUX_AttachSignal(INPUTMUX_Type *base, uint32_t index, inputmux_connection_t connection) -{ - uint32_t pmux_id; - uint32_t output_id; - - /* extract pmux to be used */ - pmux_id = ((uint32_t)(connection)) >> PMUX_SHIFT; - /* extract function number */ - output_id = ((uint32_t)(connection)) & ((1UL << PMUX_SHIFT) - 1U); - /* programm signal */ - *(volatile uint32_t *)(((uint32_t)base) + pmux_id + (index * 4U)) = output_id; -} - -#if defined(FSL_FEATURE_INPUTMUX_HAS_SIGNAL_ENA) -/*! - * brief Enable/disable a signal - * - * This function gates the INPUTPMUX clock. - * - * param base Base address of the INPUTMUX peripheral. - * param signal Enable signal register id and bit offset. - * param enable Selects enable or disable. - * - * retval None. - */ -void INPUTMUX_EnableSignal(INPUTMUX_Type *base, inputmux_signal_t signal, bool enable) -{ - uint32_t ena_id; - uint32_t ena_id_mask = (1UL << (32U - ENA_SHIFT)) - 1U; - uint32_t bit_offset; - -#if defined(FSL_FEATURE_INPUTMUX_HAS_CHANNEL_MUX) && FSL_FEATURE_INPUTMUX_HAS_CHANNEL_MUX - uint32_t chmux_offset; - uint32_t chmux_value; - - /* Only enable need to update channel mux */ - if (enable && ((((uint32_t)signal) & (1UL << CHMUX_AVL_SHIFT)) != 0U)) - { - chmux_offset = (((uint32_t)signal) >> CHMUX_OFF_SHIFT) & ((1UL << (CHMUX_AVL_SHIFT - CHMUX_OFF_SHIFT)) - 1UL); - chmux_value = (((uint32_t)signal) >> CHMUX_VAL_SHIFT) & ((1UL << (CHMUX_OFF_SHIFT - CHMUX_VAL_SHIFT)) - 1UL); - *(volatile uint32_t *)(((uint32_t)base) + chmux_offset) = chmux_value; - } - ena_id_mask = (1UL << (CHMUX_VAL_SHIFT - ENA_SHIFT)) - 1U; -#endif - /* extract enable register to be used */ - ena_id = (((uint32_t)signal) >> ENA_SHIFT) & ena_id_mask; - /* extract enable bit offset */ - bit_offset = ((uint32_t)signal) & ((1UL << ENA_SHIFT) - 1U); - /* set signal */ - if (enable) - { - *(volatile uint32_t *)(((uint32_t)base) + ena_id) |= (1UL << bit_offset); - } - else - { - *(volatile uint32_t *)(((uint32_t)base) + ena_id) &= ~(1UL << bit_offset); - } -} -#endif - -/*! - * brief Deinitialize INPUTMUX peripheral. - - * This function disables the INPUTMUX clock. - * - * param base Base address of the INPUTMUX peripheral. - * - * retval None. - */ -void INPUTMUX_Deinit(INPUTMUX_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#if defined(FSL_FEATURE_INPUTMUX_HAS_NO_INPUTMUX_CLOCK_SOURCE) && FSL_FEATURE_INPUTMUX_HAS_NO_INPUTMUX_CLOCK_SOURCE -#if (defined(FSL_FEATURE_SOC_SCT_COUNT) && (FSL_FEATURE_SOC_SCT_COUNT > 0)) - CLOCK_DisableClock(kCLOCK_Sct); -#endif /* FSL_FEATURE_SOC_SCT_COUNT */ - CLOCK_DisableClock(kCLOCK_Dma); -#else - CLOCK_DisableClock(kCLOCK_InputMux); -#endif /* FSL_FEATURE_INPUTMUX_HAS_NO_INPUTMUX_CLOCK_SOURCE */ -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_inputmux.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_inputmux.h deleted file mode 100644 index 4c185b5195c..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_inputmux.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_INPUTMUX_H_ -#define FSL_INPUTMUX_H_ - -#include "fsl_inputmux_connections.h" -#include "fsl_common.h" - -/*! - * @addtogroup inputmux_driver - * @{ - */ - -/*! @file */ -/*! @file fsl_inputmux_connections.h */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief Group interrupt driver version for SDK */ -#define FSL_INPUTMUX_DRIVER_VERSION (MAKE_VERSION(2, 0, 7)) -/*@}*/ - -/******************************************************************************* - * API - ******************************************************************************/ - -#ifdef __cplusplus -extern "C" { -#endif - -/*! - * @brief Initialize INPUTMUX peripheral. - - * This function enables the INPUTMUX clock. - * - * @param base Base address of the INPUTMUX peripheral. - * - * @retval None. - */ -void INPUTMUX_Init(INPUTMUX_Type *base); - -/*! - * @brief Attaches a signal - * - * This function attaches multiplexed signals from INPUTMUX to target signals. - * For example, to attach GPIO PORT0 Pin 5 to PINT peripheral, do the following: - * @code - * INPUTMUX_AttachSignal(INPUTMUX, 2, kINPUTMUX_GpioPort0Pin5ToPintsel); - * @endcode - * In this example, INTMUX has 8 registers for PINT, PINT_SEL0~PINT_SEL7. - * With parameter @p index specified as 2, this function configures register PINT_SEL2. - * - * @param base Base address of the INPUTMUX peripheral. - * @param index The serial number of destination register in the group of INPUTMUX registers with same name. - * @param connection Applies signal from source signals collection to target signal. - * - * @retval None. - */ -void INPUTMUX_AttachSignal(INPUTMUX_Type *base, uint32_t index, inputmux_connection_t connection); - -#if defined(FSL_FEATURE_INPUTMUX_HAS_SIGNAL_ENA) -/*! - * @brief Enable/disable a signal - * - * This function gates the INPUTPMUX clock. - * - * @param base Base address of the INPUTMUX peripheral. - * @param signal Enable signal register id and bit offset. - * @param enable Selects enable or disable. - * - * @retval None. - */ -void INPUTMUX_EnableSignal(INPUTMUX_Type *base, inputmux_signal_t signal, bool enable); -#endif - -/*! - * @brief Deinitialize INPUTMUX peripheral. - - * This function disables the INPUTMUX clock. - * - * @param base Base address of the INPUTMUX peripheral. - * - * @retval None. - */ -void INPUTMUX_Deinit(INPUTMUX_Type *base); - -#ifdef __cplusplus -} -#endif - -/*@}*/ - -#endif /* FSL_INPUTMUX_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_inputmux_connections.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_inputmux_connections.h deleted file mode 100644 index 629a6aa25e6..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_inputmux_connections.h +++ /dev/null @@ -1,3664 +0,0 @@ -/* - * Copyright 2022 , NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _FSL_INPUTMUX_CONNECTIONS_ -#define _FSL_INPUTMUX_CONNECTIONS_ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.inputmux_connections" -#endif - -/*! - * @addtogroup inputmux_driver - * @{ - */ - -/*! - * @name Input multiplexing connections - * @{ - */ - -/*! @brief Periphinmux IDs */ -#define TIMER0CAPTSEL0 0x20U -#define TIMER0TRIGIN 0x30U -#define TIMER1CAPTSEL0 0x40U -#define TIMER1TRIGIN 0x50U -#define TIMER2CAPTSEL0 0x60U -#define TIMER2TRIGIN 0x70U -#define SMARTDMAARCHB_INMUX0 0xA0U -#define PINTSEL0 0xC0U -#define FREQMEAS_REF_REG 0x180U -#define FREQMEAS_TAR_REG 0x184U -#define TIMER3CAPTSEL0 0x1A0U -#define TIMER3TRIGIN 0x1B0U -#define TIMER4CAPTSEL0 0x1C0U -#define TIMER4TRIGIN 0x1D0U -#define CMP0_TRIG_REG 0x260U -#define ADC0_TRIG0 0x280U -#define ADC1_TRIG0 0x2C0U -#define QDC0_TRIG_REG 0x360U -#define QDC0_HOME_REG 0x364U -#define QDC0_INDEX_REG 0x368U -#define QDC0_PHASEB_REG 0x36CU -#define QDC0_PHASEA_REG 0x370U -#define QDC1_TRIG_REG 0x380U -#define QDC1_HOME_REG 0x384U -#define QDC1_INDEX_REG 0x388U -#define QDC1_PHASEB_REG 0x38CU -#define QDC1_PHASEA_REG 0x390U -#define FlexPWM0_SM0_EXTSYNC_REG 0x3A0U -#define FlexPWM0_SM1_EXTSYNC_REG 0x3A4U -#define FlexPWM0_SM2_EXTSYNC_REG 0x3A8U -#define FlexPWM0_SM3_EXTSYNC_REG 0x3ACU -#define FlexPWM0_SM0_EXTA_REG 0x3B0U -#define FlexPWM0_SM1_EXTA_REG 0x3B4U -#define FlexPWM0_SM2_EXTA_REG 0x3B8U -#define FlexPWM0_SM3_EXTA_REG 0x3BCU -#define FlexPWM0_EXTFORCE_REG 0x3C0U -#define FlexPWM0_FAULT0_REG 0x3C4U -#define FlexPWM0_FAULT1_REG 0x3C8U -#define FlexPWM0_FAULT2_REG 0x3CCU -#define FlexPWM0_FAULT3_REG 0x3D0U -#define FlexPWM1_SM0_EXTSYNC_REG 0x3E0U -#define FlexPWM1_SM1_EXTSYNC_REG 0x3E4U -#define FlexPWM1_SM2_EXTSYNC_REG 0x3E8U -#define FlexPWM1_SM3_EXTSYNC_REG 0x3ECU -#define FlexPWM1_SM0_EXTA_REG 0x3F0U -#define FlexPWM1_SM1_EXTA_REG 0x3F4U -#define FlexPWM1_SM2_EXTA_REG 0x3F8U -#define FlexPWM1_SM3_EXTA_REG 0x3FCU -#define FlexPWM1_EXTFORCE_REG 0x400U -#define FlexPWM1_FAULT0_REG 0x404U -#define FlexPWM1_FAULT1_REG 0x408U -#define FlexPWM1_FAULT2_REG 0x40CU -#define FlexPWM1_FAULT3_REG 0x410U -#define PWM0_EXT_CLK_REG 0x420U -#define PWM1_EXT_CLK_REG 0x424U -#define EVTG_TRIG0_REG 0x440U -#define EXT_TRIG0_REG 0x4C0U -#define CMP1_TRIG_REG 0x4E0U -#define FLEXCOMM0_TRIG_REG 0x5A0U -#define FLEXCOMM1_TRIG_REG 0x5C0U -#define FLEXCOMM2_TRIG_REG 0x5E0U -#define FLEXCOMM3_TRIG_REG 0x600U -#define FLEXCOMM4_TRIG_REG 0x620U -#define FLEXCOMM5_TRIG_REG 0x640U -#define FLEXCOMM6_TRIG_REG 0x660U -#define FLEXCOMM7_TRIG_REG 0x680U -#define FLEXIO_TRIG0_REG 0x6E0U - -#define DMA0_REQ_ENABLE0_REG 0x700U -#define DMA0_REQ_ENABLE1_REG 0x710U -#define DMA0_REQ_ENABLE2_REG 0x720U -#define DMA0_REQ_ENABLE3_REG 0x730U -#define DMA1_REQ_ENABLE0_REG 0x780U -#define DMA1_REQ_ENABLE1_REG 0x790U -#define DMA1_REQ_ENABLE2_REG 0x7A0U -#define DMA1_REQ_ENABLE3_REG 0x7B0U - -#define ENA_SHIFT 8U -#define PMUX_SHIFT 20U - -/*! @brief INPUTMUX connections type */ -typedef enum _inputmux_connection_t -{ - /*!< TIMER0 CAPTSEL. */ - kINPUTMUX_CtimerInp0ToTimer0Captsel = 0U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer0Captsel = 1U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer0Captsel = 2U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer0Captsel = 3U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer0Captsel = 4U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer0Captsel = 5U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer0Captsel = 6U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer0Captsel = 7U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer0Captsel = 8U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer0Captsel = 9U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp10ToTimer0Captsel = 10U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp11ToTimer0Captsel = 11U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer0Captsel = 12U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer0Captsel = 13U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer0Captsel = 14U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer0Captsel = 15U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer0Captsel = 16U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer0Captsel = 17U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer0Captsel = 18U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer0Captsel = 19U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer0Captsel = 20U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Usb1StartOfFrameToTimer0Captsel = 21U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_DcdcBurstActiveToTimer0Captsel = 22U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai0TxSyncOutToTimer0Captsel = 23U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai0RxSyncOutToTimer0Captsel = 24U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0IrqToTimer0Captsel = 25U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc1IrqToTimer0Captsel = 26U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer0Captsel = 27U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer0Captsel = 28U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig01ToTimer0Captsel = 30U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig01ToTimer0Captsel = 31U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig01ToTimer0Captsel = 32U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig01ToTimer0Captsel = 33U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig01ToTimer0Captsel = 34U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig01ToTimer0Captsel = 35U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig01ToTimer0Captsel = 36U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig01ToTimer0Captsel = 37U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToTimer0Captsel = 38U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToTimer0Captsel = 39U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToTimer0Captsel = 40U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToTimer0Captsel = 41U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToTimer0Captsel = 42U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToTimer0Captsel = 43U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToTimer0Captsel = 44U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToTimer0Captsel = 45U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToTimer0Captsel = 46U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToTimer0Captsel = 47U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig0ToTimer0Captsel = 50U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig1ToTimer0Captsel = 51U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig2ToTimer0Captsel = 52U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig0ToTimer0Captsel = 53U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig1ToTimer0Captsel = 54U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig2ToTimer0Captsel = 55U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig0ToTimer0Captsel = 56U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig1ToTimer0Captsel = 57U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig2ToTimer0Captsel = 58U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig0ToTimer0Captsel = 59U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig1ToTimer0Captsel = 60U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig2ToTimer0Captsel = 61U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig3ToTimer0Captsel = 62U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai1TxSyncOutToTimer0Captsel = 63U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai1RxSyncOutToTimer0Captsel = 64U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - - /*!< TIMER1 CAPTSEL. */ - kINPUTMUX_CtimerInp0ToTimer1Captsel = 0U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer1Captsel = 1U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer1Captsel = 2U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer1Captsel = 3U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer1Captsel = 4U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer1Captsel = 5U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer1Captsel = 6U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer1Captsel = 7U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer1Captsel = 8U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer1Captsel = 9U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp10ToTimer1Captsel = 10U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp11ToTimer1Captsel = 11U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer1Captsel = 12U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer1Captsel = 13U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer1Captsel = 14U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer1Captsel = 15U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer1Captsel = 16U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer1Captsel = 17U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer1Captsel = 18U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer1Captsel = 19U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer1Captsel = 20U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Usb1StartOfFrameToTimer1Captsel = 21U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_DcdcBurstActiveToTimer1Captsel = 22U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai0TxSyncOutToTimer1Captsel = 23U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai0RxSyncOutToTimer1Captsel = 24U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0IrqToTimer1Captsel = 25U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc1IrqToTimer1Captsel = 26U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer1Captsel = 27U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer1Captsel = 28U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig01ToTimer1Captsel = 30U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig01ToTimer1Captsel = 31U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig01ToTimer1Captsel = 32U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig01ToTimer1Captsel = 33U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig01ToTimer1Captsel = 34U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig01ToTimer1Captsel = 35U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig01ToTimer1Captsel = 36U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig01ToTimer1Captsel = 37U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToTimer1Captsel = 38U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToTimer1Captsel = 39U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToTimer1Captsel = 40U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToTimer1Captsel = 41U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToTimer1Captsel = 42U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToTimer1Captsel = 43U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToTimer1Captsel = 44U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToTimer1Captsel = 45U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToTimer1Captsel = 46U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToTimer1Captsel = 47U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig0ToTimer1Captsel = 50U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig1ToTimer1Captsel = 51U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig2ToTimer1Captsel = 52U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig0ToTimer1Captsel = 53U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig1ToTimer1Captsel = 54U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig2ToTimer1Captsel = 55U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig0ToTimer1Captsel = 56U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig1ToTimer1Captsel = 57U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig2ToTimer1Captsel = 58U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig0ToTimer1Captsel = 59U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig1ToTimer1Captsel = 60U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig2ToTimer1Captsel = 61U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig3ToTimer1Captsel = 62U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai1TxSyncOutToTimer1Captsel = 63U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai1RxSyncOutToTimer1Captsel = 64U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - - /*!< TIMER2 CAPTSEL. */ - kINPUTMUX_CtimerInp0ToTimer2Captsel = 0U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer2Captsel = 1U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer2Captsel = 2U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer2Captsel = 3U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer2Captsel = 4U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer2Captsel = 5U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer2Captsel = 6U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer2Captsel = 7U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer2Captsel = 8U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer2Captsel = 9U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp10ToTimer2Captsel = 10U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp11ToTimer2Captsel = 11U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer2Captsel = 12U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer2Captsel = 13U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer2Captsel = 14U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer2Captsel = 15U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer2Captsel = 16U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer2Captsel = 17U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer2Captsel = 18U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer2Captsel = 19U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer2Captsel = 20U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Usb1StartOfFrameToTimer2Captsel = 21U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_DcdcBurstActiveToTimer2Captsel = 22U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai0TxSyncOutToTimer2Captsel = 23U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai0RxSyncOutToTimer2Captsel = 24U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0IrqToTimer2Captsel = 25U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc1IrqToTimer2Captsel = 26U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer2Captsel = 27U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer2Captsel = 28U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig01ToTimer2Captsel = 30U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig01ToTimer2Captsel = 31U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig01ToTimer2Captsel = 32U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig01ToTimer2Captsel = 33U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig01ToTimer2Captsel = 34U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig01ToTimer2Captsel = 35U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig01ToTimer2Captsel = 36U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig01ToTimer2Captsel = 37U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToTimer2Captsel = 38U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToTimer2Captsel = 39U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToTimer2Captsel = 40U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToTimer2Captsel = 41U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToTimer2Captsel = 42U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToTimer2Captsel = 43U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToTimer2Captsel = 44U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToTimer2Captsel = 45U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToTimer2Captsel = 46U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToTimer2Captsel = 47U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig0ToTimer2Captsel = 50U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig1ToTimer2Captsel = 51U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig2ToTimer2Captsel = 52U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig0ToTimer2Captsel = 53U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig1ToTimer2Captsel = 54U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig2ToTimer2Captsel = 55U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig0ToTimer2Captsel = 56U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig1ToTimer2Captsel = 57U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig2ToTimer2Captsel = 58U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig0ToTimer2Captsel = 59U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig1ToTimer2Captsel = 60U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig2ToTimer2Captsel = 61U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig3ToTimer2Captsel = 62U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai1TxSyncOutToTimer2Captsel = 63U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai1RxSyncOutToTimer2Captsel = 64U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - - /*!< TIMER3 CAPTSEL. */ - kINPUTMUX_CtimerInp0ToTimer3Captsel = 0U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer3Captsel = 1U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer3Captsel = 2U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer3Captsel = 3U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer3Captsel = 4U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer3Captsel = 5U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer3Captsel = 6U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer3Captsel = 7U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer3Captsel = 8U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer3Captsel = 9U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp10ToTimer3Captsel = 10U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp11ToTimer3Captsel = 11U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer3Captsel = 12U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer3Captsel = 13U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer3Captsel = 14U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer3Captsel = 15U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer3Captsel = 16U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer3Captsel = 17U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer3Captsel = 18U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer3Captsel = 19U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer3Captsel = 20U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Usb1StartOfFrameToTimer3Captsel = 21U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_DcdcBurstActiveToTimer3Captsel = 22U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai0TxSyncOutToTimer3Captsel = 23U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai0RxSyncOutToTimer3Captsel = 24U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0IrqToTimer3Captsel = 25U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc1IrqToTimer3Captsel = 26U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer3Captsel = 27U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer3Captsel = 28U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig01ToTimer3Captsel = 30U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig01ToTimer3Captsel = 31U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig01ToTimer3Captsel = 32U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig01ToTimer3Captsel = 33U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig01ToTimer3Captsel = 34U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig01ToTimer3Captsel = 35U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig01ToTimer3Captsel = 36U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig01ToTimer3Captsel = 37U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToTimer3Captsel = 38U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToTimer3Captsel = 39U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToTimer3Captsel = 40U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToTimer3Captsel = 41U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToTimer3Captsel = 42U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToTimer3Captsel = 43U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToTimer3Captsel = 44U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToTimer3Captsel = 45U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToTimer3Captsel = 46U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToTimer3Captsel = 47U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig0ToTimer3Captsel = 50U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig1ToTimer3Captsel = 51U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig2ToTimer3Captsel = 52U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig0ToTimer3Captsel = 53U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig1ToTimer3Captsel = 54U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig2ToTimer3Captsel = 55U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig0ToTimer3Captsel = 56U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig1ToTimer3Captsel = 57U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig2ToTimer3Captsel = 58U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig0ToTimer3Captsel = 59U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig1ToTimer3Captsel = 60U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig2ToTimer3Captsel = 61U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig3ToTimer3Captsel = 62U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai1TxSyncOutToTimer3Captsel = 63U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai1RxSyncOutToTimer3Captsel = 64U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - - /*!< Timer4 CAPTSEL. */ - kINPUTMUX_CtimerInp0ToTimer4Captsel = 0U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer4Captsel = 1U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer4Captsel = 2U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer4Captsel = 3U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer4Captsel = 4U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer4Captsel = 5U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer4Captsel = 6U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer4Captsel = 7U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer4Captsel = 8U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer4Captsel = 9U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp10ToTimer4Captsel = 10U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp11ToTimer4Captsel = 11U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer4Captsel = 12U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer4Captsel = 13U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer4Captsel = 14U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer4Captsel = 15U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer4Captsel = 16U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer4Captsel = 17U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer4Captsel = 18U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer4Captsel = 19U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer4Captsel = 20U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Usb1StartOfFrameToTimer4Captsel = 21U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_DcdcBurstActiveToTimer4Captsel = 22U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai0TxSyncOutToTimer4Captsel = 23U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai0RxSyncOutToTimer4Captsel = 24U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0IrqToTimer4Captsel = 25U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc1IrqToTimer4Captsel = 26U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer4Captsel = 27U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer4Captsel = 28U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig01ToTimer4Captsel = 30U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig01ToTimer4Captsel = 31U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig01ToTimer4Captsel = 32U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig01ToTimer4Captsel = 33U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig01ToTimer4Captsel = 34U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig01ToTimer4Captsel = 35U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig01ToTimer4Captsel = 36U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig01ToTimer4Captsel = 37U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToTimer4Captsel = 38U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToTimer4Captsel = 39U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToTimer4Captsel = 40U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToTimer4Captsel = 41U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToTimer4Captsel = 42U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToTimer4Captsel = 43U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToTimer4Captsel = 44U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToTimer4Captsel = 45U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToTimer4Captsel = 46U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToTimer4Captsel = 47U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig0ToTimer4Captsel = 50U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig1ToTimer4Captsel = 51U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig2ToTimer4Captsel = 52U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig0ToTimer4Captsel = 53U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig1ToTimer4Captsel = 54U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig2ToTimer4Captsel = 55U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig0ToTimer4Captsel = 56U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig1ToTimer4Captsel = 57U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig2ToTimer4Captsel = 58U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig0ToTimer4Captsel = 59U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig1ToTimer4Captsel = 60U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig2ToTimer4Captsel = 61U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig3ToTimer4Captsel = 62U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai1TxSyncOutToTimer4Captsel = 63U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai1RxSyncOutToTimer4Captsel = 64U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - - /*!< TIMER0 Trigger. */ - kINPUTMUX_CtimerInp0ToTimer0Trigger = 0U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer0Trigger = 1U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer0Trigger = 2U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer0Trigger = 3U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer0Trigger = 4U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer0Trigger = 5U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer0Trigger = 6U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer0Trigger = 7U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer0Trigger = 8U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer0Trigger = 9U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp10ToTimer0Trigger = 10U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp11ToTimer0Trigger = 11U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer0Trigger = 12U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer0Trigger = 13U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer0Trigger = 14U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer0Trigger = 15U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer0Trigger = 16U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer0Trigger = 17U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer0Trigger = 18U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer0Trigger = 19U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer0Trigger = 20U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Usb1StartOfFrameToTimer0Trigger = 21U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_DcdcBurstActiveToTimer0Trigger = 22U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai0TxSyncOutToTimer0Trigger = 23U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai0RxSyncOutToTimer0Trigger = 24U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0IrqToTimer0Trigger = 25U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc1IrqToTimer0Trigger = 26U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer0Trigger = 27U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer0Trigger = 28U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig01ToTimer0Trigger = 30U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig01ToTimer0Trigger = 31U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig01ToTimer0Trigger = 32U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig01ToTimer0Trigger = 33U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig01ToTimer0Trigger = 34U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig01ToTimer0Trigger = 35U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig01ToTimer0Trigger = 36U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig01ToTimer0Trigger = 37U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToTimer0Trigger = 38U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToTimer0Trigger = 39U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToTimer0Trigger = 40U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToTimer0Trigger = 41U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToTimer0Trigger = 42U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToTimer0Trigger = 43U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToTimer0Trigger = 44U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToTimer0Trigger = 45U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToTimer0Trigger = 46U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToTimer0Trigger = 47U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig0ToTimer0Trigger = 50U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig1ToTimer0Trigger = 51U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig2ToTimer0Trigger = 52U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig0ToTimer0Trigger = 53U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig1ToTimer0Trigger = 54U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig2ToTimer0Trigger = 55U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig0ToTimer0Trigger = 56U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig1ToTimer0Trigger = 57U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig2ToTimer0Trigger = 58U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig0ToTimer0Trigger = 59U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig1ToTimer0Trigger = 60U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig2ToTimer0Trigger = 61U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig3ToTimer0Trigger = 62U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai1TxSyncOutToTimer0Trigger = 63U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai1RxSyncOutToTimer0Trigger = 64U + (TIMER0TRIGIN << PMUX_SHIFT), - - /*!< TIMER1 Trigger. */ - kINPUTMUX_CtimerInp0ToTimer1Trigger = 0U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer1Trigger = 1U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer1Trigger = 2U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer1Trigger = 3U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer1Trigger = 4U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer1Trigger = 5U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer1Trigger = 6U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer1Trigger = 7U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer1Trigger = 8U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer1Trigger = 9U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp10ToTimer1Trigger = 10U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp11ToTimer1Trigger = 11U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer1Trigger = 12U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer1Trigger = 13U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer1Trigger = 14U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer1Trigger = 15U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer1Trigger = 16U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer1Trigger = 17U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer1Trigger = 18U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer1Trigger = 19U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer1Trigger = 20U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Usb1StartOfFrameToTimer1Trigger = 21U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_DcdcBurstActiveToTimer1Trigger = 22U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai0TxSyncOutToTimer1Trigger = 23U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai0RxSyncOutToTimer1Trigger = 24U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0IrqToTimer1Trigger = 25U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc1IrqToTimer1Trigger = 26U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer1Trigger = 27U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer1Trigger = 28U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig01ToTimer1Trigger = 30U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig01ToTimer1Trigger = 31U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig01ToTimer1Trigger = 32U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig01ToTimer1Trigger = 33U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig01ToTimer1Trigger = 34U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig01ToTimer1Trigger = 35U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig01ToTimer1Trigger = 36U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig01ToTimer1Trigger = 37U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToTimer1Trigger = 38U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToTimer1Trigger = 39U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToTimer1Trigger = 40U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToTimer1Trigger = 41U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToTimer1Trigger = 42U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToTimer1Trigger = 43U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToTimer1Trigger = 44U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToTimer1Trigger = 45U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToTimer1Trigger = 46U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToTimer1Trigger = 47U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig0ToTimer1Trigger = 50U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig1ToTimer1Trigger = 51U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig2ToTimer1Trigger = 52U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig0ToTimer1Trigger = 53U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig1ToTimer1Trigger = 54U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig2ToTimer1Trigger = 55U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig0ToTimer1Trigger = 56U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig1ToTimer1Trigger = 57U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig2ToTimer1Trigger = 58U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig0ToTimer1Trigger = 59U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig1ToTimer1Trigger = 60U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig2ToTimer1Trigger = 61U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig3ToTimer1Trigger = 62U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai1TxSyncOutToTimer1Trigger = 63U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai1RxSyncOutToTimer1Trigger = 64U + (TIMER1TRIGIN << PMUX_SHIFT), - - /*!< TIMER2 Trigger. */ - kINPUTMUX_CtimerInp0ToTimer2Trigger = 0U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer2Trigger = 1U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer2Trigger = 2U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer2Trigger = 3U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer2Trigger = 4U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer2Trigger = 5U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer2Trigger = 6U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer2Trigger = 7U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer2Trigger = 8U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer2Trigger = 9U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp10ToTimer2Trigger = 10U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp11ToTimer2Trigger = 11U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer2Trigger = 12U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer2Trigger = 13U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer2Trigger = 14U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer2Trigger = 15U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer2Trigger = 16U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer2Trigger = 17U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer2Trigger = 18U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer2Trigger = 19U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer2Trigger = 20U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Usb1StartOfFrameToTimer2Trigger = 21U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_DcdcBurstActiveToTimer2Trigger = 22U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai0TxSyncOutToTimer2Trigger = 23U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai0RxSyncOutToTimer2Trigger = 24U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0IrqToTimer2Trigger = 25U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc1IrqToTimer2Trigger = 26U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer2Trigger = 27U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer2Trigger = 28U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig01ToTimer2Trigger = 30U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig01ToTimer2Trigger = 31U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig01ToTimer2Trigger = 32U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig01ToTimer2Trigger = 33U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig01ToTimer2Trigger = 34U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig01ToTimer2Trigger = 35U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig01ToTimer2Trigger = 36U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig01ToTimer2Trigger = 37U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToTimer2Trigger = 38U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToTimer2Trigger = 39U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToTimer2Trigger = 40U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToTimer2Trigger = 41U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToTimer2Trigger = 42U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToTimer2Trigger = 43U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToTimer2Trigger = 44U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToTimer2Trigger = 45U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToTimer2Trigger = 46U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToTimer2Trigger = 47U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig0ToTimer2Trigger = 50U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig1ToTimer2Trigger = 51U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig2ToTimer2Trigger = 52U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig0ToTimer2Trigger = 53U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig1ToTimer2Trigger = 54U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig2ToTimer2Trigger = 55U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig0ToTimer2Trigger = 56U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig1ToTimer2Trigger = 57U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig2ToTimer2Trigger = 58U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig0ToTimer2Trigger = 59U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig1ToTimer2Trigger = 60U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig2ToTimer2Trigger = 61U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig3ToTimer2Trigger = 62U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai1TxSyncOutToTimer2Trigger = 63U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai1RxSyncOutToTimer2Trigger = 64U + (TIMER2TRIGIN << PMUX_SHIFT), - - /*!< TIMER3 Trigger. */ - kINPUTMUX_CtimerInp0ToTimer3Trigger = 0U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer3Trigger = 1U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer3Trigger = 2U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer3Trigger = 3U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer3Trigger = 4U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer3Trigger = 5U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer3Trigger = 6U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer3Trigger = 7U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer3Trigger = 8U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer3Trigger = 9U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp10ToTimer3Trigger = 10U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp11ToTimer3Trigger = 11U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer3Trigger = 12U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer3Trigger = 13U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer3Trigger = 14U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer3Trigger = 15U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer3Trigger = 16U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer3Trigger = 17U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer3Trigger = 18U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer3Trigger = 19U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer3Trigger = 20U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Usb1StartOfFrameToTimer3Trigger = 21U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_DcdcBurstActiveToTimer3Trigger = 22U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai0TxSyncOutToTimer3Trigger = 23U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai0RxSyncOutToTimer3Trigger = 24U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0IrqToTimer3Trigger = 25U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc1IrqToTimer3Trigger = 26U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer3Trigger = 27U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer3Trigger = 28U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig01ToTimer3Trigger = 30U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig01ToTimer3Trigger = 31U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig01ToTimer3Trigger = 32U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig01ToTimer3Trigger = 33U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig01ToTimer3Trigger = 34U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig01ToTimer3Trigger = 35U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig01ToTimer3Trigger = 36U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig01ToTimer3Trigger = 37U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToTimer3Trigger = 38U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToTimer3Trigger = 39U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToTimer3Trigger = 40U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToTimer3Trigger = 41U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToTimer3Trigger = 42U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToTimer3Trigger = 43U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToTimer3Trigger = 44U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToTimer3Trigger = 45U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToTimer3Trigger = 46U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToTimer3Trigger = 47U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig0ToTimer3Trigger = 50U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig1ToTimer3Trigger = 51U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig2ToTimer3Trigger = 52U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig0ToTimer3Trigger = 53U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig1ToTimer3Trigger = 54U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig2ToTimer3Trigger = 55U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig0ToTimer3Trigger = 56U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig1ToTimer3Trigger = 57U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig2ToTimer3Trigger = 58U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig0ToTimer3Trigger = 59U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig1ToTimer3Trigger = 60U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig2ToTimer3Trigger = 61U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig3ToTimer3Trigger = 62U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai1TxSyncOutToTimer3Trigger = 63U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai1RxSyncOutToTimer3Trigger = 64U + (TIMER3TRIGIN << PMUX_SHIFT), - - /*!< TIMER4 Trigger. */ - kINPUTMUX_CtimerInp0ToTimer4Trigger = 0U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer4Trigger = 1U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer4Trigger = 2U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer4Trigger = 3U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer4Trigger = 4U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer4Trigger = 5U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer4Trigger = 6U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer4Trigger = 7U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer4Trigger = 8U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer4Trigger = 9U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp10ToTimer4Trigger = 10U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp11ToTimer4Trigger = 11U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer4Trigger = 12U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer4Trigger = 13U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer4Trigger = 14U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer4Trigger = 15U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer4Trigger = 16U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer4Trigger = 17U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer4Trigger = 18U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer4Trigger = 19U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer4Trigger = 20U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Usb1StartOfFrameToTimer4Trigger = 21U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_DcdcBurstActiveToTimer4Trigger = 22U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai0TxSyncOutToTimer4Trigger = 23U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai0RxSyncOutToTimer4Trigger = 24U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0IrqToTimer4Trigger = 25U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc1IrqToTimer4Trigger = 26U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer4Trigger = 27U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer4Trigger = 28U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig01ToTimer4Trigger = 30U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig01ToTimer4Trigger = 31U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig01ToTimer4Trigger = 32U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig01ToTimer4Trigger = 33U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig01ToTimer4Trigger = 34U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig01ToTimer4Trigger = 35U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig01ToTimer4Trigger = 36U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig01ToTimer4Trigger = 37U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToTimer4Trigger = 38U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToTimer4Trigger = 39U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToTimer4Trigger = 40U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToTimer4Trigger = 41U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToTimer4Trigger = 42U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToTimer4Trigger = 43U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToTimer4Trigger = 44U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToTimer4Trigger = 45U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToTimer4Trigger = 46U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToTimer4Trigger = 47U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig0ToTimer4Trigger = 50U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig1ToTimer4Trigger = 51U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig2ToTimer4Trigger = 52U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig0ToTimer4Trigger = 53U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig1ToTimer4Trigger = 54U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig2ToTimer4Trigger = 55U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig0ToTimer4Trigger = 56U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig1ToTimer4Trigger = 57U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig2ToTimer4Trigger = 58U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig0ToTimer4Trigger = 59U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig1ToTimer4Trigger = 60U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig2ToTimer4Trigger = 61U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig3ToTimer4Trigger = 62U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai1TxSyncOutToTimer4Trigger = 63U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai1RxSyncOutToTimer4Trigger = 64U + (TIMER4TRIGIN << PMUX_SHIFT), - - /*!< SMARTDMA arch B inputs. */ - kINPUTMUX_GpioPort0Pin0ToSmartDma = 0U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin1ToSmartDma = 1U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin2ToSmartDma = 2U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin3ToSmartDma = 3U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin4ToSmartDma = 4U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin5ToSmartDma = 5U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin6ToSmartDma = 6U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin7ToSmartDma = 7U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin12ToSmartDma = 12U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin13ToSmartDma = 13U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin14ToSmartDma = 14U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin15ToSmartDma = 15U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_MrtCh0IrqToSmartDma = 20U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_MrtCh1IrqToSmartDma = 21U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToSmartDma = 22U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToSmartDma = 23U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToSmartDma = 24U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToSmartDma = 25U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToSmartDma = 26U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToSmartDma = 27U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_UtickIrqToSmartDma = 28U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Wdt0IrqToSmartDma = 29U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Adc0IrqToSmartDma = 30U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Cmp0IrqToSmartDma = 31U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm7IrqToSmartDma = 33U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm6IrqToSmartDma = 34U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm5IrqToSmartDma = 35U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm4IrqToSmartDma = 36U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3IrqToSmartDma = 37U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2IrqToSmartDma = 38U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1IrqToSmartDma = 39U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0IrqToSmartDma = 40U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Dma0IrqToSmartDma = 41U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Dma1IrqToSmartDma = 42U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_SysIrqToSmartDma = 43U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_RtcComboIrqToSmartDma = 44U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_ArmTxevToSmartDma = 45U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToSmartDma = 46U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToSmartDma = 49U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameIrqToSmartDma = 50U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Usb1StartOfFrameIrqToSmartDma = 51U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_OsEventTimerIrqToSmartDma = 52U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Adc1IrqToSmartDma = 53U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Cmp01IrqToSmartDma = 54U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Pwm0IrqToSmartDma = 57U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Pwm1IrqToSmartDma = 58U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Qdc0IrqToSmartDma = 59U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Qdc1IrqToSmartDma = 60U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToSmartDma = 61U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToSmartDma = 62U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToSmartDma = 65U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig1ToSmartDma = 66U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToSmartDma = 67U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToSmartDma = 68U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToSmartDma = 69U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToSmartDma = 70U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_FlexioShifterDmaRequest0ToSmartDma = 71U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_FlexioShifterDmaRequest1ToSmartDma = 72U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_FlexioShifterDmaRequest2ToSmartDma = 73U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_FlexioShifterDmaRequest3ToSmartDma = 74U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_FlexioShifterDmaRequest4ToSmartDma = 75U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_FlexioShifterDmaRequest5ToSmartDma = 76U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_FlexioShifterDmaRequest6ToSmartDma = 77U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_FlexioShifterDmaRequest7ToSmartDma = 78U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - - /*!< Pin interrupt select. */ - kINPUTMUX_GpioPort0Pin0ToPintsel = 0U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin1ToPintsel = 1U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin2ToPintsel = 2U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin3ToPintsel = 3U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin4ToPintsel = 4U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin5ToPintsel = 5U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin6ToPintsel = 6U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin7ToPintsel = 7U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin12ToPintsel = 12U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin13ToPintsel = 13U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin14ToPintsel = 14U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin15ToPintsel = 15U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin16ToPintsel = 16U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin17ToPintsel = 17U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin18ToPintsel = 18U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin19ToPintsel = 19U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin20ToPintsel = 20U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin21ToPintsel = 21U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin22ToPintsel = 22U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin23ToPintsel = 23U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin24ToPintsel = 24U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin25ToPintsel = 25U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin26ToPintsel = 26U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin27ToPintsel = 27U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin28ToPintsel = 28U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin29ToPintsel = 29U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin0ToPintsel = 32U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin1ToPintsel = 33U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin2ToPintsel = 34U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin3ToPintsel = 35U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin4ToPintsel = 36U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin5ToPintsel = 37U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin6ToPintsel = 38U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin7ToPintsel = 39U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin8ToPintsel = 40U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin9ToPintsel = 41U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin10ToPintsel = 42U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin11ToPintsel = 43U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin12ToPintsel = 44U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin13ToPintsel = 45U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin14ToPintsel = 46U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin15ToPintsel = 47U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin16ToPintsel = 48U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin17ToPintsel = 49U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin18ToPintsel = 50U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin19ToPintsel = 51U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin30ToPintsel = 62U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin31ToPintsel = 63U + (PINTSEL0 << PMUX_SHIFT), - - /*!< Selection for frequency measurement reference clock. */ - kINPUTMUX_ClkInToFreqmeasRef = 0U + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_Fro12MToFreqmeasRef = 1u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_Fro144MToFreqmeasRef = 2u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_Osc32KToFreqmeasRef = 4u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_CpuAhbClkToFreqmeasRef = 5u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_FreqmeClkIn0ToFreqmeasRef = 6u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_FreqmeClkIn1ToFreqmeasRef = 7u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFreqmeasRef = 8u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFreqmeasRef = 9u + (FREQMEAS_REF_REG << PMUX_SHIFT), - - /*!< Selection for frequency measurement target clock. */ - kINPUTMUX_ClkInToFreqmeasTar = 0U + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_Fro12MToFreqmeasTar = 1u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_Fro144MToFreqmeasTar = 2u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_Osc32KToFreqmeasTar = 4u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_CpuAhbClkToFreqmeasTar = 5u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_FreqmeClkIn0ToFreqmeasTar = 6u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_FreqmeClkIn1ToFreqmeasTar = 7u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFreqmeasTar = 8u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFreqmeasTar = 9u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - - /*!< Cmp0 Trigger. */ - kINPUTMUX_PinInt0ToCmp0Trigger = 0U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt6ToCmp0Trigger = 1U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToCmp0Trigger = 5U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToCmp0Trigger = 6U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToCmp0Trigger = 7U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M0ToCmp0Trigger = 8U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToCmp0Trigger = 9U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToCmp0Trigger = 11U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToCmp0Trigger = 12U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToCmp0Trigger = 13U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToCmp0Trigger = 14U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig01ToCmp0Trigger = 17U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig01ToCmp0Trigger = 18U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig01ToCmp0Trigger = 19U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig01ToCmp0Trigger = 20U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig01ToCmp0Trigger = 21U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig01ToCmp0Trigger = 22U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig01ToCmp0Trigger = 23U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig01ToCmp0Trigger = 24U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToCmp0Trigger = 25U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToCmp0Trigger = 26U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToCmp0Trigger = 27U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToCmp0Trigger = 28U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToCmp0Trigger = 29U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToCmp0Trigger = 30U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToCmp0Trigger = 31U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToCmp0Trigger = 32U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToCmp0Trigger = 33U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToCmp0Trigger = 34U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToCmp0Trigger = 35U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToCmp0Trigger = 36U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToCmp0Trigger = 37U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToCmp0Trigger = 38U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToCmp0Trigger = 39U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToCmp0Trigger = 40U + (CMP0_TRIG_REG << PMUX_SHIFT), - - /*!< Cmp1 Trigger. */ - kINPUTMUX_PinInt0ToCmp1Trigger = 0U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt7ToCmp1Trigger = 1U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToCmp1Trigger = 5U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToCmp1Trigger = 6U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToCmp1Trigger = 7U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M1ToCmp1Trigger = 8U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToCmp1Trigger = 9U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToCmp1Trigger = 11U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToCmp1Trigger = 12U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToCmp1Trigger = 13U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToCmp1Trigger = 14U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig01ToCmp1Trigger = 17U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig01ToCmp1Trigger = 18U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig01ToCmp1Trigger = 19U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig01ToCmp1Trigger = 20U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig01ToCmp1Trigger = 21U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig01ToCmp1Trigger = 22U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig01ToCmp1Trigger = 23U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig01ToCmp1Trigger = 24U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToCmp1Trigger = 25U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToCmp1Trigger = 26U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToCmp1Trigger = 27U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToCmp1Trigger = 28U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToCmp1Trigger = 29U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToCmp1Trigger = 30U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToCmp1Trigger = 31U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToCmp1Trigger = 32U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToCmp1Trigger = 33U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToCmp1Trigger = 34U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToCmp1Trigger = 35U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToCmp1Trigger = 36U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToCmp1Trigger = 37U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToCmp1Trigger = 38U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToCmp1Trigger = 39U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToCmp1Trigger = 40U + (CMP1_TRIG_REG << PMUX_SHIFT), - - - /*!< Adc0 Trigger. */ - kINPUTMUX_PinInt0ToAdc0Trigger = 0U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_PinInt1ToAdc0Trigger = 1U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToAdc0Trigger = 5U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToAdc0Trigger = 6U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToAdc0Trigger = 7U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToAdc0Trigger = 8U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToAdc0Trigger = 9U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_DcdcBurstDoneTrigToAdc0Trigger = 10U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_ArmTxevToAdc0Trigger = 11U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToAdc0Trigger = 12U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToAdc0Trigger = 13U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToAdc0Trigger = 14U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToAdc0Trigger = 15U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToAdc0Trigger = 16U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToAdc0Trigger = 17U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToAdc0Trigger = 18U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToAdc0Trigger = 19U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToAdc0Trigger = 20U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToAdc0Trigger = 21U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToAdc0Trigger = 22U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToAdc0Trigger = 24U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToAdc0Trigger = 25U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToAdc0Trigger = 26U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToAdc0Trigger = 27U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToAdc0Trigger = 28U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToAdc0Trigger = 29U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToAdc0Trigger = 30U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToAdc0Trigger = 31U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToAdc0Trigger = 32U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToAdc0Trigger = 33U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToAdc0Trigger = 34U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToAdc0Trigger = 35U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToAdc0Trigger = 36U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToAdc0Trigger = 37U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToAdc0Trigger = 38U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToAdc0Trigger = 39U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToAdc0Trigger = 40U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToAdc0Trigger = 41U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToAdc0Trigger = 42U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToAdc0Trigger = 43U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToAdc0Trigger = 44U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToAdc0Trigger = 45U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToAdc0Trigger = 46U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToAdc0Trigger = 47U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToAdc0Trigger = 48U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToAdc0Trigger = 49U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToAdc0Trigger = 50U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToAdc0Trigger = 51U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_FlexioCh0ToAdc0Trigger = 52U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_FlexioCh1ToAdc0Trigger = 53U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_FlexioCh2ToAdc0Trigger = 54U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_FlexioCh3ToAdc0Trigger = 55U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToAdc0Trigger = 61U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToAdc0Trigger = 62U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToAdc0Trigger = 63U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToAdc0Trigger = 64U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_WuuToAdc0Trigger = 65U + (ADC0_TRIG0 << PMUX_SHIFT), - - /*!< Adc1 Trigger. */ - kINPUTMUX_PinInt0ToAdc1Trigger = 0U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_PinInt2ToAdc1Trigger = 1U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToAdc1Trigger = 5U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToAdc1Trigger = 6U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToAdc1Trigger = 7U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToAdc1Trigger = 8U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToAdc1Trigger = 9U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_DcdcBurstDoneTrigToAdc1Trigger = 10U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_ArmTxevToAdc1Trigger = 11U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToAdc1Trigger = 12U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToAdc1Trigger = 13U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToAdc1Trigger = 14U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToAdc1Trigger = 15U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToAdc1Trigger = 16U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToAdc1Trigger = 17U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToAdc1Trigger = 18U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToAdc1Trigger = 19U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToAdc1Trigger = 20U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToAdc1Trigger = 21U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToAdc1Trigger = 22U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToAdc1Trigger = 24U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToAdc1Trigger = 25U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToAdc1Trigger = 26U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToAdc1Trigger = 27U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToAdc1Trigger = 28U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToAdc1Trigger = 29U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToAdc1Trigger = 30U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToAdc1Trigger = 31U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToAdc1Trigger = 32U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToAdc1Trigger = 33U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToAdc1Trigger = 34U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToAdc1Trigger = 35U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToAdc1Trigger = 36U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToAdc1Trigger = 37U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToAdc1Trigger = 38U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToAdc1Trigger = 39U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToAdc1Trigger = 40U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToAdc1Trigger = 41U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToAdc1Trigger = 42U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToAdc1Trigger = 43U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToAdc1Trigger = 44U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToAdc1Trigger = 45U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToAdc1Trigger = 46U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToAdc1Trigger = 47U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToAdc1Trigger = 48U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToAdc1Trigger = 49U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToAdc1Trigger = 50U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToAdc1Trigger = 51U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_FlexioCh0ToAdc1Trigger = 52U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_FlexioCh1ToAdc1Trigger = 53U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_FlexioCh2ToAdc1Trigger = 54U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_FlexioCh3ToAdc1Trigger = 55U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToAdc1Trigger = 61U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToAdc1Trigger = 62U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToAdc1Trigger = 63U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToAdc1Trigger = 64U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_WuuToAdc1Trigger = 65U + (ADC1_TRIG0 << PMUX_SHIFT), - - /*!< QDC0 Trigger Input Connections. */ - kINPUTMUX_PinInt0ToQdc0Trigger = 0U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt4ToQdc0Trigger = 1U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc0Trigger = 5U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc0Trigger = 6U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc0Trigger = 7U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToQdc0Trigger = 8U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToQdc0Trigger = 9U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToQdc0Trigger = 11U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToQdc0Trigger = 12U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToQdc0Trigger = 13U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToQdc0Trigger = 14U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToQdc0Trigger = 15U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToQdc0Trigger = 16U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToQdc0Trigger = 17U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToQdc0Trigger = 18U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToQdc0Trigger = 19U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToQdc0Trigger = 20U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc0Trigger = 21U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc0Trigger = 22U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToQdc0Trigger = 24U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToQdc0Trigger = 25U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToQdc0Trigger = 26U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToQdc0Trigger = 27U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToQdc0Trigger = 28U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToQdc0Trigger = 29U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToQdc0Trigger = 30U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToQdc0Trigger = 31U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToQdc0Trigger = 32U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToQdc0Trigger = 33U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToQdc0Trigger = 34U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToQdc0Trigger = 35U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToQdc0Trigger = 36U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToQdc0Trigger = 37U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToQdc0Trigger = 38U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToQdc0Trigger = 39U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToQdc0Trigger = 40U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToQdc0Trigger = 41U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc0Trigger = 42U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc0Trigger = 43U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc0Trigger = 44U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc0Trigger = 45U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc0Trigger = 46U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc0Trigger = 47U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc0Trigger = 48U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc0Trigger = 49U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc0Trigger = 50U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc0Trigger = 51U + (QDC0_TRIG_REG << PMUX_SHIFT), - - /*!< QDC0 Home Input Connections. */ - kINPUTMUX_PinInt0ToQdc0Home = 0U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_PinInt4ToQdc0Home = 1U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc0Home = 5U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc0Home = 6U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc0Home = 7U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToQdc0Home = 8U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToQdc0Home = 9U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToQdc0Home = 11U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToQdc0Home = 12U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToQdc0Home = 13U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToQdc0Home = 14U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToQdc0Home = 15U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToQdc0Home = 16U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToQdc0Home = 17U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToQdc0Home = 18U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToQdc0Home = 19U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToQdc0Home = 20U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc0Home = 21U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc0Home = 22U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToQdc0Home = 24U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToQdc0Home = 25U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToQdc0Home = 26U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToQdc0Home = 27U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToQdc0Home = 28U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToQdc0Home = 29U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToQdc0Home = 30U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToQdc0Home = 31U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToQdc0Home = 32U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToQdc0Home = 33U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToQdc0Home = 34U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToQdc0Home = 35U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToQdc0Home = 36U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToQdc0Home = 37U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToQdc0Home = 38U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToQdc0Home = 39U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToQdc0Home = 40U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToQdc0Home = 41U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc0Home = 42U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc0Home = 43U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc0Home = 44U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc0Home = 45U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc0Home = 46U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc0Home = 47U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc0Home = 48U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc0Home = 49U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc0Home = 50U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc0Home = 51U + (QDC0_HOME_REG << PMUX_SHIFT), - - /*!< QDC0 Index Input Connections. */ - kINPUTMUX_PinInt0ToQdc0Index = 0U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_PinInt4ToQdc0Index = 1U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc0Index = 5U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc0Index = 6U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc0Index = 7U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToQdc0Index = 8U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToQdc0Index = 9U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToQdc0Index = 11U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToQdc0Index = 12U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToQdc0Index = 13U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToQdc0Index = 14U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToQdc0Index = 15U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToQdc0Index = 16U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToQdc0Index = 17U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToQdc0Index = 18U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToQdc0Index = 19U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToQdc0Index = 20U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc0Index = 21U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc0Index = 22U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToQdc0Index = 24U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToQdc0Index = 25U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToQdc0Index = 26U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToQdc0Index = 27U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToQdc0Index = 28U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToQdc0Index = 29U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToQdc0Index = 30U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToQdc0Index = 31U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToQdc0Index = 32U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToQdc0Index = 33U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToQdc0Index = 34U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToQdc0Index = 35U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToQdc0Index = 36U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToQdc0Index = 37U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToQdc0Index = 38U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToQdc0Index = 39U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToQdc0Index = 40U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToQdc0Index = 41U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc0Index = 42U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc0Index = 43U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc0Index = 44U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc0Index = 45U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc0Index = 46U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc0Index = 47U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc0Index = 48U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc0Index = 49U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc0Index = 50U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc0Index = 51U + (QDC0_INDEX_REG << PMUX_SHIFT), - - /*!< QDC0 Phaseb Input Connections. */ - kINPUTMUX_PinInt0ToQdc0Phaseb = 0U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_PinInt4ToQdc0Phaseb = 1U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc0Phaseb = 5U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc0Phaseb = 6U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc0Phaseb = 7U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToQdc0Phaseb = 8U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToQdc0Phaseb = 9U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToQdc0Phaseb = 11U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToQdc0Phaseb = 12U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToQdc0Phaseb = 13U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToQdc0Phaseb = 14U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToQdc0Phaseb = 15U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToQdc0Phaseb = 16U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToQdc0Phaseb = 17U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToQdc0Phaseb = 18U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToQdc0Phaseb = 19U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToQdc0Phaseb = 20U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc0Phaseb = 21U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc0Phaseb = 22U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToQdc0Phaseb = 24U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToQdc0Phaseb = 25U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToQdc0Phaseb = 26U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToQdc0Phaseb = 27U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToQdc0Phaseb = 28U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToQdc0Phaseb = 29U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToQdc0Phaseb = 30U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToQdc0Phaseb = 31U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToQdc0Phaseb = 32U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToQdc0Phaseb = 33U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToQdc0Phaseb = 34U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToQdc0Phaseb = 35U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToQdc0Phaseb = 36U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToQdc0Phaseb = 37U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToQdc0Phaseb = 38U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToQdc0Phaseb = 39U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToQdc0Phaseb = 40U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToQdc0Phaseb = 41U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc0Phaseb = 42U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc0Phaseb = 43U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc0Phaseb = 44U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc0Phaseb = 45U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc0Phaseb = 46U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc0Phaseb = 47U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc0Phaseb = 48U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc0Phaseb = 49U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc0Phaseb = 50U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc0Phaseb = 51U + (QDC0_PHASEB_REG << PMUX_SHIFT), - - /*!< QDC0 Phasea Input Connections. */ - kINPUTMUX_PinInt0ToQdc0Phasea = 0U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_PinInt4ToQdc0Phasea = 1U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc0Phasea = 5U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc0Phasea = 6U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc0Phasea = 7U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToQdc0Phasea = 8U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToQdc0Phasea = 9U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToQdc0Phasea = 11U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToQdc0Phasea = 12U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToQdc0Phasea = 13U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToQdc0Phasea = 14U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToQdc0Phasea = 15U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToQdc0Phasea = 16U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToQdc0Phasea = 17U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToQdc0Phasea = 18U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToQdc0Phasea = 19U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToQdc0Phasea = 20U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc0Phasea = 21U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc0Phasea = 22U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToQdc0Phasea = 24U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToQdc0Phasea = 25U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToQdc0Phasea = 26U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToQdc0Phasea = 27U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToQdc0Phasea = 28U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToQdc0Phasea = 29U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToQdc0Phasea = 30U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToQdc0Phasea = 31U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToQdc0Phasea = 32U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToQdc0Phasea = 33U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToQdc0Phasea = 34U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToQdc0Phasea = 35U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToQdc0Phasea = 36U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToQdc0Phasea = 37U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToQdc0Phasea = 38U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToQdc0Phasea = 39U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToQdc0Phasea = 40U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToQdc0Phasea = 41U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc0Phasea = 42U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc0Phasea = 43U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc0Phasea = 44U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc0Phasea = 45U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc0Phasea = 46U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc0Phasea = 47U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc0Phasea = 48U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc0Phasea = 49U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc0Phasea = 50U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc0Phasea = 51U + (QDC0_PHASEA_REG << PMUX_SHIFT), - - /*!< QDC1 Trigger Input Connections. */ - kINPUTMUX_PinInt0ToQdc1Trigger = 0U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt4ToQdc1Trigger = 1U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc1Trigger = 5U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc1Trigger = 6U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc1Trigger = 7U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToQdc1Trigger = 8U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToQdc1Trigger = 9U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToQdc1Trigger = 11U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToQdc1Trigger = 12U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToQdc1Trigger = 13U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToQdc1Trigger = 14U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToQdc1Trigger = 15U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToQdc1Trigger = 16U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToQdc1Trigger = 17U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToQdc1Trigger = 18U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToQdc1Trigger = 19U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToQdc1Trigger = 20U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc1Trigger = 21U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc1Trigger = 22U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToQdc1Trigger = 24U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToQdc1Trigger = 25U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToQdc1Trigger = 26U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToQdc1Trigger = 27U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToQdc1Trigger = 28U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToQdc1Trigger = 29U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToQdc1Trigger = 30U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToQdc1Trigger = 31U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToQdc1Trigger = 32U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToQdc1Trigger = 33U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToQdc1Trigger = 34U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToQdc1Trigger = 35U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToQdc1Trigger = 36U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToQdc1Trigger = 37U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToQdc1Trigger = 38U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToQdc1Trigger = 39U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToQdc1Trigger = 40U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToQdc1Trigger = 41U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc1Trigger = 42U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc1Trigger = 43U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc1Trigger = 44U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc1Trigger = 45U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc1Trigger = 46U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc1Trigger = 47U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc1Trigger = 48U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc1Trigger = 49U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc1Trigger = 50U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc1Trigger = 51U + (QDC1_TRIG_REG << PMUX_SHIFT), - - /*!< QDC1 Home Input Connections. */ - kINPUTMUX_PinInt0ToQdc1Home = 0U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_PinInt4ToQdc1Home = 1U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc1Home = 5U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc1Home = 6U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc1Home = 7U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToQdc1Home = 8U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToQdc1Home = 9U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToQdc1Home = 11U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToQdc1Home = 12U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToQdc1Home = 13U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToQdc1Home = 14U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToQdc1Home = 15U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToQdc1Home = 16U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToQdc1Home = 17U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToQdc1Home = 18U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToQdc1Home = 19U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToQdc1Home = 20U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc1Home = 21U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc1Home = 22U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToQdc1Home = 24U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToQdc1Home = 25U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToQdc1Home = 26U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToQdc1Home = 27U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToQdc1Home = 28U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToQdc1Home = 29U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToQdc1Home = 30U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToQdc1Home = 31U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToQdc1Home = 32U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToQdc1Home = 33U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToQdc1Home = 34U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToQdc1Home = 35U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToQdc1Home = 36U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToQdc1Home = 37U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToQdc1Home = 38U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToQdc1Home = 39U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToQdc1Home = 40U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToQdc1Home = 41U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc1Home = 42U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc1Home = 43U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc1Home = 44U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc1Home = 45U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc1Home = 46U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc1Home = 47U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc1Home = 48U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc1Home = 49U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc1Home = 50U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc1Home = 51U + (QDC1_HOME_REG << PMUX_SHIFT), - - /*!< QDC1 Index Input Connections. */ - kINPUTMUX_PinInt0ToQdc1Index = 0U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_PinInt4ToQdc1Index = 1U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc1Index = 5U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc1Index = 6U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc1Index = 7U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToQdc1Index = 8U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToQdc1Index = 9U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToQdc1Index = 11U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToQdc1Index = 12U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToQdc1Index = 13U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToQdc1Index = 14U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToQdc1Index = 15U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToQdc1Index = 16U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToQdc1Index = 17U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToQdc1Index = 18U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToQdc1Index = 19U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToQdc1Index = 20U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc1Index = 21U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc1Index = 22U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToQdc1Index = 24U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToQdc1Index = 25U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToQdc1Index = 26U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToQdc1Index = 27U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToQdc1Index = 28U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToQdc1Index = 29U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToQdc1Index = 30U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToQdc1Index = 31U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToQdc1Index = 32U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToQdc1Index = 33U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToQdc1Index = 34U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToQdc1Index = 35U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToQdc1Index = 36U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToQdc1Index = 37U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToQdc1Index = 38U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToQdc1Index = 39U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToQdc1Index = 40U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToQdc1Index = 41U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc1Index = 42U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc1Index = 43U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc1Index = 44U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc1Index = 45U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc1Index = 46U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc1Index = 47U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc1Index = 48U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc1Index = 49U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc1Index = 50U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc1Index = 51U + (QDC1_INDEX_REG << PMUX_SHIFT), - - /*!< QDC1 Phaseb Input Connections. */ - kINPUTMUX_PinInt0ToQdc1Phaseb = 0U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_PinInt4ToQdc1Phaseb = 1U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc1Phaseb = 5U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc1Phaseb = 6U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc1Phaseb = 7U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToQdc1Phaseb = 8U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToQdc1Phaseb = 9U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToQdc1Phaseb = 11U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToQdc1Phaseb = 12U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToQdc1Phaseb = 13U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToQdc1Phaseb = 14U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToQdc1Phaseb = 15U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToQdc1Phaseb = 16U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToQdc1Phaseb = 17U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToQdc1Phaseb = 18U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToQdc1Phaseb = 19U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToQdc1Phaseb = 20U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc1Phaseb = 21U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc1Phaseb = 22U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToQdc1Phaseb = 24U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToQdc1Phaseb = 25U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToQdc1Phaseb = 26U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToQdc1Phaseb = 27U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToQdc1Phaseb = 28U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToQdc1Phaseb = 29U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToQdc1Phaseb = 30U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToQdc1Phaseb = 31U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToQdc1Phaseb = 32U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToQdc1Phaseb = 33U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToQdc1Phaseb = 34U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToQdc1Phaseb = 35U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToQdc1Phaseb = 36U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToQdc1Phaseb = 37U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToQdc1Phaseb = 38U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToQdc1Phaseb = 39U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToQdc1Phaseb = 40U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToQdc1Phaseb = 41U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc1Phaseb = 42U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc1Phaseb = 43U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc1Phaseb = 44U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc1Phaseb = 45U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc1Phaseb = 46U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc1Phaseb = 47U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc1Phaseb = 48U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc1Phaseb = 49U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc1Phaseb = 50U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc1Phaseb = 51U + (QDC1_PHASEB_REG << PMUX_SHIFT), - - /*!< QDC1 Phasea Input Connections. */ - kINPUTMUX_PinInt0ToQdc1Phasea = 0U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_PinInt4ToQdc1Phasea = 1U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc1Phasea = 5U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc1Phasea = 6U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc1Phasea = 7U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToQdc1Phasea = 8U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToQdc1Phasea = 9U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToQdc1Phasea = 11U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToQdc1Phasea = 12U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToQdc1Phasea = 13U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToQdc1Phasea = 14U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToQdc1Phasea = 15U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToQdc1Phasea = 16U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToQdc1Phasea = 17U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToQdc1Phasea = 18U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToQdc1Phasea = 19U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToQdc1Phasea = 20U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc1Phasea = 21U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc1Phasea = 22U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToQdc1Phasea = 24U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToQdc1Phasea = 25U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToQdc1Phasea = 26U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToQdc1Phasea = 27U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToQdc1Phasea = 28U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToQdc1Phasea = 29U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToQdc1Phasea = 30U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToQdc1Phasea = 31U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToQdc1Phasea = 32U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToQdc1Phasea = 33U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToQdc1Phasea = 34U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToQdc1Phasea = 35U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToQdc1Phasea = 36U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToQdc1Phasea = 37U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToQdc1Phasea = 38U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToQdc1Phasea = 39U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToQdc1Phasea = 40U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToQdc1Phasea = 41U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc1Phasea = 42U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc1Phasea = 43U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc1Phasea = 44U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc1Phasea = 45U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc1Phasea = 46U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc1Phasea = 47U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc1Phasea = 48U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc1Phasea = 49U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc1Phasea = 50U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc1Phasea = 51U + (QDC1_PHASEA_REG << PMUX_SHIFT), - - /*!< FlexPWM0_SM0_EXTSYNC input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm0Sm0ExtSync = 0U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexPwm0Sm0ExtSync = 1U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Sm0ExtSync = 5U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Sm0ExtSync = 6U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Sm0ExtSync = 7U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexPwm0Sm0ExtSync = 8U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexPwm0Sm0ExtSync = 9U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm0Sm0ExtSync = 11U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm0Sm0ExtSync = 12U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm0Sm0ExtSync = 13U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm0Sm0ExtSync = 14U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm0Sm0ExtSync = 15U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm0Sm0ExtSync = 16U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm0Sm0ExtSync = 17U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm0Sm0ExtSync = 18U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm0Sm0ExtSync = 19U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm0Sm0ExtSync = 20U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Sm0ExtSync = 21U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Sm0ExtSync = 22U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToFlexPwm0Sm0ExtSync = 24U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToFlexPwm0Sm0ExtSync = 25U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToFlexPwm0Sm0ExtSync = 26U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToFlexPwm0Sm0ExtSync = 27U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToFlexPwm0Sm0ExtSync = 28U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToFlexPwm0Sm0ExtSync = 29U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToFlexPwm0Sm0ExtSync = 30U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToFlexPwm0Sm0ExtSync = 31U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm0Sm0ExtSync = 32U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm0Sm0ExtSync = 33U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm0Sm0ExtSync = 34U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm0Sm0ExtSync = 35U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm0Sm0ExtSync = 36U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm0Sm0ExtSync = 37U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm0Sm0ExtSync = 38U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm0Sm0ExtSync = 39U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm0Sm0ExtSync = 40U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm0Sm0ExtSync = 41U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Sm0ExtSync = 42U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Sm0ExtSync = 43U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Sm0ExtSync = 44U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Sm0ExtSync = 45U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Sm0ExtSync = 46U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Sm0ExtSync = 47U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Sm0ExtSync = 48U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Sm0ExtSync = 49U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Sm0ExtSync = 50U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Sm0ExtSync = 51U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Sm0ExtSync = 57U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm0Sm0ExtSync = 58U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Sm0ExtSync = 59U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm0Sm0ExtSync = 60U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - - /*!< FlexPWM0_SM1_EXTSYNC input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm0Sm1ExtSync = 0U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexPwm0Sm1ExtSync = 1U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Sm1ExtSync = 5U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Sm1ExtSync = 6U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Sm1ExtSync = 7U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexPwm0Sm1ExtSync = 8U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexPwm0Sm1ExtSync = 9U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm0Sm1ExtSync = 11U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm0Sm1ExtSync = 12U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm0Sm1ExtSync = 13U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm0Sm1ExtSync = 14U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm0Sm1ExtSync = 15U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm0Sm1ExtSync = 16U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm0Sm1ExtSync = 17U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm0Sm1ExtSync = 18U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm0Sm1ExtSync = 19U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm0Sm1ExtSync = 20U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Sm1ExtSync = 21U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Sm1ExtSync = 22U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToFlexPwm0Sm1ExtSync = 24U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToFlexPwm0Sm1ExtSync = 25U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToFlexPwm0Sm1ExtSync = 26U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToFlexPwm0Sm1ExtSync = 27U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToFlexPwm0Sm1ExtSync = 28U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToFlexPwm0Sm1ExtSync = 29U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToFlexPwm0Sm1ExtSync = 30U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToFlexPwm0Sm1ExtSync = 31U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm0Sm1ExtSync = 32U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm0Sm1ExtSync = 33U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm0Sm1ExtSync = 34U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm0Sm1ExtSync = 35U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm0Sm1ExtSync = 36U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm0Sm1ExtSync = 37U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm0Sm1ExtSync = 38U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm0Sm1ExtSync = 39U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm0Sm1ExtSync = 40U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm0Sm1ExtSync = 41U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Sm1ExtSync = 42U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Sm1ExtSync = 43U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Sm1ExtSync = 44U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Sm1ExtSync = 45U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Sm1ExtSync = 46U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Sm1ExtSync = 47U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Sm1ExtSync = 48U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Sm1ExtSync = 49U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Sm1ExtSync = 50U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Sm1ExtSync = 51U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Sm1ExtSync = 57U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm0Sm1ExtSync = 58U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Sm1ExtSync = 59U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm0Sm1ExtSync = 60U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - - /*!< FlexPWM0_SM2_EXTSYNC2 input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm0Sm2ExtSync = 0U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexPwm0Sm2ExtSync = 1U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Sm2ExtSync = 5U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Sm2ExtSync = 6U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Sm2ExtSync = 7U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexPwm0Sm2ExtSync = 8U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexPwm0Sm2ExtSync = 9U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm0Sm2ExtSync = 11U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm0Sm2ExtSync = 12U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm0Sm2ExtSync = 13U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm0Sm2ExtSync = 14U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm0Sm2ExtSync = 15U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm0Sm2ExtSync = 16U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm0Sm2ExtSync = 17U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm0Sm2ExtSync = 18U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm0Sm2ExtSync = 19U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm0Sm2ExtSync = 20U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Sm2ExtSync = 21U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Sm2ExtSync = 22U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToFlexPwm0Sm2ExtSync = 24U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToFlexPwm0Sm2ExtSync = 25U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToFlexPwm0Sm2ExtSync = 26U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToFlexPwm0Sm2ExtSync = 27U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToFlexPwm0Sm2ExtSync = 28U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToFlexPwm0Sm2ExtSync = 29U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToFlexPwm0Sm2ExtSync = 30U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToFlexPwm0Sm2ExtSync = 31U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm0Sm2ExtSync = 32U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm0Sm2ExtSync = 33U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm0Sm2ExtSync = 34U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm0Sm2ExtSync = 35U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm0Sm2ExtSync = 36U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm0Sm2ExtSync = 37U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm0Sm2ExtSync = 38U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm0Sm2ExtSync = 39U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm0Sm2ExtSync = 40U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm0Sm2ExtSync = 41U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Sm2ExtSync = 42U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Sm2ExtSync = 43U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Sm2ExtSync = 44U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Sm2ExtSync = 45U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Sm2ExtSync = 46U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Sm2ExtSync = 47U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Sm2ExtSync = 48U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Sm2ExtSync = 49U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Sm2ExtSync = 50U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Sm2ExtSync = 51U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Sm2ExtSync = 57U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm0Sm2ExtSync = 58U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Sm2ExtSync = 59U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm0Sm2ExtSync = 60U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - - /*!< FlexPWM0_SM3_EXTSYNC input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm0Sm3ExtSync = 0U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexPwm0Sm3ExtSync = 1U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Sm3ExtSync = 5U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Sm3ExtSync = 6U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Sm3ExtSync = 7U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexPwm0Sm3ExtSync = 8U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexPwm0Sm3ExtSync = 9U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm0Sm3ExtSync = 11U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm0Sm3ExtSync = 12U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm0Sm3ExtSync = 13U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm0Sm3ExtSync = 14U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm0Sm3ExtSync = 15U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm0Sm3ExtSync = 16U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm0Sm3ExtSync = 17U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm0Sm3ExtSync = 18U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm0Sm3ExtSync = 19U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm0Sm3ExtSync = 20U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Sm3ExtSync = 21U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Sm3ExtSync = 22U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToFlexPwm0Sm3ExtSync = 24U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToFlexPwm0Sm3ExtSync = 25U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToFlexPwm0Sm3ExtSync = 26U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToFlexPwm0Sm3ExtSync = 27U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToFlexPwm0Sm3ExtSync = 28U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToFlexPwm0Sm3ExtSync = 29U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToFlexPwm0Sm3ExtSync = 30U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToFlexPwm0Sm3ExtSync = 31U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm0Sm3ExtSync = 32U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm0Sm3ExtSync = 33U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm0Sm3ExtSync = 34U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm0Sm3ExtSync = 35U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm0Sm3ExtSync = 36U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm0Sm3ExtSync = 37U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm0Sm3ExtSync = 38U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm0Sm3ExtSync = 39U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm0Sm3ExtSync = 40U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm0Sm3ExtSync = 41U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Sm3ExtSync = 42U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Sm3ExtSync = 43U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Sm3ExtSync = 44U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Sm3ExtSync = 45U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Sm3ExtSync = 46U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Sm3ExtSync = 47U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Sm3ExtSync = 48U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Sm3ExtSync = 49U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Sm3ExtSync = 50U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Sm3ExtSync = 51U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Sm3ExtSync = 57U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm0Sm3ExtSync = 58U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Sm3ExtSync = 59U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm0Sm3ExtSync = 60U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - - /*!< FlexPWM0_SM0_EXTA input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm0Sm0Exta = 0U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexPwm0Sm0Exta = 1U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Sm0Exta = 5U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Sm0Exta = 6U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Sm0Exta = 7U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexPwm0Sm0Exta = 8U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexPwm0Sm0Exta = 9U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm0Sm0Exta = 11U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm0Sm0Exta = 12U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm0Sm0Exta = 13U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm0Sm0Exta = 14U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm0Sm0Exta = 15U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm0Sm0Exta = 16U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm0Sm0Exta = 17U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm0Sm0Exta = 18U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm0Sm0Exta = 19U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm0Sm0Exta = 20U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Sm0Exta = 21U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Sm0Exta = 22U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToFlexPwm0Sm0Exta = 24U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToFlexPwm0Sm0Exta = 25U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToFlexPwm0Sm0Exta = 26U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToFlexPwm0Sm0Exta = 27U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToFlexPwm0Sm0Exta = 28U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToFlexPwm0Sm0Exta = 29U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToFlexPwm0Sm0Exta = 30U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToFlexPwm0Sm0Exta = 31U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm0Sm0Exta = 32U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm0Sm0Exta = 33U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm0Sm0Exta = 34U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm0Sm0Exta = 35U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm0Sm0Exta = 36U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm0Sm0Exta = 37U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm0Sm0Exta = 38U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm0Sm0Exta = 39U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm0Sm0Exta = 40U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm0Sm0Exta = 41U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Sm0Exta = 42U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Sm0Exta = 43U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Sm0Exta = 44U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Sm0Exta = 45U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Sm0Exta = 46U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Sm0Exta = 47U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Sm0Exta = 48U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Sm0Exta = 49U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Sm0Exta = 50U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Sm0Exta = 51U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Sm0Exta = 57U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm0Sm0Exta = 58U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Sm0Exta = 59U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm0Sm0Exta = 60U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - - /*!< FlexPWM0_SM1_EXTA input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm0Sm1Exta = 0U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexPwm0Sm1Exta = 1U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Sm1Exta = 5U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Sm1Exta = 6U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Sm1Exta = 7U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexPwm0Sm1Exta = 8U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexPwm0Sm1Exta = 9U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm0Sm1Exta = 11U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm0Sm1Exta = 12U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm0Sm1Exta = 13U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm0Sm1Exta = 14U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm0Sm1Exta = 15U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm0Sm1Exta = 16U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm0Sm1Exta = 17U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm0Sm1Exta = 18U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm0Sm1Exta = 19U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm0Sm1Exta = 20U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Sm1Exta = 21U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Sm1Exta = 22U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToFlexPwm0Sm1Exta = 24U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToFlexPwm0Sm1Exta = 25U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToFlexPwm0Sm1Exta = 26U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToFlexPwm0Sm1Exta = 27U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToFlexPwm0Sm1Exta = 28U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToFlexPwm0Sm1Exta = 29U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToFlexPwm0Sm1Exta = 30U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToFlexPwm0Sm1Exta = 31U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm0Sm1Exta = 32U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm0Sm1Exta = 33U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm0Sm1Exta = 34U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm0Sm1Exta = 35U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm0Sm1Exta = 36U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm0Sm1Exta = 37U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm0Sm1Exta = 38U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm0Sm1Exta = 39U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm0Sm1Exta = 40U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm0Sm1Exta = 41U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Sm1Exta = 42U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Sm1Exta = 43U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Sm1Exta = 44U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Sm1Exta = 45U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Sm1Exta = 46U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Sm1Exta = 47U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Sm1Exta = 48U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Sm1Exta = 49U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Sm1Exta = 50U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Sm1Exta = 51U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Sm1Exta = 57U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm0Sm1Exta = 58U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Sm1Exta = 59U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm0Sm1Exta = 60U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - - /*!< FlexPWM0_SM2_EXTA input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm0Sm2Exta = 0U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexPwm0Sm2Exta = 1U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Sm2Exta = 5U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Sm2Exta = 6U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Sm2Exta = 7U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexPwm0Sm2Exta = 8U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexPwm0Sm2Exta = 9U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm0Sm2Exta = 11U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm0Sm2Exta = 12U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm0Sm2Exta = 13U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm0Sm2Exta = 14U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm0Sm2Exta = 15U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm0Sm2Exta = 16U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm0Sm2Exta = 17U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm0Sm2Exta = 18U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm0Sm2Exta = 19U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm0Sm2Exta = 20U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Sm2Exta = 21U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Sm2Exta = 22U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToFlexPwm0Sm2Exta = 24U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToFlexPwm0Sm2Exta = 25U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToFlexPwm0Sm2Exta = 26U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToFlexPwm0Sm2Exta = 27U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToFlexPwm0Sm2Exta = 28U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToFlexPwm0Sm2Exta = 29U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToFlexPwm0Sm2Exta = 30U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToFlexPwm0Sm2Exta = 31U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm0Sm2Exta = 32U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm0Sm2Exta = 33U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm0Sm2Exta = 34U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm0Sm2Exta = 35U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm0Sm2Exta = 36U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm0Sm2Exta = 37U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm0Sm2Exta = 38U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm0Sm2Exta = 39U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm0Sm2Exta = 40U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm0Sm2Exta = 41U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Sm2Exta = 42U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Sm2Exta = 43U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Sm2Exta = 44U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Sm2Exta = 45U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Sm2Exta = 46U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Sm2Exta = 47U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Sm2Exta = 48U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Sm2Exta = 49U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Sm2Exta = 50U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Sm2Exta = 51U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Sm2Exta = 57U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm0Sm2Exta = 58U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Sm2Exta = 59U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm0Sm2Exta = 60U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - - /*!< FlexPWM0_SM3_EXTA input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm0Sm3Exta = 0U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexPwm0Sm3Exta = 1U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Sm3Exta = 5U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Sm3Exta = 6U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Sm3Exta = 7U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexPwm0Sm3Exta = 8U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexPwm0Sm3Exta = 9U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm0Sm3Exta = 11U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm0Sm3Exta = 12U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm0Sm3Exta = 13U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm0Sm3Exta = 14U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm0Sm3Exta = 15U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm0Sm3Exta = 16U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm0Sm3Exta = 17U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm0Sm3Exta = 18U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm0Sm3Exta = 19U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm0Sm3Exta = 20U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Sm3Exta = 21U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Sm3Exta = 22U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToFlexPwm0Sm3Exta = 24U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToFlexPwm0Sm3Exta = 25U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToFlexPwm0Sm3Exta = 26U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToFlexPwm0Sm3Exta = 27U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToFlexPwm0Sm3Exta = 28U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToFlexPwm0Sm3Exta = 29U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToFlexPwm0Sm3Exta = 30U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToFlexPwm0Sm3Exta = 31U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm0Sm3Exta = 32U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm0Sm3Exta = 33U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm0Sm3Exta = 34U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm0Sm3Exta = 35U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm0Sm3Exta = 36U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm0Sm3Exta = 37U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm0Sm3Exta = 38U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm0Sm3Exta = 39U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm0Sm3Exta = 40U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm0Sm3Exta = 41U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Sm3Exta = 42U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Sm3Exta = 43U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Sm3Exta = 44U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Sm3Exta = 45U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Sm3Exta = 46U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Sm3Exta = 47U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Sm3Exta = 48U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Sm3Exta = 49U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Sm3Exta = 50U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Sm3Exta = 51U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Sm3Exta = 57U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm0Sm3Exta = 58U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Sm3Exta = 59U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm0Sm3Exta = 60U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - - /*!< FlexPWM0_EXTFORCE input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm0ExtForce = 0U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexPwm0ExtForce = 1U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0ExtForce = 5U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0ExtForce = 6U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0ExtForce = 7U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexPwm0ExtForce = 8U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexPwm0ExtForce = 9U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm0ExtForce = 11U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm0ExtForce = 12U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm0ExtForce = 13U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm0ExtForce = 14U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm0ExtForce = 15U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm0ExtForce = 16U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm0ExtForce = 17U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm0ExtForce = 18U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm0ExtForce = 19U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm0ExtForce = 20U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0ExtForce = 21U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0ExtForce = 22U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToFlexPwm0ExtForce = 24U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToFlexPwm0ExtForce = 25U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToFlexPwm0ExtForce = 26U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToFlexPwm0ExtForce = 27U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToFlexPwm0ExtForce = 28U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToFlexPwm0ExtForce = 29U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToFlexPwm0ExtForce = 30U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToFlexPwm0ExtForce = 31U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm0ExtForce = 32U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm0ExtForce = 33U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm0ExtForce = 34U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm0ExtForce = 35U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm0ExtForce = 36U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm0ExtForce = 37U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm0ExtForce = 38U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm0ExtForce = 39U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm0ExtForce = 40U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm0ExtForce = 41U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0ExtForce = 42U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0ExtForce = 43U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0ExtForce = 44U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0ExtForce = 45U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0ExtForce = 46U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0ExtForce = 47U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0ExtForce = 48U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0ExtForce = 49U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0ExtForce = 50U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0ExtForce = 51U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0ExtForce = 57U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm0ExtForce = 58U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0ExtForce = 59U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm0ExtForce = 60U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - - /*!< FlexPWM0_FAULT0 input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm0Fault0 = 0U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexPwm0Fault0 = 1U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Fault0 = 5U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Fault0 = 6U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Fault0 = 7U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexPwm0Fault0 = 8U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexPwm0Fault0 = 9U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm0Fault0 = 11U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm0Fault0 = 12U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm0Fault0 = 13U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm0Fault0 = 14U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm0Fault0 = 15U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm0Fault0 = 16U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm0Fault0 = 17U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm0Fault0 = 18U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm0Fault0 = 19U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm0Fault0 = 20U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Fault0 = 21U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Fault0 = 22U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToFlexPwm0Fault0 = 24U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToFlexPwm0Fault0 = 25U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToFlexPwm0Fault0 = 26U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToFlexPwm0Fault0 = 27U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToFlexPwm0Fault0 = 28U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToFlexPwm0Fault0 = 29U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToFlexPwm0Fault0 = 30U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToFlexPwm0Fault0 = 31U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm0Fault0 = 32U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm0Fault0 = 33U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm0Fault0 = 34U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm0Fault0 = 35U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm0Fault0 = 36U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm0Fault0 = 37U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm0Fault0 = 38U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm0Fault0 = 39U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm0Fault0 = 40U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm0Fault0 = 41U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Fault0 = 42U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Fault0 = 43U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Fault0 = 44U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Fault0 = 45U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Fault0 = 46U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Fault0 = 47U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Fault0 = 48U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Fault0 = 49U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Fault0 = 50U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Fault0 = 51U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Fault0 = 57U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm0Fault0 = 58U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Fault0 = 59U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm0Fault0 = 60U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - - /*!< FlexPWM0_FAULT1 input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm0Fault1 = 0U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexPwm0Fault1 = 1U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Fault1 = 5U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Fault1 = 6U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Fault1 = 7U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexPwm0Fault1 = 8U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexPwm0Fault1 = 9U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm0Fault1 = 11U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm0Fault1 = 12U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm0Fault1 = 13U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm0Fault1 = 14U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm0Fault1 = 15U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm0Fault1 = 16U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm0Fault1 = 17U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm0Fault1 = 18U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm0Fault1 = 19U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm0Fault1 = 20U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Fault1 = 21U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Fault1 = 22U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToFlexPwm0Fault1 = 24U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToFlexPwm0Fault1 = 25U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToFlexPwm0Fault1 = 26U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToFlexPwm0Fault1 = 27U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToFlexPwm0Fault1 = 28U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToFlexPwm0Fault1 = 29U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToFlexPwm0Fault1 = 30U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToFlexPwm0Fault1 = 31U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm0Fault1 = 32U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm0Fault1 = 33U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm0Fault1 = 34U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm0Fault1 = 35U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm0Fault1 = 36U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm0Fault1 = 37U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm0Fault1 = 38U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm0Fault1 = 39U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm0Fault1 = 40U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm0Fault1 = 41U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Fault1 = 42U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Fault1 = 43U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Fault1 = 44U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Fault1 = 45U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Fault1 = 46U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Fault1 = 47U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Fault1 = 48U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Fault1 = 49U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Fault1 = 50U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Fault1 = 51U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Fault1 = 57U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm0Fault1 = 58U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Fault1 = 59U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm0Fault1 = 60U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - - /*!< FlexPWM0_FAULT2 input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm0Fault2 = 0U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexPwm0Fault2 = 1U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Fault2 = 5U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Fault2 = 6U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Fault2 = 7U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexPwm0Fault2 = 8U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexPwm0Fault2 = 9U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm0Fault2 = 11U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm0Fault2 = 12U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm0Fault2 = 13U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm0Fault2 = 14U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm0Fault2 = 15U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm0Fault2 = 16U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm0Fault2 = 17U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm0Fault2 = 18U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm0Fault2 = 19U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm0Fault2 = 20U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Fault2 = 21U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Fault2 = 22U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToFlexPwm0Fault2 = 24U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToFlexPwm0Fault2 = 25U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToFlexPwm0Fault2 = 26U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToFlexPwm0Fault2 = 27U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToFlexPwm0Fault2 = 28U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToFlexPwm0Fault2 = 29U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToFlexPwm0Fault2 = 30U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToFlexPwm0Fault2 = 31U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm0Fault2 = 32U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm0Fault2 = 33U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm0Fault2 = 34U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm0Fault2 = 35U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm0Fault2 = 36U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm0Fault2 = 37U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm0Fault2 = 38U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm0Fault2 = 39U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm0Fault2 = 40U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm0Fault2 = 41U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Fault2 = 42U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Fault2 = 43U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Fault2 = 44U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Fault2 = 45U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Fault2 = 46U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Fault2 = 47U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Fault2 = 48U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Fault2 = 49U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Fault2 = 50U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Fault2 = 51U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Fault2 = 57U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm0Fault2 = 58U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Fault2 = 59U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm0Fault2 = 60U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - - /*!< FlexPWM0_FAULT3 input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm0Fault3 = 0U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexPwm0Fault3 = 1U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Fault3 = 5U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Fault3 = 6U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Fault3 = 7U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexPwm0Fault3 = 8U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexPwm0Fault3 = 9U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm0Fault3 = 11U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm0Fault3 = 12U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm0Fault3 = 13U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm0Fault3 = 14U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm0Fault3 = 15U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm0Fault3 = 16U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm0Fault3 = 17U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm0Fault3 = 18U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm0Fault3 = 19U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm0Fault3 = 20U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Fault3 = 21U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Fault3 = 22U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToFlexPwm0Fault3 = 24U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToFlexPwm0Fault3 = 25U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToFlexPwm0Fault3 = 26U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToFlexPwm0Fault3 = 27U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToFlexPwm0Fault3 = 28U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToFlexPwm0Fault3 = 29U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToFlexPwm0Fault3 = 30U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToFlexPwm0Fault3 = 31U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm0Fault3 = 32U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm0Fault3 = 33U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm0Fault3 = 34U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm0Fault3 = 35U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm0Fault3 = 36U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm0Fault3 = 37U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm0Fault3 = 38U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm0Fault3 = 39U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm0Fault3 = 40U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm0Fault3 = 41U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Fault3 = 42U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Fault3 = 43U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Fault3 = 44U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Fault3 = 45U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Fault3 = 46U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Fault3 = 47U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Fault3 = 48U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Fault3 = 49U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Fault3 = 50U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Fault3 = 51U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Fault3 = 57U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm0Fault3 = 58U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Fault3 = 59U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm0Fault3 = 60U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - - /*!< FlexPWM1_SM0_EXTSYNC input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm1Sm0ExtSync = 0U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_PinInt2ToFlexPwm1Sm0ExtSync = 1U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Sm0ExtSync = 5U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Sm0ExtSync = 6U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Sm0ExtSync = 7U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexPwm1Sm0ExtSync = 8U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexPwm1Sm0ExtSync = 9U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm1Sm0ExtSync = 11U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm1Sm0ExtSync = 12U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm1Sm0ExtSync = 13U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm1Sm0ExtSync = 14U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm1Sm0ExtSync = 15U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm1Sm0ExtSync = 16U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm1Sm0ExtSync = 17U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm1Sm0ExtSync = 18U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm1Sm0ExtSync = 19U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm1Sm0ExtSync = 20U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Sm0ExtSync = 21U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Sm0ExtSync = 22U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToFlexPwm1Sm0ExtSync = 24U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToFlexPwm1Sm0ExtSync = 25U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToFlexPwm1Sm0ExtSync = 26U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToFlexPwm1Sm0ExtSync = 27U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToFlexPwm1Sm0ExtSync = 28U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToFlexPwm1Sm0ExtSync = 29U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToFlexPwm1Sm0ExtSync = 30U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToFlexPwm1Sm0ExtSync = 31U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm1Sm0ExtSync = 32U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm1Sm0ExtSync = 33U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm1Sm0ExtSync = 34U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm1Sm0ExtSync = 35U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm1Sm0ExtSync = 36U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm1Sm0ExtSync = 37U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm1Sm0ExtSync = 38U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm1Sm0ExtSync = 39U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm1Sm0ExtSync = 40U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm1Sm0ExtSync = 41U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Sm0ExtSync = 42U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Sm0ExtSync = 43U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Sm0ExtSync = 44U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Sm0ExtSync = 45U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Sm0ExtSync = 46U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Sm0ExtSync = 47U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Sm0ExtSync = 48U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Sm0ExtSync = 49U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Sm0ExtSync = 50U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Sm0ExtSync = 51U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Sm0ExtSync = 57U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm1Sm0ExtSync = 58U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Sm0ExtSync = 59U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm1Sm0ExtSync = 60U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - - /*!< FlexPWM1_SM1_EXTSYNC input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm1Sm1ExtSync = 0U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_PinInt2ToFlexPwm1Sm1ExtSync = 1U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Sm1ExtSync = 5U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Sm1ExtSync = 6U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Sm1ExtSync = 7U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexPwm1Sm1ExtSync = 8U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexPwm1Sm1ExtSync = 9U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm1Sm1ExtSync = 11U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm1Sm1ExtSync = 12U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm1Sm1ExtSync = 13U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm1Sm1ExtSync = 14U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm1Sm1ExtSync = 15U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm1Sm1ExtSync = 16U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm1Sm1ExtSync = 17U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm1Sm1ExtSync = 18U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm1Sm1ExtSync = 19U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm1Sm1ExtSync = 20U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Sm1ExtSync = 21U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Sm1ExtSync = 22U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToFlexPwm1Sm1ExtSync = 24U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToFlexPwm1Sm1ExtSync = 25U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToFlexPwm1Sm1ExtSync = 26U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToFlexPwm1Sm1ExtSync = 27U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToFlexPwm1Sm1ExtSync = 28U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToFlexPwm1Sm1ExtSync = 29U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToFlexPwm1Sm1ExtSync = 30U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToFlexPwm1Sm1ExtSync = 31U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm1Sm1ExtSync = 32U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm1Sm1ExtSync = 33U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm1Sm1ExtSync = 34U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm1Sm1ExtSync = 35U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm1Sm1ExtSync = 36U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm1Sm1ExtSync = 37U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm1Sm1ExtSync = 38U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm1Sm1ExtSync = 39U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm1Sm1ExtSync = 40U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm1Sm1ExtSync = 41U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Sm1ExtSync = 42U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Sm1ExtSync = 43U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Sm1ExtSync = 44U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Sm1ExtSync = 45U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Sm1ExtSync = 46U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Sm1ExtSync = 47U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Sm1ExtSync = 48U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Sm1ExtSync = 49U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Sm1ExtSync = 50U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Sm1ExtSync = 51U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Sm1ExtSync = 57U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm1Sm1ExtSync = 58U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Sm1ExtSync = 59U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm1Sm1ExtSync = 60U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - - /*!< FlexPWM1_SM2_EXTSYNC2 input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm1Sm2ExtSync = 0U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_PinInt2ToFlexPwm1Sm2ExtSync = 1U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Sm2ExtSync = 5U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Sm2ExtSync = 6U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Sm2ExtSync = 7U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexPwm1Sm2ExtSync = 8U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexPwm1Sm2ExtSync = 9U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm1Sm2ExtSync = 11U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm1Sm2ExtSync = 12U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm1Sm2ExtSync = 13U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm1Sm2ExtSync = 14U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm1Sm2ExtSync = 15U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm1Sm2ExtSync = 16U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm1Sm2ExtSync = 17U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm1Sm2ExtSync = 18U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm1Sm2ExtSync = 19U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm1Sm2ExtSync = 20U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Sm2ExtSync = 21U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Sm2ExtSync = 22U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToFlexPwm1Sm2ExtSync = 24U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToFlexPwm1Sm2ExtSync = 25U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToFlexPwm1Sm2ExtSync = 26U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToFlexPwm1Sm2ExtSync = 27U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToFlexPwm1Sm2ExtSync = 28U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToFlexPwm1Sm2ExtSync = 29U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToFlexPwm1Sm2ExtSync = 30U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToFlexPwm1Sm2ExtSync = 31U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm1Sm2ExtSync = 32U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm1Sm2ExtSync = 33U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm1Sm2ExtSync = 34U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm1Sm2ExtSync = 35U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm1Sm2ExtSync = 36U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm1Sm2ExtSync = 37U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm1Sm2ExtSync = 38U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm1Sm2ExtSync = 39U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm1Sm2ExtSync = 40U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm1Sm2ExtSync = 41U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Sm2ExtSync = 42U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Sm2ExtSync = 43U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Sm2ExtSync = 44U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Sm2ExtSync = 45U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Sm2ExtSync = 46U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Sm2ExtSync = 47U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Sm2ExtSync = 48U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Sm2ExtSync = 49U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Sm2ExtSync = 50U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Sm2ExtSync = 51U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Sm2ExtSync = 57U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm1Sm2ExtSync = 58U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Sm2ExtSync = 59U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm1Sm2ExtSync = 60U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - - /*!< FlexPWM1_SM3_EXTSYNC input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm1Sm3ExtSync = 0U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_PinInt2ToFlexPwm1Sm3ExtSync = 1U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Sm3ExtSync = 5U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Sm3ExtSync = 6U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Sm3ExtSync = 7U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexPwm1Sm3ExtSync = 8U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexPwm1Sm3ExtSync = 9U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm1Sm3ExtSync = 11U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm1Sm3ExtSync = 12U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm1Sm3ExtSync = 13U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm1Sm3ExtSync = 14U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm1Sm3ExtSync = 15U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm1Sm3ExtSync = 16U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm1Sm3ExtSync = 17U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm1Sm3ExtSync = 18U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm1Sm3ExtSync = 19U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm1Sm3ExtSync = 20U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Sm3ExtSync = 21U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Sm3ExtSync = 22U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToFlexPwm1Sm3ExtSync = 24U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToFlexPwm1Sm3ExtSync = 25U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToFlexPwm1Sm3ExtSync = 26U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToFlexPwm1Sm3ExtSync = 27U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToFlexPwm1Sm3ExtSync = 28U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToFlexPwm1Sm3ExtSync = 29U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToFlexPwm1Sm3ExtSync = 30U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToFlexPwm1Sm3ExtSync = 31U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm1Sm3ExtSync = 32U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm1Sm3ExtSync = 33U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm1Sm3ExtSync = 34U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm1Sm3ExtSync = 35U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm1Sm3ExtSync = 36U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm1Sm3ExtSync = 37U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm1Sm3ExtSync = 38U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm1Sm3ExtSync = 39U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm1Sm3ExtSync = 40U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm1Sm3ExtSync = 41U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Sm3ExtSync = 42U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Sm3ExtSync = 43U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Sm3ExtSync = 44U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Sm3ExtSync = 45U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Sm3ExtSync = 46U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Sm3ExtSync = 47U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Sm3ExtSync = 48U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Sm3ExtSync = 49U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Sm3ExtSync = 50U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Sm3ExtSync = 51U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Sm3ExtSync = 57U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm1Sm3ExtSync = 58U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Sm3ExtSync = 59U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm1Sm3ExtSync = 60U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - - /*!< FlexPWM1_SM0_EXTA input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm1Sm0Exta = 0U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_PinInt2ToFlexPwm1Sm0Exta = 1U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Sm0Exta = 5U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Sm0Exta = 6U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Sm0Exta = 7U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexPwm1Sm0Exta = 8U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexPwm1Sm0Exta = 9U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm1Sm0Exta = 11U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm1Sm0Exta = 12U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm1Sm0Exta = 13U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm1Sm0Exta = 14U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm1Sm0Exta = 15U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm1Sm0Exta = 16U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm1Sm0Exta = 17U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm1Sm0Exta = 18U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm1Sm0Exta = 19U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm1Sm0Exta = 20U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Sm0Exta = 21U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Sm0Exta = 22U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToFlexPwm1Sm0Exta = 24U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToFlexPwm1Sm0Exta = 25U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToFlexPwm1Sm0Exta = 26U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToFlexPwm1Sm0Exta = 27U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToFlexPwm1Sm0Exta = 28U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToFlexPwm1Sm0Exta = 29U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToFlexPwm1Sm0Exta = 30U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToFlexPwm1Sm0Exta = 31U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm1Sm0Exta = 32U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm1Sm0Exta = 33U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm1Sm0Exta = 34U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm1Sm0Exta = 35U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm1Sm0Exta = 36U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm1Sm0Exta = 37U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm1Sm0Exta = 38U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm1Sm0Exta = 39U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm1Sm0Exta = 40U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm1Sm0Exta = 41U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Sm0Exta = 42U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Sm0Exta = 43U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Sm0Exta = 44U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Sm0Exta = 45U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Sm0Exta = 46U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Sm0Exta = 47U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Sm0Exta = 48U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Sm0Exta = 49U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Sm0Exta = 50U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Sm0Exta = 51U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Sm0Exta = 57U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm1Sm0Exta = 58U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Sm0Exta = 59U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm1Sm0Exta = 60U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - - /*!< FlexPWM1_SM1_EXTA input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm1Sm1Exta = 0U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_PinInt2ToFlexPwm1Sm1Exta = 1U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Sm1Exta = 5U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Sm1Exta = 6U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Sm1Exta = 7U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexPwm1Sm1Exta = 8U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexPwm1Sm1Exta = 9U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm1Sm1Exta = 11U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm1Sm1Exta = 12U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm1Sm1Exta = 13U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm1Sm1Exta = 14U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm1Sm1Exta = 15U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm1Sm1Exta = 16U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm1Sm1Exta = 17U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm1Sm1Exta = 18U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm1Sm1Exta = 19U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm1Sm1Exta = 20U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Sm1Exta = 21U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Sm1Exta = 22U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToFlexPwm1Sm1Exta = 24U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToFlexPwm1Sm1Exta = 25U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToFlexPwm1Sm1Exta = 26U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToFlexPwm1Sm1Exta = 27U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToFlexPwm1Sm1Exta = 28U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToFlexPwm1Sm1Exta = 29U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToFlexPwm1Sm1Exta = 30U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToFlexPwm1Sm1Exta = 31U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm1Sm1Exta = 32U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm1Sm1Exta = 33U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm1Sm1Exta = 34U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm1Sm1Exta = 35U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm1Sm1Exta = 36U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm1Sm1Exta = 37U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm1Sm1Exta = 38U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm1Sm1Exta = 39U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm1Sm1Exta = 40U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm1Sm1Exta = 41U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Sm1Exta = 42U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Sm1Exta = 43U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Sm1Exta = 44U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Sm1Exta = 45U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Sm1Exta = 46U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Sm1Exta = 47U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Sm1Exta = 48U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Sm1Exta = 49U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Sm1Exta = 50U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Sm1Exta = 51U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Sm1Exta = 57U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm1Sm1Exta = 58U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Sm1Exta = 59U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm1Sm1Exta = 60U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - - /*!< FlexPWM1_SM2_EXTA input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm1Sm2Exta = 0U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_PinInt2ToFlexPwm1Sm2Exta = 1U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Sm2Exta = 5U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Sm2Exta = 6U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Sm2Exta = 7U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexPwm1Sm2Exta = 8U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexPwm1Sm2Exta = 9U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm1Sm2Exta = 11U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm1Sm2Exta = 12U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm1Sm2Exta = 13U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm1Sm2Exta = 14U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm1Sm2Exta = 15U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm1Sm2Exta = 16U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm1Sm2Exta = 17U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm1Sm2Exta = 18U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm1Sm2Exta = 19U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm1Sm2Exta = 20U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Sm2Exta = 21U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Sm2Exta = 22U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToFlexPwm1Sm2Exta = 24U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToFlexPwm1Sm2Exta = 25U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToFlexPwm1Sm2Exta = 26U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToFlexPwm1Sm2Exta = 27U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToFlexPwm1Sm2Exta = 28U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToFlexPwm1Sm2Exta = 29U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToFlexPwm1Sm2Exta = 30U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToFlexPwm1Sm2Exta = 31U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm1Sm2Exta = 32U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm1Sm2Exta = 33U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm1Sm2Exta = 34U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm1Sm2Exta = 35U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm1Sm2Exta = 36U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm1Sm2Exta = 37U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm1Sm2Exta = 38U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm1Sm2Exta = 39U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm1Sm2Exta = 40U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm1Sm2Exta = 41U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Sm2Exta = 42U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Sm2Exta = 43U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Sm2Exta = 44U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Sm2Exta = 45U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Sm2Exta = 46U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Sm2Exta = 47U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Sm2Exta = 48U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Sm2Exta = 49U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Sm2Exta = 50U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Sm2Exta = 51U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Sm2Exta = 57U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm1Sm2Exta = 58U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Sm2Exta = 59U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm1Sm2Exta = 60U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - - /*!< FlexPWM1_SM3_EXTA input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm1Sm3Exta = 0U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_PinInt2ToFlexPwm1Sm3Exta = 1U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Sm3Exta = 5U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Sm3Exta = 6U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Sm3Exta = 7U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexPwm1Sm3Exta = 8U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexPwm1Sm3Exta = 9U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm1Sm3Exta = 11U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm1Sm3Exta = 12U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm1Sm3Exta = 13U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm1Sm3Exta = 14U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm1Sm3Exta = 15U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm1Sm3Exta = 16U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm1Sm3Exta = 17U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm1Sm3Exta = 18U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm1Sm3Exta = 19U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm1Sm3Exta = 20U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Sm3Exta = 21U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Sm3Exta = 22U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToFlexPwm1Sm3Exta = 24U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToFlexPwm1Sm3Exta = 25U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToFlexPwm1Sm3Exta = 26U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToFlexPwm1Sm3Exta = 27U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToFlexPwm1Sm3Exta = 28U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToFlexPwm1Sm3Exta = 29U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToFlexPwm1Sm3Exta = 30U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToFlexPwm1Sm3Exta = 31U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm1Sm3Exta = 32U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm1Sm3Exta = 33U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm1Sm3Exta = 34U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm1Sm3Exta = 35U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm1Sm3Exta = 36U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm1Sm3Exta = 37U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm1Sm3Exta = 38U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm1Sm3Exta = 39U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm1Sm3Exta = 40U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm1Sm3Exta = 41U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Sm3Exta = 42U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Sm3Exta = 43U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Sm3Exta = 44U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Sm3Exta = 45U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Sm3Exta = 46U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Sm3Exta = 47U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Sm3Exta = 48U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Sm3Exta = 49U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Sm3Exta = 50U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Sm3Exta = 51U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Sm3Exta = 57U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm1Sm3Exta = 58U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Sm3Exta = 59U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm1Sm3Exta = 60U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - - /*!< FlexPWM1_EXTFORCE input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm1ExtForce = 0U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_PinInt2ToFlexPwm1ExtForce = 1U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1ExtForce = 5U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1ExtForce = 6U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1ExtForce = 7U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexPwm1ExtForce = 8U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexPwm1ExtForce = 9U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm1ExtForce = 11U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm1ExtForce = 12U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm1ExtForce = 13U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm1ExtForce = 14U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm1ExtForce = 15U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm1ExtForce = 16U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm1ExtForce = 17U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm1ExtForce = 18U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm1ExtForce = 19U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm1ExtForce = 20U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1ExtForce = 21U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1ExtForce = 22U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToFlexPwm1ExtForce = 24U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToFlexPwm1ExtForce = 25U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToFlexPwm1ExtForce = 26U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToFlexPwm1ExtForce = 27U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToFlexPwm1ExtForce = 28U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToFlexPwm1ExtForce = 29U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToFlexPwm1ExtForce = 30U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToFlexPwm1ExtForce = 31U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm1ExtForce = 32U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm1ExtForce = 33U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm1ExtForce = 34U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm1ExtForce = 35U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm1ExtForce = 36U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm1ExtForce = 37U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm1ExtForce = 38U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm1ExtForce = 39U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm1ExtForce = 40U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm1ExtForce = 41U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1ExtForce = 42U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1ExtForce = 43U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1ExtForce = 44U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1ExtForce = 45U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1ExtForce = 46U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1ExtForce = 47U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1ExtForce = 48U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1ExtForce = 49U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1ExtForce = 50U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1ExtForce = 51U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1ExtForce = 57U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm1ExtForce = 58U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1ExtForce = 59U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm1ExtForce = 60U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - - /*!< FlexPWM1_FAULT0 input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm1Fault0 = 0U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_PinInt2ToFlexPwm1Fault0 = 1U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Fault0 = 5U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Fault0 = 6U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Fault0 = 7U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexPwm1Fault0 = 8U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexPwm1Fault0 = 9U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm1Fault0 = 11U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm1Fault0 = 12U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm1Fault0 = 13U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm1Fault0 = 14U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm1Fault0 = 15U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm1Fault0 = 16U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm1Fault0 = 17U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm1Fault0 = 18U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm1Fault0 = 19U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm1Fault0 = 20U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Fault0 = 21U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Fault0 = 22U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToFlexPwm1Fault0 = 24U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToFlexPwm1Fault0 = 25U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToFlexPwm1Fault0 = 26U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToFlexPwm1Fault0 = 27U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToFlexPwm1Fault0 = 28U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToFlexPwm1Fault0 = 29U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToFlexPwm1Fault0 = 30U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToFlexPwm1Fault0 = 31U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm1Fault0 = 32U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm1Fault0 = 33U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm1Fault0 = 34U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm1Fault0 = 35U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm1Fault0 = 36U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm1Fault0 = 37U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm1Fault0 = 38U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm1Fault0 = 39U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm1Fault0 = 40U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm1Fault0 = 41U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Fault0 = 42U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Fault0 = 43U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Fault0 = 44U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Fault0 = 45U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Fault0 = 46U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Fault0 = 47U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Fault0 = 48U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Fault0 = 49U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Fault0 = 50U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Fault0 = 51U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Fault0 = 57U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm1Fault0 = 58U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Fault0 = 59U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm1Fault0 = 60U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - - /*!< FlexPWM1_FAULT1 input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm1Fault1 = 0U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_PinInt2ToFlexPwm1Fault1 = 1U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Fault1 = 5U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Fault1 = 6U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Fault1 = 7U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexPwm1Fault1 = 8U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexPwm1Fault1 = 9U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm1Fault1 = 11U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm1Fault1 = 12U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm1Fault1 = 13U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm1Fault1 = 14U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm1Fault1 = 15U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm1Fault1 = 16U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm1Fault1 = 17U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm1Fault1 = 18U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm1Fault1 = 19U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm1Fault1 = 20U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Fault1 = 21U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Fault1 = 22U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToFlexPwm1Fault1 = 24U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToFlexPwm1Fault1 = 25U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToFlexPwm1Fault1 = 26U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToFlexPwm1Fault1 = 27U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToFlexPwm1Fault1 = 28U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToFlexPwm1Fault1 = 29U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToFlexPwm1Fault1 = 30U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToFlexPwm1Fault1 = 31U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm1Fault1 = 32U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm1Fault1 = 33U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm1Fault1 = 34U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm1Fault1 = 35U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm1Fault1 = 36U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm1Fault1 = 37U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm1Fault1 = 38U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm1Fault1 = 39U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm1Fault1 = 40U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm1Fault1 = 41U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Fault1 = 42U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Fault1 = 43U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Fault1 = 44U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Fault1 = 45U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Fault1 = 46U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Fault1 = 47U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Fault1 = 48U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Fault1 = 49U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Fault1 = 50U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Fault1 = 51U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Fault1 = 57U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm1Fault1 = 58U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Fault1 = 59U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm1Fault1 = 60U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - - /*!< FlexPWM1_FAULT2 input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm1Fault2 = 0U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_PinInt2ToFlexPwm1Fault2 = 1U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Fault2 = 5U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Fault2 = 6U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Fault2 = 7U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexPwm1Fault2 = 8U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexPwm1Fault2 = 9U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm1Fault2 = 11U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm1Fault2 = 12U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm1Fault2 = 13U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm1Fault2 = 14U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm1Fault2 = 15U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm1Fault2 = 16U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm1Fault2 = 17U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm1Fault2 = 18U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm1Fault2 = 19U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm1Fault2 = 20U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Fault2 = 21U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Fault2 = 22U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToFlexPwm1Fault2 = 24U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToFlexPwm1Fault2 = 25U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToFlexPwm1Fault2 = 26U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToFlexPwm1Fault2 = 27U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToFlexPwm1Fault2 = 28U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToFlexPwm1Fault2 = 29U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToFlexPwm1Fault2 = 30U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToFlexPwm1Fault2 = 31U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm1Fault2 = 32U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm1Fault2 = 33U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm1Fault2 = 34U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm1Fault2 = 35U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm1Fault2 = 36U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm1Fault2 = 37U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm1Fault2 = 38U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm1Fault2 = 39U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm1Fault2 = 40U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm1Fault2 = 41U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Fault2 = 42U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Fault2 = 43U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Fault2 = 44U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Fault2 = 45U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Fault2 = 46U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Fault2 = 47U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Fault2 = 48U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Fault2 = 49U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Fault2 = 50U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Fault2 = 51U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Fault2 = 57U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm1Fault2 = 58U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Fault2 = 59U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm1Fault2 = 60U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - - /*!< FlexPWM1_FAULT3 input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm1Fault3 = 0U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_PinInt2ToFlexPwm1Fault3 = 1U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Fault3 = 5U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Fault3 = 6U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Fault3 = 7U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexPwm1Fault3 = 8U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexPwm1Fault3 = 9U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm1Fault3 = 11U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm1Fault3 = 12U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm1Fault3 = 13U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm1Fault3 = 14U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm1Fault3 = 15U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm1Fault3 = 16U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm1Fault3 = 17U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm1Fault3 = 18U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm1Fault3 = 19U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm1Fault3 = 20U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Fault3 = 21U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Fault3 = 22U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToFlexPwm1Fault3 = 24U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToFlexPwm1Fault3 = 25U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToFlexPwm1Fault3 = 26U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToFlexPwm1Fault3 = 27U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToFlexPwm1Fault3 = 28U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToFlexPwm1Fault3 = 29U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToFlexPwm1Fault3 = 30U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToFlexPwm1Fault3 = 31U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm1Fault3 = 32U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm1Fault3 = 33U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm1Fault3 = 34U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm1Fault3 = 35U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm1Fault3 = 36U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm1Fault3 = 37U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm1Fault3 = 38U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm1Fault3 = 39U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm1Fault3 = 40U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm1Fault3 = 41U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Fault3 = 42U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Fault3 = 43U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Fault3 = 44U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Fault3 = 45U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Fault3 = 46U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Fault3 = 47U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Fault3 = 48U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Fault3 = 49U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Fault3 = 50U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Fault3 = 51U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Fault3 = 57U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm1Fault3 = 58U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Fault3 = 59U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm1Fault3 = 60U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - - /*!< PWM0 external clock trigger. */ - kINPUTMUX_Fro16KToPwm0ExtClk = 0U + (PWM0_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_Osc32KToPwm0ExtClk = 1U + (PWM0_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToPwm0ExtClk = 2U + (PWM0_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToPwm0ExtClk = 3U + (PWM0_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_ExttrigIn0ToPwm0ExtClk = 4U + (PWM0_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_ExttrigIn1ToPwm0ExtClk = 5U + (PWM0_EXT_CLK_REG << PMUX_SHIFT), - - /*!< PWM1 external clock trigger. */ - kINPUTMUX_Fro16KToPwm1ExtClk = 0U + (PWM1_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_Osc32KToPwm1ExtClk = 1U + (PWM1_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToPwm1ExtClk = 2U + (PWM1_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToPwm1ExtClk = 3U + (PWM1_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_ExttrigIn0ToPwm1ExtClk = 4U + (PWM1_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_ExttrigIn1ToPwm1ExtClk = 5U + (PWM1_EXT_CLK_REG << PMUX_SHIFT), - - /*!< EVTG trigger input connections. */ - kINPUTMUX_PinInt0ToEvtgTrigger = 0U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_PinInt1ToEvtgTrigger = 1U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToEvtgTrigger = 6U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToEvtgTrigger = 7U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToEvtgTrigger = 8U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToEvtgTrigger = 9U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToEvtgTrigger = 10U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToEvtgTrigger = 11U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToEvtgTrigger = 13U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0IrqToEvtgTrigger = 14U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1IrqToEvtgTrigger = 15U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToEvtgTrigger = 16U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToEvtgTrigger = 17U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToEvtgTrigger = 18U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToEvtgTrigger = 19U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToEvtgTrigger = 20U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToEvtgTrigger = 21U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToEvtgTrigger = 22U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToEvtgTrigger = 23U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToEvtgTrigger = 24U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToEvtgTrigger = 25U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToEvtgTrigger = 27U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToEvtgTrigger = 28U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToEvtgTrigger = 29U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToEvtgTrigger = 30U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToEvtgTrigger = 31U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToEvtgTrigger = 32U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToEvtgTrigger = 33U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToEvtgTrigger = 34U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToEvtgTrigger = 35U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToEvtgTrigger = 36U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToEvtgTrigger = 37U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToEvtgTrigger = 38U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToEvtgTrigger = 39U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToEvtgTrigger = 40U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToEvtgTrigger = 41U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToEvtgTrigger = 42U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToEvtgTrigger = 43U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToEvtgTrigger = 44U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToEvtgTrigger = 45U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToEvtgTrigger = 46U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToEvtgTrigger = 47U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToEvtgTrigger = 48U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToEvtgTrigger = 49U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToEvtgTrigger = 50U + (EVTG_TRIG0_REG << PMUX_SHIFT), - - /*!< EXT trigger connections. */ - kINPUTMUX_PinInt0ToExtTrigger = 0U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_PinInt1ToExtTrigger = 1U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0IrqToExtTrigger = 2U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1IrqToExtTrigger = 3U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToExtTrigger = 4U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToExtTrigger = 5U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig01ToExtTrigger = 6U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig01ToExtTrigger = 7U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig01ToExtTrigger = 8U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig01ToExtTrigger = 9U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig01ToExtTrigger = 10U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig01ToExtTrigger = 11U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig01ToExtTrigger = 12U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig01ToExtTrigger = 13U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToExtTrigger = 14U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToExtTrigger = 15U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToExtTrigger = 16U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToExtTrigger = 17U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToExtTrigger = 18U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToExtTrigger = 19U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToExtTrigger = 20U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToExtTrigger = 21U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToExtTrigger = 22U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToExtTrigger = 23U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToExtTrigger = 26U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToExtTrigger = 27U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm0Trig3ToExtTrigger = 34U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm1Trig3ToExtTrigger = 35U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm2Trig3ToExtTrigger = 36U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm3Trig3ToExtTrigger = 37U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm4Trig3ToExtTrigger = 38U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm5Trig3ToExtTrigger = 39U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm6Trig3ToExtTrigger = 40U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm7Trig3ToExtTrigger = 41U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToExtTrigger = 44U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToExtTrigger = 45U + (EXT_TRIG0_REG << PMUX_SHIFT), - - /*!< FLEXCOMM0 trigger input connections. */ - kINPUTMUX_PinInt4ToFlexcomm0Trigger = 0U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexcomm0Trigger = 1U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt6ToFlexcomm0Trigger = 2U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToFlexcomm0Trigger = 6U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToFlexcomm0Trigger = 7U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexcomm0Trigger = 8U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToFlexcomm0Trigger = 9U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexcomm0Trigger = 10U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToFlexcomm0Trigger = 11U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToFlexcomm0Trigger = 12U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexcomm0Trigger = 13U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexcomm0Trigger = 14U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexcomm0Trigger = 15U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexcomm0Trigger = 16U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexcomm0Trigger = 18U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexcomm0Trigger = 19U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexcomm0Trigger = 20U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexcomm0Trigger = 21U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexcomm0Trigger = 22U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexcomm0Trigger = 23U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexcomm0Trigger = 24U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexcomm0Trigger = 25U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexcomm0Trigger = 26U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexcomm0Trigger = 27U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexcomm0Trigger = 28U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexcomm0Trigger = 29U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexcomm0Trigger = 30U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexcomm0Trigger = 31U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexcomm0Trigger = 32U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh4ToFlexcomm0Trigger = 33U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh5ToFlexcomm0Trigger = 34U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh6ToFlexcomm0Trigger = 35U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh7ToFlexcomm0Trigger = 36U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Usb0IppIndUartRxdUsbmuxToFlexcomm0Trigger = 37U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexcomm0Trigger = 38U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexcomm0Trigger = 39U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexcomm0Trigger = 40U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexcomm0Trigger = 41U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToFlexcomm0Trigger = 42U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - - /*!< FLEXCOMM1 trigger input connections. */ - kINPUTMUX_PinInt4ToFlexcomm1Trigger = 0U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexcomm1Trigger = 1U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt6ToFlexcomm1Trigger = 2U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToFlexcomm1Trigger = 6U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToFlexcomm1Trigger = 7U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexcomm1Trigger = 8U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToFlexcomm1Trigger = 9U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexcomm1Trigger = 10U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToFlexcomm1Trigger = 11U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToFlexcomm1Trigger = 12U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexcomm1Trigger = 13U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexcomm1Trigger = 14U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexcomm1Trigger = 15U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexcomm1Trigger = 16U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexcomm1Trigger = 18U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexcomm1Trigger = 19U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexcomm1Trigger = 20U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexcomm1Trigger = 21U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexcomm1Trigger = 22U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexcomm1Trigger = 23U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexcomm1Trigger = 24U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexcomm1Trigger = 25U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexcomm1Trigger = 26U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexcomm1Trigger = 27U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexcomm1Trigger = 28U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexcomm1Trigger = 29U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexcomm1Trigger = 30U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexcomm1Trigger = 31U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexcomm1Trigger = 32U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh4ToFlexcomm1Trigger = 33U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh5ToFlexcomm1Trigger = 34U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh6ToFlexcomm1Trigger = 35U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh7ToFlexcomm1Trigger = 36U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Usb0IppIndUartRxdUsbmuxToFlexcomm1Trigger = 37U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexcomm1Trigger = 38U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexcomm1Trigger = 39U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexcomm1Trigger = 40U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexcomm1Trigger = 41U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToFlexcomm1Trigger = 42U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - - /*!< FLEXCOMM2 trigger input connections. */ - kINPUTMUX_PinInt4ToFlexcomm2Trigger = 0U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt6ToFlexcomm2Trigger = 1U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt7ToFlexcomm2Trigger = 2U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToFlexcomm2Trigger = 6U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToFlexcomm2Trigger = 7U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexcomm2Trigger = 8U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M1ToFlexcomm2Trigger = 9U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexcomm2Trigger = 10U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToFlexcomm2Trigger = 11U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToFlexcomm2Trigger = 12U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexcomm2Trigger = 13U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexcomm2Trigger = 14U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexcomm2Trigger = 15U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexcomm2Trigger = 16U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexcomm2Trigger = 18U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexcomm2Trigger = 19U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexcomm2Trigger = 20U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexcomm2Trigger = 21U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexcomm2Trigger = 22U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexcomm2Trigger = 23U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexcomm2Trigger = 24U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexcomm2Trigger = 25U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexcomm2Trigger = 26U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexcomm2Trigger = 27U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexcomm2Trigger = 28U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexcomm2Trigger = 29U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexcomm2Trigger = 30U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexcomm2Trigger = 31U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexcomm2Trigger = 32U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh4ToFlexcomm2Trigger = 33U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh5ToFlexcomm2Trigger = 34U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh6ToFlexcomm2Trigger = 35U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh7ToFlexcomm2Trigger = 36U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Usb0IppIndUartRxdUsbmuxToFlexcomm2Trigger = 37U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexcomm2Trigger = 38U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexcomm2Trigger = 39U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexcomm2Trigger = 40U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexcomm2Trigger = 41U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToFlexcomm2Trigger = 42U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - - /*!< FLEXCOMM3 trigger input connections. */ - kINPUTMUX_PinInt4ToFlexcomm3Trigger = 0U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexcomm3Trigger = 1U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt7ToFlexcomm3Trigger = 2U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToFlexcomm3Trigger = 6U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToFlexcomm3Trigger = 7U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexcomm3Trigger = 8U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M1ToFlexcomm3Trigger = 9U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexcomm3Trigger = 10U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToFlexcomm3Trigger = 11U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToFlexcomm3Trigger = 12U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexcomm3Trigger = 13U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexcomm3Trigger = 14U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexcomm3Trigger = 15U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexcomm3Trigger = 16U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexcomm3Trigger = 18U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexcomm3Trigger = 19U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexcomm3Trigger = 20U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexcomm3Trigger = 21U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexcomm3Trigger = 22U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexcomm3Trigger = 23U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexcomm3Trigger = 24U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexcomm3Trigger = 25U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexcomm3Trigger = 26U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexcomm3Trigger = 27U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexcomm3Trigger = 28U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexcomm3Trigger = 29U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexcomm3Trigger = 30U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexcomm3Trigger = 31U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexcomm3Trigger = 32U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh4ToFlexcomm3Trigger = 33U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh5ToFlexcomm3Trigger = 34U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh6ToFlexcomm3Trigger = 35U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh7ToFlexcomm3Trigger = 36U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Usb0IppIndUartRxdUsbmuxToFlexcomm3Trigger = 37U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexcomm3Trigger = 38U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexcomm3Trigger = 39U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexcomm3Trigger = 40U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexcomm3Trigger = 41U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToFlexcomm3Trigger = 42U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - - /*!< FLEXCOMM4 trigger input connections. */ - kINPUTMUX_PinInt4ToFlexcomm4Trigger = 0U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexcomm4Trigger = 1U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt7ToFlexcomm4Trigger = 2U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToFlexcomm4Trigger = 6U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToFlexcomm4Trigger = 7U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToFlexcomm4Trigger = 8U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToFlexcomm4Trigger = 9U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToFlexcomm4Trigger = 10U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToFlexcomm4Trigger = 11U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToFlexcomm4Trigger = 12U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexcomm4Trigger = 13U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexcomm4Trigger = 14U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexcomm4Trigger = 15U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexcomm4Trigger = 16U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexcomm4Trigger = 18U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexcomm4Trigger = 19U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexcomm4Trigger = 20U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexcomm4Trigger = 21U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexcomm4Trigger = 22U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexcomm4Trigger = 23U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexcomm4Trigger = 24U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexcomm4Trigger = 25U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexcomm4Trigger = 26U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexcomm4Trigger = 27U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexcomm4Trigger = 28U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexcomm4Trigger = 29U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexcomm4Trigger = 30U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexcomm4Trigger = 31U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexcomm4Trigger = 32U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh4ToFlexcomm4Trigger = 33U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh5ToFlexcomm4Trigger = 34U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh6ToFlexcomm4Trigger = 35U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh7ToFlexcomm4Trigger = 36U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Usb0IppIndUartRxdUsbmuxToFlexcomm4Trigger = 37U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexcomm4Trigger = 38U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexcomm4Trigger = 39U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexcomm4Trigger = 40U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexcomm4Trigger = 41U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToFlexcomm4Trigger = 42U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - - /*!< FLEXCOMM5 trigger input connections. */ - kINPUTMUX_PinInt4ToFlexcomm5Trigger = 0U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexcomm5Trigger = 1U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt7ToFlexcomm5Trigger = 2U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToFlexcomm5Trigger = 6U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToFlexcomm5Trigger = 7U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToFlexcomm5Trigger = 8U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToFlexcomm5Trigger = 9U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToFlexcomm5Trigger = 10U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToFlexcomm5Trigger = 11U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToFlexcomm5Trigger = 12U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexcomm5Trigger = 13U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexcomm5Trigger = 14U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexcomm5Trigger = 15U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexcomm5Trigger = 16U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexcomm5Trigger = 18U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexcomm5Trigger = 19U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexcomm5Trigger = 20U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexcomm5Trigger = 21U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexcomm5Trigger = 22U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexcomm5Trigger = 23U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexcomm5Trigger = 24U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexcomm5Trigger = 25U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexcomm5Trigger = 26U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexcomm5Trigger = 27U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexcomm5Trigger = 28U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexcomm5Trigger = 29U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexcomm5Trigger = 30U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexcomm5Trigger = 31U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexcomm5Trigger = 32U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh4ToFlexcomm5Trigger = 33U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh5ToFlexcomm5Trigger = 34U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh6ToFlexcomm5Trigger = 35U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh7ToFlexcomm5Trigger = 36U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Usb0IppIndUartRxdUsbmuxToFlexcomm5Trigger = 37U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexcomm5Trigger = 38U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexcomm5Trigger = 39U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexcomm5Trigger = 40U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexcomm5Trigger = 41U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToFlexcomm5Trigger = 42U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - - /*!< FLEXCOMM6 trigger input connections. */ - kINPUTMUX_PinInt4ToFlexcomm6Trigger = 0U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexcomm6Trigger = 1U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt7ToFlexcomm6Trigger = 2U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToFlexcomm6Trigger = 6U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToFlexcomm6Trigger = 7U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexcomm6Trigger = 8U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToFlexcomm6Trigger = 9U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToFlexcomm6Trigger = 10U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToFlexcomm6Trigger = 11U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToFlexcomm6Trigger = 12U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexcomm6Trigger = 13U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexcomm6Trigger = 14U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexcomm6Trigger = 15U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexcomm6Trigger = 16U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexcomm6Trigger = 18U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexcomm6Trigger = 19U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexcomm6Trigger = 20U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexcomm6Trigger = 21U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexcomm6Trigger = 22U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexcomm6Trigger = 23U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexcomm6Trigger = 24U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexcomm6Trigger = 25U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexcomm6Trigger = 26U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexcomm6Trigger = 27U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexcomm6Trigger = 28U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexcomm6Trigger = 29U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexcomm6Trigger = 30U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexcomm6Trigger = 31U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexcomm6Trigger = 32U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh4ToFlexcomm6Trigger = 33U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh5ToFlexcomm6Trigger = 34U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh6ToFlexcomm6Trigger = 35U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh7ToFlexcomm6Trigger = 36U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Usb0IppIndUartRxdUsbmuxToFlexcomm6Trigger = 37U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexcomm6Trigger = 38U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexcomm6Trigger = 39U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexcomm6Trigger = 40U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexcomm6Trigger = 41U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToFlexcomm6Trigger = 42U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - - /*!< FLEXCOMM7 trigger input connections. */ - kINPUTMUX_PinInt4ToFlexcomm7Trigger = 0U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexcomm7Trigger = 1U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt7ToFlexcomm7Trigger = 2U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToFlexcomm7Trigger = 6U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToFlexcomm7Trigger = 7U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexcomm7Trigger = 8U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToFlexcomm7Trigger = 9U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToFlexcomm7Trigger = 10U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToFlexcomm7Trigger = 11U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToFlexcomm7Trigger = 12U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexcomm7Trigger = 13U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexcomm7Trigger = 14U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexcomm7Trigger = 15U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexcomm7Trigger = 16U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexcomm7Trigger = 18U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexcomm7Trigger = 19U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexcomm7Trigger = 20U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexcomm7Trigger = 21U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexcomm7Trigger = 22U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexcomm7Trigger = 23U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexcomm7Trigger = 24U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexcomm7Trigger = 25U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexcomm7Trigger = 26U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexcomm7Trigger = 27U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexcomm7Trigger = 28U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexcomm7Trigger = 29U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexcomm7Trigger = 30U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexcomm7Trigger = 31U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexcomm7Trigger = 32U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh4ToFlexcomm7Trigger = 33U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh5ToFlexcomm7Trigger = 34U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh6ToFlexcomm7Trigger = 35U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh7ToFlexcomm7Trigger = 36U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Usb0IppIndUartRxdUsbmuxToFlexcomm7Trigger = 37U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexcomm7Trigger = 38U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexcomm7Trigger = 39U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexcomm7Trigger = 40U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexcomm7Trigger = 41U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToFlexcomm7Trigger = 42U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - - /*!< FlexIO trigger input connections. */ - kINPUTMUX_PinInt4ToFlexioTrigger = 0U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexioTrigger = 1U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_PinInt6ToFlexioTrigger = 2U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_PinInt7ToFlexioTrigger = 3U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToFlexioTrigger = 9U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToFlexioTrigger = 10U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexioTrigger = 11U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M1ToFlexioTrigger = 12U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexioTrigger = 13U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToFlexioTrigger = 14U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToFlexioTrigger = 15U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexioTrigger = 16U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexioTrigger = 17U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexioTrigger = 18U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexioTrigger = 19U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexioTrigger = 20U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexioTrigger = 21U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexioTrigger = 22U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexioTrigger = 23U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexioTrigger = 24U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexioTrigger = 25U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexioTrigger = 26U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexioTrigger = 27U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToFlexioTrigger = 29U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToFlexioTrigger = 30U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToFlexioTrigger = 31U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToFlexioTrigger = 32U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToFlexioTrigger = 33U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToFlexioTrigger = 34U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToFlexioTrigger = 35U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToFlexioTrigger = 36U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToFlexioTrigger = 37U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToFlexioTrigger = 38U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToFlexioTrigger = 39U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToFlexioTrigger = 40U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToFlexioTrigger = 41U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToFlexioTrigger = 42U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToFlexioTrigger = 43U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToFlexioTrigger = 44U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexioTrigger = 45U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexioTrigger = 46U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexioTrigger = 47U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexioTrigger = 48U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexioTrigger = 49U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexioTrigger = 50U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexioTrigger = 51U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexioTrigger = 52U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexioTrigger = 53U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexioTrigger = 54U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexioTrigger = 55U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexioTrigger = 56U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexioTrigger = 57U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm0Trig0ToFlexioTrigger = 63U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm0Trig1ToFlexioTrigger = 64U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm0Trig2ToFlexioTrigger = 65U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm1Trig0ToFlexioTrigger = 66U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm1Trig1ToFlexioTrigger = 67U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm1Trig2ToFlexioTrigger = 68U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm2Trig0ToFlexioTrigger = 69U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm2Trig1ToFlexioTrigger = 70U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm2Trig2ToFlexioTrigger = 71U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm3Trig0ToFlexioTrigger = 72U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm3Trig1ToFlexioTrigger = 73U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm3Trig2ToFlexioTrigger = 74U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm3Trig3ToFlexioTrigger = 75U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_WuuToFlexioTrigger = 76U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), -} inputmux_connection_t; - -/*! @brief INPUTMUX signal enable/disable type */ -typedef enum _inputmux_signal_t -{ - /*!< DMA0 REQ ENABLE0 signal. */ - kINPUTMUX_PinInt0ToDma0Ch3Ena = 3U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_PinInt1ToDma0Ch4Ena = 4U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_PinInt2ToDma0Ch5Ena = 5U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_PinInt3ToDma0Ch6Ena = 6U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer0M0ToDma0Ch7Ena = 7U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer0M1ToDma0Ch8Ena = 8U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer1M0ToDma0Ch9Ena = 9U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer1M1ToDma0Ch10Ena = 10U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer2M0ToDma0Ch11Ena = 11U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer2M1ToDma0Ch12Ena = 12U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer3M0ToDma0Ch13Ena = 13U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer3M1ToDma0Ch14Ena = 14U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer4M0ToDma0Ch15Ena = 15U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer4M1ToDma0Ch16Ena = 16U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Wuu0ToDma0Ch17Ena = 17U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Micfil0FifoRequestToDma0Ch18Ena = 18U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Adc0FifoARequestToDma0Ch21Ena = 21U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Adc0FifoBRequestToDma0Ch22Ena = 22U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Adc1FifoARequestToDma0Ch23Ena = 23U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Adc1FifoBRequestoDma0Ch24Ena = 24U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_HsCmp0DmaRequestToDma0Ch28Ena = 28U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_HsCmp1DmaRequestToDma0Ch29Ena = 29U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Evtg0Out0AToDma0Ch31Ena = 31U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - - /*!< DMA0 REQ ENABLE1 signal. */ - kINPUTMUX_Evtg0Out0BToDma0Ch32Ena = 0U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Evtg0Out1AToDma0Ch33Ena = 1U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Evtg0Out1BToDma0Ch34Ena = 2U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Evtg0Out2AToDma0Ch35Ena = 3U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Evtg0Out2BToDma0Ch36Ena = 4U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Evtg0Out3AToDma0Ch37Ena = 5U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Evtg0Out3BToDma0Ch38Ena = 6U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqCapt0ToDma0Ch39Ena = 7U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqCapt1ToDma0Ch40Ena = 8U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqCapt2ToDma0Ch41Ena = 9U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqCapt3ToDma0Ch42Ena = 10U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqVal0ToDma0Ch43Ena = 11U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqVal1ToDma0Ch44Ena = 12U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqVal2ToDma0Ch45Ena = 13U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqVal3ToDma0Ch46Ena = 14U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqCapt0ToDma0Ch47Ena = 15U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqCapt1ToDma0Ch48Ena = 16U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqCapt2ToDma0Ch49Ena = 17U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqCapt3ToDma0Ch50Ena = 18U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqVal0ToDma0Ch51Ena = 19U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqVal1ToDma0Ch52Ena = 20U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqVal2ToDma0Ch53Ena = 21U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqVal3ToDma0Ch54Ena = 22U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Lptmr0ToDma0Ch57Ena = 25U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Lptmr1ToDma0Ch58Ena = 26U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexCan0DmaRequestToDma0Ch59Ena = 27U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexCan1DmaRequestToDma0Ch60Ena = 28U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexIO0ShiftRegister0RequestToDma0Ch61Ena = 29U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexIO0ShiftRegister1RequestToDma0Ch62Ena = 30U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexIO0ShiftRegister2RequestToDma0Ch63Ena = 31U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - - /*!< DMA0 REQ ENABLE2 signal. */ - kINPUTMUX_FlexIO0ShiftRegister3RequestToDma0Ch64Ena = 0U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_FlexIO0ShiftRegister4RequestToDma0Ch65Ena = 1U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_FlexIO0ShiftRegister5RequestToDma0Ch66Ena = 2U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_FlexIO0ShiftRegister6RequestToDma0Ch67Ena = 3U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_FlexIO0ShiftRegister7RequestToDma0Ch68Ena = 4U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm0RxToDma0Ch69Ena = 5U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm0TxToDma0Ch70Ena = 6U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm1RxToDma0Ch71Ena = 7U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm1TxToDma0Ch72Ena = 8U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm2RxToDma0Ch73Ena = 9U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm2TxToDma0Ch74Ena = 10U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm3RxToDma0Ch75Ena = 11U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm3TxToDma0Ch76Ena = 12U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm4RxToDma0Ch77Ena = 13U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm4TxToDma0Ch78Ena = 14U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm5RxToDma0Ch79Ena = 15U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm5TxToDma0Ch80Ena = 16U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm6RxToDma0Ch81Ena = 17U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm6TxToDma0Ch82Ena = 18U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm7RxToDma0Ch83Ena = 19U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm7TxToDma0Ch84Ena = 20U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_I3c0RxToDma0Ch95Ena = 31U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - - /*!< DMA0 REQ ENABLE3 signal. */ - kINPUTMUX_I3c0TxToDma0Ch96Ena = 0U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_I3c1RxToDma0Ch97Ena = 1U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_I3c1TxToDma0Ch98Ena = 2U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Sai0RxToDma0Ch99Ena = 3U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Sai0TxToDma0Ch100Ena = 4U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Sai1RxToDma0Ch101Ena = 5U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Sai1TxToDma0Ch102Ena = 6U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio0PinEventRequest0ToDma0Ch108Ena = 12U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio0PinEventRequest1ToDma0Ch109Ena = 13U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio1PinEventRequest0ToDma0Ch110Ena = 14U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio1PinEventRequest1ToDma0Ch111Ena = 15U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio2PinEventRequest0ToDma0Ch112Ena = 16U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio2PinEventRequest1ToDma0Ch113Ena = 17U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio3PinEventRequest0ToDma0Ch114Ena = 18U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio3PinEventRequest1ToDma0Ch115Ena = 19U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio4PinEventRequest0ToDma0Ch116Ena = 20U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio4PinEventRequest1ToDma0Ch117Ena = 21U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio5PinEventRequest0ToDma0Ch118Ena = 22U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio5PinEventRequest1ToDma0Ch119Ena = 23U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - - /*!< DMA1 REQ ENABLE0 signal. */ - kINPUTMUX_PinInt0ToDma1Ch3Ena = 3U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_PinInt1ToDma1Ch4Ena = 4U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_PinInt2ToDma1Ch5Ena = 5U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_PinInt3ToDma1Ch6Ena = 6U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer0M0ToDma1Ch7Ena = 7U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer0M1ToDma1Ch8Ena = 8U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer1M0ToDma1Ch9Ena = 9U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer1M1ToDma1Ch10Ena = 10U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer2M0ToDma1Ch11Ena = 11U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer2M1ToDma1Ch12Ena = 12U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer3M0ToDma1Ch13Ena = 13U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer3M1ToDma1Ch14Ena = 14U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer4M0ToDma1Ch15Ena = 15U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer4M1ToDma1Ch16Ena = 16U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Wuu0ToDma1Ch17Ena = 17U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Micfil0FifoRequestToDma1Ch18Ena = 18U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Adc0FifoARequestToDma1Ch21Ena = 21U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Adc0FifoBRequestToDma1Ch22Ena = 22U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Adc1FifoARequestToDma1Ch23Ena = 23U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Adc1FifoBRequestToDma1Ch24Ena = 24U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_HsCmp0DmaRequestToDma1Ch28Ena = 28U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_HsCmp1DmaRequestToDma1Ch29Ena = 29U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Evtg0Out0AToDma1Ch31Ena = 31U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - - /*!< DMA1 REQ ENABLE1 signal. */ - kINPUTMUX_Evtg0Out0BToDma1Ch32Ena = 0U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Evtg0Out1AToDma1Ch33Ena = 1U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Evtg0Out1BToDma1Ch34Ena = 2U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Evtg0Out2AToDma1Ch35Ena = 3U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Evtg0Out2BToDma1Ch36Ena = 4U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Evtg0Out3AToDma1Ch37Ena = 5U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Evtg0Out3BToDma1Ch38Ena = 6U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqCapt0ToDma1Ch39Ena = 7U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqCapt1ToDma1Ch40Ena = 8U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqCapt2ToDma1Ch41Ena = 9U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqCapt3ToDma1Ch42Ena = 10U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqVal0ToDma1Ch43Ena = 11U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqVal1ToDma1Ch44Ena = 12U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqVal2ToDma1Ch45Ena = 13U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqVal3ToDma1Ch46Ena = 14U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqCapt0ToDma1Ch47Ena = 15U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqCapt1ToDma1Ch48Ena = 16U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqCapt2ToDma1Ch49Ena = 17U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqCapt3ToDma1Ch50Ena = 18U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqVal0ToDma1Ch51Ena = 19U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqVal1ToDma1Ch52Ena = 20U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqVal2ToDma1Ch53Ena = 21U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqVal3ToDma1Ch54Ena = 22U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Lptmr0ToDma1Ch57Ena = 25U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Lptmr1ToDma1Ch58Ena = 26U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexCan0DmaRequestToDma1Ch59Ena = 27U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexCan1DmaRequestToDma1Ch60Ena = 28U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexIO0ShiftRegister0RequestToDma1Ch61Ena = 29U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexIO0ShiftRegister1RequestToDma1Ch62Ena = 30U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexIO0ShiftRegister2RequestToDma1Ch63Ena = 31U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - - /*!< DMA1 REQ ENABLE2 signal. */ - kINPUTMUX_FlexIO0ShiftRegister3RequestToDma1Ch64Ena = 0U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_FlexIO0ShiftRegister4RequestToDma1Ch65Ena = 1U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_FlexIO0ShiftRegister5RequestToDma1Ch66Ena = 2U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_FlexIO0ShiftRegister6RequestToDma1Ch67Ena = 3U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_FlexIO0ShiftRegister7RequestToDma1Ch68Ena = 4U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm0RxToDma1Ch69Ena = 5U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm0TxToDma1Ch70Ena = 6U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm1RxToDma1Ch71Ena = 7U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm1TxToDma1Ch72Ena = 8U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm2RxToDma1Ch73Ena = 9U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm2TxToDma1Ch74Ena = 10U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm3RxToDma1Ch75Ena = 11U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm3TxToDma1Ch76Ena = 12U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm4RxToDma1Ch77Ena = 13U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm4TxToDma1Ch78Ena = 14U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm5RxToDma1Ch79Ena = 15U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm5TxToDma1Ch80Ena = 16U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm6RxToDma1Ch81Ena = 17U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm6TxToDma1Ch82Ena = 18U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm7RxToDma1Ch83Ena = 19U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm7TxToDma1Ch84Ena = 20U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_ESpi0Ch0ToDma1Ch89Ena = 25U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_ESpi0Ch1ToDma1Ch90Ena = 26U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_I3c0RxToDma1Ch95Ena = 31U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - - /*!< DMA1 REQ ENABLE3 signal. */ - kINPUTMUX_I3c0TxToDma1Ch96Ena = 0U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_I3c1RxToDma1Ch97Ena = 1U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_I3c1TxToDma1Ch98Ena = 2U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Sai0RxToDma1Ch99Ena = 3U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Sai0TxToDma1Ch100Ena = 4U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Sai1RxToDma1Ch101Ena = 5U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Sai1TxToDma1Ch102Ena = 6U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio0PinEventRequest0ToDma1Ch108Ena = 12U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio0PinEventRequest1ToDma1Ch109Ena = 13U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio1PinEventRequest0ToDma1Ch110Ena = 14U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio1PinEventRequest1ToDma1Ch111Ena = 15U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio2PinEventRequest0ToDma1Ch112Ena = 16U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio2PinEventRequest1ToDma1Ch113Ena = 17U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio3PinEventRequest0ToDma1Ch114Ena = 18U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio3PinEventRequest1ToDma1Ch115Ena = 19U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio4PinEventRequest0ToDma1Ch116Ena = 20U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio4PinEventRequest1ToDma1Ch117Ena = 21U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio5PinEventRequest0ToDma1Ch118Ena = 22U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio5PinEventRequest1ToDma1Ch119Ena = 23U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), -} inputmux_signal_t; - -/*@}*/ - -/*@}*/ - -#endif /* _FSL_INPUTMUX_CONNECTIONS_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_intm.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_intm.c deleted file mode 100644 index b62eb585b34..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_intm.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_intm.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.intm" -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -/*! - * brief Fill in the INTM config struct with the default settings - * - * The default values are: - * code - * config[0].irqnumber = NotAvail_IRQn; - * config[0].maxtimer = 1000U; - * config[1].irqnumber = NotAvail_IRQn; - * config[1].maxtimer = 1000U; - * config[2].irqnumber = NotAvail_IRQn; - * config[2].maxtimer = 1000U; - * config[3].irqnumber = NotAvail_IRQn; - * config[3].maxtimer = 1000U; - * config->enable = false; - * endcode - * param config Pointer to user's INTM config structure. - */ -void INTM_GetDefaultConfig(intm_config_t *config) -{ - assert(config); - - for (uint32_t i = 0; i < (uint32_t)FSL_FEATURE_INTM_MONITOR_COUNT; i++) - { - config->intm[i].irqnumber = NotAvail_IRQn; - config->intm[i].maxtimer = 1000U; - } - - /* INTM cycle count timer mode disable*/ - config->enable = false; -} - -/*! - * brief Ungates the INTM clock and configures the peripheral for basic operation. - * - * note This API should be called at the beginning of the application using the INTM driver. - * - * param base INTM peripheral base address - * param config Pointer to user's INTM config structure. - */ -void INTM_Init(INTM_Type *base, const intm_config_t *config) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_EnableClock(kCLOCK_Intm); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - for (uint32_t i = 0U; i < (uint32_t)FSL_FEATURE_INTM_MONITOR_COUNT; i++) - { - base->MON[i].INTM_IRQSEL = INTM_MON_INTM_IRQSEL_IRQ(config->intm[i].irqnumber); - base->MON[i].INTM_LATENCY = INTM_MON_INTM_LATENCY_LAT(config->intm[i].maxtimer); - } - - INTM_EnableCycleCount(base, config->enable); -} - -/*! - * brief Disables the INTM module. - * - * param base INTM peripheral base address - */ -void INTM_Deinit(INTM_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate the INTM clock*/ - CLOCK_DisableClock(kCLOCK_Intm); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_intm.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_intm.h deleted file mode 100644 index 7e0410b3cb0..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_intm.h +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_INTM_H_ -#define FSL_INTM_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup intm - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief INTM driver version. */ -#define FSL_INTM_DRIVER_VERSION (MAKE_VERSION(2, 0, 1)) -/*@}*/ - -/*! @brief Interrupt monitors. */ -typedef enum _intm_monitor -{ - kINTM_Monitor1 = 0U, - kINTM_Monitor2, - kINTM_Monitor3, - kINTM_Monitor4 -} intm_monitor_t; - -/*! @brief INTM interrupt source configuration structure. */ -typedef struct _intm_monitor_config -{ - uint32_t maxtimer; /*!< Set the maximum timer */ - IRQn_Type irqnumber; /*!< Select the interrupt request number to monitor. */ -} intm_monitor_config_t; - -/*! @brief INTM configuration structure. */ -typedef struct _intm_config -{ - intm_monitor_config_t intm[FSL_FEATURE_INTM_MONITOR_COUNT]; /*! Interrupt source monitor config.*/ - bool enable; /*!< enables the cycle count timer on a monitored interrupt request for comparison to the latency - register. */ -} intm_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ -/*! - * @brief Fill in the INTM config struct with the default settings - * - * The default values are: - * @code - * config[0].irqnumber = NotAvail_IRQn; - * config[0].maxtimer = 1000U; - * config[1].irqnumber = NotAvail_IRQn; - * config[1].maxtimer = 1000U; - * config[2].irqnumber = NotAvail_IRQn; - * config[2].maxtimer = 1000U; - * config[3].irqnumber = NotAvail_IRQn; - * config[3].maxtimer = 1000U; - * config->enable = false; - * @endcode - * @param config Pointer to user's INTM config structure. - */ -void INTM_GetDefaultConfig(intm_config_t *config); - -/*! - * @brief Ungates the INTM clock and configures the peripheral for basic operation. - * - * @note This API should be called at the beginning of the application using the INTM driver. - * - * @param base INTM peripheral base address - * @param config Pointer to user's INTM config structure. - */ -void INTM_Init(INTM_Type *base, const intm_config_t *config); - -/*! - * @brief Disables the INTM module. - * - * @param base INTM peripheral base address - */ -void INTM_Deinit(INTM_Type *base); - -/*! - * @brief Enable the cycle count timer mode. - * - * Monitor mode enables the cycle count timer on a monitored interrupt request for comparison to the latency register. - * - * @param base INTM peripheral base address. - * @param enable Enable the cycle count or not. - */ -static inline void INTM_EnableCycleCount(INTM_Type *base, bool enable) -{ - if (enable) - { - base->INTM_MM |= INTM_INTM_MM_MM_MASK; - } - else - { - base->INTM_MM &= ~INTM_INTM_MM_MM_MASK; - } -} - -/*! - * @brief Interrupt Acknowledge. - * - * Call this function in ISR to acknowledge interrupt. - * - * @param base INTM peripheral base address. - * @param irq Handle interrupt number. - */ -static inline void INTM_AckIrq(INTM_Type *base, IRQn_Type irq) -{ - assert(((uint32_t)irq) < (uint32_t)NUMBER_OF_INT_VECTORS); - - base->INTM_IACK = (uint32_t)irq; -} - -/*! - * @brief Interrupt Request Select. - * - * This function is used to set the interrupt request number to monitor or check. - * - * @param base INTM peripheral base address. - * @param intms Programmable interrupt monitors. - * @param irq Interrupt request number to monitor. - * - * @return Select the interrupt request number to monitor. - */ -static inline void INTM_SetInterruptRequestNumber(INTM_Type *base, intm_monitor_t intms, IRQn_Type irq) -{ - assert(((uint32_t)irq) < (uint32_t)NUMBER_OF_INT_VECTORS); - - base->MON[intms].INTM_IRQSEL = INTM_MON_INTM_IRQSEL_IRQ(irq); -} - -/*! - * @brief Set the maximum count time. - * - * This function is to set the maximum time from interrupt generation to confirmation. - * - * @param base INTM peripheral base address. - * @param intms Programmable interrupt monitors. - * @param count Timer maximum count. - */ -static inline void INTM_SetMaxTime(INTM_Type *base, intm_monitor_t intms, uint32_t count) -{ - assert((count < 0xFFFFFDU) && (count > 0U)); - - base->MON[intms].INTM_LATENCY = INTM_MON_INTM_LATENCY_LAT(count); -} - -/*! - * @brief Clear the timer period in units of count. - * - * This function is used to clear the INTM_TIMERa register. - * - * @param base INTM peripheral base address. - * @param intms Programmable interrupt monitors. - */ -static inline void INTM_ClearTimeCount(INTM_Type *base, intm_monitor_t intms) -{ - base->MON[intms].INTM_TIMER &= ~INTM_MON_INTM_TIMER_TIMER_MASK; -} - -/*! - * @brief Gets the timer period in units of count. - * - * This function is used to get the number of INTM clock cycles from interrupt request to confirmation interrupt - * processing. If this number exceeds the set maximum time, will be an error signal. - * - * @param base INTM peripheral base address. - * @param intms Programmable interrupt monitors. - */ -static inline uint32_t INTM_GetTimeCount(INTM_Type *base, intm_monitor_t intms) -{ - return base->MON[intms].INTM_TIMER; -} - -/*! - * @brief Interrupt monitor status. - * - * This function indicates whether the INTM_TIMERa value has exceeded the INTM_LATENCYa value. - * If any interrupt source in INTM_TIMERa exceeds the programmed delay value, the monitor state - * can be cleared by calling the INTM_ClearTimeCount() API to clear the corresponding INTM_TIMERa register. - * - * @param base INTM peripheral base address. - * @param intms Programmable interrupt monitors. - * - * @return Whether INTM_TIMER value has exceeded INTM_LATENCY value. - * false:INTM_TIMER value has not exceeded the INTM_LATENCY value; - * true:INTM_TIMER value has exceeded the INTM_LATENCY value. - */ -static inline bool INTM_GetStatusFlags(INTM_Type *base, intm_monitor_t intms) -{ - return ((base->MON[intms].INTM_STATUS & INTM_MON_INTM_STATUS_STATUS_MASK) != 0U); -} - -/*! @} */ -#endif /* FSL_INTM_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_irtc.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_irtc.c deleted file mode 100644 index 46b0bedb9bf..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_irtc.c +++ /dev/null @@ -1,717 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2019 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_irtc.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.irtc" -#endif - -#define IRTC_BASE_YEAR (2112U) -#define YEAR_RANGE_START (1984U) /* Valid values for year range from -128 to 127; 2112 - 128 */ -#define YEAR_RANGE_END (2239U) /* Valid values for year range from -128 to 127; 2112 + 127 */ - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Checks whether the date and time passed in is valid - * - * @param datetime Pointer to structure where the date and time details are stored - * - * @return Returns false if the date & time details are out of range; true if in range - */ -static bool IRTC_CheckDatetimeFormat(const irtc_datetime_t *datetime); - -/******************************************************************************* - * Code - ******************************************************************************/ -static bool IRTC_CheckDatetimeFormat(const irtc_datetime_t *datetime) -{ - assert(NULL != datetime); - - bool fgRet = true; - - /* Table of days in a month for a non leap year */ - uint8_t daysPerMonth[] = {0U, 31U, 28U, 31U, 30U, 31U, 30U, 31U, 31U, 30U, 31U, 30U, 31U}; - - /* Check year, month, hour, minute, seconds */ - if ((datetime->year < YEAR_RANGE_START) || (datetime->year > YEAR_RANGE_END) || (datetime->month > 12U) || - (datetime->month < 1U) || (datetime->weekDay >= 7U) || (datetime->hour >= 24U) || (datetime->minute >= 60U) || - (datetime->second >= 60U)) - { - /* If not correct then error*/ - fgRet = false; - } - else - { - /* Adjust the days in February for a leap year */ - if (((0U == (datetime->year & 3U)) && (0U != (datetime->year % 100U))) || (0U == (datetime->year % 400U))) - { - daysPerMonth[2] = 29U; - } - - /* Check the validity of the day */ - if ((datetime->day > daysPerMonth[datetime->month]) || (datetime->day < 1U)) - { - fgRet = false; - } - } - return fgRet; -} - -/*! - * brief Ungates the IRTC clock and configures the peripheral for basic operation. - * - * This function initiates a soft-reset of the IRTC module, this has not effect on DST, - * calendaring, standby time and tamper detect registers. - * - * note This API should be called at the beginning of the application using the IRTC driver. - * - * param base IRTC peripheral base address - * param config Pointer to user's IRTC config structure. - * - * return kStatus_Fail if we cannot disable register write protection - */ -status_t IRTC_Init(RTC_Type *base, const irtc_config_t *config) -{ - assert(NULL != config); - - uint16_t reg; - status_t status = kStatus_Success; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_EnableClock(kCLOCK_Rtc0); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(FSL_FEATURE_RTC_HAS_RESET) && FSL_FEATURE_RTC_HAS_RESET - RESET_PeripheralReset(kRTC_RST_SHIFT_RSTn); -#endif - - /* Unlock to allow register write operation */ - if (kStatus_Success == IRTC_SetWriteProtection(base, false)) - { - /* Issue a software reset */ - IRTC_Reset(base); - -#if !defined(FSL_FEATURE_RTC_HAS_NO_CTRL2_WAKEUP_MODE) || (!FSL_FEATURE_RTC_HAS_NO_CTRL2_WAKEUP_MODE) - /* Setup the wakeup pin select */ - if (config->wakeupSelect) - { - base->CTRL2 |= RTC_CTRL2_WAKEUP_MODE_MASK; - } - else - { - base->CTRL2 &= ~(uint16_t)RTC_CTRL2_WAKEUP_MODE_MASK; - } -#endif - /* Setup alarm match operation, sampling clock operation in standby mode, 16.384kHz RTC clock and selected clock outout to other peripherals */ - reg = base->CTRL; - reg &= ~( -#if !defined(FSL_FEATURE_RTC_HAS_NO_TIMER_STB_MASK) || (!FSL_FEATURE_RTC_HAS_NO_TIMER_STB_MASK) - (uint16_t)RTC_CTRL_TIMER_STB_MASK_MASK | -#endif -#if defined(FSL_FEATURE_RTC_HAS_CLOCK_SELECT) && FSL_FEATURE_RTC_HAS_CLOCK_SELECT - (uint16_t)RTC_CTRL_CLK_SEL_MASK | -#endif -#if defined(FSL_FEATURE_RTC_HAS_CLOCK_OUTPUT_DISABLE) && FSL_FEATURE_RTC_HAS_CLOCK_OUTPUT_DISABLE - (uint16_t)RTC_CTRL_CLKO_DIS_MASK | -#endif - (uint16_t)RTC_CTRL_ALM_MATCH_MASK); - reg |= ( -#if !defined(FSL_FEATURE_RTC_HAS_NO_TIMER_STB_MASK) || (!FSL_FEATURE_RTC_HAS_NO_TIMER_STB_MASK) - RTC_CTRL_TIMER_STB_MASK(config->timerStdMask) | -#endif -#if defined(FSL_FEATURE_RTC_HAS_CLOCK_SELECT) && FSL_FEATURE_RTC_HAS_CLOCK_SELECT - RTC_CTRL_CLK_SEL(config->clockSelect) | -#endif -#if defined(FSL_FEATURE_RTC_HAS_CLOCK_OUTPUT_DISABLE) && FSL_FEATURE_RTC_HAS_CLOCK_OUTPUT_DISABLE - RTC_CTRL_CLKO_DIS(config->disableClockOutput) | -#endif - RTC_CTRL_ALM_MATCH(config->alrmMatch)); - base->CTRL = reg; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -/*! - * brief Fill in the IRTC config struct with the default settings - * - * The default values are: - * code - * config->wakeupSelect = true; - * config->timerStdMask = false; - * config->alrmMatch = kRTC_MatchSecMinHr; - * endcode - * param config Pointer to user's IRTC config structure. - */ -void IRTC_GetDefaultConfig(irtc_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - -#if !defined(FSL_FEATURE_RTC_HAS_NO_CTRL2_WAKEUP_MODE) || (!FSL_FEATURE_RTC_HAS_NO_CTRL2_WAKEUP_MODE) - /* Tamper pin 0 is used as a wakeup/hibernation pin */ - config->wakeupSelect = true; -#endif - -#if !defined(FSL_FEATURE_RTC_HAS_NO_TIMER_STB_MASK) || (!FSL_FEATURE_RTC_HAS_NO_TIMER_STB_MASK) - /* Sampling clock are not gated when in standby mode */ - config->timerStdMask = false; -#endif - - /* Only seconds, minutes and hours are matched when generating an alarm */ - config->alrmMatch = kRTC_MatchSecMinHr; - -#if defined(FSL_FEATURE_RTC_HAS_CLOCK_SELECT) && FSL_FEATURE_RTC_HAS_CLOCK_SELECT - /* 16.384kHz clock is selected */ - config->clockSelect = kIRTC_Clk16K; -#endif - -#if defined(FSL_FEATURE_RTC_HAS_CLOCK_OUTPUT_DISABLE) && FSL_FEATURE_RTC_HAS_CLOCK_OUTPUT_DISABLE - /* The selected clock is not output to other peripherals */ - config->disableClockOutput = true; -#endif -} - -/*! - * brief Sets the IRTC date and time according to the given time structure. - * - * The IRTC counter is started after the time is set. - * - * param base IRTC peripheral base address - * param datetime Pointer to structure where the date and time details to set are stored - * - * return kStatus_Success: success in setting the time and starting the IRTC - * kStatus_InvalidArgument: failure. An error occurs because the datetime format is incorrect. - */ -status_t IRTC_SetDatetime(RTC_Type *base, const irtc_datetime_t *datetime) -{ - assert(NULL != datetime); - - status_t status = kStatus_Success; - - /* Return error if the time provided is not valid */ - if (IRTC_CheckDatetimeFormat(datetime)) - { - /* The register stores the offset in years from the base year of 2112 */ - if (datetime->year < IRTC_BASE_YEAR) - { - /* Values for years less than the base year range from -128 to 1 */ - base->YEARMON = - RTC_YEARMON_YROFST(0x100U + datetime->year - IRTC_BASE_YEAR) | RTC_YEARMON_MON_CNT(datetime->month); - } - else - { - /* Values for years greater or equal to the base year range from 0 to 127 */ - base->YEARMON = RTC_YEARMON_YROFST(datetime->year - IRTC_BASE_YEAR) | RTC_YEARMON_MON_CNT(datetime->month); - } - /* Update the Day Count and Day of the week field */ - base->DAYS = RTC_DAYS_DOW(datetime->weekDay) | RTC_DAYS_DAY_CNT(datetime->day); - - /* Update hour and minute field */ - base->HOURMIN = RTC_HOURMIN_HOUR_CNT(datetime->hour) | RTC_HOURMIN_MIN_CNT(datetime->minute); - - /* Update the seconds register */ - base->SECONDS = RTC_SECONDS_SEC_CNT(datetime->second); - } - else - { - status = kStatus_InvalidArgument; - } - - return status; -} - -/*! - * brief Gets the IRTC time and stores it in the given time structure. - * - * param base IRTC peripheral base address - * param datetime Pointer to structure where the date and time details are stored. - */ -void IRTC_GetDatetime(RTC_Type *base, irtc_datetime_t *datetime) -{ - assert(NULL != datetime); - - uint16_t temp = base->YEARMON; - - datetime->year = - (uint16_t)IRTC_BASE_YEAR + (uint16_t)((int8_t)(uint8_t)((temp >> RTC_YEARMON_YROFST_SHIFT) & 0xFFU)); - datetime->month = (uint8_t)temp & RTC_YEARMON_MON_CNT_MASK; - - temp = base->DAYS; - datetime->weekDay = (uint8_t)((temp & RTC_DAYS_DOW_MASK) >> RTC_DAYS_DOW_SHIFT); - datetime->day = (uint8_t)temp & RTC_DAYS_DAY_CNT_MASK; - - temp = base->HOURMIN; - datetime->hour = (uint8_t)((temp & RTC_HOURMIN_HOUR_CNT_MASK) >> RTC_HOURMIN_HOUR_CNT_SHIFT); - datetime->minute = (uint8_t)temp & RTC_HOURMIN_MIN_CNT_MASK; - - datetime->second = (uint8_t)(base->SECONDS) & RTC_SECONDS_SEC_CNT_MASK; -} - -/*! - * brief Sets the IRTC alarm time - * - * param base RTC peripheral base address - * param alarmTime Pointer to structure where the alarm time is stored. - * - * note weekDay field of alarmTime is not used during alarm match and should be set to 0 - * - * return kStatus_Success: success in setting the alarm - * kStatus_InvalidArgument: error in setting the alarm. Error occurs because the alarm - * datetime format is incorrect. - */ -status_t IRTC_SetAlarm(RTC_Type *base, const irtc_datetime_t *alarmTime) -{ - assert(NULL != alarmTime); - - status_t status = kStatus_Success; - - /* Return error if the alarm time provided is not valid */ - if (IRTC_CheckDatetimeFormat(alarmTime)) - { - /* Set the alarm year */ - if (alarmTime->year < IRTC_BASE_YEAR) - { - base->ALM_YEARMON = RTC_ALM_YEARMON_ALM_YEAR(0x100U + alarmTime->year - IRTC_BASE_YEAR) | - RTC_ALM_YEARMON_ALM_MON(alarmTime->month); - } - else - { - base->ALM_YEARMON = - RTC_ALM_YEARMON_ALM_YEAR(alarmTime->year - IRTC_BASE_YEAR) | RTC_ALM_YEARMON_ALM_MON(alarmTime->month); - } - - /* Set the alarm day */ - base->ALM_DAYS = RTC_ALM_DAYS_ALM_DAY(alarmTime->day); - - /* Set the alarm hour and minute */ - base->ALM_HOURMIN = RTC_ALM_HOURMIN_ALM_HOUR(alarmTime->hour) | RTC_ALM_HOURMIN_ALM_MIN(alarmTime->minute); - - /* Set the alarm seconds */ - base->ALM_SECONDS = RTC_ALM_SECONDS_ALM_SEC(alarmTime->second); - } - else - { - status = kStatus_InvalidArgument; - } - - return status; -} - -/*! - * brief Returns the IRTC alarm time. - * - * param base RTC peripheral base address - * param datetime Pointer to structure where the alarm date and time details are stored. - */ -void IRTC_GetAlarm(RTC_Type *base, irtc_datetime_t *datetime) -{ - assert(NULL != datetime); - - uint16_t temp = base->ALM_YEARMON; - - datetime->year = - (uint16_t)IRTC_BASE_YEAR + (uint16_t)((int8_t)(uint8_t)((temp >> RTC_ALM_YEARMON_ALM_YEAR_SHIFT) & 0xFFU)); - datetime->month = (uint8_t)temp & RTC_ALM_YEARMON_ALM_MON_MASK; - - datetime->day = (uint8_t)(base->ALM_DAYS) & RTC_ALM_DAYS_ALM_DAY_MASK; - - temp = base->ALM_HOURMIN; - datetime->hour = (uint8_t)((temp & RTC_ALM_HOURMIN_ALM_HOUR_MASK) >> RTC_ALM_HOURMIN_ALM_HOUR_SHIFT); - datetime->minute = (uint8_t)temp & RTC_ALM_HOURMIN_ALM_MIN_MASK; - - datetime->second = (uint8_t)(base->ALM_SECONDS) & RTC_ALM_SECONDS_ALM_SEC_MASK; -} - -/*! - * brief Locks or unlocks IRTC registers for write access. - * - * note When the registers are unlocked, they remain in unlocked state for - * 2 seconds, after which they are locked automatically. After - * power-on-reset, the registers come out unlocked and they are locked - * automatically 15 seconds after power on. - * - * param base IRTC peripheral base address - * param lock true: Lock IRTC registers; false: Unlock IRTC registers. - * - * return kStatus_Success: if lock or unlock operation is successful - * kStatus_Fail: if lock or unlock operation fails even after multiple retry attempts - */ -status_t IRTC_SetWriteProtection(RTC_Type *base, bool lock) -{ - /* Retry before giving up */ - uint8_t repeatProtectSequence = 0xFFU; - status_t status = kStatus_Success; - - if (!lock) - { - /* Unlock IRTC registers */ - while ((0U != (base->STATUS & (uint16_t)RTC_STATUS_WRITE_PROT_EN_MASK)) && (0U != repeatProtectSequence)) - { - /* Access in 8-bit mode while storing the value */ - *(__IO uint8_t *)(&base->STATUS) = 0U; - *(__IO uint8_t *)(&base->STATUS) = 0x40U; - *(__IO uint8_t *)(&base->STATUS) = 0xC0U; - *(__IO uint8_t *)(&base->STATUS) = 0x80U; - repeatProtectSequence--; - } - } - else - { - /* Lock IRTC registers */ - while ((0U == ((base->STATUS & (uint16_t)RTC_STATUS_WRITE_PROT_EN_MASK) >> RTC_STATUS_WRITE_PROT_EN_SHIFT)) && - (0U != repeatProtectSequence)) - { - *(__IO uint8_t *)(&base->STATUS) = 0x80U; - repeatProtectSequence--; - } - } - - /* Lock/unlock was not successful even after trying 256 times */ - if (0U == repeatProtectSequence) - { - status = kStatus_Fail; - } - - return status; -} - -/*! - * brief Sets the IRTC daylight savings start and stop date and time. - * - * It also enables the daylight saving bit in the IRTC control register - * - * param base IRTC peripheral base address - * param datetime Pointer to a structure where the date and time details are stored. - */ -void IRTC_SetDaylightTime(RTC_Type *base, const irtc_daylight_time_t *datetime) -{ - assert(NULL != datetime); - - /* Disable daylight saving time */ - base->CTRL &= ~(uint16_t)RTC_CTRL_DST_EN_MASK; - - /* Set the daylight saving time start month and end month value */ - base->DST_MONTH = - RTC_DST_MONTH_DST_START_MONTH(datetime->startMonth) | RTC_DST_MONTH_DST_END_MONTH(datetime->endMonth); - - /* Set the daylight saving time start day and end day value */ - base->DST_DAY = RTC_DST_DAY_DST_START_DAY(datetime->startDay) | RTC_DST_DAY_DST_END_DAY(datetime->endDay); - - /* Set the daylight saving time start hour and end hour value */ - base->DST_HOUR = RTC_DST_HOUR_DST_START_HOUR(datetime->startHour) | RTC_DST_HOUR_DST_END_HOUR(datetime->endHour); - - /* Enable daylight saving time */ - base->CTRL |= RTC_CTRL_DST_EN_MASK; -} - -/*! - * brief Gets the IRTC daylight savings time and stores it in the given time structure. - * - * param base IRTC peripheral base address - * param datetime Pointer to a structure where the date and time details are stored. - */ -void IRTC_GetDaylightTime(RTC_Type *base, irtc_daylight_time_t *datetime) -{ - assert(NULL != datetime); - - uint16_t temp = base->DST_MONTH; - - /* Get the daylight savings time start and end month value */ - datetime->startMonth = - (uint8_t)((temp & RTC_DST_MONTH_DST_START_MONTH_MASK) >> RTC_DST_MONTH_DST_START_MONTH_SHIFT); - datetime->endMonth = (uint8_t)((temp & RTC_DST_MONTH_DST_END_MONTH_MASK) >> RTC_DST_MONTH_DST_END_MONTH_SHIFT); - - /* Get the daylight savings time start and end day value */ - temp = base->DST_DAY; - datetime->startDay = (uint8_t)((temp & RTC_DST_DAY_DST_START_DAY_MASK) >> RTC_DST_DAY_DST_START_DAY_SHIFT); - datetime->endDay = (uint8_t)((temp & RTC_DST_DAY_DST_END_DAY_MASK) >> RTC_DST_DAY_DST_END_DAY_SHIFT); - - /* Get the daylight savings time start and end hour value */ - temp = base->DST_HOUR; - datetime->startHour = (uint8_t)((temp & RTC_DST_HOUR_DST_START_HOUR_MASK) >> RTC_DST_HOUR_DST_START_HOUR_SHIFT); - datetime->endHour = (uint8_t)((temp & RTC_DST_HOUR_DST_END_HOUR_MASK) >> RTC_DST_HOUR_DST_END_HOUR_SHIFT); -} - -/*! - * brief Enables the coarse compensation and sets the value in the IRTC compensation register. - * - * param base IRTC peripheral base address - * param compensationValue Compensation value is a 2's complement value. - * param compensationInterval Compensation interval. - */ -void IRTC_SetCoarseCompensation(RTC_Type *base, uint8_t compensationValue, uint8_t compensationInterval) -{ - uint16_t reg; - - /* Set the compensation value and interval */ - base->COMPEN = (uint16_t)compensationValue | ((uint16_t)compensationInterval << 8U); - - /* Disable fine and enable coarse compensation */ - reg = base->CTRL; - reg &= ~(uint16_t)RTC_CTRL_FINEEN_MASK; - reg |= RTC_CTRL_COMP_EN_MASK; - base->CTRL = reg; -} - -/*! - * brief Enables the fine compensation and sets the value in the IRTC compensation register. - * - * param base The IRTC peripheral base address - * param integralValue Compensation integral value; twos complement value of the integer part - * param fractionValue Compensation fraction value expressed as number of clock cycles of a - * fixed 4.194304Mhz clock that have to be added. - * param accumulateFractional Flag indicating if we want to add to previous fractional part; - * true: Add to previously accumulated fractional part, - * false: Start afresh and overwrite current value - */ -void IRTC_SetFineCompensation(RTC_Type *base, uint8_t integralValue, uint8_t fractionValue, bool accumulateFractional) -{ - if (!accumulateFractional) - { - /* Disable compensation to clear previous accumulated fractional part */ - base->CTRL &= ~(((uint16_t)1U << RTC_CTRL_COMP_EN_SHIFT) | ((uint16_t)1U << RTC_CTRL_FINEEN_SHIFT)); - } - - /* Set the compensation fractional and integral parts */ - base->COMPEN = ((uint16_t)fractionValue & 0x7FU) | (((uint16_t)integralValue & 0xFU) << 12U); - /* Enable fine compensation */ - base->CTRL |= (RTC_CTRL_COMP_EN_MASK | RTC_CTRL_FINEEN_MASK); -} - -#if !defined(FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) || (!FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) - -/*! - * brief This function allows configuring the four tamper inputs. - * - * The function configures the filter properties for the three external tampers. - * It also sets up active/passive and direction of the tamper bits, which are not available - * on all platforms. - * note This function programs the tamper filter parameters. The user must gate the 32K clock to - * the RTC before calling this function. It is assumed that the time and date are set after this - * and the tamper parameters do not require to be changed again later. - * - * param base The IRTC peripheral base address - * param tamperNumber The IRTC tamper input to configure - * param tamperConfig The IRTC tamper properties - */ -void IRTC_SetTamperParams(RTC_Type *base, irtc_tamper_pins_t tamperNumber, const irtc_tamper_config_t *tamperConfig) -{ - assert(NULL != tamperConfig); - - uint16_t reg = 0; - -#if defined(FSL_FEATURE_RTC_HAS_TAMPER_DIRECTION) && (FSL_FEATURE_RTC_HAS_TAMPER_DIRECTION) - reg = base->TAMPER_DIRECTION; - /* Set whether tamper pin is active or passive */ - if (tamperConfig->activePassive) - { - /* In case of active tamper, set the direction */ - reg |= (1U << tamperNumber); - if (tamperConfig->direction) - { - /* Tamper direction is output */ - reg |= (1U << (RTC_TAMPER_DIRECTION_I_O_TAMP_SHIFT + tamperNumber)); - } - else - { - /* Tamper direction is input */ - reg &= ~(1U << (RTC_TAMPER_DIRECTION_I_O_TAMP_SHIFT + tamperNumber)); - } - } - else - { - /* Passive tampers are input only and the direction bit is read only in this case */ - reg &= ~(1U << tamperNumber); - } - base->TAMPER_DIRECTION = reg; -#endif /* FSL_FEATURE_RTC_HAS_TAMPER_DIRECTION */ - - /* Set the filter properties for the external tamper pins */ - switch (tamperNumber) - { - case kIRTC_Tamper_0: - /* Set the pin for Tamper 0 */ -#if !defined(FSL_FEATURE_RTC_HAS_NO_CTRL2_WAKEUP_MODE) || (!FSL_FEATURE_RTC_HAS_NO_CTRL2_WAKEUP_MODE) - base->CTRL2 &= ~(uint16_t)RTC_CTRL2_WAKEUP_MODE_MASK; -#endif - reg = base->FILTER01_CFG; - reg &= ~((uint16_t)RTC_FILTER01_CFG_POL0_MASK | (uint16_t)RTC_FILTER01_CFG_FIL_DUR0_MASK | - (uint16_t)RTC_FILTER01_CFG_CLK_SEL0_MASK); - reg |= (RTC_FILTER01_CFG_POL0(tamperConfig->pinPolarity) | - RTC_FILTER01_CFG_FIL_DUR0(tamperConfig->filterDuration) | - RTC_FILTER01_CFG_CLK_SEL0(tamperConfig->filterClk)); - base->FILTER01_CFG = reg; - break; - case kIRTC_Tamper_1: - reg = base->FILTER01_CFG; - reg &= ~((uint16_t)RTC_FILTER01_CFG_POL1_MASK | (uint16_t)RTC_FILTER01_CFG_FIL_DUR1_MASK | - (uint16_t)RTC_FILTER01_CFG_CLK_SEL1_MASK); - reg |= (RTC_FILTER01_CFG_POL1(tamperConfig->pinPolarity) | - RTC_FILTER01_CFG_FIL_DUR1(tamperConfig->filterDuration) | - RTC_FILTER01_CFG_CLK_SEL1(tamperConfig->filterClk)); - base->FILTER01_CFG = reg; - break; -#if defined(FSL_FEATURE_RTC_HAS_FILTER23_CFG) && FSL_FEATURE_RTC_HAS_FILTER23_CFG - case kIRTC_Tamper_2: - reg = base->FILTER23_CFG; - reg &= ~((uint16_t)RTC_FILTER23_CFG_POL2_MASK | (uint16_t)RTC_FILTER23_CFG_FIL_DUR2_MASK | - (uint16_t)RTC_FILTER23_CFG_CLK_SEL2_MASK); - reg |= (RTC_FILTER23_CFG_POL2(tamperConfig->pinPolarity) | - RTC_FILTER23_CFG_FIL_DUR2(tamperConfig->filterDuration) | - RTC_FILTER23_CFG_CLK_SEL2(tamperConfig->filterClk)); - base->FILTER23_CFG = reg; - break; - case kIRTC_Tamper_3: - reg = base->FILTER23_CFG; - reg &= ~((uint16_t)RTC_FILTER23_CFG_POL3_MASK | (uint16_t)RTC_FILTER23_CFG_FIL_DUR3_MASK | - (uint16_t)RTC_FILTER23_CFG_CLK_SEL3_MASK); - reg |= (RTC_FILTER23_CFG_POL3(tamperConfig->pinPolarity) | - RTC_FILTER23_CFG_FIL_DUR3(tamperConfig->filterDuration) | - RTC_FILTER23_CFG_CLK_SEL3(tamperConfig->filterClk)); - base->FILTER23_CFG = reg; - break; -#else - case kIRTC_Tamper_2: - reg = base->FILTER2_CFG; - reg &= ~((uint16_t)RTC_FILTER2_CFG_POL2_MASK | (uint16_t)RTC_FILTER2_CFG_FIL_DUR2_MASK | - (uint16_t)RTC_FILTER2_CFG_CLK_SEL2_MASK); - reg |= (RTC_FILTER2_CFG_POL2(tamperConfig->pinPolarity) | - RTC_FILTER2_CFG_FIL_DUR2(tamperConfig->filterDuration) | - RTC_FILTER2_CFG_CLK_SEL2(tamperConfig->filterClk)); - base->FILTER2_CFG = reg; - break; -#endif - - default: - /* Internal tamper, does not have filter configuration. */ - break; - } -} - -#endif - -#if !defined(FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) || (!FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) -#if defined(FSL_FEATURE_RTC_HAS_TAMPER_QUEUE) && (FSL_FEATURE_RTC_HAS_TAMPER_QUEUE) - -/*! - * brief This function reads the tamper timestamp and returns the associated tamper pin. - * - * The tamper timestamp has month, day, hour, minutes, and seconds. Ignore the year field as this - * information is not available in the tamper queue. The user should look at the RTC_YEARMON register - * for this because the expectation is that the queue is read at least once a year. - * Return the tamper pin number associated with the timestamp. - * - * param base The IRTC peripheral base address - * param tamperTimestamp The tamper timestamp - * - * return The tamper pin number - */ -uint8_t IRTC_ReadTamperQueue(RTC_Type *base, irtc_datetime_t *tamperTimestamp) -{ - assert(NULL != tamperTimestamp); - - /* Read the register 2 times to get a entry*/ - uint16_t temp1 = base->TAMPER_QUEUE; - uint16_t temp2 = base->TAMPER_QUEUE; - uint8_t tamperNum; - - /* - * Tamper queue does not store the year field as this value can be read from RTC_YEARMON. - * It is expected that the queue will be read at least once in a year. - */ - tamperTimestamp->year = 0; - /* From the first read; TAMPER_DATA[4:0] is the hour field */ - tamperTimestamp->hour = (uint8_t)temp1 & 0x1FU; - /* From the first read; TAMPER_DATA[9:5] is the day field */ - tamperTimestamp->day = (uint8_t)(temp1 >> 5U) & 0x1FU; - /* From the first read; TAMPER_DATA[13:10] is the month field */ - tamperTimestamp->month = (uint8_t)(temp1 >> 10U) & 0xFU; - - /* From the second read; TAMPER_DATA[5:0] is the seconds field */ - tamperTimestamp->second = (uint8_t)temp2 & 0x3FU; - /* From the second read; TAMPER_DATA[11:6] is the minutes field */ - tamperTimestamp->minute = (uint8_t)(temp2 >> 6U) & 0x3FU; - /* From the second read; TAMPER_DATA[14:12] is the tamper index */ - tamperNum = (uint8_t)(temp2 >> 12U) & 0x7U; - - return tamperNum; -} - -#endif /* FSL_FEATURE_RTC_HAS_TAMPER_QUEUE */ -#endif /* FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE */ - -/*! - * brief Select which clock to output from RTC. - * - * Select which clock to output from RTC for other modules to use inside SoC, for example, - * RTC subsystem needs RTC to output 1HZ clock for sub-second counter. - * - * param base IRTC peripheral base address - * param cloOut select clock to use for output - */ -void IRTC_ConfigClockOut(RTC_Type *base, irtc_clockout_sel_t clkOut) -{ - uint16_t ctrlVal = base->CTRL; - - ctrlVal &= (uint16_t)(~RTC_CTRL_CLKOUT_MASK); - - ctrlVal |= RTC_CTRL_CLKOUT((uint16_t)clkOut); - if (clkOut == kIRTC_ClkoutCoarse1Hz) - { - ctrlVal |= RTC_CTRL_COMP_EN_MASK; - } - else if (clkOut == kIRTC_ClkoutFine1Hz) - { - ctrlVal |= RTC_CTRL_FINEEN_MASK; - } - else - { - /* empty else */ - } - - base->CTRL = ctrlVal; -} - -#if defined(FSL_FEATURE_RTC_HAS_CLOCK_SELECT) && FSL_FEATURE_RTC_HAS_CLOCK_SELECT - -/*! - * brief Select which clock is used by RTC. - * - * Select which clock is used by RTC to output to the peripheral - * and divided to generate a 512 Hz clock and a 1 Hz clock. - * - * param base IRTC peripheral base address - * param clkSelect select clock used by RTC - */ -void IRTC_ConfigClockSelect(RTC_Type *base, irtc_clock_select_t clkSelect) -{ - uint16_t ctrlVal = base->CTRL; - - ctrlVal &= (uint16_t)(~RTC_CTRL_CLK_SEL_MASK); - - ctrlVal |= RTC_CTRL_CLK_SEL((uint16_t)clkSelect); - - base->CTRL = ctrlVal; -} - -#endif /* FSL_FEATURE_RTC_HAS_CLOCK_SELECT */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_irtc.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_irtc.h deleted file mode 100644 index 98f78be1853..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_irtc.h +++ /dev/null @@ -1,852 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2019, 2022-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_IRTC_H_ -#define FSL_IRTC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup irtc - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -#define FSL_IRTC_DRIVER_VERSION (MAKE_VERSION(2, 2, 4)) /*!< Version. */ -/*@}*/ - -#if defined(FSL_FEATURE_RTC_HAS_CLOCK_SELECT) && FSL_FEATURE_RTC_HAS_CLOCK_SELECT -/*! @brief IRTC clock select. */ -typedef enum _irtc_clock_select -{ - kIRTC_Clk16K = 0x0U, /*!< 16.384 kHz clock is selected.*/ - kIRTC_Clk32K = 0x1U, /*!< 32.768 kHz clock is selected.*/ -} irtc_clock_select_t; -#endif - -#if !defined(FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) || (!FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) -/*! @brief IRTC filter clock source options. */ -typedef enum _irtc_filter_clock_source -{ - kIRTC_32K = 0x0U, /*!< Use 32 kHz clock source for the tamper filter.*/ - kIRTC_512 = 0x1U, /*!< Use 512 Hz clock source for the tamper filter.*/ - kIRTC_128 = 0x2U, /*!< Use 128 Hz clock source for the tamper filter.*/ - kIRTC_64 = 0x3U, /*!< Use 64 Hz clock source for the tamper filter.*/ - kIRTC_16 = 0x4U, /*!< Use 16 Hz clock source for the tamper filter.*/ - kIRTC_8 = 0x5U, /*!< Use 8 Hz clock source for the tamper filter.*/ - kIRTC_4 = 0x6U, /*!< Use 4 Hz clock source for the tamper filter.*/ - kIRTC_2 = 0x7U /*!< Use 2 Hz clock source for the tamper filter.*/ -} irtc_filter_clock_source_t; - -/*! @brief IRTC Tamper pins. */ -typedef enum _irtc_tamper_pins -{ - kIRTC_Tamper_0 = 0U, /*!< External Tamper 0 */ - kIRTC_Tamper_1, /*!< External Tamper 1 */ - kIRTC_Tamper_2, /*!< External Tamper 2 */ - kIRTC_Tamper_3 /*!< Internal tamper, does not have filter configuration */ -} irtc_tamper_pins_t; -#endif - -/*! @brief List of IRTC interrupts */ -typedef enum _irtc_interrupt_enable -{ -#if !defined(FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) || (!FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) - kIRTC_TamperInterruptEnable = RTC_IER_TAMPER_IE_MASK, /*!< Tamper Interrupt Enable */ -#endif - kIRTC_AlarmInterruptEnable = RTC_IER_ALM_IE_MASK, /*!< Alarm Interrupt Enable */ - kIRTC_DayInterruptEnable = RTC_IER_DAY_IE_MASK, /*!< Days Interrupt Enable */ - kIRTC_HourInterruptEnable = RTC_IER_HOUR_IE_MASK, /*!< Hours Interrupt Enable */ - kIRTC_MinInterruptEnable = RTC_IER_MIN_IE_MASK, /*!< Minutes Interrupt Enable */ - kIRTC_1hzInterruptEnable = RTC_IER_IE_1HZ_MASK, /*!< 1 Hz interval Interrupt Enable */ - kIRTC_2hzInterruptEnable = RTC_IER_IE_2HZ_MASK, /*!< 2 Hz interval Interrupt Enable */ - kIRTC_4hzInterruptEnable = RTC_IER_IE_4HZ_MASK, /*!< 4 Hz interval Interrupt Enable */ - kIRTC_8hzInterruptEnable = RTC_IER_IE_8HZ_MASK, /*!< 8 Hz interval Interrupt Enable */ - kIRTC_16hzInterruptEnable = RTC_IER_IE_16HZ_MASK, /*!< 16 Hz interval Interrupt Enable */ - kIRTC_32hzInterruptEnable = RTC_IER_IE_32HZ_MASK, /*!< 32 Hz interval Interrupt Enable */ - kIRTC_64hzInterruptEnable = RTC_IER_IE_64HZ_MASK, /*!< 64 Hz interval Interrupt Enable */ - kIRTC_128hzInterruptEnable = RTC_IER_IE_128HZ_MASK, /*!< 128 Hz interval Interrupt Enable */ - kIRTC_256hzInterruptEnable = RTC_IER_IE_256HZ_MASK, /*!< 256 Hz interval Interrupt Enable */ - kIRTC_512hzInterruptEnable = RTC_IER_IE_512HZ_MASK, /*!< 512 Hz interval Interrupt Enable */ -#if defined(FSL_FEATURE_RTC_HAS_SUBSYSTEM) && FSL_FEATURE_RTC_HAS_SUBSYSTEM - kIRTC_WakeTimerInterruptEnable = (RTC_WAKE_TIMER_CTRL_INTR_EN_MASK << 16U), /*!< Wake timer Interrupt Enable */ -#endif -#if defined(FSL_FEATURE_RTC_HAS_TAMPER_QUEUE) && FSL_FEATURE_RTC_HAS_TAMPER_QUEUE - kIRTC_TamperQueueFullInterruptEnable = - (RTC_TAMPER_QSCR_Q_FULL_INT_EN_MASK << 24U), /*!< Tamper queue full Interrupt Enable */ -#endif -} irtc_interrupt_enable_t; - -/*! @brief List of IRTC flags */ -typedef enum _irtc_status_flags -{ -#if !defined(FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) || (!FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) - kIRTC_TamperFlag = RTC_ISR_TAMPER_IS_MASK, /*!< Tamper Status flag*/ -#endif - kIRTC_AlarmFlag = RTC_ISR_ALM_IS_MASK, /*!< Alarm Status flag */ - kIRTC_DayFlag = RTC_ISR_DAY_IS_MASK, /*!< Days Status flag */ - kIRTC_HourFlag = RTC_ISR_HOUR_IS_MASK, /*!< Hour Status flag */ - kIRTC_MinFlag = RTC_ISR_MIN_IS_MASK, /*!< Minutes Status flag */ - kIRTC_1hzFlag = RTC_ISR_IS_1HZ_MASK, /*!< 1 Hz interval status flag */ - kIRTC_2hzFlag = RTC_ISR_IS_2HZ_MASK, /*!< 2 Hz interval status flag*/ - kIRTC_4hzFlag = RTC_ISR_IS_4HZ_MASK, /*!< 4 Hz interval status flag*/ - kIRTC_8hzFlag = RTC_ISR_IS_8HZ_MASK, /*!< 8 Hz interval status flag*/ - kIRTC_16hzFlag = RTC_ISR_IS_16HZ_MASK, /*!< 16 Hz interval status flag*/ - kIRTC_32hzFlag = RTC_ISR_IS_32HZ_MASK, /*!< 32 Hz interval status flag*/ - kIRTC_64hzFlag = RTC_ISR_IS_64HZ_MASK, /*!< 64 Hz interval status flag*/ - kIRTC_128hzFlag = RTC_ISR_IS_128HZ_MASK, /*!< 128 Hz interval status flag*/ - kIRTC_256hzFlag = RTC_ISR_IS_256HZ_MASK, /*!< 256 Hz interval status flag*/ - kIRTC_512hzFlag = RTC_ISR_IS_512HZ_MASK, /*!< 512 Hz interval status flag*/ - kIRTC_InvalidFlag = (RTC_STATUS_INVAL_BIT_MASK << 16U), /*!< Indicates if time/date counters are invalid */ - kIRTC_WriteProtFlag = (RTC_STATUS_WRITE_PROT_EN_MASK << 16U), /*!< Write protect enable status flag */ -#if !defined(FSL_FEATURE_RTC_HAS_NO_CPU_LOW_VOLT_FLAG) || (!FSL_FEATURE_RTC_HAS_NO_CPU_LOW_VOLT_FLAG) - kIRTC_CpuLowVoltFlag = (RTC_STATUS_CPU_LOW_VOLT_MASK << 16U), /*!< CPU low voltage warning flag */ -#endif -#if !defined(FSL_FEATURE_RTC_HAS_NO_RST_SRC_FLAG) || (!FSL_FEATURE_RTC_HAS_NO_RST_SRC_FLAG) - kIRTC_ResetSrcFlag = (RTC_STATUS_RST_SRC_MASK << 16U), /*!< Reset source flag */ -#endif - kIRTC_CmpIntFlag = (RTC_STATUS_CMP_INT_MASK << 16U), /*!< Compensation interval status flag */ - kIRTC_BusErrFlag = (RTC_STATUS_BUS_ERR_MASK << 16U), /*!< Bus error flag */ - kIRTC_CmpDoneFlag = (RTC_STATUS_CMP_DONE_MASK << 16U), /*!< Compensation done flag */ -#if defined(FSL_FEATURE_RTC_HAS_SUBSYSTEM) && FSL_FEATURE_RTC_HAS_SUBSYSTEM - kIRTC_WakeTimerFlag = (RTC_WAKE_TIMER_CTRL_WAKE_FLAG_MASK << 28U) /*!< Wake timer status flag */ -#endif -} irtc_status_flags_t; - -/*! @brief IRTC alarm match options */ -typedef enum _irtc_alarm_match -{ - kRTC_MatchSecMinHr = 0U, /*!< Only match second, minute and hour */ - kRTC_MatchSecMinHrDay = 1U, /*!< Only match second, minute, hour and day */ - kRTC_MatchSecMinHrDayMnth = 2U, /*!< Only match second, minute, hour, day and month */ - kRTC_MatchSecMinHrDayMnthYr = 3U /*!< Only match second, minute, hour, day, month and year */ -} irtc_alarm_match_t; - -#if !defined(FSL_FEATURE_RTC_HAS_NO_GP_DATA_REG) || (!FSL_FEATURE_RTC_HAS_NO_GP_DATA_REG) -/*! @brief List of RTC Oscillator capacitor load settings */ -typedef enum _irtc_osc_cap_load -{ - kIRTC_Capacitor2p = (1U << 1U), /*!< 2pF capacitor load */ - kIRTC_Capacitor4p = (1U << 2U), /*!< 4pF capacitor load */ - kIRTC_Capacitor8p = (1U << 3U), /*!< 8pF capacitor load */ - kIRTC_Capacitor16p = (1U << 4U) /*!< 16pF capacitor load */ -} irtc_osc_cap_load_t; -#endif - -/*! @brief IRTC clockout select. */ -typedef enum _irtc_clockout_sel -{ - kIRTC_ClkoutNo = 0U, /*!< No clock out */ - kIRTC_ClkoutFine1Hz, /*!< clock out fine 1Hz */ - kIRTC_Clkout32kHz, /*!< clock out 32.768kHz */ - kIRTC_ClkoutCoarse1Hz /*!< clock out coarse 1Hz */ -} irtc_clockout_sel_t; - -/*! @brief Structure is used to hold the date and time */ -typedef struct _irtc_datetime -{ - uint16_t year; /*!< Range from 1984 to 2239.*/ - uint8_t month; /*!< Range from 1 to 12.*/ - uint8_t day; /*!< Range from 1 to 31 (depending on month).*/ - uint8_t weekDay; /*!< Range from 0(Sunday) to 6(Saturday). */ - uint8_t hour; /*!< Range from 0 to 23.*/ - uint8_t minute; /*!< Range from 0 to 59.*/ - uint8_t second; /*!< Range from 0 to 59.*/ -} irtc_datetime_t; - -/*! @brief Structure is used to hold the daylight saving time */ -typedef struct _irtc_daylight_time -{ - uint8_t startMonth; /*!< Range from 1 to 12 */ - uint8_t endMonth; /*!< Range from 1 to 12 */ - uint8_t startDay; /*!< Range from 1 to 31 (depending on month) */ - uint8_t endDay; /*!< Range from 1 to 31 (depending on month) */ - uint8_t startHour; /*!< Range from 0 to 23 */ - uint8_t endHour; /*!< Range from 0 to 23 */ -} irtc_daylight_time_t; - -#if !defined(FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) || (!FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) -/*! @brief Structure is used to define the parameters to configure a RTC tamper event. */ -typedef struct _irtc_tamper_config -{ -#if FSL_FEATURE_RTC_HAS_TAMPER_DIRECTION - bool activePassive; /*!< true: configure tamper as active; false: passive tamper */ - bool direction; /*!< true: configure tamper direction as output; false: configure as input; - this is only used if a tamper pin is defined as active */ -#endif - bool pinPolarity; /*!< true: tamper has active low polarity; - false: active high polarity */ - irtc_filter_clock_source_t filterClk; /*!< Clock source for the tamper filter */ - uint8_t filterDuration; /*!< Tamper filter duration.*/ -} irtc_tamper_config_t; -#endif - -/*! - * @brief RTC config structure - * - * This structure holds the configuration settings for the RTC peripheral. To initialize this - * structure to reasonable defaults, call the IRTC_GetDefaultConfig() function and pass a - * pointer to your config structure instance. - * - * The config struct can be made const so it resides in flash - */ -typedef struct _irtc_config -{ -#if !defined(FSL_FEATURE_RTC_HAS_NO_CTRL2_WAKEUP_MODE) || (!FSL_FEATURE_RTC_HAS_NO_CTRL2_WAKEUP_MODE) - bool wakeupSelect; /*!< true: Tamper pin 0 is used to wakeup the chip; - false: Tamper pin 0 is used as the tamper pin */ -#endif -#if !defined(FSL_FEATURE_RTC_HAS_NO_TIMER_STB_MASK) || (!FSL_FEATURE_RTC_HAS_NO_TIMER_STB_MASK) - bool timerStdMask; /*!< true: Sampling clocks gated in standby mode; - false: Sampling clocks not gated */ -#endif - irtc_alarm_match_t alrmMatch; /*!< Pick one option from enumeration :: irtc_alarm_match_t */ -#if defined(FSL_FEATURE_RTC_HAS_CLOCK_SELECT) && FSL_FEATURE_RTC_HAS_CLOCK_SELECT - irtc_clock_select_t clockSelect; /*!< Pick one option from enumeration :: irtc_clock_select_t */ -#endif -#if defined(FSL_FEATURE_RTC_HAS_CLOCK_OUTPUT_DISABLE) && FSL_FEATURE_RTC_HAS_CLOCK_OUTPUT_DISABLE - bool disableClockOutput; /*!< true: The selected clock is not output to other peripherals; - false: The selected clock is output to other peripherals */ -#endif -} irtc_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Ungates the IRTC clock and configures the peripheral for basic operation. - * - * This function initiates a soft-reset of the IRTC module, this has not effect on DST, - * calendaring, standby time and tamper detect registers. - * - * @note This API should be called at the beginning of the application using the IRTC driver. - * - * @param base IRTC peripheral base address - * @param config Pointer to user's IRTC config structure. - * - * @return kStatus_Fail if we cannot disable register write protection - */ -status_t IRTC_Init(RTC_Type *base, const irtc_config_t *config); - -/*! - * @brief Gate the IRTC clock - * - * @param base IRTC peripheral base address - */ -static inline void IRTC_Deinit(RTC_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_DisableClock(kCLOCK_Rtc0); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * @brief Fill in the IRTC config struct with the default settings - * - * The default values are: - * @code - * config->wakeupSelect = true; - * config->timerStdMask = false; - * config->alrmMatch = kRTC_MatchSecMinHr; - * @endcode - * @param config Pointer to user's IRTC config structure. - */ -void IRTC_GetDefaultConfig(irtc_config_t *config); - -/*! @}*/ - -/*! - * @name Current Time & Alarm - * @{ - */ - -/*! - * @brief Sets the IRTC date and time according to the given time structure. - * - * The IRTC counter is started after the time is set. - * - * @param base IRTC peripheral base address - * @param datetime Pointer to structure where the date and time details to set are stored - * - * @return kStatus_Success: success in setting the time and starting the IRTC - * kStatus_InvalidArgument: failure. An error occurs because the datetime format is incorrect. - */ -status_t IRTC_SetDatetime(RTC_Type *base, const irtc_datetime_t *datetime); - -/*! - * @brief Gets the IRTC time and stores it in the given time structure. - * - * @param base IRTC peripheral base address - * @param datetime Pointer to structure where the date and time details are stored. - */ -void IRTC_GetDatetime(RTC_Type *base, irtc_datetime_t *datetime); - -/*! - * @brief Sets the IRTC alarm time - * - * @param base RTC peripheral base address - * @param alarmTime Pointer to structure where the alarm time is stored. - * - * @note weekDay field of alarmTime is not used during alarm match and should be set to 0 - * - * @return kStatus_Success: success in setting the alarm - * kStatus_InvalidArgument: error in setting the alarm. Error occurs because the alarm - * datetime format is incorrect. - */ -status_t IRTC_SetAlarm(RTC_Type *base, const irtc_datetime_t *alarmTime); - -/*! - * @brief Returns the IRTC alarm time. - * - * @param base RTC peripheral base address - * @param datetime Pointer to structure where the alarm date and time details are stored. - */ -void IRTC_GetAlarm(RTC_Type *base, irtc_datetime_t *datetime); -/*! @}*/ - -/*! - * @name Interrupt Interface - * @{ - */ - -/*! - * @brief Enables the selected IRTC interrupts. - * - * @param base IRTC peripheral base address - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::irtc_interrupt_enable_t - */ -static inline void IRTC_EnableInterrupts(RTC_Type *base, uint32_t mask) -{ - base->IER |= (uint16_t)mask; -#if defined(FSL_FEATURE_RTC_HAS_SUBSYSTEM) && FSL_FEATURE_RTC_HAS_SUBSYSTEM - if (0U != (mask & (uint32_t)kIRTC_WakeTimerInterruptEnable)) - { - base->WAKE_TIMER_CTRL |= RTC_WAKE_TIMER_CTRL_INTR_EN_MASK; - } -#endif -#if !defined(FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) || (!FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) -#if defined(FSL_FEATURE_RTC_HAS_TAMPER_QUEUE) && (FSL_FEATURE_RTC_HAS_TAMPER_QUEUE) - if (0U != (mask & (uint32_t)kIRTC_TamperQueueFullInterruptEnable)) - { - base->TAMPER_QSCR |= RTC_TAMPER_QSCR_Q_FULL_INT_EN_MASK; - } -#endif -#endif -} - -/*! - * @brief Disables the selected IRTC interrupts. - * - * @param base IRTC peripheral base address - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::irtc_interrupt_enable_t - */ -static inline void IRTC_DisableInterrupts(RTC_Type *base, uint32_t mask) -{ - base->IER &= ~(uint16_t)mask; -#if defined(FSL_FEATURE_RTC_HAS_SUBSYSTEM) && FSL_FEATURE_RTC_HAS_SUBSYSTEM - if (0U != (mask & (uint32_t)kIRTC_WakeTimerInterruptEnable)) - { - base->WAKE_TIMER_CTRL &= ~(uint16_t)RTC_WAKE_TIMER_CTRL_INTR_EN_MASK; - } -#endif -#if !defined(FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) || (!FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) -#if defined(FSL_FEATURE_RTC_HAS_TAMPER_QUEUE) && (FSL_FEATURE_RTC_HAS_TAMPER_QUEUE) - if (0U != (mask & (uint32_t)kIRTC_TamperQueueFullInterruptEnable)) - { - base->TAMPER_QSCR &= ~(uint16_t)RTC_TAMPER_QSCR_Q_FULL_INT_EN_MASK; - } -#endif -#endif -} - -/*! - * @brief Gets the enabled IRTC interrupts. - * - * @param base IRTC peripheral base address - * - * @return The enabled interrupts. This is the logical OR of members of the - * enumeration ::irtc_interrupt_enable_t - */ -static inline uint32_t IRTC_GetEnabledInterrupts(RTC_Type *base) -{ - uint32_t intsEnabled = base->IER; -#if defined(FSL_FEATURE_RTC_HAS_SUBSYSTEM) && FSL_FEATURE_RTC_HAS_SUBSYSTEM - intsEnabled |= (base->WAKE_TIMER_CTRL & (uint32_t)RTC_WAKE_TIMER_CTRL_INTR_EN_MASK) << 16U; -#endif -#if !defined(FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) || (!FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) -#if defined(FSL_FEATURE_RTC_HAS_TAMPER_QUEUE) && (FSL_FEATURE_RTC_HAS_TAMPER_QUEUE) - intsEnabled |= (base->TAMPER_QSCR & (uint32_t)RTC_TAMPER_QSCR_Q_FULL_INT_EN_MASK) << 24U; -#endif -#endif - - return intsEnabled; -} - -/*! @}*/ - -/*! - * @name Status Interface - * @{ - */ - -/*! - * @brief Gets the IRTC status flags - * - * @param base IRTC peripheral base address - * - * @return The status flags. This is the logical OR of members of the - * enumeration ::irtc_status_flags_t - */ -static inline uint32_t IRTC_GetStatusFlags(RTC_Type *base) -{ -#if defined(FSL_FEATURE_RTC_HAS_SUBSYSTEM) && FSL_FEATURE_RTC_HAS_SUBSYSTEM - return (base->ISR | ((uint32_t)base->STATUS << 16U) | ((uint32_t)base->WAKE_TIMER_CTRL << 28U)); -#else - return (base->ISR | ((uint32_t)base->STATUS << 16U)); -#endif -} - -/*! - * @brief Clears the IRTC status flags. - * - * @param base IRTC peripheral base address - * @param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::irtc_status_flags_t - */ -static inline void IRTC_ClearStatusFlags(RTC_Type *base, uint32_t mask) -{ - base->ISR = (uint16_t)mask; - base->STATUS = (base->STATUS & ~((uint16_t)RTC_STATUS_BUS_ERR_MASK | (uint16_t)RTC_STATUS_CMP_DONE_MASK)) | - ((uint16_t)(mask >> 16U)); -#if !defined(FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) || (!FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) - /* TAMPER flag need clear TAMPER_SCR[TMPR_STS] filed */ - if (0U != (mask & (uint32_t)kIRTC_TamperFlag)) - { - base->TAMPER_SCR |= RTC_TAMPER_SCR_TMPR_STS_MASK; - } -#endif -#if defined(FSL_FEATURE_RTC_HAS_SUBSYSTEM) && FSL_FEATURE_RTC_HAS_SUBSYSTEM - if (0U != (mask & (uint32_t)kIRTC_WakeTimerFlag)) - { - base->WAKE_TIMER_CTRL |= RTC_WAKE_TIMER_CTRL_WAKE_FLAG_MASK; - } -#endif -} - -/*! @}*/ - -#if !defined(FSL_FEATURE_RTC_HAS_NO_GP_DATA_REG) || (!FSL_FEATURE_RTC_HAS_NO_GP_DATA_REG) - -/*! - * @brief This function sets the specified capacitor configuration for the RTC oscillator. - * - * @param base IRTC peripheral base address - * @param capLoad Oscillator loads to enable. This is a logical OR of members of the - * enumeration ::irtc_osc_cap_load_t - */ -static inline void IRTC_SetOscCapLoad(RTC_Type *base, uint16_t capLoad) -{ - uint16_t reg = base->GP_DATA_REG; - - reg &= ~((uint16_t)kIRTC_Capacitor2p | (uint16_t)kIRTC_Capacitor4p | (uint16_t)kIRTC_Capacitor8p | - (uint16_t)kIRTC_Capacitor16p); - reg |= capLoad; - - base->GP_DATA_REG = reg; -} - -#endif - -/*! - * @brief Locks or unlocks IRTC registers for write access. - * - * @note When the registers are unlocked, they remain in unlocked state for - * 2 seconds, after which they are locked automatically. After - * power-on-reset, the registers come out unlocked and they are locked - * automatically 15 seconds after power on. - * - * @param base IRTC peripheral base address - * @param lock true: Lock IRTC registers; false: Unlock IRTC registers. - * - * @return kStatus_Success: if lock or unlock operation is successful - * kStatus_Fail: if lock or unlock operation fails even after multiple retry attempts - */ -status_t IRTC_SetWriteProtection(RTC_Type *base, bool lock); - -/*! - * @brief Performs a software reset on the IRTC module. - * - * Clears contents of alarm, interrupt (status and enable except tamper interrupt enable bit) - * registers, STATUS[CMP_DONE] and STATUS[BUS_ERR]. This has no effect on DST, calendaring, standby time - * and tamper detect registers. - * - * @param base IRTC peripheral base address - */ -static inline void IRTC_Reset(RTC_Type *base) -{ - base->CTRL |= RTC_CTRL_SWR_MASK; -} - -#if !defined(FSL_FEATURE_RTC_HAS_NO_GP_DATA_REG) || (!FSL_FEATURE_RTC_HAS_NO_GP_DATA_REG) - -/*! - * @brief Enable/disable 32 kHz RTC OSC clock during RTC register write - * - * @param base IRTC peripheral base address - * @param enable Enable/disable 32 kHz RTC OSC clock. - * - true: Enables the oscillator. - * - false: Disables the oscillator. - * - */ -static inline void IRTC_Enable32kClkDuringRegisterWrite(RTC_Type *base, bool enable) -{ - uint16_t mask = RTC_GP_DATA_REG_CFG0_MASK; - if (enable) - { - base->GP_DATA_REG &= ~mask; - } - else - { - base->GP_DATA_REG |= mask; - } -} - -#endif - -/*! - * @brief Select which clock to output from RTC. - * - * Select which clock to output from RTC for other modules to use inside SoC, for example, - * RTC subsystem needs RTC to output 1HZ clock for sub-second counter. - * - * @param base IRTC peripheral base address - * @param cloOut select clock to use for output, - */ -void IRTC_ConfigClockOut(RTC_Type *base, irtc_clockout_sel_t clkOut); - -#if defined(FSL_FEATURE_RTC_HAS_CLOCK_SELECT) && FSL_FEATURE_RTC_HAS_CLOCK_SELECT - -/*! - * @brief Select which clock is used by RTC. - * - * Select which clock is used by RTC to output to the peripheral - * and divided to generate a 512 Hz clock and a 1 Hz clock. - * - * @param base IRTC peripheral base address - * @param clkSelect select clock used by RTC - */ -void IRTC_ConfigClockSelect(RTC_Type *base, irtc_clock_select_t clkSelect); - -#endif /* FSL_FEATURE_RTC_HAS_CLOCK_SELECT */ - -#if defined(FSL_FEATURE_RTC_HAS_CLOCK_OUTPUT_DISABLE) && FSL_FEATURE_RTC_HAS_CLOCK_OUTPUT_DISABLE - -/*! - * @brief Determines whether the selected clock is output to other peripherals. - * - * Determines whether the selected clock is output to other peripherals. - * - * @param base IRTC peripheral base address - * @param enable determine whether the selected clock is output to other peripherals - */ -static inline void IRTC_EnableClockOutputToPeripheral(RTC_Type *base, bool enable) -{ - if (enable) - { - base->CTRL &= ~(uint16_t)RTC_CTRL_CLKO_DIS_MASK; - } - else - { - base->CTRL |= RTC_CTRL_CLKO_DIS_MASK; - } -} - -#endif /* FSL_FEATURE_RTC_HAS_CLOCK_OUTPUT_DISABLE */ - -#if !defined(FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) || (!FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) - -/*! - * @brief Gets the IRTC Tamper status flags - * - * @param base IRTC peripheral base address - * - * @return The Tamper status value. - */ -static inline uint8_t IRTC_GetTamperStatusFlag(RTC_Type *base) -{ - return (uint8_t)((base->TAMPER_SCR & RTC_TAMPER_SCR_TMPR_STS_MASK) >> RTC_TAMPER_SCR_TMPR_STS_SHIFT); -} - -/*! - * @brief Gets the IRTC Tamper status flags - * - * @param base IRTC peripheral base address - * - */ -static inline void IRTC_ClearTamperStatusFlag(RTC_Type *base) -{ - /* Writing '1' to this field clears the tamper status.*/ - base->TAMPER_SCR |= RTC_TAMPER_SCR_TMPR_STS_MASK; -} - -/*! - * @brief Set tamper configuration over - * - * Note that this API is neeeded after call IRTC_SetTamperParams to configure tamper events to - * notify IRTC module that tamper configuration process is over. - * - * @param base IRTC peripheral base address - * - */ -static inline void IRTC_SetTamperConfigurationOver(RTC_Type *base) -{ - /* Set tamper configuration over.*/ - base->CTRL2 |= RTC_CTRL2_TAMP_CFG_OVER_MASK; -} - -#endif - -/*! - * @name Daylight Savings Interface - * @{ - */ - -/*! - * @brief Sets the IRTC daylight savings start and stop date and time. - * - * It also enables the daylight saving bit in the IRTC control register - * - * @param base IRTC peripheral base address - * @param datetime Pointer to a structure where the date and time details are stored. - */ -void IRTC_SetDaylightTime(RTC_Type *base, const irtc_daylight_time_t *datetime); - -/*! - * @brief Gets the IRTC daylight savings time and stores it in the given time structure. - * - * @param base IRTC peripheral base address - * @param datetime Pointer to a structure where the date and time details are stored. - */ -void IRTC_GetDaylightTime(RTC_Type *base, irtc_daylight_time_t *datetime); - -/*! @}*/ - -/*! - * @name Time Compensation Interface - * @{ - */ - -/*! - * @brief Enables the coarse compensation and sets the value in the IRTC compensation register. - * - * @param base IRTC peripheral base address - * @param compensationValue Compensation value is a 2's complement value. - * @param compensationInterval Compensation interval. - */ -void IRTC_SetCoarseCompensation(RTC_Type *base, uint8_t compensationValue, uint8_t compensationInterval); - -/*! - * @brief Enables the fine compensation and sets the value in the IRTC compensation register. - * - * @param base The IRTC peripheral base address - * @param integralValue Compensation integral value; twos complement value of the integer part - * @param fractionValue Compensation fraction value expressed as number of clock cycles of a - * fixed 4.194304Mhz clock that have to be added. - * @param accumulateFractional Flag indicating if we want to add to previous fractional part; - * true: Add to previously accumulated fractional part, - * false: Start afresh and overwrite current value - */ -void IRTC_SetFineCompensation(RTC_Type *base, uint8_t integralValue, uint8_t fractionValue, bool accumulateFractional); - -/*! @}*/ - -#if !defined(FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) || (!FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) - -/*! - * @name Tamper Interface - * @{ - */ - -/*! - * @brief This function allows configuring the four tamper inputs. - * - * The function configures the filter properties for the three external tampers. - * It also sets up active/passive and direction of the tamper bits, which are not available - * on all platforms. - * @note This function programs the tamper filter parameters. The user must gate the 32K clock to - * the RTC before calling this function. It is assumed that the time and date are set after this - * and the tamper parameters do not require to be changed again later. - * - * @param base The IRTC peripheral base address - * @param tamperNumber The IRTC tamper input to configure - * @param tamperConfig The IRTC tamper properties - */ -void IRTC_SetTamperParams(RTC_Type *base, irtc_tamper_pins_t tamperNumber, const irtc_tamper_config_t *tamperConfig); - -#if defined(FSL_FEATURE_RTC_HAS_TAMPER_QUEUE) && (FSL_FEATURE_RTC_HAS_TAMPER_QUEUE) - -/*! - * @brief This function reads the tamper timestamp and returns the associated tamper pin. - * - * The tamper timestamp has month, day, hour, minutes, and seconds. Ignore the year field as this - * information is not available in the tamper queue. The user should look at the RTC_YEARMON register - * for this because the expectation is that the queue is read at least once a year. - * Return the tamper pin number associated with the timestamp. - * - * @param base The IRTC peripheral base address - * @param tamperTimestamp The tamper timestamp - * - * @return The tamper pin number - */ -uint8_t IRTC_ReadTamperQueue(RTC_Type *base, irtc_datetime_t *tamperTimestamp); - -/*! - * @brief Gets the IRTC Tamper queue full status - * - * @param base IRTC peripheral base address - * - * @retval true Tamper queue is full. - * @retval false Tamper queue is not full. - */ -static inline bool IRTC_GetTamperQueueFullStatus(RTC_Type *base) -{ - return ((0U != (base->TAMPER_SCR & RTC_TAMPER_QSCR_Q_FULL_MASK)) ? true : false); -} - -/*! - * @brief Clear the IRTC Tamper queue full status - * - * @param base IRTC peripheral base address - * - */ -static inline void IRTC_ClearTamperQueueFullStatus(RTC_Type *base) -{ - base->TAMPER_QSCR |= RTC_TAMPER_QSCR_Q_CLEAR_MASK; -} -#endif /* FSL_FEATURE_RTC_HAS_TAMPER_QUEUE */ - -/*! @}*/ - -#endif - -#if defined(FSL_FEATURE_RTC_HAS_SUBSYSTEM) && FSL_FEATURE_RTC_HAS_SUBSYSTEM -/*! - * @name RTC subsystem Interface - * @{ - */ - -/*! - * @brief Enable the RTC wake-up timer. - * - * 1HZ clock out selected via call to API IRTC_ConfigClockOut in order for the subsecond - * counter to synchronize with the RTC_SECONDS counter. - * - * @param base RTC peripheral base address - * @param enable Use/Un-use the sub-second counter. - * - true: Use RTC wake-up timer at the same time. - * - false: Un-use RTC wake-up timer, RTC only use the normal seconds timer by default. - */ -static inline void IRTC_EnableSubsecondCounter(RTC_Type *base, bool enable) -{ - if (enable) - { - base->SUBSECOND_CTRL |= RTC_SUBSECOND_CTRL_SUB_SECOND_CNT_EN_MASK; - } - else - { - base->SUBSECOND_CTRL &= ~RTC_SUBSECOND_CTRL_SUB_SECOND_CNT_EN_MASK; - } -} - -/*! - * @brief Read the actual RTC sub-second COUNT value. - * - * @param base RTC peripheral base address - * - * @return The actual RTC sub-second COUNT value. - */ -static inline uint32_t IRTC_GetSubsecondCount(RTC_Type *base) -{ - uint32_t a, b; - - /* Follow the RF document to read the RTC default seconds timer (1HZ) counter value. */ - do - { - a = base->SUBSECOND_CNT; - b = base->SUBSECOND_CNT; - } while (a != b); - - return b; -} -/*! - * @brief Set countdown value to the RTC wake timer counter register. - * - * @param base RTC peripheral base address - * @param enable1kHzClk Enable 1kHz clock source for the wake timer, else use the 32kHz clock. - * @param wakeupValue The value to be loaded into the WAKE register in wake timer counter. - */ -static inline void IRTC_SetWakeupCount(RTC_Type *base, bool enable1kHzClk, uint32_t wakeupValue) -{ - /* Config whether enable the wakeup counter */ - uint32_t writeVal; - writeVal = base->WAKE_TIMER_CTRL; - base->WAKE_TIMER_CTRL = RTC_WAKE_TIMER_CTRL_CLR_WAKE_TIMER_MASK; - - if (enable1kHzClk) - { - writeVal |= RTC_WAKE_TIMER_CTRL_OSC_DIV_ENA_MASK; - } - else - { - writeVal &= ~RTC_WAKE_TIMER_CTRL_OSC_DIV_ENA_MASK; - } - - base->WAKE_TIMER_CTRL = writeVal; - /* Set the start countdown value into the RTC WAKE register */ - base->WAKE_TIMER_CNT = wakeupValue; -} - -/*! - * @brief Read the actual value from the WAKE register value in RTC wake timer. - * - * @param base RTC peripheral base address - * - * @return The actual value of the WAKE register value in wake timer counter. - */ -static inline uint32_t IRTC_GetWakeupCount(RTC_Type *base) -{ - /* Read current wake-up countdown value */ - return base->WAKE_TIMER_CNT; -} - -/*! @}*/ -#endif - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_IRTC_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_itrc.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_itrc.c deleted file mode 100644 index 27120e076aa..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_itrc.c +++ /dev/null @@ -1,293 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_itrc.h" - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.itrc" -#endif - -#define b11 0x3UL -#define b10 0x2u -#define b01 0x1u - -#define OUT_SEL_0_COUNT (16u) -#define OUT_SEL_1_COUNT (32u) -#define OUT_SEL_2_COUNT (48u) - -/* Value used to trigger SW Events */ -#define SW_EVENT_VAL 0x5AA55AA5u - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * Weak implementation of ITRC IRQ, should be re-defined by user when using ITRC IRQ - */ -__WEAK void ITRC0_DriverIRQHandler(void) -{ - /* ITRC generates IRQ until corresponding bit in STATUS is cleared by calling - * ITRC_ClearStatus(ITRC,((uint32_t)kITRC_Irq) - */ -} - -/*! - * brief Clear ITRC status - * - * This function clears corresponding ITRC event or action in STATUS register. - * - * param base ITRC peripheral base address - * param word 32bit word represent corresponding event/action in STATUS register to be cleared (see - * ITRC_STATUS_INx/OUTx_STATUS) - * return kStatus_Success if success, kStatus_InvalidArgument otherwise - */ -status_t ITRC_ClearStatus(ITRC_Type *base, uint32_t word) -{ - /* If reserved/unused bits in STATUS register are set in 'word' parameter, return kStatus_InvalidArgument */ - if ((word & ~(IN_0_15_EVENTS_MASK | OUT_ACTIONS_MASK)) != 0u) - { - return kStatus_InvalidArgument; - } - - base->STATUS |= word; - - return kStatus_Success; -} - -/*! - * brief Get ITRC Status - * - * This function returns ITRC STATUS1 register value. - * - * param base ITRC peripheral base address - * return Value of ITRC STATUS register - */ -uint32_t ITRC_GetStatus(ITRC_Type *base) -{ - return base->STATUS; -} - -#if defined(ITRC_STATUS1_IN16_STATUS_MASK) -/*! - * brief Clear ITRC status 1 - * - * This function clears corresponding ITRC event or action in STATUS1 register. - * - * param base ITRC peripheral base address - * param word 32bit word represent corresponding event/action in STATUS1 register to be cleared (see - * ITRC_STATUS_INx/OUTx_STATUS) - * return kStatus_Success if success, kStatus_InvalidArgument otherwise - */ -status_t ITRC_ClearStatus1(ITRC_Type *base, uint32_t word) -{ - /* If reserved/unused bits in STATUS register are set in 'word' parameter, return kStatus_InvalidArgument */ - if ((word & ~(IN_16_47_EVENTS_MASK)) != 0u) - { - return kStatus_InvalidArgument; - } - - base->STATUS1 |= word; - - return kStatus_Success; -} - -/*! - * brief Get ITRC Status 1 - * - * This function returns ITRC STATUS1 register value. - * - * param base ITRC peripheral base address - * return Value of ITRC STATUS1 register - */ -uint32_t ITRC_GetStatus1(ITRC_Type *base) -{ - return base->STATUS1; -} - -#endif /* defined(ITRC_STATUS1_IN16_STATUS_MASK) */ - -/*! - * brief Clear all ITRC status - * - * This clears all event and action in STATUS and STATUS1 registers. - * - * param base ITRC peripheral base address - * return kStatus_Success - */ -status_t ITRC_ClearAllStatus(ITRC_Type *base) -{ - base->STATUS |= (IN_0_15_EVENTS_MASK | OUT_ACTIONS_MASK); -#if defined(ITRC_STATUS1_IN16_STATUS_MASK) - base->STATUS1 |= (IN_16_47_EVENTS_MASK); -#endif /* defined(ITRC_STATUS1_IN16_STATUS_MASK) */ - - return kStatus_Success; -} - -/*! - * brief Trigger ITRC SW Event 0 - * - * This funciton set SW_EVENT0 register with value !=0 which triggers ITRC SW Event 0. - * - * param base ITRC peripheral base address - */ -void ITRC_SetSWEvent0(ITRC_Type *base) -{ - base->SW_EVENT0 = SW_EVENT_VAL; -} - -/*! - * brief Trigger ITRC SW Event 1 - * - * This funciton set SW_EVENT1 register with value !=0 which triggers ITRC SW Event 1. - * - * param base ITRC peripheral base address - */ -void ITRC_SetSWEvent1(ITRC_Type *base) -{ - base->SW_EVENT1 = SW_EVENT_VAL; -} - -/*! - * brief Set ITRC Action to Event - * - * This function sets input Event signal to corresponding output Action response signal. - * - * param base ITRC peripheral base address - * param out ITRC OUT signal action - * param in ITRC IN signal event - * param lock if set locks INx_SEL configuration. This can be cleared only by PMC Core reset. - * param enable if set input Event will be selected for output Action, otherwise disable (if not already locked). - * return kStatus_Success if success, kStatus_InvalidArgument otherwise - */ -status_t ITRC_SetActionToEvent( - ITRC_Type *base, itrc_out_signals_t out, itrc_input_signals_t in, itrc_lock_t lock, itrc_enable_t enable) -{ - uint32_t sel0, sel1, index, select_AND_mask; - - /* prepare values for INx_SEL0/1 bit-field according to secure techniques and register behavior - * +------------+------------+------------------+---------------------------+ - * | INx_SEL0 | INx_SEL1 | Signal selected? | Writable field? | - * +------------+------------+------------------+---------------------------+ - * | 10 | 10 | No | Yes (default after reset) | - * | 01 | 10 | Yes | Yes | - * | don't care | !="10" | Yes | No | - * | 00 or 11 | don't care | Yes | No | - * +------------+------------+------------------+---------------------------+ - */ - if ((lock == kITRC_Unlock) && (enable == kITRC_Disable)) - { - sel0 = b10; - sel1 = b10; - } - else if ((lock == kITRC_Unlock) && (enable == kITRC_Enable)) - { - sel0 = b01; - sel1 = b10; - } - else - { - sel0 = b11; - sel1 = b11; - } - - /* Compute index for INx_SEL0/1 bit-field within OUTy_SEL0/1 registers */ - if ((uint32_t)in < OUT_SEL_0_COUNT) - { - index = 2u * (uint32_t)in; - } - else if (OUT_SEL_0_COUNT <= (uint32_t)in && (uint32_t)in < OUT_SEL_1_COUNT) - { - index = 2u * ((uint32_t)in - OUT_SEL_0_COUNT); - } - else if (OUT_SEL_1_COUNT <= (uint32_t)in && (uint32_t)in < OUT_SEL_2_COUNT) - { - index = 2u * ((uint32_t)in - OUT_SEL_1_COUNT); - } - else - { - return kStatus_InvalidArgument; - } - - /* Prepare AND mask to set INx_SEL0 accordingly */ - select_AND_mask = ~(uint32_t)(b11 << index); - - /* Configure OUT action for IN event */ - for (uint8_t i = (uint8_t)kITRC_Irq; i < ITRC_OUT_COUNT; i++) - { - /* Loop over all OUT actions, set only requested one */ - if (i == (uint8_t)out) - { - if ((uint32_t)in < OUT_SEL_0_COUNT) - { - base->OUT_SEL[i][0] = (base->OUT_SEL[i][0] & select_AND_mask) | (sel0 << index); - base->OUT_SEL[i][1] |= sel1 << index; - break; - } -#if defined(ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_COUNT) - else if (OUT_SEL_0_COUNT <= (uint32_t)in && (uint32_t)in < OUT_SEL_1_COUNT) - { - base->OUT_SEL_1[i][0] = (base->OUT_SEL[i][0] & select_AND_mask) | (sel0 << index); - base->OUT_SEL_1[i][1] |= sel1 << index; - break; - } -#endif /* defined(OUT_SEL_1) */ -#if defined(ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_COUNT) - else if (OUT_SEL_1_COUNT <= (uint32_t)in && (uint32_t)in < OUT_SEL_2_COUNT) - { - base->OUT_SEL_2[i][0] = (base->OUT_SEL[i][0] & select_AND_mask) | (sel0 << index); - base->OUT_SEL_2[i][1] |= sel1 << index; - break; - } - else - { - /* All the cases have been listed above, this branch should not be reached. */ - return kStatus_InvalidArgument; - } -#endif /* defined(OUT_SEL_2) */ - } - } - - return kStatus_Success; -} - -/*! - * brief Initialize ITRC - * - * This function initializes ITRC by enabling IRQ. - * - * param base ITRC peripheral base address - * return Status of the init operation - */ -status_t ITRC_Init(ITRC_Type *base) -{ - NVIC_EnableIRQ(ITRC0_IRQn); - - return kStatus_Success; -} - -/*! - * brief Deinitialize ITRC - * - * This function just disable ITRC IRQ. - * - * param base ITRC peripheral base address - */ -void ITRC_Deinit(ITRC_Type *base) -{ - NVIC_DisableIRQ(ITRC0_IRQn); -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_itrc.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_itrc.h deleted file mode 100644 index 6e0817da6c8..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_itrc.h +++ /dev/null @@ -1,322 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_ITRC_H_ -#define FSL_ITRC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup ITRC - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief Defines ITRC driver version 2.3.0. - * - * Change log: - * - Version 2.3.0 - * - Update names of kITRC_SwEvent1/2 to kITRC_SwEvent0/1 to align with RM - * - Version 2.2.0 - * - Update driver to new version and input events - * - Version 2.1.0 - * - Make SYSCON glitch platform dependent - * - Version 2.0.0 - * - initial version - */ -#define FSL_ITRC_DRIVER_VERSION (MAKE_VERSION(2, 3, 0)) -/*@}*/ - -typedef enum _itrc_input_signals -{ - kITRC_Glitch = 0U, - kITRC_Tamper = 1U, - kITRC_Cdog = 2U, - kITRC_BodVbat = 3u, - kITRC_BodVdd = 4u, - kITRC_Watchdog = 5u, - kITRC_FlashEcc = 6u, - kITRC_Ahb = 7u, - kITRC_ElsErr = 8u, -#if defined(FSL_FEATURE_ITRC_HAS_SYSCON_GLITCH) && (FSL_FEATURE_ITRC_HAS_SYSCON_GLITCH > 0) - kITRC_SysconGlitch = 9u, -#endif - kITRC_Pkc = 10u, -#if defined(ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN11_SELn_MASK) - kITRC_Cdog1 = 11u, -#endif /* ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN11_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN12_SELn_MASK) - kITRC_Watchdog1 = 12u, -#endif /* ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN12_SELn_MASK*/ -#if defined(ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN13_SELn_MASK) - kITRC_Freqme = 13u, -#endif /* ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN13_SELn_MASK */ - kITRC_SwEvent0 = 14u, - kITRC_SwEvent1 = 15u, -#if defined(ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN16_SELn_MASK) - kITRC_VddSysLow = 16u, -#endif /* ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN16_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN17_SELn_MASK) - kITRC_VddIoLow = 17u, -#endif /* ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN17_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN19_SELn_MASK) - kITRC_VddTemp = 19u, -#endif /* ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN19_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN20_SELn_MASK) - kITRC_VddClock = 20u, -#endif /* ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN20_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN21_SELn_MASK) - kITRC_INTM0 = 21u, -#endif /* ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN21_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN22_SELn_MASK) - kITRC_INTM1 = 22u, -#endif /* ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN22_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN23_SELn_MASK) - kITRC_INTM2 = 23u, -#endif /* ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN23_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN24_SELn_MASK) - kITRC_INTM3 = 24u, -#endif /* ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN24_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN25_SELn_MASK) && \ - defined(ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN32_SELn_MASK) - kITRC_SoCTrim0 = 25u, - kITRC_SoCTrim1 = 26u, - kITRC_SoCTrim2 = 27u, - kITRC_SoCTrim3 = 28u, - kITRC_SoCTrim4 = 29u, - kITRC_SoCTrim5 = 30u, - kITRC_SoCTrim6 = 31u, - kITRC_SoCTrim7 = 32u, -#endif /* ITRC_OUTX_SEL_x_OUTX_SELY_OUT_SEL_INxx_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN33_SELn_MASK) - kITRC_GdetSfr = 33u, -#endif /* ITRC_OUTX_SEL_x_OUTX_SELY_OUT_SEL_INxx_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN34_SELn_MASK) - kITRC_VddCore = 34u, -#endif /* ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN34_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN35_SELn_MASK) - kITRC_VddSys = 35u, -#endif /* ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN35_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN36_SELn_MASK) - kITRC_VddIo = 36u, -#endif /* ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN36_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN37_SELn_MASK) - kITRC_FlexspiGcm = 37u, -#endif /* ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN37_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN46_SELn_MASK) - kITRC_Sm3Err = 46u, -#endif /* ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN46_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN47_SELn_MASK) - kITRC_TrngErr = 47u, -#endif /* */ -} itrc_input_signals_t; - -typedef enum _itrc_lock -{ - kITRC_Unlock = 0U, - kITRC_Lock = 1U, -} itrc_lock_t; - -typedef enum _itrc_enable -{ - kITRC_Enable = 0U, - kITRC_Disable = 1U, -} itrc_enable_t; - -typedef enum _itrc_out_signals -{ - kITRC_Irq = 0U, - kITRC_ElsReset = 1U, - kITRC_PufZeroize = 2U, - kITRC_RamZeroize = 3u, - kITRC_ChipReset = 4u, - kITRC_TamperOut = 5u, - kITRC_TamperOut1 = 6u, -} itrc_out_signals_t; - -/* Inputs 0 to 15 events mask */ -#if defined(FSL_FEATURE_ITRC_HAS_SYSCON_GLITCH) && (FSL_FEATURE_ITRC_HAS_SYSCON_GLITCH > 0) -#define IN_0_15_EVENTS_MASK \ - (ITRC_STATUS_IN0_STATUS_MASK | ITRC_STATUS_IN1_STATUS_MASK | ITRC_STATUS_IN2_STATUS_MASK | \ - ITRC_STATUS_IN3_STATUS_MASK | ITRC_STATUS_IN4_STATUS_MASK | ITRC_STATUS_IN5_STATUS_MASK | \ - ITRC_STATUS_IN6_STATUS_MASK | ITRC_STATUS_IN7_STATUS_MASK | ITRC_STATUS_IN8_STATUS_MASK | \ - ITRC_STATUS_IN9_STATUS_MASK | ITRC_STATUS_IN10_STATUS_MASK | ITRC_STATUS_IN14_STATUS_MASK | \ - ITRC_STATUS_IN15_STATUS_MASK) -#else -#define IN_0_15_EVENTS_MASK \ - (ITRC_STATUS_IN0_STATUS_MASK | ITRC_STATUS_IN1_STATUS_MASK | ITRC_STATUS_IN2_STATUS_MASK | \ - ITRC_STATUS_IN3_STATUS_MASK | ITRC_STATUS_IN4_STATUS_MASK | ITRC_STATUS_IN5_STATUS_MASK | \ - ITRC_STATUS_IN6_STATUS_MASK | ITRC_STATUS_IN7_STATUS_MASK | ITRC_STATUS_IN8_STATUS_MASK | \ - ITRC_STATUS_IN10_STATUS_MASK | ITRC_STATUS_IN14_STATUS_MASK | ITRC_STATUS_IN15_STATUS_MASK) -#endif /* FSL_FEATURE_ITRC_HAS_SYSCON_GLITCH */ - -/* Inputs 15 to 47 events mask */ -#if defined(ITRC_STATUS1_IN16_STATUS_MASK) && defined(ITRC_STATUS1_IN47_STATUS) -#define IN_16_47_EVENTS_MASK \ - (ITRC_STATUS1_IN16_STATUS_MASK | ITRC_STATUS1_IN17_STATUS_MASK | ITRC_STATUS1_IN18_STATUS_MASK | \ - ITRC_STATUS1_IN19_STATUS_MASK | ITRC_STATUS1_IN20_STATUS_MASK | ITRC_STATUS1_IN24_21_STATUS_MASK | \ - ITRC_STATUS1_IN24_21_STATUS_MASK | ITRC_STATUS1_IN32_25_STATUS_MASK | ITRC_STATUS1_IN33_STATUS_MASK | \ - ITRC_STATUS1_IN34_STATUS_MASK | ITRC_STATUS1_IN35_STATUS_MASK | ITRC_STATUS1_IN36_STATUS_MASK | \ - ITRC_STATUS1_IN37_STATUS_MASK | ITRC_STATUS1_IN46_STATUS_MASK | ITRC_STATUS1_IN47_STATUS_MASK) -#endif /* ITRC_STATUS1_IN16_STATUS_MASK && ITRC_STATUS1_IN47_STATUS */ - -/* Output actions mask */ -#if defined(ITRC_STATUS_OUT6_STATUS) -#define OUT_ACTIONS_MASK \ - (ITRC_STATUS_OUT0_STATUS_MASK | ITRC_STATUS_OUT1_STATUS_MASK | ITRC_STATUS_OUT2_STATUS_MASK | \ - ITRC_STATUS_OUT3_STATUS_MASK | ITRC_STATUS_OUT4_STATUS_MASK | ITRC_STATUS_OUT5_STATUS_MASK | \ - ITRC_STATUS_OUT6_STATUS_MASK) -#else -#define OUT_ACTIONS_MASK \ - (ITRC_STATUS_OUT0_STATUS_MASK | ITRC_STATUS_OUT1_STATUS_MASK | ITRC_STATUS_OUT2_STATUS_MASK | \ - ITRC_STATUS_OUT3_STATUS_MASK | ITRC_STATUS_OUT4_STATUS_MASK | ITRC_STATUS_OUT5_STATUS_MASK) -#endif /* ITRC_STATUS_OUT6_STATUS */ - -#define ITRC_OUT_COUNT (7u) -#ifndef ITRC -#define ITRC ITRC0 -#endif - -/******************************************************************************* - * API - *******************************************************************************/ - -extern void ITRC0_DriverIRQHandler(void); - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name ITRC Functional Operation - * @{ - */ - -/*! - * @brief Set ITRC Action to Event - * - * This function sets input Event signal to corresponding output Action response signal. - * - * @param base ITRC peripheral base address - * @param out ITRC OUT signal action - * @param in ITRC IN signal event - * @param lock if set locks INx_SEL configuration. This can be cleared only by PMC Core reset. - * @param enable if set input Event will be selected for output Action, otherwise disable (if not already locked). - * @return kStatus_Success if success, kStatus_InvalidArgument otherwise - */ -status_t ITRC_SetActionToEvent( - ITRC_Type *base, itrc_out_signals_t out, itrc_input_signals_t in, itrc_lock_t lock, itrc_enable_t enable); - -/*! - * @brief Trigger ITRC SW Event 0 - * - * This funciton set SW_EVENT0 register with value !=0 which triggers ITRC SW Event 0. - * - * @param base ITRC peripheral base address - */ -void ITRC_SetSWEvent0(ITRC_Type *base); - -/*! - * @brief Trigger ITRC SW Event 1 - * - * This funciton set SW_EVENT1 register with value !=0 which triggers ITRC SW Event 1. - * - * @param base ITRC peripheral base address - */ -void ITRC_SetSWEvent1(ITRC_Type *base); - -/*! - * @brief Get ITRC Status - * - * This function returns ITRC register status. - * - * @param base ITRC peripheral base address - * @return Value of ITRC STATUS register - */ -uint32_t ITRC_GetStatus(ITRC_Type *base); - -/*! - * @brief Clear ITRC status - * - * This function clears corresponding ITRC event or action in STATUS register. - * - * @param base ITRC peripheral base address - * @param word 32bit word represent corresponding event/action in STATUS register to be cleared (see - * ITRC_STATUS_INx/OUTx_STATUS) - * @return kStatus_Success if success, kStatus_InvalidArgument otherwise - */ -status_t ITRC_ClearStatus(ITRC_Type *base, uint32_t word); - -#if defined(ITRC_STATUS1_IN16_STATUS_MASK) -/*! - * @brief Get ITRC Status 1 - * - * This function returns ITRC STATUS1 register value. - * - * @param base ITRC peripheral base address - * @return Value of ITRC STATUS1 register - */ -uint32_t ITRC_GetStatus1(ITRC_Type *base); - -/*! - * brief Clear ITRC status 1 - * - * This function clears corresponding ITRC event or action in STATUS1 register. - * - * param base ITRC peripheral base address - * param word 32bit word represent corresponding event/action in STATUS1 register to be cleared (see - * ITRC_STATUS_INx/OUTx_STATUS) - * return kStatus_Success if success, kStatus_InvalidArgument otherwise - */ -status_t ITRC_ClearStatus1(ITRC_Type *base, uint32_t word); -#endif /* defined(ITRC_STATUS1_IN16_STATUS_MASK) */ - -/*! - * @brief Clear All ITRC status - * - * This function clears all event and action status. - * - * @param base ITRC peripheral base address - * @return kStatus_Success if success - */ -status_t ITRC_ClearAllStatus(ITRC_Type *base); - -/*! - * @brief Initialize ITRC - * - * This function initializes ITRC by enabling IRQ. - * - * @param base ITRC peripheral base address - * @param conf ITRC configuration structure - * @return Status of the init operation - */ -status_t ITRC_Init(ITRC_Type *base); - -/*! - * @brief Deinitialize ITRC - * - * This function deinitializes ITRC by disabling IRQ. - * - * @param base ITRC peripheral base address - */ -void ITRC_Deinit(ITRC_Type *base); - -/*! @}*/ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @}*/ /* end of group itrc */ - -#endif /* FSL_ITRC_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpadc.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpadc.c deleted file mode 100644 index c22741c4f58..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpadc.c +++ /dev/null @@ -1,977 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpadc.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpadc" -#endif - -#ifndef ADC_VERID_DIFFEN_MASK -#define ADC_VERID_DIFFEN_MASK (0x2U) -#endif /* ADC_VERID_DIFFEN_MASK */ - -#ifndef ADC_VERID_NUM_SEC_MASK -#define ADC_VERID_NUM_SEC_MASK (0x800U) -#endif /* ADC_VERID_NUM_SEC_MASK */ - -#define ADC_CMDL_CHANNEL_MODE_MASK (0x60U) -#define ADC_CMDL_CHANNEL_MODE_SHIFT (5U) -#define ADC_CMDL_CHANNEL_MODE(x) \ - (((uint32_t)(((uint32_t)(x)) << ADC_CMDL_CHANNEL_MODE_SHIFT)) & ADC_CMDL_CHANNEL_MODE_MASK) - -#define GET_ADC_CFG_TPRICTRL_VALUE(val) (((uint32_t)val) & 0x3U) - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES -#define GET_ADC_CFG_TRES_VALUE(val) ((((uint32_t)val) & 0x4U) >> 2U) -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES */ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES -#define GET_ADC_CFG_TCMDRES_VALUE(val) ((((uint32_t)val) & 0x8U) >> 3U) -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES */ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI) && FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI -#define GET_ADC_CFG_HPT_EXDI_VALUE(val) ((((uint32_t)val) & 0x10U) >> 4U) -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI) && FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI */ - -#if defined(LPADC_RSTS) -#define LPADC_RESETS_ARRAY LPADC_RSTS -#elif defined(ADC_RSTS) -#define LPADC_RESETS_ARRAY ADC_RSTS -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Get instance number for LPADC module. - * - * @param base LPADC peripheral base address - */ -static uint32_t LPADC_GetInstance(ADC_Type *base); - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ -/*! - * @brief Get gain conversion result . - * - * @param gainAdjustment gain adjustment value. - */ -static uint32_t LPADC_GetGainConvResult(float gainAdjustment); -#endif /* defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ */ - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to LPADC bases for each instance. */ -static ADC_Type *const s_lpadcBases[] = ADC_BASE_PTRS; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to LPADC clocks for each instance. */ -static const clock_ip_name_t s_lpadcClocks[] = LPADC_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#if defined(LPADC_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_lpadcResets[] = LPADC_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t LPADC_GetInstance(ADC_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - /* - * $Branch Coverage Justification$ - * (instance >= ARRAY_SIZE(s_lpadcBases)) not covered. The peripheral base - * address is always valid and checked by assert. - */ - for (instance = 0; instance < ARRAY_SIZE(s_lpadcBases); instance++) - { - /* - * $Branch Coverage Justification$ - * (s_lpadcBases[instance] != base) not covered. The peripheral base - * address is always valid and checked by assert. - */ - if (s_lpadcBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_lpadcBases)); - - return instance; -} - -#if (defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) -/*! - * brief Get gain conversion Result . - * - * param gainAdjustment gain adjustment value. - */ -static uint32_t LPADC_GetGainConvResult(float gainAdjustment) -{ - uint16_t i = 0U; - uint32_t tmp32 = 0U; - uint32_t GCRa[17] = {0}; - uint32_t GCALR = 0U; - - for (i = 0x11U; i > 0U; i--) - { - tmp32 = (uint32_t)((gainAdjustment) / ((float)(1.0 / (double)(1U << (0x10U - (i - 1U)))))); - GCRa[i - 1U] = tmp32; - gainAdjustment = gainAdjustment - ((float)tmp32) * ((float)(1.0 / (double)(1U << (0x10U - (i - 1U))))); - } - /* Get GCALR value calculated */ - for (i = 0x11U; i > 0U; i--) - { - GCALR += GCRa[i - 1U] * ((uint32_t)(1UL << (uint32_t)(i - 1UL))); - } - - /* to return GCALR value calculated */ - return GCALR; -} -#endif /* defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ */ - -/*! - * brief Initializes the LPADC module. - * - * param base LPADC peripheral base address. - * param config Pointer to configuration structure. See "lpadc_config_t". - */ -void LPADC_Init(ADC_Type *base, const lpadc_config_t *config) -{ - /* Check if the pointer is available. */ - assert(config != NULL); - - uint32_t tmp32 = 0U; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock for LPADC instance. */ - (void)CLOCK_EnableClock(s_lpadcClocks[LPADC_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(LPADC_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_lpadcResets[LPADC_GetInstance(base)]); -#endif - - /* Reset the module. */ - LPADC_DoResetConfig(base); -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - LPADC_DoResetFIFO0(base); - LPADC_DoResetFIFO1(base); -#else - LPADC_DoResetFIFO(base); -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ - - /* Disable the module before setting configuration. */ - LPADC_Enable(base, false); - - /* Configure the module generally. */ - if (config->enableInDozeMode) - { - base->CTRL &= ~ADC_CTRL_DOZEN_MASK; - } - else - { - base->CTRL |= ADC_CTRL_DOZEN_MASK; - } - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS - /* Set calibration average mode. */ - base->CTRL |= ADC_CTRL_CAL_AVGS(config->conversionAverageMode); -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS */ - -/* ADCx_CFG. */ -#if defined(FSL_FEATURE_LPADC_HAS_CFG_ADCKEN) && FSL_FEATURE_LPADC_HAS_CFG_ADCKEN - if (config->enableInternalClock) - { - tmp32 |= ADC_CFG_ADCKEN_MASK; - } -#endif /* FSL_FEATURE_LPADC_HAS_CFG_ADCKEN */ -#if defined(FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG) && FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG - if (config->enableVref1LowVoltage) - { - tmp32 |= ADC_CFG_VREF1RNG_MASK; - } -#endif /* FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG */ - if (config->enableAnalogPreliminary) - { - tmp32 |= ADC_CFG_PWREN_MASK; - } - tmp32 |= (ADC_CFG_PUDLY(config->powerUpDelay) /* Power up delay. */ - | ADC_CFG_REFSEL(config->referenceVoltageSource) /* Reference voltage. */ -#if defined(FSL_FEATURE_LPADC_HAS_CFG_PWRSEL) && (FSL_FEATURE_LPADC_HAS_CFG_PWRSEL == 1U) - | ADC_CFG_PWRSEL(config->powerLevelMode) /* Power configuration. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_PWRSEL) && (FSL_FEATURE_LPADC_HAS_CFG_PWRSEL == 1U) */ - ); - - tmp32 |= ADC_CFG_TPRICTRL(GET_ADC_CFG_TPRICTRL_VALUE(config->triggerPriorityPolicy)); - -#if (defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES) - tmp32 |= ADC_CFG_TRES(GET_ADC_CFG_TRES_VALUE(config->triggerPriorityPolicy)); -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES */ - -#if (defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) - tmp32 |= ADC_CFG_TCMDRES(GET_ADC_CFG_TCMDRES_VALUE(config->triggerPriorityPolicy)); -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES */ - -#if (defined(FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI) && FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI) - tmp32 |= ADC_CFG_HPT_EXDI(GET_ADC_CFG_HPT_EXDI_VALUE(config->triggerPriorityPolicy)); -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI) && FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI */ - - base->CFG = tmp32; - - /* ADCx_PAUSE. */ - if (config->enableConvPause) - { - base->PAUSE = ADC_PAUSE_PAUSEEN_MASK | ADC_PAUSE_PAUSEDLY(config->convPauseDelay); - } - else - { - base->PAUSE = 0U; - } - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - /* ADCx_FCTRL0. */ - base->FCTRL[0] = ADC_FCTRL_FWMARK(config->FIFO0Watermark); - /* ADCx_FCTRL1. */ - base->FCTRL[1] = ADC_FCTRL_FWMARK(config->FIFO1Watermark); -#else - /* ADCx_FCTRL. */ - base->FCTRL = ADC_FCTRL_FWMARK(config->FIFOWatermark); -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ - - /* Enable the module after setting configuration. */ - LPADC_Enable(base, true); -} - -/*! - * brief Gets an available pre-defined settings for initial configuration. - * - * This function initializes the converter configuration structure with an available settings. The default values are: - * code - * config->enableInDozeMode = true; - * config->conversionAverageMode = kLPADC_ConversionAverage1; - * config->enableAnalogPreliminary = false; - * config->powerUpDelay = 0x80; - * config->referenceVoltageSource = kLPADC_ReferenceVoltageAlt1; - * config->powerLevelMode = kLPADC_PowerLevelAlt1; - * config->triggerPriorityPolicy = kLPADC_TriggerPriorityPreemptImmediately; - * config->enableConvPause = false; - * config->convPauseDelay = 0U; - * config->FIFO0Watermark = 0U; - * config->FIFO1Watermark = 0U; - * config->FIFOWatermark = 0U; - * endcode - * param config Pointer to configuration structure. - */ -void LPADC_GetDefaultConfig(lpadc_config_t *config) -{ - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_ADCKEN) && FSL_FEATURE_LPADC_HAS_CFG_ADCKEN - config->enableInternalClock = false; -#endif /* FSL_FEATURE_LPADC_HAS_CFG_ADCKEN */ -#if defined(FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG) && FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG - config->enableVref1LowVoltage = false; -#endif /* FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG */ - config->enableInDozeMode = true; -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS - /* Set calibration average mode. */ - config->conversionAverageMode = kLPADC_ConversionAverage1; -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS */ - config->enableAnalogPreliminary = false; - config->powerUpDelay = 0x80; - config->referenceVoltageSource = kLPADC_ReferenceVoltageAlt1; -#if defined(FSL_FEATURE_LPADC_HAS_CFG_PWRSEL) && (FSL_FEATURE_LPADC_HAS_CFG_PWRSEL == 1U) - config->powerLevelMode = kLPADC_PowerLevelAlt1; -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_PWRSEL) && (FSL_FEATURE_LPADC_HAS_CFG_PWRSEL == 1U) */ - config->triggerPriorityPolicy = kLPADC_TriggerPriorityPreemptImmediately; - config->enableConvPause = false; - config->convPauseDelay = 0U; -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - config->FIFO0Watermark = 0U; - config->FIFO1Watermark = 0U; -#else - config->FIFOWatermark = 0U; -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ -} - -/*! - * brief De-initializes the LPADC module. - * - * param base LPADC peripheral base address. - */ -void LPADC_Deinit(ADC_Type *base) -{ - /* Disable the module. */ - LPADC_Enable(base, false); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate the clock. */ - (void)CLOCK_DisableClock(s_lpadcClocks[LPADC_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) -/*! - * brief Get the result in conversion FIFOn. - * - * param base LPADC peripheral base address. - * param result Pointer to structure variable that keeps the conversion result in conversion FIFOn. - * param index Result FIFO index. - * - * return Status whether FIFOn entry is valid. - */ -bool LPADC_GetConvResult(ADC_Type *base, lpadc_conv_result_t *result, uint8_t index) -{ - assert(result != NULL); /* Check if the input pointer is available. */ - - uint32_t tmp32 = 0U; - - tmp32 = base->RESFIFO[index]; - - if (ADC_RESFIFO_VALID_MASK != (tmp32 & ADC_RESFIFO_VALID_MASK)) - { - return false; /* FIFO is empty. Discard any read from RESFIFO. */ - } - - result->commandIdSource = (tmp32 & ADC_RESFIFO_CMDSRC_MASK) >> ADC_RESFIFO_CMDSRC_SHIFT; - result->loopCountIndex = (tmp32 & ADC_RESFIFO_LOOPCNT_MASK) >> ADC_RESFIFO_LOOPCNT_SHIFT; - result->triggerIdSource = (tmp32 & ADC_RESFIFO_TSRC_MASK) >> ADC_RESFIFO_TSRC_SHIFT; - result->convValue = (uint16_t)(tmp32 & ADC_RESFIFO_D_MASK); - - return true; -} -/*! - * brief Get the result in conversion FIFOn using blocking method. - * - * param base LPADC peripheral base address. - * param result Pointer to structure variable that keeps the conversion result in conversion FIFOn. - * param index Result FIFO index. - */ -void LPADC_GetConvResultBlocking(ADC_Type *base, lpadc_conv_result_t *result, uint8_t index) -{ - assert(result != NULL); /* Check if the input pointer is available. */ - - uint32_t tmp32 = 0U; - - tmp32 = base->RESFIFO[index]; - - while (ADC_RESFIFO_VALID_MASK != (tmp32 & ADC_RESFIFO_VALID_MASK)) - { - tmp32 = base->RESFIFO[index]; - } - - result->commandIdSource = (tmp32 & ADC_RESFIFO_CMDSRC_MASK) >> ADC_RESFIFO_CMDSRC_SHIFT; - result->loopCountIndex = (tmp32 & ADC_RESFIFO_LOOPCNT_MASK) >> ADC_RESFIFO_LOOPCNT_SHIFT; - result->triggerIdSource = (tmp32 & ADC_RESFIFO_TSRC_MASK) >> ADC_RESFIFO_TSRC_SHIFT; - result->convValue = (uint16_t)(tmp32 & ADC_RESFIFO_D_MASK); -} -#else -/*! - * brief Get the result in conversion FIFO. - * - * param base LPADC peripheral base address. - * param result Pointer to structure variable that keeps the conversion result in conversion FIFO. - * - * return Status whether FIFO entry is valid. - */ -bool LPADC_GetConvResult(ADC_Type *base, lpadc_conv_result_t *result) -{ - assert(result != NULL); /* Check if the input pointer is available. */ - - uint32_t tmp32 = 0U; - - tmp32 = base->RESFIFO; - - if (ADC_RESFIFO_VALID_MASK != (tmp32 & ADC_RESFIFO_VALID_MASK)) - { - return false; /* FIFO is empty. Discard any read from RESFIFO. */ - } - - result->commandIdSource = (tmp32 & ADC_RESFIFO_CMDSRC_MASK) >> ADC_RESFIFO_CMDSRC_SHIFT; - result->loopCountIndex = (tmp32 & ADC_RESFIFO_LOOPCNT_MASK) >> ADC_RESFIFO_LOOPCNT_SHIFT; - result->triggerIdSource = (tmp32 & ADC_RESFIFO_TSRC_MASK) >> ADC_RESFIFO_TSRC_SHIFT; - result->convValue = (uint16_t)(tmp32 & ADC_RESFIFO_D_MASK); - - return true; -} -/*! - * @brief Get the result in conversion FIFO using blocking method. - * - * @param base LPADC peripheral base address. - * @param result Pointer to structure variable that keeps the conversion result in conversion FIFO. - */ -void LPADC_GetConvResultBlocking(ADC_Type *base, lpadc_conv_result_t *result) -{ - assert(result != NULL); /* Check if the input pointer is available. */ - - uint32_t tmp32 = 0U; - - tmp32 = base->RESFIFO; - - while (ADC_RESFIFO_VALID_MASK != (tmp32 & ADC_RESFIFO_VALID_MASK)) - { - tmp32 = base->RESFIFO; - } - - result->commandIdSource = (tmp32 & ADC_RESFIFO_CMDSRC_MASK) >> ADC_RESFIFO_CMDSRC_SHIFT; - result->loopCountIndex = (tmp32 & ADC_RESFIFO_LOOPCNT_MASK) >> ADC_RESFIFO_LOOPCNT_SHIFT; - result->triggerIdSource = (tmp32 & ADC_RESFIFO_TSRC_MASK) >> ADC_RESFIFO_TSRC_SHIFT; - result->convValue = (uint16_t)(tmp32 & ADC_RESFIFO_D_MASK); -} -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ - -/*! - * brief Configure the conversion trigger source. - * - * Each programmable trigger can launch the conversion command in command buffer. - * - * param base LPADC peripheral base address. - * param triggerId ID for each trigger. Typically, the available value range is from 0 to 3. - * param config Pointer to configuration structure. See to #lpadc_conv_trigger_config_t. - */ -void LPADC_SetConvTriggerConfig(ADC_Type *base, uint32_t triggerId, const lpadc_conv_trigger_config_t *config) -{ - assert(triggerId < ADC_TCTRL_COUNT); /* Check if the triggerId is available in this device. */ - assert(config != NULL); /* Check if the input pointer is available. */ - - uint32_t tmp32; - - tmp32 = ADC_TCTRL_TCMD(config->targetCommandId) /* Trigger command select. */ - | ADC_TCTRL_TDLY(config->delayPower) /* Trigger delay select. */ - | ADC_TCTRL_TPRI(config->priority) /* Trigger priority setting. */ -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - | ADC_TCTRL_FIFO_SEL_A(config->channelAFIFOSelect) -#if !(defined(FSL_FEATURE_LPADC_HAS_NO_TCTRL_FIFO_SEL_B) && FSL_FEATURE_LPADC_HAS_NO_TCTRL_FIFO_SEL_B) - | ADC_TCTRL_FIFO_SEL_B(config->channelBFIFOSelect) -#endif /* FSL_FEATURE_LPADC_HAS_NO_TCTRL_FIFO_SEL_B */ -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ - ; - if (config->enableHardwareTrigger) - { - tmp32 |= ADC_TCTRL_HTEN_MASK; - } - - base->TCTRL[triggerId] = tmp32; -} - -/*! - * brief Gets an available pre-defined settings for trigger's configuration. - * - * This function initializes the trigger's configuration structure with an available settings. The default values are: - * code - * config->targetCommandId = 0U; - * config->delayPower = 0U; - * config->priority = 0U; - * config->channelAFIFOSelect = 0U; - * config->channelBFIFOSelect = 0U; - * config->enableHardwareTrigger = false; - * endcode - * param config Pointer to configuration structure. - */ -void LPADC_GetDefaultConvTriggerConfig(lpadc_conv_trigger_config_t *config) -{ - assert(config != NULL); /* Check if the input pointer is available. */ - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->targetCommandId = 0U; - config->delayPower = 0U; - config->priority = 0U; -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - config->channelAFIFOSelect = 0U; - config->channelBFIFOSelect = 0U; -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ - config->enableHardwareTrigger = false; -} - -/*! - * brief Configure conversion command. - * - * note The number of compare value register on different chips is different, that is mean in some chips, some - * command buffers do not have the compare functionality. - * - * param base LPADC peripheral base address. - * param commandId ID for command in command buffer. Typically, the available value range is 1 - 15. - * param config Pointer to configuration structure. See to #lpadc_conv_command_config_t. - */ -void LPADC_SetConvCommandConfig(ADC_Type *base, uint32_t commandId, const lpadc_conv_command_config_t *config) -{ - assert(commandId < (ADC_CMDL_COUNT + 1U)); /* Check if the commandId is available on this device. */ - assert(config != NULL); /* Check if the input pointer is available. */ - - uint32_t tmp32 = 0; - - commandId--; /* The available command number are 1-15, while the index of register group are 0-14. */ - - /* ADCx_CMDL. */ - tmp32 = ADC_CMDL_ADCH(config->channelNumber); /* Channel number. */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTB_ADCH) && FSL_FEATURE_LPADC_HAS_CMDL_ALTB_ADCH - tmp32 |= ADC_CMDL_ALTB_ADCH(config->channelBNumber); /* Alternate channel B number. */ -#endif -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_CSCALE) && FSL_FEATURE_LPADC_HAS_CMDL_CSCALE - tmp32 |= ADC_CMDL_CSCALE(config->sampleScaleMode); /* Full/Part scale input voltage. */ -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_CSCALE */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE) && FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE - tmp32 |= ADC_CMDL_ALTB_CSCALE(config->channelBScaleMode); /* Alternate channel B full/Part scale input voltage. */ -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE */ - -#if !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_DIFF) && FSL_FEATURE_LPADC_HAS_CMDL_DIFF - assert(((config->sampleChannelMode >= kLPADC_SampleChannelDiffBothSideAB) && - (((base->VERID) & ADC_VERID_DIFFEN_MASK) != 0U)) || - (config->sampleChannelMode < kLPADC_SampleChannelDiffBothSideAB)); -#endif /* defined(FSL_FEATURE_LPADC_HAS_CMDL_DIFF) && FSL_FEATURE_LPADC_HAS_CMDL_DIFF */ - -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_CTYPE) && FSL_FEATURE_LPADC_HAS_CMDL_CTYPE - assert(((config->sampleChannelMode == kLPADC_SampleChannelDiffBothSide) && - (((base->VERID) & ADC_VERID_DIFFEN_MASK) != 0U)) || - ((config->sampleChannelMode == kLPADC_SampleChannelDualSingleEndBothSide) && - (((base->VERID) & ADC_VERID_NUM_SEC_MASK) != 0U)) || - (config->sampleChannelMode < kLPADC_SampleChannelDualSingleEndBothSide)); -#endif /* defined(FSL_FEATURE_LPADC_HAS_CMDL_CTYPE) && FSL_FEATURE_LPADC_HAS_CMDL_CTYPE */ -#endif /* !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) */ - - tmp32 |= ADC_CMDL_CHANNEL_MODE(config->sampleChannelMode); - -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_MODE) && FSL_FEATURE_LPADC_HAS_CMDL_MODE - tmp32 |= ADC_CMDL_MODE(config->conversionResolutionMode); -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_MODE */ - -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN) && FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN - /* Enable alternate channel B.*/ - if (config->enableChannelB) - { - tmp32 |= ADC_CMDL_ALTBEN_MASK; - } -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN */ - - base->CMD[commandId].CMDL = tmp32; - - /* ADCx_CMDH. */ - tmp32 = ADC_CMDH_NEXT(config->chainedNextCommandNumber) /* Next Command Select. */ - | ADC_CMDH_LOOP(config->loopCount) /* Loop Count Select. */ - | ADC_CMDH_AVGS(config->hardwareAverageMode) /* Hardware Average Select. */ - | ADC_CMDH_STS(config->sampleTimeMode) /* Sample Time Select. */ - | ADC_CMDH_CMPEN(config->hardwareCompareMode); /* Hardware compare enable. */ -#if (defined(FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG) && FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG) - if (config->enableWaitTrigger) - { - tmp32 |= ADC_CMDH_WAIT_TRIG_MASK; /* Wait trigger enable. */ - } -#endif /* FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG */ - - if (config->enableAutoChannelIncrement) - { - tmp32 |= ADC_CMDH_LWI_MASK; - } - base->CMD[commandId].CMDH = tmp32; - - /* Hardware compare settings. - * Not all Command Buffers have an associated Compare Value register. The compare function is only available on - * Command Buffers that have a corresponding Compare Value register. Therefore, assertion judgment needs to be - * made before setting the CV register. - */ - - if ((kLPADC_HardwareCompareDisabled != config->hardwareCompareMode) && (commandId < ADC_CV_COUNT)) - { - /* Set CV register. */ - base->CV[commandId] = (ADC_CV_CVH(config->hardwareCompareValueHigh) /* Compare value high. */ - | ADC_CV_CVL(config->hardwareCompareValueLow)); /* Compare value low. */ - } -} - -/*! - * brief Gets an available pre-defined settings for conversion command's configuration. - * - * This function initializes the conversion command's configuration structure with an available settings. The default - * values are: - * code - * config->sampleScaleMode = kLPADC_SampleFullScale; - * config->channelBScaleMode = kLPADC_SampleFullScale; - * config->sampleChannelMode = kLPADC_SampleChannelSingleEndSideA; - * config->channelNumber = 0U; - * config->channelBNumber = 0U; - * config->chainedNextCommandNumber = 0U; - * config->enableAutoChannelIncrement = false; - * config->loopCount = 0U; - * config->hardwareAverageMode = kLPADC_HardwareAverageCount1; - * config->sampleTimeMode = kLPADC_SampleTimeADCK3; - * config->hardwareCompareMode = kLPADC_HardwareCompareDisabled; - * config->hardwareCompareValueHigh = 0U; - * config->hardwareCompareValueLow = 0U; - * config->conversionResolutionMode = kLPADC_ConversionResolutionStandard; - * config->enableWaitTrigger = false; - * config->enableChannelB = false; - * endcode - * param config Pointer to configuration structure. - */ -void LPADC_GetDefaultConvCommandConfig(lpadc_conv_command_config_t *config) -{ - assert(config != NULL); /* Check if the input pointer is available. */ - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_CSCALE) && FSL_FEATURE_LPADC_HAS_CMDL_CSCALE - config->sampleScaleMode = kLPADC_SampleFullScale; -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_CSCALE */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE) && FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE - config->channelBScaleMode = kLPADC_SampleFullScale; -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE */ - config->sampleChannelMode = kLPADC_SampleChannelSingleEndSideA; - config->channelNumber = 0U; -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTB_ADCH) && FSL_FEATURE_LPADC_HAS_CMDL_ALTB_ADCH - config->channelBNumber = 0U; -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE */ - config->chainedNextCommandNumber = 0U; /* No next command defined. */ - config->enableAutoChannelIncrement = false; - config->loopCount = 0U; - config->hardwareAverageMode = kLPADC_HardwareAverageCount1; - config->sampleTimeMode = kLPADC_SampleTimeADCK3; - config->hardwareCompareMode = kLPADC_HardwareCompareDisabled; - config->hardwareCompareValueHigh = 0U; /* No used. */ - config->hardwareCompareValueLow = 0U; /* No used. */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_MODE) && FSL_FEATURE_LPADC_HAS_CMDL_MODE - config->conversionResolutionMode = kLPADC_ConversionResolutionStandard; -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_MODE */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG) && FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG - config->enableWaitTrigger = false; -#endif /* FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN) && FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN - config->enableChannelB = false; /* Enable alternate channel B.*/ -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN */ -} - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_CALOFS) && FSL_FEATURE_LPADC_HAS_CFG_CALOFS -/*! - * brief Enable the calibration function. - * - * When CALOFS is set, the ADC is configured to perform a calibration function anytime the ADC executes - * a conversion. Any channel selected is ignored and the value returned in the RESFIFO is a signed value - * between -31 and 31. -32 is not a valid and is never a returned value. Software should copy the lower 6- - * bits of the conversion result stored in the RESFIFO after a completed calibration conversion to the - * OFSTRIM field. The OFSTRIM field is used in normal operation for offset correction. - * - * param base LPADC peripheral base address. - * param enable switcher to the calibration function. - */ -void LPADC_EnableCalibration(ADC_Type *base, bool enable) -{ - LPADC_Enable(base, false); - if (enable) - { - base->CFG |= ADC_CFG_CALOFS_MASK; - } - else - { - base->CFG &= ~ADC_CFG_CALOFS_MASK; - } - LPADC_Enable(base, true); -} - -#if defined(FSL_FEATURE_LPADC_HAS_OFSTRIM) && FSL_FEATURE_LPADC_HAS_OFSTRIM -/*! - * brief Do auto calibration. - * - * Calibration function should be executed before using converter in application. It used the software trigger and a - * dummy conversion, get the offset and write them into the OFSTRIM register. It called some of functional API - * including: -LPADC_EnableCalibration(...) -LPADC_LPADC_SetOffsetValue(...) -LPADC_SetConvCommandConfig(...) - * -LPADC_SetConvTriggerConfig(...) - * - * param base LPADC peripheral base address. - */ -void LPADC_DoAutoCalibration(ADC_Type *base) -{ - assert(0u == LPADC_GetConvResultCount(base)); - - uint32_t mLpadcCMDL; - uint32_t mLpadcCMDH; - uint32_t mLpadcTrigger; - lpadc_conv_trigger_config_t mLpadcTriggerConfigStruct; - lpadc_conv_command_config_t mLpadcCommandConfigStruct; - lpadc_conv_result_t mLpadcResultConfigStruct; - - /* Enable the calibration function. */ - LPADC_EnableCalibration(base, true); - - /* Keep the CMD and TRG state here and restore it later if the calibration completes.*/ - mLpadcCMDL = base->CMD[0].CMDL; /* CMD1L. */ - mLpadcCMDH = base->CMD[0].CMDH; /* CMD1H. */ - mLpadcTrigger = base->TCTRL[0]; /* Trigger0. */ - - /* Set trigger0 configuration - for software trigger. */ - LPADC_GetDefaultConvTriggerConfig(&mLpadcTriggerConfigStruct); - mLpadcTriggerConfigStruct.targetCommandId = 1U; /* CMD1 is executed. */ - LPADC_SetConvTriggerConfig(base, 0U, &mLpadcTriggerConfigStruct); /* Configurate the trigger0. */ - - /* Set conversion CMD configuration. */ - LPADC_GetDefaultConvCommandConfig(&mLpadcCommandConfigStruct); - mLpadcCommandConfigStruct.hardwareAverageMode = kLPADC_HardwareAverageCount128; - LPADC_SetConvCommandConfig(base, 1U, &mLpadcCommandConfigStruct); /* Set CMD1 configuration. */ - - /* Do calibration. */ - LPADC_DoSoftwareTrigger(base, 1U); /* 1U is trigger0 mask. */ - while (!LPADC_GetConvResult(base, &mLpadcResultConfigStruct)) - { - } - /* The valid bits of data are bits 14:3 in the RESFIFO register. */ - LPADC_SetOffsetValue(base, (uint32_t)(mLpadcResultConfigStruct.convValue) >> 3UL); - /* Disable the calibration function. */ - LPADC_EnableCalibration(base, false); - - /* restore CMD and TRG registers. */ - base->CMD[0].CMDL = mLpadcCMDL; /* CMD1L. */ - base->CMD[0].CMDH = mLpadcCMDH; /* CMD1H. */ - base->TCTRL[0] = mLpadcTrigger; /* Trigger0. */ -} -#endif /* FSL_FEATURE_LPADC_HAS_OFSTRIM */ -#endif /* FSL_FEATURE_LPADC_HAS_CFG_CALOFS */ - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFS) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFS -/*! - * brief Do offset calibration. - * - * param base LPADC peripheral base address. - */ -void LPADC_DoOffsetCalibration(ADC_Type *base) -{ - LPADC_EnableOffsetCalibration(base, true); - while (ADC_STAT_CAL_RDY_MASK != (base->STAT & ADC_STAT_CAL_RDY_MASK)) - { - } -} - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ -/*! - * brief Do auto calibration. - * - * param base LPADC peripheral base address. - */ -void LPADC_DoAutoCalibration(ADC_Type *base) -{ - LPADC_PrepareAutoCalibration(base); - LPADC_FinishAutoCalibration(base); -} - -/*! - * brief Prepare auto calibration, LPADC_FinishAutoCalibration has to be called before using the LPADC. - * LPADC_DoAutoCalibration has been split in two API to avoid to be stuck too long in the function. - * - * param base LPADC peripheral base address. - */ -void LPADC_PrepareAutoCalibration(ADC_Type *base) -{ -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - assert((0U == LPADC_GetConvResultCount(base, 0)) && (0U == LPADC_GetConvResultCount(base, 1))); -#else /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 1)) */ - assert(LPADC_GetConvResultCount(base) == 0U); -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) */ - - /* Request gain calibration. */ - base->CTRL |= ADC_CTRL_CAL_REQ_MASK; -} - -/*! - * brief Finish auto calibration start with LPADC_PrepareAutoCalibration. - * - * param base LPADC peripheral base address. - */ -void LPADC_FinishAutoCalibration(ADC_Type *base) -{ -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE - int32_t GCCa; - int32_t GCCb; - float GCRa; - float GCRb; -#else - uint32_t GCCa; - float GCRa; -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - uint32_t GCCb; - float GCRb; -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE */ - - while ((ADC_GCC_RDY_MASK != (base->GCC[0] & ADC_GCC_RDY_MASK)) -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - || (ADC_GCC_RDY_MASK != (base->GCC[1] & ADC_GCC_RDY_MASK)) -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ - ) - { - } - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE - GCCa = (int32_t)(base->GCC[0] & ADC_GCC_GAIN_CAL_MASK); - GCCb = (int32_t)(base->GCC[1] & ADC_GCC_GAIN_CAL_MASK); - if (0U != ((base->GCC[0]) & 0x8000U)) - { - GCCa = GCCa - 0x10000; - GCRa = (float)((131072.0) / - (131072.0 - (double)GCCa)); /* Gain_CalA = (131072.0 / (131072-(ADC_GCC_GAIN_CAL(ADC->GCC[0]))*/ - base->GCR[0] = LPADC_GetGainConvResult(GCRa); /* write A side GCALR. */ - } - - if (0U != ((base->GCC[1]) & 0x8000U)) - { - GCCb = GCCb - 0x10000; - GCRb = (float)((131072.0) / - (131072.0 - (double)GCCb)); /* Gain_CalB = (131072.0 / (131072-(ADC_GCC_GAIN_CAL(ADC->GCC[1]))*/ - base->GCR[1] = LPADC_GetGainConvResult(GCRb); /* write B side GCALR. */ - } -#else - /* Calculate gain offset. */ - GCCa = (base->GCC[0] & ADC_GCC_GAIN_CAL_MASK); - GCRa = (float)((131072.0) / - (131072.0 - (double)GCCa)); /* Gain_CalA = (131072.0 / (131072-(ADC_GCC_GAIN_CAL(ADC->GCC[0]))*/ - base->GCR[0] = LPADC_GetGainConvResult(GCRa); /* write A side GCALR. */ - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - GCCb = (base->GCC[1] & ADC_GCC_GAIN_CAL_MASK); - GCRb = (float)((131072.0) / - (131072.0 - (double)GCCb)); /* Gain_CalB = (131072.0 / (131072-(ADC_GCC_GAIN_CAL(ADC->GCC[1]))*/ - base->GCR[1] = LPADC_GetGainConvResult(GCRb); /* write B side GCALR. */ -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE */ - /* Indicate the values are valid. */ - base->GCR[0] |= ADC_GCR_RDY_MASK; -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - base->GCR[1] |= ADC_GCR_RDY_MASK; -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ - - while (ADC_STAT_CAL_RDY_MASK != (base->STAT & ADC_STAT_CAL_RDY_MASK)) - { - } -} -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ */ - -/*! - * brief Get calibration value into the memory which is defined by invoker. - * - * note Please note the ADC will be disabled temporary. - * note This function should be used after finish calibration. - * - * param base LPADC peripheral base address. - * param ptrCalibrationValue Pointer to lpadc_calibration_value_t structure, this memory block should be always powered - * on even in low power modes. - */ -void LPADC_GetCalibrationValue(ADC_Type *base, lpadc_calibration_value_t *ptrCalibrationValue) -{ - assert(ptrCalibrationValue != NULL); - - bool adcEnabled = false; - - /* Check if ADC is enabled. */ - if ((base->CTRL & ADC_CTRL_ADCEN_MASK) != 0UL) - { - LPADC_Enable(base, false); - adcEnabled = true; - } - -#if (defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) - uint32_t i; - for (i = 0UL; i < 33UL; i++) - { -#if defined(ADC_CAL_GAR0_CAL_GAR_VAL_MASK) - ptrCalibrationValue->generalCalibrationValueA[i] = - (uint16_t)((*(((volatile uint32_t *)(&(base->CAL_GAR0))) + i)) & 0xFFFFU); -#if !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) - ptrCalibrationValue->generalCalibrationValueB[i] = - (uint16_t)((*(((volatile uint32_t *)(&(base->CAL_GBR0))) + i)) & 0xFFFFU); -#endif /* (defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) */ -#else - ptrCalibrationValue->generalCalibrationValueA[i] = - (uint16_t)((*(((volatile uint32_t *)(&(base->CAL_GAR[0]))) + i)) & 0xFFFFU); -#if !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) - ptrCalibrationValue->generalCalibrationValueB[i] = - (uint16_t)((*(((volatile uint32_t *)(&(base->CAL_GBR[0]))) + i)) & 0xFFFFU); -#endif /* (defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) */ - -#endif /* defined(ADC_CAL_GAR0_CAL_GAR_VAL_MASK) */ - } -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ */ - - ptrCalibrationValue->gainCalibrationResultA = (uint16_t)(base->GCR[0] & ADC_GCR_GCALR_MASK); -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - ptrCalibrationValue->gainCalibrationResultB = (uint16_t)(base->GCR[1] & ADC_GCR_GCALR_MASK); -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ - - if (adcEnabled) - { - LPADC_Enable(base, true); - } -} - -/*! - * brief Set calibration value into ADC calibration registers. - * - * note Please note the ADC will be disabled temporary. - * - * param base LPADC peripheral base address. - * param ptrCalibrationValue Pointer to lpadc_calibration_value_t structure which contains ADC's calibration value. - */ -void LPADC_SetCalibrationValue(ADC_Type *base, const lpadc_calibration_value_t *ptrCalibrationValue) -{ - assert(ptrCalibrationValue != NULL); - - bool adcEnabled = false; - - /* Check if ADC is enabled. */ - if ((base->CTRL & ADC_CTRL_ADCEN_MASK) != 0UL) - { - LPADC_Enable(base, false); - adcEnabled = true; - } - -#if (defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) - for (uint32_t i = 0UL; i < 33UL; i++) - { -#if defined(ADC_CAL_GAR0_CAL_GAR_VAL_MASK) - *(((volatile uint32_t *)(&(base->CAL_GAR0))) + i) = ptrCalibrationValue->generalCalibrationValueA[i]; -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - *(((volatile uint32_t *)(&(base->CAL_GBR0))) + i) = ptrCalibrationValue->generalCalibrationValueB[i]; -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ -#else - *(((volatile uint32_t *)(&(base->CAL_GAR[0]))) + i) = ptrCalibrationValue->generalCalibrationValueA[i]; -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - *(((volatile uint32_t *)(&(base->CAL_GBR[0]))) + i) = ptrCalibrationValue->generalCalibrationValueB[i]; -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ -#endif /* defined(ADC_CAL_GAR0_CAL_GAR_VAL_MASK) */ - } -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ */ - - base->GCR[0] = ADC_GCR_GCALR(ptrCalibrationValue->gainCalibrationResultA) | ADC_GCR_RDY_MASK; -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - base->GCR[1] = ADC_GCR_GCALR(ptrCalibrationValue->gainCalibrationResultB) | ADC_GCR_RDY_MASK; -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ - /* - * $Branch Coverage Justification$ - * while ((base->STAT & ADC_STAT_CAL_RDY_MASK) == ADC_STAT_CAL_RDY_MASK) not covered. Test unfeasible, - * the calibration ready state is too short not to catch. - */ - while (ADC_STAT_CAL_RDY_MASK != (base->STAT & ADC_STAT_CAL_RDY_MASK)) - { - } - - if (adcEnabled) - { - LPADC_Enable(base, true); - } -} - -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CALOFS */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpadc.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpadc.h deleted file mode 100644 index 5da00196871..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpadc.h +++ /dev/null @@ -1,1529 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LPADC_H_ -#define FSL_LPADC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup lpadc - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief LPADC driver version 2.8.4. */ -#define FSL_LPADC_DRIVER_VERSION (MAKE_VERSION(2, 8, 4)) -/*! @} */ - -#if (defined(FSL_FEATURE_LPADC_OFSTRIM_COUNT) && (FSL_FEATURE_LPADC_OFSTRIM_COUNT == 1)) -#define ADC_OFSTRIM_OFSTRIM_MAX (ADC_OFSTRIM_OFSTRIM_MASK >> ADC_OFSTRIM_OFSTRIM_SHIFT) -#define ADC_OFSTRIM_OFSTRIM_SIGN ((ADC_OFSTRIM_OFSTRIM_MAX + 1U) >> 1U) - -#elif (defined(FSL_FEATURE_LPADC_OFSTRIM_COUNT) && (FSL_FEATURE_LPADC_OFSTRIM_COUNT == 2)) -#define ADC_OFSTRIM_OFSTRIM_A_MAX (ADC_OFSTRIM_OFSTRIM_A_MASK >> ADC_OFSTRIM_OFSTRIM_A_SHIFT) -#define ADC_OFSTRIM_OFSTRIM_B_MAX (ADC_OFSTRIM_OFSTRIM_B_MASK >> ADC_OFSTRIM_OFSTRIM_B_SHIFT) -#define ADC_OFSTRIM_OFSTRIM_A_SIGN ((ADC_OFSTRIM_OFSTRIM_A_MAX + 1U) >> 1U) -#define ADC_OFSTRIM_OFSTRIM_B_SIGN ((ADC_OFSTRIM_OFSTRIM_B_MAX + 1U) >> 1U) -#endif /* defined(FSL_FEATURE_LPADC_OFSTRIM_COUNT) */ - -/*! - * @brief Define the MACRO function to get command status from status value. - * - * The statusVal is the return value from LPADC_GetStatusFlags(). - */ -#define LPADC_GET_ACTIVE_COMMAND_STATUS(statusVal) ((statusVal & ADC_STAT_CMDACT_MASK) >> ADC_STAT_CMDACT_SHIFT) - -/*! - * @brief Define the MACRO function to get trigger status from status value. - * - * The statusVal is the return value from LPADC_GetStatusFlags(). - */ -#define LPADC_GET_ACTIVE_TRIGGER_STATUE(statusVal) ((statusVal & ADC_STAT_TRGACT_MASK) >> ADC_STAT_TRGACT_SHIFT) - -/* Map macros to the unified name. */ -#if !defined(ADC_STAT_FOF0_MASK) -#ifdef ADC_STAT_FOF_MASK -#define ADC_STAT_FOF0_MASK ADC_STAT_FOF_MASK -#else -#error "ADC_STAT_FOF0_MASK not defined" -#endif /* ifdef(ADC_STAT_FOF_MASK) */ -#endif /* !defined(ADC_STAT_FOF0_MASK) */ - -#if !defined(ADC_STAT_RDY0_MASK) -#ifdef ADC_STAT_RDY_MASK -#define ADC_STAT_RDY0_MASK ADC_STAT_RDY_MASK -#else -#error "ADC_STAT_RDY0_MASK not defined" -#endif /* ifdef ADC_STAT_RDY_MASK */ -#endif /* !defined(ADC_STAT_RDY0_MASK) */ - -#if !defined(ADC_IE_FOFIE0_MASK) -#ifdef ADC_IE_FOFIE_MASK -#define ADC_IE_FOFIE0_MASK ADC_IE_FOFIE_MASK -#else -#error "ADC_IE_FOFIE0_MASK not defined" -#endif /* ifdef ADC_IE_FOFIE_MASK */ -#endif /* !defined(ADC_IE_FOFIE0_MASK) */ - -#if !defined(ADC_IE_FWMIE0_MASK) -#ifdef ADC_IE_FWMIE_MASK -#define ADC_IE_FWMIE0_MASK ADC_IE_FWMIE_MASK -#else -#error "ADC_IE_FWMIE0_MASK not defined" -#endif /* ifdef ADC_IE_FWMIE_MASK */ -#endif /* !defined(ADC_IE_FWMIE0_MASK) */ - -/*! - * @brief Define hardware flags of the module. - */ -enum _lpadc_status_flags -{ - kLPADC_ResultFIFO0OverflowFlag = ADC_STAT_FOF0_MASK, /*!< Indicates that more data has been written to the Result - FIFO 0 than it can hold. */ - kLPADC_ResultFIFO0ReadyFlag = ADC_STAT_RDY0_MASK, /*!< Indicates when the number of valid datawords in the result - FIFO 0 is greater than the setting watermark level. */ - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - kLPADC_ResultFIFO1OverflowFlag = ADC_STAT_FOF1_MASK, /*!< Indicates that more data has been written to the Result - FIFO 1 than it can hold. */ - kLPADC_ResultFIFO1ReadyFlag = ADC_STAT_RDY1_MASK, /*!< Indicates when the number of valid datawords in the result - FIFO 1 is greater than the setting watermark level. */ -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ - -#if (defined(FSL_FEATURE_LPADC_HAS_STAT_TEXC_INT) && (FSL_FEATURE_LPADC_HAS_STAT_TEXC_INT == 1U)) - kLPADC_TriggerExceptionFlag = ADC_STAT_TEXC_INT_MASK, /*!< Indicates that a trigger exception event has occurred. */ -#endif /* (defined(FSL_FEATURE_LPADC_HAS_STAT_TEXC_INT) && (FSL_FEATURE_LPADC_HAS_STAT_TEXC_INT == 1U)) */ - -#if (defined(FSL_FEATURE_LPADC_HAS_STAT_TCOMP_INT) && (FSL_FEATURE_LPADC_HAS_STAT_TCOMP_INT == 1U)) - kLPADC_TriggerCompletionFlag = ADC_STAT_TCOMP_INT_MASK, /*!< Indicates that a trigger completion event has occurred. - */ -#endif /* (defined(FSL_FEATURE_LPADC_HAS_STAT_TCOMP_INT) && (FSL_FEATURE_LPADC_HAS_STAT_TCOMP_INT == 1U)) */ - -#if (defined(FSL_FEATURE_LPADC_HAS_STAT_CAL_RDY) && (FSL_FEATURE_LPADC_HAS_STAT_CAL_RDY == 1U)) - kLPADC_CalibrationReadyFlag = ADC_STAT_CAL_RDY_MASK, /*!< Indicates that the calibration process is done. */ -#endif /* (defined(FSL_FEATURE_LPADC_HAS_STAT_CAL_RDY) && (FSL_FEATURE_LPADC_HAS_STAT_CAL_RDY == 1U)) */ - -#if (defined(FSL_FEATURE_LPADC_HAS_STAT_ADC_ACTIVE) && (FSL_FEATURE_LPADC_HAS_STAT_ADC_ACTIVE == 1U)) - kLPADC_ActiveFlag = ADC_STAT_ADC_ACTIVE_MASK, /*!< Indicates that the ADC is in active state. */ -#endif /* (defined(FSL_FEATURE_LPADC_HAS_STAT_ADC_ACTIVE) && (FSL_FEATURE_LPADC_HAS_STAT_ADC_ACTIVE == 1U)) */ - - kLPADC_ResultFIFOOverflowFlag = kLPADC_ResultFIFO0OverflowFlag, /*!< To compilitable with old version, do not - recommend using this, please use @ref - kLPADC_ResultFIFO0OverflowFlag as instead. */ - - kLPADC_ResultFIFOReadyFlag = kLPADC_ResultFIFO0ReadyFlag, /*!< To compilitable with old version, do not - recommend using this, please use @ref - kLPADC_ResultFIFO0ReadyFlag as instead. */ -}; - -/*! - * @brief Define interrupt switchers of the module. - * - * Note: LPADC of different chips supports different number of trigger sources, - * please check the Reference Manual for details. - */ -enum _lpadc_interrupt_enable -{ - kLPADC_ResultFIFO0OverflowInterruptEnable = ADC_IE_FOFIE0_MASK, /*!< Configures ADC to generate overflow interrupt - requests when FOF0 flag is asserted. */ - kLPADC_FIFO0WatermarkInterruptEnable = ADC_IE_FWMIE0_MASK, /*!< Configures ADC to generate watermark interrupt - requests when RDY0 flag is asserted. */ - kLPADC_ResultFIFOOverflowInterruptEnable = kLPADC_ResultFIFO0OverflowInterruptEnable, /*!< To compilitable with old - version, do not recommend using this, - please use - #kLPADC_ResultFIFO0OverflowInterruptEnable - as instead. */ - kLPADC_FIFOWatermarkInterruptEnable = kLPADC_FIFO0WatermarkInterruptEnable, /*!< To compilitable with old version, - do not recommend using this, please - use - #kLPADC_FIFO0WatermarkInterruptEnable - as instead. */ - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - kLPADC_ResultFIFO1OverflowInterruptEnable = ADC_IE_FOFIE1_MASK, /*!< Configures ADC to generate overflow interrupt - requests when FOF1 flag is asserted. */ - kLPADC_FIFO1WatermarkInterruptEnable = ADC_IE_FWMIE1_MASK, /*!< Configures ADC to generate watermark interrupt - requests when RDY1 flag is asserted. */ -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ - -#if (defined(FSL_FEATURE_LPADC_HAS_IE_TEXC_IE) && (FSL_FEATURE_LPADC_HAS_IE_TEXC_IE == 1U)) - kLPADC_TriggerExceptionInterruptEnable = ADC_IE_TEXC_IE_MASK, /*!< Configures ADC to generate trigger exception - interrupt. */ -#endif /* (defined(FSL_FEATURE_LPADC_HAS_IE_TEXC_IE) && (FSL_FEATURE_LPADC_HAS_IE_TEXC_IE == 1U)) */ - -#if (defined(FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE) && (FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE == 1U)) - kLPADC_Trigger0CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 0UL), /*!< Configures ADC to generate interrupt - when trigger 0 completion. */ - kLPADC_Trigger1CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 1UL), /*!< Configures ADC to generate interrupt - when trigger 1 completion. */ - kLPADC_Trigger2CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 2UL), /*!< Configures ADC to generate interrupt - when trigger 2 completion. */ - kLPADC_Trigger3CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 3UL), /*!< Configures ADC to generate interrupt - when trigger 3 completion. */ - kLPADC_Trigger4CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 4UL), /*!< Configures ADC to generate interrupt - when trigger 4 completion. */ - kLPADC_Trigger5CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 5UL), /*!< Configures ADC to generate interrupt - when trigger 5 completion. */ - kLPADC_Trigger6CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 6UL), /*!< Configures ADC to generate interrupt - when trigger 6 completion. */ - kLPADC_Trigger7CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 7UL), /*!< Configures ADC to generate interrupt - when trigger 7 completion. */ - kLPADC_Trigger8CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 8UL), /*!< Configures ADC to generate interrupt - when trigger 8 completion. */ - kLPADC_Trigger9CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 9UL), /*!< Configures ADC to generate interrupt - when trigger 9 completion. */ - kLPADC_Trigger10CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 10UL), /*!< Configures ADC to generate interrupt - when trigger 10 completion. */ - kLPADC_Trigger11CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 11UL), /*!< Configures ADC to generate interrupt - when trigger 11 completion. */ - kLPADC_Trigger12CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 12UL), /*!< Configures ADC to generate interrupt - when trigger 12 completion. */ - kLPADC_Trigger13CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 13UL), /*!< Configures ADC to generate interrupt - when trigger 13 completion. */ - kLPADC_Trigger14CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 14UL), /*!< Configures ADC to generate interrupt - when trigger 14 completion. */ - kLPADC_Trigger15CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 15UL), /*!< Configures ADC to generate interrupt - when trigger 15 completion. */ -#endif /* #if (defined(FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE) && (FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE == 1U)) */ -}; - -#if (defined(FSL_FEATURE_LPADC_HAS_TSTAT) && (FSL_FEATURE_LPADC_HAS_TSTAT)) -/*! - * @brief The enumerator of lpadc trigger status flags, including interrupted flags and completed flags. - * - * Note: LPADC of different chips supports different number of trigger sources, - * please check the Reference Manual for details. - */ -enum _lpadc_trigger_status_flags -{ - kLPADC_Trigger0InterruptedFlag = 1UL << 0UL, /*!< Trigger 0 is interrupted by a high priority exception. */ - kLPADC_Trigger1InterruptedFlag = 1UL << 1UL, /*!< Trigger 1 is interrupted by a high priority exception. */ - kLPADC_Trigger2InterruptedFlag = 1UL << 2UL, /*!< Trigger 2 is interrupted by a high priority exception. */ - kLPADC_Trigger3InterruptedFlag = 1UL << 3UL, /*!< Trigger 3 is interrupted by a high priority exception. */ - kLPADC_Trigger4InterruptedFlag = 1UL << 4UL, /*!< Trigger 4 is interrupted by a high priority exception. */ - kLPADC_Trigger5InterruptedFlag = 1UL << 5UL, /*!< Trigger 5 is interrupted by a high priority exception. */ - kLPADC_Trigger6InterruptedFlag = 1UL << 6UL, /*!< Trigger 6 is interrupted by a high priority exception. */ - kLPADC_Trigger7InterruptedFlag = 1UL << 7UL, /*!< Trigger 7 is interrupted by a high priority exception. */ - kLPADC_Trigger8InterruptedFlag = 1UL << 8UL, /*!< Trigger 8 is interrupted by a high priority exception. */ - kLPADC_Trigger9InterruptedFlag = 1UL << 9UL, /*!< Trigger 9 is interrupted by a high priority exception. */ - kLPADC_Trigger10InterruptedFlag = 1UL << 10UL, /*!< Trigger 10 is interrupted by a high priority exception. */ - kLPADC_Trigger11InterruptedFlag = 1UL << 11UL, /*!< Trigger 11 is interrupted by a high priority exception. */ - kLPADC_Trigger12InterruptedFlag = 1UL << 12UL, /*!< Trigger 12 is interrupted by a high priority exception. */ - kLPADC_Trigger13InterruptedFlag = 1UL << 13UL, /*!< Trigger 13 is interrupted by a high priority exception. */ - kLPADC_Trigger14InterruptedFlag = 1UL << 14UL, /*!< Trigger 14 is interrupted by a high priority exception. */ - kLPADC_Trigger15InterruptedFlag = 1UL << 15UL, /*!< Trigger 15 is interrupted by a high priority exception. */ - - kLPADC_Trigger0CompletedFlag = 1UL << 16UL, /*!< Trigger 0 is completed and - trigger 0 has enabled completion interrupts. */ - kLPADC_Trigger1CompletedFlag = 1UL << 17UL, /*!< Trigger 1 is completed and - trigger 1 has enabled completion interrupts. */ - kLPADC_Trigger2CompletedFlag = 1UL << 18UL, /*!< Trigger 2 is completed and - trigger 2 has enabled completion interrupts. */ - kLPADC_Trigger3CompletedFlag = 1UL << 19UL, /*!< Trigger 3 is completed and - trigger 3 has enabled completion interrupts. */ - kLPADC_Trigger4CompletedFlag = 1UL << 20UL, /*!< Trigger 4 is completed and - trigger 4 has enabled completion interrupts. */ - kLPADC_Trigger5CompletedFlag = 1UL << 21UL, /*!< Trigger 5 is completed and - trigger 5 has enabled completion interrupts. */ - kLPADC_Trigger6CompletedFlag = 1UL << 22UL, /*!< Trigger 6 is completed and - trigger 6 has enabled completion interrupts. */ - kLPADC_Trigger7CompletedFlag = 1UL << 23UL, /*!< Trigger 7 is completed and - trigger 7 has enabled completion interrupts. */ - kLPADC_Trigger8CompletedFlag = 1UL << 24UL, /*!< Trigger 8 is completed and - trigger 8 has enabled completion interrupts. */ - kLPADC_Trigger9CompletedFlag = 1UL << 25UL, /*!< Trigger 9 is completed and - trigger 9 has enabled completion interrupts. */ - kLPADC_Trigger10CompletedFlag = 1UL << 26UL, /*!< Trigger 10 is completed and - trigger 10 has enabled completion interrupts. */ - kLPADC_Trigger11CompletedFlag = 1UL << 27UL, /*!< Trigger 11 is completed and - trigger 11 has enabled completion interrupts. */ - kLPADC_Trigger12CompletedFlag = 1UL << 28UL, /*!< Trigger 12 is completed and - trigger 12 has enabled completion interrupts. */ - kLPADC_Trigger13CompletedFlag = 1UL << 29UL, /*!< Trigger 13 is completed and - trigger 13 has enabled completion interrupts. */ - kLPADC_Trigger14CompletedFlag = 1UL << 30UL, /*!< Trigger 14 is completed and - trigger 14 has enabled completion interrupts. */ - kLPADC_Trigger15CompletedFlag = 1UL << 31UL, /*!< Trigger 15 is completed and - trigger 15 has enabled completion interrupts. */ -}; -#endif /* (defined(FSL_FEATURE_LPADC_HAS_TSTAT) && (FSL_FEATURE_LPADC_HAS_TSTAT)) */ - -/*! - * @brief Define enumeration of sample scale mode. - * - * The sample scale mode is used to reduce the selected ADC analog channel input voltage level by a factor. The maximum - * possible voltage on the ADC channel input should be considered when selecting a scale mode to ensure that the - * reducing factor always results voltage level at or below the VREFH reference. This reducing capability allows - * conversion of analog inputs higher than VREFH. A-side and B-side channel inputs are both scaled using the scale mode. - */ -typedef enum _lpadc_sample_scale_mode -{ - kLPADC_SamplePartScale = 0U, /*!< Use divided input voltage signal. - (For scale select,please refer to the reference manual). */ - kLPADC_SampleFullScale = 1U, /*!< Full scale (Factor of 1). */ -} lpadc_sample_scale_mode_t; - -/*! - * @brief Define enumeration of channel sample mode. - * - * The channel sample mode configures the channel with single-end/differential/dual-single-end, side A/B. - */ -typedef enum _lpadc_sample_channel_mode -{ - kLPADC_SampleChannelSingleEndSideA = 0x0U, /*!< Single-end mode, only A-side channel is converted. */ -#if !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) - kLPADC_SampleChannelSingleEndSideB = 0x1U, /*!< Single-end mode, only B-side channel is converted. */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_DIFF) && FSL_FEATURE_LPADC_HAS_CMDL_DIFF - kLPADC_SampleChannelDiffBothSideAB = 0x2U, /*!< Differential mode, the ADC result is (CHnA-CHnB). */ - kLPADC_SampleChannelDiffBothSideBA = 0x3U, /*!< Differential mode, the ADC result is (CHnB-CHnA). */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CMDL_DIFF) && FSL_FEATURE_LPADC_HAS_CMDL_DIFF */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_CTYPE) && FSL_FEATURE_LPADC_HAS_CMDL_CTYPE - kLPADC_SampleChannelDiffBothSide = 0x02U, /*!< Differential mode, the ADC result is (CHnA-CHnB). */ - kLPADC_SampleChannelDualSingleEndBothSide = 0x03U, /*!< Dual-Single-Ended Mode. Both A side and B side - channels are converted independently. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CMDL_CTYPE) && FSL_FEATURE_LPADC_HAS_CMDL_CTYPE */ -#endif /* !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) */ -} lpadc_sample_channel_mode_t; - -/*! - * @brief Define enumeration of hardware average selection. - * - * It Selects how many ADC conversions are averaged to create the ADC result. An internal storage buffer is used to - * capture temporary results while the averaging iterations are executed. - * - * @note Some enumerator values are not available on some devices, mainly depends on the size of AVGS field in CMDH - * register. - */ -typedef enum _lpadc_hardware_average_mode -{ - kLPADC_HardwareAverageCount1 = 0U, /*!< Single conversion. */ - kLPADC_HardwareAverageCount2 = 1U, /*!< 2 conversions averaged. */ - kLPADC_HardwareAverageCount4 = 2U, /*!< 4 conversions averaged. */ - kLPADC_HardwareAverageCount8 = 3U, /*!< 8 conversions averaged. */ - kLPADC_HardwareAverageCount16 = 4U, /*!< 16 conversions averaged. */ - kLPADC_HardwareAverageCount32 = 5U, /*!< 32 conversions averaged. */ - kLPADC_HardwareAverageCount64 = 6U, /*!< 64 conversions averaged. */ - kLPADC_HardwareAverageCount128 = 7U, /*!< 128 conversions averaged. */ -#if (defined(FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH) && \ - (FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH == 4U)) - kLPADC_HardwareAverageCount256 = 8U, /*!< 256 conversions averaged. */ - kLPADC_HardwareAverageCount512 = 9U, /*!< 512 conversions averaged. */ - kLPADC_HardwareAverageCount1024 = 10U, /*!< 1024 conversions averaged. */ -#endif /* (defined(FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH) && \ - (FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH == 4U))*/ -} lpadc_hardware_average_mode_t; - -/*! - * @brief Define enumeration of sample time selection. - * - * The shortest sample time maximizes conversion speed for lower impedance inputs. Extending sample time allows higher - * impedance inputs to be accurately sampled. Longer sample times can also be used to lower overall power consumption - * when command looping and sequencing is configured and high conversion rates are not required. - */ -typedef enum _lpadc_sample_time_mode -{ - kLPADC_SampleTimeADCK3 = 0U, /*!< 3 ADCK cycles total sample time. */ - kLPADC_SampleTimeADCK5 = 1U, /*!< 5 ADCK cycles total sample time. */ - kLPADC_SampleTimeADCK7 = 2U, /*!< 7 ADCK cycles total sample time. */ - kLPADC_SampleTimeADCK11 = 3U, /*!< 11 ADCK cycles total sample time. */ - kLPADC_SampleTimeADCK19 = 4U, /*!< 19 ADCK cycles total sample time. */ - kLPADC_SampleTimeADCK35 = 5U, /*!< 35 ADCK cycles total sample time. */ - kLPADC_SampleTimeADCK67 = 6U, /*!< 69 ADCK cycles total sample time. */ - kLPADC_SampleTimeADCK131 = 7U, /*!< 131 ADCK cycles total sample time. */ -} lpadc_sample_time_mode_t; - -/*! - * @brief Define enumeration of hardware compare mode. - * - * After an ADC channel input is sampled and converted and any averaging iterations are performed, this mode setting - * guides operation of the automatic compare function to optionally only store when the compare operation is true. - * When compare is enabled, the conversion result is compared to the compare values. - */ -typedef enum _lpadc_hardware_compare_mode -{ - kLPADC_HardwareCompareDisabled = 0U, /*!< Compare disabled. */ - kLPADC_HardwareCompareStoreOnTrue = 2U, /*!< Compare enabled. Store on true. */ - kLPADC_HardwareCompareRepeatUntilTrue = 3U, /*!< Compare enabled. Repeat channel acquisition until true. */ -} lpadc_hardware_compare_mode_t; - -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_MODE) && FSL_FEATURE_LPADC_HAS_CMDL_MODE -/*! - * @brief Define enumeration of conversion resolution mode. - * - * Configure the resolution bit in specific conversion type. For detailed resolution accuracy, see to - * #lpadc_sample_channel_mode_t - */ -typedef enum _lpadc_conversion_resolution_mode -{ - kLPADC_ConversionResolutionStandard = 0U, /*!< Standard resolution. Single-ended 12-bit conversion, Differential - 13-bit conversion with 2's complement output. */ - kLPADC_ConversionResolutionHigh = 1U, /*!< High resolution. Single-ended 16-bit conversion; Differential 16-bit - conversion with 2's complement output. */ -} lpadc_conversion_resolution_mode_t; -#endif /* defined(FSL_FEATURE_LPADC_HAS_CMDL_MODE) && FSL_FEATURE_LPADC_HAS_CMDL_MODE */ - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS -/*! - * @brief Define enumeration of conversion averages mode. - * - * Configure the converion average number for auto-calibration. - * @note Some enumerator values are not available on some devices, mainly depends on the size of CAL_AVGS field in CTRL - * register. - */ -typedef enum _lpadc_conversion_average_mode -{ - kLPADC_ConversionAverage1 = 0U, /*!< Single conversion. */ - kLPADC_ConversionAverage2 = 1U, /*!< 2 conversions averaged. */ - kLPADC_ConversionAverage4 = 2U, /*!< 4 conversions averaged. */ - kLPADC_ConversionAverage8 = 3U, /*!< 8 conversions averaged. */ - kLPADC_ConversionAverage16 = 4U, /*!< 16 conversions averaged. */ - kLPADC_ConversionAverage32 = 5U, /*!< 32 conversions averaged. */ - kLPADC_ConversionAverage64 = 6U, /*!< 64 conversions averaged. */ - kLPADC_ConversionAverage128 = 7U, /*!< 128 conversions averaged. */ -#if (defined(FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH) && \ - (FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH == 4U)) - kLPADC_ConversionAverage256 = 8U, /*!< 256 conversions averaged. */ - kLPADC_ConversionAverage512 = 9U, /*!< 512 conversions averaged. */ - kLPADC_ConversionAverage1024 = 10U, /*!< 1024 conversions averaged. */ -#endif /* (defined(FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH) && \ - (FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH == 4U))*/ -} lpadc_conversion_average_mode_t; -#endif /* defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS */ - -/*! - * @brief Define enumeration of reference voltage source. - * - * For detail information, need to check the SoC's specification. - */ -typedef enum _lpadc_reference_voltage_mode -{ - kLPADC_ReferenceVoltageAlt1 = 0U, /*!< Option 1 setting. */ - kLPADC_ReferenceVoltageAlt2 = 1U, /*!< Option 2 setting. */ - kLPADC_ReferenceVoltageAlt3 = 2U, /*!< Option 3 setting. */ -} lpadc_reference_voltage_source_t; - -/*! - * @brief Define enumeration of power configuration. - * - * Configures the ADC for power and performance. In the highest power setting the highest conversion rates will be - * possible. Refer to the device data sheet for power and performance capabilities for each setting. - */ -typedef enum _lpadc_power_level_mode -{ - kLPADC_PowerLevelAlt1 = 0U, /*!< Lowest power setting. */ - kLPADC_PowerLevelAlt2 = 1U, /*!< Next lowest power setting. */ - kLPADC_PowerLevelAlt3 = 2U, /*!< ... */ - kLPADC_PowerLevelAlt4 = 3U, /*!< Highest power setting. */ -} lpadc_power_level_mode_t; - -#if (defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE) -/*! - * @brief Define enumeration of offset calibration mode. - * - */ -typedef enum _lpadc_offset_calibration_mode -{ - kLPADC_OffsetCalibration12bitMode = 0U, /*!< 12 bit offset calibration mode. */ - kLPADC_OffsetCalibration16bitMode = 1U, /*!< 16 bit offset calibration mode. */ -} lpadc_offset_calibration_mode_t; -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE */ - -/*! - * @brief Define enumeration of trigger priority policy. - * - * This selection controls how higher priority triggers are handled. - * @note \b kLPADC_TriggerPriorityPreemptSubsequently is not available on some devices, mainly depends on the size of - * TPRICTRL field in CFG register. - */ -typedef enum _lpadc_trigger_priority_policy -{ - kLPADC_ConvPreemptImmediatelyNotAutoResumed = 0x0U, /*!< If a higher priority trigger is detected during command - processing, the current conversion is aborted and the new - command specified by the trigger is started, when higher - priority conversion finishes, the preempted conversion is not - automatically resumed or restarted. */ - kLPADC_ConvPreemptSoftlyNotAutoResumed = 0x1U, /*!< If a higher priority trigger is received during command - processing, the current conversion is completed (including averaging - iterations and compare function if enabled) and stored to the result - FIFO before the higher priority trigger/command is initiated, when - higher priority conversion finishes, the preempted conversion is not - resumed or restarted. */ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES - kLPADC_ConvPreemptImmediatelyAutoRestarted = 0x4U, /*!< If a higher priority trigger is detected during command - processing, the current conversion is aborted and the new - command specified by the trigger is started, when higher - priority conversion finishes, the preempted conversion will - automatically be restarted. */ - kLPADC_ConvPreemptSoftlyAutoRestarted = 0x5U, /*!< If a higher priority trigger is received during command - processing, the current conversion is completed (including averaging - iterations and compare function if enabled) and stored to the result - FIFO before the higher priority trigger/command is initiated, when - higher priority conversion finishes, the preempted conversion will - automatically be restarted. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES */ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES - kLPADC_ConvPreemptImmediatelyAutoResumed = 0xCU, /*!< If a higher priority trigger is detected during command - processing, the current conversion is aborted and the new - command specified by the trigger is started, when higher - priority conversion finishes, the preempted conversion will - automatically be resumed. */ - kLPADC_ConvPreemptSoftlyAutoResumed = 0xDU, /*!< If a higher priority trigger is received during command - processing, the current conversion is completed (including averaging - iterations and compare function if enabled) and stored to the result - FIFO before the higher priority trigger/command is initiated, when - higher priority conversion finishes, the preempted conversion will - be automatically be resumed. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES */ - - kLPADC_TriggerPriorityPreemptImmediately = - kLPADC_ConvPreemptImmediatelyNotAutoResumed, /*!< Legacy support is not recommended as it only ensures - compatibility with older versions. */ - kLPADC_TriggerPriorityPreemptSoftly = - kLPADC_ConvPreemptSoftlyNotAutoResumed, /*!< Legacy support is not recommended as it only ensures compatibility - with older versions. */ - -#if (defined(FSL_FEATURE_LPADC_CFG_TPRICTRL_BITFIELD_WIDTH) && (FSL_FEATURE_LPADC_CFG_TPRICTRL_BITFIELD_WIDTH == 2U)) - kLPADC_ConvPreemptSubsequentlyNotAutoResumed = 0x2U, /*!< If a higher priority trigger is received during command - processing, the current command will be completed (averaging, - looping, compare) before servicing the higher priority trigger, when - higher priority conversion finishes, the preempted conversion will - not automatically be restarted or resumed. */ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES - kLPADC_ConvPreemptSubsequentlyAutoRestarted = 0x6U, /*!< If a higher priority trigger is received during command - processing, the current command will be completed (averaging, - looping, compare) before servicing the higher priority trigger, when - higher priority conversion finishes, the preempted conversion will - be automatically restarted. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES */ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES - kLPADC_ConvPreemptSubsequentlyAutoResumed = 0xEU, /*!< If a higher priority trigger is received during command - processing, the current command will be completed (averaging, - looping, compare) before servicing the higher priority trigger, when - higher priority conversion finishes, the preempted conversion will - be automatically resumed. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES */ - - kLPADC_TriggerPriorityPreemptSubsequently = - kLPADC_ConvPreemptSubsequentlyNotAutoResumed, /*!< Legacy support is not recommended as it only ensures - compatibility with older versions. */ -#endif /* #if (defined(FSL_FEATURE_LPADC_CFG_TPRICTRL_BITFIELD_WIDTH) && \ - (FSL_FEATURE_LPADC_CFG_TPRICTRL_BITFIELD_WIDTH == 2U)) */ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI) && FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI - kLPADC_TriggerPriorityExceptionDisabled = 0x10U, /*!< High priority trigger exception disabled. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI) && FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI */ -} lpadc_trigger_priority_policy_t; - -#if ((defined(FSL_FEATURE_LPADC_HAS_CTRL_CALHS)) && FSL_FEATURE_LPADC_HAS_CTRL_CALHS) -/*! - * @brief Define enumeration of tune value. - */ -typedef enum _lpadc_tune_value -{ - kLPADC_TuneValue0 = 0U, /*!< Tune value 0. */ - kLPADC_TuneValue1 = 1U, /*!< Tune value 1. */ - kLPADC_TuneValue2 = 2U, /*!< Tune value 2. */ - kLPADC_TuneValue3 = 3U, /*!< Tune value 3. */ -} lpadc_tune_value_t; -#endif /* ((defined(FSL_FEATURE_LPADC_HAS_CTRL_CALHS)) && FSL_FEATURE_LPADC_HAS_CTRL_CALHS) */ - -/*! - * @brief LPADC global configuration. - * - * This structure would used to keep the settings for initialization. - */ -typedef struct -{ -#if defined(FSL_FEATURE_LPADC_HAS_CFG_ADCKEN) && FSL_FEATURE_LPADC_HAS_CFG_ADCKEN - bool enableInternalClock; /*!< Enables the internally generated clock source. The clock source is used in clock - selection logic at the chip level and is optionally used for the ADC clock source. */ -#endif /* FSL_FEATURE_LPADC_HAS_CFG_ADCKEN */ -#if defined(FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG) && FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG - bool enableVref1LowVoltage; /*!< If voltage reference option1 input is below 1.8V, it should be "true". - If voltage reference option1 input is above 1.8V, it should be "false". */ -#endif /* FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG */ - bool enableInDozeMode; /*!< Control system transition to Stop and Wait power modes while ADC is converting. When - enabled in Doze mode, immediate entries to Wait or Stop are allowed. When disabled, the - ADC will wait for the current averaging iteration/FIFO storage to complete before - acknowledging stop or wait mode entry. */ -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS - lpadc_conversion_average_mode_t conversionAverageMode; /*!< Auto-Calibration Averages. */ -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS */ - bool enableAnalogPreliminary; /*!< ADC analog circuits are pre-enabled and ready to execute conversions without - startup delays(at the cost of higher DC current consumption). */ - uint32_t powerUpDelay; /*!< When the analog circuits are not pre-enabled, the ADC analog circuits are only powered - while the ADC is active and there is a counted delay defined by this field after an - initial trigger transitions the ADC from its Idle state to allow time for the analog - circuits to stabilize. The startup delay count of (powerUpDelay * 4) ADCK cycles must - result in a longer delay than the analog startup time. */ - lpadc_reference_voltage_source_t referenceVoltageSource; /*!< Selects the voltage reference high used for - conversions.*/ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_PWRSEL) && (FSL_FEATURE_LPADC_HAS_CFG_PWRSEL == 1U) - lpadc_power_level_mode_t powerLevelMode; /*!< Power Configuration Selection. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_PWRSEL) && (FSL_FEATURE_LPADC_HAS_CFG_PWRSEL == 1U) */ - lpadc_trigger_priority_policy_t triggerPriorityPolicy; /*!< Control how higher priority triggers are handled, see to - lpadc_trigger_priority_policy_t. */ - bool enableConvPause; /*!< Enables the ADC pausing function. When enabled, a programmable delay is inserted during - command execution sequencing between LOOP iterations, between commands in a sequence, and - between conversions when command is executing in "Compare Until True" configuration. */ - uint32_t convPauseDelay; /*!< Controls the duration of pausing during command execution sequencing. The pause delay - is a count of (convPauseDelay*4) ADCK cycles. Only available when ADC pausing - function is enabled. The available value range is in 9-bit. */ -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - /* for FIFO0. */ - uint32_t FIFO0Watermark; /*!< FIFO0Watermark is a programmable threshold setting. When the number of datawords - stored in the ADC Result FIFO0 is greater than the value in this field, the ready flag - would be asserted to indicate stored data has reached the programmable threshold. */ - /* for FIFO1. */ - uint32_t FIFO1Watermark; /*!< FIFO1Watermark is a programmable threshold setting. When the number of datawords - stored in the ADC Result FIFO1 is greater than the value in this field, the ready flag - would be asserted to indicate stored data has reached the programmable threshold. */ -#else - /* for FIFO. */ - uint32_t FIFOWatermark; /*!< FIFOWatermark is a programmable threshold setting. When the number of datawords stored - in the ADC Result FIFO is greater than the value in this field, the ready flag would be - asserted to indicate stored data has reached the programmable threshold. */ -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ -#if (defined(FSL_FEATURE_LPADC_HAS_TSTAT) && (FSL_FEATURE_LPADC_HAS_TSTAT)) - -#endif /* FSL_FEATURE_LPADC_HAS_TSTAT */ -} lpadc_config_t; - -/*! - * @brief Define structure to keep the configuration for conversion command. - */ -typedef struct -{ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_CSCALE) && FSL_FEATURE_LPADC_HAS_CMDL_CSCALE - lpadc_sample_scale_mode_t sampleScaleMode; /*!< Sample scale mode. */ -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_CSCALE */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE) && FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE - lpadc_sample_scale_mode_t channelBScaleMode; /*!< Alternate channe B Scale mode. */ -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE */ - lpadc_sample_channel_mode_t sampleChannelMode; /*!< Channel sample mode. */ - uint32_t channelNumber; /*!< Channel number, select the channel or channel pair. */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTB_ADCH) && FSL_FEATURE_LPADC_HAS_CMDL_ALTB_ADCH - uint32_t channelBNumber; /*!< Alternate Channel B number, select the channel. */ -#endif - uint32_t chainedNextCommandNumber; /*!< Selects the next command to be executed after this command completes. - 1-15 is available, 0 is to terminate the chain after this command. */ - bool enableAutoChannelIncrement; /*!< Loop with increment: when disabled, the "loopCount" field selects the number - of times the selected channel is converted consecutively; when enabled, the - "loopCount" field defines how many consecutive channels are converted as part - of the command execution. */ - uint32_t loopCount; /*!< Selects how many times this command executes before finish and transition to the next - command or Idle state. Command executes LOOP+1 times. 0-15 is available. */ - lpadc_hardware_average_mode_t hardwareAverageMode; /*!< Hardware average selection. */ - lpadc_sample_time_mode_t sampleTimeMode; /*!< Sample time selection. */ - - lpadc_hardware_compare_mode_t hardwareCompareMode; /*!< Hardware compare selection. */ - uint32_t hardwareCompareValueHigh; /*!< Compare Value High. The available value range is in 16-bit. */ - uint32_t hardwareCompareValueLow; /*!< Compare Value Low. The available value range is in 16-bit. */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_MODE) && FSL_FEATURE_LPADC_HAS_CMDL_MODE - lpadc_conversion_resolution_mode_t conversionResolutionMode; /*!< Conversion resolution mode. */ -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_MODE */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG) && FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG - bool enableWaitTrigger; /*!< Wait for trigger assertion before execution: when disabled, this command will be - automatically executed; when enabled, the active trigger must be asserted again before - executing this command. */ -#endif /* FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN) && FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN - bool enableChannelB; /*! Enable alternate Channel B */ -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN */ -} lpadc_conv_command_config_t; - -/*! - * @brief Define structure to keep the configuration for conversion trigger. - */ -typedef struct -{ - uint32_t targetCommandId; /*!< Select the command from command buffer to execute upon detect of the associated - trigger event. */ - uint32_t delayPower; /*!< Select the trigger delay duration to wait at the start of servicing a trigger event. - When this field is clear, then no delay is incurred. When this field is set to a non-zero - value, the duration for the delay is 2^delayPower ADCK cycles. The available value range - is 4-bit. */ - uint32_t priority; /*!< Sets the priority of the associated trigger source. If two or more triggers have the same - priority level setting, the lower order trigger event has the higher priority. The lower - value for this field is for the higher priority, the available value range is 1-bit. */ -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - uint8_t channelAFIFOSelect; /* SAR Result Destination For Channel A. */ - uint8_t channelBFIFOSelect; /* SAR Result Destination For Channel B. */ -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ - bool enableHardwareTrigger; /*!< Enable hardware trigger source to initiate conversion on the rising edge of the - input trigger source or not. THe software trigger is always available. */ -} lpadc_conv_trigger_config_t; - -/*! - * @brief Define the structure to keep the conversion result. - */ -typedef struct -{ - uint32_t commandIdSource; /*!< Indicate the command buffer being executed that generated this result. */ - uint32_t loopCountIndex; /*!< Indicate the loop count value during command execution that generated this result. */ - uint32_t triggerIdSource; /*!< Indicate the trigger source that initiated a conversion and generated this result. */ - uint16_t convValue; /*!< Data result. */ -} lpadc_conv_result_t; - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFS) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFS -/*! - * @brief A structure of calibration value. - */ -typedef struct _lpadc_calibration_value -{ - /* gain calibration result. */ - uint16_t gainCalibrationResultA; -#if !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) - uint16_t gainCalibrationResultB; -#endif /* !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) */ -#if (defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) - /* general calibration value. */ - uint16_t generalCalibrationValueA[33U]; -#if !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) - uint16_t generalCalibrationValueB[33U]; -#endif /* !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) */ -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ */ -} lpadc_calibration_value_t; -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CALOFS */ - -#if defined(__cplusplus) -extern "C" { -#endif - -/******************************************************************************* - * API - ******************************************************************************/ -/*! - * @name Initialization & de-initialization. - * @{ - */ - -/*! - * @brief Initializes the LPADC module. - * - * @param base LPADC peripheral base address. - * @param config Pointer to configuration structure. See "lpadc_config_t". - */ -void LPADC_Init(ADC_Type *base, const lpadc_config_t *config); - -/*! - * @brief Gets an available pre-defined settings for initial configuration. - * - * This function initializes the converter configuration structure with an available settings. The default values are: - * @code - * config->enableInDozeMode = true; - * config->enableAnalogPreliminary = false; - * config->powerUpDelay = 0x80; - * config->referenceVoltageSource = kLPADC_ReferenceVoltageAlt1; - * config->powerLevelMode = kLPADC_PowerLevelAlt1; - * config->triggerPriorityPolicy = kLPADC_TriggerPriorityPreemptImmediately; - * config->enableConvPause = false; - * config->convPauseDelay = 0U; - * config->FIFOWatermark = 0U; - * @endcode - * @param config Pointer to configuration structure. - */ -void LPADC_GetDefaultConfig(lpadc_config_t *config); - -/*! - * @brief De-initializes the LPADC module. - * - * @param base LPADC peripheral base address. - */ -void LPADC_Deinit(ADC_Type *base); - -/*! - * @brief Switch on/off the LPADC module. - * - * @param base LPADC peripheral base address. - * @param enable switcher to the module. - */ -static inline void LPADC_Enable(ADC_Type *base, bool enable) -{ - if (enable) - { - base->CTRL |= ADC_CTRL_ADCEN_MASK; - } - else - { - base->CTRL &= ~ADC_CTRL_ADCEN_MASK; - } -} - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) -/*! - * @brief Do reset the conversion FIFO0. - * - * @param base LPADC peripheral base address. - */ -static inline void LPADC_DoResetFIFO0(ADC_Type *base) -{ - base->CTRL |= ADC_CTRL_RSTFIFO0_MASK; -} - -/*! - * @brief Do reset the conversion FIFO1. - * - * @param base LPADC peripheral base address. - */ -static inline void LPADC_DoResetFIFO1(ADC_Type *base) -{ - base->CTRL |= ADC_CTRL_RSTFIFO1_MASK; -} -#else - -#if defined(ADC_CTRL_RSTFIFO0_MASK) -#define ADC_CTRL_RSTFIFO_MASK ADC_CTRL_RSTFIFO0_MASK -#endif /* defined(ADC_CTRL_RSTFIFO0_MASK) */ -/*! - * @brief Do reset the conversion FIFO. - * - * @param base LPADC peripheral base address. - */ -static inline void LPADC_DoResetFIFO(ADC_Type *base) -{ - base->CTRL |= ADC_CTRL_RSTFIFO_MASK; -} -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ - -/*! - * @brief Do reset the module's configuration. - * - * Reset all ADC internal logic and registers, except the Control Register (ADCx_CTRL). - * - * @param base LPADC peripheral base address. - */ -static inline void LPADC_DoResetConfig(ADC_Type *base) -{ - base->CTRL |= ADC_CTRL_RST_MASK; - base->CTRL &= ~ADC_CTRL_RST_MASK; -} - -/* @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Get status flags. - * - * @param base LPADC peripheral base address. - * @return status flags' mask. See to #_lpadc_status_flags. - */ -static inline uint32_t LPADC_GetStatusFlags(ADC_Type *base) -{ - return base->STAT; -} - -/*! - * @brief Clear status flags. - * - * Only the flags can be cleared by writing ADCx_STATUS register would be cleared by this API. - * - * @param base LPADC peripheral base address. - * @param mask Mask value for flags to be cleared. See to #_lpadc_status_flags. - */ -static inline void LPADC_ClearStatusFlags(ADC_Type *base, uint32_t mask) -{ - base->STAT = mask; -} - -#if (defined(FSL_FEATURE_LPADC_HAS_TSTAT) && FSL_FEATURE_LPADC_HAS_TSTAT) -/*! - * @brief Get trigger status flags to indicate which trigger sequences have been completed or interrupted by a high - * priority trigger exception. - * - * @param base LPADC peripheral base address. - * @return The OR'ed value of @ref _lpadc_trigger_status_flags. - */ -static inline uint32_t LPADC_GetTriggerStatusFlags(ADC_Type *base) -{ - return base->TSTAT; -} - -/*! - * @brief Clear trigger status flags. - * - * @param base LPADC peripheral base address. - * @param mask The mask of trigger status flags to be cleared, should be the - * OR'ed value of @ref _lpadc_trigger_status_flags. - */ -static inline void LPADC_ClearTriggerStatusFlags(ADC_Type *base, uint32_t mask) -{ - /* This assert used to avoid user use doesn't supported trigger sources. */ - assert(((mask & 0xFFFFU) == (mask & ADC_TSTAT_TEXC_NUM_MASK)) && - ((mask & 0xFFFF0000U) == (mask & ADC_TSTAT_TCOMP_FLAG_MASK))); - base->TSTAT = mask; -} -#endif /* (defined(FSL_FEATURE_LPADC_HAS_TSTAT) && FSL_FEATURE_LPADC_HAS_TSTAT) */ - -/* @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enable interrupts. - * - * @param base LPADC peripheral base address. - * @param mask Mask value for interrupt events. See to #_lpadc_interrupt_enable. - */ -static inline void LPADC_EnableInterrupts(ADC_Type *base, uint32_t mask) -{ -#if (defined(FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE) && (FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE == 1U)) - /* This assert used to avoid user use doesn't supported trigger sources. */ - assert((mask <= 0xFFFFU) || ((mask & 0xFFFF0000U) == (mask & ADC_IE_TCOMP_IE_MASK))); -#endif /* #if (defined(FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE) && (FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE == 1U)) */ - base->IE |= mask; -} - -/*! - * @brief Disable interrupts. - * - * @param base LPADC peripheral base address. - * @param mask Mask value for interrupt events. See to #_lpadc_interrupt_enable. - */ -static inline void LPADC_DisableInterrupts(ADC_Type *base, uint32_t mask) -{ -#if (defined(FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE) && (FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE == 1U)) - /* This assert used to avoid user use doesn't supported trigger sources. */ - assert((mask <= 0xFFFFU) || ((mask & 0xFFFF0000U) == (mask & ADC_IE_TCOMP_IE_MASK))); -#endif /* #if (defined(FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE) && (FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE == 1U)) */ - base->IE &= ~mask; -} - -/*! - * @name DMA Control - * @{ - */ - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) -/*! - * @brief Switch on/off the DMA trigger for FIFO0 watermark event. - * - * @param base LPADC peripheral base address. - * @param enable Switcher to the event. - */ -static inline void LPADC_EnableFIFO0WatermarkDMA(ADC_Type *base, bool enable) -{ - if (enable) - { - base->DE |= ADC_DE_FWMDE0_MASK; - } - else - { - base->DE &= ~ADC_DE_FWMDE0_MASK; - } -} - -/*! - * @brief Switch on/off the DMA trigger for FIFO1 watermark event. - * - * @param base LPADC peripheral base address. - * @param enable Switcher to the event. - */ -static inline void LPADC_EnableFIFO1WatermarkDMA(ADC_Type *base, bool enable) -{ - if (enable) - { - base->DE |= ADC_DE_FWMDE1_MASK; - } - else - { - base->DE &= ~ADC_DE_FWMDE1_MASK; - } -} -#else -#if defined(ADC_DE_FWMDE0_MASK) -#define ADC_DE_FWMDE_MASK ADC_DE_FWMDE0_MASK -#endif /* defined(ADC_DE_FWMDE0_MASK) */ -/*! - * @brief Switch on/off the DMA trigger for FIFO watermark event. - * - * @param base LPADC peripheral base address. - * @param enable Switcher to the event. - */ -static inline void LPADC_EnableFIFOWatermarkDMA(ADC_Type *base, bool enable) -{ - if (enable) - { - base->DE |= ADC_DE_FWMDE_MASK; - } - else - { - base->DE &= ~ADC_DE_FWMDE_MASK; - } -} -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) */ -/* @} */ - -/*! - * @name Trigger and conversion with FIFO. - * @{ - */ - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) -/*! - * @brief Get the count of result kept in conversion FIFOn. - * - * @param base LPADC peripheral base address. - * @param index Result FIFO index. - * @return The count of result kept in conversion FIFOn. - */ -static inline uint32_t LPADC_GetConvResultCount(ADC_Type *base, uint8_t index) -{ - return (ADC_FCTRL_FCOUNT_MASK & base->FCTRL[index]) >> ADC_FCTRL_FCOUNT_SHIFT; -} - -/*! - * @brief Get the result in conversion FIFOn. - * - * @param base LPADC peripheral base address. - * @param result Pointer to structure variable that keeps the conversion result in conversion FIFOn. - * @param index Result FIFO index. - * - * @return Status whether FIFOn entry is valid. - */ -bool LPADC_GetConvResult(ADC_Type *base, lpadc_conv_result_t *result, uint8_t index); - -/*! - * @brief Get the result in conversion FIFOn using blocking method. - * - * @param base LPADC peripheral base address. - * @param result Pointer to structure variable that keeps the conversion result in conversion FIFOn. - * @param index Result FIFO index. - */ -void LPADC_GetConvResultBlocking(ADC_Type *base, lpadc_conv_result_t *result, uint8_t index); -#else /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 1)) */ -/*! - * @brief Get the count of result kept in conversion FIFO. - * - * @param base LPADC peripheral base address. - * @return The count of result kept in conversion FIFO. - */ -static inline uint32_t LPADC_GetConvResultCount(ADC_Type *base) -{ - return (ADC_FCTRL_FCOUNT_MASK & base->FCTRL) >> ADC_FCTRL_FCOUNT_SHIFT; -} - -/*! - * @brief Get the result in conversion FIFO. - * - * @param base LPADC peripheral base address. - * @param result Pointer to structure variable that keeps the conversion result in conversion FIFO. - * - * @return Status whether FIFO entry is valid. - */ -bool LPADC_GetConvResult(ADC_Type *base, lpadc_conv_result_t *result); - -/*! - * @brief Get the result in conversion FIFO using blocking method. - * - * @param base LPADC peripheral base address. - * @param result Pointer to structure variable that keeps the conversion result in conversion FIFO. - */ -void LPADC_GetConvResultBlocking(ADC_Type *base, lpadc_conv_result_t *result); -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) */ - -/*! - * @brief Configure the conversion trigger source. - * - * Each programmable trigger can launch the conversion command in command buffer. - * - * @param base LPADC peripheral base address. - * @param triggerId ID for each trigger. Typically, the available value range is from 0. - * @param config Pointer to configuration structure. See to #lpadc_conv_trigger_config_t. - */ -void LPADC_SetConvTriggerConfig(ADC_Type *base, uint32_t triggerId, const lpadc_conv_trigger_config_t *config); - -/*! - * @brief Gets an available pre-defined settings for trigger's configuration. - * - * This function initializes the trigger's configuration structure with an available settings. The default values are: - * @code - * config->targetCommandId = 0U; - * config->delayPower = 0U; - * config->priority = 0U; - * config->channelAFIFOSelect = 0U; - * config->channelBFIFOSelect = 0U; - * config->enableHardwareTrigger = false; - * @endcode - * @param config Pointer to configuration structure. - */ -void LPADC_GetDefaultConvTriggerConfig(lpadc_conv_trigger_config_t *config); - -/*! - * @brief Do software trigger to conversion command. - * - * @param base LPADC peripheral base address. - * @param triggerIdMask Mask value for software trigger indexes, which count from zero. - */ -static inline void LPADC_DoSoftwareTrigger(ADC_Type *base, uint32_t triggerIdMask) -{ - /* Writes to ADCx_SWTRIG register are ignored while ADCx_CTRL[ADCEN] is clear. */ - base->SWTRIG = triggerIdMask; -} - -#if defined(FSL_FEATURE_LPADC_HAS_TCTRL_CMD_SEL) && FSL_FEATURE_LPADC_HAS_TCTRL_CMD_SEL -/*! - * @brief Enable hardware trigger command selection. - * - * This function will use the hardware trigger command from ADC_ETC.The trigger command is then defined - * by ADC hardware trigger command selection field in ADC_ETC- >TRIGx_CHAINy_z_n[CSEL]. - * - * @param base LPADC peripheral base address. - * @param triggerId ID for each trigger. Typically, the available value range is from 0. - * @param enable True to enable or flase to disable. - */ -static inline void LPADC_EnableHardwareTriggerCommandSelection(ADC_Type *base, uint32_t triggerId, bool enable) -{ - if (enable) - { - base->TCTRL[triggerId] |= ADC_TCTRL_CMD_SEL_MASK; - } - else - { - base->TCTRL[triggerId] &= ~ADC_TCTRL_CMD_SEL_MASK; - } -} -#endif /* defined(FSL_FEATURE_LPADC_HAS_TCTRL_CMD_SEL) && FSL_FEATURE_LPADC_HAS_TCTRL_CMD_SEL*/ - -/*! - * @brief Configure conversion command. - - * @note The number of compare value register on different chips is different, that is mean in some chips, some - * command buffers do not have the compare functionality. - * - * @param base LPADC peripheral base address. - * @param commandId ID for command in command buffer. Typically, the available value range is 1 - 15. - * @param config Pointer to configuration structure. See to #lpadc_conv_command_config_t. - */ -void LPADC_SetConvCommandConfig(ADC_Type *base, uint32_t commandId, const lpadc_conv_command_config_t *config); - -/*! - * @brief Gets an available pre-defined settings for conversion command's configuration. - * - * This function initializes the conversion command's configuration structure with an available settings. The default - * values are: - * @code - * config->sampleScaleMode = kLPADC_SampleFullScale; - * config->channelBScaleMode = kLPADC_SampleFullScale; - * config->sampleChannelMode = kLPADC_SampleChannelSingleEndSideA; - * config->channelNumber = 0U; - * config->channelBNumber = 0U; - * config->chainedNextCommandNumber = 0U; - * config->enableAutoChannelIncrement = false; - * config->loopCount = 0U; - * config->hardwareAverageMode = kLPADC_HardwareAverageCount1; - * config->sampleTimeMode = kLPADC_SampleTimeADCK3; - * config->hardwareCompareMode = kLPADC_HardwareCompareDisabled; - * config->hardwareCompareValueHigh = 0U; - * config->hardwareCompareValueLow = 0U; - * config->conversionResolutionMode = kLPADC_ConversionResolutionStandard; - * config->enableWaitTrigger = false; - * config->enableChannelB = false; - * @endcode - * @param config Pointer to configuration structure. - */ -void LPADC_GetDefaultConvCommandConfig(lpadc_conv_command_config_t *config); - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_CALOFS) && FSL_FEATURE_LPADC_HAS_CFG_CALOFS -/*! - * @brief Enable the calibration function. - * - * When CALOFS is set, the ADC is configured to perform a calibration function anytime the ADC executes - * a conversion. Any channel selected is ignored and the value returned in the RESFIFO is a signed value - * between -31 and 31. -32 is not a valid and is never a returned value. Software should copy the lower 6- - * bits of the conversion result stored in the RESFIFO after a completed calibration conversion to the - * OFSTRIM field. The OFSTRIM field is used in normal operation for offset correction. - * - * @param base LPADC peripheral base address. - * @param enable switcher to the calibration function. - */ -void LPADC_EnableCalibration(ADC_Type *base, bool enable); -#if defined(FSL_FEATURE_LPADC_HAS_OFSTRIM) && FSL_FEATURE_LPADC_HAS_OFSTRIM -/*! - * @brief Set proper offset value to trim ADC. - * - * To minimize the offset during normal operation, software should read the conversion result from - * the RESFIFO calibration operation and write the lower 6 bits to the OFSTRIM register. - * - * @param base LPADC peripheral base address. - * @param value Setting offset value. - */ -static inline void LPADC_SetOffsetValue(ADC_Type *base, uint32_t value) -{ - base->OFSTRIM = (value & ADC_OFSTRIM_OFSTRIM_MASK) >> ADC_OFSTRIM_OFSTRIM_SHIFT; -} - -/*! - * @brief Do auto calibration. - * - * Calibration function should be executed before using converter in application. It used the software trigger and a - * dummy conversion, get the offset and write them into the OFSTRIM register. It called some of functional API - * including: -LPADC_EnableCalibration(...) -LPADC_LPADC_SetOffsetValue(...) -LPADC_SetConvCommandConfig(...) - * -LPADC_SetConvTriggerConfig(...) - * - * @param base LPADC peripheral base address. - */ -void LPADC_DoAutoCalibration(ADC_Type *base); -#endif /* defined(FSL_FEATURE_LPADC_HAS_OFSTRIM) && FSL_FEATURE_LPADC_HAS_OFSTRIM */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_CALOFS) && FSL_FEATURE_LPADC_HAS_CFG_CALOFS */ - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFS) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFS -#if defined(FSL_FEATURE_LPADC_HAS_OFSTRIM) && FSL_FEATURE_LPADC_HAS_OFSTRIM -#if defined(FSL_FEATURE_LPADC_OFSTRIM_COUNT) && (FSL_FEATURE_LPADC_OFSTRIM_COUNT == 1U) -/*! - * @brief Set trim value for offset. - * - * @note For 16-bit conversions, each increment is 1/2 LSB resulting in a programmable offset range of -256 LSB to 255.5 - * LSB; For 12-bit conversions, each increment is 1/32 LSB resulting in a programmable offset range of -16 LSB to - * 15.96875 LSB. - * - * @param base LPADC peripheral base address. - * @param value Offset trim value, is a 10-bit signed value between -512 and 511. - */ -static inline void LPADC_SetOffsetValue(ADC_Type *base, int16_t value) -{ - base->OFSTRIM = ADC_OFSTRIM_OFSTRIM(value); -} - -/*! - * @brief Get trim value of offset. - * - * @param base LPADC peripheral base address. - * @param pValue Pointer to the variable in type of int16_t to store offset value. - */ -static inline void LPADC_GetOffsetValue(ADC_Type *base, int16_t *pValue) -{ - assert(pValue != NULL); - - uint16_t ofstrim = (uint16_t)((base->OFSTRIM & (ADC_OFSTRIM_OFSTRIM_MASK)) >> ADC_OFSTRIM_OFSTRIM_SHIFT); - - if ((ofstrim & ADC_OFSTRIM_OFSTRIM_SIGN) != 0U) - { - /* If the sign bit is set, then set the other MSB. */ - ofstrim |= (uint16_t)(~ADC_OFSTRIM_OFSTRIM_MAX); - } - - *pValue = (int16_t)ofstrim; -} -#elif (defined(FSL_FEATURE_LPADC_OFSTRIM_COUNT) && (FSL_FEATURE_LPADC_OFSTRIM_COUNT == 2U)) -/*! - * @brief Set proper offset value to trim ADC. - * - * Set the offset trim value for offset calibration manually. - * - * @param base LPADC peripheral base address. - * @param valueA Setting offset value A. - * @param valueB Setting offset value B. - * @note In normal adc sequence, the values are automatically calculated by LPADC_EnableOffsetCalibration. - */ -static inline void LPADC_SetOffsetValue(ADC_Type *base, int32_t valueA, int32_t valueB) -{ - base->OFSTRIM = ADC_OFSTRIM_OFSTRIM_A(valueA) | ADC_OFSTRIM_OFSTRIM_B(valueB); -} - -/*! - * @brief Get trim value of offset. - * - * @param base LPADC peripheral base address. - * @param pValueA Pointer to the variable in type of int32_t to store offset A value. - * @param pValueB Pointer to the variable in type of int32_t to store offset B value. - */ -static inline void LPADC_GetOffsetValue(ADC_Type *base, int32_t *pValueA, int32_t *pValueB) -{ - assert(pValueA != NULL); - assert(pValueB != NULL); - - uint32_t ofstrimA = (base->OFSTRIM & (ADC_OFSTRIM_OFSTRIM_A_MASK)) >> ADC_OFSTRIM_OFSTRIM_A_SHIFT; - uint32_t ofstrimB = (base->OFSTRIM & (ADC_OFSTRIM_OFSTRIM_B_MASK)) >> ADC_OFSTRIM_OFSTRIM_B_SHIFT; - - if ((ofstrimA & ADC_OFSTRIM_OFSTRIM_A_SIGN) != 0U) - { - /* If the sign bit is set, then set the other MSB. */ - ofstrimA |= (~ADC_OFSTRIM_OFSTRIM_A_MAX); - } - if ((ofstrimB & ADC_OFSTRIM_OFSTRIM_B_SIGN) != 0U) - { - /* If the sign bit is set, then set the other MSB. */ - ofstrimB |= (~ADC_OFSTRIM_OFSTRIM_B_MAX); - } - - *pValueA = (int32_t)ofstrimA; - *pValueB = (int32_t)ofstrimB; -} -#endif /* defined(FSL_FEATURE_LPADC_OFSTRIM_COUNT) */ -#else /* !(defined(FSL_FEATURE_LPADC_HAS_OFSTRIM) && FSL_FEATURE_LPADC_HAS_OFSTRIM) */ -/*! - * @brief Set proper offset value to trim 12 bit ADC conversion. - * - * Set the offset trim value for offset calibration manually. - * - * @param base LPADC peripheral base address. - * @param valueA Setting offset value A. - * @param valueB Setting offset value B. - * @note In normal adc sequence, the values are automatically calculated by LPADC_EnableOffsetCalibration. - */ -static inline void LPADC_SetOffset12BitValue(ADC_Type *base, uint32_t valueA, uint32_t valueB) -{ - base->OFSTRIM12 = ADC_OFSTRIM12_OFSTRIM_A(valueA) | ADC_OFSTRIM12_OFSTRIM_A(valueB); -} - -/*! - * @brief Set proper offset value to trim 16 bit ADC conversion. - * - * Set the offset trim value for offset calibration manually. - * - * @param base LPADC peripheral base address. - * @param valueA Setting offset value A. - * @param valueB Setting offset value B. - * @note In normal adc sequence, the values are automatically calculated by LPADC_EnableOffsetCalibration. - */ -static inline void LPADC_SetOffset16BitValue(ADC_Type *base, uint32_t valueA, uint32_t valueB) -{ - base->OFSTRIM16 = ADC_OFSTRIM16_OFSTRIM_A(valueA) | ADC_OFSTRIM16_OFSTRIM_B(valueB); -} -#endif /* FSL_FEATURE_LPADC_HAS_OFSTRIM */ - -/*! - * @brief Enable the offset calibration function. - * - * @param base LPADC peripheral base address. - * @param enable switcher to the calibration function. - */ -static inline void LPADC_EnableOffsetCalibration(ADC_Type *base, bool enable) -{ - if (enable) - { - base->CTRL |= ADC_CTRL_CALOFS_MASK; - } - else - { - base->CTRL &= ~ADC_CTRL_CALOFS_MASK; - } -} -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE -/*! - * @brief Set offset calibration mode. - * - * @param base LPADC peripheral base address. - * @param mode set offset calibration mode.see to #lpadc_offset_calibration_mode_t . - */ -static inline void LPADC_SetOffsetCalibrationMode(ADC_Type *base, lpadc_offset_calibration_mode_t mode) -{ - base->CTRL = (base->CTRL & ~ADC_CTRL_CALOFSMODE_MASK) | ADC_CTRL_CALOFSMODE(mode); -} - -#endif /* defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE */ - -/*! - * @brief Do offset calibration. - * - * @param base LPADC peripheral base address. - */ -void LPADC_DoOffsetCalibration(ADC_Type *base); - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ -/*! - * @brief Do auto calibration. - * - * @param base LPADC peripheral base address. - */ -void LPADC_DoAutoCalibration(ADC_Type *base); - -/*! - * @brief Prepare auto calibration, LPADC_FinishAutoCalibration has to be called before using the LPADC. - * LPADC_DoAutoCalibration has been split in two API to avoid to be stuck too long in the function. - * - * @param base LPADC peripheral base address. - */ -void LPADC_PrepareAutoCalibration(ADC_Type *base); - -/*! - * @brief Finish auto calibration start with LPADC_PrepareAutoCalibration. - * - * @param base LPADC peripheral base address. - */ -void LPADC_FinishAutoCalibration(ADC_Type *base); - -#endif /* defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ */ - -/*! - * @brief Get calibration value into the memory which is defined by invoker. - * - * @note Please note the ADC will be disabled temporary. - * @note This function should be used after finish calibration. - * - * @param base LPADC peripheral base address. - * @param ptrCalibrationValue Pointer to @ref lpadc_calibration_value_t structure, this memory block should be always - * powered on even in low power modes. - */ -void LPADC_GetCalibrationValue(ADC_Type *base, lpadc_calibration_value_t *ptrCalibrationValue); - -/*! - * @brief Set calibration value into ADC calibration registers. - * - * @note Please note the ADC will be disabled temporary. - * - * @param base LPADC peripheral base address. - * @param ptrCalibrationValue Pointer to @ref lpadc_calibration_value_t structure which contains ADC's calibration - * value. - */ -void LPADC_SetCalibrationValue(ADC_Type *base, const lpadc_calibration_value_t *ptrCalibrationValue); - -#endif /* defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFS) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFS */ - -#if ((defined(FSL_FEATURE_LPADC_HAS_CTRL_CALHS)) && FSL_FEATURE_LPADC_HAS_CTRL_CALHS) -/*! - * @brief Request high speed mode trim calculation. - * - * @param base LPADC peripheral base address. - */ -static inline void LPADC_RequestHighSpeedModeTrim(ADC_Type *base) -{ - base->CTRL |= ADC_CTRL_CALHS_MASK; -} - -/*! - * @brief Get high speed mode trim value, the result is a 5-bit signed value between -16 and 15. - * - * @note The high speed mode trim value is used to minimize offset for high speed conversion. - * - * @param base LPADC peripheral base address. - * @return The calculated high speed mode trim value. - */ -static inline int8_t LPADC_GetHighSpeedTrimValue(ADC_Type *base) -{ - return (int8_t)(base->HSTRIM); -} - -/*! - * @brief Set high speed mode trim value. - * - * @note If is possible to set the trim value manually, but it is recommended to use the LPADC_RequestHighSpeedModeTrim. - * - * @param base LPADC peripheral base address. - * @param trimValue The trim value to be set. - */ -static inline void LPADC_SetHighSpeedTrimValue(ADC_Type *base, int8_t trimValue) -{ - base->HSTRIM = ADC_HSTRIM_HSTRIM(trimValue); -} - -/*! - * @brief Enable/disable high speed conversion mode, if enabled conversions complete 2 or 3 ADCK cycles sooner compared - * to conversion cycle counts when high speed mode is disabled. - * - * @param base LPADC peripheral base address. - * @param enable Used to enable/disable high speed conversion mode: - * - \b true Enable high speed conversion mode; - * - \b false Disable high speed conversion mode. - */ -static inline void LPADC_EnableHighSpeedConversionMode(ADC_Type *base, bool enable) -{ - if (enable) - { - base->CFG2 |= ADC_CFG2_HS_MASK; - } - else - { - base->CFG2 &= ~ADC_CFG2_HS_MASK; - } -} - -/*! - * @brief Enable/disable an additional ADCK cycle to conversion. - * - * @param base LPADC peripheral base address. - * @param enable Used to enable/disable an additional ADCK cycle to conversion: - * - \b true Enable an additional ADCK cycle to conversion; - * - \b false Disable an additional ADCK cycle to conversion. - */ -static inline void LPADC_EnableExtraCycle(ADC_Type *base, bool enable) -{ - if (enable) - { - base->CFG2 |= ADC_CFG2_HSEXTRA_MASK; - } - else - { - base->CFG2 &= ~ADC_CFG2_HSEXTRA_MASK; - } -} - -/*! - * @brief Set tune value which provides some variability in how many cycles are needed to complete a conversion. - * - * @param base LPADC peripheral base address. - * @param tuneValue The tune value to be set, please refer to @ref lpadc_tune_value_t. - */ -static inline void LPADC_SetTuneValue(ADC_Type *base, lpadc_tune_value_t tuneValue) -{ - base->CFG2 = (base->CFG2 & ~ADC_CFG2_TUNE_MASK) | ADC_CFG2_TUNE(tuneValue); -} - -/*! - * @brief Get tune value which provides some variability in how many cycles are needed to complete a conversion. - * - * @param base LPADC peripheral base address. - * @return The tune value, please refer to @ref lpadc_tune_value_t. - */ -static inline lpadc_tune_value_t LPADC_GetTuneValue(ADC_Type *base) -{ - return (lpadc_tune_value_t)((base->CFG2 & ADC_CFG2_TUNE_MASK) >> ADC_CFG2_TUNE_SHIFT); -} -#endif /* ((defined(FSL_FEATURE_LPADC_HAS_CTRL_CALHS)) && FSL_FEATURE_LPADC_HAS_CTRL_CALHS) */ - -#if (defined(FSL_FEATURE_LPADC_HAS_CFG2_JLEFT) && FSL_FEATURE_LPADC_HAS_CFG2_JLEFT) -/*! - * @brief Enable/disable left-justify format in 12-bit single-end mode. - * - * @param base LPADC peripheral base address. - * @param enable Used to enable/disable left-justify format in 12-bit single-end mode: - * - \b true Enable left-justify format in 12-bit single-end mode; - * - \b false Disable left-justify format in 12-bit single-end mode. - */ -static inline void LPADC_EnableJustifiedLeft(ADC_Type *base, bool enable) -{ - if (enable) - { - base->CFG2 |= ADC_CFG2_JLEFT_MASK; - } - else - { - base->CFG2 &= ~ADC_CFG2_JLEFT_MASK; - } -} -#endif /* (defined(FSL_FEATURE_LPADC_HAS_CFG2_JLEFT) && FSL_FEATURE_LPADC_HAS_CFG2_JLEFT) */ - -/* @} */ - -#if defined(__cplusplus) -} -#endif -/*! - * @} - */ -#endif /* FSL_LPADC_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpcmp.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpcmp.c deleted file mode 100644 index 23b2da790ea..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpcmp.c +++ /dev/null @@ -1,367 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2019, 2023 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpcmp.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpcmp" -#endif - -#if defined(LPCMP_RSTS) -#define LPCMP_RESETS_ARRAY LPCMP_RSTS -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#if defined(LPCMP_CLOCKS) -/*! - * @brief Get instance number for LPCMP module. - * - * @param base LPCMP peripheral base address - */ -static uint32_t LPCMP_GetInstance(LPCMP_Type *base); -#endif /* LPCMP_CLOCKS */ - -/******************************************************************************* - * Variables - ******************************************************************************/ -#if defined(LPCMP_CLOCKS) -/*! @brief Pointers to LPCMP bases for each instance. */ -static LPCMP_Type *const s_lpcmpBases[] = LPCMP_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to LPCMP clocks for each instance. */ -static const clock_ip_name_t s_lpcmpClocks[] = LPCMP_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* LPCMP_CLOCKS */ - -#if defined(LPCMP_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_lpcmpResets[] = LPCMP_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Codes - ******************************************************************************/ -#if defined(LPCMP_CLOCKS) -static uint32_t LPCMP_GetInstance(LPCMP_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - /* - * $Branch Coverage Justification$ - * (instance >= ARRAY_SIZE(s_lpcmpBases)) not covered. The peripheral base - * address is always valid and checked by assert. - */ - for (instance = 0; instance < ARRAY_SIZE(s_lpcmpBases); instance++) - { - /* - * $Branch Coverage Justification$ - * (s_lpcmpBases[instance] != base) not covered. The peripheral base - * address is always valid and checked by assert. - */ - if (s_lpcmpBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_lpcmpBases)); - - return instance; -} -#endif /* LPCMP_CLOCKS */ - -/*! - * brief Initialize the LPCMP - * - * This function initializes the LPCMP module. The operations included are: - * - Enabling the clock for LPCMP module. - * - Configuring the comparator. - * - Enabling the LPCMP module. - * Note: For some devices, multiple LPCMP instance share the same clock gate. In this case, to enable the clock for - * any instance enables all the LPCMPs. Check the chip reference manual for the clock assignment of the LPCMP. - * - * param base LPCMP peripheral base address. - * param config Pointer to "lpcmp_config_t" structure. - */ -void LPCMP_Init(LPCMP_Type *base, const lpcmp_config_t *config) -{ - assert(config != NULL); - - uint32_t tmp32; - -#if defined(LPCMP_CLOCKS) -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock. */ - CLOCK_EnableClock(s_lpcmpClocks[LPCMP_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* LPCMP_CLOCKS */ - -#if defined(LPCMP_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_lpcmpResets[LPCMP_GetInstance(base)]); -#endif - - /* Configure. */ - LPCMP_Enable(base, false); - -#if !(defined(FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) && FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) - /* CCR0 register. */ - if (config->enableStopMode) - { - base->CCR0 |= LPCMP_CCR0_CMP_STOP_EN_MASK; - } - else - { - base->CCR0 &= ~LPCMP_CCR0_CMP_STOP_EN_MASK; - } -#endif /* !(defined(FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) && FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) */ - - /* CCR1 register. */ - tmp32 = (base->CCR1 & (~(LPCMP_CCR1_COUT_PEN_MASK | LPCMP_CCR1_COUT_SEL_MASK | LPCMP_CCR1_COUT_INV_MASK -#if defined(FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL) && FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL - | LPCMP_CCR1_FUNC_CLK_SEL_MASK -#endif /* FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL */ - ))); - - if (config->enableOutputPin) - { - tmp32 |= LPCMP_CCR1_COUT_PEN_MASK; - } - if (config->useUnfilteredOutput) - { - tmp32 |= LPCMP_CCR1_COUT_SEL_MASK; - } - if (config->enableInvertOutput) - { - tmp32 |= LPCMP_CCR1_COUT_INV_MASK; - } -#if defined(FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL) && FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL - tmp32 |= LPCMP_CCR1_FUNC_CLK_SEL(config->functionalSourceClock); -#endif /* FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL */ - base->CCR1 = tmp32; - /* CCR2 register. */ - tmp32 = base->CCR2 & ~(LPCMP_CCR2_HYSTCTR_MASK | LPCMP_CCR2_CMP_NPMD_MASK | LPCMP_CCR2_CMP_HPMD_MASK); - tmp32 |= LPCMP_CCR2_HYSTCTR(config->hysteresisMode); - tmp32 |= ((uint32_t)(config->powerMode) << LPCMP_CCR2_CMP_HPMD_SHIFT); - base->CCR2 = tmp32; - - LPCMP_Enable(base, true); /* Enable the LPCMP module. */ -} - -/*! - * brief De-initializes the LPCMP module. - * - * This function de-initializes the LPCMP module. The operations included are: - * - Disabling the LPCMP module. - * - Disabling the clock for LPCMP module. - * - * This function disables the clock for the LPCMP. - * Note: For some devices, multiple LPCMP instance shares the same clock gate. In this case, before disabling the - * clock for the LPCMP, ensure that all the LPCMP instances are not used. - * - * param base LPCMP peripheral base address. - */ -void LPCMP_Deinit(LPCMP_Type *base) -{ - /* Disable the LPCMP module. */ - LPCMP_Enable(base, false); -#if defined(LPCMP_CLOCKS) -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable the clock. */ - CLOCK_DisableClock(s_lpcmpClocks[LPCMP_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* LPCMP_CLOCKS */ -} - -/*! - * brief Gets an available pre-defined settings for the comparator's configuration. - * - * This function initializes the comparator configuration structure to these default values: - * code - * config->enableStopMode = false; - * config->enableOutputPin = false; - * config->useUnfilteredOutput = false; - * config->enableInvertOutput = false; - * config->hysteresisMode = kLPCMP_HysteresisLevel0; - * config->powerMode = kLPCMP_LowSpeedPowerMode; - * config->functionalSourceClock = kLPCMP_FunctionalClockSource0; - * endcode - * param config Pointer to "lpcmp_config_t" structure. - */ -void LPCMP_GetDefaultConfig(lpcmp_config_t *config) -{ - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); -#if !(defined(FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) && FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) - config->enableStopMode = false; -#endif /* !(defined(FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) && FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) */ - config->enableOutputPin = false; - config->useUnfilteredOutput = false; - config->enableInvertOutput = false; - config->hysteresisMode = kLPCMP_HysteresisLevel0; - config->powerMode = kLPCMP_LowSpeedPowerMode; -#if defined(FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL) && FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL - config->functionalSourceClock = kLPCMP_FunctionalClockSource0; -#endif /* FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL */ -} - -/*! - * brief Select the input channels for LPCMP. This function determines which input - * is selected for the negative and positive mux. - * - * param base LPCMP peripheral base address. - * param positiveChannel Positive side input channel number. - * param negativeChannel Negative side input channel number. - */ -void LPCMP_SetInputChannels(LPCMP_Type *base, uint32_t positiveChannel, uint32_t negativeChannel) -{ - uint32_t tmp32; - - tmp32 = base->CCR2 & ~(LPCMP_CCR2_PSEL_MASK | LPCMP_CCR2_MSEL_MASK); - tmp32 |= LPCMP_CCR2_PSEL(positiveChannel) | LPCMP_CCR2_MSEL(negativeChannel); - base->CCR2 = tmp32; -} - -/*! - * brief Configures the filter. - * - * param base LPCMP peripheral base address. - * param config Pointer to "lpcmp_filter_config_t" structure. - */ -void LPCMP_SetFilterConfig(LPCMP_Type *base, const lpcmp_filter_config_t *config) -{ - assert(config != NULL); - - uint32_t tmp32; - - tmp32 = base->CCR1 & ~(LPCMP_CCR1_FILT_PER_MASK | LPCMP_CCR1_FILT_CNT_MASK | LPCMP_CCR1_SAMPLE_EN_MASK); - if (config->enableSample) - { - tmp32 |= LPCMP_CCR1_SAMPLE_EN_MASK; - } - tmp32 |= LPCMP_CCR1_FILT_PER(config->filterSamplePeriod) | LPCMP_CCR1_FILT_CNT(config->filterSampleCount); - base->CCR1 = tmp32; -} - -/*! - * brief Configure the internal DAC module. - * - * param base LPCMP peripheral base address. - * param config Pointer to "lpcmp_dac_config_t" structure. If config is "NULL", disable internal DAC. - */ -void LPCMP_SetDACConfig(LPCMP_Type *base, const lpcmp_dac_config_t *config) -{ - uint32_t tmp32; - if (config == NULL) - { - tmp32 = 0U; /* Disable internal DAC. */ - } - else - { - tmp32 = LPCMP_DCR_VRSEL(config->referenceVoltageSource) | LPCMP_DCR_DAC_DATA(config->DACValue); - if (config->enableLowPowerMode) - { - tmp32 |= LPCMP_DCR_DAC_HPMD_MASK; - } - tmp32 |= LPCMP_DCR_DAC_EN_MASK; - } - base->DCR = tmp32; -} - -#if defined(FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL) && FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL -/*! - * @brief Configure the window control, users can use this API to implement operations on the window, - * such as inverting the window signal, setting the window closing event(only valid in windowing mode), - * and setting the COUTA signal after the window is closed(only valid in windowing mode). - * - * @param base LPCMP peripheral base address. - * @param config Pointer "lpcmp_window_control_config_t" structure. - */ -void LPCMP_SetWindowControl(LPCMP_Type *base, const lpcmp_window_control_config_t *config) -{ - assert(config != NULL); - - uint32_t tmp32 = 0UL; - - tmp32 = (base->CCR1 & (~(LPCMP_CCR1_COUTA_CFG_MASK | LPCMP_CCR1_EVT_SEL_CFG_MASK | LPCMP_CCR1_WINDOW_INV_MASK))); - - if (config->enableInvertWindowSignal) - { - tmp32 |= LPCMP_CCR1_WINDOW_INV_MASK; - } - - /* Set COUT event, which can close the active window in window mode. */ - tmp32 |= LPCMP_CCR1_EVT_SEL_CFG(config->closeWindowEvent); - - /* Set the COUTA signal value when the window is closed. */ - tmp32 |= LPCMP_CCR1_COUTA_CFG(config->COUTASignal); - - base->CCR1 = tmp32; -} -#endif /* FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL */ - -#if defined(FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE) && FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE -/*! - * @brief Configure the roundrobin mode. - * - * @param base LPCMP peripheral base address. - * @param config Pointer "lpcmp_roundrobin_config_t" structure. - */ -void LPCMP_SetRoundRobinConfig(LPCMP_Type *base, const lpcmp_roundrobin_config_t *config) -{ - assert(config != NULL); - - uint32_t tmp32 = 0UL; - - /* LPCMPx_RRCR0 register, Configuration options for the round-robin operation. */ - tmp32 = (base->RRCR0 & - (~(LPCMP_RRCR0_RR_TRG_SEL_MASK | LPCMP_RRCR0_RR_NSAM_MASK | LPCMP_RRCR0_RR_CLK_SEL_MASK | - LPCMP_RRCR0_RR_INITMOD_MASK | LPCMP_RRCR0_RR_SAMPLE_CNT_MASK | LPCMP_RRCR0_RR_SAMPLE_THRESHOLD_MASK))); - - tmp32 |= - (LPCMP_RRCR0_RR_TRG_SEL(config->roundrobinTriggerSource) | LPCMP_RRCR0_RR_NSAM(config->sampleClockNumbers) | - LPCMP_RRCR0_RR_CLK_SEL(config->roundrobinClockSource) | LPCMP_RRCR0_RR_INITMOD(config->initDelayModules) | - LPCMP_RRCR0_RR_SAMPLE_CNT(config->channelSampleNumbers) | - LPCMP_RRCR0_RR_SAMPLE_THRESHOLD(config->sampleTimeThreshhold)); - - base->RRCR0 = tmp32; - - /* LPCMPx_RRCR1 register, Configure the fix port, fix channel and checker channel. */ - tmp32 = - (base->RRCR1 & (~(LPCMP_RRCR1_FIXP_MASK | LPCMP_RRCR1_FIXCH_MASK | (0xFFUL << LPCMP_RRCR1_RR_CH0EN_SHIFT)))); - tmp32 |= (LPCMP_RRCR1_FIXP(config->fixedMuxPort) | LPCMP_RRCR1_FIXCH(config->fixedChannel) | - ((uint32_t)(config->checkerChannelMask) << LPCMP_RRCR1_RR_CH0EN_SHIFT)); - - base->RRCR1 = tmp32; -} - -/*! - * brief Configure the roundrobin internal timer reload value. - * - * param base LPCMP peripheral base address. - * param value RoundRobin internal timer reload value, allowed range:0x0UL-0xFFFFFFFUL. - */ -void LPCMP_SetRoundRobinInternalTimer(LPCMP_Type *base, uint32_t value) -{ - uint32_t tmp32 = 0UL; - - tmp32 = (base->RRCR2 & (~LPCMP_RRCR2_RR_TIMER_RELOAD_MASK)); - tmp32 |= LPCMP_RRCR2_RR_TIMER_RELOAD(value); - - base->RRCR2 = tmp32; -} - -#endif /* FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpcmp.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpcmp.h deleted file mode 100644 index 737738acd46..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpcmp.h +++ /dev/null @@ -1,585 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2020, 2023 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_LPCMP_H_ -#define FSL_LPCMP_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup lpcmp - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/*! @name Driver version */ -/*! @{ */ -/*! @brief LPCMP driver version 2.1.2. */ -#define FSL_LPCMP_DRIVER_VERSION (MAKE_VERSION(2, 1, 2)) -/*! @} */ - -#define LPCMP_CCR1_COUTA_CFG_MASK (LPCMP_CCR1_COUTA_OWEN_MASK | LPCMP_CCR1_COUTA_OW_MASK) -#define LPCMP_CCR1_COUTA_CFG_SHIFT LPCMP_CCR1_COUTA_OWEN_SHIFT -#define LPCMP_CCR1_COUTA_CFG(x) \ - (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_COUTA_CFG_SHIFT)) & LPCMP_CCR1_COUTA_CFG_MASK) - -#define LPCMP_CCR1_EVT_SEL_CFG_MASK (LPCMP_CCR1_EVT_SEL_MASK | LPCMP_CCR1_WINDOW_CLS_MASK) -#define LPCMP_CCR1_EVT_SEL_CFG_SHIFT LPCMP_CCR1_WINDOW_CLS_SHIFT -#define LPCMP_CCR1_EVT_SEL_CFG(x) \ - (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_EVT_SEL_CFG_SHIFT)) & LPCMP_CCR1_EVT_SEL_CFG_MASK) - -/*! - * @brief LPCMP status falgs mask. - */ -enum _lpcmp_status_flags -{ - kLPCMP_OutputRisingEventFlag = LPCMP_CSR_CFR_MASK, /*!< Rising-edge on the comparison output has occurred. */ - kLPCMP_OutputFallingEventFlag = LPCMP_CSR_CFF_MASK, /*!< Falling-edge on the comparison output has occurred. */ -#if defined(FSL_FEATURE_LPCMP_HAS_CSR_RRF) && FSL_FEATURE_LPCMP_HAS_CSR_RRF - kLPCMP_OutputRoundRobinEventFlag = LPCMP_CSR_RRF_MASK, /*!< Detects when any channel's last comparison result is - different from the pre-set value in trigger mode. */ -#endif /* FSL_FEATURE_LPCMP_HAS_CSR_RRF */ - kLPCMP_OutputAssertEventFlag = LPCMP_CSR_COUT_MASK, /*!< Return the current value of the analog comparator output. - The flag does not support W1C. */ -}; - -/*! - * @brief LPCMP interrupt enable/disable mask. - */ -enum _lpcmp_interrupt_enable -{ - kLPCMP_OutputRisingInterruptEnable = LPCMP_IER_CFR_IE_MASK, /*!< Comparator interrupt enable rising. */ - kLPCMP_OutputFallingInterruptEnable = LPCMP_IER_CFF_IE_MASK, /*!< Comparator interrupt enable falling. */ -#if defined(FSL_FEATURE_LPCMP_HAS_IER_RRF_IE) && FSL_FEATURE_LPCMP_HAS_IER_RRF_IE - kLPCMP_RoundRobinInterruptEnable = LPCMP_IER_RRF_IE_MASK, /*!< Comparator round robin mode interrupt - occurred when the comparison result changes for a given channel. */ -#endif /* FSL_FEATURE_LPCMP_HAS_IER_RRF_IE */ -}; - -/*! - * @brief LPCMP hysteresis mode. See chip data sheet to get the actual hystersis - * value with each level - */ -typedef enum _lpcmp_hysteresis_mode -{ - kLPCMP_HysteresisLevel0 = 0U, /*!< The hard block output has level 0 hysteresis internally. */ - kLPCMP_HysteresisLevel1 = 1U, /*!< The hard block output has level 1 hysteresis internally. */ - kLPCMP_HysteresisLevel2 = 2U, /*!< The hard block output has level 2 hysteresis internally. */ - kLPCMP_HysteresisLevel3 = 3U, /*!< The hard block output has level 3 hysteresis internally. */ -} lpcmp_hysteresis_mode_t; - -/*! - * @brief LPCMP nano mode. - */ -typedef enum _lpcmp_power_mode -{ - kLPCMP_LowSpeedPowerMode = 0U, /*!< Low speed comparison mode is selected. */ - kLPCMP_HighSpeedPowerMode = 1U, /*!< High speed comparison mode is selected. */ - kLPCMP_NanoPowerMode = 2U, /*!< Nano power comparator is enabled. */ -} lpcmp_power_mode_t; - -/*! - * @brief Internal DAC reference voltage source. - */ -typedef enum _lpcmp_dac_reference_voltage_source -{ - kLPCMP_VrefSourceVin1 = 0U, /*!< vrefh_int is selected as resistor ladder network supply reference Vin. */ - kLPCMP_VrefSourceVin2 = 1U, /*!< vrefh_ext is selected as resistor ladder network supply reference Vin. */ -} lpcmp_dac_reference_voltage_source_t; - -#if defined(FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL) && FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL -/*! - * @brief LPCMP functional mode clock source selection. - * - * Note: In different devices, the functional mode clock source selection is different, - * please refer to specific device Reference Manual for details. - */ -typedef enum _lpcmp_functional_source_clock -{ - kLPCMP_FunctionalClockSource0 = 0U, /*!< Select functional mode clock source0. */ - kLPCMP_FunctionalClockSource1 = 1U, /*!< Select functional mode clock source1. */ - kLPCMP_FunctionalClockSource2 = 2U, /*!< Select functional mode clock source2. */ - kLPCMP_FunctionalClockSource3 = 3U, /*!< Select functional mode clock source3. */ -} lpcmp_functional_source_clock_t; -#endif /* FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL */ - -#if defined(FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL) && FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL -/*! - * @brief Set the COUTA signal value when the window is closed. - */ -typedef enum _lpcmp_couta_signal -{ - kLPCMP_COUTASignalNoSet = 0U, /*!< NO set the COUTA signal value when the window is closed. */ - kLPCMP_COUTASignalLow = 1U, /*!< Set COUTA signal low(0) when the window is closed. */ - kLPCMP_COUTASignalHigh = 3U, /*!< Set COUTA signal high(1) when the window is closed. */ -} lpcmp_couta_signal_t; - -/*! - * @brief Set COUT event, which can close the active window in window mode. - */ -typedef enum _lpcmp_close_window_event -{ - kLPCMP_CLoseWindowEventNoSet = 0U, /*!< No Set COUT event, which can close the active window in window mode. */ - kLPCMP_CloseWindowEventRisingEdge = 1U, /*!< Set rising edge COUT signal as COUT event. */ - kLPCMP_CloseWindowEventFallingEdge = 3U, /*!< Set falling edge COUT signal as COUT event. */ - kLPCMP_CLoseWindowEventBothEdge = 5U, /*!< Set both rising and falling edge COUT signal as COUT event. */ -} lpcmp_close_window_event_t; -#endif /* FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL */ - -#if defined(FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE) && FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE -/*! - * @brief LPCMP round robin mode fixed mux port. - */ -typedef enum _lpcmp_roundrobin_fixedmuxport -{ - kLPCMP_FixedPlusMuxPort = 0U, /*!< Fixed plus mux port. */ - kLPCMP_FixedMinusMuxPort = 1U, /*!< Fixed minus mux port. */ -} lpcmp_roundrobin_fixedmuxport_t; - -/*! - * @brief LPCMP round robin mode clock source selection. - * - * Note: In different devices,the round robin mode clock source selection is different, - * please refer to the specific device Reference Manual for details. - */ -typedef enum _lpcmp_roundrobin_clock_source -{ - kLPCMP_RoundRobinClockSource0 = 0U, /*!< Select roundrobin mode clock source0. */ - kLPCMP_RoundRobinClockSource1 = 1U, /*!< Select roundrobin mode clock source1. */ - kLPCMP_RoundRobinClockSource2 = 2U, /*!< Select roundrobin mode clock source2. */ - kLPCMP_RoundRobinClockSource3 = 3U, /*!< Select roundrobin mode clock source3. */ -} lpcmp_roundrobin_clock_source_t; - -/*! - * @brief LPCMP round robin mode trigger source. - */ -typedef enum _lpcmp_roundrobin_trigger_source -{ - kLPCMP_TriggerSourceExternally = 0U, /*!< Select external trigger source. */ - kLPCMP_TriggerSourceInternally = 1U, /*!< Select internal trigger source. */ -} lpcmp_roundrobin_trigger_source_t; -#endif /* FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE */ - -/*! - * @brief Configure the filter. - */ -typedef struct _lpcmp_filter_config -{ - bool enableSample; /*!< Decide whether to use the external SAMPLE as a sampling clock input. */ - uint8_t filterSampleCount; /*!< Filter Sample Count. Available range is 1-7; 0 disables the filter. */ - uint8_t filterSamplePeriod; /*!< Filter Sample Period. The divider to the bus clock. Available range is 0-255. The - sampling clock must be at least 4 times slower than the system clock to the comparator. - So if enableSample is "false", filterSamplePeriod should be set greater than 4.*/ -} lpcmp_filter_config_t; - -/*! - * @brief configure the internal DAC. - */ -typedef struct _lpcmp_dac_config -{ - bool enableLowPowerMode; /*!< Decide whether to enable DAC low power mode. */ - lpcmp_dac_reference_voltage_source_t referenceVoltageSource; /*!< Internal DAC supply voltage reference source. */ - uint8_t DACValue; /*!< Value for the DAC Output Voltage. Different devices has different available range, - for specific values, please refer to the reference manual.*/ -} lpcmp_dac_config_t; - -/*! - * @brief Configures the comparator. - */ -typedef struct _lpcmp_config -{ -#if !(defined(FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) && FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) - bool enableStopMode; /*!< Decide whether to enable the comparator when in STOP modes. */ -#endif /* !(defined(FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) && FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) */ - - bool enableOutputPin; /*!< Decide whether to enable the comparator is available in selected pin. */ - bool useUnfilteredOutput; /*!< Decide whether to use unfiltered output. */ - bool enableInvertOutput; /*!< Decide whether to inverts the comparator output. */ - lpcmp_hysteresis_mode_t hysteresisMode; /*!< LPCMP hysteresis mode. */ - lpcmp_power_mode_t powerMode; /*!< LPCMP power mode. */ -#if defined(FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL) && FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL - lpcmp_functional_source_clock_t functionalSourceClock; /*!< Select LPCMP functional mode clock source. */ -#endif /* FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL */ -} lpcmp_config_t; - -#if defined(FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL) && FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL -/*! - * @brief Configure the window mode control. - */ -typedef struct _lpcmp_window_control_config -{ - bool enableInvertWindowSignal; /*!< True: enable invert window signal, False: disable invert window signal. */ - lpcmp_couta_signal_t COUTASignal; /*!< Decide whether to define the COUTA signal value when the window is closed. */ - lpcmp_close_window_event_t closeWindowEvent; /*!< Decide whether to select COUT event signal edge defines - a COUT event to close window. */ -} lpcmp_window_control_config_t; -#endif /* FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL */ - -#if defined(FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE) && FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE -/*! - * @brief Configure the round robin mode. - */ -typedef struct _lpcmp_roundrobin_config -{ - uint8_t initDelayModules; /*!< Comparator and DAC initialization delay modulus, See Reference Manual and DataSheet - for specific value. */ - uint8_t sampleClockNumbers; /*!< Specify the number of the round robin clock cycles(0~3) to wait after scanning the - active channel before sampling the channel's comparison result. */ - uint8_t channelSampleNumbers; /*!< Specify the number of samples for one channel, note that channelSampleNumbers - must not smaller than sampleTimeThreshhold. */ - uint8_t sampleTimeThreshhold; /*!< Specify that for one channel, when (sampleTimeThreshhold + 1) sample results are - "1",the final result is "1", otherwise the final result is "0", note that the - sampleTimeThreshhold must not be larger than channelSampleNumbers. */ - lpcmp_roundrobin_clock_source_t roundrobinClockSource; /*!< Decide which clock source to - choose in round robin mode. */ - lpcmp_roundrobin_trigger_source_t roundrobinTriggerSource; /*!< Decide which trigger source to - choose in round robin mode. */ - lpcmp_roundrobin_fixedmuxport_t fixedMuxPort; /*!< Decide which mux port to choose as - fixed channel in round robin mode. */ - uint8_t fixedChannel; /*!< Indicate which channel of the fixed mux port is used in round robin mode. */ - uint8_t checkerChannelMask; /*!< Indicate which channel of the non-fixed mux port to check its voltage value in - round robin mode, for example, if checkerChannelMask set to 0x11U means select - channel 0 and channel 4 as checker channel.*/ -} lpcmp_roundrobin_config_t; -#endif /* FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and configuration - * @{ - */ - -/*! - * @brief Initialize the LPCMP - * - * This function initializes the LPCMP module. The operations included are: - * - Enabling the clock for LPCMP module. - * - Configuring the comparator. - * - Enabling the LPCMP module. - * Note: For some devices, multiple LPCMP instance share the same clock gate. In this case, to enable the clock for - * any instance enables all the LPCMPs. Check the chip reference manual for the clock assignment of the LPCMP. - * - * @param base LPCMP peripheral base address. - * @param config Pointer to "lpcmp_config_t" structure. - */ -void LPCMP_Init(LPCMP_Type *base, const lpcmp_config_t *config); - -/*! - * @brief De-initializes the LPCMP module. - * - * This function de-initializes the LPCMP module. The operations included are: - * - Disabling the LPCMP module. - * - Disabling the clock for LPCMP module. - * - * This function disables the clock for the LPCMP. - * Note: For some devices, multiple LPCMP instance shares the same clock gate. In this case, before disabling the - * clock for the LPCMP, ensure that all the LPCMP instances are not used. - * - * @param base LPCMP peripheral base address. - */ -void LPCMP_Deinit(LPCMP_Type *base); - -/*! - * @brief Gets an available pre-defined settings for the comparator's configuration. - * - * This function initializes the comparator configuration structure to these default values: - * @code - * config->enableStopMode = false; - * config->enableOutputPin = false; - * config->useUnfilteredOutput = false; - * config->enableInvertOutput = false; - * config->hysteresisMode = kLPCMP_HysteresisLevel0; - * config->powerMode = kLPCMP_LowSpeedPowerMode; - * config->functionalSourceClock = kLPCMP_FunctionalClockSource0; - * @endcode - * @param config Pointer to "lpcmp_config_t" structure. - */ -void LPCMP_GetDefaultConfig(lpcmp_config_t *config); - -/*! - * @brief Enable/Disable LPCMP module. - * - * @param base LPCMP peripheral base address. - * @param enable "true" means enable the module, and "false" means disable the module. - */ -static inline void LPCMP_Enable(LPCMP_Type *base, bool enable) -{ - if (enable) - { - base->CCR0 |= LPCMP_CCR0_CMP_EN_MASK; - } - else - { - base->CCR0 &= ~LPCMP_CCR0_CMP_EN_MASK; - } -} - -/*! - * @brief Select the input channels for LPCMP. This function determines which input - * is selected for the negative and positive mux. - * - * @param base LPCMP peripheral base address. - * @param positiveChannel Positive side input channel number. Available range is 0-7. - * @param negativeChannel Negative side input channel number. Available range is 0-7. - */ -void LPCMP_SetInputChannels(LPCMP_Type *base, uint32_t positiveChannel, uint32_t negativeChannel); - -/*! - * @brief Enables/disables the DMA request for rising/falling events. - * Normally, the LPCMP generates a CPU interrupt if there is a rising/falling event. When - * DMA support is enabled and the rising/falling interrupt is enabled , the rising/falling - * event forces a DMA transfer request rather than a CPU interrupt instead. - * - * @param base LPCMP peripheral base address. - * @param enable "true" means enable DMA support, and "false" means disable DMA support. - */ -static inline void LPCMP_EnableDMA(LPCMP_Type *base, bool enable) -{ - if (enable) - { - base->CCR1 |= LPCMP_CCR1_DMA_EN_MASK; - } - else - { - base->CCR1 &= ~LPCMP_CCR1_DMA_EN_MASK; - } -} - -/*! - * @brief Configures the filter. - * - * @param base LPCMP peripheral base address. - * @param config Pointer to "lpcmp_filter_config_t" structure. - */ -void LPCMP_SetFilterConfig(LPCMP_Type *base, const lpcmp_filter_config_t *config); - -/*! - * @brief Configure the internal DAC module. - * - * @param base LPCMP peripheral base address. - * @param config Pointer to "lpcmp_dac_config_t" structure. If config is "NULL", disable internal DAC. - */ -void LPCMP_SetDACConfig(LPCMP_Type *base, const lpcmp_dac_config_t *config); - -/*! - * @brief Enable the interrupts. - * - * @param base LPCMP peripheral base address. - * @param mask Mask value for interrupts. See "_lpcmp_interrupt_enable". - */ -static inline void LPCMP_EnableInterrupts(LPCMP_Type *base, uint32_t mask) -{ - base->IER |= mask; -} - -/*! - * @brief Disable the interrupts. - * - * @param base LPCMP peripheral base address. - * @param mask Mask value for interrupts. See "_lpcmp_interrupt_enable". - */ -static inline void LPCMP_DisableInterrupts(LPCMP_Type *base, uint32_t mask) -{ - base->IER &= ~mask; -} - -/*! - * @brief Get the LPCMP status flags. - * - * @param base LPCMP peripheral base address. - * - * @return Mask value for the asserted flags. See "_lpcmp_status_flags". - */ -static inline uint32_t LPCMP_GetStatusFlags(LPCMP_Type *base) -{ - return base->CSR; -} - -/*! - * @brief Clear the LPCMP status flags - * - * @param base LPCMP peripheral base address. - * @param mask Mask value for the flags. See "_lpcmp_status_flags". - */ -static inline void LPCMP_ClearStatusFlags(LPCMP_Type *base, uint32_t mask) -{ - base->CSR = mask; -} - -/*! @} */ - -/*! - * @name Window mode - * @{ - */ - -/*! - * @brief Enable/Disable window mode.When any windowed mode is active, COUTA is clocked by - * the bus clock whenever WINDOW = 1. The last latched value is held when WINDOW = 0. - * The optionally inverted comparator output COUT_RAW is sampled on every bus clock - * when WINDOW=1 to generate COUTA. - * - * @param base LPCMP peripheral base address. - * @param enable "true" means enable window mode, and "false" means disable window mode. - */ -static inline void LPCMP_EnableWindowMode(LPCMP_Type *base, bool enable) -{ - if (enable) - { - base->CCR1 |= LPCMP_CCR1_WINDOW_EN_MASK; - } - else - { - base->CCR1 &= ~LPCMP_CCR1_WINDOW_EN_MASK; - } -} - -#if defined(FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL) && FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL -/*! - * @brief Configure the window control, users can use this API to implement operations on the window, - * such as inverting the window signal, setting the window closing event(only valid in windowing mode), - * and setting the COUTA signal after the window is closed(only valid in windowing mode). - * - * @param base LPCMP peripheral base address. - * @param config Pointer "lpcmp_window_control_config_t" structure. - */ -void LPCMP_SetWindowControl(LPCMP_Type *base, const lpcmp_window_control_config_t *config); -#endif /* FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL */ - -/*! @} */ - -#if defined(FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE) && FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE -/*! - * @name RoundRobin mode - * @{ - */ - -/*! - * @brief Configure the roundrobin mode. - * - * @param base LPCMP peripheral base address. - * @param config Pointer "lpcmp_roundrobin_config_t" structure. - */ -void LPCMP_SetRoundRobinConfig(LPCMP_Type *base, const lpcmp_roundrobin_config_t *config); - -/*! - * brief Configure the roundrobin internal timer reload value. - * - * param base LPCMP peripheral base address. - * param value RoundRobin internal timer reload value, allowed range:0x0UL-0xFFFFFFFUL. - */ -void LPCMP_SetRoundRobinInternalTimer(LPCMP_Type *base, uint32_t value); - -/*! - * @brief Enable/Disable roundrobin mode. - * - * @param base LPCMP peripheral base address. - * @param enable "true" means enable roundrobin mode, and "false" means disable roundrobin mode. - */ -static inline void LPCMP_EnableRoundRobinMode(LPCMP_Type *base, bool enable) -{ - if (enable) - { - base->RRCR0 |= LPCMP_RRCR0_RR_EN_MASK; - } - else - { - base->RRCR0 &= ~LPCMP_RRCR0_RR_EN_MASK; - } -} - -/*! - * @brief Enable/Disable roundrobin internal timer, note that this function is only valid - * when using the internal trigger source. - * - * @param base LPCMP peripheral base address. - * @param enable "true" means enable roundrobin internal timer, and "false" means disable roundrobin internal timer. - */ -static inline void LPCMP_EnableRoundRobinInternalTimer(LPCMP_Type *base, bool enable) -{ - if (enable) - { - base->RRCR2 |= LPCMP_RRCR2_RR_TIMER_EN_MASK; - } - else - { - base->RRCR2 &= ~LPCMP_RRCR2_RR_TIMER_EN_MASK; - } -} - -/*! - * @brief Set preset value for all channels, users can set all channels' preset vaule through this API, - * for example, if the mask set to 0x03U means channel0 and channel2's preset value set to 1U and other - * channels' preset value set to 0U. - * - * @param base LPCMP peripheral base address. - * @param mask Mask of channel index. - */ -static inline void LPCMP_SetPreSetValue(LPCMP_Type *base, uint8_t mask) -{ - base->RRCSR = (uint32_t)mask; -} - -/*! - * @brief Get comparison results for all channels, users can get all channels' comparison - * results through this API. - * - * @param base LPCMP peripheral base address. - * @return return All channels' comparison result. - */ -static inline uint8_t LPCMP_GetComparisonResult(LPCMP_Type *base) -{ - return (uint8_t)base->RRCSR; -} - -/*! - * @brief Clear input changed flags for single channel or multiple channels, users can clear - * input changed flag of a single channel or multiple channels through this API, for example, - * if the mask set to 0x03U means clear channel0 and channel2's input changed flags. - * - * @param base LPCMP peripheral base address. - * @param mask Mask of channel index. - */ -static inline void LPCMP_ClearInputChangedFlags(LPCMP_Type *base, uint8_t mask) -{ - base->RRSR = (uint32_t)mask; -} - -/*! - * @brief Get input changed flags for all channels, Users can get all channels' input changed - * flags through this API. - * - * @param base LPCMP peripheral base address. - * @return return All channels' changed flag. - */ -static inline uint8_t LPCMP_GetInputChangedFlags(LPCMP_Type *base) -{ - return (uint8_t)base->RRSR; -} - -/*! @} */ - -#endif /* FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE */ - -#if defined(__cplusplus) -} -#endif - -/*! @} */ - -#endif /* FSL_LPCMP_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpflexcomm.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpflexcomm.c deleted file mode 100644 index b494aa8d961..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpflexcomm.c +++ /dev/null @@ -1,380 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_common.h" -#include "fsl_lpflexcomm.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpflexcomm" -#endif - -/*! - * @brief Used for conversion between `void*` and `uint32_t`. - */ -typedef union pvoid_to_u32 -{ - void *pvoid; - uint32_t u32; -} pvoid_to_u32_t; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! @brief check whether lpflexcomm supports peripheral type */ -static bool LP_FLEXCOMM_PeripheralIsPresent(LP_FLEXCOMM_Type *base, LP_FLEXCOMM_PERIPH_T periph); - -/*! @brief Changes LP_FLEXCOMM mode. */ -static status_t LP_FLEXCOMM_SetPeriph(uint32_t instance, LP_FLEXCOMM_PERIPH_T periph, int lock); - -/*! @brief Common LPFLEXCOMM IRQhandle. */ -static void LP_FLEXCOMM_CommonIRQHandler(uint32_t instance); -/******************************************************************************* - * Variables - ******************************************************************************/ - -/*! @brief Array to map LP_FLEXCOMM instance number to base address. */ -static const uint32_t s_lpflexcommBaseAddrs[] = LP_FLEXCOMM_BASE_ADDRS; - -/*! @brief Array to map LP_FLEXCOMM instance PTRS. */ -static LP_FLEXCOMM_Type *const s_lpflexcommBase[] = LP_FLEXCOMM_BASE_PTRS; - -/*! @brief Pointers to real IRQ handlers installed by drivers for each instance. */ -static lpflexcomm_irq_handler_t s_lpflexcommIrqHandler[LP_FLEXCOMM_PERIPH_LPI2C + 1][ARRAY_SIZE(s_lpflexcommBaseAddrs)]; - -/*! @brief Pointers to handles for each instance to provide context to interrupt routines */ -static void *s_lpflexcommHandle[LP_FLEXCOMM_PERIPH_LPI2C + 1][ARRAY_SIZE(s_lpflexcommBaseAddrs)]; - -/*! @brief Array to map LP_FLEXCOMM instance number to IRQ number. */ -IRQn_Type const kFlexcommIrqs[] = LP_FLEXCOMM_IRQS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief IDs of clock for each LP_FLEXCOMM module */ -static const clock_ip_name_t s_lpflexcommClocks[] = LP_FLEXCOMM_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_FEATURE_LP_FLEXCOMM_HAS_NO_RESET) && FSL_FEATURE_LP_FLEXCOMM_HAS_NO_RESET) -/*! @brief Pointers to LP_FLEXCOMM resets for each instance. */ -static const reset_ip_name_t s_lpflexcommResets[] = LP_FLEXCOMM_RSTS; -#endif -/******************************************************************************* - * Code - ******************************************************************************/ - -/* check whether lpflexcomm supports peripheral type */ -static bool LP_FLEXCOMM_PeripheralIsPresent(LP_FLEXCOMM_Type *base, LP_FLEXCOMM_PERIPH_T periph) -{ - if (periph == LP_FLEXCOMM_PERIPH_NONE) - { - return true; - } - else if (periph <= LP_FLEXCOMM_PERIPH_LPI2C) - { - return (base->PSELID & (1UL << ((uint32_t)periph + 3U))) > 0UL ? true : false; - } - else if (periph == LP_FLEXCOMM_PERIPH_LPI2CAndLPUART) - { - return true; - } - else - { - return false; - } -} - -/*! @brief Returns for LP_FLEXCOMM base address. */ -uint32_t LP_FLEXCOMM_GetBaseAddress(uint32_t instance) -{ - if(instance < (uint32_t)ARRAY_SIZE(s_lpflexcommBaseAddrs)) - { - return s_lpflexcommBaseAddrs[instance]; - } - return 0U; -} - -/*! brief Returns for LP_FLEXCOMM interrupt source,see #_lpflexcomm_interrupt_flag. */ -uint32_t LP_FLEXCOMM_GetInterruptStatus(uint32_t instance) -{ - LP_FLEXCOMM_Type *base = s_lpflexcommBase[instance]; - return base->ISTAT; -} - -/* Get the index corresponding to the LP_FLEXCOMM */ -/*! brief Returns instance number for LP_FLEXCOMM module with given base address. */ -uint32_t LP_FLEXCOMM_GetInstance(void *base) -{ - uint32_t i; - pvoid_to_u32_t BaseAddr; - BaseAddr.pvoid = base; - - for (i = 0U; i < (uint32_t)ARRAY_SIZE(s_lpflexcommBaseAddrs); i++) - { - if (BaseAddr.u32 == s_lpflexcommBaseAddrs[i]) - { - break; - } - } - - assert(i < (uint32_t)ARRAY_SIZE(s_lpflexcommBaseAddrs)); - return i; -} - -/* Changes LP_FLEXCOMM mode */ -static status_t LP_FLEXCOMM_SetPeriph(uint32_t instance, LP_FLEXCOMM_PERIPH_T periph, int lock) -{ - assert(periph <= LP_FLEXCOMM_PERIPH_LPI2CAndLPUART); - LP_FLEXCOMM_Type *base = s_lpflexcommBase[instance]; - - /* Check whether peripheral type is present */ - if (!LP_FLEXCOMM_PeripheralIsPresent(base, periph)) - { - return kStatus_OutOfRange; - } - - /* Flexcomm is locked to different peripheral type than expected */ - if (((base->PSELID & LP_FLEXCOMM_PSELID_LOCK_MASK) != 0U) && - ((base->PSELID & LP_FLEXCOMM_PSELID_PERSEL_MASK) != (uint32_t)periph)) - { - return kStatus_Fail; - } - - /* Check if we are asked to lock */ - if (lock != 0) - { - base->PSELID = (uint32_t)periph | LP_FLEXCOMM_PSELID_LOCK_MASK; - } - else - { - base->PSELID = (uint32_t)periph; - } - - return kStatus_Success; -} - -/*! brief Initializes LP_FLEXCOMM and selects peripheral mode according to the second parameter. */ -status_t LP_FLEXCOMM_Init(uint32_t instance, LP_FLEXCOMM_PERIPH_T periph) -{ - assert(instance < (uint32_t)ARRAY_SIZE(s_lpflexcommBase)); -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the peripheral clock */ - CLOCK_EnableClock(s_lpflexcommClocks[instance]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_FEATURE_LP_FLEXCOMM_HAS_NO_RESET) && FSL_FEATURE_LP_FLEXCOMM_HAS_NO_RESET) - /* Reset the LP_FLEXCOMM module before configuring it.*/ - RESET_ClearPeripheralReset(s_lpflexcommResets[instance]); -#endif - /* Set the LP_FLEXCOMM to given peripheral */ - return LP_FLEXCOMM_SetPeriph(instance, periph, 0); -} - -/*! brief Deinitializes LP_FLEXCOMM. */ -void LP_FLEXCOMM_Deinit(uint32_t instance) -{ - assert(instance < (uint32_t)ARRAY_SIZE(s_lpflexcommBase)); -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable the peripheral clock */ - CLOCK_DisableClock(s_lpflexcommClocks[instance]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - RESET_SetPeripheralReset(s_lpflexcommResets[instance]); -} - -/*! brief Sets IRQ handler for given LP_FLEXCOMM module. It is used by drivers register IRQ handler according to - * LP_FLEXCOMM mode */ -void LP_FLEXCOMM_SetIRQHandler(uint32_t instance, - lpflexcomm_irq_handler_t handler, - void *lpflexcommHandle, - LP_FLEXCOMM_PERIPH_T periph) -{ - assert(instance < (uint32_t)ARRAY_SIZE(s_lpflexcommBase)); - /* Clear handler first to avoid execution of the handler with wrong handle */ - s_lpflexcommIrqHandler[periph][instance] = NULL; - s_lpflexcommHandle[periph][instance] = lpflexcommHandle; - s_lpflexcommIrqHandler[periph][instance] = handler; -} - -static void LP_FLEXCOMM_CommonIRQHandler(uint32_t instance) -{ - uint32_t interruptStat; - - interruptStat = LP_FLEXCOMM_GetInterruptStatus(instance); - if ((interruptStat & - ((uint32_t)kLPFLEXCOMM_I2cSlaveInterruptFlag | (uint32_t)kLPFLEXCOMM_I2cMasterInterruptFlag)) != 0U) - { - if (s_lpflexcommIrqHandler[LP_FLEXCOMM_PERIPH_LPI2C][instance] != NULL) - { - s_lpflexcommIrqHandler[LP_FLEXCOMM_PERIPH_LPI2C][instance]( - instance, s_lpflexcommHandle[LP_FLEXCOMM_PERIPH_LPI2C][instance]); - } - } - if ((interruptStat & ((uint32_t)kLPFLEXCOMM_UartRxInterruptFlag | (uint32_t)kLPFLEXCOMM_UartTxInterruptFlag)) != 0U) - { - if (s_lpflexcommIrqHandler[LP_FLEXCOMM_PERIPH_LPUART][instance] != NULL) - { - s_lpflexcommIrqHandler[LP_FLEXCOMM_PERIPH_LPUART][instance]( - instance, s_lpflexcommHandle[LP_FLEXCOMM_PERIPH_LPUART][instance]); - } - } - if (((interruptStat & (uint32_t)kLPFLEXCOMM_SpiInterruptFlag)) != 0U) - { - if (s_lpflexcommIrqHandler[LP_FLEXCOMM_PERIPH_LPSPI][instance] != NULL) - { - s_lpflexcommIrqHandler[LP_FLEXCOMM_PERIPH_LPSPI][instance]( - instance, s_lpflexcommHandle[LP_FLEXCOMM_PERIPH_LPSPI][instance]); - } - } - SDK_ISR_EXIT_BARRIER; -} - -/* IRQ handler functions overloading weak symbols in the startup */ -#if defined(LP_FLEXCOMM0) -void LP_FLEXCOMM0_DriverIRQHandler(void); -void LP_FLEXCOMM0_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(0U); -} -#endif - -#if defined(LP_FLEXCOMM1) -void LP_FLEXCOMM1_DriverIRQHandler(void); -void LP_FLEXCOMM1_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(1U); -} -#endif - -#if defined(LP_FLEXCOMM2) -void LP_FLEXCOMM2_DriverIRQHandler(void); -void LP_FLEXCOMM2_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(2U); -} -#endif - -#if defined(LP_FLEXCOMM3) -void LP_FLEXCOMM3_DriverIRQHandler(void); -void LP_FLEXCOMM3_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(3U); -} -#endif - -#if defined(LP_FLEXCOMM4) -void LP_FLEXCOMM4_DriverIRQHandler(void); -void LP_FLEXCOMM4_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(4U); -} -#endif - -#if defined(LP_FLEXCOMM5) -void LP_FLEXCOMM5_DriverIRQHandler(void); -void LP_FLEXCOMM5_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(5U); -} -#endif - -#if defined(LP_FLEXCOMM6) -void LP_FLEXCOMM6_DriverIRQHandler(void); -void LP_FLEXCOMM6_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(6U); -} -#endif - -#if defined(LP_FLEXCOMM7) -void LP_FLEXCOMM7_DriverIRQHandler(void); -void LP_FLEXCOMM7_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(7U); -} -#endif - -#if defined(LP_FLEXCOMM8) -void LP_FLEXCOMM8_DriverIRQHandler(void); -void LP_FLEXCOMM8_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(8U); -} -#endif - -#if defined(LP_FLEXCOMM9) -void LP_FLEXCOMM9_DriverIRQHandler(void); -void LP_FLEXCOMM9_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(9U); -} -#endif - -#if defined(LP_FLEXCOMM10) -void LP_FLEXCOMM10_DriverIRQHandler(void); -void LP_FLEXCOMM10_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(10U); -} -#endif - -#if defined(LP_FLEXCOMM11) -void LP_FLEXCOMM11_DriverIRQHandler(void); -void LP_FLEXCOMM11_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(11U); -} -#endif - -#if defined(LP_FLEXCOMM12) -void LP_FLEXCOMM12_DriverIRQHandler(void); -void LP_FLEXCOMM12_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(12U); -} -#endif - -#if defined(LP_FLEXCOMM13) -void LP_FLEXCOMM13_DriverIRQHandler(void); -void LP_FLEXCOMM13_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(13U); -} -#endif - -#if defined(LP_FLEXCOMM17) -void LP_FLEXCOMM17_DriverIRQHandler(void); -void LP_FLEXCOMM17_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(17U); -} -#endif - -#if defined(LP_FLEXCOMM18) -void LP_FLEXCOMM18_DriverIRQHandler(void); -void LP_FLEXCOMM18_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(18U); -} -#endif - -#if defined(LP_FLEXCOMM19) -void LP_FLEXCOMM19_DriverIRQHandler(void); -void LP_FLEXCOMM19_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(19U); -} -#endif - -#if defined(LP_FLEXCOMM20) -void LP_FLEXCOMM20_DriverIRQHandler(void); -void LP_FLEXCOMM20_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(20U); -} -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpflexcomm.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpflexcomm.h deleted file mode 100644 index 3dc449b653a..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpflexcomm.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LP_FLEXCOMM_H_ -#define FSL_LP_FLEXCOMM_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup lpflexcomm_driver - * @{ - */ - -/*! @name Driver version */ -/*@{*/ -/*! @brief FlexCOMM driver version. */ -#define FSL_LP_FLEXCOMM_DRIVER_VERSION (MAKE_VERSION(2, 2, 1)) -/*@}*/ - -/*! @brief LP_FLEXCOMM peripheral modes. */ -typedef enum -{ - LP_FLEXCOMM_PERIPH_NONE, /*!< No peripheral */ - LP_FLEXCOMM_PERIPH_LPUART, /*!< LPUART peripheral */ - LP_FLEXCOMM_PERIPH_LPSPI, /*!< LPSPI Peripheral */ - LP_FLEXCOMM_PERIPH_LPI2C, /*!< LPI2C Peripheral */ - LP_FLEXCOMM_PERIPH_LPI2CAndLPUART = 7, /*!< LPI2C and LPUART Peripheral */ -} LP_FLEXCOMM_PERIPH_T; - -/*! @brief LP_FLEXCOMM interrupt source flags. */ -enum _lpflexcomm_interrupt_flag -{ - kLPFLEXCOMM_I2cSlaveInterruptFlag = LP_FLEXCOMM_ISTAT_I2CS_MASK, /* LPI2C slave interrupt. */ - kLPFLEXCOMM_I2cMasterInterruptFlag = LP_FLEXCOMM_ISTAT_I2CM_MASK, /* LPI2C master interrupt. */ - kLPFLEXCOMM_SpiInterruptFlag = LP_FLEXCOMM_ISTAT_SPI_MASK, /* LPSPI interrupt. */ - kLPFLEXCOMM_UartRxInterruptFlag = LP_FLEXCOMM_ISTAT_UARTRX_MASK, /* LPUART RX interrupt. */ - kLPFLEXCOMM_UartTxInterruptFlag = LP_FLEXCOMM_ISTAT_UARTTX_MASK, /* LPUART TX interrupt. */ - - kLPFLEXCOMM_AllInterruptFlag = kLPFLEXCOMM_I2cSlaveInterruptFlag | kLPFLEXCOMM_I2cMasterInterruptFlag | - kLPFLEXCOMM_SpiInterruptFlag | kLPFLEXCOMM_UartRxInterruptFlag | - kLPFLEXCOMM_UartTxInterruptFlag, -}; - -/*! @brief Typedef for interrupt handler. */ -typedef void (*lpflexcomm_irq_handler_t)(uint32_t instance, void *handle); - -/*! @brief Array with IRQ number for each LP_FLEXCOMM module. */ -extern IRQn_Type const kFlexcommIrqs[]; - -/******************************************************************************* - * API - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! @brief Returns instance number for LP_FLEXCOMM module with given base address. */ -uint32_t LP_FLEXCOMM_GetInstance(void *base); - -/*! @brief Returns for LP_FLEXCOMM base address. */ -uint32_t LP_FLEXCOMM_GetBaseAddress(uint32_t instance); - -/*! brief Returns for LP_FLEXCOMM interrupt source,see #_lpflexcomm_interrupt_flag. */ -uint32_t LP_FLEXCOMM_GetInterruptStatus(uint32_t instance); - -/*! @brief Initializes LP_FLEXCOMM and selects peripheral mode according to the second parameter. */ -status_t LP_FLEXCOMM_Init(uint32_t instance, LP_FLEXCOMM_PERIPH_T periph); - -/*! @brief Deinitializes LP_FLEXCOMM. */ -void LP_FLEXCOMM_Deinit(uint32_t instance); - -/*! @brief Sets IRQ handler for given LP_FLEXCOMM module. It is used by drivers register IRQ handler according to - * LP_FLEXCOMM mode */ -void LP_FLEXCOMM_SetIRQHandler(uint32_t instance, - lpflexcomm_irq_handler_t handler, - void *lpflexcommHandle, - LP_FLEXCOMM_PERIPH_T periph); - -#if defined(__cplusplus) -} -#endif - -/*@}*/ - -#endif /* FSL_LP_FLEXCOMM_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpi2c.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpi2c.c deleted file mode 100644 index cfcb19ef98b..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpi2c.c +++ /dev/null @@ -1,2423 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpi2c.h" -#include -#include - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpflexcomm_lpi2c" -#endif - -/*! @brief Typedef for slave interrupt handler. */ -typedef void (*lpi2c_slave_isr_t)(uint32_t instance, void *handle); - -/*! - * @brief Used for conversion from `lpflexcomm_irq_handler_t` to `lpi2c_master_isr_t` - */ -typedef union lpi2c_to_lpflexcomm -{ - lpi2c_master_isr_t lpi2c_master_handler; - lpi2c_slave_isr_t lpi2c_slave_handler; - lpflexcomm_irq_handler_t lpflexcomm_handler; -} lpi2c_to_lpflexcomm_t; - -/* ! @brief LPI2C master fifo commands. */ -enum -{ - kTxDataCmd = LPI2C_MTDR_CMD(0x0U), /*!< Transmit DATA[7:0] */ - kRxDataCmd = LPI2C_MTDR_CMD(0X1U), /*!< Receive (DATA[7:0] + 1) bytes */ - kStopCmd = LPI2C_MTDR_CMD(0x2U), /*!< Generate STOP condition */ - kStartCmd = LPI2C_MTDR_CMD(0x4U), /*!< Generate(repeated) START and transmit address in DATA[[7:0] */ -}; - -/*! - * @brief Default watermark values. - * - * The default watermarks are set to zero. - */ -enum -{ - kDefaultTxWatermark = 0, - kDefaultRxWatermark = 0, -}; - -/*! @brief States for the state machine used by transactional APIs. */ -enum -{ - kIdleState = 0, - kSendCommandState, - kIssueReadCommandState, - kTransferDataState, - kStopState, - kWaitForCompletionState, -}; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -static uint32_t LPI2C_GetCyclesForWidth( - uint32_t sourceClock_Hz, uint32_t width_ns, uint32_t minCycles, uint32_t maxCycles, uint32_t prescaler); - -static status_t LPI2C_MasterWaitForTxReady(LPI2C_Type *base); - -static status_t LPI2C_RunTransferStateMachine(LPI2C_Type *base, lpi2c_master_handle_t *handle, bool *isDone); - -static void LPI2C_InitTransferStateMachine(lpi2c_master_handle_t *handle); - -static status_t LPI2C_SlaveCheckAndClearError(LPI2C_Type *base, uint32_t flags); - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/*! @brief Array to map LPI2C instance number to base pointer. */ -static LPI2C_Type *const kLpi2cBases[] = LPI2C_BASE_PTRS; - -/*! @brief Array to map LPI2C instance number to IRQ number, used internally for LPI2C master interrupt and EDMA -transactional APIs. */ -IRQn_Type const kLpi2cIrqs[] = LPI2C_IRQS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Array to map LPI2C instance number to clock gate enum. */ -static clock_ip_name_t const kLpi2cClocks[] = LPI2C_CLOCKS; - -#if defined(LPI2C_PERIPH_CLOCKS) -/*! @brief Array to map LPI2C instance number to pheripheral clock gate enum. */ -static const clock_ip_name_t kLpi2cPeriphClocks[] = LPI2C_PERIPH_CLOCKS; -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/*! @brief Pointer to master IRQ handler for each instance, used internally for LPI2C master interrupt and EDMA -transactional APIs. */ -lpi2c_master_isr_t s_lpi2cMasterIsr; - -/*! @brief Pointer to slave IRQ handler for each instance. */ -static lpi2c_slave_isr_t s_lpi2cSlaveIsr; - -/*! @brief Pointers to master handles for each instance, used internally for LPI2C master interrupt and EDMA -transactional APIs. */ -void *s_lpi2cMasterHandle[ARRAY_SIZE(kLpi2cBases)]; - -/*! @brief Pointers to slave handles for each instance. */ -static lpi2c_slave_handle_t *s_lpi2cSlaveHandle[ARRAY_SIZE(kLpi2cBases)]; - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Returns an instance number given a base address. - * - * If an invalid base address is passed, debug builds will assert. Release builds will just return - * instance number 0. - * - * param base The LPI2C peripheral base address. - * return LPI2C instance number starting from 0. - */ -uint32_t LPI2C_GetInstance(LPI2C_Type *base) -{ - uint32_t instance; - for (instance = 0U; instance < ARRAY_SIZE(kLpi2cBases); ++instance) - { - if (kLpi2cBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(kLpi2cBases)); - return instance; -} - -/*! - * @brief Computes a cycle count for a given time in nanoseconds. - * @param sourceClock_Hz LPI2C functional clock frequency in Hertz. - * @param width_ns Desired with in nanoseconds. - * @param minCycles Minimum cycle count. - * @param maxCycles Maximum cycle count. - * @param prescaler LPI2C prescaler setting. If the cycle period is not affected by the prescaler value, set it to 0. - */ -static uint32_t LPI2C_GetCyclesForWidth( - uint32_t sourceClock_Hz, uint32_t width_ns, uint32_t minCycles, uint32_t maxCycles, uint32_t prescaler) -{ - assert(sourceClock_Hz > 0U); - - uint32_t divider = 1U; - - while (prescaler != 0U) - { - divider *= 2U; - prescaler--; - } - - uint32_t busCycle_ns = 1000000U / (sourceClock_Hz / divider / 1000U); - /* Calculate the cycle count, round up the calculated value. */ - uint32_t cycles = (width_ns * 10U / busCycle_ns + 5U) / 10U; - - /* If the calculated value is smaller than the minimum value, use the minimum value */ - if (cycles < minCycles) - { - cycles = minCycles; - } - /* If the calculated value is larger than the maximum value, use the maxmum value */ - if (cycles > maxCycles) - { - cycles = maxCycles; - } - - return cycles; -} - -/*! - * @brief Convert provided flags to status code, and clear any errors if present. - * @param base The LPI2C peripheral base address. - * @param status Current status flags value that will be checked. - * @retval #kStatus_Success - * @retval #kStatus_LPI2C_PinLowTimeout - * @retval #kStatus_LPI2C_ArbitrationLost - * @retval #kStatus_LPI2C_Nak - * @retval #kStatus_LPI2C_FifoError - */ -/* Not static so it can be used from fsl_lpi2c_edma.c. */ -status_t LPI2C_MasterCheckAndClearError(LPI2C_Type *base, uint32_t status) -{ - status_t result = kStatus_Success; - - /* Check for error. These errors cause a stop to automatically be sent. We must */ - /* clear the errors before a new transfer can start. */ - status &= (uint32_t)kLPI2C_MasterErrorFlags; - if (0U != status) - { - /* Select the correct error code. Ordered by severity, with bus issues first. */ - if (0U != (status & (uint32_t)kLPI2C_MasterPinLowTimeoutFlag)) - { - result = kStatus_LPI2C_PinLowTimeout; - } - else if (0U != (status & (uint32_t)kLPI2C_MasterArbitrationLostFlag)) - { - result = kStatus_LPI2C_ArbitrationLost; - } - else if (0U != (status & (uint32_t)kLPI2C_MasterNackDetectFlag)) - { - result = kStatus_LPI2C_Nak; - } - else if (0U != (status & (uint32_t)kLPI2C_MasterFifoErrFlag)) - { - result = kStatus_LPI2C_FifoError; - } - else - { - ; /* Intentional empty */ - } - - /* Clear the flags. */ - LPI2C_MasterClearStatusFlags(base, status); - - /* Reset fifos. These flags clear automatically. */ - base->MCR |= LPI2C_MCR_RRF_MASK | LPI2C_MCR_RTF_MASK; - } - else - { - ; /* Intentional empty */ - } - - return result; -} - -/*! - * @brief Wait until there is room in the tx fifo. - * @param base The LPI2C peripheral base address. - * @retval #kStatus_Success - * @retval #kStatus_LPI2C_PinLowTimeout - * @retval #kStatus_LPI2C_ArbitrationLost - * @retval #kStatus_LPI2C_Nak - * @retval #kStatus_LPI2C_FifoError - */ -static status_t LPI2C_MasterWaitForTxReady(LPI2C_Type *base) -{ - status_t result = kStatus_Success; - uint32_t status; - size_t txCount; - size_t txFifoSize = (size_t)FSL_FEATURE_LPI2C_FIFO_SIZEn(base); - -#if I2C_RETRY_TIMES != 0U - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - do - { - /* Get the number of words in the tx fifo and compute empty slots. */ - LPI2C_MasterGetFifoCounts(base, NULL, &txCount); - txCount = txFifoSize - txCount; - - /* Check for error flags. */ - status = LPI2C_MasterGetStatusFlags(base); - result = LPI2C_MasterCheckAndClearError(base, status); - if (kStatus_Success != result) - { - break; - } -#if I2C_RETRY_TIMES != 0U - waitTimes--; - } while ((0U == txCount) && (0U != waitTimes)); - - if (0U == waitTimes) - { - result = kStatus_LPI2C_Timeout; - } -#else - } while (0U == txCount); -#endif - - return result; -} - -/*! - * @brief Make sure the bus isn't already busy. - * - * A busy bus is allowed if we are the one driving it. - * - * @param base The LPI2C peripheral base address. - * @retval #kStatus_Success - * @retval #kStatus_LPI2C_Busy - */ -/* Not static so it can be used from fsl_lpi2c_edma.c. */ -status_t LPI2C_CheckForBusyBus(LPI2C_Type *base) -{ - status_t ret = kStatus_Success; - - uint32_t status = LPI2C_MasterGetStatusFlags(base); - if ((0U != (status & (uint32_t)kLPI2C_MasterBusBusyFlag)) && (0U == (status & (uint32_t)kLPI2C_MasterBusyFlag))) - { - ret = kStatus_LPI2C_Busy; - } - - return ret; -} - -/*! - * brief Provides a default configuration for the LPI2C master peripheral. - * - * This function provides the following default configuration for the LPI2C master peripheral: - * code - * masterConfig->enableMaster = true; - * masterConfig->debugEnable = false; - * masterConfig->ignoreAck = false; - * masterConfig->pinConfig = kLPI2C_2PinOpenDrain; - * masterConfig->baudRate_Hz = 100000U; - * masterConfig->busIdleTimeout_ns = 0U; - * masterConfig->pinLowTimeout_ns = 0U; - * masterConfig->sdaGlitchFilterWidth_ns = 0U; - * masterConfig->sclGlitchFilterWidth_ns = 0U; - * masterConfig->hostRequest.enable = false; - * masterConfig->hostRequest.source = kLPI2C_HostRequestExternalPin; - * masterConfig->hostRequest.polarity = kLPI2C_HostRequestPinActiveHigh; - * endcode - * - * After calling this function, you can override any settings in order to customize the configuration, - * prior to initializing the master driver with LPI2C_MasterInit(). - * - * param[out] masterConfig User provided configuration structure for default values. Refer to #lpi2c_master_config_t. - */ -void LPI2C_MasterGetDefaultConfig(lpi2c_master_config_t *masterConfig) -{ - /* Initializes the configure structure to zero. */ - (void)memset(masterConfig, 0, sizeof(*masterConfig)); - - masterConfig->enableMaster = true; - masterConfig->debugEnable = false; - masterConfig->enableDoze = true; - masterConfig->ignoreAck = false; - masterConfig->pinConfig = kLPI2C_2PinOpenDrain; - masterConfig->baudRate_Hz = 100000U; - masterConfig->busIdleTimeout_ns = 0U; /* Set to 0 to disable the function */ - masterConfig->pinLowTimeout_ns = 0U; /* Set to 0 to disable the function */ - masterConfig->sdaGlitchFilterWidth_ns = 0U; /* Set to 0 to disable the function */ - masterConfig->sclGlitchFilterWidth_ns = 0U; /* Set to 0 to disable the function */ - masterConfig->hostRequest.enable = false; - masterConfig->hostRequest.source = kLPI2C_HostRequestExternalPin; - masterConfig->hostRequest.polarity = kLPI2C_HostRequestPinActiveHigh; -} - -/*! - * brief Initializes the LPI2C master peripheral. - * - * This function enables the peripheral clock and initializes the LPI2C master peripheral as described by the user - * provided configuration. A software reset is performed prior to configuration. - * - * param base The LPI2C peripheral base address. - * param masterConfig User provided peripheral configuration. Use LPI2C_MasterGetDefaultConfig() to get a set of - * defaults - * that you can override. - * param sourceClock_Hz Frequency in Hertz of the LPI2C functional clock. Used to calculate the baud rate divisors, - * filter widths, and timeout periods. - */ -void LPI2C_MasterInit(LPI2C_Type *base, const lpi2c_master_config_t *masterConfig, uint32_t sourceClock_Hz) -{ - uint32_t prescaler; - uint32_t cycles; - uint32_t cfgr2; - uint32_t value; - uint32_t instance = LPI2C_GetInstance(base); - - if(LP_FLEXCOMM_GetBaseAddress(instance) != 0U) - { - -#if !(defined(LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) && LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) - /* initialize flexcomm to LPI2C mode */ - status_t status = LP_FLEXCOMM_Init(instance, LP_FLEXCOMM_PERIPH_LPI2C); - if (kStatus_Success != status) - { - assert(false); - } -#endif /* LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER */ - - } - else - { - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate the clock. */ - (void)CLOCK_EnableClock(kLpi2cClocks[instance]); -#if defined(LPI2C_PERIPH_CLOCKS) - /* Ungate the functional clock in initialize function. */ - CLOCK_EnableClock(kLpi2cPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - } - - /* Reset peripheral before configuring it. */ - LPI2C_MasterReset(base); - - /* Doze bit: 0 is enable, 1 is disable */ - base->MCR = LPI2C_MCR_DBGEN(masterConfig->debugEnable) | LPI2C_MCR_DOZEN(!(masterConfig->enableDoze)); - - /* host request */ - value = base->MCFGR0; - value &= (~(LPI2C_MCFGR0_HREN_MASK | LPI2C_MCFGR0_HRPOL_MASK | LPI2C_MCFGR0_HRSEL_MASK)); - value |= LPI2C_MCFGR0_HREN(masterConfig->hostRequest.enable) | - LPI2C_MCFGR0_HRPOL(masterConfig->hostRequest.polarity) | - LPI2C_MCFGR0_HRSEL(masterConfig->hostRequest.source); - base->MCFGR0 = value; - - /* pin config and ignore ack */ - value = base->MCFGR1; - value &= ~(LPI2C_MCFGR1_PINCFG_MASK | LPI2C_MCFGR1_IGNACK_MASK); - value |= LPI2C_MCFGR1_PINCFG(masterConfig->pinConfig); - value |= LPI2C_MCFGR1_IGNACK(masterConfig->ignoreAck); - base->MCFGR1 = value; - - LPI2C_MasterSetWatermarks(base, (size_t)kDefaultTxWatermark, (size_t)kDefaultRxWatermark); - - /* Configure glitch filters. */ - cfgr2 = base->MCFGR2; - if (0U != (masterConfig->sdaGlitchFilterWidth_ns)) - { - /* Calculate SDA filter width. The width is equal to FILTSDA cycles of functional clock. - And set FILTSDA to 0 disables the fileter, so the min value is 1. */ - cycles = LPI2C_GetCyclesForWidth(sourceClock_Hz, masterConfig->sdaGlitchFilterWidth_ns, 1U, - (LPI2C_MCFGR2_FILTSDA_MASK >> LPI2C_MCFGR2_FILTSDA_SHIFT), 0U); - cfgr2 &= ~LPI2C_MCFGR2_FILTSDA_MASK; - cfgr2 |= LPI2C_MCFGR2_FILTSDA(cycles); - } - if (0U != masterConfig->sclGlitchFilterWidth_ns) - { - /* Calculate SDL filter width. The width is equal to FILTSCL cycles of functional clock. - And set FILTSCL to 0 disables the fileter, so the min value is 1. */ - cycles = LPI2C_GetCyclesForWidth(sourceClock_Hz, masterConfig->sclGlitchFilterWidth_ns, 1U, - (LPI2C_MCFGR2_FILTSCL_MASK >> LPI2C_MCFGR2_FILTSCL_SHIFT), 0U); - cfgr2 &= ~LPI2C_MCFGR2_FILTSCL_MASK; - cfgr2 |= LPI2C_MCFGR2_FILTSCL(cycles); - } - base->MCFGR2 = cfgr2; - - /* Configure baudrate after the SDA/SCL glitch filter setting, - since the baudrate calculation needs them as parameter. */ - LPI2C_MasterSetBaudRate(base, sourceClock_Hz, masterConfig->baudRate_Hz); - - /* Configure bus idle and pin low timeouts after baudrate setting, - since the timeout calculation needs prescaler as parameter. */ - prescaler = (base->MCFGR1 & LPI2C_MCFGR1_PRESCALE_MASK) >> LPI2C_MCFGR1_PRESCALE_SHIFT; - - if (0U != (masterConfig->busIdleTimeout_ns)) - { - /* Calculate bus idle timeout value. The value is equal to BUSIDLE cycles of functional clock divided by - prescaler. And set BUSIDLE to 0 disables the fileter, so the min value is 1. */ - cycles = LPI2C_GetCyclesForWidth(sourceClock_Hz, masterConfig->busIdleTimeout_ns, 1U, - (LPI2C_MCFGR2_BUSIDLE_MASK >> LPI2C_MCFGR2_BUSIDLE_SHIFT), prescaler); - cfgr2 &= ~LPI2C_MCFGR2_BUSIDLE_MASK; - cfgr2 |= LPI2C_MCFGR2_BUSIDLE(cycles); - } - base->MCFGR2 = cfgr2; - if (0U != masterConfig->pinLowTimeout_ns) - { - /* Calculate bus pin low timeout value. The value is equal to PINLOW cycles of functional clock divided by - prescaler. And set PINLOW to 0 disables the fileter, so the min value is 1. */ - cycles = LPI2C_GetCyclesForWidth(sourceClock_Hz, masterConfig->pinLowTimeout_ns / 256U, 1U, - (LPI2C_MCFGR2_BUSIDLE_MASK >> LPI2C_MCFGR2_BUSIDLE_SHIFT), prescaler); - base->MCFGR3 = (base->MCFGR3 & ~LPI2C_MCFGR3_PINLOW_MASK) | LPI2C_MCFGR3_PINLOW(cycles); - } - - LPI2C_MasterEnable(base, masterConfig->enableMaster); -} - -/*! - * brief Deinitializes the LPI2C master peripheral. - * - * This function disables the LPI2C master peripheral and gates the clock. It also performs a software - * reset to restore the peripheral to reset conditions. - * - * param base The LPI2C peripheral base address. - */ -void LPI2C_MasterDeinit(LPI2C_Type *base) -{ - uint32_t instance = LPI2C_GetInstance(base); - - /* Restore to reset state. */ - LPI2C_MasterReset(base); - if(LP_FLEXCOMM_GetBaseAddress(instance) != 0U) - { - LP_FLEXCOMM_Deinit(instance); - } - else - { -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate clock. */ - (void)CLOCK_DisableClock(kLpi2cClocks[instance]); -#if defined(LPI2C_PERIPH_CLOCKS) - /* Gate the functional clock. */ - CLOCK_DisableClock(kLpi2cPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - } -#if !(defined(LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) && LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) - LP_FLEXCOMM_Deinit(LPI2C_GetInstance(base)); -#endif -} - -/*! - * brief Configures LPI2C master data match feature. - * - * param base The LPI2C peripheral base address. - * param matchConfig Settings for the data match feature. - */ -void LPI2C_MasterConfigureDataMatch(LPI2C_Type *base, const lpi2c_data_match_config_t *matchConfig) -{ - /* Disable master mode. */ - bool wasEnabled = (0U != ((base->MCR & LPI2C_MCR_MEN_MASK) >> LPI2C_MCR_MEN_SHIFT)); - LPI2C_MasterEnable(base, false); - - base->MCFGR1 = (base->MCFGR1 & ~LPI2C_MCFGR1_MATCFG_MASK) | LPI2C_MCFGR1_MATCFG(matchConfig->matchMode); - base->MCFGR0 = (base->MCFGR0 & ~LPI2C_MCFGR0_RDMO_MASK) | LPI2C_MCFGR0_RDMO(matchConfig->rxDataMatchOnly); - base->MDMR = LPI2C_MDMR_MATCH0(matchConfig->match0) | LPI2C_MDMR_MATCH1(matchConfig->match1); - - /* Restore master mode. */ - if (wasEnabled) - { - LPI2C_MasterEnable(base, true); - } -} - -/*! - * brief Sets the I2C bus frequency for master transactions. - * - * The LPI2C master is automatically disabled and re-enabled as necessary to configure the baud - * rate. Do not call this function during a transfer, or the transfer is aborted. - * - * note Please note that the second parameter is the clock frequency of LPI2C module, the third - * parameter means user configured bus baudrate, this implementation is different from other I2C drivers - * which use baudrate configuration as second parameter and source clock frequency as third parameter. - * - * param base The LPI2C peripheral base address. - * param sourceClock_Hz LPI2C functional clock frequency in Hertz. - * param baudRate_Hz Requested bus frequency in Hertz. - */ -void LPI2C_MasterSetBaudRate(LPI2C_Type *base, uint32_t sourceClock_Hz, uint32_t baudRate_Hz) -{ - bool wasEnabled; - uint8_t filtScl = (uint8_t)((base->MCFGR2 & LPI2C_MCFGR2_FILTSCL_MASK) >> LPI2C_MCFGR2_FILTSCL_SHIFT); - - uint8_t divider = 1U; - uint8_t bestDivider = 1U; - uint8_t prescale = 0U; - uint8_t bestPre = 0U; - - uint8_t clkCycle; - uint8_t bestclkCycle = 0U; - - uint32_t absError = 0U; - uint32_t bestError = 0xffffffffu; - uint32_t computedRate; - - uint32_t tmpReg = 0U; - - /* Disable master mode. */ - wasEnabled = (0U != ((base->MCR & LPI2C_MCR_MEN_MASK) >> LPI2C_MCR_MEN_SHIFT)); - LPI2C_MasterEnable(base, false); - - /* Baud rate = (sourceClock_Hz / 2 ^ prescale) / (CLKLO + 1 + CLKHI + 1 + SCL_LATENCY) - * SCL_LATENCY = ROUNDDOWN((2 + FILTSCL) / (2 ^ prescale)) - */ - for (prescale = 0U; prescale <= 7U; prescale++) - { - /* Calculate the clkCycle, clkCycle = CLKLO + CLKHI, divider = 2 ^ prescale */ - clkCycle = (uint8_t)((10U * sourceClock_Hz / divider / baudRate_Hz + 5U) / 10U - (2U + filtScl) / divider - 2U); - /* According to register description, The max value for CLKLO and CLKHI is 63. - however to meet the I2C specification of tBUF, CLKHI should be less than - clkCycle - 0.52 x sourceClock_Hz / baudRate_Hz / divider + 1U. Refer to the comment of the tmpHigh's - calculation for details. So we have: - CLKHI < clkCycle - 0.52 x sourceClock_Hz / baudRate_Hz / divider + 1U, - clkCycle = CLKHI + CLKLO and - sourceClock_Hz / baudRate_Hz / divider = clkCycle + 2 + ROUNDDOWN((2 + FILTSCL) / divider), - we can come up with: CLKHI < 0.92 x CLKLO - ROUNDDOWN(2 + FILTSCL) / divider - so the max boundary of CLKHI should be 0.92 x 63 - ROUNDDOWN(2 + FILTSCL) / divider, - and the max boundary of clkCycle is 1.92 x 63 - ROUNDDOWN(2 + FILTSCL) / divider. */ - if (clkCycle > (120U - (2U + filtScl) / divider)) - { - divider *= 2U; - continue; - } - /* Calculate the computed baudrate and compare it with the desired baudrate */ - computedRate = (sourceClock_Hz / (uint32_t)divider) / - ((uint32_t)clkCycle + 2U + (2U + (uint32_t)filtScl) / (uint32_t)divider); - absError = baudRate_Hz > computedRate ? baudRate_Hz - computedRate : computedRate - baudRate_Hz; - if (absError < bestError) - { - bestPre = prescale; - bestDivider = divider; - bestclkCycle = clkCycle; - bestError = absError; - - /* If the error is 0, then we can stop searching because we won't find a better match. */ - if (absError == 0U) - { - break; - } - } - divider *= 2U; - } - - /* SCL low time tLO should be larger than or equal to SCL high time tHI: - tLO = ((CLKLO + 1) x (2 ^ PRESCALE)) >= tHI = ((CLKHI + 1 + SCL_LATENCY) x (2 ^ PRESCALE)), - which is CLKLO >= CLKHI + (2U + filtScl) / bestDivider. - Also since bestclkCycle = CLKLO + CLKHI, bestDivider = 2 ^ PRESCALE - which makes CLKHI <= (bestclkCycle - (2U + filtScl) / bestDivider) / 2U. - - The max tBUF should be at least 0.52 times of the SCL clock cycle: - tBUF = ((CLKLO + 1) x (2 ^ PRESCALE) / sourceClock_Hz) > (0.52 / baudRate_Hz), - plus bestDivider = 2 ^ PRESCALE, bestclkCycle = CLKLO + CLKHI we can come up with - CLKHI <= (bestclkCycle - 0.52 x sourceClock_Hz / baudRate_Hz / bestDivider + 1U). - In this case to get a safe CLKHI calculation, we can assume: - */ - uint8_t tmpHigh = (bestclkCycle - (2U + filtScl) / bestDivider) / 2U; - while (tmpHigh > (bestclkCycle - 52U * sourceClock_Hz / baudRate_Hz / bestDivider / 100U + 1U)) - { - tmpHigh = tmpHigh - 1U; - } - - /* Calculate DATAVD and SETHOLD. - To meet the timing requirement of I2C spec for standard mode, fast mode and fast mode plus: */ - /* The min tHD:STA/tSU:STA/tSU:STO should be at least 0.4 times of the SCL clock cycle, use 0.5 to be safe: - tHD:STA = ((SETHOLD + 1) x (2 ^ PRESCALE) / sourceClock_Hz) > (0.5 / baudRate_Hz), bestDivider = 2 ^ PRESCALE */ - uint8_t tmpHold = (uint8_t)(sourceClock_Hz / baudRate_Hz / bestDivider / 2U) - 1U; - - /* The max tVD:DAT/tVD:ACK/tHD:DAT should be at most 0.345 times of the SCL clock cycle, use 0.25 to be safe: - tVD:DAT = ((DATAVD + 1) x (2 ^ PRESCALE) / sourceClock_Hz) < (0.25 / baudRate_Hz), bestDivider = 2 ^ PRESCALE */ - uint8_t tmpDataVd = (uint8_t)(sourceClock_Hz / baudRate_Hz / bestDivider / 4U) - 1U; - - /* The min tSU:DAT should be at least 0.05 times of the SCL clock cycle: - tSU:DAT = ((2 + FILTSDA + 2 ^ PRESCALE) / sourceClock_Hz) >= (0.05 / baud), - plus bestDivider = 2 ^ PRESCALE, we can come up with: - FILTSDA >= (0.05 x sourceClock_Hz / baudRate_Hz - bestDivider - 2) */ - if ((sourceClock_Hz / baudRate_Hz / 20U) > (bestDivider + 2U)) - { - /* Read out the FILTSDA configuration, if it is smaller than expected, change the setting. */ - uint8_t filtSda = (uint8_t)((base->MCFGR2 & LPI2C_MCFGR2_FILTSDA_MASK) >> LPI2C_MCFGR2_FILTSDA_SHIFT); - if (filtSda < (sourceClock_Hz / baudRate_Hz / 20U - bestDivider - 2U)) - { - filtSda = (uint8_t)(sourceClock_Hz / baudRate_Hz / 20U) - bestDivider - 2U; - } - base->MCFGR2 = (base->MCFGR2 & ~LPI2C_MCFGR2_FILTSDA_MASK) | LPI2C_MCFGR2_FILTSDA(filtSda); - } - - /* Set CLKHI, CLKLO, SETHOLD, DATAVD value. */ - tmpReg = LPI2C_MCCR0_CLKHI((uint32_t)tmpHigh) | - LPI2C_MCCR0_CLKLO((uint32_t)((uint32_t)bestclkCycle - (uint32_t)tmpHigh)) | - LPI2C_MCCR0_SETHOLD((uint32_t)tmpHold) | LPI2C_MCCR0_DATAVD((uint32_t)tmpDataVd); - base->MCCR0 = tmpReg; - - /* Set PRESCALE value. */ - base->MCFGR1 = (base->MCFGR1 & ~LPI2C_MCFGR1_PRESCALE_MASK) | LPI2C_MCFGR1_PRESCALE(bestPre); - - /* Restore master mode. */ - if (wasEnabled) - { - LPI2C_MasterEnable(base, true); - } -} - -/*! - * brief Sends a START signal and slave address on the I2C bus. - * - * This function is used to initiate a new master mode transfer. First, the bus state is checked to ensure - * that another master is not occupying the bus. Then a START signal is transmitted, followed by the - * 7-bit address specified in the a address parameter. Note that this function does not actually wait - * until the START and address are successfully sent on the bus before returning. - * - * param base The LPI2C peripheral base address. - * param address 7-bit slave device address, in bits [6:0]. - * param dir Master transfer direction, either #kLPI2C_Read or #kLPI2C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * retval #kStatus_Success START signal and address were successfully enqueued in the transmit FIFO. - * retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - */ -status_t LPI2C_MasterStart(LPI2C_Type *base, uint8_t address, lpi2c_direction_t dir) -{ - /* Return an error if the bus is already in use not by us. */ - status_t result = LPI2C_CheckForBusyBus(base); - if (kStatus_Success == result) - { - /* Clear all flags. */ - LPI2C_MasterClearStatusFlags(base, (uint32_t)kLPI2C_MasterClearFlags); - - /* Turn off auto-stop option. */ - base->MCFGR1 &= ~LPI2C_MCFGR1_AUTOSTOP_MASK; - - /* Wait until there is room in the fifo. */ - result = LPI2C_MasterWaitForTxReady(base); - if (kStatus_Success == result) - { - /* Issue start command. */ - base->MTDR = (uint32_t)kStartCmd | (((uint32_t)address << 1U) | (uint32_t)dir); - } - } - - return result; -} - -/*! - * brief Sends a STOP signal on the I2C bus. - * - * This function does not return until the STOP signal is seen on the bus, or an error occurs. - * - * param base The LPI2C peripheral base address. - * retval #kStatus_Success The STOP signal was successfully sent on the bus and the transaction terminated. - * retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_LPI2C_FifoError FIFO under run or overrun. - * retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterStop(LPI2C_Type *base) -{ - /* Wait until there is room in the fifo. */ - status_t result = LPI2C_MasterWaitForTxReady(base); - if (kStatus_Success == result) - { - /* Send the STOP signal */ - base->MTDR = (uint32_t)kStopCmd; - - /* Wait for the stop detected flag to set, indicating the transfer has completed on the bus. */ - /* Also check for errors while waiting. */ -#if I2C_RETRY_TIMES != 0U - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - -#if I2C_RETRY_TIMES != 0U - while ((result == kStatus_Success) && (0U != waitTimes)) - { - waitTimes--; -#else - while (result == kStatus_Success) - { -#endif - uint32_t status = LPI2C_MasterGetStatusFlags(base); - - /* Check for error flags. */ - result = LPI2C_MasterCheckAndClearError(base, status); - - /* Check if the stop was sent successfully. */ - if ((0U != (status & (uint32_t)kLPI2C_MasterStopDetectFlag)) && - (0U != (status & (uint32_t)kLPI2C_MasterTxReadyFlag))) - { - LPI2C_MasterClearStatusFlags(base, (uint32_t)kLPI2C_MasterStopDetectFlag); - break; - } - } - -#if I2C_RETRY_TIMES != 0U - if (0U == waitTimes) - { - result = kStatus_LPI2C_Timeout; - } -#endif - } - - return result; -} - -/*! - * brief Performs a polling receive transfer on the I2C bus. - * - * param base The LPI2C peripheral base address. - * param rxBuff The pointer to the data to be transferred. - * param rxSize The length in bytes of the data to be transferred. - * retval #kStatus_Success Data was received successfully. - * retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_LPI2C_FifoError FIFO under run or overrun. - * retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterReceive(LPI2C_Type *base, void *rxBuff, size_t rxSize) -{ - assert(NULL != rxBuff); - - status_t result = kStatus_Success; - uint8_t *buf; - size_t tmpRxSize = rxSize; -#if I2C_RETRY_TIMES != 0U - uint32_t waitTimes; -#endif - - /* Check transfer data size. */ - if (rxSize > (256UL * (uint32_t)FSL_FEATURE_LPI2C_FIFO_SIZEn(base))) - { - return kStatus_InvalidArgument; - } - - /* Handle empty read. */ - if (rxSize != 0U) - { - /* Wait until there is room in the command fifo. */ - result = LPI2C_MasterWaitForTxReady(base); - if (kStatus_Success == result) - { - /* Issue command to receive data. A single write to MTDR can issue read operation of 0xFFU + 1 byte of data - at most, so when the rxSize is larger than 0x100U, push multiple read commands to MTDR until rxSize is - reached. */ - while (tmpRxSize != 0U) - { - if (tmpRxSize > 256U) - { - base->MTDR = (uint32_t)(kRxDataCmd) | (uint32_t)LPI2C_MTDR_DATA(0xFFU); - tmpRxSize -= 256U; - } - else - { - base->MTDR = (uint32_t)(kRxDataCmd) | (uint32_t)LPI2C_MTDR_DATA(tmpRxSize - 1U); - tmpRxSize = 0U; - } - } - - /* Receive data */ - buf = (uint8_t *)rxBuff; - while (0U != (rxSize--)) - { -#if I2C_RETRY_TIMES != 0U - waitTimes = I2C_RETRY_TIMES; -#endif - /* Read LPI2C receive fifo register. The register includes a flag to indicate whether */ - /* the FIFO is empty, so we can both get the data and check if we need to keep reading */ - /* using a single register read. */ - uint32_t value = 0U; - do - { - /* Check for errors. */ - result = LPI2C_MasterCheckAndClearError(base, LPI2C_MasterGetStatusFlags(base)); - if (kStatus_Success != result) - { - break; - } - - value = base->MRDR; -#if I2C_RETRY_TIMES != 0U - waitTimes--; - } while ((0U != (value & LPI2C_MRDR_RXEMPTY_MASK)) && (0U != waitTimes)); - if (0U == waitTimes) - { - result = kStatus_LPI2C_Timeout; - } -#else - } while (0U != (value & LPI2C_MRDR_RXEMPTY_MASK)); -#endif - if ((status_t)kStatus_Success != result) - { - break; - } - - *buf++ = (uint8_t)(value & LPI2C_MRDR_DATA_MASK); - } - } - } - - return result; -} - -/*! - * brief Performs a polling send transfer on the I2C bus. - * - * Sends up to a txSize number of bytes to the previously addressed slave device. The slave may - * reply with a NAK to any byte in order to terminate the transfer early. If this happens, this - * function returns #kStatus_LPI2C_Nak. - * - * param base The LPI2C peripheral base address. - * param txBuff The pointer to the data to be transferred. - * param txSize The length in bytes of the data to be transferred. - * retval #kStatus_Success Data was sent successfully. - * retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_LPI2C_FifoError FIFO under run or over run. - * retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterSend(LPI2C_Type *base, void *txBuff, size_t txSize) -{ - status_t result = kStatus_Success; - uint8_t *buf = (uint8_t *)txBuff; - - assert(NULL != txBuff); - - /* Send data buffer */ - while (0U != (txSize--)) - { - /* Wait until there is room in the fifo. This also checks for errors. */ - result = LPI2C_MasterWaitForTxReady(base); - if (kStatus_Success != result) - { - break; - } - - /* Write byte into LPI2C master data register. */ - base->MTDR = *buf++; - } - - return result; -} - -/*! - * brief Performs a master polling transfer on the I2C bus. - * - * note The API does not return until the transfer succeeds or fails due - * to error happens during transfer. - * - * param base The LPI2C peripheral base address. - * param transfer Pointer to the transfer structure. - * retval #kStatus_Success Data was received successfully. - * retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_LPI2C_FifoError FIFO under run or overrun. - * retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterTransferBlocking(LPI2C_Type *base, lpi2c_master_transfer_t *transfer) -{ - assert(NULL != transfer); - assert(transfer->subaddressSize <= sizeof(transfer->subaddress)); - - status_t result = kStatus_Success; - status_t ret = kStatus_Success; - uint16_t commandBuffer[7]; - uint32_t cmdCount = 0U; - - /* Check transfer data size in read operation. */ - if ((transfer->direction == kLPI2C_Read) && - (transfer->dataSize > (256UL * (uint32_t)FSL_FEATURE_LPI2C_FIFO_SIZEn(base)))) - { - return kStatus_InvalidArgument; - } - - /* Return an error if the bus is already in use not by us. */ - result = LPI2C_CheckForBusyBus(base); - if (kStatus_Success == result) - { - /* Clear all flags. */ - LPI2C_MasterClearStatusFlags(base, (uint32_t)kLPI2C_MasterClearFlags); - - /* Turn off auto-stop option. */ - base->MCFGR1 &= ~LPI2C_MCFGR1_AUTOSTOP_MASK; - - lpi2c_direction_t direction = (0U != transfer->subaddressSize) ? kLPI2C_Write : transfer->direction; - if (0U == (transfer->flags & (uint32_t)kLPI2C_TransferNoStartFlag)) - { - commandBuffer[cmdCount++] = - (uint16_t)kStartCmd | - (uint16_t)((uint16_t)((uint16_t)transfer->slaveAddress << 1U) | (uint16_t)direction); - } - - /* Subaddress, MSB first. */ - if (0U != transfer->subaddressSize) - { - uint32_t subaddressRemaining = transfer->subaddressSize; - while (0U != subaddressRemaining--) - { - uint8_t subaddressByte = (uint8_t)((transfer->subaddress >> (8U * subaddressRemaining)) & 0xffU); - commandBuffer[cmdCount++] = subaddressByte; - } - } - - /* Reads need special handling. */ - if ((0U != transfer->dataSize) && (transfer->direction == kLPI2C_Read)) - { - /* Need to send repeated start if switching directions to read. */ - if (direction == kLPI2C_Write) - { - commandBuffer[cmdCount++] = - (uint16_t)kStartCmd | - (uint16_t)((uint16_t)((uint16_t)transfer->slaveAddress << 1U) | (uint16_t)kLPI2C_Read); - } - } - - /* Send command buffer */ - uint32_t index = 0U; - while (0U != cmdCount--) - { - /* Wait until there is room in the fifo. This also checks for errors. */ - result = LPI2C_MasterWaitForTxReady(base); - if (kStatus_Success != result) - { - break; - } - - /* Write byte into LPI2C master data register. */ - base->MTDR = commandBuffer[index]; - index++; - } - - if (kStatus_Success == result) - { - /* Transmit data. */ - if ((transfer->direction == kLPI2C_Write) && (transfer->dataSize > 0U)) - { - /* Send Data. */ - result = LPI2C_MasterSend(base, transfer->data, transfer->dataSize); - } - - /* Receive Data. */ - if ((transfer->direction == kLPI2C_Read) && (transfer->dataSize > 0U)) - { - result = LPI2C_MasterReceive(base, transfer->data, transfer->dataSize); - } - - if (kStatus_Success == result) - { - if ((transfer->flags & (uint32_t)kLPI2C_TransferNoStopFlag) == 0U) - { - result = LPI2C_MasterStop(base); - } - } - } - /* Transmit fail */ - if (kStatus_Success != result) - { - if ((transfer->flags & (uint32_t)kLPI2C_TransferNoStopFlag) == 0U) - { - ret = LPI2C_MasterStop(base); - if(kStatus_Success != ret) - { - result = ret; - } - } - } - } - - return result; -} - -/*! - * brief Creates a new handle for the LPI2C master non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the LPI2C_MasterTransferAbort() API shall be called. - * - * - * note The function also enables the NVIC IRQ for the input LPI2C. Need to notice - * that on some SoCs the LPI2C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - * - * param base The LPI2C peripheral base address. - * param[out] handle Pointer to the LPI2C master driver handle. - * param callback User provided pointer to the asynchronous callback function. - * param userData User provided pointer to the application callback data. - */ -void LPI2C_MasterTransferCreateHandle(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_master_transfer_callback_t callback, - void *userData) -{ - uint32_t instance; - - assert(NULL != handle); - - /* Clear out the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Look up instance number */ - instance = LPI2C_GetInstance(base); - - /* Save base and instance. */ - handle->completionCallback = callback; - handle->userData = userData; - - if(LP_FLEXCOMM_GetBaseAddress(instance) != 0U) - { - lpi2c_to_lpflexcomm_t handler; - (void)memset(&handler, 0, sizeof(handler)); - - /* Save the handle in global variables to support the double weak mechanism. */ - handler.lpi2c_master_handler = LPI2C_MasterTransferHandleIRQ; - LP_FLEXCOMM_SetIRQHandler(LPI2C_GetInstance(base), handler.lpflexcomm_handler, handle, LP_FLEXCOMM_PERIPH_LPI2C); - } - else - { - /* Save this handle for IRQ use. */ - s_lpi2cMasterHandle[instance] = handle; - - /* Set irq handler. */ - s_lpi2cMasterIsr = LPI2C_MasterTransferHandleIRQ; - } - - /* Clear internal IRQ enables and enable NVIC IRQ. */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - - /* Enable NVIC IRQ, this only enables the IRQ directly connected to the NVIC. - In some cases the LPI2C IRQ is configured through INTMUX, user needs to enable - INTMUX IRQ in application code. */ - (void)EnableIRQ(kLpi2cIrqs[instance]); -} - -/*! - * @brief Execute states until FIFOs are exhausted. - * @param handle Master nonblocking driver handle. - * @param[out] isDone Set to true if the transfer has completed. - * @retval #kStatus_Success - * @retval #kStatus_LPI2C_PinLowTimeout - * @retval #kStatus_LPI2C_ArbitrationLost - * @retval #kStatus_LPI2C_Nak - * @retval #kStatus_LPI2C_FifoError - */ -static status_t LPI2C_RunTransferStateMachine(LPI2C_Type *base, lpi2c_master_handle_t *handle, bool *isDone) -{ - uint32_t status; - status_t result = kStatus_Success; - lpi2c_master_transfer_t *xfer; - size_t txCount; - size_t rxCount; - size_t txFifoSize = (size_t)FSL_FEATURE_LPI2C_FIFO_SIZEn(base); - bool state_complete = false; - uint16_t sendval; - - /* Set default isDone return value. */ - *isDone = false; - - /* Check for errors. */ - status = LPI2C_MasterGetStatusFlags(base); - - /* Get fifo counts. */ - LPI2C_MasterGetFifoCounts(base, &rxCount, &txCount); - - /* Get pointer to private data. */ - xfer = &handle->transfer; - - /* For the last byte, nack flag is expected. - Do not check and clear kLPI2C_MasterNackDetectFlag for the last byte, - in case FIFO is emptied when stop command has not been sent. */ - if (handle->remainingBytes == 0U) - { - /* When data size is not zero which means it is not only one byte of address is sent, and */ - /* when the txfifo is empty, or have one byte which is the stop command, then the nack status can be ignored. */ - if ((xfer->dataSize != 0U) && - ((txCount == 0U) || ((txCount == 1U) && (handle->state == (uint8_t)kWaitForCompletionState) && - ((xfer->flags & (uint32_t)kLPI2C_TransferNoStopFlag) == 0U)))) - { - status &= ~(uint32_t)kLPI2C_MasterNackDetectFlag; - } - } - - result = LPI2C_MasterCheckAndClearError(base, status); - - if (kStatus_Success == result) - { - /* Compute room in tx fifo */ - txCount = txFifoSize - txCount; - - while (!state_complete) - { - /* Execute the state. */ - switch (handle->state) - { - case (uint8_t)kSendCommandState: - /* Make sure there is room in the tx fifo for the next command. */ - if (0U == txCount--) - { - state_complete = true; - break; - } - - /* Issue command. buf is a uint8_t* pointing at the uint16 command array. */ - sendval = ((uint16_t)handle->buf[0]) | (((uint16_t)handle->buf[1]) << 8U); - base->MTDR = sendval; - handle->buf++; - handle->buf++; - - /* Count down until all commands are sent. */ - if (--handle->remainingBytes == 0U) - { - /* Choose next state and set up buffer pointer and count. */ - if (0U != xfer->dataSize) - { - /* Either a send or receive transfer is next. */ - handle->state = (uint8_t)kTransferDataState; - handle->buf = (uint8_t *)xfer->data; - handle->remainingBytes = (uint16_t)xfer->dataSize; - if (xfer->direction == kLPI2C_Read) - { - /* Disable TX interrupt */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterTxReadyFlag); - /* Issue command to receive data. A single write to MTDR can issue read operation of - 0xFFU + 1 byte of data at most, so when the dataSize is larger than 0x100U, push - multiple read commands to MTDR until dataSize is reached. */ - size_t tmpRxSize = xfer->dataSize; - while (tmpRxSize != 0U) - { - LPI2C_MasterGetFifoCounts(base, NULL, &txCount); - while (txFifoSize == txCount) - { - LPI2C_MasterGetFifoCounts(base, NULL, &txCount); - } - - if (tmpRxSize > 256U) - { - base->MTDR = (uint32_t)(kRxDataCmd) | (uint32_t)LPI2C_MTDR_DATA(0xFFU); - tmpRxSize -= 256U; - } - else - { - base->MTDR = (uint32_t)(kRxDataCmd) | (uint32_t)LPI2C_MTDR_DATA(tmpRxSize - 1U); - tmpRxSize = 0U; - } - } - } - } - else - { - /* No transfer, so move to stop state. */ - handle->state = (uint8_t)kStopState; - } - } - break; - - case (uint8_t)kIssueReadCommandState: - /* Make sure there is room in the tx fifo for the read command. */ - if (0U == txCount--) - { - state_complete = true; - break; - } - - base->MTDR = (uint32_t)kRxDataCmd | LPI2C_MTDR_DATA(xfer->dataSize - 1U); - - /* Move to transfer state. */ - handle->state = (uint8_t)kTransferDataState; - if (xfer->direction == kLPI2C_Read) - { - /* Disable TX interrupt */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterTxReadyFlag); - } - break; - - case (uint8_t)kTransferDataState: - if (xfer->direction == kLPI2C_Write) - { - /* Make sure there is room in the tx fifo. */ - if (0U == txCount--) - { - state_complete = true; - break; - } - - /* Put byte to send in fifo. */ - base->MTDR = *(handle->buf)++; - } - else - { - /* XXX handle receive sizes > 256, use kIssueReadCommandState */ - /* Make sure there is data in the rx fifo. */ - if (0U == rxCount--) - { - state_complete = true; - break; - } - - /* Read byte from fifo. */ - *(handle->buf)++ = (uint8_t)(base->MRDR & LPI2C_MRDR_DATA_MASK); - } - - /* Move to stop when the transfer is done. */ - if (--handle->remainingBytes == 0U) - { - if (xfer->direction == kLPI2C_Write) - { - state_complete = true; - } - handle->state = (uint8_t)kStopState; - } - break; - - case (uint8_t)kStopState: - /* Only issue a stop transition if the caller requested it. */ - if ((xfer->flags & (uint32_t)kLPI2C_TransferNoStopFlag) == 0U) - { - /* Make sure there is room in the tx fifo for the stop command. */ - if (0U == txCount--) - { - state_complete = true; - break; - } - - base->MTDR = (uint32_t)kStopCmd; - } - else - { - /* If all data is read and no stop flag is required to send, we are done. */ - if (xfer->direction == kLPI2C_Read) - { - *isDone = true; - } - state_complete = true; - } - handle->state = (uint8_t)kWaitForCompletionState; - break; - - case (uint8_t)kWaitForCompletionState: - if ((xfer->flags & (uint32_t)kLPI2C_TransferNoStopFlag) == 0U) - { - /* We stay in this state until the stop state is detected. */ - if (0U != (status & (uint32_t)kLPI2C_MasterStopDetectFlag)) - { - *isDone = true; - } - } - else - { - /* If all data is pushed to FIFO and no stop flag is required to send, we need to make sure they - are all send out to bus. */ - if ((xfer->direction == kLPI2C_Write) && ((base->MFSR & LPI2C_MFSR_TXCOUNT_MASK) == 0U)) - { - /* We stay in this state until the data is sent out to bus. */ - *isDone = true; - } - } - state_complete = true; - break; - default: - assert(false); - break; - } - } - } - return result; -} - -/*! - * @brief Prepares the transfer state machine and fills in the command buffer. - * @param handle Master nonblocking driver handle. - */ -static void LPI2C_InitTransferStateMachine(lpi2c_master_handle_t *handle) -{ - lpi2c_master_transfer_t *xfer = &handle->transfer; - - /* Handle no start option. */ - if (0U != (xfer->flags & (uint32_t)kLPI2C_TransferNoStartFlag)) - { - if (xfer->direction == kLPI2C_Read) - { - /* Need to issue read command first. */ - handle->state = (uint8_t)kIssueReadCommandState; - } - else - { - /* Start immediately in the data transfer state. */ - handle->state = (uint8_t)kTransferDataState; - } - - handle->buf = (uint8_t *)xfer->data; - handle->remainingBytes = (uint16_t)xfer->dataSize; - } - else - { - uint16_t *cmd = (uint16_t *)&handle->commandBuffer; - uint32_t cmdCount = 0U; - - /* Initial direction depends on whether a subaddress was provided, and of course the actual */ - /* data transfer direction. */ - lpi2c_direction_t direction = (0U != xfer->subaddressSize) ? kLPI2C_Write : xfer->direction; - - /* Start command. */ - cmd[cmdCount++] = - (uint16_t)kStartCmd | (uint16_t)((uint16_t)((uint16_t)xfer->slaveAddress << 1U) | (uint16_t)direction); - - /* Subaddress, MSB first. */ - if (0U != xfer->subaddressSize) - { - uint32_t subaddressRemaining = xfer->subaddressSize; - while (0U != (subaddressRemaining--)) - { - uint8_t subaddressByte = (uint8_t)((xfer->subaddress >> (8U * subaddressRemaining)) & 0xffU); - cmd[cmdCount++] = subaddressByte; - } - } - - /* Reads need special handling. */ - if ((0U != xfer->dataSize) && (xfer->direction == kLPI2C_Read)) - { - /* Need to send repeated start if switching directions to read. */ - if (direction == kLPI2C_Write) - { - cmd[cmdCount++] = (uint16_t)kStartCmd | - (uint16_t)((uint16_t)((uint16_t)xfer->slaveAddress << 1U) | (uint16_t)kLPI2C_Read); - } - } - - /* Set up state machine for transferring the commands. */ - handle->state = (uint8_t)kSendCommandState; - handle->remainingBytes = (uint16_t)cmdCount; - handle->buf = (uint8_t *)&handle->commandBuffer; - } -} - -/*! - * brief Performs a non-blocking transaction on the I2C bus. - * - * param base The LPI2C peripheral base address. - * param handle Pointer to the LPI2C master driver handle. - * param transfer The pointer to the transfer descriptor. - * retval #kStatus_Success The transaction was started successfully. - * retval #kStatus_LPI2C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - */ -status_t LPI2C_MasterTransferNonBlocking(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_master_transfer_t *transfer) -{ - assert(NULL != handle); - assert(NULL != transfer); - assert(transfer->subaddressSize <= sizeof(transfer->subaddress)); - - status_t result; - - /* Check transfer data size in read operation. */ - if ((transfer->direction == kLPI2C_Read) && - (transfer->dataSize > (256U * (uint32_t)FSL_FEATURE_LPI2C_FIFO_SIZEn(base)))) - { - return kStatus_InvalidArgument; - } - - /* Return busy if another transaction is in progress. */ - if (handle->state != (uint8_t)kIdleState) - { - result = kStatus_LPI2C_Busy; - } - else - { - result = LPI2C_CheckForBusyBus(base); - } - - if ((status_t)kStatus_Success == result) - { - /* Disable LPI2C IRQ sources while we configure stuff. */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - - /* Reset FIFO in case there are data. */ - base->MCR |= LPI2C_MCR_RRF_MASK | LPI2C_MCR_RTF_MASK; - - /* Save transfer into handle. */ - handle->transfer = *transfer; - - /* Generate commands to send. */ - LPI2C_InitTransferStateMachine(handle); - - /* Clear all flags. */ - LPI2C_MasterClearStatusFlags(base, (uint32_t)kLPI2C_MasterClearFlags); - - /* Turn off auto-stop option. */ - base->MCFGR1 &= ~LPI2C_MCFGR1_AUTOSTOP_MASK; - - /* Enable LPI2C internal IRQ sources. NVIC IRQ was enabled in CreateHandle() */ - LPI2C_MasterEnableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - } - - return result; -} - -/*! - * brief Returns number of bytes transferred so far. - * param base The LPI2C peripheral base address. - * param handle Pointer to the LPI2C master driver handle. - * param[out] count Number of bytes transferred so far by the non-blocking transaction. - * retval #kStatus_Success - * retval #kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t LPI2C_MasterTransferGetCount(LPI2C_Type *base, lpi2c_master_handle_t *handle, size_t *count) -{ - status_t result = kStatus_Success; - - assert(NULL != handle); - - if (NULL == count) - { - result = kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - else if (handle->state == (uint8_t)kIdleState) - { - *count = 0; - result = kStatus_NoTransferInProgress; - } - else - { - uint8_t state; - uint16_t remainingBytes; - uint32_t dataSize; - - /* Cache some fields with IRQs disabled. This ensures all field values */ - /* are synchronized with each other during an ongoing transfer. */ - uint32_t irqs = LPI2C_MasterGetEnabledInterrupts(base); - LPI2C_MasterDisableInterrupts(base, irqs); - state = handle->state; - remainingBytes = handle->remainingBytes; - dataSize = handle->transfer.dataSize; - LPI2C_MasterEnableInterrupts(base, irqs); - - /* Get transfer count based on current transfer state. */ - switch (state) - { - case (uint8_t)kIdleState: - case (uint8_t)kSendCommandState: - case (uint8_t) - kIssueReadCommandState: /* XXX return correct value for this state when >256 reads are supported */ - *count = 0; - break; - - case (uint8_t)kTransferDataState: - *count = dataSize - remainingBytes; - break; - - case (uint8_t)kStopState: - case (uint8_t)kWaitForCompletionState: - default: - *count = dataSize; - break; - } - } - - return result; -} - -/*! - * brief Terminates a non-blocking LPI2C master transmission early. - * - * note It is not safe to call this function from an IRQ handler that has a higher priority than the - * LPI2C peripheral's IRQ priority. - * - * param base The LPI2C peripheral base address. - * param handle Pointer to the LPI2C master driver handle. - * retval #kStatus_Success A transaction was successfully aborted. - * retval #kStatus_LPI2C_Idle There is not a non-blocking transaction currently in progress. - */ -void LPI2C_MasterTransferAbort(LPI2C_Type *base, lpi2c_master_handle_t *handle) -{ - if (handle->state != (uint8_t)kIdleState) - { - /* Disable internal IRQ enables. */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - - /* Reset fifos. */ - base->MCR |= LPI2C_MCR_RRF_MASK | LPI2C_MCR_RTF_MASK; - - /* If master is still busy and has not send out stop signal yet. */ - if ((LPI2C_MasterGetStatusFlags(base) & ((uint32_t)kLPI2C_MasterStopDetectFlag | - (uint32_t)kLPI2C_MasterBusyFlag)) == (uint32_t)kLPI2C_MasterBusyFlag) - { - /* Send a stop command to finalize the transfer. */ - base->MTDR = (uint32_t)kStopCmd; - } - - /* Reset handle. */ - handle->state = (uint8_t)kIdleState; - } -} - -/*! - * brief Reusable routine to handle master interrupts. - * note This function does not need to be called unless you are reimplementing the - * nonblocking API's interrupt handler routines to add special functionality. - * param instance The LPI2C instance. - * param lpi2cMasterHandle Pointer to the LPI2C master driver handle. - */ -void LPI2C_MasterTransferHandleIRQ(uint32_t instance, void *lpi2cMasterHandle) -{ - assert(lpi2cMasterHandle != NULL); - assert(instance < ARRAY_SIZE(kLpi2cBases)); - LPI2C_Type *base = kLpi2cBases[instance]; - lpi2c_master_handle_t *handle = (lpi2c_master_handle_t *)lpi2cMasterHandle; - bool isDone = false; - status_t result; - - /* Don't do anything if we don't have a valid handle. */ - if (NULL != handle) - { - if (handle->state != (uint8_t)kIdleState) - { - result = LPI2C_RunTransferStateMachine(base, handle, &isDone); - - if ((result != kStatus_Success) || isDone) - { - /* Handle error, terminate xfer */ - if (result != kStatus_Success) - { - LPI2C_MasterTransferAbort(base, handle); - } - - /* Disable internal IRQ enables. */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - - /* Set handle to idle state. */ - handle->state = (uint8_t)kIdleState; - - /* Invoke callback. */ - if (NULL != handle->completionCallback) - { - handle->completionCallback(base, handle, result, handle->userData); - } - } - } - } -} - -/*! - * brief Provides a default configuration for the LPI2C slave peripheral. - * - * This function provides the following default configuration for the LPI2C slave peripheral: - * code - * slaveConfig->enableSlave = true; - * slaveConfig->address0 = 0U; - * slaveConfig->address1 = 0U; - * slaveConfig->addressMatchMode = kLPI2C_MatchAddress0; - * slaveConfig->filterDozeEnable = true; - * slaveConfig->filterEnable = true; - * slaveConfig->enableGeneralCall = false; - * slaveConfig->sclStall.enableAck = false; - * slaveConfig->sclStall.enableTx = true; - * slaveConfig->sclStall.enableRx = true; - * slaveConfig->sclStall.enableAddress = true; - * slaveConfig->ignoreAck = false; - * slaveConfig->enableReceivedAddressRead = false; - * slaveConfig->sdaGlitchFilterWidth_ns = 0; - * slaveConfig->sclGlitchFilterWidth_ns = 0; - * slaveConfig->dataValidDelay_ns = 0; - * slaveConfig->clockHoldTime_ns = 0; - * endcode - * - * After calling this function, override any settings to customize the configuration, - * prior to initializing the master driver with LPI2C_SlaveInit(). Be sure to override at least the a - * address0 member of the configuration structure with the desired slave address. - * - * param[out] slaveConfig User provided configuration structure that is set to default values. Refer to - * #lpi2c_slave_config_t. - */ -void LPI2C_SlaveGetDefaultConfig(lpi2c_slave_config_t *slaveConfig) -{ - /* Initializes the configure structure to zero. */ - (void)memset(slaveConfig, 0, sizeof(*slaveConfig)); - - slaveConfig->enableSlave = true; - slaveConfig->address0 = 0U; - slaveConfig->address1 = 0U; - slaveConfig->addressMatchMode = kLPI2C_MatchAddress0; - slaveConfig->filterDozeEnable = true; - slaveConfig->filterEnable = true; - slaveConfig->enableGeneralCall = false; - slaveConfig->sclStall.enableAck = false; - slaveConfig->sclStall.enableTx = true; - slaveConfig->sclStall.enableRx = true; - slaveConfig->sclStall.enableAddress = false; - slaveConfig->ignoreAck = false; - slaveConfig->enableReceivedAddressRead = false; - slaveConfig->sdaGlitchFilterWidth_ns = 0U; /* Set to 0 to disable the function */ - slaveConfig->sclGlitchFilterWidth_ns = 0U; /* Set to 0 to disable the function */ - slaveConfig->dataValidDelay_ns = 0U; - /* When enabling the slave tx SCL stall, set the default clock hold time to 250ns according - to I2C spec for standard mode baudrate(100k). User can manually change it to 100ns or 50ns - for fast-mode(400k) or fast-mode+(1m). */ - slaveConfig->clockHoldTime_ns = 250U; -} - -/*! - * brief Initializes the LPI2C slave peripheral. - * - * This function enables the peripheral clock and initializes the LPI2C slave peripheral as described by the user - * provided configuration. - * - * param base The LPI2C peripheral base address. - * param slaveConfig User provided peripheral configuration. Use LPI2C_SlaveGetDefaultConfig() to get a set of defaults - * that you can override. - * param sourceClock_Hz Frequency in Hertz of the LPI2C functional clock. Used to calculate the filter widths, - * data valid delay, and clock hold time. - */ -void LPI2C_SlaveInit(LPI2C_Type *base, const lpi2c_slave_config_t *slaveConfig, uint32_t sourceClock_Hz) -{ - uint32_t tmpReg; - uint32_t tmpCycle; - uint32_t instance = LPI2C_GetInstance(base); - - if(LP_FLEXCOMM_GetBaseAddress(instance) != 0U) - { - -#if !(defined(LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) && LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) - /* initialize flexcomm to LPI2C mode */ - status_t status = LP_FLEXCOMM_Init(instance, LP_FLEXCOMM_PERIPH_LPI2C); - if (kStatus_Success != status) - { - assert(false); - } -#endif /* LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER */ - - } - else - { - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate the clock. */ - (void)CLOCK_EnableClock(kLpi2cClocks[instance]); -#if defined(LPI2C_PERIPH_CLOCKS) - /* Ungate the functional clock in initialize function. */ - CLOCK_EnableClock(kLpi2cPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - } - - /* Restore to reset conditions. */ - LPI2C_SlaveReset(base); - - /* Configure peripheral. */ - base->SAMR = LPI2C_SAMR_ADDR0(slaveConfig->address0) | LPI2C_SAMR_ADDR1(slaveConfig->address1); - - base->SCFGR1 = - LPI2C_SCFGR1_ADDRCFG(slaveConfig->addressMatchMode) | LPI2C_SCFGR1_IGNACK(slaveConfig->ignoreAck) | - LPI2C_SCFGR1_RXCFG(slaveConfig->enableReceivedAddressRead) | LPI2C_SCFGR1_GCEN(slaveConfig->enableGeneralCall) | - LPI2C_SCFGR1_ACKSTALL(slaveConfig->sclStall.enableAck) | LPI2C_SCFGR1_TXDSTALL(slaveConfig->sclStall.enableTx) | - LPI2C_SCFGR1_RXSTALL(slaveConfig->sclStall.enableRx) | - LPI2C_SCFGR1_ADRSTALL(slaveConfig->sclStall.enableAddress); - - /* Calculate SDA filter width. The width is equal to FILTSDA+3 cycles of functional clock. - And set FILTSDA to 0 disables the fileter, so the min value is 4. */ - tmpReg = LPI2C_SCFGR2_FILTSDA( - LPI2C_GetCyclesForWidth(sourceClock_Hz, slaveConfig->sdaGlitchFilterWidth_ns, 4U, - (LPI2C_SCFGR2_FILTSDA_MASK >> LPI2C_SCFGR2_FILTSDA_SHIFT) + 3U, 0U) - - 3U); - - /* Calculate SDL filter width. The width is equal to FILTSCL+3 cycles of functional clock. - And set FILTSCL to 0 disables the fileter, so the min value is 4. */ - tmpCycle = LPI2C_GetCyclesForWidth(sourceClock_Hz, slaveConfig->sclGlitchFilterWidth_ns, 4U, - (LPI2C_SCFGR2_FILTSCL_MASK >> LPI2C_SCFGR2_FILTSCL_SHIFT) + 3U, 0U); - tmpReg |= LPI2C_SCFGR2_FILTSCL(tmpCycle - 3U); - - /* Calculate data valid time. The time is equal to FILTSCL+DATAVD+3 cycles of functional clock. - So the min value is FILTSCL+3. */ - tmpReg |= LPI2C_SCFGR2_DATAVD( - LPI2C_GetCyclesForWidth(sourceClock_Hz, slaveConfig->dataValidDelay_ns, tmpCycle, - tmpCycle + (LPI2C_SCFGR2_DATAVD_MASK >> LPI2C_SCFGR2_DATAVD_SHIFT), 0U) - - tmpCycle); - - /* Calculate clock hold time. The time is equal to CLKHOLD+3 cycles of functional clock. - So the min value is 3. */ - base->SCFGR2 = - tmpReg | LPI2C_SCFGR2_CLKHOLD( - LPI2C_GetCyclesForWidth(sourceClock_Hz, slaveConfig->clockHoldTime_ns, 3U, - (LPI2C_SCFGR2_CLKHOLD_MASK >> LPI2C_SCFGR2_CLKHOLD_SHIFT) + 3U, 0U) - - 3U); - - /* Save SCR to last so we don't enable slave until it is configured */ - base->SCR = LPI2C_SCR_FILTDZ(!slaveConfig->filterDozeEnable) | LPI2C_SCR_FILTEN(slaveConfig->filterEnable) | - LPI2C_SCR_SEN(slaveConfig->enableSlave); -} - -/*! - * brief Deinitializes the LPI2C slave peripheral. - * - * This function disables the LPI2C slave peripheral and gates the clock. It also performs a software - * reset to restore the peripheral to reset conditions. - * - * param base The LPI2C peripheral base address. - */ -void LPI2C_SlaveDeinit(LPI2C_Type *base) -{ - uint32_t instance = LPI2C_GetInstance(base); - - /* Restore to reset state. */ - LPI2C_SlaveReset(base); - if(LP_FLEXCOMM_GetBaseAddress(instance) != 0U) - { - LP_FLEXCOMM_Deinit(instance); - } - else - { -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate clock. */ - (void)CLOCK_DisableClock(kLpi2cClocks[instance]); -#if defined(LPI2C_PERIPH_CLOCKS) - /* Gate the functional clock. */ - CLOCK_DisableClock(kLpi2cPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - } -#if !(defined(LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) && LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) - LP_FLEXCOMM_Deinit(LPI2C_GetInstance(base)); -#endif -} - -/*! - * @brief Convert provided flags to status code, and clear any errors if present. - * @param base The LPI2C peripheral base address. - * @param status Current status flags value that will be checked. - * @retval #kStatus_Success - * @retval #kStatus_LPI2C_BitError - * @retval #kStatus_LPI2C_FifoError - */ -static status_t LPI2C_SlaveCheckAndClearError(LPI2C_Type *base, uint32_t flags) -{ - status_t result = kStatus_Success; - - flags &= (uint32_t)kLPI2C_SlaveErrorFlags; - if (0U != flags) - { - if (0U != (flags & (uint32_t)kLPI2C_SlaveBitErrFlag)) - { - result = kStatus_LPI2C_BitError; - } - else if (0U != (flags & (uint32_t)kLPI2C_SlaveFifoErrFlag)) - { - result = kStatus_LPI2C_FifoError; - } - else - { - ; /* Intentional empty */ - } - - /* Clear the errors. */ - LPI2C_SlaveClearStatusFlags(base, flags); - } - else - { - ; /* Intentional empty */ - } - - return result; -} - -/*! - * brief Performs a polling send transfer on the I2C bus. - * - * param base The LPI2C peripheral base address. - * param txBuff The pointer to the data to be transferred. - * param txSize The length in bytes of the data to be transferred. - * param[out] actualTxSize - * return Error or success status returned by API. - */ -status_t LPI2C_SlaveSend(LPI2C_Type *base, void *txBuff, size_t txSize, size_t *actualTxSize) -{ - status_t result = kStatus_Success; - uint8_t *buf = (uint8_t *)txBuff; - size_t remaining = txSize; - - assert(NULL != txBuff); - -#if I2C_RETRY_TIMES != 0U - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - - /* Clear stop flag. */ - LPI2C_SlaveClearStatusFlags(base, - (uint32_t)kLPI2C_SlaveStopDetectFlag | (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag); - - while (0U != remaining) - { - uint32_t flags; - - /* Wait until we can transmit. */ - do - { - /* Check for errors */ - flags = LPI2C_SlaveGetStatusFlags(base); - result = LPI2C_SlaveCheckAndClearError(base, flags); - if (kStatus_Success != result) - { - if (NULL != actualTxSize) - { - *actualTxSize = txSize - remaining; - } - break; - } -#if I2C_RETRY_TIMES != 0U - waitTimes--; - } while ((0U == (flags & ((uint32_t)kLPI2C_SlaveTxReadyFlag | (uint32_t)kLPI2C_SlaveStopDetectFlag | - (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag))) && - (0U != waitTimes)); - if (0U == waitTimes) - { - result = kStatus_LPI2C_Timeout; - } -#else - } while (0U == (flags & ((uint32_t)kLPI2C_SlaveTxReadyFlag | (uint32_t)kLPI2C_SlaveStopDetectFlag | - (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag))); -#endif - - if (kStatus_Success != result) - { - break; - } - - /* Send a byte. */ - if (0U != (flags & (uint32_t)kLPI2C_SlaveTxReadyFlag)) - { - base->STDR = *buf++; - --remaining; - } - - /* Exit loop if we see a stop or restart in transfer*/ - if ((0U != (flags & ((uint32_t)kLPI2C_SlaveStopDetectFlag | (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag))) && - (remaining != 0U)) - { - LPI2C_SlaveClearStatusFlags( - base, (uint32_t)kLPI2C_SlaveStopDetectFlag | (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag); - break; - } - } - - if (NULL != actualTxSize) - { - *actualTxSize = txSize - remaining; - } - - return result; -} - -/*! - * brief Performs a polling receive transfer on the I2C bus. - * - * param base The LPI2C peripheral base address. - * param rxBuff The pointer to the data to be transferred. - * param rxSize The length in bytes of the data to be transferred. - * param[out] actualRxSize - * return Error or success status returned by API. - */ -status_t LPI2C_SlaveReceive(LPI2C_Type *base, void *rxBuff, size_t rxSize, size_t *actualRxSize) -{ - status_t result = kStatus_Success; - uint8_t *buf = (uint8_t *)rxBuff; - size_t remaining = rxSize; - - assert(NULL != rxBuff); - -#if I2C_RETRY_TIMES != 0U - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - - /* Clear stop flag. */ - LPI2C_SlaveClearStatusFlags(base, - (uint32_t)kLPI2C_SlaveStopDetectFlag | (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag); - - while (0U != remaining) - { - uint32_t flags; - - /* Wait until we can receive. */ - do - { - /* Check for errors */ - flags = LPI2C_SlaveGetStatusFlags(base); - result = LPI2C_SlaveCheckAndClearError(base, flags); - if (kStatus_Success != result) - { - if (NULL != actualRxSize) - { - *actualRxSize = rxSize - remaining; - } - break; - } -#if I2C_RETRY_TIMES != 0U - waitTimes--; - } while ((0U == (flags & ((uint32_t)kLPI2C_SlaveRxReadyFlag | (uint32_t)kLPI2C_SlaveStopDetectFlag | - (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag))) && - (0U != waitTimes)); - if (0U == waitTimes) - { - result = kStatus_LPI2C_Timeout; - } -#else - } while (0U == (flags & ((uint32_t)kLPI2C_SlaveRxReadyFlag | (uint32_t)kLPI2C_SlaveStopDetectFlag | - (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag))); -#endif - - if ((status_t)kStatus_Success != result) - { - break; - } - - /* Receive a byte. */ - if (0U != (flags & (uint32_t)kLPI2C_SlaveRxReadyFlag)) - { - *buf++ = (uint8_t)(base->SRDR & LPI2C_SRDR_DATA_MASK); - --remaining; - } - - /* Exit loop if we see a stop or restart */ - if ((0U != (flags & ((uint32_t)kLPI2C_SlaveStopDetectFlag | (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag))) && - (remaining != 0U)) - { - LPI2C_SlaveClearStatusFlags( - base, (uint32_t)kLPI2C_SlaveStopDetectFlag | (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag); - break; - } - } - - if (NULL != actualRxSize) - { - *actualRxSize = rxSize - remaining; - } - - return result; -} - -/*! - * brief Creates a new handle for the LPI2C slave non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the LPI2C_SlaveTransferAbort() API shall be called. - * - * note The function also enables the NVIC IRQ for the input LPI2C. Need to notice - * that on some SoCs the LPI2C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - - * param base The LPI2C peripheral base address. - * param[out] handle Pointer to the LPI2C slave driver handle. - * param callback User provided pointer to the asynchronous callback function. - * param userData User provided pointer to the application callback data. - */ -void LPI2C_SlaveTransferCreateHandle(LPI2C_Type *base, - lpi2c_slave_handle_t *handle, - lpi2c_slave_transfer_callback_t callback, - void *userData) -{ - uint32_t instance; - - assert(NULL != handle); - - /* Clear out the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Look up instance number */ - instance = LPI2C_GetInstance(base); - - /* Save base and instance. */ - handle->callback = callback; - handle->userData = userData; - - if(LP_FLEXCOMM_GetBaseAddress(instance) != 0U) - { - lpi2c_to_lpflexcomm_t handler; - (void)memset(&handler, 0, sizeof(handler)); - - /* Save the handle in global variables to support the double weak mechanism. */ - handler.lpi2c_slave_handler = LPI2C_SlaveTransferHandleIRQ; - LP_FLEXCOMM_SetIRQHandler(LPI2C_GetInstance(base), handler.lpflexcomm_handler, handle, LP_FLEXCOMM_PERIPH_LPI2C); - } - else - { - /* Save this handle for IRQ use. */ - s_lpi2cSlaveHandle[instance] = handle; - - /* Set irq handler. */ - s_lpi2cSlaveIsr = LPI2C_SlaveTransferHandleIRQ; - } - - /* Clear internal IRQ enables and enable NVIC IRQ. */ - LPI2C_SlaveDisableInterrupts(base, (uint32_t)kLPI2C_SlaveIrqFlags); - (void)EnableIRQ(kLpi2cIrqs[instance]); - - /* Nack by default. */ - base->STAR = LPI2C_STAR_TXNACK_MASK; -} - -/*! - * brief Starts accepting slave transfers. - * - * Call this API after calling I2C_SlaveInit() and LPI2C_SlaveTransferCreateHandle() to start processing - * transactions driven by an I2C master. The slave monitors the I2C bus and pass events to the - * callback that was passed into the call to LPI2C_SlaveTransferCreateHandle(). The callback is always invoked - * from the interrupt context. - * - * The set of events received by the callback is customizable. To do so, set the a eventMask parameter to - * the OR'd combination of #lpi2c_slave_transfer_event_t enumerators for the events you wish to receive. - * The #kLPI2C_SlaveTransmitEvent and #kLPI2C_SlaveReceiveEvent events are always enabled and do not need - * to be included in the mask. Alternatively, you can pass 0 to get a default set of only the transmit and - * receive events that are always enabled. In addition, the #kLPI2C_SlaveAllEvents constant is provided as - * a convenient way to enable all events. - * - * param base The LPI2C peripheral base address. - * param handle Pointer to #lpi2c_slave_handle_t structure which stores the transfer state. - * param eventMask Bit mask formed by OR'ing together #lpi2c_slave_transfer_event_t enumerators to specify - * which events to send to the callback. Other accepted values are 0 to get a default set of - * only the transmit and receive events, and #kLPI2C_SlaveAllEvents to enable all events. - * - * retval #kStatus_Success Slave transfers were successfully started. - * retval #kStatus_LPI2C_Busy Slave transfers have already been started on this handle. - */ -status_t LPI2C_SlaveTransferNonBlocking(LPI2C_Type *base, lpi2c_slave_handle_t *handle, uint32_t eventMask) -{ - status_t result = kStatus_Success; - - assert(NULL != handle); - - /* Return busy if another transaction is in progress. */ - if (handle->isBusy) - { - result = kStatus_LPI2C_Busy; - } - else - { - /* Return an error if the bus is already in use not by us. */ - uint32_t status = LPI2C_SlaveGetStatusFlags(base); - if ((0U != (status & (uint32_t)kLPI2C_SlaveBusBusyFlag)) && (0U == (status & (uint32_t)kLPI2C_SlaveBusyFlag))) - { - result = kStatus_LPI2C_Busy; - } - } - - if ((status_t)kStatus_Success == result) - { - /* Disable LPI2C IRQ sources while we configure stuff. */ - LPI2C_SlaveDisableInterrupts(base, (uint32_t)kLPI2C_SlaveIrqFlags); - - /* Clear transfer in handle. */ - (void)memset(&handle->transfer, 0, sizeof(handle->transfer)); - - /* Record that we're busy. */ - handle->isBusy = true; - - /* Set up event mask. tx and rx are always enabled. */ - handle->eventMask = eventMask | (uint32_t)kLPI2C_SlaveTransmitEvent | (uint32_t)kLPI2C_SlaveReceiveEvent; - - /* Ack by default. */ - base->STAR = 0U; - - /* Clear all flags. */ - LPI2C_SlaveClearStatusFlags(base, (uint32_t)kLPI2C_SlaveClearFlags); - - /* Enable LPI2C internal IRQ sources. NVIC IRQ was enabled in CreateHandle() */ - LPI2C_SlaveEnableInterrupts(base, (uint32_t)kLPI2C_SlaveIrqFlags); - } - - return result; -} - -/*! - * brief Gets the slave transfer status during a non-blocking transfer. - * param base The LPI2C peripheral base address. - * param handle Pointer to i2c_slave_handle_t structure. - * param[out] count Pointer to a value to hold the number of bytes transferred. May be NULL if the count is not - * required. - * retval #kStatus_Success - * retval #kStatus_NoTransferInProgress - */ -status_t LPI2C_SlaveTransferGetCount(LPI2C_Type *base, lpi2c_slave_handle_t *handle, size_t *count) -{ - status_t status = kStatus_Success; - - assert(NULL != handle); - - if (count == NULL) - { - status = kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - else if (!handle->isBusy) - { - *count = 0; - status = kStatus_NoTransferInProgress; - } - - /* For an active transfer, just return the count from the handle. */ - else - { - *count = handle->transferredCount; - } - - return status; -} - -/*! - * brief Aborts the slave non-blocking transfers. - * note This API could be called at any time to stop slave for handling the bus events. - * param base The LPI2C peripheral base address. - * param handle Pointer to #lpi2c_slave_handle_t structure which stores the transfer state. - * retval #kStatus_Success - * retval #kStatus_LPI2C_Idle - */ -void LPI2C_SlaveTransferAbort(LPI2C_Type *base, lpi2c_slave_handle_t *handle) -{ - assert(NULL != handle); - - /* Return idle if no transaction is in progress. */ - if (handle->isBusy) - { - /* Disable LPI2C IRQ sources. */ - LPI2C_SlaveDisableInterrupts(base, (uint32_t)kLPI2C_SlaveIrqFlags); - - /* Nack by default. */ - base->STAR = LPI2C_STAR_TXNACK_MASK; - - /* Reset transfer info. */ - (void)memset(&handle->transfer, 0, sizeof(handle->transfer)); - - /* We're no longer busy. */ - handle->isBusy = false; - } -} - -/*! - * brief Reusable routine to handle slave interrupts. - * note This function does not need to be called unless you are reimplementing the - * non blocking API's interrupt handler routines to add special functionality. - * param instance The LPI2C instance. - * param lpi2cSlaveHandle Pointer to #lpi2c_slave_handle_t structure which stores the transfer state. - */ -void LPI2C_SlaveTransferHandleIRQ(uint32_t instance, void *lpi2cSlaveHandle) -{ - assert(instance < ARRAY_SIZE(kLpi2cBases)); - uint32_t flags; - lpi2c_slave_transfer_t *xfer; - LPI2C_Type *base = kLpi2cBases[instance]; - lpi2c_slave_handle_t *handle = (lpi2c_slave_handle_t *)lpi2cSlaveHandle; - - /* Check for a valid handle in case of a spurious interrupt. */ - if (NULL != handle) - { - xfer = &handle->transfer; - - /* Get status flags. */ - flags = LPI2C_SlaveGetStatusFlags(base); - - if (0U != (flags & ((uint32_t)kLPI2C_SlaveBitErrFlag | (uint32_t)kLPI2C_SlaveFifoErrFlag))) - { - xfer->event = kLPI2C_SlaveCompletionEvent; - xfer->completionStatus = LPI2C_SlaveCheckAndClearError(base, flags); - - if ((0U != (handle->eventMask & (uint32_t)kLPI2C_SlaveCompletionEvent)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - } - else - { - if (0U != - (flags & (((uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag) | ((uint32_t)kLPI2C_SlaveStopDetectFlag)))) - { - xfer->event = (0U != (flags & (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag)) ? - kLPI2C_SlaveRepeatedStartEvent : - kLPI2C_SlaveCompletionEvent; - xfer->receivedAddress = 0U; - xfer->completionStatus = kStatus_Success; - xfer->transferredCount = handle->transferredCount; - - if (xfer->event == kLPI2C_SlaveCompletionEvent) - { - handle->isBusy = false; - } - - if (handle->wasTransmit) - { - /* Subtract one from the transmit count to offset the fact that LPI2C asserts the */ - /* tx flag before it sees the nack from the master-receiver, thus causing one more */ - /* count that the master actually receives. */ - --xfer->transferredCount; - handle->wasTransmit = false; - } - - /* Clear the flag. */ - LPI2C_SlaveClearStatusFlags(base, flags & ((uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag | - (uint32_t)kLPI2C_SlaveStopDetectFlag)); - - /* Revert to sending an Ack by default, in case we sent a Nack for receive. */ - base->STAR = 0U; - - if ((0U != (handle->eventMask & (uint32_t)xfer->event)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - - if (0U != (flags & (uint32_t)kLPI2C_SlaveStopDetectFlag)) - { - /* Clean up transfer info on completion, after the callback has been invoked. */ - (void)memset(&handle->transfer, 0, sizeof(handle->transfer)); - } - } - if (0U != (flags & (uint32_t)kLPI2C_SlaveAddressValidFlag)) - { - xfer->event = kLPI2C_SlaveAddressMatchEvent; - xfer->receivedAddress = (uint8_t)(base->SASR & LPI2C_SASR_RADDR_MASK); - - /* Update handle status to busy because slave is addressed. */ - handle->isBusy = true; - if ((0U != (handle->eventMask & (uint32_t)kLPI2C_SlaveAddressMatchEvent)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - } - if (0U != (flags & (uint32_t)kLPI2C_SlaveTransmitAckFlag)) - { - xfer->event = kLPI2C_SlaveTransmitAckEvent; - - if ((0U != (handle->eventMask & (uint32_t)kLPI2C_SlaveTransmitAckEvent)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - else - { - LPI2C_SlaveTransmitAck(base, true); - } - } - - /* Handle transmit and receive. */ - if (0U != (flags & (uint32_t)kLPI2C_SlaveTxReadyFlag)) - { - handle->wasTransmit = true; - - /* If we're out of data, invoke callback to get more. */ - if ((NULL == xfer->data) || (0U == xfer->dataSize)) - { - xfer->event = kLPI2C_SlaveTransmitEvent; - if (NULL != handle->callback) - { - handle->callback(base, xfer, handle->userData); - } - - /* Clear the transferred count now that we have a new buffer. */ - handle->transferredCount = 0U; - } - - /* Transmit a byte. */ - if ((NULL != xfer->data) && (0U != xfer->dataSize)) - { - base->STDR = *xfer->data++; - --xfer->dataSize; - ++handle->transferredCount; - } - } - if (0U != (flags & (uint32_t)kLPI2C_SlaveRxReadyFlag)) - { - /* If we're out of room in the buffer, invoke callback to get another. */ - if ((NULL == xfer->data) || (0U == xfer->dataSize)) - { - xfer->event = kLPI2C_SlaveReceiveEvent; - if (NULL != handle->callback) - { - handle->callback(base, xfer, handle->userData); - } - - /* Clear the transferred count now that we have a new buffer. */ - handle->transferredCount = 0U; - } - - /* Receive a byte. */ - if ((NULL != xfer->data) && (0U != xfer->dataSize)) - { - *xfer->data++ = (uint8_t)base->SRDR; - --xfer->dataSize; - ++handle->transferredCount; - if (0U != (base->SCFGR1 & LPI2C_SCFGR1_ACKSTALL_MASK)) - { - if (((0U == (handle->eventMask & (uint32_t)kLPI2C_SlaveTransmitAckEvent)) || - (NULL == handle->callback))) - { - LPI2C_SlaveTransmitAck(base, true); - } - } - } - else - { - /* We don't have any room to receive more data, so send a nack. */ - if (0U != (base->SCFGR1 & LPI2C_SCFGR1_ACKSTALL_MASK)) - { - if (((0U == (handle->eventMask & (uint32_t)kLPI2C_SlaveTransmitAckEvent)) || - (NULL == handle->callback))) - { - LPI2C_SlaveTransmitAck(base, false); - } - } - } - } - } - } -} - -#if !(defined(FSL_FEATURE_I2C_HAS_NO_IRQ) && FSL_FEATURE_I2C_HAS_NO_IRQ) -/*! - * @brief Shared IRQ handler that can call both master and slave ISRs. - * - * The master and slave ISRs are called through function pointers in order to decouple - * this code from the ISR functions. Without this, the linker would always pull in both - * ISRs and every function they call, even if only the functional API was used. - * - * @param base The LPI2C peripheral base address. - * @param instance The LPI2C peripheral instance number. - */ -void LPI2C_CommonIRQHandler(LPI2C_Type *base, uint32_t instance); -void LPI2C_CommonIRQHandler(LPI2C_Type *base, uint32_t instance) -{ - /* Check for master IRQ. */ - if ((0U != (base->MCR & LPI2C_MCR_MEN_MASK)) && (NULL != s_lpi2cMasterIsr)) - { - /* Master mode. */ - s_lpi2cMasterIsr(instance, s_lpi2cMasterHandle[instance]); - } - - /* Check for slave IRQ. */ - if ((0U != (base->SCR & LPI2C_SCR_SEN_MASK)) && (NULL != s_lpi2cSlaveIsr)) - { - /* Slave mode. */ - s_lpi2cSlaveIsr(instance, s_lpi2cSlaveHandle[instance]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(LPI2C15) -/* Implementation of LPI2C15 handler named in startup code. */ -void LPI2C15_DriverIRQHandler(void); -void LPI2C15_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(LPI2C15, 15U); -} -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpi2c.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpi2c.h deleted file mode 100644 index cd7cba0335f..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpi2c.h +++ /dev/null @@ -1,1342 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LPI2C_H_ -#define FSL_LPI2C_H_ - -#include -#include "fsl_device_registers.h" -#include "fsl_common.h" -#include "fsl_lpflexcomm.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @addtogroup lpi2c - * @{ - */ - -/*! @name Driver version */ -/*@{*/ -/*! @brief LPI2C driver version. */ -#define FSL_LPI2C_DRIVER_VERSION (MAKE_VERSION(2, 2, 3)) -/*@}*/ - -/*! @brief Retry times for waiting flag. */ -#ifndef I2C_RETRY_TIMES -#define I2C_RETRY_TIMES 0U /* Define to zero means keep waiting until the flag is assert/deassert. */ -#endif - -/*! @brief LPI2C status return codes. */ -enum -{ - kStatus_LPI2C_Busy = MAKE_STATUS(kStatusGroup_LPI2C, 0), /*!< The master is already performing a transfer. */ - kStatus_LPI2C_Idle = MAKE_STATUS(kStatusGroup_LPI2C, 1), /*!< The slave driver is idle. */ - kStatus_LPI2C_Nak = MAKE_STATUS(kStatusGroup_LPI2C, 2), /*!< The slave device sent a NAK in response to a byte. */ - kStatus_LPI2C_FifoError = MAKE_STATUS(kStatusGroup_LPI2C, 3), /*!< FIFO under run or overrun. */ - kStatus_LPI2C_BitError = MAKE_STATUS(kStatusGroup_LPI2C, 4), /*!< Transferred bit was not seen on the bus. */ - kStatus_LPI2C_ArbitrationLost = MAKE_STATUS(kStatusGroup_LPI2C, 5), /*!< Arbitration lost error. */ - kStatus_LPI2C_PinLowTimeout = - MAKE_STATUS(kStatusGroup_LPI2C, 6), /*!< SCL or SDA were held low longer than the timeout. */ - kStatus_LPI2C_NoTransferInProgress = - MAKE_STATUS(kStatusGroup_LPI2C, 7), /*!< Attempt to abort a transfer when one is not in progress. */ - kStatus_LPI2C_DmaRequestFail = MAKE_STATUS(kStatusGroup_LPI2C, 8), /*!< DMA request failed. */ - kStatus_LPI2C_Timeout = MAKE_STATUS(kStatusGroup_LPI2C, 9), /*!< Timeout polling status flags. */ -}; - -/*! @} */ - -/*! - * @addtogroup lpi2c_master_driver - * @{ - */ - -/*! - * @brief LPI2C master peripheral flags. - * - * The following status register flags can be cleared: - * - #kLPI2C_MasterEndOfPacketFlag - * - #kLPI2C_MasterStopDetectFlag - * - #kLPI2C_MasterNackDetectFlag - * - #kLPI2C_MasterArbitrationLostFlag - * - #kLPI2C_MasterFifoErrFlag - * - #kLPI2C_MasterPinLowTimeoutFlag - * - #kLPI2C_MasterDataMatchFlag - * - * All flags except #kLPI2C_MasterBusyFlag and #kLPI2C_MasterBusBusyFlag can be enabled as - * interrupts. - * - * @note These enums are meant to be OR'd together to form a bit mask. - */ -enum _lpi2c_master_flags -{ - kLPI2C_MasterTxReadyFlag = LPI2C_MSR_TDF_MASK, /*!< Transmit data flag */ - kLPI2C_MasterRxReadyFlag = LPI2C_MSR_RDF_MASK, /*!< Receive data flag */ - kLPI2C_MasterEndOfPacketFlag = LPI2C_MSR_EPF_MASK, /*!< End Packet flag */ - kLPI2C_MasterStopDetectFlag = LPI2C_MSR_SDF_MASK, /*!< Stop detect flag */ - kLPI2C_MasterNackDetectFlag = LPI2C_MSR_NDF_MASK, /*!< NACK detect flag */ - kLPI2C_MasterArbitrationLostFlag = LPI2C_MSR_ALF_MASK, /*!< Arbitration lost flag */ - kLPI2C_MasterFifoErrFlag = LPI2C_MSR_FEF_MASK, /*!< FIFO error flag */ - kLPI2C_MasterPinLowTimeoutFlag = LPI2C_MSR_PLTF_MASK, /*!< Pin low timeout flag */ - kLPI2C_MasterDataMatchFlag = LPI2C_MSR_DMF_MASK, /*!< Data match flag */ - kLPI2C_MasterBusyFlag = LPI2C_MSR_MBF_MASK, /*!< Master busy flag */ - kLPI2C_MasterBusBusyFlag = LPI2C_MSR_BBF_MASK, /*!< Bus busy flag */ - - /*! All flags which are cleared by the driver upon starting a transfer. */ - kLPI2C_MasterClearFlags = kLPI2C_MasterEndOfPacketFlag | kLPI2C_MasterStopDetectFlag | kLPI2C_MasterNackDetectFlag | - kLPI2C_MasterArbitrationLostFlag | kLPI2C_MasterFifoErrFlag | - kLPI2C_MasterPinLowTimeoutFlag | kLPI2C_MasterDataMatchFlag, - /*! IRQ sources enabled by the non-blocking transactional API. */ - kLPI2C_MasterIrqFlags = kLPI2C_MasterArbitrationLostFlag | kLPI2C_MasterTxReadyFlag | kLPI2C_MasterRxReadyFlag | - kLPI2C_MasterStopDetectFlag | kLPI2C_MasterNackDetectFlag | kLPI2C_MasterPinLowTimeoutFlag | - kLPI2C_MasterFifoErrFlag, - /*! Errors to check for. */ - kLPI2C_MasterErrorFlags = kLPI2C_MasterNackDetectFlag | kLPI2C_MasterArbitrationLostFlag | - kLPI2C_MasterFifoErrFlag | kLPI2C_MasterPinLowTimeoutFlag -}; - -/*! @brief Direction of master and slave transfers. */ -typedef enum _lpi2c_direction -{ - kLPI2C_Write = 0U, /*!< Master transmit. */ - kLPI2C_Read = 1U /*!< Master receive. */ -} lpi2c_direction_t; - -/*! @brief LPI2C pin configuration. */ -typedef enum _lpi2c_master_pin_config -{ - kLPI2C_2PinOpenDrain = 0x0U, /*!< LPI2C Configured for 2-pin open drain mode */ - kLPI2C_2PinOutputOnly = 0x1U, /*!< LPI2C Configured for 2-pin output only mode (ultra-fast mode) */ - kLPI2C_2PinPushPull = 0x2U, /*!< LPI2C Configured for 2-pin push-pull mode */ - kLPI2C_4PinPushPull = 0x3U, /*!< LPI2C Configured for 4-pin push-pull mode */ - kLPI2C_2PinOpenDrainWithSeparateSlave = - 0x4U, /*!< LPI2C Configured for 2-pin open drain mode with separate LPI2C slave */ - kLPI2C_2PinOutputOnlyWithSeparateSlave = - 0x5U, /*!< LPI2C Configured for 2-pin output only mode(ultra-fast mode) with separate LPI2C slave */ - kLPI2C_2PinPushPullWithSeparateSlave = - 0x6U, /*!< LPI2C Configured for 2-pin push-pull mode with separate LPI2C slave */ - kLPI2C_4PinPushPullWithInvertedOutput = 0x7U /*!< LPI2C Configured for 4-pin push-pull mode(inverted outputs) */ -} lpi2c_master_pin_config_t; - -/*! @brief LPI2C master host request selection. */ -typedef enum _lpi2c_host_request_source -{ - kLPI2C_HostRequestExternalPin = 0x0U, /*!< Select the LPI2C_HREQ pin as the host request input */ - kLPI2C_HostRequestInputTrigger = 0x1U, /*!< Select the input trigger as the host request input */ -} lpi2c_host_request_source_t; - -/*! @brief LPI2C master host request pin polarity configuration. */ -typedef enum _lpi2c_host_request_polarity -{ - kLPI2C_HostRequestPinActiveLow = 0x0U, /*!< Configure the LPI2C_HREQ pin active low */ - kLPI2C_HostRequestPinActiveHigh = 0x1U /*!< Configure the LPI2C_HREQ pin active high */ -} lpi2c_host_request_polarity_t; - -/*! - * @brief Structure with settings to initialize the LPI2C master module. - * - * This structure holds configuration settings for the LPI2C peripheral. To initialize this - * structure to reasonable defaults, call the LPI2C_MasterGetDefaultConfig() function and - * pass a pointer to your configuration structure instance. - * - * The configuration structure can be made constant so it resides in flash. - */ -typedef struct _lpi2c_master_config -{ - bool enableMaster; /*!< Whether to enable master mode. */ - bool enableDoze; /*!< Whether master is enabled in doze mode. */ - bool debugEnable; /*!< Enable transfers to continue when halted in debug mode. */ - bool ignoreAck; /*!< Whether to ignore ACK/NACK. */ - lpi2c_master_pin_config_t pinConfig; /*!< The pin configuration option. */ - uint32_t baudRate_Hz; /*!< Desired baud rate in Hertz. */ - uint32_t busIdleTimeout_ns; /*!< Bus idle timeout in nanoseconds. Set to 0 to disable. */ - uint32_t pinLowTimeout_ns; /*!< Pin low timeout in nanoseconds. Set to 0 to disable. */ - uint8_t sdaGlitchFilterWidth_ns; /*!< Width in nanoseconds of glitch filter on SDA pin. Set to 0 to disable. */ - uint8_t sclGlitchFilterWidth_ns; /*!< Width in nanoseconds of glitch filter on SCL pin. Set to 0 to disable. */ - struct - { - bool enable; /*!< Enable host request. */ - lpi2c_host_request_source_t source; /*!< Host request source. */ - lpi2c_host_request_polarity_t polarity; /*!< Host request pin polarity. */ - } hostRequest; /*!< Host request options. */ -} lpi2c_master_config_t; - -/*! @brief LPI2C master data match configuration modes. */ -typedef enum _lpi2c_data_match_config_mode -{ - kLPI2C_MatchDisabled = 0x0U, /*!< LPI2C Match Disabled */ - kLPI2C_1stWordEqualsM0OrM1 = 0x2U, /*!< LPI2C Match Enabled and 1st data word equals MATCH0 OR MATCH1 */ - kLPI2C_AnyWordEqualsM0OrM1 = 0x3U, /*!< LPI2C Match Enabled and any data word equals MATCH0 OR MATCH1 */ - kLPI2C_1stWordEqualsM0And2ndWordEqualsM1 = - 0x4U, /*!< LPI2C Match Enabled and 1st data word equals MATCH0, 2nd data equals MATCH1 */ - kLPI2C_AnyWordEqualsM0AndNextWordEqualsM1 = - 0x5U, /*!< LPI2C Match Enabled and any data word equals MATCH0, next data equals MATCH1 */ - kLPI2C_1stWordAndM1EqualsM0AndM1 = - 0x6U, /*!< LPI2C Match Enabled and 1st data word and MATCH0 equals MATCH0 and MATCH1 */ - kLPI2C_AnyWordAndM1EqualsM0AndM1 = - 0x7U /*!< LPI2C Match Enabled and any data word and MATCH0 equals MATCH0 and MATCH1 */ -} lpi2c_data_match_config_mode_t; - -/*! @brief LPI2C master data match configuration structure. */ -typedef struct _lpi2c_match_config -{ - lpi2c_data_match_config_mode_t matchMode; /*!< Data match configuration setting. */ - bool rxDataMatchOnly; /*!< When set to true, received data is ignored until a successful match. */ - uint32_t match0; /*!< Match value 0. */ - uint32_t match1; /*!< Match value 1. */ -} lpi2c_data_match_config_t; - -/* Forward declaration of the transfer descriptor and handle typedefs. */ -typedef struct _lpi2c_master_transfer lpi2c_master_transfer_t; -typedef struct _lpi2c_master_handle lpi2c_master_handle_t; - -/*! - * @brief Master completion callback function pointer type. - * - * This callback is used only for the non-blocking master transfer API. Specify the callback you wish to use - * in the call to LPI2C_MasterTransferCreateHandle(). - * - * @param base The LPI2C peripheral base address. - * @param completionStatus Either kStatus_Success or an error code describing how the transfer completed. - * @param userData Arbitrary pointer-sized value passed from the application. - */ -typedef void (*lpi2c_master_transfer_callback_t)(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - status_t completionStatus, - void *userData); - -/*! - * @brief Transfer option flags. - * - * @note These enumerations are intended to be OR'd together to form a bit mask of options for - * the #_lpi2c_master_transfer::flags field. - */ -enum _lpi2c_master_transfer_flags -{ - kLPI2C_TransferDefaultFlag = 0x00U, /*!< Transfer starts with a start signal, stops with a stop signal. */ - kLPI2C_TransferNoStartFlag = 0x01U, /*!< Don't send a start condition, address, and sub address */ - kLPI2C_TransferRepeatedStartFlag = 0x02U, /*!< Send a repeated start condition */ - kLPI2C_TransferNoStopFlag = 0x04U, /*!< Don't send a stop condition. */ -}; - -/*! - * @brief Non-blocking transfer descriptor structure. - * - * This structure is used to pass transaction parameters to the LPI2C_MasterTransferNonBlocking() API. - */ -struct _lpi2c_master_transfer -{ - uint32_t flags; /*!< Bit mask of options for the transfer. See enumeration #_lpi2c_master_transfer_flags for - available options. Set to 0 or #kLPI2C_TransferDefaultFlag for normal transfers. */ - uint16_t slaveAddress; /*!< The 7-bit slave address. */ - lpi2c_direction_t direction; /*!< Either #kLPI2C_Read or #kLPI2C_Write. */ - uint32_t subaddress; /*!< Sub address. Transferred MSB first. */ - size_t subaddressSize; /*!< Length of sub address to send in bytes. Maximum size is 4 bytes. */ - void *data; /*!< Pointer to data to transfer. */ - size_t dataSize; /*!< Number of bytes to transfer. */ -}; - -/*! - * @brief Driver handle for master non-blocking APIs. - * @note The contents of this structure are private and subject to change. - */ -struct _lpi2c_master_handle -{ - uint8_t state; /*!< Transfer state machine current state. */ - uint16_t remainingBytes; /*!< Remaining byte count in current state. */ - uint8_t *buf; /*!< Buffer pointer for current state. */ - uint16_t commandBuffer[6]; /*!< LPI2C command sequence. When all 6 command words are used: - Start&addr&write[1 word] + subaddr[4 words] + restart&addr&read[1 word] */ - lpi2c_master_transfer_t transfer; /*!< Copy of the current transfer info. */ - lpi2c_master_transfer_callback_t completionCallback; /*!< Callback function pointer. */ - void *userData; /*!< Application data passed to callback. */ -}; - -/*! @brief Typedef for master interrupt handler, used internally for LPI2C master interrupt and EDMA transactional APIs. - */ -typedef void (*lpi2c_master_isr_t)(uint32_t instance, void *handle); - -/*! @} */ - -/*! - * @addtogroup lpi2c_slave_driver - * @{ - */ - -/*! - * @brief LPI2C slave peripheral flags. - * - * The following status register flags can be cleared: - * - #kLPI2C_SlaveRepeatedStartDetectFlag - * - #kLPI2C_SlaveStopDetectFlag - * - #kLPI2C_SlaveBitErrFlag - * - #kLPI2C_SlaveFifoErrFlag - * - * All flags except #kLPI2C_SlaveBusyFlag and #kLPI2C_SlaveBusBusyFlag can be enabled as - * interrupts. - * - * @note These enumerations are meant to be OR'd together to form a bit mask. - */ -enum _lpi2c_slave_flags -{ - kLPI2C_SlaveTxReadyFlag = LPI2C_SSR_TDF_MASK, /*!< Transmit data flag */ - kLPI2C_SlaveRxReadyFlag = LPI2C_SSR_RDF_MASK, /*!< Receive data flag */ - kLPI2C_SlaveAddressValidFlag = LPI2C_SSR_AVF_MASK, /*!< Address valid flag */ - kLPI2C_SlaveTransmitAckFlag = LPI2C_SSR_TAF_MASK, /*!< Transmit ACK flag */ - kLPI2C_SlaveRepeatedStartDetectFlag = LPI2C_SSR_RSF_MASK, /*!< Repeated start detect flag */ - kLPI2C_SlaveStopDetectFlag = LPI2C_SSR_SDF_MASK, /*!< Stop detect flag */ - kLPI2C_SlaveBitErrFlag = LPI2C_SSR_BEF_MASK, /*!< Bit error flag */ - kLPI2C_SlaveFifoErrFlag = LPI2C_SSR_FEF_MASK, /*!< FIFO error flag */ - kLPI2C_SlaveAddressMatch0Flag = LPI2C_SSR_AM0F_MASK, /*!< Address match 0 flag */ - kLPI2C_SlaveAddressMatch1Flag = LPI2C_SSR_AM1F_MASK, /*!< Address match 1 flag */ - kLPI2C_SlaveGeneralCallFlag = LPI2C_SSR_GCF_MASK, /*!< General call flag */ - kLPI2C_SlaveBusyFlag = LPI2C_SSR_SBF_MASK, /*!< Master busy flag */ - kLPI2C_SlaveBusBusyFlag = LPI2C_SSR_BBF_MASK, /*!< Bus busy flag */ - /*! All flags which are cleared by the driver upon starting a transfer. */ - kLPI2C_SlaveClearFlags = kLPI2C_SlaveRepeatedStartDetectFlag | kLPI2C_SlaveStopDetectFlag | kLPI2C_SlaveBitErrFlag | - kLPI2C_SlaveFifoErrFlag, - /*! IRQ sources enabled by the non-blocking transactional API. */ - kLPI2C_SlaveIrqFlags = kLPI2C_SlaveTxReadyFlag | kLPI2C_SlaveRxReadyFlag | kLPI2C_SlaveStopDetectFlag | - kLPI2C_SlaveRepeatedStartDetectFlag | kLPI2C_SlaveFifoErrFlag | kLPI2C_SlaveBitErrFlag | - kLPI2C_SlaveTransmitAckFlag | kLPI2C_SlaveAddressValidFlag, - /*! Errors to check for. */ - kLPI2C_SlaveErrorFlags = kLPI2C_SlaveFifoErrFlag | kLPI2C_SlaveBitErrFlag -}; - -/*! @brief LPI2C slave address match options. */ -typedef enum _lpi2c_slave_address_match -{ - kLPI2C_MatchAddress0 = 0U, /*!< Match only address 0. */ - kLPI2C_MatchAddress0OrAddress1 = 2U, /*!< Match either address 0 or address 1. */ - kLPI2C_MatchAddress0ThroughAddress1 = 6U, /*!< Match a range of slave addresses from address 0 through address 1. */ -} lpi2c_slave_address_match_t; - -/*! - * @brief Structure with settings to initialize the LPI2C slave module. - * - * This structure holds configuration settings for the LPI2C slave peripheral. To initialize this - * structure to reasonable defaults, call the LPI2C_SlaveGetDefaultConfig() function and - * pass a pointer to your configuration structure instance. - * - * The configuration structure can be made constant so it resides in flash. - */ -typedef struct _lpi2c_slave_config -{ - bool enableSlave; /*!< Enable slave mode. */ - uint8_t address0; /*!< Slave's 7-bit address. */ - uint8_t address1; /*!< Alternate slave 7-bit address. */ - lpi2c_slave_address_match_t addressMatchMode; /*!< Address matching options. */ - bool filterDozeEnable; /*!< Enable digital glitch filter in doze mode. */ - bool filterEnable; /*!< Enable digital glitch filter. */ - bool enableGeneralCall; /*!< Enable general call address matching. */ - struct - { - bool enableAck; /*!< Enables SCL clock stretching during slave-transmit address byte(s) - and slave-receiver address and data byte(s) to allow software to - write the Transmit ACK Register before the ACK or NACK is transmitted. - Clock stretching occurs when transmitting the 9th bit. When - enableAckSCLStall is enabled, there is no need to set either - enableRxDataSCLStall or enableAddressSCLStall. */ - bool enableTx; /*!< Enables SCL clock stretching when the transmit data flag is set - during a slave-transmit transfer. */ - bool enableRx; /*!< Enables SCL clock stretching when receive data flag is set during - a slave-receive transfer. */ - bool enableAddress; /*!< Enables SCL clock stretching when the address valid flag is asserted. */ - } sclStall; - bool ignoreAck; /*!< Continue transfers after a NACK is detected. */ - bool enableReceivedAddressRead; /*!< Enable reading the address received address as the first byte of data. */ - uint32_t sdaGlitchFilterWidth_ns; /*!< Width in nanoseconds of the digital filter on the SDA signal. Set to 0 to - disable. */ - uint32_t sclGlitchFilterWidth_ns; /*!< Width in nanoseconds of the digital filter on the SCL signal. Set to 0 to - disable. */ - uint32_t dataValidDelay_ns; /*!< Width in nanoseconds of the data valid delay. */ - uint32_t clockHoldTime_ns; /*!< Width in nanoseconds of the clock hold time. */ -} lpi2c_slave_config_t; - -/*! - * @brief Set of events sent to the callback for non blocking slave transfers. - * - * These event enumerations are used for two related purposes. First, a bit mask created by OR'ing together - * events is passed to LPI2C_SlaveTransferNonBlocking() in order to specify which events to enable. - * Then, when the slave callback is invoked, it is passed the current event through its @a transfer - * parameter. - * - * @note These enumerations are meant to be OR'd together to form a bit mask of events. - */ -typedef enum _lpi2c_slave_transfer_event -{ - kLPI2C_SlaveAddressMatchEvent = 0x01U, /*!< Received the slave address after a start or repeated start. */ - kLPI2C_SlaveTransmitEvent = 0x02U, /*!< Callback is requested to provide data to transmit - (slave-transmitter role). */ - kLPI2C_SlaveReceiveEvent = 0x04U, /*!< Callback is requested to provide a buffer in which to place received - data (slave-receiver role). */ - kLPI2C_SlaveTransmitAckEvent = 0x08U, /*!< Callback needs to either transmit an ACK or NACK. - When this event is set, the driver will no longer decide to reply to ack/nack. */ - kLPI2C_SlaveRepeatedStartEvent = 0x10U, /*!< A repeated start was detected. */ - kLPI2C_SlaveCompletionEvent = 0x20U, /*!< A stop was detected, completing the transfer. */ - - /*! Bit mask of all available events. */ - kLPI2C_SlaveAllEvents = kLPI2C_SlaveAddressMatchEvent | kLPI2C_SlaveTransmitEvent | kLPI2C_SlaveReceiveEvent | - kLPI2C_SlaveTransmitAckEvent | kLPI2C_SlaveRepeatedStartEvent | kLPI2C_SlaveCompletionEvent, -} lpi2c_slave_transfer_event_t; - -/*! @brief LPI2C slave transfer structure */ -typedef struct _lpi2c_slave_transfer -{ - lpi2c_slave_transfer_event_t event; /*!< Reason the callback is being invoked. */ - uint8_t receivedAddress; /*!< Matching address send by master. */ - uint8_t *data; /*!< Transfer buffer */ - size_t dataSize; /*!< Transfer size */ - status_t completionStatus; /*!< Success or error code describing how the transfer completed. Only applies for - #kLPI2C_SlaveCompletionEvent. */ - size_t transferredCount; /*!< Number of bytes actually transferred since start or last repeated start. */ -} lpi2c_slave_transfer_t; - -/* Forward declaration. */ -typedef struct _lpi2c_slave_handle lpi2c_slave_handle_t; - -/*! - * @brief Slave event callback function pointer type. - * - * This callback is used only for the slave non-blocking transfer API. To install a callback, - * use the LPI2C_SlaveSetCallback() function after you have created a handle. - * - * @param base Base address for the LPI2C instance on which the event occurred. - * @param transfer Pointer to transfer descriptor containing values passed to and/or from the callback. - * @param userData Arbitrary pointer-sized value passed from the application. - */ -typedef void (*lpi2c_slave_transfer_callback_t)(LPI2C_Type *base, lpi2c_slave_transfer_t *transfer, void *userData); - -/*! - * @brief LPI2C slave handle structure. - * @note The contents of this structure are private and subject to change. - */ -struct _lpi2c_slave_handle -{ - lpi2c_slave_transfer_t transfer; /*!< LPI2C slave transfer copy. */ - bool isBusy; /*!< Whether transfer is busy. */ - bool wasTransmit; /*!< Whether the last transfer was a transmit. */ - uint32_t eventMask; /*!< Mask of enabled events. */ - uint32_t transferredCount; /*!< Count of bytes transferred. */ - lpi2c_slave_transfer_callback_t callback; /*!< Callback function called at transfer event. */ - void *userData; /*!< Callback parameter passed to callback. */ -}; - -/*! @} */ - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! Array to map LPI2C instance number to IRQ number, used internally for LPI2C master interrupt and EDMA transactional -APIs. */ -extern IRQn_Type const kLpi2cIrqs[]; - -/*! Pointer to master IRQ handler for each instance, used internally for LPI2C master interrupt and EDMA transactional -APIs. */ -extern lpi2c_master_isr_t s_lpi2cMasterIsr; - -/*! Pointers to master handles for each instance, used internally for LPI2C master interrupt and EDMA transactional -APIs. */ -extern void *s_lpi2cMasterHandle[]; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @brief Returns an instance number given a base address. - * - * If an invalid base address is passed, debug builds will assert. Release builds will just return - * instance number 0. - * - * @param base The LPI2C peripheral base address. - * @return LPI2C instance number starting from 0. - */ -uint32_t LPI2C_GetInstance(LPI2C_Type *base); - -/*! - * @addtogroup lpi2c_master_driver - * @{ - */ - -/*! @name Initialization and deinitialization */ -/*@{*/ - -/*! - * @brief Provides a default configuration for the LPI2C master peripheral. - * - * This function provides the following default configuration for the LPI2C master peripheral: - * @code - * masterConfig->enableMaster = true; - * masterConfig->debugEnable = false; - * masterConfig->ignoreAck = false; - * masterConfig->pinConfig = kLPI2C_2PinOpenDrain; - * masterConfig->baudRate_Hz = 100000U; - * masterConfig->busIdleTimeout_ns = 0; - * masterConfig->pinLowTimeout_ns = 0; - * masterConfig->sdaGlitchFilterWidth_ns = 0; - * masterConfig->sclGlitchFilterWidth_ns = 0; - * masterConfig->hostRequest.enable = false; - * masterConfig->hostRequest.source = kLPI2C_HostRequestExternalPin; - * masterConfig->hostRequest.polarity = kLPI2C_HostRequestPinActiveHigh; - * @endcode - * - * After calling this function, you can override any settings in order to customize the configuration, - * prior to initializing the master driver with LPI2C_MasterInit(). - * - * @param[out] masterConfig User provided configuration structure for default values. Refer to #lpi2c_master_config_t. - */ -void LPI2C_MasterGetDefaultConfig(lpi2c_master_config_t *masterConfig); - -/*! - * @brief Initializes the LPI2C master peripheral. - * - * This function enables the peripheral clock and initializes the LPI2C master peripheral as described by the user - * provided configuration. A software reset is performed prior to configuration. - * - * @param base The LPI2C peripheral base address. - * @param masterConfig User provided peripheral configuration. Use LPI2C_MasterGetDefaultConfig() to get a set of - * defaults - * that you can override. - * @param sourceClock_Hz Frequency in Hertz of the LPI2C functional clock. Used to calculate the baud rate divisors, - * filter widths, and timeout periods. - */ -void LPI2C_MasterInit(LPI2C_Type *base, const lpi2c_master_config_t *masterConfig, uint32_t sourceClock_Hz); - -/*! - * @brief Deinitializes the LPI2C master peripheral. - * - * This function disables the LPI2C master peripheral and gates the clock. It also performs a software - * reset to restore the peripheral to reset conditions. - * - * @param base The LPI2C peripheral base address. - */ -void LPI2C_MasterDeinit(LPI2C_Type *base); - -/*! - * @brief Configures LPI2C master data match feature. - * - * @param base The LPI2C peripheral base address. - * @param matchConfig Settings for the data match feature. - */ -void LPI2C_MasterConfigureDataMatch(LPI2C_Type *base, const lpi2c_data_match_config_t *matchConfig); - -/* Not static so it can be used from fsl_lpi2c_edma.c. */ -status_t LPI2C_MasterCheckAndClearError(LPI2C_Type *base, uint32_t status); - -/* Not static so it can be used from fsl_lpi2c_edma.c. */ -status_t LPI2C_CheckForBusyBus(LPI2C_Type *base); - -/*! - * @brief Performs a software reset. - * - * Restores the LPI2C master peripheral to reset conditions. - * - * @param base The LPI2C peripheral base address. - */ -static inline void LPI2C_MasterReset(LPI2C_Type *base) -{ - base->MCR = LPI2C_MCR_RST_MASK; - base->MCR = 0; -} - -/*! - * @brief Enables or disables the LPI2C module as master. - * - * @param base The LPI2C peripheral base address. - * @param enable Pass true to enable or false to disable the specified LPI2C as master. - */ -static inline void LPI2C_MasterEnable(LPI2C_Type *base, bool enable) -{ - base->MCR = (base->MCR & ~LPI2C_MCR_MEN_MASK) | LPI2C_MCR_MEN(enable); -} - -/*@}*/ - -/*! @name Status */ -/*@{*/ - -/*! - * @brief Gets the LPI2C master status flags. - * - * A bit mask with the state of all LPI2C master status flags is returned. For each flag, the corresponding bit - * in the return value is set if the flag is asserted. - * - * @param base The LPI2C peripheral base address. - * @return State of the status flags: - * - 1: related status flag is set. - * - 0: related status flag is not set. - * @see _lpi2c_master_flags - */ -static inline uint32_t LPI2C_MasterGetStatusFlags(LPI2C_Type *base) -{ - return base->MSR; -} - -/*! - * @brief Clears the LPI2C master status flag state. - * - * The following status register flags can be cleared: - * - #kLPI2C_MasterEndOfPacketFlag - * - #kLPI2C_MasterStopDetectFlag - * - #kLPI2C_MasterNackDetectFlag - * - #kLPI2C_MasterArbitrationLostFlag - * - #kLPI2C_MasterFifoErrFlag - * - #kLPI2C_MasterPinLowTimeoutFlag - * - #kLPI2C_MasterDataMatchFlag - * - * Attempts to clear other flags has no effect. - * - * @param base The LPI2C peripheral base address. - * @param statusMask A bitmask of status flags that are to be cleared. The mask is composed of - * _lpi2c_master_flags enumerators OR'd together. You may pass the result of a previous call to - * LPI2C_MasterGetStatusFlags(). - * @see _lpi2c_master_flags. - */ -static inline void LPI2C_MasterClearStatusFlags(LPI2C_Type *base, uint32_t statusMask) -{ - base->MSR = statusMask; -} - -/*@}*/ - -/*! @name Interrupts */ -/*@{*/ - -/*! - * @brief Enables the LPI2C master interrupt requests. - * - * All flags except #kLPI2C_MasterBusyFlag and #kLPI2C_MasterBusBusyFlag can be enabled as - * interrupts. - * - * @param base The LPI2C peripheral base address. - * @param interruptMask Bit mask of interrupts to enable. See _lpi2c_master_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void LPI2C_MasterEnableInterrupts(LPI2C_Type *base, uint32_t interruptMask) -{ - base->MIER |= interruptMask; -} - -/*! - * @brief Disables the LPI2C master interrupt requests. - * - * All flags except #kLPI2C_MasterBusyFlag and #kLPI2C_MasterBusBusyFlag can be enabled as - * interrupts. - * - * @param base The LPI2C peripheral base address. - * @param interruptMask Bit mask of interrupts to disable. See _lpi2c_master_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void LPI2C_MasterDisableInterrupts(LPI2C_Type *base, uint32_t interruptMask) -{ - base->MIER &= ~interruptMask; -} - -/*! - * @brief Returns the set of currently enabled LPI2C master interrupt requests. - * - * @param base The LPI2C peripheral base address. - * @return A bitmask composed of _lpi2c_master_flags enumerators OR'd together to indicate the - * set of enabled interrupts. - */ -static inline uint32_t LPI2C_MasterGetEnabledInterrupts(LPI2C_Type *base) -{ - return base->MIER; -} - -/*@}*/ - -/*! @name DMA control */ -/*@{*/ - -/*! - * @brief Enables or disables LPI2C master DMA requests. - * - * @param base The LPI2C peripheral base address. - * @param enableTx Enable flag for transmit DMA request. Pass true for enable, false for disable. - * @param enableRx Enable flag for receive DMA request. Pass true for enable, false for disable. - */ -static inline void LPI2C_MasterEnableDMA(LPI2C_Type *base, bool enableTx, bool enableRx) -{ - base->MDER = LPI2C_MDER_TDDE(enableTx) | LPI2C_MDER_RDDE(enableRx); -} - -/*! - * @brief Gets LPI2C master transmit data register address for DMA transfer. - * - * @param base The LPI2C peripheral base address. - * @return The LPI2C Master Transmit Data Register address. - */ -static inline uint32_t LPI2C_MasterGetTxFifoAddress(LPI2C_Type *base) -{ - return (uint32_t)&base->MTDR; -} - -/*! - * @brief Gets LPI2C master receive data register address for DMA transfer. - * - * @param base The LPI2C peripheral base address. - * @return The LPI2C Master Receive Data Register address. - */ -static inline uint32_t LPI2C_MasterGetRxFifoAddress(LPI2C_Type *base) -{ - return (uint32_t)&base->MRDR; -} - -/*@}*/ - -/*! @name FIFO control */ -/*@{*/ - -/*! - * @brief Sets the watermarks for LPI2C master FIFOs. - * - * @param base The LPI2C peripheral base address. - * @param txWords Transmit FIFO watermark value in words. The #kLPI2C_MasterTxReadyFlag flag is set whenever - * the number of words in the transmit FIFO is equal or less than @a txWords. Writing a value equal or - * greater than the FIFO size is truncated. - * @param rxWords Receive FIFO watermark value in words. The #kLPI2C_MasterRxReadyFlag flag is set whenever - * the number of words in the receive FIFO is greater than @a rxWords. Writing a value equal or greater - * than the FIFO size is truncated. - */ -static inline void LPI2C_MasterSetWatermarks(LPI2C_Type *base, size_t txWords, size_t rxWords) -{ - base->MFCR = LPI2C_MFCR_TXWATER(txWords) | LPI2C_MFCR_RXWATER(rxWords); -} - -/*! - * @brief Gets the current number of words in the LPI2C master FIFOs. - * - * @param base The LPI2C peripheral base address. - * @param[out] txCount Pointer through which the current number of words in the transmit FIFO is returned. - * Pass NULL if this value is not required. - * @param[out] rxCount Pointer through which the current number of words in the receive FIFO is returned. - * Pass NULL if this value is not required. - */ -static inline void LPI2C_MasterGetFifoCounts(LPI2C_Type *base, size_t *rxCount, size_t *txCount) -{ - if (NULL != txCount) - { - *txCount = (base->MFSR & LPI2C_MFSR_TXCOUNT_MASK) >> LPI2C_MFSR_TXCOUNT_SHIFT; - } - if (NULL != rxCount) - { - *rxCount = (base->MFSR & LPI2C_MFSR_RXCOUNT_MASK) >> LPI2C_MFSR_RXCOUNT_SHIFT; - } -} - -/*@}*/ - -/*! @name Bus operations */ -/*@{*/ - -/*! - * @brief Sets the I2C bus frequency for master transactions. - * - * The LPI2C master is automatically disabled and re-enabled as necessary to configure the baud - * rate. Do not call this function during a transfer, or the transfer is aborted. - * - * @note Please note that the second parameter is the clock frequency of LPI2C module, the third - * parameter means user configured bus baudrate, this implementation is different from other I2C drivers - * which use baudrate configuration as second parameter and source clock frequency as third parameter. - * - * @param base The LPI2C peripheral base address. - * @param sourceClock_Hz LPI2C functional clock frequency in Hertz. - * @param baudRate_Hz Requested bus frequency in Hertz. - */ -void LPI2C_MasterSetBaudRate(LPI2C_Type *base, uint32_t sourceClock_Hz, uint32_t baudRate_Hz); - -/*! - * @brief Returns whether the bus is idle. - * - * Requires the master mode to be enabled. - * - * @param base The LPI2C peripheral base address. - * @retval true Bus is busy. - * @retval false Bus is idle. - */ -static inline bool LPI2C_MasterGetBusIdleState(LPI2C_Type *base) -{ - return ((base->MSR & LPI2C_MSR_BBF_MASK) >> LPI2C_MSR_BBF_SHIFT) == 1U ? true : false; -} - -/*! - * @brief Sends a START signal and slave address on the I2C bus. - * - * This function is used to initiate a new master mode transfer. First, the bus state is checked to ensure - * that another master is not occupying the bus. Then a START signal is transmitted, followed by the - * 7-bit address specified in the @a address parameter. Note that this function does not actually wait - * until the START and address are successfully sent on the bus before returning. - * - * @param base The LPI2C peripheral base address. - * @param address 7-bit slave device address, in bits [6:0]. - * @param dir Master transfer direction, either #kLPI2C_Read or #kLPI2C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * @retval kStatus_Success START signal and address were successfully enqueued in the transmit FIFO. - * @retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - */ -status_t LPI2C_MasterStart(LPI2C_Type *base, uint8_t address, lpi2c_direction_t dir); - -/*! - * @brief Sends a repeated START signal and slave address on the I2C bus. - * - * This function is used to send a Repeated START signal when a transfer is already in progress. Like - * LPI2C_MasterStart(), it also sends the specified 7-bit address. - * - * @note This function exists primarily to maintain compatible APIs between LPI2C and I2C drivers, - * as well as to better document the intent of code that uses these APIs. - * - * @param base The LPI2C peripheral base address. - * @param address 7-bit slave device address, in bits [6:0]. - * @param dir Master transfer direction, either #kLPI2C_Read or #kLPI2C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * @retval kStatus_Success Repeated START signal and address were successfully enqueued in the transmit FIFO. - * @retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - */ -static inline status_t LPI2C_MasterRepeatedStart(LPI2C_Type *base, uint8_t address, lpi2c_direction_t dir) -{ - return LPI2C_MasterStart(base, address, dir); -} - -/*! - * @brief Performs a polling send transfer on the I2C bus. - * - * Sends up to @a txSize number of bytes to the previously addressed slave device. The slave may - * reply with a NAK to any byte in order to terminate the transfer early. If this happens, this - * function returns #kStatus_LPI2C_Nak. - * - * @param base The LPI2C peripheral base address. - * @param txBuff The pointer to the data to be transferred. - * @param txSize The length in bytes of the data to be transferred. - * @retval kStatus_Success Data was sent successfully. - * @retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * @retval #kStatus_LPI2C_FifoError FIFO under run or over run. - * @retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * @retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterSend(LPI2C_Type *base, void *txBuff, size_t txSize); - -/*! - * @brief Performs a polling receive transfer on the I2C bus. - * - * @param base The LPI2C peripheral base address. - * @param rxBuff The pointer to the data to be transferred. - * @param rxSize The length in bytes of the data to be transferred. - * @retval kStatus_Success Data was received successfully. - * @retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * @retval #kStatus_LPI2C_FifoError FIFO under run or overrun. - * @retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * @retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterReceive(LPI2C_Type *base, void *rxBuff, size_t rxSize); - -/*! - * @brief Sends a STOP signal on the I2C bus. - * - * This function does not return until the STOP signal is seen on the bus, or an error occurs. - * - * @param base The LPI2C peripheral base address. - * @retval kStatus_Success The STOP signal was successfully sent on the bus and the transaction terminated. - * @retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * @retval #kStatus_LPI2C_FifoError FIFO under run or overrun. - * @retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * @retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterStop(LPI2C_Type *base); - -/*! - * @brief Performs a master polling transfer on the I2C bus. - * - * @note The API does not return until the transfer succeeds or fails due - * to error happens during transfer. - * - * @param base The LPI2C peripheral base address. - * @param transfer Pointer to the transfer structure. - * @retval kStatus_Success Data was received successfully. - * @retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * @retval #kStatus_LPI2C_FifoError FIFO under run or overrun. - * @retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * @retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterTransferBlocking(LPI2C_Type *base, lpi2c_master_transfer_t *transfer); - -/*@}*/ - -/*! @name Non-blocking */ -/*@{*/ - -/*! - * @brief Creates a new handle for the LPI2C master non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the LPI2C_MasterTransferAbort() API shall be called. - * - * - * @note The function also enables the NVIC IRQ for the input LPI2C. Need to notice - * that on some SoCs the LPI2C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - * - * @param base The LPI2C peripheral base address. - * @param[out] handle Pointer to the LPI2C master driver handle. - * @param callback User provided pointer to the asynchronous callback function. - * @param userData User provided pointer to the application callback data. - */ -void LPI2C_MasterTransferCreateHandle(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_master_transfer_callback_t callback, - void *userData); - -/*! - * @brief Performs a non-blocking transaction on the I2C bus. - * - * @param base The LPI2C peripheral base address. - * @param handle Pointer to the LPI2C master driver handle. - * @param transfer The pointer to the transfer descriptor. - * @retval kStatus_Success The transaction was started successfully. - * @retval #kStatus_LPI2C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - */ -status_t LPI2C_MasterTransferNonBlocking(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_master_transfer_t *transfer); - -/*! - * @brief Returns number of bytes transferred so far. - * @param base The LPI2C peripheral base address. - * @param handle Pointer to the LPI2C master driver handle. - * @param[out] count Number of bytes transferred so far by the non-blocking transaction. - * @retval kStatus_Success - * @retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t LPI2C_MasterTransferGetCount(LPI2C_Type *base, lpi2c_master_handle_t *handle, size_t *count); - -/*! - * @brief Terminates a non-blocking LPI2C master transmission early. - * - * @note It is not safe to call this function from an IRQ handler that has a higher priority than the - * LPI2C peripheral's IRQ priority. - * - * @param base The LPI2C peripheral base address. - * @param handle Pointer to the LPI2C master driver handle. - * @retval kStatus_Success A transaction was successfully aborted. - * @retval #kStatus_LPI2C_Idle There is not a non-blocking transaction currently in progress. - */ -void LPI2C_MasterTransferAbort(LPI2C_Type *base, lpi2c_master_handle_t *handle); - -/*@}*/ - -/*! @name IRQ handler */ -/*@{*/ - -/*! - * @brief Reusable routine to handle master interrupts. - * @note This function does not need to be called unless you are reimplementing the - * nonblocking API's interrupt handler routines to add special functionality. - * @param instance The LPI2C instance. - * @param lpi2cMasterHandle Pointer to the LPI2C master driver handle. - */ -void LPI2C_MasterTransferHandleIRQ(uint32_t instance, void *lpi2cMasterHandle); - -/*@}*/ - -/*! @} */ - -/*! - * @addtogroup lpi2c_slave_driver - * @{ - */ - -/*! @name Slave initialization and deinitialization */ -/*@{*/ - -/*! - * @brief Provides a default configuration for the LPI2C slave peripheral. - * - * This function provides the following default configuration for the LPI2C slave peripheral: - * @code - * slaveConfig->enableSlave = true; - * slaveConfig->address0 = 0U; - * slaveConfig->address1 = 0U; - * slaveConfig->addressMatchMode = kLPI2C_MatchAddress0; - * slaveConfig->filterDozeEnable = true; - * slaveConfig->filterEnable = true; - * slaveConfig->enableGeneralCall = false; - * slaveConfig->sclStall.enableAck = false; - * slaveConfig->sclStall.enableTx = true; - * slaveConfig->sclStall.enableRx = true; - * slaveConfig->sclStall.enableAddress = true; - * slaveConfig->ignoreAck = false; - * slaveConfig->enableReceivedAddressRead = false; - * slaveConfig->sdaGlitchFilterWidth_ns = 0; - * slaveConfig->sclGlitchFilterWidth_ns = 0; - * slaveConfig->dataValidDelay_ns = 0; - * slaveConfig->clockHoldTime_ns = 0; - * @endcode - * - * After calling this function, override any settings to customize the configuration, - * prior to initializing the master driver with LPI2C_SlaveInit(). Be sure to override at least the @a - * address0 member of the configuration structure with the desired slave address. - * - * @param[out] slaveConfig User provided configuration structure that is set to default values. Refer to - * #lpi2c_slave_config_t. - */ -void LPI2C_SlaveGetDefaultConfig(lpi2c_slave_config_t *slaveConfig); - -/*! - * @brief Initializes the LPI2C slave peripheral. - * - * This function enables the peripheral clock and initializes the LPI2C slave peripheral as described by the user - * provided configuration. - * - * @param base The LPI2C peripheral base address. - * @param slaveConfig User provided peripheral configuration. Use LPI2C_SlaveGetDefaultConfig() to get a set of defaults - * that you can override. - * @param sourceClock_Hz Frequency in Hertz of the LPI2C functional clock. Used to calculate the filter widths, - * data valid delay, and clock hold time. - */ -void LPI2C_SlaveInit(LPI2C_Type *base, const lpi2c_slave_config_t *slaveConfig, uint32_t sourceClock_Hz); - -/*! - * @brief Deinitializes the LPI2C slave peripheral. - * - * This function disables the LPI2C slave peripheral and gates the clock. It also performs a software - * reset to restore the peripheral to reset conditions. - * - * @param base The LPI2C peripheral base address. - */ -void LPI2C_SlaveDeinit(LPI2C_Type *base); - -/*! - * @brief Performs a software reset of the LPI2C slave peripheral. - * - * @param base The LPI2C peripheral base address. - */ -static inline void LPI2C_SlaveReset(LPI2C_Type *base) -{ - base->SCR = LPI2C_SCR_RST_MASK; - base->SCR = 0; -} - -/*! - * @brief Enables or disables the LPI2C module as slave. - * - * @param base The LPI2C peripheral base address. - * @param enable Pass true to enable or false to disable the specified LPI2C as slave. - */ -static inline void LPI2C_SlaveEnable(LPI2C_Type *base, bool enable) -{ - base->SCR = (base->SCR & ~LPI2C_SCR_SEN_MASK) | LPI2C_SCR_SEN(enable); -} - -/*@}*/ - -/*! @name Slave status */ -/*@{*/ - -/*! - * @brief Gets the LPI2C slave status flags. - * - * A bit mask with the state of all LPI2C slave status flags is returned. For each flag, the corresponding bit - * in the return value is set if the flag is asserted. - * - * @param base The LPI2C peripheral base address. - * @return State of the status flags: - * - 1: related status flag is set. - * - 0: related status flag is not set. - * @see _lpi2c_slave_flags - */ -static inline uint32_t LPI2C_SlaveGetStatusFlags(LPI2C_Type *base) -{ - return base->SSR; -} - -/*! - * @brief Clears the LPI2C status flag state. - * - * The following status register flags can be cleared: - * - #kLPI2C_SlaveRepeatedStartDetectFlag - * - #kLPI2C_SlaveStopDetectFlag - * - #kLPI2C_SlaveBitErrFlag - * - #kLPI2C_SlaveFifoErrFlag - * - * Attempts to clear other flags has no effect. - * - * @param base The LPI2C peripheral base address. - * @param statusMask A bitmask of status flags that are to be cleared. The mask is composed of - * #_lpi2c_slave_flags enumerators OR'd together. You may pass the result of a previous call to - * LPI2C_SlaveGetStatusFlags(). - * @see _lpi2c_slave_flags. - */ -static inline void LPI2C_SlaveClearStatusFlags(LPI2C_Type *base, uint32_t statusMask) -{ - base->SSR = statusMask; -} - -/*@}*/ - -/*! @name Slave interrupts */ -/*@{*/ - -/*! - * @brief Enables the LPI2C slave interrupt requests. - * - * All flags except #kLPI2C_SlaveBusyFlag and #kLPI2C_SlaveBusBusyFlag can be enabled as - * interrupts. - * - * @param base The LPI2C peripheral base address. - * @param interruptMask Bit mask of interrupts to enable. See #_lpi2c_slave_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void LPI2C_SlaveEnableInterrupts(LPI2C_Type *base, uint32_t interruptMask) -{ - base->SIER |= interruptMask; -} - -/*! - * @brief Disables the LPI2C slave interrupt requests. - * - * All flags except #kLPI2C_SlaveBusyFlag and #kLPI2C_SlaveBusBusyFlag can be enabled as - * interrupts. - * - * @param base The LPI2C peripheral base address. - * @param interruptMask Bit mask of interrupts to disable. See #_lpi2c_slave_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void LPI2C_SlaveDisableInterrupts(LPI2C_Type *base, uint32_t interruptMask) -{ - base->SIER &= ~interruptMask; -} - -/*! - * @brief Returns the set of currently enabled LPI2C slave interrupt requests. - * @param base The LPI2C peripheral base address. - * @return A bitmask composed of #_lpi2c_slave_flags enumerators OR'd together to indicate the - * set of enabled interrupts. - */ -static inline uint32_t LPI2C_SlaveGetEnabledInterrupts(LPI2C_Type *base) -{ - return base->SIER; -} - -/*@}*/ - -/*! @name Slave DMA control */ -/*@{*/ - -/*! - * @brief Enables or disables the LPI2C slave peripheral DMA requests. - * - * @param base The LPI2C peripheral base address. - * @param enableAddressValid Enable flag for the address valid DMA request. Pass true for enable, false for disable. - * The address valid DMA request is shared with the receive data DMA request. - * @param enableRx Enable flag for the receive data DMA request. Pass true for enable, false for disable. - * @param enableTx Enable flag for the transmit data DMA request. Pass true for enable, false for disable. - */ -static inline void LPI2C_SlaveEnableDMA(LPI2C_Type *base, bool enableAddressValid, bool enableRx, bool enableTx) -{ - base->SDER = (base->SDER & ~(LPI2C_SDER_AVDE_MASK | LPI2C_SDER_RDDE_MASK | LPI2C_SDER_TDDE_MASK)) | - LPI2C_SDER_AVDE(enableAddressValid) | LPI2C_SDER_RDDE(enableRx) | LPI2C_SDER_TDDE(enableTx); -} - -/*@}*/ - -/*! @name Slave bus operations */ -/*@{*/ - -/*! - * @brief Returns whether the bus is idle. - * - * Requires the slave mode to be enabled. - * - * @param base The LPI2C peripheral base address. - * @retval true Bus is busy. - * @retval false Bus is idle. - */ -static inline bool LPI2C_SlaveGetBusIdleState(LPI2C_Type *base) -{ - return ((base->SSR & LPI2C_SSR_BBF_MASK) >> LPI2C_SSR_BBF_SHIFT) == 1U ? true : false; -} - -/*! - * @brief Transmits either an ACK or NAK on the I2C bus in response to a byte from the master. - * - * Use this function to send an ACK or NAK when the #kLPI2C_SlaveTransmitAckFlag is asserted. This - * only happens if you enable the sclStall.enableAck field of the ::lpi2c_slave_config_t configuration - * structure used to initialize the slave peripheral. - * - * @param base The LPI2C peripheral base address. - * @param ackOrNack Pass true for an ACK or false for a NAK. - */ -static inline void LPI2C_SlaveTransmitAck(LPI2C_Type *base, bool ackOrNack) -{ - base->STAR = LPI2C_STAR_TXNACK(!ackOrNack); -} - -/*! - * @brief Enables or disables ACKSTALL. - * - * When enables ACKSTALL, software can transmit either an ACK or NAK on the I2C bus in response to - * a byte from the master. - * - * @param base The LPI2C peripheral base address. - * @param enable True will enable ACKSTALL,false will disable ACKSTALL. - */ -static inline void LPI2C_SlaveEnableAckStall(LPI2C_Type *base, bool enable) -{ - if (enable) - { - base->SCFGR1 |= LPI2C_SCFGR1_ACKSTALL_MASK; - } - else - { - base->SCFGR1 &= ~LPI2C_SCFGR1_ACKSTALL_MASK; - } -} - -/*! - * @brief Returns the slave address sent by the I2C master. - * - * This function should only be called if the #kLPI2C_SlaveAddressValidFlag is asserted. - * - * @param base The LPI2C peripheral base address. - * @return The 8-bit address matched by the LPI2C slave. Bit 0 contains the R/w direction bit, and - * the 7-bit slave address is in the upper 7 bits. - */ -static inline uint32_t LPI2C_SlaveGetReceivedAddress(LPI2C_Type *base) -{ - return base->SASR & LPI2C_SASR_RADDR_MASK; -} - -/*! - * @brief Performs a polling send transfer on the I2C bus. - * - * @param base The LPI2C peripheral base address. - * @param txBuff The pointer to the data to be transferred. - * @param txSize The length in bytes of the data to be transferred. - * @param[out] actualTxSize - * @return Error or success status returned by API. - */ -status_t LPI2C_SlaveSend(LPI2C_Type *base, void *txBuff, size_t txSize, size_t *actualTxSize); - -/*! - * @brief Performs a polling receive transfer on the I2C bus. - * - * @param base The LPI2C peripheral base address. - * @param rxBuff The pointer to the data to be transferred. - * @param rxSize The length in bytes of the data to be transferred. - * @param[out] actualRxSize - * @return Error or success status returned by API. - */ -status_t LPI2C_SlaveReceive(LPI2C_Type *base, void *rxBuff, size_t rxSize, size_t *actualRxSize); - -/*@}*/ - -/*! @name Slave non-blocking */ -/*@{*/ - -/*! - * @brief Creates a new handle for the LPI2C slave non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the LPI2C_SlaveTransferAbort() API shall be called. - * - * @note The function also enables the NVIC IRQ for the input LPI2C. Need to notice - * that on some SoCs the LPI2C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - - * @param base The LPI2C peripheral base address. - * @param[out] handle Pointer to the LPI2C slave driver handle. - * @param callback User provided pointer to the asynchronous callback function. - * @param userData User provided pointer to the application callback data. - */ -void LPI2C_SlaveTransferCreateHandle(LPI2C_Type *base, - lpi2c_slave_handle_t *handle, - lpi2c_slave_transfer_callback_t callback, - void *userData); - -/*! - * @brief Starts accepting slave transfers. - * - * Call this API after calling I2C_SlaveInit() and LPI2C_SlaveTransferCreateHandle() to start processing - * transactions driven by an I2C master. The slave monitors the I2C bus and pass events to the - * callback that was passed into the call to LPI2C_SlaveTransferCreateHandle(). The callback is always invoked - * from the interrupt context. - * - * The set of events received by the callback is customizable. To do so, set the @a eventMask parameter to - * the OR'd combination of #lpi2c_slave_transfer_event_t enumerators for the events you wish to receive. - * The #kLPI2C_SlaveTransmitEvent and #kLPI2C_SlaveReceiveEvent events are always enabled and do not need - * to be included in the mask. Alternatively, you can pass 0 to get a default set of only the transmit and - * receive events that are always enabled. In addition, the #kLPI2C_SlaveAllEvents constant is provided as - * a convenient way to enable all events. - * - * @param base The LPI2C peripheral base address. - * @param handle Pointer to lpi2c_slave_handle_t structure which stores the transfer state. - * @param eventMask Bit mask formed by OR'ing together #lpi2c_slave_transfer_event_t enumerators to specify - * which events to send to the callback. Other accepted values are 0 to get a default set of - * only the transmit and receive events, and #kLPI2C_SlaveAllEvents to enable all events. - * - * @retval kStatus_Success Slave transfers were successfully started. - * @retval #kStatus_LPI2C_Busy Slave transfers have already been started on this handle. - */ -status_t LPI2C_SlaveTransferNonBlocking(LPI2C_Type *base, lpi2c_slave_handle_t *handle, uint32_t eventMask); - -/*! - * @brief Gets the slave transfer status during a non-blocking transfer. - * @param base The LPI2C peripheral base address. - * @param handle Pointer to i2c_slave_handle_t structure. - * @param[out] count Pointer to a value to hold the number of bytes transferred. May be NULL if the count is not - * required. - * @retval kStatus_Success - * @retval kStatus_NoTransferInProgress - */ -status_t LPI2C_SlaveTransferGetCount(LPI2C_Type *base, lpi2c_slave_handle_t *handle, size_t *count); - -/*! - * @brief Aborts the slave non-blocking transfers. - * @note This API could be called at any time to stop slave for handling the bus events. - * @param base The LPI2C peripheral base address. - * @param handle Pointer to lpi2c_slave_handle_t structure which stores the transfer state. - * @retval kStatus_Success - * @retval #kStatus_LPI2C_Idle - */ -void LPI2C_SlaveTransferAbort(LPI2C_Type *base, lpi2c_slave_handle_t *handle); - -/*@}*/ - -/*! @name Slave IRQ handler */ -/*@{*/ - -/*! - * @brief Reusable routine to handle slave interrupts. - * @note This function does not need to be called unless you are reimplementing the - * non blocking API's interrupt handler routines to add special functionality. - * @param instance The LPI2C instance. - * @param lpi2cSlaveHandle Pointer to lpi2c_slave_handle_t structure which stores the transfer state. - */ -void LPI2C_SlaveTransferHandleIRQ(uint32_t instance, void *lpi2cSlaveHandle); - -/*@}*/ - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -#endif /* FSL_LPI2C_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpi2c_edma.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpi2c_edma.c deleted file mode 100644 index d2020a6ce36..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpi2c_edma.c +++ /dev/null @@ -1,636 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpi2c_edma.h" -#include -#include - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpflexcomm_lpi2c_edma" -#endif - -/* @brief Mask to align an address to 32 bytes. */ -#define ALIGN_32_MASK (0x1fU) - -/* ! @brief LPI2C master fifo commands. */ -enum _lpi2c_master_fifo_cmd -{ - kTxDataCmd = LPI2C_MTDR_CMD(0x0U), /*!< Transmit DATA[7:0] */ - kRxDataCmd = LPI2C_MTDR_CMD(0X1U), /*!< Receive (DATA[7:0] + 1) bytes */ - kStopCmd = LPI2C_MTDR_CMD(0x2U), /*!< Generate STOP condition */ - kStartCmd = LPI2C_MTDR_CMD(0x4U), /*!< Generate(repeated) START and transmit address in DATA[[7:0] */ -}; - -/*! @brief States for the state machine used by transactional APIs. */ -enum _lpi2c_transfer_states -{ - kIdleState = 0, - kSendCommandState, - kIssueReadCommandState, - kTransferDataState, - kStopState, - kWaitForCompletionState, -}; - -/*! - * @brief Used for conversion from `lpflexcomm_irq_handler_t` to `lpi2c_master_isr_t` - */ -typedef union lpi2c_to_lpflexcomm_edma -{ - lpi2c_master_isr_t lpi2c_master_handler; - lpflexcomm_irq_handler_t lpflexcomm_handler; -} lpi2c_to_lpflexcomm_edma_t; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Prepares the command buffer with the sequence of commands needed to send the requested transaction. - * @param handle Master DMA driver handle. - * @return Number of command words. - */ -static uint32_t LPI2C_GenerateCommands(lpi2c_master_edma_handle_t *handle); - -/*! - * @brief DMA completion callback. - * @param dmaHandle DMA channel handle for the channel that completed. - * @param userData User data associated with the channel handle. For this callback, the user data is the - * LPI2C DMA driver handle. - * @param isTransferDone Whether the DMA transfer has completed. - * @param tcds Number of TCDs that completed. - */ -static void LPI2C_MasterEDMACallback(edma_handle_t *dmaHandle, void *userData, bool isTransferDone, uint32_t tcds); - -/*! - * @brief LPI2C master edma transfer IRQ handle routine. - * - * This API handles the LPI2C bus error status and invoke callback if needed. - * - * @param base The LPI2C peripheral base address. - * @param lpi2cMasterEdmaHandle Pointer to the LPI2C master edma handle. - */ -static void LPI2C_MasterTransferEdmaHandleIRQ(uint32_t instance, void *lpi2cMasterEdmaHandle); -/******************************************************************************* - * Variables - ******************************************************************************/ - -static uint32_t lpi2c_edma_RecSetting = 0x02; - -/*! @brief Array to map LPI2C instance number to base pointer. */ -static LPI2C_Type *const kLpi2cBases[] = LPI2C_BASE_PTRS; - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Create a new handle for the LPI2C master DMA APIs. - * - * The creation of a handle is for use with the DMA APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the LPI2C_MasterTransferAbortEDMA() API shall be called. - * - * For devices where the LPI2C send and receive DMA requests are OR'd together, the a txDmaHandle - * parameter is ignored and may be set to NULL. - * - * param base The LPI2C peripheral base address. - * param[out] handle Pointer to the LPI2C master driver handle. - * param rxDmaHandle Handle for the eDMA receive channel. Created by the user prior to calling this function. - * param txDmaHandle Handle for the eDMA transmit channel. Created by the user prior to calling this function. - * param callback User provided pointer to the asynchronous callback function. - * param userData User provided pointer to the application callback data. - */ -void LPI2C_MasterCreateEDMAHandle(LPI2C_Type *base, - lpi2c_master_edma_handle_t *handle, - edma_handle_t *rxDmaHandle, - edma_handle_t *txDmaHandle, - lpi2c_master_edma_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - assert(rxDmaHandle != NULL); - assert(txDmaHandle != NULL); - - /* Look up instance number */ - uint32_t instance = LPI2C_GetInstance(base); - - /* Clear out the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Set up the handle. For combined rx/tx DMA requests, the tx channel handle is set to the rx handle */ - /* in order to make the transfer API code simpler. */ - handle->base = base; - handle->completionCallback = callback; - handle->userData = userData; - handle->rx = rxDmaHandle; - handle->tx = (FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base) > 0) ? txDmaHandle : rxDmaHandle; - - if(LP_FLEXCOMM_GetBaseAddress(instance) != 0U) - { - lpi2c_to_lpflexcomm_edma_t handler; - handler.lpi2c_master_handler = LPI2C_MasterTransferEdmaHandleIRQ; - - LP_FLEXCOMM_SetIRQHandler(instance, handler.lpflexcomm_handler, handle, LP_FLEXCOMM_PERIPH_LPI2C); - } - else - { - /* Save the handle in global variables to support the double weak mechanism. */ - s_lpi2cMasterHandle[instance] = handle; - - /* Set LPI2C_MasterTransferEdmaHandleIRQ as LPI2C DMA IRQ handler */ - s_lpi2cMasterIsr = LPI2C_MasterTransferEdmaHandleIRQ; - } - - /* Enable interrupt in NVIC. */ - (void)EnableIRQ(kLpi2cIrqs[instance]); - - /* Set DMA channel completion callbacks. */ - EDMA_SetCallback(handle->rx, LPI2C_MasterEDMACallback, handle); - if (FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base) != 0) - { - EDMA_SetCallback(handle->tx, LPI2C_MasterEDMACallback, handle); - } -} - -static uint32_t LPI2C_GenerateCommands(lpi2c_master_edma_handle_t *handle) -{ - lpi2c_master_transfer_t *xfer = &handle->transfer; - uint16_t *cmd = (uint16_t *)&handle->commandBuffer; - uint32_t cmdCount = 0; - - /* Handle no start option. */ - if ((xfer->flags & (uint32_t)kLPI2C_TransferNoStartFlag) != 0U) - { - if (xfer->direction == kLPI2C_Read) - { - /* Need to issue read command first. */ - cmd[cmdCount++] = (uint16_t)kRxDataCmd | (uint16_t)LPI2C_MTDR_DATA(xfer->dataSize - 1U); - } - } - else - { - /* - * Initial direction depends on whether a subaddress was provided, and of course the actual - * data transfer direction. - */ - lpi2c_direction_t direction = (xfer->subaddressSize != 0U) ? kLPI2C_Write : xfer->direction; - - /* Start command. */ - cmd[cmdCount++] = - (uint16_t)kStartCmd | (uint16_t)((uint16_t)((uint16_t)xfer->slaveAddress << 1U) | (uint16_t)direction); - - /* Subaddress, MSB first. */ - if (xfer->subaddressSize != 0U) - { - uint32_t subaddressRemaining = xfer->subaddressSize; - while (0U != subaddressRemaining--) - { - uint8_t subaddressByte = (uint8_t)(xfer->subaddress >> (8U * subaddressRemaining)) & 0xffU; - cmd[cmdCount++] = subaddressByte; - } - } - - /* Reads need special handling because we have to issue a read command and maybe a repeated start. */ - if ((xfer->dataSize != 0U) && (xfer->direction == kLPI2C_Read)) - { - /* Need to send repeated start if switching directions to read. */ - if (direction == kLPI2C_Write) - { - cmd[cmdCount++] = (uint16_t)kStartCmd | - (uint16_t)((uint16_t)((uint16_t)xfer->slaveAddress << 1U) | (uint16_t)kLPI2C_Read); - } - - /* Read command. A single write to MTDR can issue read operation of 0xFFU + 1 byte of data at most, so when - the dataSize is larger than 0x100U, push multiple read commands to MTDR until dataSize is reached. */ - size_t tmpRxSize = xfer->dataSize; - while (tmpRxSize != 0U) - { - if (tmpRxSize > 256U) - { - cmd[cmdCount++] = (uint16_t)kRxDataCmd | (uint16_t)LPI2C_MTDR_DATA(0xFFU); - tmpRxSize -= 256U; - } - else - { - cmd[cmdCount++] = (uint16_t)kRxDataCmd | (uint16_t)LPI2C_MTDR_DATA(tmpRxSize - 1U); - tmpRxSize = 0U; - } - } - } - } - - return cmdCount; -} - -/*! - * brief Performs a non-blocking DMA-based transaction on the I2C bus. - * - * The callback specified when the a handle was created is invoked when the transaction has - * completed. - * - * param base The LPI2C peripheral base address. - * param handle Pointer to the LPI2C master driver handle. - * param transfer The pointer to the transfer descriptor. - * retval #kStatus_Success The transaction was started successfully. - * retval #kStatus_LPI2C_Busy Either another master is currently utilizing the bus, or another DMA - * transaction is already in progress. - */ -status_t LPI2C_MasterTransferEDMA(LPI2C_Type *base, - lpi2c_master_edma_handle_t *handle, - lpi2c_master_transfer_t *transfer) -{ - status_t result; - - assert(handle != NULL); - assert(transfer != NULL); - assert(transfer->subaddressSize <= sizeof(transfer->subaddress)); - - /* Check transfer data size in read operation. */ - /* A single write to MTDR can issue read operation of 0xFFU + 1 byte of data at most, so when the dataSize is larger - than 0x100U, push multiple read commands to MTDR until dataSize is reached. LPI2C edma transfer uses linked - descriptor to transfer command and data, the command buffer is stored in handle. Allocate 4 command words to - carry read command which can cover nearly all use cases. */ - if ((transfer->direction == kLPI2C_Read) && (transfer->dataSize > (256U * 4U))) - { - return kStatus_InvalidArgument; - } - - /* Return busy if another transaction is in progress. */ - if (handle->isBusy) - { - return kStatus_LPI2C_Busy; - } - - /* Return an error if the bus is already in use not by us. */ - result = LPI2C_CheckForBusyBus(base); - if (result != kStatus_Success) - { - return result; - } - - /* We're now busy. */ - handle->isBusy = true; - - /* Disable LPI2C IRQ and DMA sources while we configure stuff. */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - LPI2C_MasterEnableDMA(base, false, false); - - /* Clear all flags. */ - LPI2C_MasterClearStatusFlags(base, (uint32_t)kLPI2C_MasterClearFlags); - - /* Save transfer into handle. */ - handle->transfer = *transfer; - - /* Generate commands to send. */ - uint32_t commandCount = LPI2C_GenerateCommands(handle); - - /* If the user is transmitting no data with no start or stop, then just go ahead and invoke the callback. */ - if ((0U == commandCount) && (transfer->dataSize == 0U)) - { - if (handle->completionCallback != NULL) - { - handle->completionCallback(base, handle, kStatus_Success, handle->userData); - } - return kStatus_Success; - } - - /* Reset DMA channels. */ - EDMA_ResetChannel(handle->rx->base, handle->rx->channel); - if (FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base) != 0) - { - EDMA_ResetChannel(handle->tx->base, handle->tx->channel); - } - - /* Get a 32-byte aligned TCD pointer. */ - edma_tcd_t *tcd = (edma_tcd_t *)((uint32_t)(&handle->tcds[1]) & (~ALIGN_32_MASK)); - - bool hasSendData = (transfer->direction == kLPI2C_Write) && (transfer->dataSize != 0U); - bool hasReceiveData = (transfer->direction == kLPI2C_Read) && (transfer->dataSize != 0U); - - edma_transfer_config_t transferConfig = {0}; - edma_tcd_t *linkTcd = NULL; - - /* Set up data transmit. */ - if (hasSendData) - { - uint32_t *srcAddr = (uint32_t *)transfer->data; - transferConfig.srcAddr = (uint32_t)srcAddr; - transferConfig.destAddr = (uint32_t)LPI2C_MasterGetTxFifoAddress(base); - transferConfig.srcTransferSize = kEDMA_TransferSize1Bytes; - transferConfig.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfig.srcOffset = (int16_t)sizeof(uint8_t); - transferConfig.destOffset = 0; - transferConfig.minorLoopBytes = sizeof(uint8_t); /* TODO optimize to fill fifo */ - transferConfig.majorLoopCounts = transfer->dataSize; - - /* Store the initially configured eDMA minor byte transfer count into the LPI2C handle */ - handle->nbytes = (uint8_t)transferConfig.minorLoopBytes; - - if (commandCount != 0U) - { - /* Create a software TCD, which will be chained after the commands. */ - EDMA_TcdReset(tcd); - EDMA_TcdSetTransferConfig(tcd, &transferConfig, NULL); - EDMA_TcdEnableInterrupts(tcd, (uint32_t)kEDMA_MajorInterruptEnable); - linkTcd = tcd; - } - else - { - /* User is only transmitting data with no required commands, so this transfer can stand alone. */ - EDMA_SetTransferConfig(handle->tx->base, handle->tx->channel, &transferConfig, NULL); - EDMA_EnableChannelInterrupts(handle->tx->base, handle->tx->channel, (uint32_t)kEDMA_MajorInterruptEnable); - } - } - else if (hasReceiveData) - { - uint32_t *srcAddr = (uint32_t *)transfer->data; - /* Set up data receive. */ - transferConfig.srcAddr = (uint32_t)LPI2C_MasterGetRxFifoAddress(base); - transferConfig.destAddr = (uint32_t)srcAddr; - transferConfig.srcTransferSize = kEDMA_TransferSize1Bytes; - transferConfig.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfig.srcOffset = 0; - transferConfig.destOffset = (int16_t)sizeof(uint8_t); - transferConfig.minorLoopBytes = sizeof(uint8_t); /* TODO optimize to empty fifo */ - transferConfig.majorLoopCounts = transfer->dataSize; - - /* Store the initially configured eDMA minor byte transfer count into the LPI2C handle */ - handle->nbytes = (uint8_t)transferConfig.minorLoopBytes; - - if ((FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base) != 0) || (0U == commandCount)) - { - /* We can put this receive transfer on its own DMA channel. */ - EDMA_SetTransferConfig(handle->rx->base, handle->rx->channel, &transferConfig, NULL); - EDMA_EnableChannelInterrupts(handle->rx->base, handle->rx->channel, (uint32_t)kEDMA_MajorInterruptEnable); - } - else - { - /* For shared rx/tx DMA requests, when there are commands, create a software TCD of - enabling rx dma and disabling tx dma, which will be chained onto the commands transfer, - and create another software TCD of transfering data and chain it onto the last TCD. - Notice that in this situation assume tx/rx uses same channel */ - EDMA_TcdReset(tcd); - EDMA_TcdSetTransferConfig(tcd, &transferConfig, NULL); - EDMA_TcdEnableInterrupts(tcd, (uint32_t)kEDMA_MajorInterruptEnable); - - transferConfig.srcAddr = (uint32_t)&lpi2c_edma_RecSetting; - transferConfig.destAddr = (uint32_t) & (base->MDER); - transferConfig.srcTransferSize = kEDMA_TransferSize1Bytes; - transferConfig.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfig.srcOffset = 0; - transferConfig.destOffset = (int16_t)sizeof(uint8_t); - transferConfig.minorLoopBytes = sizeof(uint8_t); - transferConfig.majorLoopCounts = 1; - - edma_tcd_t *tcdSetRxClearTxDMA = (edma_tcd_t *)((uint32_t)(&handle->tcds[2]) & (~ALIGN_32_MASK)); - - EDMA_TcdReset(tcdSetRxClearTxDMA); - EDMA_TcdSetTransferConfig(tcdSetRxClearTxDMA, &transferConfig, tcd); - linkTcd = tcdSetRxClearTxDMA; - } - } - else - { - /* No data to send */ - } - - if (hasSendData) - { - } - - /* Set up commands transfer. */ - if (commandCount != 0U) - { - transferConfig.srcAddr = (uint32_t)handle->commandBuffer; - transferConfig.destAddr = (uint32_t)LPI2C_MasterGetTxFifoAddress(base); - transferConfig.srcTransferSize = kEDMA_TransferSize2Bytes; - transferConfig.destTransferSize = kEDMA_TransferSize2Bytes; - transferConfig.srcOffset = (int16_t)sizeof(uint16_t); - transferConfig.destOffset = 0; - transferConfig.minorLoopBytes = sizeof(uint16_t); /* TODO optimize to fill fifo */ - transferConfig.majorLoopCounts = commandCount; - - EDMA_SetTransferConfig(handle->tx->base, handle->tx->channel, &transferConfig, linkTcd); - } - - /* Start DMA transfer. */ - if (hasReceiveData || (0 == FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base))) - { - EDMA_StartTransfer(handle->rx); - } - - if ((hasSendData || (commandCount != 0U)) && (FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base) != 0)) - { - EDMA_StartTransfer(handle->tx); - } - - /* Enable DMA in both directions. This actually kicks of the transfer. */ - LPI2C_MasterEnableDMA(base, true, true); - - /* Enable all LPI2C master interrupts */ - LPI2C_MasterEnableInterrupts(base, - (uint32_t)kLPI2C_MasterArbitrationLostFlag | (uint32_t)kLPI2C_MasterNackDetectFlag | - (uint32_t)kLPI2C_MasterPinLowTimeoutFlag | (uint32_t)kLPI2C_MasterFifoErrFlag); - - return result; -} - -/*! - * brief Returns number of bytes transferred so far. - * - * param base The LPI2C peripheral base address. - * param handle Pointer to the LPI2C master driver handle. - * param[out] count Number of bytes transferred so far by the non-blocking transaction. - * retval #kStatus_Success - * retval #kStatus_NoTransferInProgress There is not a DMA transaction currently in progress. - */ -status_t LPI2C_MasterTransferGetCountEDMA(LPI2C_Type *base, lpi2c_master_edma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (!handle->isBusy) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - uint32_t remaining = handle->transfer.dataSize; - - /* If the DMA is still on a commands transfer that chains to the actual data transfer, */ - /* we do nothing and return the number of transferred bytes as zero. */ - if (EDMA_GetNextTCDAddress(handle->tx) == 0U) - { - if (handle->transfer.direction == kLPI2C_Write) - { - remaining = - (uint32_t)handle->nbytes * EDMA_GetRemainingMajorLoopCount(handle->tx->base, handle->tx->channel); - } - else - { - remaining = - (uint32_t)handle->nbytes * EDMA_GetRemainingMajorLoopCount(handle->rx->base, handle->rx->channel); - } - } - - *count = handle->transfer.dataSize - remaining; - - return kStatus_Success; -} - -/*! - * brief Terminates a non-blocking LPI2C master transmission early. - * - * note It is not safe to call this function from an IRQ handler that has a higher priority than the - * eDMA peripheral's IRQ priority. - * - * param base The LPI2C peripheral base address. - * param handle Pointer to the LPI2C master driver handle. - * retval #kStatus_Success A transaction was successfully aborted. - * retval #kStatus_LPI2C_Idle There is not a DMA transaction currently in progress. - */ -status_t LPI2C_MasterTransferAbortEDMA(LPI2C_Type *base, lpi2c_master_edma_handle_t *handle) -{ - /* Catch when there is not an active transfer. */ - if (!handle->isBusy) - { - return kStatus_LPI2C_Idle; - } - - /* Terminate DMA transfers. */ - EDMA_AbortTransfer(handle->rx); - if (FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base) != 0) - { - EDMA_AbortTransfer(handle->tx); - } - - /* Reset fifos. */ - base->MCR |= LPI2C_MCR_RRF_MASK | LPI2C_MCR_RTF_MASK; - - /* Disable LPI2C interrupts. */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - - /* If master is still busy and has not send out stop signal yet. */ - if ((LPI2C_MasterGetStatusFlags(base) & - ((uint32_t)kLPI2C_MasterStopDetectFlag | (uint32_t)kLPI2C_MasterBusyFlag)) == (uint32_t)kLPI2C_MasterBusyFlag) - { - /* Send a stop command to finalize the transfer. */ - base->MTDR = (uint32_t)kStopCmd; - } - - /* Reset handle. */ - handle->isBusy = false; - - return kStatus_Success; -} - -static void LPI2C_MasterEDMACallback(edma_handle_t *dmaHandle, void *userData, bool isTransferDone, uint32_t tcds) -{ - lpi2c_master_edma_handle_t *handle = (lpi2c_master_edma_handle_t *)userData; - - if (NULL == handle) - { - return; - } - - /* Check for errors. */ - status_t result = LPI2C_MasterCheckAndClearError(handle->base, LPI2C_MasterGetStatusFlags(handle->base)); - - /* Done with this transaction. */ - handle->isBusy = false; - - if (0U == (handle->transfer.flags & (uint32_t)kLPI2C_TransferNoStopFlag)) - { - /* Send a stop command to finalize the transfer. */ - handle->base->MTDR = (uint32_t)kStopCmd; - } - - /* Invoke callback. */ - if (handle->completionCallback != NULL) - { - handle->completionCallback(handle->base, handle, result, handle->userData); - } -} - -static void LPI2C_MasterTransferEdmaHandleIRQ(uint32_t instance, void *lpi2cMasterEdmaHandle) -{ - assert(lpi2cMasterEdmaHandle != NULL); - assert(instance < ARRAY_SIZE(kLpi2cBases)); - LPI2C_Type *base = kLpi2cBases[instance]; - - lpi2c_master_edma_handle_t *handle = (lpi2c_master_edma_handle_t *)lpi2cMasterEdmaHandle; - uint32_t status = LPI2C_MasterGetStatusFlags(base); - status_t result = kStatus_Success; - - /* Terminate DMA transfers. */ - EDMA_AbortTransfer(handle->rx); - if (FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base) != 0) - { - EDMA_AbortTransfer(handle->tx); - } - - /* Done with this transaction. */ - handle->isBusy = false; - - /* Disable LPI2C interrupts. */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - - /* Check error status */ - if (0U != (status & (uint32_t)kLPI2C_MasterPinLowTimeoutFlag)) - { - result = kStatus_LPI2C_PinLowTimeout; - } - else if (0U != (status & (uint32_t)kLPI2C_MasterArbitrationLostFlag)) - { - result = kStatus_LPI2C_ArbitrationLost; - } - else if (0U != (status & (uint32_t)kLPI2C_MasterNackDetectFlag)) - { - result = kStatus_LPI2C_Nak; - } - else if (0U != (status & (uint32_t)kLPI2C_MasterFifoErrFlag)) - { - result = kStatus_LPI2C_FifoError; - } - else - { - ; /* Intentional empty */ - } - - /* Clear error status. */ - (void)LPI2C_MasterCheckAndClearError(base, status); - - /* Send stop flag if needed */ - if (0U == (handle->transfer.flags & (uint32_t)kLPI2C_TransferNoStopFlag)) - { - status = LPI2C_MasterGetStatusFlags(base); - /* If bus is still busy and the master has not generate stop flag */ - if ((status & ((uint32_t)kLPI2C_MasterBusBusyFlag | (uint32_t)kLPI2C_MasterStopDetectFlag)) == - (uint32_t)kLPI2C_MasterBusBusyFlag) - { - /* Send a stop command to finalize the transfer. */ - handle->base->MTDR = (uint32_t)kStopCmd; - } - } - - /* Invoke callback. */ - if (handle->completionCallback != NULL) - { - handle->completionCallback(base, handle, result, handle->userData); - } -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpi2c_edma.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpi2c_edma.h deleted file mode 100644 index e17be779973..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpi2c_edma.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_LPI2C_EDMA_H_ -#define FSL_LPI2C_EDMA_H_ - -#include "fsl_lpi2c.h" -#include "fsl_edma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief LPI2C EDMA driver version. */ -#define FSL_LPI2C_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) -/*@}*/ - -/*! - * @addtogroup lpi2c_master_edma_driver - * @{ - */ - -/* Forward declaration of the transfer descriptor and handle typedefs. */ -typedef struct _lpi2c_master_edma_handle lpi2c_master_edma_handle_t; - -/*! - * @brief Master DMA completion callback function pointer type. - * - * This callback is used only for the non-blocking master transfer API. Specify the callback you wish to use - * in the call to LPI2C_MasterCreateEDMAHandle(). - * - * @param base The LPI2C peripheral base address. - * @param handle Handle associated with the completed transfer. - * @param completionStatus Either kStatus_Success or an error code describing how the transfer completed. - * @param userData Arbitrary pointer-sized value passed from the application. - */ -typedef void (*lpi2c_master_edma_transfer_callback_t)(LPI2C_Type *base, - lpi2c_master_edma_handle_t *handle, - status_t completionStatus, - void *userData); - -/*! - * @brief Driver handle for master DMA APIs. - * @note The contents of this structure are private and subject to change. - */ -struct _lpi2c_master_edma_handle -{ - LPI2C_Type *base; /*!< LPI2C base pointer. */ - bool isBusy; /*!< Transfer state machine current state. */ - uint8_t nbytes; /*!< eDMA minor byte transfer count initially configured. */ - uint16_t commandBuffer[10]; /*!< LPI2C command sequence. When all 10 command words are used: - Start&addr&write[1 word] + subaddr[4 words] + restart&addr&read[1 word] + receive&Size[4 words] */ - lpi2c_master_transfer_t transfer; /*!< Copy of the current transfer info. */ - lpi2c_master_edma_transfer_callback_t completionCallback; /*!< Callback function pointer. */ - void *userData; /*!< Application data passed to callback. */ - edma_handle_t *rx; /*!< Handle for receive DMA channel. */ - edma_handle_t *tx; /*!< Handle for transmit DMA channel. */ - edma_tcd_t tcds[3]; /*!< Software TCD. Three are allocated to provide enough room to align to 32-bytes. */ -}; - -/*! @} */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @addtogroup lpi2c_master_edma_driver - * @{ - */ - -/*! @name Master DMA */ -/*@{*/ - -/*! - * @brief Create a new handle for the LPI2C master DMA APIs. - * - * The creation of a handle is for use with the DMA APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the LPI2C_MasterTransferAbortEDMA() API shall be called. - * - * For devices where the LPI2C send and receive DMA requests are OR'd together, the @a txDmaHandle - * parameter is ignored and may be set to NULL. - * - * @param base The LPI2C peripheral base address. - * @param[out] handle Pointer to the LPI2C master driver handle. - * @param rxDmaHandle Handle for the eDMA receive channel. Created by the user prior to calling this function. - * @param txDmaHandle Handle for the eDMA transmit channel. Created by the user prior to calling this function. - * @param callback User provided pointer to the asynchronous callback function. - * @param userData User provided pointer to the application callback data. - */ -void LPI2C_MasterCreateEDMAHandle(LPI2C_Type *base, - lpi2c_master_edma_handle_t *handle, - edma_handle_t *rxDmaHandle, - edma_handle_t *txDmaHandle, - lpi2c_master_edma_transfer_callback_t callback, - void *userData); - -/*! - * @brief Performs a non-blocking DMA-based transaction on the I2C bus. - * - * The callback specified when the @a handle was created is invoked when the transaction has - * completed. - * - * @param base The LPI2C peripheral base address. - * @param handle Pointer to the LPI2C master driver handle. - * @param transfer The pointer to the transfer descriptor. - * @retval kStatus_Success The transaction was started successfully. - * @retval #kStatus_LPI2C_Busy Either another master is currently utilizing the bus, or another DMA - * transaction is already in progress. - */ -status_t LPI2C_MasterTransferEDMA(LPI2C_Type *base, - lpi2c_master_edma_handle_t *handle, - lpi2c_master_transfer_t *transfer); - -/*! - * @brief Returns number of bytes transferred so far. - * - * @param base The LPI2C peripheral base address. - * @param handle Pointer to the LPI2C master driver handle. - * @param[out] count Number of bytes transferred so far by the non-blocking transaction. - * @retval kStatus_Success - * @retval kStatus_NoTransferInProgress There is not a DMA transaction currently in progress. - */ -status_t LPI2C_MasterTransferGetCountEDMA(LPI2C_Type *base, lpi2c_master_edma_handle_t *handle, size_t *count); - -/*! - * @brief Terminates a non-blocking LPI2C master transmission early. - * - * @note It is not safe to call this function from an IRQ handler that has a higher priority than the - * eDMA peripheral's IRQ priority. - * - * @param base The LPI2C peripheral base address. - * @param handle Pointer to the LPI2C master driver handle. - * @retval kStatus_Success A transaction was successfully aborted. - * @retval #kStatus_LPI2C_Idle There is not a DMA transaction currently in progress. - */ -status_t LPI2C_MasterTransferAbortEDMA(LPI2C_Type *base, lpi2c_master_edma_handle_t *handle); - -/*@}*/ - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -#endif /* FSL_LPI2C_EDMA_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpi2c_freertos.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpi2c_freertos.c deleted file mode 100644 index 818c23801b5..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpi2c_freertos.c +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpi2c_freertos.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpflexcomm_lpi2c_freertos" -#endif - -static void LPI2C_RTOS_Callback(LPI2C_Type *base, lpi2c_master_handle_t *drv_handle, status_t status, void *userData) -{ - lpi2c_rtos_handle_t *handle = (lpi2c_rtos_handle_t *)userData; - BaseType_t reschedule = pdFALSE; - handle->async_status = status; - (void)xSemaphoreGiveFromISR(handle->semaphore, &reschedule); - portYIELD_FROM_ISR(reschedule); -} - -/*! - * brief Initializes LPI2C. - * - * This function initializes the LPI2C module and the related RTOS context. - * - * param handle The RTOS LPI2C handle, the pointer to an allocated space for RTOS context. - * param base The pointer base address of the LPI2C instance to initialize. - * param masterConfig Configuration structure to set-up LPI2C in master mode. - * param srcClock_Hz Frequency of input clock of the LPI2C module. - * return status of the operation. - */ -status_t LPI2C_RTOS_Init(lpi2c_rtos_handle_t *handle, - LPI2C_Type *base, - const lpi2c_master_config_t *masterConfig, - uint32_t srcClock_Hz) -{ - if (handle == NULL) - { - return kStatus_InvalidArgument; - } - - if (base == NULL) - { - return kStatus_InvalidArgument; - } - - (void)memset(handle, 0, sizeof(lpi2c_rtos_handle_t)); - - handle->mutex = xSemaphoreCreateMutex(); - if (handle->mutex == NULL) - { - return kStatus_Fail; - } - - handle->semaphore = xSemaphoreCreateBinary(); - if (handle->semaphore == NULL) - { - vSemaphoreDelete(handle->mutex); - return kStatus_Fail; - } - - handle->base = base; - - LPI2C_MasterInit(handle->base, masterConfig, srcClock_Hz); - LPI2C_MasterTransferCreateHandle(base, &handle->drv_handle, LPI2C_RTOS_Callback, (void *)handle); - - return kStatus_Success; -} - -/*! - * brief Deinitializes the LPI2C. - * - * This function deinitializes the LPI2C module and the related RTOS context. - * - * param handle The RTOS LPI2C handle. - */ -status_t LPI2C_RTOS_Deinit(lpi2c_rtos_handle_t *handle) -{ - LPI2C_MasterDeinit(handle->base); - vSemaphoreDelete(handle->semaphore); - vSemaphoreDelete(handle->mutex); - return kStatus_Success; -} - -/*! - * brief Performs LPI2C transfer. - * - * This function performs an LPI2C transfer according to data given in the transfer structure. - * - * param handle The RTOS LPI2C handle. - * param transfer Structure specifying the transfer parameters. - * return status of the operation. - */ -status_t LPI2C_RTOS_Transfer(lpi2c_rtos_handle_t *handle, lpi2c_master_transfer_t *transfer) -{ - status_t status; - - /* Lock resource mutex */ - if (xSemaphoreTake(handle->mutex, portMAX_DELAY) != pdTRUE) - { - return kStatus_LPI2C_Busy; - } - - status = LPI2C_MasterTransferNonBlocking(handle->base, &handle->drv_handle, transfer); - if (status != kStatus_Success) - { - (void)xSemaphoreGive(handle->mutex); - return status; - } - - /* Wait for transfer to finish */ - (void)xSemaphoreTake(handle->semaphore, portMAX_DELAY); - - /* Unlock resource mutex */ - (void)xSemaphoreGive(handle->mutex); - - /* Return status captured by callback function */ - return handle->async_status; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpi2c_freertos.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpi2c_freertos.h deleted file mode 100644 index ea4e77d3c87..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpi2c_freertos.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_LPI2C_FREERTOS_H__ -#define FSL_LPI2C_FREERTOS_H__ - -#include "FreeRTOS.h" -#include "portable.h" -#include "semphr.h" - -#include "fsl_lpi2c.h" - -/*! - * @addtogroup lpi2c_freertos_driver LPI2C FreeRTOS Driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief LPI2C FreeRTOS driver version 2.0.0. */ -#define FSL_LPI2C_FREERTOS_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) -/*@}*/ - -/*! @brief LPI2C FreeRTOS handle */ -typedef struct _lpi2c_rtos_handle -{ - LPI2C_Type *base; /*!< LPI2C base address */ - lpi2c_master_handle_t drv_handle; /*!< A handle of the underlying driver, treated as opaque by the RTOS layer */ - status_t async_status; /*!< Transactional state of the underlying driver */ - SemaphoreHandle_t mutex; /*!< A mutex to lock the handle during a transfer */ - SemaphoreHandle_t semaphore; /*!< A semaphore to notify and unblock task when the transfer ends */ -#if (configSUPPORT_STATIC_ALLOCATION == 1) - StaticSemaphore_t mutexBuffer; /*!< Statically allocated memory for mutex */ - StaticSemaphore_t semaphoreBuffer; /*!< Statically allocated memory for semaphore */ -#endif -} lpi2c_rtos_handle_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name LPI2C RTOS Operation - * @{ - */ - -/*! - * @brief Initializes LPI2C. - * - * This function initializes the LPI2C module and the related RTOS context. - * - * @param handle The RTOS LPI2C handle, the pointer to an allocated space for RTOS context. - * @param base The pointer base address of the LPI2C instance to initialize. - * @param masterConfig Configuration structure to set-up LPI2C in master mode. - * @param srcClock_Hz Frequency of input clock of the LPI2C module. - * @return status of the operation. - */ -status_t LPI2C_RTOS_Init(lpi2c_rtos_handle_t *handle, - LPI2C_Type *base, - const lpi2c_master_config_t *masterConfig, - uint32_t srcClock_Hz); - -/*! - * @brief Deinitializes the LPI2C. - * - * This function deinitializes the LPI2C module and the related RTOS context. - * - * @param handle The RTOS LPI2C handle. - */ -status_t LPI2C_RTOS_Deinit(lpi2c_rtos_handle_t *handle); - -/*! - * @brief Performs LPI2C transfer. - * - * This function performs an LPI2C transfer according to data given in the transfer structure. - * - * @param handle The RTOS LPI2C handle. - * @param transfer Structure specifying the transfer parameters. - * @return status of the operation. - */ -status_t LPI2C_RTOS_Transfer(lpi2c_rtos_handle_t *handle, lpi2c_master_transfer_t *transfer); - -/*! - * @} - */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ - -#endif /* FSL_LPI2C_FREERTOS_H__ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpspi.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpspi.c deleted file mode 100644 index 6af1d30958f..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpspi.c +++ /dev/null @@ -1,2297 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpspi.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpflexcomm_lpspi" -#endif - -/*! - * @brief Default watermark values. - * - * The default watermarks are set to zero. - */ -enum _lpspi_default_watermarks -{ - kLpspiDefaultTxWatermark = 0, - kLpspiDefaultRxWatermark = 0, -}; - -/*! @brief Typedef for master interrupt handler. */ -typedef void (*lpspi_master_isr_t)(uint32_t instance, lpspi_master_handle_t *handle); - -/*! @brief Typedef for slave interrupt handler. */ -typedef void (*lpspi_slave_isr_t)(uint32_t instance, lpspi_slave_handle_t *handle); - -/*! - * @brief Used for conversion from `lpflexcomm_irq_handler_t` to `lpuart_irq_handler_t` - */ -typedef union lpspi_to_lpflexcomm -{ - lpspi_master_isr_t lpspi_master_handler; - lpspi_slave_isr_t lpspi_slave_handler; - lpflexcomm_irq_handler_t lpflexcomm_handler; -} lpspi_to_lpflexcomm_t; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Configures the LPSPI peripheral chip select polarity. - * - * This function takes in the desired peripheral chip select (Pcs) and it's corresponding desired polarity and - * configures the Pcs signal to operate with the desired characteristic. - * - * @param base LPSPI peripheral address. - * @param pcs The particular peripheral chip select (parameter value is of type lpspi_which_pcs_t) for which we wish to - * apply the active high or active low characteristic. - * @param activeLowOrHigh The setting for either "active high, inactive low (0)" or "active low, inactive high(1)" of - * type lpspi_pcs_polarity_config_t. - */ -static void LPSPI_SetOnePcsPolarity(LPSPI_Type *base, - lpspi_which_pcs_t pcs, - lpspi_pcs_polarity_config_t activeLowOrHigh); - -/*! - * @brief Combine the write data for 1 byte to 4 bytes. - * This is not a public API. - */ -static uint32_t LPSPI_CombineWriteData(uint8_t *txData, uint8_t bytesEachWrite, bool isByteSwap); - -/*! - * @brief Separate the read data for 1 byte to 4 bytes. - * This is not a public API. - */ -static void LPSPI_SeparateReadData(uint8_t *rxData, uint32_t readData, uint8_t bytesEachRead, bool isByteSwap); - -/*! - * @brief Wait for tx FIFO to be empty. - * This is not a public API. - * @param base LPSPI peripheral address. - * @return true for the tx FIFO is ready, false is not. - */ -static bool LPSPI_TxFifoReady(LPSPI_Type *base); - -/*! - * @brief Master fill up the TX FIFO with data. - * This is not a public API. - */ -static void LPSPI_MasterTransferFillUpTxFifo(LPSPI_Type *base, lpspi_master_handle_t *handle); - -/*! - * @brief Master finish up a transfer. - * It would call back if there is callback function and set the state to idle. - * This is not a public API. - */ -static void LPSPI_MasterTransferComplete(LPSPI_Type *base, lpspi_master_handle_t *handle); - -/*! - * @brief Slave fill up the TX FIFO with data. - * This is not a public API. - */ -static void LPSPI_SlaveTransferFillUpTxFifo(LPSPI_Type *base, lpspi_slave_handle_t *handle); - -/*! - * @brief Slave finish up a transfer. - * It would call back if there is callback function and set the state to idle. - * This is not a public API. - */ -static void LPSPI_SlaveTransferComplete(LPSPI_Type *base, lpspi_slave_handle_t *handle); - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/* Defines constant value arrays for the baud rate pre-scalar and scalar divider values.*/ -static const uint8_t s_baudratePrescaler[] = {1, 2, 4, 8, 16, 32, 64, 128}; - -/*! @brief Pointers to lpspi bases for each instance. */ -static LPSPI_Type *const s_lpspiBases[] = LPSPI_BASE_PTRS; - -/*! @brief Pointers to lpspi IRQ number for each instance. */ -static const IRQn_Type s_lpspiIRQ[] = LPSPI_IRQS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to lpspi clocks for each instance. */ -static const clock_ip_name_t s_lpspiClocks[] = LPSPI_CLOCKS; - -#if defined(LPSPI_PERIPH_CLOCKS) -static const clock_ip_name_t s_LpspiPeriphClocks[] = LPSPI_PERIPH_CLOCKS; -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/*! @brief Pointers to lpspi handles for each instance. */ -static void *s_lpspiHandle[ARRAY_SIZE(s_lpspiBases)]; - -/* @brief Dummy data for each instance. This data is used when user's tx buffer is NULL*/ -volatile uint8_t g_lpspiDummyData[ARRAY_SIZE(s_lpspiBases)] = {0}; - -/*! @brief Pointer to master IRQ handler for each instance. */ -static lpspi_master_isr_t s_lpspiMasterIsr; -/*! @brief Pointer to slave IRQ handler for each instance. */ -static lpspi_slave_isr_t s_lpspiSlaveIsr; - -/********************************************************************************************************************** - * Code - *********************************************************************************************************************/ - -/*! - * brief Get the LPSPI instance from peripheral base address. - * - * param base LPSPI peripheral base address. - * return LPSPI instance. - */ -uint32_t LPSPI_GetInstance(LPSPI_Type *base) -{ - uint8_t instance = 0; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_lpspiBases); instance++) - { - if (s_lpspiBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_lpspiBases)); - - return instance; -} - -/*! - * brief Set up the dummy data. - * - * param base LPSPI peripheral address. - * param dummyData Data to be transferred when tx buffer is NULL. - * Note: - * This API has no effect when LPSPI in slave interrupt mode, because driver - * will set the TXMSK bit to 1 if txData is NULL, no data is loaded from transmit - * FIFO and output pin is tristated. - */ -void LPSPI_SetDummyData(LPSPI_Type *base, uint8_t dummyData) -{ - uint32_t instance = LPSPI_GetInstance(base); - g_lpspiDummyData[instance] = dummyData; -} - -/*! - * brief Initializes the LPSPI master. - * - * param base LPSPI peripheral address. - * param masterConfig Pointer to structure lpspi_master_config_t. - * param srcClock_Hz Module source input clock in Hertz - */ -void LPSPI_MasterInit(LPSPI_Type *base, const lpspi_master_config_t *masterConfig, uint32_t srcClock_Hz) -{ - assert(masterConfig != NULL); - - uint32_t tcrPrescaleValue = 0; - uint32_t instance = LPSPI_GetInstance(base); - - if(LP_FLEXCOMM_GetBaseAddress(instance) != 0U) - { - -#if !(defined(LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) && LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) - /* initialize flexcomm to LPSPI mode */ - status_t status = LP_FLEXCOMM_Init(LPSPI_GetInstance(base), LP_FLEXCOMM_PERIPH_LPSPI); - if (kStatus_Success != status) - { - assert(false); - } -#endif /* LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER */ - - } - else - { - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - - /* Enable LPSPI clock */ - (void)CLOCK_EnableClock(s_lpspiClocks[instance]); - -#if defined(LPSPI_PERIPH_CLOCKS) - (void)CLOCK_EnableClock(s_LpspiPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - } - - /* Disable LPSPI first */ - LPSPI_Enable(base, false); - - /* Set LPSPI to master */ - LPSPI_SetMasterSlaveMode(base, kLPSPI_Master); - - /* Set specific PCS to active high or low */ - LPSPI_SetOnePcsPolarity(base, masterConfig->whichPcs, masterConfig->pcsActiveHighOrLow); - - /* Set Configuration Register 1 related setting.*/ - base->CFGR1 = (base->CFGR1 & ~(LPSPI_CFGR1_OUTCFG_MASK | LPSPI_CFGR1_PINCFG_MASK | LPSPI_CFGR1_NOSTALL_MASK | - LPSPI_CFGR1_SAMPLE_MASK | LPSPI_CFGR1_PCSCFG_MASK )) | - LPSPI_CFGR1_OUTCFG(masterConfig->dataOutConfig) | LPSPI_CFGR1_PINCFG(masterConfig->pinCfg) | - LPSPI_CFGR1_NOSTALL(0) | LPSPI_CFGR1_SAMPLE((uint32_t)masterConfig->enableInputDelay )| - LPSPI_CFGR1_PCSCFG(masterConfig->pcsFunc); - - /* Set baudrate and delay times*/ - (void)LPSPI_MasterSetBaudRate(base, masterConfig->baudRate, srcClock_Hz, &tcrPrescaleValue); - - /* Set default watermarks */ - LPSPI_SetFifoWatermarks(base, (uint32_t)kLpspiDefaultTxWatermark, (uint32_t)kLpspiDefaultRxWatermark); - - /* Set Transmit Command Register*/ - base->TCR = LPSPI_TCR_CPOL(masterConfig->cpol) | LPSPI_TCR_CPHA(masterConfig->cpha) | - LPSPI_TCR_LSBF(masterConfig->direction) | LPSPI_TCR_FRAMESZ(masterConfig->bitsPerFrame - 1U) | - LPSPI_TCR_PRESCALE(tcrPrescaleValue) | LPSPI_TCR_PCS(masterConfig->whichPcs); - - LPSPI_Enable(base, true); - - (void)LPSPI_MasterSetDelayTimes(base, masterConfig->pcsToSckDelayInNanoSec, kLPSPI_PcsToSck, srcClock_Hz); - (void)LPSPI_MasterSetDelayTimes(base, masterConfig->lastSckToPcsDelayInNanoSec, kLPSPI_LastSckToPcs, srcClock_Hz); - (void)LPSPI_MasterSetDelayTimes(base, masterConfig->betweenTransferDelayInNanoSec, kLPSPI_BetweenTransfer, - srcClock_Hz); - - LPSPI_SetDummyData(base, LPSPI_DUMMY_DATA); -} - -/*! - * brief Sets the lpspi_master_config_t structure to default values. - * - * This API initializes the configuration structure for LPSPI_MasterInit(). - * The initialized structure can remain unchanged in LPSPI_MasterInit(), or can be modified - * before calling the LPSPI_MasterInit(). - * Example: - * code - * lpspi_master_config_t masterConfig; - * LPSPI_MasterGetDefaultConfig(&masterConfig); - * endcode - * param masterConfig pointer to lpspi_master_config_t structure - */ -void LPSPI_MasterGetDefaultConfig(lpspi_master_config_t *masterConfig) -{ - assert(masterConfig != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(masterConfig, 0, sizeof(*masterConfig)); - - masterConfig->baudRate = 500000; - masterConfig->bitsPerFrame = 8; - masterConfig->cpol = kLPSPI_ClockPolarityActiveHigh; - masterConfig->cpha = kLPSPI_ClockPhaseFirstEdge; - masterConfig->direction = kLPSPI_MsbFirst; - - masterConfig->pcsToSckDelayInNanoSec = (1000000000U / masterConfig->baudRate) / 2U; - masterConfig->lastSckToPcsDelayInNanoSec = (1000000000U / masterConfig->baudRate) / 2U; - masterConfig->betweenTransferDelayInNanoSec = (1000000000U / masterConfig->baudRate) / 2U; - - masterConfig->whichPcs = kLPSPI_Pcs0; - masterConfig->pcsActiveHighOrLow = kLPSPI_PcsActiveLow; - masterConfig->pcsFunc = kLPSPI_PcsAsCs; - - masterConfig->pinCfg = kLPSPI_SdiInSdoOut; - masterConfig->dataOutConfig = kLpspiDataOutRetained; - - masterConfig->enableInputDelay = false; -} - -/*! - * brief LPSPI slave configuration. - * - * param base LPSPI peripheral address. - * param slaveConfig Pointer to a structure lpspi_slave_config_t. - */ -void LPSPI_SlaveInit(LPSPI_Type *base, const lpspi_slave_config_t *slaveConfig) -{ - assert(slaveConfig != NULL); - - uint32_t instance = LPSPI_GetInstance(base); - - if(LP_FLEXCOMM_GetBaseAddress(instance) != 0U) - { - -#if !(defined(LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) && LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) - /* initialize flexcomm to LPSPI mode */ - status_t status = LP_FLEXCOMM_Init(LPSPI_GetInstance(base), LP_FLEXCOMM_PERIPH_LPSPI); - if (kStatus_Success != status) - { - assert(false); - } -#endif /* LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER */ - - } - else - { - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - - /* Enable LPSPI clock */ - (void)CLOCK_EnableClock(s_lpspiClocks[instance]); - -#if defined(LPSPI_PERIPH_CLOCKS) - (void)CLOCK_EnableClock(s_LpspiPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - } - - LPSPI_SetMasterSlaveMode(base, kLPSPI_Slave); - - LPSPI_SetOnePcsPolarity(base, slaveConfig->whichPcs, slaveConfig->pcsActiveHighOrLow); - - base->CFGR1 = (base->CFGR1 & ~(LPSPI_CFGR1_OUTCFG_MASK | LPSPI_CFGR1_PINCFG_MASK)) | - LPSPI_CFGR1_OUTCFG(slaveConfig->dataOutConfig) | LPSPI_CFGR1_PINCFG(slaveConfig->pinCfg); - - LPSPI_SetFifoWatermarks(base, (uint32_t)kLpspiDefaultTxWatermark, (uint32_t)kLpspiDefaultRxWatermark); - - base->TCR = LPSPI_TCR_CPOL(slaveConfig->cpol) | LPSPI_TCR_CPHA(slaveConfig->cpha) | - LPSPI_TCR_LSBF(slaveConfig->direction) | LPSPI_TCR_FRAMESZ(slaveConfig->bitsPerFrame - 1U); - - /* This operation will set the dummy data for edma transfer, no effect in interrupt way. */ - LPSPI_SetDummyData(base, LPSPI_DUMMY_DATA); - - LPSPI_Enable(base, true); -} - -/*! - * brief Sets the lpspi_slave_config_t structure to default values. - * - * This API initializes the configuration structure for LPSPI_SlaveInit(). - * The initialized structure can remain unchanged in LPSPI_SlaveInit() or can be modified - * before calling the LPSPI_SlaveInit(). - * Example: - * code - * lpspi_slave_config_t slaveConfig; - * LPSPI_SlaveGetDefaultConfig(&slaveConfig); - * endcode - * param slaveConfig pointer to lpspi_slave_config_t structure. - */ -void LPSPI_SlaveGetDefaultConfig(lpspi_slave_config_t *slaveConfig) -{ - assert(slaveConfig != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(slaveConfig, 0, sizeof(*slaveConfig)); - - slaveConfig->bitsPerFrame = 8; /*!< Bits per frame, minimum 8, maximum 4096.*/ - slaveConfig->cpol = kLPSPI_ClockPolarityActiveHigh; /*!< Clock polarity. */ - slaveConfig->cpha = kLPSPI_ClockPhaseFirstEdge; /*!< Clock phase. */ - slaveConfig->direction = kLPSPI_MsbFirst; /*!< MSB or LSB data shift direction. */ - - slaveConfig->whichPcs = kLPSPI_Pcs0; /*!< Desired Peripheral Chip Select (pcs) */ - slaveConfig->pcsActiveHighOrLow = kLPSPI_PcsActiveLow; /*!< Desired PCS active high or low */ - - slaveConfig->pinCfg = kLPSPI_SdiInSdoOut; - slaveConfig->dataOutConfig = kLpspiDataOutRetained; -} - -/*! - * brief Restores the LPSPI peripheral to reset state. Note that this function - * sets all registers to reset state. As a result, the LPSPI module can't work after calling - * this API. - * param base LPSPI peripheral address. - */ -void LPSPI_Reset(LPSPI_Type *base) -{ - /* Reset all internal logic and registers, except the Control Register. Remains set until cleared by software.*/ - base->CR |= LPSPI_CR_RST_MASK; - - /* Software reset doesn't reset the CR, so manual reset the FIFOs */ - base->CR |= LPSPI_CR_RRF_MASK | LPSPI_CR_RTF_MASK; - - /* Master logic is not reset and module is disabled.*/ - base->CR = 0x00U; -} - -/*! - * brief De-initializes the LPSPI peripheral. Call this API to disable the LPSPI clock. - * param base LPSPI peripheral address. - */ -void LPSPI_Deinit(LPSPI_Type *base) -{ - - uint32_t instance = LPSPI_GetInstance(base); - - /* Reset to default value */ - LPSPI_Reset(base); - if(LP_FLEXCOMM_GetBaseAddress(instance) != 0U) - { - LP_FLEXCOMM_Deinit(instance); - } - else - { -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable LPSPI clock */ - (void)CLOCK_DisableClock(s_lpspiClocks[instance]); - -#if defined(LPSPI_PERIPH_CLOCKS) - (void)CLOCK_DisableClock(s_LpspiPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - } -#if !(defined(LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) && LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) - LP_FLEXCOMM_Deinit(LPSPI_GetInstance(base)); -#endif -} - -static void LPSPI_SetOnePcsPolarity(LPSPI_Type *base, - lpspi_which_pcs_t pcs, - lpspi_pcs_polarity_config_t activeLowOrHigh) -{ - uint32_t cfgr1Value = 0; - /* Clear the PCS polarity bit */ - cfgr1Value = base->CFGR1 & ~(1UL << (LPSPI_CFGR1_PCSPOL_SHIFT + (uint32_t)pcs)); - - /* Configure the PCS polarity bit according to the activeLowOrHigh setting */ - base->CFGR1 = cfgr1Value | ((uint32_t)activeLowOrHigh << (LPSPI_CFGR1_PCSPOL_SHIFT + (uint32_t)pcs)); -} - -/*! - * brief Sets the LPSPI baud rate in bits per second. - * - * This function takes in the desired bitsPerSec (baud rate) and calculates the nearest - * possible baud rate without exceeding the desired baud rate and returns the - * calculated baud rate in bits-per-second. It requires the caller to provide - * the frequency of the module source clock (in Hertz). Note that the baud rate - * does not go into effect until the Transmit Control Register (TCR) is programmed - * with the prescale value. Hence, this function returns the prescale tcrPrescaleValue - * parameter for later programming in the TCR. The higher level - * peripheral driver should alert the user of an out of range baud rate input. - * - * Note that the LPSPI module must first be disabled before configuring this. - * Note that the LPSPI module must be configured for master mode before configuring this. - * - * param base LPSPI peripheral address. - * param baudRate_Bps The desired baud rate in bits per second. - * param srcClock_Hz Module source input clock in Hertz. - * param tcrPrescaleValue The TCR prescale value needed to program the TCR. - * return The actual calculated baud rate. This function may also return a "0" if the - * LPSPI is not configured for master mode or if the LPSPI module is not disabled. - */ - -uint32_t LPSPI_MasterSetBaudRate(LPSPI_Type *base, - uint32_t baudRate_Bps, - uint32_t srcClock_Hz, - uint32_t *tcrPrescaleValue) -{ - assert(tcrPrescaleValue != NULL); - - /* For master mode configuration only, if slave mode detected, return 0. - * Also, the LPSPI module needs to be disabled first, if enabled, return 0 - */ - if ((!LPSPI_IsMaster(base)) || ((base->CR & LPSPI_CR_MEN_MASK) != 0U)) - { - return 0U; - } - - uint32_t prescaler, bestPrescaler; - uint32_t scaler, bestScaler; - uint32_t realBaudrate, bestBaudrate; - uint32_t diff, min_diff; - uint32_t desiredBaudrate = baudRate_Bps; - - /* find combination of prescaler and scaler resulting in baudrate closest to the - * requested value - */ - min_diff = 0xFFFFFFFFU; - - /* Set to maximum divisor value bit settings so that if baud rate passed in is less - * than the minimum possible baud rate, then the SPI will be configured to the lowest - * possible baud rate - */ - bestPrescaler = 7; - bestScaler = 255; - - bestBaudrate = 0; /* required to avoid compilation warning */ - - /* In all for loops, if min_diff = 0, the exit for loop*/ - for (prescaler = 0U; prescaler < 8U; prescaler++) - { - if (min_diff == 0U) - { - break; - } - for (scaler = 0U; scaler < 256U; scaler++) - { - if (min_diff == 0U) - { - break; - } - realBaudrate = (srcClock_Hz / (s_baudratePrescaler[prescaler] * (scaler + 2U))); - - /* calculate the baud rate difference based on the conditional statement - * that states that the calculated baud rate must not exceed the desired baud rate - */ - if (desiredBaudrate >= realBaudrate) - { - diff = desiredBaudrate - realBaudrate; - if (min_diff > diff) - { - /* a better match found */ - min_diff = diff; - bestPrescaler = prescaler; - bestScaler = scaler; - bestBaudrate = realBaudrate; - } - } - } - } - - /* Write the best baud rate scalar to the CCR. - * Note, no need to check for error since we've already checked to make sure the module is - * disabled and in master mode. Also, there is a limit on the maximum divider so we will not - * exceed this. - */ -#if defined(FSL_FEATURE_LPSPI_HAS_CCR1) && FSL_FEATURE_LPSPI_HAS_CCR1 - /* When CCR1 is present, the CCR[DBT] and CCR[SCKDIV] is write only, all read will return 0 - The real DBT and SCKDIV can be obtained in CCR1, CCR[DBT]=CCR1[SCKSCK] and CCR[SCKDIV]=CCR1[SCKHLD]+CCR1[SCKSET] - So when changing either CCR[DBT] or CCR[SCKDIV] make sure the other value is not overwritten by 0 */ - base->CCR = base->CCR | LPSPI_CCR_DBT((base->CCR1 & LPSPI_CCR1_SCKSCK_MASK) >> LPSPI_CCR1_SCKSCK_SHIFT) | - LPSPI_CCR_SCKDIV(bestScaler); -#else - base->CCR = (base->CCR & ~LPSPI_CCR_SCKDIV_MASK) | LPSPI_CCR_SCKDIV(bestScaler); -#endif /* FSL_FEATURE_LPSPI_HAS_CCR1 */ - - /* return the best prescaler value for user to use later */ - *tcrPrescaleValue = bestPrescaler; - - /* return the actual calculated baud rate */ - return bestBaudrate; -} - -/*! - * brief Manually configures a specific LPSPI delay parameter (module must be disabled to - * change the delay values). - * - * This function configures the following: - * SCK to PCS delay, or - * PCS to SCK delay, or - * The configurations must occur between the transfer delay. - * - * The delay names are available in type lpspi_delay_type_t. - * - * The user passes the desired delay along with the delay value. - * This allows the user to directly set the delay values if they have - * pre-calculated them or if they simply wish to manually increment the value. - * - * Note that the LPSPI module must first be disabled before configuring this. - * Note that the LPSPI module must be configured for master mode before configuring this. - * - * param base LPSPI peripheral address. - * param scaler The 8-bit delay value 0x00 to 0xFF (255). - * param whichDelay The desired delay to configure, must be of type lpspi_delay_type_t. - */ -void LPSPI_MasterSetDelayScaler(LPSPI_Type *base, uint32_t scaler, lpspi_delay_type_t whichDelay) -{ - /*These settings are only relevant in master mode */ -#if defined(FSL_FEATURE_LPSPI_HAS_CCR1) && FSL_FEATURE_LPSPI_HAS_CCR1 - /* When CCR1 is present, the CCR[DBT] and CCR[SCKDIV] is write only, all read will return 0 - The real DBT and SCKDIV can be obtained in CCR1, CCR[DBT]=CCR1[SCKSCK] and CCR[SCKDIV]=CCR1[SCKHLD]+CCR1[SCKSET] - So when changing either CCR[DBT] or CCR[SCKDIV] make sure the other value is not overwritten by 0 */ - uint32_t dbt = (base->CCR1 & LPSPI_CCR1_SCKSCK_MASK) >> LPSPI_CCR1_SCKSCK_SHIFT; - uint32_t sckdiv = (base->CCR1 & LPSPI_CCR1_SCKHLD_MASK) >> LPSPI_CCR1_SCKHLD_SHIFT; - sckdiv += (base->CCR1 & LPSPI_CCR1_SCKSET_MASK) >> LPSPI_CCR1_SCKSET_SHIFT; - switch (whichDelay) - { - case kLPSPI_PcsToSck: - base->CCR = (base->CCR & (~LPSPI_CCR_PCSSCK_MASK)) | LPSPI_CCR_PCSSCK(scaler) | LPSPI_CCR_DBT(dbt) | - LPSPI_CCR_SCKDIV(sckdiv); - - break; - case kLPSPI_LastSckToPcs: - base->CCR = (base->CCR & (~LPSPI_CCR_SCKPCS_MASK)) | LPSPI_CCR_SCKPCS(scaler) | LPSPI_CCR_DBT(dbt) | - LPSPI_CCR_SCKDIV(sckdiv); - - break; - case kLPSPI_BetweenTransfer: - base->CCR = base->CCR | LPSPI_CCR_DBT(scaler) | LPSPI_CCR_SCKDIV(sckdiv); -#else - switch (whichDelay) - { - case kLPSPI_PcsToSck: - base->CCR = (base->CCR & (~LPSPI_CCR_PCSSCK_MASK)) | LPSPI_CCR_PCSSCK(scaler); - - break; - case kLPSPI_LastSckToPcs: - base->CCR = (base->CCR & (~LPSPI_CCR_SCKPCS_MASK)) | LPSPI_CCR_SCKPCS(scaler); - - break; - case kLPSPI_BetweenTransfer: - base->CCR = (base->CCR & (~LPSPI_CCR_DBT_MASK)) | LPSPI_CCR_DBT(scaler); -#endif /* FSL_FEATURE_LPSPI_HAS_CCR1 */ - break; - default: - assert(false); - break; - } -} - -/*! - * brief Calculates the delay based on the desired delay input in nanoseconds (module must be - * disabled to change the delay values). - * - * This function calculates the values for the following: - * SCK to PCS delay, or - * PCS to SCK delay, or - * The configurations must occur between the transfer delay. - * - * The delay names are available in type lpspi_delay_type_t. - * - * The user passes the desired delay and the desired delay value in - * nano-seconds. The function calculates the value needed for the desired delay parameter - * and returns the actual calculated delay because an exact delay match may not be possible. In this - * case, the closest match is calculated without going below the desired delay value input. - * It is possible to input a very large delay value that exceeds the capability of the part, in - * which case the maximum supported delay is returned. It is up to the higher level - * peripheral driver to alert the user of an out of range delay input. - * - * Note that the LPSPI module must be configured for master mode before configuring this. And note that - * the delayTime = LPSPI_clockSource / (PRESCALE * Delay_scaler). - * - * param base LPSPI peripheral address. - * param delayTimeInNanoSec The desired delay value in nano-seconds. - * param whichDelay The desired delay to configuration, which must be of type lpspi_delay_type_t. - * param srcClock_Hz Module source input clock in Hertz. - * return actual Calculated delay value in nano-seconds. - */ -uint32_t LPSPI_MasterSetDelayTimes(LPSPI_Type *base, - uint32_t delayTimeInNanoSec, - lpspi_delay_type_t whichDelay, - uint32_t srcClock_Hz) -{ - uint64_t realDelay, bestDelay; - uint32_t scaler, bestScaler; - uint32_t diff, min_diff; - uint64_t initialDelayNanoSec; - uint32_t clockDividedPrescaler; - - /* For delay between transfer, an additional scaler value is needed */ - uint32_t additionalScaler = 0; - - /*As the RM note, the LPSPI baud rate clock is itself divided by the PRESCALE setting, which can vary between - * transfers.*/ - clockDividedPrescaler = - srcClock_Hz / s_baudratePrescaler[(base->TCR & LPSPI_TCR_PRESCALE_MASK) >> LPSPI_TCR_PRESCALE_SHIFT]; - - /* Find combination of prescaler and scaler resulting in the delay closest to the requested value.*/ - min_diff = 0xFFFFFFFFU; - - /* Initialize scaler to max value to generate the max delay */ - bestScaler = 0xFFU; - - /* Calculate the initial (min) delay and maximum possible delay based on the specific delay as - * the delay divisors are slightly different based on which delay we are configuring. - */ - if (whichDelay == kLPSPI_BetweenTransfer) - { - /* First calculate the initial, default delay, note min delay is 2 clock cycles. Due to large size of - calculated values (uint64_t), we need to break up the calculation into several steps to ensure - accurate calculated results - */ - initialDelayNanoSec = 1000000000U; - initialDelayNanoSec *= 2U; - initialDelayNanoSec /= clockDividedPrescaler; - - /* Calculate the maximum delay */ - bestDelay = 1000000000U; - bestDelay *= 257U; /* based on DBT+2, or 255 + 2 */ - bestDelay /= clockDividedPrescaler; - - additionalScaler = 1U; - } - else - { - /* First calculate the initial, default delay, min delay is 1 clock cycle. Due to large size of calculated - values (uint64_t), we need to break up the calculation into several steps to ensure accurate calculated - results. - */ - initialDelayNanoSec = 1000000000U; - initialDelayNanoSec /= clockDividedPrescaler; - - /* Calculate the maximum delay */ - bestDelay = 1000000000U; - bestDelay *= 256U; /* based on SCKPCS+1 or PCSSCK+1, or 255 + 1 */ - bestDelay /= clockDividedPrescaler; - - additionalScaler = 0U; - } - - /* If the initial, default delay is already greater than the desired delay, then - * set the delay to their initial value (0) and return the delay. In other words, - * there is no way to decrease the delay value further. - */ - if (initialDelayNanoSec >= delayTimeInNanoSec) - { - LPSPI_MasterSetDelayScaler(base, 0, whichDelay); - return (uint32_t)initialDelayNanoSec; - } - - /* If min_diff = 0, the exit for loop */ - for (scaler = 0U; scaler < 256U; scaler++) - { - if (min_diff == 0U) - { - break; - } - /* Calculate the real delay value as we cycle through the scaler values. - Due to large size of calculated values (uint64_t), we need to break up the - calculation into several steps to ensure accurate calculated results - */ - realDelay = 1000000000U; - realDelay *= ((uint64_t)scaler + 1UL + (uint64_t)additionalScaler); - realDelay /= clockDividedPrescaler; - - /* calculate the delay difference based on the conditional statement - * that states that the calculated delay must not be less then the desired delay - */ - if (realDelay >= delayTimeInNanoSec) - { - diff = (uint32_t)(realDelay - (uint64_t)delayTimeInNanoSec); - if (min_diff > diff) - { - /* a better match found */ - min_diff = diff; - bestScaler = scaler; - bestDelay = realDelay; - } - } - } - - /* write the best scaler value for the delay */ - LPSPI_MasterSetDelayScaler(base, bestScaler, whichDelay); - - /* return the actual calculated delay value (in ns) */ - return (uint32_t)bestDelay; -} - -/*Transactional APIs -- Master*/ - -/*! - * brief Initializes the LPSPI master handle. - * - * This function initializes the LPSPI handle, which can be used for other LPSPI transactional APIs. Usually, for a - * specified LPSPI instance, call this API once to get the initialized handle. - - * param base LPSPI peripheral address. - * param handle LPSPI handle pointer to lpspi_master_handle_t. - * param callback DSPI callback. - * param userData callback function parameter. - */ -void LPSPI_MasterTransferCreateHandle(LPSPI_Type *base, - lpspi_master_handle_t *handle, - lpspi_master_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - uint32_t instance = LPSPI_GetInstance(base); - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - handle->callback = callback; - handle->userData = userData; - - if(LP_FLEXCOMM_GetBaseAddress(instance) != 0U) - { - lpspi_to_lpflexcomm_t handler; - handler.lpspi_master_handler = LPSPI_MasterTransferHandleIRQ; - - /* Save the handle in global variables to support the double weak mechanism. */ - LP_FLEXCOMM_SetIRQHandler(instance, handler.lpflexcomm_handler, handle, LP_FLEXCOMM_PERIPH_LPSPI); - } - else - { - s_lpspiHandle[instance] = handle; - - /* Set irq handler. */ - s_lpspiMasterIsr = LPSPI_MasterTransferHandleIRQ; - } -} - -/*! - * brief Check the argument for transfer . - * - * param base LPSPI peripheral address. - * param transfer the transfer struct to be used. - * param isEdma True to check for EDMA transfer, false to check interrupt non-blocking transfer - * return Return true for right and false for wrong. - */ -bool LPSPI_CheckTransferArgument(LPSPI_Type *base, lpspi_transfer_t *transfer, bool isEdma) -{ - assert(transfer != NULL); - uint32_t bitsPerFrame = ((base->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT) + 1U; - uint32_t bytesPerFrame = (bitsPerFrame + 7U) / 8U; - uint32_t temp = (base->CFGR1 & LPSPI_CFGR1_PINCFG_MASK); - /* If the transfer count is zero, then return immediately.*/ - if (transfer->dataSize == 0U) - { - return false; - } - - /* If both send buffer and receive buffer is null */ - if ((NULL == (transfer->txData)) && (NULL == (transfer->rxData))) - { - return false; - } - - /*The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4 . - *For bytesPerFrame greater than 4 situation: - *the transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not integer multiples of 4 , - *otherwise , the transfer data size can be integer multiples of bytesPerFrame. - */ - if (bytesPerFrame <= 4U) - { - if ((transfer->dataSize % bytesPerFrame) != 0U) - { - return false; - } - } - else - { - if ((bytesPerFrame % 4U) != 0U) - { - if (transfer->dataSize != bytesPerFrame) - { - return false; - } - } - else - { - if ((transfer->dataSize % bytesPerFrame) != 0U) - { - return false; - } - } - } - - /* Check if using 3-wire mode and the txData is NULL, set the output pin to tristated. */ - if ((temp == LPSPI_CFGR1_PINCFG(kLPSPI_SdiInSdiOut)) || (temp == LPSPI_CFGR1_PINCFG(kLPSPI_SdoInSdoOut))) - { - /* The 3-wire mode can't send and receive data at the same time. */ - if ((transfer->txData != NULL) && (transfer->rxData != NULL)) - { - return false; - } - if (NULL == transfer->txData) - { - base->CFGR1 |= LPSPI_CFGR1_OUTCFG_MASK; - } - } - - if (isEdma && ((bytesPerFrame % 4U) == 3U)) - { - return false; - } - - return true; -} - -/*! - * brief LPSPI master transfer data using a polling method. - * - * This function transfers data using a polling method. This is a blocking function, which does not return until all - * transfers have been completed. - * - * Note: - * The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not integer multiples of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * param base LPSPI peripheral address. - * param transfer pointer to lpspi_transfer_t structure. - * return status of status_t. - */ -status_t LPSPI_MasterTransferBlocking(LPSPI_Type *base, lpspi_transfer_t *transfer) -{ - assert(transfer != NULL); - - /* Check that LPSPI is not busy.*/ - if ((LPSPI_GetStatusFlags(base) & (uint32_t)kLPSPI_ModuleBusyFlag) != 0U) - { - return kStatus_LPSPI_Busy; - } - LPSPI_Enable(base, false); - /* Check arguements */ - if (!LPSPI_CheckTransferArgument(base, transfer, false)) - { - return kStatus_InvalidArgument; - } - - LPSPI_FlushFifo(base, true, true); - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_AllStatusFlag); - - /* Variables */ - bool isTxMask = false; - bool isByteSwap = ((transfer->configFlags & (uint32_t)kLPSPI_MasterByteSwap) != 0U); - uint8_t bytesEachWrite; - uint8_t bytesEachRead; - uint8_t *txData = transfer->txData; - uint8_t *rxData = transfer->rxData; - uint8_t dummyData = g_lpspiDummyData[LPSPI_GetInstance(base)]; - uint32_t readData = 0U; - uint32_t txRemainingByteCount = transfer->dataSize; - uint32_t rxRemainingByteCount = transfer->dataSize; - uint32_t wordToSend = - ((uint32_t)dummyData) | ((uint32_t)dummyData << 8) | ((uint32_t)dummyData << 16) | ((uint32_t)dummyData << 24); - /*The TX and RX FIFO sizes are always the same*/ - uint32_t fifoSize = LPSPI_GetRxFifoSize(base); - uint32_t bytesPerFrame = ((base->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT) / 8U + 1U; - /* No need to configure PCS continous if the transfer byte count is smaller than frame size */ - bool isPcsContinuous = (((transfer->configFlags & (uint32_t)kLPSPI_MasterPcsContinuous) != 0U) && - (bytesPerFrame < transfer->dataSize)); - uint32_t rxFifoMaxBytes = MIN(bytesPerFrame, 4U) * fifoSize; - uint32_t whichPcs = (transfer->configFlags & LPSPI_MASTER_PCS_MASK) >> LPSPI_MASTER_PCS_SHIFT; - uint32_t width = (transfer->configFlags & LPSPI_MASTER_WIDTH_MASK) >> LPSPI_MASTER_WIDTH_SHIFT; - uint32_t temp = (base->CFGR1 & LPSPI_CFGR1_PINCFG_MASK); - -#if SPI_RETRY_TIMES - uint32_t waitTimes; -#endif - - /* Mask tx data in half duplex mode */ - if (((temp == LPSPI_CFGR1_PINCFG(kLPSPI_SdiInSdiOut)) || (temp == LPSPI_CFGR1_PINCFG(kLPSPI_SdoInSdoOut))) && - (txData == NULL)) - { - isTxMask = true; - } - - base->CFGR1 &= (~LPSPI_CFGR1_NOSTALL_MASK); - LPSPI_Enable(base, true); - - /* Configure transfer control register. */ - base->TCR = (base->TCR & ~(LPSPI_TCR_CONT_MASK | LPSPI_TCR_CONTC_MASK | LPSPI_TCR_RXMSK_MASK | - LPSPI_TCR_TXMSK_MASK | LPSPI_TCR_PCS_MASK)) | - LPSPI_TCR_PCS(whichPcs) | LPSPI_TCR_WIDTH(width); - - /*TCR is also shared the FIFO, so wait for TCR written.*/ - if (!LPSPI_TxFifoReady(base)) - { - return kStatus_LPSPI_Timeout; - } - - /* PCS should be configured separately from the other bits, otherwise it will not take effect. */ - base->TCR |= LPSPI_TCR_CONT(isPcsContinuous) | LPSPI_TCR_CONTC(isPcsContinuous) | LPSPI_TCR_RXMSK(NULL == rxData); - - /*TCR is also shared the FIFO, so wait for TCR written.*/ - if (!LPSPI_TxFifoReady(base)) - { - return kStatus_LPSPI_Timeout; - } - - if (bytesPerFrame <= 4U) - { - bytesEachWrite = (uint8_t)bytesPerFrame; - bytesEachRead = (uint8_t)bytesPerFrame; - } - else - { - bytesEachWrite = 4U; - bytesEachRead = 4U; - } - - /*Write the TX data until txRemainingByteCount is equal to 0 */ - while (txRemainingByteCount > 0U) - { - if (txRemainingByteCount < bytesEachWrite) - { - bytesEachWrite = (uint8_t)txRemainingByteCount; - } - - /*Wait until TX FIFO is not full*/ -#if SPI_RETRY_TIMES - waitTimes = SPI_RETRY_TIMES; - while ((LPSPI_GetTxFifoCount(base) == fifoSize) && (--waitTimes != 0U)) -#else - while (LPSPI_GetTxFifoCount(base) == fifoSize) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return kStatus_LPSPI_Timeout; - } -#endif - - /* To prevent rxfifo overflow, ensure transmitting and receiving are executed in parallel */ - if (((NULL == rxData) || (rxRemainingByteCount - txRemainingByteCount) < rxFifoMaxBytes)) - { - if (isTxMask) - { - /* When TCR[TXMSK]=1, transfer is initiate by writting a new command word to TCR. TCR[TXMSK] is cleared - by hardware every time when TCR[FRAMESZ] bit of data is transfered. - In this case TCR[TXMSK] should be set to initiate each transfer. */ - base->TCR |= LPSPI_TCR_TXMSK_MASK; - if (isPcsContinuous && (txRemainingByteCount == bytesPerFrame)) - { - /* For the last piece of frame size of data, if is PCS continous mode(TCR[CONT]), TCR[CONTC] should - * be cleared to de-assert the PCS. Be sure to clear the TXMSK as well otherwise another FRAMESZ - * of data will be received. */ - base->TCR &= ~(LPSPI_TCR_CONTC_MASK | LPSPI_TCR_CONT_MASK | LPSPI_TCR_TXMSK_MASK); - } - txRemainingByteCount -= bytesPerFrame; - } - else - { - if (txData != NULL) - { - wordToSend = LPSPI_CombineWriteData(txData, bytesEachWrite, isByteSwap); - txData += bytesEachWrite; - } - /* Otherwise push data to tx FIFO to initiate transfer */ - LPSPI_WriteData(base, wordToSend); - txRemainingByteCount -= bytesEachWrite; - } - } - - /* Check whether there is RX data in RX FIFO . Read out the RX data so that the RX FIFO would not overrun. */ - if ((rxData != NULL) && (rxRemainingByteCount != 0U)) - { - /* To ensure parallel execution in 3-wire mode, after writting 1 to TXMSK to generate clock of - bytesPerFrame's data wait until bytesPerFrame's data is received. */ - while (isTxMask && (LPSPI_GetRxFifoCount(base) == 0U)) - { - } -#if SPI_RETRY_TIMES - waitTimes = SPI_RETRY_TIMES; - while ((LPSPI_GetRxFifoCount(base) != 0U) && (--waitTimes != 0U)) -#else - while (LPSPI_GetRxFifoCount(base) != 0U) -#endif - { - readData = LPSPI_ReadData(base); - if (rxRemainingByteCount < bytesEachRead) - { - bytesEachRead = (uint8_t)rxRemainingByteCount; - } - - LPSPI_SeparateReadData(rxData, readData, bytesEachRead, isByteSwap); - rxData += bytesEachRead; - - rxRemainingByteCount -= bytesEachRead; - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return kStatus_LPSPI_Timeout; - } -#endif - } - } - - if (isPcsContinuous && !isTxMask) - { - /* In PCS continous mode(TCR[CONT]), after write all the data in TX FIFO, TCR[CONTC] and TCR[CONT] should be - cleared to de-assert the PCS. Note that TCR register also use the TX FIFO. Also CONTC should be cleared when - tx is not masked, otherwise written to TCR register with TXMSK bit wet will initiate a new transfer. */ -#if SPI_RETRY_TIMES - waitTimes = SPI_RETRY_TIMES; - while ((LPSPI_GetTxFifoCount(base) == fifoSize) && (--waitTimes != 0U)) -#else - while (LPSPI_GetTxFifoCount(base) == fifoSize) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return kStatus_LPSPI_Timeout; - } -#endif - base->TCR = (base->TCR & ~(LPSPI_TCR_CONTC_MASK | LPSPI_TCR_CONT_MASK)); - } - - /*Read out the RX data in FIFO*/ - if (rxData != NULL) - { - while (rxRemainingByteCount > 0U) - { -#if SPI_RETRY_TIMES - waitTimes = SPI_RETRY_TIMES; - while ((LPSPI_GetRxFifoCount(base) != 0U) && (--waitTimes != 0U)) -#else - while (LPSPI_GetRxFifoCount(base) != 0U) -#endif - { - readData = LPSPI_ReadData(base); - - if (rxRemainingByteCount < bytesEachRead) - { - bytesEachRead = (uint8_t)rxRemainingByteCount; - } - - LPSPI_SeparateReadData(rxData, readData, bytesEachRead, isByteSwap); - rxData += bytesEachRead; - - rxRemainingByteCount -= bytesEachRead; - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return kStatus_LPSPI_Timeout; - } -#endif - } - } - - /* Wait for transfer complete flag, that is the PCS is re-asserted. */ -#if SPI_RETRY_TIMES - waitTimes = SPI_RETRY_TIMES; - while (((LPSPI_GetStatusFlags(base) & (uint32_t)kLPSPI_TransferCompleteFlag) == 0U) && (--waitTimes != 0U)) -#else - while ((LPSPI_GetStatusFlags(base) & (uint32_t)kLPSPI_TransferCompleteFlag) == 0U) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return kStatus_LPSPI_Timeout; - } -#endif - - return kStatus_Success; -} - -/*! - * brief LPSPI master transfer data using an interrupt method. - * - * This function transfers data using an interrupt method. This is a non-blocking function, which returns right away. - * When all data is transferred, the callback function is called. - * - * Note: - * The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not integer multiples of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * param base LPSPI peripheral address. - * param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - * param transfer pointer to lpspi_transfer_t structure. - * return status of status_t. - */ -status_t LPSPI_MasterTransferNonBlocking(LPSPI_Type *base, lpspi_master_handle_t *handle, lpspi_transfer_t *transfer) -{ - assert(handle != NULL); - assert(transfer != NULL); - - /* Check that we're not busy.*/ - if (handle->state == (uint8_t)kLPSPI_Busy) - { - return kStatus_LPSPI_Busy; - } - - LPSPI_Enable(base, false); - /* Check arguements */ - if (!LPSPI_CheckTransferArgument(base, transfer, false)) - { - return kStatus_InvalidArgument; - } - - /* Flush FIFO, clear status, disable all the interrupts. */ - LPSPI_FlushFifo(base, true, true); - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_AllStatusFlag); - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_AllInterruptEnable); - - /* Variables */ - bool isRxMask = false; - handle->isTxMask = false; - uint8_t txWatermark; - uint8_t dummyData = g_lpspiDummyData[LPSPI_GetInstance(base)]; - uint32_t tmpTimes; - uint32_t whichPcs = (transfer->configFlags & LPSPI_MASTER_PCS_MASK) >> LPSPI_MASTER_PCS_SHIFT; - uint32_t temp = (base->CFGR1 & LPSPI_CFGR1_PINCFG_MASK); - - /* Assign the original value for members of transfer handle. */ - handle->state = (uint8_t)kLPSPI_Busy; - handle->txData = transfer->txData; - handle->rxData = transfer->rxData; - handle->txRemainingByteCount = transfer->dataSize; - handle->rxRemainingByteCount = transfer->dataSize; - handle->totalByteCount = transfer->dataSize; - handle->writeTcrInIsr = false; - handle->bytesPerFrame = (uint16_t)((base->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT) / 8U + 1U; - /* No need to configure PCS continous if the transfer byte count is smaller than frame size */ - bool isPcsContinuous = (((transfer->configFlags & (uint32_t)kLPSPI_MasterPcsContinuous) != 0U) && - (transfer->dataSize > handle->bytesPerFrame)); - handle->writeRegRemainingTimes = - (transfer->dataSize / (uint32_t)handle->bytesPerFrame) * (((uint32_t)handle->bytesPerFrame + 3U) / 4U); - handle->readRegRemainingTimes = handle->writeRegRemainingTimes; - handle->txBuffIfNull = - ((uint32_t)dummyData) | ((uint32_t)dummyData << 8) | ((uint32_t)dummyData << 16) | ((uint32_t)dummyData << 24); - /*The TX and RX FIFO sizes are always the same*/ - handle->fifoSize = LPSPI_GetRxFifoSize(base); - handle->isPcsContinuous = isPcsContinuous; - handle->isByteSwap = ((transfer->configFlags & (uint32_t)kLPSPI_MasterByteSwap) != 0U); - /*Calculate the bytes for write/read the TX/RX register each time*/ - if (handle->bytesPerFrame <= 4U) - { - handle->bytesEachWrite = (uint8_t)handle->bytesPerFrame; - handle->bytesEachRead = (uint8_t)handle->bytesPerFrame; - } - else - { - handle->bytesEachWrite = 4U; - handle->bytesEachRead = 4U; - } - - /*Set the RX and TX watermarks to reduce the ISR times.*/ - if (handle->fifoSize > 1U) - { - txWatermark = 1U; - handle->rxWatermark = handle->fifoSize - 2U; - } - else - { - txWatermark = 0U; - handle->rxWatermark = 0U; - } - LPSPI_SetFifoWatermarks(base, txWatermark, handle->rxWatermark); - - /* If there is no rxData, mask the receive data so that receive data is not stored in receive FIFO. */ - if (handle->rxData == NULL) - { - isRxMask = true; - handle->rxRemainingByteCount = 0; - } - - /* Mask tx data in half duplex mode since the tx/rx share the same pin, so that the data received from slave is not - * interfered. */ - if (((temp == LPSPI_CFGR1_PINCFG(kLPSPI_SdiInSdiOut)) || (temp == LPSPI_CFGR1_PINCFG(kLPSPI_SdoInSdoOut))) && - (handle->txData == NULL)) - { - handle->isTxMask = true; - } - - /*Transfers will stall when transmit FIFO is empty or receive FIFO is full. */ - base->CFGR1 &= (~LPSPI_CFGR1_NOSTALL_MASK); - - /* Enable module for following configuration of TCR to take effect. */ - LPSPI_Enable(base, true); - - /* Configure transfer control register. */ - base->TCR = (base->TCR & ~(LPSPI_TCR_CONT_MASK | LPSPI_TCR_CONTC_MASK | LPSPI_TCR_RXMSK_MASK | - LPSPI_TCR_TXMSK_MASK | LPSPI_TCR_PCS_MASK)) | - LPSPI_TCR_PCS(whichPcs); - - /*TCR is also shared the FIFO , so wait for TCR written.*/ - if (!LPSPI_TxFifoReady(base)) - { - return kStatus_LPSPI_Timeout; - } - - /* PCS should be configured separately from the other bits, otherwise it will not take effect. */ - base->TCR |= LPSPI_TCR_CONT(isPcsContinuous) | LPSPI_TCR_CONTC(isPcsContinuous) | LPSPI_TCR_RXMSK(isRxMask); - - /* Enable the NVIC for LPSPI peripheral. Note that below code is useless if the LPSPI interrupt is in INTMUX , - * and you should also enable the INTMUX interupt in your application. - */ - (void)EnableIRQ(s_lpspiIRQ[LPSPI_GetInstance(base)]); - - /*TCR is also shared the FIFO , so wait for TCR written.*/ - if (!LPSPI_TxFifoReady(base)) - { - return kStatus_LPSPI_Timeout; - } - - if (handle->isTxMask) - { - /* When TCR[TXMSK]=1, transfer is initiate by writting a new command word to TCR. TCR[TXMSK] is cleared by - hardware every time when TCR[FRAMESZ] bit of data is transfered. In this case TCR[TXMSK] should be set to - initiate each transfer. */ - - base->TCR |= LPSPI_TCR_TXMSK_MASK; - handle->txRemainingByteCount -= (uint32_t)handle->bytesPerFrame; - } - else - { - /* Fill up the TX data in FIFO to initiate transfer */ - LPSPI_MasterTransferFillUpTxFifo(base, handle); - } - - /* Since SPI is a synchronous interface, we only need to enable the RX interrupt if there is RX data. - * The IRQ handler will get the status of RX and TX interrupt flags. - */ - if (handle->rxData != NULL) - { - if (handle->isTxMask) - { - /* if tx data is masked, transfer is initiated by writing 1 to TCR[TXMSK] and TCR[FRMESZ] bits of data is - read. If rx water mark is set larger than TCR[FRMESZ], rx interrupt will not be generated. Lower the rx - water mark setting */ - if ((handle->bytesPerFrame / 4U) < (uint16_t)handle->rxWatermark) - { - handle->rxWatermark = - (uint8_t)(handle->bytesPerFrame / 4U) > 0U ? (uint8_t)(handle->bytesPerFrame / 4U - 1U) : 0U; - base->FCR = (base->FCR & (~LPSPI_FCR_RXWATER_MASK)) | LPSPI_FCR_RXWATER(handle->rxWatermark); - } - } - else - { - /*Set rxWatermark to (readRegRemainingTimes-1) if readRegRemainingTimes less than rxWatermark. Otherwise - *there is not RX interrupt for the last datas because the RX count is not greater than rxWatermark. - */ - tmpTimes = handle->readRegRemainingTimes; - if (tmpTimes <= handle->rxWatermark) - { - base->FCR = (base->FCR & (~LPSPI_FCR_RXWATER_MASK)) | LPSPI_FCR_RXWATER(tmpTimes - 1U); - } - } - - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_RxInterruptEnable); - } - else - { - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_TxInterruptEnable); - } - - return kStatus_Success; -} - -static void LPSPI_MasterTransferFillUpTxFifo(LPSPI_Type *base, lpspi_master_handle_t *handle) -{ - assert(handle != NULL); - - uint32_t wordToSend = 0; - uint8_t fifoSize = handle->fifoSize; - uint32_t writeRegRemainingTimes = handle->writeRegRemainingTimes; - uint32_t readRegRemainingTimes = handle->readRegRemainingTimes; - size_t txRemainingByteCount = handle->txRemainingByteCount; - uint8_t bytesEachWrite = handle->bytesEachWrite; - bool isByteSwap = handle->isByteSwap; - - /* Make sure the difference in remaining TX and RX byte counts does not exceed FIFO depth - * and that the number of TX FIFO entries does not exceed the FIFO depth. - * But no need to make the protection if there is no rxData. - */ - while ((LPSPI_GetTxFifoCount(base) < fifoSize) && - (((readRegRemainingTimes - writeRegRemainingTimes) < (uint32_t)fifoSize) || (handle->rxData == NULL))) - { - if (txRemainingByteCount < (size_t)bytesEachWrite) - { - handle->bytesEachWrite = (uint8_t)txRemainingByteCount; - bytesEachWrite = handle->bytesEachWrite; - } - - if (handle->txData != NULL) - { - wordToSend = LPSPI_CombineWriteData(handle->txData, bytesEachWrite, isByteSwap); - handle->txData += bytesEachWrite; - } - else - { - wordToSend = handle->txBuffIfNull; - } - - /*Write the word to TX register*/ - LPSPI_WriteData(base, wordToSend); - - /*Decrease the write TX register times.*/ - --handle->writeRegRemainingTimes; - writeRegRemainingTimes = handle->writeRegRemainingTimes; - - /*Decrease the remaining TX byte count.*/ - handle->txRemainingByteCount -= (size_t)bytesEachWrite; - txRemainingByteCount = handle->txRemainingByteCount; - - if (handle->txRemainingByteCount == 0U) - { - /* If PCS is continuous, update TCR to de-assert PCS */ - if (handle->isPcsContinuous) - { - /* Only write to the TCR if the FIFO has room */ - if (LPSPI_GetTxFifoCount(base) < fifoSize) - { - base->TCR = (base->TCR & ~(LPSPI_TCR_CONTC_MASK)); - handle->writeTcrInIsr = false; - } - /* Else, set a global flag to tell the ISR to do write to the TCR */ - else - { - handle->writeTcrInIsr = true; - } - } - break; - } - } -} - -static void LPSPI_MasterTransferComplete(LPSPI_Type *base, lpspi_master_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable interrupt requests*/ - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_AllInterruptEnable); - - handle->state = (uint8_t)kLPSPI_Idle; - - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_Success, handle->userData); - } -} - -/*! - * brief Gets the master transfer remaining bytes. - * - * This function gets the master transfer remaining bytes. - * - * param base LPSPI peripheral address. - * param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - * param count Number of bytes transferred so far by the non-blocking transaction. - * return status of status_t. - */ -status_t LPSPI_MasterTransferGetCount(LPSPI_Type *base, lpspi_master_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (handle->state != (uint8_t)kLPSPI_Busy) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - size_t remainingByte; - - if (handle->rxData != NULL) - { - remainingByte = handle->rxRemainingByteCount; - } - else - { - remainingByte = handle->txRemainingByteCount; - } - - *count = handle->totalByteCount - remainingByte; - - return kStatus_Success; -} - -/*! - * brief LPSPI master abort transfer which uses an interrupt method. - * - * This function aborts a transfer which uses an interrupt method. - * - * param base LPSPI peripheral address. - * param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - */ -void LPSPI_MasterTransferAbort(LPSPI_Type *base, lpspi_master_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable interrupt requests*/ - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_AllInterruptEnable); - - LPSPI_Reset(base); - - handle->state = (uint8_t)kLPSPI_Idle; - handle->txRemainingByteCount = 0; - handle->rxRemainingByteCount = 0; -} - -/*! - * brief LPSPI Master IRQ handler function. - * - * This function processes the LPSPI transmit and receive IRQ. - * - * param instance LPSPI instance. - * param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - */ -void LPSPI_MasterTransferHandleIRQ(uint32_t instance, lpspi_master_handle_t *handle) -{ - assert(handle != NULL); - assert(instance < ARRAY_SIZE(s_lpspiBases)); - LPSPI_Type *base = s_lpspiBases[instance]; - uint32_t readData; - uint8_t bytesEachRead = handle->bytesEachRead; - bool isByteSwap = handle->isByteSwap; - uint32_t readRegRemainingTimes = handle->readRegRemainingTimes; - - if (handle->rxData != NULL) - { - if (handle->rxRemainingByteCount != 0U) - { - /* First, disable the interrupts to avoid potentially triggering another interrupt - * while reading out the RX FIFO as more data may be coming into the RX FIFO. We'll - * re-enable the interrupts based on the LPSPI state after reading out the FIFO. - */ - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_RxInterruptEnable); - - while ((LPSPI_GetRxFifoCount(base) != 0U) && (handle->rxRemainingByteCount != 0U)) - { - /*Read out the data*/ - readData = LPSPI_ReadData(base); - - /*Decrease the read RX register times.*/ - --handle->readRegRemainingTimes; - readRegRemainingTimes = handle->readRegRemainingTimes; - - if (handle->rxRemainingByteCount < (size_t)bytesEachRead) - { - handle->bytesEachRead = (uint8_t)(handle->rxRemainingByteCount); - bytesEachRead = handle->bytesEachRead; - } - - LPSPI_SeparateReadData(handle->rxData, readData, bytesEachRead, isByteSwap); - handle->rxData += bytesEachRead; - - /*Decrease the remaining RX byte count.*/ - handle->rxRemainingByteCount -= (size_t)bytesEachRead; - } - - /* Re-enable the interrupts only if rxCount indicates there is more data to receive, - * else we may get a spurious interrupt. - * */ - if (handle->rxRemainingByteCount != 0U) - { - /* Set the TDF and RDF interrupt enables simultaneously to avoid race conditions */ - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_RxInterruptEnable); - } - } - - /*Set rxWatermark to (readRegRemainingTimes-1) if readRegRemainingTimes less than rxWatermark. Otherwise there - *is not RX interrupt for the last datas because the RX count is not greater than rxWatermark. - */ - if (readRegRemainingTimes <= (uint32_t)handle->rxWatermark) - { - base->FCR = (base->FCR & (~LPSPI_FCR_RXWATER_MASK)) | - LPSPI_FCR_RXWATER((readRegRemainingTimes > 1U) ? (readRegRemainingTimes - 1U) : (0U)); - } - } - - if (handle->txRemainingByteCount != 0U) - { - if (handle->isTxMask) - { - /* When TCR[TXMSK]=1, transfer is initiate by writting a new command word to TCR. TCR[TXMSK] is cleared by - hardware every time when TCR[FRAMESZ] bit of data is transfered. - In this case TCR[TXMSK] should be set to initiate each transfer. */ - base->TCR |= LPSPI_TCR_TXMSK_MASK; - if ((handle->txRemainingByteCount == (uint32_t)handle->bytesPerFrame) && (handle->isPcsContinuous)) - { - /* For the last piece of frame size of data, if is PCS continous mode(TCR[CONT]), TCR[CONTC] should - * be cleared to de-assert the PCS. Be sure to clear the TXMSK as well otherwise another FRAMESZ - * of data will be received. */ - base->TCR &= ~(LPSPI_TCR_CONTC_MASK | LPSPI_TCR_CONT_MASK | LPSPI_TCR_TXMSK_MASK); - } - handle->txRemainingByteCount -= (uint32_t)handle->bytesPerFrame; - } - else - { - LPSPI_MasterTransferFillUpTxFifo(base, handle); - } - } - else - { - if ((LPSPI_GetTxFifoCount(base) < (handle->fifoSize))) - { - if ((handle->isPcsContinuous) && (handle->writeTcrInIsr) && (!handle->isTxMask)) - { - base->TCR = (base->TCR & ~(LPSPI_TCR_CONTC_MASK)); - handle->writeTcrInIsr = false; - } - } - } - - if ((handle->txRemainingByteCount == 0U) && (handle->rxRemainingByteCount == 0U) && (!handle->writeTcrInIsr)) - { - /* If no RX buffer, then transfer is not complete until transfer complete flag sets */ - if (handle->rxData == NULL) - { - if ((LPSPI_GetStatusFlags(base) & (uint32_t)kLPSPI_TransferCompleteFlag) != 0U) - { - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_TransferCompleteFlag); - /* Complete the transfer and disable the interrupts */ - LPSPI_MasterTransferComplete(base, handle); - } - else - { - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_TransferCompleteInterruptEnable); - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_TxInterruptEnable | (uint32_t)kLPSPI_RxInterruptEnable); - } - } - else - { - /* Complete the transfer and disable the interrupts */ - LPSPI_MasterTransferComplete(base, handle); - } - } -} - -/*Transactional APIs -- Slave*/ -/*! - * brief Initializes the LPSPI slave handle. - * - * This function initializes the LPSPI handle, which can be used for other LPSPI transactional APIs. Usually, for a - * specified LPSPI instance, call this API once to get the initialized handle. - * - * param base LPSPI peripheral address. - * param handle LPSPI handle pointer to lpspi_slave_handle_t. - * param callback DSPI callback. - * param userData callback function parameter. - */ -void LPSPI_SlaveTransferCreateHandle(LPSPI_Type *base, - lpspi_slave_handle_t *handle, - lpspi_slave_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - /* Get instance from peripheral base address. */ - uint32_t instance = LPSPI_GetInstance(base); - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - handle->callback = callback; - handle->userData = userData; - - if(LP_FLEXCOMM_GetBaseAddress(instance) != 0U) - { - lpspi_to_lpflexcomm_t handler; - handler.lpspi_slave_handler = LPSPI_SlaveTransferHandleIRQ; - - /* Save the handle in global variables to support the double weak mechanism. */ - LP_FLEXCOMM_SetIRQHandler(instance, handler.lpflexcomm_handler, handle, LP_FLEXCOMM_PERIPH_LPSPI); - } - else - { - s_lpspiHandle[instance] = handle; - - /* Set irq handler. */ - s_lpspiSlaveIsr = LPSPI_SlaveTransferHandleIRQ; - } -} - -/*! - * brief LPSPI slave transfer data using an interrupt method. - * - * This function transfer data using an interrupt method. This is a non-blocking function, which returns right away. - * When all data is transferred, the callback function is called. - * - * Note: - * The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not an integer multiple of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * param base LPSPI peripheral address. - * param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - * param transfer pointer to lpspi_transfer_t structure. - * return status of status_t. - */ -status_t LPSPI_SlaveTransferNonBlocking(LPSPI_Type *base, lpspi_slave_handle_t *handle, lpspi_transfer_t *transfer) -{ - assert(handle != NULL); - assert(transfer != NULL); - - /* Check that we're not busy.*/ - if (handle->state == (uint8_t)kLPSPI_Busy) - { - return kStatus_LPSPI_Busy; - } - LPSPI_Enable(base, false); - /* Check arguements */ - if (!LPSPI_CheckTransferArgument(base, transfer, false)) - { - return kStatus_InvalidArgument; - } - - /* Flush FIFO, clear status, disable all the inerrupts. */ - LPSPI_FlushFifo(base, true, true); - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_AllStatusFlag); - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_AllInterruptEnable); - - /* Variables */ - bool isRxMask = false; - bool isTxMask = false; - uint8_t txWatermark; - uint32_t readRegRemainingTimes; - uint32_t whichPcs = (transfer->configFlags & LPSPI_SLAVE_PCS_MASK) >> LPSPI_SLAVE_PCS_SHIFT; - uint32_t bytesPerFrame = ((base->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT) / 8U + 1U; - - /* Assign the original value for members of transfer handle. */ - handle->state = (uint8_t)kLPSPI_Busy; - handle->txData = transfer->txData; - handle->rxData = transfer->rxData; - handle->txRemainingByteCount = transfer->dataSize; - handle->rxRemainingByteCount = transfer->dataSize; - handle->totalByteCount = transfer->dataSize; - handle->writeRegRemainingTimes = (transfer->dataSize / bytesPerFrame) * ((bytesPerFrame + 3U) / 4U); - handle->readRegRemainingTimes = handle->writeRegRemainingTimes; - /*The TX and RX FIFO sizes are always the same*/ - handle->fifoSize = LPSPI_GetRxFifoSize(base); - handle->isByteSwap = ((transfer->configFlags & (uint32_t)kLPSPI_SlaveByteSwap) != 0U); - /*Calculate the bytes for write/read the TX/RX register each time*/ - if (bytesPerFrame <= 4U) - { - handle->bytesEachWrite = (uint8_t)bytesPerFrame; - handle->bytesEachRead = (uint8_t)bytesPerFrame; - } - else - { - handle->bytesEachWrite = 4U; - handle->bytesEachRead = 4U; - } - /* Set proper RX and TX watermarks to reduce the ISR response times. */ - if (handle->fifoSize > 1U) - { - txWatermark = 1U; - handle->rxWatermark = handle->fifoSize - 2U; - } - else - { - txWatermark = 0U; - handle->rxWatermark = 0U; - } - LPSPI_SetFifoWatermarks(base, txWatermark, handle->rxWatermark); - - /* If there is no rxData, mask the receive data so that receive data is not stored in receive FIFO. */ - if (handle->rxData == NULL) - { - isRxMask = true; - handle->rxRemainingByteCount = 0U; - } - /* If there is no txData, mask the transmit data so that no data is loaded from transmit FIFO and output pin - * is tristated. */ - if (handle->txData == NULL) - { - isTxMask = true; - handle->txRemainingByteCount = 0U; - } - - /* Enable module for following configuration of TCR to take effect. */ - LPSPI_Enable(base, true); - - base->TCR = (base->TCR & ~(LPSPI_TCR_CONT_MASK | LPSPI_TCR_CONTC_MASK | LPSPI_TCR_RXMSK_MASK | - LPSPI_TCR_TXMSK_MASK | LPSPI_TCR_PCS_MASK)) | - LPSPI_TCR_RXMSK(isRxMask) | LPSPI_TCR_TXMSK(isTxMask) | LPSPI_TCR_PCS(whichPcs); - - /* Enable the NVIC for LPSPI peripheral. Note that below code is useless if the LPSPI interrupt is in INTMUX , - * and you should also enable the INTMUX interupt in your application. - */ - (void)EnableIRQ(s_lpspiIRQ[LPSPI_GetInstance(base)]); - - /*TCR is also shared the FIFO, so wait for TCR written.*/ - if (!LPSPI_TxFifoReady(base)) - { - return kStatus_LPSPI_Timeout; - } - - /* Fill up the TX data in FIFO */ - if (handle->txData != NULL) - { - LPSPI_SlaveTransferFillUpTxFifo(base, handle); - } - - /* Since SPI is a synchronous interface, we only need to enable the RX interrupt if there is RX data. - * The IRQ handler will get the status of RX and TX interrupt flags. - */ - if (handle->rxData != NULL) - { - /*Set rxWatermark to (readRegRemainingTimes-1) if readRegRemainingTimes less than rxWatermark. Otherwise there - *is not RX interrupt for the last datas because the RX count is not greater than rxWatermark. - */ - readRegRemainingTimes = handle->readRegRemainingTimes; - if (readRegRemainingTimes <= (uint32_t)handle->rxWatermark) - { - base->FCR = (base->FCR & (~LPSPI_FCR_RXWATER_MASK)) | LPSPI_FCR_RXWATER(readRegRemainingTimes - 1U); - } - - /* RX request and FIFO overflow request enable */ - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_RxInterruptEnable | (uint32_t)kLPSPI_ReceiveErrorInterruptEnable); - } - else - { - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_TxInterruptEnable); - } - - if (handle->txData != NULL) - { - /* TX FIFO underflow request enable */ - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_TransmitErrorInterruptEnable); - } - - return kStatus_Success; -} - -static void LPSPI_SlaveTransferFillUpTxFifo(LPSPI_Type *base, lpspi_slave_handle_t *handle) -{ - assert(handle != NULL); - - uint32_t wordToSend = 0U; - uint8_t bytesEachWrite = handle->bytesEachWrite; - bool isByteSwap = handle->isByteSwap; - - while (LPSPI_GetTxFifoCount(base) < (handle->fifoSize)) - { - if (handle->txRemainingByteCount < (size_t)bytesEachWrite) - { - handle->bytesEachWrite = (uint8_t)handle->txRemainingByteCount; - bytesEachWrite = handle->bytesEachWrite; - } - - wordToSend = LPSPI_CombineWriteData(handle->txData, bytesEachWrite, isByteSwap); - handle->txData += bytesEachWrite; - - /*Decrease the remaining TX byte count.*/ - handle->txRemainingByteCount -= (size_t)bytesEachWrite; - - /*Write the word to TX register*/ - LPSPI_WriteData(base, wordToSend); - - if (handle->txRemainingByteCount == 0U) - { - break; - } - } -} - -static void LPSPI_SlaveTransferComplete(LPSPI_Type *base, lpspi_slave_handle_t *handle) -{ - assert(handle != NULL); - - status_t status = kStatus_Success; - - /* Disable interrupt requests*/ - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_AllInterruptEnable); - - if (handle->state == (uint8_t)kLPSPI_Error) - { - status = kStatus_LPSPI_Error; - } - else - { - status = kStatus_Success; - } - - handle->state = (uint8_t)kLPSPI_Idle; - - if (handle->callback != NULL) - { - handle->callback(base, handle, status, handle->userData); - } -} - -/*! - * brief Gets the slave transfer remaining bytes. - * - * This function gets the slave transfer remaining bytes. - * - * param base LPSPI peripheral address. - * param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - * param count Number of bytes transferred so far by the non-blocking transaction. - * return status of status_t. - */ -status_t LPSPI_SlaveTransferGetCount(LPSPI_Type *base, lpspi_slave_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (handle->state != (uint8_t)kLPSPI_Busy) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - size_t remainingByte; - - if (handle->rxData != NULL) - { - remainingByte = handle->rxRemainingByteCount; - } - else - { - remainingByte = handle->txRemainingByteCount; - } - - *count = handle->totalByteCount - remainingByte; - - return kStatus_Success; -} - -/*! - * brief LPSPI slave aborts a transfer which uses an interrupt method. - * - * This function aborts a transfer which uses an interrupt method. - * - * param base LPSPI peripheral address. - * param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - */ -void LPSPI_SlaveTransferAbort(LPSPI_Type *base, lpspi_slave_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable interrupt requests*/ - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_TxInterruptEnable | (uint32_t)kLPSPI_RxInterruptEnable); - - LPSPI_Reset(base); - - handle->state = (uint8_t)kLPSPI_Idle; - handle->txRemainingByteCount = 0U; - handle->rxRemainingByteCount = 0U; -} - -/*! - * brief LPSPI Slave IRQ handler function. - * - * This function processes the LPSPI transmit and receives an IRQ. - * - * param instance LPSPI instance index. - * param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - */ -void LPSPI_SlaveTransferHandleIRQ(uint32_t instance, lpspi_slave_handle_t *handle) -{ - assert(handle != NULL); - assert(instance < ARRAY_SIZE(s_lpspiBases)); - LPSPI_Type *base = s_lpspiBases[instance]; - uint32_t readData; /* variable to store word read from RX FIFO */ - uint8_t bytesEachRead = handle->bytesEachRead; - bool isByteSwap = handle->isByteSwap; - uint32_t readRegRemainingTimes; - - if (handle->rxData != NULL) - { - if (handle->rxRemainingByteCount > 0U) - { - while (LPSPI_GetRxFifoCount(base) != 0U) - { - /*Read out the data*/ - readData = LPSPI_ReadData(base); - - /*Decrease the read RX register times.*/ - --handle->readRegRemainingTimes; - - if (handle->rxRemainingByteCount < (size_t)bytesEachRead) - { - handle->bytesEachRead = (uint8_t)handle->rxRemainingByteCount; - bytesEachRead = handle->bytesEachRead; - } - - LPSPI_SeparateReadData(handle->rxData, readData, bytesEachRead, isByteSwap); - handle->rxData += bytesEachRead; - - /*Decrease the remaining RX byte count.*/ - handle->rxRemainingByteCount -= (size_t)bytesEachRead; - - if ((handle->txRemainingByteCount > 0U) && (handle->txData != NULL)) - { - LPSPI_SlaveTransferFillUpTxFifo(base, handle); - } - - if (handle->rxRemainingByteCount == 0U) - { - break; - } - } - } - - /*Set rxWatermark to (readRegRemainingTimes-1) if readRegRemainingTimes less than rxWatermark. Otherwise there - *is not RX interrupt for the last datas because the RX count is not greater than rxWatermark. - */ - readRegRemainingTimes = handle->readRegRemainingTimes; - if (readRegRemainingTimes <= (uint32_t)handle->rxWatermark) - { - base->FCR = (base->FCR & (~LPSPI_FCR_RXWATER_MASK)) | - LPSPI_FCR_RXWATER((readRegRemainingTimes > 1U) ? (readRegRemainingTimes - 1U) : (0U)); - } - } - if ((handle->rxData == NULL) && (handle->txRemainingByteCount != 0U) && (handle->txData != NULL)) - { - LPSPI_SlaveTransferFillUpTxFifo(base, handle); - } - - if ((handle->txRemainingByteCount == 0U) && (handle->rxRemainingByteCount == 0U)) - { - /* If no RX buffer, then transfer is not complete until transfer complete flag sets and the TX FIFO empty*/ - if (handle->rxData == NULL) - { - if (((LPSPI_GetStatusFlags(base) & (uint32_t)kLPSPI_FrameCompleteFlag) != 0U) && - (LPSPI_GetTxFifoCount(base) == 0U)) - { - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_FrameCompleteFlag); - /* Complete the transfer and disable the interrupts */ - LPSPI_SlaveTransferComplete(base, handle); - } - else - { - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_FrameCompleteFlag); - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_FrameCompleteInterruptEnable); - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_TxInterruptEnable | (uint32_t)kLPSPI_RxInterruptEnable); - } - } - else - { - /* Complete the transfer and disable the interrupts */ - LPSPI_SlaveTransferComplete(base, handle); - } - } - - /* Catch tx fifo underflow conditions, service only if tx under flow interrupt enabled */ - if (((LPSPI_GetStatusFlags(base) & (uint32_t)kLPSPI_TransmitErrorFlag) != 0U) && - ((base->IER & LPSPI_IER_TEIE_MASK) != 0U)) - { - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_TransmitErrorFlag); - /* Change state to error and clear flag */ - if (handle->txData != NULL) - { - handle->state = (uint8_t)kLPSPI_Error; - } - handle->errorCount++; - /* ERR051588: Clear FIFO after underrun occurs */ - LPSPI_FlushFifo(base, true, false); - } - /* Catch rx fifo overflow conditions, service only if rx over flow interrupt enabled */ - if (((LPSPI_GetStatusFlags(base) & (uint32_t)kLPSPI_ReceiveErrorFlag) != 0U) && - ((base->IER & LPSPI_IER_REIE_MASK) != 0U)) - { - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_ReceiveErrorFlag); - /* Change state to error and clear flag */ - if (handle->txData != NULL) - { - handle->state = (uint8_t)kLPSPI_Error; - } - handle->errorCount++; - } -} - -static uint32_t LPSPI_CombineWriteData(uint8_t *txData, uint8_t bytesEachWrite, bool isByteSwap) -{ - assert(txData != NULL); - - uint32_t wordToSend = 0U; - - switch (bytesEachWrite) - { - case 1: - wordToSend = *txData; - ++txData; - break; - - case 2: - if (!isByteSwap) - { - wordToSend = *txData; - ++txData; - wordToSend |= (unsigned)(*txData) << 8U; - ++txData; - } - else - { - wordToSend = (unsigned)(*txData) << 8U; - ++txData; - wordToSend |= *txData; - ++txData; - } - - break; - - case 3: - if (!isByteSwap) - { - wordToSend = *txData; - ++txData; - wordToSend |= (unsigned)(*txData) << 8U; - ++txData; - wordToSend |= (unsigned)(*txData) << 16U; - ++txData; - } - else - { - wordToSend = (unsigned)(*txData) << 16U; - ++txData; - wordToSend |= (unsigned)(*txData) << 8U; - ++txData; - wordToSend |= *txData; - ++txData; - } - break; - - case 4: - if (!isByteSwap) - { - wordToSend = *txData; - ++txData; - wordToSend |= (unsigned)(*txData) << 8U; - ++txData; - wordToSend |= (unsigned)(*txData) << 16U; - ++txData; - wordToSend |= (unsigned)(*txData) << 24U; - ++txData; - } - else - { - wordToSend = (unsigned)(*txData) << 24U; - ++txData; - wordToSend |= (unsigned)(*txData) << 16U; - ++txData; - wordToSend |= (unsigned)(*txData) << 8U; - ++txData; - wordToSend |= *txData; - ++txData; - } - break; - - default: - assert(false); - break; - } - return wordToSend; -} - -static void LPSPI_SeparateReadData(uint8_t *rxData, uint32_t readData, uint8_t bytesEachRead, bool isByteSwap) -{ - assert(rxData != NULL); - - switch (bytesEachRead) - { - case 1: - *rxData = (uint8_t)readData; - ++rxData; - break; - - case 2: - if (!isByteSwap) - { - *rxData = (uint8_t)readData; - ++rxData; - *rxData = (uint8_t)(readData >> 8); - ++rxData; - } - else - { - *rxData = (uint8_t)(readData >> 8); - ++rxData; - *rxData = (uint8_t)readData; - ++rxData; - } - break; - - case 3: - if (!isByteSwap) - { - *rxData = (uint8_t)readData; - ++rxData; - *rxData = (uint8_t)(readData >> 8); - ++rxData; - *rxData = (uint8_t)(readData >> 16); - ++rxData; - } - else - { - *rxData = (uint8_t)(readData >> 16); - ++rxData; - *rxData = (uint8_t)(readData >> 8); - ++rxData; - *rxData = (uint8_t)readData; - ++rxData; - } - break; - - case 4: - if (!isByteSwap) - { - *rxData = (uint8_t)readData; - ++rxData; - *rxData = (uint8_t)(readData >> 8); - ++rxData; - *rxData = (uint8_t)(readData >> 16); - ++rxData; - *rxData = (uint8_t)(readData >> 24); - ++rxData; - } - else - { - *rxData = (uint8_t)(readData >> 24); - ++rxData; - *rxData = (uint8_t)(readData >> 16); - ++rxData; - *rxData = (uint8_t)(readData >> 8); - ++rxData; - *rxData = (uint8_t)readData; - ++rxData; - } - break; - - default: - assert(false); - break; - } -} - -static bool LPSPI_TxFifoReady(LPSPI_Type *base) -{ -#if SPI_RETRY_TIMES - uint32_t waitTimes = SPI_RETRY_TIMES; - while (((uint8_t)LPSPI_GetTxFifoCount(base) != 0U) && (--waitTimes != 0U)) -#else - while ((uint8_t)LPSPI_GetTxFifoCount(base) != 0U) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return false; - } -#endif - return true; -} - -void LPSPI_CommonIRQHandler(LPSPI_Type *base, uint32_t instance); -void LPSPI_CommonIRQHandler(LPSPI_Type *base, uint32_t instance) -{ - assert(s_lpspiHandle[instance] != NULL); - if (LPSPI_IsMaster(base)) - { - s_lpspiMasterIsr(instance, (lpspi_master_handle_t *)s_lpspiHandle[instance]); - } - else - { - s_lpspiSlaveIsr(instance, (lpspi_slave_handle_t *)s_lpspiHandle[instance]); - } - SDK_ISR_EXIT_BARRIER; -} - -#if defined(LPSPI14) -void LPSPI14_DriverIRQHandler(void); -void LPSPI14_DriverIRQHandler(void) -{ - LPSPI_CommonIRQHandler(LPSPI14, 14); -} -#endif - -#if defined(LPSPI16) -void LPSPI16_DriverIRQHandler(void); -void LPSPI16_DriverIRQHandler(void) -{ - LPSPI_CommonIRQHandler(LPSPI16, 16); -} -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpspi.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpspi.h deleted file mode 100644 index 54eb4ac8907..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpspi.h +++ /dev/null @@ -1,1175 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LPSPI_H_ -#define FSL_LPSPI_H_ - -#include "fsl_common.h" -#include "fsl_lpflexcomm.h" - -/*! - * @addtogroup lpspi_driver - * @{ - */ - -/********************************************************************************************************************** - * Definitions - *********************************************************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief LPSPI driver version. */ -#define FSL_LPSPI_DRIVER_VERSION (MAKE_VERSION(2, 2, 5)) -/*@}*/ - -#ifndef LPSPI_DUMMY_DATA -/*! @brief LPSPI dummy data if no Tx data.*/ -#define LPSPI_DUMMY_DATA (0x00U) /*!< Dummy data used for tx if there is not txData. */ -#endif - -/*! @brief Retry times for waiting flag. */ -#ifndef SPI_RETRY_TIMES -#define SPI_RETRY_TIMES 0U /* Define to zero means keep waiting until the flag is assert/deassert. */ -#endif - -/*! @brief Global variable for dummy data value setting. */ -extern volatile uint8_t g_lpspiDummyData[]; - -/*! @brief Status for the LPSPI driver.*/ -enum -{ - kStatus_LPSPI_Busy = MAKE_STATUS(kStatusGroup_LPSPI, 0), /*!< LPSPI transfer is busy.*/ - kStatus_LPSPI_Error = MAKE_STATUS(kStatusGroup_LPSPI, 1), /*!< LPSPI driver error. */ - kStatus_LPSPI_Idle = MAKE_STATUS(kStatusGroup_LPSPI, 2), /*!< LPSPI is idle.*/ - kStatus_LPSPI_OutOfRange = MAKE_STATUS(kStatusGroup_LPSPI, 3), /*!< LPSPI transfer out Of range. */ - kStatus_LPSPI_Timeout = MAKE_STATUS(kStatusGroup_LPSPI, 4) /*!< LPSPI timeout polling status flags. */ -}; - -/*! @brief LPSPI status flags in SPIx_SR register.*/ -enum _lpspi_flags -{ - kLPSPI_TxDataRequestFlag = LPSPI_SR_TDF_MASK, /*!< Transmit data flag */ - kLPSPI_RxDataReadyFlag = LPSPI_SR_RDF_MASK, /*!< Receive data flag */ - kLPSPI_WordCompleteFlag = LPSPI_SR_WCF_MASK, /*!< Word Complete flag */ - kLPSPI_FrameCompleteFlag = LPSPI_SR_FCF_MASK, /*!< Frame Complete flag */ - kLPSPI_TransferCompleteFlag = LPSPI_SR_TCF_MASK, /*!< Transfer Complete flag */ - kLPSPI_TransmitErrorFlag = LPSPI_SR_TEF_MASK, /*!< Transmit Error flag (FIFO underrun) */ - kLPSPI_ReceiveErrorFlag = LPSPI_SR_REF_MASK, /*!< Receive Error flag (FIFO overrun) */ - kLPSPI_DataMatchFlag = LPSPI_SR_DMF_MASK, /*!< Data Match flag */ - kLPSPI_ModuleBusyFlag = LPSPI_SR_MBF_MASK, /*!< Module Busy flag */ - kLPSPI_AllStatusFlag = (LPSPI_SR_TDF_MASK | LPSPI_SR_RDF_MASK | LPSPI_SR_WCF_MASK | LPSPI_SR_FCF_MASK | - LPSPI_SR_TCF_MASK | LPSPI_SR_TEF_MASK | LPSPI_SR_REF_MASK | LPSPI_SR_DMF_MASK | - LPSPI_SR_MBF_MASK) /*!< Used for clearing all w1c status flags */ -}; - -/*! @brief LPSPI interrupt source.*/ -enum _lpspi_interrupt_enable -{ - kLPSPI_TxInterruptEnable = LPSPI_IER_TDIE_MASK, /*!< Transmit data interrupt enable */ - kLPSPI_RxInterruptEnable = LPSPI_IER_RDIE_MASK, /*!< Receive data interrupt enable */ - kLPSPI_WordCompleteInterruptEnable = LPSPI_IER_WCIE_MASK, /*!< Word complete interrupt enable */ - kLPSPI_FrameCompleteInterruptEnable = LPSPI_IER_FCIE_MASK, /*!< Frame complete interrupt enable */ - kLPSPI_TransferCompleteInterruptEnable = LPSPI_IER_TCIE_MASK, /*!< Transfer complete interrupt enable */ - kLPSPI_TransmitErrorInterruptEnable = LPSPI_IER_TEIE_MASK, /*!< Transmit error interrupt enable(FIFO underrun)*/ - kLPSPI_ReceiveErrorInterruptEnable = LPSPI_IER_REIE_MASK, /*!< Receive Error interrupt enable (FIFO overrun) */ - kLPSPI_DataMatchInterruptEnable = LPSPI_IER_DMIE_MASK, /*!< Data Match interrupt enable */ - kLPSPI_AllInterruptEnable = - (LPSPI_IER_TDIE_MASK | LPSPI_IER_RDIE_MASK | LPSPI_IER_WCIE_MASK | LPSPI_IER_FCIE_MASK | LPSPI_IER_TCIE_MASK | - LPSPI_IER_TEIE_MASK | LPSPI_IER_REIE_MASK | LPSPI_IER_DMIE_MASK) /*!< All above interrupts enable.*/ -}; - -/*! @brief LPSPI DMA source.*/ -enum _lpspi_dma_enable -{ - kLPSPI_TxDmaEnable = LPSPI_DER_TDDE_MASK, /*!< Transmit data DMA enable */ - kLPSPI_RxDmaEnable = LPSPI_DER_RDDE_MASK /*!< Receive data DMA enable */ -}; - -/*! @brief LPSPI master or slave mode configuration.*/ -typedef enum _lpspi_master_slave_mode -{ - kLPSPI_Master = 1U, /*!< LPSPI peripheral operates in master mode.*/ - kLPSPI_Slave = 0U /*!< LPSPI peripheral operates in slave mode.*/ -} lpspi_master_slave_mode_t; - -/*! @brief LPSPI Peripheral Chip Select (PCS) configuration (which PCS to configure).*/ -typedef enum _lpspi_which_pcs_config -{ - kLPSPI_Pcs0 = 0U, /*!< PCS[0] */ - kLPSPI_Pcs1 = 1U, /*!< PCS[1] */ - kLPSPI_Pcs2 = 2U, /*!< PCS[2] */ - kLPSPI_Pcs3 = 3U /*!< PCS[3] */ -} lpspi_which_pcs_t; - -/*! @brief LPSPI Peripheral Chip Select (PCS) Polarity configuration.*/ -typedef enum _lpspi_pcs_polarity_config -{ - kLPSPI_PcsActiveHigh = 1U, /*!< PCS Active High (idles low) */ - kLPSPI_PcsActiveLow = 0U /*!< PCS Active Low (idles high) */ -} lpspi_pcs_polarity_config_t; - -/*! @brief LPSPI Peripheral Chip Select (PCS) Polarity.*/ -enum _lpspi_pcs_polarity -{ - kLPSPI_Pcs0ActiveLow = 1U << 0, /*!< Pcs0 Active Low (idles high). */ - kLPSPI_Pcs1ActiveLow = 1U << 1, /*!< Pcs1 Active Low (idles high). */ - kLPSPI_Pcs2ActiveLow = 1U << 2, /*!< Pcs2 Active Low (idles high). */ - kLPSPI_Pcs3ActiveLow = 1U << 3, /*!< Pcs3 Active Low (idles high). */ - kLPSPI_PcsAllActiveLow = 0xFU /*!< Pcs0 to Pcs5 Active Low (idles high). */ -}; - -/*! @brief LPSPI clock polarity configuration.*/ -typedef enum _lpspi_clock_polarity -{ - kLPSPI_ClockPolarityActiveHigh = 0U, /*!< CPOL=0. Active-high LPSPI clock (idles low)*/ - kLPSPI_ClockPolarityActiveLow = 1U /*!< CPOL=1. Active-low LPSPI clock (idles high)*/ -} lpspi_clock_polarity_t; - -/*! @brief LPSPI clock phase configuration.*/ -typedef enum _lpspi_clock_phase -{ - kLPSPI_ClockPhaseFirstEdge = 0U, /*!< CPHA=0. Data is captured on the leading edge of the SCK and changed on the - following edge.*/ - kLPSPI_ClockPhaseSecondEdge = 1U /*!< CPHA=1. Data is changed on the leading edge of the SCK and captured on the - following edge.*/ -} lpspi_clock_phase_t; - -/*! @brief LPSPI data shifter direction options.*/ -typedef enum _lpspi_shift_direction -{ - kLPSPI_MsbFirst = 0U, /*!< Data transfers start with most significant bit.*/ - kLPSPI_LsbFirst = 1U /*!< Data transfers start with least significant bit.*/ -} lpspi_shift_direction_t; - -/*! @brief LPSPI Host Request select configuration. */ -typedef enum _lpspi_host_request_select -{ - kLPSPI_HostReqExtPin = 0U, /*!< Host Request is an ext pin. */ - kLPSPI_HostReqInternalTrigger = 1U /*!< Host Request is an internal trigger. */ -} lpspi_host_request_select_t; - -/*! @brief LPSPI Match configuration options. */ -typedef enum _lpspi_match_config -{ - kLPSI_MatchDisabled = 0x0U, /*!< LPSPI Match Disabled. */ - kLPSI_1stWordEqualsM0orM1 = 0x2U, /*!< LPSPI Match Enabled. */ - kLPSI_AnyWordEqualsM0orM1 = 0x3U, /*!< LPSPI Match Enabled. */ - kLPSI_1stWordEqualsM0and2ndWordEqualsM1 = 0x4U, /*!< LPSPI Match Enabled. */ - kLPSI_AnyWordEqualsM0andNxtWordEqualsM1 = 0x5U, /*!< LPSPI Match Enabled. */ - kLPSI_1stWordAndM1EqualsM0andM1 = 0x6U, /*!< LPSPI Match Enabled. */ - kLPSI_AnyWordAndM1EqualsM0andM1 = 0x7U, /*!< LPSPI Match Enabled. */ -} lpspi_match_config_t; - -/*! @brief LPSPI pin (SDO and SDI) configuration. */ -typedef enum _lpspi_pin_config -{ - kLPSPI_SdiInSdoOut = 0U, /*!< LPSPI SDI input, SDO output. */ - kLPSPI_SdiInSdiOut = 1U, /*!< LPSPI SDI input, SDI output. */ - kLPSPI_SdoInSdoOut = 2U, /*!< LPSPI SDO input, SDO output. */ - kLPSPI_SdoInSdiOut = 3U /*!< LPSPI SDO input, SDI output. */ -} lpspi_pin_config_t; - -/*! @brief LPSPI data output configuration. */ -typedef enum _lpspi_data_out_config -{ - kLpspiDataOutRetained = 0U, /*!< Data out retains last value when chip select is de-asserted */ - kLpspiDataOutTristate = 1U /*!< Data out is tristated when chip select is de-asserted */ -} lpspi_data_out_config_t; - -/*! @brief LPSPI cs function configuration. */ -typedef enum _lpspi_pcs_function_config -{ - kLPSPI_PcsAsCs = 0U, /*!< PCS pin select as cs function */ - kLPSPI_PcsAsData = 1U, /*!< PCS pin select as date function */ -} lpspi_pcs_function_config_t; - -/*! @brief LPSPI transfer width configuration. */ -typedef enum _lpspi_transfer_width -{ - kLPSPI_SingleBitXfer = 0U, /*!< 1-bit shift at a time, data out on SDO, in on SDI (normal mode) */ - kLPSPI_TwoBitXfer = 1U, /*!< 2-bits shift out on SDO/SDI and in on SDO/SDI */ - kLPSPI_FourBitXfer = 2U /*!< 4-bits shift out on SDO/SDI/PCS[3:2] and in on SDO/SDI/PCS[3:2] */ -} lpspi_transfer_width_t; - -/*! @brief LPSPI delay type selection.*/ -typedef enum _lpspi_delay_type -{ - kLPSPI_PcsToSck = 1U, /*!< PCS-to-SCK delay. */ - kLPSPI_LastSckToPcs, /*!< Last SCK edge to PCS delay. */ - kLPSPI_BetweenTransfer /*!< Delay between transfers. */ -} lpspi_delay_type_t; - -#define LPSPI_MASTER_PCS_SHIFT (4U) /*!< LPSPI master PCS shift macro , internal used. */ -#define LPSPI_MASTER_PCS_MASK (0xF0U) /*!< LPSPI master PCS shift macro , internal used. */ - -#define LPSPI_MASTER_WIDTH_SHIFT (16U) /*!< LPSPI master width shift macro, internal used */ -#define LPSPI_MASTER_WIDTH_MASK (0x30000U) /*!< LPSPI master width shift mask, internal used */ - -/*! @brief Use this enumeration for LPSPI master transfer configFlags. */ -enum _lpspi_transfer_config_flag_for_master -{ - kLPSPI_MasterPcs0 = 0U << LPSPI_MASTER_PCS_SHIFT, /*!< LPSPI master transfer use PCS0 signal */ - kLPSPI_MasterPcs1 = 1U << LPSPI_MASTER_PCS_SHIFT, /*!< LPSPI master transfer use PCS1 signal */ - kLPSPI_MasterPcs2 = 2U << LPSPI_MASTER_PCS_SHIFT, /*!< LPSPI master transfer use PCS2 signal */ - kLPSPI_MasterPcs3 = 3U << LPSPI_MASTER_PCS_SHIFT, /*!< LPSPI master transfer use PCS3 signal */ - - kLPSPI_MasterWidth1 = 0U << LPSPI_MASTER_WIDTH_SHIFT, /*!< LPSPI master transfer 1bit */ - kLPSPI_MasterWidth2 = 1U << LPSPI_MASTER_WIDTH_SHIFT, /*!< LPSPI master transfer 2bit */ - kLPSPI_MasterWidth4 = 2U << LPSPI_MASTER_WIDTH_SHIFT, /*!< LPSPI master transfer 4bit */ - - kLPSPI_MasterPcsContinuous = 1U << 20, /*!< Is PCS signal continuous */ - - kLPSPI_MasterByteSwap = - 1U << 22 /*!< Is master swap the byte. - * For example, when want to send data 1 2 3 4 5 6 7 8 (suppose you set - * lpspi_shift_direction_t to MSB). - * 1. If you set bitPerFrame = 8 , no matter the kLPSPI_MasterByteSwapyou flag is used - * or not, the waveform is 1 2 3 4 5 6 7 8. - * 2. If you set bitPerFrame = 16 : - * (1) the waveform is 2 1 4 3 6 5 8 7 if you do not use the kLPSPI_MasterByteSwap flag. - * (2) the waveform is 1 2 3 4 5 6 7 8 if you use the kLPSPI_MasterByteSwap flag. - * 3. If you set bitPerFrame = 32 : - * (1) the waveform is 4 3 2 1 8 7 6 5 if you do not use the kLPSPI_MasterByteSwap flag. - * (2) the waveform is 1 2 3 4 5 6 7 8 if you use the kLPSPI_MasterByteSwap flag. - */ -}; - -#define LPSPI_SLAVE_PCS_SHIFT (4U) /*!< LPSPI slave PCS shift macro , internal used. */ -#define LPSPI_SLAVE_PCS_MASK (0xF0U) /*!< LPSPI slave PCS shift macro , internal used. */ - -/*! @brief Use this enumeration for LPSPI slave transfer configFlags. */ -enum _lpspi_transfer_config_flag_for_slave -{ - kLPSPI_SlavePcs0 = 0U << LPSPI_SLAVE_PCS_SHIFT, /*!< LPSPI slave transfer use PCS0 signal */ - kLPSPI_SlavePcs1 = 1U << LPSPI_SLAVE_PCS_SHIFT, /*!< LPSPI slave transfer use PCS1 signal */ - kLPSPI_SlavePcs2 = 2U << LPSPI_SLAVE_PCS_SHIFT, /*!< LPSPI slave transfer use PCS2 signal */ - kLPSPI_SlavePcs3 = 3U << LPSPI_SLAVE_PCS_SHIFT, /*!< LPSPI slave transfer use PCS3 signal */ - - kLPSPI_SlaveByteSwap = - 1U << 22 /*!< Is slave swap the byte. - * For example, when want to send data 1 2 3 4 5 6 7 8 (suppose you set - * lpspi_shift_direction_t to MSB). - * 1. If you set bitPerFrame = 8 , no matter the kLPSPI_SlaveByteSwap flag is used - * or not, the waveform is 1 2 3 4 5 6 7 8. - * 2. If you set bitPerFrame = 16 : - * (1) the waveform is 2 1 4 3 6 5 8 7 if you do not use the kLPSPI_SlaveByteSwap flag. - * (2) the waveform is 1 2 3 4 5 6 7 8 if you use the kLPSPI_SlaveByteSwap flag. - * 3. If you set bitPerFrame = 32 : - * (1) the waveform is 4 3 2 1 8 7 6 5 if you do not use the kLPSPI_SlaveByteSwap flag. - * (2) the waveform is 1 2 3 4 5 6 7 8 if you use the kLPSPI_SlaveByteSwap flag. - */ -}; - -/*! @brief LPSPI transfer state, which is used for LPSPI transactional API state machine. */ -enum _lpspi_transfer_state -{ - kLPSPI_Idle = 0x0U, /*!< Nothing in the transmitter/receiver. */ - kLPSPI_Busy, /*!< Transfer queue is not finished. */ - kLPSPI_Error /*!< Transfer error. */ -}; - -/*! @brief LPSPI master configuration structure.*/ -typedef struct _lpspi_master_config -{ - uint32_t baudRate; /*!< Baud Rate for LPSPI. */ - uint32_t bitsPerFrame; /*!< Bits per frame, minimum 8, maximum 4096.*/ - lpspi_clock_polarity_t cpol; /*!< Clock polarity. */ - lpspi_clock_phase_t cpha; /*!< Clock phase. */ - lpspi_shift_direction_t direction; /*!< MSB or LSB data shift direction. */ - - uint32_t pcsToSckDelayInNanoSec; /*!< PCS to SCK delay time in nanoseconds, setting to 0 sets the minimum delay. - It sets the boundary value if out of range.*/ - uint32_t lastSckToPcsDelayInNanoSec; /*!< Last SCK to PCS delay time in nanoseconds, setting to 0 sets the minimum - delay. It sets the boundary value if out of range.*/ - uint32_t betweenTransferDelayInNanoSec; /*!< After the SCK delay time with nanoseconds, setting to 0 sets the - minimum delay. It sets the boundary value if out of range.*/ - - lpspi_which_pcs_t whichPcs; /*!< Desired Peripheral Chip Select (PCS). */ - lpspi_pcs_polarity_config_t pcsActiveHighOrLow; /*!< Desired PCS active high or low */ - - lpspi_pin_config_t pinCfg; /*!< Configures which pins are used for input and output data - *during single bit transfers.*/ - - lpspi_pcs_function_config_t pcsFunc; /*!< Configures cs pins function.*/ - - lpspi_data_out_config_t dataOutConfig; /*!< Configures if the output data is tristated - * between accesses (LPSPI_PCS is negated). */ - bool enableInputDelay; /*!< Enable master to sample the input data on a delayed SCK. This can help improve slave - setup time. Refer to device data sheet for specific time length. */ -} lpspi_master_config_t; - -/*! @brief LPSPI slave configuration structure.*/ -typedef struct _lpspi_slave_config -{ - uint32_t bitsPerFrame; /*!< Bits per frame, minimum 8, maximum 4096.*/ - lpspi_clock_polarity_t cpol; /*!< Clock polarity. */ - lpspi_clock_phase_t cpha; /*!< Clock phase. */ - lpspi_shift_direction_t direction; /*!< MSB or LSB data shift direction. */ - - lpspi_which_pcs_t whichPcs; /*!< Desired Peripheral Chip Select (pcs) */ - lpspi_pcs_polarity_config_t pcsActiveHighOrLow; /*!< Desired PCS active high or low */ - - lpspi_pin_config_t pinCfg; /*!< Configures which pins are used for input and output data - *during single bit transfers.*/ - - lpspi_data_out_config_t dataOutConfig; /*!< Configures if the output data is tristated - * between accesses (LPSPI_PCS is negated). */ -} lpspi_slave_config_t; - -/*! - * @brief Forward declaration of the _lpspi_master_handle typedefs. - */ -typedef struct _lpspi_master_handle lpspi_master_handle_t; - -/*! - * @brief Forward declaration of the _lpspi_slave_handle typedefs. - */ -typedef struct _lpspi_slave_handle lpspi_slave_handle_t; - -/*! - * @brief Master completion callback function pointer type. - * - * @param base LPSPI peripheral address. - * @param handle Pointer to the handle for the LPSPI master. - * @param status Success or error code describing whether the transfer is completed. - * @param userData Arbitrary pointer-dataSized value passed from the application. - */ -typedef void (*lpspi_master_transfer_callback_t)(LPSPI_Type *base, - lpspi_master_handle_t *handle, - status_t status, - void *userData); - -/*! - * @brief Slave completion callback function pointer type. - * - * @param base LPSPI peripheral address. - * @param handle Pointer to the handle for the LPSPI slave. - * @param status Success or error code describing whether the transfer is completed. - * @param userData Arbitrary pointer-dataSized value passed from the application. - */ -typedef void (*lpspi_slave_transfer_callback_t)(LPSPI_Type *base, - lpspi_slave_handle_t *handle, - status_t status, - void *userData); - -/*! @brief LPSPI master/slave transfer structure.*/ -typedef struct _lpspi_transfer -{ - uint8_t *txData; /*!< Send buffer. */ - uint8_t *rxData; /*!< Receive buffer. */ - volatile size_t dataSize; /*!< Transfer bytes. */ - - uint32_t configFlags; /*!< Transfer transfer configuration flags. Set from _lpspi_transfer_config_flag_for_master if - the transfer is used for master or _lpspi_transfer_config_flag_for_slave enumeration if the - transfer is used for slave.*/ -} lpspi_transfer_t; - -/*! @brief LPSPI master transfer handle structure used for transactional API. */ -struct _lpspi_master_handle -{ - volatile bool isPcsContinuous; /*!< Is PCS continuous in transfer. */ - volatile bool writeTcrInIsr; /*!< A flag that whether should write TCR in ISR. */ - - volatile bool isByteSwap; /*!< A flag that whether should byte swap. */ - volatile bool isTxMask; /*!< A flag that whether TCR[TXMSK] is set. */ - volatile uint16_t bytesPerFrame; /*!< Number of bytes in each frame */ - - volatile uint8_t fifoSize; /*!< FIFO dataSize. */ - - volatile uint8_t rxWatermark; /*!< Rx watermark. */ - - volatile uint8_t bytesEachWrite; /*!< Bytes for each write TDR. */ - volatile uint8_t bytesEachRead; /*!< Bytes for each read RDR. */ - - uint8_t *volatile txData; /*!< Send buffer. */ - uint8_t *volatile rxData; /*!< Receive buffer. */ - volatile size_t txRemainingByteCount; /*!< Number of bytes remaining to send.*/ - volatile size_t rxRemainingByteCount; /*!< Number of bytes remaining to receive.*/ - - volatile uint32_t writeRegRemainingTimes; /*!< Write TDR register remaining times. */ - volatile uint32_t readRegRemainingTimes; /*!< Read RDR register remaining times. */ - - uint32_t totalByteCount; /*!< Number of transfer bytes*/ - - uint32_t txBuffIfNull; /*!< Used if the txData is NULL. */ - - volatile uint8_t state; /*!< LPSPI transfer state , _lpspi_transfer_state.*/ - - lpspi_master_transfer_callback_t callback; /*!< Completion callback. */ - void *userData; /*!< Callback user data. */ -}; - -/*! @brief LPSPI slave transfer handle structure used for transactional API. */ -struct _lpspi_slave_handle -{ - volatile bool isByteSwap; /*!< A flag that whether should byte swap. */ - - volatile uint8_t fifoSize; /*!< FIFO dataSize. */ - - volatile uint8_t rxWatermark; /*!< Rx watermark. */ - - volatile uint8_t bytesEachWrite; /*!< Bytes for each write TDR. */ - volatile uint8_t bytesEachRead; /*!< Bytes for each read RDR. */ - - uint8_t *volatile txData; /*!< Send buffer. */ - uint8_t *volatile rxData; /*!< Receive buffer. */ - - volatile size_t txRemainingByteCount; /*!< Number of bytes remaining to send.*/ - volatile size_t rxRemainingByteCount; /*!< Number of bytes remaining to receive.*/ - - volatile uint32_t writeRegRemainingTimes; /*!< Write TDR register remaining times. */ - volatile uint32_t readRegRemainingTimes; /*!< Read RDR register remaining times. */ - - uint32_t totalByteCount; /*!< Number of transfer bytes*/ - - volatile uint8_t state; /*!< LPSPI transfer state , _lpspi_transfer_state.*/ - - volatile uint32_t errorCount; /*!< Error count for slave transfer.*/ - - lpspi_slave_transfer_callback_t callback; /*!< Completion callback. */ - void *userData; /*!< Callback user data. */ -}; - -/********************************************************************************************************************** - * API - *********************************************************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus*/ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Initializes the LPSPI master. - * - * @param base LPSPI peripheral address. - * @param masterConfig Pointer to structure lpspi_master_config_t. - * @param srcClock_Hz Module source input clock in Hertz - */ -void LPSPI_MasterInit(LPSPI_Type *base, const lpspi_master_config_t *masterConfig, uint32_t srcClock_Hz); - -/*! - * @brief Sets the lpspi_master_config_t structure to default values. - * - * This API initializes the configuration structure for LPSPI_MasterInit(). - * The initialized structure can remain unchanged in LPSPI_MasterInit(), or can be modified - * before calling the LPSPI_MasterInit(). - * Example: - * @code - * lpspi_master_config_t masterConfig; - * LPSPI_MasterGetDefaultConfig(&masterConfig); - * @endcode - * @param masterConfig pointer to lpspi_master_config_t structure - */ -void LPSPI_MasterGetDefaultConfig(lpspi_master_config_t *masterConfig); - -/*! - * @brief LPSPI slave configuration. - * - * @param base LPSPI peripheral address. - * @param slaveConfig Pointer to a structure lpspi_slave_config_t. - */ -void LPSPI_SlaveInit(LPSPI_Type *base, const lpspi_slave_config_t *slaveConfig); - -/*! - * @brief Sets the lpspi_slave_config_t structure to default values. - * - * This API initializes the configuration structure for LPSPI_SlaveInit(). - * The initialized structure can remain unchanged in LPSPI_SlaveInit() or can be modified - * before calling the LPSPI_SlaveInit(). - * Example: - * @code - * lpspi_slave_config_t slaveConfig; - * LPSPI_SlaveGetDefaultConfig(&slaveConfig); - * @endcode - * @param slaveConfig pointer to lpspi_slave_config_t structure. - */ -void LPSPI_SlaveGetDefaultConfig(lpspi_slave_config_t *slaveConfig); - -/*! - * @brief De-initializes the LPSPI peripheral. Call this API to disable the LPSPI clock. - * @param base LPSPI peripheral address. - */ -void LPSPI_Deinit(LPSPI_Type *base); - -/*! - * @brief Restores the LPSPI peripheral to reset state. Note that this function - * sets all registers to reset state. As a result, the LPSPI module can't work after calling - * this API. - * @param base LPSPI peripheral address. - */ -void LPSPI_Reset(LPSPI_Type *base); - -/*! - * @brief Get the LPSPI instance from peripheral base address. - * - * @param base LPSPI peripheral base address. - * @return LPSPI instance. - */ -uint32_t LPSPI_GetInstance(LPSPI_Type *base); - -/*! - * @brief Enables the LPSPI peripheral and sets the MCR MDIS to 0. - * - * @param base LPSPI peripheral address. - * @param enable Pass true to enable module, false to disable module. - */ -static inline void LPSPI_Enable(LPSPI_Type *base, bool enable) -{ - if (enable) - { - base->CR |= LPSPI_CR_MEN_MASK; - } - else - { - base->CR &= ~LPSPI_CR_MEN_MASK; - } -} - -/*! - *@} - */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets the LPSPI status flag state. - * @param base LPSPI peripheral address. - * @return The LPSPI status(in SR register). - */ -static inline uint32_t LPSPI_GetStatusFlags(LPSPI_Type *base) -{ - return (base->SR); -} - -/*! - * @brief Gets the LPSPI Tx FIFO size. - * @param base LPSPI peripheral address. - * @return The LPSPI Tx FIFO size. - */ -static inline uint8_t LPSPI_GetTxFifoSize(LPSPI_Type *base) -{ - return (1U << ((base->PARAM & LPSPI_PARAM_TXFIFO_MASK) >> LPSPI_PARAM_TXFIFO_SHIFT)); -} - -/*! - * @brief Gets the LPSPI Rx FIFO size. - * @param base LPSPI peripheral address. - * @return The LPSPI Rx FIFO size. - */ -static inline uint8_t LPSPI_GetRxFifoSize(LPSPI_Type *base) -{ - return (1U << ((base->PARAM & LPSPI_PARAM_RXFIFO_MASK) >> LPSPI_PARAM_RXFIFO_SHIFT)); -} - -/*! - * @brief Gets the LPSPI Tx FIFO count. - * @param base LPSPI peripheral address. - * @return The number of words in the transmit FIFO. - */ -static inline uint32_t LPSPI_GetTxFifoCount(LPSPI_Type *base) -{ - return ((base->FSR & LPSPI_FSR_TXCOUNT_MASK) >> LPSPI_FSR_TXCOUNT_SHIFT); -} - -/*! - * @brief Gets the LPSPI Rx FIFO count. - * @param base LPSPI peripheral address. - * @return The number of words in the receive FIFO. - */ -static inline uint32_t LPSPI_GetRxFifoCount(LPSPI_Type *base) -{ - return ((base->FSR & LPSPI_FSR_RXCOUNT_MASK) >> LPSPI_FSR_RXCOUNT_SHIFT); -} - -/*! - * @brief Clears the LPSPI status flag. - * - * This function clears the desired status bit by using a write-1-to-clear. The user passes in the base and the - * desired status flag bit to clear. The list of status flags is defined in the _lpspi_flags. - * Example usage: - * @code - * LPSPI_ClearStatusFlags(base, kLPSPI_TxDataRequestFlag|kLPSPI_RxDataReadyFlag); - * @endcode - * - * @param base LPSPI peripheral address. - * @param statusFlags The status flag used from type _lpspi_flags. - */ -static inline void LPSPI_ClearStatusFlags(LPSPI_Type *base, uint32_t statusFlags) -{ - base->SR = statusFlags; /*!< The status flags are cleared by writing 1 (w1c).*/ -} - -/*! - *@} - */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables the LPSPI interrupts. - * - * This function configures the various interrupt masks of the LPSPI. The parameters are base and an interrupt mask. - * Note that, for Tx fill and Rx FIFO drain requests, enabling the interrupt request disables the DMA request. - * - * @code - * LPSPI_EnableInterrupts(base, kLPSPI_TxInterruptEnable | kLPSPI_RxInterruptEnable ); - * @endcode - * - * @param base LPSPI peripheral address. - * @param mask The interrupt mask; Use the enum _lpspi_interrupt_enable. - */ -static inline void LPSPI_EnableInterrupts(LPSPI_Type *base, uint32_t mask) -{ - base->IER |= mask; -} - -/*! - * @brief Disables the LPSPI interrupts. - * - * @code - * LPSPI_DisableInterrupts(base, kLPSPI_TxInterruptEnable | kLPSPI_RxInterruptEnable ); - * @endcode - * - * @param base LPSPI peripheral address. - * @param mask The interrupt mask; Use the enum _lpspi_interrupt_enable. - */ -static inline void LPSPI_DisableInterrupts(LPSPI_Type *base, uint32_t mask) -{ - base->IER &= ~mask; -} - -/*! - *@} - */ - -/*! - * @name DMA Control - * @{ - */ - -/*! - * @brief Enables the LPSPI DMA request. - * - * This function configures the Rx and Tx DMA mask of the LPSPI. The parameters are base and a DMA mask. - * @code - * LPSPI_EnableDMA(base, kLPSPI_TxDmaEnable | kLPSPI_RxDmaEnable); - * @endcode - * - * @param base LPSPI peripheral address. - * @param mask The interrupt mask; Use the enum _lpspi_dma_enable. - */ -static inline void LPSPI_EnableDMA(LPSPI_Type *base, uint32_t mask) -{ - base->DER |= mask; -} - -/*! - * @brief Disables the LPSPI DMA request. - * - * This function configures the Rx and Tx DMA mask of the LPSPI. The parameters are base and a DMA mask. - * @code - * SPI_DisableDMA(base, kLPSPI_TxDmaEnable | kLPSPI_RxDmaEnable); - * @endcode - * - * @param base LPSPI peripheral address. - * @param mask The interrupt mask; Use the enum _lpspi_dma_enable. - */ -static inline void LPSPI_DisableDMA(LPSPI_Type *base, uint32_t mask) -{ - base->DER &= ~mask; -} - -/*! - * @brief Gets the LPSPI Transmit Data Register address for a DMA operation. - * - * This function gets the LPSPI Transmit Data Register address because this value is needed - * for the DMA operation. - * This function can be used for either master or slave mode. - * - * @param base LPSPI peripheral address. - * @return The LPSPI Transmit Data Register address. - */ -static inline uint32_t LPSPI_GetTxRegisterAddress(LPSPI_Type *base) -{ - return (uint32_t) & (base->TDR); -} - -/*! - * @brief Gets the LPSPI Receive Data Register address for a DMA operation. - * - * This function gets the LPSPI Receive Data Register address because this value is needed - * for the DMA operation. - * This function can be used for either master or slave mode. - * - * @param base LPSPI peripheral address. - * @return The LPSPI Receive Data Register address. - */ -static inline uint32_t LPSPI_GetRxRegisterAddress(LPSPI_Type *base) -{ - return (uint32_t) & (base->RDR); -} - -/*! - *@} - */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Check the argument for transfer . - * - * @param base LPSPI peripheral address. - * @param transfer the transfer struct to be used. - * @param isEdma True to check for EDMA transfer, false to check interrupt non-blocking transfer - * @return Return true for right and false for wrong. - */ -bool LPSPI_CheckTransferArgument(LPSPI_Type *base, lpspi_transfer_t *transfer, bool isEdma); - -/*! - * @brief Configures the LPSPI for either master or slave. - * - * Note that the CFGR1 should only be written when the LPSPI is disabled (LPSPIx_CR_MEN = 0). - * - * @param base LPSPI peripheral address. - * @param mode Mode setting (master or slave) of type lpspi_master_slave_mode_t. - */ -static inline void LPSPI_SetMasterSlaveMode(LPSPI_Type *base, lpspi_master_slave_mode_t mode) -{ - base->CFGR1 = (base->CFGR1 & (~LPSPI_CFGR1_MASTER_MASK)) | LPSPI_CFGR1_MASTER(mode); -} - -/*! - * @brief Configures the peripheral chip select used for the transfer. - * - * @param base LPSPI peripheral address. - * @param select LPSPI Peripheral Chip Select (PCS) configuration. - */ -static inline void LPSPI_SelectTransferPCS(LPSPI_Type *base, lpspi_which_pcs_t select) -{ - base->TCR = (base->TCR & (~LPSPI_TCR_PCS_MASK)) | LPSPI_TCR_PCS((uint8_t)select); -} - -/*! - * @brief Set the PCS signal to continuous or uncontinuous mode. - * - * @note In master mode, continuous transfer will keep the PCS asserted at the end of the frame size, until a command - * word is received that starts a new frame. So PCS must be set back to uncontinuous when transfer finishes. - * In slave mode, when continuous transfer is enabled, the LPSPI will only transmit the first frame size bits, after - * that the LPSPI will transmit received data back (assuming a 32-bit shift register). - * - * @param base LPSPI peripheral address. - * @param IsContinous True to set the transfer PCS to continuous mode, false to set to uncontinuous mode. - */ -static inline void LPSPI_SetPCSContinous(LPSPI_Type *base, bool IsContinous) -{ - if (IsContinous) - { - base->TCR |= LPSPI_TCR_CONT_MASK; - } - else - { - base->TCR &= ~LPSPI_TCR_CONT_MASK; - } -} - -/*! - * @brief Returns whether the LPSPI module is in master mode. - * - * @param base LPSPI peripheral address. - * @return Returns true if the module is in master mode or false if the module is in slave mode. - */ -static inline bool LPSPI_IsMaster(LPSPI_Type *base) -{ - return (bool)((base->CFGR1) & LPSPI_CFGR1_MASTER_MASK); -} - -/*! - * @brief Flushes the LPSPI FIFOs. - * - * @param base LPSPI peripheral address. - * @param flushTxFifo Flushes (true) the Tx FIFO, else do not flush (false) the Tx FIFO. - * @param flushRxFifo Flushes (true) the Rx FIFO, else do not flush (false) the Rx FIFO. - */ -static inline void LPSPI_FlushFifo(LPSPI_Type *base, bool flushTxFifo, bool flushRxFifo) -{ - base->CR |= ((uint32_t)flushTxFifo << LPSPI_CR_RTF_SHIFT) | ((uint32_t)flushRxFifo << LPSPI_CR_RRF_SHIFT); -} - -/*! - * @brief Sets the transmit and receive FIFO watermark values. - * - * This function allows the user to set the receive and transmit FIFO watermarks. The function - * does not compare the watermark settings to the FIFO size. The FIFO watermark should not be - * equal to or greater than the FIFO size. It is up to the higher level driver to make this check. - * - * @param base LPSPI peripheral address. - * @param txWater The TX FIFO watermark value. Writing a value equal or greater than the FIFO size is truncated. - * @param rxWater The RX FIFO watermark value. Writing a value equal or greater than the FIFO size is truncated. - */ -static inline void LPSPI_SetFifoWatermarks(LPSPI_Type *base, uint32_t txWater, uint32_t rxWater) -{ - base->FCR = LPSPI_FCR_TXWATER(txWater) | LPSPI_FCR_RXWATER(rxWater); -} - -/*! - * @brief Configures all LPSPI peripheral chip select polarities simultaneously. - * - * Note that the CFGR1 should only be written when the LPSPI is disabled (LPSPIx_CR_MEN = 0). - * - * This is an example: PCS0 and PCS1 set to active low and other PCSs set to active high. Note that the number of - * PCS is device-specific. - * @code - * LPSPI_SetAllPcsPolarity(base, kLPSPI_Pcs0ActiveLow | kLPSPI_Pcs1ActiveLow); - * @endcode - * - * @param base LPSPI peripheral address. - * @param mask The PCS polarity mask; Use the enum _lpspi_pcs_polarity. - */ -static inline void LPSPI_SetAllPcsPolarity(LPSPI_Type *base, uint32_t mask) -{ - base->CFGR1 = (base->CFGR1 & ~LPSPI_CFGR1_PCSPOL_MASK) | LPSPI_CFGR1_PCSPOL(~mask); -} - -/*! - * @brief Configures the frame size. - * - * The minimum frame size is 8-bits and the maximum frame size is 4096-bits. If the frame size is less than or equal - * to 32-bits, the word size and frame size are identical. If the frame size is greater than 32-bits, the word - * size is 32-bits for each word except the last (the last word contains the remainder bits if the frame size is not - * divisible by 32). The minimum word size is 2-bits. A frame size of 33-bits (or similar) is not supported. - * - * Note 1: The transmit command register should be initialized before enabling the LPSPI in slave mode, although - * the command register does not update until after the LPSPI is enabled. After it is enabled, the transmit command - * register - * should only be changed if the LPSPI is idle. - * - * Note 2: The transmit and command FIFO is a combined FIFO that includes both transmit data and command words. That - * means the TCR register should be written to when the Tx FIFO is not full. - * - * @param base LPSPI peripheral address. - * @param frameSize The frame size in number of bits. - */ -static inline void LPSPI_SetFrameSize(LPSPI_Type *base, uint32_t frameSize) -{ - base->TCR = (base->TCR & ~LPSPI_TCR_FRAMESZ_MASK) | LPSPI_TCR_FRAMESZ(frameSize - 1U); -} - -/*! - * @brief Sets the LPSPI baud rate in bits per second. - * - * This function takes in the desired bitsPerSec (baud rate) and calculates the nearest - * possible baud rate without exceeding the desired baud rate and returns the - * calculated baud rate in bits-per-second. It requires the caller to provide - * the frequency of the module source clock (in Hertz). Note that the baud rate - * does not go into effect until the Transmit Control Register (TCR) is programmed - * with the prescale value. Hence, this function returns the prescale tcrPrescaleValue - * parameter for later programming in the TCR. The higher level - * peripheral driver should alert the user of an out of range baud rate input. - * - * Note that the LPSPI module must first be disabled before configuring this. - * Note that the LPSPI module must be configured for master mode before configuring this. - * - * @param base LPSPI peripheral address. - * @param baudRate_Bps The desired baud rate in bits per second. - * @param srcClock_Hz Module source input clock in Hertz. - * @param tcrPrescaleValue The TCR prescale value needed to program the TCR. - * @return The actual calculated baud rate. This function may also return a "0" if the - * LPSPI is not configured for master mode or if the LPSPI module is not disabled. - */ - -uint32_t LPSPI_MasterSetBaudRate(LPSPI_Type *base, - uint32_t baudRate_Bps, - uint32_t srcClock_Hz, - uint32_t *tcrPrescaleValue); - -/*! - * @brief Manually configures a specific LPSPI delay parameter (module must be disabled to - * change the delay values). - * - * This function configures the following: - * SCK to PCS delay, or - * PCS to SCK delay, or - * The configurations must occur between the transfer delay. - * - * The delay names are available in type lpspi_delay_type_t. - * - * The user passes the desired delay along with the delay value. - * This allows the user to directly set the delay values if they have - * pre-calculated them or if they simply wish to manually increment the value. - * - * Note that the LPSPI module must first be disabled before configuring this. - * Note that the LPSPI module must be configured for master mode before configuring this. - * - * @param base LPSPI peripheral address. - * @param scaler The 8-bit delay value 0x00 to 0xFF (255). - * @param whichDelay The desired delay to configure, must be of type lpspi_delay_type_t. - */ -void LPSPI_MasterSetDelayScaler(LPSPI_Type *base, uint32_t scaler, lpspi_delay_type_t whichDelay); - -/*! - * @brief Calculates the delay based on the desired delay input in nanoseconds (module must be - * disabled to change the delay values). - * - * This function calculates the values for the following: - * SCK to PCS delay, or - * PCS to SCK delay, or - * The configurations must occur between the transfer delay. - * - * The delay names are available in type lpspi_delay_type_t. - * - * The user passes the desired delay and the desired delay value in - * nano-seconds. The function calculates the value needed for the desired delay parameter - * and returns the actual calculated delay because an exact delay match may not be possible. In this - * case, the closest match is calculated without going below the desired delay value input. - * It is possible to input a very large delay value that exceeds the capability of the part, in - * which case the maximum supported delay is returned. It is up to the higher level - * peripheral driver to alert the user of an out of range delay input. - * - * Note that the LPSPI module must be configured for master mode before configuring this. And note that - * the delayTime = LPSPI_clockSource / (PRESCALE * Delay_scaler). - * - * @param base LPSPI peripheral address. - * @param delayTimeInNanoSec The desired delay value in nano-seconds. - * @param whichDelay The desired delay to configuration, which must be of type lpspi_delay_type_t. - * @param srcClock_Hz Module source input clock in Hertz. - * @return actual Calculated delay value in nano-seconds. - */ -uint32_t LPSPI_MasterSetDelayTimes(LPSPI_Type *base, - uint32_t delayTimeInNanoSec, - lpspi_delay_type_t whichDelay, - uint32_t srcClock_Hz); - -/*! - * @brief Writes data into the transmit data buffer. - * - * This function writes data passed in by the user to the Transmit Data Register (TDR). - * The user can pass up to 32-bits of data to load into the TDR. If the frame size exceeds 32-bits, - * the user has to manage sending the data one 32-bit word at a time. - * Any writes to the TDR result in an immediate push to the transmit FIFO. - * This function can be used for either master or slave modes. - * - * @param base LPSPI peripheral address. - * @param data The data word to be sent. - */ -static inline void LPSPI_WriteData(LPSPI_Type *base, uint32_t data) -{ - base->TDR = data; -} - -/*! - * @brief Reads data from the data buffer. - * - * This function reads the data from the Receive Data Register (RDR). - * This function can be used for either master or slave mode. - * - * @param base LPSPI peripheral address. - * @return The data read from the data buffer. - */ -static inline uint32_t LPSPI_ReadData(LPSPI_Type *base) -{ - return (base->RDR); -} - -/*! - * @brief Set up the dummy data. - * - * @param base LPSPI peripheral address. - * @param dummyData Data to be transferred when tx buffer is NULL. - * Note: - * This API has no effect when LPSPI in slave interrupt mode, because driver - * will set the TXMSK bit to 1 if txData is NULL, no data is loaded from transmit - * FIFO and output pin is tristated. - */ -void LPSPI_SetDummyData(LPSPI_Type *base, uint8_t dummyData); - -/*! - *@} - */ - -/*! - * @name Transactional - * @{ - */ -/*Transactional APIs*/ - -/*! - * @brief Initializes the LPSPI master handle. - * - * This function initializes the LPSPI handle, which can be used for other LPSPI transactional APIs. Usually, for a - * specified LPSPI instance, call this API once to get the initialized handle. - - * @param base LPSPI peripheral address. - * @param handle LPSPI handle pointer to lpspi_master_handle_t. - * @param callback DSPI callback. - * @param userData callback function parameter. - */ -void LPSPI_MasterTransferCreateHandle(LPSPI_Type *base, - lpspi_master_handle_t *handle, - lpspi_master_transfer_callback_t callback, - void *userData); - -/*! - * @brief LPSPI master transfer data using a polling method. - * - * This function transfers data using a polling method. This is a blocking function, which does not return until all - * transfers have been - * completed. - * - * Note: - * The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not integer multiples of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * @param base LPSPI peripheral address. - * @param transfer pointer to lpspi_transfer_t structure. - * @return status of status_t. - */ -status_t LPSPI_MasterTransferBlocking(LPSPI_Type *base, lpspi_transfer_t *transfer); - -/*! - * @brief LPSPI master transfer data using an interrupt method. - * - * This function transfers data using an interrupt method. This is a non-blocking function, which returns right away. - * When all data is transferred, the callback function is called. - * - * Note: - * The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not integer multiples of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * @param base LPSPI peripheral address. - * @param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - * @param transfer pointer to lpspi_transfer_t structure. - * @return status of status_t. - */ -status_t LPSPI_MasterTransferNonBlocking(LPSPI_Type *base, lpspi_master_handle_t *handle, lpspi_transfer_t *transfer); - -/*! - * @brief Gets the master transfer remaining bytes. - * - * This function gets the master transfer remaining bytes. - * - * @param base LPSPI peripheral address. - * @param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - * @param count Number of bytes transferred so far by the non-blocking transaction. - * @return status of status_t. - */ -status_t LPSPI_MasterTransferGetCount(LPSPI_Type *base, lpspi_master_handle_t *handle, size_t *count); - -/*! - * @brief LPSPI master abort transfer which uses an interrupt method. - * - * This function aborts a transfer which uses an interrupt method. - * - * @param base LPSPI peripheral address. - * @param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - */ -void LPSPI_MasterTransferAbort(LPSPI_Type *base, lpspi_master_handle_t *handle); - -/*! - * @brief LPSPI Master IRQ handler function. - * - * This function processes the LPSPI transmit and receive IRQ. - * - * @param instance LPSPI instance. - * @param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - */ -void LPSPI_MasterTransferHandleIRQ(uint32_t instance, lpspi_master_handle_t *handle); - -/*! - * @brief Initializes the LPSPI slave handle. - * - * This function initializes the LPSPI handle, which can be used for other LPSPI transactional APIs. Usually, for a - * specified LPSPI instance, call this API once to get the initialized handle. - * - * @param base LPSPI peripheral address. - * @param handle LPSPI handle pointer to lpspi_slave_handle_t. - * @param callback DSPI callback. - * @param userData callback function parameter. - */ -void LPSPI_SlaveTransferCreateHandle(LPSPI_Type *base, - lpspi_slave_handle_t *handle, - lpspi_slave_transfer_callback_t callback, - void *userData); - -/*! - * @brief LPSPI slave transfer data using an interrupt method. - * - * This function transfer data using an interrupt method. This is a non-blocking function, which returns right away. - * When all data is transferred, the callback function is called. - * - * Note: - * The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not an integer multiple of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * @param base LPSPI peripheral address. - * @param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - * @param transfer pointer to lpspi_transfer_t structure. - * @return status of status_t. - */ -status_t LPSPI_SlaveTransferNonBlocking(LPSPI_Type *base, lpspi_slave_handle_t *handle, lpspi_transfer_t *transfer); - -/*! - * @brief Gets the slave transfer remaining bytes. - * - * This function gets the slave transfer remaining bytes. - * - * @param base LPSPI peripheral address. - * @param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - * @param count Number of bytes transferred so far by the non-blocking transaction. - * @return status of status_t. - */ -status_t LPSPI_SlaveTransferGetCount(LPSPI_Type *base, lpspi_slave_handle_t *handle, size_t *count); - -/*! - * @brief LPSPI slave aborts a transfer which uses an interrupt method. - * - * This function aborts a transfer which uses an interrupt method. - * - * @param base LPSPI peripheral address. - * @param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - */ -void LPSPI_SlaveTransferAbort(LPSPI_Type *base, lpspi_slave_handle_t *handle); - -/*! - * @brief LPSPI Slave IRQ handler function. - * - * This function processes the LPSPI transmit and receives an IRQ. - * - * @param instance LPSPI instance index. - * @param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - */ -void LPSPI_SlaveTransferHandleIRQ(uint32_t instance, lpspi_slave_handle_t *handle); - -/*! - *@} - */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /*FSL_LPSPI_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpspi_edma.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpspi_edma.c deleted file mode 100644 index e7c0de298c4..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpspi_edma.c +++ /dev/null @@ -1,1118 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpspi_edma.h" - -/*********************************************************************************************************************** - * Definitions - ***********************************************************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpflexcomm_lpspi_edma" -#endif - -/*! - * @brief Structure definition for dspi_master_edma_private_handle_t. The structure is private. - */ -typedef struct _lpspi_master_edma_private_handle -{ - LPSPI_Type *base; /*!< LPSPI peripheral base address. */ - lpspi_master_edma_handle_t *handle; /*!< lpspi_master_edma_handle_t handle */ -} lpspi_master_edma_private_handle_t; - -/*! - * @brief Structure definition for dspi_slave_edma_private_handle_t. The structure is private. - */ -typedef struct _lpspi_slave_edma_private_handle -{ - LPSPI_Type *base; /*!< LPSPI peripheral base address. */ - lpspi_slave_edma_handle_t *handle; /*!< lpspi_slave_edma_handle_t handle */ -} lpspi_slave_edma_private_handle_t; - -/*********************************************************************************************************************** - * Prototypes - ***********************************************************************************************************************/ - -/*! - * @brief EDMA_LpspiMasterCallback after the LPSPI master transfer completed by using EDMA. - * This is not a public API. - */ -static void EDMA_LpspiMasterCallback(edma_handle_t *edmaHandle, - void *g_lpspiEdmaPrivateHandle, - bool transferDone, - uint32_t tcds); - -/*! - * @brief EDMA_LpspiSlaveCallback after the LPSPI slave transfer completed by using EDMA. - * This is not a public API. - */ -static void EDMA_LpspiSlaveCallback(edma_handle_t *edmaHandle, - void *g_lpspiEdmaPrivateHandle, - bool transferDone, - uint32_t tcds); - -static void LPSPI_SeparateEdmaReadData(uint8_t *rxData, uint32_t readData, uint32_t bytesEachRead, bool isByteSwap); - -/*********************************************************************************************************************** - * Variables - ***********************************************************************************************************************/ -/*! @brief Pointers to lpspi bases for each instance. */ -static LPSPI_Type *const s_lpspiBases[] = LPSPI_BASE_PTRS; - -/*! @brief Pointers to lpspi edma handles for each instance. */ -static lpspi_master_edma_private_handle_t s_lpspiMasterEdmaPrivateHandle[ARRAY_SIZE(s_lpspiBases)]; -static lpspi_slave_edma_private_handle_t s_lpspiSlaveEdmaPrivateHandle[ARRAY_SIZE(s_lpspiBases)]; - -/*********************************************************************************************************************** - * Code - ***********************************************************************************************************************/ -static void LPSPI_SeparateEdmaReadData(uint8_t *rxData, uint32_t readData, uint32_t bytesEachRead, bool isByteSwap) -{ - assert(rxData != NULL); - - switch (bytesEachRead) - { - case 1: - if (!isByteSwap) - { - *rxData = (uint8_t)readData; - ++rxData; - } - else - { - *rxData = (uint8_t)(readData >> 24); - ++rxData; - } - break; - - case 2: - if (!isByteSwap) - { - *rxData = (uint8_t)readData; - ++rxData; - *rxData = (uint8_t)(readData >> 8); - ++rxData; - } - else - { - *rxData = (uint8_t)(readData >> 16); - ++rxData; - *rxData = (uint8_t)(readData >> 24); - ++rxData; - } - break; - - case 4: - - *rxData = (uint8_t)readData; - ++rxData; - *rxData = (uint8_t)(readData >> 8); - ++rxData; - *rxData = (uint8_t)(readData >> 16); - ++rxData; - *rxData = (uint8_t)(readData >> 24); - ++rxData; - - break; - - default: - assert(false); - break; - } -} - -/*! - * brief Initializes the LPSPI master eDMA handle. - * - * This function initializes the LPSPI eDMA handle which can be used for other LPSPI transactional APIs. Usually, for a - * specified LPSPI instance, call this API once to get the initialized handle. - * - * Note that the LPSPI eDMA has a separated (Rx and Rx as two sources) or shared (Rx and Tx are the same source) DMA - * request source. - * (1) For a separated DMA request source, enable and set the Rx DMAMUX source for edmaRxRegToRxDataHandle and - * Tx DMAMUX source for edmaIntermediaryToTxRegHandle. - * (2) For a shared DMA request source, enable and set the Rx/Rx DMAMUX source for edmaRxRegToRxDataHandle. - * - * param base LPSPI peripheral base address. - * param handle LPSPI handle pointer to lpspi_master_edma_handle_t. - * param callback LPSPI callback. - * param userData callback function parameter. - * param edmaRxRegToRxDataHandle edmaRxRegToRxDataHandle pointer to edma_handle_t. - * param edmaTxDataToTxRegHandle edmaTxDataToTxRegHandle pointer to edma_handle_t. - */ -void LPSPI_MasterTransferCreateHandleEDMA(LPSPI_Type *base, - lpspi_master_edma_handle_t *handle, - lpspi_master_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *edmaRxRegToRxDataHandle, - edma_handle_t *edmaTxDataToTxRegHandle) -{ - assert(handle != NULL); - assert(edmaRxRegToRxDataHandle != NULL); - assert(edmaTxDataToTxRegHandle != NULL); - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - uint32_t instance = LPSPI_GetInstance(base); - - s_lpspiMasterEdmaPrivateHandle[instance].base = base; - s_lpspiMasterEdmaPrivateHandle[instance].handle = handle; - - handle->callback = callback; - handle->userData = userData; - - handle->edmaRxRegToRxDataHandle = edmaRxRegToRxDataHandle; - handle->edmaTxDataToTxRegHandle = edmaTxDataToTxRegHandle; -} - -static void LPSPI_PrepareTransferEDMA(LPSPI_Type *base) -{ - /* Flush FIFO, clear status, disable all the inerrupts and DMA requests. */ - LPSPI_FlushFifo(base, true, true); - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_AllStatusFlag); - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_AllInterruptEnable); - LPSPI_DisableDMA(base, (uint32_t)kLPSPI_RxDmaEnable | (uint32_t)kLPSPI_TxDmaEnable); -} - -/*! - * brief LPSPI master config transfer parameter using eDMA. - * - * This function is preparing to transfers data using eDMA. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_master_edma_handle_t structure which stores the transfer state. - * param configFlags transfer configuration flags. ref _lpspi_transfer_config_flag_for_master. - * return Indicates whether LPSPI master transfer was successful or not. - * retval kStatus_Success Execution successfully. - * retval kStatus_LPSPI_Busy The LPSPI device is busy. - */ -status_t LPSPI_MasterTransferPrepareEDMALite(LPSPI_Type *base, lpspi_master_edma_handle_t *handle, uint32_t configFlags) -{ - assert(handle != NULL); - - /* Check that we're not busy.*/ - if (handle->state == (uint8_t)kLPSPI_Busy) - { - return kStatus_LPSPI_Busy; - } - - /* Disable module before configuration */ - LPSPI_Enable(base, false); - - LPSPI_PrepareTransferEDMA(base); - - bool isByteSwap = ((configFlags & (uint32_t)kLPSPI_MasterByteSwap) != 0U); - bool isPcsContinuous = ((configFlags & (uint32_t)kLPSPI_MasterPcsContinuous) != 0U); - uint32_t instance = LPSPI_GetInstance(base); - uint8_t dummyData = g_lpspiDummyData[instance]; - /*Used for byte swap*/ - uint32_t whichPcs = (configFlags & LPSPI_MASTER_PCS_MASK) >> LPSPI_MASTER_PCS_SHIFT; - uint32_t bytesPerFrame = ((base->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT) / 8U + 1U; - - handle->txBuffIfNull = - ((uint32_t)dummyData) | ((uint32_t)dummyData << 8) | ((uint32_t)dummyData << 16) | ((uint32_t)dummyData << 24); - /*The TX and RX FIFO sizes are always the same*/ - handle->fifoSize = LPSPI_GetRxFifoSize(base); - handle->isPcsContinuous = isPcsContinuous; - handle->isByteSwap = isByteSwap; - handle->isThereExtraRxBytes = false; - - /*Because DMA is fast enough , so set the RX and TX watermarks to 0 .*/ - LPSPI_SetFifoWatermarks(base, 0U, 0U); - - /* Transfers will stall when transmit FIFO is empty or receive FIFO is full. */ - base->CFGR1 &= (~LPSPI_CFGR1_NOSTALL_MASK); - - /* Enable module for following configuration of TCR to take effect. */ - LPSPI_Enable(base, true); - - /* For DMA transfer , we'd better not masked the transmit data and receive data in TCR since the transfer flow is - * hard to controlled by software. */ - base->TCR = (base->TCR & ~(LPSPI_TCR_CONT_MASK | LPSPI_TCR_CONTC_MASK | LPSPI_TCR_BYSW_MASK | LPSPI_TCR_PCS_MASK)) | - LPSPI_TCR_CONT(isPcsContinuous) | LPSPI_TCR_BYSW(isByteSwap) | LPSPI_TCR_PCS(whichPcs); - /*Calculate the bytes for write/read the TX/RX register each time*/ - if (bytesPerFrame <= 4U) - { - handle->bytesEachWrite = (uint8_t)bytesPerFrame; - handle->bytesEachRead = (uint8_t)bytesPerFrame; - handle->bytesLastRead = (uint8_t)bytesPerFrame; - } - else - { - handle->bytesEachWrite = 4U; - handle->bytesEachRead = 4U; - - handle->bytesLastRead = 4U; - } - return kStatus_Success; -} - -/*! - * brief LPSPI master transfer data using eDMA without configs. - * - * This function transfers data using eDMA. This is a non-blocking function, which returns right away. When all data - * is transferred, the callback function is called. - * - * Note: - * This API is only for transfer through DMA without configuration. - * Before calling this API, you must call LPSPI_MasterTransferPrepareEDMALite to configure it once. - * The transfer data size should be an integer multiple of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not an integer multiple of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_master_edma_handle_t structure which stores the transfer state. - * param transfer pointer to lpspi_transfer_t structure, config field is not working. - * return Indicates whether LPSPI master transfer was successful or not. - * retval kStatus_Success Execution successfully. - * retval kStatus_LPSPI_Busy The LPSPI device is busy. - * retval kStatus_InvalidArgument The transfer structure is invalid. - */ -status_t LPSPI_MasterTransferEDMALite(LPSPI_Type *base, lpspi_master_edma_handle_t *handle, lpspi_transfer_t *transfer) -{ - assert(handle != NULL); - assert(transfer != NULL); - - /* Check that we're not busy.*/ - if (handle->state == (uint8_t)kLPSPI_Busy) - { - return kStatus_LPSPI_Busy; - } - - /* Check arguements */ - if (!LPSPI_CheckTransferArgument(base, transfer, true)) - { - return kStatus_InvalidArgument; - } - - /* Variables */ - bool isThereExtraTxBytes = false; - uint8_t bytesLastWrite = 0; - uint32_t instance = LPSPI_GetInstance(base); - /*Used for byte swap*/ - uint32_t addrOffset = 0; - uint32_t rxAddr = LPSPI_GetRxRegisterAddress(base); - uint32_t txAddr = LPSPI_GetTxRegisterAddress(base); - uint32_t bytesPerFrame = ((base->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT) / 8U + 1U; - edma_transfer_config_t transferConfigRx = {0}; - edma_transfer_config_t transferConfigTx = {0}; - edma_tcd_t *softwareTCD_pcsContinuous = (edma_tcd_t *)((uint32_t)(&handle->lpspiSoftwareTCD[2]) & (~0x1FU)); - edma_tcd_t *softwareTCD_extraBytes = (edma_tcd_t *)((uint32_t)(&handle->lpspiSoftwareTCD[1]) & (~0x1FU)); - - handle->state = (uint8_t)kLPSPI_Busy; - handle->txData = transfer->txData; - handle->rxData = transfer->rxData; - handle->txRemainingByteCount = transfer->dataSize; - handle->rxRemainingByteCount = transfer->dataSize; - handle->totalByteCount = transfer->dataSize; - handle->writeRegRemainingTimes = (transfer->dataSize / bytesPerFrame) * ((bytesPerFrame + 3U) / 4U); - handle->readRegRemainingTimes = handle->writeRegRemainingTimes; - - handle->isThereExtraRxBytes = false; - - /*Calculate the bytes for write/read the TX/RX register each time*/ - if (bytesPerFrame > 4U) - { - if ((transfer->dataSize % 4U) != 0U) - { - bytesLastWrite = (uint8_t)(transfer->dataSize % 4U); - handle->bytesLastRead = bytesLastWrite; - - isThereExtraTxBytes = true; - - --handle->writeRegRemainingTimes; - - --handle->readRegRemainingTimes; - handle->isThereExtraRxBytes = true; - } - } - - EDMA_SetCallback(handle->edmaRxRegToRxDataHandle, EDMA_LpspiMasterCallback, - &s_lpspiMasterEdmaPrivateHandle[instance]); - - /* Configure rx EDMA transfer */ - EDMA_ResetChannel(handle->edmaRxRegToRxDataHandle->base, handle->edmaRxRegToRxDataHandle->channel); - - if (handle->rxData != NULL) - { - transferConfigRx.destAddr = (uint32_t) & (handle->rxData[0]); - transferConfigRx.destOffset = 1; - } - else - { - transferConfigRx.destAddr = (uint32_t) & (handle->rxBuffIfNull); - transferConfigRx.destOffset = 0; - } - transferConfigRx.destTransferSize = kEDMA_TransferSize1Bytes; - - addrOffset = 0; - switch (handle->bytesEachRead) - { - case (1U): - transferConfigRx.srcTransferSize = kEDMA_TransferSize1Bytes; - transferConfigRx.minorLoopBytes = 1; - if (handle->isByteSwap) - { - addrOffset = 3; - } - break; - - case (2U): - transferConfigRx.srcTransferSize = kEDMA_TransferSize2Bytes; - transferConfigRx.minorLoopBytes = 2; - if (handle->isByteSwap) - { - addrOffset = 2; - } - break; - - case (4U): - transferConfigRx.srcTransferSize = kEDMA_TransferSize4Bytes; - transferConfigRx.minorLoopBytes = 4; - break; - - default: - transferConfigRx.srcTransferSize = kEDMA_TransferSize1Bytes; - transferConfigRx.minorLoopBytes = 1; - assert(false); - break; - } - - transferConfigRx.srcAddr = (uint32_t)rxAddr + addrOffset; - transferConfigRx.srcOffset = 0; - - transferConfigRx.majorLoopCounts = handle->readRegRemainingTimes; - - /* Store the initially configured eDMA minor byte transfer count into the LPSPI handle */ - handle->nbytes = (uint8_t)transferConfigRx.minorLoopBytes; - - EDMA_SetTransferConfig(handle->edmaRxRegToRxDataHandle->base, handle->edmaRxRegToRxDataHandle->channel, - &transferConfigRx, NULL); - EDMA_EnableChannelInterrupts(handle->edmaRxRegToRxDataHandle->base, handle->edmaRxRegToRxDataHandle->channel, - (uint32_t)kEDMA_MajorInterruptEnable); - - /* Configure tx EDMA transfer */ - EDMA_ResetChannel(handle->edmaTxDataToTxRegHandle->base, handle->edmaTxDataToTxRegHandle->channel); - - if (isThereExtraTxBytes) - { - if (handle->txData != NULL) - { - transferConfigTx.srcAddr = (uint32_t) & (transfer->txData[transfer->dataSize - bytesLastWrite]); - transferConfigTx.srcOffset = 1; - } - else - { - transferConfigTx.srcAddr = (uint32_t)(&handle->txBuffIfNull); - transferConfigTx.srcOffset = 0; - } - - transferConfigTx.destOffset = 0; - - transferConfigTx.srcTransferSize = kEDMA_TransferSize1Bytes; - - addrOffset = 0; - switch (bytesLastWrite) - { - case (1U): - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - if (handle->isByteSwap) - { - addrOffset = 3; - } - break; - - case (2U): - transferConfigTx.destTransferSize = kEDMA_TransferSize2Bytes; - transferConfigTx.minorLoopBytes = 2; - if (handle->isByteSwap) - { - addrOffset = 2; - } - break; - - default: - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - assert(false); - break; - } - - transferConfigTx.destAddr = (uint32_t)txAddr + addrOffset; - transferConfigTx.majorLoopCounts = 1; - - EDMA_TcdReset(softwareTCD_extraBytes); - - if (handle->isPcsContinuous) - { - EDMA_TcdSetTransferConfig(softwareTCD_extraBytes, &transferConfigTx, softwareTCD_pcsContinuous); - } - else - { - EDMA_TcdSetTransferConfig(softwareTCD_extraBytes, &transferConfigTx, NULL); - } - } - - if (handle->isPcsContinuous) - { - handle->transmitCommand = base->TCR & ~(LPSPI_TCR_CONTC_MASK | LPSPI_TCR_CONT_MASK); - - transferConfigTx.srcAddr = (uint32_t) & (handle->transmitCommand); - transferConfigTx.srcOffset = 0; - - transferConfigTx.destAddr = (uint32_t) & (base->TCR); - transferConfigTx.destOffset = 0; - - transferConfigTx.srcTransferSize = kEDMA_TransferSize4Bytes; - transferConfigTx.destTransferSize = kEDMA_TransferSize4Bytes; - transferConfigTx.minorLoopBytes = 4; - transferConfigTx.majorLoopCounts = 1; - - EDMA_TcdReset(softwareTCD_pcsContinuous); - EDMA_TcdSetTransferConfig(softwareTCD_pcsContinuous, &transferConfigTx, NULL); - } - - if (handle->txData != NULL) - { - transferConfigTx.srcAddr = (uint32_t)(handle->txData); - transferConfigTx.srcOffset = 1; - } - else - { - transferConfigTx.srcAddr = (uint32_t)(&handle->txBuffIfNull); - transferConfigTx.srcOffset = 0; - } - - transferConfigTx.destOffset = 0; - - transferConfigTx.srcTransferSize = kEDMA_TransferSize1Bytes; - - addrOffset = 0U; - switch (handle->bytesEachRead) - { - case (1U): - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - if (handle->isByteSwap) - { - addrOffset = 3; - } - break; - - case (2U): - transferConfigTx.destTransferSize = kEDMA_TransferSize2Bytes; - transferConfigTx.minorLoopBytes = 2; - - if (handle->isByteSwap) - { - addrOffset = 2; - } - break; - - case (4U): - transferConfigTx.destTransferSize = kEDMA_TransferSize4Bytes; - transferConfigTx.minorLoopBytes = 4; - break; - - default: - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - assert(false); - break; - } - - transferConfigTx.destAddr = (uint32_t)txAddr + addrOffset; - - transferConfigTx.majorLoopCounts = handle->writeRegRemainingTimes; - - if (isThereExtraTxBytes) - { - EDMA_SetTransferConfig(handle->edmaTxDataToTxRegHandle->base, handle->edmaTxDataToTxRegHandle->channel, - &transferConfigTx, softwareTCD_extraBytes); - } - else if (handle->isPcsContinuous) - { - EDMA_SetTransferConfig(handle->edmaTxDataToTxRegHandle->base, handle->edmaTxDataToTxRegHandle->channel, - &transferConfigTx, softwareTCD_pcsContinuous); - } - else - { - EDMA_SetTransferConfig(handle->edmaTxDataToTxRegHandle->base, handle->edmaTxDataToTxRegHandle->channel, - &transferConfigTx, NULL); - } - - EDMA_StartTransfer(handle->edmaTxDataToTxRegHandle); - EDMA_StartTransfer(handle->edmaRxRegToRxDataHandle); - LPSPI_EnableDMA(base, (uint32_t)kLPSPI_RxDmaEnable | (uint32_t)kLPSPI_TxDmaEnable); - - return kStatus_Success; -} - -/*! - * brief LPSPI master transfer data using eDMA. - * - * This function transfers data using eDMA. This is a non-blocking function, which returns right away. When all data - * is transferred, the callback function is called. - * - * Note: - * The transfer data size should be an integer multiple of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not an integer multiple of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_master_edma_handle_t structure which stores the transfer state. - * param transfer pointer to lpspi_transfer_t structure. - * return status of status_t. - */ -status_t LPSPI_MasterTransferEDMA(LPSPI_Type *base, lpspi_master_edma_handle_t *handle, lpspi_transfer_t *transfer) -{ - status_t status = kStatus_Fail; - status = LPSPI_MasterTransferPrepareEDMALite(base, handle, transfer->configFlags); - if(kStatus_Success != status) - { - return status; - } - return LPSPI_MasterTransferEDMALite(base,handle,transfer); -} - -static void EDMA_LpspiMasterCallback(edma_handle_t *edmaHandle, - void *g_lpspiEdmaPrivateHandle, - bool transferDone, - uint32_t tcds) -{ - assert(edmaHandle != NULL); - assert(g_lpspiEdmaPrivateHandle != NULL); - - uint32_t readData; - - lpspi_master_edma_private_handle_t *lpspiEdmaPrivateHandle; - - lpspiEdmaPrivateHandle = (lpspi_master_edma_private_handle_t *)g_lpspiEdmaPrivateHandle; - - size_t rxRemainingByteCount = lpspiEdmaPrivateHandle->handle->rxRemainingByteCount; - uint8_t bytesLastRead = lpspiEdmaPrivateHandle->handle->bytesLastRead; - bool isByteSwap = lpspiEdmaPrivateHandle->handle->isByteSwap; - - LPSPI_DisableDMA(lpspiEdmaPrivateHandle->base, (uint32_t)kLPSPI_TxDmaEnable | (uint32_t)kLPSPI_RxDmaEnable); - - if (lpspiEdmaPrivateHandle->handle->isThereExtraRxBytes) - { - while (LPSPI_GetRxFifoCount(lpspiEdmaPrivateHandle->base) == 0U) - { - } - readData = LPSPI_ReadData(lpspiEdmaPrivateHandle->base); - - if (lpspiEdmaPrivateHandle->handle->rxData != NULL) - { - LPSPI_SeparateEdmaReadData(&(lpspiEdmaPrivateHandle->handle->rxData[rxRemainingByteCount - bytesLastRead]), - readData, bytesLastRead, isByteSwap); - } - } - - lpspiEdmaPrivateHandle->handle->state = (uint8_t)kLPSPI_Idle; - - if (lpspiEdmaPrivateHandle->handle->callback != NULL) - { - lpspiEdmaPrivateHandle->handle->callback(lpspiEdmaPrivateHandle->base, lpspiEdmaPrivateHandle->handle, - kStatus_Success, lpspiEdmaPrivateHandle->handle->userData); - } -} - -/*! - * brief LPSPI master aborts a transfer which is using eDMA. - * - * This function aborts a transfer which is using eDMA. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_master_edma_handle_t structure which stores the transfer state. - */ -void LPSPI_MasterTransferAbortEDMA(LPSPI_Type *base, lpspi_master_edma_handle_t *handle) -{ - assert(handle != NULL); - - LPSPI_DisableDMA(base, (uint32_t)kLPSPI_RxDmaEnable | (uint32_t)kLPSPI_TxDmaEnable); - - EDMA_AbortTransfer(handle->edmaRxRegToRxDataHandle); - EDMA_AbortTransfer(handle->edmaTxDataToTxRegHandle); - - handle->state = (uint8_t)kLPSPI_Idle; -} - -/*! - * brief Gets the master eDMA transfer remaining bytes. - * - * This function gets the master eDMA transfer remaining bytes. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_master_edma_handle_t structure which stores the transfer state. - * param count Number of bytes transferred so far by the EDMA transaction. - * return status of status_t. - */ -status_t LPSPI_MasterTransferGetCountEDMA(LPSPI_Type *base, lpspi_master_edma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (handle->state != (uint8_t)kLPSPI_Busy) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - size_t remainingByte; - - remainingByte = - (uint32_t)handle->nbytes * EDMA_GetRemainingMajorLoopCount(handle->edmaRxRegToRxDataHandle->base, - handle->edmaRxRegToRxDataHandle->channel); - - *count = handle->totalByteCount - remainingByte; - - return kStatus_Success; -} - -/*! - * brief Initializes the LPSPI slave eDMA handle. - * - * This function initializes the LPSPI eDMA handle which can be used for other LPSPI transactional APIs. Usually, for a - * specified LPSPI instance, call this API once to get the initialized handle. - * - * Note that LPSPI eDMA has a separated (Rx and Tx as two sources) or shared (Rx and Tx as the same source) DMA request - * source. - * - * (1) For a separated DMA request source, enable and set the Rx DMAMUX source for edmaRxRegToRxDataHandle and - * Tx DMAMUX source for edmaTxDataToTxRegHandle. - * (2) For a shared DMA request source, enable and set the Rx/Rx DMAMUX source for edmaRxRegToRxDataHandle . - * - * param base LPSPI peripheral base address. - * param handle LPSPI handle pointer to lpspi_slave_edma_handle_t. - * param callback LPSPI callback. - * param userData callback function parameter. - * param edmaRxRegToRxDataHandle edmaRxRegToRxDataHandle pointer to edma_handle_t. - * param edmaTxDataToTxRegHandle edmaTxDataToTxRegHandle pointer to edma_handle_t. - */ -void LPSPI_SlaveTransferCreateHandleEDMA(LPSPI_Type *base, - lpspi_slave_edma_handle_t *handle, - lpspi_slave_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *edmaRxRegToRxDataHandle, - edma_handle_t *edmaTxDataToTxRegHandle) -{ - assert(handle != NULL); - assert(edmaRxRegToRxDataHandle != NULL); - assert(edmaTxDataToTxRegHandle != NULL); - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - uint32_t instance = LPSPI_GetInstance(base); - - s_lpspiSlaveEdmaPrivateHandle[instance].base = base; - s_lpspiSlaveEdmaPrivateHandle[instance].handle = handle; - - handle->callback = callback; - handle->userData = userData; - - handle->edmaRxRegToRxDataHandle = edmaRxRegToRxDataHandle; - handle->edmaTxDataToTxRegHandle = edmaTxDataToTxRegHandle; -} - -/*! - * brief LPSPI slave transfers data using eDMA. - * - * This function transfers data using eDMA. This is a non-blocking function, which return right away. When all data - * is transferred, the callback function is called. - * - * Note: - * The transfer data size should be an integer multiple of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not an integer multiple of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_slave_edma_handle_t structure which stores the transfer state. - * param transfer pointer to lpspi_transfer_t structure. - * return status of status_t. - */ -status_t LPSPI_SlaveTransferEDMA(LPSPI_Type *base, lpspi_slave_edma_handle_t *handle, lpspi_transfer_t *transfer) -{ - assert(handle != NULL); - assert(transfer != NULL); - - /* Check that we're not busy.*/ - if (handle->state == (uint8_t)kLPSPI_Busy) - { - return kStatus_LPSPI_Busy; - } - /* Disable module before configuration. */ - LPSPI_Enable(base, false); - /* Check arguements, also dma transfer can not support 3 bytes */ - if (!LPSPI_CheckTransferArgument(base, transfer, true)) - { - return kStatus_InvalidArgument; - } - - LPSPI_PrepareTransferEDMA(base); - - /* Variables */ - bool isThereExtraTxBytes = false; - bool isByteSwap = ((transfer->configFlags & (uint32_t)kLPSPI_MasterByteSwap) != 0U); - uint8_t bytesLastWrite = 0; - uint8_t dummyData = g_lpspiDummyData[LPSPI_GetInstance(base)]; - uint32_t mask = (uint32_t)kLPSPI_RxDmaEnable; - - /* Used for byte swap */ - uint32_t addrOffset = 0; - uint32_t instance = LPSPI_GetInstance(base); - uint32_t rxAddr = LPSPI_GetRxRegisterAddress(base); - uint32_t txAddr = LPSPI_GetTxRegisterAddress(base); - uint32_t whichPcs = (transfer->configFlags & LPSPI_MASTER_PCS_MASK) >> LPSPI_MASTER_PCS_SHIFT; - uint32_t bytesPerFrame = ((base->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT) / 8U + 1U; - edma_transfer_config_t transferConfigRx = {0}; - edma_transfer_config_t transferConfigTx = {0}; - edma_tcd_t *softwareTCD_extraBytes = (edma_tcd_t *)((uint32_t)(&handle->lpspiSoftwareTCD[1]) & (~0x1FU)); - - /* Assign the original value for members of transfer handle. */ - handle->state = (uint8_t)kLPSPI_Busy; - handle->txData = transfer->txData; - handle->rxData = transfer->rxData; - handle->txRemainingByteCount = transfer->dataSize; - handle->rxRemainingByteCount = transfer->dataSize; - handle->totalByteCount = transfer->dataSize; - handle->writeRegRemainingTimes = (transfer->dataSize / bytesPerFrame) * ((bytesPerFrame + 3U) / 4U); - handle->readRegRemainingTimes = handle->writeRegRemainingTimes; - handle->txBuffIfNull = - ((uint32_t)dummyData) | ((uint32_t)dummyData << 8) | ((uint32_t)dummyData << 16) | ((uint32_t)dummyData << 24); - /*The TX and RX FIFO sizes are always the same*/ - handle->fifoSize = LPSPI_GetRxFifoSize(base); - handle->isByteSwap = isByteSwap; - handle->isThereExtraRxBytes = false; - - /* Because DMA is fast enough, set the RX and TX watermarks to 0. */ - LPSPI_SetFifoWatermarks(base, 0U, 0U); - - /* Transfers will stall when transmit FIFO is empty or receive FIFO is full. */ - base->CFGR1 &= (~LPSPI_CFGR1_NOSTALL_MASK); - - /* Enable module for following configuration of TCR to take effect. */ - LPSPI_Enable(base, true); - - /* For DMA transfer, mask the transmit data if the tx data is null, for rx the receive data should not be masked at - any time since we use rx dma transfer finish cllback to indicate transfer finish. */ - base->TCR = - (base->TCR & ~(LPSPI_TCR_CONT_MASK | LPSPI_TCR_CONTC_MASK | LPSPI_TCR_BYSW_MASK | LPSPI_TCR_TXMSK_MASK)) | - LPSPI_TCR_TXMSK(transfer->txData == NULL) | LPSPI_TCR_BYSW(isByteSwap) | LPSPI_TCR_PCS(whichPcs); - - /*Calculate the bytes for write/read the TX/RX register each time*/ - if (bytesPerFrame <= 4U) - { - handle->bytesEachWrite = (uint8_t)bytesPerFrame; - handle->bytesEachRead = (uint8_t)bytesPerFrame; - - handle->bytesLastRead = (uint8_t)bytesPerFrame; - } - else - { - handle->bytesEachWrite = 4U; - handle->bytesEachRead = 4U; - - handle->bytesLastRead = 4U; - - if ((transfer->dataSize % 4U) != 0U) - { - bytesLastWrite = (uint8_t)(transfer->dataSize % 4U); - handle->bytesLastRead = bytesLastWrite; - - isThereExtraTxBytes = true; - --handle->writeRegRemainingTimes; - - handle->isThereExtraRxBytes = true; - --handle->readRegRemainingTimes; - } - } - - EDMA_SetCallback(handle->edmaRxRegToRxDataHandle, EDMA_LpspiSlaveCallback, - &s_lpspiSlaveEdmaPrivateHandle[instance]); - - /*Rx*/ - if (handle->readRegRemainingTimes > 0U) - { - EDMA_ResetChannel(handle->edmaRxRegToRxDataHandle->base, handle->edmaRxRegToRxDataHandle->channel); - - if (handle->rxData != NULL) - { - transferConfigRx.destAddr = (uint32_t) & (handle->rxData[0]); - transferConfigRx.destOffset = 1; - } - else - { - transferConfigRx.destAddr = (uint32_t) & (handle->rxBuffIfNull); - transferConfigRx.destOffset = 0; - } - transferConfigRx.destTransferSize = kEDMA_TransferSize1Bytes; - - addrOffset = 0; - switch (handle->bytesEachRead) - { - case (1U): - transferConfigRx.srcTransferSize = kEDMA_TransferSize1Bytes; - transferConfigRx.minorLoopBytes = 1; - if (handle->isByteSwap) - { - addrOffset = 3; - } - break; - - case (2U): - transferConfigRx.srcTransferSize = kEDMA_TransferSize2Bytes; - transferConfigRx.minorLoopBytes = 2; - if (handle->isByteSwap) - { - addrOffset = 2; - } - break; - - case (4U): - transferConfigRx.srcTransferSize = kEDMA_TransferSize4Bytes; - transferConfigRx.minorLoopBytes = 4; - break; - - default: - transferConfigRx.srcTransferSize = kEDMA_TransferSize1Bytes; - transferConfigRx.minorLoopBytes = 1; - assert(false); - break; - } - - transferConfigRx.srcAddr = (uint32_t)rxAddr + addrOffset; - transferConfigRx.srcOffset = 0; - - transferConfigRx.majorLoopCounts = handle->readRegRemainingTimes; - - /* Store the initially configured eDMA minor byte transfer count into the DSPI handle */ - handle->nbytes = (uint8_t)transferConfigRx.minorLoopBytes; - - EDMA_SetTransferConfig(handle->edmaRxRegToRxDataHandle->base, handle->edmaRxRegToRxDataHandle->channel, - &transferConfigRx, NULL); - EDMA_EnableChannelInterrupts(handle->edmaRxRegToRxDataHandle->base, handle->edmaRxRegToRxDataHandle->channel, - (uint32_t)kEDMA_MajorInterruptEnable); - EDMA_StartTransfer(handle->edmaRxRegToRxDataHandle); - } - - /*Tx*/ - if (handle->txData != NULL) - { - EDMA_ResetChannel(handle->edmaTxDataToTxRegHandle->base, handle->edmaTxDataToTxRegHandle->channel); - if (isThereExtraTxBytes) - { - transferConfigTx.srcAddr = (uint32_t) & (transfer->txData[transfer->dataSize - bytesLastWrite]); - transferConfigTx.srcOffset = 1; - transferConfigTx.destOffset = 0; - transferConfigTx.srcTransferSize = kEDMA_TransferSize1Bytes; - addrOffset = 0; - switch (bytesLastWrite) - { - case (1U): - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - if (handle->isByteSwap) - { - addrOffset = 3; - } - break; - - case (2U): - transferConfigTx.destTransferSize = kEDMA_TransferSize2Bytes; - transferConfigTx.minorLoopBytes = 2; - if (handle->isByteSwap) - { - addrOffset = 2; - } - break; - - default: - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - assert(false); - break; - } - - transferConfigTx.destAddr = (uint32_t)txAddr + addrOffset; - transferConfigTx.majorLoopCounts = 1; - - EDMA_TcdReset(softwareTCD_extraBytes); - EDMA_TcdSetTransferConfig(softwareTCD_extraBytes, &transferConfigTx, NULL); - } - - transferConfigTx.srcAddr = (uint32_t)(handle->txData); - transferConfigTx.srcOffset = 1; - transferConfigTx.destOffset = 0; - transferConfigTx.srcTransferSize = kEDMA_TransferSize1Bytes; - addrOffset = 0; - switch (handle->bytesEachRead) - { - case (1U): - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - if (handle->isByteSwap) - { - addrOffset = 3; - } - break; - - case (2U): - transferConfigTx.destTransferSize = kEDMA_TransferSize2Bytes; - transferConfigTx.minorLoopBytes = 2; - - if (handle->isByteSwap) - { - addrOffset = 2; - } - break; - - case (4U): - transferConfigTx.destTransferSize = kEDMA_TransferSize4Bytes; - transferConfigTx.minorLoopBytes = 4; - break; - - default: - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - assert(false); - break; - } - - transferConfigTx.destAddr = (uint32_t)txAddr + addrOffset; - transferConfigTx.majorLoopCounts = handle->writeRegRemainingTimes; - - if (isThereExtraTxBytes) - { - EDMA_SetTransferConfig(handle->edmaTxDataToTxRegHandle->base, handle->edmaTxDataToTxRegHandle->channel, - &transferConfigTx, softwareTCD_extraBytes); - } - else - { - EDMA_SetTransferConfig(handle->edmaTxDataToTxRegHandle->base, handle->edmaTxDataToTxRegHandle->channel, - &transferConfigTx, NULL); - } - EDMA_StartTransfer(handle->edmaTxDataToTxRegHandle); - mask |= (uint32_t)kLPSPI_TxDmaEnable; - } - - LPSPI_EnableDMA(base, mask); - - return kStatus_Success; -} - -static void EDMA_LpspiSlaveCallback(edma_handle_t *edmaHandle, - void *g_lpspiEdmaPrivateHandle, - bool transferDone, - uint32_t tcds) -{ - assert(edmaHandle != NULL); - assert(g_lpspiEdmaPrivateHandle != NULL); - - uint32_t readData; - - lpspi_slave_edma_private_handle_t *lpspiEdmaPrivateHandle; - - lpspiEdmaPrivateHandle = (lpspi_slave_edma_private_handle_t *)g_lpspiEdmaPrivateHandle; - - size_t rxRemainingByteCount = lpspiEdmaPrivateHandle->handle->rxRemainingByteCount; - uint8_t bytesLastRead = lpspiEdmaPrivateHandle->handle->bytesLastRead; - bool isByteSwap = lpspiEdmaPrivateHandle->handle->isByteSwap; - - LPSPI_DisableDMA(lpspiEdmaPrivateHandle->base, (uint32_t)kLPSPI_TxDmaEnable | (uint32_t)kLPSPI_RxDmaEnable); - - if (lpspiEdmaPrivateHandle->handle->isThereExtraRxBytes) - { - while (LPSPI_GetRxFifoCount(lpspiEdmaPrivateHandle->base) == 0U) - { - } - readData = LPSPI_ReadData(lpspiEdmaPrivateHandle->base); - - if (lpspiEdmaPrivateHandle->handle->rxData != NULL) - { - LPSPI_SeparateEdmaReadData(&(lpspiEdmaPrivateHandle->handle->rxData[rxRemainingByteCount - bytesLastRead]), - readData, bytesLastRead, isByteSwap); - } - } - - lpspiEdmaPrivateHandle->handle->state = (uint8_t)kLPSPI_Idle; - - if (lpspiEdmaPrivateHandle->handle->callback != NULL) - { - lpspiEdmaPrivateHandle->handle->callback(lpspiEdmaPrivateHandle->base, lpspiEdmaPrivateHandle->handle, - kStatus_Success, lpspiEdmaPrivateHandle->handle->userData); - } -} - -/*! - * brief LPSPI slave aborts a transfer which is using eDMA. - * - * This function aborts a transfer which is using eDMA. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_slave_edma_handle_t structure which stores the transfer state. - */ -void LPSPI_SlaveTransferAbortEDMA(LPSPI_Type *base, lpspi_slave_edma_handle_t *handle) -{ - assert(handle != NULL); - - LPSPI_DisableDMA(base, (uint32_t)kLPSPI_RxDmaEnable | (uint32_t)kLPSPI_TxDmaEnable); - - EDMA_AbortTransfer(handle->edmaRxRegToRxDataHandle); - EDMA_AbortTransfer(handle->edmaTxDataToTxRegHandle); - - handle->state = (uint8_t)kLPSPI_Idle; -} - -/*! - * brief Gets the slave eDMA transfer remaining bytes. - * - * This function gets the slave eDMA transfer remaining bytes. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_slave_edma_handle_t structure which stores the transfer state. - * param count Number of bytes transferred so far by the eDMA transaction. - * return status of status_t. - */ -status_t LPSPI_SlaveTransferGetCountEDMA(LPSPI_Type *base, lpspi_slave_edma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (handle->state != (uint8_t)kLPSPI_Busy) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - size_t remainingByte; - - remainingByte = - (uint32_t)handle->nbytes * EDMA_GetRemainingMajorLoopCount(handle->edmaRxRegToRxDataHandle->base, - handle->edmaRxRegToRxDataHandle->channel); - - *count = handle->totalByteCount - remainingByte; - - return kStatus_Success; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpspi_edma.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpspi_edma.h deleted file mode 100644 index d31cd38b860..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpspi_edma.h +++ /dev/null @@ -1,339 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_LPSPI_EDMA_H_ -#define FSL_LPSPI_EDMA_H_ - -#include "fsl_lpspi.h" -#include "fsl_edma.h" - -/*! - * @addtogroup lpspi_edma_driver - * @{ - */ - -/*********************************************************************************************************************** - * Definitions - **********************************************************************************************************************/ -/*! @name Driver version */ -/*@{*/ -/*! @brief LPSPI EDMA driver version. */ -#define FSL_LPSPI_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 1, 0)) -/*@}*/ - -/*! - * @brief Forward declaration of the _lpspi_master_edma_handle typedefs. - */ -typedef struct _lpspi_master_edma_handle lpspi_master_edma_handle_t; - -/*! - * @brief Forward declaration of the _lpspi_slave_edma_handle typedefs. - */ -typedef struct _lpspi_slave_edma_handle lpspi_slave_edma_handle_t; - -/*! - * @brief Completion callback function pointer type. - * - * @param base LPSPI peripheral base address. - * @param handle Pointer to the handle for the LPSPI master. - * @param status Success or error code describing whether the transfer completed. - * @param userData Arbitrary pointer-dataSized value passed from the application. - */ -typedef void (*lpspi_master_edma_transfer_callback_t)(LPSPI_Type *base, - lpspi_master_edma_handle_t *handle, - status_t status, - void *userData); -/*! - * @brief Completion callback function pointer type. - * - * @param base LPSPI peripheral base address. - * @param handle Pointer to the handle for the LPSPI slave. - * @param status Success or error code describing whether the transfer completed. - * @param userData Arbitrary pointer-dataSized value passed from the application. - */ -typedef void (*lpspi_slave_edma_transfer_callback_t)(LPSPI_Type *base, - lpspi_slave_edma_handle_t *handle, - status_t status, - void *userData); - -/*! @brief LPSPI master eDMA transfer handle structure used for transactional API. */ -struct _lpspi_master_edma_handle -{ - volatile bool isPcsContinuous; /*!< Is PCS continuous in transfer. */ - - volatile bool isByteSwap; /*!< A flag that whether should byte swap. */ - - volatile uint8_t fifoSize; /*!< FIFO dataSize. */ - - volatile uint8_t rxWatermark; /*!< Rx watermark. */ - - volatile uint8_t bytesEachWrite; /*!< Bytes for each write TDR. */ - volatile uint8_t bytesEachRead; /*!< Bytes for each read RDR. */ - - volatile uint8_t bytesLastRead; /*!< Bytes for last read RDR. */ - volatile bool isThereExtraRxBytes; /*!< Is there extra RX byte. */ - - uint8_t *volatile txData; /*!< Send buffer. */ - uint8_t *volatile rxData; /*!< Receive buffer. */ - volatile size_t txRemainingByteCount; /*!< Number of bytes remaining to send.*/ - volatile size_t rxRemainingByteCount; /*!< Number of bytes remaining to receive.*/ - - volatile uint32_t writeRegRemainingTimes; /*!< Write TDR register remaining times. */ - volatile uint32_t readRegRemainingTimes; /*!< Read RDR register remaining times. */ - - uint32_t totalByteCount; /*!< Number of transfer bytes*/ - - uint32_t txBuffIfNull; /*!< Used if there is not txData for DMA purpose.*/ - uint32_t rxBuffIfNull; /*!< Used if there is not rxData for DMA purpose.*/ - - uint32_t transmitCommand; /*!< Used to write TCR for DMA purpose.*/ - - volatile uint8_t state; /*!< LPSPI transfer state , _lpspi_transfer_state.*/ - - uint8_t nbytes; /*!< eDMA minor byte transfer count initially configured. */ - - lpspi_master_edma_transfer_callback_t callback; /*!< Completion callback. */ - void *userData; /*!< Callback user data. */ - - edma_handle_t *edmaRxRegToRxDataHandle; /*!async_status = status; - (void)xSemaphoreGiveFromISR(handle->event, &reschedule); - portYIELD_FROM_ISR(reschedule); -} - -/*! - * brief Initializes LPSPI. - * - * This function initializes the LPSPI module and related RTOS context. - * - * param handle The RTOS LPSPI handle, the pointer to an allocated space for RTOS context. - * param base The pointer base address of the LPSPI instance to initialize. - * param masterConfig Configuration structure to set-up LPSPI in master mode. - * param srcClock_Hz Frequency of input clock of the LPSPI module. - * return status of the operation. - */ -status_t LPSPI_RTOS_Init(lpspi_rtos_handle_t *handle, - LPSPI_Type *base, - const lpspi_master_config_t *masterConfig, - uint32_t srcClock_Hz) -{ - if (handle == NULL) - { - return kStatus_InvalidArgument; - } - - if (base == NULL) - { - return kStatus_InvalidArgument; - } - - (void)memset(handle, 0, sizeof(lpspi_rtos_handle_t)); - - handle->mutex = xSemaphoreCreateMutex(); - if (handle->mutex == NULL) - { - return kStatus_Fail; - } - - handle->event = xSemaphoreCreateBinary(); - if (handle->event == NULL) - { - vSemaphoreDelete(handle->mutex); - return kStatus_Fail; - } - - handle->base = base; - - (void)LPSPI_MasterInit(handle->base, masterConfig, srcClock_Hz); - LPSPI_MasterTransferCreateHandle(handle->base, &handle->drv_handle, LPSPI_RTOS_Callback, (void *)handle); - - return kStatus_Success; -} - -/*! - * brief Deinitializes the LPSPI. - * - * This function deinitializes the LPSPI module and related RTOS context. - * - * param handle The RTOS LPSPI handle. - */ -status_t LPSPI_RTOS_Deinit(lpspi_rtos_handle_t *handle) -{ - LPSPI_Deinit(handle->base); - vSemaphoreDelete(handle->event); - vSemaphoreDelete(handle->mutex); - - return kStatus_Success; -} - -/*! - * brief Performs LPSPI transfer. - * - * This function performs an LPSPI transfer according to data given in the transfer structure. - * - * param handle The RTOS LPSPI handle. - * param transfer Structure specifying the transfer parameters. - * return status of the operation. - */ -status_t LPSPI_RTOS_Transfer(lpspi_rtos_handle_t *handle, lpspi_transfer_t *transfer) -{ - status_t status; - - /* Lock resource mutex */ - if (xSemaphoreTake(handle->mutex, portMAX_DELAY) != pdTRUE) - { - return kStatus_LPSPI_Busy; - } - - /* Initiate transfer */ - status = LPSPI_MasterTransferNonBlocking(handle->base, &handle->drv_handle, transfer); - if (status != kStatus_Success) - { - (void)xSemaphoreGive(handle->mutex); - return status; - } - - /* Wait for transfer to finish */ - if (xSemaphoreTake(handle->event, portMAX_DELAY) != pdTRUE) - { - return kStatus_LPSPI_Error; - } - - /* Retrieve status before releasing mutex */ - status = handle->async_status; - - /* Unlock resource mutex */ - (void)xSemaphoreGive(handle->mutex); - - /* Translate status of underlying driver */ - if (status == kStatus_LPSPI_Idle) - { - status = kStatus_Success; - } - - return status; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpspi_freertos.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpspi_freertos.h deleted file mode 100644 index 98fe4b16f95..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpspi_freertos.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LPSPI_FREERTOS_H__ -#define FSL_LPSPI_FREERTOS_H__ - -#include "FreeRTOS.h" -#include "portable.h" -#include "semphr.h" -#include "fsl_lpspi.h" - -/*! - * @addtogroup lpspi_freertos_driver - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief LPSPI FreeRTOS driver version 2.0.0. */ -#define FSL_LPSPI_FREERTOS_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) -/*@}*/ - -/*! @brief LPSPI FreeRTOS handle */ -typedef struct _lpspi_rtos_handle -{ - LPSPI_Type *base; /*!< LPSPI base address */ - lpspi_master_handle_t drv_handle; /*!< Handle of the underlying driver, treated as opaque by the RTOS layer */ - status_t async_status; - SemaphoreHandle_t mutex; /*!< Mutex to lock the handle during a trasfer */ - SemaphoreHandle_t event; /*!< Semaphore to notify and unblock task when transfer ends */ -} lpspi_rtos_handle_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name LPSPI RTOS Operation - * @{ - */ - -/*! - * @brief Initializes LPSPI. - * - * This function initializes the LPSPI module and related RTOS context. - * - * @param handle The RTOS LPSPI handle, the pointer to an allocated space for RTOS context. - * @param base The pointer base address of the LPSPI instance to initialize. - * @param masterConfig Configuration structure to set-up LPSPI in master mode. - * @param srcClock_Hz Frequency of input clock of the LPSPI module. - * @return status of the operation. - */ -status_t LPSPI_RTOS_Init(lpspi_rtos_handle_t *handle, - LPSPI_Type *base, - const lpspi_master_config_t *masterConfig, - uint32_t srcClock_Hz); - -/*! - * @brief Deinitializes the LPSPI. - * - * This function deinitializes the LPSPI module and related RTOS context. - * - * @param handle The RTOS LPSPI handle. - */ -status_t LPSPI_RTOS_Deinit(lpspi_rtos_handle_t *handle); - -/*! - * @brief Performs LPSPI transfer. - * - * This function performs an LPSPI transfer according to data given in the transfer structure. - * - * @param handle The RTOS LPSPI handle. - * @param transfer Structure specifying the transfer parameters. - * @return status of the operation. - */ -status_t LPSPI_RTOS_Transfer(lpspi_rtos_handle_t *handle, lpspi_transfer_t *transfer); - -/*! - * @} - */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ - -#endif /* FSL_LPSPI_FREERTOS_H__ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lptmr.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lptmr.c deleted file mode 100644 index 4741e22a658..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lptmr.c +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2017 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lptmr.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lptmr" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#if defined(LPTMR_CLOCKS) -/*! - * @brief Gets the instance from the base address to be used to gate or ungate the module clock - * - * @param base LPTMR peripheral base address - * - * @return The LPTMR instance - */ -static uint32_t LPTMR_GetInstance(LPTMR_Type *base); -#endif /* LPTMR_CLOCKS */ - -/******************************************************************************* - * Variables - ******************************************************************************/ -#if defined(LPTMR_CLOCKS) -/*! @brief Pointers to LPTMR bases for each instance. */ -static LPTMR_Type *const s_lptmrBases[] = LPTMR_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to LPTMR clocks for each instance. */ -static const clock_ip_name_t s_lptmrClocks[] = LPTMR_CLOCKS; - -#if defined(LPTMR_PERIPH_CLOCKS) -/* Array of LPTMR functional clock name. */ -static const clock_ip_name_t s_lptmrPeriphClocks[] = LPTMR_PERIPH_CLOCKS; -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* LPTMR_CLOCKS */ - -/******************************************************************************* - * Code - ******************************************************************************/ -#if defined(LPTMR_CLOCKS) -static uint32_t LPTMR_GetInstance(LPTMR_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_lptmrBases); instance++) - { - if (s_lptmrBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_lptmrBases)); - - return instance; -} -#endif /* LPTMR_CLOCKS */ - -/*! - * brief Ungates the LPTMR clock and configures the peripheral for a basic operation. - * - * note This API should be called at the beginning of the application using the LPTMR driver. - * - * param base LPTMR peripheral base address - * param config A pointer to the LPTMR configuration structure. - */ -void LPTMR_Init(LPTMR_Type *base, const lptmr_config_t *config) -{ - assert(NULL != config); - -#if defined(LPTMR_CLOCKS) -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - - uint32_t instance = LPTMR_GetInstance(base); - - /* Ungate the LPTMR clock*/ - CLOCK_EnableClock(s_lptmrClocks[instance]); -#if defined(LPTMR_PERIPH_CLOCKS) - CLOCK_EnableClock(s_lptmrPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* LPTMR_CLOCKS */ - - /* Configure the timers operation mode and input pin setup */ - base->CSR = (LPTMR_CSR_TMS(config->timerMode) | LPTMR_CSR_TFC(config->enableFreeRunning) | - LPTMR_CSR_TPP(config->pinPolarity) | LPTMR_CSR_TPS(config->pinSelect)); - - /* Configure the prescale value and clock source */ - base->PSR = (LPTMR_PSR_PRESCALE(config->value) | LPTMR_PSR_PBYP(config->bypassPrescaler) | - LPTMR_PSR_PCS(config->prescalerClockSource)); -} - -/*! - * brief Gates the LPTMR clock. - * - * param base LPTMR peripheral base address - */ -void LPTMR_Deinit(LPTMR_Type *base) -{ - /* Disable the LPTMR and reset the internal logic */ - base->CSR &= ~LPTMR_CSR_TEN_MASK; - -#if defined(LPTMR_CLOCKS) -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - - uint32_t instance = LPTMR_GetInstance(base); - - /* Gate the LPTMR clock*/ - CLOCK_DisableClock(s_lptmrClocks[instance]); -#if defined(LPTMR_PERIPH_CLOCKS) - CLOCK_DisableClock(s_lptmrPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* LPTMR_CLOCKS */ -} - -/*! - * brief Fills in the LPTMR configuration structure with default settings. - * - * The default values are as follows. - * code - * config->timerMode = kLPTMR_TimerModeTimeCounter; - * config->pinSelect = kLPTMR_PinSelectInput_0; - * config->pinPolarity = kLPTMR_PinPolarityActiveHigh; - * config->enableFreeRunning = false; - * config->bypassPrescaler = true; - * config->prescalerClockSource = kLPTMR_PrescalerClock_1; - * config->value = kLPTMR_Prescale_Glitch_0; - * endcode - * param config A pointer to the LPTMR configuration structure. - */ -void LPTMR_GetDefaultConfig(lptmr_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - /* Use time counter mode */ - config->timerMode = kLPTMR_TimerModeTimeCounter; - /* Use input 0 as source in pulse counter mode */ - config->pinSelect = kLPTMR_PinSelectInput_0; - /* Pulse input pin polarity is active-high */ - config->pinPolarity = kLPTMR_PinPolarityActiveHigh; - /* Counter resets whenever TCF flag is set */ - config->enableFreeRunning = false; - /* Bypass the prescaler */ - config->bypassPrescaler = true; - /* LPTMR clock source */ -#if !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT) - config->prescalerClockSource = kLPTMR_PrescalerClock_1; -#else - config->prescalerClockSource = kLPTMR_PrescalerClock_0; -#endif /* FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT */ - /* Divide the prescaler clock by 2 */ - config->value = kLPTMR_Prescale_Glitch_0; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lptmr.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lptmr.h deleted file mode 100644 index ba94fe17738..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lptmr.h +++ /dev/null @@ -1,374 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2017 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LPTMR_H_ -#define FSL_LPTMR_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup lptmr - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -#define FSL_LPTMR_DRIVER_VERSION (MAKE_VERSION(2, 1, 1)) /*!< Version 2.1.1 */ -/*@}*/ - -/*! @brief LPTMR pin selection used in pulse counter mode.*/ -typedef enum _lptmr_pin_select -{ - kLPTMR_PinSelectInput_0 = 0x0U, /*!< Pulse counter input 0 is selected */ - kLPTMR_PinSelectInput_1 = 0x1U, /*!< Pulse counter input 1 is selected */ - kLPTMR_PinSelectInput_2 = 0x2U, /*!< Pulse counter input 2 is selected */ - kLPTMR_PinSelectInput_3 = 0x3U /*!< Pulse counter input 3 is selected */ -} lptmr_pin_select_t; - -/*! @brief LPTMR pin polarity used in pulse counter mode.*/ -typedef enum _lptmr_pin_polarity -{ - kLPTMR_PinPolarityActiveHigh = 0x0U, /*!< Pulse Counter input source is active-high */ - kLPTMR_PinPolarityActiveLow = 0x1U /*!< Pulse Counter input source is active-low */ -} lptmr_pin_polarity_t; - -/*! @brief LPTMR timer mode selection.*/ -typedef enum _lptmr_timer_mode -{ - kLPTMR_TimerModeTimeCounter = 0x0U, /*!< Time Counter mode */ - kLPTMR_TimerModePulseCounter = 0x1U /*!< Pulse Counter mode */ -} lptmr_timer_mode_t; - -/*! @brief LPTMR prescaler/glitch filter values*/ -typedef enum _lptmr_prescaler_glitch_value -{ - kLPTMR_Prescale_Glitch_0 = 0x0U, /*!< Prescaler divide 2, glitch filter does not support this setting */ - kLPTMR_Prescale_Glitch_1 = 0x1U, /*!< Prescaler divide 4, glitch filter 2 */ - kLPTMR_Prescale_Glitch_2 = 0x2U, /*!< Prescaler divide 8, glitch filter 4 */ - kLPTMR_Prescale_Glitch_3 = 0x3U, /*!< Prescaler divide 16, glitch filter 8 */ - kLPTMR_Prescale_Glitch_4 = 0x4U, /*!< Prescaler divide 32, glitch filter 16 */ - kLPTMR_Prescale_Glitch_5 = 0x5U, /*!< Prescaler divide 64, glitch filter 32 */ - kLPTMR_Prescale_Glitch_6 = 0x6U, /*!< Prescaler divide 128, glitch filter 64 */ - kLPTMR_Prescale_Glitch_7 = 0x7U, /*!< Prescaler divide 256, glitch filter 128 */ - kLPTMR_Prescale_Glitch_8 = 0x8U, /*!< Prescaler divide 512, glitch filter 256 */ - kLPTMR_Prescale_Glitch_9 = 0x9U, /*!< Prescaler divide 1024, glitch filter 512*/ - kLPTMR_Prescale_Glitch_10 = 0xAU, /*!< Prescaler divide 2048 glitch filter 1024 */ - kLPTMR_Prescale_Glitch_11 = 0xBU, /*!< Prescaler divide 4096, glitch filter 2048 */ - kLPTMR_Prescale_Glitch_12 = 0xCU, /*!< Prescaler divide 8192, glitch filter 4096 */ - kLPTMR_Prescale_Glitch_13 = 0xDU, /*!< Prescaler divide 16384, glitch filter 8192 */ - kLPTMR_Prescale_Glitch_14 = 0xEU, /*!< Prescaler divide 32768, glitch filter 16384 */ - kLPTMR_Prescale_Glitch_15 = 0xFU /*!< Prescaler divide 65536, glitch filter 32768 */ -} lptmr_prescaler_glitch_value_t; - -/*! - * @brief LPTMR prescaler/glitch filter clock select. - * @note Clock connections are SoC-specific - */ -typedef enum _lptmr_prescaler_clock_select -{ - kLPTMR_PrescalerClock_0 = 0x0U, /*!< Prescaler/glitch filter clock 0 selected. */ -#if !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT) - kLPTMR_PrescalerClock_1 = 0x1U, /*!< Prescaler/glitch filter clock 1 selected. */ -#endif /* FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT */ - kLPTMR_PrescalerClock_2 = 0x2U, /*!< Prescaler/glitch filter clock 2 selected. */ -#if !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_3_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_3_SUPPORT) - kLPTMR_PrescalerClock_3 = 0x3U, /*!< Prescaler/glitch filter clock 3 selected. */ -#endif /* FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_3_SUPPORT */ -} lptmr_prescaler_clock_select_t; - -/*! @brief List of the LPTMR interrupts */ -typedef enum _lptmr_interrupt_enable -{ - kLPTMR_TimerInterruptEnable = LPTMR_CSR_TIE_MASK, /*!< Timer interrupt enable */ -} lptmr_interrupt_enable_t; - -/*! @brief List of the LPTMR status flags */ -typedef enum _lptmr_status_flags -{ - kLPTMR_TimerCompareFlag = LPTMR_CSR_TCF_MASK, /*!< Timer compare flag */ -} lptmr_status_flags_t; - -/*! - * @brief LPTMR config structure - * - * This structure holds the configuration settings for the LPTMR peripheral. To initialize this - * structure to reasonable defaults, call the LPTMR_GetDefaultConfig() function and pass a - * pointer to your configuration structure instance. - * - * The configuration struct can be made constant so it resides in flash. - */ -typedef struct _lptmr_config -{ - lptmr_timer_mode_t timerMode; /*!< Time counter mode or pulse counter mode */ - lptmr_pin_select_t pinSelect; /*!< LPTMR pulse input pin select; used only in pulse counter mode */ - lptmr_pin_polarity_t pinPolarity; /*!< LPTMR pulse input pin polarity; used only in pulse counter mode */ - bool enableFreeRunning; /*!< True: enable free running, counter is reset on overflow - False: counter is reset when the compare flag is set */ - bool bypassPrescaler; /*!< True: bypass prescaler; false: use clock from prescaler */ - lptmr_prescaler_clock_select_t prescalerClockSource; /*!< LPTMR clock source */ - lptmr_prescaler_glitch_value_t value; /*!< Prescaler or glitch filter value */ -} lptmr_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Ungates the LPTMR clock and configures the peripheral for a basic operation. - * - * @note This API should be called at the beginning of the application using the LPTMR driver. - * - * @param base LPTMR peripheral base address - * @param config A pointer to the LPTMR configuration structure. - */ -void LPTMR_Init(LPTMR_Type *base, const lptmr_config_t *config); - -/*! - * @brief Gates the LPTMR clock. - * - * @param base LPTMR peripheral base address - */ -void LPTMR_Deinit(LPTMR_Type *base); - -/*! - * @brief Fills in the LPTMR configuration structure with default settings. - * - * The default values are as follows. - * @code - * config->timerMode = kLPTMR_TimerModeTimeCounter; - * config->pinSelect = kLPTMR_PinSelectInput_0; - * config->pinPolarity = kLPTMR_PinPolarityActiveHigh; - * config->enableFreeRunning = false; - * config->bypassPrescaler = true; - * config->prescalerClockSource = kLPTMR_PrescalerClock_1; - * config->value = kLPTMR_Prescale_Glitch_0; - * @endcode - * @param config A pointer to the LPTMR configuration structure. - */ -void LPTMR_GetDefaultConfig(lptmr_config_t *config); - -/*! @}*/ - -/*! - * @name Interrupt Interface - * @{ - */ - -/*! - * @brief Enables the selected LPTMR interrupts. - * - * @param base LPTMR peripheral base address - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::lptmr_interrupt_enable_t - */ -static inline void LPTMR_EnableInterrupts(LPTMR_Type *base, uint32_t mask) -{ - uint32_t reg = base->CSR; - - /* Clear the TCF bit so that we don't clear this w1c bit when writing back */ - reg &= ~(LPTMR_CSR_TCF_MASK); - reg |= mask; - base->CSR = reg; -} - -/*! - * @brief Disables the selected LPTMR interrupts. - * - * @param base LPTMR peripheral base address - * @param mask The interrupts to disable. This is a logical OR of members of the - * enumeration ::lptmr_interrupt_enable_t. - */ -static inline void LPTMR_DisableInterrupts(LPTMR_Type *base, uint32_t mask) -{ - uint32_t reg = base->CSR; - - /* Clear the TCF bit so that we don't clear this w1c bit when writing back */ - reg &= ~(LPTMR_CSR_TCF_MASK); - reg &= ~mask; - base->CSR = reg; -} - -/*! - * @brief Gets the enabled LPTMR interrupts. - * - * @param base LPTMR peripheral base address - * - * @return The enabled interrupts. This is the logical OR of members of the - * enumeration ::lptmr_interrupt_enable_t - */ -static inline uint32_t LPTMR_GetEnabledInterrupts(LPTMR_Type *base) -{ - return (base->CSR & LPTMR_CSR_TIE_MASK); -} - -/*! @}*/ - -#if defined(FSL_FEATURE_LPTMR_HAS_CSR_TDRE) && (FSL_FEATURE_LPTMR_HAS_CSR_TDRE) -/*! - * @brief Enable or disable timer DMA request - * - * @param base base LPTMR peripheral base address - * @param enable Switcher of timer DMA feature. "true" means to enable, "false" means to disable. - */ -static inline void LPTMR_EnableTimerDMA(LPTMR_Type *base, bool enable) -{ - if (enable) - { - base->CSR |= LPTMR_CSR_TDRE_MASK; - } - else - { - base->CSR &= ~(LPTMR_CSR_TDRE_MASK); - } -} -#endif /* FSL_FEATURE_LPTMR_HAS_CSR_TDRE */ - -/*! - * @name Status Interface - * @{ - */ - -/*! - * @brief Gets the LPTMR status flags. - * - * @param base LPTMR peripheral base address - * - * @return The status flags. This is the logical OR of members of the - * enumeration ::lptmr_status_flags_t - */ -static inline uint32_t LPTMR_GetStatusFlags(LPTMR_Type *base) -{ - return (base->CSR & LPTMR_CSR_TCF_MASK); -} - -/*! - * @brief Clears the LPTMR status flags. - * - * @param base LPTMR peripheral base address - * @param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::lptmr_status_flags_t. - */ -static inline void LPTMR_ClearStatusFlags(LPTMR_Type *base, uint32_t mask) -{ - base->CSR |= mask; -} - -/*! @}*/ - -/*! - * @name Read and write the timer period - * @{ - */ - -/*! - * @brief Sets the timer period in units of count. - * - * Timers counts from 0 until it equals the count value set here. The count value is written to - * the CMR register. - * - * @note - * 1. The TCF flag is set with the CNR equals the count provided here and then increments. - * 2. Call the utility macros provided in the fsl_common.h to convert to ticks. - * - * @param base LPTMR peripheral base address - * @param ticks A timer period in units of ticks, which should be equal or greater than 1. - */ -static inline void LPTMR_SetTimerPeriod(LPTMR_Type *base, uint32_t ticks) -{ - assert(ticks > 0U); - base->CMR = LPTMR_CMR_COMPARE(ticks - 1U); -} - -/*! - * @brief Reads the current timer counting value. - * - * This function returns the real-time timer counting value in a range from 0 to a - * timer period. - * - * @note Call the utility macros provided in the fsl_common.h to convert ticks to usec or msec. - * - * @param base LPTMR peripheral base address - * - * @return The current counter value in ticks - */ -static inline uint32_t LPTMR_GetCurrentTimerCount(LPTMR_Type *base) -{ - /* Must first write any value to the CNR. This synchronizes and registers the current value - * of the CNR into a temporary register which can then be read - */ - base->CNR = 0U; - return (uint32_t)((base->CNR & LPTMR_CNR_COUNTER_MASK) >> LPTMR_CNR_COUNTER_SHIFT); -} - -/*! @}*/ - -/*! - * @name Timer Start and Stop - * @{ - */ - -/*! - * @brief Starts the timer. - * - * After calling this function, the timer counts up to the CMR register value. - * Each time the timer reaches the CMR value and then increments, it generates a - * trigger pulse and sets the timeout interrupt flag. An interrupt is also - * triggered if the timer interrupt is enabled. - * - * @param base LPTMR peripheral base address - */ -static inline void LPTMR_StartTimer(LPTMR_Type *base) -{ - uint32_t reg = base->CSR; - - /* Clear the TCF bit to avoid clearing the w1c bit when writing back. */ - reg &= ~(LPTMR_CSR_TCF_MASK); - reg |= LPTMR_CSR_TEN_MASK; - base->CSR = reg; -} - -/*! - * @brief Stops the timer. - * - * This function stops the timer and resets the timer's counter register. - * - * @param base LPTMR peripheral base address - */ -static inline void LPTMR_StopTimer(LPTMR_Type *base) -{ - uint32_t reg = base->CSR; - - /* Clear the TCF bit to avoid clearing the w1c bit when writing back. */ - reg &= ~(LPTMR_CSR_TCF_MASK); - reg &= ~LPTMR_CSR_TEN_MASK; - base->CSR = reg; -} - -/*! @}*/ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_LPTMR_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpuart.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpuart.c deleted file mode 100644 index 6972c3d88b0..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpuart.c +++ /dev/null @@ -1,2129 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpuart.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpflexcomm_lpuart" -#endif - -/*! - * @brief Used for conversion from `lpflexcomm_irq_handler_t` to `lpuart_irq_handler_t` - */ -typedef union lpuart_to_lpflexcomm -{ - lpuart_irq_handler_t lpuart_handler; - lpflexcomm_irq_handler_t lpflexcomm_handler; -} lpuart_to_lpflexcomm_t; - -/* LPUART transfer state. */ -enum -{ - kLPUART_TxIdle, /*!< TX idle. */ - kLPUART_TxBusy, /*!< TX busy. */ - kLPUART_RxIdle, /*!< RX idle. */ - kLPUART_RxBusy /*!< RX busy. */ -}; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Check whether the RX ring buffer is full. - * - * @userData handle LPUART handle pointer. - * @retval true RX ring buffer is full. - * @retval false RX ring buffer is not full. - */ -static bool LPUART_TransferIsRxRingBufferFull(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief Write to TX register using non-blocking method. - * - * This function writes data to the TX register directly, upper layer must make - * sure the TX register is empty or TX FIFO has empty room before calling this function. - * - * @note This function does not check whether all the data has been sent out to bus, - * so before disable TX, check kLPUART_TransmissionCompleteFlag to ensure the TX is - * finished. - * - * @param base LPUART peripheral base address. - * @param data Start address of the data to write. - * @param length Size of the buffer to be sent. - */ -static void LPUART_WriteNonBlocking(LPUART_Type *base, const uint8_t *data, size_t length); - -/*! - * @brief Write to TX register using non-blocking method in 9bit or 10bit mode. - * - * @note This function only support 9bit or 10bit transfer. - * - * @param base LPUART peripheral base address. - * @param data Start address of the data to write. - * @param length Size of the buffer to be sent. - */ -static void LPUART_WriteNonBlocking16bit(LPUART_Type *base, const uint16_t *data, size_t length); - -/*! - * @brief Read RX register using non-blocking method. - * - * This function reads data from the TX register directly, upper layer must make - * sure the RX register is full or TX FIFO has data before calling this function. - * - * @param base LPUART peripheral base address. - * @param data Start address of the buffer to store the received data. - * @param length Size of the buffer. - */ -static void LPUART_ReadNonBlocking(LPUART_Type *base, uint8_t *data, size_t length); - -/*! - * @brief Read RX register using non-blocking method in 9bit or 10bit mode. - * - * @note This function only support 9bit or 10bit transfer. - * - * @param base LPUART peripheral base address. - * @param data Start address of the buffer to store the received data. - * @param length Size of the buffer. - */ -static void LPUART_ReadNonBlocking16bit(LPUART_Type *base, uint16_t *data, size_t length); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/* Array of LPUART peripheral base address. */ -static LPUART_Type *const s_lpuartBases[] = LPUART_BASE_PTRS; - -/* Array of LPUART IRQ number. */ -const IRQn_Type s_lpuartIRQ[] = LPUART_RX_TX_IRQS; - -/******************************************************************************* - * Code - ******************************************************************************/ -/*! - * brief Get the LPUART instance from peripheral base address. - * - * param base LPUART peripheral base address. - * return LPUART instance. - */ -uint32_t LPUART_GetInstance(LPUART_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0U; instance < ARRAY_SIZE(s_lpuartBases); instance++) - { - if (s_lpuartBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_lpuartBases)); - - return instance; -} - -/*! - * brief Get the length of received data in RX ring buffer. - * - * userData handle LPUART handle pointer. - * return Length of received data in RX ring buffer. - */ -size_t LPUART_TransferGetRxRingBufferLength(LPUART_Type *base, lpuart_handle_t *handle) -{ - assert(NULL != handle); - - size_t size; - size_t tmpRxRingBufferSize = handle->rxRingBufferSize; - uint16_t tmpRxRingBufferTail = handle->rxRingBufferTail; - uint16_t tmpRxRingBufferHead = handle->rxRingBufferHead; - - if (tmpRxRingBufferTail > tmpRxRingBufferHead) - { - size = ((size_t)tmpRxRingBufferHead + tmpRxRingBufferSize - (size_t)tmpRxRingBufferTail); - } - else - { - size = ((size_t)tmpRxRingBufferHead - (size_t)tmpRxRingBufferTail); - } - - return size; -} - -static bool LPUART_TransferIsRxRingBufferFull(LPUART_Type *base, lpuart_handle_t *handle) -{ - assert(NULL != handle); - - bool full; - - if (LPUART_TransferGetRxRingBufferLength(base, handle) == (handle->rxRingBufferSize - 1U)) - { - full = true; - } - else - { - full = false; - } - return full; -} - -static void LPUART_WriteNonBlocking(LPUART_Type *base, const uint8_t *data, size_t length) -{ - assert(NULL != data); - - size_t i; - - /* The Non Blocking write data API assume user have ensured there is enough space in - peripheral to write. */ - for (i = 0; i < length; i++) - { - base->DATA = data[i]; - } -} - -static void LPUART_WriteNonBlocking16bit(LPUART_Type *base, const uint16_t *data, size_t length) -{ - assert(NULL != data); - - size_t i; - - /* The Non Blocking write data API assume user have ensured there is enough space in - peripheral to write. */ - for (i = 0; i < length; i++) - { - base->DATA = data[i]; - } -} -static void LPUART_ReadNonBlocking(LPUART_Type *base, uint8_t *data, size_t length) -{ - assert(NULL != data); - - size_t i; -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - uint32_t ctrl = base->CTRL; - bool isSevenDataBits = (((ctrl & LPUART_CTRL_M7_MASK) != 0U) || - (((ctrl & LPUART_CTRL_M_MASK) == 0U) && ((ctrl & LPUART_CTRL_PE_MASK) != 0U))); -#endif - - /* The Non Blocking read data API assume user have ensured there is enough space in - peripheral to write. */ - for (i = 0; i < length; i++) - { -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - if (isSevenDataBits) - { - data[i] = (uint8_t)(base->DATA & 0x7FU); - } - else - { - data[i] = (uint8_t)base->DATA; - } -#else - data[i] = (uint8_t)(base->DATA); -#endif - } -} - -static void LPUART_ReadNonBlocking16bit(LPUART_Type *base, uint16_t *data, size_t length) -{ - assert(NULL != data); - - size_t i; - /* The Non Blocking read data API assume user have ensured there is enough space in - peripheral to write. */ - for (i = 0; i < length; i++) - { - data[i] = (uint16_t)(base->DATA & 0x03FFU); - } -} -/*! - * brief Initializes an LPUART instance with the user configuration structure and the peripheral clock. - * - * This function configures the LPUART module with user-defined settings. Call the LPUART_GetDefaultConfig() function - * to configure the configuration structure and get the default configuration. - * The example below shows how to use this API to configure the LPUART. - * code - * lpuart_config_t lpuartConfig; - * lpuartConfig.baudRate_Bps = 115200U; - * lpuartConfig.parityMode = kLPUART_ParityDisabled; - * lpuartConfig.dataBitsCount = kLPUART_EightDataBits; - * lpuartConfig.isMsb = false; - * lpuartConfig.stopBitCount = kLPUART_OneStopBit; - * lpuartConfig.txFifoWatermark = 0; - * lpuartConfig.rxFifoWatermark = 1; - * LPUART_Init(LPUART1, &lpuartConfig, 20000000U); - * endcode - * - * param base LPUART peripheral base address. - * param config Pointer to a user-defined configuration structure. - * param srcClock_Hz LPUART clock source frequency in HZ. - * retval kStatus_LPUART_BaudrateNotSupport Baudrate is not support in current clock source. - * retval kStatus_Success LPUART initialize succeed - */ -status_t LPUART_Init(LPUART_Type *base, const lpuart_config_t *config, uint32_t srcClock_Hz) -{ - assert(NULL != config); - assert(0U < config->baudRate_Bps); -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - assert((uint8_t)FSL_FEATURE_LPUART_FIFO_SIZEn(base) > config->txFifoWatermark); - assert((uint8_t)FSL_FEATURE_LPUART_FIFO_SIZEn(base) > config->rxFifoWatermark); -#endif - - status_t status = kStatus_Success; - uint32_t temp; - uint16_t sbr, sbrTemp; - uint8_t osr, osrTemp; - uint32_t tempDiff, calculatedBaud, baudDiff; - - /* This LPUART instantiation uses a slightly different baud rate calculation - * The idea is to use the best OSR (over-sampling rate) possible - * Note, OSR is typically hard-set to 16 in other LPUART instantiations - * loop to find the best OSR value possible, one that generates minimum baudDiff - * iterate through the rest of the supported values of OSR */ - - baudDiff = config->baudRate_Bps; - osr = 0U; - sbr = 0U; - for (osrTemp = 4U; osrTemp <= 32U; osrTemp++) - { - /* calculate the temporary sbr value */ - sbrTemp = (uint16_t)((srcClock_Hz * 10U / (config->baudRate_Bps * (uint32_t)osrTemp) + 5U) / 10U); - /*set sbrTemp to 1 if the sourceClockInHz can not satisfy the desired baud rate*/ - if (sbrTemp == 0U) - { - sbrTemp = 1U; - } - else if (sbrTemp > LPUART_BAUD_SBR_MASK) - { - sbrTemp = LPUART_BAUD_SBR_MASK; - } - else - { - /* For MISRA 15.7 */ - } - /* Calculate the baud rate based on the temporary OSR and SBR values */ - calculatedBaud = (srcClock_Hz / ((uint32_t)osrTemp * (uint32_t)sbrTemp)); - tempDiff = calculatedBaud > config->baudRate_Bps ? (calculatedBaud - config->baudRate_Bps) : - (config->baudRate_Bps - calculatedBaud); - - if (tempDiff <= baudDiff) - { - baudDiff = tempDiff; - osr = osrTemp; /* update and store the best OSR value calculated */ - sbr = sbrTemp; /* update store the best SBR value calculated */ - } - } - - /* Check to see if actual baud rate is within 3% of desired baud rate - * based on the best calculate OSR value */ - if (baudDiff > ((config->baudRate_Bps / 100U) * 3U)) - { - /* Unacceptable baud rate difference of more than 3%*/ - status = kStatus_LPUART_BaudrateNotSupport; - } - else - { -#if !(defined(LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) && LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) - /* initialize flexcomm to LPUART mode */ - status = LP_FLEXCOMM_Init(LPUART_GetInstance(base), LP_FLEXCOMM_PERIPH_LPUART); - if (kStatus_Success != status) - { - return status; - } -#endif /* LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER */ - -#if defined(FSL_FEATURE_LPUART_HAS_GLOBAL) && FSL_FEATURE_LPUART_HAS_GLOBAL - /*Reset all internal logic and registers, except the Global Register */ - LPUART_SoftwareReset(base); -#else - /* Disable LPUART TX RX before setting. */ - base->CTRL &= ~(LPUART_CTRL_TE_MASK | LPUART_CTRL_RE_MASK); -#endif - - temp = base->BAUD; - - /* Acceptable baud rate, check if OSR is between 4x and 7x oversampling. - * If so, then "BOTHEDGE" sampling must be turned on */ - if ((osr > 3U) && (osr < 8U)) - { - temp |= LPUART_BAUD_BOTHEDGE_MASK; - } - - /* program the osr value (bit value is one less than actual value) */ - temp &= ~LPUART_BAUD_OSR_MASK; - temp |= LPUART_BAUD_OSR((uint32_t)osr - 1UL); - - /* write the sbr value to the BAUD registers */ - temp &= ~LPUART_BAUD_SBR_MASK; - base->BAUD = temp | LPUART_BAUD_SBR(sbr); - - /* Set bit count and parity mode. */ - base->BAUD &= ~LPUART_BAUD_M10_MASK; - - temp = base->CTRL & ~(LPUART_CTRL_PE_MASK | LPUART_CTRL_PT_MASK | LPUART_CTRL_M_MASK | LPUART_CTRL_ILT_MASK | - LPUART_CTRL_IDLECFG_MASK); - - temp |= (uint8_t)config->parityMode | LPUART_CTRL_IDLECFG(config->rxIdleConfig) | - LPUART_CTRL_ILT(config->rxIdleType); - -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - if (kLPUART_SevenDataBits == config->dataBitsCount) - { - if (kLPUART_ParityDisabled != config->parityMode) - { - temp &= ~LPUART_CTRL_M7_MASK; /* Seven data bits and one parity bit */ - } - else - { - temp |= LPUART_CTRL_M7_MASK; - } - } - else -#endif - { - if (kLPUART_ParityDisabled != config->parityMode) - { - temp |= LPUART_CTRL_M_MASK; /* Eight data bits and one parity bit */ - } - } - - base->CTRL = temp; - -#if defined(FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT) && FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT - /* set stop bit per char */ - temp = base->BAUD & ~LPUART_BAUD_SBNS_MASK; - base->BAUD = temp | LPUART_BAUD_SBNS((uint8_t)config->stopBitCount); -#endif - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Set tx/rx WATER watermark - Note: - Take care of the RX FIFO, RX interrupt request only assert when received bytes - equal or more than RX water mark, there is potential issue if RX water - mark larger than 1. - For example, if RX FIFO water mark is 2, upper layer needs 5 bytes and - 5 bytes are received. the last byte will be saved in FIFO but not trigger - RX interrupt because the water mark is 2. - */ - base->WATER = (((uint32_t)(config->rxFifoWatermark) << 16U) | config->txFifoWatermark); - - /* Enable tx/rx FIFO */ - base->FIFO |= (LPUART_FIFO_TXFE_MASK | LPUART_FIFO_RXFE_MASK); - - /* Flush FIFO */ - base->FIFO |= (LPUART_FIFO_TXFLUSH_MASK | LPUART_FIFO_RXFLUSH_MASK); -#endif - - /* Clear all status flags */ - temp = (LPUART_STAT_RXEDGIF_MASK | LPUART_STAT_IDLE_MASK | LPUART_STAT_OR_MASK | LPUART_STAT_NF_MASK | - LPUART_STAT_FE_MASK | LPUART_STAT_PF_MASK); - -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - temp |= LPUART_STAT_LBKDIF_MASK; -#endif - -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - temp |= (LPUART_STAT_MA1F_MASK | LPUART_STAT_MA2F_MASK); -#endif - -#if defined(FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT) && FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT - /* Set the CTS configuration/TX CTS source. */ - base->MODIR |= LPUART_MODIR_TXCTSC(config->txCtsConfig) | LPUART_MODIR_TXCTSSRC(config->txCtsSource); - if (true == config->enableRxRTS) - { - /* Enable the receiver RTS(request-to-send) function. */ - base->MODIR |= LPUART_MODIR_RXRTSE_MASK; - } - if (true == config->enableTxCTS) - { - /* Enable the CTS(clear-to-send) function. */ - base->MODIR |= LPUART_MODIR_TXCTSE_MASK; - } -#endif - - /* Set data bits order. */ - if (true == config->isMsb) - { - temp |= LPUART_STAT_MSBF_MASK; - } - else - { - temp &= ~LPUART_STAT_MSBF_MASK; - } - - base->STAT |= temp; - - /* Enable TX/RX base on configure structure. */ - temp = base->CTRL; - if (true == config->enableTx) - { - temp |= LPUART_CTRL_TE_MASK; - } - - if (true == config->enableRx) - { - temp |= LPUART_CTRL_RE_MASK; - } - - base->CTRL = temp; -#if defined(FSL_FEATURE_LPUART_HAS_TIMEOUT) && FSL_FEATURE_LPUART_HAS_TIMEOUT - /* Timeout configuration. */ - base->REIR = (uint32_t)config->timeoutConfig.rxExtendedTimeoutValue; - base->TEIR = (uint32_t)config->timeoutConfig.txExtendedTimeoutValue; - base->TOCR |= (uint32_t)config->timeoutConfig.rxCounter0.enableCounter | - ((uint32_t)config->timeoutConfig.rxCounter1.enableCounter << 1U) | - ((uint32_t)config->timeoutConfig.txCounter0.enableCounter << 2U) | - ((uint32_t)config->timeoutConfig.txCounter1.enableCounter << 3U); - base->TIMEOUT[0] = ((uint32_t)config->timeoutConfig.rxCounter0.timeoutCondition << 30U) | - (uint32_t)config->timeoutConfig.rxCounter0.timeoutValue; - base->TIMEOUT[1] = ((uint32_t)config->timeoutConfig.rxCounter1.timeoutCondition << 30U) | - (uint32_t)config->timeoutConfig.rxCounter1.timeoutValue; - base->TIMEOUT[2] = ((uint32_t)config->timeoutConfig.txCounter0.timeoutCondition << 30U) | - (uint32_t)config->timeoutConfig.txCounter0.timeoutValue; - base->TIMEOUT[3] = ((uint32_t)config->timeoutConfig.txCounter1.timeoutCondition << 30U) | - (uint32_t)config->timeoutConfig.txCounter1.timeoutValue; -#endif - - /* Siglewire configuration. */ -#if defined(FSL_FEATURE_LPUART_HAS_HDCR) && FSL_FEATURE_LPUART_HAS_HDCR - base->HDCR = (uint32_t)config->rtsDelay << 8U; - if (config->enableSingleWire) - { - base->HDCR |= 0xFUL; - } -#endif - } - return status; -} -/*! - * brief Deinitializes a LPUART instance. - * - * This function waits for transmit to complete, disables TX and RX, and disables the LPUART clock. - * - * param base LPUART peripheral base address. - */ -void LPUART_Deinit(LPUART_Type *base) -{ - uint32_t temp; - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Wait tx FIFO send out*/ - while (0U != ((base->WATER & LPUART_WATER_TXCOUNT_MASK) >> LPUART_WATER_TXWATER_SHIFT)) - { - } -#endif - /* Wait last char shift out */ - while (0U == (base->STAT & LPUART_STAT_TC_MASK)) - { - } - - /* Clear all status flags */ - temp = (LPUART_STAT_RXEDGIF_MASK | LPUART_STAT_IDLE_MASK | LPUART_STAT_OR_MASK | LPUART_STAT_NF_MASK | - LPUART_STAT_FE_MASK | LPUART_STAT_PF_MASK); - -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - temp |= LPUART_STAT_LBKDIF_MASK; -#endif - -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - temp |= (LPUART_STAT_MA1F_MASK | LPUART_STAT_MA2F_MASK); -#endif - - base->STAT |= temp; - - /* Disable the module. */ - base->CTRL = 0U; - -#if !(defined(LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) && LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) - LP_FLEXCOMM_Deinit(LPUART_GetInstance(base)); -#endif -} - -/*! - * brief Gets the default configuration structure. - * - * This function initializes the LPUART configuration structure to a default value. The default - * values are: - * lpuartConfig->baudRate_Bps = 115200U; - * lpuartConfig->parityMode = kLPUART_ParityDisabled; - * lpuartConfig->dataBitsCount = kLPUART_EightDataBits; - * lpuartConfig->isMsb = false; - * lpuartConfig->stopBitCount = kLPUART_OneStopBit; - * lpuartConfig->txFifoWatermark = 0; - * lpuartConfig->rxFifoWatermark = 1; - * lpuartConfig->rxIdleType = kLPUART_IdleTypeStartBit; - * lpuartConfig->rxIdleConfig = kLPUART_IdleCharacter1; - * lpuartConfig->enableTx = false; - * lpuartConfig->enableRx = false; - * - * param config Pointer to a configuration structure. - */ -void LPUART_GetDefaultConfig(lpuart_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->baudRate_Bps = 115200U; - config->parityMode = kLPUART_ParityDisabled; - config->dataBitsCount = kLPUART_EightDataBits; - config->isMsb = false; -#if defined(FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT) && FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT - config->stopBitCount = kLPUART_OneStopBit; -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - config->txFifoWatermark = 0U; - config->rxFifoWatermark = 0U; -#endif -#if defined(FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT) && FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT - config->enableRxRTS = false; - config->enableTxCTS = false; - config->txCtsConfig = kLPUART_CtsSampleAtStart; - config->txCtsSource = kLPUART_CtsSourcePin; -#endif - config->rxIdleType = kLPUART_IdleTypeStartBit; - config->rxIdleConfig = kLPUART_IdleCharacter1; - config->enableTx = false; - config->enableRx = false; -} - -/*! - * brief Sets the LPUART instance baudrate. - * - * This function configures the LPUART module baudrate. This function is used to update - * the LPUART module baudrate after the LPUART module is initialized by the LPUART_Init. - * code - * LPUART_SetBaudRate(LPUART1, 115200U, 20000000U); - * endcode - * - * param base LPUART peripheral base address. - * param baudRate_Bps LPUART baudrate to be set. - * param srcClock_Hz LPUART clock source frequency in HZ. - * retval kStatus_LPUART_BaudrateNotSupport Baudrate is not supported in the current clock source. - * retval kStatus_Success Set baudrate succeeded. - */ -status_t LPUART_SetBaudRate(LPUART_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz) -{ - assert(0U < baudRate_Bps); - - status_t status = kStatus_Success; - uint32_t temp, oldCtrl; - uint16_t sbr, sbrTemp; - uint8_t osr, osrTemp; - uint32_t tempDiff, calculatedBaud, baudDiff; - - /* This LPUART instantiation uses a slightly different baud rate calculation - * The idea is to use the best OSR (over-sampling rate) possible - * Note, OSR is typically hard-set to 16 in other LPUART instantiations - * loop to find the best OSR value possible, one that generates minimum baudDiff - * iterate through the rest of the supported values of OSR */ - - baudDiff = baudRate_Bps; - osr = 0U; - sbr = 0U; - for (osrTemp = 4U; osrTemp <= 32U; osrTemp++) - { - /* calculate the temporary sbr value */ - sbrTemp = (uint16_t)((srcClock_Hz * 10U / (baudRate_Bps * (uint32_t)osrTemp) + 5U) / 10U); - /*set sbrTemp to 1 if the sourceClockInHz can not satisfy the desired baud rate*/ - if (sbrTemp == 0U) - { - sbrTemp = 1U; - } - else if (sbrTemp > LPUART_BAUD_SBR_MASK) - { - sbrTemp = LPUART_BAUD_SBR_MASK; - } - else - { - /* For MISRA 15.7 */ - } - - /* Calculate the baud rate based on the temporary OSR and SBR values */ - calculatedBaud = srcClock_Hz / ((uint32_t)osrTemp * (uint32_t)sbrTemp); - - tempDiff = calculatedBaud > baudRate_Bps ? (calculatedBaud - baudRate_Bps) : (baudRate_Bps - calculatedBaud); - - if (tempDiff <= baudDiff) - { - baudDiff = tempDiff; - osr = osrTemp; /* update and store the best OSR value calculated */ - sbr = sbrTemp; /* update store the best SBR value calculated */ - } - } - - /* Check to see if actual baud rate is within 3% of desired baud rate - * based on the best calculate OSR value */ - if (baudDiff < (uint32_t)((baudRate_Bps / 100U) * 3U)) - { - /* Store CTRL before disable Tx and Rx */ - oldCtrl = base->CTRL; - - /* Disable LPUART TX RX before setting. */ - base->CTRL &= ~(LPUART_CTRL_TE_MASK | LPUART_CTRL_RE_MASK); - - temp = base->BAUD; - - /* Acceptable baud rate, check if OSR is between 4x and 7x oversampling. - * If so, then "BOTHEDGE" sampling must be turned on */ - if ((osr > 3U) && (osr < 8U)) - { - temp |= LPUART_BAUD_BOTHEDGE_MASK; - } - - /* program the osr value (bit value is one less than actual value) */ - temp &= ~LPUART_BAUD_OSR_MASK; - temp |= LPUART_BAUD_OSR((uint32_t)osr - 1UL); - - /* write the sbr value to the BAUD registers */ - temp &= ~LPUART_BAUD_SBR_MASK; - base->BAUD = temp | LPUART_BAUD_SBR(sbr); - - /* Restore CTRL. */ - base->CTRL = oldCtrl; - } - else - { - /* Unacceptable baud rate difference of more than 3%*/ - status = kStatus_LPUART_BaudrateNotSupport; - } - - return status; -} - -/*! - * brief Enable 9-bit data mode for LPUART. - * - * This function set the 9-bit mode for LPUART module. The 9th bit is not used for parity thus can be modified by user. - * - * param base LPUART peripheral base address. - * param enable true to enable, flase to disable. - */ -void LPUART_Enable9bitMode(LPUART_Type *base, bool enable) -{ - assert(base != NULL); - - uint32_t temp = 0U; - - if (enable) - { - /* Set LPUART_CTRL_M for 9-bit mode, clear LPUART_CTRL_PE to disable parity. */ - temp = base->CTRL & ~((uint32_t)LPUART_CTRL_PE_MASK | (uint32_t)LPUART_CTRL_M_MASK); - temp |= (uint32_t)LPUART_CTRL_M_MASK; - base->CTRL = temp; - } - else - { - /* Clear LPUART_CTRL_M. */ - base->CTRL &= ~(uint32_t)LPUART_CTRL_M_MASK; - } -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - /* Clear LPUART_CTRL_M7 to disable 7-bit mode. */ - base->CTRL &= ~(uint32_t)LPUART_CTRL_M7_MASK; -#endif -#if defined(FSL_FEATURE_LPUART_HAS_10BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_10BIT_DATA_SUPPORT - /* Clear LPUART_BAUD_M10 to disable 10-bit mode. */ - base->BAUD &= ~(uint32_t)LPUART_BAUD_M10_MASK; -#endif -} - -/*! - * brief Transmit an address frame in 9-bit data mode. - * - * param base LPUART peripheral base address. - * param address LPUART slave address. - */ -void LPUART_SendAddress(LPUART_Type *base, uint8_t address) -{ - assert(base != NULL); - - uint32_t temp = base->DATA & 0xFFFFFC00UL; - temp |= ((uint32_t)address | (1UL << LPUART_DATA_R8T8_SHIFT)); - base->DATA = temp; -} - -/*! - * brief Enables LPUART interrupts according to a provided mask. - * - * This function enables the LPUART interrupts according to a provided mask. The mask - * is a logical OR of enumeration members. See the ref _lpuart_interrupt_enable. - * This examples shows how to enable TX empty interrupt and RX full interrupt: - * code - * LPUART_EnableInterrupts(LPUART1,kLPUART_TxDataRegEmptyInterruptEnable | kLPUART_RxDataRegFullInterruptEnable); - * endcode - * - * param base LPUART peripheral base address. - * param mask The interrupts to enable. Logical OR of ref _uart_interrupt_enable. - */ -void LPUART_EnableInterrupts(LPUART_Type *base, uint32_t mask) -{ - uint32_t s_atomicOldInt; - /* Only consider the real interrupt enable bits. */ - mask &= (uint32_t)kLPUART_AllInterruptEnable; - -#if defined(FSL_FEATURE_LPUART_HAS_MCR) && FSL_FEATURE_LPUART_HAS_MCR - /* Modem control interrupt enables */ - base->MCR |= (mask & 0xFUL); -#endif -#if defined(FSL_FEATURE_LPUART_HAS_TIMEOUT) && FSL_FEATURE_LPUART_HAS_TIMEOUT - /* Timeout interrupt enables. */ - base->TOSR |= ((mask >> 2U) & 0xF00UL); -#endif - /* Check int enable bits in base->BAUD */ - uint32_t baudRegMask = 0UL; -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - baudRegMask |= ((mask << 8U) & LPUART_BAUD_LBKDIE_MASK); - /* Clear bit 7 from mask */ - mask &= ~(uint32_t)kLPUART_LinBreakInterruptEnable; -#endif - baudRegMask |= ((mask << 8U) & LPUART_BAUD_RXEDGIE_MASK); - /* Clear bit 6 from mask */ - mask &= ~(uint32_t)kLPUART_RxActiveEdgeInterruptEnable; - - s_atomicOldInt = DisableGlobalIRQ(); - base->BAUD |= baudRegMask; - EnableGlobalIRQ(s_atomicOldInt); - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Check int enable bits in base->FIFO */ - - s_atomicOldInt = DisableGlobalIRQ(); - base->FIFO = (base->FIFO & ~(LPUART_FIFO_TXOF_MASK | LPUART_FIFO_RXUF_MASK)) | - (mask & (LPUART_FIFO_TXOFE_MASK | LPUART_FIFO_RXUFE_MASK)); - EnableGlobalIRQ(s_atomicOldInt); - - /* Clear bit 9 and bit 8 from mask */ - mask &= ~((uint32_t)kLPUART_TxFifoOverflowInterruptEnable | (uint32_t)kLPUART_RxFifoUnderflowInterruptEnable); -#endif - - /* Check int enable bits in base->CTRL */ - s_atomicOldInt = DisableGlobalIRQ(); - base->CTRL |= mask; - EnableGlobalIRQ(s_atomicOldInt); -} - -/*! - * brief Disables LPUART interrupts according to a provided mask. - * - * This function disables the LPUART interrupts according to a provided mask. The mask - * is a logical OR of enumeration members. See ref _lpuart_interrupt_enable. - * This example shows how to disable the TX empty interrupt and RX full interrupt: - * code - * LPUART_DisableInterrupts(LPUART1,kLPUART_TxDataRegEmptyInterruptEnable | kLPUART_RxDataRegFullInterruptEnable); - * endcode - * - * param base LPUART peripheral base address. - * param mask The interrupts to disable. Logical OR of ref _lpuart_interrupt_enable. - */ -void LPUART_DisableInterrupts(LPUART_Type *base, uint32_t mask) -{ - uint32_t s_atomicOldInt; - /* Only consider the real interrupt enable bits. */ - mask &= (uint32_t)kLPUART_AllInterruptEnable; - -#if defined(FSL_FEATURE_LPUART_HAS_MCR) && FSL_FEATURE_LPUART_HAS_MCR - /* Modem control interrupts. */ - base->MCR &= ~(mask & 0xFUL); -#endif -#if defined(FSL_FEATURE_LPUART_HAS_TIMEOUT) && FSL_FEATURE_LPUART_HAS_TIMEOUT - /* Timeout interrupt enables. */ - base->TOSR &= ~((mask >> 2U) & 0xF00UL); -#endif - - /* Clear int enable bits in base->BAUD */ - uint32_t baudRegMask = 0UL; -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - baudRegMask |= ((mask << 8U) & LPUART_BAUD_LBKDIE_MASK); - /* Clear bit 7 from mask */ - mask &= ~(uint32_t)kLPUART_LinBreakInterruptEnable; -#endif - baudRegMask |= ((mask << 8U) & LPUART_BAUD_RXEDGIE_MASK); - /* Clear bit 6 from mask */ - mask &= ~(uint32_t)kLPUART_RxActiveEdgeInterruptEnable; - - s_atomicOldInt = DisableGlobalIRQ(); - base->BAUD &= ~baudRegMask; - EnableGlobalIRQ(s_atomicOldInt); - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Check int enable bits in base->FIFO */ - - s_atomicOldInt = DisableGlobalIRQ(); - base->FIFO = (base->FIFO & ~(LPUART_FIFO_TXOF_MASK | LPUART_FIFO_RXUF_MASK)) & - ~(mask & (LPUART_FIFO_TXOFE_MASK | LPUART_FIFO_RXUFE_MASK)); - EnableGlobalIRQ(s_atomicOldInt); - /* Clear bit 9 and bit 8 from mask */ - mask &= ~((uint32_t)kLPUART_TxFifoOverflowInterruptEnable | (uint32_t)kLPUART_RxFifoUnderflowInterruptEnable); -#endif - - /* Clear int enable bits in base->CTRL */ - s_atomicOldInt = DisableGlobalIRQ(); - base->CTRL &= ~mask; - EnableGlobalIRQ(s_atomicOldInt); -} - -/*! - * brief Gets enabled LPUART interrupts. - * - * This function gets the enabled LPUART interrupts. The enabled interrupts are returned - * as the logical OR value of the enumerators ref _lpuart_interrupt_enable. To check - * a specific interrupt enable status, compare the return value with enumerators - * in ref _lpuart_interrupt_enable. - * For example, to check whether the TX empty interrupt is enabled: - * code - * uint32_t enabledInterrupts = LPUART_GetEnabledInterrupts(LPUART1); - * - * if (kLPUART_TxDataRegEmptyInterruptEnable & enabledInterrupts) - * { - * ... - * } - * endcode - * - * param base LPUART peripheral base address. - * return LPUART interrupt flags which are logical OR of the enumerators in ref _lpuart_interrupt_enable. - */ -uint32_t LPUART_GetEnabledInterrupts(LPUART_Type *base) -{ - /* Check int enable bits in base->CTRL */ - uint32_t temp = (uint32_t)(base->CTRL & 0xFF0C000UL); - -#if defined(FSL_FEATURE_LPUART_HAS_MCR) && FSL_FEATURE_LPUART_HAS_MCR - /* Check modem control interrupts. */ - temp |= (base->MCR & 0xFUL); -#endif -#if defined(FSL_FEATURE_LPUART_HAS_TIMEOUT) && FSL_FEATURE_LPUART_HAS_TIMEOUT - /* Check timeout control interrupts. */ - temp |= ((base->TOCR & 0xF00UL) << 2U); -#endif - - /* Check int enable bits in base->BAUD */ - temp = (temp & ~(uint32_t)kLPUART_RxActiveEdgeInterruptEnable) | ((base->BAUD & LPUART_BAUD_RXEDGIE_MASK) >> 8U); -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - temp = (temp & ~(uint32_t)kLPUART_LinBreakInterruptEnable) | ((base->BAUD & LPUART_BAUD_LBKDIE_MASK) >> 8U); -#endif - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Check int enable bits in base->FIFO */ - temp = - (temp & ~((uint32_t)kLPUART_TxFifoOverflowInterruptEnable | (uint32_t)kLPUART_RxFifoUnderflowInterruptEnable)) | - (base->FIFO & (LPUART_FIFO_TXOFE_MASK | LPUART_FIFO_RXUFE_MASK)); -#endif - - return temp; -} - -/*! - * brief Gets LPUART status flags. - * - * This function gets all LPUART status flags. The flags are returned as the logical - * OR value of the enumerators ref _lpuart_flags. To check for a specific status, - * compare the return value with enumerators in the ref _lpuart_flags. - * For example, to check whether the TX is empty: - * code - * if (kLPUART_TxDataRegEmptyFlag & LPUART_GetStatusFlags(LPUART1)) - * { - * ... - * } - * endcode - * - * param base LPUART peripheral base address. - * return LPUART status flags which are ORed by the enumerators in the _lpuart_flags. - */ -uint32_t LPUART_GetStatusFlags(LPUART_Type *base) -{ - uint32_t temp; - - temp = (base->STAT & 0xC1FFC000UL); -#if defined(FSL_FEATURE_LPUART_HAS_MCR) && FSL_FEATURE_LPUART_HAS_MCR - temp |= ((base->MSR & 0xFUL) << 2U); -#endif -#if defined(FSL_FEATURE_LPUART_HAS_TIMEOUT) && FSL_FEATURE_LPUART_HAS_TIMEOUT - temp |= ((base->TOSR & 0xF00UL) << 2U); -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - temp |= (base->FIFO & - (LPUART_FIFO_TXEMPT_MASK | LPUART_FIFO_RXEMPT_MASK | LPUART_FIFO_TXOF_MASK | LPUART_FIFO_RXUF_MASK)) >> - 16U; -#endif - /* Only keeps the status bits */ - temp &= (uint32_t)kLPUART_AllFlags; - return temp; -} - -/*! - * brief Clears status flags with a provided mask. - * - * This function clears LPUART status flags with a provided mask. Automatically cleared flags - * can't be cleared by this function. - * Flags that can only cleared or set by hardware are: - * kLPUART_TxDataRegEmptyFlag, kLPUART_TransmissionCompleteFlag, kLPUART_RxDataRegFullFlag, - * kLPUART_RxActiveFlag, kLPUART_NoiseErrorInRxDataRegFlag, kLPUART_ParityErrorInRxDataRegFlag, - * kLPUART_TxFifoEmptyFlag,kLPUART_RxFifoEmptyFlag - * Note: This API should be called when the Tx/Rx is idle, otherwise it takes no effects. - * - * param base LPUART peripheral base address. - * param mask the status flags to be cleared. The user can use the enumerators in the - * _lpuart_status_flag_t to do the OR operation and get the mask. - * return 0 succeed, others failed. - * retval kStatus_LPUART_FlagCannotClearManually The flag can't be cleared by this function but - * it is cleared automatically by hardware. - * retval kStatus_Success Status in the mask are cleared. - */ -status_t LPUART_ClearStatusFlags(LPUART_Type *base, uint32_t mask) -{ - uint32_t temp; - status_t status; - - /* Only deal with the clearable flags */ - mask &= (uint32_t)kLPUART_AllClearFlags; - -#if defined(FSL_FEATURE_LPUART_HAS_MCR) && FSL_FEATURE_LPUART_HAS_MCR - /* Modem status */ - base->MSR = ((mask >> 2U) & 0xFUL); -#endif -#if defined(FSL_FEATURE_LPUART_HAS_TIMEOUT) && FSL_FEATURE_LPUART_HAS_TIMEOUT - /* Timeout status */ - base->TOSR = ((mask >> 2U) & 0xF00UL); -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Status bits in FIFO register */ - if ((mask & ((uint32_t)kLPUART_TxFifoOverflowFlag | (uint32_t)kLPUART_RxFifoUnderflowFlag)) != 0U) - { - /* Get the FIFO register value and mask the rx/tx FIFO flush bits and the status bits that can be W1C in case - they are written 1 accidentally. */ - temp = (uint32_t)base->FIFO; - temp &= (uint32_t)( - ~(LPUART_FIFO_TXFLUSH_MASK | LPUART_FIFO_RXFLUSH_MASK | LPUART_FIFO_TXOF_MASK | LPUART_FIFO_RXUF_MASK)); - temp |= (mask << 16U) & (LPUART_FIFO_TXOF_MASK | LPUART_FIFO_RXUF_MASK); - base->FIFO = temp; - } -#endif - /* Status bits in STAT register */ - /* First get the STAT register value and mask all the bits that not represent status, then OR with the status bit - * that is to be W1C */ - temp = (base->STAT & 0x3E000000UL) | mask; - base->STAT = temp; - /* If some flags still pending. */ - if (0U != (mask & LPUART_GetStatusFlags(base))) - { - status = kStatus_LPUART_FlagCannotClearManually; - } - else - { - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Writes to the transmitter register using a blocking method. - * - * This function polls the transmitter register, first waits for the register to be empty or TX FIFO to have room, - * and writes data to the transmitter buffer, then waits for the data to be sent out to bus. - * - * param base LPUART peripheral base address. - * param data Start address of the data to write. - * param length Size of the data to write. - * retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * retval kStatus_Success Successfully wrote all data. - */ -status_t LPUART_WriteBlocking(LPUART_Type *base, const uint8_t *data, size_t length) -{ - assert(NULL != data); - - const uint8_t *dataAddress = data; - size_t transferSize = length; - -#if UART_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != transferSize) - { -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; - while ((0U == (base->STAT & LPUART_STAT_TDRE_MASK)) && (0U != --waitTimes)) -#else - while (0U == (base->STAT & LPUART_STAT_TDRE_MASK)) -#endif - { - } -#if UART_RETRY_TIMES - if (0U == waitTimes) - { - return kStatus_LPUART_Timeout; - } -#endif - base->DATA = *(dataAddress); - dataAddress++; - transferSize--; - } - /* Ensure all the data in the transmit buffer are sent out to bus. */ -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; - while ((0U == (base->STAT & LPUART_STAT_TC_MASK)) && (0U != --waitTimes)) -#else - while (0U == (base->STAT & LPUART_STAT_TC_MASK)) -#endif - { - } -#if UART_RETRY_TIMES - if (0U == waitTimes) - { - return kStatus_LPUART_Timeout; - } -#endif - return kStatus_Success; -} - -/*! - * brief Writes to the transmitter register using a blocking method in 9bit or 10bit mode. - * - * note This function only support 9bit or 10bit transfer. - * Please make sure only 10bit of data is valid and other bits are 0. - * - * param base LPUART peripheral base address. - * param data Start address of the data to write. - * param length Size of the data to write. - * retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * retval kStatus_Success Successfully wrote all data. - */ -status_t LPUART_WriteBlocking16bit(LPUART_Type *base, const uint16_t *data, size_t length) -{ - assert(NULL != data); - - const uint16_t *dataAddress = data; - size_t transferSize = length; - -#if UART_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != transferSize) - { -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; - while ((0U == (base->STAT & LPUART_STAT_TDRE_MASK)) && (0U != --waitTimes)) -#else - while (0U == (base->STAT & LPUART_STAT_TDRE_MASK)) -#endif - { - } -#if UART_RETRY_TIMES - if (0U == waitTimes) - { - return kStatus_LPUART_Timeout; - } -#endif - base->DATA = *(dataAddress); - dataAddress++; - transferSize--; - } - /* Ensure all the data in the transmit buffer are sent out to bus. */ -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; - while ((0U == (base->STAT & LPUART_STAT_TC_MASK)) && (0U != --waitTimes)) -#else - while (0U == (base->STAT & LPUART_STAT_TC_MASK)) -#endif - { - } -#if UART_RETRY_TIMES - if (0U == waitTimes) - { - return kStatus_LPUART_Timeout; - } -#endif - return kStatus_Success; -} - -/*! - * brief Reads the receiver data register using a blocking method. - * - * This function polls the receiver register, waits for the receiver register full or receiver FIFO - * has data, and reads data from the TX register. - * - * param base LPUART peripheral base address. - * param data Start address of the buffer to store the received data. - * param length Size of the buffer. - * retval kStatus_LPUART_RxHardwareOverrun Receiver overrun happened while receiving data. - * retval kStatus_LPUART_NoiseError Noise error happened while receiving data. - * retval kStatus_LPUART_FramingError Framing error happened while receiving data. - * retval kStatus_LPUART_ParityError Parity error happened while receiving data. - * retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * retval kStatus_Success Successfully received all data. - */ -status_t LPUART_ReadBlocking(LPUART_Type *base, uint8_t *data, size_t length) -{ - assert(NULL != data); - - status_t status = kStatus_Success; - uint32_t statusFlag; - uint8_t *dataAddress = data; - -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - uint32_t ctrl = base->CTRL; - bool isSevenDataBits = (((ctrl & LPUART_CTRL_M7_MASK) != 0U) || - (((ctrl & LPUART_CTRL_M_MASK) == 0U) && ((ctrl & LPUART_CTRL_PE_MASK) != 0U))); -#endif - -#if UART_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != (length--)) - { -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - while (0U == ((base->WATER & LPUART_WATER_RXCOUNT_MASK) >> LPUART_WATER_RXCOUNT_SHIFT)) -#else - while (0U == (base->STAT & LPUART_STAT_RDRF_MASK)) -#endif - { -#if UART_RETRY_TIMES - if (0U == --waitTimes) - { - status = kStatus_LPUART_Timeout; - break; - } -#endif - statusFlag = LPUART_GetStatusFlags(base); - - if (0U != (statusFlag & (uint32_t)kLPUART_RxOverrunFlag)) - { - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_RxOverrunFlag)) ? - (kStatus_LPUART_RxHardwareOverrun) : - (kStatus_LPUART_FlagCannotClearManually)); - /* Other error flags(FE, NF, and PF) are prevented from setting once OR is set, no need to check other - * error flags*/ - break; - } - - if (0U != (statusFlag & (uint32_t)kLPUART_ParityErrorFlag)) - { - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_ParityErrorFlag)) ? - (kStatus_LPUART_ParityError) : - (kStatus_LPUART_FlagCannotClearManually)); - } - - if (0U != (statusFlag & (uint32_t)kLPUART_FramingErrorFlag)) - { - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_FramingErrorFlag)) ? - (kStatus_LPUART_FramingError) : - (kStatus_LPUART_FlagCannotClearManually)); - } - - if (0U != (statusFlag & (uint32_t)kLPUART_NoiseErrorFlag)) - { - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_NoiseErrorFlag)) ? - (kStatus_LPUART_NoiseError) : - (kStatus_LPUART_FlagCannotClearManually)); - } - if (kStatus_Success != status) - { - break; - } - } - - if (kStatus_Success == status) - { -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - if (isSevenDataBits) - { - *(dataAddress) = (uint8_t)(base->DATA & 0x7FU); - dataAddress++; - } - else - { - *(dataAddress) = (uint8_t)base->DATA; - dataAddress++; - } -#else - *(dataAddress) = (uint8_t)base->DATA; - dataAddress++; -#endif - } - else - { - break; - } - } - - return status; -} - -/*! - * brief Reads the receiver data register in 9bit or 10bit mode. - * - * note This function only support 9bit or 10bit transfer. - * - * param base LPUART peripheral base address. - * param data Start address of the buffer to store the received data by 16bit, only 10bit is valid. - * param length Size of the buffer. - * retval kStatus_LPUART_RxHardwareOverrun Receiver overrun happened while receiving data. - * retval kStatus_LPUART_NoiseError Noise error happened while receiving data. - * retval kStatus_LPUART_FramingError Framing error happened while receiving data. - * retval kStatus_LPUART_ParityError Parity error happened while receiving data. - * retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * retval kStatus_Success Successfully received all data. - */ -status_t LPUART_ReadBlocking16bit(LPUART_Type *base, uint16_t *data, size_t length) -{ - assert(NULL != data); - - status_t status = kStatus_Success; - uint32_t statusFlag; - uint16_t *dataAddress = data; - -#if UART_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != (length--)) - { -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - while (0U == ((base->WATER & LPUART_WATER_RXCOUNT_MASK) >> LPUART_WATER_RXCOUNT_SHIFT)) -#else - while (0U == (base->STAT & LPUART_STAT_RDRF_MASK)) -#endif - { -#if UART_RETRY_TIMES - if (0U == --waitTimes) - { - status = kStatus_LPUART_Timeout; - break; - } -#endif - statusFlag = LPUART_GetStatusFlags(base); - - if (0U != (statusFlag & (uint32_t)kLPUART_RxOverrunFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_RxOverrunFlag)) ? - (kStatus_LPUART_RxHardwareOverrun) : - (kStatus_LPUART_FlagCannotClearManually)); - /* Other error flags(FE, NF, and PF) are prevented from setting once OR is set, no need to check other - * error flags*/ - break; - } - - if (0U != (statusFlag & (uint32_t)kLPUART_ParityErrorFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_ParityErrorFlag)) ? - (kStatus_LPUART_ParityError) : - (kStatus_LPUART_FlagCannotClearManually)); - } - - if (0U != (statusFlag & (uint32_t)kLPUART_FramingErrorFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_FramingErrorFlag)) ? - (kStatus_LPUART_FramingError) : - (kStatus_LPUART_FlagCannotClearManually)); - } - - if (0U != (statusFlag & (uint32_t)kLPUART_NoiseErrorFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_NoiseErrorFlag)) ? - (kStatus_LPUART_NoiseError) : - (kStatus_LPUART_FlagCannotClearManually)); - } - if (kStatus_Success != status) - { - break; - } - } - if (kStatus_Success == status) - { - *(dataAddress) = (uint16_t)(base->DATA & 0x03FFU); - dataAddress++; - } - else - { - break; - } - } - - return status; -} - -/*! - * brief Initializes the LPUART handle. - * - * This function initializes the LPUART handle, which can be used for other LPUART - * transactional APIs. Usually, for a specified LPUART instance, - * call this API once to get the initialized handle. - * - * The LPUART driver supports the "background" receiving, which means that user can set up - * an RX ring buffer optionally. Data received is stored into the ring buffer even when the - * user doesn't call the LPUART_TransferReceiveNonBlocking() API. If there is already data received - * in the ring buffer, the user can get the received data from the ring buffer directly. - * The ring buffer is disabled if passing NULL as p ringBuffer. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param callback Callback function. - * param userData User data. - */ -void LPUART_TransferCreateHandle(LPUART_Type *base, - lpuart_handle_t *handle, - lpuart_transfer_callback_t callback, - void *userData) -{ - assert(NULL != handle); - - /* Get instance from peripheral base address. */ - uint32_t instance = LPUART_GetInstance(base); - - lpuart_to_lpflexcomm_t handler; - handler.lpuart_handler = LPUART_TransferHandleIRQ; - -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - uint32_t ctrl = base->CTRL; - bool isSevenDataBits = (((ctrl & LPUART_CTRL_M7_MASK) != 0U) || - (((ctrl & LPUART_CTRL_M_MASK) == 0U) && ((ctrl & LPUART_CTRL_PE_MASK) != 0U))); -#endif - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(lpuart_handle_t)); - - /* Set the TX/RX state. */ - handle->rxState = (uint8_t)kLPUART_RxIdle; - handle->txState = (uint8_t)kLPUART_TxIdle; - - /* Set the callback and user data. */ - handle->callback = callback; - handle->userData = userData; - -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - /* Initial seven data bits flag */ - handle->isSevenDataBits = isSevenDataBits; -#endif - - /* Save the handle in global variables to support the double weak mechanism. */ - LP_FLEXCOMM_SetIRQHandler(LPUART_GetInstance(base), handler.lpflexcomm_handler, handle, LP_FLEXCOMM_PERIPH_LPUART); - - /* Enable interrupt in NVIC. */ - (void)EnableIRQ(s_lpuartIRQ[instance]); -} - -/*! - * brief Sets up the RX ring buffer. - * - * This function sets up the RX ring buffer to a specific UART handle. - * - * When the RX ring buffer is used, data received is stored into the ring buffer even when - * the user doesn't call the UART_TransferReceiveNonBlocking() API. If there is already data received - * in the ring buffer, the user can get the received data from the ring buffer directly. - * - * note When using RX ring buffer, one byte is reserved for internal use. In other - * words, if p ringBufferSize is 32, then only 31 bytes are used for saving data. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param ringBuffer Start address of ring buffer for background receiving. Pass NULL to disable the ring buffer. - * param ringBufferSize size of the ring buffer. - */ -void LPUART_TransferStartRingBuffer(LPUART_Type *base, - lpuart_handle_t *handle, - uint8_t *ringBuffer, - size_t ringBufferSize) -{ - assert(NULL != handle); - assert(NULL != ringBuffer); - - /* Setup the ring buffer address */ - handle->rxRingBuffer = ringBuffer; - handle->rxRingBufferSize = ringBufferSize; - handle->rxRingBufferHead = 0U; - handle->rxRingBufferTail = 0U; - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. */ - uint32_t irqMask = DisableGlobalIRQ(); - /* Enable the interrupt to accept the data when user need the ring buffer. */ - base->CTRL |= (uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); -} - -/*! - * brief Aborts the background transfer and uninstalls the ring buffer. - * - * This function aborts the background transfer and uninstalls the ring buffer. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - */ -void LPUART_TransferStopRingBuffer(LPUART_Type *base, lpuart_handle_t *handle) -{ - assert(NULL != handle); - - if (handle->rxState == (uint8_t)kLPUART_RxIdle) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. - */ - uint32_t irqMask = DisableGlobalIRQ(); - base->CTRL &= ~(uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); - } - - handle->rxRingBuffer = NULL; - handle->rxRingBufferSize = 0U; - handle->rxRingBufferHead = 0U; - handle->rxRingBufferTail = 0U; -} - -/*! - * brief Transmits a buffer of data using the interrupt method. - * - * This function send data using an interrupt method. This is a non-blocking function, which - * returns directly without waiting for all data written to the transmitter register. When - * all data is written to the TX register in the ISR, the LPUART driver calls the callback - * function and passes the ref kStatus_LPUART_TxIdle as status parameter. - * - * note The kStatus_LPUART_TxIdle is passed to the upper layer when all data are written - * to the TX register. However, there is no check to ensure that all the data sent out. Before disabling the TX, - * check the kLPUART_TransmissionCompleteFlag to ensure that the transmit is finished. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param xfer LPUART transfer structure, see #lpuart_transfer_t. - * retval kStatus_Success Successfully start the data transmission. - * retval kStatus_LPUART_TxBusy Previous transmission still not finished, data not all written to the TX register. - * retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_TransferSendNonBlocking(LPUART_Type *base, lpuart_handle_t *handle, lpuart_transfer_t *xfer) -{ - assert(NULL != handle); - assert(NULL != xfer); - assert(NULL != xfer->txData); - assert(0U != xfer->dataSize); - - status_t status; - - /* Return error if current TX busy. */ - if ((uint8_t)kLPUART_TxBusy == handle->txState) - { - status = kStatus_LPUART_TxBusy; - } - else - { - handle->txData = xfer->txData; - handle->txDataSize = xfer->dataSize; - handle->txDataSizeAll = xfer->dataSize; - handle->txState = (uint8_t)kLPUART_TxBusy; - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. - */ - uint32_t irqMask = DisableGlobalIRQ(); - /* Enable transmitter interrupt. */ - base->CTRL |= (uint32_t)LPUART_CTRL_TIE_MASK; - EnableGlobalIRQ(irqMask); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Aborts the interrupt-driven data transmit. - * - * This function aborts the interrupt driven data sending. The user can get the remainBtyes to find out - * how many bytes are not sent out. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - */ -void LPUART_TransferAbortSend(LPUART_Type *base, lpuart_handle_t *handle) -{ - assert(NULL != handle); - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. */ - uint32_t irqMask = DisableGlobalIRQ(); - base->CTRL &= ~(uint32_t)(LPUART_CTRL_TIE_MASK | LPUART_CTRL_TCIE_MASK); - EnableGlobalIRQ(irqMask); - - handle->txDataSize = 0; - handle->txState = (uint8_t)kLPUART_TxIdle; -} - -/*! - * brief Gets the number of bytes that have been sent out to bus. - * - * This function gets the number of bytes that have been sent out to bus by an interrupt method. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param count Send bytes count. - * retval kStatus_NoTransferInProgress No send in progress. - * retval kStatus_InvalidArgument Parameter is invalid. - * retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetSendCount(LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count) -{ - assert(NULL != handle); - assert(NULL != count); - - status_t status = kStatus_Success; - size_t tmptxDataSize = handle->txDataSize; - - if ((uint8_t)kLPUART_TxIdle == handle->txState) - { - status = kStatus_NoTransferInProgress; - } - else - { -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - *count = handle->txDataSizeAll - tmptxDataSize - - ((base->WATER & LPUART_WATER_TXCOUNT_MASK) >> LPUART_WATER_TXCOUNT_SHIFT); -#else - if ((base->STAT & (uint32_t)kLPUART_TxDataRegEmptyFlag) != 0U) - { - *count = handle->txDataSizeAll - tmptxDataSize; - } - else - { - *count = handle->txDataSizeAll - tmptxDataSize - 1U; - } -#endif - } - - return status; -} - -/*! - * brief Receives a buffer of data using the interrupt method. - * - * This function receives data using an interrupt method. This is a non-blocking function - * which returns without waiting to ensure that all data are received. - * If the RX ring buffer is used and not empty, the data in the ring buffer is copied and - * the parameter p receivedBytes shows how many bytes are copied from the ring buffer. - * After copying, if the data in the ring buffer is not enough for read, the receive - * request is saved by the LPUART driver. When the new data arrives, the receive request - * is serviced first. When all data is received, the LPUART driver notifies the upper layer - * through a callback function and passes a status parameter ref kStatus_UART_RxIdle. - * For example, the upper layer needs 10 bytes but there are only 5 bytes in ring buffer. - * The 5 bytes are copied to xfer->data, which returns with the - * parameter p receivedBytes set to 5. For the remaining 5 bytes, the newly arrived data is - * saved from xfer->data[5]. When 5 bytes are received, the LPUART driver notifies the upper layer. - * If the RX ring buffer is not enabled, this function enables the RX and RX interrupt - * to receive data to xfer->data. When all data is received, the upper layer is notified. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param xfer LPUART transfer structure, see #uart_transfer_t. - * param receivedBytes Bytes received from the ring buffer directly. - * retval kStatus_Success Successfully queue the transfer into the transmit queue. - * retval kStatus_LPUART_RxBusy Previous receive request is not finished. - * retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_TransferReceiveNonBlocking(LPUART_Type *base, - lpuart_handle_t *handle, - lpuart_transfer_t *xfer, - size_t *receivedBytes) -{ - assert(NULL != handle); - assert(NULL != xfer); - assert(NULL != xfer->rxData); - assert(0U != xfer->dataSize); - - uint32_t i; - status_t status; - uint32_t irqMask; - /* How many bytes to copy from ring buffer to user memory. */ - size_t bytesToCopy = 0U; - /* How many bytes to receive. */ - size_t bytesToReceive; - /* How many bytes currently have received. */ - size_t bytesCurrentReceived; - - /* How to get data: - 1. If RX ring buffer is not enabled, then save xfer->data and xfer->dataSize - to lpuart handle, enable interrupt to store received data to xfer->data. When - all data received, trigger callback. - 2. If RX ring buffer is enabled and not empty, get data from ring buffer first. - If there are enough data in ring buffer, copy them to xfer->data and return. - If there are not enough data in ring buffer, copy all of them to xfer->data, - save the xfer->data remained empty space to lpuart handle, receive data - to this empty space and trigger callback when finished. */ - - if ((uint8_t)kLPUART_RxBusy == handle->rxState) - { - status = kStatus_LPUART_RxBusy; - } - else - { - bytesToReceive = xfer->dataSize; - bytesCurrentReceived = 0; - - /* If RX ring buffer is used. */ - if (NULL != handle->rxRingBuffer) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - /* Disable LPUART RX IRQ, protect ring buffer. */ - base->CTRL &= ~(uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); - - /* How many bytes in RX ring buffer currently. */ - bytesToCopy = LPUART_TransferGetRxRingBufferLength(base, handle); - - if (0U != bytesToCopy) - { - bytesToCopy = MIN(bytesToReceive, bytesToCopy); - - bytesToReceive -= bytesToCopy; - - /* Copy data from ring buffer to user memory. */ - for (i = 0U; i < bytesToCopy; i++) - { - xfer->rxData[bytesCurrentReceived] = handle->rxRingBuffer[handle->rxRingBufferTail]; - bytesCurrentReceived++; - - /* Wrap to 0. Not use modulo (%) because it might be large and slow. */ - if (((uint32_t)handle->rxRingBufferTail + 1U) == handle->rxRingBufferSize) - { - handle->rxRingBufferTail = 0U; - } - else - { - handle->rxRingBufferTail++; - } - } - } - - /* If ring buffer does not have enough data, still need to read more data. */ - if (0U != bytesToReceive) - { - /* No data in ring buffer, save the request to LPUART handle. */ - handle->rxData = &xfer->rxData[bytesCurrentReceived]; - handle->rxDataSize = bytesToReceive; - handle->rxDataSizeAll = xfer->dataSize; - handle->rxState = (uint8_t)kLPUART_RxBusy; - } - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - /* Re-enable LPUART RX IRQ. */ - base->CTRL |= (uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); - - /* Call user callback since all data are received. */ - if (0U == bytesToReceive) - { - if (NULL != handle->callback) - { - handle->callback(base, handle, kStatus_LPUART_RxIdle, handle->userData); - } - } - } - /* Ring buffer not used. */ - else - { - handle->rxData = &xfer->rxData[bytesCurrentReceived]; - handle->rxDataSize = bytesToReceive; - handle->rxDataSizeAll = bytesToReceive; - handle->rxState = (uint8_t)kLPUART_RxBusy; - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - /* Enable RX interrupt. */ - base->CTRL |= (uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ILIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); - } - - /* Return the how many bytes have read. */ - if (NULL != receivedBytes) - { - *receivedBytes = bytesCurrentReceived; - } - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Aborts the interrupt-driven data receiving. - * - * This function aborts the interrupt-driven data receiving. The user can get the remainBytes to find out - * how many bytes not received yet. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - */ -void LPUART_TransferAbortReceive(LPUART_Type *base, lpuart_handle_t *handle) -{ - assert(NULL != handle); - - /* Only abort the receive to handle->rxData, the RX ring buffer is still working. */ - if (NULL == handle->rxRingBuffer) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. - */ - uint32_t irqMask = DisableGlobalIRQ(); - /* Disable RX interrupt. */ - base->CTRL &= ~(uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ILIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); - } - - handle->rxDataSize = 0U; - handle->rxState = (uint8_t)kLPUART_RxIdle; -} - -/*! - * brief Gets the number of bytes that have been received. - * - * This function gets the number of bytes that have been received. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param count Receive bytes count. - * retval kStatus_NoTransferInProgress No receive in progress. - * retval kStatus_InvalidArgument Parameter is invalid. - * retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetReceiveCount(LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count) -{ - assert(NULL != handle); - assert(NULL != count); - - status_t status = kStatus_Success; - size_t tmprxDataSize = handle->rxDataSize; - - if ((uint8_t)kLPUART_RxIdle == handle->rxState) - { - status = kStatus_NoTransferInProgress; - } - else - { - *count = handle->rxDataSizeAll - tmprxDataSize; - } - - return status; -} - -/*! - * brief LPUART IRQ handle function. - * - * This function handles the LPUART transmit and receive IRQ request. - * - * param instance LPUART instance. - * param irqHandle LPUART handle pointer. - */ -void LPUART_TransferHandleIRQ(uint32_t instance, void *irqHandle) -{ - assert(NULL != irqHandle); - assert(instance < ARRAY_SIZE(s_lpuartBases)); - LPUART_Type *base = s_lpuartBases[instance]; - uint8_t count; - uint8_t tempCount; - uint32_t status = LPUART_GetStatusFlags(base); - uint32_t enabledInterrupts = LPUART_GetEnabledInterrupts(base); - uint16_t tpmRxRingBufferHead; - uint32_t tpmData; - uint32_t irqMask; - lpuart_handle_t *handle = (lpuart_handle_t *)irqHandle; - - /* If RX overrun. */ - if ((uint32_t)kLPUART_RxOverrunFlag == ((uint32_t)kLPUART_RxOverrunFlag & status)) - { - /* Clear overrun flag, otherwise the RX does not work. */ - base->STAT = ((base->STAT & 0x3FE00000U) | LPUART_STAT_OR_MASK); - - /* Trigger callback. */ - if (NULL != (handle->callback)) - { - handle->callback(base, handle, kStatus_LPUART_RxHardwareOverrun, handle->userData); - } - } - - /* If IDLE flag is set and the IDLE interrupt is enabled. */ - if ((0U != ((uint32_t)kLPUART_IdleLineFlag & status)) && - (0U != ((uint32_t)kLPUART_IdleLineInterruptEnable & enabledInterrupts))) - { -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - count = ((uint8_t)((base->WATER & LPUART_WATER_RXCOUNT_MASK) >> LPUART_WATER_RXCOUNT_SHIFT)); - - while ((0U != handle->rxDataSize) && (0U != count)) - { - tempCount = (uint8_t)MIN(handle->rxDataSize, count); - - /* Using non block API to read the data from the registers. */ - if (!handle->is16bitData) - { - LPUART_ReadNonBlocking(base, handle->rxData, tempCount); - handle->rxData = &handle->rxData[tempCount]; - } - else - { - LPUART_ReadNonBlocking16bit(base, (uint16_t *)handle->rxData, tempCount); - handle->rxData = &handle->rxData[tempCount * 2u]; - } - handle->rxDataSize -= tempCount; - count -= tempCount; - - /* If rxDataSize is 0, invoke rx idle callback.*/ - if (0U == (handle->rxDataSize)) - { - handle->rxState = (uint8_t)kLPUART_RxIdle; - - if (NULL != handle->callback) - { - handle->callback(base, handle, kStatus_LPUART_RxIdle, handle->userData); - } - } - } -#endif - /* Clear IDLE flag.*/ - base->STAT = ((base->STAT & 0x3FE00000U) | LPUART_STAT_IDLE_MASK); - - /* If rxDataSize is 0, disable rx ready, overrun and idle line interrupt.*/ - if (0U == handle->rxDataSize) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - base->CTRL &= ~(uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ILIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); - } - /* Invoke callback if callback is not NULL and rxDataSize is not 0. */ - else if (NULL != handle->callback) - { - handle->callback(base, handle, kStatus_LPUART_IdleLineDetected, handle->userData); - } - else - { - /* Avoid MISRA 15.7 */ - } - } - /* Receive data register full */ - if ((0U != ((uint32_t)kLPUART_RxDataRegFullFlag & status)) && - (0U != ((uint32_t)kLPUART_RxDataRegFullInterruptEnable & enabledInterrupts))) - { - /* Get the size that can be stored into buffer for this interrupt. */ -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - count = ((uint8_t)((base->WATER & LPUART_WATER_RXCOUNT_MASK) >> LPUART_WATER_RXCOUNT_SHIFT)); -#else - count = 1; -#endif - - /* If handle->rxDataSize is not 0, first save data to handle->rxData. */ - while ((0U != handle->rxDataSize) && (0U != count)) - { -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - tempCount = (uint8_t)MIN(handle->rxDataSize, count); -#else - tempCount = 1; -#endif - - /* Using non block API to read the data from the registers. */ - if (!handle->is16bitData) - { - LPUART_ReadNonBlocking(base, handle->rxData, tempCount); - handle->rxData = &handle->rxData[tempCount]; - } - else - { - LPUART_ReadNonBlocking16bit(base, (uint16_t *)handle->rxData, tempCount); - handle->rxData = &handle->rxData[tempCount * 2]; - } - handle->rxDataSize -= tempCount; - count -= tempCount; - - /* If all the data required for upper layer is ready, trigger callback. */ - if (0U == handle->rxDataSize) - { - handle->rxState = (uint8_t)kLPUART_RxIdle; - - if (NULL != handle->callback) - { - handle->callback(base, handle, kStatus_LPUART_RxIdle, handle->userData); - } - } - } - - /* If use RX ring buffer, receive data to ring buffer. */ - if (NULL != handle->rxRingBuffer) - { - while (0U != count--) - { - /* If RX ring buffer is full, trigger callback to notify over run. */ - if (LPUART_TransferIsRxRingBufferFull(base, handle)) - { - if (NULL != handle->callback) - { - handle->callback(base, handle, kStatus_LPUART_RxRingBufferOverrun, handle->userData); - } - } - - /* If ring buffer is still full after callback function, the oldest data is overridden. */ - if (LPUART_TransferIsRxRingBufferFull(base, handle)) - { - /* Increase handle->rxRingBufferTail to make room for new data. */ - if (((uint32_t)handle->rxRingBufferTail + 1U) == handle->rxRingBufferSize) - { - handle->rxRingBufferTail = 0U; - } - else - { - handle->rxRingBufferTail++; - } - } - - /* Read data. */ - tpmRxRingBufferHead = handle->rxRingBufferHead; - tpmData = base->DATA; -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - if (handle->isSevenDataBits) - { - handle->rxRingBuffer[tpmRxRingBufferHead] = (uint8_t)(tpmData & 0x7FU); - } - else - { - handle->rxRingBuffer[tpmRxRingBufferHead] = (uint8_t)tpmData; - } -#else - handle->rxRingBuffer[tpmRxRingBufferHead] = (uint8_t)tpmData; -#endif - - /* Increase handle->rxRingBufferHead. */ - if (((uint32_t)handle->rxRingBufferHead + 1U) == handle->rxRingBufferSize) - { - handle->rxRingBufferHead = 0U; - } - else - { - handle->rxRingBufferHead++; - } - } - } - /* If no receive requst pending, stop RX interrupt. */ - else if (0U == handle->rxDataSize) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - base->CTRL &= ~(uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ORIE_MASK | LPUART_CTRL_ILIE_MASK); - EnableGlobalIRQ(irqMask); - } - else - { - } - } - - /* Send data register empty and the interrupt is enabled. */ - if ((0U != ((uint32_t)kLPUART_TxDataRegEmptyFlag & status)) && - (0U != ((uint32_t)kLPUART_TxDataRegEmptyInterruptEnable & enabledInterrupts))) - { -/* Get the bytes that available at this moment. */ -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - count = (uint8_t)FSL_FEATURE_LPUART_FIFO_SIZEn(base) - - (uint8_t)((base->WATER & LPUART_WATER_TXCOUNT_MASK) >> LPUART_WATER_TXCOUNT_SHIFT); -#else - count = 1; -#endif - - while ((0U != handle->txDataSize) && (0U != count)) - { -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - tempCount = (uint8_t)MIN(handle->txDataSize, count); -#else - tempCount = 1; -#endif - - /* Using non block API to write the data to the registers. */ - if (!handle->is16bitData) - { - LPUART_WriteNonBlocking(base, handle->txData, tempCount); - handle->txData = &handle->txData[tempCount]; - } - else - { - LPUART_WriteNonBlocking16bit(base, (const uint16_t *)handle->txData, tempCount); - handle->txData = &handle->txData[tempCount * 2u]; - } - handle->txDataSize -= tempCount; - count -= tempCount; - - /* If all the data are written to data register, notify user with the callback, then TX finished. */ - if (0U == handle->txDataSize) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - /* Disable TX register empty interrupt and enable transmission completion interrupt. */ - base->CTRL = (base->CTRL & ~LPUART_CTRL_TIE_MASK) | LPUART_CTRL_TCIE_MASK; - EnableGlobalIRQ(irqMask); - } - } - } - - /* Transmission complete and the interrupt is enabled. */ - if ((0U != ((uint32_t)kLPUART_TransmissionCompleteFlag & status)) && - (0U != ((uint32_t)kLPUART_TransmissionCompleteInterruptEnable & enabledInterrupts))) - { - /* Set txState to idle only when all data has been sent out to bus. */ - handle->txState = (uint8_t)kLPUART_TxIdle; - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. - */ - irqMask = DisableGlobalIRQ(); - /* Disable transmission complete interrupt. */ - base->CTRL &= ~(uint32_t)LPUART_CTRL_TCIE_MASK; - EnableGlobalIRQ(irqMask); - - /* Trigger callback. */ - if (NULL != handle->callback) - { - handle->callback(base, handle, kStatus_LPUART_TxIdle, handle->userData); - } - } -} - -/*! - * brief LPUART Error IRQ handle function. - * - * This function handles the LPUART error IRQ request. - * - * param base LPUART peripheral base address. - * param irqHandle LPUART handle pointer. - */ -void LPUART_TransferHandleErrorIRQ(LPUART_Type *base, void *irqHandle) -{ - /* To be implemented by User. */ -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpuart.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpuart.h deleted file mode 100644 index aa29daf60f2..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpuart.h +++ /dev/null @@ -1,1175 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LPUART_H_ -#define FSL_LPUART_H_ - -#include "fsl_common.h" -#include "fsl_lpflexcomm.h" - -/*! - * @addtogroup lpuart_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief LPUART driver version. */ -#define FSL_LPUART_DRIVER_VERSION (MAKE_VERSION(2, 3, 1)) -/*@}*/ - -/*! @brief Retry times for waiting flag. */ -#ifndef UART_RETRY_TIMES -#define UART_RETRY_TIMES 0U /* Defining to zero means to keep waiting for the flag until it is assert/deassert. */ -#endif - -/*! @brief Error codes for the LPUART driver. */ -enum -{ - kStatus_LPUART_TxBusy = MAKE_STATUS(kStatusGroup_LPUART, 0), /*!< TX busy */ - kStatus_LPUART_RxBusy = MAKE_STATUS(kStatusGroup_LPUART, 1), /*!< RX busy */ - kStatus_LPUART_TxIdle = MAKE_STATUS(kStatusGroup_LPUART, 2), /*!< LPUART transmitter is idle. */ - kStatus_LPUART_RxIdle = MAKE_STATUS(kStatusGroup_LPUART, 3), /*!< LPUART receiver is idle. */ - kStatus_LPUART_TxWatermarkTooLarge = MAKE_STATUS(kStatusGroup_LPUART, 4), /*!< TX FIFO watermark too large */ - kStatus_LPUART_RxWatermarkTooLarge = MAKE_STATUS(kStatusGroup_LPUART, 5), /*!< RX FIFO watermark too large */ - kStatus_LPUART_FlagCannotClearManually = MAKE_STATUS(kStatusGroup_LPUART, 6), /*!< Some flag can't manually clear */ - kStatus_LPUART_Error = MAKE_STATUS(kStatusGroup_LPUART, 7), /*!< Error happens on LPUART. */ - kStatus_LPUART_RxRingBufferOverrun = - MAKE_STATUS(kStatusGroup_LPUART, 8), /*!< LPUART RX software ring buffer overrun. */ - kStatus_LPUART_RxHardwareOverrun = MAKE_STATUS(kStatusGroup_LPUART, 9), /*!< LPUART RX receiver overrun. */ - kStatus_LPUART_NoiseError = MAKE_STATUS(kStatusGroup_LPUART, 10), /*!< LPUART noise error. */ - kStatus_LPUART_FramingError = MAKE_STATUS(kStatusGroup_LPUART, 11), /*!< LPUART framing error. */ - kStatus_LPUART_ParityError = MAKE_STATUS(kStatusGroup_LPUART, 12), /*!< LPUART parity error. */ - kStatus_LPUART_BaudrateNotSupport = - MAKE_STATUS(kStatusGroup_LPUART, 13), /*!< Baudrate is not support in current clock source */ - kStatus_LPUART_IdleLineDetected = MAKE_STATUS(kStatusGroup_LPUART, 14), /*!< IDLE flag. */ - kStatus_LPUART_Timeout = MAKE_STATUS(kStatusGroup_LPUART, 15), /*!< LPUART times out. */ -}; - -/*! @brief LPUART parity mode. */ -typedef enum _lpuart_parity_mode -{ - kLPUART_ParityDisabled = 0x0U, /*!< Parity disabled */ - kLPUART_ParityEven = 0x2U, /*!< Parity enabled, type even, bit setting: PE|PT = 10 */ - kLPUART_ParityOdd = 0x3U, /*!< Parity enabled, type odd, bit setting: PE|PT = 11 */ -} lpuart_parity_mode_t; - -/*! @brief LPUART data bits count. */ -typedef enum _lpuart_data_bits -{ - kLPUART_EightDataBits = 0x0U, /*!< Eight data bit */ -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - kLPUART_SevenDataBits = 0x1U, /*!< Seven data bit */ -#endif -} lpuart_data_bits_t; - -/*! @brief LPUART stop bit count. */ -typedef enum _lpuart_stop_bit_count -{ - kLPUART_OneStopBit = 0U, /*!< One stop bit */ - kLPUART_TwoStopBit = 1U, /*!< Two stop bits */ -} lpuart_stop_bit_count_t; - -#if defined(FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT) && FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT -/*! @brief LPUART transmit CTS source. */ -typedef enum _lpuart_transmit_cts_source -{ - kLPUART_CtsSourcePin = 0U, /*!< CTS resource is the LPUART_CTS pin. */ - kLPUART_CtsSourceMatchResult = 1U, /*!< CTS resource is the match result. */ -} lpuart_transmit_cts_source_t; - -/*! @brief LPUART transmit CTS configure. */ -typedef enum _lpuart_transmit_cts_config -{ - kLPUART_CtsSampleAtStart = 0U, /*!< CTS input is sampled at the start of each character. */ - kLPUART_CtsSampleAtIdle = 1U, /*!< CTS input is sampled when the transmitter is idle */ -} lpuart_transmit_cts_config_t; -#endif - -/*! @brief LPUART idle flag type defines when the receiver starts counting. */ -typedef enum _lpuart_idle_type_select -{ - kLPUART_IdleTypeStartBit = 0U, /*!< Start counting after a valid start bit. */ - kLPUART_IdleTypeStopBit = 1U, /*!< Start counting after a stop bit. */ -} lpuart_idle_type_select_t; - -/*! @brief LPUART idle detected configuration. - * This structure defines the number of idle characters that must be received before - * the IDLE flag is set. - */ -typedef enum _lpuart_idle_config -{ - kLPUART_IdleCharacter1 = 0U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter2 = 1U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter4 = 2U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter8 = 3U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter16 = 4U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter32 = 5U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter64 = 6U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter128 = 7U, /*!< the number of idle characters. */ -} lpuart_idle_config_t; - -/*! - * @brief LPUART interrupt configuration structure, default settings all disabled. - * - * This structure contains the settings for all LPUART interrupt configurations. - */ -enum _lpuart_interrupt_enable -{ -#if defined(FSL_FEATURE_LPUART_HAS_MCR) && FSL_FEATURE_LPUART_HAS_MCR - kLPUART_CtsStateChangeInterruptEnable = LPUART_MCR_CTS_MASK, /*!< Change of state on CTS_B pin. bit 0 */ - kLPUART_DsrStateChangeInterruptEnable = LPUART_MCR_DSR_MASK, /*!< Change of state on DSR_B pin. bit 1 */ - kLPUART_RinStateChangeInterruptEnable = LPUART_MCR_RIN_MASK, /*!< Change of state on RIN_B pin. bit 2 */ - kLPUART_DcdStateChangeInterruptEnable = LPUART_MCR_DCD_MASK, /*!< Change of state on DCD_B pin. bit 3 */ -#endif - kLPUART_RxActiveEdgeInterruptEnable = (LPUART_BAUD_RXEDGIE_MASK >> 8U), /*!< Receive Active Edge. bit 6 */ -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - kLPUART_LinBreakInterruptEnable = (LPUART_BAUD_LBKDIE_MASK >> 8U), /*!< LIN break detect. bit 7 */ -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - kLPUART_RxFifoUnderflowInterruptEnable = (LPUART_FIFO_RXUFE_MASK), /*!< Receive FIFO Underflow. bit 8 */ - kLPUART_TxFifoOverflowInterruptEnable = (LPUART_FIFO_TXOFE_MASK), /*!< Transmit FIFO Overflow. bit 9 */ -#endif - kLPUART_RxCounter0TimeoutInterruptEnable = 1UL << 10, /*!< Receiver counter0 timeout. bit 10 */ - kLPUART_RxCounter1TimeoutInterruptEnable = 1UL << 11, /*!< Receiver counter1 timeout. bit 11 */ - kLPUART_TxCounter0TimeoutInterruptEnable = 1UL << 12, /*!< Transmitter counter0 timeout. bit 12 */ - kLPUART_TxCounter1TimeoutInterruptEnable = 1UL << 13, /*!< Transmitter counter1 timeout. bit 13 */ -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - kLPUART_DataMatch2InterruptEnable = - (LPUART_CTRL_MA2IE_MASK), /*!< The next character to be read from LPUART_DATA matches MA2. bit 14 */ - kLPUART_DataMatch1InterruptEnable = - (LPUART_CTRL_MA1IE_MASK), /*!< The next character to be read from LPUART_DATA matches MA1. bit 15 */ -#endif - kLPUART_IdleLineInterruptEnable = (LPUART_CTRL_ILIE_MASK), /*!< Idle line. bit 20 */ - kLPUART_RxDataRegFullInterruptEnable = (LPUART_CTRL_RIE_MASK), /*!< Receiver data register full. bit 21 */ - kLPUART_TransmissionCompleteInterruptEnable = (LPUART_CTRL_TCIE_MASK), /*!< Transmission complete. bit 22 */ - kLPUART_TxDataRegEmptyInterruptEnable = (LPUART_CTRL_TIE_MASK), /*!< Transmit data register empty. bit 23 */ - kLPUART_ParityErrorInterruptEnable = (LPUART_CTRL_PEIE_MASK), /*!< Parity error flag. bit 24 */ - kLPUART_FramingErrorInterruptEnable = (LPUART_CTRL_FEIE_MASK), /*!< Framing error flag. bit 25 */ - kLPUART_NoiseErrorInterruptEnable = (LPUART_CTRL_NEIE_MASK), /*!< Noise error flag. bit 26 */ - kLPUART_RxOverrunInterruptEnable = (LPUART_CTRL_ORIE_MASK), /*!< Receiver Overrun. bit 27 */ - kLPUART_AllInterruptEnable = -#if defined(FSL_FEATURE_LPUART_HAS_MCR) && FSL_FEATURE_LPUART_HAS_MCR - kLPUART_CtsStateChangeInterruptEnable | kLPUART_DsrStateChangeInterruptEnable | - kLPUART_RinStateChangeInterruptEnable | kLPUART_DcdStateChangeInterruptEnable | -#endif - kLPUART_RxActiveEdgeInterruptEnable | kLPUART_IdleLineInterruptEnable | kLPUART_RxDataRegFullInterruptEnable | - kLPUART_TransmissionCompleteInterruptEnable | kLPUART_TxDataRegEmptyInterruptEnable | - kLPUART_ParityErrorInterruptEnable | kLPUART_FramingErrorInterruptEnable | kLPUART_NoiseErrorInterruptEnable | - kLPUART_RxOverrunInterruptEnable -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - | kLPUART_LinBreakInterruptEnable -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - | kLPUART_RxFifoUnderflowInterruptEnable | kLPUART_TxFifoOverflowInterruptEnable -#endif -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - | kLPUART_DataMatch2InterruptEnable | kLPUART_DataMatch1InterruptEnable -#endif - , -}; - -/*! - * @brief LPUART status flags. - * - * This provides constants for the LPUART status flags for use in the LPUART functions. - */ -enum _lpuart_flags -{ -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - kLPUART_RxFifoUnderflowFlag = - (LPUART_FIFO_RXUF_MASK >> 16), /*!< RXUF bit, sets if receive buffer underflow occurred. bit 0 */ - kLPUART_TxFifoOverflowFlag = - (LPUART_FIFO_TXOF_MASK >> 16), /*!< TXOF bit, sets if transmit buffer overflow occurred. bit 1 */ - kLPUART_RxFifoEmptyFlag = - (LPUART_FIFO_RXEMPT_MASK >> 16), /*!< RXEMPT bit, sets if receive buffer is empty. bit 6 */ - kLPUART_TxFifoEmptyFlag = - (LPUART_FIFO_TXEMPT_MASK >> 16), /*!< TXEMPT bit, sets if transmit buffer is empty. bit 7 */ -#endif - -#if defined(FSL_FEATURE_LPUART_HAS_MCR) && FSL_FEATURE_LPUART_HAS_MCR - kLPUART_CtsStateChangeFlag = LPUART_MCR_CTS_MASK << 2U, /*!< Change of state on CTS_B pin. bit 2 */ - kLPUART_DsrStateChangeFlag = LPUART_MCR_DSR_MASK << 2U, /*!< Change of state on DSR_B pin. bit 3 */ - kLPUART_RinStateChangeFlag = LPUART_MCR_RIN_MASK << 2U, /*!< Change of state on RIN_B pin. bit 4 */ - kLPUART_DcdStateChangeFlag = LPUART_MCR_DCD_MASK << 2U, /*!< Change of state on DCD_B pin. bit 5 */ -#endif - kLPUART_RxCounter0TimeoutFlag = 1UL << 10, /*!< Receiver counter0 timeout. bit 10 */ - kLPUART_RxCounter1TimeoutFlag = 1UL << 11, /*!< Receiver counter1 timeout. bit 11 */ - kLPUART_TxCounter0TimeoutFlag = 1UL << 12, /*!< Transmitter counter0 timeout. bit 12 */ - kLPUART_TxCounter1TimeoutFlag = 1UL << 13, /*!< Transmitter counter1 timeout. bit 13 */ -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - kLPUART_DataMatch2Flag = - LPUART_STAT_MA2F_MASK, /*!< The next character to be read from LPUART_DATA matches MA2. bit 14 */ - kLPUART_DataMatch1Flag = - LPUART_STAT_MA1F_MASK, /*!< The next character to be read from LPUART_DATA matches MA1. bit 15 */ -#endif - kLPUART_ParityErrorFlag = (LPUART_STAT_PF_MASK), /*!< If parity enabled, sets upon parity error detection. bit 16 */ - kLPUART_FramingErrorFlag = - (LPUART_STAT_FE_MASK), /*!< Frame error flag, sets if logic 0 was detected where stop bit expected. bit 17 */ - kLPUART_NoiseErrorFlag = (LPUART_STAT_NF_MASK), /*!< Receive takes 3 samples of each received bit. If any - of these samples differ, noise flag sets. bit 18 */ - kLPUART_RxOverrunFlag = (LPUART_STAT_OR_MASK), /*!< Receive Overrun, sets when new data is received before - data is read from receive register. bit 19 */ - kLPUART_IdleLineFlag = (LPUART_STAT_IDLE_MASK), /*!< Idle line detect flag, sets when idle line detected. bit 20 */ - kLPUART_RxDataRegFullFlag = (LPUART_STAT_RDRF_MASK), /*!< Receive data register full flag, sets when the - receive data buffer is full. bit 21 */ - kLPUART_TransmissionCompleteFlag = - (LPUART_STAT_TC_MASK), /*!< Transmission complete flag, sets when transmission activity complete. bit 22 */ - kLPUART_TxDataRegEmptyFlag = - (LPUART_STAT_TDRE_MASK), /*!< Transmit data register empty flag, sets when transmit buffer is empty. bit 23 */ - kLPUART_RxActiveFlag = - (LPUART_STAT_RAF_MASK), /*!< Receiver Active Flag (RAF), sets at beginning of valid start. bit 24 */ - kLPUART_RxActiveEdgeFlag = (LPUART_STAT_RXEDGIF_MASK), /*!< Receive pin active edge interrupt flag, sets - when active edge detected. bit 30 */ -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - kLPUART_LinBreakFlag = (LPUART_STAT_LBKDIF_MASK), /*!< LIN break detect interrupt flag, sets when LIN break - char detected and LIN circuit enabled. bit 31 */ -#endif - - kLPUART_AllClearFlags = -#if defined(FSL_FEATURE_LPUART_HAS_MCR) && FSL_FEATURE_LPUART_HAS_MCR - kLPUART_CtsStateChangeFlag | kLPUART_DsrStateChangeFlag | kLPUART_RinStateChangeFlag | - kLPUART_DcdStateChangeFlag | -#endif - kLPUART_ParityErrorFlag | kLPUART_FramingErrorFlag | kLPUART_NoiseErrorFlag | kLPUART_RxOverrunFlag | - kLPUART_IdleLineFlag | kLPUART_RxActiveEdgeFlag -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - | kLPUART_TxFifoOverflowFlag | kLPUART_RxFifoUnderflowFlag -#endif -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - | kLPUART_DataMatch2Flag | kLPUART_DataMatch1Flag -#endif -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - | kLPUART_LinBreakFlag -#endif - , - - kLPUART_AllFlags = -#if defined(FSL_FEATURE_LPUART_HAS_MCR) && FSL_FEATURE_LPUART_HAS_MCR - kLPUART_CtsStateChangeFlag | kLPUART_DsrStateChangeFlag | kLPUART_RinStateChangeFlag | - kLPUART_DcdStateChangeFlag | -#endif - kLPUART_ParityErrorFlag | kLPUART_FramingErrorFlag | kLPUART_NoiseErrorFlag | kLPUART_RxOverrunFlag | - kLPUART_IdleLineFlag | kLPUART_RxDataRegFullFlag | kLPUART_TransmissionCompleteFlag | - kLPUART_TxDataRegEmptyFlag | kLPUART_RxActiveFlag | kLPUART_RxActiveEdgeFlag -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - | kLPUART_TxFifoOverflowFlag | kLPUART_RxFifoUnderflowFlag | kLPUART_TxFifoEmptyFlag | kLPUART_RxFifoEmptyFlag -#endif -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - | kLPUART_DataMatch2Flag | kLPUART_DataMatch1Flag -#endif -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - | kLPUART_LinBreakFlag -#endif - , -}; - -/*! @brief LPUART timeout condition. - * This structure defines the conditions when the counter timeout occur. - */ -typedef enum _lpuart_timeout_condition -{ - kLPUART_TimeoutAfterCharacters = - 0U, /*!< Timeout occurs when the number of characters specified by timeoutValue are received. */ - kLPUART_TimeoutAfterIdle = 1U, /*!< Timeout occurs when rx/tx remains idle for timeoutValue of bit clocks after idle - condition is detected. */ - kLPUART_TimeoutAfterNext = 2U, /*!< Timeout occurs when rx/tx remains idle for timeoutValue of bit clocks after next - character is received/transmitted. */ - kLPUART_TimeoutAfterIdleBeforeExtended = 3U, /*!< Timeout occurs when tx/rx is idle for larger than timeoutValue of - bit clocks and smaller than tx/rx extended timeout value. */ -} lpuart_timeout_condition_t; - -/*! @brief LPUART timeout counter configuration structure. */ -typedef struct _lpuart_timeout_counter_config -{ - bool enableCounter; /*!< Eneble the timeout counter. */ - lpuart_timeout_condition_t timeoutCondition; /*!< Timeout condition. */ - uint16_t timeoutValue; /*!< Timeout value. */ -} lpuart_timeout_counter_config_t; - -/*! @brief LPUART timeout configuration structure. */ -typedef struct _lpuart_timeout_config -{ - uint16_t rxExtendedTimeoutValue; /*!< The number of bits since the last stop bit that is required for an - idle condition to be detected. Enable this will disable rxIdleType and rxIdleConfig. Set to 0 to disable. */ - uint16_t txExtendedTimeoutValue; /*!< The transmitter idle time in number of bits (baud rate) whenever an - idle character is queued through the transmit FIFO. */ - lpuart_timeout_counter_config_t rxCounter0; /*!< Rx counter 0 configuration. */ - lpuart_timeout_counter_config_t rxCounter1; /*!< Rx counter 1 configuration. */ - lpuart_timeout_counter_config_t txCounter0; /*!< Tx counter 0 configuration. */ - lpuart_timeout_counter_config_t txCounter1; /*!< Tx counter 1 configuration. */ -} lpuart_timeout_config_t; - -/*! @brief LPUART configuration structure. */ -typedef struct _lpuart_config -{ - uint32_t baudRate_Bps; /*!< LPUART baud rate */ - lpuart_parity_mode_t parityMode; /*!< Parity mode, disabled (default), even, odd */ - lpuart_data_bits_t dataBitsCount; /*!< Data bits count, eight (default), seven */ - bool isMsb; /*!< Data bits order, LSB (default), MSB */ -#if defined(FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT) && FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT - lpuart_stop_bit_count_t stopBitCount; /*!< Number of stop bits, 1 stop bit (default) or 2 stop bits */ -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - uint8_t txFifoWatermark; /*!< TX FIFO watermark */ - uint8_t rxFifoWatermark; /*!< RX FIFO watermark */ -#endif -#if defined(FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT) && FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT - bool enableRxRTS; /*!< RX RTS enable */ - bool enableTxCTS; /*!< TX CTS enable */ - lpuart_transmit_cts_source_t txCtsSource; /*!< TX CTS source */ - lpuart_transmit_cts_config_t txCtsConfig; /*!< TX CTS configure */ -#endif - lpuart_idle_type_select_t rxIdleType; /*!< RX IDLE type. */ - lpuart_idle_config_t rxIdleConfig; /*!< RX IDLE configuration. */ - lpuart_timeout_config_t timeoutConfig; /*!< Timeout configuration. */ - bool enableSingleWire; /*!< Use TXD pin as the source for the receiver. When enabled the TXD pin should be - configured as open drain. */ - uint8_t rtsDelay; /*!< Delay the negation of RTS by the configured number of bit clocks. */ - bool enableTx; /*!< Enable TX */ - bool enableRx; /*!< Enable RX */ -} lpuart_config_t; - -/*! @brief LPUART transfer structure. */ -typedef struct _lpuart_transfer -{ - /* - * Use separate TX and RX data pointer, because TX data is const data. - * The member data is kept for backward compatibility. - */ - union - { - uint8_t *data; /*!< The buffer of data to be transfer.*/ - uint8_t *rxData; /*!< The buffer to receive data. */ - const uint8_t *txData; /*!< The buffer of data to be sent. */ - }; - size_t dataSize; /*!< The byte count to be transfer. */ -} lpuart_transfer_t; - -/* Forward declaration of the handle typedef. */ -typedef struct _lpuart_handle lpuart_handle_t; - -/*! @brief LPUART transfer callback function. */ -typedef void (*lpuart_transfer_callback_t)(LPUART_Type *base, lpuart_handle_t *handle, status_t status, void *userData); - -/*! @brief LPUART handle structure. */ -struct _lpuart_handle -{ - const uint8_t *volatile txData; /*!< Address of remaining data to send. */ - volatile size_t txDataSize; /*!< Size of the remaining data to send. */ - size_t txDataSizeAll; /*!< Size of the data to send out. */ - uint8_t *volatile rxData; /*!< Address of remaining data to receive. */ - volatile size_t rxDataSize; /*!< Size of the remaining data to receive. */ - size_t rxDataSizeAll; /*!< Size of the data to receive. */ - - uint8_t *rxRingBuffer; /*!< Start address of the receiver ring buffer. */ - size_t rxRingBufferSize; /*!< Size of the ring buffer. */ - volatile uint16_t rxRingBufferHead; /*!< Index for the driver to store received data into ring buffer. */ - volatile uint16_t rxRingBufferTail; /*!< Index for the user to get data from the ring buffer. */ - - lpuart_transfer_callback_t callback; /*!< Callback function. */ - void *userData; /*!< LPUART callback function parameter.*/ - - volatile uint8_t txState; /*!< TX transfer state. */ - volatile uint8_t rxState; /*!< RX transfer state. */ - -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - bool isSevenDataBits; /*!< Seven data bits flag. */ -#endif - bool is16bitData; /*!< 16bit data bits flag, only used for 9bit or 10bit data */ -}; - -/* Typedef for interrupt handler. */ -typedef void (*lpuart_irq_handler_t)(uint32_t instance, void *handle); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/* Array of LPUART IRQ number. */ -extern const IRQn_Type s_lpuartIRQ[]; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* _cplusplus */ - -#if defined(FSL_FEATURE_LPUART_HAS_GLOBAL) && FSL_FEATURE_LPUART_HAS_GLOBAL - -/*! - * @name Software Reset - * @{ - */ - -/*! - * @brief Resets the LPUART using software. - * - * This function resets all internal logic and registers except the Global Register. - * Remains set until cleared by software. - * - * @param base LPUART peripheral base address. - */ -static inline void LPUART_SoftwareReset(LPUART_Type *base) -{ - base->GLOBAL |= LPUART_GLOBAL_RST_MASK; - base->GLOBAL &= ~LPUART_GLOBAL_RST_MASK; -} - -/*! - * @brief Sets the LPUART using 16bit transmit, only for 9bit or 10bit mode. - * - * This function Enable 16bit Data transmit in lpuart_handle_t. - * - * @param handle LPUART handle pointer. - * @param enable true to enable, false to disable. - */ -static inline void LPUART_TransferEnable16Bit(lpuart_handle_t *handle,bool enable) -{ - handle->is16bitData = enable; -} - -/* @} */ -#endif /*FSL_FEATURE_LPUART_HAS_GLOBAL*/ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Initializes an LPUART instance with the user configuration structure and the peripheral clock. - * - * This function configures the LPUART module with user-defined settings. Call the LPUART_GetDefaultConfig() function - * to configure the configuration structure and get the default configuration. - * The example below shows how to use this API to configure the LPUART. - * @code - * lpuart_config_t lpuartConfig; - * lpuartConfig.baudRate_Bps = 115200U; - * lpuartConfig.parityMode = kLPUART_ParityDisabled; - * lpuartConfig.dataBitsCount = kLPUART_EightDataBits; - * lpuartConfig.isMsb = false; - * lpuartConfig.stopBitCount = kLPUART_OneStopBit; - * lpuartConfig.txFifoWatermark = 0; - * lpuartConfig.rxFifoWatermark = 1; - * LPUART_Init(LPUART1, &lpuartConfig, 20000000U); - * @endcode - * - * @param base LPUART peripheral base address. - * @param config Pointer to a user-defined configuration structure. - * @param srcClock_Hz LPUART clock source frequency in HZ. - * @retval kStatus_LPUART_BaudrateNotSupport Baudrate is not support in current clock source. - * @retval kStatus_Success LPUART initialize succeed - */ -status_t LPUART_Init(LPUART_Type *base, const lpuart_config_t *config, uint32_t srcClock_Hz); - -/*! - * @brief Deinitializes a LPUART instance. - * - * This function waits for transmit to complete, disables TX and RX, and disables the LPUART clock. - * - * @param base LPUART peripheral base address. - */ -void LPUART_Deinit(LPUART_Type *base); - -/*! - * @brief Gets the default configuration structure. - * - * This function initializes the LPUART configuration structure to a default value. The default - * values are: - * lpuartConfig->baudRate_Bps = 115200U; - * lpuartConfig->parityMode = kLPUART_ParityDisabled; - * lpuartConfig->dataBitsCount = kLPUART_EightDataBits; - * lpuartConfig->isMsb = false; - * lpuartConfig->stopBitCount = kLPUART_OneStopBit; - * lpuartConfig->txFifoWatermark = 0; - * lpuartConfig->rxFifoWatermark = 1; - * lpuartConfig->rxIdleType = kLPUART_IdleTypeStartBit; - * lpuartConfig->rxIdleConfig = kLPUART_IdleCharacter1; - * lpuartConfig->enableTx = false; - * lpuartConfig->enableRx = false; - * - * @param config Pointer to a configuration structure. - */ -void LPUART_GetDefaultConfig(lpuart_config_t *config); -/* @} */ - -/*! - * @name Module configuration - * @{ - */ -/*! - * @brief Sets the LPUART instance baudrate. - * - * This function configures the LPUART module baudrate. This function is used to update - * the LPUART module baudrate after the LPUART module is initialized by the LPUART_Init. - * @code - * LPUART_SetBaudRate(LPUART1, 115200U, 20000000U); - * @endcode - * - * @param base LPUART peripheral base address. - * @param baudRate_Bps LPUART baudrate to be set. - * @param srcClock_Hz LPUART clock source frequency in HZ. - * @retval kStatus_LPUART_BaudrateNotSupport Baudrate is not supported in the current clock source. - * @retval kStatus_Success Set baudrate succeeded. - */ -status_t LPUART_SetBaudRate(LPUART_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz); - -/*! - * @brief Enable 9-bit data mode for LPUART. - * - * This function set the 9-bit mode for LPUART module. The 9th bit is not used for parity thus can be modified by user. - * - * @param base LPUART peripheral base address. - * @param enable true to enable, flase to disable. - */ -void LPUART_Enable9bitMode(LPUART_Type *base, bool enable); - -/*! - * @brief Set the LPUART address. - * - * This function configures the address for LPUART module that works as slave in 9-bit data mode. One or two address - * fields can be configured. When the address field's match enable bit is set, the frame it receices with MSB being - * 1 is considered as an address frame, otherwise it is considered as data frame. Once the address frame matches one - * of slave's own addresses, this slave is addressed. This address frame and its following data frames are stored in - * the receive buffer, otherwise the frames will be discarded. To un-address a slave, just send an address frame with - * unmatched address. - * - * @note Any LPUART instance joined in the multi-slave system can work as slave. The position of the address mark is the - * same as the parity bit when parity is enabled for 8 bit and 9 bit data formats. - * - * @param base LPUART peripheral base address. - * @param address1 LPUART slave address1. - * @param address2 LPUART slave address2. - */ -static inline void LPUART_SetMatchAddress(LPUART_Type *base, uint16_t address1, uint16_t address2) -{ - /* Configure match address. */ - uint32_t address = ((uint32_t)address2 << 16U) | (uint32_t)address1 | 0x1000100UL; - base->MATCH = address; -} - -/*! - * @brief Enable the LPUART match address feature. - * - * @param base LPUART peripheral base address. - * @param match1 true to enable match address1, false to disable. - * @param match2 true to enable match address2, false to disable. - */ -static inline void LPUART_EnableMatchAddress(LPUART_Type *base, bool match1, bool match2) -{ - /* Configure match address1 enable bit. */ - if (match1) - { - base->BAUD |= (uint32_t)LPUART_BAUD_MAEN1_MASK; - } - else - { - base->BAUD &= ~(uint32_t)LPUART_BAUD_MAEN1_MASK; - } - /* Configure match address2 enable bit. */ - if (match2) - { - base->BAUD |= (uint32_t)LPUART_BAUD_MAEN2_MASK; - } - else - { - base->BAUD &= ~(uint32_t)LPUART_BAUD_MAEN2_MASK; - } -} - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO -/*! - * @brief Sets the rx FIFO watermark. - * - * @param base LPUART peripheral base address. - * @param water Rx FIFO watermark. - */ -static inline void LPUART_SetRxFifoWatermark(LPUART_Type *base, uint8_t water) -{ - assert((uint8_t)FSL_FEATURE_LPUART_FIFO_SIZEn(base) > water); - base->WATER = (base->WATER & ~LPUART_WATER_RXWATER_MASK) | LPUART_WATER_RXWATER(water); -} - -/*! - * @brief Sets the tx FIFO watermark. - * - * @param base LPUART peripheral base address. - * @param water Tx FIFO watermark. - */ -static inline void LPUART_SetTxFifoWatermark(LPUART_Type *base, uint8_t water) -{ - assert((uint8_t)FSL_FEATURE_LPUART_FIFO_SIZEn(base) > water); - base->WATER = (base->WATER & ~LPUART_WATER_TXWATER_MASK) | LPUART_WATER_TXWATER(water); -} -#endif -/* @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets LPUART status flags. - * - * This function gets all LPUART status flags. The flags are returned as the logical - * OR value of the enumerators @ref _lpuart_flags. To check for a specific status, - * compare the return value with enumerators in the @ref _lpuart_flags. - * For example, to check whether the TX is empty: - * @code - * if (kLPUART_TxDataRegEmptyFlag & LPUART_GetStatusFlags(LPUART1)) - * { - * ... - * } - * @endcode - * - * @param base LPUART peripheral base address. - * @return LPUART status flags which are ORed by the enumerators in the _lpuart_flags. - */ -uint32_t LPUART_GetStatusFlags(LPUART_Type *base); - -/*! - * @brief Clears status flags with a provided mask. - * - * This function clears LPUART status flags with a provided mask. Automatically cleared flags - * can't be cleared by this function. - * Flags that can only cleared or set by hardware are: - * kLPUART_TxDataRegEmptyFlag, kLPUART_TransmissionCompleteFlag, kLPUART_RxDataRegFullFlag, - * kLPUART_RxActiveFlag, kLPUART_NoiseErrorInRxDataRegFlag, kLPUART_ParityErrorInRxDataRegFlag, - * kLPUART_TxFifoEmptyFlag,kLPUART_RxFifoEmptyFlag - * Note: This API should be called when the Tx/Rx is idle, otherwise it takes no effects. - * - * @param base LPUART peripheral base address. - * @param mask the status flags to be cleared. The user can use the enumerators in the - * _lpuart_status_flag_t to do the OR operation and get the mask. - * @return 0 succeed, others failed. - * @retval kStatus_LPUART_FlagCannotClearManually The flag can't be cleared by this function but - * it is cleared automatically by hardware. - * @retval kStatus_Success Status in the mask are cleared. - */ -status_t LPUART_ClearStatusFlags(LPUART_Type *base, uint32_t mask); -/* @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables LPUART interrupts according to a provided mask. - * - * This function enables the LPUART interrupts according to a provided mask. The mask - * is a logical OR of enumeration members. See the @ref _lpuart_interrupt_enable. - * This examples shows how to enable TX empty interrupt and RX full interrupt: - * @code - * LPUART_EnableInterrupts(LPUART1,kLPUART_TxDataRegEmptyInterruptEnable | kLPUART_RxDataRegFullInterruptEnable); - * @endcode - * - * @param base LPUART peripheral base address. - * @param mask The interrupts to enable. Logical OR of the enumeration _uart_interrupt_enable. - */ -void LPUART_EnableInterrupts(LPUART_Type *base, uint32_t mask); - -/*! - * @brief Disables LPUART interrupts according to a provided mask. - * - * This function disables the LPUART interrupts according to a provided mask. The mask - * is a logical OR of enumeration members. See @ref _lpuart_interrupt_enable. - * This example shows how to disable the TX empty interrupt and RX full interrupt: - * @code - * LPUART_DisableInterrupts(LPUART1,kLPUART_TxDataRegEmptyInterruptEnable | kLPUART_RxDataRegFullInterruptEnable); - * @endcode - * - * @param base LPUART peripheral base address. - * @param mask The interrupts to disable. Logical OR of @ref _lpuart_interrupt_enable. - */ -void LPUART_DisableInterrupts(LPUART_Type *base, uint32_t mask); - -/*! - * @brief Gets enabled LPUART interrupts. - * - * This function gets the enabled LPUART interrupts. The enabled interrupts are returned - * as the logical OR value of the enumerators @ref _lpuart_interrupt_enable. To check - * a specific interrupt enable status, compare the return value with enumerators - * in @ref _lpuart_interrupt_enable. - * For example, to check whether the TX empty interrupt is enabled: - * @code - * uint32_t enabledInterrupts = LPUART_GetEnabledInterrupts(LPUART1); - * - * if (kLPUART_TxDataRegEmptyInterruptEnable & enabledInterrupts) - * { - * ... - * } - * @endcode - * - * @param base LPUART peripheral base address. - * @return LPUART interrupt flags which are logical OR of the enumerators in @ref _lpuart_interrupt_enable. - */ -uint32_t LPUART_GetEnabledInterrupts(LPUART_Type *base); -/* @} */ - -#if defined(FSL_FEATURE_LPUART_HAS_DMA_ENABLE) && FSL_FEATURE_LPUART_HAS_DMA_ENABLE -/*! - * @name DMA Configuration - * @{ - */ -/*! - * @brief Gets the LPUART data register address. - * - * This function returns the LPUART data register address, which is mainly used by the DMA/eDMA. - * - * @param base LPUART peripheral base address. - * @return LPUART data register addresses which are used both by the transmitter and receiver. - */ -static inline uint32_t LPUART_GetDataRegisterAddress(LPUART_Type *base) -{ - return (uint32_t) & (base->DATA); -} - -/*! - * @brief Enables or disables the LPUART transmitter DMA request. - * - * This function enables or disables the transmit data register empty flag, STAT[TDRE], to generate DMA requests. - * - * @param base LPUART peripheral base address. - * @param enable True to enable, false to disable. - */ -static inline void LPUART_EnableTxDMA(LPUART_Type *base, bool enable) -{ - if (enable) - { - base->BAUD |= LPUART_BAUD_TDMAE_MASK; - } - else - { - base->BAUD &= ~LPUART_BAUD_TDMAE_MASK; - } -} - -/*! - * @brief Enables or disables the LPUART receiver DMA. - * - * This function enables or disables the receiver data register full flag, STAT[RDRF], to generate DMA requests. - * - * @param base LPUART peripheral base address. - * @param enable True to enable, false to disable. - */ -static inline void LPUART_EnableRxDMA(LPUART_Type *base, bool enable) -{ - if (enable) - { - base->BAUD |= LPUART_BAUD_RDMAE_MASK; - } - else - { - base->BAUD &= ~LPUART_BAUD_RDMAE_MASK; - } -} -/* @} */ -#endif /* FSL_FEATURE_LPUART_HAS_DMA_ENABLE */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Get the LPUART instance from peripheral base address. - * - * @param base LPUART peripheral base address. - * @return LPUART instance. - */ -uint32_t LPUART_GetInstance(LPUART_Type *base); - -/*! - * @brief Enables or disables the LPUART transmitter. - * - * This function enables or disables the LPUART transmitter. - * - * @param base LPUART peripheral base address. - * @param enable True to enable, false to disable. - */ -static inline void LPUART_EnableTx(LPUART_Type *base, bool enable) -{ - if (enable) - { - base->CTRL |= LPUART_CTRL_TE_MASK; - } - else - { - base->CTRL &= ~LPUART_CTRL_TE_MASK; - } -} - -/*! - * @brief Enables or disables the LPUART receiver. - * - * This function enables or disables the LPUART receiver. - * - * @param base LPUART peripheral base address. - * @param enable True to enable, false to disable. - */ -static inline void LPUART_EnableRx(LPUART_Type *base, bool enable) -{ - if (enable) - { - base->CTRL |= LPUART_CTRL_RE_MASK; - } - else - { - base->CTRL &= ~LPUART_CTRL_RE_MASK; - } -} - -/*! - * @brief Writes to the transmitter register. - * - * This function writes data to the transmitter register directly. The upper layer must - * ensure that the TX register is empty or that the TX FIFO has room before calling this function. - * - * @param base LPUART peripheral base address. - * @param data Data write to the TX register. - */ -static inline void LPUART_WriteByte(LPUART_Type *base, uint8_t data) -{ - base->DATA = data; -} - -/*! - * @brief Reads the receiver register. - * - * This function reads data from the receiver register directly. The upper layer must - * ensure that the receiver register is full or that the RX FIFO has data before calling this function. - * - * @param base LPUART peripheral base address. - * @return Data read from data register. - */ -static inline uint8_t LPUART_ReadByte(LPUART_Type *base) -{ -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - uint32_t ctrl = base->CTRL; - uint8_t result; - bool isSevenDataBits = (((ctrl & LPUART_CTRL_M7_MASK) != 0U) || - (((ctrl & LPUART_CTRL_M7_MASK) == 0U) && ((ctrl & LPUART_CTRL_M_MASK) == 0U) && - ((ctrl & LPUART_CTRL_PE_MASK) != 0U))); - - if (isSevenDataBits) - { - result = (uint8_t)(base->DATA & 0x7FU); - } - else - { - result = (uint8_t)base->DATA; - } - - return result; -#else - return (uint8_t)(base->DATA); -#endif -} - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO -/*! - * @brief Gets the rx FIFO data count. - * - * @param base LPUART peripheral base address. - * @return rx FIFO data count. - */ -static inline uint8_t LPUART_GetRxFifoCount(LPUART_Type *base) -{ - return (uint8_t)((base->WATER & LPUART_WATER_RXCOUNT_MASK) >> LPUART_WATER_RXCOUNT_SHIFT); -} - -/*! - * @brief Gets the tx FIFO data count. - * - * @param base LPUART peripheral base address. - * @return tx FIFO data count. - */ -static inline uint8_t LPUART_GetTxFifoCount(LPUART_Type *base) -{ - return (uint8_t)((base->WATER & LPUART_WATER_TXCOUNT_MASK) >> LPUART_WATER_TXCOUNT_SHIFT); -} -#endif - -/*! - * @brief Transmit an address frame in 9-bit data mode. - * - * @param base LPUART peripheral base address. - * @param address LPUART slave address. - */ -void LPUART_SendAddress(LPUART_Type *base, uint8_t address); - -/*! - * @brief Writes to the transmitter register using a blocking method. - * - * This function polls the transmitter register, first waits for the register to be empty or TX FIFO to have room, - * and writes data to the transmitter buffer, then waits for the dat to be sent out to the bus. - * - * @param base LPUART peripheral base address. - * @param data Start address of the data to write. - * @param length Size of the data to write. - * @retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * @retval kStatus_Success Successfully wrote all data. - */ -status_t LPUART_WriteBlocking(LPUART_Type *base, const uint8_t *data, size_t length); - -/*! - * @brief Writes to the transmitter register using a blocking method in 9bit or 10bit mode. - * - * @note This function only support 9bit or 10bit transfer. - * Please make sure only 10bit of data is valid and other bits are 0. - * - * @param base LPUART peripheral base address. - * @param data Start address of the data to write. - * @param length Size of the data to write. - * @retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * @retval kStatus_Success Successfully wrote all data. - */ -status_t LPUART_WriteBlocking16bit(LPUART_Type *base, const uint16_t *data, size_t length); - -/*! - * @brief Reads the receiver data register using a blocking method. - * - * This function polls the receiver register, waits for the receiver register full or receiver FIFO - * has data, and reads data from the TX register. - * - * @param base LPUART peripheral base address. - * @param data Start address of the buffer to store the received data. - * @param length Size of the buffer. - * @retval kStatus_LPUART_RxHardwareOverrun Receiver overrun happened while receiving data. - * @retval kStatus_LPUART_NoiseError Noise error happened while receiving data. - * @retval kStatus_LPUART_FramingError Framing error happened while receiving data. - * @retval kStatus_LPUART_ParityError Parity error happened while receiving data. - * @retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * @retval kStatus_Success Successfully received all data. - */ -status_t LPUART_ReadBlocking(LPUART_Type *base, uint8_t *data, size_t length); - -/*! - * @brief Reads the receiver data register in 9bit or 10bit mode. - * - * @note This function only support 9bit or 10bit transfer. - * - * @param base LPUART peripheral base address. - * @param data Start address of the buffer to store the received data by 16bit, only 10bit is valid. - * @param length Size of the buffer. - * @retval kStatus_LPUART_RxHardwareOverrun Receiver overrun happened while receiving data. - * @retval kStatus_LPUART_NoiseError Noise error happened while receiving data. - * @retval kStatus_LPUART_FramingError Framing error happened while receiving data. - * @retval kStatus_LPUART_ParityError Parity error happened while receiving data. - * @retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * @retval kStatus_Success Successfully received all data. - */ -status_t LPUART_ReadBlocking16bit(LPUART_Type *base, uint16_t *data, size_t length); - -/* @} */ - -/*! - * @name Transactional - * @{ - */ - -/*! - * @brief Initializes the LPUART handle. - * - * This function initializes the LPUART handle, which can be used for other LPUART - * transactional APIs. Usually, for a specified LPUART instance, - * call this API once to get the initialized handle. - * - * The LPUART driver supports the "background" receiving, which means that user can set up - * an RX ring buffer optionally. Data received is stored into the ring buffer even when the - * user doesn't call the LPUART_TransferReceiveNonBlocking() API. If there is already data received - * in the ring buffer, the user can get the received data from the ring buffer directly. - * The ring buffer is disabled if passing NULL as @p ringBuffer. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param callback Callback function. - * @param userData User data. - */ -void LPUART_TransferCreateHandle(LPUART_Type *base, - lpuart_handle_t *handle, - lpuart_transfer_callback_t callback, - void *userData); -/*! - * @brief Transmits a buffer of data using the interrupt method. - * - * This function send data using an interrupt method. This is a non-blocking function, which - * returns directly without waiting for all data written to the transmitter register. When - * all data is written to the TX register in the ISR, the LPUART driver calls the callback - * function and passes the @ref kStatus_LPUART_TxIdle as status parameter. - * - * @note The kStatus_LPUART_TxIdle is passed to the upper layer when all data are written - * to the TX register. However, there is no check to ensure that all the data sent out. Before disabling the TX, - * check the kLPUART_TransmissionCompleteFlag to ensure that the transmit is finished. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param xfer LPUART transfer structure, see #lpuart_transfer_t. - * @retval kStatus_Success Successfully start the data transmission. - * @retval kStatus_LPUART_TxBusy Previous transmission still not finished, data not all written to the TX register. - * @retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_TransferSendNonBlocking(LPUART_Type *base, lpuart_handle_t *handle, lpuart_transfer_t *xfer); - -/*! - * @brief Sets up the RX ring buffer. - * - * This function sets up the RX ring buffer to a specific UART handle. - * - * When the RX ring buffer is used, data received is stored into the ring buffer even when - * the user doesn't call the UART_TransferReceiveNonBlocking() API. If there is already data received - * in the ring buffer, the user can get the received data from the ring buffer directly. - * - * @note When using RX ring buffer, one byte is reserved for internal use. In other - * words, if @p ringBufferSize is 32, then only 31 bytes are used for saving data. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param ringBuffer Start address of ring buffer for background receiving. Pass NULL to disable the ring buffer. - * @param ringBufferSize size of the ring buffer. - */ -void LPUART_TransferStartRingBuffer(LPUART_Type *base, - lpuart_handle_t *handle, - uint8_t *ringBuffer, - size_t ringBufferSize); - -/*! - * @brief Aborts the background transfer and uninstalls the ring buffer. - * - * This function aborts the background transfer and uninstalls the ring buffer. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - */ -void LPUART_TransferStopRingBuffer(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief Get the length of received data in RX ring buffer. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @return Length of received data in RX ring buffer. - */ -size_t LPUART_TransferGetRxRingBufferLength(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief Aborts the interrupt-driven data transmit. - * - * This function aborts the interrupt driven data sending. The user can get the remainBtyes to find out - * how many bytes are not sent out. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - */ -void LPUART_TransferAbortSend(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief Gets the number of bytes that have been sent out to bus. - * - * This function gets the number of bytes that have been sent out to bus by an interrupt method. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param count Send bytes count. - * @retval kStatus_NoTransferInProgress No send in progress. - * @retval kStatus_InvalidArgument Parameter is invalid. - * @retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetSendCount(LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count); - -/*! - * @brief Receives a buffer of data using the interrupt method. - * - * This function receives data using an interrupt method. This is a non-blocking function - * which returns without waiting to ensure that all data are received. - * If the RX ring buffer is used and not empty, the data in the ring buffer is copied and - * the parameter @p receivedBytes shows how many bytes are copied from the ring buffer. - * After copying, if the data in the ring buffer is not enough for read, the receive - * request is saved by the LPUART driver. When the new data arrives, the receive request - * is serviced first. When all data is received, the LPUART driver notifies the upper layer - * through a callback function and passes a status parameter kStatus_UART_RxIdle. - * For example, the upper layer needs 10 bytes but there are only 5 bytes in ring buffer. - * The 5 bytes are copied to xfer->data, which returns with the - * parameter @p receivedBytes set to 5. For the remaining 5 bytes, the newly arrived data is - * saved from xfer->data[5]. When 5 bytes are received, the LPUART driver notifies the upper layer. - * If the RX ring buffer is not enabled, this function enables the RX and RX interrupt - * to receive data to xfer->data. When all data is received, the upper layer is notified. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param xfer LPUART transfer structure, see uart_transfer_t. - * @param receivedBytes Bytes received from the ring buffer directly. - * @retval kStatus_Success Successfully queue the transfer into the transmit queue. - * @retval kStatus_LPUART_RxBusy Previous receive request is not finished. - * @retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_TransferReceiveNonBlocking(LPUART_Type *base, - lpuart_handle_t *handle, - lpuart_transfer_t *xfer, - size_t *receivedBytes); - -/*! - * @brief Aborts the interrupt-driven data receiving. - * - * This function aborts the interrupt-driven data receiving. The user can get the remainBytes to find out - * how many bytes not received yet. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - */ -void LPUART_TransferAbortReceive(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief Gets the number of bytes that have been received. - * - * This function gets the number of bytes that have been received. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param count Receive bytes count. - * @retval kStatus_NoTransferInProgress No receive in progress. - * @retval kStatus_InvalidArgument Parameter is invalid. - * @retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetReceiveCount(LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count); - -/*! - * @brief LPUART IRQ handle function. - * - * This function handles the LPUART transmit and receive IRQ request. - * - * @param instance LPUART instance. - * @param irqHandle LPUART handle pointer. - */ -void LPUART_TransferHandleIRQ(uint32_t instance, void *irqHandle); - -/*! - * @brief LPUART Error IRQ handle function. - * - * This function handles the LPUART error IRQ request. - * - * @param base LPUART peripheral base address. - * @param irqHandle LPUART handle pointer. - */ -void LPUART_TransferHandleErrorIRQ(LPUART_Type *base, void *irqHandle); - -/* @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_LPUART_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpuart_edma.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpuart_edma.c deleted file mode 100644 index 65349656535..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpuart_edma.c +++ /dev/null @@ -1,510 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpuart_edma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpflexcomm_lpuart_edma" -#endif - -/*base, false); - - /* Stop transfer. */ - EDMA_AbortTransfer(handle); - - /* Enable tx complete interrupt */ - LPUART_EnableInterrupts(lpuartPrivateHandle->base, (uint32_t)kLPUART_TransmissionCompleteInterruptEnable); - } -} - -static void LPUART_ReceiveEDMACallback(edma_handle_t *handle, void *param, bool transferDone, uint32_t tcds) -{ - assert(NULL != param); - - lpuart_edma_private_handle_t *lpuartPrivateHandle = (lpuart_edma_private_handle_t *)param; - - /* Avoid warning for unused parameters. */ - handle = handle; - tcds = tcds; - - if (transferDone) - { - /* Disable transfer. */ - LPUART_TransferAbortReceiveEDMA(lpuartPrivateHandle->base, lpuartPrivateHandle->handle); - - if (NULL != lpuartPrivateHandle->handle->callback) - { - lpuartPrivateHandle->handle->callback(lpuartPrivateHandle->base, lpuartPrivateHandle->handle, - kStatus_LPUART_RxIdle, lpuartPrivateHandle->handle->userData); - } - } -} - -/*! - * brief Initializes the LPUART handle which is used in transactional functions. - * - * note This function disables all LPUART interrupts. - * - * param base LPUART peripheral base address. - * param handle Pointer to lpuart_edma_handle_t structure. - * param callback Callback function. - * param userData User data. - * param txEdmaHandle User requested DMA handle for TX DMA transfer. - * param rxEdmaHandle User requested DMA handle for RX DMA transfer. - */ -void LPUART_TransferCreateHandleEDMA(LPUART_Type *base, - lpuart_edma_handle_t *handle, - lpuart_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *txEdmaHandle, - edma_handle_t *rxEdmaHandle) -{ - assert(NULL != handle); - - uint32_t instance = LPUART_GetInstance(base); - lpuart_to_lpflexcomm_edma_t handler; - - s_lpuartEdmaPrivateHandle[instance].base = base; - s_lpuartEdmaPrivateHandle[instance].handle = handle; - - (void)memset(handle, 0, sizeof(*handle)); - - handle->rxState = (uint8_t)kLPUART_RxIdle; - handle->txState = (uint8_t)kLPUART_TxIdle; - - handle->rxEdmaHandle = rxEdmaHandle; - handle->txEdmaHandle = txEdmaHandle; - - handle->callback = callback; - handle->userData = userData; - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Note: - Take care of the RX FIFO, EDMA request only assert when received bytes - equal or more than RX water mark, there is potential issue if RX water - mark larger than 1. - For example, if RX FIFO water mark is 2, upper layer needs 5 bytes and - 5 bytes are received. the last byte will be saved in FIFO but not trigger - EDMA transfer because the water mark is 2. - */ - if (NULL != rxEdmaHandle) - { - base->WATER &= (~LPUART_WATER_RXWATER_MASK); - } -#endif - handler.lpuart_handler = LPUART_TransferEdmaHandleIRQ; - /* Save the handle in global variables to support the double weak mechanism. */ - LP_FLEXCOMM_SetIRQHandler(instance, handler.lpflexcomm_handler, handle, LP_FLEXCOMM_PERIPH_LPUART); - /* Disable all LPUART internal interrupts */ - LPUART_DisableInterrupts(base, (uint32_t)kLPUART_AllInterruptEnable); - /* Enable interrupt in NVIC. */ -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ - (void)EnableIRQ(s_lpuartTxIRQ[instance]); -#else - (void)EnableIRQ(s_lpuartIRQ[instance]); -#endif - - /* Configure TX. */ - if (NULL != txEdmaHandle) - { - EDMA_SetCallback(handle->txEdmaHandle, LPUART_SendEDMACallback, &s_lpuartEdmaPrivateHandle[instance]); - } - - /* Configure RX. */ - if (NULL != rxEdmaHandle) - { - EDMA_SetCallback(handle->rxEdmaHandle, LPUART_ReceiveEDMACallback, &s_lpuartEdmaPrivateHandle[instance]); - } -} - -/*! - * brief Sends data using eDMA. - * - * This function sends data using eDMA. This is a non-blocking function, which returns - * right away. When all data is sent, the send callback function is called. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param xfer LPUART eDMA transfer structure. See #lpuart_transfer_t. - * retval kStatus_Success if succeed, others failed. - * retval kStatus_LPUART_TxBusy Previous transfer on going. - * retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_SendEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, lpuart_transfer_t *xfer) -{ - assert(NULL != handle); - assert(NULL != handle->txEdmaHandle); - assert(NULL != xfer); - assert(NULL != xfer->data); - assert(0U != xfer->dataSize); - - edma_transfer_config_t xferConfig; - status_t status; - - /* If previous TX not finished. */ - if ((uint8_t)kLPUART_TxBusy == handle->txState) - { - status = kStatus_LPUART_TxBusy; - } - else - { - handle->txState = (uint8_t)kLPUART_TxBusy; - handle->txDataSizeAll = xfer->dataSize; - - /* Prepare transfer. */ - EDMA_PrepareTransfer(&xferConfig, xfer->data, sizeof(uint8_t), - (void *)(uint32_t *)LPUART_GetDataRegisterAddress(base), sizeof(uint8_t), sizeof(uint8_t), - xfer->dataSize, kEDMA_MemoryToPeripheral); - - /* Store the initially configured eDMA minor byte transfer count into the LPUART handle */ - handle->nbytes = (uint8_t)sizeof(uint8_t); - - /* Submit transfer. */ - if (kStatus_Success != - EDMA_SubmitTransfer(handle->txEdmaHandle, (const edma_transfer_config_t *)(uint32_t)&xferConfig)) - { - return kStatus_Fail; - } - EDMA_StartTransfer(handle->txEdmaHandle); - - /* Enable LPUART TX EDMA. */ - LPUART_EnableTxDMA(base, true); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Receives data using eDMA. - * - * This function receives data using eDMA. This is non-blocking function, which returns - * right away. When all data is received, the receive callback function is called. - * - * param base LPUART peripheral base address. - * param handle Pointer to lpuart_edma_handle_t structure. - * param xfer LPUART eDMA transfer structure, see #lpuart_transfer_t. - * retval kStatus_Success if succeed, others fail. - * retval kStatus_LPUART_RxBusy Previous transfer ongoing. - * retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_ReceiveEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, lpuart_transfer_t *xfer) -{ - assert(NULL != handle); - assert(NULL != handle->rxEdmaHandle); - assert(NULL != xfer); - assert(NULL != xfer->data); - assert(0U != xfer->dataSize); - - edma_transfer_config_t xferConfig; - status_t status; - - /* If previous RX not finished. */ - if ((uint8_t)kLPUART_RxBusy == handle->rxState) - { - status = kStatus_LPUART_RxBusy; - } - else - { - handle->rxState = (uint8_t)kLPUART_RxBusy; - handle->rxDataSizeAll = xfer->dataSize; - - /* Prepare transfer. */ - EDMA_PrepareTransfer(&xferConfig, (void *)(uint32_t *)LPUART_GetDataRegisterAddress(base), sizeof(uint8_t), - xfer->data, sizeof(uint8_t), sizeof(uint8_t), xfer->dataSize, kEDMA_PeripheralToMemory); - - /* Store the initially configured eDMA minor byte transfer count into the LPUART handle */ - handle->nbytes = (uint8_t)sizeof(uint8_t); - - /* Submit transfer. */ - if (kStatus_Success != - EDMA_SubmitTransfer(handle->rxEdmaHandle, (const edma_transfer_config_t *)(uint32_t)&xferConfig)) - { - return kStatus_Fail; - } - EDMA_StartTransfer(handle->rxEdmaHandle); - - /* Enable LPUART RX EDMA. */ - LPUART_EnableRxDMA(base, true); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Aborts the sent data using eDMA. - * - * This function aborts the sent data using eDMA. - * - * param base LPUART peripheral base address. - * param handle Pointer to lpuart_edma_handle_t structure. - */ -void LPUART_TransferAbortSendEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle) -{ - assert(NULL != handle); - assert(NULL != handle->txEdmaHandle); - - /* Disable LPUART TX EDMA. */ - LPUART_EnableTxDMA(base, false); - - /* Stop transfer. */ - EDMA_AbortTransfer(handle->txEdmaHandle); - - handle->txState = (uint8_t)kLPUART_TxIdle; -} - -/*! - * brief Aborts the received data using eDMA. - * - * This function aborts the received data using eDMA. - * - * param base LPUART peripheral base address. - * param handle Pointer to lpuart_edma_handle_t structure. - */ -void LPUART_TransferAbortReceiveEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle) -{ - assert(NULL != handle); - assert(NULL != handle->rxEdmaHandle); - - /* Disable LPUART RX EDMA. */ - LPUART_EnableRxDMA(base, false); - - /* Stop transfer. */ - EDMA_AbortTransfer(handle->rxEdmaHandle); - - handle->rxState = (uint8_t)kLPUART_RxIdle; -} - -/*! - * brief Gets the number of received bytes. - * - * This function gets the number of received bytes. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param count Receive bytes count. - * retval kStatus_NoTransferInProgress No receive in progress. - * retval kStatus_InvalidArgument Parameter is invalid. - * retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetReceiveCountEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, uint32_t *count) -{ - assert(NULL != handle); - assert(NULL != handle->rxEdmaHandle); - assert(NULL != count); - - if ((uint8_t)kLPUART_RxIdle == handle->rxState) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->rxDataSizeAll - - ((uint32_t)handle->nbytes * - EDMA_GetRemainingMajorLoopCount(handle->rxEdmaHandle->base, handle->rxEdmaHandle->channel)); - - return kStatus_Success; -} - -/*! - * brief Gets the number of bytes written to the LPUART TX register. - * - * This function gets the number of bytes written to the LPUART TX - * register by DMA. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param count Send bytes count. - * retval kStatus_NoTransferInProgress No send in progress. - * retval kStatus_InvalidArgument Parameter is invalid. - * retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetSendCountEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, uint32_t *count) -{ - assert(NULL != handle); - assert(NULL != handle->txEdmaHandle); - assert(NULL != count); - - if ((uint8_t)kLPUART_TxIdle == handle->txState) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->txDataSizeAll - - ((uint32_t)handle->nbytes * - EDMA_GetRemainingMajorLoopCount(handle->txEdmaHandle->base, handle->txEdmaHandle->channel)); - - return kStatus_Success; -} - -/*! - * brief LPUART eDMA IRQ handle function. - * - * This function handles the LPUART tx complete IRQ request and invoke user callback. - * It is not set to static so that it can be used in user application. - * note This function is used as default IRQ handler by double weak mechanism. - * If user's specific IRQ handler is implemented, make sure this function is invoked in the handler. - * - * param instance LPUART peripheral index. - * param lpuartEdmaHandle LPUART handle pointer. - */ -void LPUART_TransferEdmaHandleIRQ(uint32_t instance, void *lpuartEdmaHandle) -{ - assert(lpuartEdmaHandle != NULL); - assert(instance < ARRAY_SIZE(s_lpuartBases)); - LPUART_Type *base = s_lpuartBases[instance]; - - if (((uint32_t)kLPUART_TransmissionCompleteFlag & LPUART_GetStatusFlags(base)) != 0U) - { - lpuart_edma_handle_t *handle = (lpuart_edma_handle_t *)lpuartEdmaHandle; - - /* Disable tx complete interrupt */ - LPUART_DisableInterrupts(base, (uint32_t)kLPUART_TransmissionCompleteInterruptEnable); - - handle->txState = (uint8_t)kLPUART_TxIdle; - - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_LPUART_TxIdle, handle->userData); - } - } -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpuart_edma.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpuart_edma.h deleted file mode 100644 index 2d25416da3c..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpuart_edma.h +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_LPUART_EDMA_H_ -#define FSL_LPUART_EDMA_H_ - -#include "fsl_lpuart.h" -#include "fsl_edma.h" - -/*! - * @addtogroup lpuart_edma_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief LPUART EDMA driver version. */ -#define FSL_LPUART_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) -/*@}*/ - -/* Forward declaration of the handle typedef. */ -typedef struct _lpuart_edma_handle lpuart_edma_handle_t; - -/*! @brief LPUART transfer callback function. */ -typedef void (*lpuart_edma_transfer_callback_t)(LPUART_Type *base, - lpuart_edma_handle_t *handle, - status_t status, - void *userData); - -/*! - * @brief LPUART eDMA handle - */ -struct _lpuart_edma_handle -{ - lpuart_edma_transfer_callback_t callback; /*!< Callback function. */ - void *userData; /*!< LPUART callback function parameter.*/ - size_t rxDataSizeAll; /*!< Size of the data to receive. */ - size_t txDataSizeAll; /*!< Size of the data to send out. */ - - edma_handle_t *txEdmaHandle; /*!< The eDMA TX channel used. */ - edma_handle_t *rxEdmaHandle; /*!< The eDMA RX channel used. */ - - uint8_t nbytes; /*!< eDMA minor byte transfer count initially configured. */ - - volatile uint8_t txState; /*!< TX transfer state. */ - volatile uint8_t rxState; /*!< RX transfer state */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name eDMA transactional - * @{ - */ - -/*! - * @brief Initializes the LPUART handle which is used in transactional functions. - * - * @note This function disables all LPUART interrupts. - * - * @param base LPUART peripheral base address. - * @param handle Pointer to lpuart_edma_handle_t structure. - * @param callback Callback function. - * @param userData User data. - * @param txEdmaHandle User requested DMA handle for TX DMA transfer. - * @param rxEdmaHandle User requested DMA handle for RX DMA transfer. - */ -void LPUART_TransferCreateHandleEDMA(LPUART_Type *base, - lpuart_edma_handle_t *handle, - lpuart_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *txEdmaHandle, - edma_handle_t *rxEdmaHandle); - -/*! - * @brief Sends data using eDMA. - * - * This function sends data using eDMA. This is a non-blocking function, which returns - * right away. When all data is sent, the send callback function is called. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param xfer LPUART eDMA transfer structure. See #lpuart_transfer_t. - * @retval kStatus_Success if succeed, others failed. - * @retval kStatus_LPUART_TxBusy Previous transfer on going. - * @retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_SendEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, lpuart_transfer_t *xfer); - -/*! - * @brief Receives data using eDMA. - * - * This function receives data using eDMA. This is non-blocking function, which returns - * right away. When all data is received, the receive callback function is called. - * - * @param base LPUART peripheral base address. - * @param handle Pointer to lpuart_edma_handle_t structure. - * @param xfer LPUART eDMA transfer structure, see #lpuart_transfer_t. - * @retval kStatus_Success if succeed, others fail. - * @retval kStatus_LPUART_RxBusy Previous transfer ongoing. - * @retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_ReceiveEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, lpuart_transfer_t *xfer); - -/*! - * @brief Aborts the sent data using eDMA. - * - * This function aborts the sent data using eDMA. - * - * @param base LPUART peripheral base address. - * @param handle Pointer to lpuart_edma_handle_t structure. - */ -void LPUART_TransferAbortSendEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle); - -/*! - * @brief Aborts the received data using eDMA. - * - * This function aborts the received data using eDMA. - * - * @param base LPUART peripheral base address. - * @param handle Pointer to lpuart_edma_handle_t structure. - */ -void LPUART_TransferAbortReceiveEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle); - -/*! - * @brief Gets the number of bytes written to the LPUART TX register. - * - * This function gets the number of bytes written to the LPUART TX - * register by DMA. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param count Send bytes count. - * @retval kStatus_NoTransferInProgress No send in progress. - * @retval kStatus_InvalidArgument Parameter is invalid. - * @retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetSendCountEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, uint32_t *count); - -/*! - * @brief Gets the number of received bytes. - * - * This function gets the number of received bytes. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param count Receive bytes count. - * @retval kStatus_NoTransferInProgress No receive in progress. - * @retval kStatus_InvalidArgument Parameter is invalid. - * @retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetReceiveCountEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, uint32_t *count); - -/*! - * @brief LPUART eDMA IRQ handle function. - * - * This function handles the LPUART tx complete IRQ request and invoke user callback. - * It is not set to static so that it can be used in user application. - * @note This function is used as default IRQ handler by double weak mechanism. - * If user's specific IRQ handler is implemented, make sure this function is invoked in the handler. - * - * @param instance LPUART peripheral index. - * @param lpuartEdmaHandle LPUART handle pointer. - */ -void LPUART_TransferEdmaHandleIRQ(uint32_t instance, void *lpuartEdmaHandle); - -/*@}*/ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_LPUART_EDMA_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpuart_freertos.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpuart_freertos.c deleted file mode 100644 index f78a4dc9faa..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpuart_freertos.c +++ /dev/null @@ -1,489 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpuart_freertos.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpflexcomm_lpuart_freertos" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -static void LPUART_RTOS_Callback(LPUART_Type *base, lpuart_handle_t *state, status_t status, void *param) -{ - lpuart_rtos_handle_t *handle = (lpuart_rtos_handle_t *)param; - BaseType_t xHigherPriorityTaskWoken, xResult; - - xHigherPriorityTaskWoken = pdFALSE; - xResult = pdFAIL; - - if (status == kStatus_LPUART_RxIdle) - { - xResult = xEventGroupSetBitsFromISR(handle->rxEvent, RTOS_LPUART_RX_COMPLETE, &xHigherPriorityTaskWoken); - } - else if (status == kStatus_LPUART_TxIdle) - { - xResult = xEventGroupSetBitsFromISR(handle->txEvent, RTOS_LPUART_TX_COMPLETE, &xHigherPriorityTaskWoken); - } - else if (status == kStatus_LPUART_RxRingBufferOverrun) - { - xResult = - xEventGroupSetBitsFromISR(handle->rxEvent, RTOS_LPUART_RING_BUFFER_OVERRUN, &xHigherPriorityTaskWoken); - } - else if (status == kStatus_LPUART_RxHardwareOverrun) - { - /* Clear Overrun flag (OR) in LPUART STAT register */ - (void)LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_RxOverrunFlag); - xResult = - xEventGroupSetBitsFromISR(handle->rxEvent, RTOS_LPUART_HARDWARE_BUFFER_OVERRUN, &xHigherPriorityTaskWoken); - } - else - { - xResult = pdFAIL; - } - - if (xResult != pdFAIL) - { - portYIELD_FROM_ISR(xHigherPriorityTaskWoken); - } -} - -/*FUNCTION********************************************************************** - * - * Function Name : LPUART_RTOS_Init - * Description : Initializes the LPUART instance for application - * - *END**************************************************************************/ -/*! - * brief Initializes an LPUART instance for operation in RTOS. - * - * param handle The RTOS LPUART handle, the pointer to an allocated space for RTOS context. - * param t_handle The pointer to an allocated space to store the transactional layer internal state. - * param cfg The pointer to the parameters required to configure the LPUART after initialization. - * return kStatus_Success, others failed - */ -int LPUART_RTOS_Init(lpuart_rtos_handle_t *handle, lpuart_handle_t *t_handle, const lpuart_rtos_config_t *cfg) -{ - status_t status; - lpuart_config_t defcfg; - - if (NULL == handle) - { - return kStatus_InvalidArgument; - } - if (NULL == t_handle) - { - return kStatus_InvalidArgument; - } - if (NULL == cfg) - { - return kStatus_InvalidArgument; - } - if (NULL == cfg->base) - { - return kStatus_InvalidArgument; - } - if (0u == cfg->srcclk) - { - return kStatus_InvalidArgument; - } - if (0u == cfg->baudrate) - { - return kStatus_InvalidArgument; - } - - handle->base = cfg->base; - handle->t_state = t_handle; - handle->rx_timeout_constant_ms = cfg->rx_timeout_constant_ms; - handle->rx_timeout_multiplier_ms = cfg->rx_timeout_multiplier_ms; - handle->tx_timeout_constant_ms = cfg->tx_timeout_constant_ms; - handle->tx_timeout_multiplier_ms = cfg->tx_timeout_multiplier_ms; - -#if (configSUPPORT_STATIC_ALLOCATION == 1) - handle->txSemaphore = xSemaphoreCreateMutexStatic(&handle->txSemaphoreBuffer); -#else - handle->txSemaphore = xSemaphoreCreateMutex(); -#endif - if (NULL == handle->txSemaphore) - { - return kStatus_Fail; - } -#if (configSUPPORT_STATIC_ALLOCATION == 1) - handle->rxSemaphore = xSemaphoreCreateMutexStatic(&handle->rxSemaphoreBuffer); -#else - handle->rxSemaphore = xSemaphoreCreateMutex(); -#endif - if (NULL == handle->rxSemaphore) - { - vSemaphoreDelete(handle->txSemaphore); - return kStatus_Fail; - } -#if (configSUPPORT_STATIC_ALLOCATION == 1) - handle->txEvent = xEventGroupCreateStatic(&handle->txEventBuffer); -#else - handle->txEvent = xEventGroupCreate(); -#endif - if (NULL == handle->txEvent) - { - vSemaphoreDelete(handle->rxSemaphore); - vSemaphoreDelete(handle->txSemaphore); - return kStatus_Fail; - } -#if (configSUPPORT_STATIC_ALLOCATION == 1) - handle->rxEvent = xEventGroupCreateStatic(&handle->rxEventBuffer); -#else - handle->rxEvent = xEventGroupCreate(); -#endif - if (NULL == handle->rxEvent) - { - vEventGroupDelete(handle->txEvent); - vSemaphoreDelete(handle->rxSemaphore); - vSemaphoreDelete(handle->txSemaphore); - return kStatus_Fail; - } - - LPUART_GetDefaultConfig(&defcfg); - - defcfg.baudRate_Bps = cfg->baudrate; - defcfg.parityMode = cfg->parity; - defcfg.stopBitCount = cfg->stopbits; -#if defined(FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT) && FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT - defcfg.enableRxRTS = cfg->enableRxRTS; - defcfg.enableTxCTS = cfg->enableTxCTS; - defcfg.txCtsSource = cfg->txCtsSource; - defcfg.txCtsConfig = cfg->txCtsConfig; -#endif - status = LPUART_Init(handle->base, &defcfg, cfg->srcclk); - if (status != kStatus_Success) - { - vEventGroupDelete(handle->rxEvent); - vEventGroupDelete(handle->txEvent); - vSemaphoreDelete(handle->rxSemaphore); - vSemaphoreDelete(handle->txSemaphore); - return kStatus_Fail; - } - LPUART_TransferCreateHandle(handle->base, handle->t_state, LPUART_RTOS_Callback, handle); - LPUART_TransferStartRingBuffer(handle->base, handle->t_state, cfg->buffer, cfg->buffer_size); - - LPUART_EnableTx(handle->base, true); - LPUART_EnableRx(handle->base, true); - - return kStatus_Success; -} - -/*FUNCTION********************************************************************** - * - * Function Name : LPUART_RTOS_Deinit - * Description : Deinitializes the LPUART instance and frees resources - * - *END**************************************************************************/ -/*! - * brief Deinitializes an LPUART instance for operation. - * - * This function deinitializes the LPUART module, sets all register value to the reset value, - * and releases the resources. - * - * param handle The RTOS LPUART handle. - */ -int LPUART_RTOS_Deinit(lpuart_rtos_handle_t *handle) -{ - LPUART_Deinit(handle->base); - - vEventGroupDelete(handle->txEvent); - vEventGroupDelete(handle->rxEvent); - - /* Give the semaphore. This is for functional safety */ - (void)xSemaphoreGive(handle->txSemaphore); - (void)xSemaphoreGive(handle->rxSemaphore); - - vSemaphoreDelete(handle->txSemaphore); - vSemaphoreDelete(handle->rxSemaphore); - - /* Invalidate the handle */ - handle->base = NULL; - handle->t_state = NULL; - - return 0; -} - -/*FUNCTION********************************************************************** - * - * Function Name : UART_RTOS_Send - * Description : Send chars over LPUART - * - *END**************************************************************************/ -/*! - * brief Sends data in the background. - * - * This function sends data. It is an synchronous API. - * If the hardware buffer is full, the task is in the blocked state. - * - * param handle The RTOS LPUART handle. - * param buffer The pointer to buffer to send. - * param length The number of bytes to send. - */ -int LPUART_RTOS_Send(lpuart_rtos_handle_t *handle, uint8_t *buffer, uint32_t length) -{ - EventBits_t ev; - int retval = kStatus_Fail; - status_t status; - const TickType_t txTickTimeout = - (length * handle->tx_timeout_multiplier_ms + handle->tx_timeout_constant_ms) / portTICK_PERIOD_MS; - - if (NULL == handle->base) - { - /* Invalid handle. */ - return kStatus_Fail; - } - if (0u == length) - { - return kStatus_Success; - } - if (NULL == buffer) - { - return kStatus_InvalidArgument; - } - - if (pdFALSE == xSemaphoreTake(handle->txSemaphore, 0u)) - { - /* We could not take the semaphore, exit with 0 data received */ - return kStatus_Fail; - } - - handle->txTransfer.data = (uint8_t *)buffer; - handle->txTransfer.dataSize = (uint32_t)length; - - /* Non-blocking call */ - status = LPUART_TransferSendNonBlocking(handle->base, handle->t_state, &handle->txTransfer); - if (status != kStatus_Success) - { - (void)xSemaphoreGive(handle->txSemaphore); - return kStatus_Fail; - } - - ev = xEventGroupWaitBits(handle->txEvent, RTOS_LPUART_TX_COMPLETE, pdTRUE, pdFALSE, - (txTickTimeout > 0u) ? txTickTimeout : portMAX_DELAY); - if ((ev & RTOS_LPUART_TX_COMPLETE) != 0u) - { - retval = kStatus_Success; - } - else /* timeout expired or unknown error*/ - { - if (txTickTimeout > 0u) - { - LPUART_TransferAbortSend(handle->base, handle->t_state); - (void)xEventGroupClearBits(handle->txEvent, RTOS_LPUART_TX_COMPLETE); - retval = kStatus_Timeout; - } - else - { - retval = kStatus_Fail; - } - } - - if (pdFALSE == xSemaphoreGive(handle->txSemaphore)) - { - /* We could not post the semaphore, exit with error */ - retval = kStatus_Fail; - } - - return retval; -} - -/*FUNCTION********************************************************************** - * - * Function Name : LPUART_RTOS_Receive - * Description : Receives chars from LPUART - * - *END**************************************************************************/ -/*! - * brief Receives data. - * - * This function receives data from LPUART. It is an synchronous API. If any data is immediately available - * it is returned immediately and the number of bytes received. - * - * param handle The RTOS LPUART handle. - * param buffer The pointer to buffer where to write received data. - * param length The number of bytes to receive. - * param received The pointer to a variable of size_t where the number of received data is filled. - */ -int LPUART_RTOS_Receive(lpuart_rtos_handle_t *handle, uint8_t *buffer, uint32_t length, size_t *received) -{ - EventBits_t ev; - size_t n = 0u; - int retval = kStatus_Fail; - uint32_t local_received = 0u; - status_t status; - const TickType_t rxTickTimeout = - (length * handle->rx_timeout_multiplier_ms + handle->rx_timeout_constant_ms) / portTICK_PERIOD_MS; - - if (NULL == handle->base) - { - /* Invalid handle. */ - return kStatus_Fail; - } - if (0u == length) - { - if (received != NULL) - { - *received = n; - } - return kStatus_Success; - } - if (NULL == buffer) - { - return kStatus_InvalidArgument; - } - - /* New transfer can be performed only after current one is finished */ - if (pdFALSE == xSemaphoreTake(handle->rxSemaphore, portMAX_DELAY)) - { - /* We could not take the semaphore, exit with 0 data received */ - return kStatus_Fail; - } - - handle->rxTransfer.data = buffer; - handle->rxTransfer.dataSize = (uint32_t)length; - - /* Non-blocking call */ - status = LPUART_TransferReceiveNonBlocking(handle->base, handle->t_state, &handle->rxTransfer, &n); - if (status != kStatus_Success) - { - (void)xSemaphoreGive(handle->rxSemaphore); - return kStatus_Fail; - } - - ev = xEventGroupWaitBits( - handle->rxEvent, - RTOS_LPUART_RX_COMPLETE | RTOS_LPUART_RING_BUFFER_OVERRUN | RTOS_LPUART_HARDWARE_BUFFER_OVERRUN, pdTRUE, - pdFALSE, (rxTickTimeout > 0u) ? rxTickTimeout : portMAX_DELAY); - if ((ev & RTOS_LPUART_HARDWARE_BUFFER_OVERRUN) != 0u) - { - /* Stop data transfer to application buffer, ring buffer is still active */ - LPUART_TransferAbortReceive(handle->base, handle->t_state); - /* Prevent false indication of successful transfer in next call of LPUART_RTOS_Receive. - RTOS_LPUART_COMPLETE flag could be set meanwhile overrun is handled */ - (void)xEventGroupClearBits(handle->rxEvent, RTOS_LPUART_RX_COMPLETE); - retval = kStatus_LPUART_RxHardwareOverrun; - local_received = 0u; - } - else if ((ev & RTOS_LPUART_RING_BUFFER_OVERRUN) != 0u) - { - /* Stop data transfer to application buffer, ring buffer is still active */ - LPUART_TransferAbortReceive(handle->base, handle->t_state); - /* Prevent false indication of successful transfer in next call of LPUART_RTOS_Receive. - RTOS_LPUART_COMPLETE flag could be set meanwhile overrun is handled */ - (void)xEventGroupClearBits(handle->rxEvent, RTOS_LPUART_RX_COMPLETE); - retval = kStatus_LPUART_RxRingBufferOverrun; - local_received = 0u; - } - else if ((ev & RTOS_LPUART_RX_COMPLETE) != 0u) - { - retval = kStatus_Success; - local_received = length; - } - else /* timeout expired or unknown error*/ - { - if (rxTickTimeout > 0u) - { - (void)LPUART_TransferGetReceiveCount(handle->base, handle->t_state, &local_received); - LPUART_TransferAbortReceive(handle->base, handle->t_state); - (void)xEventGroupClearBits(handle->rxEvent, RTOS_LPUART_RX_COMPLETE); - retval = kStatus_Timeout; - } - else - { - retval = kStatus_LPUART_Error; - local_received = 0u; - } - } - - /* Prevent repetitive NULL check */ - if (received != NULL) - { - *received = (size_t)local_received; - } - - /* Enable next transfer. Current one is finished */ - if (pdFALSE == xSemaphoreGive(handle->rxSemaphore)) - { - /* We could not post the semaphore, exit with error */ - retval = kStatus_Fail; - } - return retval; -} - -/*FUNCTION********************************************************************** - * - * Function Name : LPUART_RTOS_SetRxTimeout - * Description : Modify receive timeout value in alreaty initialized LPUART RTOS handle. - * - *END**************************************************************************/ -/*! - * brief Set RX timeout in runtime - * - * This function can modify RX timeout between initialization and receive. - * - * param handle The RTOS LPUART handle. - * param rx_timeout_constant_ms RX timeout applied per receive. - * param rx_timeout_multiplier_ms RX timeout added for each byte of the receive. - */ -int LPUART_RTOS_SetRxTimeout(lpuart_rtos_handle_t *handle, - uint32_t rx_timeout_constant_ms, - uint32_t rx_timeout_multiplier_ms) -{ - if (NULL == handle) - { - return kStatus_InvalidArgument; - } - handle->rx_timeout_constant_ms = rx_timeout_constant_ms; - handle->rx_timeout_multiplier_ms = rx_timeout_multiplier_ms; - return kStatus_Success; -} - -/*FUNCTION********************************************************************** - * - * Function Name : LPUART_RTOS_SetTxTimeout - * Description : Modify send timeout value in alreaty initialized LPUART RTOS handle. - * - *END**************************************************************************/ -/*! - * brief Set TX timeout in runtime - * - * This function can modify TX timeout between initialization and send. - * - * param handle The RTOS LPUART handle. - * param tx_timeout_constant_ms TX timeout applied per transmition. - * param tx_timeout_multiplier_ms TX timeout added for each byte of the transmition. - */ -int LPUART_RTOS_SetTxTimeout(lpuart_rtos_handle_t *handle, - uint32_t tx_timeout_constant_ms, - uint32_t tx_timeout_multiplier_ms) -{ - if (NULL == handle) - { - return kStatus_InvalidArgument; - } - handle->tx_timeout_constant_ms = tx_timeout_constant_ms; - handle->tx_timeout_multiplier_ms = tx_timeout_multiplier_ms; - return kStatus_Success; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpuart_freertos.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpuart_freertos.h deleted file mode 100644 index 57d453da165..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_lpuart_freertos.h +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_LPUART_FREERTOS_H__ -#define FSL_LPUART_FREERTOS_H__ - -#include "fsl_lpuart.h" -#include "FreeRTOS.h" -#include "event_groups.h" -#include "semphr.h" - -/*! - * @addtogroup lpuart_freertos_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief LPUART FreeRTOS driver version 2.0.0. */ -#define FSL_LPUART_FREERTOS_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) -/*@}*/ - -/*! @brief LPUART RTOS configuration structure. */ -typedef struct _lpuart_rtos_config -{ - LPUART_Type *base; /*!< UART base address */ - uint32_t srcclk; /*!< UART source clock in Hz*/ - uint32_t baudrate; /*!< Desired communication speed */ - lpuart_parity_mode_t parity; /*!< Parity setting */ - lpuart_stop_bit_count_t stopbits; /*!< Number of stop bits to use */ - uint8_t *buffer; /*!< Buffer for background reception */ - uint32_t buffer_size; /*!< Size of buffer for background reception */ - /* Zero in constant and multiplier is interpreted as infinit timeout. */ - uint32_t rx_timeout_constant_ms; /*!< RX timeout applied per receive */ - uint32_t rx_timeout_multiplier_ms; /*!< RX timeout added for each byte of the receive. */ - uint32_t tx_timeout_constant_ms; /*!< TX timeout applied per transmition */ - uint32_t tx_timeout_multiplier_ms; /*!< TX timeout added for each byte of the transmition. */ -#if defined(FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT) && FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT - bool enableRxRTS; /*!< RX RTS enable */ - bool enableTxCTS; /*!< TX CTS enable */ - lpuart_transmit_cts_source_t txCtsSource; /*!< TX CTS source */ - lpuart_transmit_cts_config_t txCtsConfig; /*!< TX CTS configure */ -#endif -} lpuart_rtos_config_t; - -/*! - * @cond RTOS_PRIVATE - * @name LPUART event flags - * - * This are only valid states for txEvent and rxEvent (lpuart_rtos_handle_t). - */ -/*@{*/ -/*! @brief Event flag - uart transmit complete. */ -#define RTOS_LPUART_TX_COMPLETE 0x1U -/*! @brief Event flag - uart receive complete. */ -#define RTOS_LPUART_RX_COMPLETE 0x2U -/*! @brief Event flag - ring buffer overrun. */ -#define RTOS_LPUART_RING_BUFFER_OVERRUN 0x4U -/*! @brief Event flag - hardware buffer overrun. */ -#define RTOS_LPUART_HARDWARE_BUFFER_OVERRUN 0x8U -/*@}*/ - -/*! @brief LPUART FreeRTOS transfer structure. */ -typedef struct _lpuart_rtos_handle -{ - LPUART_Type *base; /*!< UART base address */ - lpuart_transfer_t txTransfer; /*!< TX transfer structure */ - lpuart_transfer_t rxTransfer; /*!< RX transfer structure */ - SemaphoreHandle_t rxSemaphore; /*!< RX semaphore for resource sharing */ - SemaphoreHandle_t txSemaphore; /*!< TX semaphore for resource sharing */ - EventGroupHandle_t rxEvent; /*!< RX completion event */ - EventGroupHandle_t txEvent; /*!< TX completion event */ - uint32_t rx_timeout_constant_ms; /*!< RX Timeout applied per transfer */ - uint32_t rx_timeout_multiplier_ms; /*!< RX Timeout added for each byte of the transfer. */ - uint32_t tx_timeout_constant_ms; /*!< TX Timeout applied per transfer */ - uint32_t tx_timeout_multiplier_ms; /*!< TX Timeout added for each byte of the transfer. */ - void *t_state; /*!< Transactional state of the underlying driver */ -#if (configSUPPORT_STATIC_ALLOCATION == 1) - StaticSemaphore_t txSemaphoreBuffer; /*!< Statically allocated memory for txSemaphore */ - StaticSemaphore_t rxSemaphoreBuffer; /*!< Statically allocated memory for rxSemaphore */ - StaticEventGroup_t txEventBuffer; /*!< Statically allocated memory for txEvent */ - StaticEventGroup_t rxEventBuffer; /*!< Statically allocated memory for rxEvent */ -#endif -} lpuart_rtos_handle_t; -/*! \endcond */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name LPUART RTOS Operation - * @{ - */ - -/*! - * @brief Initializes an LPUART instance for operation in RTOS. - * - * @param handle The RTOS LPUART handle, the pointer to an allocated space for RTOS context. - * @param t_handle The pointer to an allocated space to store the transactional layer internal state. - * @param cfg The pointer to the parameters required to configure the LPUART after initialization. - * @return 0 succeed, others failed - */ -int LPUART_RTOS_Init(lpuart_rtos_handle_t *handle, lpuart_handle_t *t_handle, const lpuart_rtos_config_t *cfg); - -/*! - * @brief Deinitializes an LPUART instance for operation. - * - * This function deinitializes the LPUART module, sets all register value to the reset value, - * and releases the resources. - * - * @param handle The RTOS LPUART handle. - */ -int LPUART_RTOS_Deinit(lpuart_rtos_handle_t *handle); - -/*! - * @name LPUART transactional Operation - * @{ - */ - -/*! - * @brief Sends data in the background. - * - * This function sends data. It is an synchronous API. - * If the hardware buffer is full, the task is in the blocked state. - * - * @param handle The RTOS LPUART handle. - * @param buffer The pointer to buffer to send. - * @param length The number of bytes to send. - */ -int LPUART_RTOS_Send(lpuart_rtos_handle_t *handle, uint8_t *buffer, uint32_t length); - -/*! - * @brief Receives data. - * - * This function receives data from LPUART. It is an synchronous API. If any data is immediately available - * it is returned immediately and the number of bytes received. - * - * @param handle The RTOS LPUART handle. - * @param buffer The pointer to buffer where to write received data. - * @param length The number of bytes to receive. - * @param received The pointer to a variable of size_t where the number of received data is filled. - */ -int LPUART_RTOS_Receive(lpuart_rtos_handle_t *handle, uint8_t *buffer, uint32_t length, size_t *received); - -/*! - * @brief Set RX timeout in runtime - * - * This function can modify RX timeout between initialization and receive. - * - * param handle The RTOS LPUART handle. - * param rx_timeout_constant_ms RX timeout applied per receive. - * param rx_timeout_multiplier_ms RX timeout added for each byte of the receive. - */ -int LPUART_RTOS_SetRxTimeout(lpuart_rtos_handle_t *handle, - uint32_t rx_timeout_constant_ms, - uint32_t rx_timeout_multiplier_ms); - -/*! - * @brief Set TX timeout in runtime - * - * This function can modify TX timeout between initialization and send. - * - * param handle The RTOS LPUART handle. - * param tx_timeout_constant_ms TX timeout applied per transmition. - * param tx_timeout_multiplier_ms TX timeout added for each byte of the transmition. - */ -int LPUART_RTOS_SetTxTimeout(lpuart_rtos_handle_t *handle, - uint32_t tx_timeout_constant_ms, - uint32_t tx_timeout_multiplier_ms); - -/* @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_LPUART_FREERTOS_H__ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_mrt.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_mrt.c deleted file mode 100644 index 69697a21b5c..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_mrt.c +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2017, 2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_mrt.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.mrt" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Gets the instance from the base address - * - * @param base Multi-Rate timer peripheral base address - * - * @return The MRT instance - */ -static uint32_t MRT_GetInstance(MRT_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to MRT bases for each instance. */ -static MRT_Type *const s_mrtBases[] = MRT_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to MRT clocks for each instance. */ -static const clock_ip_name_t s_mrtClocks[] = MRT_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) -#if defined(MRT_RSTS_N) -/*! @brief Pointers to MRT resets for each instance, writing a zero asserts the reset */ -static const reset_ip_name_t s_mrtResets[] = MRT_RSTS_N; -#elif defined(MRT_RSTS) -/*! @brief Pointers to MRT resets for each instance, writing a one asserts the reset */ -static const reset_ip_name_t s_mrtResets[] = MRT_RSTS; -#endif -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t MRT_GetInstance(MRT_Type *base) -{ - uint32_t instance; - uint32_t mrtArrayCount = (sizeof(s_mrtBases) / sizeof(s_mrtBases[0])); - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < mrtArrayCount; instance++) - { - if (s_mrtBases[instance] == base) - { - break; - } - } - - assert(instance < mrtArrayCount); - - return instance; -} - -/*! - * brief Ungates the MRT clock and configures the peripheral for basic operation. - * - * note This API should be called at the beginning of the application using the MRT driver. - * - * param base Multi-Rate timer peripheral base address - * param config Pointer to user's MRT config structure. If MRT has MULTITASK bit field in - * MODCFG reigster, param config is useless. - */ -void MRT_Init(MRT_Type *base, const mrt_config_t *config) -{ - assert(config != NULL); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate the MRT clock */ - CLOCK_EnableClock(s_mrtClocks[MRT_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) -#if defined(MRT_RSTS_N) || defined(MRT_RSTS) - /* Reset the module. */ - RESET_PeripheralReset(s_mrtResets[MRT_GetInstance(base)]); -#endif -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ - -#if !(defined(FSL_FEATURE_MRT_HAS_NO_MODCFG_MULTITASK) && FSL_FEATURE_MRT_HAS_NO_MODCFG_MULTITASK) - /* Set timer operating mode */ - base->MODCFG = MRT_MODCFG_MULTITASK(config->enableMultiTask); -#endif -} - -/*! - * brief Gate the MRT clock - * - * param base Multi-Rate timer peripheral base address - */ -void MRT_Deinit(MRT_Type *base) -{ - /* Stop all the timers */ - MRT_StopTimer(base, kMRT_Channel_0); - MRT_StopTimer(base, kMRT_Channel_1); -#if (FSL_FEATURE_MRT_NUMBER_OF_CHANNELS > 2U) - MRT_StopTimer(base, kMRT_Channel_2); -#endif -#if (FSL_FEATURE_MRT_NUMBER_OF_CHANNELS > 3U) - MRT_StopTimer(base, kMRT_Channel_3); -#endif - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate the MRT clock*/ - CLOCK_DisableClock(s_mrtClocks[MRT_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Used to update the timer period in units of count. - * - * The new value will be immediately loaded or will be loaded at the end of the current time - * interval. For one-shot interrupt mode the new value will be immediately loaded. - * - * note User can call the utility macros provided in fsl_common.h to convert to ticks - * - * param base Multi-Rate timer peripheral base address - * param channel Timer channel number - * param count Timer period in units of ticks - * param immediateLoad true: Load the new value immediately into the TIMER register; - * false: Load the new value at the end of current timer interval - */ -void MRT_UpdateTimerPeriod(MRT_Type *base, mrt_chnl_t channel, uint32_t count, bool immediateLoad) -{ - assert((uint8_t)channel < (uint8_t)FSL_FEATURE_MRT_NUMBER_OF_CHANNELS); - - uint32_t newValue = count; - if (((base->CHANNEL[channel].CTRL & MRT_CHANNEL_CTRL_MODE_MASK) == (uint8_t)kMRT_OneShotMode) || (immediateLoad)) - { - /* For one-shot interrupt mode, load the new value immediately even if user forgot to enable */ - newValue |= MRT_CHANNEL_INTVAL_LOAD_MASK; - } - - /* Update the timer interval value */ - base->CHANNEL[channel].INTVAL = newValue; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_mrt.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_mrt.h deleted file mode 100644 index 3d398a0f938..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_mrt.h +++ /dev/null @@ -1,366 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2017, 2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_MRT_H_ -#define FSL_MRT_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup mrt - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -#define FSL_MRT_DRIVER_VERSION (MAKE_VERSION(2, 0, 3)) /*!< Version 2.0.3 */ -/*@}*/ - -/*! @brief List of MRT channels */ -typedef enum _mrt_chnl -{ - kMRT_Channel_0 = 0U, /*!< MRT channel number 0*/ - kMRT_Channel_1, /*!< MRT channel number 1 */ - kMRT_Channel_2, /*!< MRT channel number 2 */ - kMRT_Channel_3 /*!< MRT channel number 3 */ -} mrt_chnl_t; - -/*! @brief List of MRT timer modes */ -typedef enum _mrt_timer_mode -{ - kMRT_RepeatMode = (0 << MRT_CHANNEL_CTRL_MODE_SHIFT), /*!< Repeat Interrupt mode */ - kMRT_OneShotMode = (1 << MRT_CHANNEL_CTRL_MODE_SHIFT), /*!< One-shot Interrupt mode */ - kMRT_OneShotStallMode = (2 << MRT_CHANNEL_CTRL_MODE_SHIFT) /*!< One-shot stall mode */ -} mrt_timer_mode_t; - -/*! @brief List of MRT interrupts */ -typedef enum _mrt_interrupt_enable -{ - kMRT_TimerInterruptEnable = MRT_CHANNEL_CTRL_INTEN_MASK /*!< Timer interrupt enable*/ -} mrt_interrupt_enable_t; - -/*! @brief List of MRT status flags */ -typedef enum _mrt_status_flags -{ - kMRT_TimerInterruptFlag = MRT_CHANNEL_STAT_INTFLAG_MASK, /*!< Timer interrupt flag */ - kMRT_TimerRunFlag = MRT_CHANNEL_STAT_RUN_MASK, /*!< Indicates state of the timer */ -} mrt_status_flags_t; - -/*! - * @brief MRT configuration structure - * - * This structure holds the configuration settings for the MRT peripheral. To initialize this - * structure to reasonable defaults, call the MRT_GetDefaultConfig() function and pass a - * pointer to your config structure instance. - * - * The config struct can be made const so it resides in flash - */ -typedef struct _mrt_config -{ - bool enableMultiTask; /*!< true: Timers run in multi-task mode; false: Timers run in hardware status mode */ -} mrt_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Ungates the MRT clock and configures the peripheral for basic operation. - * - * @note This API should be called at the beginning of the application using the MRT driver. - * - * @param base Multi-Rate timer peripheral base address - * @param config Pointer to user's MRT config structure. If MRT has MULTITASK bit field in - * MODCFG reigster, param config is useless. - */ -void MRT_Init(MRT_Type *base, const mrt_config_t *config); - -/*! - * @brief Gate the MRT clock - * - * @param base Multi-Rate timer peripheral base address - */ -void MRT_Deinit(MRT_Type *base); - -/*! - * @brief Fill in the MRT config struct with the default settings - * - * The default values are: - * @code - * config->enableMultiTask = false; - * @endcode - * @param config Pointer to user's MRT config structure. - */ -static inline void MRT_GetDefaultConfig(mrt_config_t *config) -{ - assert(config != NULL); -#if !(defined(FSL_FEATURE_MRT_HAS_NO_MODCFG_MULTITASK) && FSL_FEATURE_MRT_HAS_NO_MODCFG_MULTITASK) - /* Use hardware status operating mode */ - config->enableMultiTask = false; -#endif -} - -/*! - * @brief Sets up an MRT channel mode. - * - * @param base Multi-Rate timer peripheral base address - * @param channel Channel that is being configured. - * @param mode Timer mode to use for the channel. - */ -static inline void MRT_SetupChannelMode(MRT_Type *base, mrt_chnl_t channel, const mrt_timer_mode_t mode) -{ - assert((uint8_t)channel < (uint8_t)FSL_FEATURE_MRT_NUMBER_OF_CHANNELS); - - uint32_t reg = base->CHANNEL[channel].CTRL; - - /* Clear old value */ - reg &= ~MRT_CHANNEL_CTRL_MODE_MASK; - /* Add the new mode */ - reg |= (uint32_t)mode; - - base->CHANNEL[channel].CTRL = reg; -} - -/*! @}*/ - -/*! - * @name Interrupt Interface - * @{ - */ - -/*! - * @brief Enables the MRT interrupt. - * - * @param base Multi-Rate timer peripheral base address - * @param channel Timer channel number - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::mrt_interrupt_enable_t - */ -static inline void MRT_EnableInterrupts(MRT_Type *base, mrt_chnl_t channel, uint32_t mask) -{ - assert((uint8_t)channel < (uint8_t)FSL_FEATURE_MRT_NUMBER_OF_CHANNELS); - base->CHANNEL[channel].CTRL |= mask; -} - -/*! - * @brief Disables the selected MRT interrupt. - * - * @param base Multi-Rate timer peripheral base address - * @param channel Timer channel number - * @param mask The interrupts to disable. This is a logical OR of members of the - * enumeration ::mrt_interrupt_enable_t - */ -static inline void MRT_DisableInterrupts(MRT_Type *base, mrt_chnl_t channel, uint32_t mask) -{ - assert((uint8_t)channel < (uint8_t)FSL_FEATURE_MRT_NUMBER_OF_CHANNELS); - base->CHANNEL[channel].CTRL &= ~mask; -} - -/*! - * @brief Gets the enabled MRT interrupts. - * - * @param base Multi-Rate timer peripheral base address - * @param channel Timer channel number - * - * @return The enabled interrupts. This is the logical OR of members of the - * enumeration ::mrt_interrupt_enable_t - */ -static inline uint32_t MRT_GetEnabledInterrupts(MRT_Type *base, mrt_chnl_t channel) -{ - assert((uint8_t)channel < (uint8_t)FSL_FEATURE_MRT_NUMBER_OF_CHANNELS); - return (base->CHANNEL[channel].CTRL & MRT_CHANNEL_CTRL_INTEN_MASK); -} - -/*! @}*/ - -/*! - * @name Status Interface - * @{ - */ - -/*! - * @brief Gets the MRT status flags - * - * @param base Multi-Rate timer peripheral base address - * @param channel Timer channel number - * - * @return The status flags. This is the logical OR of members of the - * enumeration ::mrt_status_flags_t - */ -static inline uint32_t MRT_GetStatusFlags(MRT_Type *base, mrt_chnl_t channel) -{ - assert((uint8_t)channel < (uint8_t)FSL_FEATURE_MRT_NUMBER_OF_CHANNELS); - return (base->CHANNEL[channel].STAT & (MRT_CHANNEL_STAT_INTFLAG_MASK | MRT_CHANNEL_STAT_RUN_MASK)); -} - -/*! - * @brief Clears the MRT status flags. - * - * @param base Multi-Rate timer peripheral base address - * @param channel Timer channel number - * @param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::mrt_status_flags_t - */ -static inline void MRT_ClearStatusFlags(MRT_Type *base, mrt_chnl_t channel, uint32_t mask) -{ - assert((uint8_t)channel < (uint8_t)FSL_FEATURE_MRT_NUMBER_OF_CHANNELS); - base->CHANNEL[channel].STAT = (mask & MRT_CHANNEL_STAT_INTFLAG_MASK); -} - -/*! @}*/ - -/*! - * @name Read and Write the timer period - * @{ - */ - -/*! - * @brief Used to update the timer period in units of count. - * - * The new value will be immediately loaded or will be loaded at the end of the current time - * interval. For one-shot interrupt mode the new value will be immediately loaded. - * - * @note User can call the utility macros provided in fsl_common.h to convert to ticks - * - * @param base Multi-Rate timer peripheral base address - * @param channel Timer channel number - * @param count Timer period in units of ticks - * @param immediateLoad true: Load the new value immediately into the TIMER register; - * false: Load the new value at the end of current timer interval - */ -void MRT_UpdateTimerPeriod(MRT_Type *base, mrt_chnl_t channel, uint32_t count, bool immediateLoad); - -/*! - * @brief Reads the current timer counting value. - * - * This function returns the real-time timer counting value, in a range from 0 to a - * timer period. - * - * @note User can call the utility macros provided in fsl_common.h to convert ticks to usec or msec - * - * @param base Multi-Rate timer peripheral base address - * @param channel Timer channel number - * - * @return Current timer counting value in ticks - */ -static inline uint32_t MRT_GetCurrentTimerCount(MRT_Type *base, mrt_chnl_t channel) -{ - assert((uint8_t)channel < (uint8_t)FSL_FEATURE_MRT_NUMBER_OF_CHANNELS); - return base->CHANNEL[channel].TIMER; -} - -/*! @}*/ - -/*! - * @name Timer Start and Stop - * @{ - */ - -/*! - * @brief Starts the timer counting. - * - * After calling this function, timers load period value, counts down to 0 and - * depending on the timer mode it will either load the respective start value again or stop. - * - * @note User can call the utility macros provided in fsl_common.h to convert to ticks - * - * @param base Multi-Rate timer peripheral base address - * @param channel Timer channel number. - * @param count Timer period in units of ticks. Count can contain the LOAD bit, which control the force load feature. - */ -static inline void MRT_StartTimer(MRT_Type *base, mrt_chnl_t channel, uint32_t count) -{ - assert((uint8_t)channel < (uint8_t)FSL_FEATURE_MRT_NUMBER_OF_CHANNELS); - assert((uint32_t)(count & ~MRT_CHANNEL_INTVAL_LOAD_MASK) <= (uint32_t)MRT_CHANNEL_INTVAL_IVALUE_MASK); - /* Write the timer interval value */ - base->CHANNEL[channel].INTVAL = count; -} - -/*! - * @brief Stops the timer counting. - * - * This function stops the timer from counting. - * - * @param base Multi-Rate timer peripheral base address - * @param channel Timer channel number. - */ -static inline void MRT_StopTimer(MRT_Type *base, mrt_chnl_t channel) -{ - assert((uint8_t)channel < (uint8_t)FSL_FEATURE_MRT_NUMBER_OF_CHANNELS); - /* Stop the timer immediately */ - base->CHANNEL[channel].INTVAL = MRT_CHANNEL_INTVAL_LOAD_MASK; -} - -/*! @}*/ - -/*! - * @name Get & release channel - * @{ - */ - -/*! - * @brief Find the available channel. - * - * This function returns the lowest available channel number. - * - * @param base Multi-Rate timer peripheral base address - */ -static inline uint32_t MRT_GetIdleChannel(MRT_Type *base) -{ - return base->IDLE_CH; -} - -#if !(defined(FSL_FEATURE_MRT_HAS_NO_CHANNEL_STAT_INUSE) && FSL_FEATURE_MRT_HAS_NO_CHANNEL_STAT_INUSE) -/*! - * @brief Release the channel when the timer is using the multi-task mode. - * - * In multi-task mode, the INUSE flags allow more control over when MRT channels are released for - * further use. The user can hold on to a channel acquired by calling MRT_GetIdleChannel() for as - * long as it is needed and release it by calling this function. This removes the need to ask for - * an available channel for every use. - * - * @param base Multi-Rate timer peripheral base address - * @param channel Timer channel number. - */ -static inline void MRT_ReleaseChannel(MRT_Type *base, mrt_chnl_t channel) -{ - assert((uint8_t)channel < (uint8_t)FSL_FEATURE_MRT_NUMBER_OF_CHANNELS); - - uint32_t reg = base->CHANNEL[channel].STAT; - - /* Clear flag bits to prevent accidentally clearing anything when writing back */ - reg = ~MRT_CHANNEL_STAT_INTFLAG_MASK; - reg |= MRT_CHANNEL_STAT_INUSE_MASK; - - base->CHANNEL[channel].STAT = reg; -} -#endif - -/*! @}*/ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_MRT_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_ostimer.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_ostimer.c deleted file mode 100644 index 4f1de1cc59e..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_ostimer.c +++ /dev/null @@ -1,394 +0,0 @@ -/* - * Copyright 2018-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_ostimer.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.ostimer" -#endif - -#if defined(OSTIMER_RSTS) -#define OSTIMER_RESETS_ARRAY OSTIMER_RSTS -#endif - -/* Typedef for interrupt handler. */ -typedef void (*ostimer_isr_t)(OSTIMER_Type *base, ostimer_callback_t cb); - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Gets the instance from the base address - * - * @param base OSTIMER peripheral base address - * - * @return The OSTIMER instance - */ -static uint32_t OSTIMER_GetInstance(OSTIMER_Type *base); - -#if (defined(FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) && FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) -/* @brief Translate the value from gray-code to decimal by the Code Gray in SYSCTL. - * - * @param gray The gray value input. - * - * @return the decimal value. - */ -static uint64_t OSTIMER_GrayToDecimalbyCodeGray(uint64_t gray); -#endif /* FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY. */ - -/******************************************************************************* - * Variables - ******************************************************************************/ -/* Array of OSTIMER handle. */ -static ostimer_callback_t s_ostimerHandle[FSL_FEATURE_SOC_OSTIMER_COUNT]; -/* Array of OSTIMER peripheral base address. */ -static OSTIMER_Type *const s_ostimerBases[] = OSTIMER_BASE_PTRS; -/* Array of OSTIMER IRQ number. */ -static const IRQn_Type s_ostimerIRQ[] = OSTIMER_IRQS; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/* Array of OSTIMER clock name. */ -static const clock_ip_name_t s_ostimerClock[] = OSTIMER_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/* OSTIMER ISR for transactional APIs. */ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -static ostimer_isr_t s_ostimerIsr = (ostimer_isr_t)DefaultISR; -#else -static ostimer_isr_t s_ostimerIsr; -#endif - -#if defined(OSTIMER_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_ostimerResets[] = OSTIMER_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ - -/* @brief Function for getting the instance number of OS timer. */ -static uint32_t OSTIMER_GetInstance(OSTIMER_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_ostimerBases); instance++) - { - if (s_ostimerBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_ostimerBases)); - - return instance; -} - -#if (defined(FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) && FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) -/* @brief Translate the value from gray-code to decimal by the Code Gray in SYSCTL. - * - * @param gray The gray value input. - * - * @return the decimal value. - */ -static uint64_t OSTIMER_GrayToDecimalbyCodeGray(uint64_t gray) -{ - uint64_t decOut; - - SYSCTL->CODE_GRAY_LSB = (uint32_t)(gray & 0xFFFFFFFFU); - SYSCTL->CODE_GRAY_MSB = (uint32_t)((gray >> 32U) & 0x3FFU); /* limit to 42bits as OSevent timer*/ - __NOP(); - decOut = ((uint64_t)(SYSCTL->CODE_BIN_MSB) & 0x3FFU) << 32U; - decOut |= (uint64_t)(SYSCTL->CODE_BIN_LSB); - - return decOut; -} -#endif /* FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY. */ - -/* @brief Translate the value from gray-code to decimal. */ -/* - * @param gray The gray value input. - * - * @return the decimal value. - */ -uint64_t OSTIMER_GrayToDecimal(uint64_t gray) -{ -#if (defined(FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) && FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) - return OSTIMER_GrayToDecimalbyCodeGray(gray); -#else - uint64_t temp = gray; - while (temp != 0U) - { - temp >>= 1U; - gray ^= temp; - } - - return gray; -#endif /* FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY. */ -} - -/* @brief Enable the OSTIMER interrupt. - * - * After calling this function, the OSTIMER driver will enable/disable the IRQ and module interrupt enablement. - * - * @param base OSTIMER peripheral base address. - * @param enable enable/disable the IRQ and module interrupt enablement. - * - true: Disable the IRQ and module interrupt enablement. - * - false: Disable the IRQ and module interrupt enablement. - * @return none - */ -static void OSTIMER_EnableInterrupt(OSTIMER_Type *base, bool enable) -{ - assert(NULL != base); - - if (enable) - { - /* Enable the IRQ and module interrupt enablement. */ - (void)EnableIRQ(s_ostimerIRQ[OSTIMER_GetInstance(base)]); - base->OSEVENT_CTRL |= OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_MASK; - } - else - { - /* Clear interrupt flag, disable the IRQ and module interrupt enablement. */ - (void)DisableIRQ(s_ostimerIRQ[OSTIMER_GetInstance(base)]); - base->OSEVENT_CTRL &= ~OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_MASK; /* Clear interrupt flag by writing 1. */ - } -} - -/*! - * @brief Initializes an OSTIMER by turning it's clock on. - * - */ -void OSTIMER_Init(OSTIMER_Type *base) -{ - assert(NULL != base); - - uint32_t instance = OSTIMER_GetInstance(base); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#if !(defined(FSL_FEATURE_PMC_HAS_NO_OSTIMER_REG) && FSL_FEATURE_PMC_HAS_NO_OSTIMER_REG) - /* Enable the OSTIMER 32k clock in PMC module. */ - CLOCK_EnableOstimer32kClock(); -#endif - /* Enable clock for OSTIMER. */ - CLOCK_EnableClock(s_ostimerClock[instance]); -#if (defined(FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) && FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) - CLOCK_EnableClock(kCLOCK_Sysctl); -#endif /* FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY. */ -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(OSTIMER_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_ostimerResets[OSTIMER_GetInstance(base)]); -#endif -} - -/*! - * @brief Deinitializes a OSTIMER instance. - * - * This function shuts down OSTIMER clock - * - * @param base OSTIMER peripheral base address. - */ -void OSTIMER_Deinit(OSTIMER_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable clock for OSTIMER. */ - CLOCK_DisableClock(s_ostimerClock[OSTIMER_GetInstance(base)]); -#if (defined(FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) && FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) - CLOCK_DisableClock(kCLOCK_Sysctl); -#endif /* FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY. */ -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * @brief Get OSTIMER status Flags. - * - * This returns the status flag. - * Currently, only match interrupt flag can be got. - * - * @param base OSTIMER peripheral base address. - * @return status register value - */ -uint32_t OSTIMER_GetStatusFlags(OSTIMER_Type *base) -{ - return base->OSEVENT_CTRL & OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG_MASK; -} - -/*! - * @brief Clear Status Interrupt Flags. - * - * This clears intr status flag. - * Currently, only match interrupt flag can be cleared. - * - * @param base OSTIMER peripheral base address. - * @param mask Clear bit mask. - * @return none - */ -void OSTIMER_ClearStatusFlags(OSTIMER_Type *base, uint32_t mask) -{ - base->OSEVENT_CTRL |= mask; -} - -/*! - * @brief Set the match raw value for OSTIMER. - * - * This function will set a match value for OSTIMER with an optional callback. And this callback - * will be called while the data in dedicated pair match register is equals to the value of central EVTIMER. - * Please note that, the data format is gray-code, if decimal data was desired, please using OSTIMER_SetMatchValue(). - * - * @param base OSTIMER peripheral base address. - * @param count OSTIMER timer match value.(Value is gray-code format) - * - * @param cb OSTIMER callback (can be left as NULL if none, otherwise should be a void func(void)). - * @retval kStatus_Success - Set match raw value and enable interrupt Successfully. - * @retval kStatus_Fail - Set match raw value fail. - */ -status_t OSTIMER_SetMatchRawValue(OSTIMER_Type *base, uint64_t count, ostimer_callback_t cb) -{ -#ifdef OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK - uint64_t decValueTimer; -#endif - status_t status; - uint64_t tmp = count; - uint32_t instance = OSTIMER_GetInstance(base); - - /* Clear interrupt flag, disable the IRQ and module interrupt enablement. */ - OSTIMER_EnableInterrupt(base, false); - - s_ostimerIsr = OSTIMER_HandleIRQ; - s_ostimerHandle[instance] = cb; - - /* Set the match value. */ - base->MATCH_L = (uint32_t)tmp; - base->MATCH_H = (uint32_t)(tmp >> 32U); - -#ifdef OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK - /* Workaround-2019-12-30: - * Since OSTimer's counter register is Gray-encoded, it would cost more time to write register. When EVTimer Match - * Write Ready bit is low, which means the previous match value has been updated successfully by that time, it is - * safe to reload (write) the Match Registers. Even if there is the RM comment that "In typical applications, it - * should not be necessary to test this bit", but we found the interruption would not be reported when the delta - * timer user added is smaller(IE: RT595 11us in 1MHz typical application) in release version." To prevent such - * issue from happening, we'd better wait for the match value to update successfully before enabling IRQ. - */ - while (0U != (base->OSEVENT_CTRL & OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK)) - { - } - - /* After the WR_RDY bit became low, we need to check whether current time goes ahead of the match value we set. - * (1) If current timer value has gone ahead of the match value, the interrupt will not be reported before 64-bit - * timer value over flow. We need to check whether the interrupt flag has been set or not: if yes, we will enable - * interrupt and return success; if not, we will return fail directly. - * (2) If current timer value has not gone ahead of match value, we will enable interrupt and return success. - */ - decValueTimer = OSTIMER_GetCurrentTimerValue(base); - if ((decValueTimer >= OSTIMER_GrayToDecimal(tmp)) && - (0U == (base->OSEVENT_CTRL & (uint32_t)kOSTIMER_MatchInterruptFlag))) - { - status = kStatus_Fail; - } - else -#endif /* #ifdef OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK */ - { - /* Enable the module interrupt enablement. */ - OSTIMER_EnableInterrupt(base, true); - status = kStatus_Success; - } - - return status; -} - -/*! - * @brief Set the match value for OSTIMER. - * - * This function will set a match value for OSTIMER with an optional callback. And this callback - * will be called while the data in dedicated pair match register is equals to the value of central EVTIMER. - * - * @param base OSTIMER peripheral base address. - * @param count OSTIMER timer match value.(Value is decimal format, and this value will be translate to Gray code in - * API. ) - * @param cb OSTIMER callback (can be left as NULL if none, otherwise should be a void func(void)). - * @retval kStatus_Success - Set match value and enable interrupt Successfully. - * @retval kStatus_Fail - Set match value fail. - */ -status_t OSTIMER_SetMatchValue(OSTIMER_Type *base, uint64_t count, ostimer_callback_t cb) -{ - uint64_t tmp = OSTIMER_DecimalToGray(count); - - return OSTIMER_SetMatchRawValue(base, tmp, cb); -} - -/*! - * @brief Get current timer count value from OSTIMER. - * - * This function will get a decimal timer count value. - * The RAW value of timer count is gray code format, will be translated to decimal data internally. - * - * @param base OSTIMER peripheral base address. - * @return Value of OSTIMER which will formated to decimal value. - */ -uint64_t OSTIMER_GetCurrentTimerValue(OSTIMER_Type *base) -{ - uint64_t tmp = 0U; - - tmp = OSTIMER_GetCurrentTimerRawValue(base); - - return OSTIMER_GrayToDecimal(tmp); -} - -/*! - * @brief Get the capture value from OSTIMER. - * - * This function will get a capture decimal-value from OSTIMER. - * The RAW value of timer capture is gray code format, will be translated to decimal data internally. - * - * @param base OSTIMER peripheral base address. - * @return Value of capture register, data format is decimal. - */ -uint64_t OSTIMER_GetCaptureValue(OSTIMER_Type *base) -{ - uint64_t tmp = 0U; - - tmp = OSTIMER_GetCaptureRawValue(base); - - return OSTIMER_GrayToDecimal(tmp); -} - -void OSTIMER_HandleIRQ(OSTIMER_Type *base, ostimer_callback_t cb) -{ - /* Clear interrupt flag, disable the IRQ and module interrupt enablement. */ - OSTIMER_EnableInterrupt(base, false); - - if (cb != NULL) - { - cb(); - } -} - -#if defined(OSTIMER0) -void OS_EVENT_DriverIRQHandler(void); -void OS_EVENT_DriverIRQHandler(void) -{ - s_ostimerIsr(OSTIMER0, s_ostimerHandle[0]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(OSTIMER) -void OS_EVENT_DriverIRQHandler(void); -void OS_EVENT_DriverIRQHandler(void) -{ - s_ostimerIsr(OSTIMER, s_ostimerHandle[0]); - SDK_ISR_EXIT_BARRIER; -} -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_ostimer.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_ostimer.h deleted file mode 100644 index 0cd991ef442..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_ostimer.h +++ /dev/null @@ -1,273 +0,0 @@ -/* - * Copyright 2018-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_OSTIMER_H_ -#define FSL_OSTIMER_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup ostimer - * @{ - */ - -/*! @file*/ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief OSTIMER driver version. */ -#define FSL_OSTIMER_DRIVER_VERSION (MAKE_VERSION(2, 2, 1)) -/*@}*/ - -/*! - * @brief OSTIMER status flags. - */ -enum _ostimer_flags -{ - kOSTIMER_MatchInterruptFlag = (OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG_MASK), /*!< Match interrupt flag bit, sets if - the match value was reached. */ -}; - -/*! @brief ostimer callback function. */ -typedef void (*ostimer_callback_t)(void); - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* _cplusplus */ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Initializes an OSTIMER by turning its bus clock on - * - */ -void OSTIMER_Init(OSTIMER_Type *base); - -/*! - * @brief Deinitializes a OSTIMER instance. - * - * This function shuts down OSTIMER bus clock - * - * @param base OSTIMER peripheral base address. - */ -void OSTIMER_Deinit(OSTIMER_Type *base); - -/*! - * @brief Translate the value from gray-code to decimal. - * - * @param gray The gray value input. - * @return The decimal value. - */ -uint64_t OSTIMER_GrayToDecimal(uint64_t gray); - -/*! - * @brief Translate the value from decimal to gray-code. - * - * @param dec The decimal value. - * @return The gray code of the input value. - */ -static inline uint64_t OSTIMER_DecimalToGray(uint64_t dec) -{ - return (dec ^ (dec >> 1U)); -} - -/*! - * @brief Get OSTIMER status Flags. - * - * This returns the status flag. - * Currently, only match interrupt flag can be got. - * - * @param base OSTIMER peripheral base address. - * @return status register value - */ -uint32_t OSTIMER_GetStatusFlags(OSTIMER_Type *base); - -/*! - * @brief Clear Status Interrupt Flags. - * - * This clears intrrupt status flag. - * Currently, only match interrupt flag can be cleared. - * - * @param base OSTIMER peripheral base address. - * @param mask Clear bit mask. - * @return none - */ -void OSTIMER_ClearStatusFlags(OSTIMER_Type *base, uint32_t mask); - -/*! - * @brief Set the match raw value for OSTIMER. - * - * This function will set a match value for OSTIMER with an optional callback. And this callback - * will be called while the data in dedicated pair match register is equals to the value of central EVTIMER. - * Please note that, the data format is gray-code, if decimal data was desired, please using OSTIMER_SetMatchValue(). - * - * @param base OSTIMER peripheral base address. - * @param count OSTIMER timer match value.(Value is gray-code format) - * - * @param cb OSTIMER callback (can be left as NULL if none, otherwise should be a void func(void)). - * @retval kStatus_Success - Set match raw value and enable interrupt Successfully. - * @retval kStatus_Fail - Set match raw value fail. - */ -status_t OSTIMER_SetMatchRawValue(OSTIMER_Type *base, uint64_t count, ostimer_callback_t cb); - -/*! - * @brief Set the match value for OSTIMER. - * - * This function will set a match value for OSTIMER with an optional callback. And this callback - * will be called while the data in dedicated pair match register is equals to the value of central OS TIMER. - * - * @param base OSTIMER peripheral base address. - * @param count OSTIMER timer match value.(Value is decimal format, and this value will be translate to Gray code - * internally.) - * - * @param cb OSTIMER callback (can be left as NULL if none, otherwise should be a void func(void)). - * @retval kStatus_Success - Set match value and enable interrupt Successfully. - * @retval kStatus_Fail - Set match value fail. - */ -status_t OSTIMER_SetMatchValue(OSTIMER_Type *base, uint64_t count, ostimer_callback_t cb); - -/*! - * @brief Set value to OSTIMER MATCH register directly. - * - * This function writes the input value to OSTIMER MATCH register directly, - * it does not touch any other registers. Note that, the data format is - * gray-code. The function @ref OSTIMER_DecimalToGray could convert decimal - * value to gray code. - * - * @param base OSTIMER peripheral base address. - * @param count OSTIMER timer match value (Value is gray-code format). - */ -static inline void OSTIMER_SetMatchRegister(OSTIMER_Type *base, uint64_t value) -{ -#ifdef OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK - /* Wait for MATCH register ready for write. */ - while (0U != (base->OSEVENT_CTRL & OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK)) - { - } -#endif - - base->MATCH_L = (uint32_t)value; - base->MATCH_H = (uint32_t)(value >> 32U); -} - -/*! - * @brief Enable the OSTIMER counter match interrupt. - * - * Enable the timer counter match interrupt. The interrupt happens when OSTIMER - * counter matches the value in MATCH registers. - * - * @param base OSTIMER peripheral base address. - */ -static inline void OSTIMER_EnableMatchInterrupt(OSTIMER_Type *base) -{ - base->OSEVENT_CTRL |= OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_MASK; -} - -/*! - * @brief Disable the OSTIMER counter match interrupt. - * - * Disable the timer counter match interrupt. The interrupt happens when OSTIMER - * counter matches the value in MATCH registers. - * - * @param base OSTIMER peripheral base address. - */ -static inline void OSTIMER_DisableMatchInterrupt(OSTIMER_Type *base) -{ - base->OSEVENT_CTRL &= ~OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_MASK; -} - -/*! - * @brief Get current timer raw count value from OSTIMER. - * - * This function will get a gray code type timer count value from OS timer register. - * The raw value of timer count is gray code format. - * - * @param base OSTIMER peripheral base address. - * @return Raw value of OSTIMER, gray code format. - */ -static inline uint64_t OSTIMER_GetCurrentTimerRawValue(OSTIMER_Type *base) -{ - uint64_t tmp = 0U; - - tmp = base->EVTIMERL; - tmp |= (uint64_t)(base->EVTIMERH) << 32U; - - return tmp; -} - -/*! - * @brief Get current timer count value from OSTIMER. - * - * This function will get a decimal timer count value. - * The RAW value of timer count is gray code format, will be translated to decimal data internally. - * - * @param base OSTIMER peripheral base address. - * @return Value of OSTIMER which will be formated to decimal value. - */ -uint64_t OSTIMER_GetCurrentTimerValue(OSTIMER_Type *base); - -/*! - * @brief Get the capture value from OSTIMER. - * - * This function will get a captured gray-code value from OSTIMER. - * The Raw value of timer capture is gray code format. - * - * @param base OSTIMER peripheral base address. - * @return Raw value of capture register, data format is gray code. - */ -static inline uint64_t OSTIMER_GetCaptureRawValue(OSTIMER_Type *base) -{ - uint64_t tmp = 0U; - - tmp = base->CAPTURE_L; - tmp |= (uint64_t)(base->CAPTURE_H) << 32U; - - return tmp; -} - -/*! - * @brief Get the capture value from OSTIMER. - * - * This function will get a capture decimal-value from OSTIMER. - * The RAW value of timer capture is gray code format, will be translated to decimal data internally. - * - * @param base OSTIMER peripheral base address. - * @return Value of capture register, data format is decimal. - */ -uint64_t OSTIMER_GetCaptureValue(OSTIMER_Type *base); - -/*! - * @brief OS timer interrupt Service Handler. - * - * This function handles the interrupt and refers to the callback array in the driver to callback user (as per request - * in OSTIMER_SetMatchValue()). - * if no user callback is scheduled, the interrupt will simply be cleared. - * - * @param base OS timer peripheral base address. - * @param cb callback scheduled for this instance of OS timer - * @return none - */ -void OSTIMER_HandleIRQ(OSTIMER_Type *base, ostimer_callback_t cb); -/* @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_OSTIMER_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_pdm.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_pdm.c deleted file mode 100644 index 2132ed2a1d5..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_pdm.c +++ /dev/null @@ -1,969 +0,0 @@ -/* - * Copyright (c) 2018, Freescale Semiconductor, Inc. - * Copyright 2019-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_pdm.h" -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.pdm" -#endif - -/******************************************************************************* - * Definitations - ******************************************************************************/ -/*! @brief Typedef for pdm rx interrupt handler. */ -typedef void (*pdm_isr_t)(PDM_Type *base, pdm_handle_t *pdmHandle); -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#if !(defined FSL_FEATURE_PDM_HAS_NO_MINIMUM_CLKDIV && FSL_FEATURE_PDM_HAS_NO_MINIMUM_CLKDIV) -/*! - * @brief Get the instance number for PDM. - * - * @param channelMask enabled channel. - * @param qualitymode selected quality mode. - * @param osr oversample rate. - * @param regdiv register divider. - */ -static status_t PDM_ValidateSrcClockRate(uint32_t channelMask, - pdm_df_quality_mode_t qualityMode, - uint8_t osr, - uint32_t regDiv); -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ -/* Base pointer array */ -static PDM_Type *const s_pdmBases[] = PDM_BASE_PTRS; -/*!@brief PDM handle pointer */ -static pdm_handle_t *s_pdmHandle[ARRAY_SIZE(s_pdmBases)]; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/* Clock name array */ -static const clock_ip_name_t s_pdmClock[] = PDM_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#if defined(FSL_PDM_HAS_FILTER_CLOCK_GATE) && FSL_PDM_HAS_FILTER_CLOCK_GATE -/* Clock name array */ -static const clock_ip_name_t s_pdmFilterClock[] = PDM_FILTER_CLOCKS; -#endif -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/*! @brief Pointer to tx IRQ handler for each instance. */ -static pdm_isr_t s_pdmIsr; -#if !(defined(FSL_FEATURE_PDM_HAS_NO_HWVAD) && FSL_FEATURE_PDM_HAS_NO_HWVAD) -/*! @brief callback for hwvad. */ -static pdm_hwvad_notification_t s_pdm_hwvad_notification[ARRAY_SIZE(s_pdmBases)]; -#endif -/******************************************************************************* - * Code - ******************************************************************************/ -uint32_t PDM_GetInstance(PDM_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_pdmBases); instance++) - { - if (s_pdmBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_pdmBases)); - - return instance; -} - -/*! - * brief PDM read fifo. - * Note: This function support 16 bit only for IP version that only supports 16bit. - * - * param base PDM base pointer. - * param startChannel start channel number. - * param channelNums total enabled channelnums. - * param buffer received buffer address. - * param size number of samples to read. - * param dataWidth sample width. - */ -void PDM_ReadFifo( - PDM_Type *base, uint32_t startChannel, uint32_t channelNums, void *buffer, size_t size, uint32_t dataWidth) -{ - uint32_t i = 0, j = 0U; - uint32_t *dataAddr = (uint32_t *)buffer; - - for (i = 0U; i < size; i++) - { - for (j = 0; j < channelNums; j++) - { -#if defined(FSL_FEATURE_PDM_FIFO_WIDTH) && (FSL_FEATURE_PDM_FIFO_WIDTH != 2U) - *dataAddr = base->DATACH[startChannel + j] >> (dataWidth == 4U ? 0U : 8U); - dataAddr = (uint32_t *)((uint32_t)dataAddr + dataWidth); -#else - *dataAddr = base->DATACH[startChannel + j]; - dataAddr = (uint32_t *)((uint32_t)dataAddr + 2U); -#endif - } - } -} - -#if defined(FSL_FEATURE_PDM_FIFO_WIDTH) && (FSL_FEATURE_PDM_FIFO_WIDTH == 2U) -/*! - * brief PDM read data non blocking, only support 16bit data read. - * So the actually read data byte size in this function is (size * 2 * channelNums). - * param base PDM base pointer. - * param startChannel start channel number. - * param channelNums total enabled channelnums. - * param buffer received buffer address. - * param size number of 16bit data to read. - */ -void PDM_ReadNonBlocking(PDM_Type *base, uint32_t startChannel, uint32_t channelNums, int16_t *buffer, size_t size) -{ - uint32_t i = 0, j = 0U; - - for (i = 0U; i < size; i++) - { - for (j = 0; j < channelNums; j++) - { - *buffer++ = (int16_t)base->DATACH[startChannel + j]; - } - } -} -#endif - -#if !(defined FSL_FEATURE_PDM_HAS_NO_MINIMUM_CLKDIV && FSL_FEATURE_PDM_HAS_NO_MINIMUM_CLKDIV) -static status_t PDM_ValidateSrcClockRate(uint32_t channelMask, - pdm_df_quality_mode_t qualityMode, - uint8_t osr, - uint32_t regDiv) -{ - uint32_t enabledChannel = 0U, i = 0U, factor = 0U, k = 0U; - - for (i = 0U; i < (uint32_t)FSL_FEATURE_PDM_CHANNEL_NUM; i++) - { - if (((channelMask >> i) & 0x01U) != 0U) - { - enabledChannel++; - } - } - - switch (qualityMode) - { - case kPDM_QualityModeMedium: - factor = FSL_FEATURE_PDM_HIGH_QUALITY_CLKDIV_FACTOR; - k = 2U; - break; - - case kPDM_QualityModeHigh: - factor = FSL_FEATURE_PDM_HIGH_QUALITY_CLKDIV_FACTOR; - k = 1U; - break; - - case kPDM_QualityModeLow: - factor = FSL_FEATURE_PDM_HIGH_QUALITY_CLKDIV_FACTOR; - k = 4U; - break; - - case kPDM_QualityModeVeryLow0: - factor = FSL_FEATURE_PDM_VERY_LOW_QUALITY_CLKDIV_FACTOR; - k = 2U; - break; - - case kPDM_QualityModeVeryLow1: - factor = FSL_FEATURE_PDM_VERY_LOW_QUALITY_CLKDIV_FACTOR; - k = 4U; - break; - - case kPDM_QualityModeVeryLow2: - factor = FSL_FEATURE_PDM_VERY_LOW_QUALITY_CLKDIV_FACTOR; - k = 8U; - break; - - default: - assert(false); - break; - } - - /* validate the minimum clock divider */ - /* 2U is for canculating k, 100U is for determing the specific float number of clock divider */ - if (((regDiv * k) / 2U * 100U) < (((10U + factor * enabledChannel) * 100U / (8U * osr)) * k / 2U)) - { - return kStatus_Fail; - } - - return kStatus_Success; -} -#endif - -/*! - * brief PDM set sample rate. - * - * note This function is depend on the configuration of the PDM and PDM channel, so the correct call sequence is - * code - * PDM_Init(base, pdmConfig) - * PDM_SetChannelConfig(base, channel, &channelConfig) - * PDM_SetSampleRateConfig(base, source, sampleRate) - * endcode - * param base PDM base pointer - * param sourceClock_HZ PDM source clock frequency. - * param sampleRate_HZ PDM sample rate. - */ -status_t PDM_SetSampleRateConfig(PDM_Type *base, uint32_t sourceClock_HZ, uint32_t sampleRate_HZ) -{ - uint32_t osr = (base->CTRL_2 & PDM_CTRL_2_CICOSR_MASK) >> PDM_CTRL_2_CICOSR_SHIFT; -#if !(defined FSL_FEATURE_PDM_HAS_NO_MINIMUM_CLKDIV && FSL_FEATURE_PDM_HAS_NO_MINIMUM_CLKDIV) - pdm_df_quality_mode_t qualityMode = - (pdm_df_quality_mode_t)(uint32_t)((base->CTRL_2 & PDM_CTRL_2_QSEL_MASK) >> PDM_CTRL_2_QSEL_SHIFT); - uint32_t enabledChannelMask = base->CTRL_1 & (uint32_t)kPDM_EnableChannelAll; -#endif - - uint32_t pdmClockRate = 0U; - uint32_t regDiv = 0U; - - /* get divider */ - osr = (PDM_CTRL_2_CICOSR_MASK >> PDM_CTRL_2_CICOSR_SHIFT) + 1U - osr; - pdmClockRate = sampleRate_HZ * osr * 8U; - regDiv = sourceClock_HZ / pdmClockRate; - - if (regDiv > PDM_CTRL_2_CLKDIV_MASK) - { - return kStatus_Fail; - } - -#if !(defined FSL_FEATURE_PDM_HAS_NO_MINIMUM_CLKDIV && FSL_FEATURE_PDM_HAS_NO_MINIMUM_CLKDIV) - if (PDM_ValidateSrcClockRate(enabledChannelMask, qualityMode, (uint8_t)osr, regDiv) == kStatus_Fail) - { - return kStatus_Fail; - } -#endif - - base->CTRL_2 = (base->CTRL_2 & (~PDM_CTRL_2_CLKDIV_MASK)) | PDM_CTRL_2_CLKDIV(regDiv); - - return kStatus_Success; -} - -/*! - * brief PDM set sample rate. - * - * deprecated Do not use this function. It has been superceded by @ref PDM_SetSampleRateConfig - * param base PDM base pointer - * param enableChannelMask PDM channel enable mask. - * param qualityMode quality mode. - * param osr cic oversample rate - * param clkDiv clock divider - */ -status_t PDM_SetSampleRate( - PDM_Type *base, uint32_t enableChannelMask, pdm_df_quality_mode_t qualityMode, uint8_t osr, uint32_t clkDiv) -{ -#if !(defined FSL_FEATURE_PDM_HAS_NO_MINIMUM_CLKDIV && FSL_FEATURE_PDM_HAS_NO_MINIMUM_CLKDIV) - uint8_t realOsr = (PDM_CTRL_2_CICOSR_MASK >> PDM_CTRL_2_CICOSR_SHIFT) + 1U - - (osr & (PDM_CTRL_2_CICOSR_MASK >> PDM_CTRL_2_CICOSR_SHIFT)); -#endif - uint32_t regDiv = clkDiv >> 1U; - - switch (qualityMode) - { - case kPDM_QualityModeHigh: - regDiv <<= 1U; - break; - case kPDM_QualityModeLow: - case kPDM_QualityModeVeryLow1: - regDiv >>= 1U; - break; - case kPDM_QualityModeVeryLow2: - regDiv >>= 2U; - break; - default: - assert(false); - break; - } - -#if !(defined FSL_FEATURE_PDM_HAS_NO_MINIMUM_CLKDIV && FSL_FEATURE_PDM_HAS_NO_MINIMUM_CLKDIV) - if (PDM_ValidateSrcClockRate(enableChannelMask, qualityMode, realOsr, regDiv) == kStatus_Fail) - { - return kStatus_Fail; - } -#endif - - assert(regDiv <= PDM_CTRL_2_CLKDIV_MASK); - base->CTRL_2 = (base->CTRL_2 & (~PDM_CTRL_2_CLKDIV_MASK)) | PDM_CTRL_2_CLKDIV(regDiv); - - return kStatus_Success; -} - -/*! - * brief Initializes the PDM peripheral. - * - * Ungates the PDM clock, resets the module, and configures PDM with a configuration structure. - * The configuration structure can be custom filled or set with default values by - * PDM_GetDefaultConfig(). - * - * note This API should be called at the beginning of the application to use - * the PDM driver. Otherwise, accessing the PDM module can cause a hard fault - * because the clock is not enabled. - * - * param base PDM base pointer - * param config PDM configuration structure. - */ -void PDM_Init(PDM_Type *base, const pdm_config_t *config) -{ - assert(config != NULL); - assert(config->fifoWatermark <= PDM_FIFO_CTRL_FIFOWMK_MASK); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the PDM clock */ - CLOCK_EnableClock(s_pdmClock[PDM_GetInstance(base)]); -#if defined(FSL_PDM_HAS_FILTER_CLOCK_GATE) && FSL_PDM_HAS_FILTER_CLOCK_GATE - CLOCK_EnableClock(s_pdmFilterClock[PDM_GetInstance(base)]); -#endif -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Enable the module and disable the interface/all channel */ - base->CTRL_1 &= - ~(PDM_CTRL_1_MDIS_MASK | PDM_CTRL_1_PDMIEN_MASK | PDM_CTRL_1_ERREN_MASK | (uint32_t)kPDM_EnableChannelAll); - - /* wait all filter stopped */ - while ((base->STAT & PDM_STAT_BSY_FIL_MASK) != 0U) - { - } - - /* software reset */ - base->CTRL_1 |= PDM_CTRL_1_SRES_MASK; - - /* Set the configure settings */ -#if !(defined(FSL_FEATURE_PDM_HAS_NO_DOZEN) && FSL_FEATURE_PDM_HAS_NO_DOZEN) - PDM_EnableDoze(base, config->enableDoze); -#endif - base->CTRL_2 = (base->CTRL_2 & (~(PDM_CTRL_2_CICOSR_MASK | PDM_CTRL_2_QSEL_MASK))) | - PDM_CTRL_2_CICOSR(config->cicOverSampleRate) | PDM_CTRL_2_QSEL(config->qualityMode); - -#if defined(FSL_FEATURE_PDM_HAS_DECIMATION_FILTER_BYPASS) && FSL_FEATURE_PDM_HAS_DECIMATION_FILTER_BYPASS - base->CTRL_2 = (base->CTRL_2 & ~PDM_CTRL_2_DEC_BYPASS_MASK) | PDM_CTRL_2_DEC_BYPASS(config->enableFilterBypass); -#endif - /* Set the watermark */ - base->FIFO_CTRL = PDM_FIFO_CTRL_FIFOWMK(config->fifoWatermark); -} - -/*! - * brief De-initializes the PDM peripheral. - * - * This API gates the PDM clock. The PDM module can't operate unless PDM_Init - * is called to enable the clock. - * - * param base PDM base pointer - */ -void PDM_Deinit(PDM_Type *base) -{ - /* disable PDM interface */ - PDM_DisableInterrupts(base, (uint32_t)kPDM_FIFOInterruptEnable | (uint32_t)kPDM_ErrorInterruptEnable); - PDM_Enable(base, false); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_DisableClock(s_pdmClock[PDM_GetInstance(base)]); -#if defined(FSL_PDM_HAS_FILTER_CLOCK_GATE) && FSL_PDM_HAS_FILTER_CLOCK_GATE - CLOCK_DisableClock(s_pdmFilterClock[PDM_GetInstance(base)]); -#endif -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Enables the PDM interrupt requests. - * - * param base PDM base pointer - * param mask interrupt source - * The parameter can be a combination of the following sources if defined. - * arg kPDM_ErrorInterruptEnable - * arg kPDM_FIFOInterruptEnable - */ -void PDM_EnableInterrupts(PDM_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kPDM_FIFOInterruptEnable) != 0U) - { - base->CTRL_1 = (base->CTRL_1 & (~PDM_CTRL_1_DISEL_MASK)) | (uint32_t)kPDM_FIFOInterruptEnable; - } - if ((mask & (uint32_t)kPDM_ErrorInterruptEnable) != 0U) - { - base->CTRL_1 = (base->CTRL_1 & (~PDM_CTRL_1_ERREN_MASK)) | (uint32_t)kPDM_ErrorInterruptEnable; - } -} - -/*! - * brief PDM one channel configurations. - * - * param base PDM base pointer - * param config PDM channel configurations. - * param channel channel number. - * after completing the current frame in debug mode. - */ -void PDM_SetChannelConfig(PDM_Type *base, uint32_t channel, const pdm_channel_config_t *config) -{ - assert(config != NULL); - assert(channel <= (uint32_t)FSL_FEATURE_PDM_CHANNEL_NUM); - - uint32_t dcCtrl = 0U; - -#if (defined(FSL_FEATURE_PDM_HAS_DC_OUT_CTRL) && (FSL_FEATURE_PDM_HAS_DC_OUT_CTRL)) - dcCtrl = base->DC_OUT_CTRL; - /* configure gain and cut off freq */ - dcCtrl &= ~((uint32_t)PDM_DC_OUT_CTRL_DCCONFIG0_MASK << (channel << 1U)); - dcCtrl |= (uint32_t)config->outputCutOffFreq << (channel << 1U); - base->DC_OUT_CTRL = dcCtrl; -#endif - -#if !(defined(FSL_FEATURE_PDM_DC_CTRL_VALUE_FIXED) && (FSL_FEATURE_PDM_DC_CTRL_VALUE_FIXED)) - dcCtrl = base->DC_CTRL; - /* configure gain and cut off freq */ - dcCtrl &= ~((uint32_t)PDM_DC_CTRL_DCCONFIG0_MASK << (channel << 1U)); - dcCtrl |= (uint32_t)config->cutOffFreq << (channel << 1U); - base->DC_CTRL = dcCtrl; -#endif - - PDM_SetChannelGain(base, channel, config->gain); - - /* enable channel */ - base->CTRL_1 |= 1UL << channel; -} - -/*! - * brief Set the PDM channel gain. - * - * Please note for different quality mode, the valid gain value is different, reference RM for detail. - * param base PDM base pointer. - * param channel PDM channel index. - * param gain channel gain, the register gain value range is 0 - 15. - */ -void PDM_SetChannelGain(PDM_Type *base, uint32_t channel, pdm_df_output_gain_t gain) -{ - assert(channel <= (uint32_t)FSL_FEATURE_PDM_CHANNEL_NUM); - -#if defined(FSL_FEATURE_PDM_HAS_RANGE_CTRL) && FSL_FEATURE_PDM_HAS_RANGE_CTRL - uint32_t outCtrl = base->RANGE_CTRL; -#else - uint32_t outCtrl = base->OUT_CTRL; -#endif - -#if defined(FSL_FEATURE_PDM_HAS_RANGE_CTRL) && FSL_FEATURE_PDM_HAS_RANGE_CTRL - outCtrl &= ~((uint32_t)PDM_RANGE_CTRL_RANGEADJ0_MASK << (channel << 2U)); -#else - outCtrl &= ~((uint32_t)PDM_OUT_CTRL_OUTGAIN0_MASK << (channel << 2U)); -#endif - - outCtrl |= (uint32_t)gain << (channel << 2U); - -#if defined(FSL_FEATURE_PDM_HAS_RANGE_CTRL) && FSL_FEATURE_PDM_HAS_RANGE_CTRL - base->RANGE_CTRL = outCtrl; -#else - base->OUT_CTRL = outCtrl; -#endif -} - -/*! - * brief PDM set channel transfer config. - * - * param base PDM base pointer. - * param handle PDM handle pointer. - * param channel PDM channel. - * param config channel config. - * param format data format. - */ -status_t PDM_TransferSetChannelConfig( - PDM_Type *base, pdm_handle_t *handle, uint32_t channel, const pdm_channel_config_t *config, uint32_t format) -{ - assert(handle != NULL); - - PDM_SetChannelConfig(base, channel, config); - - handle->format = format; - - if (handle->channelNums == 0U) - { - handle->startChannel = (uint8_t)channel; - } - - handle->channelNums++; - - if (handle->channelNums > (uint8_t)FSL_FEATURE_PDM_CHANNEL_NUM) - { - return kStatus_PDM_ChannelConfig_Failed; - } - - return kStatus_Success; -} - -/*! - * brief Initializes the PDM handle. - * - * This function initializes the handle for the PDM transactional APIs. Call - * this function once to get the handle initialized. - * - * param base PDM base pointer. - * param handle PDM handle pointer. - * param callback Pointer to the user callback function. - * param userData User parameter passed to the callback function. - */ -void PDM_TransferCreateHandle(PDM_Type *base, pdm_handle_t *handle, pdm_transfer_callback_t callback, void *userData) -{ - assert(handle != NULL); - - /* Zero the handle */ - (void)memset(handle, 0, sizeof(*handle)); - - s_pdmHandle[PDM_GetInstance(base)] = handle; - - handle->callback = callback; - handle->userData = userData; - handle->watermark = (uint8_t)(base->FIFO_CTRL & PDM_FIFO_CTRL_FIFOWMK_MASK); - - /* Set the isr pointer */ - s_pdmIsr = PDM_TransferHandleIRQ; - - /* Enable RX event IRQ */ - (void)EnableIRQ(PDM_EVENT_IRQn); -#if !(defined FSL_FEATURE_PDM_HAS_NO_INDEPENDENT_ERROR_IRQ && FSL_FEATURE_PDM_HAS_NO_INDEPENDENT_ERROR_IRQ) - /* Enable FIFO error IRQ */ - (void)EnableIRQ(PDM_ERROR_IRQn); -#endif -} - -/*! - * brief Performs an interrupt non-blocking receive transfer on PDM. - * - * note This API returns immediately after the transfer initiates. - * Call the PDM_RxGetTransferStatusIRQ to poll the transfer status and check whether - * the transfer is finished. If the return status is not kStatus_PDM_Busy, the transfer - * is finished. - * - * param base PDM base pointer - * param handle Pointer to the pdm_handle_t structure which stores the transfer state. - * param xfer Pointer to the pdm_transfer_t structure. - * retval kStatus_Success Successfully started the data receive. - * retval kStatus_PDM_Busy Previous receive still not finished. - */ -status_t PDM_TransferReceiveNonBlocking(PDM_Type *base, pdm_handle_t *handle, pdm_transfer_t *xfer) -{ - assert(handle != NULL); - - /* Check if the queue is full */ - if (handle->pdmQueue[handle->queueUser].data != NULL) - { - return kStatus_PDM_QueueFull; - } - - /* Add into queue */ - handle->transferSize[handle->queueUser] = xfer->dataSize; - handle->pdmQueue[handle->queueUser].data = xfer->data; - handle->pdmQueue[handle->queueUser].dataSize = xfer->dataSize; - handle->queueUser = (handle->queueUser + 1U) % PDM_XFER_QUEUE_SIZE; - - /* Set state to busy */ - handle->state = kStatus_PDM_Busy; - - /* Enable interrupt */ - PDM_EnableInterrupts(base, (uint32_t)kPDM_FIFOInterruptEnable); - - PDM_Enable(base, true); - - return kStatus_Success; -} - -/*! - * brief Aborts the current IRQ receive. - * - * note This API can be called when an interrupt non-blocking transfer initiates - * to abort the transfer early. - * - * param base PDM base pointer - * param handle Pointer to the pdm_handle_t structure which stores the transfer state. - */ -void PDM_TransferAbortReceive(PDM_Type *base, pdm_handle_t *handle) -{ - assert(handle != NULL); - - /* Use FIFO request interrupt and fifo error */ - PDM_DisableInterrupts(base, (uint32_t)kPDM_FIFOInterruptEnable | (uint32_t)kPDM_ErrorInterruptEnable); - PDM_Enable(base, false); - handle->state = kStatus_PDM_Idle; - /* Clear the queue */ - (void)memset(handle->pdmQueue, 0, sizeof(pdm_transfer_t) * PDM_XFER_QUEUE_SIZE); - handle->queueDriver = 0; - handle->queueUser = 0; -} - -/*! - * brief Tx interrupt handler. - * - * param base PDM base pointer. - * param handle Pointer to the pdm_handle_t structure. - */ -void PDM_TransferHandleIRQ(PDM_Type *base, pdm_handle_t *handle) -{ - assert(handle != NULL); - -#if (defined FSL_FEATURE_PDM_HAS_NO_INDEPENDENT_ERROR_IRQ && FSL_FEATURE_PDM_HAS_NO_INDEPENDENT_ERROR_IRQ) - uint32_t status = 0U; - -#if (defined(FSL_FEATURE_PDM_HAS_STATUS_LOW_FREQ) && (FSL_FEATURE_PDM_HAS_STATUS_LOW_FREQ == 1U)) - if (PDM_GetStatus(base) & PDM_STAT_LOWFREQF_MASK) - { - PDM_ClearStatus(base, PDM_STAT_LOWFREQF_MASK); - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_PDM_CLK_LOW, handle->userData); - } - } -#endif - status = PDM_GetFifoStatus(base); - if (status != 0U) - { - PDM_ClearFIFOStatus(base, status); - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_PDM_FIFO_ERROR, handle->userData); - } - } - -#if !(defined(FSL_FEATURE_PDM_HAS_RANGE_CTRL) && FSL_FEATURE_PDM_HAS_RANGE_CTRL) - status = PDM_GetOutputStatus(base); - if (status != 0U) - { - PDM_ClearOutputStatus(base, status); - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_PDM_Output_ERROR, handle->userData); - } - } -#endif -#endif - - /* Handle transfer */ - if (((base->STAT & 0xFFU) != 0U) && (handle->channelNums != 0U) && - ((base->CTRL_1 & PDM_CTRL_1_DISEL_MASK) == (0x2UL << PDM_CTRL_1_DISEL_SHIFT))) - { - PDM_ClearStatus(base, 0xFFU); - /* Judge if the data need to transmit is less than space */ - uint8_t size = (uint8_t)MIN((handle->pdmQueue[handle->queueDriver].dataSize), - ((uint32_t)handle->watermark * handle->channelNums * handle->format)); - - PDM_ReadFifo(base, handle->startChannel, handle->channelNums, - (uint8_t *)(uint32_t)handle->pdmQueue[handle->queueDriver].data, - ((size_t)size / handle->channelNums / handle->format), handle->format); - - /* Update the internal counter */ - handle->pdmQueue[handle->queueDriver].dataSize -= size; - handle->pdmQueue[handle->queueDriver].data = &(handle->pdmQueue[handle->queueDriver].data[size]); - } - - /* If finished a block, call the callback function */ - if (handle->pdmQueue[handle->queueDriver].dataSize == 0U) - { - handle->pdmQueue[handle->queueDriver].data = NULL; - handle->queueDriver = (handle->queueDriver + 1U) % PDM_XFER_QUEUE_SIZE; - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_PDM_Idle, handle->userData); - } - } - - /* If all data finished, just stop the transfer */ - if (handle->pdmQueue[handle->queueDriver].data == NULL) - { - PDM_TransferAbortReceive(base, handle); - } -} - -#if !(defined(FSL_FEATURE_PDM_HAS_NO_HWVAD) && FSL_FEATURE_PDM_HAS_NO_HWVAD) -/*! - * brief set HWVAD in envelope based mode . - * Recommand configurations, - * code - * static const pdm_hwvad_config_t hwvadConfig = { - * .channel = 0, - * .initializeTime = 10U, - * .cicOverSampleRate = 0U, - * .inputGain = 0U, - * .frameTime = 10U, - * .cutOffFreq = kPDM_HwvadHpfBypassed, - * .enableFrameEnergy = false, - * .enablePreFilter = true, -}; - - * static const pdm_hwvad_noise_filter_t noiseFilterConfig = { - * .enableAutoNoiseFilter = false, - * .enableNoiseMin = true, - * .enableNoiseDecimation = true, - * .noiseFilterAdjustment = 0U, - * .noiseGain = 7U, - * .enableNoiseDetectOR = true, - * }; - * code - * param base PDM base pointer. - * param hwvadConfig internal filter status. - * param noiseConfig Voice activity detector noise filter configure structure pointer. - * param zcdConfig Voice activity detector zero cross detector configure structure pointer . - * param signalGain signal gain value. - */ -void PDM_SetHwvadInEnvelopeBasedMode(PDM_Type *base, - const pdm_hwvad_config_t *hwvadConfig, - const pdm_hwvad_noise_filter_t *noiseConfig, - const pdm_hwvad_zero_cross_detector_t *zcdConfig, - uint32_t signalGain) -{ - assert(hwvadConfig != NULL); - assert(noiseConfig != NULL); - - uint32_t i = 0U; - - PDM_SetHwvadConfig(base, hwvadConfig); - PDM_SetHwvadSignalFilterConfig(base, true, signalGain); - PDM_SetHwvadNoiseFilterConfig(base, noiseConfig); - PDM_EnableHwvad(base, true); - - if (NULL != zcdConfig) - { - PDM_SetHwvadZeroCrossDetectorConfig(base, zcdConfig); - } - - PDM_Enable(base, true); - - while (PDM_GetHwvadInitialFlag(base) != 0U) - { - } - - for (i = 0; i < 3U; i++) - { - /* set HWVAD interal filter stauts initial */ - PDM_SetHwvadInternalFilterStatus(base, kPDM_HwvadInternalFilterInitial); - } - - PDM_SetHwvadInternalFilterStatus(base, kPDM_HwvadInternalFilterNormalOperation); -} - -/*! - * brief set HWVAD in energy based mode . - * Recommand configurations, - * code - * static const pdm_hwvad_config_t hwvadConfig = { - * .channel = 0, - * .initializeTime = 10U, - * .cicOverSampleRate = 0U, - * .inputGain = 0U, - * .frameTime = 10U, - * .cutOffFreq = kPDM_HwvadHpfBypassed, - * .enableFrameEnergy = true, - * .enablePreFilter = true, -}; - - * static const pdm_hwvad_noise_filter_t noiseFilterConfig = { - * .enableAutoNoiseFilter = true, - * .enableNoiseMin = false, - * .enableNoiseDecimation = false, - * .noiseFilterAdjustment = 0U, - * .noiseGain = 7U, - * .enableNoiseDetectOR = false, - * }; - * code - * param base PDM base pointer. - * param hwvadConfig internal filter status. - * param noiseConfig Voice activity detector noise filter configure structure pointer. - * param zcdConfig Voice activity detector zero cross detector configure structure pointer . - * param signalGain signal gain value, signal gain value should be properly according to application. - */ -void PDM_SetHwvadInEnergyBasedMode(PDM_Type *base, - const pdm_hwvad_config_t *hwvadConfig, - const pdm_hwvad_noise_filter_t *noiseConfig, - const pdm_hwvad_zero_cross_detector_t *zcdConfig, - uint32_t signalGain) -{ - assert(hwvadConfig != NULL); - assert(noiseConfig != NULL); - - PDM_SetHwvadConfig(base, hwvadConfig); - /* signal filter need to disable, but signal gain value should be set */ - base->VAD0_SCONFIG = PDM_VAD0_SCONFIG_VADSGAIN(signalGain); - PDM_SetHwvadNoiseFilterConfig(base, noiseConfig); - PDM_EnableHwvad(base, true); - - if (NULL != zcdConfig) - { - PDM_SetHwvadZeroCrossDetectorConfig(base, zcdConfig); - } - - PDM_Enable(base, true); -} - -/*! - * brief Configure voice activity detector. - * - * param base PDM base pointer - * param config Voice activity detector configure structure pointer . - */ -void PDM_SetHwvadConfig(PDM_Type *base, const pdm_hwvad_config_t *config) -{ - assert(config != NULL); - - uint32_t ctrl1 = base->VAD0_CTRL_1; - - /* Configure VAD0_CTRL_1 register */ - ctrl1 &= ~(PDM_VAD0_CTRL_1_VADCHSEL_MASK | PDM_VAD0_CTRL_1_VADCICOSR_MASK | PDM_VAD0_CTRL_1_VADINITT_MASK); - ctrl1 |= (PDM_VAD0_CTRL_1_VADCHSEL(config->channel) | PDM_VAD0_CTRL_1_VADCICOSR(config->cicOverSampleRate) | - PDM_VAD0_CTRL_1_VADINITT(config->initializeTime)); - base->VAD0_CTRL_1 = ctrl1; - - /* Configure VAD0_CTRL_2 register */ - base->VAD0_CTRL_2 = - (PDM_VAD0_CTRL_2_VADFRENDIS((config->enableFrameEnergy == true) ? 0U : 1U) | - PDM_VAD0_CTRL_2_VADPREFEN(config->enablePreFilter) | PDM_VAD0_CTRL_2_VADFRAMET(config->frameTime) | - PDM_VAD0_CTRL_2_VADINPGAIN(config->inputGain) | PDM_VAD0_CTRL_2_VADHPF(config->cutOffFreq)); -} - -/*! - * brief Configure voice activity detector signal filter. - * - * param base PDM base pointer - * param enableMaxBlock If signal maximum block enabled. - * param signalGain Gain value for the signal energy. - */ -void PDM_SetHwvadSignalFilterConfig(PDM_Type *base, bool enableMaxBlock, uint32_t signalGain) -{ - uint32_t signalConfig = base->VAD0_SCONFIG; - - signalConfig &= ~(PDM_VAD0_SCONFIG_VADSMAXEN_MASK | PDM_VAD0_SCONFIG_VADSGAIN_MASK); - signalConfig |= (PDM_VAD0_SCONFIG_VADSMAXEN(enableMaxBlock) | PDM_VAD0_SCONFIG_VADSGAIN(signalGain)) | - PDM_VAD0_SCONFIG_VADSFILEN_MASK; - base->VAD0_SCONFIG = signalConfig; -} - -/*! - * brief Configure voice activity detector noise filter. - * - * param base PDM base pointer - * param config Voice activity detector noise filter configure structure pointer . - */ -void PDM_SetHwvadNoiseFilterConfig(PDM_Type *base, const pdm_hwvad_noise_filter_t *config) -{ - assert(config != NULL); - - base->VAD0_NCONFIG = - (PDM_VAD0_NCONFIG_VADNFILAUTO(config->enableAutoNoiseFilter) | - PDM_VAD0_NCONFIG_VADNOREN(config->enableNoiseDetectOR) | PDM_VAD0_NCONFIG_VADNMINEN(config->enableNoiseMin) | - PDM_VAD0_NCONFIG_VADNDECEN(config->enableNoiseDecimation) | - PDM_VAD0_NCONFIG_VADNFILADJ(config->noiseFilterAdjustment) | PDM_VAD0_NCONFIG_VADNGAIN(config->noiseGain)); -} - -/*! - * brief Configure voice activity detector zero cross detector. - * - * param base PDM base pointer - * param config Voice activity detector zero cross detector configure structure pointer . - */ -void PDM_SetHwvadZeroCrossDetectorConfig(PDM_Type *base, const pdm_hwvad_zero_cross_detector_t *config) -{ - assert(config != NULL); - - uint32_t zcd = (base->VAD0_ZCD & (~(PDM_VAD0_ZCD_VADZCDTH_MASK | PDM_VAD0_ZCD_VADZCDADJ_MASK | - PDM_VAD0_ZCD_VADZCDAUTO_MASK | PDM_VAD0_ZCD_VADZCDAND_MASK))); - - zcd |= (PDM_VAD0_ZCD_VADZCDTH(config->threshold) | PDM_VAD0_ZCD_VADZCDADJ(config->adjustmentThreshold) | - PDM_VAD0_ZCD_VADZCDAUTO(config->enableAutoThreshold) | PDM_VAD0_ZCD_VADZCDAND(config->zcdAnd)) | - PDM_VAD0_ZCD_VADZCDEN_MASK; - - base->VAD0_ZCD = zcd; -} - -/*! - * brief Enable/Disable hwvad callback. - - * This function enable/disable the hwvad interrupt for the selected PDM peripheral. - * - * param base Base address of the PDM peripheral. - * param vadCallback callback Pointer to store callback function, should be NULL when disable. - * param userData user data. - * param enable true is enable, false is disable. - * retval None. - */ -void PDM_EnableHwvadInterruptCallback(PDM_Type *base, pdm_hwvad_callback_t vadCallback, void *userData, bool enable) -{ - uint32_t instance = PDM_GetInstance(base); - - if (enable) - { - PDM_EnableHwvadInterrupts(base, (uint32_t)kPDM_HwvadErrorInterruptEnable | (uint32_t)kPDM_HwvadInterruptEnable); - NVIC_ClearPendingIRQ(PDM_HWVAD_EVENT_IRQn); - (void)EnableIRQ(PDM_HWVAD_EVENT_IRQn); -#if !(defined FSL_FEATURE_PDM_HAS_NO_INDEPENDENT_ERROR_IRQ && FSL_FEATURE_PDM_HAS_NO_INDEPENDENT_ERROR_IRQ) - NVIC_ClearPendingIRQ(PDM_HWVAD_ERROR_IRQn); - (void)EnableIRQ(PDM_HWVAD_ERROR_IRQn); -#endif - s_pdm_hwvad_notification[instance].callback = vadCallback; - s_pdm_hwvad_notification[instance].userData = userData; - } - else - { - PDM_DisableHwvadInterrupts(base, - (uint32_t)kPDM_HwvadErrorInterruptEnable | (uint32_t)kPDM_HwvadInterruptEnable); - (void)DisableIRQ(PDM_HWVAD_EVENT_IRQn); -#if !(defined FSL_FEATURE_PDM_HAS_NO_INDEPENDENT_ERROR_IRQ && FSL_FEATURE_PDM_HAS_NO_INDEPENDENT_ERROR_IRQ) - (void)DisableIRQ(PDM_HWVAD_ERROR_IRQn); - NVIC_ClearPendingIRQ(PDM_HWVAD_ERROR_IRQn); -#endif - s_pdm_hwvad_notification[instance].callback = NULL; - s_pdm_hwvad_notification[instance].userData = NULL; - NVIC_ClearPendingIRQ(PDM_HWVAD_EVENT_IRQn); - } -} - -#if (defined PDM) -void PDM_HWVAD_EVENT_DriverIRQHandler(void); -void PDM_HWVAD_EVENT_DriverIRQHandler(void) -{ - if ((PDM_GetHwvadInterruptStatusFlags(PDM) & (uint32_t)kPDM_HwvadStatusVoiceDetectFlag) != 0U) - { - PDM_ClearHwvadInterruptStatusFlags(PDM, (uint32_t)kPDM_HwvadStatusVoiceDetectFlag); - if (s_pdm_hwvad_notification[0].callback != NULL) - { - s_pdm_hwvad_notification[0].callback(kStatus_PDM_HWVAD_VoiceDetected, s_pdm_hwvad_notification[0].userData); - } - } -#if (defined FSL_FEATURE_PDM_HAS_NO_INDEPENDENT_ERROR_IRQ && FSL_FEATURE_PDM_HAS_NO_INDEPENDENT_ERROR_IRQ) - else - { - PDM_ClearHwvadInterruptStatusFlags(PDM, (uint32_t)kPDM_HwvadStatusInputSaturation); - if (s_pdm_hwvad_notification[0].callback != NULL) - { - s_pdm_hwvad_notification[0].callback(kStatus_PDM_HWVAD_Error, s_pdm_hwvad_notification[0].userData); - } - } -#endif - SDK_ISR_EXIT_BARRIER; -} - -#if !(defined FSL_FEATURE_PDM_HAS_NO_INDEPENDENT_ERROR_IRQ && FSL_FEATURE_PDM_HAS_NO_INDEPENDENT_ERROR_IRQ) -void PDM_HWVAD_ERROR_DriverIRQHandler(void); -void PDM_HWVAD_ERROR_DriverIRQHandler(void) -{ - PDM_ClearHwvadInterruptStatusFlags(PDM, (uint32_t)kPDM_HwvadStatusInputSaturation); - if (s_pdm_hwvad_notification[0].callback != NULL) - { - s_pdm_hwvad_notification[0].callback(kStatus_PDM_HWVAD_Error, s_pdm_hwvad_notification[0].userData); - } - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif -#endif - -#if defined(PDM) -void PDM_EVENT_DriverIRQHandler(void); -void PDM_EVENT_DriverIRQHandler(void) -{ - assert(s_pdmHandle[0] != NULL); - s_pdmIsr(PDM, s_pdmHandle[0]); - SDK_ISR_EXIT_BARRIER; -} -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_pdm.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_pdm.h deleted file mode 100644 index e8c402df061..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_pdm.h +++ /dev/null @@ -1,1217 +0,0 @@ -/* - * Copyright (c) 2018, Freescale Semiconductor, Inc. - * Copyright 2019-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_PDM_H_ -#define FSL_PDM_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup pdm_driver PDM Driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -#define FSL_PDM_DRIVER_VERSION (MAKE_VERSION(2, 9, 1)) /*!< Version 2.9.1 */ -/*@}*/ - -/*! @brief PDM XFER QUEUE SIZE */ -#define PDM_XFER_QUEUE_SIZE (4U) - -/*! @brief PDM return status*/ -enum -{ - kStatus_PDM_Busy = MAKE_STATUS(kStatusGroup_PDM, 0), /*!< PDM is busy. */ -#if (defined(FSL_FEATURE_PDM_HAS_STATUS_LOW_FREQ) && (FSL_FEATURE_PDM_HAS_STATUS_LOW_FREQ == 1U)) - kStatus_PDM_CLK_LOW = MAKE_STATUS(kStatusGroup_PDM, 1), /*!< PDM clock frequency low */ -#endif - kStatus_PDM_FIFO_ERROR = MAKE_STATUS(kStatusGroup_PDM, 2), /*!< PDM FIFO underrun or overflow */ - kStatus_PDM_QueueFull = MAKE_STATUS(kStatusGroup_PDM, 3), /*!< PDM FIFO underrun or overflow */ - kStatus_PDM_Idle = MAKE_STATUS(kStatusGroup_PDM, 4), /*!< PDM is idle */ - kStatus_PDM_Output_ERROR = MAKE_STATUS(kStatusGroup_PDM, 5), /*!< PDM is output error */ - kStatus_PDM_ChannelConfig_Failed = MAKE_STATUS(kStatusGroup_PDM, 6), /*!< PDM channel config failed */ -#if !(defined(FSL_FEATURE_PDM_HAS_NO_HWVAD) && FSL_FEATURE_PDM_HAS_NO_HWVAD) - kStatus_PDM_HWVAD_VoiceDetected = MAKE_STATUS(kStatusGroup_PDM, 7), /*!< PDM hwvad voice detected */ - kStatus_PDM_HWVAD_Error = MAKE_STATUS(kStatusGroup_PDM, 8), /*!< PDM hwvad error */ -#endif -}; - -/*! @brief The PDM interrupt enable flag */ -enum _pdm_interrupt_enable -{ - kPDM_ErrorInterruptEnable = PDM_CTRL_1_ERREN_MASK, /*!< PDM channel error interrupt enable. */ - kPDM_FIFOInterruptEnable = PDM_CTRL_1_DISEL(2U), /*!< PDM channel FIFO interrupt */ -}; - -/*! @brief The PDM status */ -enum _pdm_internal_status -{ - kPDM_StatusDfBusyFlag = (int)PDM_STAT_BSY_FIL_MASK, /*!< Decimation filter is busy processing data */ -#if !(defined(FSL_FEATURE_PDM_HAS_NO_FIR_RDY) && FSL_FEATURE_PDM_HAS_NO_FIR_RDY) - kPDM_StatusFIRFilterReady = PDM_STAT_FIR_RDY_MASK, /*!< FIR filter data is ready */ -#endif -#if (defined(FSL_FEATURE_PDM_HAS_STATUS_LOW_FREQ) && (FSL_FEATURE_PDM_HAS_STATUS_LOW_FREQ == 1U)) - kPDM_StatusFrequencyLow = PDM_STAT_LOWFREQF_MASK, /*!< Mic app clock frequency not high enough */ -#endif - kPDM_StatusCh0FifoDataAvaliable = PDM_STAT_CH0F_MASK, /*!< channel 0 fifo data reached watermark level */ - kPDM_StatusCh1FifoDataAvaliable = PDM_STAT_CH1F_MASK, /*!< channel 1 fifo data reached watermark level */ - kPDM_StatusCh2FifoDataAvaliable = PDM_STAT_CH2F_MASK, /*!< channel 2 fifo data reached watermark level */ - kPDM_StatusCh3FifoDataAvaliable = PDM_STAT_CH3F_MASK, /*!< channel 3 fifo data reached watermark level */ -#if !defined(FSL_FEATURE_PDM_CHANNEL_NUM) || (FSL_FEATURE_PDM_CHANNEL_NUM == 8U) - kPDM_StatusCh4FifoDataAvaliable = PDM_STAT_CH4F_MASK, /*!< channel 4 fifo data reached watermark level */ - kPDM_StatusCh5FifoDataAvaliable = PDM_STAT_CH5F_MASK, /*!< channel 5 fifo data reached watermark level */ - kPDM_StatusCh6FifoDataAvaliable = PDM_STAT_CH6F_MASK, /*!< channel 6 fifo data reached watermark level */ - kPDM_StatusCh7FifoDataAvaliable = PDM_STAT_CH7F_MASK, /*!< channel 7 fifo data reached watermark level */ -#endif -}; - -/*! @brief PDM channel enable mask */ -enum _pdm_channel_enable_mask -{ - kPDM_EnableChannel0 = PDM_STAT_CH0F_MASK, /*!< channgel 0 enable mask */ - kPDM_EnableChannel1 = PDM_STAT_CH1F_MASK, /*!< channgel 1 enable mask */ - kPDM_EnableChannel2 = PDM_STAT_CH2F_MASK, /*!< channgel 2 enable mask */ - kPDM_EnableChannel3 = PDM_STAT_CH3F_MASK, /*!< channgel 3 enable mask */ -#if !defined(FSL_FEATURE_PDM_CHANNEL_NUM) || (FSL_FEATURE_PDM_CHANNEL_NUM == 8U) - kPDM_EnableChannel4 = PDM_STAT_CH4F_MASK, /*!< channgel 4 enable mask */ - kPDM_EnableChannel5 = PDM_STAT_CH5F_MASK, /*!< channgel 5 enable mask */ - kPDM_EnableChannel6 = PDM_STAT_CH6F_MASK, /*!< channgel 6 enable mask */ - kPDM_EnableChannel7 = PDM_STAT_CH7F_MASK, /*!< channgel 7 enable mask */ - - kPDM_EnableChannelAll = kPDM_EnableChannel0 | kPDM_EnableChannel1 | kPDM_EnableChannel2 | kPDM_EnableChannel3 | - kPDM_EnableChannel4 | kPDM_EnableChannel5 | kPDM_EnableChannel6 | kPDM_EnableChannel7, -#else - kPDM_EnableChannelAll = kPDM_EnableChannel0 | kPDM_EnableChannel1 | kPDM_EnableChannel2 | kPDM_EnableChannel3, -#endif -}; - -/*! @brief The PDM fifo status */ -enum _pdm_fifo_status -{ - kPDM_FifoStatusUnderflowCh0 = PDM_FIFO_STAT_FIFOUND0_MASK, /*!< channel0 fifo status underflow */ - kPDM_FifoStatusUnderflowCh1 = PDM_FIFO_STAT_FIFOUND1_MASK, /*!< channel1 fifo status underflow */ - kPDM_FifoStatusUnderflowCh2 = PDM_FIFO_STAT_FIFOUND2_MASK, /*!< channel2 fifo status underflow */ - kPDM_FifoStatusUnderflowCh3 = PDM_FIFO_STAT_FIFOUND3_MASK, /*!< channel3 fifo status underflow */ -#if !defined(FSL_FEATURE_PDM_CHANNEL_NUM) || (FSL_FEATURE_PDM_CHANNEL_NUM == 8U) - kPDM_FifoStatusUnderflowCh4 = PDM_FIFO_STAT_FIFOUND4_MASK, /*!< channel4 fifo status underflow */ - kPDM_FifoStatusUnderflowCh5 = PDM_FIFO_STAT_FIFOUND5_MASK, /*!< channel5 fifo status underflow */ - kPDM_FifoStatusUnderflowCh6 = PDM_FIFO_STAT_FIFOUND6_MASK, /*!< channel6 fifo status underflow */ - kPDM_FifoStatusUnderflowCh7 = PDM_FIFO_STAT_FIFOUND6_MASK, /*!< channel7 fifo status underflow */ -#endif - - kPDM_FifoStatusOverflowCh0 = PDM_FIFO_STAT_FIFOOVF0_MASK, /*!< channel0 fifo status overflow */ - kPDM_FifoStatusOverflowCh1 = PDM_FIFO_STAT_FIFOOVF1_MASK, /*!< channel1 fifo status overflow */ - kPDM_FifoStatusOverflowCh2 = PDM_FIFO_STAT_FIFOOVF2_MASK, /*!< channel2 fifo status overflow */ - kPDM_FifoStatusOverflowCh3 = PDM_FIFO_STAT_FIFOOVF3_MASK, /*!< channel3 fifo status overflow */ -#if !defined(FSL_FEATURE_PDM_CHANNEL_NUM) || (FSL_FEATURE_PDM_CHANNEL_NUM == 8U) - kPDM_FifoStatusOverflowCh4 = PDM_FIFO_STAT_FIFOOVF4_MASK, /*!< channel4 fifo status overflow */ - kPDM_FifoStatusOverflowCh5 = PDM_FIFO_STAT_FIFOOVF5_MASK, /*!< channel5 fifo status overflow */ - kPDM_FifoStatusOverflowCh6 = PDM_FIFO_STAT_FIFOOVF6_MASK, /*!< channel6 fifo status overflow */ - kPDM_FifoStatusOverflowCh7 = PDM_FIFO_STAT_FIFOOVF7_MASK, /*!< channel7 fifo status overflow */ -#endif -}; - -#if defined(FSL_FEATURE_PDM_HAS_RANGE_CTRL) && FSL_FEATURE_PDM_HAS_RANGE_CTRL -/*! @brief The PDM output status */ -enum _pdm_range_status -{ - kPDM_RangeStatusUnderFlowCh0 = PDM_RANGE_STAT_RANGEUNF0_MASK, /*!< channel0 range status underflow */ - kPDM_RangeStatusUnderFlowCh1 = PDM_RANGE_STAT_RANGEUNF1_MASK, /*!< channel1 range status underflow */ - kPDM_RangeStatusUnderFlowCh2 = PDM_RANGE_STAT_RANGEUNF2_MASK, /*!< channel2 range status underflow */ - kPDM_RangeStatusUnderFlowCh3 = PDM_RANGE_STAT_RANGEUNF3_MASK, /*!< channel3 range status underflow */ -#if !defined(FSL_FEATURE_PDM_CHANNEL_NUM) || (FSL_FEATURE_PDM_CHANNEL_NUM == 8U) - kPDM_RangeStatusUnderFlowCh4 = PDM_RANGE_STAT_RANGEUNF4_MASK, /*!< channel4 range status underflow */ - kPDM_RangeStatusUnderFlowCh5 = PDM_RANGE_STAT_RANGEUNF5_MASK, /*!< channel5 range status underflow */ - kPDM_RangeStatusUnderFlowCh6 = PDM_RANGE_STAT_RANGEUNF6_MASK, /*!< channel6 range status underflow */ - kPDM_RangeStatusUnderFlowCh7 = PDM_RANGE_STAT_RANGEUNF7_MASK, /*!< channel7 range status underflow */ -#endif - kPDM_RangeStatusOverFlowCh0 = PDM_RANGE_STAT_RANGEOVF0_MASK, /*!< channel0 range status overflow */ - kPDM_RangeStatusOverFlowCh1 = PDM_RANGE_STAT_RANGEOVF1_MASK, /*!< channel1 range status overflow */ - kPDM_RangeStatusOverFlowCh2 = PDM_RANGE_STAT_RANGEOVF2_MASK, /*!< channel2 range status overflow */ - kPDM_RangeStatusOverFlowCh3 = PDM_RANGE_STAT_RANGEOVF3_MASK, /*!< channel3 range status overflow */ -#if !defined(FSL_FEATURE_PDM_CHANNEL_NUM) || (FSL_FEATURE_PDM_CHANNEL_NUM == 8U) - kPDM_RangeStatusOverFlowCh4 = PDM_RANGE_STAT_RANGEOVF4_MASK, /*!< channel4 range status overflow */ - kPDM_RangeStatusOverFlowCh5 = PDM_RANGE_STAT_RANGEOVF5_MASK, /*!< channel5 range status overflow */ - kPDM_RangeStatusOverFlowCh6 = PDM_RANGE_STAT_RANGEOVF6_MASK, /*!< channel6 range status overflow */ - kPDM_RangeStatusOverFlowCh7 = PDM_RANGE_STAT_RANGEOVF7_MASK, /*!< channel7 range status overflow */ -#endif -}; -#else -/*! @brief The PDM output status */ -enum _pdm_output_status -{ - kPDM_OutputStatusUnderFlowCh0 = PDM_OUT_STAT_OUTUNF0_MASK, /*!< channel0 output status underflow */ - kPDM_OutputStatusUnderFlowCh1 = PDM_OUT_STAT_OUTUNF1_MASK, /*!< channel1 output status underflow */ - kPDM_OutputStatusUnderFlowCh2 = PDM_OUT_STAT_OUTUNF2_MASK, /*!< channel2 output status underflow */ - kPDM_OutputStatusUnderFlowCh3 = PDM_OUT_STAT_OUTUNF3_MASK, /*!< channel3 output status underflow */ -#if !defined(FSL_FEATURE_PDM_CHANNEL_NUM) || (FSL_FEATURE_PDM_CHANNEL_NUM == 8U) - kPDM_OutputStatusUnderFlowCh4 = PDM_OUT_STAT_OUTUNF4_MASK, /*!< channel4 output status underflow */ - kPDM_OutputStatusUnderFlowCh5 = PDM_OUT_STAT_OUTUNF5_MASK, /*!< channel5 output status underflow */ - kPDM_OutputStatusUnderFlowCh6 = PDM_OUT_STAT_OUTUNF6_MASK, /*!< channel6 output status underflow */ - kPDM_OutputStatusUnderFlowCh7 = PDM_OUT_STAT_OUTUNF7_MASK, /*!< channel7 output status underflow */ -#endif - kPDM_OutputStatusOverFlowCh0 = PDM_OUT_STAT_OUTOVF0_MASK, /*!< channel0 output status overflow */ - kPDM_OutputStatusOverFlowCh1 = PDM_OUT_STAT_OUTOVF1_MASK, /*!< channel1 output status overflow */ - kPDM_OutputStatusOverFlowCh2 = PDM_OUT_STAT_OUTOVF2_MASK, /*!< channel2 output status overflow */ - kPDM_OutputStatusOverFlowCh3 = PDM_OUT_STAT_OUTOVF3_MASK, /*!< channel3 output status overflow */ -#if !defined(FSL_FEATURE_PDM_CHANNEL_NUM) || (FSL_FEATURE_PDM_CHANNEL_NUM == 8U) - kPDM_OutputStatusOverFlowCh4 = PDM_OUT_STAT_OUTOVF4_MASK, /*!< channel4 output status overflow */ - kPDM_OutputStatusOverFlowCh5 = PDM_OUT_STAT_OUTOVF5_MASK, /*!< channel5 output status overflow */ - kPDM_OutputStatusOverFlowCh6 = PDM_OUT_STAT_OUTOVF6_MASK, /*!< channel6 output status overflow */ - kPDM_OutputStatusOverFlowCh7 = PDM_OUT_STAT_OUTOVF7_MASK, /*!< channel7 output status overflow */ -#endif -}; -#endif - -#if (defined(FSL_FEATURE_PDM_HAS_DC_OUT_CTRL) && (FSL_FEATURE_PDM_HAS_DC_OUT_CTRL)) -/*! @brief PDM DC remover configurations */ -typedef enum _pdm_dc_remover -{ - kPDM_DcRemoverCutOff20Hz = 0U, /*!< DC remover cut off 20HZ */ - kPDM_DcRemoverCutOff13Hz = 1U, /*!< DC remover cut off 13.3HZ */ - kPDM_DcRemoverCutOff40Hz = 2U, /*!< DC remover cut off 40HZ */ - kPDM_DcRemoverBypass = 3U, /*!< DC remover bypass */ -} pdm_dc_remover_t; -#else -/*! @brief PDM DC remover configurations */ -typedef enum _pdm_dc_remover -{ - kPDM_DcRemoverCutOff21Hz = 0U, /*!< DC remover cut off 21HZ */ - kPDM_DcRemoverCutOff83Hz = 1U, /*!< DC remover cut off 83HZ */ - kPDM_DcRemoverCutOff152Hz = 2U, /*!< DC remover cut off 152HZ */ - kPDM_DcRemoverBypass = 3U, /*!< DC remover bypass */ -} pdm_dc_remover_t; -#endif - -/*! @brief PDM decimation filter quality mode */ -typedef enum _pdm_df_quality_mode -{ - kPDM_QualityModeMedium = 0U, /*!< quality mode memdium */ - kPDM_QualityModeHigh = 1U, /*!< quality mode high */ - kPDM_QualityModeLow = 7U, /*!< quality mode low */ - kPDM_QualityModeVeryLow0 = 6U, /*!< quality mode very low0 */ - kPDM_QualityModeVeryLow1 = 5U, /*!< quality mode very low1 */ - kPDM_QualityModeVeryLow2 = 4U, /*!< quality mode very low2 */ -} pdm_df_quality_mode_t; - -/*! @brief PDM quality mode K factor */ -enum _pdm_qulaity_mode_k_factor -{ - kPDM_QualityModeHighKFactor = 1U, /*!< high quality mode K factor = 1 / 2 */ - kPDM_QualityModeMediumKFactor = 2U, /*!< medium/very low0 quality mode K factor = 2 / 2 */ - kPDM_QualityModeLowKFactor = 4U, /*!< low/very low1 quality mode K factor = 4 / 2 */ - kPDM_QualityModeVeryLow2KFactor = 8U, /*!< very low2 quality mode K factor = 8 / 2 */ -}; - -/*! @brief PDM decimation filter output gain */ -typedef enum _pdm_df_output_gain -{ - kPDM_DfOutputGain0 = 0U, /*!< Decimation filter output gain 0 */ - kPDM_DfOutputGain1 = 1U, /*!< Decimation filter output gain 1 */ - kPDM_DfOutputGain2 = 2U, /*!< Decimation filter output gain 2 */ - kPDM_DfOutputGain3 = 3U, /*!< Decimation filter output gain 3 */ - kPDM_DfOutputGain4 = 4U, /*!< Decimation filter output gain 4 */ - kPDM_DfOutputGain5 = 5U, /*!< Decimation filter output gain 5 */ - kPDM_DfOutputGain6 = 6U, /*!< Decimation filter output gain 6 */ - kPDM_DfOutputGain7 = 7U, /*!< Decimation filter output gain 7 */ - kPDM_DfOutputGain8 = 8U, /*!< Decimation filter output gain 8 */ - kPDM_DfOutputGain9 = 9U, /*!< Decimation filter output gain 9 */ - kPDM_DfOutputGain10 = 0xAU, /*!< Decimation filter output gain 10 */ - kPDM_DfOutputGain11 = 0xBU, /*!< Decimation filter output gain 11 */ - kPDM_DfOutputGain12 = 0xCU, /*!< Decimation filter output gain 12 */ - kPDM_DfOutputGain13 = 0xDU, /*!< Decimation filter output gain 13 */ - kPDM_DfOutputGain14 = 0xEU, /*!< Decimation filter output gain 14 */ - kPDM_DfOutputGain15 = 0xFU, /*!< Decimation filter output gain 15 */ -} pdm_df_output_gain_t; - -/*! @brief PDM data width */ -enum _pdm_data_width -{ -#if defined(FSL_FEATURE_PDM_FIFO_WIDTH) && (FSL_FEATURE_PDM_FIFO_WIDTH != 2U) - kPDM_DataWwidth24 = 3U, /*!< PDM data width 24bit */ - kPDM_DataWwidth32 = 4U, /*!< PDM data width 32bit */ -#else - kPDM_DataWdith16 = 2U, /*!< PDM data width 16bit */ -#endif -}; - -/*! @brief PDM channel configurations */ -typedef struct _pdm_channel_config -{ -#if (defined(FSL_FEATURE_PDM_HAS_DC_OUT_CTRL) && (FSL_FEATURE_PDM_HAS_DC_OUT_CTRL)) - pdm_dc_remover_t outputCutOffFreq; /*!< PDM output DC remover cut off frequency */ -#endif - -#if !(defined(FSL_FEATURE_PDM_DC_CTRL_VALUE_FIXED) && (FSL_FEATURE_PDM_DC_CTRL_VALUE_FIXED)) - pdm_dc_remover_t cutOffFreq; /*!< DC remover cut off frequency */ -#endif - - pdm_df_output_gain_t gain; /*!< Decimation Filter Output Gain */ -} pdm_channel_config_t; - -/*! @brief PDM user configuration structure */ -typedef struct _pdm_config -{ - bool - enableDoze; /*!< This module will enter disable/low leakage mode if DOZEN is active with ipg_doze is asserted */ -#if defined(FSL_FEATURE_PDM_HAS_DECIMATION_FILTER_BYPASS) && FSL_FEATURE_PDM_HAS_DECIMATION_FILTER_BYPASS - bool enableFilterBypass; /*!< Switchable bypass path for the decimation filter */ -#endif - uint8_t fifoWatermark; /*!< Watermark value for FIFO */ - pdm_df_quality_mode_t qualityMode; /*!< Quality mode */ - uint8_t cicOverSampleRate; /*!< CIC filter over sampling rate */ -} pdm_config_t; - -#if !(defined(FSL_FEATURE_PDM_HAS_NO_HWVAD) && FSL_FEATURE_PDM_HAS_NO_HWVAD) -/*! @brief PDM voice activity detector interrupt type */ -enum _pdm_hwvad_interrupt_enable -{ - kPDM_HwvadErrorInterruptEnable = PDM_VAD0_CTRL_1_VADERIE_MASK, /*!< PDM channel HWVAD error interrupt enable. */ - kPDM_HwvadInterruptEnable = PDM_VAD0_CTRL_1_VADIE_MASK, /*!< PDM channel HWVAD interrupt */ -}; - -/*! @brief The PDM hwvad interrupt status flag */ -enum _pdm_hwvad_int_status -{ - kPDM_HwvadStatusInputSaturation = PDM_VAD0_STAT_VADINSATF_MASK, /*!< HWVAD saturation condition */ - kPDM_HwvadStatusVoiceDetectFlag = PDM_VAD0_STAT_VADIF_MASK, /*!< HWVAD voice detect interrupt triggered */ -}; - -/*! @brief High pass filter configure cut-off frequency*/ -typedef enum _pdm_hwvad_hpf_config -{ - kPDM_HwvadHpfBypassed = 0x0U, /*!< High-pass filter bypass */ - kPDM_HwvadHpfCutOffFreq1750Hz = 0x1U, /*!< High-pass filter cut off frequency 1750HZ */ - kPDM_HwvadHpfCutOffFreq215Hz = 0x2U, /*!< High-pass filter cut off frequency 215HZ */ - kPDM_HwvadHpfCutOffFreq102Hz = 0x3U, /*!< High-pass filter cut off frequency 102HZ */ -} pdm_hwvad_hpf_config_t; - -/*! @brief HWVAD internal filter status */ -typedef enum _pdm_hwvad_filter_status -{ - kPDM_HwvadInternalFilterNormalOperation = 0U, /*!< internal filter ready for normal operation */ - kPDM_HwvadInternalFilterInitial = PDM_VAD0_CTRL_1_VADST10_MASK, /*!< interla filter are initial */ -} pdm_hwvad_filter_status_t; - -/*! @brief PDM voice activity detector user configuration structure */ -typedef struct _pdm_hwvad_config -{ - uint8_t channel; /*!< Which channel uses voice activity detector */ - uint8_t initializeTime; /*!< Number of frames or samples to initialize voice activity detector. */ - uint8_t cicOverSampleRate; /*!< CIC filter over sampling rate */ - - uint8_t inputGain; /*!< Voice activity detector input gain */ - uint32_t frameTime; /*!< Voice activity frame time */ - pdm_hwvad_hpf_config_t cutOffFreq; /*!< High pass filter cut off frequency */ - bool enableFrameEnergy; /*!< If frame energy enabled, true means enable */ - bool enablePreFilter; /*!< If pre-filter enabled */ -} pdm_hwvad_config_t; - -/*! @brief PDM voice activity detector noise filter user configuration structure */ -typedef struct _pdm_hwvad_noise_filter -{ - bool enableAutoNoiseFilter; /*!< If noise fileter automatically activated, true means enable */ - bool enableNoiseMin; /*!< If Noise minimum block enabled, true means enabled */ - bool enableNoiseDecimation; /*!< If enable noise input decimation */ - bool enableNoiseDetectOR; /*!< Enables a OR logic in the output of minimum noise estimator block */ - uint32_t noiseFilterAdjustment; /*!< The adjustment value of the noise filter */ - uint32_t noiseGain; /*!< Gain value for the noise energy or envelope estimated */ -} pdm_hwvad_noise_filter_t; - -/*! @brief PDM voice activity detector zero cross detector result */ -typedef enum _pdm_hwvad_zcd_result -{ - kPDM_HwvadResultOREnergyBasedDetection = - 0U, /*!< zero cross detector result will be OR with energy based detection */ - kPDM_HwvadResultANDEnergyBasedDetection = - 1U, /*!< zero cross detector result will be AND with energy based detection */ -} pdm_hwvad_zcd_result_t; - -/*! @brief PDM voice activity detector zero cross detector configuration structure */ -typedef struct _pdm_hwvad_zero_cross_detector -{ - bool enableAutoThreshold; /*!< If ZCD auto-threshold enabled, true means enabled. */ - pdm_hwvad_zcd_result_t zcdAnd; /*!< Is ZCD result is AND'ed with energy-based detection, false means OR'ed */ - uint32_t threshold; /*!< The adjustment value of the noise filter */ - uint32_t adjustmentThreshold; /*!< Gain value for the noise energy or envelope estimated */ -} pdm_hwvad_zero_cross_detector_t; -#endif - -/*! @brief PDM SDMA transfer structure */ -typedef struct _pdm_transfer -{ - volatile uint8_t *data; /*!< Data start address to transfer. */ - volatile size_t dataSize; /*!< Total Transfer bytes size. */ -} pdm_transfer_t; - -/*! @brief PDM handle */ -typedef struct _pdm_handle pdm_handle_t; - -/*! @brief PDM transfer callback prototype */ -typedef void (*pdm_transfer_callback_t)(PDM_Type *base, pdm_handle_t *handle, status_t status, void *userData); - -#if !(defined(FSL_FEATURE_PDM_HAS_NO_HWVAD) && FSL_FEATURE_PDM_HAS_NO_HWVAD) -/*! @brief PDM HWVAD callback prototype */ -typedef void (*pdm_hwvad_callback_t)(status_t status, void *userData); -/*! @brief PDM HWVAD notification structure */ -typedef struct _pdm_hwvad_notification -{ - pdm_hwvad_callback_t callback; - void *userData; -} pdm_hwvad_notification_t; -#endif - -/*! @brief PDM handle structure */ -struct _pdm_handle -{ - uint32_t state; /*!< Transfer status */ - pdm_transfer_callback_t callback; /*!< Callback function called at transfer event*/ - void *userData; /*!< Callback parameter passed to callback function*/ - - pdm_transfer_t pdmQueue[PDM_XFER_QUEUE_SIZE]; /*!< Transfer queue storing queued transfer */ - size_t transferSize[PDM_XFER_QUEUE_SIZE]; /*!< Data bytes need to transfer */ - volatile uint8_t queueUser; /*!< Index for user to queue transfer */ - volatile uint8_t queueDriver; /*!< Index for driver to get the transfer data and size */ - - uint32_t format; /*!< data format */ - uint8_t watermark; /*!< Watermark value */ - uint8_t startChannel; /*!< end channel */ - uint8_t channelNums; /*!< Enabled channel number */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus*/ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Initializes the PDM peripheral. - * - * Ungates the PDM clock, resets the module, and configures PDM with a configuration structure. - * The configuration structure can be custom filled or set with default values by - * PDM_GetDefaultConfig(). - * - * @note This API should be called at the beginning of the application to use - * the PDM driver. Otherwise, accessing the PDM module can cause a hard fault - * because the clock is not enabled. - * - * @param base PDM base pointer - * @param config PDM configuration structure. - */ -void PDM_Init(PDM_Type *base, const pdm_config_t *config); - -/*! - * @brief De-initializes the PDM peripheral. - * - * This API gates the PDM clock. The PDM module can't operate unless PDM_Init - * is called to enable the clock. - * - * @param base PDM base pointer - */ -void PDM_Deinit(PDM_Type *base); - -/*! - * @brief Resets the PDM module. - * - * @param base PDM base pointer - */ -static inline void PDM_Reset(PDM_Type *base) -{ - base->CTRL_1 |= PDM_CTRL_1_SRES_MASK; -} - -/*! - * @brief Enables/disables PDM interface. - * - * @param base PDM base pointer - * @param enable True means PDM interface is enabled, false means PDM interface is disabled. - */ -static inline void PDM_Enable(PDM_Type *base, bool enable) -{ - if (enable) - { - base->CTRL_1 |= PDM_CTRL_1_PDMIEN_MASK; - } - else - { - base->CTRL_1 &= ~PDM_CTRL_1_PDMIEN_MASK; - } -} - -#if !(defined(FSL_FEATURE_PDM_HAS_NO_DOZEN) && FSL_FEATURE_PDM_HAS_NO_DOZEN) -/*! - * @brief Enables/disables DOZE. - * - * @param base PDM base pointer - * @param enable True means the module will enter Disable/Low Leakage mode when ipg_doze is asserted, false means the - * module will not enter Disable/Low Leakage mode when ipg_doze is asserted. - */ -static inline void PDM_EnableDoze(PDM_Type *base, bool enable) -{ - if (enable) - { - base->CTRL_1 |= PDM_CTRL_1_DOZEN_MASK; - } - else - { - base->CTRL_1 &= ~PDM_CTRL_1_DOZEN_MASK; - } -} -#endif -/*! - * @brief Enables/disables debug mode for PDM. - * The PDM interface cannot enter debug mode once in Disable/Low Leakage or Low Power mode. - * @param base PDM base pointer - * @param enable True means PDM interface enter debug mode, false means PDM interface in normal mode. - */ -static inline void PDM_EnableDebugMode(PDM_Type *base, bool enable) -{ - if (enable) - { - base->CTRL_1 |= PDM_CTRL_1_DBG_MASK; - } - else - { - base->CTRL_1 &= ~PDM_CTRL_1_DBG_MASK; - } -} - -/*! - * @brief Enables/disables PDM interface in debug mode. - * - * @param base PDM base pointer - * @param enable True means PDM interface is enabled debug mode, false means PDM interface is disabled after - * after completing the current frame in debug mode. - */ -static inline void PDM_EnableInDebugMode(PDM_Type *base, bool enable) -{ - if (enable) - { - base->CTRL_1 |= PDM_CTRL_1_DBGE_MASK; - } - else - { - base->CTRL_1 &= ~PDM_CTRL_1_DBGE_MASK; - } -} - -/*! - * @brief Enables/disables PDM interface disable/Low Leakage mode. - * - * @param base PDM base pointer - * @param enable True means PDM interface is in disable/low leakage mode, False means PDM interface is in normal mode. - */ -static inline void PDM_EnterLowLeakageMode(PDM_Type *base, bool enable) -{ - if (enable) - { - base->CTRL_1 |= PDM_CTRL_1_MDIS_MASK; - } - else - { - base->CTRL_1 &= ~PDM_CTRL_1_MDIS_MASK; - } -} - -/*! - * @brief Enables/disables the PDM channel. - * - * @param base PDM base pointer - * @param channel PDM channel number need to enable or disable. - * @param enable True means enable PDM channel, false means disable. - */ -static inline void PDM_EnableChannel(PDM_Type *base, uint8_t channel, bool enable) -{ - if (enable) - { - base->CTRL_1 |= (1UL << channel); - } - else - { - base->CTRL_1 &= ~(1UL << channel); - } -} - -/*! - * @brief PDM one channel configurations. - * - * @param base PDM base pointer - * @param config PDM channel configurations. - * @param channel channel number. - * after completing the current frame in debug mode. - */ -void PDM_SetChannelConfig(PDM_Type *base, uint32_t channel, const pdm_channel_config_t *config); - -/*! - * @brief PDM set sample rate. - * - * @note This function is depend on the configuration of the PDM and PDM channel, so the correct call sequence is - * @code - * PDM_Init(base, pdmConfig) - * PDM_SetChannelConfig(base, channel, &channelConfig) - * PDM_SetSampleRateConfig(base, source, sampleRate) - * @endcode - * @param base PDM base pointer - * @param sourceClock_HZ PDM source clock frequency. - * @param sampleRate_HZ PDM sample rate. - */ -status_t PDM_SetSampleRateConfig(PDM_Type *base, uint32_t sourceClock_HZ, uint32_t sampleRate_HZ); - -/*! - * @brief PDM set sample rate. - * - * @deprecated Do not use this function. It has been superceded by @ref PDM_SetSampleRateConfig - * @param base PDM base pointer - * @param enableChannelMask PDM channel enable mask. - * @param qualityMode quality mode. - * @param osr cic oversample rate - * @param clkDiv clock divider - */ -status_t PDM_SetSampleRate( - PDM_Type *base, uint32_t enableChannelMask, pdm_df_quality_mode_t qualityMode, uint8_t osr, uint32_t clkDiv); - -/*! - * @brief Get the instance number for PDM. - * - * @param base PDM base pointer. - */ -uint32_t PDM_GetInstance(PDM_Type *base); -/*! @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets the PDM internal status flag. - * Use the Status Mask in _pdm_internal_status to get the status value needed - * @param base PDM base pointer - * @return PDM status flag value. - */ -static inline uint32_t PDM_GetStatus(PDM_Type *base) -{ - return base->STAT; -} - -/*! - * @brief Gets the PDM FIFO status flag. - * Use the Status Mask in _pdm_fifo_status to get the status value needed - * @param base PDM base pointer - * @return FIFO status. - */ -static inline uint32_t PDM_GetFifoStatus(PDM_Type *base) -{ - return base->FIFO_STAT; -} - -#if defined(FSL_FEATURE_PDM_HAS_RANGE_CTRL) && FSL_FEATURE_PDM_HAS_RANGE_CTRL -/*! - * @brief Gets the PDM Range status flag. - * Use the Status Mask in _pdm_range_status to get the status value needed - * @param base PDM base pointer - * @return output status. - */ -static inline uint32_t PDM_GetRangeStatus(PDM_Type *base) -{ - return base->RANGE_STAT; -} -#else -/*! - * @brief Gets the PDM output status flag. - * Use the Status Mask in _pdm_output_status to get the status value needed - * @param base PDM base pointer - * @return output status. - */ -static inline uint32_t PDM_GetOutputStatus(PDM_Type *base) -{ - return base->OUT_STAT; -} -#endif - -/*! - * @brief Clears the PDM Tx status. - * - * @param base PDM base pointer - * @param mask State mask. It can be a combination of the status between kPDM_StatusFrequencyLow and - * kPDM_StatusCh7FifoDataAvaliable. - */ -static inline void PDM_ClearStatus(PDM_Type *base, uint32_t mask) -{ - base->STAT = mask; -} - -/*! - * @brief Clears the PDM Tx status. - * - * @param base PDM base pointer - * @param mask State mask.It can be a combination of the status in _pdm_fifo_status. - */ -static inline void PDM_ClearFIFOStatus(PDM_Type *base, uint32_t mask) -{ - base->FIFO_STAT = mask; -} - -#if defined(FSL_FEATURE_PDM_HAS_RANGE_CTRL) && FSL_FEATURE_PDM_HAS_RANGE_CTRL -/*! - * @brief Clears the PDM range status. - * - * @param base PDM base pointer - * @param mask State mask. It can be a combination of the status in _pdm_range_status. - */ -static inline void PDM_ClearRangeStatus(PDM_Type *base, uint32_t mask) -{ - base->RANGE_STAT = mask; -} -#else -/*! - * @brief Clears the PDM output status. - * - * @param base PDM base pointer - * @param mask State mask. It can be a combination of the status in _pdm_output_status. - */ -static inline void PDM_ClearOutputStatus(PDM_Type *base, uint32_t mask) -{ - base->OUT_STAT = mask; -} -#endif - -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables the PDM interrupt requests. - * - * @param base PDM base pointer - * @param mask interrupt source - * The parameter can be a combination of the following sources if defined. - * @arg kPDM_ErrorInterruptEnable - * @arg kPDM_FIFOInterruptEnable - */ -void PDM_EnableInterrupts(PDM_Type *base, uint32_t mask); - -/*! - * @brief Disables the PDM interrupt requests. - * - * @param base PDM base pointer - * @param mask interrupt source - * The parameter can be a combination of the following sources if defined. - * @arg kPDM_ErrorInterruptEnable - * @arg kPDM_FIFOInterruptEnable - */ -static inline void PDM_DisableInterrupts(PDM_Type *base, uint32_t mask) -{ - base->CTRL_1 &= ~mask; -} - -/*! @} */ - -/*! - * @name DMA Control - * @{ - */ - -/*! - * @brief Enables/disables the PDM DMA requests. - * - * @param base PDM base pointer - * @param enable True means enable DMA, false means disable DMA. - */ -static inline void PDM_EnableDMA(PDM_Type *base, bool enable) -{ - if (enable) - { - base->CTRL_1 = (base->CTRL_1 & (~PDM_CTRL_1_DISEL_MASK)) | PDM_CTRL_1_DISEL(0x1U); - } - else - { - base->CTRL_1 &= ~PDM_CTRL_1_DISEL_MASK; - } -} - -/*! - * @brief Gets the PDM data register address. - * - * This API is used to provide a transfer address for the PDM DMA transfer configuration. - * - * @param base PDM base pointer. - * @param channel Which data channel used. - * @return data register address. - */ -static inline uint32_t PDM_GetDataRegisterAddress(PDM_Type *base, uint32_t channel) -{ - return (uint32_t)(&(base->DATACH)[channel]); -} - -/*! @} */ - -/*! - * @name Bus Operations - * @{ - */ -#if defined(FSL_FEATURE_PDM_FIFO_WIDTH) && (FSL_FEATURE_PDM_FIFO_WIDTH == 2U) -/*! - * @brief Reads data from the PDM FIFO. - * - * @param base PDM base pointer. - * @param channel Data channel used. - * @return Data in PDM FIFO. - */ -static inline int16_t PDM_ReadData(PDM_Type *base, uint32_t channel) -{ - return (int16_t)(base->DATACH[channel]); -} - -/*! - * @brief PDM read data non blocking. - * So the actually read data byte size in this function is (size * 2 * channelNums). - * @param base PDM base pointer. - * @param startChannel start channel number. - * @param channelNums total enabled channelnums. - * @param buffer received buffer address. - * @param size number of 16bit data to read. - */ -void PDM_ReadNonBlocking(PDM_Type *base, uint32_t startChannel, uint32_t channelNums, int16_t *buffer, size_t size); -#endif - -/*! - * @brief PDM read fifo. - * @note: This function support 16 bit only for IP version that only supports 16bit. - * - * @param base PDM base pointer. - * @param startChannel start channel number. - * @param channelNums total enabled channelnums. - * @param buffer received buffer address. - * @param size number of samples to read. - * @param dataWidth sample width. - */ -void PDM_ReadFifo( - PDM_Type *base, uint32_t startChannel, uint32_t channelNums, void *buffer, size_t size, uint32_t dataWidth); - -#if defined(FSL_FEATURE_PDM_FIFO_WIDTH) && (FSL_FEATURE_PDM_FIFO_WIDTH == 4U) -/*! - * @brief Reads data from the PDM FIFO. - * - * @param base PDM base pointer. - * @param channel Data channel used. - * @return Data in PDM FIFO. - */ -static inline uint32_t PDM_ReadData(PDM_Type *base, uint32_t channel) -{ - return base->DATACH[channel]; -} -#endif - -/*! - * @brief Set the PDM channel gain. - * - * Please note for different quality mode, the valid gain value is different, reference RM for detail. - * @param base PDM base pointer. - * @param channel PDM channel index. - * @param gain channel gain, the register gain value range is 0 - 15. - */ -void PDM_SetChannelGain(PDM_Type *base, uint32_t channel, pdm_df_output_gain_t gain); - -#if !(defined(FSL_FEATURE_PDM_HAS_NO_HWVAD) && FSL_FEATURE_PDM_HAS_NO_HWVAD) -/*! @} */ - -/*! - * @name Voice Activity Detector - * @{ - */ - -/*! - * @brief Configure voice activity detector. - * - * @param base PDM base pointer - * @param config Voice activity detector configure structure pointer . - */ -void PDM_SetHwvadConfig(PDM_Type *base, const pdm_hwvad_config_t *config); - -/*! - * @brief PDM hwvad force output disable. - * - * @param base PDM base pointer - * @param enable true is output force disable, false is output not force. - */ -static inline void PDM_ForceHwvadOutputDisable(PDM_Type *base, bool enable) -{ - if (enable) - { - base->VAD0_CTRL_2 &= ~PDM_VAD0_CTRL_2_VADFOUTDIS_MASK; - } - else - { - base->VAD0_CTRL_2 |= PDM_VAD0_CTRL_2_VADFOUTDIS_MASK; - } -} - -/*! - * @brief PDM hwvad reset. - * It will reset VADNDATA register and will clean all internal buffers, should be called when the PDM isn't running. - * - * @param base PDM base pointer - */ -static inline void PDM_ResetHwvad(PDM_Type *base) -{ - base->VAD0_CTRL_1 |= PDM_VAD0_CTRL_1_VADRST_MASK; -} -/*! - * @brief Enable/Disable Voice activity detector. - * Should be called when the PDM isn't running. - * @param base PDM base pointer. - * @param enable True means enable voice activity detector, false means disable. - */ -static inline void PDM_EnableHwvad(PDM_Type *base, bool enable) -{ - if (enable) - { - base->VAD0_CTRL_1 |= PDM_VAD0_CTRL_1_VADEN_MASK; - } - else - { - base->VAD0_CTRL_1 &= ~PDM_VAD0_CTRL_1_VADEN_MASK; - } -} - -/*! - * @brief Enables the PDM Voice Detector interrupt requests. - * - * @param base PDM base pointer - * @param mask interrupt source - * The parameter can be a combination of the following sources if defined. - * @arg kPDM_HWVADErrorInterruptEnable - * @arg kPDM_HWVADInterruptEnable - */ -static inline void PDM_EnableHwvadInterrupts(PDM_Type *base, uint32_t mask) -{ - base->VAD0_CTRL_1 |= mask; -} - -/*! - * @brief Disables the PDM Voice Detector interrupt requests. - * - * @param base PDM base pointer - * @param mask interrupt source - * The parameter can be a combination of the following sources if defined. - * @arg kPDM_HWVADErrorInterruptEnable - * @arg kPDM_HWVADInterruptEnable - */ -static inline void PDM_DisableHwvadInterrupts(PDM_Type *base, uint32_t mask) -{ - base->VAD0_CTRL_1 &= ~mask; -} - -/*! - * @brief Clears the PDM voice activity detector status flags. - * - * @param base PDM base pointer - * @param mask State mask,reference _pdm_hwvad_int_status. - */ -static inline void PDM_ClearHwvadInterruptStatusFlags(PDM_Type *base, uint32_t mask) -{ - base->VAD0_STAT = mask; -} - -/*! - * @brief Clears the PDM voice activity detector status flags. - * - * @param base PDM base pointer - * @return status, reference _pdm_hwvad_int_status - */ -static inline uint32_t PDM_GetHwvadInterruptStatusFlags(PDM_Type *base) -{ - return base->VAD0_STAT & (PDM_VAD0_STAT_VADIF_MASK | PDM_VAD0_STAT_VADINSATF_MASK); -} - -/*! - * @brief Get the PDM voice activity detector initial flags. - * - * @param base PDM base pointer - * @return initial flag. - */ -static inline uint32_t PDM_GetHwvadInitialFlag(PDM_Type *base) -{ - return base->VAD0_STAT & PDM_VAD0_STAT_VADINITF_MASK; -} - -#if !(defined(FSL_FEATURE_PDM_HAS_NO_VADEF) && (FSL_FEATURE_PDM_HAS_NO_VADEF)) -/*! - * @brief Get the PDM voice activity detector voice detected flags. - * NOte: this flag is auto cleared when voice gone. - * @param base PDM base pointer - * @return voice detected flag. - */ -static inline uint32_t PDM_GetHwvadVoiceDetectedFlag(PDM_Type *base) -{ - return base->VAD0_STAT & PDM_VAD0_STAT_VADEF_MASK; -} -#endif - -/*! - * @brief Enables/disables voice activity detector signal filter. - * - * @param base PDM base pointer - * @param enable True means enable signal filter, false means disable. - */ -static inline void PDM_EnableHwvadSignalFilter(PDM_Type *base, bool enable) -{ - if (enable) - { - base->VAD0_SCONFIG |= PDM_VAD0_SCONFIG_VADSFILEN_MASK; - } - else - { - base->VAD0_SCONFIG &= ~PDM_VAD0_SCONFIG_VADSFILEN_MASK; - } -} - -/*! - * @brief Configure voice activity detector signal filter. - * - * @param base PDM base pointer - * @param enableMaxBlock If signal maximum block enabled. - * @param signalGain Gain value for the signal energy. - */ -void PDM_SetHwvadSignalFilterConfig(PDM_Type *base, bool enableMaxBlock, uint32_t signalGain); - -/*! - * @brief Configure voice activity detector noise filter. - * - * @param base PDM base pointer - * @param config Voice activity detector noise filter configure structure pointer . - */ -void PDM_SetHwvadNoiseFilterConfig(PDM_Type *base, const pdm_hwvad_noise_filter_t *config); - -/*! - * @brief Enables/disables voice activity detector zero cross detector. - * - * @param base PDM base pointer - * @param enable True means enable zero cross detector, false means disable. - */ -static inline void PDM_EnableHwvadZeroCrossDetector(PDM_Type *base, bool enable) -{ - if (enable) - { - base->VAD0_ZCD |= PDM_VAD0_ZCD_VADZCDEN_MASK; - } - else - { - base->VAD0_ZCD &= ~PDM_VAD0_ZCD_VADZCDEN_MASK; - } -} - -/*! - * @brief Configure voice activity detector zero cross detector. - * - * @param base PDM base pointer - * @param config Voice activity detector zero cross detector configure structure pointer . - */ -void PDM_SetHwvadZeroCrossDetectorConfig(PDM_Type *base, const pdm_hwvad_zero_cross_detector_t *config); - -/*! - * @brief Reads noise data. - * - * @param base PDM base pointer. - * @return Data in PDM noise data register. - */ -static inline uint16_t PDM_GetNoiseData(PDM_Type *base) -{ - return (uint16_t)base->VAD0_NDATA; -} - -/*! - * @brief set hwvad internal filter status . - * Note: filter initial status should be asserted for two more cycles, then set it to normal operation. - * @param base PDM base pointer. - * @param status internal filter status. - */ -static inline void PDM_SetHwvadInternalFilterStatus(PDM_Type *base, pdm_hwvad_filter_status_t status) -{ - base->VAD0_CTRL_1 = (base->VAD0_CTRL_1 & (~PDM_VAD0_CTRL_1_VADST10_MASK)) | (uint32_t)status; -} - -/*! - * @brief set HWVAD in envelope based mode . - * Recommand configurations, - * @code - * static const pdm_hwvad_config_t hwvadConfig = { - * .channel = 0, - * .initializeTime = 10U, - * .cicOverSampleRate = 0U, - * .inputGain = 0U, - * .frameTime = 10U, - * .cutOffFreq = kPDM_HwvadHpfBypassed, - * .enableFrameEnergy = false, - * .enablePreFilter = true, -}; - - * static const pdm_hwvad_noise_filter_t noiseFilterConfig = { - * .enableAutoNoiseFilter = false, - * .enableNoiseMin = true, - * .enableNoiseDecimation = true, - * .noiseFilterAdjustment = 0U, - * .noiseGain = 7U, - * .enableNoiseDetectOR = true, - * }; - * @endcode - * @param base PDM base pointer. - * @param hwvadConfig internal filter status. - * @param noiseConfig Voice activity detector noise filter configure structure pointer. - * @param zcdConfig Voice activity detector zero cross detector configure structure pointer . - * @param signalGain signal gain value. - */ -void PDM_SetHwvadInEnvelopeBasedMode(PDM_Type *base, - const pdm_hwvad_config_t *hwvadConfig, - const pdm_hwvad_noise_filter_t *noiseConfig, - const pdm_hwvad_zero_cross_detector_t *zcdConfig, - uint32_t signalGain); - -/*! - * brief set HWVAD in energy based mode . - * Recommand configurations, - * code - * static const pdm_hwvad_config_t hwvadConfig = { - * .channel = 0, - * .initializeTime = 10U, - * .cicOverSampleRate = 0U, - * .inputGain = 0U, - * .frameTime = 10U, - * .cutOffFreq = kPDM_HwvadHpfBypassed, - * .enableFrameEnergy = true, - * .enablePreFilter = true, -}; - - * static const pdm_hwvad_noise_filter_t noiseFilterConfig = { - * .enableAutoNoiseFilter = true, - * .enableNoiseMin = false, - * .enableNoiseDecimation = false, - * .noiseFilterAdjustment = 0U, - * .noiseGain = 7U, - * .enableNoiseDetectOR = false, - * }; - * code - * param base PDM base pointer. - * param hwvadConfig internal filter status. - * param noiseConfig Voice activity detector noise filter configure structure pointer. - * param zcdConfig Voice activity detector zero cross detector configure structure pointer . - * param signalGain signal gain value, signal gain value should be properly according to application. - */ -void PDM_SetHwvadInEnergyBasedMode(PDM_Type *base, - const pdm_hwvad_config_t *hwvadConfig, - const pdm_hwvad_noise_filter_t *noiseConfig, - const pdm_hwvad_zero_cross_detector_t *zcdConfig, - uint32_t signalGain); - -/*! - * @brief Enable/Disable hwvad callback. - - * This function enable/disable the hwvad interrupt for the selected PDM peripheral. - * - * @param base Base address of the PDM peripheral. - * @param vadCallback callback Pointer to store callback function, should be NULL when disable. - * @param userData user data. - * @param enable true is enable, false is disable. - * @retval None. - */ -void PDM_EnableHwvadInterruptCallback(PDM_Type *base, pdm_hwvad_callback_t vadCallback, void *userData, bool enable); -/*! @} */ -#endif - -/*! - * @name Transactional - * @{ - */ - -/*! - * @brief Initializes the PDM handle. - * - * This function initializes the handle for the PDM transactional APIs. Call - * this function once to get the handle initialized. - * - * @param base PDM base pointer. - * @param handle PDM handle pointer. - * @param callback Pointer to the user callback function. - * @param userData User parameter passed to the callback function. - */ -void PDM_TransferCreateHandle(PDM_Type *base, pdm_handle_t *handle, pdm_transfer_callback_t callback, void *userData); - -/*! - * @brief PDM set channel transfer config. - * - * @param base PDM base pointer. - * @param handle PDM handle pointer. - * @param channel PDM channel. - * @param config channel config. - * @param format data format, support data width configurations,_pdm_data_width. - * @retval kStatus_PDM_ChannelConfig_Failed or kStatus_Success. - */ -status_t PDM_TransferSetChannelConfig( - PDM_Type *base, pdm_handle_t *handle, uint32_t channel, const pdm_channel_config_t *config, uint32_t format); - -/*! - * @brief Performs an interrupt non-blocking receive transfer on PDM. - * - * @note This API returns immediately after the transfer initiates. - * Call the PDM_RxGetTransferStatusIRQ to poll the transfer status and check whether - * the transfer is finished. If the return status is not kStatus_PDM_Busy, the transfer - * is finished. - * - * @param base PDM base pointer - * @param handle Pointer to the pdm_handle_t structure which stores the transfer state. - * @param xfer Pointer to the pdm_transfer_t structure. - * @retval kStatus_Success Successfully started the data receive. - * @retval kStatus_PDM_Busy Previous receive still not finished. - */ -status_t PDM_TransferReceiveNonBlocking(PDM_Type *base, pdm_handle_t *handle, pdm_transfer_t *xfer); - -/*! - * @brief Aborts the current IRQ receive. - * - * @note This API can be called when an interrupt non-blocking transfer initiates - * to abort the transfer early. - * - * @param base PDM base pointer - * @param handle Pointer to the pdm_handle_t structure which stores the transfer state. - */ -void PDM_TransferAbortReceive(PDM_Type *base, pdm_handle_t *handle); - -/*! - * @brief Tx interrupt handler. - * - * @param base PDM base pointer. - * @param handle Pointer to the pdm_handle_t structure. - */ -void PDM_TransferHandleIRQ(PDM_Type *base, pdm_handle_t *handle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /*_cplusplus*/ - -/*! @} */ - -#endif /* FSL_PDM_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_pdm_edma.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_pdm_edma.c deleted file mode 100644 index 3c8104b5f3a..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_pdm_edma.c +++ /dev/null @@ -1,459 +0,0 @@ -/* - * Copyright 2019 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_pdm_edma.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.pdm_edma" -#endif - -/******************************************************************************* - * Definitations - ******************************************************************************/ -/* Used for 32byte aligned */ -#define STCD_ADDR(address) (edma_tcd_t *)(((uint32_t)(address) + 32) & ~0x1FU) - -/*handle; - - if (!(pdmHandle->isLoopTransfer)) - { - (void)memset(&pdmHandle->tcd[pdmHandle->tcdDriver], 0, sizeof(edma_tcd_t)); - pdmHandle->tcdDriver = (pdmHandle->tcdDriver + 1U) % pdmHandle->tcdNum; - } - - pdmHandle->receivedBytes += - pdmHandle->tcd[pdmHandle->tcdDriver].BITER * (pdmHandle->tcd[pdmHandle->tcdDriver].NBYTES & 0x3FFU); - - /* If finished a block, call the callback function */ - if (pdmHandle->callback != NULL) - { - (pdmHandle->callback)(privHandle->base, pdmHandle, kStatus_PDM_Idle, pdmHandle->userData); - } - - pdmHandle->tcdUsedNum--; - /* If all data finished, just stop the transfer */ - if ((pdmHandle->tcdUsedNum == 0U) && !(pdmHandle->isLoopTransfer)) - { - /* Disable DMA enable bit */ - PDM_EnableDMA(privHandle->base, false); - EDMA_AbortTransfer(handle); - } -} - -/*! - * brief Initializes the PDM Rx eDMA handle. - * - * This function initializes the PDM slave DMA handle, which can be used for other PDM master transactional APIs. - * Usually, for a specified PDM instance, call this API once to get the initialized handle. - * - * param base PDM base pointer. - * param handle PDM eDMA handle pointer. - * param base PDM peripheral base address. - * param callback Pointer to user callback function. - * param userData User parameter passed to the callback function. - * param dmaHandle eDMA handle pointer, this handle shall be static allocated by users. - */ -void PDM_TransferCreateHandleEDMA( - PDM_Type *base, pdm_edma_handle_t *handle, pdm_edma_callback_t callback, void *userData, edma_handle_t *dmaHandle) -{ - assert((handle != NULL) && (dmaHandle != NULL)); - - uint32_t instance = PDM_GetInstance(base); - - /* Zero the handle */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Set pdm base to handle */ - handle->dmaHandle = dmaHandle; - handle->callback = callback; - handle->userData = userData; - - /* Set PDM state to idle */ - handle->state = (uint32_t)kPDM_Idle; - - s_edmaPrivateHandle[instance].base = base; - s_edmaPrivateHandle[instance].handle = handle; - - /* Install callback for Tx dma channel */ - EDMA_SetCallback(dmaHandle, PDM_EDMACallback, &s_edmaPrivateHandle[instance]); -} - -/*! - * brief Initializes the multi PDM channel interleave type. - * - * This function initializes the PDM DMA handle member interleaveType, it shall be called only when application would - * like to use type kPDM_EDMAMultiChannelInterleavePerChannelBlock, since the default interleaveType is - * kPDM_EDMAMultiChannelInterleavePerChannelSample always - * - * param handle PDM eDMA handle pointer. - * param multiChannelInterleaveType Multi channel interleave type. - */ -void PDM_TransferSetMultiChannelInterleaveType(pdm_edma_handle_t *handle, - pdm_edma_multi_channel_interleave_t multiChannelInterleaveType) -{ - handle->interleaveType = multiChannelInterleaveType; -} - -/*! - * brief Install EDMA descriptor memory. - * - * param handle Pointer to EDMA channel transfer handle. - * param tcdAddr EDMA head descriptor address. - * param tcdNum EDMA link descriptor address. - */ -void PDM_TransferInstallEDMATCDMemory(pdm_edma_handle_t *handle, void *tcdAddr, size_t tcdNum) -{ - assert(handle != NULL); - - handle->tcd = (edma_tcd_t *)tcdAddr; - handle->tcdNum = tcdNum; -} - -/*! - * brief Configures the PDM channel. - * - * param base PDM base pointer. - * param handle PDM eDMA handle pointer. - * param channel channel index. - * param pdmConfig pdm channel configurations. - */ -void PDM_TransferSetChannelConfigEDMA(PDM_Type *base, - pdm_edma_handle_t *handle, - uint32_t channel, - const pdm_channel_config_t *config) -{ - assert((handle != NULL) && (config != NULL)); - assert(channel < (uint32_t)FSL_FEATURE_PDM_CHANNEL_NUM); - - /* Configure the PDM channel */ - PDM_SetChannelConfig(base, channel, config); - - /* record end channel number */ - handle->endChannel = (uint8_t)channel; - /* increase totoal enabled channel number */ - handle->channelNums++; - /* increase count pre channel numbers */ - handle->count = (uint8_t)(base->FIFO_CTRL & PDM_FIFO_CTRL_FIFOWMK_MASK); -} - -/*! - * brief Performs a non-blocking PDM receive using eDMA. - * - * note This interface returns immediately after the transfer initiates. Call - * the PDM_GetReceiveRemainingBytes to poll the transfer status and check whether the PDM transfer is finished. - * - * 1. Scatter gather case: - * This functio support dynamic scatter gather and staic scatter gather, - * a. for the dynamic scatter gather case: - * Application should call PDM_TransferReceiveEDMA function continuously to make sure new receive request is submit - *before the previous one finish. b. for the static scatter gather case: Application should use the link transfer - *feature and make sure a loop link transfer is provided, such as: code pdm_edma_transfer_t pdmXfer[2] = - * { - * { - * .data = s_buffer, - * .dataSize = BUFFER_SIZE, - * .linkTransfer = &pdmXfer[1], - * }, - * - * { - * .data = &s_buffer[BUFFER_SIZE], - * .dataSize = BUFFER_SIZE, - * .linkTransfer = &pdmXfer[0] - * }, - * }; - *endcode - * - * 2. Multi channel case: - * This function support receive multi pdm channel data, for example, if two channel is requested, - * code - * PDM_TransferSetChannelConfigEDMA(DEMO_PDM, &s_pdmRxHandle_0, DEMO_PDM_ENABLE_CHANNEL_0, &channelConfig); - * PDM_TransferSetChannelConfigEDMA(DEMO_PDM, &s_pdmRxHandle_0, DEMO_PDM_ENABLE_CHANNEL_1, &channelConfig); - * PDM_TransferReceiveEDMA(DEMO_PDM, &s_pdmRxHandle_0, pdmXfer); - * endcode - * The output data will be formatted as below if handle->interleaveType = - *kPDM_EDMAMultiChannelInterleavePerChannelSample : - * ------------------------------------------------------------------------- - * |CHANNEL0 | CHANNEL1 | CHANNEL0 | CHANNEL1 | CHANNEL0 | CHANNEL 1 | ....| - * ------------------------------------------------------------------------- - * - * The output data will be formatted as below if handle->interleaveType = kPDM_EDMAMultiChannelInterleavePerChannelBlock - *: - * ---------------------------------------------------------------------------------------------------------------------- - * |CHANNEL3 | CHANNEL3 | CHANNEL3 | .... | CHANNEL4 | CHANNEL 4 | CHANNEL4 |....| CHANNEL5 | CHANNEL 5 | CHANNEL5 - *|....| - * ---------------------------------------------------------------------------------------------------------------------- - * Note: the dataSize of xfer is the total data size, while application using - * kPDM_EDMAMultiChannelInterleavePerChannelBlock, the buffer size for each PDM channel is channelSize = dataSize / - * channelNums, there are limitation for this feature, - * 1. For 3 DMIC array: the dataSize shall be 4 * (channelSize) - * The addtional buffer is mandantory for edma modulo feature. - * 2. The kPDM_EDMAMultiChannelInterleavePerChannelBlock feature support below dmic array only, - * 2 DMIC array: CHANNEL3, CHANNEL4 - * 3 DMIC array: CHANNEL3, CHANNEL4, CHANNEL5 - * 4 DMIC array: CHANNEL3, CHANNEL4, CHANNEL5, CHANNEL6 - * Any other combinations is not support, that is to SAY, THE FEATURE SUPPORT RECEIVE START FROM CHANNEL3 ONLY AND 4 - * MAXIMUM DMIC CHANNELS. - * - * param base PDM base pointer - * param handle PDM eDMA handle pointer. - * param xfer Pointer to DMA transfer structure. - * retval kStatus_Success Start a PDM eDMA receive successfully. - * retval kStatus_InvalidArgument The input argument is invalid. - * retval kStatus_RxBusy PDM is busy receiving data. - */ -status_t PDM_TransferReceiveEDMA(PDM_Type *base, pdm_edma_handle_t *handle, pdm_edma_transfer_t *xfer) -{ - assert((handle != NULL) && (xfer != NULL)); - - edma_transfer_config_t config = {0}; - uint32_t startAddr = PDM_GetDataRegisterAddress(base, handle->endChannel - (handle->channelNums - 1UL)); - pdm_edma_transfer_t *currentTransfer = xfer; - uint32_t nextTcdIndex = 0U, tcdIndex = handle->tcdUser, destOffset = FSL_FEATURE_PDM_FIFO_WIDTH; - uint32_t mappedChannel = handle->channelNums; - edma_modulo_t modulo = kEDMA_ModuloDisable; - /* minor offset used for channel sample interleave transfer */ - edma_minor_offset_config_t minorOffset = { - .enableSrcMinorOffset = true, - .enableDestMinorOffset = false, - .minorOffset = 0xFFFFFU - mappedChannel * (uint32_t)FSL_FEATURE_PDM_FIFO_OFFSET + 1U}; - - /* Check if input parameter invalid */ - if ((xfer->data == NULL) || (xfer->dataSize == 0U)) - { - return kStatus_InvalidArgument; - } - - if ((handle->interleaveType == kPDM_EDMAMultiChannelInterleavePerChannelBlock) && (mappedChannel > 1U)) - { - /* Limitation of the feature, reference the API comments */ - if (((startAddr & 0xFU) != 0U) || (mappedChannel > 4U)) - { - return kStatus_InvalidArgument; - } - modulo = PDM_TransferMappingChannel(&mappedChannel); - if ((xfer->dataSize % mappedChannel) != 0U) - { - return kStatus_InvalidArgument; - } - destOffset = xfer->dataSize / mappedChannel; - /* reconfigure the minor loop offset for channel block interleave */ - minorOffset.enableSrcMinorOffset = false, minorOffset.enableDestMinorOffset = true, - minorOffset.minorOffset = - 0xFFFFFU - mappedChannel * (uint32_t)destOffset + (uint32_t)FSL_FEATURE_PDM_FIFO_WIDTH + 1U; - } - - while (currentTransfer != NULL) - { - if (handle->tcdUsedNum >= handle->tcdNum) - { - return kStatus_PDM_QueueFull; - } - else - { - uint32_t primask = DisableGlobalIRQ(); - handle->tcdUsedNum++; - EnableGlobalIRQ(primask); - } - - nextTcdIndex = (handle->tcdUser + 1U) % handle->tcdNum; - - if (mappedChannel == 1U) - { - EDMA_PrepareTransferConfig(&config, (void *)(uint32_t *)startAddr, FSL_FEATURE_PDM_FIFO_WIDTH, 0, - (uint8_t *)(uint32_t)currentTransfer->data, FSL_FEATURE_PDM_FIFO_WIDTH, - FSL_FEATURE_PDM_FIFO_WIDTH, handle->count * (uint32_t)FSL_FEATURE_PDM_FIFO_WIDTH, - currentTransfer->dataSize); - } - else - { - EDMA_PrepareTransferConfig(&config, (void *)(uint32_t *)startAddr, FSL_FEATURE_PDM_FIFO_WIDTH, - FSL_FEATURE_PDM_FIFO_OFFSET, (uint8_t *)(uint32_t)currentTransfer->data, - FSL_FEATURE_PDM_FIFO_WIDTH, (int16_t)destOffset, - mappedChannel * (uint32_t)FSL_FEATURE_PDM_FIFO_WIDTH, currentTransfer->dataSize); - } - - EDMA_TcdSetTransferConfig((edma_tcd_t *)&handle->tcd[handle->tcdUser], &config, - (edma_tcd_t *)&handle->tcd[nextTcdIndex]); - - if (mappedChannel > 1U) - { - EDMA_TcdSetMinorOffsetConfig((edma_tcd_t *)&handle->tcd[handle->tcdUser], &minorOffset); - - if (handle->interleaveType == kPDM_EDMAMultiChannelInterleavePerChannelBlock) - { - EDMA_TcdSetModulo((edma_tcd_t *)&handle->tcd[handle->tcdUser], modulo, kEDMA_ModuloDisable); - } - } - - EDMA_TcdEnableInterrupts((edma_tcd_t *)&handle->tcd[handle->tcdUser], (uint32_t)kEDMA_MajorInterruptEnable); - - handle->tcdUser = nextTcdIndex; - - currentTransfer = currentTransfer->linkTransfer; - - if (currentTransfer == xfer) - { - handle->isLoopTransfer = true; - break; - } - } - - if (handle->state != (uint32_t)kPDM_Busy) - { - EDMA_InstallTCD(handle->dmaHandle->base, handle->dmaHandle->channel, (edma_tcd_t *)&handle->tcd[tcdIndex]); - /* Start DMA transfer */ - EDMA_StartTransfer(handle->dmaHandle); - - /* Enable DMA enable bit */ - PDM_EnableDMA(base, true); - /* enable PDM */ - PDM_Enable(base, true); - - handle->state = (uint32_t)kPDM_Busy; - } - - return kStatus_Success; -} - -/*! - * brief Aborts a PDM receive using eDMA. - * - * This function only aborts the current transfer slots, the other transfer slots' information still kept - * in the handler. If users want to terminate all transfer slots, just call PDM_TransferTerminateReceiveEDMA. - * - * param base PDM base pointer - * param handle PDM eDMA handle pointer. - */ -void PDM_TransferAbortReceiveEDMA(PDM_Type *base, pdm_edma_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable dma */ - EDMA_AbortTransfer(handle->dmaHandle); - - /* Disable DMA enable bit */ - PDM_EnableDMA(base, false); - - /* Disable PDM */ - PDM_Enable(base, false); - - /* Handle the queue index */ - handle->tcdUsedNum--; - - /* Set the handle state */ - handle->state = (uint32_t)kPDM_Idle; -} - -/*! - * brief Terminate all PDM receive. - * - * This function will clear all transfer slots buffered in the pdm queue. If users only want to abort the - * current transfer slot, please call PDM_TransferAbortReceiveEDMA. - * - * param base PDM base pointer. - * param handle PDM eDMA handle pointer. - */ -void PDM_TransferTerminateReceiveEDMA(PDM_Type *base, pdm_edma_handle_t *handle) -{ - assert(handle != NULL); - - /* Abort the current transfer */ - PDM_TransferAbortReceiveEDMA(base, handle); - - /* Clear all the internal information */ - (void)memset(handle->tcd, 0, sizeof(edma_tcd_t) * handle->tcdNum); - handle->tcdUser = 0U; - handle->tcdUsedNum = 0U; -} - -/*! - * brief Gets byte count received by PDM. - * - * param base PDM base pointer - * param handle PDM eDMA handle pointer. - * param count Bytes count received by PDM. - * retval kStatus_Success Succeed get the transfer count. - * retval kStatus_NoTransferInProgress There is no non-blocking transaction in progress. - */ -status_t PDM_TransferGetReceiveCountEDMA(PDM_Type *base, pdm_edma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - *count = handle->receivedBytes; - - return kStatus_Success; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_pdm_edma.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_pdm_edma.h deleted file mode 100644 index a1ca0442fab..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_pdm_edma.h +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Copyright 2019 - 2020, NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_PDM_EDMA_H_ -#define FSL_PDM_EDMA_H_ - -#include "fsl_edma.h" -#include "fsl_pdm.h" - -/*! - * @addtogroup pdm_edma PDM EDMA Driver - * @ingroup pdm - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -#define FSL_PDM_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 6, 1)) /*!< Version 2.6.1 */ -/*@}*/ - -/*! @brief PDM edma handler */ -typedef struct _pdm_edma_handle pdm_edma_handle_t; - -/*!@brief pdm multi channel interleave type */ -typedef enum _pdm_edma_multi_channel_interleave -{ - kPDM_EDMAMultiChannelInterleavePerChannelSample = - 0U, /*!< multi channel PDM data interleave per channel sample - * ------------------------------------------------------------------------- - * |CHANNEL0 | CHANNEL1 | CHANNEL0 | CHANNEL1 | CHANNEL0 | CHANNEL 1 | ....| - * ------------------------------------------------------------------------- - */ - kPDM_EDMAMultiChannelInterleavePerChannelBlock = - 1U, /*!< multi channel PDM data interleave per channel block - * ---------------------------------------------------------------------------------------------------------------------------- - * |CHANNEL0 | CHANNEL0 | CHANNEL0 | ...... | CHANNEL1 | CHANNEL 1 | CHANNEL 1 | ....| CHANNEL2 | CHANNEL 2 - * | CHANNEL 2 | ....| - * ---------------------------------------------------------------------------------------------------------------------------- - */ -} pdm_edma_multi_channel_interleave_t; - -/*! @brief PDM edma transfer */ -typedef struct _pdm_edma_transfer -{ - volatile uint8_t *data; /*!< Data start address to transfer. */ - volatile size_t dataSize; /*!< Total Transfer bytes size. */ - struct _pdm_edma_transfer *linkTransfer; /*!< linked transfer configurations */ -} pdm_edma_transfer_t; - -/*! @brief PDM eDMA transfer callback function for finish and error */ -typedef void (*pdm_edma_callback_t)(PDM_Type *base, pdm_edma_handle_t *handle, status_t status, void *userData); - -/*! @brief PDM DMA transfer handle, users should not touch the content of the handle.*/ -struct _pdm_edma_handle -{ - edma_handle_t *dmaHandle; /*!< DMA handler for PDM send */ - uint8_t count; /*!< The transfer data count in a DMA request */ - uint32_t receivedBytes; /*!< total transfer count */ - uint32_t state; /*!< Internal state for PDM eDMA transfer */ - pdm_edma_callback_t callback; /*!< Callback for users while transfer finish or error occurs */ - bool isLoopTransfer; /*!< loop transfer */ - void *userData; /*!< User callback parameter */ - edma_tcd_t *tcd; /*!< TCD pool for eDMA transfer. */ - uint32_t tcdNum; /*!< TCD number */ - uint32_t tcdUser; /*!< Index for user to queue transfer. */ - uint32_t tcdDriver; /*!< Index for driver to get the transfer data and size */ - volatile uint32_t tcdUsedNum; /*!< Index for user to queue transfer. */ - - pdm_edma_multi_channel_interleave_t interleaveType; /*!< multi channel transfer interleave type */ - - uint8_t endChannel; /*!< The last enabled channel */ - uint8_t channelNums; /*!< total channel numbers */ -}; - -/******************************************************************************* - * APIs - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name PDM eDMA Transactional - * @{ - */ - -/*! - * @brief Install EDMA descriptor memory. - * - * @param handle Pointer to EDMA channel transfer handle. - * @param tcdAddr EDMA head descriptor address. - * @param tcdNum EDMA link descriptor address. - */ -void PDM_TransferInstallEDMATCDMemory(pdm_edma_handle_t *handle, void *tcdAddr, size_t tcdNum); - -/*! - * @brief Initializes the PDM Rx eDMA handle. - * - * This function initializes the PDM slave DMA handle, which can be used for other PDM master transactional APIs. - * Usually, for a specified PDM instance, call this API once to get the initialized handle. - * - * @param base PDM base pointer. - * @param handle PDM eDMA handle pointer. - * @param callback Pointer to user callback function. - * @param userData User parameter passed to the callback function. - * @param dmaHandle eDMA handle pointer, this handle shall be static allocated by users. - */ -void PDM_TransferCreateHandleEDMA( - PDM_Type *base, pdm_edma_handle_t *handle, pdm_edma_callback_t callback, void *userData, edma_handle_t *dmaHandle); - -/*! - * @brief Initializes the multi PDM channel interleave type. - * - * This function initializes the PDM DMA handle member interleaveType, it shall be called only when application would - * like to use type kPDM_EDMAMultiChannelInterleavePerChannelBlock, since the default interleaveType is - * kPDM_EDMAMultiChannelInterleavePerChannelSample always - * - * @param handle PDM eDMA handle pointer. - * @param multiChannelInterleaveType Multi channel interleave type. - */ -void PDM_TransferSetMultiChannelInterleaveType(pdm_edma_handle_t *handle, - pdm_edma_multi_channel_interleave_t multiChannelInterleaveType); - -/*! - * @brief Configures the PDM channel. - * - * @param base PDM base pointer. - * @param handle PDM eDMA handle pointer. - * @param channel channel index. - * @param config pdm channel configurations. - */ -void PDM_TransferSetChannelConfigEDMA(PDM_Type *base, - pdm_edma_handle_t *handle, - uint32_t channel, - const pdm_channel_config_t *config); - -/*! - * @brief Performs a non-blocking PDM receive using eDMA. - * - * @note This interface returns immediately after the transfer initiates. Call - * the PDM_GetReceiveRemainingBytes to poll the transfer status and check whether the PDM transfer is finished. - * - * 1. Scatter gather case: - * This functio support dynamic scatter gather and staic scatter gather, - * a. for the dynamic scatter gather case: - * Application should call PDM_TransferReceiveEDMA function continuously to make sure new receive request is submit - * before the previous one finish. b. for the static scatter gather case: Application should use the link transfer - * feature and make sure a loop link transfer is provided, such as: - * @code pdm_edma_transfer_t pdmXfer[2] = - * { - * { - * .data = s_buffer, - * .dataSize = BUFFER_SIZE, - * .linkTransfer = &pdmXfer[1], - * }, - * - * { - * .data = &s_buffer[BUFFER_SIZE], - * .dataSize = BUFFER_SIZE, - * .linkTransfer = &pdmXfer[0] - * }, - * }; - * @endcode - * - * 2. Multi channel case: - * This function support receive multi pdm channel data, for example, if two channel is requested, - * @code - * PDM_TransferSetChannelConfigEDMA(DEMO_PDM, &s_pdmRxHandle_0, DEMO_PDM_ENABLE_CHANNEL_0, &channelConfig); - * PDM_TransferSetChannelConfigEDMA(DEMO_PDM, &s_pdmRxHandle_0, DEMO_PDM_ENABLE_CHANNEL_1, &channelConfig); - * PDM_TransferReceiveEDMA(DEMO_PDM, &s_pdmRxHandle_0, pdmXfer); - * @endcode - * The output data will be formatted as below if handle->interleaveType = - * kPDM_EDMAMultiChannelInterleavePerChannelSample : - * ------------------------------------------------------------------------- - * |CHANNEL0 | CHANNEL1 | CHANNEL0 | CHANNEL1 | CHANNEL0 | CHANNEL 1 | ....| - * ------------------------------------------------------------------------- - * - * The output data will be formatted as below if handle->interleaveType = kPDM_EDMAMultiChannelInterleavePerChannelBlock - * : - * ---------------------------------------------------------------------------------------------------------------------- - * |CHANNEL3 | CHANNEL3 | CHANNEL3 | .... | CHANNEL4 | CHANNEL 4 | CHANNEL4 |....| CHANNEL5 | CHANNEL 5 | CHANNEL5 - * |....| - * ---------------------------------------------------------------------------------------------------------------------- - * Note: the dataSize of xfer is the total data size, while application using - * kPDM_EDMAMultiChannelInterleavePerChannelBlock, the buffer size for each PDM channel is channelSize = dataSize / - * channelNums, then there are limitation for this feature, - * 1. 3 DMIC array: the dataSize shall be 4 * (channelSize) - * The addtional buffer is mandantory for edma modulo feature. - * 2. The kPDM_EDMAMultiChannelInterleavePerChannelBlock feature support below dmic array only, - * 2 DMIC array: CHANNEL3, CHANNEL4 - * 3 DMIC array: CHANNEL3, CHANNEL4, CHANNEL5 - * 4 DMIC array: CHANNEL3, CHANNEL4, CHANNEL5, CHANNEL6 - * Any other combinations is not support, that is to SAY, THE FEATURE SUPPORT RECEIVE START FROM CHANNEL3 ONLY AND 4 - * MAXIMUM DMIC CHANNELS. - * - * @param base PDM base pointer - * @param handle PDM eDMA handle pointer. - * @param xfer Pointer to DMA transfer structure. - * @retval kStatus_Success Start a PDM eDMA receive successfully. - * @retval kStatus_InvalidArgument The input argument is invalid. - * @retval kStatus_RxBusy PDM is busy receiving data. - */ -status_t PDM_TransferReceiveEDMA(PDM_Type *base, pdm_edma_handle_t *handle, pdm_edma_transfer_t *xfer); - -/*! - * @brief Terminate all PDM receive. - * - * This function will clear all transfer slots buffered in the pdm queue. If users only want to abort the - * current transfer slot, please call PDM_TransferAbortReceiveEDMA. - * - * @param base PDM base pointer. - * @param handle PDM eDMA handle pointer. - */ -void PDM_TransferTerminateReceiveEDMA(PDM_Type *base, pdm_edma_handle_t *handle); - -/*! - * @brief Aborts a PDM receive using eDMA. - * - * This function only aborts the current transfer slots, the other transfer slots' information still kept - * in the handler. If users want to terminate all transfer slots, just call PDM_TransferTerminateReceiveEDMA. - * - * @param base PDM base pointer - * @param handle PDM eDMA handle pointer. - */ -void PDM_TransferAbortReceiveEDMA(PDM_Type *base, pdm_edma_handle_t *handle); - -/*! - * @brief Gets byte count received by PDM. - * - * @param base PDM base pointer - * @param handle PDM eDMA handle pointer. - * @param count Bytes count received by PDM. - * @retval kStatus_Success Succeed get the transfer count. - * @retval kStatus_NoTransferInProgress There is no non-blocking transaction in progress. - */ -status_t PDM_TransferGetReceiveCountEDMA(PDM_Type *base, pdm_edma_handle_t *handle, size_t *count); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_pint.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_pint.c deleted file mode 100644 index bbee183cd96..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_pint.c +++ /dev/null @@ -1,1033 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2024 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_pint.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.pint" -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ - -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) -/*! @brief Irq number array */ -static const IRQn_Type s_pintIRQ[FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS + - FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS] = PINT_IRQS; - -/*! @brief Callback function array for SECPINT(s). */ -static pint_cb_t s_secpintCallback[FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS]; -#else - -#if defined(FSL_FEATURE_PINT_INTERRUPT_COMBINE) && (FSL_FEATURE_PINT_INTERRUPT_COMBINE == 1) -/*! @brief Irq number array */ -static const IRQn_Type s_pintIRQ[1] = PINT_IRQS; -#else -/*! @brief Irq number array */ -static const IRQn_Type s_pintIRQ[FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS] = PINT_IRQS; -#endif /* FSL_FEATURE_PINT_INTERRUPT_COMBINE */ -#endif /* FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS */ - -/*! @brief Callback function array for PINT(s). */ -static pint_cb_t s_pintCallback[FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS]; - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Initialize PINT peripheral. - - * This function initializes the PINT peripheral and enables the clock. - * - * param base Base address of the PINT peripheral. - * - * retval None. - */ -void PINT_Init(PINT_Type *base) -{ - uint32_t i; - uint32_t pmcfg = 0; - uint8_t pintcount = 0; - assert(base != NULL); - - if (base == PINT) - { - pintcount = FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS; - /* clear PINT callback array*/ - for (i = 0; i < (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS; i++) - { - s_pintCallback[i] = NULL; - } - } - else - { -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) - pintcount = FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS; - /* clear SECPINT callback array*/ - for (i = 0; i < (uint32_t)FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS; i++) - { - s_secpintCallback[i] = NULL; - } -#endif /* FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS */ - } - - /* Disable all bit slices for pint*/ - for (i = 0; i < pintcount; i++) - { - pmcfg = pmcfg | ((uint32_t)kPINT_PatternMatchNever << (PININT_BITSLICE_CFG_START + (i * 3U))); - } - -#if defined(FSL_FEATURE_CLOCK_HAS_GPIOINT_CLOCK_SOURCE) && (FSL_FEATURE_CLOCK_HAS_GPIOINT_CLOCK_SOURCE == 1) - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock. */ - CLOCK_EnableClock(kCLOCK_GpioInt); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) - /* Reset the module. */ - RESET_PeripheralReset(kGPIOINT_RST_N_SHIFT_RSTn); -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ - -#elif defined(FSL_FEATURE_CLOCK_HAS_GPIOINT_CLOCK_SOURCE) && (FSL_FEATURE_CLOCK_HAS_GPIOINT_CLOCK_SOURCE == 0) - - if (base == PINT) - { -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock. */ - CLOCK_EnableClock(kCLOCK_Gpio0); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) - /* Reset the module. */ - RESET_PeripheralReset(kGPIO0_RST_N_SHIFT_RSTn); -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ - } - else - { -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock. */ - CLOCK_EnableClock(kCLOCK_Gpio_Sec); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) - /* Reset the module. */ - RESET_PeripheralReset(kGPIOSEC_RST_SHIFT_RSTn); -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ -#endif /* FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS */ - } - -#else - - if (base == PINT) - { -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock. */ - CLOCK_EnableClock(kCLOCK_Pint); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) - /* Reset the module. */ - RESET_PeripheralReset(kPINT_RST_SHIFT_RSTn); -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ - } - else - { - /* if need config SECURE PINT device,then enable secure pint interrupt clock */ -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock. */ - CLOCK_EnableClock(kCLOCK_Gpio_Sec_Int); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) - /* Reset the module. */ - RESET_PeripheralReset(kGPIOSECINT_RST_SHIFT_RSTn); -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ -#endif /* FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS */ - } -#endif /* FSL_FEATURE_CLOCK_HAS_GPIOINT_CLOCK_SOURCE */ - - /* Disable all pattern match bit slices */ - base->PMCFG = pmcfg; -} - -/*! - * brief Configure PINT peripheral pin interrupt. - - * This function configures a given pin interrupt. - * - * param base Base address of the PINT peripheral. - * param intr Pin interrupt. - * param enable Selects detection logic. - * param callback Callback. - * - * retval None. - */ -void PINT_PinInterruptConfig(PINT_Type *base, pint_pin_int_t intr, pint_pin_enable_t enable, pint_cb_t callback) -{ - assert(base != NULL); - - /* Clear Rise and Fall flags first */ - PINT_PinInterruptClrRiseFlag(base, intr); - PINT_PinInterruptClrFallFlag(base, intr); - - /* Security PINT uses additional callback array */ - if (base == PINT) - { - s_pintCallback[intr] = callback; - } - else - { -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) - s_secpintCallback[intr] = callback; -#endif - } - - /* select level or edge sensitive */ - base->ISEL = (base->ISEL & ~(1UL << (uint32_t)intr)) | - ((((uint32_t)enable & PINT_PIN_INT_LEVEL) != 0U) ? (1UL << (uint32_t)intr) : 0U); - - /* enable rising or level interrupt */ - if (((unsigned)enable & (PINT_PIN_INT_LEVEL | PINT_PIN_INT_RISE)) != 0U) - { - base->SIENR = 1UL << (uint32_t)intr; - } - else - { - base->CIENR = 1UL << (uint32_t)intr; - } - - /* Enable falling or select high level */ - if (((unsigned)enable & PINT_PIN_INT_FALL_OR_HIGH_LEVEL) != 0U) - { - base->SIENF = 1UL << (uint32_t)intr; - } - else - { - base->CIENF = 1UL << (uint32_t)intr; - } -} - -/*! - * brief Get PINT peripheral pin interrupt configuration. - - * This function returns the configuration of a given pin interrupt. - * - * param base Base address of the PINT peripheral. - * param pintr Pin interrupt. - * param enable Pointer to store the detection logic. - * param callback Callback. - * - * retval None. - */ -void PINT_PinInterruptGetConfig(PINT_Type *base, pint_pin_int_t pintr, pint_pin_enable_t *enable, pint_cb_t *callback) -{ - uint32_t mask; - bool level; - - assert(base != NULL); - - *enable = kPINT_PinIntEnableNone; - level = false; - - mask = 1UL << (uint32_t)pintr; - if ((base->ISEL & mask) != 0U) - { - /* Pin interrupt is level sensitive */ - level = true; - } - - if ((base->IENR & mask) != 0U) - { - if (level) - { - /* Level interrupt is enabled */ - *enable = kPINT_PinIntEnableLowLevel; - } - else - { - /* Rising edge interrupt */ - *enable = kPINT_PinIntEnableRiseEdge; - } - } - - if ((base->IENF & mask) != 0U) - { - if (level) - { - /* Level interrupt is active high */ - *enable = kPINT_PinIntEnableHighLevel; - } - else - { - /* Either falling or both edge */ - if (*enable == kPINT_PinIntEnableRiseEdge) - { - /* Rising and faling edge */ - *enable = kPINT_PinIntEnableBothEdges; - } - else - { - /* Falling edge */ - *enable = kPINT_PinIntEnableFallEdge; - } - } - } - - /* Security PINT uses additional callback array */ - if (base == PINT) - { - *callback = s_pintCallback[pintr]; - } - else - { -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) - *callback = s_secpintCallback[pintr]; -#endif - } -} - -/*! - * brief Configure PINT pattern match. - - * This function configures a given pattern match bit slice. - * - * param base Base address of the PINT peripheral. - * param bslice Pattern match bit slice number. - * param cfg Pointer to bit slice configuration. - * - * retval None. - */ -void PINT_PatternMatchConfig(PINT_Type *base, pint_pmatch_bslice_t bslice, pint_pmatch_cfg_t *cfg) -{ - uint32_t src_shift; - uint32_t cfg_shift; - uint32_t pmcfg; - uint32_t tmp_src_shift = PININT_BITSLICE_SRC_MASK; - uint32_t tmp_cfg_shift = PININT_BITSLICE_CFG_MASK; - - assert(base != NULL); - - src_shift = PININT_BITSLICE_SRC_START + ((uint32_t)bslice * 3UL); - cfg_shift = PININT_BITSLICE_CFG_START + ((uint32_t)bslice * 3UL); - - /* Input source selection for selected bit slice */ - base->PMSRC = (base->PMSRC & ~(tmp_src_shift << src_shift)) | ((uint32_t)(cfg->bs_src) << src_shift); - - /* Bit slice configuration */ - pmcfg = base->PMCFG; - pmcfg = (pmcfg & ~(tmp_cfg_shift << cfg_shift)) | ((uint32_t)(cfg->bs_cfg) << cfg_shift); - - /* If end point is true, enable the bits */ - if ((uint32_t)bslice != 7UL) - { - if (cfg->end_point) - { - pmcfg |= (1UL << (uint32_t)bslice); - } - else - { - pmcfg &= ~(1UL << (uint32_t)bslice); - } - } - - base->PMCFG = pmcfg; - - /* Save callback pointer */ - if (base == PINT) - { - if ((uint32_t)bslice < (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) - { - s_pintCallback[bslice] = cfg->callback; - } - } - else - { -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) - if ((uint32_t)bslice < (uint32_t)FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) - { - s_secpintCallback[bslice] = cfg->callback; - } -#endif - } -} - -/*! - * brief Get PINT pattern match configuration. - - * This function returns the configuration of a given pattern match bit slice. - * - * param base Base address of the PINT peripheral. - * param bslice Pattern match bit slice number. - * param cfg Pointer to bit slice configuration. - * - * retval None. - */ -void PINT_PatternMatchGetConfig(PINT_Type *base, pint_pmatch_bslice_t bslice, pint_pmatch_cfg_t *cfg) -{ - uint32_t src_shift; - uint32_t cfg_shift; - uint32_t tmp_src_shift = PININT_BITSLICE_SRC_MASK; - uint32_t tmp_cfg_shift = PININT_BITSLICE_CFG_MASK; - - assert(base != NULL); - - src_shift = PININT_BITSLICE_SRC_START + ((uint32_t)bslice * 3UL); - cfg_shift = PININT_BITSLICE_CFG_START + ((uint32_t)bslice * 3UL); - - cfg->bs_src = (pint_pmatch_input_src_t)(uint32_t)((base->PMSRC & (tmp_src_shift << src_shift)) >> src_shift); - cfg->bs_cfg = (pint_pmatch_bslice_cfg_t)(uint32_t)((base->PMCFG & (tmp_cfg_shift << cfg_shift)) >> cfg_shift); - - if ((uint32_t)bslice == 7U) - { - cfg->end_point = true; - } - else - { - cfg->end_point = (((base->PMCFG & (1UL << (uint32_t)bslice)) >> (uint32_t)bslice) != 0U) ? true : false; - } - - if (base == PINT) - { - if ((uint32_t)bslice < (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) - { - cfg->callback = s_pintCallback[bslice]; - } - } - else - { -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) - if ((uint32_t)bslice < (uint32_t)FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) - { - cfg->callback = s_secpintCallback[bslice]; - } -#endif - } -} - -/*! - * brief Reset pattern match detection logic. - - * This function resets the pattern match detection logic if any of the product term is matching. - * - * param base Base address of the PINT peripheral. - * - * retval pmstatus Each bit position indicates the match status of corresponding bit slice. - * = 0 Match was detected. = 1 Match was not detected. - */ -uint32_t PINT_PatternMatchResetDetectLogic(PINT_Type *base) -{ - uint32_t pmctrl; - uint32_t pmstatus; - uint32_t pmsrc; - - pmctrl = base->PMCTRL; - pmstatus = pmctrl >> PINT_PMCTRL_PMAT_SHIFT; - if (pmstatus != 0UL) - { - /* Reset Pattern match engine detection logic */ - pmsrc = base->PMSRC; - base->PMSRC = pmsrc; - } - return (pmstatus); -} - -/*! - * @brief Clear Selected pin interrupt status only when the pin was triggered by edge-sensitive. - - * This function clears the selected pin interrupt status. - * - * @param base Base address of the PINT peripheral. - * @param pintr Pin interrupt. - * - * @retval None. - */ -void PINT_PinInterruptClrStatus(PINT_Type *base, pint_pin_int_t pintr) -{ - uint32_t pinIntMode = base->ISEL & (1UL << (uint32_t)pintr); - uint32_t pinIntStatus = base->IST & (1UL << (uint32_t)pintr); - - /* Edge sensitive and pin interrupt that is currently requesting an interrupt. */ - if ((pinIntMode == 0x0UL) && (pinIntStatus != 0x0UL)) - { - base->IST = (1UL << (uint32_t)pintr); - } -} - -/*! - * @brief Clear all pin interrupts status only when pins were triggered by edge-sensitive. - - * This function clears the status of all pin interrupts. - * - * @param base Base address of the PINT peripheral. - * - * @retval None. - */ -void PINT_PinInterruptClrStatusAll(PINT_Type *base) -{ - uint32_t pinIntMode = 0; - uint32_t pinIntStatus = 0; - uint32_t pinIntCount = 0; - uint32_t mask = 0; - uint32_t i; - - if (base == PINT) - { - pinIntCount = (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS; - } - else - { -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) - pinIntCount = (uint32_t)FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS; -#endif /* FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS */ - } - - for (i = 0; i < pinIntCount; i++) - { - pinIntMode = base->ISEL & (1UL << i); - pinIntStatus = base->IST & (1UL << i); - - /* Edge sensitive and pin interrupt that is currently requesting an interrupt. */ - if ((pinIntMode == 0x0UL) && (pinIntStatus != 0x0UL)) - { - mask |= 1UL << i; - } - } - - base->IST = mask; -} - -/*! - * brief Enable callback. - - * This function enables the interrupt for the selected PINT peripheral. Although the pin(s) are monitored - * as soon as they are enabled, the callback function is not enabled until this function is called. - * - * param base Base address of the PINT peripheral. - * - * retval None. - */ -void PINT_EnableCallback(PINT_Type *base) -{ - uint32_t i; - - assert(base != NULL); - - if (base == PINT) - { -#if defined(FSL_FEATURE_PINT_INTERRUPT_COMBINE) && (FSL_FEATURE_PINT_INTERRUPT_COMBINE == 1) - for (i = 0; i < (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS; i++) - { - PINT_PinInterruptClrStatus(base, (pint_pin_int_t)i); - } - NVIC_ClearPendingIRQ(s_pintIRQ[0]); - (void)EnableIRQ(s_pintIRQ[0]); -#else - for (i = 0; i < (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS; i++) - { - PINT_PinInterruptClrStatus(base, (pint_pin_int_t)i); - NVIC_ClearPendingIRQ(s_pintIRQ[i]); - (void)EnableIRQ(s_pintIRQ[i]); - } -#endif - } - else - { -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) - for (i = 0; i < (uint32_t)FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS; i++) - { - PINT_PinInterruptClrStatus(base, (pint_pin_int_t)i); - NVIC_ClearPendingIRQ(s_pintIRQ[i + (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS]); - (void)EnableIRQ(s_pintIRQ[i + (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS]); - } -#endif /* FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS */ - } -} - -/*! - * brief enable callback by pin index. - - * This function enables callback by pin index instead of enabling all pins. - * - * param base Base address of the peripheral. - * param pinIdx pin index. - * - * retval None. - */ -void PINT_EnableCallbackByIndex(PINT_Type *base, pint_pin_int_t pintIdx) -{ - assert(base != NULL); - - PINT_PinInterruptClrStatus(base, (pint_pin_int_t)pintIdx); - -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) - /* Get the right security pint irq index in array */ - if ((base == SECPINT) && ((uint32_t)pintIdx < (uint32_t)FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS)) - { - pintIdx = - (pint_pin_int_t)(uint32_t)((uint32_t)pintIdx + (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS); - } -#endif /* FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS */ - -#if defined(FSL_FEATURE_PINT_INTERRUPT_COMBINE) && (FSL_FEATURE_PINT_INTERRUPT_COMBINE == 1) - NVIC_ClearPendingIRQ(s_pintIRQ[0]); - (void)EnableIRQ(s_pintIRQ[0]); -#else - NVIC_ClearPendingIRQ(s_pintIRQ[pintIdx]); - (void)EnableIRQ(s_pintIRQ[pintIdx]); -#endif -} - -/*! - * brief Disable callback. - - * This function disables the interrupt for the selected PINT peripheral. Although the pins are still - * being monitored but the callback function is not called. - * - * param base Base address of the peripheral. - * - * retval None. - */ -void PINT_DisableCallback(PINT_Type *base) -{ - uint32_t i; - - assert(base != NULL); - - if (base == PINT) - { -#if defined(FSL_FEATURE_PINT_INTERRUPT_COMBINE) && (FSL_FEATURE_PINT_INTERRUPT_COMBINE == 1) - (void)DisableIRQ(s_pintIRQ[0]); - for (i = 0; i < (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS; i++) - { - PINT_PinInterruptClrStatus(base, (pint_pin_int_t)i); - } - NVIC_ClearPendingIRQ(s_pintIRQ[0]); -#else - for (i = 0; i < (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS; i++) - { - (void)DisableIRQ(s_pintIRQ[i]); - PINT_PinInterruptClrStatus(base, (pint_pin_int_t)i); - NVIC_ClearPendingIRQ(s_pintIRQ[i]); - } -#endif - } - else - { -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) - for (i = 0; i < (uint32_t)FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS; i++) - { - (void)DisableIRQ(s_pintIRQ[i + (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS]); - PINT_PinInterruptClrStatus(base, (pint_pin_int_t)i); - NVIC_ClearPendingIRQ(s_pintIRQ[i + (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS]); - } -#endif /* FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS */ - } -} - -/*! - * brief disable callback by pin index. - - * This function disables callback by pin index instead of disabling all pins. - * - * param base Base address of the peripheral. - * param pinIdx pin index. - * - * retval None. - */ -void PINT_DisableCallbackByIndex(PINT_Type *base, pint_pin_int_t pintIdx) -{ - assert(base != NULL); - - if (base == PINT) - { -#if defined(FSL_FEATURE_PINT_INTERRUPT_COMBINE) && (FSL_FEATURE_PINT_INTERRUPT_COMBINE == 1) - (void)DisableIRQ(s_pintIRQ[0]); - PINT_PinInterruptClrStatus(base, (pint_pin_int_t)pintIdx); - NVIC_ClearPendingIRQ(s_pintIRQ[0]); -#else - (void)DisableIRQ(s_pintIRQ[pintIdx]); - PINT_PinInterruptClrStatus(base, (pint_pin_int_t)pintIdx); - NVIC_ClearPendingIRQ(s_pintIRQ[pintIdx]); -#endif - } - else - { -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) - (void)DisableIRQ(s_pintIRQ[(uint32_t)pintIdx + (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS]); - PINT_PinInterruptClrStatus(base, (pint_pin_int_t)pintIdx); - NVIC_ClearPendingIRQ(s_pintIRQ[(uint32_t)pintIdx + (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS]); -#endif - } -} - -/*! - * brief Deinitialize PINT peripheral. - - * This function disables the PINT clock. - * - * param base Base address of the PINT peripheral. - * - * retval None. - */ -void PINT_Deinit(PINT_Type *base) -{ - uint32_t i; - - assert(base != NULL); - - /* Cleanup */ - PINT_DisableCallback(base); - if (base == PINT) - { - /* clear PINT callback array*/ - for (i = 0; i < (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS; i++) - { - s_pintCallback[i] = NULL; - } - } - else - { -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) - /* clear SECPINT callback array */ - for (i = 0; i < (uint32_t)FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS; i++) - { - s_secpintCallback[i] = NULL; - } -#endif /* FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS */ - } - -#if defined(FSL_FEATURE_CLOCK_HAS_GPIOINT_CLOCK_SOURCE) && (FSL_FEATURE_CLOCK_HAS_GPIOINT_CLOCK_SOURCE == 1) - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock. */ - CLOCK_DisableClock(kCLOCK_GpioInt); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) - /* Reset the module. */ - RESET_PeripheralReset(kGPIOINT_RST_N_SHIFT_RSTn); -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ - -#elif defined(FSL_FEATURE_CLOCK_HAS_GPIOINT_CLOCK_SOURCE) && (FSL_FEATURE_CLOCK_HAS_GPIOINT_CLOCK_SOURCE == 0) - - if (base == PINT) - { -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock. */ - CLOCK_DisableClock(kCLOCK_Gpio0); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) - /* Reset the module. */ - RESET_PeripheralReset(kGPIO0_RST_N_SHIFT_RSTn); -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ - } - else - { -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock. */ - CLOCK_DisableClock(kCLOCK_Gpio_Sec); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) - /* Reset the module. */ - RESET_PeripheralReset(kGPIOSEC_RST_SHIFT_RSTn); -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ -#endif /* FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS */ - } - -#else - - if (base == PINT) - { -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock. */ - CLOCK_DisableClock(kCLOCK_Pint); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) - /* Reset the module. */ - RESET_PeripheralReset(kPINT_RST_SHIFT_RSTn); -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ - } - else - { - /* if need config SECURE PINT device,then enable secure pint interrupt clock */ -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock. */ - CLOCK_DisableClock(kCLOCK_Gpio_Sec_Int); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) - /* Reset the module. */ - RESET_PeripheralReset(kGPIOSECINT_RST_SHIFT_RSTn); -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ -#endif /* FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS */ - } -#endif /* FSL_FEATURE_CLOCK_HAS_GPIOINT_CLOCK_SOURCE */ -} -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) -/* IRQ handler functions overloading weak symbols in the startup */ -void SEC_GPIO_INT0_IRQ0_DriverIRQHandler(void); -void SEC_GPIO_INT0_IRQ0_DriverIRQHandler(void) -{ - uint32_t pmstatus = 0; - - /* Reset pattern match detection */ - pmstatus = PINT_PatternMatchResetDetectLogic(SECPINT); - /* Call user function */ - if (s_secpintCallback[kPINT_SecPinInt0] != NULL) - { - s_secpintCallback[kPINT_SecPinInt0](kPINT_SecPinInt0, pmstatus); - } - if ((SECPINT->ISEL & 0x1U) == 0x0U) - { - /* Edge sensitive: clear Pin interrupt after callback */ - PINT_PinInterruptClrStatus(SECPINT, kPINT_PinInt0); - } - SDK_ISR_EXIT_BARRIER; -} - -#if (FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS > 1U) -/* IRQ handler functions overloading weak symbols in the startup */ -void SEC_GPIO_INT0_IRQ1_DriverIRQHandler(void); -void SEC_GPIO_INT0_IRQ1_DriverIRQHandler(void) -{ - uint32_t pmstatus; - - /* Reset pattern match detection */ - pmstatus = PINT_PatternMatchResetDetectLogic(SECPINT); - /* Call user function */ - if (s_secpintCallback[kPINT_SecPinInt1] != NULL) - { - s_secpintCallback[kPINT_SecPinInt1](kPINT_SecPinInt1, pmstatus); - } - if ((SECPINT->ISEL & 0x1U) == 0x0U) - { - /* Edge sensitive: clear Pin interrupt after callback */ - PINT_PinInterruptClrStatus(SECPINT, kPINT_PinInt1); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS */ -#endif /* FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS */ - -void PINT0_DriverIRQHandler(void); -void PINT0_DriverIRQHandler(void) -{ - uint32_t flags = (PINT->IST & PINT_IST_PSTAT_MASK) | PINT_PatternMatchGetStatusAll(PINT); - uint32_t pmstatus; - - for (uint8_t i = 0; i < (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS; i++) - { - if ((flags & (1UL << i)) != 0UL) - { - /* Reset pattern match detection */ - pmstatus = PINT_PatternMatchResetDetectLogic(PINT); - /* Call user function */ - if (s_pintCallback[i] != NULL) - { - s_pintCallback[i]((pint_pin_int_t)i, pmstatus); - } - if ((PINT->ISEL & (1UL << i)) == 0x0UL) - { - /* Edge sensitive: clear Pin interrupt after callback */ - PINT_PinInterruptClrStatus(PINT, (pint_pin_int_t)i); - } - } - } - - SDK_ISR_EXIT_BARRIER; -} - -/* IRQ handler functions overloading weak symbols in the startup */ -void PIN_INT0_DriverIRQHandler(void); -void PIN_INT0_DriverIRQHandler(void) -{ - uint32_t pmstatus; - - /* Reset pattern match detection */ - pmstatus = PINT_PatternMatchResetDetectLogic(PINT); - /* Call user function */ - if (s_pintCallback[kPINT_PinInt0] != NULL) - { - s_pintCallback[kPINT_PinInt0](kPINT_PinInt0, pmstatus); - } - if ((PINT->ISEL & 0x1U) == 0x0U) - { - /* Edge sensitive: clear Pin interrupt after callback */ - PINT_PinInterruptClrStatus(PINT, kPINT_PinInt0); - } - SDK_ISR_EXIT_BARRIER; -} - -#if (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 1U) -void PIN_INT1_DriverIRQHandler(void); -void PIN_INT1_DriverIRQHandler(void) -{ - uint32_t pmstatus; - - /* Reset pattern match detection */ - pmstatus = PINT_PatternMatchResetDetectLogic(PINT); - /* Call user function */ - if (s_pintCallback[kPINT_PinInt1] != NULL) - { - s_pintCallback[kPINT_PinInt1](kPINT_PinInt1, pmstatus); - } - if ((PINT->ISEL & 0x2U) == 0x0U) - { - /* Edge sensitive: clear Pin interrupt after callback */ - PINT_PinInterruptClrStatus(PINT, kPINT_PinInt1); - } - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 2U) -void PIN_INT2_DriverIRQHandler(void); -void PIN_INT2_DriverIRQHandler(void) -{ - uint32_t pmstatus; - - /* Reset pattern match detection */ - pmstatus = PINT_PatternMatchResetDetectLogic(PINT); - /* Call user function */ - if (s_pintCallback[kPINT_PinInt2] != NULL) - { - s_pintCallback[kPINT_PinInt2](kPINT_PinInt2, pmstatus); - } - if ((PINT->ISEL & 0x4U) == 0x0U) - { - /* Edge sensitive: clear Pin interrupt after callback */ - PINT_PinInterruptClrStatus(PINT, kPINT_PinInt2); - } - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 3U) -void PIN_INT3_DriverIRQHandler(void); -void PIN_INT3_DriverIRQHandler(void) -{ - uint32_t pmstatus; - - /* Reset pattern match detection */ - pmstatus = PINT_PatternMatchResetDetectLogic(PINT); - /* Call user function */ - if (s_pintCallback[kPINT_PinInt3] != NULL) - { - s_pintCallback[kPINT_PinInt3](kPINT_PinInt3, pmstatus); - } - if ((PINT->ISEL & 0x8U) == 0x0U) - { - /* Edge sensitive: clear Pin interrupt after callback */ - PINT_PinInterruptClrStatus(PINT, kPINT_PinInt3); - } - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 4U) -void PIN_INT4_DriverIRQHandler(void); -void PIN_INT4_DriverIRQHandler(void) -{ - uint32_t pmstatus; - - /* Reset pattern match detection */ - pmstatus = PINT_PatternMatchResetDetectLogic(PINT); - /* Call user function */ - if (s_pintCallback[kPINT_PinInt4] != NULL) - { - s_pintCallback[kPINT_PinInt4](kPINT_PinInt4, pmstatus); - } - if ((PINT->ISEL & 0x10U) == 0x0U) - { - /* Edge sensitive: clear Pin interrupt after callback */ - PINT_PinInterruptClrStatus(PINT, kPINT_PinInt4); - } - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 5U) -#if defined(FSL_FEATURE_NVIC_HAS_SHARED_INTERTTUPT_NUMBER) && FSL_FEATURE_NVIC_HAS_SHARED_INTERTTUPT_NUMBER -void PIN_INT5_DAC1_IRQHandler(void); -void PIN_INT5_DAC1_IRQHandler(void) -#else -void PIN_INT5_DriverIRQHandler(void); -void PIN_INT5_DriverIRQHandler(void) -#endif /* FSL_FEATURE_NVIC_HAS_SHARED_INTERTTUPT_NUMBER */ -{ - uint32_t pmstatus; - - /* Reset pattern match detection */ - pmstatus = PINT_PatternMatchResetDetectLogic(PINT); - /* Call user function */ - if (s_pintCallback[kPINT_PinInt5] != NULL) - { - s_pintCallback[kPINT_PinInt5](kPINT_PinInt5, pmstatus); - } - if ((PINT->ISEL & 0x20U) == 0x0U) - { - /* Edge sensitive: clear Pin interrupt after callback */ - PINT_PinInterruptClrStatus(PINT, kPINT_PinInt5); - } - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 6U) -#if defined(FSL_FEATURE_NVIC_HAS_SHARED_INTERTTUPT_NUMBER) && FSL_FEATURE_NVIC_HAS_SHARED_INTERTTUPT_NUMBER -void PIN_INT6_USART3_IRQHandler(void); -void PIN_INT6_USART3_IRQHandler(void) -#else -void PIN_INT6_DriverIRQHandler(void); -void PIN_INT6_DriverIRQHandler(void) -#endif /* FSL_FEATURE_NVIC_HAS_SHARED_INTERTTUPT_NUMBER */ -{ - uint32_t pmstatus; - - /* Reset pattern match detection */ - pmstatus = PINT_PatternMatchResetDetectLogic(PINT); - /* Call user function */ - if (s_pintCallback[kPINT_PinInt6] != NULL) - { - s_pintCallback[kPINT_PinInt6](kPINT_PinInt6, pmstatus); - } - if ((PINT->ISEL & 0x40U) == 0x0U) - { - /* Edge sensitive: clear Pin interrupt after callback */ - PINT_PinInterruptClrStatus(PINT, kPINT_PinInt6); - } - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 7U) -#if defined(FSL_FEATURE_NVIC_HAS_SHARED_INTERTTUPT_NUMBER) && FSL_FEATURE_NVIC_HAS_SHARED_INTERTTUPT_NUMBER -void PIN_INT7_USART4_IRQHandler(void); -void PIN_INT7_USART4_IRQHandler(void) -#else -void PIN_INT7_DriverIRQHandler(void); -void PIN_INT7_DriverIRQHandler(void) -#endif /* FSL_FEATURE_NVIC_HAS_SHARED_INTERTTUPT_NUMBER */ -{ - uint32_t pmstatus; - - /* Reset pattern match detection */ - pmstatus = PINT_PatternMatchResetDetectLogic(PINT); - /* Call user function */ - if (s_pintCallback[kPINT_PinInt7] != NULL) - { - s_pintCallback[kPINT_PinInt7](kPINT_PinInt7, pmstatus); - } - if ((PINT->ISEL & 0x80U) == 0x0U) - { - /* Edge sensitive: clear Pin interrupt after callback */ - PINT_PinInterruptClrStatus(PINT, kPINT_PinInt7); - } - SDK_ISR_EXIT_BARRIER; -} -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_pint.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_pint.h deleted file mode 100644 index 0eb4195689c..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_pint.h +++ /dev/null @@ -1,580 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2024 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_PINT_H_ -#define FSL_PINT_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup pint_driver - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -#define FSL_PINT_DRIVER_VERSION (MAKE_VERSION(2, 1, 13)) -/*@}*/ - -/* Number of interrupt line supported by PINT */ -#define PINT_PIN_INT_COUNT 8U - -/* Number of interrupt line supported by SECURE PINT */ -#define SEC_PINT_PIN_INT_COUNT 2U - -/* Number of input sources supported by PINT */ -#define PINT_INPUT_COUNT 8U - -/* PININT Bit slice source register bits */ -#define PININT_BITSLICE_SRC_START 8U -#define PININT_BITSLICE_SRC_MASK 7U - -/* PININT Bit slice configuration register bits */ -#define PININT_BITSLICE_CFG_START 8U -#define PININT_BITSLICE_CFG_MASK 7U -#define PININT_BITSLICE_ENDP_MASK 7U - -#define PINT_PIN_INT_LEVEL 0x10U -#define PINT_PIN_INT_EDGE 0x00U -#define PINT_PIN_INT_FALL_OR_HIGH_LEVEL 0x02U -#define PINT_PIN_INT_RISE 0x01U -#define PINT_PIN_RISE_EDGE (PINT_PIN_INT_EDGE | PINT_PIN_INT_RISE) -#define PINT_PIN_FALL_EDGE (PINT_PIN_INT_EDGE | PINT_PIN_INT_FALL_OR_HIGH_LEVEL) -#define PINT_PIN_BOTH_EDGE (PINT_PIN_INT_EDGE | PINT_PIN_INT_RISE | PINT_PIN_INT_FALL_OR_HIGH_LEVEL) -#define PINT_PIN_LOW_LEVEL (PINT_PIN_INT_LEVEL) -#define PINT_PIN_HIGH_LEVEL (PINT_PIN_INT_LEVEL | PINT_PIN_INT_FALL_OR_HIGH_LEVEL) - -/*! @brief PINT Pin Interrupt enable type */ -typedef enum _pint_pin_enable -{ - kPINT_PinIntEnableNone = 0U, /*!< Do not generate Pin Interrupt */ - kPINT_PinIntEnableRiseEdge = PINT_PIN_RISE_EDGE, /*!< Generate Pin Interrupt on rising edge */ - kPINT_PinIntEnableFallEdge = PINT_PIN_FALL_EDGE, /*!< Generate Pin Interrupt on falling edge */ - kPINT_PinIntEnableBothEdges = PINT_PIN_BOTH_EDGE, /*!< Generate Pin Interrupt on both edges */ - kPINT_PinIntEnableLowLevel = PINT_PIN_LOW_LEVEL, /*!< Generate Pin Interrupt on low level */ - kPINT_PinIntEnableHighLevel = PINT_PIN_HIGH_LEVEL /*!< Generate Pin Interrupt on high level */ -} pint_pin_enable_t; - -/*! @brief PINT Pin Interrupt type */ -typedef enum _pint_int -{ - kPINT_PinInt0 = 0U, /*!< Pin Interrupt 0 */ -#if defined(FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 1U) - kPINT_PinInt1 = 1U, /*!< Pin Interrupt 1 */ -#endif -#if defined(FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 2U) - kPINT_PinInt2 = 2U, /*!< Pin Interrupt 2 */ -#endif -#if defined(FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 3U) - kPINT_PinInt3 = 3U, /*!< Pin Interrupt 3 */ -#endif -#if defined(FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 4U) - kPINT_PinInt4 = 4U, /*!< Pin Interrupt 4 */ -#endif -#if defined(FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 5U) - kPINT_PinInt5 = 5U, /*!< Pin Interrupt 5 */ -#endif -#if defined(FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 6U) - kPINT_PinInt6 = 6U, /*!< Pin Interrupt 6 */ -#endif -#if defined(FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 7U) - kPINT_PinInt7 = 7U, /*!< Pin Interrupt 7 */ -#endif -#if defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS > 0U) - kPINT_SecPinInt0 = 0U, /*!< Secure Pin Interrupt 0 */ -#endif -#if defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS > 1U) - kPINT_SecPinInt1 = 1U, /*!< Secure Pin Interrupt 1 */ -#endif -} pint_pin_int_t; - -/*! @brief PINT Pattern Match bit slice input source type */ -typedef enum _pint_pmatch_input_src -{ - kPINT_PatternMatchInp0Src = 0U, /*!< Input source 0 */ - kPINT_PatternMatchInp1Src = 1U, /*!< Input source 1 */ - kPINT_PatternMatchInp2Src = 2U, /*!< Input source 2 */ - kPINT_PatternMatchInp3Src = 3U, /*!< Input source 3 */ - kPINT_PatternMatchInp4Src = 4U, /*!< Input source 4 */ - kPINT_PatternMatchInp5Src = 5U, /*!< Input source 5 */ - kPINT_PatternMatchInp6Src = 6U, /*!< Input source 6 */ - kPINT_PatternMatchInp7Src = 7U, /*!< Input source 7 */ - kPINT_SecPatternMatchInp0Src = 0U, /*!< Input source 0 */ - kPINT_SecPatternMatchInp1Src = 1U, /*!< Input source 1 */ -} pint_pmatch_input_src_t; - -/*! @brief PINT Pattern Match bit slice type */ -typedef enum _pint_pmatch_bslice -{ - kPINT_PatternMatchBSlice0 = 0U, /*!< Bit slice 0 */ -#if defined(FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 1U) - kPINT_PatternMatchBSlice1 = 1U, /*!< Bit slice 1 */ -#endif -#if defined(FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 2U) - kPINT_PatternMatchBSlice2 = 2U, /*!< Bit slice 2 */ -#endif -#if defined(FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 3U) - kPINT_PatternMatchBSlice3 = 3U, /*!< Bit slice 3 */ -#endif -#if defined(FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 4U) - kPINT_PatternMatchBSlice4 = 4U, /*!< Bit slice 4 */ -#endif -#if defined(FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 5U) - kPINT_PatternMatchBSlice5 = 5U, /*!< Bit slice 5 */ -#endif -#if defined(FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 6U) - kPINT_PatternMatchBSlice6 = 6U, /*!< Bit slice 6 */ -#endif -#if defined(FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 7U) - kPINT_PatternMatchBSlice7 = 7U, /*!< Bit slice 7 */ -#endif -#if defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS > 0U) - kPINT_SecPatternMatchBSlice0 = 0U, /*!< Bit slice 0 */ -#endif -#if defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS > 1U) - kPINT_SecPatternMatchBSlice1 = 1U, /*!< Bit slice 1 */ -#endif -} pint_pmatch_bslice_t; - -/*! @brief PINT Pattern Match configuration type */ -typedef enum _pint_pmatch_bslice_cfg -{ - kPINT_PatternMatchAlways = 0U, /*!< Always Contributes to product term match */ - kPINT_PatternMatchStickyRise = 1U, /*!< Sticky Rising edge */ - kPINT_PatternMatchStickyFall = 2U, /*!< Sticky Falling edge */ - kPINT_PatternMatchStickyBothEdges = 3U, /*!< Sticky Rising or Falling edge */ - kPINT_PatternMatchHigh = 4U, /*!< High level */ - kPINT_PatternMatchLow = 5U, /*!< Low level */ - kPINT_PatternMatchNever = 6U, /*!< Never contributes to product term match */ - kPINT_PatternMatchBothEdges = 7U, /*!< Either rising or falling edge */ -} pint_pmatch_bslice_cfg_t; - -/*! @brief PINT Callback function. */ -typedef void (*pint_cb_t)(pint_pin_int_t pintr, uint32_t pmatch_status); - -typedef struct _pint_pmatch_cfg -{ - pint_pmatch_input_src_t bs_src; - pint_pmatch_bslice_cfg_t bs_cfg; - bool end_point; - pint_cb_t callback; -} pint_pmatch_cfg_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @brief Initialize PINT peripheral. - - * This function initializes the PINT peripheral and enables the clock. - * - * @param base Base address of the PINT peripheral. - * - * @retval None. - */ -void PINT_Init(PINT_Type *base); - -/*! - * @brief Configure PINT peripheral pin interrupt. - - * This function configures a given pin interrupt. - * - * @param base Base address of the PINT peripheral. - * @param intr Pin interrupt. - * @param enable Selects detection logic. - * @param callback Callback. - * - * @retval None. - */ -void PINT_PinInterruptConfig(PINT_Type *base, pint_pin_int_t intr, pint_pin_enable_t enable, pint_cb_t callback); - -/*! - * @brief Get PINT peripheral pin interrupt configuration. - - * This function returns the configuration of a given pin interrupt. - * - * @param base Base address of the PINT peripheral. - * @param pintr Pin interrupt. - * @param enable Pointer to store the detection logic. - * @param callback Callback. - * - * @retval None. - */ -void PINT_PinInterruptGetConfig(PINT_Type *base, pint_pin_int_t pintr, pint_pin_enable_t *enable, pint_cb_t *callback); - -/*! - * @brief Clear Selected pin interrupt status only when the pin was triggered by edge-sensitive. - - * This function clears the selected pin interrupt status. - * - * @param base Base address of the PINT peripheral. - * @param pintr Pin interrupt. - * - * @retval None. - */ -void PINT_PinInterruptClrStatus(PINT_Type *base, pint_pin_int_t pintr); - -/*! - * @brief Get Selected pin interrupt status. - - * This function returns the selected pin interrupt status. - * - * @param base Base address of the PINT peripheral. - * @param pintr Pin interrupt. - * - * @retval status = 0 No pin interrupt request. = 1 Selected Pin interrupt request active. - */ -static inline uint32_t PINT_PinInterruptGetStatus(PINT_Type *base, pint_pin_int_t pintr) -{ - return ((base->IST & (1UL << (uint32_t)pintr)) != 0U ? 1U : 0U); -} - -/*! - * @brief Clear all pin interrupts status only when pins were triggered by edge-sensitive. - - * This function clears the status of all pin interrupts. - * - * @param base Base address of the PINT peripheral. - * - * @retval None. - */ -void PINT_PinInterruptClrStatusAll(PINT_Type *base); - -/*! - * @brief Get all pin interrupts status. - - * This function returns the status of all pin interrupts. - * - * @param base Base address of the PINT peripheral. - * - * @retval status Each bit position indicates the status of corresponding pin interrupt. - * = 0 No pin interrupt request. = 1 Pin interrupt request active. - */ -static inline uint32_t PINT_PinInterruptGetStatusAll(PINT_Type *base) -{ - return (base->IST); -} - -/*! - * @brief Clear Selected pin interrupt fall flag. - - * This function clears the selected pin interrupt fall flag. - * - * @param base Base address of the PINT peripheral. - * @param pintr Pin interrupt. - * - * @retval None. - */ -static inline void PINT_PinInterruptClrFallFlag(PINT_Type *base, pint_pin_int_t pintr) -{ - base->FALL = (1UL << (uint32_t)pintr); -} - -/*! - * @brief Get selected pin interrupt fall flag. - - * This function returns the selected pin interrupt fall flag. - * - * @param base Base address of the PINT peripheral. - * @param pintr Pin interrupt. - * - * @retval flag = 0 Falling edge has not been detected. = 1 Falling edge has been detected. - */ -static inline uint32_t PINT_PinInterruptGetFallFlag(PINT_Type *base, pint_pin_int_t pintr) -{ - return ((base->FALL & (1UL << (uint32_t)pintr)) != 0U ? 1U : 0U); -} - -/*! - * @brief Clear all pin interrupt fall flags. - - * This function clears the fall flag for all pin interrupts. - * - * @param base Base address of the PINT peripheral. - * - * @retval None. - */ -static inline void PINT_PinInterruptClrFallFlagAll(PINT_Type *base) -{ - base->FALL = PINT_FALL_FDET_MASK; -} - -/*! - * @brief Get all pin interrupt fall flags. - - * This function returns the fall flag of all pin interrupts. - * - * @param base Base address of the PINT peripheral. - * - * @retval flags Each bit position indicates the falling edge detection of the corresponding pin interrupt. - * 0 Falling edge has not been detected. = 1 Falling edge has been detected. - */ -static inline uint32_t PINT_PinInterruptGetFallFlagAll(PINT_Type *base) -{ - return (base->FALL); -} - -/*! - * @brief Clear Selected pin interrupt rise flag. - - * This function clears the selected pin interrupt rise flag. - * - * @param base Base address of the PINT peripheral. - * @param pintr Pin interrupt. - * - * @retval None. - */ -static inline void PINT_PinInterruptClrRiseFlag(PINT_Type *base, pint_pin_int_t pintr) -{ - base->RISE = (1UL << (uint32_t)pintr); -} - -/*! - * @brief Get selected pin interrupt rise flag. - - * This function returns the selected pin interrupt rise flag. - * - * @param base Base address of the PINT peripheral. - * @param pintr Pin interrupt. - * - * @retval flag = 0 Rising edge has not been detected. = 1 Rising edge has been detected. - */ -static inline uint32_t PINT_PinInterruptGetRiseFlag(PINT_Type *base, pint_pin_int_t pintr) -{ - return ((base->RISE & (1UL << (uint32_t)pintr)) != 0U ? 1U : 0U); -} - -/*! - * @brief Clear all pin interrupt rise flags. - - * This function clears the rise flag for all pin interrupts. - * - * @param base Base address of the PINT peripheral. - * - * @retval None. - */ -static inline void PINT_PinInterruptClrRiseFlagAll(PINT_Type *base) -{ - base->RISE = PINT_RISE_RDET_MASK; -} - -/*! - * @brief Get all pin interrupt rise flags. - - * This function returns the rise flag of all pin interrupts. - * - * @param base Base address of the PINT peripheral. - * - * @retval flags Each bit position indicates the rising edge detection of the corresponding pin interrupt. - * 0 Rising edge has not been detected. = 1 Rising edge has been detected. - */ -static inline uint32_t PINT_PinInterruptGetRiseFlagAll(PINT_Type *base) -{ - return (base->RISE); -} - -/*! - * @brief Configure PINT pattern match. - - * This function configures a given pattern match bit slice. - * - * @param base Base address of the PINT peripheral. - * @param bslice Pattern match bit slice number. - * @param cfg Pointer to bit slice configuration. - * - * @retval None. - */ -void PINT_PatternMatchConfig(PINT_Type *base, pint_pmatch_bslice_t bslice, pint_pmatch_cfg_t *cfg); - -/*! - * @brief Get PINT pattern match configuration. - - * This function returns the configuration of a given pattern match bit slice. - * - * @param base Base address of the PINT peripheral. - * @param bslice Pattern match bit slice number. - * @param cfg Pointer to bit slice configuration. - * - * @retval None. - */ -void PINT_PatternMatchGetConfig(PINT_Type *base, pint_pmatch_bslice_t bslice, pint_pmatch_cfg_t *cfg); - -/*! - * @brief Get pattern match bit slice status. - - * This function returns the status of selected bit slice. - * - * @param base Base address of the PINT peripheral. - * @param bslice Pattern match bit slice number. - * - * @retval status = 0 Match has not been detected. = 1 Match has been detected. - */ -static inline uint32_t PINT_PatternMatchGetStatus(PINT_Type *base, pint_pmatch_bslice_t bslice) -{ - return ((base->PMCTRL >> PINT_PMCTRL_PMAT_SHIFT) & (1UL << (uint32_t)bslice)) >> (uint32_t)bslice; -} - -/*! - * @brief Get status of all pattern match bit slices. - - * This function returns the status of all bit slices. - * - * @param base Base address of the PINT peripheral. - * - * @retval status Each bit position indicates the match status of corresponding bit slice. - * = 0 Match has not been detected. = 1 Match has been detected. - */ -static inline uint32_t PINT_PatternMatchGetStatusAll(PINT_Type *base) -{ - return base->PMCTRL >> PINT_PMCTRL_PMAT_SHIFT; -} - -/*! - * @brief Reset pattern match detection logic. - - * This function resets the pattern match detection logic if any of the product term is matching. - * - * @param base Base address of the PINT peripheral. - * - * @retval pmstatus Each bit position indicates the match status of corresponding bit slice. - * = 0 Match was detected. = 1 Match was not detected. - */ -uint32_t PINT_PatternMatchResetDetectLogic(PINT_Type *base); - -/*! - * @brief Enable pattern match function. - - * This function enables the pattern match function. - * - * @param base Base address of the PINT peripheral. - * - * @retval None. - */ -static inline void PINT_PatternMatchEnable(PINT_Type *base) -{ - base->PMCTRL = (base->PMCTRL & PINT_PMCTRL_ENA_RXEV_MASK) | PINT_PMCTRL_SEL_PMATCH_MASK; -} - -/*! - * @brief Disable pattern match function. - - * This function disables the pattern match function. - * - * @param base Base address of the PINT peripheral. - * - * @retval None. - */ -static inline void PINT_PatternMatchDisable(PINT_Type *base) -{ - base->PMCTRL = (base->PMCTRL & PINT_PMCTRL_ENA_RXEV_MASK) & ~PINT_PMCTRL_SEL_PMATCH_MASK; -} - -/*! - * @brief Enable RXEV output. - - * This function enables the pattern match RXEV output. - * - * @param base Base address of the PINT peripheral. - * - * @retval None. - */ -static inline void PINT_PatternMatchEnableRXEV(PINT_Type *base) -{ - base->PMCTRL = (base->PMCTRL & PINT_PMCTRL_SEL_PMATCH_MASK) | PINT_PMCTRL_ENA_RXEV_MASK; -} - -/*! - * @brief Disable RXEV output. - - * This function disables the pattern match RXEV output. - * - * @param base Base address of the PINT peripheral. - * - * @retval None. - */ -static inline void PINT_PatternMatchDisableRXEV(PINT_Type *base) -{ - base->PMCTRL = (base->PMCTRL & PINT_PMCTRL_SEL_PMATCH_MASK) & ~PINT_PMCTRL_ENA_RXEV_MASK; -} - -/*! - * @brief Enable callback. - - * This function enables the interrupt for the selected PINT peripheral. Although the pin(s) are monitored - * as soon as they are enabled, the callback function is not enabled until this function is called. - * - * @param base Base address of the PINT peripheral. - * - * @retval None. - */ -void PINT_EnableCallback(PINT_Type *base); - -/*! - * @brief Disable callback. - - * This function disables the interrupt for the selected PINT peripheral. Although the pins are still - * being monitored but the callback function is not called. - * - * @param base Base address of the peripheral. - * - * @retval None. - */ -void PINT_DisableCallback(PINT_Type *base); - -/*! - * @brief Deinitialize PINT peripheral. - - * This function disables the PINT clock. - * - * @param base Base address of the PINT peripheral. - * - * @retval None. - */ -void PINT_Deinit(PINT_Type *base); - -/*! - * @brief enable callback by pin index. - - * This function enables callback by pin index instead of enabling all pins. - * - * @param base Base address of the peripheral. - * @param pintIdx pin index. - * - * @retval None. - */ -void PINT_EnableCallbackByIndex(PINT_Type *base, pint_pin_int_t pintIdx); - -/*! - * @brief disable callback by pin index. - - * This function disables callback by pin index instead of disabling all pins. - * - * @param base Base address of the peripheral. - * @param pintIdx pin index. - * - * @retval None. - */ -void PINT_DisableCallbackByIndex(PINT_Type *base, pint_pin_int_t pintIdx); - -#ifdef __cplusplus -} -#endif - -/*@}*/ - -#endif /* FSL_PINT_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_port.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_port.h deleted file mode 100644 index ded8005678c..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_port.h +++ /dev/null @@ -1,679 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_PORT_H_ -#define FSL_PORT_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup port - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.port" -#endif - -/*! @name Driver version */ -/*@{*/ -/*! @brief PORT driver version. */ -#define FSL_PORT_DRIVER_VERSION (MAKE_VERSION(2, 4, 1)) -/*@}*/ - -#if defined(FSL_FEATURE_PORT_HAS_PULL_ENABLE) && FSL_FEATURE_PORT_HAS_PULL_ENABLE -/*! @brief Internal resistor pull feature selection */ -enum _port_pull -{ - kPORT_PullDisable = 0U, /*!< Internal pull-up/down resistor is disabled. */ - kPORT_PullDown = 2U, /*!< Internal pull-down resistor is enabled. */ - kPORT_PullUp = 3U, /*!< Internal pull-up resistor is enabled. */ -}; -#endif /* FSL_FEATURE_PORT_HAS_PULL_ENABLE */ - -#if defined(FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE) && FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE -/*! @brief Internal resistor pull value selection */ -enum _port_pull_value -{ - kPORT_LowPullResistor = 0U, /*!< Low internal pull resistor value is selected. */ - kPORT_HighPullResistor = 1U, /*!< High internal pull resistor value is selected. */ -}; -#endif /* FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE */ - -#if defined(FSL_FEATURE_PORT_HAS_SLEW_RATE) && FSL_FEATURE_PORT_HAS_SLEW_RATE -/*! @brief Slew rate selection */ -enum _port_slew_rate -{ - kPORT_FastSlewRate = 0U, /*!< Fast slew rate is configured. */ - kPORT_SlowSlewRate = 1U, /*!< Slow slew rate is configured. */ -}; -#endif /* FSL_FEATURE_PORT_HAS_SLEW_RATE */ - -#if defined(FSL_FEATURE_PORT_HAS_OPEN_DRAIN) && FSL_FEATURE_PORT_HAS_OPEN_DRAIN -/*! @brief Open Drain feature enable/disable */ -enum _port_open_drain_enable -{ - kPORT_OpenDrainDisable = 0U, /*!< Open drain output is disabled. */ - kPORT_OpenDrainEnable = 1U, /*!< Open drain output is enabled. */ -}; -#endif /* FSL_FEATURE_PORT_HAS_OPEN_DRAIN */ - -#if defined(FSL_FEATURE_PORT_HAS_PASSIVE_FILTER) && FSL_FEATURE_PORT_HAS_PASSIVE_FILTER -/*! @brief Passive filter feature enable/disable */ -enum _port_passive_filter_enable -{ - kPORT_PassiveFilterDisable = 0U, /*!< Passive input filter is disabled. */ - kPORT_PassiveFilterEnable = 1U, /*!< Passive input filter is enabled. */ -}; -#endif - -#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH -/*! @brief Configures the drive strength. */ -enum _port_drive_strength -{ - kPORT_LowDriveStrength = 0U, /*!< Low-drive strength is configured. */ - kPORT_HighDriveStrength = 1U, /*!< High-drive strength is configured. */ -}; -#endif /* FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH */ - -#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1 -/*! @brief Configures the drive strength1. */ -enum _port_drive_strength1 -{ - kPORT_NormalDriveStrength = 0U, /*!< Normal drive strength */ - kPORT_DoubleDriveStrength = 1U, /*!< Double drive strength */ -}; -#endif /* FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1 */ - -#if defined(FSL_FEATURE_PORT_HAS_INPUT_BUFFER) && FSL_FEATURE_PORT_HAS_INPUT_BUFFER -/*! @brief input buffer disable/enable. */ -enum _port_input_buffer -{ - kPORT_InputBufferDisable = 0U, /*!< Digital input is disabled */ - kPORT_InputBufferEnable = 1U, /*!< Digital input is enabled */ -}; -#endif /* FSL_FEATURE_PORT_HAS_INPUT_BUFFER */ - -#if defined(FSL_FEATURE_PORT_HAS_INVERT_INPUT) && FSL_FEATURE_PORT_HAS_INVERT_INPUT -/*! @brief Digital input is not inverted or it is inverted. */ -enum _port_invet_input -{ - kPORT_InputNormal = 0U, /*!< Digital input is not inverted */ - kPORT_InputInvert = 1U, /*!< Digital input is inverted */ -}; -#endif /* FSL_FEATURE_PORT_HAS_INVERT_INPUT */ - -#if defined(FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK) && FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK -/*! @brief Unlock/lock the pin control register field[15:0] */ -enum _port_lock_register -{ - kPORT_UnlockRegister = 0U, /*!< Pin Control Register fields [15:0] are not locked. */ - kPORT_LockRegister = 1U, /*!< Pin Control Register fields [15:0] are locked. */ -}; -#endif /* FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK */ - -#if defined(FSL_FEATURE_PORT_PCR_MUX_WIDTH) && FSL_FEATURE_PORT_PCR_MUX_WIDTH -/*! @brief Pin mux selection */ -typedef enum _port_mux -{ - kPORT_PinDisabledOrAnalog = 0U, /*!< Corresponding pin is disabled, but is used as an analog pin. */ - kPORT_MuxAsGpio = 1U, /*!< Corresponding pin is configured as GPIO. */ - kPORT_MuxAlt0 = 0U, /*!< Chip-specific */ - kPORT_MuxAlt1 = 1U, /*!< Chip-specific */ - kPORT_MuxAlt2 = 2U, /*!< Chip-specific */ - kPORT_MuxAlt3 = 3U, /*!< Chip-specific */ - kPORT_MuxAlt4 = 4U, /*!< Chip-specific */ - kPORT_MuxAlt5 = 5U, /*!< Chip-specific */ - kPORT_MuxAlt6 = 6U, /*!< Chip-specific */ - kPORT_MuxAlt7 = 7U, /*!< Chip-specific */ - kPORT_MuxAlt8 = 8U, /*!< Chip-specific */ - kPORT_MuxAlt9 = 9U, /*!< Chip-specific */ - kPORT_MuxAlt10 = 10U, /*!< Chip-specific */ - kPORT_MuxAlt11 = 11U, /*!< Chip-specific */ - kPORT_MuxAlt12 = 12U, /*!< Chip-specific */ - kPORT_MuxAlt13 = 13U, /*!< Chip-specific */ - kPORT_MuxAlt14 = 14U, /*!< Chip-specific */ - kPORT_MuxAlt15 = 15U, /*!< Chip-specific */ -} port_mux_t; -#endif /* FSL_FEATURE_PORT_PCR_MUX_WIDTH */ - -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) -/*! @brief Configures the interrupt generation condition. */ -typedef enum _port_interrupt -{ - kPORT_InterruptOrDMADisabled = 0x0U, /*!< Interrupt/DMA request is disabled. */ -#if defined(FSL_FEATURE_PORT_HAS_DMA_REQUEST) && FSL_FEATURE_PORT_HAS_DMA_REQUEST || defined(DOXYGEN_OUTPUT) - kPORT_DMARisingEdge = 0x1U, /*!< DMA request on rising edge. */ - kPORT_DMAFallingEdge = 0x2U, /*!< DMA request on falling edge. */ - kPORT_DMAEitherEdge = 0x3U, /*!< DMA request on either edge. */ -#endif -#if defined(FSL_FEATURE_PORT_HAS_IRQC_FLAG) && FSL_FEATURE_PORT_HAS_IRQC_FLAG || defined(DOXYGEN_OUTPUT) - kPORT_FlagRisingEdge = 0x05U, /*!< Flag sets on rising edge. */ - kPORT_FlagFallingEdge = 0x06U, /*!< Flag sets on falling edge. */ - kPORT_FlagEitherEdge = 0x07U, /*!< Flag sets on either edge. */ -#endif - kPORT_InterruptLogicZero = 0x8U, /*!< Interrupt when logic zero. */ - kPORT_InterruptRisingEdge = 0x9U, /*!< Interrupt on rising edge. */ - kPORT_InterruptFallingEdge = 0xAU, /*!< Interrupt on falling edge. */ - kPORT_InterruptEitherEdge = 0xBU, /*!< Interrupt on either edge. */ - kPORT_InterruptLogicOne = 0xCU, /*!< Interrupt when logic one. */ -#if defined(FSL_FEATURE_PORT_HAS_IRQC_TRIGGER) && FSL_FEATURE_PORT_HAS_IRQC_TRIGGER || defined(DOXYGEN_OUTPUT) - kPORT_ActiveHighTriggerOutputEnable = 0xDU, /*!< Enable active high-trigger output. */ - kPORT_ActiveLowTriggerOutputEnable = 0xEU, /*!< Enable active low-trigger output. */ -#endif -} port_interrupt_t; -#endif - -#if defined(FSL_FEATURE_PORT_HAS_DIGITAL_FILTER) && FSL_FEATURE_PORT_HAS_DIGITAL_FILTER -/*! @brief Digital filter clock source selection */ -typedef enum _port_digital_filter_clock_source -{ - kPORT_BusClock = 0U, /*!< Digital filters are clocked by the bus clock. */ - kPORT_LpoClock = 1U, /*!< Digital filters are clocked by the 1 kHz LPO clock. */ -} port_digital_filter_clock_source_t; - -/*! @brief PORT digital filter feature configuration definition */ -typedef struct _port_digital_filter_config -{ - uint32_t digitalFilterWidth; /*!< Set digital filter width */ - port_digital_filter_clock_source_t clockSource; /*!< Set digital filter clockSource */ -} port_digital_filter_config_t; -#endif /* FSL_FEATURE_PORT_HAS_DIGITAL_FILTER */ - -#if defined(FSL_FEATURE_PORT_PCR_MUX_WIDTH) && FSL_FEATURE_PORT_PCR_MUX_WIDTH -/*! @brief PORT pin configuration structure */ -typedef struct _port_pin_config -{ -#if defined(FSL_FEATURE_PORT_HAS_PULL_ENABLE) && FSL_FEATURE_PORT_HAS_PULL_ENABLE - uint16_t pullSelect : 2; /*!< No-pull/pull-down/pull-up select */ -#else - uint16_t : 2; -#endif /* FSL_FEATURE_PORT_HAS_PULL_ENABLE */ - -#if defined(FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE) && FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE - uint16_t pullValueSelect : 1; /*!< Pull value select */ -#endif /* FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE */ - -#if defined(FSL_FEATURE_PORT_HAS_SLEW_RATE) && FSL_FEATURE_PORT_HAS_SLEW_RATE - uint16_t slewRate : 1; /*!< Fast/slow slew rate Configure */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_SLEW_RATE */ - -#if !(defined(FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE) && FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE) - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE */ - -#if defined(FSL_FEATURE_PORT_HAS_PASSIVE_FILTER) && FSL_FEATURE_PORT_HAS_PASSIVE_FILTER - uint16_t passiveFilterEnable : 1; /*!< Passive filter enable/disable */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_PASSIVE_FILTER */ - -#if defined(FSL_FEATURE_PORT_HAS_OPEN_DRAIN) && FSL_FEATURE_PORT_HAS_OPEN_DRAIN - uint16_t openDrainEnable : 1; /*!< Open drain enable/disable */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_OPEN_DRAIN */ - -#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH - uint16_t driveStrength : 1; /*!< Fast/slow drive strength configure */ -#else - uint16_t : 1; -#endif - -#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1 - uint16_t driveStrength1 : 1; /*!< Normal/Double drive strength enable/disable */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1 */ - -#if defined(FSL_FEATURE_PORT_PCR_MUX_WIDTH) && (FSL_FEATURE_PORT_PCR_MUX_WIDTH == 3) - uint16_t mux : 3; /*!< Pin mux Configure */ - uint16_t : 1; -#elif defined(FSL_FEATURE_PORT_PCR_MUX_WIDTH) && (FSL_FEATURE_PORT_PCR_MUX_WIDTH == 4) - uint16_t mux : 4; /*!< Pin mux Configure */ -#else - uint16_t : 4; -#endif - -#if defined(FSL_FEATURE_PORT_HAS_INPUT_BUFFER) && FSL_FEATURE_PORT_HAS_INPUT_BUFFER - uint16_t inputBuffer : 1; /*!< Input Buffer Configure */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_INPUT_BUFFER */ - -#if defined(FSL_FEATURE_PORT_HAS_INVERT_INPUT) && FSL_FEATURE_PORT_HAS_INVERT_INPUT - uint16_t invertInput : 1; /*!< Invert Input Configure */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_INVERT_INPUT */ - - uint16_t : 1; - -#if defined(FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK) && FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK - uint16_t lockRegister : 1; /*!< Lock/unlock the PCR field[15:0] */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK */ -} port_pin_config_t; -#endif /* FSL_FEATURE_PORT_PCR_MUX_WIDTH */ - -#if defined(FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER) && FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER -/*! @brief PORT version information. */ -typedef struct _port_version_info -{ - uint16_t feature; /*!< Feature Specification Number. */ - uint8_t minor; /*!< Minor Version Number. */ - uint8_t major; /*!< Major Version Number. */ -} port_version_info_t; -#endif /* FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER */ - -#if defined(FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE) && FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE -/*! @brief PORT voltage range. */ -typedef enum _port_voltage_range -{ - kPORT_VoltageRange1Dot71V_3Dot6V = 0x0U, /*!< Port voltage range is 1.71 V - 3.6 V. */ - kPORT_VoltageRange2Dot70V_3Dot6V = 0x1U, /*!< Port voltage range is 2.70 V - 3.6 V. */ -} port_voltage_range_t; -#endif /* FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -#if defined(FSL_FEATURE_PORT_PCR_MUX_WIDTH) && FSL_FEATURE_PORT_PCR_MUX_WIDTH -/*! @name Configuration */ -/*@{*/ - -#if defined(FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER) && FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER -/*! - * @brief Get PORT version information. - * - * @param base PORT peripheral base pointer - * @param info PORT version information - */ -static inline void PORT_GetVersionInfo(PORT_Type *base, port_version_info_t *info) -{ - uint32_t verid = base->VERID; - info->feature = (uint16_t)verid; - info->minor = (uint8_t)(verid >> PORT_VERID_MINOR_SHIFT); - info->major = (uint8_t)(verid >> PORT_VERID_MAJOR_SHIFT); -} -#endif /* FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER */ - -#if defined(FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE) && FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE -/*! - * @brief Get PORT version information. - * - * @note : PORTA_CONFIG[RANGE] controls the voltage ranges of Port A, B, and C. Read or write PORTB_CONFIG[RANGE] and - * PORTC_CONFIG[RANGE] does not take effect. - * - * @param base PORT peripheral base pointer - * @param range port voltage range - */ -static inline void PORT_SecletPortVoltageRange(PORT_Type *base, port_voltage_range_t range) -{ - base->CONFIG = (uint32_t)range; -} -#endif /* FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE */ - -/*! - * @brief Sets the port PCR register. - * - * This is an example to define an input pin or output pin PCR configuration. - * @code - * // Define a digital input pin PCR configuration - * port_pin_config_t config = { - * kPORT_PullUp, - * kPORT_FastSlewRate, - * kPORT_PassiveFilterDisable, - * kPORT_OpenDrainDisable, - * kPORT_LowDriveStrength, - * kPORT_MuxAsGpio, - * kPORT_UnLockRegister, - * }; - * @endcode - * - * @param base PORT peripheral base pointer. - * @param pin PORT pin number. - * @param config PORT PCR register configuration structure. - */ -static inline void PORT_SetPinConfig(PORT_Type *base, uint32_t pin, const port_pin_config_t *config) -{ - assert(config); - uint32_t addr = (uint32_t)&base->PCR[pin]; - *(volatile uint16_t *)(addr) = *((const uint16_t *)(const void *)config); -} - -/*! - * @brief Sets the port PCR register for multiple pins. - * - * This is an example to define input pins or output pins PCR configuration. - * @code - * Define a digital input pin PCR configuration - * port_pin_config_t config = { - * kPORT_PullUp , - * kPORT_PullEnable, - * kPORT_FastSlewRate, - * kPORT_PassiveFilterDisable, - * kPORT_OpenDrainDisable, - * kPORT_LowDriveStrength, - * kPORT_MuxAsGpio, - * kPORT_UnlockRegister, - * }; - * @endcode - * - * @param base PORT peripheral base pointer. - * @param mask PORT pin number macro. - * @param config PORT PCR register configuration structure. - */ -static inline void PORT_SetMultiplePinsConfig(PORT_Type *base, uint32_t mask, const port_pin_config_t *config) -{ - assert(config); - - uint16_t pcrl = *((const uint16_t *)(const void *)config); - - if (0U != (mask & 0xffffU)) - { - base->GPCLR = ((mask & 0xffffU) << 16) | pcrl; - } - if (0U != (mask >> 16)) - { - base->GPCHR = (mask & 0xffff0000U) | pcrl; - } -} - -#if defined(FSL_FEATURE_PORT_HAS_MULTIPLE_IRQ_CONFIG) && FSL_FEATURE_PORT_HAS_MULTIPLE_IRQ_CONFIG -/*! - * @brief Sets the port interrupt configuration in PCR register for multiple pins. - * - * @param base PORT peripheral base pointer. - * @param mask PORT pin number macro. - * @param config PORT pin interrupt configuration. - * - #kPORT_InterruptOrDMADisabled: Interrupt/DMA request disabled. - * - #kPORT_DMARisingEdge : DMA request on rising edge(if the DMA requests exit). - * - #kPORT_DMAFallingEdge: DMA request on falling edge(if the DMA requests exit). - * - #kPORT_DMAEitherEdge : DMA request on either edge(if the DMA requests exit). - * - #kPORT_FlagRisingEdge : Flag sets on rising edge(if the Flag states exit). - * - #kPORT_FlagFallingEdge : Flag sets on falling edge(if the Flag states exit). - * - #kPORT_FlagEitherEdge : Flag sets on either edge(if the Flag states exit). - * - #kPORT_InterruptLogicZero : Interrupt when logic zero. - * - #kPORT_InterruptRisingEdge : Interrupt on rising edge. - * - #kPORT_InterruptFallingEdge: Interrupt on falling edge. - * - #kPORT_InterruptEitherEdge : Interrupt on either edge. - * - #kPORT_InterruptLogicOne : Interrupt when logic one. - * - #kPORT_ActiveHighTriggerOutputEnable : Enable active high-trigger output (if the trigger states exit). - * - #kPORT_ActiveLowTriggerOutputEnable : Enable active low-trigger output (if the trigger states exit).. - */ -static inline void PORT_SetMultipleInterruptPinsConfig(PORT_Type *base, uint32_t mask, port_interrupt_t config) -{ - assert(config); - - if (0U != ((uint32_t)mask & 0xffffU)) - { - base->GICLR = ((uint32_t)config << 16U) | ((uint32_t)mask & 0xffffU); - } - mask = mask >> 16; - if (0U != mask) - { - base->GICHR = ((uint32_t)config << 16U) | ((uint32_t)mask & 0xffffU); - } -} -#endif - -/*! - * @brief Configures the pin muxing. - * - * @param base PORT peripheral base pointer. - * @param pin PORT pin number. - * @param mux pin muxing slot selection. - * - #kPORT_PinDisabledOrAnalog: Pin disabled or work in analog function. - * - #kPORT_MuxAsGpio : Set as GPIO. - * - #kPORT_MuxAlt2 : chip-specific. - * - #kPORT_MuxAlt3 : chip-specific. - * - #kPORT_MuxAlt4 : chip-specific. - * - #kPORT_MuxAlt5 : chip-specific. - * - #kPORT_MuxAlt6 : chip-specific. - * - #kPORT_MuxAlt7 : chip-specific. - * @note : This function is NOT recommended to use together with the PORT_SetPinsConfig, because - * the PORT_SetPinsConfig need to configure the pin mux anyway (Otherwise the pin mux is - * reset to zero : kPORT_PinDisabledOrAnalog). - * This function is recommended to use to reset the pin mux - * - */ -static inline void PORT_SetPinMux(PORT_Type *base, uint32_t pin, port_mux_t mux) -{ - base->PCR[pin] = (base->PCR[pin] & ~PORT_PCR_MUX_MASK) | PORT_PCR_MUX(mux); -} -#endif /* FSL_FEATURE_PORT_PCR_MUX_WIDTH */ - -#if defined(FSL_FEATURE_PORT_HAS_DIGITAL_FILTER) && FSL_FEATURE_PORT_HAS_DIGITAL_FILTER - -/*! - * @brief Enables the digital filter in one port, each bit of the 32-bit register represents one pin. - * - * @param base PORT peripheral base pointer. - * @param mask PORT pin number macro. - * @param enable PORT digital filter configuration. - */ -static inline void PORT_EnablePinsDigitalFilter(PORT_Type *base, uint32_t mask, bool enable) -{ - if (enable == true) - { - base->DFER |= mask; - } - else - { - base->DFER &= ~mask; - } -} - -/*! - * @brief Sets the digital filter in one port, each bit of the 32-bit register represents one pin. - * - * @param base PORT peripheral base pointer. - * @param config PORT digital filter configuration structure. - */ -static inline void PORT_SetDigitalFilterConfig(PORT_Type *base, const port_digital_filter_config_t *config) -{ - assert(config); - - base->DFCR = PORT_DFCR_CS(config->clockSource); - base->DFWR = PORT_DFWR_FILT(config->digitalFilterWidth); -} - -#endif /* FSL_FEATURE_PORT_HAS_DIGITAL_FILTER */ -/*@}*/ - -/*! @name Interrupt */ -/*@{*/ - -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) -/*! - * @brief Configures the port pin interrupt/DMA request. - * - * @param base PORT peripheral base pointer. - * @param pin PORT pin number. - * @param config PORT pin interrupt configuration. - * - #kPORT_InterruptOrDMADisabled: Interrupt/DMA request disabled. - * - #kPORT_DMARisingEdge : DMA request on rising edge(if the DMA requests exit). - * - #kPORT_DMAFallingEdge: DMA request on falling edge(if the DMA requests exit). - * - #kPORT_DMAEitherEdge : DMA request on either edge(if the DMA requests exit). - * - #kPORT_FlagRisingEdge : Flag sets on rising edge(if the Flag states exit). - * - #kPORT_FlagFallingEdge : Flag sets on falling edge(if the Flag states exit). - * - #kPORT_FlagEitherEdge : Flag sets on either edge(if the Flag states exit). - * - #kPORT_InterruptLogicZero : Interrupt when logic zero. - * - #kPORT_InterruptRisingEdge : Interrupt on rising edge. - * - #kPORT_InterruptFallingEdge: Interrupt on falling edge. - * - #kPORT_InterruptEitherEdge : Interrupt on either edge. - * - #kPORT_InterruptLogicOne : Interrupt when logic one. - * - #kPORT_ActiveHighTriggerOutputEnable : Enable active high-trigger output (if the trigger states exit). - * - #kPORT_ActiveLowTriggerOutputEnable : Enable active low-trigger output (if the trigger states exit). - */ -static inline void PORT_SetPinInterruptConfig(PORT_Type *base, uint32_t pin, port_interrupt_t config) -{ - base->PCR[pin] = (base->PCR[pin] & ~PORT_PCR_IRQC_MASK) | PORT_PCR_IRQC(config); -} -#endif - -#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH -/*! - * @brief Configures the port pin drive strength. - * - * @param base PORT peripheral base pointer. - * @param pin PORT pin number. - * @param strength PORT pin drive strength - * - #kPORT_LowDriveStrength = 0U - Low-drive strength is configured. - * - #kPORT_HighDriveStrength = 1U - High-drive strength is configured. - */ -static inline void PORT_SetPinDriveStrength(PORT_Type *base, uint32_t pin, uint8_t strength) -{ - base->PCR[pin] = (base->PCR[pin] & ~PORT_PCR_DSE_MASK) | PORT_PCR_DSE(strength); -} -#endif - -#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1 -/*! - * @brief Enables the port pin double drive strength. - * - * @param base PORT peripheral base pointer. - * @param pin PORT pin number. - * @param enable PORT pin drive strength configuration. - */ -static inline void PORT_EnablePinDoubleDriveStrength(PORT_Type *base, uint32_t pin, bool enable) -{ - base->PCR[pin] = (base->PCR[pin] & ~PORT_PCR_DSE1_MASK) | PORT_PCR_DSE1(enable); -} -#endif - -#if defined(FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE) && FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE -/*! - * @brief Configures the port pin pull value. - * - * @param base PORT peripheral base pointer. - * @param pin PORT pin number. - * @param value PORT pin pull value - * - #kPORT_LowPullResistor = 0U - Low internal pull resistor value is selected. - * - #kPORT_HighPullResistor = 1U - High internal pull resistor value is selected. - */ -static inline void PORT_SetPinPullValue(PORT_Type *base, uint32_t pin, uint8_t value) -{ - base->PCR[pin] = (base->PCR[pin] & ~PORT_PCR_PV_MASK) | PORT_PCR_PV(value); -} -#endif /* FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE */ - -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) -/*! - * @brief Reads the whole port status flag. - * - * If a pin is configured to generate the DMA request, the corresponding flag - * is cleared automatically at the completion of the requested DMA transfer. - * Otherwise, the flag remains set until a logic one is written to that flag. - * If configured for a level sensitive interrupt that remains asserted, the flag - * is set again immediately. - * - * @param base PORT peripheral base pointer. - * @return Current port interrupt status flags, for example, 0x00010001 means the - * pin 0 and 16 have the interrupt. - */ -static inline uint32_t PORT_GetPinsInterruptFlags(PORT_Type *base) -{ - return base->ISFR; -} - -/*! - * @brief Clears the multiple pin interrupt status flag. - * - * @param base PORT peripheral base pointer. - * @param mask PORT pin number macro. - */ -static inline void PORT_ClearPinsInterruptFlags(PORT_Type *base, uint32_t mask) -{ - base->ISFR = mask; -} -#endif - -#if defined(FSL_FEATURE_PORT_SUPPORT_EFT) && FSL_FEATURE_PORT_SUPPORT_EFT -/*! - * @brief Get EFT detect flags. - * - * @param base PORT peripheral base pointer - * @return EFT detect flags - */ -static inline uint32_t PORT_GetEFTDetectFlags(PORT_Type *base) -{ - return base->EDFR; -} - -/*! - * @brief Enable EFT detect interrupts. - * - * @param base PORT peripheral base pointer - * @param interrupt EFT detect interrupt - */ -static inline void PORT_EnableEFTDetectInterrupts(PORT_Type *base, uint32_t interrupt) -{ - base->EDIER |= interrupt; -} - -/*! - * @brief Disable EFT detect interrupts. - * - * @param base PORT peripheral base pointer - * @param interrupt EFT detect interrupt - */ -static inline void PORT_DisableEFTDetectInterrupts(PORT_Type *base, uint32_t interrupt) -{ - base->EDIER &= ~interrupt; -} - -/*! - * @brief Clear all low EFT detector. - * - * @note : Port B and Port C pins share the same EFT detector clear control from PORTC_EDCR register. Any write to the - * PORTB_EDCR does not take effect. - * @param base PORT peripheral base pointer - * @param interrupt EFT detect interrupt - */ -static inline void PORT_ClearAllLowEFTDetectors(PORT_Type *base) -{ - base->EDCR |= PORT_EDCR_EDLC_MASK; - base->EDCR &= ~PORT_EDCR_EDLC_MASK; -} - -/*! - * @brief Clear all high EFT detector. - * - * @param base PORT peripheral base pointer - * @param interrupt EFT detect interrupt - */ -static inline void PORT_ClearAllHighEFTDetectors(PORT_Type *base) -{ - base->EDCR |= PORT_EDCR_EDHC_MASK; - base->EDCR &= ~PORT_EDCR_EDHC_MASK; -} -#endif /* FSL_FEATURE_PORT_SUPPORT_EFT */ - -/*@}*/ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_PORT_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_puf_v3.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_puf_v3.c deleted file mode 100644 index de5ff296b36..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_puf_v3.c +++ /dev/null @@ -1,1000 +0,0 @@ -/* - * Copyright 2020,2023 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_common.h" -#include "fsl_puf_v3.h" -#include "fsl_clock.h" -#include "fsl_reset.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.puf_v3" -#endif - -#define kPUF_OperationInProgress (0x0u) -#define kPUF_Enroll (0x1u) -#define kPUF_Start (0x2u) -#define kPUF_Stop (0x5u) -#define kPUF_GetKey (0x6u) -#define kPUF_Unwrap (0x7u) -#define kPUF_WrapGeneratedRandom (0x8u) -#define kPUF_Wrap (0x9u) -#define kPUF_GenerateRandom (0xfu) -#define kPUF_Test (0x1fu) -#define kPUF_Init (0x20u) -#define kPUF_Zeroize (0x2fu) -typedef uint32_t puf_last_operation_t; - -#define PUF_KEY_OPERATION_CONTEXT_TYPE (0x10UL << 16UL) -#define PUF_CONTEXT_GENERIC_KEY_TYPE (0x0u) -#define PUF_CONTEXT_KEY_LEN_MASK (0x1fffu) - -/******************************************************************************* - * Code - ******************************************************************************/ - -static status_t puf_waitForInit(PUF_Type *base) -{ - status_t status = kStatus_Fail; - - /* wait until status register reads non-zero. All zero is not valid. It should be BUSY or OK or ERROR */ - while (0u == base->SR) - { - } - - /* wait if busy */ - while ((base->SR & PUF_SR_BUSY_MASK) != 0u) - { - } - - /* return status */ - if (0U != (base->SR & (PUF_SR_OK_MASK | PUF_SR_ERROR_MASK))) - { - status = kStatus_Success; - } - - return status; -} - -static void puf_powerOn(PUF_Type *base, puf_config_t *conf) -{ - /* Power On PUF SRAM */ - base->SRAM_CFG = 0x1u; - while (0u == (PUF_SRAM_STATUS_READY_MASK & base->SRAM_STATUS)) - { - } -} - -static status_t puf_powerCycle(PUF_Type *base, puf_config_t *conf) -{ - /* Power off */ - base->SRAM_CFG = 0x0u; - - /* Reset PUF and reenable power to PUF SRAM */ - RESET_PeripheralReset(kPUF_RST_SHIFT_RSTn); - puf_powerOn(base, conf); - - return kStatus_Success; -} - -static status_t puf_makeStatus(PUF_Type *base, puf_last_operation_t operation) -{ - uint32_t result; - status_t status = kStatus_Fail; - - if (((base->ORR & PUF_ORR_LAST_OPERATION_MASK) >> PUF_ORR_LAST_OPERATION_SHIFT) == operation) - { - result = (base->ORR & PUF_ORR_RESULT_CODE_MASK); - if ((result == kPUF_ResultOK) && (0u == (base->SR & PUF_SR_ERROR_MASK))) - { - status = kStatus_Success; - } - else - { - status = MAKE_STATUS((int32_t)kStatusGroup_PUF, (int32_t)result); - } - } - - return status; -} - -/*! - * brief Sets the default configuration of PUF - * - * This function initialize PUF config structure to default values. - * - * @param conf PUF configuration structure - */ -void PUF_GetDefaultConfig(puf_config_t *conf) -{ - /* Default configuration after reset */ - conf->dataEndianness = kPUF_EndianBig; - conf->CKGATING = 0U; -} - -/*! - * brief Initialize PUF - * - * This function enables power to PUF block and waits until the block initializes. - * - * @param conf PUF configuration structure - * @return Status of the init operation - */ -status_t PUF_Init(PUF_Type *base, puf_config_t *conf) -{ - status_t status = kStatus_Fail; - - /* Enable PUF clock */ - CLOCK_EnableClock(kCLOCK_Puf); - - /* Clear the PUF peripheral reset */ - RESET_ClearPeripheralReset(kPUF_RST_SHIFT_RSTn); - - /* Reset PUF */ -#if defined(FSL_FEATURE_PUF_HAS_RESET) && FSL_FEATURE_PUF_HAS_RESET - RESET_PeripheralReset(kPUF_RST_SHIFT_RSTn); -#endif /* FSL_FEATURE_PUF_HAS_RESET */ - - /* Set configuration from SRAM */ - base->SRAM_CFG |= PUF_SRAM_CFG_CKGATING(conf->CKGATING); - - /* Enable power to PUF SRAM */ - puf_powerOn(base, conf); - - /* Wait for peripheral to become ready */ - status = puf_waitForInit(base); - - /* In case of error or enroll & start not allowed, do power-cycle */ - if ((status != kStatus_Success) || ((PUF_AR_ALLOW_ENROLL_MASK | PUF_AR_ALLOW_START_MASK) != - (base->AR & (PUF_AR_ALLOW_ENROLL_MASK | PUF_AR_ALLOW_START_MASK)))) - { - (void)puf_powerCycle(base, conf); - status = puf_waitForInit(base); - } - - if (kStatus_Success == status) - { - /* Set data endianness */ - base->MISC = PUF_MISC_DATA_ENDIANNESS(conf->dataEndianness); - - /* get status */ - status = puf_makeStatus(base, kPUF_Init); - } - - return status; -} - -/*! - * brief Denitialize PUF - * - * This function disables power to PUF SRAM and peripheral clock. - * - * @param base PUF peripheral base address - * @param conf PUF configuration structure - */ -void PUF_Deinit(PUF_Type *base, puf_config_t *conf) -{ - base->SRAM_CFG = 0x0u; - - RESET_PeripheralReset(kPUF_RST_SHIFT_RSTn); - CLOCK_DisableClock(kCLOCK_Puf); -} - -/*! - * brief Enroll PUF - * - * This function derives a digital fingerprint, generates the corresponding Activation Code (AC) - * and returns it to be stored in an NVM or a file. This step needs to be - * performed only once for each device. This function may be permanently disallowed by a fuse. - * - * @param base PUF peripheral base address - * @param[out] activationCode Word aligned address of the resulting activation code. - * @param activationCodeSize Size of the activationCode buffer in bytes. Shall be FSL_FEATURE_PUF_ACTIVATION_CODE_SIZE bytes. - * @param score Value of the PUF Score that was obtained during the enroll operation. - * @return Status of enroll operation. - */ -status_t PUF_Enroll(PUF_Type *base, uint8_t *activationCode, size_t activationCodeSize, uint8_t *score) -{ - status_t status = kStatus_Fail; - uint32_t *activationCodeAligned = NULL; - register uint32_t temp32 = 0; - - /* check that activation code buffer size is at least FSL_FEATURE_PUF_ACTIVATION_CODE_SIZE bytes */ - if (activationCodeSize < PUF_ACTIVATION_CODE_SIZE) - { - return kStatus_InvalidArgument; - } - - /* only work with aligned and valid activationCode */ - if ((0U != (0x3u & (uintptr_t)activationCode)) || (activationCode == NULL)) - { - return kStatus_InvalidArgument; - } - - activationCodeAligned = (uint32_t *)(uintptr_t)activationCode; - - /* check if ENROLL is allowed */ - if (0x0u == (base->AR & PUF_AR_ALLOW_ENROLL_MASK)) - { - return kStatus_PUF_OperationNotAllowed; - } - - /* begin */ - base->CR = PUF_CR_ENROLL_MASK; - - /* wait till command is accepted */ - while (0u != (base->CR & PUF_CR_ENROLL_MASK)) - { - } - - /* read out AC */ - while (0u != (base->SR & PUF_SR_BUSY_MASK)) - { - if (0u != (PUF_SR_DO_REQUEST_MASK & base->SR)) - { - temp32 = base->DOR; - if (activationCodeSize >= sizeof(uint32_t)) - { - *activationCodeAligned = temp32; - activationCodeAligned++; - activationCodeSize -= sizeof(uint32_t); - } - } - } - - /* In case of success fill in score */ - if ((0u != (base->SR & PUF_SR_OK_MASK)) && (score != NULL)) - { - *score = (uint8_t)(base->PSR & PUF_PSR_PUF_SCORE_MASK); - } - - /* get status */ - status = puf_makeStatus(base, kPUF_Enroll); - - return status; -} - -/*! - * brief Start PUF - * - * The Activation Code generated during the Enroll operation is used to - * reconstruct the digital fingerprint. This needs to be done after every power-up - * and reset. - * - * @param base PUF peripheral base address - * @param[in] activationCode Word aligned address of the input activation code. - * @param activationCodeSize Size of the activationCode buffer in bytes. Shall be FSL_FEATURE_PUF_ACTIVATION_CODE_SIZE bytes. - * @param score Value of the PUF Score that was obtained during the start operation. - * return Status of start operation. - */ -status_t PUF_Start(PUF_Type *base, const uint8_t *activationCode, size_t activationCodeSize, uint8_t *score) -{ - status_t status = kStatus_Fail; - const uint32_t *activationCodeAligned = NULL; - register uint32_t temp32 = 0; - - /* check that activation code size is at least FSL_FEATURE_PUF_ACTIVATION_CODE_SIZE bytes */ - if (activationCodeSize < PUF_ACTIVATION_CODE_SIZE) - { - return kStatus_InvalidArgument; - } - - /* Set activationCodeSize to FSL_FEATURE_PUF_ACTIVATION_CODE_SIZE bytes */ - activationCodeSize = PUF_ACTIVATION_CODE_SIZE; - - /* only work with aligned activationCode */ - if ((0U != (0x3u & (uintptr_t)activationCode)) || (activationCode == NULL)) - { - return kStatus_InvalidArgument; - } - - activationCodeAligned = (const uint32_t *)(uintptr_t)activationCode; - - /* check if START is allowed */ - if (0x0u == (base->AR & PUF_AR_ALLOW_START_MASK)) - { - return kStatus_PUF_OperationNotAllowed; - } - - /* begin */ - base->CR = PUF_CR_START_MASK; - - /* wait till command is accepted */ - while (0u != (base->CR & PUF_CR_START_MASK)) - { - } - - /* while busy send AC */ - while (0u != (base->SR & PUF_SR_BUSY_MASK)) - { - if (0u != (PUF_SR_DI_REQUEST_MASK & base->SR)) - { - if (activationCodeSize >= sizeof(uint32_t)) - { - temp32 = *activationCodeAligned; - activationCodeAligned++; - activationCodeSize -= sizeof(uint32_t); - } - /* Send AC again */ - else - { - activationCodeAligned = (const uint32_t *)(uintptr_t)activationCode; - temp32 = *activationCodeAligned; - activationCodeAligned++; - activationCodeSize = PUF_ACTIVATION_CODE_SIZE - sizeof(uint32_t); - } - base->DIR = temp32; - } - } - - /* In case of success fill in score */ - if ((0u != (base->SR & PUF_SR_OK_MASK)) && (score != NULL)) - { - *score = (uint8_t)(base->PSR & PUF_PSR_PUF_SCORE_MASK); - } - - /* get status */ - status = puf_makeStatus(base, kPUF_Start); - - return status; -} - -/*! - * brief Stop PUF - * - * The Stop operation removes all key material from PUF flipflops and PUF SRAM, and sets - * PUF to the Stopped state. - * - * @param base PUF peripheral base address - * @return Status of stop operation. - */ -status_t PUF_Stop(PUF_Type *base) -{ - status_t status = kStatus_Fail; - - /* check if STOP is allowed */ - if (0x0u == (base->AR & PUF_AR_ALLOW_STOP_MASK)) - { - return kStatus_PUF_OperationNotAllowed; - } - - /* begin */ - base->CR = PUF_CR_STOP_MASK; - - /* wait till command is accepted */ - while (0u != (base->CR & PUF_CR_STOP_MASK)) - { - } - - /* wait while busy */ - while (0u != (base->SR & PUF_SR_BUSY_MASK)) - { - } - - /* get status */ - status = puf_makeStatus(base, kPUF_Stop); - - return status; -} - -/*! - * brief PUF Get Key - * - * The Get Key operation derives a key from the intrinsic PUF key and externally provided context. - * - * @param base PUF peripheral base address - * @param keyCtx PUF key context struct - * @param keyDest output destination of the derived PUF key - * @param[out] key Word aligned address of output key (only used when kPUF_KeyDestRegister). - * @param keySize Size of the derived key in bytes. - * @return Status of get key operation. - */ -status_t PUF_GetKey(PUF_Type *base, puf_key_ctx_t *keyCtx, puf_key_dest_t keyDest, uint8_t *key, size_t keySize) -{ - uint8_t idx = 0; - uint32_t *keyAligned = NULL; - uint32_t context[4] = {0}; - status_t status = kStatus_Fail; - - /* check if GET KEY is allowed */ - if (0x0u == (base->AR & PUF_AR_ALLOW_GET_KEY_MASK)) - { - return kStatus_PUF_OperationNotAllowed; - } - - /* check for key context */ - if (keyCtx == NULL) - { - return kStatus_InvalidArgument; - } - - /* check for valid key destination */ - if (((keyDest == kPUF_KeyDestRegister) && (key == NULL)) || (keyDest == kPUF_KeyDestInvalid)) - { - return kStatus_InvalidArgument; - } - - /* check for valid key size. */ - /* must be 8byte multiple */ - if (0U != (keySize & 0x7u)) - { - return kStatus_InvalidArgument; - } - /* if keySize > 128bytes, it must be equal to 256bytes or 384bytes or 512bytes */ - if ((keySize > 128u) && !((keySize == 256u) || (keySize == 384u) || (keySize == 512u))) - { - return kStatus_InvalidArgument; - } - - /* only work with aligned key */ - if (0U != (0x3u & (uintptr_t)key)) - { - return kStatus_InvalidArgument; - } - - keyAligned = (uint32_t *)(uintptr_t)key; - - /* fill in key context */ - context[0] = PUF_KEY_OPERATION_CONTEXT_TYPE | ((keySize * 8u) & PUF_CONTEXT_KEY_LEN_MASK); - context[1] = PUF_CONTEXT_GENERIC_KEY_TYPE | (keyCtx->keyScopeStarted << 8u) | keyCtx->keyScopeEnrolled; - context[2] = keyCtx->userCtx0; - context[3] = keyCtx->userCtx1; - - /* set key destination */ - base->DATA_DEST = keyDest; - - /* begin */ - base->CR = PUF_CR_GET_KEY_MASK; - - /* wait till command is accepted */ - while (0u != (base->CR & PUF_CR_GET_KEY_MASK)) - { - } - - /* send context and read output data while busy */ - while (0U != (base->SR & PUF_SR_BUSY_MASK)) - { - if ((0U != (PUF_SR_DI_REQUEST_MASK & base->SR)) && (idx < 4u)) - { - base->DIR = context[idx]; - idx++; - } - - if ((0U != (PUF_SR_DO_REQUEST_MASK & base->SR)) && (kPUF_KeyDestRegister == keyDest)) - { - if (keySize >= sizeof(uint32_t)) - { - *keyAligned = base->DOR; - keyAligned++; - keySize -= sizeof(uint32_t); - } - } - } - - /* get status */ - status = puf_makeStatus(base, kPUF_GetKey); - - return status; -} - -/*! - * brief PUF Wrap generated random - * - * The Wrap Generated Random operation wraps a random key into a Key Code (KC). - * - * @param base PUF peripheral base address - * @param keyCtx PUF key context struct - * @param keySize Size of the key to be generated in bytes. - * @param[out] keyCode Word aligned address of the resulting key code. - * @param keyCodeSize Size of the output keycode in bytes. - * @return Status of wrap generated random operation. - */ -status_t PUF_WrapGeneratedRandom( - PUF_Type *base, puf_key_ctx_t *keyCtx, size_t keySize, uint8_t *keyCode, size_t keyCodeSize) -{ - uint8_t idx = 0; - uint32_t *keyCodeAligned = NULL; - uint32_t context[4] = {0}; - status_t status = kStatus_Fail; - - /* check if WRAP GENERATED RANDOM is allowed */ - if (0x0u == (base->AR & PUF_AR_ALLOW_WRAP_GENERATED_RANDOM_MASK)) - { - return kStatus_PUF_OperationNotAllowed; - } - - /* check for valid key context and keyCode buffer */ - if ((keyCtx == NULL) || (keyCode == NULL)) - { - return kStatus_InvalidArgument; - } - - /* check for valid key size. */ - /* must be 8byte multiple */ - if (0U != (keySize & 0x7u)) - { - return kStatus_InvalidArgument; - } - /* if keySize > 128bytes, it must be equal to 256bytes or 384bytes or 512bytes */ - if ((keySize > 128u) && !((keySize == 256u) || (keySize == 384u) || (keySize == 512u))) - { - return kStatus_InvalidArgument; - } - - /* check that keyCodeSize is correct for given keySize */ - if (keyCodeSize < PUF_GET_KEY_CODE_SIZE_FOR_KEY_SIZE(keySize)) - { - return kStatus_InvalidArgument; - } - - /* only work with aligned key code */ - if (0U != (0x3u & (uintptr_t)keyCode)) - { - return kStatus_InvalidArgument; - } - - keyCodeAligned = (uint32_t *)(uintptr_t)keyCode; - - /* fill in key context */ - context[0] = PUF_KEY_OPERATION_CONTEXT_TYPE | ((keySize * 8u) & 0x1FFFu); - context[1] = PUF_CONTEXT_GENERIC_KEY_TYPE | (keyCtx->keyScopeStarted << 8u) | keyCtx->keyScopeEnrolled; - context[2] = keyCtx->userCtx0; - context[3] = keyCtx->userCtx1; - - /* begin */ - base->CR = PUF_CR_WRAP_GENERATED_RANDOM_MASK; - - /* wait till command is accepted */ - while (0u != (base->CR & PUF_CR_WRAP_GENERATED_RANDOM_MASK)) - { - } - - /* send context and read output data while busy */ - while (0u != (base->SR & PUF_SR_BUSY_MASK)) - { - if ((0u != (PUF_SR_DI_REQUEST_MASK & base->SR)) && (idx < 4u)) - { - base->DIR = context[idx]; - idx++; - } - - if (0u != (PUF_SR_DO_REQUEST_MASK & base->SR)) - { - if (keyCodeSize >= sizeof(uint32_t)) - { - *keyCodeAligned = base->DOR; - keyCodeAligned++; - keyCodeSize -= sizeof(uint32_t); - } - } - } - - /* get status */ - status = puf_makeStatus(base, kPUF_WrapGeneratedRandom); - - return status; -} - -/*! - * brief PUF Wrap user key - * - * The Wrap operation wraps a user defined key into a Key Code (KC). - * - * @param base PUF peripheral base address - * @param keyCtx PUF key context struct. - * @param userKey Word aligned address of input user key. - * @param userKeySize Size of the key to be wrapped in bytes. - * @param[out] keyCode Word aligned address of the resulting key code. - * @param keyCodeSize Size of the output keycode in bytes. - * @return Status of wrap operation. - */ -status_t PUF_Wrap( - PUF_Type *base, puf_key_ctx_t *keyCtx, uint8_t *userKey, size_t userKeySize, uint8_t *keyCode, size_t keyCodeSize) -{ - uint8_t ctxIdx = 0; - uint32_t *userKeyAligned = NULL; - uint32_t *keyCodeAligned = NULL; - uint32_t context[4] = {0}; - status_t status = kStatus_Fail; - - /* check if WRAP is allowed */ - if (0x0u == (base->AR & PUF_AR_ALLOW_WRAP_MASK)) - { - return kStatus_PUF_OperationNotAllowed; - } - - /* check for valid keyCtx and keyCode pointers */ - if ((keyCtx == NULL) || (keyCode == NULL)) - { - return kStatus_InvalidArgument; - } - - /* check for valid userKey size. */ - /* must be 8byte multiple */ - if (0U != (userKeySize & 0x7u)) - { - return kStatus_InvalidArgument; - } - /* if userKeySize > 128bytes, it must be equal to 256bytes or 384bytes or 512bytes */ - if ((userKeySize > 128u) && !((userKeySize == 256u) || (userKeySize == 384u) || (userKeySize == 512u))) - { - return kStatus_InvalidArgument; - } - - /* check that keyCodeSize is correct for given userKeySize */ - if (keyCodeSize < PUF_GET_KEY_CODE_SIZE_FOR_KEY_SIZE(userKeySize)) - { - return kStatus_InvalidArgument; - } - - /* only work with aligned userKey and key code */ - if (0U != ((0x3u & (uintptr_t)userKey)) || (0U != (0x3u & (uintptr_t)keyCode))) - { - return kStatus_InvalidArgument; - } - - userKeyAligned = (uint32_t *)(uintptr_t)userKey; - keyCodeAligned = (uint32_t *)(uintptr_t)keyCode; - - /* fill in key context */ - context[0] = PUF_KEY_OPERATION_CONTEXT_TYPE | ((userKeySize * 8u) & 0x1FFFu); - context[1] = PUF_CONTEXT_GENERIC_KEY_TYPE | (keyCtx->keyScopeStarted << 8u) | keyCtx->keyScopeEnrolled; - context[2] = keyCtx->userCtx0; - context[3] = keyCtx->userCtx1; - - /* begin */ - base->CR = PUF_CR_WRAP_MASK; - - /* wait till command is accepted */ - while (0u != (base->CR & PUF_CR_WRAP_MASK)) - { - } - - /* send context and read output data while busy */ - while (0u != (base->SR & PUF_SR_BUSY_MASK)) - { - if (0u != (PUF_SR_DI_REQUEST_MASK & base->SR)) - { - /* send context first */ - if (ctxIdx < 4u) - { - base->DIR = context[ctxIdx]; - ctxIdx++; - } - /* send userKey */ - else - { - base->DIR = *userKeyAligned; - userKeyAligned++; - } - } - - if (0u != (PUF_SR_DO_REQUEST_MASK & base->SR)) - { - if (keyCodeSize >= sizeof(uint32_t)) - { - *keyCodeAligned = base->DOR; - keyCodeAligned++; - keyCodeSize -= sizeof(uint32_t); - } - } - } - - /* get status */ - status = puf_makeStatus(base, kPUF_Wrap); - - return status; -} - -/*! - * brief PUF Unwrap user key - * - * The unwrap operation unwraps the key from a previously created Key Code (KC) - * - * @param base PUF peripheral base address - * @param keyDest output destination of the unwraped PUF key - * @param[in] keyCode Word aligned address of the input key code. - * @param keyCodeSize Size of the input keycode in bytes. - * @param key Word aligned address of output key (only used when kPUF_KeyDestRegister). - * @param keySize Size of the key to be generated in bytes. - * @return Status of unwrap operation. - */ -status_t PUF_Unwrap( - PUF_Type *base, puf_key_dest_t keyDest, uint8_t *keyCode, size_t keyCodeSize, uint8_t *key, size_t keySize) -{ - uint32_t *keyAligned = NULL; - uint32_t *keyCodeAligned = NULL; - status_t status = kStatus_Fail; - - /* check if UNWRAP is allowed */ - if (0x0u == (base->AR & PUF_AR_ALLOW_UNWRAP_MASK)) - { - return kStatus_PUF_OperationNotAllowed; - } - - /* check for valid key destination */ - if (((keyDest == kPUF_KeyDestRegister) && (key == NULL)) || (keyDest == kPUF_KeyDestInvalid)) - { - return kStatus_InvalidArgument; - } - - /* only work with aligned key and key code */ - if ((0U != (0x3u & (uintptr_t)key)) || (0U != (0x3u & (uintptr_t)keyCode)) || (keyCode == NULL)) - { - return kStatus_InvalidArgument; - } - - keyAligned = (uint32_t *)(uintptr_t)key; - keyCodeAligned = (uint32_t *)(uintptr_t)keyCode; - - /* set key destination */ - base->DATA_DEST = keyDest; - - /* begin */ - base->CR = PUF_CR_UNWRAP_MASK; - - /* wait till command is accepted */ - while (0u != (base->CR & PUF_CR_UNWRAP_MASK)) - { - } - - /* send context and read output data while busy */ - while (0u != (base->SR & PUF_SR_BUSY_MASK)) - { - if (0u != (PUF_SR_DI_REQUEST_MASK & base->SR)) - { - if (keyCodeSize >= sizeof(uint32_t)) - { - base->DIR = *keyCodeAligned; - keyCodeAligned++; - keyCodeSize -= sizeof(uint32_t); - } - } - - if (0u != (PUF_SR_DO_REQUEST_MASK & base->SR)) - { - if (keySize >= sizeof(uint32_t)) - { - *keyAligned = base->DOR; - keyAligned++; - keySize -= sizeof(uint32_t); - } - } - } - - /* get status */ - status = puf_makeStatus(base, kPUF_Unwrap); - - return status; -} - -/*! - * brief Generate Random - * - * The Generate Random operation outputs the requested amount of random data as specified in a - * provided context. - * - * @param base PUF peripheral base address - * @param size Size of random data to be genarated in bytes. - * @return Status of generate random operation. - */ -status_t PUF_GenerateRandom(PUF_Type *base, uint8_t *data, size_t size) -{ - uint32_t context; - uint32_t *dataAligned = NULL; - status_t status = kStatus_Fail; - - if (data == NULL) - { - return kStatus_InvalidArgument; - } - - /* check if Generate random is allowed */ - if (0u == (base->AR & PUF_AR_ALLOW_GENERATE_RANDOM_MASK)) - { - return kStatus_PUF_OperationNotAllowed; - } - - /* check for valid size. */ - /* must be 8byte multiple */ - if (0U != (size & 0x7u)) - { - return kStatus_InvalidArgument; - } - /* if size > 128bytes, it must be equal to 256bytes or 384bytes or 512bytes */ - if ((size > 128u) && !((size == 256u) || (size == 384u) || (size == 512u))) - { - return kStatus_InvalidArgument; - } - - /* only work with aligned data buffer */ - if (0U != (0x3u & (uintptr_t)data)) - { - return kStatus_InvalidArgument; - } - - /* Configure context */ - context = ((size * 8u) & 0x1FFFu); - - dataAligned = (uint32_t *)(uintptr_t)data; - - /* begin */ - base->DATA_DEST = PUF_DATA_DEST_DEST_DOR_MASK; - - base->CR = PUF_CR_GENERATE_RANDOM_MASK; - - /* wait till command is accepted */ - while (0u != (base->CR & PUF_CR_GENERATE_RANDOM_MASK)) - { - } - - /* send context and read output data while busy */ - while (0u != (base->SR & PUF_SR_BUSY_MASK)) - { - if (0u != (PUF_SR_DI_REQUEST_MASK & base->SR)) - { - base->DIR = context; - } - - if (0u != (PUF_SR_DO_REQUEST_MASK & base->SR)) - { - *dataAligned = base->DOR; - dataAligned++; - } - } - - /* get status */ - status = puf_makeStatus(base, kPUF_GenerateRandom); - - return status; -} - -/*! - * brief Zeroize PUF - * - * This function clears all PUF internal logic and puts the PUF to zeroized state. - * - * @param base PUF peripheral base address - * @return Status of the zeroize operation. - */ -status_t PUF_Zeroize(PUF_Type *base) -{ - status_t status = kStatus_Fail; - - /* zeroize command is always allowed */ - base->CR = PUF_CR_ZEROIZE_MASK; - - /* wait till command is accepted */ - while (0u != (base->CR & PUF_CR_ZEROIZE_MASK)) - { - } - - /* wait while busy */ - while (0u != (base->SR & PUF_SR_BUSY_MASK)) - { - } - - /* check status */ - if (((PUF_SR_ZEROIZED_MASK | PUF_SR_OK_MASK) == base->SR) && (0u == base->AR)) - { - status = puf_makeStatus(base, kPUF_Zeroize); - } - - return status; -} - -/*! - * brief Test PUF - * - * With the Test PUF operation, diagnostics about the PUF quality is collected and presented in a PUF - * score. - * - * @param base PUF peripheral base address - * @param score Value of the PUF Score that was obtained during the enroll operation. - * @return Status of the test operation. - */ -status_t PUF_Test(PUF_Type *base, uint8_t *score) -{ - status_t status = kStatus_Fail; - - /* check if TEST is allowed */ - if (0x0u == (base->AR & PUF_AR_ALLOW_TEST_PUF_MASK)) - { - return kStatus_PUF_OperationNotAllowed; - } - - /* begin */ - base->CR = PUF_CR_TEST_PUF_MASK; - - /* wait till command is accepted */ - while (0u != (base->CR & PUF_CR_TEST_PUF_MASK)) - { - } - - /* wait while busy */ - while (0u != (base->SR & PUF_SR_BUSY_MASK)) - { - } - - /* In case of success fill in score */ - if ((0u != (base->SR & PUF_SR_OK_MASK)) && (score != NULL)) - { - *score = (uint8_t)(base->PSR & PUF_PSR_PUF_SCORE_MASK); - } - - /* Check status */ - status = puf_makeStatus(base, kPUF_Test); - - return status; -} - -/*! - * brief Set lock of PUF operation - * - * Lock the security level of PUF block until key generate, wrap or unwrap operation is completed. - * Note: Only secure-privilege code can change the security level. - * - * @param base PUF peripheral base address - * @param securityLevel Security level of PUF block. - * @return Status of the test operation. - */ -status_t PUF_SetLock(PUF_Type *base, puf_sec_level_t securityLevel) -{ - uint32_t sec_lock_option = 0u; - - if ((securityLevel != kPUF_NonsecureUser) && (securityLevel != kPUF_NonsecurePrivilege) && - (securityLevel != kPUF_SecureUser) && (securityLevel != kPUF_SecurePrivilege)) - { - return kStatus_InvalidArgument; - } - - /* Wait until PUF is in IDLE */ - while ((base->SR & PUF_SR_BUSY_MASK) != 0u) - { - } - - /* Prepare SEC_LOCK option word */ - /* [1:0] - Security level */ - /* [3:2] - anti-pole of security level [1:0] */ - /* [15:4] - PATTERN: This field must be written as 0xAC5 */ - sec_lock_option = SEC_LOCK_PATTERN | securityLevel; - - /* Apply setings */ - base->SEC_LOCK = sec_lock_option; - - /* Check if the security level is same as the level written */ - if (securityLevel != base->SEC_LOCK) - { - return kStatus_Fail; - } - - return kStatus_Success; -} - -/*! - * brief Set App Context mask - * - * This function sets Application defined context mask used in conjunction with key user context 2. - * Whenever bit in this register is 1, corresponding bit in user context 2 provided - * during key code creation should be zero only. - * - * This register is only modifiable by task running at secure-privilege level. - * - * @param base PUF peripheral base address - * @param appCtxMask Value of the Application defined context mask. - * @return Status of the test operation. - */ -status_t PUF_SetCtxMask(PUF_Type *base, uint32_t appCtxMask) -{ - base->APP_CTX_MASK = appCtxMask; - - return kStatus_Success; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_puf_v3.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_puf_v3.h deleted file mode 100644 index 1acf08484d7..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_puf_v3.h +++ /dev/null @@ -1,325 +0,0 @@ -/* - * Copyright 2017-2018,2023 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _PUF_V3_H_ -#define _PUF_V3_H_ - -#include -#include - -#include "fsl_common.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/*! - * @addtogroup puf_v3_driver - * @{ - */ -/*! @name Driver version */ -/*@{*/ -/*! @brief PUFv3 driver version. Version 2.0.2. - * - * Current version: 2.0.2 - * - * Change log: - * - 2.0.2 - * - Fix MISRA issue in driver. - * - 2.0.1 - * - Fix PUF initialization issue and update driver to reflect SoC header changes. - * - 2.0.0 - * - Initial version. - */ -#define FSL_PUF_V3_DRIVER_VERSION (MAKE_VERSION(2, 0, 2)) -/*@}*/ - -#define kPUF_EndianLittle (0x0u) -#define kPUF_EndianBig (0x1u) -typedef uint32_t puf_endianness_t; - -#define kPUF_KeyDestRegister (0x1u) -#define kPUF_KeyDestKeyBus (0x2u) -#define kPUF_KeyDestInvalid (0x3u) -typedef uint32_t puf_key_dest_t; - -#define kPUF_KeyAllowRegister (0x1u) -#define kPUF_KeyAllowKeyBus (0x2u) -#define kPUF_KeyAllowAll (0x3u) -typedef uint32_t puf_key_scope_t; - -#define kPUF_ResultOK (0x0u) -#define kPUF_AcNotForThisProductPhase1 (0xf0u) -#define kPUF_AcNotForThisProductPhase2 (0xf1u) -#define kPUF_AcCorruptedPhase1 (0xf2u) -#define kPUF_AcCorruptedPhase2 (0xf3u) -#define kPUF_AcAuthFailedPhase1 (0xf4u) -#define kPUF_AcAuthFailedPhase2 (0xf5u) -#define kPUF_QualityVerificationFail (0xf6u) -#define kPUF_ContextIncorrect (0xf7u) -#define kPUF_DestinationNotAllowed (0xf8u) -#define kPUF_Failure (0xFFu) -typedef uint32_t puf_result_code_t; - -#define kPUF_NonsecureUser (0xCu) /* b1100 */ -#define kPUF_NonsecurePrivilege (0x9u) /* b1001 */ -#define kPUF_SecureUser (0x6u) /* b0110 */ -#define kPUF_SecurePrivilege (0x3u) /* b0011 */ -typedef uint32_t puf_sec_level_t; - -typedef struct -{ - puf_endianness_t dataEndianness; - uint8_t CKGATING; -} puf_config_t; - -typedef struct -{ - puf_key_scope_t keyScopeStarted; - puf_key_scope_t keyScopeEnrolled; - uint32_t userCtx0; - uint32_t userCtx1; -} puf_key_ctx_t; - -#define PUF_ACTIVATION_CODE_SIZE (size_t)(FSL_FEATURE_PUF_ACTIVATION_CODE_SIZE) -#define PUF_GET_KEY_CODE_SIZE_FOR_KEY_SIZE(x) ((0x34u + (x)) + 0x10u * ((x) / 0x32u)) -#define SEC_LOCK_PATTERN 0xAC50u - -enum -{ - kStatus_PUF_OperationNotAllowed = MAKE_STATUS(kStatusGroup_PUF, 0xA5), - kStatus_PUF_AcNotForThisProductPhase1 = MAKE_STATUS(kStatusGroup_PUF, kPUF_AcNotForThisProductPhase1), - kStatus_PUF_AcNotForThisProductPhase2 = MAKE_STATUS(kStatusGroup_PUF, kPUF_AcNotForThisProductPhase2), - kStatus_PUF_AcCorruptedPhase1 = MAKE_STATUS(kStatusGroup_PUF, kPUF_AcCorruptedPhase1), - kStatus_PUF_AcCorruptedPhase2 = MAKE_STATUS(kStatusGroup_PUF, kPUF_AcCorruptedPhase2), - kStatus_PUF_AcAuthFailedPhase1 = MAKE_STATUS(kStatusGroup_PUF, kPUF_AcAuthFailedPhase1), - kStatus_PUF_NBOOT_AcAuthFailedPhase2 = MAKE_STATUS(kStatusGroup_PUF, kPUF_AcAuthFailedPhase2), - kStatus_PUF_QualityVerificationFail = MAKE_STATUS(kStatusGroup_PUF, kPUF_QualityVerificationFail), - kStatus_PUF_ContextIncorrect = MAKE_STATUS(kStatusGroup_PUF, kPUF_ContextIncorrect), - kStatus_PUF_DestinationNotAllowed = MAKE_STATUS(kStatusGroup_PUF, kPUF_DestinationNotAllowed), - kStatus_PUF_Failure = MAKE_STATUS(kStatusGroup_PUF, kPUF_Failure), -}; - -/******************************************************************************* - * API - *******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * brief Sets the default configuration of PUF - * - * This function initialize PUF config structure to default values. - * - * @param conf PUF configuration structure - */ -void PUF_GetDefaultConfig(puf_config_t *conf); - -/*! - * brief Initialize PUF - * - * This function enables power to PUF block and waits until the block initializes. - * - * @param conf PUF configuration structure - * @return Status of the init operation - */ -status_t PUF_Init(PUF_Type *base, puf_config_t *conf); - -/*! - * brief Denitialize PUF - * - * This function disables power to PUF SRAM and peripheral clock. - * - * @param base PUF peripheral base address - * @param conf PUF configuration structure - */ -void PUF_Deinit(PUF_Type *base, puf_config_t *conf); - -/*! - * brief Enroll PUF - * - * This function derives a digital fingerprint, generates the corresponding Activation Code (AC) - * and returns it to be stored in an NVM or a file. This step needs to be - * performed only once for each device. This function may be permanently disallowed by a fuse. - * - * @param base PUF peripheral base address - * @param[out] activationCode Word aligned address of the resulting activation code. - * @param activationCodeSize Size of the activationCode buffer in bytes. Shall be FSL_FEATURE_PUF_ACTIVATION_CODE_SIZE bytes. - * @param score Value of the PUF Score that was obtained during the enroll operation. - * @return Status of enroll operation. - */ -status_t PUF_Enroll(PUF_Type *base, uint8_t *activationCode, size_t activationCodeSize, uint8_t *score); - -/*! - * brief Start PUF - * - * The Activation Code generated during the Enroll operation is used to - * reconstruct the digital fingerprint. This needs to be done after every power-up - * and reset. - * - * @param base PUF peripheral base address - * @param[in] activationCode Word aligned address of the input activation code. - * @param activationCodeSize Size of the activationCode buffer in bytes. Shall be FSL_FEATURE_PUF_ACTIVATION_CODE_SIZE bytes. - * @param score Value of the PUF Score that was obtained during the start operation. - * return Status of start operation. - */ -status_t PUF_Start(PUF_Type *base, const uint8_t *activationCode, size_t activationCodeSize, uint8_t *score); - -/*! - * brief Stop PUF - * - * The Stop operation removes all key material from PUF flipflops and PUF SRAM, and sets - * PUF to the Stopped state. - * - * @param base PUF peripheral base address - * @return Status of stop operation. - */ -status_t PUF_Stop(PUF_Type *base); - -/*! - * brief PUF Get Key - * - * The Get Key operation derives a key from the intrinsic PUF key and externally provided context. - * - * @param base PUF peripheral base address - * @param keyCtx PUF key context struct - * @param keyDest output destination of the derived PUF key - * @param[out] key Word aligned address of output key (only used when kPUF_KeyDestRegister). - * @param keySize Size of the derived key in bytes. - * @return Status of get key operation. - */ -status_t PUF_GetKey(PUF_Type *base, puf_key_ctx_t *keyCtx, puf_key_dest_t keyDest, uint8_t *key, size_t keySize); - -/*! - * brief PUF Wrap generated random - * - * The Wrap Generated Random operation wraps a random key into a Key Code (KC). - * - * @param base PUF peripheral base address - * @param keyCtx PUF key context struct - * @param keySize Size of the key to be generated in bytes. - * @param[out] keyCode Word aligned address of the resulting key code. - * @param keyCodeSize Size of the output keycode in bytes. - * @return Status of wrap generated random operation. - */ -status_t PUF_WrapGeneratedRandom( - PUF_Type *base, puf_key_ctx_t *keyCtx, size_t keySize, uint8_t *keyCode, size_t keyCodeSize); - -/*! - * brief PUF Wrap user key - * - * The Wrap operation wraps a user defined key into a Key Code (KC). - * - * @param base PUF peripheral base address - * @param keyCtx PUF key context struct. - * @param userKey Word aligned address of input user key. - * @param userKeySize Size of the key to be wrapped in bytes. - * @param[out] keyCode Word aligned address of the resulting key code. - * @param keyCodeSize Size of the output keycode in bytes. - * @return Status of wrap operation. - */ -status_t PUF_Wrap( - PUF_Type *base, puf_key_ctx_t *keyCtx, uint8_t *userKey, size_t userKeySize, uint8_t *keyCode, size_t keyCodeSize); - -/*! - * brief PUF Unwrap user key - * - * The unwrap operation unwraps the key from a previously created Key Code (KC) - * - * @param base PUF peripheral base address - * @param keyDest output destination of the unwraped PUF key - * @param[in] keyCode Word aligned address of the input key code. - * @param keyCodeSize Size of the input keycode in bytes. - * @param key Word aligned address of output key (only used when kPUF_KeyDestRegister). - * @param keySize Size of the key to be generated in bytes. - * @return Status of unwrap operation. - */ -status_t PUF_Unwrap( - PUF_Type *base, puf_key_dest_t keyDest, uint8_t *keyCode, size_t keyCodeSize, uint8_t *key, size_t keySize); - -/*! - * brief Generate Random - * - * The Generate Random operation outputs the requested amount of random data as specified in a - * provided context. - * - * @param base PUF peripheral base address - * @param size Size of random data to be genarated in bytes. - * @return Status of generate random operation. - */ -status_t PUF_GenerateRandom(PUF_Type *base, uint8_t *data, size_t size); - -/*! - * brief Zeroize PUF - * - * This function clears all PUF internal logic and puts the PUF to zeroized state. - * - * @param base PUF peripheral base address - * @return Status of the zeroize operation. - */ -status_t PUF_Zeroize(PUF_Type *base); - -/*! - * brief Test PUF - * - * With the Test PUF operation, diagnostics about the PUF quality is collected and presented in a PUF - * score. - * - * @param base PUF peripheral base address - * @param score Value of the PUF Score that was obtained during the enroll operation. - * @return Status of the test operation. - */ -status_t PUF_Test(PUF_Type *base, uint8_t *score); - -/*! - * @brief Blocks specified PUF commands - * - * This function blocks PUF commands specified by mask parameter. - * - * @param base PUF peripheral base address - * @param mask Mask of parameters which should be blocked until power-cycle. - * @return Status of the test operation. - */ -static inline void PUF_BlockCommand(PUF_Type *base, uint32_t mask) -{ - base->CONFIG |= mask; -} - -/*! - * brief Set lock of PUF operation - * - * Lock the security level of PUF block until key generate, wrap or unwrap operation is completed. - * Note: Only security level defined in SEC_LOCK register can use PUFv3 or change its security level. - * Default setting after leaving ROM is Secure-Privilege - * - * @param base PUF peripheral base address - * @param securityLevel Security level of PUF block. - * @return Status of the test operation. - */ -status_t PUF_SetLock(PUF_Type *base, puf_sec_level_t securityLevel); - -/*! - * brief Set App Context mask - * - * This function sets Application defined context mask used in conjunction with key user context 2. - * Whenever bit in this register is 1, corresponding bit in user context 2 provided - * during key code creation should be zero only. - * - * This register is only modifiable by task running at secure-privilege level. - * - * @param base PUF peripheral base address - * @param appCtxMask Value of the Application defined context mask. - * @return Status of the test operation. - */ -status_t PUF_SetCtxMask(PUF_Type *base, uint32_t appCtxMask); - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -#endif /* _PUF_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_pwm.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_pwm.c deleted file mode 100644 index 5896b1c35ea..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_pwm.c +++ /dev/null @@ -1,1466 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_pwm.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.pwm" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Get the instance from the base address - * - * @param base PWM peripheral base address - * - * @return The PWM module instance - */ -static uint32_t PWM_GetInstance(PWM_Type *base); - -#if defined(PWM_RSTS) -#define PWM_RESETS_ARRAY PWM_RSTS -#elif defined(FLEXPWM_RSTS) -#define PWM_RESETS_ARRAY FLEXPWM_RSTS -#elif defined(FLEXPWM_RSTS_N) -#define PWM_RESETS_ARRAY FLEXPWM_RSTS_N -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to PWM bases for each instance. */ -static PWM_Type *const s_pwmBases[] = PWM_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to PWM clocks for each PWM submodule. */ -static const clock_ip_name_t s_pwmClocks[][FSL_FEATURE_PWM_SUBMODULE_COUNT] = PWM_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(PWM_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_pwmResets[] = PWM_RESETS_ARRAY; -#endif - -/*! @brief Temporary PWM duty cycle. */ -static uint8_t s_pwmGetPwmDutyCycle[FSL_FEATURE_PWM_SUBMODULE_COUNT][PWM_SUBMODULE_CHANNEL] = {{0}}; - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Complement the variable of type uint16_t as needed - * - * This function can complement the variable of type uint16_t as needed.For example, - * need to ask for the opposite of a positive integer. - * - * param value Parameters of type uint16_t - */ -static inline uint16_t PWM_GetComplementU16(uint16_t value) -{ - return (~value + 1U); -} - -static inline uint16_t dutyCycleToReloadValue(uint8_t dutyCyclePercent) -{ - /* Rounding calculations to improve the accuracy of reloadValue */ - return ((65535U * dutyCyclePercent) + 50U) / 100U; -} - -static uint32_t PWM_GetInstance(PWM_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_pwmBases); instance++) - { - if (s_pwmBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_pwmBases)); - - return instance; -} - -/*! - * brief Set register about period on one PWM submodule. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param mode PWM operation mode, options available in enumeration ::pwm_mode_t - * param pulseCnt PWM period, value should be between 0 to 65535 - */ -static void PWM_SetPeriodRegister(PWM_Type *base, pwm_submodule_t subModule, pwm_mode_t mode, uint16_t pulseCnt) -{ - uint16_t modulo = 0; - - switch (mode) - { - case kPWM_SignedCenterAligned: - /* Setup the PWM period for a signed center aligned signal */ - modulo = (pulseCnt >> 1U); - /* Indicates the start of the PWM period */ - base->SM[subModule].INIT = PWM_GetComplementU16(modulo); - /* Indicates the center value */ - base->SM[subModule].VAL0 = 0; - /* Indicates the end of the PWM period */ - /* The change during the end to start of the PWM period requires a count time */ - base->SM[subModule].VAL1 = modulo - 1U; - break; - case kPWM_CenterAligned: - /* Setup the PWM period for an unsigned center aligned signal */ - /* Indicates the start of the PWM period */ - base->SM[subModule].INIT = 0; - /* Indicates the center value */ - base->SM[subModule].VAL0 = (pulseCnt / 2U); - /* Indicates the end of the PWM period */ - /* The change during the end to start of the PWM period requires a count time */ - base->SM[subModule].VAL1 = pulseCnt - 1U; - break; - case kPWM_SignedEdgeAligned: - /* Setup the PWM period for a signed edge aligned signal */ - modulo = (pulseCnt >> 1U); - /* Indicates the start of the PWM period */ - base->SM[subModule].INIT = PWM_GetComplementU16(modulo); - /* Indicates the center value */ - base->SM[subModule].VAL0 = 0; - /* Indicates the end of the PWM period */ - /* The change during the end to start of the PWM period requires a count time */ - base->SM[subModule].VAL1 = modulo - 1U; - break; - case kPWM_EdgeAligned: - /* Setup the PWM period for a unsigned edge aligned signal */ - /* Indicates the start of the PWM period */ - base->SM[subModule].INIT = 0; - /* Indicates the center value */ - base->SM[subModule].VAL0 = (pulseCnt / 2U); - /* Indicates the end of the PWM period */ - /* The change during the end to start of the PWM period requires a count time */ - base->SM[subModule].VAL1 = pulseCnt - 1U; - break; - default: - assert(false); - break; - } -} - -/*! - * brief Set register about dutycycle on one PWM submodule. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmSignal Signal (PWM A or PWM B) to update - * param mode PWM operation mode, options available in enumeration ::pwm_mode_t - * param pulseCnt PWM period, value should be between 0 to 65535 - * param dutyCycle New PWM pulse width, value should be between 0 to 65535 - */ -static void PWM_SetDutycycleRegister(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmSignal, - pwm_mode_t mode, - uint16_t pulseCnt, - uint16_t pwmHighPulse) -{ - uint16_t modulo = 0; - - switch (mode) - { - case kPWM_SignedCenterAligned: - /* Setup the PWM dutycycle for a signed center aligned signal */ - if (pwmSignal == kPWM_PwmA) - { - base->SM[subModule].VAL2 = PWM_GetComplementU16(pwmHighPulse / 2U); - base->SM[subModule].VAL3 = (pwmHighPulse / 2U); - } - else if (pwmSignal == kPWM_PwmB) - { - base->SM[subModule].VAL4 = PWM_GetComplementU16(pwmHighPulse / 2U); - base->SM[subModule].VAL5 = (pwmHighPulse / 2U); - } - else - { - ; /* Intentional empty */ - } - break; - case kPWM_CenterAligned: - /* Setup the PWM dutycycle for an unsigned center aligned signal */ - if (pwmSignal == kPWM_PwmA) - { - base->SM[subModule].VAL2 = ((pulseCnt - pwmHighPulse) / 2U); - base->SM[subModule].VAL3 = ((pulseCnt + pwmHighPulse) / 2U); - } - else if (pwmSignal == kPWM_PwmB) - { - base->SM[subModule].VAL4 = ((pulseCnt - pwmHighPulse) / 2U); - base->SM[subModule].VAL5 = ((pulseCnt + pwmHighPulse) / 2U); - } - else - { - ; /* Intentional empty */ - } - break; - case kPWM_SignedEdgeAligned: - modulo = (pulseCnt >> 1U); - - /* Setup the PWM dutycycle for a signed edge aligned signal */ - if (pwmSignal == kPWM_PwmA) - { - base->SM[subModule].VAL2 = PWM_GetComplementU16(modulo); - base->SM[subModule].VAL3 = PWM_GetComplementU16(modulo) + pwmHighPulse; - } - else if (pwmSignal == kPWM_PwmB) - { - base->SM[subModule].VAL4 = PWM_GetComplementU16(modulo); - base->SM[subModule].VAL5 = PWM_GetComplementU16(modulo) + pwmHighPulse; - } - else - { - ; /* Intentional empty */ - } - break; - case kPWM_EdgeAligned: - /* Setup the PWM dutycycle for a unsigned edge aligned signal */ - if (pwmSignal == kPWM_PwmA) - { - base->SM[subModule].VAL2 = 0; - base->SM[subModule].VAL3 = pwmHighPulse; - } - else if (pwmSignal == kPWM_PwmB) - { - base->SM[subModule].VAL4 = 0; - base->SM[subModule].VAL5 = pwmHighPulse; - } - else - { - ; /* Intentional empty */ - } - break; - default: - assert(false); - break; - } -} - -/*! - * brief Ungates the PWM submodule clock and configures the peripheral for basic operation. - * - * note This API should be called at the beginning of the application using the PWM driver. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param config Pointer to user's PWM config structure. - * - * return kStatus_Success means success; else failed. - */ -status_t PWM_Init(PWM_Type *base, pwm_submodule_t subModule, const pwm_config_t *config) -{ - assert(config); - - uint16_t reg; - - /* Source clock for submodule 0 cannot be itself */ - if ((config->clockSource == kPWM_Submodule0Clock) && (subModule == kPWM_Module_0)) - { - return kStatus_Fail; - } - - /* Reload source select clock for submodule 0 cannot be master reload */ - if ((config->reloadSelect == kPWM_MasterReload) && (subModule == kPWM_Module_0)) - { - return kStatus_Fail; - } - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate the PWM submodule clock*/ - CLOCK_EnableClock(s_pwmClocks[PWM_GetInstance(base)][subModule]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(PWM_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_pwmResets[PWM_GetInstance(base)]); -#endif - - /* Clear the fault status flags */ - base->FSTS |= PWM_FSTS_FFLAG_MASK; - - reg = base->SM[subModule].CTRL2; - - /* Setup the submodule clock-source, control source of the INIT signal, - * source of the force output signal, operation in debug & wait modes and reload source select - */ - reg &= - ~(uint16_t)(PWM_CTRL2_CLK_SEL_MASK | PWM_CTRL2_FORCE_SEL_MASK | PWM_CTRL2_INIT_SEL_MASK | PWM_CTRL2_INDEP_MASK | -#if !defined(FSL_FEATURE_PWM_HAS_NO_WAITEN) || (!FSL_FEATURE_PWM_HAS_NO_WAITEN) - PWM_CTRL2_WAITEN_MASK | -#endif /* FSL_FEATURE_PWM_HAS_NO_WAITEN */ - PWM_CTRL2_DBGEN_MASK | PWM_CTRL2_RELOAD_SEL_MASK); - reg |= (PWM_CTRL2_CLK_SEL(config->clockSource) | PWM_CTRL2_FORCE_SEL(config->forceTrigger) | - PWM_CTRL2_INIT_SEL(config->initializationControl) | PWM_CTRL2_DBGEN(config->enableDebugMode) | -#if !defined(FSL_FEATURE_PWM_HAS_NO_WAITEN) || (!FSL_FEATURE_PWM_HAS_NO_WAITEN) - PWM_CTRL2_WAITEN(config->enableWait) | -#endif /* FSL_FEATURE_PWM_HAS_NO_WAITEN */ - PWM_CTRL2_RELOAD_SEL(config->reloadSelect)); - - /* Setup PWM A & B to be independent or a complementary-pair */ - switch (config->pairOperation) - { - case kPWM_Independent: - reg |= PWM_CTRL2_INDEP_MASK; - break; - case kPWM_ComplementaryPwmA: - base->MCTRL &= ~((uint16_t)1U << (PWM_MCTRL_IPOL_SHIFT + (uint16_t)subModule)); - break; - case kPWM_ComplementaryPwmB: - base->MCTRL |= ((uint16_t)1U << (PWM_MCTRL_IPOL_SHIFT + (uint16_t)subModule)); - break; - default: - assert(false); - break; - } - base->SM[subModule].CTRL2 = reg; - - reg = base->SM[subModule].CTRL; - - /* Setup the clock prescale, load mode and frequency */ - reg &= ~(uint16_t)(PWM_CTRL_PRSC_MASK | PWM_CTRL_LDFQ_MASK | PWM_CTRL_LDMOD_MASK); - reg |= (PWM_CTRL_PRSC(config->prescale) | PWM_CTRL_LDFQ(config->reloadFrequency)); - - /* Setup register reload logic */ - switch (config->reloadLogic) - { - case kPWM_ReloadImmediate: - reg |= PWM_CTRL_LDMOD_MASK; - break; - case kPWM_ReloadPwmHalfCycle: - reg |= PWM_CTRL_HALF_MASK; - reg &= (uint16_t)(~PWM_CTRL_FULL_MASK); - break; - case kPWM_ReloadPwmFullCycle: - reg &= (uint16_t)(~PWM_CTRL_HALF_MASK); - reg |= PWM_CTRL_FULL_MASK; - break; - case kPWM_ReloadPwmHalfAndFullCycle: - reg |= PWM_CTRL_HALF_MASK; - reg |= PWM_CTRL_FULL_MASK; - break; - default: - assert(false); - break; - } - base->SM[subModule].CTRL = reg; - - /* Set PWM output normal */ -#if defined(PWM_MASK_UPDATE_MASK) - base->MASK &= (uint16_t)(~(uint16_t)(PWM_MASK_MASKX_MASK | PWM_MASK_MASKA_MASK | - PWM_MASK_MASKB_MASK | PWM_MASK_UPDATE_MASK_MASK)); -#else - base->MASK &= ~(uint16_t)(PWM_MASK_MASKX_MASK | PWM_MASK_MASKA_MASK | PWM_MASK_MASKB_MASK); -#endif - - base->DTSRCSEL = 0U; - - /* Issue a Force trigger event when configured to trigger locally */ - if (config->forceTrigger == kPWM_Force_Local) - { - base->SM[subModule].CTRL2 |= PWM_CTRL2_FORCE(1U); - } - - return kStatus_Success; -} - -/*! - * brief Gate the PWM submodule clock - * - * param base PWM peripheral base address - * param subModule PWM submodule to deinitialize - */ -void PWM_Deinit(PWM_Type *base, pwm_submodule_t subModule) -{ - /* Stop the submodule */ - base->MCTRL &= ~((uint16_t)1U << (PWM_MCTRL_RUN_SHIFT + (uint16_t)subModule)); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate the PWM submodule clock*/ - CLOCK_DisableClock(s_pwmClocks[PWM_GetInstance(base)][subModule]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Fill in the PWM config struct with the default settings - * - * The default values are: - * code - * config->enableDebugMode = false; - * config->enableWait = false; - * config->reloadSelect = kPWM_LocalReload; - * config->clockSource = kPWM_BusClock; - * config->prescale = kPWM_Prescale_Divide_1; - * config->initializationControl = kPWM_Initialize_LocalSync; - * config->forceTrigger = kPWM_Force_Local; - * config->reloadFrequency = kPWM_LoadEveryOportunity; - * config->reloadLogic = kPWM_ReloadImmediate; - * config->pairOperation = kPWM_Independent; - * endcode - * param config Pointer to user's PWM config structure. - */ -void PWM_GetDefaultConfig(pwm_config_t *config) -{ - assert(config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - /* PWM is paused in debug mode */ - config->enableDebugMode = false; - /* PWM is paused in wait mode */ -#if !defined(FSL_FEATURE_PWM_HAS_NO_WAITEN) || (!FSL_FEATURE_PWM_HAS_NO_WAITEN) - config->enableWait = false; -#endif /* FSL_FEATURE_PWM_HAS_NO_WAITEN */ - /* PWM module uses the local reload signal to reload registers */ - config->reloadSelect = kPWM_LocalReload; - /* Use the IP Bus clock as source clock for the PWM submodule */ - config->clockSource = kPWM_BusClock; - /* Clock source prescale is set to divide by 1*/ - config->prescale = kPWM_Prescale_Divide_1; - /* Local sync causes initialization */ - config->initializationControl = kPWM_Initialize_LocalSync; - /* The local force signal, CTRL2[FORCE], from the submodule is used to force updates */ - config->forceTrigger = kPWM_Force_Local; - /* PWM reload frequency, reload opportunity is PWM half cycle or full cycle. - * This field is not used in Immediate reload mode - */ - config->reloadFrequency = kPWM_LoadEveryOportunity; - /* Buffered-registers get loaded with new values as soon as LDOK bit is set */ - config->reloadLogic = kPWM_ReloadImmediate; - /* PWM A & PWM B operate as 2 independent channels */ - config->pairOperation = kPWM_Independent; -} - -/*! - * brief Sets up the PWM signals for a PWM submodule. - * - * The function initializes the submodule according to the parameters passed in by the user. The function - * also sets up the value compare registers to match the PWM signal requirements. - * If the dead time insertion logic is enabled, the pulse period is reduced by the - * dead time period specified by the user. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param chnlParams Array of PWM channel parameters to configure the channel(s), PWMX submodule is not supported. - * param numOfChnls Number of channels to configure, this should be the size of the array passed in. - * Array size should not be more than 2 as each submodule has 2 pins to output PWM - * param mode PWM operation mode, options available in enumeration ::pwm_mode_t - * param pwmFreq_Hz PWM signal frequency in Hz - * param srcClock_Hz PWM source clock of correspond submodule in Hz. If source clock of submodule1,2,3 is from - * submodule0 AUX_CLK, its source clock is submodule0 source clock divided with submodule0 - * prescaler value instead of submodule0 source clock. - * - * return Returns kStatusFail if there was error setting up the signal; kStatusSuccess otherwise - */ -status_t PWM_SetupPwm(PWM_Type *base, - pwm_submodule_t subModule, - const pwm_signal_param_t *chnlParams, - uint8_t numOfChnls, - pwm_mode_t mode, - uint32_t pwmFreq_Hz, - uint32_t srcClock_Hz) -{ - assert(chnlParams); - assert(pwmFreq_Hz); - assert(numOfChnls); - assert(srcClock_Hz); - - uint32_t pwmClock; - uint16_t pulseCnt = 0, pwmHighPulse = 0; - uint8_t i, polarityShift = 0, outputEnableShift = 0; - - for (i = 0; i < numOfChnls; i++) - { - if (chnlParams[i].pwmChannel == kPWM_PwmX) - { - /* PWMX configuration is not supported yet */ - return kStatus_Fail; - } - } - - /* Divide the clock by the prescale value */ - pwmClock = (srcClock_Hz / (1UL << ((base->SM[subModule].CTRL & PWM_CTRL_PRSC_MASK) >> PWM_CTRL_PRSC_SHIFT))); - pulseCnt = (uint16_t)(pwmClock / pwmFreq_Hz); - - /* Setup each PWM channel */ - for (i = 0; i < numOfChnls; i++) - { - /* Calculate pulse width */ - pwmHighPulse = (pulseCnt * chnlParams->dutyCyclePercent) / 100U; - - /* Setup the different match registers to generate the PWM signal */ - if (i == 0U) - { - /* Update register about period */ - PWM_SetPeriodRegister(base, subModule, mode, pulseCnt); - } - - /* Update register about dutycycle */ - PWM_SetDutycycleRegister(base, subModule, chnlParams->pwmChannel, mode, pulseCnt, pwmHighPulse); - - /* Setup register shift values based on the channel being configured. - * Also setup the deadtime value - */ - if (chnlParams->pwmChannel == kPWM_PwmA) - { - polarityShift = PWM_OCTRL_POLA_SHIFT; - outputEnableShift = PWM_OUTEN_PWMA_EN_SHIFT; - base->SM[subModule].DTCNT0 = PWM_DTCNT0_DTCNT0(chnlParams->deadtimeValue); - } - else - { - polarityShift = PWM_OCTRL_POLB_SHIFT; - outputEnableShift = PWM_OUTEN_PWMB_EN_SHIFT; - base->SM[subModule].DTCNT1 = PWM_DTCNT1_DTCNT1(chnlParams->deadtimeValue); - } - - /* Set PWM output fault status */ - switch (chnlParams->pwmChannel) - { - case kPWM_PwmA: - base->SM[subModule].OCTRL &= ~((uint16_t)PWM_OCTRL_PWMAFS_MASK); - base->SM[subModule].OCTRL |= (((uint16_t)(chnlParams->faultState) << (uint16_t)PWM_OCTRL_PWMAFS_SHIFT) & - (uint16_t)PWM_OCTRL_PWMAFS_MASK); - break; - case kPWM_PwmB: - base->SM[subModule].OCTRL &= ~((uint16_t)PWM_OCTRL_PWMBFS_MASK); - base->SM[subModule].OCTRL |= (((uint16_t)(chnlParams->faultState) << (uint16_t)PWM_OCTRL_PWMBFS_SHIFT) & - (uint16_t)PWM_OCTRL_PWMBFS_MASK); - break; - default: - assert(false); - break; - } - - /* Setup signal active level */ - if ((bool)chnlParams->level == kPWM_HighTrue) - { - base->SM[subModule].OCTRL &= ~((uint16_t)1U << (uint16_t)polarityShift); - } - else - { - base->SM[subModule].OCTRL |= ((uint16_t)1U << (uint16_t)polarityShift); - } - if (chnlParams->pwmchannelenable) - { - /* Enable PWM output */ - base->OUTEN |= ((uint16_t)1U << ((uint16_t)outputEnableShift + (uint16_t)subModule)); - } - - /* Get the pwm duty cycle */ - s_pwmGetPwmDutyCycle[subModule][chnlParams->pwmChannel] = chnlParams->dutyCyclePercent; - - /* Get the next channel parameters */ - chnlParams++; - } - - return kStatus_Success; -} - -/*! - * brief Set PWM phase shift for PWM channel running on channel PWM_A, PWM_B which with 50% duty cycle. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmChannel PWM channel to configure - * param pwmFreq_Hz PWM signal frequency in Hz - * param srcClock_Hz PWM main counter clock in Hz. - * param shiftvalue Phase shift value, range in 0 ~ 50 - * param doSync true: Set LDOK bit for the submodule list; - * false: LDOK bit don't set, need to call PWM_SetPwmLdok to sync update. - * - * return Returns kStatus_Fail if there was error setting up the signal; kStatus_Success otherwise - */ -status_t PWM_SetupPwmPhaseShift(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - uint32_t pwmFreq_Hz, - uint32_t srcClock_Hz, - uint8_t shiftvalue, - bool doSync) -{ - assert(pwmFreq_Hz != 0U); - assert(srcClock_Hz != 0U); - assert(shiftvalue <= 50U); - - uint32_t pwmClock; - uint16_t pulseCnt = 0, pwmHighPulse = 0; - uint16_t modulo = 0; - uint16_t shift = 0; - - if (pwmChannel != kPWM_PwmX) - { - /* Divide the clock by the prescale value */ - pwmClock = (srcClock_Hz / (1UL << ((base->SM[subModule].CTRL & PWM_CTRL_PRSC_MASK) >> PWM_CTRL_PRSC_SHIFT))); - pulseCnt = (uint16_t)(pwmClock / pwmFreq_Hz); - - /* Clear LDOK bit if it is set */ - if (0U != (base->MCTRL & PWM_MCTRL_LDOK(1UL << (uint8_t)subModule))) - { - base->MCTRL |= PWM_MCTRL_CLDOK(1UL << (uint8_t)subModule); - } - - modulo = (pulseCnt >> 1U); - /* Indicates the start of the PWM period */ - base->SM[subModule].INIT = PWM_GetComplementU16(modulo); - /* Indicates the center value */ - base->SM[subModule].VAL0 = 0; - /* Indicates the end of the PWM period */ - /* The change during the end to start of the PWM period requires a count time */ - base->SM[subModule].VAL1 = modulo - 1U; - - /* Immediately upon when MCTRL[LDOK] being set */ - base->SM[subModule].CTRL |= PWM_CTRL_LDMOD_MASK; - - /* phase shift value */ - shift = (pulseCnt * shiftvalue) / 100U; - - /* duty cycle 50% */ - pwmHighPulse = pulseCnt / 2U; - - if (pwmChannel == kPWM_PwmA) - { - base->SM[subModule].VAL2 = PWM_GetComplementU16(modulo) + shift; - base->SM[subModule].VAL3 = PWM_GetComplementU16(modulo) + pwmHighPulse + shift - 1U; - } - else if (pwmChannel == kPWM_PwmB) - { - base->SM[subModule].VAL4 = PWM_GetComplementU16(modulo) + shift; - base->SM[subModule].VAL5 = PWM_GetComplementU16(modulo) + pwmHighPulse + shift - 1U; - } - else - { - return kStatus_Fail; - } - - if (doSync) - { - /* Set LDOK bit to load VALx bit */ - base->MCTRL |= PWM_MCTRL_LDOK(1UL << (uint8_t)subModule); - } - } - else - { - return kStatus_Fail; - } - - return kStatus_Success; -} - -/*! - * brief Updates the PWM signal's dutycycle. - * - * The function updates the PWM dutycyle to the new value that is passed in. - * If the dead time insertion logic is enabled then the pulse period is reduced by the - * dead time period specified by the user. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmSignal Signal (PWM A or PWM B) to update - * param currPwmMode The current PWM mode set during PWM setup - * param dutyCyclePercent New PWM pulse width, value should be between 0 to 100 - * 0=inactive signal(0% duty cycle)... - * 100=active signal (100% duty cycle) - */ -void PWM_UpdatePwmDutycycle(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmSignal, - pwm_mode_t currPwmMode, - uint8_t dutyCyclePercent) -{ - assert(dutyCyclePercent <= 100U); - assert(pwmSignal != kPWM_PwmX); - uint16_t reloadValue = dutyCycleToReloadValue(dutyCyclePercent); - - PWM_UpdatePwmDutycycleHighAccuracy(base, subModule, pwmSignal, currPwmMode, reloadValue); -} - -/*! - * brief Updates the PWM signal's dutycycle with 16-bit accuracy. - * - * The function updates the PWM dutycyle to the new value that is passed in. - * If the dead time insertion logic is enabled then the pulse period is reduced by the - * dead time period specified by the user. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmSignal Signal (PWM A or PWM B) to update - * param currPwmMode The current PWM mode set during PWM setup - * param dutyCycle New PWM pulse width, value should be between 0 to 65535 - * 0=inactive signal(0% duty cycle)... - * 65535=active signal (100% duty cycle) - */ -void PWM_UpdatePwmDutycycleHighAccuracy( - PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmSignal, pwm_mode_t currPwmMode, uint16_t dutyCycle) -{ - assert(pwmSignal != kPWM_PwmX); - uint16_t pulseCnt = 0, pwmHighPulse = 0; - uint16_t modulo = 0; - - switch (currPwmMode) - { - case kPWM_SignedCenterAligned: - modulo = base->SM[subModule].VAL1 + 1U; - pulseCnt = modulo * 2U; - /* Calculate pulse width */ - pwmHighPulse = (pulseCnt * dutyCycle) / 65535U; - break; - case kPWM_CenterAligned: - pulseCnt = base->SM[subModule].VAL1 + 1U; - /* Calculate pulse width */ - pwmHighPulse = (pulseCnt * dutyCycle) / 65535U; - break; - case kPWM_SignedEdgeAligned: - modulo = base->SM[subModule].VAL1 + 1U; - pulseCnt = modulo * 2U; - /* Calculate pulse width */ - pwmHighPulse = (pulseCnt * dutyCycle) / 65535U; - break; - case kPWM_EdgeAligned: - pulseCnt = base->SM[subModule].VAL1 + 1U; - /* Calculate pulse width */ - pwmHighPulse = (pulseCnt * dutyCycle) / 65535U; - break; - default: - assert(false); - break; - } - - /* Update register about dutycycle */ - if (kPWM_PwmA == pwmSignal) - { - PWM_SetDutycycleRegister(base, subModule, kPWM_PwmA, currPwmMode, pulseCnt, pwmHighPulse); - } - else if (kPWM_PwmB == pwmSignal) - { - PWM_SetDutycycleRegister(base, subModule, kPWM_PwmB, currPwmMode, pulseCnt, pwmHighPulse); - } - else - { - ; /* Intentional empty */ - } - - if (kPWM_PwmX != pwmSignal) - { - /* Get the pwm duty cycle */ - s_pwmGetPwmDutyCycle[subModule][pwmSignal] = (uint8_t)(dutyCycle * 100U / 65535U); - } -} - -/*! - * brief Update the PWM signal's period and dutycycle for a PWM submodule. - * - * The function updates PWM signal period generated by a specific submodule according to the parameters - * passed in by the user. This function can also set dutycycle weather you want to keep original dutycycle - * or update new dutycycle. Call this function in local sync control mode because PWM period is depended by - * INIT and VAL1 register of each submodule. In master sync initialization control mode, call this function - * to update INIT and VAL1 register of all submodule because PWM period is depended by INIT and VAL1 register - * in submodule0. If the dead time insertion logic is enabled, the pulse period is reduced by the dead time - * period specified by the user. PWM signal will not be generated if its period is less than dead time duration. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmSignal Signal (PWM A or PWM B) to update - * param currPwmMode The current PWM mode set during PWM setup, options available in enumeration ::pwm_mode_t - * param pulseCnt New PWM period, value should be between 0 to 65535 - * 0=minimum PWM period... - * 65535=maximum PWM period - * param dutyCycle New PWM pulse width of channel, value should be between 0 to 65535 - * 0=inactive signal(0% duty cycle)... - * 65535=active signal (100% duty cycle) - * You can keep original dutycycle or update new dutycycle - */ -void PWM_UpdatePwmPeriodAndDutycycle(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmSignal, - pwm_mode_t currPwmMode, - uint16_t pulseCnt, - uint16_t dutyCycle) -{ - uint16_t pwmHighPulse = 0; - - assert(pwmSignal != kPWM_PwmX); - - /* Calculate pulse width */ - pwmHighPulse = (pulseCnt * dutyCycle) / 65535U; - - /* Update register about period */ - PWM_SetPeriodRegister(base, subModule, currPwmMode, pulseCnt); - - /* Update register about dutycycle */ - PWM_SetDutycycleRegister(base, subModule, pwmSignal, currPwmMode, pulseCnt, pwmHighPulse); - - /* Get the pwm duty cycle */ - s_pwmGetPwmDutyCycle[subModule][pwmSignal] = (uint8_t)((dutyCycle * 100U) / 65535U); -} - -/*! - * brief Sets up the PWM input capture - * - * Each PWM submodule has 3 pins that can be configured for use as input capture pins. This function - * sets up the capture parameters for each pin and enables the pin for input capture operation. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmChannel Channel in the submodule to setup - * param inputCaptureParams Parameters passed in to set up the input pin - */ -void PWM_SetupInputCapture(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - const pwm_input_capture_param_t *inputCaptureParams) -{ - uint16_t reg = 0; - switch (pwmChannel) - { -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA - case kPWM_PwmA: - /* Setup the capture paramters for PWM A pin */ - reg = (PWM_CAPTCTRLA_INP_SELA(inputCaptureParams->captureInputSel) | - PWM_CAPTCTRLA_EDGA0(inputCaptureParams->edge0) | PWM_CAPTCTRLA_EDGA1(inputCaptureParams->edge1) | - PWM_CAPTCTRLA_ONESHOTA(inputCaptureParams->enableOneShotCapture) | - PWM_CAPTCTRLA_CFAWM(inputCaptureParams->fifoWatermark)); - /* Enable the edge counter if using the output edge counter */ - if (inputCaptureParams->captureInputSel) - { - reg |= PWM_CAPTCTRLA_EDGCNTA_EN_MASK; - } - /* Enable input capture operation */ - reg |= PWM_CAPTCTRLA_ARMA_MASK; - - base->SM[subModule].CAPTCTRLA = reg; - - /* Setup the compare value when using the edge counter as source */ - base->SM[subModule].CAPTCOMPA = PWM_CAPTCOMPA_EDGCMPA(inputCaptureParams->edgeCompareValue); - /* Setup PWM A pin for input capture */ - base->OUTEN &= ~((uint16_t)1U << (PWM_OUTEN_PWMA_EN_SHIFT + (uint16_t)subModule)); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB - case kPWM_PwmB: - /* Setup the capture paramters for PWM B pin */ - reg = (PWM_CAPTCTRLB_INP_SELB(inputCaptureParams->captureInputSel) | - PWM_CAPTCTRLB_EDGB0(inputCaptureParams->edge0) | PWM_CAPTCTRLB_EDGB1(inputCaptureParams->edge1) | - PWM_CAPTCTRLB_ONESHOTB(inputCaptureParams->enableOneShotCapture) | - PWM_CAPTCTRLB_CFBWM(inputCaptureParams->fifoWatermark)); - /* Enable the edge counter if using the output edge counter */ - if (inputCaptureParams->captureInputSel) - { - reg |= PWM_CAPTCTRLB_EDGCNTB_EN_MASK; - } - /* Enable input capture operation */ - reg |= PWM_CAPTCTRLB_ARMB_MASK; - - base->SM[subModule].CAPTCTRLB = reg; - - /* Setup the compare value when using the edge counter as source */ - base->SM[subModule].CAPTCOMPB = PWM_CAPTCOMPB_EDGCMPB(inputCaptureParams->edgeCompareValue); - /* Setup PWM B pin for input capture */ - base->OUTEN &= ~((uint16_t)1U << (PWM_OUTEN_PWMB_EN_SHIFT + (uint16_t)subModule)); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX - case kPWM_PwmX: - reg = (PWM_CAPTCTRLX_INP_SELX(inputCaptureParams->captureInputSel) | - PWM_CAPTCTRLX_EDGX0(inputCaptureParams->edge0) | PWM_CAPTCTRLX_EDGX1(inputCaptureParams->edge1) | - PWM_CAPTCTRLX_ONESHOTX(inputCaptureParams->enableOneShotCapture) | - PWM_CAPTCTRLX_CFXWM(inputCaptureParams->fifoWatermark)); - /* Enable the edge counter if using the output edge counter */ - if (inputCaptureParams->captureInputSel) - { - reg |= PWM_CAPTCTRLX_EDGCNTX_EN_MASK; - } - /* Enable input capture operation */ - reg |= PWM_CAPTCTRLX_ARMX_MASK; - - base->SM[subModule].CAPTCTRLX = reg; - - /* Setup the compare value when using the edge counter as source */ - base->SM[subModule].CAPTCOMPX = PWM_CAPTCOMPX_EDGCMPX(inputCaptureParams->edgeCompareValue); - /* Setup PWM X pin for input capture */ - base->OUTEN &= ~((uint16_t)1U << (PWM_OUTEN_PWMX_EN_SHIFT + (uint16_t)subModule)); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX */ - default: - assert(false); - break; - } -} - -/*! - * @brief Sets up the PWM fault input filter. - * - * @param base PWM peripheral base address - * @param faultInputFilterParams Parameters passed in to set up the fault input filter. - */ -void PWM_SetupFaultInputFilter(PWM_Type *base, const pwm_fault_input_filter_param_t *faultInputFilterParams) -{ - assert(NULL != faultInputFilterParams); - - /* When changing values for fault period from a non-zero value, first write a value of 0 to clear the filter. */ - if (0U != (base->FFILT & PWM_FFILT_FILT_PER_MASK)) - { - base->FFILT &= ~(uint16_t)(PWM_FFILT_FILT_PER_MASK); - } - - base->FFILT = (uint16_t)(PWM_FFILT_FILT_PER(faultInputFilterParams->faultFilterPeriod) | - PWM_FFILT_FILT_CNT(faultInputFilterParams->faultFilterCount) | - PWM_FFILT_GSTR(faultInputFilterParams->faultGlitchStretch ? 1U : 0U)); -} - -/*! - * brief Sets up the PWM fault protection. - * - * PWM has 4 fault inputs. - * - * param base PWM peripheral base address - * param faultNum PWM fault to configure. - * param faultParams Pointer to the PWM fault config structure - */ -void PWM_SetupFaults(PWM_Type *base, pwm_fault_input_t faultNum, const pwm_fault_param_t *faultParams) -{ - assert(faultParams); - uint16_t reg; - - reg = base->FCTRL; - /* Set the faults level-settting */ - if (faultParams->faultLevel) - { - reg |= ((uint16_t)1U << (PWM_FCTRL_FLVL_SHIFT + (uint16_t)faultNum)); - } - else - { - reg &= ~((uint16_t)1U << (PWM_FCTRL_FLVL_SHIFT + (uint16_t)faultNum)); - } - /* Set the fault clearing mode */ - if ((uint16_t)faultParams->faultClearingMode != 0U) - { - /* Use manual fault clearing */ - reg &= ~((uint16_t)1U << (PWM_FCTRL_FAUTO_SHIFT + (uint16_t)faultNum)); - if (faultParams->faultClearingMode == kPWM_ManualSafety) - { - /* Use manual fault clearing with safety mode enabled */ - reg |= ((uint16_t)1U << (PWM_FCTRL_FSAFE_SHIFT + (uint16_t)faultNum)); - } - else - { - /* Use manual fault clearing with safety mode disabled */ - reg &= ~((uint16_t)1U << (PWM_FCTRL_FSAFE_SHIFT + (uint16_t)faultNum)); - } - } - else - { - /* Use automatic fault clearing */ - reg |= ((uint16_t)1U << (PWM_FCTRL_FAUTO_SHIFT + (uint16_t)faultNum)); - } - base->FCTRL = reg; - - /* Set the combinational path option */ - if (faultParams->enableCombinationalPath) - { - /* Combinational path from the fault input to the PWM output is available */ - base->FCTRL2 &= ~((uint16_t)1U << (uint16_t)faultNum); - } - else - { - /* No combinational path available, only fault filter & latch signal can disable PWM output */ - base->FCTRL2 |= ((uint16_t)1U << (uint16_t)faultNum); - } - - /* Initially clear both recovery modes */ - reg = base->FSTS; - reg &= ~(((uint16_t)1U << (PWM_FSTS_FFULL_SHIFT + (uint16_t)faultNum)) | - ((uint16_t)1U << (PWM_FSTS_FHALF_SHIFT + (uint16_t)faultNum))); - /* Setup fault recovery */ - switch (faultParams->recoverMode) - { - case kPWM_NoRecovery: - break; - case kPWM_RecoverHalfCycle: - reg |= ((uint16_t)1U << (PWM_FSTS_FHALF_SHIFT + (uint16_t)faultNum)); - break; - case kPWM_RecoverFullCycle: - reg |= ((uint16_t)1U << (PWM_FSTS_FFULL_SHIFT + (uint16_t)faultNum)); - break; - case kPWM_RecoverHalfAndFullCycle: - reg |= ((uint16_t)1U << (PWM_FSTS_FHALF_SHIFT + (uint16_t)faultNum)); - reg |= ((uint16_t)1U << (PWM_FSTS_FFULL_SHIFT + (uint16_t)faultNum)); - break; - default: - assert(false); - break; - } - base->FSTS = reg; -} - -/*! - * brief Fill in the PWM fault config struct with the default settings - * - * The default values are: - * code - * config->faultClearingMode = kPWM_Automatic; - * config->faultLevel = false; - * config->enableCombinationalPath = true; - * config->recoverMode = kPWM_NoRecovery; - * endcode - * param config Pointer to user's PWM fault config structure. - */ -void PWM_FaultDefaultConfig(pwm_fault_param_t *config) -{ - assert(config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - /* PWM uses automatic fault clear mode */ - config->faultClearingMode = kPWM_Automatic; - /* PWM fault level is set to logic 0 */ - config->faultLevel = false; - /* Combinational Path from fault input is enabled */ - config->enableCombinationalPath = true; - /* PWM output will stay inactive when recovering from a fault */ - config->recoverMode = kPWM_NoRecovery; -} - -/*! - * brief Selects the signal to output on a PWM pin when a FORCE_OUT signal is asserted. - * - * The user specifies which channel to configure by supplying the submodule number and whether - * to modify PWM A or PWM B within that submodule. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmChannel Channel to configure - * param mode Signal to output when a FORCE_OUT is triggered - */ -void PWM_SetupForceSignal(PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmChannel, pwm_force_signal_t mode) - -{ - uint16_t shift; - uint16_t reg; - - /* DTSRCSEL register has 4 bits per submodule; 2 bits for PWM A and 2 bits for PWM B */ - shift = ((uint16_t)subModule * 4U) + ((uint16_t)pwmChannel * 2U); - - /* Setup the signal to be passed upon occurrence of a FORCE_OUT signal */ - reg = base->DTSRCSEL; - reg &= ~((uint16_t)0x3U << shift); - reg |= (uint16_t)((uint16_t)mode << shift); - base->DTSRCSEL = reg; -} - -/*! - * brief Enables the selected PWM interrupts - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::pwm_interrupt_enable_t - */ -void PWM_EnableInterrupts(PWM_Type *base, pwm_submodule_t subModule, uint32_t mask) -{ - /* Upper 16 bits are for related to the submodule */ - base->SM[subModule].INTEN |= ((uint16_t)mask & 0xFFFFU); - /* Fault related interrupts */ - base->FCTRL |= ((uint16_t)(mask >> 16U) & PWM_FCTRL_FIE_MASK); -} - -/*! - * brief Disables the selected PWM interrupts - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::pwm_interrupt_enable_t - */ -void PWM_DisableInterrupts(PWM_Type *base, pwm_submodule_t subModule, uint32_t mask) -{ - base->SM[subModule].INTEN &= ~((uint16_t)mask & 0xFFFFU); - base->FCTRL &= ~((uint16_t)(mask >> 16U) & PWM_FCTRL_FIE_MASK); -} - -/*! - * brief Gets the enabled PWM interrupts - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * - * return The enabled interrupts. This is the logical OR of members of the - * enumeration ::pwm_interrupt_enable_t - */ -uint32_t PWM_GetEnabledInterrupts(PWM_Type *base, pwm_submodule_t subModule) -{ - uint32_t enabledInterrupts; - - enabledInterrupts = base->SM[subModule].INTEN; - enabledInterrupts |= (((uint32_t)base->FCTRL & PWM_FCTRL_FIE_MASK) << 16UL); - return enabledInterrupts; -} - -/*! - * brief Gets the PWM status flags - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * - * return The status flags. This is the logical OR of members of the - * enumeration ::pwm_status_flags_t - */ -uint32_t PWM_GetStatusFlags(PWM_Type *base, pwm_submodule_t subModule) -{ - uint32_t statusFlags; - - statusFlags = base->SM[subModule].STS; - statusFlags |= (((uint32_t)base->FSTS & PWM_FSTS_FFLAG_MASK) << 16UL); - - return statusFlags; -} - -/*! - * brief Clears the PWM status flags - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::pwm_status_flags_t - */ -void PWM_ClearStatusFlags(PWM_Type *base, pwm_submodule_t subModule, uint32_t mask) -{ - uint16_t reg; - - base->SM[subModule].STS = ((uint16_t)mask & 0xFFFFU); - reg = base->FSTS; - /* Clear the fault flags and set only the ones we wish to clear as the fault flags are cleared - * by writing a login one - */ - reg &= ~(uint16_t)(PWM_FSTS_FFLAG_MASK); - reg |= (uint16_t)((mask >> 16U) & PWM_FSTS_FFLAG_MASK); - base->FSTS = reg; -} - -/*! - * brief Set PWM output in idle status (high or low). - * - * note This API should call after PWM_SetupPwm() APIs, and PWMX submodule is not supported. - * - * param base PWM peripheral base address - * param pwmChannel PWM channel to configure - * param subModule PWM submodule to configure - * param idleStatus True: PWM output is high in idle status; false: PWM output is low in idle status. - * - * return kStatus_Fail if there was error setting up the signal; kStatus_Success if set output idle success - */ -status_t PWM_SetOutputToIdle(PWM_Type *base, pwm_channels_t pwmChannel, pwm_submodule_t subModule, bool idleStatus) -{ - uint16_t valOn = 0, valOff = 0; - uint16_t ldmod; - - /* Clear LDOK bit if it is set */ - if (0U != (base->MCTRL & PWM_MCTRL_LDOK(1UL << (uint8_t)subModule))) - { - base->MCTRL |= PWM_MCTRL_CLDOK(1UL << (uint8_t)subModule); - } - - valOff = base->SM[subModule].INIT; - valOn = base->SM[subModule].VAL1 + 0x1U; - - if ((valOff + 1U) == valOn) - { - return kStatus_Fail; - } - - /* Should not PWM_X channel */ - if (kPWM_PwmA == pwmChannel) - { - if (0U != (base->SM[subModule].OCTRL & PWM_OCTRL_POLA_MASK)) - { - if (!idleStatus) - { - valOn = base->SM[subModule].INIT; - valOff = base->SM[subModule].VAL1 + 0x1U; - } - } - else - { - if (idleStatus) - { - valOn = base->SM[subModule].INIT; - valOff = base->SM[subModule].VAL1 + 0x1U; - } - } - base->SM[subModule].VAL2 = valOn; - base->SM[subModule].VAL3 = valOff; - } - else if (kPWM_PwmB == pwmChannel) - { - if (0U != (base->SM[subModule].OCTRL & PWM_OCTRL_POLB_MASK)) - { - if (!idleStatus) - { - valOn = base->SM[subModule].INIT; - valOff = base->SM[subModule].VAL1 + 0x1U; - } - } - else - { - if (idleStatus) - { - valOn = base->SM[subModule].INIT; - valOff = base->SM[subModule].VAL1 + 0x1U; - } - } - base->SM[subModule].VAL4 = valOn; - base->SM[subModule].VAL5 = valOff; - } - else - { - return kStatus_Fail; - } - - /* Record Load mode */ - ldmod = base->SM[subModule].CTRL; - /* Set Load mode to make Buffered registers take effect immediately when LDOK bit set */ - base->SM[subModule].CTRL |= PWM_CTRL_LDMOD_MASK; - /* Set LDOK bit to load buffer registers */ - base->MCTRL |= PWM_MCTRL_LDOK(1UL << (uint8_t)subModule); - /* Restore Load mode */ - base->SM[subModule].CTRL = ldmod; - - /* Get pwm duty cycle */ - s_pwmGetPwmDutyCycle[subModule][pwmChannel] = 0x0U; - - return kStatus_Success; -} - -/*! - * brief Get the dutycycle value. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmChannel PWM channel to configure - * - * return Current channel dutycycle value. - */ -uint8_t PWM_GetPwmChannelState(PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmChannel) -{ - return s_pwmGetPwmDutyCycle[subModule][pwmChannel]; -} - -/*! - * brief Set the pwm submodule prescaler. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param prescaler Set prescaler value - */ -void PWM_SetClockMode(PWM_Type *base, pwm_submodule_t subModule, pwm_clock_prescale_t prescaler) -{ - uint16_t reg = base->SM[subModule].CTRL; - - /* Clear LDOK bit if it is set */ - if (0U != (base->MCTRL & PWM_MCTRL_LDOK(1UL << (uint8_t)subModule))) - { - base->MCTRL |= PWM_MCTRL_CLDOK(1UL << (uint8_t)subModule); - } - /* Set submodule prescaler. */ - reg &= ~(uint16_t)PWM_CTRL_PRSC_MASK; - reg |= PWM_CTRL_PRSC(prescaler); - base->SM[subModule].CTRL = reg; - /* Set Load mode to make Buffered registers take effect immediately when LDOK bit set */ - base->SM[subModule].CTRL |= PWM_CTRL_LDMOD_MASK; - /* Set LDOK bit to load buffer registers */ - base->MCTRL |= PWM_MCTRL_LDOK(1UL << (uint8_t)subModule); - /* Restore Load mode */ - base->SM[subModule].CTRL = reg; -} - -/*! - * brief This function enables-disables the forcing of the output of a given eFlexPwm channel to logic 0. - * - * param base PWM peripheral base address - * param pwmChannel PWM channel to configure - * param subModule PWM submodule to configure - * param forcetozero True: Enable the pwm force output to zero; False: Disable the pwm output resumes normal - * function. - */ -void PWM_SetPwmForceOutputToZero(PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmChannel, bool forcetozero) -{ -#if !defined(PWM_MASK_UPDATE_MASK) - uint16_t reg = base->SM[subModule].CTRL2; -#endif - uint16_t mask; - - if (kPWM_PwmA == pwmChannel) - { - mask = PWM_MASK_MASKA(0x01UL << (uint8_t)subModule); - } - else if (kPWM_PwmB == pwmChannel) - { - mask = PWM_MASK_MASKB(0x01UL << (uint8_t)subModule); - } - else - { - mask = PWM_MASK_MASKX(0x01UL << (uint8_t)subModule); - } - - if (forcetozero) - { - /* Disables the channel output, forcing output level to 0 */ - base->MASK |= mask; - } - else - { - /* Enables the channel output */ - base->MASK &= ~mask; - } - -#if defined(PWM_MASK_UPDATE_MASK) - /* Update output mask bits immediately with UPDATE_MASK bit */ - base->MASK |= PWM_MASK_UPDATE_MASK(0x01UL << (uint8_t)subModule); -#else - /* Select local force signal */ - base->SM[subModule].CTRL2 &= ~(uint16_t)PWM_CTRL2_FORCE_SEL_MASK; - /* Issue a local Force trigger event */ - base->SM[subModule].CTRL2 |= PWM_CTRL2_FORCE_MASK; - /* Restore the source of FORCE OUTPUT signal */ - base->SM[subModule].CTRL2 = reg; -#endif -} - -/*! - * brief This function set the output state of the PWM pin as requested for the current cycle. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmChannel PWM channel to configure - * param outputstate Set pwm output state, see @ref pwm_output_state_t. - */ -void PWM_SetChannelOutput(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - pwm_output_state_t outputstate) -{ - uint16_t mask, swcout, sourceShift; - uint16_t reg = base->SM[subModule].CTRL2; - - if (kPWM_PwmA == pwmChannel) - { - mask = PWM_MASK_MASKA(0x01UL << (uint8_t)subModule); - swcout = (uint16_t)PWM_SWCOUT_SM0OUT23_MASK << ((uint8_t)subModule * 2U); - sourceShift = PWM_DTSRCSEL_SM0SEL23_SHIFT + ((uint16_t)subModule * 4U); - } - else if (kPWM_PwmB == pwmChannel) - { - mask = PWM_MASK_MASKB(0x01UL << (uint8_t)subModule); - swcout = (uint16_t)PWM_SWCOUT_SM0OUT45_MASK << ((uint8_t)subModule * 2U); - sourceShift = PWM_DTSRCSEL_SM0SEL45_SHIFT + ((uint16_t)subModule * 4U); - } - else - { - mask = PWM_MASK_MASKX(0x01UL << (uint8_t)subModule); - swcout = 0U; - sourceShift = 0U; - } - - if (kPWM_MaskState == outputstate) - { - /* Disables the channel output, forcing output level to 0 */ - base->MASK |= mask; - } - else - { - /* Enables the channel output first */ - base->MASK &= ~mask; - /* PwmX only support MASK mode */ - if (kPWM_PwmX != pwmChannel) - { - if (kPWM_HighState == outputstate) - { - base->SWCOUT |= swcout; - base->DTSRCSEL = - (base->DTSRCSEL & ~(uint16_t)(0x3UL << sourceShift)) | (uint16_t)(0x2UL << sourceShift); - } - else if (kPWM_LowState == outputstate) - { - base->SWCOUT &= ~swcout; - base->DTSRCSEL = - (base->DTSRCSEL & ~(uint16_t)(0x3UL << sourceShift)) | (uint16_t)(0x2UL << sourceShift); - } - else if (kPWM_NormalState == outputstate) - { - base->DTSRCSEL &= ~(uint16_t)(0x3UL << sourceShift); - } - else - { - base->DTSRCSEL = - (base->DTSRCSEL & ~(uint16_t)(0x3UL << sourceShift)) | (uint16_t)(0x1UL << sourceShift); - } - } - } - - /* Select local force signal */ - base->SM[subModule].CTRL2 &= ~(uint16_t)PWM_CTRL2_FORCE_SEL_MASK; - /* Issue a local Force trigger event */ - base->SM[subModule].CTRL2 |= PWM_CTRL2_FORCE_MASK; - /* Restore the source of FORCE OUTPUT signal */ - base->SM[subModule].CTRL2 = reg; -} - -#if defined(FSL_FEATURE_PWM_HAS_PHASE_DELAY) && FSL_FEATURE_PWM_HAS_PHASE_DELAY -/*! - * brief This function set the phase delay from the master sync signal of submodule 0. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmChannel PWM channel to configure - * param delayCycles Number of cycles delayed from submodule 0. - * - * return kStatus_Fail if the number of delay cycles is set larger than the period defined in submodule 0; - * kStatus_Success if set phase delay success - */ -status_t PWM_SetPhaseDelay(PWM_Type *base, pwm_channels_t pwmChannel, pwm_submodule_t subModule, uint16_t delayCycles) -{ - assert(subModule != kPWM_Module_0); - uint16_t reg = base->SM[subModule].CTRL2; - - /* Clear LDOK bit if it is set */ - if (0U != (base->MCTRL & PWM_MCTRL_LDOK(1UL << (uint8_t)subModule))) - { - base->MCTRL |= PWM_MCTRL_CLDOK(1UL << (uint8_t)subModule); - } - - if(base->SM[kPWM_Module_0].VAL1 < delayCycles) - { - return kStatus_Fail; - } - else - { - base->SM[subModule].PHASEDLY = delayCycles; - } - - /* Select the master sync signal as the source for initialization */ - reg = (reg & ~(uint16_t)PWM_CTRL2_INIT_SEL_MASK)| PWM_CTRL2_INIT_SEL(2); - /* Set Load mode to make Buffered registers take effect immediately when LDOK bit set */ - base->SM[subModule].CTRL |= PWM_CTRL_LDMOD_MASK; - /* Set LDOK bit to load buffer registers */ - base->MCTRL |= PWM_MCTRL_LDOK(1UL << (uint8_t)subModule); - /* Restore the source of phase delay register intialization */ - base->SM[subModule].CTRL2 = reg; - return kStatus_Success; -} -#endif /* FSL_FEATURE_PWM_HAS_PHASE_DELAY */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_pwm.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_pwm.h deleted file mode 100644 index 76835e2233d..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_pwm.h +++ /dev/null @@ -1,1372 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_PWM_H_ -#define FSL_PWM_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup pwm_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/*! @name Driver version */ -/*@{*/ -#define FSL_PWM_DRIVER_VERSION (MAKE_VERSION(2, 8, 3)) /*!< Version 2.8.3 */ -/*@}*/ - -/*! Number of bits per submodule for software output control */ -#define PWM_SUBMODULE_SWCONTROL_WIDTH 2 -/*! Because setting the pwm duty cycle doesn't support PWMX, getting the pwm duty cycle also doesn't support PWMX. */ -#define PWM_SUBMODULE_CHANNEL 2 - -/*! @brief List of PWM submodules */ -typedef enum _pwm_submodule -{ - kPWM_Module_0 = 0U, /*!< Submodule 0 */ - kPWM_Module_1, /*!< Submodule 1 */ - kPWM_Module_2, /*!< Submodule 2 */ -#if defined(FSL_FEATURE_PWM_SUBMODULE_COUNT) && (FSL_FEATURE_PWM_SUBMODULE_COUNT > 3U) - kPWM_Module_3 /*!< Submodule 3 */ -#endif /* FSL_FEATURE_PWM_SUBMODULE_COUNT */ -} pwm_submodule_t; - -/*! @brief List of PWM channels in each module */ -typedef enum _pwm_channels -{ - kPWM_PwmB = 0U, - kPWM_PwmA, - kPWM_PwmX -} pwm_channels_t; - -/*! @brief List of PWM value registers */ -typedef enum _pwm_value_register -{ - kPWM_ValueRegister_0 = 0U, /*!< PWM Value0 register */ - kPWM_ValueRegister_1, /*!< PWM Value1 register */ - kPWM_ValueRegister_2, /*!< PWM Value2 register */ - kPWM_ValueRegister_3, /*!< PWM Value3 register */ - kPWM_ValueRegister_4, /*!< PWM Value4 register */ - kPWM_ValueRegister_5 /*!< PWM Value5 register */ -} pwm_value_register_t; - -/*! @brief List of PWM value registers mask */ -enum _pwm_value_register_mask -{ - kPWM_ValueRegisterMask_0 = (1U << 0), /*!< PWM Value0 register mask */ - kPWM_ValueRegisterMask_1 = (1U << 1), /*!< PWM Value1 register mask */ - kPWM_ValueRegisterMask_2 = (1U << 2), /*!< PWM Value2 register mask */ - kPWM_ValueRegisterMask_3 = (1U << 3), /*!< PWM Value3 register mask */ - kPWM_ValueRegisterMask_4 = (1U << 4), /*!< PWM Value4 register mask */ - kPWM_ValueRegisterMask_5 = (1U << 5) /*!< PWM Value5 register mask */ -}; - -/*! @brief PWM clock source selection.*/ -typedef enum _pwm_clock_source -{ - kPWM_BusClock = 0U, /*!< The IPBus clock is used as the clock */ - kPWM_ExternalClock, /*!< EXT_CLK is used as the clock */ - kPWM_Submodule0Clock /*!< Clock of the submodule 0 (AUX_CLK) is used as the source clock */ -} pwm_clock_source_t; - -/*! @brief PWM prescaler factor selection for clock source*/ -typedef enum _pwm_clock_prescale -{ - kPWM_Prescale_Divide_1 = 0U, /*!< PWM clock frequency = fclk/1 */ - kPWM_Prescale_Divide_2, /*!< PWM clock frequency = fclk/2 */ - kPWM_Prescale_Divide_4, /*!< PWM clock frequency = fclk/4 */ - kPWM_Prescale_Divide_8, /*!< PWM clock frequency = fclk/8 */ - kPWM_Prescale_Divide_16, /*!< PWM clock frequency = fclk/16 */ - kPWM_Prescale_Divide_32, /*!< PWM clock frequency = fclk/32 */ - kPWM_Prescale_Divide_64, /*!< PWM clock frequency = fclk/64 */ - kPWM_Prescale_Divide_128 /*!< PWM clock frequency = fclk/128 */ -} pwm_clock_prescale_t; - -/*! @brief Options that can trigger a PWM FORCE_OUT */ -typedef enum _pwm_force_output_trigger -{ - kPWM_Force_Local = 0U, /*!< The local force signal, CTRL2[FORCE], from the submodule is used to force updates */ - kPWM_Force_Master, /*!< The master force signal from submodule 0 is used to force updates */ - kPWM_Force_LocalReload, /*!< The local reload signal from this submodule is used to force updates without regard to - the state of LDOK */ - kPWM_Force_MasterReload, /*!< The master reload signal from submodule 0 is used to force updates if LDOK is set */ - kPWM_Force_LocalSync, /*!< The local sync signal from this submodule is used to force updates */ - kPWM_Force_MasterSync, /*!< The master sync signal from submodule0 is used to force updates */ - kPWM_Force_External, /*!< The external force signal, EXT_FORCE, from outside the PWM module causes updates */ - kPWM_Force_ExternalSync /*!< The external sync signal, EXT_SYNC, from outside the PWM module causes updates */ -} pwm_force_output_trigger_t; - -/*! @brief PWM channel output status */ -typedef enum _pwm_output_state -{ - kPWM_HighState = 0, /*!< The output state of PWM channel is high */ - kPWM_LowState, /*!< The output state of PWM channel is low */ - kPWM_NormalState, /*!< The output state of PWM channel is normal */ - kPWM_InvertState, /*!< The output state of PWM channel is invert */ - kPWM_MaskState /*!< The output state of PWM channel is mask */ -} pwm_output_state_t; - -/*! @brief PWM counter initialization options */ -typedef enum _pwm_init_source -{ - kPWM_Initialize_LocalSync = 0U, /*!< Local sync causes initialization */ - kPWM_Initialize_MasterReload, /*!< Master reload from submodule 0 causes initialization */ - kPWM_Initialize_MasterSync, /*!< Master sync from submodule 0 causes initialization */ - kPWM_Initialize_ExtSync /*!< EXT_SYNC causes initialization */ -} pwm_init_source_t; - -/*! @brief PWM load frequency selection */ -typedef enum _pwm_load_frequency -{ - kPWM_LoadEveryOportunity = 0U, /*!< Every PWM opportunity */ - kPWM_LoadEvery2Oportunity, /*!< Every 2 PWM opportunities */ - kPWM_LoadEvery3Oportunity, /*!< Every 3 PWM opportunities */ - kPWM_LoadEvery4Oportunity, /*!< Every 4 PWM opportunities */ - kPWM_LoadEvery5Oportunity, /*!< Every 5 PWM opportunities */ - kPWM_LoadEvery6Oportunity, /*!< Every 6 PWM opportunities */ - kPWM_LoadEvery7Oportunity, /*!< Every 7 PWM opportunities */ - kPWM_LoadEvery8Oportunity, /*!< Every 8 PWM opportunities */ - kPWM_LoadEvery9Oportunity, /*!< Every 9 PWM opportunities */ - kPWM_LoadEvery10Oportunity, /*!< Every 10 PWM opportunities */ - kPWM_LoadEvery11Oportunity, /*!< Every 11 PWM opportunities */ - kPWM_LoadEvery12Oportunity, /*!< Every 12 PWM opportunities */ - kPWM_LoadEvery13Oportunity, /*!< Every 13 PWM opportunities */ - kPWM_LoadEvery14Oportunity, /*!< Every 14 PWM opportunities */ - kPWM_LoadEvery15Oportunity, /*!< Every 15 PWM opportunities */ - kPWM_LoadEvery16Oportunity /*!< Every 16 PWM opportunities */ -} pwm_load_frequency_t; - -/*! @brief List of PWM fault selections */ -typedef enum _pwm_fault_input -{ - kPWM_Fault_0 = 0U, /*!< Fault 0 input pin */ - kPWM_Fault_1, /*!< Fault 1 input pin */ - kPWM_Fault_2, /*!< Fault 2 input pin */ - kPWM_Fault_3 /*!< Fault 3 input pin */ -} pwm_fault_input_t; - -/*! @brief List of PWM fault disable mapping selections */ -typedef enum _pwm_fault_disable -{ - kPWM_FaultDisable_0 = (1U << 0), /*!< Fault 0 disable mapping */ - kPWM_FaultDisable_1 = (1U << 1), /*!< Fault 1 disable mapping */ - kPWM_FaultDisable_2 = (1U << 2), /*!< Fault 2 disable mapping */ - kPWM_FaultDisable_3 = (1U << 3) /*!< Fault 3 disable mapping */ -} pwm_fault_disable_t; - -/*! @brief List of PWM fault channels */ -typedef enum _pwm_fault_channels -{ - kPWM_faultchannel_0 = 0U, - kPWM_faultchannel_1 -} pwm_fault_channels_t; - -/*! @brief PWM capture edge select */ -typedef enum _pwm_input_capture_edge -{ - kPWM_Disable = 0U, /*!< Disabled */ - kPWM_FallingEdge, /*!< Capture on falling edge only */ - kPWM_RisingEdge, /*!< Capture on rising edge only */ - kPWM_RiseAndFallEdge /*!< Capture on rising or falling edge */ -} pwm_input_capture_edge_t; - -/*! @brief PWM output options when a FORCE_OUT signal is asserted */ -typedef enum _pwm_force_signal -{ - kPWM_UsePwm = 0U, /*!< Generated PWM signal is used by the deadtime logic.*/ - kPWM_InvertedPwm, /*!< Inverted PWM signal is used by the deadtime logic.*/ - kPWM_SoftwareControl, /*!< Software controlled value is used by the deadtime logic. */ - kPWM_UseExternal /*!< PWM_EXTA signal is used by the deadtime logic. */ -} pwm_force_signal_t; - -/*! @brief Options available for the PWM A & B pair operation */ -typedef enum _pwm_chnl_pair_operation -{ - kPWM_Independent = 0U, /*!< PWM A & PWM B operate as 2 independent channels */ - kPWM_ComplementaryPwmA, /*!< PWM A & PWM B are complementary channels, PWM A generates the signal */ - kPWM_ComplementaryPwmB /*!< PWM A & PWM B are complementary channels, PWM B generates the signal */ -} pwm_chnl_pair_operation_t; - -/*! @brief Options available on how to load the buffered-registers with new values */ -typedef enum _pwm_register_reload -{ - kPWM_ReloadImmediate = 0U, /*!< Buffered-registers get loaded with new values as soon as LDOK bit is set */ - kPWM_ReloadPwmHalfCycle, /*!< Registers loaded on a PWM half cycle */ - kPWM_ReloadPwmFullCycle, /*!< Registers loaded on a PWM full cycle */ - kPWM_ReloadPwmHalfAndFullCycle /*!< Registers loaded on a PWM half & full cycle */ -} pwm_register_reload_t; - -/*! @brief Options available on how to re-enable the PWM output when recovering from a fault */ -typedef enum _pwm_fault_recovery_mode -{ - kPWM_NoRecovery = 0U, /*!< PWM output will stay inactive */ - kPWM_RecoverHalfCycle, /*!< PWM output re-enabled at the first half cycle */ - kPWM_RecoverFullCycle, /*!< PWM output re-enabled at the first full cycle */ - kPWM_RecoverHalfAndFullCycle /*!< PWM output re-enabled at the first half or full cycle */ -} pwm_fault_recovery_mode_t; - -/*! @brief List of PWM interrupt options */ -typedef enum _pwm_interrupt_enable -{ - kPWM_CompareVal0InterruptEnable = (1U << 0), /*!< PWM VAL0 compare interrupt */ - kPWM_CompareVal1InterruptEnable = (1U << 1), /*!< PWM VAL1 compare interrupt */ - kPWM_CompareVal2InterruptEnable = (1U << 2), /*!< PWM VAL2 compare interrupt */ - kPWM_CompareVal3InterruptEnable = (1U << 3), /*!< PWM VAL3 compare interrupt */ - kPWM_CompareVal4InterruptEnable = (1U << 4), /*!< PWM VAL4 compare interrupt */ - kPWM_CompareVal5InterruptEnable = (1U << 5), /*!< PWM VAL5 compare interrupt */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX - kPWM_CaptureX0InterruptEnable = (1U << 6), /*!< PWM capture X0 interrupt */ - kPWM_CaptureX1InterruptEnable = (1U << 7), /*!< PWM capture X1 interrupt */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB - kPWM_CaptureB0InterruptEnable = (1U << 8), /*!< PWM capture B0 interrupt */ - kPWM_CaptureB1InterruptEnable = (1U << 9), /*!< PWM capture B1 interrupt */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA - kPWM_CaptureA0InterruptEnable = (1U << 10), /*!< PWM capture A0 interrupt */ - kPWM_CaptureA1InterruptEnable = (1U << 11), /*!< PWM capture A1 interrupt */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA */ - kPWM_ReloadInterruptEnable = (1U << 12), /*!< PWM reload interrupt */ - kPWM_ReloadErrorInterruptEnable = (1U << 13), /*!< PWM reload error interrupt */ - kPWM_Fault0InterruptEnable = (1U << 16), /*!< PWM fault 0 interrupt */ - kPWM_Fault1InterruptEnable = (1U << 17), /*!< PWM fault 1 interrupt */ - kPWM_Fault2InterruptEnable = (1U << 18), /*!< PWM fault 2 interrupt */ - kPWM_Fault3InterruptEnable = (1U << 19) /*!< PWM fault 3 interrupt */ -} pwm_interrupt_enable_t; - -/*! @brief List of PWM status flags */ -typedef enum _pwm_status_flags -{ - kPWM_CompareVal0Flag = (1U << 0), /*!< PWM VAL0 compare flag */ - kPWM_CompareVal1Flag = (1U << 1), /*!< PWM VAL1 compare flag */ - kPWM_CompareVal2Flag = (1U << 2), /*!< PWM VAL2 compare flag */ - kPWM_CompareVal3Flag = (1U << 3), /*!< PWM VAL3 compare flag */ - kPWM_CompareVal4Flag = (1U << 4), /*!< PWM VAL4 compare flag */ - kPWM_CompareVal5Flag = (1U << 5), /*!< PWM VAL5 compare flag */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX - kPWM_CaptureX0Flag = (1U << 6), /*!< PWM capture X0 flag */ - kPWM_CaptureX1Flag = (1U << 7), /*!< PWM capture X1 flag */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB - kPWM_CaptureB0Flag = (1U << 8), /*!< PWM capture B0 flag */ - kPWM_CaptureB1Flag = (1U << 9), /*!< PWM capture B1 flag */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA - kPWM_CaptureA0Flag = (1U << 10), /*!< PWM capture A0 flag */ - kPWM_CaptureA1Flag = (1U << 11), /*!< PWM capture A1 flag */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA */ - kPWM_ReloadFlag = (1U << 12), /*!< PWM reload flag */ - kPWM_ReloadErrorFlag = (1U << 13), /*!< PWM reload error flag */ - kPWM_RegUpdatedFlag = (1U << 14), /*!< PWM registers updated flag */ - kPWM_Fault0Flag = (1U << 16), /*!< PWM fault 0 flag */ - kPWM_Fault1Flag = (1U << 17), /*!< PWM fault 1 flag */ - kPWM_Fault2Flag = (1U << 18), /*!< PWM fault 2 flag */ - kPWM_Fault3Flag = (1U << 19) /*!< PWM fault 3 flag */ -} pwm_status_flags_t; - -/*! @brief List of PWM DMA options */ -typedef enum _pwm_dma_enable -{ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX - kPWM_CaptureX0DMAEnable = (1U << 0), /*!< PWM capture X0 DMA */ - kPWM_CaptureX1DMAEnable = (1U << 1), /*!< PWM capture X1 DMA */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB - kPWM_CaptureB0DMAEnable = (1U << 2), /*!< PWM capture B0 DMA */ - kPWM_CaptureB1DMAEnable = (1U << 3), /*!< PWM capture B1 DMA */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA - kPWM_CaptureA0DMAEnable = (1U << 4), /*!< PWM capture A0 DMA */ - kPWM_CaptureA1DMAEnable = (1U << 5) /*!< PWM capture A1 DMA */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA */ -} pwm_dma_enable_t; - -/*! @brief List of PWM capture DMA enable source select */ -typedef enum _pwm_dma_source_select -{ - kPWM_DMARequestDisable = 0U, /*!< Read DMA requests disabled */ - kPWM_DMAWatermarksEnable, /*!< Exceeding a FIFO watermark sets the DMA read request */ - kPWM_DMALocalSync, /*!< A local sync (VAL1 matches counter) sets the read DMA request */ - kPWM_DMALocalReload /*!< A local reload (STS[RF] being set) sets the read DMA request */ -} pwm_dma_source_select_t; - -/*! @brief PWM FIFO Watermark AND Control */ -typedef enum _pwm_watermark_control -{ - kPWM_FIFOWatermarksOR = 0U, /*!< Selected FIFO watermarks are OR'ed together */ - kPWM_FIFOWatermarksAND /*!< Selected FIFO watermarks are AND'ed together */ -} pwm_watermark_control_t; - -/*! @brief PWM operation mode */ -typedef enum _pwm_mode -{ - kPWM_SignedCenterAligned = 0U, /*!< Signed center-aligned */ - kPWM_CenterAligned, /*!< Unsigned cente-aligned */ - kPWM_SignedEdgeAligned, /*!< Signed edge-aligned */ - kPWM_EdgeAligned /*!< Unsigned edge-aligned */ -} pwm_mode_t; - -/*! @brief PWM output pulse mode, high-true or low-true */ -typedef enum _pwm_level_select -{ - kPWM_HighTrue = 0U, /*!< High level represents "on" or "active" state */ - kPWM_LowTrue /*!< Low level represents "on" or "active" state */ -} pwm_level_select_t; - -/*! @brief PWM output fault status */ -typedef enum _pwm_fault_state -{ - kPWM_PwmFaultState0 = - 0U, /*!< Output is forced to logic 0 state prior to consideration of output polarity control. */ - kPWM_PwmFaultState1, /*!< Output is forced to logic 1 state prior to consideration of output polarity control. */ - kPWM_PwmFaultState2, /*!< Output is tristated. */ - kPWM_PwmFaultState3 /*!< Output is tristated. */ -} pwm_fault_state_t; - -/*! @brief PWM reload source select */ -typedef enum _pwm_reload_source_select -{ - kPWM_LocalReload = 0U, /*!< The local reload signal is used to reload registers */ - kPWM_MasterReload /*!< The master reload signal (from submodule 0) is used to reload */ -} pwm_reload_source_select_t; - -/*! @brief PWM fault clearing options */ -typedef enum _pwm_fault_clear -{ - kPWM_Automatic = 0U, /*!< Automatic fault clearing */ - kPWM_ManualNormal, /*!< Manual fault clearing with no fault safety mode */ - kPWM_ManualSafety /*!< Manual fault clearing with fault safety mode */ -} pwm_fault_clear_t; - -/*! @brief Options for submodule master control operation */ -typedef enum _pwm_module_control -{ - kPWM_Control_Module_0 = (1U << 0), /*!< Control submodule 0's start/stop,buffer reload operation */ - kPWM_Control_Module_1 = (1U << 1), /*!< Control submodule 1's start/stop,buffer reload operation */ - kPWM_Control_Module_2 = (1U << 2), /*!< Control submodule 2's start/stop,buffer reload operation */ - kPWM_Control_Module_3 = (1U << 3) /*!< Control submodule 3's start/stop,buffer reload operation */ -} pwm_module_control_t; - -/*! @brief Structure for the user to define the PWM signal characteristics */ -typedef struct _pwm_signal_param -{ - pwm_channels_t pwmChannel; /*!< PWM channel being configured; PWM A or PWM B */ - uint8_t dutyCyclePercent; /*!< PWM pulse width, value should be between 0 to 100 - 0=inactive signal(0% duty cycle)... - 100=always active signal (100% duty cycle)*/ - pwm_level_select_t level; /*!< PWM output active level select */ - uint16_t deadtimeValue; /*!< The deadtime value; only used if channel pair is operating in complementary mode */ - pwm_fault_state_t faultState; /*!< PWM output fault status */ - bool pwmchannelenable; /*!< Enable PWM output */ -} pwm_signal_param_t; - -/*! - * @brief PWM config structure - * - * This structure holds the configuration settings for the PWM peripheral. To initialize this - * structure to reasonable defaults, call the PWM_GetDefaultConfig() function and pass a - * pointer to your config structure instance. - * - * The config struct can be made const so it resides in flash - */ -typedef struct _pwm_config -{ - bool enableDebugMode; /*!< true: PWM continues to run in debug mode; - false: PWM is paused in debug mode */ -#if !defined(FSL_FEATURE_PWM_HAS_NO_WAITEN) || (!FSL_FEATURE_PWM_HAS_NO_WAITEN) - bool enableWait; /*!< true: PWM continues to run in WAIT mode; - false: PWM is paused in WAIT mode */ -#endif /* FSL_FEATURE_PWM_HAS_NO_WAITEN */ - pwm_init_source_t initializationControl; /*!< Option to initialize the counter */ - pwm_clock_source_t clockSource; /*!< Clock source for the counter */ - pwm_clock_prescale_t prescale; /*!< Pre-scaler to divide down the clock */ - pwm_chnl_pair_operation_t pairOperation; /*!< Channel pair in indepedent or complementary mode */ - pwm_register_reload_t reloadLogic; /*!< PWM Reload logic setup */ - pwm_reload_source_select_t reloadSelect; /*!< Reload source select */ - pwm_load_frequency_t reloadFrequency; /*!< Specifies when to reload, used when user's choice - is not immediate reload */ - pwm_force_output_trigger_t forceTrigger; /*!< Specify which signal will trigger a FORCE_OUT */ -} pwm_config_t; - -/*! @brief Structure for the user to configure the fault input filter. */ -typedef struct _pwm_fault_input_filter_param -{ - uint8_t faultFilterCount; /*!< Fault filter count */ - uint8_t faultFilterPeriod; /*!< Fault filter period;value of 0 will bypass the filter */ - bool faultGlitchStretch; /*!< Fault Glitch Stretch Enable: A logic 1 means that input - fault signals will be stretched to at least 2 IPBus clock cycles */ -} pwm_fault_input_filter_param_t; - -/*! @brief Structure is used to hold the parameters to configure a PWM fault */ -typedef struct _pwm_fault_param -{ - pwm_fault_clear_t faultClearingMode; /*!< Fault clearing mode to use */ - bool faultLevel; /*!< true: Logic 1 indicates fault; - false: Logic 0 indicates fault */ - bool enableCombinationalPath; /*!< true: Combinational Path from fault input is enabled; - false: No combination path is available */ - pwm_fault_recovery_mode_t recoverMode; /*!< Specify when to re-enable the PWM output */ -} pwm_fault_param_t; - -/*! - * @brief Structure is used to hold parameters to configure the capture capability of a signal pin - */ -typedef struct _pwm_input_capture_param -{ - bool captureInputSel; /*!< true: Use the edge counter signal as source - false: Use the raw input signal from the pin as source */ - uint8_t edgeCompareValue; /*!< Compare value, used only if edge counter is used as source */ - pwm_input_capture_edge_t edge0; /*!< Specify which edge causes a capture for input circuitry 0 */ - pwm_input_capture_edge_t edge1; /*!< Specify which edge causes a capture for input circuitry 1 */ - bool enableOneShotCapture; /*!< true: Use one-shot capture mode; - false: Use free-running capture mode */ - uint8_t fifoWatermark; /*!< Watermark level for capture FIFO. The capture flags in - the status register will set if the word count in the FIFO - is greater than this watermark level */ -} pwm_input_capture_param_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Ungates the PWM submodule clock and configures the peripheral for basic operation. - * - * @note This API should be called at the beginning of the application using the PWM driver. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param config Pointer to user's PWM config structure. - * - * @return kStatus_Success means success; else failed. - */ -status_t PWM_Init(PWM_Type *base, pwm_submodule_t subModule, const pwm_config_t *config); - -/*! - * @brief Gate the PWM submodule clock - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to deinitialize - */ -void PWM_Deinit(PWM_Type *base, pwm_submodule_t subModule); - -/*! - * @brief Fill in the PWM config struct with the default settings - * - * The default values are: - * @code - * config->enableDebugMode = false; - * config->enableWait = false; - * config->reloadSelect = kPWM_LocalReload; - * config->clockSource = kPWM_BusClock; - * config->prescale = kPWM_Prescale_Divide_1; - * config->initializationControl = kPWM_Initialize_LocalSync; - * config->forceTrigger = kPWM_Force_Local; - * config->reloadFrequency = kPWM_LoadEveryOportunity; - * config->reloadLogic = kPWM_ReloadImmediate; - * config->pairOperation = kPWM_Independent; - * @endcode - * @param config Pointer to user's PWM config structure. - */ -void PWM_GetDefaultConfig(pwm_config_t *config); - -/*! @}*/ - -/*! - * @name Module PWM output - * @{ - */ -/*! - * @brief Sets up the PWM signals for a PWM submodule. - * - * The function initializes the submodule according to the parameters passed in by the user. The function - * also sets up the value compare registers to match the PWM signal requirements. - * If the dead time insertion logic is enabled, the pulse period is reduced by the - * dead time period specified by the user. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param chnlParams Array of PWM channel parameters to configure the channel(s), PWMX submodule is not supported. - * @param numOfChnls Number of channels to configure, this should be the size of the array passed in. - * Array size should not be more than 2 as each submodule has 2 pins to output PWM - * @param mode PWM operation mode, options available in enumeration ::pwm_mode_t - * @param pwmFreq_Hz PWM signal frequency in Hz - * @param srcClock_Hz PWM source clock of correspond submodule in Hz. If source clock of submodule1,2,3 is from - * submodule0 AUX_CLK, its source clock is submodule0 source clock divided with submodule0 - * prescaler value instead of submodule0 source clock. - * - * @return Returns kStatus_Fail if there was error setting up the signal; kStatus_Success otherwise - */ -status_t PWM_SetupPwm(PWM_Type *base, - pwm_submodule_t subModule, - const pwm_signal_param_t *chnlParams, - uint8_t numOfChnls, - pwm_mode_t mode, - uint32_t pwmFreq_Hz, - uint32_t srcClock_Hz); - -/*! - * @brief Set PWM phase shift for PWM channel running on channel PWM_A, PWM_B which with 50% duty cycle.. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel PWM channel to configure - * @param pwmFreq_Hz PWM signal frequency in Hz - * @param srcClock_Hz PWM main counter clock in Hz. - * @param shiftvalue Phase shift value - * @param doSync true: Set LDOK bit for the submodule list; - * false: LDOK bit don't set, need to call PWM_SetPwmLdok to sync update. - * - * @return Returns kStatus_Fail if there was error setting up the signal; kStatus_Success otherwise - */ -status_t PWM_SetupPwmPhaseShift(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - uint32_t pwmFreq_Hz, - uint32_t srcClock_Hz, - uint8_t shiftvalue, - bool doSync); - -/*! - * @brief Updates the PWM signal's dutycycle. - * - * The function updates the PWM dutycyle to the new value that is passed in. - * If the dead time insertion logic is enabled then the pulse period is reduced by the - * dead time period specified by the user. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmSignal Signal (PWM A or PWM B) to update - * @param currPwmMode The current PWM mode set during PWM setup - * @param dutyCyclePercent New PWM pulse width, value should be between 0 to 100 - * 0=inactive signal(0% duty cycle)... - * 100=active signal (100% duty cycle) - */ -void PWM_UpdatePwmDutycycle(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmSignal, - pwm_mode_t currPwmMode, - uint8_t dutyCyclePercent); - -/*! - * @brief Updates the PWM signal's dutycycle with 16-bit accuracy. - * - * The function updates the PWM dutycyle to the new value that is passed in. - * If the dead time insertion logic is enabled then the pulse period is reduced by the - * dead time period specified by the user. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmSignal Signal (PWM A or PWM B) to update - * @param currPwmMode The current PWM mode set during PWM setup - * @param dutyCycle New PWM pulse width, value should be between 0 to 65535 - * 0=inactive signal(0% duty cycle)... - * 65535=active signal (100% duty cycle) - */ -void PWM_UpdatePwmDutycycleHighAccuracy( - PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmSignal, pwm_mode_t currPwmMode, uint16_t dutyCycle); - -/*! - * @brief Update the PWM signal's period and dutycycle for a PWM submodule. - * - * The function updates PWM signal period generated by a specific submodule according to the parameters - * passed in by the user. This function can also set dutycycle weather you want to keep original dutycycle - * or update new dutycycle. Call this function in local sync control mode because PWM period is depended by - * INIT and VAL1 register of each submodule. In master sync initialization control mode, call this function - * to update INIT and VAL1 register of all submodule because PWM period is depended by INIT and VAL1 register - * in submodule0. If the dead time insertion logic is enabled, the pulse period is reduced by the dead time - * period specified by the user. PWM signal will not be generated if its period is less than dead time duration. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmSignal Signal (PWM A or PWM B) to update - * @param currPwmMode The current PWM mode set during PWM setup, options available in enumeration ::pwm_mode_t - * @param pulseCnt New PWM period, value should be between 0 to 65535 - * 0=minimum PWM period... - * 65535=maximum PWM period - * @param dutyCycle New PWM pulse width of channel, value should be between 0 to 65535 - * 0=inactive signal(0% duty cycle)... - * 65535=active signal (100% duty cycle) - * You can keep original duty cycle or update new duty cycle - */ -void PWM_UpdatePwmPeriodAndDutycycle(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmSignal, - pwm_mode_t currPwmMode, - uint16_t pulseCnt, - uint16_t dutyCycle); - -/*! @}*/ - -/*! - * @brief Sets up the PWM input capture - * - * Each PWM submodule has 3 pins that can be configured for use as input capture pins. This function - * sets up the capture parameters for each pin and enables the pin for input capture operation. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel Channel in the submodule to setup - * @param inputCaptureParams Parameters passed in to set up the input pin - */ -void PWM_SetupInputCapture(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - const pwm_input_capture_param_t *inputCaptureParams); - -/*! - * @brief Sets up the PWM fault input filter. - * - * @param base PWM peripheral base address - * @param faultInputFilterParams Parameters passed in to set up the fault input filter. - */ -void PWM_SetupFaultInputFilter(PWM_Type *base, const pwm_fault_input_filter_param_t *faultInputFilterParams); - -/*! - * @brief Sets up the PWM fault protection. - * - * PWM has 4 fault inputs. - * - * @param base PWM peripheral base address - * @param faultNum PWM fault to configure. - * @param faultParams Pointer to the PWM fault config structure - */ -void PWM_SetupFaults(PWM_Type *base, pwm_fault_input_t faultNum, const pwm_fault_param_t *faultParams); - -/*! - * @brief Fill in the PWM fault config struct with the default settings - * - * The default values are: - * @code - * config->faultClearingMode = kPWM_Automatic; - * config->faultLevel = false; - * config->enableCombinationalPath = true; - * config->recoverMode = kPWM_NoRecovery; - * @endcode - * @param config Pointer to user's PWM fault config structure. - */ -void PWM_FaultDefaultConfig(pwm_fault_param_t *config); - -/*! - * @brief Selects the signal to output on a PWM pin when a FORCE_OUT signal is asserted. - * - * The user specifies which channel to configure by supplying the submodule number and whether - * to modify PWM A or PWM B within that submodule. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel Channel to configure - * @param mode Signal to output when a FORCE_OUT is triggered - */ -void PWM_SetupForceSignal(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - pwm_force_signal_t mode); - -/*! - * @name Interrupts Interface - * @{ - */ - -/*! - * @brief Enables the selected PWM interrupts - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::pwm_interrupt_enable_t - */ -void PWM_EnableInterrupts(PWM_Type *base, pwm_submodule_t subModule, uint32_t mask); - -/*! - * @brief Disables the selected PWM interrupts - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::pwm_interrupt_enable_t - */ -void PWM_DisableInterrupts(PWM_Type *base, pwm_submodule_t subModule, uint32_t mask); - -/*! - * @brief Gets the enabled PWM interrupts - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * - * @return The enabled interrupts. This is the logical OR of members of the - * enumeration ::pwm_interrupt_enable_t - */ -uint32_t PWM_GetEnabledInterrupts(PWM_Type *base, pwm_submodule_t subModule); - -/*! @}*/ - -/*! - * @name DMA Interface - * @{ - */ - -/*! - * @brief Capture DMA Enable Source Select. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwm_watermark_control PWM FIFO watermark and control - */ -static inline void PWM_DMAFIFOWatermarkControl(PWM_Type *base, - pwm_submodule_t subModule, - pwm_watermark_control_t pwm_watermark_control) -{ - uint16_t reg = base->SM[subModule].DMAEN; - if (pwm_watermark_control == kPWM_FIFOWatermarksOR) - { - reg &= ~((uint16_t)PWM_DMAEN_FAND_MASK); - } - else - { - reg |= ((uint16_t)PWM_DMAEN_FAND_MASK); - } - base->SM[subModule].DMAEN = reg; -} - -/*! - * @brief Capture DMA Enable Source Select. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwm_dma_source_select PWM capture DMA enable source select - */ -static inline void PWM_DMACaptureSourceSelect(PWM_Type *base, - pwm_submodule_t subModule, - pwm_dma_source_select_t pwm_dma_source_select) -{ - uint16_t reg = base->SM[subModule].DMAEN; - - reg &= ~((uint16_t)PWM_DMAEN_CAPTDE_MASK); - reg |= (((uint16_t)pwm_dma_source_select << (uint16_t)PWM_DMAEN_CAPTDE_SHIFT) & (uint16_t)PWM_DMAEN_CAPTDE_MASK); - - base->SM[subModule].DMAEN = reg; -} - -/*! - * @brief Enables or disables the selected PWM DMA Capture read request. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param mask The DMA to enable or disable. This is a logical OR of members of the - * enumeration ::pwm_dma_enable_t - * @param activate true: Enable DMA read request; false: Disable DMA read request - */ -static inline void PWM_EnableDMACapture(PWM_Type *base, pwm_submodule_t subModule, uint16_t mask, bool activate) -{ - uint16_t reg = base->SM[subModule].DMAEN; - if (activate) - { - reg |= (uint16_t)(mask); - } - else - { - reg &= ~((uint16_t)(mask)); - } - base->SM[subModule].DMAEN = reg; -} - -/*! - * @brief Enables or disables the PWM DMA write request. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param activate true: Enable DMA write request; false: Disable DMA write request - */ -static inline void PWM_EnableDMAWrite(PWM_Type *base, pwm_submodule_t subModule, bool activate) -{ - uint16_t reg = base->SM[subModule].DMAEN; - if (activate) - { - reg |= ((uint16_t)PWM_DMAEN_VALDE_MASK); - } - else - { - reg &= ~((uint16_t)PWM_DMAEN_VALDE_MASK); - } - base->SM[subModule].DMAEN = reg; -} - -/*! @}*/ - -/*! - * @name Status Interface - * @{ - */ - -/*! - * @brief Gets the PWM status flags - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * - * @return The status flags. This is the logical OR of members of the - * enumeration ::pwm_status_flags_t - */ -uint32_t PWM_GetStatusFlags(PWM_Type *base, pwm_submodule_t subModule); - -/*! - * @brief Clears the PWM status flags - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::pwm_status_flags_t - */ -void PWM_ClearStatusFlags(PWM_Type *base, pwm_submodule_t subModule, uint32_t mask); - -/*! @}*/ - -/*! - * @name Timer Start and Stop - * @{ - */ - -/*! - * @brief Starts the PWM counter for a single or multiple submodules. - * - * Sets the Run bit which enables the clocks to the PWM submodule. This function can start multiple - * submodules at the same time. - * - * @param base PWM peripheral base address - * @param subModulesToStart PWM submodules to start. This is a logical OR of members of the - * enumeration ::pwm_module_control_t - */ -static inline void PWM_StartTimer(PWM_Type *base, uint8_t subModulesToStart) -{ - base->MCTRL |= PWM_MCTRL_RUN(subModulesToStart); -} - -/*! - * @brief Stops the PWM counter for a single or multiple submodules. - * - * Clears the Run bit which resets the submodule's counter. This function can stop multiple - * submodules at the same time. - * - * @param base PWM peripheral base address - * @param subModulesToStop PWM submodules to stop. This is a logical OR of members of the - * enumeration ::pwm_module_control_t - */ -static inline void PWM_StopTimer(PWM_Type *base, uint8_t subModulesToStop) -{ - base->MCTRL &= ~(PWM_MCTRL_RUN(subModulesToStop)); -} - -/*! @}*/ - -/*! - * @brief Set the PWM VALx registers. - * - * This function allows the user to write value into VAL registers directly. And it will destroying the PWM clock period - * set by the PWM_SetupPwm()/PWM_SetupPwmPhaseShift() functions. - * Due to VALx registers are bufferd, the new value will not active uless call PWM_SetPwmLdok() and the reload point is - * reached. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param valueRegister VALx register that will be writen new value - * @param value Value that will been write into VALx register - */ -static inline void PWM_SetVALxValue(PWM_Type *base, - pwm_submodule_t subModule, - pwm_value_register_t valueRegister, - uint16_t value) -{ - switch (valueRegister) - { - case kPWM_ValueRegister_0: - base->SM[subModule].VAL0 = value; - break; - case kPWM_ValueRegister_1: - base->SM[subModule].VAL1 = value; - break; - case kPWM_ValueRegister_2: - base->SM[subModule].VAL2 = value; - break; - case kPWM_ValueRegister_3: - base->SM[subModule].VAL3 = value; - break; - case kPWM_ValueRegister_4: - base->SM[subModule].VAL4 = value; - break; - case kPWM_ValueRegister_5: - base->SM[subModule].VAL5 = value; - break; - default: - assert(false); - break; - } -} - -/*! - * @brief Get the PWM VALx registers. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param valueRegister VALx register that will be read value - * @return The VALx register value - */ -static inline uint16_t PWM_GetVALxValue(PWM_Type *base, pwm_submodule_t subModule, pwm_value_register_t valueRegister) -{ - uint16_t temp = 0U; - - switch (valueRegister) - { - case kPWM_ValueRegister_0: - temp = base->SM[subModule].VAL0; - break; - case kPWM_ValueRegister_1: - temp = base->SM[subModule].VAL1; - break; - case kPWM_ValueRegister_2: - temp = base->SM[subModule].VAL2; - break; - case kPWM_ValueRegister_3: - temp = base->SM[subModule].VAL3; - break; - case kPWM_ValueRegister_4: - temp = base->SM[subModule].VAL4; - break; - case kPWM_ValueRegister_5: - temp = base->SM[subModule].VAL5; - break; - default: - assert(false); - break; - } - - return temp; -} - -/*! - * @brief Enables or disables the PWM output trigger. - * - * This function allows the user to enable or disable the PWM trigger. The PWM has 2 triggers. Trigger 0 - * is activated when the counter matches VAL 0, VAL 2, or VAL 4 register. Trigger 1 is activated - * when the counter matches VAL 1, VAL 3, or VAL 5 register. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param valueRegister Value register that will activate the trigger - * @param activate true: Enable the trigger; false: Disable the trigger - */ -static inline void PWM_OutputTriggerEnable(PWM_Type *base, - pwm_submodule_t subModule, - pwm_value_register_t valueRegister, - bool activate) -{ - if (activate) - { - base->SM[subModule].TCTRL |= ((uint16_t)1U << (uint16_t)valueRegister); - } - else - { - base->SM[subModule].TCTRL &= ~((uint16_t)1U << (uint16_t)valueRegister); - } -} - -/*! - * @brief Enables the PWM output trigger. - * - * This function allows the user to enable one or more (VAL0-5) PWM trigger. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param valueRegisterMask Value register mask that will activate one or more (VAL0-5) trigger - * enumeration ::_pwm_value_register_mask - */ -static inline void PWM_ActivateOutputTrigger(PWM_Type *base, pwm_submodule_t subModule, uint16_t valueRegisterMask) -{ - base->SM[subModule].TCTRL |= (PWM_TCTRL_OUT_TRIG_EN_MASK & (valueRegisterMask)); -} - -/*! - * @brief Disables the PWM output trigger. - * - * This function allows the user to disables one or more (VAL0-5) PWM trigger. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param valueRegisterMask Value register mask that will Deactivate one or more (VAL0-5) trigger - * enumeration ::_pwm_value_register_mask - */ -static inline void PWM_DeactivateOutputTrigger(PWM_Type *base, pwm_submodule_t subModule, uint16_t valueRegisterMask) -{ - base->SM[subModule].TCTRL &= ~(PWM_TCTRL_OUT_TRIG_EN_MASK & (valueRegisterMask)); -} - -/*! - * @brief Sets the software control output for a pin to high or low. - * - * The user specifies which channel to modify by supplying the submodule number and whether - * to modify PWM A or PWM B within that submodule. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel Channel to configure - * @param value true: Supply a logic 1, false: Supply a logic 0. - */ -static inline void PWM_SetupSwCtrlOut(PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmChannel, bool value) -{ - if (value) - { - base->SWCOUT |= - ((uint16_t)1U << (((uint16_t)subModule * (uint16_t)PWM_SUBMODULE_SWCONTROL_WIDTH) + (uint16_t)pwmChannel)); - } - else - { - base->SWCOUT &= - ~((uint16_t)1U << (((uint16_t)subModule * (uint16_t)PWM_SUBMODULE_SWCONTROL_WIDTH) + (uint16_t)pwmChannel)); - } -} - -/*! - * @brief Sets or clears the PWM LDOK bit on a single or multiple submodules - * - * Set LDOK bit to load buffered values into CTRL[PRSC] and the INIT, FRACVAL and VAL registers. The - * values are loaded immediately if kPWM_ReloadImmediate option was choosen during config. Else the - * values are loaded at the next PWM reload point. - * This function can issue the load command to multiple submodules at the same time. - * - * @param base PWM peripheral base address - * @param subModulesToUpdate PWM submodules to update with buffered values. This is a logical OR of - * members of the enumeration ::pwm_module_control_t - * @param value true: Set LDOK bit for the submodule list; false: Clear LDOK bit - */ -static inline void PWM_SetPwmLdok(PWM_Type *base, uint8_t subModulesToUpdate, bool value) -{ - if (value) - { - base->MCTRL |= PWM_MCTRL_LDOK(subModulesToUpdate); - } - else - { - base->MCTRL |= PWM_MCTRL_CLDOK(subModulesToUpdate); - } -} - -/*! - * @brief Set PWM output fault status - * - * These bits determine the fault state for the PWM_A output in fault conditions - * and STOP mode. It may also define the output state in WAIT and DEBUG modes - * depending on the settings of CTRL2[WAITEN] and CTRL2[DBGEN]. - * This function can update PWM output fault status. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel Channel to configure - * @param faultState PWM output fault status - */ -static inline void PWM_SetPwmFaultState(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - pwm_fault_state_t faultState) -{ - uint16_t reg = base->SM[subModule].OCTRL; - switch (pwmChannel) - { - case kPWM_PwmA: - reg &= ~((uint16_t)PWM_OCTRL_PWMAFS_MASK); - reg |= (((uint16_t)faultState << (uint16_t)PWM_OCTRL_PWMAFS_SHIFT) & (uint16_t)PWM_OCTRL_PWMAFS_MASK); - break; - case kPWM_PwmB: - reg &= ~((uint16_t)PWM_OCTRL_PWMBFS_MASK); - reg |= (((uint16_t)faultState << (uint16_t)PWM_OCTRL_PWMBFS_SHIFT) & (uint16_t)PWM_OCTRL_PWMBFS_MASK); - break; - case kPWM_PwmX: - reg &= ~((uint16_t)PWM_OCTRL_PWMXFS_MASK); - reg |= (((uint16_t)faultState << (uint16_t)PWM_OCTRL_PWMXFS_SHIFT) & (uint16_t)PWM_OCTRL_PWMXFS_MASK); - break; - default: - assert(false); - break; - } - base->SM[subModule].OCTRL = reg; -} - -/*! - * @brief Set PWM fault disable mapping - * - * Each of the four bits of this read/write field is one-to-one associated - * with the four FAULTx inputs of fault channel 0/1. The PWM output will be turned - * off if there is a logic 1 on an FAULTx input and a 1 in the corresponding - * bit of this field. A reset sets all bits in this field. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel PWM channel to configure - * @param pwm_fault_channels PWM fault channel to configure - * @param value Fault disable mapping mask value - * enumeration ::pwm_fault_disable_t - */ -static inline void PWM_SetupFaultDisableMap(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - pwm_fault_channels_t pwm_fault_channels, - uint16_t value) -{ - uint16_t reg = base->SM[subModule].DISMAP[pwm_fault_channels]; - switch (pwmChannel) - { - case kPWM_PwmA: - reg &= ~((uint16_t)PWM_DISMAP_DIS0A_MASK); - reg |= (((uint16_t)(value) << (uint16_t)PWM_DISMAP_DIS0A_SHIFT) & (uint16_t)PWM_DISMAP_DIS0A_MASK); - break; - case kPWM_PwmB: - reg &= ~((uint16_t)PWM_DISMAP_DIS0B_MASK); - reg |= (((uint16_t)(value) << (uint16_t)PWM_DISMAP_DIS0B_SHIFT) & (uint16_t)PWM_DISMAP_DIS0B_MASK); - break; - case kPWM_PwmX: - reg &= ~((uint16_t)PWM_DISMAP_DIS0X_MASK); - reg |= (((uint16_t)(value) << (uint16_t)PWM_DISMAP_DIS0X_SHIFT) & (uint16_t)PWM_DISMAP_DIS0X_MASK); - break; - default: - assert(false); - break; - } - base->SM[subModule].DISMAP[pwm_fault_channels] = reg; -} - -/*! - * @brief Set PWM output enable - * - * This feature allows the user to enable the PWM Output. - * - * @param base PWM peripheral base address - * @param pwmChannel PWM channel to configure - * @param subModule PWM submodule to configure - */ -static inline void PWM_OutputEnable(PWM_Type *base, pwm_channels_t pwmChannel, pwm_submodule_t subModule) -{ - /* Set PWM output */ - switch (pwmChannel) - { - case kPWM_PwmA: - base->OUTEN |= ((uint16_t)1U << ((uint16_t)PWM_OUTEN_PWMA_EN_SHIFT + (uint16_t)subModule)); - break; - case kPWM_PwmB: - base->OUTEN |= ((uint16_t)1U << ((uint16_t)PWM_OUTEN_PWMB_EN_SHIFT + (uint16_t)subModule)); - break; - case kPWM_PwmX: - base->OUTEN |= ((uint16_t)1U << ((uint16_t)PWM_OUTEN_PWMX_EN_SHIFT + (uint16_t)subModule)); - break; - default: - assert(false); - break; - } -} - -/*! - * @brief Set PWM output disable - * - *This feature allows the user to disable the PWM output. - * - * @param base PWM peripheral base address - * @param pwmChannel PWM channel to configure - * @param subModule PWM submodule to configure - */ -static inline void PWM_OutputDisable(PWM_Type *base, pwm_channels_t pwmChannel, pwm_submodule_t subModule) -{ - switch (pwmChannel) - { - case kPWM_PwmA: - base->OUTEN &= ~((uint16_t)1U << ((uint16_t)PWM_OUTEN_PWMA_EN_SHIFT + (uint16_t)subModule)); - break; - case kPWM_PwmB: - base->OUTEN &= ~((uint16_t)1U << ((uint16_t)PWM_OUTEN_PWMB_EN_SHIFT + (uint16_t)subModule)); - break; - case kPWM_PwmX: - base->OUTEN &= ~((uint16_t)1U << ((uint16_t)PWM_OUTEN_PWMX_EN_SHIFT + (uint16_t)subModule)); - break; - default: - assert(false); - break; - } -} - -/*! - * @brief Get the dutycycle value. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel PWM channel to configure - * - * @return Current channel dutycycle value. - */ -uint8_t PWM_GetPwmChannelState(PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmChannel); - -/*! - * @brief Set PWM output in idle status (high or low). - * - * @note This API should call after PWM_SetupPwm() APIs, and PWMX submodule is not supported. - * - * @param base PWM peripheral base address - * @param pwmChannel PWM channel to configure - * @param subModule PWM submodule to configure - * @param idleStatus True: PWM output is high in idle status; false: PWM output is low in idle status. - * - * @return kStatus_Fail if there was error setting up the signal; kStatus_Success if set output idle success - */ -status_t PWM_SetOutputToIdle(PWM_Type *base, pwm_channels_t pwmChannel, pwm_submodule_t subModule, bool idleStatus); - -/*! - * @brief Set the pwm submodule prescaler. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param prescaler Set prescaler value - */ -void PWM_SetClockMode(PWM_Type *base, pwm_submodule_t subModule, pwm_clock_prescale_t prescaler); - -/*! - * @brief This function enables-disables the forcing of the output of a given eFlexPwm channel to logic 0. - * - * @param base PWM peripheral base address - * @param pwmChannel PWM channel to configure - * @param subModule PWM submodule to configure - * @param forcetozero True: Enable the pwm force output to zero; False: Disable the pwm output resumes normal - * function. - */ -void PWM_SetPwmForceOutputToZero(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - bool forcetozero); - -/*! - * @brief This function set the output state of the PWM pin as requested for the current cycle. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel PWM channel to configure - * @param outputstate Set pwm output state, see @ref pwm_output_state_t. - */ -void PWM_SetChannelOutput(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - pwm_output_state_t outputstate); - -#if defined(FSL_FEATURE_PWM_HAS_PHASE_DELAY) && FSL_FEATURE_PWM_HAS_PHASE_DELAY -/*! - * @brief This function set the phase delay from the master sync signal of submodule 0. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel PWM channel to configure - * @param delayCycles Number of cycles delayed from submodule 0. - * - * @return kStatus_Fail if the number of delay cycles is set larger than the period defined in submodule 0; - * kStatus_Success if set phase delay success - */ -status_t PWM_SetPhaseDelay(PWM_Type *base, pwm_channels_t pwmChannel, pwm_submodule_t subModule, uint16_t delayCycles); -#endif - -#if defined(FSL_FEATURE_PWM_HAS_INPUT_FILTER_CAPTURE) && FSL_FEATURE_PWM_HAS_INPUT_FILTER_CAPTURE -/*! - * @brief This function set the number of consecutive samples that must agree prior to the input filter. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel PWM channel to configure - * @param filterSampleCount Number of consecutive samples. - */ -static inline void PWM_SetFilterSampleCount(PWM_Type *base, - pwm_channels_t pwmChannel, - pwm_submodule_t subModule, - uint8_t filterSampleCount) -{ - switch(pwmChannel) - { -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA - case kPWM_PwmA: - base->SM[subModule].CAPTFILTA &= ~((uint16_t)PWM_CAPTFILTA_CAPTA_FILT_CNT_MASK); - base->SM[subModule].CAPTFILTA |= PWM_CAPTFILTA_CAPTA_FILT_CNT(filterSampleCount); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB - case kPWM_PwmB: - base->SM[subModule].CAPTFILTB &= ~((uint16_t)PWM_CAPTFILTB_CAPTB_FILT_CNT_MASK); - base->SM[subModule].CAPTFILTB |= PWM_CAPTFILTB_CAPTB_FILT_CNT(filterSampleCount); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX - case kPWM_PwmX: - base->SM[subModule].CAPTFILTX &= ~((uint16_t)PWM_CAPTFILTX_CAPTX_FILT_CNT_MASK); - base->SM[subModule].CAPTFILTX |= PWM_CAPTFILTX_CAPTX_FILT_CNT(filterSampleCount); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX */ - default: - assert(false); - break; - } -} - -/*! - * @brief This function set the sampling period of the fault pin input filter. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel PWM channel to configure - * @param filterSamplePeriod Sampling period of input filter. - */ -static inline void PWM_SetFilterSamplePeriod(PWM_Type *base, - pwm_channels_t pwmChannel, - pwm_submodule_t subModule, - uint8_t filterSamplePeriod) -{ - switch(pwmChannel) - { -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA - case kPWM_PwmA: - base->SM[subModule].CAPTFILTA &= ~((uint16_t)PWM_CAPTFILTA_CAPTA_FILT_PER_MASK); - base->SM[subModule].CAPTFILTA |= PWM_CAPTFILTA_CAPTA_FILT_PER(filterSamplePeriod); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB - case kPWM_PwmB: - base->SM[subModule].CAPTFILTB &= ~((uint16_t)PWM_CAPTFILTB_CAPTB_FILT_PER_MASK); - base->SM[subModule].CAPTFILTB |= PWM_CAPTFILTB_CAPTB_FILT_PER(filterSamplePeriod); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX - case kPWM_PwmX: - base->SM[subModule].CAPTFILTX &= ~((uint16_t)PWM_CAPTFILTX_CAPTX_FILT_PER_MASK); - base->SM[subModule].CAPTFILTX |= PWM_CAPTFILTX_CAPTX_FILT_PER(filterSamplePeriod); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX */ - default: - assert(false); - break; - } -} -#endif - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_PWM_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_qdc.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_qdc.c deleted file mode 100644 index 75158b976c5..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_qdc.c +++ /dev/null @@ -1,645 +0,0 @@ -/* - * Copyright 2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_qdc.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.qdc" -#endif - -#define QDC_CTRL_W1C_FLAGS (QDC_CTRL_HIRQ_MASK | QDC_CTRL_XIRQ_MASK | QDC_CTRL_DIRQ_MASK | QDC_CTRL_CMPIRQ_MASK) -#if (defined(FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) && FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) -#define QDC_CTRL2_W1C_FLAGS (QDC_CTRL2_ROIRQ_MASK | QDC_CTRL2_RUIRQ_MASK) -#else -#define QDC_CTRL2_W1C_FLAGS (QDC_CTRL2_SABIRQ_MASK | QDC_CTRL2_ROIRQ_MASK | QDC_CTRL2_RUIRQ_MASK) -#endif - -#if defined(QDC_RSTS) -#define QDC_RESETS_ARRAY QDC_RSTS -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Get instance number for QDC module. - * - * @param base QDC peripheral base address - */ -static uint32_t QDC_GetInstance(QDC_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to QDC bases for each instance. */ -static QDC_Type *const s_qdcBases[] = QDC_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to QDC clocks for each instance. */ -static const clock_ip_name_t s_qdcClocks[] = QDC_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(QDC_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_qdcResets[] = QDC_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t QDC_GetInstance(QDC_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_qdcBases); instance++) - { - if (s_qdcBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_qdcBases)); - - return instance; -} - -/*! - * brief Initialization for the QDC module. - * - * This function is to make the initialization for the QDC module. It should be called firstly before any operation to - * the QDC with the operations like: - * - Enable the clock for QDC module. - * - Configure the QDC's working attributes. - * - * param base QDC peripheral base address. - * param config Pointer to configuration structure. See to "qdc_config_t". - */ -void QDC_Init(QDC_Type *base, const qdc_config_t *config) -{ - assert(NULL != config); - - uint16_t tmp16; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock. */ - CLOCK_EnableClock(s_qdcClocks[QDC_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(QDC_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_qdcResets[QDC_GetInstance(base)]); -#endif - - /* QDC_CTRL. */ - tmp16 = base->CTRL & (uint16_t)(~(QDC_CTRL_W1C_FLAGS | QDC_CTRL_HIP_MASK | QDC_CTRL_HNE_MASK | QDC_CTRL_REV_MASK | - QDC_CTRL_PH1_MASK | QDC_CTRL_XIP_MASK | QDC_CTRL_XNE_MASK | QDC_CTRL_WDE_MASK)); - /* For HOME trigger. */ - if (kQDC_HOMETriggerDisabled != config->HOMETriggerMode) - { - tmp16 |= QDC_CTRL_HIP_MASK; - if (kQDC_HOMETriggerOnFallingEdge == config->HOMETriggerMode) - { - tmp16 |= QDC_CTRL_HNE_MASK; - } - } - /* For encoder work mode. */ - if (config->enableReverseDirection) - { - tmp16 |= QDC_CTRL_REV_MASK; - } - if (kQDC_DecoderWorkAsSignalPhaseCountMode == config->decoderWorkMode) - { - tmp16 |= QDC_CTRL_PH1_MASK; - } - /* For INDEX trigger. */ - if (kQDC_INDEXTriggerDisabled != config->INDEXTriggerMode) - { - tmp16 |= QDC_CTRL_XIP_MASK; - if (kQDC_INDEXTriggerOnFallingEdge == config->INDEXTriggerMode) - { - tmp16 |= QDC_CTRL_XNE_MASK; - } - } - /* Watchdog. */ - if (config->enableWatchdog) - { - tmp16 |= QDC_CTRL_WDE_MASK; - base->WTR = config->watchdogTimeoutValue; /* WDOG can be only available when the feature is enabled. */ - } - base->CTRL = tmp16; - - /* QDC_FILT. */ - base->FILT = QDC_FILT_FILT_CNT(config->filterCount) | QDC_FILT_FILT_PER(config->filterSamplePeriod) -#if (defined(FSL_FEATURE_QDC_HAS_FILT_PRSC) && FSL_FEATURE_QDC_HAS_FILT_PRSC) - | QDC_FILT_FILT_PRSC(config->filterPrescaler) -#endif - ; - - /* QDC_CTRL2. */ - tmp16 = base->CTRL2 & (uint16_t)(~(QDC_CTRL2_W1C_FLAGS | QDC_CTRL2_OUTCTL_MASK | QDC_CTRL2_REVMOD_MASK | - QDC_CTRL2_MOD_MASK | QDC_CTRL2_UPDPOS_MASK | QDC_CTRL2_UPDHLD_MASK)); - if (kQDC_POSMATCHOnReadingAnyPositionCounter == config->positionMatchMode) - { - tmp16 |= QDC_CTRL2_OUTCTL_MASK; - } - if (kQDC_RevolutionCountOnRollOverModulus == config->revolutionCountCondition) - { - tmp16 |= QDC_CTRL2_REVMOD_MASK; - } - if (config->enableModuloCountMode) - { - tmp16 |= QDC_CTRL2_MOD_MASK; - /* Set modulus value. */ - base->UMOD = (uint16_t)(config->positionModulusValue >> 16U); /* Upper 16 bits. */ - base->LMOD = (uint16_t)(config->positionModulusValue); /* Lower 16 bits. */ - } - if (config->enableTRIGGERClearPositionCounter) - { - tmp16 |= QDC_CTRL2_UPDPOS_MASK; - } - if (config->enableTRIGGERClearHoldPositionCounter) - { - tmp16 |= QDC_CTRL2_UPDHLD_MASK; - } - base->CTRL2 = tmp16; - -#if (defined(FSL_FEATURE_QDC_HAS_CTRL3) && FSL_FEATURE_QDC_HAS_CTRL3) - /* QDC_CTRL3. */ - tmp16 = base->CTRL3 & (uint16_t)(~(QDC_CTRL3_PMEN_MASK | QDC_CTRL3_PRSC_MASK)); - if (config->enablePeriodMeasurementFunction) - { - tmp16 |= QDC_CTRL3_PMEN_MASK; - /* Set prescaler value. */ - tmp16 |= ((uint16_t)config->prescalerValue << QDC_CTRL3_PRSC_SHIFT); - } - base->CTRL3 = tmp16; -#endif - - /* QDC_UCOMP & QDC_LCOMP. */ - base->UCOMP = (uint16_t)(config->positionCompareValue >> 16U); /* Upper 16 bits. */ - base->LCOMP = (uint16_t)(config->positionCompareValue); /* Lower 16 bits. */ - - /* QDC_UINIT & QDC_LINIT. */ - base->UINIT = (uint16_t)(config->positionInitialValue >> 16U); /* Upper 16 bits. */ - base->LINIT = (uint16_t)(config->positionInitialValue); /* Lower 16 bits. */ -} - -/*! - * brief De-initialization for the QDC module. - * - * This function is to make the de-initialization for the QDC module. It could be called when QDC is no longer used with - * the operations like: - * - Disable the clock for QDC module. - * - * param base QDC peripheral base address. - */ -void QDC_Deinit(QDC_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable the clock. */ - CLOCK_DisableClock(s_qdcClocks[QDC_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Get an available pre-defined settings for QDC's configuration. - * - * This function initializes the QDC configuration structure with an available settings, the default value are: - * code - * config->enableReverseDirection = false; - * config->decoderWorkMode = kQDC_DecoderWorkAsNormalMode; - * config->HOMETriggerMode = kQDC_HOMETriggerDisabled; - * config->INDEXTriggerMode = kQDC_INDEXTriggerDisabled; - * config->enableTRIGGERClearPositionCounter = false; - * config->enableTRIGGERClearHoldPositionCounter = false; - * config->enableWatchdog = false; - * config->watchdogTimeoutValue = 0U; - * config->filterCount = 0U; - * config->filterSamplePeriod = 0U; - * config->positionMatchMode = kQDC_POSMATCHOnPositionCounterEqualToComapreValue; - * config->positionCompareValue = 0xFFFFFFFFU; - * config->revolutionCountCondition = kQDC_RevolutionCountOnINDEXPulse; - * config->enableModuloCountMode = false; - * config->positionModulusValue = 0U; - * config->positionInitialValue = 0U; - * config->prescalerValue = kQDC_ClockDiv1; - * config->enablePeriodMeasurementFunction = true; - * endcode - * param config Pointer to a variable of configuration structure. See to "qdc_config_t". - */ -void QDC_GetDefaultConfig(qdc_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->enableReverseDirection = false; - config->decoderWorkMode = kQDC_DecoderWorkAsNormalMode; - config->HOMETriggerMode = kQDC_HOMETriggerDisabled; - config->INDEXTriggerMode = kQDC_INDEXTriggerDisabled; - config->enableTRIGGERClearPositionCounter = false; - config->enableTRIGGERClearHoldPositionCounter = false; - config->enableWatchdog = false; - config->watchdogTimeoutValue = 0U; - config->filterCount = 0U; - config->filterSamplePeriod = 0U; - config->positionMatchMode = kQDC_POSMATCHOnPositionCounterEqualToComapreValue; - config->positionCompareValue = 0xFFFFFFFFU; - config->revolutionCountCondition = kQDC_RevolutionCountOnINDEXPulse; - config->enableModuloCountMode = false; - config->positionModulusValue = 0U; - config->positionInitialValue = 0U; -#if (defined(FSL_FEATURE_QDC_HAS_CTRL3) && FSL_FEATURE_QDC_HAS_CTRL3) - config->prescalerValue = kQDC_ClockDiv1; - config->enablePeriodMeasurementFunction = true; -#endif - -#if (defined(FSL_FEATURE_QDC_HAS_FILT_PRSC) && FSL_FEATURE_QDC_HAS_FILT_PRSC) - config->filterPrescaler = kQDC_FilterPrescalerDiv1; -#endif -} - -/*! - * brief Load the initial position value to position counter. - * - * This function is to transfer the initial position value (UINIT and LINIT) contents to position counter (UPOS and - * LPOS), so that to provide the consistent operation the position counter registers. - * - * param base QDC peripheral base address. - */ -void QDC_DoSoftwareLoadInitialPositionValue(QDC_Type *base) -{ - uint16_t tmp16 = base->CTRL & (uint16_t)(~QDC_CTRL_W1C_FLAGS); - - tmp16 |= QDC_CTRL_SWIP_MASK; /* Write 1 to trigger the command for loading initial position value. */ - base->CTRL = tmp16; -} - -/*! - * brief Enable and configure the self test function. - * - * This function is to enable and configuration the self test function. It controls and sets the frequency of a - * quadrature signal generator. It provides a quadrature test signal to the inputs of the quadrature decoder module. - * It is a factory test feature; however, it may be useful to customers' software development and testing. - * - * param base QDC peripheral base address. - * param config Pointer to configuration structure. See to "qdc_self_test_config_t". Pass "NULL" to disable. - */ -void QDC_SetSelfTestConfig(QDC_Type *base, const qdc_self_test_config_t *config) -{ - uint16_t tmp16 = 0U; - - if (NULL == config) /* Pass "NULL" to disable the feature. */ - { - tmp16 = 0U; - } - else - { - tmp16 = QDC_TST_TEN_MASK | QDC_TST_TCE_MASK | QDC_TST_TEST_PERIOD(config->signalPeriod) | - QDC_TST_TEST_COUNT(config->signalCount); - if (kQDC_SelfTestDirectionNegative == config->signalDirection) - { - tmp16 |= QDC_TST_QDN_MASK; - } - } - - base->TST = tmp16; -} - -/*! - * brief Enable watchdog for QDC module. - * - * param base QDC peripheral base address - * param enable Enables or disables the watchdog - */ -void QDC_EnableWatchdog(QDC_Type *base, bool enable) -{ - uint16_t tmp16 = base->CTRL & (uint16_t)(~(QDC_CTRL_W1C_FLAGS | QDC_CTRL_WDE_MASK)); - - if (enable) - { - tmp16 |= QDC_CTRL_WDE_MASK; - } - base->CTRL = tmp16; -} - -/*! - * brief Get the status flags. - * - * param base QDC peripheral base address. - * - * return Mask value of status flags. For available mask, see to "_qdc_status_flags". - */ -uint32_t QDC_GetStatusFlags(QDC_Type *base) -{ - uint32_t ret32 = 0U; - - /* QDC_CTRL. */ - if (0U != (QDC_CTRL_HIRQ_MASK & base->CTRL)) - { - ret32 |= (uint32_t)kQDC_HOMETransitionFlag; - } - if (0U != (QDC_CTRL_XIRQ_MASK & base->CTRL)) - { - ret32 |= (uint32_t)kQDC_INDEXPulseFlag; - } - if (0U != (QDC_CTRL_DIRQ_MASK & base->CTRL)) - { - ret32 |= (uint32_t)kQDC_WatchdogTimeoutFlag; - } - if (0U != (QDC_CTRL_CMPIRQ_MASK & base->CTRL)) - { - ret32 |= (uint32_t)kQDC_PositionCompareFlag; - } - - /* QDC_CTRL2. */ -#if !(defined(FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) && FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) - if (0U != (QDC_CTRL2_SABIRQ_MASK & base->CTRL2)) - { - ret32 |= (uint32_t)kQDC_SimultBothPhaseChangeFlag; - } -#endif - if (0U != (QDC_CTRL2_ROIRQ_MASK & base->CTRL2)) - { - ret32 |= (uint32_t)kQDC_PositionRollOverFlag; - } - if (0U != (QDC_CTRL2_RUIRQ_MASK & base->CTRL2)) - { - ret32 |= (uint32_t)kQDC_PositionRollUnderFlag; - } - if (0U != (QDC_CTRL2_DIR_MASK & base->CTRL2)) - { - ret32 |= (uint32_t)kQDC_LastCountDirectionFlag; - } - - return ret32; -} - -/*! - * brief Clear the status flags. - * - * param base QDC peripheral base address. - * param mask Mask value of status flags to be cleared. For available mask, see to "_qdc_status_flags". - */ -void QDC_ClearStatusFlags(QDC_Type *base, uint32_t mask) -{ - uint32_t tmp16 = 0U; - - /* QDC_CTRL. */ - if (0U != ((uint32_t)kQDC_HOMETransitionFlag & mask)) - { - tmp16 |= QDC_CTRL_HIRQ_MASK; - } - if (0U != ((uint32_t)kQDC_INDEXPulseFlag & mask)) - { - tmp16 |= QDC_CTRL_XIRQ_MASK; - } - if (0U != ((uint32_t)kQDC_WatchdogTimeoutFlag & mask)) - { - tmp16 |= QDC_CTRL_DIRQ_MASK; - } - if (0U != ((uint32_t)kQDC_PositionCompareFlag & mask)) - { - tmp16 |= QDC_CTRL_CMPIRQ_MASK; - } - if (0U != tmp16) - { - base->CTRL = (uint16_t)(((uint32_t)base->CTRL & (~QDC_CTRL_W1C_FLAGS)) | tmp16); - } - - /* QDC_CTRL2. */ - tmp16 = 0U; -#if !(defined(FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) && FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) - if (0U != ((uint32_t)kQDC_SimultBothPhaseChangeFlag & mask)) - { - tmp16 |= QDC_CTRL2_SABIRQ_MASK; - } -#endif - if (0U != ((uint32_t)kQDC_PositionRollOverFlag & mask)) - { - tmp16 |= QDC_CTRL2_ROIRQ_MASK; - } - if (0U != ((uint32_t)kQDC_PositionRollUnderFlag & mask)) - { - tmp16 |= QDC_CTRL2_RUIRQ_MASK; - } - if (0U != tmp16) - { - base->CTRL2 = (uint16_t)(((uint32_t)base->CTRL2 & (~QDC_CTRL2_W1C_FLAGS)) | tmp16); - } -} - -/*! - * brief Enable the interrupts. - * - * param base QDC peripheral base address. - * param mask Mask value of interrupts to be enabled. For available mask, see to "_qdc_interrupt_enable". - */ -void QDC_EnableInterrupts(QDC_Type *base, uint32_t mask) -{ - uint32_t tmp16 = 0U; - - /* QDC_CTRL. */ - if (0U != ((uint32_t)kQDC_HOMETransitionInterruptEnable & mask)) - { - tmp16 |= QDC_CTRL_HIE_MASK; - } - if (0U != ((uint32_t)kQDC_INDEXPulseInterruptEnable & mask)) - { - tmp16 |= QDC_CTRL_XIE_MASK; - } - if (0U != ((uint32_t)kQDC_WatchdogTimeoutInterruptEnable & mask)) - { - tmp16 |= QDC_CTRL_DIE_MASK; - } - if (0U != ((uint32_t)kQDC_PositionCompareInerruptEnable & mask)) - { - tmp16 |= QDC_CTRL_CMPIE_MASK; - } - if (tmp16 != 0U) - { - base->CTRL = (uint16_t)(((uint32_t)base->CTRL & (~QDC_CTRL_W1C_FLAGS)) | tmp16); - } - /* QDC_CTRL2. */ - tmp16 = 0U; -#if !(defined(FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) && FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) - if (0U != ((uint32_t)kQDC_SimultBothPhaseChangeInterruptEnable & mask)) - { - tmp16 |= QDC_CTRL2_SABIE_MASK; - } -#endif - if (0U != ((uint32_t)kQDC_PositionRollOverInterruptEnable & mask)) - { - tmp16 |= QDC_CTRL2_ROIE_MASK; - } - if (0U != ((uint32_t)kQDC_PositionRollUnderInterruptEnable & mask)) - { - tmp16 |= QDC_CTRL2_RUIE_MASK; - } - if (tmp16 != 0U) - { - base->CTRL2 = (uint16_t)(((uint32_t)base->CTRL2 & (~QDC_CTRL2_W1C_FLAGS)) | tmp16); - } -} - -/*! - * brief Disable the interrupts. - * - * param base QDC peripheral base address. - * param mask Mask value of interrupts to be disabled. For available mask, see to "_qdc_interrupt_enable". - */ -void QDC_DisableInterrupts(QDC_Type *base, uint32_t mask) -{ - uint16_t tmp16 = 0U; - - /* QDC_CTRL. */ - if (0U != ((uint32_t)kQDC_HOMETransitionInterruptEnable & mask)) - { - tmp16 |= QDC_CTRL_HIE_MASK; - } - if (0U != ((uint32_t)kQDC_INDEXPulseInterruptEnable & mask)) - { - tmp16 |= QDC_CTRL_XIE_MASK; - } - if (0U != ((uint32_t)kQDC_WatchdogTimeoutInterruptEnable & mask)) - { - tmp16 |= QDC_CTRL_DIE_MASK; - } - if (0U != ((uint32_t)kQDC_PositionCompareInerruptEnable & mask)) - { - tmp16 |= QDC_CTRL_CMPIE_MASK; - } - if (0U != tmp16) - { - base->CTRL = (uint16_t)(base->CTRL & (uint16_t)(~QDC_CTRL_W1C_FLAGS)) & (uint16_t)(~tmp16); - } - /* QDC_CTRL2. */ - tmp16 = 0U; -#if !(defined(FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) && FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) - if (0U != ((uint32_t)kQDC_SimultBothPhaseChangeInterruptEnable & mask)) - { - tmp16 |= QDC_CTRL2_SABIE_MASK; - } -#endif - if (0U != ((uint32_t)kQDC_PositionRollOverInterruptEnable & mask)) - { - tmp16 |= QDC_CTRL2_ROIE_MASK; - } - if (0U != ((uint32_t)kQDC_PositionRollUnderInterruptEnable & mask)) - { - tmp16 |= QDC_CTRL2_RUIE_MASK; - } - if (tmp16 != 0U) - { - base->CTRL2 = (uint16_t)(base->CTRL2 & (uint16_t)(~QDC_CTRL2_W1C_FLAGS)) & (uint16_t)(~tmp16); - } -} - -/*! - * brief Get the enabled interrupts' flags. - * - * param base QDC peripheral base address. - * - * return Mask value of enabled interrupts. - */ -uint32_t QDC_GetEnabledInterrupts(QDC_Type *base) -{ - uint32_t ret32 = 0U; - - /* QDC_CTRL. */ - if (0U != (QDC_CTRL_HIE_MASK & base->CTRL)) - { - ret32 |= (uint32_t)kQDC_HOMETransitionInterruptEnable; - } - if (0U != (QDC_CTRL_XIE_MASK & base->CTRL)) - { - ret32 |= (uint32_t)kQDC_INDEXPulseInterruptEnable; - } - if (0U != (QDC_CTRL_DIE_MASK & base->CTRL)) - { - ret32 |= (uint32_t)kQDC_WatchdogTimeoutInterruptEnable; - } - if (0U != (QDC_CTRL_CMPIE_MASK & base->CTRL)) - { - ret32 |= (uint32_t)kQDC_PositionCompareInerruptEnable; - } - /* QDC_CTRL2. */ -#if !(defined(FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) && FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) - if (0U != (QDC_CTRL2_SABIE_MASK & base->CTRL2)) - { - ret32 |= (uint32_t)kQDC_SimultBothPhaseChangeInterruptEnable; - } -#endif - if (0U != (QDC_CTRL2_ROIE_MASK & base->CTRL2)) - { - ret32 |= (uint32_t)kQDC_PositionRollOverInterruptEnable; - } - if (0U != (QDC_CTRL2_RUIE_MASK & base->CTRL2)) - { - ret32 |= (uint32_t)kQDC_PositionRollUnderInterruptEnable; - } - return ret32; -} - -/*! - * brief Set initial position value for QDC module. - * - * param base QDC peripheral base address - * param value Positive initial value - */ -void QDC_SetInitialPositionValue(QDC_Type *base, uint32_t value) -{ - base->UINIT = (uint16_t)(value >> 16U); /* Set upper 16 bits. */ - base->LINIT = (uint16_t)(value); /* Set lower 16 bits. */ -} - -/*! - * brief Get the current position counter's value. - * - * param base QDC peripheral base address. - * - * return Current position counter's value. - */ -uint32_t QDC_GetPositionValue(QDC_Type *base) -{ - uint32_t ret32; - - ret32 = base->UPOS; /* Get upper 16 bits and make a snapshot. */ - ret32 <<= 16U; - ret32 |= base->LPOSH; /* Get lower 16 bits from hold register. */ - - return ret32; -} - -/*! - * brief Get the hold position counter's value. - * - * When any of the counter registers is read, the contents of each counter register is written to the corresponding hold - * register. Taking a snapshot of the counters' values provides a consistent view of a system position and a velocity to - * be attained. - * - * param base QDC peripheral base address. - * - * return Hold position counter's value. - */ -uint32_t QDC_GetHoldPositionValue(QDC_Type *base) -{ - uint32_t ret32; - - ret32 = base->UPOSH; /* Get upper 16 bits and make a snapshot. */ - ret32 <<= 16U; - ret32 |= base->LPOSH; /* Get lower 16 bits from hold register. */ - - return ret32; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_qdc.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_qdc.h deleted file mode 100644 index 5a79f3de116..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_qdc.h +++ /dev/null @@ -1,585 +0,0 @@ -/* - * Copyright 2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_QDC_H_ -#define FSL_QDC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup qdc - * @{ - */ -/******************************************************************************* - * Definitions - ******************************************************************************/ -#define FSL_QDC_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) - -/*! - * @brief Interrupt enable/disable mask. - */ -enum _qdc_interrupt_enable -{ - kQDC_HOMETransitionInterruptEnable = (1U << 0U), /*!< HOME interrupt enable. */ - kQDC_INDEXPulseInterruptEnable = (1U << 1U), /*!< INDEX pulse interrupt enable. */ - kQDC_WatchdogTimeoutInterruptEnable = (1U << 2U), /*!< Watchdog timeout interrupt enable. */ - kQDC_PositionCompareInerruptEnable = (1U << 3U), /*!< Position compare interrupt enable. */ -#if !(defined(FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) && FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) - kQDC_SimultBothPhaseChangeInterruptEnable = - (1U << 4U), /*!< Simultaneous PHASEA and PHASEB change interrupt enable. */ -#endif - kQDC_PositionRollOverInterruptEnable = (1U << 5U), /*!< Roll-over interrupt enable. */ - kQDC_PositionRollUnderInterruptEnable = (1U << 6U), /*!< Roll-under interrupt enable. */ -}; - -/*! - * @brief Status flag mask. - * - * These flags indicate the counter's events. - */ -enum _qdc_status_flags -{ - kQDC_HOMETransitionFlag = (1U << 0U), /*!< HOME signal transition interrupt request. */ - kQDC_INDEXPulseFlag = (1U << 1U), /*!< INDEX Pulse Interrupt Request. */ - kQDC_WatchdogTimeoutFlag = (1U << 2U), /*!< Watchdog timeout interrupt request. */ - kQDC_PositionCompareFlag = (1U << 3U), /*!< Position compare interrupt request. */ -#if !(defined(FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) && FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) - kQDC_SimultBothPhaseChangeFlag = (1U << 4U), /*!< Simultaneous PHASEA and PHASEB change interrupt request. */ -#endif - kQDC_PositionRollOverFlag = (1U << 5U), /*!< Roll-over interrupt request. */ - kQDC_PositionRollUnderFlag = (1U << 6U), /*!< Roll-under interrupt request. */ - kQDC_LastCountDirectionFlag = (1U << 7U), /*!< Last count was in the up direction, or the down direction. */ -}; - -/*! - * @brief Signal status flag mask. - * - * These flags indicate the counter's signal. - */ -enum _qdc_signal_status_flags -{ - kQDC_RawHOMEStatusFlag = QDC_IMR_HOME_MASK, /*!< Raw HOME input. */ - kQDC_RawINDEXStatusFlag = QDC_IMR_INDEX_MASK, /*!< Raw INDEX input. */ - kQDC_RawPHBStatusFlag = QDC_IMR_PHB_MASK, /*!< Raw PHASEB input. */ - kQDC_RawPHAEXStatusFlag = QDC_IMR_PHA_MASK, /*!< Raw PHASEA input. */ - kQDC_FilteredHOMEStatusFlag = QDC_IMR_FHOM_MASK, /*!< The filtered version of HOME input. */ - kQDC_FilteredINDEXStatusFlag = QDC_IMR_FIND_MASK, /*!< The filtered version of INDEX input. */ - kQDC_FilteredPHBStatusFlag = QDC_IMR_FPHB_MASK, /*!< The filtered version of PHASEB input. */ - kQDC_FilteredPHAStatusFlag = QDC_IMR_FPHA_MASK, /*!< The filtered version of PHASEA input. */ -}; - -/*! - * @brief Define HOME signal's trigger mode. - * - * The QDC would count the trigger from HOME signal line. - */ -typedef enum _qdc_home_trigger_mode -{ - kQDC_HOMETriggerDisabled = 0U, /*!< HOME signal's trigger is disabled. */ - kQDC_HOMETriggerOnRisingEdge, /*!< Use positive going edge-to-trigger initialization of position counters. */ - kQDC_HOMETriggerOnFallingEdge, /*!< Use negative going edge-to-trigger initialization of position counters. */ -} qdc_home_trigger_mode_t; - -/*! - * @brief Define INDEX signal's trigger mode. - * - * The QDC would count the trigger from INDEX signal line. - */ -typedef enum _qdc_index_trigger_mode -{ - kQDC_INDEXTriggerDisabled = 0U, /*!< INDEX signal's trigger is disabled. */ - kQDC_INDEXTriggerOnRisingEdge, /*!< Use positive going edge-to-trigger initialization of position counters. */ - kQDC_INDEXTriggerOnFallingEdge, /*!< Use negative going edge-to-trigger initialization of position counters. */ -} qdc_index_trigger_mode_t; - -/*! - * @brief Define type for decoder work mode. - * - * The normal work mode uses the standard quadrature decoder with PHASEA and PHASEB. When in signal phase count mode, - * a positive transition of the PHASEA input generates a count signal while the PHASEB input and the reverse direction - * control the counter direction. If the reverse direction is not enabled, PHASEB = 0 means counting up and PHASEB = 1 - * means counting down. Otherwise, the direction is reversed. - */ -typedef enum _qdc_decoder_work_mode -{ - kQDC_DecoderWorkAsNormalMode = 0U, /*!< Use standard quadrature decoder with PHASEA and PHASEB. */ - kQDC_DecoderWorkAsSignalPhaseCountMode, /*!< PHASEA input generates a count signal while PHASEB input control the - direction. */ -} qdc_decoder_work_mode_t; - -/*! - * @brief Define type for the condition of POSMATCH pulses. - */ -typedef enum _qdc_position_match_mode -{ - kQDC_POSMATCHOnPositionCounterEqualToComapreValue = 0U, /*!< POSMATCH pulses when a match occurs between the - position counters (POS) and the compare value (COMP). */ - kQDC_POSMATCHOnReadingAnyPositionCounter, /*!< POSMATCH pulses when any position counter register is read. */ -} qdc_position_match_mode_t; - -/*! - * @brief Define type for determining how the revolution counter (REV) is incremented/decremented. - */ -typedef enum _qdc_revolution_count_condition -{ - kQDC_RevolutionCountOnINDEXPulse = 0U, /*!< Use INDEX pulse to increment/decrement revolution counter. */ - kQDC_RevolutionCountOnRollOverModulus, /*!< Use modulus counting roll-over/under to increment/decrement revolution - counter. */ -} qdc_revolution_count_condition_t; - -/*! - * @brief Define type for direction of self test generated signal. - */ -typedef enum _qdc_self_test_direction -{ - kQDC_SelfTestDirectionPositive = 0U, /*!< Self test generates the signal in positive direction. */ - kQDC_SelfTestDirectionNegative, /*!< Self test generates the signal in negative direction. */ -} qdc_self_test_direction_t; - -#if (defined(FSL_FEATURE_QDC_HAS_CTRL3) && FSL_FEATURE_QDC_HAS_CTRL3) -/*! - * @brief Define prescaler value for clock in CTRL3. - * - * The clock is prescaled by a value of 2^PRSC which means that the prescaler logic - * can divide the clock by a minimum of 1 and a maximum of 32,768. - */ -typedef enum _qdc_prescaler -{ - kQDC_ClockDiv1 = 0, - kQDC_ClockDiv2 = 1, - kQDC_ClockDiv4 = 2, - kQDC_ClockDiv8 = 3, - kQDC_ClockDiv16 = 4, - kQDC_ClockDiv32 = 5, - kQDC_ClockDiv64 = 6, - kQDC_ClockDiv128 = 7, - kQDC_ClockDiv256 = 8, - kQDC_ClockDiv512 = 9, - kQDC_ClockDiv1024 = 10, - kQDC_ClockDiv2048 = 11, - kQDC_ClockDiv4096 = 12, - kQDC_ClockDiv8192 = 13, - kQDC_ClockDiv16384 = 14, - kQDC_ClockDiv32768 = 15, -} qdc_prescaler_t; -#endif - -#if (defined(FSL_FEATURE_QDC_HAS_FILT_PRSC) && FSL_FEATURE_QDC_HAS_FILT_PRSC) -/*! - * @brief Define input filter prescaler value. - * - * The input filter prescaler value is to prescale the IPBus clock. - * (Frequency of FILT clock) = (Frequency of IPBus clock) / 2^FILT_PRSC. - */ -typedef enum _qdc_filter_prescaler -{ - kQDC_FilterPrescalerDiv1 = 0U, /*!< Input filter prescaler is 1. */ - kQDC_FilterPrescalerDiv2 = 1U, /*!< Input filter prescaler is 2. */ - kQDC_FilterPrescalerDiv4 = 2U, /*!< Input filter prescaler is 4. */ - kQDC_FilterPrescalerDiv8 = 3U, /*!< Input filter prescaler is 8. */ - kQDC_FilterPrescalerDiv16 = 4U, /*!< Input filter prescaler is 16. */ - kQDC_FilterPrescalerDiv32 = 5U, /*!< Input filter prescaler is 32. */ - kQDC_FilterPrescalerDiv64 = 6U, /*!< Input filter prescaler is 64. */ - kQDC_FilterPrescalerDiv128 = 7U, /*!< Input filter prescaler is 128. */ -} qdc_filter_prescaler_t; -#endif - -/*! - * @brief Define user configuration structure for QDC module. - */ -typedef struct _qdc_config -{ - /* Basic counter. */ - bool enableReverseDirection; /*!< Enable reverse direction counting. */ - qdc_decoder_work_mode_t decoderWorkMode; /*!< Enable signal phase count mode. */ - - /* Signal detection. */ - qdc_home_trigger_mode_t HOMETriggerMode; /*!< Enable HOME to initialize position counters. */ - qdc_index_trigger_mode_t INDEXTriggerMode; /*!< Enable INDEX to initialize position counters. */ - bool enableTRIGGERClearPositionCounter; /*!< Clear POSD, REV, UPOS and LPOS on rising edge of TRIGGER, or not. */ - bool enableTRIGGERClearHoldPositionCounter; /*!< Enable update of hold registers on rising edge of TRIGGER, or not. - */ - - /* Watchdog. */ - bool enableWatchdog; /*!< Enable the watchdog to detect if the target is moving or not. */ - uint16_t watchdogTimeoutValue; /*!< Watchdog timeout count value. It stores the timeout count for the quadrature - decoder module watchdog timer. This field is only available when - "enableWatchdog" = true. The available value is a 16-bit unsigned number.*/ - -#if (defined(FSL_FEATURE_QDC_HAS_FILT_PRSC) && FSL_FEATURE_QDC_HAS_FILT_PRSC) - qdc_filter_prescaler_t filterPrescaler; /*!< Input filter prescaler. */ -#endif - - /* Filter for PHASEA, PHASEB, INDEX and HOME. */ - uint16_t filterCount; /*!< Input Filter Sample Count. This value should be chosen to reduce the probability of - noisy samples causing an incorrect transition to be recognized. The value represent the - number of consecutive samples that must agree prior to the input filter accepting an - input transition. A value of 0x0 represents 3 samples. A value of 0x7 represents 10 - samples. The Available range is 0 - 7.*/ - uint16_t filterSamplePeriod; /*!< Input Filter Sample Period. This value should be set such that the sampling period - is larger than the period of the expected noise. This value represents the - sampling period (in IPBus clock cycles) of the decoder input signals. - The available range is 0 - 255. */ - - /* Position compare. */ - qdc_position_match_mode_t positionMatchMode; /*!< The condition of POSMATCH pulses. */ - uint32_t positionCompareValue; /*!< Position compare value. The available value is a 32-bit number.*/ - - /* Modulus counting. */ - qdc_revolution_count_condition_t revolutionCountCondition; /*!< Revolution Counter Modulus Enable. */ - bool enableModuloCountMode; /*!< Enable Modulo Counting. */ - uint32_t positionModulusValue; /*!< Position modulus value. This value would be available only when - "enableModuloCountMode" = true. The available value is a 32-bit number. */ - uint32_t positionInitialValue; /*!< Position initial value. The available value is a 32-bit number. */ - -#if (defined(FSL_FEATURE_QDC_HAS_CTRL3) && FSL_FEATURE_QDC_HAS_CTRL3) - /* Prescaler. */ - bool enablePeriodMeasurementFunction; /*!< Enable period measurement function. */ - qdc_prescaler_t prescalerValue; /*!< The value of prescaler. */ -#endif -} qdc_config_t; - -/*! - * @brief Define configuration structure for self test module. - * - * The self test module provides a quadrature test signal to the inputs of the quadrature decoder module. - * This is a factory test feature. It is also useful to customers' software development and testing. - */ -typedef struct _qdc_self_test_config -{ - qdc_self_test_direction_t signalDirection; /*!< Direction of self test generated signal. */ - uint16_t signalCount; /*!< Hold the number of quadrature advances to generate. The available range is 0 - 255.*/ - uint16_t signalPeriod; /*!< Hold the period of quadrature phase in IPBus clock cycles. - The available range is 0 - 31. */ -} qdc_self_test_config_t; - -#if defined(__cplusplus) -extern "C" { -#endif - -/******************************************************************************* - * API - ******************************************************************************/ - -/*! - * @name Initialization and De-initialization - * @{ - */ - -/*! - * @brief Initialization for the QDC module. - * - * This function is to make the initialization for the QDC module. It should be called firstly before any operation to - * the QDC with the operations like: - * - Enable the clock for QDC module. - * - Configure the QDC's working attributes. - * - * @param base QDC peripheral base address. - * @param config Pointer to configuration structure. See to "qdc_config_t". - */ -void QDC_Init(QDC_Type *base, const qdc_config_t *config); - -/*! - * @brief De-initialization for the QDC module. - * - * This function is to make the de-initialization for the QDC module. It could be called when QDC is no longer used with - * the operations like: - * - Disable the clock for QDC module. - * - * @param base QDC peripheral base address. - */ -void QDC_Deinit(QDC_Type *base); - -/*! - * @brief Get an available pre-defined settings for QDC's configuration. - * - * This function initializes the QDC configuration structure with an available settings, the default value are: - * @code - * config->enableReverseDirection = false; - * config->decoderWorkMode = kQDC_DecoderWorkAsNormalMode; - * config->HOMETriggerMode = kQDC_HOMETriggerDisabled; - * config->INDEXTriggerMode = kQDC_INDEXTriggerDisabled; - * config->enableTRIGGERClearPositionCounter = false; - * config->enableTRIGGERClearHoldPositionCounter = false; - * config->enableWatchdog = false; - * config->watchdogTimeoutValue = 0U; - * config->filterCount = 0U; - * config->filterSamplePeriod = 0U; - * config->positionMatchMode = kQDC_POSMATCHOnPositionCounterEqualToComapreValue; - * config->positionCompareValue = 0xFFFFFFFFU; - * config->revolutionCountCondition = kQDC_RevolutionCountOnINDEXPulse; - * config->enableModuloCountMode = false; - * config->positionModulusValue = 0U; - * config->positionInitialValue = 0U; - * config->prescalerValue = kQDC_ClockDiv1; - * config->enablePeriodMeasurementFunction = true; - * @endcode - * @param config Pointer to a variable of configuration structure. See to "qdc_config_t". - */ -void QDC_GetDefaultConfig(qdc_config_t *config); - -/*! - * @brief Load the initial position value to position counter. - * - * This function is to transfer the initial position value (UINIT and LINIT) contents to position counter (UPOS and - * LPOS), so that to provide the consistent operation the position counter registers. - * - * @param base QDC peripheral base address. - */ -void QDC_DoSoftwareLoadInitialPositionValue(QDC_Type *base); - -/*! - * @brief Enable and configure the self test function. - * - * This function is to enable and configuration the self test function. It controls and sets the frequency of a - * quadrature signal generator. It provides a quadrature test signal to the inputs of the quadrature decoder module. - * It is a factory test feature; however, it may be useful to customers' software development and testing. - * - * @param base QDC peripheral base address. - * @param config Pointer to configuration structure. See to "qdc_self_test_config_t". Pass "NULL" to disable. - */ -void QDC_SetSelfTestConfig(QDC_Type *base, const qdc_self_test_config_t *config); - -/*! - * @brief Enable watchdog for QDC module. - * - * @param base QDC peripheral base address - * @param enable Enables or disables the watchdog - */ -void QDC_EnableWatchdog(QDC_Type *base, bool enable); - -/*! - * @brief Set initial position value for QDC module. - * - * @param base QDC peripheral base address - * @param value Positive initial value - */ -void QDC_SetInitialPositionValue(QDC_Type *base, uint32_t value); - -/*! @} */ - -/*! - * @name Status - * @{ - */ -/*! - * @brief Get the status flags. - * - * @param base QDC peripheral base address. - * - * @return Mask value of status flags. For available mask, see to "_qdc_status_flags". - */ -uint32_t QDC_GetStatusFlags(QDC_Type *base); - -/*! - * @brief Clear the status flags. - * - * @param base QDC peripheral base address. - * @param mask Mask value of status flags to be cleared. For available mask, see to "_qdc_status_flags". - */ -void QDC_ClearStatusFlags(QDC_Type *base, uint32_t mask); - -/*! - * @brief Get the signals' real-time status. - * - * @param base QDC peripheral base address. - * - * @return Mask value of signals' real-time status. For available mask, see to "_qdc_signal_status_flags" - */ -static inline uint16_t QDC_GetSignalStatusFlags(QDC_Type *base) -{ - return base->IMR; -} -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enable the interrupts. - * - * @param base QDC peripheral base address. - * @param mask Mask value of interrupts to be enabled. For available mask, see to "_qdc_interrupt_enable". - */ -void QDC_EnableInterrupts(QDC_Type *base, uint32_t mask); - -/*! - * @brief Disable the interrupts. - * - * @param base QDC peripheral base address. - * @param mask Mask value of interrupts to be disabled. For available mask, see to "_qdc_interrupt_enable". - */ -void QDC_DisableInterrupts(QDC_Type *base, uint32_t mask); - -/*! - * @brief Get the enabled interrupts' flags. - * - * @param base QDC peripheral base address. - * - * @return Mask value of enabled interrupts. - */ -uint32_t QDC_GetEnabledInterrupts(QDC_Type *base); - -/*! @} */ - -/*! - * @name Value Operation - * @{ - */ - -/*! - * @brief Get the current position counter's value. - * - * @param base QDC peripheral base address. - * - * @return Current position counter's value. - */ -uint32_t QDC_GetPositionValue(QDC_Type *base); - -/*! - * @brief Get the hold position counter's value. - * - * When any of the counter registers is read, the contents of each counter register is written to the corresponding hold - * register. Taking a snapshot of the counters' values provides a consistent view of a system position and a velocity to - * be attained. - * - * @param base QDC peripheral base address. - * - * @return Hold position counter's value. - */ -uint32_t QDC_GetHoldPositionValue(QDC_Type *base); - -/*! - * @brief Get the position difference counter's value. - * - * @param base QDC peripheral base address. - * - * @return The position difference counter's value. - */ -static inline uint16_t QDC_GetPositionDifferenceValue(QDC_Type *base) -{ - return base->POSD; -} - -/*! - * @brief Get the hold position difference counter's value. - * - * When any of the counter registers is read, the contents of each counter register is written to the corresponding hold - * register. Taking a snapshot of the counters' values provides a consistent view of a system position and a velocity to - * be attained. - * - * @param base QDC peripheral base address. - * - * @return Hold position difference counter's value. - */ -static inline uint16_t QDC_GetHoldPositionDifferenceValue(QDC_Type *base) -{ - return base->POSDH; -} - -/*! - * @brief Get the position revolution counter's value. - * - * @param base QDC peripheral base address. - * - * @return The position revolution counter's value. - */ -static inline uint16_t QDC_GetRevolutionValue(QDC_Type *base) -{ - return base->REV; -} - -/*! - * @brief Get the hold position revolution counter's value. - * - * When any of the counter registers is read, the contents of each counter register is written to the corresponding hold - * register. Taking a snapshot of the counters' values provides a consistent view of a system position and a velocity to - * be attained. - * - * @param base QDC peripheral base address. - * - * @return Hold position revolution counter's value. - */ -static inline uint16_t QDC_GetHoldRevolutionValue(QDC_Type *base) -{ - return base->REVH; -} - -#if (defined(FSL_FEATURE_QDC_HAS_LASTEDGE) && FSL_FEATURE_QDC_HAS_LASTEDGE) -/*! - * @brief Get the last edge time value. - * - * @param base QDC peripheral base address. - * - * @return The last edge time hold value. - */ -static inline uint16_t QDC_GetLastEdgeTimeValue(QDC_Type *base) -{ - return base->LASTEDGE; -} - -/*! - * @brief Get the last edge time hold value. - * - * @param base QDC peripheral base address. - * - * @return The last edge time hold value. - */ -static inline uint16_t QDC_GetHoldLastEdgeTimeValue(QDC_Type *base) -{ - return base->LASTEDGEH; -} -#endif - -#if (defined(FSL_FEATURE_QDC_HAS_POSDPER) && FSL_FEATURE_QDC_HAS_POSDPER) -/*! - * @brief Get the position difference period value. - * - * @param base QDC peripheral base address. - * - * @return The position difference period hold value. - */ -static inline uint16_t QDC_GetPositionDifferencePeriodValue(QDC_Type *base) -{ - return base->POSDPER; -} - -/*! - * @brief Get the position difference period buffer value. - * - * @param base QDC peripheral base address. - * - * @return The position difference period hold value. - */ -static inline uint16_t QDC_GetPositionDifferencePeriodBufferValue(QDC_Type *base) -{ - return base->POSDPERBFR; -} - -/*! - * @brief Get the position difference period hold value. - * - * @param base QDC peripheral base address. - * - * @return The position difference period hold value. - */ -static inline uint16_t QDC_GetHoldPositionDifferencePeriodValue(QDC_Type *base) -{ - return base->POSDPERH; -} -#endif -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @} */ - -#endif /* FSL_QDC_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_reset.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_reset.c deleted file mode 100644 index 58c05995054..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_reset.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright 2022, NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_common.h" -#include "fsl_reset.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.reset" -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -#if (defined(FSL_FEATURE_SOC_SYSCON_COUNT) && (FSL_FEATURE_SOC_SYSCON_COUNT > 0)) - -/*! - * brief Assert reset to peripheral. - * - * Asserts reset signal to specified peripheral module. - * - * param peripheral Assert reset to this peripheral. The enum argument contains encoding of reset register - * and reset bit position in the reset register. - */ -void RESET_SetPeripheralReset(reset_ip_name_t peripheral) -{ - const uint32_t regIndex = ((uint32_t)peripheral & 0xFFFF0000u) >> 16; - const uint32_t bitPos = ((uint32_t)peripheral & 0x0000FFFFu); - const uint32_t bitMask = 1UL << bitPos; - volatile uint32_t *pResetCtrl; - - assert(bitPos < 32u); - - /* reset register is in SYSCON */ - /* set bit */ - SYSCON->PRESETCTRLSET[regIndex] = bitMask; - /* wait until it reads 0b1 */ - pResetCtrl = &(SYSCON->PRESETCTRL0); - while (0u == ((uint32_t)((volatile uint32_t *)pResetCtrl)[regIndex] & bitMask)) - { - } -} - -/*! - * brief Clear reset to peripheral. - * - * Clears reset signal to specified peripheral module, allows it to operate. - * - * param peripheral Clear reset to this peripheral. The enum argument contains encoding of reset register - * and reset bit position in the reset register. - */ -void RESET_ClearPeripheralReset(reset_ip_name_t peripheral) -{ - const uint32_t regIndex = ((uint32_t)peripheral & 0xFFFF0000u) >> 16; - const uint32_t bitPos = ((uint32_t)peripheral & 0x0000FFFFu); - const uint32_t bitMask = 1UL << bitPos; - volatile uint32_t *pResetCtrl; - - assert(bitPos < 32u); - - /* reset register is in SYSCON */ - - /* clear bit */ - SYSCON->PRESETCTRLCLR[regIndex] = bitMask; - /* wait until it reads 0b0 */ - pResetCtrl = &(SYSCON->PRESETCTRL0); - while (bitMask == ((uint32_t)((volatile uint32_t *)pResetCtrl)[regIndex] & bitMask)) - { - } -} - -/*! - * brief Reset peripheral module. - * - * Reset peripheral module. - * - * param peripheral Peripheral to reset. The enum argument contains encoding of reset register - * and reset bit position in the reset register. - */ -void RESET_PeripheralReset(reset_ip_name_t peripheral) -{ - RESET_SetPeripheralReset(peripheral); - RESET_ClearPeripheralReset(peripheral); -} - -#endif /* FSL_FEATURE_SOC_SYSCON_COUNT || FSL_FEATURE_SOC_ASYNC_SYSCON_COUNT */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_reset.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_reset.h deleted file mode 100644 index 59922b4fd12..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_reset.h +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Copyright 2022, NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _FSL_RESET_H_ -#define _FSL_RESET_H_ - -#include -#include -#include -#include -#include "fsl_device_registers.h" - -/*! - * @addtogroup reset - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief reset driver version 2.4.0 */ -#define FSL_RESET_DRIVER_VERSION (MAKE_VERSION(2, 4, 0)) -/*@}*/ - -/*! - * @brief Enumeration for peripheral reset control bits - * - * Defines the enumeration for peripheral reset control bits in PRESETCTRL/ASYNCPRESETCTRL registers - */ -typedef enum _SYSCON_RSTn -{ - kFMU_RST_SHIFT_RSTn = 0 | 9U, /**< Flash management unit reset control */ - kMUX_RST_SHIFT_RSTn = 0 | 12U, /**< Input mux reset control */ - kPORT0_RST_SHIFT_RSTn = 0 | 13U, /**< PORT0 reset control */ - kPORT1_RST_SHIFT_RSTn = 0 | 14U, /**< PORT1 reset control */ - kPORT2_RST_SHIFT_RSTn = 0 | 15U, /**< PORT2 reset control */ - kPORT3_RST_SHIFT_RSTn = 0 | 16U, /**< PORT3 reset control */ - kPORT4_RST_SHIFT_RSTn = 0 | 17U, /**< PORT4 reset control */ - kGPIO0_RST_SHIFT_RSTn = 0 | 19U, /**< GPIO0 reset control */ - kGPIO1_RST_SHIFT_RSTn = 0 | 20U, /**< GPIO1 reset control */ - kGPIO2_RST_SHIFT_RSTn = 0 | 21U, /**< GPIO2 reset control */ - kGPIO3_RST_SHIFT_RSTn = 0 | 22U, /**< GPIO3 reset control */ - kGPIO4_RST_SHIFT_RSTn = 0 | 23U, /**< GPIO4 reset control */ - kPINT_RST_SHIFT_RSTn = 0 | 25U, /**< Pin interrupt (PINT) reset control */ - kDMA0_RST_SHIFT_RSTn = 0 | 26U, /**< DMA0 reset control */ - kCRC_RST_SHIFT_RSTn = 0 | 27U, /**< CRC reset control */ - - kMRT_RST_SHIFT_RSTn = 65536 | 0U, /**< Multi-rate timer (MRT) reset control */ - kOSTIMER_RST_SHIFT_RSTn = 65536 | 1U, /**< OSTimer reset control */ - kADC0_RST_SHIFT_RSTn = 65536 | 3U, /**< ADC0 reset control */ - kADC1_RST_SHIFT_RSTn = 65536 | 4U, /**< ADC1 reset control */ - kUTICK_RST_SHIFT_RSTn = 65536 | 10U, /**< Micro-tick timer reset control */ - kFC0_RST_SHIFT_RSTn = 65536 | 11U, /**< Flexcomm Interface 0 reset control */ - kFC1_RST_SHIFT_RSTn = 65536 | 12U, /**< Flexcomm Interface 1 reset control */ - kFC2_RST_SHIFT_RSTn = 65536 | 13U, /**< Flexcomm Interface 2 reset control */ - kFC3_RST_SHIFT_RSTn = 65536 | 14U, /**< Flexcomm Interface 3 reset control */ - kFC4_RST_SHIFT_RSTn = 65536 | 15U, /**< Flexcomm Interface 4 reset control */ - kFC5_RST_SHIFT_RSTn = 65536 | 16U, /**< Flexcomm Interface 5 reset control */ - kFC6_RST_SHIFT_RSTn = 65536 | 17U, /**< Flexcomm Interface 6 reset control */ - kFC7_RST_SHIFT_RSTn = 65536 | 18U, /**< Flexcomm Interface 7 reset control */ - kMICFIL_RST_SHIFT_RSTn = 65536 | 21U, /**< Flexcomm Interface 7 reset control */ - kCTIMER2_RST_SHIFT_RSTn = 65536 | 22U, /**< CTimer 2 reset control */ - kUSB0_FS_DCD_RST_SHIFT_RSTn = 65536 | 24U, /**< USB0-FS DCD reset control */ - kCTIMER0_RST_SHIFT_RSTn = 65536 | 26U, /**< CTimer 0 reset control */ - kCTIMER1_RST_SHIFT_RSTn = 65536 | 27U, /**< CTimer 1 reset control */ - kSMART_DMA_RST_SHIFT_RSTn = 65536 | 31U, /**< SmartDMA reset control */ - - kDMA1_RST_SHIFT_RSTn = 131072 | 1U, /**< DMA1 reset control */ - kUSDHC_RST_SHIFT_RSTn = 131072 | 3U, /**< uSDHC reset control */ - kFLEXIO_RST_SHIFT_RSTn = 131072 | 4U, /**< FLEXIO reset control */ - kSAI0_RST_SHIFT_RSTn = 131072 | 5U, /**< SAI0 reset control */ - kSAI1_RST_SHIFT_RSTn = 131072 | 6U, /**< SAI1 reset control */ - kTRO_RST_SHIFT_RSTn = 131072 | 7U, /**< TRO reset control */ - kFREQME_RST_SHIFT_RSTn = 131072 | 8U, /**< FREQME reset control */ - kTRNG_RST_SHIFT_RSTn = 131072 | 13U, /**< TRNG reset control */ - kFLEXCAN0_RST_SHIFT_RSTn = 131072 | 14U, /**< Flexcan0 reset control */ - kFLEXCAN1_RST_SHIFT_RSTn = 131072 | 15U, /**< Flexcan1 reset control */ - kUSB_HS_RST_SHIFT_RSTn = 131072 | 16U, /**< USB HS reset control */ - kUSB_HS_PHY_RST_SHIFT_RSTn = 131072 | 17U, /**< USB HS PHY reset control */ - kCTIMER3_RST_SHIFT_RSTn = 131072 | 21U, /**< CTimer 3 reset control */ - kCTIMER4_RST_SHIFT_RSTn = 131072 | 22U, /**< CTimer 4 reset control */ - kPUF_RST_SHIFT_RSTn = 131072 | 23U, /**< PUF reset control */ - kPKC_RST_SHIFT_RSTn = 131072 | 24U, /**< PKC reset control */ - kSM3_RST_SHIFT_RSTn = 131072 | 30U, /**< SM3 reset control */ - - kI3C0_RST_SHIFT_RSTn = 196608 | 0U, /**< I3C0 reset control */ - kI3C1_RST_SHIFT_RSTn = 196608 | 1U, /**< I3C1 reset control */ - kQDC0_RST_SHIFT_RSTn = 196608 | 4U, /**< QDC0 reset control */ - kQDC1_RST_SHIFT_RSTn = 196608 | 5U, /**< QDC1 reset control */ - kPWM0_RST_SHIFT_RSTn = 196608 | 6U, /**< PWM0 reset control */ - kPWM1_RST_SHIFT_RSTn = 196608 | 7U, /**< PWM1 reset control */ - kAOI0_RST_SHIFT_RSTn = 196608 | 8U, /**< AOI0 reset control */ - kVREF_RST_SHIFT_RSTn = 196608 | 19U, /**< VREF reset control */ - kEWM_RST_SHIFT_RSTn = 196608 | 23U, /**< EWM reset control */ - kEIM_RST_SHIFT_RSTn = 196608 | 24U, /**< EIM reset control */ -} SYSCON_RSTn_t; - -/** Array initializers with peripheral reset bits **/ -#define ADC_RSTS \ - { \ - kADC0_RST_SHIFT_RSTn, kADC1_RST_SHIFT_RSTn \ - } /* Reset bits for ADC peripheral */ -#define CRC_RSTS \ - { \ - kCRC_RST_SHIFT_RSTn \ - } /* Reset bits for CRC peripheral */ -#define CTIMER_RSTS \ - { \ - kCTIMER0_RST_SHIFT_RSTn, kCTIMER1_RST_SHIFT_RSTn, kCTIMER2_RST_SHIFT_RSTn, kCTIMER3_RST_SHIFT_RSTn, \ - kCTIMER4_RST_SHIFT_RSTn \ - } /* Reset bits for CTIMER peripheral */ -#define DMA_RSTS_N \ - { \ - kDMA0_RST_SHIFT_RSTn, kDMA1_RST_SHIFT_RSTn \ - } /* Reset bits for DMA peripheral */ - -#define LP_FLEXCOMM_RSTS \ - { \ - kFC0_RST_SHIFT_RSTn, kFC1_RST_SHIFT_RSTn, kFC2_RST_SHIFT_RSTn, kFC3_RST_SHIFT_RSTn, kFC4_RST_SHIFT_RSTn, \ - kFC5_RST_SHIFT_RSTn, kFC6_RST_SHIFT_RSTn, kFC7_RST_SHIFT_RSTn \ - } /* Reset bits for FLEXCOMM peripheral */ -#define GPIO_RSTS_N \ - { \ - kGPIO0_RST_SHIFT_RSTn, kGPIO1_RST_SHIFT_RSTn, kGPIO2_RST_SHIFT_RSTn, kGPIO3_RST_SHIFT_RSTn, \ - kGPIO4_RST_SHIFT_RSTn \ - } /* Reset bits for GPIO peripheral */ -#define INPUTMUX_RSTS \ - { \ - kMUX_RST_SHIFT_RSTn \ - } /* Reset bits for INPUTMUX peripheral */ -#define FLASH_RSTS \ - { \ - kFMC_RST_SHIFT_RSTn \ - } /* Reset bits for Flash peripheral */ -#define MRT_RSTS \ - { \ - kMRT_RST_SHIFT_RSTn \ - } /* Reset bits for MRT peripheral */ -#define PINT_RSTS \ - { \ - kPINT_RST_SHIFT_RSTn \ - } /* Reset bits for PINT peripheral */ -#define TRNG_RSTS \ - { \ - kTRNG_RST_SHIFT_RSTn \ - } /* Reset bits for TRNG peripheral */ -#define UTICK_RSTS \ - { \ - kUTICK_RST_SHIFT_RSTn \ - } /* Reset bits for UTICK peripheral */ -#define OSTIMER_RSTS \ - { \ - kOSTIMER_RST_SHIFT_RSTn \ - } /* Reset bits for OSTIMER peripheral */ -#define I3C_RSTS \ - { \ - kI3C0_RST_SHIFT_RSTn, kI3C1_RST_SHIFT_RSTn \ - } /* Reset bits for I3C peripheral */ -typedef SYSCON_RSTn_t reset_ip_name_t; - -/******************************************************************************* - * API - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @brief Assert reset to peripheral. - * - * Asserts reset signal to specified peripheral module. - * - * @param peripheral Assert reset to this peripheral. The enum argument contains encoding of reset register - * and reset bit position in the reset register. - */ -void RESET_SetPeripheralReset(reset_ip_name_t peripheral); - -/*! - * @brief Clear reset to peripheral. - * - * Clears reset signal to specified peripheral module, allows it to operate. - * - * @param peripheral Clear reset to this peripheral. The enum argument contains encoding of reset register - * and reset bit position in the reset register. - */ -void RESET_ClearPeripheralReset(reset_ip_name_t peripheral); - -/*! - * @brief Reset peripheral module. - * - * Reset peripheral module. - * - * @param peripheral Peripheral to reset. The enum argument contains encoding of reset register - * and reset bit position in the reset register. - */ -void RESET_PeripheralReset(reset_ip_name_t peripheral); - -/*! - * @brief Release peripheral module. - * - * Release peripheral module. - * - * @param peripheral Peripheral to release. The enum argument contains encoding of reset register - * and reset bit position in the reset register. - */ -static inline void RESET_ReleasePeripheralReset(reset_ip_name_t peripheral) -{ - RESET_ClearPeripheralReset(peripheral); -} - -#if defined(__cplusplus) -} -#endif - -/*! @} */ - -#endif /* _FSL_RESET_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_sai.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_sai.c deleted file mode 100644 index 6d69f5efb2a..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_sai.c +++ /dev/null @@ -1,3140 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_sai.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.sai" -#endif - -/******************************************************************************* - * Definitations - ******************************************************************************/ -/*! @brief _sai_transfer_state sai transfer state.*/ -enum -{ - kSAI_Busy = 0x0U, /*!< SAI is busy */ - kSAI_Idle, /*!< Transfer is done. */ - kSAI_Error /*!< Transfer error occurred. */ -}; - -/*! @brief Typedef for sai tx interrupt handler. */ -typedef void (*sai_tx_isr_t)(I2S_Type *base, sai_handle_t *saiHandle); - -/*! @brief Typedef for sai rx interrupt handler. */ -typedef void (*sai_rx_isr_t)(I2S_Type *base, sai_handle_t *saiHandle); - -/*! @brief check flag avalibility */ -#define IS_SAI_FLAG_SET(reg, flag) (((reg) & ((uint32_t)flag)) != 0UL) - -#if defined(SAI_RSTS) -#define SAI_RESETS_ARRAY SAI_RSTS -#endif -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief sai get rx enabled interrupt status. - * - * - * @param base SAI base pointer. - * @param enableFlag enable flag to check. - * @param statusFlag status flag to check. - */ -static bool SAI_RxGetEnabledInterruptStatus(I2S_Type *base, uint32_t enableFlag, uint32_t statusFlag); - -/*! - * @brief sai get tx enabled interrupt status. - * - * - * @param base SAI base pointer. - * @param enableFlag enable flag to check. - * @param statusFlag status flag to check. - */ -static bool SAI_TxGetEnabledInterruptStatus(I2S_Type *base, uint32_t enableFlag, uint32_t statusFlag); - -/*! - * @brief Set the master clock divider. - * - * This API will compute the master clock divider according to master clock frequency and master - * clock source clock source frequency. - * - * @param base SAI base pointer. - * @param mclk_Hz Mater clock frequency in Hz. - * @param mclkSrcClock_Hz Master clock source frequency in Hz. - */ -static bool SAI_TxGetEnabledInterruptStatus(I2S_Type *base, uint32_t enableFlag, uint32_t statusFlag); - -#if ((defined(FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) && (FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER)) || \ - (defined(FSL_FEATURE_SAI_HAS_MCR_MCLK_POST_DIV) && (FSL_FEATURE_SAI_HAS_MCR_MCLK_POST_DIV))) - -/*! - * @brief Set the master clock divider. - * - * This API will compute the master clock divider according to master clock frequency and master - * clock source clock source frequency. - * - * @param base SAI base pointer. - * @param mclk_Hz Mater clock frequency in Hz. - * @param mclkSrcClock_Hz Master clock source frequency in Hz. - */ -static void SAI_SetMasterClockDivider(I2S_Type *base, uint32_t mclk_Hz, uint32_t mclkSrcClock_Hz); -#endif /* FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER */ - -/*! - * @brief Get the instance number for SAI. - * - * @param base SAI base pointer. - */ -static uint32_t SAI_GetInstance(I2S_Type *base); - -/*! - * @brief sends a piece of data in non-blocking way. - * - * @param base SAI base pointer - * @param channel start channel number. - * @param channelMask enabled channels mask. - * @param endChannel end channel numbers. - * @param bitWidth How many bits in a audio word, usually 8/16/24/32 bits. - * @param buffer Pointer to the data to be written. - * @param size Bytes to be written. - */ -static void SAI_WriteNonBlocking(I2S_Type *base, - uint32_t channel, - uint32_t channelMask, - uint32_t endChannel, - uint8_t bitWidth, - uint8_t *buffer, - uint32_t size); - -/*! - * @brief Receive a piece of data in non-blocking way. - * - * @param base SAI base pointer - * @param channel start channel number. - * @param channelMask enabled channels mask. - * @param endChannel end channel numbers. - * @param bitWidth How many bits in a audio word, usually 8/16/24/32 bits. - * @param buffer Pointer to the data to be read. - * @param size Bytes to be read. - */ -static void SAI_ReadNonBlocking(I2S_Type *base, - uint32_t channel, - uint32_t channelMask, - uint32_t endChannel, - uint8_t bitWidth, - uint8_t *buffer, - uint32_t size); - -/*! - * @brief Get classic I2S mode configurations. - * - * @param config transceiver configurations - * @param bitWidth audio data bitWidth. - * @param mode audio data channel - * @param saiChannelMask channel mask value to enable - */ -static void SAI_GetCommonConfig(sai_transceiver_t *config, - sai_word_width_t bitWidth, - sai_mono_stereo_t mode, - uint32_t saiChannelMask); -/******************************************************************************* - * Variables - ******************************************************************************/ -/* Base pointer array */ -static I2S_Type *const s_saiBases[] = I2S_BASE_PTRS; -#if defined(SAI_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_saiReset[] = SAI_RESETS_ARRAY; -#endif -/*!@brief SAI handle pointer */ -static sai_handle_t *s_saiHandle[ARRAY_SIZE(s_saiBases)][2]; -/* IRQ number array */ -static const IRQn_Type s_saiTxIRQ[] = I2S_TX_IRQS; -static const IRQn_Type s_saiRxIRQ[] = I2S_RX_IRQS; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/* Clock name array */ -static const clock_ip_name_t s_saiClock[] = SAI_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -/*! @brief Pointer to tx IRQ handler for each instance. */ -static sai_tx_isr_t s_saiTxIsr; -/*! @brief Pointer to tx IRQ handler for each instance. */ -static sai_rx_isr_t s_saiRxIsr; - -/******************************************************************************* - * Code - ******************************************************************************/ -static bool SAI_RxGetEnabledInterruptStatus(I2S_Type *base, uint32_t enableFlag, uint32_t statusFlag) -{ - uint32_t rcsr = base->RCSR; - - return IS_SAI_FLAG_SET(rcsr, enableFlag) && IS_SAI_FLAG_SET(rcsr, statusFlag); -} - -static bool SAI_TxGetEnabledInterruptStatus(I2S_Type *base, uint32_t enableFlag, uint32_t statusFlag) -{ - uint32_t tcsr = base->TCSR; - - return IS_SAI_FLAG_SET(tcsr, enableFlag) && IS_SAI_FLAG_SET(tcsr, statusFlag); -} - -#if ((defined(FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) && (FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER)) || \ - (defined(FSL_FEATURE_SAI_HAS_MCR_MCLK_POST_DIV) && (FSL_FEATURE_SAI_HAS_MCR_MCLK_POST_DIV))) -static void SAI_SetMasterClockDivider(I2S_Type *base, uint32_t mclk_Hz, uint32_t mclkSrcClock_Hz) -{ - assert(mclk_Hz <= mclkSrcClock_Hz); - - uint32_t sourceFreq = mclkSrcClock_Hz / 100U; /*In order to prevent overflow */ - uint32_t targetFreq = mclk_Hz / 100U; /*In order to prevent overflow */ - -#if FSL_FEATURE_SAI_HAS_MCR_MCLK_POST_DIV - uint32_t postDivider = sourceFreq / targetFreq; - - /* if source equal to target, then disable divider */ - if (postDivider == 1U) - { - base->MCR &= ~I2S_MCR_DIVEN_MASK; - } - else - { - base->MCR = (base->MCR & (~I2S_MCR_DIV_MASK)) | I2S_MCR_DIV(postDivider / 2U - 1U) | I2S_MCR_DIVEN_MASK; - } -#endif -#if FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER - uint16_t fract, divide; - uint32_t remaind = 0; - uint32_t current_remainder = 0xFFFFFFFFU; - uint16_t current_fract = 0; - uint16_t current_divide = 0; - uint32_t mul_freq = 0; - uint32_t max_fract = 256; - - /* Compute the max fract number */ - max_fract = targetFreq * 4096U / sourceFreq + 1U; - if (max_fract > 256U) - { - max_fract = 256U; - } - - /* Looking for the closet frequency */ - for (fract = 1; fract < max_fract; fract++) - { - mul_freq = sourceFreq * fract; - remaind = mul_freq % targetFreq; - divide = (uint16_t)(mul_freq / targetFreq); - - /* Find the exactly frequency */ - if (remaind == 0U) - { - current_fract = fract; - current_divide = (uint16_t)(mul_freq / targetFreq); - break; - } - - /* Closer to next one, set the closest to next data */ - if (remaind > mclk_Hz / 2U) - { - remaind = targetFreq - remaind; - divide += 1U; - } - - /* Update the closest div and fract */ - if (remaind < current_remainder) - { - current_fract = fract; - current_divide = divide; - current_remainder = remaind; - } - } - - /* Fill the computed fract and divider to registers */ - base->MDR = I2S_MDR_DIVIDE(current_divide - 1UL) | I2S_MDR_FRACT(current_fract - 1UL); - - /* Waiting for the divider updated */ - while ((base->MCR & I2S_MCR_DUF_MASK) != 0UL) - { - } -#endif -} -#endif /* FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER */ - -static uint32_t SAI_GetInstance(I2S_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_saiBases); instance++) - { - if (s_saiBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_saiBases)); - - return instance; -} - -static void SAI_WriteNonBlocking(I2S_Type *base, - uint32_t channel, - uint32_t channelMask, - uint32_t endChannel, - uint8_t bitWidth, - uint8_t *buffer, - uint32_t size) -{ - uint32_t i = 0, j = 0U; - uint8_t m = 0; - uint8_t bytesPerWord = bitWidth / 8U; - uint32_t data = 0; - uint32_t temp = 0; - - for (i = 0; i < size / bytesPerWord; i++) - { - for (j = channel; j <= endChannel; j++) - { - if (IS_SAI_FLAG_SET((1UL << j), channelMask)) - { - for (m = 0; m < bytesPerWord; m++) - { - temp = (uint32_t)(*buffer); - data |= (temp << (8U * m)); - buffer++; - } - base->TDR[j] = data; - data = 0; - } - } - } -} - -static void SAI_ReadNonBlocking(I2S_Type *base, - uint32_t channel, - uint32_t channelMask, - uint32_t endChannel, - uint8_t bitWidth, - uint8_t *buffer, - uint32_t size) -{ - uint32_t i = 0, j = 0; - uint8_t m = 0; - uint8_t bytesPerWord = bitWidth / 8U; - uint32_t data = 0; - - for (i = 0; i < size / bytesPerWord; i++) - { - for (j = channel; j <= endChannel; j++) - { - if (IS_SAI_FLAG_SET((1UL << j), channelMask)) - { - data = base->RDR[j]; - for (m = 0; m < bytesPerWord; m++) - { - *buffer = (uint8_t)(data >> (8U * m)) & 0xFFU; - buffer++; - } - } - } - } -} - -static void SAI_GetCommonConfig(sai_transceiver_t *config, - sai_word_width_t bitWidth, - sai_mono_stereo_t mode, - uint32_t saiChannelMask) -{ - assert(NULL != config); - assert(saiChannelMask != 0U); - - (void)memset(config, 0, sizeof(sai_transceiver_t)); - - config->channelMask = (uint8_t)saiChannelMask; - /* sync mode default configurations */ - config->syncMode = kSAI_ModeAsync; - - /* master mode default */ - config->masterSlave = kSAI_Master; - - /* bit default configurations */ - config->bitClock.bclkSrcSwap = false; - config->bitClock.bclkInputDelay = false; - config->bitClock.bclkPolarity = kSAI_SampleOnRisingEdge; - config->bitClock.bclkSource = kSAI_BclkSourceMclkDiv; - - /* frame sync default configurations */ - config->frameSync.frameSyncWidth = (uint8_t)bitWidth; - config->frameSync.frameSyncEarly = true; -#if defined(FSL_FEATURE_SAI_HAS_ON_DEMAND_MODE) && FSL_FEATURE_SAI_HAS_ON_DEMAND_MODE - config->frameSync.frameSyncGenerateOnDemand = false; -#endif - config->frameSync.frameSyncPolarity = kSAI_PolarityActiveLow; - - /* serial data default configurations */ -#if defined(FSL_FEATURE_SAI_HAS_CHANNEL_MODE) && FSL_FEATURE_SAI_HAS_CHANNEL_MODE - config->serialData.dataMode = kSAI_DataPinStateOutputZero; -#endif - config->serialData.dataOrder = kSAI_DataMSB; - config->serialData.dataWord0Length = (uint8_t)bitWidth; - config->serialData.dataWordLength = (uint8_t)bitWidth; - config->serialData.dataWordNLength = (uint8_t)bitWidth; - config->serialData.dataFirstBitShifted = (uint8_t)bitWidth; - config->serialData.dataWordNum = 2U; - config->serialData.dataMaskedWord = (uint32_t)mode; - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) && FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR - config->fifo.fifoContinueOneError = true; -#endif -} - -/*! - * brief Initializes the SAI peripheral. - * - * This API gates the SAI clock. The SAI module can't operate unless SAI_Init is called to enable the clock. - * - * param base SAI base pointer - */ -void SAI_Init(I2S_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the SAI clock */ - (void)CLOCK_EnableClock(s_saiClock[SAI_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(SAI_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_saiReset[SAI_GetInstance(base)]); -#endif - -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - /* disable interrupt and DMA request*/ - base->TCSR &= - ~(I2S_TCSR_FRIE_MASK | I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK | I2S_TCSR_FRDE_MASK | I2S_TCSR_FWDE_MASK); - base->RCSR &= - ~(I2S_RCSR_FRIE_MASK | I2S_RCSR_FWIE_MASK | I2S_RCSR_FEIE_MASK | I2S_RCSR_FRDE_MASK | I2S_RCSR_FWDE_MASK); -#else - /* disable interrupt and DMA request*/ - base->TCSR &= ~(I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK | I2S_TCSR_FWDE_MASK); - base->RCSR &= ~(I2S_RCSR_FWIE_MASK | I2S_RCSR_FEIE_MASK | I2S_RCSR_FWDE_MASK); -#endif -} - -/*! - * brief De-initializes the SAI peripheral. - * - * This API gates the SAI clock. The SAI module can't operate unless SAI_TxInit - * or SAI_RxInit is called to enable the clock. - * - * param base SAI base pointer - */ -void SAI_Deinit(I2S_Type *base) -{ - SAI_TxEnable(base, false); - SAI_RxEnable(base, false); -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - (void)CLOCK_DisableClock(s_saiClock[SAI_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Resets the SAI Tx. - * - * This function enables the software reset and FIFO reset of SAI Tx. After reset, clear the reset bit. - * - * param base SAI base pointer - */ -void SAI_TxReset(I2S_Type *base) -{ - /* Set the software reset and FIFO reset to clear internal state */ - base->TCSR = I2S_TCSR_SR_MASK | I2S_TCSR_FR_MASK; - - /* Clear software reset bit, this should be done by software */ - base->TCSR &= ~I2S_TCSR_SR_MASK; - - /* Reset all Tx register values */ - base->TCR2 = 0; - base->TCR3 = 0; - base->TCR4 = 0; - base->TCR5 = 0; - base->TMR = 0; -} - -/*! - * brief Resets the SAI Rx. - * - * This function enables the software reset and FIFO reset of SAI Rx. After reset, clear the reset bit. - * - * param base SAI base pointer - */ -void SAI_RxReset(I2S_Type *base) -{ - /* Set the software reset and FIFO reset to clear internal state */ - base->RCSR = I2S_RCSR_SR_MASK | I2S_RCSR_FR_MASK; - - /* Clear software reset bit, this should be done by software */ - base->RCSR &= ~I2S_RCSR_SR_MASK; - - /* Reset all Rx register values */ - base->RCR2 = 0; - base->RCR3 = 0; - base->RCR4 = 0; - base->RCR5 = 0; - base->RMR = 0; -} - -/*! - * brief Enables/disables the SAI Tx. - * - * param base SAI base pointer - * param enable True means enable SAI Tx, false means disable. - */ -void SAI_TxEnable(I2S_Type *base, bool enable) -{ - if (enable) - { - /* If clock is sync with Rx, should enable RE bit. */ - if (((base->TCR2 & I2S_TCR2_SYNC_MASK) >> I2S_TCR2_SYNC_SHIFT) == 0x1U) - { - base->RCSR = ((base->RCSR & 0xFFE3FFFFU) | I2S_RCSR_RE_MASK); - } - base->TCSR = ((base->TCSR & 0xFFE3FFFFU) | I2S_TCSR_TE_MASK); - /* Also need to clear the FIFO error flag before start */ - SAI_TxClearStatusFlags(base, kSAI_FIFOErrorFlag); - } - else - { - /* If Rx not in sync with Tx, then disable Tx, otherwise, shall not disable Tx */ - if (((base->RCR2 & I2S_RCR2_SYNC_MASK) >> I2S_RCR2_SYNC_SHIFT) != 0x1U) - { - /* Disable TE bit */ - base->TCSR = ((base->TCSR & 0xFFE3FFFFU) & (~I2S_TCSR_TE_MASK)); - } - } -} - -/*! - * brief Enables/disables the SAI Rx. - * - * param base SAI base pointer - * param enable True means enable SAI Rx, false means disable. - */ -void SAI_RxEnable(I2S_Type *base, bool enable) -{ - if (enable) - { - /* If clock is sync with Tx, should enable TE bit. */ - if (((base->RCR2 & I2S_RCR2_SYNC_MASK) >> I2S_RCR2_SYNC_SHIFT) == 0x1U) - { - base->TCSR = ((base->TCSR & 0xFFE3FFFFU) | I2S_TCSR_TE_MASK); - } - base->RCSR = ((base->RCSR & 0xFFE3FFFFU) | I2S_RCSR_RE_MASK); - /* Also need to clear the FIFO error flag before start */ - SAI_RxClearStatusFlags(base, kSAI_FIFOErrorFlag); - } - else - { - /* If Tx not in sync with Rx, then disable Rx, otherwise, shall not disable Rx */ - if (((base->TCR2 & I2S_TCR2_SYNC_MASK) >> I2S_TCR2_SYNC_SHIFT) != 0x1U) - { - /* Disable RE bit */ - base->RCSR = ((base->RCSR & 0xFFE3FFFFU) & (~I2S_RCSR_RE_MASK)); - } - } -} - -/*! - * brief Do software reset or FIFO reset . - * - * FIFO reset means clear all the data in the FIFO, and make the FIFO pointer both to 0. - * Software reset means clear the Tx internal logic, including the bit clock, frame count etc. But software - * reset will not clear any configuration registers like TCR1~TCR5. - * This function will also clear all the error flags such as FIFO error, sync error etc. - * - * param base SAI base pointer - * param resetType Reset type, FIFO reset or software reset - */ -void SAI_TxSoftwareReset(I2S_Type *base, sai_reset_type_t resetType) -{ - base->TCSR |= (uint32_t)resetType; - - /* Clear the software reset */ - base->TCSR &= ~I2S_TCSR_SR_MASK; -} - -/*! - * brief Do software reset or FIFO reset . - * - * FIFO reset means clear all the data in the FIFO, and make the FIFO pointer both to 0. - * Software reset means clear the Rx internal logic, including the bit clock, frame count etc. But software - * reset will not clear any configuration registers like RCR1~RCR5. - * This function will also clear all the error flags such as FIFO error, sync error etc. - * - * param base SAI base pointer - * param resetType Reset type, FIFO reset or software reset - */ -void SAI_RxSoftwareReset(I2S_Type *base, sai_reset_type_t resetType) -{ - base->RCSR |= (uint32_t)resetType; - - /* Clear the software reset */ - base->RCSR &= ~I2S_RCSR_SR_MASK; -} - -/*! - * brief Set the Tx channel FIFO enable mask. - * - * param base SAI base pointer - * param mask Channel enable mask, 0 means all channel FIFO disabled, 1 means channel 0 enabled, - * 3 means both channel 0 and channel 1 enabled. - */ -void SAI_TxSetChannelFIFOMask(I2S_Type *base, uint8_t mask) -{ - base->TCR3 &= ~I2S_TCR3_TCE_MASK; - base->TCR3 |= I2S_TCR3_TCE(mask); -} - -/*! - * brief Set the Rx channel FIFO enable mask. - * - * param base SAI base pointer - * param mask Channel enable mask, 0 means all channel FIFO disabled, 1 means channel 0 enabled, - * 3 means both channel 0 and channel 1 enabled. - */ -void SAI_RxSetChannelFIFOMask(I2S_Type *base, uint8_t mask) -{ - base->RCR3 &= ~I2S_RCR3_RCE_MASK; - base->RCR3 |= I2S_RCR3_RCE(mask); -} - -/*! - * brief Set the Tx data order. - * - * param base SAI base pointer - * param order Data order MSB or LSB - */ -void SAI_TxSetDataOrder(I2S_Type *base, sai_data_order_t order) -{ - uint32_t val = (base->TCR4) & (~I2S_TCR4_MF_MASK); - - val |= I2S_TCR4_MF(order); - base->TCR4 = val; -} - -/*! - * brief Set the Rx data order. - * - * param base SAI base pointer - * param order Data order MSB or LSB - */ -void SAI_RxSetDataOrder(I2S_Type *base, sai_data_order_t order) -{ - uint32_t val = (base->RCR4) & (~I2S_RCR4_MF_MASK); - - val |= I2S_RCR4_MF(order); - base->RCR4 = val; -} - -/*! - * brief Set the Tx data order. - * - * param base SAI base pointer - * param order Data order MSB or LSB - */ -void SAI_TxSetBitClockPolarity(I2S_Type *base, sai_clock_polarity_t polarity) -{ - uint32_t val = (base->TCR2) & (~I2S_TCR2_BCP_MASK); - - val |= I2S_TCR2_BCP(polarity); - base->TCR2 = val; -} - -/*! - * brief Set the Rx data order. - * - * param base SAI base pointer - * param order Data order MSB or LSB - */ -void SAI_RxSetBitClockPolarity(I2S_Type *base, sai_clock_polarity_t polarity) -{ - uint32_t val = (base->RCR2) & (~I2S_RCR2_BCP_MASK); - - val |= I2S_RCR2_BCP(polarity); - base->RCR2 = val; -} - -/*! - * brief Set the Tx data order. - * - * param base SAI base pointer - * param order Data order MSB or LSB - */ -void SAI_TxSetFrameSyncPolarity(I2S_Type *base, sai_clock_polarity_t polarity) -{ - uint32_t val = (base->TCR4) & (~I2S_TCR4_FSP_MASK); - - val |= I2S_TCR4_FSP(polarity); - base->TCR4 = val; -} - -/*! - * brief Set the Rx data order. - * - * param base SAI base pointer - * param order Data order MSB or LSB - */ -void SAI_RxSetFrameSyncPolarity(I2S_Type *base, sai_clock_polarity_t polarity) -{ - uint32_t val = (base->RCR4) & (~I2S_RCR4_FSP_MASK); - - val |= I2S_RCR4_FSP(polarity); - base->RCR4 = val; -} - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_PACKING) && FSL_FEATURE_SAI_HAS_FIFO_PACKING -/*! - * brief Set Tx FIFO packing feature. - * - * param base SAI base pointer. - * param pack FIFO pack type. It is element of sai_fifo_packing_t. - */ -void SAI_TxSetFIFOPacking(I2S_Type *base, sai_fifo_packing_t pack) -{ - uint32_t val = base->TCR4; - - val &= ~I2S_TCR4_FPACK_MASK; - val |= I2S_TCR4_FPACK(pack); - base->TCR4 = val; -} - -/*! - * brief Set Rx FIFO packing feature. - * - * param base SAI base pointer. - * param pack FIFO pack type. It is element of sai_fifo_packing_t. - */ -void SAI_RxSetFIFOPacking(I2S_Type *base, sai_fifo_packing_t pack) -{ - uint32_t val = base->RCR4; - - val &= ~I2S_RCR4_FPACK_MASK; - val |= I2S_RCR4_FPACK(pack); - base->RCR4 = val; -} -#endif /* FSL_FEATURE_SAI_HAS_FIFO_PACKING */ - -/*! - * brief Transmitter bit clock rate configurations. - * - * param base SAI base pointer. - * param sourceClockHz, bit clock source frequency. - * param sampleRate audio data sample rate. - * param bitWidth, audio data bitWidth. - * param channelNumbers, audio channel numbers. - */ -void SAI_TxSetBitClockRate( - I2S_Type *base, uint32_t sourceClockHz, uint32_t sampleRate, uint32_t bitWidth, uint32_t channelNumbers) -{ - uint32_t tcr2 = base->TCR2; - uint32_t bitClockDiv = 0; - uint32_t bitClockFreq = sampleRate * bitWidth * channelNumbers; - - assert(sourceClockHz >= bitClockFreq); - - tcr2 &= ~I2S_TCR2_DIV_MASK; - /* need to check the divided bclk, if bigger than target, then divider need to re-calculate. */ - bitClockDiv = sourceClockHz / bitClockFreq; - /* for the condition where the source clock is smaller than target bclk */ - if (bitClockDiv == 0U) - { - bitClockDiv++; - } - /* recheck the divider if properly or not, to make sure output blck not bigger than target*/ - if ((sourceClockHz / bitClockDiv) > bitClockFreq) - { - bitClockDiv++; - } - -#if defined(FSL_FEATURE_SAI_HAS_BCLK_BYPASS) && (FSL_FEATURE_SAI_HAS_BCLK_BYPASS) - /* if bclk same with MCLK, bypass the divider */ - if (bitClockDiv == 1U) - { - tcr2 |= I2S_TCR2_BYP_MASK; - } - else -#endif - { - tcr2 |= I2S_TCR2_DIV(bitClockDiv / 2U - 1UL); - } - - base->TCR2 = tcr2; -} - -/*! - * brief Receiver bit clock rate configurations. - * - * param base SAI base pointer. - * param sourceClockHz, bit clock source frequency. - * param sampleRate audio data sample rate. - * param bitWidth, audio data bitWidth. - * param channelNumbers, audio channel numbers. - */ -void SAI_RxSetBitClockRate( - I2S_Type *base, uint32_t sourceClockHz, uint32_t sampleRate, uint32_t bitWidth, uint32_t channelNumbers) -{ - uint32_t rcr2 = base->RCR2; - uint32_t bitClockDiv = 0; - uint32_t bitClockFreq = sampleRate * bitWidth * channelNumbers; - - assert(sourceClockHz >= bitClockFreq); - - rcr2 &= ~I2S_RCR2_DIV_MASK; - /* need to check the divided bclk, if bigger than target, then divider need to re-calculate. */ - bitClockDiv = sourceClockHz / bitClockFreq; - /* for the condition where the source clock is smaller than target bclk */ - if (bitClockDiv == 0U) - { - bitClockDiv++; - } - /* recheck the divider if properly or not, to make sure output blck not bigger than target*/ - if ((sourceClockHz / bitClockDiv) > bitClockFreq) - { - bitClockDiv++; - } - -#if defined(FSL_FEATURE_SAI_HAS_BCLK_BYPASS) && (FSL_FEATURE_SAI_HAS_BCLK_BYPASS) - /* if bclk same with MCLK, bypass the divider */ - if (bitClockDiv == 1U) - { - rcr2 |= I2S_RCR2_BYP_MASK; - } - else -#endif - { - rcr2 |= I2S_RCR2_DIV(bitClockDiv / 2U - 1UL); - } - - base->RCR2 = rcr2; -} - -/*! - * brief Transmitter Bit clock configurations. - * - * param base SAI base pointer. - * param masterSlave master or slave. - * param config bit clock other configurations, can be NULL in slave mode. - */ -void SAI_TxSetBitclockConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_bit_clock_t *config) -{ - uint32_t tcr2 = base->TCR2; - - if ((masterSlave == kSAI_Master) || (masterSlave == kSAI_Bclk_Master_FrameSync_Slave)) - { - assert(config != NULL); - - tcr2 &= ~(I2S_TCR2_BCD_MASK | I2S_TCR2_BCP_MASK | I2S_TCR2_BCI_MASK | I2S_TCR2_BCS_MASK | I2S_TCR2_MSEL_MASK); - tcr2 |= I2S_TCR2_BCD(1U) | I2S_TCR2_BCP(config->bclkPolarity) | I2S_TCR2_BCI(config->bclkInputDelay) | - I2S_TCR2_BCS(config->bclkSrcSwap) | I2S_TCR2_MSEL(config->bclkSource); - } - else - { - tcr2 &= ~(I2S_TCR2_BCD_MASK); - tcr2 |= I2S_TCR2_BCP(config->bclkPolarity); - } - - base->TCR2 = tcr2; -} - -/*! - * brief Receiver Bit clock configurations. - * - * param base SAI base pointer. - * param masterSlave master or slave. - * param config bit clock other configurations, can be NULL in slave mode. - */ -void SAI_RxSetBitclockConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_bit_clock_t *config) -{ - uint32_t rcr2 = base->RCR2; - - if ((masterSlave == kSAI_Master) || (masterSlave == kSAI_Bclk_Master_FrameSync_Slave)) - { - assert(config != NULL); - - rcr2 &= ~(I2S_RCR2_BCD_MASK | I2S_RCR2_BCP_MASK | I2S_RCR2_BCI_MASK | I2S_RCR2_BCS_MASK | I2S_RCR2_MSEL_MASK); - rcr2 |= I2S_RCR2_BCD(1U) | I2S_RCR2_BCP(config->bclkPolarity) | I2S_RCR2_BCI(config->bclkInputDelay) | - I2S_RCR2_BCS(config->bclkSrcSwap) | I2S_RCR2_MSEL(config->bclkSource); - } - else - { - rcr2 &= ~(I2S_RCR2_BCD_MASK); - rcr2 |= I2S_RCR2_BCP(config->bclkPolarity); - } - - base->RCR2 = rcr2; -} - -#if (defined(FSL_FEATURE_SAI_HAS_MCR) && (FSL_FEATURE_SAI_HAS_MCR)) || \ - (defined(FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) && (FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER)) -/*! - * brief Master clock configurations. - * - * param base SAI base pointer. - * param config master clock configurations. - */ -void SAI_SetMasterClockConfig(I2S_Type *base, sai_master_clock_t *config) -{ - assert(config != NULL); - -#if defined(FSL_FEATURE_SAI_HAS_MCR) && (FSL_FEATURE_SAI_HAS_MCR) - uint32_t val = 0; -#if !(defined(FSL_FEATURE_SAI_HAS_NO_MCR_MICS) && (FSL_FEATURE_SAI_HAS_NO_MCR_MICS)) - /* Master clock source setting */ - val = (base->MCR & ~I2S_MCR_MICS_MASK); - base->MCR = (val | I2S_MCR_MICS(config->mclkSource)); -#endif - - /* Configure Master clock output enable */ - val = (base->MCR & ~I2S_MCR_MOE_MASK); - base->MCR = (val | I2S_MCR_MOE(config->mclkOutputEnable)); -#endif /* FSL_FEATURE_SAI_HAS_MCR */ - -#if ((defined(FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) && (FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER)) || \ - (defined(FSL_FEATURE_SAI_HAS_MCR_MCLK_POST_DIV) && (FSL_FEATURE_SAI_HAS_MCR_MCLK_POST_DIV))) - /* Check if master clock divider enabled, then set master clock divider */ - if (config->mclkOutputEnable) - { - SAI_SetMasterClockDivider(base, config->mclkHz, config->mclkSourceClkHz); - } -#endif /* FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER */ -} -#endif - -#if FSL_SAI_HAS_FIFO_EXTEND_FEATURE -/*! - * brief SAI transmitter fifo configurations. - * - * param base SAI base pointer. - * param config fifo configurations. - */ -void SAI_TxSetFifoConfig(I2S_Type *base, sai_fifo_t *config) -{ - assert(config != NULL); -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((config->fifoWatermark == 0U) || - (config->fifoWatermark > (uint8_t)((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base)))) - { - config->fifoWatermark = (uint8_t)((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base) / 2U); - } -#endif - - uint32_t tcr4 = base->TCR4; - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE - tcr4 &= ~I2S_TCR4_FCOMB_MASK; - tcr4 |= I2S_TCR4_FCOMB(config->fifoCombine); -#endif - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) && FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR - tcr4 &= ~I2S_TCR4_FCONT_MASK; - /* ERR05144: not set FCONT = 1 when TMR > 0, the transmit shift register may not load correctly that will cause TX - * not work */ - if (base->TMR == 0U) - { - tcr4 |= I2S_TCR4_FCONT(config->fifoContinueOneError); - } -#endif - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_PACKING) && FSL_FEATURE_SAI_HAS_FIFO_PACKING - tcr4 &= ~I2S_TCR4_FPACK_MASK; - tcr4 |= I2S_TCR4_FPACK(config->fifoPacking); -#endif - - base->TCR4 = tcr4; - -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - base->TCR1 = (base->TCR1 & (~I2S_TCR1_TFW_MASK)) | I2S_TCR1_TFW(config->fifoWatermark); -#endif -} - -/*! - * brief SAI receiver fifo configurations. - * - * param base SAI base pointer. - * param config fifo configurations. - */ -void SAI_RxSetFifoConfig(I2S_Type *base, sai_fifo_t *config) -{ - assert(config != NULL); -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((config->fifoWatermark == 0U) || - (config->fifoWatermark > (uint8_t)((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base)))) - { - config->fifoWatermark = (uint8_t)((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base) / 2U); - } -#endif - uint32_t rcr4 = base->RCR4; - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE - rcr4 &= ~I2S_RCR4_FCOMB_MASK; - rcr4 |= I2S_RCR4_FCOMB(config->fifoCombine); -#endif - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) && FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR - rcr4 &= ~I2S_RCR4_FCONT_MASK; - rcr4 |= I2S_RCR4_FCONT(config->fifoContinueOneError); -#endif - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_PACKING) && FSL_FEATURE_SAI_HAS_FIFO_PACKING - rcr4 &= ~I2S_RCR4_FPACK_MASK; - rcr4 |= I2S_RCR4_FPACK(config->fifoPacking); -#endif - - base->RCR4 = rcr4; - -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - base->RCR1 = (base->RCR1 & (~I2S_RCR1_RFW_MASK)) | I2S_RCR1_RFW(config->fifoWatermark); -#endif -} -#endif - -/*! - * brief SAI transmitter Frame sync configurations. - * - * param base SAI base pointer. - * param masterSlave master or slave. - * param config frame sync configurations, can be NULL in slave mode. - */ -void SAI_TxSetFrameSyncConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_frame_sync_t *config) -{ - assert(config != NULL); - assert((config->frameSyncWidth - 1UL) <= (I2S_TCR4_SYWD_MASK >> I2S_TCR4_SYWD_SHIFT)); - - uint32_t tcr4 = base->TCR4; - - tcr4 &= ~(I2S_TCR4_FSE_MASK | I2S_TCR4_FSP_MASK | I2S_TCR4_FSD_MASK | I2S_TCR4_SYWD_MASK); - -#if defined(FSL_FEATURE_SAI_HAS_ON_DEMAND_MODE) && FSL_FEATURE_SAI_HAS_ON_DEMAND_MODE - tcr4 &= ~I2S_TCR4_ONDEM_MASK; - tcr4 |= I2S_TCR4_ONDEM(config->frameSyncGenerateOnDemand); -#endif - - tcr4 |= - I2S_TCR4_FSE(config->frameSyncEarly) | I2S_TCR4_FSP(config->frameSyncPolarity) | - I2S_TCR4_FSD(((masterSlave == kSAI_Master) || (masterSlave == kSAI_Bclk_Slave_FrameSync_Master)) ? 1UL : 0U) | - I2S_TCR4_SYWD(config->frameSyncWidth - 1UL); - - base->TCR4 = tcr4; -} - -/*! - * brief SAI receiver Frame sync configurations. - * - * param base SAI base pointer. - * param masterSlave master or slave. - * param config frame sync configurations, can be NULL in slave mode. - */ -void SAI_RxSetFrameSyncConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_frame_sync_t *config) -{ - assert(config != NULL); - assert((config->frameSyncWidth - 1UL) <= (I2S_RCR4_SYWD_MASK >> I2S_RCR4_SYWD_SHIFT)); - - uint32_t rcr4 = base->RCR4; - - rcr4 &= ~(I2S_RCR4_FSE_MASK | I2S_RCR4_FSP_MASK | I2S_RCR4_FSD_MASK | I2S_RCR4_SYWD_MASK); - -#if defined(FSL_FEATURE_SAI_HAS_ON_DEMAND_MODE) && FSL_FEATURE_SAI_HAS_ON_DEMAND_MODE - rcr4 &= ~I2S_RCR4_ONDEM_MASK; - rcr4 |= I2S_RCR4_ONDEM(config->frameSyncGenerateOnDemand); -#endif - - rcr4 |= - I2S_RCR4_FSE(config->frameSyncEarly) | I2S_RCR4_FSP(config->frameSyncPolarity) | - I2S_RCR4_FSD(((masterSlave == kSAI_Master) || (masterSlave == kSAI_Bclk_Slave_FrameSync_Master)) ? 1UL : 0U) | - I2S_RCR4_SYWD(config->frameSyncWidth - 1UL); - - base->RCR4 = rcr4; -} - -/*! - * brief SAI transmitter Serial data configurations. - * - * param base SAI base pointer. - * param config serial data configurations. - */ -void SAI_TxSetSerialDataConfig(I2S_Type *base, sai_serial_data_t *config) -{ - assert(config != NULL); - - uint32_t tcr4 = base->TCR4; - - base->TCR5 = I2S_TCR5_WNW(config->dataWordNLength - 1UL) | I2S_TCR5_W0W(config->dataWord0Length - 1UL) | - I2S_TCR5_FBT(config->dataFirstBitShifted - 1UL); - base->TMR = config->dataMaskedWord; -#if defined(FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) && FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR - /* ERR05144: not set FCONT = 1 when TMR > 0, the transmit shift register may not load correctly that will cause TX - * not work */ - if (config->dataMaskedWord > 0U) - { - tcr4 &= ~I2S_TCR4_FCONT_MASK; - } -#endif - tcr4 &= ~(I2S_TCR4_FRSZ_MASK | I2S_TCR4_MF_MASK); - tcr4 |= I2S_TCR4_FRSZ(config->dataWordNum - 1UL) | I2S_TCR4_MF(config->dataOrder); - -#if defined(FSL_FEATURE_SAI_HAS_CHANNEL_MODE) && FSL_FEATURE_SAI_HAS_CHANNEL_MODE - tcr4 &= ~I2S_TCR4_CHMOD_MASK; - tcr4 |= I2S_TCR4_CHMOD(config->dataMode); -#endif - - base->TCR4 = tcr4; -} - -/*! - * @brief SAI receiver Serial data configurations. - * - * @param base SAI base pointer. - * @param config serial data configurations. - */ -void SAI_RxSetSerialDataConfig(I2S_Type *base, sai_serial_data_t *config) -{ - assert(config != NULL); - - uint32_t rcr4 = base->RCR4; - - base->RCR5 = I2S_RCR5_WNW(config->dataWordNLength - 1UL) | I2S_RCR5_W0W(config->dataWord0Length - 1UL) | - I2S_RCR5_FBT(config->dataFirstBitShifted - 1UL); - base->RMR = config->dataMaskedWord; - - rcr4 &= ~(I2S_RCR4_FRSZ_MASK | I2S_RCR4_MF_MASK); - rcr4 |= I2S_RCR4_FRSZ(config->dataWordNum - 1uL) | I2S_RCR4_MF(config->dataOrder); - - base->RCR4 = rcr4; -} - -/*! - * brief SAI transmitter configurations. - * - * param base SAI base pointer. - * param config transmitter configurations. - */ -void SAI_TxSetConfig(I2S_Type *base, sai_transceiver_t *config) -{ - assert(config != NULL); - assert(FSL_FEATURE_SAI_CHANNEL_COUNTn(base) != -1); - - uint8_t i = 0U; - uint32_t val = 0U; - uint8_t channelNums = 0U; - - /* reset transmitter */ - SAI_TxReset(base); - - /* if channel mask is not set, then format->channel must be set, - use it to get channel mask value */ - if (config->channelMask == 0U) - { - config->channelMask = 1U << config->startChannel; - } - - for (i = 0U; i < (uint32_t)FSL_FEATURE_SAI_CHANNEL_COUNTn(base); i++) - { - if (IS_SAI_FLAG_SET(1UL << i, config->channelMask)) - { - channelNums++; - config->endChannel = i; - } - } - - for (i = 0U; i < (uint32_t)FSL_FEATURE_SAI_CHANNEL_COUNTn(base); i++) - { - if (IS_SAI_FLAG_SET((1UL << i), config->channelMask)) - { - config->startChannel = i; - break; - } - } - - config->channelNums = channelNums; -#if defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && (FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) - /* make sure combine mode disabled while multipe channel is used */ - if (config->channelNums > 1U) - { - base->TCR4 &= ~I2S_TCR4_FCOMB_MASK; - } -#endif - - /* Set data channel */ - base->TCR3 &= ~I2S_TCR3_TCE_MASK; - base->TCR3 |= I2S_TCR3_TCE(config->channelMask); - - if (config->syncMode == kSAI_ModeAsync) - { - val = base->TCR2; - val &= ~I2S_TCR2_SYNC_MASK; - base->TCR2 = (val | I2S_TCR2_SYNC(0U)); - } - if (config->syncMode == kSAI_ModeSync) - { - val = base->TCR2; - val &= ~I2S_TCR2_SYNC_MASK; - base->TCR2 = (val | I2S_TCR2_SYNC(1U)); - /* If sync with Rx, should set Rx to async mode */ - val = base->RCR2; - val &= ~I2S_RCR2_SYNC_MASK; - base->RCR2 = (val | I2S_RCR2_SYNC(0U)); - } -#if defined(FSL_FEATURE_SAI_HAS_SYNC_WITH_ANOTHER_SAI) && (FSL_FEATURE_SAI_HAS_SYNC_WITH_ANOTHER_SAI) - if (config->syncMode == kSAI_ModeSyncWithOtherTx) - { - val = base->TCR2; - val &= ~I2S_TCR2_SYNC_MASK; - base->TCR2 = (val | I2S_TCR2_SYNC(2U)); - } - if (config->syncMode == kSAI_ModeSyncWithOtherRx) - { - val = base->TCR2; - val &= ~I2S_TCR2_SYNC_MASK; - base->TCR2 = (val | I2S_TCR2_SYNC(3U)); - } -#endif /* FSL_FEATURE_SAI_HAS_SYNC_WITH_ANOTHER_SAI */ - - /* bit clock configurations */ - SAI_TxSetBitclockConfig(base, config->masterSlave, &config->bitClock); - /* serial data configurations */ - SAI_TxSetSerialDataConfig(base, &config->serialData); - /* frame sync configurations */ - SAI_TxSetFrameSyncConfig(base, config->masterSlave, &config->frameSync); -#if FSL_SAI_HAS_FIFO_EXTEND_FEATURE - /* fifo configurations */ - SAI_TxSetFifoConfig(base, &config->fifo); -#endif -} - -/*! - * brief SAI transmitter transfer configurations. - * - * This function initializes the TX, include bit clock, frame sync, master clock, serial data and fifo configurations. - * - * param base SAI base pointer. - * param handle SAI handle pointer. - * param config tranmitter configurations. - */ -void SAI_TransferTxSetConfig(I2S_Type *base, sai_handle_t *handle, sai_transceiver_t *config) -{ - assert(handle != NULL); - assert(config != NULL); - assert(config->channelNums <= (uint32_t)FSL_FEATURE_SAI_CHANNEL_COUNTn(base)); - - handle->bitWidth = config->serialData.dataWordNLength; -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((config->fifo.fifoWatermark == 0U) || - (config->fifo.fifoWatermark > (uint8_t)((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base)))) - { - config->fifo.fifoWatermark = (uint8_t)((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base) / 2U); - } - handle->watermark = config->fifo.fifoWatermark; -#endif - - /* transmitter configurations */ - SAI_TxSetConfig(base, config); - - handle->channel = config->startChannel; - /* used for multi channel */ - handle->channelMask = config->channelMask; - handle->channelNums = config->channelNums; - handle->endChannel = config->endChannel; -} - -/*! - * brief SAI receiver configurations. - * - * param base SAI base pointer. - * param config transmitter configurations. - */ -void SAI_RxSetConfig(I2S_Type *base, sai_transceiver_t *config) -{ - assert(config != NULL); - assert(FSL_FEATURE_SAI_CHANNEL_COUNTn(base) != -1); - - uint8_t i = 0U; - uint32_t val = 0U; - uint8_t channelNums = 0U; - - /* reset receiver */ - SAI_RxReset(base); - - /* if channel mask is not set, then format->channel must be set, - use it to get channel mask value */ - if (config->channelMask == 0U) - { - config->channelMask = 1U << config->startChannel; - } - - for (i = 0U; i < (uint32_t)FSL_FEATURE_SAI_CHANNEL_COUNTn(base); i++) - { - if (IS_SAI_FLAG_SET((1UL << i), config->channelMask)) - { - channelNums++; - config->endChannel = i; - } - } - - for (i = 0U; i < (uint32_t)FSL_FEATURE_SAI_CHANNEL_COUNTn(base); i++) - { - if (IS_SAI_FLAG_SET((1UL << i), config->channelMask)) - { - config->startChannel = i; - break; - } - } - - config->channelNums = channelNums; -#if defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && (FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) - /* make sure combine mode disabled while multipe channel is used */ - if (config->channelNums > 1U) - { - base->RCR4 &= ~I2S_RCR4_FCOMB_MASK; - } -#endif - - /* Set data channel */ - base->RCR3 &= ~I2S_RCR3_RCE_MASK; - base->RCR3 |= I2S_RCR3_RCE(config->channelMask); - - /* Set Sync mode */ - if (config->syncMode == kSAI_ModeAsync) - { - val = base->RCR2; - val &= ~I2S_RCR2_SYNC_MASK; - base->RCR2 = (val | I2S_RCR2_SYNC(0U)); - } - if (config->syncMode == kSAI_ModeSync) - { - val = base->RCR2; - val &= ~I2S_RCR2_SYNC_MASK; - base->RCR2 = (val | I2S_RCR2_SYNC(1U)); - /* If sync with Tx, should set Tx to async mode */ - val = base->TCR2; - val &= ~I2S_TCR2_SYNC_MASK; - base->TCR2 = (val | I2S_TCR2_SYNC(0U)); - } -#if defined(FSL_FEATURE_SAI_HAS_SYNC_WITH_ANOTHER_SAI) && (FSL_FEATURE_SAI_HAS_SYNC_WITH_ANOTHER_SAI) - if (config->syncMode == kSAI_ModeSyncWithOtherTx) - { - val = base->RCR2; - val &= ~I2S_RCR2_SYNC_MASK; - base->RCR2 = (val | I2S_RCR2_SYNC(2U)); - } - if (config->syncMode == kSAI_ModeSyncWithOtherRx) - { - val = base->RCR2; - val &= ~I2S_RCR2_SYNC_MASK; - base->RCR2 = (val | I2S_RCR2_SYNC(3U)); - } -#endif /* FSL_FEATURE_SAI_HAS_SYNC_WITH_ANOTHER_SAI */ - - /* bit clock configurations */ - SAI_RxSetBitclockConfig(base, config->masterSlave, &config->bitClock); - /* serial data configurations */ - SAI_RxSetSerialDataConfig(base, &config->serialData); - /* frame sync configurations */ - SAI_RxSetFrameSyncConfig(base, config->masterSlave, &config->frameSync); -#if FSL_SAI_HAS_FIFO_EXTEND_FEATURE - /* fifo configurations */ - SAI_RxSetFifoConfig(base, &config->fifo); -#endif -} - -/*! - * brief SAI receiver transfer configurations. - * - * This function initializes the TX, include bit clock, frame sync, master clock, serial data and fifo configurations. - * - * param base SAI base pointer. - * param handle SAI handle pointer. - * param config tranmitter configurations. - */ -void SAI_TransferRxSetConfig(I2S_Type *base, sai_handle_t *handle, sai_transceiver_t *config) -{ - assert(handle != NULL); - assert(config != NULL); - - handle->bitWidth = config->serialData.dataWordNLength; -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((config->fifo.fifoWatermark == 0U) || - (config->fifo.fifoWatermark > (uint8_t)((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base)))) - { - config->fifo.fifoWatermark = (uint8_t)((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base) / 2U); - } - handle->watermark = config->fifo.fifoWatermark; -#endif - - /* receiver configurations */ - SAI_RxSetConfig(base, config); - - handle->channel = config->startChannel; - /* used for multi channel */ - handle->channelMask = config->channelMask; - handle->channelNums = config->channelNums; - handle->endChannel = config->endChannel; -} - -/*! - * brief Get classic I2S mode configurations. - * - * param config transceiver configurations. - * param bitWidth audio data bitWidth. - * param mode audio data channel. - * param saiChannelMask channel mask value to enable. - */ -void SAI_GetClassicI2SConfig(sai_transceiver_t *config, - sai_word_width_t bitWidth, - sai_mono_stereo_t mode, - uint32_t saiChannelMask) -{ - SAI_GetCommonConfig(config, bitWidth, mode, saiChannelMask); -} - -/*! - * brief Get left justified mode configurations. - * - * param config transceiver configurations. - * param bitWidth audio data bitWidth. - * param mode audio data channel. - * param saiChannelMask channel mask value to enable. - */ -void SAI_GetLeftJustifiedConfig(sai_transceiver_t *config, - sai_word_width_t bitWidth, - sai_mono_stereo_t mode, - uint32_t saiChannelMask) -{ - assert(NULL != config); - assert(saiChannelMask != 0U); - - SAI_GetCommonConfig(config, bitWidth, mode, saiChannelMask); - - config->frameSync.frameSyncEarly = false; - config->frameSync.frameSyncPolarity = kSAI_PolarityActiveHigh; -} - -/*! - * brief Get right justified mode configurations. - * - * param config transceiver configurations. - * param bitWidth audio data bitWidth. - * param mode audio data channel. - * param saiChannelMask channel mask value to enable. - */ -void SAI_GetRightJustifiedConfig(sai_transceiver_t *config, - sai_word_width_t bitWidth, - sai_mono_stereo_t mode, - uint32_t saiChannelMask) -{ - assert(NULL != config); - assert(saiChannelMask != 0U); - - SAI_GetCommonConfig(config, bitWidth, mode, saiChannelMask); - - config->frameSync.frameSyncEarly = false; - config->frameSync.frameSyncPolarity = kSAI_PolarityActiveHigh; -} - -/*! - * brief Get DSP mode configurations. - * - * note DSP mode is also called PCM mode which support MODE A and MODE B, - * DSP/PCM MODE A configuration flow. RX is similiar but uses SAI_RxSetConfig instead of SAI_TxSetConfig: - * code - * SAI_GetDSPConfig(config, kSAI_FrameSyncLenOneBitClk, bitWidth, kSAI_Stereo, channelMask) - * config->frameSync.frameSyncEarly = true; - * SAI_TxSetConfig(base, config) - * endcode - * - * DSP/PCM MODE B configuration flow for TX. RX is similiar but uses SAI_RxSetConfig instead of SAI_TxSetConfig: - * code - * SAI_GetDSPConfig(config, kSAI_FrameSyncLenOneBitClk, bitWidth, kSAI_Stereo, channelMask) - * SAI_TxSetConfig(base, config) - * endcode - * - * param config transceiver configurations. - * param frameSyncWidth length of frame sync. - * param bitWidth audio data bitWidth. - * param mode audio data channel. - * param saiChannelMask mask value of the channel to enable. - */ -void SAI_GetDSPConfig(sai_transceiver_t *config, - sai_frame_sync_len_t frameSyncWidth, - sai_word_width_t bitWidth, - sai_mono_stereo_t mode, - uint32_t saiChannelMask) -{ - assert(NULL != config); - assert(saiChannelMask != 0U); - - SAI_GetCommonConfig(config, bitWidth, mode, saiChannelMask); - - /* frame sync default configurations */ - switch (frameSyncWidth) - { - case kSAI_FrameSyncLenOneBitClk: - config->frameSync.frameSyncWidth = 1U; - break; - default: - assert(false); - break; - } - config->frameSync.frameSyncEarly = false; - config->frameSync.frameSyncPolarity = kSAI_PolarityActiveHigh; -} - -/*! - * brief Get TDM mode configurations. - * - * param config transceiver configurations. - * param bitWidth audio data bitWidth. - * param mode audio data channel. - * param saiChannelMask channel mask value to enable. - */ -void SAI_GetTDMConfig(sai_transceiver_t *config, - sai_frame_sync_len_t frameSyncWidth, - sai_word_width_t bitWidth, - uint32_t dataWordNum, - uint32_t saiChannelMask) -{ - assert(NULL != config); - assert(saiChannelMask != 0U); - assert(dataWordNum <= 32U); - - SAI_GetCommonConfig(config, bitWidth, kSAI_Stereo, saiChannelMask); - - /* frame sync default configurations */ - switch (frameSyncWidth) - { - case kSAI_FrameSyncLenOneBitClk: - config->frameSync.frameSyncWidth = 1U; - break; - case kSAI_FrameSyncLenPerWordWidth: - break; - default: - assert(false); - break; - } - config->frameSync.frameSyncEarly = false; - config->frameSync.frameSyncPolarity = kSAI_PolarityActiveHigh; - config->serialData.dataWordNum = (uint8_t)dataWordNum; -} - -/*! - * brief Sends data using a blocking method. - * - * note This function blocks by polling until data is ready to be sent. - * - * param base SAI base pointer. - * param channel Data channel used. - * param bitWidth How many bits in an audio word; usually 8/16/24/32 bits. - * param buffer Pointer to the data to be written. - * param size Bytes to be written. - */ -void SAI_WriteBlocking(I2S_Type *base, uint32_t channel, uint32_t bitWidth, uint8_t *buffer, uint32_t size) -{ - uint32_t i = 0; - uint32_t bytesPerWord = bitWidth / 8U; -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - bytesPerWord = (((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base) - base->TCR1) * bytesPerWord); -#endif - - while (i < size) - { - /* Wait until it can write data */ - while (!(IS_SAI_FLAG_SET(base->TCSR, I2S_TCSR_FWF_MASK))) - { - } - - SAI_WriteNonBlocking(base, channel, 1UL << channel, channel, (uint8_t)bitWidth, buffer, bytesPerWord); - buffer = (uint8_t *)((uintptr_t)buffer + bytesPerWord); - i += bytesPerWord; - } - - /* Wait until the last data is sent */ - while (!(IS_SAI_FLAG_SET(base->TCSR, I2S_TCSR_FWF_MASK))) - { - } -} - -/*! - * brief Sends data to multi channel using a blocking method. - * - * note This function blocks by polling until data is ready to be sent. - * - * param base SAI base pointer. - * param channel Data channel used. - * param channelMask channel mask. - * param bitWidth How many bits in an audio word; usually 8/16/24/32 bits. - * param buffer Pointer to the data to be written. - * param size Bytes to be written. - */ -void SAI_WriteMultiChannelBlocking( - I2S_Type *base, uint32_t channel, uint32_t channelMask, uint32_t bitWidth, uint8_t *buffer, uint32_t size) -{ - assert(FSL_FEATURE_SAI_CHANNEL_COUNTn(base) != -1); - - uint32_t i = 0, j = 0; - uint32_t bytesPerWord = bitWidth / 8U; - uint32_t channelNums = 0U, endChannel = 0U; - -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - bytesPerWord = (((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base) - base->TCR1) * bytesPerWord); -#endif - - for (i = 0U; (i < (uint32_t)FSL_FEATURE_SAI_CHANNEL_COUNTn(base)); i++) - { - if (IS_SAI_FLAG_SET((1UL << i), channelMask)) - { - channelNums++; - endChannel = i; - } - } - - bytesPerWord *= channelNums; - - while (j < size) - { - /* Wait until it can write data */ - while (!(IS_SAI_FLAG_SET(base->TCSR, I2S_TCSR_FWF_MASK))) - { - } - - SAI_WriteNonBlocking(base, channel, channelMask, endChannel, (uint8_t)bitWidth, buffer, - bytesPerWord * channelNums); - buffer = (uint8_t *)((uintptr_t)buffer + bytesPerWord * channelNums); - j += bytesPerWord * channelNums; - } - - /* Wait until the last data is sent */ - while (!(IS_SAI_FLAG_SET(base->TCSR, I2S_TCSR_FWF_MASK))) - { - } -} - -/*! - * brief Receives multi channel data using a blocking method. - * - * note This function blocks by polling until data is ready to be sent. - * - * param base SAI base pointer. - * param channel Data channel used. - * param channelMask channel mask. - * param bitWidth How many bits in an audio word; usually 8/16/24/32 bits. - * param buffer Pointer to the data to be read. - * param size Bytes to be read. - */ -void SAI_ReadMultiChannelBlocking( - I2S_Type *base, uint32_t channel, uint32_t channelMask, uint32_t bitWidth, uint8_t *buffer, uint32_t size) -{ - assert(FSL_FEATURE_SAI_CHANNEL_COUNTn(base) != -1); - - uint32_t i = 0, j = 0; - uint32_t bytesPerWord = bitWidth / 8U; - uint32_t channelNums = 0U, endChannel = 0U; -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - bytesPerWord = base->RCR1 * bytesPerWord; -#endif - for (i = 0U; (i < (uint32_t)FSL_FEATURE_SAI_CHANNEL_COUNTn(base)); i++) - { - if (IS_SAI_FLAG_SET((1UL << i), channelMask)) - { - channelNums++; - endChannel = i; - } - } - - bytesPerWord *= channelNums; - - while (j < size) - { - /* Wait until data is received */ - while (!(IS_SAI_FLAG_SET(base->RCSR, I2S_RCSR_FWF_MASK))) - { - } - - SAI_ReadNonBlocking(base, channel, channelMask, endChannel, (uint8_t)bitWidth, buffer, - bytesPerWord * channelNums); - buffer = (uint8_t *)((uintptr_t)buffer + bytesPerWord * channelNums); - j += bytesPerWord * channelNums; - } -} - -/*! - * brief Receives data using a blocking method. - * - * note This function blocks by polling until data is ready to be sent. - * - * param base SAI base pointer. - * param channel Data channel used. - * param bitWidth How many bits in an audio word; usually 8/16/24/32 bits. - * param buffer Pointer to the data to be read. - * param size Bytes to be read. - */ -void SAI_ReadBlocking(I2S_Type *base, uint32_t channel, uint32_t bitWidth, uint8_t *buffer, uint32_t size) -{ - uint32_t i = 0; - uint32_t bytesPerWord = bitWidth / 8U; -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - bytesPerWord = base->RCR1 * bytesPerWord; -#endif - - while (i < size) - { - /* Wait until data is received */ - while (!(IS_SAI_FLAG_SET(base->RCSR, I2S_RCSR_FWF_MASK))) - { - } - - SAI_ReadNonBlocking(base, channel, 1UL << channel, channel, (uint8_t)bitWidth, buffer, bytesPerWord); - buffer = (uint8_t *)((uintptr_t)buffer + bytesPerWord); - i += bytesPerWord; - } -} - -/*! - * brief Initializes the SAI Tx handle. - * - * This function initializes the Tx handle for the SAI Tx transactional APIs. Call - * this function once to get the handle initialized. - * - * param base SAI base pointer - * param handle SAI handle pointer. - * param callback Pointer to the user callback function. - * param userData User parameter passed to the callback function - */ -void SAI_TransferTxCreateHandle(I2S_Type *base, sai_handle_t *handle, sai_transfer_callback_t callback, void *userData) -{ - assert(handle != NULL); - - /* Zero the handle */ - (void)memset(handle, 0, sizeof(*handle)); - - s_saiHandle[SAI_GetInstance(base)][0] = handle; - - handle->callback = callback; - handle->userData = userData; - handle->base = base; - - /* Set the isr pointer */ - s_saiTxIsr = SAI_TransferTxHandleIRQ; - - /* Enable Tx irq */ - (void)EnableIRQ(s_saiTxIRQ[SAI_GetInstance(base)]); -} - -/*! - * brief Initializes the SAI Rx handle. - * - * This function initializes the Rx handle for the SAI Rx transactional APIs. Call - * this function once to get the handle initialized. - * - * param base SAI base pointer. - * param handle SAI handle pointer. - * param callback Pointer to the user callback function. - * param userData User parameter passed to the callback function. - */ -void SAI_TransferRxCreateHandle(I2S_Type *base, sai_handle_t *handle, sai_transfer_callback_t callback, void *userData) -{ - assert(handle != NULL); - - /* Zero the handle */ - (void)memset(handle, 0, sizeof(*handle)); - - s_saiHandle[SAI_GetInstance(base)][1] = handle; - - handle->callback = callback; - handle->userData = userData; - handle->base = base; - - /* Set the isr pointer */ - s_saiRxIsr = SAI_TransferRxHandleIRQ; - - /* Enable Rx irq */ - (void)EnableIRQ(s_saiRxIRQ[SAI_GetInstance(base)]); -} - -/*! - * brief Performs an interrupt non-blocking send transfer on SAI. - * - * note This API returns immediately after the transfer initiates. - * Call the SAI_TxGetTransferStatusIRQ to poll the transfer status and check whether - * the transfer is finished. If the return status is not kStatus_SAI_Busy, the transfer - * is finished. - * - * param base SAI base pointer. - * param handle Pointer to the sai_handle_t structure which stores the transfer state. - * param xfer Pointer to the sai_transfer_t structure. - * retval kStatus_Success Successfully started the data receive. - * retval kStatus_SAI_TxBusy Previous receive still not finished. - * retval kStatus_InvalidArgument The input parameter is invalid. - */ -status_t SAI_TransferSendNonBlocking(I2S_Type *base, sai_handle_t *handle, sai_transfer_t *xfer) -{ - assert(handle != NULL); - assert(handle->channelNums <= (uint32_t)FSL_FEATURE_SAI_CHANNEL_COUNTn(base)); - - /* Check if the queue is full */ - if (handle->saiQueue[handle->queueUser].data != NULL) - { - return kStatus_SAI_QueueFull; - } - - /* Add into queue */ - handle->transferSize[handle->queueUser] = xfer->dataSize; - handle->saiQueue[handle->queueUser].data = xfer->data; - handle->saiQueue[handle->queueUser].dataSize = xfer->dataSize; - handle->queueUser = (handle->queueUser + 1U) % (uint8_t)SAI_XFER_QUEUE_SIZE; - - /* Set the state to busy */ - handle->state = (uint32_t)kSAI_Busy; - - /* Enable interrupt */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - /* Use FIFO request interrupt and fifo error*/ - SAI_TxEnableInterrupts(base, I2S_TCSR_FEIE_MASK | I2S_TCSR_FRIE_MASK); -#else - SAI_TxEnableInterrupts(base, I2S_TCSR_FEIE_MASK | I2S_TCSR_FWIE_MASK); -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ - - /* Enable Tx transfer */ - SAI_TxEnable(base, true); - - return kStatus_Success; -} - -/*! - * brief Performs an interrupt non-blocking receive transfer on SAI. - * - * note This API returns immediately after the transfer initiates. - * Call the SAI_RxGetTransferStatusIRQ to poll the transfer status and check whether - * the transfer is finished. If the return status is not kStatus_SAI_Busy, the transfer - * is finished. - * - * param base SAI base pointer - * param handle Pointer to the sai_handle_t structure which stores the transfer state. - * param xfer Pointer to the sai_transfer_t structure. - * retval kStatus_Success Successfully started the data receive. - * retval kStatus_SAI_RxBusy Previous receive still not finished. - * retval kStatus_InvalidArgument The input parameter is invalid. - */ -status_t SAI_TransferReceiveNonBlocking(I2S_Type *base, sai_handle_t *handle, sai_transfer_t *xfer) -{ - assert(handle != NULL); - assert(handle->channelNums <= (uint32_t)FSL_FEATURE_SAI_CHANNEL_COUNTn(base)); - - /* Check if the queue is full */ - if (handle->saiQueue[handle->queueUser].data != NULL) - { - return kStatus_SAI_QueueFull; - } - - /* Add into queue */ - handle->transferSize[handle->queueUser] = xfer->dataSize; - handle->saiQueue[handle->queueUser].data = xfer->data; - handle->saiQueue[handle->queueUser].dataSize = xfer->dataSize; - handle->queueUser = (handle->queueUser + 1U) % (uint8_t)SAI_XFER_QUEUE_SIZE; - - /* Set state to busy */ - handle->state = (uint32_t)kSAI_Busy; - -/* Enable interrupt */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - /* Use FIFO request interrupt and fifo error*/ - SAI_RxEnableInterrupts(base, I2S_TCSR_FEIE_MASK | I2S_TCSR_FRIE_MASK); -#else - SAI_RxEnableInterrupts(base, I2S_TCSR_FEIE_MASK | I2S_TCSR_FWIE_MASK); -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ - - /* Enable Rx transfer */ - SAI_RxEnable(base, true); - - return kStatus_Success; -} - -/*! - * brief Gets a set byte count. - * - * param base SAI base pointer. - * param handle Pointer to the sai_handle_t structure which stores the transfer state. - * param count Bytes count sent. - * retval kStatus_Success Succeed get the transfer count. - * retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t SAI_TransferGetSendCount(I2S_Type *base, sai_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - status_t status = kStatus_Success; - uint32_t queueDriverIndex = handle->queueDriver; - - if (handle->state != (uint32_t)kSAI_Busy) - { - status = kStatus_NoTransferInProgress; - } - else - { - *count = (handle->transferSize[queueDriverIndex] - handle->saiQueue[queueDriverIndex].dataSize); - } - - return status; -} - -/*! - * brief Gets a received byte count. - * - * param base SAI base pointer. - * param handle Pointer to the sai_handle_t structure which stores the transfer state. - * param count Bytes count received. - * retval kStatus_Success Succeed get the transfer count. - * retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t SAI_TransferGetReceiveCount(I2S_Type *base, sai_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - status_t status = kStatus_Success; - uint32_t queueDriverIndex = handle->queueDriver; - - if (handle->state != (uint32_t)kSAI_Busy) - { - status = kStatus_NoTransferInProgress; - } - else - { - *count = (handle->transferSize[queueDriverIndex] - handle->saiQueue[queueDriverIndex].dataSize); - } - - return status; -} - -/*! - * brief Aborts the current send. - * - * note This API can be called any time when an interrupt non-blocking transfer initiates - * to abort the transfer early. - * - * param base SAI base pointer. - * param handle Pointer to the sai_handle_t structure which stores the transfer state. - */ -void SAI_TransferAbortSend(I2S_Type *base, sai_handle_t *handle) -{ - assert(handle != NULL); - - /* Stop Tx transfer and disable interrupt */ - SAI_TxEnable(base, false); -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - /* Use FIFO request interrupt and fifo error */ - SAI_TxDisableInterrupts(base, I2S_TCSR_FEIE_MASK | I2S_TCSR_FRIE_MASK); -#else - SAI_TxDisableInterrupts(base, I2S_TCSR_FEIE_MASK | I2S_TCSR_FWIE_MASK); -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ - - handle->state = (uint32_t)kSAI_Idle; - - /* Clear the queue */ - (void)memset(handle->saiQueue, 0, sizeof(sai_transfer_t) * (uint8_t)SAI_XFER_QUEUE_SIZE); - handle->queueDriver = 0; - handle->queueUser = 0; -} - -/*! - * brief Aborts the current IRQ receive. - * - * note This API can be called when an interrupt non-blocking transfer initiates - * to abort the transfer early. - * - * param base SAI base pointer - * param handle Pointer to the sai_handle_t structure which stores the transfer state. - */ -void SAI_TransferAbortReceive(I2S_Type *base, sai_handle_t *handle) -{ - assert(handle != NULL); - - /* Stop Tx transfer and disable interrupt */ - SAI_RxEnable(base, false); -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - /* Use FIFO request interrupt and fifo error */ - SAI_RxDisableInterrupts(base, I2S_TCSR_FEIE_MASK | I2S_TCSR_FRIE_MASK); -#else - SAI_RxDisableInterrupts(base, I2S_TCSR_FEIE_MASK | I2S_TCSR_FWIE_MASK); -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ - - handle->state = (uint32_t)kSAI_Idle; - - /* Clear the queue */ - (void)memset(handle->saiQueue, 0, sizeof(sai_transfer_t) * (uint8_t)SAI_XFER_QUEUE_SIZE); - handle->queueDriver = 0; - handle->queueUser = 0; -} - -/*! - * brief Terminate all SAI send. - * - * This function will clear all transfer slots buffered in the sai queue. If users only want to abort the - * current transfer slot, please call SAI_TransferAbortSend. - * - * param base SAI base pointer. - * param handle SAI eDMA handle pointer. - */ -void SAI_TransferTerminateSend(I2S_Type *base, sai_handle_t *handle) -{ - assert(handle != NULL); - - /* Abort the current transfer */ - SAI_TransferAbortSend(base, handle); - - /* Clear all the internal information */ - (void)memset(handle->saiQueue, 0, sizeof(handle->saiQueue)); - (void)memset(handle->transferSize, 0, sizeof(handle->transferSize)); - - handle->queueUser = 0U; - handle->queueDriver = 0U; -} - -/*! - * brief Terminate all SAI receive. - * - * This function will clear all transfer slots buffered in the sai queue. If users only want to abort the - * current transfer slot, please call SAI_TransferAbortReceive. - * - * param base SAI base pointer. - * param handle SAI eDMA handle pointer. - */ -void SAI_TransferTerminateReceive(I2S_Type *base, sai_handle_t *handle) -{ - assert(handle != NULL); - - /* Abort the current transfer */ - SAI_TransferAbortReceive(base, handle); - - /* Clear all the internal information */ - (void)memset(handle->saiQueue, 0, sizeof(handle->saiQueue)); - (void)memset(handle->transferSize, 0, sizeof(handle->transferSize)); - - handle->queueUser = 0U; - handle->queueDriver = 0U; -} - -/*! - * brief Tx interrupt handler. - * - * param base SAI base pointer. - * param handle Pointer to the sai_handle_t structure. - */ -void SAI_TransferTxHandleIRQ(I2S_Type *base, sai_handle_t *handle) -{ - assert(handle != NULL); - - uint8_t *buffer = handle->saiQueue[handle->queueDriver].data; - uint32_t dataSize = (handle->bitWidth / 8UL) * handle->channelNums; - - /* Handle Error */ - if (IS_SAI_FLAG_SET(base->TCSR, I2S_TCSR_FEF_MASK)) - { - /* Clear FIFO error flag to continue transfer */ - SAI_TxClearStatusFlags(base, I2S_TCSR_FEF_MASK); - - /* Reset FIFO for safety */ - SAI_TxSoftwareReset(base, kSAI_ResetTypeFIFO); - - /* Call the callback */ - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_SAI_TxError, handle->userData); - } - } - -/* Handle transfer */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if (IS_SAI_FLAG_SET(base->TCSR, I2S_TCSR_FRF_MASK)) - { - /* Judge if the data need to transmit is less than space */ - size_t size = MIN((handle->saiQueue[handle->queueDriver].dataSize), - (size_t)(((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base) - handle->watermark) * dataSize)); - - /* Copy the data from sai buffer to FIFO */ - SAI_WriteNonBlocking(base, handle->channel, handle->channelMask, handle->endChannel, handle->bitWidth, buffer, - size); - - /* Update the internal counter */ - handle->saiQueue[handle->queueDriver].dataSize -= size; - handle->saiQueue[handle->queueDriver].data = (uint8_t *)((uintptr_t)buffer + size); - } -#else - if (IS_SAI_FLAG_SET(base->TCSR, I2S_TCSR_FWF_MASK)) - { - size_t size = MIN((handle->saiQueue[handle->queueDriver].dataSize), dataSize); - - SAI_WriteNonBlocking(base, handle->channel, handle->channelMask, handle->endChannel, handle->bitWidth, buffer, - size); - - /* Update internal counter */ - handle->saiQueue[handle->queueDriver].dataSize -= size; - handle->saiQueue[handle->queueDriver].data = (uint8_t *)((uintptr_t)buffer + size); - } -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ - - /* If finished a block, call the callback function */ - if (handle->saiQueue[handle->queueDriver].dataSize == 0U) - { - (void)memset(&handle->saiQueue[handle->queueDriver], 0, sizeof(sai_transfer_t)); - handle->queueDriver = (handle->queueDriver + 1U) % (uint8_t)SAI_XFER_QUEUE_SIZE; - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_SAI_TxIdle, handle->userData); - } - } - - /* If all data finished, just stop the transfer */ - if (handle->saiQueue[handle->queueDriver].data == NULL) - { - SAI_TransferAbortSend(base, handle); - } -} - -/*! - * brief Tx interrupt handler. - * - * param base SAI base pointer. - * param handle Pointer to the sai_handle_t structure. - */ -void SAI_TransferRxHandleIRQ(I2S_Type *base, sai_handle_t *handle) -{ - assert(handle != NULL); - - uint8_t *buffer = handle->saiQueue[handle->queueDriver].data; - uint32_t dataSize = (handle->bitWidth / 8UL) * handle->channelNums; - - /* Handle Error */ - if (IS_SAI_FLAG_SET(base->RCSR, I2S_RCSR_FEF_MASK)) - { - /* Clear FIFO error flag to continue transfer */ - SAI_RxClearStatusFlags(base, I2S_TCSR_FEF_MASK); - - /* Reset FIFO for safety */ - SAI_RxSoftwareReset(base, kSAI_ResetTypeFIFO); - - /* Call the callback */ - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_SAI_RxError, handle->userData); - } - } - -/* Handle transfer */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if (IS_SAI_FLAG_SET(base->RCSR, I2S_RCSR_FRF_MASK)) - { - /* Judge if the data need to transmit is less than space */ - size_t size = MIN((handle->saiQueue[handle->queueDriver].dataSize), handle->watermark * dataSize); - - /* Copy the data from sai buffer to FIFO */ - SAI_ReadNonBlocking(base, handle->channel, handle->channelMask, handle->endChannel, handle->bitWidth, buffer, - size); - - /* Update the internal counter */ - handle->saiQueue[handle->queueDriver].dataSize -= size; - handle->saiQueue[handle->queueDriver].data = (uint8_t *)((uintptr_t)buffer + size); - } -#else - if (IS_SAI_FLAG_SET(base->RCSR, I2S_RCSR_FWF_MASK)) - { - size_t size = MIN((handle->saiQueue[handle->queueDriver].dataSize), dataSize); - - SAI_ReadNonBlocking(base, handle->channel, handle->channelMask, handle->endChannel, handle->bitWidth, buffer, - size); - - /* Update internal state */ - handle->saiQueue[handle->queueDriver].dataSize -= size; - handle->saiQueue[handle->queueDriver].data = (uint8_t *)((uintptr_t)buffer + size); - } -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ - - /* If finished a block, call the callback function */ - if (handle->saiQueue[handle->queueDriver].dataSize == 0U) - { - (void)memset(&handle->saiQueue[handle->queueDriver], 0, sizeof(sai_transfer_t)); - handle->queueDriver = (handle->queueDriver + 1U) % (uint8_t)SAI_XFER_QUEUE_SIZE; - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_SAI_RxIdle, handle->userData); - } - } - - /* If all data finished, just stop the transfer */ - if (handle->saiQueue[handle->queueDriver].data == NULL) - { - SAI_TransferAbortReceive(base, handle); - } -} - -#if defined(I2S0) -void I2S0_DriverIRQHandler(void); -void I2S0_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[0][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S0, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[0][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S0, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(I2S0, s_saiHandle[0][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[0][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S0, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[0][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S0, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(I2S0, s_saiHandle[0][0]); - } - SDK_ISR_EXIT_BARRIER; -} - -void I2S0_Tx_DriverIRQHandler(void); -void I2S0_Tx_DriverIRQHandler(void) -{ - assert(s_saiHandle[0][0] != NULL); - s_saiTxIsr(I2S0, s_saiHandle[0][0]); - SDK_ISR_EXIT_BARRIER; -} - -void I2S0_Rx_DriverIRQHandler(void); -void I2S0_Rx_DriverIRQHandler(void) -{ - assert(s_saiHandle[0][1] != NULL); - s_saiRxIsr(I2S0, s_saiHandle[0][1]); - SDK_ISR_EXIT_BARRIER; -} -#endif /* I2S0*/ - -#if defined(I2S1) -void I2S1_DriverIRQHandler(void); -void I2S1_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S1, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S1, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(I2S1, s_saiHandle[1][1]); - } - -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S1, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S1, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(I2S1, s_saiHandle[1][0]); - } - SDK_ISR_EXIT_BARRIER; -} - -void I2S1_Tx_DriverIRQHandler(void); -void I2S1_Tx_DriverIRQHandler(void) -{ - assert(s_saiHandle[1][0] != NULL); - s_saiTxIsr(I2S1, s_saiHandle[1][0]); - SDK_ISR_EXIT_BARRIER; -} - -void I2S1_Rx_DriverIRQHandler(void); -void I2S1_Rx_DriverIRQHandler(void) -{ - assert(s_saiHandle[1][1] != NULL); - s_saiRxIsr(I2S1, s_saiHandle[1][1]); - SDK_ISR_EXIT_BARRIER; -} -#endif /* I2S1*/ - -#if defined(I2S2) -void I2S2_DriverIRQHandler(void); -void I2S2_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[2][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S2, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[2][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S2, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(I2S2, s_saiHandle[2][1]); - } - -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[2][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S2, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[2][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S2, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(I2S2, s_saiHandle[2][0]); - } - SDK_ISR_EXIT_BARRIER; -} - -void I2S2_Tx_DriverIRQHandler(void); -void I2S2_Tx_DriverIRQHandler(void) -{ - assert(s_saiHandle[2][0] != NULL); - s_saiTxIsr(I2S2, s_saiHandle[2][0]); - SDK_ISR_EXIT_BARRIER; -} - -void I2S2_Rx_DriverIRQHandler(void); -void I2S2_Rx_DriverIRQHandler(void) -{ - assert(s_saiHandle[2][1] != NULL); - s_saiRxIsr(I2S2, s_saiHandle[2][1]); - SDK_ISR_EXIT_BARRIER; -} -#endif /* I2S2*/ - -#if defined(I2S3) -void I2S3_DriverIRQHandler(void); -void I2S3_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[3][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S3, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[3][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S3, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(I2S3, s_saiHandle[3][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[3][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S3, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[3][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S3, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(I2S3, s_saiHandle[3][0]); - } - SDK_ISR_EXIT_BARRIER; -} - -void I2S3_Tx_DriverIRQHandler(void); -void I2S3_Tx_DriverIRQHandler(void) -{ - assert(s_saiHandle[3][0] != NULL); - s_saiTxIsr(I2S3, s_saiHandle[3][0]); - SDK_ISR_EXIT_BARRIER; -} - -void I2S3_Rx_DriverIRQHandler(void); -void I2S3_Rx_DriverIRQHandler(void) -{ - assert(s_saiHandle[3][1] != NULL); - s_saiRxIsr(I2S3, s_saiHandle[3][1]); - SDK_ISR_EXIT_BARRIER; -} -#endif /* I2S3*/ - -#if defined(I2S4) -void I2S4_DriverIRQHandler(void); -void I2S4_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[4][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S4, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[4][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S4, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(I2S4, s_saiHandle[4][1]); - } - -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[4][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S4, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[4][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S4, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(I2S4, s_saiHandle[4][0]); - } - SDK_ISR_EXIT_BARRIER; -} - -void I2S4_Tx_DriverIRQHandler(void); -void I2S4_Tx_DriverIRQHandler(void) -{ - assert(s_saiHandle[4][0] != NULL); - s_saiTxIsr(I2S4, s_saiHandle[4][0]); - SDK_ISR_EXIT_BARRIER; -} - -void I2S4_Rx_DriverIRQHandler(void); -void I2S4_Rx_DriverIRQHandler(void) -{ - assert(s_saiHandle[4][1] != NULL); - s_saiRxIsr(I2S4, s_saiHandle[4][1]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(FSL_FEATURE_SAI_SAI5_SAI6_SHARE_IRQ) && (FSL_FEATURE_SAI_SAI5_SAI6_SHARE_IRQ) && defined(I2S5) && \ - defined(I2S6) -void I2S56_DriverIRQHandler(void); -void I2S56_DriverIRQHandler(void) -{ - /* use index 5 to get handle when I2S5 & I2S6 share IRQ NUMBER */ - I2S_Type *base = s_saiHandle[5][1]->base; -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[5][1] != NULL) && SAI_RxGetEnabledInterruptStatus(base, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[5][1] != NULL) && SAI_RxGetEnabledInterruptStatus(base, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(base, s_saiHandle[5][1]); - } - - base = s_saiHandle[5][0]->base; -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[5][0] != NULL) && SAI_TxGetEnabledInterruptStatus(base, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[5][0] != NULL) && SAI_TxGetEnabledInterruptStatus(base, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(base, s_saiHandle[5][0]); - } - SDK_ISR_EXIT_BARRIER; -} - -void I2S56_Tx_DriverIRQHandler(void); -void I2S56_Tx_DriverIRQHandler(void) -{ - /* use index 5 to get handle when I2S5 & I2S6 share IRQ NUMBER */ - assert(s_saiHandle[5][0] != NULL); - s_saiTxIsr(s_saiHandle[5][0]->base, s_saiHandle[5][0]); - SDK_ISR_EXIT_BARRIER; -} - -void I2S56_Rx_DriverIRQHandler(void); -void I2S56_Rx_DriverIRQHandler(void) -{ - /* use index 5 to get handle when I2S5 & I2S6 share IRQ NUMBER */ - assert(s_saiHandle[5][1] != NULL); - s_saiRxIsr(s_saiHandle[5][1]->base, s_saiHandle[5][1]); - SDK_ISR_EXIT_BARRIER; -} - -#else - -#if defined(I2S5) -void I2S5_DriverIRQHandler(void); -void I2S5_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[5][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S5, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[5][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S5, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(I2S5, s_saiHandle[5][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[5][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S5, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[5][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S5, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(I2S5, s_saiHandle[5][0]); - } - SDK_ISR_EXIT_BARRIER; -} - -void I2S5_Tx_DriverIRQHandler(void); -void I2S5_Tx_DriverIRQHandler(void) -{ - assert(s_saiHandle[5][0] != NULL); - s_saiTxIsr(I2S5, s_saiHandle[5][0]); - SDK_ISR_EXIT_BARRIER; -} - -void I2S5_Rx_DriverIRQHandler(void); -void I2S5_Rx_DriverIRQHandler(void) -{ - assert(s_saiHandle[5][1] != NULL); - s_saiRxIsr(I2S5, s_saiHandle[5][1]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(I2S6) -void I2S6_DriverIRQHandler(void); -void I2S6_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[6][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S6, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[6][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S6, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(I2S6, s_saiHandle[6][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[6][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S6, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[6][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S6, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(I2S6, s_saiHandle[6][0]); - } - SDK_ISR_EXIT_BARRIER; -} - -void I2S6_Tx_DriverIRQHandler(void); -void I2S6_Tx_DriverIRQHandler(void) -{ - assert(s_saiHandle[6][0] != NULL); - s_saiTxIsr(I2S6, s_saiHandle[6][0]); - SDK_ISR_EXIT_BARRIER; -} - -void I2S6_Rx_DriverIRQHandler(void); -void I2S6_Rx_DriverIRQHandler(void) -{ - assert(s_saiHandle[6][1] != NULL); - s_saiRxIsr(I2S6, s_saiHandle[6][1]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(AUDIO__SAI0) -void AUDIO_SAI0_INT_DriverIRQHandler(void); -void AUDIO_SAI0_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[0][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI0, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[0][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI0, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(AUDIO__SAI0, s_saiHandle[0][1]); - } - -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[0][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI0, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[0][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI0, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(AUDIO__SAI0, s_saiHandle[0][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* AUDIO__SAI0 */ - -#if defined(AUDIO__SAI1) -void AUDIO_SAI1_INT_DriverIRQHandler(void); -void AUDIO_SAI1_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI1, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI1, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(AUDIO__SAI1, s_saiHandle[1][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI1, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI1, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(AUDIO__SAI1, s_saiHandle[1][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* AUDIO__SAI1 */ - -#if defined(AUDIO__SAI2) -void AUDIO_SAI2_INT_DriverIRQHandler(void); -void AUDIO_SAI2_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[2][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI2, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[2][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI2, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(AUDIO__SAI2, s_saiHandle[2][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[2][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI2, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[2][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI2, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(AUDIO__SAI2, s_saiHandle[2][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* AUDIO__SAI2 */ - -#if defined(AUDIO__SAI3) -void AUDIO_SAI3_INT_DriverIRQHandler(void); -void AUDIO_SAI3_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[3][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI3, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[3][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI3, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(AUDIO__SAI3, s_saiHandle[3][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[3][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI3, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[3][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI3, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(AUDIO__SAI3, s_saiHandle[3][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(AUDIO__SAI6) -void AUDIO_SAI6_INT_DriverIRQHandler(void); -void AUDIO_SAI6_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[6][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI6, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[6][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI6, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(AUDIO__SAI6, s_saiHandle[6][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[6][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI6, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[6][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI6, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(AUDIO__SAI6, s_saiHandle[6][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* AUDIO__SAI6 */ - -#if defined(AUDIO__SAI7) -void AUDIO_SAI7_INT_DriverIRQHandler(void); -void AUDIO_SAI7_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[7][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI7, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[7][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI7, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(AUDIO__SAI7, s_saiHandle[7][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[7][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI7, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[7][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI7, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(AUDIO__SAI7, s_saiHandle[7][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* AUDIO__SAI7 */ - -#if defined(ADMA__SAI0) -void ADMA_SAI0_INT_DriverIRQHandler(void); -void ADMA_SAI0_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI0, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI0, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(ADMA__SAI0, s_saiHandle[1][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI0, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI0, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(ADMA__SAI0, s_saiHandle[1][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* ADMA__SAI0 */ - -#if defined(ADMA__SAI1) -void ADMA_SAI1_INT_DriverIRQHandler(void); -void ADMA_SAI1_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI1, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI1, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(ADMA__SAI1, s_saiHandle[1][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI1, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI1, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(ADMA__SAI1, s_saiHandle[1][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* ADMA__SAI1 */ - -#if defined(ADMA__SAI2) -void ADMA_SAI2_INT_DriverIRQHandler(void); -void ADMA_SAI2_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI2, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI2, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(ADMA__SAI2, s_saiHandle[1][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI2, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI2, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(ADMA__SAI2, s_saiHandle[1][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* ADMA__SAI2 */ - -#if defined(ADMA__SAI3) -void ADMA_SAI3_INT_DriverIRQHandler(void); -void ADMA_SAI3_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI3, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI3, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(ADMA__SAI3, s_saiHandle[1][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI3, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI3, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(ADMA__SAI3, s_saiHandle[1][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* ADMA__SAI3 */ - -#if defined(ADMA__SAI4) -void ADMA_SAI4_INT_DriverIRQHandler(void); -void ADMA_SAI4_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI4, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI4, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(ADMA__SAI4, s_saiHandle[1][1]); - } - -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI4, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI4, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(ADMA__SAI4, s_saiHandle[1][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* ADMA__SAI4 */ - -#if defined(ADMA__SAI5) -void ADMA_SAI5_INT_DriverIRQHandler(void); -void ADMA_SAI5_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI5, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI5, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(ADMA__SAI5, s_saiHandle[1][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI5, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI5, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(ADMA__SAI5, s_saiHandle[1][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* ADMA__SAI5 */ - -#if defined(SAI0) -void SAI0_DriverIRQHandler(void); -void SAI0_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[0][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI0, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[0][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI0, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(SAI0, s_saiHandle[0][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[0][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI0, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[0][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI0, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(SAI0, s_saiHandle[0][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* SAI0 */ - -#if defined(SAI1) -void SAI1_DriverIRQHandler(void); -void SAI1_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI1, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI1, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(SAI1, s_saiHandle[1][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI1, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI1, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(SAI1, s_saiHandle[1][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* SAI1 */ - -#if defined(SAI2) -void SAI2_DriverIRQHandler(void); -void SAI2_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[2][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI2, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[2][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI2, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(SAI2, s_saiHandle[2][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[2][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI2, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[2][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI2, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(SAI2, s_saiHandle[2][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* SAI2 */ - -#if defined(SAI3) -void SAI3_DriverIRQHandler(void); -void SAI3_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[3][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI3, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[3][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI3, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(SAI3, s_saiHandle[3][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[3][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI3, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[3][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI3, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(SAI3, s_saiHandle[3][0]); - } - SDK_ISR_EXIT_BARRIER; -} - -void SAI3_TX_DriverIRQHandler(void); -void SAI3_TX_DriverIRQHandler(void) -{ - assert(s_saiHandle[3][0] != NULL); - s_saiTxIsr(SAI3, s_saiHandle[3][0]); - SDK_ISR_EXIT_BARRIER; -} - -void SAI3_RX_DriverIRQHandler(void); -void SAI3_RX_DriverIRQHandler(void) -{ - assert(s_saiHandle[3][1] != NULL); - s_saiRxIsr(SAI3, s_saiHandle[3][1]); - SDK_ISR_EXIT_BARRIER; -} -#endif /* SAI3 */ - -#if defined(SAI4) -void SAI4_DriverIRQHandler(void); -void SAI4_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[4][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI4, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[4][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI4, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(SAI4, s_saiHandle[4][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[4][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI4, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[4][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI4, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(SAI4, s_saiHandle[4][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* SAI4 */ - -#if defined(SAI5) -void SAI5_DriverIRQHandler(void); -void SAI5_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[5][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI5, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[5][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI5, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(SAI5, s_saiHandle[5][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[5][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI5, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[5][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI5, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(SAI5, s_saiHandle[5][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* SAI5 */ - -#if defined(SAI6) -void SAI6_DriverIRQHandler(void); -void SAI6_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[6][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI6, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[6][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI6, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(SAI6, s_saiHandle[6][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[6][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI6, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[6][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI6, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(SAI6, s_saiHandle[6][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* SAI6 */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_sai.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_sai.h deleted file mode 100644 index d00f81e98b3..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_sai.h +++ /dev/null @@ -1,1437 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_SAI_H_ -#define FSL_SAI_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup sai_driver SAI Driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -#define FSL_SAI_DRIVER_VERSION (MAKE_VERSION(2, 4, 2)) /*!< Version 2.4.2 */ -/*@}*/ - -/*! @brief _sai_status_t, SAI return status.*/ -enum -{ - kStatus_SAI_TxBusy = MAKE_STATUS(kStatusGroup_SAI, 0), /*!< SAI Tx is busy. */ - kStatus_SAI_RxBusy = MAKE_STATUS(kStatusGroup_SAI, 1), /*!< SAI Rx is busy. */ - kStatus_SAI_TxError = MAKE_STATUS(kStatusGroup_SAI, 2), /*!< SAI Tx FIFO error. */ - kStatus_SAI_RxError = MAKE_STATUS(kStatusGroup_SAI, 3), /*!< SAI Rx FIFO error. */ - kStatus_SAI_QueueFull = MAKE_STATUS(kStatusGroup_SAI, 4), /*!< SAI transfer queue is full. */ - kStatus_SAI_TxIdle = MAKE_STATUS(kStatusGroup_SAI, 5), /*!< SAI Tx is idle */ - kStatus_SAI_RxIdle = MAKE_STATUS(kStatusGroup_SAI, 6) /*!< SAI Rx is idle */ -}; - -/*! @brief _sai_channel_mask,.sai channel mask value, actual channel numbers is depend soc specific */ -enum -{ - kSAI_Channel0Mask = 1 << 0U, /*!< channel 0 mask value */ - kSAI_Channel1Mask = 1 << 1U, /*!< channel 1 mask value */ - kSAI_Channel2Mask = 1 << 2U, /*!< channel 2 mask value */ - kSAI_Channel3Mask = 1 << 3U, /*!< channel 3 mask value */ - kSAI_Channel4Mask = 1 << 4U, /*!< channel 4 mask value */ - kSAI_Channel5Mask = 1 << 5U, /*!< channel 5 mask value */ - kSAI_Channel6Mask = 1 << 6U, /*!< channel 6 mask value */ - kSAI_Channel7Mask = 1 << 7U, /*!< channel 7 mask value */ -}; - -/*! @brief Define the SAI bus type */ -typedef enum _sai_protocol -{ - kSAI_BusLeftJustified = 0x0U, /*!< Uses left justified format.*/ - kSAI_BusRightJustified, /*!< Uses right justified format. */ - kSAI_BusI2S, /*!< Uses I2S format. */ - kSAI_BusPCMA, /*!< Uses I2S PCM A format.*/ - kSAI_BusPCMB /*!< Uses I2S PCM B format. */ -} sai_protocol_t; - -/*! @brief Master or slave mode */ -typedef enum _sai_master_slave -{ - kSAI_Master = 0x0U, /*!< Master mode include bclk and frame sync */ - kSAI_Slave = 0x1U, /*!< Slave mode include bclk and frame sync */ - kSAI_Bclk_Master_FrameSync_Slave = 0x2U, /*!< bclk in master mode, frame sync in slave mode */ - kSAI_Bclk_Slave_FrameSync_Master = 0x3U, /*!< bclk in slave mode, frame sync in master mode */ -} sai_master_slave_t; - -/*! @brief Mono or stereo audio format */ -typedef enum _sai_mono_stereo -{ - kSAI_Stereo = 0x0U, /*!< Stereo sound. */ - kSAI_MonoRight, /*!< Only Right channel have sound. */ - kSAI_MonoLeft /*!< Only left channel have sound. */ -} sai_mono_stereo_t; - -/*! @brief SAI data order, MSB or LSB */ -typedef enum _sai_data_order -{ - kSAI_DataLSB = 0x0U, /*!< LSB bit transferred first */ - kSAI_DataMSB /*!< MSB bit transferred first */ -} sai_data_order_t; - -/*! @brief SAI clock polarity, active high or low */ -typedef enum _sai_clock_polarity -{ - kSAI_PolarityActiveHigh = 0x0U, /*!< Drive outputs on rising edge */ - kSAI_PolarityActiveLow = 0x1U, /*!< Drive outputs on falling edge */ - kSAI_SampleOnFallingEdge = 0x0U, /*!< Sample inputs on falling edge */ - kSAI_SampleOnRisingEdge = 0x1U, /*!< Sample inputs on rising edge */ -} sai_clock_polarity_t; - -/*! @brief Synchronous or asynchronous mode */ -typedef enum _sai_sync_mode -{ - kSAI_ModeAsync = 0x0U, /*!< Asynchronous mode */ - kSAI_ModeSync, /*!< Synchronous mode (with receiver or transmit) */ -#if defined(FSL_FEATURE_SAI_HAS_SYNC_WITH_ANOTHER_SAI) && (FSL_FEATURE_SAI_HAS_SYNC_WITH_ANOTHER_SAI) - kSAI_ModeSyncWithOtherTx, /*!< Synchronous with another SAI transmit */ - kSAI_ModeSyncWithOtherRx /*!< Synchronous with another SAI receiver */ -#endif /* FSL_FEATURE_SAI_HAS_SYNC_WITH_ANOTHER_SAI */ -} sai_sync_mode_t; - -#if !(defined(FSL_FEATURE_SAI_HAS_NO_MCR_MICS) && (FSL_FEATURE_SAI_HAS_NO_MCR_MICS)) -/*! @brief Mater clock source */ -typedef enum _sai_mclk_source -{ - kSAI_MclkSourceSysclk = 0x0U, /*!< Master clock from the system clock */ - kSAI_MclkSourceSelect1, /*!< Master clock from source 1 */ - kSAI_MclkSourceSelect2, /*!< Master clock from source 2 */ - kSAI_MclkSourceSelect3 /*!< Master clock from source 3 */ -} sai_mclk_source_t; -#endif - -/*! @brief Bit clock source */ -typedef enum _sai_bclk_source -{ - kSAI_BclkSourceBusclk = 0x0U, /*!< Bit clock using bus clock */ - /* General device bit source definition */ - kSAI_BclkSourceMclkOption1 = 0x1U, /*!< Bit clock MCLK option 1 */ - kSAI_BclkSourceMclkOption2 = 0x2U, /*!< Bit clock MCLK option2 */ - kSAI_BclkSourceMclkOption3 = 0x3U, /*!< Bit clock MCLK option3 */ - /* Kinetis device bit clock source definition */ - kSAI_BclkSourceMclkDiv = 0x1U, /*!< Bit clock using master clock divider */ - kSAI_BclkSourceOtherSai0 = 0x2U, /*!< Bit clock from other SAI device */ - kSAI_BclkSourceOtherSai1 = 0x3U /*!< Bit clock from other SAI device */ -} sai_bclk_source_t; - -/*! @brief _sai_interrupt_enable_t, The SAI interrupt enable flag */ -enum -{ - kSAI_WordStartInterruptEnable = - I2S_TCSR_WSIE_MASK, /*!< Word start flag, means the first word in a frame detected */ - kSAI_SyncErrorInterruptEnable = I2S_TCSR_SEIE_MASK, /*!< Sync error flag, means the sync error is detected */ - kSAI_FIFOWarningInterruptEnable = I2S_TCSR_FWIE_MASK, /*!< FIFO warning flag, means the FIFO is empty */ - kSAI_FIFOErrorInterruptEnable = I2S_TCSR_FEIE_MASK, /*!< FIFO error flag */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - kSAI_FIFORequestInterruptEnable = I2S_TCSR_FRIE_MASK, /*!< FIFO request, means reached watermark */ -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ -}; - -/*! @brief _sai_dma_enable_t, The DMA request sources */ -enum -{ - kSAI_FIFOWarningDMAEnable = I2S_TCSR_FWDE_MASK, /*!< FIFO warning caused by the DMA request */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - kSAI_FIFORequestDMAEnable = I2S_TCSR_FRDE_MASK, /*!< FIFO request caused by the DMA request */ -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ -}; - -/*! @brief _sai_flags, The SAI status flag */ -enum -{ - kSAI_WordStartFlag = I2S_TCSR_WSF_MASK, /*!< Word start flag, means the first word in a frame detected */ - kSAI_SyncErrorFlag = I2S_TCSR_SEF_MASK, /*!< Sync error flag, means the sync error is detected */ - kSAI_FIFOErrorFlag = I2S_TCSR_FEF_MASK, /*!< FIFO error flag */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - kSAI_FIFORequestFlag = I2S_TCSR_FRF_MASK, /*!< FIFO request flag. */ -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ - kSAI_FIFOWarningFlag = I2S_TCSR_FWF_MASK, /*!< FIFO warning flag */ -}; - -/*! @brief The reset type */ -typedef enum _sai_reset_type -{ - kSAI_ResetTypeSoftware = I2S_TCSR_SR_MASK, /*!< Software reset, reset the logic state */ - kSAI_ResetTypeFIFO = I2S_TCSR_FR_MASK, /*!< FIFO reset, reset the FIFO read and write pointer */ - kSAI_ResetAll = I2S_TCSR_SR_MASK | I2S_TCSR_FR_MASK /*!< All reset. */ -} sai_reset_type_t; - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_PACKING) && FSL_FEATURE_SAI_HAS_FIFO_PACKING -/*! - * @brief The SAI packing mode - * The mode includes 8 bit and 16 bit packing. - */ -typedef enum _sai_fifo_packing -{ - kSAI_FifoPackingDisabled = 0x0U, /*!< Packing disabled */ - kSAI_FifoPacking8bit = 0x2U, /*!< 8 bit packing enabled */ - kSAI_FifoPacking16bit = 0x3U /*!< 16bit packing enabled */ -} sai_fifo_packing_t; -#endif /* FSL_FEATURE_SAI_HAS_FIFO_PACKING */ - -/*! @brief SAI user configuration structure */ -typedef struct _sai_config -{ - sai_protocol_t protocol; /*!< Audio bus protocol in SAI */ - sai_sync_mode_t syncMode; /*!< SAI sync mode, control Tx/Rx clock sync */ -#if defined(FSL_FEATURE_SAI_HAS_MCR) && (FSL_FEATURE_SAI_HAS_MCR) - bool mclkOutputEnable; /*!< Master clock output enable, true means master clock divider enabled */ -#if !(defined(FSL_FEATURE_SAI_HAS_NO_MCR_MICS) && (FSL_FEATURE_SAI_HAS_NO_MCR_MICS)) - sai_mclk_source_t mclkSource; /*!< Master Clock source */ -#endif /* FSL_FEATURE_SAI_HAS_MCR */ -#endif - sai_bclk_source_t bclkSource; /*!< Bit Clock source */ - sai_master_slave_t masterSlave; /*!< Master or slave */ -} sai_config_t; - -#ifndef SAI_XFER_QUEUE_SIZE -/*!@brief SAI transfer queue size, user can refine it according to use case. */ -#define SAI_XFER_QUEUE_SIZE (4U) -#endif - -/*! @brief Audio sample rate */ -typedef enum _sai_sample_rate -{ - kSAI_SampleRate8KHz = 8000U, /*!< Sample rate 8000 Hz */ - kSAI_SampleRate11025Hz = 11025U, /*!< Sample rate 11025 Hz */ - kSAI_SampleRate12KHz = 12000U, /*!< Sample rate 12000 Hz */ - kSAI_SampleRate16KHz = 16000U, /*!< Sample rate 16000 Hz */ - kSAI_SampleRate22050Hz = 22050U, /*!< Sample rate 22050 Hz */ - kSAI_SampleRate24KHz = 24000U, /*!< Sample rate 24000 Hz */ - kSAI_SampleRate32KHz = 32000U, /*!< Sample rate 32000 Hz */ - kSAI_SampleRate44100Hz = 44100U, /*!< Sample rate 44100 Hz */ - kSAI_SampleRate48KHz = 48000U, /*!< Sample rate 48000 Hz */ - kSAI_SampleRate96KHz = 96000U, /*!< Sample rate 96000 Hz */ - kSAI_SampleRate192KHz = 192000U, /*!< Sample rate 192000 Hz */ - kSAI_SampleRate384KHz = 384000U, /*!< Sample rate 384000 Hz */ -} sai_sample_rate_t; - -/*! @brief Audio word width */ -typedef enum _sai_word_width -{ - kSAI_WordWidth8bits = 8U, /*!< Audio data width 8 bits */ - kSAI_WordWidth16bits = 16U, /*!< Audio data width 16 bits */ - kSAI_WordWidth24bits = 24U, /*!< Audio data width 24 bits */ - kSAI_WordWidth32bits = 32U /*!< Audio data width 32 bits */ -} sai_word_width_t; - -#if defined(FSL_FEATURE_SAI_HAS_CHANNEL_MODE) && FSL_FEATURE_SAI_HAS_CHANNEL_MODE -/*! @brief sai data pin state definition */ -typedef enum _sai_data_pin_state -{ - kSAI_DataPinStateTriState = - 0U, /*!< transmit data pins are tri-stated when slots are masked or channels are disabled */ - kSAI_DataPinStateOutputZero = 1U, /*!< transmit data pins are never tri-stated and will output zero when slots - are masked or channel disabled */ -} sai_data_pin_state_t; -#endif - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE -/*! @brief sai fifo combine mode definition */ -typedef enum _sai_fifo_combine -{ - kSAI_FifoCombineDisabled = 0U, /*!< sai fifo combine mode disabled */ - kSAI_FifoCombineModeEnabledOnRead, /*!< sai fifo combine mode enabled on FIFO reads */ - kSAI_FifoCombineModeEnabledOnWrite, /*!< sai fifo combine mode enabled on FIFO write */ - kSAI_FifoCombineModeEnabledOnReadWrite, /*!< sai fifo combined mode enabled on FIFO read/writes */ -} sai_fifo_combine_t; -#endif - -/*! @brief sai transceiver type */ -typedef enum _sai_transceiver_type -{ - kSAI_Transmitter = 0U, /*!< sai transmitter */ - kSAI_Receiver = 1U, /*!< sai receiver */ -} sai_transceiver_type_t; - -/*! @brief sai frame sync len */ -typedef enum _sai_frame_sync_len -{ - kSAI_FrameSyncLenOneBitClk = 0U, /*!< 1 bit clock frame sync len for DSP mode */ - kSAI_FrameSyncLenPerWordWidth = 1U, /*!< Frame sync length decided by word width */ -} sai_frame_sync_len_t; - -/*! @brief sai transfer format */ -typedef struct _sai_transfer_format -{ - uint32_t sampleRate_Hz; /*!< Sample rate of audio data */ - uint32_t bitWidth; /*!< Data length of audio data, usually 8/16/24/32 bits */ - sai_mono_stereo_t stereo; /*!< Mono or stereo */ -#if defined(FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) && (FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) - uint32_t masterClockHz; /*!< Master clock frequency in Hz */ -#endif /* FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - uint8_t watermark; /*!< Watermark value */ -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ - - /* for the multi channel usage, user can provide channelMask Oonly, then sai driver will handle - * other parameter carefully, such as - * channelMask = kSAI_Channel0Mask | kSAI_Channel1Mask | kSAI_Channel4Mask - * then in SAI_RxSetFormat/SAI_TxSetFormat function, channel/endChannel/channelNums will be calculated. - * for the single channel usage, user can provide channel or channel mask only, such as, - * channel = 0 or channelMask = kSAI_Channel0Mask. - */ - uint8_t channel; /*!< Transfer start channel */ - uint8_t channelMask; /*!< enabled channel mask value, reference _sai_channel_mask */ - uint8_t endChannel; /*!< end channel number */ - uint8_t channelNums; /*!< Total enabled channel numbers */ - - sai_protocol_t protocol; /*!< Which audio protocol used */ - bool isFrameSyncCompact; /*!< True means Frame sync length is configurable according to bitWidth, false means frame - sync length is 64 times of bit clock. */ -} sai_transfer_format_t; - -#if (defined(FSL_FEATURE_SAI_HAS_MCR) && (FSL_FEATURE_SAI_HAS_MCR)) || \ - (defined(FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) && (FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER)) -/*! @brief master clock configurations */ -typedef struct _sai_master_clock -{ -#if defined(FSL_FEATURE_SAI_HAS_MCR) && (FSL_FEATURE_SAI_HAS_MCR) - bool mclkOutputEnable; /*!< master clock output enable */ -#if !(defined(FSL_FEATURE_SAI_HAS_NO_MCR_MICS) && (FSL_FEATURE_SAI_HAS_NO_MCR_MICS)) - sai_mclk_source_t mclkSource; /*!< Master Clock source */ -#endif -#endif - -#if (defined(FSL_FEATURE_SAI_HAS_MCR) && (FSL_FEATURE_SAI_HAS_MCR)) || \ - (defined(FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) && (FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER)) - uint32_t mclkHz; /*!< target mclk frequency */ - uint32_t mclkSourceClkHz; /*!< mclk source frequency*/ -#endif -} sai_master_clock_t; -#endif - -/*! @brief sai fifo feature*/ -#if (defined(FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) && FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) || \ - (defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) || \ - (defined(FSL_FEATURE_SAI_HAS_FIFO_PACKING) && FSL_FEATURE_SAI_HAS_FIFO_PACKING) || \ - (defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO)) -#define FSL_SAI_HAS_FIFO_EXTEND_FEATURE 1 -#else -#define FSL_SAI_HAS_FIFO_EXTEND_FEATURE 0 -#endif - -#if FSL_SAI_HAS_FIFO_EXTEND_FEATURE -/*! @brief sai fifo configurations */ -typedef struct _sai_fifo -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) && FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR - bool fifoContinueOneError; /*!< fifo continues when error occur */ -#endif - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE - sai_fifo_combine_t fifoCombine; /*!< fifo combine mode */ -#endif - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_PACKING) && FSL_FEATURE_SAI_HAS_FIFO_PACKING - sai_fifo_packing_t fifoPacking; /*!< fifo packing mode */ -#endif -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - uint8_t fifoWatermark; /*!< fifo watermark */ -#endif -} sai_fifo_t; -#endif - -/*! @brief sai bit clock configurations */ -typedef struct _sai_bit_clock -{ - bool bclkSrcSwap; /*!< bit clock source swap */ - bool bclkInputDelay; /*!< bit clock actually used by the transmitter is delayed by the pad output delay, - this has effect of decreasing the data input setup time, but increasing the data output valid - time .*/ - sai_clock_polarity_t bclkPolarity; /*!< bit clock polarity */ - sai_bclk_source_t bclkSource; /*!< bit Clock source */ -} sai_bit_clock_t; - -/*! @brief sai frame sync configurations */ -typedef struct _sai_frame_sync -{ - uint8_t frameSyncWidth; /*!< frame sync width in number of bit clocks */ - bool frameSyncEarly; /*!< TRUE is frame sync assert one bit before the first bit of frame - FALSE is frame sync assert with the first bit of the frame */ - -#if defined(FSL_FEATURE_SAI_HAS_ON_DEMAND_MODE) && FSL_FEATURE_SAI_HAS_ON_DEMAND_MODE - bool frameSyncGenerateOnDemand; /*!< internal frame sync is generated when FIFO waring flag is clear */ -#endif - - sai_clock_polarity_t frameSyncPolarity; /*!< frame sync polarity */ - -} sai_frame_sync_t; - -/*! @brief sai serial data configurations */ -typedef struct _sai_serial_data -{ -#if defined(FSL_FEATURE_SAI_HAS_CHANNEL_MODE) && FSL_FEATURE_SAI_HAS_CHANNEL_MODE - sai_data_pin_state_t dataMode; /*!< sai data pin state when slots masked or channel disabled */ -#endif - - sai_data_order_t dataOrder; /*!< configure whether the LSB or MSB is transmitted first */ - uint8_t dataWord0Length; /*!< configure the number of bits in the first word in each frame */ - uint8_t dataWordNLength; /*!< configure the number of bits in the each word in each frame, except the first word */ - uint8_t dataWordLength; /*!< used to record the data length for dma transfer */ - uint8_t - dataFirstBitShifted; /*!< Configure the bit index for the first bit transmitted for each word in the frame */ - uint8_t dataWordNum; /*!< configure the number of words in each frame */ - uint32_t dataMaskedWord; /*!< configure whether the transmit word is masked */ -} sai_serial_data_t; - -/*! @brief sai transceiver configurations */ -typedef struct _sai_transceiver -{ - sai_serial_data_t serialData; /*!< serial data configurations */ - sai_frame_sync_t frameSync; /*!< ws configurations */ - sai_bit_clock_t bitClock; /*!< bit clock configurations */ -#if FSL_SAI_HAS_FIFO_EXTEND_FEATURE - sai_fifo_t fifo; /*!< fifo configurations */ -#endif - sai_master_slave_t masterSlave; /*!< transceiver is master or slave */ - - sai_sync_mode_t syncMode; /*!< transceiver sync mode */ - - uint8_t startChannel; /*!< Transfer start channel */ - uint8_t channelMask; /*!< enabled channel mask value, reference _sai_channel_mask */ - uint8_t endChannel; /*!< end channel number */ - uint8_t channelNums; /*!< Total enabled channel numbers */ - -} sai_transceiver_t; - -/*! @brief SAI transfer structure */ -typedef struct _sai_transfer -{ - uint8_t *data; /*!< Data start address to transfer. */ - size_t dataSize; /*!< Transfer size. */ -} sai_transfer_t; - -typedef struct _sai_handle sai_handle_t; - -/*! @brief SAI transfer callback prototype */ -typedef void (*sai_transfer_callback_t)(I2S_Type *base, sai_handle_t *handle, status_t status, void *userData); - -/*! @brief SAI handle structure */ -struct _sai_handle -{ - I2S_Type *base; /*!< base address */ - - uint32_t state; /*!< Transfer status */ - sai_transfer_callback_t callback; /*!< Callback function called at transfer event*/ - void *userData; /*!< Callback parameter passed to callback function*/ - uint8_t bitWidth; /*!< Bit width for transfer, 8/16/24/32 bits */ - - /* for the multi channel usage, user can provide channelMask Oonly, then sai driver will handle - * other parameter carefully, such as - * channelMask = kSAI_Channel0Mask | kSAI_Channel1Mask | kSAI_Channel4Mask - * then in SAI_RxSetFormat/SAI_TxSetFormat function, channel/endChannel/channelNums will be calculated. - * for the single channel usage, user can provide channel or channel mask only, such as, - * channel = 0 or channelMask = kSAI_Channel0Mask. - */ - uint8_t channel; /*!< Transfer start channel */ - uint8_t channelMask; /*!< enabled channel mask value, refernece _sai_channel_mask */ - uint8_t endChannel; /*!< end channel number */ - uint8_t channelNums; /*!< Total enabled channel numbers */ - - sai_transfer_t saiQueue[SAI_XFER_QUEUE_SIZE]; /*!< Transfer queue storing queued transfer */ - size_t transferSize[SAI_XFER_QUEUE_SIZE]; /*!< Data bytes need to transfer */ - volatile uint8_t queueUser; /*!< Index for user to queue transfer */ - volatile uint8_t queueDriver; /*!< Index for driver to get the transfer data and size */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - uint8_t watermark; /*!< Watermark value */ -#endif -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus*/ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Initializes the SAI peripheral. - * - * This API gates the SAI clock. The SAI module can't operate unless SAI_Init is called to enable the clock. - * - * @param base SAI base pointer. - */ -void SAI_Init(I2S_Type *base); - -/*! - * @brief De-initializes the SAI peripheral. - * - * This API gates the SAI clock. The SAI module can't operate unless SAI_TxInit - * or SAI_RxInit is called to enable the clock. - * - * @param base SAI base pointer. - */ -void SAI_Deinit(I2S_Type *base); - -/*! - * @brief Resets the SAI Tx. - * - * This function enables the software reset and FIFO reset of SAI Tx. After reset, clear the reset bit. - * - * @param base SAI base pointer - */ -void SAI_TxReset(I2S_Type *base); - -/*! - * @brief Resets the SAI Rx. - * - * This function enables the software reset and FIFO reset of SAI Rx. After reset, clear the reset bit. - * - * @param base SAI base pointer - */ -void SAI_RxReset(I2S_Type *base); - -/*! - * @brief Enables/disables the SAI Tx. - * - * @param base SAI base pointer. - * @param enable True means enable SAI Tx, false means disable. - */ -void SAI_TxEnable(I2S_Type *base, bool enable); - -/*! - * @brief Enables/disables the SAI Rx. - * - * @param base SAI base pointer. - * @param enable True means enable SAI Rx, false means disable. - */ -void SAI_RxEnable(I2S_Type *base, bool enable); - -/*! - * @brief Set Rx bit clock direction. - * - * Select bit clock direction, master or slave. - * - * @param base SAI base pointer. - * @param masterSlave reference sai_master_slave_t. - */ -static inline void SAI_TxSetBitClockDirection(I2S_Type *base, sai_master_slave_t masterSlave) -{ - if (masterSlave == kSAI_Master) - { - base->TCR2 |= I2S_TCR2_BCD_MASK; - } - else - { - base->TCR2 &= ~I2S_TCR2_BCD_MASK; - } -} - -/*! - * @brief Set Rx bit clock direction. - * - * Select bit clock direction, master or slave. - * - * @param base SAI base pointer. - * @param masterSlave reference sai_master_slave_t. - */ -static inline void SAI_RxSetBitClockDirection(I2S_Type *base, sai_master_slave_t masterSlave) -{ - if (masterSlave == kSAI_Master) - { - base->RCR2 |= I2S_RCR2_BCD_MASK; - } - else - { - base->RCR2 &= ~I2S_RCR2_BCD_MASK; - } -} - -/*! - * @brief Set Rx frame sync direction. - * - * Select frame sync direction, master or slave. - * - * @param base SAI base pointer. - * @param masterSlave reference sai_master_slave_t. - */ -static inline void SAI_RxSetFrameSyncDirection(I2S_Type *base, sai_master_slave_t masterSlave) -{ - if (masterSlave == kSAI_Master) - { - base->RCR4 |= I2S_RCR4_FSD_MASK; - } - else - { - base->RCR4 &= ~I2S_RCR4_FSD_MASK; - } -} - -/*! - * @brief Set Tx frame sync direction. - * - * Select frame sync direction, master or slave. - * - * @param base SAI base pointer. - * @param masterSlave reference sai_master_slave_t. - */ -static inline void SAI_TxSetFrameSyncDirection(I2S_Type *base, sai_master_slave_t masterSlave) -{ - if (masterSlave == kSAI_Master) - { - base->TCR4 |= I2S_TCR4_FSD_MASK; - } - else - { - base->TCR4 &= ~I2S_TCR4_FSD_MASK; - } -} - -/*! - * @brief Transmitter bit clock rate configurations. - * - * @param base SAI base pointer. - * @param sourceClockHz Bit clock source frequency. - * @param sampleRate Audio data sample rate. - * @param bitWidth Audio data bitWidth. - * @param channelNumbers Audio channel numbers. - */ -void SAI_TxSetBitClockRate( - I2S_Type *base, uint32_t sourceClockHz, uint32_t sampleRate, uint32_t bitWidth, uint32_t channelNumbers); - -/*! - * @brief Receiver bit clock rate configurations. - * - * @param base SAI base pointer. - * @param sourceClockHz Bit clock source frequency. - * @param sampleRate Audio data sample rate. - * @param bitWidth Audio data bitWidth. - * @param channelNumbers Audio channel numbers. - */ -void SAI_RxSetBitClockRate( - I2S_Type *base, uint32_t sourceClockHz, uint32_t sampleRate, uint32_t bitWidth, uint32_t channelNumbers); - -/*! - * @brief Transmitter Bit clock configurations. - * - * @param base SAI base pointer. - * @param masterSlave master or slave. - * @param config bit clock other configurations, can be NULL in slave mode. - */ -void SAI_TxSetBitclockConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_bit_clock_t *config); - -/*! - * @brief Receiver Bit clock configurations. - * - * @param base SAI base pointer. - * @param masterSlave master or slave. - * @param config bit clock other configurations, can be NULL in slave mode. - */ -void SAI_RxSetBitclockConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_bit_clock_t *config); - -#if (defined(FSL_FEATURE_SAI_HAS_MCR) && (FSL_FEATURE_SAI_HAS_MCR)) || \ - (defined(FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) && (FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER)) -/*! - * @brief Master clock configurations. - * - * @param base SAI base pointer. - * @param config master clock configurations. - */ -void SAI_SetMasterClockConfig(I2S_Type *base, sai_master_clock_t *config); -#endif - -#if FSL_SAI_HAS_FIFO_EXTEND_FEATURE -/*! - * @brief SAI transmitter fifo configurations. - * - * @param base SAI base pointer. - * @param config fifo configurations. - */ -void SAI_TxSetFifoConfig(I2S_Type *base, sai_fifo_t *config); - -/*! - * @brief SAI receiver fifo configurations. - * - * @param base SAI base pointer. - * @param config fifo configurations. - */ -void SAI_RxSetFifoConfig(I2S_Type *base, sai_fifo_t *config); -#endif - -/*! - * @brief SAI transmitter Frame sync configurations. - * - * @param base SAI base pointer. - * @param masterSlave master or slave. - * @param config frame sync configurations, can be NULL in slave mode. - */ -void SAI_TxSetFrameSyncConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_frame_sync_t *config); - -/*! - * @brief SAI receiver Frame sync configurations. - * - * @param base SAI base pointer. - * @param masterSlave master or slave. - * @param config frame sync configurations, can be NULL in slave mode. - */ -void SAI_RxSetFrameSyncConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_frame_sync_t *config); - -/*! - * @brief SAI transmitter Serial data configurations. - * - * @param base SAI base pointer. - * @param config serial data configurations. - */ -void SAI_TxSetSerialDataConfig(I2S_Type *base, sai_serial_data_t *config); - -/*! - * @brief SAI receiver Serial data configurations. - * - * @param base SAI base pointer. - * @param config serial data configurations. - */ -void SAI_RxSetSerialDataConfig(I2S_Type *base, sai_serial_data_t *config); - -/*! - * @brief SAI transmitter configurations. - * - * @param base SAI base pointer. - * @param config transmitter configurations. - */ -void SAI_TxSetConfig(I2S_Type *base, sai_transceiver_t *config); - -/*! - * @brief SAI receiver configurations. - * - * @param base SAI base pointer. - * @param config receiver configurations. - */ -void SAI_RxSetConfig(I2S_Type *base, sai_transceiver_t *config); - -/*! - * @brief Get classic I2S mode configurations. - * - * @param config transceiver configurations. - * @param bitWidth audio data bitWidth. - * @param mode audio data channel. - * @param saiChannelMask mask value of the channel to be enable. - */ -void SAI_GetClassicI2SConfig(sai_transceiver_t *config, - sai_word_width_t bitWidth, - sai_mono_stereo_t mode, - uint32_t saiChannelMask); - -/*! - * @brief Get left justified mode configurations. - * - * @param config transceiver configurations. - * @param bitWidth audio data bitWidth. - * @param mode audio data channel. - * @param saiChannelMask mask value of the channel to be enable. - */ -void SAI_GetLeftJustifiedConfig(sai_transceiver_t *config, - sai_word_width_t bitWidth, - sai_mono_stereo_t mode, - uint32_t saiChannelMask); - -/*! - * @brief Get right justified mode configurations. - * - * @param config transceiver configurations. - * @param bitWidth audio data bitWidth. - * @param mode audio data channel. - * @param saiChannelMask mask value of the channel to be enable. - */ -void SAI_GetRightJustifiedConfig(sai_transceiver_t *config, - sai_word_width_t bitWidth, - sai_mono_stereo_t mode, - uint32_t saiChannelMask); - -/*! - * @brief Get TDM mode configurations. - * - * @param config transceiver configurations. - * @param frameSyncWidth length of frame sync. - * @param bitWidth audio data word width. - * @param dataWordNum word number in one frame. - * @param saiChannelMask mask value of the channel to be enable. - */ -void SAI_GetTDMConfig(sai_transceiver_t *config, - sai_frame_sync_len_t frameSyncWidth, - sai_word_width_t bitWidth, - uint32_t dataWordNum, - uint32_t saiChannelMask); - -/*! - * @brief Get DSP mode configurations. - * - * @note DSP mode is also called PCM mode which support MODE A and MODE B, - * DSP/PCM MODE A configuration flow. RX is similiar but uses SAI_RxSetConfig instead of SAI_TxSetConfig: - * @code - * SAI_GetDSPConfig(config, kSAI_FrameSyncLenOneBitClk, bitWidth, kSAI_Stereo, channelMask) - * config->frameSync.frameSyncEarly = true; - * SAI_TxSetConfig(base, config) - * @endcode - * - * DSP/PCM MODE B configuration flow for TX. RX is similiar but uses SAI_RxSetConfig instead of SAI_TxSetConfig: - * @code - * SAI_GetDSPConfig(config, kSAI_FrameSyncLenOneBitClk, bitWidth, kSAI_Stereo, channelMask) - * SAI_TxSetConfig(base, config) - * @endcode - * - * @param config transceiver configurations. - * @param frameSyncWidth length of frame sync. - * @param bitWidth audio data bitWidth. - * @param mode audio data channel. - * @param saiChannelMask mask value of the channel to enable. - */ -void SAI_GetDSPConfig(sai_transceiver_t *config, - sai_frame_sync_len_t frameSyncWidth, - sai_word_width_t bitWidth, - sai_mono_stereo_t mode, - uint32_t saiChannelMask); -/*! @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets the SAI Tx status flag state. - * - * @param base SAI base pointer - * @return SAI Tx status flag value. Use the Status Mask to get the status value needed. - */ -static inline uint32_t SAI_TxGetStatusFlag(I2S_Type *base) -{ - return base->TCSR; -} - -/*! - * @brief Clears the SAI Tx status flag state. - * - * @param base SAI base pointer - * @param mask State mask. It can be a combination of the following source if defined: - * @arg kSAI_WordStartFlag - * @arg kSAI_SyncErrorFlag - * @arg kSAI_FIFOErrorFlag - */ -static inline void SAI_TxClearStatusFlags(I2S_Type *base, uint32_t mask) -{ - base->TCSR = ((base->TCSR & 0xFFE3FFFFU) | mask); -} - -/*! - * @brief Gets the SAI Tx status flag state. - * - * @param base SAI base pointer - * @return SAI Rx status flag value. Use the Status Mask to get the status value needed. - */ -static inline uint32_t SAI_RxGetStatusFlag(I2S_Type *base) -{ - return base->RCSR; -} - -/*! - * @brief Clears the SAI Rx status flag state. - * - * @param base SAI base pointer - * @param mask State mask. It can be a combination of the following sources if defined. - * @arg kSAI_WordStartFlag - * @arg kSAI_SyncErrorFlag - * @arg kSAI_FIFOErrorFlag - */ -static inline void SAI_RxClearStatusFlags(I2S_Type *base, uint32_t mask) -{ - base->RCSR = ((base->RCSR & 0xFFE3FFFFU) | mask); -} - -/*! - * @brief Do software reset or FIFO reset . - * - * FIFO reset means clear all the data in the FIFO, and make the FIFO pointer both to 0. - * Software reset means clear the Tx internal logic, including the bit clock, frame count etc. But software - * reset will not clear any configuration registers like TCR1~TCR5. - * This function will also clear all the error flags such as FIFO error, sync error etc. - * - * @param base SAI base pointer - * @param tresetType Reset type, FIFO reset or software reset - */ -void SAI_TxSoftwareReset(I2S_Type *base, sai_reset_type_t resetType); - -/*! - * @brief Do software reset or FIFO reset . - * - * FIFO reset means clear all the data in the FIFO, and make the FIFO pointer both to 0. - * Software reset means clear the Rx internal logic, including the bit clock, frame count etc. But software - * reset will not clear any configuration registers like RCR1~RCR5. - * This function will also clear all the error flags such as FIFO error, sync error etc. - * - * @param base SAI base pointer - * @param resetType Reset type, FIFO reset or software reset - */ -void SAI_RxSoftwareReset(I2S_Type *base, sai_reset_type_t resetType); - -/*! - * @brief Set the Tx channel FIFO enable mask. - * - * @param base SAI base pointer - * @param mask Channel enable mask, 0 means all channel FIFO disabled, 1 means channel 0 enabled, - * 3 means both channel 0 and channel 1 enabled. - */ -void SAI_TxSetChannelFIFOMask(I2S_Type *base, uint8_t mask); - -/*! - * @brief Set the Rx channel FIFO enable mask. - * - * @param base SAI base pointer - * @param mask Channel enable mask, 0 means all channel FIFO disabled, 1 means channel 0 enabled, - * 3 means both channel 0 and channel 1 enabled. - */ -void SAI_RxSetChannelFIFOMask(I2S_Type *base, uint8_t mask); - -/*! - * @brief Set the Tx data order. - * - * @param base SAI base pointer - * @param order Data order MSB or LSB - */ -void SAI_TxSetDataOrder(I2S_Type *base, sai_data_order_t order); - -/*! - * @brief Set the Rx data order. - * - * @param base SAI base pointer - * @param order Data order MSB or LSB - */ -void SAI_RxSetDataOrder(I2S_Type *base, sai_data_order_t order); - -/*! - * @brief Set the Tx data order. - * - * @param base SAI base pointer - * @param polarity - */ -void SAI_TxSetBitClockPolarity(I2S_Type *base, sai_clock_polarity_t polarity); - -/*! - * @brief Set the Rx data order. - * - * @param base SAI base pointer - * @param polarity - */ -void SAI_RxSetBitClockPolarity(I2S_Type *base, sai_clock_polarity_t polarity); - -/*! - * @brief Set the Tx data order. - * - * @param base SAI base pointer - * @param polarity - */ -void SAI_TxSetFrameSyncPolarity(I2S_Type *base, sai_clock_polarity_t polarity); - -/*! - * @brief Set the Rx data order. - * - * @param base SAI base pointer - * @param polarity - */ -void SAI_RxSetFrameSyncPolarity(I2S_Type *base, sai_clock_polarity_t polarity); - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_PACKING) && FSL_FEATURE_SAI_HAS_FIFO_PACKING -/*! - * @brief Set Tx FIFO packing feature. - * - * @param base SAI base pointer. - * @param pack FIFO pack type. It is element of sai_fifo_packing_t. - */ -void SAI_TxSetFIFOPacking(I2S_Type *base, sai_fifo_packing_t pack); - -/*! - * @brief Set Rx FIFO packing feature. - * - * @param base SAI base pointer. - * @param pack FIFO pack type. It is element of sai_fifo_packing_t. - */ -void SAI_RxSetFIFOPacking(I2S_Type *base, sai_fifo_packing_t pack); -#endif /* FSL_FEATURE_SAI_HAS_FIFO_PACKING */ - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) && FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR -/*! - * @brief Set Tx FIFO error continue. - * - * FIFO error continue mode means SAI will keep running while FIFO error occurred. If this feature - * not enabled, SAI will hang and users need to clear FEF flag in TCSR register. - * - * @param base SAI base pointer. - * @param isEnabled Is FIFO error continue enabled, true means enable, false means disable. - */ -static inline void SAI_TxSetFIFOErrorContinue(I2S_Type *base, bool isEnabled) -{ - if (isEnabled) - { - base->TCR4 |= I2S_TCR4_FCONT_MASK; - } - else - { - base->TCR4 &= ~I2S_TCR4_FCONT_MASK; - } -} - -/*! - * @brief Set Rx FIFO error continue. - * - * FIFO error continue mode means SAI will keep running while FIFO error occurred. If this feature - * not enabled, SAI will hang and users need to clear FEF flag in RCSR register. - * - * @param base SAI base pointer. - * @param isEnabled Is FIFO error continue enabled, true means enable, false means disable. - */ -static inline void SAI_RxSetFIFOErrorContinue(I2S_Type *base, bool isEnabled) -{ - if (isEnabled) - { - base->RCR4 |= I2S_RCR4_FCONT_MASK; - } - else - { - base->RCR4 &= ~I2S_RCR4_FCONT_MASK; - } -} -#endif - -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables the SAI Tx interrupt requests. - * - * @param base SAI base pointer - * @param mask interrupt source - * The parameter can be a combination of the following sources if defined. - * @arg kSAI_WordStartInterruptEnable - * @arg kSAI_SyncErrorInterruptEnable - * @arg kSAI_FIFOWarningInterruptEnable - * @arg kSAI_FIFORequestInterruptEnable - * @arg kSAI_FIFOErrorInterruptEnable - */ -static inline void SAI_TxEnableInterrupts(I2S_Type *base, uint32_t mask) -{ - base->TCSR = ((base->TCSR & 0xFFE3FFFFU) | mask); -} - -/*! - * @brief Enables the SAI Rx interrupt requests. - * - * @param base SAI base pointer - * @param mask interrupt source - * The parameter can be a combination of the following sources if defined. - * @arg kSAI_WordStartInterruptEnable - * @arg kSAI_SyncErrorInterruptEnable - * @arg kSAI_FIFOWarningInterruptEnable - * @arg kSAI_FIFORequestInterruptEnable - * @arg kSAI_FIFOErrorInterruptEnable - */ -static inline void SAI_RxEnableInterrupts(I2S_Type *base, uint32_t mask) -{ - base->RCSR = ((base->RCSR & 0xFFE3FFFFU) | mask); -} - -/*! - * @brief Disables the SAI Tx interrupt requests. - * - * @param base SAI base pointer - * @param mask interrupt source - * The parameter can be a combination of the following sources if defined. - * @arg kSAI_WordStartInterruptEnable - * @arg kSAI_SyncErrorInterruptEnable - * @arg kSAI_FIFOWarningInterruptEnable - * @arg kSAI_FIFORequestInterruptEnable - * @arg kSAI_FIFOErrorInterruptEnable - */ -static inline void SAI_TxDisableInterrupts(I2S_Type *base, uint32_t mask) -{ - base->TCSR = ((base->TCSR & 0xFFE3FFFFU) & (~mask)); -} - -/*! - * @brief Disables the SAI Rx interrupt requests. - * - * @param base SAI base pointer - * @param mask interrupt source - * The parameter can be a combination of the following sources if defined. - * @arg kSAI_WordStartInterruptEnable - * @arg kSAI_SyncErrorInterruptEnable - * @arg kSAI_FIFOWarningInterruptEnable - * @arg kSAI_FIFORequestInterruptEnable - * @arg kSAI_FIFOErrorInterruptEnable - */ -static inline void SAI_RxDisableInterrupts(I2S_Type *base, uint32_t mask) -{ - base->RCSR = ((base->RCSR & 0xFFE3FFFFU) & (~mask)); -} - -/*! @} */ - -/*! - * @name DMA Control - * @{ - */ - -/*! - * @brief Enables/disables the SAI Tx DMA requests. - * @param base SAI base pointer - * @param mask DMA source - * The parameter can be combination of the following sources if defined. - * @arg kSAI_FIFOWarningDMAEnable - * @arg kSAI_FIFORequestDMAEnable - * @param enable True means enable DMA, false means disable DMA. - */ -static inline void SAI_TxEnableDMA(I2S_Type *base, uint32_t mask, bool enable) -{ - if (enable) - { - base->TCSR = ((base->TCSR & 0xFFE3FFFFU) | mask); - } - else - { - base->TCSR = ((base->TCSR & 0xFFE3FFFFU) & (~mask)); - } -} - -/*! - * @brief Enables/disables the SAI Rx DMA requests. - * @param base SAI base pointer - * @param mask DMA source - * The parameter can be a combination of the following sources if defined. - * @arg kSAI_FIFOWarningDMAEnable - * @arg kSAI_FIFORequestDMAEnable - * @param enable True means enable DMA, false means disable DMA. - */ -static inline void SAI_RxEnableDMA(I2S_Type *base, uint32_t mask, bool enable) -{ - if (enable) - { - base->RCSR = ((base->RCSR & 0xFFE3FFFFU) | mask); - } - else - { - base->RCSR = ((base->RCSR & 0xFFE3FFFFU) & (~mask)); - } -} - -/*! - * @brief Gets the SAI Tx data register address. - * - * This API is used to provide a transfer address for the SAI DMA transfer configuration. - * - * @param base SAI base pointer. - * @param channel Which data channel used. - * @return data register address. - */ -static inline uintptr_t SAI_TxGetDataRegisterAddress(I2S_Type *base, uint32_t channel) -{ - return (uintptr_t)(&(base->TDR)[channel]); -} - -/*! - * @brief Gets the SAI Rx data register address. - * - * This API is used to provide a transfer address for the SAI DMA transfer configuration. - * - * @param base SAI base pointer. - * @param channel Which data channel used. - * @return data register address. - */ -static inline uintptr_t SAI_RxGetDataRegisterAddress(I2S_Type *base, uint32_t channel) -{ - return (uintptr_t)(&(base->RDR)[channel]); -} - -/*! @} */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Sends data using a blocking method. - * - * @note This function blocks by polling until data is ready to be sent. - * - * @param base SAI base pointer. - * @param channel Data channel used. - * @param bitWidth How many bits in an audio word; usually 8/16/24/32 bits. - * @param buffer Pointer to the data to be written. - * @param size Bytes to be written. - */ -void SAI_WriteBlocking(I2S_Type *base, uint32_t channel, uint32_t bitWidth, uint8_t *buffer, uint32_t size); - -/*! - * @brief Sends data to multi channel using a blocking method. - * - * @note This function blocks by polling until data is ready to be sent. - * - * @param base SAI base pointer. - * @param channel Data channel used. - * @param channelMask channel mask. - * @param bitWidth How many bits in an audio word; usually 8/16/24/32 bits. - * @param buffer Pointer to the data to be written. - * @param size Bytes to be written. - */ -void SAI_WriteMultiChannelBlocking( - I2S_Type *base, uint32_t channel, uint32_t channelMask, uint32_t bitWidth, uint8_t *buffer, uint32_t size); - -/*! - * @brief Writes data into SAI FIFO. - * - * @param base SAI base pointer. - * @param channel Data channel used. - * @param data Data needs to be written. - */ -static inline void SAI_WriteData(I2S_Type *base, uint32_t channel, uint32_t data) -{ - base->TDR[channel] = data; -} - -/*! - * @brief Receives data using a blocking method. - * - * @note This function blocks by polling until data is ready to be sent. - * - * @param base SAI base pointer. - * @param channel Data channel used. - * @param bitWidth How many bits in an audio word; usually 8/16/24/32 bits. - * @param buffer Pointer to the data to be read. - * @param size Bytes to be read. - */ -void SAI_ReadBlocking(I2S_Type *base, uint32_t channel, uint32_t bitWidth, uint8_t *buffer, uint32_t size); - -/*! - * @brief Receives multi channel data using a blocking method. - * - * @note This function blocks by polling until data is ready to be sent. - * - * @param base SAI base pointer. - * @param channel Data channel used. - * @param channelMask channel mask. - * @param bitWidth How many bits in an audio word; usually 8/16/24/32 bits. - * @param buffer Pointer to the data to be read. - * @param size Bytes to be read. - */ -void SAI_ReadMultiChannelBlocking( - I2S_Type *base, uint32_t channel, uint32_t channelMask, uint32_t bitWidth, uint8_t *buffer, uint32_t size); - -/*! - * @brief Reads data from the SAI FIFO. - * - * @param base SAI base pointer. - * @param channel Data channel used. - * @return Data in SAI FIFO. - */ -static inline uint32_t SAI_ReadData(I2S_Type *base, uint32_t channel) -{ - return base->RDR[channel]; -} - -/*! @} */ - -/*! - * @name Transactional - * @{ - */ - -/*! - * @brief Initializes the SAI Tx handle. - * - * This function initializes the Tx handle for the SAI Tx transactional APIs. Call - * this function once to get the handle initialized. - * - * @param base SAI base pointer - * @param handle SAI handle pointer. - * @param callback Pointer to the user callback function. - * @param userData User parameter passed to the callback function - */ -void SAI_TransferTxCreateHandle(I2S_Type *base, sai_handle_t *handle, sai_transfer_callback_t callback, void *userData); - -/*! - * @brief Initializes the SAI Rx handle. - * - * This function initializes the Rx handle for the SAI Rx transactional APIs. Call - * this function once to get the handle initialized. - * - * @param base SAI base pointer. - * @param handle SAI handle pointer. - * @param callback Pointer to the user callback function. - * @param userData User parameter passed to the callback function. - */ -void SAI_TransferRxCreateHandle(I2S_Type *base, sai_handle_t *handle, sai_transfer_callback_t callback, void *userData); - -/*! - * @brief SAI transmitter transfer configurations. - * - * This function initializes the Tx, include bit clock, frame sync, master clock, serial data and fifo - * configurations. - * - * @param base SAI base pointer. - * @param handle SAI handle pointer. - * @param config tranmitter configurations. - */ -void SAI_TransferTxSetConfig(I2S_Type *base, sai_handle_t *handle, sai_transceiver_t *config); - -/*! - * @brief SAI receiver transfer configurations. - * - * This function initializes the Rx, include bit clock, frame sync, master clock, serial data and fifo - * configurations. - * - * @param base SAI base pointer. - * @param handle SAI handle pointer. - * @param config receiver configurations. - */ -void SAI_TransferRxSetConfig(I2S_Type *base, sai_handle_t *handle, sai_transceiver_t *config); - - -/*! - * @brief Performs an interrupt non-blocking send transfer on SAI. - * - * @note This API returns immediately after the transfer initiates. - * Call the SAI_TxGetTransferStatusIRQ to poll the transfer status and check whether - * the transfer is finished. If the return status is not kStatus_SAI_Busy, the transfer - * is finished. - * - * @param base SAI base pointer. - * @param handle Pointer to the sai_handle_t structure which stores the transfer state. - * @param xfer Pointer to the sai_transfer_t structure. - * @retval kStatus_Success Successfully started the data receive. - * @retval kStatus_SAI_TxBusy Previous receive still not finished. - * @retval kStatus_InvalidArgument The input parameter is invalid. - */ -status_t SAI_TransferSendNonBlocking(I2S_Type *base, sai_handle_t *handle, sai_transfer_t *xfer); - -/*! - * @brief Performs an interrupt non-blocking receive transfer on SAI. - * - * @note This API returns immediately after the transfer initiates. - * Call the SAI_RxGetTransferStatusIRQ to poll the transfer status and check whether - * the transfer is finished. If the return status is not kStatus_SAI_Busy, the transfer - * is finished. - * - * @param base SAI base pointer - * @param handle Pointer to the sai_handle_t structure which stores the transfer state. - * @param xfer Pointer to the sai_transfer_t structure. - * @retval kStatus_Success Successfully started the data receive. - * @retval kStatus_SAI_RxBusy Previous receive still not finished. - * @retval kStatus_InvalidArgument The input parameter is invalid. - */ -status_t SAI_TransferReceiveNonBlocking(I2S_Type *base, sai_handle_t *handle, sai_transfer_t *xfer); - -/*! - * @brief Gets a set byte count. - * - * @param base SAI base pointer. - * @param handle Pointer to the sai_handle_t structure which stores the transfer state. - * @param count Bytes count sent. - * @retval kStatus_Success Succeed get the transfer count. - * @retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t SAI_TransferGetSendCount(I2S_Type *base, sai_handle_t *handle, size_t *count); - -/*! - * @brief Gets a received byte count. - * - * @param base SAI base pointer. - * @param handle Pointer to the sai_handle_t structure which stores the transfer state. - * @param count Bytes count received. - * @retval kStatus_Success Succeed get the transfer count. - * @retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t SAI_TransferGetReceiveCount(I2S_Type *base, sai_handle_t *handle, size_t *count); - -/*! - * @brief Aborts the current send. - * - * @note This API can be called any time when an interrupt non-blocking transfer initiates - * to abort the transfer early. - * - * @param base SAI base pointer. - * @param handle Pointer to the sai_handle_t structure which stores the transfer state. - */ -void SAI_TransferAbortSend(I2S_Type *base, sai_handle_t *handle); - -/*! - * @brief Aborts the current IRQ receive. - * - * @note This API can be called when an interrupt non-blocking transfer initiates - * to abort the transfer early. - * - * @param base SAI base pointer - * @param handle Pointer to the sai_handle_t structure which stores the transfer state. - */ -void SAI_TransferAbortReceive(I2S_Type *base, sai_handle_t *handle); - -/*! - * @brief Terminate all SAI send. - * - * This function will clear all transfer slots buffered in the sai queue. If users only want to abort the - * current transfer slot, please call SAI_TransferAbortSend. - * - * @param base SAI base pointer. - * @param handle SAI eDMA handle pointer. - */ -void SAI_TransferTerminateSend(I2S_Type *base, sai_handle_t *handle); - -/*! - * @brief Terminate all SAI receive. - * - * This function will clear all transfer slots buffered in the sai queue. If users only want to abort the - * current transfer slot, please call SAI_TransferAbortReceive. - * - * @param base SAI base pointer. - * @param handle SAI eDMA handle pointer. - */ -void SAI_TransferTerminateReceive(I2S_Type *base, sai_handle_t *handle); - -/*! - * @brief Tx interrupt handler. - * - * @param base SAI base pointer. - * @param handle Pointer to the sai_handle_t structure. - */ -void SAI_TransferTxHandleIRQ(I2S_Type *base, sai_handle_t *handle); - -/*! - * @brief Tx interrupt handler. - * - * @param base SAI base pointer. - * @param handle Pointer to the sai_handle_t structure. - */ -void SAI_TransferRxHandleIRQ(I2S_Type *base, sai_handle_t *handle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /*_cplusplus*/ - -/*! @} */ - -#endif /* FSL_SAI_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_sai_edma.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_sai_edma.c deleted file mode 100644 index 64ea0711af7..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_sai_edma.c +++ /dev/null @@ -1,1013 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_sai_edma.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.sai_edma" -#endif - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Used for 32byte aligned */ -#define STCD_ADDR(address) (edma_tcd_t *)(((uint32_t)(address) + 32UL) & ~0x1FU) - -static I2S_Type *const s_saiBases[] = I2S_BASE_PTRS; -/* Only support 2 and 4 channel */ -#define SAI_CHANNEL_MAP_MODULO(channel) ((channel) == 2U ? kEDMA_Modulo8bytes : kEDMA_Modulo16bytes) - -/*handle; - status_t status = kStatus_SAI_TxBusy; - - if (saiHandle->state != (uint32_t)kSAI_BusyLoopTransfer) - { - if (saiHandle->queueDriver + tcds > (uint32_t)SAI_XFER_QUEUE_SIZE) - { - (void)memset(&saiHandle->saiQueue[saiHandle->queueDriver], 0, - sizeof(sai_transfer_t) * ((uint32_t)SAI_XFER_QUEUE_SIZE - saiHandle->queueDriver)); - (void)memset(&saiHandle->saiQueue[0U], 0, - sizeof(sai_transfer_t) * (saiHandle->queueDriver + tcds - (uint32_t)SAI_XFER_QUEUE_SIZE)); - } - else - { - (void)memset(&saiHandle->saiQueue[saiHandle->queueDriver], 0, sizeof(sai_transfer_t) * tcds); - } - saiHandle->queueDriver = (uint8_t)((saiHandle->queueDriver + tcds) % (uint32_t)SAI_XFER_QUEUE_SIZE); - - /* If all data finished, just stop the transfer */ - if (saiHandle->saiQueue[saiHandle->queueDriver].data == NULL) - { - /* Disable DMA enable bit */ - SAI_TxEnableDMA(privHandle->base, kSAI_FIFORequestDMAEnable, false); - EDMA_AbortTransfer(handle); - status = kStatus_SAI_TxIdle; - } - } - - /* If finished a block, call the callback function */ - if (saiHandle->callback != NULL) - { - (saiHandle->callback)(privHandle->base, saiHandle, status, saiHandle->userData); - } -} - -static void SAI_RxEDMACallback(edma_handle_t *handle, void *userData, bool done, uint32_t tcds) -{ - sai_edma_private_handle_t *privHandle = (sai_edma_private_handle_t *)userData; - sai_edma_handle_t *saiHandle = privHandle->handle; - status_t status = kStatus_SAI_RxBusy; - - if (saiHandle->state != (uint32_t)kSAI_BusyLoopTransfer) - { - if (saiHandle->queueDriver + tcds > (uint32_t)SAI_XFER_QUEUE_SIZE) - { - (void)memset(&saiHandle->saiQueue[saiHandle->queueDriver], 0, - sizeof(sai_transfer_t) * ((uint32_t)SAI_XFER_QUEUE_SIZE - saiHandle->queueDriver)); - (void)memset(&saiHandle->saiQueue[0U], 0, - sizeof(sai_transfer_t) * (saiHandle->queueDriver + tcds - (uint32_t)SAI_XFER_QUEUE_SIZE)); - } - else - { - (void)memset(&saiHandle->saiQueue[saiHandle->queueDriver], 0, sizeof(sai_transfer_t) * tcds); - } - saiHandle->queueDriver = (uint8_t)((saiHandle->queueDriver + tcds) % (uint32_t)SAI_XFER_QUEUE_SIZE); - - /* If all data finished, just stop the transfer */ - if (saiHandle->saiQueue[saiHandle->queueDriver].data == NULL) - { - /* Disable DMA enable bit */ - SAI_RxEnableDMA(privHandle->base, kSAI_FIFORequestDMAEnable, false); - EDMA_AbortTransfer(handle); - status = kStatus_SAI_RxIdle; - } - } - - /* If finished a block, call the callback function */ - if (saiHandle->callback != NULL) - { - (saiHandle->callback)(privHandle->base, saiHandle, status, saiHandle->userData); - } -} - -/*! - * brief Initializes the SAI eDMA handle. - * - * This function initializes the SAI master DMA handle, which can be used for other SAI master transactional APIs. - * Usually, for a specified SAI instance, call this API once to get the initialized handle. - * - * param base SAI base pointer. - * param handle SAI eDMA handle pointer. - * param base SAI peripheral base address. - * param callback Pointer to user callback function. - * param userData User parameter passed to the callback function. - * param dmaHandle eDMA handle pointer, this handle shall be static allocated by users. - */ -void SAI_TransferTxCreateHandleEDMA( - I2S_Type *base, sai_edma_handle_t *handle, sai_edma_callback_t callback, void *userData, edma_handle_t *txDmaHandle) -{ - assert((handle != NULL) && (txDmaHandle != NULL)); - - uint32_t instance = SAI_GetInstance(base); - - /* Zero the handle */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Set sai base to handle */ - handle->dmaHandle = txDmaHandle; - handle->callback = callback; - handle->userData = userData; - handle->interleaveType = kSAI_EDMAInterleavePerChannelSample; - - /* Set SAI state to idle */ - handle->state = (uint32_t)kSAI_Idle; - - s_edmaPrivateHandle[instance][0].base = base; - s_edmaPrivateHandle[instance][0].handle = handle; - - /* Need to use scatter gather */ - EDMA_InstallTCDMemory(txDmaHandle, (edma_tcd_t *)(STCD_ADDR(handle->tcd)), SAI_XFER_QUEUE_SIZE); - - /* Install callback for Tx dma channel */ - EDMA_SetCallback(txDmaHandle, SAI_TxEDMACallback, &s_edmaPrivateHandle[instance][0]); -} - -/*! - * brief Initializes the SAI Rx eDMA handle. - * - * This function initializes the SAI slave DMA handle, which can be used for other SAI master transactional APIs. - * Usually, for a specified SAI instance, call this API once to get the initialized handle. - * - * param base SAI base pointer. - * param handle SAI eDMA handle pointer. - * param base SAI peripheral base address. - * param callback Pointer to user callback function. - * param userData User parameter passed to the callback function. - * param dmaHandle eDMA handle pointer, this handle shall be static allocated by users. - */ -void SAI_TransferRxCreateHandleEDMA( - I2S_Type *base, sai_edma_handle_t *handle, sai_edma_callback_t callback, void *userData, edma_handle_t *rxDmaHandle) -{ - assert((handle != NULL) && (rxDmaHandle != NULL)); - - uint32_t instance = SAI_GetInstance(base); - - /* Zero the handle */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Set sai base to handle */ - handle->dmaHandle = rxDmaHandle; - handle->callback = callback; - handle->userData = userData; - handle->interleaveType = kSAI_EDMAInterleavePerChannelSample; - - /* Set SAI state to idle */ - handle->state = (uint32_t)kSAI_Idle; - - s_edmaPrivateHandle[instance][1].base = base; - s_edmaPrivateHandle[instance][1].handle = handle; - - /* Need to use scatter gather */ - EDMA_InstallTCDMemory(rxDmaHandle, STCD_ADDR(handle->tcd), SAI_XFER_QUEUE_SIZE); - - /* Install callback for Tx dma channel */ - EDMA_SetCallback(rxDmaHandle, SAI_RxEDMACallback, &s_edmaPrivateHandle[instance][1]); -} - -/*! - * brief Initializes the SAI interleave type. - * - * This function initializes the SAI DMA handle member interleaveType, it shall be called only when application would - * like to use type kSAI_EDMAInterleavePerChannelBlock, since the default interleaveType is - * kSAI_EDMAInterleavePerChannelSample always - * - * param handle SAI eDMA handle pointer. - * param interleaveType SAI interleave type. - */ -void SAI_TransferSetInterleaveType(sai_edma_handle_t *handle, sai_edma_interleave_t interleaveType) -{ - handle->interleaveType = interleaveType; -} - -/*! - * brief Configures the SAI Tx. - * - * note SAI eDMA supports data transfer in a multiple SAI channels if the FIFO Combine feature is supported. - * To activate the multi-channel transfer enable SAI channels by filling the channelMask - * of sai_transceiver_t with the corresponding values of _sai_channel_mask enum, enable the FIFO Combine - * mode by assigning kSAI_FifoCombineModeEnabledOnWrite to the fifoCombine member of sai_fifo_combine_t - * which is a member of sai_transceiver_t. - * This is an example of multi-channel data transfer configuration step. - * code - * sai_transceiver_t config; - * SAI_GetClassicI2SConfig(&config, kSAI_WordWidth16bits, kSAI_Stereo, kSAI_Channel0Mask|kSAI_Channel1Mask); - * config.fifo.fifoCombine = kSAI_FifoCombineModeEnabledOnWrite; - * SAI_TransferTxSetConfigEDMA(I2S0, &edmaHandle, &config); - * endcode - * param base SAI base pointer. - * param handle SAI eDMA handle pointer. - * param saiConfig sai configurations. - */ -void SAI_TransferTxSetConfigEDMA(I2S_Type *base, sai_edma_handle_t *handle, sai_transceiver_t *saiConfig) -{ - assert((handle != NULL) && (saiConfig != NULL)); - - /* Configure the audio format to SAI registers */ - SAI_TxSetConfig(base, saiConfig); - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE - /* Allow multi-channel transfer only if FIFO Combine mode is enabled */ - assert( - (saiConfig->channelNums <= 1U) || - ((saiConfig->channelNums > 1U) && ((saiConfig->fifo.fifoCombine == kSAI_FifoCombineModeEnabledOnWrite) || - (saiConfig->fifo.fifoCombine == kSAI_FifoCombineModeEnabledOnReadWrite)))); -#endif - - /* Get the transfer size from format, this should be used in EDMA configuration */ - if (saiConfig->serialData.dataWordLength == 24U) - { - handle->bytesPerFrame = 4U; - } - else - { - handle->bytesPerFrame = saiConfig->serialData.dataWordLength / 8U; - } - /* Update the data channel SAI used */ - handle->channel = saiConfig->startChannel; - handle->channelMask = saiConfig->channelMask; - handle->channelNums = saiConfig->channelNums; - - /* Clear the channel enable bits until do a send/receive */ - base->TCR3 &= ~I2S_TCR3_TCE_MASK; -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - handle->count = (uint8_t)((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base) - saiConfig->fifo.fifoWatermark); -#else - handle->count = 1U; -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ -} - -/*! - * brief Configures the SAI Rx. - * - * note SAI eDMA supports data transfer in a multiple SAI channels if the FIFO Combine feature is supported. - * To activate the multi-channel transfer enable SAI channels by filling the channelMask - * of sai_transceiver_t with the corresponding values of _sai_channel_mask enum, enable the FIFO Combine - * mode by assigning kSAI_FifoCombineModeEnabledOnRead to the fifoCombine member of sai_fifo_combine_t - * which is a member of sai_transceiver_t. - * This is an example of multi-channel data transfer configuration step. - * code - * sai_transceiver_t config; - * SAI_GetClassicI2SConfig(&config, kSAI_WordWidth16bits, kSAI_Stereo, kSAI_Channel0Mask|kSAI_Channel1Mask); - * config.fifo.fifoCombine = kSAI_FifoCombineModeEnabledOnRead; - * SAI_TransferRxSetConfigEDMA(I2S0, &edmaHandle, &config); - * endcode - * param base SAI base pointer. - * param handle SAI eDMA handle pointer. - * param saiConfig sai configurations. - */ -void SAI_TransferRxSetConfigEDMA(I2S_Type *base, sai_edma_handle_t *handle, sai_transceiver_t *saiConfig) -{ - assert((handle != NULL) && (saiConfig != NULL)); - - /* Configure the audio format to SAI registers */ - SAI_RxSetConfig(base, saiConfig); - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE - /* Allow multi-channel transfer only if FIFO Combine mode is enabled */ - assert( - (saiConfig->channelNums <= 1U) || - ((saiConfig->channelNums > 1U) && ((saiConfig->fifo.fifoCombine == kSAI_FifoCombineModeEnabledOnRead) || - (saiConfig->fifo.fifoCombine == kSAI_FifoCombineModeEnabledOnReadWrite)))); -#endif - - /* Get the transfer size from format, this should be used in EDMA configuration */ - if (saiConfig->serialData.dataWordLength == 24U) - { - handle->bytesPerFrame = 4U; - } - else - { - handle->bytesPerFrame = saiConfig->serialData.dataWordLength / 8U; - } - - /* Update the data channel SAI used */ - handle->channel = saiConfig->startChannel; - handle->channelMask = saiConfig->channelMask; - handle->channelNums = saiConfig->channelNums; - /* Clear the channel enable bits until do a send/receive */ - base->RCR3 &= ~I2S_RCR3_RCE_MASK; -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - handle->count = saiConfig->fifo.fifoWatermark; -#else - handle->count = 1U; -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ -} - -/*! - * brief Performs a non-blocking SAI transfer using DMA. - * - * note This interface returns immediately after the transfer initiates. Call - * SAI_GetTransferStatus to poll the transfer status and check whether the SAI transfer is finished. - * - * In classic I2S mode configuration. - * 1. The data source sent should be formatted as below if handle->interleaveType = - * kSAI_EDMAInterleavePerChannelSample : - * -------------------------------------------------------------------------------------------------- - * |LEFT CHANNEL | RIGHT CHANNEL | LEFT CHANNEL | RIGHT CHANNEL | LEFT CHANNEL | RIGHT CHANNEL | ...| - * -------------------------------------------------------------------------------------------------- - * 2. The data source sent should be formatted as below if handle->interleaveType = - * kSAI_EDMAInterleavePerChannelBlock : - * ------------------------------------------------------------------------------------------------------- - * |LEFT CHANNEL | LEFT CHANNEL | LEFT CHANNEL | ...| RIGHT CHANNEL | RIGHT CHANNEL | RIGHT CHANNEL | ...| - * ------------------------------------------------------------------------------------------------------- - * - * This function support multi channel transfer, - * 1. for the sai IP support fifo combine mode, application should enable the fifo combine mode, no limitation - * on channel numbers - * 2. for the sai IP not support fifo combine mode, sai edma provide another solution which using - * EDMA modulo feature, but support 2 or 4 channels only. - * - * param base SAI base pointer. - * param handle SAI eDMA handle pointer. - * param xfer Pointer to the DMA transfer structure. - * retval kStatus_Success Start a SAI eDMA send successfully. - * retval kStatus_InvalidArgument The input argument is invalid. - * retval kStatus_TxBusy SAI is busy sending data. - */ -status_t SAI_TransferSendEDMA(I2S_Type *base, sai_edma_handle_t *handle, sai_transfer_t *xfer) -{ - assert((handle != NULL) && (xfer != NULL)); - - edma_transfer_config_t config = {0}; - uint32_t destAddr = SAI_TxGetDataRegisterAddress(base, handle->channel); - uint32_t destOffset = 0U; - uint32_t srcOffset = xfer->dataSize / 2U; - edma_tcd_t *currentTCD = STCD_ADDR(handle->tcd); - edma_minor_offset_config_t minorOffset = {.enableSrcMinorOffset = true, - .enableDestMinorOffset = false, - .minorOffset = 0xFFFFFU - 2U * srcOffset + 1U + handle->bytesPerFrame}; - - /* Check if input parameter invalid */ - if ((xfer->data == NULL) || (xfer->dataSize == 0U)) - { - return kStatus_InvalidArgument; - } - - if (handle->saiQueue[handle->queueUser].data != NULL) - { - return kStatus_SAI_QueueFull; - } - - /* Change the state of handle */ - handle->state = (uint32_t)kSAI_Busy; - - /* Update the queue state */ - handle->transferSize[handle->queueUser] = xfer->dataSize; - handle->saiQueue[handle->queueUser].data = xfer->data; - handle->saiQueue[handle->queueUser].dataSize = xfer->dataSize; - handle->queueUser = (handle->queueUser + 1U) % (uint8_t)SAI_XFER_QUEUE_SIZE; - -#if !(defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) - if (handle->channelNums > 1U) - { - destOffset = sizeof(uint32_t); - } -#endif - - if (handle->interleaveType == kSAI_EDMAInterleavePerChannelSample) - { - /* Prepare edma configure */ - EDMA_PrepareTransferConfig(&config, xfer->data, (uint32_t)handle->bytesPerFrame, (int16_t)handle->bytesPerFrame, - (uint32_t *)destAddr, (uint32_t)handle->bytesPerFrame, (int16_t)destOffset, - (uint32_t)handle->count * handle->bytesPerFrame, xfer->dataSize); - } - else - { - EDMA_PrepareTransferConfig(&config, xfer->data, (uint32_t)handle->bytesPerFrame, (int16_t)srcOffset, - (uint32_t *)destAddr, (uint32_t)handle->bytesPerFrame, (int16_t)destOffset, - (uint32_t)2U * handle->bytesPerFrame, xfer->dataSize); - EDMA_TcdSetTransferConfig(currentTCD, &config, NULL); - EDMA_TcdSetMinorOffsetConfig(currentTCD, &minorOffset); - EDMA_TcdEnableInterrupts(currentTCD, (uint32_t)kEDMA_MajorInterruptEnable); - EDMA_TcdEnableAutoStopRequest(currentTCD, true); - EDMA_InstallTCD(handle->dmaHandle->base, handle->dmaHandle->channel, currentTCD); - } - /* Store the initially configured eDMA minor byte transfer count into the SAI handle */ - handle->nbytes = handle->count * handle->bytesPerFrame; - - if (EDMA_SubmitTransfer(handle->dmaHandle, &config) != kStatus_Success) - { - return kStatus_SAI_QueueFull; - } - -#if !(defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) - if (handle->channelNums > 1U) - { - if ((handle->channelNums % 2U) != 0U) - { - return kStatus_InvalidArgument; - } - - EDMA_SetModulo(handle->dmaHandle->base, handle->dmaHandle->channel, kEDMA_ModuloDisable, - SAI_CHANNEL_MAP_MODULO(handle->channelNums)); - } -#endif - /* Start DMA transfer */ - EDMA_StartTransfer(handle->dmaHandle); - - /* Enable DMA enable bit */ - SAI_TxEnableDMA(base, kSAI_FIFORequestDMAEnable, true); - - /* Enable SAI Tx clock */ - SAI_TxEnable(base, true); - - /* Enable the channel FIFO */ - base->TCR3 |= I2S_TCR3_TCE(handle->channelMask); - - return kStatus_Success; -} - -/*! - * brief Performs a non-blocking SAI receive using eDMA. - * - * note This interface returns immediately after the transfer initiates. Call - * the SAI_GetReceiveRemainingBytes to poll the transfer status and check whether the SAI transfer is finished. - * - * In classic I2S mode configuration. - * 1. The output data will be formatted as below if handle->interleaveType = - * kSAI_EDMAInterleavePerChannelSample : - * -------------------------------------------------------------------------------------------------- - * |LEFT CHANNEL | RIGHT CHANNEL | LEFT CHANNEL | RIGHT CHANNEL | LEFT CHANNEL | RIGHT CHANNEL | ...| - * -------------------------------------------------------------------------------------------------- - * 2. The output data will be formatted as below if handle->interleaveType = - * kSAI_EDMAInterleavePerChannelBlock : - * ------------------------------------------------------------------------------------------------------- - * |LEFT CHANNEL | LEFT CHANNEL | LEFT CHANNEL | ...| RIGHT CHANNEL | RIGHT CHANNEL | RIGHT CHANNEL | ...| - * ------------------------------------------------------------------------------------------------------- - * - * This function support multi channel transfer, - * 1. for the sai IP support fifo combine mode, application should enable the fifo combine mode, no limitation - * on channel numbers - * 2. for the sai IP not support fifo combine mode, sai edma provide another solution which using - * EDMA modulo feature, but support 2 or 4 channels only. - * - * param base SAI base pointer - * param handle SAI eDMA handle pointer. - * param xfer Pointer to DMA transfer structure. - * retval kStatus_Success Start a SAI eDMA receive successfully. - * retval kStatus_InvalidArgument The input argument is invalid. - * retval kStatus_RxBusy SAI is busy receiving data. - */ -status_t SAI_TransferReceiveEDMA(I2S_Type *base, sai_edma_handle_t *handle, sai_transfer_t *xfer) -{ - assert((handle != NULL) && (xfer != NULL)); - - edma_transfer_config_t config = {0}; - uint32_t srcAddr = SAI_RxGetDataRegisterAddress(base, handle->channel); - uint32_t srcOffset = 0U; - uint32_t destOffset = xfer->dataSize / 2U; - edma_tcd_t *currentTCD = STCD_ADDR(handle->tcd); - edma_minor_offset_config_t minorOffset = { - .enableSrcMinorOffset = false, - .enableDestMinorOffset = true, - .minorOffset = 0xFFFFFU - 2U * destOffset + 1U + (uint32_t)handle->bytesPerFrame}; - - /* Check if input parameter invalid */ - if ((xfer->data == NULL) || (xfer->dataSize == 0U)) - { - return kStatus_InvalidArgument; - } - - if (handle->saiQueue[handle->queueUser].data != NULL) - { - return kStatus_SAI_QueueFull; - } - - /* Change the state of handle */ - handle->state = (uint32_t)kSAI_Busy; - - /* Update queue state */ - handle->transferSize[handle->queueUser] = xfer->dataSize; - handle->saiQueue[handle->queueUser].data = xfer->data; - handle->saiQueue[handle->queueUser].dataSize = xfer->dataSize; - handle->queueUser = (handle->queueUser + 1U) % (uint8_t)SAI_XFER_QUEUE_SIZE; - -#if !(defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) - if (handle->channelNums > 1U) - { - srcOffset = sizeof(uint32_t); - } -#endif - - if (handle->interleaveType == kSAI_EDMAInterleavePerChannelSample) - { - /* Prepare edma configure */ - EDMA_PrepareTransferConfig(&config, (uint32_t *)srcAddr, (uint32_t)handle->bytesPerFrame, (int16_t)srcOffset, - xfer->data, (uint32_t)handle->bytesPerFrame, (int16_t)handle->bytesPerFrame, - (uint32_t)handle->count * handle->bytesPerFrame, xfer->dataSize); - } - else - { - EDMA_PrepareTransferConfig(&config, (uint32_t *)srcAddr, (uint32_t)handle->bytesPerFrame, (int16_t)srcOffset, - xfer->data, (uint32_t)handle->bytesPerFrame, (int16_t)destOffset, - (uint32_t)2U * handle->bytesPerFrame, xfer->dataSize); - EDMA_TcdSetTransferConfig(currentTCD, &config, NULL); - EDMA_TcdSetMinorOffsetConfig(currentTCD, &minorOffset); - EDMA_TcdEnableInterrupts(currentTCD, (uint32_t)kEDMA_MajorInterruptEnable); - EDMA_TcdEnableAutoStopRequest(currentTCD, true); - EDMA_InstallTCD(handle->dmaHandle->base, handle->dmaHandle->channel, currentTCD); - } - - /* Store the initially configured eDMA minor byte transfer count into the SAI handle */ - handle->nbytes = handle->count * handle->bytesPerFrame; - - if (EDMA_SubmitTransfer(handle->dmaHandle, &config) != kStatus_Success) - { - return kStatus_SAI_QueueFull; - } - -#if !(defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) - if (handle->channelNums > 1U) - { - if ((handle->channelNums % 2U) != 0U) - { - return kStatus_InvalidArgument; - } - - EDMA_SetModulo(handle->dmaHandle->base, handle->dmaHandle->channel, SAI_CHANNEL_MAP_MODULO(handle->channelNums), - kEDMA_ModuloDisable); - } -#endif - /* Start DMA transfer */ - EDMA_StartTransfer(handle->dmaHandle); - - /* Enable DMA enable bit */ - SAI_RxEnableDMA(base, kSAI_FIFORequestDMAEnable, true); - - /* Enable the channel FIFO */ - base->RCR3 |= I2S_RCR3_RCE(handle->channelMask); - - /* Enable SAI Rx clock */ - SAI_RxEnable(base, true); - - return kStatus_Success; -} - -/*! - * brief Performs a non-blocking SAI loop transfer using eDMA. - * - * note This function support loop transfer only,such as A->B->...->A, application must be aware of - * that the more counts of the loop transfer, then more tcd memory required, as the function use the tcd pool in - * sai_edma_handle_t, so application could redefine the SAI_XFER_QUEUE_SIZE to determine the proper TCD pool size. - * This function support one sai channel only. - * - * Once the loop transfer start, application can use function SAI_TransferAbortSendEDMA to stop the loop transfer. - * - * param base SAI base pointer. - * param handle SAI eDMA handle pointer. - * param xfer Pointer to the DMA transfer structure, should be a array with elements counts >=1(loopTransferCount). - * param loopTransferCount the counts of xfer array. - * retval kStatus_Success Start a SAI eDMA send successfully. - * retval kStatus_InvalidArgument The input argument is invalid. - */ -status_t SAI_TransferSendLoopEDMA(I2S_Type *base, - sai_edma_handle_t *handle, - sai_transfer_t *xfer, - uint32_t loopTransferCount) -{ - assert((handle != NULL) && (xfer != NULL)); - - edma_transfer_config_t config = {0}; - uint32_t destAddr = SAI_TxGetDataRegisterAddress(base, handle->channel); - sai_transfer_t *transfer = xfer; - edma_tcd_t *currentTCD = STCD_ADDR(handle->tcd); - uint32_t tcdIndex = 0U; - - /* Change the state of handle */ - handle->state = (uint32_t)kSAI_Busy; - - for (uint32_t i = 0U; i < loopTransferCount; i++) - { - transfer = &xfer[i]; - - if ((transfer->data == NULL) || (transfer->dataSize == 0U) || (tcdIndex >= (uint32_t)SAI_XFER_QUEUE_SIZE)) - { - return kStatus_InvalidArgument; - } - - /* Update the queue state */ - handle->transferSize[tcdIndex] = transfer->dataSize; - handle->saiQueue[tcdIndex].data = transfer->data; - handle->saiQueue[tcdIndex].dataSize = transfer->dataSize; - - /* Prepare edma configure */ - EDMA_PrepareTransfer(&config, transfer->data, handle->bytesPerFrame, (uint32_t *)destAddr, - handle->bytesPerFrame, (uint32_t)handle->count * handle->bytesPerFrame, transfer->dataSize, - kEDMA_MemoryToPeripheral); - - if (i == (loopTransferCount - 1U)) - { - EDMA_TcdSetTransferConfig(¤tTCD[tcdIndex], &config, ¤tTCD[0U]); - EDMA_TcdEnableInterrupts(¤tTCD[tcdIndex], (uint32_t)kEDMA_MajorInterruptEnable); - handle->state = (uint32_t)kSAI_BusyLoopTransfer; - break; - } - else - { - EDMA_TcdSetTransferConfig(¤tTCD[tcdIndex], &config, ¤tTCD[tcdIndex + 1U]); - EDMA_TcdEnableInterrupts(¤tTCD[tcdIndex], (uint32_t)kEDMA_MajorInterruptEnable); - } - - tcdIndex = tcdIndex + 1U; - } - - EDMA_InstallTCD(handle->dmaHandle->base, handle->dmaHandle->channel, ¤tTCD[0]); - /* Start DMA transfer */ - EDMA_StartTransfer(handle->dmaHandle); - - /* Enable DMA enable bit */ - SAI_TxEnableDMA(base, kSAI_FIFORequestDMAEnable, true); - - /* Enable SAI Tx clock */ - SAI_TxEnable(base, true); - - /* Enable the channel FIFO */ - base->TCR3 |= I2S_TCR3_TCE(1UL << handle->channel); - - return kStatus_Success; -} - -/*! - * brief Performs a non-blocking SAI loop transfer using eDMA. - * - * note This function support loop transfer only,such as A->B->...->A, application must be aware of - * that the more counts of the loop transfer, then more tcd memory required, as the function use the tcd pool in - * sai_edma_handle_t, so application could redefine the SAI_XFER_QUEUE_SIZE to determine the proper TCD pool size. - * This function support one sai channel only. - * - * Once the loop transfer start, application can use function SAI_TransferAbortReceiveEDMA to stop the loop transfer. - * - * param base SAI base pointer. - * param handle SAI eDMA handle pointer. - * param xfer Pointer to the DMA transfer structure, should be a array with elements counts >=1(loopTransferCount). - * param loopTransferCount the counts of xfer array. - * retval kStatus_Success Start a SAI eDMA receive successfully. - * retval kStatus_InvalidArgument The input argument is invalid. - */ -status_t SAI_TransferReceiveLoopEDMA(I2S_Type *base, - sai_edma_handle_t *handle, - sai_transfer_t *xfer, - uint32_t loopTransferCount) -{ - assert((handle != NULL) && (xfer != NULL)); - - edma_transfer_config_t config = {0}; - uint32_t srcAddr = SAI_RxGetDataRegisterAddress(base, handle->channel); - sai_transfer_t *transfer = xfer; - edma_tcd_t *currentTCD = STCD_ADDR(handle->tcd); - uint32_t tcdIndex = 0U; - - /* Change the state of handle */ - handle->state = (uint32_t)kSAI_Busy; - - for (uint32_t i = 0U; i < loopTransferCount; i++) - { - transfer = &xfer[i]; - - if ((tcdIndex >= (uint32_t)SAI_XFER_QUEUE_SIZE) || (xfer->data == NULL) || (xfer->dataSize == 0U)) - { - return kStatus_InvalidArgument; - } - - /* Update the queue state */ - handle->transferSize[tcdIndex] = transfer->dataSize; - handle->saiQueue[tcdIndex].data = transfer->data; - handle->saiQueue[tcdIndex].dataSize = transfer->dataSize; - - /* Prepare edma configure */ - EDMA_PrepareTransfer(&config, (uint32_t *)srcAddr, handle->bytesPerFrame, transfer->data, handle->bytesPerFrame, - (uint32_t)handle->count * handle->bytesPerFrame, transfer->dataSize, - kEDMA_PeripheralToMemory); - - if (i == (loopTransferCount - 1U)) - { - EDMA_TcdSetTransferConfig(¤tTCD[tcdIndex], &config, ¤tTCD[0U]); - EDMA_TcdEnableInterrupts(¤tTCD[tcdIndex], (uint32_t)kEDMA_MajorInterruptEnable); - handle->state = (uint32_t)kSAI_BusyLoopTransfer; - break; - } - else - { - EDMA_TcdSetTransferConfig(¤tTCD[tcdIndex], &config, ¤tTCD[tcdIndex + 1U]); - EDMA_TcdEnableInterrupts(¤tTCD[tcdIndex], (uint32_t)kEDMA_MajorInterruptEnable); - } - - tcdIndex = tcdIndex + 1U; - } - - EDMA_InstallTCD(handle->dmaHandle->base, handle->dmaHandle->channel, ¤tTCD[0]); - /* Start DMA transfer */ - EDMA_StartTransfer(handle->dmaHandle); - /* Enable DMA enable bit */ - SAI_RxEnableDMA(base, kSAI_FIFORequestDMAEnable, true); - - /* Enable the channel FIFO */ - base->RCR3 |= I2S_RCR3_RCE(1UL << handle->channel); - - /* Enable SAI Rx clock */ - SAI_RxEnable(base, true); - - return kStatus_Success; -} - -/*! - * brief Aborts a SAI transfer using eDMA. - * - * This function only aborts the current transfer slots, the other transfer slots' information still kept - * in the handler. If users want to terminate all transfer slots, just call SAI_TransferTerminateSendEDMA. - * - * param base SAI base pointer. - * param handle SAI eDMA handle pointer. - */ -void SAI_TransferAbortSendEDMA(I2S_Type *base, sai_edma_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable dma */ - EDMA_AbortTransfer(handle->dmaHandle); - - /* Disable the channel FIFO */ - base->TCR3 &= ~I2S_TCR3_TCE_MASK; - - /* Disable DMA enable bit */ - SAI_TxEnableDMA(base, kSAI_FIFORequestDMAEnable, false); - - /* Disable Tx */ - SAI_TxEnable(base, false); - - /* If Tx is disabled, reset the FIFO pointer and clear error flags */ - if ((base->TCSR & I2S_TCSR_TE_MASK) == 0UL) - { - base->TCSR |= (I2S_TCSR_FR_MASK | I2S_TCSR_SR_MASK); - base->TCSR &= ~I2S_TCSR_SR_MASK; - } - - /* Handle the queue index */ - (void)memset(&handle->saiQueue[handle->queueDriver], 0, sizeof(sai_transfer_t)); - handle->queueDriver = (handle->queueDriver + 1U) % (uint8_t)SAI_XFER_QUEUE_SIZE; - - /* Set the handle state */ - handle->state = (uint32_t)kSAI_Idle; -} - -/*! - * brief Aborts a SAI receive using eDMA. - * - * This function only aborts the current transfer slots, the other transfer slots' information still kept - * in the handler. If users want to terminate all transfer slots, just call SAI_TransferTerminateReceiveEDMA. - * - * param base SAI base pointer. - * param handle SAI eDMA handle pointer. - */ -void SAI_TransferAbortReceiveEDMA(I2S_Type *base, sai_edma_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable dma */ - EDMA_AbortTransfer(handle->dmaHandle); - - /* Disable the channel FIFO */ - base->RCR3 &= ~I2S_RCR3_RCE_MASK; - - /* Disable DMA enable bit */ - SAI_RxEnableDMA(base, kSAI_FIFORequestDMAEnable, false); - - /* Disable Rx */ - SAI_RxEnable(base, false); - - /* If Rx is disabled, reset the FIFO pointer and clear error flags */ - if ((base->RCSR & I2S_RCSR_RE_MASK) == 0UL) - { - base->RCSR |= (I2S_RCSR_FR_MASK | I2S_RCSR_SR_MASK); - base->RCSR &= ~I2S_RCSR_SR_MASK; - } - - /* Handle the queue index */ - (void)memset(&handle->saiQueue[handle->queueDriver], 0, sizeof(sai_transfer_t)); - handle->queueDriver = (handle->queueDriver + 1U) % (uint8_t)SAI_XFER_QUEUE_SIZE; - - /* Set the handle state */ - handle->state = (uint32_t)kSAI_Idle; -} - -/*! - * brief Terminate all SAI send. - * - * This function will clear all transfer slots buffered in the sai queue. If users only want to abort the - * current transfer slot, please call SAI_TransferAbortSendEDMA. - * - * param base SAI base pointer. - * param handle SAI eDMA handle pointer. - */ -void SAI_TransferTerminateSendEDMA(I2S_Type *base, sai_edma_handle_t *handle) -{ - assert(handle != NULL); - - /* Abort the current transfer */ - SAI_TransferAbortSendEDMA(base, handle); - - /* Clear all the internal information */ - (void)memset(handle->tcd, 0, sizeof(handle->tcd)); - (void)memset(handle->saiQueue, 0, sizeof(handle->saiQueue)); - (void)memset(handle->transferSize, 0, sizeof(handle->transferSize)); - - handle->queueUser = 0U; - handle->queueDriver = 0U; -} - -/*! - * brief Terminate all SAI receive. - * - * This function will clear all transfer slots buffered in the sai queue. If users only want to abort the - * current transfer slot, please call SAI_TransferAbortReceiveEDMA. - * - * param base SAI base pointer. - * param handle SAI eDMA handle pointer. - */ -void SAI_TransferTerminateReceiveEDMA(I2S_Type *base, sai_edma_handle_t *handle) -{ - assert(handle != NULL); - - /* Abort the current transfer */ - SAI_TransferAbortReceiveEDMA(base, handle); - - /* Clear all the internal information */ - (void)memset(handle->tcd, 0, sizeof(handle->tcd)); - (void)memset(handle->saiQueue, 0, sizeof(handle->saiQueue)); - (void)memset(handle->transferSize, 0, sizeof(handle->transferSize)); - - handle->queueUser = 0U; - handle->queueDriver = 0U; -} - -/*! - * brief Gets byte count sent by SAI. - * - * param base SAI base pointer. - * param handle SAI eDMA handle pointer. - * param count Bytes count sent by SAI. - * retval kStatus_Success Succeed get the transfer count. - * retval kStatus_NoTransferInProgress There is no non-blocking transaction in progress. - */ -status_t SAI_TransferGetSendCountEDMA(I2S_Type *base, sai_edma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - status_t status = kStatus_Success; - - if (handle->state != (uint32_t)kSAI_Busy) - { - status = kStatus_NoTransferInProgress; - } - else - { - *count = (handle->transferSize[handle->queueDriver] - - (uint32_t)handle->nbytes * - EDMA_GetRemainingMajorLoopCount(handle->dmaHandle->base, handle->dmaHandle->channel)); - } - - return status; -} - -/*! - * brief Gets byte count received by SAI. - * - * param base SAI base pointer - * param handle SAI eDMA handle pointer. - * param count Bytes count received by SAI. - * retval kStatus_Success Succeed get the transfer count. - * retval kStatus_NoTransferInProgress There is no non-blocking transaction in progress. - */ -status_t SAI_TransferGetReceiveCountEDMA(I2S_Type *base, sai_edma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - status_t status = kStatus_Success; - - if (handle->state != (uint32_t)kSAI_Busy) - { - status = kStatus_NoTransferInProgress; - } - else - { - *count = (handle->transferSize[handle->queueDriver] - - (uint32_t)handle->nbytes * - EDMA_GetRemainingMajorLoopCount(handle->dmaHandle->base, handle->dmaHandle->channel)); - } - - return status; -} - -/*! - * @rief Gets valid transfer slot. - * - * This function can be used to query the valid transfer request slot that the application can submit. - * It should be called in the critical section, that means the application could call it in the corresponding callback - * function or disable IRQ before calling it in the application, otherwise, the returned value may not correct. - * - * param base SAI base pointer - * param handle SAI eDMA handle pointer. - * retval valid slot count that application submit. - */ -uint32_t SAI_TransferGetValidTransferSlotsEDMA(I2S_Type *base, sai_edma_handle_t *handle) -{ - uint32_t validSlot = 0U; - - for (uint32_t i = 0U; i < (uint32_t)SAI_XFER_QUEUE_SIZE; i++) - { - if (handle->saiQueue[i].data == NULL) - { - validSlot++; - } - } - - return validSlot; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_sai_edma.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_sai_edma.h deleted file mode 100644 index 82d7fb0f225..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_sai_edma.h +++ /dev/null @@ -1,351 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_SAI_EDMA_H_ -#define FSL_SAI_EDMA_H_ - -#include "fsl_edma.h" -#include "fsl_sai.h" - -/*! - * @addtogroup sai_edma SAI EDMA Driver - * @ingroup sai - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -#define FSL_SAI_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 7, 0)) /*!< Version 2.7.0 */ -/*@}*/ - -typedef struct sai_edma_handle sai_edma_handle_t; - -/*! @brief SAI eDMA transfer callback function for finish and error */ -typedef void (*sai_edma_callback_t)(I2S_Type *base, sai_edma_handle_t *handle, status_t status, void *userData); - -/*!@brief sai interleave type */ -typedef enum _sai_edma_interleave -{ - kSAI_EDMAInterleavePerChannelSample = - 0U, /*!< SAI data interleave per channel sample - * --------------------------------------------------------------------------------------------------- - * |LEFT CHANNEL | RIGHT CHANNEL | LEFT CHANNEL | RIGHT CHANNEL | LEFT CHANNEL | RIGHT CHANNEL | ....| - * --------------------------------------------------------------------------------------------------- - */ - kSAI_EDMAInterleavePerChannelBlock = - 1U, /*!< SAI data interleave per channel block - * -------------------------------------------------------------------------------------------------------- - * |LEFT CHANNEL | LEFT CHANNEL | LEFT CHANNEL | ... | RIGHT CHANNEL | RIGHT CHANNEL | RIGHT CHANNEL | ...| - * -------------------------------------------------------------------------------------------------------- - */ -} sai_edma_interleave_t; - -/*! @brief SAI DMA transfer handle, users should not touch the content of the handle.*/ -struct sai_edma_handle -{ - edma_handle_t *dmaHandle; /*!< DMA handler for SAI send */ - uint8_t nbytes; /*!< eDMA minor byte transfer count initially configured. */ - uint8_t bytesPerFrame; /*!< Bytes in a frame */ - uint8_t channelMask; /*!< Enabled channel mask value, reference _sai_channel_mask */ - uint8_t channelNums; /*!< total enabled channel nums */ - uint8_t channel; /*!< Which data channel */ - uint8_t count; /*!< The transfer data count in a DMA request */ - uint32_t state; /*!< Internal state for SAI eDMA transfer */ - sai_edma_callback_t callback; /*!< Callback for users while transfer finish or error occurs */ - void *userData; /*!< User callback parameter */ - uint8_t tcd[(SAI_XFER_QUEUE_SIZE + 1U) * sizeof(edma_tcd_t)]; /*!< TCD pool for eDMA transfer. */ - sai_transfer_t saiQueue[SAI_XFER_QUEUE_SIZE]; /*!< Transfer queue storing queued transfer. */ - size_t transferSize[SAI_XFER_QUEUE_SIZE]; /*!< Data bytes need to transfer */ - sai_edma_interleave_t interleaveType; /*!< Transfer interleave type */ - volatile uint8_t queueUser; /*!< Index for user to queue transfer. */ - volatile uint8_t queueDriver; /*!< Index for driver to get the transfer data and size */ -}; - -/******************************************************************************* - * APIs - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name eDMA Transactional - * @{ - */ - -/*! - * @brief Initializes the SAI eDMA handle. - * - * This function initializes the SAI master DMA handle, which can be used for other SAI master transactional APIs. - * Usually, for a specified SAI instance, call this API once to get the initialized handle. - * - * @param base SAI base pointer. - * @param handle SAI eDMA handle pointer. - * @param base SAI peripheral base address. - * @param callback Pointer to user callback function. - * @param userData User parameter passed to the callback function. - * @param txDmaHandle eDMA handle pointer, this handle shall be static allocated by users. - */ -void SAI_TransferTxCreateHandleEDMA(I2S_Type *base, - sai_edma_handle_t *handle, - sai_edma_callback_t callback, - void *userData, - edma_handle_t *txDmaHandle); - -/*! - * @brief Initializes the SAI Rx eDMA handle. - * - * This function initializes the SAI slave DMA handle, which can be used for other SAI master transactional APIs. - * Usually, for a specified SAI instance, call this API once to get the initialized handle. - * - * @param base SAI base pointer. - * @param handle SAI eDMA handle pointer. - * @param base SAI peripheral base address. - * @param callback Pointer to user callback function. - * @param userData User parameter passed to the callback function. - * @param rxDmaHandle eDMA handle pointer, this handle shall be static allocated by users. - */ -void SAI_TransferRxCreateHandleEDMA(I2S_Type *base, - sai_edma_handle_t *handle, - sai_edma_callback_t callback, - void *userData, - edma_handle_t *rxDmaHandle); - -/*! - * @brief Initializes the SAI interleave type. - * - * This function initializes the SAI DMA handle member interleaveType, it shall be called only when application would - * like to use type kSAI_EDMAInterleavePerChannelBlock, since the default interleaveType is - * kSAI_EDMAInterleavePerChannelSample always - * - * @param handle SAI eDMA handle pointer. - * @param interleaveType Multi channel interleave type. - */ -void SAI_TransferSetInterleaveType(sai_edma_handle_t *handle, sai_edma_interleave_t interleaveType); - -/*! - * @brief Configures the SAI Tx. - * - * @note SAI eDMA supports data transfer in a multiple SAI channels if the FIFO Combine feature is supported. - * To activate the multi-channel transfer enable SAI channels by filling the channelMask - * of sai_transceiver_t with the corresponding values of _sai_channel_mask enum, enable the FIFO Combine - * mode by assigning kSAI_FifoCombineModeEnabledOnWrite to the fifoCombine member of sai_fifo_combine_t - * which is a member of sai_transceiver_t. - * This is an example of multi-channel data transfer configuration step. - * @code - * sai_transceiver_t config; - * SAI_GetClassicI2SConfig(&config, kSAI_WordWidth16bits, kSAI_Stereo, kSAI_Channel0Mask|kSAI_Channel1Mask); - * config.fifo.fifoCombine = kSAI_FifoCombineModeEnabledOnWrite; - * SAI_TransferTxSetConfigEDMA(I2S0, &edmaHandle, &config); - * @endcode - * - * @param base SAI base pointer. - * @param handle SAI eDMA handle pointer. - * @param saiConfig sai configurations. - */ -void SAI_TransferTxSetConfigEDMA(I2S_Type *base, sai_edma_handle_t *handle, sai_transceiver_t *saiConfig); - -/*! - * @brief Configures the SAI Rx. - * - * @note SAI eDMA supports data transfer in a multiple SAI channels if the FIFO Combine feature is supported. - * To activate the multi-channel transfer enable SAI channels by filling the channelMask - * of sai_transceiver_t with the corresponding values of _sai_channel_mask enum, enable the FIFO Combine - * mode by assigning kSAI_FifoCombineModeEnabledOnRead to the fifoCombine member of sai_fifo_combine_t - * which is a member of sai_transceiver_t. - * This is an example of multi-channel data transfer configuration step. - * @code - * sai_transceiver_t config; - * SAI_GetClassicI2SConfig(&config, kSAI_WordWidth16bits, kSAI_Stereo, kSAI_Channel0Mask|kSAI_Channel1Mask); - * config.fifo.fifoCombine = kSAI_FifoCombineModeEnabledOnRead; - * SAI_TransferRxSetConfigEDMA(I2S0, &edmaHandle, &config); - * @endcode - * @param base SAI base pointer. - * @param handle SAI eDMA handle pointer. - * @param saiConfig sai configurations. - */ -void SAI_TransferRxSetConfigEDMA(I2S_Type *base, sai_edma_handle_t *handle, sai_transceiver_t *saiConfig); - -/*! - * @brief Performs a non-blocking SAI transfer using DMA. - * - * @note This interface returns immediately after the transfer initiates. Call - * SAI_GetTransferStatus to poll the transfer status and check whether the SAI transfer is finished. - * - * This function support multi channel transfer, - * 1. for the sai IP support fifo combine mode, application should enable the fifo combine mode, no limitation - * on channel numbers - * 2. for the sai IP not support fifo combine mode, sai edma provide another solution which using - * EDMA modulo feature, but support 2 or 4 channels only. - * - * @param base SAI base pointer. - * @param handle SAI eDMA handle pointer. - * @param xfer Pointer to the DMA transfer structure. - * @retval kStatus_Success Start a SAI eDMA send successfully. - * @retval kStatus_InvalidArgument The input argument is invalid. - * @retval kStatus_TxBusy SAI is busy sending data. - */ -status_t SAI_TransferSendEDMA(I2S_Type *base, sai_edma_handle_t *handle, sai_transfer_t *xfer); - -/*! - * @brief Performs a non-blocking SAI receive using eDMA. - * - * @note This interface returns immediately after the transfer initiates. Call - * the SAI_GetReceiveRemainingBytes to poll the transfer status and check whether the SAI transfer is finished. - * - * This function support multi channel transfer, - * 1. for the sai IP support fifo combine mode, application should enable the fifo combine mode, no limitation - * on channel numbers - * 2. for the sai IP not support fifo combine mode, sai edma provide another solution which using - * EDMA modulo feature, but support 2 or 4 channels only. - * - * @param base SAI base pointer - * @param handle SAI eDMA handle pointer. - * @param xfer Pointer to DMA transfer structure. - * @retval kStatus_Success Start a SAI eDMA receive successfully. - * @retval kStatus_InvalidArgument The input argument is invalid. - * @retval kStatus_RxBusy SAI is busy receiving data. - */ -status_t SAI_TransferReceiveEDMA(I2S_Type *base, sai_edma_handle_t *handle, sai_transfer_t *xfer); - -/*! - * @brief Performs a non-blocking SAI loop transfer using eDMA. - * - * @note This function support loop transfer only,such as A->B->...->A, application must be aware of - * that the more counts of the loop transfer, then more tcd memory required, as the function use the tcd pool in - * sai_edma_handle_t, so application could redefine the SAI_XFER_QUEUE_SIZE to determine the proper TCD pool size. - * This function support one sai channel only. - * - * Once the loop transfer start, application can use function SAI_TransferAbortSendEDMA to stop the loop transfer. - * - * @param base SAI base pointer. - * @param handle SAI eDMA handle pointer. - * @param xfer Pointer to the DMA transfer structure, should be a array with elements counts >=1(loopTransferCount). - * @param loopTransferCount the counts of xfer array. - * @retval kStatus_Success Start a SAI eDMA send successfully. - * @retval kStatus_InvalidArgument The input argument is invalid. - */ -status_t SAI_TransferSendLoopEDMA(I2S_Type *base, - sai_edma_handle_t *handle, - sai_transfer_t *xfer, - uint32_t loopTransferCount); - -/*! - * @brief Performs a non-blocking SAI loop transfer using eDMA. - * - * @note This function support loop transfer only,such as A->B->...->A, application must be aware of - * that the more counts of the loop transfer, then more tcd memory required, as the function use the tcd pool in - * sai_edma_handle_t, so application could redefine the SAI_XFER_QUEUE_SIZE to determine the proper TCD pool size. - * This function support one sai channel only. - * - * Once the loop transfer start, application can use function SAI_TransferAbortReceiveEDMA to stop the loop transfer. - * - * @param base SAI base pointer. - * @param handle SAI eDMA handle pointer. - * @param xfer Pointer to the DMA transfer structure, should be a array with elements counts >=1(loopTransferCount). - * @param loopTransferCount the counts of xfer array. - * @retval kStatus_Success Start a SAI eDMA receive successfully. - * @retval kStatus_InvalidArgument The input argument is invalid. - */ -status_t SAI_TransferReceiveLoopEDMA(I2S_Type *base, - sai_edma_handle_t *handle, - sai_transfer_t *xfer, - uint32_t loopTransferCount); - -/*! - * @brief Terminate all SAI send. - * - * This function will clear all transfer slots buffered in the sai queue. If users only want to abort the - * current transfer slot, please call SAI_TransferAbortSendEDMA. - * - * @param base SAI base pointer. - * @param handle SAI eDMA handle pointer. - */ -void SAI_TransferTerminateSendEDMA(I2S_Type *base, sai_edma_handle_t *handle); - -/*! - * @brief Terminate all SAI receive. - * - * This function will clear all transfer slots buffered in the sai queue. If users only want to abort the - * current transfer slot, please call SAI_TransferAbortReceiveEDMA. - * - * @param base SAI base pointer. - * @param handle SAI eDMA handle pointer. - */ -void SAI_TransferTerminateReceiveEDMA(I2S_Type *base, sai_edma_handle_t *handle); - -/*! - * @brief Aborts a SAI transfer using eDMA. - * - * This function only aborts the current transfer slots, the other transfer slots' information still kept - * in the handler. If users want to terminate all transfer slots, just call SAI_TransferTerminateSendEDMA. - * - * @param base SAI base pointer. - * @param handle SAI eDMA handle pointer. - */ -void SAI_TransferAbortSendEDMA(I2S_Type *base, sai_edma_handle_t *handle); - -/*! - * @brief Aborts a SAI receive using eDMA. - * - * This function only aborts the current transfer slots, the other transfer slots' information still kept - * in the handler. If users want to terminate all transfer slots, just call SAI_TransferTerminateReceiveEDMA. - * - * @param base SAI base pointer - * @param handle SAI eDMA handle pointer. - */ -void SAI_TransferAbortReceiveEDMA(I2S_Type *base, sai_edma_handle_t *handle); - -/*! - * @brief Gets byte count sent by SAI. - * - * @param base SAI base pointer. - * @param handle SAI eDMA handle pointer. - * @param count Bytes count sent by SAI. - * @retval kStatus_Success Succeed get the transfer count. - * @retval kStatus_NoTransferInProgress There is no non-blocking transaction in progress. - */ -status_t SAI_TransferGetSendCountEDMA(I2S_Type *base, sai_edma_handle_t *handle, size_t *count); - -/*! - * @brief Gets byte count received by SAI. - * - * @param base SAI base pointer - * @param handle SAI eDMA handle pointer. - * @param count Bytes count received by SAI. - * @retval kStatus_Success Succeed get the transfer count. - * @retval kStatus_NoTransferInProgress There is no non-blocking transaction in progress. - */ -status_t SAI_TransferGetReceiveCountEDMA(I2S_Type *base, sai_edma_handle_t *handle, size_t *count); - -/*! - * @brief Gets valid transfer slot. - * - * This function can be used to query the valid transfer request slot that the application can submit. - * It should be called in the critical section, that means the application could call it in the corresponding callback - * function or disable IRQ before calling it in the application, otherwise, the returned value may not correct. - * - * @param base SAI base pointer - * @param handle SAI eDMA handle pointer. - * @retval valid slot count that application submit. - */ -uint32_t SAI_TransferGetValidTransferSlotsEDMA(I2S_Type *base, sai_edma_handle_t *handle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_smartdma.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_smartdma.c deleted file mode 100644 index d1560d46b64..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_smartdma.c +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright 2019-2023 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_smartdma.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpc_smartdma" -#endif - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -typedef void (*smartdma_func_t)(void); - -#define SMARTDMA_HANDSHAKE_EVENT 0U -#define SMARTDMA_HANDSHAKE_ENABLE 1U -#define SMARTDMA_MASK_RESP 2U -#define SMARTDMA_ENABLE_AHBBUF 3U -#define SMARTDMA_ENABLE_GPISYNCH 4U - -#if defined(SMARTDMA0) && !(defined(SMARTDMA)) -#define SMARTDMA SMARTDMA0 -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ -static smartdma_func_t *s_smartdmaApiTable; -static smartdma_callback_t s_smartdmaCallback; -static void *s_smartdmaCallbackParam; -static smartdma_param_t s_smartdmaParam; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Codes - ******************************************************************************/ -/*! - * brief Initialize the SMARTDMA. - * - * param apiMemAddr The address firmware will be copied to. - * param firmware The firmware to use. - * param firmwareSizeByte Size of firmware. - */ -void SMARTDMA_Init(uint32_t apiMemAddr, const void *firmware, uint32_t firmwareSizeByte) -{ - SMARTDMA_InitWithoutFirmware(); - SMARTDMA_InstallFirmware(apiMemAddr, firmware, firmwareSizeByte); -} - -/*! - * brief Initialize the SMARTDMA. - * - * This function is similar with SMARTDMA_Init, the difference is this function - * does not install the firmware, the firmware could be installed using - * SMARTDMA_InstallFirmware. - */ -void SMARTDMA_InitWithoutFirmware(void) -{ - /* Clear Smart DMA RAM */ - RESET_PeripheralReset(kSMART_DMA_RST_SHIFT_RSTn); - CLOCK_EnableClock(kCLOCK_Smartdma); -} - -/*! - * @brief Install the firmware. - * - * param apiMemAddr The address firmware will be copied to. - * param firmware The firmware to use. - * param firmwareSizeByte Size of firmware. - */ -void SMARTDMA_InstallFirmware(uint32_t apiMemAddr, const void *firmware, uint32_t firmwareSizeByte) -{ - (void)memcpy((void *)(uint8_t *)apiMemAddr, firmware, firmwareSizeByte); - SMARTDMA->CTRL = (0xC0DE0000U | (1U << SMARTDMA_ENABLE_GPISYNCH)); - s_smartdmaApiTable = (smartdma_func_t *)apiMemAddr; -} - -/*! - * brief Install the complete callback function.. - * - * param callback The callback called when smartdma program finished. - */ -void SMARTDMA_InstallCallback(smartdma_callback_t callback, void *param) -{ - s_smartdmaCallback = callback; - s_smartdmaCallbackParam = param; -} - -/*! - * brief Boot the SMARTDMA to run program. - * - * param apiIndex Index of the API to call. - * param pParam Pointer to the parameter allocated by caller. - * param mask Value set to SMARTDMA_ARM2SMARTDMA[0:1]. - */ -void SMARTDMA_Boot(uint32_t apiIndex, void *pParam, uint8_t mask) -{ - SMARTDMA->ARM2EZH = (uint32_t)(uint8_t *)pParam | (uint32_t)mask; - SMARTDMA->BOOTADR = (uint32_t)(s_smartdmaApiTable[apiIndex]); - SMARTDMA->CTRL = 0xC0DE0011U | (0U << SMARTDMA_MASK_RESP) | (0U << SMARTDMA_ENABLE_AHBBUF); /* BOOT */ -}; - -/* - * brief Copy SMARTDMA params and Boot to run program. - * - * This function is similar with SMARTDMA_Boot, the only difference - * is, this function copies the *pParam to a local variable, upper layer - * can free the pParam's memory before the SMARTDMA execution finished, - * for example, upper layer can define the param as a local variable. - * - * param apiIndex Index of the API to call. - * param pParam Pointer to the parameter. - * param mask Value set to SMARTDMA_ARM2SMARTDMA[0:1]. - * note Only call this function when SMARTDMA is not busy. - */ -void SMARTDMA_Boot1(uint32_t apiIndex, const smartdma_param_t *pParam, uint8_t mask) -{ - (void)memcpy(&s_smartdmaParam, pParam, sizeof(smartdma_param_t)); - SMARTDMA_Boot(apiIndex, &s_smartdmaParam, mask); -} - -/*! - * brief Deinitialize the SMARTDMA. - */ -void SMARTDMA_Deinit(void) -{ - SMARTDMA->CTRL = 0xC0DE0000U; - CLOCK_DisableClock(kCLOCK_Smartdma); -} - -/*! - * brief Reset the SMARTDMA. - */ -void SMARTDMA_Reset(void) -{ - RESET_PeripheralReset(kSMART_DMA_RST_SHIFT_RSTn); - SMARTDMA->CTRL = (0xC0DE0000U | (1U << SMARTDMA_ENABLE_GPISYNCH)); -} - -/*! - * brief SMARTDMA IRQ. - */ -void SMARTDMA_HandleIRQ(void) -{ - if (NULL != s_smartdmaCallback) - { - s_smartdmaCallback(s_smartdmaCallbackParam); - } -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_smartdma.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_smartdma.h deleted file mode 100644 index 8741711c9cb..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_smartdma.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright 2019-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_SMARTDMA_H_ -#define FSL_SMARTDMA_H_ - -#include "fsl_common.h" - -#if defined(MIMXRT533S_SERIES) || defined(MIMXRT555S_SERIES) || defined(MIMXRT595S_cm33_SERIES) -#include "fsl_smartdma_rt500.h" -#elif defined(MCXN546_cm33_core0_SERIES) || defined(MCXN546_cm33_core1_SERIES) || \ - defined(MCXN547_cm33_core0_SERIES) || defined(MCXN547_cm33_core1_SERIES) || defined(MCXN946_cm33_core0_SERIES) || \ - defined(MCXN946_cm33_core1_SERIES) || defined(MCXN947_cm33_core0_SERIES) || defined(MCXN947_cm33_core1_SERIES) || \ - defined(MCXN236_SERIES) || defined(MCXN235_SERIES) -#include "fsl_smartdma_mcxn.h" -#else -#error "Device not supported" -#endif - -/*! - * @addtogroup smartdma - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief SMARTDMA driver version */ -#define FSL_SMARTDMA_DRIVER_VERSION (MAKE_VERSION(2, 9, 1)) -/*@}*/ - -/*! @brief Callback function prototype for the smartdma driver. */ -typedef void (*smartdma_callback_t)(void *param); - -/******************************************************************************* - * APIs - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @brief Initialize the SMARTDMA. - * - * @param apiMemAddr The address firmware will be copied to. - * @param firmware The firmware to use. - * @param firmwareSizeByte Size of firmware. - * @deprecated Do not use this function. It has been superceded by - * @ref SMARTDMA_InitWithoutFirmware and @ref SMARTDMA_InstallFirmware. - */ -void SMARTDMA_Init(uint32_t apiMemAddr, const void *firmware, uint32_t firmwareSizeByte); - -/*! - * @brief Initialize the SMARTDMA. - * - * This function is similar with @ref SMARTDMA_Init, the difference is this function - * does not install the firmware, the firmware could be installed using - * @ref SMARTDMA_InstallFirmware. - */ -void SMARTDMA_InitWithoutFirmware(void); - -/*! - * @brief Install the firmware. - * - * @param apiMemAddr The address firmware will be copied to. - * @param firmware The firmware to use. - * @param firmwareSizeByte Size of firmware. - * @note Only call this function when SMARTDMA is not busy. - */ -void SMARTDMA_InstallFirmware(uint32_t apiMemAddr, const void *firmware, uint32_t firmwareSizeByte); - -/*! - * @brief Install the complete callback function. - * - * @param callback The callback called when smartdma program finished. - * @param param Parameter for the callback. - * @note Only call this function when SMARTDMA is not busy. - */ -void SMARTDMA_InstallCallback(smartdma_callback_t callback, void *param); - -/*! - * @brief Boot the SMARTDMA to run program. - * - * @param apiIndex Index of the API to call. - * @param pParam Pointer to the parameter allocated by caller. - * @param mask Value set to register SMARTDMA->ARM2EZH[0:1]. - * @note Only call this function when SMARTDMA is not busy. - * @note The memory *pParam shall not be freed before the SMARTDMA function finished. - */ -void SMARTDMA_Boot(uint32_t apiIndex, void *pParam, uint8_t mask); - -/*! - * @brief Copy SMARTDMA params and Boot to run program. - * - * This function is similar with @ref SMARTDMA_Boot, the only difference - * is, this function copies the *pParam to a local variable, upper layer - * can free the pParam's memory before the SMARTDMA execution finished, - * for example, upper layer can define the param as a local variable. - * - * @param apiIndex Index of the API to call. - * @param pParam Pointer to the parameter. - * @param mask Value set to SMARTDMA_ARM2SMARTDMA[0:1]. - * @note Only call this function when SMARTDMA is not busy. - */ -void SMARTDMA_Boot1(uint32_t apiIndex, const smartdma_param_t *pParam, uint8_t mask); - -/*! - * @brief Deinitialize the SMARTDMA. - */ -void SMARTDMA_Deinit(void); - -/*! - * @brief Reset the SMARTDMA. - */ -void SMARTDMA_Reset(void); - -/*! - * @brief SMARTDMA IRQ. - */ -void SMARTDMA_HandleIRQ(void); - -#if defined(__cplusplus) -} -#endif - -/* @} */ - -#endif /* FSL_SMARTDMA_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_smartdma_mcxn.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_smartdma_mcxn.c deleted file mode 100644 index 88790187922..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_smartdma_mcxn.c +++ /dev/null @@ -1,445 +0,0 @@ -/* - * Copyright 2019-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_smartdma.h" - -#if defined(MCXN546_cm33_core0_SERIES) || defined(MCXN546_cm33_core1_SERIES) || defined(MCXN547_cm33_core0_SERIES) || \ - defined(MCXN547_cm33_core1_SERIES) || defined(MCXN946_cm33_core0_SERIES) || defined(MCXN946_cm33_core1_SERIES) || \ - defined(MCXN947_cm33_core0_SERIES) || defined(MCXN947_cm33_core1_SERIES) || defined(MCXN236_SERIES) - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ - -const uint8_t s_smartdmaDisplayFirmware[] = { - 0x24U, 0x00U, 0x00U, 0x04U, 0x18U, 0x01U, 0x00U, 0x04U, 0xC8U, 0x02U, 0x00U, 0x04U, 0xF0U, 0x01U, 0x00U, 0x04U, - 0x7CU, 0x03U, 0x00U, 0x04U, 0xACU, 0x08U, 0x00U, 0x04U, 0x10U, 0x0EU, 0x00U, 0x04U, 0x38U, 0x10U, 0x00U, 0x04U, - 0xC0U, 0x12U, 0x00U, 0x04U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, - 0x04U, 0x18U, 0x04U, 0x33U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, - 0x10U, 0x04U, 0x14U, 0x05U, 0x00U, 0x08U, 0x26U, 0x05U, 0x00U, 0x0CU, 0x0CU, 0x01U, 0x0CU, 0x88U, 0x30U, 0x00U, - 0x00U, 0x1CU, 0x0EU, 0x04U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0xC7U, 0x08U, - 0x1AU, 0x80U, 0x10U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x02U, 0xC0U, 0x25U, 0x00U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x02U, 0xC0U, 0x25U, 0x01U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x02U, 0xC0U, 0x25U, 0x02U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x02U, 0xC0U, 0x25U, 0x03U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x02U, 0xC0U, 0x25U, 0x04U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x02U, 0xC0U, 0x25U, 0x05U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x02U, 0xC0U, 0x25U, 0x06U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x02U, 0xC0U, 0x25U, 0x07U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xF2U, 0x01U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x33U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0xB0U, 0x05U, 0x02U, 0x10U, 0x04U, 0x14U, 0x05U, 0x00U, 0x08U, 0x26U, 0x05U, 0x00U, 0x0CU, 0x0CU, 0x01U, - 0x0CU, 0x88U, 0x30U, 0x00U, 0x00U, 0x1CU, 0x0EU, 0x04U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x08U, 0x44U, 0x14U, 0x00U, - 0x06U, 0x48U, 0x07U, 0x07U, 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x06U, 0x00U, 0xC4U, 0x01U, 0x01U, 0x08U, 0x1CU, 0xFFU, 0x01U, 0x0CU, 0x1CU, 0xFFU, - 0x01U, 0x10U, 0x1CU, 0xFFU, 0x01U, 0x14U, 0x1CU, 0xFFU, 0x11U, 0x08U, 0x20U, 0x00U, 0x02U, 0xC0U, 0x25U, 0x00U, - 0x11U, 0x0CU, 0x30U, 0x00U, 0x02U, 0xC0U, 0x35U, 0x01U, 0x11U, 0x10U, 0x40U, 0x00U, 0x02U, 0xC0U, 0x45U, 0x02U, - 0x11U, 0x14U, 0x50U, 0x00U, 0x02U, 0xC0U, 0x55U, 0x03U, 0x01U, 0x08U, 0x1CU, 0xFFU, 0x01U, 0x0CU, 0x1CU, 0xFFU, - 0x01U, 0x10U, 0x1CU, 0xFFU, 0x01U, 0x14U, 0x1CU, 0x08U, 0x11U, 0x08U, 0x20U, 0x00U, 0x02U, 0xC0U, 0x25U, 0x04U, - 0x11U, 0x0CU, 0x30U, 0x00U, 0x02U, 0xC0U, 0x35U, 0x05U, 0x11U, 0x10U, 0x40U, 0x00U, 0x02U, 0xC0U, 0x45U, 0x06U, - 0x11U, 0x14U, 0x50U, 0x00U, 0x02U, 0xC0U, 0x55U, 0x07U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xA2U, 0x03U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x33U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, 0x06U, 0x18U, 0x10U, 0x00U, - 0x10U, 0x04U, 0x14U, 0x05U, 0x00U, 0x08U, 0x26U, 0x05U, 0x00U, 0x0CU, 0x0CU, 0x01U, 0x0CU, 0x88U, 0x30U, 0x00U, - 0x00U, 0x1CU, 0x0EU, 0x04U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0xC7U, 0x06U, - 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x01U, 0x88U, 0x15U, 0xFFU, 0x01U, 0x8CU, 0x15U, 0xFFU, 0x01U, 0x90U, 0x15U, 0xFFU, 0x01U, 0x94U, 0x15U, 0xFFU, - 0x11U, 0x08U, 0x20U, 0x00U, 0x02U, 0xC0U, 0x25U, 0x00U, 0x11U, 0x0CU, 0x30U, 0x00U, 0x02U, 0xC0U, 0x35U, 0x01U, - 0x11U, 0x10U, 0x40U, 0x00U, 0x02U, 0xC0U, 0x45U, 0x02U, 0x11U, 0x14U, 0x50U, 0x00U, 0x02U, 0xC0U, 0x55U, 0x03U, - 0x01U, 0x88U, 0x15U, 0xFFU, 0x01U, 0x8CU, 0x15U, 0xFFU, 0x01U, 0x90U, 0x15U, 0xFFU, 0x01U, 0x94U, 0x15U, 0xFFU, - 0x11U, 0x08U, 0x20U, 0x00U, 0x02U, 0xC0U, 0x25U, 0x04U, 0x11U, 0x0CU, 0x30U, 0x00U, 0x02U, 0xC0U, 0x35U, 0x05U, - 0x11U, 0x10U, 0x40U, 0x00U, 0x02U, 0xC0U, 0x45U, 0x06U, 0x11U, 0x14U, 0x50U, 0x00U, 0x02U, 0xC0U, 0x55U, 0x07U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x52U, 0x05U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x33U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0xB0U, 0x05U, 0x02U, 0x10U, 0x04U, 0x14U, 0x05U, 0x00U, 0x08U, 0x26U, 0x05U, 0x00U, 0x0CU, 0x0CU, 0x01U, - 0x0CU, 0x88U, 0x30U, 0x00U, 0x00U, 0x1CU, 0x0EU, 0x04U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x08U, 0x44U, 0x14U, 0x00U, - 0x06U, 0x48U, 0xC7U, 0x04U, 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x02U, 0xC0U, 0x25U, 0x00U, 0x02U, 0xC0U, 0x35U, 0x01U, 0x02U, 0xC0U, 0x45U, 0x02U, - 0x02U, 0xC0U, 0x55U, 0x03U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x02U, 0xC0U, 0x25U, 0x04U, 0x02U, 0xC0U, 0x35U, 0x05U, 0x02U, 0xC0U, 0x45U, 0x06U, - 0x02U, 0xC0U, 0x55U, 0x07U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, - 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xBAU, 0x06U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x04U, 0x18U, 0x04U, 0x33U, 0x10U, 0x18U, 0x68U, 0x02U, 0x10U, 0x18U, 0x60U, 0x02U, 0x01U, 0x80U, 0x05U, 0x00U, - 0x01U, 0xA4U, 0x05U, 0x01U, 0x01U, 0x84U, 0x05U, 0x02U, 0x01U, 0xB0U, 0x05U, 0x03U, 0x10U, 0x04U, 0x14U, 0x06U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, - 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, - 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, - 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, - 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, - 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, - 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, - 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, - 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x02U, 0x44U, 0x3EU, 0x01U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, - 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, - 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, - 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, - 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, - 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, - 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, - 0x02U, 0x44U, 0x3EU, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, - 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, - 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, - 0x10U, 0xCCU, 0x70U, 0x4BU, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, - 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, - 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, - 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, 0x02U, 0x44U, 0x3EU, 0x01U, - 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, - 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, 0x02U, 0x44U, 0x3EU, 0x01U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, - 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, - 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, - 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, - 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, - 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, - 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, - 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, - 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x02U, 0x44U, 0x3EU, 0x01U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, - 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, - 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, - 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, - 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, - 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, - 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, - 0x02U, 0x44U, 0x3EU, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, - 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, - 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, - 0x10U, 0xCCU, 0x70U, 0x4BU, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, - 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, - 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, - 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, 0x02U, 0x44U, 0x3EU, 0x01U, - 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, - 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, 0x02U, 0x44U, 0x3EU, 0x01U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x42U, 0x07U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, - 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x1AU, 0x11U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x33U, 0x10U, 0x18U, 0x68U, 0x02U, - 0x10U, 0x18U, 0x60U, 0x02U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, - 0x10U, 0x04U, 0x14U, 0x06U, 0x00U, 0x08U, 0x26U, 0x05U, 0x00U, 0x0CU, 0x0CU, 0x01U, 0x0CU, 0x88U, 0x30U, 0x00U, - 0x00U, 0x1CU, 0x0EU, 0x04U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x24U, 0x10U, 0xCCU, 0x40U, 0x45U, 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x28U, - 0x10U, 0xCCU, 0x40U, 0x48U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x10U, 0x90U, 0x40U, 0x30U, 0x10U, 0xCCU, 0x40U, 0x4BU, - 0x02U, 0xC0U, 0x35U, 0x00U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, - 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x48U, 0x50U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x0DU, 0x90U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x53U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x24U, 0x10U, 0xCCU, 0x40U, 0x55U, 0x02U, 0xC0U, 0x35U, 0x01U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x10U, 0x90U, 0x40U, 0x30U, 0x10U, 0xCCU, 0x48U, 0x45U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0xCCU, 0x48U, 0x43U, 0x00U, 0x10U, 0x84U, 0x0FU, - 0x10U, 0x90U, 0x40U, 0x38U, 0x10U, 0xCCU, 0x48U, 0x40U, 0x02U, 0xC0U, 0x35U, 0x02U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x24U, - 0x10U, 0xCCU, 0x40U, 0x45U, 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x28U, 0x10U, 0xCCU, 0x40U, 0x48U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x10U, 0x90U, 0x40U, 0x30U, 0x10U, 0xCCU, 0x40U, 0x4BU, 0x02U, 0xC0U, 0x35U, 0x03U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x00U, 0x10U, 0x84U, 0x0FU, - 0x10U, 0x90U, 0x40U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x48U, 0x50U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x0DU, 0x90U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x53U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x24U, - 0x10U, 0xCCU, 0x40U, 0x55U, 0x02U, 0xC0U, 0x35U, 0x04U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x10U, 0x90U, 0x40U, 0x30U, 0x10U, 0xCCU, 0x48U, 0x45U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0xCCU, 0x48U, 0x43U, 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x38U, - 0x10U, 0xCCU, 0x48U, 0x40U, 0x02U, 0xC0U, 0x35U, 0x05U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x0DU, 0x8CU, 0x40U, 0x03U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x24U, 0x10U, 0xCCU, 0x40U, 0x45U, - 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x28U, 0x10U, 0xCCU, 0x40U, 0x48U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x10U, 0x90U, 0x40U, 0x30U, 0x10U, 0xCCU, 0x40U, 0x4BU, 0x02U, 0xC0U, 0x35U, 0x06U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x38U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x48U, 0x50U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x0DU, 0x90U, 0x40U, 0x00U, - 0x10U, 0xCCU, 0x40U, 0x53U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x24U, 0x10U, 0xCCU, 0x40U, 0x55U, - 0x02U, 0xC0U, 0x35U, 0x07U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x10U, 0x90U, 0x40U, 0x30U, 0x10U, 0xCCU, 0x48U, 0x45U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0xCCU, 0x48U, 0x43U, 0x00U, 0x10U, 0x84U, 0x0FU, - 0x10U, 0x90U, 0x40U, 0x38U, 0x10U, 0xCCU, 0x48U, 0x40U, 0x02U, 0xC0U, 0x35U, 0x00U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x24U, - 0x10U, 0xCCU, 0x40U, 0x45U, 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x28U, 0x10U, 0xCCU, 0x40U, 0x48U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x10U, 0x90U, 0x40U, 0x30U, 0x10U, 0xCCU, 0x40U, 0x4BU, 0x02U, 0xC0U, 0x35U, 0x01U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x00U, 0x10U, 0x84U, 0x0FU, - 0x10U, 0x90U, 0x40U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x48U, 0x50U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x0DU, 0x90U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x53U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x24U, - 0x10U, 0xCCU, 0x40U, 0x55U, 0x02U, 0xC0U, 0x35U, 0x02U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x10U, 0x90U, 0x40U, 0x30U, 0x10U, 0xCCU, 0x48U, 0x45U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0xCCU, 0x48U, 0x43U, 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x38U, - 0x10U, 0xCCU, 0x48U, 0x40U, 0x02U, 0xC0U, 0x35U, 0x03U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x0DU, 0x8CU, 0x40U, 0x03U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x24U, 0x10U, 0xCCU, 0x40U, 0x45U, - 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x28U, 0x10U, 0xCCU, 0x40U, 0x48U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x10U, 0x90U, 0x40U, 0x30U, 0x10U, 0xCCU, 0x40U, 0x4BU, 0x02U, 0xC0U, 0x35U, 0x04U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x38U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x48U, 0x50U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x0DU, 0x90U, 0x40U, 0x00U, - 0x10U, 0xCCU, 0x40U, 0x53U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x24U, 0x10U, 0xCCU, 0x40U, 0x55U, - 0x02U, 0xC0U, 0x35U, 0x05U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x10U, 0x90U, 0x40U, 0x30U, 0x10U, 0xCCU, 0x48U, 0x45U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, - 0x10U, 0xCCU, 0x48U, 0x43U, 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x38U, 0x10U, 0xCCU, 0x48U, 0x40U, - 0x02U, 0xC0U, 0x35U, 0x06U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x24U, 0x10U, 0xCCU, 0x40U, 0x45U, 0x00U, 0x10U, 0x84U, 0x0FU, - 0x10U, 0x90U, 0x40U, 0x28U, 0x10U, 0xCCU, 0x40U, 0x48U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x10U, 0x90U, 0x40U, 0x30U, - 0x10U, 0xCCU, 0x40U, 0x4BU, 0x02U, 0xC0U, 0x35U, 0x07U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x00U, 0x10U, 0x84U, 0x0FU, - 0x10U, 0x90U, 0x40U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x48U, 0x50U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x0DU, 0x90U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x53U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x24U, - 0x10U, 0xCCU, 0x40U, 0x55U, 0x02U, 0xC0U, 0x35U, 0x00U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x10U, 0x90U, 0x40U, 0x30U, 0x10U, 0xCCU, 0x48U, 0x45U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0xCCU, 0x48U, 0x43U, 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x38U, - 0x10U, 0xCCU, 0x48U, 0x40U, 0x02U, 0xC0U, 0x35U, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x0DU, 0x8CU, 0x40U, 0x03U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x24U, 0x10U, 0xCCU, 0x40U, 0x45U, - 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x28U, 0x10U, 0xCCU, 0x40U, 0x48U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x10U, 0x90U, 0x40U, 0x30U, 0x10U, 0xCCU, 0x40U, 0x4BU, 0x02U, 0xC0U, 0x35U, 0x02U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x38U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x48U, 0x50U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x0DU, 0x90U, 0x40U, 0x00U, - 0x10U, 0xCCU, 0x40U, 0x53U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x24U, 0x10U, 0xCCU, 0x40U, 0x55U, - 0x02U, 0xC0U, 0x35U, 0x03U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x10U, 0x90U, 0x40U, 0x30U, 0x10U, 0xCCU, 0x48U, 0x45U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, - 0x10U, 0xCCU, 0x48U, 0x43U, 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x38U, 0x10U, 0xCCU, 0x48U, 0x40U, - 0x02U, 0xC0U, 0x35U, 0x04U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x24U, 0x10U, 0xCCU, 0x40U, 0x45U, 0x00U, 0x10U, 0x84U, 0x0FU, - 0x10U, 0x90U, 0x40U, 0x28U, 0x10U, 0xCCU, 0x40U, 0x48U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x10U, 0x90U, 0x40U, 0x30U, - 0x10U, 0xCCU, 0x40U, 0x4BU, 0x02U, 0xC0U, 0x35U, 0x05U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, - 0x10U, 0x0CU, 0x48U, 0x13U, 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x10U, 0xCCU, 0x48U, 0x50U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x0DU, 0x90U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x53U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x24U, 0x10U, 0xCCU, 0x40U, 0x55U, 0x02U, 0xC0U, 0x35U, 0x06U, - 0x00U, 0x10U, 0x86U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x10U, 0x90U, 0x40U, 0x30U, - 0x10U, 0xCCU, 0x48U, 0x45U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0xCCU, 0x48U, 0x43U, - 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x38U, 0x10U, 0xCCU, 0x48U, 0x40U, 0x02U, 0xC0U, 0x35U, 0x07U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xD2U, 0x11U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xE2U, 0x1BU, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x33U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, 0x10U, 0x04U, 0x14U, 0x07U, - 0x00U, 0x18U, 0xFEU, 0x8FU, 0x00U, 0x08U, 0x26U, 0x05U, 0x00U, 0x0CU, 0x0CU, 0x01U, 0x0CU, 0x88U, 0x30U, 0x00U, - 0x00U, 0x1CU, 0x0EU, 0x04U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0xC7U, 0x1BU, - 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x00U, 0x02U, 0xC0U, 0x35U, 0x01U, - 0x02U, 0xC0U, 0x45U, 0x02U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x03U, - 0x02U, 0xC0U, 0x35U, 0x04U, 0x02U, 0xC0U, 0x45U, 0x05U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, - 0x02U, 0xC0U, 0x25U, 0x06U, 0x02U, 0xC0U, 0x35U, 0x07U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x02U, 0xC0U, 0x45U, 0x00U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x01U, - 0x02U, 0xC0U, 0x35U, 0x02U, 0x02U, 0xC0U, 0x45U, 0x03U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, - 0x02U, 0xC0U, 0x25U, 0x04U, 0x02U, 0xC0U, 0x35U, 0x05U, 0x02U, 0xC0U, 0x45U, 0x06U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x07U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x02U, 0xC0U, 0x35U, 0x00U, 0x02U, 0xC0U, 0x45U, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, - 0x02U, 0xC0U, 0x25U, 0x02U, 0x02U, 0xC0U, 0x35U, 0x03U, 0x02U, 0xC0U, 0x45U, 0x04U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x05U, 0x02U, 0xC0U, 0x35U, 0x06U, 0x02U, 0xC0U, 0x45U, 0x07U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x32U, 0x20U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x33U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0xB0U, 0x05U, 0x02U, 0x10U, 0x04U, 0x14U, 0x07U, 0x00U, 0x18U, 0xFEU, 0x8FU, 0x00U, 0x08U, 0x26U, 0x05U, - 0x00U, 0x0CU, 0x0CU, 0x01U, 0x0CU, 0x88U, 0x30U, 0x00U, 0x00U, 0x1CU, 0x0EU, 0x04U, 0x0CU, 0xDCU, 0x21U, 0x00U, - 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0xC7U, 0x21U, 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x00U, - 0x02U, 0xC0U, 0x35U, 0x01U, 0x02U, 0xC0U, 0x45U, 0x02U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x03U, - 0x02U, 0xC0U, 0x35U, 0x04U, 0x02U, 0xC0U, 0x45U, 0x05U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x06U, - 0x02U, 0xC0U, 0x35U, 0x07U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x02U, 0xC0U, 0x45U, 0x00U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x01U, 0x02U, 0xC0U, 0x35U, 0x02U, 0x02U, 0xC0U, 0x45U, 0x03U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x04U, 0x02U, 0xC0U, 0x35U, 0x05U, 0x02U, 0xC0U, 0x45U, 0x06U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x07U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x02U, 0xC0U, 0x35U, 0x00U, 0x02U, 0xC0U, 0x45U, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x02U, - 0x02U, 0xC0U, 0x35U, 0x03U, 0x02U, 0xC0U, 0x45U, 0x04U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x05U, - 0x02U, 0xC0U, 0x35U, 0x06U, 0x02U, 0xC0U, 0x45U, 0x07U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x42U, 0x25U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x33U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, 0x00U, 0x18U, 0xFEU, 0x8FU, - 0x06U, 0x00U, 0x10U, 0x00U, 0x10U, 0x04U, 0x14U, 0x07U, 0x00U, 0x08U, 0x26U, 0x05U, 0x00U, 0x0CU, 0x0CU, 0x01U, - 0x0CU, 0x88U, 0x30U, 0x00U, 0x00U, 0x1CU, 0x0EU, 0x04U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x08U, 0x44U, 0x14U, 0x00U, - 0x06U, 0x48U, 0xC7U, 0x21U, 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, - 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x00U, 0x02U, 0xC0U, 0x35U, 0x01U, - 0x02U, 0xC0U, 0x45U, 0x02U, 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, - 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x03U, 0x02U, 0xC0U, 0x35U, 0x04U, - 0x02U, 0xC0U, 0x45U, 0x05U, 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, - 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x06U, 0x02U, 0xC0U, 0x35U, 0x07U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x02U, 0xC0U, 0x45U, 0x00U, 0x01U, 0x08U, 0x14U, 0xFFU, - 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, - 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, - 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, - 0x02U, 0xC0U, 0x25U, 0x01U, 0x02U, 0xC0U, 0x35U, 0x02U, 0x02U, 0xC0U, 0x45U, 0x03U, 0x01U, 0x08U, 0x14U, 0xFFU, - 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, - 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, - 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, - 0x02U, 0xC0U, 0x25U, 0x04U, 0x02U, 0xC0U, 0x35U, 0x05U, 0x02U, 0xC0U, 0x45U, 0x06U, 0x01U, 0x08U, 0x14U, 0xFFU, - 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, - 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, - 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, - 0x02U, 0xC0U, 0x25U, 0x07U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x02U, 0xC0U, 0x35U, 0x00U, - 0x02U, 0xC0U, 0x45U, 0x01U, 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, - 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x02U, 0x02U, 0xC0U, 0x35U, 0x03U, - 0x02U, 0xC0U, 0x45U, 0x04U, 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, - 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x05U, 0x02U, 0xC0U, 0x35U, 0x06U, - 0x02U, 0xC0U, 0x45U, 0x07U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, - 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x5AU, 0x2AU, 0x00U}; - -const uint32_t s_smartdmaDisplayFirmwareSize = sizeof(s_smartdmaDisplayFirmware); - -const uint8_t s_smartdmaCameraFirmware[] = { - 0x21U, 0x00U, 0x00U, 0x04U, 0xE1U, 0x00U, 0x00U, 0x04U, 0xE1U, 0x02U, 0x00U, 0x04U, 0x00U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x04U, 0x18U, 0x04U, 0x33U, 0x10U, 0x18U, 0x68U, 0x02U, 0x10U, 0x18U, 0x60U, 0x02U, 0x01U, 0xB0U, 0x05U, 0x00U, - 0x01U, 0x8CU, 0x05U, 0x01U, 0x01U, 0x68U, 0x07U, 0x01U, 0x01U, 0x6CU, 0x07U, 0x01U, 0x06U, 0x74U, 0x47U, 0x00U, - 0x00U, 0x88U, 0x00U, 0x00U, 0x01U, 0x92U, 0x6CU, 0xDBU, 0x18U, 0x64U, 0x02U, 0x20U, 0x18U, 0x64U, 0x02U, 0x21U, - 0x18U, 0x64U, 0x02U, 0x22U, 0x18U, 0x64U, 0x02U, 0x23U, 0x18U, 0x64U, 0x02U, 0x24U, 0x18U, 0x64U, 0x02U, 0x25U, - 0x18U, 0x64U, 0x02U, 0x26U, 0x18U, 0x64U, 0x02U, 0x27U, 0x18U, 0x64U, 0x02U, 0xD2U, 0x00U, 0x04U, 0xF4U, 0x0FU, - 0x1CU, 0x36U, 0xD0U, 0x04U, 0x10U, 0x40U, 0xE8U, 0x20U, 0x18U, 0xECU, 0x02U, 0xC2U, 0x9FU, 0x00U, 0x00U, 0x04U, - 0xBBU, 0x00U, 0x00U, 0x04U, 0x02U, 0xC4U, 0x08U, 0x01U, 0x83U, 0x00U, 0x00U, 0x04U, 0x18U, 0xECU, 0x02U, 0xC0U, - 0x18U, 0xECU, 0x02U, 0xC1U, 0x18U, 0xECU, 0x02U, 0xC2U, 0x01U, 0x8CU, 0x05U, 0x01U, 0x18U, 0x20U, 0x02U, 0xF2U, - 0x05U, 0x44U, 0x00U, 0x33U, 0x83U, 0x00U, 0x00U, 0x04U, 0x18U, 0xCCU, 0x00U, 0x20U, 0x18U, 0xCCU, 0x00U, 0x21U, - 0x18U, 0xECU, 0x02U, 0xC1U, 0x18U, 0xECU, 0x02U, 0xC2U, 0x18U, 0x20U, 0x02U, 0xF2U, 0x83U, 0x00U, 0x00U, 0x04U, - 0x70U, 0x47U, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, - 0x12U, 0x00U, 0x00U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x04U, 0x18U, 0x04U, 0x33U, 0x10U, 0x18U, 0x68U, 0x02U, 0x10U, 0x18U, 0x60U, 0x02U, 0x01U, 0xB0U, 0x05U, 0x00U, - 0x01U, 0x8CU, 0x05U, 0x03U, 0x01U, 0x68U, 0x07U, 0x01U, 0x01U, 0x6CU, 0x07U, 0x01U, 0x06U, 0x74U, 0x47U, 0x00U, - 0x00U, 0x88U, 0x00U, 0x00U, 0x01U, 0x92U, 0x6CU, 0xDBU, 0x18U, 0x64U, 0x02U, 0x20U, 0x18U, 0x64U, 0x02U, 0x21U, - 0x18U, 0x64U, 0x02U, 0x22U, 0x18U, 0x64U, 0x02U, 0x23U, 0x18U, 0x64U, 0x02U, 0x24U, 0x18U, 0x64U, 0x02U, 0x25U, - 0x18U, 0x64U, 0x02U, 0x26U, 0x18U, 0x64U, 0x02U, 0x27U, 0x18U, 0x64U, 0x02U, 0xD2U, 0x00U, 0x08U, 0x14U, 0x00U, - 0x00U, 0x14U, 0x04U, 0x00U, 0x1CU, 0x36U, 0xD0U, 0x04U, 0x0DU, 0x80U, 0xF7U, 0x0FU, 0x18U, 0xECU, 0x02U, 0xC2U, - 0x67U, 0x01U, 0x00U, 0x04U, 0x87U, 0x01U, 0x00U, 0x04U, 0x08U, 0x76U, 0xC7U, 0x01U, 0x02U, 0xC4U, 0x08U, 0x01U, - 0x18U, 0x20U, 0x02U, 0xF2U, 0x18U, 0xECU, 0x02U, 0xC0U, 0x00U, 0x08U, 0x14U, 0x00U, 0x00U, 0x14U, 0x04U, 0x00U, - 0x18U, 0xECU, 0x02U, 0xC1U, 0x18U, 0xECU, 0x02U, 0xC2U, 0x01U, 0x8CU, 0x05U, 0x03U, 0x18U, 0x20U, 0x02U, 0xF2U, - 0x47U, 0x01U, 0x00U, 0x04U, 0x18U, 0xCCU, 0x00U, 0x20U, 0x18U, 0xCCU, 0x00U, 0x21U, 0x00U, 0x14U, 0x04U, 0x00U, - 0x0DU, 0x88U, 0xF4U, 0x1FU, 0x01U, 0x90U, 0x05U, 0x02U, 0x0EU, 0x82U, 0xF4U, 0x00U, 0x20U, 0x04U, 0x04U, 0x00U, - 0x22U, 0x00U, 0x15U, 0x00U, 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0xE4U, 0x01U, 0x20U, 0x04U, 0x14U, 0x00U, - 0x22U, 0x00U, 0x15U, 0x00U, 0x21U, 0x8CU, 0x05U, 0x03U, 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0xD4U, 0x02U, - 0x20U, 0x04U, 0x24U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0xC4U, 0x03U, - 0x20U, 0x04U, 0x34U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x21U, 0x8CU, 0x05U, 0x03U, 0x25U, 0x44U, 0x00U, 0x33U, - 0x0EU, 0x82U, 0xB4U, 0x04U, 0x20U, 0x04U, 0x44U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x25U, 0x44U, 0x00U, 0x33U, - 0x0EU, 0x82U, 0xA4U, 0x05U, 0x20U, 0x04U, 0x54U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x21U, 0x8CU, 0x05U, 0x03U, - 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x94U, 0x06U, 0x20U, 0x04U, 0x64U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, - 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x84U, 0x07U, 0x20U, 0x04U, 0x74U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, - 0x21U, 0x8CU, 0x05U, 0x03U, 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x74U, 0x08U, 0x20U, 0x04U, 0x84U, 0x00U, - 0x22U, 0x00U, 0x15U, 0x00U, 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x64U, 0x09U, 0x20U, 0x04U, 0x94U, 0x00U, - 0x22U, 0x00U, 0x15U, 0x00U, 0x21U, 0x8CU, 0x05U, 0x03U, 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x54U, 0x0AU, - 0x20U, 0x04U, 0xA4U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x44U, 0x0BU, - 0x20U, 0x04U, 0xB4U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x21U, 0x8CU, 0x05U, 0x03U, 0x25U, 0x44U, 0x00U, 0x33U, - 0x0EU, 0x82U, 0x34U, 0x0CU, 0x20U, 0x04U, 0xC4U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x25U, 0x44U, 0x00U, 0x33U, - 0x0EU, 0x82U, 0x24U, 0x0DU, 0x20U, 0x04U, 0xD4U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x21U, 0x8CU, 0x05U, 0x03U, - 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x14U, 0x0EU, 0x20U, 0x04U, 0xE4U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, - 0x25U, 0x44U, 0x00U, 0x33U, 0x18U, 0xECU, 0x02U, 0xC1U, 0x18U, 0xECU, 0x02U, 0xC2U, 0x0EU, 0x82U, 0x04U, 0x0FU, - 0x20U, 0x04U, 0xF4U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x21U, 0x8CU, 0x05U, 0x03U, 0x25U, 0x44U, 0x00U, 0x33U, - 0x38U, 0xECU, 0x02U, 0x21U, 0x38U, 0xECU, 0x02U, 0x22U, 0x06U, 0x88U, 0x14U, 0x00U, 0x18U, 0x20U, 0x02U, 0xF2U, - 0x47U, 0x01U, 0x00U, 0x04U, 0x70U, 0x47U, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, - 0x12U, 0x00U, 0x00U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x04U, 0x18U, 0x04U, 0x33U, 0x10U, 0x18U, 0x68U, 0x02U, 0x10U, 0x18U, 0x60U, 0x02U, 0x01U, 0xB0U, 0x05U, 0x00U, - 0x01U, 0x8CU, 0x05U, 0x01U, 0x01U, 0x68U, 0x07U, 0x01U, 0x01U, 0x6CU, 0x07U, 0x01U, 0x06U, 0x74U, 0x47U, 0x00U, - 0x00U, 0x88U, 0x00U, 0x00U, 0x01U, 0x92U, 0x6CU, 0xDBU, 0x18U, 0x64U, 0x02U, 0x20U, 0x18U, 0x64U, 0x02U, 0x21U, - 0x18U, 0x64U, 0x02U, 0x22U, 0x18U, 0x64U, 0x02U, 0x23U, 0x18U, 0x64U, 0x02U, 0x24U, 0x18U, 0x64U, 0x02U, 0x25U, - 0x18U, 0x64U, 0x02U, 0x26U, 0x18U, 0x64U, 0x02U, 0x27U, 0x18U, 0x64U, 0x02U, 0xD2U, 0x00U, 0x04U, 0xF4U, 0x0FU, - 0x1CU, 0x36U, 0xD0U, 0x04U, 0x10U, 0x40U, 0xE8U, 0x20U, 0x18U, 0xECU, 0x02U, 0xC2U, 0x6BU, 0x03U, 0x00U, 0x04U, - 0x8BU, 0x03U, 0x00U, 0x04U, 0x08U, 0xBEU, 0x04U, 0x3CU, 0x82U, 0xC4U, 0x08U, 0x01U, 0x08U, 0x76U, 0x47U, 0x02U, - 0x98U, 0x20U, 0x02U, 0xF2U, 0x06U, 0x88U, 0x14U, 0x00U, 0x18U, 0xECU, 0x02U, 0xC0U, 0x18U, 0xECU, 0x02U, 0xC1U, - 0x01U, 0x8CU, 0x05U, 0x01U, 0x00U, 0x08U, 0x04U, 0x00U, 0x00U, 0x10U, 0x04U, 0x00U, 0x18U, 0x20U, 0x02U, 0xF2U, - 0x05U, 0x44U, 0x00U, 0x33U, 0x43U, 0x03U, 0x00U, 0x04U, 0x18U, 0xECU, 0x02U, 0xC1U, 0x06U, 0x10U, 0x15U, 0x00U, - 0x08U, 0x3EU, 0x05U, 0x05U, 0xB8U, 0xECU, 0x02U, 0xC2U, 0x08U, 0x3EU, 0x05U, 0x19U, 0xB8U, 0xECU, 0x02U, 0x22U, - 0x00U, 0x08U, 0x04U, 0x00U, 0x43U, 0x03U, 0x00U, 0x04U, 0x70U, 0x47U, 0x00U, 0x00, -}; - -const uint32_t s_smartdmaCameraFirmwareSize = sizeof(s_smartdmaCameraFirmware); - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Codes - ******************************************************************************/ - -void SMARTDMA_IRQHandler(void); -void SMARTDMA_IRQHandler(void) -{ - SMARTDMA_HandleIRQ(); -} - -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_smartdma_mcxn.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_smartdma_mcxn.h deleted file mode 100644 index ceadc88415f..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_smartdma_mcxn.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright 2019-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_SMARTDMA_MCXN_H_ -#define FSL_SMARTDMA_MCXN_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup smartdma_mcxn MCXN SMARTDMA Firmware - * @ingroup smartdma - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -#if defined(MCXN236_SERIES) || defined(MCXN235_SERIES) -#define SMARTDMA_USE_FLEXIO_SHIFTER_DMA 1 -#endif - -/*! @brief The firmware used for display. */ -extern const uint8_t s_smartdmaDisplayFirmware[]; - -/*! @brief The s_smartdmaDisplayFirmware firmware memory address. */ -#define SMARTDMA_DISPLAY_MEM_ADDR 0x04000000U - -/*! @brief Size of s_smartdmaDisplayFirmware */ -#define SMARTDMA_DISPLAY_FIRMWARE_SIZE (s_smartdmaDisplayFirmwareSize) - -/*! @brief Size of s_smartdmaDisplayFirmware */ -extern const uint32_t s_smartdmaDisplayFirmwareSize; - -/*! @brief The firmware used for camera. */ -extern const uint8_t s_smartdmaCameraFirmware[]; - -/*! @brief The s_smartdmaCameraFirmware firmware memory address. */ -#define SMARTDMA_CAMERA_MEM_ADDR 0x04000000U - -/*! @brief Size of s_smartdmacameraFirmware */ -#define SMARTDMA_CAMERA_FIRMWARE_SIZE (s_smartdmaCameraFirmwareSize) - -/*! @brief Size of s_smartdmacameraFirmware */ -extern const uint32_t s_smartdmaCameraFirmwareSize; - -/*! - * @brief The API index when using s_smartdmaDisplayFirmware. - */ -enum _smartdma_display_api -{ - kSMARTDMA_FlexIO_DMA_Endian_Swap = 0U, - kSMARTDMA_FlexIO_DMA_Reverse32, - kSMARTDMA_FlexIO_DMA, - kSMARTDMA_FlexIO_DMA_Reverse, /*!< Send data to FlexIO with reverse order. */ - kSMARTDMA_RGB565To888, /*!< Convert RGB565 to RGB888 and save to output memory, use parameter - smartdma_rgb565_rgb888_param_t. */ - kSMARTDMA_FlexIO_DMA_RGB565To888, /*!< Convert RGB565 to RGB888 and send to FlexIO, use parameter - smartdma_flexio_mculcd_param_t. */ - kSMARTDMA_FlexIO_DMA_ARGB2RGB, /*!< Convert ARGB to RGB and send to FlexIO, use parameter - smartdma_flexio_mculcd_param_t. */ - kSMARTDMA_FlexIO_DMA_ARGB2RGB_Endian_Swap, /*!< Convert ARGB to RGB, then swap endian, and send to FlexIO, use - parameter smartdma_flexio_mculcd_param_t. */ - kSMARTDMA_FlexIO_DMA_ARGB2RGB_Endian_Swap_Reverse, /*!< Convert ARGB to RGB, then swap endian and reverse, and send - to FlexIO, use parameter smartdma_flexio_mculcd_param_t. */ -}; - -/*! - * @brief Parameter for FlexIO MCULCD - */ -typedef struct _smartdma_flexio_mculcd_param -{ - uint32_t *p_buffer; - uint32_t buffersize; - uint32_t *smartdma_stack; -} smartdma_flexio_mculcd_param_t; - -/*! - * @brief Parameter for RGB565To888 - */ -typedef struct _smartdma_rgb565_rgb888_param -{ - uint32_t *inBuf; - uint32_t *outBuf; - uint32_t buffersize; - uint32_t *smartdma_stack; -} smartdma_rgb565_rgb888_param_t; - -/*! - * @brief The API index when using s_smartdmaCameraFirmware - */ -enum _smartdma_camera_api -{ - /*! Save whole camera frame to buffer, only supports QVGA(320x240), QQVGA(160x120). */ - kSMARTDMA_FlexIO_CameraWholeFrame = 0U, - /*! Save only first 1/16 of camera frame to buffer, only supports QVGA(320x240). */ - kSMARTDMA_FlexIO_CameraDiv16Frame = 1U, -}; - -/*! - * @brief Parameter for camera - */ -typedef struct _smartdma_camera_param -{ - uint32_t *smartdma_stack; /*!< Stack used by SMARTDMA, shall be at least 64 bytes. */ - uint32_t *p_buffer; /*!< Buffer to store the received camera data. */ -} smartdma_camera_param_t; - -/*! - * @brief Parameter for all supported APIs. - */ -typedef union -{ - smartdma_flexio_mculcd_param_t flexioMcuLcdParam; /*!< Parameter for flexio MCULCD. */ - smartdma_rgb565_rgb888_param_t rgb565_rgb888Param; /*!< Parameter for RGB565_RGB888 convertion. */ - smartdma_camera_param_t cameraParam; /*!< Parameter for camera. */ -} smartdma_param_t; - -/******************************************************************************* - * APIs - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -#if defined(__cplusplus) -} -#endif - -/* @} */ - -#endif /* FSL_SMARTDMA_MCXN_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_smartdma_prv.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_smartdma_prv.h deleted file mode 100644 index f297aa0687a..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_smartdma_prv.h +++ /dev/null @@ -1,6058 +0,0 @@ -/* - * @brief IOH Architecture B mnemonics - * - * @note - * Copyright 2014, 2019, NXP - * All rights reserved. - * - * @par - * Software that is described herein is for illustrative purposes only - * which provides customers with programming information regarding the - * LPC products. This software is supplied "AS IS" without any warranties of - * any kind, and NXP Semiconductors and its licensor disclaim any and - * all warranties, express or implied, including all implied warranties of - * merchantability, fitness for a particular purpose and non-infringement of - * intellectual property rights. NXP Semiconductors assumes no responsibility - * or liability for the use of the software, conveys no license or rights under any - * patent, copyright, mask work right, or any other intellectual property rights in - * or to any products. NXP Semiconductors reserves the right to make changes - * in the software without notification. NXP Semiconductors also makes no - * representation or warranty that such application will be suitable for the - * specified use without further testing or modification. - * - * @par - * Permission to use, copy, modify, and distribute this software and its - * documentation is hereby granted, under NXP Semiconductors' and its - * licensor's relevant copyrights in the software, without fee, provided that it - * is used in conjunction with NXP Semiconductors microcontrollers. This - * copyright, permission, and disclaimer notice must appear in all copies of - * this code. - */ - -#ifndef FSL_SMARTDMA_PRV_H_ -#define FSL_SMARTDMA_PRV_H_ - -#include "fsl_common.h" - -#define SMARTDMA_INPUT_SOURCE_0 0 -#define SMARTDMA_INPUT_SOURCE_1 1 -#define SMARTDMA_INPUT_SOURCE_2 2 -#define SMARTDMA_INPUT_SOURCE_3 3 -#define SMARTDMA_INPUT_SOURCE_4 4 -#define SMARTDMA_INPUT_SOURCE_5 5 -#define SMARTDMA_INPUT_SOURCE_6 6 -#define SMARTDMA_INPUT_SOURCE_7 7 - -#define BS0(c) (c << 8) -#define BS1(c) (c << 11) -#define BS2(c) (c << 14) -#define BS3(c) (c << 17) -#define BS4(c) (c << 20) -#define BS5(c) (c << 23) -#define BS6(c) (c << 26) -#define BS7(c) (c << 29) - -#define SMARTDMA_DISABLE_EMERGENCY_BIT 8 - -#define SMARTDMA_HANDSHAKE_EVENT 0 -#define SMARTDMA_HANDSHAKE_ENABLE 1 - -#define SMARTDMA_MASK_RESP 2 -#define SMARTDMA_ENABLE_AHBBUF 3 -#define SMARTDMA_ENABLE_GPISYNCH 4 - -typedef enum -{ - ezh_trap_low = 1, - ezh_trap_high = 0 -} trap_pol; - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* SMARTDMA ARCH B */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -#define R0 0x00 -#define R1 0x01 -#define R2 0x02 -#define R3 0x03 -#define R4 0x04 -#define R5 0x05 -#define R6 0x06 -#define R7 0x07 -#define GPO 0x08 -#define GPD 0x09 -#define CFS 0x0a -#define CFM 0x0b -#define SP 0x0c -#define PC 0x0d -#define GPI 0x0e -#define RA 0x0f - -/* Conditional Flags */ -#define EU 0x0 -#define ZE 0x1 -#define NZ 0x2 -#define PO 0x3 -#define NE 0x4 -#define AZ 0x5 -#define ZB 0x6 -#define CA 0x7 -#define NC 0x8 -#define CZ 0x9 -#define SPO 0xa -#define SNE 0xb -#define NBS 0xc -#define NEX 0xd -#define BS 0xe -#define EX 0xf - -#define UNS 0xa -#define NZS 0xb - -#define VECT0 0x1 -#define VECT1 0x2 -#define VECT2 0x4 -#define VECT3 0x8 -#define VECT4 0x10 -#define VECT5 0x20 -#define VECT6 0x40 -#define VECT7 0x80 - -/* Bit Slice Mux cfg */ - -#define BS_1 0 -#define BS_RISE 1 -#define BS_FALL 2 -#define BS_CHANGE 3 -#define BS_SIG 4 -#define BS_SIGN 5 -#define BS_0 6 -#define BS_EVENT 7 - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* Unconditional OpCodes */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -#define E_GOSUB(a30) DCD 0x03 + a30 -#define E_NOP DCD 0x12 -#define E_INT_TRIGGER(x24) DCD 0x14 + (x24 << 8) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_GOTO */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* the pre-processor/linker will calculate it this way (<< relative not allowed) */ -#define E_GOTO(a21) \ - DCD 0x15 + (1 << 9) + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 - -#define E_GOTO_REG(raddr) DCD 0x15 + (raddr << 14) - -/* the pre-processor/linker will calculate it this way (<< relative not allowed) */ -#define E_GOTOL(a21) \ - DCD 0x15 + (1 << 10) + (1 << 9) + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 - -#define E_GOTO_REGL(raddr) DCD 0x15 + (raddr << 14) + (1 << 10) - -#define E_COND_GOTO(cond, a21) \ - DCD 0x15 + (cond << 5) + (1 << 9) + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 - -#define E_COND_GOTO_REG(cond, raddr) DCD 0x15 + (raddr << 14) + (cond << 5) - -/* the pre-processor/linker will calculate it this way (<< relative not allowed) */ -#define E_COND_GOTOL(cond, a21) \ - DCD 0x15 + (1 << 10) + (cond << 5) + (1 << 9) + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 - -#define E_COND_GOTO_REGL(cond, raddr) DCD 0x15 + (raddr << 14) + (1 << 10) + (cond << 5) -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_MOV */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -#define E_MOV(dest, source) DCD 0x0 + (source << 14) + (dest << 10) + (EU << 5) -#define E_MOVS(dest, source) DCD 0x0 + (source << 14) + (dest << 10) + (1 << 9) + (EU << 5) -#define E_COND_MOV(cond, dest, source) DCD 0x0 + (source << 14) + (dest << 10) + (cond << 5) -#define E_COND_MOVS(cond, dest, source) DCD 0x0 + (source << 14) + (dest << 10) + (1 << 9) + (cond << 5) - -/* Invert */ -#define E_MVN(dest, source) DCD 0x0 + (source << 14) + (dest << 10) + (EU << 5) + (1 << 31) -#define E_MVNS(dest, source) DCD 0x0 + (source << 14) + (dest << 10) + (1 << 9) + (EU << 5) + (1 << 31) -#define E_COND_MVN(cond, dest, source) DCD 0x0 + (source << 14) + (dest << 10) + (cond << 5) + (1 << 31) -#define E_COND_MVNS(cond, dest, source) DCD 0x0 + (source << 14) + (dest << 10) + (1 << 9) + (cond << 5) + (1 << 31) - -/* Load Immediate */ -#define E_LOAD_IMM(dest, imm11s) DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (EU << 5) -#define E_LOAD_IMMS(dest, imm11s) DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (1 << 9) + (EU << 5) -#define E_COND_LOAD_IMM(cond, dest, imm11s) DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (cond << 5) -#define E_COND_LOAD_IMMS(cond, dest, imm11s) \ - DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (1 << 9) + (cond << 5) - -/* Load Shifted Immediate */ -#define E_LOAD_SIMM(dest, imm11s, sam) \ - DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (EU << 5) + ((sam & 0xf) << 14) + \ - (((sam & 0x10) >> 4) << 19) -#define E_LOAD_SIMMS(dest, imm11s, sam) \ - DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (1 << 9) + (EU << 5) + ((sam & 0xf) << 14) + \ - (((sam & 0x10) >> 4) << 19) -#define E_COND_LOAD_SIMM(cond, dest, imm11s, sam) \ - DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (cond << 5) + ((sam & 0xf) << 14) + \ - (((sam & 0x10) >> 4) << 19) -#define E_COND_LOAD_SIMMS(cond, dest, imm11s, sam) \ - DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (1 << 9) + (cond << 5) + ((sam & 0xf) << 14) + \ - (((sam & 0x10) >> 4) << 19) - -/* Load Inverted Immediate */ -#define E_LOAD_IMMN(dest, imm11s) DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (EU << 5) + (1 << 31) -#define E_LOAD_IMMNS(dest, imm11s) \ - DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (1 << 9) + (EU << 5) + (1 << 31) -#define E_COND_LOAD_IMMN(cond, dest, imm11s) \ - DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (cond << 5) + (1 << 31) -#define E_COND_LOAD_IMMNS(cond, dest, imm11s) \ - DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (1 << 9) + (cond << 5) + (1 << 31) - -/* Load Shifted then inverted Immediate */ -#define E_LOAD_SIMMN(dest, imm11s, sam) \ - DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (EU << 5) + ((sam & 0xf) << 14) + \ - (((sam & 0x10) >> 4) << 19) + (1 << 31) -#define E_LOAD_SIMMNS(dest, imm11s, sam) \ - DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (1 << 9) + (EU << 5) + ((sam & 0xf) << 14) + \ - (((sam & 0x10) >> 4) << 19) + (1 << 31) -#define E_COND_LOAD_SIMMN(cond, dest, imm11s, sam) \ - DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (cond << 5) + ((sam & 0xf) << 14) + \ - (((sam & 0x10) >> 4) << 19) + (1 << 31) -#define E_COND_LOAD_SIMMNS(cond, dest, imm11s, sam) \ - DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (1 << 9) + (cond << 5) + ((sam & 0xf) << 14) + \ - (((sam & 0x10) >> 4) << 19) + (1 << 31) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_AHB_READ Codes */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Ptr PostIncrement (0 means pre-inc) Rdata Dest */ -/* Pointer WData Source Offset UpdatePointer */ -/* SizeWord Signed Access Cond */ - -/* LDR (Load, Load Byte, LoadByteSigned) */ -#define E_LDR(dest, source, offset8s) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (0 << 20) + (1 << 18) + (0 << 21) + \ - (EU << 5) -#define E_LDRB(dest, source, offset8s) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (0 << 20) + (0 << 18) + (0 << 21) + \ - (EU << 5) -#define E_LDRBS(dest, source, offset8s) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (0 << 20) + (0 << 18) + (1 << 21) + \ - (EU << 5) - -/* Conditional LDR (Load, Load Byte, LoadByteSigned) */ -#define E_COND_LDR(cond, dest, source, offset8s) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (0 << 20) + (1 << 18) + (0 << 21) + \ - (cond << 5) -#define E_COND_LDRB(cond, dest, source, offset8s) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (0 << 20) + (0 << 18) + (0 << 21) + \ - (cond << 5) -#define E_COND_LDRBS(cond, dest, source, offset8s) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (0 << 20) + (0 << 18) + (1 << 21) + \ - (cond << 5) - -/* With Update Pointer */ -#define E_LDR_PRE(dest, source, offset8s) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (1 << 20) + (1 << 18) + (0 << 21) + \ - (EU << 5) -#define E_LDRB_PRE(dest, source, offset8s) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (1 << 20) + (0 << 18) + (0 << 21) + \ - (EU << 5) -#define E_LDRBS_PRE(dest, source, offset8s) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (1 << 20) + (0 << 18) + (1 << 21) + \ - (EU << 5) -#define E_COND_LDR_PRE(cond, dest, source, offset8s) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (1 << 20) + (1 << 18) + (0 << 21) + \ - (cond << 5) -#define E_COND_LDRB_PRE(cond, dest, source, offset8s) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (1 << 20) + (0 << 18) + (0 << 21) + \ - (cond << 5) -#define E_COND_LDRBS_PRE(cond, dest, source, offset8s) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (1 << 20) + (0 << 18) + (1 << 21) + \ - (cond << 5) - -/* With Update Pointer (Post Increment pointer) */ -#define E_LDR_POST(dest, source, offset8s) \ - DCD 0x1 + (1 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (1 << 20) + (1 << 18) + (0 << 21) + \ - (EU << 5) -#define E_LDRB_POST(dest, source, offset8s) \ - DCD 0x1 + (1 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (1 << 20) + (0 << 18) + (0 << 21) + \ - (EU << 5) -#define E_LDRBS_POST(dest, source, offset8s) \ - DCD 0x1 + (1 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (1 << 20) + (0 << 18) + (1 << 21) + \ - (EU << 5) -#define E_COND_LDR_POST(cond, dest, source, offset8s) \ - DCD 0x1 + (1 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (1 << 20) + (1 << 18) + (0 << 21) + \ - (cond << 5) -#define E_COND_LDRB_POST(cond, dest, source, offset8s) \ - DCD 0x1 + (1 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (1 << 20) + (0 << 18) + (0 << 21) + \ - (cond << 5) -#define E_COND_LDRBS_POST(cond, dest, source, offset8s) \ - DCD 0x1 + (1 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (1 << 20) + (0 << 18) + (1 << 21) + \ - (cond << 5) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_AHB_WRITE Codes */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Ptr PostIncrement (0 means pre-inc) Rdata Dest */ -/* Pointer WData Source offset8s UpdatePointer */ -/* SizeWord Signed Access Cond */ - -/* STR (Load, Load Byte, LoadByteSigned) */ -#define E_STR(raddr, rdata, offset8s) \ - DCD 0x2 + (0 << 19) + (raddr << 14) + (rdata << 20) + (offset8s << 24) + (0 << 10) + (1 << 18) + (0 << 11) + \ - (EU << 5) -#define E_STRB(raddr, rdata, offset8s) \ - DCD 0x2 + (0 << 19) + (raddr << 14) + (rdata << 20) + (offset8s << 24) + (0 << 10) + (0 << 18) + (0 << 11) + \ - (EU << 5) - -/* Conditional STR (Load, Load Byte, LoadByteSigned) */ -#define E_COND_STR(cond, raddr, rdata, offset8s) \ - DCD 0x2 + (0 << 19) + (raddr << 14) + (rdata << 20) + (offset8s << 24) + (0 << 10) + (1 << 18) + (0 << 11) + \ - (cond << 5) -#define E_COND_STRB(cond, raddr, rdata, offset8s) \ - DCD 0x2 + (0 << 19) + (raddr << 14) + (rdata << 20) + (offset8s << 24) + (0 << 10) + (0 << 18) + (0 << 11) + \ - (cond << 5) - -/* With Update Pointer */ -#define E_STR_PRE(raddr, rdata, offset8s) \ - DCD 0x2 + (0 << 19) + (raddr << 14) + (rdata << 20) + (offset8s << 24) + (1 << 10) + (1 << 18) + (0 << 11) + \ - (EU << 5) -#define E_STRB_PRE(raddr, rdata, offset8s) \ - DCD 0x2 + (0 << 19) + (raddr << 14) + (rdata << 20) + (offset8s << 24) + (1 << 10) + (0 << 18) + (0 << 11) + \ - (EU << 5) -#define E_COND_STR_PRE(cond, raddr, rdata, offset8s) \ - DCD 0x2 + (0 << 19) + (raddr << 14) + (rdata << 20) + (offset8s << 24) + (1 << 10) + (1 << 18) + (0 << 11) + \ - (cond << 5) -#define E_COND_STRB_PRE(cond, raddr, rdata, offset8s) \ - DCD 0x2 + (0 << 19) + (raddr << 14) + (rdata << 20) + (offset8s << 24) + (1 << 10) + (0 << 18) + (0 << 11) + \ - (cond << 5) - -/* With Update Pointer (Post Increment pointer) */ -#define E_STR_POST(raddr, rdata, offset8s) \ - DCD 0x2 + (1 << 19) + (raddr << 14) + (rdata << 20) + (offset8s << 24) + (1 << 10) + (1 << 18) + (0 << 11) + \ - (EU << 5) -#define E_STRB_POST(raddr, rdata, offset8s) \ - DCD 0x2 + (1 << 19) + (raddr << 14) + (rdata << 20) + (offset8s << 24) + (1 << 10) + (0 << 18) + (0 << 11) + \ - (EU << 5) -#define E_COND_STR_POST(cond, raddr, rdata, offset8s) \ - DCD 0x2 + (1 << 19) + (raddr << 14) + (rdata << 20) + (offset8s << 24) + (1 << 10) + (1 << 18) + (0 << 11) + \ - (cond << 5) -#define E_COND_STRB_POST(cond, raddr, rdata, offset8s) \ - DCD 0x2 + (1 << 19) + (raddr << 14) + (rdata << 20) + (offset8s << 24) + (1 << 10) + (0 << 18) + (0 << 11) + \ - (cond << 5) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* Stack Operations (built up from E_LDR and E_STR codes */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Ptr PostIncrement (0 means pre-inc) Rdata Dest */ -/* Pointer WData Source Offset UpdatePointer - */ -/* SizeWord Signed Access Cond */ - -#define E_PUSH(source) \ - DCD 0x2 + (1 << 19) + (SP << 14) + (source << 20) + (1 << 24) + (1 << 10) + (1 << 18) + (0 << 11) + (EU << 5) -#define E_POP(dest) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (SP << 14) + ((-1) << 24) + (1 << 20) + (1 << 18) + (0 << 21) + (EU << 5) -#define E_PUSHB(source) \ - DCD 0x2 + (1 << 19) + (SP << 14) + (source << 20) + (1 << 24) + (1 << 10) + (0 << 18) + (0 << 11) + (EU << 5) -#define E_POPB(dest) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (SP << 14) + ((-1) << 24) + (1 << 20) + (0 << 18) + (0 << 21) + (EU << 5) - -#define E_POPBS(dest) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (SP << 14) + ((-1) << 24) + (1 << 20) + (0 << 18) + (1 << 21) + (EU << 5) - -#define E_COND_PUSH(cond, source) \ - DCD 0x2 + (1 << 19) + (SP << 14) + (source << 20) + (1 << 24) + (1 << 10) + (1 << 18) + (0 << 11) + (cond << 5) -#define E_COND_POP(cond, dest) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (SP << 14) + ((-1) << 24) + (1 << 20) + (1 << 18) + (0 << 21) + (cond << 5) -#define E_COND_PUSHB(cond, source) \ - DCD 0x2 + (1 << 19) + (SP << 14) + (source << 20) + (1 << 24) + (1 << 10) + (0 << 18) + (0 << 11) + (cond << 5) -#define E_COND_POPB(cond, dest) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (SP << 14) + ((-1) << 24) + (1 << 20) + (0 << 18) + (0 << 21) + (cond << 5) - -#define E_COND_POPBS(cond, dest) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (SP << 14) + ((-1) << 24) + (1 << 20) + (0 << 18) + (1 << 21) + (cond << 5) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_PER_READ Codes */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Address Cond */ - -#define E_PER_READ(dest, addr20) DCD 0x4 + (dest << 10) + ((addr20 & 0x000ffffc) << 12) + (EU << 5) -#define E_COND_PER_READ(cond, dest, addr20) DCD 0x4 + (dest << 10) + ((addr20 & 0x000ffffc) << 12) + (cond << 5) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_PER_WRITE Codes */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Address Cond */ - -#define E_PER_WRITE(source, addr20) \ - DCD 0x5 + (source << 20) + ((addr20 & 0x000ff000) << 12) + ((addr20 & 0x00000ffc) << 8) + (EU << 5) -#define E_COND_PER_WRITE(cond, source, addr20) \ - DCD 0x5 + (source << 20) + ((addr20 & 0x000ff000) << 12) + ((addr20 & 0x00000ffc) << 8) + (cond << 5) - -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_ADD Codes */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Src1 src2 SFlag Cond - */ -/* Imm Use_Imm Invert Result Shift Amount - */ -/* Shift/Rotate Left/Right Flip */ - -/* Add reg to reg */ -#define E_ADD(dest, src1, src2) DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) -#define E_ADDS(dest, src1, src2) DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) -#define E_COND_ADD(cond, dest, src1, src2) DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) -#define E_COND_ADDS(cond, dest, src1, src2) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) - -/* Add reg to reg and invert result */ -#define E_ADDN(dest, src1, src2) DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) -#define E_ADDNS(dest, src1, src2) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) -#define E_COND_ADDN(cond, dest, src1, src2) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) -#define E_COND_ADDNS(cond, dest, src1, src2) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) - -/* Add imm12s to reg */ -#define E_ADD_IMM(dest, src1, imm12s) DCD 0x6 + (dest << 10) + (src1 << 14) + (EU << 5) + (imm12s << 20) + (1 << 18) -#define E_ADD_IMMS(dest, src1, imm12s) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (1 << 9) + (EU << 5) + (imm12s << 20) + (1 << 18) -#define E_COND_ADD_IMM(cond, dest, src1, imm12s) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (cond << 5) + (imm12s << 20) + (1 << 18) -#define E_COND_ADD_IMMS(cond, dest, src1, imm12s) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (1 << 9) + (cond << 5) + (imm12s << 20) + (1 << 18) - -/* Add imm12s to reg and invert result */ -#define E_ADDN_IMM(dest, src1, imm12s) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (EU << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_ADDN_IMMS(dest, src1, imm12s) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (1 << 9) + (EU << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_COND_ADDN_IMM(cond, dest, src1, imm12s) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (cond << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_COND_ADDN_IMMS(cond, dest, src1, imm12s) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (1 << 9) + (cond << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) - -/* Add reg to reg with Post Shift Left */ -#define E_ADD_LSL(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (0 << 31) -#define E_ADD_LSLS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ADD_LSL(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (0 << 31) -#define E_COND_ADD_LSLS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) - -/* Add reg to reg and invert result with Post Shift Left */ -#define E_ADDN_LSL(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_ADDN_LSLS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ADDN_LSL(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ADDN_LSLS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (0 << 31) - -/* Add reg to reg with Post Shift Right */ -#define E_ADD_LSR(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (0 << 31) -#define E_ADD_LSRS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ADD_LSR(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (0 << 31) -#define E_COND_ADD_LSRS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) - -/* Add reg to reg and invert result with Post Shift Right */ -#define E_ADDN_LSR(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_ADDN_LSRS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ADDN_LSR(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ADDN_LSRS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (0 << 31) - -/* Add reg to reg with Post Arith Shift Right */ -#define E_ADD_ASR(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (0 << 31) -#define E_ADD_ASRS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ADD_ASR(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (0 << 31) -#define E_COND_ADD_ASRS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) - -/* Add reg to reg and invert result with Post Arith Shift Right */ -#define E_ADDN_ASR(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_ADDN_ASRS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ADDN_ASR(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ADDN_ASRS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (0 << 31) - -/* Add reg to reg with Post ROR */ -#define E_ADD_ROR(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (0 << 31) -#define E_ADD_RORS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ADD_ROR(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (0 << 31) -#define E_COND_ADD_RORS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) - -/* Add reg to reg and invert result with ROR */ -#define E_ADDN_ROR(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_ADDN_RORS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ADDN_ROR(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ADDN_RORS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (0 << 31) - -/* Add reg to reg with Flip */ -#define E_ADD_F(dest, src1, src2) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((0 & 0x1f) << 24) + (0 << 29) + (0 << 30) + \ - (1 << 31) -#define E_ADD_FS(dest, src1, src2) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_ADD_F(cond, dest, src1, src2) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((0 & 0x1f) << 24) + (0 << 29) + (0 << 30) + \ - (1 << 31) -#define E_COND_ADD_FS(cond, dest, src1, src2) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) - -/* Add reg to reg and invert result with Flip */ -#define E_ADDN_F(dest, src1, src2) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_ADDN_FS(dest, src1, src2) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + ((0 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ADDN_F(cond, dest, src1, src2) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_ADDN_FS(cond, dest, src1, src2) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + ((0 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) - -/* Add reg to reg with Post Shift Left */ -#define E_ADD_FLSL(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_ADD_FLSLS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ADD_FLSL(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_ADD_FLSLS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) - -/* Add reg to reg and invert result with Post Shift Left */ -#define E_ADDN_FLSL(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_ADDN_FLSLS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ADDN_FLSL(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ADDN_FLSLS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (1 << 31) - -/* Add reg to reg with Post Shift Right */ -#define E_ADD_FLSR(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (1 << 31) -#define E_ADD_FLSRS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ADD_FLSR(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (1 << 31) -#define E_COND_ADD_FLSRS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) - -/* Add reg to reg and invert result with Post Shift Right */ -#define E_ADDN_FLSR(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_ADDN_FLSRS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ADDN_FLSR(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ADDN_FLSRS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (1 << 31) - -/* Add reg to reg with Post Arith Shift Right */ -#define E_ADD_FASR(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (1 << 31) -#define E_ADD_FASRS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ADD_FASR(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_ADD_FASRS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) - -/* Add reg to reg and invert result with Post Arith Shift Right */ -#define E_ADDN_FASR(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_ADDN_FASRS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ADDN_FASR(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ADDN_FASRS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (1 << 31) - -/* Add reg to reg with Post ROR */ -#define E_ADD_FROR(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (1 << 31) -#define E_ADD_FRORS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ADD_FROR(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (1 << 31) -#define E_COND_ADD_FRORS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) - -/* Add reg to reg and invert result with ROR */ -#define E_ADDN_FROR(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_ADDN_FRORS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ADDN_FROR(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ADDN_FRORS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (1 << 31) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_SUB Codes */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Src1 src2 SFlag Cond - */ -/* Imm Use_Imm Invert Result Shift Result */ - -/* sub reg from reg */ -#define E_SUB(dest, src1, src2) DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) -#define E_SUBS(dest, src1, src2) DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) -#define E_COND_SUB(cond, dest, src1, src2) DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) -#define E_COND_SUBS(cond, dest, src1, src2) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) - -/* sub reg from reg and invert result */ -#define E_SUBN(dest, src1, src2) DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) -#define E_SUBNS(dest, src1, src2) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) -#define E_COND_SUBN(cond, dest, src1, src2) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) -#define E_COND_SUBNS(cond, dest, src1, src2) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) - -/* sub imm12s from reg */ -#define E_SUB_IMM(dest, src1, imm12s) DCD 0x8 + (dest << 10) + (src1 << 14) + (EU << 5) + (imm12s << 20) + (1 << 18) -#define E_SUB_IMMS(dest, src1, imm12s) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (1 << 9) + (EU << 5) + (imm12s << 20) + (1 << 18) -#define E_COND_SUB_IMM(cond, dest, src1, imm12s) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (cond << 5) + (imm12s << 20) + (1 << 18) -#define E_COND_SUB_IMMS(cond, dest, src1, imm12s) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (1 << 9) + (cond << 5) + (imm12s << 20) + (1 << 18) - -/* sub imm12s from reg and invert result */ -#define E_SUBN_IMM(dest, src1, imm12s) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (EU << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_SUBN_IMMS(dest, src1, imm12s) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (1 << 9) + (EU << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_COND_SUBN_IMM(cond, dest, src1, imm12s) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (cond << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_COND_SUBN_IMMS(cond, dest, src1, imm12s) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (1 << 9) + (cond << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) - -/* SUB reg to reg with Post Shift Left */ -#define E_SUB_LSL(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (0 << 31) -#define E_SUB_LSLS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_SUB_LSL(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (0 << 31) -#define E_COND_SUB_LSLS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) - -/* SUB reg to reg and invert result with Post Shift Left */ -#define E_SUBN_LSL(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_SUBN_LSLS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_SUBN_LSL(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_SUBN_LSLS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (0 << 31) - -/* SUB reg to reg with Post Shift Right */ -#define E_SUB_LSR(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (0 << 31) -#define E_SUB_LSRS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_SUB_LSR(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (0 << 31) -#define E_COND_SUB_LSRS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) - -/* SUB reg to reg and invert result with Post Shift Right */ -#define E_SUBN_LSR(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_SUBN_LSRS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_SUBN_LSR(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_SUBN_LSRS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (0 << 31) - -/* SUB reg to reg with Post Arith Shift Right */ -#define E_SUB_ASR(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (0 << 31) -#define E_SUB_ASRS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_SUB_ASR(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (0 << 31) -#define E_COND_SUB_ASRS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) - -/* SUB reg to reg and invert result with Post Arith Shift Right */ -#define E_SUBN_ASR(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_SUBN_ASRS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_SUBN_ASR(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_SUBN_ASRS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (0 << 31) - -/* SUB reg to reg with Post ROR */ -#define E_SUB_ROR(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (0 << 31) -#define E_SUB_RORS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_SUB_ROR(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (0 << 31) -#define E_COND_SUB_RORS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) - -/* SUB reg to reg and invert result with ROR */ -#define E_SUBN_ROR(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_SUBN_RORS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_SUBN_ROR(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_SUBN_RORS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (0 << 31) - -/* Flip Endianness and then shift5/Rotate */ - -/* Sub reg to reg with Flip */ -#define E_SUB_F(dest, src1, src2) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((0 & 0x1f) << 24) + (0 << 29) + (0 << 30) + \ - (1 << 31) -#define E_SUB_FS(dest, src1, src2) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_SUB_F(cond, dest, src1, src2) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((0 & 0x1f) << 24) + (0 << 29) + (0 << 30) + \ - (1 << 31) -#define E_COND_SUB_FS(cond, dest, src1, src2) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) - -/* Sub reg to reg and invert result with Flip */ -#define E_SUBN_F(dest, src1, src2) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_SUBN_FS(dest, src1, src2) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + ((0 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_SUBN_F(cond, dest, src1, src2) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_SUBN_FS(cond, dest, src1, src2) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + ((0 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) - -/* SUB reg to reg with Post Shift Left */ -#define E_SUB_FLSL(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_SUB_FLSLS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_SUB_FLSL(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_SUB_FLSLS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) - -/* SUB reg to reg and invert result with Post Shift Left */ -#define E_SUBN_FLSL(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_SUBN_FLSLS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_SUBN_FLSL(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_SUBN_FLSLS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (1 << 31) - -/* SUB reg to reg with Post Shift Right */ -#define E_SUB_FLSR(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (1 << 31) -#define E_SUB_FLSRS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_SUB_FLSR(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (1 << 31) -#define E_COND_SUB_FLSRS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) - -/* SUB reg to reg and invert result with Post Shift Right */ -#define E_SUBN_FLSR(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_SUBN_FLSRS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_SUBN_FLSR(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_SUBN_FLSRS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (1 << 31) - -/* SUB reg to reg with Post Arith Shift Right */ -#define E_SUB_FASR(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (1 << 31) -#define E_SUB_FASRS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_SUB_FASR(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_SUB_FASRS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) - -/* SUB reg to reg and invert result with Post Arith Shift Right */ -#define E_SUBN_FASR(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_SUBN_FASRS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_SUBN_FASR(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_SUBN_FASRS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (1 << 31) - -/* SUB reg to reg with Post ROR */ -#define E_SUB_FROR(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (1 << 31) -#define E_SUB_FRORS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_SUB_FROR(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (1 << 31) -#define E_COND_SUB_FRORS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) - -/* SUB reg to reg and invert result with ROR */ -#define E_SUBN_FROR(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_SUBN_FRORS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_SUBN_FROR(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_SUBN_FRORS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (1 << 31) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_ADC Codes */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Src1 src2 SFlag Cond - */ -/* Imm Use_Imm Invert Result Shift Result */ - -/* carry add reg from reg */ -#define E_ADC(dest, src1, src2) DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) -#define E_ADCS(dest, src1, src2) DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) -#define E_COND_ADC(cond, dest, src1, src2) DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) -#define E_COND_ADCS(cond, dest, src1, src2) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) - -/* carry add reg from reg and invert result */ -#define E_ADCN(dest, src1, src2) DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) -#define E_ADCNS(dest, src1, src2) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) -#define E_COND_ADCN(cond, dest, src1, src2) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) -#define E_COND_ADCNS(cond, dest, src1, src2) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) - -/* carry add imm12s from reg */ -#define E_ADC_IMM(dest, src1, imm12s) DCD 0x9 + (dest << 10) + (src1 << 14) + (EU << 5) + (imm12s << 20) + (1 << 18) -#define E_ADC_IMMS(dest, src1, imm12s) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (1 << 9) + (EU << 5) + (imm12s << 20) + (1 << 18) -#define E_COND_ADC_IMM(cond, dest, src1, imm12s) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (cond << 5) + (imm12s << 20) + (1 << 18) -#define E_COND_ADC_IMMS(cond, dest, src1, imm12s) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (1 << 9) + (cond << 5) + (imm12s << 20) + (1 << 18) - -/* carry add imm12s from reg and invert result */ -#define E_ADCN_IMM(dest, src1, imm12s) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (EU << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_ADCN_IMMS(dest, src1, imm12s) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (1 << 9) + (EU << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_COND_ADCN_IMM(cond, dest, src1, imm12s) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (cond << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_COND_ADCN_IMMS(cond, dest, src1, imm12s) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (1 << 9) + (cond << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) - -/* ADC reg to reg with Post Shift Left */ -#define E_ADC_LSL(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (0 << 31) -#define E_ADC_LSLS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ADC_LSL(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (0 << 31) -#define E_COND_ADC_LSLS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) - -/* ADC reg to reg and invert result with Post Shift Left */ -#define E_ADCN_LSL(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_ADCN_LSLS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ADCN_LSL(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ADCN_LSLS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (0 << 31) - -/* ADC reg to reg with Post Shift Right */ -#define E_ADC_LSR(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (0 << 31) -#define E_ADC_LSRS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ADC_LSR(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (0 << 31) -#define E_COND_ADC_LSRS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) - -/* ADC reg to reg and invert result with Post Shift Right */ -#define E_ADCN_LSR(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_ADCN_LSRS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ADCN_LSR(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ADCN_LSRS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (0 << 31) - -/* ADC reg to reg with Post Arith Shift Right */ -#define E_ADC_ASR(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (0 << 31) -#define E_ADC_ASRS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ADC_ASR(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (0 << 31) -#define E_COND_ADC_ASRS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) - -/* ADC reg to reg and invert result with Post Arith Shift Right */ -#define E_ADCN_ASR(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_ADCN_ASRS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ADCN_ASR(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ADCN_ASRS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (0 << 31) - -/* ADC reg to reg with Post ROR */ -#define E_ADC_ROR(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (0 << 31) -#define E_ADC_RORS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ADC_ROR(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (0 << 31) -#define E_COND_ADC_RORS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) - -/* ADC reg to reg and invert result with ROR */ -#define E_ADCN_ROR(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_ADCN_RORS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ADCN_ROR(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ADCN_RORS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (0 << 31) - -/* Flip Endianness and then shift5/Rotate */ - -/* adc reg to reg with Flip */ -#define E_ADC_F(dest, src1, src2) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((0 & 0x1f) << 24) + (0 << 29) + (0 << 30) + \ - (1 << 31) -#define E_ADC_FS(dest, src1, src2) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_ADC_F(cond, dest, src1, src2) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((0 & 0x1f) << 24) + (0 << 29) + (0 << 30) + \ - (1 << 31) -#define E_COND_ADC_FS(cond, dest, src1, src2) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) - -/* ADC reg to reg and invert result with Flip */ -#define E_ADCN_F(dest, src1, src2) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_ADCN_FS(dest, src1, src2) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + ((0 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ADCN_F(cond, dest, src1, src2) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_ADCN_FS(cond, dest, src1, src2) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + ((0 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) - -/* ADC reg to reg with Post Shift Left */ -#define E_ADC_FLSL(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_ADC_FLSLS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ADC_FLSL(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_ADC_FLSLS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) - -/* ADC reg to reg and invert result with Post Shift Left */ -#define E_ADCN_FLSL(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_ADCN_FLSLS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ADCN_FLSL(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ADCN_FLSLS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (1 << 31) - -/* ADC reg to reg with Post Shift Right */ -#define E_ADC_FLSR(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (1 << 31) -#define E_ADC_FLSRS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ADC_FLSR(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (1 << 31) -#define E_COND_ADC_FLSRS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) - -/* ADC reg to reg and invert result with Post Shift Right */ -#define E_ADCN_FLSR(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_ADCN_FLSRS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ADCN_FLSR(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ADCN_FLSRS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (1 << 31) - -/* ADC reg to reg with Post Arith Shift Right */ -#define E_ADC_FASR(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (1 << 31) -#define E_ADC_FASRS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ADC_FASR(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_ADC_FASRS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) - -/* ADC reg to reg and invert result with Post Arith Shift Right */ -#define E_ADCN_FASR(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_ADCN_FASRS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ADCN_FASR(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ADCN_FASRS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (1 << 31) - -/* ADC reg to reg with Post ROR */ -#define E_ADC_FROR(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (1 << 31) -#define E_ADC_FRORS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ADC_FROR(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (1 << 31) -#define E_COND_ADC_FRORS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) - -/* ADC reg to reg and invert result with ROR */ -#define E_ADCN_FROR(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_ADCN_FRORS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ADCN_FROR(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ADCN_FRORS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (1 << 31) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_SBC Codes */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Src1 src2 SFlag Cond - */ -/* Imm Use_Imm Invert Result Shift Result */ - -/* carry sub reg from reg */ -#define E_SBC(dest, src1, src2) DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) -#define E_SBCS(dest, src1, src2) DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) -#define E_COND_SBC(cond, dest, src1, src2) DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) -#define E_COND_SBCS(cond, dest, src1, src2) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) - -/* carry sub reg from reg and invert result */ -#define E_SBCN(dest, src1, src2) DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) -#define E_SBCNS(dest, src1, src2) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) -#define E_COND_SBCN(cond, dest, src1, src2) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) -#define E_COND_SBCNS(cond, dest, src1, src2) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) - -/* carry sub imm12s from reg */ -#define E_SBC_IMM(dest, src1, imm12s) DCD 0xA + (dest << 10) + (src1 << 14) + (EU << 5) + (imm12s << 20) + (1 << 18) -#define E_SBC_IMMS(dest, src1, imm12s) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (1 << 9) + (EU << 5) + (imm12s << 20) + (1 << 18) -#define E_COND_SBC_IMM(cond, dest, src1, imm12s) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (cond << 5) + (imm12s << 20) + (1 << 18) -#define E_COND_SBC_IMMS(cond, dest, src1, imm12s) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (1 << 9) + (cond << 5) + (imm12s << 20) + (1 << 18) - -/* carry sub imm12s from reg and invert result */ -#define E_SBCN_IMM(dest, src1, imm12s) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (EU << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_SBCN_IMMS(dest, src1, imm12s) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (1 << 9) + (EU << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_COND_SBCN_IMM(cond, dest, src1, imm12s) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (cond << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_COND_SBCN_IMMS(cond, dest, src1, imm12s) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (1 << 9) + (cond << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) - -/* SBC reg to reg with Post Shift Left */ -#define E_SBC_LSL(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (0 << 31) -#define E_SBC_LSLS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_SBC_LSL(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (0 << 31) -#define E_COND_SBC_LSLS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) - -/* SBC reg to reg and invert result with Post Shift Left */ -#define E_SBCN_LSL(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_SBCN_LSLS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_SBCN_LSL(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_SBCN_LSLS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (0 << 31) - -/* SBC reg to reg with Post Shift Right */ -#define E_SBC_LSR(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (0 << 31) -#define E_SBC_LSRS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_SBC_LSR(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (0 << 31) -#define E_COND_SBC_LSRS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) - -/* SBC reg to reg and invert result with Post Shift Right */ -#define E_SBCN_LSR(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_SBCN_LSRS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_SBCN_LSR(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_SBCN_LSRS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (0 << 31) - -/* SBC reg to reg with Post Arith Shift Right */ -#define E_SBC_ASR(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (0 << 31) -#define E_SBC_ASRS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_SBC_ASR(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (0 << 31) -#define E_COND_SBC_ASRS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) - -/* SBC reg to reg and invert result with Post Arith Shift Right */ -#define E_SBCN_ASR(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_SBCN_ASRS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_SBCN_ASR(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_SBCN_ASRS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (0 << 31) - -/* SBC reg to reg with Post ROR */ -#define E_SBC_ROR(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (0 << 31) -#define E_SBC_RORS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_SBC_ROR(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (0 << 31) -#define E_COND_SBC_RORS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) - -/* SBC reg to reg and invert result with ROR */ -#define E_SBCN_ROR(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_SBCN_RORS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_SBCN_ROR(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_SBCN_RORS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (0 << 31) - -/* Flip Endianness and then shift5/Rotate */ - -/* SBC reg to reg with Flip */ -#define E_SBC_F(dest, src1, src2) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((0 & 0x1f) << 24) + (0 << 29) + (0 << 30) + \ - (1 << 31) -#define E_SBC_FS(dest, src1, src2) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_SBC_F(cond, dest, src1, src2) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((0 & 0x1f) << 24) + (0 << 29) + (0 << 30) + \ - (1 << 31) -#define E_COND_SBC_FS(cond, dest, src1, src2) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) - -/* SBC reg to reg and invert result with Flip */ -#define E_SBCN_F(dest, src1, src2) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_SBCN_FS(dest, src1, src2) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + ((0 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_SBCN_F(cond, dest, src1, src2) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_SBCN_FS(cond, dest, src1, src2) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + ((0 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) - -/* SBC reg to reg with Post Shift Left */ -#define E_SBC_FLSL(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_SBC_FLSLS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_SBC_FLSL(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_SBC_FLSLS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) - -/* SBC reg to reg and invert result with Post Shift Left */ -#define E_SBCN_FLSL(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_SBCN_FLSLS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_SBCN_FLSL(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_SBCN_FLSLS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (1 << 31) - -/* SBC reg to reg with Post Shift Right */ -#define E_SBC_FLSR(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (1 << 31) -#define E_SBC_FLSRS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_SBC_FLSR(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (1 << 31) -#define E_COND_SBC_FLSRS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) - -/* SBC reg to reg and invert result with Post Shift Right */ -#define E_SBCN_FLSR(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_SBCN_FLSRS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_SBCN_FLSR(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_SBCN_FLSRS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (1 << 31) - -/* SBC reg to reg with Post Arith Shift Right */ -#define E_SBC_FASR(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (1 << 31) -#define E_SBC_FASRS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_SBC_FASR(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_SBC_FASRS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) - -/* SBC reg to reg and invert result with Post Arith Shift Right */ -#define E_SBCN_FASR(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_SBCN_FASRS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_SBCN_FASR(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_SBCN_FASRS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (1 << 31) - -/* SBC reg to reg with Post ROR */ -#define E_SBC_FROR(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (1 << 31) -#define E_SBC_FRORS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_SBC_FROR(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (1 << 31) -#define E_COND_SBC_FRORS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) - -/* SBC reg to reg and invert result with ROR */ -#define E_SBCN_FROR(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_SBCN_FRORS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_SBCN_FROR(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_SBCN_FRORS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (1 << 31) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_OR Codes */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Src1 src2 SFlag Cond - */ -/* Imm Use_Imm Invert Result Shift Result */ - -/* or reg with reg */ -#define E_OR(dest, src1, src2) DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) -#define E_ORS(dest, src1, src2) DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) -#define E_COND_OR(cond, dest, src1, src2) DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) -#define E_COND_ORS(cond, dest, src1, src2) DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) - -/* or reg with reg and invert result */ -#define E_ORN(dest, src1, src2) DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) -#define E_ORNS(dest, src1, src2) DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) -#define E_COND_ORN(cond, dest, src1, src2) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) -#define E_COND_ORNS(cond, dest, src1, src2) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) - -/* or imm12s with reg */ -#define E_OR_IMM(dest, src1, imm12s) DCD 0xC + (dest << 10) + (src1 << 14) + (EU << 5) + (imm12s << 20) + (1 << 18) -#define E_OR_IMMS(dest, src1, imm12s) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (1 << 9) + (EU << 5) + (imm12s << 20) + (1 << 18) -#define E_COND_OR_IMM(cond, dest, src1, imm12s) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (cond << 5) + (imm12s << 20) + (1 << 18) -#define E_COND_OR_IMMS(cond, dest, src1, imm12s) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (1 << 9) + (cond << 5) + (imm12s << 20) + (1 << 18) - -/* or imm12s with reg and invert result */ -#define E_ORN_IMM(dest, src1, imm12s) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (EU << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_ORN_IMMS(dest, src1, imm12s) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (1 << 9) + (EU << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_COND_ORN_IMM(cond, dest, src1, imm12s) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (cond << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_COND_ORN_IMMS(cond, dest, src1, imm12s) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (1 << 9) + (cond << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) - -/* OR reg to reg with Post Shift Left */ -#define E_OR_LSL(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (0 << 31) -#define E_OR_LSLS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_OR_LSL(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (0 << 31) -#define E_COND_OR_LSLS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) - -/* OR reg to reg and invert result with Post Shift Left */ -#define E_ORN_LSL(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_ORN_LSLS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ORN_LSL(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ORN_LSLS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (0 << 31) - -/* OR reg to reg with Post Shift Right */ -#define E_OR_LSR(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (0 << 31) -#define E_OR_LSRS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_OR_LSR(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (0 << 31) -#define E_COND_OR_LSRS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) - -/* OR reg to reg and invert result with Post Shift Right */ -#define E_ORN_LSR(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_ORN_LSRS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ORN_LSR(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ORN_LSRS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (0 << 31) - -/* OR reg to reg with Post Arith Shift Right */ -#define E_OR_ASR(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (0 << 31) -#define E_OR_ASRS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_OR_ASR(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (0 << 31) -#define E_COND_OR_ASRS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) - -/* OR reg to reg and invert result with Post Arith Shift Right */ -#define E_ORN_ASR(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_ORN_ASRS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ORN_ASR(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ORN_ASRS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (0 << 31) - -/* OR reg to reg with Post ROR */ -#define E_OR_ROR(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (0 << 31) -#define E_OR_RORS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_OR_ROR(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (0 << 31) -#define E_COND_OR_RORS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) - -/* OR reg to reg and invert result with ROR */ -#define E_ORN_ROR(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_ORN_RORS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ORN_ROR(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ORN_RORS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (0 << 31) -/* Flip Endianness and then shift5/Rotate */ - -/* OR reg to reg with Flip */ -#define E_OR_F(dest, src1, src2) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((0 & 0x1f) << 24) + (0 << 29) + (0 << 30) + \ - (1 << 31) -#define E_OR_FS(dest, src1, src2) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_OR_F(cond, dest, src1, src2) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((0 & 0x1f) << 24) + (0 << 29) + (0 << 30) + \ - (1 << 31) -#define E_COND_OR_FS(cond, dest, src1, src2) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) - -/* OR reg to reg and invert result with Flip */ -#define E_ORN_F(dest, src1, src2) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_ORN_FS(dest, src1, src2) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + ((0 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ORN_F(cond, dest, src1, src2) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_ORN_FS(cond, dest, src1, src2) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + ((0 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) - -/* OR reg to reg with Post Shift Left */ -#define E_OR_FLSL(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_OR_FLSLS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_OR_FLSL(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_OR_FLSLS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) - -/* OR reg to reg and invert result with Post Shift Left */ -#define E_ORN_FLSL(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_ORN_FLSLS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ORN_FLSL(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ORN_FLSLS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (1 << 31) - -/* OR reg to reg with Post Shift Right */ -#define E_OR_FLSR(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (1 << 31) -#define E_OR_FLSRS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_OR_FLSR(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (1 << 31) -#define E_COND_OR_FLSRS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) - -/* OR reg to reg and invert result with Post Shift Right */ -#define E_ORN_FLSR(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_ORN_FLSRS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ORN_FLSR(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ORN_FLSRS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (1 << 31) - -/* OR reg to reg with Post Arith Shift Right */ -#define E_OR_FASR(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (1 << 31) -#define E_OR_FASRS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_OR_FASR(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_OR_FASRS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) - -/* OR reg to reg and invert result with Post Arith Shift Right */ -#define E_ORN_FASR(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_ORN_FASRS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ORN_FASR(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ORN_FASRS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (1 << 31) - -/* OR reg to reg with Post ROR */ -#define E_OR_FROR(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (1 << 31) -#define E_OR_FRORS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_OR_FROR(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (1 << 31) -#define E_COND_OR_FRORS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) - -/* OR reg to reg and invert result with ROR */ -#define E_ORN_FROR(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_ORN_FRORS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ORN_FROR(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ORN_FRORS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (1 << 31) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_AND Codes */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Src1 src2 SFlag Cond - */ -/* Imm Use_Imm Invert Result Shift Result */ - -/* AND reg with reg */ -#define E_AND(dest, src1, src2) DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) -#define E_ANDS(dest, src1, src2) DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) -#define E_COND_AND(cond, dest, src1, src2) DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) -#define E_COND_ANDS(cond, dest, src1, src2) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) - -/* AND reg with reg and invert result */ -#define E_ANDN(dest, src1, src2) DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) -#define E_ANDNS(dest, src1, src2) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) -#define E_COND_ANDN(cond, dest, src1, src2) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) -#define E_COND_ANDNS(cond, dest, src1, src2) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) - -/* AND imm12s with reg */ -#define E_AND_IMM(dest, src1, imm12s) DCD 0xd + (dest << 10) + (src1 << 14) + (EU << 5) + (imm12s << 20) + (1 << 18) -#define E_AND_IMMS(dest, src1, imm12s) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (1 << 9) + (EU << 5) + (imm12s << 20) + (1 << 18) -#define E_COND_AND_IMM(cond, dest, src1, imm12s) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (cond << 5) + (imm12s << 20) + (1 << 18) -#define E_COND_AND_IMMS(cond, dest, src1, imm12s) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (1 << 9) + (cond << 5) + (imm12s << 20) + (1 << 18) - -/* AND imm12s with reg and invert result */ -#define E_ANDN_IMM(dest, src1, imm12s) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (EU << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_ANDN_IMMS(dest, src1, imm12s) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (1 << 9) + (EU << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_COND_ANDN_IMM(cond, dest, src1, imm12s) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (cond << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_COND_ANDN_IMMS(cond, dest, src1, imm12s) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (1 << 9) + (cond << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) - -/* AND reg to reg with Post Shift Left */ -#define E_AND_LSL(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (0 << 31) -#define E_AND_LSLS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_AND_LSL(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (0 << 31) -#define E_COND_AND_LSLS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) - -/* AND reg to reg and invert result with Post Shift Left */ -#define E_ANDN_LSL(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_ANDN_LSLS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ANDN_LSL(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ANDN_LSLS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (0 << 31) - -/* AND reg to reg with Post Shift Right */ -#define E_AND_LSR(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (0 << 31) -#define E_AND_LSRS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_AND_LSR(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (0 << 31) -#define E_COND_AND_LSRS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) - -/* AND reg to reg and invert result with Post Shift Right */ -#define E_ANDN_LSR(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_ANDN_LSRS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ANDN_LSR(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ANDN_LSRS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (0 << 31) - -/* AND reg to reg with Post Arith Shift Right */ -#define E_AND_ASR(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (0 << 31) -#define E_AND_ASRS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_AND_ASR(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (0 << 31) -#define E_COND_AND_ASRS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) - -/* AND reg to reg and invert result with Post Arith Shift Right */ -#define E_ANDN_ASR(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_ANDN_ASRS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ANDN_ASR(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ANDN_ASRS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (0 << 31) - -/* AND reg to reg with Post ROR */ -#define E_AND_ROR(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (0 << 31) -#define E_AND_RORS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_AND_ROR(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (0 << 31) -#define E_COND_AND_RORS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) - -/* AND reg to reg and invert result with ROR */ -#define E_ANDN_ROR(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_ANDN_RORS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ANDN_ROR(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ANDN_RORS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (0 << 31) - -/* Flip Endianness and then shift5/Rotate */ - -/* AND reg to reg with Flip */ -#define E_AND_F(dest, src1, src2) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((0 & 0x1f) << 24) + (0 << 29) + (0 << 30) + \ - (1 << 31) -#define E_AND_FS(dest, src1, src2) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_AND_F(cond, dest, src1, src2) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((0 & 0x1f) << 24) + (0 << 29) + (0 << 30) + \ - (1 << 31) -#define E_COND_AND_FS(cond, dest, src1, src2) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) - -/* AND reg to reg and invert result with Flip */ -#define E_ANDN_F(dest, src1, src2) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_ANDN_FS(dest, src1, src2) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + ((0 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ANDN_F(cond, dest, src1, src2) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_ANDN_FS(cond, dest, src1, src2) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + ((0 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) - -/* AND reg to reg with Post Shift Left */ -#define E_AND_FLSL(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_AND_FLSLS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_AND_FLSL(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_AND_FLSLS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) - -/* AND reg to reg and invert result with Post Shift Left */ -#define E_ANDN_FLSL(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_ANDN_FLSLS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ANDN_FLSL(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ANDN_FLSLS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (1 << 31) - -/* AND reg to reg with Post Shift Right */ -#define E_AND_FLSR(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (1 << 31) -#define E_AND_FLSRS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_AND_FLSR(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (1 << 31) -#define E_COND_AND_FLSRS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) - -/* AND reg to reg and invert result with Post Shift Right */ -#define E_ANDN_FLSR(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_ANDN_FLSRS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ANDN_FLSR(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ANDN_FLSRS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (1 << 31) - -/* AND reg to reg with Post Arith Shift Right */ -#define E_AND_FASR(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (1 << 31) -#define E_AND_FASRS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_AND_FASR(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_AND_FASRS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) - -/* AND reg to reg and invert result with Post Arith Shift Right */ -#define E_ANDN_FASR(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_ANDN_FASRS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ANDN_FASR(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ANDN_FASRS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (1 << 31) - -/* AND reg to reg with Post ROR */ -#define E_AND_FROR(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (1 << 31) -#define E_AND_FRORS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_AND_FROR(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (1 << 31) -#define E_COND_AND_FRORS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) - -/* AND reg to reg and invert result with ROR */ -#define E_ANDN_FROR(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_ANDN_FRORS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ANDN_FROR(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ANDN_FRORS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (1 << 31) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_XOR Codes */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Src1 src2 SFlag Cond - */ -/* Imm Use_Imm Invert Result Shift Result */ - -/* XOR reg with reg */ -#define E_XOR(dest, src1, src2) DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) -#define E_XORS(dest, src1, src2) DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) -#define E_COND_XOR(cond, dest, src1, src2) DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) -#define E_COND_XORS(cond, dest, src1, src2) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) - -/* XOR reg with reg XOR invert result */ -#define E_XORN(dest, src1, src2) DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) -#define E_XORNS(dest, src1, src2) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) -#define E_COND_XORN(cond, dest, src1, src2) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) -#define E_COND_XORNS(cond, dest, src1, src2) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) - -/* XOR imm12s with reg */ -#define E_XOR_IMM(dest, src1, imm12s) DCD 0xe + (dest << 10) + (src1 << 14) + (EU << 5) + (imm12s << 20) + (1 << 18) -#define E_XOR_IMMS(dest, src1, imm12s) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (1 << 9) + (EU << 5) + (imm12s << 20) + (1 << 18) -#define E_COND_XOR_IMM(cond, dest, src1, imm12s) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (cond << 5) + (imm12s << 20) + (1 << 18) -#define E_COND_XOR_IMMS(cond, dest, src1, imm12s) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (1 << 9) + (cond << 5) + (imm12s << 20) + (1 << 18) - -/* XOR imm12s with reg XOR invert result */ -#define E_XORN_IMM(dest, src1, imm12s) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (EU << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_XORN_IMMS(dest, src1, imm12s) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (1 << 9) + (EU << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_COND_XORN_IMM(cond, dest, src1, imm12s) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (cond << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_COND_XORN_IMMS(cond, dest, src1, imm12s) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (1 << 9) + (cond << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) - -/* XOR reg to reg with Post Shift Left */ -#define E_XOR_LSL(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (0 << 31) -#define E_XOR_LSLS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_XOR_LSL(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (0 << 31) -#define E_COND_XOR_LSLS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) - -/* XOR reg to reg XOR invert result with Post Shift Left */ -#define E_XORN_LSL(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_XORN_LSLS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_XORN_LSL(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_XORN_LSLS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (0 << 31) - -/* XOR reg to reg with Post Shift Right */ -#define E_XOR_LSR(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (0 << 31) -#define E_XOR_LSRS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_XOR_LSR(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (0 << 31) -#define E_COND_XOR_LSRS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) - -/* XOR reg to reg XOR invert result with Post Shift Right */ -#define E_XORN_LSR(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_XORN_LSRS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_XORN_LSR(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_XORN_LSRS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (0 << 31) - -/* XOR reg to reg with Post Arith Shift Right */ -#define E_XOR_ASR(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (0 << 31) -#define E_XOR_ASRS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_XOR_ASR(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (0 << 31) -#define E_COND_XOR_ASRS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) - -/* XOR reg to reg XOR invert result with Post Arith Shift Right */ -#define E_XORN_ASR(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_XORN_ASRS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_XORN_ASR(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_XORN_ASRS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (0 << 31) - -/* XOR reg to reg with Post ROR */ -#define E_XOR_ROR(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (0 << 31) -#define E_XOR_RORS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_XOR_ROR(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (0 << 31) -#define E_COND_XOR_RORS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) - -/* XOR reg to reg XOR invert result with ROR */ -#define E_XORN_ROR(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_XORN_RORS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_XORN_ROR(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_XORN_RORS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (0 << 31) - -/* Flip Endianness and then shift5/Rotate */ - -/* XOR reg to reg with Flip */ -#define E_XOR_F(dest, src1, src2) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((0 & 0x1f) << 24) + (0 << 29) + (0 << 30) + \ - (1 << 31) -#define E_XOR_FS(dest, src1, src2) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_XOR_F(cond, dest, src1, src2) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((0 & 0x1f) << 24) + (0 << 29) + (0 << 30) + \ - (1 << 31) -#define E_COND_XOR_FS(cond, dest, src1, src2) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) - -/* XOR reg to reg and invert result with Flip */ -#define E_XORN_F(dest, src1, src2) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_XORN_FS(dest, src1, src2) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + ((0 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_XORN_F(cond, dest, src1, src2) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_XORN_FS(cond, dest, src1, src2) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + ((0 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) - -/* XOR reg to reg with Post Shift Left */ -#define E_XOR_FLSL(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_XOR_FLSLS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_XOR_FLSL(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_XOR_FLSLS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) - -/* XOR reg to reg XOR invert result with Post Shift Left */ -#define E_XORN_FLSL(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_XORN_FLSLS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_XORN_FLSL(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_XORN_FLSLS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (1 << 31) - -/* XOR reg to reg with Post Shift Right */ -#define E_XOR_FLSR(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (1 << 31) -#define E_XOR_FLSRS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_XOR_FLSR(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (1 << 31) -#define E_COND_XOR_FLSRS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) - -/* XOR reg to reg XOR invert result with Post Shift Right */ -#define E_XORN_FLSR(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_XORN_FLSRS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_XORN_FLSR(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_XORN_FLSRS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (1 << 31) - -/* XOR reg to reg with Post Arith Shift Right */ -#define E_XOR_FASR(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (1 << 31) -#define E_XOR_FASRS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_XOR_FASR(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_XOR_FASRS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) - -/* XOR reg to reg XOR invert result with Post Arith Shift Right */ -#define E_XORN_FASR(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_XORN_FASRS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_XORN_FASR(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_XORN_FASRS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (1 << 31) - -/* XOR reg to reg with Post ROR */ -#define E_XOR_FROR(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (1 << 31) -#define E_XOR_FRORS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_XOR_FROR(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (1 << 31) -#define E_COND_XOR_FRORS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) - -/* XOR reg to reg XOR invert result with ROR */ -#define E_XORN_FROR(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_XORN_FRORS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_XORN_FROR(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_XORN_FRORS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (1 << 31) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_Shift Codes */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Src1 r2shift SFlag - */ -/* Cond Imm Extra Operation */ -/* Left/Right Shift/Rotate */ - -/* Logical Shift */ -#define E_LSL(dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (0 << 18) -#define E_LSR(dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag */ -#define E_LSLS(dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (0 << 18) -#define E_LSRS(dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (0 << 18) - -/* Logical Shift and then AND */ -#define E_LSL_AND(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) -#define E_LSR_AND(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then AND */ -#define E_LSL_ANDS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) -#define E_LSR_ANDS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then OR */ -#define E_LSL_OR(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) -#define E_LSR_OR(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then OR */ -#define E_LSL_ORS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) -#define E_LSR_ORS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then XOR */ -#define E_LSL_XOR(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) -#define E_LSR_XOR(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then XOR */ -#define E_LSL_XORS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) -#define E_LSR_XORS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then ADD */ -#define E_LSL_ADD(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) -#define E_LSR_ADD(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then ADD */ -#define E_LSL_ADDS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) -#define E_LSR_ADDS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then SUB */ -#define E_LSL_SUB(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) -#define E_LSR_SUB(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then SUB */ -#define E_LSL_SUBS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) -#define E_LSR_SUBS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then ADC */ -#define E_LSL_ADC(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) -#define E_LSR_ADC(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then ADC */ -#define E_LSL_ADCS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) -#define E_LSR_ADCS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then SBC */ -#define E_LSL_SBC(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) -#define E_LSR_SBC(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then SBC */ -#define E_LSL_SBCS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) -#define E_LSR_SBCS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) - -/* Conditional */ -/* Logical Shift */ -#define E_COND_LSL(cond, dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (0 << 18) -#define E_COND_LSR(cond, dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag */ -#define E_COND_LSLS(cond, dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (0 << 18) -#define E_COND_LSRS(cond, dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (0 << 18) - -/* Logical Shift and then AND */ -#define E_COND_LSL_AND(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) -#define E_COND_LSR_AND(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then AND */ -#define E_COND_LSL_ANDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) -#define E_COND_LSR_ANDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then OR */ -#define E_COND_LSL_OR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) -#define E_COND_LSR_OR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then OR */ -#define E_COND_LSL_ORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) -#define E_COND_LSR_ORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then XOR */ -#define E_COND_LSL_XOR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) -#define E_COND_LSR_XOR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then XOR */ -#define E_COND_LSL_XORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) -#define E_COND_LSR_XORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then ADD */ -#define E_COND_LSL_ADD(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) -#define E_COND_LSR_ADD(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then ADD */ -#define E_COND_LSL_ADDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) -#define E_COND_LSR_ADDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then SUB */ -#define E_COND_LSL_SUB(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) -#define E_COND_LSR_SUB(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then SUB */ -#define E_COND_LSL_SUBS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) -#define E_COND_LSR_SUBS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then ADC */ -#define E_COND_LSL_ADC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) -#define E_COND_LSR_ADC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then ADC */ -#define E_COND_LSL_ADCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) -#define E_COND_LSR_ADCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then SBC */ -#define E_COND_LSL_SBC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) -#define E_COND_LSR_SBC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then SBC */ -#define E_COND_LSL_SBCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) -#define E_COND_LSR_SBCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) - -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_ROTATE Codes */ -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Src1 r2shift SFlag - */ -/* Cond Imm Extra Operation Left/Right - */ -/* Shift/Rotate */ - -/* Rotate */ -#define E_ROR(dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (1 << 18) -/* Rotate and Set Flag */ -#define E_RORS(dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (1 << 18) - -/* Rotate and then AND */ -#define E_ROR_AND(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then AND */ -#define E_ROR_ANDS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then OR */ -#define E_ROR_OR(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then OR */ -#define E_ROR_ORS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then XOR */ -#define E_ROR_XOR(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then XOR */ -#define E_ROR_XORS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then ADD */ -#define E_ROR_ADD(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then ADD */ -#define E_ROR_ADDS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then SUB */ -#define E_ROR_SUB(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then SUB */ -#define E_ROR_SUBS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then ADC */ -#define E_ROR_ADC(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then ADC */ -#define E_ROR_ADCS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then SBC */ -#define E_ROR_SBC(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then SBC */ -#define E_ROR_SBCS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) - -/* Conditional */ -/* Rotate */ -#define E_COND_ROR(cond, dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (1 << 18) -/* Rotate and Set Flag */ -#define E_COND_RORS(cond, dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (1 << 18) - -/* Rotate and then AND */ -#define E_COND_ROR_AND(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then AND */ -#define E_COND_ROR_ANDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then OR */ -#define E_COND_ROR_OR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then OR */ -#define E_COND_ROR_ORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then XOR */ -#define E_COND_ROR_XOR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then XOR */ -#define E_COND_ROR_XORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then ADD */ -#define E_COND_ROR_ADD(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then ADD */ -#define E_COND_ROR_ADDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then SUB */ -#define E_COND_ROR_SUB(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then SUB */ -#define E_COND_ROR_SUBS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then ADC */ -#define E_COND_ROR_ADC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then ADC */ -#define E_COND_ROR_ADCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then SBC */ -#define E_COND_ROR_SBC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then SBC */ -#define E_COND_ROR_SBCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) - -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* Arithmetical Shift Codes */ -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Src1 r2shift SFlag - */ -/* Cond Imm Extra Operation Left/Right - */ -/* Shift/Rotate Arith/Shift */ - -/* Arith Shift Right */ -#define E_ASR(dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag */ -#define E_ASRS(dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (1 << 18) - -/* Arith Shift Right and then AND */ -#define E_ASR_AND(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag then AND */ -#define E_ASR_ANDS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) - -/* Arith Shift Right and then OR */ -#define E_ASR_OR(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag then OR */ -#define E_ASR_ORS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) - -/* Arith Shift Right and then XOR */ -#define E_ASR_XOR(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag then XOR */ -#define E_ASR_XORS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) - -/* Arith Shift Right and then ADD */ -#define E_ASR_ADD(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag then ADD */ -#define E_ASR_ADDS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) - -/* Arith Shift Right and then SUB */ -#define E_ASR_SUB(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag then SUB */ -#define E_ASR_SUBS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) - -/* Arith Shift Right and then ADC */ -#define E_ASR_ADC(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag then ADC */ -#define E_ASR_ADCS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) - -/* Arith Shift Right and then SBC */ -#define E_ASR_SBC(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag then SBC */ -#define E_ASR_SBCS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) - -/* Conditional */ -/* Conditional Arith Shift */ -#define E_COND_ASR(cond, dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag */ -#define E_COND_ASRS(cond, dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (1 << 18) - -/* Conditional Arith Shift and then AND */ -#define E_COND_ASR_AND(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag then AND */ -#define E_COND_ASR_ANDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) - -/* Conditional Arith Shift and then OR */ -#define E_COND_ASR_OR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag then OR */ -#define E_COND_ASR_ORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) - -/* Conditional Arith Shift and then XOR */ -#define E_COND_ASR_XOR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag then XOR */ -#define E_COND_ASR_XORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) - -/* Conditional Arith Shift and then ADD */ -#define E_COND_ASR_ADD(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag then ADD */ -#define E_COND_ASR_ADDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) - -/* Conditional Arith Shift and then SUB */ -#define E_COND_ASR_SUB(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag then SUB */ -#define E_COND_ASR_SUBS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) - -/* Conditional Arith Shift and then ADC */ -#define E_COND_ASR_ADC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag then ADC */ -#define E_COND_ASR_ADCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) - -/* Conditional Arith Shift and then SBC */ -#define E_COND_ASR_SBC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag then SBC */ -#define E_COND_ASR_SBCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) - -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* Flip Opcodes */ -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* opcode Dest Src1 r2shift SFlag - */ -/* Cond Imm Extra Operation Endian/bit - */ -/* ARITH Arith/Shift */ - -/* Flip Endian , ASR Right */ -#define E_FEND_ASR(dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 18) + (1 << 19) -/* Flip Endian , ASR Right ,Set Flag */ -#define E_FEND_ASRS(dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 18) + (1 << 19) - -/* Flip Endian , ASR Right , AND */ -#define E_FEND_ASR_AND(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 18) + (1 << 19) -/* Flip Endian , ASR Right ,Set Flag then AND */ -#define E_FEND_ASR_ANDS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 18) + (1 << 19) - -/* Flip Endian , ASR Right , OR */ -#define E_FEND_ASR_OR(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 18) + (1 << 19) -/* Flip Endian , ASR Right ,Set Flag then OR */ -#define E_FEND_ASR_ORS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 18) + (1 << 19) - -/* Flip Endian , ASR Right , XOR */ -#define E_FEND_ASR_XOR(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 18) + (1 << 19) -/* Flip Endian , ASR Right ,Set Flag then XOR */ -#define E_FEND_ASR_XORS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 18) + (1 << 19) - -/* Flip Endian , ASR Right , ADD */ -#define E_FEND_ASR_ADD(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 18) + (1 << 19) -/* Flip Endian , ASR Right ,Set Flag then ADD */ -#define E_FEND_ASR_ADDS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 18) + (1 << 19) - -/* Flip Endian , ASR Right , SUB */ -#define E_FEND_ASR_SUB(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 18) + (1 << 19) -/* Flip Endian , ASR Right ,Set Flag then SUB */ -#define E_FEND_ASR_SUBS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 18) + (1 << 19) - -/* Flip Endian , ASR Right , ADC */ -#define E_FEND_ASR_ADC(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 18) + (1 << 19) -/* Flip Endian , ASR Right ,Set Flag then ADC */ -#define E_FEND_ASR_ADCS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 18) + (1 << 19) - -/* Flip Endian , ASR Right , SBC */ -#define E_FEND_ASR_SBC(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 18) + (1 << 19) -/* Flip Endian , ASR Right ,Set Flag then SBC */ -#define E_FEND_ASR_SBCS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 18) + (1 << 19) - -/* Conditional */ -/* Conditional Flip Endian , ASR */ -#define E_COND_FEND_ASR(cond, dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 18) + (1 << 19) -/* Conditional Flip Endian , ASR ,Set Flag */ -#define E_COND_FEND_ASRS(cond, dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 18) + (1 << 19) - -/* Conditional Flip Endian , ASR , AND */ -#define E_COND_FEND_ASR_AND(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 18) + (1 << 19) -/* Conditional Flip Endian , ASR ,Set Flag then AND */ -#define E_COND_FEND_ASR_ANDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 18) + (1 << 19) - -/* Conditional Flip Endian , ASR , OR */ -#define E_COND_FEND_ASR_OR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 18) + (1 << 19) -/* Conditional Flip Endian , ASR ,Set Flag then OR */ -#define E_COND_FEND_ASR_ORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 18) + (1 << 19) - -/* Conditional Flip Endian , ASR , XOR */ -#define E_COND_FEND_ASR_XOR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 18) + (1 << 19) -/* Conditional Flip Endian , ASR ,Set Flag then XOR */ -#define E_COND_FEND_ASR_XORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 18) + (1 << 19) - -/* Conditional Flip Endian , ASR , ADD */ -#define E_COND_FEND_ASR_ADD(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 18) + (1 << 19) -/* Conditional Flip Endian , ASR ,Set Flag then ADD */ -#define E_COND_FEND_ASR_ADDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 18) + (1 << 19) - -/* Conditional Flip Endian , ASR , SUB */ -#define E_COND_FEND_ASR_SUB(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 18) + (1 << 19) -/* Conditional Flip Endian , ASR ,Set Flag then SUB */ -#define E_COND_FEND_ASR_SUBS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 18) + (1 << 19) - -/* Conditional Flip Endian , ASR , ADC */ -#define E_COND_FEND_ASR_ADC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 18) + (1 << 19) -/* Conditional Flip Endian , ASR ,Set Flag then ADC */ -#define E_COND_FEND_ASR_ADCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 18) + (1 << 19) - -/* Conditional Flip Endian , ASR , SBC */ -#define E_COND_FEND_ASR_SBC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 18) + (1 << 19) -/* Conditional Flip Endian , ASR ,Set Flag then SBC */ -#define E_COND_FEND_ASR_SBCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 18) + (1 << 19) - -/* Bitwise Flip ASR */ - -/* Flip Bitwise , ASR Right */ -#define E_FBIT_ASR(dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 18) + (1 << 19) -/* Flip Bitwise , ASR Right ,Set Flag */ -#define E_FBIT_ASRS(dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 18) + (1 << 19) - -/* Flip Bitwise , ASR Right , AND */ -#define E_FBIT_ASR_AND(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 18) + (1 << 19) -/* Flip Bitwise , ASR Right ,Set Flag then AND */ -#define E_FBIT_ASR_ANDS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 18) + (1 << 19) - -/* Flip Bitwise , ASR Right , OR */ -#define E_FBIT_ASR_OR(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 18) + (1 << 19) -/* Flip Bitwise , ASR Right ,Set Flag then OR */ -#define E_FBIT_ASR_ORS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 18) + (1 << 19) - -/* Flip Bitwise , ASR Right , XOR */ -#define E_FBIT_ASR_XOR(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 18) + (1 << 19) -/* Flip Bitwise , ASR Right ,Set Flag then XOR */ -#define E_FBIT_ASR_XORS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 18) + (1 << 19) - -/* Flip Bitwise , ASR Right , ADD */ -#define E_FBIT_ASR_ADD(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 18) + (1 << 19) -/* Flip Bitwise , ASR Right ,Set Flag then ADD */ -#define E_FBIT_ASR_ADDS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 18) + (1 << 19) - -/* Flip Bitwise , ASR Right , SUB */ -#define E_FBIT_ASR_SUB(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 18) + (1 << 19) -/* Flip Bitwise , ASR Right ,Set Flag then SUB */ -#define E_FBIT_ASR_SUBS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 18) + (1 << 19) - -/* Flip Bitwise , ASR Right , ADC */ -#define E_FBIT_ASR_ADC(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 18) + (1 << 19) -/* Flip Bitwise , ASR Right ,Set Flag then ADC */ -#define E_FBIT_ASR_ADCS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 18) + (1 << 19) - -/* Flip Bitwise , ASR Right , SBC */ -#define E_FBIT_ASR_SBC(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 18) + (1 << 19) -/* Flip Bitwise , ASR Right ,Set Flag then SBC */ -#define E_FBIT_ASR_SBCS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 18) + (1 << 19) - -/* Conditional */ -/* Conditional Flip Bitwise , ASR */ -#define E_COND_FBIT_ASR(cond, dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 18) + (1 << 19) -/* Conditional Flip Bitwise , ASR ,Set Flag */ -#define E_COND_FBIT_ASRS(cond, dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 18) + (1 << 19) - -/* Conditional Flip Bitwise , ASR , AND */ -#define E_COND_FBIT_ASR_AND(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 18) + (1 << 19) -/* Conditional Flip Bitwise , ASR ,Set Flag then AND */ -#define E_COND_FBIT_ASR_ANDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 18) + (1 << 19) - -/* Conditional Flip Bitwise , ASR , OR */ -#define E_COND_FBIT_ASR_OR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 18) + (1 << 19) -/* Conditional Flip Bitwise , ASR ,Set Flag then OR */ -#define E_COND_FBIT_ASR_ORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 18) + (1 << 19) - -/* Conditional Flip Bitwise , ASR , XOR */ -#define E_COND_FBIT_ASR_XOR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 18) + (1 << 19) -/* Conditional Flip Bitwise , ASR ,Set Flag then XOR */ -#define E_COND_FBIT_ASR_XORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 18) + (1 << 19) - -/* Conditional Flip Bitwise , ASR , ADD */ -#define E_COND_FBIT_ASR_ADD(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 18) + (1 << 19) -/* Conditional Flip Bitwise , ASR ,Set Flag then ADD */ -#define E_COND_FBIT_ASR_ADDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 18) + (1 << 19) - -/* Conditional Flip Bitwise , ASR , SUB */ -#define E_COND_FBIT_ASR_SUB(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 18) + (1 << 19) -/* Conditional Flip Bitwise , ASR ,Set Flag then SUB */ -#define E_COND_FBIT_ASR_SUBS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 18) + (1 << 19) - -/* Conditional Flip Bitwise , ASR , ADC */ -#define E_COND_FBIT_ASR_ADC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 18) + (1 << 19) -/* Conditional Flip Bitwise , ASR ,Set Flag then ADC */ -#define E_COND_FBIT_ASR_ADCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 18) + (1 << 19) - -/* Conditional Flip Bitwise , ASR , SBC */ -#define E_COND_FBIT_ASR_SBC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 18) + (1 << 19) -/* Conditional Flip Bitwise , ASR ,Set Flag then SBC */ -#define E_COND_FBIT_ASR_SBCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 18) + (1 << 19) - -/* Flip Endian , LSR Right */ -#define E_FEND_LSR(dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 18) + (0 << 19) -/* Flip Endian , LSR Right ,Set Flag */ -#define E_FEND_LSRS(dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 18) + (0 << 19) - -/* Flip Endian , LSR Right , AND */ -#define E_FEND_LSR_AND(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 18) + (0 << 19) -/* Flip Endian , LSR Right ,Set Flag then AND */ -#define E_FEND_LSR_ANDS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 18) + (0 << 19) - -/* Flip Endian , LSR Right , OR */ -#define E_FEND_LSR_OR(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 18) + (0 << 19) -/* Flip Endian , LSR Right ,Set Flag then OR */ -#define E_FEND_LSR_ORS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 18) + (0 << 19) - -/* Flip Endian , LSR Right , XOR */ -#define E_FEND_LSR_XOR(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 18) + (0 << 19) -/* Flip Endian , LSR Right ,Set Flag then XOR */ -#define E_FEND_LSR_XORS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 18) + (0 << 19) - -/* Flip Endian , LSR Right , ADD */ -#define E_FEND_LSR_ADD(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 18) + (0 << 19) -/* Flip Endian , LSR Right ,Set Flag then ADD */ -#define E_FEND_LSR_ADDS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 18) + (0 << 19) - -/* Flip Endian , LSR Right , SUB */ -#define E_FEND_LSR_SUB(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 18) + (0 << 19) -/* Flip Endian , LSR Right ,Set Flag then SUB */ -#define E_FEND_LSR_SUBS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 18) + (0 << 19) - -/* Flip Endian , LSR Right , ADC */ -#define E_FEND_LSR_ADC(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 18) + (0 << 19) -/* Flip Endian , LSR Right ,Set Flag then ADC */ -#define E_FEND_LSR_ADCS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 18) + (0 << 19) - -/* Flip Endian , LSR Right , SBC */ -#define E_FEND_LSR_SBC(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 18) + (0 << 19) -/* Flip Endian , LSR Right ,Set Flag then SBC */ -#define E_FEND_LSR_SBCS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 18) + (0 << 19) - -/* Conditional */ -/* Conditional Flip Endian , LSR */ -#define E_COND_FEND_LSR(cond, dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 18) + (0 << 19) -/* Conditional Flip Endian , LSR ,Set Flag */ -#define E_COND_FEND_LSRS(cond, dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 18) + (0 << 19) - -/* Conditional Flip Endian , LSR , AND */ -#define E_COND_FEND_LSR_AND(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 18) + (0 << 19) -/* Conditional Flip Endian , LSR ,Set Flag then AND */ -#define E_COND_FEND_LSR_ANDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 18) + (0 << 19) - -/* Conditional Flip Endian , LSR , OR */ -#define E_COND_FEND_LSR_OR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 18) + (0 << 19) -/* Conditional Flip Endian , LSR ,Set Flag then OR */ -#define E_COND_FEND_LSR_ORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 18) + (0 << 19) - -/* Conditional Flip Endian , LSR , XOR */ -#define E_COND_FEND_LSR_XOR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 18) + (0 << 19) -/* Conditional Flip Endian , LSR ,Set Flag then XOR */ -#define E_COND_FEND_LSR_XORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 18) + (0 << 19) - -/* Conditional Flip Endian , LSR , ADD */ -#define E_COND_FEND_LSR_ADD(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 18) + (0 << 19) -/* Conditional Flip Endian , LSR ,Set Flag then ADD */ -#define E_COND_FEND_LSR_ADDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 18) + (0 << 19) - -/* Conditional Flip Endian , LSR , SUB */ -#define E_COND_FEND_LSR_SUB(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 18) + (0 << 19) -/* Conditional Flip Endian , LSR ,Set Flag then SUB */ -#define E_COND_FEND_LSR_SUBS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 18) + (0 << 19) - -/* Conditional Flip Endian , LSR , ADC */ -#define E_COND_FEND_LSR_ADC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 18) + (0 << 19) -/* Conditional Flip Endian , LSR ,Set Flag then ADC */ -#define E_COND_FEND_LSR_ADCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 18) + (0 << 19) - -/* Conditional Flip Endian , LSR , SBC */ -#define E_COND_FEND_LSR_SBC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 18) + (0 << 19) -/* Conditional Flip Endian , LSR ,Set Flag then SBC */ -#define E_COND_FEND_LSR_SBCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 18) + (0 << 19) - -/* Bitwise Flip LSR */ - -/* Flip Bitwise , LSR Right */ -#define E_FBIT_LSR(dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 18) + (0 << 19) -/* Flip Bitwise , LSR Right ,Set Flag */ -#define E_FBIT_LSRS(dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 18) + (0 << 19) - -/* Flip Bitwise , LSR Right , AND */ -#define E_FBIT_LSR_AND(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 18) + (0 << 19) -/* Flip Bitwise , LSR Right ,Set Flag then AND */ -#define E_FBIT_LSR_ANDS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 18) + (0 << 19) - -/* Flip Bitwise , LSR Right , OR */ -#define E_FBIT_LSR_OR(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 18) + (0 << 19) -/* Flip Bitwise , LSR Right ,Set Flag then OR */ -#define E_FBIT_LSR_ORS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 18) + (0 << 19) - -/* Flip Bitwise , LSR Right , XOR */ -#define E_FBIT_LSR_XOR(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 18) + (0 << 19) -/* Flip Bitwise , LSR Right ,Set Flag then XOR */ -#define E_FBIT_LSR_XORS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 18) + (0 << 19) - -/* Flip Bitwise , LSR Right , ADD */ -#define E_FBIT_LSR_ADD(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 18) + (0 << 19) -/* Flip Bitwise , LSR Right ,Set Flag then ADD */ -#define E_FBIT_LSR_ADDS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 18) + (0 << 19) - -/* Flip Bitwise , LSR Right , SUB */ -#define E_FBIT_LSR_SUB(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 18) + (0 << 19) -/* Flip Bitwise , LSR Right ,Set Flag then SUB */ -#define E_FBIT_LSR_SUBS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 18) + (0 << 19) - -/* Flip Bitwise , LSR Right , ADC */ -#define E_FBIT_LSR_ADC(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 18) + (0 << 19) -/* Flip Bitwise , LSR Right ,Set Flag then ADC */ -#define E_FBIT_LSR_ADCS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 18) + (0 << 19) - -/* Flip Bitwise , LSR Right , SBC */ -#define E_FBIT_LSR_SBC(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 18) + (0 << 19) -/* Flip Bitwise , LSR Right ,Set Flag then SBC */ -#define E_FBIT_LSR_SBCS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 18) + (0 << 19) - -/* Conditional */ -/* Conditional Flip Bitwise , LSR */ -#define E_COND_FBIT_LSR(cond, dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 18) + (0 << 19) -/* Conditional Flip Bitwise , LSR ,Set Flag */ -#define E_COND_FBIT_LSRS(cond, dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 18) + (0 << 19) - -/* Conditional Flip Bitwise , LSR , AND */ -#define E_COND_FBIT_LSR_AND(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 18) + (0 << 19) -/* Conditional Flip Bitwise , LSR ,Set Flag then AND */ -#define E_COND_FBIT_LSR_ANDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 18) + (0 << 19) - -/* Conditional Flip Bitwise , LSR , OR */ -#define E_COND_FBIT_LSR_OR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 18) + (0 << 19) -/* Conditional Flip Bitwise , LSR ,Set Flag then OR */ -#define E_COND_FBIT_LSR_ORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 18) + (0 << 19) - -/* Conditional Flip Bitwise , LSR , XOR */ -#define E_COND_FBIT_LSR_XOR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 18) + (0 << 19) -/* Conditional Flip Bitwise , LSR ,Set Flag then XOR */ -#define E_COND_FBIT_LSR_XORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 18) + (0 << 19) - -/* Conditional Flip Bitwise , LSR , ADD */ -#define E_COND_FBIT_LSR_ADD(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 18) + (0 << 19) -/* Conditional Flip Bitwise , LSR ,Set Flag then ADD */ -#define E_COND_FBIT_LSR_ADDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 18) + (0 << 19) - -/* Conditional Flip Bitwise , LSR , SUB */ -#define E_COND_FBIT_LSR_SUB(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 18) + (0 << 19) -/* Conditional Flip Bitwise , LSR ,Set Flag then SUB */ -#define E_COND_FBIT_LSR_SUBS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 18) + (0 << 19) - -/* Conditional Flip Bitwise , LSR , ADC */ -#define E_COND_FBIT_LSR_ADC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 18) + (0 << 19) -/* Conditional Flip Bitwise , LSR ,Set Flag then ADC */ -#define E_COND_FBIT_LSR_ADCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 18) + (0 << 19) - -/* Conditional Flip Bitwise , LSR , SBC */ -#define E_COND_FBIT_LSR_SBC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 18) + (0 << 19) -/* Conditional Flip Bitwise , LSR ,Set Flag then SBC */ -#define E_COND_FBIT_LSR_SBCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 18) + (0 << 19) - -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_ANDOR */ -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* opcode Dest Src1 src2 SFlag */ -/* Cond SRC3 */ - -/* ANDOR */ -#define E_ANDOR(dest, rsrc, rand, ror) \ - DCD 0x16 + (dest << 10) + (rsrc << 14)(rand << 20) + (0 << 9) + (EU << 5) + (ror << 24) -#define E_ANDORS(dest, rsrc, rand, ror) \ - DCD 0x16 + (dest << 10) + (rsrc << 14)(rand << 20) + (1 << 9) + (EU << 5) + (ror << 24) -#define E_COND_ANDOR(cond, dest, rsrc, rand, ror) \ - DCD 0x16 + (dest << 10) + (rsrc << 14)(rand << 20) + (0 << 9) + (cond << 5) + (ror << 24) -#define E_COND_ANDORS(cond, dest, rsrc, rand, ror) \ - DCD 0x16 + (dest << 10) + (rsrc << 14)(rand << 20) + (1 << 9) + (cond << 5) + (ror << 24) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_Shift byte reg Codes */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Src1 src2 SFlag Cond - */ -/* Imm Extra Operation Left/Right */ -/* Shift/Rotate Invert */ - -/* Logical Shift */ -#define E_RLSL(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (0 << 18) -#define E_RLSR(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag */ -#define E_RLSLS(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (0 << 18) -#define E_RLSRS(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (0 << 18) - -/* Logical Shift and then AND */ -#define E_RLSL_AND(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) -#define E_RLSR_AND(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then AND */ -#define E_RLSL_ANDS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) -#define E_RLSR_ANDS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then OR */ -#define E_RLSL_OR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) -#define E_RLSR_OR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then OR */ -#define E_RLSL_ORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) -#define E_RLSR_ORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then XOR */ -#define E_RLSL_XOR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) -#define E_RLSR_XOR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then XOR */ -#define E_RLSL_XORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) -#define E_RLSR_XORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then ADD */ -#define E_RLSL_ADD(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) -#define E_RLSR_ADD(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then ADD */ -#define E_RLSL_ADDS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) -#define E_RLSR_ADDS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then SUB */ -#define E_RLSL_SUB(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) -#define E_RLSR_SUB(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then SUB */ -#define E_RLSL_SUBS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) -#define E_RLSR_SUBS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then ADC */ -#define E_RLSL_ADC(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) -#define E_RLSR_ADC(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then ADC */ -#define E_RLSL_ADCS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) -#define E_RLSR_ADCS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then SBC */ -#define E_RLSL_SBC(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) -#define E_RLSR_SBC(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then SBC */ -#define E_RLSL_SBCS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) -#define E_RLSR_SBCS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) - -/* Conditional */ -/* Logical Shift */ -#define E_COND_RLSL(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (0 << 18) -#define E_COND_RLSR(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag */ -#define E_COND_RLSLS(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (0 << 18) -#define E_COND_RLSRS(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (0 << 18) - -/* Logical Shift and then AND */ -#define E_COND_RLSL_AND(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) -#define E_COND_RLSR_AND(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then AND */ -#define E_COND_RLSL_ANDS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) -#define E_COND_RLSR_ANDS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then OR */ -#define E_COND_RLSL_OR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) -#define E_COND_RLSR_OR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then OR */ -#define E_COND_RLSL_ORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) -#define E_COND_RLSR_ORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then XOR */ -#define E_COND_RLSL_XOR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) -#define E_COND_RLSR_XOR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then XOR */ -#define E_COND_RLSL_XORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) -#define E_COND_RLSR_XORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then ADD */ -#define E_COND_RLSL_ADD(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) -#define E_COND_RLSR_ADD(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then ADD */ -#define E_COND_RLSL_ADDS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) -#define E_COND_RLSR_ADDS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then SUB */ -#define E_COND_RLSL_SUB(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) -#define E_COND_RLSR_SUB(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then SUB */ -#define E_COND_RLSL_SUBS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) -#define E_COND_RLSR_SUBS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then ADC */ -#define E_COND_RLSL_ADC(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) -#define E_COND_RLSR_ADC(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then ADC */ -#define E_COND_RLSL_ADCS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) -#define E_COND_RLSR_ADCS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then SBC */ -#define E_COND_RLSL_SBC(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) -#define E_COND_RLSR_SBC(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then SBC */ -#define E_COND_RLSL_SBCS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) -#define E_COND_RLSR_SBCS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) - -/* opcode Dest Src1 r2shift SFlag - */ -/* Cond Imm Extra Operation */ -/* Left/Right Shift/Rotate POSTshift */ - -/* Logical Shift and then AND */ -#define E_AND_RLSL(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_AND_RLSR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) + (1 << 28) -/* Logical Shift and Set Flag then AND */ -#define E_AND_RLSLS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_AND_RLSRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) + (1 << 28) - -/* Logical Shift and then OR */ -#define E_OR_RLSL(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_OR_RLSR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) + (1 << 28) -/* Logical Shift and Set Flag then OR */ -#define E_OR_RLSLS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_OR_RLSRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) + (1 << 28) - -/* Logical Shift and then XOR */ -#define E_XOR_RLSL(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_XOR_RLSR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) + (1 << 28) -/* Logical Shift and Set Flag then XOR */ -#define E_XOR_RLSLS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_XOR_RLSRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) + (1 << 28) - -/* Logical Shift and then ADD */ -#define E_ADD_RLSL(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_ADD_RLSR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) + (1 << 28) -/* Logical Shift and Set Flag then ADD */ -#define E_ADD_RLSLS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_ADD_RLSRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) + (1 << 28) - -/* Logical Shift and then SUB */ -#define E_SUB_RLSL(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_SUB_RLSR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) + (1 << 28) -/* Logical Shift and Set Flag then SUB */ -#define E_SUB_RLSLS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_SUB_RLSRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) + (1 << 28) - -/* Logical Shift and then ADC */ -#define E_ADC_RLSL(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_ADC_RLSR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) + (1 << 28) -/* Logical Shift and Set Flag then ADC */ -#define E_ADC_RLSLS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_ADC_RLSRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) + (1 << 28) - -/* Logical Shift and then SBC */ -#define E_SBC_RLSL(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_SBC_RLSR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) + (1 << 28) -/* Logical Shift and Set Flag then SBC */ -#define E_SBC_RLSLS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_SBC_RLSRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) + (1 << 28) - -/* Conditional */ - -/* Logical Shift and then AND */ -#define E_COND_AND_RLSL(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_COND_AND_RLSR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) + (1 << 28) -/* Logical Shift and Set Flag then AND */ -#define E_COND_AND_RLSLS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_COND_AND_RLSRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) + (1 << 28) - -/* Logical Shift and then OR */ -#define E_COND_OR_RLSL(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_COND_OR_RLSR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) + (1 << 28) -/* Logical Shift and Set Flag then OR */ -#define E_COND_OR_RLSLS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_COND_OR_RLSRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) + (1 << 28) - -/* Logical Shift and then XOR */ -#define E_COND_XOR_RLSL(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_COND_XOR_RLSR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) + (1 << 28) -/* Logical Shift and Set Flag then XOR */ -#define E_COND_XOR_RLSLS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_COND_XOR_RLSRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) + (1 << 28) - -/* Logical Shift and then ADD */ -#define E_COND_ADD_RLSL(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_COND_ADD_RLSR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) + (1 << 28) -/* Logical Shift and Set Flag then ADD */ -#define E_COND_ADD_RLSLS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_COND_ADD_RLSRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) + (1 << 28) - -/* Logical Shift and then SUB */ -#define E_COND_SUB_RLSL(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_COND_SUB_RLSR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) + (1 << 28) -/* Logical Shift and Set Flag then SUB */ -#define E_COND_SUB_RLSLS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_COND_SUB_RLSRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) + (1 << 28) - -/* Logical Shift and then ADC */ -#define E_COND_ADC_RLSL(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_COND_ADC_RLSR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) + (1 << 28) -/* Logical Shift and Set Flag then ADC */ -#define E_COND_ADC_RLSLS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_COND_ADC_RLSRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) + (1 << 28) - -/* Logical Shift and then SBC */ -#define E_COND_SBC_RLSL(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_COND_SBC_RLSR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) + (1 << 28) -/* Logical Shift and Set Flag then SBC */ -#define E_COND_SBC_RLSLS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_COND_SBC_RLSRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) + (1 << 28) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_Shift byte reg with inversion */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* Logical Shift */ -#define E_RLSLN(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSRN(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag */ -#define E_RLSLNS(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSRNS(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (0 << 18) + (1 << 27) - -/* Logical Shift and then AND */ -#define E_RLSL_ANDN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSR_ANDN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag then AND */ -#define E_RLSL_ANDNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSR_ANDNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) + (1 << 27) - -/* Logical Shift and then OR */ -#define E_RLSL_ORN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSR_ORN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag then OR */ -#define E_RLSL_ORNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSR_ORNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) + (1 << 27) - -/* Logical Shift and then XOR */ -#define E_RLSL_XORN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSR_XORN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag then XOR */ -#define E_RLSL_XORNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSR_XORNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) + (1 << 27) - -/* Logical Shift and then ADD */ -#define E_RLSL_ADDN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSR_ADDN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag then ADD */ -#define E_RLSL_ADDNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSR_ADDNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) + (1 << 27) - -/* Logical Shift and then SUB */ -#define E_RLSL_SUBN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSR_SUBN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag then SUB */ -#define E_RLSL_SUBNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSR_SUBNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) + (1 << 27) - -/* Logical Shift and then ADC */ -#define E_RLSL_ADCN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSR_ADCN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag then ADC */ -#define E_RLSL_ADCNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSR_ADCNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) + (1 << 27) - -/* Logical Shift and then SBC */ -#define E_RLSL_SBCN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSR_SBCN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag then SBC */ -#define E_RLSL_SBCNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSR_SBCNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) + (1 << 27) - -/* Conditional */ -/* Logical Shift */ -#define E_COND_RLSLN(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSRN(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag */ -#define E_COND_RLSLNS(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSRNS(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (0 << 18) + (1 << 27) - -/* Logical Shift and then AND */ -#define E_COND_RLSL_ANDN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSR_ANDN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag then AND */ -#define E_COND_RLSL_ANDNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSR_ANDNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) + (1 << 27) - -/* Logical Shift and then OR */ -#define E_COND_RLSL_ORN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSR_ORN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag then OR */ -#define E_COND_RLSL_ORNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSR_ORNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) + (1 << 27) - -/* Logical Shift and then XOR */ -#define E_COND_RLSL_XORN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSR_XORN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag then XOR */ -#define E_COND_RLSL_XORNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSR_XORNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) + (1 << 27) - -/* Logical Shift and then ADD */ -#define E_COND_RLSL_ADDN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSR_ADDN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag then ADD */ -#define E_COND_RLSL_ADDNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSR_ADDNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) + (1 << 27) - -/* Logical Shift and then SUB */ -#define E_COND_RLSL_SUBN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSR_SUBN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag then SUB */ -#define E_COND_RLSL_SUBNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSR_SUBNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) + (1 << 27) - -/* Logical Shift and then ADC */ -#define E_COND_RLSL_ADCN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSR_ADCN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag then ADC */ -#define E_COND_RLSL_ADCNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSR_ADCNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) + (1 << 27) - -/* Logical Shift and then SBC */ -#define E_COND_RLSL_SBCN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSR_SBCN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag then SBC */ -#define E_COND_RLSL_SBCNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSR_SBCNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) + (1 << 27) - -/* opcode Dest Src1 r2shift SFlag - */ -/* Cond Imm Extra Operation */ -/* Left/Right Shift/Rotate Inv POSTshift */ - -/* Logical Shift and then AND */ -#define E_ANDN_RLSL(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_ANDN_RLSR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -/* Logical Shift and Set Flag then AND */ -#define E_ANDN_RLSLS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_ANDN_RLSRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) - -/* Logical Shift and then OR */ -#define E_ORN_RLSL(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_ORN_RLSR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -/* Logical Shift and Set Flag then OR */ -#define E_ORN_RLSLS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_ORN_RLSRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) - -/* Logical Shift and then XOR */ -#define E_XORN_RLSL(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_XORN_RLSR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -/* Logical Shift and Set Flag then XOR */ -#define E_XORN_RLSLS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_XORN_RLSRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) - -/* Logical Shift and then ADD */ -#define E_ADDN_RLSL(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_ADDN_RLSR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -/* Logical Shift and Set Flag then ADD */ -#define E_ADDN_RLSLS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_ADDN_RLSRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) - -/* Logical Shift and then SUB */ -#define E_SUBN_RLSL(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_SUBN_RLSR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -/* Logical Shift and Set Flag then SUB */ -#define E_SUBN_RLSLS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_SUBN_RLSRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) - -/* Logical Shift and then ADC */ -#define E_ADCN_RLSL(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_ADCN_RLSR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -/* Logical Shift and Set Flag then ADC */ -#define E_ADCN_RLSLS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_ADCN_RLSRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) - -/* Logical Shift and then SBC */ -#define E_SBCN_RLSL(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_SBCN_RLSR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -/* Logical Shift and Set Flag then SBC */ -#define E_SBCN_RLSLS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_SBCN_RLSRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) - -/* Conditional */ - -/* Logical Shift and then AND */ -#define E_COND_ANDN_RLSL(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_COND_ANDN_RLSR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -/* Logical Shift and Set Flag then AND */ -#define E_COND_ANDN_RLSLS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_COND_ANDN_RLSRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) - -/* Logical Shift and then OR */ -#define E_COND_ORN_RLSL(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_COND_ORN_RLSR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -/* Logical Shift and Set Flag then OR */ -#define E_COND_ORN_RLSLS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_COND_ORN_RLSRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) - -/* Logical Shift and then XOR */ -#define E_COND_XORN_RLSL(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_COND_XORN_RLSR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -/* Logical Shift and Set Flag then XOR */ -#define E_COND_XORN_RLSLS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_COND_XORN_RLSRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) - -/* Logical Shift and then ADD */ -#define E_COND_ADDN_RLSL(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_COND_ADDN_RLSR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -/* Logical Shift and Set Flag then ADD */ -#define E_COND_ADDN_RLSLS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_COND_ADDN_RLSRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) - -/* Logical Shift and then SUB */ -#define E_COND_SUBN_RLSL(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_COND_SUBN_RLSR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -/* Logical Shift and Set Flag then SUB */ -#define E_COND_SUBN_RLSLS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_COND_SUBN_RLSRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) - -/* Logical Shift and then ADC */ -#define E_COND_ADCN_RLSL(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_COND_ADCN_RLSR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -/* Logical Shift and Set Flag then ADC */ -#define E_COND_ADCN_RLSLS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_COND_ADCN_RLSRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) - -/* Logical Shift and then SBC */ -#define E_COND_SBCN_RLSL(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_COND_SBCN_RLSR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -/* Logical Shift and Set Flag then SBC */ -#define E_COND_SBCN_RLSLS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_COND_SBCN_RLSRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) - -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_ROTATE by Reg Codes */ -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Src1 r2shift SFlag - */ -/* Cond Imm Extra Operation Left/Right - */ -/* Shift/Rotate */ - -/* Rotate */ -#define E_RROR(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (1 << 18) -/* Rotate and Set Flag */ -#define E_RRORS(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (1 << 18) - -/* Rotate and then AND */ -#define E_RROR_AND(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then AND */ -#define E_RROR_ANDS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then OR */ -#define E_RROR_OR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then OR */ -#define E_RROR_ORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then XOR */ -#define E_RROR_XOR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then XOR */ -#define E_RROR_XORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then ADD */ -#define E_RROR_ADD(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then ADD */ -#define E_RROR_ADDS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then SUB */ -#define E_RROR_SUB(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then SUB */ -#define E_RROR_SUBS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then ADC */ -#define E_RROR_ADC(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then ADC */ -#define E_RROR_ADCS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then SBC */ -#define E_RROR_SBC(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then SBC */ -#define E_RROR_SBCS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) - -/* Conditional */ -/* Rotate */ -#define E_COND_RROR(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (1 << 18) -/* Rotate and Set Flag */ -#define E_COND_RRORS(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (1 << 18) - -/* Rotate and then AND */ -#define E_COND_RROR_AND(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then AND */ -#define E_COND_RROR_ANDS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then OR */ -#define E_COND_RROR_OR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then OR */ -#define E_COND_RROR_ORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then XOR */ -#define E_COND_RROR_XOR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then XOR */ -#define E_COND_RROR_XORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then ADD */ -#define E_COND_RROR_ADD(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then ADD */ -#define E_COND_RROR_ADDS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then SUB */ -#define E_COND_RROR_SUB(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then SUB */ -#define E_COND_RROR_SUBS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then ADC */ -#define E_COND_RROR_ADC(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then ADC */ -#define E_COND_RROR_ADCS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then SBC */ -#define E_COND_RROR_SBC(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then SBC */ -#define E_COND_RROR_SBCS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then AND */ -#define E_AND_RROR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) + (1 << 28) -/* Rotate and Set Flag then AND */ -#define E_AND_RRORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) + (1 << 28) - -/* Rotate and then OR */ -#define E_OR_RROR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) + (1 << 28) -/* Rotate and Set Flag then OR */ -#define E_OR_RRORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) + (1 << 28) - -/* Rotate and then XOR */ -#define E_XOR_RROR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) + (1 << 28) -/* Rotate and Set Flag then XOR */ -#define E_XOR_RRORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) + (1 << 28) - -/* Rotate and then ADD */ -#define E_ADD_RROR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) + (1 << 28) -/* Rotate and Set Flag then ADD */ -#define E_ADD_RRORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) + (1 << 28) - -/* Rotate and then SUB */ -#define E_SUB_RROR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) + (1 << 28) -/* Rotate and Set Flag then SUB */ -#define E_SUB_RRORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) + (1 << 28) - -/* Rotate and then ADC */ -#define E_ADC_RROR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) + (1 << 28) -/* Rotate and Set Flag then ADC */ -#define E_ADC_RRORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) + (1 << 28) - -/* Rotate and then SBC */ -#define E_SBC_RROR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) + (1 << 28) -/* Rotate and Set Flag then SBC */ -#define E_SBC_RRORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) + (1 << 28) - -/* Conditional */ - -/* Rotate and then AND */ -#define E_COND_AND_RROR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) + (1 << 28) -/* Rotate and Set Flag then AND */ -#define E_COND_AND_RRORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) + (1 << 28) - -/* Rotate and then OR */ -#define E_COND_OR_RROR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) + (1 << 28) -/* Rotate and Set Flag then OR */ -#define E_COND_OR_RRORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) + (1 << 28) - -/* Rotate and then XOR */ -#define E_COND_XOR_RROR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) + (1 << 28) -/* Rotate and Set Flag then XOR */ -#define E_COND_XOR_RRORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) + (1 << 28) - -/* Rotate and then ADD */ -#define E_COND_ADD_RROR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) + (1 << 28) -/* Rotate and Set Flag then ADD */ -#define E_COND_ADD_RRORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) + (1 << 28) - -/* Rotate and then SUB */ -#define E_COND_SUB_RROR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) + (1 << 28) -/* Rotate and Set Flag then SUB */ -#define E_COND_SUB_RRORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) + (1 << 28) - -/* Rotate and then ADC */ -#define E_COND_ADC_RROR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) + (1 << 28) -/* Rotate and Set Flag then ADC */ -#define E_COND_ADC_RRORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) + (1 << 28) - -/* Rotate and then SBC */ -#define E_COND_SBC_RROR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) + (1 << 28) -/* Rotate and Set Flag then SBC */ -#define E_COND_SBC_RRORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) + (1 << 28) - -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_ROTATE by Reg Codes and invert ALU result */ -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Src1 r2shift SFlag - */ -/* Cond Imm Extra Operation Left/Right - */ -/* Shift/Rotate */ - -/* Rotate */ -#define E_RRORN(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag */ -#define E_RRORNS(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (1 << 18) + (1 << 27) - -/* Rotate and then AND */ -#define E_RROR_ANDN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag then AND */ -#define E_RROR_ANDNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) + (1 << 27) - -/* Rotate and then OR */ -#define E_RROR_ORN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag then OR */ -#define E_RROR_ORNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) + (1 << 27) - -/* Rotate and then XOR */ -#define E_RROR_XORN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag then XOR */ -#define E_RROR_XORNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) + (1 << 27) - -/* Rotate and then ADD */ -#define E_RROR_ADDN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag then ADD */ -#define E_RROR_ADDNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) + (1 << 27) - -/* Rotate and then SUB */ -#define E_RROR_SUBN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag then SUB */ -#define E_RROR_SUBNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) + (1 << 27) - -/* Rotate and then ADC */ -#define E_RROR_ADCN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag then ADC */ -#define E_RROR_ADCNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) + (1 << 27) - -/* Rotate and then SBC */ -#define E_RROR_SBCN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag then SBC */ -#define E_RROR_SBCNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) + (1 << 27) - -/* Conditional */ -/* Rotate */ -#define E_COND_RRORN(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag */ -#define E_COND_RRORNS(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (1 << 18) + (1 << 27) - -/* Rotate and then AND */ -#define E_COND_RROR_ANDN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag then AND */ -#define E_COND_RROR_ANDNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) + (1 << 27) - -/* Rotate and then OR */ -#define E_COND_RROR_ORN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag then OR */ -#define E_COND_RROR_ORNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) + (1 << 27) - -/* Rotate and then XOR */ -#define E_COND_RROR_XORN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag then XOR */ -#define E_COND_RROR_XORNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) + (1 << 27) - -/* Rotate and then ADD */ -#define E_COND_RROR_ADDN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag then ADD */ -#define E_COND_RROR_ADDNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) + (1 << 27) - -/* Rotate and then SUB */ -#define E_COND_RROR_SUBN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag then SUB */ -#define E_COND_RROR_SUBNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) + (1 << 27) - -/* Rotate and then ADC */ -#define E_COND_RROR_ADCN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag then ADC */ -#define E_COND_RROR_ADCNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) + (1 << 27) - -/* Rotate and then SBC */ -#define E_COND_RROR_SBCN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag then SBC */ -#define E_COND_RROR_SBCNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) + (1 << 27) - -/* Rotate and then AND */ -#define E_ANDN_RROR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Rotate and Set Flag then AND */ -#define E_ANDN_RRORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Rotate and then OR */ -#define E_ORN_RROR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Rotate and Set Flag then OR */ -#define E_ORN_RRORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Rotate and then XOR */ -#define E_XORN_RROR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Rotate and Set Flag then XOR */ -#define E_XORN_RRORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Rotate and then ADD */ -#define E_ADDN_RROR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Rotate and Set Flag then ADD */ -#define E_ADDN_RRORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Rotate and then SUB */ -#define E_SUBN_RROR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Rotate and Set Flag then SUB */ -#define E_SUBN_RRORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Rotate and then ADC */ -#define E_ADCN_RROR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Rotate and Set Flag then ADC */ -#define E_ADCN_RRORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Rotate and then SBC */ -#define E_SBCN_RROR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Rotate and Set Flag then SBC */ -#define E_SBCN_RRORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Conditional */ - -/* Rotate and then AND */ -#define E_COND_ANDN_RROR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Rotate and Set Flag then AND */ -#define E_COND_ANDN_RRORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Rotate and then OR */ -#define E_COND_ORN_RROR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Rotate and Set Flag then OR */ -#define E_COND_ORN_RRORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Rotate and then XOR */ -#define E_COND_XORN_RROR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Rotate and Set Flag then XOR */ -#define E_COND_XORN_RRORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Rotate and then ADD */ -#define E_COND_ADDN_RROR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Rotate and Set Flag then ADD */ -#define E_COND_ADDN_RRORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Rotate and then SUB */ -#define E_COND_SUBN_RROR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Rotate and Set Flag then SUB */ -#define E_COND_SUBN_RRORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Rotate and then ADC */ -#define E_COND_ADCN_RROR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Rotate and Set Flag then ADC */ -#define E_COND_ADCN_RRORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Rotate and then SBC */ -#define E_COND_SBCN_RROR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Rotate and Set Flag then SBC */ -#define E_COND_SBCN_RRORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* Arithmetical Shift Codes */ -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Src1 r2shift SFlag - */ -/* Cond Imm Extra Operation Left/Right - */ -/* Shift/Rotate Arith/Shift */ - -/* Arith Shift Right */ -#define E_RASR(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag */ -#define E_RASRS(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (1 << 18) - -/* Arith Shift Right and then AND */ -#define E_RASR_AND(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag then AND */ -#define E_RASR_ANDS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) - -/* Arith Shift Right and then OR */ -#define E_RASR_OR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag then OR */ -#define E_RASR_ORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) - -/* Arith Shift Right and then XOR */ -#define E_RASR_XOR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag then XOR */ -#define E_RASR_XORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) - -/* Arith Shift Right and then ADD */ -#define E_RASR_ADD(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag then ADD */ -#define E_RASR_ADDS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) - -/* Arith Shift Right and then SUB */ -#define E_RASR_SUB(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag then SUB */ -#define E_RASR_SUBS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) - -/* Arith Shift Right and then ADC */ -#define E_RASR_ADC(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag then ADC */ -#define E_RASR_ADCS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) - -/* Arith Shift Right and then SBC */ -#define E_RASR_SBC(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag then SBC */ -#define E_RASR_SBCS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) - -/* Conditional */ -/* Conditional Arith Shift */ -#define E_COND_RASR(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag */ -#define E_COND_RASRS(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (1 << 18) - -/* Conditional Arith Shift and then AND */ -#define E_COND_RASR_AND(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag then AND */ -#define E_COND_RASR_ANDS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) - -/* Conditional Arith Shift and then OR */ -#define E_COND_RASR_OR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag then OR */ -#define E_COND_RASR_ORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) - -/* Conditional Arith Shift and then XOR */ -#define E_COND_RASR_XOR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag then XOR */ -#define E_COND_RASR_XORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) - -/* Conditional Arith Shift and then ADD */ -#define E_COND_RASR_ADD(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag then ADD */ -#define E_COND_RASR_ADDS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) - -/* Conditional Arith Shift and then SUB */ -#define E_COND_RASR_SUB(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag then SUB */ -#define E_COND_RASR_SUBS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) - -/* Conditional Arith Shift and then ADC */ -#define E_COND_RASR_ADC(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag then ADC */ -#define E_COND_RASR_ADCS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) - -/* Conditional Arith Shift and then SBC */ -#define E_COND_RASR_SBC(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag then SBC */ -#define E_COND_RASR_SBCS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) - -/* Arith Shift Right and then AND */ -#define E_AND_RASR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) + (1 << 28) -/* Arith Shift Right and Set Flag then AND */ -#define E_AND_RASRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) + (1 << 28) - -/* Arith Shift Right and then OR */ -#define E_OR_RASR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) + (1 << 28) -/* Arith Shift Right and Set Flag then OR */ -#define E_OR_RASRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) + (1 << 28) - -/* Arith Shift Right and then XOR */ -#define E_XOR_RASR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) + (1 << 28) -/* Arith Shift Right and Set Flag then XOR */ -#define E_XOR_RASRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) + (1 << 28) - -/* Arith Shift Right and then ADD */ -#define E_ADD_RASR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) + (1 << 28) -/* Arith Shift Right and Set Flag then ADD */ -#define E_ADD_RASRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) + (1 << 28) - -/* Arith Shift Right and then SUB */ -#define E_SUB_RASR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) + (1 << 28) -/* Arith Shift Right and Set Flag then SUB */ -#define E_SUB_RASRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) + (1 << 28) - -/* Arith Shift Right and then ADC */ -#define E_ADC_RASR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) + (1 << 28) -/* Arith Shift Right and Set Flag then ADC */ -#define E_ADC_RASRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) + (1 << 28) - -/* Arith Shift Right and then SBC */ -#define E_SBC_RASR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) + (1 << 28) -/* Arith Shift Right and Set Flag then SBC */ -#define E_SBC_RASRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) + (1 << 28) - -/* Conditional */ - -/* Conditional Arith Shift and then AND */ -#define E_COND_AND_RASR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) + (1 << 28) -/* Conditional Arith Shift and Set Flag then AND */ -#define E_COND_AND_RASRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) + (1 << 28) - -/* Conditional Arith Shift and then OR */ -#define E_COND_OR_RASR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) + (1 << 28) -/* Conditional Arith Shift and Set Flag then OR */ -#define E_COND_OR_RASRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) + (1 << 28) - -/* Conditional Arith Shift and then XOR */ -#define E_COND_XOR_RASR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) + (1 << 28) -/* Conditional Arith Shift and Set Flag then XOR */ -#define E_COND_XOR_RASRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) + (1 << 28) - -/* Conditional Arith Shift and then ADD */ -#define E_COND_ADD_RASR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) + (1 << 28) -/* Conditional Arith Shift and Set Flag then ADD */ -#define E_COND_ADD_RASRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) + (1 << 28) - -/* Conditional Arith Shift and then SUB */ -#define E_COND_SUB_RASR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) + (1 << 28) -/* Conditional Arith Shift and Set Flag then SUB */ -#define E_COND_SUB_RASRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) + (1 << 28) - -/* Conditional Arith Shift and then ADC */ -#define E_COND_ADC_RASR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) + (1 << 28) -/* Conditional Arith Shift and Set Flag then ADC */ -#define E_COND_ADC_RASRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) + (1 << 28) - -/* Conditional Arith Shift and then SBC */ -#define E_COND_SBC_RASR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) + (1 << 28) -/* Conditional Arith Shift and Set Flag then SBC */ -#define E_COND_SBC_RASRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) + (1 << 28) - -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* Arithmetical Shift Codes with invert ALU */ -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Src1 r2shift SFlag - */ -/* Cond Imm Extra Operation Left/Right - */ -/* Shift/Rotate pOSTShift */ - -/* Arith Shift Right */ -#define E_RASRN(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (1 << 18) + (1 << 27) -/* Arith Shift Right and Set Flag */ -#define E_RASRNS(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (1 << 18) + (1 << 27) - -/* Arith Shift Right and then AND */ -#define E_RASR_ANDN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) + (1 << 27) -/* Arith Shift Right and Set Flag then AND */ -#define E_RASR_ANDNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) + (1 << 27) - -/* Arith Shift Right and then OR */ -#define E_RASR_ORN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) + (1 << 27) -/* Arith Shift Right and Set Flag then OR */ -#define E_RASR_ORNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) + (1 << 27) - -/* Arith Shift Right and then XOR */ -#define E_RASR_XORN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) + (1 << 27) -/* Arith Shift Right and Set Flag then XOR */ -#define E_RASR_XORNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) + (1 << 27) - -/* Arith Shift Right and then ADD */ -#define E_RASR_ADDN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) + (1 << 27) -/* Arith Shift Right and Set Flag then ADD */ -#define E_RASR_ADDNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) + (1 << 27) - -/* Arith Shift Right and then SUB */ -#define E_RASR_SUBN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) + (1 << 27) -/* Arith Shift Right and Set Flag then SUB */ -#define E_RASR_SUBNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) + (1 << 27) - -/* Arith Shift Right and then ADC */ -#define E_RASR_ADCN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) + (1 << 27) -/* Arith Shift Right and Set Flag then ADC */ -#define E_RASR_ADCNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) + (1 << 27) - -/* Arith Shift Right and then SBC */ -#define E_RASR_SBCN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) + (1 << 27) -/* Arith Shift Right and Set Flag then SBC */ -#define E_RASR_SBCNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) + (1 << 27) - -/* Conditional */ -/* Conditional Arith Shift */ -#define E_COND_RASRN(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (1 << 18) + (1 << 27) -/* Conditional Arith Shift and Set Flag */ -#define E_COND_RASRNS(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (1 << 18) + (1 << 27) - -/* Conditional Arith Shift and then AND */ -#define E_COND_RASR_ANDN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) + (1 << 27) -/* Conditional Arith Shift and Set Flag then AND */ -#define E_COND_RASR_ANDNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) + (1 << 27) - -/* Conditional Arith Shift and then OR */ -#define E_COND_RASR_ORN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) + (1 << 27) -/* Conditional Arith Shift and Set Flag then OR */ -#define E_COND_RASR_ORNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) + (1 << 27) - -/* Conditional Arith Shift and then XOR */ -#define E_COND_RASR_XORN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) + (1 << 27) -/* Conditional Arith Shift and Set Flag then XOR */ -#define E_COND_RASR_XORNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) + (1 << 27) - -/* Conditional Arith Shift and then ADD */ -#define E_COND_RASR_ADDN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) + (1 << 27) -/* Conditional Arith Shift and Set Flag then ADD */ -#define E_COND_RASR_ADDNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) + (1 << 27) - -/* Conditional Arith Shift and then SUB */ -#define E_COND_RASR_SUBN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) + (1 << 27) -/* Conditional Arith Shift and Set Flag then SUB */ -#define E_COND_RASR_SUBNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) + (1 << 27) - -/* Conditional Arith Shift and then ADC */ -#define E_COND_RASR_ADCN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) + (1 << 27) -/* Conditional Arith Shift and Set Flag then ADC */ -#define E_COND_RASR_ADCNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) + (1 << 27) - -/* Conditional Arith Shift and then SBC */ -#define E_COND_RASR_SBCN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) + (1 << 27) -/* Conditional Arith Shift and Set Flag then SBC */ -#define E_COND_RASR_SBCNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) + (1 << 27) - -/* Arith Shift Right and then AND */ -#define E_ANDN_RASR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Arith Shift Right and Set Flag then AND */ -#define E_ANDN_RASRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Arith Shift Right and then OR */ -#define E_ORN_RASR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Arith Shift Right and Set Flag then OR */ -#define E_ORN_RASRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Arith Shift Right and then XOR */ -#define E_XORN_RASR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Arith Shift Right and Set Flag then XOR */ -#define E_XORN_RASRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Arith Shift Right and then ADD */ -#define E_ADDN_RASR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Arith Shift Right and Set Flag then ADD */ -#define E_ADDN_RASRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Arith Shift Right and then SUB */ -#define E_SUBN_RASR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Arith Shift Right and Set Flag then SUB */ -#define E_SUBN_RASRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Arith Shift Right and then ADC */ -#define E_ADCN_RASR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Arith Shift Right and Set Flag then ADC */ -#define E_ADCN_RASRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Arith Shift Right and then SBC */ -#define E_SBCN_RASR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Arith Shift Right and Set Flag then SBC */ -#define E_SBCN_RASRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Conditional */ - -/* Conditional Arith Shift and then AND */ -#define E_COND_ANDN_RASR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Conditional Arith Shift and Set Flag then AND */ -#define E_COND_ANDN_RASRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Conditional Arith Shift and then OR */ -#define E_COND_ORN_RASR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Conditional Arith Shift and Set Flag then OR */ -#define E_COND_ORN_RASRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Conditional Arith Shift and then XOR */ -#define E_COND_XORN_RASR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Conditional Arith Shift and Set Flag then XOR */ -#define E_COND_XORN_RASRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Conditional Arith Shift and then ADD */ -#define E_COND_ADDN_RASR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Conditional Arith Shift and Set Flag then ADD */ -#define E_COND_ADDN_RASRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Conditional Arith Shift and then SUB */ -#define E_COND_SUBN_RASR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Conditional Arith Shift and Set Flag then SUB */ -#define E_COND_SUBN_RASRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Conditional Arith Shift and then ADC */ -#define E_COND_ADCN_RASR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Conditional Arith Shift and Set Flag then ADC */ -#define E_COND_ADCN_RASRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Conditional Arith Shift and then SBC */ -#define E_COND_SBCN_RASR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Conditional Arith Shift and Set Flag then SBC */ -#define E_COND_SBCN_RASRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* Bit Manipulate */ -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* opcode Dest Src1 src2 SFlag */ -/* Cond Imm Extra Operation ShiftByByte - */ -/* Neg/Pos Mask */ - -/* Bit test by byte */ -#define E_BTST(dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (0 << 9) + (EU << 5) + (0 << 24) + (1 << 29) + \ - (1 << 18) + (1 << 31) -#define E_BCLR(dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (0 << 9) + (EU << 5) + (0 << 24) + (1 << 29) + \ - (1 << 18) + (0 << 31) -#define E_BSET(dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (0 << 9) + (EU << 5) + (0 << 24) + (2 << 29) + \ - (1 << 18) + (1 << 31) -#define E_BTOG(dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (0 << 9) + (EU << 5) + (0 << 24) + (3 << 29) + \ - (1 << 18) + (1 << 31) - -/* Bit test by byte with set flags */ -#define E_BTSTS(dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (1 << 9) + (EU << 5) + (0 << 24) + (1 << 29) + \ - (1 << 18) + (1 << 31) -#define E_BCLRS(dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (1 << 9) + (EU << 5) + (0 << 24) + (1 << 29) + \ - (1 << 18) + (0 << 31) -#define E_BSETS(dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (1 << 9) + (EU << 5) + (0 << 24) + (2 << 29) + \ - (1 << 18) + (1 << 31) -#define E_BTOGS(dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (1 << 9) + (EU << 5) + (0 << 24) + (3 << 29) + \ - (1 << 18) + (1 << 31) - -/* Conditional Bit test by byte */ -#define E_COND_BTST(cond, dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (0 << 9) + (cond << 5) + (0 << 24) + (1 << 29) + \ - (1 << 18) + (1 << 31) -#define E_COND_BCLR(cond, dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (0 << 9) + (cond << 5) + (0 << 24) + (1 << 29) + \ - (1 << 18) + (0 << 31) -#define E_COND_BSET(cond, dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (0 << 9) + (cond << 5) + (0 << 24) + (2 << 29) + \ - (1 << 18) + (1 << 31) -#define E_COND_BTOG(cond, dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (0 << 9) + (cond << 5) + (0 << 24) + (3 << 29) + \ - (1 << 18) + (1 << 31) - -/* Conditional Bit test by byte with set flags */ -#define E_COND_BTSTS(cond, dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (1 << 9) + (cond << 5) + (0 << 24) + (1 << 29) + \ - (1 << 18) + (1 << 31) -#define E_COND_BCLRS(cond, dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (1 << 9) + (cond << 5) + (0 << 24) + (1 << 29) + \ - (1 << 18) + (0 << 31) -#define E_COND_BSETS(cond, dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (1 << 9) + (cond << 5) + (0 << 24) + (2 << 29) + \ - (1 << 18) + (1 << 31) -#define E_COND_BTOGS(cond, dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (1 << 9) + (cond << 5) + (0 << 24) + (3 << 29) + \ - (1 << 18) + (1 << 31) - -/* Bit test by imm */ -#define E_BTST_IMM(dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (0 << 9) + (EU << 5) + ((bit5 & 0x1f) << 24) + (1 << 29) + (0 << 18) + \ - (1 << 31) -#define E_BCLR_IMM(dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (0 << 9) + (EU << 5) + ((bit5 & 0x1f) << 24) + (1 << 29) + (0 << 18) + \ - (0 << 31) -#define E_BSET_IMM(dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (0 << 9) + (EU << 5) + ((bit5 & 0x1f) << 24) + (2 << 29) + (0 << 18) + \ - (1 << 31) -#define E_BTOG_IMM(dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (0 << 9) + (EU << 5) + ((bit5 & 0x1f) << 24) + (3 << 29) + (0 << 18) + \ - (1 << 31) - -/* Bit test by imm with set flags */ -#define E_BTST_IMMS(dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (1 << 9) + (EU << 5) + ((bit5 & 0x1f) << 24) + (1 << 29) + (0 << 18) + \ - (1 << 31) -#define E_BCLR_IMMS(dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (1 << 9) + (EU << 5) + ((bit5 & 0x1f) << 24) + (1 << 29) + (0 << 18) + \ - (0 << 31) -#define E_BSET_IMMS(dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (1 << 9) + (EU << 5) + ((bit5 & 0x1f) << 24) + (2 << 29) + (0 << 18) + \ - (1 << 31) -#define E_BTOG_IMMS(dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (1 << 9) + (EU << 5) + ((bit5 & 0x1f) << 24) + (3 << 29) + (0 << 18) + \ - (1 << 31) - -/* Conditional Bit test by imm */ -#define E_COND_BTST_IMM(cond, dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (0 << 9) + (cond << 5) + ((bit5 & 0x1f) << 24) + (1 << 29) + (0 << 18) + \ - (1 << 31) -#define E_COND_BCLR_IMM(cond, dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (0 << 9) + (cond << 5) + ((bit5 & 0x1f) << 24) + (1 << 29) + (0 << 18) + \ - (0 << 31) -#define E_COND_BSET_IMM(cond, dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (0 << 9) + (cond << 5) + ((bit5 & 0x1f) << 24) + (2 << 29) + (0 << 18) + \ - (1 << 31) -#define E_COND_BTOG_IMM(cond, dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (0 << 9) + (cond << 5) + ((bit5 & 0x1f) << 24) + (3 << 29) + (0 << 18) + \ - (1 << 31) - -/* Conditional Bit test by imm with set flags */ -#define E_COND_BTST_IMMS(cond, dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (1 << 9) + (cond << 5) + ((bit5 & 0x1f) << 24) + (1 << 29) + (0 << 18) + \ - (1 << 31) -#define E_COND_BCLR_IMMS(cond, dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (1 << 9) + (cond << 5) + ((bit5 & 0x1f) << 24) + (1 << 29) + (0 << 18) + \ - (0 << 31) -#define E_COND_BSET_IMMS(cond, dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (1 << 9) + (cond << 5) + ((bit5 & 0x1f) << 24) + (2 << 29) + (0 << 18) + \ - (1 << 31) -#define E_COND_BTOG_IMMS(cond, dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (1 << 9) + (cond << 5) + ((bit5 & 0x1f) << 24) + (3 << 29) + (0 << 18) + \ - (1 << 31) - -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* Tight Loop */ -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -#define E_TIGHT_LOOP(rend, rcount) DCD 0x1A + (rend << 14) + (rcount << 20) -#define E_COND_TIGHT_LOOP(cond, rend, rcount) DCD 0x1A + (rend << 14) + (rcount << 20) + (cond << 5) - -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* Boolean Detect */ -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* Opcode Dest Vector/Single NoUpdateRA */ -/* LargeVectors Cond Table */ - -#define E_HOLD DCD 0x1C + (PC << 10) + (1 << 15) + (0 << 18) + (0 << 19) + (EU << 5) -#define E_COND_HOLD(cond) DCD 0x1C + (PC << 10) + (1 << 15) + (0 << 18) + (0 << 19) + (cond << 5) - -/* Small Vector Versions */ -#define E_VECTORED_HOLD(table) DCD 0x1C + (table << 10) + (0 << 15) + (0 << 18) + (0 << 19) + (EU << 5) + (table << 20) -#define E_COND_VECTORED_HOLD(cond, table) \ - DCD 0x1C + (table << 10) + (0 << 15) + (0 << 18) + (0 << 19) + (cond << 5) + (table << 20) -#define E_VECTORED_HOLD_NRA(table) \ - DCD 0x1C + (table << 10) + (0 << 15) + (1 << 18) + (0 << 19) + (EU << 5) + (table << 20) -#define E_COND_VECTORED_HOLD_NRA \ - (cond, table) DCD 0x1C + (table << 10) + (0 << 15) + (1 << 18) + (0 << 19) + (cond << 5) + (table << 20) - -/* Large Vector Versions */ -#define E_VECTORED_HOLD_LV(table) \ - DCD 0x1C + (table << 10) + (0 << 15) + (0 << 18) + (1 << 19) + (EU << 5) + (table << 20) -#define E_COND_VECTORED_HOLD_LV(cond, table) \ - DCD 0x1C + (table << 10) + (0 << 15) + (0 << 18) + (1 << 19) + (cond << 5) + (table << 20) -#define E_VECTORED_HOLD_LV_NRA(table) \ - DCD 0x1C + (table << 10) + (0 << 15) + (1 << 18) + (1 << 19) + (EU << 5) + (table << 20) -#define E_COND_VECTORED_HOLD_LV_NRA \ - (cond, table) DCD 0x1C + (table << 10) + (0 << 15) + (1 << 18) + (1 << 19) + (cond << 5) + (table << 20) - -/*/ Accelarated Vectored_hold */ -/* Small Vector Versions */ -#define E_ACC_VECTORED_HOLD(table, vectors) \ - DCD 0x1C + (table << 10) + (0 << 15) + (0 << 18) + (0 << 19) + (EU << 5) + (table << 20) + (1 << 9) + \ - (vectors << 24) -#define E_COND_ACC_VECTORED_HOLD(cond, table, vectors) \ - DCD 0x1C + (table << 10) + (0 << 15) + (0 << 18) + (0 << 19) + (cond << 5) + (table << 20) + (1 << 9) + \ - (vectors << 24) -#define E_ACC_VECTORED_HOLD_NRA(table, vectors) \ - DCD 0x1C + (table << 10) + (0 << 15) + (1 << 18) + (0 << 19) + (EU << 5) + (table << 20) + (1 << 9) + \ - (vectors << 24) -#define E_COND_ACC_VECTORED_HOLD_NRA \ - (cond, table, vectors) DCD 0x1C + (table << 10) + (0 << 15) + (1 << 18) + (0 << 19) + (cond << 5) + \ - (table << 20) + (1 << 9) + (vectors << 24) - -/* Large Vector Versions */ -#define E_ACC_VECTORED_HOLD_LV(table, vectors) \ - DCD 0x1C + (table << 10) + (0 << 15) + (0 << 18) + (1 << 19) + (EU << 5) + (table << 20) + (1 << 9) + \ - (vectors << 24) -#define E_COND_ACC_VECTORED_HOLD_LV(cond, table, vectors) \ - DCD 0x1C + (table << 10) + (0 << 15) + (0 << 18) + (1 << 19) + (cond << 5) + (table << 20) + (1 << 9) + \ - (vectors << 24) -#define E_ACC_VECTORED_HOLD_LV_NRA(table, vectors) \ - DCD 0x1C + (table << 10) + (0 << 15) + (1 << 18) + (1 << 19) + (EU << 5) + (table << 20) + (1 << 9) + \ - (vectors << 24) -#define E_COND_ACC_VECTORED_HOLD_LV_NRA \ - (cond, table, vectors) DCD 0x1C + (table << 10) + (0 << 15) + (1 << 18) + (1 << 19) + (cond << 5) + \ - (table << 20) + (1 << 9) + (vectors << 24) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* Reg offset Read */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Rdata Dest Pointer WData Source */ -/* Offset SizeWord Signed Access Cond Write */ - -/* LDR (Load, Load Byte, LoadByteSigned) */ -#define E_LDR_REG(dest, source, offset) \ - DCD 0x1D + (dest << 10) + (source << 14) + (offset << 24) + (1 << 18) + (0 << 21) + (EU << 5) -#define E_LDR_REGB(dest, source, offset) \ - DCD 0x1D + (dest << 10) + (source << 14) + (offset << 24) + (0 << 18) + (0 << 21) + (EU << 5) -#define E_LDR_REGBS(dest, source, offset) \ - DCD 0x1D + (dest << 10) + (source << 14) + (offset << 24) + (0 << 18) + (1 << 21) + (EU << 5) - -/* Conditional LDR (Load, Load Byte, LoadByteSigned) */ -#define E_COND_LDR_REG(cond, dest, source, offset) \ - DCD 0x1D + (dest << 10) + (source << 14) + (offset << 24) + (1 << 18) + (0 << 21) + (cond << 5) -#define E_COND_LDR_REGB(cond, dest, source, offset) \ - DCD 0x1D + (dest << 10) + (source << 14) + (offset << 24) + (0 << 18) + (0 << 21) + (cond << 5) -#define E_COND_LDR_REGBS(cond, dest, source, offset) \ - DCD 0x1D + (dest << 10) + (source << 14) + (offset << 24) + (0 << 18) + (1 << 21) + (cond << 5) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* Reg offset Write */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Rdata Dest Pointer WData Source */ -/* Offset SizeWord Signed Access Cond Write */ - -/* STR (Load, Load Byte, LoadByteSigned) */ -#define E_STR_REG(raddr, rdata, roffset) \ - DCD 0x1D + (raddr << 14) + (rdata << 20) + (roffset << 24) + (1 << 18) + (0 << 11) + (EU << 5) + (1 << 30) -#define E_STR_REGB(raddr, rdata, roffset) \ - DCD 0x1D + (raddr << 14) + (rdata << 20) + (roffset << 24) + (0 << 18) + (0 << 11) + (EU << 5) + (1 << 30) - -/* Conditional STR (Load, Load Byte, LoadByteSigned) */ -#define E_COND_STR_REG(cond, raddr, rdata, roffset) \ - DCD 0x1D + (raddr << 14) + (rdata << 20) + (roffset << 24) + (1 << 18) + (0 << 11) + (cond << 5) + (1 << 30) -#define E_COND_STR_REGB(cond, raddr, rdata, roffset) \ - DCD 0x1D + (raddr << 14) + (rdata << 20) + (roffset << 24) + (0 << 18) + (0 << 11) + (cond << 5) + (1 << 30) - -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* GPO modify Byte */ -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -#define E_MODIFY_GPO_BYTE(andmask, ormask, xormask) DCD 0x1E + (andmask << 8) + (ormask << 16) + (xormask << 24) - -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* HeartBeat opcodes */ -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -#define E_HEART_RYTHM_IMM(val16imm) DCD 0x32 + (val16imm << 16) -#define E_HEART_RYTHM(r16bit) DCD 0x32 + (r16bit << 14) + (1 << 9) -#define E_SYNCH_ALL_TO_BEAT(on1imm) DCD 0x52 + (on1imm << 31) -#define E_WAIT_FOR_BEAT DCD 0x72 - -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_smartdma_rt500.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_smartdma_rt500.c deleted file mode 100644 index f8952e16e1d..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_smartdma_rt500.c +++ /dev/null @@ -1,2518 +0,0 @@ -/* - * Copyright 2019-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_smartdma.h" - -#if defined(MIMXRT533S_SERIES) || defined(MIMXRT555S_SERIES) || defined(MIMXRT595S_cm33_SERIES) - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ -#if (SMARTDMA_DISPLAY_FIRMWARE_SELECT == SMARTDMA_DISPLAY_MIPI_AND_FLEXIO) -const uint8_t s_smartdmaDisplayFirmware[] = { - 0x60U, 0x00U, 0x10U, 0x24U, 0x40U, 0x01U, 0x10U, 0x24U, 0xC8U, 0x02U, 0x10U, 0x24U, - 0x04U, 0x02U, 0x10U, 0x24U, 0x68U, 0x03U, 0x10U, 0x24U, 0x98U, 0x08U, 0x10U, 0x24U, - 0xE8U, 0x0DU, 0x10U, 0x24U, 0xFCU, 0x0FU, 0x10U, 0x24U, 0x70U, 0x12U, 0x10U, 0x24U, - 0xE8U, 0x14U, 0x10U, 0x24U, 0xACU, 0x25U, 0x10U, 0x24U, 0x54U, 0x16U, 0x10U, 0x24U, - 0xCCU, 0x27U, 0x10U, 0x24U, 0x18U, 0x19U, 0x10U, 0x24U, 0x7CU, 0x2BU, 0x10U, 0x24U, - 0xE4U, 0x1BU, 0x10U, 0x24U, 0x54U, 0x1DU, 0x10U, 0x24U, 0x24U, 0x20U, 0x10U, 0x24U, - 0xDCU, 0x2EU, 0x10U, 0x24U, 0x68U, 0x33U, 0x10U, 0x24U, 0x70U, 0x38U, 0x10U, 0x24U, - 0x8CU, 0x3BU, 0x10U, 0x24U, 0xF8U, 0x22U, 0x10U, 0x24U, 0x44U, 0x3EU, 0x10U, 0x24U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, - 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0xB0U, 0x05U, 0x02U, 0x10U, 0x04U, 0x14U, 0x05U, 0x08U, 0x44U, 0x14U, 0x00U, - 0x06U, 0x48U, 0xC7U, 0x08U, 0x1AU, 0x80U, 0x10U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x11U, 0x08U, 0x38U, 0x00U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x05U, 0x00U, 0x22U, 0x32U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, - 0x05U, 0x04U, 0x22U, 0x32U, 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x10U, 0x08U, 0x2CU, 0x10U, 0x05U, 0x08U, 0x22U, 0x32U, 0x11U, 0x08U, 0x38U, 0x00U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x05U, 0x0CU, 0x22U, 0x32U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, - 0x05U, 0x10U, 0x22U, 0x32U, 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x10U, 0x08U, 0x2CU, 0x10U, 0x05U, 0x14U, 0x22U, 0x32U, 0x11U, 0x08U, 0x38U, 0x00U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x05U, 0x18U, 0x22U, 0x32U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, - 0x05U, 0x1CU, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x42U, 0x02U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, - 0x10U, 0x04U, 0x14U, 0x05U, 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0x07U, 0x07U, - 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x06U, 0x00U, 0xC4U, 0x01U, 0x01U, 0x08U, 0x1CU, 0xFFU, - 0x01U, 0x0CU, 0x1CU, 0xFFU, 0x01U, 0x10U, 0x1CU, 0xFFU, 0x01U, 0x14U, 0x1CU, 0xFFU, - 0x11U, 0x08U, 0x20U, 0x00U, 0x05U, 0x00U, 0x22U, 0x32U, 0x11U, 0x0CU, 0x30U, 0x00U, - 0x05U, 0x04U, 0x32U, 0x32U, 0x11U, 0x10U, 0x40U, 0x00U, 0x05U, 0x08U, 0x42U, 0x32U, - 0x11U, 0x14U, 0x50U, 0x00U, 0x05U, 0x0CU, 0x52U, 0x32U, 0x01U, 0x08U, 0x1CU, 0xFFU, - 0x01U, 0x0CU, 0x1CU, 0xFFU, 0x01U, 0x10U, 0x1CU, 0xFFU, 0x01U, 0x14U, 0x1CU, 0x08U, - 0x11U, 0x08U, 0x20U, 0x00U, 0x05U, 0x10U, 0x22U, 0x32U, 0x11U, 0x0CU, 0x30U, 0x00U, - 0x05U, 0x14U, 0x32U, 0x32U, 0x11U, 0x10U, 0x40U, 0x00U, 0x05U, 0x18U, 0x42U, 0x32U, - 0x11U, 0x14U, 0x50U, 0x00U, 0x05U, 0x1CU, 0x52U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, - 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xCAU, 0x03U, 0x20U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, - 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0xB0U, 0x05U, 0x02U, 0x06U, 0x18U, 0x10U, 0x00U, 0x10U, 0x04U, 0x14U, 0x05U, - 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0xC7U, 0x06U, 0x1AU, 0x80U, 0x10U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x01U, 0x88U, 0x15U, 0xFFU, 0x01U, 0x8CU, 0x15U, 0xFFU, 0x01U, 0x90U, 0x15U, 0xFFU, - 0x01U, 0x94U, 0x15U, 0xFFU, 0x11U, 0x08U, 0x20U, 0x00U, 0x05U, 0x00U, 0x22U, 0x32U, - 0x11U, 0x0CU, 0x30U, 0x00U, 0x05U, 0x04U, 0x32U, 0x32U, 0x11U, 0x10U, 0x40U, 0x00U, - 0x05U, 0x08U, 0x42U, 0x32U, 0x11U, 0x14U, 0x50U, 0x00U, 0x05U, 0x0CU, 0x52U, 0x32U, - 0x01U, 0x88U, 0x15U, 0xFFU, 0x01U, 0x8CU, 0x15U, 0xFFU, 0x01U, 0x90U, 0x15U, 0xFFU, - 0x01U, 0x94U, 0x15U, 0xFFU, 0x11U, 0x08U, 0x20U, 0x00U, 0x05U, 0x10U, 0x22U, 0x32U, - 0x11U, 0x0CU, 0x30U, 0x00U, 0x05U, 0x14U, 0x32U, 0x32U, 0x11U, 0x10U, 0x40U, 0x00U, - 0x05U, 0x18U, 0x42U, 0x32U, 0x11U, 0x14U, 0x50U, 0x00U, 0x05U, 0x1CU, 0x52U, 0x32U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x15U, 0x52U, 0x05U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, - 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, 0x10U, 0x04U, 0x14U, 0x05U, - 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0xC7U, 0x04U, 0x1AU, 0x80U, 0x10U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x05U, 0x00U, 0x22U, 0x32U, 0x05U, 0x04U, 0x32U, 0x32U, - 0x05U, 0x08U, 0x42U, 0x32U, 0x05U, 0x0CU, 0x52U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x05U, 0x10U, 0x22U, 0x32U, 0x05U, 0x14U, 0x32U, 0x32U, 0x05U, 0x18U, 0x42U, 0x32U, - 0x05U, 0x1CU, 0x52U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x92U, 0x06U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x04U, 0x18U, 0x04U, 0x27U, 0x10U, 0x18U, 0x68U, 0x02U, 0x10U, 0x18U, 0x60U, 0x02U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0xA4U, 0x05U, 0x01U, 0x01U, 0x84U, 0x05U, 0x02U, - 0x01U, 0xB0U, 0x05U, 0x03U, 0x10U, 0x04U, 0x14U, 0x06U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, - 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, - 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x02U, 0x44U, 0x3EU, 0x01U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, - 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, - 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, - 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, - 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x02U, 0x44U, 0x3EU, 0x01U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, - 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, - 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, - 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, - 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x02U, 0x44U, 0x3EU, 0x01U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, - 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, - 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, - 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, - 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x02U, 0x44U, 0x3EU, 0x01U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, - 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, - 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, - 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, - 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x02U, 0x44U, 0x3EU, 0x01U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, - 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, - 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, - 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, - 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x02U, 0x44U, 0x3EU, 0x01U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, - 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, - 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, - 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, - 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x02U, 0x44U, 0x3EU, 0x01U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, - 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, - 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, - 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, - 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x02U, 0x44U, 0x3EU, 0x01U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, - 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, - 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x1AU, 0x07U, 0x20U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x15U, 0xF2U, 0x10U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x10U, 0x18U, 0x68U, 0x02U, - 0x10U, 0x18U, 0x60U, 0x02U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0xB0U, 0x05U, 0x02U, 0x10U, 0x04U, 0x14U, 0x06U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, - 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, - 0x10U, 0xCCU, 0x70U, 0x4BU, 0x05U, 0x00U, 0x32U, 0x32U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, - 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, - 0x05U, 0x04U, 0x32U, 0x32U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, - 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, - 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, - 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, - 0x05U, 0x08U, 0x32U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, - 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, - 0x10U, 0xCCU, 0x70U, 0x4BU, 0x05U, 0x0CU, 0x32U, 0x32U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, - 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, - 0x05U, 0x10U, 0x32U, 0x32U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, - 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, - 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, - 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, - 0x05U, 0x14U, 0x32U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, - 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, - 0x10U, 0xCCU, 0x70U, 0x4BU, 0x05U, 0x18U, 0x32U, 0x32U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, - 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, - 0x05U, 0x1CU, 0x32U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, - 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, - 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, - 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, 0x05U, 0x00U, 0x32U, 0x32U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, - 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, - 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, - 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, - 0x05U, 0x04U, 0x32U, 0x32U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, - 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, - 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, - 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, 0x05U, 0x08U, 0x32U, 0x32U, - 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, - 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, - 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, - 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, 0x05U, 0x0CU, 0x32U, 0x32U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, - 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, - 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, - 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, - 0x05U, 0x10U, 0x32U, 0x32U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, - 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, - 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, - 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, 0x05U, 0x14U, 0x32U, 0x32U, - 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, - 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, - 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, - 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, 0x05U, 0x18U, 0x32U, 0x32U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, - 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, - 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, - 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, - 0x05U, 0x1CU, 0x32U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, - 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, - 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x05U, 0x00U, 0x32U, 0x32U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x05U, 0x04U, 0x32U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, - 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, - 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x05U, 0x08U, 0x32U, 0x32U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, - 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, - 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x05U, 0x0CU, 0x32U, 0x32U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x05U, 0x10U, 0x32U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, - 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, - 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x05U, 0x14U, 0x32U, 0x32U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, - 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, - 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x05U, 0x18U, 0x32U, 0x32U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x05U, 0x1CU, 0x32U, 0x32U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x82U, 0x11U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x92U, 0x1BU, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, - 0x10U, 0x04U, 0x14U, 0x07U, 0x00U, 0x18U, 0xFEU, 0x8FU, 0x08U, 0x44U, 0x14U, 0x00U, - 0x06U, 0x48U, 0xC7U, 0x1BU, 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, - 0x05U, 0x00U, 0x22U, 0x32U, 0x05U, 0x04U, 0x32U, 0x32U, 0x05U, 0x08U, 0x42U, 0x32U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x0CU, 0x22U, 0x32U, 0x05U, 0x10U, 0x32U, 0x32U, - 0x05U, 0x14U, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x18U, 0x22U, 0x32U, - 0x05U, 0x1CU, 0x32U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x00U, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x04U, 0x22U, 0x32U, - 0x05U, 0x08U, 0x32U, 0x32U, 0x05U, 0x0CU, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, - 0x05U, 0x10U, 0x22U, 0x32U, 0x05U, 0x14U, 0x32U, 0x32U, 0x05U, 0x18U, 0x42U, 0x32U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x1CU, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x00U, 0x32U, 0x32U, 0x05U, 0x04U, 0x42U, 0x32U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x08U, 0x22U, 0x32U, 0x05U, 0x0CU, 0x32U, 0x32U, - 0x05U, 0x10U, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x14U, 0x22U, 0x32U, - 0x05U, 0x18U, 0x32U, 0x32U, 0x05U, 0x1CU, 0x42U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, - 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xBAU, 0x1FU, 0x20U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, - 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0xB0U, 0x05U, 0x02U, 0x10U, 0x04U, 0x14U, 0x07U, 0x00U, 0x18U, 0xFEU, 0x8FU, - 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0xC7U, 0x21U, 0x1AU, 0x80U, 0x10U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x00U, - 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x00U, 0x22U, 0x32U, 0x05U, 0x04U, 0x32U, 0x32U, - 0x05U, 0x08U, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x11U, 0x88U, 0x21U, 0x20U, - 0x11U, 0x0CU, 0x30U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x0CU, 0x22U, 0x32U, - 0x05U, 0x10U, 0x32U, 0x32U, 0x05U, 0x14U, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x10U, 0x51U, 0x48U, - 0x05U, 0x18U, 0x22U, 0x32U, 0x05U, 0x1CU, 0x32U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x00U, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x10U, 0x51U, 0x48U, - 0x05U, 0x04U, 0x22U, 0x32U, 0x05U, 0x08U, 0x32U, 0x32U, 0x05U, 0x0CU, 0x42U, 0x32U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x00U, - 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x10U, 0x22U, 0x32U, 0x05U, 0x14U, 0x32U, 0x32U, - 0x05U, 0x18U, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x11U, 0x88U, 0x21U, 0x20U, - 0x11U, 0x0CU, 0x30U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x1CU, 0x22U, 0x32U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x00U, 0x32U, 0x32U, - 0x05U, 0x04U, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x11U, 0x88U, 0x21U, 0x20U, - 0x11U, 0x0CU, 0x30U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x08U, 0x22U, 0x32U, - 0x05U, 0x0CU, 0x32U, 0x32U, 0x05U, 0x10U, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x10U, 0x51U, 0x48U, - 0x05U, 0x14U, 0x22U, 0x32U, 0x05U, 0x18U, 0x32U, 0x32U, 0x05U, 0x1CU, 0x42U, 0x32U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x15U, 0xA2U, 0x24U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, - 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, 0x00U, 0x18U, 0xFEU, 0x8FU, - 0x06U, 0x00U, 0x10U, 0x00U, 0x10U, 0x04U, 0x14U, 0x07U, 0x08U, 0x44U, 0x14U, 0x00U, - 0x06U, 0x48U, 0xC7U, 0x21U, 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x01U, 0x08U, 0x14U, 0xFFU, - 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, - 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, - 0x05U, 0x00U, 0x22U, 0x32U, 0x05U, 0x04U, 0x32U, 0x32U, 0x05U, 0x08U, 0x42U, 0x32U, - 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, - 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, - 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x0CU, 0x22U, 0x32U, 0x05U, 0x10U, 0x32U, 0x32U, - 0x05U, 0x14U, 0x42U, 0x32U, 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, - 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x18U, 0x22U, 0x32U, - 0x05U, 0x1CU, 0x32U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x00U, 0x42U, 0x32U, 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, - 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x04U, 0x22U, 0x32U, - 0x05U, 0x08U, 0x32U, 0x32U, 0x05U, 0x0CU, 0x42U, 0x32U, 0x01U, 0x08U, 0x14U, 0xFFU, - 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, - 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, - 0x05U, 0x10U, 0x22U, 0x32U, 0x05U, 0x14U, 0x32U, 0x32U, 0x05U, 0x18U, 0x42U, 0x32U, - 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, - 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, - 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x1CU, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x00U, 0x32U, 0x32U, 0x05U, 0x04U, 0x42U, 0x32U, - 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, - 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, - 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x08U, 0x22U, 0x32U, 0x05U, 0x0CU, 0x32U, 0x32U, - 0x05U, 0x10U, 0x42U, 0x32U, 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, - 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x14U, 0x22U, 0x32U, - 0x05U, 0x18U, 0x32U, 0x32U, 0x05U, 0x1CU, 0x42U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, - 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x92U, 0x29U, 0x20U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, - 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0xB0U, 0x05U, 0x02U, 0x01U, 0x9CU, 0x05U, 0x03U, 0x00U, 0x0CU, 0xC4U, 0x02U, - 0x00U, 0xDEU, 0x01U, 0x00U, 0x35U, 0x32U, 0x2AU, 0x20U, 0x15U, 0x5AU, 0x2BU, 0x20U, - 0x08U, 0x4AU, 0xC4U, 0x0FU, 0x60U, 0x08U, 0xC4U, 0x0FU, 0x80U, 0x48U, 0x00U, 0x00U, - 0x06U, 0x98U, 0x34U, 0x00U, 0x10U, 0x18U, 0x68U, 0x02U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x5AU, 0x2AU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x11U, 0x10U, 0x48U, 0x00U, 0x10U, 0x10U, 0x4CU, 0x10U, 0x10U, 0xDCU, 0x40U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x0CU, 0x48U, 0x18U, 0x08U, 0x9AU, 0x15U, 0x00U, - 0x55U, 0x5AU, 0x2AU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0xB2U, 0x2AU, 0x20U, 0x0DU, 0x9AU, 0x34U, 0x00U, 0x25U, 0x80U, 0x32U, 0x31U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, - 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, - 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, 0x08U, 0x46U, 0x20U, 0x00U, - 0xB5U, 0x32U, 0x2AU, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x15U, 0x6AU, 0x2CU, 0x20U, 0x08U, 0x4AU, 0xC4U, 0x0FU, 0x60U, 0x08U, 0xC4U, 0x0FU, - 0x80U, 0x48U, 0x00U, 0x00U, 0x06U, 0x98U, 0x34U, 0x00U, 0x10U, 0x18U, 0x68U, 0x02U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x82U, 0x2BU, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x10U, 0x0CU, 0x48U, 0x18U, 0x08U, 0x9AU, 0x15U, 0x00U, 0x55U, 0x82U, 0x2BU, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0xCAU, 0x2BU, 0x20U, - 0x0DU, 0x9AU, 0x34U, 0x00U, 0x25U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, - 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, - 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, - 0x00U, 0x0CU, 0xC4U, 0x03U, 0x08U, 0x46U, 0x20U, 0x00U, 0xB5U, 0x5AU, 0x2BU, 0x20U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x15U, 0x6AU, 0x2CU, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, - 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, 0x01U, 0x9CU, 0x05U, 0x03U, - 0x00U, 0x0CU, 0xC4U, 0x02U, 0x00U, 0xDEU, 0x01U, 0x00U, 0x35U, 0x0AU, 0x2DU, 0x20U, - 0x15U, 0xC2U, 0x2FU, 0x20U, 0x08U, 0x4AU, 0xC4U, 0x0FU, 0x60U, 0x08U, 0xC4U, 0x0FU, - 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0x2AU, 0x2EU, 0x20U, 0x00U, 0x24U, 0x54U, 0x01U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x32U, 0x2DU, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x01U, 0x18U, 0x1CU, 0x01U, - 0x11U, 0x1CU, 0x40U, 0x08U, 0x10U, 0xDCU, 0x70U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x10U, 0x10U, 0x48U, 0x18U, 0x0DU, 0x8CU, 0xF5U, 0x0FU, 0x10U, 0x0CU, 0x31U, 0x48U, - 0x11U, 0x10U, 0x50U, 0x10U, 0x10U, 0x1CU, 0x31U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x14U, 0x50U, 0x10U, 0x11U, 0x1CU, 0x60U, 0x00U, - 0x10U, 0x1CU, 0x70U, 0x10U, 0x10U, 0xDCU, 0x59U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x00U, 0x0CU, 0xF6U, 0x0FU, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x08U, 0x66U, 0x16U, 0x00U, - 0x55U, 0x32U, 0x2DU, 0x20U, 0x08U, 0x46U, 0x20U, 0x00U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x02U, 0x2EU, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, - 0x15U, 0x42U, 0x2FU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0x2AU, 0x2EU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x01U, 0x18U, 0x1CU, 0x01U, 0x11U, 0x1CU, 0x40U, 0x08U, 0x10U, 0xDCU, 0x70U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, 0x35U, 0x42U, 0x2FU, 0x20U, - 0x10U, 0x10U, 0x48U, 0x18U, 0x0DU, 0x8CU, 0xF5U, 0x0FU, 0x10U, 0x0CU, 0x31U, 0x48U, - 0x11U, 0x10U, 0x50U, 0x10U, 0x10U, 0x1CU, 0x31U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x34U, 0x00U, 0x35U, 0x42U, 0x2FU, 0x20U, 0x11U, 0x14U, 0x50U, 0x00U, - 0x10U, 0x14U, 0x50U, 0x10U, 0x11U, 0x1CU, 0x60U, 0x00U, 0x10U, 0x1CU, 0x70U, 0x10U, - 0x10U, 0xDCU, 0x59U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, - 0x35U, 0x42U, 0x2FU, 0x20U, 0x00U, 0x0CU, 0xF6U, 0x0FU, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x08U, 0x46U, 0x34U, 0x00U, 0xB5U, 0x2AU, 0x2EU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x22U, 0x2FU, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, - 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, - 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, 0x00U, 0x46U, 0x00U, 0x00U, - 0xB5U, 0x0AU, 0x2DU, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x15U, 0xF2U, 0x31U, 0x20U, 0x08U, 0x4AU, 0xC4U, 0x0FU, 0x60U, 0x08U, 0xC4U, 0x0FU, - 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0xA2U, 0x30U, 0x20U, 0x00U, 0x24U, 0x54U, 0x01U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0xEAU, 0x2FU, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x01U, 0x18U, 0x1CU, 0x01U, - 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x10U, 0x48U, 0x18U, - 0x10U, 0x1CU, 0x51U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x14U, 0x58U, 0x18U, - 0x10U, 0x5CU, 0x61U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x0CU, 0x68U, 0x18U, - 0x08U, 0x66U, 0x16U, 0x00U, 0x55U, 0xEAU, 0x2FU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x72U, 0x30U, 0x20U, 0x08U, 0x46U, 0x20U, 0x00U, - 0x05U, 0x80U, 0x32U, 0x31U, 0x15U, 0x7AU, 0x31U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0xA2U, 0x30U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x01U, 0x18U, 0x1CU, 0x01U, 0x10U, 0xDCU, 0x40U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, 0x35U, 0x7AU, 0x31U, 0x20U, - 0x10U, 0x10U, 0x48U, 0x18U, 0x10U, 0x1CU, 0x51U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x34U, 0x00U, 0x35U, 0x7AU, 0x31U, 0x20U, 0x10U, 0x14U, 0x58U, 0x18U, - 0x10U, 0x5CU, 0x61U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, - 0x35U, 0x7AU, 0x31U, 0x20U, 0x10U, 0x0CU, 0x68U, 0x18U, 0x08U, 0x46U, 0x34U, 0x00U, - 0xB5U, 0xA2U, 0x30U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0x5AU, 0x31U, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, - 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, - 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, - 0x00U, 0x0CU, 0xC4U, 0x03U, 0x00U, 0x46U, 0x00U, 0x00U, 0xB5U, 0xC2U, 0x2FU, 0x20U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x15U, 0xF2U, 0x31U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, - 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, 0x01U, 0x9CU, 0x05U, 0x03U, - 0x00U, 0x0CU, 0xC4U, 0x02U, 0x00U, 0x24U, 0xF4U, 0x0FU, 0x00U, 0xDEU, 0x01U, 0x00U, - 0x35U, 0x9AU, 0x32U, 0x20U, 0x15U, 0x1AU, 0x35U, 0x20U, 0x08U, 0x4AU, 0x04U, 0x15U, - 0x60U, 0x08U, 0x04U, 0x15U, 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0x9AU, 0x33U, 0x20U, - 0x00U, 0x20U, 0x54U, 0x01U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0xC2U, 0x32U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x01U, 0x18U, 0x1CU, 0x01U, 0x11U, 0x1CU, 0x40U, 0x08U, 0x10U, 0xDCU, 0x70U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x11U, 0x14U, 0x50U, 0x08U, - 0x10U, 0x9CU, 0x91U, 0x30U, 0x10U, 0x5CU, 0x71U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x11U, 0x18U, 0x60U, 0x10U, 0x11U, 0x1CU, 0x40U, 0x08U, 0x10U, 0x9CU, 0x71U, 0x50U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x0DU, 0x4CU, 0x42U, 0x00U, 0x08U, 0x22U, 0x16U, 0x00U, - 0x55U, 0xC2U, 0x32U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0x6AU, 0x33U, 0x20U, 0x08U, 0x46U, 0x20U, 0x00U, 0x05U, 0x80U, 0x32U, 0x31U, - 0x15U, 0x92U, 0x34U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0x9AU, 0x33U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x01U, 0x18U, 0x1CU, 0x01U, 0x11U, 0x1CU, 0x40U, 0x08U, 0x10U, 0xDCU, 0x70U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, 0x35U, 0x92U, 0x34U, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x9CU, 0x91U, 0x30U, - 0x10U, 0x5CU, 0x71U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x35U, 0x92U, 0x34U, 0x20U, 0x11U, 0x18U, 0x60U, 0x10U, 0x11U, 0x1CU, 0x40U, 0x08U, - 0x10U, 0x9CU, 0x71U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x35U, 0x92U, 0x34U, 0x20U, 0x0DU, 0x4CU, 0x42U, 0x00U, 0x08U, 0x46U, 0x44U, 0x00U, - 0xB5U, 0x9AU, 0x33U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0x72U, 0x34U, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, - 0x10U, 0x0CU, 0x28U, 0x02U, 0x08U, 0x88U, 0x30U, 0x00U, 0x0CU, 0xDCU, 0x21U, 0x00U, - 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, - 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, - 0xB5U, 0x9AU, 0x32U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x15U, 0x8AU, 0x37U, 0x20U, 0x08U, 0x4AU, 0x04U, 0x15U, 0x60U, 0x08U, 0x04U, 0x15U, - 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0x12U, 0x36U, 0x20U, 0x00U, 0x20U, 0x54U, 0x01U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x42U, 0x35U, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x01U, 0x18U, 0x1CU, 0x01U, - 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x10U, 0x14U, 0x50U, 0x08U, 0x10U, 0x14U, 0x58U, 0x08U, 0x10U, 0x5CU, 0x61U, 0x58U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x18U, 0x60U, 0x08U, 0x10U, 0x18U, 0x68U, 0x10U, - 0x10U, 0x9CU, 0x41U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x4CU, 0x4AU, 0x30U, - 0x08U, 0x22U, 0x16U, 0x00U, 0x55U, 0x42U, 0x35U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0xE2U, 0x35U, 0x20U, 0x08U, 0x46U, 0x20U, 0x00U, - 0x05U, 0x80U, 0x32U, 0x31U, 0x15U, 0x02U, 0x37U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x12U, 0x36U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x01U, 0x18U, 0x1CU, 0x01U, 0x10U, 0xDCU, 0x40U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, 0x35U, 0x02U, 0x37U, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x10U, 0x14U, 0x50U, 0x08U, 0x10U, 0x14U, 0x58U, 0x08U, - 0x10U, 0x5CU, 0x61U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x35U, 0x02U, 0x37U, 0x20U, 0x10U, 0x18U, 0x60U, 0x08U, 0x10U, 0x18U, 0x68U, 0x10U, - 0x10U, 0x9CU, 0x41U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x35U, 0x02U, 0x37U, 0x20U, 0x10U, 0x4CU, 0x4AU, 0x30U, 0x08U, 0x46U, 0x44U, 0x00U, - 0xB5U, 0x12U, 0x36U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0xE2U, 0x36U, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, - 0x10U, 0x0CU, 0x28U, 0x02U, 0x08U, 0x88U, 0x30U, 0x00U, 0x0CU, 0xDCU, 0x21U, 0x00U, - 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, - 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, - 0x00U, 0x46U, 0x00U, 0x00U, 0xB5U, 0x1AU, 0x35U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, - 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x8AU, 0x37U, 0x20U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, - 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0xB0U, 0x05U, 0x02U, 0x01U, 0x9CU, 0x05U, 0x03U, 0x00U, 0x0CU, 0xC4U, 0x02U, - 0x06U, 0x00U, 0x10U, 0x00U, 0x00U, 0xDEU, 0x01U, 0x00U, 0x35U, 0x32U, 0x38U, 0x20U, - 0x15U, 0x52U, 0x39U, 0x20U, 0x08U, 0x4AU, 0xC4U, 0x0FU, 0x60U, 0x08U, 0xC4U, 0x0FU, - 0x80U, 0x48U, 0x00U, 0x00U, 0x06U, 0x98U, 0x34U, 0x00U, 0x10U, 0x18U, 0x68U, 0x02U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x5AU, 0x38U, 0x20U, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x11U, 0x10U, 0x48U, 0x00U, 0x10U, 0xDCU, 0x40U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x0CU, 0x48U, 0x18U, 0x08U, 0x9AU, 0x15U, 0x00U, - 0x55U, 0x5AU, 0x38U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0xAAU, 0x38U, 0x20U, 0x0DU, 0x9AU, 0x34U, 0x00U, 0x25U, 0x80U, 0x32U, 0x31U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, - 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, - 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, 0x08U, 0x46U, 0x20U, 0x00U, - 0xB5U, 0x32U, 0x38U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x15U, 0x6AU, 0x3AU, 0x20U, 0x08U, 0x4AU, 0xC4U, 0x0FU, 0x60U, 0x08U, 0xC4U, 0x0FU, - 0x80U, 0x48U, 0x00U, 0x00U, 0x06U, 0x98U, 0x34U, 0x00U, 0x10U, 0x18U, 0x68U, 0x02U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x7AU, 0x39U, 0x20U, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x10U, 0x10U, 0x4CU, 0x10U, 0x10U, 0xDCU, 0x40U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x0CU, 0x48U, 0x18U, 0x08U, 0x9AU, 0x15U, 0x00U, - 0x55U, 0x7AU, 0x39U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0xCAU, 0x39U, 0x20U, 0x0DU, 0x9AU, 0x34U, 0x00U, 0x25U, 0x80U, 0x32U, 0x31U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, - 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, - 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, 0x08U, 0x46U, 0x20U, 0x00U, - 0xB5U, 0x52U, 0x39U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x6AU, 0x3AU, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, - 0x01U, 0x9CU, 0x05U, 0x03U, 0x00U, 0x0CU, 0xC4U, 0x02U, 0x06U, 0x00U, 0x10U, 0x00U, - 0x00U, 0xDEU, 0x01U, 0x00U, 0x35U, 0x12U, 0x3BU, 0x20U, 0x15U, 0x7AU, 0x3DU, 0x20U, - 0x08U, 0x4AU, 0xC4U, 0x0FU, 0x60U, 0x08U, 0xC4U, 0x0FU, 0x80U, 0x48U, 0x00U, 0x00U, - 0x95U, 0x0AU, 0x3CU, 0x20U, 0x00U, 0x24U, 0x54U, 0x01U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x3AU, 0x3BU, 0x20U, 0x01U, 0x10U, 0x14U, 0xFFU, - 0x01U, 0x14U, 0x14U, 0xFFU, 0x01U, 0x18U, 0x14U, 0xFFU, 0x11U, 0x1CU, 0x40U, 0x00U, - 0x10U, 0xDCU, 0x70U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x0DU, 0x10U, 0xF5U, 0x0FU, - 0x11U, 0x1CU, 0x58U, 0x00U, 0x10U, 0x1CU, 0x71U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x0DU, 0x54U, 0xF5U, 0x0FU, 0x11U, 0x1CU, 0x68U, 0x00U, 0x10U, 0x5CU, 0x71U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x0DU, 0x8CU, 0xF5U, 0x0FU, 0x08U, 0x66U, 0x16U, 0x00U, - 0x55U, 0x3AU, 0x3BU, 0x20U, 0x08U, 0x46U, 0x20U, 0x00U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0xE2U, 0x3BU, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, - 0x15U, 0xFAU, 0x3CU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0x2AU, 0x2EU, 0x20U, 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, - 0x01U, 0x18U, 0x14U, 0xFFU, 0x11U, 0x1CU, 0x40U, 0x00U, 0x10U, 0xDCU, 0x70U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, 0x35U, 0xFAU, 0x3CU, 0x20U, - 0x0DU, 0x10U, 0xF5U, 0x0FU, 0x11U, 0x1CU, 0x58U, 0x00U, 0x10U, 0x1CU, 0x71U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, 0x35U, 0xFAU, 0x3CU, 0x20U, - 0x0DU, 0x54U, 0xF5U, 0x0FU, 0x11U, 0x1CU, 0x68U, 0x00U, 0x10U, 0x5CU, 0x71U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, 0x35U, 0xFAU, 0x3CU, 0x20U, - 0x0DU, 0x8CU, 0xF5U, 0x0FU, 0x08U, 0x46U, 0x34U, 0x00U, 0xB5U, 0x0AU, 0x3CU, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0xDAU, 0x3CU, 0x20U, - 0x05U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x21U, 0x00U, - 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, - 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, - 0x00U, 0x46U, 0x00U, 0x00U, 0xB5U, 0x12U, 0x3BU, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x0AU, 0x40U, 0x20U, 0x08U, 0x4AU, 0xC4U, 0x0FU, - 0x60U, 0x08U, 0xC4U, 0x0FU, 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0x8AU, 0x3EU, 0x20U, - 0x00U, 0x24U, 0x54U, 0x01U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0xA2U, 0x3DU, 0x20U, 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, - 0x01U, 0x18U, 0x14U, 0xFFU, 0x10U, 0x1CU, 0x48U, 0x08U, 0x10U, 0xDCU, 0x70U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x0DU, 0x10U, 0xF5U, 0x0FU, 0x10U, 0x1CU, 0x68U, 0x18U, - 0x10U, 0x1CU, 0x70U, 0x18U, 0x10U, 0xDCU, 0x59U, 0x50U, 0x10U, 0xDCU, 0x41U, 0x50U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x14U, 0x50U, 0x10U, 0x10U, 0x1CU, 0x60U, 0x10U, - 0x10U, 0xDCU, 0x59U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x0CU, 0x68U, 0x10U, - 0x0DU, 0xCCU, 0xF4U, 0x0FU, 0x08U, 0x66U, 0x16U, 0x00U, 0x55U, 0xA2U, 0x3DU, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x72U, 0x30U, 0x20U, - 0x08U, 0x46U, 0x20U, 0x00U, 0x05U, 0x80U, 0x32U, 0x31U, 0x15U, 0x92U, 0x3FU, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x8AU, 0x3EU, 0x20U, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x01U, 0x18U, 0x14U, 0xFFU, - 0x10U, 0x1CU, 0x48U, 0x08U, 0x10U, 0xDCU, 0x70U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x34U, 0x00U, 0x35U, 0x92U, 0x3FU, 0x20U, 0x0DU, 0x10U, 0xF5U, 0x0FU, - 0x10U, 0x1CU, 0x68U, 0x18U, 0x10U, 0x1CU, 0x70U, 0x18U, 0x10U, 0xDCU, 0x59U, 0x50U, - 0x10U, 0xDCU, 0x41U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, - 0x35U, 0x92U, 0x3FU, 0x20U, 0x10U, 0x14U, 0x50U, 0x10U, 0x10U, 0x1CU, 0x60U, 0x10U, - 0x10U, 0xDCU, 0x59U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, - 0x35U, 0x92U, 0x3FU, 0x20U, 0x10U, 0x0CU, 0x68U, 0x10U, 0x0DU, 0xCCU, 0xF4U, 0x0FU, - 0x08U, 0x46U, 0x34U, 0x00U, 0xB5U, 0x8AU, 0x3EU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x72U, 0x3FU, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, - 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, - 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, 0x00U, 0x46U, 0x00U, 0x00U, - 0xB5U, 0x7AU, 0x3DU, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x0AU, 0x40U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, - 0x01U, 0x9CU, 0x05U, 0x03U, 0x00U, 0x0CU, 0xC4U, 0x02U, 0x00U, 0x24U, 0xF4U, 0x0FU, - 0x06U, 0x00U, 0x10U, 0x00U, 0x00U, 0xDEU, 0x01U, 0x00U, 0x35U, 0xBAU, 0x40U, 0x20U, - 0x15U, 0x42U, 0x43U, 0x20U, 0x08U, 0x4AU, 0x04U, 0x15U, 0x60U, 0x08U, 0x04U, 0x15U, - 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0xBAU, 0x41U, 0x20U, 0x00U, 0x20U, 0x54U, 0x01U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0xE2U, 0x40U, 0x20U, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x01U, 0x18U, 0x14U, 0xFFU, - 0x11U, 0x1CU, 0x40U, 0x08U, 0x10U, 0xDCU, 0x70U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x9CU, 0x91U, 0x30U, - 0x10U, 0x5CU, 0x71U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x11U, 0x18U, 0x60U, 0x10U, - 0x11U, 0x1CU, 0x40U, 0x08U, 0x10U, 0x9CU, 0x71U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x0DU, 0x4CU, 0x42U, 0x00U, 0x08U, 0x22U, 0x16U, 0x00U, 0x55U, 0xE2U, 0x40U, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x8AU, 0x41U, 0x20U, - 0x08U, 0x46U, 0x20U, 0x00U, 0x05U, 0x80U, 0x32U, 0x31U, 0x15U, 0xB2U, 0x42U, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0xBAU, 0x41U, 0x20U, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x01U, 0x18U, 0x14U, 0xFFU, - 0x11U, 0x1CU, 0x40U, 0x08U, 0x10U, 0xDCU, 0x70U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x44U, 0x00U, 0x35U, 0xB2U, 0x42U, 0x20U, 0x01U, 0x10U, 0x14U, 0xFFU, - 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x9CU, 0x91U, 0x30U, 0x10U, 0x5CU, 0x71U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, 0x35U, 0xB2U, 0x42U, 0x20U, - 0x11U, 0x18U, 0x60U, 0x10U, 0x11U, 0x1CU, 0x40U, 0x08U, 0x10U, 0x9CU, 0x71U, 0x50U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, 0x35U, 0xB2U, 0x42U, 0x20U, - 0x0DU, 0x4CU, 0x42U, 0x00U, 0x08U, 0x46U, 0x44U, 0x00U, 0xB5U, 0xBAU, 0x41U, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x92U, 0x42U, 0x20U, - 0x05U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, 0x10U, 0x0CU, 0x28U, 0x02U, - 0x08U, 0x88U, 0x30U, 0x00U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, - 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, - 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, 0x00U, 0x46U, 0x00U, 0x00U, - 0xB5U, 0xBAU, 0x40U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x15U, 0xB2U, 0x45U, 0x20U, 0x08U, 0x4AU, 0x04U, 0x15U, 0x60U, 0x08U, 0x04U, 0x15U, - 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0x3AU, 0x44U, 0x20U, 0x00U, 0x20U, 0x54U, 0x01U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x6AU, 0x43U, 0x20U, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x01U, 0x18U, 0x14U, 0xFFU, - 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x01U, 0x10U, 0x14U, 0xFFU, - 0x10U, 0x14U, 0x50U, 0x08U, 0x10U, 0x14U, 0x58U, 0x08U, 0x10U, 0x5CU, 0x61U, 0x58U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x18U, 0x60U, 0x08U, 0x10U, 0x18U, 0x68U, 0x10U, - 0x10U, 0x9CU, 0x41U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x4CU, 0x4AU, 0x30U, - 0x08U, 0x22U, 0x16U, 0x00U, 0x55U, 0x6AU, 0x43U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x0AU, 0x44U, 0x20U, 0x08U, 0x46U, 0x20U, 0x00U, - 0x05U, 0x80U, 0x32U, 0x31U, 0x15U, 0x2AU, 0x45U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x3AU, 0x44U, 0x20U, 0x01U, 0x10U, 0x14U, 0xFFU, - 0x01U, 0x14U, 0x14U, 0xFFU, 0x01U, 0x18U, 0x14U, 0xFFU, 0x10U, 0xDCU, 0x40U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, 0x35U, 0x2AU, 0x45U, 0x20U, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x10U, 0x14U, 0x50U, 0x08U, 0x10U, 0x14U, 0x58U, 0x08U, - 0x10U, 0x5CU, 0x61U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x35U, 0x2AU, 0x45U, 0x20U, 0x10U, 0x18U, 0x60U, 0x08U, 0x10U, 0x18U, 0x68U, 0x10U, - 0x10U, 0x9CU, 0x41U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x35U, 0x2AU, 0x45U, 0x20U, 0x10U, 0x4CU, 0x4AU, 0x30U, 0x08U, 0x46U, 0x44U, 0x00U, - 0xB5U, 0x3AU, 0x44U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0x0AU, 0x45U, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, - 0x10U, 0x0CU, 0x28U, 0x02U, 0x08U, 0x88U, 0x30U, 0x00U, 0x0CU, 0xDCU, 0x21U, 0x00U, - 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, - 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, - 0x00U, 0x46U, 0x00U, 0x00U, 0xB5U, 0x42U, 0x43U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, - 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xB2U, 0x45U, 0x20U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, - 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0x8CU, 0x05U, 0x02U, 0x01U, 0xB0U, 0x05U, 0x03U, 0x10U, 0x04U, 0x14U, 0x02U, - 0x0DU, 0x50U, 0x14U, 0x00U, 0x10U, 0x04U, 0x14U, 0x01U, 0x08U, 0x44U, 0x14U, 0x00U, - 0x00U, 0xCEU, 0x00U, 0x00U, 0x35U, 0xDAU, 0x46U, 0x20U, 0x08U, 0xCEU, 0x14U, 0x00U, - 0x35U, 0x62U, 0x47U, 0x20U, 0x08U, 0xCEU, 0x14U, 0x00U, 0x35U, 0xEAU, 0x47U, 0x20U, - 0x08U, 0xCEU, 0x14U, 0x00U, 0x35U, 0x72U, 0x48U, 0x20U, 0x08U, 0xCEU, 0x14U, 0x00U, - 0x35U, 0xFAU, 0x48U, 0x20U, 0x08U, 0xCEU, 0x14U, 0x00U, 0x35U, 0x82U, 0x49U, 0x20U, - 0x08U, 0xCEU, 0x14U, 0x00U, 0x35U, 0x0AU, 0x4AU, 0x20U, 0x08U, 0xCEU, 0x14U, 0x00U, - 0x35U, 0x92U, 0x4AU, 0x20U, 0x15U, 0x1AU, 0x4BU, 0x20U, 0x06U, 0x48U, 0x47U, 0x02U, - 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x00U, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x00U, 0x32U, 0x32U, 0x00U, 0x12U, 0x01U, 0x00U, 0x41U, 0x08U, 0x1CU, 0x01U, - 0x5CU, 0xB4U, 0x00U, 0x00U, 0x45U, 0x00U, 0x22U, 0x32U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x15U, 0x1AU, 0x4BU, 0x20U, 0x06U, 0x48U, 0x47U, 0x02U, 0x1AU, 0x80U, 0x10U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x04U, 0x22U, 0x32U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x04U, 0x32U, 0x32U, - 0x00U, 0x12U, 0x01U, 0x00U, 0x41U, 0x08U, 0x1CU, 0x01U, 0x5CU, 0xB4U, 0x00U, 0x00U, - 0x45U, 0x04U, 0x22U, 0x32U, 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x1AU, 0x4BU, 0x20U, - 0x06U, 0x48U, 0x47U, 0x02U, 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x08U, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x08U, 0x32U, 0x32U, 0x00U, 0x12U, 0x01U, 0x00U, - 0x41U, 0x08U, 0x1CU, 0x01U, 0x5CU, 0xB4U, 0x00U, 0x00U, 0x45U, 0x08U, 0x22U, 0x32U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x1AU, 0x4BU, 0x20U, 0x06U, 0x48U, 0x47U, 0x02U, - 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x0CU, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x0CU, 0x32U, 0x32U, 0x00U, 0x12U, 0x01U, 0x00U, 0x41U, 0x08U, 0x1CU, 0x01U, - 0x5CU, 0xB4U, 0x00U, 0x00U, 0x45U, 0x0CU, 0x22U, 0x32U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x15U, 0x1AU, 0x4BU, 0x20U, 0x06U, 0x48U, 0x47U, 0x02U, 0x1AU, 0x80U, 0x10U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x10U, 0x22U, 0x32U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x10U, 0x32U, 0x32U, - 0x00U, 0x12U, 0x01U, 0x00U, 0x41U, 0x08U, 0x1CU, 0x01U, 0x5CU, 0xB4U, 0x00U, 0x00U, - 0x45U, 0x10U, 0x22U, 0x32U, 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x1AU, 0x4BU, 0x20U, - 0x06U, 0x48U, 0x47U, 0x02U, 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x14U, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x14U, 0x32U, 0x32U, 0x00U, 0x12U, 0x01U, 0x00U, - 0x41U, 0x08U, 0x1CU, 0x01U, 0x5CU, 0xB4U, 0x00U, 0x00U, 0x45U, 0x14U, 0x22U, 0x32U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x1AU, 0x4BU, 0x20U, 0x06U, 0x48U, 0x47U, 0x02U, - 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x18U, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x18U, 0x32U, 0x32U, 0x00U, 0x12U, 0x01U, 0x00U, 0x41U, 0x08U, 0x1CU, 0x01U, - 0x5CU, 0xB4U, 0x00U, 0x00U, 0x45U, 0x18U, 0x22U, 0x32U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x15U, 0x1AU, 0x4BU, 0x20U, 0x06U, 0x48U, 0x47U, 0x02U, 0x1AU, 0x80U, 0x10U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x1CU, 0x22U, 0x32U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x1CU, 0x32U, 0x32U, - 0x00U, 0x12U, 0x01U, 0x00U, 0x41U, 0x08U, 0x1CU, 0x01U, 0x5CU, 0xB4U, 0x00U, 0x00U, - 0x45U, 0x1CU, 0x22U, 0x32U, 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x1AU, 0x4BU, 0x20U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x1AU, 0x4BU, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0x88U, 0x05U, 0x02U, - 0x01U, 0x8CU, 0x05U, 0x03U, 0x01U, 0xB0U, 0x05U, 0x04U, 0x01U, 0x9CU, 0x05U, 0x05U, - 0x02U, 0x00U, 0x17U, 0x00U, 0x02U, 0x00U, 0x27U, 0x01U, 0x08U, 0xCCU, 0x14U, 0x00U, - 0x00U, 0x18U, 0x04U, 0x00U, 0x00U, 0x08U, 0xC4U, 0x02U, 0x00U, 0xDEU, 0x01U, 0x00U, - 0x35U, 0xEAU, 0x4BU, 0x20U, 0x15U, 0xA2U, 0x4DU, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x10U, 0x5CU, 0x41U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x48U, - 0x08U, 0x46U, 0x24U, 0x00U, 0x55U, 0x62U, 0x4CU, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x62U, 0x4CU, 0x20U, 0x26U, 0x98U, 0x25U, 0x00U, - 0x20U, 0xC8U, 0x01U, 0x00U, 0x35U, 0xE2U, 0x4CU, 0x20U, 0x01U, 0x08U, 0x18U, 0x01U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x08U, 0x44U, 0x24U, 0x00U, 0x10U, 0xDCU, 0x51U, 0x58U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, - 0x75U, 0xE2U, 0x4CU, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0xEAU, 0x4BU, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0xEAU, 0x4BU, 0x20U, - 0x05U, 0x80U, 0x22U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x61U, 0x00U, - 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, - 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x08U, 0xC4U, 0x03U, - 0x00U, 0x18U, 0x04U, 0x00U, 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0xEAU, 0x4BU, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0xEAU, 0x4BU, 0x20U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x5AU, 0x4FU, 0x20U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, 0x10U, 0x1CU, 0x51U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x48U, 0x08U, 0x46U, 0x24U, 0x00U, 0x55U, 0x1AU, 0x4EU, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x1AU, 0x4EU, 0x20U, - 0x26U, 0x98U, 0x25U, 0x00U, 0x20U, 0xC8U, 0x01U, 0x00U, 0x35U, 0x9AU, 0x4EU, 0x20U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x08U, 0x18U, 0x01U, 0x08U, 0x44U, 0x24U, 0x00U, - 0x10U, 0xDCU, 0x51U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, 0x06U, 0x98U, 0x45U, 0x00U, - 0x08U, 0x92U, 0xC5U, 0x07U, 0x75U, 0x9AU, 0x4EU, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, - 0x55U, 0xA2U, 0x4DU, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0xA2U, 0x4DU, 0x20U, 0x05U, 0x80U, 0x22U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, - 0x0CU, 0xDCU, 0x61U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, - 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, - 0x00U, 0x08U, 0xC4U, 0x03U, 0x00U, 0x18U, 0x04U, 0x00U, 0x00U, 0x46U, 0x00U, 0x00U, - 0x55U, 0xA2U, 0x4DU, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0xA2U, 0x4DU, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x15U, 0x5AU, 0x4FU, 0x20U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, - 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x5AU, 0x4FU, 0x20U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, - 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0x88U, 0x05U, 0x02U, 0x01U, 0x8CU, 0x05U, 0x03U, 0x01U, 0xB0U, 0x05U, 0x04U, - 0x01U, 0x9CU, 0x05U, 0x05U, 0x02U, 0x00U, 0x17U, 0x00U, 0x02U, 0x00U, 0x27U, 0x01U, - 0x08U, 0xCCU, 0x14U, 0x00U, 0x00U, 0x18U, 0x04U, 0x00U, 0x00U, 0x08U, 0xC4U, 0x02U, - 0x00U, 0xDEU, 0x01U, 0x00U, 0x35U, 0x2AU, 0x50U, 0x20U, 0x15U, 0x72U, 0x53U, 0x20U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x1CU, 0x18U, 0x01U, - 0x10U, 0xD4U, 0x51U, 0x48U, 0x10U, 0x5CU, 0x41U, 0x50U, 0x10U, 0x9CU, 0x70U, 0x48U, - 0x08U, 0x44U, 0x34U, 0x00U, 0x05U, 0x80U, 0x72U, 0x31U, 0x06U, 0x98U, 0x45U, 0x00U, - 0x08U, 0x92U, 0xC5U, 0x07U, 0x75U, 0xBAU, 0x52U, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, - 0x55U, 0xCAU, 0x50U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0xCAU, 0x50U, 0x20U, 0x35U, 0xBAU, 0x52U, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x1CU, 0x18U, 0x01U, 0x10U, 0xD4U, 0x51U, 0x48U, - 0x10U, 0x5CU, 0x41U, 0x50U, 0x08U, 0x46U, 0x34U, 0x00U, 0x55U, 0x4AU, 0x51U, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x4AU, 0x51U, 0x20U, - 0x25U, 0x80U, 0x72U, 0x31U, 0x26U, 0x98U, 0x35U, 0x00U, 0x35U, 0xBAU, 0x52U, 0x20U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x24U, 0x18U, 0x01U, - 0x08U, 0x44U, 0x34U, 0x00U, 0x10U, 0xDCU, 0x91U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x10U, 0x5CU, 0x41U, 0x48U, 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, - 0x25U, 0x80U, 0x72U, 0x31U, 0x26U, 0x98U, 0x25U, 0x00U, 0x35U, 0xBAU, 0x52U, 0x20U, - 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0x02U, 0x52U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x02U, 0x52U, 0x20U, 0x25U, 0x80U, 0x72U, 0x31U, - 0x26U, 0x98U, 0x25U, 0x00U, 0x35U, 0xBAU, 0x52U, 0x20U, 0x01U, 0x08U, 0x18U, 0x01U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x10U, 0x18U, 0x01U, 0x08U, 0x44U, 0x34U, 0x00U, - 0x10U, 0xDCU, 0x41U, 0x50U, 0x10U, 0xDCU, 0x51U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, 0x25U, 0x80U, 0x22U, 0x31U, - 0x26U, 0x98U, 0x15U, 0x00U, 0x35U, 0xBAU, 0x52U, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, - 0x55U, 0x2AU, 0x50U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0x2AU, 0x50U, 0x20U, 0x25U, 0x80U, 0x22U, 0x31U, 0x26U, 0x98U, 0x15U, 0x00U, - 0x35U, 0xBAU, 0x52U, 0x20U, 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x61U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, - 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, - 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x08U, 0xC4U, 0x03U, 0x08U, 0x98U, 0x15U, 0x00U, - 0x00U, 0x18U, 0x04U, 0x00U, 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0x2AU, 0x50U, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x2AU, 0x50U, 0x20U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0xBAU, 0x56U, 0x20U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x1CU, 0x18U, 0x01U, - 0x10U, 0x14U, 0x51U, 0x48U, 0x10U, 0x5CU, 0x71U, 0x50U, 0x10U, 0x9CU, 0x70U, 0x48U, - 0x08U, 0x44U, 0x34U, 0x00U, 0x05U, 0x80U, 0x72U, 0x31U, 0x06U, 0x98U, 0x45U, 0x00U, - 0x08U, 0x92U, 0xC5U, 0x07U, 0x75U, 0x02U, 0x56U, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, - 0x55U, 0x12U, 0x54U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0x12U, 0x54U, 0x20U, 0x35U, 0x02U, 0x56U, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x1CU, 0x18U, 0x01U, 0x10U, 0x14U, 0x51U, 0x48U, - 0x10U, 0x5CU, 0x71U, 0x50U, 0x08U, 0x46U, 0x34U, 0x00U, 0x55U, 0x92U, 0x54U, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x92U, 0x54U, 0x20U, - 0x25U, 0x80U, 0x72U, 0x31U, 0x26U, 0x98U, 0x35U, 0x00U, 0x35U, 0x02U, 0x56U, 0x20U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x24U, 0x18U, 0x01U, - 0x08U, 0x44U, 0x34U, 0x00U, 0x10U, 0xDCU, 0x41U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x10U, 0x5CU, 0x91U, 0x48U, 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, - 0x25U, 0x80U, 0x72U, 0x31U, 0x26U, 0x98U, 0x25U, 0x00U, 0x35U, 0x02U, 0x56U, 0x20U, - 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0x4AU, 0x55U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x4AU, 0x55U, 0x20U, 0x25U, 0x80U, 0x72U, 0x31U, - 0x26U, 0x98U, 0x25U, 0x00U, 0x35U, 0x02U, 0x56U, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x08U, 0x18U, 0x01U, 0x08U, 0x44U, 0x34U, 0x00U, - 0x10U, 0xDCU, 0x41U, 0x50U, 0x10U, 0xDCU, 0x51U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, 0x25U, 0x80U, 0x22U, 0x31U, - 0x26U, 0x98U, 0x15U, 0x00U, 0x35U, 0x02U, 0x56U, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, - 0x55U, 0x72U, 0x53U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0x72U, 0x53U, 0x20U, 0x25U, 0x80U, 0x22U, 0x31U, 0x26U, 0x98U, 0x15U, 0x00U, - 0x35U, 0x02U, 0x56U, 0x20U, 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x61U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, - 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, - 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x08U, 0xC4U, 0x03U, 0x08U, 0x98U, 0x15U, 0x00U, - 0x00U, 0x18U, 0x04U, 0x00U, 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0x72U, 0x53U, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x72U, 0x53U, 0x20U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0xBAU, 0x56U, 0x20U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xBAU, 0x56U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0x88U, 0x05U, 0x02U, - 0x01U, 0x8CU, 0x05U, 0x03U, 0x01U, 0xB0U, 0x05U, 0x04U, 0x01U, 0x9CU, 0x05U, 0x05U, - 0x02U, 0x00U, 0x17U, 0x00U, 0x02U, 0x00U, 0x27U, 0x01U, 0x08U, 0xCCU, 0x14U, 0x00U, - 0x00U, 0x18U, 0x04U, 0x00U, 0x00U, 0x14U, 0xFEU, 0x8FU, 0x00U, 0xDEU, 0x01U, 0x00U, - 0x00U, 0x08U, 0xC4U, 0x02U, 0x35U, 0x92U, 0x57U, 0x20U, 0x15U, 0x9AU, 0x5AU, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x10U, 0x10U, 0x40U, 0x08U, 0x11U, 0x10U, 0x48U, 0x00U, - 0x10U, 0x9CU, 0x40U, 0x48U, 0x08U, 0x44U, 0x44U, 0x00U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, 0x75U, 0xE2U, 0x59U, 0x20U, - 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0x22U, 0x58U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x22U, 0x58U, 0x20U, 0x35U, 0xE2U, 0x59U, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x10U, 0x1CU, 0x40U, 0x08U, 0x11U, 0x1CU, 0x78U, 0x00U, - 0x08U, 0x46U, 0x44U, 0x00U, 0x55U, 0x92U, 0x58U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x92U, 0x58U, 0x20U, 0x25U, 0x80U, 0x72U, 0x31U, - 0x26U, 0x98U, 0x35U, 0x00U, 0x35U, 0xE2U, 0x59U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x10U, 0x10U, 0x40U, 0x08U, 0x11U, 0x10U, 0x48U, 0x00U, 0x10U, 0xDCU, 0x41U, 0x58U, - 0x08U, 0x46U, 0x44U, 0x00U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x1CU, 0x48U, 0x08U, - 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, 0x75U, 0xE2U, 0x59U, 0x20U, - 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0x3AU, 0x59U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x3AU, 0x59U, 0x20U, 0x25U, 0x80U, 0x72U, 0x31U, - 0x26U, 0x98U, 0x25U, 0x00U, 0x35U, 0xE2U, 0x59U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x10U, 0x10U, 0x40U, 0x08U, 0x11U, 0x10U, 0x48U, 0x00U, 0x10U, 0xDCU, 0x41U, 0x50U, - 0x08U, 0x46U, 0x44U, 0x00U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x08U, 0x48U, 0x10U, - 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, 0x75U, 0xE2U, 0x59U, 0x20U, - 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0x92U, 0x57U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x92U, 0x57U, 0x20U, 0x25U, 0x80U, 0x22U, 0x31U, - 0x26U, 0x98U, 0x25U, 0x00U, 0x35U, 0xE2U, 0x59U, 0x20U, 0x00U, 0x9CU, 0x9CU, 0x07U, - 0x0CU, 0xDCU, 0x61U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, - 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x08U, 0xC4U, 0x03U, - 0x08U, 0x98U, 0x15U, 0x00U, 0x00U, 0x18U, 0x04U, 0x00U, 0x00U, 0x46U, 0x00U, 0x00U, - 0x55U, 0x92U, 0x57U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0x92U, 0x57U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x15U, 0x7AU, 0x5DU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x10U, 0x9CU, 0x40U, 0x48U, - 0x08U, 0x44U, 0x44U, 0x00U, 0x05U, 0x80U, 0x72U, 0x31U, 0x06U, 0x98U, 0x45U, 0x00U, - 0x08U, 0x92U, 0xC5U, 0x07U, 0x75U, 0xC2U, 0x5CU, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, - 0x55U, 0x1AU, 0x5BU, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0x1AU, 0x5BU, 0x20U, 0x35U, 0xC2U, 0x5CU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x0DU, 0x1CU, 0x51U, 0x00U, 0x08U, 0x46U, 0x44U, 0x00U, 0x55U, 0x82U, 0x5BU, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x82U, 0x5BU, 0x20U, - 0x25U, 0x80U, 0x72U, 0x31U, 0x26U, 0x98U, 0x35U, 0x00U, 0x35U, 0xC2U, 0x5CU, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x0DU, 0x10U, 0x51U, 0x00U, 0x10U, 0xDCU, 0x41U, 0x58U, - 0x08U, 0x46U, 0x44U, 0x00U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x1CU, 0x48U, 0x08U, - 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, 0x75U, 0xC2U, 0x5CU, 0x20U, - 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0x22U, 0x5CU, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x22U, 0x5CU, 0x20U, 0x25U, 0x80U, 0x72U, 0x31U, - 0x26U, 0x98U, 0x25U, 0x00U, 0x35U, 0xC2U, 0x5CU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x0DU, 0x10U, 0x51U, 0x00U, 0x10U, 0xDCU, 0x41U, 0x50U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x08U, 0x48U, 0x10U, 0x06U, 0x98U, 0x45U, 0x00U, - 0x08U, 0x92U, 0xC5U, 0x07U, 0x75U, 0xC2U, 0x5CU, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, - 0x55U, 0x9AU, 0x5AU, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0x9AU, 0x5AU, 0x20U, 0x25U, 0x80U, 0x22U, 0x31U, 0x26U, 0x98U, 0x25U, 0x00U, - 0x35U, 0xC2U, 0x5CU, 0x20U, 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x61U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, - 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, - 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x08U, 0xC4U, 0x03U, 0x08U, 0x98U, 0x15U, 0x00U, - 0x00U, 0x18U, 0x04U, 0x00U, 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0x9AU, 0x5AU, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x9AU, 0x5AU, 0x20U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x7AU, 0x5DU, 0x20U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x7AU, 0x5DU, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, - 0x01U, 0x9CU, 0x05U, 0x03U, 0x00U, 0x0CU, 0xC4U, 0x02U, 0x00U, 0xDEU, 0x01U, 0x00U, - 0x35U, 0x1AU, 0x5EU, 0x20U, 0x15U, 0x5AU, 0x62U, 0x20U, 0x08U, 0x4AU, 0x84U, 0x0AU, - 0x60U, 0x08U, 0x84U, 0x0AU, 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0xFAU, 0x5FU, 0x20U, - 0x00U, 0x24U, 0x54U, 0x01U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0x42U, 0x5EU, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x0DU, 0x18U, 0xF5U, 0x01U, 0x10U, 0x18U, 0x60U, 0x1BU, 0x0DU, 0x1CU, 0x05U, 0x0EU, - 0x10U, 0x98U, 0x71U, 0x4DU, 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x55U, - 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x48U, 0x10U, 0xDCU, 0x60U, 0x40U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x0DU, 0x18U, 0xF5U, 0x01U, 0x10U, 0x18U, 0x60U, 0x13U, 0x0DU, 0x1CU, 0x05U, 0x0EU, - 0x10U, 0x98U, 0x71U, 0x45U, 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x4DU, - 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x40U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x9CU, 0x71U, 0x58U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x18U, 0x78U, 0x03U, - 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x45U, 0x0DU, 0x1CU, 0xF5U, 0x01U, - 0x10U, 0x9CU, 0x71U, 0x4BU, 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x50U, 0x0DU, 0x1CU, 0x05U, 0x0EU, - 0x10U, 0x98U, 0x71U, 0x55U, 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x9CU, 0x71U, 0x5DU, - 0x05U, 0x80U, 0x72U, 0x31U, 0x0DU, 0x0CU, 0xF5U, 0x01U, 0x10U, 0x0CU, 0x30U, 0x03U, - 0x08U, 0x66U, 0x16U, 0x00U, 0x55U, 0x42U, 0x5EU, 0x20U, 0x08U, 0x46U, 0x20U, 0x00U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0xD2U, 0x5FU, 0x20U, - 0x05U, 0x80U, 0x32U, 0x31U, 0x15U, 0xD2U, 0x61U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0xFAU, 0x5FU, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x0DU, 0x18U, 0xF5U, 0x01U, 0x10U, 0x18U, 0x60U, 0x1BU, - 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x98U, 0x71U, 0x4DU, 0x0DU, 0x5CU, 0x75U, 0x00U, - 0x10U, 0x98U, 0x71U, 0x55U, 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x48U, - 0x10U, 0xDCU, 0x60U, 0x40U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x24U, 0x00U, - 0x35U, 0xD2U, 0x61U, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x0DU, 0x18U, 0xF5U, 0x01U, 0x10U, 0x18U, 0x60U, 0x13U, 0x0DU, 0x1CU, 0x05U, 0x0EU, - 0x10U, 0x98U, 0x71U, 0x45U, 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x4DU, - 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x40U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x9CU, 0x71U, 0x58U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x24U, 0x00U, 0x35U, 0xD2U, 0x61U, 0x20U, - 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x18U, 0x78U, 0x03U, 0x0DU, 0x5CU, 0x75U, 0x00U, - 0x10U, 0x98U, 0x71U, 0x45U, 0x0DU, 0x1CU, 0xF5U, 0x01U, 0x10U, 0x9CU, 0x71U, 0x4BU, - 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, 0x0DU, 0x5CU, 0x85U, 0x0FU, - 0x10U, 0x98U, 0x71U, 0x50U, 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x98U, 0x71U, 0x55U, - 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x9CU, 0x71U, 0x5DU, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x24U, 0x00U, 0x35U, 0xD2U, 0x61U, 0x20U, 0x0DU, 0x0CU, 0xF5U, 0x01U, - 0x10U, 0x0CU, 0x30U, 0x03U, 0x08U, 0x46U, 0x24U, 0x00U, 0xB5U, 0xFAU, 0x5FU, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0xB2U, 0x61U, 0x20U, - 0x05U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, 0x10U, 0x88U, 0x28U, 0x81U, - 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, - 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, - 0x00U, 0x0CU, 0xC4U, 0x03U, 0x00U, 0x46U, 0x00U, 0x00U, 0xB5U, 0x1AU, 0x5EU, 0x20U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x92U, 0x66U, 0x20U, - 0x08U, 0x4AU, 0x84U, 0x0AU, 0x60U, 0x08U, 0x84U, 0x0AU, 0x80U, 0x48U, 0x00U, 0x00U, - 0x95U, 0x3AU, 0x64U, 0x20U, 0x00U, 0x24U, 0x54U, 0x01U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x82U, 0x62U, 0x20U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x0DU, 0x18U, 0xF5U, 0x01U, 0x10U, 0x18U, 0x60U, 0x1BU, - 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x98U, 0x71U, 0x4DU, 0x0DU, 0x5CU, 0x75U, 0x00U, - 0x10U, 0x98U, 0x71U, 0x55U, 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x48U, - 0x10U, 0xDCU, 0x60U, 0x40U, 0x05U, 0x80U, 0x72U, 0x31U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x0DU, 0x18U, 0xF5U, 0x01U, 0x10U, 0x18U, 0x60U, 0x13U, - 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x98U, 0x71U, 0x45U, 0x0DU, 0x5CU, 0x75U, 0x00U, - 0x10U, 0x98U, 0x71U, 0x4DU, 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x40U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x10U, 0x18U, 0x01U, 0x0DU, 0x5CU, 0x85U, 0x0FU, - 0x10U, 0x9CU, 0x71U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, 0x0DU, 0x1CU, 0x05U, 0x0EU, - 0x10U, 0x18U, 0x78U, 0x03U, 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x45U, - 0x0DU, 0x1CU, 0xF5U, 0x01U, 0x10U, 0x9CU, 0x71U, 0x4BU, 0x01U, 0x14U, 0x18U, 0x01U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x50U, - 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x98U, 0x71U, 0x55U, 0x0DU, 0x5CU, 0x75U, 0x00U, - 0x10U, 0x9CU, 0x71U, 0x5DU, 0x05U, 0x80U, 0x72U, 0x31U, 0x0DU, 0x0CU, 0xF5U, 0x01U, - 0x10U, 0x0CU, 0x30U, 0x03U, 0x08U, 0x66U, 0x16U, 0x00U, 0x55U, 0x82U, 0x62U, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x0AU, 0x64U, 0x20U, - 0x08U, 0x46U, 0x20U, 0x00U, 0x05U, 0x80U, 0x32U, 0x31U, 0x15U, 0x12U, 0x66U, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x3AU, 0x64U, 0x20U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x10U, 0x18U, 0x01U, 0x0DU, 0x18U, 0xF5U, 0x01U, - 0x10U, 0x18U, 0x60U, 0x1BU, 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x98U, 0x71U, 0x4DU, - 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x55U, 0x0DU, 0x5CU, 0x85U, 0x0FU, - 0x10U, 0x98U, 0x71U, 0x48U, 0x10U, 0xDCU, 0x60U, 0x40U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x24U, 0x00U, 0x35U, 0x12U, 0x66U, 0x20U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x0DU, 0x18U, 0xF5U, 0x01U, 0x10U, 0x18U, 0x60U, 0x13U, - 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x98U, 0x71U, 0x45U, 0x0DU, 0x5CU, 0x75U, 0x00U, - 0x10U, 0x98U, 0x71U, 0x4DU, 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x40U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x10U, 0x18U, 0x01U, 0x0DU, 0x5CU, 0x85U, 0x0FU, - 0x10U, 0x9CU, 0x71U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x24U, 0x00U, - 0x35U, 0x12U, 0x66U, 0x20U, 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x18U, 0x78U, 0x03U, - 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x45U, 0x0DU, 0x1CU, 0xF5U, 0x01U, - 0x10U, 0x9CU, 0x71U, 0x4BU, 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x50U, 0x0DU, 0x1CU, 0x05U, 0x0EU, - 0x10U, 0x98U, 0x71U, 0x55U, 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x9CU, 0x71U, 0x5DU, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x24U, 0x00U, 0x35U, 0x12U, 0x66U, 0x20U, - 0x0DU, 0x0CU, 0xF5U, 0x01U, 0x10U, 0x0CU, 0x30U, 0x03U, 0x08U, 0x46U, 0x24U, 0x00U, - 0xB5U, 0x3AU, 0x64U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0xF2U, 0x65U, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, - 0x10U, 0x88U, 0x28U, 0x81U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, - 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, - 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, 0x00U, 0x46U, 0x00U, 0x00U, - 0xB5U, 0x5AU, 0x62U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x92U, 0x66U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0x88U, 0x05U, 0x02U, - 0x01U, 0xA0U, 0x05U, 0x03U, 0x01U, 0x90U, 0x05U, 0x04U, 0x01U, 0xB0U, 0x05U, 0x05U, - 0x01U, 0xBCU, 0x05U, 0x06U, 0x02U, 0x00U, 0x17U, 0x00U, 0x02U, 0x00U, 0x27U, 0x01U, - 0x02U, 0x00U, 0xF7U, 0x02U, 0x02U, 0x00U, 0x47U, 0x03U, 0x0DU, 0x1EU, 0x15U, 0x00U, - 0x40U, 0x1CU, 0x14U, 0x00U, 0x20U, 0x1CU, 0x04U, 0x00U, 0x02U, 0x00U, 0x77U, 0x04U, - 0x02U, 0x00U, 0x77U, 0x05U, 0x08U, 0x1EU, 0x15U, 0x00U, 0x26U, 0x00U, 0x44U, 0x00U, - 0x00U, 0x24U, 0xFCU, 0x0FU, 0x00U, 0x10U, 0xF6U, 0x0FU, 0x0CU, 0x64U, 0x42U, 0x00U, - 0x00U, 0x10U, 0xF4U, 0x0FU, 0x0CU, 0x64U, 0x42U, 0x00U, 0x00U, 0x0CU, 0xC4U, 0x02U, - 0x01U, 0x08U, 0x07U, 0x00U, 0x08U, 0x88U, 0x14U, 0x00U, 0x02U, 0x00U, 0x27U, 0x00U, - 0x01U, 0x04U, 0x07U, 0x01U, 0x08U, 0x4AU, 0x44U, 0x05U, 0x60U, 0x08U, 0x44U, 0x05U, - 0x80U, 0x48U, 0x00U, 0x00U, 0x02U, 0x00U, 0x27U, 0x07U, 0x95U, 0x2AU, 0x6AU, 0x20U, - 0x0DU, 0x1EU, 0x16U, 0x00U, 0x55U, 0x12U, 0x68U, 0x20U, 0x15U, 0x32U, 0x68U, 0x20U, - 0x01U, 0x10U, 0x07U, 0x04U, 0x00U, 0x12U, 0x01U, 0x00U, 0x35U, 0xFAU, 0x68U, 0x20U, - 0x55U, 0x9AU, 0x69U, 0x20U, 0x01U, 0x10U, 0x07U, 0x03U, 0x08U, 0x1EU, 0x15U, 0x00U, - 0x35U, 0x7AU, 0x68U, 0x20U, 0x08U, 0x1EU, 0x25U, 0x00U, 0x35U, 0x9AU, 0x68U, 0x20U, - 0x08U, 0x1EU, 0x35U, 0x00U, 0x35U, 0xBAU, 0x68U, 0x20U, 0x08U, 0x1EU, 0x45U, 0x00U, - 0x35U, 0xDAU, 0x68U, 0x20U, 0x01U, 0x10U, 0x07U, 0x04U, 0x00U, 0x12U, 0x01U, 0x00U, - 0x55U, 0x9AU, 0x69U, 0x20U, 0x35U, 0x02U, 0x6EU, 0x20U, 0x01U, 0x10U, 0x07U, 0x04U, - 0x00U, 0x12U, 0x01U, 0x00U, 0x35U, 0xFAU, 0x68U, 0x20U, 0x55U, 0x02U, 0x6EU, 0x20U, - 0x01U, 0x10U, 0x07U, 0x04U, 0x00U, 0x12U, 0x01U, 0x00U, 0x35U, 0x9AU, 0x69U, 0x20U, - 0x55U, 0x02U, 0x6EU, 0x20U, 0x01U, 0x10U, 0x07U, 0x04U, 0x00U, 0x12U, 0x01U, 0x00U, - 0x55U, 0xFAU, 0x68U, 0x20U, 0x35U, 0x02U, 0x6EU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0xFAU, 0x68U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x02U, - 0x01U, 0x18U, 0x1CU, 0x02U, 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, - 0x0DU, 0x98U, 0x91U, 0x00U, 0x31U, 0x10U, 0x40U, 0x08U, 0x31U, 0x18U, 0x60U, 0x08U, - 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x1CU, 0x60U, 0x18U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x1CU, 0x68U, 0x08U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x00U, 0x0CU, 0x04U, 0x00U, 0x08U, 0x8AU, 0x44U, 0x00U, 0xB5U, 0xFAU, 0x68U, 0x20U, - 0x15U, 0xE2U, 0x6EU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0x9AU, 0x69U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x02U, 0x01U, 0x18U, 0x1CU, 0x02U, - 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, 0x0DU, 0x98U, 0x91U, 0x00U, - 0x31U, 0x10U, 0x40U, 0x08U, 0x31U, 0x18U, 0x60U, 0x08U, 0x05U, 0x80U, 0x32U, 0x31U, - 0x05U, 0x80U, 0x42U, 0x31U, 0x10U, 0x1CU, 0x60U, 0x10U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x10U, 0x0CU, 0x68U, 0x10U, 0x08U, 0x8AU, 0x44U, 0x00U, 0xB5U, 0x9AU, 0x69U, 0x20U, - 0x15U, 0xE2U, 0x6EU, 0x20U, 0x0DU, 0x1EU, 0x16U, 0x00U, 0x55U, 0x42U, 0x6AU, 0x20U, - 0x15U, 0x62U, 0x6AU, 0x20U, 0x01U, 0x10U, 0x07U, 0x04U, 0x00U, 0x12U, 0x01U, 0x00U, - 0x35U, 0x2AU, 0x6BU, 0x20U, 0x55U, 0x02U, 0x6CU, 0x20U, 0x01U, 0x10U, 0x07U, 0x03U, - 0x08U, 0x1EU, 0x15U, 0x00U, 0x35U, 0xAAU, 0x6AU, 0x20U, 0x08U, 0x1EU, 0x25U, 0x00U, - 0x35U, 0xCAU, 0x6AU, 0x20U, 0x08U, 0x1EU, 0x35U, 0x00U, 0x35U, 0xEAU, 0x6AU, 0x20U, - 0x08U, 0x1EU, 0x45U, 0x00U, 0x35U, 0x0AU, 0x6BU, 0x20U, 0x01U, 0x10U, 0x07U, 0x04U, - 0x00U, 0x12U, 0x01U, 0x00U, 0x55U, 0x02U, 0x6CU, 0x20U, 0x35U, 0xDAU, 0x6CU, 0x20U, - 0x01U, 0x10U, 0x07U, 0x04U, 0x00U, 0x12U, 0x01U, 0x00U, 0x35U, 0x2AU, 0x6BU, 0x20U, - 0x55U, 0xDAU, 0x6CU, 0x20U, 0x01U, 0x10U, 0x07U, 0x04U, 0x00U, 0x12U, 0x01U, 0x00U, - 0x35U, 0x02U, 0x6CU, 0x20U, 0x55U, 0xDAU, 0x6CU, 0x20U, 0x01U, 0x10U, 0x07U, 0x04U, - 0x00U, 0x12U, 0x01U, 0x00U, 0x55U, 0x2AU, 0x6BU, 0x20U, 0x35U, 0xDAU, 0x6CU, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x2AU, 0x6BU, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x02U, 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, - 0x31U, 0x10U, 0x40U, 0x08U, 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x8AU, 0x14U, 0x00U, 0x35U, 0x02U, 0x6FU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x02U, - 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, 0x31U, 0x10U, 0x40U, 0x08U, - 0x10U, 0x1CU, 0x40U, 0x18U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x8AU, 0x14U, 0x00U, - 0x35U, 0x02U, 0x6FU, 0x20U, 0x10U, 0x1CU, 0x48U, 0x08U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x8AU, 0x14U, 0x00U, 0x35U, 0x02U, 0x6FU, 0x20U, 0x00U, 0x0CU, 0x04U, 0x00U, - 0x08U, 0x8AU, 0x14U, 0x00U, 0xB5U, 0x2AU, 0x6BU, 0x20U, 0x15U, 0xE2U, 0x6EU, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x02U, 0x6CU, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x02U, 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, - 0x31U, 0x10U, 0x40U, 0x08U, 0x00U, 0xDCU, 0x00U, 0x00U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x8AU, 0x14U, 0x00U, 0x35U, 0x02U, 0x6FU, 0x20U, 0x00U, 0x1CU, 0x01U, 0x00U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x8AU, 0x14U, 0x00U, 0x35U, 0x02U, 0x6FU, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x02U, 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, - 0x31U, 0x10U, 0x40U, 0x08U, 0x10U, 0x1CU, 0x40U, 0x10U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x8AU, 0x14U, 0x00U, 0x35U, 0x02U, 0x6FU, 0x20U, 0x10U, 0x0CU, 0x48U, 0x10U, - 0x08U, 0x8AU, 0x14U, 0x00U, 0xB5U, 0x02U, 0x6CU, 0x20U, 0x15U, 0xE2U, 0x6EU, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0xDAU, 0x6CU, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, - 0x31U, 0x10U, 0x40U, 0x08U, 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x8AU, 0x14U, 0x00U, 0x35U, 0x02U, 0x6FU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, 0x31U, 0x10U, 0x40U, 0x08U, - 0x00U, 0x18U, 0x01U, 0x00U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x00U, 0xFEU, 0x03U, 0x00U, - 0x0DU, 0x10U, 0x91U, 0x00U, 0x31U, 0x10U, 0x40U, 0x08U, 0x10U, 0x9CU, 0x41U, 0x58U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x8AU, 0x14U, 0x00U, 0x35U, 0x02U, 0x6FU, 0x20U, - 0x10U, 0x18U, 0x48U, 0x08U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x00U, 0xFEU, 0x03U, 0x00U, - 0x0DU, 0x10U, 0x91U, 0x00U, 0x31U, 0x10U, 0x40U, 0x08U, 0x10U, 0x9CU, 0x41U, 0x50U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x8AU, 0x14U, 0x00U, 0x35U, 0x02U, 0x6FU, 0x20U, - 0x10U, 0x0CU, 0x48U, 0x10U, 0x08U, 0x8AU, 0x14U, 0x00U, 0xB5U, 0xDAU, 0x6CU, 0x20U, - 0x15U, 0xE2U, 0x6EU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0x02U, 0x6EU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x18U, 0x1CU, 0x01U, - 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, 0x0DU, 0x98U, 0x91U, 0x00U, - 0x31U, 0x10U, 0x40U, 0x08U, 0x31U, 0x18U, 0x60U, 0x08U, 0x10U, 0xDCU, 0x40U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x00U, 0x94U, 0x01U, 0x00U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x18U, 0x1CU, 0x01U, 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, - 0x0DU, 0x98U, 0x91U, 0x00U, 0x31U, 0x10U, 0x40U, 0x08U, 0x31U, 0x18U, 0x60U, 0x08U, - 0x10U, 0x5CU, 0x41U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x10U, 0x48U, 0x08U, - 0x10U, 0x1CU, 0x61U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x0CU, 0x68U, 0x10U, - 0x08U, 0x8AU, 0x44U, 0x00U, 0xB5U, 0x02U, 0x6EU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0xE2U, 0x6EU, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x01U, 0x08U, 0x07U, 0x07U, 0x10U, 0x0CU, 0x20U, 0x01U, - 0x06U, 0x8CU, 0x30U, 0x00U, 0x0CU, 0xDCU, 0x31U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, - 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, - 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, 0x08U, 0x46U, 0x20U, 0x00U, - 0xB5U, 0xD2U, 0x67U, 0x20U, 0x0DU, 0x1EU, 0x16U, 0x00U, 0x55U, 0x9AU, 0x6FU, 0x20U, - 0x35U, 0xC2U, 0x6FU, 0x20U, 0x01U, 0x1CU, 0x07U, 0x04U, 0x08U, 0xDEU, 0x15U, 0x00U, - 0x28U, 0x00U, 0x44U, 0x00U, 0x46U, 0x00U, 0x44U, 0x00U, 0x15U, 0x52U, 0x70U, 0x20U, - 0x01U, 0x10U, 0x07U, 0x03U, 0x08U, 0x1EU, 0x15U, 0x00U, 0x35U, 0x0AU, 0x70U, 0x20U, - 0x08U, 0x1EU, 0x25U, 0x00U, 0x35U, 0x52U, 0x70U, 0x20U, 0x08U, 0x1EU, 0x35U, 0x00U, - 0x35U, 0x32U, 0x70U, 0x20U, 0x08U, 0x1EU, 0x45U, 0x00U, 0x35U, 0x52U, 0x70U, 0x20U, - 0x01U, 0x1CU, 0x07U, 0x04U, 0x08U, 0xDEU, 0x15U, 0x00U, 0x28U, 0x00U, 0x44U, 0x00U, - 0x46U, 0x00U, 0x44U, 0x00U, 0x15U, 0x52U, 0x70U, 0x20U, 0x01U, 0x1CU, 0x07U, 0x04U, - 0x08U, 0xDEU, 0x15U, 0x00U, 0x26U, 0x00U, 0x44U, 0x00U, 0x48U, 0x00U, 0x44U, 0x00U, - 0x01U, 0x1CU, 0x07U, 0x04U, 0x08U, 0xDEU, 0x15U, 0x00U, 0x20U, 0x1CU, 0x04U, 0x00U, - 0x40U, 0x1CU, 0x14U, 0x00U, 0x02U, 0x00U, 0x77U, 0x04U, 0x01U, 0x08U, 0x07U, 0x00U, - 0x00U, 0x8AU, 0x00U, 0x00U, 0xB5U, 0xB2U, 0x67U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, - 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xA2U, 0x70U, 0x20U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, - 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0xB0U, 0x05U, 0x00U, 0x00U, 0x00U, 0x14U, 0x00U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x44U, 0x00U, 0x27U, 0x04U, 0x84U, 0x01U, 0x01U, - 0x00U, 0x80U, 0x1FU, 0x00U, 0x0CU, 0x00U, 0x10U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x18U, 0x00U, 0x01U, 0x00U, 0x00U, 0x0EU, 0x04U, 0x00U, 0x04U, 0x1CU, 0x01U, - 0x00U, 0x08U, 0x06U, 0x06U, 0x0CU, 0x1CU, 0x10U, 0x00U, 0x0CU, 0xDCU, 0x21U, 0x00U, - 0x00U, 0x00U, 0x2EU, 0x00U, 0x00U, 0x04U, 0x6CU, 0x04U, 0x00U, 0x08U, 0xA6U, 0x08U, - 0x00U, 0x0CU, 0xE4U, 0x0CU, 0x0CU, 0x14U, 0x10U, 0x00U, 0x0CU, 0x54U, 0x21U, 0x00U, - 0x0CU, 0x54U, 0x31U, 0x00U, 0x00U, 0x00U, 0x3EU, 0x01U, 0x00U, 0x04U, 0x7CU, 0x05U, - 0x00U, 0x08U, 0xB6U, 0x09U, 0x00U, 0x0CU, 0xF4U, 0x0DU, 0x0CU, 0x18U, 0x10U, 0x00U, - 0x0CU, 0x98U, 0x21U, 0x00U, 0x0CU, 0x98U, 0x31U, 0x00U, 0x02U, 0x04U, 0x5FU, 0x01U, - 0x02U, 0x04U, 0x6FU, 0x01U, 0x02U, 0x04U, 0x7FU, 0x01U, 0x02U, 0xC0U, 0x55U, 0x00U, - 0x02U, 0xC0U, 0x65U, 0x00U, 0x00U, 0x00U, 0xF4U, 0x03U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x18U, 0xB4U, 0x00U, 0x02U, 0x04U, 0x6FU, 0x01U, - 0x05U, 0x24U, 0x6FU, 0x02U, 0x00U, 0x04U, 0x04U, 0x02U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x42U, 0x72U, 0x20U, 0x00U, 0x00U, 0xF4U, 0x03U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x00U, 0xD4U, 0x03U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x92U, 0x72U, 0x20U, - 0x00U, 0x00U, 0xC4U, 0x03U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0xCAU, 0x72U, 0x20U, 0x00U, 0x00U, 0xE4U, 0x03U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x02U, 0x73U, 0x20U, 0x00U, 0x00U, 0xC4U, 0x03U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x3AU, 0x73U, 0x20U, - 0x00U, 0x00U, 0x24U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x72U, 0x73U, 0x20U, 0x00U, 0x00U, 0x04U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xAAU, 0x73U, 0x20U, 0x00U, 0x00U, 0x24U, 0x00U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xE2U, 0x73U, 0x20U, - 0x00U, 0x00U, 0x04U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x1AU, 0x74U, 0x20U, 0x00U, 0x00U, 0x24U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x52U, 0x74U, 0x20U, 0x00U, 0x00U, 0x04U, 0x00U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x8AU, 0x74U, 0x20U, - 0x00U, 0x00U, 0x14U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0xC2U, 0x74U, 0x20U, 0x00U, 0x00U, 0x04U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xFAU, 0x74U, 0x20U, 0x00U, 0x00U, 0x14U, 0x00U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x32U, 0x75U, 0x20U, - 0x00U, 0x00U, 0x04U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x6AU, 0x75U, 0x20U, 0x00U, 0x00U, 0x14U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xA2U, 0x75U, 0x20U, 0x00U, 0x00U, 0x04U, 0x00U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xDAU, 0x75U, 0x20U, - 0x00U, 0x00U, 0x14U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x12U, 0x76U, 0x20U, 0x00U, 0x00U, 0x04U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x4AU, 0x76U, 0x20U, 0x00U, 0x00U, 0x24U, 0x00U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x82U, 0x76U, 0x20U, - 0x00U, 0x00U, 0x04U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0xBAU, 0x76U, 0x20U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x15U, 0xDAU, 0x76U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0xB0U, 0x05U, 0x00U, - 0x00U, 0x00U, 0x04U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x44U, 0x00U, 0x27U, - 0x00U, 0x00U, 0xD4U, 0x03U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x02U, 0x04U, 0x4FU, 0x01U, 0x02U, 0xC0U, 0x45U, 0x00U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x8AU, 0x77U, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0xAAU, 0x77U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xCAU, 0x77U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xEAU, 0x77U, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x0AU, 0x78U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x2AU, 0x78U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x4AU, 0x78U, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x6AU, 0x78U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x8AU, 0x78U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xAAU, 0x78U, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0xCAU, 0x78U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xEAU, 0x78U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x0AU, 0x79U, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x2AU, 0x79U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x4AU, 0x79U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x6AU, 0x79U, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x8AU, 0x79U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xAAU, 0x79U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xCAU, 0x79U, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0xEAU, 0x79U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x0AU, 0x7AU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x2AU, 0x7AU, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x4AU, 0x7AU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x6AU, 0x7AU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x8AU, 0x7AU, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0xAAU, 0x7AU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xCAU, 0x7AU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xEAU, 0x7AU, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x0AU, 0x7BU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x2AU, 0x7BU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x4AU, 0x7BU, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x6AU, 0x7BU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x8AU, 0x7BU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xAAU, 0x7BU, 0x20U, - 0x00U, 0x00U, 0xF4U, 0x03U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x02U, 0x80U, 0x45U, 0x00U, 0x00U, 0x00U, 0x0EU, 0x04U, 0x00U, 0x04U, 0x1CU, 0x01U, - 0x00U, 0x08U, 0x06U, 0x06U, 0x0CU, 0x14U, 0x10U, 0x00U, 0x0CU, 0x54U, 0x21U, 0x00U, - 0x00U, 0x00U, 0x04U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x02U, 0x40U, 0x05U, 0x00U, - 0x00U, 0x00U, 0x04U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x24U, 0x0FU, 0x02U, - 0x02U, 0xC0U, 0x45U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x15U, 0x4AU, 0x7CU, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x00U, 0x1CU, 0xF4U, 0x0FU, 0x05U, 0x10U, 0x70U, 0x32U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, - 0x10U, 0x04U, 0x18U, 0x05U, 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0xC7U, 0x04U, - 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x04U, 0x1CU, 0x20U, 0x32U, 0x04U, 0x4CU, 0x20U, 0x32U, - 0x04U, 0x90U, 0x20U, 0x32U, 0x04U, 0xD4U, 0x20U, 0x32U, 0x02U, 0x04U, 0x7CU, 0x01U, - 0x02U, 0x04U, 0x3CU, 0x01U, 0x02U, 0x04U, 0x4CU, 0x01U, 0x02U, 0x04U, 0x5CU, 0x01U, - 0x04U, 0x1CU, 0x21U, 0x32U, 0x04U, 0x4CU, 0x21U, 0x32U, 0x04U, 0x90U, 0x21U, 0x32U, - 0x04U, 0xD4U, 0x21U, 0x32U, 0x02U, 0x04U, 0x7CU, 0x01U, 0x02U, 0x04U, 0x3CU, 0x01U, - 0x02U, 0x04U, 0x4CU, 0x01U, 0x02U, 0x04U, 0x5CU, 0x01U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xA2U, 0x7DU, 0x20U -}; -#elif (SMARTDMA_DISPLAY_FIRMWARE_SELECT == SMARTDMA_DISPLAY_FLEXIO_ONLY) -const uint8_t s_smartdmaDisplayFirmware[] = { - 0x28U, 0x00U, 0x10U, 0x24U, 0x08U, 0x01U, 0x10U, 0x24U, 0x90U, 0x02U, 0x10U, 0x24U, 0xCCU, 0x01U, 0x10U, 0x24U, - 0x30U, 0x03U, 0x10U, 0x24U, 0x80U, 0x08U, 0x10U, 0x24U, 0x94U, 0x0AU, 0x10U, 0x24U, 0x08U, 0x0DU, 0x10U, 0x24U, - 0x80U, 0x0FU, 0x10U, 0x24U, 0x34U, 0x12U, 0x10U, 0x24U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0xB0U, 0x05U, 0x02U, 0x10U, 0x04U, 0x14U, 0x05U, 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0xC7U, 0x08U, - 0x1AU, 0x80U, 0x10U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x05U, 0x00U, 0x22U, 0x32U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x05U, 0x04U, 0x22U, 0x32U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x05U, 0x08U, 0x22U, 0x32U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x05U, 0x0CU, 0x22U, 0x32U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x05U, 0x10U, 0x22U, 0x32U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x05U, 0x14U, 0x22U, 0x32U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x05U, 0x18U, 0x22U, 0x32U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x05U, 0x1CU, 0x22U, 0x32U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xD2U, 0x01U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0xB0U, 0x05U, 0x02U, 0x10U, 0x04U, 0x14U, 0x05U, 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0x07U, 0x07U, - 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x06U, 0x00U, 0xC4U, 0x01U, 0x01U, 0x08U, 0x1CU, 0xFFU, 0x01U, 0x0CU, 0x1CU, 0xFFU, 0x01U, 0x10U, 0x1CU, 0xFFU, - 0x01U, 0x14U, 0x1CU, 0xFFU, 0x11U, 0x08U, 0x20U, 0x00U, 0x05U, 0x00U, 0x22U, 0x32U, 0x11U, 0x0CU, 0x30U, 0x00U, - 0x05U, 0x04U, 0x32U, 0x32U, 0x11U, 0x10U, 0x40U, 0x00U, 0x05U, 0x08U, 0x42U, 0x32U, 0x11U, 0x14U, 0x50U, 0x00U, - 0x05U, 0x0CU, 0x52U, 0x32U, 0x01U, 0x08U, 0x1CU, 0xFFU, 0x01U, 0x0CU, 0x1CU, 0xFFU, 0x01U, 0x10U, 0x1CU, 0xFFU, - 0x01U, 0x14U, 0x1CU, 0x08U, 0x11U, 0x08U, 0x20U, 0x00U, 0x05U, 0x10U, 0x22U, 0x32U, 0x11U, 0x0CU, 0x30U, 0x00U, - 0x05U, 0x14U, 0x32U, 0x32U, 0x11U, 0x10U, 0x40U, 0x00U, 0x05U, 0x18U, 0x42U, 0x32U, 0x11U, 0x14U, 0x50U, 0x00U, - 0x05U, 0x1CU, 0x52U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, - 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x5AU, 0x03U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, - 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, 0x06U, 0x18U, 0x10U, 0x00U, 0x10U, 0x04U, 0x14U, 0x05U, - 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0xC7U, 0x06U, 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x01U, 0x88U, 0x15U, 0xFFU, 0x01U, 0x8CU, 0x15U, 0xFFU, - 0x01U, 0x90U, 0x15U, 0xFFU, 0x01U, 0x94U, 0x15U, 0xFFU, 0x11U, 0x08U, 0x20U, 0x00U, 0x05U, 0x00U, 0x22U, 0x32U, - 0x11U, 0x0CU, 0x30U, 0x00U, 0x05U, 0x04U, 0x32U, 0x32U, 0x11U, 0x10U, 0x40U, 0x00U, 0x05U, 0x08U, 0x42U, 0x32U, - 0x11U, 0x14U, 0x50U, 0x00U, 0x05U, 0x0CU, 0x52U, 0x32U, 0x01U, 0x88U, 0x15U, 0xFFU, 0x01U, 0x8CU, 0x15U, 0xFFU, - 0x01U, 0x90U, 0x15U, 0xFFU, 0x01U, 0x94U, 0x15U, 0xFFU, 0x11U, 0x08U, 0x20U, 0x00U, 0x05U, 0x10U, 0x22U, 0x32U, - 0x11U, 0x0CU, 0x30U, 0x00U, 0x05U, 0x14U, 0x32U, 0x32U, 0x11U, 0x10U, 0x40U, 0x00U, 0x05U, 0x18U, 0x42U, 0x32U, - 0x11U, 0x14U, 0x50U, 0x00U, 0x05U, 0x1CU, 0x52U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xE2U, 0x04U, 0x20U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, 0x10U, 0x04U, 0x14U, 0x05U, - 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0xC7U, 0x04U, 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x05U, 0x00U, 0x22U, 0x32U, 0x05U, 0x04U, 0x32U, 0x32U, - 0x05U, 0x08U, 0x42U, 0x32U, 0x05U, 0x0CU, 0x52U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x05U, 0x10U, 0x22U, 0x32U, 0x05U, 0x14U, 0x32U, 0x32U, - 0x05U, 0x18U, 0x42U, 0x32U, 0x05U, 0x1CU, 0x52U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x22U, 0x06U, 0x20U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x10U, 0x18U, 0x68U, 0x02U, 0x10U, 0x18U, 0x60U, 0x02U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0xB0U, 0x05U, 0x02U, 0x10U, 0x04U, 0x14U, 0x06U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, - 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, - 0x05U, 0x00U, 0x32U, 0x32U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, - 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, - 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, 0x05U, 0x04U, 0x32U, 0x32U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, - 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, - 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, 0x05U, 0x08U, 0x32U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, - 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, - 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x05U, 0x0CU, 0x32U, 0x32U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x05U, 0x10U, 0x32U, 0x32U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, - 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, - 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x05U, 0x14U, 0x32U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, - 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x05U, 0x18U, 0x32U, 0x32U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, - 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, - 0x05U, 0x1CU, 0x32U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, - 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, - 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, 0x05U, 0x00U, 0x32U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, - 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, - 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x05U, 0x04U, 0x32U, 0x32U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x05U, 0x08U, 0x32U, 0x32U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, - 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, - 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x05U, 0x0CU, 0x32U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, - 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x05U, 0x10U, 0x32U, 0x32U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, - 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, - 0x05U, 0x14U, 0x32U, 0x32U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, - 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, - 0x05U, 0x18U, 0x32U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, - 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, - 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, - 0x10U, 0xCCU, 0x70U, 0x4BU, 0x05U, 0x1CU, 0x32U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x05U, 0x00U, 0x32U, 0x32U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, - 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, - 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x05U, 0x04U, 0x32U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, - 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x05U, 0x08U, 0x32U, 0x32U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, - 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, - 0x05U, 0x0CU, 0x32U, 0x32U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, - 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, - 0x05U, 0x10U, 0x32U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, - 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, - 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, - 0x10U, 0xCCU, 0x70U, 0x4BU, 0x05U, 0x14U, 0x32U, 0x32U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, - 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, - 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, - 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, 0x05U, 0x18U, 0x32U, 0x32U, - 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, - 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, 0x05U, 0x1CU, 0x32U, 0x32U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xB2U, 0x06U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xC2U, 0x10U, 0x20U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, 0x10U, 0x04U, 0x14U, 0x07U, - 0x00U, 0x18U, 0xFEU, 0x8FU, 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0xC7U, 0x1BU, 0x1AU, 0x80U, 0x10U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x00U, 0x22U, 0x32U, 0x05U, 0x04U, 0x32U, 0x32U, 0x05U, 0x08U, 0x42U, 0x32U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x0CU, 0x22U, 0x32U, 0x05U, 0x10U, 0x32U, 0x32U, - 0x05U, 0x14U, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x18U, 0x22U, 0x32U, - 0x05U, 0x1CU, 0x32U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x00U, 0x42U, 0x32U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x04U, 0x22U, 0x32U, 0x05U, 0x08U, 0x32U, 0x32U, - 0x05U, 0x0CU, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x10U, 0x22U, 0x32U, - 0x05U, 0x14U, 0x32U, 0x32U, 0x05U, 0x18U, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, - 0x05U, 0x1CU, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x00U, 0x32U, 0x32U, - 0x05U, 0x04U, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x08U, 0x22U, 0x32U, - 0x05U, 0x0CU, 0x32U, 0x32U, 0x05U, 0x10U, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, - 0x05U, 0x14U, 0x22U, 0x32U, 0x05U, 0x18U, 0x32U, 0x32U, 0x05U, 0x1CU, 0x42U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x15U, 0xEAU, 0x14U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, - 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, - 0x10U, 0x04U, 0x14U, 0x07U, 0x00U, 0x18U, 0xFEU, 0x8FU, 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0xC7U, 0x21U, - 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x00U, 0x22U, 0x32U, 0x05U, 0x04U, 0x32U, 0x32U, 0x05U, 0x08U, 0x42U, 0x32U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x0CU, 0x22U, 0x32U, 0x05U, 0x10U, 0x32U, 0x32U, 0x05U, 0x14U, 0x42U, 0x32U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x18U, 0x22U, 0x32U, 0x05U, 0x1CU, 0x32U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x00U, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x04U, 0x22U, 0x32U, - 0x05U, 0x08U, 0x32U, 0x32U, 0x05U, 0x0CU, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x10U, 0x22U, 0x32U, - 0x05U, 0x14U, 0x32U, 0x32U, 0x05U, 0x18U, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x1CU, 0x22U, 0x32U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x00U, 0x32U, 0x32U, 0x05U, 0x04U, 0x42U, 0x32U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x08U, 0x22U, 0x32U, 0x05U, 0x0CU, 0x32U, 0x32U, 0x05U, 0x10U, 0x42U, 0x32U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x14U, 0x22U, 0x32U, 0x05U, 0x18U, 0x32U, 0x32U, 0x05U, 0x1CU, 0x42U, 0x32U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xD2U, 0x19U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0xB0U, 0x05U, 0x02U, 0x00U, 0x18U, 0xFEU, 0x8FU, 0x06U, 0x00U, 0x10U, 0x00U, 0x10U, 0x04U, 0x14U, 0x07U, - 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0xC7U, 0x21U, 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x00U, 0x22U, 0x32U, - 0x05U, 0x04U, 0x32U, 0x32U, 0x05U, 0x08U, 0x42U, 0x32U, 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x0CU, 0x22U, 0x32U, - 0x05U, 0x10U, 0x32U, 0x32U, 0x05U, 0x14U, 0x42U, 0x32U, 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x18U, 0x22U, 0x32U, - 0x05U, 0x1CU, 0x32U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x00U, 0x42U, 0x32U, - 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, - 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x04U, 0x22U, 0x32U, 0x05U, 0x08U, 0x32U, 0x32U, 0x05U, 0x0CU, 0x42U, 0x32U, - 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, - 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x10U, 0x22U, 0x32U, 0x05U, 0x14U, 0x32U, 0x32U, 0x05U, 0x18U, 0x42U, 0x32U, - 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, - 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x1CU, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x00U, 0x32U, 0x32U, 0x05U, 0x04U, 0x42U, 0x32U, 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x08U, 0x22U, 0x32U, - 0x05U, 0x0CU, 0x32U, 0x32U, 0x05U, 0x10U, 0x42U, 0x32U, 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x14U, 0x22U, 0x32U, - 0x05U, 0x18U, 0x32U, 0x32U, 0x05U, 0x1CU, 0x42U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xC2U, 0x1EU, 0x20U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0x8CU, 0x05U, 0x02U, 0x01U, 0xB0U, 0x05U, 0x03U, - 0x10U, 0x04U, 0x14U, 0x02U, 0x0DU, 0x50U, 0x14U, 0x00U, 0x10U, 0x04U, 0x14U, 0x01U, 0x08U, 0x44U, 0x14U, 0x00U, - 0x00U, 0xCEU, 0x00U, 0x00U, 0x35U, 0xEAU, 0x1FU, 0x20U, 0x08U, 0xCEU, 0x14U, 0x00U, 0x35U, 0x72U, 0x20U, 0x20U, - 0x08U, 0xCEU, 0x14U, 0x00U, 0x35U, 0xFAU, 0x20U, 0x20U, 0x08U, 0xCEU, 0x14U, 0x00U, 0x35U, 0x82U, 0x21U, 0x20U, - 0x08U, 0xCEU, 0x14U, 0x00U, 0x35U, 0x0AU, 0x22U, 0x20U, 0x08U, 0xCEU, 0x14U, 0x00U, 0x35U, 0x92U, 0x22U, 0x20U, - 0x08U, 0xCEU, 0x14U, 0x00U, 0x35U, 0x1AU, 0x23U, 0x20U, 0x08U, 0xCEU, 0x14U, 0x00U, 0x35U, 0xA2U, 0x23U, 0x20U, - 0x15U, 0x2AU, 0x24U, 0x20U, 0x06U, 0x48U, 0x47U, 0x02U, 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x00U, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x00U, 0x32U, 0x32U, - 0x00U, 0x12U, 0x01U, 0x00U, 0x41U, 0x08U, 0x1CU, 0x01U, 0x5CU, 0xB4U, 0x00U, 0x00U, 0x45U, 0x00U, 0x22U, 0x32U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x2AU, 0x24U, 0x20U, 0x06U, 0x48U, 0x47U, 0x02U, 0x1AU, 0x80U, 0x10U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x04U, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x04U, 0x32U, 0x32U, 0x00U, 0x12U, 0x01U, 0x00U, 0x41U, 0x08U, 0x1CU, 0x01U, 0x5CU, 0xB4U, 0x00U, 0x00U, - 0x45U, 0x04U, 0x22U, 0x32U, 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x2AU, 0x24U, 0x20U, 0x06U, 0x48U, 0x47U, 0x02U, - 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x08U, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x08U, 0x32U, 0x32U, 0x00U, 0x12U, 0x01U, 0x00U, 0x41U, 0x08U, 0x1CU, 0x01U, - 0x5CU, 0xB4U, 0x00U, 0x00U, 0x45U, 0x08U, 0x22U, 0x32U, 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x2AU, 0x24U, 0x20U, - 0x06U, 0x48U, 0x47U, 0x02U, 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x0CU, 0x22U, 0x32U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x0CU, 0x32U, 0x32U, 0x00U, 0x12U, 0x01U, 0x00U, - 0x41U, 0x08U, 0x1CU, 0x01U, 0x5CU, 0xB4U, 0x00U, 0x00U, 0x45U, 0x0CU, 0x22U, 0x32U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x15U, 0x2AU, 0x24U, 0x20U, 0x06U, 0x48U, 0x47U, 0x02U, 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x10U, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x10U, 0x32U, 0x32U, - 0x00U, 0x12U, 0x01U, 0x00U, 0x41U, 0x08U, 0x1CU, 0x01U, 0x5CU, 0xB4U, 0x00U, 0x00U, 0x45U, 0x10U, 0x22U, 0x32U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x2AU, 0x24U, 0x20U, 0x06U, 0x48U, 0x47U, 0x02U, 0x1AU, 0x80U, 0x10U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x14U, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x14U, 0x32U, 0x32U, 0x00U, 0x12U, 0x01U, 0x00U, 0x41U, 0x08U, 0x1CU, 0x01U, 0x5CU, 0xB4U, 0x00U, 0x00U, - 0x45U, 0x14U, 0x22U, 0x32U, 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x2AU, 0x24U, 0x20U, 0x06U, 0x48U, 0x47U, 0x02U, - 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x18U, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x18U, 0x32U, 0x32U, 0x00U, 0x12U, 0x01U, 0x00U, 0x41U, 0x08U, 0x1CU, 0x01U, - 0x5CU, 0xB4U, 0x00U, 0x00U, 0x45U, 0x18U, 0x22U, 0x32U, 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x2AU, 0x24U, 0x20U, - 0x06U, 0x48U, 0x47U, 0x02U, 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x1CU, 0x22U, 0x32U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x1CU, 0x32U, 0x32U, 0x00U, 0x12U, 0x01U, 0x00U, - 0x41U, 0x08U, 0x1CU, 0x01U, 0x5CU, 0xB4U, 0x00U, 0x00U, 0x45U, 0x1CU, 0x22U, 0x32U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x15U, 0x2AU, 0x24U, 0x20U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x15U, 0x2AU, 0x24U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, - 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x00U, 0x1CU, 0xF4U, 0x0FU, 0x05U, 0x10U, 0x70U, 0x32U, - 0x10U, 0x04U, 0x18U, 0x05U, 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0xC7U, 0x04U, 0x1AU, 0x80U, 0x10U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x04U, 0x1CU, 0x20U, 0x32U, - 0x04U, 0x4CU, 0x20U, 0x32U, 0x04U, 0x90U, 0x20U, 0x32U, 0x04U, 0xD4U, 0x20U, 0x32U, 0x02U, 0x04U, 0x7CU, 0x01U, - 0x02U, 0x04U, 0x3CU, 0x01U, 0x02U, 0x04U, 0x4CU, 0x01U, 0x02U, 0x04U, 0x5CU, 0x01U, 0x04U, 0x1CU, 0x21U, 0x32U, - 0x04U, 0x4CU, 0x21U, 0x32U, 0x04U, 0x90U, 0x21U, 0x32U, 0x04U, 0xD4U, 0x21U, 0x32U, 0x02U, 0x04U, 0x7CU, 0x01U, - 0x02U, 0x04U, 0x3CU, 0x01U, 0x02U, 0x04U, 0x4CU, 0x01U, 0x02U, 0x04U, 0x5CU, 0x01U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x82U, 0x25U, 0x20U}; -#elif (SMARTDMA_DISPLAY_FIRMWARE_SELECT == SMARTDMA_DISPLAY_MIPI_ONLY) -const uint8_t s_smartdmaDisplayFirmware[] = { - 0x34U, 0x00U, 0x10U, 0x24U, 0x44U, 0x0EU, 0x10U, 0x24U, 0xA0U, 0x01U, 0x10U, 0x24U, - 0x64U, 0x10U, 0x10U, 0x24U, 0x64U, 0x04U, 0x10U, 0x24U, 0x14U, 0x14U, 0x10U, 0x24U, - 0x30U, 0x07U, 0x10U, 0x24U, 0xA0U, 0x08U, 0x10U, 0x24U, 0x70U, 0x0BU, 0x10U, 0x24U, - 0x74U, 0x17U, 0x10U, 0x24U, 0x00U, 0x1CU, 0x10U, 0x24U, 0x08U, 0x21U, 0x10U, 0x24U, - 0x24U, 0x24U, 0x10U, 0x24U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, - 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, 0x01U, 0x9CU, 0x05U, 0x03U, - 0x00U, 0x0CU, 0xC4U, 0x02U, 0x00U, 0xDEU, 0x01U, 0x00U, 0x35U, 0xCAU, 0x00U, 0x20U, - 0x15U, 0xF2U, 0x01U, 0x20U, 0x08U, 0x4AU, 0xC4U, 0x0FU, 0x60U, 0x08U, 0xC4U, 0x0FU, - 0x80U, 0x48U, 0x00U, 0x00U, 0x06U, 0x98U, 0x34U, 0x00U, 0x10U, 0x18U, 0x68U, 0x02U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0xF2U, 0x00U, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x11U, 0x10U, 0x48U, 0x00U, 0x10U, 0x10U, 0x4CU, 0x10U, - 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x0CU, 0x48U, 0x18U, - 0x08U, 0x9AU, 0x15U, 0x00U, 0x55U, 0xF2U, 0x00U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x4AU, 0x01U, 0x20U, 0x0DU, 0x9AU, 0x34U, 0x00U, - 0x25U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x21U, 0x00U, - 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, - 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, - 0x08U, 0x46U, 0x20U, 0x00U, 0xB5U, 0xCAU, 0x00U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x02U, 0x03U, 0x20U, 0x08U, 0x4AU, 0xC4U, 0x0FU, - 0x60U, 0x08U, 0xC4U, 0x0FU, 0x80U, 0x48U, 0x00U, 0x00U, 0x06U, 0x98U, 0x34U, 0x00U, - 0x10U, 0x18U, 0x68U, 0x02U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0x1AU, 0x02U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x10U, 0xDCU, 0x40U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x0CU, 0x48U, 0x18U, 0x08U, 0x9AU, 0x15U, 0x00U, - 0x55U, 0x1AU, 0x02U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0x62U, 0x02U, 0x20U, 0x0DU, 0x9AU, 0x34U, 0x00U, 0x25U, 0x80U, 0x32U, 0x31U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, - 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, - 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, 0x08U, 0x46U, 0x20U, 0x00U, - 0xB5U, 0xF2U, 0x01U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x02U, 0x03U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, - 0x01U, 0x9CU, 0x05U, 0x03U, 0x00U, 0x0CU, 0xC4U, 0x02U, 0x00U, 0xDEU, 0x01U, 0x00U, - 0x35U, 0xA2U, 0x03U, 0x20U, 0x15U, 0x5AU, 0x06U, 0x20U, 0x08U, 0x4AU, 0xC4U, 0x0FU, - 0x60U, 0x08U, 0xC4U, 0x0FU, 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0xC2U, 0x04U, 0x20U, - 0x00U, 0x24U, 0x54U, 0x01U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0xCAU, 0x03U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x01U, 0x18U, 0x1CU, 0x01U, 0x11U, 0x1CU, 0x40U, 0x08U, 0x10U, 0xDCU, 0x70U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x10U, 0x48U, 0x18U, 0x0DU, 0x8CU, 0xF5U, 0x0FU, - 0x10U, 0x0CU, 0x31U, 0x48U, 0x11U, 0x10U, 0x50U, 0x10U, 0x10U, 0x1CU, 0x31U, 0x50U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x14U, 0x50U, 0x10U, - 0x11U, 0x1CU, 0x60U, 0x00U, 0x10U, 0x1CU, 0x70U, 0x10U, 0x10U, 0xDCU, 0x59U, 0x50U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xF6U, 0x0FU, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x08U, 0x66U, 0x16U, 0x00U, 0x55U, 0xCAU, 0x03U, 0x20U, 0x08U, 0x46U, 0x20U, 0x00U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x9AU, 0x04U, 0x20U, - 0x05U, 0x80U, 0x32U, 0x31U, 0x15U, 0xDAU, 0x05U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0xC2U, 0x04U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x01U, 0x18U, 0x1CU, 0x01U, 0x11U, 0x1CU, 0x40U, 0x08U, - 0x10U, 0xDCU, 0x70U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, - 0x35U, 0xDAU, 0x05U, 0x20U, 0x10U, 0x10U, 0x48U, 0x18U, 0x0DU, 0x8CU, 0xF5U, 0x0FU, - 0x10U, 0x0CU, 0x31U, 0x48U, 0x11U, 0x10U, 0x50U, 0x10U, 0x10U, 0x1CU, 0x31U, 0x50U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, 0x35U, 0xDAU, 0x05U, 0x20U, - 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x14U, 0x50U, 0x10U, 0x11U, 0x1CU, 0x60U, 0x00U, - 0x10U, 0x1CU, 0x70U, 0x10U, 0x10U, 0xDCU, 0x59U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x34U, 0x00U, 0x35U, 0xDAU, 0x05U, 0x20U, 0x00U, 0x0CU, 0xF6U, 0x0FU, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x08U, 0x46U, 0x34U, 0x00U, 0xB5U, 0xC2U, 0x04U, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0xBAU, 0x05U, 0x20U, - 0x05U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x21U, 0x00U, - 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, - 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, - 0x00U, 0x46U, 0x00U, 0x00U, 0xB5U, 0xA2U, 0x03U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x8AU, 0x08U, 0x20U, 0x08U, 0x4AU, 0xC4U, 0x0FU, - 0x60U, 0x08U, 0xC4U, 0x0FU, 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0x3AU, 0x07U, 0x20U, - 0x00U, 0x24U, 0x54U, 0x01U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0x82U, 0x06U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x01U, 0x18U, 0x1CU, 0x01U, 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x10U, 0x10U, 0x48U, 0x18U, 0x10U, 0x1CU, 0x51U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x10U, 0x14U, 0x58U, 0x18U, 0x10U, 0x5CU, 0x61U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x10U, 0x0CU, 0x68U, 0x18U, 0x08U, 0x66U, 0x16U, 0x00U, 0x55U, 0x82U, 0x06U, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x0AU, 0x07U, 0x20U, - 0x08U, 0x46U, 0x20U, 0x00U, 0x05U, 0x80U, 0x32U, 0x31U, 0x15U, 0x12U, 0x08U, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x3AU, 0x07U, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x01U, 0x18U, 0x1CU, 0x01U, - 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, - 0x35U, 0x12U, 0x08U, 0x20U, 0x10U, 0x10U, 0x48U, 0x18U, 0x10U, 0x1CU, 0x51U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, 0x35U, 0x12U, 0x08U, 0x20U, - 0x10U, 0x14U, 0x58U, 0x18U, 0x10U, 0x5CU, 0x61U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x34U, 0x00U, 0x35U, 0x12U, 0x08U, 0x20U, 0x10U, 0x0CU, 0x68U, 0x18U, - 0x08U, 0x46U, 0x34U, 0x00U, 0xB5U, 0x3AU, 0x07U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0xF2U, 0x07U, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, - 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, - 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, 0x00U, 0x46U, 0x00U, 0x00U, - 0xB5U, 0x5AU, 0x06U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x8AU, 0x08U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, - 0x01U, 0x9CU, 0x05U, 0x03U, 0x00U, 0x0CU, 0xC4U, 0x02U, 0x00U, 0x24U, 0xF4U, 0x0FU, - 0x00U, 0xDEU, 0x01U, 0x00U, 0x35U, 0x32U, 0x09U, 0x20U, 0x15U, 0xB2U, 0x0BU, 0x20U, - 0x08U, 0x4AU, 0x04U, 0x15U, 0x60U, 0x08U, 0x04U, 0x15U, 0x80U, 0x48U, 0x00U, 0x00U, - 0x95U, 0x32U, 0x0AU, 0x20U, 0x00U, 0x20U, 0x54U, 0x01U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x5AU, 0x09U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x01U, 0x18U, 0x1CU, 0x01U, 0x11U, 0x1CU, 0x40U, 0x08U, - 0x10U, 0xDCU, 0x70U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x9CU, 0x91U, 0x30U, 0x10U, 0x5CU, 0x71U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x11U, 0x18U, 0x60U, 0x10U, 0x11U, 0x1CU, 0x40U, 0x08U, - 0x10U, 0x9CU, 0x71U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, 0x0DU, 0x4CU, 0x42U, 0x00U, - 0x08U, 0x22U, 0x16U, 0x00U, 0x55U, 0x5AU, 0x09U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x02U, 0x0AU, 0x20U, 0x08U, 0x46U, 0x20U, 0x00U, - 0x05U, 0x80U, 0x32U, 0x31U, 0x15U, 0x2AU, 0x0BU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x32U, 0x0AU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x01U, 0x18U, 0x1CU, 0x01U, 0x11U, 0x1CU, 0x40U, 0x08U, - 0x10U, 0xDCU, 0x70U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x35U, 0x2AU, 0x0BU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x11U, 0x14U, 0x50U, 0x08U, - 0x10U, 0x9CU, 0x91U, 0x30U, 0x10U, 0x5CU, 0x71U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x44U, 0x00U, 0x35U, 0x2AU, 0x0BU, 0x20U, 0x11U, 0x18U, 0x60U, 0x10U, - 0x11U, 0x1CU, 0x40U, 0x08U, 0x10U, 0x9CU, 0x71U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x44U, 0x00U, 0x35U, 0x2AU, 0x0BU, 0x20U, 0x0DU, 0x4CU, 0x42U, 0x00U, - 0x08U, 0x46U, 0x44U, 0x00U, 0xB5U, 0x32U, 0x0AU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x0AU, 0x0BU, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x10U, 0x0CU, 0x28U, 0x02U, 0x08U, 0x88U, 0x30U, 0x00U, - 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, - 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, - 0x00U, 0x0CU, 0xC4U, 0x03U, 0xB5U, 0x32U, 0x09U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x22U, 0x0EU, 0x20U, 0x08U, 0x4AU, 0x04U, 0x15U, - 0x60U, 0x08U, 0x04U, 0x15U, 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0xAAU, 0x0CU, 0x20U, - 0x00U, 0x20U, 0x54U, 0x01U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0xDAU, 0x0BU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x01U, 0x18U, 0x1CU, 0x01U, 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x10U, 0x14U, 0x50U, 0x08U, 0x10U, 0x14U, 0x58U, 0x08U, - 0x10U, 0x5CU, 0x61U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x18U, 0x60U, 0x08U, - 0x10U, 0x18U, 0x68U, 0x10U, 0x10U, 0x9CU, 0x41U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x10U, 0x4CU, 0x4AU, 0x30U, 0x08U, 0x22U, 0x16U, 0x00U, 0x55U, 0xDAU, 0x0BU, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x7AU, 0x0CU, 0x20U, - 0x08U, 0x46U, 0x20U, 0x00U, 0x05U, 0x80U, 0x32U, 0x31U, 0x15U, 0x9AU, 0x0DU, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0xAAU, 0x0CU, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x01U, 0x18U, 0x1CU, 0x01U, - 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x35U, 0x9AU, 0x0DU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x10U, 0x14U, 0x50U, 0x08U, - 0x10U, 0x14U, 0x58U, 0x08U, 0x10U, 0x5CU, 0x61U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x44U, 0x00U, 0x35U, 0x9AU, 0x0DU, 0x20U, 0x10U, 0x18U, 0x60U, 0x08U, - 0x10U, 0x18U, 0x68U, 0x10U, 0x10U, 0x9CU, 0x41U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x44U, 0x00U, 0x35U, 0x9AU, 0x0DU, 0x20U, 0x10U, 0x4CU, 0x4AU, 0x30U, - 0x08U, 0x46U, 0x44U, 0x00U, 0xB5U, 0xAAU, 0x0CU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x7AU, 0x0DU, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x10U, 0x0CU, 0x28U, 0x02U, 0x08U, 0x88U, 0x30U, 0x00U, - 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, - 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, - 0x00U, 0x0CU, 0xC4U, 0x03U, 0x00U, 0x46U, 0x00U, 0x00U, 0xB5U, 0xB2U, 0x0BU, 0x20U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x15U, 0x22U, 0x0EU, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, - 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, 0x01U, 0x9CU, 0x05U, 0x03U, - 0x00U, 0x0CU, 0xC4U, 0x02U, 0x06U, 0x00U, 0x10U, 0x00U, 0x00U, 0xDEU, 0x01U, 0x00U, - 0x35U, 0xCAU, 0x0EU, 0x20U, 0x15U, 0xEAU, 0x0FU, 0x20U, 0x08U, 0x4AU, 0xC4U, 0x0FU, - 0x60U, 0x08U, 0xC4U, 0x0FU, 0x80U, 0x48U, 0x00U, 0x00U, 0x06U, 0x98U, 0x34U, 0x00U, - 0x10U, 0x18U, 0x68U, 0x02U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0xF2U, 0x0EU, 0x20U, 0x01U, 0x10U, 0x14U, 0xFFU, 0x11U, 0x10U, 0x48U, 0x00U, - 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x0CU, 0x48U, 0x18U, - 0x08U, 0x9AU, 0x15U, 0x00U, 0x55U, 0xF2U, 0x0EU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x42U, 0x0FU, 0x20U, 0x0DU, 0x9AU, 0x34U, 0x00U, - 0x25U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x21U, 0x00U, - 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, - 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, - 0x08U, 0x46U, 0x20U, 0x00U, 0xB5U, 0xCAU, 0x0EU, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x02U, 0x11U, 0x20U, 0x08U, 0x4AU, 0xC4U, 0x0FU, - 0x60U, 0x08U, 0xC4U, 0x0FU, 0x80U, 0x48U, 0x00U, 0x00U, 0x06U, 0x98U, 0x34U, 0x00U, - 0x10U, 0x18U, 0x68U, 0x02U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0x12U, 0x10U, 0x20U, 0x01U, 0x10U, 0x14U, 0xFFU, 0x10U, 0x10U, 0x4CU, 0x10U, - 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x0CU, 0x48U, 0x18U, - 0x08U, 0x9AU, 0x15U, 0x00U, 0x55U, 0x12U, 0x10U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x62U, 0x10U, 0x20U, 0x0DU, 0x9AU, 0x34U, 0x00U, - 0x25U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x21U, 0x00U, - 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, - 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, - 0x08U, 0x46U, 0x20U, 0x00U, 0xB5U, 0xEAU, 0x0FU, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, - 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x02U, 0x11U, 0x20U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, - 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0xB0U, 0x05U, 0x02U, 0x01U, 0x9CU, 0x05U, 0x03U, 0x00U, 0x0CU, 0xC4U, 0x02U, - 0x06U, 0x00U, 0x10U, 0x00U, 0x00U, 0xDEU, 0x01U, 0x00U, 0x35U, 0xAAU, 0x11U, 0x20U, - 0x15U, 0x12U, 0x14U, 0x20U, 0x08U, 0x4AU, 0xC4U, 0x0FU, 0x60U, 0x08U, 0xC4U, 0x0FU, - 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0xA2U, 0x12U, 0x20U, 0x00U, 0x24U, 0x54U, 0x01U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0xD2U, 0x11U, 0x20U, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x01U, 0x18U, 0x14U, 0xFFU, - 0x11U, 0x1CU, 0x40U, 0x00U, 0x10U, 0xDCU, 0x70U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x0DU, 0x10U, 0xF5U, 0x0FU, 0x11U, 0x1CU, 0x58U, 0x00U, 0x10U, 0x1CU, 0x71U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x0DU, 0x54U, 0xF5U, 0x0FU, 0x11U, 0x1CU, 0x68U, 0x00U, - 0x10U, 0x5CU, 0x71U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x0DU, 0x8CU, 0xF5U, 0x0FU, - 0x08U, 0x66U, 0x16U, 0x00U, 0x55U, 0xD2U, 0x11U, 0x20U, 0x08U, 0x46U, 0x20U, 0x00U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x7AU, 0x12U, 0x20U, - 0x05U, 0x80U, 0x32U, 0x31U, 0x15U, 0x92U, 0x13U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0xC2U, 0x04U, 0x20U, 0x01U, 0x10U, 0x14U, 0xFFU, - 0x01U, 0x14U, 0x14U, 0xFFU, 0x01U, 0x18U, 0x14U, 0xFFU, 0x11U, 0x1CU, 0x40U, 0x00U, - 0x10U, 0xDCU, 0x70U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, - 0x35U, 0x92U, 0x13U, 0x20U, 0x0DU, 0x10U, 0xF5U, 0x0FU, 0x11U, 0x1CU, 0x58U, 0x00U, - 0x10U, 0x1CU, 0x71U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, - 0x35U, 0x92U, 0x13U, 0x20U, 0x0DU, 0x54U, 0xF5U, 0x0FU, 0x11U, 0x1CU, 0x68U, 0x00U, - 0x10U, 0x5CU, 0x71U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, - 0x35U, 0x92U, 0x13U, 0x20U, 0x0DU, 0x8CU, 0xF5U, 0x0FU, 0x08U, 0x46U, 0x34U, 0x00U, - 0xB5U, 0xA2U, 0x12U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0x72U, 0x13U, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, - 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, - 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, - 0x00U, 0x0CU, 0xC4U, 0x03U, 0x00U, 0x46U, 0x00U, 0x00U, 0xB5U, 0xAAU, 0x11U, 0x20U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0xA2U, 0x16U, 0x20U, - 0x08U, 0x4AU, 0xC4U, 0x0FU, 0x60U, 0x08U, 0xC4U, 0x0FU, 0x80U, 0x48U, 0x00U, 0x00U, - 0x95U, 0x22U, 0x15U, 0x20U, 0x00U, 0x24U, 0x54U, 0x01U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x3AU, 0x14U, 0x20U, 0x01U, 0x10U, 0x14U, 0xFFU, - 0x01U, 0x14U, 0x14U, 0xFFU, 0x01U, 0x18U, 0x14U, 0xFFU, 0x10U, 0x1CU, 0x48U, 0x08U, - 0x10U, 0xDCU, 0x70U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x0DU, 0x10U, 0xF5U, 0x0FU, - 0x10U, 0x1CU, 0x68U, 0x18U, 0x10U, 0x1CU, 0x70U, 0x18U, 0x10U, 0xDCU, 0x59U, 0x50U, - 0x10U, 0xDCU, 0x41U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x14U, 0x50U, 0x10U, - 0x10U, 0x1CU, 0x60U, 0x10U, 0x10U, 0xDCU, 0x59U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x10U, 0x0CU, 0x68U, 0x10U, 0x0DU, 0xCCU, 0xF4U, 0x0FU, 0x08U, 0x66U, 0x16U, 0x00U, - 0x55U, 0x3AU, 0x14U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0x0AU, 0x07U, 0x20U, 0x08U, 0x46U, 0x20U, 0x00U, 0x05U, 0x80U, 0x32U, 0x31U, - 0x15U, 0x2AU, 0x16U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0x22U, 0x15U, 0x20U, 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, - 0x01U, 0x18U, 0x14U, 0xFFU, 0x10U, 0x1CU, 0x48U, 0x08U, 0x10U, 0xDCU, 0x70U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, 0x35U, 0x2AU, 0x16U, 0x20U, - 0x0DU, 0x10U, 0xF5U, 0x0FU, 0x10U, 0x1CU, 0x68U, 0x18U, 0x10U, 0x1CU, 0x70U, 0x18U, - 0x10U, 0xDCU, 0x59U, 0x50U, 0x10U, 0xDCU, 0x41U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x34U, 0x00U, 0x35U, 0x2AU, 0x16U, 0x20U, 0x10U, 0x14U, 0x50U, 0x10U, - 0x10U, 0x1CU, 0x60U, 0x10U, 0x10U, 0xDCU, 0x59U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x34U, 0x00U, 0x35U, 0x2AU, 0x16U, 0x20U, 0x10U, 0x0CU, 0x68U, 0x10U, - 0x0DU, 0xCCU, 0xF4U, 0x0FU, 0x08U, 0x46U, 0x34U, 0x00U, 0xB5U, 0x22U, 0x15U, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x0AU, 0x16U, 0x20U, - 0x05U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x21U, 0x00U, - 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, - 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, - 0x00U, 0x46U, 0x00U, 0x00U, 0xB5U, 0x12U, 0x14U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, - 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xA2U, 0x16U, 0x20U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, - 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0xB0U, 0x05U, 0x02U, 0x01U, 0x9CU, 0x05U, 0x03U, 0x00U, 0x0CU, 0xC4U, 0x02U, - 0x00U, 0x24U, 0xF4U, 0x0FU, 0x06U, 0x00U, 0x10U, 0x00U, 0x00U, 0xDEU, 0x01U, 0x00U, - 0x35U, 0x52U, 0x17U, 0x20U, 0x15U, 0xDAU, 0x19U, 0x20U, 0x08U, 0x4AU, 0x04U, 0x15U, - 0x60U, 0x08U, 0x04U, 0x15U, 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0x52U, 0x18U, 0x20U, - 0x00U, 0x20U, 0x54U, 0x01U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0x7AU, 0x17U, 0x20U, 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, - 0x01U, 0x18U, 0x14U, 0xFFU, 0x11U, 0x1CU, 0x40U, 0x08U, 0x10U, 0xDCU, 0x70U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x01U, 0x10U, 0x14U, 0xFFU, 0x11U, 0x14U, 0x50U, 0x08U, - 0x10U, 0x9CU, 0x91U, 0x30U, 0x10U, 0x5CU, 0x71U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x11U, 0x18U, 0x60U, 0x10U, 0x11U, 0x1CU, 0x40U, 0x08U, 0x10U, 0x9CU, 0x71U, 0x50U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x0DU, 0x4CU, 0x42U, 0x00U, 0x08U, 0x22U, 0x16U, 0x00U, - 0x55U, 0x7AU, 0x17U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0x22U, 0x18U, 0x20U, 0x08U, 0x46U, 0x20U, 0x00U, 0x05U, 0x80U, 0x32U, 0x31U, - 0x15U, 0x4AU, 0x19U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0x52U, 0x18U, 0x20U, 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, - 0x01U, 0x18U, 0x14U, 0xFFU, 0x11U, 0x1CU, 0x40U, 0x08U, 0x10U, 0xDCU, 0x70U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, 0x35U, 0x4AU, 0x19U, 0x20U, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x9CU, 0x91U, 0x30U, - 0x10U, 0x5CU, 0x71U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x35U, 0x4AU, 0x19U, 0x20U, 0x11U, 0x18U, 0x60U, 0x10U, 0x11U, 0x1CU, 0x40U, 0x08U, - 0x10U, 0x9CU, 0x71U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x35U, 0x4AU, 0x19U, 0x20U, 0x0DU, 0x4CU, 0x42U, 0x00U, 0x08U, 0x46U, 0x44U, 0x00U, - 0xB5U, 0x52U, 0x18U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0x2AU, 0x19U, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, - 0x10U, 0x0CU, 0x28U, 0x02U, 0x08U, 0x88U, 0x30U, 0x00U, 0x0CU, 0xDCU, 0x21U, 0x00U, - 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, - 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, - 0x00U, 0x46U, 0x00U, 0x00U, 0xB5U, 0x52U, 0x17U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x4AU, 0x1CU, 0x20U, 0x08U, 0x4AU, 0x04U, 0x15U, - 0x60U, 0x08U, 0x04U, 0x15U, 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0xD2U, 0x1AU, 0x20U, - 0x00U, 0x20U, 0x54U, 0x01U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0x02U, 0x1AU, 0x20U, 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, - 0x01U, 0x18U, 0x14U, 0xFFU, 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x10U, 0x14U, 0x50U, 0x08U, 0x10U, 0x14U, 0x58U, 0x08U, - 0x10U, 0x5CU, 0x61U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x18U, 0x60U, 0x08U, - 0x10U, 0x18U, 0x68U, 0x10U, 0x10U, 0x9CU, 0x41U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x10U, 0x4CU, 0x4AU, 0x30U, 0x08U, 0x22U, 0x16U, 0x00U, 0x55U, 0x02U, 0x1AU, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0xA2U, 0x1AU, 0x20U, - 0x08U, 0x46U, 0x20U, 0x00U, 0x05U, 0x80U, 0x32U, 0x31U, 0x15U, 0xC2U, 0x1BU, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0xD2U, 0x1AU, 0x20U, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x01U, 0x18U, 0x14U, 0xFFU, - 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x35U, 0xC2U, 0x1BU, 0x20U, 0x01U, 0x10U, 0x14U, 0xFFU, 0x10U, 0x14U, 0x50U, 0x08U, - 0x10U, 0x14U, 0x58U, 0x08U, 0x10U, 0x5CU, 0x61U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x44U, 0x00U, 0x35U, 0xC2U, 0x1BU, 0x20U, 0x10U, 0x18U, 0x60U, 0x08U, - 0x10U, 0x18U, 0x68U, 0x10U, 0x10U, 0x9CU, 0x41U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x44U, 0x00U, 0x35U, 0xC2U, 0x1BU, 0x20U, 0x10U, 0x4CU, 0x4AU, 0x30U, - 0x08U, 0x46U, 0x44U, 0x00U, 0xB5U, 0xD2U, 0x1AU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0xA2U, 0x1BU, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x10U, 0x0CU, 0x28U, 0x02U, 0x08U, 0x88U, 0x30U, 0x00U, - 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, - 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, - 0x00U, 0x0CU, 0xC4U, 0x03U, 0x00U, 0x46U, 0x00U, 0x00U, 0xB5U, 0xDAU, 0x19U, 0x20U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x15U, 0x4AU, 0x1CU, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, - 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0x88U, 0x05U, 0x02U, 0x01U, 0x8CU, 0x05U, 0x03U, - 0x01U, 0xB0U, 0x05U, 0x04U, 0x01U, 0x9CU, 0x05U, 0x05U, 0x02U, 0x00U, 0x17U, 0x00U, - 0x02U, 0x00U, 0x27U, 0x01U, 0x08U, 0xCCU, 0x14U, 0x00U, 0x00U, 0x18U, 0x04U, 0x00U, - 0x00U, 0x08U, 0xC4U, 0x02U, 0x00U, 0xDEU, 0x01U, 0x00U, 0x35U, 0x1AU, 0x1DU, 0x20U, - 0x15U, 0xD2U, 0x1EU, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x10U, 0x5CU, 0x41U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x48U, 0x08U, 0x46U, 0x24U, 0x00U, - 0x55U, 0x92U, 0x1DU, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0x92U, 0x1DU, 0x20U, 0x26U, 0x98U, 0x25U, 0x00U, 0x20U, 0xC8U, 0x01U, 0x00U, - 0x35U, 0x12U, 0x1EU, 0x20U, 0x01U, 0x08U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x08U, 0x44U, 0x24U, 0x00U, 0x10U, 0xDCU, 0x51U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, 0x75U, 0x12U, 0x1EU, 0x20U, - 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0x1AU, 0x1DU, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x1AU, 0x1DU, 0x20U, 0x05U, 0x80U, 0x22U, 0x31U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x61U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, - 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, - 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x08U, 0xC4U, 0x03U, 0x00U, 0x18U, 0x04U, 0x00U, - 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0x1AU, 0x1DU, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x1AU, 0x1DU, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x8AU, 0x20U, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x10U, 0x1CU, 0x51U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x48U, - 0x08U, 0x46U, 0x24U, 0x00U, 0x55U, 0x4AU, 0x1FU, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x4AU, 0x1FU, 0x20U, 0x26U, 0x98U, 0x25U, 0x00U, - 0x20U, 0xC8U, 0x01U, 0x00U, 0x35U, 0xCAU, 0x1FU, 0x20U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x01U, 0x08U, 0x18U, 0x01U, 0x08U, 0x44U, 0x24U, 0x00U, 0x10U, 0xDCU, 0x51U, 0x58U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, - 0x75U, 0xCAU, 0x1FU, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0xD2U, 0x1EU, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0xD2U, 0x1EU, 0x20U, - 0x05U, 0x80U, 0x22U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x61U, 0x00U, - 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, - 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x08U, 0xC4U, 0x03U, - 0x00U, 0x18U, 0x04U, 0x00U, 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0xD2U, 0x1EU, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0xD2U, 0x1EU, 0x20U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x8AU, 0x20U, 0x20U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x8AU, 0x20U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0x88U, 0x05U, 0x02U, - 0x01U, 0x8CU, 0x05U, 0x03U, 0x01U, 0xB0U, 0x05U, 0x04U, 0x01U, 0x9CU, 0x05U, 0x05U, - 0x02U, 0x00U, 0x17U, 0x00U, 0x02U, 0x00U, 0x27U, 0x01U, 0x08U, 0xCCU, 0x14U, 0x00U, - 0x00U, 0x18U, 0x04U, 0x00U, 0x00U, 0x08U, 0xC4U, 0x02U, 0x00U, 0xDEU, 0x01U, 0x00U, - 0x35U, 0x5AU, 0x21U, 0x20U, 0x15U, 0xA2U, 0x24U, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x1CU, 0x18U, 0x01U, 0x10U, 0xD4U, 0x51U, 0x48U, - 0x10U, 0x5CU, 0x41U, 0x50U, 0x10U, 0x9CU, 0x70U, 0x48U, 0x08U, 0x44U, 0x34U, 0x00U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, - 0x75U, 0xEAU, 0x23U, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0xFAU, 0x21U, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0xFAU, 0x21U, 0x20U, - 0x35U, 0xEAU, 0x23U, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x01U, 0x1CU, 0x18U, 0x01U, 0x10U, 0xD4U, 0x51U, 0x48U, 0x10U, 0x5CU, 0x41U, 0x50U, - 0x08U, 0x46U, 0x34U, 0x00U, 0x55U, 0x7AU, 0x22U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x7AU, 0x22U, 0x20U, 0x25U, 0x80U, 0x72U, 0x31U, - 0x26U, 0x98U, 0x35U, 0x00U, 0x35U, 0xEAU, 0x23U, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x24U, 0x18U, 0x01U, 0x08U, 0x44U, 0x34U, 0x00U, - 0x10U, 0xDCU, 0x91U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x5CU, 0x41U, 0x48U, - 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, 0x25U, 0x80U, 0x72U, 0x31U, - 0x26U, 0x98U, 0x25U, 0x00U, 0x35U, 0xEAU, 0x23U, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, - 0x55U, 0x32U, 0x23U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0x32U, 0x23U, 0x20U, 0x25U, 0x80U, 0x72U, 0x31U, 0x26U, 0x98U, 0x25U, 0x00U, - 0x35U, 0xEAU, 0x23U, 0x20U, 0x01U, 0x08U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x08U, 0x44U, 0x34U, 0x00U, 0x10U, 0xDCU, 0x41U, 0x50U, - 0x10U, 0xDCU, 0x51U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, 0x06U, 0x98U, 0x45U, 0x00U, - 0x08U, 0x92U, 0xC5U, 0x07U, 0x25U, 0x80U, 0x22U, 0x31U, 0x26U, 0x98U, 0x15U, 0x00U, - 0x35U, 0xEAU, 0x23U, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0x5AU, 0x21U, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x5AU, 0x21U, 0x20U, - 0x25U, 0x80U, 0x22U, 0x31U, 0x26U, 0x98U, 0x15U, 0x00U, 0x35U, 0xEAU, 0x23U, 0x20U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x61U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, - 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, - 0x00U, 0x08U, 0xC4U, 0x03U, 0x08U, 0x98U, 0x15U, 0x00U, 0x00U, 0x18U, 0x04U, 0x00U, - 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0x5AU, 0x21U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x5AU, 0x21U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0xEAU, 0x27U, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x1CU, 0x18U, 0x01U, 0x10U, 0x14U, 0x51U, 0x48U, - 0x10U, 0x5CU, 0x71U, 0x50U, 0x10U, 0x9CU, 0x70U, 0x48U, 0x08U, 0x44U, 0x34U, 0x00U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, - 0x75U, 0x32U, 0x27U, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0x42U, 0x25U, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x42U, 0x25U, 0x20U, - 0x35U, 0x32U, 0x27U, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x01U, 0x1CU, 0x18U, 0x01U, 0x10U, 0x14U, 0x51U, 0x48U, 0x10U, 0x5CU, 0x71U, 0x50U, - 0x08U, 0x46U, 0x34U, 0x00U, 0x55U, 0xC2U, 0x25U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0xC2U, 0x25U, 0x20U, 0x25U, 0x80U, 0x72U, 0x31U, - 0x26U, 0x98U, 0x35U, 0x00U, 0x35U, 0x32U, 0x27U, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x24U, 0x18U, 0x01U, 0x08U, 0x44U, 0x34U, 0x00U, - 0x10U, 0xDCU, 0x41U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x5CU, 0x91U, 0x48U, - 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, 0x25U, 0x80U, 0x72U, 0x31U, - 0x26U, 0x98U, 0x25U, 0x00U, 0x35U, 0x32U, 0x27U, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, - 0x55U, 0x7AU, 0x26U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0x7AU, 0x26U, 0x20U, 0x25U, 0x80U, 0x72U, 0x31U, 0x26U, 0x98U, 0x25U, 0x00U, - 0x35U, 0x32U, 0x27U, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x01U, 0x08U, 0x18U, 0x01U, 0x08U, 0x44U, 0x34U, 0x00U, 0x10U, 0xDCU, 0x41U, 0x50U, - 0x10U, 0xDCU, 0x51U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, 0x06U, 0x98U, 0x45U, 0x00U, - 0x08U, 0x92U, 0xC5U, 0x07U, 0x25U, 0x80U, 0x22U, 0x31U, 0x26U, 0x98U, 0x15U, 0x00U, - 0x35U, 0x32U, 0x27U, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0xA2U, 0x24U, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0xA2U, 0x24U, 0x20U, - 0x25U, 0x80U, 0x22U, 0x31U, 0x26U, 0x98U, 0x15U, 0x00U, 0x35U, 0x32U, 0x27U, 0x20U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x61U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, - 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, - 0x00U, 0x08U, 0xC4U, 0x03U, 0x08U, 0x98U, 0x15U, 0x00U, 0x00U, 0x18U, 0x04U, 0x00U, - 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0xA2U, 0x24U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0xA2U, 0x24U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0xEAU, 0x27U, 0x20U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x15U, 0xEAU, 0x27U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, - 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0x88U, 0x05U, 0x02U, 0x01U, 0x8CU, 0x05U, 0x03U, - 0x01U, 0xB0U, 0x05U, 0x04U, 0x01U, 0x9CU, 0x05U, 0x05U, 0x02U, 0x00U, 0x17U, 0x00U, - 0x02U, 0x00U, 0x27U, 0x01U, 0x08U, 0xCCU, 0x14U, 0x00U, 0x00U, 0x18U, 0x04U, 0x00U, - 0x00U, 0x14U, 0xFEU, 0x8FU, 0x00U, 0xDEU, 0x01U, 0x00U, 0x00U, 0x08U, 0xC4U, 0x02U, - 0x35U, 0xC2U, 0x28U, 0x20U, 0x15U, 0xCAU, 0x2BU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x10U, 0x10U, 0x40U, 0x08U, 0x11U, 0x10U, 0x48U, 0x00U, 0x10U, 0x9CU, 0x40U, 0x48U, - 0x08U, 0x44U, 0x44U, 0x00U, 0x05U, 0x80U, 0x72U, 0x31U, 0x06U, 0x98U, 0x45U, 0x00U, - 0x08U, 0x92U, 0xC5U, 0x07U, 0x75U, 0x12U, 0x2BU, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, - 0x55U, 0x52U, 0x29U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0x52U, 0x29U, 0x20U, 0x35U, 0x12U, 0x2BU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x10U, 0x1CU, 0x40U, 0x08U, 0x11U, 0x1CU, 0x78U, 0x00U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x55U, 0xC2U, 0x29U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0xC2U, 0x29U, 0x20U, 0x25U, 0x80U, 0x72U, 0x31U, 0x26U, 0x98U, 0x35U, 0x00U, - 0x35U, 0x12U, 0x2BU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x10U, 0x10U, 0x40U, 0x08U, - 0x11U, 0x10U, 0x48U, 0x00U, 0x10U, 0xDCU, 0x41U, 0x58U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x1CU, 0x48U, 0x08U, 0x06U, 0x98U, 0x45U, 0x00U, - 0x08U, 0x92U, 0xC5U, 0x07U, 0x75U, 0x12U, 0x2BU, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, - 0x55U, 0x6AU, 0x2AU, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0x6AU, 0x2AU, 0x20U, 0x25U, 0x80U, 0x72U, 0x31U, 0x26U, 0x98U, 0x25U, 0x00U, - 0x35U, 0x12U, 0x2BU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x10U, 0x10U, 0x40U, 0x08U, - 0x11U, 0x10U, 0x48U, 0x00U, 0x10U, 0xDCU, 0x41U, 0x50U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x08U, 0x48U, 0x10U, 0x06U, 0x98U, 0x45U, 0x00U, - 0x08U, 0x92U, 0xC5U, 0x07U, 0x75U, 0x12U, 0x2BU, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, - 0x55U, 0xC2U, 0x28U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0xC2U, 0x28U, 0x20U, 0x25U, 0x80U, 0x22U, 0x31U, 0x26U, 0x98U, 0x25U, 0x00U, - 0x35U, 0x12U, 0x2BU, 0x20U, 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x61U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, - 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, - 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x08U, 0xC4U, 0x03U, 0x08U, 0x98U, 0x15U, 0x00U, - 0x00U, 0x18U, 0x04U, 0x00U, 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0xC2U, 0x28U, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0xC2U, 0x28U, 0x20U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0xAAU, 0x2EU, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x10U, 0x9CU, 0x40U, 0x48U, 0x08U, 0x44U, 0x44U, 0x00U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, - 0x75U, 0xF2U, 0x2DU, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0x4AU, 0x2CU, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x4AU, 0x2CU, 0x20U, - 0x35U, 0xF2U, 0x2DU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x0DU, 0x1CU, 0x51U, 0x00U, - 0x08U, 0x46U, 0x44U, 0x00U, 0x55U, 0xB2U, 0x2CU, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0xB2U, 0x2CU, 0x20U, 0x25U, 0x80U, 0x72U, 0x31U, - 0x26U, 0x98U, 0x35U, 0x00U, 0x35U, 0xF2U, 0x2DU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x0DU, 0x10U, 0x51U, 0x00U, 0x10U, 0xDCU, 0x41U, 0x58U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x1CU, 0x48U, 0x08U, 0x06U, 0x98U, 0x45U, 0x00U, - 0x08U, 0x92U, 0xC5U, 0x07U, 0x75U, 0xF2U, 0x2DU, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, - 0x55U, 0x52U, 0x2DU, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0x52U, 0x2DU, 0x20U, 0x25U, 0x80U, 0x72U, 0x31U, 0x26U, 0x98U, 0x25U, 0x00U, - 0x35U, 0xF2U, 0x2DU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x0DU, 0x10U, 0x51U, 0x00U, - 0x10U, 0xDCU, 0x41U, 0x50U, 0x08U, 0x46U, 0x44U, 0x00U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x10U, 0x08U, 0x48U, 0x10U, 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, - 0x75U, 0xF2U, 0x2DU, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0xCAU, 0x2BU, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0xCAU, 0x2BU, 0x20U, - 0x25U, 0x80U, 0x22U, 0x31U, 0x26U, 0x98U, 0x25U, 0x00U, 0x35U, 0xF2U, 0x2DU, 0x20U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x61U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, - 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, - 0x00U, 0x08U, 0xC4U, 0x03U, 0x08U, 0x98U, 0x15U, 0x00U, 0x00U, 0x18U, 0x04U, 0x00U, - 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0xCAU, 0x2BU, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0xCAU, 0x2BU, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0xAAU, 0x2EU, 0x20U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x15U, 0xAAU, 0x2EU, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, - 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, 0x01U, 0x9CU, 0x05U, 0x03U, - 0x00U, 0x0CU, 0xC4U, 0x02U, 0x00U, 0xDEU, 0x01U, 0x00U, 0x35U, 0x4AU, 0x2FU, 0x20U, - 0x15U, 0x8AU, 0x33U, 0x20U, 0x08U, 0x4AU, 0x84U, 0x0AU, 0x60U, 0x08U, 0x84U, 0x0AU, - 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0x2AU, 0x31U, 0x20U, 0x00U, 0x24U, 0x54U, 0x01U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x72U, 0x2FU, 0x20U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, 0x0DU, 0x18U, 0xF5U, 0x01U, - 0x10U, 0x18U, 0x60U, 0x1BU, 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x98U, 0x71U, 0x4DU, - 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x55U, 0x0DU, 0x5CU, 0x85U, 0x0FU, - 0x10U, 0x98U, 0x71U, 0x48U, 0x10U, 0xDCU, 0x60U, 0x40U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, 0x0DU, 0x18U, 0xF5U, 0x01U, - 0x10U, 0x18U, 0x60U, 0x13U, 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x98U, 0x71U, 0x45U, - 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x4DU, 0x0DU, 0x5CU, 0x85U, 0x0FU, - 0x10U, 0x98U, 0x71U, 0x40U, 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x9CU, 0x71U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x18U, 0x78U, 0x03U, 0x0DU, 0x5CU, 0x75U, 0x00U, - 0x10U, 0x98U, 0x71U, 0x45U, 0x0DU, 0x1CU, 0xF5U, 0x01U, 0x10U, 0x9CU, 0x71U, 0x4BU, - 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, 0x0DU, 0x5CU, 0x85U, 0x0FU, - 0x10U, 0x98U, 0x71U, 0x50U, 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x98U, 0x71U, 0x55U, - 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x9CU, 0x71U, 0x5DU, 0x05U, 0x80U, 0x72U, 0x31U, - 0x0DU, 0x0CU, 0xF5U, 0x01U, 0x10U, 0x0CU, 0x30U, 0x03U, 0x08U, 0x66U, 0x16U, 0x00U, - 0x55U, 0x72U, 0x2FU, 0x20U, 0x08U, 0x46U, 0x20U, 0x00U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x02U, 0x31U, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, - 0x15U, 0x02U, 0x33U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0x2AU, 0x31U, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x0DU, 0x18U, 0xF5U, 0x01U, 0x10U, 0x18U, 0x60U, 0x1BU, 0x0DU, 0x1CU, 0x05U, 0x0EU, - 0x10U, 0x98U, 0x71U, 0x4DU, 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x55U, - 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x48U, 0x10U, 0xDCU, 0x60U, 0x40U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x24U, 0x00U, 0x35U, 0x02U, 0x33U, 0x20U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, 0x0DU, 0x18U, 0xF5U, 0x01U, - 0x10U, 0x18U, 0x60U, 0x13U, 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x98U, 0x71U, 0x45U, - 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x4DU, 0x0DU, 0x5CU, 0x85U, 0x0FU, - 0x10U, 0x98U, 0x71U, 0x40U, 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x9CU, 0x71U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x24U, 0x00U, 0x35U, 0x02U, 0x33U, 0x20U, 0x0DU, 0x1CU, 0x05U, 0x0EU, - 0x10U, 0x18U, 0x78U, 0x03U, 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x45U, - 0x0DU, 0x1CU, 0xF5U, 0x01U, 0x10U, 0x9CU, 0x71U, 0x4BU, 0x01U, 0x10U, 0x18U, 0x01U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x50U, - 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x98U, 0x71U, 0x55U, 0x0DU, 0x5CU, 0x75U, 0x00U, - 0x10U, 0x9CU, 0x71U, 0x5DU, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x24U, 0x00U, - 0x35U, 0x02U, 0x33U, 0x20U, 0x0DU, 0x0CU, 0xF5U, 0x01U, 0x10U, 0x0CU, 0x30U, 0x03U, - 0x08U, 0x46U, 0x24U, 0x00U, 0xB5U, 0x2AU, 0x31U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0xE2U, 0x32U, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x10U, 0x88U, 0x28U, 0x81U, 0x0CU, 0xDCU, 0x21U, 0x00U, - 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, - 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, - 0x00U, 0x46U, 0x00U, 0x00U, 0xB5U, 0x4AU, 0x2FU, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0xC2U, 0x37U, 0x20U, 0x08U, 0x4AU, 0x84U, 0x0AU, - 0x60U, 0x08U, 0x84U, 0x0AU, 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0x6AU, 0x35U, 0x20U, - 0x00U, 0x24U, 0x54U, 0x01U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0xB2U, 0x33U, 0x20U, 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x0DU, 0x18U, 0xF5U, 0x01U, 0x10U, 0x18U, 0x60U, 0x1BU, 0x0DU, 0x1CU, 0x05U, 0x0EU, - 0x10U, 0x98U, 0x71U, 0x4DU, 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x55U, - 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x48U, 0x10U, 0xDCU, 0x60U, 0x40U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x0DU, 0x18U, 0xF5U, 0x01U, 0x10U, 0x18U, 0x60U, 0x13U, 0x0DU, 0x1CU, 0x05U, 0x0EU, - 0x10U, 0x98U, 0x71U, 0x45U, 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x4DU, - 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x40U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x9CU, 0x71U, 0x58U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x18U, 0x78U, 0x03U, - 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x45U, 0x0DU, 0x1CU, 0xF5U, 0x01U, - 0x10U, 0x9CU, 0x71U, 0x4BU, 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x50U, 0x0DU, 0x1CU, 0x05U, 0x0EU, - 0x10U, 0x98U, 0x71U, 0x55U, 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x9CU, 0x71U, 0x5DU, - 0x05U, 0x80U, 0x72U, 0x31U, 0x0DU, 0x0CU, 0xF5U, 0x01U, 0x10U, 0x0CU, 0x30U, 0x03U, - 0x08U, 0x66U, 0x16U, 0x00U, 0x55U, 0xB2U, 0x33U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x3AU, 0x35U, 0x20U, 0x08U, 0x46U, 0x20U, 0x00U, - 0x05U, 0x80U, 0x32U, 0x31U, 0x15U, 0x42U, 0x37U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x6AU, 0x35U, 0x20U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x0DU, 0x18U, 0xF5U, 0x01U, 0x10U, 0x18U, 0x60U, 0x1BU, - 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x98U, 0x71U, 0x4DU, 0x0DU, 0x5CU, 0x75U, 0x00U, - 0x10U, 0x98U, 0x71U, 0x55U, 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x48U, - 0x10U, 0xDCU, 0x60U, 0x40U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x24U, 0x00U, - 0x35U, 0x42U, 0x37U, 0x20U, 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x0DU, 0x18U, 0xF5U, 0x01U, 0x10U, 0x18U, 0x60U, 0x13U, 0x0DU, 0x1CU, 0x05U, 0x0EU, - 0x10U, 0x98U, 0x71U, 0x45U, 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x4DU, - 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x40U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x9CU, 0x71U, 0x58U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x24U, 0x00U, 0x35U, 0x42U, 0x37U, 0x20U, - 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x18U, 0x78U, 0x03U, 0x0DU, 0x5CU, 0x75U, 0x00U, - 0x10U, 0x98U, 0x71U, 0x45U, 0x0DU, 0x1CU, 0xF5U, 0x01U, 0x10U, 0x9CU, 0x71U, 0x4BU, - 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x10U, 0x18U, 0x01U, 0x0DU, 0x5CU, 0x85U, 0x0FU, - 0x10U, 0x98U, 0x71U, 0x50U, 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x98U, 0x71U, 0x55U, - 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x9CU, 0x71U, 0x5DU, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x24U, 0x00U, 0x35U, 0x42U, 0x37U, 0x20U, 0x0DU, 0x0CU, 0xF5U, 0x01U, - 0x10U, 0x0CU, 0x30U, 0x03U, 0x08U, 0x46U, 0x24U, 0x00U, 0xB5U, 0x6AU, 0x35U, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x22U, 0x37U, 0x20U, - 0x05U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, 0x10U, 0x88U, 0x28U, 0x81U, - 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, - 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, - 0x00U, 0x0CU, 0xC4U, 0x03U, 0x00U, 0x46U, 0x00U, 0x00U, 0xB5U, 0x8AU, 0x33U, 0x20U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x15U, 0xC2U, 0x37U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, - 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0x88U, 0x05U, 0x02U, 0x01U, 0xA0U, 0x05U, 0x03U, - 0x01U, 0x90U, 0x05U, 0x04U, 0x01U, 0xB0U, 0x05U, 0x05U, 0x01U, 0xBCU, 0x05U, 0x06U, - 0x02U, 0x00U, 0x17U, 0x00U, 0x02U, 0x00U, 0x27U, 0x01U, 0x02U, 0x00U, 0xF7U, 0x02U, - 0x02U, 0x00U, 0x47U, 0x03U, 0x0DU, 0x1EU, 0x15U, 0x00U, 0x40U, 0x1CU, 0x14U, 0x00U, - 0x20U, 0x1CU, 0x04U, 0x00U, 0x02U, 0x00U, 0x77U, 0x04U, 0x02U, 0x00U, 0x77U, 0x05U, - 0x08U, 0x1EU, 0x15U, 0x00U, 0x26U, 0x00U, 0x44U, 0x00U, 0x00U, 0x24U, 0xFCU, 0x0FU, - 0x00U, 0x10U, 0xF6U, 0x0FU, 0x0CU, 0x64U, 0x42U, 0x00U, 0x00U, 0x10U, 0xF4U, 0x0FU, - 0x0CU, 0x64U, 0x42U, 0x00U, 0x00U, 0x0CU, 0xC4U, 0x02U, 0x01U, 0x08U, 0x07U, 0x00U, - 0x08U, 0x88U, 0x14U, 0x00U, 0x02U, 0x00U, 0x27U, 0x00U, 0x01U, 0x04U, 0x07U, 0x01U, - 0x08U, 0x4AU, 0x44U, 0x05U, 0x60U, 0x08U, 0x44U, 0x05U, 0x80U, 0x48U, 0x00U, 0x00U, - 0x02U, 0x00U, 0x27U, 0x07U, 0x95U, 0x5AU, 0x3BU, 0x20U, 0x0DU, 0x1EU, 0x16U, 0x00U, - 0x55U, 0x42U, 0x39U, 0x20U, 0x15U, 0x62U, 0x39U, 0x20U, 0x01U, 0x10U, 0x07U, 0x04U, - 0x00U, 0x12U, 0x01U, 0x00U, 0x35U, 0x2AU, 0x3AU, 0x20U, 0x55U, 0xCAU, 0x3AU, 0x20U, - 0x01U, 0x10U, 0x07U, 0x03U, 0x08U, 0x1EU, 0x15U, 0x00U, 0x35U, 0xAAU, 0x39U, 0x20U, - 0x08U, 0x1EU, 0x25U, 0x00U, 0x35U, 0xCAU, 0x39U, 0x20U, 0x08U, 0x1EU, 0x35U, 0x00U, - 0x35U, 0xEAU, 0x39U, 0x20U, 0x08U, 0x1EU, 0x45U, 0x00U, 0x35U, 0x0AU, 0x3AU, 0x20U, - 0x01U, 0x10U, 0x07U, 0x04U, 0x00U, 0x12U, 0x01U, 0x00U, 0x55U, 0xCAU, 0x3AU, 0x20U, - 0x35U, 0x32U, 0x3FU, 0x20U, 0x01U, 0x10U, 0x07U, 0x04U, 0x00U, 0x12U, 0x01U, 0x00U, - 0x35U, 0x2AU, 0x3AU, 0x20U, 0x55U, 0x32U, 0x3FU, 0x20U, 0x01U, 0x10U, 0x07U, 0x04U, - 0x00U, 0x12U, 0x01U, 0x00U, 0x35U, 0xCAU, 0x3AU, 0x20U, 0x55U, 0x32U, 0x3FU, 0x20U, - 0x01U, 0x10U, 0x07U, 0x04U, 0x00U, 0x12U, 0x01U, 0x00U, 0x55U, 0x2AU, 0x3AU, 0x20U, - 0x35U, 0x32U, 0x3FU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0x2AU, 0x3AU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x02U, 0x01U, 0x18U, 0x1CU, 0x02U, - 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, 0x0DU, 0x98U, 0x91U, 0x00U, - 0x31U, 0x10U, 0x40U, 0x08U, 0x31U, 0x18U, 0x60U, 0x08U, 0x10U, 0xDCU, 0x40U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x1CU, 0x60U, 0x18U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x10U, 0x1CU, 0x68U, 0x08U, 0x05U, 0x80U, 0x72U, 0x31U, 0x00U, 0x0CU, 0x04U, 0x00U, - 0x08U, 0x8AU, 0x44U, 0x00U, 0xB5U, 0x2AU, 0x3AU, 0x20U, 0x15U, 0x12U, 0x40U, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0xCAU, 0x3AU, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x02U, 0x01U, 0x18U, 0x1CU, 0x02U, 0x00U, 0xFEU, 0x03U, 0x00U, - 0x0DU, 0x10U, 0x91U, 0x00U, 0x0DU, 0x98U, 0x91U, 0x00U, 0x31U, 0x10U, 0x40U, 0x08U, - 0x31U, 0x18U, 0x60U, 0x08U, 0x05U, 0x80U, 0x32U, 0x31U, 0x05U, 0x80U, 0x42U, 0x31U, - 0x10U, 0x1CU, 0x60U, 0x10U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x0CU, 0x68U, 0x10U, - 0x08U, 0x8AU, 0x44U, 0x00U, 0xB5U, 0xCAU, 0x3AU, 0x20U, 0x15U, 0x12U, 0x40U, 0x20U, - 0x0DU, 0x1EU, 0x16U, 0x00U, 0x55U, 0x72U, 0x3BU, 0x20U, 0x15U, 0x92U, 0x3BU, 0x20U, - 0x01U, 0x10U, 0x07U, 0x04U, 0x00U, 0x12U, 0x01U, 0x00U, 0x35U, 0x5AU, 0x3CU, 0x20U, - 0x55U, 0x32U, 0x3DU, 0x20U, 0x01U, 0x10U, 0x07U, 0x03U, 0x08U, 0x1EU, 0x15U, 0x00U, - 0x35U, 0xDAU, 0x3BU, 0x20U, 0x08U, 0x1EU, 0x25U, 0x00U, 0x35U, 0xFAU, 0x3BU, 0x20U, - 0x08U, 0x1EU, 0x35U, 0x00U, 0x35U, 0x1AU, 0x3CU, 0x20U, 0x08U, 0x1EU, 0x45U, 0x00U, - 0x35U, 0x3AU, 0x3CU, 0x20U, 0x01U, 0x10U, 0x07U, 0x04U, 0x00U, 0x12U, 0x01U, 0x00U, - 0x55U, 0x32U, 0x3DU, 0x20U, 0x35U, 0x0AU, 0x3EU, 0x20U, 0x01U, 0x10U, 0x07U, 0x04U, - 0x00U, 0x12U, 0x01U, 0x00U, 0x35U, 0x5AU, 0x3CU, 0x20U, 0x55U, 0x0AU, 0x3EU, 0x20U, - 0x01U, 0x10U, 0x07U, 0x04U, 0x00U, 0x12U, 0x01U, 0x00U, 0x35U, 0x32U, 0x3DU, 0x20U, - 0x55U, 0x0AU, 0x3EU, 0x20U, 0x01U, 0x10U, 0x07U, 0x04U, 0x00U, 0x12U, 0x01U, 0x00U, - 0x55U, 0x5AU, 0x3CU, 0x20U, 0x35U, 0x0AU, 0x3EU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x5AU, 0x3CU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x02U, - 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, 0x31U, 0x10U, 0x40U, 0x08U, - 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x8AU, 0x14U, 0x00U, - 0x35U, 0x32U, 0x40U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x02U, 0x00U, 0xFEU, 0x03U, 0x00U, - 0x0DU, 0x10U, 0x91U, 0x00U, 0x31U, 0x10U, 0x40U, 0x08U, 0x10U, 0x1CU, 0x40U, 0x18U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x8AU, 0x14U, 0x00U, 0x35U, 0x32U, 0x40U, 0x20U, - 0x10U, 0x1CU, 0x48U, 0x08U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x8AU, 0x14U, 0x00U, - 0x35U, 0x32U, 0x40U, 0x20U, 0x00U, 0x0CU, 0x04U, 0x00U, 0x08U, 0x8AU, 0x14U, 0x00U, - 0xB5U, 0x5AU, 0x3CU, 0x20U, 0x15U, 0x12U, 0x40U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x32U, 0x3DU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x02U, - 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, 0x31U, 0x10U, 0x40U, 0x08U, - 0x00U, 0xDCU, 0x00U, 0x00U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x8AU, 0x14U, 0x00U, - 0x35U, 0x32U, 0x40U, 0x20U, 0x00U, 0x1CU, 0x01U, 0x00U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x8AU, 0x14U, 0x00U, 0x35U, 0x32U, 0x40U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x02U, - 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, 0x31U, 0x10U, 0x40U, 0x08U, - 0x10U, 0x1CU, 0x40U, 0x10U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x8AU, 0x14U, 0x00U, - 0x35U, 0x32U, 0x40U, 0x20U, 0x10U, 0x0CU, 0x48U, 0x10U, 0x08U, 0x8AU, 0x14U, 0x00U, - 0xB5U, 0x32U, 0x3DU, 0x20U, 0x15U, 0x12U, 0x40U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x0AU, 0x3EU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, 0x31U, 0x10U, 0x40U, 0x08U, - 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x8AU, 0x14U, 0x00U, - 0x35U, 0x32U, 0x40U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x00U, 0xFEU, 0x03U, 0x00U, - 0x0DU, 0x10U, 0x91U, 0x00U, 0x31U, 0x10U, 0x40U, 0x08U, 0x00U, 0x18U, 0x01U, 0x00U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, - 0x31U, 0x10U, 0x40U, 0x08U, 0x10U, 0x9CU, 0x41U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x8AU, 0x14U, 0x00U, 0x35U, 0x32U, 0x40U, 0x20U, 0x10U, 0x18U, 0x48U, 0x08U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, - 0x31U, 0x10U, 0x40U, 0x08U, 0x10U, 0x9CU, 0x41U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x8AU, 0x14U, 0x00U, 0x35U, 0x32U, 0x40U, 0x20U, 0x10U, 0x0CU, 0x48U, 0x10U, - 0x08U, 0x8AU, 0x14U, 0x00U, 0xB5U, 0x0AU, 0x3EU, 0x20U, 0x15U, 0x12U, 0x40U, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x32U, 0x3FU, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x18U, 0x1CU, 0x01U, 0x00U, 0xFEU, 0x03U, 0x00U, - 0x0DU, 0x10U, 0x91U, 0x00U, 0x0DU, 0x98U, 0x91U, 0x00U, 0x31U, 0x10U, 0x40U, 0x08U, - 0x31U, 0x18U, 0x60U, 0x08U, 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x00U, 0x94U, 0x01U, 0x00U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x18U, 0x1CU, 0x01U, - 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, 0x0DU, 0x98U, 0x91U, 0x00U, - 0x31U, 0x10U, 0x40U, 0x08U, 0x31U, 0x18U, 0x60U, 0x08U, 0x10U, 0x5CU, 0x41U, 0x58U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x10U, 0x48U, 0x08U, 0x10U, 0x1CU, 0x61U, 0x50U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x0CU, 0x68U, 0x10U, 0x08U, 0x8AU, 0x44U, 0x00U, - 0xB5U, 0x32U, 0x3FU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0x12U, 0x40U, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, - 0x01U, 0x08U, 0x07U, 0x07U, 0x10U, 0x0CU, 0x20U, 0x01U, 0x06U, 0x8CU, 0x30U, 0x00U, - 0x0CU, 0xDCU, 0x31U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, - 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, - 0x00U, 0x0CU, 0xC4U, 0x03U, 0x08U, 0x46U, 0x20U, 0x00U, 0xB5U, 0x02U, 0x39U, 0x20U, - 0x0DU, 0x1EU, 0x16U, 0x00U, 0x55U, 0xCAU, 0x40U, 0x20U, 0x35U, 0xF2U, 0x40U, 0x20U, - 0x01U, 0x1CU, 0x07U, 0x04U, 0x08U, 0xDEU, 0x15U, 0x00U, 0x28U, 0x00U, 0x44U, 0x00U, - 0x46U, 0x00U, 0x44U, 0x00U, 0x15U, 0x82U, 0x41U, 0x20U, 0x01U, 0x10U, 0x07U, 0x03U, - 0x08U, 0x1EU, 0x15U, 0x00U, 0x35U, 0x3AU, 0x41U, 0x20U, 0x08U, 0x1EU, 0x25U, 0x00U, - 0x35U, 0x82U, 0x41U, 0x20U, 0x08U, 0x1EU, 0x35U, 0x00U, 0x35U, 0x62U, 0x41U, 0x20U, - 0x08U, 0x1EU, 0x45U, 0x00U, 0x35U, 0x82U, 0x41U, 0x20U, 0x01U, 0x1CU, 0x07U, 0x04U, - 0x08U, 0xDEU, 0x15U, 0x00U, 0x28U, 0x00U, 0x44U, 0x00U, 0x46U, 0x00U, 0x44U, 0x00U, - 0x15U, 0x82U, 0x41U, 0x20U, 0x01U, 0x1CU, 0x07U, 0x04U, 0x08U, 0xDEU, 0x15U, 0x00U, - 0x26U, 0x00U, 0x44U, 0x00U, 0x48U, 0x00U, 0x44U, 0x00U, 0x01U, 0x1CU, 0x07U, 0x04U, - 0x08U, 0xDEU, 0x15U, 0x00U, 0x20U, 0x1CU, 0x04U, 0x00U, 0x40U, 0x1CU, 0x14U, 0x00U, - 0x02U, 0x00U, 0x77U, 0x04U, 0x01U, 0x08U, 0x07U, 0x00U, 0x00U, 0x8AU, 0x00U, 0x00U, - 0xB5U, 0xE2U, 0x38U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xD2U, 0x41U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x01U, 0xB0U, 0x05U, 0x00U, 0x00U, 0x00U, 0x14U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x44U, 0x00U, 0x27U, 0x04U, 0x84U, 0x01U, 0x01U, 0x00U, 0x80U, 0x1FU, 0x00U, - 0x0CU, 0x00U, 0x10U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x18U, 0x00U, 0x01U, - 0x00U, 0x00U, 0x0EU, 0x04U, 0x00U, 0x04U, 0x1CU, 0x01U, 0x00U, 0x08U, 0x06U, 0x06U, - 0x0CU, 0x1CU, 0x10U, 0x00U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x00U, 0x00U, 0x2EU, 0x00U, - 0x00U, 0x04U, 0x6CU, 0x04U, 0x00U, 0x08U, 0xA6U, 0x08U, 0x00U, 0x0CU, 0xE4U, 0x0CU, - 0x0CU, 0x14U, 0x10U, 0x00U, 0x0CU, 0x54U, 0x21U, 0x00U, 0x0CU, 0x54U, 0x31U, 0x00U, - 0x00U, 0x00U, 0x3EU, 0x01U, 0x00U, 0x04U, 0x7CU, 0x05U, 0x00U, 0x08U, 0xB6U, 0x09U, - 0x00U, 0x0CU, 0xF4U, 0x0DU, 0x0CU, 0x18U, 0x10U, 0x00U, 0x0CU, 0x98U, 0x21U, 0x00U, - 0x0CU, 0x98U, 0x31U, 0x00U, 0x02U, 0x04U, 0x5FU, 0x01U, 0x02U, 0x04U, 0x6FU, 0x01U, - 0x02U, 0x04U, 0x7FU, 0x01U, 0x02U, 0xC0U, 0x55U, 0x00U, 0x02U, 0xC0U, 0x65U, 0x00U, - 0x00U, 0x00U, 0xF4U, 0x03U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x00U, 0x18U, 0xB4U, 0x00U, 0x02U, 0x04U, 0x6FU, 0x01U, 0x05U, 0x24U, 0x6FU, 0x02U, - 0x00U, 0x04U, 0x04U, 0x02U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x72U, 0x43U, 0x20U, 0x00U, 0x00U, 0xF4U, 0x03U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x00U, 0xD4U, 0x03U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xC2U, 0x43U, 0x20U, 0x00U, 0x00U, 0xC4U, 0x03U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xFAU, 0x43U, 0x20U, - 0x00U, 0x00U, 0xE4U, 0x03U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x32U, 0x44U, 0x20U, 0x00U, 0x00U, 0xC4U, 0x03U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x6AU, 0x44U, 0x20U, 0x00U, 0x00U, 0x24U, 0x00U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xA2U, 0x44U, 0x20U, - 0x00U, 0x00U, 0x04U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0xDAU, 0x44U, 0x20U, 0x00U, 0x00U, 0x24U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x12U, 0x45U, 0x20U, 0x00U, 0x00U, 0x04U, 0x00U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x4AU, 0x45U, 0x20U, - 0x00U, 0x00U, 0x24U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x82U, 0x45U, 0x20U, 0x00U, 0x00U, 0x04U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xBAU, 0x45U, 0x20U, 0x00U, 0x00U, 0x14U, 0x00U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xF2U, 0x45U, 0x20U, - 0x00U, 0x00U, 0x04U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x2AU, 0x46U, 0x20U, 0x00U, 0x00U, 0x14U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x62U, 0x46U, 0x20U, 0x00U, 0x00U, 0x04U, 0x00U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x9AU, 0x46U, 0x20U, - 0x00U, 0x00U, 0x14U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0xD2U, 0x46U, 0x20U, 0x00U, 0x00U, 0x04U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x0AU, 0x47U, 0x20U, 0x00U, 0x00U, 0x14U, 0x00U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x42U, 0x47U, 0x20U, - 0x00U, 0x00U, 0x04U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x7AU, 0x47U, 0x20U, 0x00U, 0x00U, 0x24U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xB2U, 0x47U, 0x20U, 0x00U, 0x00U, 0x04U, 0x00U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xEAU, 0x47U, 0x20U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, - 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x0AU, 0x48U, 0x20U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, - 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0xB0U, 0x05U, 0x00U, 0x00U, 0x00U, 0x04U, 0x00U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x44U, 0x00U, 0x27U, 0x00U, 0x00U, 0xD4U, 0x03U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x02U, 0x04U, 0x4FU, 0x01U, - 0x02U, 0xC0U, 0x45U, 0x00U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xBAU, 0x48U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xDAU, 0x48U, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0xFAU, 0x48U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x1AU, 0x49U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x3AU, 0x49U, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x5AU, 0x49U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x7AU, 0x49U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x9AU, 0x49U, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0xBAU, 0x49U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xDAU, 0x49U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xFAU, 0x49U, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x1AU, 0x4AU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x3AU, 0x4AU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x5AU, 0x4AU, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x7AU, 0x4AU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x9AU, 0x4AU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xBAU, 0x4AU, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0xDAU, 0x4AU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xFAU, 0x4AU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x1AU, 0x4BU, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x3AU, 0x4BU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x5AU, 0x4BU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x7AU, 0x4BU, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x9AU, 0x4BU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xBAU, 0x4BU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xDAU, 0x4BU, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0xFAU, 0x4BU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x1AU, 0x4CU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x3AU, 0x4CU, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x5AU, 0x4CU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x7AU, 0x4CU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x9AU, 0x4CU, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0xBAU, 0x4CU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xDAU, 0x4CU, 0x20U, 0x00U, 0x00U, 0xF4U, 0x03U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x02U, 0x80U, 0x45U, 0x00U, - 0x00U, 0x00U, 0x0EU, 0x04U, 0x00U, 0x04U, 0x1CU, 0x01U, 0x00U, 0x08U, 0x06U, 0x06U, - 0x0CU, 0x14U, 0x10U, 0x00U, 0x0CU, 0x54U, 0x21U, 0x00U, 0x00U, 0x00U, 0x04U, 0x00U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x02U, 0x40U, 0x05U, 0x00U, 0x00U, 0x00U, 0x04U, 0x00U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x24U, 0x0FU, 0x02U, 0x02U, 0xC0U, 0x45U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, - 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x7AU, 0x4DU, 0x20U -}; -#endif -const uint32_t s_smartdmaDisplayFirmwareSize = sizeof(s_smartdmaDisplayFirmware); - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Codes - ******************************************************************************/ - -void SDMA_IRQHandler(void); -void SDMA_IRQHandler(void) -{ - SMARTDMA_HandleIRQ(); -} - -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_smartdma_rt500.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_smartdma_rt500.h deleted file mode 100644 index fe2c47f8b08..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_smartdma_rt500.h +++ /dev/null @@ -1,321 +0,0 @@ -/* - * Copyright 2019-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_SMARTDMA_RT500_H_ -#define FSL_SMARTDMA_RT500_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup smartdma_rt500 RT500 SMARTDMA Firmware - * @ingroup smartdma - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -#define SMARTDMA_DISPLAY_MIPI_AND_FLEXIO 0 -#define SMARTDMA_DISPLAY_MIPI_ONLY 1 -#define SMARTDMA_DISPLAY_FLEXIO_ONLY 2 - -/* Select firmware for MIPI and FLEXIO by default. */ -#ifndef SMARTDMA_DISPLAY_FIRMWARE_SELECT -#define SMARTDMA_DISPLAY_FIRMWARE_SELECT SMARTDMA_DISPLAY_MIPI_AND_FLEXIO -#endif - -/*! @brief The firmware used for display. */ -extern const uint8_t s_smartdmaDisplayFirmware[]; - -/*! @brief The s_smartdmaDisplayFirmware firmware memory address. */ -#define SMARTDMA_DISPLAY_MEM_ADDR 0x24100000U - -/*! @brief Size of s_smartdmaDisplayFirmware */ -#define SMARTDMA_DISPLAY_FIRMWARE_SIZE (s_smartdmaDisplayFirmwareSize) - -/*! @brief Size of s_smartdmaDisplayFirmware */ -extern const uint32_t s_smartdmaDisplayFirmwareSize; - -#if (SMARTDMA_DISPLAY_FIRMWARE_SELECT == SMARTDMA_DISPLAY_MIPI_AND_FLEXIO) -/*! - * @brief The API index when using s_smartdmaDisplayFirmware. - */ -enum _smartdma_display_api -{ - kSMARTDMA_FlexIO_DMA_Endian_Swap = 0U, - kSMARTDMA_FlexIO_DMA_Reverse32, - kSMARTDMA_FlexIO_DMA, - kSMARTDMA_FlexIO_DMA_Reverse, /*!< Send data to FlexIO with reverse order. */ - kSMARTDMA_RGB565To888, /*!< Convert RGB565 to RGB888 and save to output memory, use parameter - smartdma_rgb565_rgb888_param_t. */ - kSMARTDMA_FlexIO_DMA_RGB565To888, /*!< Convert RGB565 to RGB888 and send to FlexIO, use parameter - smartdma_flexio_mculcd_param_t. */ - kSMARTDMA_FlexIO_DMA_ARGB2RGB, /*!< Convert ARGB to RGB and send to FlexIO, use parameter - smartdma_flexio_mculcd_param_t. */ - kSMARTDMA_FlexIO_DMA_ARGB2RGB_Endian_Swap, /*!< Convert ARGB to RGB, then swap endian, and send to - FlexIO, use parameter smartdma_flexio_mculcd_param_t. */ - kSMARTDMA_FlexIO_DMA_ARGB2RGB_Endian_Swap_Reverse, /*!< Convert ARGB to RGB, then swap endian and reverse, and send - to FlexIO, use parameter smartdma_flexio_mculcd_param_t. */ - kSMARTDMA_MIPI_RGB565_DMA, /*!< Send RGB565 data to MIPI DSI, use parameter smartdma_dsi_param_t. */ - kSMARTDMA_MIPI_RGB565_DMA2D, /*!< Send RGB565 data to MIPI DSI, use parameter smartdma_dsi_2d_param_t. - */ - kSMARTDMA_MIPI_RGB888_DMA, /*!< Send RGB888 data to MIPI DSI, use parameter smartdma_dsi_param_t. */ - kSMARTDMA_MIPI_RGB888_DMA2D, /*!< Send RGB565 data to MIPI DSI, use parameter smartdma_dsi_2d_param_t. - */ - kSMARTDMA_MIPI_XRGB2RGB_DMA, /*!< Send XRGB8888 data to MIPI DSI, use parameter smartdma_dsi_param_t */ - kSMARTDMA_MIPI_XRGB2RGB_DMA2D, /*!< Send XRGB8888 data to MIPI DSI, use parameter - smartdma_dsi_2d_param_t. */ - kSMARTDMA_MIPI_RGB565_R180_DMA, /*!< Send RGB565 data to MIPI DSI, Rotate 180, use parameter - * smartdma_dsi_param_t. - */ - kSMARTDMA_MIPI_RGB888_R180_DMA, /*!< Send RGB888 data to MIPI DSI, Rotate 180, use parameter - * smartdma_dsi_param_t. - */ - kSMARTDMA_MIPI_XRGB2RGB_R180_DMA, /*!< Send XRGB8888 data to MIPI DSI, Rotate 180, use parameter - smartdma_dsi_param_t */ - kSMARTDMA_MIPI_RGB5652RGB888_DMA, /*!< Send RGB565 data to MIPI DSI, use parameter smartdma_dsi_param_t. - */ - kSMARTDMA_MIPI_RGB888_CHECKER_BOARD_DMA, /*!< Send RGB888 data to MIPI DSI with checker board pattern, - use parameter smartdma_dsi_checkerboard_param_t. */ - kSMARTDMA_MIPI_Enter_ULPS, /*!< Set MIPI-DSI to enter ultra low power state. */ - kSMARTDMA_MIPI_Exit_ULPS, /*!< Set MIPI-DSI to exit ultra low power state. */ - kSMARTDMA_FlexIO_DMA_ONELANE, /*!< FlexIO DMA for one SHIFTBUF, Write Data to SHIFTBUF[OFFSET] */ - kSMARTDMA_FlexIO_FIFO2RAM, /*!< Read data from FlexIO FIFO to ram space. */ -}; - -#elif (SMARTDMA_DISPLAY_FIRMWARE_SELECT == SMARTDMA_DISPLAY_MIPI_ONLY) - -/*! - * @brief The API index when using s_smartdmaDisplayFirmware. - */ -enum _smartdma_display_api -{ - kSMARTDMA_MIPI_RGB565_DMA, /*!< Send RGB565 data to MIPI DSI, use parameter smartdma_dsi_param_t. */ - kSMARTDMA_MIPI_RGB565_DMA2D, /*!< Send RGB565 data to MIPI DSI, use parameter smartdma_dsi_2d_param_t. - */ - kSMARTDMA_MIPI_RGB888_DMA, /*!< Send RGB888 data to MIPI DSI, use parameter smartdma_dsi_param_t. */ - kSMARTDMA_MIPI_RGB888_DMA2D, /*!< Send RGB565 data to MIPI DSI, use parameter smartdma_dsi_2d_param_t. - */ - kSMARTDMA_MIPI_XRGB2RGB_DMA, /*!< Send XRGB8888 data to MIPI DSI, use parameter smartdma_dsi_param_t */ - kSMARTDMA_MIPI_XRGB2RGB_DMA2D, /*!< Send XRGB8888 data to MIPI DSI, use parameter - smartdma_dsi_2d_param_t. */ - kSMARTDMA_MIPI_RGB565_R180_DMA, /*!< Send RGB565 data to MIPI DSI, Rotate 180, use parameter - * smartdma_dsi_param_t. - */ - kSMARTDMA_MIPI_RGB888_R180_DMA, /*!< Send RGB888 data to MIPI DSI, Rotate 180, use parameter - * smartdma_dsi_param_t. - */ - kSMARTDMA_MIPI_XRGB2RGB_R180_DMA, /*!< Send XRGB8888 data to MIPI DSI, Rotate 180, use parameter - smartdma_dsi_param_t */ - kSMARTDMA_MIPI_RGB5652RGB888_DMA, /*!< Send RGB565 data to MIPI DSI, use parameter smartdma_dsi_param_t. - */ - kSMARTDMA_MIPI_RGB888_CHECKER_BOARD_DMA, /*!< Send RGB888 data to MIPI DSI with checker board pattern, - use parameter smartdma_dsi_checkerboard_param_t. */ - kSMARTDMA_MIPI_Enter_ULPS, /*!< Set MIPI-DSI to enter ultra low power state. */ - kSMARTDMA_MIPI_Exit_ULPS, /*!< Set MIPI-DSI to exit ultra low power state. */ -}; - -#elif (SMARTDMA_DISPLAY_FIRMWARE_SELECT == SMARTDMA_DISPLAY_FLEXIO_ONLY) - -/*! - * @brief The API index when using s_smartdmaDisplayFirmware. - */ -enum _smartdma_display_api -{ - kSMARTDMA_FlexIO_DMA_Endian_Swap = 0U, - kSMARTDMA_FlexIO_DMA_Reverse32, - kSMARTDMA_FlexIO_DMA, - kSMARTDMA_FlexIO_DMA_Reverse, /*!< Send data to FlexIO with reverse order. */ - kSMARTDMA_FlexIO_DMA_RGB565To888, /*!< Convert RGB565 to RGB888 and send to FlexIO, use parameter - smartdma_flexio_mculcd_param_t. */ - kSMARTDMA_FlexIO_DMA_ARGB2RGB, /*!< Convert ARGB to RGB and send to FlexIO, use parameter - smartdma_flexio_mculcd_param_t. */ - kSMARTDMA_FlexIO_DMA_ARGB2RGB_Endian_Swap, /*!< Convert ARGB to RGB, then swap endian, and send to FlexIO, use - parameter smartdma_flexio_mculcd_param_t. */ - kSMARTDMA_FlexIO_DMA_ARGB2RGB_Endian_Swap_Reverse, /*!< Convert ARGB to RGB, then swap endian and reverse, and send - to FlexIO, use parameter smartdma_flexio_mculcd_param_t. */ - kSMARTDMA_FlexIO_DMA_ONELANE, /*!< FlexIO DMA for one SHIFTBUF, Write Data to SHIFTBUF[OFFSET] */ - kSMARTDMA_FlexIO_FIFO2RAM, /*!< Read data from FlexIO FIFO to ram space. */ -}; -#endif - -/*! - * @brief Parameter for FlexIO MCULCD except kSMARTDMA_FlexIO_DMA_ONELANE - */ -typedef struct _smartdma_flexio_mculcd_param -{ - uint32_t *p_buffer; - uint32_t buffersize; - uint32_t *smartdma_stack; -} smartdma_flexio_mculcd_param_t; - -/*! - * @brief Parameter for kSMARTDMA_FlexIO_DMA_ONELANE - */ -typedef struct _smartdma_flexio_onelane_mculcd_param -{ - uint32_t *p_buffer; - uint32_t buffersize; - uint32_t offset; - uint32_t *smartdma_stack; -} smartdma_flexio_onelane_mculcd_param_t; - -/*! - * @brief Parameter for MIPI DSI - */ -typedef struct _smartdma_dsi_param -{ - /*! Pointer to the buffer to send. */ - const uint8_t *p_buffer; - /*! Buffer size in byte. */ - uint32_t buffersize; - /*! Stack used by SMARTDMA. */ - uint32_t *smartdma_stack; - /*! - * If set to 1, the pixels are filled to MIPI DSI FIFO directly. - * If set to 0, the pixel bytes are swapped then filled to - * MIPI DSI FIFO. For example, when set to 0 and frame buffer pixel - * format is RGB565: - * LSB MSB - * B0 B1 B2 B3 B4 G0 G1 G2 | G3 G4 G5 R0 R1 R2 R3 R4 - * Then the pixel filled to DSI FIFO is: - * LSB MSB - * G3 G4 G5 R0 R1 R2 R3 R4 | B0 B1 B2 B3 B4 G0 G1 G2 - */ - uint32_t disablePixelByteSwap; -} smartdma_dsi_param_t; - -/*! - * @brief Parameter for kSMARTDMA_MIPI_RGB565_DMA2D, kSMARTDMA_MIPI_RGB888_DMA2D - * and kSMARTDMA_MIPI_XRGB2RGB_DMA2D. - */ -typedef struct _smartdma_dsi_2d_param -{ - /*! Pointer to the buffer to send. */ - const uint8_t *p_buffer; - /*! SRC data transfer in a minor loop */ - uint32_t minorLoop; - /*! SRC data offset added after a minor loop */ - uint32_t minorLoopOffset; - /*! SRC data transfer in a major loop */ - uint32_t majorLoop; - /*! Stack used by SMARTDMA. */ - uint32_t *smartdma_stack; - /*! - * If set to 1, the pixels are filled to MIPI DSI FIFO directly. - * If set to 0, the pixel bytes are swapped then filled to - * MIPI DSI FIFO. For example, when set to 0 and frame buffer pixel - * format is RGB565: - * LSB MSB - * B0 B1 B2 B3 B4 G0 G1 G2 | G3 G4 G5 R0 R1 R2 R3 R4 - * Then the pixel filled to DSI FIFO is: - * LSB MSB - * G3 G4 G5 R0 R1 R2 R3 R4 | B0 B1 B2 B3 B4 G0 G1 G2 - */ - uint32_t disablePixelByteSwap; -} smartdma_dsi_2d_param_t; - -/*! - * @brief Parameter for kSMARTDMA_MIPI_RGB888_CHECKER_BOARD_DMA - */ -typedef struct _smartdma_dsi_checkerboard_param -{ - /*! Pointer to the buffer to send, pixel format is ARGB8888. */ - const uint8_t *p_buffer; - uint32_t height; /*! Height resolution in pixel. */ - uint32_t width; /*! Width resolution in pixel. */ - /*! Cube block type. - * cbType=1 : 1/2 pixel mask cases - * cbType=2 : 1/4 pixel mask cases - */ - uint32_t cbType; - /*! which pixel is turned off in each type - * cbType=2: indexOff= 1,2,3,4 - * cbType=1: indexOff= 0,1 - */ - uint32_t indexOff; - /*! Stack used by SMARTDMA. */ - uint32_t *smartdma_stack; - /*! - * If set to 1, the pixels are filled to MIPI DSI FIFO directly. - * If set to 0, the pixel bytes are swapped then filled to - * MIPI DSI FIFO. For example, when set to 0 and frame buffer pixel - * for example - * format is RGB888: - * LSB MSB - * B0 B1 B2 B3 B4 B5 B6 B7 | G0 G1 G2 G3 G4 G5 G6 G7 | R0 R1 R2 R3 R4 R5 R6 R7 - * Then the pixel filled to DSI FIFO is: - * LSB MSB - * R0 R1 R2 R3 R4 R5 R6 R7 | G0 G1 G2 G3 G4 G5 G6 G7 | B0 B1 B2 B3 B4 B5 B6 B7 - */ - uint32_t disablePixelByteSwap; -} smartdma_dsi_checkerboard_param_t; - -/*! - * @brief Parameter for RGB565To888 - */ -typedef struct _smartdma_rgb565_rgb888_param -{ - uint32_t *inBuf; - uint32_t *outBuf; - uint32_t buffersize; - uint32_t *smartdma_stack; -} smartdma_rgb565_rgb888_param_t; - -/*! - * @brief Parameter for all supported APIs. - */ -typedef union -{ - /*! Parameter for flexio MCULCD. */ - smartdma_flexio_mculcd_param_t flexioMcuLcdParam; - /*! Parameter for flexio MCULCD with one shift buffer. */ - smartdma_flexio_onelane_mculcd_param_t flexioOneLineMcuLcdParam; - /*! Parameter for MIPI DSI functions. */ - smartdma_dsi_param_t dsiParam; - /*! Parameter for MIPI DSI 2D functions. */ - smartdma_dsi_2d_param_t dsi2DParam; - /*! Parameter for MIPI DSI checker board functions. */ - smartdma_dsi_checkerboard_param_t dsiCheckerBoardParam; - /*! Parameter for RGB565_RGB888 convertion. */ - smartdma_rgb565_rgb888_param_t rgb565_rgb888Param; -} smartdma_param_t; - -typedef struct -{ - uint8_t RESERVED_0[32]; - __IO uint32_t BOOTADR; /* 0x20 */ - __IO uint32_t CTRL; /* 0x24 */ - __I uint32_t PC; /* 0x28 */ - __I uint32_t SP; /* 0x2C */ - __IO uint32_t BREAK_ADDR; /* 0x30 */ - __IO uint32_t BREAK_VECT; /* 0x34 */ - __IO uint32_t EMER_VECT; /* 0x38 */ - __IO uint32_t EMER_SEL; /* 0x3C */ - __IO uint32_t ARM2EZH; /* 0x40 */ - __IO uint32_t EZH2ARM; /* 0x44 */ - __IO uint32_t PENDTRAP; /* 0x48 */ -} SMARTDMA_Type; - -#define SMARTDMA_BASE 0x40027000 -#define SMARTDMA ((volatile SMARTDMA_Type *)SMARTDMA_BASE) - -/******************************************************************************* - * APIs - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -#if defined(__cplusplus) -} -#endif - -/* @} */ - -#endif /* FSL_SMARTDMA_RT500_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_spc.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_spc.c deleted file mode 100644 index 3420d0d1bb2..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_spc.c +++ /dev/null @@ -1,1753 +0,0 @@ -/* - * Copyright 2022-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_spc.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.mcx_spc" -#endif - -/* - * $Coverage Justification Reference$ - * - * $Justification spc_c_ref_1$ - * The SPC busy status flag is too short to get coverage data. - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Gets selected power domain's requested low power mode. - * - * param base SPC peripheral base address. - * param powerDomainId Power Domain Id, please refer to spc_power_domain_id_t. - * - * return The selected power domain's requested low power mode, please refer to spc_power_domain_low_power_mode_t. - */ -spc_power_domain_low_power_mode_t SPC_GetPowerDomainLowPowerMode(SPC_Type *base, spc_power_domain_id_t powerDomainId) -{ - assert((uint8_t)powerDomainId < SPC_PD_STATUS_COUNT); - - uint32_t val; - - val = ((base->PD_STATUS[(uint8_t)powerDomainId] & SPC_PD_STATUS_LP_MODE_MASK) >> SPC_PD_STATUS_LP_MODE_SHIFT); - return (spc_power_domain_low_power_mode_t)val; -} - -/*! - * brief Gets Isolation status for each power domains. - * - * This function gets the status which indicates whether certain - * peripheral and the IO pads are in a latched state as a result - * of having been in POWERDOWN mode. - * - * param base SPC peripheral base address. - * return Current isolation status for each power domains. - */ -uint8_t SPC_GetPeriphIOIsolationStatus(SPC_Type *base) -{ - uint32_t reg; - - reg = base->SC; - return (uint8_t)((reg & SPC_SC_ISO_CLR_MASK) >> SPC_SC_ISO_CLR_SHIFT); -} - -/*! - * brief Configs Low power request output pin. - * - * This function configs the low power request output pin - * - * param base SPC peripheral base address. - * param config Pointer the spc_LowPower_Request_config_t structure. - */ -void SPC_SetLowPowerRequestConfig(SPC_Type *base, const spc_lowpower_request_config_t *config) -{ - assert(config != NULL); - - uint32_t reg; - - reg = base->LPREQ_CFG; - reg &= ~(SPC_LPREQ_CFG_LPREQOE_MASK | SPC_LPREQ_CFG_LPREQPOL_MASK | SPC_LPREQ_CFG_LPREQOV_MASK); - - if (config->enable) - { - reg |= SPC_LPREQ_CFG_LPREQOE_MASK | SPC_LPREQ_CFG_LPREQPOL((uint8_t)(config->polarity)) | - SPC_LPREQ_CFG_LPREQOV((uint8_t)(config->override)); - } - else - { - reg &= ~SPC_LPREQ_CFG_LPREQOE_MASK; - } - - base->LPREQ_CFG = reg; -} - -/*! - * brief Configures VDD Core Glitch detector, including ripple counter selection, timeout value and so on. - * - * param base SPC peripheral base address. - * param config Pointer to the structure in type of spc_vdd_core_glitch_detector_config_t. - */ -void SPC_ConfigVddCoreGlitchDetector(SPC_Type *base, const spc_vdd_core_glitch_detector_config_t *config) -{ - assert(config != NULL); - - uint32_t reg; - - reg = (base->VDD_CORE_GLITCH_DETECT_SC) & - ~(SPC_VDD_CORE_GLITCH_DETECT_SC_CNT_SELECT_MASK | SPC_VDD_CORE_GLITCH_DETECT_SC_TIMEOUT_MASK | - SPC_VDD_CORE_GLITCH_DETECT_SC_RE_MASK | SPC_VDD_CORE_GLITCH_DETECT_SC_IE_MASK); - - reg |= SPC_VDD_CORE_GLITCH_DETECT_SC_CNT_SELECT(config->rippleCounterSelect) | - SPC_VDD_CORE_GLITCH_DETECT_SC_TIMEOUT(config->resetTimeoutValue) | - SPC_VDD_CORE_GLITCH_DETECT_SC_RE(config->enableReset) | - SPC_VDD_CORE_GLITCH_DETECT_SC_IE(config->enableInterrupt); - - base->VDD_CORE_GLITCH_DETECT_SC = reg; -} - -/*! - * brief Set SRAM operate voltage. - * - * param base SPC peripheral base address. - * param config The pointer to spc_sram_voltage_config_t, specifies the configuration of sram voltage. - */ -void SPC_SetSRAMOperateVoltage(SPC_Type *base, const spc_sram_voltage_config_t *config) -{ - assert(config != NULL); - - uint32_t reg = 0UL; - - reg |= SPC_SRAMCTL_VSM(config->operateVoltage); - - base->SRAMCTL = reg; - - if (config->requestVoltageUpdate) - { - base->SRAMCTL |= SPC_SRAMCTL_REQ_MASK; - while ((base->SRAMCTL & SPC_SRAMCTL_ACK_MASK) == 0UL) - { - /* Wait until acknowledged */ - ; - } - base->SRAMCTL &= ~SPC_SRAMCTL_REQ_MASK; - } -} - -/*! - * brief Configs Bandgap mode in Active mode. - * - * note In active mode, beacause CORELDO_VDD_DS is reserved and set to Normal, so it is impossible to - * disable Bandgap in active mode - * - * param base SPC peripheral base address. - * param mode The Bandgap mode be selected. - * - * retval kStatus_SPC_BandgapModeWrong The Bandgap can not be disabled in active mode. - * retval kStatus_Success Config Bandgap mode in Active power mode successful. - */ -status_t SPC_SetActiveModeBandgapModeConfig(SPC_Type *base, spc_bandgap_mode_t mode) -{ - uint32_t reg; - uint32_t state; - - reg = base->ACTIVE_CFG; - - if (mode == kSPC_BandgapDisabled) - { - state = SPC_GetActiveModeVoltageDetectStatus(base); - - /* If any of the LVD/HVDs are kept enabled, bandgap mode must be enabled with buffer disabled. */ - if (state != 0UL) - { - return kStatus_SPC_BandgapModeWrong; - } - - /* The bandgap mode must be enabled if any regulators' drive strength set as Normal. */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - if ((base->ACTIVE_CFG & SPC_ACTIVE_CFG_SYSLDO_VDD_DS_MASK) == - SPC_ACTIVE_CFG_SYSLDO_VDD_DS(kSPC_SysLDO_NormalDriveStrength)) - { - return kStatus_SPC_BandgapModeWrong; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - if ((base->ACTIVE_CFG & SPC_ACTIVE_CFG_DCDC_VDD_DS_MASK) == SPC_ACTIVE_CFG_DCDC_VDD_DS(kSPC_DCDC_NormalVoltage)) - { - return kStatus_SPC_BandgapModeWrong; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - - /* state of GLITCH_DETECT_DISABLE will be ignored if bandgap is disabled. */ - if ((base->ACTIVE_CFG & SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE_MASK) == 0UL) - { - return kStatus_SPC_BandgapModeWrong; - } -#if defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS - if ((base->ACTIVE_CFG & SPC_ACTIVE_CFG_CORELDO_VDD_DS_MASK) == - SPC_ACTIVE_CFG_CORELDO_VDD_DS(kSPC_CoreLDO_NormalDriveStrength)) - { - return kStatus_SPC_BandgapModeWrong; - } -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - } - - reg &= ~SPC_ACTIVE_CFG_BGMODE_MASK; - reg |= SPC_ACTIVE_CFG_BGMODE(mode); - - base->ACTIVE_CFG = reg; - - return kStatus_Success; -} - -/*! - * brief Configs Bandgap mode in Low Power mode. - * - * This function configs Bandgap mode in Low Power mode. - * IF user wants to disable Bandgap while keeping any of the Regulator in Normal Driver Strength - * or if any of the High voltage detectors/Low voltage detectors are kept enabled, the Bandgap mode - * will be set as Bandgap Enabled with Buffer Disabled. - * - * param base SPC peripheral base address. - * param mode The Bandgap mode be selected. - * retval kStatus_SPC_BandgapModeWrong The bandgap mode setting in Low Power mode is wrong. - * retval kStatus_Success Config Bandgap mode in Low Power power mode successful. - */ -status_t SPC_SetLowPowerModeBandgapmodeConfig(SPC_Type *base, spc_bandgap_mode_t mode) -{ - uint32_t reg; - uint32_t state; - - reg = base->LP_CFG; - - if (mode == kSPC_BandgapDisabled) - { - state = (uint32_t)SPC_GetLowPowerModeVoltageDetectStatus(base); - - /* If any of the LVD/HVDs are kept enabled, bandgap mode must be enabled with buffer disabled. */ - if (state != 0UL) - { - return kStatus_SPC_BandgapModeWrong; - } - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - if ((base->LP_CFG & SPC_LP_CFG_DCDC_VDD_DS_MASK) == SPC_LP_CFG_DCDC_VDD_DS(kSPC_DCDC_NormalDriveStrength)) - { - return kStatus_SPC_BandgapModeWrong; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - if ((base->LP_CFG & SPC_LP_CFG_SYSLDO_VDD_DS_MASK) == - SPC_LP_CFG_SYSLDO_VDD_DS(kSPC_SysLDO_NormalDriveStrength)) - { - return kStatus_SPC_BandgapModeWrong; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - - if ((base->LP_CFG & SPC_LP_CFG_CORELDO_VDD_DS_MASK) == - SPC_LP_CFG_CORELDO_VDD_DS(kSPC_CoreLDO_NormalDriveStrength)) - { - return kStatus_SPC_BandgapModeWrong; - } - - /* state of GLITCH_DETECT_DISABLE will be ignored if bandgap is disabled. */ - if ((base->LP_CFG & SPC_LP_CFG_GLITCH_DETECT_DISABLE_MASK) == 0UL) - { - return kStatus_SPC_BandgapModeWrong; - } - } - - reg &= ~SPC_LP_CFG_BGMODE_MASK; - reg |= SPC_LP_CFG_BGMODE(mode); - base->LP_CFG = reg; - - return kStatus_Success; -} - -/*! - * brief Configs CORE voltage detect options. - * - * This function configs CORE voltage detect options. - * Note: Setting both the voltage detect interrupt and reset - * enable will cause interrupt to be generated on exit from reset. - * If those conditioned is not desired, interrupt/reset only one is enabled. - * - * param base SPC peripheral base address. - * param config Pointer to spc_core_voltage_detect_config_t structure. - */ -void SPC_SetCoreVoltageDetectConfig(SPC_Type *base, const spc_core_voltage_detect_config_t *config) -{ - assert(config != NULL); - - uint32_t reg = 0UL; - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) - reg |= (config->option.HVDInterruptEnable) ? SPC_VD_CORE_CFG_HVDIE(1U) : SPC_VD_CORE_CFG_HVDIE(0U); - reg |= (config->option.HVDResetEnable) ? SPC_VD_CORE_CFG_HVDRE(1U) : SPC_VD_CORE_CFG_HVDRE(0U); -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD */ - reg |= (config->option.LVDInterruptEnable) ? SPC_VD_CORE_CFG_LVDIE(1U) : SPC_VD_CORE_CFG_LVDIE(0U); - reg |= (config->option.LVDResetEnable) ? SPC_VD_CORE_CFG_LVDRE(1U) : SPC_VD_CORE_CFG_LVDRE(0U); - - base->VD_CORE_CFG = reg; -} - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) -/*! - * brief Enables the Core High Voltage Detector in Active mode. - * - * note If the CORE_LDO high voltage detect is enabled in Active mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low. - * - * param base SPC peripheral base address. - * param enable Enable/Disable Core HVD. - * true - Enable Core High voltage detector in active mode. - * false - Disable Core High voltage detector in active mode. - * - * retval kStatus_Success Enable Core High Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeCoreHighVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_CORE_HVDE_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_CORE_HVDE_MASK; - } - - return status; -} - - -/*! - * brief Enables the Core High Voltage Detector in Low Power mode. - * - * note If the CORE_LDO high voltage detect is enabled in Low Power mode, - * please note that the bandgap must be enabled and the drive strength of each regulator - * must not set to low in low power mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable Core HVD. - * true - Enable Core High voltage detector in low power mode. - * false - Disable Core High voltage detector in low power mode. - * - * retval kStatus_Success Enable Core High Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeCoreHighVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_CORE_HVDE_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_CORE_HVDE_MASK; - } - - return status; -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD */ - -/*! - * brief Enables the Core Low Voltage Detector in Active mode. - * - * note If the CORE_LDO high voltage detect is enabled in Active mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low. - * - * param base SPC peripheral base address. - * param enable Enable/Disable Core LVD. - * true - Enable Core Low voltage detector in active mode. - * false - Disable Core Low voltage detector in active mode. - * - * retval kStatus_Success Enable Core Low Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeCoreLowVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_CORE_LVDE_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_CORE_LVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the Core Low Voltage Detector in Low Power mode. - * - * note If the CORE_LDO low voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Low Power mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable Core HVD. - * true - Enable Core Low voltage detector in low power mode. - * false - Disable Core Low voltage detector in low power mode. - * - * retval kStatus_Success Enable Core Low Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeCoreLowVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_CORE_LVDE_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_CORE_LVDE_MASK; - } - - return status; -} - -/*! - * brief Set system VDD Low-voltage level selection. - * - * This function selects the system VDD low-voltage level. Changing system VDD low-voltage level - * must be done after disabling the System VDD low voltage reset and interrupt. - * - * param base SPC peripheral base address. - * param level System VDD Low-Voltage level selection. See @ref spc_low_voltage_level_select_t for details. - */ -void SPC_SetSystemVDDLowVoltageLevel(SPC_Type *base, spc_low_voltage_level_select_t level) -{ - uint32_t reg; - - reg = base->VD_SYS_CFG; - /* Before changing voltage level, must disable low voltage detect interrupt and reset. */ - base->VD_SYS_CFG &= ~(SPC_VD_SYS_CFG_LVDRE_MASK | SPC_VD_SYS_CFG_LVDIE_MASK); - reg |= SPC_VD_SYS_CFG_LVSEL(level); - - base->VD_SYS_CFG = reg; -} - -/*! - * brief Configs SYS voltage detect options. - * - * This function config SYS voltage detect options. - * Note: Setting both the voltage detect interrupt and reset - * enable will cause interrupt to be generated on exit from reset. - * If those conditioned is not desired, interrupt/reset only one is enabled. - * - * param base SPC peripheral base address. - * param config Pointer to spc_system_voltage_detect_config_t structure. - */ -void SPC_SetSystemVoltageDetectConfig(SPC_Type *base, const spc_system_voltage_detect_config_t *config) -{ - assert(config != NULL); - - uint32_t reg = 0UL; - - reg |= (config->option.HVDInterruptEnable) ? SPC_VD_SYS_CFG_HVDIE(1U) : SPC_VD_SYS_CFG_HVDIE(0U); - reg |= (config->option.LVDInterruptEnable) ? SPC_VD_SYS_CFG_LVDIE(1U) : SPC_VD_SYS_CFG_LVDIE(0U); - reg |= (config->option.HVDResetEnable) ? SPC_VD_SYS_CFG_HVDRE(1U) : SPC_VD_SYS_CFG_HVDRE(0U); - reg |= (config->option.LVDResetEnable) ? SPC_VD_SYS_CFG_LVDRE(1U) : SPC_VD_SYS_CFG_LVDRE(0U); - - base->VD_SYS_CFG = reg; - - /* Set trip voltage level. */ - SPC_SetSystemVDDLowVoltageLevel(base, config->level); -} - -/*! - * brief Enables the System High Voltage Detector in Active mode. - * - * note If the System_LDO high voltage detect is enabled in Active mode, - * please note that the bandgap must be enabled and the drive strength of - * each regulator must not set to low in Active mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable System HVD. - * true - Enable System High voltage detector in active mode. - * false - Disable System High voltage detector in active mode. - * - * retval kStatus_Success Enable System High Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeSystemHighVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_SYS_HVDE_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_SYS_HVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the System Low Voltage Detector in Active mode. - * - * note If the System_LDO low voltage detect is enabled in Active mode, - * please note that the bandgap must be enabled and the drive strength of each - * regulator must not set to low in Active mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable System LVD. - * true - Enable System Low voltage detector in active mode. - * false - Disable System Low voltage detector in active mode. - * - * retval kStatus_Success Enable the System Low Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeSystemLowVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_SYS_LVDE_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_SYS_LVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the System High Voltage Detector in Low Power mode. - * - * note If the System_LDO high voltage detect is enabled in low power mode, - * please note that the bandgap must be enabled and the drive strength of each - * regulator must not set to low in low power mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable System HVD. - * true - Enable System High voltage detector in low power mode. - * false - Disable System High voltage detector in low power mode. - * - * retval kStatus_Success Enable System High Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeSystemHighVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_SYS_HVDE_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_SYS_HVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the System Low Voltage Detector in Low Power mode. - * - * note If the System_LDO low voltage detect is enabled in Low Power mode, - * please note that the bandgap must be enabled and the drive strength of each - * regulator must not set to low in Low Power mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable System HVD. - * true - Enable System Low voltage detector in low power mode. - * false - Disable System Low voltage detector in low power mode. - * - * retval kStatus_Success Enable System Low Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeSystemLowVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_SYS_LVDE_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_SYS_LVDE_MASK; - } - - return status; -} - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) && FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) -/*! - * brief Set IO VDD Low-Voltage level selection. - * - * This function selects the IO VDD Low-voltage level. Changing IO VDD low-voltage level - * must be done after disabling the IO VDD low voltage reset and interrupt. - * - * param base SPC peripheral base address. - * param level IO VDD Low-voltage level selection. - */ -void SPC_SetIOVDDLowVoltageLevel(SPC_Type *base, spc_low_voltage_level_select_t level) -{ - uint32_t reg; - - reg = base->VD_IO_CFG; - - base->VD_IO_CFG &= ~(SPC_VD_IO_CFG_LVDRE_MASK | SPC_VD_IO_CFG_LVDIE_MASK | SPC_VD_IO_CFG_LVSEL_MASK); - reg |= SPC_VD_IO_CFG_LVSEL(level); - - base->VD_IO_CFG = reg; -} - -/*! - * brief Configs IO voltage detect options. - * - * This function config IO voltage detect options. - * Note: Setting both the voltage detect interrupt and reset - * enable will cause interrupt to be generated on exit from reset. - * If those conditioned is not desired, interrupt/reset so only one is enabled. - * - * param base SPC peripheral base address. - * param config Pointer to spc_IO_voltage_detect_config_t structure. - */ -void SPC_SetIOVoltageDetectConfig(SPC_Type *base, const spc_io_voltage_detect_config_t *config) -{ - assert(config != NULL); - - uint32_t reg = 0UL; - - /* Set trip voltage level. */ - SPC_SetIOVDDLowVoltageLevel(base, config->level); - - reg = base->VD_IO_CFG; - reg &= ~(SPC_VD_IO_CFG_LVDRE_MASK | SPC_VD_IO_CFG_LVDIE_MASK | SPC_VD_IO_CFG_HVDRE_MASK | SPC_VD_IO_CFG_HVDIE_MASK); - - reg |= (config->option.HVDInterruptEnable) ? SPC_VD_IO_CFG_HVDIE(1U) : SPC_VD_IO_CFG_HVDIE(0U); - reg |= (config->option.LVDInterruptEnable) ? SPC_VD_IO_CFG_LVDIE(1U) : SPC_VD_IO_CFG_LVDIE(0U); - reg |= (config->option.HVDResetEnable) ? SPC_VD_IO_CFG_HVDRE(1U) : SPC_VD_IO_CFG_HVDRE(0U); - reg |= (config->option.LVDResetEnable) ? SPC_VD_IO_CFG_LVDRE(1U) : SPC_VD_IO_CFG_LVDRE(0U); - - base->VD_IO_CFG = reg; -} - -/*! - * brief Enables the IO High Voltage Detector in Active mode. - * - * note If the IO high voltage detect is enabled in Active mode, - * please note that the bandgap must be enabled and the drive strength - * of each regulator must not set to low in Active mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable IO HVD. - * true - Enable IO High voltage detector in active mode. - * false - Disable IO High voltage detector in active mode. - * - * retval kStatus_Success Enable IO High Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeIOHighVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_IO_HVDE_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_IO_HVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the IO Low Voltage Detector in Active mode. - * - * note If the IO low voltage detect is enabled in Active mode, - * please note that the bandgap must be enabled and the drive strength - * of each regulator must not set to low in Active mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable IO LVD. - * true - Enable IO Low voltage detector in active mode. - * false - Disable IO Low voltage detector in active mode. - * - * retval kStatus_Success Enable IO Low Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeIOLowVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_IO_LVDE_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_IO_LVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the IO High Voltage Detector in Low Power mode. - * - * note If the IO high voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Low Power mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable IO HVD. - * true - Enable IO High voltage detector in low power mode. - * false - Disable IO High voltage detector in low power mode. - * - * retval kStatus_Success Enable IO High Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeIOHighVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_IO_HVDE_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_IO_HVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the IO Low Voltage Detector in Low Power mode. - * - * note If the IO low voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Low Power mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable IO HVD. - * true - Enable IO Low voltage detector in low power mode. - * false - Disable IO Low voltage detector in low power mode. - * - * retval kStatus_Success Enable IO Low Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeIOLowVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_IO_LVDE_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_IO_LVDE_MASK; - } - - return status; -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD */ - -/*! - * brief Configs external voltage domains - * - * This function configs external voltage domains isolation. - * - * param base SPC peripheral base address. - * param lowPowerIsoMask The mask of external domains isolate enable during low power mode. - * param IsoMask The mask of external domains isolate. - */ -void SPC_SetExternalVoltageDomainsConfig(SPC_Type *base, uint8_t lowPowerIsoMask, uint8_t IsoMask) -{ - uint32_t reg = 0UL; - - reg |= SPC_EVD_CFG_REG_EVDISO(IsoMask) | SPC_EVD_CFG_REG_EVDLPISO(lowPowerIsoMask); - base->EVD_CFG = reg; -} - -/*! - * brief Configs Core LDO VDD Regulator in Active mode. - * - * note If any voltage detect feature is enabled in Active mode, then CORE_LDO's drive strength must not set to low. - * note Core VDD level for the Core LDO low power regulator can only be changed when CORELDO_VDD_DS is normal - * - * param base SPC peripheral base address. - * param option Pointer to the spc_active_mode_Core_LDO_option_t structure. - * - * retval kStatus_Success Config Core LDO regulator in Active power mode successful. - * retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * retval kStatus_SPC_CORELDOLowDriveStrengthIgnore If any voltage detect enabled, core_ldo's drive strength can not - * set to low. - * retval kStatus_SPC_CORELDOVoltageWrong The selected voltage level in active mode is not allowed. - */ -status_t SPC_SetActiveModeCoreLDORegulatorConfig(SPC_Type *base, const spc_active_mode_core_ldo_option_t *option) -{ - assert(option != NULL); - - if ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - return kStatus_SPC_Busy; - } - -#if defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS - if ((option->CoreLDODriveStrength == kSPC_CoreLDO_LowDriveStrength) && (SPC_GetActiveModeCoreLDODriveStrength(base) == kSPC_CoreLDO_LowDriveStrength) && (option->CoreLDOVoltage != SPC_GetActiveModeCoreLDOVDDVoltageLevel(base))) - { - /* In active mode, CORE_LDO voltage level should only be changed when the CORE_LDO is in Normal strength. */ - return kStatus_SPC_CORELDOVoltageWrong; - } - - if ((option->CoreLDODriveStrength == kSPC_CoreLDO_LowDriveStrength) && (SPC_GetActiveModeCoreLDODriveStrength(base) == kSPC_CoreLDO_NormalDriveStrength)) - { - /* Change Voltage level firstly. */ - (void)SPC_SetActiveModeCoreLDORegulatorVoltageLevel(base, option->CoreLDOVoltage); - /* Then change drive strength. */ - (void)SPC_SetActiveModeCoreLDORegulatorDriveStrength(base, option->CoreLDODriveStrength); - } - - if (option->CoreLDODriveStrength == kSPC_CoreLDO_NormalDriveStrength) - { - /* Change drive strength firstly. */ - (void)SPC_SetActiveModeCoreLDORegulatorDriveStrength(base, option->CoreLDODriveStrength); - /* Then change Voltage level. */ - (void)SPC_SetActiveModeCoreLDORegulatorVoltageLevel(base, option->CoreLDOVoltage); - } -#else /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - (void)SPC_SetActiveModeCoreLDORegulatorVoltageLevel(base, option->CoreLDOVoltage); -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - - /* - * $Branch Coverage Justification$ - * $ref spc_c_ref_1$. - */ - while ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - } - - return kStatus_Success; -} - -/*! - * brief Set Core LDO VDD Regulator Voltage level in Active mode. - * - * - * - * param base SPC peripheral base address. - * param voltageLevel Specify the voltage level of CORE LDO Regulator in Active mode, please - refer to @ref spc_core_ldo_voltage_level_t. - * - * retval kStatus_SPC_CORELDOVoltageWrong The selected voltage level in active mode is not allowed. - * retval kStatus_Success Set Core LDO regulator voltage level in Active power mode successful. - */ -status_t SPC_SetActiveModeCoreLDORegulatorVoltageLevel(SPC_Type *base, spc_core_ldo_voltage_level_t voltageLevel) -{ - base->ACTIVE_CFG = ((base->ACTIVE_CFG & ~SPC_ACTIVE_CFG_CORELDO_VDD_LVL_MASK) | - SPC_ACTIVE_CFG_CORELDO_VDD_LVL(voltageLevel)); - - return kStatus_Success; -} - -#if defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS -/*! - * brief Set Core LDO VDD Regulator Drive Strength in Active mode. - * - * param base SPC peripheral base address. - * param driveStrength Specify the drive strength of CORE LDO Regulator in Active mode, please - refer to @ref spc_core_ldo_drive_strength_t. - * - * retval #kStatus_Success Set Core LDO regulator drive strength in Active power mode successful. - * retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore If any voltage detect enabled, - core_ldo's drive strength can not set to low. - * retval #kStatus_SPC_BandgapModeWrong The selected bandgap mode is not allowed. - */ -status_t SPC_SetActiveModeCoreLDORegulatorDriveStrength(SPC_Type *base, spc_core_ldo_drive_strength_t driveStrength) -{ - if (driveStrength == kSPC_CoreLDO_LowDriveStrength) - { - /* If any voltage detect feature is enabled in Active mode, then CORE_LDO's drive strength must not set to low. - */ - if (SPC_GetActiveModeVoltageDetectStatus(base) != 0UL) - { - return kStatus_SPC_CORELDOLowDriveStrengthIgnore; - } - } - - if (driveStrength == kSPC_CoreLDO_NormalDriveStrength) - { - /* If specify normal drive strength, bandgap must not be disabled. */ - if (SPC_GetActiveModeBandgapMode(base) == kSPC_BandgapDisabled) - { - return kStatus_SPC_BandgapModeWrong; - } - } - - base->ACTIVE_CFG = ((base->ACTIVE_CFG & ~SPC_ACTIVE_CFG_CORELDO_VDD_DS_MASK) | - SPC_ACTIVE_CFG_CORELDO_VDD_DS(driveStrength)); - - return kStatus_Success; -} -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - -/*! - * brief Configs CORE LDO Regulator in low power mode - * - * This function configs CORE LDO Regulator in Low Power mode. - * If CORE LDO VDD Drive Strength is set to Normal, the CORE LDO VDD regulator voltage - * level in Active mode must be equal to the voltage level in Low power mode. And the Bandgap - * must be programmed to select bandgap enabled. - * Core VDD voltage levels for the Core LDO low power regulator can only be changed when the CORE - * LDO Drive Strength is set as Normal. - * - * param base SPC peripheral base address. - * param option Pointer to the spc_lowpower_mode_Core_LDO_option_t structure. - * retval kStatus_Success Config Core LDO regulator in power mode successfully. - * retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * retval kStatus_SPC_BandgapModeWrong The bandgap mode setting in low powermode is wrong. - * retval kStatus_SPC_CORELDOVoltageWrong The selected voltage level is wrong. - * retval kStatus_SPC_CORELDOLowDriveStrengthIgnore Set driver strength to low will be ignored. - * retval kStatus_SPC_CORELDOVoltageSetFail. Fail to change Core LDO voltage level. - */ -status_t SPC_SetLowPowerModeCoreLDORegulatorConfig(SPC_Type *base, const spc_lowpower_mode_core_ldo_option_t *option) -{ - status_t status = kStatus_Success; - spc_core_ldo_drive_strength_t activeCoreLdoDS = kSPC_CoreLDO_NormalDriveStrength; - - - if ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - /* - * $Line Coverage Justification$ - * $ref spc_c_ref_1$. - */ - return kStatus_SPC_Busy; - } - -#if (defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) - activeCoreLdoDS = SPC_GetActiveModeCoreLDODriveStrength(base); -#endif /* (defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) */ - - if ((option->CoreLDODriveStrength == activeCoreLdoDS) && (option->CoreLDOVoltage != SPC_GetActiveModeCoreLDOVDDVoltageLevel(base))) - { - /* If attemp to set to same drive strength as active mode, voltage level must same in active mode and low power mode. */ - return kStatus_SPC_CORELDOVoltageWrong; - } - - if ((option->CoreLDODriveStrength == kSPC_CoreLDO_LowDriveStrength) && (option->CoreLDOVoltage != SPC_GetLowPowerCoreLDOVDDVoltageLevel(base))) - { - /* Can change core VDD levels for the LDO_CORE low power regulator only when the LDO_CORE is work as normal drive strength. */ - return kStatus_SPC_CORELDOVoltageWrong; - } - - status = SPC_SetLowPowerModeCoreLDORegulatorDriveStrength(base, option->CoreLDODriveStrength); - if (status == kStatus_Success) - { - status = SPC_SetLowPowerModeCoreLDORegulatorVoltageLevel(base, option->CoreLDOVoltage); - } - - /* - * $Branch Coverage Justification$ - * $ref spc_c_ref_1$. - */ - while ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - } - - return status; -} - -/*! - * brief Set Core LDO VDD Regulator Voltage level in Low power mode. - * - * @note If CORE LDO's drive strength is set to Normal, the CORE LDO VDD regulator voltage in active mode and low power - * mode must be same. - * @note Voltage level for the CORE LDO in low power mode can only be changed when the CORE LDO Drive Strength set as - * Normal. - * - * param base SPC peripheral base address. - * param voltageLevel Voltage level of CORE LDO Regulator in Low power mode, please - refer to @ref spc_core_ldo_voltage_level_t. - * - * retval #kStatus_SPC_CORELDOVoltageWrong Voltage level in active mode and low power mode is not same. - * retval #kStatus_Success Set Core LDO regulator voltage level in Low power mode successful. - * retval #kStatus_SPC_CORELDOVoltageSetFail Fail to update voltage level because drive strength is incorrect. - */ -status_t SPC_SetLowPowerModeCoreLDORegulatorVoltageLevel(SPC_Type *base, spc_core_ldo_voltage_level_t voltageLevel) -{ - if ((SPC_GetLowPowerCoreLDOVDDDriveStrength(base) == kSPC_CoreLDO_NormalDriveStrength) && ((uint8_t)voltageLevel != (uint8_t)SPC_GetActiveModeCoreLDOVDDVoltageLevel(base))) - { - /* If LDO_CORE VDD Drive strength is set as normal, the voltage level in active mode and low power mode must be same. */ - return kStatus_SPC_CORELDOVoltageWrong; - } - - if ((SPC_GetLowPowerCoreLDOVDDDriveStrength(base) != kSPC_CoreLDO_NormalDriveStrength) && ((uint8_t)SPC_GetLowPowerCoreLDOVDDVoltageLevel(base) != (uint8_t)voltageLevel)) - { - /* Voltage level for the LDO_CORE low power regulatorcan only be changed when core LDO work as normal drive strength. */ - return kStatus_SPC_CORELDOVoltageSetFail; - } - - base->LP_CFG = ((base->LP_CFG & ~SPC_LP_CFG_CORELDO_VDD_LVL_MASK) | SPC_LP_CFG_CORELDO_VDD_LVL(voltageLevel)); - - return kStatus_Success; -} - -/*! - * brief Set Core LDO VDD Regulator Drive Strength in Low power mode. - * - * param base SPC peripheral base address. - * param driveStrength Specify drive strength of CORE LDO in low power mode. - * - * retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore Some voltage detect enabled, CORE LDO's drive strength can not set - * as low. - * retval #kStatus_Success Set Core LDO regulator drive strength in Low power mode successful. - * retval #kStatus_SPC_BandgapModeWrong Bandgap is disabled when attempt to set CORE LDO work as normal drive strength. - */ -status_t SPC_SetLowPowerModeCoreLDORegulatorDriveStrength(SPC_Type *base, spc_core_ldo_drive_strength_t driveStrength) -{ - if (driveStrength == kSPC_CoreLDO_LowDriveStrength) - { - /* If any voltage detect feature is enabled in Low Power mode, then CORE_LDO's drive strength must not set to low. - */ - if (SPC_GetLowPowerModeVoltageDetectStatus(base) != 0UL) - { - return kStatus_SPC_CORELDOLowDriveStrengthIgnore; - } - } - else - { - /* To specify normal drive strength, the bandgap must be enabled in low power mode. */ - if (SPC_GetLowPowerModeBandgapMode(base) == kSPC_BandgapDisabled) - { - return kStatus_SPC_BandgapModeWrong; - } - } - - base->LP_CFG = ((base->LP_CFG & ~SPC_LP_CFG_CORELDO_VDD_DS_MASK) | - SPC_LP_CFG_CORELDO_VDD_DS(driveStrength)); - - return kStatus_Success; -} - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) -/*! - * brief Configs System LDO VDD Regulator in Active mode. - * - * This function configs System LDO VDD Regulator in Active mode. - * If System LDO VDD Drive Strength is set to Normal, the Bandgap mode in Active mode must be programmed - * to a value that enable the bandgap. - * If any voltage detects are kept enabled, configuration to set System LDO VDD drive strength to low will - * be ignored. - * If select System LDO VDD Regulator voltage level to Over Drive Voltage, the Drive Strength of System LDO VDD - * Regulator must be set to Normal otherwise the regulator Drive Strength will be forced to Normal. - * If select System LDO VDD Regulator voltage level to Over Drive Voltage, the High voltage detect must be disabled. - * Otherwise it will be fail to regulator to Over Drive Voltage. - * - * param base SPC peripheral base address. - * param option Pointer to the spc_active_mode_Sys_LDO_option_t structure. - * retval kStatus_Success Config System LDO regulator in Active power mode successful. - * retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * retval kStatus_SPC_BandgapModeWrong The bandgap mode setting in Active mode is wrong. - * retval kStatus_SPC_SYSLDOOverDriveVoltageFail Fail to regulator to Over Drive Voltage. - * retval kStatus_SPC_SYSLDOLowDriveStrengthIgnore Set System LDO VDD regulator's driver strength to Low will be - * ignored. - */ -status_t SPC_SetActiveModeSystemLDORegulatorConfig(SPC_Type *base, const spc_active_mode_sys_ldo_option_t *option) -{ - assert(option != NULL); - - status_t status; - - if ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - /* - * $Line Coverage Justification$ - * $ref spc_c_ref_1$. - */ - return kStatus_SPC_Busy; - } - - status = SPC_SetActiveModeSystemLDORegulatorDriveStrength(base, option->SysLDODriveStrength); - if (status == kStatus_Success) - { - status = SPC_SetActiveModeSystemLDORegulatorVoltageLevel(base, option->SysLDOVoltage); - } - - /* - * $Branch Coverage Justification$ - * $ref spc_c_ref_1$. - */ - while ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - } - - return status; -} - -/*! - * brief Set System LDO Regulator voltage level in Active mode. - * - * @note The system LDO regulator can only operate at the overdrive voltage level for a limited amount of time for the - * life of chip. - * - * param base SPC peripheral base address. - * param voltageLevel Specify the voltage level of System LDO Regulator in Active mode. - * - * retval #kStatus_Success Set System LDO Regulator voltage level in Active mode successfully. - * retval #kStatus_SPC_SYSLDOOverDriveVoltageFail Must disable system LDO high voltage detector before specifing overdrive voltage. - */ -status_t SPC_SetActiveModeSystemLDORegulatorVoltageLevel(SPC_Type *base, spc_sys_ldo_voltage_level_t voltageLevel) -{ - if (voltageLevel == kSPC_SysLDO_OverDriveVoltage) - { - /* Must disable system LDO high voltage detector before specifing overdrive voltage. */ - if ((SPC_GetActiveModeVoltageDetectStatus(base) & SPC_ACTIVE_CFG_SYS_HVDE_MASK) != 0UL) - { - return kStatus_SPC_SYSLDOOverDriveVoltageFail; - } - } - - base->ACTIVE_CFG = (base->ACTIVE_CFG & ~SPC_ACTIVE_CFG_SYSLDO_VDD_LVL_MASK) | - SPC_ACTIVE_CFG_SYSLDO_VDD_LVL(voltageLevel); - - return kStatus_Success; -} - -/*! - * brief Set System LDO Regulator Drive Strength in Active mode. - * - * param base SPC peripheral base address. - * param driveStrength Specify the drive strength of System LDO Regulator in Active mode. - * - * retval #kStatus_Success Set System LDO Regulator drive strength in Active mode successfully. - * retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Attempt to specify low drive strength is ignored due to any - voltage detect feature is enabled in active mode. - * retval #kStatus_SPC_BandgapModeWrong Bandgap mode in Active mode must be programmed to a value that enables - the bandgap if attempt to specify normal drive strength. - */ -status_t SPC_SetActiveModeSystemLDORegulatorDriveStrength(SPC_Type *base, spc_sys_ldo_drive_strength_t driveStrength) -{ - if (driveStrength == kSPC_SysLDO_LowDriveStrength) - { - /* If enabled any LVDs or HVDs, SPC will ignore the attempt to specify low drive strength. */ - if (SPC_GetActiveModeVoltageDetectStatus(base) != 0UL) - { - return kStatus_SPC_SYSLDOLowDriveStrengthIgnore; - } - } - - if (driveStrength == kSPC_SysLDO_NormalDriveStrength) - { - /* If specify normal drive strength, bandgap must not be disabled. */ - if (SPC_GetActiveModeBandgapMode(base) == kSPC_BandgapDisabled) - { - return kStatus_SPC_BandgapModeWrong; - } - } - - base->ACTIVE_CFG = (base->ACTIVE_CFG & ~SPC_ACTIVE_CFG_SYSLDO_VDD_DS_MASK) | SPC_ACTIVE_CFG_SYSLDO_VDD_DS(driveStrength); - - return kStatus_Success; -} - -/*! - * brief Configs System LDO regulator in low power modes. - * - * This function configs System LDO regulator in low power modes. - * If System LDO VDD Regulator Drive strength is set to normal, bandgap mode in low power - * mode must be programmed to a value that enables the Bandgap. - * If any High voltage detectors or Low Voltage detectors are kept enabled, configuration - * to set System LDO Regulator drive strength as Low will be ignored. - * - * param base SPC peripheral base address. - * param option Pointer to spc_lowpower_mode_Sys_LDO_option_t structure. - * retval kStatus_Success Config System LDO regulator in Low Power Mode successfully. - * retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * retval kStatus_SPC_BandgapModeWrong The bandgap mode setting in Low Power Mode is wrong. - * retval kStatus_SPC_SYSLDOLowDriveStrengthIgnore Set driver strength to low will be ignored. - */ -status_t SPC_SetLowPowerModeSystemLDORegulatorConfig(SPC_Type *base, const spc_lowpower_mode_sys_ldo_option_t *option) -{ - status_t status; - - if ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - /* - * $Line Coverage Justification$ - * $ref spc_c_ref_1$. - */ - return kStatus_SPC_Busy; - } - - status = SPC_SetLowPowerModeSystemLDORegulatorDriveStrength(base, option->SysLDODriveStrength); - /* - * $Branch Coverage Justification$ - * $ref spc_c_ref_1$. - */ - while ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - } - - return status; -} - -/*! - * brief Set System LDO Regulator drive strength in Low Power Mode. - * - * param base SPC peripheral base address. - * param driveStrength Specify the drive strength of System LDO Regulator in Low Power Mode. - * - * retval #kStatus_Success Set System LDO Regulator drive strength in Low Power Mode successfully. - * retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Attempt to specify low drive strength is ignored due to any - voltage detect feature is enabled in low power mode. - * retval #kStatus_SPC_BandgapModeWrong Bandgap mode in low power mode must be programmed to a value that enables - the bandgap if attempt to specify normal drive strength. - */ -status_t SPC_SetLowPowerModeSystemLDORegulatorDriveStrength(SPC_Type *base, spc_sys_ldo_drive_strength_t driveStrength) -{ - if (driveStrength == kSPC_SysLDO_LowDriveStrength) - { - /* If enabled any LVDs or HVDs, SPC will ignore the attempt to specify low drive strength. */ - if (SPC_GetLowPowerModeVoltageDetectStatus(base) != 0UL) - { - return kStatus_SPC_SYSLDOLowDriveStrengthIgnore; - } - } - else - { - /* If specify normal drive strength, bandgap must not be disabled. */ - if (SPC_GetLowPowerModeBandgapMode(base) == kSPC_BandgapDisabled) - { - return kStatus_SPC_BandgapModeWrong; - } - } - - base->LP_CFG = (base->LP_CFG & ~SPC_LP_CFG_SYSLDO_VDD_DS_MASK) | SPC_LP_CFG_SYSLDO_VDD_DS(driveStrength); - - return kStatus_Success; -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) -/*! - * brief Configs DCDC VDD Regulator in Active mode. - * - * Before switching DCDC drive strength from low to normal, the DCDC voltage level should be configured back to - * what it was before switching to low drive strength. - * - * param base SPC peripheral base address. - * param option Pointer to the spc_active_mode_DCDC_option_t structure. - * retval kStatus_Success Config DCDC regulator in Active power mode successful. - * retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * retval kStatus_SPC_BandgapModeWrong The bandgap mode setting in Active mode is wrong. - * retval kStatus_SPC_DCDCLowDriveStrengthIgnore Set driver strength to Low will be ignored. - */ -status_t SPC_SetActiveModeDCDCRegulatorConfig(SPC_Type *base, const spc_active_mode_dcdc_option_t *option) -{ - assert(option != NULL); - status_t status = kStatus_Success; - - if ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - /* - * $Line Coverage Justification$ - * $ref spc_c_ref_1$. - */ - return kStatus_SPC_Busy; - } - - status = SPC_SetActiveModeDCDCRegulatorDriveStrength(base, option->DCDCDriveStrength); - - if (status == kStatus_Success) - { - SPC_SetActiveModeDCDCRegulatorVoltageLevel(base, option->DCDCVoltage); - } - - /* - * $Branch Coverage Justification$ - * $ref spc_c_ref_1$. - */ - while ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - } - - return status; -} - -/*! - * brief Set DCDC VDD Regulator drive strength in Active mode. - * - * param base SPC peripheral base address. - * param driveStrength Specify the DCDC VDD regulator drive strength, please refer to @ref spc_dcdc_drive_strength_t. - * - * retval #kStatus_Success Set DCDC VDD Regulator drive strength in Active mode successfully. - * retval #kStatus_SPC_DCDCLowDriveStrengthIgnore Any of the voltage detects are kept enabled, set driver strength to - * Low will be ignored. - * retval #kStatus_SPC_BandgapModeWrong Set DCDC VDD Regulator drive strength to Normal, the Bandgap must be enabled. - */ -status_t SPC_SetActiveModeDCDCRegulatorDriveStrength(SPC_Type *base, spc_dcdc_drive_strength_t driveStrength) -{ - if (driveStrength == kSPC_DCDC_LowDriveStrength) - { - /*If enabled LVDs or HVDs, and attempt to specify low drive strength, - SPC will ignore the attempt. */ - if (SPC_GetActiveModeVoltageDetectStatus(base) != 0UL) - { - return kStatus_SPC_DCDCLowDriveStrengthIgnore; - } - } - - if (driveStrength == kSPC_DCDC_NormalDriveStrength) - { - /* If specify normal drive strength, bandgap must not be disabled. */ - if (SPC_GetActiveModeBandgapMode(base) == kSPC_BandgapDisabled) - { - return kStatus_SPC_BandgapModeWrong; - } - } - - base->ACTIVE_CFG = ((base->ACTIVE_CFG) & (~SPC_ACTIVE_CFG_DCDC_VDD_DS_MASK)) | SPC_ACTIVE_CFG_DCDC_VDD_DS(driveStrength); - - return kStatus_Success; -} - -/*! - * brief Configs DCDC VDD Regulator in Low power modes. - * - * This function configs DCDC VDD Regulator in Low Power modes. - * If DCDC VDD Drive Strength is set to Normal, the Bandgap mode in Low Power mode must be programmed - * to a value that enables the Bandgap. - * If any of voltage detectors are kept enabled, configuration to set DCDC VDD Drive Strength to Low or Pulse mode - * will be ignored. - * In Deep Power Down mode, DCDC regulator is always turned off. - * - * param base SPC peripheral base address. - * param option Pointer to the spc_lowpower_mode_DCDC_option_t structure. - * retval kStatus_Success Config DCDC regulator in low power mode successfully. - * retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * retval kStatus_SPC_BandgapModeWrong The bandgap mode setting in Low Power mode is wrong. - * retval kStatus_SPC_DCDCPulseRefreshModeIgnore Set driver strength to Pulse Refresh mode will be ignored. - * retval kStatus_SPC_DCDCLowDriveStrengthIgnore Set driver strength to Low Drive Strength will be ignored. - */ -status_t SPC_SetLowPowerModeDCDCRegulatorConfig(SPC_Type *base, const spc_lowpower_mode_dcdc_option_t *option) -{ - status_t status; - - if ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - /* - * $Line Coverage Justification$ - * $ref spc_c_ref_1$. - */ - return kStatus_SPC_Busy; - } - - status = SPC_SetLowPowerModeDCDCRegulatorDriveStrength(base, option->DCDCDriveStrength); - if (status == kStatus_Success) - { - SPC_SetLowPowerModeDCDCRegulatorVoltageLevel(base, option->DCDCVoltage); - } - - /* - * $Branch Coverage Justification$ - * $ref spc_c_ref_1$. - */ - while ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - } - - return status; -} - -/*! - * brief Set DCDC VDD Regulator drive strength in Low power mode. - * - * param base SPC peripheral base address. - * param driveStrength Specify the DCDC VDD Regulator drive strength, please refer to @ref spc_dcdc_drive_strength_t. - * - * retval #kStatus_Success Set DCDC VDD Regulator drive strength in Low power mode successfully. - * retval #kStatus_SPC_DCDCLowDriveStrengthIgnore Any of the voltage detects are kept enabled, set driver strength to - * Low will be ignored. - * retval #kStatus_SPC_BandgapModeWrong Set DCDC VDD Regulator drive strength to Normal, the Bandgap must be enabled. - */ -status_t SPC_SetLowPowerModeDCDCRegulatorDriveStrength(SPC_Type *base, spc_dcdc_drive_strength_t driveStrength) -{ - if (driveStrength == kSPC_DCDC_LowDriveStrength) - { - /*If enabled LVDs or HVDs, and attempt to specify low drive strength, - SPC will ignore the attempt. */ - if (SPC_GetLowPowerModeVoltageDetectStatus(base) != 0UL) - { - return kStatus_SPC_DCDCLowDriveStrengthIgnore; - } - } - - if (driveStrength == kSPC_DCDC_NormalDriveStrength) - { - /* If specify normal drive strength, bandgap must not be disabled. */ - if (SPC_GetLowPowerModeBandgapMode(base) == kSPC_BandgapDisabled) - { - return kStatus_SPC_BandgapModeWrong; - } - } - - base->LP_CFG = ((base->LP_CFG) & (~SPC_LP_CFG_DCDC_VDD_DS_MASK)) | SPC_LP_CFG_DCDC_VDD_DS(driveStrength); - - return kStatus_Success; -} - -/*! - * brief Config DCDC Burst options - * - * param base SPC peripheral base address. - * param config Pointer to spc_DCDC_burst_config_t structure. - */ -void SPC_SetDCDCBurstConfig(SPC_Type *base, spc_dcdc_burst_config_t *config) -{ - assert(config != NULL); - uint32_t reg; - reg = base->DCDC_CFG; - reg &= ~(SPC_DCDC_CFG_FREQ_CNTRL_MASK | SPC_DCDC_CFG_FREQ_CNTRL_ON_MASK); - reg |= SPC_DCDC_CFG_FREQ_CNTRL(config->freq); - reg |= config->stabilizeBurstFreq ? SPC_DCDC_CFG_FREQ_CNTRL_ON(1U) : SPC_DCDC_CFG_FREQ_CNTRL_ON(0U); - base->DCDC_CFG = reg; - - /* Clear DCDC burst acknowledge flag. */ - base->DCDC_BURST_CFG |= SPC_DCDC_BURST_CFG_BURST_ACK_MASK; - base->DCDC_BURST_CFG |= SPC_DCDC_BURST_CFG_EXT_BURST_EN(config->externalBurstRequest); - - if (config->sofwareBurstRequest) - { - base->DCDC_BURST_CFG |= SPC_DCDC_BURST_CFG_BURST_REQ_MASK; - while ((base->DCDC_BURST_CFG & SPC_DCDC_BURST_CFG_BURST_ACK_MASK) == 0U) - { - } - /* DCDC burst request has completed and acknowledged, need to clear this flag. */ - base->DCDC_BURST_CFG |= SPC_DCDC_BURST_CFG_BURST_ACK_MASK; - } -} - -/*! - * brief Set the count value of the reference clock. - * - * This function set the count value of the reference clock to control the frequency - * of dcdc refresh when dcdc is configured in Pulse Refresh mode. - * - * param base SPC peripheral base address. - * param count The count value, 16 bit width. - */ -void SPC_SetDCDCRefreshCount(SPC_Type *base, uint16_t count) -{ - uint32_t reg; - - reg = base->DCDC_BURST_CFG; - reg &= ~SPC_DCDC_BURST_CFG_PULSE_REFRESH_CNT_MASK; - reg |= SPC_DCDC_BURST_CFG_PULSE_REFRESH_CNT(count); - - base->DCDC_BURST_CFG = reg; -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - - -/*! - * brief Configs regulators in Active mode. - * - * This function provides the method to config all on-chip regulators in active mode. - * - * param base SPC peripheral base address. - * param config Pointer to spc_active_mode_regulators_config_t structure. - * retval kStatus_Success Config regulators in Active power mode successful. - * retval kStatus_SPC_BandgapModeWrong The bandgap mode setting in Active mode is wrong. - * retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * retval kStatus_SPC_CORELDOVoltageWrong The selected voltage level in active mode is not allowed. - * retval kStatus_SPC_SYSLDOOverDriveVoltageFail Fail to regulator to Over Drive Voltage. - * retval kStatus_SPC_SYSLDOLowDriveStrengthIgnore Set driver strength to Low will be ignored. - * retval kStatus_SPC_DCDCLowDriveStrengthIgnore Set driver strength to Low will be ignored. - */ -status_t SPC_SetActiveModeRegulatorsConfig(SPC_Type *base, const spc_active_mode_regulators_config_t *config) -{ - assert(config != NULL); - - status_t status; - bool bandgapConfigured = false; - spc_bandgap_mode_t curBandgapMode = SPC_GetActiveModeBandgapMode(base); - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - if (((config->DCDCOption.DCDCDriveStrength) == kSPC_DCDC_NormalDriveStrength) && (bandgapConfigured == false)) - { - if (curBandgapMode == kSPC_BandgapDisabled) - { - if ((config->bandgapMode) == kSPC_BandgapDisabled) - { - /* Bandgap must be enabled if any regulator attemp to work as normal drive strength. */ - return kStatus_SPC_BandgapModeWrong; - } - else - { - /* Set bandgap firstly, if current bandgap is disabled and attempt to set regulator as normal drive - strength. */ - base->ACTIVE_CFG = ((base->ACTIVE_CFG) & (~SPC_ACTIVE_CFG_BGMODE_MASK)) | SPC_ACTIVE_CFG_BGMODE(config->bandgapMode); - bandgapConfigured = true; - } - } - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -#if (defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) - if (((config->CoreLDOOption.CoreLDODriveStrength) == kSPC_CoreLDO_NormalDriveStrength) && (bandgapConfigured == false)) - { - if (curBandgapMode == kSPC_BandgapDisabled) - { - if ((config->bandgapMode) == kSPC_BandgapDisabled) - { - /* Bandgap must be enabled if any regulator attemp to work as normal drive strength. */ - return kStatus_SPC_BandgapModeWrong; - } - else - { - /* Set bandgap firstly, if current bandgap is disabled and attempt to set regulator as normal drive - strength. */ - base->ACTIVE_CFG = ((base->ACTIVE_CFG) & (~SPC_ACTIVE_CFG_BGMODE_MASK)) | SPC_ACTIVE_CFG_BGMODE(config->bandgapMode); - bandgapConfigured = true; - } - } - } -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - if (((config->SysLDOOption.SysLDODriveStrength) == kSPC_SysLDO_NormalDriveStrength) && (bandgapConfigured == false)) - { - if (curBandgapMode == kSPC_BandgapDisabled) - { - if ((config->bandgapMode) == kSPC_BandgapDisabled) - { - /* Bandgap must be enabled if any regulator attemp to work as normal drive strength. */ - return kStatus_SPC_BandgapModeWrong; - } - else - { - /* Set bandgap firstly, if current bandgap is disabled and attempt to set regulator as normal drive - strength. */ - base->ACTIVE_CFG = ((base->ACTIVE_CFG) & (~SPC_ACTIVE_CFG_BGMODE_MASK)) | SPC_ACTIVE_CFG_BGMODE(config->bandgapMode); - bandgapConfigured = true; - } - } - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - if ((uint8_t)config->DCDCOption.DCDCVoltage != (uint8_t)config->CoreLDOOption.CoreLDOVoltage) - { - /* Must specify the same level for both DCDC and CORE LDO, even if LDO_CORE is off. */ - return kStatus_SPC_CORELDOVoltageWrong; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - - if (SPC_GetActiveModeCoreLDOVDDVoltageLevel(base) < (config->CoreLDOOption.CoreLDOVoltage)) - { - /* If want to switch to higher voltage level. */ - - /* Set DCDC configuration previously. */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - status = SPC_SetActiveModeDCDCRegulatorConfig(base, &config->DCDCOption); -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - if (status == kStatus_Success) - { - /* Configure CORE LDO after DCDC is configured successfully. */ - status = SPC_SetActiveModeCoreLDORegulatorConfig(base, &config->CoreLDOOption); - } - else - { - return status; - } - } - else - { - /* If want to switch to lower/same voltage level. */ - - /* Set LDO configuration previously. */ - status = SPC_SetActiveModeCoreLDORegulatorConfig(base, &config->CoreLDOOption); -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - if (status == kStatus_Success) - { - /* Configure DCDC after CORE_LDO is configured successfully. */ - status = SPC_SetActiveModeDCDCRegulatorConfig(base, &config->DCDCOption); - } - else - { - return status; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - } - - if (status == kStatus_Success) - { -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - status = SPC_SetActiveModeSystemLDORegulatorConfig(base, &config->SysLDOOption); -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - if (status == kStatus_Success) - { - if (bandgapConfigured == false) - { - status = SPC_SetActiveModeBandgapModeConfig(base, config->bandgapMode); - } -#if (defined(FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) - if (status == kStatus_Success) - { - SPC_EnableActiveModeCMPBandgapBuffer(base, config->lpBuff); - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT */ - } - } - return status; -} - -/*! - * brief Configs regulators in Low Power mode. - * - * This function provides the method to config all on-chip regulators in Low Power mode. - * - * param base SPC peripheral base address. - * param config Pointer to spc_lowpower_mode_regulators_config_t structure. - * retval kStatus_Success Config regulators in Low power mode successful. - * retval kStatus_SPC_BandgapModeWrong The bandgap mode setting in Low Power mode is wrong. - * retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * retval kStatus_SPC_CORELDOVoltageWrong The selected voltage level is wrong. - * retval kStatus_SPC_CORELDOLowDriveStrengthIgnore Set driver strength to low will be ignored. - * retval kStatus_SPC_CORELDOVoltageSetFail. Fail to change Core LDO voltage level. - * retval kStatus_SPC_SYSLDOLowDriveStrengthIgnore Set driver strength to low will be ignored. - * retval kStatus_SPC_DCDCPulseRefreshModeIgnore Set driver strength to Pulse Refresh mode will be ignored. - * retval kStatus_SPC_DCDCLowDriveStrengthIgnore Set driver strength to Low Drive Strength will be ignored. - */ -status_t SPC_SetLowPowerModeRegulatorsConfig(SPC_Type *base, const spc_lowpower_mode_regulators_config_t *config) -{ - assert(config != NULL); - - status_t status = kStatus_Success; - bool bandgapConfigured = false; - spc_bandgap_mode_t curBandgapMode = SPC_GetActiveModeBandgapMode(base); - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - if (((config->DCDCOption.DCDCDriveStrength) == kSPC_DCDC_NormalDriveStrength) && (bandgapConfigured == false)) - { - if (curBandgapMode == kSPC_BandgapDisabled) - { - if ((config->bandgapMode) == kSPC_BandgapDisabled) - { - /* Bandgap must be enabled if any regulator attemp to work as normal drive strength. */ - return kStatus_SPC_BandgapModeWrong; - } - else - { - /* Set bandgap firstly, if current bandgap is disabled and attempt to set regulator as normal drive - strength. */ - base->LP_CFG = ((base->LP_CFG) & (~SPC_LP_CFG_BGMODE_MASK)) | SPC_LP_CFG_BGMODE(config->bandgapMode); - bandgapConfigured = true; - } - } - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - - if (((config->CoreLDOOption.CoreLDODriveStrength) == kSPC_CoreLDO_NormalDriveStrength) && (bandgapConfigured == false)) - { - if (curBandgapMode == kSPC_BandgapDisabled) - { - if ((config->bandgapMode) == kSPC_BandgapDisabled) - { - /* Bandgap must be enabled if any regulator attemp to work as normal drive strength. */ - return kStatus_SPC_BandgapModeWrong; - } - else - { - /* Set bandgap firstly, if current bandgap is disabled and attempt to set regulator as normal drive - strength. */ - base->LP_CFG = ((base->LP_CFG) & (~SPC_LP_CFG_BGMODE_MASK)) | SPC_LP_CFG_BGMODE(config->bandgapMode); - bandgapConfigured = true; - } - } - } - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - if (((config->SysLDOOption.SysLDODriveStrength) == kSPC_SysLDO_NormalDriveStrength) && (bandgapConfigured == false)) - { - if (curBandgapMode == kSPC_BandgapDisabled) - { - if ((config->bandgapMode) == kSPC_BandgapDisabled) - { - /* Bandgap must be enabled if any regulator attemp to work as normal drive strength. */ - return kStatus_SPC_BandgapModeWrong; - } - else - { - /* Set bandgap firstly, if current bandgap is disabled and attempt to set regulator as normal drive - strength. */ - base->LP_CFG = ((base->LP_CFG) & (~SPC_LP_CFG_BGMODE_MASK)) | SPC_LP_CFG_BGMODE(config->bandgapMode); - bandgapConfigured = true; - } - } - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - if ((uint8_t)config->DCDCOption.DCDCVoltage != (uint8_t)config->CoreLDOOption.CoreLDOVoltage) - { - /* Must specify the same level for both DCDC and CORE LDO, even if LDO_CORE is off. */ - return kStatus_SPC_CORELDOVoltageWrong; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - - status = SPC_SetLowPowerModeCoreLDORegulatorConfig(base, &config->CoreLDOOption); - if (status == kStatus_Success) - { -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - status = SPC_SetLowPowerModeSystemLDORegulatorConfig(base, &config->SysLDOOption); -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - if (status == kStatus_Success) - { -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - status = SPC_SetLowPowerModeDCDCRegulatorConfig(base, &config->DCDCOption); -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - if (status == kStatus_Success) - { - if (bandgapConfigured == false) - { - status = SPC_SetLowPowerModeBandgapmodeConfig(base, config->bandgapMode); - } - if (status == kStatus_Success) - { -#if (defined(FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) - SPC_EnableLowPowerModeCMPBandgapBufferMode(base, config->lpBuff); -#endif /* FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT */ - SPC_EnableLowPowerModeLowPowerIREF(base, config->lpIREF); -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT) - SPC_EnableLowPowerModeCoreVDDInternalVoltageScaling(base, config->CoreIVS); -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT */ - } - } - } - } - - return status; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_spc.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_spc.h deleted file mode 100644 index 38ff988b329..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_spc.h +++ /dev/null @@ -1,2223 +0,0 @@ -/* - * Copyright 2022-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_SPC_H_ -#define FSL_SPC_H_ -#include "fsl_common.h" - -/*! - * @addtogroup mcx_spc - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief SPC driver version 2.2.1. */ -#define FSL_SPC_DRIVER_VERSION (MAKE_VERSION(2, 2, 1)) -/*@}*/ - -#define SPC_EVD_CFG_REG_EVDISO_SHIFT 0UL -#define SPC_EVD_CFG_REG_EVDLPISO_SHIFT 8UL -#define SPC_EVD_CFG_REG_EVDSTAT_SHIFT 16UL - -#define SPC_EVD_CFG_REG_EVDISO(x) ((uint32_t)(x) << SPC_EVD_CFG_REG_EVDISO_SHIFT) -#define SPC_EVD_CFG_REG_EVDLPISO(x) ((uint32_t)(x) << SPC_EVD_CFG_REG_EVDLPISO_SHIFT) -#define SPC_EVD_CFG_REG_EVDSTAT(x) ((uint32_t)(x) << SPC_EVD_CFG_REG_EVDSTAT_SHIFT) - -#if (defined(SPC_GLITCH_DETECT_SC_CNT_SELECT_MASK)) -#define VDD_CORE_GLITCH_DETECT_SC GLITCH_DETECT_SC -#define SPC_VDD_CORE_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG_MASK SPC_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG_MASK -#define SPC_VDD_CORE_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG SPC_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG -#define SPC_VDD_CORE_GLITCH_DETECT_SC_LOCK_MASK SPC_GLITCH_DETECT_SC_LOCK_MASK -#define SPC_VDD_CORE_GLITCH_DETECT_SC_CNT_SELECT_MASK SPC_GLITCH_DETECT_SC_CNT_SELECT_MASK -#define SPC_VDD_CORE_GLITCH_DETECT_SC_CNT_SELECT SPC_GLITCH_DETECT_SC_CNT_SELECT -#define SPC_VDD_CORE_GLITCH_DETECT_SC_RE_MASK SPC_GLITCH_DETECT_SC_RE_MASK -#define SPC_VDD_CORE_GLITCH_DETECT_SC_RE SPC_GLITCH_DETECT_SC_RE -#define SPC_VDD_CORE_GLITCH_DETECT_SC_TIMEOUT_MASK SPC_GLITCH_DETECT_SC_TIMEOUT_MASK -#define SPC_VDD_CORE_GLITCH_DETECT_SC_TIMEOUT SPC_GLITCH_DETECT_SC_TIMEOUT -#define SPC_VDD_CORE_GLITCH_DETECT_SC_IE_MASK SPC_GLITCH_DETECT_SC_IE_MASK -#define SPC_VDD_CORE_GLITCH_DETECT_SC_IE SPC_GLITCH_DETECT_SC_IE -#endif - -/*! - * @brief SPC status enumeration. - * - * @note Some device(such as MCXA family) do not equip DCDC or System LDO, please refer to the reference manual - * to check. - */ -enum -{ - kStatus_SPC_Busy = MAKE_STATUS(kStatusGroup_SPC, 0U), /*!< The SPC instance is busy executing any - type of power mode transition. */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - kStatus_SPC_DCDCLowDriveStrengthIgnore = MAKE_STATUS(kStatusGroup_SPC, 1U), /*!< DCDC Low drive strength setting be - ignored for LVD/HVD enabled. */ - kStatus_SPC_DCDCPulseRefreshModeIgnore = MAKE_STATUS(kStatusGroup_SPC, 2U), /*!< DCDC Pulse Refresh Mode drive - strength setting be ignored for LVD/HVD enabled. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - kStatus_SPC_SYSLDOOverDriveVoltageFail = MAKE_STATUS(kStatusGroup_SPC, 3U), /*!< SYS LDO regulate to Over drive - voltage failed for SYS LDO HVD must be disabled. */ - kStatus_SPC_SYSLDOLowDriveStrengthIgnore = MAKE_STATUS(kStatusGroup_SPC, 4U), /*!< SYS LDO Low driver strength - setting be ignored for LDO LVD/HVD enabled. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - kStatus_SPC_CORELDOLowDriveStrengthIgnore = MAKE_STATUS(kStatusGroup_SPC, 5U), /*!< CORE LDO Low driver strength - setting be ignored for LDO LVD/HVD enabled. */ - kStatus_SPC_CORELDOVoltageWrong = MAKE_STATUS(kStatusGroup_SPC, 7U), /*!< Core LDO voltage is wrong. */ - kStatus_SPC_CORELDOVoltageSetFail = MAKE_STATUS(kStatusGroup_SPC, 8U), /*!< Core LDO voltage set fail. */ - kStatus_SPC_BandgapModeWrong = MAKE_STATUS(kStatusGroup_SPC, 6U), /*!< Selected Bandgap Mode wrong. */ -}; - -/*! - * @brief Voltage Detect Status Flags. - */ -enum _spc_voltage_detect_flags -{ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) && FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) - kSPC_IOVDDHighVoltageDetectFlag = SPC_VD_STAT_IOVDD_HVDF_MASK, /*!< IO VDD High-Voltage detect flag. */ - kSPC_IOVDDLowVoltageDetectFlag = SPC_VD_STAT_IOVDD_LVDF_MASK, /*!< IO VDD Low-Voltage detect flag. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD */ - kSPC_SystemVDDHighVoltageDetectFlag = SPC_VD_STAT_SYSVDD_HVDF_MASK, /*!< System VDD High-Voltage detect flag. */ - kSPC_SystemVDDLowVoltageDetectFlag = SPC_VD_STAT_SYSVDD_LVDF_MASK, /*!< System VDD Low-Voltage detect flag. */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) - kSPC_CoreVDDHighVoltageDetectFlag = SPC_VD_STAT_COREVDD_HVDF_MASK, /*!< Core VDD High-Voltage detect flag. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD */ - kSPC_CoreVDDLowVoltageDetectFlag = SPC_VD_STAT_COREVDD_LVDF_MASK, /*!< Core VDD Low-Voltage detect flag. */ -}; - -/*! - * @brief SPC power domain isolation status. - * @note Some devices(such as MCXA family) do not contain WAKE Power Domain, please refer to the reference manual to - * check. - */ -enum _spc_power_domains -{ - kSPC_MAINPowerDomainRetain = 1UL << 16U, /*!< Peripherals and IO pads retain in MAIN Power Domain. */ - kSPC_WAKEPowerDomainRetain = 1UL << 17U, /*!< Peripherals and IO pads retain in WAKE Power Domain. */ -}; - -/*! - * @brief The enumeration of all analog module that can be controlled by SPC in active or low-power modes. - * @anchor spc_analog_module_control - */ -enum _spc_analog_module_control -{ - kSPC_controlVref = 1UL << 0UL, /*!< Enable/disable VREF in active or low-power modes. */ - kSPC_controlUsb3vDet = 1UL << 1UL, /*!< Enable/disable USB3V_Det in active or low-power modes. */ - kSPC_controlDac0 = 1UL << 4UL, /*!< Enable/disable DAC0 in active or low-power modes. */ - kSPC_controlDac1 = 1UL << 5UL, /*!< Enable/disable DAC1 in active or low-power modes. */ - kSPC_controlDac2 = 1UL << 6UL, /*!< Enable/disable DAC2 in active or low-power modes. */ - kSPC_controlOpamp0 = 1UL << 8UL, /*!< Enable/disable OPAMP0 in active or low-power modes. */ - kSPC_controlOpamp1 = 1UL << 9UL, /*!< Enable/disable OPAMP1 in active or low-power modes. */ - kSPC_controlOpamp2 = 1UL << 10UL, /*!< Enable/disable OPAMP2 in active or low-power modes. */ - kSPC_controlCmp0 = 1UL << 16UL, /*!< Enable/disable CMP0 in active or low-power modes. */ - kSPC_controlCmp1 = 1UL << 17UL, /*!< Enable/disable CMP1 in active or low-power modes. */ - kSPC_controlCmp2 = 1UL << 18UL, /*!< Enable/disable CMP2 in active or low-power modes. */ - kSPC_controlCmp0Dac = 1UL << 20UL, /*!< Enable/disable CMP0_DAC in active or low-power modes. */ - kSPC_controlCmp1Dac = 1UL << 21UL, /*!< Enable/disable CMP1_DAC in active or low-power modes. */ - kSPC_controlCmp2Dac = 1UL << 22UL, /*!< Enable/disable CMP2_DAC in active or low-power modes. */ - kSPC_controlAllModules = 0x770773UL, /*!< Enable/disable all modules in active or low-power modes. */ -}; - -/*! - * @brief The enumeration of spc power domain, the connected power domain is chip specfic, please refer to chip's RM - * for details. - */ -typedef enum _spc_power_domain_id -{ - kSPC_PowerDomain0 = 0U, /*!< Power domain0, the connected power domain is chip specific. */ - kSPC_PowerDomain1 = 1U, /*!< Power domain1, the connected power domain is chip specific. */ -} spc_power_domain_id_t; - -/*! - * @brief The enumeration of Power domain's low power mode. - */ -typedef enum _spc_power_domain_low_power_mode -{ - kSPC_SleepWithSYSClockRunning = 0U, /*!< Power domain request SLEEP mode with SYS clock running. */ - kSPC_DeepSleepWithSysClockOff = 1U, /*!< Power domain request deep sleep mode with system clock off. */ - kSPC_PowerDownWithSysClockOff = 2U, /*!< Power domain request power down mode with system clock off. */ - kSPC_DeepPowerDownWithSysClockOff = 4U, /*!< Power domain request deep power down mode with system clock off. */ -} spc_power_domain_low_power_mode_t; - -/*! - * @brief SPC low power request output pin polarity. - */ -typedef enum _spc_lowPower_request_pin_polarity -{ - kSPC_HighTruePolarity = 0x0U, /*!< Control the High Polarity of the Low Power Reqest Pin. */ - kSPC_LowTruePolarity = 0x1U, /*!< Control the Low Polarity of the Low Power Reqest Pin. */ -} spc_lowpower_request_pin_polarity_t; - -/*! - * @brief SPC low power request output override. - */ -typedef enum _spc_lowPower_request_output_override -{ - kSPC_LowPowerRequestNotForced = 0x0U, /*!< Not Forced. */ - kSPC_LowPowerRequestReserved = 0x1U, /*!< Reserved. */ - kSPC_LowPowerRequestForcedLow = 0x2U, /*!< Forced Low (Ignore LowPower request output polarity setting.) */ - kSPC_LowPowerRequestForcedHigh = 0x3U, /*!< Forced High (Ignore LowPower request output polarity setting.) */ -} spc_lowpower_request_output_override_t; - -/*! - * @brief SPC Bandgap mode enumeration in Active mode or Low Power mode. - */ -typedef enum _spc_bandgap_mode -{ - kSPC_BandgapDisabled = 0x0U, /*!< Bandgap disabled. */ - kSPC_BandgapEnabledBufferDisabled = 0x1U, /*!< Bandgap enabled with Buffer disabled. */ - kSPC_BandgapEnabledBufferEnabled = 0x2U, /*!< Bandgap enabled with Buffer enabled. */ - kSPC_BandgapReserved = 0x3U, /*!< Reserved. */ -} spc_bandgap_mode_t; - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) -/*! - * @brief DCDC regulator voltage level enumeration in Active mode or Low Power Mode. - */ -typedef enum _spc_dcdc_voltage_level -{ - kSPC_DCDC_MidVoltage = 0x1U, /*!< DCDC VDD Regulator regulate to Mid Voltage(1.0V). */ - kSPC_DCDC_NormalVoltage = 0x2U, /*!< DCDC VDD Regulator regulate to Normal Voltage(1.1V). */ - kSPC_DCDC_OverdriveVoltage = 0x3U, /*!< DCDC VDD Regulator regulate to Safe-Mode Voltage(1.2V). */ -} spc_dcdc_voltage_level_t; - -/*! - * @brief DCDC regulator Drive Strength enumeration in Active mode or Low Power Mode. - */ -typedef enum _spc_dcdc_drive_strength -{ - kSPC_DCDC_PulseRefreshMode = 0x0U, /*!< DCDC VDD Regulator Drive Strength set to Pulse Refresh Mode, - * This enum member is only useful for Low Power Mode config, please - * note that pluse refresh mode is invalid in SLEEP mode. - */ - kSPC_DCDC_LowDriveStrength = 0x1U, /*!< DCDC VDD regulator Drive Strength set to low. */ - kSPC_DCDC_NormalDriveStrength = 0x2U, /*!< DCDC VDD regulator Drive Strength set to Normal. */ -} spc_dcdc_drive_strength_t; -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) -/*! - * @brief SYS LDO regulator voltage level enumeration in Active mode. - */ -typedef enum _spc_sys_ldo_voltage_level -{ - kSPC_SysLDO_NormalVoltage = 0x0U, /*!< SYS LDO VDD Regulator regulate to Normal Voltage(1.8V). */ - kSPC_SysLDO_OverDriveVoltage = 0x1U, /*!< SYS LDO VDD Regulator regulate to Over Drive Voltage(2.5V). */ -} spc_sys_ldo_voltage_level_t; - -/*! - * @brief SYS LDO regulator Drive Strength enumeration in Active mode or Low Power mode. - */ -typedef enum _spc_sys_ldo_drive_strength -{ - kSPC_SysLDO_LowDriveStrength = 0x0U, /*!< SYS LDO VDD regulator Drive Strength set to low. */ - kSPC_SysLDO_NormalDriveStrength = 0x1U, /*!< SYS LDO VDD regulator Drive Strength set to Normal. */ -} spc_sys_ldo_drive_strength_t; -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -/*! - * @brief Core LDO regulator voltage level enumeration in Active mode or Low Power mode. - */ -typedef enum _spc_core_ldo_voltage_level -{ - kSPC_CoreLDO_UnderDriveVoltage = 0x0U, /*!< Core LDO VDD regulator regulate to Under Drive Voltage, please note that - underDrive voltage only useful in low power modes. */ - kSPC_CoreLDO_MidDriveVoltage = 0x1U, /*!< Core LDO VDD regulator regulate to Mid Drive Voltage. */ - kSPC_CoreLDO_NormalVoltage = 0x2U, /*!< Core LDO VDD regulator regulate to Normal Voltage. */ - kSPC_CoreLDO_OverDriveVoltage = 0x3U, /*!< Core LDO VDD regulator regulate to overdrive Voltage. */ -} spc_core_ldo_voltage_level_t; - -/*! - * @brief CORE LDO VDD regulator Drive Strength enumeration in Low Power mode. - */ -typedef enum _spc_core_ldo_drive_strength -{ - kSPC_CoreLDO_LowDriveStrength = 0x0U, /*!< Core LDO VDD regulator Drive Strength set to low. */ - kSPC_CoreLDO_NormalDriveStrength = 0x1U, /*!< Core LDO VDD regulator Drive Strength set to Normal. */ -} spc_core_ldo_drive_strength_t; - -/*! - * @brief System/IO VDD Low-Voltage Level Select. - */ -typedef enum _spc_low_voltage_level_select -{ - kSPC_LowVoltageNormalLevel = 0x0U, /*!< Trip point set to Normal level. */ - kSPC_LowVoltageSafeLevel = 0x1U, /*!< Trip point set to Safe level. */ -} spc_low_voltage_level_select_t; - -/*! - * @brief Used to select output of 4-bit ripple counter is used to monitor a glitch on VDD core. - */ -typedef enum _spc_vdd_core_glitch_ripple_counter_select -{ - kSPC_selectBit0Of4bitRippleCounter = 0x0U, /*!< Select bit-0 of 4-bit Ripple Counter - to detect glitch on VDD Core. */ - kSPC_selectBit1Of4bitRippleCounter = 0x1U, /*!< Select bit-1 of 4-bit Ripple Counter - to detect glitch on VDD Core. */ - kSPC_selectBit2Of4bitRippleCounter = 0x2U, /*!< Select bit-2 of 4-bit Ripple Counter - to detect glitch on VDD Core. */ - kSPC_selectBit3Of4bitRippleCounter = 0x3U, /*!< Select bit-3 of 4-bit Ripple Counter - to detect glitch on VDD Core. */ -} spc_vdd_core_glitch_ripple_counter_select_t; - -/*! - * @brief The list of the operating voltage for the SRAM's read/write timing margin. - */ -typedef enum _spc_sram_operate_voltage -{ - kSPC_sramOperateAt1P0V = 0x1U, /*!< SRAM configured for 1.0V operation. */ - kSPC_sramOperateAt1P1V = 0x2U, /*!< SRAM configured for 1.1V operation. */ - kSPC_sramOperateAt1P2V = 0x3U, /*!< SRAM configured for 1.2V operation. */ -} spc_sram_operate_voltage_t; - -/*! - * @brief The configuration of VDD Core glitch detector. - */ -typedef struct _spc_vdd_core_glitch_detector_config -{ - spc_vdd_core_glitch_ripple_counter_select_t rippleCounterSelect; /*!< Used to set ripple counter. */ - uint8_t resetTimeoutValue; /*!< The timeout value used to reset glitch detect/compare logic after an initial - glitch is detected. */ - bool enableReset; /*!< Used to enable/disable POR/LVD reset that caused by CORE VDD glitch detect error. */ - bool enableInterrupt; /*!< Used to enable/disable hardware interrupt if CORE VDD glitch detect error. */ -} spc_vdd_core_glitch_detector_config_t; - -typedef struct _spc_sram_voltage_config -{ - spc_sram_operate_voltage_t operateVoltage; /*!< Specifies the operating voltage for the SRAM's - read/write timing margin. */ - bool requestVoltageUpdate; /*!< Used to control whether request an SRAM trim value change. */ -} spc_sram_voltage_config_t; - -/*! - * @brief Low Power Request output pin configuration. - */ -typedef struct _spc_lowpower_request_config -{ - bool enable; /*!< Low Power Request Output enable. */ - spc_lowpower_request_pin_polarity_t polarity; /*!< Low Power Request Output pin polarity select. */ - spc_lowpower_request_output_override_t override; /*!< Low Power Request Output Override. */ -} spc_lowpower_request_config_t; - -/*! - * @brief Core LDO regulator options in Active mode. - */ -typedef struct _spc_active_mode_core_ldo_option -{ - spc_core_ldo_voltage_level_t CoreLDOVoltage; /*!< Core LDO Regulator Voltage Level selection in Active mode. */ -#if defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS - spc_core_ldo_drive_strength_t CoreLDODriveStrength; /*!< Core LDO Regulator Drive Strength - selection in Active mode */ -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ -} spc_active_mode_core_ldo_option_t; - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) -/*! - * @brief System LDO regulator options in Active mode. - */ -typedef struct _spc_active_mode_sys_ldo_option -{ - spc_sys_ldo_voltage_level_t SysLDOVoltage; /*!< System LDO Regulator Voltage Level selection in Active mode. */ - spc_sys_ldo_drive_strength_t SysLDODriveStrength; /*!< System LDO Regulator Drive Strength - selection in Active mode. */ -} spc_active_mode_sys_ldo_option_t; -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) -/*! - * @brief DCDC regulator options in Active mode. - */ -typedef struct _spc_active_mode_dcdc_option -{ - spc_dcdc_voltage_level_t DCDCVoltage; /*!< DCDC Regulator Voltage Level selection in Active mode. */ - spc_dcdc_drive_strength_t DCDCDriveStrength; /*!< DCDC VDD Regulator Drive Strength selection in Active mode. */ -} spc_active_mode_dcdc_option_t; -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -/*! - * @brief Core LDO regulator options in Low Power mode. - */ -typedef struct _spc_lowpower_mode_core_ldo_option -{ - spc_core_ldo_voltage_level_t CoreLDOVoltage; /*!< Core LDO Regulator Voltage Level selection in Low Power mode. */ - spc_core_ldo_drive_strength_t CoreLDODriveStrength; /*!< Core LDO Regulator Drive Strength - selection in Low Power mode */ -} spc_lowpower_mode_core_ldo_option_t; - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) -/*! - * @brief System LDO regulator options in Low Power mode. - */ -typedef struct _spc_lowpower_mode_sys_ldo_option -{ - spc_sys_ldo_drive_strength_t SysLDODriveStrength; /*!< System LDO Regulator Drive Strength - selection in Low Power mode. */ -} spc_lowpower_mode_sys_ldo_option_t; -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) -/*! - * @brief DCDC regulator options in Low Power mode. - */ -typedef struct _spc_lowpower_mode_dcdc_option -{ - spc_dcdc_voltage_level_t DCDCVoltage; /*!< DCDC Regulator Voltage Level selection in Low Power mode. */ - spc_dcdc_drive_strength_t DCDCDriveStrength; /*!< DCDC VDD Regulator Drive Strength selection in Low Power mode. */ -} spc_lowpower_mode_dcdc_option_t; - -/*! - * @brief DCDC Burst configuration. - */ -typedef struct _spc_dcdc_burst_config -{ - bool sofwareBurstRequest; /*!< Enable/Disable DCDC Software Burst Request. */ - bool externalBurstRequest; /*!< Enable/Disable DCDC External Burst Request. */ - bool stabilizeBurstFreq; /*!< Enable/Disable DCDC frequency stabilization. */ - uint8_t freq; /*!< The frequency of the current burst. */ -} spc_dcdc_burst_config_t; -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -/*! - * @brief CORE/SYS/IO VDD Voltage Detect options. - */ -typedef struct _spc_voltage_detect_option -{ - bool HVDInterruptEnable; /*!< CORE/SYS/IO VDD High Voltage Detect interrupt enable. */ - bool HVDResetEnable; /*!< CORE/SYS/IO VDD High Voltage Detect reset enable. */ - bool LVDInterruptEnable; /*!< CORE/SYS/IO VDD Low Voltage Detect interrupt enable. */ - bool LVDResetEnable; /*!< CORE/SYS/IO VDD Low Voltage Detect reset enable. */ -} spc_voltage_detect_option_t; - -/*! - * @brief Core Voltage Detect configuration. - */ -typedef struct _spc_core_voltage_detect_config -{ - spc_voltage_detect_option_t option; /*!< Core VDD Voltage Detect option. */ -} spc_core_voltage_detect_config_t; - -/*! - * @brief System Voltage Detect Configuration. - */ -typedef struct _spc_system_voltage_detect_config -{ - spc_voltage_detect_option_t option; /*!< System VDD Voltage Detect option. */ - spc_low_voltage_level_select_t level; /*!< System VDD low-voltage selection. */ -} spc_system_voltage_detect_config_t; - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) && FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) -/*! - * @brief IO Voltage Detect Configuration. - */ -typedef struct _spc_io_voltage_detect_config -{ - spc_voltage_detect_option_t option; /*!< IO VDD Voltage Detect option. */ - spc_low_voltage_level_select_t level; /*!< IO VDD Low-voltage level selection. */ -} spc_io_voltage_detect_config_t; -#endif /* FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD */ - -/*! - * @brief Active mode configuration. - */ -typedef struct _spc_active_mode_regulators_config -{ - spc_bandgap_mode_t bandgapMode; /*!< Specify bandgap mode in active mode. */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) - bool lpBuff; /*!< Enable/disable CMP bandgap buffer. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - spc_active_mode_dcdc_option_t DCDCOption; /*!< Specify DCDC configurations in active mode. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - spc_active_mode_sys_ldo_option_t SysLDOOption; /*!< Specify System LDO configurations in active mode. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - - spc_active_mode_core_ldo_option_t CoreLDOOption; /*!< Specify Core LDO configurations in active mode. */ -} spc_active_mode_regulators_config_t; - -/*! - * @brief Low Power Mode configuration. - */ -typedef struct _spc_lowpower_mode_regulators_config -{ - bool lpIREF; /*!< Enable/disable low power IREF in low power modes. */ - spc_bandgap_mode_t bandgapMode; /*!< Specify bandgap mode in low power modes. */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) - bool lpBuff; /*!< Enable/disable CMP bandgap buffer in low power modes. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT) - bool CoreIVS; /*!< Enable/disable CORE VDD internal voltage scaling. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - spc_lowpower_mode_dcdc_option_t DCDCOption; /*!< Specify DCDC configurations in low power modes. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - spc_lowpower_mode_sys_ldo_option_t SysLDOOption; /*!< Specify system LDO configurations in low power modes. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - - spc_lowpower_mode_core_ldo_option_t CoreLDOOption; /*!< Specify core LDO configurations in low power modes. */ -} spc_lowpower_mode_regulators_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name SPC Status - * @{ - */ -/*! - * @brief Gets Isolation status for each power domains. - * - * This function gets the status which indicates whether certain - * peripheral and the IO pads are in a latched state as a result - * of having been in POWERDOWN mode. - * - * @param base SPC peripheral base address. - * @return Current isolation status for each power domains. See @ref _spc_power_domains for details. - */ -uint8_t SPC_GetPeriphIOIsolationStatus(SPC_Type *base); - -/*! - * @brief Clears peripherals and I/O pads isolation flags for each power domains. - * - * This function clears peripherals and I/O pads isolation flags for each power domains. - * After recovering from the POWERDOWN mode, user must invoke this function to release the - * I/O pads and certain peripherals to their normal run mode state. Before invoking this - * function, user must restore chip configuration in particular pin configuration for enabled - * WUU wakeup pins. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_ClearPeriphIOIsolationFlag(SPC_Type *base) -{ - base->SC |= SPC_SC_ISO_CLR_MASK; -} - -/*! - * @brief Gets SPC busy status flag. - * - * This function gets SPC busy status flag. When SPC executing any type of power mode - * transition in ACTIVE mode or any of the SOC low power mode, the SPC busy status flag is set - * and this function returns true. When changing CORE LDO voltage level and DCDC voltage level - * in ACTIVE mode, the SPC busy status flag is set and this function return true. - * - * @param base SPC peripheral base address. - * @return Ack busy flag. - * true - SPC is busy. - * false - SPC is not busy. - */ -static inline bool SPC_GetBusyStatusFlag(SPC_Type *base) -{ - return ((base->SC & SPC_SC_BUSY_MASK) != 0UL); -} - -/*! - * @brief Checks system low power request. - * - * @note Only when all power domains request low power mode entry, the result of this function is true. That means when - * all power domains request low power mode entry, the SPC regulators will be controlled by LP_CFG register. - * - * @param base SPC peripheral base address. - * @return The system low power request check result. - * - \b true All power domains have requested low power mode and SPC has entered a low power state and power mode - * configuration are based on the LP_CFG configuration register. - * - \b false SPC in active mode and ACTIVE_CFG register control system power supply. - */ -static inline bool SPC_CheckLowPowerReqest(SPC_Type *base) -{ - return ((base->SC & SPC_SC_SPC_LP_REQ_MASK) == SPC_SC_SPC_LP_REQ_MASK); -} - -/*! - * @brief Clears system low power request, set SPC in active mode. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_ClearLowPowerRequest(SPC_Type *base) -{ - base->SC |= SPC_SC_SPC_LP_REQ_MASK; -} - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SWITCH_STATE_BIT) && FSL_FEATURE_MCX_SPC_HAS_SWITCH_STATE_BIT) -/*! - * @brief Checks whether the power switch is on. - * - * @param base SPC peripheral base address. - * - * @retval true The power switch is on. - * @retval false The power switch is off. - */ -static inline bool SPC_CheckSwitchState(SPC_Type *base) -{ - return ((base->SC & SPC_SC_SWITCH_STATE_MASK) != 0UL); -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_SWITCH_STATE_BIT */ - -/*! - * @brief Gets selected power domain's requested low power mode. - * - * @param base SPC peripheral base address. - * @param powerDomainId Power Domain Id, please refer to @ref spc_power_domain_id_t. - * - * @return The selected power domain's requested low power mode, please refer to @ref spc_power_domain_low_power_mode_t. - */ -spc_power_domain_low_power_mode_t SPC_GetPowerDomainLowPowerMode(SPC_Type *base, spc_power_domain_id_t powerDomainId); - -/*! - * @brief Checks power domain's low power request. - * - * @param base SPC peripheral base address. - * @param powerDomainId Power Domain Id, please refer to @ref spc_power_domain_id_t. - * @return The result of power domain's low power request. - * - \b true The selected power domain requests low power mode entry. - * - \b false The selected power domain does not request low power mode entry. - */ -static inline bool SPC_CheckPowerDomainLowPowerRequest(SPC_Type *base, spc_power_domain_id_t powerDomainId) -{ - assert((uint8_t)powerDomainId < SPC_PD_STATUS_COUNT); - return ((base->PD_STATUS[(uint8_t)powerDomainId] & SPC_PD_STATUS_PWR_REQ_STATUS_MASK) == - SPC_PD_STATUS_PWR_REQ_STATUS_MASK); -} - -/*! - * @brief Clears selected power domain's low power request flag. - * - * @param base SPC peripheral base address. - * @param powerDomainId Power Domain Id, please refer to @ref spc_power_domain_id_t. - */ -static inline void SPC_ClearPowerDomainLowPowerRequestFlag(SPC_Type *base, spc_power_domain_id_t powerDomainId) -{ - assert((uint8_t)powerDomainId < SPC_PD_STATUS_COUNT); - base->PD_STATUS[(uint8_t)powerDomainId] |= SPC_PD_STATUS_PD_LP_REQ_MASK; -} - -/* @} */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SRAMRETLDO_REG) && FSL_FEATURE_MCX_SPC_HAS_SRAMRETLDO_REG) -/*! - * @name SRAM Retention LDO Control APIs - * @{ - */ - -/*! - * @brief Trims SRAM retention regulator reference voltage, trim step is 12 mV, range is around 0.48V to 0.85V. - * - * @param base SPC peripheral base address. - * @param trimValue Reference voltage trim value. - */ -static inline void SPC_TrimSRAMLdoRefVoltage(SPC_Type *base, uint8_t trimValue) -{ - base->SRAMRETLDO_REFTRIM = ((base->SRAMRETLDO_REFTRIM & ~SPC_SRAMRETLDO_REFTRIM_REFTRIM_MASK) | SPC_SRAMRETLDO_REFTRIM_REFTRIM(trimValue)); -} - -/*! - * @brief Enables/disables SRAM retention LDO. - * - * @param base SPC peripheral base address. - * @param enable Used to enable/disable SRAM LDO : - * - \b true Enable SRAM LDO; - * - \b false Disable SRAM LDO. - */ -static inline void SPC_EnableSRAMLdo(SPC_Type *base, bool enable) -{ - if (enable) - { - base->SRAMRETLDO_CNTRL |= SPC_SRAMRETLDO_CNTRL_SRAMLDO_ON_MASK; - } - else - { - base->SRAMRETLDO_CNTRL &= ~SPC_SRAMRETLDO_CNTRL_SRAMLDO_ON_MASK; - } -} - -/*! - * @brief - * - * @todo Need to check. - * - * @param base SPC peripheral base address. - * @param mask The OR'ed value of SRAM Array. - */ -static inline void SPC_RetainSRAMArray(SPC_Type *base, uint8_t mask) -{ - base->SRAMRETLDO_CNTRL |= SPC_SRAMRETLDO_CNTRL_SRAM_RET_EN(mask); -} - -/* @} */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_SRAMRETLDO_REG */ - -/*! - * @name Low Power Request configuration - * @{ - */ -/*! - * @brief Configs Low power request output pin. - * - * This function config the low power request output pin - * - * @param base SPC peripheral base address. - * @param config Pointer the @ref spc_lowpower_request_config_t structure. - */ -void SPC_SetLowPowerRequestConfig(SPC_Type *base, const spc_lowpower_request_config_t *config); - -/* @} */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_CFG_REG) && FSL_FEATURE_MCX_SPC_HAS_CFG_REG) -/*! - * @name Integrated Power Switch Control APIs - * @{ - */ - -/*! - * @brief Enables/disables the integrated power switch manually. - * - * @param base SPC peripheral base address. - * @param enable Used to enable/disable the integrated power switch: - * - \b true Enable the integrated power switch; - * - \b false Disable the integrated power switch. - */ -static inline void SPC_EnableIntegratedPowerSwitchManually(SPC_Type *base, bool enable) -{ - if (enable) - { - base->CFG |= (SPC_CFG_INTG_PWSWTCH_SLEEP_ACTIVE_EN_MASK | SPC_CFG_INTG_PWSWTCH_WKUP_ACTIVE_EN_MASK); - } - else - { - base->CFG &= ~(SPC_CFG_INTG_PWSWTCH_SLEEP_ACTIVE_EN_MASK | SPC_CFG_INTG_PWSWTCH_WKUP_ACTIVE_EN_MASK); - } -} - -/*! - * @brief Enables/disables the integrated power switch automatically. - * - * To gate the integrated power switch when chip enter low power modes, and ungate the switch after wake-up from low - * power modes: - * @code - * SPC_EnableIntegratedPowerSwitchAutomatically(SPC, true, true); - * @endcode - * - * @param base SPC peripheral base address. - * @param sleepGate Enable the integrated power switch when chip enter low power modes: - * - \b true SPC asserts an output pin at low-power entry to power-gate the switch; - * - \b false SPC does not assert an output pin at low-power entry to power-gate the switch. - * @param wakeupUngate Enables the switch after wake-up from low power modes: - * - \b true SPC asserts an output pin at low-power exit to power-ungate the switch; - * - \b false SPC does not assert an output pin at low-power exit to power-ungate the switch. - */ -static inline void SPC_EnableIntegratedPowerSwitchAutomatically(SPC_Type *base, bool sleepGate, bool wakeupUngate) -{ - uint32_t tmp32 = ((base->CFG) & ~(SPC_CFG_INTG_PWSWTCH_SLEEP_EN_MASK | SPC_CFG_INTG_PWSWTCH_WKUP_EN_MASK)); - - tmp32 |= SPC_CFG_INTG_PWSWTCH_SLEEP_EN(sleepGate) | SPC_CFG_INTG_PWSWTCH_WKUP_EN(wakeupUngate); - - base->CFG = tmp32; -} - -/* @} */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_CFG_REG */ - -/*! - * @name VDD Core Glitch Detector Control APIs - * @{ - */ - -/*! - * @brief Configures VDD Core Glitch detector, including ripple counter selection, timeout value and so on. - * - * @param base SPC peripheral base address. - * @param config Pointer to the structure in type of @ref spc_vdd_core_glitch_detector_config_t. - */ -void SPC_ConfigVddCoreGlitchDetector(SPC_Type *base, const spc_vdd_core_glitch_detector_config_t *config); - -/*! - * @brief Checks selected 4-bit glitch ripple counter's output. - * - * @param base SPC peripheral base address. - * @param rippleCounter The ripple counter to check, please refer to @ref spc_vdd_core_glitch_ripple_counter_select_t. - * - * @retval true The selected ripple counter output is 1, will generate interrupt or reset based on settings. - * @retval false The selected ripple counter output is 0. - */ - -static inline bool SPC_CheckGlitchRippleCounterOutput(SPC_Type *base, - spc_vdd_core_glitch_ripple_counter_select_t rippleCounter) -{ - return ((base->VDD_CORE_GLITCH_DETECT_SC & SPC_VDD_CORE_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG_MASK) == - SPC_VDD_CORE_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG(1UL << (uint32_t)(rippleCounter))); -} - -/*! - * @brief Clears output of selected glitch ripple counter. - * - * @param base SPC peripheral base address. - * @param rippleCounter The ripple counter to check, please refer to @ref spc_vdd_core_glitch_ripple_counter_select_t. - */ -static inline void SPC_ClearGlitchRippleCounterOutput(SPC_Type *base, - spc_vdd_core_glitch_ripple_counter_select_t rippleCounter) -{ - base->VDD_CORE_GLITCH_DETECT_SC |= - SPC_VDD_CORE_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG(1UL << (uint32_t)(rippleCounter)); -} - -/*! - * @brief After invoking this function, writes to SPC_VDD_CORE_GLITCH_DETECT_SC[RE] register are ignored. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_LockVddCoreVoltageGlitchDetectResetControl(SPC_Type *base) -{ - base->VDD_CORE_GLITCH_DETECT_SC |= SPC_VDD_CORE_GLITCH_DETECT_SC_LOCK_MASK; -} - -/*! - * @brief After invoking this function, writes to SPC_VDD_CORE_GLITCH_DETECT_SC[RE] register are allowed. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_UnlockVddCoreVoltageGlitchDetectResetControl(SPC_Type *base) -{ - base->VDD_CORE_GLITCH_DETECT_SC &= ~SPC_VDD_CORE_GLITCH_DETECT_SC_LOCK_MASK; -} - -/*! - * @brief Checks if SPC_VDD_CORE_GLITCH_DETECT_SC[RE] register is writable. - * - * @param base SPC peripheral base address. - * - * @retval true SPC_VDD_CORE_GLITCH_DETECT_SC[RE] register is writable. - * @retval false SPC_VDD_CORE_GLITCH_DETECT_SC[RE] register is not writable. - */ -static inline bool SPC_CheckVddCoreVoltageGlitchResetControlState(SPC_Type *base) -{ - return ((base->VDD_CORE_GLITCH_DETECT_SC & SPC_VDD_CORE_GLITCH_DETECT_SC_LOCK_MASK) != 0UL); -} - -/* @} */ - -/*! - * @name SRAM Control APIs - * @{ - */ - -/*! - * @brief Set SRAM operate voltage. - * - * @param base SPC peripheral base address. - * @param config The pointer to @ref spc_sram_voltage_config_t, specifies the configuration of sram voltage. - */ -void SPC_SetSRAMOperateVoltage(SPC_Type *base, const spc_sram_voltage_config_t *config); - -/* @} */ - -/*! - * @name Active Mode configuration - * @{ - */ - -/*! - * @brief Gets the Bandgap mode in Active mode. - * - * @param base SPC peripheral base address. - * @return Bandgap mode in the type of @ref spc_bandgap_mode_t enumeration. - */ -static inline spc_bandgap_mode_t SPC_GetActiveModeBandgapMode(SPC_Type *base) -{ - return (spc_bandgap_mode_t)(uint32_t)((base->ACTIVE_CFG & SPC_ACTIVE_CFG_BGMODE_MASK) >> - SPC_ACTIVE_CFG_BGMODE_SHIFT); -} - -/*! - * @brief Gets all voltage detectors status in Active mode. - * - * @param base SPC peripheral base address. - * @return All voltage detectors status in Active mode. - */ -static inline uint32_t SPC_GetActiveModeVoltageDetectStatus(SPC_Type *base) -{ - uint32_t state; - state = base->ACTIVE_CFG & - ( -#if (defined(FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) && FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) - SPC_ACTIVE_CFG_IO_HVDE_MASK | SPC_ACTIVE_CFG_IO_LVDE_MASK | \ - -#endif /* FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD */ - SPC_ACTIVE_CFG_SYS_HVDE_MASK | SPC_ACTIVE_CFG_SYS_LVDE_MASK | SPC_ACTIVE_CFG_CORE_LVDE_MASK \ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) - | SPC_ACTIVE_CFG_CORE_HVDE_MASK \ - -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD */ - ); - return state; -} - -/*! - * @brief Configs Bandgap mode in Active mode. - * - * @note In active mode, beacause CORELDO_VDD_DS is reserved and set to Normal, so it is impossible to - * disable Bandgap in active mode - * - * @param base SPC peripheral base address. - * @param mode The Bandgap mode be selected. - * - * @retval #kStatus_SPC_BandgapModeWrong The Bandgap can not be disabled in active mode. - * @retval #kStatus_Success Config Bandgap mode in Active power mode successful. - */ -status_t SPC_SetActiveModeBandgapModeConfig(SPC_Type *base, spc_bandgap_mode_t mode); - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) -/*! - * @brief Enables/Disable the CMP Bandgap Buffer in Active mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable CMP Bandgap buffer. - * true - Enable Buffer Stored Reference voltage to CMP. - * false - Disable Buffer Stored Reference voltage to CMP. - */ -static inline void SPC_EnableActiveModeCMPBandgapBuffer(SPC_Type *base, bool enable) -{ - if (enable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_LPBUFF_EN_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_LPBUFF_EN_MASK; - } -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT */ - -/*! - * @brief Sets the delay when the regulators change voltage level in Active mode. - * - * @param base SPC peripheral base address. - * @param delay The number of SPC timer clock cycles. - */ -static inline void SPC_SetActiveModeVoltageTrimDelay(SPC_Type *base, uint16_t delay) -{ - base->ACTIVE_VDELAY = SPC_ACTIVE_VDELAY_ACTIVE_VDELAY(delay); -} - -/*! - * @brief Configs regulators in Active mode. - * - * This function provides the method to config all on-chip regulators in active mode. - * - * @param base SPC peripheral base address. - * @param config Pointer to spc_active_mode_regulators_config_t structure. - * @retval #kStatus_Success Config regulators in Active power mode successful. - * @retval #kStatus_SPC_BandgapModeWrong The bandgap mode setting in Active mode is wrong. - * @retval #kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * @retval #kStatus_SPC_CORELDOVoltageWrong The selected voltage level in active mode is not allowed. - * @retval #kStatus_SPC_SYSLDOOverDriveVoltageFail Fail to regulator to Over Drive Voltage. - * @retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Set driver strength to Low will be ignored. - * @retval #kStatus_SPC_DCDCLowDriveStrengthIgnore Set driver strength to Low will be ignored. - */ -status_t SPC_SetActiveModeRegulatorsConfig(SPC_Type *base, const spc_active_mode_regulators_config_t *config); - -/*! - * @brief Disables/Enables VDD Core Glitch Detect in Active mode. - * - * @note State of glitch detect disable feature will be ignored if bandgap is disabled and - * glitch detect hardware will be forced to OFF state. - * - * @param base SPC peripheral base address. - * @param disable Used to disable/enable VDD Core Glitch detect feature. - * - \b true Disable VDD Core Low Voltage detect; - * - \b false Enable VDD Core Low Voltage detect. - */ -static inline void SPC_DisableActiveModeVddCoreGlitchDetect(SPC_Type *base, bool disable) -{ - if (disable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE_MASK; - } -} - -/*! - * @brief Enables analog modules in active mode. - * - * @param base SPC peripheral base address. - * @param maskValue The mask of analog modules to enable in active mode, should be the OR'ed value - * of @ref spc_analog_module_control. - */ -static inline void SPC_EnableActiveModeAnalogModules(SPC_Type *base, uint32_t maskValue) -{ - base->ACTIVE_CFG1 |= SPC_ACTIVE_CFG1_SOC_CNTRL(maskValue); -} - -/*! - * @brief Disables analog modules in active mode. - * - * @param base SPC peripheral base address. - * @param maskValue The mask of analog modules to disable in active mode, should be the OR'ed value - * of @ref spc_analog_module_control. - */ -static inline void SPC_DisableActiveModeAnalogModules(SPC_Type *base, uint32_t maskValue) -{ - base->ACTIVE_CFG1 &= ~SPC_ACTIVE_CFG1_SOC_CNTRL(maskValue); -} - -/*! - * @brief Gets enabled analog modules that enabled in active mode. - * - * @param base SPC peripheral base address. - * - * @return The mask of enabled analog modules that enabled in active mode. - */ -static inline uint32_t SPC_GetActiveModeEnabledAnalogModules(SPC_Type *base) -{ - return base->ACTIVE_CFG1; -} - -/* @} */ - -/*! - * @name Low Power mode configuration - * @{ - */ - -/*! - * @brief Gets the Bandgap mode in Low Power mode. - * - * @param base SPC peripheral base address. - * @return Bandgap mode in the type of @ref spc_bandgap_mode_t enumeration. - */ -static inline spc_bandgap_mode_t SPC_GetLowPowerModeBandgapMode(SPC_Type *base) -{ - return (spc_bandgap_mode_t)(uint32_t)((base->LP_CFG & SPC_LP_CFG_BGMODE_MASK) >> SPC_LP_CFG_BGMODE_SHIFT); -} - -/*! - * @brief Gets the status of all voltage detectors in Low Power mode. - * - * @param base SPC peripheral base address. - * @return The status of all voltage detectors in low power mode. - */ -static inline uint32_t SPC_GetLowPowerModeVoltageDetectStatus(SPC_Type *base) -{ - uint32_t state; - state = base->LP_CFG & ( -#if (defined(FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) && FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) - SPC_LP_CFG_IO_HVDE_MASK | SPC_LP_CFG_IO_LVDE_MASK | \ - -#endif /* FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD */ - SPC_LP_CFG_SYS_HVDE_MASK | SPC_LP_CFG_SYS_LVDE_MASK | SPC_LP_CFG_CORE_LVDE_MASK \ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) - | SPC_LP_CFG_CORE_HVDE_MASK \ - -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD */ - ); - return state; -} - -/*! - * @brief Enables/Disables Low Power IREF in low power modes. - * - * This function enables/disables Low Power IREF. Low Power IREF can only get - * disabled in Deep power down mode. In other low power modes, the Low Power IREF - * is always enabled. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable Low Power IREF. - * true - Enable Low Power IREF for Low Power modes. - * false - Disable Low Power IREF for Deep Power Down mode. - */ -static inline void SPC_EnableLowPowerModeLowPowerIREF(SPC_Type *base, bool enable) -{ - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_LP_IREFEN_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_LP_IREFEN_MASK; - } -} - -/*! - * @brief Configs Bandgap mode in Low Power mode. - * - * This function configs Bandgap mode in Low Power mode. - * IF user want to disable Bandgap while keeping any of the Regulator in Normal Driver Strength - * or if any of the High voltage detectors/Low voltage detectors are kept enabled, the Bandgap mode - * will be set as Bandgap Enabled with Buffer Disabled. - * - * @note This API shall be invoked following set HVDs/LVDs and regulators' driver strength. - * - * @param base SPC peripheral base address. - * @param mode The Bandgap mode be selected. - * @retval #kStatus_SPC_BandgapModeWrong The bandgap mode setting in Low Power mode is wrong. - * @retval #kStatus_Success Config Bandgap mode in Low Power power mode successful. - */ -status_t SPC_SetLowPowerModeBandgapmodeConfig(SPC_Type *base, spc_bandgap_mode_t mode); - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SRAMLDO_DPD_ON_BIT) && FSL_FEATURE_MCX_SPC_HAS_SRAMLDO_DPD_ON_BIT) -/*! - * @brief Enables/disables SRAM_LDO deep power low power IREF. - * - * @param base SPC peripheral base address. - * @param enable Used to enable/disable low power IREF : - * - \b true: Low Power IREF is enabled ; - * - \b false: Low Power IREF is disabled for power saving. - */ -static inline void SPC_EnableSRAMLdOLowPowerModeIREF(SPC_Type *base, bool enable) -{ - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_SRAMLDO_DPD_ON_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_SRAMLDO_DPD_ON_MASK; - } -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_SRAMLDO_DPD_ON_BIT */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) -/*! - * @brief Enables/Disables CMP Bandgap Buffer. - * - * This function gates CMP bandgap buffer. CMP bandgap buffer is automatically disabled and turned off - * in Deep Power Down mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable CMP Bandgap buffer. - * true - Enable Buffer Stored Reference Voltage to CMP. - * false - Disable Buffer Stored Reference Voltage to CMP. - */ -static inline void SPC_EnableLowPowerModeCMPBandgapBufferMode(SPC_Type *base, bool enable) -{ - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_LPBUFF_EN_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_LPBUFF_EN_MASK; - } -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT) -/*! - * @brief Enables/Disables CORE VDD IVS(Internal Voltage Scaling) in power down modes. - * - * This function gates CORE VDD IVS. When enabled, the IVS regulator will scale the - * external input CORE VDD to a lower voltage level to reduce internal leakage. - * IVS is invalid in Sleep or Deep power down mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable IVS. - * true - enable CORE VDD IVS in Power Down mode. - * false - disable CORE VDD IVS in Power Down mode. - */ -static inline void SPC_EnableLowPowerModeCoreVDDInternalVoltageScaling(SPC_Type *base, bool enable) -{ - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_COREVDD_IVS_EN_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_COREVDD_IVS_EN_MASK; - } -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT */ - -/*! - * @brief Sets the delay when exit the low power modes. - * - * @param base SPC peripheral base address. - * @param delay The number of SPC timer clock cycles that the SPC waits on exit from low power modes. - */ -static inline void SPC_SetLowPowerWakeUpDelay(SPC_Type *base, uint16_t delay) -{ - base->LPWKUP_DELAY = SPC_LPWKUP_DELAY_LPWKUP_DELAY(delay); -} - -/*! - * @brief Configs regulators in Low Power mode. - * - * This function provides the method to config all on-chip regulators in Low Power mode. - * - * @param base SPC peripheral base address. - * @param config Pointer to spc_lowpower_mode_regulators_config_t structure. - * @retval #kStatus_Success Config regulators in Low power mode successful. - * @retval #kStatus_SPC_BandgapModeWrong The bandgap mode setting in Low Power mode is wrong. - * @retval #kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * @retval #kStatus_SPC_CORELDOVoltageWrong The selected voltage level is wrong. - * @retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore Set driver strength to low will be ignored. - * @retval #kStatus_SPC_CORELDOVoltageSetFail. Fail to change Core LDO voltage level. - * @retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Set driver strength to low will be ignored. - * @retval #kStatus_SPC_DCDCPulseRefreshModeIgnore Set driver strength to Pulse Refresh mode will be ignored. - * @retval #kStatus_SPC_DCDCLowDriveStrengthIgnore Set driver strength to Low Drive Strength will be ignored. - */ -status_t SPC_SetLowPowerModeRegulatorsConfig(SPC_Type *base, const spc_lowpower_mode_regulators_config_t *config); - -/*! - * @brief Disable/Enable VDD Core Glitch Detect in low power mode. - * - * @note State of glitch detect disable feature will be ignored if bandgap is disabled and - * glitch detect hardware will be forced to OFF state. - * - * @param base SPC peripheral base address. - * @param disable Used to disable/enable VDD Core Glitch detect feature. - * - \b true Disable VDD Core Low Voltage detect; - * - \b false Enable VDD Core Low Voltage detect. - */ -static inline void SPC_DisableLowPowerModeVddCoreGlitchDetect(SPC_Type *base, bool disable) -{ - if (disable) - { - base->LP_CFG |= SPC_LP_CFG_GLITCH_DETECT_DISABLE_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_GLITCH_DETECT_DISABLE_MASK; - } -} - -/*! - * @brief Enables analog modules in low power modes. - * - * @param base SPC peripheral base address. - * @param maskValue The mask of analog modules to enable in low power modes, should be OR'ed value - of @ref spc_analog_module_control. - */ -static inline void SPC_EnableLowPowerModeAnalogModules(SPC_Type *base, uint32_t maskValue) -{ - base->LP_CFG1 |= SPC_LP_CFG1_SOC_CNTRL(maskValue); -} - -/*! - * @brief Disables analog modules in low power modes. - * - * @param base SPC peripheral base address. - * @param maskValue The mask of analog modules to disable in low power modes, should be OR'ed value - of @ref spc_analog_module_control. - */ -static inline void SPC_DisableLowPowerModeAnalogModules(SPC_Type *base, uint32_t maskValue) -{ - base->LP_CFG1 &= ~SPC_LP_CFG1_SOC_CNTRL(maskValue); -} - -/*! - * @brief Gets enabled analog modules that enabled in low power modes. - * - * @param base SPC peripheral base address. - * - * @return The mask of enabled analog modules that enabled in low power modes. - */ -static inline uint32_t SPC_GetLowPowerModeEnabledAnalogModules(SPC_Type *base) -{ - return base->LP_CFG1; -} - -/* @} */ - -/*! - * @name Voltage Detect Status - * @{ - */ -/*! - * @brief Get Voltage Detect Status Flags. - * - * @param base SPC peripheral base address. - * @return Voltage Detect Status Flags. See @ref _spc_voltage_detect_flags for details. - */ -static inline uint8_t SPC_GetVoltageDetectStatusFlag(SPC_Type *base) -{ - return (uint8_t)(base->VD_STAT); -} - -/*! - * @brief Clear Voltage Detect Status Flags. - * - * @param base SPC peripheral base address. - * @param mask The mask of the voltage detect status flags. See @ref _spc_voltage_detect_flags for details. - */ -static inline void SPC_ClearVoltageDetectStatusFlag(SPC_Type *base, uint8_t mask) -{ - base->VD_STAT |= mask; -} - -/* @} */ - -/*! - * @name Voltage Detect configuration for Core voltage domain. - * @{ - */ - -/*! - * @brief Configs CORE voltage detect options. - * - * @note: Setting both the voltage detect interrupt and reset - * enable will cause interrupt to be generated on exit from reset. - * If those conditioned is not desired, interrupt/reset so only one is enabled. - * - * @param base SPC peripheral base address. - * @param config Pointer to spc_core_voltage_detect_config_t structure. - */ -void SPC_SetCoreVoltageDetectConfig(SPC_Type *base, const spc_core_voltage_detect_config_t *config); - -/*! - * @brief Locks Core voltage detect reset setting. - * - * This function locks core voltage detect reset setting. After invoking this function - * any configuration of Core voltage detect reset will be ignored. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_LockCoreVoltageDetectResetSetting(SPC_Type *base) -{ - base->VD_CORE_CFG |= SPC_VD_CORE_CFG_LOCK_MASK; -} - -/*! - * @brief Unlocks Core voltage detect reset setting. - * - * This function unlocks core voltage detect reset setting. If locks the Core - * voltage detect reset setting, invoking this function to unlock. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_UnlockCoreVoltageDetectResetSetting(SPC_Type *base) -{ - base->VD_CORE_CFG &= ~SPC_VD_CORE_CFG_LOCK_MASK; -} - -/*! - * @brief Enables/Disables the Core Low Voltage Detector in Active mode. - * - * @note If the CORE_LDO low voltage detect is enabled in Active mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable Core LVD. - * true - Enable Core Low voltage detector in active mode. - * false - Disable Core Low voltage detector in active mode. - * - * @retval #kStatus_Success Enable/Disable Core Low Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeCoreLowVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disables the Core Low Voltage Detector in Low Power mode. - * - * This function enables/disables the Core Low Voltage Detector. - * If enabled the Core Low Voltage detector. The Bandgap mode in - * low power mode must be programmed so that Bandgap is enabled. - * - * @note If the CORE_LDO low voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Low Power mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable Core HVD. - * true - Enable Core Low voltage detector in low power mode. - * false - Disable Core Low voltage detector in low power mode. - * - * @retval #kStatus_Success Enable/Disable Core Low Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeCoreLowVoltageDetect(SPC_Type *base, bool enable); - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) -/*! - * @brief Enables/Disables the Core High Voltage Detector in Active mode. - * - * @note If the CORE_LDO high voltage detect is enabled in Active mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable Core HVD. - * true - Enable Core High voltage detector in active mode. - * false - Disable Core High voltage detector in active mode. - * - * @retval #kStatus_Success Enable/Disable Core High Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeCoreHighVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disables the Core High Voltage Detector in Low Power mode. - * - * This function enables/disables the Core High Voltage Detector. - * If enabled the Core High Voltage detector. The Bandgap mode in - * low power mode must be programmed so that Bandgap is enabled. - * - * @note If the CORE_LDO high voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in low power mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable Core HVD. - * true - Enable Core High voltage detector in low power mode. - * false - Disable Core High voltage detector in low power mode. - * - * @retval #kStatus_Success Enable/Disable Core High Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeCoreHighVoltageDetect(SPC_Type *base, bool enable); -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD */ - -/* @} */ - -/*! - * @name Voltage detect configuration for System Voltage domain - * @{ - */ -/*! - * @brief Set system VDD Low-voltage level selection. - * - * This function selects the system VDD low-voltage level. Changing system VDD low-voltage level - * must be done after disabling the System VDD low voltage reset and interrupt. - * - * @param base SPC peripheral base address. - * @param level System VDD Low-Voltage level selection. - */ -void SPC_SetSystemVDDLowVoltageLevel(SPC_Type *base, spc_low_voltage_level_select_t level); - -/*! - * @brief Configs SYS voltage detect options. - * - * This function config SYS voltage detect options. - * @note: Setting both the voltage detect interrupt and reset - * enable will cause interrupt to be generated on exit from reset. - * If those conditioned is not desired, interrupt/reset so only one is enabled. - * - * @param base SPC peripheral base address. - * @param config Pointer to spc_system_voltage_detect_config_t structure. - */ -void SPC_SetSystemVoltageDetectConfig(SPC_Type *base, const spc_system_voltage_detect_config_t *config); - -/*! - * @brief Lock System voltage detect reset setting. - * - * This function locks system voltage detect reset setting. After invoking this function - * any configuration of System Voltage detect reset will be ignored. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_LockSystemVoltageDetectResetSetting(SPC_Type *base) -{ - base->VD_SYS_CFG |= SPC_VD_SYS_CFG_LOCK_MASK; -} - -/*! - * @brief Unlock System voltage detect reset setting. - * - * This function unlocks system voltage detect reset setting. If locks the System - * voltage detect reset setting, invoking this function to unlock. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_UnlockSystemVoltageDetectResetSetting(SPC_Type *base) -{ - base->VD_SYS_CFG &= ~SPC_VD_SYS_CFG_LOCK_MASK; -} - -/*! - * @brief Enables/Disables the System High Voltage Detector in Active mode. - * - * @note If the System_LDO high voltage detect is enabled in Active mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Active mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable System HVD. - * true - Enable System High voltage detector in active mode. - * false - Disable System High voltage detector in active mode. - * - * @retval #kStatus_Success Enable/Disable System High Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeSystemHighVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disable the System Low Voltage Detector in Active mode. - * - * @note If the System_LDO low voltage detect is enabled in Active mode, - * please note that the bandgap must be enabled and the drive strength of each - * regulator must not set to low in Active mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable System LVD. - * true - Enable System Low voltage detector in active mode. - * false - Disable System Low voltage detector in active mode. - * - * @retval #kStatus_Success Enable/Disable the System Low Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeSystemLowVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disables the System High Voltage Detector in Low Power mode. - * - * @note If the System_LDO high voltage detect is enabled in Low Power mode, please note - * that the bandgap must be enabled and the drive strength of each regulator must - * not set to low in Low Power mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable System HVD. - * true - Enable System High voltage detector in low power mode. - * false - Disable System High voltage detector in low power mode. - * - * @retval #kStatus_Success Enable/Disable System High Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeSystemHighVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disables the System Low Voltage Detector in Low Power mode. - * - * @note If the System_LDO low voltage detect is enabled in Low Power mode, - * please note that the bandgap must be enabled and the drive strength of each - * regulator must not set to low in Low Power mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable System HVD. - * true - Enable System Low voltage detector in low power mode. - * false - Disable System Low voltage detector in low power mode. - * - * @retval #kStatus_Success Enables System Low Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeSystemLowVoltageDetect(SPC_Type *base, bool enable); - -/* @} */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) && FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) -/*! - * @name Voltage detect configuration for IO voltage domain - * @{ - */ -/*! - * @brief Set IO VDD Low-Voltage level selection. - * - * This function selects the IO VDD Low-voltage level. Changing IO VDD low-voltage level - * must be done after disabling the IO VDD low voltage reset and interrupt. - * - * @param base SPC peripheral base address. - * @param level IO VDD Low-voltage level selection. - */ -void SPC_SetIOVDDLowVoltageLevel(SPC_Type *base, spc_low_voltage_level_select_t level); - -/*! - * @brief Configs IO voltage detect options. - * - * This function config IO voltage detect options. - * @note: Setting both the voltage detect interrupt and reset - * enable will cause interrupt to be generated on exit from reset. - * If those conditioned is not desired, interrupt/reset so only one is enabled. - * - * @param base SPC peripheral base address. - * @param config Pointer to spc_voltage_detect_config_t structure. - */ -void SPC_SetIOVoltageDetectConfig(SPC_Type *base, const spc_io_voltage_detect_config_t *config); - -/*! - * @brief Lock IO Voltage detect reset setting. - * - * This function locks IO voltage detect reset setting. After invoking this function - * any configuration of system voltage detect reset will be ignored. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_LockIOVoltageDetectResetSetting(SPC_Type *base) -{ - base->VD_IO_CFG |= SPC_VD_IO_CFG_LOCK_MASK; -} - -/*! - * @brief Unlock IO voltage detect reset setting. - * - * This function unlocks IO voltage detect reset setting. If locks the IO - * voltage detect reset setting, invoking this function to unlock. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_UnlockIOVoltageDetectResetSetting(SPC_Type *base) -{ - base->VD_IO_CFG &= ~SPC_VD_IO_CFG_LOCK_MASK; -} - -/*! - * @brief Enables/Disables the IO High Voltage Detector in Active mode. - * - * @note If the IO high voltage detect is enabled in Active mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Active mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable IO HVD. - * true - Enable IO High voltage detector in active mode. - * false - Disable IO High voltage detector in active mode. - * - * @retval #kStatus_Success Enable/Disable IO High Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeIOHighVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disables the IO Low Voltage Detector in Active mode. - * - * @note If the IO low voltage detect is enabled in Active mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Active mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable IO LVD. - * true - Enable IO Low voltage detector in active mode. - * false - Disable IO Low voltage detector in active mode. - * - * @retval #kStatus_Success Enable IO Low Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeIOLowVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disables the IO High Voltage Detector in Low Power mode. - * - * @note If the IO high voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Low Power mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable IO HVD. - * true - Enable IO High voltage detector in low power mode. - * false - Disable IO High voltage detector in low power mode. - * - * @retval #kStatus_Success Enable IO High Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeIOHighVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disables the IO Low Voltage Detector in Low Power mode. - * - * @note If the IO low voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Low Power mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable IO LVD. - * true - Enable IO Low voltage detector in low power mode. - * false - Disable IO Low voltage detector in low power mode. - * - * @retval #kStatus_Success Enable/Disable IO Low Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeIOLowVoltageDetect(SPC_Type *base, bool enable); - -/* @} */ - -#endif /* FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD */ - -/*! - * @name External Voltage domains configuration - * @{ - */ -/*! - * @brief Configs external voltage domains - * - * This function configs external voltage domains isolation. - * - * @param base SPC peripheral base address. - * @param lowPowerIsoMask The mask of external domains isolate enable during low power mode. Please read the Reference - * Manual for the Bitmap. - * @param IsoMask The mask of external domains isolate. Please read the Reference Manual for the Bitmap. - */ -void SPC_SetExternalVoltageDomainsConfig(SPC_Type *base, uint8_t lowPowerIsoMask, uint8_t IsoMask); - -/*! - * @brief Gets External Domains status. - * - * This function configs external voltage domains status. - * - * @param base SPC peripheral base address. - * @return The status of each external domain. - */ -static inline uint8_t SPC_GetExternalDomainsStatus(SPC_Type *base) -{ - return (uint8_t)(base->EVD_CFG >> SPC_EVD_CFG_REG_EVDSTAT_SHIFT); -} - -/* @} */ - -/*! - * @name Set CORE LDO Regulator - * @{ - */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_CNTRL_REG) && FSL_FEATURE_MCX_SPC_HAS_CNTRL_REG) -/*! - * @brief Enable/Disable Core LDO regulator. - * - * @note The CORE LDO enable bit is write-once. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable CORE LDO Regulator. - * true - Enable CORE LDO Regulator. - * false - Disable CORE LDO Regulator. - */ -static inline void SPC_EnableCoreLDORegulator(SPC_Type *base, bool enable) -{ - if (enable) - { - base->CNTRL |= SPC_CNTRL_CORELDO_EN_MASK; - } - else - { - /* - * $Branch Coverage Justification$ - * If CORE_LDO is disabled, all RAMs data will powered off. - */ - base->CNTRL &= ~SPC_CNTRL_CORELDO_EN_MASK; - } -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_CNTRL_REG */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DPDOWN_PULLDOWN_DISABLE_BIT) && FSL_FEATURE_MCX_SPC_HAS_DPDOWN_PULLDOWN_DISABLE_BIT) -/*! - * @brief Enable/Disable the CORE LDO Regulator pull down in Deep Power Down. - * - * @note This function only useful when enabled the CORE LDO Regulator. - * - * @param base SPC peripheral base address. - * @param pulldown Enable/Disable CORE LDO pulldown in Deep Power Down mode. - * true - CORE LDO Regulator will discharge in Deep Power Down mode. - * false - CORE LDO Regulator will not discharge in Deep Power Down mode. - */ -static inline void SPC_PullDownCoreLDORegulator(SPC_Type *base, bool pulldown) -{ - if (pulldown) - { - base->CORELDO_CFG &= ~SPC_CORELDO_CFG_DPDOWN_PULLDOWN_DISABLE_MASK; - } - else - { - base->CORELDO_CFG |= SPC_CORELDO_CFG_DPDOWN_PULLDOWN_DISABLE_MASK; - } -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_DPDOWN_PULLDOWN_DISABLE_BIT */ - -/*! - * @brief Configs Core LDO VDD Regulator in Active mode. - * - * @note If any voltage detect feature is enabled in Active mode, then CORE_LDO's drive strength must not set to low. - * - * @note Core VDD level for the Core LDO low power regulator can only be changed when CORELDO_VDD_DS is normal - * - * @param base SPC peripheral base address. - * @param option Pointer to the spc_active_mode_core_ldo_option_t structure. - * - * @retval #kStatus_Success Config Core LDO regulator in Active power mode successful. - * @retval #kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * @retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore If any voltage detect enabled, core_ldo's drive strength can not - * set to low. - * @retval #kStatus_SPC_CORELDOVoltageWrong The selected voltage level in active mode is not allowed. - */ -status_t SPC_SetActiveModeCoreLDORegulatorConfig(SPC_Type *base, const spc_active_mode_core_ldo_option_t *option); - -/*! - * @brief Set Core LDO VDD Regulator Voltage level in Active mode. - * - * - * - * @param base SPC peripheral base address. - * @param voltageLevel Specify the voltage level of CORE LDO Regulator in Active mode, please - refer to @ref spc_core_ldo_voltage_level_t. - * - * @retval kStatus_SPC_CORELDOVoltageWrong The selected voltage level in active mode is not allowed. - * @retval kStatus_Success Set Core LDO regulator voltage level in Active power mode successful. - */ -status_t SPC_SetActiveModeCoreLDORegulatorVoltageLevel(SPC_Type *base, spc_core_ldo_voltage_level_t voltageLevel); - -/*! - * @brief Gets CORE LDO VDD Regulator Voltage level. - * - * This function returns the voltage level of CORE LDO Regulator in Active mode. - * - * @param base SPC peripheral base address. - * @return Voltage level of CORE LDO in type of @ref spc_core_ldo_voltage_level_t enumeration. - */ -static inline spc_core_ldo_voltage_level_t SPC_GetActiveModeCoreLDOVDDVoltageLevel(SPC_Type *base) -{ - return (spc_core_ldo_voltage_level_t)(uint32_t)((base->ACTIVE_CFG & SPC_ACTIVE_CFG_CORELDO_VDD_LVL_MASK) >> - SPC_ACTIVE_CFG_CORELDO_VDD_LVL_SHIFT); -} - -#if (defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) -/*! - * @brief Set Core LDO VDD Regulator Drive Strength in Active mode. - * - * @param base SPC peripheral base address. - * @param driveStrength Specify the drive strength of CORE LDO Regulator in Active mode, please - refer to @ref spc_core_ldo_drive_strength_t. - * - * @retval #kStatus_Success Set Core LDO regulator drive strength in Active power mode successful. - * @retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore If any voltage detect enabled, - core_ldo's drive strength can not set to low. - * @retval #kStatus_SPC_BandgapModeWrong The selected bandgap mode is not allowed. - */ -status_t SPC_SetActiveModeCoreLDORegulatorDriveStrength(SPC_Type *base, spc_core_ldo_drive_strength_t driveStrength); - -/*! - * @brief Gets CORE LDO VDD Regulator Drive Strength in Active mode. - * - * @param base SPC peripheral base address. - * @return Drive Strength of CORE LDO regulator in Active mode, please refer to @ref spc_core_ldo_drive_strength_t. - */ -static inline spc_core_ldo_drive_strength_t SPC_GetActiveModeCoreLDODriveStrength(SPC_Type *base) -{ - return (spc_core_ldo_drive_strength_t)(uint32_t)((base->ACTIVE_CFG & SPC_ACTIVE_CFG_CORELDO_VDD_DS_MASK) >> - SPC_ACTIVE_CFG_CORELDO_VDD_DS_SHIFT); -} -#endif /* defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - - -/*! - * @brief Configs CORE LDO Regulator in low power mode - * - * This function configs CORE LDO Regulator in Low Power mode. - * If CORE LDO VDD Drive Strength is set to Normal, the CORE LDO VDD regulator voltage - * level in Active mode must be equal to the voltage level in Low power mode. And the Bandgap - * must be programmed to select bandgap enabled. - * Core VDD voltage levels for the Core LDO low power regulator can only be changed when the CORE - * LDO Drive Strength set as Normal. - * - * @param base SPC peripheral base address. - * @param option Pointer to the spc_lowpower_mode_core_ldo_option_t structure. - * - * @retval #kStatus_Success Config Core LDO regulator in power mode successfully. - * @retval #kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * @retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore Set driver strength to low will be ignored. - * @retval #kStatus_SPC_CORELDOVoltageSetFail. Fail to change Core LDO voltage level. - */ -status_t SPC_SetLowPowerModeCoreLDORegulatorConfig(SPC_Type *base, const spc_lowpower_mode_core_ldo_option_t *option); - -/*! - * @brief Set Core LDO VDD Regulator Voltage level in Low power mode. - * - * @note If CORE LDO's drive strength is set to Normal, the CORE LDO VDD regulator voltage in active mode and low power - * mode must be same. - * @note Voltage level for the CORE LDO in low power mode can only be changed when the CORE LDO Drive Strength set as - * Normal. - * - * @param base SPC peripheral base address. - * @param voltageLevel Voltage level of CORE LDO Regulator in Low power mode, please - refer to @ref spc_core_ldo_voltage_level_t. - * - * @retval #kStatus_SPC_CORELDOVoltageWrong Voltage level in active mode and low power mode is not same. - * @retval #kStatus_Success Set Core LDO regulator voltage level in Low power mode successful. - * @retval #kStatus_SPC_CORELDOVoltageSetFail Fail to update voltage level because drive strength is incorrect. - */ -status_t SPC_SetLowPowerModeCoreLDORegulatorVoltageLevel(SPC_Type *base, spc_core_ldo_voltage_level_t voltageLevel); - -/*! - * @brief Gets the CORE LDO VDD Regulator Voltage Level for Low Power modes. - * - * @param base SPC peripheral base address. - * @return The CORE LDO VDD Regulator's voltage level. - */ -static inline spc_core_ldo_voltage_level_t SPC_GetLowPowerCoreLDOVDDVoltageLevel(SPC_Type *base) -{ - return ((spc_core_ldo_voltage_level_t)(uint32_t)((base->LP_CFG & SPC_LP_CFG_CORELDO_VDD_LVL_MASK) >> - SPC_LP_CFG_CORELDO_VDD_LVL_SHIFT)); -} - -/*! - * @brief Set Core LDO VDD Regulator Drive Strength in Low power mode. - * - * @param base SPC peripheral base address. - * @param driveStrength Specify drive strength of CORE LDO in low power mode. - * - * @retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore Some voltage detect enabled, CORE LDO's drive strength can not set - * as low. - * @retval #kStatus_Success Set Core LDO regulator drive strength in Low power mode successful. - * @retval #kStatus_SPC_BandgapModeWrong Bandgap is disabled when attempt to set CORE LDO work as normal drive strength. - */ -status_t SPC_SetLowPowerModeCoreLDORegulatorDriveStrength(SPC_Type *base, spc_core_ldo_drive_strength_t driveStrength); - -/*! - * @brief Gets CORE LDO VDD Drive Strength for Low Power modes. - * - * @param base SPC peripheral base address. - * @return The CORE LDO's VDD Drive Strength. - */ -static inline spc_core_ldo_drive_strength_t SPC_GetLowPowerCoreLDOVDDDriveStrength(SPC_Type *base) -{ - return (spc_core_ldo_drive_strength_t)(uint32_t)((base->LP_CFG & SPC_LP_CFG_CORELDO_VDD_DS_MASK) >> - SPC_LP_CFG_CORELDO_VDD_DS_SHIFT); -} - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) -/*! - * @name Set System LDO Regulator. - * @{ - */ - -/*! - * @brief Enable/Disable System LDO regulator. - * - * @note The SYSTEM LDO enable bit is write-once. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable System LDO Regulator. - * true - Enable System LDO Regulator. - * false - Disable System LDO Regulator. - */ -static inline void SPC_EnableSystemLDORegulator(SPC_Type *base, bool enable) -{ - if (enable) - { - base->CNTRL |= SPC_CNTRL_SYSLDO_EN_MASK; - } - else - { - /* - * $Branch Coverage Justification$ - * If SYSTEM_LDO is disabled, may cause some unexpected issues. - */ - base->CNTRL &= ~SPC_CNTRL_SYSLDO_EN_MASK; - } -} - -/*! - * @brief Enable/Disable current sink feature of System LDO Regulator. - * - * @param base SPC peripheral base address. - * @param sink Enable/Disable current sink feature. - * true - Enable current sink feature of System LDO Regulator. - * false - Disable current sink feature of System LDO Regulator. - */ -static inline void SPC_EnableSystemLDOSinkFeature(SPC_Type *base, bool sink) -{ - if (sink) - { - base->SYSLDO_CFG |= SPC_SYSLDO_CFG_ISINKEN_MASK; - } - else - { - base->SYSLDO_CFG &= ~SPC_SYSLDO_CFG_ISINKEN_MASK; - } -} - -/*! - * @brief Configs System LDO VDD Regulator in Active mode. - * - * This function configs System LDO VDD Regulator in Active mode. - * If System LDO VDD Drive Strength is set to Normal, the Bandgap mode in Active mode must be programmed - * to a value that enables the bandgap. - * If any voltage detects are kept enabled, configuration to set System LDO VDD drive strength to low will - * be ignored. - * If select System LDO VDD Regulator voltage level to Over Drive Voltage, the Drive Strength of System LDO VDD - * Regulator must be set to Normal otherwise the regulator Drive Strength will be forced to Normal. - * If select System LDO VDD Regulator voltage level to Over Drive Voltage, the High voltage detect must be disabled. - * Otherwise it will be fail to regulator to Over Drive Voltage. - * - * @param base SPC peripheral base address. - * @param option Pointer to the spc_active_mode_sys_ldo_option_t structure. - * - * @retval #kStatus_Success Config System LDO regulator in Active power mode successful. - * @retval #kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * @retval #kStatus_SPC_SYSLDOOverDriveVoltageFail Fail to regulator to Over Drive Voltage. - * @retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Set driver strength to Low will be ignored. - */ -status_t SPC_SetActiveModeSystemLDORegulatorConfig(SPC_Type *base, const spc_active_mode_sys_ldo_option_t *option); - -/*! - * @brief Set System LDO Regulator voltage level in Active mode. - * - * @note The system LDO regulator can only operate at the overdrive voltage level for a limited amount of time for the - * life of chip. - * - * @param base SPC peripheral base address. - * @param voltageLevel Specify the voltage level of System LDO Regulator in Active mode. - * - * @retval #kStatus_Success Set System LDO Regulator voltage level in Active mode successfully. - * @retval #kStatus_SPC_SYSLDOOverDriveVoltageFail Must disable system LDO high voltage detector before specifing overdrive voltage. - */ -status_t SPC_SetActiveModeSystemLDORegulatorVoltageLevel(SPC_Type *base, spc_sys_ldo_voltage_level_t voltageLevel); - -/*! - * @brief Get System LDO Regulator voltage level in Active mode. - * - * @param base SPC peripheral base address. - * @return System LDO Regulator voltage level in Active mode, please refer to @ref spc_sys_ldo_voltage_level_t. - */ -static inline spc_sys_ldo_voltage_level_t SPC_GetActiveModeSystemLDORegulatorVoltageLevel(SPC_Type *base) -{ - return (spc_sys_ldo_voltage_level_t)(uint32_t)((base->ACTIVE_CFG & SPC_ACTIVE_CFG_SYSLDO_VDD_LVL_MASK) >> SPC_ACTIVE_CFG_SYSLDO_VDD_LVL_SHIFT); -} - -/*! - * @brief Set System LDO Regulator Drive Strength in Active mode. - * - * @param base SPC peripheral base address. - * @param driveStrength Specify the drive strength of System LDO Regulator in Active mode. - * - * @retval #kStatus_Success Set System LDO Regulator drive strength in Active mode successfully. - * @retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Attempt to specify low drive strength is ignored due to any - voltage detect feature is enabled in active mode. - * @retval #kStatus_SPC_BandgapModeWrong Bandgap mode in Active mode must be programmed to a value that enables - the bandgap if attempt to specify normal drive strength. - */ -status_t SPC_SetActiveModeSystemLDORegulatorDriveStrength(SPC_Type *base, spc_sys_ldo_drive_strength_t driveStrength); - -/*! - * @brief Get System LDO Regulator Drive Strength in Active mode. - * - * @param base SPC peripheral base address. - * @return System LDO regulator drive strength in Active mode, please refer to @ref spc_sys_ldo_drive_strength_t. - */ -static inline spc_sys_ldo_drive_strength_t SPC_GetActiveModeSystemLDORegulatorDriveStrength(SPC_Type *base) -{ - return (spc_sys_ldo_drive_strength_t)(uint32_t)((base->ACTIVE_CFG & SPC_ACTIVE_CFG_SYSLDO_VDD_DS_MASK) >> SPC_ACTIVE_CFG_SYSLDO_VDD_DS_SHIFT); -} - -/*! - * @brief Configs System LDO regulator in low power modes. - * - * This function configs System LDO regulator in low power modes. - * If System LDO VDD Regulator Drive strength is set to normal, bandgap mode in low power - * mode must be programmed to a value that enables the Bandgap. - * If any High voltage detectors or Low Voltage detectors are kept enabled, configuration - * to set System LDO Regulator drive strength as Low will be ignored. - * - * @param base SPC peripheral base address. - * @param option Pointer to spc_lowpower_mode_sys_ldo_option_t structure. - * - * @retval #kStatus_Success Config System LDO regulator in Low Power Mode successfully. - * @retval #kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * @retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Set driver strength to low will be ignored. - */ -status_t SPC_SetLowPowerModeSystemLDORegulatorConfig(SPC_Type *base, const spc_lowpower_mode_sys_ldo_option_t *option); - -/*! - * @brief Set System LDO Regulator drive strength in Low Power Mode. - * - * @param base SPC peripheral base address. - * @param driveStrength Specify the drive strength of System LDO Regulator in Low Power Mode. - * - * @retval #kStatus_Success Set System LDO Regulator drive strength in Low Power Mode successfully. - * @retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Attempt to specify low drive strength is ignored due to any - voltage detect feature is enabled in low power mode. - * @retval #kStatus_SPC_BandgapModeWrong Bandgap mode in low power mode must be programmed to a value that enables - the bandgap if attempt to specify normal drive strength. - */ -status_t SPC_SetLowPowerModeSystemLDORegulatorDriveStrength(SPC_Type *base, spc_sys_ldo_drive_strength_t driveStrength); - -/*! - * @brief Get System LDO Regulator drive strength in Low Power Mode. - * - * @param base SPC peripheral base address. - * @return System LDO regulator drive strength in Low Power Mode, please refer to @ref spc_sys_ldo_drive_strength_t. - */ -static inline spc_sys_ldo_drive_strength_t SPC_GetLowPowerModeSystemLDORegulatorDriveStrength(SPC_Type *base) -{ - return (spc_sys_ldo_drive_strength_t)(uint32_t)((base->LP_CFG & SPC_LP_CFG_SYSLDO_VDD_DS_MASK) >> SPC_LP_CFG_SYSLDO_VDD_DS_SHIFT); -} -/* @} */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) -/*! - * @name Set DCDC Regulator. - * @{ - */ - -/*! - * @brief Enable/Disable DCDC Regulator. - * - * @note The DCDC enable bit is write-once. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable DCDC Regulator. - * true - Enable DCDC Regulator. - * false - Disable DCDC Regulator. - */ -static inline void SPC_EnableDCDCRegulator(SPC_Type *base, bool enable) -{ - if (enable) - { - base->CNTRL |= SPC_CNTRL_DCDC_EN_MASK; - } - else - { - /* - * $Branch Coverage Justification$ - * If DCDC is disabled, all RAMs data will powered off. - */ - base->CNTRL &= ~SPC_CNTRL_DCDC_EN_MASK; - } -} - -/*! - * @brief Config DCDC Burst options - * - * @param base SPC peripheral base address. - * @param config Pointer to spc_dcdc_burst_config_t structure. - */ -void SPC_SetDCDCBurstConfig(SPC_Type *base, spc_dcdc_burst_config_t *config); - -/*! - * @brief Set the count value of the reference clock. - * - * This function set the count value of the reference clock to control the frequency - * of dcdc refresh when dcdc is configured in Pulse Refresh mode. - * - * @param base SPC peripheral base address. - * @param count The count value, 16 bit width. - */ -void SPC_SetDCDCRefreshCount(SPC_Type *base, uint16_t count); - -/*! - * @brief Configs DCDC VDD Regulator in Active mode. - * - * @note Before switching DCDC drive strength from low to normal, the DCDC voltage level should be configured back to - * what it was before switching to low drive strength. - * - * @param base SPC peripheral base address. - * @param option Pointer to the spc_active_mode_dcdc_option_t structure. - * - * @retval #kStatus_Success Config DCDC regulator in Active power mode successful. - * @retval #kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * @retval #kStatus_SPC_DCDCLowDriveStrengthIgnore Set driver strength to Low will be ignored. - */ -status_t SPC_SetActiveModeDCDCRegulatorConfig(SPC_Type *base, const spc_active_mode_dcdc_option_t *option); - -/*! - * @brief Set DCDC VDD Regulator voltage level in Active mode. - * - * @param base SPC peripheral base address. - * @param voltageLevel Specify the DCDC VDD Regulator voltage level, please refer to @ref spc_dcdc_voltage_level_t. - */ -static inline void SPC_SetActiveModeDCDCRegulatorVoltageLevel(SPC_Type *base, spc_dcdc_voltage_level_t voltageLevel) -{ - base->ACTIVE_CFG = (base->ACTIVE_CFG & (~SPC_ACTIVE_CFG_DCDC_VDD_LVL_MASK)) | SPC_ACTIVE_CFG_DCDC_VDD_LVL(voltageLevel); -} - -/*! - * @brief Get DCDC VDD Regulator voltage level in Active mode. - * - * @param base SPC peripheral base address. - * @return DCDC VDD Regulator voltage level, please refer to @ref spc_dcdc_voltage_level_t. - */ -static inline spc_dcdc_voltage_level_t SPC_GetActiveModeDCDCRegulatorVoltageLevel(SPC_Type *base) -{ - return (spc_dcdc_voltage_level_t)((base->ACTIVE_CFG & SPC_ACTIVE_CFG_DCDC_VDD_LVL_MASK) >> - SPC_ACTIVE_CFG_DCDC_VDD_LVL_SHIFT); -} - -/*! - * @brief Set DCDC VDD Regulator drive strength in Active mode. - * - * @param base SPC peripheral base address. - * @param driveStrength Specify the DCDC VDD regulator drive strength, please refer to @ref spc_dcdc_drive_strength_t. - * - * @retval #kStatus_Success Set DCDC VDD Regulator drive strength in Active mode successfully. - * @retval #kStatus_SPC_DCDCLowDriveStrengthIgnore Any of the voltage detects are kept enabled, set driver strength to - * Low will be ignored. - * @retval #kStatus_SPC_BandgapModeWrong Set DCDC VDD Regulator drive strength to Normal, the Bandgap must be enabled. - */ -status_t SPC_SetActiveModeDCDCRegulatorDriveStrength(SPC_Type *base, spc_dcdc_drive_strength_t driveStrength); - -/*! - * @brief Get DCDC VDD Regulator drive strength in Active mode. - * - * @param base SPC peripheral base address. - * @return DCDC VDD Regulator drive strength, please refer to @ref spc_dcdc_drive_strength_t. - */ -static inline spc_dcdc_drive_strength_t SPC_GetActiveModeDCDCRegulatorDriveStrength(SPC_Type *base) -{ - return (spc_dcdc_drive_strength_t)((base->ACTIVE_CFG & SPC_ACTIVE_CFG_DCDC_VDD_DS_MASK) >> - SPC_ACTIVE_CFG_DCDC_VDD_DS_SHIFT); -} - -/*! - * @brief Configs DCDC VDD Regulator in Low power modes. - * - * This function configs DCDC VDD Regulator in Low Power modes. - * If DCDC VDD Drive Strength is set to Normal, the Bandgap mode in Low Power mode must be programmed - * to a value that enables the Bandgap. - * If any of voltage detectors are kept enabled, configuration to set DCDC VDD Drive Strength to Low or Pulse mode - * will be ignored. - * In Deep Power Down mode, DCDC regulator is always turned off. - * - * @param base SPC peripheral base address. - * @param option Pointer to the spc_lowpower_mode_dcdc_option_t structure. - * - * @retval #kStatus_Success Config DCDC regulator in low power mode successfully. - * @retval #kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * @retval #kStatus_SPC_DCDCPulseRefreshModeIgnore Set driver strength to Pulse Refresh mode will be ignored. - * @retval #kStatus_SPC_DCDCLowDriveStrengthIgnore Set driver strength to Low Drive Strength will be ignored. - */ -status_t SPC_SetLowPowerModeDCDCRegulatorConfig(SPC_Type *base, const spc_lowpower_mode_dcdc_option_t *option); - -/*! - * @brief Set DCDC VDD Regulator voltage level in Low power mode. - * - * @param base SPC peripheral base address. - * @param voltageLevel Specify the DCDC VDD Regulator voltage level, please refer to @ref spc_dcdc_voltage_level_t. - */ -static inline void SPC_SetLowPowerModeDCDCRegulatorVoltageLevel(SPC_Type *base, spc_dcdc_voltage_level_t voltageLevel) -{ - base->LP_CFG = (base->LP_CFG & (~SPC_LP_CFG_DCDC_VDD_LVL_MASK)) | SPC_LP_CFG_DCDC_VDD_LVL(voltageLevel); -} - -/*! - * @brief Get DCDC VDD Regulator voltage level in Low power mode. - * - * @param base SPC peripheral base address. - * @return DCDC VDD Regulator voltage level, please refer to @ref spc_dcdc_voltage_level_t. - */ -static inline spc_dcdc_voltage_level_t SPC_GetLowPowerModeDCDCRegulatorVoltageLevel(SPC_Type *base) -{ - return (spc_dcdc_voltage_level_t)((base->LP_CFG & SPC_LP_CFG_DCDC_VDD_LVL_MASK) >> - SPC_LP_CFG_DCDC_VDD_LVL_SHIFT); -} - -/*! - * @brief Set DCDC VDD Regulator drive strength in Low power mode. - * - * @param base SPC peripheral base address. - * @param driveStrength Specify the DCDC VDD Regulator drive strength, please refer to @ref spc_dcdc_drive_strength_t. - * - * @retval #kStatus_Success Set DCDC VDD Regulator drive strength in Low power mode successfully. - * @retval #kStatus_SPC_DCDCLowDriveStrengthIgnore Any of the voltage detects are kept enabled, set driver strength to - * Low will be ignored. - * @retval #kStatus_SPC_BandgapModeWrong Set DCDC VDD Regulator drive strength to Normal, the Bandgap must be enabled. - */ -status_t SPC_SetLowPowerModeDCDCRegulatorDriveStrength(SPC_Type *base, spc_dcdc_drive_strength_t driveStrength); - -/*! - * @brief Get DCDC VDD Regulator drive strength in Low power mode. - * - * @param base SPC peripheral base address. - * @return DCDC VDD Regulator drive strength, please refer to @ref spc_dcdc_drive_strength_t. - */ -static inline spc_dcdc_drive_strength_t SPC_GetLowPowerModeDCDCRegulatorDriveStrength(SPC_Type *base) -{ - return (spc_dcdc_drive_strength_t)((base->LP_CFG & SPC_LP_CFG_DCDC_VDD_DS_MASK) >> SPC_LP_CFG_DCDC_VDD_DS_SHIFT); -} - -/* @} */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @} */ - -#endif /* FSL_SPC_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_syspm.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_syspm.c deleted file mode 100644 index 2fecd525bc6..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_syspm.c +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Copyright 2021-2022 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_syspm.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.syspm" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -#if (!(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)) && defined(SYSPM_CLOCKS) -/*! - * @brief Get instance number for ESYSPM. - * - * @param base ESYSPM peripheral base address. - */ -static uint32_t SYSPM_GetInstance(SYSPM_Type *base); -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ -#if (!(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)) && defined(SYSPM_CLOCKS) -/*! @brief Array to map SYSPM instance number to base pointer. */ -static SYSPM_Type *const s_syspmBases[] = SYSPM_BASE_PTRS; - -/*! @brief Array to map SYSPM instance number to clock name. */ -static const clock_ip_name_t s_syspmClockName[] = SYSPM_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/******************************************************************************* - * Code - ******************************************************************************/ -#if (!(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)) && defined(SYSPM_CLOCKS) -static uint32_t SYSPM_GetInstance(SYSPM_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_syspmBases); instance++) - { - if (s_syspmBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_syspmBases)); - - return instance; -} -#endif - -/* - * brief Initializes the SYSPM - * - * This function enables the SYSPM clock. - * - * param base SYSPM peripheral base address. - */ -void SYSPM_Init(SYSPM_Type *base) -{ -#if (!(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)) && defined(SYSPM_CLOCKS) - CLOCK_EnableClock(s_syspmClockName[SYSPM_GetInstance(base)]); -#endif -} - -/* - * brief Deinitializes the SYSPM - * - * This function disables the SYSPM clock. - * - * param base SYSPM peripheral base address. - */ -void SYSPM_Deinit(SYSPM_Type *base) -{ -#if (!(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)) && defined(SYSPM_CLOCKS) - CLOCK_DisableClock(s_syspmClockName[SYSPM_GetInstance(base)]); -#endif -} - -/*! - * @brief Select event counters - * - * @param base SYSPM peripheral base address. - * @param monitor syspm control monitor, see to #syspm_monitor_t. - * @param event syspm select event, see to #syspm_event_t. - * @param eventCode select which event to be counted in PMECTRx., see to table Events. - */ -void SYSPM_SelectEvent(SYSPM_Type *base, syspm_monitor_t monitor, syspm_event_t event, uint8_t eventCode) -{ - uint32_t pmcr; - uint8_t shift; - - shift = 7U * (uint8_t)event; - - pmcr = base->PMCR[(uint8_t)monitor].PMCR; - pmcr &= ~(SYSPM_PMCR_SELEVT1_MASK << shift); - pmcr |= SYSPM_PMCR_SELEVT1(eventCode) << shift; - - base->PMCR[(uint8_t)monitor].PMCR = pmcr; -} - -/*! - * @brief Reset event counters - * - * @param base SYSPM peripheral base address. - * @param monitor syspm control monitor, see to #syspm_monitor_t. - */ -void SYSPM_ResetEvent(SYSPM_Type *base, syspm_monitor_t monitor, syspm_event_t event) -{ - base->PMCR[(uint8_t)monitor].PMCR |= ((uint32_t)SYSPM_PMCR_RECTR1_MASK << (uint8_t)event); -} - -#if !((defined(FSL_FEATURE_SYSPM_HAS_PMCR_RICTR) && (FSL_FEATURE_SYSPM_HAS_PMCR_RICTR == 0U))) -/*! - * @brief Reset Instruction Counter - * - * @param base SYSPM peripheral base address. - * @param monitor syspm control monitor, see to #syspm_monitor_t. - */ -void SYSPM_ResetInstructionEvent(SYSPM_Type *base, syspm_monitor_t monitor) -{ - base->PMCR[(uint8_t)monitor].PMCR |= SYSPM_PMCR_RICTR_MASK; -} -#endif /* FSL_FEATURE_SYSPM_HAS_PMCR_RICTR */ - -/*! - * @brief Set count mode - * - * @param base SYSPM peripheral base address. - * @param monitor syspm control monitor, see to #syspm_monitor_t. - * @param mode syspm select counter mode, see to #syspm_mode_t. - */ -void SYSPM_SetCountMode(SYSPM_Type *base, syspm_monitor_t monitor, syspm_mode_t mode) -{ - base->PMCR[(uint8_t)monitor].PMCR = - (base->PMCR[(uint8_t)monitor].PMCR & ~SYSPM_PMCR_CMODE_MASK) | SYSPM_PMCR_CMODE(mode); -} - -/*! - * @brief Set Start/Stop Control - * - * @param base SYSPM peripheral base address. - * @param monitor syspm control monitor, see to #syspm_monitor_t. - * @param ssc This 3-bit field provides a three-phase mechanism to start/stop the counters. It includes a - * prioritized scheme with local start > local stop > global start > global stop > conditional - * TSTART > TSTOP. The global and conditional start/stop affect all configured PM/PSAM module concurrently so counters - * are "coherent". see to #syspm_startstop_control_t - */ -void SYSPM_SetStartStopControl(SYSPM_Type *base, syspm_monitor_t monitor, syspm_startstop_control_t ssc) -{ - base->PMCR[(uint8_t)monitor].PMCR = - (base->PMCR[(uint8_t)monitor].PMCR & ~SYSPM_PMCR_SSC_MASK) | SYSPM_PMCR_SSC(ssc); -} - -#if !((defined(FSL_FEATURE_SYSPM_HAS_PMCR_DCIFSH)) && (FSL_FEATURE_SYSPM_HAS_PMCR_DCIFSH == 0U)) -/*! - * @brief Disable Counters if Stopped or Halted - * - * @param base SYSPM peripheral base address. - * @param monitor syspm control monitor, see to #syspm_monitor_t. - */ -void SYSPM_DisableCounter(SYSPM_Type *base, syspm_monitor_t monitor) -{ - base->PMCR[(uint8_t)monitor].PMCR |= SYSPM_PMCR_DCIFSH_MASK; -} -#endif /* FSL_FEATURE_SYSPM_HAS_PMCR_DCIFSH */ - -/*! - * @brief This is the the 40-bits of eventx counter. - The value in this register increments each time the event - selected in PMCRx[SELEVTx] occurs. - * - * @param base SYSPM peripheral base address. - * @param monitor syspm control monitor, see to #syspm_monitor_t. - * @param event syspm select event, see to #syspm_event_t. - * @return get the the 40 bits of eventx counter. - */ -uint64_t SYSPM_GetEventCounter(SYSPM_Type *base, syspm_monitor_t monitor, syspm_event_t event) -{ - uint32_t highOld; - uint32_t high; - uint32_t low; - - highOld = base->PMCR[(uint8_t)monitor].PMECTR[(uint8_t)event].HI; - while (true) - { - low = base->PMCR[(uint8_t)monitor].PMECTR[(uint8_t)event].LO; - high = base->PMCR[(uint8_t)monitor].PMECTR[(uint8_t)event].HI; - if (high == highOld) - { - break; - } - else - { - highOld = high; - } - } - - return ((uint64_t)high << 32U) + low; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_syspm.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_syspm.h deleted file mode 100644 index 397b1f9aeb6..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_syspm.h +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright 2021-2022 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_SYSPM_H_ -#define FSL_SYSPM_H_ - -#include "fsl_common.h" - -/*! @addtogroup syspm */ -/*! @{ */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief SYSPM driver version */ -#define FSL_SYSPM_DRIVER_VERSION (MAKE_VERSION(2, 2, 0)) - -/*@}*/ -/*! @brief syspm select control monitor */ -typedef enum _syspm_monitor -{ - kSYSPM_Monitor0 = 0U, /*!< Monitor 0 */ -#if (SYSPM_PMCR_COUNT > 1U) - kSYSPM_Monitor1 = 1U, /*!< Monitor 1 */ -#endif -} syspm_monitor_t; - -/*! @brief syspm select event */ -typedef enum _syspm_event -{ - kSYSPM_Event1 = 0U, /*!< Event 1 */ - kSYSPM_Event2 = 1U, /*!< Event 2 */ - kSYSPM_Event3 = 2U, /*!< Event 3 */ -} syspm_event_t; - -/*! @brief syspm set count mode */ -typedef enum _syspm_mode -{ - kSYSPM_BothMode = 0x00, /*!< count in both modes */ - kSYSPM_UserMode = 0x02, /*!< count only in user mode */ - kSYSPM_PrivilegedMode = 0x03, /*!< count only in privileged mode */ -} syspm_mode_t; - -/*! @brief syspm start/stop control */ -typedef enum _syspm_startstop_control -{ - kSYSPM_Idle = 0x00, /*!< idle >*/ - kSYSPM_LocalStop = 0x01, /*!< local stop */ - kSYSPM_LocalStart = 0x02, /*!< local start */ - KSYSPM_EnableTraceControl = 0x04, /*!< enable global TSTART/TSTOP */ - kSYSPM_GlobalStart = 0x05, /*!< global stop */ - kSYSPM_GlobalStop = 0x06, /*!< global start */ -} syspm_startstop_control_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus. */ - -/*! - * @brief Initializes the SYSPM - * - * This function enables the SYSPM clock. - * - * @param base SYSPM peripheral base address. - */ -void SYSPM_Init(SYSPM_Type *base); - -/*! - * @brief Deinitializes the SYSPM - * - * This function disables the SYSPM clock. - * - * @param base SYSPM peripheral base address. - */ -void SYSPM_Deinit(SYSPM_Type *base); - -/*! - * @brief Select event counters - * - * @param base SYSPM peripheral base address. - * @param event syspm select event, see to #syspm_event_t. - * @param eventCode select which event to be counted in PMECTRx., see to table Events. - */ -void SYSPM_SelectEvent(SYSPM_Type *base, syspm_monitor_t monitor, syspm_event_t event, uint8_t eventCode); - -/*! - * @brief Reset event counters - * - * @param base SYSPM peripheral base address. - * @param monitor syspm control monitor, see to #syspm_monitor_t. - */ -void SYSPM_ResetEvent(SYSPM_Type *base, syspm_monitor_t monitor, syspm_event_t event); - -#if !((defined(FSL_FEATURE_SYSPM_HAS_PMCR_RICTR) && (FSL_FEATURE_SYSPM_HAS_PMCR_RICTR == 0U))) -/*! - * @brief Reset Instruction Counter - * - * @param base SYSPM peripheral base address. - * @param monitor syspm control monitor, see to #syspm_monitor_t. - */ -void SYSPM_ResetInstructionEvent(SYSPM_Type *base, syspm_monitor_t monitor); -#endif - -/*! - * @brief Set count mode - * - * @param base SYSPM peripheral base address. - * @param monitor syspm control monitor, see to #syspm_monitor_t. - * @param mode syspm select counter mode, see to #syspm_mode_t. - */ -void SYSPM_SetCountMode(SYSPM_Type *base, syspm_monitor_t monitor, syspm_mode_t mode); - -/*! - * @brief Set Start/Stop Control - * - * @param base SYSPM peripheral base address. - * @param monitor syspm control monitor, see to #syspm_monitor_t. - * @param ssc This 3-bit field provides a three-phase mechanism to start/stop the counters. It includes a - * prioritized scheme with local start > local stop > global start > global stop > conditional - * TSTART > TSTOP. The global and conditional start/stop affect all configured PM/PSAM module concurrently so counters - * are "coherent". see to #syspm_startstop_control_t - */ -void SYSPM_SetStartStopControl(SYSPM_Type *base, syspm_monitor_t monitor, syspm_startstop_control_t ssc); - -#if !((defined(FSL_FEATURE_SYSPM_HAS_PMCR_DCIFSH)) && (FSL_FEATURE_SYSPM_HAS_PMCR_DCIFSH == 0U)) -/*! - * @brief Disable Counters if Stopped or Halted - * - * @param base SYSPM peripheral base address. - * @param monitor syspm control monitor, see to #syspm_monitor_t. - */ -void SYSPM_DisableCounter(SYSPM_Type *base, syspm_monitor_t monitor); -#endif - -/*! - * @brief This is the the 40-bits of eventx counter. - The value in this register increments each time the event - selected in PMCRx[SELEVTx] occurs. - * - * @param base SYSPM peripheral base address. - * @param monitor syspm control monitor, see to #syspm_monitor_t. - * @param event syspm select event, see to #syspm_event_t. - * @return get the the 40 bits of eventx counter. - */ -uint64_t SYSPM_GetEventCounter(SYSPM_Type *base, syspm_monitor_t monitor, syspm_event_t event); - -#if defined(__cplusplus) -} -#endif /* __cplusplus*/ - -/*! @}*/ - -#endif /* FSL_SYSPM_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_tdet.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_tdet.c deleted file mode 100644 index 4caa262a500..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_tdet.c +++ /dev/null @@ -1,656 +0,0 @@ -/* - * Copyright 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_tdet.h" - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.tdet" -#endif - -/* all bits defined in the LOCK Register. */ -#define TDET_ALL_LC_MASK 0x00FF3FF0u - -/* all bits defined in the Interrupt Enable Register. */ -#define TDET_ALL_IER_MASK 0x00FF03FDu - -/* all bits defined in the Tamper Enable Register. */ -#define TDET_ALL_TER_MASK 0x00FF0FFCu - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * Weak implementation of TDET IRQ, should be re-defined by user when using TDET IRQ - */ -__WEAK void VBAT0_DriverIRQHandler(void) -{ - /* TDET generates IRQ until corresponding bit in STATUS is cleared by calling - * TDET_ClearStatusFlags(TDET0,kTDET_StatusAll); - * which clear all bits or kTDET_StatusXXX to clear only one bit - */ -} - -static bool tdet_IsRegisterWriteAllowed(DIGTMP_Type *base, uint32_t mask) -{ - bool retval; - - retval = false; - mask = mask & TDET_ALL_LC_MASK; - - /* specified LR bit(s) must be set */ - if (mask == (mask & base->LR)) - { - retval = true; - } - return retval; -} - -static status_t tdet_PinConfigure(DIGTMP_Type *base, const tdet_pin_config_t *pinConfig, uint32_t pin) -{ - uint32_t temp; - uint32_t mask; - status_t status; - - if ((tdet_IsRegisterWriteAllowed( - base, DIGTMP_LR_PDL_MASK | DIGTMP_LR_PPL_MASK | (((uint32_t)1u << DIGTMP_LR_GFL0_SHIFT) << pin))) && - (pinConfig != NULL)) - { - /* pin 0 to 7 selects bit0 to bit7 */ - mask = ((uint32_t)1u << pin); - - /* Pin Direction Register */ - temp = base->PDR; - temp &= ~mask; /* clear the bit */ - if (kTDET_TamperPinDirectionOut == pinConfig->pinDirection) - { - temp |= mask; /* set the bit, if configured */ - } - base->PDR = temp; - - /* Pin Polarity Register */ - temp = base->PPR; - temp &= ~mask; /* clear the bit */ - if (kTDET_TamperPinPolarityExpectInverted == pinConfig->pinPolarity) - { - temp |= mask; /* set the bit, if configured */ - } - base->PPR = temp; - - /* compute and set the configured value to the glitch filter register */ - temp = 0; - temp |= DIGTMP_PGFR_GFW(pinConfig->glitchFilterWidth); - temp |= DIGTMP_PGFR_GFP(pinConfig->glitchFilterPrescaler); - temp |= DIGTMP_PGFR_TPSW(pinConfig->tamperPinSampleWidth); - temp |= DIGTMP_PGFR_TPSF(pinConfig->tamperPinSampleFrequency); - temp |= DIGTMP_PGFR_TPEX(pinConfig->tamperPinExpected); - temp |= DIGTMP_PGFR_TPE(pinConfig->tamperPullEnable); - temp |= DIGTMP_PGFR_TPS(pinConfig->tamperPullSelect); - /* make sure the glitch filter is disabled when we configure glitch filter width */ - base->PGFR[pin] = temp; - /* add glitch filter enabled */ - if (pinConfig->glitchFilterEnable) - { - temp |= DIGTMP_PGFR_GFE(1u); - base->PGFR[pin] = temp; - } - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -static status_t tdet_ActiveTamperConfigure(DIGTMP_Type *base, - const tdet_active_tamper_config_t *activeTamperConfig, - uint32_t activeTamperRegister) -{ - uint32_t temp; - status_t status; - - /* check if writing to active tamper register is allowed */ - if ((tdet_IsRegisterWriteAllowed(base, ((uint32_t)1u << DIGTMP_LR_ATL0_SHIFT) << activeTamperRegister)) && - (activeTamperConfig != NULL)) - { - /* compute and set the configured value to the active tamper register */ - temp = 0; - temp |= DIGTMP_ATR_ATSR(activeTamperConfig->activeTamperShift); - temp |= DIGTMP_ATR_ATP(activeTamperConfig->activeTamperPolynomial); - base->ATR[activeTamperRegister] = temp; - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -/*! - * brief Initialize TDET - * - * This function initializes TDET. - * - * param base TDET peripheral base address - * return Status of the init operation - */ -status_t TDET_Init(DIGTMP_Type *base) -{ - return kStatus_Success; -} - -/*! - * brief Deinitialize TDET - * - * This function disables glitch filters and active tampers - * This function disables the TDET clock and prescaler in TDET Control Register. - * param base TDET peripheral base address - */ -void TDET_Deinit(DIGTMP_Type *base) -{ - uint32_t i, j, k; - j = ARRAY_SIZE(base->PGFR); - k = ARRAY_SIZE(base->ATR); - /* disable all glitch filters and active tampers */ - for (i = 0; i < j; i++) - { - base->PGFR[i] = 0; - } - for (i = 0; i < k; i++) - { - base->ATR[i] = 0; - } - - /* disable inner TDET clock and prescaler */ - base->CR &= ~DIGTMP_CR_DEN_MASK; -} - -/*! - * brief Gets default values for the TDET Control Register. - * - * This function fills the given structure with default values for the TDET Control Register. - * The default values are: - * code - * defaultConfig->innerClockAndPrescalerEnable = true - * defaultConfig->tamperForceSystemResetEnable = false - * defaultConfig->updateMode = kTDET_StatusLockWithTamper - * defaultConfig->clockSourceActiveTamper0 = kTDET_ClockType1Hz - * defaultConfig->clockSourceActiveTamper1 = kTDET_ClockType1Hz - * defaultConfig->disablePrescalerAfterTamper = false - * defaultConfig->prescaler = 0 - * endcode - * param base TDET peripheral base address - * param[out] defaultConfig Pointer to structure to be filled with default parameters - */ -void TDET_GetDefaultConfig(DIGTMP_Type *base, tdet_config_t *defaultConfig) -{ - /* Initializes the configure structure to zero. */ - (void)memset(defaultConfig, 0, sizeof(*defaultConfig)); - - struct _tdet_config myDefaultConfig = { - true, /* innerClockAndPrescalerEnable */ - false, /* tamperForceSystemResetEnable */ - kTDET_StatusLockWithTamper, /* updateMode */ - kTDET_ClockType1Hz, /* clockSourceActiveTamper0 */ - kTDET_ClockType1Hz, /* clockSourceActiveTamper1 */ - false, /* disable prescaler on tamper event */ - 0, /* prescaler */ - }; - - *defaultConfig = myDefaultConfig; -} - -/*! - * brief Writes to the TDET Control Register. - * - * This function writes the given structure to the TDET Control Register. - * param base TDET peripheral base address - * param config Pointer to structure with TDET peripheral configuration parameters - * return kStatus_Fail when writing to TDET Control Register is not allowed - * return kStatus_Success when operation completes successfully - */ -status_t TDET_SetConfig(DIGTMP_Type *base, const tdet_config_t *config) -{ - uint32_t tmpCR; - - status_t retval = kStatus_Fail; - - /* check if writing to CR is allowed */ - if ((tdet_IsRegisterWriteAllowed(base, DIGTMP_LR_CRL_MASK)) && (config != NULL)) - { - /* compute CR value */ - tmpCR = 0; - tmpCR |= DIGTMP_CR_TFSR(config->tamperForceSystemResetEnable); - tmpCR |= DIGTMP_CR_UM(config->updateMode); - tmpCR |= DIGTMP_CR_ATCS0(config->clockSourceActiveTamper0); - tmpCR |= DIGTMP_CR_ATCS1(config->clockSourceActiveTamper1); - tmpCR |= DIGTMP_CR_DISTAM(config->disablePrescalerAfterTamper); - tmpCR |= DIGTMP_CR_DPR(config->prescaler); - /* write the computed value to the CR register */ - base->CR = tmpCR; - /* after the prescaler is written to CR register, enable the inner TDET clock and prescaler */ - if (config->innerClockAndPrescalerEnable) - { - base->CR = tmpCR | DIGTMP_CR_DEN_MASK; - } - retval = kStatus_Success; - } - else - { - retval = kStatus_Fail; - } - - return retval; -} - -/*! - * brief Software reset. - * - * This function resets all TDET registers. The CR[SWR] itself is not affected; - * it is reset by VBAT POR only. - * - * param base TDET peripheral base address - * return kStatus_Fail when writing to TDET Control Register is not allowed - * return kStatus_Success when operation completes successfully - */ -status_t TDET_SoftwareReset(DIGTMP_Type *base) -{ - status_t retval = kStatus_Fail; - - /* check if writing to CR is allowed */ - if (tdet_IsRegisterWriteAllowed(base, DIGTMP_LR_CRL_MASK)) - { - /* set the CR[SWR] */ - base->CR = DIGTMP_CR_SWR_MASK; - retval = kStatus_Success; - } - else - { - retval = kStatus_Fail; - } - - return retval; -} - -/*! - * brief Writes to the active tamper register(s). - * - * This function writes per active tamper register parameters to active tamper register(s). - * - * param base TDET peripheral base address - * param activeTamperConfig Pointer to structure with active tamper register parameters - * param activeTamperRegisterSelect Bit mask for active tamper registers to be configured. The passed value is - * combination of tdet_active_tamper_register_t values (OR'ed). - * return kStatus_Fail when writing to TDET Active Tamper Register(s) is not allowed - * return kStatus_Success when operation completes successfully - */ -status_t TDET_ActiveTamperSetConfig(DIGTMP_Type *base, - const tdet_active_tamper_config_t *activeTamperConfig, - uint32_t activeTamperRegisterSelect) -{ - uint32_t mask; - status_t status; - uint32_t i, j; - - mask = 1u; - status = kStatus_Success; - j = ARRAY_SIZE(base->ATR); - /* configure active tamper register by active tamper register, by moving through all active tamper registers */ - for (i = 0; i < j; i++) - { - if ((activeTamperRegisterSelect & mask) != 0U) - { - /* configure this active tamper register */ - status = tdet_ActiveTamperConfigure(base, activeTamperConfig, i); - if (status != kStatus_Success) - { - break; - } - } - mask = mask << 1u; - } - - return status; -} - -/*! - * brief Gets default values for tamper pin configuration. - * - * This function fills the give structure with default values for the tamper pin and glitch filter configuration. - * The default values are: - * code - * pinConfig->pinPolarity = kTDET_TamperPinPolarityExpectNormal; - * pinConfig->pinDirection = kTDET_TamperPinDirectionIn; - * pinConfig->tamperPullEnable = false; - * pinConfig->tamperPinSampleFrequency = kTDET_GlitchFilterSamplingEveryCycle8; - * pinConfig->tamperPinSampleWidth = kTDET_GlitchFilterSampleDisable; - * pinConfig->glitchFilterEnable = false; - * pinConfig->glitchFilterPrescaler = kTDET_GlitchFilterClock512Hz; - * pinConfig->glitchFilterWidth = 0; - * pinConfig->tamperPinExpected = kTDET_GlitchFilterExpectedLogicZero; - * pinConfig->tamperPullSelect = kTDET_GlitchFilterPullTypeAssert; - * endcode - * - * param base TDET peripheral base address - * param[out] pinConfig Pointer to structure to be filled with tamper pins default parameters - */ -void TDET_PinGetDefaultConfig(DIGTMP_Type *base, tdet_pin_config_t *pinConfig) -{ - /* Initializes the configure structure to zero. */ - (void)memset(pinConfig, 0, sizeof(*pinConfig)); - - struct _tdet_pin_config myPinDefaultConfig = { - kTDET_TamperPinPolarityExpectNormal, /* pinPolarity */ - kTDET_TamperPinDirectionIn, /* pinDirection */ - false, /* tamperPullEnable */ - kTDET_GlitchFilterSamplingEveryCycle8, /* tamperPinSampleFrequency */ - kTDET_GlitchFilterSampleDisable, /* tamperPinSampleWidth */ - false, /* glitchFilterEnable */ - kTDET_GlitchFilterClock512Hz, /* glitchFilterPrescaler */ - 0, /* glitchFilterWidth */ - kTDET_GlitchFilterExpectedLogicZero, /* tamperPinExpected */ - kTDET_GlitchFilterPullTypeAssert, /* tamperPullSelect */ - }; - - *pinConfig = myPinDefaultConfig; -} - -/*! - * brief Writes the tamper pin configuration. - * - * This function writes per pin parameters to tamper pin and glitch filter configuration registers. - * - * param base TDET peripheral base address - * param pinConfig Pointer to structure with tamper pin and glitch filter configuration parameters - * param pinSelect Bit mask for tamper pins to be configured. The passed value is combination of - * enum _tdet_external_tamper_pin (tdet_external_tamper_pin_t) values (OR'ed). - * return kStatus_Fail when writing to TDET Pin Direction, Pin Polarity or Glitch Filter Register(s) is not allowed - * return kStatus_Success when operation completes successfully - */ -status_t TDET_PinSetConfig(DIGTMP_Type *base, const tdet_pin_config_t *pinConfig, uint32_t pinSelect) -{ - uint32_t mask; - status_t status; - uint32_t i, j; - - mask = 1u; - status = kStatus_Success; - j = ARRAY_SIZE(base->PGFR); - /* configure pin by pin, by moving through all selected pins */ - for (i = 0; i < j; i++) - { - if ((pinSelect & mask) != 0U) - { - /* clear this pin from pinSelect */ - pinSelect &= ~mask; - - /* configure this pin */ - status = tdet_PinConfigure(base, pinConfig, i); - - /* if pinSelect is zero, we have configured all pins selected by pinSelect, so skip */ - if ((status != kStatus_Success) || (0U == pinSelect)) - { - break; - } - } - mask = mask << 1u; - } - - return status; -} - -/*! - * brief Reads the Status Register. - * - * This function reads flag bits from TDET Status Register. - * - * param base TDET peripheral base address - * param[out] result Pointer to uint32_t where to write Status Register read value. Use tdet_status_flag_t to decode - * individual flags. - * return kStatus_Fail when Status Register reading is not allowed - * return kStatus_Success when result is written with the Status Register read value - */ -status_t TDET_GetStatusFlags(DIGTMP_Type *base, uint32_t *result) -{ - status_t status; - - if (result != NULL) - { - *result = base->SR; - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -/*! - * brief Writes to the Status Register. - * - * This function clears specified flag bits in TDET Status Register. - * - * param base TDET peripheral base address - * param mask Bit mask for the flag bits to be cleared. Use tdet_status_flag_t to encode flags. - * return kStatus_Fail when Status Register writing is not allowed - * return kStatus_Success when mask is written to the Status Register - */ -status_t TDET_ClearStatusFlags(DIGTMP_Type *base, uint32_t mask) -{ - status_t status; - - if (tdet_IsRegisterWriteAllowed(base, DIGTMP_LR_SRL_MASK)) - { - base->SR = mask; - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -/*! - * brief Writes to the Interrupt Enable Register. - * - * This function sets specified interrupt enable bits in TDET Interrupt Enable Register. - * - * param base TDET peripheral base address - * param mask Bit mask for the interrupt enable bits to be set. - * return kStatus_Fail when Interrupt Enable Register writing is not allowed - * return kStatus_Success when mask is written to the Interrupt Enable Register - */ -status_t TDET_EnableInterrupts(DIGTMP_Type *base, uint32_t mask) -{ - status_t status; - - mask = mask & TDET_ALL_IER_MASK; /* only set the bits documented in Reference Manual. */ - if (tdet_IsRegisterWriteAllowed(base, DIGTMP_LR_IEL_MASK)) - { - base->IER |= mask; - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -/*! - * brief Writes to the Interrupt Enable Register. - * - * This function clears specified interrupt enable bits in TDET Interrupt Enable Register. - * - * param base TDET peripheral base address - * param mask Bit mask for the interrupt enable bits to be cleared. - * return kStatus_Fail when Interrupt Enable Register writing is not allowed - * return kStatus_Success when specified bits are cleared in the Interrupt Enable Register - */ -status_t TDET_DisableInterrupts(DIGTMP_Type *base, uint32_t mask) -{ - status_t status; - - mask = mask & TDET_ALL_IER_MASK; /* only clear the bits documented in Reference Manual. */ - if (tdet_IsRegisterWriteAllowed(base, DIGTMP_LR_IEL_MASK)) - { - base->IER &= ~mask; - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -/*! - * brief Writes to the Tamper Enable Register. - * - * This function sets specified tamper enable bits in TDET Tamper Enable Register. - * - * param base TDET peripheral base address - * param mask Bit mask for the tamper enable bits to be set. - * return kStatus_Fail when Tamper Enable Register writing is not allowed - * return kStatus_Success when mask is written to the Tamper Enable Register - */ -status_t TDET_EnableTampers(DIGTMP_Type *base, uint32_t mask) -{ - status_t status; - - mask = mask & TDET_ALL_TER_MASK; /* only set the bits documented in Reference Manual */ - if (tdet_IsRegisterWriteAllowed(base, DIGTMP_LR_TEL_MASK)) - { - base->TER |= mask; - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -/*! - * brief Writes to the Tamper Enable Register. - * - * This function clears specified tamper enable bits in TDET Tamper Enable Register. - * - * param base TDET peripheral base address - * param mask Bit mask for the tamper enable bits to be cleared. - * return kStatus_Fail when Tamper Enable Register writing is not allowed - * return kStatus_Success when specified bits are cleared in the Tamper Enable Register - */ -status_t TDET_DisableTampers(DIGTMP_Type *base, uint32_t mask) -{ - status_t status; - - mask = mask & TDET_ALL_TER_MASK; /* only clear the bits documented in Reference Manual */ - if (tdet_IsRegisterWriteAllowed(base, DIGTMP_LR_TEL_MASK)) - { - base->TER &= ~mask; - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -/*! - * brief Writes to the Tamper Seconds Register. - * - * This function writes to TDET Tamper Seconds Register. This causes Status Register DTF flag to be set (TDET - * tampering detected). - * - * param base TDET peripheral base address - * return kStatus_Fail when Tamper Seconds Register writing is not allowed - * return kStatus_Success when Tamper Seconds Register is written - */ -status_t TDET_ForceTamper(DIGTMP_Type *base) -{ - status_t status; - - if (tdet_IsRegisterWriteAllowed(base, DIGTMP_LR_TSL_MASK)) - { - base->TSR = 0; - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -/*! - * brief Reads the Tamper Seconds Register. - * - * This function reads TDET Tamper Seconds Register. The read value returns the time in seconds at which the Status - * Register DTF flag was set. - * - * param base TDET peripheral base address - * param tamperTimeSeconds Time in seconds at which the tamper detection SR[DTF] flag was set. - * return kStatus_Fail when Tamper Seconds Register reading is not allowed - * return kStatus_Success when Tamper Seconds Register is read - */ -status_t TDET_GetTamperTimeSeconds(DIGTMP_Type *base, uint32_t *tamperTimeSeconds) -{ - status_t status; - - if (tamperTimeSeconds != NULL) - { - *tamperTimeSeconds = base->TSR; - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -/*! - * brief Writes to the TDET Lock Register. - * - * This function clears specified lock bits in the TDET Lock Register. - * When a lock bit is clear, a write to corresponding TDET Register is ignored. - * Once cleared, these bits can only be set by VBAT POR or software reset. - * - * param base TDET peripheral base address - * param mask Bit mask for the lock bits to be cleared. Use tdet_register_t values to encode (OR'ed) which TDET - * Registers shall be locked. - */ -void TDET_LockRegisters(DIGTMP_Type *base, uint32_t mask) -{ - mask &= (uint32_t)kTDET_AllRegisters; /* make sure only documented registers are selected by the mask */ - base->LR &= ~mask; /* clear the selected bits */ -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_tdet.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_tdet.h deleted file mode 100644 index e56234933dd..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_tdet.h +++ /dev/null @@ -1,601 +0,0 @@ -/* - * Copyright 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_TDET_H_ -#define FSL_TDET_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup TDET - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief Defines TDET driver version 2.1.0. - * - * Change log: - * - Version 2.1.0 - * - Added setting of disabling prescaler on tamper event into TDET_SetConfig() and TDET_GetDefaultConfig functions. - * - Version 2.0.0 - * - Initial version - */ -#define FSL_TDET_DRIVER_VERSION (MAKE_VERSION(2, 1, 0)) -/*@}*/ - -/*! - * @brief TDET Update Mode. - * - * These constants allow TDET interrupts to be cleared if no tampering has been detected, while still preventing - * the TDET Tamper Flag (SR[DTF]) from being cleared once it is set. - */ -typedef enum _tdet_update_mode -{ - kTDET_StatusLockNormal = 0U, /*!< TDET Status Register cannot be written when the Status Register Lock bit - within the Lock Register (LR[SRL]) is clear */ - kTDET_StatusLockWithTamper = 1U, /*!< TDET Status Register cannot be written when the Status Register Lock bit - within the Lock Register (LR[SRL]) is clear and TDET Tamper Flag (SR[DTF]) - is set*/ -} tdet_update_mode_t; - -/*! - * @brief TDET Active Tamper Clock Source. - * - * These constants define the clock source for Active Tamper Shift Register to configure in a TDET base. - */ -typedef enum _tdet_active_tamper_clock -{ - kTDET_ClockType1Hz = 0U, /*!< clocked by 1 Hz prescaler clock */ - kTDET_ClockType64Hz = 1U, /*!< clocked by 614 Hz prescaler clock */ -} tdet_active_tamper_clock_t; - -/*! - * @brief TDET Control Register. - * - * This structure defines values for TDET Control Register. - */ -typedef struct _tdet_config -{ - bool innerClockAndPrescalerEnable; /*!< Enable/disable 32768 Hz clock within TDET and the TDET prescaler that - generates 512 Hz, 64Hz and 1 Hz prescaler clocks */ - bool tamperForceSystemResetEnable; /*!< Enable/disable assertion of chip reset when tampering is detected */ - enum _tdet_update_mode updateMode; /*!< Selects update mode for TDET Status Register */ - enum _tdet_active_tamper_clock - clockSourceActiveTamper0; /*!< Selects clock source for Active Tamper Shift Register 0 */ - enum _tdet_active_tamper_clock - clockSourceActiveTamper1; /*!< Selects clock source for Active Tamper Shift Register 1 */ - bool disablePrescalerAfterTamper; /*!< Allows the 32-KHz clock and prescaler to be automatically disabled after - tamper detection and until the system acknowledges the tamper. Disabling the - prescaler after detecting a tamper event conserves power and freezes the state - of the active tamper outputs and glitch filters. To ensure a clean transition, - the prescaler is disabled at the end of a 1 Hz period. */ - uint32_t prescaler; /*!< Initial value for the TDET prescaler 15-bit value. */ -} tdet_config_t; - -/*! - * @brief TDET Tamper Pin Polarity. - * - * These constants define tamper pin polarity to configure in a TDET base. - */ -typedef enum _tdet_pin_polarity -{ - kTDET_TamperPinPolarityExpectNormal = 0U, /*!< Tamper pin expected value is not inverted */ - kTDET_TamperPinPolarityExpectInverted = 1U, /*!< Tamper pin expected value is inverted */ -} tdet_pin_polarity_t; - -/*! - * @brief TDET Tamper Pin Direction. - * - * These constants define tamper pin direction to configure in a TDET base. - */ -typedef enum _tdet_pin_direction -{ - kTDET_TamperPinDirectionIn = 0U, /*!< Tamper pins configured as input */ - kTDET_TamperPinDirectionOut = 1U, /*!< Tamper pins configured as output, drives inverse of expected value */ -} tdet_pin_direction_t; - -/*! - * @brief TDET Glitch Filter Tamper Pin Sample Frequency. - * - * These constants define tamper pin glitch filter sample frequency to configure in a TDET base. - */ -typedef enum _tdet_glitch_filter_sample_freq -{ - kTDET_GlitchFilterSamplingEveryCycle8 = 0U, /*!< Sample once every 8 cycles */ - kTDET_GlitchFilterSamplingEveryCycle32 = 1U, /*!< Sample once every 32 cycles */ - kTDET_GlitchFilterSamplingEveryCycle128 = 2U, /*!< Sample once every 128 cycles */ - kTDET_GlitchFilterSamplingEveryCycle512 = 3U, /*!< Sample once every 512 cycles */ -} tdet_glitch_filter_sample_freq_t; -/*! - * @brief TDET Glitch Filter Tamper Pin Sample Width. - * - * These constants define tamper pin glitch filter sample width to configure in a TDET base. - */ -typedef enum _tdet_glitch_filter_sample_width -{ - kTDET_GlitchFilterSampleDisable = 0U, /*!< Sampling disabled */ - kTDET_GlitchFilterSampleCycle2 = 1U, /*!< Sample width pull enable/input buffer enable=2 cycles/1 cycle */ - kTDET_GlitchFilterSampleCycle4 = 2U, /*!< Sample width pull enable/input buffer enable=4 cycles/2 cycles */ - kTDET_GlitchFilterSampleCycle8 = 3U, /*!< Sample width pull enable/input buffer enable=8 cycles/4 cycles */ -} tdet_glitch_filter_sample_width_t; - -/*! - * @brief TDET Glitch Filter Tamper Pin Clock Source. - * - * These constants define tamper pin glitch filter clock source to configure in a TDET base. - */ -typedef enum _tdet_glitch_filter_prescaler -{ - kTDET_GlitchFilterClock512Hz = 0U, /*!< Glitch Filter on tamper pin is clocked by the 512 Hz prescaler clock */ - kTDET_GlitchFilterClock32768Hz = 1U, /*!< Glitch Filter on tamper pin is clocked by the 32768 Hz prescaler clock */ -} tdet_glitch_filter_prescaler_t; - -/*! - * @brief TDET Glitch Filter Tamper Pin Expected Value. - * - * These constants define tamper pin glitch filter expected value to configure in a TDET base. - */ -typedef enum _tdet_glitch_filter_expected -{ - kTDET_GlitchFilterExpectedLogicZero = 0U, /*!< Expected value is logic zero */ - kTDET_GlitchFilterExpectedActTamperOut0 = 1U, /*!< Expected value is active tamper 0 output */ - kTDET_GlitchFilterExpectedActTamperOut1 = 2U, /*!< Expected value is active tamper 1 output */ - kTDET_GlitchFilterExpectedActTamperOutXOR = - 3U, /*!< Expected value is active tamper 0 output XORed with active tamper 1 output */ -} tdet_glitch_filter_expected_t; - -/*! - * @brief TDET Glitch Filter Tamper Pull Select. - * - * These constants define tamper pin glitch filter pull direction to configure in a TDET base. - */ -typedef enum _tdet_glitch_filter_pull -{ - kTDET_GlitchFilterPullTypeAssert = 0U, /*!< Tamper pin pull direction always asserts the tamper pin. */ - kTDET_GlitchFilterPullTypeNegate = 1U, /*!< Tamper pin pull direction always negates the tamper pin. */ -} tdet_glitch_filter_pull_t; - -/*! - * @brief TDET Tamper Pin configuration registers. - * - * This structure defines values for TDET Pin Direction, Pin Polarity, and Glitch Filter registers. - */ -typedef struct _tdet_pin_config -{ - enum _tdet_pin_polarity pinPolarity; /*!< Selects tamper pin expected value */ - enum _tdet_pin_direction pinDirection; /*!< Selects tamper pin direction */ - bool tamperPullEnable; /*!< Enable/disable pull resistor on the tamper pin */ - enum _tdet_glitch_filter_sample_freq tamperPinSampleFrequency; /*!< Selects tamper pin sample frequency */ - enum _tdet_glitch_filter_sample_width tamperPinSampleWidth; /*!< Selects tamper pin sample width */ - bool glitchFilterEnable; /*!< Enable/disable glitch filter on the tamper pin */ - enum _tdet_glitch_filter_prescaler - glitchFilterPrescaler; /*!< Selects the prescaler for the glitch filter on tamper pin */ - - uint8_t glitchFilterWidth; /*!< 6-bit value to configure number of clock edges the input must remain stable for to - be passed through the glitch filter for the tamper pin */ - - enum _tdet_glitch_filter_expected tamperPinExpected; /*!< Selects tamper pin expected value */ - enum _tdet_glitch_filter_pull tamperPullSelect; /*!< Selects the direction of the tamper pin pull resistor */ -} tdet_pin_config_t; - -/*! @brief List of TDET external tampers */ -typedef enum _tdet_external_tamper_pin -{ - kTDET_ExternalTamper0 = 1U << 0, - kTDET_ExternalTamper1 = 1U << 1, - kTDET_ExternalTamper2 = 1U << 2, - kTDET_ExternalTamper3 = 1U << 3, - kTDET_ExternalTamper4 = 1U << 4, - kTDET_ExternalTamper5 = 1U << 5, - kTDET_ExternalTamper6 = 1U << 6, - kTDET_ExternalTamper7 = 1U << 7 -} tdet_external_tamper_pin_t; - -/*! - * @brief TDET Active Tamper Register Select. - * - * These constants are used to define activeTamperRegisterSelect argument to be used with - * TDET_ActiveTamperConfigure(). - */ -typedef enum _tdet_active_tamper_register -{ - kTDET_ActiveTamperRegister0 = 1u << 0, - kTDET_ActiveTamperRegister1 = 1u << 1, -} tdet_active_tamper_register_t; - -/*! - * @brief TDET Active Tamper registers. - * - * This structure defines values for TDET Active Tamper Registers. - */ -typedef struct _tdet_active_tamper_config -{ - uint32_t activeTamperShift; /*!< Active tamper shift register. initialize to non-zero value. */ - uint32_t activeTamperPolynomial; /*!< Polynomial of the active tamper shift register. */ -} tdet_active_tamper_config_t; - -/*! - * @brief TDET Status Register flags. - * - * This provides constants for the TDET Status Register. - */ -typedef enum _tdet_status_flag -{ - kTDET_StatusTamperFlag = 1U << DIGTMP_SR_DTF_SHIFT, /*!< TDET Digital Tamper Flag */ - kTDET_StatusTamperAcknowledgeFlag = 1U << DIGTMP_SR_TAF_SHIFT, /*!< TDET Tamper Acknowledge Flag */ - kTDET_StatusClockTamper = 1U << DIGTMP_IER_TIIE0_SHIFT, /*!< TDET Clock Tamper detected */ - kTDET_StatusConfigurationTamper = 1U << DIGTMP_IER_TIIE1_SHIFT, /*!< TDET Configuration Tamper detected */ - kTDET_StatusVoltageTamper = 1U << DIGTMP_IER_TIIE2_SHIFT, /*!< TDET Voltage Tamper detected */ - kTDET_StatusTemperatureTamper = 1U << DIGTMP_IER_TIIE3_SHIFT, /*!< TDET Temperature Tamper detected */ - kTDET_StatusRamZeroizeTamper = 1U << DIGTMP_IER_TIIE6_SHIFT, /*!< TDET RAM Zeroize Tamper detected */ - kTDET_StatusTamperPinTamper0 = 1U << DIGTMP_IER_TPIE0_SHIFT, /*!< TDET Tamper Pin 0 Tamper detected */ - kTDET_StatusTamperPinTamper1 = 1U << DIGTMP_IER_TPIE1_SHIFT, /*!< TDET Tamper Pin 1 Tamper detected */ - kTDET_StatusTamperPinTamper2 = 1U << DIGTMP_IER_TPIE2_SHIFT, /*!< TDET Tamper Pin 2 Tamper detected */ - kTDET_StatusTamperPinTamper3 = 1U << DIGTMP_IER_TPIE3_SHIFT, /*!< TDET Tamper Pin 3 Tamper detected */ - kTDET_StatusTamperPinTamper4 = 1U << DIGTMP_IER_TPIE4_SHIFT, /*!< TDET Tamper Pin 4 Tamper detected */ - kTDET_StatusTamperPinTamper5 = 1U << DIGTMP_IER_TPIE5_SHIFT, /*!< TDET Tamper Pin 5 Tamper detected */ - kTDET_StatusTamperPinTamper6 = 1U << DIGTMP_IER_TPIE6_SHIFT, /*!< TDET Tamper Pin 6 Tamper detected */ - kTDET_StatusTamperPinTamper7 = 1U << DIGTMP_IER_TPIE7_SHIFT, /*!< TDET Tamper Pin 7 Tamper detected */ - kTDET_StatusAll = DIGTMP_SR_DTF_MASK | DIGTMP_SR_TAF_MASK | DIGTMP_IER_TIIE0_MASK | DIGTMP_IER_TIIE1_MASK | - DIGTMP_IER_TIIE2_MASK | DIGTMP_IER_TIIE3_MASK | DIGTMP_IER_TIIE6_MASK | DIGTMP_IER_TPIE0_MASK | - DIGTMP_IER_TPIE1_MASK | DIGTMP_IER_TPIE2_MASK | DIGTMP_IER_TPIE3_MASK | DIGTMP_IER_TPIE4_MASK | - DIGTMP_IER_TPIE5_MASK | DIGTMP_IER_TPIE6_MASK | - DIGTMP_IER_TPIE7_MASK, /*!< Mask for all of the TDET Status Register bits */ -} tdet_status_flag_t; - -/*! - * @brief TDET Interrupt Enable Register. - * - * This provides constants for the TDET Interrupt Enable Register. - */ -typedef enum _tdet_interrupt -{ - kTDET_InterruptTamper = 1U << DIGTMP_IER_DTIE_SHIFT, /*!< TDET Digital Tamper Interrupt */ - kTDET_InterruptClockTamper = 1U << DIGTMP_IER_TIIE0_SHIFT, /*!< TDET Clock Tamper Interrupt */ - kTDET_InterruptConfigurationTamper = 1U << DIGTMP_IER_TIIE1_SHIFT, /*!< TDET Configuration error */ - kTDET_InterruptVoltageTamper = 1U << DIGTMP_IER_TIIE2_SHIFT, /*!< TDET Voltage Tamper */ - kTDET_InterruptTemperatureTamper = 1U << DIGTMP_IER_TIIE3_SHIFT, /*!< TDET Temperature Tamper Interrupt */ - kTDET_InterruptRamZeroizeTamper = 1U << DIGTMP_IER_TIIE6_SHIFT, /*!< TDET RAM Zeroize Tamper Interrupt */ - kTDET_InterruptTamperPinTamper0 = 1U << DIGTMP_IER_TPIE0_SHIFT, /*!< TDET Tamper Pin Tamper 0 Interrupt */ - kTDET_InterruptTamperPinTamper1 = 1U << DIGTMP_IER_TPIE1_SHIFT, /*!< TDET Tamper Pin Tamper 1 Interrupt */ - kTDET_InterruptTamperPinTamper2 = 1U << DIGTMP_IER_TPIE2_SHIFT, /*!< TDET Tamper Pin Tamper 2 Interrupt */ - kTDET_InterruptTamperPinTamper3 = 1U << DIGTMP_IER_TPIE3_SHIFT, /*!< TDET Tamper Pin Tamper 3 Interrupt */ - kTDET_InterruptTamperPinTamper4 = 1U << DIGTMP_IER_TPIE4_SHIFT, /*!< TDET Tamper Pin Tamper 4 Interrupt */ - kTDET_InterruptTamperPinTamper5 = 1U << DIGTMP_IER_TPIE5_SHIFT, /*!< TDET Tamper Pin Tamper 5 Interrupt */ - kTDET_InterruptTamperPinTamper6 = 1U << DIGTMP_IER_TPIE6_SHIFT, /*!< TDET Tamper Pin Tamper 6 Interrupt */ - kTDET_InterruptTamperPinTamper7 = 1U << DIGTMP_IER_TPIE7_SHIFT, /*!< TDET Tamper Pin Tamper 7 Interrupt */ - kTDET_InterruptTamperPinTamper_All = DIGTMP_IER_TPIE0_MASK | DIGTMP_IER_TPIE1_MASK | DIGTMP_IER_TPIE2_MASK | - DIGTMP_IER_TPIE3_MASK | DIGTMP_IER_TPIE4_MASK | DIGTMP_IER_TPIE5_MASK | - DIGTMP_IER_TPIE6_MASK | - DIGTMP_IER_TPIE7_MASK, /*!< TDET All Tamper Pins Interrupt */ - kTDET_InterruptAll = DIGTMP_IER_DTIE_MASK | DIGTMP_IER_TIIE0_MASK | DIGTMP_IER_TIIE1_MASK | DIGTMP_IER_TIIE2_MASK | - DIGTMP_IER_TIIE3_MASK | DIGTMP_IER_TIIE6_MASK | DIGTMP_IER_TPIE0_MASK | DIGTMP_IER_TPIE1_MASK | - DIGTMP_IER_TPIE2_MASK | DIGTMP_IER_TPIE3_MASK | DIGTMP_IER_TPIE4_MASK | DIGTMP_IER_TPIE5_MASK | - DIGTMP_IER_TPIE6_MASK | - DIGTMP_IER_TPIE7_MASK, /*!< Mask to select all TDET Interrupt Enable Register bits */ -} tdet_interrupt_t; - -/*! - * @brief TDET Tamper Enable Register. - * - * This provides constants for the TDET Tamper Enable Register. - */ -typedef enum _tdet_tamper -{ - kTDET_TamperClock = 1U << DIGTMP_TER_TIE0_SHIFT, /*!< Clock Tamper Enable */ - kTDET_TamperConfiguration = 1U << DIGTMP_TER_TIE1_SHIFT, /*!< Configuration error Tamper Enable */ - kTDET_TamperVoltage = 1U << DIGTMP_TER_TIE2_SHIFT, /*!< Voltage Tamper Enable */ - kTDET_TamperTemperature = 1U << DIGTMP_TER_TIE3_SHIFT, /*!< Temperature Tamper Enable */ - kTDET_TamperRamZeroize = 1U << DIGTMP_TER_TIE6_SHIFT, /*!< RAM Zeroize Tamper Enable */ - kTDET_TamperTamperPin0 = 1U << DIGTMP_TER_TPE0_SHIFT, /*!< Tamper Pin 0 Tamper Enable */ - kTDET_TamperTamperPin1 = 1U << DIGTMP_TER_TPE1_SHIFT, /*!< Tamper Pin 1 Tamper Enable */ - kTDET_TamperTamperPin2 = 1U << DIGTMP_TER_TPE2_SHIFT, /*!< Tamper Pin 2 Tamper Enable */ - kTDET_TamperTamperPin3 = 1U << DIGTMP_TER_TPE3_SHIFT, /*!< Tamper Pin 3 Tamper Enable */ - kTDET_TamperTamperPin4 = 1U << DIGTMP_TER_TPE4_SHIFT, /*!< Tamper Pin 4 Tamper Enable */ - kTDET_TamperTamperPin5 = 1U << DIGTMP_TER_TPE5_SHIFT, /*!< Tamper Pin 5 Tamper Enable */ - kTDET_TamperTamperPin6 = 1U << DIGTMP_TER_TPE6_SHIFT, /*!< Tamper Pin 6 Tamper Enable */ - kTDET_TamperTamperPin7 = 1U << DIGTMP_TER_TPE7_SHIFT, /*!< Tamper Pin 7 Tamper Enable */ - kTDET_TamperTamperPinAll = DIGTMP_TER_TPE0_MASK | DIGTMP_TER_TPE1_MASK | DIGTMP_TER_TPE2_MASK | - DIGTMP_TER_TPE3_MASK | DIGTMP_TER_TPE4_MASK | DIGTMP_TER_TPE5_MASK | - DIGTMP_TER_TPE6_MASK | DIGTMP_TER_TPE7_MASK, /*!< All Tamper Pin Tamper Enable */ - kTDET_TamperAll = DIGTMP_TER_TIE0_MASK | DIGTMP_TER_TIE1_MASK | DIGTMP_TER_TIE2_MASK | DIGTMP_TER_TIE3_MASK | - DIGTMP_TER_TIE6_MASK | DIGTMP_TER_TPE0_MASK | DIGTMP_TER_TPE1_MASK | DIGTMP_TER_TPE2_MASK | - DIGTMP_TER_TPE3_MASK | DIGTMP_TER_TPE4_MASK | DIGTMP_TER_TPE5_MASK | DIGTMP_TER_TPE6_MASK | - DIGTMP_TER_TPE7_MASK, /*!< Mask to select all Tamper Enable Register bits */ -} tdet_tamper_t; - -/*! - * @brief TDET Registers. - * - * This provides constants to encode a mask for the TDET Registers. - */ -typedef enum _tdet_register -{ - kTDET_NoRegister = 0U, /*!< No Register */ - kTDET_Control = 1U << DIGTMP_LR_CRL_SHIFT, /*!< Control Register */ - kTDET_Status = 1U << DIGTMP_LR_SRL_SHIFT, /*!< Status Register */ - kTDET_Lock = 1U << DIGTMP_LR_LRL_SHIFT, /*!< Lock Register */ - kTDET_InterruptEnable = 1U << DIGTMP_LR_IEL_SHIFT, /*!< Interrupt Enable Register */ - kTDET_TamperSeconds = 1U << DIGTMP_LR_TSL_SHIFT, /*!< Tamper Seconds Register */ - kTDET_TamperEnable = 1U << DIGTMP_LR_TEL_SHIFT, /*!< Tamper Enable Register */ - kTDET_PinDirection = 1U << DIGTMP_LR_PDL_SHIFT, /*!< Pin Direction Register */ - kTDET_PinPolarity = 1U << DIGTMP_LR_PPL_SHIFT, /*!< Pin Polarity Register */ - kTDET_ActiveTamper0 = 1U << DIGTMP_LR_ATL0_SHIFT, /*!< Active Tamper Register 0 */ - kTDET_ActiveTamper1 = 1U << DIGTMP_LR_ATL1_SHIFT, /*!< Active Tamper Register 1 */ - kTDET_GlitchFilter0 = 1U << DIGTMP_LR_GFL0_SHIFT, /*!< Glitch Filter Register 0 */ - kTDET_GlitchFilter1 = 1U << DIGTMP_LR_GFL1_SHIFT, /*!< Glitch Filter Register 1 */ - kTDET_GlitchFilter2 = 1U << DIGTMP_LR_GFL2_SHIFT, /*!< Glitch Filter Register 2 */ - kTDET_GlitchFilter3 = 1U << DIGTMP_LR_GFL3_SHIFT, /*!< Glitch Filter Register 3 */ - kTDET_GlitchFilter4 = 1U << DIGTMP_LR_GFL4_SHIFT, /*!< Glitch Filter Register 4 */ - kTDET_GlitchFilter5 = 1U << DIGTMP_LR_GFL5_SHIFT, /*!< Glitch Filter Register 5 */ - kTDET_GlitchFilter6 = 1U << DIGTMP_LR_GFL6_SHIFT, /*!< Glitch Filter Register 6 */ - kTDET_GlitchFilter7 = 1U << DIGTMP_LR_GFL7_SHIFT, /*!< Glitch Filter Register 7 */ - kTDET_PinConfigurationRegisters = - DIGTMP_LR_PDL_MASK | DIGTMP_LR_PPL_MASK | DIGTMP_LR_ATL0_MASK | DIGTMP_LR_ATL1_MASK | DIGTMP_LR_GFL0_MASK | - DIGTMP_LR_GFL1_MASK | DIGTMP_LR_GFL2_MASK | DIGTMP_LR_GFL3_MASK | DIGTMP_LR_GFL4_MASK | DIGTMP_LR_GFL5_MASK | - DIGTMP_LR_GFL6_MASK | DIGTMP_LR_GFL7_MASK, /*!< Mask to select all TDET Pin Configuration Registers */ - kTDET_AllRegisters = DIGTMP_LR_CRL_MASK | DIGTMP_LR_SRL_MASK | DIGTMP_LR_LRL_MASK | DIGTMP_LR_IEL_MASK | - DIGTMP_LR_TSL_MASK | DIGTMP_LR_TEL_MASK | DIGTMP_LR_PDL_MASK | DIGTMP_LR_PPL_MASK | - DIGTMP_LR_ATL0_MASK | DIGTMP_LR_ATL1_MASK | DIGTMP_LR_GFL0_MASK | DIGTMP_LR_GFL1_MASK | - DIGTMP_LR_GFL2_MASK | DIGTMP_LR_GFL3_MASK | DIGTMP_LR_GFL4_MASK | DIGTMP_LR_GFL5_MASK | - DIGTMP_LR_GFL6_MASK | DIGTMP_LR_GFL7_MASK, /*!< Mask to select all TDET Registers */ -} tdet_register_t; - -/******************************************************************************* - * API - *******************************************************************************/ -extern void VBAT0_DriverIRQHandler(void); - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name TDET Functional Operation - * @{ - */ - -/*! - * @brief Initialize TDET - * - * This function initializes TDET. - * - * @param base TDET peripheral base address - * @return Status of the init operation - */ -status_t TDET_Init(DIGTMP_Type *base); - -/*! - * @brief Deinitialize TDET - * - * This function disables glitch filters and active tampers - * This function disables the TDET clock and prescaler in TDET Control Register. - * @param base TDET peripheral base address - */ -void TDET_Deinit(DIGTMP_Type *base); - -/*! - * @brief Gets default values for the TDET Control Register. - * - * This function fills the given structure with default values for the TDET Control Register. - * The default values are: - * @code - * defaultConfig->innerClockAndPrescalerEnable = true - * defaultConfig->tamperForceSystemResetEnable = false - * defaultConfig->updateMode = kTDET_StatusLockWithTamper - * defaultConfig->clockSourceActiveTamper0 = kTDET_ClockType1Hz - * defaultConfig->clockSourceActiveTamper1 = kTDET_ClockType1Hz - * defaultConfig->prescaler = 0 - * @endcode - * @param base TDET peripheral base address - * @param[out] defaultConfig Pointer to structure to be filled with default parameters - */ -void TDET_GetDefaultConfig(DIGTMP_Type *base, tdet_config_t *defaultConfig); - -/*! - * @brief Writes to the TDET Control Register. - * - * This function writes the given structure to the TDET Control Register. - * @param base TDET peripheral base address - * @param config Pointer to structure with TDET peripheral configuration parameters - * @return kStatus_Fail when writing to TDET Control Register is not allowed - * @return kStatus_Success when operation completes successfully - */ -status_t TDET_SetConfig(DIGTMP_Type *base, const tdet_config_t *config); - -/*! - * @brief Software reset. - * - * This function resets all TDET registers. The CR[SWR] itself is not affected; - * it is reset by VBAT POR only. - * - * @param base TDET peripheral base address - * @return kStatus_Fail when writing to TDET Control Register is not allowed - * @return kStatus_Success when operation completes successfully - */ -status_t TDET_SoftwareReset(DIGTMP_Type *base); - -/*! - * @brief Writes to the active tamper register(s). - * - * This function writes per active tamper register parameters to active tamper register(s). - * - * @param base TDET peripheral base address - * @param activeTamperConfig Pointer to structure with active tamper register parameters - * @param activeTamperRegisterSelect Bit mask for active tamper registers to be configured. The passed value is - * combination of tdet_active_tamper_register_t values (OR'ed). - * @return kStatus_Fail when writing to TDET Active Tamper Register(s) is not allowed - * @return kStatus_Success when operation completes successfully - */ -status_t TDET_ActiveTamperSetConfig(DIGTMP_Type *base, - const tdet_active_tamper_config_t *activeTamperConfig, - uint32_t activeTamperRegisterSelect); - -/*! - * @brief Gets default values for tamper pin configuration. - * - * This function fills the give structure with default values for the tamper pin and glitch filter configuration. - * The default values are: - * code - * pinConfig->pinPolarity = kTDET_TamperPinPolarityExpectNormal; - * pinConfig->pinDirection = kTDET_TamperPinDirectionIn; - * pinConfig->tamperPullEnable = false; - * pinConfig->tamperPinSampleFrequency = kTDET_GlitchFilterSamplingEveryCycle8; - * pinConfig->tamperPinSampleWidth = kTDET_GlitchFilterSampleDisable; - * pinConfig->glitchFilterEnable = false; - * pinConfig->glitchFilterPrescaler = kTDET_GlitchFilterClock512Hz; - * pinConfig->glitchFilterWidth = 0; - * pinConfig->tamperPinExpected = kTDET_GlitchFilterExpectedLogicZero; - * pinConfig->tamperPullSelect = kTDET_GlitchFilterPullTypeAssert; - * endcode - * - * @param base TDET peripheral base address - * @param[out] pinConfig Pointer to structure to be filled with tamper pins default parameters - */ - -void TDET_PinGetDefaultConfig(DIGTMP_Type *base, tdet_pin_config_t *pinConfig); - -/*! - * @brief Writes the tamper pin configuration. - * - * This function writes per pin parameters to tamper pin and glitch filter configuration registers. - * - * @param base TDET peripheral base address - * @param pinConfig Pointer to structure with tamper pin and glitch filter configuration parameters - * @param pinSelect Bit mask for tamper pins to be configured. The passed value is combination of - * enum _tdet_tamper_pin (tdet_tamper_pin_t) values (OR'ed). - * @return kStatus_Fail when writing to TDET Pin Direction, Pin Polarity or Glitch Filter Register(s) is not allowed - * @return kStatus_Success when operation completes successfully - */ -status_t TDET_PinSetConfig(DIGTMP_Type *base, const tdet_pin_config_t *pinConfig, uint32_t pinSelect); - -/*! - * @brief Reads the Status Register. - * - * This function reads flag bits from TDET Status Register. - * - * @param base TDET peripheral base address - * @param[out] result Pointer to uint32_t where to write Status Register read value. Use tdet_status_flag_t to decode - * individual flags. - * @return kStatus_Fail when Status Register reading is not allowed - * @return kStatus_Success when result is written with the Status Register read value - */ -status_t TDET_GetStatusFlags(DIGTMP_Type *base, uint32_t *result); - -/*! - * @brief Writes to the Status Register. - * - * This function clears specified flag bits in TDET Status Register. - * - * @param base TDET peripheral base address - * @param mask Bit mask for the flag bits to be cleared. Use tdet_status_flag_t to encode flags. - * @return kStatus_Fail when Status Register writing is not allowed - * @return kStatus_Success when mask is written to the Status Register - */ -status_t TDET_ClearStatusFlags(DIGTMP_Type *base, uint32_t mask); - -/*! - * @brief Writes to the Interrupt Enable Register. - * - * This function sets specified interrupt enable bits in TDET Interrupt Enable Register. - * - * @param base TDET peripheral base address - * @param mask Bit mask for the interrupt enable bits to be set. - * @return kStatus_Fail when Interrupt Enable Register writing is not allowed - * @return kStatus_Success when mask is written to the Interrupt Enable Register - */ -status_t TDET_EnableInterrupts(DIGTMP_Type *base, uint32_t mask); - -/*! - * @brief Writes to the Interrupt Enable Register. - * - * This function clears specified interrupt enable bits in TDET Interrupt Enable Register. - * - * @param base TDET peripheral base address - * @param mask Bit mask for the interrupt enable bits to be cleared. - * @return kStatus_Fail when Interrupt Enable Register writing is not allowed - * @return kStatus_Success when specified bits are cleared in the Interrupt Enable Register - */ -status_t TDET_DisableInterrupts(DIGTMP_Type *base, uint32_t mask); - -/*! - * @brief Writes to the Tamper Enable Register. - * - * This function sets specified tamper enable bits in TDET Tamper Enable Register. - * - * @param base TDET peripheral base address - * @param mask Bit mask for the tamper enable bits to be set. - * @return kStatus_Fail when Tamper Enable Register writing is not allowed - * @return kStatus_Success when mask is written to the Tamper Enable Register - */ -status_t TDET_EnableTampers(DIGTMP_Type *base, uint32_t mask); - -/*! - * @brief Writes to the Tamper Enable Register. - * - * This function clears specified tamper enable bits in TDET Tamper Enable Register. - * - * @param base TDET peripheral base address - * @param mask Bit mask for the tamper enable bits to be cleared. - * @return kStatus_Fail when Tamper Enable Register writing is not allowed - * @return kStatus_Success when specified bits are cleared in the Tamper Enable Register - */ -status_t TDET_DisableTampers(DIGTMP_Type *base, uint32_t mask); - -/*! - * @brief Writes to the Tamper Seconds Register. - * - * This function writes to TDET Tamper Seconds Register. This causes Status Register DTF flag to be set (TDET - * tampering detected). - * - * @param base TDET peripheral base address - * @return kStatus_Fail when Tamper Seconds Register writing is not allowed - * @return kStatus_Success when Tamper Seconds Register is written - */ -status_t TDET_ForceTamper(DIGTMP_Type *base); - -/*! - * @brief Reads the Tamper Seconds Register. - * - * This function reads TDET Tamper Seconds Register. The read value returns the time in seconds at which the Status - * Register DTF flag was set. - * - * @param base TDET peripheral base address - * @param tamperTimeSeconds Time in seconds at which the tamper detection SR[DTF] flag was set. - * @return kStatus_Fail when Tamper Seconds Register reading is not allowed - * @return kStatus_Success when Tamper Seconds Register is read - */ -status_t TDET_GetTamperTimeSeconds(DIGTMP_Type *base, uint32_t *tamperTimeSeconds); - -/*! - * @brief Writes to the TDET Lock Register. - * - * This function clears specified lock bits in the TDET Lock Register. - * When a lock bit is clear, a write to corresponding TDET Register is ignored. - * Once cleared, these bits can only be set by VBAT POR or software reset. - * - * @param base TDET peripheral base address - * @param mask Bit mask for the lock bits to be cleared. Use tdet_register_t values to encode (OR'ed) which TDET - * Registers shall be locked. - */ -void TDET_LockRegisters(DIGTMP_Type *base, uint32_t mask); - -/*! @}*/ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @}*/ /* end of group tdet */ - -#endif /* FSL_TDET_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_utick.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_utick.c deleted file mode 100644 index 0eea419cd34..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_utick.c +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2019, 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_utick.h" -#if !(defined(FSL_FEATURE_UTICK_HAS_NO_PDCFG) && FSL_FEATURE_UTICK_HAS_NO_PDCFG) -#include "fsl_power.h" -#endif -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.utick" -#endif - -/* Typedef for interrupt handler. */ -typedef void (*utick_isr_t)(UTICK_Type *base, utick_callback_t cb); - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Gets the instance from the base address - * - * @param base UTICK peripheral base address - * - * @return The UTICK instance - */ -static uint32_t UTICK_GetInstance(UTICK_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/* Array of UTICK handle. */ -static utick_callback_t s_utickHandle[FSL_FEATURE_SOC_UTICK_COUNT]; -/* Array of UTICK peripheral base address. */ -static UTICK_Type *const s_utickBases[] = UTICK_BASE_PTRS; -/* Array of UTICK IRQ number. */ -static const IRQn_Type s_utickIRQ[] = UTICK_IRQS; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/* Array of UTICK clock name. */ -static const clock_ip_name_t s_utickClock[] = UTICK_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_FEATURE_UTICK_HAS_NO_RESET) && FSL_FEATURE_UTICK_HAS_NO_RESET) -/*! @brief Pointers to UTICK resets for each instance. */ -static const reset_ip_name_t s_utickResets[] = UTICK_RSTS; -#endif - -/* UTICK ISR for transactional APIs. */ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -static utick_isr_t s_utickIsr = (utick_isr_t)DefaultISR; -#else -static utick_isr_t s_utickIsr; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t UTICK_GetInstance(UTICK_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_utickBases); instance++) - { - if (s_utickBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_utickBases)); - - return instance; -} - -/*! - * brief Starts UTICK. - * - * This function starts a repeat/onetime countdown with an optional callback - * - * param base UTICK peripheral base address. - * param mode UTICK timer mode (ie kUTICK_onetime or kUTICK_repeat) - * param count UTICK timer mode (ie kUTICK_onetime or kUTICK_repeat) - * param cb UTICK callback (can be left as NULL if none, otherwise should be a void func(void)) - * return none - */ -void UTICK_SetTick(UTICK_Type *base, utick_mode_t mode, uint32_t count, utick_callback_t cb) -{ - uint32_t instance; - - /* Get instance from peripheral base address. */ - instance = UTICK_GetInstance(base); - - /* Save the handle in global variables to support the double weak mechanism. */ - s_utickHandle[instance] = cb; -#if ((defined(FSL_FEATURE_SOC_SYSCON_COUNT) && (FSL_FEATURE_SOC_SYSCON_COUNT > 0)) && \ - !(defined(FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS) && FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS)) - EnableDeepSleepIRQ(s_utickIRQ[instance]); -#else - (void)EnableIRQ(s_utickIRQ[instance]); -#endif /* FSL_FEATURE_SOC_SYSCON_COUNT && !FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS */ - base->CTRL = count | UTICK_CTRL_REPEAT(mode); -} - -/*! - * brief Initializes an UTICK by turning its bus clock on - * - */ -void UTICK_Init(UTICK_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable utick clock */ - CLOCK_EnableClock(s_utickClock[UTICK_GetInstance(base)]); -#endif - -#if !(defined(FSL_FEATURE_UTICK_HAS_NO_RESET) && FSL_FEATURE_UTICK_HAS_NO_RESET) - RESET_PeripheralReset(s_utickResets[UTICK_GetInstance(base)]); -#endif - -#if !(defined(FSL_FEATURE_UTICK_HAS_NO_PDCFG) && FSL_FEATURE_UTICK_HAS_NO_PDCFG) - /* Power up Watchdog oscillator*/ - POWER_DisablePD(kPDRUNCFG_PD_WDT_OSC); -#endif - - s_utickIsr = UTICK_HandleIRQ; -} - -/*! - * brief Deinitializes a UTICK instance. - * - * This function shuts down Utick bus clock - * - * param base UTICK peripheral base address. - */ -void UTICK_Deinit(UTICK_Type *base) -{ - /* Turn off utick */ - base->CTRL = 0; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable utick clock */ - CLOCK_DisableClock(s_utickClock[UTICK_GetInstance(base)]); -#endif -} - -/*! - * brief Get Status Flags. - * - * This returns the status flag - * - * param base UTICK peripheral base address. - * return status register value - */ -uint32_t UTICK_GetStatusFlags(UTICK_Type *base) -{ - return (base->STAT); -} - -/*! - * brief Clear Status Interrupt Flags. - * - * This clears intr status flag - * - * param base UTICK peripheral base address. - * return none - */ -void UTICK_ClearStatusFlags(UTICK_Type *base) -{ - base->STAT = UTICK_STAT_INTR_MASK; -} - -/*! - * brief UTICK Interrupt Service Handler. - * - * This function handles the interrupt and refers to the callback array in the driver to callback user (as per request - * in UTICK_SetTick()). - * if no user callback is scheduled, the interrupt will simply be cleared. - * - * param base UTICK peripheral base address. - * param cb callback scheduled for this instance of UTICK - * return none - */ -void UTICK_HandleIRQ(UTICK_Type *base, utick_callback_t cb) -{ - UTICK_ClearStatusFlags(base); - if (cb != NULL) - { - cb(); - } -} - -#if defined(UTICK0) -void UTICK0_DriverIRQHandler(void); -void UTICK0_DriverIRQHandler(void) -{ - s_utickIsr(UTICK0, s_utickHandle[0]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#if defined(UTICK1) -void UTICK1_DriverIRQHandler(void); -void UTICK1_DriverIRQHandler(void) -{ - s_utickIsr(UTICK1, s_utickHandle[1]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#if defined(UTICK2) -void UTICK2_DriverIRQHandler(void); -void UTICK2_DriverIRQHandler(void) -{ - s_utickIsr(UTICK2, s_utickHandle[2]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#if defined(UTICK) -void UTICK_DriverIRQHandler(void); -void UTICK_DriverIRQHandler(void) -{ - s_utickIsr(UTICK, s_utickHandle[0]); - SDK_ISR_EXIT_BARRIER; -} -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_utick.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_utick.h deleted file mode 100644 index 836b518f4c0..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_utick.h +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2019, 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_UTICK_H_ -#define FSL_UTICK_H_ - -#include "fsl_common.h" -/*! - * @addtogroup utick - * @{ - */ - -/*! @file*/ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief UTICK driver version 2.0.5. */ -#define FSL_UTICK_DRIVER_VERSION (MAKE_VERSION(2, 0, 5)) -/*@}*/ - -/*! @brief UTICK timer operational mode. */ -typedef enum _utick_mode -{ - kUTICK_Onetime = 0x0U, /*!< Trigger once*/ - kUTICK_Repeat = 0x1U, /*!< Trigger repeatedly */ -} utick_mode_t; - -/*! @brief UTICK callback function. */ -typedef void (*utick_callback_t)(void); - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* _cplusplus */ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Initializes an UTICK by turning its bus clock on - * - */ -void UTICK_Init(UTICK_Type *base); - -/*! - * @brief Deinitializes a UTICK instance. - * - * This function shuts down Utick bus clock - * - * @param base UTICK peripheral base address. - */ -void UTICK_Deinit(UTICK_Type *base); -/*! - * @brief Get Status Flags. - * - * This returns the status flag - * - * @param base UTICK peripheral base address. - * @return status register value - */ -uint32_t UTICK_GetStatusFlags(UTICK_Type *base); -/*! - * @brief Clear Status Interrupt Flags. - * - * This clears intr status flag - * - * @param base UTICK peripheral base address. - * @return none - */ -void UTICK_ClearStatusFlags(UTICK_Type *base); - -/*! - * @brief Starts UTICK. - * - * This function starts a repeat/onetime countdown with an optional callback - * - * @param base UTICK peripheral base address. - * @param mode UTICK timer mode (ie kUTICK_onetime or kUTICK_repeat) - * @param count UTICK timer mode (ie kUTICK_onetime or kUTICK_repeat) - * @param cb UTICK callback (can be left as NULL if none, otherwise should be a void func(void)) - * @return none - */ -void UTICK_SetTick(UTICK_Type *base, utick_mode_t mode, uint32_t count, utick_callback_t cb); -/*! - * @brief UTICK Interrupt Service Handler. - * - * This function handles the interrupt and refers to the callback array in the driver to callback user (as per request - * in UTICK_SetTick()). - * if no user callback is scheduled, the interrupt will simply be cleared. - * - * @param base UTICK peripheral base address. - * @param cb callback scheduled for this instance of UTICK - * @return none - */ -void UTICK_HandleIRQ(UTICK_Type *base, utick_callback_t cb); - -/* @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_UTICK_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_vbat.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_vbat.c deleted file mode 100644 index 676adcdf570..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_vbat.c +++ /dev/null @@ -1,498 +0,0 @@ -/* - * Copyright 2022-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_vbat.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.mcx_vbat" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Configure internal 16kHz free running oscillator, including enabel FRO16k, gate FRO16k output. - * - * param base VBAT peripheral base address. - * param config Pointer to vbat_fro16k_config_t structure. - */ -void VBAT_ConfigFRO16k(VBAT_Type *base, const vbat_fro16k_config_t *config) -{ - assert(config != NULL); - - VBAT_EnableFRO16k(base, config->enableFRO16k); - VBAT_UngateFRO16k(base, config->enabledConnectionsMask); -} - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG) -/*! - * brief Set 32k crystal oscillator mode and load capacitance for the XTAL/EXTAL pin. - * - * param base VBAT peripheral base address. - * param operateMode Specify the crystal oscillator mode, please refer to vbat_osc32k_operate_mode_t. - * param xtalCap Specify the internal capacitance for the XTAL pin from the capacitor bank. - * param extalCap Specify the internal capacitance for the EXTAL pin from the capacitor bank. - * - * retval kStatus_VBAT_WrongCapacitanceValue The load capacitance value to set is not align with operate mode's - * requirements. - * retval kStatus_Success Success to set operate mode and load capacitance. - */ -status_t VBAT_SetCrystalOsc32kModeAndLoadCapacitance(VBAT_Type *base, - vbat_osc32k_operate_mode_t operateMode, - vbat_osc32k_load_capacitance_select_t xtalCap, - vbat_osc32k_load_capacitance_select_t extalCap) -{ - if (operateMode == kVBAT_Osc32kEnabledToTransconductanceMode) - { - if (((uint8_t)extalCap & 0x1U) == 0U) - { - return kStatus_VBAT_WrongCapacitanceValue; - } - } - - if (operateMode == kVBAT_Osc32kEnabledToLowPowerSwitchedMode) - { - if ((extalCap != kVBAT_Osc32kCrystalLoadCap0pF) && (xtalCap != kVBAT_Osc32kCrystalLoadCap0pF)) - { - return kStatus_VBAT_WrongCapacitanceValue; - } - } - - if (operateMode == kVBAT_Osc32kEnabledToLowPowerBackupMode) - { - if ((extalCap & 0x1U) != 0U) - { - return kStatus_VBAT_WrongCapacitanceValue; - } - } - - if ((xtalCap != kVBAT_Osc32kCrystalLoadCapBankDisabled) && (extalCap != kVBAT_Osc32kCrystalLoadCapBankDisabled)) - { - base->OSCCTLA |= VBAT_OSCCTLA_CAP_SEL_EN_MASK; - base->OSCCTLB &= ~VBAT_OSCCTLA_CAP_SEL_EN_MASK; - base->OSCCTLA = ((base->OSCCTLA & ~(VBAT_OSCCTLA_EXTAL_CAP_SEL_MASK | VBAT_OSCCTLA_XTAL_CAP_SEL_MASK)) | - (VBAT_OSCCTLA_XTAL_CAP_SEL(xtalCap) | VBAT_OSCCTLA_EXTAL_CAP_SEL(extalCap))); - base->OSCCTLB = ((base->OSCCTLB & ~(VBAT_OSCCTLA_EXTAL_CAP_SEL_MASK | VBAT_OSCCTLA_XTAL_CAP_SEL_MASK)) | - VBAT_OSCCTLA_XTAL_CAP_SEL(~xtalCap) | VBAT_OSCCTLA_EXTAL_CAP_SEL(~extalCap)); - } - - base->OSCCTLA = (((base->OSCCTLA & ~VBAT_OSCCTLA_MODE_EN_MASK)) | VBAT_OSCCTLA_MODE_EN(operateMode)); - base->OSCCTLB = ((base->OSCCTLB & ~VBAT_OSCCTLA_MODE_EN_MASK) | VBAT_OSCCTLA_MODE_EN((uint8_t)~operateMode)); - - return kStatus_Success; -} -#endif /* FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG) -/*! - * brief Enable/disable Bandgap. - * - * note The FRO16K must be enabled before enableing the bandgap. - * note This setting can be locked by VBAT_LockRamLdoSettings() function. - * - * param base VBAT peripheral base address. - * param enable Used to enable/disable bandgap. - * - \b true Enable the bandgap. - * - \b false Disable the bandgap. - * - * retval kStatus_Success Success to enable/disable the bandgap. - * retval kStatus_VBAT_Fro16kNotEnabled Fail to enable the bandgap due to FRO16k is not enabled previously. - */ -status_t VBAT_EnableBandgap(VBAT_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - if (VBAT_CheckFRO16kEnabled(base)) - { - base->LDOCTLA |= VBAT_LDOCTLA_BG_EN_MASK; - base->LDOCTLB &= ~VBAT_LDOCTLA_BG_EN_MASK; - } - else - { - /* FRO16K must be enabled before enabling the Bandgap. */ - status = kStatus_VBAT_Fro16kNotEnabled; - } - } - else - { - base->LDOCTLA &= ~VBAT_LDOCTLA_BG_EN_MASK; - base->LDOCTLB |= VBAT_LDOCTLA_BG_EN_MASK; - } - - return status; -} - -/*! - * brief Enable/disable Backup RAM Regulator(RAM_LDO). - * - * note This setting can be locked by VBAT_LockRamLdoSettings() function. - * - * param base VBAT peripheral base address. - * param enable Used to enable/disable RAM_LDO. - * - \b true Enable backup SRAM regulator. - * - \b false Disable backup SRAM regulator. - * - * retval kStatusSuccess Success to enable/disable backup SRAM regulator. - * retval kStatus_VBAT_Fro16kNotEnabled Fail to enable backup SRAM regulator due to FRO16k is not enabled previously. - * retval kStatus_VBAT_BandgapNotEnabled Fail to enable backup SRAM regulator due to the bandgap is not enabled - * previously. - */ -status_t VBAT_EnableBackupSRAMRegulator(VBAT_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - if (VBAT_CheckFRO16kEnabled(base)) - { - if (VBAT_CheckBandgapEnabled(base)) - { - base->LDOCTLA |= VBAT_LDOCTLA_LDO_EN_MASK; - base->LDOCTLB &= ~VBAT_LDOCTLA_LDO_EN_MASK; - /* Polling until LDO is enabled. */ - while ((base->STATUSA & VBAT_STATUSA_LDO_RDY_MASK) == 0UL) - { - } - } - else - { - /* The bandgap must be enabled previously. */ - status = kStatus_VBAT_BandgapNotEnabled; - } - } - else - { - /* FRO16k must be enabled previously. */ - status = kStatus_VBAT_Fro16kNotEnabled; - } - } - else - { - base->LDOCTLA &= ~VBAT_LDOCTLA_LDO_EN_MASK; - base->LDOCTLB |= VBAT_LDOCTLA_LDO_EN_MASK; - } - - return status; -} - -/*! - * brief Switch the SRAM to be powered by VBAT. - * - * param base VBAT peripheral base address. - * - * retval kStatusSuccess Success to Switch SRAM powered by VBAT. - * retval kStatus_VBAT_Fro16kNotEnabled Fail to switch SRAM powered by VBAT due to FRO16K not enabled previously. - */ -status_t VBAT_SwitchSRAMPowerByLDOSRAM(VBAT_Type *base) -{ - status_t status = kStatus_Success; - - status = VBAT_EnableBandgap(base, true); - - if (status == kStatus_Success) - { - VBAT_EnableBandgapRefreshMode(base, true); - (void)VBAT_EnableBackupSRAMRegulator(base, true); - - /* Isolate the SRAM array */ - base->LDORAMC |= VBAT_LDORAMC_ISO_MASK; - /* Switch the supply to VBAT LDO. */ - base->LDORAMC |= VBAT_LDORAMC_SWI_MASK; - } - - return status; -} -#endif /* FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) && FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) -/*! - * brief Enable/disable Bandgap timer. - * - * note The bandgap timer is available when the bandgap is enabled and are clocked by the FRO16k. - * - * param base VBAT peripheral base address. - * param enable Used to enable/disable bandgap timer. - * param timerIdMask The mask of bandgap timer Id, should be the OR'ed value of vbat_bandgap_timer_id_t. - * - * retval kStatus_Success Success to enable/disable selected bandgap timer. - * retval kStatus_VBAT_Fro16kNotEnabled Fail to enable/disable selected bandgap timer due to FRO16k not enabled - * previously. retval kStatus_VBAT_BandgapNotEnabled Fail to enable/disable selected bandgap timer due to bandgap not - * enabled previously. - */ -status_t VBAT_EnableBandgapTimer(VBAT_Type *base, bool enable, uint8_t timerIdMask) -{ - status_t status = kStatus_Success; - - if (enable) - { - if (VBAT_CheckFRO16kEnabled(base)) - { - if (VBAT_CheckBandgapEnabled(base)) - { - if ((timerIdMask & (uint8_t)kVBAT_BandgapTimer0) != 0U) - { - base->LDOTIMER0 |= VBAT_LDOTIMER0_TIMEN_MASK; - } - - if ((timerIdMask & (uint8_t)kVBAT_BandgapTimer1) != 0U) - { - base->LDOTIMER1 |= VBAT_LDOTIMER1_TIMEN_MASK; - } - } - else - { - /* Bandgap must be enabled previously. */ - status = kStatus_VBAT_BandgapNotEnabled; - } - } - else - { - /* FRO16K must be enabled previously. */ - status = kStatus_VBAT_Fro16kNotEnabled; - } - } - else - { - if ((timerIdMask & (uint8_t)kVBAT_BandgapTimer0) != 0U) - { - base->LDOTIMER0 &= ~VBAT_LDOTIMER0_TIMEN_MASK; - } - - if ((timerIdMask & (uint8_t)kVBAT_BandgapTimer1) != 0U) - { - base->LDOTIMER1 &= ~VBAT_LDOTIMER1_TIMEN_MASK; - } - } - - return status; -} - -/*! - * brief Set bandgap timer0 timeout value. - * - * param base VBAT peripheral base address. - * param timeoutPeriod Bandgap timer timeout value, please refer to vbat_bandgap_timer0_timeout_period_t. - */ -void VBAT_SetBandgapTimer0TimeoutValue(VBAT_Type *base, vbat_bandgap_timer0_timeout_period_t timeoutPeriod) -{ - bool timerEnabled = false; - - timerEnabled = ((base->LDOTIMER0 & VBAT_LDOTIMER0_TIMEN_MASK) != 0UL) ? true : false; - - if (timerEnabled) - { - base->LDOTIMER0 &= ~VBAT_LDOTIMER0_TIMEN_MASK; - } - - base->LDOTIMER0 = ((base->LDOTIMER0 & (~VBAT_LDOTIMER0_TIMCFG_MASK)) | VBAT_LDOTIMER0_TIMCFG(timeoutPeriod)); - - if (timerEnabled) - { - base->LDOTIMER0 |= VBAT_LDOTIMER0_TIMEN_MASK; - } -} - -/*! - * brief Set bandgap timer1 timeout value. - * - * note The timeout value can only be changed when the timer is disabled. - * - * param base VBAT peripheral base address. - * param timeoutPeriod The bandgap timerout 1 period, in number of seconds, ranging from 0 to 65535s. - */ -void VBAT_SetBandgapTimer1TimeoutValue(VBAT_Type *base, uint32_t timeoutPeriod) -{ - bool timerEnabled = false; - - timerEnabled = ((base->LDOTIMER1 & VBAT_LDOTIMER1_TIMEN_MASK) != 0UL) ? true : false; - - if (timerEnabled) - { - base->LDOTIMER1 &= ~VBAT_LDOTIMER1_TIMEN_MASK; - } - - base->LDOTIMER1 = ((base->LDOTIMER1 & (~VBAT_LDOTIMER1_TIMCFG_MASK)) | VBAT_LDOTIMER1_TIMCFG(timeoutPeriod)); - - if (timerEnabled) - { - base->LDOTIMER1 |= VBAT_LDOTIMER1_TIMEN_MASK; - } -} -#endif /* FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) && FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) -/*! - * brief Initializes the VBAT clock monitor, enable clock monitor and set the clock monitor configuration. - * - * note Both FRO16K and OSC32K should be enabled and stable before invoking this function. - * - * param base VBAT peripheral base address. - * param config Pointer to vbat_clock_monitor_config_t structure. - * - * retval kStatus_Success Clock monitor is initialized successfully. - * retval kStatus_VBAT_Fro16kNotEnabled FRO16K is not enabled. - * retval kStatus_VBAT_Osc32kNotReady OSC32K is not ready. - * retval kStatus_VBAT_ClockMonitorLocked Clock monitor is locked. - */ -status_t VBAT_InitClockMonitor(VBAT_Type *base, const vbat_clock_monitor_config_t *config) -{ - assert(config != NULL); - - status_t status = kStatus_Success; - - if (VBAT_CheckFRO16kEnabled(base)) - { - if ((VBAT_GetStatusFlags(base) & kVBAT_StatusFlagOsc32kReady) != 0UL) - { - if (VBAT_CheckClockMonitorControlLocked(base)) - { - status = kStatus_VBAT_ClockMonitorLocked; - } - else - { - /* Disable clock monitor before configuring clock monitor. */ - VBAT_EnableClockMonitor(base, false); - /* Set clock monitor divide trim value. */ - VBAT_SetClockMonitorDivideTrim(base, config->divideTrim); - /* Set clock monitor frequency trim value. */ - VBAT_SetClockMonitorFrequencyTrim(base, config->freqTrim); - /* Enable clock monitor. */ - VBAT_EnableClockMonitor(base, true); - - if (config->lock) - { - VBAT_LockClockMonitorControl(base); - } - } - } - else - { - status = kStatus_VBAT_OSC32KNotReady; - } - } - else - { - status = kStatus_VBAT_Fro16kNotEnabled; - } - - return status; -} - -/*! - * brief Deinitialize the VBAT clock monitor. - * - * param base VBAT peripheral base address. - * - * retval kStatus_Success Clock monitor is de-initialized successfully. - * retval kStatus_VBAT_ClockMonitorLocked Control of Clock monitor is locked. - */ -status_t VBAT_DeinitMonitor(VBAT_Type *base) -{ - if (VBAT_CheckClockMonitorControlLocked(base)) - { - return kStatus_VBAT_ClockMonitorLocked; - } - - VBAT_EnableClockMonitor(base, false); - - return kStatus_Success; -} -#endif /* FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) && FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) -/*! - * brief Initialize tamper control. - * - * note Both FRO16K and bandgap should be enabled before calling this function. - * - * param base VBAT peripheral base address. - * param config Pointer to vbat_tamper_config_t structure. - * - * retval kStatus_Success Tamper is initialized successfully. - * retval kStatus_VBAT_TamperLocked Tamper control is locked. - * retval kStatus_VBAT_BandgapNotEnabled Bandgap is not enabled. - * retval kStatus_VBAT_Fro16kNotEnabled FRO 16K is not enabled. - */ -status_t VBAT_InitTamper(VBAT_Type *base, const vbat_tamper_config_t *config) -{ - assert(config != NULL); - - status_t status = kStatus_Success; - - if (VBAT_CheckFRO16kEnabled(base)) - { - if (VBAT_CheckBandgapEnabled(base)) - { - if (VBAT_CheckTamperControlLocked(base)) - { - return kStatus_VBAT_TamperLocked; - } - else - { - base->TAMCTLA = ((base->TAMCTLA & (~VBAT_TAMCTLA_VOLT_EN_MASK | VBAT_TAMCTLA_TEMP_EN_MASK)) | - VBAT_TAMCTLA_VOLT_EN(config->enableVoltageDetect) | - VBAT_TAMCTLA_TEMP_EN(config->enableTemperatureDetect)); - base->TAMCTLB = ((base->TAMCTLB & (~VBAT_TAMCTLA_VOLT_EN_MASK | VBAT_TAMCTLA_TEMP_EN_MASK)) | - VBAT_TAMCTLA_VOLT_EN((config->enableVoltageDetect) ? 0U : 1U) | - VBAT_TAMCTLA_TEMP_EN((config->enableTemperatureDetect) ? 0U : 1U)); - - if (config->lock) - { - VBAT_LockTamperControl(base); - } - } - } - else - { - status = kStatus_VBAT_BandgapNotEnabled; - } - } - else - { - status = kStatus_VBAT_Fro16kNotEnabled; - } - - return status; -} - -/*! - * brief De-initialize tamper control. - * - * param base VBAT peripheral base address. - * - * retval kStatus_Success Tamper is de-initialized successfully. - * retval kStatus_VBAT_TamperLocked Tamper control is locked. - */ -status_t VBAT_DeinitTamper(VBAT_Type *base) -{ - if (VBAT_CheckTamperControlLocked(base)) - { - return kStatus_VBAT_TamperLocked; - } - - base->TAMCTLA &= ~(VBAT_TAMCTLA_VOLT_EN_MASK | VBAT_TAMCTLA_TEMP_EN_MASK); - base->TAMCTLB |= (VBAT_TAMCTLA_VOLT_EN_MASK | VBAT_TAMCTLA_TEMP_EN_MASK); - - return kStatus_Success; -} -#endif /* FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_vbat.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_vbat.h deleted file mode 100644 index c1f38bc6dc8..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_vbat.h +++ /dev/null @@ -1,1386 +0,0 @@ -/* - * Copyright 2022-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_VBAT_H_ -#define FSL_VBAT_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup mcx_vbat - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief VBAT driver version 2.3.0. */ -#define FSL_VBAT_DRIVER_VERSION (MAKE_VERSION(2, 3, 0)) -/*@}*/ - -#if !defined(VBAT_LDORAMC_RET_MASK) -#define VBAT_LDORAMC_RET_MASK (0xF00U) -#define VBAT_LDORAMC_RET_SHIFT (8U) -#define VBAT_LDORAMC_RET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDORAMC_RET_SHIFT)) & VBAT_LDORAMC_RET_MASK) -#endif - -/*! - * @brief The enumeration of VBAT module status. - */ -enum -{ - kStatus_VBAT_Fro16kNotEnabled = MAKE_STATUS(kStatusGroup_VBAT, 0), /*!< Internal 16kHz free running - oscillator not enabled. */ - kStatus_VBAT_BandgapNotEnabled = MAKE_STATUS(kStatusGroup_VBAT, 1), /*!< Bandgap not enabled. */ - kStatus_VBAT_WrongCapacitanceValue = MAKE_STATUS(kStatusGroup_VBAT, 2), /*!< Wrong capacitance for - selected oscillator mode. */ - kStatus_VBAT_ClockMonitorLocked = MAKE_STATUS(kStatusGroup_VBAT, 3), /*!< Clock monitor locked. */ - kStatus_VBAT_OSC32KNotReady = MAKE_STATUS(kStatusGroup_VBAT, 4), /*!< OSC32K not ready. */ - kStatus_VBAT_LDONotReady = MAKE_STATUS(kStatusGroup_VBAT, 5), /*!< LDO not ready. */ - kStatus_VBAT_TamperLocked = MAKE_STATUS(kStatusGroup_VBAT, 6), /*!< Tamper locked. */ -}; - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_STATUS_REG) && FSL_FEATURE_MCX_VBAT_HAS_STATUS_REG) -/*! - * @brief The enumeration of VBAT status flags. - * - * @anchor vbat_status_flag_t - */ -enum _vbat_status_flag -{ - kVBAT_StatusFlagPORDetect = VBAT_STATUSA_POR_DET_MASK, /*!< VBAT domain has been reset */ - kVBAT_StatusFlagWakeupPin = VBAT_STATUSA_WAKEUP_FLAG_MASK, /*!< A falling edge is detected on the wakeup pin. */ - kVBAT_StatusFlagBandgapTimer0 = VBAT_STATUSA_TIMER0_FLAG_MASK, /*!< Bandgap Timer0 period reached. */ - kVBAT_StatusFlagBandgapTimer1 = VBAT_STATUSA_TIMER1_FLAG_MASK, /*!< Bandgap Timer1 period reached. */ - kVBAT_StatusFlagLdoReady = VBAT_STATUSA_LDO_RDY_MASK, /*!< LDO is enabled and ready. */ - kVBAT_StatusFlagOsc32kReady = VBAT_STATUSA_OSC_RDY_MASK, /*!< OSC32k is enabled and clock is ready. */ -#if defined(VBAT_STATUSA_CLOCK_DET_MASK) - kVBAT_StatusFlagClockDetect = VBAT_STATUSA_CLOCK_DET_MASK, /*!< The clock monitor has detected an error. */ -#endif /* VBAT_STATUSA_CLOCK_DET_MASK */ - kVBAT_StatusFlagConfigDetect = VBAT_STATUSA_CONFIG_DET_MASK, /*!< Configuration error detected. */ -#if defined(VBAT_STATUSA_VOLT_DET_MASK) - kVBAT_StatusFlagVoltageDetect = VBAT_STATUSA_VOLT_DET_MASK, /*!< Voltage monitor has detected - an error with VBAT supply. */ -#endif /* VBAT_STATUSA_VOLT_DET_MASK */ -#if defined(VBAT_STATUSA_TEMP_DET_MASK) - kVBAT_StatusFlagTemperatureDetect = VBAT_STATUSA_TEMP_DET_MASK, /*!< Temperature monitor has detected an error. */ -#endif /* VBAT_STATUSA_TEMP_DET_MASK */ -#if defined(VBAT_STATUSA_SEC0_DET_MASK) - kVBAT_StatusFlagSec0Detect = VBAT_STATUSA_SEC0_DET_MASK, /*!< Security input 0 has detected an error. */ -#endif /* VBAT_STATUSA_SEC0_DET_MASK */ - kVBAT_StatusFlagInterrupt0Detect = VBAT_STATUSA_IRQ0_DET_MASK, /*!< Interrupt 0 asserted. */ - kVBAT_StatusFlagInterrupt1Detect = VBAT_STATUSA_IRQ1_DET_MASK, /*!< Interrupt 1 asserted. */ - kVBAT_StatusFlagInterrupt2Detect = VBAT_STATUSA_IRQ2_DET_MASK, /*!< Interrupt 2 asserted. */ - kVBAT_StatusFlagInterrupt3Detect = VBAT_STATUSA_IRQ3_DET_MASK, /*!< Interrupt 2 asserted. */ -}; - -/*! - * @brief The enumeration of VBAT interrupt enable. - * - * @anchor vbat_interrupt_enable_t - */ -enum _vbat_interrupt_enable -{ - kVBAT_InterruptEnablePORDetect = VBAT_IRQENA_POR_DET_MASK, /*!< Enable POR detect interrupt. */ - kVBAT_InterruptEnableWakeupPin = VBAT_IRQENA_WAKEUP_FLAG_MASK, /*!< Enable the interrupt when a falling edge is - detected on the wakeup pin. */ - kVBAT_InterruptEnableBandgapTimer0 = VBAT_IRQENA_TIMER0_FLAG_MASK, /*!< Enable the interrupt if Bandgap - Timer0 period reached. */ - kVBAT_InterruptEnableBandgapTimer1 = VBAT_IRQENA_TIMER1_FLAG_MASK, /*!< Enable the interrupt if Bandgap - Timer1 period reached. */ - kVBAT_InterruptEnableLdoReady = VBAT_IRQENA_LDO_RDY_MASK, /*!< Enable LDO ready interrupt. */ - kVBAT_InterruptEnableOsc32kReady = VBAT_IRQENA_OSC_RDY_MASK, /*!< Enable OSC32K ready interrupt. */ -#if defined(VBAT_IRQENA_CLOCK_DET_MASK) - kVBAT_InterruptEnableClockDetect = VBAT_IRQENA_CLOCK_DET_MASK, /*!< Enable clock monitor detect interrupt. */ -#endif /* VBAT_IRQENA_CLOCK_DET_MASK */ - kVBAT_InterruptEnableConfigDetect = - VBAT_IRQENA_CONFIG_DET_MASK, /*!< Enable configuration error detected interrupt. */ -#if defined(VBAT_IRQENA_VOLT_DET_MASK) - kVBAT_InterruptEnableVoltageDetect = VBAT_IRQENA_VOLT_DET_MASK, /*!< Enable voltage monitor detect interrupt. */ -#endif /* VBAT_IRQENA_VOLT_DET_MASK */ -#if defined(VBAT_IRQENA_TEMP_DET_MASK) - kVBAT_InterruptEnableTemperatureDetect = VBAT_IRQENA_TEMP_DET_MASK, /*!< Enable temperature monitor detect - interrupt. */ -#endif /* VBAT_IRQENA_TEMP_DET_MASK */ -#if defined(VBAT_IRQENA_SEC0_DET_MASK) - kVBAT_InterruptEnableSec0Detect = VBAT_IRQENA_SEC0_DET_MASK, /*!< Enable security input 0 detect interrupt. */ -#endif /* VBAT_IRQENA_SEC0_DET_MASK */ - kVBAT_InterruptEnableInterrupt0 = VBAT_IRQENA_IRQ0_DET_MASK, /*!< Enable the interrupt0. */ - kVBAT_InterruptEnableInterrupt1 = VBAT_IRQENA_IRQ1_DET_MASK, /*!< Enable the interrupt1. */ - kVBAT_InterruptEnableInterrupt2 = VBAT_IRQENA_IRQ2_DET_MASK, /*!< Enable the interrupt2. */ - kVBAT_InterruptEnableInterrupt3 = VBAT_IRQENA_IRQ3_DET_MASK, /*!< Enable the interrupt3. */ - - kVBAT_AllInterruptsEnable = - (VBAT_IRQENA_POR_DET_MASK | VBAT_IRQENA_WAKEUP_FLAG_MASK | VBAT_IRQENA_TIMER0_FLAG_MASK | - VBAT_IRQENA_TIMER1_FLAG_MASK | VBAT_IRQENA_LDO_RDY_MASK | VBAT_IRQENA_OSC_RDY_MASK | - VBAT_IRQENA_CONFIG_DET_MASK | VBAT_IRQENA_IRQ0_DET_MASK | VBAT_IRQENA_IRQ1_DET_MASK | - VBAT_IRQENA_IRQ2_DET_MASK | VBAT_IRQENA_IRQ3_DET_MASK), /*!< Enable all interrupts. */ -}; - -/*! - * @brief The enumeration of VBAT wakeup enable. - * - * @anchor vbat_wakeup_enable_t - */ -enum _vbat_wakeup_enable -{ - kVBAT_WakeupEnablePORDetect = VBAT_WAKENA_POR_DET_MASK, /*!< Enable POR detect wakeup. */ - kVBAT_WakeupEnableWakeupPin = VBAT_WAKENA_WAKEUP_FLAG_MASK, /*!< Enable wakeup feature when a falling edge is - detected on the wakeup pin. */ - kVBAT_WakeupEnableBandgapTimer0 = VBAT_WAKENA_TIMER0_FLAG_MASK, /*!< Enable wakeup feature when bandgap - timer0 period reached. */ - kVBAT_WakeupEnableBandgapTimer1 = VBAT_WAKENA_TIMER1_FLAG_MASK, /*!< Enable wakeup feature when bandgap - timer1 period reached. */ - kVBAT_WakeupEnableLdoReady = VBAT_WAKENA_LDO_RDY_MASK, /*!< Enable wakeup when LDO ready. */ - kVBAT_WakeupEnableOsc32kReady = VBAT_WAKENA_OSC_RDY_MASK, /*!< Enable wakeup when OSC32k ready. */ -#if defined(VBAT_WAKENA_CLOCK_DET_MASK) - kVBAT_WakeupEnableClockDetect = - VBAT_WAKENA_CLOCK_DET_MASK, /*!< Enable wakeup when clock monitor detect an error. */ -#endif /* VBAT_WAKENA_CLOCK_DET_MASK */ - kVBAT_WakeupEnableConfigDetect = VBAT_WAKENA_CONFIG_DET_MASK, /*!< Enable wakeup when - configuration error detected. */ -#if defined(VBAT_WAKENA_VOLT_DET_MASK) - kVBAT_WakeupEnableVoltageDetect = VBAT_WAKENA_VOLT_DET_MASK, /*!< Enable wakeup when voltage monitor detect an - error. */ -#endif /* VBAT_WAKENA_VOLT_DET_MASK */ -#if defined(VBAT_WAKENA_TEMP_DET_MASK) - kVBAT_WakeupEnableTemperatureDetect = VBAT_WAKENA_TEMP_DET_MASK, /*!< Enable wakeup when temperature monitor - detect an error. */ -#endif /* VBAT_WAKENA_TEMP_DET_MASK */ -#if defined(VBAT_WAKENA_SEC0_DET_MASK) - kVBAT_WakeupEnableSec0Detect = VBAT_WAKENA_SEC0_DET_MASK, /*!< Enable wakeup when security input 0 detect an - error. */ -#endif /* VBAT_WAKENA_SEC0_DET_MASK */ - kVBAT_WakeupEnableInterrupt0 = VBAT_WAKENA_IRQ0_DET_MASK, /*!< Enable wakeup when interrupt0 asserted. */ - kVBAT_WakeupEnableInterrupt1 = VBAT_WAKENA_IRQ1_DET_MASK, /*!< Enable wakeup when interrupt1 asserted. */ - kVBAT_WakeupEnableInterrupt2 = VBAT_WAKENA_IRQ2_DET_MASK, /*!< Enable wakeup when interrupt2 asserted. */ - kVBAT_WakeupEnableInterrupt3 = VBAT_WAKENA_IRQ3_DET_MASK, /*!< Enable wakeup when interrupt3 asserted. */ - - kVBAT_AllWakeupsEnable = (VBAT_WAKENA_POR_DET_MASK | VBAT_WAKENA_WAKEUP_FLAG_MASK | VBAT_WAKENA_TIMER0_FLAG_MASK | - VBAT_WAKENA_TIMER1_FLAG_MASK | VBAT_WAKENA_LDO_RDY_MASK | VBAT_WAKENA_OSC_RDY_MASK | - VBAT_WAKENA_CONFIG_DET_MASK | VBAT_WAKENA_IRQ0_DET_MASK | VBAT_WAKENA_IRQ1_DET_MASK | - VBAT_WAKENA_IRQ2_DET_MASK | VBAT_WAKENA_IRQ3_DET_MASK - -#if defined(VBAT_WAKENA_CLOCK_DET_MASK) - | VBAT_WAKENA_CLOCK_DET_MASK - -#endif /* VBAT_WAKENA_CLOCK_DET_MASK */ -#if defined(VBAT_WAKENA_VOLT_DET_MASK) - | VBAT_WAKENA_VOLT_DET_MASK - -#endif /* VBAT_WAKENA_VOLT_DET_MASK */ -#if defined(VBAT_WAKENA_TEMP_DET_MASK) - | VBAT_WAKENA_TEMP_DET_MASK - -#endif /* VBAT_WAKENA_TEMP_DET_MASK */ -#if defined(VBAT_WAKENA_SEC0_DET_MASK) - | VBAT_WAKENA_SEC0_DET_MASK - -#endif /* VBAT_WAKENA_SEC0_DET_MASK */ - ), /*!< Enable all wakeup. */ -}; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_STATUS_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) && FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) -/*! - * @brief The enumeration of VBAT tamper enable. - */ -enum _vbat_tamper_enable -{ - kVBAT_TamperEnablePOR = VBAT_TAMPERA_POR_DET_MASK, /*!< Enable tamper if POR asserted in STATUS register. */ - kVBAT_TamperEnableClockDetect = VBAT_TAMPERA_CLOCK_DET_MASK, /*!< Enable tamper if clock monitor detect an error. */ - kVBAT_TamperEnableConfigDetect = - VBAT_TAMPERA_CONFIG_DET_MASK, /*!< Enable tamper if configuration error detected. */ - kVBAT_TamperEnableVoltageDetect = VBAT_TAMPERA_VOLT_DET_MASK, /*!< Enable tamper if voltage monitor detect an - error. */ - kVBAT_TamperEnableTemperatureDetect = VBAT_TAMPERA_TEMP_DET_MASK, /*!< Enable tamper if temperature monitor - detect an error. */ - kVBAT_TamperEnableSec0Detect = VBAT_TAMPERA_SEC0_DET_MASK, /*!< Enable tamper if security input 0 detect an - error. */ -}; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) && FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) -/*! - * @brief The enumeration of bandgap timer id, VBAT support two bandgap timers. - * - * @anchor vbat_bandgap_timer_id_t - */ -enum _vbat_bandgap_timer_id -{ - kVBAT_BandgapTimer0 = 1U << 0U, /*!< Bandgap Timer0. */ - kVBAT_BandgapTimer1 = 1U << 1U, /*!< Bandgap Timer1. */ -}; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER */ - -/*! - * @brief The enumeration of connections for OSC32K/FRO32K output clock to other modules. - * - * @anchor vbat_clock_enable_t - */ -enum _vbat_clock_enable -{ - kVBAT_EnableClockToDomain0 = 1U << 0U, /*!< Enable clock to power domain0. */ - kVBAT_EnableClockToDomain1 = 1U << 1U, /*!< Enable clock to power domain1. */ - kVBAT_EnableClockToDomain2 = 1U << 2U, /*!< Enable clock to power domain2. */ - kVBAT_EnableClockToDomain3 = 1U << 3U, /*!< Enable clock to power domain3. */ -}; -#define kVBAT_EnableClockToVddBat kVBAT_EnableClockToDomain0 -#define kVBAT_EnableClockToVddSys kVBAT_EnableClockToDomain1 -#define kVBAT_EnableClockToVddWake kVBAT_EnableClockToDomain2 -#define kVBAT_EnableClockToVddMain kVBAT_EnableClockToDomain3 - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG) -/*! - * @brief The enumeration of SRAM arrays that controlled by VBAT. - * @anchor vbat_ram_array_t - */ -enum _vbat_ram_array -{ - kVBAT_SramArray0 = 1U << 0U, /*!< Specify SRAM array0 that controlled by VBAT. */ - kVBAT_SramArray1 = 1U << 1U, /*!< Specify SRAM array1 that controlled by VBAT. */ - kVBAT_SramArray2 = 1U << 2U, /*!< Specify SRAM array2 that controlled by VBAT. */ - kVBAT_SramArray3 = 1U << 3U, /*!< Specify SRAM array3 that controlled by VBAT. */ -}; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG */ - -/*! - * @brief The enumeration of bandgap refresh period. - */ -typedef enum _vbat_bandgap_refresh_period -{ - kVBAT_BandgapRefresh7P8125ms = 0U, /*!< Bandgap refresh every 7.8125ms. */ - kVBAT_BandgapRefresh15P625ms = 1U, /*!< Bandgap refresh every 15.625ms. */ - kVBAT_BandgapRefresh31P25ms = 2U, /*!< Bandgap refresh every 31.25ms. */ - kVBAT_BandgapRefresh62P5ms = 3U, /*!< Bandgap refresh every 62.5ms. */ -} vbat_bandgap_refresh_period_t; - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) && FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) -/*! - * @brief The enumeration of bandgap timer0 timeout period. - */ -typedef enum _vbat_bandgap_timer0_timeout_period -{ - kVBAT_BangapTimer0Timeout1s = 0U, /*!< Bandgap timer0 timerout every 1s. */ - kVBAT_BangapTimer0Timeout500ms = 1U, /*!< Bandgap timer0 timerout every 500ms. */ - kVBAT_BangapTimer0Timeout250ms = 2U, /*!< Bandgap timer0 timerout every 250ms. */ - kVBAT_BangapTimer0Timeout125ms = 3U, /*!< Bandgap timer0 timerout every 125ms. */ - kVBAT_BangapTimer0Timeout62P5ms = 4U, /*!< Bandgap timer0 timerout every 62.5ms. */ - kVBAT_BangapTimer0Timeout31P25ms = 5U, /*!< Bandgap timer0 timerout every 31.25ms. */ -} vbat_bandgap_timer0_timeout_period_t; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG) -/*! - * @brief The enumeration of osc32k operate mode, including Bypass mode, low power switched mode and so on. - */ -typedef enum _vbat_osc32k_operate_mode -{ - kVBAT_Osc32kEnabledToTransconductanceMode = 0U, /*!< Set to transconductance mode. */ - kVBAT_Osc32kEnabledToLowPowerBackupMode = 1U, /*!< Set to low power backup mode. */ - kVBAT_Osc32kEnabledToLowPowerSwitchedMode = 2U, /*!< Set to low power switched mode. */ -} vbat_osc32k_operate_mode_t; - -/*! - * @brief The enumeration of OSC32K load capacitance. - */ -typedef enum _vbat_osc32k_load_capacitance_select -{ - kVBAT_Osc32kCrystalLoadCap0pF = - 0U, /*!< Internal capacitance bank is enabled, set the internal capacitance to 0 pF. */ - kVBAT_Osc32kCrystalLoadCap2pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 2 pF. */ - kVBAT_Osc32kCrystalLoadCap4pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 4 pF. */ - kVBAT_Osc32kCrystalLoadCap6pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 6 pF. */ - kVBAT_Osc32kCrystalLoadCap8pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 8 pF. */ - kVBAT_Osc32kCrystalLoadCap10pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 10 pF. */ - kVBAT_Osc32kCrystalLoadCap12pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 12 pF. */ - kVBAT_Osc32kCrystalLoadCap14pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 14 pF. */ - kVBAT_Osc32kCrystalLoadCap16pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 16 pF. */ - kVBAT_Osc32kCrystalLoadCap18pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 18 pF. */ - kVBAT_Osc32kCrystalLoadCap20pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 20 pF. */ - kVBAT_Osc32kCrystalLoadCap22pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 22 pF. */ - kVBAT_Osc32kCrystalLoadCap24pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 24 pF. */ - kVBAT_Osc32kCrystalLoadCap26pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 26 pF. */ - kVBAT_Osc32kCrystalLoadCap28pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 28 pF. */ - kVBAT_Osc32kCrystalLoadCap30pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 30 pF. */ - kVBAT_Osc32kCrystalLoadCapBankDisabled = 0xF0U, /*!< Internal capacitance bank is disabled. */ -} vbat_osc32k_load_capacitance_select_t; - -/*! - * @brief The enumeration of start-up time of the oscillator. - */ -typedef enum _vbat_osc32k_start_up_time -{ - kVBAT_Osc32kStartUpTime8Sec = 0U, /*!< Configure the start-up time as 8 seconds. */ - kVBAT_Osc32kStartUpTime4Sec, /*!< Configure the start-up time as 4 seconds. */ - kVBAT_Osc32kStartUpTime2Sec, /*!< Configure the start-up time as 2 seconds. */ - kVBAT_Osc32kStartUpTime1Sec, /*!< Configure the start-up time as 1 seconds. */ - kVBAT_Osc32kStartUpTime0P5Sec, /*!< Configure the start-up time as 0.5 seconds. */ - kVBAT_Osc32kStartUpTime0P25Sec, /*!< Configure the start-up time as 0.25 seconds. */ - kVBAT_Osc32kStartUpTime0P125Sec, /*!< Configure the start-up time as 0.125 seconds. */ - kVBAT_Osc32kStartUpTime0P5MSec, /*!< Configure the start-up time as 0.5 milliseconds. */ -} vbat_osc32k_start_up_time_t; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_SWICTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_SWICTL_REG) -/*! - * @brief The enumeration of VBAT module supplies. - */ -typedef enum _vbat_internal_module_supply -{ - kVBAT_ModuleSuppliedByVddBat = 0U, /*!< VDD_BAT supplies VBAT modules. */ - kVBAT_ModuleSuppliedByVddSys = 1U, /*!< VDD_SYS supplies VBAT modules. */ -} vbat_internal_module_supply_t; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_SWICTL_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) && FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) -/*! - * @brief The enumeration of VBAT clock monitor divide trim value - */ -typedef enum _vbat_clock_monitor_divide_trim -{ - kVBAT_ClockMonitorOperateAt1kHz = 0U, /*!< Clock monitor operates at 1 kHz. */ - kVBAT_ClockMonitorOperateAt64Hz = 1U, /*!< Clock monitor operates at 64 Hz. */ -} vbat_clock_monitor_divide_trim_t; - -/*! - * @brief The enumeration of VBAT clock monitor frequency trim value used to adjust the clock monitor assert. - */ -typedef enum _vbat_clock_monitor_freq_trim -{ - kVBAT_ClockMonitorAssert2Cycle = 0U, /*!< Clock monitor assert 2 cycles after expected edge. */ - kVBAT_ClockMonitorAssert4Cycle = 1U, /*!< Clock monitor assert 4 cycles after expected edge. */ - kVBAT_ClockMonitorAssert6Cycle = 2U, /*!< Clock monitor assert 8 cycles after expected edge. */ - kVBAT_ClockMonitorAssert8Cycle = 3U, /*!< Clock monitor assert 8 cycles after expected edge. */ -} vbat_clock_monitor_freq_trim_t; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG */ - -/*! - * @brief The structure of internal 16kHz free running oscillator attributes. - */ -typedef struct _vbat_fro16k_config -{ - bool enableFRO16k; /*!< Enable/disable internal 16kHz free running oscillator. */ - uint8_t enabledConnectionsMask; /*!< The mask of connected modules to enable FRO16k clock output. */ -} vbat_fro16k_config_t; - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) && FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) -/*! - * @brief The structure of internal clock monitor, including divide trim and frequency trim. - */ -typedef struct _vbat_clock_monitor_config -{ - vbat_clock_monitor_divide_trim_t divideTrim : 1U; /* !< Divide trim value, please - refer to @ref vbat_clock_monitor_divide_trim_t */ - vbat_clock_monitor_freq_trim_t freqTrim : 2U; /*!< Frequency trim value used to adjust the clock monitor - assert, please refer to @ref vbat_clock_monitor_freq_trim_t. */ - bool lock : 1U; /*!< Lock the clock monitor control after enabled. */ -} vbat_clock_monitor_config_t; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) && FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) -/*! - * @brief The structure of Tamper configuration. - */ -typedef struct _vbat_tamper_config -{ - bool enableVoltageDetect : 1U; /*!< Enable/disable voltage detection. */ - bool enableTemperatureDetect : 1U; /*!< Enable/disable temperature detection. */ - bool lock : 1U; /*!< Lock the tamper control after enabled. */ -} vbat_tamper_config_t; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name FRO16K Control Interfaces - * @{ - */ - -/*! - * @brief Configure internal 16kHz free running oscillator, including enabel FRO16k, gate FRO16k output. - * - * @param base VBAT peripheral base address. - * @param config Pointer to @ref vbat_fro16k_config_t structure. - */ -void VBAT_ConfigFRO16k(VBAT_Type *base, const vbat_fro16k_config_t *config); - -/*! - * @brief Enable/disable internal 16kHz free running oscillator. - * - * @param base VBAT peripheral base address. - * @param enable Used to enable/disable 16kHz FRO. - * - \b true Enable internal 16kHz free running oscillator. - * - \b false Disable internal 16kHz free running oscillator. - */ -static inline void VBAT_EnableFRO16k(VBAT_Type *base, bool enable) -{ - if (enable) - { - base->FROCTLA |= VBAT_FROCTLA_FRO_EN_MASK; -#if (defined(VBAT_FROCTLB_INVERSE_MASK)) - base->FROCTLB &= ~VBAT_FROCTLB_INVERSE_MASK; -#endif /* VBAT_FROCTLB_INVERSE_MASK */ - } - else - { - base->FROCTLA &= ~VBAT_FROCTLA_FRO_EN_MASK; -#if (defined(VBAT_FROCTLB_INVERSE_MASK)) - base->FROCTLB |= VBAT_FROCTLB_INVERSE_MASK; -#endif /* VBAT_FROCTLB_INVERSE_MASK */ - } -} - -/*! - * @brief Check if internal 16kHz free running oscillator is enabled. - * - * @param base VBAT peripheral base address. - * - * @retval true The internal 16kHz Free running oscillator is enabled. - * @retval false The internal 16kHz Free running oscillator is enabled. - */ -static inline bool VBAT_CheckFRO16kEnabled(VBAT_Type *base) -{ - return (bool)((base->FROCTLA & VBAT_FROCTLA_FRO_EN_MASK) == VBAT_FROCTLA_FRO_EN_MASK); -} - -/*! - * @brief Enable FRO16kHz output clock to selected modules. - * - * @param base VBAT peripheral base address. - * @param connectionsMask The mask of modules that FRO16k is connected, should be the OR'ed - * value of @ref vbat_clock_enable_t. - */ -static inline void VBAT_UngateFRO16k(VBAT_Type *base, uint8_t connectionsMask) -{ - base->FROCLKE |= VBAT_FROCLKE_CLKE(connectionsMask); -} - -/*! - * @brief Disable FRO16kHz output clock to selected modules. - * - * @param base VBAT peripheral base address. - * @param connectionsMask The OR'ed value of @ref vbat_clock_enable_t. - */ -static inline void VBAT_GateFRO16k(VBAT_Type *base, uint8_t connectionsMask) -{ - base->FROCLKE &= ~VBAT_FROCLKE_CLKE(connectionsMask); -} - -/*! - * @brief Lock settings of internal 16kHz free running oscillator, please note that if locked 16kHz FRO's settings can - * not be updated until the next POR. - * - * @note Please note that the operation to ungate/gate FRO 16kHz output clock can not be locked by this function. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_LockFRO16kSettings(VBAT_Type *base) -{ - base->FROLCKA |= VBAT_FROLCKA_LOCK_MASK; -#if (defined(VBAT_FROLCKB_LOCK_MASK)) - base->FROLCKB &= ~VBAT_FROLCKB_LOCK_MASK; -#endif /* VBAT_FROLCKB_LOCK_MASK */ -} - -/*! - * @brief Check if FRO16K settings are locked. - * - * @param base VBAT peripheral base address. - * - * @return @c true in case of FRO16k settings are locked, @c false in case of FRO16k settings are not locked. - */ -static inline bool VBAT_CheckFRO16kSettingsLocked(VBAT_Type *base) -{ - return ((base->FROLCKA & VBAT_FROLCKA_LOCK_MASK) != 0UL); -} - -/*! @} */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG) -/*! - * @name OSC32K Control Interfaces - * @{ - */ - -/*! - * @brief Enable/disable 32K Crystal Oscillator. - * - * @param base VBAT peripheral base address. - * @param enable Used to enable/disable 32k Crystal Oscillator: - * - \b true Enable crystal oscillator and polling status register to check clock is ready. - * - \b false Disable crystal oscillator. - */ -static inline void VBAT_EnableCrystalOsc32k(VBAT_Type *base, bool enable) -{ - if (enable) - { - base->OSCCTLA |= VBAT_OSCCTLA_OSC_EN_MASK; - base->OSCCTLB &= ~VBAT_OSCCTLA_OSC_EN_MASK; - - /* Polling status register to check clock is ready. */ - while ((base->STATUSA & VBAT_STATUSA_OSC_RDY_MASK) == 0UL) - ; - } - else - { - base->OSCCTLA &= ~VBAT_OSCCTLA_OSC_EN_MASK; - base->OSCCTLB |= VBAT_OSCCTLA_OSC_EN_MASK; - } -} - -/*! - * @brief Bypass 32k crystal oscillator, the clock is still output by oscillator but this clock is the same as clock - * provided on EXTAL pin. - * - * @note In bypass mode, oscillator must be enabled; To exit bypass mode, oscillator must be disabled. - * - * @param base VBAT peripheral base address. - * @param enableBypass Used to enter/exit bypass mode: - * - \b true Enter into bypass mode; - * - \b false Exit bypass mode. - */ -static inline void VBAT_BypassCrystalOsc32k(VBAT_Type *base, bool enableBypass) -{ - if (enableBypass) - { - base->OSCCTLA |= (VBAT_OSCCTLA_OSC_EN_MASK | VBAT_OSCCTLA_OSC_BYP_EN_MASK); - base->OSCCTLB &= ~(VBAT_OSCCTLA_OSC_EN_MASK | VBAT_OSCCTLA_OSC_BYP_EN_MASK); - } - else - { - base->OSCCTLA &= ~(VBAT_OSCCTLA_OSC_EN_MASK | VBAT_OSCCTLA_OSC_BYP_EN_MASK); - base->OSCCTLB |= (VBAT_OSCCTLA_OSC_EN_MASK | VBAT_OSCCTLA_OSC_BYP_EN_MASK); - } -} - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_OSCCTLA_FINE_AMP_GAIN_BIT) && FSL_FEATURE_MCX_VBAT_HAS_OSCCTLA_FINE_AMP_GAIN_BIT) -/*! - * @brief Adjust 32k crystal oscillator amplifier gain. - * - * @param base VBAT peripheral base address. - * @param coarse Specify amplifier coarse trim value. - * @param fine Specify amplifier fine trim value. - */ -static inline void VBAT_AdjustCrystalOsc32kAmplifierGain(VBAT_Type *base, uint8_t coarse, uint8_t fine) -{ - base->OSCCTLA = ((base->OSCCTLA & ~(VBAT_OSCCTLA_COARSE_AMP_GAIN_MASK | VBAT_OSCCTLA_FINE_AMP_GAIN_MASK)) | - (VBAT_OSCCTLA_COARSE_AMP_GAIN(coarse) | VBAT_OSCCTLA_FINE_AMP_GAIN(fine))); - base->OSCCTLB = ((base->OSCCTLB & ~(VBAT_OSCCTLA_COARSE_AMP_GAIN_MASK | VBAT_OSCCTLA_FINE_AMP_GAIN_MASK)) | - (VBAT_OSCCTLA_COARSE_AMP_GAIN(~coarse) | VBAT_OSCCTLA_FINE_AMP_GAIN(~fine))); -} -#else -/*! - * @brief Adjust 32k crystal oscillator amplifier gain. - * - * @param base VBAT peripheral base address. - * @param coarse Specify amplifier coarse trim value. - */ -static inline void VBAT_AdjustCrystalOsc32kAmplifierGain(VBAT_Type *base, uint8_t coarse) -{ - base->OSCCTLA = (base->OSCCTLA & ~VBAT_OSCCTLA_COARSE_AMP_GAIN_MASK) | (VBAT_OSCCTLA_COARSE_AMP_GAIN(coarse)); - base->OSCCTLB = (base->OSCCTLB & ~VBAT_OSCCTLA_COARSE_AMP_GAIN_MASK) | (VBAT_OSCCTLA_COARSE_AMP_GAIN(~coarse)); -} - -#endif /* */ - -/*! - * @brief Set 32k crystal oscillator mode and load capacitance for the XTAL/EXTAL pin. - * - * @param base VBAT peripheral base address. - * @param operateMode Specify the crystal oscillator mode, please refer to @ref vbat_osc32k_operate_mode_t. - * @param xtalCap Specify the internal capacitance for the XTAL pin from the capacitor bank. - * @param extalCap Specify the internal capacitance for the EXTAL pin from the capacitor bank. - * - * @retval kStatus_VBAT_WrongCapacitanceValue The load capacitance value to set is not align with operate mode's - * requirements. - * @retval kStatus_Success Success to set operate mode and load capacitance. - */ -status_t VBAT_SetCrystalOsc32kModeAndLoadCapacitance(VBAT_Type *base, - vbat_osc32k_operate_mode_t operateMode, - vbat_osc32k_load_capacitance_select_t xtalCap, - vbat_osc32k_load_capacitance_select_t extalCap); - -/*! - * @brief Trim 32k crystal oscillator startup time. - * - * @param base VBAT peripheral base address. - * @param startupTime Specify the startup time of the oscillator. - */ -static inline void VBAT_TrimCrystalOsc32kStartupTime(VBAT_Type *base, vbat_osc32k_start_up_time_t startupTime) -{ - base->OSCCFGA = ((base->OSCCFGA & ~(VBAT_OSCCFGA_INIT_TRIM_MASK)) | VBAT_OSCCFGA_INIT_TRIM(startupTime)); - base->OSCCFGB = ((base->OSCCFGB & ~(VBAT_OSCCFGA_INIT_TRIM_MASK)) | VBAT_OSCCFGA_INIT_TRIM(~((uint32_t)startupTime))); -} - -/*! - * @brief Set crystal oscillator comparator trim value when oscillator is set as low power switch mode. - * - * @param base VBAT peripheral base address. - * @param comparatorTrimValue Comparator trim value, ranges from 0 to 7. - */ -static inline void VBAT_SetOsc32kSwitchModeComparatorTrimValue(VBAT_Type *base, uint8_t comparatorTrimValue) -{ - base->OSCCFGA = ((base->OSCCFGA & ~VBAT_OSCCFGA_CMP_TRIM_MASK) | VBAT_OSCCFGA_CMP_TRIM(comparatorTrimValue)); - base->OSCCFGB = ((base->OSCCFGB & ~VBAT_OSCCFGA_CMP_TRIM_MASK) | VBAT_OSCCFGA_CMP_TRIM(~((uint32_t)comparatorTrimValue))); -} - -/*! - * @brief Set crystal oscillator delay trim value when oscillator is set as low power switch mode. - * - * @param base VBAT peripheral base address. - * @param delayTrimValue Delay trim value, ranges from 0 to 15. - */ -static inline void VBAT_SetOsc32kSwitchModeDelayTrimValue(VBAT_Type *base, uint8_t delayTrimValue) -{ - base->OSCCFGA = ((base->OSCCFGA & ~VBAT_OSCCFGA_DLY_TRIM_MASK) | VBAT_OSCCFGA_DLY_TRIM(delayTrimValue)); - base->OSCCFGB = ((base->OSCCFGB & ~VBAT_OSCCFGA_DLY_TRIM_MASK) | VBAT_OSCCFGA_DLY_TRIM(~((uint32_t)delayTrimValue))); -} - -/*! - * @brief Set crystal oscillator capacitor trim value when oscillator is set as low power switch mode. - * - * @param base VBAT peripheral base address. - * @param capacitorTrimValue Capacitor value to trim, ranges from 0 to 3. - */ -static inline void VBAT_SetOsc32kSwitchModeCapacitorTrimValue(VBAT_Type *base, uint8_t capacitorTrimValue) -{ - base->OSCCFGA = ((base->OSCCFGA & ~VBAT_OSCCFGA_CAP_TRIM_MASK) | VBAT_OSCCFGA_CAP_TRIM(capacitorTrimValue)); - base->OSCCFGB = ((base->OSCCFGB & ~VBAT_OSCCFGA_CAP_TRIM_MASK) | VBAT_OSCCFGA_CAP_TRIM(~((uint32_t)capacitorTrimValue))); -} - -/*! - * @brief Lock Osc32k settings, after locked all writes to the Oscillator registers are blocked. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_LookOsc32kSettings(VBAT_Type *base) -{ - base->OSCLCKA |= VBAT_OSCLCKA_LOCK_MASK; - base->OSCLCKB &= ~VBAT_OSCLCKB_LOCK_MASK; -} - -/*! - * @brief Unlock Osc32k settings. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_UnlockOsc32kSettings(VBAT_Type *base) -{ - base->OSCLCKA &= ~VBAT_OSCLCKA_LOCK_MASK; - base->OSCLCKB |= VBAT_OSCLCKB_LOCK_MASK; -} - -/*! - * @brief Check if osc32k settings are locked. - * - * @param base VBAT peripheral base address. - * @return \c true in case of osc32k settings are locked, \c false in case of osc32k settings are not locked. - */ -static inline bool VBAT_CheckOsc32kSettingsLocked(VBAT_Type *base) -{ - return ((base->OSCLCKA & VBAT_OSCLCKA_LOCK_MASK) != 0UL); -} - -/*! - * @brief Enable OSC32k output clock to selected modules. - * - * @param base VBAT peripheral base address. - * @param connectionsMask The OR'ed value of @ref vbat_clock_enable_t. - */ -static inline void VBAT_UngateOsc32k(VBAT_Type *base, uint8_t connectionsMask) -{ - base->OSCCLKE |= VBAT_OSCCLKE_CLKE(connectionsMask); -} - -/*! - * @brief Disable OSC32k output clock to selected modules. - * - * @param base VBAT peripheral base address. - * @param connectionsMask The OR'ed value of @ref vbat_clock_enable_t. - */ -static inline void VBAT_GateOsc32k(VBAT_Type *base, uint8_t connectionsMask) -{ - base->OSCCLKE &= ~VBAT_OSCCLKE_CLKE(connectionsMask); -} - -/*! @} */ -#endif /* FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG) -/*! - * @name RAM_LDO Control Interfaces - * @{ - */ - -/*! - * @brief Enable/disable Bandgap. - * - * @note The FRO16K must be enabled before enabling the bandgap. - * @note This setting can be locked by VBAT_LockRamLdoSettings() function. - * - * @param base VBAT peripheral base address. - * @param enable Used to enable/disable bandgap. - * - \b true Enable the bandgap. - * - \b false Disable the bandgap. - * - * @retval kStatus_Success Success to enable/disable the bandgap. - * @retval kStatus_VBAT_Fro16kNotEnabled Fail to enable the bandgap due to FRO16k is not enabled previously. - */ -status_t VBAT_EnableBandgap(VBAT_Type *base, bool enable); - -/*! - * @brief Check if bandgap is enabled. - * - * @param base VBAT peripheral base address. - * - * @retval true The bandgap is enabled. - * @retval false The bandgap is disabled. - */ -static inline bool VBAT_CheckBandgapEnabled(VBAT_Type *base) -{ - return (bool)((base->LDOCTLA & VBAT_LDOCTLA_BG_EN_MASK) == VBAT_LDOCTLA_BG_EN_MASK); -} - -/*! - * @brief Enable/disable bandgap low power refresh mode. - * - * @note For lowest power consumption, refresh mode must be enabled. - * @note This setting can be locked by VBAT_LockRamLdoSettings() function. - * - * @param base VBAT peripheral base address. - * @param enableRefreshMode Used to enable/disable bandgap low power refresh mode. - * - \b true Enable bandgap low power refresh mode. - * - \b false Disable bandgap low power refresh mode. - */ -static inline void VBAT_EnableBandgapRefreshMode(VBAT_Type *base, bool enableRefreshMode) -{ - if (enableRefreshMode) - { - base->LDOCTLA |= VBAT_LDOCTLA_REFRESH_EN_MASK; - base->LDOCTLB &= ~VBAT_LDOCTLA_REFRESH_EN_MASK; - } - else - { - base->LDOCTLA &= ~VBAT_LDOCTLA_REFRESH_EN_MASK; - base->LDOCTLB |= VBAT_LDOCTLA_REFRESH_EN_MASK; - } -} - -/*! - * @brief Enable/disable Backup RAM Regulator(RAM_LDO). - * - * @note This setting can be locked by VBAT_LockRamLdoSettings() function. - * - * @param base VBAT peripheral base address. - * @param enable Used to enable/disable RAM_LDO. - * - \b true Enable backup SRAM regulator. - * - \b false Disable backup SRAM regulator. - * - * @retval kStatusSuccess Success to enable/disable backup SRAM regulator. - * @retval kStatus_VBAT_Fro16kNotEnabled Fail to enable backup SRAM regulator due to FRO16k is not enabled previously. - * @retval kStatus_VBAT_BandgapNotEnabled Fail to enable backup SRAM regulator due to the bandgap is not enabled - * previously. - */ -status_t VBAT_EnableBackupSRAMRegulator(VBAT_Type *base, bool enable); - -/*! - * @brief Lock settings of RAM_LDO, please note that if locked then RAM_LDO's settings - * can not be updated until the next POR. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_LockRamLdoSettings(VBAT_Type *base) -{ - base->LDOLCKA |= VBAT_LDOLCKA_LOCK_MASK; - base->LDOLCKB &= ~VBAT_LDOLCKA_LOCK_MASK; -} - -/*! - * @brief Check if RAM_LDO settings is locked. - * - * @param base VBAT peripheral base address. - * @return @c true in case of RAM_LDO settings are locked, @c false in case of RAM_LDO settings are unlocked. - */ -static inline bool VBAT_CheckRamLdoSettingsLocked(VBAT_Type *base) -{ - return ((base->LDOLCKA & VBAT_LDOLCKA_LOCK_MASK) != 0UL); -} - -/*! - * @brief Switch the SRAM to be powered by LDO_RAM. - * - * @note This function can be used to switch the SRAM to the VBAT retention supply at any time, but please note that the - * SRAM must not be accessed during this time. - * @note Invoke this function to switch power supply before switching off external power. - * @note RAM_LDO must be enabled before invoking this function. - * @note To access the SRAM arrays retained by the LDO_RAM, please invoke VBAT_SwitchSRAMPowerBySocSupply(), after - * external power is switched back on. - * - * @param base VBAT peripheral base address. - * - * @retval kStatusSuccess Success to Switch SRAM powered by VBAT. - * @retval kStatus_VBAT_Fro16kNotEnabled Fail to switch SRAM powered by VBAT due to FRO16K not enabled previously. - */ -status_t VBAT_SwitchSRAMPowerByLDOSRAM(VBAT_Type *base); - -/*! - * @brief Switch the RAM to be powered by Soc Supply in software mode. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_SwitchSRAMPowerBySocSupply(VBAT_Type *base) -{ - base->LDORAMC &= ~VBAT_LDORAMC_SWI_MASK; - base->LDORAMC &= ~VBAT_LDORAMC_ISO_MASK; -} - -/*! - * @brief Power off selected SRAM array in low power modes. - * - * @param base VBAT peripheral base address. - * @param sramMask The mask of SRAM array to power off, should be the OR'ed value of @ref vbat_ram_array_t. - */ -static inline void VBAT_PowerOffSRAMsInLowPowerModes(VBAT_Type *base, uint8_t sramMask) -{ - base->LDORAMC |= (uint32_t)VBAT_LDORAMC_RET(sramMask); -} - -/*! - * @brief Retain selected SRAM array in low power modes. - * - * @param base VBAT peripheral base address. - * @param sramMask The mask of SRAM array to retain, should be the OR'ed value of @ref vbat_ram_array_t. - */ -static inline void VBAT_RetainSRAMsInLowPowerModes(VBAT_Type *base, uint8_t sramMask) -{ - base->LDORAMC &= ~(uint32_t)VBAT_LDORAMC_RET(sramMask); -} - -/*! - * @brief Enable/disable SRAM isolation. - * - * @param base VBAT peripheral base address. - * @param enable Used to enable/disable SRAM violation. - * - \b true SRAM will be isolated. - * - \b false SRAM state follows the SoC power modes. - */ -static inline void VBAT_EnableSRAMIsolation(VBAT_Type *base, bool enable) -{ - if (enable) - { - base->LDORAMC |= VBAT_LDORAMC_ISO_MASK; - } - else - { - base->LDORAMC &= ~VBAT_LDORAMC_ISO_MASK; - } -} - -/*! @} */ -#endif /* FSL_FEATURE_MCX_VBAT_HAS_RAM_LDO */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) && FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) -/*! @name Bandgap Timer Control Interfaces - * @{ - */ - -/*! - * @brief Enable/disable Bandgap timer. - * - * @note The bandgap timer is available when the bandgap is enabled and are clocked by the FRO16k. - * - * @param base VBAT peripheral base address. - * @param enable Used to enable/disable bandgap timer. - * @param timerIdMask The mask of bandgap timer Id, should be the OR'ed value of @ref vbat_bandgap_timer_id_t. - * - * @retval kStatus_Success Success to enable/disable selected bandgap timer. - * @retval kStatus_VBAT_Fro16kNotEnabled Fail to enable/disable selected bandgap timer due to FRO16k not enabled - * previously. - * @retval kStatus_VBAT_BandgapNotEnabled Fail to enable/disable selected bandgap timer due to bandgap not enabled - * previously. - */ -status_t VBAT_EnableBandgapTimer(VBAT_Type *base, bool enable, uint8_t timerIdMask); - -/*! - * @brief Set bandgap timer0 timeout value. - * - * @note The timeout value can only be changed when the timer is disabled. - * - * @param base VBAT peripheral base address. - * @param timeoutPeriod Bandgap timer timeout value, please refer to @ref vbat_bandgap_timer0_timeout_period_t. - */ -void VBAT_SetBandgapTimer0TimeoutValue(VBAT_Type *base, vbat_bandgap_timer0_timeout_period_t timeoutPeriod); - -/*! - * @brief Set bandgap timer1 timeout value. - * - * @note The timeout value can only be changed when the timer is disabled. - * - * @param base VBAT peripheral base address. - * @param timeoutPeriod The bandgap timerout 1 period, in number of seconds, ranging from 0 to 65535s. - */ -void VBAT_SetBandgapTimer1TimeoutValue(VBAT_Type *base, uint32_t timeoutPeriod); - -/*! @} */ -#endif /* FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_SWICTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_SWICTL_REG) -/*! @name Switch Control Interfaces - * @{ - */ - -/*! - * @brief Control the VBAT internal switch in active mode, VBAT modules can be suppiled by VDD_BAT and VDD_SYS. - * - * @param base VBAT peripheral base address. - * @param supply Used to control the VBAT internal switch. - */ -static inline void VBAT_SwitchVBATModuleSupplyActiveMode(VBAT_Type *base, vbat_internal_module_supply_t supply) -{ - if (supply == kVBAT_ModuleSuppliedByVddBat) - { - base->SWICTLA &= ~VBAT_SWICTLA_SWI_EN_MASK; - base->SWICTLB |= VBAT_SWICTLA_SWI_EN_MASK; - } - else - { - base->SWICTLA |= VBAT_SWICTLA_SWI_EN_MASK; - base->SWICTLB &= ~VBAT_SWICTLA_SWI_EN_MASK; - } -} - -/*! - * @brief Get VBAT module supply in active mode. - * - * @param base VBAT peripheral base address. - * @return VDD_SYS supplies VBAT modules or VDD_BAT supplies VBAT modules, in type of @ref - * vbat_internal_module_supply_t. - */ -static inline vbat_internal_module_supply_t VBAT_GetVBATModuleSupply(VBAT_Type *base) -{ - return (vbat_internal_module_supply_t)(base->SWICTLA & VBAT_SWICTLA_SWI_EN_MASK); -} - -/*! - * @brief Control the VBAT internal switch in low power modes. - * - * @note If VBAT modules are supplied by VDD_SYS in low power modes, VBAT module will also supplied by VDD_SYS in active - * mode. - * - * @param base VBAT peripheral base address. - * @param supply Used to specify which voltage input supply VBAT modules in low power mode. - */ -static inline void VBAT_SwitchVBATModuleSupplyLowPowerMode(VBAT_Type *base, vbat_internal_module_supply_t supply) -{ - if (supply == kVBAT_ModuleSuppliedByVddBat) - { - base->SWICTLA &= ~VBAT_SWICTLA_LP_EN_MASK; - base->SWICTLB |= VBAT_SWICTLA_LP_EN_MASK; - } - else - { - base->SWICTLA |= VBAT_SWICTLA_SWI_EN_MASK; - base->SWICTLB &= ~VBAT_SWICTLA_SWI_EN_MASK; - base->SWICTLA |= VBAT_SWICTLA_LP_EN_MASK; - base->SWICTLB &= ~VBAT_SWICTLA_LP_EN_MASK; - } -} - -/*! - * @brief Lock switch control, if locked all writes to the switch registers will be blocked. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_LockSwitchControl(VBAT_Type *base) -{ - base->SWILCKA |= VBAT_SWILCKA_LOCK_MASK; - base->SWILCKB &= ~VBAT_SWILCKB_LOCK_MASK; -} - -/*! - * @brief Unlock switch control. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_UnlockSwitchControl(VBAT_Type *base) -{ - base->SWILCKA &= ~VBAT_SWILCKA_LOCK_MASK; - base->SWILCKB |= VBAT_SWILCKB_LOCK_MASK; -} - -/*! - * @brief Check if switch control is locked. - * - * @param base VBAT peripheral base address. - * - * @retval false switch control is not locked. - * @retval true switch control is locked, any writes to related registers are blocked. - */ -static inline bool VBAT_CheckSwitchControlLocked(VBAT_Type *base) -{ - return ((base->SWILCKA & VBAT_SWILCKA_LOCK_MASK) != 0UL); -} - -/*! @} */ -#endif /* FSL_FEATURE_MCX_VBAT_HAS_SWICTL_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) && FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) -/*! - * @name Clock Monitor Interfaces - * @{ - */ - -/*! - * @brief Initialize the VBAT clock monitor, enable clock monitor and set the clock monitor configuration. - * - * @note Both FRO16K and OSC32K should be enabled and stable before invoking this function. - * - * @param base VBAT peripheral base address. - * @param config Pointer to @ref vbat_clock_monitor_config_t structure. - * - * @retval kStatus_Success Clock monitor is initialized successfully. - * @retval kStatus_VBAT_Fro16kNotEnabled FRO16K is not enabled. - * @retval kStatus_VBAT_Osc32kNotReady OSC32K is not ready. - * @retval kStatus_VBAT_ClockMonitorLocked Clock monitor is locked. - */ -status_t VBAT_InitClockMonitor(VBAT_Type *base, const vbat_clock_monitor_config_t *config); - -/*! - * @brief Deinitialize the VBAT clock monitor. - * - * @param base VBAT peripheral base address. - * - * @retval kStatus_Success Clock monitor is de-initialized successfully. - * @retval kStatus_VBAT_ClockMonitorLocked Control of Clock monitor is locked. - */ -status_t VBAT_DeinitMonitor(VBAT_Type *base); - -/*! - * @brief Enable/disable clock monitor. - * - * @param base VBAT peripheral base address. - * @param enable Switcher to enable/disable clock monitor: - * - true: enable clock monitor; - * - false: disable clock monitor. - */ -static inline void VBAT_EnableClockMonitor(VBAT_Type *base, bool enable) -{ - if (enable) - { - base->MONCTLA |= VBAT_MONCTLA_MON_EN_MASK; - base->MONCTLB &= ~VBAT_MONCTLA_MON_EN_MASK; - } - else - { - base->MONCTLA &= ~VBAT_MONCTLA_MON_EN_MASK; - base->MONCTLB |= VBAT_MONCTLA_MON_EN_MASK; - } -} - -/*! - * @brief Set clock monitor's divide trim, avaiable value is #kVBAT_ClockMonitorOperateAt1kHz and - * #kVBAT_ClockMonitorOperateAt64Hz - * - * @param base VBAT peripheral base address. - * @param divideTrim Specify divide trim value, please refer to @ref vbat_clock_monitor_divide_trim_t. - */ -static inline void VBAT_SetClockMonitorDivideTrim(VBAT_Type *base, vbat_clock_monitor_divide_trim_t divideTrim) -{ - base->MONCFGA = (base->MONCFGA & ~VBAT_MONCFGA_DIVIDE_TRIM_MASK) | VBAT_MONCFGA_DIVIDE_TRIM(divideTrim); - base->MONCFGB = (base->MONCFGB & ~VBAT_MONCFGA_DIVIDE_TRIM_MASK) | VBAT_MONCFGA_DIVIDE_TRIM(~divideTrim); -} - -/*! - * @brief Set clock monitor's frequency trim, avaiable value is #kVBAT_ClockMonitorAssert2Cycle, - * #kVBAT_ClockMonitorAssert4Cycle, #kVBAT_ClockMonitorAssert6Cycle and #kVBAT_ClockMonitorAssert8Cycle. - * - * @param base VBAT peripheral base address. - * @param freqTrim Specify frequency trim value, please refer to @ref vbat_clock_monitor_freq_trim_t. - */ -static inline void VBAT_SetClockMonitorFrequencyTrim(VBAT_Type *base, vbat_clock_monitor_freq_trim_t freqTrim) -{ - base->MONCFGA = (base->MONCFGA & ~VBAT_MONCFGA_FREQ_TRIM_MASK) | VBAT_MONCFGA_FREQ_TRIM(freqTrim); - base->MONCFGB = (base->MONCFGB & ~VBAT_MONCFGA_FREQ_TRIM_MASK) | VBAT_MONCFGA_FREQ_TRIM(~freqTrim); -} - -/*! - * @brief Lock clock monitor enable/disable control. - * - * @note If locked, it is not allowed to change clock monitor enable/disable control. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_LockClockMonitorControl(VBAT_Type *base) -{ - base->MONLCKA |= VBAT_MONLCKA_LOCK_MASK; - base->MONLCKB &= ~VBAT_MONLCKA_LOCK_MASK; -} - -/*! - * @brief Unlock clock monitor enable/disable control. - * - * @param base VBTA peripheral base address. - */ -static inline void VBAT_UnlockClockMonitorControl(VBAT_Type *base) -{ - base->MONLCKA &= ~VBAT_MONLCKA_LOCK_MASK; - base->MONLCKB |= VBAT_MONLCKA_LOCK_MASK; -} - -/*! - * @brief Check if clock monitor enable/disable control is locked. - * - * @note If locked, it is not allowed to change clock monitor enable/disable control. - * - * @param base VBAT peripheral base address. - * - * @retval false clock monitor enable/disable control is not locked. - * @retval true clock monitor enable/disable control is locked, any writes to related registers are blocked. - */ -static inline bool VBAT_CheckClockMonitorControlLocked(VBAT_Type *base) -{ - return ((base->MONLCKA & VBAT_MONLCKA_LOCK_MASK) != 0UL); -} - -/*! @} */ -#endif /* FSL_FEATURE_VBAT_HAS_CLOCK_MONITOR */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) && FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) -/*! @name Tamper Control Interfaces - * - */ - -/*! - * @brief Initialize tamper control. - * - * @note Both FRO16K and bandgap should be enabled before calling this function. - * - * @param base VBAT peripheral base address. - * @param config Pointer to @ref vbat_tamper_config_t structure. - * - * @retval kStatus_Success Tamper is initialized successfully. - * @retval kStatus_VBAT_TamperLocked Tamper control is locked. - * @retval kStatus_VBAT_BandgapNotEnabled Bandgap is not enabled. - * @retval kStatus_VBAT_Fro16kNotEnabled FRO 16K is not enabled. - */ -status_t VBAT_InitTamper(VBAT_Type *base, const vbat_tamper_config_t *config); - -/*! - * @brief De-initialize tamper control. - * - * @param base VBAT peripheral base address. - * - * @retval kStatus_Success Tamper is de-initialized successfully. - * @retval kStatus_VBAT_TamperLocked Tamper control is locked. - */ -status_t VBAT_DeinitTamper(VBAT_Type *base); - -/*! - * @brief Enable tampers for VBAT. - * - * @param base VBAT peripheral base address. - * @param tamperEnableMask Mask of tamper to be enabled, should be the OR'ed value of @ref _vbat_tamper_enable. - */ -static inline void VBAT_EnableTamper(VBAT_Type *base, uint32_t tamperEnableMask) -{ - base->TAMPERA |= tamperEnableMask; - base->TAMPERB &= ~tamperEnableMask; -} - -/*! - * @brief Disable tampers for VBAT. - * - * @param base VBAT peripheral base address. - * @param tamperEnableMask Mask of tamper to be disabled, should be the OR'ed value of @ref _vbat_tamper_enable. - */ -static inline void VBAT_DisableTamper(VBAT_Type *base, uint32_t tamperEnableMask) -{ - base->TAMPERA &= ~tamperEnableMask; - base->TAMPERB |= tamperEnableMask; -} - -/*! - * @brief Get tamper enable information. - * - * @param base VBAT peripheral base address. - * - * @return Mask of tamper enable information, should be the OR'ed value of @ref _vbat_tamper_enable. - */ -static inline uint32_t VBAT_GetTamperEnableInfo(VBAT_Type *base) -{ - return base->TAMPERA; -} - -/*! - * @brief Lock tamper control, if locked, it is not allowed to change tamper control. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_LockTamperControl(VBAT_Type *base) -{ - base->TAMLCKA |= VBAT_TAMLCKA_LOCK_MASK; - base->TAMLCKB &= ~VBAT_TAMLCKA_LOCK_MASK; -} - -/*! - * @brief Unlock tamper control. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_UnlockTamperControl(VBAT_Type *base) -{ - base->TAMLCKA &= ~VBAT_TAMLCKA_LOCK_MASK; - base->TAMLCKB |= VBAT_TAMLCKA_LOCK_MASK; -} - -/*! - * @brief Check if tamper control is locked. - * - * @param base VBAT peripheral base address. - * - * @retval false Tamper control is not locked. - * @retval true Tamper control is locked, any writes to related registers are blocked. - */ -static inline bool VBAT_CheckTamperControlLocked(VBAT_Type *base) -{ - return ((base->TAMLCKA & VBAT_TAMLCKA_LOCK_MASK) != 0UL); -} - -/*! @} */ -#endif /* FSL_FEATURE_VBAT_HAS_TAMPER */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_STATUS_REG) && FSL_FEATURE_MCX_VBAT_HAS_STATUS_REG) -/*! @name Status, Interrupt, Wakeup Control Interfaces - * @{ - */ - -/*! - * @brief Get VBAT status flags - * - * @param base VBAT peripheral base address. - * @return The asserted status flags, should be the OR'ed value of @ref vbat_status_flag_t. - */ -static inline uint32_t VBAT_GetStatusFlags(VBAT_Type *base) -{ - return (uint32_t)(base->STATUSA); -} - -/*! - * @brief Clear VBAT status flags. - * - * @param base VBAT peripheral base address. - * @param mask The mask of status flags to be cleared, should be the OR'ed value of @ref vbat_status_flag_t except - * @ref kVBAT_StatusFlagLdoReady, @ref kVBAT_StatusFlagOsc32kReady, @ref kVBAT_StatusFlagInterrupt0Detect, - * @ref kVBAT_StatusFlagInterrupt1Detect, @ref kVBAT_StatusFlagInterrupt2Detect, - * @ref kVBAT_StatusFlagInterrupt3Detect. - */ -static inline void VBAT_ClearStatusFlags(VBAT_Type *base, uint32_t mask) -{ - base->STATUSA = mask; - base->STATUSB = ~mask; -} - -/*! - * @brief Enable interrupts for the VBAT module, such as POR detect interrupt, Wakeup Pin interrupt and so on. - * - * @param base VBAT peripheral base address. - * @param mask The mask of interrupts to be enabled, should be the OR'ed value of @ref vbat_interrupt_enable_t. - */ -static inline void VBAT_EnableInterrupts(VBAT_Type *base, uint32_t mask) -{ - base->IRQENA |= mask; - base->IRQENB &= (uint32_t)~mask; -} - -/*! - * @brief Disable interrupts for the VBAT module, such as POR detect interrupt, wakeup pin interrupt and so on. - * - * @param base VBAT peripheral base address. - * @param mask The mask of interrupts to be disabled, should be the OR'ed value of @ref vbat_interrupt_enable_t. - */ -static inline void VBAT_DisableInterrupts(VBAT_Type *base, uint32_t mask) -{ - base->IRQENA &= ~mask; - base->IRQENB |= mask; -} - -/*! - * @brief Enable wakeup for the VBAT module, such as POR detect wakeup, wakeup pin wakeup and so on. - * - * @param base VBAT peripheral base address. - * @param mask The mask of enumerators in @ref vbat_wakeup_enable_t. - */ -static inline void VBAT_EnableWakeup(VBAT_Type *base, uint32_t mask) -{ - base->WAKENA |= mask; - base->WAKENB &= ~mask; -} - -/*! - * @brief Disable wakeup for VBAT module, such as POR detect wakeup, wakeup pin wakeup and so on. - * - * @param base VBAT peripheral base address. - * @param mask The mask of enumerators in @ref vbat_wakeup_enable_t. - */ -static inline void VBAT_DisableWakeup(VBAT_Type *base, uint32_t mask) -{ - base->WAKENA &= ~mask; - base->WAKENB |= mask; -} - -/*! - * @brief Lock VBAT interrupt and wakeup settings, please note that if locked the interrupt and wakeup settings can not - * be updated until the next POR. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_LockInterruptWakeupSettings(VBAT_Type *base) -{ - base->LOCKA |= VBAT_LOCKA_LOCK_MASK; -} - -/*! - * @brief Set the default state of the WAKEUP_b pin output when no enabled wakeup source is asserted. - * - * @param base VBAT peripheral base address. - * @param assert Used to set default state of the WAKEUP_b pin output: - * - \b true WAKEUP_b output state is logic one; - * - \b false WAKEUP_b output state is logic zero. - */ -static inline void VBAT_SetWakeupPinDefaultState(VBAT_Type *base, bool assert) -{ - if (assert) - { - base->WAKECFG |= VBAT_WAKECFG_OUT_MASK; - } - else - { - base->WAKECFG &= ~VBAT_WAKECFG_OUT_MASK; - } -} - -/*! @} */ -#endif /* FSL_FEATURE_MCX_VBAT_HAS_STATUS_REG */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ -#endif /* FSL_VBAT_H__ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_vref.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_vref.c deleted file mode 100644 index fd8ee68ae2b..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_vref.c +++ /dev/null @@ -1,308 +0,0 @@ -/* - * Copyright 2019-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_vref.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.vref_1" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Gets the instance from the base address - * - * @param base VREF peripheral base address - * - * @return The VREF instance - */ -static uint32_t VREF_GetInstance(VREF_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/*! @brief Pointers to VREF bases for each instance. */ -static VREF_Type *const s_vrefBases[] = VREF_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to VREF clocks for each instance. */ -static const clock_ip_name_t s_vrefClocks[] = VREF_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/******************************************************************************* - * Code - ******************************************************************************/ - -static uint32_t VREF_GetInstance(VREF_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - /* - * $Branch Coverage Justification$ - * (instance >= ARRAY_SIZE(s_vrefBases)) not covered. The peripheral base - * address is always valid and checked by assert. - */ - for (instance = 0; instance < ARRAY_SIZE(s_vrefBases); instance++) - { - /* - * $Branch Coverage Justification$ - * (s_vrefBases[instance] != base) not covered. The peripheral base - * address is always valid and checked by assert. - */ - if (s_vrefBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_vrefBases)); - - return instance; -} - -/*! - * brief Enables the clock gate and configures the VREF module according to the configuration structure. - * - * This function must be called before calling all other VREF driver functions, read/write registers, and - * configurations with user-defined settings. The example below shows how to set up vref_config_t parameters - * and how to call the VREF_Init function by passing in these parameters. - * code - * vref_config_t vrefConfig; - * VREF_GetDefaultConfig(VREF, &vrefConfig); - * vrefConfig.bufferMode = kVREF_ModeHighPowerBuffer; - * VREF_Init(VREF, &vrefConfig); - * endcode - * - * param base VREF peripheral address. - * param config Pointer to the configuration structure. - */ -void VREF_Init(VREF_Type *base, const vref_config_t *config) -{ - assert(config != NULL); - - uint32_t tmp32 = 0UL; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate clock for VREF */ - CLOCK_EnableClock(s_vrefClocks[VREF_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - base->CSR |= VREF_CSR_LPBGEN_MASK; - /* After enabling low power bandgap, delay 20 us. */ - SDK_DelayAtLeastUs(20U, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY); - - /* Provides bias current for other peripherals. */ - if (config->enableLowPowerBuff) - { - base->CSR |= VREF_CSR_LPBG_BUF_EN_MASK; - } - - if (config->bufferMode != kVREF_ModeBandgapOnly) - { - if (config->enableHCBandgap) - { - tmp32 |= VREF_CSR_HCBGEN_MASK; - } - - if (config->enableInternalVoltageRegulator) - { - tmp32 |= VREF_CSR_REGEN_MASK; - } - - if (config->enableChopOscillator) - { - tmp32 |= (VREF_CSR_REGEN_MASK | VREF_CSR_CHOPEN_MASK); - } - - if (config->enableCurvatureCompensation) - { - tmp32 |= VREF_CSR_ICOMPEN_MASK; - } - - if (config->bufferMode == kVREF_ModeLowPowerBuffer) - { - tmp32 |= VREF_CSR_BUF21EN_MASK; - } - else - { - tmp32 |= (VREF_CSR_BUF21EN_MASK | VREF_CSR_HI_PWR_LV_MASK); - } - - base->CSR |= tmp32; - /* After enabling high accurancy bandgap, delay 400 us. */ - SDK_DelayAtLeastUs(400U, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY); - } -} - -/*! - * brief Stops and disables the clock for the VREF module. - * - * This function should be called to shut down the module. - * This is an example. - * code - * vref_config_t vrefUserConfig; - * VREF_GetDefaultConfig(VREF, &vrefUserConfig); - * VREF_Init(VREF, &vrefUserConfig); - * ... - * VREF_Deinit(VREF); - * endcode - * - * param base VREF peripheral address. - */ -void VREF_Deinit(VREF_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate clock for VREF */ - CLOCK_DisableClock(s_vrefClocks[VREF_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Initializes the VREF configuration structure. - * - * This function initializes the VREF configuration structure to default values. - * This is an example. - * code - * config->bufferMode = kVREF_ModeHighPowerBuffer; - * config->enableInternalVoltageRegulator = true; - * config->enableChopOscillator = true; - * config->enableHCBandgap = true; - * config->enableCurvatureCompensation = true; - * config->enableLowPowerBuff = true; - * endcode - * - * param config Pointer to the initialization structure. - */ -void VREF_GetDefaultConfig(vref_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->bufferMode = kVREF_ModeHighPowerBuffer; - config->enableInternalVoltageRegulator = true; - config->enableChopOscillator = true; - config->enableHCBandgap = true; - config->enableCurvatureCompensation = true; - config->enableLowPowerBuff = true; -} - -/*! - * brief Sets a TRIM value for the accurate 1.0V bandgap output. - * - * This function sets a TRIM value for the reference voltage. It will trim the accurate 1.0V bandgap by 0.5mV each step. - * - * param base VREF peripheral address. - * param trimValue Value of the trim register to set the output reference voltage (maximum 0x3F (6-bit)). - */ -void VREF_SetVrefTrimVal(VREF_Type *base, uint8_t trimValue) -{ - uint32_t tmp32 = base->UTRIM; - - tmp32 &= (~VREF_UTRIM_VREFTRIM_MASK); - tmp32 |= VREF_UTRIM_VREFTRIM(trimValue); - - base->UTRIM = tmp32; - - if (VREF_CSR_CHOPEN_MASK == (base->CSR & VREF_CSR_CHOPEN_MASK)) - { - /* After enabling high accurancy bandgap, delay 400 us. */ - SDK_DelayAtLeastUs(400U, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY); - } - else - { - /*Wait internal HC voltage reference stable*/ - /* - * $Branch Coverage Justification$ - * while ((base->CSR & VREF_CSR_VREFST_MASK) != 0U) not covered. Test unfeasible, - * the internal HC voltage stable state is too short not to catch. - */ - while ((base->CSR & VREF_CSR_VREFST_MASK) == 0U) - { - } - } -} - -/*! - * brief Sets a TRIM value for the accurate buffered VREF output. - * - * This function sets a TRIM value for the reference voltage. If buffer mode be set to other values (Buf21 - * enabled), it will trim the VREF_OUT by 0.1V each step from 1.0V to 2.1V. - * - * note When Buf21 is enabled, the value of UTRIM[TRIM2V1] should be ranged from 0b0000 to 0b1011 in order to trim the - * output voltage from 1.0V to 2.1V, other values will make the VREF_OUT to default value, 1.0V. - * - * param base VREF peripheral address. - * param trim21Value Value of the trim register to set the output reference voltage (maximum 0xF (4-bit)). - */ -void VREF_SetTrim21Val(VREF_Type *base, uint8_t trim21Value) -{ - uint32_t tmp32 = base->UTRIM; - - tmp32 &= (~VREF_UTRIM_TRIM2V1_MASK); - tmp32 |= VREF_UTRIM_TRIM2V1(trim21Value); - - base->UTRIM = tmp32; - - if (VREF_CSR_CHOPEN_MASK == (base->CSR & VREF_CSR_CHOPEN_MASK)) - { - /* After enabling high accurancy bandgap, delay 400 us. */ - SDK_DelayAtLeastUs(400U, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY); - } - else - { - /*Wait internal HC voltage reference stable*/ - /* - * $Branch Coverage Justification$ - * while ((base->CSR & VREF_CSR_VREFST_MASK) != 0U) not covered. Test unfeasible, - * the internal HC voltage stable state is too short not to catch. - */ - while ((base->CSR & VREF_CSR_VREFST_MASK) == 0U) - { - } - } -} - -/*! - * brief Reads the VREF trim value. - * - * This function gets the TRIM value from the UTRIM register. It reads UTRIM[VREFTRIM] (13:8) - * - * param base VREF peripheral address. - * return 6-bit value of trim setting. - */ -uint8_t VREF_GetVrefTrimVal(VREF_Type *base) -{ - uint8_t trimValue; - - trimValue = (uint8_t)((base->UTRIM & VREF_UTRIM_VREFTRIM_MASK) >> VREF_UTRIM_VREFTRIM_SHIFT); - - return trimValue; -} - -/*! - * brief Reads the VREF 2.1V trim value. - * - * This function gets the TRIM value from the UTRIM register. It reads UTRIM[TRIM2V1] (3:0), - * - * param base VREF peripheral address. - * return 4-bit value of trim setting. - */ -uint8_t VREF_GetTrim21Val(VREF_Type *base) -{ - uint8_t trimValue; - - trimValue = (uint8_t)((base->UTRIM & VREF_UTRIM_TRIM2V1_MASK) >> VREF_UTRIM_TRIM2V1_SHIFT); - - return trimValue; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_vref.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_vref.h deleted file mode 100644 index 99689610c40..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_vref.h +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright 2019-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_VREF_H_ -#define FSL_VREF_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup vref - * @{ - */ - -/****************************************************************************** - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -#define FSL_VREF_DRIVER_VERSION (MAKE_VERSION(2, 2, 2)) /*!< Version 2.2.2. */ -/*@}*/ - -/*! @brief VREF buffer modes. */ -typedef enum _vref_buffer_mode -{ - kVREF_ModeBandgapOnly = 0U, /*!< Bandgap enabled/standby. */ - kVREF_ModeLowPowerBuffer = 1U, /*!< Low-power buffer mode enabled */ - kVREF_ModeHighPowerBuffer = 2U, /*!< High-power buffer mode enabled */ -} vref_buffer_mode_t; - -/*! @brief The description structure for the VREF module. */ -typedef struct _vref_config -{ - vref_buffer_mode_t bufferMode; /*!< Buffer mode selection */ - bool enableInternalVoltageRegulator; /*!< Provide additional supply noise rejection. */ - bool enableChopOscillator; /*!< Enable Chop oscillator.*/ - bool enableHCBandgap; /*!< Enable High-Accurate bandgap.*/ - bool enableCurvatureCompensation; /*!< Enable second order curvature compensation. */ - bool enableLowPowerBuff; /*!< Provides bias current for other peripherals.*/ - -} vref_config_t; - -/****************************************************************************** - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Enables the clock gate and configures the VREF module according to the configuration structure. - * - * This function must be called before calling all other VREF driver functions, read/write registers, and - * configurations with user-defined settings. The example below shows how to set up vref_config_t parameters - * and how to call the VREF_Init function by passing in these parameters. - * @code - * vref_config_t vrefConfig; - * VREF_GetDefaultConfig(VREF, &vrefConfig); - * vrefConfig.bufferMode = kVREF_ModeHighPowerBuffer; - * VREF_Init(VREF, &vrefConfig); - * @endcode - * - * @param base VREF peripheral address. - * @param config Pointer to the configuration structure. - */ -void VREF_Init(VREF_Type *base, const vref_config_t *config); - -/*! - * @brief Stops and disables the clock for the VREF module. - * - * This function should be called to shut down the module. - * This is an example. - * @code - * vref_config_t vrefUserConfig; - * VREF_GetDefaultConfig(VREF, &vrefUserConfig); - * VREF_Init(VREF, &vrefUserConfig); - * ... - * VREF_Deinit(VREF); - * @endcode - * - * @param base VREF peripheral address. - */ -void VREF_Deinit(VREF_Type *base); - -/*! - * @brief Initializes the VREF configuration structure. - * - * This function initializes the VREF configuration structure to default values. - * This is an example. - * @code - * config->bufferMode = kVREF_ModeHighPowerBuffer; - * config->enableInternalVoltageRegulator = true; - * config->enableChopOscillator = true; - * config->enableHCBandgap = true; - * config->enableCurvatureCompensation = true; - * config->enableLowPowerBuff = true; - * @endcode - * - * @param config Pointer to the initialization structure. - */ -void VREF_GetDefaultConfig(vref_config_t *config); - -/* @} */ - -/*! - * @name Trim functions - * @{ - */ - -/*! - * @brief Sets a TRIM value for the accurate 1.0V bandgap output. - * - * This function sets a TRIM value for the reference voltage. It will trim the accurate 1.0V bandgap by 0.5mV each step. - * - * @param base VREF peripheral address. - * @param trimValue Value of the trim register to set the output reference voltage (maximum 0x3F (6-bit)). - */ -void VREF_SetVrefTrimVal(VREF_Type *base, uint8_t trimValue); - -/*! - * @brief Sets a TRIM value for the accurate buffered VREF output. - * - * This function sets a TRIM value for the reference voltage. If buffer mode be set to other values (Buf21 - * enabled), it will trim the VREF_OUT by 0.1V each step from 1.0V to 2.1V. - * - * @note When Buf21 is enabled, the value of UTRIM[TRIM2V1] should be ranged from 0b0000 to 0b1011 in order to trim the - * output voltage from 1.0V to 2.1V, other values will make the VREF_OUT to default value, 1.0V. - * - * @param base VREF peripheral address. - * @param trim21Value Value of the trim register to set the output reference voltage (maximum 0xF (4-bit)). - */ -void VREF_SetTrim21Val(VREF_Type *base, uint8_t trim21Value); - -/*! - * @brief Reads the trim value. - * - * This function gets the TRIM value from the UTRIM register. It reads UTRIM[VREFTRIM] (13:8) - * - * @param base VREF peripheral address. - * @return 6-bit value of trim setting. - */ -uint8_t VREF_GetVrefTrimVal(VREF_Type *base); - -/*! - * @brief Reads the VREF 2.1V trim value. - * - * This function gets the TRIM value from the UTRIM register. It reads UTRIM[TRIM2V1] (3:0), - * - * @param base VREF peripheral address. - * @return 4-bit value of trim setting. - */ -uint8_t VREF_GetTrim21Val(VREF_Type *base); - -/* @} */ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @}*/ - -#endif /* FSL_VREF_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_wuu.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_wuu.c deleted file mode 100644 index 8f58fd0eae8..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_wuu.c +++ /dev/null @@ -1,292 +0,0 @@ -/* - * Copyright 2019-2023 NXP. - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_wuu.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.wuu" -#endif - -#define WUU_PE_REG_BIT_FIELD_MASK 0x03UL -#define WUU_PDC_REG_BIT_FIELD_MASK 0x03UL -#define WUU_PMC_REG_BIT_FIELD_MASK 0x01UL - -#define WUU_ME_REG_WUME_FIELD_MASK 0x01UL -#define WUU_DE_REG_WUME_FIELD_MASK 0x01UL - -#define WUU_FILT_REG_FILTE_FIELD_MASK 0x60U -#define WUU_FILT_REG_FILTSET_FIELD_MASK 0x1FU -#define WUU_FDC_REG_FILTC_FIELD_MASK 0x3U -#define WUU_FMC_REG_FILTM_FIELD_MASK 0x1U - -#define WUU_FILT_REG_FILTSET_FIELD(x) (((uint32_t)(x) << 5UL) & WUU_FILT_REG_FILTE_FIELD_MASK) -#define WUU_CLEAR_BIT_FIELD_IN_REG(mask, offset) (~((uint32_t)(mask) << (offset))) -#define WUU_SET_BIT_FIELD_IN_REG(val, offset) ((uint32_t)(val) << (offset)) -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Enables and Configs External WakeUp Pins. - * - * This function enables/disables the external pin as wakeup input. What's more this - * function configs pins options, including edge detection wakeup event and operate mode. - * - * param base MUU peripheral base address. - * param pinIndex The index of the external input pin. See Reference Manual for the details. - * param config Pointer to wuu_external_wakeup_pin_config_t structure. - */ -void WUU_SetExternalWakeUpPinsConfig(WUU_Type *base, uint8_t pinIndex, const wuu_external_wakeup_pin_config_t *config) -{ - assert(config != NULL); - - volatile uint32_t *edgeRegBase = NULL; - volatile uint32_t *eventRegBase = NULL; - uint32_t edgeReg; - uint32_t eventReg; - uint32_t modeReg; - uint8_t offset; - - /* Calculate offset. */ - offset = 2U * (pinIndex & 0xFU); - - if (config->edge != kWUU_ExternalPinDisable) - { - /* Based on pin index, get register base address. */ - if ((pinIndex >> 4U) != 0U) - { - edgeRegBase = &base->PE2; - eventRegBase = &base->PDC2; - } - else - { - edgeRegBase = &base->PE1; - eventRegBase = &base->PDC1; - } - - /* Enable and config the edge detection. */ - edgeReg = *edgeRegBase; - edgeReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_PE_REG_BIT_FIELD_MASK, offset); - edgeReg |= WUU_SET_BIT_FIELD_IN_REG(config->edge, offset); - *edgeRegBase = edgeReg; - - /* Config the wakeup event. */ - eventReg = *eventRegBase; - eventReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_PDC_REG_BIT_FIELD_MASK, offset); - eventReg |= WUU_SET_BIT_FIELD_IN_REG(config->event, offset); - *eventRegBase = eventReg; - - /* Config operate mode. */ - modeReg = base->PMC; - modeReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_PMC_REG_BIT_FIELD_MASK, pinIndex); - modeReg |= WUU_SET_BIT_FIELD_IN_REG(config->mode, pinIndex); - - base->PMC = modeReg; - } - else - { - /* Based on pin index, get register base address. */ - if ((pinIndex >> 4U) != 0U) - { - edgeRegBase = &base->PE2; - } - else - { - edgeRegBase = &base->PE1; - } - - edgeReg = *edgeRegBase; - edgeReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_PE_REG_BIT_FIELD_MASK, offset); - *edgeRegBase = edgeReg; - } -} - -/*! - * brief Config Internal modules' event as the wake up soures. - * - * This function configs the internal modules event as the wake up sources. - * - * param base WUU peripheral base address. - * param moduleIndex The selected internal module. See the Reference Manual for the details. - * param event Select interrupt or DMA/Trigger of the internal module as the wake up source. - */ -void WUU_SetInternalWakeUpModulesConfig(WUU_Type *base, uint8_t moduleIndex, wuu_internal_wakeup_module_event_t event) -{ - switch (event) - { - case kWUU_InternalModuleInterrupt: - base->ME |= WUU_SET_BIT_FIELD_IN_REG(WUU_ME_REG_WUME_FIELD_MASK, moduleIndex); - break; - case kWUU_InternalModuleDMATrigger: - base->DE |= WUU_SET_BIT_FIELD_IN_REG(WUU_DE_REG_WUME_FIELD_MASK, moduleIndex); - break; - default: - assert(false); - break; - } -} - -/*! - * brief Disable an on-chip internal modules' event as the wakeup sources. - * - * param base WUU peripheral base address. - * param moduleIndex The selected internal module. See the Reference Manual for the details. - * param event The event(interrupt or DMA/trigger) of the internal module to disable. - */ -void WUU_ClearInternalWakeUpModulesConfig(WUU_Type *base, uint8_t moduleIndex, wuu_internal_wakeup_module_event_t event) -{ - switch(event) - { - case kWUU_InternalModuleInterrupt: - base->ME &= ~WUU_SET_BIT_FIELD_IN_REG(WUU_ME_REG_WUME_FIELD_MASK, moduleIndex); - break; - case kWUU_InternalModuleDMATrigger: - base->DE &= ~WUU_SET_BIT_FIELD_IN_REG(WUU_DE_REG_WUME_FIELD_MASK, moduleIndex); - break; - default: - assert(false); - break; - } -} - -/*! - * brief Configs and Enables Pin filters. - * - * This function configs Pin filter, including pin select, filer operate mode - * filer wakeup event and filter edge detection. - * - * param base WUU peripheral base address. - * param filterIndex The index of the pin filer. - * param config Pointer to wuu_pin_filter_config_t structure. - */ -void WUU_SetPinFilterConfig(WUU_Type *base, uint8_t filterIndex, const wuu_pin_filter_config_t *config) -{ - assert(config != NULL); - - uint8_t shift; - uint32_t filterReg; - uint32_t eventReg; - uint32_t modeReg; - - shift = (filterIndex - 1U) * 8U; - filterReg = base->FILT; - filterReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_FILT_REG_FILTE_FIELD_MASK, shift); - filterReg |= WUU_SET_BIT_FIELD_IN_REG(WUU_FILT_REG_FILTSET_FIELD(config->edge), shift); - - if (config->edge != kWUU_FilterDisabled) - { - filterReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_FILT_REG_FILTSET_FIELD_MASK, shift); - filterReg |= WUU_SET_BIT_FIELD_IN_REG(config->pinIndex, shift); - - /* Config wake up event. */ - shift = (filterIndex - 1U) * 2U; - eventReg = base->FDC; - eventReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_FDC_REG_FILTC_FIELD_MASK, shift); - eventReg |= WUU_SET_BIT_FIELD_IN_REG(config->event, shift); - base->FDC = eventReg; - - /* Config operate mode. */ - shift = (filterIndex - 1U) * 1U; - modeReg = base->FMC; - modeReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_FMC_REG_FILTM_FIELD_MASK, shift); - modeReg |= WUU_SET_BIT_FIELD_IN_REG(config->mode, shift); - base->FMC = modeReg; - } - - base->FILT = filterReg; -} - -/*! - * brief Gets the pin filter configuration. - * - * This function gets the pin filter flag. - * - * param base WUU peripheral base address. - * param filterIndex A pin filter index, which starts from 1. - * return True if the flag is a source of the existing low-leakage power mode. - */ -bool WUU_GetPinFilterFlag(WUU_Type *base, uint8_t filterIndex) -{ - bool ret = false; - - switch (filterIndex) - { - case 1: - ret = ((base->FILT & WUU_FILT_FILTF1_MASK) != 0U); - break; - case 2: - ret = ((base->FILT & WUU_FILT_FILTF2_MASK) != 0U); - break; - default: - ret = false; - break; - } - - return ret; -} - -/*! - * brief Clears the pin filter configuration. - * - * This function clears the pin filter flag. - * - * param base WUU peripheral base address. - * param filterIndex A pin filter index to clear the flag, starting from 1. - */ -void WUU_ClearPinFilterFlag(WUU_Type *base, uint8_t filterIndex) -{ - uint32_t reg; - - reg = base->FILT; - /* Clean the W1C bits, in case the flags are cleared by mistake. */ - reg &= ~(WUU_FILT_FILTF1_MASK | WUU_FILT_FILTF2_MASK); - - reg |= WUU_SET_BIT_FIELD_IN_REG(WUU_FILT_FILTF1_MASK, ((filterIndex - 1U) * 8U)); - - base->FILT = reg; -} - -/*! - * brief Gets the external wakeup source flag. - * - * This function checks the external pin flag to detect whether the MCU is - * woken up by the specific pin. - * - * param base WUU peripheral base address. - * param pinIndex A pin index, which starts from 0. - * return True if the specific pin is a wakeup source. - */ -bool WUU_GetExternalWakeupPinFlag(WUU_Type *base, uint32_t pinIndex) -{ - return (0U != (base->PF & (1UL << pinIndex))); -} - -/*! - * brief Clears the external wakeup source flag. - * - * This function clears the external wakeup source flag for a specific pin. - * - * param base WUU peripheral base address. - * param pinIndex A pin index, which starts from 0. - */ -void WUU_ClearExternalWakeupPinFlag(WUU_Type *base, uint32_t pinIndex) -{ - base->PF = (1UL << pinIndex); -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_wuu.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_wuu.h deleted file mode 100644 index 24260322ab8..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_wuu.h +++ /dev/null @@ -1,286 +0,0 @@ -/* - * Copyright 2019-2023 NXP. - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_WUU_H_ -#define FSL_WUU_H_ - -#include "fsl_common.h" - -/*! @addtogroup wuu */ -/*! @{ */ - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief Defines WUU driver version 2.3.0. */ -#define FSL_WUU_DRIVER_VERSION (MAKE_VERSION(2, 3, 0)) -/*@}*/ - -/*! - * @brief External WakeUp pin edge detection enumeration. - */ -typedef enum _wuu_external_pin_edge_detection -{ - kWUU_ExternalPinDisable = 0x0U, /*!< External input Pin disabled as wake up input. */ - kWUU_ExternalPinRisingEdge = 0x1U, /*!< External input Pin enabled with the rising edge detection. */ - kWUU_ExternalPinFallingEdge = 0x2U, /*!< External input Pin enabled with the falling edge detection. */ - kWUU_ExternalPinAnyEdge = 0x3U, /*!< External input Pin enabled with any change detection. */ -} wuu_external_pin_edge_detection_t; - -/*! - * @brief External input wake up pin event enumeration. - */ -typedef enum _wuu_external_wakeup_pin_event -{ - kWUU_ExternalPinInterrupt = 0x0U, /*!< External input Pin configured as interrupt. */ - kWUU_ExternalPinDMARequest = 0x1U, /*!< External input Pin configured as DMA request. */ - kWUU_ExternalPinTriggerEvent = 0x2U, /*!< External input Pin configured as Trigger event. */ -} wuu_external_wakeup_pin_event_t; - -/*! - * @brief External input wake up pin mode enumeration. - */ -typedef enum _wuu_external_wakeup_pin_mode -{ - kWUU_ExternalPinActiveDSPD = 0x0U, /*!< External input Pin is active only during Deep Sleep/Power Down Mode. */ - kWUU_ExternalPinActiveAlways = 0x1U, /*!< External input Pin is active during all power modes. */ -} wuu_external_wakeup_pin_mode_t; - -/*! - * @brief Internal module wake up event enumeration. - */ -typedef enum _wuu_internal_wakeup_module_event -{ - kWUU_InternalModuleInterrupt = 0x0U, /*!< Internal modules' interrupt as a wakeup source. */ - kWUU_InternalModuleDMATrigger = 0x1U, /*!< Internal modules' DMA/Trigger as a wakeup source. */ -} wuu_internal_wakeup_module_event_t; - -/*! - * @brief Pin filter edge enumeration. - */ -typedef enum _wuu_filter_edge -{ - kWUU_FilterDisabled = 0x0U, /*!< Filter disabled. */ - kWUU_FilterPosedgeEnable = 0x1U, /*!< Filter posedge detect enabled. */ - kWUU_FilterNegedgeEnable = 0x2U, /*!< Filter negedge detect enabled. */ - kWUU_FilterAnyEdge = 0x3U, /*!< Filter any edge detect enabled. */ -} wuu_filter_edge_t; - -/*! - * @brief Pin Filter event enumeration. - */ -typedef enum _wuu_filter_event -{ - kWUU_FilterInterrupt = 0x0U, /*!< Filter output configured as interrupt. */ - kWUU_FilterDMARequest = 0x1U, /*!< Filter output configured as DMA request. */ - kWUU_FilterTriggerEvent = 0x2U, /*!< Filter output configured as Trigger event. */ -} wuu_filter_event_t; - -/*! - * @brief Pin filter mode enumeration. - */ -typedef enum _wuu_filter_mode -{ - kWUU_FilterActiveDSPD = 0x0U, /*!< External input pin filter is active only during Deep Sleep/Power Down Mode. */ - kWUU_FilterActiveAlways = 0x1U, /*!< External input Pin filter is active during all power modes. */ -} wuu_filter_mode_t; - -/*! - * @brief External WakeUp pin configuration - */ -typedef struct _wuu_external_wakeup_pin_config -{ - wuu_external_pin_edge_detection_t edge; /*!< External Input pin edge detection. */ - wuu_external_wakeup_pin_event_t event; /*!< External Input wakeup Pin event */ - wuu_external_wakeup_pin_mode_t mode; /*!< External Input wakeup Pin operate mode. */ -} wuu_external_wakeup_pin_config_t; - -/*! - * @brief Pin Filter configuration. - */ -typedef struct _wuu_pin_filter_config -{ - uint32_t pinIndex; /*!< The index of wakeup pin to be muxxed into filter. */ - wuu_filter_edge_t edge; /*!< The edge of the pin digital filter. */ - wuu_filter_event_t event; /*!< The event of the filter output. */ - wuu_filter_mode_t mode; /*!< The mode of the filter operate. */ -} wuu_pin_filter_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name External Wake up Pins Control APIs. - * @{ - */ -/*! - * @brief Enables and Configs External WakeUp Pins. - * - * This function enables/disables the external pin as wakeup input. What's more this - * function configs pins options, including edge detection wakeup event and operate mode. - * - * @param base MUU peripheral base address. - * @param pinIndex The index of the external input pin. See Reference Manual for the details. - * @param config Pointer to wuu_external_wakeup_pin_config_t structure. - */ -void WUU_SetExternalWakeUpPinsConfig(WUU_Type *base, uint8_t pinIndex, const wuu_external_wakeup_pin_config_t *config); - -/*! - * @brief Gets External Wakeup pin flags. - * - * This function return the external wakeup pin flags. - * - * @param base WUU peripheral base address. - * @return Wakeup flags for all external wakeup pins. - */ -static inline uint32_t WUU_GetExternalWakeUpPinsFlag(WUU_Type *base) -{ - return base->PF; -} - -/*! - * @brief Clears External WakeUp Pin flags. - * - * This function clears external wakeup pins flags based on the mask. - * - * @param base WUU peripheral base address. - * @param mask The mask of Wakeup pin index to be cleared. - */ -static inline void WUU_ClearExternalWakeUpPinsFlag(WUU_Type *base, uint32_t mask) -{ - base->PF = mask; -} -/* @} */ - -/*! - * @name Internal Wakeup Module control APIs. - * @{ - */ - -/*! - * @brief Config Internal modules' event as the wake up soures. - * - * This function configs the internal modules event as the wake up sources. - * - * @param base WUU peripheral base address. - * @param moduleIndex The selected internal module. See the Reference Manual for the details. - * @param event Select interrupt or DMA/Trigger of the internal module as the wake up source. - */ -void WUU_SetInternalWakeUpModulesConfig(WUU_Type *base, uint8_t moduleIndex, wuu_internal_wakeup_module_event_t event); - -/*! - * @brief Disable an on-chip internal modules' event as the wakeup sources. - * - * @param base WUU peripheral base address. - * @param moduleIndex The selected internal module. See the Reference Manual for the details. - * @param event The event(interrupt or DMA/trigger) of the internal module to disable. - */ -void WUU_ClearInternalWakeUpModulesConfig(WUU_Type *base, uint8_t moduleIndex, wuu_internal_wakeup_module_event_t event); - -#if (defined(FSL_FEATURE_WUU_HAS_MF) && FSL_FEATURE_WUU_HAS_MF) -/*! - * @brief Get wakeup flags for internal wakeup modules. - * - * @param base WUU peripheral base address. - * @return Wakeup flags for all internal wakeup modules. - */ -static inline uint32_t WUU_GetModuleInterruptFlag(WUU_Type *base) -{ - return base->MF; -} - -/*! - * @brief Gets the internal module wakeup source flag. - * - * This function checks the flag to detect whether the system is - * woken up by specific on-chip module interrupt. - * - * @param base WWU peripheral base address. - * @param moduleIndex A module index, which starts from 0. - * @return True if the specific pin is a wake up source. - */ -static inline bool WUU_GetInternalWakeupModuleFlag(WUU_Type *base, uint32_t moduleIndex) -{ - return ((1UL << moduleIndex) == (WUU_GetModuleInterruptFlag(base) & (1UL << moduleIndex))); -} -#endif /* FSL_FEATURE_WUU_HAS_MF */ - -/* @} */ - -/*! - * @name Pin Filter Control APIs - * @{ - */ -/*! - * @brief Configs and Enables Pin filters. - * - * This function configs Pin filter, including pin select, filer operate mode - * filer wakeup event and filter edge detection. - * - * @param base WUU peripheral base address. - * @param filterIndex The index of the pin filer. - * @param config Pointer to wuu_pin_filter_config_t structure. - */ -void WUU_SetPinFilterConfig(WUU_Type *base, uint8_t filterIndex, const wuu_pin_filter_config_t *config); - -/*! - * @brief Gets the pin filter configuration. - * - * This function gets the pin filter flag. - * - * @param base WUU peripheral base address. - * @param filterIndex A pin filter index, which starts from 1. - * @return True if the flag is a source of the existing low-leakage power mode. - */ -bool WUU_GetPinFilterFlag(WUU_Type *base, uint8_t filterIndex); - -/*! - * @brief Clears the pin filter configuration. - * - * This function clears the pin filter flag. - * - * @param base WUU peripheral base address. - * @param filterIndex A pin filter index to clear the flag, starting from 1. - */ -void WUU_ClearPinFilterFlag(WUU_Type *base, uint8_t filterIndex); - -/*! - * brief Gets the external wakeup source flag. - * - * This function checks the external pin flag to detect whether the MCU is - * woken up by the specific pin. - * - * param base WUU peripheral base address. - * param pinIndex A pin index, which starts from 0. - * return True if the specific pin is a wakeup source. - */ -bool WUU_GetExternalWakeupPinFlag(WUU_Type *base, uint32_t pinIndex); - -/*! - * brief Clears the external wakeup source flag. - * - * This function clears the external wakeup source flag for a specific pin. - * - * param base WUU peripheral base address. - * param pinIndex A pin index, which starts from 0. - */ -void WUU_ClearExternalWakeupPinFlag(WUU_Type *base, uint32_t pinIndex); -/* @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @} */ - -#endif /*FSL_WUU_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_wwdt.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_wwdt.c deleted file mode 100644 index 6680148acf7..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_wwdt.c +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_wwdt.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.wwdt" -#endif - -#define FREQUENCY_3MHZ (3000000U) -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Gets the instance from the base address - * - * @param base WWDT peripheral base address - * - * @return The WWDT instance - */ -static uint32_t WWDT_GetInstance(WWDT_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to WWDT bases for each instance. */ -static WWDT_Type *const s_wwdtBases[] = WWDT_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to WWDT clocks for each instance. */ -static const clock_ip_name_t s_wwdtClocks[] = WWDT_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) -#if !(defined(FSL_FEATURE_WWDT_HAS_NO_RESET) && FSL_FEATURE_WWDT_HAS_NO_RESET) -/*! @brief Pointers to WWDT resets for each instance. */ -static const reset_ip_name_t s_wwdtResets[] = WWDT_RSTS; -#endif -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t WWDT_GetInstance(WWDT_Type *base) -{ - uint32_t instance; - uint32_t wwdtArrayCount = (sizeof(s_wwdtBases) / sizeof(s_wwdtBases[0])); - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < wwdtArrayCount; instance++) - { - if (s_wwdtBases[instance] == base) - { - break; - } - } - - assert(instance < wwdtArrayCount); - - return instance; -} - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Initializes WWDT configure structure. - * - * This function initializes the WWDT configure structure to default value. The default - * value are: - * code - * config->enableWwdt = true; - * config->enableWatchdogReset = false; - * config->enableWatchdogProtect = false; - * config->enableLockOscillator = false; - * config->windowValue = 0xFFFFFFU; - * config->timeoutValue = 0xFFFFFFU; - * config->warningValue = 0; - * endcode - * - * param config Pointer to WWDT config structure. - * see wwdt_config_t - */ -void WWDT_GetDefaultConfig(wwdt_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - /* Enable the watch dog */ - config->enableWwdt = true; - /* Disable the watchdog timeout reset */ - config->enableWatchdogReset = false; - /* Disable the watchdog protection for updating the timeout value */ - config->enableWatchdogProtect = false; -#if !(defined(FSL_FEATURE_WWDT_HAS_NO_OSCILLATOR_LOCK) && FSL_FEATURE_WWDT_HAS_NO_OSCILLATOR_LOCK) - /* Do not lock the watchdog oscillator */ - config->enableLockOscillator = false; -#endif - /* Windowing is not in effect */ - config->windowValue = 0xFFFFFFU; - /* Set the timeout value to the max */ - config->timeoutValue = 0xFFFFFFU; - /* No warning is provided */ - config->warningValue = 0; - /* Set clock frequency. */ - config->clockFreq_Hz = 0U; -} - -/*! - * brief Initializes the WWDT. - * - * This function initializes the WWDT. When called, the WWDT runs according to the configuration. - * - * Example: - * code - * wwdt_config_t config; - * WWDT_GetDefaultConfig(&config); - * config.timeoutValue = 0x7ffU; - * WWDT_Init(wwdt_base,&config); - * endcode - * - * param base WWDT peripheral base address - * param config The configuration of WWDT - */ -void WWDT_Init(WWDT_Type *base, const wwdt_config_t *config) -{ - assert(NULL != config); - - uint32_t value = 0U; - uint32_t DelayUs = 0U; - uint32_t primaskValue = 0U; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the WWDT clock */ - CLOCK_EnableClock(s_wwdtClocks[WWDT_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) -#if !(defined(FSL_FEATURE_WWDT_HAS_NO_RESET) && FSL_FEATURE_WWDT_HAS_NO_RESET) - /* Reset the module. */ - RESET_PeripheralReset(s_wwdtResets[WWDT_GetInstance(base)]); -#endif - -#if defined(FSL_FEATURE_WWDT_WDTRESET_FROM_PMC) && (FSL_FEATURE_WWDT_WDTRESET_FROM_PMC) - /* PMC RESETCAUSE: set bit to clear it by write 1. */ - PMC->RESETCAUSE = PMC_RESETCAUSE_WDTRESET_MASK; - /* Enable the watchdog reset event to affect the system in the Power Management Controller */ - PMC->CTRL |= PMC_CTRL_WDTRESETENABLE_MASK; -#endif /*FSL_FEATURE_WWDT_WDTRESET_FROM_PMC*/ - -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ - -#if !(defined(FSL_FEATURE_WWDT_HAS_NO_OSCILLATOR_LOCK) && FSL_FEATURE_WWDT_HAS_NO_OSCILLATOR_LOCK) - value = WWDT_MOD_WDEN(config->enableWwdt) | WWDT_MOD_WDRESET(config->enableWatchdogReset) | - WWDT_MOD_LOCK(config->enableLockOscillator); -#else - value = WWDT_MOD_WDEN(config->enableWwdt) | WWDT_MOD_WDRESET(config->enableWatchdogReset); -#endif - /* Clear legacy flag in the MOD register by software writing a "1" to this bit field.. */ - if (0U != (base->MOD & WWDT_MOD_WDINT_MASK)) - { - value |= WWDT_MOD_WDINT_MASK; - } - /* Set configuration */ - primaskValue = DisableGlobalIRQ(); - base->TC = WWDT_TC_COUNT(config->timeoutValue); - base->MOD = value; - base->WINDOW = WWDT_WINDOW_WINDOW(config->windowValue); - base->WARNINT = WWDT_WARNINT_WARNINT(config->warningValue); - /* Refreshes the WWDT timer. */ - base->FEED = WWDT_FIRST_WORD_OF_REFRESH; - base->FEED = WWDT_SECOND_WORD_OF_REFRESH; - EnableGlobalIRQ(primaskValue); - /* Read counter value to wait wwdt timer start*/ - if (config->enableWwdt) - { - while (base->TV == 0xFFUL) - { - } - } - - /* This WDPROTECT bit can be set once by software and is only cleared by a reset */ - if (config->enableWatchdogProtect && (0U == (base->MOD & WWDT_MOD_WDPROTECT_MASK))) - { - /* The config->clockFreq_Hz must be set in order to config the delay time. */ - assert(0U != config->clockFreq_Hz); - - /* Set the WDPROTECT bit after the Feed Sequence (0xAA, 0x55) with 3 WDCLK delay */ - DelayUs = FREQUENCY_3MHZ / config->clockFreq_Hz + 1U; - SDK_DelayAtLeastUs(DelayUs, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY); - - base->MOD |= WWDT_MOD_WDPROTECT(1U); - } -} - -/*! - * brief Shuts down the WWDT. - * - * This function shuts down the WWDT. - * - * param base WWDT peripheral base address - */ -void WWDT_Deinit(WWDT_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable the WWDT clock */ - CLOCK_DisableClock(s_wwdtClocks[WWDT_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Refreshes the WWDT timer. - * - * This function feeds the WWDT. - * This function should be called before WWDT timer is in timeout. Otherwise, a reset is asserted. - * - * param base WWDT peripheral base address - */ -void WWDT_Refresh(WWDT_Type *base) -{ - uint32_t primaskValue = 0U; - - /* Disable the global interrupt to protect refresh sequence */ - primaskValue = DisableGlobalIRQ(); - base->FEED = WWDT_FIRST_WORD_OF_REFRESH; - base->FEED = WWDT_SECOND_WORD_OF_REFRESH; - EnableGlobalIRQ(primaskValue); -} - -/*! - * brief Clear WWDT flag. - * - * This function clears WWDT status flag. - * - * Example for clearing warning flag: - * code - * WWDT_ClearStatusFlags(wwdt_base, kWWDT_WarningFlag); - * endcode - * param base WWDT peripheral base address - * param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::_wwdt_status_flags_t - */ -void WWDT_ClearStatusFlags(WWDT_Type *base, uint32_t mask) -{ - /* Clear the WDINT bit so that we don't accidentally clear it */ - uint32_t reg = (base->MOD & (~WWDT_MOD_WDINT_MASK)); - - /* Clear timeout by writing a zero */ - if (0U != (mask & (uint32_t)kWWDT_TimeoutFlag)) - { - reg &= ~WWDT_MOD_WDTOF_MASK; -#if defined(FSL_FEATURE_WWDT_WDTRESET_FROM_PMC) && (FSL_FEATURE_WWDT_WDTRESET_FROM_PMC) - /* PMC RESETCAUSE: set bit to clear it */ - PMC->RESETCAUSE = PMC_RESETCAUSE_WDTRESET_MASK; -#endif /*FSL_FEATURE_WWDT_WDTRESET_FROM_PMC*/ - } - - /* Clear warning interrupt flag by writing a one */ - if (0U != (mask & (uint32_t)kWWDT_WarningFlag)) - { - reg |= WWDT_MOD_WDINT_MASK; - } - - base->MOD = reg; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_wwdt.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_wwdt.h deleted file mode 100644 index e1ee183dd51..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/fsl_wwdt.h +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_WWDT_H_ -#define FSL_WWDT_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup wwdt - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief Defines WWDT driver version. */ -#define FSL_WWDT_DRIVER_VERSION (MAKE_VERSION(2, 1, 9)) -/*@}*/ - -/*! @name Refresh sequence */ -/*@{*/ -#define WWDT_FIRST_WORD_OF_REFRESH (0xAAU) /*!< First word of refresh sequence */ -#define WWDT_SECOND_WORD_OF_REFRESH (0x55U) /*!< Second word of refresh sequence */ -/*@}*/ - -/*! @brief Describes WWDT configuration structure. */ -typedef struct _wwdt_config -{ - bool enableWwdt; /*!< Enables or disables WWDT */ - bool enableWatchdogReset; /*!< true: Watchdog timeout will cause a chip reset - false: Watchdog timeout will not cause a chip reset */ - bool enableWatchdogProtect; /*!< true: Enable watchdog protect i.e timeout value can only be - changed after counter is below warning & window values - false: Disable watchdog protect; timeout value can be changed - at any time */ -#if !(defined(FSL_FEATURE_WWDT_HAS_NO_OSCILLATOR_LOCK) && FSL_FEATURE_WWDT_HAS_NO_OSCILLATOR_LOCK) - bool enableLockOscillator; /*!< true: Disabling or powering down the watchdog oscillator is prevented - Once set, this bit can only be cleared by a reset - false: Do not lock oscillator */ -#endif - uint32_t windowValue; /*!< Window value, set this to 0xFFFFFF if windowing is not in effect */ - uint32_t timeoutValue; /*!< Timeout value */ - uint32_t warningValue; /*!< Watchdog time counter value that will generate a - warning interrupt. Set this to 0 for no warning */ - uint32_t clockFreq_Hz; /*!< Watchdog clock source frequency. */ -} wwdt_config_t; - -/*! - * @brief WWDT status flags. - * - * This structure contains the WWDT status flags for use in the WWDT functions. - */ -enum _wwdt_status_flags_t -{ - kWWDT_TimeoutFlag = WWDT_MOD_WDTOF_MASK, /*!< Time-out flag, set when the timer times out */ - kWWDT_WarningFlag = WWDT_MOD_WDINT_MASK /*!< Warning interrupt flag, set when timer is below the value WDWARNINT */ -}; - -/******************************************************************************* - * API - *******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name WWDT Initialization and De-initialization - * @{ - */ - -/*! - * @brief Initializes WWDT configure structure. - * - * This function initializes the WWDT configure structure to default value. The default - * value are: - * @code - * config->enableWwdt = true; - * config->enableWatchdogReset = false; - * config->enableWatchdogProtect = false; - * config->enableLockOscillator = false; - * config->windowValue = 0xFFFFFFU; - * config->timeoutValue = 0xFFFFFFU; - * config->warningValue = 0; - * @endcode - * - * @param config Pointer to WWDT config structure. - * @see wwdt_config_t - */ -void WWDT_GetDefaultConfig(wwdt_config_t *config); - -/*! - * @brief Initializes the WWDT. - * - * This function initializes the WWDT. When called, the WWDT runs according to the configuration. - * - * Example: - * @code - * wwdt_config_t config; - * WWDT_GetDefaultConfig(&config); - * config.timeoutValue = 0x7ffU; - * WWDT_Init(wwdt_base,&config); - * @endcode - * - * @param base WWDT peripheral base address - * @param config The configuration of WWDT - */ -void WWDT_Init(WWDT_Type *base, const wwdt_config_t *config); - -/*! - * @brief Shuts down the WWDT. - * - * This function shuts down the WWDT. - * - * @param base WWDT peripheral base address - */ -void WWDT_Deinit(WWDT_Type *base); - -/* @} */ - -/*! - * @name WWDT Functional Operation - * @{ - */ - -/*! - * @brief Enables the WWDT module. - * - * This function write value into WWDT_MOD register to enable the WWDT, it is a write-once bit; - * once this bit is set to one and a watchdog feed is performed, the watchdog timer will run - * permanently. - * - * @param base WWDT peripheral base address - */ -static inline void WWDT_Enable(WWDT_Type *base) -{ - base->MOD |= WWDT_MOD_WDEN_MASK; -} - -/*! - * @brief Disables the WWDT module. - * @deprecated Do not use this function. It will be deleted in next release version, for - * once the bit field of WDEN written with a 1, it can not be re-written with a 0. - * - * This function write value into WWDT_MOD register to disable the WWDT. - * - * @param base WWDT peripheral base address - */ -static inline void WWDT_Disable(WWDT_Type *base) -{ - base->MOD &= ~WWDT_MOD_WDEN_MASK; -} - -/*! - * @brief Gets all WWDT status flags. - * - * This function gets all status flags. - * - * Example for getting Timeout Flag: - * @code - * uint32_t status; - * status = WWDT_GetStatusFlags(wwdt_base) & kWWDT_TimeoutFlag; - * @endcode - * @param base WWDT peripheral base address - * @return The status flags. This is the logical OR of members of the - * enumeration ::_wwdt_status_flags_t - */ -static inline uint32_t WWDT_GetStatusFlags(WWDT_Type *base) -{ -#if defined(FSL_FEATURE_WWDT_WDTRESET_FROM_PMC) && (FSL_FEATURE_WWDT_WDTRESET_FROM_PMC) - uint32_t status; - /* WDTOF is not set in case of WD reset - get info from PMC instead */ - status = (base->MOD & (WWDT_MOD_WDTOF_MASK | WWDT_MOD_WDINT_MASK)); - if (PMC->RESETCAUSE & PMC_RESETCAUSE_WDTRESET_MASK) - { - status |= kWWDT_TimeoutFlag; - } - return status; -#else - return (base->MOD & (WWDT_MOD_WDTOF_MASK | WWDT_MOD_WDINT_MASK)); -#endif /*FSL_FEATURE_WWDT_WDTRESET_FROM_PMC*/ -} - -/*! - * @brief Clear WWDT flag. - * - * This function clears WWDT status flag. - * - * Example for clearing warning flag: - * @code - * WWDT_ClearStatusFlags(wwdt_base, kWWDT_WarningFlag); - * @endcode - * @param base WWDT peripheral base address - * @param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::_wwdt_status_flags_t - */ -void WWDT_ClearStatusFlags(WWDT_Type *base, uint32_t mask); - -/*! - * @brief Set the WWDT warning value. - * - * The WDWARNINT register determines the watchdog timer counter value that will generate a watchdog - * interrupt. When the watchdog timer counter is no longer greater than the value defined by - * WARNINT, an interrupt will be generated after the subsequent WDCLK. - * - * @param base WWDT peripheral base address - * @param warningValue WWDT warning value. - */ -static inline void WWDT_SetWarningValue(WWDT_Type *base, uint32_t warningValue) -{ - base->WARNINT = WWDT_WARNINT_WARNINT(warningValue); -} - -/*! - * @brief Set the WWDT timeout value. - * - * This function sets the timeout value. Every time a feed sequence occurs the value in the TC - * register is loaded into the Watchdog timer. Writing a value below 0xFF will cause 0xFF to be - * loaded into the TC register. Thus the minimum time-out interval is TWDCLK*256*4. - * If enableWatchdogProtect flag is true in wwdt_config_t config structure, any attempt to change - * the timeout value before the watchdog counter is below the warning and window values - * will cause a watchdog reset and set the WDTOF flag. - * - * @param base WWDT peripheral base address - * @param timeoutCount WWDT timeout value, count of WWDT clock tick. - */ -static inline void WWDT_SetTimeoutValue(WWDT_Type *base, uint32_t timeoutCount) -{ - base->TC = WWDT_TC_COUNT(timeoutCount); -} - -/*! - * @brief Sets the WWDT window value. - * - * The WINDOW register determines the highest TV value allowed when a watchdog feed is performed. - * If a feed sequence occurs when timer value is greater than the value in WINDOW, a watchdog - * event will occur. To disable windowing, set windowValue to 0xFFFFFF (maximum possible timer - * value) so windowing is not in effect. - * - * @param base WWDT peripheral base address - * @param windowValue WWDT window value. - */ -static inline void WWDT_SetWindowValue(WWDT_Type *base, uint32_t windowValue) -{ - base->WINDOW = WWDT_WINDOW_WINDOW(windowValue); -} - -/*! - * @brief Refreshes the WWDT timer. - * - * This function feeds the WWDT. - * This function should be called before WWDT timer is in timeout. Otherwise, a reset is asserted. - * - * @param base WWDT peripheral base address - */ -void WWDT_Refresh(WWDT_Type *base); - -/*@}*/ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @}*/ - -#endif /* FSL_WWDT_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/flash/fsl_efuse.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/flash/fsl_efuse.h deleted file mode 100644 index aad5bf341c4..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/flash/fsl_efuse.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - * - */ - -#ifndef FSL_EFUSE_H_ -#define FSL_EFUSE_H_ - -#include "fsl_flash.h" - -/*! - * @addtogroup efuse_driver - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name EFUSE APIs - * @{ - */ - -/*! - * @brief Initialize EFUSE controller. - * - * This function enables EFUSE Controller clock. - * - * @retval #kStatus_Success 0 Operation succeeded without error. - * @retval #kStatus_Fail 1 The operation failed with a generic error. - * @retval #kStatus_ReadOnly 2 Requested value cannot be changed because it is read-only. - * @retval #kStatus_OutOfRange 3 Requested value is out of range. - * @retval #kStatus_InvalidArgument 4 The requested command's argument is undefined. - * @retval #kStatus_Timeout An invalid 5 A timeout occurred - * @retval #kStatus_NoTransferInProgress 6 No send in progress. - */ -status_t EFUSE_Init(void); - -/*! - * @brief De-Initialize EFUSE controller. - * - * This functin disables EFUSE Controller Clock. - * - * @retval #kStatus_Success 0 Operation succeeded without error. - * @retval #kStatus_Fail 1 The operation failed with a generic error. - * @retval #kStatus_ReadOnly 2 Requested value cannot be changed because it is read-only. - * @retval #kStatus_OutOfRange 3 Requested value is out of range. - * @retval #kStatus_InvalidArgument 4 The requested command's argument is undefined. - * @retval #kStatus_Timeout An invalid 5 A timeout occurred - * @retval #kStatus_NoTransferInProgress 6 No send in progress. - */ -status_t EFUSE_Deinit(void); - -/*! - * @brief Read Fuse value from eFuse word. - * - * This function read fuse data from eFuse word to specified data buffer. - * - * @param addr Fuse address - * @param data Buffer to hold the data read from eFuse word - * - * @retval #kStatus_Success 0 Operation succeeded without error. - * @retval #kStatus_Fail 1 The operation failed with a generic error. - * @retval #kStatus_ReadOnly 2 Requested value cannot be changed because it is read-only. - * @retval #kStatus_OutOfRange 3 Requested value is out of range. - * @retval #kStatus_InvalidArgument 4 The requested command's argument is undefined. - * @retval #kStatus_Timeout An invalid 5 A timeout occurred - * @retval #kStatus_NoTransferInProgress 6 No send in progress. - */ -status_t EFUSE_Read(uint32_t addr, uint32_t *data); - -/*! - * @brief Program value to eFuse block. - * - * This function program data to specified eFuse address. - * - * @param addr Fuse address - * @param data data to be programmed into eFuse Fuse block - * - * @retval #kStatus_Success 0 Operation succeeded without error. - * @retval #kStatus_Fail 1 The operation failed with a generic error. - * @retval #kStatus_ReadOnly 2 Requested value cannot be changed because it is read-only. - * @retval #kStatus_OutOfRange 3 Requested value is out of range. - * @retval #kStatus_InvalidArgument 4 The requested command's argument is undefined. - * @retval #kStatus_Timeout An invalid 5 A timeout occurred - * @retval #kStatus_NoTransferInProgress 6 No send in progress. - */ -status_t EFUSE_Program(uint32_t addr, uint32_t data); - -/*@}*/ - -#ifdef __cplusplus -} -#endif - -/*@}*/ - -#endif /*! FSL_EFUSE_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/flash/fsl_flash.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/flash/fsl_flash.h deleted file mode 100644 index ccdf3ff900d..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/flash/fsl_flash.h +++ /dev/null @@ -1,591 +0,0 @@ -/* - * Copyright 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - * - */ - -#ifndef FSL_FLASH_H_ -#define FSL_FLASH_H_ - -#include "fsl_common.h" -/*! - * @addtogroup flash_driver - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/*! - * @name Flash version - * @{ - */ -/*! @brief Constructs the version number for drivers. */ -#if !defined(MAKE_VERSION) -#define MAKE_VERSION(major, minor, bugfix) (((major) << 16) | ((minor) << 8) | (bugfix)) -#endif - -/*! @brief Flash driver version for SDK*/ -#define FSL_FLASH_DRIVER_VERSION (MAKE_VERSION(1, 0, 0)) /*!< Version 1.0.0. */ - -/*! @brief Flash driver version for ROM*/ -enum _flash_driver_version_constants -{ - kFLASH_DriverVersionName = 'F', /*!< Flash driver version name.*/ - kFLASH_DriverVersionMajor = 1, /*!< Major flash driver version.*/ - kFLASH_DriverVersionMinor = 0, /*!< Minor flash driver version.*/ - kFLASH_DriverVersionBugfix = 0 /*!< Bugfix for flash driver version.*/ -}; -/*@}*/ - -/*! - * @name Flash driver support feature - * @{ - */ -#define FSL_FEATURE_SYSCON_HAS_FLASH_HIDING 1U - -/*@}*/ - -/*! - * @name Flash status - * @{ - */ -/*! @brief Flash driver status group. */ -#if defined(kStatusGroup_FlashDriver) -#define kStatusGroupGeneric kStatusGroup_Generic -#define kStatusGroupFlashDriver kStatusGroup_FlashDriver -#elif defined(kStatusGroup_FLASHIAP) -#define kStatusGroupGeneric kStatusGroup_Generic -#define kStatusGroupFlashDriver kStatusGroup_FLASH -#else -#define kStatusGroupGeneric 0 -#define kStatusGroupFlashDriver 1 -#endif - -/*! @brief Constructs a status code value from a group and a code number. */ -#if !defined(MAKE_STATUS) -#define MAKE_STATUS(group, code) ((((group)*100) + (code))) -#endif - -/*! - * @brief Flash driver status codes. - */ -enum -{ - kStatus_FLASH_Success = MAKE_STATUS(kStatusGroupGeneric, 0), /*!< API is executed successfully*/ - kStatus_FLASH_InvalidArgument = MAKE_STATUS(kStatusGroupGeneric, 4), /*!< Invalid argument*/ - kStatus_FLASH_SizeError = MAKE_STATUS(kStatusGroupFlashDriver, 0), /*!< Error size*/ - kStatus_FLASH_AlignmentError = - MAKE_STATUS(kStatusGroupFlashDriver, 1), /*!< Parameter is not aligned with the specified baseline*/ - kStatus_FLASH_AddressError = MAKE_STATUS(kStatusGroupFlashDriver, 2), /*!< Address is out of range */ - kStatus_FLASH_AccessError = - MAKE_STATUS(kStatusGroupFlashDriver, 3), /*!< Invalid instruction codes and out-of bound addresses */ - kStatus_FLASH_ProtectionViolation = MAKE_STATUS( - kStatusGroupFlashDriver, 4), /*!< The program/erase operation is requested to execute on protected areas */ - kStatus_FLASH_CommandFailure = - MAKE_STATUS(kStatusGroupFlashDriver, 5), /*!< Run-time error during command execution. */ - kStatus_FLASH_UnknownProperty = MAKE_STATUS(kStatusGroupFlashDriver, 6), /*!< Unknown property.*/ - kStatus_FLASH_EraseKeyError = MAKE_STATUS(kStatusGroupFlashDriver, 7), /*!< API erase key is invalid.*/ - kStatus_FLASH_RegionExecuteOnly = - MAKE_STATUS(kStatusGroupFlashDriver, 8), /*!< The current region is execute-only.*/ - kStatus_FLASH_ExecuteInRamFunctionNotReady = - MAKE_STATUS(kStatusGroupFlashDriver, 9), /*!< Execute-in-RAM function is not available.*/ - - kStatus_FLASH_CommandNotSupported = MAKE_STATUS(kStatusGroupFlashDriver, 11), /*!< Flash API is not supported.*/ - kStatus_FLASH_ReadOnlyProperty = MAKE_STATUS(kStatusGroupFlashDriver, 12), /*!< The flash property is read-only.*/ - kStatus_FLASH_InvalidPropertyValue = - MAKE_STATUS(kStatusGroupFlashDriver, 13), /*!< The flash property value is out of range.*/ - kStatus_FLASH_InvalidSpeculationOption = - MAKE_STATUS(kStatusGroupFlashDriver, 14), /*!< The option of flash prefetch speculation is invalid.*/ - kStatus_FLASH_EccError = MAKE_STATUS(kStatusGroupFlashDriver, - 0x10), /*!< A correctable or uncorrectable error during command execution. */ - kStatus_FLASH_CompareError = - MAKE_STATUS(kStatusGroupFlashDriver, 0x11), /*!< Destination and source memory contents do not match. */ - kStatus_FLASH_RegulationLoss = MAKE_STATUS(kStatusGroupFlashDriver, 0x12), /*!< A loss of regulation during read. */ - kStatus_FLASH_InvalidWaitStateCycles = - MAKE_STATUS(kStatusGroupFlashDriver, 0x13), /*!< The wait state cycle set to r/w mode is invalid. */ - - kStatus_FLASH_OutOfDateCfpaPage = - MAKE_STATUS(kStatusGroupFlashDriver, 0x20), /*!< CFPA page version is out of date. */ - kStatus_FLASH_BlankIfrPageData = MAKE_STATUS(kStatusGroupFlashDriver, 0x21), /*!< Blank page cannnot be read. */ - kStatus_FLASH_EncryptedRegionsEraseNotDoneAtOnce = - MAKE_STATUS(kStatusGroupFlashDriver, 0x22), /*!< Encrypted flash subregions are not erased at once. */ - kStatus_FLASH_ProgramVerificationNotAllowed = MAKE_STATUS( - kStatusGroupFlashDriver, 0x23), /*!< Program verification is not allowed when the encryption is enabled. */ - kStatus_FLASH_HashCheckError = - MAKE_STATUS(kStatusGroupFlashDriver, 0x24), /*!< Hash check of page data is failed. */ - kStatus_FLASH_SealedFfrRegion = MAKE_STATUS(kStatusGroupFlashDriver, 0x25), /*!< The FFR region is sealed. */ - kStatus_FLASH_FfrRegionWriteBroken = MAKE_STATUS( - kStatusGroupFlashDriver, 0x26), /*!< The FFR Spec region is not allowed to be written discontinuously. */ - kStatus_FLASH_NmpaAccessNotAllowed = - MAKE_STATUS(kStatusGroupFlashDriver, 0x27), /*!< The NMPA region is not allowed to be read/written/erased. */ - kStatus_FLASH_CmpaCfgDirectEraseNotAllowed = - MAKE_STATUS(kStatusGroupFlashDriver, 0x28), /*!< The CMPA Cfg region is not allowed to be erased directly. */ - kStatus_FLASH_FfrBankIsLocked = MAKE_STATUS(kStatusGroupFlashDriver, 0x29), /*!< The FFR bank region is locked. */ - kStatus_FLASH_CfpaScratchPageInvalid = - MAKE_STATUS(kStatusGroupFlashDriver, 0x30), /*!< CFPA Scratch Page is invalid*/ - kStatus_FLASH_CfpaVersionRollbackDisallowed = - MAKE_STATUS(kStatusGroupFlashDriver, 0x31), /*!< CFPA version rollback is not allowed */ - kStatus_FLASH_ReadHidingAreaDisallowed = - MAKE_STATUS(kStatusGroupFlashDriver, 0x32), /*!< Flash hiding read is not allowed */ - kStatus_FLASH_ModifyProtectedAreaDisallowed = - MAKE_STATUS(kStatusGroupFlashDriver, 0x33), /*!< Flash firewall page locked erase and program are not allowed */ - kStatus_FLASH_CommandOperationInProgress = MAKE_STATUS( - kStatusGroupFlashDriver, 0x34), /*!< The flash state is busy, indicate that a flash command in progress. */ -}; -/*@}*/ - -/*! - * @name Flash API key - * @{ - */ -/*! @brief Constructs the four character code for the Flash driver API key. */ -#if !defined(FOUR_CHAR_CODE) -#define FOUR_CHAR_CODE(a, b, c, d) (((d) << 24) | ((c) << 16) | ((b) << 8) | ((a))) -#endif - -/*! - * @brief Enumeration for Flash driver API keys. - * - * @note The resulting value is built with a byte order such that the string - * being readable in expected order when viewed in a hex editor, if the value - * is treated as a 32-bit little endian value. - */ -enum _flash_driver_api_keys -{ - kFLASH_ApiEraseKey = FOUR_CHAR_CODE('l', 'f', 'e', 'k') /*!< Key value used to validate all flash erase APIs.*/ -}; -/*@}*/ - -/*! - * @brief Enumeration for various flash properties. - */ -typedef enum _flash_property_tag -{ - kFLASH_PropertyPflashSectorSize = 0x00U, /*!< Pflash sector size property.*/ - kFLASH_PropertyPflashTotalSize = 0x01U, /*!< Pflash total size property.*/ - kFLASH_PropertyPflashBlockSize = 0x02U, /*!< Pflash block size property.*/ - kFLASH_PropertyPflashBlockCount = 0x03U, /*!< Pflash block count property.*/ - kFLASH_PropertyPflashBlockBaseAddr = 0x04U, /*!< Pflash block base address property.*/ - - kFLASH_PropertyPflashPageSize = 0x30U, /*!< Pflash page size property.*/ - kFLASH_PropertyPflashSystemFreq = 0x31U, /*!< System Frequency System Frequency.*/ - - kFLASH_PropertyFfrSectorSize = 0x40U, /*!< FFR sector size property.*/ - kFLASH_PropertyFfrTotalSize = 0x41U, /*!< FFR total size property.*/ - kFLASH_PropertyFfrBlockBaseAddr = 0x42U, /*!< FFR block base address property.*/ - kFLASH_PropertyFfrPageSize = 0x43U, /*!< FFR page size property.*/ -} flash_property_tag_t; - -/*! - * @brief Enumeration for flash max pages to erase. - */ -enum _flash_max_erase_page_value -{ - kFLASH_MaxPagesToErase = 100U /*!< The max value in pages to erase. */ -}; - -/*! - * @brief Enumeration for flash alignment property. - */ -enum _flash_alignment_property -{ - kFLASH_AlignementUnitVerifyErase = 4U, /*!< The alignment unit in bytes used for verify erase operation.*/ - kFLASH_AlignementUnitProgram = 512U, /*!< The alignment unit in bytes used for program operation.*/ - /*kFLASH_AlignementUnitVerifyProgram = 4U,*/ /*!< The alignment unit in bytes used for verify program operation.*/ - kFLASH_AlignementUnitSingleWordRead = 16U /*!< The alignment unit in bytes used for SingleWordRead command.*/ -}; - -/*! - * @brief Enumeration for flash read ecc option - */ -enum _flash_read_ecc_option -{ - kFLASH_ReadWithEccOn = 0U, /*! ECC is on */ - kFLASH_ReadWithEccOff = 1U /*! ECC is off */ -}; - -/*! - * @brief Enumeration for flash read margin option - */ -enum _flash_read_margin_option -{ - kFLASH_ReadMarginNormal = 0U, /*!< Normal read */ - kFLASH_ReadMarginVsProgram = 1U, /*!< Margin vs. program */ - kFLASH_ReadMarginVsErase = 2U, /*!< Margin vs. erase */ - kFLASH_ReadMarginIllegalBitCombination = 3U /*!< Illegal bit combination */ -}; - -/*! - * @brief Enumeration for flash read dmacc option - */ -enum _flash_read_dmacc_option -{ - kFLASH_ReadDmaccDisabled = 0U, /*!< Memory word */ - kFLASH_ReadDmaccEnabled = 1U /*!< DMACC word */ -}; - -/*! - * @brief Enumeration for flash ramp control option - */ -enum _flash_ramp_control_option -{ - kFLASH_RampControlDivisionFactorReserved = 0U, /*!< Reserved */ - kFLASH_RampControlDivisionFactor256 = 1U, /*!< clk48mhz / 256 = 187.5KHz */ - kFLASH_RampControlDivisionFactor128 = 2U, /*!< clk48mhz / 128 = 375KHz */ - kFLASH_RampControlDivisionFactor64 = 3U /*!< clk48mhz / 64 = 750KHz */ -}; - -/*! @brief Flash ECC log info. */ -typedef struct _flash_ecc_log -{ - uint32_t firstEccEventAddress; - uint32_t eccErrorCount; - uint32_t eccCorrectionCount; - uint32_t reserved; -} flash_ecc_log_t; - -/*! @brief Flash controller paramter config. */ -typedef struct _flash_mode_config -{ - uint32_t sysFreqInMHz; - /* ReadSingleWord parameter. */ - struct - { - uint8_t readWithEccOff : 1; - uint8_t readMarginLevel : 2; - uint8_t readDmaccWord : 1; - uint8_t reserved0 : 4; - uint8_t reserved1[3]; - } readSingleWord; - /* SetWriteMode parameter. */ - struct - { - uint8_t programRampControl; - uint8_t eraseRampControl; - uint8_t reserved[2]; - } setWriteMode; - /* SetReadMode parameter. */ - struct - { - uint16_t readInterfaceTimingTrim; - uint16_t readControllerTimingTrim; - uint8_t readWaitStates; - uint8_t reserved[3]; - } setReadMode; -} flash_mode_config_t; - -/*! @brief Flash controller paramter config. */ -typedef struct _flash_ffr_config -{ - uint32_t ffrBlockBase; - uint32_t ffrTotalSize; - uint32_t ffrPageSize; - uint32_t cfpaPageVersion; - uint32_t cfpaPageOffset; -} flash_ffr_config_t; - -/*! @brief Flash driver state information. - * - * An instance of this structure is allocated by the user of the flash driver and - * passed into each of the driver APIs. - */ -typedef struct -{ - uint32_t PFlashBlockBase; /*!< A base address of the first PFlash block */ - uint32_t PFlashTotalSize; /*!< The size of the combined PFlash block. */ - uint32_t PFlashBlockCount; /*!< A number of PFlash blocks. */ - uint32_t PFlashPageSize; /*!< The size in bytes of a page of PFlash. */ - uint32_t PFlashSectorSize; /*!< The size in bytes of a sector of PFlash. */ - flash_ffr_config_t ffrConfig; - flash_mode_config_t modeConfig; - uint32_t *nbootCtx; - bool useAhbRead; -} flash_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization - * @{ - */ - -/*! - * @brief Initializes the global flash properties structure members. - * - * This function checks and initializes the Flash module for the other Flash APIs. - * - * @param config Pointer to the storage for the driver runtime state. - * - * @retval #kStatus_FLASH_Success API was executed successfully. - * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FLASH_CommandFailure Run-time error during the command execution. - * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported. - * @retval #kStatus_FLASH_EccError A correctable or uncorrectable error during command execution. - * @retval #kStatus_FLASH_RegulationLoss A loss of regulation during read. - */ -status_t FLASH_Init(flash_config_t *config); - -/*! - * @brief De-Initializes the global flash properties structure members. - * - * This API De-initializes the FLASH default parameters and related FLASH clock for the FLASH and FMC. - * The flash_deinit API should be called after all the other FLASH APIs. - * - * @param config Pointer to the storage for the driver runtime state. - * - * @retval #kStatus_FLASH_Success API was executed successfully. - * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided. - */ -status_t FLASH_Deinit(flash_config_t *config); - -/*@}*/ - -/*! - * @name Erasing - * @{ - */ - -/*! - * @brief Erases the flash sectors encompassed by parameters passed into function. - * - * This function erases the appropriate number of flash sectors based on the - * desired start address and length. - * - * @param config The pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be erased. - * NOTE: The start address need to be 4 Bytes-aligned. - * - * @param lengthInBytes The length, given in bytes need be 4 Bytes-aligned. - * - * @param key The value used to validate all flash erase APIs. - * - * @retval #kStatus_FLASH_Success API was executed successfully. - * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FLASH_AlignmentError The parameter is not aligned with the specified baseline. - * @retval #kStatus_FLASH_AddressError The address is out of range. - * @retval #kStatus_FLASH_EraseKeyError The API erase key is invalid. - * @retval #kStatus_FLASH_ModifyProtectedAreaDisallowed Flash firewall page locked erase and program are not allowed - * @retval #kStatus_FLASH_CommandFailure Run-time error during the command execution. - * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported. - * @retval #kStatus_FLASH_EccError A correctable or uncorrectable error during command execution. - * @retval #kStatus_FLASH_RegulationLoss A loss of regulation during read. - */ -status_t FLASH_Erase(flash_config_t *config, uint32_t start, uint32_t lengthInBytes, uint32_t key); - -/*@}*/ - -/*! - * @name Programming - * @{ - */ - -/*! - * @brief Programs flash with data at locations passed in through parameters. - * - * This function programs the flash memory with the desired data for a given - * flash area as determined by the start address and the length. - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be programmed. Must be - * word-aligned. - * @param src A pointer to the source buffer of data that is to be programmed - * into the flash. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be programmed. Must be word-aligned. - * - * @retval #kStatus_FLASH_Success API was executed successfully. - * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with the specified baseline. - * @retval #kStatus_FLASH_AddressError Address is out of range. - * @retval #kStatus_FLASH_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FLASH_ModifyProtectedAreaDisallowed Flash firewall page locked erase and program are not allowed - * @retval #kStatus_FLASH_CommandFailure Run-time error during the command execution. - * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported. - * @retval #kStatus_FLASH_RegulationLoss A loss of regulation during read. - * @retval #kStatus_FLASH_EccError A correctable or uncorrectable error during command execution. - */ -status_t FLASH_Program(flash_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes); - -/*! - * @name Reading - * @{ - */ - -/*! - * @brief Reads flash at locations passed in through parameters. - * - * This function read the flash memory from a given flash area as determined - * by the start address and the length. - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be read. - * @param dest A pointer to the dest buffer of data that is to be read - * from the flash. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be read. - * - * @retval #kStatus_FLASH_Success API was executed successfully. - * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with the specified baseline. - * @retval #kStatus_FLASH_AddressError Address is out of range. - * @retval #kStatus_FLASH_ReadHidingAreaDisallowed Flash hiding read is not allowed - * @retval #kStatus_FLASH_CommandFailure Run-time error during the command execution. - * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported. - * @retval #kStatus_FLASH_RegulationLoss A loss of regulation during read. - * @retval #kStatus_FLASH_EccError A correctable or uncorrectable error during command execution. - */ -status_t FLASH_Read(flash_config_t *config, uint32_t start, uint8_t *dest, uint32_t lengthInBytes); - -/*@}*/ - -/*! - * @name Verification - * @{ - */ - -/*! - * @brief Verifies an erasure of the desired flash area at a specified margin level. - * - * This function checks the appropriate number of flash sectors based on - * the desired start address and length to check whether the flash is erased - * to the specified read margin level. - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be verified. - * The start address does not need to be sector-aligned but must be word-aligned. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be verified. Must be word-aligned. - * @param margin Read margin choice. - * - * @retval #kStatus_FLASH_Success API was executed successfully. - * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with specified baseline. - * @retval #kStatus_FLASH_AddressError Address is out of range. - * @retval #kStatus_FLASH_CommandFailure Run-time error during the command execution. - * @retval #kStatus_FLASH_CommandFailure Run-time error during the command execution. - * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported. - * @retval #kStatus_FLASH_RegulationLoss A loss of regulation during read. - * @retval #kStatus_FLASH_EccError A correctable or uncorrectable error during command execution. - */ -status_t FLASH_VerifyErase(flash_config_t *config, uint32_t start, uint32_t lengthInBytes); - -/*! - * @brief Verifies programming of the desired flash area at a specified margin level. - * - * This function verifies the data programed in the flash memory using the - * Flash Program Check Command and compares it to the expected data for a given - * flash area as determined by the start address and length. - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be verified. Must be word-aligned. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be verified. Must be word-aligned. - * @param expectedData A pointer to the expected data that is to be - * verified against. - * @param margin Read margin choice. - * @param failedAddress A pointer to the returned failing address. - * @param failedData A pointer to the returned failing data. Some derivatives do - * not include failed data as part of the FCCOBx registers. In this - * case, zeros are returned upon failure. - * - * @retval #kStatus_FLASH_Success API was executed successfully. - * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with specified baseline. - * @retval #kStatus_FLASH_AddressError Address is out of range. - * @retval #kStatus_FLASH_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FLASH_ReadHidingAreaDisallowed Flash hiding read is not allowed - * @retval #kStatus_FLASH_CommandFailure Run-time error during the command execution. - * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported. - * @retval #kStatus_FLASH_RegulationLoss A loss of regulation during read. - * @retval #kStatus_FLASH_EccError A correctable or uncorrectable error during command execution. - */ -status_t FLASH_VerifyProgram(flash_config_t *config, - uint32_t start, - uint32_t lengthInBytes, - const uint8_t *expectedData, - uint32_t *failedAddress, - uint32_t *failedData); - -/*@}*/ - -/*! - * @name Properties - * @{ - */ - -/*! - * @brief Returns the desired flash property. - * - * @param config A pointer to the storage for the driver runtime state. - * @param whichProperty The desired property from the list of properties in - * enum flash_property_tag_t - * @param value A pointer to the value returned for the desired flash property. - * - * @retval #kStatus_FLASH_Success API was executed successfully. - * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FLASH_UnknownProperty An unknown property tag. - */ -status_t FLASH_GetProperty(flash_config_t *config, flash_property_tag_t whichProperty, uint32_t *value); - -/*@}*/ - -/*! - * @name CustKeyStore - * @{ - */ - -/*! - * @brief Get the customer key store data from the customer key store region . - * - * @param config Pointer to flash_config_t data structure in memory to store driver runtime state. - * @param pData Pointer to the customer key store data buffer, which got from the customer key store region. - * @param offset Point to the offset value based on the customer key store address(0x3e400) of the device. - * @param len Point to the length of the expected get customer key store data, and the offset + len <= 512B. - * - * @retval #kStatus_FLASH_Success API was executed successfully. - * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided. - */ -status_t FLASH_GetCustKeyStore(flash_config_t *config, uint8_t *pData, uint32_t offset, uint32_t len); - -/*@}*/ - -/*! - * @name flash status - * @{ - */ -#if defined(FSL_FEATURE_SYSCON_HAS_FLASH_HIDING) && (FSL_FEATURE_SYSCON_HAS_FLASH_HIDING == 1) -/*! - * @brief Validates the given address range is loaded in the flash hiding region. - * - * @param config A pointer to the storage for the driver runtime state. - * @param startAddress The start address of the desired flash memory to be verified. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be verified. - * - * @retval #kStatus_FLASH_Success API was executed successfully. - * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FLASH_ReadHidingAreaDisallowed Flash hiding read is not allowed. - */ -status_t FLASH_IsFlashAreaReadable(flash_config_t *config, uint32_t startAddress, uint32_t lengthInBytes); -#endif - -/*@}*/ - -#ifdef __cplusplus -} -#endif - -/*@}*/ - -#endif /* _FLASH_FLASH_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/flash/fsl_flash_ffr.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/flash/fsl_flash_ffr.h deleted file mode 100644 index 2bbf820c3d3..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/flash/fsl_flash_ffr.h +++ /dev/null @@ -1,591 +0,0 @@ -/* - * Copyright 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - * - */ - -#ifndef FSL_FLASH_FFR_H_ -#define FSL_FLASH_FFR_H_ - -#include "fsl_flash.h" - -/*! - * @addtogroup flash_ffr_driver - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @brief Alignment(down) utility. */ -#if !defined(ALIGN_DOWN) -#define ALIGN_DOWN(x, a) ((x) & (uint32_t)(-((int32_t)(a)))) -#endif - -/*! @brief Alignment(up) utility. */ -#if !defined(ALIGN_UP) -#define ALIGN_UP(x, a) (-((int32_t)((uint32_t)(-((int32_t)(x))) & (uint32_t)(-((int32_t)(a)))))) -#endif - -#define FLASH_FFR_MAX_PAGE_SIZE (512u) -#define FLASH_FFR_CUST_ADDRESS (0x200U) -#define FLASH_FFR_CUST_PAGE_NUMBER (15u) - -#define FLASH_FFR_HASH_DIGEST_SIZE (32u) -#define FLASH_FFR_IV_CODE_SIZE (52u) -#define FLASH_FFR_KETBLOB_OFFSET (0x160u) -#define FLASH_FFR_KETBLOB_SIZE (0x30u) -#define CFPA_HEADER_MARKER (0x9635u) -#define CMPA_HEADER_MARKER (0x5963u) -#define FLASH_FFR_UUID_SIZE (16u) -enum flash_ffr_page_offset -{ - kFfrPageOffset_CFPA = 0, /*!< Customer In-Field programmed area*/ - kFfrPageOffset_CFPA_CfgPing = 0, /*!< CFPA Configuration area (Ping page)*/ - kFfrPageOffset_CFPA_CfgPong = 1, /*!< Same as CFPA page (Pong page)*/ - kFfrPageOffset_CMPA_Cfg = 2, /*!< Customer Manufacturing programmed area*/ - kFfrPageOffset_NMPA_Cfg = 3, /*!< Customer Manufacturing programmed area*/ - kFfrPageOffset_SBL_Cfg = 4, /*!< SBL recovery programmed area*/ - kFfrPageOffset_B0_IFR1_Visible = 128, /*!< Trim programmed area*/ - -}; - -enum flash_ffr_page_num -{ - kFfrSectorNum_CFPA = 2, /*!< Customer In-Field programmed area*/ - kFfrSectorNum_CMPA = 1, /*!< Customer Manufacturing programmed area*/ - kFfrSectorNum_NMPA = 1, /*!< NXP Manufacturing programmed area*/ - kFfrSectorNum_SBL = 4, /*!< SBL Cus programmed area*/ - kFfrSectorNum_Total = (kFfrSectorNum_CFPA + kFfrSectorNum_CMPA + kFfrSectorNum_NMPA + kFfrSectorNum_SBL), -}; - -enum flash_ffr_block_size -{ - kFfrBlockSize_Key = 52u, - kFfrBlockSize_ActivationCode = 1000u, -}; - -enum cfpa_cfg_cmpa_prog_status -{ - kFfrCmpaProgStatus_Idle = 0x0u, - kFfrCmpaProgStatus_InProgress = 0x5CC55AA5u, -}; - -typedef enum -{ - kFfrCmpaProgProcess_Pre = 0x0u, - kFfrCmpaProgProcess_Post = 0xFFFFFFFFu, -} cmpa_prog_process_t; - -typedef struct -{ - struct - { - uint32_t cfpa_lc_state : 8; - uint32_t cfpa_lc_state_inv : 8; - uint32_t header_marker : 16; - } header; /*!< [0x000-0x003]*/ - - struct /*!< [0x004-0x007]*/ - { - uint32_t version : 24; /*!< cfpa version*/ - uint32_t img_upd : 2; /*!< image cmac update*/ - uint32_t reserved0 : 1; - uint32_t cmpa_update : 3; /*!< CFPA page updated through SB command.*/ - uint32_t reserved1 : 1; - uint32_t dice_en : 1; /*!< Update DICE certificate during next boot*/ - } cfpa_page_version; - - uint32_t secureFwVersion; /*!< [0x008-0x00b]*/ - uint32_t nsFwVersion; /*!< [0x00c-0x00f]*/ - uint32_t recFwVersion; /*!< [0x010-0x013]*/ - uint32_t secBootFlags; /*!< [0x014-0x01f]*/ - uint32_t imageKeyRevoke; /*!< [0x018-0x01b]*/ - uint32_t lpVectorAddr; /*!< [0x01c-0x01f]*/ - uint32_t vendorUsage; /*!< [0x020-0x02f]*/ - uint32_t dcfgNsPin; /*!< [0x024-0x027]*/ - uint32_t dcfgNsDflt; /*!< [0x028-0x02b]*/ - uint32_t reserved0; /*!< [0x02c-0x02f]*/ - uint32_t ivPrince[4]; /*!< [0x030-0x03f]*/ - uint32_t ivIped[8]; /*!< [0x040-0x05f]*/ - - uint32_t errCnt[8]; /*!< [0x060-0x07f]*/ - - uint32_t custCtr[8]; /*!< [0x080-0x09f]*/ - uint32_t mflagCtr[8]; /*!< [0x0a0-0x0bf]*/ - uint32_t flashAcl[8]; /*!< [0x0C0-0x0Df]*/ - uint32_t sblImg0Cmac[4]; /*!< [0x0E0-0x0Ef]*/ - uint32_t img1Cmac[4]; /*!< [0x0F0-0x0Ff]*/ - uint32_t diceCert[36]; /*!< [0x100-0x18f]*/ - uint32_t reserved2[23]; /*!< [0x190-0x1eb]*/ - uint32_t cfpaCrc; /*!< [0x1ec-0x1ef]*/ - uint32_t cfpaCmac[4]; /*!< [0x1f0-0x1ff]*/ -} cfpa_cfg_info_t; - -#define FFR_BOOTCFG_USBSPEED_SHIFT (9U) -#define FFR_BOOTCFG_USBSPEED_MASK (0x3u << FFR_BOOTCFG_USBSPEED_SHIFT) -#define FFR_BOOTCFG_USBSPEED_NMPASEL0 (0x0U) -#define FFR_BOOTCFG_USBSPEED_FS (0x1U) -#define FFR_BOOTCFG_USBSPEED_HS (0x2U) -#define FFR_BOOTCFG_USBSPEED_NMPASEL3 (0x3U) - -#define FFR_BOOTCFG_BOOTSPEED_MASK (0x18U) -#define FFR_BOOTCFG_BOOTSPEED_SHIFT (7U) -#define FFR_BOOTCFG_BOOTSPEED_NMPASEL (0x0U) -#define FFR_BOOTCFG_BOOTSPEED_48MHZ (0x1U) -#define FFR_BOOTCFG_BOOTSPEED_96MHZ (0x2U) - -#define FFR_USBID_VENDORID_MASK (0xFFFFU) -#define FFR_USBID_VENDORID_SHIFT (0U) -#define FFR_USBID_PRODUCTID_MASK (0xFFFF0000U) -#define FFR_USBID_PRODUCTID_SHIFT (16U) - -#define FFR_IMAGE0_CMAC_UPDATE_MASK (0x1) -#define FFR_IMAGE1_CMAC_UPDATE_MASK (0x2) - -#define FFR_IFR1_PUF_AC_CODE_ADDR (0x01100200UL) -#define FFR_IFR1_PUF_AC_CODE_LEN (1024UL) - -#define FFR_IFR1_NXP_CERT_ADDR (0x01100600UL) -#define FFR_IFR1_NXP_CERT_LEN (1448UL) - -#define FFR_IFR1_ROM_PATCH_ARRAY0_ADDR (0x01101900UL) -#define FFR_IFR1_ROM_PATCH_ARRAY0_LEN (1792UL) - -#define FFR_IFR1_ROM_PATCH_ARRAY1_ADDR (0x01102000UL) -#define FFR_IFR1_ROM_PATCH_ARRAY1_LEN (3584UL) - -#define FFR_IFR1_ROM_PATCH_ARRAY2_ADDR (0x01103000UL) -#define FFR_IFR1_ROM_PATCH_ARRAY2_LEN (2048UL) - -#define FFR_IFR1_ROM_PATCH_ARRAY3_ADDR (0x01103800UL) -#define FFR_IFR1_ROM_PATCH_ARRAY3_LEN (2048UL) - -#define FFR_IFR1_NXP_WRITEABLE_REGION0_START (FFR_IFR1_PUF_AC_CODE_ADDR) -#define FFR_IFR1_NXP_WRITEABLE_REGION0_END \ - (FFR_IFR1_PUF_AC_CODE_ADDR + FFR_IFR1_PUF_AC_CODE_LEN + FFR_IFR1_NXP_CERT_LEN) -#define FFR_IFR1_NXP_WRITEABLE_REGION1_START (FFR_IFR1_ROM_PATCH_ARRAY0_ADDR) -#define FFR_IFR1_NXP_WRITEABLE_REGION1_END \ - (FFR_IFR1_ROM_PATCH_ARRAY0_ADDR + FFR_IFR1_ROM_PATCH_ARRAY0_LEN + FFR_IFR1_ROM_PATCH_ARRAY1_LEN) -#define FFR_IFR1_NXP_WRITEABLE_REGION2_START (FFR_IFR1_ROM_PATCH_ARRAY2_ADDR) -#define FFR_IFR1_NXP_WRITEABLE_REGION2_END \ - (FFR_IFR1_ROM_PATCH_ARRAY2_ADDR + FFR_IFR1_ROM_PATCH_ARRAY2_LEN + FFR_IFR1_ROM_PATCH_ARRAY3_LEN) - -typedef struct -{ - struct - { - uint32_t boot_src : 2; - uint32_t rsv0 : 2; - uint32_t isp_boot_if : 3; - uint32_t rsv1 : 1; - uint32_t rec_boot_src : 2; - uint32_t rsv2 : 2; - uint32_t boot_speed : 2; - uint32_t rsv3 : 2; - uint32_t header_marker : 16; - } bootCfg; /*!< [0x000-0x003]*/ - - struct - { - uint32_t flash_remap_size : 5; - uint32_t bank1_ifr0_usage : 3; - uint32_t reserved : 24; - } FlashCfg; /*!< [0x004-0x007]*/ - - struct - { - uint8_t recLed; - uint8_t ispLed; - uint8_t bootFailLed; - uint8_t resv0; - } bootLedStatus; /*!< [0x008-0x00b]*/ - - struct - { - uint16_t powerDnTimeout; - uint16_t wdogTimeout; - } bootTimers; /*!< [0x00c-0x00f]*/ - - uint32_t resv2; /*!< [0x010-0x013]*/ - uint32_t resv3; /*!< [0x014-0x017]*/ - - uint32_t recSpiFlashCfg0; /*!< [0x018-0x01b]*/ - uint32_t recSpiFlashCfg1; /*!< [0x01c-0x01f]*/ - - uint32_t isp_uart_cfg; /*!< [0x020-0x023]*/ - uint32_t isp_i2c_cfg; /*!< [0x024-0x027]*/ - uint32_t isp_can_cfg; /*!< [0x028-0x02b]*/ - uint32_t isp_spi_cfg0; /*!< [0x02c-0x02f]*/ - uint32_t isp_spi_cfg1; /*!< [0x030-0x034]*/ - - struct - { - uint16_t vid; - uint16_t pid; - } usbId; /*!< [0x034-0x037]*/ - - uint32_t isp_usb_cfg; /*!< [0x038-0x038]*/ - uint32_t isp_misc_cfg; /*!< [0x03c-0x03f]*/ - uint32_t dcfgPin; /*!< [0x040-0x043]*/ - uint32_t dcfgDflt; /*!< [0x044-0x047]*/ - uint32_t dapVendorUsage; /*!< [0x048-0x04b]*/ - uint32_t resv1; /*!< [0x04c-0x04f]*/ - uint32_t secureBootCfg; /*!< [0x050-0x053]*/ - uint32_t rokthUsage; /*!< [0x054-0x057]*/ - uint32_t resv4; /*!< [0x058-0x05b]*/ - uint32_t resv5; /*!< [0x05c-0x05f]*/ - uint32_t rotkh[12]; /*!< [0x060-0x08f]*/ - - struct - { - uint32_t npx_w0; - uint32_t npx_w1; - } princeSr[4]; /*!< [0x090-0x0af]*/ - - struct - { - uint32_t ipedStartAddr; - uint32_t ipedEndAddr; - } ipedRegions[8]; /*!< [0x0b0-0x11f]*/ - - uint32_t rec_img_exit0; - uint32_t rec_img_exit1; - - uint32_t resv6[10]; - - struct - { - uint32_t set0; - uint32_t clr0; - } quickSetGpio[6]; /*!< [0x120-0x14f]*/ - - uint32_t resv7[4]; /*!< [0x150-0x15f]*/ - uint32_t cust_key_blob[12]; /*!< [0x160-0x18f]*/ - - uint32_t resv8[23]; /*!< [0x190-0x1eb]*/ - uint32_t cmpaCrc; /*!< [0x1ec-0x1ef]*/ - uint32_t cmpaCmac[4]; /*!< [0x1f0-0x1ff]*/ - -} cmpa_cfg_info_t; - -typedef struct -{ - uint32_t header; - uint8_t reserved[4]; -} cmpa_key_store_header_t; - -#define FFR_SYSTEM_SPEED_CODE_MASK (0x3U) -#define FFR_SYSTEM_SPEED_CODE_SHIFT (0U) -#define FFR_SYSTEM_SPEED_CODE_FRO12MHZ_12MHZ (0x0U) -#define FFR_SYSTEM_SPEED_CODE_FROHF96MHZ_24MHZ (0x1U) -#define FFR_SYSTEM_SPEED_CODE_FROHF96MHZ_48MHZ (0x2U) -#define FFR_SYSTEM_SPEED_CODE_FROHF96MHZ_96MHZ (0x3U) - -#define FFR_USBCFG_USBSPEED_HS (0x0U) -#define FFR_USBCFG_USBSPEED_FS (0x1U) -#define FFR_USBCFG_USBSPEED_NO (0x2U) - -#define FFR_MCAN_BAUDRATE_MASK (0xF0000U) -#define FFR_MCAN_BAUDRATE_SHIFT (16U) - -#define FFR_PERIPHERALCFG_PERI_MASK (0x7FFFFFFFU) -#define FFR_PERIPHERALCFG_PERI_SHIFT (0U) -#define FFR_PERIPHERALCFG_COREEN_MASK (0x10000000U) -#define FFR_PERIPHERALCFG_COREEN_SHIFT (31U) - -#define FFR_PUF_SRAM_CONFIG_MASK (0x3FFFF07) -#define FFR_PUF_SRAM_CONFIG_MASK_SHIFT (0U) -#define FFR_PUF_SRAM_VALID_MASK (0x1U) -#define FFR_PUF_SRAM_VALID_SHIFT (0U) -#define FFR_PUF_SRAM_MODE_MASK (0x2U) -#define FFR_PUF_SRAM_MODE_SHIFT (1U) -#define FFR_PUF_SRAM_CKGATING_MASK (0x4U) -#define FFR_PUF_SRAM_CKGATING_SHIFT (2) -#define FFR_PUF_SRAM_SMB_MASK (0x300U) -#define FFR_PUF_SRAM_SMB_SHIFT (8U) -#define FFR_PUF_SRAM_RM_MASK (0x1C00U) -#define FFR_PUF_SRAM_RM_SHIFT (10U) -#define FFR_PUF_SRAM_WM_MASK (0xE000U) -#define FFR_PUF_SRAM_WM_SHIFT (13U) -#define FFR_PUF_SRAM_WRME_MASK (0x10000U) -#define FFR_PUF_SRAM_WRME_SHIFT (16U) -#define FFR_PUF_SRAM_RAEN_MASK (0x20000U) -#define FFR_PUF_SRAM_RAEN_SHIFT (17U) -#define FFR_PUF_SRAM_RAM_MASK (0x3C0000U) -#define FFR_PUF_SRAM_RAM_SHIFT (18U) -#define FFR_PUF_SRAM_WAEN_MASK (0x400000U) -#define FFR_PUF_SRAM_WAEN_SHIFT (22U) -#define FFR_PUF_SRAM_WAM_MASK (0x1800000U) -#define FFR_PUF_SRAM_WAM_SHIFT (23U) -#define FFR_PUF_SRAM_STBP_MASK (0x2000000U) -#define FFR_PUF_SRAM_STBP_SHIFT (25U) - -typedef struct -{ - uint32_t fro32kCfg; /*!< [0x000-0x003]*/ - uint32_t puf_cfg; /*!< [0x004-0x007]*/ - uint32_t bod; /*!< [0x008-0x00b]*/ - uint32_t trim; /*!< [0x00c-0x00f]*/ - uint32_t deviceID; /*!< [0x010-0x03f]*/ - uint32_t peripheralCfg; /*!< [0x014-0x017]*/ - uint32_t dcdPowerProFileLOW[2]; /*!< [0x018-0x01f]*/ - uint32_t deviceType; /*!< [0x020-0x023]*/ - uint32_t ldo_ao; /*!< [0x024-0x027]*/ - uint32_t gdetDelayCfg; /*!< [0x028-0x02b]*/ - uint32_t gdetMargin; /*!< [0x02c-0x02f]*/ - uint32_t gdetTrim1; /*!< [0x030-0x033]*/ - uint32_t gdetEanble1; /*!< [0x034-0x037]*/ - uint32_t gdetCtrl1; /*!< [0x038-0x03b]*/ - uint32_t gdetUpdateTimer; /*!< [0x03c-0x03f]*/ - uint32_t GpoDataChecksum[4]; /*!< [0x040-0x04f]*/ - uint32_t finalTestBatchId[4]; /*!< [0x050-0x05f]*/ - uint32_t ecidBackup[4]; /*!< [0x060-0x06f]*/ - uint32_t uuid[4]; /*!< [0x070-0x07f]*/ - uint32_t reserved1[7]; /*!< [0x080-0x09b]*/ - struct - { - uint8_t xo32mReadyTimeoutInMs; - uint8_t usbSpeed; - uint8_t reserved[2]; - } usbCfg; /*!< [0x09c-0x09f]*/ - uint32_t reserved2[80]; /*!< [0x0a0-0x1df]*/ - uint8_t cmac[16]; /*!< [0x1e0-0x1ef]*/ - uint32_t pageChecksum[4]; /*!< [0x1f0-0x1ff]*/ -} nmpa_cfg_info_t; - -typedef struct -{ - uint8_t reserved[1][FLASH_FFR_MAX_PAGE_SIZE]; -} ffr_key_store_t; - -typedef enum -{ - kFFR_KeyTypeSbkek = 0x00U, - kFFR_KeyTypeUser = 0x01U, - kFFR_KeyTypeUds = 0x02U, - kFFR_KeyTypePrinceRegion0 = 0x03U, - kFFR_KeyTypePrinceRegion1 = 0x04U, - kFFR_KeyTypePrinceRegion2 = 0x05U, -} ffr_key_type_t; - -typedef enum -{ - kFFR_BankTypeBank0_CFPA0 = 0x00u, - kFFR_BankTypeBank0_CFPA1 = 0x01u, - kFFR_BankTypeBank0_CMPA = 0x02U, - kFFR_BankTypeBank0_NMPA = 0x03U, - kFFR_BankTypeBank0_SBL = 0x04U, - -} ffr_bank_type_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name FFR APIs - * @{ - */ - -/*! - * @brief Initializes the global FFR properties structure members. - * - * @param config A pointer to the storage for the driver runtime state. - * - * @retval #kStatus_FLASH_Success API was executed successfully. - */ -status_t FFR_Init(flash_config_t *config); - -/*! - * @brief Enable firewall for all flash banks. - * - * CFPA, CMPA, and NMPA flash areas region will be locked, After this function executed; - * Unless the board is reset again. - * - * @param config A pointer to the storage for the driver runtime state. - * - * @retval #kStatus_FLASH_Success An invalid argument is provided. - */ -status_t FFR_Lock(flash_config_t *config); - -/*! - * @brief APIs to access CFPA pages - * - * This routine will erase CFPA and program the CFPA page with passed data. - * - * @param config A pointer to the storage for the driver runtime state. - * @param page_data A pointer to the source buffer of data that is to be programmed - * into the CFPA. - * @param valid_len The length, given in bytes, to be programmed. - * - * @retval #kStatus_FLASH_Success The desire page-data were programed successfully into CFPA. - * @retval #kStatus_FLASH_SizeError Error size - * @retval #kStatus_FLASH_ReadHidingAreaDisallowed Flash hiding read is not allowed - * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with the specified baseline - * @retval #kStatus_FLASH_ModifyProtectedAreaDisallowed Flash firewall page locked erase and program are not allowed - * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_AddressError Address is out of range. - * @retval #kStatus_FLASH_FfrBankIsLocked The CFPA was locked. - * @retval #kStatus_FLASH_OutOfDateCfpaPage It is not newest CFPA page. - * @retval #kStatus_FLASH_CommandFailure access error. - * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported - * @retval #kStatus_FLASH_EccError A correctable or uncorrectable error during command execution. - * @retval #kStatus_FLASH_RegulationLoss A loss of regulation during read. - */ -status_t FFR_InfieldPageWrite(flash_config_t *config, uint8_t *page_data, uint32_t valid_len); - -/*! - * @brief APIs to access CFPA pages - * - * Generic read function, used by customer to read data stored in 'Customer In-field Page'. - * - * @param config A pointer to the storage for the driver runtime state. - * @param pData A pointer to the dest buffer of data that is to be read from 'Customer In-field Page'. - * @param offset An offset from the 'Customer In-field Page' start address. - * @param len The length, given in bytes, to be read. - * - * @retval #kStatus_FLASH_Success Get data from 'Customer In-field Page'. - * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_AddressError Address is out of range. - * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with the specified baseline. - * @retval #kStatus_FLASH_ReadHidingAreaDisallowed Flash hiding read is not allowed - * @retval #kStatus_FLASH_CommandFailure access error. - * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported - * @retval #kStatus_FLASH_EccError A correctable or uncorrectable error during command execution. - * @retval #kStatus_FLASH_RegulationLoss A loss of regulation during read. - */ -status_t FFR_GetCustomerInfieldData(flash_config_t *config, uint8_t *pData, uint32_t offset, uint32_t len); - -/*! - * @brief APIs to access CMPA pages - * - * This routine will erase "customer factory page" and program the page with passed data. - * If 'seal_part' parameter is TRUE then the routine will compute SHA256 hash of - * the page contents and then programs the pages. - * 1.During development customer code uses this API with 'seal_part' set to FALSE. - * 2.During manufacturing this parameter should be set to TRUE to seal the part - * from further modifications - * 3.This routine checks if the page is sealed or not. A page is said to be sealed if - * the SHA256 value in the page has non-zero value. On boot ROM locks the firewall for - * the region if hash is programmed anyways. So, write/erase commands will fail eventually. - * - * @param config A pointer to the storage for the driver runtime state. - * @param page_data A pointer to the source buffer of data that is to be programmed - * into the "customer factory page". - * @param seal_part Set fasle for During development customer code. - * - * @retval #kStatus_FLASH_Success The desire page-data were programed successfully into CMPA. - * @retval #kStatus_FLASH_InvalidArgument Parameter is not aligned with the specified baseline. - * @retval #kStatus_FTFx_AddressError Address is out of range. - * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with the specified baseline. - * @retval #kStatus_FLASH_EraseKeyError API erase key is invalid. - * @retval #kStatus_FLASH_ModifyProtectedAreaDisallowed Flash firewall page locked erase and program are not allowed - * @retval #kStatus_Fail Generic status for Fail. - * @retval #kStatus_FLASH_CommandFailure access error. - * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported - * @retval #kStatus_FLASH_EccError A correctable or uncorrectable error during command execution. - * @retval #kStatus_FLASH_RegulationLoss A loss of regulation during read. - */ -status_t FFR_CustFactoryPageWrite(flash_config_t *config, uint8_t *page_data, bool seal_part); - -/*! - * @brief APIs to access CMPA page - * - * Read data stored in 'Customer Factory CFG Page'. - * - * @param config A pointer to the storage for the driver runtime state. - * @param pData A pointer to the dest buffer of data that is to be read - * from the Customer Factory CFG Page. - * @param offset Address offset relative to the CMPA area. - * @param len The length, given in bytes to be read. - * - * @retval #kStatus_FLASH_Success Get data from 'Customer Factory CFG Page'. - * @retval #kStatus_FLASH_InvalidArgument Parameter is not aligned with the specified baseline. - * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with the specified baseline. - * @retval #kStatus_FTFx_AddressError Address is out of range. - * @retval #kStatus_FLASH_CommandFailure access error. - * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported - * @retval #kStatus_FLASH_EccError A correctable or uncorrectable error during command execution. - * @retval #kStatus_FLASH_RegulationLoss A loss of regulation during read. - * @retval #kStatus_FLASH_ReadHidingAreaDisallowed Flash hiding read is not allowed - */ -status_t FFR_GetCustomerData(flash_config_t *config, uint8_t *pData, uint32_t offset, uint32_t len); - -/*! - * @brief The API is used for getting the customer key store data from the customer key store region(0x3e400 �C - * 0x3e600), and the API should be called after the FLASH_Init and FFR_Init. - * - * @param config A pointer to the storage for the driver runtime state. - * @param pData A pointer to the dest buffer of data that is to be read - * from the Customer Factory CFG Page. - * @param offset Address offset relative to the CMPA area. - * @param len The length, given in bytes to be read. - * - * @retval #kStatus_FLASH_Success Get data from 'Customer Factory CFG Page'. - * @retval #kStatus_FLASH_InvalidArgument Parameter is not aligned with the specified baseline. - * @retval #kStatus_FTFx_AddressError Address is out of range. - * @retval #kStatus_FLASH_AddressError Address is out of range - * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with the specified baseline. - * @retval #kStatus_FLASH_ReadHidingAreaDisallowed Flash hiding read is not allowed - * @retval #kStatus_FLASH_CommandFailure access error. - * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported - * @retval #kStatus_FLASH_EccError A correctable or uncorrectable error during command execution. - * @retval #kStatus_FLASH_RegulationLoss A loss of regulation during read. - */ -status_t FFR_GetCustKeystoreData(flash_config_t *config, uint8_t *pData, uint32_t offset, uint32_t len); - -/*! - * @brief This routine writes the 3 pages allocated for Key store data. - * - * @param config A pointer to the storage for the driver runtime state. - * @param pKeyStore A pointer to the source buffer of data that is to be programmed - * into the "Key store". - * - * @retval #kStatus_FLASH_Success Get data from 'Customer Factory CFG Page'. - * @retval #kStatus_FLASH_InvalidArgument Parameter is not aligned with the specified baseline. - * @retval #kStatus_FLASH_CommandFailure access error. - * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported - * @retval #kStatus_FLASH_EccError A correctable or uncorrectable error during command execution. - * @retval #kStatus_FLASH_RegulationLoss A loss of regulation during read. - * @retval #kStatus_FLASH_SealedFfrRegion The FFR region is sealed. - * @retval #kStatus_FLASH_FfrBankIsLocked The FFR bank region is locked. - * @retval #kStatus_FLASH_AddressError Address is out of range - * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with the specified baseline. - * @retval #kStatus_FLASH_ModifyProtectedAreaDisallowed Flash firewall page locked erase and program are not allowed - */ -status_t FFR_CustKeystoreWrite(flash_config_t *config, ffr_key_store_t *pKeyStore); - -/*! - * @brief APIs to access CMPA page - * - * 1.SW should use this API routine to get the UUID of the chip. - * 2.Calling routine should pass a pointer to buffer which can hold 128-bit value. - * - * @retval #kStatus_FLASH_Success Get data from 'Customer Factory CFG Page'. - * @retval #kStatus_FLASH_InvalidArgument Parameter is not aligned with the specified baseline. - * @retval #kStatus_FLASH_ReadHidingAreaDisallowed Flash hiding read is not allowed - * @retval #kStatus_FLASH_CommandFailure Run-time error during command execution. - * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported - * @retval #kStatus_FLASH_RegulationLoss A loss of regulation during read. - */ -status_t FFR_GetUUID(flash_config_t *config, uint8_t *uuid); - -/*@}*/ - -#ifdef __cplusplus -} -#endif - -/*@}*/ - -#endif /*! FSL_FLASH_FFR_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/flash/fsl_flexspi_nor_flash.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/flash/fsl_flexspi_nor_flash.h deleted file mode 100644 index cfa77a82601..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/flash/fsl_flexspi_nor_flash.h +++ /dev/null @@ -1,721 +0,0 @@ -/* - * Copyright 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - * - */ - -#ifndef FSL_FLEXSPI_NOR_FLASH_H__ -#define FSL_FLEXSPI_NOR_FLASH_H__ - -#include "fsl_common.h" -/*! - * @addtogroup flexspi_nor_flash_driver - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -#define FLEXSPI_FEATURE_HAS_PARALLEL_MODE 0 /*!< FLEXSPI Feature related definitions */ - -#define FSL_ROM_FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) \ - (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | \ - FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1)) - -#define CMD_SDR 0x01U -#define CMD_DDR 0x21U -#define RADDR_SDR 0x02U -#define RADDR_DDR 0x22U -#define CADDR_SDR 0x03U -#define CADDR_DDR 0x23U -#define MODE1_SDR 0x04U -#define MODE1_DDR 0x24U -#define MODE2_SDR 0x05U -#define MODE2_DDR 0x25U -#define MODE4_SDR 0x06U -#define MODE4_DDR 0x26U -#define MODE8_SDR 0x07U -#define MODE8_DDR 0x27U -#define WRITE_SDR 0x08U -#define WRITE_DDR 0x28U -#define READ_SDR 0x09U -#define READ_DDR 0x29U -#define LEARN_SDR 0x0AU -#define LEARN_DDR 0x2AU -#define DATSZ_SDR 0x0BU -#define DATSZ_DDR 0x2BU -#define DUMMY_SDR 0x0CU -#define DUMMY_DDR 0x2CU -#define DUMMY_RWDS_SDR 0x0DU -#define DUMMY_RWDS_DDR 0x2DU -#define JMP_ON_CS 0x1FU -#define FLEXSPI_STOP 0U - -#define FLEXSPI_1PAD 0U -#define FLEXSPI_2PAD 1U -#define FLEXSPI_4PAD 2U -#define FLEXSPI_8PAD 3U - -/*! - * @brief NOR LUT sequence index used for default LUT assignment - * NOTE: - * The will take effect if the lut sequences are not customized. - */ -#define NOR_CMD_LUT_SEQ_IDX_READ 0U /*!< READ LUT sequence id in lookupTable stored in config block */ -#define NOR_CMD_LUT_SEQ_IDX_READSTATUS 1U /*!< Read Status LUT sequence id in lookupTable stored in config block */ -#define NOR_CMD_LUT_SEQ_IDX_READSTATUS_XPI \ - 2U /*!< Read status DPI/QPI/OPI sequence id in lookupTable stored in config block */ -#define NOR_CMD_LUT_SEQ_IDX_WRITEENABLE 3U /*!< Write Enable sequence id in lookupTable stored in config block */ -#define NOR_CMD_LUT_SEQ_IDX_WRITEENABLE_XPI \ - 4U /*!< Write Enable DPI/QPI/OPI sequence id in lookupTable stored in config block */ -#define NOR_CMD_LUT_SEQ_IDX_ERASESECTOR 5U /*!< Erase Sector sequence id in lookupTable stored in config block */ -#define NOR_CMD_LUT_SEQ_IDX_READID 7U -#define NOR_CMD_LUT_SEQ_IDX_ERASEBLOCK 8U /*!< Erase Block sequence id in lookupTable stored in config block */ -#define NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM 9U /*!< Program sequence id in lookupTable stored in config block */ -#define NOR_CMD_LUT_SEQ_IDX_CHIPERASE 11U /*!< Chip Erase sequence in lookupTable id stored in config block */ -#define NOR_CMD_LUT_SEQ_IDX_READ_SFDP 13U /*!< Read SFDP sequence in lookupTable id stored in config block */ -#define NOR_CMD_LUT_SEQ_IDX_RESTORE_NOCMD \ - 14U /*!< Restore 0-4-4/0-8-8 mode sequence id in lookupTable stored in config block */ -#define NOR_CMD_LUT_SEQ_IDX_EXIT_NOCMD \ - 15U /*!< Exit 0-4-4/0-8-8 mode sequence id in lookupTable stored in config blobk */ - -/*! @brief FLEXSPI status group numbers. */ -enum _flexspi_status_groups -{ - kStatusROMGroup_FLEXSPI = 60, /*!< Group number for ROM FLEXSPI status codes. */ - kStatusROMGroup_FLEXSPINOR = 201, /*!< ROM FLEXSPI NOR status group number.*/ -}; - -/*! @brief FLEXSPI NOR status */ -enum _flexspi_nor_status -{ - kStatus_FLEXSPINOR_ProgramFail = - MAKE_STATUS(kStatusROMGroup_FLEXSPINOR, 0), /*!< Status for Page programming failure */ - kStatus_FLEXSPINOR_EraseSectorFail = - MAKE_STATUS(kStatusROMGroup_FLEXSPINOR, 1), /*!< Status for Sector Erase failure */ - kStatus_FLEXSPINOR_EraseAllFail = MAKE_STATUS(kStatusROMGroup_FLEXSPINOR, 2), /*!< Status for Chip Erase failure */ - kStatus_FLEXSPINOR_WaitTimeout = MAKE_STATUS(kStatusROMGroup_FLEXSPINOR, 3), /*!< Status for timeout */ - kStatus_FlexSPINOR_NotSupported = MAKE_STATUS(kStatusROMGroup_FLEXSPINOR, 4), /* Status for PageSize overflow */ - kStatus_FlexSPINOR_WriteAlignmentError = - MAKE_STATUS(kStatusROMGroup_FLEXSPINOR, 5), /*!< Status for Alignement error */ - kStatus_FlexSPINOR_CommandFailure = - MAKE_STATUS(kStatusROMGroup_FLEXSPINOR, 6), /*!< Status for Erase/Program Verify Error */ - kStatus_FlexSPINOR_SFDP_NotFound = MAKE_STATUS(kStatusROMGroup_FLEXSPINOR, 7), /*!< Status for SFDP read failure */ - kStatus_FLEXSPINOR_Unsupported_SFDP_Version = - MAKE_STATUS(kStatusROMGroup_FLEXSPINOR, 8), /*!< Status for Unrecognized SFDP version */ - kStatus_FLEXSPINOR_Flash_NotFound = - MAKE_STATUS(kStatusROMGroup_FLEXSPINOR, 9), /*!< Status for Flash detection failure */ - kStatus_FLEXSPINOR_DTRRead_DummyProbeFailed = - MAKE_STATUS(kStatusROMGroup_FLEXSPINOR, 10), /*!< Status for DDR Read dummy probe failure */ - - kStatus_FLEXSPI_SequenceExecutionTimeout = - MAKE_STATUS(kStatusROMGroup_FLEXSPI, 0), /*!< Status for Sequence Execution timeout */ - kStatus_FLEXSPI_InvalidSequence = MAKE_STATUS(kStatusROMGroup_FLEXSPI, 1), /*!< Status for Invalid Sequence */ - kStatus_FLEXSPI_DeviceTimeout = MAKE_STATUS(kStatusROMGroup_FLEXSPI, 2), /*!< Status for Device timeout */ - -}; - -/*! @brief Configure the device_type of "serial_nor_config_option_t" structure */ -enum -{ - kSerialNorCfgOption_Tag = 0x0cU, - kSerialNorCfgOption_DeviceType_ReadSFDP_SDR = 0U, - kSerialNorCfgOption_DeviceType_ReadSFDP_DDR = 1U, - kSerialNorCfgOption_DeviceType_HyperFLASH1V8 = 2U, - kSerialNorCfgOption_DeviceType_HyperFLASH3V0 = 3U, - kSerialNorCfgOption_DeviceType_MacronixOctalDDR = 4U, - kSerialNorCfgOption_DeviceType_MacronixOctalSDR = 5U, - kSerialNorCfgOption_DeviceType_MicronOctalDDR = 6U, - kSerialNorCfgOption_DeviceType_MicronOctalSDR = 7U, - kSerialNorCfgOption_DeviceType_AdestoOctalDDR = 8U, - kSerialNorCfgOption_DeviceType_AdestoOctalSDR = 9U, -}; - -/*! @brief Configure the quad_mode_setting of "serial_nor_config_option_t" structure */ -enum -{ - kSerialNorQuadMode_NotConfig = 0U, - kSerialNorQuadMode_StatusReg1_Bit6 = 1U, - kSerialNorQuadMode_StatusReg2_Bit1 = 2U, - kSerialNorQuadMode_StatusReg2_Bit7 = 3U, - kSerialNorQuadMode_StatusReg2_Bit1_0x31 = 4U, -}; - -/*! @brief FLEXSPI NOR Octal mode */ -enum -{ - kSerialNorOctaldMode_NoOctalEnableBit = 0U, - kSerialNorOctaldMode_HasOctalEnableBit = 1U, -}; - -/*! @brief miscellaneous mode */ -enum -{ - kSerialNorEnhanceMode_Disabled = 0U, - kSerialNorEnhanceMode_0_4_4_Mode = 1U, - kSerialNorEnhanceMode_0_8_8_Mode = 2U, - kSerialNorEnhanceMode_DataOrderSwapped = 3U, - kSerialNorEnhanceMode_2ndPinMux = 4U, - kSerialNorEnhanceMode_InternalLoopback = 5U, - kSerialNorEnhanceMode_SpiMode = 6U, - kSerialNorEnhanceMode_ExtDqs = 8U, -}; - -/*! @brief FLEXSPI NOR reset logic options */ -enum -{ - kFlashResetLogic_Disabled = 0U, - kFlashResetLogic_ResetPin = 1U, - kFlashResetLogic_JedecHwReset = 2U, -}; - -/*! @brief Configure the flash_connection of "serial_nor_config_option_t" structure */ -enum -{ - kSerialNorConnection_SinglePortA, - kSerialNorConnection_Parallel, - kSerialNorConnection_SinglePortB, - kSerialNorConnection_BothPorts -}; - -/*! @brief - * FLEXSPI ROOT clock soruce related definitions - */ -enum -{ - kFLEXSPIClkSrc_MainClk = 0U, - kFLEXSPIClkSrc_Pll0 = 1U, - kFLEXSPIClkSrc_FroHf = 3U, - kFLEXSPIClkSrc_Pll1 = 5U, -}; - -/*! @brief Restore sequence options - * Configure the restore_sequence of "flash_run_context_t" structure - */ -enum -{ - kRestoreSequence_None = 0U, - kRestoreSequence_HW_Reset = 1U, - kRestoreSequence_QPI_4_0xFFs = 2U, - kRestoreSequence_QPI_Mode_0x00 = 3U, - kRestoreSequence_8QPI_FF = 4U, - kRestoreSequence_Send_F0 = 5U, - kRestoreSequence_Send_66_99 = 6U, - kRestoreSequence_Send_6699_9966 = 7U, - kRestoreSequence_Send_06_FF = 8U, /*!< Adesto EcoXIP */ - kRestoreSequence_QPI_5_0xFFs = 9U, - kRestoreSequence_Send_QPI_8_0xFFs = 10U, - kRestoreSequence_Wakeup_0xAB = 11U, - kRestoreSequence_Wakeup_0xAB_54 = 12U, -}; - -/*! @brief Port mode options*/ -enum -{ - kFlashInstMode_ExtendedSpi = 0x00U, - kFlashInstMode_0_4_4_SDR = 0x01U, - kFlashInstMode_0_4_4_DDR = 0x02U, - kFlashInstMode_DPI_SDR = 0x21U, - kFlashInstMode_DPI_DDR = 0x22U, - kFlashInstMode_QPI_SDR = 0x41U, - kFlashInstMode_QPI_DDR = 0x42U, - kFlashInstMode_OPI_SDR = 0x81U, - kFlashInstMode_OPI_DDR = 0x82U, -}; - -/*! - * @name Support for init FLEXSPI NOR configuration - * @{ - */ -/*! @brief Flash Pad Definitions */ -enum -{ - kSerialFlash_1Pad = 1U, - kSerialFlash_2Pads = 2U, - kSerialFlash_4Pads = 4U, - kSerialFlash_8Pads = 8U, -}; - -/*! @brief FLEXSPI clock configuration type */ -enum -{ - kFLEXSPIClk_SDR, /*!< Clock configure for SDR mode */ - kFLEXSPIClk_DDR, /*!< Clock configurat for DDR mode */ -}; - -/*! @brief FLEXSPI Read Sample Clock Source definition */ -enum _flexspi_read_sample_clk -{ - kFLEXSPIReadSampleClk_LoopbackInternally = 0U, - kFLEXSPIReadSampleClk_LoopbackFromDqsPad = 1U, - kFLEXSPIReadSampleClk_LoopbackFromSckPad = 2U, - kFLEXSPIReadSampleClk_ExternalInputFromDqsPad = 3U, -}; - -/*! @brief Flash Type Definition */ -enum -{ - kFLEXSPIDeviceType_SerialNOR = 1U, /*!< Flash device is Serial NOR */ -}; - -/*! @brief Flash Configuration Command Type */ -enum -{ - kDeviceConfigCmdType_Generic, /*!< Generic command, for example: configure dummy cycles, drive strength, etc */ - kDeviceConfigCmdType_QuadEnable, /*!< Quad Enable command */ - kDeviceConfigCmdType_Spi2Xpi, /*!< Switch from SPI to DPI/QPI/OPI mode */ - kDeviceConfigCmdType_Xpi2Spi, /*!< Switch from DPI/QPI/OPI to SPI mode */ - kDeviceConfigCmdType_Spi2NoCmd, /*!< Switch to 0-4-4/0-8-8 mode */ - kDeviceConfigCmdType_Reset, /*!< Reset device command */ -}; - -/*! @brief Defintions for FLEXSPI Serial Clock Frequency */ -enum _flexspi_serial_clk_freq -{ - kFLEXSPISerialClk_NoChange = 0U, - kFLEXSPISerialClk_30MHz = 1U, - kFLEXSPISerialClk_50MHz = 2U, - kFLEXSPISerialClk_60MHz = 3U, - kFLEXSPISerialClk_75MHz = 4U, - kFLEXSPISerialClk_100MHz = 5U, -}; - -/*! @brief Misc feature bit definitions */ -enum -{ - kFLEXSPIMiscOffset_DiffClkEnable = 0U, /*!< Bit for Differential clock enable */ - kFLEXSPIMiscOffset_Ck2Enable = 1U, /*!< Bit for CK2 enable */ - kFLEXSPIMiscOffset_ParallelEnable = 2U, /*!< Bit for Parallel mode enable */ - kFLEXSPIMiscOffset_WordAddressableEnable = 3U, /*!< Bit for Word Addressable enable */ - kFLEXSPIMiscOffset_SafeConfigFreqEnable = 4U, /*!< Bit for Safe Configuration Frequency enable */ - kFLEXSPIMiscOffset_PadSettingOverrideEnable = 5U, /*!< Bit for Pad setting override enable */ - kFLEXSPIMiscOffset_DdrModeEnable = 6U, /*!< Bit for DDR clock confiuration indication. */ - kFLEXSPIMiscOffset_UseValidTimeForAllFreq = 7U, /*!< Bit for DLLCR settings under all modes */ -}; - -/*@}*/ - -/*! @brief Manufacturer ID */ -enum -{ - kSerialFlash_ISSI_ManufacturerID = 0x9DU, /*!< Manufacturer ID of the ISSI serial flash */ - kSerialFlash_Adesto_ManufacturerID = 0x1FU, /*!< Manufacturer ID of the Adesto Technologies serial flash*/ - kSerialFlash_Winbond_ManufacturerID = 0xEFU, /*!< Manufacturer ID of the Winbond serial flash */ - kSerialFlash_Cypress_ManufacturerID = 0x01U, /*!< Manufacturer ID for Cypress */ -}; - -/*! @brief - * Serial NOR configuration option - */ -typedef struct _serial_nor_config_option -{ - union - { - struct - { - uint32_t max_freq : 4; /*!< Maximum supported Frequency */ - uint32_t misc_mode : 4; /*!< miscellaneous mode */ - uint32_t quad_mode_setting : 4; /*!< Quad mode setting */ - uint32_t cmd_pads : 4; /*!< Command pads */ - uint32_t query_pads : 4; /*!< SFDP read pads */ - uint32_t device_type : 4; /*!< Device type */ - uint32_t option_size : 4; /*!< Option size, in terms of uint32_t, size = (option_size + 1) * 4 */ - uint32_t tag : 4; /*!< Tag, must be 0x0E */ - } B; - uint32_t U; - } option0; - - union - { - struct - { - uint32_t dummy_cycles : 8; /*!< Dummy cycles before read */ - uint32_t status_override : 8; /*!< Override status register value during device mode configuration */ - uint32_t pinmux_group : 4; /*!< The pinmux group selection */ - uint32_t dqs_pinmux_group : 4; /*!< The DQS Pinmux Group Selection */ - uint32_t drive_strength : 4; /*!< The Drive Strength of FLEXSPI Pads */ - uint32_t flash_connection : 4; /*!< Flash connection option: 0 - Single Flash connected to port A, 1 - */ - /*!< Parallel mode, 2 - Single Flash connected to Port B */ - } B; - uint32_t U; - } option1; - -} serial_nor_config_option_t; - -typedef union -{ - struct - { - uint8_t por_mode; - uint8_t current_mode; - uint8_t exit_no_cmd_sequence; - uint8_t restore_sequence; - } B; - uint32_t U; -} flash_run_context_t; - -/*! @brief - * FLEXSPI LUT Sequence structure - */ -typedef struct _lut_sequence -{ - uint8_t seqNum; /*!< Sequence Number, valid number: 1-16 */ - uint8_t seqId; /*!< Sequence Index, valid number: 0-15 */ - uint16_t reserved; -} flexspi_lut_seq_t; - -typedef struct -{ - uint8_t time_100ps; /*!< Data valid time, in terms of 100ps */ - uint8_t delay_cells; /*!< Data valid time, in terms of delay cells */ -} flexspi_dll_time_t; - -/*! @brief - * FLEXSPI Memory Configuration Block - */ -typedef struct _FlexSPIConfig -{ - uint32_t tag; /*!< [0x000-0x003] Tag, fixed value 0x42464346UL */ - uint32_t version; /*!< [0x004-0x007] Version,[31:24] -'V', [23:16] - Major, [15:8] - Minor, [7:0] - bugfix */ - uint32_t reserved0; /*!< [0x008-0x00b] Reserved for future use */ - uint8_t readSampleClkSrc; /*!< [0x00c-0x00c] Read Sample Clock Source, valid value: 0/1/3 */ - uint8_t csHoldTime; /*!< [0x00d-0x00d] CS hold time, default value: 3 */ - uint8_t csSetupTime; /*!< [0x00e-0x00e] CS setup time, default value: 3 */ - uint8_t columnAddressWidth; /*!< [0x00f-0x00f] Column Address with, for HyperBus protocol, it is fixed to 3, For - Serial NAND, need to refer to datasheet */ - uint8_t deviceModeCfgEnable; /*!< [0x010-0x010] Device Mode Configure enable flag, 1 - Enable, 0 - Disable */ - uint8_t deviceModeType; /*!< [0x011-0x011] Specify the configuration command type:Quad Enable, DPI/QPI/OPI switch, - Generic configuration, etc. */ - uint16_t waitTimeCfgCommands; /*!< [0x012-0x013] Wait time for all configuration commands, unit: 100us, Used for - DPI/QPI/OPI switch or reset command */ - flexspi_lut_seq_t deviceModeSeq; /*!< [0x014-0x017] Device mode sequence info, [7:0] - LUT sequence id, [15:8] - LUt - sequence number, [31:16] Reserved */ - uint32_t deviceModeArg; /*!< [0x018-0x01b] Argument/Parameter for device configuration */ - uint8_t configCmdEnable; /*!< [0x01c-0x01c] Configure command Enable Flag, 1 - Enable, 0 - Disable */ - uint8_t configModeType[3]; /*!< [0x01d-0x01f] Configure Mode Type, similar as deviceModeTpe */ - flexspi_lut_seq_t - configCmdSeqs[3]; /*!< [0x020-0x02b] Sequence info for Device Configuration command, similar as deviceModeSeq */ - uint32_t reserved1; /*!< [0x02c-0x02f] Reserved for future use */ - uint32_t configCmdArgs[3]; /*!< [0x030-0x03b] Arguments/Parameters for device Configuration commands */ - uint32_t reserved2; /*!< [0x03c-0x03f] Reserved for future use */ - uint32_t controllerMiscOption; /*!< [0x040-0x043] Controller Misc Options, see Misc feature bit definitions for more - details */ - uint8_t deviceType; /*!< [0x044-0x044] Device Type: See Flash Type Definition for more details */ - uint8_t sflashPadType; /*!< [0x045-0x045] Serial Flash Pad Type: 1 - Single, 2 - Dual, 4 - Quad, 8 - Octal */ - uint8_t serialClkFreq; /*!< [0x046-0x046] Serial Flash Frequencey, device specific definitions, See System Boot - Chapter for more details */ - uint8_t lutCustomSeqEnable; /*!< [0x047-0x047] LUT customization Enable, it is required if the program/erase cannot - be done using 1 LUT sequence, currently, only applicable to HyperFLASH */ - uint32_t reserved3[2]; /*!< [0x048-0x04f] Reserved for future use */ - uint32_t sflashA1Size; /*!< [0x050-0x053] Size of Flash connected to A1 */ - uint32_t sflashA2Size; /*!< [0x054-0x057] Size of Flash connected to A2 */ - uint32_t sflashB1Size; /*!< [0x058-0x05b] Size of Flash connected to B1 */ - uint32_t sflashB2Size; /*!< [0x05c-0x05f] Size of Flash connected to B2 */ - uint32_t csPadSettingOverride; /*!< [0x060-0x063] CS pad setting override value */ - uint32_t sclkPadSettingOverride; /*!< [0x064-0x067] SCK pad setting override value */ - uint32_t dataPadSettingOverride; /*!< [0x068-0x06b] data pad setting override value */ - uint32_t dqsPadSettingOverride; /*!< [0x06c-0x06f] DQS pad setting override value */ - uint32_t timeoutInMs; /*!< [0x070-0x073] Timeout threshold for read status command */ - uint32_t commandInterval; /*!< [0x074-0x077] CS deselect interval between two commands */ - flexspi_dll_time_t dataValidTime[2]; /*!< [0x078-0x07b] CLK edge to data valid time for PORT A and PORT B */ - uint16_t busyOffset; /*!< [0x07c-0x07d] Busy offset, valid value: 0-31 */ - uint16_t busyBitPolarity; /*!< [0x07e-0x07f] Busy flag polarity, 0 - busy flag is 1 when flash device is busy, 1 - - busy flag is 0 when flash device is busy */ - uint32_t lookupTable[64]; /*!< [0x080-0x17f] Lookup table holds Flash command sequences */ - flexspi_lut_seq_t lutCustomSeq[12]; /*!< [0x180-0x1af] Customizable LUT Sequences */ - uint32_t dll0CrVal; /*!> [0x1b0-0x1b3] Customizable DLL0CR setting */ - uint32_t dll1CrVal; /*!> [0x1b4-0x1b7] Customizable DLL1CR setting */ - uint32_t reserved4[2]; /*!< [0x1b8-0x1bf] Reserved for future use */ -} flexspi_mem_config_t; - -/*! @brief - * Serial NOR configuration block - */ -typedef struct _flexspi_nor_config -{ - flexspi_mem_config_t memConfig; /*!< Common memory configuration info via FLEXSPI */ - uint32_t pageSize; /*!< Page size of Serial NOR */ - uint32_t sectorSize; /*!< Sector size of Serial NOR */ - uint8_t ipcmdSerialClkFreq; /*!< Clock frequency for IP command */ - uint8_t isUniformBlockSize; /*!< Sector/Block size is the same */ - uint8_t isDataOrderSwapped; /*!< Data order (D0, D1, D2, D3) is swapped (D1,D0, D3, D2) */ - uint8_t reserved0[1]; /*!< Reserved for future use */ - uint8_t serialNorType; /*!< Serial NOR Flash type: 0/1/2/3 */ - uint8_t needExitNoCmdMode; /*!< Need to exit NoCmd mode before other IP command */ - uint8_t halfClkForNonReadCmd; /*!< Half the Serial Clock for non-read command: true/false */ - uint8_t needRestoreNoCmdMode; /*!< Need to Restore NoCmd mode after IP commmand execution */ - uint32_t blockSize; /*!< Block size */ - uint32_t flashStateCtx; /*!< Flash State Context */ - uint32_t reserve2[10]; /*!< Reserved for future use */ -} flexspi_nor_config_t; - -typedef enum _flexspi_operation -{ - kFLEXSPIOperation_Command, /*!< FLEXSPI operation: Only command, both TX and RX buffer are ignored. */ - kFLEXSPIOperation_Config, /*!< FLEXSPI operation: Configure device mode, the TX FIFO size is fixed in LUT. */ - kFLEXSPIOperation_Write, /*!< FLEXSPI operation: Write, only TX buffer is effective */ - kFLEXSPIOperation_Read, /*!< FLEXSPI operation: Read, only Rx Buffer is effective. */ - kFLEXSPIOperation_End = kFLEXSPIOperation_Read, -} flexspi_operation_t; - -/*! @brief FLEXSPI Transfer Context */ -typedef struct _flexspi_xfer -{ - flexspi_operation_t operation; /*!< FLEXSPI operation */ - uint32_t baseAddress; /*!< FLEXSPI operation base address */ - uint32_t seqId; /*!< Sequence Id */ - uint32_t seqNum; /*!< Sequence Number */ - bool isParallelModeEnable; /*!< Is a parallel transfer */ - uint32_t *txBuffer; /*!< Tx buffer */ - uint32_t txSize; /*!< Tx size in bytes */ - uint32_t *rxBuffer; /*!< Rx buffer */ - uint32_t rxSize; /*!< Rx size in bytes */ -} flexspi_xfer_t; - -/*! @brief - * FLEXSPI Clock Type - */ -typedef enum -{ - kFlexSpiClock_CoreClock, /*!< ARM Core Clock */ - kFlexSpiClock_AhbClock, /*!< AHB clock */ - kFlexSpiClock_SerialRootClock, /*!< Serial Root Clock */ - kFlexSpiClock_IpgClock, /*!< IPG clock */ -} flexspi_clock_type_t; - -#ifdef __cplusplus -extern "C" { -#endif - -uint32_t FLEXSPI_NorFlash_GetVersion(void); -/*! - * @brief Initialize Serial NOR devices via FLEXSPI - * - * This function checks and initializes the FLEXSPI module for the other FLEXSPI APIs. - * - * @param instance storage the instance of FLEXSPI. - * @param config A pointer to the storage for the driver runtime state. - * - * @retval #kStatus_Success Api was executed succesfuly. - * @retval #kStatus_InvalidArgument A invalid argument is provided. - * @retval #kStatus_FLEXSPI_InvalidSequence A invalid Sequence is provided. - * @retval #kStatus_FLEXSPI_SequenceExecutionTimeout Sequence Execution timeout. - * @retval #kStatus_FLEXSPI_DeviceTimeout the device timeout - */ -status_t FLEXSPI_NorFlash_Init(uint32_t instance, flexspi_nor_config_t *config); - -/*! - * @brief Program data to Serial NOR via FLEXSPI. - * - * This function programs the NOR flash memory with the dest address for a given - * flash area as determined by the dst address and the length. - * - * @param instance storage the instance of FLEXSPI. - * @param config A pointer to the storage for the driver runtime state. - * @param dst_addr A pointer to the desired flash memory to be programmed. - * NOTE: - * It is recommended that use page aligned access; - * If the dst_addr is not aligned to page,the driver automatically - * aligns address down with the page address. - * @param src A pointer to the source buffer of data that is to be programmed - * into the NOR flash. - * - * @retval #kStatus_Success Api was executed succesfuly. - * @retval #kStatus_InvalidArgument A invalid argument is provided. - * @retval #kStatus_FLEXSPI_InvalidSequence A invalid Sequence is provided. - * @retval #kStatus_FLEXSPI_SequenceExecutionTimeout Sequence Execution timeout. - * @retval #kStatus_FLEXSPI_DeviceTimeout the device timeout - */ -status_t FLEXSPI_NorFlash_ProgramPage(uint32_t instance, - flexspi_nor_config_t *config, - uint32_t dstAddr, - const uint32_t *src); - -/*! - * @brief Erase all the Serial NOR devices connected on FLEXSPI. - * - * @param instance storage the instance of FLEXSPI. - * @param config A pointer to the storage for the driver runtime state. - * - * @retval #kStatus_Success Api was executed succesfuly. - * @retval #kStatus_InvalidArgument A invalid argument is provided. - * @retval #kStatus_FLEXSPI_InvalidSequence A invalid Sequence is provided. - * @retval #kStatus_FLEXSPI_SequenceExecutionTimeout Sequence Execution timeout. - * @retval #kStatus_FLEXSPI_DeviceTimeout the device timeout - */ -status_t FLEXSPI_NorFlash_EraseAll(uint32_t instance, flexspi_nor_config_t *config); - -/*! - * @brief Erase one sector specified by address - * - * This function erases one of NOR flash sectors based on the desired address. - * - * @param instance storage the index of FLEXSPI. - * @param config A pointer to the storage for the driver runtime state. - * @param address The start address of the desired NOR flash memory to be erased. - * NOTE: - * It is recommended that use sector-aligned access nor device; - * If dstAddr is not aligned with the sector,The driver automatically - * aligns address down with the sector address. - * - * @retval #kStatus_Success Api was executed succesfuly. - * @retval #kStatus_InvalidArgument A invalid argument is provided. - * @retval #kStatus_FLEXSPI_InvalidSequence A invalid Sequence is provided. - * @retval #kStatus_FLEXSPI_SequenceExecutionTimeout Sequence Execution timeout. - * @retval #kStatus_FLEXSPI_DeviceTimeout the device timeout - */ -status_t FLEXSPI_NorFlash_EraseSector(uint32_t instance, flexspi_nor_config_t *config, uint32_t address); - -/*! - * @brief Erase one block specified by address - * - * This function erases one block of NOR flash based on the desired address. - * - * @param instance storage the index of FLEXSPI. - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired NOR flash memory to be erased. - * NOTE: - * It is recommended that use block-aligned access nor device; - * If dstAddr is not aligned with the block,The driver automatically - * aligns address down with the block address. - * - * @retval #kStatus_Success Api was executed succesfuly. - * @retval #kStatus_InvalidArgument A invalid argument is provided. - * @retval #kStatus_FLEXSPI_InvalidSequence A invalid Sequence is provided. - * @retval #kStatus_FLEXSPI_SequenceExecutionTimeout Sequence Execution timeout. - * @retval #kStatus_FLEXSPI_DeviceTimeout the device timeout - */ -status_t FLEXSPI_NorFlash_EraseBlock(uint32_t instance, flexspi_nor_config_t *config, uint32_t address); - -/*! - * @brief Get FLEXSPI NOR Configuration Block based on specified option. - * - * @param instance storage the instance of FLEXSPI. - * @param config A pointer to the storage for the driver runtime state. - * @param option A pointer to the storage Serial NOR Configuration Option Context. - * - * @retval #kStatus_Success Api was executed succesfuly. - * @retval #kStatus_InvalidArgument A invalid argument is provided. - * @retval #kStatus_FLEXSPI_InvalidSequence A invalid Sequence is provided. - * @retval #kStatus_FLEXSPI_SequenceExecutionTimeout Sequence Execution timeout. - * @retval #kStatus_FLEXSPI_DeviceTimeout the device timeout - */ -status_t FLEXSPI_NorFlash_GetConfig(uint32_t instance, - flexspi_nor_config_t *config, - serial_nor_config_option_t *option); - -/*! - * @brief Erase Flash Region specified by address and length - * - * This function erases the appropriate number of flash sectors based on the - * desired start address and length. - * - * @param instance storage the index of FLEXSPI. - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired NOR flash memory to be erased. - * NOTE: - * It is recommended that use sector-aligned access nor device; - * If dstAddr is not aligned with the sector,the driver automatically - * aligns address down with the sector address. - * @param length The length, given in bytes to be erased. - * NOTE: - * It is recommended that use sector-aligned access nor device; - * If length is not aligned with the sector,the driver automatically - * aligns up with the sector. - * @retval #kStatus_Success Api was executed succesfuly. - * @retval #kStatus_InvalidArgument A invalid argument is provided. - * @retval #kStatus_FLEXSPI_InvalidSequence A invalid Sequence is provided. - * @retval #kStatus_FLEXSPI_SequenceExecutionTimeout Sequence Execution timeout. - * @retval #kStatus_FLEXSPI_DeviceTimeout the device timeout - */ -status_t FLEXSPI_NorFlash_Erase(uint32_t instance, flexspi_nor_config_t *config, uint32_t start, uint32_t length); - -/*! - * @brief Read data from Serial NOR via FLEXSPI. - * - * This function read the NOR flash memory with the start address for a given - * flash area as determined by the dst address and the length. - * - * @param instance storage the instance of FLEXSPI. - * @param config A pointer to the storage for the driver runtime state. - * @param dst A pointer to the dest buffer of data that is to be read from the NOR flash. - * NOTE: - * It is recommended that use page aligned access; - * If the dstAddr is not aligned to page,the driver automatically - * aligns address down with the page address. - * @param start The start address of the desired NOR flash memory to be read. - * @param lengthInBytes The length, given in bytes to be read. - * - * @retval #kStatus_Success Api was executed succesfuly. - * @retval #kStatus_InvalidArgument A invalid argument is provided. - * @retval #kStatus_FLEXSPI_InvalidSequence A invalid Sequence is provided. - * @retval #kStatus_FLEXSPI_SequenceExecutionTimeout Sequence Execution timeout. - * @retval #kStatus_FLEXSPI_DeviceTimeout the device timeout - */ -status_t FLEXSPI_NorFlash_Read( - uint32_t instance, flexspi_nor_config_t *config, uint32_t *dst, uint32_t start, uint32_t bytes); - -/*! - * @brief FLEXSPI command - * - * This function is used to perform the command write sequence to the NOR device. - * - * @param instance storage the index of FLEXSPI. - * @param xfer A pointer to the storage FLEXSPI Transfer Context. - * - * @retval kStatus_Success Api was executed succesfuly. - * @retval kStatus_InvalidArgument A invalid argument is provided. - * @retval kStatus_ROM_FLEXSPI_InvalidSequence A invalid Sequence is provided. - * @retval kStatus_ROM_FLEXSPI_SequenceExecutionTimeout Sequence Execution timeout. - */ -status_t FLEXSPI_NorFlash_CommandXfer(uint32_t instance, flexspi_xfer_t *xfer); - -/*! - * @brief Configure FLEXSPI Lookup table - * - * @param instance storage the index of FLEXSPI. - * @param seqIndex storage the sequence Id. - * @param lutBase A pointer to the look-up-table for command sequences. - * @param seqNumber storage sequence number. - * - * @retval kStatus_Success Api was executed succesfuly. - * @retval kStatus_InvalidArgument A invalid argument is provided. - * @retval kStatus_ROM_FLEXSPI_InvalidSequence A invalid Sequence is provided. - * @retval kStatus_ROM_FLEXSPI_SequenceExecutionTimeout Sequence Execution timeout. - */ -status_t FLEXSPI_NorFlash_UpdateLut(uint32_t instance, uint32_t seqIndex, const uint32_t *lutBase, uint32_t seqNumber); - -/*! - * @brief Set the clock source for FLEXSPI NOR - * - * @param clockSource Clock source for FLEXSPI NOR. See to "_flexspi_nor_clock_source". - * - * @retval #kStatus_Success Api was executed succesfuly. - * @retval #kStatus_InvalidArgument A invalid argument is provided. - */ -status_t FLEXSPI_NorFlash_SetClockSource(uint32_t clockSource); - -/*! - * @brief Configure the FlexSPI clock. - * - *The API is used for configuring the FlexSPI clock. - * - * @param instance storage the index of FLEXSPI. - * @param freqOption storage FlexSPIFlexSPI flash serial clock frequency. - * @param sampleClkMode storage the FlexSPI clock configuration type. - * - * @retval #kStatus_Success Api was executed succesfuly. - * @retval #kStatus_InvalidArgument A invalid argument is provided. - */ -void FLEXSPI_NorFlash_ConfigClock(uint32_t instance, uint32_t freqOption, uint32_t sampleClkMode); - -#ifdef __cplusplus -} -#endif - -#endif /*! FSL_FLEXSPI_NOR_FLASH_H__ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/flash/src/fsl_flash.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/flash/src/fsl_flash.c deleted file mode 100644 index edda1a74bac..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/flash/src/fsl_flash.c +++ /dev/null @@ -1,567 +0,0 @@ -/* - * Copyright 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - * - */ - -#include "fsl_flash.h" -#include "fsl_flash_ffr.h" -#include "fsl_flexspi_nor_flash.h" - -/*! @brief Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flashiap" -#endif - -#define BOOTLOADER_API_TREE_POINTER ((bootloader_tree_t *)0x1303fc00U) - -/*! - * @name flash, ffr, flexspi nor flash Structure - * @{ - */ - -typedef union functionCommandOption -{ - uint32_t commandAddr; - status_t (*isFlashAreaReadable)(flash_config_t *config, uint32_t startAddress, uint32_t lengthInBytes); - status_t (*isFlashAreaModifiable)(flash_config_t *config, uint32_t startAddress, uint32_t lengthInBytes); -} function_command_option_t; - -/*! - * @brief Structure of version property. - * - * @ingroup bl_core - */ -typedef union StandardVersion -{ - struct - { - uint8_t bugfix; /*!< bugfix version [7:0] */ - uint8_t minor; /*!< minor version [15:8] */ - uint8_t major; /*!< major version [23:16] */ - char name; /*!< name [31:24] */ - }; - uint32_t version; /*!< combined version numbers */ -} standard_version_t; - -/*! @brief Interface for the flash driver.*/ -typedef struct FlashDriverInterface -{ - standard_version_t version; /*!< flash driver API version number. */ - /* Flash driver */ - status_t (*flash_init)(flash_config_t *config); - status_t (*flash_erase)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes, uint32_t key); - status_t (*flash_program)(flash_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes); - status_t (*flash_verify_erase)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes); - status_t (*flash_verify_program)(flash_config_t *config, - uint32_t start, - uint32_t lengthInBytes, - const uint8_t *expectedData, - uint32_t *failedAddress, - uint32_t *failedData); - status_t (*flash_get_property)(flash_config_t *config, flash_property_tag_t whichProperty, uint32_t *value); - - const uint32_t reserved0[3]; - - /*!< Flash FFR driver */ - status_t (*ffr_init)(flash_config_t *config); - status_t (*ffr_lock)(flash_config_t *config); - status_t (*ffr_cust_factory_page_write)(flash_config_t *config, uint8_t *page_data, bool seal_part); - status_t (*ffr_get_uuid)(flash_config_t *config, uint8_t *uuid); - status_t (*ffr_get_customer_data)(flash_config_t *config, uint8_t *pData, uint32_t offset, uint32_t len); - status_t (*ffr_cust_keystore_write)(flash_config_t *config, ffr_key_store_t *pKeyStore); - status_t reserved1; - status_t reserved2; - status_t (*ffr_infield_page_write)(flash_config_t *config, uint8_t *page_data, uint32_t valid_len); - status_t (*ffr_get_customer_infield_data)(flash_config_t *config, uint8_t *pData, uint32_t offset, uint32_t len); - status_t (*flash_read)(flash_config_t *config, uint32_t start, uint8_t *dest, uint32_t lengthInBytes); - const uint32_t reserved3; - status_t (*flash_get_cust_keystore)(flash_config_t *config, uint8_t *pData, uint32_t offset, uint32_t len); - status_t (*flash_deinit)(flash_config_t *config); -} flash_driver_interface_t; - -/*! @brief FLEXSPI Flash driver API Interface */ -typedef struct -{ - uint32_t version; - status_t (*init)(uint32_t instance, flexspi_nor_config_t *config); - status_t (*page_program)(uint32_t instance, flexspi_nor_config_t *config, uint32_t dstAddr, const uint32_t *src); - status_t (*erase_all)(uint32_t instance, flexspi_nor_config_t *config); - status_t (*erase)(uint32_t instance, flexspi_nor_config_t *config, uint32_t start, uint32_t length); - status_t (*erase_sector)(uint32_t instance, flexspi_nor_config_t *config, uint32_t address); - status_t (*erase_block)(uint32_t instance, flexspi_nor_config_t *config, uint32_t address); - status_t (*get_config)(uint32_t instance, flexspi_nor_config_t *config, serial_nor_config_option_t *option); - status_t (*read)(uint32_t instance, flexspi_nor_config_t *config, uint32_t *dst, uint32_t start, uint32_t bytes); - status_t (*xfer)(uint32_t instance, flexspi_xfer_t *xfer); - status_t (*update_lut)(uint32_t instance, uint32_t seqIndex, const uint32_t *lutBase, uint32_t numberOfSeq); - status_t (*set_clock_source)(uint32_t clockSrc); - void (*config_clock)(uint32_t instance, uint32_t freqOption, uint32_t sampleClkMode); - status_t (*partial_program)( - uint32_t instance, flexspi_nor_config_t *config, uint32_t dstAddr, const uint32_t *src, uint32_t length); -} flexspi_nor_flash_driver_t; - -/* !@brief EFUSE driver API Interface */ -typedef struct -{ - standard_version_t version; - status_t (*init)(void); - status_t (*deinit)(void); - status_t (*read)(uint32_t addr, uint32_t *data); - status_t (*program)(uint32_t addr, uint32_t data); -} efuse_driver_t; - -/*! @}*/ - -/*! - * @brief Root of the bootloader API tree. - * - * An instance of this struct resides in read-only memory in the bootloader. It - * provides a user application access to APIs exported by the bootloader. - * - * @note The order of existing fields must not be changed. - */ -typedef struct BootloaderTree -{ - void (*runBootloader)(void *arg); /*!< Function to start the bootloader executing.*/ - standard_version_t version; /*!< Bootloader version number.*/ - const char *copyright; /*!< Copyright string.*/ - const uint32_t reserved0; /*!< reserved*/ - const flash_driver_interface_t *flashDriver; /*!< Internal Flash driver API.*/ - const uint32_t reserved1[5]; /*!< reserved*/ - const uint32_t nbootDriver; /*!< Please refer to "fsl_nboot.h" */ - const flexspi_nor_flash_driver_t *flexspiNorDriver; /*!< FlexSPI NOR FLASH Driver API.*/ - const efuse_driver_t *efuseDriver; /*!< eFuse driver API */ - const uint32_t memoryInterface; /*!< Please refer to "fsl_mem_interface.h" */ -} bootloader_tree_t; - -/******************************************************************************* - * Code - ******************************************************************************/ - -/******************************************************************************** - * Internal Flash driver API - *******************************************************************************/ -/*! - * @brief Initializes the global flash properties structure members. - * - * This function checks and initializes the Flash module for the other Flash APIs. - */ -status_t FLASH_Init(flash_config_t *config) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->flash_init(config); -} - -/*! - * @brief De-Initializes the global flash properties structure members. - * - * This API De-initializes the FLASH default parameters and related FLASH clock for the FLASH and FMC. - */ -status_t FLASH_Deinit(flash_config_t *config) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->flash_deinit(config); -} - -/*! - * @brief Erases the flash sectors encompassed by parameters passed into function. - * - * This function erases the appropriate number of flash sectors based on the - * desired start address and length. - */ -status_t FLASH_Erase(flash_config_t *config, uint32_t start, uint32_t lengthInBytes, uint32_t key) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->flash_erase(config, start, lengthInBytes, key); -} - -/*! - * @brief Programs flash with data at locations passed in through parameters. - * - * This function programs the flash memory with the desired data for a given - * flash area as determined by the start address and the length. - */ -status_t FLASH_Program(flash_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->flash_program(config, start, src, lengthInBytes); -} - -/*! - * @brief Verifies an erasure of the desired flash area at a specified margin level. - * - * This function checks the appropriate number of flash sectors based on - * the desired start address and length to check whether the flash is erased - * to the specified read margin level. - */ -status_t FLASH_VerifyErase(flash_config_t *config, uint32_t start, uint32_t lengthInBytes) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->flash_verify_erase(config, start, lengthInBytes); -} - -/*! - * @brief Reads flash at locations passed in through parameters. - * - * This function read the flash memory from a given flash area as determined - * by the start address and the length. - */ -status_t FLASH_Read(flash_config_t *config, uint32_t start, uint8_t *dest, uint32_t lengthInBytes) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->flash_read(config, start, dest, lengthInBytes); -} - -/*! - * @brief Verifies programming of the desired flash area at a specified margin level. - * - * This function verifies the data programed in the flash memory using the - * Flash Program Check Command and compares it to the expected data for a given - * flash area as determined by the start address and length. - */ -status_t FLASH_VerifyProgram(flash_config_t *config, - uint32_t start, - uint32_t lengthInBytes, - const uint8_t *expectedData, - uint32_t *failedAddress, - uint32_t *failedData) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->flash_verify_program(config, start, lengthInBytes, expectedData, - failedAddress, failedData); -} - -/*! - * @brief Returns the desired flash property. - */ -status_t FLASH_GetProperty(flash_config_t *config, flash_property_tag_t whichProperty, uint32_t *value) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->flash_get_property(config, whichProperty, value); -} - -status_t FLASH_GetCustKeyStore(flash_config_t *config, uint8_t *pData, uint32_t offset, uint32_t len) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->flash_get_cust_keystore(config, pData, offset, len); -} - -#if defined(BL_FEATURE_HAS_BUS_CRYPTO_ENGINE) && BL_FEATURE_HAS_BUS_CRYPTO_ENGINE -status_t FLASH_ErasePrologue(flash_config_t *config, uint32_t start, uint32_t lengthInBytes, uint32_t key) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->flash_erase_with_checker(config, start, lengthInBytes, key); -} - -status_t FLASH_ProgramPrologue(flash_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->flash_program_with_checker(config, start, src, lengthInBytes); -} - -status_t FLASH_VerifyProgramPrologue(flash_config_t *config, - uint32_t start, - uint32_t lengthInBytes, - const uint8_t *expectedData, - uint32_t *failedAddress, - uint32_t *failedData) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->flash_verify_program_with_checker( - config, start, lengthInBytes, expectedData, failedAddress, failedData); -} - -#endif /* BL_FEATURE_HAS_BUS_CRYPTO_ENGINE*/ - -#if defined(FSL_FEATURE_SYSCON_HAS_FLASH_HIDING) && (FSL_FEATURE_SYSCON_HAS_FLASH_HIDING == 1) -/*! - * @brief Validates the given address range is loaded in the flash hiding region. - */ -status_t FLASH_IsFlashAreaReadable(flash_config_t *config, uint32_t startAddress, uint32_t lengthInBytes) -{ - function_command_option_t runCmdFuncOption; - runCmdFuncOption.commandAddr = 0x130366f9u; - return runCmdFuncOption.isFlashAreaReadable(config, startAddress, lengthInBytes); -} -#endif - -/******************************************************************************** - * fsl iap ffr CODE - *******************************************************************************/ - -/*! - * @brief Initializes the global FFR properties structure members. - */ -status_t FFR_Init(flash_config_t *config) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->ffr_init(config); -} - -/*! - * @brief Enable firewall for all flash banks. - */ -status_t FFR_Lock(flash_config_t *config) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->ffr_lock(config); -} - -/*! - * @brief APIs to access CMPA pages; - * This routine will erase "customer factory page" and program the page with passed data. - */ -status_t FFR_CustFactoryPageWrite(flash_config_t *config, uint8_t *page_data, bool seal_part) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->ffr_cust_factory_page_write(config, page_data, seal_part); -} - -/*! - * @brief See fsl_iap_ffr.h for documentation of this function. - */ -status_t FFR_GetUUID(flash_config_t *config, uint8_t *uuid) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->ffr_get_uuid(config, uuid); -} - -/*! - * @brief APIs to access CMPA pages - * Read data stored in 'Customer Factory CFG Page'. - */ -status_t FFR_GetCustomerData(flash_config_t *config, uint8_t *pData, uint32_t offset, uint32_t len) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->ffr_get_customer_data(config, pData, offset, len); -} - -/*! - * @brief This routine writes the 3 pages allocated for Key store data. - */ -status_t FFR_CustKeystoreWrite(flash_config_t *config, ffr_key_store_t *pKeyStore) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->ffr_cust_keystore_write(config, pKeyStore); -} - -/*! - * @brief APIs to access CFPA pages - * This routine will erase CFPA and program the CFPA page with passed data. - */ -status_t FFR_InfieldPageWrite(flash_config_t *config, uint8_t *page_data, uint32_t valid_len) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->ffr_infield_page_write(config, page_data, valid_len); -} - -/*! - * @brief APIs to access CFPA pages - * Generic read function, used by customer to read data stored in 'Customer In-field Page'. - */ -status_t FFR_GetCustomerInfieldData(flash_config_t *config, uint8_t *pData, uint32_t offset, uint32_t len) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->ffr_get_customer_infield_data(config, pData, offset, len); -} - -/*! - * @brief The API is used for getting the customer key store data from the customer key store region(0x3e400 �C - * 0x3e600), and the API should be called after the FLASH_Init and FFR_Init. - */ -status_t FFR_GetCustKeystoreData(flash_config_t *config, uint8_t *pData, uint32_t offset, uint32_t len) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->flash_get_cust_keystore(config, pData, offset, len); -} - -/******************************************************************************** - * FlexSPI NOR FLASH Driver API - *******************************************************************************/ -/*! - * @brief Initialize Serial NOR devices via FLEXSPI. - */ -status_t FLEXSPI_NorFlash_Init(uint32_t instance, flexspi_nor_config_t *config) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flexspiNorDriver->init(instance, config); -} - -/*! - * @brief Program data to Serial NOR via FlexSPI - */ -status_t FLEXSPI_NorFlash_ProgramPage(uint32_t instance, - flexspi_nor_config_t *config, - uint32_t dstAddr, - const uint32_t *src) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flexspiNorDriver->page_program(instance, config, dstAddr, src); -} - -/*! - * @brief Erase all the Serial NOR devices connected on FlexSPI - */ -status_t FLEXSPI_NorFlash_EraseAll(uint32_t instance, flexspi_nor_config_t *config) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flexspiNorDriver->erase_all(instance, config); -} - -/*! - * @brief Erase Flash Region specified by address and length - */ -status_t FLEXSPI_NorFlash_Erase(uint32_t instance, flexspi_nor_config_t *config, uint32_t start, uint32_t length) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flexspiNorDriver->erase(instance, config, start, length); -} - -/*! - * @brief Erase one sector specified by address - */ -status_t FLEXSPI_NorFlash_EraseSector(uint32_t instance, flexspi_nor_config_t *config, uint32_t address) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flexspiNorDriver->erase_sector(instance, config, address); -} - -/*! - * @brief Erase one block specified by address - */ -status_t FLEXSPI_NorFlash_EraseBlock(uint32_t instance, flexspi_nor_config_t *config, uint32_t address) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flexspiNorDriver->erase_block(instance, config, address); -} - -/*! - * @brief Get FlexSPI NOR driver version - */ -uint32_t FLEXSPI_NorFlash_GetVersion(void) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flexspiNorDriver->version; -} - -/*! - * @brief Get FlexSPI NOR Configuration Block based on specified option - */ -status_t FLEXSPI_NorFlash_GetConfig(uint32_t instance, flexspi_nor_config_t *config, serial_nor_config_option_t *option) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flexspiNorDriver->get_config(instance, config, option); -} - -/*! - * @brief Read data from Serial NOR - */ -status_t FLEXSPI_NorFlash_Read( - uint32_t instance, flexspi_nor_config_t *config, uint32_t *dst, uint32_t start, uint32_t bytes) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flexspiNorDriver->read(instance, config, dst, start, bytes); -} - -/*! - * @brief Perform FlexSPI command - */ -status_t FLEXSPI_NorFlash_CommandXfer(uint32_t instance, flexspi_xfer_t *xfer) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flexspiNorDriver->xfer(instance, xfer); -} - -/*! - * @brief Configure FlexSPI Lookup table - */ -status_t FLEXSPI_NorFlash_UpdateLut(uint32_t instance, uint32_t seqIndex, const uint32_t *lutBase, uint32_t numberOfSeq) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flexspiNorDriver->update_lut(instance, seqIndex, lutBase, numberOfSeq); -} - -/*! - * @brief Set flexspi clock source - */ -status_t FLEXSPI_NorFlash_SetClockSource(uint32_t clockSource) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flexspiNorDriver->set_clock_source(clockSource); -} - -/*! - * @brief config flexspi clock - */ -void FLEXSPI_NorFlash_ConfigClock(uint32_t instance, uint32_t freqOption, uint32_t sampleClkMode) -{ - assert(BOOTLOADER_API_TREE_POINTER); - BOOTLOADER_API_TREE_POINTER->flexspiNorDriver->config_clock(instance, freqOption, sampleClkMode); -} - -/******************************************************************************** - * EFUSE driver API - *******************************************************************************/ - -/*! - * @brief Initialize EFUSE controller. - */ -status_t EFUSE_Init(void) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->efuseDriver->init(); -} - -/*! - * @brief De-Initialize EFUSE controller. - */ -status_t EFUSE_Deinit(void) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->efuseDriver->deinit(); -} - -/*! - * @brief Read Fuse value from eFuse word. - */ -status_t EFUSE_Read(uint32_t addr, uint32_t *data) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->efuseDriver->read(addr, data); -} - -/*! - * @brief Program value to eFuse block. - */ -status_t EFUSE_Program(uint32_t addr, uint32_t data) -{ - assert(BOOTLOADER_API_TREE_POINTER); - status_t status; - bool is_hvd_enabled = false; - - /* Disable SYS_HVD */ - if (0 != (SPC0->ACTIVE_CFG & SPC_ACTIVE_CFG_SYS_HVDE_MASK)) - { - is_hvd_enabled = true; - SPC0->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_SYS_HVDE_MASK; - } - - /* Call ROM API to program efuse */ - status = BOOTLOADER_API_TREE_POINTER->efuseDriver->program(addr, data); - - /* Bring VDD_SYS back to 1.8v */ - SPC0->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_SYSLDO_VDD_LVL_MASK; - - /* Wait for voltage to settle */ - SDK_DelayAtLeastUs(5000U, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY); - - /* Enable SYS_HVD back */ - if (is_hvd_enabled) - { - SPC0->ACTIVE_CFG |= SPC_ACTIVE_CFG_SYS_HVDE_MASK; - } - - return status; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/mem_interface/fsl_mem_interface.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/mem_interface/fsl_mem_interface.h deleted file mode 100644 index 2c810855202..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/mem_interface/fsl_mem_interface.h +++ /dev/null @@ -1,379 +0,0 @@ -/* - * Copyright 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_MEM_INTERFACE_H_ -#define FSL_MEM_INTERFACE_H_ - -#include "fsl_sbloader.h" -#include "fsl_common.h" - -/*! - * @addtogroup memory_interface - * @{ - */ -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @brief Bit mask for device ID. */ -#define DEVICE_ID_MASK (0xffU) -/*! @brief Bit position of device ID. */ -#define DEVICE_ID_SHIFT 0U -/*! @brief Bit mask for group ID. */ -#define GROUP_ID_MASK (0xf00U) -/*! @brief Bit position of group ID. */ -#define GROUP_ID_SHIFT 8U - -/*! @brief Construct a memory ID from a given group ID and device ID. */ -#define MAKE_MEMORYID(group, device) \ - ((((group) << GROUP_ID_SHIFT) & GROUP_ID_MASK) | (((device) << DEVICE_ID_SHIFT) & DEVICE_ID_MASK)) -/*! @brief Get group ID from a given memory ID. */ -#define GROUPID(memoryId) (((memoryId)&GROUP_ID_MASK) >> GROUP_ID_SHIFT) - -/*! @brief Get device ID from a given memory ID. */ -#define DEVICEID(memoryId) (((memoryId)&DEVICE_ID_MASK) >> DEVICE_ID_SHIFT) - -/*! @brief Memory group definition. */ -enum -{ - kMemoryGroup_Internal = 0U, /*!< Memory belongs internal 4G memory region. */ - kMemoryGroup_External = 1U, /*!< Memory belongs external memory region. */ -}; - -/*! @brief Memory device ID definition. */ -enum -{ - /* Memory ID bitfiled definition. - | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | - | Reserved | INT/EXT | Type | Sub-Type | - | | 0: INT | INT: | | - | | 1: EXT | 0: NorFlash0 | 0: Internal Flash(FTFX) | - | | | | 1: QSPI | - | | | | 4: IFR | - | | | | 5: LPC FFR | - | | | | 8: SEMC | - | | | | 9: FlexSPI | - | | | | others: Unused | - | | | | | - | | | 1: ExecuteOnlyRegion | 0: Internal Flash(FTFX) | - | | | | others: Unused | - | | | | | - | | | others: Unused | | - | | | | | - | | | EXT: | | - | | | 0: NandFlash | 0: SEMC | - | | | | 1: FlexSPI | - | | | | others: Unused | - | | | | | - | | | 1: NorFlash/EEPROM | 0: LPSPI | - | | | | 1: LPI2C | - | | | | others: Unused | - | | | | | - | | | 2: SD/SDHC/SDXC/MMC/eMMC | 0: uSDHC SD | - | | | | 1: uSDHC MMC | - | | | | others: Unused | - | | | others: Unused | | - - INT : Internal 4G memory, including internal memory modules, and XIP external memory modules. - EXT : Non-XIP external memory modules. - */ - kMemoryInternal = MAKE_MEMORYID(kMemoryGroup_Internal, 0U), /*!< Internal memory (include all on chip memory) */ - kMemoryQuadSpi0 = MAKE_MEMORYID(kMemoryGroup_Internal, 1U), /*!< Qsuad SPI memory 0 */ - kMemoryIFR0 = - MAKE_MEMORYID(kMemoryGroup_Internal, 4U), /*!< Nonvolatile information register 0. Only used by SB loader. */ - kMemoryFFR = MAKE_MEMORYID(kMemoryGroup_Internal, 5U), /*!< LPCc040hd flash FFR region. */ - kMemorySemcNor = MAKE_MEMORYID(kMemoryGroup_Internal, 8U), /*!< SEMC Nor memory */ - kMemoryFlexSpiNor = MAKE_MEMORYID(kMemoryGroup_Internal, 9U), /*!< Flex SPI Nor memory */ - kMemorySpifiNor = MAKE_MEMORYID(kMemoryGroup_Internal, 0xAU), /*!< SPIFI Nor memory */ - kMemoryFlashExecuteOnly = MAKE_MEMORYID(kMemoryGroup_Internal, 0x10U), /*!< Execute-only region on internal Flash */ - - kMemorySemcNand = MAKE_MEMORYID(kMemoryGroup_External, 0U), /*!< SEMC NAND memory */ - kMemorySpiNand = MAKE_MEMORYID(kMemoryGroup_External, 1U), /*!< SPI NAND memory */ - kMemorySpiNorEeprom = MAKE_MEMORYID(kMemoryGroup_External, 0x10U), /*!< SPI NOR/EEPROM memory */ - kMemoryI2cNorEeprom = MAKE_MEMORYID(kMemoryGroup_External, 0x11U), /*!< I2C NOR/EEPROM memory */ - kMemorySDCard = MAKE_MEMORYID(kMemoryGroup_External, 0x20U), /*!< eSD, SD, SDHC, SDXC memory Card */ - kMemoryMMCCard = MAKE_MEMORYID(kMemoryGroup_External, 0x21U), /*!< MMC, eMMC memory Card */ -}; - -/*! @brief Bootloader status group numbers. - * - * @ingroup bl_core - */ -enum -{ - kStatusGroup_Bootloader = 100, /*!< Bootloader status group number (100). */ - kStatusGroup_MemoryInterface = 102, /*!< Memory interface status group number (102). */ -}; - -/*! @brief Memory interface status codes. */ -enum -{ - kStatusMemoryRangeInvalid = MAKE_STATUS(kStatusGroup_MemoryInterface, 0), - kStatusMemoryReadFailed = MAKE_STATUS(kStatusGroup_MemoryInterface, 1), - kStatusMemoryWriteFailed = MAKE_STATUS(kStatusGroup_MemoryInterface, 2), - kStatusMemoryCumulativeWrite = MAKE_STATUS(kStatusGroup_MemoryInterface, 3), - kStatusMemoryAppOverlapWithExecuteOnlyRegion = MAKE_STATUS(kStatusGroup_MemoryInterface, 4), - kStatusMemoryNotConfigured = MAKE_STATUS(kStatusGroup_MemoryInterface, 5), - kStatusMemoryAlignmentError = MAKE_STATUS(kStatusGroup_MemoryInterface, 6), - kStatusMemoryVerifyFailed = MAKE_STATUS(kStatusGroup_MemoryInterface, 7), - kStatusMemoryWriteProtected = MAKE_STATUS(kStatusGroup_MemoryInterface, 8), - kStatusMemoryAddressError = MAKE_STATUS(kStatusGroup_MemoryInterface, 9), - kStatusMemoryBlankCheckFailed = MAKE_STATUS(kStatusGroup_MemoryInterface, 10), - kStatusMemoryBlankPageReadDisallowed = MAKE_STATUS(kStatusGroup_MemoryInterface, 11), - kStatusMemoryProtectedPageReadDisallowed = MAKE_STATUS(kStatusGroup_MemoryInterface, 12), - kStatusMemoryFfrSpecRegionWriteBroken = MAKE_STATUS(kStatusGroup_MemoryInterface, 13), - kStatusMemoryUnsupportedCommand = MAKE_STATUS(kStatusGroup_MemoryInterface, 14), -}; - -/*! @brief Bootloader status codes. */ -enum -{ - kStatus_UnknownCommand = MAKE_STATUS(kStatusGroup_Bootloader, 0), - kStatus_SecurityViolation = MAKE_STATUS(kStatusGroup_Bootloader, 1), - kStatus_AbortDataPhase = MAKE_STATUS(kStatusGroup_Bootloader, 2), - kStatus_Ping = MAKE_STATUS(kStatusGroup_Bootloader, 3), - kStatus_NoResponse = MAKE_STATUS(kStatusGroup_Bootloader, 4), - kStatus_NoResponseExpected = MAKE_STATUS(kStatusGroup_Bootloader, 5), - kStatus_CommandUnsupported = MAKE_STATUS(kStatusGroup_Bootloader, 6), -}; - -/*! - * @brief Interface to memory operations. - * - * This is the main abstract interface to all memory operations. - */ -typedef struct -{ - status_t (*init)(void); - status_t (*read)(uint32_t address, uint32_t length, uint8_t *buffer, uint32_t memoryId); - status_t (*write)(uint32_t address, uint32_t length, const uint8_t *buffer, uint32_t memoryId); - status_t (*fill)(uint32_t address, uint32_t length, uint32_t pattern); - status_t (*flush)(void); - status_t (*finalize)(void); - status_t (*erase)(uint32_t address, uint32_t length, uint32_t memoryId); -} memory_interface_t; - -/*! @brief Interface to memory operations for one region of memory. */ -typedef struct -{ - status_t (*init)(void); - status_t (*read)(uint32_t address, uint32_t length, uint8_t *buffer); - status_t (*write)(uint32_t address, uint32_t length, const uint8_t *buffer); - status_t (*fill)(uint32_t address, uint32_t length, uint32_t pattern); - status_t (*flush)(void); - status_t (*erase)(uint32_t address, uint32_t length); - status_t (*config)(uint32_t *buffer); - status_t (*erase_all)(void); -} memory_region_interface_t; - -/*! @brief Structure of a memory map entry.*/ -typedef struct -{ - uint32_t startAddress; - uint32_t endAddress; - uint32_t memoryProperty; - uint32_t memoryId; - const memory_region_interface_t *memoryInterface; -} memory_map_entry_t; - -/*! @brief Structure of version property. */ -typedef union StandardVersion -{ - struct - { - uint8_t bugfix; /*!< bugfix version [7:0] */ - uint8_t minor; /*!< minor version [15:8] */ - uint8_t major; /*!< major version [23:16] */ - char name; /*!< name [31:24] */ - }; - uint32_t version; /*!< combined version numbers */ -} standard_version_t; - -/*! @brief API initialization data structure */ -typedef struct kb_api_parameter_struct -{ - uint32_t allocStart; - uint32_t allocSize; -} kp_api_init_param_t; - -#ifdef __cplusplus -extern "C" { -#endif - -/******************************************************************************* - * API - ******************************************************************************/ - -standard_version_t API_Version(void); - -/*! @brief Initialize the IAP API runtime environment */ -status_t API_Init(api_core_context_t *coreCtx, const kp_api_init_param_t *param); - -/*! @brief Deinitialize the IAP API runtime environment */ -status_t API_Deinit(api_core_context_t *coreCtx); - -/*! - * @brief Initialize memory interface. - * - * @retval #kStatus_Fail - * @retval #kStatus_Success - */ -status_t MEM_Init(api_core_context_t *coreCtx); - -/*! - * @brief Configure memory interface - * - * @param config A pointer to the storage for the driver runtime state. - * @param memoryId Indicates the index of the memory type. Please refer to "Memory group definition" - - * @retval #kStatus_Success - * @retval #kStatus_CommandUnsupported - * @retval #kStatus_InvalidArgument - * @retval #kStatus_FLASH_ModifyProtectedAreaDisallowed - * @retval #kStatusMemoryRangeInvalid - * @retval #kStatus_Fail - * @retval #kStatus_OutOfRange - * @retval #kStatus_SPI_BaudrateNotSupport -*/ -status_t MEM_Config(api_core_context_t *coreCtx, uint32_t *config, uint32_t memoryId); - -/*! - * @brief Write memory. - * - * @param address The start address of the desired flash memory to be programmed. - For internal flash the address need to be 512bytes-aligned. - * @param length Number of bytes to be programmed. - * @param buffer A pointer to the source buffer of data that is to be programmed into the flash. - * @param memoryId Indicates the index of the memory type. Please refer to "Memory group definition" - * - * @retval #kStatus_Success - * @retval #kStatus_Fail - * @retval #kStatusMemoryRangeInvalid - * @retval #kStatus_CommandUnsupported - * @retval #kStatus_FLASH_AlignmentError - * @retval #kStatusMemoryCumulativeWrite - * @retval #kStatus_FLASH_InvalidArgument - * @retval #kStatus_FLASH_AddressError - * @retval #kStatus_FLASH_ModifyProtectedAreaDisallowed - * @retval #kStatus_FLASH_CommandFailure - * @retval #kStatus_FLASH_CommandNotSupported - * @retval #kStatus_FLASH_EccError - * @retval #kStatus_FLASH_RegulationLoss - * @retval #kStatus_FLASH_Success - * @retval #kStatus_FLASH_ReadHidingAreaDisallowed - * @retval #kStatus_FLASH_CompareError - * @retval #kStatusMemoryNotConfigured - * @retval #kStatusMemoryVerifyFailed - */ -status_t MEM_Write( - api_core_context_t *coreCtx, uint32_t start, uint32_t lengthInBytes, const uint8_t *buf, uint32_t memoryId); - -/*! - * @brief Fill memory with a word pattern. - * - * @param address The start address of the desired flash memory to be programmed. - * For internal flash the address need to be 512bytes-aligned. - * @param length Number of bytes to be programmed. - * @param pattern The data to be written into the specified memory area. - * - * @retval #kStatus_CommandUnsupported - * @retval #kStatus_Success - * @retval #kStatus_FLASH_AlignmentError - * @retval #kStatusMemoryCumulativeWrite - * @retval #kStatus_Fail - * @retval #kStatus_FLASH_InvalidArgument - * @retval #kStatus_FLASH_AddressError - * @retval #kStatus_FLASH_Success - * @retval #kStatus_FLASH_ModifyProtectedAreaDisallowed - * @retval #kStatus_FLASH_CommandFailure - * @retval #kStatus_FLASH_CommandNotSupported - * @retval #kStatus_FLASH_EccError - * @retval #kStatus_FLASH_RegulationLoss - * @retval #kStatus_FLASH_ReadHidingAreaDisallowed - */ -status_t MEM_Fill( - api_core_context_t *coreCtx, uint32_t start, uint32_t lengthInBytes, uint32_t pattern, uint32_t memoryId); - -/*! - * @brief Flush memory. - * - * @retval #kStatus_Success - * @retval #kStatus_Fail - * @retval #kStatusMemoryCumulativeWrite - * @retval #kStatus_FLASH_InvalidArgument - * @retval #kStatus_FLASH_AlignmentError - * @retval #kStatus_FLASH_Success - * @retval #kStatus_FLASH_AddressError - * @retval #kStatus_FLASH_ModifyProtectedAreaDisallowed - * @retval #kStatus_FLASH_CommandFailure - * @retval #kStatus_FLASH_CommandNotSupported - * @retval #kStatus_FLASH_EccError - * @retval #kStatus_FLASH_RegulationLoss - * @retval #kStatus_FLASH_ReadHidingAreaDisallowed - * @retval #kStatusMemoryVerifyFailed - */ -status_t MEM_Flush(api_core_context_t *coreCtx); - -/*! - * @brief Erase memory. - * - * @param address The start address of the desired flash memory to be erased. - * @param length Number of bytes to be read. - * @param memoryId Indicates the index of the memory type. Please refer to "Memory group definition" - * - * @retval #kStatus_Success - * @retval #kStatusMemoryRangeInvalid - * @retval #kStatusMemoryAddressError - * @retval #kStatus_FLASH_InvalidArgument - * @retval #kStatus_FLASH_AlignmentError - * @retval #kStatus_FLASH_Success - * @retval #kStatus_FLASH_AddressError - * @retval #kStatus_FLASH_EraseKeyError - * @retval #kStatus_FLASH_ModifyProtectedAreaDisallowed - * @retval #kStatus_Fail - * @retval #kStatus_FLASH_CommandFailure - * @retval #kStatus_FLASH_CommandNotSupported - * @retval #kStatus_FLASH_EccError - * @retval #kStatus_FLASH_RegulationLoss - * @retval #kStatusMemoryNotConfigured - * @retval #kStatusMemoryVerifyFailed - - */ -status_t MEM_Erase(api_core_context_t *coreCtx, uint32_t start, uint32_t lengthInBytes, uint32_t memoryId); - -/*! - * @brief Erase entire memory based on memoryId - * - * @param memoryId Indicates the index of the memory type. Please refer to "Memory group definition" - * - * @retval #kStatus_Success - * @retval #kStatus_Fail - * @retval #kStatus_CommandUnsupported - * @retval #kStatus_FLASH_InvalidArgument - * @retval #kStatus_FLASH_AlignmentError - * @retval #kStatus_FLASH_Success - * @retval #kStatus_FLASH_AddressError - * @retval #kStatus_FLASH_EraseKeyError - * @retval #kStatus_FLASH_CommandFailure - * @retval #kStatus_FLASH_CommandNotSupported - * @retval #kStatus_FLASH_EccError - * @retval #kStatus_FLASH_RegulationLoss - * @retval #kStatus_FLASH_ModifyProtectedAreaDisallowed - * @retval #kStatusMemoryVerifyFailed - * @retval #kStatusMemoryNotConfigured - * @retval #kStatus_InvalidArgument - */ -status_t MEM_EraseAll(api_core_context_t *coreCtx, uint32_t memoryId); - -#ifdef __cplusplus -} -#endif - -/** - * @} - */ - -#endif /* FSL_MEM_INTERFACE_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/mem_interface/fsl_sbloader.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/mem_interface/fsl_sbloader.h deleted file mode 100644 index 5d5d7e69000..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/mem_interface/fsl_sbloader.h +++ /dev/null @@ -1,373 +0,0 @@ -/* - * Copyright 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_SBLOADER_H_ -#define FSL_SBLOADER_H_ - -#include "fsl_flash.h" -#include "fsl_flexspi_nor_flash.h" -#include "fsl_sbloader_v3.h" -#include "fsl_common.h" -/*! - * @addtogroup sbloader - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @brief Determines the version of SB loader implementation (1: sb1.0; 2: sb2.0; 3.1: sb3.1) */ -#define SB_FILE_MAJOR_VERSION (3) -#define SB_FILE_MINOR_VERSION (1) - -/*! @brief Bootloader status group numbers */ -#define kStatusGroup_SBLoader (101U) - -/*! @brief Contiguous RAM region count */ -#define RAM_REGION_COUNT (2U) - -/*! @brief Contiguous FLASH region count */ -#define FLASH_REGION_COUNT (1U) - -/*! @brief Contiguous FFR region count */ -#define FFR_REGION_COUNT (1U) - -/*! @brief Memory Interface count */ -#define MEM_INTERFACE_COUNT (4U) - -/*! @brief Contiguous FLEXSPINOR meomry count */ -#define FLEXSPINOR_REGION_COUNT (1U) - -/*! @brief SB loader status codes.*/ -enum -{ - kStatusRomLdrSectionOverrun = MAKE_STATUS(kStatusGroup_SBLoader, 0), - kStatusRomLdrSignature = MAKE_STATUS(kStatusGroup_SBLoader, 1), - kStatusRomLdrSectionLength = MAKE_STATUS(kStatusGroup_SBLoader, 2), - kStatusRomLdrUnencryptedOnly = MAKE_STATUS(kStatusGroup_SBLoader, 3), - kStatusRomLdrEOFReached = MAKE_STATUS(kStatusGroup_SBLoader, 4), - kStatusRomLdrChecksum = MAKE_STATUS(kStatusGroup_SBLoader, 5), - kStatusRomLdrCrc32Error = MAKE_STATUS(kStatusGroup_SBLoader, 6), - kStatusRomLdrUnknownCommand = MAKE_STATUS(kStatusGroup_SBLoader, 7), - kStatusRomLdrIdNotFound = MAKE_STATUS(kStatusGroup_SBLoader, 8), - kStatusRomLdrDataUnderrun = MAKE_STATUS(kStatusGroup_SBLoader, 9), - kStatusRomLdrJumpReturned = MAKE_STATUS(kStatusGroup_SBLoader, 10), - kStatusRomLdrCallFailed = MAKE_STATUS(kStatusGroup_SBLoader, 11), - kStatusRomLdrKeyNotFound = MAKE_STATUS(kStatusGroup_SBLoader, 12), - kStatusRomLdrSecureOnly = MAKE_STATUS(kStatusGroup_SBLoader, 13), - kStatusRomLdrResetReturned = MAKE_STATUS(kStatusGroup_SBLoader, 14), - - kStatusRomLdrRollbackBlocked = MAKE_STATUS(kStatusGroup_SBLoader, 15), - kStatusRomLdrInvalidSectionMacCount = MAKE_STATUS(kStatusGroup_SBLoader, 16), - kStatusRomLdrUnexpectedCommand = MAKE_STATUS(kStatusGroup_SBLoader, 17), - kStatusRomLdrBadSBKEK = MAKE_STATUS(kStatusGroup_SBLoader, 18), - kStatusRomLdrPendingJumpCommand = MAKE_STATUS(kStatusGroup_SBLoader, 19), -}; - -/*! - * @brief Defines the number of bytes in a cipher block (chunk). This is dictated by - * the encryption algorithm. - */ -#define BYTES_PER_CHUNK 16 - -#define SB_SECTION_COUNT_MAX 8 - -/*! @brief Boot image signature in 32-bit little-endian format "PMTS" */ -#define BOOT_SIGNATURE 0x504d5453 - -/*! @brief Boot image signature in 32-bit little-endian format "ltgs" */ -#define BOOT_SIGNATURE2 0x6c746773 - -/*! @brief These define file header flags */ -#define FFLG_DISPLAY_PROGRESS 0x0001 - -/*! @brief These define section header flags */ -#define SFLG_SECTION_BOOTABLE 0x0001 - -/*! @brief These define boot command flags */ -#define CFLG_LAST_TAG 0x01 - -/*! @brief ROM_ERASE_CMD flags */ -#define ROM_ERASE_ALL_MASK 0x01 -#define ROM_ERASE_ALL_UNSECURE_MASK 0x02 - -/*! @brief ROM_JUMP_CMD flags */ -#define ROM_JUMP_SP_MASK 0x02 - -/*! @brief Memory device id shift at sb command flags */ -#define ROM_MEM_DEVICE_ID_SHIFT 0x8 - -/*! @brief Memory device id mask */ -#define ROM_MEM_DEVICE_ID_MASK 0xff00 - -/*! @brief Memory group id shift at sb command flags */ -#define ROM_MEM_GROUP_ID_SHIFT 0x4 - -/*! @brief Memory group id flags mask */ -#define ROM_MEM_GROUP_ID_MASK 0xf0 - -/*! @brief ROM_PROG_CMD flags */ -#define ROM_PROG_8BYTE_MASK 0x01 - -/*! @brief These define the boot command tags */ -#define ROM_NOP_CMD 0x00 -#define ROM_TAG_CMD 0x01 -#define ROM_LOAD_CMD 0x02 -#define ROM_FILL_CMD 0x03 -#define ROM_JUMP_CMD 0x04 -#define ROM_CALL_CMD 0x05 -#define ROM_MODE_CMD 0x06 -#define ROM_ERASE_CMD 0x07 -#define ROM_RESET_CMD 0x08 -#define ROM_MEM_ENABLE_CMD 0x09 -#define ROM_PROG_CMD 0x0a -#define ROM_FW_VER_CHK 0x0b - -#if SB_FILE_MAJOR_VERSION == 2 -#define SBLOADER_CMD_SET_IN_ISP_MODE (SBLOADER_V2_CMD_SET_IN_ISP_MODE) -#define SBLOADER_CMD_SET_IN_REC_MODE (SBLOADER_V2_CMD_SET_IN_REC_MODE) -#elif SB_FILE_MAJOR_VERSION == 3 -#define SBLOADER_CMD_SET_IN_ISP_MODE (SBLOADER_V3_CMD_SET_IN_ISP_MODE) -#define SBLOADER_CMD_SET_IN_REC_MODE (SBLOADER_V3_CMD_SET_IN_REC_MODE) -#endif - -/*! @brief Plugin return codes */ -#define ROM_BOOT_SECTION_ID 1 -#define ROM_BOOT_IMAGE_ID 2 - -enum _fw_version_check_option -{ - kRomLdr_FwCheckOption_SecureVersion = 0x0U, - kRomLdr_FwCheckOption_NonSecureVersion = 0x1U, -}; - -typedef uint8_t chunk_t[BYTES_PER_CHUNK]; - -/*! @brief Boot command definition */ -typedef struct _boot_cmd -{ - uint8_t checksum; /*!< 8-bit checksum over command chunk */ - uint8_t tag; /*!< command tag (identifier) */ - uint16_t flags; /*!< command flags (modifier) */ - uint32_t address; /*!< address argument */ - uint32_t count; /*!< count argument */ - uint32_t data; /*!< data argument */ -} boot_cmd_t; - -/*! @brief Definition for boot image file header chunk 1 */ -typedef struct _boot_hdr1 -{ - uint32_t hash; /*!< last 32-bits of SHA-1 hash */ - uint32_t signature; /*!< must equal "STMP" */ - uint8_t major; /*!< major file format version */ - uint8_t minor; /*!< minor file format version */ - uint16_t fileFlags; /*!< global file flags */ - uint32_t fileChunks; /*!< total chunks in the file */ -} boot_hdr1_t; - -/*! @brief Definition for boot image file header chunk 2 */ -typedef struct _boot_hdr2 -{ - uint32_t bootOffset; /*!< chunk offset to the first boot section */ - uint32_t bootSectID; /*!< section ID of the first boot section */ - uint16_t keyCount; /*!< number of keys in the key dictionary */ - uint16_t keyOffset; /*!< chunk offset to the key dictionary */ - uint16_t hdrChunks; /*!< number of chunks in the header */ - uint16_t sectCount; /*!< number of sections in the image */ -} boot_hdr2_t; - -/*! @brief Provides forward reference to the loader context definition. */ -typedef struct _ldr_Context ldr_Context_t; - -/*! @brief Function pointer definition for all loader action functions. */ -typedef status_t (*pLdrFnc_t)(ldr_Context_t *context); - -/*! @brief Jump command function pointer definition. */ -typedef status_t (*pJumpFnc_t)(uint32_t parameter); - -/*! @brief Call command function pointer definition. */ -typedef status_t (*pCallFnc_t)(uint32_t parameter, uint32_t *func); - -/*! @brief State information for the CRC32 algorithm. */ -typedef struct Crc32Data -{ - uint32_t currentCrc; /*!< Current CRC value. */ - uint32_t byteCountCrc; /*!< Number of bytes processed. */ -} crc32_data_t; - -/*! @brief Loader context definition. */ -struct _ldr_Context -{ - pLdrFnc_t Action; /*!< pointer to loader action function */ - uint32_t fileChunks; /*!< chunks remaining in file */ - uint32_t sectChunks; /*!< chunks remaining in section */ - uint32_t bootSectChunks; /*!< number of chunks we need to complete the boot section */ - uint32_t receivedChunks; /*!< number of chunks we need to complete the boot section */ - uint16_t fileFlags; /*!< file header flags */ - uint16_t keyCount; /*!< number of keys in the key dictionary */ - uint32_t objectID; /*!< ID of the current boot section or image */ - crc32_data_t crc32; /*!< crc calculated over load command payload */ - uint8_t *src; /*!< source buffer address */ - chunk_t initVector; /*!< decryption initialization vector */ - chunk_t dek; /*!< chunk size DEK if the image is encrypted */ - chunk_t scratchPad; /*!< chunk size scratch pad area */ - boot_cmd_t bootCmd; /*!< current boot command */ - uint32_t skipCount; /*!< Number of chunks to skip */ - bool skipToEnd; /*!< true if skipping to end of file */ - - /* extended for SB 2.0*/ - uint32_t nonce[4]; - uint32_t keyBlobBlock; - uint32_t keyBlobBlockCount; - uint8_t *keyBlobBuffer; - uint32_t offsetSignatureBytes; /*!< offset to signagure block header in bytesn */ - uint8_t *headerBuffer; -}; - -typedef struct soc_memory_map_struct -{ - struct - { - uint32_t start; - uint32_t end; - } ramRegions[RAM_REGION_COUNT]; - struct - { - uint32_t start; - uint32_t end; - } flashRegions[FLASH_REGION_COUNT]; - struct - { - uint32_t start; - uint32_t end; - } ffrRegions[FFR_REGION_COUNT]; - struct - { - uint32_t start; - uint32_t end; - } flexspiNorRegions[FLEXSPINOR_REGION_COUNT]; -} soc_mem_regions_t; - -typedef struct arena_context -{ - uint32_t start; - uint32_t end; - uint32_t nextAddr; -} arena_context_t; - -/*! @brief Memory region information table */ -typedef struct mem_region -{ - uint32_t start; - uint32_t end; -} mem_region_t; - -/*! @brief Memory Attribute Structure */ -typedef struct memory_attribute_struct -{ - uint32_t memId; - uint32_t regionCount; - mem_region_t *memRegions; - void *context; -} mem_attribute_t; - -/*! @brief Memory context structure */ -typedef struct memory_context_struct -{ - status_t (*flush)(mem_attribute_t *attr); - mem_attribute_t *attr; -} mem_context_t; - -/*! @brief Memory region interface structure */ -typedef struct api_memory_region_interface -{ - status_t (*init)(mem_attribute_t *attr); -#if ROM_API_HAS_FEATURE_MEM_READ - status_t (*read)(mem_attribute_t *attr, uint32_t addr, uint32_t leth, uint8_t *buf); -#endif - status_t (*write)(mem_attribute_t *attr, uint32_t addr, uint32_t len, const uint8_t *buf); - status_t (*fill)(mem_attribute_t *attr, uint32_t addr, uint32_t len, uint32_t pattern); - status_t (*flush)(mem_attribute_t *attr); - status_t (*erase)(mem_attribute_t *attr, uint32_t addr, uint32_t len); - status_t (*config)(mem_attribute_t *attr, uint32_t *buf); - status_t (*erase_all)(mem_attribute_t *attr); - status_t (*alloc_ctx)(arena_context_t *ctx, mem_attribute_t *attr, void *miscParams); -} api_memory_region_interface_t; - -/*! @brief Memory entry data structure */ -typedef struct memory_map_entry -{ - mem_attribute_t *memoryAttribute; - const api_memory_region_interface_t *memoryInterface; -} api_memory_map_entry_t; - -/*! @brief The API context structure */ -typedef struct api_core_context -{ - soc_mem_regions_t memRegions; - arena_context_t arenaCtx; - flash_config_t flashConfig; - flexspi_nor_config_t flexspinorCfg; - mem_context_t memCtx; - ldr_Context_v3_t *sbloaderCtx; - nboot_context_t *nbootCtx; - uint8_t *sharedBuf; - api_memory_map_entry_t memEntries[MEM_INTERFACE_COUNT]; -} api_core_context_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* _cplusplus */ - -/*! - * @brief Perform the Sbloader runtime environment initialization - * This API is used for initializing the sbloader state machine before calling - * the api_sbloader_pump. This API should be called after the iap_api_init API. - * - * @param ctx Pointer to IAP API core context structure. - * - * @retval #kStatus_Success Api was executed succesfuly. - */ -status_t Sbloader_Init(api_core_context_t *ctx); - -/*! - * @brief Handle the SB data stream - * This API is used for handling the secure binary(SB3.1 format) data stream, - * which is used for image update, lifecycle advancing, etc. - * This API should be called after the iap_api_init and api_sbloader_init APIs. - - * @param ctx Pointer to IAP API core context structure. - * @param data Pointer to source data that is the sb file buffer data. - * @param length The size of the process buffer data. - * - * @retval #kStatus_Success Api was executed succesfuly. - * @retval #kStatus_InvalidArgument An invalid argument is provided. - * @retval #kStatus_Fail API execution failed. - */ -status_t Sbloader_Pump(api_core_context_t *ctx, uint8_t *data, uint32_t length); - -/*! - * @brief Finish the sbloader handling - * The API is used for finalizing the sbloader operations. - * - * @param ctx Pointer to IAP API core context structure. - * - * @retval #kStatus_Success Api was executed succesfuly. - */ -status_t Sbloader_Finalize(api_core_context_t *ctx); - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_SBLOADER_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/mem_interface/fsl_sbloader_v3.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/mem_interface/fsl_sbloader_v3.h deleted file mode 100644 index 795d8f19e75..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/mem_interface/fsl_sbloader_v3.h +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Copyright 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_SBLOADER_V3_H_ -#define FSL_SBLOADER_V3_H_ - -#include - -#include "fsl_nboot_hal.h" - -/*! @addtogroup sbloader */ -/*! @{ */ - -/******************************************************************************* - * Definitions - *****************************************************************************/ - -/*! - * @brief Defines the number of bytes in a cipher block (chunk). This is dictated by - * the encryption algorithm. - */ -#define SB3_BYTES_PER_CHUNK 16 - -typedef uint8_t chunk_v3_t[SB3_BYTES_PER_CHUNK]; - -typedef struct _ldr_buf ldr_buf_t; - -struct _ldr_buf -{ - chunk_v3_t data; - uint32_t fillPosition; -}; - -/*! @brief Provides forward reference to the loader context definition. */ -typedef struct _ldr_Context_v3 ldr_Context_v3_t; - -/*! @brief Function pointer definition for all loader action functions. */ -typedef status_t (*pLdrFnc_v3_t)(ldr_Context_v3_t *content); - -/*! @brief sb3 section definitions */ -/*! @brief section type */ -typedef enum _sectionType -{ - kSectionNone = 0, /*!< end or invalid */ - kSectionDataRange = 1, - kSectionDiffUpdate = 2, - kSectionDDRConfig = 3, - kSectionRegister = 4, -} section_type_t; - -#define SB3_DATA_RANGE_HEADER_FLAGS_ERASE_MASK (0x1u) /*!< bit 0 */ -#define SB3_DATA_RANGE_HEADER_FLAGS_LOAD_MASK (0x2u) /*!< bit 1 */ - -/*! @brief section data range structure */ -typedef struct range_header -{ - uint32_t tag; - uint32_t startAddress; - uint32_t length; - uint32_t cmd; -} sb3_data_range_header_t; - -typedef struct range_header_expansion -{ - uint32_t memoryId; - uint32_t pad0; - uint32_t pad1; - uint32_t pad2; -} sb3_data_range_expansion_t; - -typedef struct copy_memory_expansion -{ - uint32_t destAddr; - uint32_t memoryIdFrom; - uint32_t memoryIdTo; - uint32_t pad; -} sb3_copy_memory_expansion_t; - -typedef struct copy -{ - sb3_data_range_header_t header; - sb3_copy_memory_expansion_t expansion; -} sb3_copy_memory_t; - -typedef struct load_keyblob -{ - uint32_t tag; - uint16_t offset; - uint16_t keyWrapId; - uint32_t length; - uint32_t cmd; -} sb3_load_keyblob_t; - -typedef struct fill_memory_expansion -{ - uint32_t pattern; /*!< word to be used as pattern */ - uint32_t pad0; - uint32_t pad1; - uint32_t pad2; -} sb3_fill_memory_expansion_t; - -typedef struct fill_memory -{ - sb3_data_range_header_t header; - sb3_fill_memory_expansion_t arg; -} sb3_fill_memory_t; - -typedef struct config_memory -{ - uint32_t tag; - uint32_t memoryId; - uint32_t address; /*!< address of config blob */ - uint32_t cmd; -} sb3_config_memory_t; - -enum -{ - kFwVerChk_Id_none = 0, - kFwVerChk_Id_nonsecure = 1, - kFwVerChk_Id_secure = 2, -}; - -typedef struct fw_ver_check -{ - uint32_t tag; - uint32_t version; - uint32_t id; - uint32_t cmd; -} sb3_fw_ver_check_t; - -/*! @brief sb3 DATA section header format */ -typedef struct section_header -{ - uint32_t sectionUid; - uint32_t sectionType; - uint32_t length; - uint32_t _pad; -} sb3_section_header_t; - -/*! @brief loader command enum */ -typedef enum _loader_command_sb3 -{ - kSB3_CmdInvalid = 0, - kSB3_CmdErase = 1, - kSB3_CmdLoad = 2, - kSB3_CmdExecute = 3, - kSB3_CmdCall = 4, - kSB3_CmdProgramFuse = 5, - kSB3_CmdProgramIFR = 6, - kSB3_CmdLoadCmac = 7, - kSB3_CmdCopy = 8, - kSB3_CmdLoadHashLocking = 9, - kSB3_CmdLoadKeyBlob = 10, - kSB3_CmdConfigMem = 11, - kSB3_CmdFillMem = 12, - kSB3_CmdFwVerCheck = 13, -} sb3_cmd_t; - -/*! @brief The all of the allowed command */ -#define SBLOADER_V3_CMD_SET_ALL \ - ((1u << kSB3_CmdErase) | (1u << kSB3_CmdLoad) | (1u << kSB3_CmdExecute) | (1u << kSB3_CmdCall) | \ - (1u << kSB3_CmdProgramFuse) | (1u << kSB3_CmdProgramIFR) | (1u << kSB3_CmdCopy) | (1u << kSB3_CmdLoadKeyBlob) | \ - (1u << kSB3_CmdConfigMem) | (1u << kSB3_CmdFillMem) | (1u << kSB3_CmdFwVerCheck)) -/*! @brief The allowed command set in ISP mode */ -#define SBLOADER_V3_CMD_SET_IN_ISP_MODE \ - ((1u << kSB3_CmdErase) | (1u << kSB3_CmdLoad) | (1u << kSB3_CmdExecute) | (1u << kSB3_CmdProgramFuse) | \ - (1u << kSB3_CmdProgramIFR) | (1u << kSB3_CmdCopy) | (1u << kSB3_CmdLoadKeyBlob) | (1u << kSB3_CmdConfigMem) | \ - (1u << kSB3_CmdFillMem) | (1u << kSB3_CmdFwVerCheck)) -/*! @brief The allowed command set in recovery mode */ -#define SBLOADER_V3_CMD_SET_IN_REC_MODE \ - ((1u << kSB3_CmdErase) | (1u << kSB3_CmdLoad) | (1u << kSB3_CmdExecute) | (1u << kSB3_CmdProgramFuse) | \ - (1u << kSB3_CmdProgramIFR) | (1u << kSB3_CmdCopy) | (1u << kSB3_CmdLoadKeyBlob) | (1u << kSB3_CmdConfigMem) | \ - (1u << kSB3_CmdFillMem) | (1u << kSB3_CmdFwVerCheck)) - -#define SB3_DATA_BUFFER_SIZE_IN_BYTE (MAX(128, NBOOT_KEY_BLOB_SIZE_IN_BYTE_MAX)) - -/*! @brief Memory region definition. */ -typedef struct -{ - uint32_t address; - uint32_t length; -} kb_region_t; - -/*! - * @brief Details of the operation to be performed by the ROM. - * - * The #kRomAuthenticateImage operation requires the entire signed image to be - * available to the application. - */ -typedef enum -{ - kRomAuthenticateImage = 1, /*!< Authenticate a signed image. */ - kRomLoadImage = 2, /*!< Load SB file. */ - kRomOperationCount = 3, -} kb_operation_t; - -typedef struct -{ - uint32_t profile; - uint32_t minBuildNumber; - uint32_t overrideSBBootSectionID; - uint32_t *userSBKEK; - uint32_t regionCount; - const kb_region_t *regions; -} kb_load_sb_t; - -typedef struct -{ - uint32_t profile; - uint32_t minBuildNumber; - uint32_t maxImageLength; - uint32_t *userRHK; -} kb_authenticate_t; - -typedef struct -{ - uint32_t version; /*!< Should be set to #kKbootApiVersion. */ - uint8_t *buffer; /*!< Caller-provided buffer used by Kboot. */ - uint32_t bufferLength; - kb_operation_t op; - union - { - kb_authenticate_t authenticate; /*!< Settings for #kKbootAuthenticate operation.*/ - kb_load_sb_t loadSB; /*!< Settings for #kKbootLoadSB operation.*/ - }; -} kb_options_t; - -/*! @brief Loader context definition. */ -struct _ldr_Context_v3 -{ - pLdrFnc_v3_t Action; /*!< pointer to loader action function */ - uint32_t block_size; /*!< size of each block in bytes */ - uint32_t block_data_size; /*!< data size in bytes (NBOOT_SB3_CHUNK_SIZE_IN_BYTES) */ - uint32_t block_data_total; /*!< data max size in bytes (block_size * data_size */ - uint32_t block_buffer_size; /*!< block0 and block size */ - uint32_t block_buffer_position; - uint8_t block_buffer[MAX(NBOOT_SB3_MANIFEST_MAX_SIZE_IN_BYTES, - NBOOT_SB3_BLOCK_MAX_SIZE_IN_BYTES)]; /*! will be used for both block0 and blockx */ - uint32_t processedBlocks; - - uint8_t data_block_offset; /*! data block offset in a block. */ - bool in_data_block; /*!< in progress of handling a data block within a block */ - uint8_t *data_block; - uint32_t data_block_position; - - bool in_data_section; /*!< in progress of handling a data section within a data block */ - uint32_t data_section_handled; - sb3_section_header_t data_section_header; - - bool in_data_range; /*!< in progress of handling a data range within a data section */ - uint32_t data_range_handled; - uint32_t data_range_gap; - sb3_data_range_header_t data_range_header; - bool has_data_range_expansion; - sb3_data_range_expansion_t data_range_expansion; - - uint32_t commandSet; /*!< support command set during sb file handling */ - - uint32_t data_position; - uint8_t data_buffer[SB3_DATA_BUFFER_SIZE_IN_BYTE]; /*!< temporary data buffer */ - - kb_options_t fromAPI; /*!< options from ROM API */ -}; - -/*! @} */ - -#endif /* FSL_SBLOADER_V3_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/mem_interface/src/fsl_mem_interface.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/mem_interface/src/fsl_mem_interface.c deleted file mode 100644 index b95b82c8a32..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/mem_interface/src/fsl_mem_interface.c +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#include "fsl_flash.h" -#include "fsl_flash_ffr.h" -#include "fsl_flexspi_nor_flash.h" -#include "fsl_mem_interface.h" - -/*! @brief Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.memInterface" -#endif - -/******************************************************************************* - * Definitions - ******************************************************************************/ -#define BOOTLOADER_API_TREE_POINTER ((bootloader_tree_t *)0x1303fc00U) - -/*! @brief IAP API Interface structure */ -typedef struct iap_api_interface_struct -{ - standard_version_t version; /*!< IAP API version number. */ - status_t (*api_init)(api_core_context_t *coreCtx, const kp_api_init_param_t *param); - status_t (*api_deinit)(api_core_context_t *coreCtx); - status_t (*mem_init)(api_core_context_t *ctx); - status_t (*mem_read)(api_core_context_t *ctx, uint32_t addr, uint32_t len, uint8_t *buf, uint32_t memoryId); - status_t (*mem_write)(api_core_context_t *ctx, uint32_t addr, uint32_t len, const uint8_t *buf, uint32_t memoryId); - status_t (*mem_fill)(api_core_context_t *ctx, uint32_t addr, uint32_t len, uint32_t pattern, uint32_t memoryId); - status_t (*mem_flush)(api_core_context_t *ctx); - status_t (*mem_erase)(api_core_context_t *ctx, uint32_t addr, uint32_t len, uint32_t memoryId); - status_t (*mem_config)(api_core_context_t *ctx, uint32_t *buf, uint32_t memoryId); - status_t (*mem_erase_all)(api_core_context_t *ctx, uint32_t memoryId); - status_t (*sbloader_init)(api_core_context_t *ctx); - status_t (*sbloader_pump)(api_core_context_t *ctx, uint8_t *data, uint32_t length); - status_t (*sbloader_finalize)(api_core_context_t *ctx); -} iap_api_interface_t; - -/*! - * @brief Root of the bootloader API tree. - * - * An instance of this struct resides in read-only memory in the bootloader. It - * provides a user application access to APIs exported by the bootloader. - * - * @note The order of existing fields must not be changed. - */ -typedef struct BootloaderTree -{ - void (*runBootloader)(void *arg); /*!< Function to start the bootloader executing.*/ - standard_version_t version; /*!< Bootloader version number.*/ - const char *copyright; /*!< Copyright string.*/ - const uint32_t reserved0; /*!< reserved*/ - const uint32_t flashDriver; /*!< Internal Flash driver API.*/ - const uint32_t reserved1[5]; /*!< reserved*/ - const uint32_t nbootDriver; /*!< Please refer to "fsl_nboot.h" */ - const uint32_t flexspiNorDriver; /*!< FlexSPI NOR FLASH Driver API.*/ - const uint32_t efuseDriver; /*!< eFuse driver API */ - const iap_api_interface_t *iapAPIDriver; /*!< IAP driver API */ -} bootloader_tree_t; -/******************************************************************************* - * API - ******************************************************************************/ - -standard_version_t API_Version(void) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->iapAPIDriver->version; -} - -/*! @brief Initialize the IAP API runtime environment */ -status_t API_Init(api_core_context_t *coreCtx, const kp_api_init_param_t *param) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->iapAPIDriver->api_init(coreCtx, param); -} - -/*! @brief Deinitialize the IAP API runtime environment */ -status_t API_Deinit(api_core_context_t *coreCtx) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->iapAPIDriver->api_deinit(coreCtx); -} - -/*! @brief Intialize the memory interface of the IAP API */ -status_t MEM_Init(api_core_context_t *coreCtx) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->iapAPIDriver->mem_init(coreCtx); -} - -/*! @brief Perform the memory write operation */ -status_t MEM_Write( - api_core_context_t *coreCtx, uint32_t start, uint32_t lengthInBytes, const uint8_t *buf, uint32_t memoryId) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->iapAPIDriver->mem_write(coreCtx, start, lengthInBytes, buf, memoryId); -} - -/*! @brief Perform the Fill operation */ -status_t MEM_Fill( - api_core_context_t *coreCtx, uint32_t start, uint32_t lengthInBytes, uint32_t pattern, uint32_t memoryId) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->iapAPIDriver->mem_fill(coreCtx, start, lengthInBytes, pattern, memoryId); -} - -/*! @brief Perform the Memory erase operation */ -status_t MEM_Erase(api_core_context_t *coreCtx, uint32_t start, uint32_t lengthInBytes, uint32_t memoryId) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->iapAPIDriver->mem_erase(coreCtx, start, lengthInBytes, memoryId); -} -/*! @brief Perform the full Memory erase operation */ -status_t MEM_EraseAll(api_core_context_t *coreCtx, uint32_t memoryId) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->iapAPIDriver->mem_erase_all(coreCtx, memoryId); -} - -/*! @brief Perform the Memory configuration operation */ -status_t MEM_Config(api_core_context_t *coreCtx, uint32_t *config, uint32_t memoryId) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->iapAPIDriver->mem_config(coreCtx, config, memoryId); -} - -/*! @brief Perform the Memory Flush operation */ -status_t MEM_Flush(api_core_context_t *coreCtx) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->iapAPIDriver->mem_flush(coreCtx); -} - -/*! @brief Perform the Sbloader runtime environment initialization */ -status_t Sbloader_Init(api_core_context_t *ctx) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->iapAPIDriver->sbloader_init(ctx); -} - -/*! @brief Handle the SB data stream */ -status_t Sbloader_Pump(api_core_context_t *ctx, uint8_t *data, uint32_t length) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->iapAPIDriver->sbloader_pump(ctx, data, length); -} -/*! @brief Finish the sbloader handling */ -status_t Sbloader_Finalize(api_core_context_t *ctx) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->iapAPIDriver->sbloader_finalize(ctx); -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/nboot/fsl_nboot.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/nboot/fsl_nboot.h deleted file mode 100644 index 94e6cd5429c..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/nboot/fsl_nboot.h +++ /dev/null @@ -1,346 +0,0 @@ -/* - * Copyright 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_NBOOT_H_ -#define FSL_NBOOT_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup nboot - * @{ - */ -/******************************************************************************* - * Definitions - ******************************************************************************/ -/** @def NXPCLHASH_WA_SIZE_MAX - * @brief Define the max workarea size required for this component - */ -#define NXPCLHASH_WA_SIZE_MAX (128U + 64U) -#define NBOOT_ROOT_CERT_COUNT (4U) -#define NXPCLCSS_HASH_RTF_OUTPUT_SIZE_HAL ((size_t)32U) /*/< Size of RTF appendix to hash output buffer, in bytes*/ - -#define NBOOT_KEYINFO_WORDLEN (23U) -#define NBOOT_CONTEXT_BYTELEN (192U + NXPCLHASH_WA_SIZE_MAX) -#define NBOOT_CONTEXT_WORDLEN (NBOOT_CONTEXT_BYTELEN / sizeof(uint32_t)) -typedef int romapi_status_t; - -/*! - * @brief NBOOT type for the root key usage - * - * This type defines the NBOOT root key usage; - * any other value means the root key is not valid (treat as if revoked). - */ -#define kNBOOT_RootKeyUsage_DebugCA_ImageCA_FwCA_ImageKey_FwKey (0x0U) -#define kNBOOT_RootKeyUsage_DebugCA (0x1U) -#define kNBOOT_RootKeyUsage_ImageCA_FwCA (0x2U) -#define kNBOOT_RootKeyUsage_DebugCA_ImageCA_FwCA (0x3U) -#define kNBOOT_RootKeyUsage_ImageKey_FwKey (0x4U) -#define kNBOOT_RootKeyUsage_ImageKey (0x5U) -#define kNBOOT_RootKeyUsage_FwKey (0x6U) -#define kNBOOT_RootKeyUsage_Unused (0x7U) -typedef uint32_t nboot_root_key_usage_t; - -/*! - * @brief NBOOT type for the root key revocation - * - * This type defines the NBOOT root key revocation; - * any other value means the root key is revoked. - */ -#define kNBOOT_RootKey_Enabled (0xAAU) -#define kNBOOT_RootKey_Revoked (0xBBU) -typedef uint32_t nboot_root_key_revocation_t; - -/*! - * @brief NBOOT type specifying the elliptic curve to be used - * - * This type defines the elliptic curve type and length - */ -#define kNBOOT_RootKey_Ecdsa_P256 (0x0000FE01U) -#define kNBOOT_RootKey_Ecdsa_P384 (0x0000FD02U) -typedef uint32_t nboot_root_key_type_and_length_t; - -/*! @brief Enumeration for SoC Lifecycle. */ -#define nboot_lc_nxpBlank (0xFFFF0000U) -#define nboot_lc_nxpFab (0xFFFE0001U) -#define nboot_lc_nxpDev (0xFF0300FCU) -#define nboot_lc_nxpProvisioned (0xFFFC0003U) -#define nboot_lc_oemOpen (0xFFFC0003U) -#define nboot_lc_oemSecureWorld (0xFFF80007U) -#define nboot_lc_oemClosed (0xFFF0000FU) -#define nboot_lc_oemLocked (0xFF3000CFU) -#define nboot_lc_oemFieldReturn (0xFFE0001FU) -#define nboot_lc_nxpFieldReturn (0xFF80007FU) -#define nboot_lc_shredded (0xFF0000FFU) -typedef uint32_t nboot_soc_lifecycle_t; - -/*! @brief Type for nboot status codes */ -typedef uint32_t nboot_status_t; - -/*! @brief Type for nboot protected status codes */ -typedef uint64_t nboot_status_protected_t; - -/*! - * @brief nboot status codes. - */ -enum -{ - kStatus_NBOOT_Success = 0x5A5A5A5AU, /*!< Operation completed successfully. */ - kStatus_NBOOT_Fail = 0x5A5AA5A5U, /*!< Operation failed. */ - kStatus_NBOOT_InvalidArgument = 0x5A5AA5F0U, /*!< Invalid argument passed to the function. */ - kStatus_NBOOT_RequestTimeout = 0x5A5AA5E1U, /*!< Operation timed out. */ - kStatus_NBOOT_KeyNotLoaded = 0x5A5AA5E2U, /*!< The requested key is not loaded. */ - kStatus_NBOOT_AuthFail = 0x5A5AA5E4U, /*!< Authentication failed. */ - kStatus_NBOOT_OperationNotAvaialable = 0x5A5AA5E5U, /*!< Operation not available on this HW. */ - kStatus_NBOOT_KeyNotAvailable = 0x5A5AA5E6U, /*!< Key is not avaialble. */ - kStatus_NBOOT_IvCounterOverflow = 0x5A5AA5E7U, /*!< Overflow of IV counter (PRINCE/IPED). */ - kStatus_NBOOT_SelftestFail = 0x5A5AA5E8U, /*!< FIPS self-test failure. */ - kStatus_NBOOT_InvalidDataFormat = 0x5A5AA5E9U, /*!< Invalid data format for example antipole */ - kStatus_NBOOT_IskCertUserDataTooBig = - 0x5A5AA5EAU, /*!< Size of User data in ISK certificate is greater than 96 bytes */ - kStatus_NBOOT_IskCertSignatureOffsetTooSmall = - 0x5A5AA5EBU, /*!< Signature offset in ISK certificate is smaller than expected */ - kStatus_NBOOT_MemcpyFail = 0x5A5A845AU, /*!< Unexpected error detected during nboot_memcpy() */ -}; - -/*! @brief Data structure holding secure counter value used by nboot library */ -typedef struct _nboot_secure_counter -{ - uint32_t sc; - uint32_t scAp; -} nboot_secure_counter_t; - -/*! - * @brief NBOOT context type - * - * This type defines the NBOOT context - * - */ -typedef struct _nboot_context -{ - uint32_t totalBlocks; /*!< holds number of SB3 blocks. Initialized by nboot_sb3_load_header(). */ - uint32_t processData; /*!< flag, initialized by nboot_sb3_load_header(). - SB3 related flag set by NBOOT in case the nboot_sb3_load_block() - provides plain data to output buffer (for processing by ROM SB3 loader */ - uint32_t timeout; /*!< timeout value for css operation. In case it is 0, infinite wait is performed */ - uint32_t keyinfo[NBOOT_KEYINFO_WORDLEN]; /*!< data for NBOOT key management. */ - uint32_t context[NBOOT_CONTEXT_WORDLEN]; /*!< work area for NBOOT lib. */ - uint32_t uuid[4]; /*!< holds UUID value from NMPA */ - uint32_t prngReadyFlag; /*!< flag, used by nboot_rng_generate_lq_random() to determine whether CSS is ready to - generate rnd number */ - uint32_t multipartMacBuffer[1024 / sizeof(uint32_t)]; - uint32_t oemShareValidFlag; /*!< flag, used during TP to determine whether valid oemShare was set by - nboot_tp_isp_gen_oem_master_share() */ - uint32_t oemShare[4]; /*!< buffer to store OEM_SHARE computed by nxpCLTrustProv_nboot_isp_gen_oem_master_share() */ - nboot_secure_counter_t secureCounter; /*!< Secure counter used by nboot */ - uint32_t rtf[NXPCLCSS_HASH_RTF_OUTPUT_SIZE_HAL / sizeof(uint32_t)]; - uint32_t imageHash[48 / sizeof(uint32_t)]; - uint32_t authStatus; -} nboot_context_t; - -/*! - * @brief NBOOT type for the root of trust parameters - * - * This type defines the NBOOT root of trust parameters - * - */ -typedef struct _nboot_rot_auth_parms -{ - /* trusted information originated from CFPA */ - nboot_root_key_revocation_t soc_rootKeyRevocation[NBOOT_ROOT_CERT_COUNT]; /*!< Provided by caller based on NVM - information in CFPA: ROTKH_REVOKE */ - uint32_t soc_imageKeyRevocation; /*!< Provided by caller based on NVM information in CFPA: IMAGE_KEY_REVOKE */ - - /* trusted information originated from CMPA */ - uint32_t soc_rkh[12]; /*!< Provided by caller based on NVM information in CMPA: ROTKH (hash of hashes) */ - /*!< In case of kNBOOT_RootKey_Ecdsa_P384, sock_rkh[0..11] are used */ - /*!< In case of kNBOOT_RootKey_Ecdsa_P256, sock_rkh[0..7] are used */ - - uint32_t soc_numberOfRootKeys; /*!< unsigned int, between minimum = 1 and maximum = 4; */ - nboot_root_key_usage_t soc_rootKeyUsage[NBOOT_ROOT_CERT_COUNT]; /*!< CMPA */ - nboot_root_key_type_and_length_t - soc_rootKeyTypeAndLength; /*!< static selection between ECDSA P-256 or ECDSA P-384 based root keys */ - - /* trusted information originated from OTP fuses */ - nboot_soc_lifecycle_t soc_lifecycle; -} nboot_rot_auth_parms_t; - -/*! - * @brief manifest loading parameters - * - * This type defines the NBOOT SB3.1 manifest loading parameters - * - */ -typedef struct _nboot_sb3_load_manifest_parms -{ - nboot_rot_auth_parms_t soc_RoTNVM; /*!< trusted information originated from CFPA and NMPA */ - uint32_t soc_trustedFirmwareVersion; /*!< Provided by caller based on NVM information in CFPA: Secure_FW_Version */ - uint8_t pckBlob[48]; -} nboot_sb3_load_manifest_parms_t; - -/*! - * @brief Data structure holding input arguments to POR secure boot (authentication) algorithm. - * Shall be read from SoC trusted NVM or SoC fuses. - */ -typedef struct _nboot_img_auth_ecdsa_parms -{ - nboot_rot_auth_parms_t soc_RoTNVM; /*!< trusted information originated from CFPA and NMPA */ - uint32_t soc_trustedFirmwareVersion; /*!< Provided by caller based on NVM information in CFPA: Secure_FW_Version */ -} nboot_img_auth_ecdsa_parms_t; - -/*! @brief Data structure holding input arguments for CMAC authentication */ -typedef struct _nboot_cmac_authenticate_parms -{ - uint32_t expectedMAC[4]; /*!< expected MAC result */ -} nboot_img_authenticate_cmac_parms_t; - -/*! - * @brief Boolean type for the NBOOT functions - * - * This type defines boolean values used by NBOOT functions that are not easily disturbed by Fault Attacks - */ -typedef enum _nboot_bool -{ - kNBOOT_TRUE = 0x3C5AC33CU, /*!< Value for TRUE. */ - kNBOOT_TRUE256 = 0x3C5AC35AU, /*!< Value for TRUE when P256 was used to sign the image. */ - kNBOOT_TRUE384 = 0x3C5AC3A5U, /*!< Value for TRUE when P384 was used to sign the image. */ - kNBOOT_FALSE = 0x5AA55AA5U, /*!< Value for FALSE. */ - kNBOOT_OperationAllowed = 0x3c5a33ccU, - kNBOOT_OperationDisallowed = 0x5aa5cc33U, -} nboot_bool_t; - -#ifdef __cplusplus -extern "C" { -#endif - -/******************************************************************************* - * API - ******************************************************************************/ - -/*! - * @brief This API function is used to generate random number with specified length. - * - * @param output Pointer to random number buffer - * @param outputByteLen length of generated random number in bytes. Length has to be in range <1, 2^16> - * - * @retval #kStatus_NBOOT_InvalidArgument Invalid input parameters (Input pointers points to NULL or length is invalid) - * @retval #kStatus_NBOOT_Success Operation successfully finished - * @retval #kStatus_NBOOT_Fail Error occured during operation - */ -status_t NBOOT_GenerateRandom(uint8_t *output, size_t outputByteLen); - -/*! - * @brief The function is used for initializing of the nboot context data structure. - * It should be called prior to any other calls of nboot API. - * - * @param nbootCtx Pointer to nboot_context_t structure. - * - * @retval #kStatus_NBOOT_Success Operation successfully finished - * @retval #kStatus_NBOOT_Fail Error occured during operation - */ -nboot_status_t NBOOT_ContextInit(nboot_context_t *context); - -/*! - * @brief The function is used to deinitialize nboot context data structure. - * Its contents are overwritten with random data so that any sensitive data does not remain in memory. - * - * @param context Pointer to nboot_context_t structure. - - * @retval #kStatus_NBOOT_Success Operation successfully finished - * @retval #kStatus_NBOOT_Fail Error occured during operation - */ -nboot_status_t NBOOT_ContextDeinit(nboot_context_t *context); - -/*! - * @brief Verify NBOOT SB3.1 manifest (header message) - * - * This function verifies the NBOOT SB3.1 manifest (header message), initializes - * the context and loads keys into the CSS key store so that they can be used by nboot_sb3_load_block - * function. The NBOOT context has to be initialized by the function nboot_context_init before calling - * this function. Please note that this API is intended to be used only by users who needs to split - * FW update process (loading of SB3.1 file) to partial steps to customize whole operation. - * For regular SB3.1 processing, please use API described in chapter ��SBloader APIs��. - * - * @param nbootCtx Pointer to nboot_context_t structure. - * @param manifest Pointer to the input manifest buffer - * @param params additional input parameters. Please refer to nboot_sb3_load_manifest_parms_t definition for details. - * - * @retval #kStatus_NBOOT_Success Operation successfully finished - * @retval #kStatus_NBOOT_Fail Error occured during operation - */ -nboot_status_protected_t NBOOT_Sb3LoadManifest(nboot_context_t *context, - uint32_t *manifest, - nboot_sb3_load_manifest_parms_t *parms); - -/*! - * @brief Verify NBOOT SB3.1 block - * - * This function verifies and decrypts an NBOOT SB3.1 block. Decryption is performed in-place. - * The NBOOT context has to be initialized by the function nboot_context_init before calling this function. - * Please note that this API is intended to be used only by users who needs to split FW update process - * (loading of SB3.1 file) to partial steps to customize whole operation. For regular SB3.1 processing, - * please use API described in chapter ��SBloader APIs��. - * - * @param context Pointer to nboot_context_t structure. - * @param block Pointer to the input SB3.1 data block - * - * @retval #kStatus_NBOOT_Success successfully finished - * @retval #kStatus_NBOOT_Fail occured during operation - */ -nboot_status_protected_t NBOOT_Sb3LoadBlock(nboot_context_t *context, uint32_t *block); - -/*! - * @brief This function authenticates image with asymmetric cryptography. - * The NBOOT context has to be initialized by the function nboot_context_init - * before calling this function. - * - * @param context Pointer to nboot_context_t structure. - * @param imageStartAddress Pointer to start of the image in memory. - * @param isSignatureVerified Pointer to memory holding function call result. - * After the function returns, the value will be set to kNBOOT_TRUE when the image is - * authentic. Any other value means the authentication does not pass. - * - * @param parms Pointer to a data structure in trusted memory, holding input parameters for the algorithm. - * The data structure shall be correctly filled before the function call. - * - * @retval #kStatus_NBOOT_Success Operation successfully finished - * @retval #kStatus_NBOOT_Fail Returned in all other cases. Doesn't always mean invalid image, - * it could also mean transient error caused by short time environmental conditions. - */ -nboot_status_protected_t NBOOT_ImgAuthenticateEcdsa(nboot_context_t *context, - uint8_t imageStartAddress[], - nboot_bool_t *isSignatureVerified, - nboot_img_auth_ecdsa_parms_t *parms); - -/*! - * @brief This function calculates the CMAC over the given image and compares it to the expected value. - * To be more resistant against SPA, it is recommended that imageStartAddress is word aligned. - * The NBOOT context has to be initialized by the nboot_context_init() before calling this function. - * - * @param context Pointer to nboot_context_t structure. - * @param imageStartAddress Pointer to start of the image in memory. - * @param isSignatureVerified Pointer to memory holding function call result. - After the function returns, the value will be set to - * @param parms Pointer to a data structure in trusted memory, holding the reference MAC. - The data structure shall be correctly filled before the function call. - * - * @retval kStatus_NBOOT_Success - * @retval kStatus_NBOOT_Fail - */ -nboot_status_protected_t NBOOT_ImgAuthenticateCmac(nboot_context_t *context, - uint8_t imageStartAddress[], - nboot_bool_t *isSignatureVerified, - nboot_img_authenticate_cmac_parms_t *parms); - -#ifdef __cplusplus -} -#endif - -/** - * @} - */ - -#endif /* FSL_NBOOT_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/nboot/fsl_nboot_hal.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/nboot/fsl_nboot_hal.h deleted file mode 100644 index 79e0dd490ef..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/nboot/fsl_nboot_hal.h +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Copyright 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_NBOOT_HAL_H_ -#define FSL_NBOOT_HAL_H_ - -#include "fsl_nboot.h" - -/*! @addtogroup nbot_hal */ -/*! @{ */ - -/*! @file */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/*! @brief The size of the UUID. */ -#define NBOOT_UUID_SIZE_IN_WORD (4) -#define NBOOT_UUID_SIZE_IN_BYTE (NBOOT_UUID_SIZE_IN_WORD * 4) - -/*! @brief The size of the PUF activation code. */ -#define NBOOT_PUF_AC_SIZE_IN_BYTE (996) -/*! @brief The size of the PUF key code. */ -#define NBOOT_PUF_KC_SIZE_IN_BYTE (84) - -/*! @brief The size of the key store. */ -#define NBOOT_KEY_STORE_SIZE_IN_BYTE (NBOOT_PUF_AC_SIZE_IN_BYTE + 8) - -/*! @brief The size of the root of trust key table hash. */ -#define NBOOT_ROOT_ROTKH_SIZE_IN_WORD (12) -#define NBOOT_ROOT_ROTKH_SIZE_IN_BYTE (NBOOT_ROOT_ROTKH_SIZE_IN_WORD * 4) - -/*! @brief The size of the blob with Key Blob. */ -#define NBOOT_KEY_BLOB_SIZE_IN_BYTE_256 (32) -#define NBOOT_KEY_BLOB_SIZE_IN_BYTE_384 (48) -#define NBOOT_KEY_BLOB_SIZE_IN_BYTE_MAX (NBOOT_KEY_BLOB_SIZE_IN_BYTE_384) - -/*! @brief The mask of the value of the debug state . */ -#define NBOOT_DBG_AUTH_DBG_STATE_MASK (0x0000FFFFu) -/*! @brief The shift inverted value of the debug state. */ -#define NBOOT_DBG_AUTH_DBG_STATE_SHIFT (16) -/*! @brief The value with all debug feature disabled. */ -#define NBOOT_DBG_AUTH_DBG_STATE_ALL_DISABLED (0xFFFF0000u) - -#define NBOOT_ROOT_OF_TRUST_HASH_SIZE_IN_BYTES (48u) - -#define NBOOT_EC_COORDINATE_384_SIZE_IN_BYTES (48u) -#define NBOOT_EC_COORDINATE_MAX_SIZE NBOOT_EC_COORDINATE_384_SIZE_IN_BYTES - -/* SB3.1 */ -#define NBOOT_SB3_CHUNK_SIZE_IN_BYTES (256u) -#define NBOOT_SB3_BLOCK_HASH256_SIZE_IN_BYTES (32u) -#define NBOOT_SB3_BLOCK_HASH384_SIZE_IN_BYTES (48u) - -/*! - * @brief NBOOT type for a timestamp - * - * This type defines the NBOOT timestamp - * - */ -typedef uint32_t nboot_timestamp_t[2]; - -/*! - * @brief NBOOT SB3.1 header type - * - * This type defines the header used in the SB3.1 manifest - * - */ -typedef struct _nboot_sb3_header -{ - uint32_t magic; /*!< offset 0x00: Fixed 4-byte string of 'sbv3' without the trailing NULL */ - uint32_t formatVersion; /*!< offset 0x04: (major = 3, minor = 1); The format version determines the manifest - (block0) size. */ - uint32_t flags; /*!< offset 0x08: not defined yet, keep zero for future compatibility */ - uint32_t blockCount; /*!< offset 0x0C: Number of blocks not including the manifest (block0). */ - uint32_t - blockSize; /*!< offset 0x10: Size in bytes of data block (repeated blockCount times for SB3 data stream). */ - nboot_timestamp_t timeStamp; /*!< offset 0x14: 64-bit value used as key derivation data. */ - uint32_t firmwareVersion; /*!< offset 0x1c: Version number of the included firmware */ - uint32_t imageTotalLength; /*!< offset 0x20: Total manifest length in bytes, including signatures etc. */ - uint32_t imageType; /*!< offset 0x24: image type and flags */ - uint32_t certificateBlockOffset; /*!< offset 0x28: Offset from start of header block to the certificate block. */ - uint8_t description[16]; /*!< offset 0x32: This field provides description of the file. It is an arbitrary - string injected by the signing tool, which helps to identify the file. */ -} nboot_sb3_header_t; - -/*! - * @brief NBOOT type for the header of the certificate block - * - * This type defines the NBOOT header of the certificate block, it is part of the nboot_certificate_block_t - * - */ -typedef struct _nboot_certificate_header_block -{ - uint32_t magic; /*!< magic number. */ - uint32_t formatMajorMinorVersion; /*!< format major minor version */ - uint32_t certBlockSize; /*!< Size of the full certificate block */ -} nboot_certificate_header_block_t; - -typedef uint8_t nboot_ctrk_hash_t[NBOOT_ROOT_OF_TRUST_HASH_SIZE_IN_BYTES]; - -/*! - * @brief NBOOT type for the hash table - * - * This type defines the NBOOT hash table - * - */ -typedef struct _nboot_ctrk_hash_table -{ - nboot_ctrk_hash_t ctrkHashTable[NBOOT_ROOT_CERT_COUNT]; -} nboot_ctrk_hash_table_t; - -/*! - * @brief NBOOT type for an ECC coordinate - * - * This type defines the NBOOT ECC coordinate type - * - */ -typedef uint8_t - nboot_ecc_coordinate_t[NBOOT_EC_COORDINATE_MAX_SIZE]; /*!< ECC point coordinate, up to 384-bits. big endian. */ - -/*! - * @brief NBOOT type for an ECC point - * - * This type defines the NBOOT ECC point type - */ -typedef struct -{ - nboot_ecc_coordinate_t x; /*!< x portion of the ECDSA public key, up to 384-bits. big endian. */ - nboot_ecc_coordinate_t y; /*!< y portion of the ECDSA public key, up to 384-bits. big endian. */ -} nboot_ecdsa_public_key_t; - -/*! - * @brief NBOOT type for the root certificate block - * - * This type defines the NBOOT root certificate block, it is part of the nboot_certificate_block_t - */ -typedef struct _nboot_root_certificate_block -{ - uint32_t flags; /*!< root certificate flags */ - nboot_ctrk_hash_table_t ctrkHashTable; /*!< hash table */ - nboot_ecdsa_public_key_t rootPublicKey; /*!< root public key */ -} nboot_root_certificate_block_t; - -/*! - * @brief NBOOT type for an ECC signature - * - * This type defines the NBOOT ECC signature type - */ -typedef struct -{ - nboot_ecc_coordinate_t r; /*!< r portion of the ECDSA signature, up to 384-bits. big endian. */ - nboot_ecc_coordinate_t s; /*!< s portion of the ECDSA signature, up to 384-bits. big endian. */ -} nboot_ecdsa_signature_t; - -/*! - * @brief NBOOT type for the isk block - * - * This type defines the constant length part of an NBOOT isk block - */ -typedef struct -{ - uint32_t signatureOffset; /*!< Offset of signature in ISK block. */ - uint32_t constraints; /*!< Version number of signing certificate. */ - uint32_t iskFlags; /*!< Reserved for definiton of ISK certificate flags. */ - nboot_ecdsa_public_key_t - iskPubKey; /*!< Public key of signing certificate. Variable length; only used to determine start address*/ - nboot_ecdsa_public_key_t userData; /*!< Space for at lest one addition public key*/ - nboot_ecdsa_signature_t iskSign; /*!< ISK signature*/ -} nboot_isk_block_t; - -/*! - * @brief NBOOT type for the certificate block - * - * This type defines the constant length part of an NBOOT certificate block - */ -typedef struct _nboot_certificate_block -{ - nboot_certificate_header_block_t header; - nboot_root_certificate_block_t rootCertBlock; /*! Details of selected root certificate (root certificate which will - be used for ISK signing/SB3 header signing) */ - nboot_isk_block_t iskBlock; -} nboot_certificate_block_t; - -#define NBOOT_SB3_MANIFEST_MAX_SIZE_IN_BYTES \ - (sizeof(nboot_sb3_header_t) + NBOOT_SB3_BLOCK_HASH384_SIZE_IN_BYTES + sizeof(nboot_certificate_block_t) + \ - NBOOT_EC_COORDINATE_MAX_SIZE * 2) -#define NBOOT_SB3_BLOCK_MAX_SIZE_IN_BYTES \ - (4 /* blockNumber */ + NBOOT_SB3_BLOCK_HASH384_SIZE_IN_BYTES + NBOOT_SB3_CHUNK_SIZE_IN_BYTES) - -/*! @brief The size of the DICE certificate. */ -#define NBOOT_DICE_CSR_SIZE_IN_WORD (36) -#define NBOOT_DICE_CSR_SIZE_IN_BYTES (NBOOT_DICE_CSR_SIZE_IN_WORD * 4) - -/*! @brief The physical address to put the DICE certificate. */ -#define NBOOT_DICE_CSR_ADDRESS (0x30000000u) - -/*! @brief The offset for the PRCINE/IPED erase region return by nboot mem checker. */ -#define NBOOT_IPED_IV_OFFSET (3U) - -#define NBOOT_IMAGE_CMAC_UPDATE_NONE (0u) -#define NBOOT_IMAGE_CMAC_UPDATE_INDEX0 (1u) -#define NBOOT_IMAGE_CMAC_UPDATE_INDEX1 (2u) -#define NBOOT_IMAGE_CMAC_UPDATE_BOTH (3u) -#define NBOOT_IMAGE_CMAC_UPDATE_MASK (3u) - -#define NBOOT_CMPA_CMAC_UPDATE_MASK (0x1Cu) -#define NBOOT_CMPA_CMAC_UPDATE_SHIFT (0x2u) - -#define NBOOT_CMPA_UPDATE_CMAC_PFR (0x2u) -#define NBOOT_CMPA_UPDATE_CMAC_PFR_OTP_OEM_SECURE (0x3u) -#define NBOOT_CMPA_UPDATE_CMAC_PFR_OTP_OEM_CLOSE (0x5u) -#define NBOOT_CMPA_UPDATE_CMAC_PFR_OTP_OEM_LOCKED (0x6u) - -/*! @brief Algorithm used for nboot HASH operation */ -typedef enum _nboot_hash_algo_t -{ - kHASH_Sha1 = 1, /*!< SHA_1 */ - kHASH_Sha256 = 2, /*!< SHA_256 */ - kHASH_Sha512 = 3, /*!< SHA_512 */ - kHASH_Aes = 4, /*!< AES */ - kHASH_AesIcb = 5, /*!< AES_ICB */ -} nboot_hash_algo_t; - -/*! @} */ - -#endif /*FSL_NBOOT_HAL_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/nboot/src/fsl_nboot.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/nboot/src/fsl_nboot.c deleted file mode 100644 index 909be4ae3e5..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/nboot/src/fsl_nboot.c +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#include "fsl_nboot.h" -#include "fsl_common.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/*! @brief Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.nboot" -#endif - -#define BOOTLOADER_API_TREE_POINTER ((bootloader_tree_t *)0x1303fc00U) - -/** - * @brief Image authentication operations. - * - * These abstract interface are used for image verification operations. - */ -typedef struct -{ - romapi_status_t (*romapi_rng_generate_random)(uint8_t *output, size_t outputByteLen); - nboot_status_t (*nboot_context_init)(nboot_context_t *context); - nboot_status_t (*nboot_context_deinit)(nboot_context_t *context); - nboot_status_protected_t (*nboot_sb3_load_manifest)(nboot_context_t *context, - uint32_t *manifest, - nboot_sb3_load_manifest_parms_t *parms); - nboot_status_protected_t (*nboot_sb3_load_block)(nboot_context_t *context, uint32_t *block); - nboot_status_protected_t (*nboot_img_authenticate_ecdsa)(nboot_context_t *context, - uint8_t imageStartAddress[], - nboot_bool_t *isSignatureVerified, - nboot_img_auth_ecdsa_parms_t *parms); - nboot_status_protected_t (*nboot_img_authenticate_cmac)(nboot_context_t *context, - uint8_t imageStartAddress[], - nboot_bool_t *isSignatureVerified, - nboot_img_authenticate_cmac_parms_t *parms); -} nboot_interface_t; - -/*! - * @brief Root of the bootloader API tree. - * - * An instance of this struct resides in read-only memory in the bootloader. It - * provides a user application access to APIs exported by the bootloader. - * - * @note The order of existing fields must not be changed. - */ -typedef struct BootloaderTree -{ - void (*runBootloader)(void *arg); /*!< Function to start the bootloader executing.*/ - const uint32_t version; /*!< Bootloader version number.*/ - const char *copyright; /*!< Copyright string.*/ - const uint32_t reserved0; /*!< reserved*/ - const uint32_t flashDriver; /*!< Internal Flash driver API.*/ - const uint32_t reserved1[5]; /*!< reserved*/ - const nboot_interface_t *nbootDriver; /*!< nBoot driver API */ - const uint32_t flexspiNorDriver; /*!< FlexSPI NOR FLASH Driver API.*/ - const uint32_t efuseDriver; /*!< eFuse driver API */ - const uint32_t iapAPIDriver; /*!< IAP driver API */ -} bootloader_tree_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -/*! - * @brief This API function is used to generate random number with specified length. - * - * @param output Pointer to random number buffer - * @param outputByteLen length of generated random number in bytes. Length has to be in range <1, 2^16> - * - * @retval #kStatus_NBOOT_InvalidArgument Invalid input parameters (Input pointers points to NULL or length is invalid) - * @retval #kStatus_NBOOT_Success Operation successfully finished - * @retval #kStatus_NBOOT_Fail Error occured during operation - */ -status_t NBOOT_GenerateRandom(uint8_t *output, size_t outputByteLen) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->nbootDriver->romapi_rng_generate_random(output, outputByteLen); -} - -/*! - * @brief The function is used for initializing of the nboot context data structure. - * It should be called prior to any other calls of nboot API. - * - * @param nbootCtx Pointer to nboot_context_t structure. - * - * @retval #kStatus_NBOOT_Success Operation successfully finished - * @retval #kStatus_NBOOT_Fail Error occured during operation - */ -nboot_status_t NBOOT_ContextInit(nboot_context_t *context) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->nbootDriver->nboot_context_init(context); -} - -/*! - * @brief The function is used to deinitialize nboot context data structure. - * Its contents are overwritten with random data so that any sensitive data does not remain in memory. - * - * @param context Pointer to nboot_context_t structure. - - * @retval #kStatus_NBOOT_Success Operation successfully finished - * @retval #kStatus_NBOOT_Fail Error occured during operation - */ -nboot_status_t NBOOT_ContextDeinit(nboot_context_t *context) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->nbootDriver->nboot_context_deinit(context); -} -/*! - * @brief Verify NBOOT SB3.1 manifest (header message) - * - * This function verifies the NBOOT SB3.1 manifest (header message), initializes - * the context and loads keys into the CSS key store so that they can be used by nboot_sb3_load_block - * function. The NBOOT context has to be initialized by the function nboot_context_init before calling - * this function. Please note that this API is intended to be used only by users who needs to split - * FW update process (loading of SB3.1 file) to partial steps to customize whole operation. - * For regular SB3.1 processing, please use API described in chapter SBloader APIs. - * - * @param nbootCtx Pointer to nboot_context_t structure. - * @param manifest Pointer to the input manifest buffer - * @param params additional input parameters. Please refer to nboot_sb3_load_manifest_parms_t definition for details. - * - * @retval #kStatus_NBOOT_Success Operation successfully finished - * @retval #kStatus_NBOOT_Fail Error occured during operation - */ -nboot_status_protected_t NBOOT_Sb3LoadManifest(nboot_context_t *context, - uint32_t *manifest, - nboot_sb3_load_manifest_parms_t *parms) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->nbootDriver->nboot_sb3_load_manifest(context, manifest, parms); -} - -/*! - * @brief Verify NBOOT SB3.1 block - * - * This function verifies and decrypts an NBOOT SB3.1 block. Decryption is performed in-place. - * The NBOOT context has to be initialized by the function nboot_context_init before calling this function. - * Please note that this API is intended to be used only by users who needs to split FW update process - * (loading of SB3.1 file) to partial steps to customize whole operation. For regular SB3.1 processing, - * please use API described in chapter SBloader APIs. - * - * @param context Pointer to nboot_context_t structure. - * @param block Pointer to the input SB3.1 data block - * - * @retval #kStatus_NBOOT_Success successfully finished - * @retval #kStatus_NBOOT_Fail occured during operation - */ -nboot_status_protected_t NBOOT_Sb3LoadBlock(nboot_context_t *context, uint32_t *block) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->nbootDriver->nboot_sb3_load_block(context, block); -} - -/*! - * @brief This function authenticates image with asymmetric cryptography. - * The NBOOT context has to be initialized by the function nboot_context_init - * before calling this function. - * - * @param context Pointer to nboot_context_t structure. - * @param imageStartAddress Pointer to start of the image in memory. - * @param isSignatureVerified Pointer to memory holding function call result. - * After the function returns, the value will be set to kNBOOT_TRUE when the image is - * authentic. Any other value means the authentication does not pass. - * - * @param parms Pointer to a data structure in trusted memory, holding input parameters for the algorithm. - * The data structure shall be correctly filled before the function call. - * - * @retval #kStatus_NBOOT_Success Operation successfully finished - * @retval #kStatus_NBOOT_Fail Returned in all other cases. Doesn't always mean invalid image, - * it could also mean transient error caused by short time environmental conditions. - */ -nboot_status_protected_t NBOOT_ImgAuthenticateEcdsa(nboot_context_t *context, - uint8_t imageStartAddress[], - nboot_bool_t *isSignatureVerified, - nboot_img_auth_ecdsa_parms_t *parms) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->nbootDriver->nboot_img_authenticate_ecdsa(context, imageStartAddress, - isSignatureVerified, parms); -} - -/*! - * @brief This function calculates the CMAC over the given image and compares it to the expected value. - * To be more resistant against SPA, it is recommended that imageStartAddress is word aligned. - * The NBOOT context has to be initialized by the nboot_context_init() before calling this function. - * - * @param context Pointer to nboot_context_t structure. - * @param imageStartAddress Pointer to start of the image in memory. - * @param isSignatureVerified Pointer to memory holding function call result. - After the function returns, the value will be set to - * @param parms Pointer to a data structure in trusted memory, holding the reference MAC. - The data structure shall be correctly filled before the function call. - * - * @retval kStatus_NBOOT_Success - * @retval kStatus_NBOOT_Fail - */ -nboot_status_protected_t NBOOT_ImgAuthenticateCmac(nboot_context_t *context, - uint8_t imageStartAddress[], - nboot_bool_t *isSignatureVerified, - nboot_img_authenticate_cmac_parms_t *parms) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->nbootDriver->nboot_img_authenticate_cmac(context, imageStartAddress, - isSignatureVerified, parms); -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/runbootloader/fsl_runbootloader.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/runbootloader/fsl_runbootloader.h deleted file mode 100644 index 8e11ec1c5ce..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/runbootloader/fsl_runbootloader.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_RUN_BOOTLOADER_H_ -#define FSL_RUN_BOOTLOADER_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup runbootloader - * @{ - */ -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* API prototype fields definition. -| 31 : 24 | 23 : 20 | 19 : 16 | 15 : 12 | 11 : 8 | 7 : 0 | - | Tag | Boot mode | bootloader periphal| Instance | Image Index| Reserved | -| | | | Used For Boot mode 0| | | -| | 0: Passive mode | 0 - Auto detection | | | | -| | 1: ISP mode | 1 - USB-HID | | | | -| | | 2 - UART | | | | -| | | 3 - SPI | | | | -| | | 4 - I2C | | | | -| | | 5 - CAN | | | | -*/ - -typedef struct -{ - union - { - struct - { - uint32_t reserved : 8; - uint32_t boot_image_index : 4; - uint32_t instance : 4; - uint32_t boot_interface : 4; - uint32_t mode : 4; - uint32_t tag : 8; - } B; - uint32_t U; - } option; -} user_app_boot_invoke_option_t; - -#ifdef __cplusplus -extern "C" { -#endif - -/******************************************************************************* - * API - ******************************************************************************/ - -/*! - * @brief Run the Bootloader API to force into the ISP mode base on the user arg - * - * @param arg Indicates API prototype fields definition. Refer to the above user_app_boot_invoke_option_t structure - */ -void bootloader_user_entry(void *arg); - -#ifdef __cplusplus -} -#endif - -/** - * @} - */ - -#endif /* FSL_RUN_BOOTLOADER_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/runbootloader/src/fsl_runbootloader.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/runbootloader/src/fsl_runbootloader.c deleted file mode 100644 index ebfe866f1eb..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/drivers/romapi/runbootloader/src/fsl_runbootloader.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#include "fsl_flash.h" -#include "fsl_flash_ffr.h" -#include "fsl_flexspi_nor_flash.h" -#include "fsl_runbootloader.h" - -/*! @brief Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.runBootloader" -#endif - -/******************************************************************************* - * Definitions - ******************************************************************************/ -#define BOOTLOADER_API_TREE_POINTER ((bootloader_tree_t *)0x1303fc00U) - -/*! - * @brief Root of the bootloader API tree. - * - * An instance of this struct resides in read-only memory in the bootloader. It - * provides a user application access to APIs exported by the bootloader. - * - * @note The order of existing fields must not be changed. - */ -typedef struct BootloaderTree -{ - void (*runBootloader)(void *arg); /*!< Function to start the bootloader executing.*/ - const uint32_t version; /*!< Bootloader version number.*/ - const char *copyright; /*!< Copyright string.*/ - const uint32_t reserved0; /*!< reserved*/ - const uint32_t flashDriver; /*!< Internal Flash driver API.*/ - const uint32_t reserved1[5]; /*!< reserved*/ - const uint32_t nbootDriver; /*!< Please refer to "fsl_nboot.h" */ - const uint32_t flexspiNorDriver; /*!< FlexSPI NOR FLASH Driver API.*/ - const uint32_t reserved2; /*!< reserved*/ - const uint32_t memoryInterface; /*!< Please refer to "fsl_mem_interface.h" */ -} bootloader_tree_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -void bootloader_user_entry(void *arg) -{ - assert(BOOTLOADER_API_TREE_POINTER); - BOOTLOADER_API_TREE_POINTER->runBootloader(arg); -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/fsl_device_registers.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/fsl_device_registers.h deleted file mode 100644 index f270e5a7564..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/fsl_device_registers.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2014-2016 Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * SPDX-License-Identifier: BSD-3-Clause - * - */ - -#ifndef __FSL_DEVICE_REGISTERS_H__ -#define __FSL_DEVICE_REGISTERS_H__ - -/* - * Include the cpu specific register header files. - * - * The CPU macro should be declared in the project or makefile. - */ -#if (defined(CPU_MCXN236VDF) || defined(CPU_MCXN236VNL)) - -#define MCXN236_SERIES - -/* CMSIS-style register definitions */ -#include "MCXN236.h" -/* CPU specific feature definitions */ -#include "MCXN236_features.h" - -#else - #error "No valid CPU defined!" -#endif - -#endif /* __FSL_DEVICE_REGISTERS_H__ */ - -/******************************************************************************* - * EOF - ******************************************************************************/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/gcc/startup_MCXN236.S b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/gcc/startup_MCXN236.S deleted file mode 100644 index 31c4031a057..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/gcc/startup_MCXN236.S +++ /dev/null @@ -1,1948 +0,0 @@ -/* ------------------------------------------------------------------------- */ -/* @file: startup_MCXN236.s */ -/* @purpose: CMSIS Cortex-M33 Core Device Startup File */ -/* MCXN236 */ -/* @version: 1.0 */ -/* @date: 2023-10-1 */ -/* @build: b240409 */ -/* ------------------------------------------------------------------------- */ -/* */ -/* Copyright 1997-2016 Freescale Semiconductor, Inc. */ -/* Copyright 2016-2024 NXP */ -/* SPDX-License-Identifier: BSD-3-Clause */ -/*****************************************************************************/ -/* Version: GCC for ARM Embedded Processors */ -/*****************************************************************************/ - .syntax unified - .arch armv8-m.main - - .section .isr_vector, "a" - .align 2 - .globl __Vectors -__Vectors: - .long __StackTop /* Top of Stack */ - .long Reset_Handler /* Reset Handler */ - .long NMI_Handler /* NMI Handler*/ - .long HardFault_Handler /* Hard Fault Handler*/ - .long MemManage_Handler /* MPU Fault Handler*/ - .long BusFault_Handler /* Bus Fault Handler*/ - .long UsageFault_Handler /* Usage Fault Handler*/ - .long SecureFault_Handler /* Secure Fault Handler*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long SVC_Handler /* SVCall Handler*/ - .long DebugMon_Handler /* Debug Monitor Handler*/ - .long 0 /* Reserved*/ - .long PendSV_Handler /* PendSV Handler*/ - .long SysTick_Handler /* SysTick Handler*/ - - /* External Interrupts*/ - .long OR_IRQHandler /* OR IRQ*/ - .long EDMA_0_CH0_IRQHandler /* eDMA_0_CH0 error or transfer complete*/ - .long EDMA_0_CH1_IRQHandler /* eDMA_0_CH1 error or transfer complete*/ - .long EDMA_0_CH2_IRQHandler /* eDMA_0_CH2 error or transfer complete*/ - .long EDMA_0_CH3_IRQHandler /* eDMA_0_CH3 error or transfer complete*/ - .long EDMA_0_CH4_IRQHandler /* eDMA_0_CH4 error or transfer complete*/ - .long EDMA_0_CH5_IRQHandler /* eDMA_0_CH5 error or transfer complete*/ - .long EDMA_0_CH6_IRQHandler /* eDMA_0_CH6 error or transfer complete*/ - .long EDMA_0_CH7_IRQHandler /* eDMA_0_CH7 error or transfer complete*/ - .long EDMA_0_CH8_IRQHandler /* eDMA_0_CH8 error or transfer complete*/ - .long EDMA_0_CH9_IRQHandler /* eDMA_0_CH9 error or transfer complete*/ - .long EDMA_0_CH10_IRQHandler /* eDMA_0_CH10 error or transfer complete*/ - .long EDMA_0_CH11_IRQHandler /* eDMA_0_CH11 error or transfer complete*/ - .long EDMA_0_CH12_IRQHandler /* eDMA_0_CH12 error or transfer complete*/ - .long EDMA_0_CH13_IRQHandler /* eDMA_0_CH13 error or transfer complete*/ - .long EDMA_0_CH14_IRQHandler /* eDMA_0_CH14 error or transfer complete*/ - .long EDMA_0_CH15_IRQHandler /* eDMA_0_CH15 error or transfer complete*/ - .long GPIO00_IRQHandler /* GPIO0 interrupt 0*/ - .long GPIO01_IRQHandler /* GPIO0 interrupt 1*/ - .long GPIO10_IRQHandler /* GPIO1 interrupt 0*/ - .long GPIO11_IRQHandler /* GPIO1 interrupt 1*/ - .long GPIO20_IRQHandler /* GPIO2 interrupt 0*/ - .long GPIO21_IRQHandler /* GPIO2 interrupt 1*/ - .long GPIO30_IRQHandler /* GPIO3 interrupt 0*/ - .long GPIO31_IRQHandler /* GPIO3 interrupt 1*/ - .long GPIO40_IRQHandler /* GPIO4 interrupt 0*/ - .long GPIO41_IRQHandler /* GPIO4 interrupt 1*/ - .long GPIO50_IRQHandler /* GPIO5 interrupt 0*/ - .long GPIO51_IRQHandler /* GPIO5 interrupt 1*/ - .long UTICK0_IRQHandler /* Micro-Tick Timer interrupt*/ - .long MRT0_IRQHandler /* Multi-Rate Timer interrupt*/ - .long CTIMER0_IRQHandler /* Standard counter/timer 0 interrupt*/ - .long CTIMER1_IRQHandler /* Standard counter/timer 1 interrupt*/ - .long Reserved49_IRQHandler /* Reserved interrupt*/ - .long CTIMER2_IRQHandler /* Standard counter/timer 2 interrupt*/ - .long LP_FLEXCOMM0_IRQHandler /* LP_FLEXCOMM0 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM1_IRQHandler /* LP_FLEXCOMM1 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM2_IRQHandler /* LP_FLEXCOMM2 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM3_IRQHandler /* LP_FLEXCOMM3 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM4_IRQHandler /* LP_FLEXCOMM4 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM5_IRQHandler /* LP_FLEXCOMM5 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM6_IRQHandler /* LP_FLEXCOMM6 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM7_IRQHandler /* LP_FLEXCOMM7 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long Reserved59_IRQHandler /* Reserved interrupt*/ - .long Reserved60_IRQHandler /* Reserved interrupt*/ - .long ADC0_IRQHandler /* Analog-to-Digital Converter 0 - General Purpose interrupt*/ - .long ADC1_IRQHandler /* Analog-to-Digital Converter 1 - General Purpose interrupt*/ - .long PINT0_IRQHandler /* Pin Interrupt Pattern Match Interrupt*/ - .long PDM_EVENT_IRQHandler /* Microphone Interface interrupt */ - .long Reserved65_IRQHandler /* Reserved interrupt*/ - .long Reserved66_IRQHandler /* Reserved interrupt*/ - .long USB0_DCD_IRQHandler /* Universal Serial Bus - Device Charge Detect interrupt*/ - .long RTC_IRQHandler /* RTC Subsystem interrupt (RTC interrupt or Wake timer interrupt)*/ - .long SMARTDMA_IRQHandler /* SmartDMA_IRQ*/ - .long Reserved70_IRQHandler /* Reserved interrupt*/ - .long CTIMER3_IRQHandler /* Standard counter/timer 3 interrupt*/ - .long CTIMER4_IRQHandler /* Standard counter/timer 4 interrupt*/ - .long OS_EVENT_IRQHandler /* OS event timer interrupt*/ - .long Reserved74_IRQHandler /* Reserved interrupt*/ - .long SAI0_IRQHandler /* Serial Audio Interface 0 interrupt*/ - .long SAI1_IRQHandler /* Serial Audio Interface 1 interrupt*/ - .long Reserved77_IRQHandler /* Reserved interrupt*/ - .long CAN0_IRQHandler /* Controller Area Network 0 interrupt*/ - .long CAN1_IRQHandler /* Controller Area Network 1 interrupt*/ - .long Reserved80_IRQHandler /* Reserved interrupt*/ - .long Reserved81_IRQHandler /* Reserved interrupt*/ - .long USB1_HS_PHY_IRQHandler /* USBHS DCD or USBHS Phy interrupt*/ - .long USB1_HS_IRQHandler /* USB High Speed OTG Controller interrupt */ - .long SEC_HYPERVISOR_CALL_IRQHandler /* AHB Secure Controller hypervisor call interrupt*/ - .long Reserved85_IRQHandler /* Reserved interrupt*/ - .long Reserved86_IRQHandler /* Reserved interrupt*/ - .long Freqme_IRQHandler /* Frequency Measurement interrupt*/ - .long SEC_VIO_IRQHandler /* Secure violation interrupt (Memory Block Checker interrupt or secure AHB matrix violation interrupt)*/ - .long ELS_IRQHandler /* ELS interrupt*/ - .long PKC_IRQHandler /* PKC interrupt*/ - .long PUF_IRQHandler /* Physical Unclonable Function interrupt*/ - .long Reserved92_IRQHandler /* Reserved interrupt*/ - .long EDMA_1_CH0_IRQHandler /* eDMA_1_CH0 error or transfer complete*/ - .long EDMA_1_CH1_IRQHandler /* eDMA_1_CH1 error or transfer complete*/ - .long EDMA_1_CH2_IRQHandler /* eDMA_1_CH2 error or transfer complete*/ - .long EDMA_1_CH3_IRQHandler /* eDMA_1_CH3 error or transfer complete*/ - .long EDMA_1_CH4_IRQHandler /* eDMA_1_CH4 error or transfer complete*/ - .long EDMA_1_CH5_IRQHandler /* eDMA_1_CH5 error or transfer complete*/ - .long EDMA_1_CH6_IRQHandler /* eDMA_1_CH6 error or transfer complete*/ - .long EDMA_1_CH7_IRQHandler /* eDMA_1_CH7 error or transfer complete*/ - .long Reserved101_IRQHandler /* Reserved interrupt*/ - .long Reserved102_IRQHandler /* Reserved interrupt*/ - .long Reserved103_IRQHandler /* Reserved interrupt*/ - .long Reserved104_IRQHandler /* Reserved interrupt*/ - .long Reserved105_IRQHandler /* Reserved interrupt*/ - .long Reserved106_IRQHandler /* Reserved interrupt*/ - .long Reserved107_IRQHandler /* Reserved interrupt*/ - .long Reserved108_IRQHandler /* Reserved interrupt*/ - .long CDOG0_IRQHandler /* Code Watchdog Timer 0 interrupt*/ - .long CDOG1_IRQHandler /* Code Watchdog Timer 1 interrupt*/ - .long I3C0_IRQHandler /* Improved Inter Integrated Circuit interrupt 0*/ - .long I3C1_IRQHandler /* Improved Inter Integrated Circuit interrupt 1*/ - .long Reserved113_IRQHandler /* Reserved interrupt*/ - .long GDET_IRQHandler /* Digital Glitch Detect 0 interrupt or Digital Glitch Detect 1 interrupt*/ - .long VBAT0_IRQHandler /* VBAT interrupt( VBAT interrupt or digital tamper interrupt)*/ - .long EWM0_IRQHandler /* External Watchdog Monitor interrupt*/ - .long Reserved117_IRQHandler /* Reserved interrupt*/ - .long Reserved118_IRQHandler /* Reserved interrupt*/ - .long Reserved119_IRQHandler /* Reserved interrupt*/ - .long Reserved120_IRQHandler /* Reserved interrupt*/ - .long FLEXIO_IRQHandler /* Flexible Input/Output interrupt*/ - .long Reserved122_IRQHandler /* Reserved interrupt*/ - .long Reserved123_IRQHandler /* Reserved interrupt*/ - .long Reserved124_IRQHandler /* Reserved interrupt*/ - .long HSCMP0_IRQHandler /* High-Speed comparator0 interrupt*/ - .long HSCMP1_IRQHandler /* High-Speed comparator1 interrupt*/ - .long Reserved127_IRQHandler /* Reserved interrupt*/ - .long FLEXPWM0_RELOAD_ERROR_IRQHandler /* FlexPWM0_reload_error interrupt*/ - .long FLEXPWM0_FAULT_IRQHandler /* FlexPWM0_fault interrupt*/ - .long FLEXPWM0_SUBMODULE0_IRQHandler /* FlexPWM0 Submodule 0 capture/compare/reload interrupt*/ - .long FLEXPWM0_SUBMODULE1_IRQHandler /* FlexPWM0 Submodule 1 capture/compare/reload interrupt*/ - .long FLEXPWM0_SUBMODULE2_IRQHandler /* FlexPWM0 Submodule 2 capture/compare/reload interrupt*/ - .long FLEXPWM0_SUBMODULE3_IRQHandler /* FlexPWM0 Submodule 3 capture/compare/reload interrupt*/ - .long FLEXPWM1_RELOAD_ERROR_IRQHandler /* FlexPWM1_reload_error interrupt*/ - .long FLEXPWM1_FAULT_IRQHandler /* FlexPWM1_fault interrupt*/ - .long FLEXPWM1_SUBMODULE0_IRQHandler /* FlexPWM1 Submodule 0 capture/compare/reload interrupt*/ - .long FLEXPWM1_SUBMODULE1_IRQHandler /* FlexPWM1 Submodule 1 capture/compare/reload interrupt*/ - .long FLEXPWM1_SUBMODULE2_IRQHandler /* FlexPWM1 Submodule 2 capture/compare/reload interrupt*/ - .long FLEXPWM1_SUBMODULE3_IRQHandler /* FlexPWM1 Submodule 3 capture/compare/reload interrupt*/ - .long QDC0_COMPARE_IRQHandler /* QDC0_Compare interrupt*/ - .long QDC0_HOME_IRQHandler /* QDC0_Home interrupt*/ - .long QDC0_WDG_SAB_IRQHandler /* QDC0_WDG_IRQ/SAB interrupt*/ - .long QDC0_IDX_IRQHandler /* QDC0_IDX interrupt*/ - .long QDC1_COMPARE_IRQHandler /* QDC1_Compare interrupt*/ - .long QDC1_HOME_IRQHandler /* QDC1_Home interrupt*/ - .long QDC1_WDG_SAB_IRQHandler /* QDC1_WDG_IRQ/SAB interrupt*/ - .long QDC1_IDX_IRQHandler /* QDC1_IDX interrupt*/ - .long ITRC0_IRQHandler /* Intrusion and Tamper Response Controller interrupt*/ - .long Reserved149_IRQHandler /* Reserved interrupt*/ - .long ELS_ERR_IRQHandler /* ELS error interrupt*/ - .long PKC_ERR_IRQHandler /* PKC error interrupt*/ - .long ERM_SINGLE_BIT_ERROR_IRQHandler /* ERM Single Bit error interrupt*/ - .long ERM_MULTI_BIT_ERROR_IRQHandler /* ERM Multi Bit error interrupt*/ - .long FMU0_IRQHandler /* Flash Management Unit interrupt*/ - .long Reserved155_IRQHandler /* Reserved interrupt*/ - .long Reserved156_IRQHandler /* Reserved interrupt*/ - .long Reserved157_IRQHandler /* Reserved interrupt*/ - .long Reserved158_IRQHandler /* Reserved interrupt*/ - .long LPTMR0_IRQHandler /* Low Power Timer 0 interrupt*/ - .long LPTMR1_IRQHandler /* Low Power Timer 1 interrupt*/ - .long SCG_IRQHandler /* System Clock Generator interrupt*/ - .long SPC_IRQHandler /* System Power Controller interrupt*/ - .long WUU_IRQHandler /* Wake Up Unit interrupt*/ - .long PORT_EFT_IRQHandler /* PORT0~5 EFT interrupt*/ - .long Reserved165_IRQHandler /* Reserved interrupt*/ - .long Reserved166_IRQHandler /* Reserved interrupt*/ - .long Reserved167_IRQHandler /* Reserved interrupt*/ - .long WWDT0_IRQHandler /* Windowed Watchdog Timer 0 interrupt*/ - .long WWDT1_IRQHandler /* Windowed Watchdog Timer 1 interrupt*/ - .long CMC0_IRQHandler /* Core Mode Controller interrupt*/ - .long Reserved171_IRQHandler /* Reserved interrupt*/ - - .size __Vectors, . - __Vectors - - .text - .thumb - -#if defined (__cplusplus) -#ifdef __REDLIB__ -#error Redlib does not support C++ -#endif -#endif -/* Reset Handler */ - - .thumb_func - .align 2 - .globl Reset_Handler - .weak Reset_Handler - .type Reset_Handler, %function -Reset_Handler: - cpsid i /* Mask interrupts */ - .equ VTOR, 0xE000ED08 - ldr r0, =VTOR - ldr r1, =__Vectors - str r1, [r0] - ldr r2, [r1] - msr msp, r2 - ldr r0, =__StackLimit - msr msplim, r0 -#ifndef __NO_SYSTEM_INIT - ldr r0,=SystemInit - blx r0 -#endif -/* Loop to copy data from read only memory to RAM. The ranges - * of copy from/to are specified by following symbols evaluated in - * linker script. - * __etext: End of code section, i.e., begin of data sections to copy from. - * __data_start__/__data_end__: RAM address range that data should be - * copied to. Both must be aligned to 4 bytes boundary. */ - - ldr r1, =__etext - ldr r2, =__data_start__ - ldr r3, =__data_end__ - -#if 1 -/* Here are two copies of loop implemenations. First one favors code size - * and the second one favors performance. Default uses the first one. - * Change to "#if 0" to use the second one */ -.LC0: - cmp r2, r3 - ittt lt - ldrlt r0, [r1], #4 - strlt r0, [r2], #4 - blt .LC0 -#else - subs r3, r2 - ble .LC1 -.LC0: - subs r3, #4 - ldr r0, [r1, r3] - str r0, [r2, r3] - bgt .LC0 -.LC1: -#endif - -#ifdef __STARTUP_CLEAR_BSS -/* This part of work usually is done in C library startup code. Otherwise, - * define this macro to enable it in this startup. - * - * Loop to zero out BSS section, which uses following symbols - * in linker script: - * __bss_start__: start of BSS section. Must align to 4 - * __bss_end__: end of BSS section. Must align to 4 - */ - ldr r1, =__bss_start__ - ldr r2, =__bss_end__ - - movs r0, 0 -.LC2: - cmp r1, r2 - itt lt - strlt r0, [r1], #4 - blt .LC2 -#endif /* __STARTUP_CLEAR_BSS */ - -/* Add stack / heap initializaiton */ - movs r0, 0 - ldr r1, =__HeapBase - ldr r2, =__HeapLimit -.LC3: - cmp r1, r2 - itt lt - strlt r0, [r1], #4 - blt .LC3 - - ldr r1, =__StackLimit - ldr r2, =__StackTop -.LC4: - cmp r1, r2 - itt lt - strlt r0, [r1], #4 - blt .LC4 - -/*End of stack / heap initializaiton */ - cpsie i /* Unmask interrupts */ -#ifndef __START -#ifdef __REDLIB__ -#define __START __main -#else -#define __START _start -#endif -#endif -#ifndef __ATOLLIC__ - ldr r0,=__START - blx r0 -#else - ldr r0,=__libc_init_array - blx r0 - ldr r0,=main - bx r0 -#endif - .pool - .size Reset_Handler, . - Reset_Handler - - .align 1 - .thumb_func - .weak DefaultISR - .type DefaultISR, %function -DefaultISR: - b DefaultISR - .size DefaultISR, . - DefaultISR - - .align 1 - .thumb_func - .weak NMI_Handler - .type NMI_Handler, %function -NMI_Handler: - ldr r0,=NMI_Handler - bx r0 - .size NMI_Handler, . - NMI_Handler - - .align 1 - .thumb_func - .weak HardFault_Handler - .type HardFault_Handler, %function -HardFault_Handler: - ldr r0,=HardFault_Handler - bx r0 - .size HardFault_Handler, . - HardFault_Handler - - .align 1 - .thumb_func - .weak SVC_Handler - .type SVC_Handler, %function -SVC_Handler: - ldr r0,=SVC_Handler - bx r0 - .size SVC_Handler, . - SVC_Handler - - .align 1 - .thumb_func - .weak PendSV_Handler - .type PendSV_Handler, %function -PendSV_Handler: - ldr r0,=PendSV_Handler - bx r0 - .size PendSV_Handler, . - PendSV_Handler - - .align 1 - .thumb_func - .weak SysTick_Handler - .type SysTick_Handler, %function -SysTick_Handler: - ldr r0,=SysTick_Handler - bx r0 - .size SysTick_Handler, . - SysTick_Handler - - .align 1 - .thumb_func - .weak OR_IRQHandler - .type OR_IRQHandler, %function -OR_IRQHandler: - ldr r0,=OR_DriverIRQHandler - bx r0 - .size OR_IRQHandler, . - OR_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH0_IRQHandler - .type EDMA_0_CH0_IRQHandler, %function -EDMA_0_CH0_IRQHandler: - ldr r0,=EDMA_0_CH0_DriverIRQHandler - bx r0 - .size EDMA_0_CH0_IRQHandler, . - EDMA_0_CH0_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH1_IRQHandler - .type EDMA_0_CH1_IRQHandler, %function -EDMA_0_CH1_IRQHandler: - ldr r0,=EDMA_0_CH1_DriverIRQHandler - bx r0 - .size EDMA_0_CH1_IRQHandler, . - EDMA_0_CH1_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH2_IRQHandler - .type EDMA_0_CH2_IRQHandler, %function -EDMA_0_CH2_IRQHandler: - ldr r0,=EDMA_0_CH2_DriverIRQHandler - bx r0 - .size EDMA_0_CH2_IRQHandler, . - EDMA_0_CH2_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH3_IRQHandler - .type EDMA_0_CH3_IRQHandler, %function -EDMA_0_CH3_IRQHandler: - ldr r0,=EDMA_0_CH3_DriverIRQHandler - bx r0 - .size EDMA_0_CH3_IRQHandler, . - EDMA_0_CH3_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH4_IRQHandler - .type EDMA_0_CH4_IRQHandler, %function -EDMA_0_CH4_IRQHandler: - ldr r0,=EDMA_0_CH4_DriverIRQHandler - bx r0 - .size EDMA_0_CH4_IRQHandler, . - EDMA_0_CH4_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH5_IRQHandler - .type EDMA_0_CH5_IRQHandler, %function -EDMA_0_CH5_IRQHandler: - ldr r0,=EDMA_0_CH5_DriverIRQHandler - bx r0 - .size EDMA_0_CH5_IRQHandler, . - EDMA_0_CH5_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH6_IRQHandler - .type EDMA_0_CH6_IRQHandler, %function -EDMA_0_CH6_IRQHandler: - ldr r0,=EDMA_0_CH6_DriverIRQHandler - bx r0 - .size EDMA_0_CH6_IRQHandler, . - EDMA_0_CH6_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH7_IRQHandler - .type EDMA_0_CH7_IRQHandler, %function -EDMA_0_CH7_IRQHandler: - ldr r0,=EDMA_0_CH7_DriverIRQHandler - bx r0 - .size EDMA_0_CH7_IRQHandler, . - EDMA_0_CH7_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH8_IRQHandler - .type EDMA_0_CH8_IRQHandler, %function -EDMA_0_CH8_IRQHandler: - ldr r0,=EDMA_0_CH8_DriverIRQHandler - bx r0 - .size EDMA_0_CH8_IRQHandler, . - EDMA_0_CH8_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH9_IRQHandler - .type EDMA_0_CH9_IRQHandler, %function -EDMA_0_CH9_IRQHandler: - ldr r0,=EDMA_0_CH9_DriverIRQHandler - bx r0 - .size EDMA_0_CH9_IRQHandler, . - EDMA_0_CH9_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH10_IRQHandler - .type EDMA_0_CH10_IRQHandler, %function -EDMA_0_CH10_IRQHandler: - ldr r0,=EDMA_0_CH10_DriverIRQHandler - bx r0 - .size EDMA_0_CH10_IRQHandler, . - EDMA_0_CH10_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH11_IRQHandler - .type EDMA_0_CH11_IRQHandler, %function -EDMA_0_CH11_IRQHandler: - ldr r0,=EDMA_0_CH11_DriverIRQHandler - bx r0 - .size EDMA_0_CH11_IRQHandler, . - EDMA_0_CH11_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH12_IRQHandler - .type EDMA_0_CH12_IRQHandler, %function -EDMA_0_CH12_IRQHandler: - ldr r0,=EDMA_0_CH12_DriverIRQHandler - bx r0 - .size EDMA_0_CH12_IRQHandler, . - EDMA_0_CH12_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH13_IRQHandler - .type EDMA_0_CH13_IRQHandler, %function -EDMA_0_CH13_IRQHandler: - ldr r0,=EDMA_0_CH13_DriverIRQHandler - bx r0 - .size EDMA_0_CH13_IRQHandler, . - EDMA_0_CH13_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH14_IRQHandler - .type EDMA_0_CH14_IRQHandler, %function -EDMA_0_CH14_IRQHandler: - ldr r0,=EDMA_0_CH14_DriverIRQHandler - bx r0 - .size EDMA_0_CH14_IRQHandler, . - EDMA_0_CH14_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH15_IRQHandler - .type EDMA_0_CH15_IRQHandler, %function -EDMA_0_CH15_IRQHandler: - ldr r0,=EDMA_0_CH15_DriverIRQHandler - bx r0 - .size EDMA_0_CH15_IRQHandler, . - EDMA_0_CH15_IRQHandler - - .align 1 - .thumb_func - .weak GPIO00_IRQHandler - .type GPIO00_IRQHandler, %function -GPIO00_IRQHandler: - ldr r0,=GPIO00_DriverIRQHandler - bx r0 - .size GPIO00_IRQHandler, . - GPIO00_IRQHandler - - .align 1 - .thumb_func - .weak GPIO01_IRQHandler - .type GPIO01_IRQHandler, %function -GPIO01_IRQHandler: - ldr r0,=GPIO01_DriverIRQHandler - bx r0 - .size GPIO01_IRQHandler, . - GPIO01_IRQHandler - - .align 1 - .thumb_func - .weak GPIO10_IRQHandler - .type GPIO10_IRQHandler, %function -GPIO10_IRQHandler: - ldr r0,=GPIO10_DriverIRQHandler - bx r0 - .size GPIO10_IRQHandler, . - GPIO10_IRQHandler - - .align 1 - .thumb_func - .weak GPIO11_IRQHandler - .type GPIO11_IRQHandler, %function -GPIO11_IRQHandler: - ldr r0,=GPIO11_DriverIRQHandler - bx r0 - .size GPIO11_IRQHandler, . - GPIO11_IRQHandler - - .align 1 - .thumb_func - .weak GPIO20_IRQHandler - .type GPIO20_IRQHandler, %function -GPIO20_IRQHandler: - ldr r0,=GPIO20_DriverIRQHandler - bx r0 - .size GPIO20_IRQHandler, . - GPIO20_IRQHandler - - .align 1 - .thumb_func - .weak GPIO21_IRQHandler - .type GPIO21_IRQHandler, %function -GPIO21_IRQHandler: - ldr r0,=GPIO21_DriverIRQHandler - bx r0 - .size GPIO21_IRQHandler, . - GPIO21_IRQHandler - - .align 1 - .thumb_func - .weak GPIO30_IRQHandler - .type GPIO30_IRQHandler, %function -GPIO30_IRQHandler: - ldr r0,=GPIO30_DriverIRQHandler - bx r0 - .size GPIO30_IRQHandler, . - GPIO30_IRQHandler - - .align 1 - .thumb_func - .weak GPIO31_IRQHandler - .type GPIO31_IRQHandler, %function -GPIO31_IRQHandler: - ldr r0,=GPIO31_DriverIRQHandler - bx r0 - .size GPIO31_IRQHandler, . - GPIO31_IRQHandler - - .align 1 - .thumb_func - .weak GPIO40_IRQHandler - .type GPIO40_IRQHandler, %function -GPIO40_IRQHandler: - ldr r0,=GPIO40_DriverIRQHandler - bx r0 - .size GPIO40_IRQHandler, . - GPIO40_IRQHandler - - .align 1 - .thumb_func - .weak GPIO41_IRQHandler - .type GPIO41_IRQHandler, %function -GPIO41_IRQHandler: - ldr r0,=GPIO41_DriverIRQHandler - bx r0 - .size GPIO41_IRQHandler, . - GPIO41_IRQHandler - - .align 1 - .thumb_func - .weak GPIO50_IRQHandler - .type GPIO50_IRQHandler, %function -GPIO50_IRQHandler: - ldr r0,=GPIO50_DriverIRQHandler - bx r0 - .size GPIO50_IRQHandler, . - GPIO50_IRQHandler - - .align 1 - .thumb_func - .weak GPIO51_IRQHandler - .type GPIO51_IRQHandler, %function -GPIO51_IRQHandler: - ldr r0,=GPIO51_DriverIRQHandler - bx r0 - .size GPIO51_IRQHandler, . - GPIO51_IRQHandler - - .align 1 - .thumb_func - .weak UTICK0_IRQHandler - .type UTICK0_IRQHandler, %function -UTICK0_IRQHandler: - ldr r0,=UTICK0_DriverIRQHandler - bx r0 - .size UTICK0_IRQHandler, . - UTICK0_IRQHandler - - .align 1 - .thumb_func - .weak MRT0_IRQHandler - .type MRT0_IRQHandler, %function -MRT0_IRQHandler: - ldr r0,=MRT0_DriverIRQHandler - bx r0 - .size MRT0_IRQHandler, . - MRT0_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER0_IRQHandler - .type CTIMER0_IRQHandler, %function -CTIMER0_IRQHandler: - ldr r0,=CTIMER0_DriverIRQHandler - bx r0 - .size CTIMER0_IRQHandler, . - CTIMER0_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER1_IRQHandler - .type CTIMER1_IRQHandler, %function -CTIMER1_IRQHandler: - ldr r0,=CTIMER1_DriverIRQHandler - bx r0 - .size CTIMER1_IRQHandler, . - CTIMER1_IRQHandler - - .align 1 - .thumb_func - .weak Reserved49_IRQHandler - .type Reserved49_IRQHandler, %function -Reserved49_IRQHandler: - ldr r0,=Reserved49_DriverIRQHandler - bx r0 - .size Reserved49_IRQHandler, . - Reserved49_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER2_IRQHandler - .type CTIMER2_IRQHandler, %function -CTIMER2_IRQHandler: - ldr r0,=CTIMER2_DriverIRQHandler - bx r0 - .size CTIMER2_IRQHandler, . - CTIMER2_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM0_IRQHandler - .type LP_FLEXCOMM0_IRQHandler, %function -LP_FLEXCOMM0_IRQHandler: - ldr r0,=LP_FLEXCOMM0_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM0_IRQHandler, . - LP_FLEXCOMM0_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM1_IRQHandler - .type LP_FLEXCOMM1_IRQHandler, %function -LP_FLEXCOMM1_IRQHandler: - ldr r0,=LP_FLEXCOMM1_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM1_IRQHandler, . - LP_FLEXCOMM1_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM2_IRQHandler - .type LP_FLEXCOMM2_IRQHandler, %function -LP_FLEXCOMM2_IRQHandler: - ldr r0,=LP_FLEXCOMM2_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM2_IRQHandler, . - LP_FLEXCOMM2_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM3_IRQHandler - .type LP_FLEXCOMM3_IRQHandler, %function -LP_FLEXCOMM3_IRQHandler: - ldr r0,=LP_FLEXCOMM3_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM3_IRQHandler, . - LP_FLEXCOMM3_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM4_IRQHandler - .type LP_FLEXCOMM4_IRQHandler, %function -LP_FLEXCOMM4_IRQHandler: - ldr r0,=LP_FLEXCOMM4_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM4_IRQHandler, . - LP_FLEXCOMM4_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM5_IRQHandler - .type LP_FLEXCOMM5_IRQHandler, %function -LP_FLEXCOMM5_IRQHandler: - ldr r0,=LP_FLEXCOMM5_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM5_IRQHandler, . - LP_FLEXCOMM5_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM6_IRQHandler - .type LP_FLEXCOMM6_IRQHandler, %function -LP_FLEXCOMM6_IRQHandler: - ldr r0,=LP_FLEXCOMM6_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM6_IRQHandler, . - LP_FLEXCOMM6_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM7_IRQHandler - .type LP_FLEXCOMM7_IRQHandler, %function -LP_FLEXCOMM7_IRQHandler: - ldr r0,=LP_FLEXCOMM7_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM7_IRQHandler, . - LP_FLEXCOMM7_IRQHandler - - .align 1 - .thumb_func - .weak Reserved59_IRQHandler - .type Reserved59_IRQHandler, %function -Reserved59_IRQHandler: - ldr r0,=Reserved59_DriverIRQHandler - bx r0 - .size Reserved59_IRQHandler, . - Reserved59_IRQHandler - - .align 1 - .thumb_func - .weak Reserved60_IRQHandler - .type Reserved60_IRQHandler, %function -Reserved60_IRQHandler: - ldr r0,=Reserved60_DriverIRQHandler - bx r0 - .size Reserved60_IRQHandler, . - Reserved60_IRQHandler - - .align 1 - .thumb_func - .weak ADC0_IRQHandler - .type ADC0_IRQHandler, %function -ADC0_IRQHandler: - ldr r0,=ADC0_DriverIRQHandler - bx r0 - .size ADC0_IRQHandler, . - ADC0_IRQHandler - - .align 1 - .thumb_func - .weak ADC1_IRQHandler - .type ADC1_IRQHandler, %function -ADC1_IRQHandler: - ldr r0,=ADC1_DriverIRQHandler - bx r0 - .size ADC1_IRQHandler, . - ADC1_IRQHandler - - .align 1 - .thumb_func - .weak PINT0_IRQHandler - .type PINT0_IRQHandler, %function -PINT0_IRQHandler: - ldr r0,=PINT0_DriverIRQHandler - bx r0 - .size PINT0_IRQHandler, . - PINT0_IRQHandler - - .align 1 - .thumb_func - .weak PDM_EVENT_IRQHandler - .type PDM_EVENT_IRQHandler, %function -PDM_EVENT_IRQHandler: - ldr r0,=PDM_EVENT_DriverIRQHandler - bx r0 - .size PDM_EVENT_IRQHandler, . - PDM_EVENT_IRQHandler - - .align 1 - .thumb_func - .weak Reserved65_IRQHandler - .type Reserved65_IRQHandler, %function -Reserved65_IRQHandler: - ldr r0,=Reserved65_DriverIRQHandler - bx r0 - .size Reserved65_IRQHandler, . - Reserved65_IRQHandler - - .align 1 - .thumb_func - .weak Reserved66_IRQHandler - .type Reserved66_IRQHandler, %function -Reserved66_IRQHandler: - ldr r0,=Reserved66_DriverIRQHandler - bx r0 - .size Reserved66_IRQHandler, . - Reserved66_IRQHandler - - .align 1 - .thumb_func - .weak USB0_DCD_IRQHandler - .type USB0_DCD_IRQHandler, %function -USB0_DCD_IRQHandler: - ldr r0,=USB0_DCD_DriverIRQHandler - bx r0 - .size USB0_DCD_IRQHandler, . - USB0_DCD_IRQHandler - - .align 1 - .thumb_func - .weak RTC_IRQHandler - .type RTC_IRQHandler, %function -RTC_IRQHandler: - ldr r0,=RTC_DriverIRQHandler - bx r0 - .size RTC_IRQHandler, . - RTC_IRQHandler - - .align 1 - .thumb_func - .weak SMARTDMA_IRQHandler - .type SMARTDMA_IRQHandler, %function -SMARTDMA_IRQHandler: - ldr r0,=SMARTDMA_DriverIRQHandler - bx r0 - .size SMARTDMA_IRQHandler, . - SMARTDMA_IRQHandler - - .align 1 - .thumb_func - .weak Reserved70_IRQHandler - .type Reserved70_IRQHandler, %function -Reserved70_IRQHandler: - ldr r0,=Reserved70_DriverIRQHandler - bx r0 - .size Reserved70_IRQHandler, . - Reserved70_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER3_IRQHandler - .type CTIMER3_IRQHandler, %function -CTIMER3_IRQHandler: - ldr r0,=CTIMER3_DriverIRQHandler - bx r0 - .size CTIMER3_IRQHandler, . - CTIMER3_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER4_IRQHandler - .type CTIMER4_IRQHandler, %function -CTIMER4_IRQHandler: - ldr r0,=CTIMER4_DriverIRQHandler - bx r0 - .size CTIMER4_IRQHandler, . - CTIMER4_IRQHandler - - .align 1 - .thumb_func - .weak OS_EVENT_IRQHandler - .type OS_EVENT_IRQHandler, %function -OS_EVENT_IRQHandler: - ldr r0,=OS_EVENT_DriverIRQHandler - bx r0 - .size OS_EVENT_IRQHandler, . - OS_EVENT_IRQHandler - - .align 1 - .thumb_func - .weak Reserved74_IRQHandler - .type Reserved74_IRQHandler, %function -Reserved74_IRQHandler: - ldr r0,=Reserved74_DriverIRQHandler - bx r0 - .size Reserved74_IRQHandler, . - Reserved74_IRQHandler - - .align 1 - .thumb_func - .weak SAI0_IRQHandler - .type SAI0_IRQHandler, %function -SAI0_IRQHandler: - ldr r0,=SAI0_DriverIRQHandler - bx r0 - .size SAI0_IRQHandler, . - SAI0_IRQHandler - - .align 1 - .thumb_func - .weak SAI1_IRQHandler - .type SAI1_IRQHandler, %function -SAI1_IRQHandler: - ldr r0,=SAI1_DriverIRQHandler - bx r0 - .size SAI1_IRQHandler, . - SAI1_IRQHandler - - .align 1 - .thumb_func - .weak Reserved77_IRQHandler - .type Reserved77_IRQHandler, %function -Reserved77_IRQHandler: - ldr r0,=Reserved77_DriverIRQHandler - bx r0 - .size Reserved77_IRQHandler, . - Reserved77_IRQHandler - - .align 1 - .thumb_func - .weak CAN0_IRQHandler - .type CAN0_IRQHandler, %function -CAN0_IRQHandler: - ldr r0,=CAN0_DriverIRQHandler - bx r0 - .size CAN0_IRQHandler, . - CAN0_IRQHandler - - .align 1 - .thumb_func - .weak CAN1_IRQHandler - .type CAN1_IRQHandler, %function -CAN1_IRQHandler: - ldr r0,=CAN1_DriverIRQHandler - bx r0 - .size CAN1_IRQHandler, . - CAN1_IRQHandler - - .align 1 - .thumb_func - .weak Reserved80_IRQHandler - .type Reserved80_IRQHandler, %function -Reserved80_IRQHandler: - ldr r0,=Reserved80_DriverIRQHandler - bx r0 - .size Reserved80_IRQHandler, . - Reserved80_IRQHandler - - .align 1 - .thumb_func - .weak Reserved81_IRQHandler - .type Reserved81_IRQHandler, %function -Reserved81_IRQHandler: - ldr r0,=Reserved81_DriverIRQHandler - bx r0 - .size Reserved81_IRQHandler, . - Reserved81_IRQHandler - - .align 1 - .thumb_func - .weak USB1_HS_PHY_IRQHandler - .type USB1_HS_PHY_IRQHandler, %function -USB1_HS_PHY_IRQHandler: - ldr r0,=USB1_HS_PHY_DriverIRQHandler - bx r0 - .size USB1_HS_PHY_IRQHandler, . - USB1_HS_PHY_IRQHandler - - .align 1 - .thumb_func - .weak USB1_HS_IRQHandler - .type USB1_HS_IRQHandler, %function -USB1_HS_IRQHandler: - ldr r0,=USB1_HS_DriverIRQHandler - bx r0 - .size USB1_HS_IRQHandler, . - USB1_HS_IRQHandler - - .align 1 - .thumb_func - .weak SEC_HYPERVISOR_CALL_IRQHandler - .type SEC_HYPERVISOR_CALL_IRQHandler, %function -SEC_HYPERVISOR_CALL_IRQHandler: - ldr r0,=SEC_HYPERVISOR_CALL_DriverIRQHandler - bx r0 - .size SEC_HYPERVISOR_CALL_IRQHandler, . - SEC_HYPERVISOR_CALL_IRQHandler - - .align 1 - .thumb_func - .weak Reserved85_IRQHandler - .type Reserved85_IRQHandler, %function -Reserved85_IRQHandler: - ldr r0,=Reserved85_DriverIRQHandler - bx r0 - .size Reserved85_IRQHandler, . - Reserved85_IRQHandler - - .align 1 - .thumb_func - .weak Reserved86_IRQHandler - .type Reserved86_IRQHandler, %function -Reserved86_IRQHandler: - ldr r0,=Reserved86_DriverIRQHandler - bx r0 - .size Reserved86_IRQHandler, . - Reserved86_IRQHandler - - .align 1 - .thumb_func - .weak Freqme_IRQHandler - .type Freqme_IRQHandler, %function -Freqme_IRQHandler: - ldr r0,=Freqme_DriverIRQHandler - bx r0 - .size Freqme_IRQHandler, . - Freqme_IRQHandler - - .align 1 - .thumb_func - .weak SEC_VIO_IRQHandler - .type SEC_VIO_IRQHandler, %function -SEC_VIO_IRQHandler: - ldr r0,=SEC_VIO_DriverIRQHandler - bx r0 - .size SEC_VIO_IRQHandler, . - SEC_VIO_IRQHandler - - .align 1 - .thumb_func - .weak ELS_IRQHandler - .type ELS_IRQHandler, %function -ELS_IRQHandler: - ldr r0,=ELS_DriverIRQHandler - bx r0 - .size ELS_IRQHandler, . - ELS_IRQHandler - - .align 1 - .thumb_func - .weak PKC_IRQHandler - .type PKC_IRQHandler, %function -PKC_IRQHandler: - ldr r0,=PKC_DriverIRQHandler - bx r0 - .size PKC_IRQHandler, . - PKC_IRQHandler - - .align 1 - .thumb_func - .weak PUF_IRQHandler - .type PUF_IRQHandler, %function -PUF_IRQHandler: - ldr r0,=PUF_DriverIRQHandler - bx r0 - .size PUF_IRQHandler, . - PUF_IRQHandler - - .align 1 - .thumb_func - .weak Reserved92_IRQHandler - .type Reserved92_IRQHandler, %function -Reserved92_IRQHandler: - ldr r0,=Reserved92_DriverIRQHandler - bx r0 - .size Reserved92_IRQHandler, . - Reserved92_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH0_IRQHandler - .type EDMA_1_CH0_IRQHandler, %function -EDMA_1_CH0_IRQHandler: - ldr r0,=EDMA_1_CH0_DriverIRQHandler - bx r0 - .size EDMA_1_CH0_IRQHandler, . - EDMA_1_CH0_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH1_IRQHandler - .type EDMA_1_CH1_IRQHandler, %function -EDMA_1_CH1_IRQHandler: - ldr r0,=EDMA_1_CH1_DriverIRQHandler - bx r0 - .size EDMA_1_CH1_IRQHandler, . - EDMA_1_CH1_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH2_IRQHandler - .type EDMA_1_CH2_IRQHandler, %function -EDMA_1_CH2_IRQHandler: - ldr r0,=EDMA_1_CH2_DriverIRQHandler - bx r0 - .size EDMA_1_CH2_IRQHandler, . - EDMA_1_CH2_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH3_IRQHandler - .type EDMA_1_CH3_IRQHandler, %function -EDMA_1_CH3_IRQHandler: - ldr r0,=EDMA_1_CH3_DriverIRQHandler - bx r0 - .size EDMA_1_CH3_IRQHandler, . - EDMA_1_CH3_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH4_IRQHandler - .type EDMA_1_CH4_IRQHandler, %function -EDMA_1_CH4_IRQHandler: - ldr r0,=EDMA_1_CH4_DriverIRQHandler - bx r0 - .size EDMA_1_CH4_IRQHandler, . - EDMA_1_CH4_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH5_IRQHandler - .type EDMA_1_CH5_IRQHandler, %function -EDMA_1_CH5_IRQHandler: - ldr r0,=EDMA_1_CH5_DriverIRQHandler - bx r0 - .size EDMA_1_CH5_IRQHandler, . - EDMA_1_CH5_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH6_IRQHandler - .type EDMA_1_CH6_IRQHandler, %function -EDMA_1_CH6_IRQHandler: - ldr r0,=EDMA_1_CH6_DriverIRQHandler - bx r0 - .size EDMA_1_CH6_IRQHandler, . - EDMA_1_CH6_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH7_IRQHandler - .type EDMA_1_CH7_IRQHandler, %function -EDMA_1_CH7_IRQHandler: - ldr r0,=EDMA_1_CH7_DriverIRQHandler - bx r0 - .size EDMA_1_CH7_IRQHandler, . - EDMA_1_CH7_IRQHandler - - .align 1 - .thumb_func - .weak Reserved101_IRQHandler - .type Reserved101_IRQHandler, %function -Reserved101_IRQHandler: - ldr r0,=Reserved101_DriverIRQHandler - bx r0 - .size Reserved101_IRQHandler, . - Reserved101_IRQHandler - - .align 1 - .thumb_func - .weak Reserved102_IRQHandler - .type Reserved102_IRQHandler, %function -Reserved102_IRQHandler: - ldr r0,=Reserved102_DriverIRQHandler - bx r0 - .size Reserved102_IRQHandler, . - Reserved102_IRQHandler - - .align 1 - .thumb_func - .weak Reserved103_IRQHandler - .type Reserved103_IRQHandler, %function -Reserved103_IRQHandler: - ldr r0,=Reserved103_DriverIRQHandler - bx r0 - .size Reserved103_IRQHandler, . - Reserved103_IRQHandler - - .align 1 - .thumb_func - .weak Reserved104_IRQHandler - .type Reserved104_IRQHandler, %function -Reserved104_IRQHandler: - ldr r0,=Reserved104_DriverIRQHandler - bx r0 - .size Reserved104_IRQHandler, . - Reserved104_IRQHandler - - .align 1 - .thumb_func - .weak Reserved105_IRQHandler - .type Reserved105_IRQHandler, %function -Reserved105_IRQHandler: - ldr r0,=Reserved105_DriverIRQHandler - bx r0 - .size Reserved105_IRQHandler, . - Reserved105_IRQHandler - - .align 1 - .thumb_func - .weak Reserved106_IRQHandler - .type Reserved106_IRQHandler, %function -Reserved106_IRQHandler: - ldr r0,=Reserved106_DriverIRQHandler - bx r0 - .size Reserved106_IRQHandler, . - Reserved106_IRQHandler - - .align 1 - .thumb_func - .weak Reserved107_IRQHandler - .type Reserved107_IRQHandler, %function -Reserved107_IRQHandler: - ldr r0,=Reserved107_DriverIRQHandler - bx r0 - .size Reserved107_IRQHandler, . - Reserved107_IRQHandler - - .align 1 - .thumb_func - .weak Reserved108_IRQHandler - .type Reserved108_IRQHandler, %function -Reserved108_IRQHandler: - ldr r0,=Reserved108_DriverIRQHandler - bx r0 - .size Reserved108_IRQHandler, . - Reserved108_IRQHandler - - .align 1 - .thumb_func - .weak CDOG0_IRQHandler - .type CDOG0_IRQHandler, %function -CDOG0_IRQHandler: - ldr r0,=CDOG0_DriverIRQHandler - bx r0 - .size CDOG0_IRQHandler, . - CDOG0_IRQHandler - - .align 1 - .thumb_func - .weak CDOG1_IRQHandler - .type CDOG1_IRQHandler, %function -CDOG1_IRQHandler: - ldr r0,=CDOG1_DriverIRQHandler - bx r0 - .size CDOG1_IRQHandler, . - CDOG1_IRQHandler - - .align 1 - .thumb_func - .weak I3C0_IRQHandler - .type I3C0_IRQHandler, %function -I3C0_IRQHandler: - ldr r0,=I3C0_DriverIRQHandler - bx r0 - .size I3C0_IRQHandler, . - I3C0_IRQHandler - - .align 1 - .thumb_func - .weak I3C1_IRQHandler - .type I3C1_IRQHandler, %function -I3C1_IRQHandler: - ldr r0,=I3C1_DriverIRQHandler - bx r0 - .size I3C1_IRQHandler, . - I3C1_IRQHandler - - .align 1 - .thumb_func - .weak Reserved113_IRQHandler - .type Reserved113_IRQHandler, %function -Reserved113_IRQHandler: - ldr r0,=Reserved113_DriverIRQHandler - bx r0 - .size Reserved113_IRQHandler, . - Reserved113_IRQHandler - - .align 1 - .thumb_func - .weak GDET_IRQHandler - .type GDET_IRQHandler, %function -GDET_IRQHandler: - ldr r0,=GDET_DriverIRQHandler - bx r0 - .size GDET_IRQHandler, . - GDET_IRQHandler - - .align 1 - .thumb_func - .weak VBAT0_IRQHandler - .type VBAT0_IRQHandler, %function -VBAT0_IRQHandler: - ldr r0,=VBAT0_DriverIRQHandler - bx r0 - .size VBAT0_IRQHandler, . - VBAT0_IRQHandler - - .align 1 - .thumb_func - .weak EWM0_IRQHandler - .type EWM0_IRQHandler, %function -EWM0_IRQHandler: - ldr r0,=EWM0_DriverIRQHandler - bx r0 - .size EWM0_IRQHandler, . - EWM0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved117_IRQHandler - .type Reserved117_IRQHandler, %function -Reserved117_IRQHandler: - ldr r0,=Reserved117_DriverIRQHandler - bx r0 - .size Reserved117_IRQHandler, . - Reserved117_IRQHandler - - .align 1 - .thumb_func - .weak Reserved118_IRQHandler - .type Reserved118_IRQHandler, %function -Reserved118_IRQHandler: - ldr r0,=Reserved118_DriverIRQHandler - bx r0 - .size Reserved118_IRQHandler, . - Reserved118_IRQHandler - - .align 1 - .thumb_func - .weak Reserved119_IRQHandler - .type Reserved119_IRQHandler, %function -Reserved119_IRQHandler: - ldr r0,=Reserved119_DriverIRQHandler - bx r0 - .size Reserved119_IRQHandler, . - Reserved119_IRQHandler - - .align 1 - .thumb_func - .weak Reserved120_IRQHandler - .type Reserved120_IRQHandler, %function -Reserved120_IRQHandler: - ldr r0,=Reserved120_DriverIRQHandler - bx r0 - .size Reserved120_IRQHandler, . - Reserved120_IRQHandler - - .align 1 - .thumb_func - .weak FLEXIO_IRQHandler - .type FLEXIO_IRQHandler, %function -FLEXIO_IRQHandler: - ldr r0,=FLEXIO_DriverIRQHandler - bx r0 - .size FLEXIO_IRQHandler, . - FLEXIO_IRQHandler - - .align 1 - .thumb_func - .weak Reserved122_IRQHandler - .type Reserved122_IRQHandler, %function -Reserved122_IRQHandler: - ldr r0,=Reserved122_DriverIRQHandler - bx r0 - .size Reserved122_IRQHandler, . - Reserved122_IRQHandler - - .align 1 - .thumb_func - .weak Reserved123_IRQHandler - .type Reserved123_IRQHandler, %function -Reserved123_IRQHandler: - ldr r0,=Reserved123_DriverIRQHandler - bx r0 - .size Reserved123_IRQHandler, . - Reserved123_IRQHandler - - .align 1 - .thumb_func - .weak Reserved124_IRQHandler - .type Reserved124_IRQHandler, %function -Reserved124_IRQHandler: - ldr r0,=Reserved124_DriverIRQHandler - bx r0 - .size Reserved124_IRQHandler, . - Reserved124_IRQHandler - - .align 1 - .thumb_func - .weak HSCMP0_IRQHandler - .type HSCMP0_IRQHandler, %function -HSCMP0_IRQHandler: - ldr r0,=HSCMP0_DriverIRQHandler - bx r0 - .size HSCMP0_IRQHandler, . - HSCMP0_IRQHandler - - .align 1 - .thumb_func - .weak HSCMP1_IRQHandler - .type HSCMP1_IRQHandler, %function -HSCMP1_IRQHandler: - ldr r0,=HSCMP1_DriverIRQHandler - bx r0 - .size HSCMP1_IRQHandler, . - HSCMP1_IRQHandler - - .align 1 - .thumb_func - .weak Reserved127_IRQHandler - .type Reserved127_IRQHandler, %function -Reserved127_IRQHandler: - ldr r0,=Reserved127_DriverIRQHandler - bx r0 - .size Reserved127_IRQHandler, . - Reserved127_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_RELOAD_ERROR_IRQHandler - .type FLEXPWM0_RELOAD_ERROR_IRQHandler, %function -FLEXPWM0_RELOAD_ERROR_IRQHandler: - ldr r0,=FLEXPWM0_RELOAD_ERROR_DriverIRQHandler - bx r0 - .size FLEXPWM0_RELOAD_ERROR_IRQHandler, . - FLEXPWM0_RELOAD_ERROR_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_FAULT_IRQHandler - .type FLEXPWM0_FAULT_IRQHandler, %function -FLEXPWM0_FAULT_IRQHandler: - ldr r0,=FLEXPWM0_FAULT_DriverIRQHandler - bx r0 - .size FLEXPWM0_FAULT_IRQHandler, . - FLEXPWM0_FAULT_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE0_IRQHandler - .type FLEXPWM0_SUBMODULE0_IRQHandler, %function -FLEXPWM0_SUBMODULE0_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE0_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE0_IRQHandler, . - FLEXPWM0_SUBMODULE0_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE1_IRQHandler - .type FLEXPWM0_SUBMODULE1_IRQHandler, %function -FLEXPWM0_SUBMODULE1_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE1_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE1_IRQHandler, . - FLEXPWM0_SUBMODULE1_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE2_IRQHandler - .type FLEXPWM0_SUBMODULE2_IRQHandler, %function -FLEXPWM0_SUBMODULE2_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE2_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE2_IRQHandler, . - FLEXPWM0_SUBMODULE2_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE3_IRQHandler - .type FLEXPWM0_SUBMODULE3_IRQHandler, %function -FLEXPWM0_SUBMODULE3_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE3_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE3_IRQHandler, . - FLEXPWM0_SUBMODULE3_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_RELOAD_ERROR_IRQHandler - .type FLEXPWM1_RELOAD_ERROR_IRQHandler, %function -FLEXPWM1_RELOAD_ERROR_IRQHandler: - ldr r0,=FLEXPWM1_RELOAD_ERROR_DriverIRQHandler - bx r0 - .size FLEXPWM1_RELOAD_ERROR_IRQHandler, . - FLEXPWM1_RELOAD_ERROR_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_FAULT_IRQHandler - .type FLEXPWM1_FAULT_IRQHandler, %function -FLEXPWM1_FAULT_IRQHandler: - ldr r0,=FLEXPWM1_FAULT_DriverIRQHandler - bx r0 - .size FLEXPWM1_FAULT_IRQHandler, . - FLEXPWM1_FAULT_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_SUBMODULE0_IRQHandler - .type FLEXPWM1_SUBMODULE0_IRQHandler, %function -FLEXPWM1_SUBMODULE0_IRQHandler: - ldr r0,=FLEXPWM1_SUBMODULE0_DriverIRQHandler - bx r0 - .size FLEXPWM1_SUBMODULE0_IRQHandler, . - FLEXPWM1_SUBMODULE0_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_SUBMODULE1_IRQHandler - .type FLEXPWM1_SUBMODULE1_IRQHandler, %function -FLEXPWM1_SUBMODULE1_IRQHandler: - ldr r0,=FLEXPWM1_SUBMODULE1_DriverIRQHandler - bx r0 - .size FLEXPWM1_SUBMODULE1_IRQHandler, . - FLEXPWM1_SUBMODULE1_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_SUBMODULE2_IRQHandler - .type FLEXPWM1_SUBMODULE2_IRQHandler, %function -FLEXPWM1_SUBMODULE2_IRQHandler: - ldr r0,=FLEXPWM1_SUBMODULE2_DriverIRQHandler - bx r0 - .size FLEXPWM1_SUBMODULE2_IRQHandler, . - FLEXPWM1_SUBMODULE2_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_SUBMODULE3_IRQHandler - .type FLEXPWM1_SUBMODULE3_IRQHandler, %function -FLEXPWM1_SUBMODULE3_IRQHandler: - ldr r0,=FLEXPWM1_SUBMODULE3_DriverIRQHandler - bx r0 - .size FLEXPWM1_SUBMODULE3_IRQHandler, . - FLEXPWM1_SUBMODULE3_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_COMPARE_IRQHandler - .type QDC0_COMPARE_IRQHandler, %function -QDC0_COMPARE_IRQHandler: - ldr r0,=QDC0_COMPARE_DriverIRQHandler - bx r0 - .size QDC0_COMPARE_IRQHandler, . - QDC0_COMPARE_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_HOME_IRQHandler - .type QDC0_HOME_IRQHandler, %function -QDC0_HOME_IRQHandler: - ldr r0,=QDC0_HOME_DriverIRQHandler - bx r0 - .size QDC0_HOME_IRQHandler, . - QDC0_HOME_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_WDG_SAB_IRQHandler - .type QDC0_WDG_SAB_IRQHandler, %function -QDC0_WDG_SAB_IRQHandler: - ldr r0,=QDC0_WDG_SAB_DriverIRQHandler - bx r0 - .size QDC0_WDG_SAB_IRQHandler, . - QDC0_WDG_SAB_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_IDX_IRQHandler - .type QDC0_IDX_IRQHandler, %function -QDC0_IDX_IRQHandler: - ldr r0,=QDC0_IDX_DriverIRQHandler - bx r0 - .size QDC0_IDX_IRQHandler, . - QDC0_IDX_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_COMPARE_IRQHandler - .type QDC1_COMPARE_IRQHandler, %function -QDC1_COMPARE_IRQHandler: - ldr r0,=QDC1_COMPARE_DriverIRQHandler - bx r0 - .size QDC1_COMPARE_IRQHandler, . - QDC1_COMPARE_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_HOME_IRQHandler - .type QDC1_HOME_IRQHandler, %function -QDC1_HOME_IRQHandler: - ldr r0,=QDC1_HOME_DriverIRQHandler - bx r0 - .size QDC1_HOME_IRQHandler, . - QDC1_HOME_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_WDG_SAB_IRQHandler - .type QDC1_WDG_SAB_IRQHandler, %function -QDC1_WDG_SAB_IRQHandler: - ldr r0,=QDC1_WDG_SAB_DriverIRQHandler - bx r0 - .size QDC1_WDG_SAB_IRQHandler, . - QDC1_WDG_SAB_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_IDX_IRQHandler - .type QDC1_IDX_IRQHandler, %function -QDC1_IDX_IRQHandler: - ldr r0,=QDC1_IDX_DriverIRQHandler - bx r0 - .size QDC1_IDX_IRQHandler, . - QDC1_IDX_IRQHandler - - .align 1 - .thumb_func - .weak ITRC0_IRQHandler - .type ITRC0_IRQHandler, %function -ITRC0_IRQHandler: - ldr r0,=ITRC0_DriverIRQHandler - bx r0 - .size ITRC0_IRQHandler, . - ITRC0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved149_IRQHandler - .type Reserved149_IRQHandler, %function -Reserved149_IRQHandler: - ldr r0,=Reserved149_DriverIRQHandler - bx r0 - .size Reserved149_IRQHandler, . - Reserved149_IRQHandler - - .align 1 - .thumb_func - .weak ELS_ERR_IRQHandler - .type ELS_ERR_IRQHandler, %function -ELS_ERR_IRQHandler: - ldr r0,=ELS_ERR_DriverIRQHandler - bx r0 - .size ELS_ERR_IRQHandler, . - ELS_ERR_IRQHandler - - .align 1 - .thumb_func - .weak PKC_ERR_IRQHandler - .type PKC_ERR_IRQHandler, %function -PKC_ERR_IRQHandler: - ldr r0,=PKC_ERR_DriverIRQHandler - bx r0 - .size PKC_ERR_IRQHandler, . - PKC_ERR_IRQHandler - - .align 1 - .thumb_func - .weak ERM_SINGLE_BIT_ERROR_IRQHandler - .type ERM_SINGLE_BIT_ERROR_IRQHandler, %function -ERM_SINGLE_BIT_ERROR_IRQHandler: - ldr r0,=ERM_SINGLE_BIT_ERROR_DriverIRQHandler - bx r0 - .size ERM_SINGLE_BIT_ERROR_IRQHandler, . - ERM_SINGLE_BIT_ERROR_IRQHandler - - .align 1 - .thumb_func - .weak ERM_MULTI_BIT_ERROR_IRQHandler - .type ERM_MULTI_BIT_ERROR_IRQHandler, %function -ERM_MULTI_BIT_ERROR_IRQHandler: - ldr r0,=ERM_MULTI_BIT_ERROR_DriverIRQHandler - bx r0 - .size ERM_MULTI_BIT_ERROR_IRQHandler, . - ERM_MULTI_BIT_ERROR_IRQHandler - - .align 1 - .thumb_func - .weak FMU0_IRQHandler - .type FMU0_IRQHandler, %function -FMU0_IRQHandler: - ldr r0,=FMU0_DriverIRQHandler - bx r0 - .size FMU0_IRQHandler, . - FMU0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved155_IRQHandler - .type Reserved155_IRQHandler, %function -Reserved155_IRQHandler: - ldr r0,=Reserved155_DriverIRQHandler - bx r0 - .size Reserved155_IRQHandler, . - Reserved155_IRQHandler - - .align 1 - .thumb_func - .weak Reserved156_IRQHandler - .type Reserved156_IRQHandler, %function -Reserved156_IRQHandler: - ldr r0,=Reserved156_DriverIRQHandler - bx r0 - .size Reserved156_IRQHandler, . - Reserved156_IRQHandler - - .align 1 - .thumb_func - .weak Reserved157_IRQHandler - .type Reserved157_IRQHandler, %function -Reserved157_IRQHandler: - ldr r0,=Reserved157_DriverIRQHandler - bx r0 - .size Reserved157_IRQHandler, . - Reserved157_IRQHandler - - .align 1 - .thumb_func - .weak Reserved158_IRQHandler - .type Reserved158_IRQHandler, %function -Reserved158_IRQHandler: - ldr r0,=Reserved158_DriverIRQHandler - bx r0 - .size Reserved158_IRQHandler, . - Reserved158_IRQHandler - - .align 1 - .thumb_func - .weak LPTMR0_IRQHandler - .type LPTMR0_IRQHandler, %function -LPTMR0_IRQHandler: - ldr r0,=LPTMR0_DriverIRQHandler - bx r0 - .size LPTMR0_IRQHandler, . - LPTMR0_IRQHandler - - .align 1 - .thumb_func - .weak LPTMR1_IRQHandler - .type LPTMR1_IRQHandler, %function -LPTMR1_IRQHandler: - ldr r0,=LPTMR1_DriverIRQHandler - bx r0 - .size LPTMR1_IRQHandler, . - LPTMR1_IRQHandler - - .align 1 - .thumb_func - .weak SCG_IRQHandler - .type SCG_IRQHandler, %function -SCG_IRQHandler: - ldr r0,=SCG_DriverIRQHandler - bx r0 - .size SCG_IRQHandler, . - SCG_IRQHandler - - .align 1 - .thumb_func - .weak SPC_IRQHandler - .type SPC_IRQHandler, %function -SPC_IRQHandler: - ldr r0,=SPC_DriverIRQHandler - bx r0 - .size SPC_IRQHandler, . - SPC_IRQHandler - - .align 1 - .thumb_func - .weak WUU_IRQHandler - .type WUU_IRQHandler, %function -WUU_IRQHandler: - ldr r0,=WUU_DriverIRQHandler - bx r0 - .size WUU_IRQHandler, . - WUU_IRQHandler - - .align 1 - .thumb_func - .weak PORT_EFT_IRQHandler - .type PORT_EFT_IRQHandler, %function -PORT_EFT_IRQHandler: - ldr r0,=PORT_EFT_DriverIRQHandler - bx r0 - .size PORT_EFT_IRQHandler, . - PORT_EFT_IRQHandler - - .align 1 - .thumb_func - .weak Reserved165_IRQHandler - .type Reserved165_IRQHandler, %function -Reserved165_IRQHandler: - ldr r0,=Reserved165_DriverIRQHandler - bx r0 - .size Reserved165_IRQHandler, . - Reserved165_IRQHandler - - .align 1 - .thumb_func - .weak Reserved166_IRQHandler - .type Reserved166_IRQHandler, %function -Reserved166_IRQHandler: - ldr r0,=Reserved166_DriverIRQHandler - bx r0 - .size Reserved166_IRQHandler, . - Reserved166_IRQHandler - - .align 1 - .thumb_func - .weak Reserved167_IRQHandler - .type Reserved167_IRQHandler, %function -Reserved167_IRQHandler: - ldr r0,=Reserved167_DriverIRQHandler - bx r0 - .size Reserved167_IRQHandler, . - Reserved167_IRQHandler - - .align 1 - .thumb_func - .weak WWDT0_IRQHandler - .type WWDT0_IRQHandler, %function -WWDT0_IRQHandler: - ldr r0,=WWDT0_DriverIRQHandler - bx r0 - .size WWDT0_IRQHandler, . - WWDT0_IRQHandler - - .align 1 - .thumb_func - .weak WWDT1_IRQHandler - .type WWDT1_IRQHandler, %function -WWDT1_IRQHandler: - ldr r0,=WWDT1_DriverIRQHandler - bx r0 - .size WWDT1_IRQHandler, . - WWDT1_IRQHandler - - .align 1 - .thumb_func - .weak CMC0_IRQHandler - .type CMC0_IRQHandler, %function -CMC0_IRQHandler: - ldr r0,=CMC0_DriverIRQHandler - bx r0 - .size CMC0_IRQHandler, . - CMC0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved171_IRQHandler - .type Reserved171_IRQHandler, %function -Reserved171_IRQHandler: - ldr r0,=Reserved171_DriverIRQHandler - bx r0 - .size Reserved171_IRQHandler, . - Reserved171_IRQHandler - - -/* Macro to define default handlers. Default handler - * will be weak symbol and just dead loops. They can be - * overwritten by other handlers */ - .macro def_irq_handler handler_name - .weak \handler_name - .set \handler_name, DefaultISR - .endm -/* Exception Handlers */ - def_irq_handler MemManage_Handler - def_irq_handler BusFault_Handler - def_irq_handler UsageFault_Handler - def_irq_handler SecureFault_Handler - def_irq_handler DebugMon_Handler - def_irq_handler OR_DriverIRQHandler - def_irq_handler EDMA_0_CH0_DriverIRQHandler - def_irq_handler EDMA_0_CH1_DriverIRQHandler - def_irq_handler EDMA_0_CH2_DriverIRQHandler - def_irq_handler EDMA_0_CH3_DriverIRQHandler - def_irq_handler EDMA_0_CH4_DriverIRQHandler - def_irq_handler EDMA_0_CH5_DriverIRQHandler - def_irq_handler EDMA_0_CH6_DriverIRQHandler - def_irq_handler EDMA_0_CH7_DriverIRQHandler - def_irq_handler EDMA_0_CH8_DriverIRQHandler - def_irq_handler EDMA_0_CH9_DriverIRQHandler - def_irq_handler EDMA_0_CH10_DriverIRQHandler - def_irq_handler EDMA_0_CH11_DriverIRQHandler - def_irq_handler EDMA_0_CH12_DriverIRQHandler - def_irq_handler EDMA_0_CH13_DriverIRQHandler - def_irq_handler EDMA_0_CH14_DriverIRQHandler - def_irq_handler EDMA_0_CH15_DriverIRQHandler - def_irq_handler GPIO00_DriverIRQHandler - def_irq_handler GPIO01_DriverIRQHandler - def_irq_handler GPIO10_DriverIRQHandler - def_irq_handler GPIO11_DriverIRQHandler - def_irq_handler GPIO20_DriverIRQHandler - def_irq_handler GPIO21_DriverIRQHandler - def_irq_handler GPIO30_DriverIRQHandler - def_irq_handler GPIO31_DriverIRQHandler - def_irq_handler GPIO40_DriverIRQHandler - def_irq_handler GPIO41_DriverIRQHandler - def_irq_handler GPIO50_DriverIRQHandler - def_irq_handler GPIO51_DriverIRQHandler - def_irq_handler UTICK0_DriverIRQHandler - def_irq_handler MRT0_DriverIRQHandler - def_irq_handler CTIMER0_DriverIRQHandler - def_irq_handler CTIMER1_DriverIRQHandler - def_irq_handler Reserved49_DriverIRQHandler - def_irq_handler CTIMER2_DriverIRQHandler - def_irq_handler LP_FLEXCOMM0_DriverIRQHandler - def_irq_handler LP_FLEXCOMM1_DriverIRQHandler - def_irq_handler LP_FLEXCOMM2_DriverIRQHandler - def_irq_handler LP_FLEXCOMM3_DriverIRQHandler - def_irq_handler LP_FLEXCOMM4_DriverIRQHandler - def_irq_handler LP_FLEXCOMM5_DriverIRQHandler - def_irq_handler LP_FLEXCOMM6_DriverIRQHandler - def_irq_handler LP_FLEXCOMM7_DriverIRQHandler - def_irq_handler Reserved59_DriverIRQHandler - def_irq_handler Reserved60_DriverIRQHandler - def_irq_handler ADC0_DriverIRQHandler - def_irq_handler ADC1_DriverIRQHandler - def_irq_handler PINT0_DriverIRQHandler - def_irq_handler PDM_EVENT_DriverIRQHandler - def_irq_handler Reserved65_DriverIRQHandler - def_irq_handler Reserved66_DriverIRQHandler - def_irq_handler USB0_DCD_DriverIRQHandler - def_irq_handler RTC_DriverIRQHandler - def_irq_handler SMARTDMA_DriverIRQHandler - def_irq_handler Reserved70_DriverIRQHandler - def_irq_handler CTIMER3_DriverIRQHandler - def_irq_handler CTIMER4_DriverIRQHandler - def_irq_handler OS_EVENT_DriverIRQHandler - def_irq_handler Reserved74_DriverIRQHandler - def_irq_handler SAI0_DriverIRQHandler - def_irq_handler SAI1_DriverIRQHandler - def_irq_handler Reserved77_DriverIRQHandler - def_irq_handler CAN0_DriverIRQHandler - def_irq_handler CAN1_DriverIRQHandler - def_irq_handler Reserved80_DriverIRQHandler - def_irq_handler Reserved81_DriverIRQHandler - def_irq_handler USB1_HS_PHY_DriverIRQHandler - def_irq_handler USB1_HS_DriverIRQHandler - def_irq_handler SEC_HYPERVISOR_CALL_DriverIRQHandler - def_irq_handler Reserved85_DriverIRQHandler - def_irq_handler Reserved86_DriverIRQHandler - def_irq_handler Freqme_DriverIRQHandler - def_irq_handler SEC_VIO_DriverIRQHandler - def_irq_handler ELS_DriverIRQHandler - def_irq_handler PKC_DriverIRQHandler - def_irq_handler PUF_DriverIRQHandler - def_irq_handler Reserved92_DriverIRQHandler - def_irq_handler EDMA_1_CH0_DriverIRQHandler - def_irq_handler EDMA_1_CH1_DriverIRQHandler - def_irq_handler EDMA_1_CH2_DriverIRQHandler - def_irq_handler EDMA_1_CH3_DriverIRQHandler - def_irq_handler EDMA_1_CH4_DriverIRQHandler - def_irq_handler EDMA_1_CH5_DriverIRQHandler - def_irq_handler EDMA_1_CH6_DriverIRQHandler - def_irq_handler EDMA_1_CH7_DriverIRQHandler - def_irq_handler Reserved101_DriverIRQHandler - def_irq_handler Reserved102_DriverIRQHandler - def_irq_handler Reserved103_DriverIRQHandler - def_irq_handler Reserved104_DriverIRQHandler - def_irq_handler Reserved105_DriverIRQHandler - def_irq_handler Reserved106_DriverIRQHandler - def_irq_handler Reserved107_DriverIRQHandler - def_irq_handler Reserved108_DriverIRQHandler - def_irq_handler CDOG0_DriverIRQHandler - def_irq_handler CDOG1_DriverIRQHandler - def_irq_handler I3C0_DriverIRQHandler - def_irq_handler I3C1_DriverIRQHandler - def_irq_handler Reserved113_DriverIRQHandler - def_irq_handler GDET_DriverIRQHandler - def_irq_handler VBAT0_DriverIRQHandler - def_irq_handler EWM0_DriverIRQHandler - def_irq_handler Reserved117_DriverIRQHandler - def_irq_handler Reserved118_DriverIRQHandler - def_irq_handler Reserved119_DriverIRQHandler - def_irq_handler Reserved120_DriverIRQHandler - def_irq_handler FLEXIO_DriverIRQHandler - def_irq_handler Reserved122_DriverIRQHandler - def_irq_handler Reserved123_DriverIRQHandler - def_irq_handler Reserved124_DriverIRQHandler - def_irq_handler HSCMP0_DriverIRQHandler - def_irq_handler HSCMP1_DriverIRQHandler - def_irq_handler Reserved127_DriverIRQHandler - def_irq_handler FLEXPWM0_RELOAD_ERROR_DriverIRQHandler - def_irq_handler FLEXPWM0_FAULT_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE0_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE1_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE2_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE3_DriverIRQHandler - def_irq_handler FLEXPWM1_RELOAD_ERROR_DriverIRQHandler - def_irq_handler FLEXPWM1_FAULT_DriverIRQHandler - def_irq_handler FLEXPWM1_SUBMODULE0_DriverIRQHandler - def_irq_handler FLEXPWM1_SUBMODULE1_DriverIRQHandler - def_irq_handler FLEXPWM1_SUBMODULE2_DriverIRQHandler - def_irq_handler FLEXPWM1_SUBMODULE3_DriverIRQHandler - def_irq_handler QDC0_COMPARE_DriverIRQHandler - def_irq_handler QDC0_HOME_DriverIRQHandler - def_irq_handler QDC0_WDG_SAB_DriverIRQHandler - def_irq_handler QDC0_IDX_DriverIRQHandler - def_irq_handler QDC1_COMPARE_DriverIRQHandler - def_irq_handler QDC1_HOME_DriverIRQHandler - def_irq_handler QDC1_WDG_SAB_DriverIRQHandler - def_irq_handler QDC1_IDX_DriverIRQHandler - def_irq_handler ITRC0_DriverIRQHandler - def_irq_handler Reserved149_DriverIRQHandler - def_irq_handler ELS_ERR_DriverIRQHandler - def_irq_handler PKC_ERR_DriverIRQHandler - def_irq_handler ERM_SINGLE_BIT_ERROR_DriverIRQHandler - def_irq_handler ERM_MULTI_BIT_ERROR_DriverIRQHandler - def_irq_handler FMU0_DriverIRQHandler - def_irq_handler Reserved155_DriverIRQHandler - def_irq_handler Reserved156_DriverIRQHandler - def_irq_handler Reserved157_DriverIRQHandler - def_irq_handler Reserved158_DriverIRQHandler - def_irq_handler LPTMR0_DriverIRQHandler - def_irq_handler LPTMR1_DriverIRQHandler - def_irq_handler SCG_DriverIRQHandler - def_irq_handler SPC_DriverIRQHandler - def_irq_handler WUU_DriverIRQHandler - def_irq_handler PORT_EFT_DriverIRQHandler - def_irq_handler Reserved165_DriverIRQHandler - def_irq_handler Reserved166_DriverIRQHandler - def_irq_handler Reserved167_DriverIRQHandler - def_irq_handler WWDT0_DriverIRQHandler - def_irq_handler WWDT1_DriverIRQHandler - def_irq_handler CMC0_DriverIRQHandler - def_irq_handler Reserved171_DriverIRQHandler - - .end diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/iar/startup_MCXN236.s b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/iar/startup_MCXN236.s deleted file mode 100644 index 5ecceee8779..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/iar/startup_MCXN236.s +++ /dev/null @@ -1,1556 +0,0 @@ -; ------------------------------------------------------------------------- -; @file: startup_MCXN236.s -; @purpose: CMSIS Cortex-M33 Core Device Startup File -; MCXN236 -; @version: 1.0 -; @date: 2023-10-1 -; @build: b240409 -; ------------------------------------------------------------------------- -; -; Copyright 1997-2016 Freescale Semiconductor, Inc. -; Copyright 2016-2024 NXP -; SPDX-License-Identifier: BSD-3-Clause -; -; The modules in this file are included in the libraries, and may be replaced -; by any user-defined modules that define the PUBLIC symbol _program_start or -; a user defined start symbol. -; To override the cstartup defined in the library, simply add your modified -; version to the workbench project. -; -; The vector table is normally located at address 0. -; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. -; The name "__vector_table" has special meaning for C-SPY: -; it is where the SP start value is found, and the NVIC vector -; table register (VTOR) is initialized to this address if != 0. -; -; Cortex-M version -; - - MODULE ?cstartup - - ;; Forward declaration of sections. - SECTION CSTACK:DATA:NOROOT(3) - - SECTION .intvec:CODE:NOROOT(2) - - EXTERN __iar_program_start - EXTERN SystemInit - PUBLIC __vector_table - PUBLIC __vector_table_0x1c - PUBLIC __Vectors - PUBLIC __Vectors_End - PUBLIC __Vectors_Size - - DATA - -__iar_init$$done: ; The vector table is not needed - ; until after copy initialization is done - -__vector_table - DCD sfe(CSTACK) - DCD Reset_Handler - - DCD NMI_Handler ;NMI Handler - DCD HardFault_Handler ;Hard Fault Handler - DCD MemManage_Handler ;MPU Fault Handler - DCD BusFault_Handler ;Bus Fault Handler - DCD UsageFault_Handler ;Usage Fault Handler -__vector_table_0x1c - DCD SecureFault_Handler ;Secure Fault Handler - DCD 0 ;Reserved - DCD 0 ;Reserved - DCD 0 ;Reserved - DCD SVC_Handler ;SVCall Handler - DCD DebugMon_Handler ;Debug Monitor Handler - DCD 0 ;Reserved - DCD PendSV_Handler ;PendSV Handler - DCD SysTick_Handler ;SysTick Handler - - ;External Interrupts - DCD OR_IRQHandler ;OR IRQ - DCD EDMA_0_CH0_IRQHandler ;eDMA_0_CH0 error or transfer complete - DCD EDMA_0_CH1_IRQHandler ;eDMA_0_CH1 error or transfer complete - DCD EDMA_0_CH2_IRQHandler ;eDMA_0_CH2 error or transfer complete - DCD EDMA_0_CH3_IRQHandler ;eDMA_0_CH3 error or transfer complete - DCD EDMA_0_CH4_IRQHandler ;eDMA_0_CH4 error or transfer complete - DCD EDMA_0_CH5_IRQHandler ;eDMA_0_CH5 error or transfer complete - DCD EDMA_0_CH6_IRQHandler ;eDMA_0_CH6 error or transfer complete - DCD EDMA_0_CH7_IRQHandler ;eDMA_0_CH7 error or transfer complete - DCD EDMA_0_CH8_IRQHandler ;eDMA_0_CH8 error or transfer complete - DCD EDMA_0_CH9_IRQHandler ;eDMA_0_CH9 error or transfer complete - DCD EDMA_0_CH10_IRQHandler ;eDMA_0_CH10 error or transfer complete - DCD EDMA_0_CH11_IRQHandler ;eDMA_0_CH11 error or transfer complete - DCD EDMA_0_CH12_IRQHandler ;eDMA_0_CH12 error or transfer complete - DCD EDMA_0_CH13_IRQHandler ;eDMA_0_CH13 error or transfer complete - DCD EDMA_0_CH14_IRQHandler ;eDMA_0_CH14 error or transfer complete - DCD EDMA_0_CH15_IRQHandler ;eDMA_0_CH15 error or transfer complete - DCD GPIO00_IRQHandler ;GPIO0 interrupt 0 - DCD GPIO01_IRQHandler ;GPIO0 interrupt 1 - DCD GPIO10_IRQHandler ;GPIO1 interrupt 0 - DCD GPIO11_IRQHandler ;GPIO1 interrupt 1 - DCD GPIO20_IRQHandler ;GPIO2 interrupt 0 - DCD GPIO21_IRQHandler ;GPIO2 interrupt 1 - DCD GPIO30_IRQHandler ;GPIO3 interrupt 0 - DCD GPIO31_IRQHandler ;GPIO3 interrupt 1 - DCD GPIO40_IRQHandler ;GPIO4 interrupt 0 - DCD GPIO41_IRQHandler ;GPIO4 interrupt 1 - DCD GPIO50_IRQHandler ;GPIO5 interrupt 0 - DCD GPIO51_IRQHandler ;GPIO5 interrupt 1 - DCD UTICK0_IRQHandler ;Micro-Tick Timer interrupt - DCD MRT0_IRQHandler ;Multi-Rate Timer interrupt - DCD CTIMER0_IRQHandler ;Standard counter/timer 0 interrupt - DCD CTIMER1_IRQHandler ;Standard counter/timer 1 interrupt - DCD Reserved49_IRQHandler ;Reserved interrupt - DCD CTIMER2_IRQHandler ;Standard counter/timer 2 interrupt - DCD LP_FLEXCOMM0_IRQHandler ;LP_FLEXCOMM0 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) - DCD LP_FLEXCOMM1_IRQHandler ;LP_FLEXCOMM1 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) - DCD LP_FLEXCOMM2_IRQHandler ;LP_FLEXCOMM2 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) - DCD LP_FLEXCOMM3_IRQHandler ;LP_FLEXCOMM3 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) - DCD LP_FLEXCOMM4_IRQHandler ;LP_FLEXCOMM4 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) - DCD LP_FLEXCOMM5_IRQHandler ;LP_FLEXCOMM5 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) - DCD LP_FLEXCOMM6_IRQHandler ;LP_FLEXCOMM6 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) - DCD LP_FLEXCOMM7_IRQHandler ;LP_FLEXCOMM7 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) - DCD Reserved59_IRQHandler ;Reserved interrupt - DCD Reserved60_IRQHandler ;Reserved interrupt - DCD ADC0_IRQHandler ;Analog-to-Digital Converter 0 - General Purpose interrupt - DCD ADC1_IRQHandler ;Analog-to-Digital Converter 1 - General Purpose interrupt - DCD PINT0_IRQHandler ;Pin Interrupt Pattern Match Interrupt - DCD PDM_EVENT_IRQHandler ;Microphone Interface interrupt - DCD Reserved65_IRQHandler ;Reserved interrupt - DCD Reserved66_IRQHandler ;Reserved interrupt - DCD USB0_DCD_IRQHandler ;Universal Serial Bus - Device Charge Detect interrupt - DCD RTC_IRQHandler ;RTC Subsystem interrupt (RTC interrupt or Wake timer interrupt) - DCD SMARTDMA_IRQHandler ;SmartDMA_IRQ - DCD Reserved70_IRQHandler ;Reserved interrupt - DCD CTIMER3_IRQHandler ;Standard counter/timer 3 interrupt - DCD CTIMER4_IRQHandler ;Standard counter/timer 4 interrupt - DCD OS_EVENT_IRQHandler ;OS event timer interrupt - DCD Reserved74_IRQHandler ;Reserved interrupt - DCD SAI0_IRQHandler ;Serial Audio Interface 0 interrupt - DCD SAI1_IRQHandler ;Serial Audio Interface 1 interrupt - DCD Reserved77_IRQHandler ;Reserved interrupt - DCD CAN0_IRQHandler ;Controller Area Network 0 interrupt - DCD CAN1_IRQHandler ;Controller Area Network 1 interrupt - DCD Reserved80_IRQHandler ;Reserved interrupt - DCD Reserved81_IRQHandler ;Reserved interrupt - DCD USB1_HS_PHY_IRQHandler ;USBHS DCD or USBHS Phy interrupt - DCD USB1_HS_IRQHandler ;USB High Speed OTG Controller interrupt - DCD SEC_HYPERVISOR_CALL_IRQHandler ;AHB Secure Controller hypervisor call interrupt - DCD Reserved85_IRQHandler ;Reserved interrupt - DCD Reserved86_IRQHandler ;Reserved interrupt - DCD Freqme_IRQHandler ;Frequency Measurement interrupt - DCD SEC_VIO_IRQHandler ;Secure violation interrupt (Memory Block Checker interrupt or secure AHB matrix violation interrupt) - DCD ELS_IRQHandler ;ELS interrupt - DCD PKC_IRQHandler ;PKC interrupt - DCD PUF_IRQHandler ;Physical Unclonable Function interrupt - DCD Reserved92_IRQHandler ;Reserved interrupt - DCD EDMA_1_CH0_IRQHandler ;eDMA_1_CH0 error or transfer complete - DCD EDMA_1_CH1_IRQHandler ;eDMA_1_CH1 error or transfer complete - DCD EDMA_1_CH2_IRQHandler ;eDMA_1_CH2 error or transfer complete - DCD EDMA_1_CH3_IRQHandler ;eDMA_1_CH3 error or transfer complete - DCD EDMA_1_CH4_IRQHandler ;eDMA_1_CH4 error or transfer complete - DCD EDMA_1_CH5_IRQHandler ;eDMA_1_CH5 error or transfer complete - DCD EDMA_1_CH6_IRQHandler ;eDMA_1_CH6 error or transfer complete - DCD EDMA_1_CH7_IRQHandler ;eDMA_1_CH7 error or transfer complete - DCD Reserved101_IRQHandler ;Reserved interrupt - DCD Reserved102_IRQHandler ;Reserved interrupt - DCD Reserved103_IRQHandler ;Reserved interrupt - DCD Reserved104_IRQHandler ;Reserved interrupt - DCD Reserved105_IRQHandler ;Reserved interrupt - DCD Reserved106_IRQHandler ;Reserved interrupt - DCD Reserved107_IRQHandler ;Reserved interrupt - DCD Reserved108_IRQHandler ;Reserved interrupt - DCD CDOG0_IRQHandler ;Code Watchdog Timer 0 interrupt - DCD CDOG1_IRQHandler ;Code Watchdog Timer 1 interrupt - DCD I3C0_IRQHandler ;Improved Inter Integrated Circuit interrupt 0 - DCD I3C1_IRQHandler ;Improved Inter Integrated Circuit interrupt 1 - DCD Reserved113_IRQHandler ;Reserved interrupt - DCD GDET_IRQHandler ;Digital Glitch Detect 0 interrupt or Digital Glitch Detect 1 interrupt - DCD VBAT0_IRQHandler ;VBAT interrupt( VBAT interrupt or digital tamper interrupt) - DCD EWM0_IRQHandler ;External Watchdog Monitor interrupt - DCD Reserved117_IRQHandler ;Reserved interrupt - DCD Reserved118_IRQHandler ;Reserved interrupt - DCD Reserved119_IRQHandler ;Reserved interrupt - DCD Reserved120_IRQHandler ;Reserved interrupt - DCD FLEXIO_IRQHandler ;Flexible Input/Output interrupt - DCD Reserved122_IRQHandler ;Reserved interrupt - DCD Reserved123_IRQHandler ;Reserved interrupt - DCD Reserved124_IRQHandler ;Reserved interrupt - DCD HSCMP0_IRQHandler ;High-Speed comparator0 interrupt - DCD HSCMP1_IRQHandler ;High-Speed comparator1 interrupt - DCD Reserved127_IRQHandler ;Reserved interrupt - DCD FLEXPWM0_RELOAD_ERROR_IRQHandler ;FlexPWM0_reload_error interrupt - DCD FLEXPWM0_FAULT_IRQHandler ;FlexPWM0_fault interrupt - DCD FLEXPWM0_SUBMODULE0_IRQHandler ;FlexPWM0 Submodule 0 capture/compare/reload interrupt - DCD FLEXPWM0_SUBMODULE1_IRQHandler ;FlexPWM0 Submodule 1 capture/compare/reload interrupt - DCD FLEXPWM0_SUBMODULE2_IRQHandler ;FlexPWM0 Submodule 2 capture/compare/reload interrupt - DCD FLEXPWM0_SUBMODULE3_IRQHandler ;FlexPWM0 Submodule 3 capture/compare/reload interrupt - DCD FLEXPWM1_RELOAD_ERROR_IRQHandler ;FlexPWM1_reload_error interrupt - DCD FLEXPWM1_FAULT_IRQHandler ;FlexPWM1_fault interrupt - DCD FLEXPWM1_SUBMODULE0_IRQHandler ;FlexPWM1 Submodule 0 capture/compare/reload interrupt - DCD FLEXPWM1_SUBMODULE1_IRQHandler ;FlexPWM1 Submodule 1 capture/compare/reload interrupt - DCD FLEXPWM1_SUBMODULE2_IRQHandler ;FlexPWM1 Submodule 2 capture/compare/reload interrupt - DCD FLEXPWM1_SUBMODULE3_IRQHandler ;FlexPWM1 Submodule 3 capture/compare/reload interrupt - DCD QDC0_COMPARE_IRQHandler ;QDC0_Compare interrupt - DCD QDC0_HOME_IRQHandler ;QDC0_Home interrupt - DCD QDC0_WDG_SAB_IRQHandler ;QDC0_WDG_IRQ/SAB interrupt - DCD QDC0_IDX_IRQHandler ;QDC0_IDX interrupt - DCD QDC1_COMPARE_IRQHandler ;QDC1_Compare interrupt - DCD QDC1_HOME_IRQHandler ;QDC1_Home interrupt - DCD QDC1_WDG_SAB_IRQHandler ;QDC1_WDG_IRQ/SAB interrupt - DCD QDC1_IDX_IRQHandler ;QDC1_IDX interrupt - DCD ITRC0_IRQHandler ;Intrusion and Tamper Response Controller interrupt - DCD Reserved149_IRQHandler ;Reserved interrupt - DCD ELS_ERR_IRQHandler ;ELS error interrupt - DCD PKC_ERR_IRQHandler ;PKC error interrupt - DCD ERM_SINGLE_BIT_ERROR_IRQHandler ;ERM Single Bit error interrupt - DCD ERM_MULTI_BIT_ERROR_IRQHandler ;ERM Multi Bit error interrupt - DCD FMU0_IRQHandler ;Flash Management Unit interrupt - DCD Reserved155_IRQHandler ;Reserved interrupt - DCD Reserved156_IRQHandler ;Reserved interrupt - DCD Reserved157_IRQHandler ;Reserved interrupt - DCD Reserved158_IRQHandler ;Reserved interrupt - DCD LPTMR0_IRQHandler ;Low Power Timer 0 interrupt - DCD LPTMR1_IRQHandler ;Low Power Timer 1 interrupt - DCD SCG_IRQHandler ;System Clock Generator interrupt - DCD SPC_IRQHandler ;System Power Controller interrupt - DCD WUU_IRQHandler ;Wake Up Unit interrupt - DCD PORT_EFT_IRQHandler ;PORT0~5 EFT interrupt - DCD Reserved165_IRQHandler ;Reserved interrupt - DCD Reserved166_IRQHandler ;Reserved interrupt - DCD Reserved167_IRQHandler ;Reserved interrupt - DCD WWDT0_IRQHandler ;Windowed Watchdog Timer 0 interrupt - DCD WWDT1_IRQHandler ;Windowed Watchdog Timer 1 interrupt - DCD CMC0_IRQHandler ;Core Mode Controller interrupt - DCD Reserved171_IRQHandler ;Reserved interrupt -__Vectors_End - -__Vectors EQU __vector_table -__Vectors_Size EQU __Vectors_End - __Vectors - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Default interrupt handlers. -;; - THUMB - - PUBWEAK Reset_Handler - SECTION .text:CODE:REORDER:NOROOT(2) -Reset_Handler - CPSID I ; Mask interrupts - LDR R0, =0xE000ED08 - LDR R1, =__vector_table - STR R1, [R0] - LDR R2, [R1] - MSR MSP, R2 - LDR R0, =sfb(CSTACK) - MSR MSPLIM, R0 - CPSIE I ; Unmask interrupts - LDR R0, =SystemInit - BLX R0 - LDR R0, =__iar_program_start - BX R0 - - PUBWEAK NMI_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -NMI_Handler - B . - - PUBWEAK HardFault_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -HardFault_Handler - B . - - PUBWEAK MemManage_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -MemManage_Handler - B . - - PUBWEAK BusFault_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -BusFault_Handler - B . - - PUBWEAK UsageFault_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -UsageFault_Handler - B . - - PUBWEAK SecureFault_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -SecureFault_Handler - B . - - PUBWEAK SVC_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -SVC_Handler - B . - - PUBWEAK DebugMon_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -DebugMon_Handler - B . - - PUBWEAK PendSV_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -PendSV_Handler - B . - - PUBWEAK SysTick_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -SysTick_Handler - B . - - PUBWEAK OR_IRQHandler - PUBWEAK OR_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -OR_IRQHandler - LDR R0, =OR_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH0_IRQHandler - PUBWEAK EDMA_0_CH0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH0_IRQHandler - LDR R0, =EDMA_0_CH0_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH1_IRQHandler - PUBWEAK EDMA_0_CH1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH1_IRQHandler - LDR R0, =EDMA_0_CH1_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH2_IRQHandler - PUBWEAK EDMA_0_CH2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH2_IRQHandler - LDR R0, =EDMA_0_CH2_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH3_IRQHandler - PUBWEAK EDMA_0_CH3_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH3_IRQHandler - LDR R0, =EDMA_0_CH3_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH4_IRQHandler - PUBWEAK EDMA_0_CH4_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH4_IRQHandler - LDR R0, =EDMA_0_CH4_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH5_IRQHandler - PUBWEAK EDMA_0_CH5_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH5_IRQHandler - LDR R0, =EDMA_0_CH5_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH6_IRQHandler - PUBWEAK EDMA_0_CH6_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH6_IRQHandler - LDR R0, =EDMA_0_CH6_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH7_IRQHandler - PUBWEAK EDMA_0_CH7_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH7_IRQHandler - LDR R0, =EDMA_0_CH7_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH8_IRQHandler - PUBWEAK EDMA_0_CH8_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH8_IRQHandler - LDR R0, =EDMA_0_CH8_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH9_IRQHandler - PUBWEAK EDMA_0_CH9_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH9_IRQHandler - LDR R0, =EDMA_0_CH9_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH10_IRQHandler - PUBWEAK EDMA_0_CH10_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH10_IRQHandler - LDR R0, =EDMA_0_CH10_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH11_IRQHandler - PUBWEAK EDMA_0_CH11_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH11_IRQHandler - LDR R0, =EDMA_0_CH11_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH12_IRQHandler - PUBWEAK EDMA_0_CH12_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH12_IRQHandler - LDR R0, =EDMA_0_CH12_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH13_IRQHandler - PUBWEAK EDMA_0_CH13_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH13_IRQHandler - LDR R0, =EDMA_0_CH13_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH14_IRQHandler - PUBWEAK EDMA_0_CH14_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH14_IRQHandler - LDR R0, =EDMA_0_CH14_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH15_IRQHandler - PUBWEAK EDMA_0_CH15_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH15_IRQHandler - LDR R0, =EDMA_0_CH15_DriverIRQHandler - BX R0 - - PUBWEAK GPIO00_IRQHandler - PUBWEAK GPIO00_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO00_IRQHandler - LDR R0, =GPIO00_DriverIRQHandler - BX R0 - - PUBWEAK GPIO01_IRQHandler - PUBWEAK GPIO01_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO01_IRQHandler - LDR R0, =GPIO01_DriverIRQHandler - BX R0 - - PUBWEAK GPIO10_IRQHandler - PUBWEAK GPIO10_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO10_IRQHandler - LDR R0, =GPIO10_DriverIRQHandler - BX R0 - - PUBWEAK GPIO11_IRQHandler - PUBWEAK GPIO11_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO11_IRQHandler - LDR R0, =GPIO11_DriverIRQHandler - BX R0 - - PUBWEAK GPIO20_IRQHandler - PUBWEAK GPIO20_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO20_IRQHandler - LDR R0, =GPIO20_DriverIRQHandler - BX R0 - - PUBWEAK GPIO21_IRQHandler - PUBWEAK GPIO21_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO21_IRQHandler - LDR R0, =GPIO21_DriverIRQHandler - BX R0 - - PUBWEAK GPIO30_IRQHandler - PUBWEAK GPIO30_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO30_IRQHandler - LDR R0, =GPIO30_DriverIRQHandler - BX R0 - - PUBWEAK GPIO31_IRQHandler - PUBWEAK GPIO31_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO31_IRQHandler - LDR R0, =GPIO31_DriverIRQHandler - BX R0 - - PUBWEAK GPIO40_IRQHandler - PUBWEAK GPIO40_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO40_IRQHandler - LDR R0, =GPIO40_DriverIRQHandler - BX R0 - - PUBWEAK GPIO41_IRQHandler - PUBWEAK GPIO41_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO41_IRQHandler - LDR R0, =GPIO41_DriverIRQHandler - BX R0 - - PUBWEAK GPIO50_IRQHandler - PUBWEAK GPIO50_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO50_IRQHandler - LDR R0, =GPIO50_DriverIRQHandler - BX R0 - - PUBWEAK GPIO51_IRQHandler - PUBWEAK GPIO51_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO51_IRQHandler - LDR R0, =GPIO51_DriverIRQHandler - BX R0 - - PUBWEAK UTICK0_IRQHandler - PUBWEAK UTICK0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -UTICK0_IRQHandler - LDR R0, =UTICK0_DriverIRQHandler - BX R0 - - PUBWEAK MRT0_IRQHandler - PUBWEAK MRT0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -MRT0_IRQHandler - LDR R0, =MRT0_DriverIRQHandler - BX R0 - - PUBWEAK CTIMER0_IRQHandler - PUBWEAK CTIMER0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CTIMER0_IRQHandler - LDR R0, =CTIMER0_DriverIRQHandler - BX R0 - - PUBWEAK CTIMER1_IRQHandler - PUBWEAK CTIMER1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CTIMER1_IRQHandler - LDR R0, =CTIMER1_DriverIRQHandler - BX R0 - - PUBWEAK Reserved49_IRQHandler - PUBWEAK Reserved49_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved49_IRQHandler - LDR R0, =Reserved49_DriverIRQHandler - BX R0 - - PUBWEAK CTIMER2_IRQHandler - PUBWEAK CTIMER2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CTIMER2_IRQHandler - LDR R0, =CTIMER2_DriverIRQHandler - BX R0 - - PUBWEAK LP_FLEXCOMM0_IRQHandler - PUBWEAK LP_FLEXCOMM0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LP_FLEXCOMM0_IRQHandler - LDR R0, =LP_FLEXCOMM0_DriverIRQHandler - BX R0 - - PUBWEAK LP_FLEXCOMM1_IRQHandler - PUBWEAK LP_FLEXCOMM1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LP_FLEXCOMM1_IRQHandler - LDR R0, =LP_FLEXCOMM1_DriverIRQHandler - BX R0 - - PUBWEAK LP_FLEXCOMM2_IRQHandler - PUBWEAK LP_FLEXCOMM2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LP_FLEXCOMM2_IRQHandler - LDR R0, =LP_FLEXCOMM2_DriverIRQHandler - BX R0 - - PUBWEAK LP_FLEXCOMM3_IRQHandler - PUBWEAK LP_FLEXCOMM3_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LP_FLEXCOMM3_IRQHandler - LDR R0, =LP_FLEXCOMM3_DriverIRQHandler - BX R0 - - PUBWEAK LP_FLEXCOMM4_IRQHandler - PUBWEAK LP_FLEXCOMM4_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LP_FLEXCOMM4_IRQHandler - LDR R0, =LP_FLEXCOMM4_DriverIRQHandler - BX R0 - - PUBWEAK LP_FLEXCOMM5_IRQHandler - PUBWEAK LP_FLEXCOMM5_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LP_FLEXCOMM5_IRQHandler - LDR R0, =LP_FLEXCOMM5_DriverIRQHandler - BX R0 - - PUBWEAK LP_FLEXCOMM6_IRQHandler - PUBWEAK LP_FLEXCOMM6_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LP_FLEXCOMM6_IRQHandler - LDR R0, =LP_FLEXCOMM6_DriverIRQHandler - BX R0 - - PUBWEAK LP_FLEXCOMM7_IRQHandler - PUBWEAK LP_FLEXCOMM7_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LP_FLEXCOMM7_IRQHandler - LDR R0, =LP_FLEXCOMM7_DriverIRQHandler - BX R0 - - PUBWEAK Reserved59_IRQHandler - PUBWEAK Reserved59_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved59_IRQHandler - LDR R0, =Reserved59_DriverIRQHandler - BX R0 - - PUBWEAK Reserved60_IRQHandler - PUBWEAK Reserved60_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved60_IRQHandler - LDR R0, =Reserved60_DriverIRQHandler - BX R0 - - PUBWEAK ADC0_IRQHandler - PUBWEAK ADC0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ADC0_IRQHandler - LDR R0, =ADC0_DriverIRQHandler - BX R0 - - PUBWEAK ADC1_IRQHandler - PUBWEAK ADC1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ADC1_IRQHandler - LDR R0, =ADC1_DriverIRQHandler - BX R0 - - PUBWEAK PINT0_IRQHandler - PUBWEAK PINT0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -PINT0_IRQHandler - LDR R0, =PINT0_DriverIRQHandler - BX R0 - - PUBWEAK PDM_EVENT_IRQHandler - PUBWEAK PDM_EVENT_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -PDM_EVENT_IRQHandler - LDR R0, =PDM_EVENT_DriverIRQHandler - BX R0 - - PUBWEAK Reserved65_IRQHandler - PUBWEAK Reserved65_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved65_IRQHandler - LDR R0, =Reserved65_DriverIRQHandler - BX R0 - - PUBWEAK Reserved66_IRQHandler - PUBWEAK Reserved66_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved66_IRQHandler - LDR R0, =Reserved66_DriverIRQHandler - BX R0 - - PUBWEAK USB0_DCD_IRQHandler - PUBWEAK USB0_DCD_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -USB0_DCD_IRQHandler - LDR R0, =USB0_DCD_DriverIRQHandler - BX R0 - - PUBWEAK RTC_IRQHandler - PUBWEAK RTC_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -RTC_IRQHandler - LDR R0, =RTC_DriverIRQHandler - BX R0 - - PUBWEAK SMARTDMA_IRQHandler - PUBWEAK SMARTDMA_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SMARTDMA_IRQHandler - LDR R0, =SMARTDMA_DriverIRQHandler - BX R0 - - PUBWEAK Reserved70_IRQHandler - PUBWEAK Reserved70_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved70_IRQHandler - LDR R0, =Reserved70_DriverIRQHandler - BX R0 - - PUBWEAK CTIMER3_IRQHandler - PUBWEAK CTIMER3_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CTIMER3_IRQHandler - LDR R0, =CTIMER3_DriverIRQHandler - BX R0 - - PUBWEAK CTIMER4_IRQHandler - PUBWEAK CTIMER4_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CTIMER4_IRQHandler - LDR R0, =CTIMER4_DriverIRQHandler - BX R0 - - PUBWEAK OS_EVENT_IRQHandler - PUBWEAK OS_EVENT_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -OS_EVENT_IRQHandler - LDR R0, =OS_EVENT_DriverIRQHandler - BX R0 - - PUBWEAK Reserved74_IRQHandler - PUBWEAK Reserved74_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved74_IRQHandler - LDR R0, =Reserved74_DriverIRQHandler - BX R0 - - PUBWEAK SAI0_IRQHandler - PUBWEAK SAI0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SAI0_IRQHandler - LDR R0, =SAI0_DriverIRQHandler - BX R0 - - PUBWEAK SAI1_IRQHandler - PUBWEAK SAI1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SAI1_IRQHandler - LDR R0, =SAI1_DriverIRQHandler - BX R0 - - PUBWEAK Reserved77_IRQHandler - PUBWEAK Reserved77_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved77_IRQHandler - LDR R0, =Reserved77_DriverIRQHandler - BX R0 - - PUBWEAK CAN0_IRQHandler - PUBWEAK CAN0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CAN0_IRQHandler - LDR R0, =CAN0_DriverIRQHandler - BX R0 - - PUBWEAK CAN1_IRQHandler - PUBWEAK CAN1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CAN1_IRQHandler - LDR R0, =CAN1_DriverIRQHandler - BX R0 - - PUBWEAK Reserved80_IRQHandler - PUBWEAK Reserved80_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved80_IRQHandler - LDR R0, =Reserved80_DriverIRQHandler - BX R0 - - PUBWEAK Reserved81_IRQHandler - PUBWEAK Reserved81_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved81_IRQHandler - LDR R0, =Reserved81_DriverIRQHandler - BX R0 - - PUBWEAK USB1_HS_PHY_IRQHandler - PUBWEAK USB1_HS_PHY_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -USB1_HS_PHY_IRQHandler - LDR R0, =USB1_HS_PHY_DriverIRQHandler - BX R0 - - PUBWEAK USB1_HS_IRQHandler - PUBWEAK USB1_HS_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -USB1_HS_IRQHandler - LDR R0, =USB1_HS_DriverIRQHandler - BX R0 - - PUBWEAK SEC_HYPERVISOR_CALL_IRQHandler - PUBWEAK SEC_HYPERVISOR_CALL_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SEC_HYPERVISOR_CALL_IRQHandler - LDR R0, =SEC_HYPERVISOR_CALL_DriverIRQHandler - BX R0 - - PUBWEAK Reserved85_IRQHandler - PUBWEAK Reserved85_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved85_IRQHandler - LDR R0, =Reserved85_DriverIRQHandler - BX R0 - - PUBWEAK Reserved86_IRQHandler - PUBWEAK Reserved86_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved86_IRQHandler - LDR R0, =Reserved86_DriverIRQHandler - BX R0 - - PUBWEAK Freqme_IRQHandler - PUBWEAK Freqme_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Freqme_IRQHandler - LDR R0, =Freqme_DriverIRQHandler - BX R0 - - PUBWEAK SEC_VIO_IRQHandler - PUBWEAK SEC_VIO_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SEC_VIO_IRQHandler - LDR R0, =SEC_VIO_DriverIRQHandler - BX R0 - - PUBWEAK ELS_IRQHandler - PUBWEAK ELS_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ELS_IRQHandler - LDR R0, =ELS_DriverIRQHandler - BX R0 - - PUBWEAK PKC_IRQHandler - PUBWEAK PKC_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -PKC_IRQHandler - LDR R0, =PKC_DriverIRQHandler - BX R0 - - PUBWEAK PUF_IRQHandler - PUBWEAK PUF_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -PUF_IRQHandler - LDR R0, =PUF_DriverIRQHandler - BX R0 - - PUBWEAK Reserved92_IRQHandler - PUBWEAK Reserved92_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved92_IRQHandler - LDR R0, =Reserved92_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH0_IRQHandler - PUBWEAK EDMA_1_CH0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH0_IRQHandler - LDR R0, =EDMA_1_CH0_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH1_IRQHandler - PUBWEAK EDMA_1_CH1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH1_IRQHandler - LDR R0, =EDMA_1_CH1_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH2_IRQHandler - PUBWEAK EDMA_1_CH2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH2_IRQHandler - LDR R0, =EDMA_1_CH2_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH3_IRQHandler - PUBWEAK EDMA_1_CH3_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH3_IRQHandler - LDR R0, =EDMA_1_CH3_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH4_IRQHandler - PUBWEAK EDMA_1_CH4_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH4_IRQHandler - LDR R0, =EDMA_1_CH4_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH5_IRQHandler - PUBWEAK EDMA_1_CH5_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH5_IRQHandler - LDR R0, =EDMA_1_CH5_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH6_IRQHandler - PUBWEAK EDMA_1_CH6_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH6_IRQHandler - LDR R0, =EDMA_1_CH6_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH7_IRQHandler - PUBWEAK EDMA_1_CH7_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH7_IRQHandler - LDR R0, =EDMA_1_CH7_DriverIRQHandler - BX R0 - - PUBWEAK Reserved101_IRQHandler - PUBWEAK Reserved101_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved101_IRQHandler - LDR R0, =Reserved101_DriverIRQHandler - BX R0 - - PUBWEAK Reserved102_IRQHandler - PUBWEAK Reserved102_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved102_IRQHandler - LDR R0, =Reserved102_DriverIRQHandler - BX R0 - - PUBWEAK Reserved103_IRQHandler - PUBWEAK Reserved103_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved103_IRQHandler - LDR R0, =Reserved103_DriverIRQHandler - BX R0 - - PUBWEAK Reserved104_IRQHandler - PUBWEAK Reserved104_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved104_IRQHandler - LDR R0, =Reserved104_DriverIRQHandler - BX R0 - - PUBWEAK Reserved105_IRQHandler - PUBWEAK Reserved105_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved105_IRQHandler - LDR R0, =Reserved105_DriverIRQHandler - BX R0 - - PUBWEAK Reserved106_IRQHandler - PUBWEAK Reserved106_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved106_IRQHandler - LDR R0, =Reserved106_DriverIRQHandler - BX R0 - - PUBWEAK Reserved107_IRQHandler - PUBWEAK Reserved107_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved107_IRQHandler - LDR R0, =Reserved107_DriverIRQHandler - BX R0 - - PUBWEAK Reserved108_IRQHandler - PUBWEAK Reserved108_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved108_IRQHandler - LDR R0, =Reserved108_DriverIRQHandler - BX R0 - - PUBWEAK CDOG0_IRQHandler - PUBWEAK CDOG0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CDOG0_IRQHandler - LDR R0, =CDOG0_DriverIRQHandler - BX R0 - - PUBWEAK CDOG1_IRQHandler - PUBWEAK CDOG1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CDOG1_IRQHandler - LDR R0, =CDOG1_DriverIRQHandler - BX R0 - - PUBWEAK I3C0_IRQHandler - PUBWEAK I3C0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -I3C0_IRQHandler - LDR R0, =I3C0_DriverIRQHandler - BX R0 - - PUBWEAK I3C1_IRQHandler - PUBWEAK I3C1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -I3C1_IRQHandler - LDR R0, =I3C1_DriverIRQHandler - BX R0 - - PUBWEAK Reserved113_IRQHandler - PUBWEAK Reserved113_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved113_IRQHandler - LDR R0, =Reserved113_DriverIRQHandler - BX R0 - - PUBWEAK GDET_IRQHandler - PUBWEAK GDET_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GDET_IRQHandler - LDR R0, =GDET_DriverIRQHandler - BX R0 - - PUBWEAK VBAT0_IRQHandler - PUBWEAK VBAT0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -VBAT0_IRQHandler - LDR R0, =VBAT0_DriverIRQHandler - BX R0 - - PUBWEAK EWM0_IRQHandler - PUBWEAK EWM0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EWM0_IRQHandler - LDR R0, =EWM0_DriverIRQHandler - BX R0 - - PUBWEAK Reserved117_IRQHandler - PUBWEAK Reserved117_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved117_IRQHandler - LDR R0, =Reserved117_DriverIRQHandler - BX R0 - - PUBWEAK Reserved118_IRQHandler - PUBWEAK Reserved118_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved118_IRQHandler - LDR R0, =Reserved118_DriverIRQHandler - BX R0 - - PUBWEAK Reserved119_IRQHandler - PUBWEAK Reserved119_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved119_IRQHandler - LDR R0, =Reserved119_DriverIRQHandler - BX R0 - - PUBWEAK Reserved120_IRQHandler - PUBWEAK Reserved120_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved120_IRQHandler - LDR R0, =Reserved120_DriverIRQHandler - BX R0 - - PUBWEAK FLEXIO_IRQHandler - PUBWEAK FLEXIO_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXIO_IRQHandler - LDR R0, =FLEXIO_DriverIRQHandler - BX R0 - - PUBWEAK Reserved122_IRQHandler - PUBWEAK Reserved122_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved122_IRQHandler - LDR R0, =Reserved122_DriverIRQHandler - BX R0 - - PUBWEAK Reserved123_IRQHandler - PUBWEAK Reserved123_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved123_IRQHandler - LDR R0, =Reserved123_DriverIRQHandler - BX R0 - - PUBWEAK Reserved124_IRQHandler - PUBWEAK Reserved124_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved124_IRQHandler - LDR R0, =Reserved124_DriverIRQHandler - BX R0 - - PUBWEAK HSCMP0_IRQHandler - PUBWEAK HSCMP0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -HSCMP0_IRQHandler - LDR R0, =HSCMP0_DriverIRQHandler - BX R0 - - PUBWEAK HSCMP1_IRQHandler - PUBWEAK HSCMP1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -HSCMP1_IRQHandler - LDR R0, =HSCMP1_DriverIRQHandler - BX R0 - - PUBWEAK Reserved127_IRQHandler - PUBWEAK Reserved127_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved127_IRQHandler - LDR R0, =Reserved127_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM0_RELOAD_ERROR_IRQHandler - PUBWEAK FLEXPWM0_RELOAD_ERROR_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM0_RELOAD_ERROR_IRQHandler - LDR R0, =FLEXPWM0_RELOAD_ERROR_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM0_FAULT_IRQHandler - PUBWEAK FLEXPWM0_FAULT_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM0_FAULT_IRQHandler - LDR R0, =FLEXPWM0_FAULT_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM0_SUBMODULE0_IRQHandler - PUBWEAK FLEXPWM0_SUBMODULE0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM0_SUBMODULE0_IRQHandler - LDR R0, =FLEXPWM0_SUBMODULE0_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM0_SUBMODULE1_IRQHandler - PUBWEAK FLEXPWM0_SUBMODULE1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM0_SUBMODULE1_IRQHandler - LDR R0, =FLEXPWM0_SUBMODULE1_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM0_SUBMODULE2_IRQHandler - PUBWEAK FLEXPWM0_SUBMODULE2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM0_SUBMODULE2_IRQHandler - LDR R0, =FLEXPWM0_SUBMODULE2_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM0_SUBMODULE3_IRQHandler - PUBWEAK FLEXPWM0_SUBMODULE3_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM0_SUBMODULE3_IRQHandler - LDR R0, =FLEXPWM0_SUBMODULE3_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM1_RELOAD_ERROR_IRQHandler - PUBWEAK FLEXPWM1_RELOAD_ERROR_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM1_RELOAD_ERROR_IRQHandler - LDR R0, =FLEXPWM1_RELOAD_ERROR_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM1_FAULT_IRQHandler - PUBWEAK FLEXPWM1_FAULT_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM1_FAULT_IRQHandler - LDR R0, =FLEXPWM1_FAULT_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM1_SUBMODULE0_IRQHandler - PUBWEAK FLEXPWM1_SUBMODULE0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM1_SUBMODULE0_IRQHandler - LDR R0, =FLEXPWM1_SUBMODULE0_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM1_SUBMODULE1_IRQHandler - PUBWEAK FLEXPWM1_SUBMODULE1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM1_SUBMODULE1_IRQHandler - LDR R0, =FLEXPWM1_SUBMODULE1_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM1_SUBMODULE2_IRQHandler - PUBWEAK FLEXPWM1_SUBMODULE2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM1_SUBMODULE2_IRQHandler - LDR R0, =FLEXPWM1_SUBMODULE2_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM1_SUBMODULE3_IRQHandler - PUBWEAK FLEXPWM1_SUBMODULE3_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM1_SUBMODULE3_IRQHandler - LDR R0, =FLEXPWM1_SUBMODULE3_DriverIRQHandler - BX R0 - - PUBWEAK QDC0_COMPARE_IRQHandler - PUBWEAK QDC0_COMPARE_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC0_COMPARE_IRQHandler - LDR R0, =QDC0_COMPARE_DriverIRQHandler - BX R0 - - PUBWEAK QDC0_HOME_IRQHandler - PUBWEAK QDC0_HOME_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC0_HOME_IRQHandler - LDR R0, =QDC0_HOME_DriverIRQHandler - BX R0 - - PUBWEAK QDC0_WDG_SAB_IRQHandler - PUBWEAK QDC0_WDG_SAB_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC0_WDG_SAB_IRQHandler - LDR R0, =QDC0_WDG_SAB_DriverIRQHandler - BX R0 - - PUBWEAK QDC0_IDX_IRQHandler - PUBWEAK QDC0_IDX_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC0_IDX_IRQHandler - LDR R0, =QDC0_IDX_DriverIRQHandler - BX R0 - - PUBWEAK QDC1_COMPARE_IRQHandler - PUBWEAK QDC1_COMPARE_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC1_COMPARE_IRQHandler - LDR R0, =QDC1_COMPARE_DriverIRQHandler - BX R0 - - PUBWEAK QDC1_HOME_IRQHandler - PUBWEAK QDC1_HOME_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC1_HOME_IRQHandler - LDR R0, =QDC1_HOME_DriverIRQHandler - BX R0 - - PUBWEAK QDC1_WDG_SAB_IRQHandler - PUBWEAK QDC1_WDG_SAB_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC1_WDG_SAB_IRQHandler - LDR R0, =QDC1_WDG_SAB_DriverIRQHandler - BX R0 - - PUBWEAK QDC1_IDX_IRQHandler - PUBWEAK QDC1_IDX_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC1_IDX_IRQHandler - LDR R0, =QDC1_IDX_DriverIRQHandler - BX R0 - - PUBWEAK ITRC0_IRQHandler - PUBWEAK ITRC0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ITRC0_IRQHandler - LDR R0, =ITRC0_DriverIRQHandler - BX R0 - - PUBWEAK Reserved149_IRQHandler - PUBWEAK Reserved149_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved149_IRQHandler - LDR R0, =Reserved149_DriverIRQHandler - BX R0 - - PUBWEAK ELS_ERR_IRQHandler - PUBWEAK ELS_ERR_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ELS_ERR_IRQHandler - LDR R0, =ELS_ERR_DriverIRQHandler - BX R0 - - PUBWEAK PKC_ERR_IRQHandler - PUBWEAK PKC_ERR_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -PKC_ERR_IRQHandler - LDR R0, =PKC_ERR_DriverIRQHandler - BX R0 - - PUBWEAK ERM_SINGLE_BIT_ERROR_IRQHandler - PUBWEAK ERM_SINGLE_BIT_ERROR_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ERM_SINGLE_BIT_ERROR_IRQHandler - LDR R0, =ERM_SINGLE_BIT_ERROR_DriverIRQHandler - BX R0 - - PUBWEAK ERM_MULTI_BIT_ERROR_IRQHandler - PUBWEAK ERM_MULTI_BIT_ERROR_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ERM_MULTI_BIT_ERROR_IRQHandler - LDR R0, =ERM_MULTI_BIT_ERROR_DriverIRQHandler - BX R0 - - PUBWEAK FMU0_IRQHandler - PUBWEAK FMU0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FMU0_IRQHandler - LDR R0, =FMU0_DriverIRQHandler - BX R0 - - PUBWEAK Reserved155_IRQHandler - PUBWEAK Reserved155_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved155_IRQHandler - LDR R0, =Reserved155_DriverIRQHandler - BX R0 - - PUBWEAK Reserved156_IRQHandler - PUBWEAK Reserved156_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved156_IRQHandler - LDR R0, =Reserved156_DriverIRQHandler - BX R0 - - PUBWEAK Reserved157_IRQHandler - PUBWEAK Reserved157_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved157_IRQHandler - LDR R0, =Reserved157_DriverIRQHandler - BX R0 - - PUBWEAK Reserved158_IRQHandler - PUBWEAK Reserved158_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved158_IRQHandler - LDR R0, =Reserved158_DriverIRQHandler - BX R0 - - PUBWEAK LPTMR0_IRQHandler - PUBWEAK LPTMR0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LPTMR0_IRQHandler - LDR R0, =LPTMR0_DriverIRQHandler - BX R0 - - PUBWEAK LPTMR1_IRQHandler - PUBWEAK LPTMR1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LPTMR1_IRQHandler - LDR R0, =LPTMR1_DriverIRQHandler - BX R0 - - PUBWEAK SCG_IRQHandler - PUBWEAK SCG_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SCG_IRQHandler - LDR R0, =SCG_DriverIRQHandler - BX R0 - - PUBWEAK SPC_IRQHandler - PUBWEAK SPC_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SPC_IRQHandler - LDR R0, =SPC_DriverIRQHandler - BX R0 - - PUBWEAK WUU_IRQHandler - PUBWEAK WUU_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -WUU_IRQHandler - LDR R0, =WUU_DriverIRQHandler - BX R0 - - PUBWEAK PORT_EFT_IRQHandler - PUBWEAK PORT_EFT_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -PORT_EFT_IRQHandler - LDR R0, =PORT_EFT_DriverIRQHandler - BX R0 - - PUBWEAK Reserved165_IRQHandler - PUBWEAK Reserved165_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved165_IRQHandler - LDR R0, =Reserved165_DriverIRQHandler - BX R0 - - PUBWEAK Reserved166_IRQHandler - PUBWEAK Reserved166_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved166_IRQHandler - LDR R0, =Reserved166_DriverIRQHandler - BX R0 - - PUBWEAK Reserved167_IRQHandler - PUBWEAK Reserved167_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved167_IRQHandler - LDR R0, =Reserved167_DriverIRQHandler - BX R0 - - PUBWEAK WWDT0_IRQHandler - PUBWEAK WWDT0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -WWDT0_IRQHandler - LDR R0, =WWDT0_DriverIRQHandler - BX R0 - - PUBWEAK WWDT1_IRQHandler - PUBWEAK WWDT1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -WWDT1_IRQHandler - LDR R0, =WWDT1_DriverIRQHandler - BX R0 - - PUBWEAK CMC0_IRQHandler - PUBWEAK CMC0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CMC0_IRQHandler - LDR R0, =CMC0_DriverIRQHandler - BX R0 - - PUBWEAK Reserved171_IRQHandler - PUBWEAK Reserved171_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved171_IRQHandler - LDR R0, =Reserved171_DriverIRQHandler - BX R0 - -OR_DriverIRQHandler -EDMA_0_CH0_DriverIRQHandler -EDMA_0_CH1_DriverIRQHandler -EDMA_0_CH2_DriverIRQHandler -EDMA_0_CH3_DriverIRQHandler -EDMA_0_CH4_DriverIRQHandler -EDMA_0_CH5_DriverIRQHandler -EDMA_0_CH6_DriverIRQHandler -EDMA_0_CH7_DriverIRQHandler -EDMA_0_CH8_DriverIRQHandler -EDMA_0_CH9_DriverIRQHandler -EDMA_0_CH10_DriverIRQHandler -EDMA_0_CH11_DriverIRQHandler -EDMA_0_CH12_DriverIRQHandler -EDMA_0_CH13_DriverIRQHandler -EDMA_0_CH14_DriverIRQHandler -EDMA_0_CH15_DriverIRQHandler -GPIO00_DriverIRQHandler -GPIO01_DriverIRQHandler -GPIO10_DriverIRQHandler -GPIO11_DriverIRQHandler -GPIO20_DriverIRQHandler -GPIO21_DriverIRQHandler -GPIO30_DriverIRQHandler -GPIO31_DriverIRQHandler -GPIO40_DriverIRQHandler -GPIO41_DriverIRQHandler -GPIO50_DriverIRQHandler -GPIO51_DriverIRQHandler -UTICK0_DriverIRQHandler -MRT0_DriverIRQHandler -CTIMER0_DriverIRQHandler -CTIMER1_DriverIRQHandler -Reserved49_DriverIRQHandler -CTIMER2_DriverIRQHandler -LP_FLEXCOMM0_DriverIRQHandler -LP_FLEXCOMM1_DriverIRQHandler -LP_FLEXCOMM2_DriverIRQHandler -LP_FLEXCOMM3_DriverIRQHandler -LP_FLEXCOMM4_DriverIRQHandler -LP_FLEXCOMM5_DriverIRQHandler -LP_FLEXCOMM6_DriverIRQHandler -LP_FLEXCOMM7_DriverIRQHandler -Reserved59_DriverIRQHandler -Reserved60_DriverIRQHandler -ADC0_DriverIRQHandler -ADC1_DriverIRQHandler -PINT0_DriverIRQHandler -PDM_EVENT_DriverIRQHandler -Reserved65_DriverIRQHandler -Reserved66_DriverIRQHandler -USB0_DCD_DriverIRQHandler -RTC_DriverIRQHandler -SMARTDMA_DriverIRQHandler -Reserved70_DriverIRQHandler -CTIMER3_DriverIRQHandler -CTIMER4_DriverIRQHandler -OS_EVENT_DriverIRQHandler -Reserved74_DriverIRQHandler -SAI0_DriverIRQHandler -SAI1_DriverIRQHandler -Reserved77_DriverIRQHandler -CAN0_DriverIRQHandler -CAN1_DriverIRQHandler -Reserved80_DriverIRQHandler -Reserved81_DriverIRQHandler -USB1_HS_PHY_DriverIRQHandler -USB1_HS_DriverIRQHandler -SEC_HYPERVISOR_CALL_DriverIRQHandler -Reserved85_DriverIRQHandler -Reserved86_DriverIRQHandler -Freqme_DriverIRQHandler -SEC_VIO_DriverIRQHandler -ELS_DriverIRQHandler -PKC_DriverIRQHandler -PUF_DriverIRQHandler -Reserved92_DriverIRQHandler -EDMA_1_CH0_DriverIRQHandler -EDMA_1_CH1_DriverIRQHandler -EDMA_1_CH2_DriverIRQHandler -EDMA_1_CH3_DriverIRQHandler -EDMA_1_CH4_DriverIRQHandler -EDMA_1_CH5_DriverIRQHandler -EDMA_1_CH6_DriverIRQHandler -EDMA_1_CH7_DriverIRQHandler -Reserved101_DriverIRQHandler -Reserved102_DriverIRQHandler -Reserved103_DriverIRQHandler -Reserved104_DriverIRQHandler -Reserved105_DriverIRQHandler -Reserved106_DriverIRQHandler -Reserved107_DriverIRQHandler -Reserved108_DriverIRQHandler -CDOG0_DriverIRQHandler -CDOG1_DriverIRQHandler -I3C0_DriverIRQHandler -I3C1_DriverIRQHandler -Reserved113_DriverIRQHandler -GDET_DriverIRQHandler -VBAT0_DriverIRQHandler -EWM0_DriverIRQHandler -Reserved117_DriverIRQHandler -Reserved118_DriverIRQHandler -Reserved119_DriverIRQHandler -Reserved120_DriverIRQHandler -FLEXIO_DriverIRQHandler -Reserved122_DriverIRQHandler -Reserved123_DriverIRQHandler -Reserved124_DriverIRQHandler -HSCMP0_DriverIRQHandler -HSCMP1_DriverIRQHandler -Reserved127_DriverIRQHandler -FLEXPWM0_RELOAD_ERROR_DriverIRQHandler -FLEXPWM0_FAULT_DriverIRQHandler -FLEXPWM0_SUBMODULE0_DriverIRQHandler -FLEXPWM0_SUBMODULE1_DriverIRQHandler -FLEXPWM0_SUBMODULE2_DriverIRQHandler -FLEXPWM0_SUBMODULE3_DriverIRQHandler -FLEXPWM1_RELOAD_ERROR_DriverIRQHandler -FLEXPWM1_FAULT_DriverIRQHandler -FLEXPWM1_SUBMODULE0_DriverIRQHandler -FLEXPWM1_SUBMODULE1_DriverIRQHandler -FLEXPWM1_SUBMODULE2_DriverIRQHandler -FLEXPWM1_SUBMODULE3_DriverIRQHandler -QDC0_COMPARE_DriverIRQHandler -QDC0_HOME_DriverIRQHandler -QDC0_WDG_SAB_DriverIRQHandler -QDC0_IDX_DriverIRQHandler -QDC1_COMPARE_DriverIRQHandler -QDC1_HOME_DriverIRQHandler -QDC1_WDG_SAB_DriverIRQHandler -QDC1_IDX_DriverIRQHandler -ITRC0_DriverIRQHandler -Reserved149_DriverIRQHandler -ELS_ERR_DriverIRQHandler -PKC_ERR_DriverIRQHandler -ERM_SINGLE_BIT_ERROR_DriverIRQHandler -ERM_MULTI_BIT_ERROR_DriverIRQHandler -FMU0_DriverIRQHandler -Reserved155_DriverIRQHandler -Reserved156_DriverIRQHandler -Reserved157_DriverIRQHandler -Reserved158_DriverIRQHandler -LPTMR0_DriverIRQHandler -LPTMR1_DriverIRQHandler -SCG_DriverIRQHandler -SPC_DriverIRQHandler -WUU_DriverIRQHandler -PORT_EFT_DriverIRQHandler -Reserved165_DriverIRQHandler -Reserved166_DriverIRQHandler -Reserved167_DriverIRQHandler -WWDT0_DriverIRQHandler -WWDT1_DriverIRQHandler -CMC0_DriverIRQHandler -Reserved171_DriverIRQHandler -DefaultISR - B . - - END diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/system_MCXN236.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/system_MCXN236.c deleted file mode 100644 index 11c0ff20f0c..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/system_MCXN236.c +++ /dev/null @@ -1,128 +0,0 @@ -/* -** ################################################################### -** Processors: MCXN236VDF -** MCXN236VNL -** -** Compilers: GNU C Compiler -** IAR ANSI C/C++ Compiler for ARM -** Keil ARM C/C++ Compiler -** MCUXpresso Compiler -** -** Reference manual: MCXN23XRM -** Version: rev. 1.0, 2023-10-01 -** Build: b240307 -** -** 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-2024 NXP -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** Revisions: -** - rev. 1.0 (2023-10-01) -** Initial version based on RM 1.2 -** -** ################################################################### -*/ - -/*! - * @file MCXN236 - * @version 1.0 - * @date 2023-10-01 - * @brief Device specific configuration file for MCXN236 (implementation file) - * - * 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. - */ - -#include -#include "fsl_device_registers.h" - - - - - - -/* ---------------------------------------------------------------------------- - -- Core clock - ---------------------------------------------------------------------------- */ - -uint32_t SystemCoreClock = DEFAULT_SYSTEM_CLOCK; - -/* ---------------------------------------------------------------------------- - -- SystemInit() - ---------------------------------------------------------------------------- */ - -__attribute__ ((weak)) 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 << 0*2) | (3UL << 1*2)); /* set CP0, CP1 Full Access in Secure mode (enable PowerQuad) */ -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) - SCB_NS->CPACR |= ((3UL << 0*2) | (3UL << 1*2)); /* set CP0, CP1 Full Access in Normal mode (enable PowerQuad) */ -#endif /* (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ - - SCB->NSACR |= ((3UL << 0) | (3UL << 10)); /* enable CP0, CP1, CP10, CP11 Non-secure Access */ - - SYSCON->ECC_ENABLE_CTRL = 0; /* disable RAM ECC to get max RAM size */ - - SYSCON->NVM_CTRL &= ~SYSCON_NVM_CTRL_DIS_MBECC_ERR_DATA_MASK; /* enables bus error on multi-bit ECC error for data */ - -#if defined(__MCUXPRESSO) - extern void(*const g_pfnVectors[]) (void); - SCB->VTOR = (uint32_t) &g_pfnVectors; -#else - extern void *__Vectors; - SCB->VTOR = (uint32_t) &__Vectors; -#endif - - /* enable the flash cache LPCAC */ - SYSCON->LPCAC_CTRL &= ~SYSCON_LPCAC_CTRL_DIS_LPCAC_MASK; - - /* Disable aGDET trigger the CHIP_RESET */ - ITRC0->OUT_SEL[4][0] = (ITRC0->OUT_SEL[4][0] & ~ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN9_SELn_MASK) | (ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN9_SELn(0x2)); - ITRC0->OUT_SEL[4][1] = (ITRC0->OUT_SEL[4][1] & ~ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN9_SELn_MASK) | (ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN9_SELn(0x2)); - /* Disable aGDET interrupt and reset */ - SPC0->ACTIVE_CFG |= SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE_MASK; - SPC0->GLITCH_DETECT_SC &= ~SPC_GLITCH_DETECT_SC_LOCK_MASK; - SPC0->GLITCH_DETECT_SC = 0x3C; - SPC0->GLITCH_DETECT_SC |= SPC_GLITCH_DETECT_SC_LOCK_MASK; - - /* Disable dGDET trigger the CHIP_RESET */ - ITRC0->OUT_SEL[4][0] = (ITRC0->OUT_SEL[4][0] & ~ ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN0_SELn_MASK) | (ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN0_SELn(0x2)); - ITRC0->OUT_SEL[4][1] = (ITRC0->OUT_SEL[4][1] & ~ ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN0_SELn_MASK) | (ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN0_SELn(0x2)); - GDET0->GDET_ENABLE1 = 0; - GDET1->GDET_ENABLE1 = 0; - - SystemInitHook(); -} - -/* ---------------------------------------------------------------------------- - -- SystemCoreClockUpdate() - ---------------------------------------------------------------------------- */ - -void SystemCoreClockUpdate (void) { - - - -} - -/* ---------------------------------------------------------------------------- - -- SystemInitHook() - ---------------------------------------------------------------------------- */ - -__attribute__ ((weak)) void SystemInitHook (void) { - /* Void implementation of the weak function. */ -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/system_MCXN236.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/system_MCXN236.h deleted file mode 100644 index 2406a9790a2..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/MCXN236/system_MCXN236.h +++ /dev/null @@ -1,106 +0,0 @@ -/* -** ################################################################### -** Processors: MCXN236VDF -** MCXN236VNL -** -** Compilers: GNU C Compiler -** IAR ANSI C/C++ Compiler for ARM -** Keil ARM C/C++ Compiler -** MCUXpresso Compiler -** -** Reference manual: MCXN23XRM -** Version: rev. 1.0, 2023-10-01 -** Build: b240307 -** -** 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-2024 NXP -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** Revisions: -** - rev. 1.0 (2023-10-01) -** Initial version based on RM 1.2 -** -** ################################################################### -*/ - -/*! - * @file MCXN236 - * @version 1.0 - * @date 2023-10-01 - * @brief Device specific configuration file for MCXN236 (header file) - * - * 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. - */ - -#ifndef _SYSTEM_MCXN236_H_ -#define _SYSTEM_MCXN236_H_ /**< Symbol preventing repeated inclusion */ - -#ifdef __cplusplus -extern "C" { -#endif - -#include - - - #define DEFAULT_SYSTEM_CLOCK 48000000u /* Default System clock value */ -#define CLK_FRO_12MHZ 12000000u /* FRO 12 MHz (fro_12m) */ -#define CLK_FRO_144MHZ 144000000u /* FRO 144 MHz (fro_144m) */ - - - -/** - * @brief System clock frequency (core clock) - * - * The system clock frequency supplied to the SysTick timer and the processor - * core clock. This variable can be used by the user application to setup the - * SysTick timer or configure other parameters. It may also be used by debugger to - * query the frequency of the debug timer or configure the trace clock speed - * SystemCoreClock is initialized with a correct predefined value. - */ -extern uint32_t SystemCoreClock; - -/** - * @brief Setup the microcontroller system. - * - * Typically this function configures the oscillator (PLL) that is part of the - * microcontroller device. For systems with variable clock speed it also updates - * the variable SystemCoreClock. SystemInit is called from startup_device file. - */ -void SystemInit (void); - -/** - * @brief Updates the SystemCoreClock variable. - * - * It must be called whenever the core clock is changed during program - * execution. SystemCoreClockUpdate() evaluates the clock register settings and calculates - * the current core clock. - */ -void SystemCoreClockUpdate (void); - -/** - * @brief SystemInit function hook. - * - * This weak function allows to call specific initialization code during the - * SystemInit() execution.This can be used when an application specific code needs - * to be called as close to the reset entry as possible (for example the Multicore - * Manager MCMGR_EarlyInit() function call). - * NOTE: No global r/w variables can be used in this hook function because the - * initialization of these variables happens after this function. - */ -void SystemInitHook (void); - -#ifdef __cplusplus -} -#endif - -#endif /* _SYSTEM_MCXN236_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/SConscript b/bsp/nxp/mcx/mcxn/Libraries/MCXN236/SConscript deleted file mode 100644 index 6d5501ebe6f..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN236/SConscript +++ /dev/null @@ -1,63 +0,0 @@ -Import('rtconfig') -from building import * - -cwd = GetCurrentDir() -path = [cwd + '/../CMSIS/Core/Include', cwd + '/MCXN236', cwd + '/MCXN236/drivers'] -src = Split(''' - MCXN236/system_MCXN236.c - ''') - -if rtconfig.PLATFORM in ['gcc']: - src += ['MCXN236/gcc/startup_MCXN236.S'] -elif rtconfig.PLATFORM in ['armcc', 'armclang']: - src += ['MCXN236/arm/startup_MCXN236.S'] -elif rtconfig.PLATFORM in ['iccarm']: - src += ['MCXN236/iar/startup_MCXN236.s'] - -src += ['MCXN236/drivers/fsl_cache_lpcac.c'] -src += ['MCXN236/drivers/fsl_cdog.c'] -src += ['MCXN236/drivers/fsl_clock.c'] -src += ['MCXN236/drivers/fsl_cmc.c'] -src += ['MCXN236/drivers/fsl_common.c'] -src += ['MCXN236/drivers/fsl_common_arm.c'] -src += ['MCXN236/drivers/fsl_crc.c'] -src += ['MCXN236/drivers/fsl_ctimer.c'] -src += ['MCXN236/drivers/fsl_edma.c'] -src += ['MCXN236/drivers/fsl_edma_soc.c'] -src += ['MCXN236/drivers/fsl_eim.c'] -src += ['MCXN236/drivers/fsl_erm.c'] -src += ['MCXN236/drivers/fsl_evtg.c'] -src += ['MCXN236/drivers/fsl_ewm.c'] -src += ['MCXN236/drivers/fsl_flexcan.c'] -src += ['MCXN236/drivers/fsl_flexcan_edma.c'] -src += ['MCXN236/drivers/fsl_flexio.c'] -src += ['MCXN236/drivers/fsl_flexio_i2c_master.c'] -src += ['MCXN236/drivers/fsl_flexio_mculcd.c'] -src += ['MCXN236/drivers/fsl_flexio_mculcd_edma.c'] -src += ['MCXN236/drivers/fsl_flexio_spi.c'] -src += ['MCXN236/drivers/fsl_flexio_spi_edma.c'] -src += ['MCXN236/drivers/fsl_flexio_uart.c'] -src += ['MCXN236/drivers/fsl_flexio_uart_edma.c'] -src += ['MCXN236/drivers/fsl_freqme.c'] -src += ['MCXN236/drivers/fsl_gpio.c'] -src += ['MCXN236/drivers/fsl_i3c.c'] -src += ['MCXN236/drivers/fsl_i3c_edma.c'] -src += ['MCXN236/drivers/fsl_irtc.c'] -src += ['MCXN236/drivers/fsl_lpadc.c'] -src += ['MCXN236/drivers/fsl_lpflexcomm.c'] -src += ['MCXN236/drivers/fsl_lpi2c.c'] -src += ['MCXN236/drivers/fsl_lpi2c_edma.c'] -src += ['MCXN236/drivers/fsl_lpspi.c'] -src += ['MCXN236/drivers/fsl_lpspi_edma.c'] -src += ['MCXN236/drivers/fsl_lptmr.c'] -src += ['MCXN236/drivers/fsl_lpuart.c'] -src += ['MCXN236/drivers/fsl_mrt.c'] -src += ['MCXN236/drivers/fsl_wwdt.c'] -src += ['MCXN236/drivers/fsl_reset.c'] -src += ['MCXN236/drivers/fsl_spc.c'] -src += ['MCXN236/drivers/fsl_vref.c'] - - -group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path) - -Return('group') diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/MCXN947_cm33_core0.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/MCXN947_cm33_core0.h deleted file mode 100644 index ddff7eb30ea..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/MCXN947_cm33_core0.h +++ /dev/null @@ -1,93743 +0,0 @@ -/* -** ################################################################### -** Processors: MCXN947VDF_cm33_core0 -** MCXN947VNL_cm33_core0 -** -** Compilers: GNU C Compiler -** IAR ANSI C/C++ Compiler for ARM -** Keil ARM C/C++ Compiler -** MCUXpresso Compiler -** -** Reference manual: MCXNx4x Reference Manual -** Version: rev. 2.0, 2023-02-01 -** Build: b240510 -** -** Abstract: -** CMSIS Peripheral Access Layer for MCXN947_cm33_core0 -** -** Copyright 1997-2016 Freescale Semiconductor, Inc. -** Copyright 2016-2024 NXP -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** Revisions: -** - rev. 1.0 (2022-10-01) -** Initial version -** - rev. 2.0 (2023-02-01) -** Initial version based on Rev. 2 Draft B -** -** ################################################################### -*/ - -/*! - * @file MCXN947_cm33_core0.h - * @version 2.0 - * @date 2023-02-01 - * @brief CMSIS Peripheral Access Layer for MCXN947_cm33_core0 - * - * CMSIS Peripheral Access Layer for MCXN947_cm33_core0 - */ - -#if !defined(MCXN947_CM33_CORE0_H_) -#define MCXN947_CM33_CORE0_H_ /**< Symbol preventing repeated inclusion */ - -/** Memory map major version (memory maps with equal major version number are - * compatible) */ -#define MCU_MEM_MAP_VERSION 0x0200U -/** Memory map minor version */ -#define MCU_MEM_MAP_VERSION_MINOR 0x0000U - - -/* ---------------------------------------------------------------------------- - -- Interrupt vector numbers - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup Interrupt_vector_numbers Interrupt vector numbers - * @{ - */ - -/** Interrupt Number Definitions */ -#define NUMBER_OF_INT_VECTORS 172 /**< Number of interrupts in the Vector table */ - -typedef enum IRQn { - /* Auxiliary constants */ - NotAvail_IRQn = -128, /**< Not available device specific interrupt */ - - /* Core interrupts */ - NonMaskableInt_IRQn = -14, /**< Non Maskable Interrupt */ - HardFault_IRQn = -13, /**< Cortex-M33 SV Hard Fault Interrupt */ - MemoryManagement_IRQn = -12, /**< Cortex-M33 Memory Management Interrupt */ - BusFault_IRQn = -11, /**< Cortex-M33 Bus Fault Interrupt */ - UsageFault_IRQn = -10, /**< Cortex-M33 Usage Fault Interrupt */ - SecureFault_IRQn = -9, /**< Cortex-M33 Secure Fault Interrupt */ - SVCall_IRQn = -5, /**< Cortex-M33 SV Call Interrupt */ - DebugMonitor_IRQn = -4, /**< Cortex-M33 Debug Monitor Interrupt */ - PendSV_IRQn = -2, /**< Cortex-M33 Pend SV Interrupt */ - SysTick_IRQn = -1, /**< Cortex-M33 System Tick Interrupt */ - - /* Device specific interrupts */ - OR_IRQn = 0, /**< OR IRQ */ - EDMA_0_CH0_IRQn = 1, /**< eDMA_0_CH0 error or transfer complete */ - EDMA_0_CH1_IRQn = 2, /**< eDMA_0_CH1 error or transfer complete */ - EDMA_0_CH2_IRQn = 3, /**< eDMA_0_CH2 error or transfer complete */ - EDMA_0_CH3_IRQn = 4, /**< eDMA_0_CH3 error or transfer complete */ - EDMA_0_CH4_IRQn = 5, /**< eDMA_0_CH4 error or transfer complete */ - EDMA_0_CH5_IRQn = 6, /**< eDMA_0_CH5 error or transfer complete */ - EDMA_0_CH6_IRQn = 7, /**< eDMA_0_CH6 error or transfer complete */ - EDMA_0_CH7_IRQn = 8, /**< eDMA_0_CH7 error or transfer complete */ - EDMA_0_CH8_IRQn = 9, /**< eDMA_0_CH8 error or transfer complete */ - EDMA_0_CH9_IRQn = 10, /**< eDMA_0_CH9 error or transfer complete */ - EDMA_0_CH10_IRQn = 11, /**< eDMA_0_CH10 error or transfer complete */ - EDMA_0_CH11_IRQn = 12, /**< eDMA_0_CH11 error or transfer complete */ - EDMA_0_CH12_IRQn = 13, /**< eDMA_0_CH12 error or transfer complete */ - EDMA_0_CH13_IRQn = 14, /**< eDMA_0_CH13 error or transfer complete */ - EDMA_0_CH14_IRQn = 15, /**< eDMA_0_CH14 error or transfer complete */ - EDMA_0_CH15_IRQn = 16, /**< eDMA_0_CH15 error or transfer complete */ - GPIO00_IRQn = 17, /**< GPIO0 interrupt 0 */ - GPIO01_IRQn = 18, /**< GPIO0 interrupt 1 */ - GPIO10_IRQn = 19, /**< GPIO1 interrupt 0 */ - GPIO11_IRQn = 20, /**< GPIO1 interrupt 1 */ - GPIO20_IRQn = 21, /**< GPIO2 interrupt 0 */ - GPIO21_IRQn = 22, /**< GPIO2 interrupt 1 */ - GPIO30_IRQn = 23, /**< GPIO3 interrupt 0 */ - GPIO31_IRQn = 24, /**< GPIO3 interrupt 1 */ - GPIO40_IRQn = 25, /**< GPIO4 interrupt 0 */ - GPIO41_IRQn = 26, /**< GPIO4 interrupt 1 */ - GPIO50_IRQn = 27, /**< GPIO5 interrupt 0 */ - GPIO51_IRQn = 28, /**< GPIO5 interrupt 1 */ - UTICK0_IRQn = 29, /**< Micro-Tick Timer interrupt */ - MRT0_IRQn = 30, /**< Multi-Rate Timer interrupt */ - CTIMER0_IRQn = 31, /**< Standard counter/timer 0 interrupt */ - CTIMER1_IRQn = 32, /**< Standard counter/timer 1 interrupt */ - SCT0_IRQn = 33, /**< SCTimer/PWM interrupt */ - CTIMER2_IRQn = 34, /**< Standard counter/timer 2 interrupt */ - LP_FLEXCOMM0_IRQn = 35, /**< LP_FLEXCOMM0 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) */ - LP_FLEXCOMM1_IRQn = 36, /**< LP_FLEXCOMM1 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) */ - LP_FLEXCOMM2_IRQn = 37, /**< LP_FLEXCOMM2 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) */ - LP_FLEXCOMM3_IRQn = 38, /**< LP_FLEXCOMM3 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) */ - LP_FLEXCOMM4_IRQn = 39, /**< LP_FLEXCOMM4 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) */ - LP_FLEXCOMM5_IRQn = 40, /**< LP_FLEXCOMM5 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) */ - LP_FLEXCOMM6_IRQn = 41, /**< LP_FLEXCOMM6 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) */ - LP_FLEXCOMM7_IRQn = 42, /**< LP_FLEXCOMM7 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) */ - LP_FLEXCOMM8_IRQn = 43, /**< LP_FLEXCOMM8 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) */ - LP_FLEXCOMM9_IRQn = 44, /**< LP_FLEXCOMM9 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) */ - ADC0_IRQn = 45, /**< Analog-to-Digital Converter 0 - General Purpose interrupt */ - ADC1_IRQn = 46, /**< Analog-to-Digital Converter 1 - General Purpose interrupt */ - PINT0_IRQn = 47, /**< Pin Interrupt Pattern Match Interrupt */ - PDM_EVENT_IRQn = 48, /**< Microphone Interface interrupt */ - Reserved65_IRQn = 49, /**< Reserved interrupt */ - USB0_FS_IRQn = 50, /**< Universal Serial Bus - Full Speed interrupt */ - USB0_DCD_IRQn = 51, /**< Universal Serial Bus - Device Charge Detect interrupt */ - RTC_IRQn = 52, /**< RTC Subsystem interrupt (RTC interrupt or Wake timer interrupt) */ - SMARTDMA_IRQn = 53, /**< SmartDMA_IRQ */ - MAILBOX_IRQn = 54, /**< Inter-CPU Mailbox interrupt0 for CPU0 Inter-CPU Mailbox interrupt1 for CPU1 */ - CTIMER3_IRQn = 55, /**< Standard counter/timer 3 interrupt */ - CTIMER4_IRQn = 56, /**< Standard counter/timer 4 interrupt */ - OS_EVENT_IRQn = 57, /**< OS event timer interrupt */ - FLEXSPI0_IRQn = 58, /**< Flexible Serial Peripheral Interface interrupt */ - SAI0_IRQn = 59, /**< Serial Audio Interface 0 interrupt */ - SAI1_IRQn = 60, /**< Serial Audio Interface 1 interrupt */ - USDHC0_IRQn = 61, /**< Ultra Secured Digital Host Controller interrupt */ - CAN0_IRQn = 62, /**< Controller Area Network 0 interrupt */ - CAN1_IRQn = 63, /**< Controller Area Network 1 interrupt */ - Reserved80_IRQn = 64, /**< Reserved interrupt */ - Reserved81_IRQn = 65, /**< Reserved interrupt */ - USB1_HS_PHY_IRQn = 66, /**< USBHS DCD or USBHS Phy interrupt */ - USB1_HS_IRQn = 67, /**< USB High Speed OTG Controller interrupt */ - SEC_HYPERVISOR_CALL_IRQn = 68, /**< AHB Secure Controller hypervisor call interrupt */ - Reserved85_IRQn = 69, /**< Reserved interrupt */ - PLU_IRQn = 70, /**< Programmable Logic Unit interrupt */ - Freqme_IRQn = 71, /**< Frequency Measurement interrupt */ - SEC_VIO_IRQn = 72, /**< Secure violation interrupt (Memory Block Checker interrupt or secure AHB matrix violation interrupt) */ - ELS_IRQn = 73, /**< ELS interrupt */ - PKC_IRQn = 74, /**< PKC interrupt */ - PUF_IRQn = 75, /**< Physical Unclonable Function interrupt */ - PQ_IRQn = 76, /**< Power Quad interrupt */ - EDMA_1_CH0_IRQn = 77, /**< eDMA_1_CH0 error or transfer complete */ - EDMA_1_CH1_IRQn = 78, /**< eDMA_1_CH1 error or transfer complete */ - EDMA_1_CH2_IRQn = 79, /**< eDMA_1_CH2 error or transfer complete */ - EDMA_1_CH3_IRQn = 80, /**< eDMA_1_CH3 error or transfer complete */ - EDMA_1_CH4_IRQn = 81, /**< eDMA_1_CH4 error or transfer complete */ - EDMA_1_CH5_IRQn = 82, /**< eDMA_1_CH5 error or transfer complete */ - EDMA_1_CH6_IRQn = 83, /**< eDMA_1_CH6 error or transfer complete */ - EDMA_1_CH7_IRQn = 84, /**< eDMA_1_CH7 error or transfer complete */ - EDMA_1_CH8_IRQn = 85, /**< eDMA_1_CH8 error or transfer complete */ - EDMA_1_CH9_IRQn = 86, /**< eDMA_1_CH9 error or transfer complete */ - EDMA_1_CH10_IRQn = 87, /**< eDMA_1_CH10 error or transfer complete */ - EDMA_1_CH11_IRQn = 88, /**< eDMA_1_CH11 error or transfer complete */ - EDMA_1_CH12_IRQn = 89, /**< eDMA_1_CH12 error or transfer complete */ - EDMA_1_CH13_IRQn = 90, /**< eDMA_1_CH13 error or transfer complete */ - EDMA_1_CH14_IRQn = 91, /**< eDMA_1_CH14 error or transfer complete */ - EDMA_1_CH15_IRQn = 92, /**< eDMA_1_CH15 error or transfer complete */ - CDOG0_IRQn = 93, /**< Code Watchdog Timer 0 interrupt */ - CDOG1_IRQn = 94, /**< Code Watchdog Timer 1 interrupt */ - I3C0_IRQn = 95, /**< Improved Inter Integrated Circuit interrupt 0 */ - I3C1_IRQn = 96, /**< Improved Inter Integrated Circuit interrupt 1 */ - NPU_IRQn = 97, /**< NPU interrupt */ - GDET_IRQn = 98, /**< Digital Glitch Detect 0 interrupt or Digital Glitch Detect 1 interrupt */ - VBAT0_IRQn = 99, /**< VBAT interrupt( VBAT interrupt or digital tamper interrupt) */ - EWM0_IRQn = 100, /**< External Watchdog Monitor interrupt */ - TSI_END_OF_SCAN_IRQn = 101, /**< TSI End of Scan interrupt */ - TSI_OUT_OF_SCAN_IRQn = 102, /**< TSI Out of Scan interrupt */ - EMVSIM0_IRQn = 103, /**< EMVSIM0 interrupt */ - EMVSIM1_IRQn = 104, /**< EMVSIM1 interrupt */ - FLEXIO_IRQn = 105, /**< Flexible Input/Output interrupt */ - DAC0_IRQn = 106, /**< Digital-to-Analog Converter 0 - General Purpose interrupt */ - DAC1_IRQn = 107, /**< Digital-to-Analog Converter 1 - General Purpose interrupt */ - DAC2_IRQn = 108, /**< 14-bit Digital-to-Analog Converter interrupt */ - HSCMP0_IRQn = 109, /**< High-Speed comparator0 interrupt */ - HSCMP1_IRQn = 110, /**< High-Speed comparator1 interrupt */ - HSCMP2_IRQn = 111, /**< High-Speed comparator2 interrupt */ - FLEXPWM0_RELOAD_ERROR_IRQn = 112, /**< FlexPWM0_reload_error interrupt */ - FLEXPWM0_FAULT_IRQn = 113, /**< FlexPWM0_fault interrupt */ - FLEXPWM0_SUBMODULE0_IRQn = 114, /**< FlexPWM0 Submodule 0 capture/compare/reload interrupt */ - FLEXPWM0_SUBMODULE1_IRQn = 115, /**< FlexPWM0 Submodule 1 capture/compare/reload interrupt */ - FLEXPWM0_SUBMODULE2_IRQn = 116, /**< FlexPWM0 Submodule 2 capture/compare/reload interrupt */ - FLEXPWM0_SUBMODULE3_IRQn = 117, /**< FlexPWM0 Submodule 3 capture/compare/reload interrupt */ - FLEXPWM1_RELOAD_ERROR_IRQn = 118, /**< FlexPWM1_reload_error interrupt */ - FLEXPWM1_FAULT_IRQn = 119, /**< FlexPWM1_fault interrupt */ - FLEXPWM1_SUBMODULE0_IRQn = 120, /**< FlexPWM1 Submodule 0 capture/compare/reload interrupt */ - FLEXPWM1_SUBMODULE1_IRQn = 121, /**< FlexPWM1 Submodule 1 capture/compare/reload interrupt */ - FLEXPWM1_SUBMODULE2_IRQn = 122, /**< FlexPWM1 Submodule 2 capture/compare/reload interrupt */ - FLEXPWM1_SUBMODULE3_IRQn = 123, /**< FlexPWM1 Submodule 3 capture/compare/reload interrupt */ - QDC0_COMPARE_IRQn = 124, /**< QDC0_Compare interrupt */ - QDC0_HOME_IRQn = 125, /**< QDC0_Home interrupt */ - QDC0_WDG_SAB_IRQn = 126, /**< QDC0_WDG_IRQ/SAB interrupt */ - QDC0_IDX_IRQn = 127, /**< QDC0_IDX interrupt */ - QDC1_COMPARE_IRQn = 128, /**< QDC1_Compare interrupt */ - QDC1_HOME_IRQn = 129, /**< QDC1_Home interrupt */ - QDC1_WDG_SAB_IRQn = 130, /**< QDC1_WDG_IRQ/SAB interrupt */ - QDC1_IDX_IRQn = 131, /**< QDC1_IDX interrupt */ - ITRC0_IRQn = 132, /**< Intrusion and Tamper Response Controller interrupt */ - BSP32_IRQn = 133, /**< CoolFlux BSP32 interrupt */ - ELS_ERR_IRQn = 134, /**< ELS error interrupt */ - PKC_ERR_IRQn = 135, /**< PKC error interrupt */ - ERM_SINGLE_BIT_ERROR_IRQn = 136, /**< ERM Single Bit error interrupt */ - ERM_MULTI_BIT_ERROR_IRQn = 137, /**< ERM Multi Bit error interrupt */ - FMU0_IRQn = 138, /**< Flash Management Unit interrupt */ - ETHERNET_IRQn = 139, /**< Ethernet QoS interrupt */ - ETHERNET_PMT_IRQn = 140, /**< Ethernet QoS power management interrupt */ - ETHERNET_MACLP_IRQn = 141, /**< Ethernet QoS MAC interrupt */ - SINC_FILTER_IRQn = 142, /**< SINC Filter interrupt */ - LPTMR0_IRQn = 143, /**< Low Power Timer 0 interrupt */ - LPTMR1_IRQn = 144, /**< Low Power Timer 1 interrupt */ - SCG_IRQn = 145, /**< System Clock Generator interrupt */ - SPC_IRQn = 146, /**< System Power Controller interrupt */ - WUU_IRQn = 147, /**< Wake Up Unit interrupt */ - PORT_EFT_IRQn = 148, /**< PORT0~5 EFT interrupt */ - ETB0_IRQn = 149, /**< ETB counter expires interrupt */ - Reserved166_IRQn = 150, /**< Reserved interrupt */ - Reserved167_IRQn = 151, /**< Reserved interrupt */ - WWDT0_IRQn = 152, /**< Windowed Watchdog Timer 0 interrupt */ - WWDT1_IRQn = 153, /**< Windowed Watchdog Timer 1 interrupt */ - CMC0_IRQn = 154, /**< Core Mode Controller interrupt */ - CTI0_IRQn = 155 /**< Cross Trigger Interface interrupt */ -} IRQn_Type; - -/*! - * @} - */ /* end of group Interrupt_vector_numbers */ - - -/* ---------------------------------------------------------------------------- - -- Cortex M33 Core Configuration - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup Cortex_Core_Configuration Cortex M33 Core Configuration - * @{ - */ - -#define __MPU_PRESENT 1 /**< Defines if an MPU is present or not */ -#define __NVIC_PRIO_BITS 3 /**< Number of priority bits implemented in the NVIC */ -#define __Vendor_SysTickConfig 0 /**< Vendor specific implementation of SysTickConfig is defined */ -#define __FPU_PRESENT 1 /**< Defines if an FPU is present or not */ -#define __DSP_PRESENT 1 /**< Defines if Armv8-M Mainline core supports DSP instructions */ -#define __SAUREGION_PRESENT 1 /**< Defines if an SAU is present or not */ - -#include "core_cm33.h" /* Core Peripheral Access Layer */ -#include "system_MCXN947_cm33_core0.h" /* Device specific configuration file */ - -/*! - * @} - */ /* end of group Cortex_Core_Configuration */ - - -/* ---------------------------------------------------------------------------- - -- Mapping Information - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup Mapping_Information Mapping Information - * @{ - */ - -/** Mapping Information */ -/*! - * @addtogroup dma_request - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @brief Structure for the DMA hardware request - * - * Defines the structure for the DMA hardware request collections. The user can configure the - * hardware request to trigger the DMA transfer accordingly. The index - * of the hardware request varies according to the to SoC. - */ -typedef enum _dma_request_source -{ - kDma0RequestMuxFlexSpi0Rx = 1U, /**< FlexSPI0 Receive event */ - kDma1RequestMuxFlexSpi0Rx = 1U, /**< FlexSPI0 Receive event */ - kDma0RequestMuxFlexSpi0Tx = 2U, /**< FlexSPI0 Transmit event */ - kDma1RequestMuxFlexSpi0Tx = 2U, /**< FlexSPI0 Transmit event */ - kDma0RequestMuxPinInt0 = 3U, /**< PINT0 INT0 */ - kDma1RequestMuxPinInt0 = 3U, /**< PINT0 INT0 */ - kDma0RequestMuxPinInt1 = 4U, /**< PINT0 INT1 */ - kDma1RequestMuxPinInt1 = 4U, /**< PINT0 INT1 */ - kDma0RequestMuxPinInt2 = 5U, /**< PINT0 INT2 */ - kDma1RequestMuxPinInt2 = 5U, /**< PINT0 INT2 */ - kDma0RequestMuxPinInt3 = 6U, /**< PINT0 INT3 */ - kDma1RequestMuxPinInt3 = 6U, /**< PINT0 INT3 */ - kDma0RequestMuxCtimer0M0 = 7U, /**< CTIMER0 Match channel 0 request */ - kDma1RequestMuxCtimer0M0 = 7U, /**< CTIMER0 Match channel 0 request */ - kDma0RequestMuxCtimer0M1 = 8U, /**< CTIMER0 Match channel 1 request */ - kDma1RequestMuxCtimer0M1 = 8U, /**< CTIMER0 Match channel 1 request */ - kDma0RequestMuxCtimer1M0 = 9U, /**< CTIMER1 Match channel 0 request */ - kDma1RequestMuxCtimer1M0 = 9U, /**< CTIMER1 Match channel 0 request */ - kDma0RequestMuxCtimer1M1 = 10U, /**< CTIMER1 Match channel 1 request */ - kDma1RequestMuxCtimer1M1 = 10U, /**< CTIMER1 Match channel 1 request */ - kDma0RequestMuxCtimer2M0 = 11U, /**< CTIMER2 Match channel 0 request */ - kDma1RequestMuxCtimer2M0 = 11U, /**< CTIMER2 Match channel 0 request */ - kDma0RequestMuxCtimer2M1 = 12U, /**< CTIMER2 Match channel 1 request */ - kDma1RequestMuxCtimer2M1 = 12U, /**< CTIMER2 Match channel 1 request */ - kDma0RequestMuxCtimer3M0 = 13U, /**< CTIMER3 Match channel 0 request */ - kDma1RequestMuxCtimer3M0 = 13U, /**< CTIMER3 Match channel 0 request */ - kDma0RequestMuxCtimer3M1 = 14U, /**< CTIMER3 Match channel 1 request */ - kDma1RequestMuxCtimer3M1 = 14U, /**< CTIMER3 Match channel 1 request */ - kDma0RequestMuxCtimer4M0 = 15U, /**< CTIMER4 Match channel 0 request */ - kDma1RequestMuxCtimer4M0 = 15U, /**< CTIMER4 Match channel 0 request */ - kDma0RequestMuxCtimer4M1 = 16U, /**< CTIMER4 Match channel 1 request */ - kDma1RequestMuxCtimer4M1 = 16U, /**< CTIMER4 Match channel 1 request */ - kDma0RequestMuxWuu0 = 17U, /**< WUU0 Wake up event */ - kDma1RequestMuxWuu0 = 17U, /**< WUU0 Wake up event */ - kDma0RequestMuxMicfil0FifoRequest = 18U, /**< MICFIL0 FIFO_request */ - kDma1RequestMuxMicfil0FifoRequest = 18U, /**< MICFIL0 FIFO_request */ - kDma0RequestMuxSct0Dma0 = 19U, /**< SCT0 DMA0 */ - kDma1RequestMuxSct0Dma0 = 19U, /**< SCT0 DMA0 */ - kDma0RequestMuxSct0Dma1 = 20U, /**< SCT0 DMA1 */ - kDma1RequestMuxSct0Dma1 = 20U, /**< SCT0 DMA1 */ - kDma0RequestMuxAdc0FifoARequest = 21U, /**< ADC0 FIFO A request */ - kDma1RequestMuxAdc0FifoARequest = 21U, /**< ADC0 FIFO A request */ - kDma0RequestMuxAdc0FifoBRequest = 22U, /**< ADC0 FIFO B request */ - kDma1RequestMuxAdc0FifoBRequest = 22U, /**< ADC0 FIFO B request */ - kDma0RequestMuxAdc1FifoARequest = 23U, /**< ADC1 FIFO A request */ - kDma1RequestMuxAdc1FifoARequest = 23U, /**< ADC1 FIFO A request */ - kDma0RequestMuxAdc1FifoBRequest = 24U, /**< ADC1 FIFO B request */ - kDma1RequestMuxAdc1FifoBRequest = 24U, /**< ADC1 FIFO B request */ - kDma0RequestMuxDac0FifoRequest = 25U, /**< DAC0 FIFO_request */ - kDma1RequestMuxDac0FifoRequest = 25U, /**< DAC0 FIFO_request */ - kDma0RequestMuxDac1FifoRequest = 26U, /**< DAC1 FIFO_request */ - kDma1RequestMuxDac1FifoRequest = 26U, /**< DAC1 FIFO_request */ - kDma0RequestMuxDac2FifoRequest = 27U, /**< DAC2 FIFO_request */ - kDma1RequestMuxDac2FifoRequest = 27U, /**< DAC2 FIFO_request */ - kDma0RequestMuxHsCmp0DmaRequest = 28U, /**< CMP0 DMA_request */ - kDma1RequestMuxHsCmp0DmaRequest = 28U, /**< CMP0 DMA_request */ - kDma0RequestMuxHsCmp1DmaRequest = 29U, /**< CMP1 DMA_request */ - kDma1RequestMuxHsCmp1DmaRequest = 29U, /**< CMP1 DMA_request */ - kDma0RequestMuxHsCmp2DmaRequest = 30U, /**< CMP2 DMA_request */ - kDma1RequestMuxHsCmp2DmaRequest = 30U, /**< CMP2 DMA_request */ - kDma0RequestMuxEvtg0Out0A = 31U, /**< EVTG0 OUT0A */ - kDma1RequestMuxEvtg0Out0A = 31U, /**< EVTG0 OUT0A */ - kDma0RequestMuxEvtg0Out0B = 32U, /**< EVTG0 OUT0B */ - kDma1RequestMuxEvtg0Out0B = 32U, /**< EVTG0 OUT0B */ - kDma0RequestMuxEvtg0Out1A = 33U, /**< EVTG0 OUT1A */ - kDma1RequestMuxEvtg0Out1A = 33U, /**< EVTG0 OUT1A */ - kDma0RequestMuxEvtg0Out1B = 34U, /**< EVTG0 OUT1B */ - kDma1RequestMuxEvtg0Out1B = 34U, /**< EVTG0 OUT1B */ - kDma0RequestMuxEvtg0Out2A = 35U, /**< EVTG0 OUT2A */ - kDma1RequestMuxEvtg0Out2A = 35U, /**< EVTG0 OUT2A */ - kDma0RequestMuxEvtg0Out2B = 36U, /**< EVTG0 OUT2B */ - kDma1RequestMuxEvtg0Out2B = 36U, /**< EVTG0 OUT2B */ - kDma0RequestMuxEvtg0Out3A = 37U, /**< EVTG0 OUT3A */ - kDma1RequestMuxEvtg0Out3A = 37U, /**< EVTG0 OUT3A */ - kDma0RequestMuxEvtg0Out3B = 38U, /**< EVTG0 OUT3B */ - kDma1RequestMuxEvtg0Out3B = 38U, /**< EVTG0 OUT3B */ - kDma0RequestMuxFlexPwm0ReqCapt0 = 39U, /**< PWM0 capture0 request */ - kDma1RequestMuxFlexPwm0ReqCapt0 = 39U, /**< PWM0 capture0 request */ - kDma0RequestMuxFlexPwm0ReqCapt1 = 40U, /**< PWM0 capture1 request */ - kDma1RequestMuxFlexPwm0ReqCapt1 = 40U, /**< PWM0 capture1 request */ - kDma0RequestMuxFlexPwm0ReqCapt2 = 41U, /**< PWM0 capture2 request */ - kDma1RequestMuxFlexPwm0ReqCapt2 = 41U, /**< PWM0 capture2 request */ - kDma0RequestMuxFlexPwm0ReqCapt3 = 42U, /**< PWM0 capture3 request */ - kDma1RequestMuxFlexPwm0ReqCapt3 = 42U, /**< PWM0 capture3 request */ - kDma0RequestMuxFlexPwm0ReqVal0 = 43U, /**< PWM0 value0 request */ - kDma1RequestMuxFlexPwm0ReqVal0 = 43U, /**< PWM0 value0 request */ - kDma0RequestMuxFlexPwm0ReqVal1 = 44U, /**< PWM0 value1 request */ - kDma1RequestMuxFlexPwm0ReqVal1 = 44U, /**< PWM0 value1 request */ - kDma0RequestMuxFlexPwm0ReqVal2 = 45U, /**< PWM0 value2 request */ - kDma1RequestMuxFlexPwm0ReqVal2 = 45U, /**< PWM0 value2 request */ - kDma0RequestMuxFlexPwm0ReqVal3 = 46U, /**< PWM0 value3 request */ - kDma1RequestMuxFlexPwm0ReqVal3 = 46U, /**< PWM0 value3 request */ - kDma0RequestMuxFlexPwm1ReqCapt0 = 47U, /**< PWM1 capture0 request */ - kDma1RequestMuxFlexPwm1ReqCapt0 = 47U, /**< PWM1 capture0 request */ - kDma0RequestMuxFlexPwm1ReqCapt1 = 48U, /**< PWM1 capture1 request */ - kDma1RequestMuxFlexPwm1ReqCapt1 = 48U, /**< PWM1 capture1 request */ - kDma0RequestMuxFlexPwm1ReqCapt2 = 49U, /**< PWM1 capture2 request */ - kDma1RequestMuxFlexPwm1ReqCapt2 = 49U, /**< PWM1 capture2 request */ - kDma0RequestMuxFlexPwm1ReqCapt3 = 50U, /**< PWM1 capture3 request */ - kDma1RequestMuxFlexPwm1ReqCapt3 = 50U, /**< PWM1 capture3 request */ - kDma0RequestMuxFlexPwm1ReqVal0 = 51U, /**< PWM1 value0 request */ - kDma1RequestMuxFlexPwm1ReqVal0 = 51U, /**< PWM1 value0 request */ - kDma0RequestMuxFlexPwm1ReqVal1 = 52U, /**< PWM1 value1 request */ - kDma1RequestMuxFlexPwm1ReqVal1 = 52U, /**< PWM1 value1 request */ - kDma0RequestMuxFlexPwm1ReqVal2 = 53U, /**< PWM1 value2 request */ - kDma1RequestMuxFlexPwm1ReqVal2 = 53U, /**< PWM1 value2 request */ - kDma0RequestMuxFlexPwm1ReqVal3 = 54U, /**< PWM0 value3 request */ - kDma1RequestMuxFlexPwm1ReqVal3 = 54U, /**< PWM0 value3 request */ - kDma0RequestMuxLptmr0 = 57U, /**< LPTMR0 Counter match event */ - kDma1RequestMuxLptmr0 = 57U, /**< LPTMR0 Counter match event */ - kDma0RequestMuxLptmr1 = 58U, /**< LPTMR1 Counter match event */ - kDma1RequestMuxLptmr1 = 58U, /**< LPTMR1 Counter match event */ - kDma0RequestMuxFlexCan0DmaRequest = 59U, /**< CAN0 DMA request */ - kDma1RequestMuxFlexCan0DmaRequest = 59U, /**< CAN0 DMA request */ - kDma0RequestMuxFlexCan1DmaRequest = 60U, /**< CAN1 DMA request */ - kDma1RequestMuxFlexCan1DmaRequest = 60U, /**< CAN1 DMA request */ - kDma0RequestMuxFlexIO0ShiftRegister0Request = 61U, /**< FlexIO0 Shifter0 Status DMA request OR Timer0 Status DMA request */ - kDma1RequestMuxFlexIO0ShiftRegister0Request = 61U, /**< FlexIO0 Shifter0 Status DMA request OR Timer0 Status DMA request */ - kDma0RequestMuxFlexIO0ShiftRegister1Request = 62U, /**< FlexIO0 Shifter1 Status DMA request OR Timer1 Status DMA request */ - kDma1RequestMuxFlexIO0ShiftRegister1Request = 62U, /**< FlexIO0 Shifter1 Status DMA request OR Timer1 Status DMA request */ - kDma0RequestMuxFlexIO0ShiftRegister2Request = 63U, /**< FlexIO0 Shifter2 Status DMA request OR Timer2 Status DMA request */ - kDma1RequestMuxFlexIO0ShiftRegister2Request = 63U, /**< FlexIO0 Shifter2 Status DMA request OR Timer2 Status DMA request */ - kDma0RequestMuxFlexIO0ShiftRegister3Request = 64U, /**< FlexIO0 Shifter3 Status DMA request OR Timer3 Status DMA request */ - kDma1RequestMuxFlexIO0ShiftRegister3Request = 64U, /**< FlexIO0 Shifter3 Status DMA request OR Timer3 Status DMA request */ - kDma0RequestMuxFlexIO0ShiftRegister4Request = 65U, /**< FlexIO0 Shifter4 Status DMA request OR Timer4 Status DMA request */ - kDma1RequestMuxFlexIO0ShiftRegister4Request = 65U, /**< FlexIO0 Shifter4 Status DMA request OR Timer4 Status DMA request */ - kDma0RequestMuxFlexIO0ShiftRegister5Request = 66U, /**< FlexIO0 Shifter5 Status DMA request OR Timer5 Status DMA request */ - kDma1RequestMuxFlexIO0ShiftRegister5Request = 66U, /**< FlexIO0 Shifter5 Status DMA request OR Timer5 Status DMA request */ - kDma0RequestMuxFlexIO0ShiftRegister6Request = 67U, /**< FlexIO0 Shifter6 Status DMA request OR Timer6 Status DMA request */ - kDma1RequestMuxFlexIO0ShiftRegister6Request = 67U, /**< FlexIO0 Shifter6 Status DMA request OR Timer6 Status DMA request */ - kDma0RequestMuxFlexIO0ShiftRegister7Request = 68U, /**< FlexIO0 Shifter7 Status DMA request OR Timer7 Status DMA request */ - kDma1RequestMuxFlexIO0ShiftRegister7Request = 68U, /**< FlexIO0 Shifter7 Status DMA request OR Timer7 Status DMA request */ - kDma0RequestMuxLpFlexcomm0Rx = 69U, /**< LP_FLEXCOMM0 Receive request */ - kDma1RequestMuxLpFlexcomm0Rx = 69U, /**< LP_FLEXCOMM0 Receive request */ - kDma0RequestMuxLpFlexcomm0Tx = 70U, /**< LP_FLEXCOMM0 Transmit request */ - kDma1RequestMuxLpFlexcomm0Tx = 70U, /**< LP_FLEXCOMM0 Transmit request */ - kDma0RequestMuxLpFlexcomm1Rx = 71U, /**< LP_FLEXCOMM1 Receive request */ - kDma1RequestMuxLpFlexcomm1Rx = 71U, /**< LP_FLEXCOMM1 Receive request */ - kDma0RequestMuxLpFlexcomm1Tx = 72U, /**< LP_FLEXCOMM1 Transmit request */ - kDma1RequestMuxLpFlexcomm1Tx = 72U, /**< LP_FLEXCOMM1 Transmit request */ - kDma0RequestMuxLpFlexcomm2Rx = 73U, /**< LP_FLEXCOMM2 Receive request */ - kDma1RequestMuxLpFlexcomm2Rx = 73U, /**< LP_FLEXCOMM2 Receive request */ - kDma0RequestMuxLpFlexcomm2Tx = 74U, /**< LP_FLEXCOMM2 Transmit request */ - kDma1RequestMuxLpFlexcomm2Tx = 74U, /**< LP_FLEXCOMM2 Transmit request */ - kDma0RequestMuxLpFlexcomm3Rx = 75U, /**< LP_FLEXCOMM3 Receive request */ - kDma1RequestMuxLpFlexcomm3Rx = 75U, /**< LP_FLEXCOMM3 Receive request */ - kDma0RequestMuxLpFlexcomm3Tx = 76U, /**< LP_FLEXCOMM3 Transmit request */ - kDma1RequestMuxLpFlexcomm3Tx = 76U, /**< LP_FLEXCOMM3 Transmit request */ - kDma0RequestMuxLpFlexcomm4Rx = 77U, /**< LP_FLEXCOMM4 Receive request */ - kDma1RequestMuxLpFlexcomm4Rx = 77U, /**< LP_FLEXCOMM4 Receive request */ - kDma0RequestMuxLpFlexcomm4Tx = 78U, /**< LP_FLEXCOMM4 Transmit request */ - kDma1RequestMuxLpFlexcomm4Tx = 78U, /**< LP_FLEXCOMM4 Transmit request */ - kDma0RequestMuxLpFlexcomm5Rx = 79U, /**< LP_FLEXCOMM5 Receive request */ - kDma1RequestMuxLpFlexcomm5Rx = 79U, /**< LP_FLEXCOMM5 Receive request */ - kDma0RequestMuxLpFlexcomm5Tx = 80U, /**< LP_FLEXCOMM5 Transmit request */ - kDma1RequestMuxLpFlexcomm5Tx = 80U, /**< LP_FLEXCOMM5 Transmit request */ - kDma0RequestMuxLpFlexcomm6Rx = 81U, /**< LP_FLEXCOMM6 Receive request */ - kDma1RequestMuxLpFlexcomm6Rx = 81U, /**< LP_FLEXCOMM6 Receive request */ - kDma0RequestMuxLpFlexcomm6Tx = 82U, /**< LP_FLEXCOMM6 Transmit request */ - kDma1RequestMuxLpFlexcomm6Tx = 82U, /**< LP_FLEXCOMM6 Transmit request */ - kDma0RequestMuxLpFlexcomm7Rx = 83U, /**< LP_FLEXCOMM7 Receive request */ - kDma1RequestMuxLpFlexcomm7Rx = 83U, /**< LP_FLEXCOMM7 Receive request */ - kDma0RequestMuxLpFlexcomm7Tx = 84U, /**< LP_FLEXCOMM7 Transmit request */ - kDma1RequestMuxLpFlexcomm7Tx = 84U, /**< LP_FLEXCOMM7 Transmit request */ - kDma0RequestMuxLpFlexcomm8Rx = 85U, /**< LP_FLEXCOMM8 Receive request */ - kDma1RequestMuxLpFlexcomm8Rx = 85U, /**< LP_FLEXCOMM8 Receive request */ - kDma0RequestMuxLpFlexcomm8Tx = 86U, /**< LP_FLEXCOMM8 Transmit request */ - kDma1RequestMuxLpFlexcomm8Tx = 86U, /**< LP_FLEXCOMM8 Transmit request */ - kDma0RequestMuxLpFlexcomm9Rx = 87U, /**< LP_FLEXCOMM9 Receive request */ - kDma1RequestMuxLpFlexcomm9Rx = 87U, /**< LP_FLEXCOMM9 Receive request */ - kDma0RequestMuxLpFlexcomm9Tx = 88U, /**< LP_FLEXCOMM9 Transmit request */ - kDma1RequestMuxLpFlexcomm9Tx = 88U, /**< LP_FLEXCOMM9 Transmit request */ - kDma0RequestMuxEmvSim0Rx = 91U, /**< EMVSIM0 Receive request */ - kDma1RequestMuxEmvSim0Rx = 91U, /**< EMVSIM0 Receive request */ - kDma0RequestMuxEmvSim0Tx = 92U, /**< EMVSIM0 Transmit request */ - kDma1RequestMuxEmvSim0Tx = 92U, /**< EMVSIM0 Transmit request */ - kDma0RequestMuxEmvSim1Rx = 93U, /**< EMVSIM1 Receive request */ - kDma1RequestMuxEmvSim1Rx = 93U, /**< EMVSIM1 Receive request */ - kDma0RequestMuxEmvSim1Tx = 94U, /**< EMVSIM1 Transmit request */ - kDma1RequestMuxEmvSim1Tx = 94U, /**< EMVSIM1 Transmit request */ - kDma0RequestMuxI3c0Rx = 95U, /**< I3C0 Receive request */ - kDma1RequestMuxI3c0Rx = 95U, /**< I3C0 Receive request */ - kDma0RequestMuxI3c0Tx = 96U, /**< I3C0 Transmit request */ - kDma1RequestMuxI3c0Tx = 96U, /**< I3C0 Transmit request */ - kDma0RequestMuxI3c1Rx = 97U, /**< I3C1 Receive request */ - kDma1RequestMuxI3c1Rx = 97U, /**< I3C1 Receive request */ - kDma0RequestMuxI3c1Tx = 98U, /**< I3C1 Transmit request */ - kDma1RequestMuxI3c1Tx = 98U, /**< I3C1 Transmit request */ - kDma0RequestMuxSai0Rx = 99U, /**< SAI0 Receive request */ - kDma1RequestMuxSai0Rx = 99U, /**< SAI0 Receive request */ - kDma0RequestMuxSai0Tx = 100U, /**< SAI0 Transmit request */ - kDma1RequestMuxSai0Tx = 100U, /**< SAI0 Transmit request */ - kDma0RequestMuxSai1Rx = 101U, /**< SAI1 Receive request */ - kDma1RequestMuxSai1Rx = 101U, /**< SAI1 Receive request */ - kDma0RequestMuxSai1Tx = 102U, /**< SAI1 Transmit request */ - kDma1RequestMuxSai1Tx = 102U, /**< SAI1 Transmit request */ - kDma0RequestMuxSinc0IpdReqSincAlt0 = 103U, /**< SINC0 ipd_req_sinc[0] or ipd_req_alt [0] */ - kDma1RequestMuxSinc0IpdReqSincAlt0 = 103U, /**< SINC0 ipd_req_sinc[0] or ipd_req_alt [0] */ - kDma0RequestMuxSinc1IpdReqSincAlt1 = 104U, /**< SINC0 ipd_req_sinc[1] or ipd_req_alt [1] */ - kDma1RequestMuxSinc1IpdReqSincAlt1 = 104U, /**< SINC0 ipd_req_sinc[1] or ipd_req_alt [1] */ - kDma0RequestMuxSinc2IpdReqSincAlt2 = 105U, /**< SINC0 ipd_req_sinc[2] or ipd_req_alt [2] */ - kDma1RequestMuxSinc2IpdReqSincAlt2 = 105U, /**< SINC0 ipd_req_sinc[2] or ipd_req_alt [2] */ - kDma0RequestMuxSinc3IpdReqSincAlt3 = 106U, /**< SINC0 ipd_req_sinc[3] or ipd_req_alt [3] */ - kDma1RequestMuxSinc3IpdReqSincAlt3 = 106U, /**< SINC0 ipd_req_sinc[3] or ipd_req_alt [3] */ - kDma0RequestMuxSinc4IpdReqSincAlt4 = 107U, /**< SINC0 ipd_req_sinc[4] or ipd_req_alt [4] */ - kDma1RequestMuxSinc4IpdReqSincAlt4 = 107U, /**< SINC0 ipd_req_sinc[4] or ipd_req_alt [4] */ - kDma0RequestMuxGpio0PinEventRequest0 = 108U, /**< GPIO0 Pin event request 0 */ - kDma1RequestMuxGpio0PinEventRequest0 = 108U, /**< GPIO0 Pin event request 0 */ - kDma0RequestMuxGpio0PinEventRequest1 = 109U, /**< GPIO0 Pin event request 1 */ - kDma1RequestMuxGpio0PinEventRequest1 = 109U, /**< GPIO0 Pin event request 1 */ - kDma0RequestMuxGpio1PinEventRequest0 = 110U, /**< GPIO1 Pin event request 0 */ - kDma1RequestMuxGpio1PinEventRequest0 = 110U, /**< GPIO1 Pin event request 0 */ - kDma0RequestMuxGpio1PinEventRequest1 = 111U, /**< GPIO1 Pin event request 1 */ - kDma1RequestMuxGpio1PinEventRequest1 = 111U, /**< GPIO1 Pin event request 1 */ - kDma0RequestMuxGpio2PinEventRequest0 = 112U, /**< GPIO2 Pin event request 0 */ - kDma1RequestMuxGpio2PinEventRequest0 = 112U, /**< GPIO2 Pin event request 0 */ - kDma0RequestMuxGpio2PinEventRequest1 = 113U, /**< GPIO2 Pin event request 1 */ - kDma1RequestMuxGpio2PinEventRequest1 = 113U, /**< GPIO2 Pin event request 1 */ - kDma0RequestMuxGpio3PinEventRequest0 = 114U, /**< GPIO3 Pin event request 0 */ - kDma1RequestMuxGpio3PinEventRequest0 = 114U, /**< GPIO3 Pin event request 0 */ - kDma0RequestMuxGpio3PinEventRequest1 = 115U, /**< GPIO3 Pin event request 1 */ - kDma1RequestMuxGpio3PinEventRequest1 = 115U, /**< GPIO3 Pin event request 1 */ - kDma0RequestMuxGpio4PinEventRequest0 = 116U, /**< GPIO4 Pin event request 0 */ - kDma1RequestMuxGpio4PinEventRequest0 = 116U, /**< GPIO4 Pin event request 0 */ - kDma0RequestMuxGpio4PinEventRequest1 = 117U, /**< GPIO4 Pin event request 1 */ - kDma1RequestMuxGpio4PinEventRequest1 = 117U, /**< GPIO4 Pin event request 1 */ - kDma0RequestMuxGpio5PinEventRequest0 = 118U, /**< GPIO5 Pin event request 0 */ - kDma1RequestMuxGpio5PinEventRequest0 = 118U, /**< GPIO5 Pin event request 0 */ - kDma0RequestMuxGpio5PinEventRequest1 = 119U, /**< GPIO5 Pin event request 1 */ - kDma1RequestMuxGpio5PinEventRequest1 = 119U, /**< GPIO5 Pin event request 1 */ - kDma0RequestMuxTsi0EndOfScan = 120U, /**< TSI0 End of Scan */ - kDma1RequestMuxTsi0EndOfScan = 120U, /**< TSI0 End of Scan */ - kDma0RequestMuxTsi0OutOfRange = 121U, /**< TSI0 Out of Range */ - kDma1RequestMuxTsi0OutOfRange = 121U, /**< TSI0 Out of Range */ -} dma_request_source_t; - -/* @} */ - -/*! - * @addtogroup eim_memory_channel - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @brief Structure for the eim_memory_channel - * - * Defines the structure for the EIM resource collections. - */ - -typedef enum _eim_memory_channel -{ - kEIM_MemoryChannelRAMX = 0U, /**< Memory RAMX */ - kEIM_MemoryChannelRAMA = 1U, /**< Memory RAMA */ - kEIM_MemoryChannelRAMB = 2U, /**< Memory RAMB */ - kEIM_MemoryChannelRAMC = 3U, /**< Memory RAMC */ - kEIM_MemoryChannelRAMD = 4U, /**< Memory RAMD */ - kEIM_MemoryChannelRAME = 5U, /**< Memory RAME */ - kEIM_MemoryChannelRAMF = 6U, /**< Memory RAMF */ - kEIM_MemoryChannelLPCACRAM = 7U, /**< Memory LPCACRAM */ - kEIM_MemoryChannelPKCRAM = 8U, /**< Memory PKCRAM */ -} eim_memory_channel_t; - -/* @} */ - -/*! - * @addtogroup eim_error_injection_channel_enable - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @brief Structure for the eim_error_injection_channel_enable - * - * Defines the structure for the EIM error injection resource collections. - */ - -typedef enum _eim_error_injection_channel_enable -{ - kEIM_MemoryChannelRAMXEnable = 0x80000000U, /**< Memory channel 0(RAMX) error injection enable */ - kEIM_MemoryChannelRAMAEnable = 0x40000000U, /**< Memory channel 1(RAMA) error injection enable */ - kEIM_MemoryChannelRAMBEnable = 0x20000000U, /**< Memory channel 2(RAMB) error injection enable */ - kEIM_MemoryChannelRAMCEnable = 0x10000000U, /**< Memory channel 3(RAMC) error injection enable */ - kEIM_MemoryChannelRAMDEnable = 0x8000000U, /**< Memory channel 4(RAMD) error injection enable */ - kEIM_MemoryChannelRAMEEnable = 0x4000000U, /**< Memory channel 5(RAME) error injection enable */ - kEIM_MemoryChannelRAMFEnable = 0x2000000U, /**< Memory channel 6(RAMF) error injection enable */ - kEIM_MemoryChannelLPCACRAMEnable = 0x1000000U, /**< Memory channel 7(LPCACRAM) error injection enable */ - kEIM_MemoryChannelPKCRAMEnable = 0x800000U, /**< Memory channel 8(PKCRAM) error injection enable */ -} eim_error_injection_channel_enable_t; - -/* @} */ - -/*! - * @addtogroup erm_memory_channel - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @brief Structure for the erm_memory_channel - * - * Defines the structure for the ERM resource collections. - */ - -typedef enum _erm_memory_channel -{ - kERM_MemoryChannelRAMX = 0U, /**< Memory RAMX */ - kERM_MemoryChannelRAMA = 1U, /**< Memory RAMA */ - kERM_MemoryChannelRAMB = 2U, /**< Memory RAMB */ - kERM_MemoryChannelRAMC = 3U, /**< Memory RAMC */ - kERM_MemoryChannelRAMD = 4U, /**< Memory RAMD */ - kERM_MemoryChannelRAME = 5U, /**< Memory RAME */ - kERM_MemoryChannelRAMF = 6U, /**< Memory RAMF */ - kERM_MemoryChannelLPCACRAM = 7U, /**< Memory LPCACRAM */ - kERM_MemoryChannelPKCRAM = 8U, /**< Memory PKCRAM */ - kERM_MemoryChannelFLASH = 9U, /**< Memory FLASH */ -} erm_memory_channel_t; - -/* @} */ - - -/*! - * @} - */ /* end of group Mapping_Information */ - - -/* ---------------------------------------------------------------------------- - -- Device Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup Peripheral_access_layer Device Peripheral Access Layer - * @{ - */ - - -/* -** Start of section using anonymous unions -*/ - -#if defined(__ARMCC_VERSION) - #if (__ARMCC_VERSION >= 6010050) - #pragma clang diagnostic push - #else - #pragma push - #pragma anon_unions - #endif -#elif defined(__GNUC__) - /* anonymous unions are enabled by default */ -#elif defined(__IAR_SYSTEMS_ICC__) - #pragma language=extended -#else - #error Not supported compiler type -#endif - -/* ---------------------------------------------------------------------------- - -- ADC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ADC_Peripheral_Access_Layer ADC Peripheral Access Layer - * @{ - */ - -/** ADC - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID Register, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter Register, offset: 0x4 */ - uint8_t RESERVED_0[8]; - __IO uint32_t CTRL; /**< Control Register, offset: 0x10 */ - __IO uint32_t STAT; /**< Status Register, offset: 0x14 */ - __IO uint32_t IE; /**< Interrupt Enable Register, offset: 0x18 */ - __IO uint32_t DE; /**< DMA Enable Register, offset: 0x1C */ - __IO uint32_t CFG; /**< Configuration Register, offset: 0x20 */ - __IO uint32_t PAUSE; /**< Pause Register, offset: 0x24 */ - uint8_t RESERVED_1[12]; - __O uint32_t SWTRIG; /**< Software Trigger Register, offset: 0x34 */ - __IO uint32_t TSTAT; /**< Trigger Status Register, offset: 0x38 */ - uint8_t RESERVED_2[4]; - __IO uint32_t OFSTRIM; /**< Offset Trim Register, offset: 0x40 */ - uint8_t RESERVED_3[92]; - __IO uint32_t TCTRL[4]; /**< Trigger Control Register, array offset: 0xA0, array step: 0x4 */ - uint8_t RESERVED_4[48]; - __IO uint32_t FCTRL[2]; /**< FIFO Control Register, array offset: 0xE0, array step: 0x4 */ - uint8_t RESERVED_5[8]; - __I uint32_t GCC[2]; /**< Gain Calibration Control, array offset: 0xF0, array step: 0x4 */ - __IO uint32_t GCR[2]; /**< Gain Calculation Result, array offset: 0xF8, array step: 0x4 */ - struct { /* offset: 0x100, array step: 0x8 */ - __IO uint32_t CMDL; /**< Command Low Buffer Register, array offset: 0x100, array step: 0x8 */ - __IO uint32_t CMDH; /**< Command High Buffer Register, array offset: 0x104, array step: 0x8 */ - } CMD[15]; - uint8_t RESERVED_6[136]; - __IO uint32_t CV[15]; /**< Compare Value Register, array offset: 0x200, array step: 0x4 */ - uint8_t RESERVED_7[196]; - __I uint32_t RESFIFO[2]; /**< Data Result FIFO Register, array offset: 0x300, array step: 0x4 */ - uint8_t RESERVED_8[248]; - __IO uint32_t CAL_GAR[33]; /**< Calibration General A-Side Registers, array offset: 0x400, array step: 0x4 */ - uint8_t RESERVED_9[124]; - __IO uint32_t CAL_GBR[33]; /**< Calibration General B-Side Registers, array offset: 0x500, array step: 0x4 */ -} ADC_Type; - -/* ---------------------------------------------------------------------------- - -- ADC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ADC_Register_Masks ADC Register Masks - * @{ - */ - -/*! @name VERID - Version ID Register */ -/*! @{ */ - -#define ADC_VERID_RES_MASK (0x1U) -#define ADC_VERID_RES_SHIFT (0U) -/*! RES - Resolution - * 0b0..Up to 13-bit differential or 12-bit single-ended resolution supported. - * 0b1..Up to 16-bit differential or 16-bit single-ended resolution supported. CMDLn[MODE] available for - * selecting the resolution of conversions for the associated command. - */ -#define ADC_VERID_RES(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_RES_SHIFT)) & ADC_VERID_RES_MASK) - -#define ADC_VERID_DIFFEN_MASK (0x2U) -#define ADC_VERID_DIFFEN_SHIFT (1U) -/*! DIFFEN - Differential Supported - * 0b0..Not supported - * 0b1..Supported. CMDLn[CTYPE] controls fields implemented. - */ -#define ADC_VERID_DIFFEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_DIFFEN_SHIFT)) & ADC_VERID_DIFFEN_MASK) - -#define ADC_VERID_MVI_MASK (0x8U) -#define ADC_VERID_MVI_SHIFT (3U) -/*! MVI - Multiple Vref Implemented - * 0b0..Single VREFH input supported. - * 0b1..Multiple VREFH inputs supported. - */ -#define ADC_VERID_MVI(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_MVI_SHIFT)) & ADC_VERID_MVI_MASK) - -#define ADC_VERID_CSW_MASK (0x70U) -#define ADC_VERID_CSW_SHIFT (4U) -/*! CSW - Channel Scale Width - * 0b000..Not supported. - * 0b001..Supported with one-bit CSCALE control field. - * 0b110..Supported with six-bit CSCALE control field. - */ -#define ADC_VERID_CSW(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_CSW_SHIFT)) & ADC_VERID_CSW_MASK) - -#define ADC_VERID_VR1RNGI_MASK (0x100U) -#define ADC_VERID_VR1RNGI_SHIFT (8U) -/*! VR1RNGI - Voltage Reference 1 Range Control Bit Implemented - * 0b0..Range control not required. - * 0b1..Range control required. - */ -#define ADC_VERID_VR1RNGI(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_VR1RNGI_SHIFT)) & ADC_VERID_VR1RNGI_MASK) - -#define ADC_VERID_IADCKI_MASK (0x200U) -#define ADC_VERID_IADCKI_SHIFT (9U) -/*! IADCKI - Internal ADC Clock Implemented - * 0b0..Not implemented - * 0b1..Implemented - */ -#define ADC_VERID_IADCKI(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_IADCKI_SHIFT)) & ADC_VERID_IADCKI_MASK) - -#define ADC_VERID_CALOFSI_MASK (0x400U) -#define ADC_VERID_CALOFSI_SHIFT (10U) -/*! CALOFSI - Calibration Function Implemented - * 0b0..Not implemented - * 0b1..Implemented - */ -#define ADC_VERID_CALOFSI(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_CALOFSI_SHIFT)) & ADC_VERID_CALOFSI_MASK) - -#define ADC_VERID_NUM_SEC_MASK (0x800U) -#define ADC_VERID_NUM_SEC_SHIFT (11U) -/*! NUM_SEC - Number of Single-Ended Outputs Supported - * 0b0..One - * 0b1..Two - */ -#define ADC_VERID_NUM_SEC(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_NUM_SEC_SHIFT)) & ADC_VERID_NUM_SEC_MASK) - -#define ADC_VERID_NUM_FIFO_MASK (0x7000U) -#define ADC_VERID_NUM_FIFO_SHIFT (12U) -/*! NUM_FIFO - Number of FIFOs - * 0b000..N/A - * 0b001..One - * 0b010..Two - * 0b011..Three - * 0b100..Four - */ -#define ADC_VERID_NUM_FIFO(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_NUM_FIFO_SHIFT)) & ADC_VERID_NUM_FIFO_MASK) - -#define ADC_VERID_MINOR_MASK (0xFF0000U) -#define ADC_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define ADC_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_MINOR_SHIFT)) & ADC_VERID_MINOR_MASK) - -#define ADC_VERID_MAJOR_MASK (0xFF000000U) -#define ADC_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define ADC_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_MAJOR_SHIFT)) & ADC_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter Register */ -/*! @{ */ - -#define ADC_PARAM_TRIG_NUM_MASK (0xFFU) -#define ADC_PARAM_TRIG_NUM_SHIFT (0U) -/*! TRIG_NUM - Trigger Number */ -#define ADC_PARAM_TRIG_NUM(x) (((uint32_t)(((uint32_t)(x)) << ADC_PARAM_TRIG_NUM_SHIFT)) & ADC_PARAM_TRIG_NUM_MASK) - -#define ADC_PARAM_FIFOSIZE_MASK (0xFF00U) -#define ADC_PARAM_FIFOSIZE_SHIFT (8U) -/*! FIFOSIZE - Result FIFO Depth - * 0b00000001..2 - * 0b00000100..4 - * 0b00001000..8 - * 0b00010000..16 - * 0b00100000..32 - * 0b01000000..64 - */ -#define ADC_PARAM_FIFOSIZE(x) (((uint32_t)(((uint32_t)(x)) << ADC_PARAM_FIFOSIZE_SHIFT)) & ADC_PARAM_FIFOSIZE_MASK) - -#define ADC_PARAM_CV_NUM_MASK (0xFF0000U) -#define ADC_PARAM_CV_NUM_SHIFT (16U) -/*! CV_NUM - Compare Value Number */ -#define ADC_PARAM_CV_NUM(x) (((uint32_t)(((uint32_t)(x)) << ADC_PARAM_CV_NUM_SHIFT)) & ADC_PARAM_CV_NUM_MASK) - -#define ADC_PARAM_CMD_NUM_MASK (0xFF000000U) -#define ADC_PARAM_CMD_NUM_SHIFT (24U) -/*! CMD_NUM - Command Buffer Number */ -#define ADC_PARAM_CMD_NUM(x) (((uint32_t)(((uint32_t)(x)) << ADC_PARAM_CMD_NUM_SHIFT)) & ADC_PARAM_CMD_NUM_MASK) -/*! @} */ - -/*! @name CTRL - Control Register */ -/*! @{ */ - -#define ADC_CTRL_ADCEN_MASK (0x1U) -#define ADC_CTRL_ADCEN_SHIFT (0U) -/*! ADCEN - ADC Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_CTRL_ADCEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_ADCEN_SHIFT)) & ADC_CTRL_ADCEN_MASK) - -#define ADC_CTRL_RST_MASK (0x2U) -#define ADC_CTRL_RST_SHIFT (1U) -/*! RST - Software Reset - * 0b0..ADC logic is not reset. - * 0b1..ADC logic is reset. - */ -#define ADC_CTRL_RST(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_RST_SHIFT)) & ADC_CTRL_RST_MASK) - -#define ADC_CTRL_DOZEN_MASK (0x4U) -#define ADC_CTRL_DOZEN_SHIFT (2U) -/*! DOZEN - Doze Enable - * 0b0..ADC is enabled in low-power mode. - * 0b1..ADC is disabled in low-power mode. - */ -#define ADC_CTRL_DOZEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_DOZEN_SHIFT)) & ADC_CTRL_DOZEN_MASK) - -#define ADC_CTRL_CAL_REQ_MASK (0x8U) -#define ADC_CTRL_CAL_REQ_SHIFT (3U) -/*! CAL_REQ - Auto-Calibration Request - * 0b0..No request made. - * 0b1..Request has been made. - */ -#define ADC_CTRL_CAL_REQ(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_CAL_REQ_SHIFT)) & ADC_CTRL_CAL_REQ_MASK) - -#define ADC_CTRL_CALOFS_MASK (0x10U) -#define ADC_CTRL_CALOFS_SHIFT (4U) -/*! CALOFS - Offset Calibration Request - * 0b0..Calibration function disabled - * 0b1..Request for offset calibration function - */ -#define ADC_CTRL_CALOFS(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_CALOFS_SHIFT)) & ADC_CTRL_CALOFS_MASK) - -#define ADC_CTRL_RSTFIFO0_MASK (0x100U) -#define ADC_CTRL_RSTFIFO0_SHIFT (8U) -/*! RSTFIFO0 - Reset FIFO 0 - * 0b0..No effect. - * 0b1..FIFO 0 is reset. - */ -#define ADC_CTRL_RSTFIFO0(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_RSTFIFO0_SHIFT)) & ADC_CTRL_RSTFIFO0_MASK) - -#define ADC_CTRL_RSTFIFO1_MASK (0x200U) -#define ADC_CTRL_RSTFIFO1_SHIFT (9U) -/*! RSTFIFO1 - Reset FIFO 1 - * 0b0..No effect. - * 0b1..FIFO 1 is reset. - */ -#define ADC_CTRL_RSTFIFO1(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_RSTFIFO1_SHIFT)) & ADC_CTRL_RSTFIFO1_MASK) - -#define ADC_CTRL_CAL_AVGS_MASK (0xF0000U) -#define ADC_CTRL_CAL_AVGS_SHIFT (16U) -/*! CAL_AVGS - Auto-Calibration Averages - * 0b0000..Single conversion. - * 0b0001..2 conversions averaged. - * 0b0010..4 conversions averaged. - * 0b0011..8 conversions averaged. - * 0b0100..16 conversions averaged. - * 0b0101..32 conversions averaged. - * 0b0110..64 conversions averaged. - * 0b0111..128 conversions averaged. - * 0b1000..256 conversions averaged. - * 0b1001..512 conversions averaged. - * 0b1010..1024 conversions averaged. - */ -#define ADC_CTRL_CAL_AVGS(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_CAL_AVGS_SHIFT)) & ADC_CTRL_CAL_AVGS_MASK) -/*! @} */ - -/*! @name STAT - Status Register */ -/*! @{ */ - -#define ADC_STAT_RDY0_MASK (0x1U) -#define ADC_STAT_RDY0_SHIFT (0U) -/*! RDY0 - Result FIFO 0 Ready Flag - * 0b0..Not above watermark - * 0b1..Above watermark - */ -#define ADC_STAT_RDY0(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_RDY0_SHIFT)) & ADC_STAT_RDY0_MASK) - -#define ADC_STAT_FOF0_MASK (0x2U) -#define ADC_STAT_FOF0_SHIFT (1U) -/*! FOF0 - Result FIFO 0 Overflow Flag - * 0b0..No result FIFO 0 overflow has occurred since the last time that the flag was cleared. - * 0b1..At least one result FIFO 0 overflow has occurred since the last time that the flag was cleared. - */ -#define ADC_STAT_FOF0(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_FOF0_SHIFT)) & ADC_STAT_FOF0_MASK) - -#define ADC_STAT_RDY1_MASK (0x4U) -#define ADC_STAT_RDY1_SHIFT (2U) -/*! RDY1 - Result FIFO1 Ready Flag - * 0b0..Not above watermark - * 0b1..Above watermark - */ -#define ADC_STAT_RDY1(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_RDY1_SHIFT)) & ADC_STAT_RDY1_MASK) - -#define ADC_STAT_FOF1_MASK (0x8U) -#define ADC_STAT_FOF1_SHIFT (3U) -/*! FOF1 - Result FIFO1 Overflow Flag - * 0b0..No result FIFO1 overflow has occurred since the last time that the flag was cleared. - * 0b1..At least one result FIFO1 overflow has occurred since the last time that the flag was cleared. - */ -#define ADC_STAT_FOF1(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_FOF1_SHIFT)) & ADC_STAT_FOF1_MASK) - -#define ADC_STAT_TEXC_INT_MASK (0x100U) -#define ADC_STAT_TEXC_INT_SHIFT (8U) -/*! TEXC_INT - Interrupt Flag For High-Priority Trigger Exception - * 0b0..No trigger exceptions have occurred. - * 0b1..A trigger exception has occurred and is pending acknowledgment. - */ -#define ADC_STAT_TEXC_INT(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_TEXC_INT_SHIFT)) & ADC_STAT_TEXC_INT_MASK) - -#define ADC_STAT_TCOMP_INT_MASK (0x200U) -#define ADC_STAT_TCOMP_INT_SHIFT (9U) -/*! TCOMP_INT - Interrupt Flag For Trigger Completion - * 0b0..Either IE[TCOMP_IE] = 0, or no trigger sequences have run to completion. - * 0b1..Trigger sequence has been completed and all data is stored in the associated FIFO. - */ -#define ADC_STAT_TCOMP_INT(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_TCOMP_INT_SHIFT)) & ADC_STAT_TCOMP_INT_MASK) - -#define ADC_STAT_CAL_RDY_MASK (0x400U) -#define ADC_STAT_CAL_RDY_SHIFT (10U) -/*! CAL_RDY - Calibration Ready - * 0b0..Calibration is incomplete or has not been run. - * 0b1..ADC is calibrated. - */ -#define ADC_STAT_CAL_RDY(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_CAL_RDY_SHIFT)) & ADC_STAT_CAL_RDY_MASK) - -#define ADC_STAT_ADC_ACTIVE_MASK (0x800U) -#define ADC_STAT_ADC_ACTIVE_SHIFT (11U) -/*! ADC_ACTIVE - ADC Active - * 0b0..ADC is idle. There are no pending triggers to service and no active commands are being processed. - * 0b1..ADC is processing a conversion, running through the power-up delay, or servicing a trigger. - */ -#define ADC_STAT_ADC_ACTIVE(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_ADC_ACTIVE_SHIFT)) & ADC_STAT_ADC_ACTIVE_MASK) - -#define ADC_STAT_TRGACT_MASK (0x30000U) -#define ADC_STAT_TRGACT_SHIFT (16U) -/*! TRGACT - Trigger Active - * 0b00..Command (sequence) associated with Trigger 0 currently being executed. - * 0b01..Command (sequence) associated with Trigger 1 currently being executed. - * 0b10..Command (sequence) associated with Trigger 2 currently being executed. - * 0b11..Command (sequence) associated with Trigger 3 currently being executed. - */ -#define ADC_STAT_TRGACT(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_TRGACT_SHIFT)) & ADC_STAT_TRGACT_MASK) - -#define ADC_STAT_CMDACT_MASK (0xF000000U) -#define ADC_STAT_CMDACT_SHIFT (24U) -/*! CMDACT - Command Active - * 0b0000..No command currently in progress. - * 0b0001..Command 1 currently being executed. - * 0b0010..Command 2 currently being executed. - * 0b0011-0b1111..Associated command number currently being executed. - */ -#define ADC_STAT_CMDACT(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_CMDACT_SHIFT)) & ADC_STAT_CMDACT_MASK) -/*! @} */ - -/*! @name IE - Interrupt Enable Register */ -/*! @{ */ - -#define ADC_IE_FWMIE0_MASK (0x1U) -#define ADC_IE_FWMIE0_SHIFT (0U) -/*! FWMIE0 - FIFO 0 Watermark Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_IE_FWMIE0(x) (((uint32_t)(((uint32_t)(x)) << ADC_IE_FWMIE0_SHIFT)) & ADC_IE_FWMIE0_MASK) - -#define ADC_IE_FOFIE0_MASK (0x2U) -#define ADC_IE_FOFIE0_SHIFT (1U) -/*! FOFIE0 - Result FIFO 0 Overflow Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_IE_FOFIE0(x) (((uint32_t)(((uint32_t)(x)) << ADC_IE_FOFIE0_SHIFT)) & ADC_IE_FOFIE0_MASK) - -#define ADC_IE_FWMIE1_MASK (0x4U) -#define ADC_IE_FWMIE1_SHIFT (2U) -/*! FWMIE1 - FIFO1 Watermark Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_IE_FWMIE1(x) (((uint32_t)(((uint32_t)(x)) << ADC_IE_FWMIE1_SHIFT)) & ADC_IE_FWMIE1_MASK) - -#define ADC_IE_FOFIE1_MASK (0x8U) -#define ADC_IE_FOFIE1_SHIFT (3U) -/*! FOFIE1 - Result FIFO1 Overflow Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_IE_FOFIE1(x) (((uint32_t)(((uint32_t)(x)) << ADC_IE_FOFIE1_SHIFT)) & ADC_IE_FOFIE1_MASK) - -#define ADC_IE_TEXC_IE_MASK (0x100U) -#define ADC_IE_TEXC_IE_SHIFT (8U) -/*! TEXC_IE - Trigger Exception Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_IE_TEXC_IE(x) (((uint32_t)(((uint32_t)(x)) << ADC_IE_TEXC_IE_SHIFT)) & ADC_IE_TEXC_IE_MASK) - -#define ADC_IE_TCOMP_IE_MASK (0xF0000U) -#define ADC_IE_TCOMP_IE_SHIFT (16U) -/*! TCOMP_IE - Trigger Completion Interrupt Enable - * 0b0000..All disabled - * 0b0001..Trigger completion interrupts are enabled for trigger source 0 only. - * 0b0010..Trigger completion interrupts are enabled for trigger source 1 only. - * 0b0011-0b1110..Associated trigger completion interrupts are enabled. - * 0b1111..All enabled - */ -#define ADC_IE_TCOMP_IE(x) (((uint32_t)(((uint32_t)(x)) << ADC_IE_TCOMP_IE_SHIFT)) & ADC_IE_TCOMP_IE_MASK) -/*! @} */ - -/*! @name DE - DMA Enable Register */ -/*! @{ */ - -#define ADC_DE_FWMDE0_MASK (0x1U) -#define ADC_DE_FWMDE0_SHIFT (0U) -/*! FWMDE0 - FIFO 0 Watermark DMA Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_DE_FWMDE0(x) (((uint32_t)(((uint32_t)(x)) << ADC_DE_FWMDE0_SHIFT)) & ADC_DE_FWMDE0_MASK) - -#define ADC_DE_FWMDE1_MASK (0x2U) -#define ADC_DE_FWMDE1_SHIFT (1U) -/*! FWMDE1 - FIFO1 Watermark DMA Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_DE_FWMDE1(x) (((uint32_t)(((uint32_t)(x)) << ADC_DE_FWMDE1_SHIFT)) & ADC_DE_FWMDE1_MASK) -/*! @} */ - -/*! @name CFG - Configuration Register */ -/*! @{ */ - -#define ADC_CFG_TPRICTRL_MASK (0x3U) -#define ADC_CFG_TPRICTRL_SHIFT (0U) -/*! TPRICTRL - ADC Trigger Priority Control - * 0b00..Current conversion is aborted and the new command specified by the trigger is started. - * 0b01..Current command is stopped after completing the current conversion. If averaging is enabled, the - * averaging loop is completed. CMDHn[LOOP] is ignored and the higher-priority trigger is serviced. - * 0b10..Current command is completed (averaging, looping, compare) before servicing the higher-priority trigger. - * 0b11.. - */ -#define ADC_CFG_TPRICTRL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_TPRICTRL_SHIFT)) & ADC_CFG_TPRICTRL_MASK) - -#define ADC_CFG_PWRSEL_MASK (0x30U) -#define ADC_CFG_PWRSEL_SHIFT (4U) -/*! PWRSEL - Power Configuration Select - * 0b0x..Low power - * 0b1x..High power - */ -#define ADC_CFG_PWRSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_PWRSEL_SHIFT)) & ADC_CFG_PWRSEL_MASK) - -#define ADC_CFG_REFSEL_MASK (0xC0U) -#define ADC_CFG_REFSEL_SHIFT (6U) -/*! REFSEL - Voltage Reference Selection - * 0b00..Option 1 - * 0b01..Option 2 - * 0b10..Option 3 - * 0b11.. - */ -#define ADC_CFG_REFSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_REFSEL_SHIFT)) & ADC_CFG_REFSEL_MASK) - -#define ADC_CFG_TRES_MASK (0x100U) -#define ADC_CFG_TRES_SHIFT (8U) -/*! TRES - Trigger Resume Enable - * 0b0..Not automatically resumed or restarted - * 0b1..Automatically resumed or restarted - */ -#define ADC_CFG_TRES(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_TRES_SHIFT)) & ADC_CFG_TRES_MASK) - -#define ADC_CFG_TCMDRES_MASK (0x200U) -#define ADC_CFG_TCMDRES_SHIFT (9U) -/*! TCMDRES - Trigger Command Resume - * 0b0..Trigger sequence automatically restarted. - * 0b1..Trigger sequence resumed from the command that was executed prior to the exception. - */ -#define ADC_CFG_TCMDRES(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_TCMDRES_SHIFT)) & ADC_CFG_TCMDRES_MASK) - -#define ADC_CFG_HPT_EXDI_MASK (0x400U) -#define ADC_CFG_HPT_EXDI_SHIFT (10U) -/*! HPT_EXDI - High-Priority Trigger Exception Disable - * 0b0..Enabled - * 0b1..Disabled - */ -#define ADC_CFG_HPT_EXDI(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_HPT_EXDI_SHIFT)) & ADC_CFG_HPT_EXDI_MASK) - -#define ADC_CFG_PUDLY_MASK (0xFF0000U) -#define ADC_CFG_PUDLY_SHIFT (16U) -/*! PUDLY - Power-up Delay */ -#define ADC_CFG_PUDLY(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_PUDLY_SHIFT)) & ADC_CFG_PUDLY_MASK) - -#define ADC_CFG_PWREN_MASK (0x10000000U) -#define ADC_CFG_PWREN_SHIFT (28U) -/*! PWREN - ADC Analog Pre-Enable - * 0b0..ADC analog circuits are only enabled while conversions are active. Analog startup delays affect performance. - * 0b1..ADC analog circuits are pre-enabled and ready to execute conversions without startup delays, at the cost - * of higher DC current consumption. A single power-up delay (CFG[PUDLY]) is executed immediately once PWREN - * is set. No detected triggers begin ADC operation until the power-up delay time has passed. After this - * initial delay expires, the analog circuits remain pre-enabled, and no additional delays are executed. - */ -#define ADC_CFG_PWREN(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_PWREN_SHIFT)) & ADC_CFG_PWREN_MASK) -/*! @} */ - -/*! @name PAUSE - Pause Register */ -/*! @{ */ - -#define ADC_PAUSE_PAUSEDLY_MASK (0x1FFU) -#define ADC_PAUSE_PAUSEDLY_SHIFT (0U) -/*! PAUSEDLY - Pause Delay */ -#define ADC_PAUSE_PAUSEDLY(x) (((uint32_t)(((uint32_t)(x)) << ADC_PAUSE_PAUSEDLY_SHIFT)) & ADC_PAUSE_PAUSEDLY_MASK) - -#define ADC_PAUSE_PAUSEEN_MASK (0x80000000U) -#define ADC_PAUSE_PAUSEEN_SHIFT (31U) -/*! PAUSEEN - Pause Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_PAUSE_PAUSEEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_PAUSE_PAUSEEN_SHIFT)) & ADC_PAUSE_PAUSEEN_MASK) -/*! @} */ - -/*! @name SWTRIG - Software Trigger Register */ -/*! @{ */ - -#define ADC_SWTRIG_SWT0_MASK (0x1U) -#define ADC_SWTRIG_SWT0_SHIFT (0U) -/*! SWT0 - Software Trigger 0 - * 0b0..No trigger 0 event generated. - * 0b1..Trigger 0 event generated. - */ -#define ADC_SWTRIG_SWT0(x) (((uint32_t)(((uint32_t)(x)) << ADC_SWTRIG_SWT0_SHIFT)) & ADC_SWTRIG_SWT0_MASK) - -#define ADC_SWTRIG_SWT1_MASK (0x2U) -#define ADC_SWTRIG_SWT1_SHIFT (1U) -/*! SWT1 - Software Trigger 1 - * 0b0..No trigger 1 event generated. - * 0b1..Trigger 1 event generated. - */ -#define ADC_SWTRIG_SWT1(x) (((uint32_t)(((uint32_t)(x)) << ADC_SWTRIG_SWT1_SHIFT)) & ADC_SWTRIG_SWT1_MASK) - -#define ADC_SWTRIG_SWT2_MASK (0x4U) -#define ADC_SWTRIG_SWT2_SHIFT (2U) -/*! SWT2 - Software Trigger 2 - * 0b0..No trigger 2 event generated. - * 0b1..Trigger 2 event generated. - */ -#define ADC_SWTRIG_SWT2(x) (((uint32_t)(((uint32_t)(x)) << ADC_SWTRIG_SWT2_SHIFT)) & ADC_SWTRIG_SWT2_MASK) - -#define ADC_SWTRIG_SWT3_MASK (0x8U) -#define ADC_SWTRIG_SWT3_SHIFT (3U) -/*! SWT3 - Software Trigger 3 - * 0b0..No trigger 3 event generated. - * 0b1..Trigger 3 event generated. - */ -#define ADC_SWTRIG_SWT3(x) (((uint32_t)(((uint32_t)(x)) << ADC_SWTRIG_SWT3_SHIFT)) & ADC_SWTRIG_SWT3_MASK) -/*! @} */ - -/*! @name TSTAT - Trigger Status Register */ -/*! @{ */ - -#define ADC_TSTAT_TEXC_NUM_MASK (0xFU) -#define ADC_TSTAT_TEXC_NUM_SHIFT (0U) -/*! TEXC_NUM - Trigger Exception Number - * 0b0000..No triggers have been interrupted by a high-priority exception. - * 0b0001..Trigger 0 has been interrupted by a high-priority exception. - * 0b0010..Trigger 1 has been interrupted by a high-priority exception. - * 0b0011-0b1110..Associated trigger sequence has interrupted by a high-priority exception. - * 0b1111..Every trigger sequence has been interrupted by a high-priority exception. - */ -#define ADC_TSTAT_TEXC_NUM(x) (((uint32_t)(((uint32_t)(x)) << ADC_TSTAT_TEXC_NUM_SHIFT)) & ADC_TSTAT_TEXC_NUM_MASK) - -#define ADC_TSTAT_TCOMP_FLAG_MASK (0xF0000U) -#define ADC_TSTAT_TCOMP_FLAG_SHIFT (16U) -/*! TCOMP_FLAG - Trigger Completion Flag - * 0b0000..No triggers have been completed. Trigger completion interrupts are disabled. - * 0b0001..Trigger 0 has been completed and trigger 0 has enabled completion interrupts. - * 0b0010..Trigger 1 has been completed and trigger 1 has enabled completion interrupts. - * 0b0011-0b1110..Associated trigger sequence has completed and has enabled completion interrupts. - * 0b1111..Every trigger sequence has been completed and every trigger has enabled completion interrupts. - */ -#define ADC_TSTAT_TCOMP_FLAG(x) (((uint32_t)(((uint32_t)(x)) << ADC_TSTAT_TCOMP_FLAG_SHIFT)) & ADC_TSTAT_TCOMP_FLAG_MASK) -/*! @} */ - -/*! @name OFSTRIM - Offset Trim Register */ -/*! @{ */ - -#define ADC_OFSTRIM_OFSTRIM_A_MASK (0x1FU) -#define ADC_OFSTRIM_OFSTRIM_A_SHIFT (0U) -/*! OFSTRIM_A - Trim for Offset */ -#define ADC_OFSTRIM_OFSTRIM_A(x) (((uint32_t)(((uint32_t)(x)) << ADC_OFSTRIM_OFSTRIM_A_SHIFT)) & ADC_OFSTRIM_OFSTRIM_A_MASK) - -#define ADC_OFSTRIM_OFSTRIM_B_MASK (0x1F0000U) -#define ADC_OFSTRIM_OFSTRIM_B_SHIFT (16U) -/*! OFSTRIM_B - Trim for Offset */ -#define ADC_OFSTRIM_OFSTRIM_B(x) (((uint32_t)(((uint32_t)(x)) << ADC_OFSTRIM_OFSTRIM_B_SHIFT)) & ADC_OFSTRIM_OFSTRIM_B_MASK) -/*! @} */ - -/*! @name TCTRL - Trigger Control Register */ -/*! @{ */ - -#define ADC_TCTRL_HTEN_MASK (0x1U) -#define ADC_TCTRL_HTEN_SHIFT (0U) -/*! HTEN - Trigger Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_TCTRL_HTEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_HTEN_SHIFT)) & ADC_TCTRL_HTEN_MASK) - -#define ADC_TCTRL_FIFO_SEL_A_MASK (0x2U) -#define ADC_TCTRL_FIFO_SEL_A_SHIFT (1U) -/*! FIFO_SEL_A - SAR Result Destination for Channel A - * 0b0..FIFO 0 - * 0b1..FIFO 1 - */ -#define ADC_TCTRL_FIFO_SEL_A(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_FIFO_SEL_A_SHIFT)) & ADC_TCTRL_FIFO_SEL_A_MASK) - -#define ADC_TCTRL_FIFO_SEL_B_MASK (0x4U) -#define ADC_TCTRL_FIFO_SEL_B_SHIFT (2U) -/*! FIFO_SEL_B - SAR Result Destination for Channel B - * 0b0..FIFO 0 - * 0b1..FIFO 1 - */ -#define ADC_TCTRL_FIFO_SEL_B(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_FIFO_SEL_B_SHIFT)) & ADC_TCTRL_FIFO_SEL_B_MASK) - -#define ADC_TCTRL_TPRI_MASK (0x300U) -#define ADC_TCTRL_TPRI_SHIFT (8U) -/*! TPRI - Trigger Priority Setting - * 0b00..Highest priority, Level 1 - * 0b01-0b10..Set to corresponding priority level. - * 0b11..Lowest priority, Level 4 - */ -#define ADC_TCTRL_TPRI(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_TPRI_SHIFT)) & ADC_TCTRL_TPRI_MASK) - -#define ADC_TCTRL_RSYNC_MASK (0x8000U) -#define ADC_TCTRL_RSYNC_SHIFT (15U) -/*! RSYNC - Trigger Resync - * 0b0..Disable - * 0b1..Enable - */ -#define ADC_TCTRL_RSYNC(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_RSYNC_SHIFT)) & ADC_TCTRL_RSYNC_MASK) - -#define ADC_TCTRL_TDLY_MASK (0xF0000U) -#define ADC_TCTRL_TDLY_SHIFT (16U) -/*! TDLY - Trigger Delay Select */ -#define ADC_TCTRL_TDLY(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_TDLY_SHIFT)) & ADC_TCTRL_TDLY_MASK) - -#define ADC_TCTRL_TCMD_MASK (0xF000000U) -#define ADC_TCTRL_TCMD_SHIFT (24U) -/*! TCMD - Trigger Command Select - * 0b0000..Not a valid selection from the command buffer. Trigger event is ignored. - * 0b0001..CMD1 - * 0b0010-0b1110..Corresponding CMD is executed - * 0b1111..CMD15 - */ -#define ADC_TCTRL_TCMD(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_TCMD_SHIFT)) & ADC_TCTRL_TCMD_MASK) -/*! @} */ - -/* The count of ADC_TCTRL */ -#define ADC_TCTRL_COUNT (4U) - -/*! @name FCTRL - FIFO Control Register */ -/*! @{ */ - -#define ADC_FCTRL_FCOUNT_MASK (0x1FU) -#define ADC_FCTRL_FCOUNT_SHIFT (0U) -/*! FCOUNT - Result FIFO Counter */ -#define ADC_FCTRL_FCOUNT(x) (((uint32_t)(((uint32_t)(x)) << ADC_FCTRL_FCOUNT_SHIFT)) & ADC_FCTRL_FCOUNT_MASK) - -#define ADC_FCTRL_FWMARK_MASK (0xF0000U) -#define ADC_FCTRL_FWMARK_SHIFT (16U) -/*! FWMARK - Watermark Level Selection */ -#define ADC_FCTRL_FWMARK(x) (((uint32_t)(((uint32_t)(x)) << ADC_FCTRL_FWMARK_SHIFT)) & ADC_FCTRL_FWMARK_MASK) -/*! @} */ - -/* The count of ADC_FCTRL */ -#define ADC_FCTRL_COUNT (2U) - -/*! @name GCC - Gain Calibration Control */ -/*! @{ */ - -#define ADC_GCC_GAIN_CAL_MASK (0xFFFFU) -#define ADC_GCC_GAIN_CAL_SHIFT (0U) -/*! GAIN_CAL - Gain Calibration Value */ -#define ADC_GCC_GAIN_CAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_GCC_GAIN_CAL_SHIFT)) & ADC_GCC_GAIN_CAL_MASK) - -#define ADC_GCC_RDY_MASK (0x1000000U) -#define ADC_GCC_RDY_SHIFT (24U) -/*! RDY - Gain Calibration Value Valid - * 0b0..Invalid - * 0b1..Valid - */ -#define ADC_GCC_RDY(x) (((uint32_t)(((uint32_t)(x)) << ADC_GCC_RDY_SHIFT)) & ADC_GCC_RDY_MASK) -/*! @} */ - -/* The count of ADC_GCC */ -#define ADC_GCC_COUNT (2U) - -/*! @name GCR - Gain Calculation Result */ -/*! @{ */ - -#define ADC_GCR_GCALR_MASK (0xFFFFU) -#define ADC_GCR_GCALR_SHIFT (0U) -/*! GCALR - Gain Calculation Result */ -#define ADC_GCR_GCALR(x) (((uint32_t)(((uint32_t)(x)) << ADC_GCR_GCALR_SHIFT)) & ADC_GCR_GCALR_MASK) - -#define ADC_GCR_RDY_MASK (0x1000000U) -#define ADC_GCR_RDY_SHIFT (24U) -/*! RDY - Gain Calculation Ready - * 0b0..Invalid - * 0b1..Valid - */ -#define ADC_GCR_RDY(x) (((uint32_t)(((uint32_t)(x)) << ADC_GCR_RDY_SHIFT)) & ADC_GCR_RDY_MASK) -/*! @} */ - -/* The count of ADC_GCR */ -#define ADC_GCR_COUNT (2U) - -/*! @name CMDL - Command Low Buffer Register */ -/*! @{ */ - -#define ADC_CMDL_ADCH_MASK (0x1FU) -#define ADC_CMDL_ADCH_SHIFT (0U) -/*! ADCH - Input Channel Select - * 0b00000..CH0A or CH0B or CH0A/CH0B pair. - * 0b00001..CH1A or CH1B or CH1A/CH1B pair. - * 0b00010..CH2A or CH2B or CH2A/CH2B pair. - * 0b00011..CH3A or CH3B or CH3A/CH3B pair. - * 0b00100-0b11101..Select corresponding channel CHnA or CHnB or CHnA/CHnB pair. - * 0b11110..CH30A or CH30B or CH30A/CH30B pair. - * 0b11111..CH31A or CH31B or CH31A/CH31B pair. - */ -#define ADC_CMDL_ADCH(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDL_ADCH_SHIFT)) & ADC_CMDL_ADCH_MASK) - -#define ADC_CMDL_CTYPE_MASK (0x60U) -#define ADC_CMDL_CTYPE_SHIFT (5U) -/*! CTYPE - Conversion Type - * 0b00..Single-Ended mode. Only A-side channel is converted. - * 0b01..Single-Ended mode. Only B-side channel is converted. - * 0b10..Differential mode. A-B. - * 0b11..Dual-Single-Ended mode. Both A-side and B-side channels are converted independently. - */ -#define ADC_CMDL_CTYPE(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDL_CTYPE_SHIFT)) & ADC_CMDL_CTYPE_MASK) - -#define ADC_CMDL_MODE_MASK (0x80U) -#define ADC_CMDL_MODE_SHIFT (7U) -/*! MODE - Select Resolution of Conversions - * 0b0..Standard resolution. Single-ended 12-bit conversion; differential 13-bit conversion with 2's complement output. - * 0b1..High resolution. Single-ended 16-bit conversion; differential 16-bit conversion with 2's complement output. - */ -#define ADC_CMDL_MODE(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDL_MODE_SHIFT)) & ADC_CMDL_MODE_MASK) - -#define ADC_CMDL_ALTB_ADCH_MASK (0x1F0000U) -#define ADC_CMDL_ALTB_ADCH_SHIFT (16U) -/*! ALTB_ADCH - Alternate Channel B Input Channel Select - * 0b00000..Select CH0B - * 0b00001..Select CH1B - * 0b00010..Select CH2B - * 0b00011..Select CH3B - * 0b00100-0b11101..Select corresponding channel CHnB - * 0b11110..Select CH30B - * 0b11111..Select CH31B - */ -#define ADC_CMDL_ALTB_ADCH(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDL_ALTB_ADCH_SHIFT)) & ADC_CMDL_ALTB_ADCH_MASK) - -#define ADC_CMDL_ALTBEN_MASK (0x200000U) -#define ADC_CMDL_ALTBEN_SHIFT (21U) -/*! ALTBEN - Alternate Channel B Select Enable - * 0b0..ALTBEN_ADCH disabled. Channel-A and Channel-B inputs are selected based on ADCH settings. - * 0b1..ALTBEN_ADCH enabled. Channel-A inputs are selected by ADCH setting and Channel-B inputs are selected by ALTB_ADCH setting. - */ -#define ADC_CMDL_ALTBEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDL_ALTBEN_SHIFT)) & ADC_CMDL_ALTBEN_MASK) -/*! @} */ - -/* The count of ADC_CMDL */ -#define ADC_CMDL_COUNT (15U) - -/*! @name CMDH - Command High Buffer Register */ -/*! @{ */ - -#define ADC_CMDH_CMPEN_MASK (0x3U) -#define ADC_CMDH_CMPEN_SHIFT (0U) -/*! CMPEN - Compare Function Enable - * 0b00..Disabled - * 0b01.. - * 0b10..Enabled. Store on true. - * 0b11..Enabled. Repeat channel acquisition (sample, convert, and compare) until true. - */ -#define ADC_CMDH_CMPEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_CMPEN_SHIFT)) & ADC_CMDH_CMPEN_MASK) - -#define ADC_CMDH_WAIT_TRIG_MASK (0x4U) -#define ADC_CMDH_WAIT_TRIG_SHIFT (2U) -/*! WAIT_TRIG - Wait for Trigger Assertion Before Execution - * 0b0..Command executes automatically. - * 0b1..Active trigger must be asserted again before executing this command. - */ -#define ADC_CMDH_WAIT_TRIG(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_WAIT_TRIG_SHIFT)) & ADC_CMDH_WAIT_TRIG_MASK) - -#define ADC_CMDH_LWI_MASK (0x80U) -#define ADC_CMDH_LWI_SHIFT (7U) -/*! LWI - Loop with Increment - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_CMDH_LWI(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_LWI_SHIFT)) & ADC_CMDH_LWI_MASK) - -#define ADC_CMDH_STS_MASK (0x700U) -#define ADC_CMDH_STS_SHIFT (8U) -/*! STS - Sample Time Select - * 0b000..Minimum sample time of 3.5 ADCK cycles. - * 0b001..5.5 ADCK cycles - * 0b010..7.5 ADCK cycles - * 0b011..11.5 ADCK cycles - * 0b100..19.5 ADCK cycles - * 0b101..35.5 ADCK cycles - * 0b110..67.5 ADCK cycles - * 0b111..131.5 ADCK cycles - */ -#define ADC_CMDH_STS(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_STS_SHIFT)) & ADC_CMDH_STS_MASK) - -#define ADC_CMDH_AVGS_MASK (0xF000U) -#define ADC_CMDH_AVGS_SHIFT (12U) -/*! AVGS - Hardware Average Select - * 0b0000..Single conversion - * 0b0001..2 - * 0b0010..4 - * 0b0011..8 - * 0b0100..16 - * 0b0101..32 - * 0b0110..64 - * 0b0111..128 - * 0b1000..256 - * 0b1001..512 - * 0b1010..1024 - */ -#define ADC_CMDH_AVGS(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_AVGS_SHIFT)) & ADC_CMDH_AVGS_MASK) - -#define ADC_CMDH_LOOP_MASK (0xF0000U) -#define ADC_CMDH_LOOP_SHIFT (16U) -/*! LOOP - Loop Count Select - * 0b0000..Looping not enabled. Command executes one time. - * 0b0001..Loop one time. Command executes two times. - * 0b0010..Loop two times. Command executes three times. - * 0b0011-0b1110..Loop corresponding number of times. Command executes LOOP + 1 times. - * 0b1111..Loop 15 times. Command executes 16 times. - */ -#define ADC_CMDH_LOOP(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_LOOP_SHIFT)) & ADC_CMDH_LOOP_MASK) - -#define ADC_CMDH_NEXT_MASK (0xF000000U) -#define ADC_CMDH_NEXT_SHIFT (24U) -/*! NEXT - Next Command Select - * 0b0000..No next command defined. Terminate conversions at completion of current command. If lower priority - * trigger pending, begin command associated with lower priority trigger. - * 0b0001..CMD1 - * 0b0010-0b1110..Select corresponding CMD command buffer register as next command - * 0b1111..CMD15 - */ -#define ADC_CMDH_NEXT(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_NEXT_SHIFT)) & ADC_CMDH_NEXT_MASK) -/*! @} */ - -/* The count of ADC_CMDH */ -#define ADC_CMDH_COUNT (15U) - -/*! @name CV - Compare Value Register */ -/*! @{ */ - -#define ADC_CV_CVL_MASK (0xFFFFU) -#define ADC_CV_CVL_SHIFT (0U) -/*! CVL - Compare Value Low */ -#define ADC_CV_CVL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CV_CVL_SHIFT)) & ADC_CV_CVL_MASK) - -#define ADC_CV_CVH_MASK (0xFFFF0000U) -#define ADC_CV_CVH_SHIFT (16U) -/*! CVH - Compare Value High */ -#define ADC_CV_CVH(x) (((uint32_t)(((uint32_t)(x)) << ADC_CV_CVH_SHIFT)) & ADC_CV_CVH_MASK) -/*! @} */ - -/* The count of ADC_CV */ -#define ADC_CV_COUNT (15U) - -/*! @name RESFIFO - Data Result FIFO Register */ -/*! @{ */ - -#define ADC_RESFIFO_D_MASK (0xFFFFU) -#define ADC_RESFIFO_D_SHIFT (0U) -/*! D - Data Result */ -#define ADC_RESFIFO_D(x) (((uint32_t)(((uint32_t)(x)) << ADC_RESFIFO_D_SHIFT)) & ADC_RESFIFO_D_MASK) - -#define ADC_RESFIFO_TSRC_MASK (0x30000U) -#define ADC_RESFIFO_TSRC_SHIFT (16U) -/*! TSRC - Trigger Source - * 0b00..Trigger source 0 - * 0b01..Trigger source 1 - * 0b10..Trigger source 2 - * 0b11..Trigger source 3 - */ -#define ADC_RESFIFO_TSRC(x) (((uint32_t)(((uint32_t)(x)) << ADC_RESFIFO_TSRC_SHIFT)) & ADC_RESFIFO_TSRC_MASK) - -#define ADC_RESFIFO_LOOPCNT_MASK (0xF00000U) -#define ADC_RESFIFO_LOOPCNT_SHIFT (20U) -/*! LOOPCNT - Loop Count Value - * 0b0000..Result is from initial conversion in command. - * 0b0001..Result is from second conversion in command. - * 0b0010-0b1110..Result is from (LOOPCNT + 1) conversion in command. - * 0b1111..Result is from 16th conversion in command. - */ -#define ADC_RESFIFO_LOOPCNT(x) (((uint32_t)(((uint32_t)(x)) << ADC_RESFIFO_LOOPCNT_SHIFT)) & ADC_RESFIFO_LOOPCNT_MASK) - -#define ADC_RESFIFO_CMDSRC_MASK (0xF000000U) -#define ADC_RESFIFO_CMDSRC_SHIFT (24U) -/*! CMDSRC - Command Buffer Source - * 0b0000..Not a valid value CMDSRC value for a data word in RESFIFO. 0h is only found in the initial FIFO state, - * prior to the storage of an ADC conversion result into a RESFIFO buffer. - * 0b0001..CMD1 - * 0b0010-0b1110..Corresponding command buffer used as control settings for this conversion. - * 0b1111..CMD15 - */ -#define ADC_RESFIFO_CMDSRC(x) (((uint32_t)(((uint32_t)(x)) << ADC_RESFIFO_CMDSRC_SHIFT)) & ADC_RESFIFO_CMDSRC_MASK) - -#define ADC_RESFIFO_VALID_MASK (0x80000000U) -#define ADC_RESFIFO_VALID_SHIFT (31U) -/*! VALID - FIFO Entry is Valid - * 0b0..FIFO is empty. Discard any read from RESFIFO. - * 0b1..FIFO contains data. FIFO record read from RESFIFO is valid. - */ -#define ADC_RESFIFO_VALID(x) (((uint32_t)(((uint32_t)(x)) << ADC_RESFIFO_VALID_SHIFT)) & ADC_RESFIFO_VALID_MASK) -/*! @} */ - -/* The count of ADC_RESFIFO */ -#define ADC_RESFIFO_COUNT (2U) - -/*! @name CAL_GAR - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR_CAL_GAR_VAL_MASK (0xFFFFU) /* Merged from fields with different position or width, of widths (11, 12, 13, 14, 15, 16), largest definition used */ -#define ADC_CAL_GAR_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR_CAL_GAR_VAL_MASK) /* Merged from fields with different position or width, of widths (11, 12, 13, 14, 15, 16), largest definition used */ -/*! @} */ - -/* The count of ADC_CAL_GAR */ -#define ADC_CAL_GAR_COUNT (33U) - -/*! @name CAL_GBR - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR_CAL_GBR_VAL_MASK (0xFFFFU) /* Merged from fields with different position or width, of widths (11, 12, 13, 14, 15, 16), largest definition used */ -#define ADC_CAL_GBR_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR_CAL_GBR_VAL_MASK) /* Merged from fields with different position or width, of widths (11, 12, 13, 14, 15, 16), largest definition used */ -/*! @} */ - -/* The count of ADC_CAL_GBR */ -#define ADC_CAL_GBR_COUNT (33U) - - -/*! - * @} - */ /* end of group ADC_Register_Masks */ - - -/* ADC - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral ADC0 base address */ - #define ADC0_BASE (0x5010D000u) - /** Peripheral ADC0 base address */ - #define ADC0_BASE_NS (0x4010D000u) - /** Peripheral ADC0 base pointer */ - #define ADC0 ((ADC_Type *)ADC0_BASE) - /** Peripheral ADC0 base pointer */ - #define ADC0_NS ((ADC_Type *)ADC0_BASE_NS) - /** Peripheral ADC1 base address */ - #define ADC1_BASE (0x5010E000u) - /** Peripheral ADC1 base address */ - #define ADC1_BASE_NS (0x4010E000u) - /** Peripheral ADC1 base pointer */ - #define ADC1 ((ADC_Type *)ADC1_BASE) - /** Peripheral ADC1 base pointer */ - #define ADC1_NS ((ADC_Type *)ADC1_BASE_NS) - /** Array initializer of ADC peripheral base addresses */ - #define ADC_BASE_ADDRS { ADC0_BASE, ADC1_BASE } - /** Array initializer of ADC peripheral base pointers */ - #define ADC_BASE_PTRS { ADC0, ADC1 } - /** Array initializer of ADC peripheral base addresses */ - #define ADC_BASE_ADDRS_NS { ADC0_BASE_NS, ADC1_BASE_NS } - /** Array initializer of ADC peripheral base pointers */ - #define ADC_BASE_PTRS_NS { ADC0_NS, ADC1_NS } -#else - /** Peripheral ADC0 base address */ - #define ADC0_BASE (0x4010D000u) - /** Peripheral ADC0 base pointer */ - #define ADC0 ((ADC_Type *)ADC0_BASE) - /** Peripheral ADC1 base address */ - #define ADC1_BASE (0x4010E000u) - /** Peripheral ADC1 base pointer */ - #define ADC1 ((ADC_Type *)ADC1_BASE) - /** Array initializer of ADC peripheral base addresses */ - #define ADC_BASE_ADDRS { ADC0_BASE, ADC1_BASE } - /** Array initializer of ADC peripheral base pointers */ - #define ADC_BASE_PTRS { ADC0, ADC1 } -#endif -/** Interrupt vectors for the ADC peripheral type */ -#define ADC_IRQS { ADC0_IRQn, ADC1_IRQn } - -/*! - * @} - */ /* end of group ADC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- AHBSC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup AHBSC_Peripheral_Access_Layer AHBSC Peripheral Access Layer - * @{ - */ - -/** AHBSC - Register Layout Typedef */ -typedef struct { - uint8_t RESERVED_0[16]; - __IO uint32_t FLASH00_MEM_RULE[4]; /**< Flash Memory Rule, array offset: 0x10, array step: 0x4 */ - __IO uint32_t FLASH01_MEM_RULE[4]; /**< Flash Memory Rule, array offset: 0x20, array step: 0x4 */ - __IO uint32_t FLASH02_MEM_RULE; /**< Flash Memory Rule, offset: 0x30 */ - uint8_t RESERVED_1[12]; - __IO uint32_t FLASH03_MEM_RULE; /**< Flash Memory Rule, offset: 0x40 */ - uint8_t RESERVED_2[28]; - __IO uint32_t ROM_MEM_RULE[4]; /**< ROM Memory Rule, array offset: 0x60, array step: 0x4 */ - uint8_t RESERVED_3[16]; - __IO uint32_t RAMX_MEM_RULE[3]; /**< RAMX Memory Rule, array offset: 0x80, array step: 0x4 */ - uint8_t RESERVED_4[20]; - __IO uint32_t RAMA_MEM_RULE; /**< RAMA Memory Rule 0, offset: 0xA0 */ - uint8_t RESERVED_5[28]; - __IO uint32_t RAMB_MEM_RULE; /**< RAMB Memory Rule, offset: 0xC0 */ - uint8_t RESERVED_6[28]; - __IO uint32_t RAMC_MEM_RULE[2]; /**< RAMC Memory Rule, array offset: 0xE0, array step: 0x4 */ - uint8_t RESERVED_7[24]; - __IO uint32_t RAMD_MEM_RULE[2]; /**< RAMD Memory Rule, array offset: 0x100, array step: 0x4 */ - uint8_t RESERVED_8[24]; - __IO uint32_t RAME_MEM_RULE[2]; /**< RAME Memory Rule, array offset: 0x120, array step: 0x4 */ - uint8_t RESERVED_9[24]; - __IO uint32_t RAMF_MEM_RULE[2]; /**< RAMF Memory Rule, array offset: 0x140, array step: 0x4 */ - uint8_t RESERVED_10[24]; - __IO uint32_t RAMG_MEM_RULE[2]; /**< RAMG Memory Rule, array offset: 0x160, array step: 0x4 */ - uint8_t RESERVED_11[24]; - __IO uint32_t RAMH_MEM_RULE; /**< RAMH Memory Rule, offset: 0x180 */ - uint8_t RESERVED_12[28]; - __IO uint32_t APB_PERIPHERAL_GROUP0_MEM_RULE0; /**< APB Bridge Group 0 Memory Rule 0, offset: 0x1A0 */ - __IO uint32_t APB_PERIPHERAL_GROUP0_MEM_RULE1; /**< APB Bridge Group 0 Memory Rule 1, offset: 0x1A4 */ - __IO uint32_t APB_PERIPHERAL_GROUP0_MEM_RULE2; /**< APB Bridge Group 0 Rule 2, offset: 0x1A8 */ - __IO uint32_t APB_PERIPHERAL_GROUP0_MEM_RULE3; /**< APB Bridge Group 0 Memory Rule 3, offset: 0x1AC */ - __IO uint32_t APB_PERIPHERAL_GROUP1_MEM_RULE0; /**< APB Bridge Group 1 Memory Rule 0, offset: 0x1B0 */ - __IO uint32_t APB_PERIPHERAL_GROUP1_MEM_RULE1; /**< APB Bridge Group 1 Memory Rule 1, offset: 0x1B4 */ - uint8_t RESERVED_13[4]; - __IO uint32_t APB_PERIPHERAL_GROUP1_MEM_RULE2; /**< APB Bridge Group 1 Memory Rule 2, offset: 0x1BC */ - __IO uint32_t AIPS_BRIDGE_GROUP0_MEM_RULE0; /**< AIPS Bridge Group 0 Memory Rule 0, offset: 0x1C0 */ - __IO uint32_t AIPS_BRIDGE_GROUP0_MEM_RULE1; /**< AIPS Bridge Group 0 Memory Rule 1, offset: 0x1C4 */ - __IO uint32_t AIPS_BRIDGE_GROUP0_MEM_RULE2; /**< AIPS Bridge Group 0 Memory Rule 2, offset: 0x1C8 */ - __IO uint32_t AIPS_BRIDGE_GROUP0_MEM_RULE3; /**< AIPS Bridge Group 0 Memory Rule 3, offset: 0x1CC */ - __IO uint32_t AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0; /**< AHB Peripheral 0 Slave Port 12 Slave Rule 0, offset: 0x1D0 */ - __IO uint32_t AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1; /**< AHB Peripheral 0 Slave Port 12 Slave Rule 1, offset: 0x1D4 */ - __IO uint32_t AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE2; /**< AHB Peripheral 0 Slave Port 12 Slave Rule 2, offset: 0x1D8 */ - uint8_t RESERVED_14[4]; - __IO uint32_t AIPS_BRIDGE_GROUP1_MEM_RULE0; /**< AIPS Bridge Group 1 Rule 0, offset: 0x1E0 */ - __IO uint32_t AIPS_BRIDGE_GROUP1_MEM_RULE1; /**< AIPS Bridge Group 1 Rule 1, offset: 0x1E4 */ - uint8_t RESERVED_15[8]; - __IO uint32_t AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0; /**< AHB Peripheral 1 Slave Port 13 Slave Rule 0, offset: 0x1F0 */ - __IO uint32_t AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1; /**< AHB Peripheral 1 Slave Port 13 Slave Rule 1, offset: 0x1F4 */ - __IO uint32_t AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE2; /**< AHB Peripheral 1 Slave Port 13 Slave Rule 2, offset: 0x1F8 */ - uint8_t RESERVED_16[4]; - __IO uint32_t AIPS_BRIDGE_GROUP2_MEM_RULE0; /**< AIPS Bridge Group 2 Rule 0, offset: 0x200 */ - __IO uint32_t AIPS_BRIDGE_GROUP2_MEM_RULE1; /**< AIPS Bridge Group 2 Memory Rule 1, offset: 0x204 */ - uint8_t RESERVED_17[24]; - __IO uint32_t AIPS_BRIDGE_GROUP3_MEM_RULE0; /**< AIPS Bridge Group 3 Rule 0, offset: 0x220 */ - __IO uint32_t AIPS_BRIDGE_GROUP3_MEM_RULE1; /**< AIPS Bridge Group 3 Memory Rule 1, offset: 0x224 */ - __IO uint32_t AIPS_BRIDGE_GROUP3_MEM_RULE2; /**< AIPS Bridge Group 3 Rule 2, offset: 0x228 */ - __IO uint32_t AIPS_BRIDGE_GROUP3_MEM_RULE3; /**< AIPS Bridge Group 3 Rule 3, offset: 0x22C */ - uint8_t RESERVED_18[16]; - __IO uint32_t AIPS_BRIDGE_GROUP4_MEM_RULE0; /**< AIPS Bridge Group 4 Rule 0, offset: 0x240 */ - __IO uint32_t AIPS_BRIDGE_GROUP4_MEM_RULE1; /**< AIPS Bridge Group 4 Rule 1, offset: 0x244 */ - __IO uint32_t AIPS_BRIDGE_GROUP4_MEM_RULE2; /**< AIPS Bridge Group 4 Rule 2, offset: 0x248 */ - __IO uint32_t AIPS_BRIDGE_GROUP4_MEM_RULE3; /**< AIPS Bridge Group 4 Rule 3, offset: 0x24C */ - __IO uint32_t AHB_SECURE_CTRL_PERIPHERAL_RULE0; /**< AHB Secure Control Peripheral Rule 0, offset: 0x250 */ - uint8_t RESERVED_19[28]; - __IO uint32_t FLEXSPI0_REGION0_MEM_RULE[4]; /**< FLEXSPI0 Region 0 Memory Rule, array offset: 0x270, array step: 0x4 */ - struct { /* offset: 0x280, array step: 0x10 */ - __IO uint32_t FLEXSPI0_REGION_MEM_RULE0; /**< FLEXSPI0 Region 1 Memory Rule 0..FLEXSPI0 Region 6 Memory Rule 0, array offset: 0x280, array step: 0x10 */ - uint8_t RESERVED_0[12]; - } FLEXSPI0_REGION1_6_MEM_RULE[6]; - __IO uint32_t FLEXSPI0_REGION7_MEM_RULE[4]; /**< FLEXSPI0 Region 7 Memory Rule, array offset: 0x2E0, array step: 0x4 */ - struct { /* offset: 0x2F0, array step: 0x10 */ - __IO uint32_t FLEXSPI0_REGION_MEM_RULE0; /**< FLEXSPI0 Region 8 Memory Rule 0..FLEXSPI0 Region 13 Memory Rule 0, array offset: 0x2F0, array step: 0x10 */ - uint8_t RESERVED_0[12]; - } FLEXSPI0_REGION8_13_MEM_RULE[6]; - uint8_t RESERVED_20[2736]; - __I uint32_t SEC_VIO_ADDR[32]; /**< Security Violation Address, array offset: 0xE00, array step: 0x4 */ - __I uint32_t SEC_VIO_MISC_INFO[32]; /**< Security Violation Miscellaneous Information at Address, array offset: 0xE80, array step: 0x4 */ - __IO uint32_t SEC_VIO_INFO_VALID; /**< Security Violation Info Validity for Address, offset: 0xF00 */ - uint8_t RESERVED_21[124]; - __IO uint32_t SEC_GPIO_MASK[2]; /**< GPIO Mask for Port 0..GPIO Mask for Port 1, array offset: 0xF80, array step: 0x4 */ - uint8_t RESERVED_22[16]; - __IO uint32_t SEC_CPU1_INT_MASK0; /**< Secure Interrupt Mask 0 for CPU1, offset: 0xF98 */ - __IO uint32_t SEC_CPU1_INT_MASK1; /**< Secure Interrupt Mask 1 for CPU1, offset: 0xF9C */ - __IO uint32_t SEC_CPU1_INT_MASK2; /**< Secure Interrupt Mask 2 for CPU1, offset: 0xFA0 */ - __IO uint32_t SEC_CPU1_INT_MASK3; /**< Secure Interrupt Mask 3 for CPU1, offset: 0xFA4 */ - __IO uint32_t SEC_CPU1_INT_MASK4; /**< Secure Interrupt Mask 4 for CPU1, offset: 0xFA8 */ - uint8_t RESERVED_23[16]; - __IO uint32_t SEC_GP_REG_LOCK; /**< Secure Mask Lock, offset: 0xFBC */ - uint8_t RESERVED_24[16]; - __IO uint32_t MASTER_SEC_LEVEL; /**< Master Secure Level, offset: 0xFD0 */ - __IO uint32_t MASTER_SEC_ANTI_POL_REG; /**< Master Secure Level, offset: 0xFD4 */ - uint8_t RESERVED_25[20]; - __IO uint32_t CPU0_LOCK_REG; /**< Miscellaneous CPU0 Control Signals, offset: 0xFEC */ - __IO uint32_t CPU1_LOCK_REG; /**< Miscellaneous CPU1 Control Signals, offset: 0xFF0 */ - uint8_t RESERVED_26[4]; - __IO uint32_t MISC_CTRL_DP_REG; /**< Secure Control Duplicate, offset: 0xFF8 */ - __IO uint32_t MISC_CTRL_REG; /**< Secure Control, offset: 0xFFC */ -} AHBSC_Type; - -/* ---------------------------------------------------------------------------- - -- AHBSC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup AHBSC_Register_Masks AHBSC Register Masks - * @{ - */ - -/*! @name FLASH00_MEM_RULE - Flash Memory Rule */ -/*! @{ */ - -#define AHBSC_FLASH00_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_FLASH00_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH00_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH00_MEM_RULE_RULE0_SHIFT)) & AHBSC_FLASH00_MEM_RULE_RULE0_MASK) - -#define AHBSC_FLASH00_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_FLASH00_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH00_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH00_MEM_RULE_RULE1_SHIFT)) & AHBSC_FLASH00_MEM_RULE_RULE1_MASK) - -#define AHBSC_FLASH00_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_FLASH00_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH00_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH00_MEM_RULE_RULE2_SHIFT)) & AHBSC_FLASH00_MEM_RULE_RULE2_MASK) - -#define AHBSC_FLASH00_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_FLASH00_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH00_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH00_MEM_RULE_RULE3_SHIFT)) & AHBSC_FLASH00_MEM_RULE_RULE3_MASK) - -#define AHBSC_FLASH00_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_FLASH00_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH00_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH00_MEM_RULE_RULE4_SHIFT)) & AHBSC_FLASH00_MEM_RULE_RULE4_MASK) - -#define AHBSC_FLASH00_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_FLASH00_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH00_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH00_MEM_RULE_RULE5_SHIFT)) & AHBSC_FLASH00_MEM_RULE_RULE5_MASK) - -#define AHBSC_FLASH00_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_FLASH00_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH00_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH00_MEM_RULE_RULE6_SHIFT)) & AHBSC_FLASH00_MEM_RULE_RULE6_MASK) - -#define AHBSC_FLASH00_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_FLASH00_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH00_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH00_MEM_RULE_RULE7_SHIFT)) & AHBSC_FLASH00_MEM_RULE_RULE7_MASK) -/*! @} */ - -/* The count of AHBSC_FLASH00_MEM_RULE */ -#define AHBSC_FLASH00_MEM_RULE_COUNT (4U) - -/*! @name FLASH01_MEM_RULE - Flash Memory Rule */ -/*! @{ */ - -#define AHBSC_FLASH01_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_FLASH01_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH01_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH01_MEM_RULE_RULE0_SHIFT)) & AHBSC_FLASH01_MEM_RULE_RULE0_MASK) - -#define AHBSC_FLASH01_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_FLASH01_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH01_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH01_MEM_RULE_RULE1_SHIFT)) & AHBSC_FLASH01_MEM_RULE_RULE1_MASK) - -#define AHBSC_FLASH01_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_FLASH01_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH01_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH01_MEM_RULE_RULE2_SHIFT)) & AHBSC_FLASH01_MEM_RULE_RULE2_MASK) - -#define AHBSC_FLASH01_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_FLASH01_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH01_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH01_MEM_RULE_RULE3_SHIFT)) & AHBSC_FLASH01_MEM_RULE_RULE3_MASK) - -#define AHBSC_FLASH01_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_FLASH01_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH01_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH01_MEM_RULE_RULE4_SHIFT)) & AHBSC_FLASH01_MEM_RULE_RULE4_MASK) - -#define AHBSC_FLASH01_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_FLASH01_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH01_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH01_MEM_RULE_RULE5_SHIFT)) & AHBSC_FLASH01_MEM_RULE_RULE5_MASK) - -#define AHBSC_FLASH01_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_FLASH01_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH01_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH01_MEM_RULE_RULE6_SHIFT)) & AHBSC_FLASH01_MEM_RULE_RULE6_MASK) - -#define AHBSC_FLASH01_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_FLASH01_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH01_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH01_MEM_RULE_RULE7_SHIFT)) & AHBSC_FLASH01_MEM_RULE_RULE7_MASK) -/*! @} */ - -/* The count of AHBSC_FLASH01_MEM_RULE */ -#define AHBSC_FLASH01_MEM_RULE_COUNT (4U) - -/*! @name FLASH02_MEM_RULE - Flash Memory Rule */ -/*! @{ */ - -#define AHBSC_FLASH02_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_FLASH02_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH02_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH02_MEM_RULE_RULE0_SHIFT)) & AHBSC_FLASH02_MEM_RULE_RULE0_MASK) - -#define AHBSC_FLASH02_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_FLASH02_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH02_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH02_MEM_RULE_RULE1_SHIFT)) & AHBSC_FLASH02_MEM_RULE_RULE1_MASK) - -#define AHBSC_FLASH02_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_FLASH02_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH02_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH02_MEM_RULE_RULE2_SHIFT)) & AHBSC_FLASH02_MEM_RULE_RULE2_MASK) - -#define AHBSC_FLASH02_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_FLASH02_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH02_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH02_MEM_RULE_RULE3_SHIFT)) & AHBSC_FLASH02_MEM_RULE_RULE3_MASK) -/*! @} */ - -/*! @name FLASH03_MEM_RULE - Flash Memory Rule */ -/*! @{ */ - -#define AHBSC_FLASH03_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_FLASH03_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH03_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH03_MEM_RULE_RULE0_SHIFT)) & AHBSC_FLASH03_MEM_RULE_RULE0_MASK) - -#define AHBSC_FLASH03_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_FLASH03_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH03_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH03_MEM_RULE_RULE1_SHIFT)) & AHBSC_FLASH03_MEM_RULE_RULE1_MASK) - -#define AHBSC_FLASH03_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_FLASH03_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH03_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH03_MEM_RULE_RULE2_SHIFT)) & AHBSC_FLASH03_MEM_RULE_RULE2_MASK) - -#define AHBSC_FLASH03_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_FLASH03_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH03_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH03_MEM_RULE_RULE3_SHIFT)) & AHBSC_FLASH03_MEM_RULE_RULE3_MASK) - -#define AHBSC_FLASH03_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_FLASH03_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH03_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH03_MEM_RULE_RULE4_SHIFT)) & AHBSC_FLASH03_MEM_RULE_RULE4_MASK) - -#define AHBSC_FLASH03_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_FLASH03_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH03_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH03_MEM_RULE_RULE5_SHIFT)) & AHBSC_FLASH03_MEM_RULE_RULE5_MASK) - -#define AHBSC_FLASH03_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_FLASH03_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH03_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH03_MEM_RULE_RULE6_SHIFT)) & AHBSC_FLASH03_MEM_RULE_RULE6_MASK) - -#define AHBSC_FLASH03_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_FLASH03_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH03_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH03_MEM_RULE_RULE7_SHIFT)) & AHBSC_FLASH03_MEM_RULE_RULE7_MASK) -/*! @} */ - -/*! @name ROM_MEM_RULE - ROM Memory Rule */ -/*! @{ */ - -#define AHBSC_ROM_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_ROM_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_ROM_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_ROM_MEM_RULE_RULE0_SHIFT)) & AHBSC_ROM_MEM_RULE_RULE0_MASK) - -#define AHBSC_ROM_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_ROM_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_ROM_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_ROM_MEM_RULE_RULE1_SHIFT)) & AHBSC_ROM_MEM_RULE_RULE1_MASK) - -#define AHBSC_ROM_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_ROM_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_ROM_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_ROM_MEM_RULE_RULE2_SHIFT)) & AHBSC_ROM_MEM_RULE_RULE2_MASK) - -#define AHBSC_ROM_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_ROM_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_ROM_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_ROM_MEM_RULE_RULE3_SHIFT)) & AHBSC_ROM_MEM_RULE_RULE3_MASK) - -#define AHBSC_ROM_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_ROM_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_ROM_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_ROM_MEM_RULE_RULE4_SHIFT)) & AHBSC_ROM_MEM_RULE_RULE4_MASK) - -#define AHBSC_ROM_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_ROM_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_ROM_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_ROM_MEM_RULE_RULE5_SHIFT)) & AHBSC_ROM_MEM_RULE_RULE5_MASK) - -#define AHBSC_ROM_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_ROM_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_ROM_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_ROM_MEM_RULE_RULE6_SHIFT)) & AHBSC_ROM_MEM_RULE_RULE6_MASK) - -#define AHBSC_ROM_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_ROM_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_ROM_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_ROM_MEM_RULE_RULE7_SHIFT)) & AHBSC_ROM_MEM_RULE_RULE7_MASK) -/*! @} */ - -/* The count of AHBSC_ROM_MEM_RULE */ -#define AHBSC_ROM_MEM_RULE_COUNT (4U) - -/*! @name RAMX_MEM_RULE0_RAMX_MEM_RULE - RAMX Memory Rule */ -/*! @{ */ - -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE0_SHIFT)) & AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE0_MASK) - -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE1_SHIFT)) & AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE1_MASK) - -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE2_SHIFT)) & AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE2_MASK) - -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE3_SHIFT)) & AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE3_MASK) - -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE4_SHIFT)) & AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE4_MASK) - -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE5_SHIFT)) & AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE5_MASK) - -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE6_SHIFT)) & AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE6_MASK) - -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE7_SHIFT)) & AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE7_MASK) -/*! @} */ - -/* The count of AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE */ -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_COUNT (3U) - -/*! @name RAMA_MEM_RULE - RAMA Memory Rule 0 */ -/*! @{ */ - -#define AHBSC_RAMA_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_RAMA_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMA_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMA_MEM_RULE_RULE0_SHIFT)) & AHBSC_RAMA_MEM_RULE_RULE0_MASK) - -#define AHBSC_RAMA_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_RAMA_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMA_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMA_MEM_RULE_RULE1_SHIFT)) & AHBSC_RAMA_MEM_RULE_RULE1_MASK) - -#define AHBSC_RAMA_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_RAMA_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMA_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMA_MEM_RULE_RULE2_SHIFT)) & AHBSC_RAMA_MEM_RULE_RULE2_MASK) - -#define AHBSC_RAMA_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_RAMA_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMA_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMA_MEM_RULE_RULE3_SHIFT)) & AHBSC_RAMA_MEM_RULE_RULE3_MASK) - -#define AHBSC_RAMA_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_RAMA_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMA_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMA_MEM_RULE_RULE4_SHIFT)) & AHBSC_RAMA_MEM_RULE_RULE4_MASK) - -#define AHBSC_RAMA_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_RAMA_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMA_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMA_MEM_RULE_RULE5_SHIFT)) & AHBSC_RAMA_MEM_RULE_RULE5_MASK) - -#define AHBSC_RAMA_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_RAMA_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMA_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMA_MEM_RULE_RULE6_SHIFT)) & AHBSC_RAMA_MEM_RULE_RULE6_MASK) - -#define AHBSC_RAMA_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_RAMA_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMA_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMA_MEM_RULE_RULE7_SHIFT)) & AHBSC_RAMA_MEM_RULE_RULE7_MASK) -/*! @} */ - -/*! @name RAMB_MEM_RULE - RAMB Memory Rule */ -/*! @{ */ - -#define AHBSC_RAMB_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_RAMB_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMB_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMB_MEM_RULE_RULE0_SHIFT)) & AHBSC_RAMB_MEM_RULE_RULE0_MASK) - -#define AHBSC_RAMB_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_RAMB_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMB_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMB_MEM_RULE_RULE1_SHIFT)) & AHBSC_RAMB_MEM_RULE_RULE1_MASK) - -#define AHBSC_RAMB_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_RAMB_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMB_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMB_MEM_RULE_RULE2_SHIFT)) & AHBSC_RAMB_MEM_RULE_RULE2_MASK) - -#define AHBSC_RAMB_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_RAMB_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMB_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMB_MEM_RULE_RULE3_SHIFT)) & AHBSC_RAMB_MEM_RULE_RULE3_MASK) - -#define AHBSC_RAMB_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_RAMB_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMB_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMB_MEM_RULE_RULE4_SHIFT)) & AHBSC_RAMB_MEM_RULE_RULE4_MASK) - -#define AHBSC_RAMB_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_RAMB_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMB_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMB_MEM_RULE_RULE5_SHIFT)) & AHBSC_RAMB_MEM_RULE_RULE5_MASK) - -#define AHBSC_RAMB_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_RAMB_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMB_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMB_MEM_RULE_RULE6_SHIFT)) & AHBSC_RAMB_MEM_RULE_RULE6_MASK) - -#define AHBSC_RAMB_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_RAMB_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMB_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMB_MEM_RULE_RULE7_SHIFT)) & AHBSC_RAMB_MEM_RULE_RULE7_MASK) -/*! @} */ - -/*! @name RAMC_MEM_RULE - RAMC Memory Rule */ -/*! @{ */ - -#define AHBSC_RAMC_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_RAMC_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMC_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMC_MEM_RULE_RULE0_SHIFT)) & AHBSC_RAMC_MEM_RULE_RULE0_MASK) - -#define AHBSC_RAMC_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_RAMC_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMC_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMC_MEM_RULE_RULE1_SHIFT)) & AHBSC_RAMC_MEM_RULE_RULE1_MASK) - -#define AHBSC_RAMC_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_RAMC_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMC_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMC_MEM_RULE_RULE2_SHIFT)) & AHBSC_RAMC_MEM_RULE_RULE2_MASK) - -#define AHBSC_RAMC_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_RAMC_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMC_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMC_MEM_RULE_RULE3_SHIFT)) & AHBSC_RAMC_MEM_RULE_RULE3_MASK) - -#define AHBSC_RAMC_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_RAMC_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMC_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMC_MEM_RULE_RULE4_SHIFT)) & AHBSC_RAMC_MEM_RULE_RULE4_MASK) - -#define AHBSC_RAMC_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_RAMC_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMC_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMC_MEM_RULE_RULE5_SHIFT)) & AHBSC_RAMC_MEM_RULE_RULE5_MASK) - -#define AHBSC_RAMC_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_RAMC_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMC_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMC_MEM_RULE_RULE6_SHIFT)) & AHBSC_RAMC_MEM_RULE_RULE6_MASK) - -#define AHBSC_RAMC_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_RAMC_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMC_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMC_MEM_RULE_RULE7_SHIFT)) & AHBSC_RAMC_MEM_RULE_RULE7_MASK) -/*! @} */ - -/* The count of AHBSC_RAMC_MEM_RULE */ -#define AHBSC_RAMC_MEM_RULE_COUNT (2U) - -/*! @name RAMD_MEM_RULE - RAMD Memory Rule */ -/*! @{ */ - -#define AHBSC_RAMD_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_RAMD_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMD_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMD_MEM_RULE_RULE0_SHIFT)) & AHBSC_RAMD_MEM_RULE_RULE0_MASK) - -#define AHBSC_RAMD_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_RAMD_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMD_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMD_MEM_RULE_RULE1_SHIFT)) & AHBSC_RAMD_MEM_RULE_RULE1_MASK) - -#define AHBSC_RAMD_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_RAMD_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMD_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMD_MEM_RULE_RULE2_SHIFT)) & AHBSC_RAMD_MEM_RULE_RULE2_MASK) - -#define AHBSC_RAMD_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_RAMD_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMD_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMD_MEM_RULE_RULE3_SHIFT)) & AHBSC_RAMD_MEM_RULE_RULE3_MASK) - -#define AHBSC_RAMD_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_RAMD_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMD_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMD_MEM_RULE_RULE4_SHIFT)) & AHBSC_RAMD_MEM_RULE_RULE4_MASK) - -#define AHBSC_RAMD_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_RAMD_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMD_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMD_MEM_RULE_RULE5_SHIFT)) & AHBSC_RAMD_MEM_RULE_RULE5_MASK) - -#define AHBSC_RAMD_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_RAMD_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMD_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMD_MEM_RULE_RULE6_SHIFT)) & AHBSC_RAMD_MEM_RULE_RULE6_MASK) - -#define AHBSC_RAMD_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_RAMD_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMD_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMD_MEM_RULE_RULE7_SHIFT)) & AHBSC_RAMD_MEM_RULE_RULE7_MASK) -/*! @} */ - -/* The count of AHBSC_RAMD_MEM_RULE */ -#define AHBSC_RAMD_MEM_RULE_COUNT (2U) - -/*! @name RAME_MEM_RULE - RAME Memory Rule */ -/*! @{ */ - -#define AHBSC_RAME_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_RAME_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAME_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAME_MEM_RULE_RULE0_SHIFT)) & AHBSC_RAME_MEM_RULE_RULE0_MASK) - -#define AHBSC_RAME_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_RAME_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAME_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAME_MEM_RULE_RULE1_SHIFT)) & AHBSC_RAME_MEM_RULE_RULE1_MASK) - -#define AHBSC_RAME_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_RAME_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAME_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAME_MEM_RULE_RULE2_SHIFT)) & AHBSC_RAME_MEM_RULE_RULE2_MASK) - -#define AHBSC_RAME_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_RAME_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAME_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAME_MEM_RULE_RULE3_SHIFT)) & AHBSC_RAME_MEM_RULE_RULE3_MASK) - -#define AHBSC_RAME_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_RAME_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAME_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAME_MEM_RULE_RULE4_SHIFT)) & AHBSC_RAME_MEM_RULE_RULE4_MASK) - -#define AHBSC_RAME_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_RAME_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAME_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAME_MEM_RULE_RULE5_SHIFT)) & AHBSC_RAME_MEM_RULE_RULE5_MASK) - -#define AHBSC_RAME_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_RAME_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAME_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAME_MEM_RULE_RULE6_SHIFT)) & AHBSC_RAME_MEM_RULE_RULE6_MASK) - -#define AHBSC_RAME_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_RAME_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAME_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAME_MEM_RULE_RULE7_SHIFT)) & AHBSC_RAME_MEM_RULE_RULE7_MASK) -/*! @} */ - -/* The count of AHBSC_RAME_MEM_RULE */ -#define AHBSC_RAME_MEM_RULE_COUNT (2U) - -/*! @name RAMF_MEM_RULE - RAMF Memory Rule */ -/*! @{ */ - -#define AHBSC_RAMF_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_RAMF_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMF_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMF_MEM_RULE_RULE0_SHIFT)) & AHBSC_RAMF_MEM_RULE_RULE0_MASK) - -#define AHBSC_RAMF_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_RAMF_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMF_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMF_MEM_RULE_RULE1_SHIFT)) & AHBSC_RAMF_MEM_RULE_RULE1_MASK) - -#define AHBSC_RAMF_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_RAMF_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMF_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMF_MEM_RULE_RULE2_SHIFT)) & AHBSC_RAMF_MEM_RULE_RULE2_MASK) - -#define AHBSC_RAMF_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_RAMF_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMF_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMF_MEM_RULE_RULE3_SHIFT)) & AHBSC_RAMF_MEM_RULE_RULE3_MASK) - -#define AHBSC_RAMF_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_RAMF_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMF_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMF_MEM_RULE_RULE4_SHIFT)) & AHBSC_RAMF_MEM_RULE_RULE4_MASK) - -#define AHBSC_RAMF_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_RAMF_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMF_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMF_MEM_RULE_RULE5_SHIFT)) & AHBSC_RAMF_MEM_RULE_RULE5_MASK) - -#define AHBSC_RAMF_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_RAMF_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMF_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMF_MEM_RULE_RULE6_SHIFT)) & AHBSC_RAMF_MEM_RULE_RULE6_MASK) - -#define AHBSC_RAMF_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_RAMF_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMF_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMF_MEM_RULE_RULE7_SHIFT)) & AHBSC_RAMF_MEM_RULE_RULE7_MASK) -/*! @} */ - -/* The count of AHBSC_RAMF_MEM_RULE */ -#define AHBSC_RAMF_MEM_RULE_COUNT (2U) - -/*! @name RAMG_MEM_RULE - RAMG Memory Rule */ -/*! @{ */ - -#define AHBSC_RAMG_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_RAMG_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMG_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMG_MEM_RULE_RULE0_SHIFT)) & AHBSC_RAMG_MEM_RULE_RULE0_MASK) - -#define AHBSC_RAMG_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_RAMG_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMG_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMG_MEM_RULE_RULE1_SHIFT)) & AHBSC_RAMG_MEM_RULE_RULE1_MASK) - -#define AHBSC_RAMG_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_RAMG_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMG_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMG_MEM_RULE_RULE2_SHIFT)) & AHBSC_RAMG_MEM_RULE_RULE2_MASK) - -#define AHBSC_RAMG_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_RAMG_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMG_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMG_MEM_RULE_RULE3_SHIFT)) & AHBSC_RAMG_MEM_RULE_RULE3_MASK) - -#define AHBSC_RAMG_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_RAMG_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMG_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMG_MEM_RULE_RULE4_SHIFT)) & AHBSC_RAMG_MEM_RULE_RULE4_MASK) - -#define AHBSC_RAMG_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_RAMG_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMG_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMG_MEM_RULE_RULE5_SHIFT)) & AHBSC_RAMG_MEM_RULE_RULE5_MASK) - -#define AHBSC_RAMG_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_RAMG_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMG_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMG_MEM_RULE_RULE6_SHIFT)) & AHBSC_RAMG_MEM_RULE_RULE6_MASK) - -#define AHBSC_RAMG_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_RAMG_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMG_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMG_MEM_RULE_RULE7_SHIFT)) & AHBSC_RAMG_MEM_RULE_RULE7_MASK) -/*! @} */ - -/* The count of AHBSC_RAMG_MEM_RULE */ -#define AHBSC_RAMG_MEM_RULE_COUNT (2U) - -/*! @name RAMH_MEM_RULE - RAMH Memory Rule */ -/*! @{ */ - -#define AHBSC_RAMH_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_RAMH_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMH_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMH_MEM_RULE_RULE0_SHIFT)) & AHBSC_RAMH_MEM_RULE_RULE0_MASK) - -#define AHBSC_RAMH_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_RAMH_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMH_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMH_MEM_RULE_RULE1_SHIFT)) & AHBSC_RAMH_MEM_RULE_RULE1_MASK) - -#define AHBSC_RAMH_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_RAMH_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMH_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMH_MEM_RULE_RULE2_SHIFT)) & AHBSC_RAMH_MEM_RULE_RULE2_MASK) - -#define AHBSC_RAMH_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_RAMH_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMH_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMH_MEM_RULE_RULE3_SHIFT)) & AHBSC_RAMH_MEM_RULE_RULE3_MASK) - -#define AHBSC_RAMH_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_RAMH_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMH_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMH_MEM_RULE_RULE4_SHIFT)) & AHBSC_RAMH_MEM_RULE_RULE4_MASK) - -#define AHBSC_RAMH_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_RAMH_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMH_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMH_MEM_RULE_RULE5_SHIFT)) & AHBSC_RAMH_MEM_RULE_RULE5_MASK) - -#define AHBSC_RAMH_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_RAMH_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMH_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMH_MEM_RULE_RULE6_SHIFT)) & AHBSC_RAMH_MEM_RULE_RULE6_MASK) - -#define AHBSC_RAMH_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_RAMH_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMH_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMH_MEM_RULE_RULE7_SHIFT)) & AHBSC_RAMH_MEM_RULE_RULE7_MASK) -/*! @} */ - -/*! @name APB_PERIPHERAL_GROUP0_MEM_RULE0 - APB Bridge Group 0 Memory Rule 0 */ -/*! @{ */ - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_SYSCON_MASK (0x3U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_SYSCON_SHIFT (0U) -/*! SYSCON - SYSCON - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_SYSCON(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_SYSCON_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_SYSCON_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_PINT0_MASK (0x30000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_PINT0_SHIFT (16U) -/*! PINT0 - PINT0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_PINT0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_PINT0_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_PINT0_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_INPUTMUX_MASK (0x3000000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_INPUTMUX_SHIFT (24U) -/*! INPUTMUX - INPUTMUX - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_INPUTMUX(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_INPUTMUX_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_INPUTMUX_MASK) -/*! @} */ - -/*! @name APB_PERIPHERAL_GROUP0_MEM_RULE1 - APB Bridge Group 0 Memory Rule 1 */ -/*! @{ */ - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER0_MASK (0x30000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER0_SHIFT (16U) -/*! CTIMER0 - CTIMER0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER0_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER0_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER1_MASK (0x300000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER1_SHIFT (20U) -/*! CTIMER1 - CTIMER1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER1_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER1_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER2_MASK (0x3000000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER2_SHIFT (24U) -/*! CTIMER2 - CTIMER2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER2_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER2_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER3_MASK (0x30000000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER3_SHIFT (28U) -/*! CTIMER3 - CTIMER3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER3_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER3_MASK) -/*! @} */ - -/*! @name APB_PERIPHERAL_GROUP0_MEM_RULE2 - APB Bridge Group 0 Rule 2 */ -/*! @{ */ - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_CTIMER4_MASK (0x3U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_CTIMER4_SHIFT (0U) -/*! CTIMER4 - CTIMER4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_CTIMER4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_CTIMER4_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_CTIMER4_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_FREQME0_MASK (0x30U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_FREQME0_SHIFT (4U) -/*! FREQME0 - FREQME0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_FREQME0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_FREQME0_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_FREQME0_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_UTCIK0_MASK (0x300U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_UTCIK0_SHIFT (8U) -/*! UTCIK0 - UTCIK0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_UTCIK0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_UTCIK0_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_UTCIK0_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_MRT0_MASK (0x3000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_MRT0_SHIFT (12U) -/*! MRT0 - MRT0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_MRT0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_MRT0_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_MRT0_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_OSTIMER0_MASK (0x30000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_OSTIMER0_SHIFT (16U) -/*! OSTIMER0 - OSTIMER0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_OSTIMER0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_OSTIMER0_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_OSTIMER0_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_WWDT0_MASK (0x3000000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_WWDT0_SHIFT (24U) -/*! WWDT0 - WWDT0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_WWDT0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_WWDT0_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_WWDT0_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_WWDT1_MASK (0x30000000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_WWDT1_SHIFT (28U) -/*! WWDT1 - WWDT1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_WWDT1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_WWDT1_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_WWDT1_MASK) -/*! @} */ - -/*! @name APB_PERIPHERAL_GROUP0_MEM_RULE3 - APB Bridge Group 0 Memory Rule 3 */ -/*! @{ */ - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE3_CACHE64_POLSEL0_MASK (0x3000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE3_CACHE64_POLSEL0_SHIFT (12U) -/*! CACHE64_POLSEL0 - CACHE64_POLSEL0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE3_CACHE64_POLSEL0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE3_CACHE64_POLSEL0_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE3_CACHE64_POLSEL0_MASK) -/*! @} */ - -/*! @name APB_PERIPHERAL_GROUP1_MEM_RULE0 - APB Bridge Group 1 Memory Rule 0 */ -/*! @{ */ - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_I3C0_MASK (0x30U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_I3C0_SHIFT (4U) -/*! I3C0 - I3C0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_I3C0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_I3C0_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_I3C0_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_I3C1_MASK (0x300U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_I3C1_SHIFT (8U) -/*! I3C1 - I3C1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_I3C1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_I3C1_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_I3C1_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_GDET_MASK (0x300000U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_GDET_SHIFT (20U) -/*! GDET - GDET - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_GDET(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_GDET_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_GDET_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_ITRC_MASK (0x3000000U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_ITRC_SHIFT (24U) -/*! ITRC - ITRC - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_ITRC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_ITRC_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_ITRC_MASK) -/*! @} */ - -/*! @name APB_PERIPHERAL_GROUP1_MEM_RULE1 - APB Bridge Group 1 Memory Rule 1 */ -/*! @{ */ - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PKC_MASK (0x3000U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PKC_SHIFT (12U) -/*! PKC - PKC - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PKC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PKC_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PKC_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS0_MASK (0x30000U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS0_SHIFT (16U) -/*! PUF_ALIAS0 - PUF_ALIAS0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS0_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS0_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS1_MASK (0x300000U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS1_SHIFT (20U) -/*! PUF_ALIAS1 - PUF_ALIAS1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS1_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS1_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS2_MASK (0x3000000U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS2_SHIFT (24U) -/*! PUF_ALIAS2 - PUF_ALIAS2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS2_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS2_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS3_MASK (0x30000000U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS3_SHIFT (28U) -/*! PUF_ALIAS3 - PUF_ALIAS3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS3_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS3_MASK) -/*! @} */ - -/*! @name APB_PERIPHERAL_GROUP1_MEM_RULE2 - APB Bridge Group 1 Memory Rule 2 */ -/*! @{ */ - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_SM3_MASK (0x30U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_SM3_SHIFT (4U) -/*! SM3 - SM3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_SM3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_SM3_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_SM3_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_COOLFLUX_MASK (0x300U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_COOLFLUX_SHIFT (8U) -/*! COOLFLUX - COOLFLUX - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_COOLFLUX(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_COOLFLUX_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_COOLFLUX_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_SMARTDMA_MASK (0x3000U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_SMARTDMA_SHIFT (12U) -/*! SMARTDMA - SmartDMA - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_SMARTDMA(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_SMARTDMA_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_SMARTDMA_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_PLU_MASK (0x30000U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_PLU_SHIFT (16U) -/*! PLU - PLU - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_PLU(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_PLU_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_PLU_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP0_MEM_RULE0 - AIPS Bridge Group 0 Memory Rule 0 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_GPIO5_ALIAS0_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_GPIO5_ALIAS0_SHIFT (0U) -/*! GPIO5_ALIAS0 - GPIO5_ALIAS0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_GPIO5_ALIAS0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_GPIO5_ALIAS0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_GPIO5_ALIAS0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_GPIO5_ALIAS1_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_GPIO5_ALIAS1_SHIFT (4U) -/*! GPIO5_ALIAS1 - GPIO5_ALIAS2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_GPIO5_ALIAS1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_GPIO5_ALIAS1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_GPIO5_ALIAS1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_PORT5_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_PORT5_SHIFT (8U) -/*! PORT5 - PORT5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_PORT5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_PORT5_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_PORT5_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_FMU0_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_FMU0_SHIFT (12U) -/*! FMU0 - FMU0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_FMU0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_FMU0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_FMU0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_SCG0_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_SCG0_SHIFT (16U) -/*! SCG0 - SCG0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_SCG0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_SCG0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_SCG0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_SPC0_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_SPC0_SHIFT (20U) -/*! SPC0 - SPC0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_SPC0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_SPC0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_SPC0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_WUU0_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_WUU0_SHIFT (24U) -/*! WUU0 - WUU0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_WUU0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_WUU0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_WUU0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_TRO0_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_TRO0_SHIFT (28U) -/*! TRO0 - TRO0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_TRO0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_TRO0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_TRO0_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP0_MEM_RULE1 - AIPS Bridge Group 0 Memory Rule 1 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_LPTMR0_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_LPTMR0_SHIFT (8U) -/*! LPTMR0 - LPTMR0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_LPTMR0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_LPTMR0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_LPTMR0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_LPTMR1_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_LPTMR1_SHIFT (12U) -/*! LPTMR1 - LPTMR1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_LPTMR1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_LPTMR1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_LPTMR1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_RTC_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_RTC_SHIFT (16U) -/*! RTC - RTC - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_RTC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_RTC_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_RTC_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_FMU_TEST_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_FMU_TEST_SHIFT (24U) -/*! FMU_TEST - FMU_TEST - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_FMU_TEST(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_FMU_TEST_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_FMU_TEST_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP0_MEM_RULE2 - AIPS Bridge Group 0 Memory Rule 2 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_TSI_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_TSI_SHIFT (0U) -/*! TSI - TSI - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_TSI(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_TSI_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_TSI_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP0_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP0_SHIFT (4U) -/*! CMP0 - CMP0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP1_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP1_SHIFT (8U) -/*! CMP1 - CMP1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP2_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP2_SHIFT (12U) -/*! CMP2 - CMP2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP2_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP2_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_SHIFT (16U) -/*! ELS - ELS - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS1_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS1_SHIFT (20U) -/*! ELS_ALIAS1 - ELS_ALIAS1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS2_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS2_SHIFT (24U) -/*! ELS_ALIAS2 - ELS_ALIAS2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS2_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS2_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS3_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS3_SHIFT (28U) -/*! ELS_ALIAS3 - ELS_ALIAS3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS3_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS3_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP0_MEM_RULE3 - AIPS Bridge Group 0 Memory Rule 3 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_DIGTMP_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_DIGTMP_SHIFT (0U) -/*! DIGTMP - DIGTMP - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_DIGTMP(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_DIGTMP_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_DIGTMP_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_VBAT_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_VBAT_SHIFT (4U) -/*! VBAT - VBAT - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_VBAT(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_VBAT_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_VBAT_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_TRNG_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_TRNG_SHIFT (8U) -/*! TRNG - TRNG - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_TRNG(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_TRNG_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_TRNG_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_EIM0_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_EIM0_SHIFT (12U) -/*! EIM0 - EIM0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_EIM0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_EIM0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_EIM0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_ERM0_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_ERM0_SHIFT (16U) -/*! ERM0 - ERM0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_ERM0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_ERM0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_ERM0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_INTM0_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_INTM0_SHIFT (20U) -/*! INTM0 - INTM0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_INTM0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_INTM0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_INTM0_MASK) -/*! @} */ - -/*! @name AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0 - AHB Peripheral 0 Slave Port 12 Slave Rule 0 */ -/*! @{ */ - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_EDMA0_CH15_MASK (0x30U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_EDMA0_CH15_SHIFT (4U) -/*! eDMA0_CH15 - eDMA0_CH15 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_EDMA0_CH15(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_EDMA0_CH15_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_EDMA0_CH15_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_SCT0_MASK (0x300U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_SCT0_SHIFT (8U) -/*! SCT0 - SCT0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_SCT0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_SCT0_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_SCT0_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM0_MASK (0x3000U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM0_SHIFT (12U) -/*! LP_FLEXCOMM0 - LP_FLEXCOMM0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM0_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM0_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM1_MASK (0x30000U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM1_SHIFT (16U) -/*! LP_FLEXCOMM1 - LP_FLEXCOMM1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM1_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM1_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM2_MASK (0x300000U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM2_SHIFT (20U) -/*! LP_FLEXCOMM2 - LP_FLEXCOMM2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM2_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM2_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM3_MASK (0x3000000U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM3_SHIFT (24U) -/*! LP_FLEXCOMM3 - LP_FLEXCOMM3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM3_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM3_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_GPIO0_ALIAS0_MASK (0x30000000U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_GPIO0_ALIAS0_SHIFT (28U) -/*! GPIO0_ALIAS0 - GPIO0_ALIAS0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_GPIO0_ALIAS0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_GPIO0_ALIAS0_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_GPIO0_ALIAS0_MASK) -/*! @} */ - -/*! @name AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1 - AHB Peripheral 0 Slave Port 12 Slave Rule 1 */ -/*! @{ */ - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO0_ALIAS1_MASK (0x3U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO0_ALIAS1_SHIFT (0U) -/*! GPIO0_ALIAS1 - GPIO0_ALIAS1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO0_ALIAS1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO0_ALIAS1_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO0_ALIAS1_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO1_ALIAS0_MASK (0x30U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO1_ALIAS0_SHIFT (4U) -/*! GPIO1_ALIAS0 - GPIO1_ALIAS0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO1_ALIAS0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO1_ALIAS0_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO1_ALIAS0_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO1_ALIAS1_MASK (0x300U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO1_ALIAS1_SHIFT (8U) -/*! GPIO1_ALIAS1 - GPIO1_ALIAS1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO1_ALIAS1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO1_ALIAS1_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO1_ALIAS1_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO2_ALIAS0_MASK (0x3000U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO2_ALIAS0_SHIFT (12U) -/*! GPIO2_ALIAS0 - GPIO2_ALIAS0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO2_ALIAS0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO2_ALIAS0_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO2_ALIAS0_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO2_ALIAS1_MASK (0x30000U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO2_ALIAS1_SHIFT (16U) -/*! GPIO2_ALIAS1 - GPIO2_ALIAS1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO2_ALIAS1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO2_ALIAS1_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO2_ALIAS1_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO3_ALIAS0_MASK (0x300000U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO3_ALIAS0_SHIFT (20U) -/*! GPIO3_ALIAS0 - GPIO3_ALIAS0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO3_ALIAS0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO3_ALIAS0_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO3_ALIAS0_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO3_ALIAS1_MASK (0x3000000U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO3_ALIAS1_SHIFT (24U) -/*! GPIO3_ALIAS1 - GPIO3_ALIAS1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO3_ALIAS1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO3_ALIAS1_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO3_ALIAS1_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO4_ALIAS0_MASK (0x30000000U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO4_ALIAS0_SHIFT (28U) -/*! GPIO4_ALIAS0 - GPIO4_ALIAS0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO4_ALIAS0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO4_ALIAS0_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO4_ALIAS0_MASK) -/*! @} */ - -/*! @name AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE2 - AHB Peripheral 0 Slave Port 12 Slave Rule 2 */ -/*! @{ */ - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE2_GPIO4_ALIAS1_MASK (0x3U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE2_GPIO4_ALIAS1_SHIFT (0U) -/*! GPIO4_ALIAS1 - GPIO4_ALIAS1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE2_GPIO4_ALIAS1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE2_GPIO4_ALIAS1_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE2_GPIO4_ALIAS1_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP1_MEM_RULE0 - AIPS Bridge Group 1 Rule 0 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_MP_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_MP_SHIFT (0U) -/*! eDMA0_MP - eDMA0_MP - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_MP(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_MP_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_MP_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH0_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH0_SHIFT (4U) -/*! eDMA0_CH0 - eDMA0_CH0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH1_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH1_SHIFT (8U) -/*! eDMA0_CH1 - eDMA0_CH1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH2_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH2_SHIFT (12U) -/*! eDMA0_CH2 - eDMA0_CH2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH2_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH2_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH3_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH3_SHIFT (16U) -/*! eDMA0_CH3 - FLEXSPI0 Registers - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH3_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH3_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH4_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH4_SHIFT (20U) -/*! eDMA0_CH4 - eDMA0_CH4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH4_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH4_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH5_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH5_SHIFT (24U) -/*! eDMA0_CH5 - eDMA0_CH5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH5_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH5_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH6_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH6_SHIFT (28U) -/*! eDMA0_CH6 - eDMA0_CH6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH6_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH6_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP1_MEM_RULE1 - AIPS Bridge Group 1 Rule 1 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH7_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH7_SHIFT (0U) -/*! eDMA0_CH7 - eDMA0_CH7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH7_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH7_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH8_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH8_SHIFT (4U) -/*! eDMA0_CH8 - eDMA0_CH8 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH8(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH8_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH8_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH9_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH9_SHIFT (8U) -/*! eDMA0_CH9 - eDMA0_CH9 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH9(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH9_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH9_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH10_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH10_SHIFT (12U) -/*! eDMA0_CH10 - eDMA0_CH10 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH10(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH10_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH10_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH11_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH11_SHIFT (16U) -/*! eDMA0_CH11 - FLEXSPI0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH11(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH11_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH11_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH12_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH12_SHIFT (20U) -/*! eDMA0_CH12 - eDMA0_CH12 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH12(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH12_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH12_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH13_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH13_SHIFT (24U) -/*! eDMA0_CH13 - eDMA0_CH13 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH13(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH13_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH13_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH14_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH14_SHIFT (28U) -/*! eDMA0_CH14 - eDMA0_CH14 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH14(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH14_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH14_MASK) -/*! @} */ - -/*! @name AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0 - AHB Peripheral 1 Slave Port 13 Slave Rule 0 */ -/*! @{ */ - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_EDMA1_CH15_MASK (0x30U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_EDMA1_CH15_SHIFT (4U) -/*! eDMA1_CH15 - eDMA1_CH15 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_EDMA1_CH15(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_EDMA1_CH15_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_EDMA1_CH15_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_SEMA42_MASK (0x300U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_SEMA42_SHIFT (8U) -/*! SEMA42 - SEMA42 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_SEMA42(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_SEMA42_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_SEMA42_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_MAILBOX_MASK (0x3000U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_MAILBOX_SHIFT (12U) -/*! MAILBOX - MAILBOX - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_MAILBOX(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_MAILBOX_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_MAILBOX_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_PKC_RAM_MASK (0x30000U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_PKC_RAM_SHIFT (16U) -/*! PKC_RAM - PKC_RAM - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_PKC_RAM(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_PKC_RAM_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_PKC_RAM_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM4_MASK (0x300000U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM4_SHIFT (20U) -/*! FLEXCOMM4 - FLEXCOMM4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM4_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM4_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM5_MASK (0x3000000U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM5_SHIFT (24U) -/*! FLEXCOMM5 - FLEXCOMM5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM5_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM5_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM6_MASK (0x30000000U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM6_SHIFT (28U) -/*! FLEXCOMM6 - FLEXCOMM6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM6_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM6_MASK) -/*! @} */ - -/*! @name AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1 - AHB Peripheral 1 Slave Port 13 Slave Rule 1 */ -/*! @{ */ - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM7_MASK (0x3U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM7_SHIFT (0U) -/*! FLEXCOMM7 - FLEXCOMM7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM7_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM7_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM8_MASK (0x30U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM8_SHIFT (4U) -/*! FLEXCOMM8 - FLEXCOMM8 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM8(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM8_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM8_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM9_MASK (0x300U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM9_SHIFT (8U) -/*! FLEXCOMM9 - FLEXCOMM9 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM9(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM9_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM9_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_USB_FS_OTG_RAM_MASK (0x3000U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_USB_FS_OTG_RAM_SHIFT (12U) -/*! USB_FS_OTG_RAM - USB FS OTG RAM - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_USB_FS_OTG_RAM(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_USB_FS_OTG_RAM_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_USB_FS_OTG_RAM_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_CDOG0_MASK (0x30000U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_CDOG0_SHIFT (16U) -/*! CDOG0 - CDOG0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_CDOG0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_CDOG0_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_CDOG0_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_CDOG1_MASK (0x300000U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_CDOG1_SHIFT (20U) -/*! CDOG1 - CDOG1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_CDOG1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_CDOG1_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_CDOG1_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_DEBUG_MAILBOX_MASK (0x3000000U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_DEBUG_MAILBOX_SHIFT (24U) -/*! DEBUG_MAILBOX - DEBUG_MAILBOX - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_DEBUG_MAILBOX(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_DEBUG_MAILBOX_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_DEBUG_MAILBOX_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_NPU_MASK (0x30000000U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_NPU_SHIFT (28U) -/*! NPU - NPU - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_NPU(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_NPU_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_NPU_MASK) -/*! @} */ - -/*! @name AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE2 - AHB Peripheral 1 Slave Port 13 Slave Rule 2 */ -/*! @{ */ - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE2_POWERQUAD_MASK (0x3U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE2_POWERQUAD_SHIFT (0U) -/*! POWERQUAD - POWERQUAD - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE2_POWERQUAD(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE2_POWERQUAD_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE2_POWERQUAD_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP2_MEM_RULE0 - AIPS Bridge Group 2 Rule 0 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_MP_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_MP_SHIFT (0U) -/*! eDMA1_MP - eDMA1_MP - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_MP(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_MP_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_MP_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH0_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH0_SHIFT (4U) -/*! eDMA1_CH0 - eDMA1_CH0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH1_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH1_SHIFT (8U) -/*! eDMA1_CH1 - eDMA1_CH1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH2_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH2_SHIFT (12U) -/*! eDMA1_CH2 - eDMA1_CH2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH2_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH2_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH3_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH3_SHIFT (16U) -/*! eDMA1_CH3 - eDMA1_CH3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH3_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH3_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH4_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH4_SHIFT (20U) -/*! eDMA1_CH4 - eDMA1_CH4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH4_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH4_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH5_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH5_SHIFT (24U) -/*! eDMA1_CH5 - eDMA1_CH5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH5_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH5_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH6_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH6_SHIFT (28U) -/*! eDMA1_CH6 - eDMA1_CH6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH6_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH6_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP2_MEM_RULE1 - AIPS Bridge Group 2 Memory Rule 1 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH7_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH7_SHIFT (0U) -/*! eDMA1_CH7 - eDMA1_CH7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH7_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH7_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH8_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH8_SHIFT (4U) -/*! eDMA1_CH8 - eDMA1_CH8 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH8(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH8_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH8_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH9_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH9_SHIFT (8U) -/*! eDMA1_CH9 - eDMA1_CH9 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH9(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH9_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH9_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH10_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH10_SHIFT (12U) -/*! eDMA1_CH10 - eDMA1_CH10 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH10(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH10_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH10_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH11_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH11_SHIFT (16U) -/*! eDMA1_CH11 - eDMA1_CH11 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH11(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH11_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH11_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH12_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH12_SHIFT (20U) -/*! eDMA1_CH12 - eDMA1_CH12 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH12(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH12_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH12_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH13_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH13_SHIFT (24U) -/*! eDMA1_CH13 - eDMA1_CH13 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH13(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH13_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH13_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH14_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH14_SHIFT (28U) -/*! eDMA1_CH14 - eDMA1_CH14 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH14(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH14_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH14_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP3_MEM_RULE0 - AIPS Bridge Group 3 Rule 0 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_EWM0_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_EWM0_SHIFT (0U) -/*! EWM0 - EWM0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_EWM0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_EWM0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_EWM0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_LPCAC_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_LPCAC_SHIFT (4U) -/*! LPCAC - LPCAC - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_LPCAC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_LPCAC_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_LPCAC_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_FLEXSPI_CMX_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_FLEXSPI_CMX_SHIFT (8U) -/*! FLEXSPI_CMX - FLEXSPI_CMX - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_FLEXSPI_CMX(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_FLEXSPI_CMX_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_FLEXSPI_CMX_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_SFA_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_SFA_SHIFT (20U) -/*! SFA - SFA - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_SFA(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_SFA_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_SFA_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_MBC_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_MBC_SHIFT (28U) -/*! MBC - MBC - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_MBC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_MBC_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_MBC_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP3_MEM_RULE1 - AIPS Bridge Group 3 Memory Rule 1 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_FLEXSPI_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_FLEXSPI_SHIFT (0U) -/*! FLEXSPI - FLEXSPI - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_FLEXSPI(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_FLEXSPI_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_FLEXSPI_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_OTPC_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_OTPC_SHIFT (4U) -/*! OTPC - OTPC - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_OTPC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_OTPC_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_OTPC_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_CRC_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_CRC_SHIFT (12U) -/*! CRC - CRC - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_CRC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_CRC_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_CRC_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_NPX_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_NPX_SHIFT (16U) -/*! NPX - NPX - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_NPX(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_NPX_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_NPX_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_PWM_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_PWM_SHIFT (24U) -/*! PWM - PWM - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_PWM(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_PWM_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_PWM_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_ENC_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_ENC_SHIFT (28U) -/*! ENC - ENC - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_ENC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_ENC_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_ENC_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP3_MEM_RULE2 - AIPS Bridge Group 3 Rule 2 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_PWM1_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_PWM1_SHIFT (0U) -/*! PWM1 - PWM1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_PWM1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_PWM1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_PWM1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_ENC1_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_ENC1_SHIFT (4U) -/*! ENC1 - ENC1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_ENC1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_ENC1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_ENC1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_EVTG_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_EVTG_SHIFT (8U) -/*! EVTG - EVTG - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_EVTG(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_EVTG_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_EVTG_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE0_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE0_SHIFT (16U) -/*! CAN0_RULE0 - CAN0 RULE0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE1_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE1_SHIFT (20U) -/*! CAN0_RULE1 - CAN0 RULE1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE2_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE2_SHIFT (24U) -/*! CAN0_RULE2 - CAN0 RULE2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE2_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE2_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE3_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE3_SHIFT (28U) -/*! CAN0_RULE3 - CAN0 RULE3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE3_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE3_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP3_MEM_RULE3 - AIPS Bridge Group 3 Rule 3 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE0_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE0_SHIFT (0U) -/*! CAN1_RULE0 - CAN1 RULE0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE1_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE1_SHIFT (4U) -/*! CAN1_RULE1 - CAN1 RULE1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE2_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE2_SHIFT (8U) -/*! CAN1_RULE2 - CAN1 RULE2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE2_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE2_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE3_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE3_SHIFT (12U) -/*! CAN1_RULE3 - CAN1 RULE3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE3_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE3_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_USBDCD_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_USBDCD_SHIFT (16U) -/*! USBDCD - USBDCD - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_USBDCD(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_USBDCD_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_USBDCD_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_USBFS_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_USBFS_SHIFT (20U) -/*! USBFS - USBFS - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_USBFS(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_USBFS_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_USBFS_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP4_MEM_RULE0 - AIPS Bridge Group 4 Rule 0 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_ENET_MASK (0xFU) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_ENET_SHIFT (0U) -/*! ENET - ENET - * 0b0000..Non-secure and non-privilege user access allowed - * 0b0001..Non-secure and privilege access allowed - * 0b0010..Secure and non-privilege user access allowed - * 0b0011..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_ENET(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_ENET_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_ENET_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_EMVSIM0_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_EMVSIM0_SHIFT (12U) -/*! EMVSIM0 - EMVSIM0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_EMVSIM0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_EMVSIM0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_EMVSIM0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_EMVSIM1_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_EMVSIM1_SHIFT (16U) -/*! EMVSIM1 - EMVSIM1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_EMVSIM1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_EMVSIM1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_EMVSIM1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_FLEXIO_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_FLEXIO_SHIFT (20U) -/*! FLEXIO - FLEXIO - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_FLEXIO(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_FLEXIO_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_FLEXIO_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_SAI0_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_SAI0_SHIFT (24U) -/*! SAI0 - SAI0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_SAI0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_SAI0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_SAI0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_SAI1_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_SAI1_SHIFT (28U) -/*! SAI1 - SAI1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_SAI1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_SAI1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_SAI1_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP4_MEM_RULE1 - AIPS Bridge Group 4 Rule 1 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_SINC0_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_SINC0_SHIFT (0U) -/*! SINC0 - SINC0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_SINC0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_SINC0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_SINC0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USDHC0_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USDHC0_SHIFT (4U) -/*! uSDHC0 - uSDHC0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USDHC0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USDHC0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USDHC0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USBHSPHY_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USBHSPHY_SHIFT (8U) -/*! USBHSPHY - USBHSPHY - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USBHSPHY(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USBHSPHY_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USBHSPHY_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USBHS_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USBHS_SHIFT (12U) -/*! USBHS - USBHS - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USBHS(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USBHS_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USBHS_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_MICD_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_MICD_SHIFT (16U) -/*! MICD - MICD - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_MICD(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_MICD_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_MICD_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_ADC0_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_ADC0_SHIFT (20U) -/*! ADC0 - ADC0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_ADC0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_ADC0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_ADC0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_ADC1_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_ADC1_SHIFT (24U) -/*! ADC1 - ADC1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_ADC1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_ADC1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_ADC1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_DAC0_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_DAC0_SHIFT (28U) -/*! DAC0 - DAC0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_DAC0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_DAC0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_DAC0_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP4_MEM_RULE2 - AIPS Bridge Group 4 Rule 2 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP0_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP0_SHIFT (0U) -/*! OPAMP0 - OPAMP0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_VREF_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_VREF_SHIFT (4U) -/*! VREF - VREF - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_VREF(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_VREF_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_VREF_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_DAC_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_DAC_SHIFT (8U) -/*! DAC - DAC - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_DAC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_DAC_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_DAC_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP1_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP1_SHIFT (12U) -/*! OPAMP1 - OPAMP1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_HPDAC0_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_HPDAC0_SHIFT (16U) -/*! HPDAC0 - HPDAC0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_HPDAC0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_HPDAC0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_HPDAC0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP2_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP2_SHIFT (20U) -/*! OPAMP2 - OPAMP2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP2_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP2_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_PORT0_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_PORT0_SHIFT (24U) -/*! PORT0 - PORT0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_PORT0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_PORT0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_PORT0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_PORT1_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_PORT1_SHIFT (28U) -/*! PORT1 - PORT1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_PORT1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_PORT1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_PORT1_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP4_MEM_RULE3 - AIPS Bridge Group 4 Rule 3 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT2_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT2_SHIFT (0U) -/*! PORT2 - PORT2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT2_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT2_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT3_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT3_SHIFT (4U) -/*! PORT3 - PORT3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT3_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT3_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT4_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT4_SHIFT (8U) -/*! PORT4 - PORT4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT4_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT4_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_MTR0_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_MTR0_SHIFT (24U) -/*! MTR0 - MTR0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_MTR0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_MTR0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_MTR0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_ATX0_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_ATX0_SHIFT (28U) -/*! ATX0 - ATX0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_ATX0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_ATX0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_ATX0_MASK) -/*! @} */ - -/*! @name AHB_SECURE_CTRL_PERIPHERAL_RULE0 - AHB Secure Control Peripheral Rule 0 */ -/*! @{ */ - -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE0_MASK (0x3U) -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE0_SHIFT)) & AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE0_MASK) - -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE1_MASK (0x30U) -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE1_SHIFT)) & AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE1_MASK) - -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE2_MASK (0x300U) -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE2_SHIFT)) & AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE2_MASK) - -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE3_MASK (0x3000U) -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE3_SHIFT)) & AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE3_MASK) -/*! @} */ - -/*! @name FLEXSPI0_REGION0_MEM_RULE - FLEXSPI0 Region 0 Memory Rule */ -/*! @{ */ - -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE0_SHIFT)) & AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE0_MASK) - -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE1_SHIFT)) & AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE1_MASK) - -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE2_SHIFT)) & AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE2_MASK) - -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE3_SHIFT)) & AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE3_MASK) - -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE4_SHIFT)) & AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE4_MASK) - -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE5_SHIFT)) & AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE5_MASK) - -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE6_SHIFT)) & AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE6_MASK) - -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE7_SHIFT)) & AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE7_MASK) -/*! @} */ - -/* The count of AHBSC_FLEXSPI0_REGION0_MEM_RULE */ -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_COUNT (4U) - -/*! @name FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0 - FLEXSPI0 Region 1 Memory Rule 0..FLEXSPI0 Region 6 Memory Rule 0 */ -/*! @{ */ - -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE0_MASK (0x3U) -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE0_SHIFT)) & AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE0_MASK) - -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE1_MASK (0x30U) -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE1_SHIFT)) & AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE1_MASK) - -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE2_MASK (0x300U) -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE2_SHIFT)) & AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE2_MASK) - -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE3_MASK (0x3000U) -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE3_SHIFT)) & AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE3_MASK) - -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE4_MASK (0x30000U) -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE4_SHIFT)) & AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE4_MASK) - -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE5_MASK (0x300000U) -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE5_SHIFT)) & AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE5_MASK) -/*! @} */ - -/* The count of AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0 */ -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_COUNT (6U) - -/*! @name FLEXSPI0_REGION7_MEM_RULE - FLEXSPI0 Region 7 Memory Rule */ -/*! @{ */ - -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE0_SHIFT)) & AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE0_MASK) - -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE1_SHIFT)) & AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE1_MASK) - -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE2_SHIFT)) & AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE2_MASK) - -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE3_SHIFT)) & AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE3_MASK) - -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE4_SHIFT)) & AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE4_MASK) - -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE5_SHIFT)) & AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE5_MASK) - -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE6_SHIFT)) & AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE6_MASK) - -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE7_SHIFT)) & AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE7_MASK) -/*! @} */ - -/* The count of AHBSC_FLEXSPI0_REGION7_MEM_RULE */ -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_COUNT (4U) - -/*! @name FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0 - FLEXSPI0 Region 8 Memory Rule 0..FLEXSPI0 Region 13 Memory Rule 0 */ -/*! @{ */ - -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE0_MASK (0x3U) -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE0_SHIFT)) & AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE0_MASK) - -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE1_MASK (0x30U) -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE1_SHIFT)) & AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE1_MASK) - -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE2_MASK (0x300U) -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE2_SHIFT)) & AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE2_MASK) - -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE3_MASK (0x3000U) -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE3_SHIFT)) & AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE3_MASK) - -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE4_MASK (0x30000U) -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE4_SHIFT)) & AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE4_MASK) - -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE5_MASK (0x300000U) -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE5_SHIFT)) & AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE5_MASK) -/*! @} */ - -/* The count of AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0 */ -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_COUNT (6U) - -/*! @name SEC_VIO_ADDRN_SEC_VIO_ADDR - Security Violation Address */ -/*! @{ */ - -#define AHBSC_SEC_VIO_ADDRN_SEC_VIO_ADDR_SEC_VIO_ADDR_MASK (0xFFFFFFFFU) -#define AHBSC_SEC_VIO_ADDRN_SEC_VIO_ADDR_SEC_VIO_ADDR_SHIFT (0U) -/*! SEC_VIO_ADDR - Security violation address for AHB layer a reset value 0 */ -#define AHBSC_SEC_VIO_ADDRN_SEC_VIO_ADDR_SEC_VIO_ADDR(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_ADDRN_SEC_VIO_ADDR_SEC_VIO_ADDR_SHIFT)) & AHBSC_SEC_VIO_ADDRN_SEC_VIO_ADDR_SEC_VIO_ADDR_MASK) -/*! @} */ - -/* The count of AHBSC_SEC_VIO_ADDRN_SEC_VIO_ADDR */ -#define AHBSC_SEC_VIO_ADDRN_SEC_VIO_ADDR_COUNT (32U) - -/*! @name SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO - Security Violation Miscellaneous Information at Address */ -/*! @{ */ - -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_WRITE_MASK (0x1U) -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_WRITE_SHIFT (0U) -/*! SEC_VIO_INFO_WRITE - Security violation access read/write indicator - * 0b0..Read access - * 0b1..Write access - */ -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_WRITE(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_WRITE_SHIFT)) & AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_WRITE_MASK) - -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_DATA_ACCESS_MASK (0x2U) -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_DATA_ACCESS_SHIFT (1U) -/*! SEC_VIO_INFO_DATA_ACCESS - Security Violation Info Data Access - * 0b0..Code - * 0b1..Data - */ -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_DATA_ACCESS(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_DATA_ACCESS_SHIFT)) & AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_DATA_ACCESS_MASK) - -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_MASTER_SEC_LEVEL_MASK (0xF0U) -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_MASTER_SEC_LEVEL_SHIFT (4U) -/*! SEC_VIO_INFO_MASTER_SEC_LEVEL - Security Violation Info Master Security Level */ -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_MASTER_SEC_LEVEL(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_MASTER_SEC_LEVEL_SHIFT)) & AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_MASTER_SEC_LEVEL_MASK) - -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_MASTER_MASK (0x1F00U) -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_MASTER_SHIFT (8U) -/*! SEC_VIO_INFO_MASTER - Security violation master number - * 0b00000..M33 Code - * 0b00001..M33 System - * 0b00010..CPU1 (Mirco-CM33) Code - * 0b00011..SMARTDMA Instruction - * 0b00100..CPU1 (Mirco-CM33) system - * 0b00101..SMARTDMA Data - * 0b00110..eDMA0 - * 0b00111..eDMA1 - * 0b01000..PKC - * 0b01001..ELS S50 - * 0b01010..PKC M0 - * 0b01011..NPU Operands - * 0b01100..DSP Instruction - * 0b01101..DSPX - * 0b01110..DSPY - * 0b10000..NPU Data - * 0b10001..USB FS - * 0b10010..Ethernet - * 0b10011..USB HS - * 0b10100..uSDHC - */ -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_MASTER(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_MASTER_SHIFT)) & AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_MASTER_MASK) -/*! @} */ - -/* The count of AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO */ -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_COUNT (32U) - -/*! @name SEC_VIO_INFO_VALID - Security Violation Info Validity for Address */ -/*! @{ */ - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID0_MASK (0x1U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID0_SHIFT (0U) -/*! VIO_INFO_VALID0 - Violation information valid flag for AHB port 0 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID0_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID0_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID1_MASK (0x2U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID1_SHIFT (1U) -/*! VIO_INFO_VALID1 - Violation information valid flag for AHB port 1 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID1_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID1_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID2_MASK (0x4U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID2_SHIFT (2U) -/*! VIO_INFO_VALID2 - Violation information valid flag for AHB port 2 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID2_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID2_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID3_MASK (0x8U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID3_SHIFT (3U) -/*! VIO_INFO_VALID3 - Violation information valid flag for AHB port 3 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID3_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID3_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID4_MASK (0x10U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID4_SHIFT (4U) -/*! VIO_INFO_VALID4 - Violation information valid flag for AHB port 4 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID4_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID4_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID5_MASK (0x20U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID5_SHIFT (5U) -/*! VIO_INFO_VALID5 - Violation information valid flag for AHB port 5 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID5_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID5_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID6_MASK (0x40U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID6_SHIFT (6U) -/*! VIO_INFO_VALID6 - Violation information valid flag for AHB port 6 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID6_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID6_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID7_MASK (0x80U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID7_SHIFT (7U) -/*! VIO_INFO_VALID7 - Violation information valid flag for AHB port 7 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID7_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID7_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID8_MASK (0x100U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID8_SHIFT (8U) -/*! VIO_INFO_VALID8 - Violation information valid flag for AHB port 8 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID8(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID8_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID8_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID9_MASK (0x200U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID9_SHIFT (9U) -/*! VIO_INFO_VALID9 - Violation information valid flag for AHB port 9 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID9(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID9_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID9_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID10_MASK (0x400U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID10_SHIFT (10U) -/*! VIO_INFO_VALID10 - Violation information valid flag for AHB port 10 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID10(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID10_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID10_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID11_MASK (0x800U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID11_SHIFT (11U) -/*! VIO_INFO_VALID11 - Violation information valid flag for AHB port 11 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID11(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID11_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID11_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID12_MASK (0x1000U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID12_SHIFT (12U) -/*! VIO_INFO_VALID12 - Violation information valid flag for AHB port 12 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID12(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID12_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID12_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID13_MASK (0x2000U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID13_SHIFT (13U) -/*! VIO_INFO_VALID13 - Violation information valid flag for AHB port 13 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID13(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID13_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID13_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID14_MASK (0x4000U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID14_SHIFT (14U) -/*! VIO_INFO_VALID14 - Violation information valid flag for AHB port 14 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID14(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID14_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID14_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID15_MASK (0x8000U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID15_SHIFT (15U) -/*! VIO_INFO_VALID15 - Violation information valid flag for AHB port 15 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID15(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID15_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID15_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID16_MASK (0x10000U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID16_SHIFT (16U) -/*! VIO_INFO_VALID16 - Violation information valid flag for AHB port 16 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID16(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID16_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID16_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID17_MASK (0x20000U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID17_SHIFT (17U) -/*! VIO_INFO_VALID17 - Violation information valid flag for AHB port 17 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID17(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID17_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID17_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID18_MASK (0x40000U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID18_SHIFT (18U) -/*! VIO_INFO_VALID18 - Violation information valid flag for AHB port 18 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID18(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID18_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID18_MASK) -/*! @} */ - -/*! @name SEC_GPIO_MASKN_SEC_GPIO_MASK - GPIO Mask for Port 0..GPIO Mask for Port 1 */ -/*! @{ */ - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN0_SEC_MASK_MASK (0x1U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN0_SEC_MASK_SHIFT (0U) -/*! PIO0_PIN0_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN0_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN0_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN0_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN0_SEC_MASK_MASK (0x1U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN0_SEC_MASK_SHIFT (0U) -/*! PIO1_PIN0_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN0_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN0_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN0_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN1_SEC_MASK_MASK (0x2U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN1_SEC_MASK_SHIFT (1U) -/*! PIO0_PIN1_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN1_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN1_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN1_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN1_SEC_MASK_MASK (0x2U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN1_SEC_MASK_SHIFT (1U) -/*! PIO1_PIN1_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN1_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN1_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN1_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN2_SEC_MASK_MASK (0x4U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN2_SEC_MASK_SHIFT (2U) -/*! PIO0_PIN2_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN2_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN2_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN2_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN2_SEC_MASK_MASK (0x4U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN2_SEC_MASK_SHIFT (2U) -/*! PIO1_PIN2_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN2_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN2_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN2_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN3_SEC_MASK_MASK (0x8U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN3_SEC_MASK_SHIFT (3U) -/*! PIO0_PIN3_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN3_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN3_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN3_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN3_SEC_MASK_MASK (0x8U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN3_SEC_MASK_SHIFT (3U) -/*! PIO1_PIN3_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN3_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN3_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN3_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN4_SEC_MASK_MASK (0x10U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN4_SEC_MASK_SHIFT (4U) -/*! PIO0_PIN4_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN4_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN4_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN4_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN4_SEC_MASK_MASK (0x10U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN4_SEC_MASK_SHIFT (4U) -/*! PIO1_PIN4_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN4_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN4_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN4_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN5_SEC_MASK_MASK (0x20U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN5_SEC_MASK_SHIFT (5U) -/*! PIO0_PIN5_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN5_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN5_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN5_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN5_SEC_MASK_MASK (0x20U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN5_SEC_MASK_SHIFT (5U) -/*! PIO1_PIN5_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN5_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN5_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN5_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN6_SEC_MASK_MASK (0x40U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN6_SEC_MASK_SHIFT (6U) -/*! PIO0_PIN6_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN6_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN6_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN6_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN6_SEC_MASK_MASK (0x40U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN6_SEC_MASK_SHIFT (6U) -/*! PIO1_PIN6_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN6_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN6_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN6_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN7_SEC_MASK_MASK (0x80U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN7_SEC_MASK_SHIFT (7U) -/*! PIO0_PIN7_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN7_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN7_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN7_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN7_SEC_MASK_MASK (0x80U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN7_SEC_MASK_SHIFT (7U) -/*! PIO1_PIN7_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN7_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN7_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN7_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN8_SEC_MASK_MASK (0x100U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN8_SEC_MASK_SHIFT (8U) -/*! PIO0_PIN8_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN8_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN8_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN8_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN8_SEC_MASK_MASK (0x100U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN8_SEC_MASK_SHIFT (8U) -/*! PIO1_PIN8_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN8_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN8_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN8_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN9_SEC_MASK_MASK (0x200U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN9_SEC_MASK_SHIFT (9U) -/*! PIO0_PIN9_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN9_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN9_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN9_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN9_SEC_MASK_MASK (0x200U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN9_SEC_MASK_SHIFT (9U) -/*! PIO1_PIN9_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN9_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN9_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN9_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN10_SEC_MASK_MASK (0x400U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN10_SEC_MASK_SHIFT (10U) -/*! PIO0_PIN10_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN10_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN10_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN10_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN10_SEC_MASK_MASK (0x400U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN10_SEC_MASK_SHIFT (10U) -/*! PIO1_PIN10_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN10_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN10_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN10_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN11_SEC_MASK_MASK (0x800U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN11_SEC_MASK_SHIFT (11U) -/*! PIO0_PIN11_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN11_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN11_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN11_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN11_SEC_MASK_MASK (0x800U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN11_SEC_MASK_SHIFT (11U) -/*! PIO1_PIN11_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN11_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN11_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN11_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN12_SEC_MASK_MASK (0x1000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN12_SEC_MASK_SHIFT (12U) -/*! PIO0_PIN12_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN12_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN12_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN12_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN12_SEC_MASK_MASK (0x1000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN12_SEC_MASK_SHIFT (12U) -/*! PIO1_PIN12_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN12_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN12_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN12_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN13_SEC_MASK_MASK (0x2000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN13_SEC_MASK_SHIFT (13U) -/*! PIO0_PIN13_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN13_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN13_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN13_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN13_SEC_MASK_MASK (0x2000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN13_SEC_MASK_SHIFT (13U) -/*! PIO1_PIN13_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN13_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN13_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN13_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN14_SEC_MASK_MASK (0x4000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN14_SEC_MASK_SHIFT (14U) -/*! PIO0_PIN14_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN14_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN14_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN14_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN14_SEC_MASK_MASK (0x4000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN14_SEC_MASK_SHIFT (14U) -/*! PIO1_PIN14_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN14_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN14_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN14_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN15_SEC_MASK_MASK (0x8000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN15_SEC_MASK_SHIFT (15U) -/*! PIO0_PIN15_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN15_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN15_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN15_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN15_SEC_MASK_MASK (0x8000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN15_SEC_MASK_SHIFT (15U) -/*! PIO1_PIN15_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN15_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN15_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN15_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN16_SEC_MASK_MASK (0x10000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN16_SEC_MASK_SHIFT (16U) -/*! PIO0_PIN16_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN16_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN16_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN16_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN16_SEC_MASK_MASK (0x10000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN16_SEC_MASK_SHIFT (16U) -/*! PIO1_PIN16_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN16_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN16_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN16_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN17_SEC_MASK_MASK (0x20000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN17_SEC_MASK_SHIFT (17U) -/*! PIO0_PIN17_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN17_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN17_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN17_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN17_SEC_MASK_MASK (0x20000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN17_SEC_MASK_SHIFT (17U) -/*! PIO1_PIN17_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN17_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN17_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN17_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN18_SEC_MASK_MASK (0x40000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN18_SEC_MASK_SHIFT (18U) -/*! PIO0_PIN18_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN18_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN18_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN18_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN18_SEC_MASK_MASK (0x40000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN18_SEC_MASK_SHIFT (18U) -/*! PIO1_PIN18_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN18_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN18_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN18_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN19_SEC_MASK_MASK (0x80000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN19_SEC_MASK_SHIFT (19U) -/*! PIO0_PIN19_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN19_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN19_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN19_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN19_SEC_MASK_MASK (0x80000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN19_SEC_MASK_SHIFT (19U) -/*! PIO1_PIN19_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN19_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN19_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN19_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN20_SEC_MASK_MASK (0x100000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN20_SEC_MASK_SHIFT (20U) -/*! PIO0_PIN20_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN20_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN20_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN20_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN20_SEC_MASK_MASK (0x100000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN20_SEC_MASK_SHIFT (20U) -/*! PIO1_PIN20_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN20_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN20_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN20_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN21_SEC_MASK_MASK (0x200000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN21_SEC_MASK_SHIFT (21U) -/*! PIO0_PIN21_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN21_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN21_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN21_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN21_SEC_MASK_MASK (0x200000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN21_SEC_MASK_SHIFT (21U) -/*! PIO1_PIN21_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN21_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN21_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN21_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN22_SEC_MASK_MASK (0x400000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN22_SEC_MASK_SHIFT (22U) -/*! PIO0_PIN22_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN22_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN22_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN22_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN22_SEC_MASK_MASK (0x400000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN22_SEC_MASK_SHIFT (22U) -/*! PIO1_PIN22_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN22_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN22_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN22_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN23_SEC_MASK_MASK (0x800000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN23_SEC_MASK_SHIFT (23U) -/*! PIO0_PIN23_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN23_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN23_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN23_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN23_SEC_MASK_MASK (0x800000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN23_SEC_MASK_SHIFT (23U) -/*! PIO1_PIN23_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN23_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN23_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN23_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN24_SEC_MASK_MASK (0x1000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN24_SEC_MASK_SHIFT (24U) -/*! PIO0_PIN24_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN24_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN24_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN24_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN24_SEC_MASK_MASK (0x1000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN24_SEC_MASK_SHIFT (24U) -/*! PIO1_PIN24_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN24_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN24_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN24_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN25_SEC_MASK_MASK (0x2000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN25_SEC_MASK_SHIFT (25U) -/*! PIO0_PIN25_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN25_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN25_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN25_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN25_SEC_MASK_MASK (0x2000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN25_SEC_MASK_SHIFT (25U) -/*! PIO1_PIN25_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN25_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN25_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN25_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN26_SEC_MASK_MASK (0x4000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN26_SEC_MASK_SHIFT (26U) -/*! PIO0_PIN26_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN26_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN26_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN26_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN26_SEC_MASK_MASK (0x4000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN26_SEC_MASK_SHIFT (26U) -/*! PIO1_PIN26_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN26_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN26_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN26_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN27_SEC_MASK_MASK (0x8000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN27_SEC_MASK_SHIFT (27U) -/*! PIO0_PIN27_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN27_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN27_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN27_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN27_SEC_MASK_MASK (0x8000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN27_SEC_MASK_SHIFT (27U) -/*! PIO1_PIN27_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN27_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN27_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN27_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN28_SEC_MASK_MASK (0x10000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN28_SEC_MASK_SHIFT (28U) -/*! PIO0_PIN28_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN28_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN28_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN28_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN28_SEC_MASK_MASK (0x10000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN28_SEC_MASK_SHIFT (28U) -/*! PIO1_PIN28_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN28_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN28_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN28_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN29_SEC_MASK_MASK (0x20000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN29_SEC_MASK_SHIFT (29U) -/*! PIO0_PIN29_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN29_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN29_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN29_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN29_SEC_MASK_MASK (0x20000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN29_SEC_MASK_SHIFT (29U) -/*! PIO1_PIN29_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN29_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN29_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN29_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN30_SEC_MASK_MASK (0x40000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN30_SEC_MASK_SHIFT (30U) -/*! PIO0_PIN30_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN30_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN30_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN30_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN30_SEC_MASK_MASK (0x40000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN30_SEC_MASK_SHIFT (30U) -/*! PIO1_PIN30_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN30_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN30_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN30_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN31_SEC_MASK_MASK (0x80000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN31_SEC_MASK_SHIFT (31U) -/*! PIO0_PIN31_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN31_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN31_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN31_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN31_SEC_MASK_MASK (0x80000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN31_SEC_MASK_SHIFT (31U) -/*! PIO1_PIN31_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN31_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN31_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN31_SEC_MASK_MASK) -/*! @} */ - -/* The count of AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_COUNT (2U) - -/*! @name SEC_CPU1_INT_MASK0 - Secure Interrupt Mask 0 for CPU1 */ -/*! @{ */ - -#define AHBSC_SEC_CPU1_INT_MASK0_INT0_MASK_MASK (0x1U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT0_MASK_SHIFT (0U) -/*! INT0_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT0_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT0_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT0_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT1_MASK_MASK (0x2U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT1_MASK_SHIFT (1U) -/*! INT1_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT1_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT1_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT1_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT2_MASK_MASK (0x4U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT2_MASK_SHIFT (2U) -/*! INT2_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT2_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT2_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT2_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT3_MASK_MASK (0x8U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT3_MASK_SHIFT (3U) -/*! INT3_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT3_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT3_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT3_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT4_MASK_MASK (0x10U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT4_MASK_SHIFT (4U) -/*! INT4_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT4_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT4_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT4_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT5_MASK_MASK (0x20U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT5_MASK_SHIFT (5U) -/*! INT5_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT5_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT5_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT5_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT6_MASK_MASK (0x40U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT6_MASK_SHIFT (6U) -/*! INT6_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT6_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT6_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT6_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT7_MASK_MASK (0x80U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT7_MASK_SHIFT (7U) -/*! INT7_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT7_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT7_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT7_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT8_MASK_MASK (0x100U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT8_MASK_SHIFT (8U) -/*! INT8_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT8_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT8_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT8_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT9_MASK_MASK (0x200U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT9_MASK_SHIFT (9U) -/*! INT9_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT9_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT9_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT9_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT10_MASK_MASK (0x400U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT10_MASK_SHIFT (10U) -/*! INT10_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT10_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT10_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT10_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT11_MASK_MASK (0x800U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT11_MASK_SHIFT (11U) -/*! INT11_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT11_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT11_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT11_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT12_MASK_MASK (0x1000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT12_MASK_SHIFT (12U) -/*! INT12_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT12_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT12_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT12_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT13_MASK_MASK (0x2000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT13_MASK_SHIFT (13U) -/*! INT13_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT13_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT13_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT13_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT14_MASK_MASK (0x4000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT14_MASK_SHIFT (14U) -/*! INT14_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT14_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT14_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT14_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT15_MASK_MASK (0x8000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT15_MASK_SHIFT (15U) -/*! INT15_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT15_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT15_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT15_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT16_MASK_MASK (0x10000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT16_MASK_SHIFT (16U) -/*! INT16_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT16_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT16_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT16_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT17_MASK_MASK (0x20000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT17_MASK_SHIFT (17U) -/*! INT17_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT17_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT17_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT17_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT18_MASK_MASK (0x40000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT18_MASK_SHIFT (18U) -/*! INT18_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT18_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT18_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT18_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT19_MASK_MASK (0x80000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT19_MASK_SHIFT (19U) -/*! INT19_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT19_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT19_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT19_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT20_MASK_MASK (0x100000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT20_MASK_SHIFT (20U) -/*! INT20_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT20_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT20_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT20_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT21_MASK_MASK (0x200000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT21_MASK_SHIFT (21U) -/*! INT21_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT21_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT21_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT21_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT22_MASK_MASK (0x400000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT22_MASK_SHIFT (22U) -/*! INT22_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT22_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT22_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT22_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT23_MASK_MASK (0x800000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT23_MASK_SHIFT (23U) -/*! INT23_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT23_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT23_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT23_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT24_MASK_MASK (0x1000000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT24_MASK_SHIFT (24U) -/*! INT24_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT24_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT24_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT24_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT25_MASK_MASK (0x2000000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT25_MASK_SHIFT (25U) -/*! INT25_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT25_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT25_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT25_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT26_MASK_MASK (0x4000000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT26_MASK_SHIFT (26U) -/*! INT26_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT26_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT26_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT26_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT27_MASK_MASK (0x8000000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT27_MASK_SHIFT (27U) -/*! INT27_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT27_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT27_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT27_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT28_MASK_MASK (0x10000000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT28_MASK_SHIFT (28U) -/*! INT28_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT28_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT28_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT28_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT29_MASK_MASK (0x20000000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT29_MASK_SHIFT (29U) -/*! INT29_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT29_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT29_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT29_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT30_MASK_MASK (0x40000000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT30_MASK_SHIFT (30U) -/*! INT30_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT30_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT30_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT30_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT31_MASK_MASK (0x80000000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT31_MASK_SHIFT (31U) -/*! INT31_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT31_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT31_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT31_MASK_MASK) -/*! @} */ - -/*! @name SEC_CPU1_INT_MASK1 - Secure Interrupt Mask 1 for CPU1 */ -/*! @{ */ - -#define AHBSC_SEC_CPU1_INT_MASK1_INT32_MASK_MASK (0x1U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT32_MASK_SHIFT (0U) -/*! INT32_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT32_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT32_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT32_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT33_MASK_MASK (0x2U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT33_MASK_SHIFT (1U) -/*! INT33_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT33_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT33_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT33_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT34_MASK_MASK (0x4U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT34_MASK_SHIFT (2U) -/*! INT34_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT34_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT34_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT34_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT35_MASK_MASK (0x8U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT35_MASK_SHIFT (3U) -/*! INT35_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT35_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT35_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT35_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT36_MASK_MASK (0x10U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT36_MASK_SHIFT (4U) -/*! INT36_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT36_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT36_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT36_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT37_MASK_MASK (0x20U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT37_MASK_SHIFT (5U) -/*! INT37_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT37_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT37_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT37_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT38_MASK_MASK (0x40U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT38_MASK_SHIFT (6U) -/*! INT38_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT38_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT38_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT38_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT39_MASK_MASK (0x80U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT39_MASK_SHIFT (7U) -/*! INT39_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT39_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT39_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT39_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT40_MASK_MASK (0x100U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT40_MASK_SHIFT (8U) -/*! INT40_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT40_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT40_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT40_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT41_MASK_MASK (0x200U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT41_MASK_SHIFT (9U) -/*! INT41_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT41_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT41_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT41_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT42_MASK_MASK (0x400U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT42_MASK_SHIFT (10U) -/*! INT42_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT42_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT42_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT42_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT43_MASK_MASK (0x800U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT43_MASK_SHIFT (11U) -/*! INT43_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT43_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT43_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT43_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT44_MASK_MASK (0x1000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT44_MASK_SHIFT (12U) -/*! INT44_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT44_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT44_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT44_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT45_MASK_MASK (0x2000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT45_MASK_SHIFT (13U) -/*! INT45_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT45_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT45_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT45_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT46_MASK_MASK (0x4000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT46_MASK_SHIFT (14U) -/*! INT46_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT46_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT46_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT46_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT47_MASK_MASK (0x8000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT47_MASK_SHIFT (15U) -/*! INT47_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT47_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT47_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT47_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT48_MASK_MASK (0x10000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT48_MASK_SHIFT (16U) -/*! INT48_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT48_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT48_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT48_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT49_MASK_MASK (0x20000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT49_MASK_SHIFT (17U) -/*! INT49_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT49_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT49_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT49_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT50_MASK_MASK (0x40000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT50_MASK_SHIFT (18U) -/*! INT50_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT50_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT50_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT50_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT51_MASK_MASK (0x80000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT51_MASK_SHIFT (19U) -/*! INT51_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT51_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT51_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT51_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT52_MASK_MASK (0x100000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT52_MASK_SHIFT (20U) -/*! INT52_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT52_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT52_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT52_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT53_MASK_MASK (0x200000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT53_MASK_SHIFT (21U) -/*! INT53_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT53_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT53_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT53_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT54_MASK_MASK (0x400000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT54_MASK_SHIFT (22U) -/*! INT54_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT54_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT54_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT54_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT55_MASK_MASK (0x800000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT55_MASK_SHIFT (23U) -/*! INT55_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT55_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT55_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT55_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT56_MASK_MASK (0x1000000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT56_MASK_SHIFT (24U) -/*! INT56_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT56_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT56_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT56_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT57_MASK_MASK (0x2000000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT57_MASK_SHIFT (25U) -/*! INT57_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT57_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT57_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT57_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT58_MASK_MASK (0x4000000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT58_MASK_SHIFT (26U) -/*! INT58_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT58_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT58_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT58_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT59_MASK_MASK (0x8000000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT59_MASK_SHIFT (27U) -/*! INT59_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT59_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT59_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT59_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT60_MASK_MASK (0x10000000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT60_MASK_SHIFT (28U) -/*! INT60_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT60_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT60_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT60_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT61_MASK_MASK (0x20000000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT61_MASK_SHIFT (29U) -/*! INT61_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT61_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT61_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT61_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT62_MASK_MASK (0x40000000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT62_MASK_SHIFT (30U) -/*! INT62_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT62_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT62_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT62_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT63_MASK_MASK (0x80000000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT63_MASK_SHIFT (31U) -/*! INT63_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT63_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT63_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT63_MASK_MASK) -/*! @} */ - -/*! @name SEC_CPU1_INT_MASK2 - Secure Interrupt Mask 2 for CPU1 */ -/*! @{ */ - -#define AHBSC_SEC_CPU1_INT_MASK2_INT64_MASK_MASK (0x1U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT64_MASK_SHIFT (0U) -/*! INT64_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT64_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT64_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT64_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT65_MASK_MASK (0x2U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT65_MASK_SHIFT (1U) -/*! INT65_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT65_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT65_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT65_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT66_MASK_MASK (0x4U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT66_MASK_SHIFT (2U) -/*! INT66_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT66_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT66_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT66_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT67_MASK_MASK (0x8U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT67_MASK_SHIFT (3U) -/*! INT67_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT67_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT67_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT67_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT68_MASK_MASK (0x10U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT68_MASK_SHIFT (4U) -/*! INT68_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT68_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT68_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT68_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT69_MASK_MASK (0x20U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT69_MASK_SHIFT (5U) -/*! INT69_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT69_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT69_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT69_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT70_MASK_MASK (0x40U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT70_MASK_SHIFT (6U) -/*! INT70_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT70_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT70_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT70_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT71_MASK_MASK (0x80U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT71_MASK_SHIFT (7U) -/*! INT71_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT71_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT71_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT71_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT72_MASK_MASK (0x100U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT72_MASK_SHIFT (8U) -/*! INT72_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT72_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT72_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT72_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT73_MASK_MASK (0x200U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT73_MASK_SHIFT (9U) -/*! INT73_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT73_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT73_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT73_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT74_MASK_MASK (0x400U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT74_MASK_SHIFT (10U) -/*! INT74_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT74_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT74_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT74_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT75_MASK_MASK (0x800U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT75_MASK_SHIFT (11U) -/*! INT75_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT75_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT75_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT75_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT76_MASK_MASK (0x1000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT76_MASK_SHIFT (12U) -/*! INT76_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT76_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT76_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT76_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT77_MASK_MASK (0x2000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT77_MASK_SHIFT (13U) -/*! INT77_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT77_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT77_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT77_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT78_MASK_MASK (0x4000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT78_MASK_SHIFT (14U) -/*! INT78_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT78_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT78_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT78_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT79_MASK_MASK (0x8000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT79_MASK_SHIFT (15U) -/*! INT79_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT79_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT79_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT79_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT80_MASK_MASK (0x10000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT80_MASK_SHIFT (16U) -/*! INT80_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT80_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT80_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT80_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT81_MASK_MASK (0x20000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT81_MASK_SHIFT (17U) -/*! INT81_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT81_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT81_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT81_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT82_MASK_MASK (0x40000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT82_MASK_SHIFT (18U) -/*! INT82_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT82_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT82_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT82_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT83_MASK_MASK (0x80000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT83_MASK_SHIFT (19U) -/*! INT83_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT83_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT83_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT83_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT84_MASK_MASK (0x100000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT84_MASK_SHIFT (20U) -/*! INT84_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT84_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT84_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT84_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT85_MASK_MASK (0x200000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT85_MASK_SHIFT (21U) -/*! INT85_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT85_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT85_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT85_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT86_MASK_MASK (0x400000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT86_MASK_SHIFT (22U) -/*! INT86_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT86_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT86_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT86_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT87_MASK_MASK (0x800000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT87_MASK_SHIFT (23U) -/*! INT87_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT87_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT87_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT87_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT88_MASK_MASK (0x1000000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT88_MASK_SHIFT (24U) -/*! INT88_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT88_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT88_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT88_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT89_MASK_MASK (0x2000000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT89_MASK_SHIFT (25U) -/*! INT89_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT89_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT89_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT89_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT90_MASK_MASK (0x4000000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT90_MASK_SHIFT (26U) -/*! INT90_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT90_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT90_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT90_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT91_MASK_MASK (0x8000000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT91_MASK_SHIFT (27U) -/*! INT91_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT91_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT91_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT91_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT92_MASK_MASK (0x10000000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT92_MASK_SHIFT (28U) -/*! INT92_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT92_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT92_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT92_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT93_MASK_MASK (0x20000000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT93_MASK_SHIFT (29U) -/*! INT93_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT93_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT93_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT93_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT94_MASK_MASK (0x40000000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT94_MASK_SHIFT (30U) -/*! INT94_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT94_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT94_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT94_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT95_MASK_MASK (0x80000000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT95_MASK_SHIFT (31U) -/*! INT95_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT95_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT95_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT95_MASK_MASK) -/*! @} */ - -/*! @name SEC_CPU1_INT_MASK3 - Secure Interrupt Mask 3 for CPU1 */ -/*! @{ */ - -#define AHBSC_SEC_CPU1_INT_MASK3_INT96_MASK_MASK (0x1U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT96_MASK_SHIFT (0U) -/*! INT96_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT96_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT96_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT96_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT97_MASK_MASK (0x2U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT97_MASK_SHIFT (1U) -/*! INT97_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT97_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT97_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT97_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT98_MASK_MASK (0x4U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT98_MASK_SHIFT (2U) -/*! INT98_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT98_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT98_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT98_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT99_MASK_MASK (0x8U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT99_MASK_SHIFT (3U) -/*! INT99_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT99_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT99_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT99_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT100_MASK_MASK (0x10U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT100_MASK_SHIFT (4U) -/*! INT100_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT100_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT100_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT100_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT101_MASK_MASK (0x20U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT101_MASK_SHIFT (5U) -/*! INT101_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT101_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT101_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT101_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT102_MASK_MASK (0x40U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT102_MASK_SHIFT (6U) -/*! INT102_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT102_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT102_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT102_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT103_MASK_MASK (0x80U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT103_MASK_SHIFT (7U) -/*! INT103_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT103_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT103_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT103_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT104_MASK_MASK (0x100U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT104_MASK_SHIFT (8U) -/*! INT104_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT104_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT104_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT104_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT105_MASK_MASK (0x200U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT105_MASK_SHIFT (9U) -/*! INT105_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT105_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT105_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT105_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT106_MASK_MASK (0x400U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT106_MASK_SHIFT (10U) -/*! INT106_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT106_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT106_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT106_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT107_MASK_MASK (0x800U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT107_MASK_SHIFT (11U) -/*! INT107_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT107_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT107_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT107_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT108_MASK_MASK (0x1000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT108_MASK_SHIFT (12U) -/*! INT108_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT108_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT108_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT108_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT109_MASK_MASK (0x2000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT109_MASK_SHIFT (13U) -/*! INT109_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT109_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT109_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT109_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT110_MASK_MASK (0x4000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT110_MASK_SHIFT (14U) -/*! INT110_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT110_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT110_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT110_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT111_MASK_MASK (0x8000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT111_MASK_SHIFT (15U) -/*! INT111_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT111_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT111_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT111_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT112_MASK_MASK (0x10000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT112_MASK_SHIFT (16U) -/*! INT112_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT112_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT112_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT112_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT113_MASK_MASK (0x20000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT113_MASK_SHIFT (17U) -/*! INT113_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT113_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT113_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT113_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT114_MASK_MASK (0x40000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT114_MASK_SHIFT (18U) -/*! INT114_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT114_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT114_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT114_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT115_MASK_MASK (0x80000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT115_MASK_SHIFT (19U) -/*! INT115_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT115_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT115_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT115_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT116_MASK_MASK (0x100000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT116_MASK_SHIFT (20U) -/*! INT116_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT116_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT116_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT116_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT117_MASK_MASK (0x200000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT117_MASK_SHIFT (21U) -/*! INT117_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT117_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT117_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT117_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT118_MASK_MASK (0x400000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT118_MASK_SHIFT (22U) -/*! INT118_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT118_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT118_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT118_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT119_MASK_MASK (0x800000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT119_MASK_SHIFT (23U) -/*! INT119_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT119_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT119_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT119_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT120_MASK_MASK (0x1000000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT120_MASK_SHIFT (24U) -/*! INT120_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT120_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT120_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT120_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT121_MASK_MASK (0x2000000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT121_MASK_SHIFT (25U) -/*! INT121_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT121_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT121_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT121_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT122_MASK_MASK (0x4000000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT122_MASK_SHIFT (26U) -/*! INT122_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT122_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT122_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT122_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT123_MASK_MASK (0x8000000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT123_MASK_SHIFT (27U) -/*! INT123_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT123_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT123_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT123_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT124_MASK_MASK (0x10000000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT124_MASK_SHIFT (28U) -/*! INT124_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT124_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT124_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT124_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT125_MASK_MASK (0x20000000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT125_MASK_SHIFT (29U) -/*! INT125_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT125_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT125_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT125_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT126_MASK_MASK (0x40000000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT126_MASK_SHIFT (30U) -/*! INT126_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT126_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT126_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT126_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT127_MASK_MASK (0x80000000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT127_MASK_SHIFT (31U) -/*! INT127_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT127_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT127_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT127_MASK_MASK) -/*! @} */ - -/*! @name SEC_CPU1_INT_MASK4 - Secure Interrupt Mask 4 for CPU1 */ -/*! @{ */ - -#define AHBSC_SEC_CPU1_INT_MASK4_INT128_MASK_MASK (0x1U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT128_MASK_SHIFT (0U) -/*! INT128_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT128_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT128_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT128_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT129_MASK_MASK (0x2U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT129_MASK_SHIFT (1U) -/*! INT129_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT129_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT129_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT129_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT130_MASK_MASK (0x4U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT130_MASK_SHIFT (2U) -/*! INT130_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT130_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT130_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT130_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT131_MASK_MASK (0x8U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT131_MASK_SHIFT (3U) -/*! INT131_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT131_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT131_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT131_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT132_MASK_MASK (0x10U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT132_MASK_SHIFT (4U) -/*! INT132_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT132_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT132_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT132_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT133_MASK_MASK (0x20U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT133_MASK_SHIFT (5U) -/*! INT133_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT133_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT133_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT133_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT134_MASK_MASK (0x40U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT134_MASK_SHIFT (6U) -/*! INT134_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT134_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT134_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT134_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT135_MASK_MASK (0x80U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT135_MASK_SHIFT (7U) -/*! INT135_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT135_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT135_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT135_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT136_MASK_MASK (0x100U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT136_MASK_SHIFT (8U) -/*! INT136_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT136_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT136_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT136_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT137_MASK_MASK (0x200U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT137_MASK_SHIFT (9U) -/*! INT137_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT137_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT137_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT137_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT138_MASK_MASK (0x400U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT138_MASK_SHIFT (10U) -/*! INT138_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT138_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT138_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT138_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT139_MASK_MASK (0x800U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT139_MASK_SHIFT (11U) -/*! INT139_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT139_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT139_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT139_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT140_MASK_MASK (0x1000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT140_MASK_SHIFT (12U) -/*! INT140_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT140_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT140_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT140_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT141_MASK_MASK (0x2000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT141_MASK_SHIFT (13U) -/*! INT141_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT141_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT141_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT141_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT142_MASK_MASK (0x4000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT142_MASK_SHIFT (14U) -/*! INT142_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT142_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT142_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT142_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT143_MASK_MASK (0x8000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT143_MASK_SHIFT (15U) -/*! INT143_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT143_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT143_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT143_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT144_MASK_MASK (0x10000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT144_MASK_SHIFT (16U) -/*! INT144_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT144_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT144_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT144_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT145_MASK_MASK (0x20000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT145_MASK_SHIFT (17U) -/*! INT145_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT145_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT145_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT145_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT146_MASK_MASK (0x40000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT146_MASK_SHIFT (18U) -/*! INT146_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT146_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT146_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT146_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT147_MASK_MASK (0x80000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT147_MASK_SHIFT (19U) -/*! INT147_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT147_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT147_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT147_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT148_MASK_MASK (0x100000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT148_MASK_SHIFT (20U) -/*! INT148_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT148_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT148_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT148_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT149_MASK_MASK (0x200000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT149_MASK_SHIFT (21U) -/*! INT149_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT149_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT149_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT149_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT150_MASK_MASK (0x400000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT150_MASK_SHIFT (22U) -/*! INT150_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT150_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT150_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT150_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT151_MASK_MASK (0x800000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT151_MASK_SHIFT (23U) -/*! INT151_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT151_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT151_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT151_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT152_MASK_MASK (0x1000000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT152_MASK_SHIFT (24U) -/*! INT152_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT152_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT152_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT152_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT153_MASK_MASK (0x2000000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT153_MASK_SHIFT (25U) -/*! INT153_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT153_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT153_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT153_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT154_MASK_MASK (0x4000000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT154_MASK_SHIFT (26U) -/*! INT154_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT154_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT154_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT154_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT155_MASK_MASK (0x8000000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT155_MASK_SHIFT (27U) -/*! INT155_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT155_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT155_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT155_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT156_MASK_MASK (0x10000000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT156_MASK_SHIFT (28U) -/*! INT156_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT156_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT156_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT156_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT157_MASK_MASK (0x20000000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT157_MASK_SHIFT (29U) -/*! INT157_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT157_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT157_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT157_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT158_MASK_MASK (0x40000000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT158_MASK_SHIFT (30U) -/*! INT158_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT158_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT158_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT158_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT159_MASK_MASK (0x80000000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT159_MASK_SHIFT (31U) -/*! INT159_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT159_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT159_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT159_MASK_MASK) -/*! @} */ - -/*! @name SEC_GP_REG_LOCK - Secure Mask Lock */ -/*! @{ */ - -#define AHBSC_SEC_GP_REG_LOCK_SEC_GPIO_MASK0_LOCK_MASK (0x3U) -#define AHBSC_SEC_GP_REG_LOCK_SEC_GPIO_MASK0_LOCK_SHIFT (0U) -/*! SEC_GPIO_MASK0_LOCK - Secure GPIO _MASK0 Lock - * 0b00..Reserved - * 0b01..SEC_GPIO_MASK0 cannot be written - * 0b10..SEC_GPIO_MASK0 can be written - * 0b11..Reserved - */ -#define AHBSC_SEC_GP_REG_LOCK_SEC_GPIO_MASK0_LOCK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GP_REG_LOCK_SEC_GPIO_MASK0_LOCK_SHIFT)) & AHBSC_SEC_GP_REG_LOCK_SEC_GPIO_MASK0_LOCK_MASK) - -#define AHBSC_SEC_GP_REG_LOCK_SEC_GPIO_MASK1_LOCK_MASK (0xCU) -#define AHBSC_SEC_GP_REG_LOCK_SEC_GPIO_MASK1_LOCK_SHIFT (2U) -/*! SEC_GPIO_MASK1_LOCK - Secure GPIO _MASK1 Lock - * 0b00..Reserved - * 0b01..SEC_GPIO_MASK1 cannot be written - * 0b10..SEC_GPIO_MASK1 can be written - * 0b11..Reserved - */ -#define AHBSC_SEC_GP_REG_LOCK_SEC_GPIO_MASK1_LOCK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GP_REG_LOCK_SEC_GPIO_MASK1_LOCK_SHIFT)) & AHBSC_SEC_GP_REG_LOCK_SEC_GPIO_MASK1_LOCK_MASK) - -#define AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK0_LOCK_MASK (0x3000U) -#define AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK0_LOCK_SHIFT (12U) -/*! SEC_CPU1_INT_MASK0_LOCK - SEC_CPU1_INT_MASK0 Lock - * 0b00..Reserved - * 0b01..SEC_GPIO_MASK0 cannot be written - * 0b10..SEC_GPIO_MASK0 can be written - * 0b11..Reserved - */ -#define AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK0_LOCK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK0_LOCK_SHIFT)) & AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK0_LOCK_MASK) - -#define AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK1_LOCK_MASK (0xC000U) -#define AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK1_LOCK_SHIFT (14U) -/*! SEC_CPU1_INT_MASK1_LOCK - SEC_CPU1_INT_MASK1 Lock - * 0b00..Reserved - * 0b01..SEC_GPIO_MASK1 cannot be written - * 0b10..SEC_GPIO_MASK1 can be written - * 0b11..Reserved - */ -#define AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK1_LOCK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK1_LOCK_SHIFT)) & AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK1_LOCK_MASK) - -#define AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK2_LOCK_MASK (0x30000U) -#define AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK2_LOCK_SHIFT (16U) -/*! SEC_CPU1_INT_MASK2_LOCK - SEC_CPU1_INT_MASK2 Lock - * 0b00..Reserved - * 0b01..SEC_CPU1_INT_MASK2 cannot be written - * 0b10..SEC_CPU1_INT_MASK2 can be written - * 0b11..Reserved - */ -#define AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK2_LOCK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK2_LOCK_SHIFT)) & AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK2_LOCK_MASK) - -#define AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK3_LOCK_MASK (0xC0000U) -#define AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK3_LOCK_SHIFT (18U) -/*! SEC_CPU1_INT_MASK3_LOCK - SEC_CPU1_INT_MASK3 Lock - * 0b00..Reserved - * 0b01..SEC_CPU1_INT_MASK3 cannot be written - * 0b10..SEC_CPU1_INT_MASK3 can be written - * 0b11..Reserved - */ -#define AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK3_LOCK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK3_LOCK_SHIFT)) & AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK3_LOCK_MASK) - -#define AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK4_LOCK_MASK (0x300000U) -#define AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK4_LOCK_SHIFT (20U) -/*! SEC_CPU1_INT_MASK4_LOCK - SEC_CPU1_INT_MASK4 Lock - * 0b00..Reserved - * 0b01..SEC_CPU1_INT_MASK4 cannot be written - * 0b10..SEC_CPU1_INT_MASK4 can be written - * 0b11..Reserved - */ -#define AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK4_LOCK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK4_LOCK_SHIFT)) & AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK4_LOCK_MASK) -/*! @} */ - -/*! @name MASTER_SEC_LEVEL - Master Secure Level */ -/*! @{ */ - -#define AHBSC_MASTER_SEC_LEVEL_CPU1_MASK (0xCU) -#define AHBSC_MASTER_SEC_LEVEL_CPU1_SHIFT (2U) -/*! CPU1 - CPU1 - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define AHBSC_MASTER_SEC_LEVEL_CPU1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_CPU1_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_CPU1_MASK) - -#define AHBSC_MASTER_SEC_LEVEL_SMARTDMA_MASK (0x30U) -#define AHBSC_MASTER_SEC_LEVEL_SMARTDMA_SHIFT (4U) -/*! SMARTDMA - SMARTDMA Data - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define AHBSC_MASTER_SEC_LEVEL_SMARTDMA(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_SMARTDMA_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_SMARTDMA_MASK) - -#define AHBSC_MASTER_SEC_LEVEL_EDMA0_MASK (0xC0U) -#define AHBSC_MASTER_SEC_LEVEL_EDMA0_SHIFT (6U) -/*! eDMA0 - eDMA0 - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define AHBSC_MASTER_SEC_LEVEL_EDMA0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_EDMA0_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_EDMA0_MASK) - -#define AHBSC_MASTER_SEC_LEVEL_EDMA1_MASK (0x300U) -#define AHBSC_MASTER_SEC_LEVEL_EDMA1_SHIFT (8U) -/*! eDMA1 - eDMA1 - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define AHBSC_MASTER_SEC_LEVEL_EDMA1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_EDMA1_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_EDMA1_MASK) - -#define AHBSC_MASTER_SEC_LEVEL_PKC_MASK (0xC00U) -#define AHBSC_MASTER_SEC_LEVEL_PKC_SHIFT (10U) -/*! PKC - PKC - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define AHBSC_MASTER_SEC_LEVEL_PKC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_PKC_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_PKC_MASK) - -#define AHBSC_MASTER_SEC_LEVEL_PQ_MASK (0xC000U) -#define AHBSC_MASTER_SEC_LEVEL_PQ_SHIFT (14U) -/*! PQ - PowerQuad - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define AHBSC_MASTER_SEC_LEVEL_PQ(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_PQ_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_PQ_MASK) - -#define AHBSC_MASTER_SEC_LEVEL_NPUO_MASK (0x30000U) -#define AHBSC_MASTER_SEC_LEVEL_NPUO_SHIFT (16U) -/*! NPUO - NPU Operands - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define AHBSC_MASTER_SEC_LEVEL_NPUO(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_NPUO_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_NPUO_MASK) - -#define AHBSC_MASTER_SEC_LEVEL_COOLFLUXI_MASK (0xC0000U) -#define AHBSC_MASTER_SEC_LEVEL_COOLFLUXI_SHIFT (18U) -/*! COOLFLUXI - Coolflux Instruction - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define AHBSC_MASTER_SEC_LEVEL_COOLFLUXI(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_COOLFLUXI_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_COOLFLUXI_MASK) - -#define AHBSC_MASTER_SEC_LEVEL_USB_FS_MASK (0xC00000U) -#define AHBSC_MASTER_SEC_LEVEL_USB_FS_SHIFT (22U) -/*! USB_FS - USB_FS - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define AHBSC_MASTER_SEC_LEVEL_USB_FS(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_USB_FS_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_USB_FS_MASK) - -#define AHBSC_MASTER_SEC_LEVEL_ETHERNET_MASK (0x3000000U) -#define AHBSC_MASTER_SEC_LEVEL_ETHERNET_SHIFT (24U) -/*! ETHERNET - Ethernet - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define AHBSC_MASTER_SEC_LEVEL_ETHERNET(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_ETHERNET_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_ETHERNET_MASK) - -#define AHBSC_MASTER_SEC_LEVEL_USB_HS_MASK (0xC000000U) -#define AHBSC_MASTER_SEC_LEVEL_USB_HS_SHIFT (26U) -/*! USB_HS - USB HS - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define AHBSC_MASTER_SEC_LEVEL_USB_HS(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_USB_HS_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_USB_HS_MASK) - -#define AHBSC_MASTER_SEC_LEVEL_USDHC_MASK (0x30000000U) -#define AHBSC_MASTER_SEC_LEVEL_USDHC_SHIFT (28U) -/*! USDHC - uSDHC - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define AHBSC_MASTER_SEC_LEVEL_USDHC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_USDHC_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_USDHC_MASK) - -#define AHBSC_MASTER_SEC_LEVEL_MASTER_SEC_LEVEL_LOCK_MASK (0xC0000000U) -#define AHBSC_MASTER_SEC_LEVEL_MASTER_SEC_LEVEL_LOCK_SHIFT (30U) -/*! MASTER_SEC_LEVEL_LOCK - Master SEC Level Lock - * 0b00..Reserved - * 0b01..MASTER_SEC_LEVEL_LOCK cannot be written - * 0b10..MASTER_SEC_LEVEL_LOCK can be written - * 0b11..Reserved - */ -#define AHBSC_MASTER_SEC_LEVEL_MASTER_SEC_LEVEL_LOCK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_MASTER_SEC_LEVEL_LOCK_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_MASTER_SEC_LEVEL_LOCK_MASK) -/*! @} */ - -/*! @name MASTER_SEC_ANTI_POL_REG - Master Secure Level */ -/*! @{ */ - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_CPU1_MASK (0xCU) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_CPU1_SHIFT (2U) -/*! CPU1 - CPU1 - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_CPU1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_CPU1_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_CPU1_MASK) - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_SMARTDMA_MASK (0x30U) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_SMARTDMA_SHIFT (4U) -/*! SMARTDMA - SMARTDMA Data - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_SMARTDMA(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_SMARTDMA_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_SMARTDMA_MASK) - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_EDMA0_MASK (0xC0U) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_EDMA0_SHIFT (6U) -/*! eDMA0 - eDMA0 - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_EDMA0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_EDMA0_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_EDMA0_MASK) - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_EDMA1_MASK (0x300U) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_EDMA1_SHIFT (8U) -/*! eDMA1 - eDMA1 - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_EDMA1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_EDMA1_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_EDMA1_MASK) - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_PKC_MASK (0xC00U) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_PKC_SHIFT (10U) -/*! PKC - PKC - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_PKC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_PKC_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_PKC_MASK) - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_PQ_MASK (0xC000U) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_PQ_SHIFT (14U) -/*! PQ - PowerQuad - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_PQ(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_PQ_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_PQ_MASK) - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_NPUO_MASK (0x30000U) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_NPUO_SHIFT (16U) -/*! NPUO - NPU Operands - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_NPUO(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_NPUO_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_NPUO_MASK) - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_COOLFLUXI_MASK (0xC0000U) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_COOLFLUXI_SHIFT (18U) -/*! COOLFLUXI - Coolflux Instruction - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_COOLFLUXI(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_COOLFLUXI_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_COOLFLUXI_MASK) - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_USB_FS_MASK (0xC00000U) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_USB_FS_SHIFT (22U) -/*! USB_FS - USB_FS - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_USB_FS(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_USB_FS_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_USB_FS_MASK) - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_ETHERNET_MASK (0x3000000U) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_ETHERNET_SHIFT (24U) -/*! ETHERNET - Ethernet - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_ETHERNET(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_ETHERNET_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_ETHERNET_MASK) - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_USB_HS_MASK (0xC000000U) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_USB_HS_SHIFT (26U) -/*! USB_HS - USB HS - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_USB_HS(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_USB_HS_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_USB_HS_MASK) - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_USDHC_MASK (0x30000000U) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_USDHC_SHIFT (28U) -/*! USDHC - uSDHC - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_USDHC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_USDHC_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_USDHC_MASK) - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_MASTER_SEC_LEVEL_ANTIPOL_LOCK_MASK (0xC0000000U) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_MASTER_SEC_LEVEL_ANTIPOL_LOCK_SHIFT (30U) -/*! MASTER_SEC_LEVEL_ANTIPOL_LOCK - Master SEC Level Antipol Lock - * 0b00..Reserved - * 0b01..MASTER_SEC_LEVEL_LOCK cannot be written - * 0b10..MASTER_SEC_LEVEL_LOCK can be written - * 0b11..Reserved - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_MASTER_SEC_LEVEL_ANTIPOL_LOCK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_MASTER_SEC_LEVEL_ANTIPOL_LOCK_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_MASTER_SEC_LEVEL_ANTIPOL_LOCK_MASK) -/*! @} */ - -/*! @name CPU0_LOCK_REG - Miscellaneous CPU0 Control Signals */ -/*! @{ */ - -#define AHBSC_CPU0_LOCK_REG_LOCK_NS_VTOR_MASK (0x3U) -#define AHBSC_CPU0_LOCK_REG_LOCK_NS_VTOR_SHIFT (0U) -/*! LOCK_NS_VTOR - LOCK_NS_VTOR - * 0b00..Reserved - * 0b01..CM33 (CPU0) LOCKNSVTOR is 1 - * 0b10..CM33 (CPU0) LOCKNSVTOR is 0 - * 0b11..Reserved - */ -#define AHBSC_CPU0_LOCK_REG_LOCK_NS_VTOR(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_CPU0_LOCK_REG_LOCK_NS_VTOR_SHIFT)) & AHBSC_CPU0_LOCK_REG_LOCK_NS_VTOR_MASK) - -#define AHBSC_CPU0_LOCK_REG_LOCK_NS_MPU_MASK (0xCU) -#define AHBSC_CPU0_LOCK_REG_LOCK_NS_MPU_SHIFT (2U) -/*! LOCK_NS_MPU - LOCK_NS_MPU - * 0b00..Reserved - * 0b01..CM33 (CPU0) LOCK_NS_MPU is 1 - * 0b10..CM33 (CPU0) LOCK_NS_MPU is 0 - * 0b11..Reserved - */ -#define AHBSC_CPU0_LOCK_REG_LOCK_NS_MPU(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_CPU0_LOCK_REG_LOCK_NS_MPU_SHIFT)) & AHBSC_CPU0_LOCK_REG_LOCK_NS_MPU_MASK) - -#define AHBSC_CPU0_LOCK_REG_LOCK_S_VTAIRCR_MASK (0x30U) -#define AHBSC_CPU0_LOCK_REG_LOCK_S_VTAIRCR_SHIFT (4U) -/*! LOCK_S_VTAIRCR - LOCK_S_VTAIRCR - * 0b00..Reserved - * 0b01..CM33 (CPU0) LOCK_S_VTAIRCR is 1 - * 0b10..CM33 (CPU0) LOCK_S_VTAIRCR is 0 - * 0b11..Reserved - */ -#define AHBSC_CPU0_LOCK_REG_LOCK_S_VTAIRCR(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_CPU0_LOCK_REG_LOCK_S_VTAIRCR_SHIFT)) & AHBSC_CPU0_LOCK_REG_LOCK_S_VTAIRCR_MASK) - -#define AHBSC_CPU0_LOCK_REG_LOCK_S_MPU_MASK (0xC0U) -#define AHBSC_CPU0_LOCK_REG_LOCK_S_MPU_SHIFT (6U) -/*! LOCK_S_MPU - LOCK_S_MPU - * 0b00..Reserved - * 0b01..CM33 (CPU0) LOCK_S_MPU is 1 - * 0b10..CM33 (CPU0) LOCK_S_MPU is 0 - * 0b11..Reserved - */ -#define AHBSC_CPU0_LOCK_REG_LOCK_S_MPU(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_CPU0_LOCK_REG_LOCK_S_MPU_SHIFT)) & AHBSC_CPU0_LOCK_REG_LOCK_S_MPU_MASK) - -#define AHBSC_CPU0_LOCK_REG_LOCK_SAU_MASK (0x300U) -#define AHBSC_CPU0_LOCK_REG_LOCK_SAU_SHIFT (8U) -/*! LOCK_SAU - LOCK_SAU - * 0b00..Reserved - * 0b01..CM33 (CPU0) LOCK_SAU is 1 - * 0b10..CM33 (CPU0) LOCK_SAU is 0 - * 0b11..Reserved - */ -#define AHBSC_CPU0_LOCK_REG_LOCK_SAU(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_CPU0_LOCK_REG_LOCK_SAU_SHIFT)) & AHBSC_CPU0_LOCK_REG_LOCK_SAU_MASK) - -#define AHBSC_CPU0_LOCK_REG_CM33_LOCK_REG_LOCK_MASK (0xC0000000U) -#define AHBSC_CPU0_LOCK_REG_CM33_LOCK_REG_LOCK_SHIFT (30U) -/*! CM33_LOCK_REG_LOCK - CM33_LOCK_REG_LOCK - * 0b00..Reserved - * 0b01..CM33_LOCK_REG_LOCK is 1 - * 0b10..CM33_LOCK_REG_LOCK is 0 - * 0b11..Reserved - */ -#define AHBSC_CPU0_LOCK_REG_CM33_LOCK_REG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_CPU0_LOCK_REG_CM33_LOCK_REG_LOCK_SHIFT)) & AHBSC_CPU0_LOCK_REG_CM33_LOCK_REG_LOCK_MASK) -/*! @} */ - -/*! @name CPU1_LOCK_REG - Miscellaneous CPU1 Control Signals */ -/*! @{ */ - -#define AHBSC_CPU1_LOCK_REG_LOCK_NS_VTOR_MASK (0x3U) -#define AHBSC_CPU1_LOCK_REG_LOCK_NS_VTOR_SHIFT (0U) -/*! LOCK_NS_VTOR - LOCK_NS_VTOR - * 0b00..Reserved - * 0b01..CM33 (CPU0) LOCKNSVTOR is 1 - * 0b10..CM33 (CPU0) LOCKNSVTOR is 0 - * 0b11..Reserved - */ -#define AHBSC_CPU1_LOCK_REG_LOCK_NS_VTOR(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_CPU1_LOCK_REG_LOCK_NS_VTOR_SHIFT)) & AHBSC_CPU1_LOCK_REG_LOCK_NS_VTOR_MASK) - -#define AHBSC_CPU1_LOCK_REG_LOCK_NS_MPU_MASK (0xCU) -#define AHBSC_CPU1_LOCK_REG_LOCK_NS_MPU_SHIFT (2U) -/*! LOCK_NS_MPU - LOCK_NS_MPU - * 0b00..Reserved - * 0b01..CM33 (CPU0) LOCK_NS_MPU is 1 - * 0b10..CM33 (CPU0) LOCK_NS_MPU is 0 - * 0b11..Reserved - */ -#define AHBSC_CPU1_LOCK_REG_LOCK_NS_MPU(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_CPU1_LOCK_REG_LOCK_NS_MPU_SHIFT)) & AHBSC_CPU1_LOCK_REG_LOCK_NS_MPU_MASK) -/*! @} */ - -/*! @name MISC_CTRL_DP_REG - Secure Control Duplicate */ -/*! @{ */ - -#define AHBSC_MISC_CTRL_DP_REG_WRITE_LOCK_MASK (0x3U) -#define AHBSC_MISC_CTRL_DP_REG_WRITE_LOCK_SHIFT (0U) -/*! WRITE_LOCK - Write Lock - * 0b00..Reserved - * 0b01..Writes to this register and to the Memory and Peripheral RULE registers are not allowed - * 0b10..Writes to this register and to the Memory and Peripheral RULE registers are allowed - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_DP_REG_WRITE_LOCK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_DP_REG_WRITE_LOCK_SHIFT)) & AHBSC_MISC_CTRL_DP_REG_WRITE_LOCK_MASK) - -#define AHBSC_MISC_CTRL_DP_REG_ENABLE_SECURE_CHECKING_MASK (0xCU) -#define AHBSC_MISC_CTRL_DP_REG_ENABLE_SECURE_CHECKING_SHIFT (2U) -/*! ENABLE_SECURE_CHECKING - Enable Secure Checking - * 0b00..Reserved - * 0b01..Enables secure checking. Violation can be detected when the security level of a transaction does not - * meet the security rule of the slave or memory to be accessed. - * 0b10..Disables secure checking. Even if the security level of a transaction does not conform to the security - * rule of the slave or memory, it will not be detected as a violation. - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_DP_REG_ENABLE_SECURE_CHECKING(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_DP_REG_ENABLE_SECURE_CHECKING_SHIFT)) & AHBSC_MISC_CTRL_DP_REG_ENABLE_SECURE_CHECKING_MASK) - -#define AHBSC_MISC_CTRL_DP_REG_ENABLE_S_PRIV_CHECK_MASK (0x30U) -#define AHBSC_MISC_CTRL_DP_REG_ENABLE_S_PRIV_CHECK_SHIFT (4U) -/*! ENABLE_S_PRIV_CHECK - Enable Secure Privilege Checking - * 0b00..Reserved - * 0b01..Enables the privilege checking of secure mode access. - * 0b10..Disables the privilege checking of secure mode access. - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_DP_REG_ENABLE_S_PRIV_CHECK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_DP_REG_ENABLE_S_PRIV_CHECK_SHIFT)) & AHBSC_MISC_CTRL_DP_REG_ENABLE_S_PRIV_CHECK_MASK) - -#define AHBSC_MISC_CTRL_DP_REG_ENABLE_NS_PRIV_CHECK_MASK (0xC0U) -#define AHBSC_MISC_CTRL_DP_REG_ENABLE_NS_PRIV_CHECK_SHIFT (6U) -/*! ENABLE_NS_PRIV_CHECK - Enable Non-Secure Privilege Checking - * 0b00..Reserved - * 0b01..Enables the privilege checking of non-secure mode access. - * 0b10..Disables the privilege checking of non-secure mode access. - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_DP_REG_ENABLE_NS_PRIV_CHECK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_DP_REG_ENABLE_NS_PRIV_CHECK_SHIFT)) & AHBSC_MISC_CTRL_DP_REG_ENABLE_NS_PRIV_CHECK_MASK) - -#define AHBSC_MISC_CTRL_DP_REG_DISABLE_VIOLATION_ABORT_MASK (0x300U) -#define AHBSC_MISC_CTRL_DP_REG_DISABLE_VIOLATION_ABORT_SHIFT (8U) -/*! DISABLE_VIOLATION_ABORT - Disable Violation Abort - * 0b00..Reserved - * 0b01..The violation detected by the secure checker will not cause an abort, but a secure_violation_irq - * (interrupt request) will still be asserted and serviced by ISR. - * 0b10..The violation detected by the secure checker will cause an abort. - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_DP_REG_DISABLE_VIOLATION_ABORT(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_DP_REG_DISABLE_VIOLATION_ABORT_SHIFT)) & AHBSC_MISC_CTRL_DP_REG_DISABLE_VIOLATION_ABORT_MASK) - -#define AHBSC_MISC_CTRL_DP_REG_DISABLE_STRICT_MODE_MASK (0xC00U) -#define AHBSC_MISC_CTRL_DP_REG_DISABLE_STRICT_MODE_SHIFT (10U) -/*! DISABLE_STRICT_MODE - Disable Strict Mode - * 0b00..Reserved - * 0b01..Master can access memories and peripherals at the same level or below that level. - * 0b10..Master can access memories and peripherals at same level only - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_DP_REG_DISABLE_STRICT_MODE(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_DP_REG_DISABLE_STRICT_MODE_SHIFT)) & AHBSC_MISC_CTRL_DP_REG_DISABLE_STRICT_MODE_MASK) - -#define AHBSC_MISC_CTRL_DP_REG_IDAU_ALL_NS_MASK (0xC000U) -#define AHBSC_MISC_CTRL_DP_REG_IDAU_ALL_NS_SHIFT (14U) -/*! IDAU_ALL_NS - IDAU All Non-Secure - * 0b00..Reserved - * 0b01..IDAU is disabled, which means that all memories are attributed as non-secure memory. - * 0b10..IDAU is enabled (restrictive mode) - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_DP_REG_IDAU_ALL_NS(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_DP_REG_IDAU_ALL_NS_SHIFT)) & AHBSC_MISC_CTRL_DP_REG_IDAU_ALL_NS_MASK) -/*! @} */ - -/*! @name MISC_CTRL_REG - Secure Control */ -/*! @{ */ - -#define AHBSC_MISC_CTRL_REG_WRITE_LOCK_MASK (0x3U) -#define AHBSC_MISC_CTRL_REG_WRITE_LOCK_SHIFT (0U) -/*! WRITE_LOCK - Write Lock - * 0b00..Reserved - * 0b01..Writes to this register and to the Memory and Peripheral RULE registers are not allowed - * 0b10..Writes to this register and to the Memory and Peripheral RULE registers are allowed - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_REG_WRITE_LOCK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_REG_WRITE_LOCK_SHIFT)) & AHBSC_MISC_CTRL_REG_WRITE_LOCK_MASK) - -#define AHBSC_MISC_CTRL_REG_ENABLE_SECURE_CHECKING_MASK (0xCU) -#define AHBSC_MISC_CTRL_REG_ENABLE_SECURE_CHECKING_SHIFT (2U) -/*! ENABLE_SECURE_CHECKING - Enable Secure Checking - * 0b00..Reserved - * 0b01..Enables secure checking. Violation can be detected when the security level of a transaction does not - * meet the security rule of the slave or memory to be accessed. - * 0b10..Disables secure checking. Even if the security level of a transaction does not conform to the security - * rule of the slave or memory, it will not be detected as a violation. - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_REG_ENABLE_SECURE_CHECKING(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_REG_ENABLE_SECURE_CHECKING_SHIFT)) & AHBSC_MISC_CTRL_REG_ENABLE_SECURE_CHECKING_MASK) - -#define AHBSC_MISC_CTRL_REG_ENABLE_S_PRIV_CHECK_MASK (0x30U) -#define AHBSC_MISC_CTRL_REG_ENABLE_S_PRIV_CHECK_SHIFT (4U) -/*! ENABLE_S_PRIV_CHECK - Enable Secure Privilege Checking - * 0b00..Reserved - * 0b01..Enables privilege checking of secure mode access. - * 0b10..Disables privilege checking of secure mode access. - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_REG_ENABLE_S_PRIV_CHECK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_REG_ENABLE_S_PRIV_CHECK_SHIFT)) & AHBSC_MISC_CTRL_REG_ENABLE_S_PRIV_CHECK_MASK) - -#define AHBSC_MISC_CTRL_REG_ENABLE_NS_PRIV_CHECK_MASK (0xC0U) -#define AHBSC_MISC_CTRL_REG_ENABLE_NS_PRIV_CHECK_SHIFT (6U) -/*! ENABLE_NS_PRIV_CHECK - Enable Non-Secure Privilege Checking - * 0b00..Reserved - * 0b01..Enables privilege checking of non-secure mode access. - * 0b10..Disables privilege checking of non-secure mode access is disabled. - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_REG_ENABLE_NS_PRIV_CHECK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_REG_ENABLE_NS_PRIV_CHECK_SHIFT)) & AHBSC_MISC_CTRL_REG_ENABLE_NS_PRIV_CHECK_MASK) - -#define AHBSC_MISC_CTRL_REG_DISABLE_VIOLATION_ABORT_MASK (0x300U) -#define AHBSC_MISC_CTRL_REG_DISABLE_VIOLATION_ABORT_SHIFT (8U) -/*! DISABLE_VIOLATION_ABORT - Disable Violation Abort - * 0b00..Reserved - * 0b01..The violation detected by the secure checker will not cause an abort, but a secure_violation_irq - * (interrupt request) will still be asserted and serviced by ISR. - * 0b10..The violation detected by the secure checker will cause an abort. - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_REG_DISABLE_VIOLATION_ABORT(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_REG_DISABLE_VIOLATION_ABORT_SHIFT)) & AHBSC_MISC_CTRL_REG_DISABLE_VIOLATION_ABORT_MASK) - -#define AHBSC_MISC_CTRL_REG_DISABLE_STRICT_MODE_MASK (0xC00U) -#define AHBSC_MISC_CTRL_REG_DISABLE_STRICT_MODE_SHIFT (10U) -/*! DISABLE_STRICT_MODE - Disable Strict Mode - * 0b00..Reserved - * 0b01..Master strict mode is on and can access memories and peripherals at the same level or below that level - * 0b10..Master strict mode is disabled and can access memories and peripherals at same level only - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_REG_DISABLE_STRICT_MODE(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_REG_DISABLE_STRICT_MODE_SHIFT)) & AHBSC_MISC_CTRL_REG_DISABLE_STRICT_MODE_MASK) - -#define AHBSC_MISC_CTRL_REG_IDAU_ALL_NS_MASK (0xC000U) -#define AHBSC_MISC_CTRL_REG_IDAU_ALL_NS_SHIFT (14U) -/*! IDAU_ALL_NS - IDAU All Non-Secure - * 0b00..Reserved - * 0b01..IDAU is disabled, which means that all memories are attributed as non-secure memory. - * 0b10..IDAU is enabled (restrictive mode) - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_REG_IDAU_ALL_NS(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_REG_IDAU_ALL_NS_SHIFT)) & AHBSC_MISC_CTRL_REG_IDAU_ALL_NS_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group AHBSC_Register_Masks */ - - -/* AHBSC - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral AHBSC base address */ - #define AHBSC_BASE (0x50120000u) - /** Peripheral AHBSC base address */ - #define AHBSC_BASE_NS (0x40120000u) - /** Peripheral AHBSC base pointer */ - #define AHBSC ((AHBSC_Type *)AHBSC_BASE) - /** Peripheral AHBSC base pointer */ - #define AHBSC_NS ((AHBSC_Type *)AHBSC_BASE_NS) - /** Peripheral AHBSC_ALIAS1 base address */ - #define AHBSC_ALIAS1_BASE (0x50121000u) - /** Peripheral AHBSC_ALIAS1 base address */ - #define AHBSC_ALIAS1_BASE_NS (0x40121000u) - /** Peripheral AHBSC_ALIAS1 base pointer */ - #define AHBSC_ALIAS1 ((AHBSC_Type *)AHBSC_ALIAS1_BASE) - /** Peripheral AHBSC_ALIAS1 base pointer */ - #define AHBSC_ALIAS1_NS ((AHBSC_Type *)AHBSC_ALIAS1_BASE_NS) - /** Peripheral AHBSC_ALIAS2 base address */ - #define AHBSC_ALIAS2_BASE (0x50122000u) - /** Peripheral AHBSC_ALIAS2 base address */ - #define AHBSC_ALIAS2_BASE_NS (0x40122000u) - /** Peripheral AHBSC_ALIAS2 base pointer */ - #define AHBSC_ALIAS2 ((AHBSC_Type *)AHBSC_ALIAS2_BASE) - /** Peripheral AHBSC_ALIAS2 base pointer */ - #define AHBSC_ALIAS2_NS ((AHBSC_Type *)AHBSC_ALIAS2_BASE_NS) - /** Peripheral AHBSC_ALIAS3 base address */ - #define AHBSC_ALIAS3_BASE (0x50123000u) - /** Peripheral AHBSC_ALIAS3 base address */ - #define AHBSC_ALIAS3_BASE_NS (0x40123000u) - /** Peripheral AHBSC_ALIAS3 base pointer */ - #define AHBSC_ALIAS3 ((AHBSC_Type *)AHBSC_ALIAS3_BASE) - /** Peripheral AHBSC_ALIAS3 base pointer */ - #define AHBSC_ALIAS3_NS ((AHBSC_Type *)AHBSC_ALIAS3_BASE_NS) - /** Array initializer of AHBSC peripheral base addresses */ - #define AHBSC_BASE_ADDRS { AHBSC_BASE, AHBSC_ALIAS1_BASE, AHBSC_ALIAS2_BASE, AHBSC_ALIAS3_BASE } - /** Array initializer of AHBSC peripheral base pointers */ - #define AHBSC_BASE_PTRS { AHBSC, AHBSC_ALIAS1, AHBSC_ALIAS2, AHBSC_ALIAS3 } - /** Array initializer of AHBSC peripheral base addresses */ - #define AHBSC_BASE_ADDRS_NS { AHBSC_BASE_NS, AHBSC_ALIAS1_BASE_NS, AHBSC_ALIAS2_BASE_NS, AHBSC_ALIAS3_BASE_NS } - /** Array initializer of AHBSC peripheral base pointers */ - #define AHBSC_BASE_PTRS_NS { AHBSC_NS, AHBSC_ALIAS1_NS, AHBSC_ALIAS2_NS, AHBSC_ALIAS3_NS } -#else - /** Peripheral AHBSC base address */ - #define AHBSC_BASE (0x40120000u) - /** Peripheral AHBSC base pointer */ - #define AHBSC ((AHBSC_Type *)AHBSC_BASE) - /** Peripheral AHBSC_ALIAS1 base address */ - #define AHBSC_ALIAS1_BASE (0x40121000u) - /** Peripheral AHBSC_ALIAS1 base pointer */ - #define AHBSC_ALIAS1 ((AHBSC_Type *)AHBSC_ALIAS1_BASE) - /** Peripheral AHBSC_ALIAS2 base address */ - #define AHBSC_ALIAS2_BASE (0x40122000u) - /** Peripheral AHBSC_ALIAS2 base pointer */ - #define AHBSC_ALIAS2 ((AHBSC_Type *)AHBSC_ALIAS2_BASE) - /** Peripheral AHBSC_ALIAS3 base address */ - #define AHBSC_ALIAS3_BASE (0x40123000u) - /** Peripheral AHBSC_ALIAS3 base pointer */ - #define AHBSC_ALIAS3 ((AHBSC_Type *)AHBSC_ALIAS3_BASE) - /** Array initializer of AHBSC peripheral base addresses */ - #define AHBSC_BASE_ADDRS { AHBSC_BASE, AHBSC_ALIAS1_BASE, AHBSC_ALIAS2_BASE, AHBSC_ALIAS3_BASE } - /** Array initializer of AHBSC peripheral base pointers */ - #define AHBSC_BASE_PTRS { AHBSC, AHBSC_ALIAS1, AHBSC_ALIAS2, AHBSC_ALIAS3 } -#endif - -/*! - * @} - */ /* end of group AHBSC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- BSP32 Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup BSP32_Peripheral_Access_Layer BSP32 Peripheral Access Layer - * @{ - */ - -/** BSP32 - Register Layout Typedef */ -typedef struct { - __IO uint32_t OFFSET_PMEM; /**< Offset address register for program memory, offset: 0x0 */ - __IO uint32_t OFFSET_XMEM; /**< Offset address register for X-data memory, offset: 0x4 */ - __IO uint32_t OFFSET_YMEM; /**< Offset address register for Y-data memory, offset: 0x8 */ - __IO uint32_t OFFSET_MAILBOX; /**< Offset address register for mailbox peripheral, offset: 0xC */ - __O uint32_t INTERRUPTS_EXTERNAL; /**< External interrupt register, offset: 0x10 */ - __IO uint32_t INTERRUPTS_STATUS; /**< Interrupt status register, offset: 0x14 */ - __IO uint32_t CF_GATING_OVERRIDE; /**< CoolFlux BSP32 gating override, offset: 0x18 */ - __IO uint32_t IVT_OFFSET; /**< CoolFlux BSP32 IVT offset register, offset: 0x1C */ - __I uint32_t SLEEP_MODE; /**< CoolFlux BSP32 sleep mode register, offset: 0x20 */ - __IO uint32_t IVT0; /**< CoolFlux BSP32 IVT register 0 content, offset: 0x24 */ - __IO uint32_t IVT1; /**< CoolFlux BSP32 IVT register 1 content, offset: 0x28 */ - __IO uint32_t IVT2; /**< CoolFlux BSP32 IVT register 2 content, offset: 0x2C */ - __IO uint32_t IVT3; /**< CoolFlux BSP32 IVT register 3 content, offset: 0x30 */ - __IO uint32_t IVT_DISABLE; /**< CoolFlux BSP32 IVT disable register, offset: 0x34 */ -} BSP32_Type; - -/* ---------------------------------------------------------------------------- - -- BSP32 Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup BSP32_Register_Masks BSP32 Register Masks - * @{ - */ - -/*! @name OFFSET_PMEM - Offset address register for program memory */ -/*! @{ */ - -#define BSP32_OFFSET_PMEM_VAL_MASK (0x3FU) -#define BSP32_OFFSET_PMEM_VAL_SHIFT (0U) -/*! val - Offset address register for program memory */ -#define BSP32_OFFSET_PMEM_VAL(x) (((uint32_t)(((uint32_t)(x)) << BSP32_OFFSET_PMEM_VAL_SHIFT)) & BSP32_OFFSET_PMEM_VAL_MASK) -/*! @} */ - -/*! @name OFFSET_XMEM - Offset address register for X-data memory */ -/*! @{ */ - -#define BSP32_OFFSET_XMEM_VAL_MASK (0xFFU) -#define BSP32_OFFSET_XMEM_VAL_SHIFT (0U) -/*! val - Offset address register for X-data memory */ -#define BSP32_OFFSET_XMEM_VAL(x) (((uint32_t)(((uint32_t)(x)) << BSP32_OFFSET_XMEM_VAL_SHIFT)) & BSP32_OFFSET_XMEM_VAL_MASK) -/*! @} */ - -/*! @name OFFSET_YMEM - Offset address register for Y-data memory */ -/*! @{ */ - -#define BSP32_OFFSET_YMEM_VAL_MASK (0xFFU) -#define BSP32_OFFSET_YMEM_VAL_SHIFT (0U) -/*! val - Offset address register for Y-data memory */ -#define BSP32_OFFSET_YMEM_VAL(x) (((uint32_t)(((uint32_t)(x)) << BSP32_OFFSET_YMEM_VAL_SHIFT)) & BSP32_OFFSET_YMEM_VAL_MASK) -/*! @} */ - -/*! @name OFFSET_MAILBOX - Offset address register for mailbox peripheral */ -/*! @{ */ - -#define BSP32_OFFSET_MAILBOX_VAL_MASK (0xFFFFFFU) -#define BSP32_OFFSET_MAILBOX_VAL_SHIFT (0U) -/*! val - Offset address register for mailbox peripheral */ -#define BSP32_OFFSET_MAILBOX_VAL(x) (((uint32_t)(((uint32_t)(x)) << BSP32_OFFSET_MAILBOX_VAL_SHIFT)) & BSP32_OFFSET_MAILBOX_VAL_MASK) -/*! @} */ - -/*! @name INTERRUPTS_EXTERNAL - External interrupt register */ -/*! @{ */ - -#define BSP32_INTERRUPTS_EXTERNAL_VAL_MASK (0xFFFFFFFFU) -#define BSP32_INTERRUPTS_EXTERNAL_VAL_SHIFT (0U) -/*! val - External interrupt register */ -#define BSP32_INTERRUPTS_EXTERNAL_VAL(x) (((uint32_t)(((uint32_t)(x)) << BSP32_INTERRUPTS_EXTERNAL_VAL_SHIFT)) & BSP32_INTERRUPTS_EXTERNAL_VAL_MASK) -/*! @} */ - -/*! @name INTERRUPTS_STATUS - Interrupt status register */ -/*! @{ */ - -#define BSP32_INTERRUPTS_STATUS_VAL_MASK (0x1U) -#define BSP32_INTERRUPTS_STATUS_VAL_SHIFT (0U) -/*! val - Interrupt status register */ -#define BSP32_INTERRUPTS_STATUS_VAL(x) (((uint32_t)(((uint32_t)(x)) << BSP32_INTERRUPTS_STATUS_VAL_SHIFT)) & BSP32_INTERRUPTS_STATUS_VAL_MASK) -/*! @} */ - -/*! @name CF_GATING_OVERRIDE - CoolFlux BSP32 gating override */ -/*! @{ */ - -#define BSP32_CF_GATING_OVERRIDE_VAL_MASK (0x1U) -#define BSP32_CF_GATING_OVERRIDE_VAL_SHIFT (0U) -/*! val - CoolFlux BSP32 gating override */ -#define BSP32_CF_GATING_OVERRIDE_VAL(x) (((uint32_t)(((uint32_t)(x)) << BSP32_CF_GATING_OVERRIDE_VAL_SHIFT)) & BSP32_CF_GATING_OVERRIDE_VAL_MASK) -/*! @} */ - -/*! @name IVT_OFFSET - CoolFlux BSP32 IVT offset register */ -/*! @{ */ - -#define BSP32_IVT_OFFSET_VAL_MASK (0xFFFFFFU) -#define BSP32_IVT_OFFSET_VAL_SHIFT (0U) -/*! val - CoolFlux BSP32 IVT offset register */ -#define BSP32_IVT_OFFSET_VAL(x) (((uint32_t)(((uint32_t)(x)) << BSP32_IVT_OFFSET_VAL_SHIFT)) & BSP32_IVT_OFFSET_VAL_MASK) -/*! @} */ - -/*! @name SLEEP_MODE - CoolFlux BSP32 sleep mode register */ -/*! @{ */ - -#define BSP32_SLEEP_MODE_VAL_MASK (0x1U) -#define BSP32_SLEEP_MODE_VAL_SHIFT (0U) -/*! val - CoolFlux BSP32 sleep mode register */ -#define BSP32_SLEEP_MODE_VAL(x) (((uint32_t)(((uint32_t)(x)) << BSP32_SLEEP_MODE_VAL_SHIFT)) & BSP32_SLEEP_MODE_VAL_MASK) -/*! @} */ - -/*! @name IVT0 - CoolFlux BSP32 IVT register 0 content */ -/*! @{ */ - -#define BSP32_IVT0_VAL_MASK (0xFFFFFFU) -#define BSP32_IVT0_VAL_SHIFT (0U) -/*! val - CoolFlux BSP32 IVT register 0 content */ -#define BSP32_IVT0_VAL(x) (((uint32_t)(((uint32_t)(x)) << BSP32_IVT0_VAL_SHIFT)) & BSP32_IVT0_VAL_MASK) -/*! @} */ - -/*! @name IVT1 - CoolFlux BSP32 IVT register 1 content */ -/*! @{ */ - -#define BSP32_IVT1_VAL_MASK (0xFFFFFFU) -#define BSP32_IVT1_VAL_SHIFT (0U) -/*! val - CoolFlux BSP32 IVT register 1 content */ -#define BSP32_IVT1_VAL(x) (((uint32_t)(((uint32_t)(x)) << BSP32_IVT1_VAL_SHIFT)) & BSP32_IVT1_VAL_MASK) -/*! @} */ - -/*! @name IVT2 - CoolFlux BSP32 IVT register 2 content */ -/*! @{ */ - -#define BSP32_IVT2_VAL_MASK (0xFFFFFFU) -#define BSP32_IVT2_VAL_SHIFT (0U) -/*! val - CoolFlux BSP32 IVT register 2 content */ -#define BSP32_IVT2_VAL(x) (((uint32_t)(((uint32_t)(x)) << BSP32_IVT2_VAL_SHIFT)) & BSP32_IVT2_VAL_MASK) -/*! @} */ - -/*! @name IVT3 - CoolFlux BSP32 IVT register 3 content */ -/*! @{ */ - -#define BSP32_IVT3_VAL_MASK (0xFFFFFFU) -#define BSP32_IVT3_VAL_SHIFT (0U) -/*! val - CoolFlux BSP32 IVT register 3 content */ -#define BSP32_IVT3_VAL(x) (((uint32_t)(((uint32_t)(x)) << BSP32_IVT3_VAL_SHIFT)) & BSP32_IVT3_VAL_MASK) -/*! @} */ - -/*! @name IVT_DISABLE - CoolFlux BSP32 IVT disable register */ -/*! @{ */ - -#define BSP32_IVT_DISABLE_VAL_MASK (0x1U) -#define BSP32_IVT_DISABLE_VAL_SHIFT (0U) -/*! val - CoolFlux BSP32 IVT disable register */ -#define BSP32_IVT_DISABLE_VAL(x) (((uint32_t)(((uint32_t)(x)) << BSP32_IVT_DISABLE_VAL_SHIFT)) & BSP32_IVT_DISABLE_VAL_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group BSP32_Register_Masks */ - - -/* BSP32 - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral BSP32_0 base address */ - #define BSP32_0_BASE (0x50032000u) - /** Peripheral BSP32_0 base address */ - #define BSP32_0_BASE_NS (0x40032000u) - /** Peripheral BSP32_0 base pointer */ - #define BSP32_0 ((BSP32_Type *)BSP32_0_BASE) - /** Peripheral BSP32_0 base pointer */ - #define BSP32_0_NS ((BSP32_Type *)BSP32_0_BASE_NS) - /** Array initializer of BSP32 peripheral base addresses */ - #define BSP32_BASE_ADDRS { BSP32_0_BASE } - /** Array initializer of BSP32 peripheral base pointers */ - #define BSP32_BASE_PTRS { BSP32_0 } - /** Array initializer of BSP32 peripheral base addresses */ - #define BSP32_BASE_ADDRS_NS { BSP32_0_BASE_NS } - /** Array initializer of BSP32 peripheral base pointers */ - #define BSP32_BASE_PTRS_NS { BSP32_0_NS } -#else - /** Peripheral BSP32_0 base address */ - #define BSP32_0_BASE (0x40032000u) - /** Peripheral BSP32_0 base pointer */ - #define BSP32_0 ((BSP32_Type *)BSP32_0_BASE) - /** Array initializer of BSP32 peripheral base addresses */ - #define BSP32_BASE_ADDRS { BSP32_0_BASE } - /** Array initializer of BSP32 peripheral base pointers */ - #define BSP32_BASE_PTRS { BSP32_0 } -#endif - -/*! - * @} - */ /* end of group BSP32_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- CACHE64_CTRL Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CACHE64_CTRL_Peripheral_Access_Layer CACHE64_CTRL Peripheral Access Layer - * @{ - */ - -/** CACHE64_CTRL - Register Layout Typedef */ -typedef struct { - uint8_t RESERVED_0[2048]; - __IO uint32_t CCR; /**< Cache Control, offset: 0x800 */ - __IO uint32_t CLCR; /**< Cache Line Control, offset: 0x804 */ - __IO uint32_t CSAR; /**< Cache Search Address, offset: 0x808 */ - __IO uint32_t CCVR; /**< Cache Read/Write Value, offset: 0x80C */ -} CACHE64_CTRL_Type; - -/* ---------------------------------------------------------------------------- - -- CACHE64_CTRL Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CACHE64_CTRL_Register_Masks CACHE64_CTRL Register Masks - * @{ - */ - -/*! @name CCR - Cache Control */ -/*! @{ */ - -#define CACHE64_CTRL_CCR_ENCACHE_MASK (0x1U) -#define CACHE64_CTRL_CCR_ENCACHE_SHIFT (0U) -/*! ENCACHE - Cache Enable - * 0b0..Disables - * 0b1..Enables - */ -#define CACHE64_CTRL_CCR_ENCACHE(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CCR_ENCACHE_SHIFT)) & CACHE64_CTRL_CCR_ENCACHE_MASK) - -#define CACHE64_CTRL_CCR_ENWRBUF_MASK (0x2U) -#define CACHE64_CTRL_CCR_ENWRBUF_SHIFT (1U) -/*! ENWRBUF - Enable Write Buffer - * 0b0..Disables - * 0b1..Enables - */ -#define CACHE64_CTRL_CCR_ENWRBUF(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CCR_ENWRBUF_SHIFT)) & CACHE64_CTRL_CCR_ENWRBUF_MASK) - -#define CACHE64_CTRL_CCR_FRCWT_MASK (0x4U) -#define CACHE64_CTRL_CCR_FRCWT_SHIFT (2U) -/*! FRCWT - Force Write Through Mode - * 0b0..Does not force - * 0b1..Force - */ -#define CACHE64_CTRL_CCR_FRCWT(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CCR_FRCWT_SHIFT)) & CACHE64_CTRL_CCR_FRCWT_MASK) - -#define CACHE64_CTRL_CCR_FRCNOALLC_MASK (0x8U) -#define CACHE64_CTRL_CCR_FRCNOALLC_SHIFT (3U) -/*! FRCNOALLC - Forces No Allocation On Cache Misses - * 0b0..Allocation on cache misses - * 0b1..Forces no allocation on cache misses (FRCWT must be asserted) - */ -#define CACHE64_CTRL_CCR_FRCNOALLC(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CCR_FRCNOALLC_SHIFT)) & CACHE64_CTRL_CCR_FRCNOALLC_MASK) - -#define CACHE64_CTRL_CCR_INVW0_MASK (0x1000000U) -#define CACHE64_CTRL_CCR_INVW0_SHIFT (24U) -/*! INVW0 - Invalidate Way 0 - * 0b0..No operation - * 0b1..Invalidates all lines in way 0 - */ -#define CACHE64_CTRL_CCR_INVW0(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CCR_INVW0_SHIFT)) & CACHE64_CTRL_CCR_INVW0_MASK) - -#define CACHE64_CTRL_CCR_PUSHW0_MASK (0x2000000U) -#define CACHE64_CTRL_CCR_PUSHW0_SHIFT (25U) -/*! PUSHW0 - Push Way 0 - * 0b0..No operation - * 0b1..Push all modified lines in way 0 - */ -#define CACHE64_CTRL_CCR_PUSHW0(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CCR_PUSHW0_SHIFT)) & CACHE64_CTRL_CCR_PUSHW0_MASK) - -#define CACHE64_CTRL_CCR_INVW1_MASK (0x4000000U) -#define CACHE64_CTRL_CCR_INVW1_SHIFT (26U) -/*! INVW1 - Invalidate Way 1 - * 0b0..No operation - * 0b1..Invalidates all lines in way 1 - */ -#define CACHE64_CTRL_CCR_INVW1(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CCR_INVW1_SHIFT)) & CACHE64_CTRL_CCR_INVW1_MASK) - -#define CACHE64_CTRL_CCR_PUSHW1_MASK (0x8000000U) -#define CACHE64_CTRL_CCR_PUSHW1_SHIFT (27U) -/*! PUSHW1 - Push Way 1 - * 0b0..No operation - * 0b1..Push all modified lines in way 1 - */ -#define CACHE64_CTRL_CCR_PUSHW1(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CCR_PUSHW1_SHIFT)) & CACHE64_CTRL_CCR_PUSHW1_MASK) - -#define CACHE64_CTRL_CCR_GO_MASK (0x80000000U) -#define CACHE64_CTRL_CCR_GO_SHIFT (31U) -/*! GO - Initiate Cache Command - * 0b0..Write: no effect; Read: no cache command active - * 0b1..Write: initiates cache command; Read: cache command active - */ -#define CACHE64_CTRL_CCR_GO(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CCR_GO_SHIFT)) & CACHE64_CTRL_CCR_GO_MASK) -/*! @} */ - -/*! @name CLCR - Cache Line Control */ -/*! @{ */ - -#define CACHE64_CTRL_CLCR_LGO_MASK (0x1U) -#define CACHE64_CTRL_CLCR_LGO_SHIFT (0U) -/*! LGO - Initiate Cache Line Command - * 0b0..Write: no effect; Read: no line command active - * 0b1..Write: initiate line command; Read: line command active - */ -#define CACHE64_CTRL_CLCR_LGO(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CLCR_LGO_SHIFT)) & CACHE64_CTRL_CLCR_LGO_MASK) - -#define CACHE64_CTRL_CLCR_CACHEADDR_MASK (0x1FFCU) -#define CACHE64_CTRL_CLCR_CACHEADDR_SHIFT (2U) -/*! CACHEADDR - Cache Address */ -#define CACHE64_CTRL_CLCR_CACHEADDR(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CLCR_CACHEADDR_SHIFT)) & CACHE64_CTRL_CLCR_CACHEADDR_MASK) - -#define CACHE64_CTRL_CLCR_WSEL_MASK (0x4000U) -#define CACHE64_CTRL_CLCR_WSEL_SHIFT (14U) -/*! WSEL - Way Select - * 0b0..Way 0 - * 0b1..Way 1 - */ -#define CACHE64_CTRL_CLCR_WSEL(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CLCR_WSEL_SHIFT)) & CACHE64_CTRL_CLCR_WSEL_MASK) - -#define CACHE64_CTRL_CLCR_TDSEL_MASK (0x10000U) -#define CACHE64_CTRL_CLCR_TDSEL_SHIFT (16U) -/*! TDSEL - Tag Or Data Select - * 0b0..Data - * 0b1..Tag - */ -#define CACHE64_CTRL_CLCR_TDSEL(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CLCR_TDSEL_SHIFT)) & CACHE64_CTRL_CLCR_TDSEL_MASK) - -#define CACHE64_CTRL_CLCR_LCIVB_MASK (0x100000U) -#define CACHE64_CTRL_CLCR_LCIVB_SHIFT (20U) -/*! LCIVB - Line Command Initial Valid Bit - * 0b0..Initial state 0 - * 0b1..Initial state 1 - */ -#define CACHE64_CTRL_CLCR_LCIVB(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CLCR_LCIVB_SHIFT)) & CACHE64_CTRL_CLCR_LCIVB_MASK) - -#define CACHE64_CTRL_CLCR_LCIMB_MASK (0x200000U) -#define CACHE64_CTRL_CLCR_LCIMB_SHIFT (21U) -/*! LCIMB - Line Command Initial Modified Bit - * 0b0..Initial state 0 - * 0b1..Initial state 1 - */ -#define CACHE64_CTRL_CLCR_LCIMB(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CLCR_LCIMB_SHIFT)) & CACHE64_CTRL_CLCR_LCIMB_MASK) - -#define CACHE64_CTRL_CLCR_LCWAY_MASK (0x400000U) -#define CACHE64_CTRL_CLCR_LCWAY_SHIFT (22U) -/*! LCWAY - Line Command Way - * 0b0..Way 0 - * 0b1..Way 1 - */ -#define CACHE64_CTRL_CLCR_LCWAY(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CLCR_LCWAY_SHIFT)) & CACHE64_CTRL_CLCR_LCWAY_MASK) - -#define CACHE64_CTRL_CLCR_LCMD_MASK (0x3000000U) -#define CACHE64_CTRL_CLCR_LCMD_SHIFT (24U) -/*! LCMD - Line Command - * 0b00..Search and read or write - * 0b01..Invalidate - * 0b10..Push - * 0b11..Clear - */ -#define CACHE64_CTRL_CLCR_LCMD(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CLCR_LCMD_SHIFT)) & CACHE64_CTRL_CLCR_LCMD_MASK) - -#define CACHE64_CTRL_CLCR_LADSEL_MASK (0x4000000U) -#define CACHE64_CTRL_CLCR_LADSEL_SHIFT (26U) -/*! LADSEL - Line Address Select - * 0b0..Cache - * 0b1..Physical - */ -#define CACHE64_CTRL_CLCR_LADSEL(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CLCR_LADSEL_SHIFT)) & CACHE64_CTRL_CLCR_LADSEL_MASK) - -#define CACHE64_CTRL_CLCR_LACC_MASK (0x8000000U) -#define CACHE64_CTRL_CLCR_LACC_SHIFT (27U) -/*! LACC - Line Access Type - * 0b0..Read - * 0b1..Write - */ -#define CACHE64_CTRL_CLCR_LACC(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CLCR_LACC_SHIFT)) & CACHE64_CTRL_CLCR_LACC_MASK) -/*! @} */ - -/*! @name CSAR - Cache Search Address */ -/*! @{ */ - -#define CACHE64_CTRL_CSAR_LGO_MASK (0x1U) -#define CACHE64_CTRL_CSAR_LGO_SHIFT (0U) -/*! LGO - Initiate Cache Line Command - * 0b0..Write: no effect; Read: no line command active - * 0b1..Write: initiate line command; Read: line command active - */ -#define CACHE64_CTRL_CSAR_LGO(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CSAR_LGO_SHIFT)) & CACHE64_CTRL_CSAR_LGO_MASK) - -#define CACHE64_CTRL_CSAR_PHYADDR_MASK (0xFFFFFFFEU) -#define CACHE64_CTRL_CSAR_PHYADDR_SHIFT (1U) -/*! PHYADDR - Physical Address */ -#define CACHE64_CTRL_CSAR_PHYADDR(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CSAR_PHYADDR_SHIFT)) & CACHE64_CTRL_CSAR_PHYADDR_MASK) -/*! @} */ - -/*! @name CCVR - Cache Read/Write Value */ -/*! @{ */ - -#define CACHE64_CTRL_CCVR_DATA_MASK (0xFFFFFFFFU) -#define CACHE64_CTRL_CCVR_DATA_SHIFT (0U) -/*! DATA - Cache Read/Write Data */ -#define CACHE64_CTRL_CCVR_DATA(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CCVR_DATA_SHIFT)) & CACHE64_CTRL_CCVR_DATA_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group CACHE64_CTRL_Register_Masks */ - - -/* CACHE64_CTRL - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral CACHE64_CTRL0 base address */ - #define CACHE64_CTRL0_BASE (0x5001B000u) - /** Peripheral CACHE64_CTRL0 base address */ - #define CACHE64_CTRL0_BASE_NS (0x4001B000u) - /** Peripheral CACHE64_CTRL0 base pointer */ - #define CACHE64_CTRL0 ((CACHE64_CTRL_Type *)CACHE64_CTRL0_BASE) - /** Peripheral CACHE64_CTRL0 base pointer */ - #define CACHE64_CTRL0_NS ((CACHE64_CTRL_Type *)CACHE64_CTRL0_BASE_NS) - /** Array initializer of CACHE64_CTRL peripheral base addresses */ - #define CACHE64_CTRL_BASE_ADDRS { CACHE64_CTRL0_BASE } - /** Array initializer of CACHE64_CTRL peripheral base pointers */ - #define CACHE64_CTRL_BASE_PTRS { CACHE64_CTRL0 } - /** Array initializer of CACHE64_CTRL peripheral base addresses */ - #define CACHE64_CTRL_BASE_ADDRS_NS { CACHE64_CTRL0_BASE_NS } - /** Array initializer of CACHE64_CTRL peripheral base pointers */ - #define CACHE64_CTRL_BASE_PTRS_NS { CACHE64_CTRL0_NS } -#else - /** Peripheral CACHE64_CTRL0 base address */ - #define CACHE64_CTRL0_BASE (0x4001B000u) - /** Peripheral CACHE64_CTRL0 base pointer */ - #define CACHE64_CTRL0 ((CACHE64_CTRL_Type *)CACHE64_CTRL0_BASE) - /** Array initializer of CACHE64_CTRL peripheral base addresses */ - #define CACHE64_CTRL_BASE_ADDRS { CACHE64_CTRL0_BASE } - /** Array initializer of CACHE64_CTRL peripheral base pointers */ - #define CACHE64_CTRL_BASE_PTRS { CACHE64_CTRL0 } -#endif -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) -/** CACHE64_CTRL physical memory base address */ - #define CACHE64_CTRL_PHYMEM_BASES { 0x18000000u, 0x90000000u, 0xB0000000u} -/** CACHE64_CTRL physical memory size */ - #define CACHE64_CTRL_PHYMEM_SIZES { 0x08000000u, 0x10000000u, 0x10000000u} -/** CACHE64_CTRL physical memory base address */ - #define CACHE64_CTRL_PHYMEM_BASES_NS { 0x08000000u, 0x80000000u, 0xA0000000u} -/** CACHE64_CTRL physical memory size */ - #define CACHE64_CTRL_PHYMEM_SIZES_NS { 0x08000000u, 0x10000000u, 0x10000000u} -#else -/** CACHE64_CTRL physical memory base address */ - #define CACHE64_CTRL_PHYMEM_BASES { 0x08000000u, 0x80000000u, 0xA0000000u} -/** CACHE64_CTRL physical memory size */ - #define CACHE64_CTRL_PHYMEM_SIZES { 0x08000000u, 0x10000000u, 0x10000000u} -#endif -/* Backward compatibility */ - - -/*! - * @} - */ /* end of group CACHE64_CTRL_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- CACHE64_POLSEL Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CACHE64_POLSEL_Peripheral_Access_Layer CACHE64_POLSEL Peripheral Access Layer - * @{ - */ - -/** CACHE64_POLSEL - Register Layout Typedef */ -typedef struct { - uint8_t RESERVED_0[20]; - __IO uint32_t REG0_TOP; /**< Region 0 Top Boundary, offset: 0x14 */ - __IO uint32_t REG1_TOP; /**< Region 1 Top Boundary, offset: 0x18 */ - __IO uint32_t POLSEL; /**< Policy Select, offset: 0x1C */ -} CACHE64_POLSEL_Type; - -/* ---------------------------------------------------------------------------- - -- CACHE64_POLSEL Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CACHE64_POLSEL_Register_Masks CACHE64_POLSEL Register Masks - * @{ - */ - -/*! @name REG0_TOP - Region 0 Top Boundary */ -/*! @{ */ - -#define CACHE64_POLSEL_REG0_TOP_REG0_TOP_MASK (0x1FFFFC00U) -#define CACHE64_POLSEL_REG0_TOP_REG0_TOP_SHIFT (10U) -/*! REG0_TOP - Upper Limit Of Region 0 */ -#define CACHE64_POLSEL_REG0_TOP_REG0_TOP(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_POLSEL_REG0_TOP_REG0_TOP_SHIFT)) & CACHE64_POLSEL_REG0_TOP_REG0_TOP_MASK) -/*! @} */ - -/*! @name REG1_TOP - Region 1 Top Boundary */ -/*! @{ */ - -#define CACHE64_POLSEL_REG1_TOP_REG1_TOP_MASK (0x1FFFFC00U) -#define CACHE64_POLSEL_REG1_TOP_REG1_TOP_SHIFT (10U) -/*! REG1_TOP - Upper Limit Of Region 1 */ -#define CACHE64_POLSEL_REG1_TOP_REG1_TOP(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_POLSEL_REG1_TOP_REG1_TOP_SHIFT)) & CACHE64_POLSEL_REG1_TOP_REG1_TOP_MASK) -/*! @} */ - -/*! @name POLSEL - Policy Select */ -/*! @{ */ - -#define CACHE64_POLSEL_POLSEL_REG0_POLICY_MASK (0x3U) -#define CACHE64_POLSEL_POLSEL_REG0_POLICY_SHIFT (0U) -/*! REG0_POLICY - Policy Select For Region 0 - * 0b00..Noncacheable - * 0b01..Write-through - * 0b10..Write-back - * 0b11..Invalid - */ -#define CACHE64_POLSEL_POLSEL_REG0_POLICY(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_POLSEL_POLSEL_REG0_POLICY_SHIFT)) & CACHE64_POLSEL_POLSEL_REG0_POLICY_MASK) - -#define CACHE64_POLSEL_POLSEL_REG1_POLICY_MASK (0xCU) -#define CACHE64_POLSEL_POLSEL_REG1_POLICY_SHIFT (2U) -/*! REG1_POLICY - Policy Select For Region 1 - * 0b00..Noncacheable - * 0b01..Write-through - * 0b10..Write-back - * 0b11..Invalid - */ -#define CACHE64_POLSEL_POLSEL_REG1_POLICY(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_POLSEL_POLSEL_REG1_POLICY_SHIFT)) & CACHE64_POLSEL_POLSEL_REG1_POLICY_MASK) - -#define CACHE64_POLSEL_POLSEL_REG2_POLICY_MASK (0x30U) -#define CACHE64_POLSEL_POLSEL_REG2_POLICY_SHIFT (4U) -/*! REG2_POLICY - Policy Select For Region 2 - * 0b00..Noncacheable - * 0b01..Write-through - * 0b10..Write-back - * 0b11..Invalid - */ -#define CACHE64_POLSEL_POLSEL_REG2_POLICY(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_POLSEL_POLSEL_REG2_POLICY_SHIFT)) & CACHE64_POLSEL_POLSEL_REG2_POLICY_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group CACHE64_POLSEL_Register_Masks */ - - -/* CACHE64_POLSEL - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral CACHE64_POLSEL0 base address */ - #define CACHE64_POLSEL0_BASE (0x5001B000u) - /** Peripheral CACHE64_POLSEL0 base address */ - #define CACHE64_POLSEL0_BASE_NS (0x4001B000u) - /** Peripheral CACHE64_POLSEL0 base pointer */ - #define CACHE64_POLSEL0 ((CACHE64_POLSEL_Type *)CACHE64_POLSEL0_BASE) - /** Peripheral CACHE64_POLSEL0 base pointer */ - #define CACHE64_POLSEL0_NS ((CACHE64_POLSEL_Type *)CACHE64_POLSEL0_BASE_NS) - /** Array initializer of CACHE64_POLSEL peripheral base addresses */ - #define CACHE64_POLSEL_BASE_ADDRS { CACHE64_POLSEL0_BASE } - /** Array initializer of CACHE64_POLSEL peripheral base pointers */ - #define CACHE64_POLSEL_BASE_PTRS { CACHE64_POLSEL0 } - /** Array initializer of CACHE64_POLSEL peripheral base addresses */ - #define CACHE64_POLSEL_BASE_ADDRS_NS { CACHE64_POLSEL0_BASE_NS } - /** Array initializer of CACHE64_POLSEL peripheral base pointers */ - #define CACHE64_POLSEL_BASE_PTRS_NS { CACHE64_POLSEL0_NS } -#else - /** Peripheral CACHE64_POLSEL0 base address */ - #define CACHE64_POLSEL0_BASE (0x4001B000u) - /** Peripheral CACHE64_POLSEL0 base pointer */ - #define CACHE64_POLSEL0 ((CACHE64_POLSEL_Type *)CACHE64_POLSEL0_BASE) - /** Array initializer of CACHE64_POLSEL peripheral base addresses */ - #define CACHE64_POLSEL_BASE_ADDRS { CACHE64_POLSEL0_BASE } - /** Array initializer of CACHE64_POLSEL peripheral base pointers */ - #define CACHE64_POLSEL_BASE_PTRS { CACHE64_POLSEL0 } -#endif - -/*! - * @} - */ /* end of group CACHE64_POLSEL_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- CAN Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CAN_Peripheral_Access_Layer CAN Peripheral Access Layer - * @{ - */ - -/** CAN - Register Layout Typedef */ -typedef struct { - __IO uint32_t MCR; /**< Module Configuration, offset: 0x0 */ - __IO uint32_t CTRL1; /**< Control 1, offset: 0x4 */ - __IO uint32_t TIMER; /**< Free-Running Timer, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __IO uint32_t RXMGMASK; /**< RX Message Buffers Global Mask, offset: 0x10 */ - __IO uint32_t RX14MASK; /**< Receive 14 Mask, offset: 0x14 */ - __IO uint32_t RX15MASK; /**< Receive 15 Mask, offset: 0x18 */ - __IO uint32_t ECR; /**< Error Counter, offset: 0x1C */ - __IO uint32_t ESR1; /**< Error and Status 1, offset: 0x20 */ - uint8_t RESERVED_1[4]; - __IO uint32_t IMASK1; /**< Interrupt Masks 1, offset: 0x28 */ - uint8_t RESERVED_2[4]; - __IO uint32_t IFLAG1; /**< Interrupt Flags 1, offset: 0x30 */ - __IO uint32_t CTRL2; /**< Control 2, offset: 0x34 */ - __I uint32_t ESR2; /**< Error and Status 2, offset: 0x38 */ - uint8_t RESERVED_3[8]; - __I uint32_t CRCR; /**< Cyclic Redundancy Check, offset: 0x44 */ - __IO uint32_t RXFGMASK; /**< Legacy RX FIFO Global Mask, offset: 0x48 */ - __I uint32_t RXFIR; /**< Legacy RX FIFO Information, offset: 0x4C */ - __IO uint32_t CBT; /**< CAN Bit Timing, offset: 0x50 */ - uint8_t RESERVED_4[44]; - union { /* offset: 0x80 */ - struct { /* offset: 0x80, array step: 0x10 */ - __IO uint32_t CS; /**< Message Buffer 0 CS Register..Message Buffer 31 CS Register, array offset: 0x80, array step: 0x10 */ - __IO uint32_t ID; /**< Message Buffer 0 ID Register..Message Buffer 31 ID Register, array offset: 0x84, array step: 0x10 */ - __IO uint32_t WORD[2]; /**< Message Buffer 0 WORD_8B Register..Message Buffer 31 WORD_8B Register, array offset: 0x88, array step: index*0x10, index2*0x4 */ - } MB_8B[32]; - struct { /* offset: 0x80, array step: 0x18 */ - __IO uint32_t CS; /**< Message Buffer 0 CS Register..Message Buffer 20 CS Register, array offset: 0x80, array step: 0x18 */ - __IO uint32_t ID; /**< Message Buffer 0 ID Register..Message Buffer 20 ID Register, array offset: 0x84, array step: 0x18 */ - __IO uint32_t WORD[4]; /**< Message Buffer 0 WORD_16B Register..Message Buffer 20 WORD_16B Register, array offset: 0x88, array step: index*0x18, index2*0x4 */ - } MB_16B[21]; - struct { /* offset: 0x80, array step: 0x28 */ - __IO uint32_t CS; /**< Message Buffer 0 CS Register..Message Buffer 11 CS Register, array offset: 0x80, array step: 0x28 */ - __IO uint32_t ID; /**< Message Buffer 0 ID Register..Message Buffer 11 ID Register, array offset: 0x84, array step: 0x28 */ - __IO uint32_t WORD[8]; /**< Message Buffer 0 WORD_32B Register..Message Buffer 11 WORD_32B Register, array offset: 0x88, array step: index*0x28, index2*0x4 */ - } MB_32B[12]; - struct { /* offset: 0x80, array step: 0x48 */ - __IO uint32_t CS; /**< Message Buffer 0 CS Register..Message Buffer 6 CS Register, array offset: 0x80, array step: 0x48 */ - __IO uint32_t ID; /**< Message Buffer 0 ID Register..Message Buffer 6 ID Register, array offset: 0x84, array step: 0x48 */ - __IO uint32_t WORD[16]; /**< Message Buffer 0 WORD_64B Register..Message Buffer 6 WORD_64B Register, array offset: 0x88, array step: index*0x48, index2*0x4 */ - } MB_64B[7]; - struct { /* offset: 0x80, array step: 0x10 */ - __IO uint32_t CS; /**< Message Buffer 0 CS Register..Message Buffer 31 CS Register, array offset: 0x80, array step: 0x10 */ - __IO uint32_t ID; /**< Message Buffer 0 ID Register..Message Buffer 31 ID Register, array offset: 0x84, array step: 0x10 */ - __IO uint32_t WORD0; /**< Message Buffer 0 WORD0 Register..Message Buffer 31 WORD0 Register, array offset: 0x88, array step: 0x10 */ - __IO uint32_t WORD1; /**< Message Buffer 0 WORD1 Register..Message Buffer 31 WORD1 Register, array offset: 0x8C, array step: 0x10 */ - } MB[32]; - }; - uint8_t RESERVED_5[1536]; - __IO uint32_t RXIMR[32]; /**< Receive Individual Mask, array offset: 0x880, array step: 0x4 */ - uint8_t RESERVED_6[512]; - __IO uint32_t CTRL1_PN; /**< Pretended Networking Control 1, offset: 0xB00 */ - __IO uint32_t CTRL2_PN; /**< Pretended Networking Control 2, offset: 0xB04 */ - __IO uint32_t WU_MTC; /**< Pretended Networking Wake-Up Match, offset: 0xB08 */ - __IO uint32_t FLT_ID1; /**< Pretended Networking ID Filter 1, offset: 0xB0C */ - __IO uint32_t FLT_DLC; /**< Pretended Networking Data Length Code (DLC) Filter, offset: 0xB10 */ - __IO uint32_t PL1_LO; /**< Pretended Networking Payload Low Filter 1, offset: 0xB14 */ - __IO uint32_t PL1_HI; /**< Pretended Networking Payload High Filter 1, offset: 0xB18 */ - __IO uint32_t FLT_ID2_IDMASK; /**< Pretended Networking ID Filter 2 or ID Mask, offset: 0xB1C */ - __IO uint32_t PL2_PLMASK_LO; /**< Pretended Networking Payload Low Filter 2 and Payload Low Mask, offset: 0xB20 */ - __IO uint32_t PL2_PLMASK_HI; /**< Pretended Networking Payload High Filter 2 and Payload High Mask, offset: 0xB24 */ - uint8_t RESERVED_7[24]; - struct { /* offset: 0xB40, array step: 0x10 */ - __I uint32_t CS; /**< Wake-Up Message Buffer, array offset: 0xB40, array step: 0x10 */ - __I uint32_t ID; /**< Wake-Up Message Buffer for ID, array offset: 0xB44, array step: 0x10 */ - __I uint32_t D03; /**< Wake-Up Message Buffer for Data 0-3, array offset: 0xB48, array step: 0x10 */ - __I uint32_t D47; /**< Wake-Up Message Buffer Register Data 4-7, array offset: 0xB4C, array step: 0x10 */ - } WMB[4]; - uint8_t RESERVED_8[112]; - __IO uint32_t EPRS; /**< Enhanced CAN Bit Timing Prescalers, offset: 0xBF0 */ - __IO uint32_t ENCBT; /**< Enhanced Nominal CAN Bit Timing, offset: 0xBF4 */ - __IO uint32_t EDCBT; /**< Enhanced Data Phase CAN Bit Timing, offset: 0xBF8 */ - __IO uint32_t ETDC; /**< Enhanced Transceiver Delay Compensation, offset: 0xBFC */ - __IO uint32_t FDCTRL; /**< CAN FD Control, offset: 0xC00 */ - __IO uint32_t FDCBT; /**< CAN FD Bit Timing, offset: 0xC04 */ - __I uint32_t FDCRC; /**< CAN FD CRC, offset: 0xC08 */ - __IO uint32_t ERFCR; /**< Enhanced RX FIFO Control, offset: 0xC0C */ - __IO uint32_t ERFIER; /**< Enhanced RX FIFO Interrupt Enable, offset: 0xC10 */ - __IO uint32_t ERFSR; /**< Enhanced RX FIFO Status, offset: 0xC14 */ - uint8_t RESERVED_9[9192]; - __IO uint32_t ERFFEL[32]; /**< Enhanced RX FIFO Filter Element, array offset: 0x3000, array step: 0x4 */ -} CAN_Type; - -/* ---------------------------------------------------------------------------- - -- CAN Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CAN_Register_Masks CAN Register Masks - * @{ - */ - -/*! @name MCR - Module Configuration */ -/*! @{ */ - -#define CAN_MCR_MAXMB_MASK (0x7FU) -#define CAN_MCR_MAXMB_SHIFT (0U) -/*! MAXMB - Number of the Last Message Buffer */ -#define CAN_MCR_MAXMB(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_MAXMB_SHIFT)) & CAN_MCR_MAXMB_MASK) - -#define CAN_MCR_IDAM_MASK (0x300U) -#define CAN_MCR_IDAM_SHIFT (8U) -/*! IDAM - ID Acceptance Mode - * 0b00..Format A: One full ID (standard and extended) per ID filter table element. - * 0b01..Format B: Two full standard IDs or two partial 14-bit (standard and extended) IDs per ID filter table element. - * 0b10..Format C: Four partial 8-bit standard IDs per ID filter table element. - * 0b11..Format D: All frames rejected. - */ -#define CAN_MCR_IDAM(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_IDAM_SHIFT)) & CAN_MCR_IDAM_MASK) - -#define CAN_MCR_FDEN_MASK (0x800U) -#define CAN_MCR_FDEN_SHIFT (11U) -/*! FDEN - CAN FD Operation Enable - * 0b1..Enable - * 0b0..Disable - */ -#define CAN_MCR_FDEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_FDEN_SHIFT)) & CAN_MCR_FDEN_MASK) - -#define CAN_MCR_AEN_MASK (0x1000U) -#define CAN_MCR_AEN_SHIFT (12U) -/*! AEN - Abort Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define CAN_MCR_AEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_AEN_SHIFT)) & CAN_MCR_AEN_MASK) - -#define CAN_MCR_LPRIOEN_MASK (0x2000U) -#define CAN_MCR_LPRIOEN_SHIFT (13U) -/*! LPRIOEN - Local Priority Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_LPRIOEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_LPRIOEN_SHIFT)) & CAN_MCR_LPRIOEN_MASK) - -#define CAN_MCR_PNET_EN_MASK (0x4000U) -#define CAN_MCR_PNET_EN_SHIFT (14U) -/*! PNET_EN - Pretended Networking Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_PNET_EN(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_PNET_EN_SHIFT)) & CAN_MCR_PNET_EN_MASK) - -#define CAN_MCR_DMA_MASK (0x8000U) -#define CAN_MCR_DMA_SHIFT (15U) -/*! DMA - DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_DMA(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_DMA_SHIFT)) & CAN_MCR_DMA_MASK) - -#define CAN_MCR_IRMQ_MASK (0x10000U) -#define CAN_MCR_IRMQ_SHIFT (16U) -/*! IRMQ - Individual RX Masking and Queue Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_IRMQ(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_IRMQ_SHIFT)) & CAN_MCR_IRMQ_MASK) - -#define CAN_MCR_SRXDIS_MASK (0x20000U) -#define CAN_MCR_SRXDIS_SHIFT (17U) -/*! SRXDIS - Self-Reception Disable - * 0b0..Enable - * 0b1..Disable - */ -#define CAN_MCR_SRXDIS(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_SRXDIS_SHIFT)) & CAN_MCR_SRXDIS_MASK) - -#define CAN_MCR_WAKSRC_MASK (0x80000U) -#define CAN_MCR_WAKSRC_SHIFT (19U) -/*! WAKSRC - Wake-Up Source - * 0b0..No filter applied - * 0b1..Filter applied - */ -#define CAN_MCR_WAKSRC(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_WAKSRC_SHIFT)) & CAN_MCR_WAKSRC_MASK) - -#define CAN_MCR_LPMACK_MASK (0x100000U) -#define CAN_MCR_LPMACK_SHIFT (20U) -/*! LPMACK - Low-Power Mode Acknowledge - * 0b0..Not in a low-power mode - * 0b1..In a low-power mode - */ -#define CAN_MCR_LPMACK(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_LPMACK_SHIFT)) & CAN_MCR_LPMACK_MASK) - -#define CAN_MCR_WRNEN_MASK (0x200000U) -#define CAN_MCR_WRNEN_SHIFT (21U) -/*! WRNEN - Warning Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_WRNEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_WRNEN_SHIFT)) & CAN_MCR_WRNEN_MASK) - -#define CAN_MCR_SLFWAK_MASK (0x400000U) -#define CAN_MCR_SLFWAK_SHIFT (22U) -/*! SLFWAK - Self Wake-up - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_SLFWAK(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_SLFWAK_SHIFT)) & CAN_MCR_SLFWAK_MASK) - -#define CAN_MCR_FRZACK_MASK (0x1000000U) -#define CAN_MCR_FRZACK_SHIFT (24U) -/*! FRZACK - Freeze Mode Acknowledge - * 0b0..Not in Freeze mode, prescaler running. - * 0b1..In Freeze mode, prescaler stopped. - */ -#define CAN_MCR_FRZACK(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_FRZACK_SHIFT)) & CAN_MCR_FRZACK_MASK) - -#define CAN_MCR_SOFTRST_MASK (0x2000000U) -#define CAN_MCR_SOFTRST_SHIFT (25U) -/*! SOFTRST - Soft Reset - * 0b0..No reset - * 0b1..Soft reset affects reset registers - */ -#define CAN_MCR_SOFTRST(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_SOFTRST_SHIFT)) & CAN_MCR_SOFTRST_MASK) - -#define CAN_MCR_WAKMSK_MASK (0x4000000U) -#define CAN_MCR_WAKMSK_SHIFT (26U) -/*! WAKMSK - Wake-up Interrupt Mask - * 0b0..Disabled - * 0b1..Enabled - */ -#define CAN_MCR_WAKMSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_WAKMSK_SHIFT)) & CAN_MCR_WAKMSK_MASK) - -#define CAN_MCR_NOTRDY_MASK (0x8000000U) -#define CAN_MCR_NOTRDY_SHIFT (27U) -/*! NOTRDY - FlexCAN Not Ready - * 0b0..FlexCAN is in Normal mode, Listen-Only mode, or Loopback mode. - * 0b1..FlexCAN is in Disable mode, Stop mode, or Freeze mode. - */ -#define CAN_MCR_NOTRDY(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_NOTRDY_SHIFT)) & CAN_MCR_NOTRDY_MASK) - -#define CAN_MCR_HALT_MASK (0x10000000U) -#define CAN_MCR_HALT_SHIFT (28U) -/*! HALT - Halt FlexCAN - * 0b0..No request - * 0b1..Enter Freeze mode, if MCR[FRZ] = 1. - */ -#define CAN_MCR_HALT(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_HALT_SHIFT)) & CAN_MCR_HALT_MASK) - -#define CAN_MCR_RFEN_MASK (0x20000000U) -#define CAN_MCR_RFEN_SHIFT (29U) -/*! RFEN - Legacy RX FIFO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_RFEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_RFEN_SHIFT)) & CAN_MCR_RFEN_MASK) - -#define CAN_MCR_FRZ_MASK (0x40000000U) -#define CAN_MCR_FRZ_SHIFT (30U) -/*! FRZ - Freeze Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_FRZ(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_FRZ_SHIFT)) & CAN_MCR_FRZ_MASK) - -#define CAN_MCR_MDIS_MASK (0x80000000U) -#define CAN_MCR_MDIS_SHIFT (31U) -/*! MDIS - Module Disable - * 0b0..Enable - * 0b1..Disable - */ -#define CAN_MCR_MDIS(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_MDIS_SHIFT)) & CAN_MCR_MDIS_MASK) -/*! @} */ - -/*! @name CTRL1 - Control 1 */ -/*! @{ */ - -#define CAN_CTRL1_PROPSEG_MASK (0x7U) -#define CAN_CTRL1_PROPSEG_SHIFT (0U) -/*! PROPSEG - Propagation Segment */ -#define CAN_CTRL1_PROPSEG(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PROPSEG_SHIFT)) & CAN_CTRL1_PROPSEG_MASK) - -#define CAN_CTRL1_LOM_MASK (0x8U) -#define CAN_CTRL1_LOM_SHIFT (3U) -/*! LOM - Listen-Only Mode - * 0b0..Listen-Only mode is deactivated. - * 0b1..FlexCAN module operates in Listen-Only mode. - */ -#define CAN_CTRL1_LOM(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_LOM_SHIFT)) & CAN_CTRL1_LOM_MASK) - -#define CAN_CTRL1_LBUF_MASK (0x10U) -#define CAN_CTRL1_LBUF_SHIFT (4U) -/*! LBUF - Lowest Buffer Transmitted First - * 0b0..Buffer with highest priority is transmitted first. - * 0b1..Lowest number buffer is transmitted first. - */ -#define CAN_CTRL1_LBUF(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_LBUF_SHIFT)) & CAN_CTRL1_LBUF_MASK) - -#define CAN_CTRL1_TSYN_MASK (0x20U) -#define CAN_CTRL1_TSYN_SHIFT (5U) -/*! TSYN - Timer Sync - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL1_TSYN(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_TSYN_SHIFT)) & CAN_CTRL1_TSYN_MASK) - -#define CAN_CTRL1_BOFFREC_MASK (0x40U) -#define CAN_CTRL1_BOFFREC_SHIFT (6U) -/*! BOFFREC - Bus Off Recovery - * 0b0..Enabled - * 0b1..Disabled - */ -#define CAN_CTRL1_BOFFREC(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_BOFFREC_SHIFT)) & CAN_CTRL1_BOFFREC_MASK) - -#define CAN_CTRL1_SMP_MASK (0x80U) -#define CAN_CTRL1_SMP_SHIFT (7U) -/*! SMP - CAN Bit Sampling - * 0b0..One sample is used to determine the bit value. - * 0b1..Three samples are used to determine the value of the received bit: the regular one (sample point) and two - * preceding samples. A majority rule is used. - */ -#define CAN_CTRL1_SMP(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_SMP_SHIFT)) & CAN_CTRL1_SMP_MASK) - -#define CAN_CTRL1_RWRNMSK_MASK (0x400U) -#define CAN_CTRL1_RWRNMSK_SHIFT (10U) -/*! RWRNMSK - RX Warning Interrupt Mask - * 0b0..Disabled - * 0b1..Enabled - */ -#define CAN_CTRL1_RWRNMSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_RWRNMSK_SHIFT)) & CAN_CTRL1_RWRNMSK_MASK) - -#define CAN_CTRL1_TWRNMSK_MASK (0x800U) -#define CAN_CTRL1_TWRNMSK_SHIFT (11U) -/*! TWRNMSK - TX Warning Interrupt Mask - * 0b0..Disabled - * 0b1..Enabled - */ -#define CAN_CTRL1_TWRNMSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_TWRNMSK_SHIFT)) & CAN_CTRL1_TWRNMSK_MASK) - -#define CAN_CTRL1_LPB_MASK (0x1000U) -#define CAN_CTRL1_LPB_SHIFT (12U) -/*! LPB - Loopback Mode - * 0b0..Disabled - * 0b1..Enabled - */ -#define CAN_CTRL1_LPB(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_LPB_SHIFT)) & CAN_CTRL1_LPB_MASK) - -#define CAN_CTRL1_ERRMSK_MASK (0x4000U) -#define CAN_CTRL1_ERRMSK_SHIFT (14U) -/*! ERRMSK - Error Interrupt Mask - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CAN_CTRL1_ERRMSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_ERRMSK_SHIFT)) & CAN_CTRL1_ERRMSK_MASK) - -#define CAN_CTRL1_BOFFMSK_MASK (0x8000U) -#define CAN_CTRL1_BOFFMSK_SHIFT (15U) -/*! BOFFMSK - Bus Off Interrupt Mask - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CAN_CTRL1_BOFFMSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_BOFFMSK_SHIFT)) & CAN_CTRL1_BOFFMSK_MASK) - -#define CAN_CTRL1_PSEG2_MASK (0x70000U) -#define CAN_CTRL1_PSEG2_SHIFT (16U) -/*! PSEG2 - Phase Segment 2 */ -#define CAN_CTRL1_PSEG2(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PSEG2_SHIFT)) & CAN_CTRL1_PSEG2_MASK) - -#define CAN_CTRL1_PSEG1_MASK (0x380000U) -#define CAN_CTRL1_PSEG1_SHIFT (19U) -/*! PSEG1 - Phase Segment 1 */ -#define CAN_CTRL1_PSEG1(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PSEG1_SHIFT)) & CAN_CTRL1_PSEG1_MASK) - -#define CAN_CTRL1_RJW_MASK (0xC00000U) -#define CAN_CTRL1_RJW_SHIFT (22U) -/*! RJW - Resync Jump Width */ -#define CAN_CTRL1_RJW(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_RJW_SHIFT)) & CAN_CTRL1_RJW_MASK) - -#define CAN_CTRL1_PRESDIV_MASK (0xFF000000U) -#define CAN_CTRL1_PRESDIV_SHIFT (24U) -/*! PRESDIV - Prescaler Division Factor */ -#define CAN_CTRL1_PRESDIV(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PRESDIV_SHIFT)) & CAN_CTRL1_PRESDIV_MASK) -/*! @} */ - -/*! @name TIMER - Free-Running Timer */ -/*! @{ */ - -#define CAN_TIMER_TIMER_MASK (0xFFFFU) -#define CAN_TIMER_TIMER_SHIFT (0U) -/*! TIMER - Timer Value */ -#define CAN_TIMER_TIMER(x) (((uint32_t)(((uint32_t)(x)) << CAN_TIMER_TIMER_SHIFT)) & CAN_TIMER_TIMER_MASK) -/*! @} */ - -/*! @name RXMGMASK - RX Message Buffers Global Mask */ -/*! @{ */ - -#define CAN_RXMGMASK_MG_MASK (0xFFFFFFFFU) -#define CAN_RXMGMASK_MG_SHIFT (0U) -/*! MG - Global Mask for RX Message Buffers */ -#define CAN_RXMGMASK_MG(x) (((uint32_t)(((uint32_t)(x)) << CAN_RXMGMASK_MG_SHIFT)) & CAN_RXMGMASK_MG_MASK) -/*! @} */ - -/*! @name RX14MASK - Receive 14 Mask */ -/*! @{ */ - -#define CAN_RX14MASK_RX14M_MASK (0xFFFFFFFFU) -#define CAN_RX14MASK_RX14M_SHIFT (0U) -/*! RX14M - RX Buffer 14 Mask Bits */ -#define CAN_RX14MASK_RX14M(x) (((uint32_t)(((uint32_t)(x)) << CAN_RX14MASK_RX14M_SHIFT)) & CAN_RX14MASK_RX14M_MASK) -/*! @} */ - -/*! @name RX15MASK - Receive 15 Mask */ -/*! @{ */ - -#define CAN_RX15MASK_RX15M_MASK (0xFFFFFFFFU) -#define CAN_RX15MASK_RX15M_SHIFT (0U) -/*! RX15M - RX Buffer 15 Mask Bits */ -#define CAN_RX15MASK_RX15M(x) (((uint32_t)(((uint32_t)(x)) << CAN_RX15MASK_RX15M_SHIFT)) & CAN_RX15MASK_RX15M_MASK) -/*! @} */ - -/*! @name ECR - Error Counter */ -/*! @{ */ - -#define CAN_ECR_TXERRCNT_MASK (0xFFU) -#define CAN_ECR_TXERRCNT_SHIFT (0U) -/*! TXERRCNT - Transmit Error Counter */ -#define CAN_ECR_TXERRCNT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ECR_TXERRCNT_SHIFT)) & CAN_ECR_TXERRCNT_MASK) - -#define CAN_ECR_RXERRCNT_MASK (0xFF00U) -#define CAN_ECR_RXERRCNT_SHIFT (8U) -/*! RXERRCNT - Receive Error Counter */ -#define CAN_ECR_RXERRCNT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ECR_RXERRCNT_SHIFT)) & CAN_ECR_RXERRCNT_MASK) - -#define CAN_ECR_TXERRCNT_FAST_MASK (0xFF0000U) -#define CAN_ECR_TXERRCNT_FAST_SHIFT (16U) -/*! TXERRCNT_FAST - Transmit Error Counter for Fast Bits */ -#define CAN_ECR_TXERRCNT_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ECR_TXERRCNT_FAST_SHIFT)) & CAN_ECR_TXERRCNT_FAST_MASK) - -#define CAN_ECR_RXERRCNT_FAST_MASK (0xFF000000U) -#define CAN_ECR_RXERRCNT_FAST_SHIFT (24U) -/*! RXERRCNT_FAST - Receive Error Counter for Fast Bits */ -#define CAN_ECR_RXERRCNT_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ECR_RXERRCNT_FAST_SHIFT)) & CAN_ECR_RXERRCNT_FAST_MASK) -/*! @} */ - -/*! @name ESR1 - Error and Status 1 */ -/*! @{ */ - -#define CAN_ESR1_WAKINT_MASK (0x1U) -#define CAN_ESR1_WAKINT_SHIFT (0U) -/*! WAKINT - Wake-up Interrupt Flag - * 0b0..No such occurrence. - * 0b1..Indicates that a recessive-to-dominant transition was received on the CAN bus. - */ -#define CAN_ESR1_WAKINT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_WAKINT_SHIFT)) & CAN_ESR1_WAKINT_MASK) - -#define CAN_ESR1_ERRINT_MASK (0x2U) -#define CAN_ESR1_ERRINT_SHIFT (1U) -/*! ERRINT - Error Interrupt Flag - * 0b0..No such occurrence. - * 0b1..Indicates setting of any error flag in the Error and Status register. - */ -#define CAN_ESR1_ERRINT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_ERRINT_SHIFT)) & CAN_ESR1_ERRINT_MASK) - -#define CAN_ESR1_BOFFINT_MASK (0x4U) -#define CAN_ESR1_BOFFINT_SHIFT (2U) -/*! BOFFINT - Bus Off Interrupt Flag - * 0b0..No such occurrence. - * 0b1..FlexCAN module entered Bus Off state. - */ -#define CAN_ESR1_BOFFINT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_BOFFINT_SHIFT)) & CAN_ESR1_BOFFINT_MASK) - -#define CAN_ESR1_RX_MASK (0x8U) -#define CAN_ESR1_RX_SHIFT (3U) -/*! RX - FlexCAN in Reception Flag - * 0b0..Not receiving - * 0b1..Receiving - */ -#define CAN_ESR1_RX(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_RX_SHIFT)) & CAN_ESR1_RX_MASK) - -#define CAN_ESR1_FLTCONF_MASK (0x30U) -#define CAN_ESR1_FLTCONF_SHIFT (4U) -/*! FLTCONF - Fault Confinement State - * 0b00..Error Active - * 0b01..Error Passive - * 0b1x..Bus Off - */ -#define CAN_ESR1_FLTCONF(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_FLTCONF_SHIFT)) & CAN_ESR1_FLTCONF_MASK) - -#define CAN_ESR1_TX_MASK (0x40U) -#define CAN_ESR1_TX_SHIFT (6U) -/*! TX - FlexCAN In Transmission - * 0b0..Not transmitting - * 0b1..Transmitting - */ -#define CAN_ESR1_TX(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_TX_SHIFT)) & CAN_ESR1_TX_MASK) - -#define CAN_ESR1_IDLE_MASK (0x80U) -#define CAN_ESR1_IDLE_SHIFT (7U) -/*! IDLE - Idle - * 0b0..Not IDLE - * 0b1..IDLE - */ -#define CAN_ESR1_IDLE(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_IDLE_SHIFT)) & CAN_ESR1_IDLE_MASK) - -#define CAN_ESR1_RXWRN_MASK (0x100U) -#define CAN_ESR1_RXWRN_SHIFT (8U) -/*! RXWRN - RX Error Warning Flag - * 0b0..No such occurrence. - * 0b1..RXERRCNT is greater than or equal to 96. - */ -#define CAN_ESR1_RXWRN(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_RXWRN_SHIFT)) & CAN_ESR1_RXWRN_MASK) - -#define CAN_ESR1_TXWRN_MASK (0x200U) -#define CAN_ESR1_TXWRN_SHIFT (9U) -/*! TXWRN - TX Error Warning Flag - * 0b0..No such occurrence. - * 0b1..TXERRCNT is 96 or greater. - */ -#define CAN_ESR1_TXWRN(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_TXWRN_SHIFT)) & CAN_ESR1_TXWRN_MASK) - -#define CAN_ESR1_STFERR_MASK (0x400U) -#define CAN_ESR1_STFERR_SHIFT (10U) -/*! STFERR - Stuffing Error Flag - * 0b0..No error - * 0b1..Error occurred since last read of this register. - */ -#define CAN_ESR1_STFERR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_STFERR_SHIFT)) & CAN_ESR1_STFERR_MASK) - -#define CAN_ESR1_FRMERR_MASK (0x800U) -#define CAN_ESR1_FRMERR_SHIFT (11U) -/*! FRMERR - Form Error Flag - * 0b0..No error - * 0b1..Error occurred since last read of this register. - */ -#define CAN_ESR1_FRMERR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_FRMERR_SHIFT)) & CAN_ESR1_FRMERR_MASK) - -#define CAN_ESR1_CRCERR_MASK (0x1000U) -#define CAN_ESR1_CRCERR_SHIFT (12U) -/*! CRCERR - Cyclic Redundancy Check Error Flag - * 0b0..No error - * 0b1..Error occurred since last read of this register. - */ -#define CAN_ESR1_CRCERR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_CRCERR_SHIFT)) & CAN_ESR1_CRCERR_MASK) - -#define CAN_ESR1_ACKERR_MASK (0x2000U) -#define CAN_ESR1_ACKERR_SHIFT (13U) -/*! ACKERR - Acknowledge Error Flag - * 0b0..No error - * 0b1..Error occurred since last read of this register. - */ -#define CAN_ESR1_ACKERR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_ACKERR_SHIFT)) & CAN_ESR1_ACKERR_MASK) - -#define CAN_ESR1_BIT0ERR_MASK (0x4000U) -#define CAN_ESR1_BIT0ERR_SHIFT (14U) -/*! BIT0ERR - Bit0 Error Flag - * 0b0..No such occurrence. - * 0b1..At least one bit sent as dominant is received as recessive. - */ -#define CAN_ESR1_BIT0ERR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_BIT0ERR_SHIFT)) & CAN_ESR1_BIT0ERR_MASK) - -#define CAN_ESR1_BIT1ERR_MASK (0x8000U) -#define CAN_ESR1_BIT1ERR_SHIFT (15U) -/*! BIT1ERR - Bit1 Error Flag - * 0b0..No such occurrence. - * 0b1..At least one bit sent as recessive is received as dominant. - */ -#define CAN_ESR1_BIT1ERR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_BIT1ERR_SHIFT)) & CAN_ESR1_BIT1ERR_MASK) - -#define CAN_ESR1_RWRNINT_MASK (0x10000U) -#define CAN_ESR1_RWRNINT_SHIFT (16U) -/*! RWRNINT - RX Warning Interrupt Flag - * 0b0..No such occurrence - * 0b1..RX error counter changed from less than 96 to greater than or equal to 96. - */ -#define CAN_ESR1_RWRNINT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_RWRNINT_SHIFT)) & CAN_ESR1_RWRNINT_MASK) - -#define CAN_ESR1_TWRNINT_MASK (0x20000U) -#define CAN_ESR1_TWRNINT_SHIFT (17U) -/*! TWRNINT - TX Warning Interrupt Flag - * 0b0..No such occurrence - * 0b1..TX error counter changed from less than 96 to greater than or equal to 96. - */ -#define CAN_ESR1_TWRNINT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_TWRNINT_SHIFT)) & CAN_ESR1_TWRNINT_MASK) - -#define CAN_ESR1_SYNCH_MASK (0x40000U) -#define CAN_ESR1_SYNCH_SHIFT (18U) -/*! SYNCH - CAN Synchronization Status Flag - * 0b0..Not synchronized - * 0b1..Synchronized - */ -#define CAN_ESR1_SYNCH(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_SYNCH_SHIFT)) & CAN_ESR1_SYNCH_MASK) - -#define CAN_ESR1_BOFFDONEINT_MASK (0x80000U) -#define CAN_ESR1_BOFFDONEINT_SHIFT (19U) -/*! BOFFDONEINT - Bus Off Done Interrupt Flag - * 0b0..No such occurrence - * 0b1..FlexCAN module has completed Bus Off process. - */ -#define CAN_ESR1_BOFFDONEINT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_BOFFDONEINT_SHIFT)) & CAN_ESR1_BOFFDONEINT_MASK) - -#define CAN_ESR1_ERRINT_FAST_MASK (0x100000U) -#define CAN_ESR1_ERRINT_FAST_SHIFT (20U) -/*! ERRINT_FAST - Fast Error Interrupt Flag - * 0b0..No such occurrence. - * 0b1..Error flag set in the data phase of CAN FD frames that have BRS = 1. - */ -#define CAN_ESR1_ERRINT_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_ERRINT_FAST_SHIFT)) & CAN_ESR1_ERRINT_FAST_MASK) - -#define CAN_ESR1_ERROVR_MASK (0x200000U) -#define CAN_ESR1_ERROVR_SHIFT (21U) -/*! ERROVR - Error Overrun Flag - * 0b0..No overrun - * 0b1..Overrun - */ -#define CAN_ESR1_ERROVR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_ERROVR_SHIFT)) & CAN_ESR1_ERROVR_MASK) - -#define CAN_ESR1_STFERR_FAST_MASK (0x4000000U) -#define CAN_ESR1_STFERR_FAST_SHIFT (26U) -/*! STFERR_FAST - Fast Stuffing Error Flag - * 0b0..No such occurrence. - * 0b1..A stuffing error occurred since last read of this register. - */ -#define CAN_ESR1_STFERR_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_STFERR_FAST_SHIFT)) & CAN_ESR1_STFERR_FAST_MASK) - -#define CAN_ESR1_FRMERR_FAST_MASK (0x8000000U) -#define CAN_ESR1_FRMERR_FAST_SHIFT (27U) -/*! FRMERR_FAST - Fast Form Error Flag - * 0b0..No such occurrence. - * 0b1..A form error occurred since last read of this register. - */ -#define CAN_ESR1_FRMERR_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_FRMERR_FAST_SHIFT)) & CAN_ESR1_FRMERR_FAST_MASK) - -#define CAN_ESR1_CRCERR_FAST_MASK (0x10000000U) -#define CAN_ESR1_CRCERR_FAST_SHIFT (28U) -/*! CRCERR_FAST - Fast Cyclic Redundancy Check Error Flag - * 0b0..No such occurrence. - * 0b1..A CRC error occurred since last read of this register. - */ -#define CAN_ESR1_CRCERR_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_CRCERR_FAST_SHIFT)) & CAN_ESR1_CRCERR_FAST_MASK) - -#define CAN_ESR1_BIT0ERR_FAST_MASK (0x40000000U) -#define CAN_ESR1_BIT0ERR_FAST_SHIFT (30U) -/*! BIT0ERR_FAST - Fast Bit0 Error Flag - * 0b0..No such occurrence. - * 0b1..At least one bit transmitted as dominant is received as recessive. - */ -#define CAN_ESR1_BIT0ERR_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_BIT0ERR_FAST_SHIFT)) & CAN_ESR1_BIT0ERR_FAST_MASK) - -#define CAN_ESR1_BIT1ERR_FAST_MASK (0x80000000U) -#define CAN_ESR1_BIT1ERR_FAST_SHIFT (31U) -/*! BIT1ERR_FAST - Fast Bit1 Error Flag - * 0b0..No such occurrence. - * 0b1..At least one bit transmitted as recessive is received as dominant. - */ -#define CAN_ESR1_BIT1ERR_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_BIT1ERR_FAST_SHIFT)) & CAN_ESR1_BIT1ERR_FAST_MASK) -/*! @} */ - -/*! @name IMASK1 - Interrupt Masks 1 */ -/*! @{ */ - -#define CAN_IMASK1_BUF31TO0M_MASK (0xFFFFFFFFU) -#define CAN_IMASK1_BUF31TO0M_SHIFT (0U) -/*! BUF31TO0M - Buffer MBi Mask */ -#define CAN_IMASK1_BUF31TO0M(x) (((uint32_t)(((uint32_t)(x)) << CAN_IMASK1_BUF31TO0M_SHIFT)) & CAN_IMASK1_BUF31TO0M_MASK) -/*! @} */ - -/*! @name IFLAG1 - Interrupt Flags 1 */ -/*! @{ */ - -#define CAN_IFLAG1_BUF0I_MASK (0x1U) -#define CAN_IFLAG1_BUF0I_SHIFT (0U) -/*! BUF0I - Buffer MB0 Interrupt or Clear Legacy FIFO bit - * 0b0..MB0 has no occurrence of successfully completed transmission or reception. - * 0b1..MB0 has successfully completed transmission or reception. - */ -#define CAN_IFLAG1_BUF0I(x) (((uint32_t)(((uint32_t)(x)) << CAN_IFLAG1_BUF0I_SHIFT)) & CAN_IFLAG1_BUF0I_MASK) - -#define CAN_IFLAG1_BUF4TO1I_MASK (0x1EU) -#define CAN_IFLAG1_BUF4TO1I_SHIFT (1U) -/*! BUF4TO1I - Buffer MBi Interrupt or Reserved */ -#define CAN_IFLAG1_BUF4TO1I(x) (((uint32_t)(((uint32_t)(x)) << CAN_IFLAG1_BUF4TO1I_SHIFT)) & CAN_IFLAG1_BUF4TO1I_MASK) - -#define CAN_IFLAG1_BUF5I_MASK (0x20U) -#define CAN_IFLAG1_BUF5I_SHIFT (5U) -/*! BUF5I - Buffer MB5 Interrupt or Frames available in Legacy RX FIFO - * 0b0..No occurrence of completed transmission or reception, or no frames available - * 0b1..MB5 completed transmission or reception, or frames available - */ -#define CAN_IFLAG1_BUF5I(x) (((uint32_t)(((uint32_t)(x)) << CAN_IFLAG1_BUF5I_SHIFT)) & CAN_IFLAG1_BUF5I_MASK) - -#define CAN_IFLAG1_BUF6I_MASK (0x40U) -#define CAN_IFLAG1_BUF6I_SHIFT (6U) -/*! BUF6I - Buffer MB6 Interrupt or Legacy RX FIFO Warning - * 0b0..No occurrence of MB6 completing transmission or reception, or FIFO not almost full. - * 0b1..MB6 completed transmission or reception, or FIFO almost full. - */ -#define CAN_IFLAG1_BUF6I(x) (((uint32_t)(((uint32_t)(x)) << CAN_IFLAG1_BUF6I_SHIFT)) & CAN_IFLAG1_BUF6I_MASK) - -#define CAN_IFLAG1_BUF7I_MASK (0x80U) -#define CAN_IFLAG1_BUF7I_SHIFT (7U) -/*! BUF7I - Buffer MB7 Interrupt or Legacy RX FIFO Overflow - * 0b0..No occurrence of MB7 completing transmission or reception, or no FIFO overflow. - * 0b1..MB7 completed transmission or reception, or FIFO overflow. - */ -#define CAN_IFLAG1_BUF7I(x) (((uint32_t)(((uint32_t)(x)) << CAN_IFLAG1_BUF7I_SHIFT)) & CAN_IFLAG1_BUF7I_MASK) - -#define CAN_IFLAG1_BUF31TO8I_MASK (0xFFFFFF00U) -#define CAN_IFLAG1_BUF31TO8I_SHIFT (8U) -/*! BUF31TO8I - Buffer MBi Interrupt */ -#define CAN_IFLAG1_BUF31TO8I(x) (((uint32_t)(((uint32_t)(x)) << CAN_IFLAG1_BUF31TO8I_SHIFT)) & CAN_IFLAG1_BUF31TO8I_MASK) -/*! @} */ - -/*! @name CTRL2 - Control 2 */ -/*! @{ */ - -#define CAN_CTRL2_EDFLTDIS_MASK (0x800U) -#define CAN_CTRL2_EDFLTDIS_SHIFT (11U) -/*! EDFLTDIS - Edge Filter Disable - * 0b0..Enabled - * 0b1..Disabled - */ -#define CAN_CTRL2_EDFLTDIS(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_EDFLTDIS_SHIFT)) & CAN_CTRL2_EDFLTDIS_MASK) - -#define CAN_CTRL2_ISOCANFDEN_MASK (0x1000U) -#define CAN_CTRL2_ISOCANFDEN_SHIFT (12U) -/*! ISOCANFDEN - ISO CAN FD Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL2_ISOCANFDEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_ISOCANFDEN_SHIFT)) & CAN_CTRL2_ISOCANFDEN_MASK) - -#define CAN_CTRL2_BTE_MASK (0x2000U) -#define CAN_CTRL2_BTE_SHIFT (13U) -/*! BTE - Bit Timing Expansion Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL2_BTE(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_BTE_SHIFT)) & CAN_CTRL2_BTE_MASK) - -#define CAN_CTRL2_PREXCEN_MASK (0x4000U) -#define CAN_CTRL2_PREXCEN_SHIFT (14U) -/*! PREXCEN - Protocol Exception Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define CAN_CTRL2_PREXCEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_PREXCEN_SHIFT)) & CAN_CTRL2_PREXCEN_MASK) - -#define CAN_CTRL2_EACEN_MASK (0x10000U) -#define CAN_CTRL2_EACEN_SHIFT (16U) -/*! EACEN - Entire Frame Arbitration Field Comparison Enable for RX Message Buffers - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL2_EACEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_EACEN_SHIFT)) & CAN_CTRL2_EACEN_MASK) - -#define CAN_CTRL2_RRS_MASK (0x20000U) -#define CAN_CTRL2_RRS_SHIFT (17U) -/*! RRS - Remote Request Storing - * 0b0..Generated - * 0b1..Stored - */ -#define CAN_CTRL2_RRS(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_RRS_SHIFT)) & CAN_CTRL2_RRS_MASK) - -#define CAN_CTRL2_MRP_MASK (0x40000U) -#define CAN_CTRL2_MRP_SHIFT (18U) -/*! MRP - Message Buffers Reception Priority - * 0b0..Matching starts from Legacy RX FIFO or Enhanced RX FIFO and continues on message buffers. - * 0b1..Matching starts from message buffers and continues on Legacy RX FIFO or Enhanced RX FIFO. - */ -#define CAN_CTRL2_MRP(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_MRP_SHIFT)) & CAN_CTRL2_MRP_MASK) - -#define CAN_CTRL2_TASD_MASK (0xF80000U) -#define CAN_CTRL2_TASD_SHIFT (19U) -/*! TASD - Transmission Arbitration Start Delay */ -#define CAN_CTRL2_TASD(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_TASD_SHIFT)) & CAN_CTRL2_TASD_MASK) - -#define CAN_CTRL2_RFFN_MASK (0xF000000U) -#define CAN_CTRL2_RFFN_SHIFT (24U) -/*! RFFN - Number of Legacy Receive FIFO Filters */ -#define CAN_CTRL2_RFFN(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_RFFN_SHIFT)) & CAN_CTRL2_RFFN_MASK) - -#define CAN_CTRL2_BOFFDONEMSK_MASK (0x40000000U) -#define CAN_CTRL2_BOFFDONEMSK_SHIFT (30U) -/*! BOFFDONEMSK - Bus Off Done Interrupt Mask - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL2_BOFFDONEMSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_BOFFDONEMSK_SHIFT)) & CAN_CTRL2_BOFFDONEMSK_MASK) - -#define CAN_CTRL2_ERRMSK_FAST_MASK (0x80000000U) -#define CAN_CTRL2_ERRMSK_FAST_SHIFT (31U) -/*! ERRMSK_FAST - Error Interrupt Mask for Errors Detected in the Data Phase of Fast CAN FD Frames - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL2_ERRMSK_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_ERRMSK_FAST_SHIFT)) & CAN_CTRL2_ERRMSK_FAST_MASK) -/*! @} */ - -/*! @name ESR2 - Error and Status 2 */ -/*! @{ */ - -#define CAN_ESR2_IMB_MASK (0x2000U) -#define CAN_ESR2_IMB_SHIFT (13U) -/*! IMB - Inactive Message Buffer - * 0b0..Message buffer indicated by ESR2[LPTM] is not inactive. - * 0b1..At least one message buffer is inactive. - */ -#define CAN_ESR2_IMB(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR2_IMB_SHIFT)) & CAN_ESR2_IMB_MASK) - -#define CAN_ESR2_VPS_MASK (0x4000U) -#define CAN_ESR2_VPS_SHIFT (14U) -/*! VPS - Valid Priority Status - * 0b0..Invalid - * 0b1..Valid - */ -#define CAN_ESR2_VPS(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR2_VPS_SHIFT)) & CAN_ESR2_VPS_MASK) - -#define CAN_ESR2_LPTM_MASK (0x7F0000U) -#define CAN_ESR2_LPTM_SHIFT (16U) -/*! LPTM - Lowest Priority TX Message Buffer */ -#define CAN_ESR2_LPTM(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR2_LPTM_SHIFT)) & CAN_ESR2_LPTM_MASK) -/*! @} */ - -/*! @name CRCR - Cyclic Redundancy Check */ -/*! @{ */ - -#define CAN_CRCR_TXCRC_MASK (0x7FFFU) -#define CAN_CRCR_TXCRC_SHIFT (0U) -/*! TXCRC - Transmitted CRC value */ -#define CAN_CRCR_TXCRC(x) (((uint32_t)(((uint32_t)(x)) << CAN_CRCR_TXCRC_SHIFT)) & CAN_CRCR_TXCRC_MASK) - -#define CAN_CRCR_MBCRC_MASK (0x7F0000U) -#define CAN_CRCR_MBCRC_SHIFT (16U) -/*! MBCRC - CRC Message Buffer */ -#define CAN_CRCR_MBCRC(x) (((uint32_t)(((uint32_t)(x)) << CAN_CRCR_MBCRC_SHIFT)) & CAN_CRCR_MBCRC_MASK) -/*! @} */ - -/*! @name RXFGMASK - Legacy RX FIFO Global Mask */ -/*! @{ */ - -#define CAN_RXFGMASK_FGM_MASK (0xFFFFFFFFU) -#define CAN_RXFGMASK_FGM_SHIFT (0U) -/*! FGM - Legacy RX FIFO Global Mask Bits */ -#define CAN_RXFGMASK_FGM(x) (((uint32_t)(((uint32_t)(x)) << CAN_RXFGMASK_FGM_SHIFT)) & CAN_RXFGMASK_FGM_MASK) -/*! @} */ - -/*! @name RXFIR - Legacy RX FIFO Information */ -/*! @{ */ - -#define CAN_RXFIR_IDHIT_MASK (0x1FFU) -#define CAN_RXFIR_IDHIT_SHIFT (0U) -/*! IDHIT - Identifier Acceptance Filter Hit Indicator */ -#define CAN_RXFIR_IDHIT(x) (((uint32_t)(((uint32_t)(x)) << CAN_RXFIR_IDHIT_SHIFT)) & CAN_RXFIR_IDHIT_MASK) -/*! @} */ - -/*! @name CBT - CAN Bit Timing */ -/*! @{ */ - -#define CAN_CBT_EPSEG2_MASK (0x1FU) -#define CAN_CBT_EPSEG2_SHIFT (0U) -/*! EPSEG2 - Extended Phase Segment 2 */ -#define CAN_CBT_EPSEG2(x) (((uint32_t)(((uint32_t)(x)) << CAN_CBT_EPSEG2_SHIFT)) & CAN_CBT_EPSEG2_MASK) - -#define CAN_CBT_EPSEG1_MASK (0x3E0U) -#define CAN_CBT_EPSEG1_SHIFT (5U) -/*! EPSEG1 - Extended Phase Segment 1 */ -#define CAN_CBT_EPSEG1(x) (((uint32_t)(((uint32_t)(x)) << CAN_CBT_EPSEG1_SHIFT)) & CAN_CBT_EPSEG1_MASK) - -#define CAN_CBT_EPROPSEG_MASK (0xFC00U) -#define CAN_CBT_EPROPSEG_SHIFT (10U) -/*! EPROPSEG - Extended Propagation Segment */ -#define CAN_CBT_EPROPSEG(x) (((uint32_t)(((uint32_t)(x)) << CAN_CBT_EPROPSEG_SHIFT)) & CAN_CBT_EPROPSEG_MASK) - -#define CAN_CBT_ERJW_MASK (0x1F0000U) -#define CAN_CBT_ERJW_SHIFT (16U) -/*! ERJW - Extended Resync Jump Width */ -#define CAN_CBT_ERJW(x) (((uint32_t)(((uint32_t)(x)) << CAN_CBT_ERJW_SHIFT)) & CAN_CBT_ERJW_MASK) - -#define CAN_CBT_EPRESDIV_MASK (0x7FE00000U) -#define CAN_CBT_EPRESDIV_SHIFT (21U) -/*! EPRESDIV - Extended Prescaler Division Factor */ -#define CAN_CBT_EPRESDIV(x) (((uint32_t)(((uint32_t)(x)) << CAN_CBT_EPRESDIV_SHIFT)) & CAN_CBT_EPRESDIV_MASK) - -#define CAN_CBT_BTF_MASK (0x80000000U) -#define CAN_CBT_BTF_SHIFT (31U) -/*! BTF - Bit Timing Format Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CBT_BTF(x) (((uint32_t)(((uint32_t)(x)) << CAN_CBT_BTF_SHIFT)) & CAN_CBT_BTF_MASK) -/*! @} */ - -/* The count of CAN_CS */ -#define CAN_CS_COUNT_MB8B (32U) - -/* The count of CAN_ID */ -#define CAN_ID_COUNT_MB8B (32U) - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB8B (32U) - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB8B2 (2U) - -/* The count of CAN_CS */ -#define CAN_CS_COUNT_MB16B (21U) - -/* The count of CAN_ID */ -#define CAN_ID_COUNT_MB16B (21U) - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB16B (21U) - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB16B2 (4U) - -/* The count of CAN_CS */ -#define CAN_CS_COUNT_MB32B (12U) - -/* The count of CAN_ID */ -#define CAN_ID_COUNT_MB32B (12U) - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB32B (12U) - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB32B2 (8U) - -/*! @name CS - Message Buffer 0 CS Register..Message Buffer 6 CS Register */ -/*! @{ */ - -#define CAN_CS_TIME_STAMP_MASK (0xFFFFU) -#define CAN_CS_TIME_STAMP_SHIFT (0U) -/*! TIME_STAMP - Free-Running Counter Time stamp. This 16-bit field is a copy of the Free-Running - * Timer, captured for Tx and Rx frames at the time when the beginning of the Identifier field - * appears on the CAN bus. - */ -#define CAN_CS_TIME_STAMP(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_TIME_STAMP_SHIFT)) & CAN_CS_TIME_STAMP_MASK) - -#define CAN_CS_DLC_MASK (0xF0000U) -#define CAN_CS_DLC_SHIFT (16U) -/*! DLC - Length of the data to be stored/transmitted. */ -#define CAN_CS_DLC(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_DLC_SHIFT)) & CAN_CS_DLC_MASK) - -#define CAN_CS_RTR_MASK (0x100000U) -#define CAN_CS_RTR_SHIFT (20U) -/*! RTR - Remote Transmission Request. One/zero for remote/data frame. */ -#define CAN_CS_RTR(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_RTR_SHIFT)) & CAN_CS_RTR_MASK) - -#define CAN_CS_IDE_MASK (0x200000U) -#define CAN_CS_IDE_SHIFT (21U) -/*! IDE - ID Extended. One/zero for extended/standard format frame. */ -#define CAN_CS_IDE(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_IDE_SHIFT)) & CAN_CS_IDE_MASK) - -#define CAN_CS_SRR_MASK (0x400000U) -#define CAN_CS_SRR_SHIFT (22U) -/*! SRR - Substitute Remote Request. Contains a fixed recessive bit. */ -#define CAN_CS_SRR(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_SRR_SHIFT)) & CAN_CS_SRR_MASK) - -#define CAN_CS_CODE_MASK (0xF000000U) -#define CAN_CS_CODE_SHIFT (24U) -/*! CODE - Message Buffer Code. This 4-bit field can be accessed (read or write) by the CPU and by - * the FlexCAN module itself, as part of the message buffer matching and arbitration process. - */ -#define CAN_CS_CODE(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_CODE_SHIFT)) & CAN_CS_CODE_MASK) - -#define CAN_CS_ESI_MASK (0x20000000U) -#define CAN_CS_ESI_SHIFT (29U) -/*! ESI - Error State Indicator. This bit indicates if the transmitting node is error active or error passive. */ -#define CAN_CS_ESI(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_ESI_SHIFT)) & CAN_CS_ESI_MASK) - -#define CAN_CS_BRS_MASK (0x40000000U) -#define CAN_CS_BRS_SHIFT (30U) -/*! BRS - Bit Rate Switch. This bit defines whether the bit rate is switched inside a CAN FD format frame. */ -#define CAN_CS_BRS(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_BRS_SHIFT)) & CAN_CS_BRS_MASK) - -#define CAN_CS_EDL_MASK (0x80000000U) -#define CAN_CS_EDL_SHIFT (31U) -/*! EDL - Extended Data Length. This bit distinguishes between CAN format and CAN FD format frames. - * The EDL bit must not be set for Message Buffers configured to RANSWER with code field 0b1010. - */ -#define CAN_CS_EDL(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_EDL_SHIFT)) & CAN_CS_EDL_MASK) -/*! @} */ - -/* The count of CAN_CS */ -#define CAN_CS_COUNT_MB64B (7U) - -/*! @name ID - Message Buffer 0 ID Register..Message Buffer 6 ID Register */ -/*! @{ */ - -#define CAN_ID_EXT_MASK (0x3FFFFU) -#define CAN_ID_EXT_SHIFT (0U) -/*! EXT - Contains extended (LOW word) identifier of message buffer. */ -#define CAN_ID_EXT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ID_EXT_SHIFT)) & CAN_ID_EXT_MASK) - -#define CAN_ID_STD_MASK (0x1FFC0000U) -#define CAN_ID_STD_SHIFT (18U) -/*! STD - Contains standard/extended (HIGH word) identifier of message buffer. */ -#define CAN_ID_STD(x) (((uint32_t)(((uint32_t)(x)) << CAN_ID_STD_SHIFT)) & CAN_ID_STD_MASK) - -#define CAN_ID_PRIO_MASK (0xE0000000U) -#define CAN_ID_PRIO_SHIFT (29U) -/*! PRIO - Local priority. This 3-bit fieldis only used when LPRIO_EN bit is set in MCR and it only - * makes sense for Tx buffers. These bits are not transmitted. They are appended to the regular - * ID to define the transmission priority. - */ -#define CAN_ID_PRIO(x) (((uint32_t)(((uint32_t)(x)) << CAN_ID_PRIO_SHIFT)) & CAN_ID_PRIO_MASK) -/*! @} */ - -/* The count of CAN_ID */ -#define CAN_ID_COUNT_MB64B (7U) - -/*! @name WORD - Message Buffer 0 WORD_64B Register..Message Buffer 6 WORD_64B Register */ -/*! @{ */ - -#define CAN_WORD_DATA_BYTE_3_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_3_SHIFT (0U) -/*! DATA_BYTE_3 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_3(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_3_SHIFT)) & CAN_WORD_DATA_BYTE_3_MASK) - -#define CAN_WORD_DATA_BYTE_7_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_7_SHIFT (0U) -/*! DATA_BYTE_7 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_7(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_7_SHIFT)) & CAN_WORD_DATA_BYTE_7_MASK) - -#define CAN_WORD_DATA_BYTE_11_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_11_SHIFT (0U) -/*! DATA_BYTE_11 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_11(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_11_SHIFT)) & CAN_WORD_DATA_BYTE_11_MASK) - -#define CAN_WORD_DATA_BYTE_15_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_15_SHIFT (0U) -/*! DATA_BYTE_15 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_15(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_15_SHIFT)) & CAN_WORD_DATA_BYTE_15_MASK) - -#define CAN_WORD_DATA_BYTE_19_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_19_SHIFT (0U) -/*! DATA_BYTE_19 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_19(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_19_SHIFT)) & CAN_WORD_DATA_BYTE_19_MASK) - -#define CAN_WORD_DATA_BYTE_23_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_23_SHIFT (0U) -/*! DATA_BYTE_23 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_23(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_23_SHIFT)) & CAN_WORD_DATA_BYTE_23_MASK) - -#define CAN_WORD_DATA_BYTE_27_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_27_SHIFT (0U) -/*! DATA_BYTE_27 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_27(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_27_SHIFT)) & CAN_WORD_DATA_BYTE_27_MASK) - -#define CAN_WORD_DATA_BYTE_31_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_31_SHIFT (0U) -/*! DATA_BYTE_31 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_31(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_31_SHIFT)) & CAN_WORD_DATA_BYTE_31_MASK) - -#define CAN_WORD_DATA_BYTE_35_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_35_SHIFT (0U) -/*! DATA_BYTE_35 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_35(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_35_SHIFT)) & CAN_WORD_DATA_BYTE_35_MASK) - -#define CAN_WORD_DATA_BYTE_39_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_39_SHIFT (0U) -/*! DATA_BYTE_39 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_39(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_39_SHIFT)) & CAN_WORD_DATA_BYTE_39_MASK) - -#define CAN_WORD_DATA_BYTE_43_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_43_SHIFT (0U) -/*! DATA_BYTE_43 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_43(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_43_SHIFT)) & CAN_WORD_DATA_BYTE_43_MASK) - -#define CAN_WORD_DATA_BYTE_47_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_47_SHIFT (0U) -/*! DATA_BYTE_47 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_47(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_47_SHIFT)) & CAN_WORD_DATA_BYTE_47_MASK) - -#define CAN_WORD_DATA_BYTE_51_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_51_SHIFT (0U) -/*! DATA_BYTE_51 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_51(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_51_SHIFT)) & CAN_WORD_DATA_BYTE_51_MASK) - -#define CAN_WORD_DATA_BYTE_55_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_55_SHIFT (0U) -/*! DATA_BYTE_55 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_55(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_55_SHIFT)) & CAN_WORD_DATA_BYTE_55_MASK) - -#define CAN_WORD_DATA_BYTE_59_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_59_SHIFT (0U) -/*! DATA_BYTE_59 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_59(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_59_SHIFT)) & CAN_WORD_DATA_BYTE_59_MASK) - -#define CAN_WORD_DATA_BYTE_63_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_63_SHIFT (0U) -/*! DATA_BYTE_63 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_63(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_63_SHIFT)) & CAN_WORD_DATA_BYTE_63_MASK) - -#define CAN_WORD_DATA_BYTE_2_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_2_SHIFT (8U) -/*! DATA_BYTE_2 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_2(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_2_SHIFT)) & CAN_WORD_DATA_BYTE_2_MASK) - -#define CAN_WORD_DATA_BYTE_6_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_6_SHIFT (8U) -/*! DATA_BYTE_6 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_6(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_6_SHIFT)) & CAN_WORD_DATA_BYTE_6_MASK) - -#define CAN_WORD_DATA_BYTE_10_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_10_SHIFT (8U) -/*! DATA_BYTE_10 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_10(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_10_SHIFT)) & CAN_WORD_DATA_BYTE_10_MASK) - -#define CAN_WORD_DATA_BYTE_14_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_14_SHIFT (8U) -/*! DATA_BYTE_14 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_14(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_14_SHIFT)) & CAN_WORD_DATA_BYTE_14_MASK) - -#define CAN_WORD_DATA_BYTE_18_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_18_SHIFT (8U) -/*! DATA_BYTE_18 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_18(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_18_SHIFT)) & CAN_WORD_DATA_BYTE_18_MASK) - -#define CAN_WORD_DATA_BYTE_22_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_22_SHIFT (8U) -/*! DATA_BYTE_22 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_22(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_22_SHIFT)) & CAN_WORD_DATA_BYTE_22_MASK) - -#define CAN_WORD_DATA_BYTE_26_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_26_SHIFT (8U) -/*! DATA_BYTE_26 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_26(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_26_SHIFT)) & CAN_WORD_DATA_BYTE_26_MASK) - -#define CAN_WORD_DATA_BYTE_30_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_30_SHIFT (8U) -/*! DATA_BYTE_30 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_30(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_30_SHIFT)) & CAN_WORD_DATA_BYTE_30_MASK) - -#define CAN_WORD_DATA_BYTE_34_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_34_SHIFT (8U) -/*! DATA_BYTE_34 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_34(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_34_SHIFT)) & CAN_WORD_DATA_BYTE_34_MASK) - -#define CAN_WORD_DATA_BYTE_38_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_38_SHIFT (8U) -/*! DATA_BYTE_38 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_38(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_38_SHIFT)) & CAN_WORD_DATA_BYTE_38_MASK) - -#define CAN_WORD_DATA_BYTE_42_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_42_SHIFT (8U) -/*! DATA_BYTE_42 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_42(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_42_SHIFT)) & CAN_WORD_DATA_BYTE_42_MASK) - -#define CAN_WORD_DATA_BYTE_46_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_46_SHIFT (8U) -/*! DATA_BYTE_46 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_46(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_46_SHIFT)) & CAN_WORD_DATA_BYTE_46_MASK) - -#define CAN_WORD_DATA_BYTE_50_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_50_SHIFT (8U) -/*! DATA_BYTE_50 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_50(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_50_SHIFT)) & CAN_WORD_DATA_BYTE_50_MASK) - -#define CAN_WORD_DATA_BYTE_54_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_54_SHIFT (8U) -/*! DATA_BYTE_54 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_54(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_54_SHIFT)) & CAN_WORD_DATA_BYTE_54_MASK) - -#define CAN_WORD_DATA_BYTE_58_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_58_SHIFT (8U) -/*! DATA_BYTE_58 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_58(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_58_SHIFT)) & CAN_WORD_DATA_BYTE_58_MASK) - -#define CAN_WORD_DATA_BYTE_62_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_62_SHIFT (8U) -/*! DATA_BYTE_62 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_62(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_62_SHIFT)) & CAN_WORD_DATA_BYTE_62_MASK) - -#define CAN_WORD_DATA_BYTE_1_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_1_SHIFT (16U) -/*! DATA_BYTE_1 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_1(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_1_SHIFT)) & CAN_WORD_DATA_BYTE_1_MASK) - -#define CAN_WORD_DATA_BYTE_5_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_5_SHIFT (16U) -/*! DATA_BYTE_5 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_5(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_5_SHIFT)) & CAN_WORD_DATA_BYTE_5_MASK) - -#define CAN_WORD_DATA_BYTE_9_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_9_SHIFT (16U) -/*! DATA_BYTE_9 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_9(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_9_SHIFT)) & CAN_WORD_DATA_BYTE_9_MASK) - -#define CAN_WORD_DATA_BYTE_13_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_13_SHIFT (16U) -/*! DATA_BYTE_13 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_13(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_13_SHIFT)) & CAN_WORD_DATA_BYTE_13_MASK) - -#define CAN_WORD_DATA_BYTE_17_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_17_SHIFT (16U) -/*! DATA_BYTE_17 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_17(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_17_SHIFT)) & CAN_WORD_DATA_BYTE_17_MASK) - -#define CAN_WORD_DATA_BYTE_21_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_21_SHIFT (16U) -/*! DATA_BYTE_21 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_21(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_21_SHIFT)) & CAN_WORD_DATA_BYTE_21_MASK) - -#define CAN_WORD_DATA_BYTE_25_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_25_SHIFT (16U) -/*! DATA_BYTE_25 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_25(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_25_SHIFT)) & CAN_WORD_DATA_BYTE_25_MASK) - -#define CAN_WORD_DATA_BYTE_29_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_29_SHIFT (16U) -/*! DATA_BYTE_29 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_29(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_29_SHIFT)) & CAN_WORD_DATA_BYTE_29_MASK) - -#define CAN_WORD_DATA_BYTE_33_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_33_SHIFT (16U) -/*! DATA_BYTE_33 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_33(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_33_SHIFT)) & CAN_WORD_DATA_BYTE_33_MASK) - -#define CAN_WORD_DATA_BYTE_37_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_37_SHIFT (16U) -/*! DATA_BYTE_37 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_37(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_37_SHIFT)) & CAN_WORD_DATA_BYTE_37_MASK) - -#define CAN_WORD_DATA_BYTE_41_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_41_SHIFT (16U) -/*! DATA_BYTE_41 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_41(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_41_SHIFT)) & CAN_WORD_DATA_BYTE_41_MASK) - -#define CAN_WORD_DATA_BYTE_45_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_45_SHIFT (16U) -/*! DATA_BYTE_45 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_45(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_45_SHIFT)) & CAN_WORD_DATA_BYTE_45_MASK) - -#define CAN_WORD_DATA_BYTE_49_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_49_SHIFT (16U) -/*! DATA_BYTE_49 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_49(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_49_SHIFT)) & CAN_WORD_DATA_BYTE_49_MASK) - -#define CAN_WORD_DATA_BYTE_53_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_53_SHIFT (16U) -/*! DATA_BYTE_53 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_53(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_53_SHIFT)) & CAN_WORD_DATA_BYTE_53_MASK) - -#define CAN_WORD_DATA_BYTE_57_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_57_SHIFT (16U) -/*! DATA_BYTE_57 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_57(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_57_SHIFT)) & CAN_WORD_DATA_BYTE_57_MASK) - -#define CAN_WORD_DATA_BYTE_61_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_61_SHIFT (16U) -/*! DATA_BYTE_61 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_61(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_61_SHIFT)) & CAN_WORD_DATA_BYTE_61_MASK) - -#define CAN_WORD_DATA_BYTE_0_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_0_SHIFT (24U) -/*! DATA_BYTE_0 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_0(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_0_SHIFT)) & CAN_WORD_DATA_BYTE_0_MASK) - -#define CAN_WORD_DATA_BYTE_4_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_4_SHIFT (24U) -/*! DATA_BYTE_4 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_4(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_4_SHIFT)) & CAN_WORD_DATA_BYTE_4_MASK) - -#define CAN_WORD_DATA_BYTE_8_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_8_SHIFT (24U) -/*! DATA_BYTE_8 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_8(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_8_SHIFT)) & CAN_WORD_DATA_BYTE_8_MASK) - -#define CAN_WORD_DATA_BYTE_12_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_12_SHIFT (24U) -/*! DATA_BYTE_12 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_12(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_12_SHIFT)) & CAN_WORD_DATA_BYTE_12_MASK) - -#define CAN_WORD_DATA_BYTE_16_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_16_SHIFT (24U) -/*! DATA_BYTE_16 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_16(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_16_SHIFT)) & CAN_WORD_DATA_BYTE_16_MASK) - -#define CAN_WORD_DATA_BYTE_20_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_20_SHIFT (24U) -/*! DATA_BYTE_20 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_20(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_20_SHIFT)) & CAN_WORD_DATA_BYTE_20_MASK) - -#define CAN_WORD_DATA_BYTE_24_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_24_SHIFT (24U) -/*! DATA_BYTE_24 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_24(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_24_SHIFT)) & CAN_WORD_DATA_BYTE_24_MASK) - -#define CAN_WORD_DATA_BYTE_28_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_28_SHIFT (24U) -/*! DATA_BYTE_28 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_28(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_28_SHIFT)) & CAN_WORD_DATA_BYTE_28_MASK) - -#define CAN_WORD_DATA_BYTE_32_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_32_SHIFT (24U) -/*! DATA_BYTE_32 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_32(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_32_SHIFT)) & CAN_WORD_DATA_BYTE_32_MASK) - -#define CAN_WORD_DATA_BYTE_36_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_36_SHIFT (24U) -/*! DATA_BYTE_36 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_36(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_36_SHIFT)) & CAN_WORD_DATA_BYTE_36_MASK) - -#define CAN_WORD_DATA_BYTE_40_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_40_SHIFT (24U) -/*! DATA_BYTE_40 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_40(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_40_SHIFT)) & CAN_WORD_DATA_BYTE_40_MASK) - -#define CAN_WORD_DATA_BYTE_44_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_44_SHIFT (24U) -/*! DATA_BYTE_44 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_44(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_44_SHIFT)) & CAN_WORD_DATA_BYTE_44_MASK) - -#define CAN_WORD_DATA_BYTE_48_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_48_SHIFT (24U) -/*! DATA_BYTE_48 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_48(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_48_SHIFT)) & CAN_WORD_DATA_BYTE_48_MASK) - -#define CAN_WORD_DATA_BYTE_52_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_52_SHIFT (24U) -/*! DATA_BYTE_52 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_52(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_52_SHIFT)) & CAN_WORD_DATA_BYTE_52_MASK) - -#define CAN_WORD_DATA_BYTE_56_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_56_SHIFT (24U) -/*! DATA_BYTE_56 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_56(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_56_SHIFT)) & CAN_WORD_DATA_BYTE_56_MASK) - -#define CAN_WORD_DATA_BYTE_60_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_60_SHIFT (24U) -/*! DATA_BYTE_60 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_60(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_60_SHIFT)) & CAN_WORD_DATA_BYTE_60_MASK) -/*! @} */ - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB64B (7U) - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB64B2 (16U) - -/* The count of CAN_CS */ -#define CAN_CS_COUNT (32U) - -/* The count of CAN_ID */ -#define CAN_ID_COUNT (32U) - -/*! @name WORD0 - Message Buffer 0 WORD0 Register..Message Buffer 31 WORD0 Register */ -/*! @{ */ - -#define CAN_WORD0_DATA_BYTE_3_MASK (0xFFU) -#define CAN_WORD0_DATA_BYTE_3_SHIFT (0U) -/*! DATA_BYTE_3 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD0_DATA_BYTE_3(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD0_DATA_BYTE_3_SHIFT)) & CAN_WORD0_DATA_BYTE_3_MASK) - -#define CAN_WORD0_DATA_BYTE_2_MASK (0xFF00U) -#define CAN_WORD0_DATA_BYTE_2_SHIFT (8U) -/*! DATA_BYTE_2 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD0_DATA_BYTE_2(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD0_DATA_BYTE_2_SHIFT)) & CAN_WORD0_DATA_BYTE_2_MASK) - -#define CAN_WORD0_DATA_BYTE_1_MASK (0xFF0000U) -#define CAN_WORD0_DATA_BYTE_1_SHIFT (16U) -/*! DATA_BYTE_1 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD0_DATA_BYTE_1(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD0_DATA_BYTE_1_SHIFT)) & CAN_WORD0_DATA_BYTE_1_MASK) - -#define CAN_WORD0_DATA_BYTE_0_MASK (0xFF000000U) -#define CAN_WORD0_DATA_BYTE_0_SHIFT (24U) -/*! DATA_BYTE_0 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD0_DATA_BYTE_0(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD0_DATA_BYTE_0_SHIFT)) & CAN_WORD0_DATA_BYTE_0_MASK) -/*! @} */ - -/* The count of CAN_WORD0 */ -#define CAN_WORD0_COUNT (32U) - -/*! @name WORD1 - Message Buffer 0 WORD1 Register..Message Buffer 31 WORD1 Register */ -/*! @{ */ - -#define CAN_WORD1_DATA_BYTE_7_MASK (0xFFU) -#define CAN_WORD1_DATA_BYTE_7_SHIFT (0U) -/*! DATA_BYTE_7 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD1_DATA_BYTE_7(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD1_DATA_BYTE_7_SHIFT)) & CAN_WORD1_DATA_BYTE_7_MASK) - -#define CAN_WORD1_DATA_BYTE_6_MASK (0xFF00U) -#define CAN_WORD1_DATA_BYTE_6_SHIFT (8U) -/*! DATA_BYTE_6 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD1_DATA_BYTE_6(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD1_DATA_BYTE_6_SHIFT)) & CAN_WORD1_DATA_BYTE_6_MASK) - -#define CAN_WORD1_DATA_BYTE_5_MASK (0xFF0000U) -#define CAN_WORD1_DATA_BYTE_5_SHIFT (16U) -/*! DATA_BYTE_5 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD1_DATA_BYTE_5(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD1_DATA_BYTE_5_SHIFT)) & CAN_WORD1_DATA_BYTE_5_MASK) - -#define CAN_WORD1_DATA_BYTE_4_MASK (0xFF000000U) -#define CAN_WORD1_DATA_BYTE_4_SHIFT (24U) -/*! DATA_BYTE_4 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD1_DATA_BYTE_4(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD1_DATA_BYTE_4_SHIFT)) & CAN_WORD1_DATA_BYTE_4_MASK) -/*! @} */ - -/* The count of CAN_WORD1 */ -#define CAN_WORD1_COUNT (32U) - -/*! @name RXIMR - Receive Individual Mask */ -/*! @{ */ - -#define CAN_RXIMR_MI_MASK (0xFFFFFFFFU) -#define CAN_RXIMR_MI_SHIFT (0U) -/*! MI - Individual Mask Bits */ -#define CAN_RXIMR_MI(x) (((uint32_t)(((uint32_t)(x)) << CAN_RXIMR_MI_SHIFT)) & CAN_RXIMR_MI_MASK) -/*! @} */ - -/* The count of CAN_RXIMR */ -#define CAN_RXIMR_COUNT (32U) - -/*! @name CTRL1_PN - Pretended Networking Control 1 */ -/*! @{ */ - -#define CAN_CTRL1_PN_FCS_MASK (0x3U) -#define CAN_CTRL1_PN_FCS_SHIFT (0U) -/*! FCS - Filtering Combination Selection - * 0b00..Message ID filtering only - * 0b01..Message ID filtering and payload filtering - * 0b10..Message ID filtering occurring a specified number of times - * 0b11..Message ID filtering and payload filtering a specified number of times - */ -#define CAN_CTRL1_PN_FCS(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PN_FCS_SHIFT)) & CAN_CTRL1_PN_FCS_MASK) - -#define CAN_CTRL1_PN_IDFS_MASK (0xCU) -#define CAN_CTRL1_PN_IDFS_SHIFT (2U) -/*! IDFS - ID Filtering Selection - * 0b00..Match ID contents to an exact target value - * 0b01..Match an ID value greater than or equal to a specified target value - * 0b10..Match an ID value smaller than or equal to a specified target value - * 0b11..Match an ID value within a range of values, inclusive - */ -#define CAN_CTRL1_PN_IDFS(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PN_IDFS_SHIFT)) & CAN_CTRL1_PN_IDFS_MASK) - -#define CAN_CTRL1_PN_PLFS_MASK (0x30U) -#define CAN_CTRL1_PN_PLFS_SHIFT (4U) -/*! PLFS - Payload Filtering Selection - * 0b00..Match payload contents to an exact target value - * 0b01..Match a payload value greater than or equal to a specified target value - * 0b10..Match a payload value smaller than or equal to a specified target value - * 0b11..Match upon a payload value within a range of values, inclusive - */ -#define CAN_CTRL1_PN_PLFS(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PN_PLFS_SHIFT)) & CAN_CTRL1_PN_PLFS_MASK) - -#define CAN_CTRL1_PN_NMATCH_MASK (0xFF00U) -#define CAN_CTRL1_PN_NMATCH_SHIFT (8U) -/*! NMATCH - Number of Messages Matching the Same Filtering Criteria - * 0b00000001..Once - * 0b00000010..Twice - * 0b11111111..255 times - */ -#define CAN_CTRL1_PN_NMATCH(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PN_NMATCH_SHIFT)) & CAN_CTRL1_PN_NMATCH_MASK) - -#define CAN_CTRL1_PN_WUMF_MSK_MASK (0x10000U) -#define CAN_CTRL1_PN_WUMF_MSK_SHIFT (16U) -/*! WUMF_MSK - Wake-up by Matching Flag Mask - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL1_PN_WUMF_MSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PN_WUMF_MSK_SHIFT)) & CAN_CTRL1_PN_WUMF_MSK_MASK) - -#define CAN_CTRL1_PN_WTOF_MSK_MASK (0x20000U) -#define CAN_CTRL1_PN_WTOF_MSK_SHIFT (17U) -/*! WTOF_MSK - Wake-up by Timeout Flag Mask - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL1_PN_WTOF_MSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PN_WTOF_MSK_SHIFT)) & CAN_CTRL1_PN_WTOF_MSK_MASK) -/*! @} */ - -/*! @name CTRL2_PN - Pretended Networking Control 2 */ -/*! @{ */ - -#define CAN_CTRL2_PN_MATCHTO_MASK (0xFFFFU) -#define CAN_CTRL2_PN_MATCHTO_SHIFT (0U) -/*! MATCHTO - Timeout for No Message Matching the Filtering Criteria */ -#define CAN_CTRL2_PN_MATCHTO(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_PN_MATCHTO_SHIFT)) & CAN_CTRL2_PN_MATCHTO_MASK) -/*! @} */ - -/*! @name WU_MTC - Pretended Networking Wake-Up Match */ -/*! @{ */ - -#define CAN_WU_MTC_MCOUNTER_MASK (0xFF00U) -#define CAN_WU_MTC_MCOUNTER_SHIFT (8U) -/*! MCOUNTER - Number of Matches in Pretended Networking */ -#define CAN_WU_MTC_MCOUNTER(x) (((uint32_t)(((uint32_t)(x)) << CAN_WU_MTC_MCOUNTER_SHIFT)) & CAN_WU_MTC_MCOUNTER_MASK) - -#define CAN_WU_MTC_WUMF_MASK (0x10000U) -#define CAN_WU_MTC_WUMF_SHIFT (16U) -/*! WUMF - Wake-up by Match Flag - * 0b0..No event detected - * 0b1..Event detected - */ -#define CAN_WU_MTC_WUMF(x) (((uint32_t)(((uint32_t)(x)) << CAN_WU_MTC_WUMF_SHIFT)) & CAN_WU_MTC_WUMF_MASK) - -#define CAN_WU_MTC_WTOF_MASK (0x20000U) -#define CAN_WU_MTC_WTOF_SHIFT (17U) -/*! WTOF - Wake-up by Timeout Flag Bit - * 0b0..No event detected - * 0b1..Event detected - */ -#define CAN_WU_MTC_WTOF(x) (((uint32_t)(((uint32_t)(x)) << CAN_WU_MTC_WTOF_SHIFT)) & CAN_WU_MTC_WTOF_MASK) -/*! @} */ - -/*! @name FLT_ID1 - Pretended Networking ID Filter 1 */ -/*! @{ */ - -#define CAN_FLT_ID1_FLT_ID1_MASK (0x1FFFFFFFU) -#define CAN_FLT_ID1_FLT_ID1_SHIFT (0U) -/*! FLT_ID1 - ID Filter 1 for Pretended Networking filtering */ -#define CAN_FLT_ID1_FLT_ID1(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_ID1_FLT_ID1_SHIFT)) & CAN_FLT_ID1_FLT_ID1_MASK) - -#define CAN_FLT_ID1_FLT_RTR_MASK (0x20000000U) -#define CAN_FLT_ID1_FLT_RTR_SHIFT (29U) -/*! FLT_RTR - Remote Transmission Request Filter - * 0b0..Reject remote frame (accept data frame) - * 0b1..Accept remote frame - */ -#define CAN_FLT_ID1_FLT_RTR(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_ID1_FLT_RTR_SHIFT)) & CAN_FLT_ID1_FLT_RTR_MASK) - -#define CAN_FLT_ID1_FLT_IDE_MASK (0x40000000U) -#define CAN_FLT_ID1_FLT_IDE_SHIFT (30U) -/*! FLT_IDE - ID Extended Filter - * 0b0..Standard - * 0b1..Extended - */ -#define CAN_FLT_ID1_FLT_IDE(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_ID1_FLT_IDE_SHIFT)) & CAN_FLT_ID1_FLT_IDE_MASK) -/*! @} */ - -/*! @name FLT_DLC - Pretended Networking Data Length Code (DLC) Filter */ -/*! @{ */ - -#define CAN_FLT_DLC_FLT_DLC_HI_MASK (0xFU) -#define CAN_FLT_DLC_FLT_DLC_HI_SHIFT (0U) -/*! FLT_DLC_HI - Upper Limit for Length of Data Bytes Filter */ -#define CAN_FLT_DLC_FLT_DLC_HI(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_DLC_FLT_DLC_HI_SHIFT)) & CAN_FLT_DLC_FLT_DLC_HI_MASK) - -#define CAN_FLT_DLC_FLT_DLC_LO_MASK (0xF0000U) -#define CAN_FLT_DLC_FLT_DLC_LO_SHIFT (16U) -/*! FLT_DLC_LO - Lower Limit for Length of Data Bytes Filter */ -#define CAN_FLT_DLC_FLT_DLC_LO(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_DLC_FLT_DLC_LO_SHIFT)) & CAN_FLT_DLC_FLT_DLC_LO_MASK) -/*! @} */ - -/*! @name PL1_LO - Pretended Networking Payload Low Filter 1 */ -/*! @{ */ - -#define CAN_PL1_LO_Data_byte_3_MASK (0xFFU) -#define CAN_PL1_LO_Data_byte_3_SHIFT (0U) -/*! Data_byte_3 - Data byte 3 */ -#define CAN_PL1_LO_Data_byte_3(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_LO_Data_byte_3_SHIFT)) & CAN_PL1_LO_Data_byte_3_MASK) - -#define CAN_PL1_LO_Data_byte_2_MASK (0xFF00U) -#define CAN_PL1_LO_Data_byte_2_SHIFT (8U) -/*! Data_byte_2 - Data byte 2 */ -#define CAN_PL1_LO_Data_byte_2(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_LO_Data_byte_2_SHIFT)) & CAN_PL1_LO_Data_byte_2_MASK) - -#define CAN_PL1_LO_Data_byte_1_MASK (0xFF0000U) -#define CAN_PL1_LO_Data_byte_1_SHIFT (16U) -/*! Data_byte_1 - Data byte 1 */ -#define CAN_PL1_LO_Data_byte_1(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_LO_Data_byte_1_SHIFT)) & CAN_PL1_LO_Data_byte_1_MASK) - -#define CAN_PL1_LO_Data_byte_0_MASK (0xFF000000U) -#define CAN_PL1_LO_Data_byte_0_SHIFT (24U) -/*! Data_byte_0 - Data byte 0 */ -#define CAN_PL1_LO_Data_byte_0(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_LO_Data_byte_0_SHIFT)) & CAN_PL1_LO_Data_byte_0_MASK) -/*! @} */ - -/*! @name PL1_HI - Pretended Networking Payload High Filter 1 */ -/*! @{ */ - -#define CAN_PL1_HI_Data_byte_7_MASK (0xFFU) -#define CAN_PL1_HI_Data_byte_7_SHIFT (0U) -/*! Data_byte_7 - Data byte 7 */ -#define CAN_PL1_HI_Data_byte_7(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_HI_Data_byte_7_SHIFT)) & CAN_PL1_HI_Data_byte_7_MASK) - -#define CAN_PL1_HI_Data_byte_6_MASK (0xFF00U) -#define CAN_PL1_HI_Data_byte_6_SHIFT (8U) -/*! Data_byte_6 - Data byte 6 */ -#define CAN_PL1_HI_Data_byte_6(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_HI_Data_byte_6_SHIFT)) & CAN_PL1_HI_Data_byte_6_MASK) - -#define CAN_PL1_HI_Data_byte_5_MASK (0xFF0000U) -#define CAN_PL1_HI_Data_byte_5_SHIFT (16U) -/*! Data_byte_5 - Data byte 5 */ -#define CAN_PL1_HI_Data_byte_5(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_HI_Data_byte_5_SHIFT)) & CAN_PL1_HI_Data_byte_5_MASK) - -#define CAN_PL1_HI_Data_byte_4_MASK (0xFF000000U) -#define CAN_PL1_HI_Data_byte_4_SHIFT (24U) -/*! Data_byte_4 - Data byte 4 */ -#define CAN_PL1_HI_Data_byte_4(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_HI_Data_byte_4_SHIFT)) & CAN_PL1_HI_Data_byte_4_MASK) -/*! @} */ - -/*! @name FLT_ID2_IDMASK - Pretended Networking ID Filter 2 or ID Mask */ -/*! @{ */ - -#define CAN_FLT_ID2_IDMASK_FLT_ID2_IDMASK_MASK (0x1FFFFFFFU) -#define CAN_FLT_ID2_IDMASK_FLT_ID2_IDMASK_SHIFT (0U) -/*! FLT_ID2_IDMASK - ID Filter 2 for Pretended Networking Filtering or ID Mask Bits for Pretended Networking ID Filtering */ -#define CAN_FLT_ID2_IDMASK_FLT_ID2_IDMASK(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_ID2_IDMASK_FLT_ID2_IDMASK_SHIFT)) & CAN_FLT_ID2_IDMASK_FLT_ID2_IDMASK_MASK) - -#define CAN_FLT_ID2_IDMASK_RTR_MSK_MASK (0x20000000U) -#define CAN_FLT_ID2_IDMASK_RTR_MSK_SHIFT (29U) -/*! RTR_MSK - Remote Transmission Request Mask - * 0b0..The corresponding bit in the filter is "don't care." - * 0b1..The corresponding bit in the filter is checked. - */ -#define CAN_FLT_ID2_IDMASK_RTR_MSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_ID2_IDMASK_RTR_MSK_SHIFT)) & CAN_FLT_ID2_IDMASK_RTR_MSK_MASK) - -#define CAN_FLT_ID2_IDMASK_IDE_MSK_MASK (0x40000000U) -#define CAN_FLT_ID2_IDMASK_IDE_MSK_SHIFT (30U) -/*! IDE_MSK - ID Extended Mask - * 0b0..The corresponding bit in the filter is "don't care." - * 0b1..The corresponding bit in the filter is checked. - */ -#define CAN_FLT_ID2_IDMASK_IDE_MSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_ID2_IDMASK_IDE_MSK_SHIFT)) & CAN_FLT_ID2_IDMASK_IDE_MSK_MASK) -/*! @} */ - -/*! @name PL2_PLMASK_LO - Pretended Networking Payload Low Filter 2 and Payload Low Mask */ -/*! @{ */ - -#define CAN_PL2_PLMASK_LO_Data_byte_3_MASK (0xFFU) -#define CAN_PL2_PLMASK_LO_Data_byte_3_SHIFT (0U) -/*! Data_byte_3 - Data Byte 3 */ -#define CAN_PL2_PLMASK_LO_Data_byte_3(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_LO_Data_byte_3_SHIFT)) & CAN_PL2_PLMASK_LO_Data_byte_3_MASK) - -#define CAN_PL2_PLMASK_LO_Data_byte_2_MASK (0xFF00U) -#define CAN_PL2_PLMASK_LO_Data_byte_2_SHIFT (8U) -/*! Data_byte_2 - Data Byte 2 */ -#define CAN_PL2_PLMASK_LO_Data_byte_2(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_LO_Data_byte_2_SHIFT)) & CAN_PL2_PLMASK_LO_Data_byte_2_MASK) - -#define CAN_PL2_PLMASK_LO_Data_byte_1_MASK (0xFF0000U) -#define CAN_PL2_PLMASK_LO_Data_byte_1_SHIFT (16U) -/*! Data_byte_1 - Data Byte 1 */ -#define CAN_PL2_PLMASK_LO_Data_byte_1(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_LO_Data_byte_1_SHIFT)) & CAN_PL2_PLMASK_LO_Data_byte_1_MASK) - -#define CAN_PL2_PLMASK_LO_Data_byte_0_MASK (0xFF000000U) -#define CAN_PL2_PLMASK_LO_Data_byte_0_SHIFT (24U) -/*! Data_byte_0 - Data Byte 0 */ -#define CAN_PL2_PLMASK_LO_Data_byte_0(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_LO_Data_byte_0_SHIFT)) & CAN_PL2_PLMASK_LO_Data_byte_0_MASK) -/*! @} */ - -/*! @name PL2_PLMASK_HI - Pretended Networking Payload High Filter 2 and Payload High Mask */ -/*! @{ */ - -#define CAN_PL2_PLMASK_HI_Data_byte_7_MASK (0xFFU) -#define CAN_PL2_PLMASK_HI_Data_byte_7_SHIFT (0U) -/*! Data_byte_7 - Data Byte 7 */ -#define CAN_PL2_PLMASK_HI_Data_byte_7(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_HI_Data_byte_7_SHIFT)) & CAN_PL2_PLMASK_HI_Data_byte_7_MASK) - -#define CAN_PL2_PLMASK_HI_Data_byte_6_MASK (0xFF00U) -#define CAN_PL2_PLMASK_HI_Data_byte_6_SHIFT (8U) -/*! Data_byte_6 - Data Byte 6 */ -#define CAN_PL2_PLMASK_HI_Data_byte_6(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_HI_Data_byte_6_SHIFT)) & CAN_PL2_PLMASK_HI_Data_byte_6_MASK) - -#define CAN_PL2_PLMASK_HI_Data_byte_5_MASK (0xFF0000U) -#define CAN_PL2_PLMASK_HI_Data_byte_5_SHIFT (16U) -/*! Data_byte_5 - Data Byte 5 */ -#define CAN_PL2_PLMASK_HI_Data_byte_5(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_HI_Data_byte_5_SHIFT)) & CAN_PL2_PLMASK_HI_Data_byte_5_MASK) - -#define CAN_PL2_PLMASK_HI_Data_byte_4_MASK (0xFF000000U) -#define CAN_PL2_PLMASK_HI_Data_byte_4_SHIFT (24U) -/*! Data_byte_4 - Data Byte 4 */ -#define CAN_PL2_PLMASK_HI_Data_byte_4(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_HI_Data_byte_4_SHIFT)) & CAN_PL2_PLMASK_HI_Data_byte_4_MASK) -/*! @} */ - -/*! @name WMB_CS - Wake-Up Message Buffer */ -/*! @{ */ - -#define CAN_WMB_CS_DLC_MASK (0xF0000U) -#define CAN_WMB_CS_DLC_SHIFT (16U) -/*! DLC - Length of Data in Bytes */ -#define CAN_WMB_CS_DLC(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_CS_DLC_SHIFT)) & CAN_WMB_CS_DLC_MASK) - -#define CAN_WMB_CS_RTR_MASK (0x100000U) -#define CAN_WMB_CS_RTR_SHIFT (20U) -/*! RTR - Remote Transmission Request - * 0b0..Data - * 0b1..Remote - */ -#define CAN_WMB_CS_RTR(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_CS_RTR_SHIFT)) & CAN_WMB_CS_RTR_MASK) - -#define CAN_WMB_CS_IDE_MASK (0x200000U) -#define CAN_WMB_CS_IDE_SHIFT (21U) -/*! IDE - ID Extended Bit - * 0b0..Standard - * 0b1..Extended - */ -#define CAN_WMB_CS_IDE(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_CS_IDE_SHIFT)) & CAN_WMB_CS_IDE_MASK) - -#define CAN_WMB_CS_SRR_MASK (0x400000U) -#define CAN_WMB_CS_SRR_SHIFT (22U) -/*! SRR - Substitute Remote Request - * 0b0..Dominant - * 0b1..Recessive - */ -#define CAN_WMB_CS_SRR(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_CS_SRR_SHIFT)) & CAN_WMB_CS_SRR_MASK) -/*! @} */ - -/* The count of CAN_WMB_CS */ -#define CAN_WMB_CS_COUNT (4U) - -/*! @name WMB_ID - Wake-Up Message Buffer for ID */ -/*! @{ */ - -#define CAN_WMB_ID_ID_MASK (0x1FFFFFFFU) -#define CAN_WMB_ID_ID_SHIFT (0U) -/*! ID - Received ID in Pretended Networking Mode */ -#define CAN_WMB_ID_ID(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_ID_ID_SHIFT)) & CAN_WMB_ID_ID_MASK) -/*! @} */ - -/* The count of CAN_WMB_ID */ -#define CAN_WMB_ID_COUNT (4U) - -/*! @name WMB_D03 - Wake-Up Message Buffer for Data 0-3 */ -/*! @{ */ - -#define CAN_WMB_D03_Data_byte_3_MASK (0xFFU) -#define CAN_WMB_D03_Data_byte_3_SHIFT (0U) -/*! Data_byte_3 - Data Byte 3 */ -#define CAN_WMB_D03_Data_byte_3(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D03_Data_byte_3_SHIFT)) & CAN_WMB_D03_Data_byte_3_MASK) - -#define CAN_WMB_D03_Data_byte_2_MASK (0xFF00U) -#define CAN_WMB_D03_Data_byte_2_SHIFT (8U) -/*! Data_byte_2 - Data Byte 2 */ -#define CAN_WMB_D03_Data_byte_2(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D03_Data_byte_2_SHIFT)) & CAN_WMB_D03_Data_byte_2_MASK) - -#define CAN_WMB_D03_Data_byte_1_MASK (0xFF0000U) -#define CAN_WMB_D03_Data_byte_1_SHIFT (16U) -/*! Data_byte_1 - Data Byte 1 */ -#define CAN_WMB_D03_Data_byte_1(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D03_Data_byte_1_SHIFT)) & CAN_WMB_D03_Data_byte_1_MASK) - -#define CAN_WMB_D03_Data_byte_0_MASK (0xFF000000U) -#define CAN_WMB_D03_Data_byte_0_SHIFT (24U) -/*! Data_byte_0 - Data Byte 0 */ -#define CAN_WMB_D03_Data_byte_0(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D03_Data_byte_0_SHIFT)) & CAN_WMB_D03_Data_byte_0_MASK) -/*! @} */ - -/* The count of CAN_WMB_D03 */ -#define CAN_WMB_D03_COUNT (4U) - -/*! @name WMB_D47 - Wake-Up Message Buffer Register Data 4-7 */ -/*! @{ */ - -#define CAN_WMB_D47_Data_byte_7_MASK (0xFFU) -#define CAN_WMB_D47_Data_byte_7_SHIFT (0U) -/*! Data_byte_7 - Data Byte 7 */ -#define CAN_WMB_D47_Data_byte_7(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D47_Data_byte_7_SHIFT)) & CAN_WMB_D47_Data_byte_7_MASK) - -#define CAN_WMB_D47_Data_byte_6_MASK (0xFF00U) -#define CAN_WMB_D47_Data_byte_6_SHIFT (8U) -/*! Data_byte_6 - Data Byte 6 */ -#define CAN_WMB_D47_Data_byte_6(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D47_Data_byte_6_SHIFT)) & CAN_WMB_D47_Data_byte_6_MASK) - -#define CAN_WMB_D47_Data_byte_5_MASK (0xFF0000U) -#define CAN_WMB_D47_Data_byte_5_SHIFT (16U) -/*! Data_byte_5 - Data Byte 5 */ -#define CAN_WMB_D47_Data_byte_5(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D47_Data_byte_5_SHIFT)) & CAN_WMB_D47_Data_byte_5_MASK) - -#define CAN_WMB_D47_Data_byte_4_MASK (0xFF000000U) -#define CAN_WMB_D47_Data_byte_4_SHIFT (24U) -/*! Data_byte_4 - Data Byte 4 */ -#define CAN_WMB_D47_Data_byte_4(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D47_Data_byte_4_SHIFT)) & CAN_WMB_D47_Data_byte_4_MASK) -/*! @} */ - -/* The count of CAN_WMB_D47 */ -#define CAN_WMB_D47_COUNT (4U) - -/*! @name EPRS - Enhanced CAN Bit Timing Prescalers */ -/*! @{ */ - -#define CAN_EPRS_ENPRESDIV_MASK (0x3FFU) -#define CAN_EPRS_ENPRESDIV_SHIFT (0U) -/*! ENPRESDIV - Extended Nominal Prescaler Division Factor */ -#define CAN_EPRS_ENPRESDIV(x) (((uint32_t)(((uint32_t)(x)) << CAN_EPRS_ENPRESDIV_SHIFT)) & CAN_EPRS_ENPRESDIV_MASK) - -#define CAN_EPRS_EDPRESDIV_MASK (0x3FF0000U) -#define CAN_EPRS_EDPRESDIV_SHIFT (16U) -/*! EDPRESDIV - Extended Data Phase Prescaler Division Factor */ -#define CAN_EPRS_EDPRESDIV(x) (((uint32_t)(((uint32_t)(x)) << CAN_EPRS_EDPRESDIV_SHIFT)) & CAN_EPRS_EDPRESDIV_MASK) -/*! @} */ - -/*! @name ENCBT - Enhanced Nominal CAN Bit Timing */ -/*! @{ */ - -#define CAN_ENCBT_NTSEG1_MASK (0xFFU) -#define CAN_ENCBT_NTSEG1_SHIFT (0U) -/*! NTSEG1 - Nominal Time Segment 1 */ -#define CAN_ENCBT_NTSEG1(x) (((uint32_t)(((uint32_t)(x)) << CAN_ENCBT_NTSEG1_SHIFT)) & CAN_ENCBT_NTSEG1_MASK) - -#define CAN_ENCBT_NTSEG2_MASK (0x7F000U) -#define CAN_ENCBT_NTSEG2_SHIFT (12U) -/*! NTSEG2 - Nominal Time Segment 2 */ -#define CAN_ENCBT_NTSEG2(x) (((uint32_t)(((uint32_t)(x)) << CAN_ENCBT_NTSEG2_SHIFT)) & CAN_ENCBT_NTSEG2_MASK) - -#define CAN_ENCBT_NRJW_MASK (0x1FC00000U) -#define CAN_ENCBT_NRJW_SHIFT (22U) -/*! NRJW - Nominal Resynchronization Jump Width */ -#define CAN_ENCBT_NRJW(x) (((uint32_t)(((uint32_t)(x)) << CAN_ENCBT_NRJW_SHIFT)) & CAN_ENCBT_NRJW_MASK) -/*! @} */ - -/*! @name EDCBT - Enhanced Data Phase CAN Bit Timing */ -/*! @{ */ - -#define CAN_EDCBT_DTSEG1_MASK (0x1FU) -#define CAN_EDCBT_DTSEG1_SHIFT (0U) -/*! DTSEG1 - Data Phase Segment 1 */ -#define CAN_EDCBT_DTSEG1(x) (((uint32_t)(((uint32_t)(x)) << CAN_EDCBT_DTSEG1_SHIFT)) & CAN_EDCBT_DTSEG1_MASK) - -#define CAN_EDCBT_DTSEG2_MASK (0xF000U) -#define CAN_EDCBT_DTSEG2_SHIFT (12U) -/*! DTSEG2 - Data Phase Time Segment 2 */ -#define CAN_EDCBT_DTSEG2(x) (((uint32_t)(((uint32_t)(x)) << CAN_EDCBT_DTSEG2_SHIFT)) & CAN_EDCBT_DTSEG2_MASK) - -#define CAN_EDCBT_DRJW_MASK (0x3C00000U) -#define CAN_EDCBT_DRJW_SHIFT (22U) -/*! DRJW - Data Phase Resynchronization Jump Width */ -#define CAN_EDCBT_DRJW(x) (((uint32_t)(((uint32_t)(x)) << CAN_EDCBT_DRJW_SHIFT)) & CAN_EDCBT_DRJW_MASK) -/*! @} */ - -/*! @name ETDC - Enhanced Transceiver Delay Compensation */ -/*! @{ */ - -#define CAN_ETDC_ETDCVAL_MASK (0xFFU) -#define CAN_ETDC_ETDCVAL_SHIFT (0U) -/*! ETDCVAL - Enhanced Transceiver Delay Compensation Value */ -#define CAN_ETDC_ETDCVAL(x) (((uint32_t)(((uint32_t)(x)) << CAN_ETDC_ETDCVAL_SHIFT)) & CAN_ETDC_ETDCVAL_MASK) - -#define CAN_ETDC_ETDCFAIL_MASK (0x8000U) -#define CAN_ETDC_ETDCFAIL_SHIFT (15U) -/*! ETDCFAIL - Transceiver Delay Compensation Fail - * 0b0..In range - * 0b1..Out of range - */ -#define CAN_ETDC_ETDCFAIL(x) (((uint32_t)(((uint32_t)(x)) << CAN_ETDC_ETDCFAIL_SHIFT)) & CAN_ETDC_ETDCFAIL_MASK) - -#define CAN_ETDC_ETDCOFF_MASK (0x7F0000U) -#define CAN_ETDC_ETDCOFF_SHIFT (16U) -/*! ETDCOFF - Enhanced Transceiver Delay Compensation Offset */ -#define CAN_ETDC_ETDCOFF(x) (((uint32_t)(((uint32_t)(x)) << CAN_ETDC_ETDCOFF_SHIFT)) & CAN_ETDC_ETDCOFF_MASK) - -#define CAN_ETDC_TDMDIS_MASK (0x40000000U) -#define CAN_ETDC_TDMDIS_SHIFT (30U) -/*! TDMDIS - Transceiver Delay Measurement Disable - * 0b0..Enable - * 0b1..Disable - */ -#define CAN_ETDC_TDMDIS(x) (((uint32_t)(((uint32_t)(x)) << CAN_ETDC_TDMDIS_SHIFT)) & CAN_ETDC_TDMDIS_MASK) - -#define CAN_ETDC_ETDCEN_MASK (0x80000000U) -#define CAN_ETDC_ETDCEN_SHIFT (31U) -/*! ETDCEN - Transceiver Delay Compensation Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_ETDC_ETDCEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_ETDC_ETDCEN_SHIFT)) & CAN_ETDC_ETDCEN_MASK) -/*! @} */ - -/*! @name FDCTRL - CAN FD Control */ -/*! @{ */ - -#define CAN_FDCTRL_TDCVAL_MASK (0x3FU) -#define CAN_FDCTRL_TDCVAL_SHIFT (0U) -/*! TDCVAL - Transceiver Delay Compensation Value */ -#define CAN_FDCTRL_TDCVAL(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCTRL_TDCVAL_SHIFT)) & CAN_FDCTRL_TDCVAL_MASK) - -#define CAN_FDCTRL_TDCOFF_MASK (0x1F00U) -#define CAN_FDCTRL_TDCOFF_SHIFT (8U) -/*! TDCOFF - Transceiver Delay Compensation Offset */ -#define CAN_FDCTRL_TDCOFF(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCTRL_TDCOFF_SHIFT)) & CAN_FDCTRL_TDCOFF_MASK) - -#define CAN_FDCTRL_TDCFAIL_MASK (0x4000U) -#define CAN_FDCTRL_TDCFAIL_SHIFT (14U) -/*! TDCFAIL - Transceiver Delay Compensation Fail - * 0b0..In range - * 0b1..Out of range - */ -#define CAN_FDCTRL_TDCFAIL(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCTRL_TDCFAIL_SHIFT)) & CAN_FDCTRL_TDCFAIL_MASK) - -#define CAN_FDCTRL_TDCEN_MASK (0x8000U) -#define CAN_FDCTRL_TDCEN_SHIFT (15U) -/*! TDCEN - Transceiver Delay Compensation Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_FDCTRL_TDCEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCTRL_TDCEN_SHIFT)) & CAN_FDCTRL_TDCEN_MASK) - -#define CAN_FDCTRL_MBDSR0_MASK (0x30000U) -#define CAN_FDCTRL_MBDSR0_SHIFT (16U) -/*! MBDSR0 - Message Buffer Data Size for Region 0 - * 0b00..8 bytes - * 0b01..16 bytes - * 0b10..32 bytes - * 0b11..64 bytes - */ -#define CAN_FDCTRL_MBDSR0(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCTRL_MBDSR0_SHIFT)) & CAN_FDCTRL_MBDSR0_MASK) - -#define CAN_FDCTRL_FDRATE_MASK (0x80000000U) -#define CAN_FDCTRL_FDRATE_SHIFT (31U) -/*! FDRATE - Bit Rate Switch Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_FDCTRL_FDRATE(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCTRL_FDRATE_SHIFT)) & CAN_FDCTRL_FDRATE_MASK) -/*! @} */ - -/*! @name FDCBT - CAN FD Bit Timing */ -/*! @{ */ - -#define CAN_FDCBT_FPSEG2_MASK (0x7U) -#define CAN_FDCBT_FPSEG2_SHIFT (0U) -/*! FPSEG2 - Fast Phase Segment 2 */ -#define CAN_FDCBT_FPSEG2(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCBT_FPSEG2_SHIFT)) & CAN_FDCBT_FPSEG2_MASK) - -#define CAN_FDCBT_FPSEG1_MASK (0xE0U) -#define CAN_FDCBT_FPSEG1_SHIFT (5U) -/*! FPSEG1 - Fast Phase Segment 1 */ -#define CAN_FDCBT_FPSEG1(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCBT_FPSEG1_SHIFT)) & CAN_FDCBT_FPSEG1_MASK) - -#define CAN_FDCBT_FPROPSEG_MASK (0x7C00U) -#define CAN_FDCBT_FPROPSEG_SHIFT (10U) -/*! FPROPSEG - Fast Propagation Segment */ -#define CAN_FDCBT_FPROPSEG(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCBT_FPROPSEG_SHIFT)) & CAN_FDCBT_FPROPSEG_MASK) - -#define CAN_FDCBT_FRJW_MASK (0x70000U) -#define CAN_FDCBT_FRJW_SHIFT (16U) -/*! FRJW - Fast Resync Jump Width */ -#define CAN_FDCBT_FRJW(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCBT_FRJW_SHIFT)) & CAN_FDCBT_FRJW_MASK) - -#define CAN_FDCBT_FPRESDIV_MASK (0x3FF00000U) -#define CAN_FDCBT_FPRESDIV_SHIFT (20U) -/*! FPRESDIV - Fast Prescaler Division Factor */ -#define CAN_FDCBT_FPRESDIV(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCBT_FPRESDIV_SHIFT)) & CAN_FDCBT_FPRESDIV_MASK) -/*! @} */ - -/*! @name FDCRC - CAN FD CRC */ -/*! @{ */ - -#define CAN_FDCRC_FD_TXCRC_MASK (0x1FFFFFU) -#define CAN_FDCRC_FD_TXCRC_SHIFT (0U) -/*! FD_TXCRC - Extended Transmitted CRC value */ -#define CAN_FDCRC_FD_TXCRC(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCRC_FD_TXCRC_SHIFT)) & CAN_FDCRC_FD_TXCRC_MASK) - -#define CAN_FDCRC_FD_MBCRC_MASK (0x7F000000U) -#define CAN_FDCRC_FD_MBCRC_SHIFT (24U) -/*! FD_MBCRC - CRC Message Buffer Number for FD_TXCRC */ -#define CAN_FDCRC_FD_MBCRC(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCRC_FD_MBCRC_SHIFT)) & CAN_FDCRC_FD_MBCRC_MASK) -/*! @} */ - -/*! @name ERFCR - Enhanced RX FIFO Control */ -/*! @{ */ - -#define CAN_ERFCR_ERFWM_MASK (0x1FU) -#define CAN_ERFCR_ERFWM_SHIFT (0U) -/*! ERFWM - Enhanced RX FIFO Watermark */ -#define CAN_ERFCR_ERFWM(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFCR_ERFWM_SHIFT)) & CAN_ERFCR_ERFWM_MASK) - -#define CAN_ERFCR_NFE_MASK (0x3F00U) -#define CAN_ERFCR_NFE_SHIFT (8U) -/*! NFE - Number of Enhanced RX FIFO Filter Elements */ -#define CAN_ERFCR_NFE(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFCR_NFE_SHIFT)) & CAN_ERFCR_NFE_MASK) - -#define CAN_ERFCR_NEXIF_MASK (0x7F0000U) -#define CAN_ERFCR_NEXIF_SHIFT (16U) -/*! NEXIF - Number of Extended ID Filter Elements */ -#define CAN_ERFCR_NEXIF(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFCR_NEXIF_SHIFT)) & CAN_ERFCR_NEXIF_MASK) - -#define CAN_ERFCR_DMALW_MASK (0x7C000000U) -#define CAN_ERFCR_DMALW_SHIFT (26U) -/*! DMALW - DMA Last Word */ -#define CAN_ERFCR_DMALW(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFCR_DMALW_SHIFT)) & CAN_ERFCR_DMALW_MASK) - -#define CAN_ERFCR_ERFEN_MASK (0x80000000U) -#define CAN_ERFCR_ERFEN_SHIFT (31U) -/*! ERFEN - Enhanced RX FIFO enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_ERFCR_ERFEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFCR_ERFEN_SHIFT)) & CAN_ERFCR_ERFEN_MASK) -/*! @} */ - -/*! @name ERFIER - Enhanced RX FIFO Interrupt Enable */ -/*! @{ */ - -#define CAN_ERFIER_ERFDAIE_MASK (0x10000000U) -#define CAN_ERFIER_ERFDAIE_SHIFT (28U) -/*! ERFDAIE - Enhanced RX FIFO Data Available Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_ERFIER_ERFDAIE(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFIER_ERFDAIE_SHIFT)) & CAN_ERFIER_ERFDAIE_MASK) - -#define CAN_ERFIER_ERFWMIIE_MASK (0x20000000U) -#define CAN_ERFIER_ERFWMIIE_SHIFT (29U) -/*! ERFWMIIE - Enhanced RX FIFO Watermark Indication Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_ERFIER_ERFWMIIE(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFIER_ERFWMIIE_SHIFT)) & CAN_ERFIER_ERFWMIIE_MASK) - -#define CAN_ERFIER_ERFOVFIE_MASK (0x40000000U) -#define CAN_ERFIER_ERFOVFIE_SHIFT (30U) -/*! ERFOVFIE - Enhanced RX FIFO Overflow Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_ERFIER_ERFOVFIE(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFIER_ERFOVFIE_SHIFT)) & CAN_ERFIER_ERFOVFIE_MASK) - -#define CAN_ERFIER_ERFUFWIE_MASK (0x80000000U) -#define CAN_ERFIER_ERFUFWIE_SHIFT (31U) -/*! ERFUFWIE - Enhanced RX FIFO Underflow Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_ERFIER_ERFUFWIE(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFIER_ERFUFWIE_SHIFT)) & CAN_ERFIER_ERFUFWIE_MASK) -/*! @} */ - -/*! @name ERFSR - Enhanced RX FIFO Status */ -/*! @{ */ - -#define CAN_ERFSR_ERFEL_MASK (0x3FU) -#define CAN_ERFSR_ERFEL_SHIFT (0U) -/*! ERFEL - Enhanced RX FIFO Elements */ -#define CAN_ERFSR_ERFEL(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFEL_SHIFT)) & CAN_ERFSR_ERFEL_MASK) - -#define CAN_ERFSR_ERFF_MASK (0x10000U) -#define CAN_ERFSR_ERFF_SHIFT (16U) -/*! ERFF - Enhanced RX FIFO Full Flag - * 0b0..Not full - * 0b1..Full - */ -#define CAN_ERFSR_ERFF(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFF_SHIFT)) & CAN_ERFSR_ERFF_MASK) - -#define CAN_ERFSR_ERFE_MASK (0x20000U) -#define CAN_ERFSR_ERFE_SHIFT (17U) -/*! ERFE - Enhanced RX FIFO Empty Flag - * 0b0..Not empty - * 0b1..Empty - */ -#define CAN_ERFSR_ERFE(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFE_SHIFT)) & CAN_ERFSR_ERFE_MASK) - -#define CAN_ERFSR_ERFCLR_MASK (0x8000000U) -#define CAN_ERFSR_ERFCLR_SHIFT (27U) -/*! ERFCLR - Enhanced RX FIFO Clear - * 0b0..No effect - * 0b1..Clear enhanced RX FIFO content - */ -#define CAN_ERFSR_ERFCLR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFCLR_SHIFT)) & CAN_ERFSR_ERFCLR_MASK) - -#define CAN_ERFSR_ERFDA_MASK (0x10000000U) -#define CAN_ERFSR_ERFDA_SHIFT (28U) -/*! ERFDA - Enhanced RX FIFO Data Available Flag - * 0b0..No such occurrence - * 0b1..At least one message stored in Enhanced RX FIFO - */ -#define CAN_ERFSR_ERFDA(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFDA_SHIFT)) & CAN_ERFSR_ERFDA_MASK) - -#define CAN_ERFSR_ERFWMI_MASK (0x20000000U) -#define CAN_ERFSR_ERFWMI_SHIFT (29U) -/*! ERFWMI - Enhanced RX FIFO Watermark Indication Flag - * 0b0..No such occurrence - * 0b1..Number of messages in FIFO is greater than the watermark - */ -#define CAN_ERFSR_ERFWMI(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFWMI_SHIFT)) & CAN_ERFSR_ERFWMI_MASK) - -#define CAN_ERFSR_ERFOVF_MASK (0x40000000U) -#define CAN_ERFSR_ERFOVF_SHIFT (30U) -/*! ERFOVF - Enhanced RX FIFO Overflow Flag - * 0b0..No such occurrence - * 0b1..Overflow - */ -#define CAN_ERFSR_ERFOVF(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFOVF_SHIFT)) & CAN_ERFSR_ERFOVF_MASK) - -#define CAN_ERFSR_ERFUFW_MASK (0x80000000U) -#define CAN_ERFSR_ERFUFW_SHIFT (31U) -/*! ERFUFW - Enhanced RX FIFO Underflow Flag - * 0b0..No such occurrence - * 0b1..Underflow - */ -#define CAN_ERFSR_ERFUFW(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFUFW_SHIFT)) & CAN_ERFSR_ERFUFW_MASK) -/*! @} */ - -/*! @name ERFFEL - Enhanced RX FIFO Filter Element */ -/*! @{ */ - -#define CAN_ERFFEL_FEL_MASK (0xFFFFFFFFU) -#define CAN_ERFFEL_FEL_SHIFT (0U) -/*! FEL - Filter Element Bits */ -#define CAN_ERFFEL_FEL(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFFEL_FEL_SHIFT)) & CAN_ERFFEL_FEL_MASK) -/*! @} */ - -/* The count of CAN_ERFFEL */ -#define CAN_ERFFEL_COUNT (32U) - - -/*! - * @} - */ /* end of group CAN_Register_Masks */ - - -/* CAN - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral CAN0 base address */ - #define CAN0_BASE (0x500D4000u) - /** Peripheral CAN0 base address */ - #define CAN0_BASE_NS (0x400D4000u) - /** Peripheral CAN0 base pointer */ - #define CAN0 ((CAN_Type *)CAN0_BASE) - /** Peripheral CAN0 base pointer */ - #define CAN0_NS ((CAN_Type *)CAN0_BASE_NS) - /** Peripheral CAN1 base address */ - #define CAN1_BASE (0x500D8000u) - /** Peripheral CAN1 base address */ - #define CAN1_BASE_NS (0x400D8000u) - /** Peripheral CAN1 base pointer */ - #define CAN1 ((CAN_Type *)CAN1_BASE) - /** Peripheral CAN1 base pointer */ - #define CAN1_NS ((CAN_Type *)CAN1_BASE_NS) - /** Array initializer of CAN peripheral base addresses */ - #define CAN_BASE_ADDRS { CAN0_BASE, CAN1_BASE } - /** Array initializer of CAN peripheral base pointers */ - #define CAN_BASE_PTRS { CAN0, CAN1 } - /** Array initializer of CAN peripheral base addresses */ - #define CAN_BASE_ADDRS_NS { CAN0_BASE_NS, CAN1_BASE_NS } - /** Array initializer of CAN peripheral base pointers */ - #define CAN_BASE_PTRS_NS { CAN0_NS, CAN1_NS } -#else - /** Peripheral CAN0 base address */ - #define CAN0_BASE (0x400D4000u) - /** Peripheral CAN0 base pointer */ - #define CAN0 ((CAN_Type *)CAN0_BASE) - /** Peripheral CAN1 base address */ - #define CAN1_BASE (0x400D8000u) - /** Peripheral CAN1 base pointer */ - #define CAN1 ((CAN_Type *)CAN1_BASE) - /** Array initializer of CAN peripheral base addresses */ - #define CAN_BASE_ADDRS { CAN0_BASE, CAN1_BASE } - /** Array initializer of CAN peripheral base pointers */ - #define CAN_BASE_PTRS { CAN0, CAN1 } -#endif -/** Interrupt vectors for the CAN peripheral type */ -#define CAN_Rx_Warning_IRQS { CAN0_IRQn, CAN1_IRQn } -#define CAN_Tx_Warning_IRQS { CAN0_IRQn, CAN1_IRQn } -#define CAN_Wake_Up_IRQS { CAN0_IRQn, CAN1_IRQn } -#define CAN_Error_IRQS { CAN0_IRQn, CAN1_IRQn } -#define CAN_Bus_Off_IRQS { CAN0_IRQn, CAN1_IRQn } -#define CAN_ORed_Message_buffer_IRQS { CAN0_IRQn, CAN1_IRQn } - -/*! - * @} - */ /* end of group CAN_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- CDOG Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CDOG_Peripheral_Access_Layer CDOG Peripheral Access Layer - * @{ - */ - -/** CDOG - Register Layout Typedef */ -typedef struct { - __IO uint32_t CONTROL; /**< Control Register, offset: 0x0 */ - __IO uint32_t RELOAD; /**< Instruction Timer Reload Register, offset: 0x4 */ - __I uint32_t INSTRUCTION_TIMER; /**< Instruction Timer Register, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __I uint32_t STATUS; /**< Status 1 Register, offset: 0x10 */ - __I uint32_t STATUS2; /**< Status 2 Register, offset: 0x14 */ - __IO uint32_t FLAGS; /**< Flags Register, offset: 0x18 */ - __IO uint32_t PERSISTENT; /**< Persistent Data Storage Register, offset: 0x1C */ - __O uint32_t START; /**< START Command Register, offset: 0x20 */ - __O uint32_t STOP; /**< STOP Command Register, offset: 0x24 */ - __O uint32_t RESTART; /**< RESTART Command Register, offset: 0x28 */ - __O uint32_t ADD; /**< ADD Command Register, offset: 0x2C */ - __O uint32_t ADD1; /**< ADD1 Command Register, offset: 0x30 */ - __O uint32_t ADD16; /**< ADD16 Command Register, offset: 0x34 */ - __O uint32_t ADD256; /**< ADD256 Command Register, offset: 0x38 */ - __O uint32_t SUB; /**< SUB Command Register, offset: 0x3C */ - __O uint32_t SUB1; /**< SUB1 Command Register, offset: 0x40 */ - __O uint32_t SUB16; /**< SUB16 Command Register, offset: 0x44 */ - __O uint32_t SUB256; /**< SUB256 Command Register, offset: 0x48 */ - __O uint32_t ASSERT16; /**< ASSERT16 Command Register, offset: 0x4C */ -} CDOG_Type; - -/* ---------------------------------------------------------------------------- - -- CDOG Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CDOG_Register_Masks CDOG Register Masks - * @{ - */ - -/*! @name CONTROL - Control Register */ -/*! @{ */ - -#define CDOG_CONTROL_LOCK_CTRL_MASK (0x3U) -#define CDOG_CONTROL_LOCK_CTRL_SHIFT (0U) -/*! LOCK_CTRL - Lock control - * 0b01..Locked - * 0b10..Unlocked - */ -#define CDOG_CONTROL_LOCK_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_LOCK_CTRL_SHIFT)) & CDOG_CONTROL_LOCK_CTRL_MASK) - -#define CDOG_CONTROL_TIMEOUT_CTRL_MASK (0x1CU) -#define CDOG_CONTROL_TIMEOUT_CTRL_SHIFT (2U) -/*! TIMEOUT_CTRL - TIMEOUT fault control - * 0b100..Disable both reset and interrupt - * 0b001..Enable reset - * 0b010..Enable interrupt - */ -#define CDOG_CONTROL_TIMEOUT_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_TIMEOUT_CTRL_SHIFT)) & CDOG_CONTROL_TIMEOUT_CTRL_MASK) - -#define CDOG_CONTROL_MISCOMPARE_CTRL_MASK (0xE0U) -#define CDOG_CONTROL_MISCOMPARE_CTRL_SHIFT (5U) -/*! MISCOMPARE_CTRL - MISCOMPARE fault control - * 0b100..Disable both reset and interrupt - * 0b001..Enable reset - * 0b010..Enable interrupt - */ -#define CDOG_CONTROL_MISCOMPARE_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_MISCOMPARE_CTRL_SHIFT)) & CDOG_CONTROL_MISCOMPARE_CTRL_MASK) - -#define CDOG_CONTROL_SEQUENCE_CTRL_MASK (0x700U) -#define CDOG_CONTROL_SEQUENCE_CTRL_SHIFT (8U) -/*! SEQUENCE_CTRL - SEQUENCE fault control - * 0b001..Enable reset - * 0b010..Enable interrupt - * 0b100..Disable both reset and interrupt - */ -#define CDOG_CONTROL_SEQUENCE_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_SEQUENCE_CTRL_SHIFT)) & CDOG_CONTROL_SEQUENCE_CTRL_MASK) - -#define CDOG_CONTROL_STATE_CTRL_MASK (0x1C000U) -#define CDOG_CONTROL_STATE_CTRL_SHIFT (14U) -/*! STATE_CTRL - STATE fault control - * 0b001..Enable reset - * 0b010..Enable interrupt - * 0b100..Disable both reset and interrupt - */ -#define CDOG_CONTROL_STATE_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_STATE_CTRL_SHIFT)) & CDOG_CONTROL_STATE_CTRL_MASK) - -#define CDOG_CONTROL_ADDRESS_CTRL_MASK (0xE0000U) -#define CDOG_CONTROL_ADDRESS_CTRL_SHIFT (17U) -/*! ADDRESS_CTRL - ADDRESS fault control - * 0b001..Enable reset - * 0b010..Enable interrupt - * 0b100..Disable both reset and interrupt - */ -#define CDOG_CONTROL_ADDRESS_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_ADDRESS_CTRL_SHIFT)) & CDOG_CONTROL_ADDRESS_CTRL_MASK) - -#define CDOG_CONTROL_IRQ_PAUSE_MASK (0x30000000U) -#define CDOG_CONTROL_IRQ_PAUSE_SHIFT (28U) -/*! IRQ_PAUSE - IRQ pause control - * 0b01..Keep the timer running - * 0b10..Stop the timer - */ -#define CDOG_CONTROL_IRQ_PAUSE(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_IRQ_PAUSE_SHIFT)) & CDOG_CONTROL_IRQ_PAUSE_MASK) - -#define CDOG_CONTROL_DEBUG_HALT_CTRL_MASK (0xC0000000U) -#define CDOG_CONTROL_DEBUG_HALT_CTRL_SHIFT (30U) -/*! DEBUG_HALT_CTRL - DEBUG_HALT control - * 0b01..Keep the timer running - * 0b10..Stop the timer - */ -#define CDOG_CONTROL_DEBUG_HALT_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_DEBUG_HALT_CTRL_SHIFT)) & CDOG_CONTROL_DEBUG_HALT_CTRL_MASK) -/*! @} */ - -/*! @name RELOAD - Instruction Timer Reload Register */ -/*! @{ */ - -#define CDOG_RELOAD_RLOAD_MASK (0xFFFFFFFFU) -#define CDOG_RELOAD_RLOAD_SHIFT (0U) -/*! RLOAD - Instruction Timer reload value */ -#define CDOG_RELOAD_RLOAD(x) (((uint32_t)(((uint32_t)(x)) << CDOG_RELOAD_RLOAD_SHIFT)) & CDOG_RELOAD_RLOAD_MASK) -/*! @} */ - -/*! @name INSTRUCTION_TIMER - Instruction Timer Register */ -/*! @{ */ - -#define CDOG_INSTRUCTION_TIMER_INSTIM_MASK (0xFFFFFFFFU) -#define CDOG_INSTRUCTION_TIMER_INSTIM_SHIFT (0U) -/*! INSTIM - Current value of the Instruction Timer */ -#define CDOG_INSTRUCTION_TIMER_INSTIM(x) (((uint32_t)(((uint32_t)(x)) << CDOG_INSTRUCTION_TIMER_INSTIM_SHIFT)) & CDOG_INSTRUCTION_TIMER_INSTIM_MASK) -/*! @} */ - -/*! @name STATUS - Status 1 Register */ -/*! @{ */ - -#define CDOG_STATUS_NUMTOF_MASK (0xFFU) -#define CDOG_STATUS_NUMTOF_SHIFT (0U) -/*! NUMTOF - Number of TIMEOUT faults since the last POR */ -#define CDOG_STATUS_NUMTOF(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS_NUMTOF_SHIFT)) & CDOG_STATUS_NUMTOF_MASK) - -#define CDOG_STATUS_NUMMISCOMPF_MASK (0xFF00U) -#define CDOG_STATUS_NUMMISCOMPF_SHIFT (8U) -/*! NUMMISCOMPF - Number of MISCOMPARE faults since the last POR */ -#define CDOG_STATUS_NUMMISCOMPF(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS_NUMMISCOMPF_SHIFT)) & CDOG_STATUS_NUMMISCOMPF_MASK) - -#define CDOG_STATUS_NUMILSEQF_MASK (0xFF0000U) -#define CDOG_STATUS_NUMILSEQF_SHIFT (16U) -/*! NUMILSEQF - Number of SEQUENCE faults since the last POR */ -#define CDOG_STATUS_NUMILSEQF(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS_NUMILSEQF_SHIFT)) & CDOG_STATUS_NUMILSEQF_MASK) - -#define CDOG_STATUS_CURST_MASK (0xF0000000U) -#define CDOG_STATUS_CURST_SHIFT (28U) -/*! CURST - Current State */ -#define CDOG_STATUS_CURST(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS_CURST_SHIFT)) & CDOG_STATUS_CURST_MASK) -/*! @} */ - -/*! @name STATUS2 - Status 2 Register */ -/*! @{ */ - -#define CDOG_STATUS2_NUMCNTF_MASK (0xFFU) -#define CDOG_STATUS2_NUMCNTF_SHIFT (0U) -/*! NUMCNTF - Number of CONTROL faults since the last POR */ -#define CDOG_STATUS2_NUMCNTF(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS2_NUMCNTF_SHIFT)) & CDOG_STATUS2_NUMCNTF_MASK) - -#define CDOG_STATUS2_NUMILLSTF_MASK (0xFF00U) -#define CDOG_STATUS2_NUMILLSTF_SHIFT (8U) -/*! NUMILLSTF - Number of STATE faults since the last POR */ -#define CDOG_STATUS2_NUMILLSTF(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS2_NUMILLSTF_SHIFT)) & CDOG_STATUS2_NUMILLSTF_MASK) - -#define CDOG_STATUS2_NUMILLA_MASK (0xFF0000U) -#define CDOG_STATUS2_NUMILLA_SHIFT (16U) -/*! NUMILLA - Number of ADDRESS faults since the last POR */ -#define CDOG_STATUS2_NUMILLA(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS2_NUMILLA_SHIFT)) & CDOG_STATUS2_NUMILLA_MASK) -/*! @} */ - -/*! @name FLAGS - Flags Register */ -/*! @{ */ - -#define CDOG_FLAGS_TO_FLAG_MASK (0x1U) -#define CDOG_FLAGS_TO_FLAG_SHIFT (0U) -/*! TO_FLAG - TIMEOUT fault flag - * 0b0..A TIMEOUT fault has not occurred - * 0b1..A TIMEOUT fault has occurred - */ -#define CDOG_FLAGS_TO_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_TO_FLAG_SHIFT)) & CDOG_FLAGS_TO_FLAG_MASK) - -#define CDOG_FLAGS_MISCOM_FLAG_MASK (0x2U) -#define CDOG_FLAGS_MISCOM_FLAG_SHIFT (1U) -/*! MISCOM_FLAG - MISCOMPARE fault flag - * 0b0..A MISCOMPARE fault has not occurred - * 0b1..A MISCOMPARE fault has occurred - */ -#define CDOG_FLAGS_MISCOM_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_MISCOM_FLAG_SHIFT)) & CDOG_FLAGS_MISCOM_FLAG_MASK) - -#define CDOG_FLAGS_SEQ_FLAG_MASK (0x4U) -#define CDOG_FLAGS_SEQ_FLAG_SHIFT (2U) -/*! SEQ_FLAG - SEQUENCE fault flag - * 0b0..A SEQUENCE fault has not occurred - * 0b1..A SEQUENCE fault has occurred - */ -#define CDOG_FLAGS_SEQ_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_SEQ_FLAG_SHIFT)) & CDOG_FLAGS_SEQ_FLAG_MASK) - -#define CDOG_FLAGS_CNT_FLAG_MASK (0x8U) -#define CDOG_FLAGS_CNT_FLAG_SHIFT (3U) -/*! CNT_FLAG - CONTROL fault flag - * 0b0..A CONTROL fault has not occurred - * 0b1..A CONTROL fault has occurred - */ -#define CDOG_FLAGS_CNT_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_CNT_FLAG_SHIFT)) & CDOG_FLAGS_CNT_FLAG_MASK) - -#define CDOG_FLAGS_STATE_FLAG_MASK (0x10U) -#define CDOG_FLAGS_STATE_FLAG_SHIFT (4U) -/*! STATE_FLAG - STATE fault flag - * 0b0..A STATE fault has not occurred - * 0b1..A STATE fault has occurred - */ -#define CDOG_FLAGS_STATE_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_STATE_FLAG_SHIFT)) & CDOG_FLAGS_STATE_FLAG_MASK) - -#define CDOG_FLAGS_ADDR_FLAG_MASK (0x20U) -#define CDOG_FLAGS_ADDR_FLAG_SHIFT (5U) -/*! ADDR_FLAG - ADDRESS fault flag - * 0b0..An ADDRESS fault has not occurred - * 0b1..An ADDRESS fault has occurred - */ -#define CDOG_FLAGS_ADDR_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_ADDR_FLAG_SHIFT)) & CDOG_FLAGS_ADDR_FLAG_MASK) - -#define CDOG_FLAGS_POR_FLAG_MASK (0x10000U) -#define CDOG_FLAGS_POR_FLAG_SHIFT (16U) -/*! POR_FLAG - Power-on reset flag - * 0b0..A Power-on reset event has not occurred - * 0b1..A Power-on reset event has occurred - */ -#define CDOG_FLAGS_POR_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_POR_FLAG_SHIFT)) & CDOG_FLAGS_POR_FLAG_MASK) -/*! @} */ - -/*! @name PERSISTENT - Persistent Data Storage Register */ -/*! @{ */ - -#define CDOG_PERSISTENT_PERSIS_MASK (0xFFFFFFFFU) -#define CDOG_PERSISTENT_PERSIS_SHIFT (0U) -/*! PERSIS - Persistent Storage */ -#define CDOG_PERSISTENT_PERSIS(x) (((uint32_t)(((uint32_t)(x)) << CDOG_PERSISTENT_PERSIS_SHIFT)) & CDOG_PERSISTENT_PERSIS_MASK) -/*! @} */ - -/*! @name START - START Command Register */ -/*! @{ */ - -#define CDOG_START_STRT_MASK (0xFFFFFFFFU) -#define CDOG_START_STRT_SHIFT (0U) -/*! STRT - Start command */ -#define CDOG_START_STRT(x) (((uint32_t)(((uint32_t)(x)) << CDOG_START_STRT_SHIFT)) & CDOG_START_STRT_MASK) -/*! @} */ - -/*! @name STOP - STOP Command Register */ -/*! @{ */ - -#define CDOG_STOP_STP_MASK (0xFFFFFFFFU) -#define CDOG_STOP_STP_SHIFT (0U) -/*! STP - Stop command */ -#define CDOG_STOP_STP(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STOP_STP_SHIFT)) & CDOG_STOP_STP_MASK) -/*! @} */ - -/*! @name RESTART - RESTART Command Register */ -/*! @{ */ - -#define CDOG_RESTART_RSTRT_MASK (0xFFFFFFFFU) -#define CDOG_RESTART_RSTRT_SHIFT (0U) -/*! RSTRT - Restart command */ -#define CDOG_RESTART_RSTRT(x) (((uint32_t)(((uint32_t)(x)) << CDOG_RESTART_RSTRT_SHIFT)) & CDOG_RESTART_RSTRT_MASK) -/*! @} */ - -/*! @name ADD - ADD Command Register */ -/*! @{ */ - -#define CDOG_ADD_AD_MASK (0xFFFFFFFFU) -#define CDOG_ADD_AD_SHIFT (0U) -/*! AD - ADD Write Value */ -#define CDOG_ADD_AD(x) (((uint32_t)(((uint32_t)(x)) << CDOG_ADD_AD_SHIFT)) & CDOG_ADD_AD_MASK) -/*! @} */ - -/*! @name ADD1 - ADD1 Command Register */ -/*! @{ */ - -#define CDOG_ADD1_AD1_MASK (0xFFFFFFFFU) -#define CDOG_ADD1_AD1_SHIFT (0U) -/*! AD1 - ADD 1 */ -#define CDOG_ADD1_AD1(x) (((uint32_t)(((uint32_t)(x)) << CDOG_ADD1_AD1_SHIFT)) & CDOG_ADD1_AD1_MASK) -/*! @} */ - -/*! @name ADD16 - ADD16 Command Register */ -/*! @{ */ - -#define CDOG_ADD16_AD16_MASK (0xFFFFFFFFU) -#define CDOG_ADD16_AD16_SHIFT (0U) -/*! AD16 - ADD 16 */ -#define CDOG_ADD16_AD16(x) (((uint32_t)(((uint32_t)(x)) << CDOG_ADD16_AD16_SHIFT)) & CDOG_ADD16_AD16_MASK) -/*! @} */ - -/*! @name ADD256 - ADD256 Command Register */ -/*! @{ */ - -#define CDOG_ADD256_AD256_MASK (0xFFFFFFFFU) -#define CDOG_ADD256_AD256_SHIFT (0U) -/*! AD256 - ADD 256 */ -#define CDOG_ADD256_AD256(x) (((uint32_t)(((uint32_t)(x)) << CDOG_ADD256_AD256_SHIFT)) & CDOG_ADD256_AD256_MASK) -/*! @} */ - -/*! @name SUB - SUB Command Register */ -/*! @{ */ - -#define CDOG_SUB_SB_MASK (0xFFFFFFFFU) -#define CDOG_SUB_SB_SHIFT (0U) -/*! SB - Subtract Write Value */ -#define CDOG_SUB_SB(x) (((uint32_t)(((uint32_t)(x)) << CDOG_SUB_SB_SHIFT)) & CDOG_SUB_SB_MASK) -/*! @} */ - -/*! @name SUB1 - SUB1 Command Register */ -/*! @{ */ - -#define CDOG_SUB1_SB1_MASK (0xFFFFFFFFU) -#define CDOG_SUB1_SB1_SHIFT (0U) -/*! SB1 - Subtract 1 */ -#define CDOG_SUB1_SB1(x) (((uint32_t)(((uint32_t)(x)) << CDOG_SUB1_SB1_SHIFT)) & CDOG_SUB1_SB1_MASK) -/*! @} */ - -/*! @name SUB16 - SUB16 Command Register */ -/*! @{ */ - -#define CDOG_SUB16_SB16_MASK (0xFFFFFFFFU) -#define CDOG_SUB16_SB16_SHIFT (0U) -/*! SB16 - Subtract 16 */ -#define CDOG_SUB16_SB16(x) (((uint32_t)(((uint32_t)(x)) << CDOG_SUB16_SB16_SHIFT)) & CDOG_SUB16_SB16_MASK) -/*! @} */ - -/*! @name SUB256 - SUB256 Command Register */ -/*! @{ */ - -#define CDOG_SUB256_SB256_MASK (0xFFFFFFFFU) -#define CDOG_SUB256_SB256_SHIFT (0U) -/*! SB256 - Subtract 256 */ -#define CDOG_SUB256_SB256(x) (((uint32_t)(((uint32_t)(x)) << CDOG_SUB256_SB256_SHIFT)) & CDOG_SUB256_SB256_MASK) -/*! @} */ - -/*! @name ASSERT16 - ASSERT16 Command Register */ -/*! @{ */ - -#define CDOG_ASSERT16_AST16_MASK (0xFFFFFFFFU) -#define CDOG_ASSERT16_AST16_SHIFT (0U) -/*! AST16 - ASSERT16 Command */ -#define CDOG_ASSERT16_AST16(x) (((uint32_t)(((uint32_t)(x)) << CDOG_ASSERT16_AST16_SHIFT)) & CDOG_ASSERT16_AST16_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group CDOG_Register_Masks */ - - -/* CDOG - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral CDOG0 base address */ - #define CDOG0_BASE (0x500BB000u) - /** Peripheral CDOG0 base address */ - #define CDOG0_BASE_NS (0x400BB000u) - /** Peripheral CDOG0 base pointer */ - #define CDOG0 ((CDOG_Type *)CDOG0_BASE) - /** Peripheral CDOG0 base pointer */ - #define CDOG0_NS ((CDOG_Type *)CDOG0_BASE_NS) - /** Peripheral CDOG1 base address */ - #define CDOG1_BASE (0x500BC000u) - /** Peripheral CDOG1 base address */ - #define CDOG1_BASE_NS (0x400BC000u) - /** Peripheral CDOG1 base pointer */ - #define CDOG1 ((CDOG_Type *)CDOG1_BASE) - /** Peripheral CDOG1 base pointer */ - #define CDOG1_NS ((CDOG_Type *)CDOG1_BASE_NS) - /** Array initializer of CDOG peripheral base addresses */ - #define CDOG_BASE_ADDRS { CDOG0_BASE, CDOG1_BASE } - /** Array initializer of CDOG peripheral base pointers */ - #define CDOG_BASE_PTRS { CDOG0, CDOG1 } - /** Array initializer of CDOG peripheral base addresses */ - #define CDOG_BASE_ADDRS_NS { CDOG0_BASE_NS, CDOG1_BASE_NS } - /** Array initializer of CDOG peripheral base pointers */ - #define CDOG_BASE_PTRS_NS { CDOG0_NS, CDOG1_NS } -#else - /** Peripheral CDOG0 base address */ - #define CDOG0_BASE (0x400BB000u) - /** Peripheral CDOG0 base pointer */ - #define CDOG0 ((CDOG_Type *)CDOG0_BASE) - /** Peripheral CDOG1 base address */ - #define CDOG1_BASE (0x400BC000u) - /** Peripheral CDOG1 base pointer */ - #define CDOG1 ((CDOG_Type *)CDOG1_BASE) - /** Array initializer of CDOG peripheral base addresses */ - #define CDOG_BASE_ADDRS { CDOG0_BASE, CDOG1_BASE } - /** Array initializer of CDOG peripheral base pointers */ - #define CDOG_BASE_PTRS { CDOG0, CDOG1 } -#endif -/** Interrupt vectors for the CDOG peripheral type */ -#define CDOG_IRQS { CDOG0_IRQn, CDOG1_IRQn } - -/*! - * @} - */ /* end of group CDOG_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- CMC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CMC_Peripheral_Access_Layer CMC Peripheral Access Layer - * @{ - */ - -/** CMC - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - uint8_t RESERVED_0[12]; - __IO uint32_t CKCTRL; /**< Clock Control, offset: 0x10 */ - __IO uint32_t CKSTAT; /**< Clock Status, offset: 0x14 */ - __IO uint32_t PMPROT; /**< Power Mode Protection, offset: 0x18 */ - __O uint32_t GPMCTRL; /**< Global Power Mode Control, offset: 0x1C */ - __IO uint32_t PMCTRL[2]; /**< Power Mode Control, array offset: 0x20, array step: 0x4 */ - uint8_t RESERVED_1[88]; - __I uint32_t SRS; /**< System Reset Status, offset: 0x80 */ - __IO uint32_t RPC; /**< Reset Pin Control, offset: 0x84 */ - __IO uint32_t SSRS; /**< Sticky System Reset Status, offset: 0x88 */ - __IO uint32_t SRIE; /**< System Reset Interrupt Enable, offset: 0x8C */ - __IO uint32_t SRIF; /**< System Reset Interrupt Flag, offset: 0x90 */ - uint8_t RESERVED_2[8]; - __I uint32_t RSTCNT; /**< Reset Count Register, offset: 0x9C */ - __IO uint32_t MR[1]; /**< Mode, array offset: 0xA0, array step: 0x4 */ - uint8_t RESERVED_3[12]; - __IO uint32_t FM[1]; /**< Force Mode, array offset: 0xB0, array step: 0x4 */ - uint8_t RESERVED_4[12]; - __IO uint32_t SRAMDIS[1]; /**< SRAM Disable, array offset: 0xC0, array step: 0x4 */ - uint8_t RESERVED_5[12]; - __IO uint32_t SRAMRET[1]; /**< SRAM Retention, array offset: 0xD0, array step: 0x4 */ - uint8_t RESERVED_6[12]; - __IO uint32_t FLASHCR; /**< Flash Control, offset: 0xE0 */ - uint8_t RESERVED_7[28]; - __IO uint32_t BSR; /**< BootROM Status Register, offset: 0x100 */ - uint8_t RESERVED_8[8]; - __IO uint32_t BLR; /**< BootROM Lock Register, offset: 0x10C */ - __IO uint32_t CORECTL; /**< Core Control, offset: 0x110 */ - uint8_t RESERVED_9[12]; - __IO uint32_t DBGCTL; /**< Debug Control, offset: 0x120 */ -} CMC_Type; - -/* ---------------------------------------------------------------------------- - -- CMC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CMC_Register_Masks CMC Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define CMC_VERID_FEATURE_MASK (0xFFFFU) -#define CMC_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number */ -#define CMC_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << CMC_VERID_FEATURE_SHIFT)) & CMC_VERID_FEATURE_MASK) - -#define CMC_VERID_MINOR_MASK (0xFF0000U) -#define CMC_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define CMC_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << CMC_VERID_MINOR_SHIFT)) & CMC_VERID_MINOR_MASK) - -#define CMC_VERID_MAJOR_MASK (0xFF000000U) -#define CMC_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define CMC_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << CMC_VERID_MAJOR_SHIFT)) & CMC_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name CKCTRL - Clock Control */ -/*! @{ */ - -#define CMC_CKCTRL_CKMODE_MASK (0xFU) -#define CMC_CKCTRL_CKMODE_SHIFT (0U) -/*! CKMODE - Clocking Mode - * 0b0000..No clock gating - * 0b0001..Core clock is gated - * 0b1111..Core, platform, and peripheral clocks are gated, and core enters Low-Power mode. - */ -#define CMC_CKCTRL_CKMODE(x) (((uint32_t)(((uint32_t)(x)) << CMC_CKCTRL_CKMODE_SHIFT)) & CMC_CKCTRL_CKMODE_MASK) - -#define CMC_CKCTRL_LOCK_MASK (0x80000000U) -#define CMC_CKCTRL_LOCK_SHIFT (31U) -/*! LOCK - Lock - * 0b0..Allowed - * 0b1..Blocked - */ -#define CMC_CKCTRL_LOCK(x) (((uint32_t)(((uint32_t)(x)) << CMC_CKCTRL_LOCK_SHIFT)) & CMC_CKCTRL_LOCK_MASK) -/*! @} */ - -/*! @name CKSTAT - Clock Status */ -/*! @{ */ - -#define CMC_CKSTAT_CKMODE_MASK (0xFU) -#define CMC_CKSTAT_CKMODE_SHIFT (0U) -/*! CKMODE - Low Power Status - * 0b0000..Core clock not gated - * 0b0001..Core clock was gated - * 0b1111..Core, platform, and peripheral clocks were gated, and power domain entered Low-Power mode - * *.. - */ -#define CMC_CKSTAT_CKMODE(x) (((uint32_t)(((uint32_t)(x)) << CMC_CKSTAT_CKMODE_SHIFT)) & CMC_CKSTAT_CKMODE_MASK) - -#define CMC_CKSTAT_WAKEUP_MASK (0xFF00U) -#define CMC_CKSTAT_WAKEUP_SHIFT (8U) -/*! WAKEUP - Wake-up Source */ -#define CMC_CKSTAT_WAKEUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_CKSTAT_WAKEUP_SHIFT)) & CMC_CKSTAT_WAKEUP_MASK) - -#define CMC_CKSTAT_VALID_MASK (0x80000000U) -#define CMC_CKSTAT_VALID_SHIFT (31U) -/*! VALID - Clock Status Valid - * 0b0..Core clock not gated - * 0b1..Core clock was gated due to Low-Power mode entry - */ -#define CMC_CKSTAT_VALID(x) (((uint32_t)(((uint32_t)(x)) << CMC_CKSTAT_VALID_SHIFT)) & CMC_CKSTAT_VALID_MASK) -/*! @} */ - -/*! @name PMPROT - Power Mode Protection */ -/*! @{ */ - -#define CMC_PMPROT_LPMODE_MASK (0xFU) -#define CMC_PMPROT_LPMODE_SHIFT (0U) -/*! LPMODE - Low-Power Mode - * 0b0000..Not allowed - * 0b0001..Allowed - * 0b0010..Allowed - * 0b0011..Allowed - * 0b0100..Allowed - * 0b0101..Allowed - * 0b0110..Allowed - * 0b0111..Allowed - * 0b1000..Allowed - * 0b1001..Allowed - * 0b1010..Allowed - * 0b1011..Allowed - * 0b1100..Allowed - * 0b1101..Allowed - * 0b1110..Allowed - * 0b1111..Allowed - */ -#define CMC_PMPROT_LPMODE(x) (((uint32_t)(((uint32_t)(x)) << CMC_PMPROT_LPMODE_SHIFT)) & CMC_PMPROT_LPMODE_MASK) - -#define CMC_PMPROT_LOCK_MASK (0x80000000U) -#define CMC_PMPROT_LOCK_SHIFT (31U) -/*! LOCK - Lock Register - * 0b0..Allowed - * 0b1..Blocked - */ -#define CMC_PMPROT_LOCK(x) (((uint32_t)(((uint32_t)(x)) << CMC_PMPROT_LOCK_SHIFT)) & CMC_PMPROT_LOCK_MASK) -/*! @} */ - -/*! @name GPMCTRL - Global Power Mode Control */ -/*! @{ */ - -#define CMC_GPMCTRL_LPMODE_MASK (0xFU) -#define CMC_GPMCTRL_LPMODE_SHIFT (0U) -/*! LPMODE - Low-Power Mode */ -#define CMC_GPMCTRL_LPMODE(x) (((uint32_t)(((uint32_t)(x)) << CMC_GPMCTRL_LPMODE_SHIFT)) & CMC_GPMCTRL_LPMODE_MASK) -/*! @} */ - -/*! @name PMCTRL - Power Mode Control */ -/*! @{ */ - -#define CMC_PMCTRL_LPMODE_MASK (0xFU) -#define CMC_PMCTRL_LPMODE_SHIFT (0U) -/*! LPMODE - Low-Power Mode - * 0b0000..Active/Sleep - * 0b0001..Deep Sleep - * 0b0011..Power Down - * 0b0111..Reserved - * 0b1111..Deep-Power Down - */ -#define CMC_PMCTRL_LPMODE(x) (((uint32_t)(((uint32_t)(x)) << CMC_PMCTRL_LPMODE_SHIFT)) & CMC_PMCTRL_LPMODE_MASK) -/*! @} */ - -/* The count of CMC_PMCTRL */ -#define CMC_PMCTRL_COUNT (2U) - -/*! @name SRS - System Reset Status */ -/*! @{ */ - -#define CMC_SRS_WAKEUP_MASK (0x1U) -#define CMC_SRS_WAKEUP_SHIFT (0U) -/*! WAKEUP - Wake-up Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_WAKEUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_WAKEUP_SHIFT)) & CMC_SRS_WAKEUP_MASK) - -#define CMC_SRS_POR_MASK (0x2U) -#define CMC_SRS_POR_SHIFT (1U) -/*! POR - Power-on Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_POR(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_POR_SHIFT)) & CMC_SRS_POR_MASK) - -#define CMC_SRS_VD_MASK (0x4U) -#define CMC_SRS_VD_SHIFT (2U) -/*! VD - Voltage Detect Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_VD(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_VD_SHIFT)) & CMC_SRS_VD_MASK) - -#define CMC_SRS_WARM_MASK (0x10U) -#define CMC_SRS_WARM_SHIFT (4U) -/*! WARM - Warm Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_WARM(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_WARM_SHIFT)) & CMC_SRS_WARM_MASK) - -#define CMC_SRS_FATAL_MASK (0x20U) -#define CMC_SRS_FATAL_SHIFT (5U) -/*! FATAL - Fatal Reset - * 0b0..Reset was not generated - * 0b1..Reset was generated - */ -#define CMC_SRS_FATAL(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_FATAL_SHIFT)) & CMC_SRS_FATAL_MASK) - -#define CMC_SRS_PIN_MASK (0x100U) -#define CMC_SRS_PIN_SHIFT (8U) -/*! PIN - Pin Reset - * 0b0..Reset was not generated - * 0b1..Reset was generated - */ -#define CMC_SRS_PIN(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_PIN_SHIFT)) & CMC_SRS_PIN_MASK) - -#define CMC_SRS_DAP_MASK (0x200U) -#define CMC_SRS_DAP_SHIFT (9U) -/*! DAP - Debug Access Port Reset - * 0b0..Reset was not generated - * 0b1..Reset was generated - */ -#define CMC_SRS_DAP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_DAP_SHIFT)) & CMC_SRS_DAP_MASK) - -#define CMC_SRS_RSTACK_MASK (0x400U) -#define CMC_SRS_RSTACK_SHIFT (10U) -/*! RSTACK - Reset Timeout - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_RSTACK(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_RSTACK_SHIFT)) & CMC_SRS_RSTACK_MASK) - -#define CMC_SRS_LPACK_MASK (0x800U) -#define CMC_SRS_LPACK_SHIFT (11U) -/*! LPACK - Low Power Acknowledge Timeout Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_LPACK(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_LPACK_SHIFT)) & CMC_SRS_LPACK_MASK) - -#define CMC_SRS_SCG_MASK (0x1000U) -#define CMC_SRS_SCG_SHIFT (12U) -/*! SCG - System Clock Generation Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SRS_SCG(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_SCG_SHIFT)) & CMC_SRS_SCG_MASK) - -#define CMC_SRS_WWDT0_MASK (0x2000U) -#define CMC_SRS_WWDT0_SHIFT (13U) -/*! WWDT0 - Windowed Watchdog 0 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SRS_WWDT0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_WWDT0_SHIFT)) & CMC_SRS_WWDT0_MASK) - -#define CMC_SRS_SW_MASK (0x4000U) -#define CMC_SRS_SW_SHIFT (14U) -/*! SW - Software Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_SW(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_SW_SHIFT)) & CMC_SRS_SW_MASK) - -#define CMC_SRS_LOCKUP_MASK (0x8000U) -#define CMC_SRS_LOCKUP_SHIFT (15U) -/*! LOCKUP - Lockup Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_LOCKUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_LOCKUP_SHIFT)) & CMC_SRS_LOCKUP_MASK) - -#define CMC_SRS_CPU1_MASK (0x10000U) -#define CMC_SRS_CPU1_SHIFT (16U) -/*! CPU1 - CPU1 System Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_CPU1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_CPU1_SHIFT)) & CMC_SRS_CPU1_MASK) - -#define CMC_SRS_VBAT_MASK (0x1000000U) -#define CMC_SRS_VBAT_SHIFT (24U) -/*! VBAT - VBAT System Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_VBAT(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_VBAT_SHIFT)) & CMC_SRS_VBAT_MASK) - -#define CMC_SRS_WWDT1_MASK (0x2000000U) -#define CMC_SRS_WWDT1_SHIFT (25U) -/*! WWDT1 - Windowed Watchdog 1 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SRS_WWDT1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_WWDT1_SHIFT)) & CMC_SRS_WWDT1_MASK) - -#define CMC_SRS_CDOG0_MASK (0x4000000U) -#define CMC_SRS_CDOG0_SHIFT (26U) -/*! CDOG0 - Code Watchdog 0 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SRS_CDOG0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_CDOG0_SHIFT)) & CMC_SRS_CDOG0_MASK) - -#define CMC_SRS_CDOG1_MASK (0x8000000U) -#define CMC_SRS_CDOG1_SHIFT (27U) -/*! CDOG1 - Code Watchdog 1 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SRS_CDOG1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_CDOG1_SHIFT)) & CMC_SRS_CDOG1_MASK) - -#define CMC_SRS_JTAG_MASK (0x10000000U) -#define CMC_SRS_JTAG_SHIFT (28U) -/*! JTAG - JTAG System Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_JTAG(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_JTAG_SHIFT)) & CMC_SRS_JTAG_MASK) - -#define CMC_SRS_SECVIO_MASK (0x40000000U) -#define CMC_SRS_SECVIO_SHIFT (30U) -/*! SECVIO - Security Violation Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_SECVIO(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_SECVIO_SHIFT)) & CMC_SRS_SECVIO_MASK) - -#define CMC_SRS_TAMPER_MASK (0x80000000U) -#define CMC_SRS_TAMPER_SHIFT (31U) -/*! TAMPER - Tamper Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_TAMPER(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_TAMPER_SHIFT)) & CMC_SRS_TAMPER_MASK) -/*! @} */ - -/*! @name RPC - Reset Pin Control */ -/*! @{ */ - -#define CMC_RPC_FILTCFG_MASK (0x1FU) -#define CMC_RPC_FILTCFG_SHIFT (0U) -/*! FILTCFG - Reset Filter Configuration */ -#define CMC_RPC_FILTCFG(x) (((uint32_t)(((uint32_t)(x)) << CMC_RPC_FILTCFG_SHIFT)) & CMC_RPC_FILTCFG_MASK) - -#define CMC_RPC_FILTEN_MASK (0x100U) -#define CMC_RPC_FILTEN_SHIFT (8U) -/*! FILTEN - Filter Enable - * 0b0..Disables - * 0b1..Enables - */ -#define CMC_RPC_FILTEN(x) (((uint32_t)(((uint32_t)(x)) << CMC_RPC_FILTEN_SHIFT)) & CMC_RPC_FILTEN_MASK) - -#define CMC_RPC_LPFEN_MASK (0x200U) -#define CMC_RPC_LPFEN_SHIFT (9U) -/*! LPFEN - Low-Power Filter Enable - * 0b0..Disables - * 0b1..Enables - */ -#define CMC_RPC_LPFEN(x) (((uint32_t)(((uint32_t)(x)) << CMC_RPC_LPFEN_SHIFT)) & CMC_RPC_LPFEN_MASK) -/*! @} */ - -/*! @name SSRS - Sticky System Reset Status */ -/*! @{ */ - -#define CMC_SSRS_WAKEUP_MASK (0x1U) -#define CMC_SSRS_WAKEUP_SHIFT (0U) -/*! WAKEUP - Wake-up Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_WAKEUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_WAKEUP_SHIFT)) & CMC_SSRS_WAKEUP_MASK) - -#define CMC_SSRS_POR_MASK (0x2U) -#define CMC_SSRS_POR_SHIFT (1U) -/*! POR - Power-on Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_POR(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_POR_SHIFT)) & CMC_SSRS_POR_MASK) - -#define CMC_SSRS_VD_MASK (0x4U) -#define CMC_SSRS_VD_SHIFT (2U) -/*! VD - Voltage Detect Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_VD(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_VD_SHIFT)) & CMC_SSRS_VD_MASK) - -#define CMC_SSRS_WARM_MASK (0x10U) -#define CMC_SSRS_WARM_SHIFT (4U) -/*! WARM - Warm Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_WARM(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_WARM_SHIFT)) & CMC_SSRS_WARM_MASK) - -#define CMC_SSRS_FATAL_MASK (0x20U) -#define CMC_SSRS_FATAL_SHIFT (5U) -/*! FATAL - Fatal Reset - * 0b0..Reset was not generated - * 0b1..Reset was generated - */ -#define CMC_SSRS_FATAL(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_FATAL_SHIFT)) & CMC_SSRS_FATAL_MASK) - -#define CMC_SSRS_PIN_MASK (0x100U) -#define CMC_SSRS_PIN_SHIFT (8U) -/*! PIN - Pin Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_PIN(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_PIN_SHIFT)) & CMC_SSRS_PIN_MASK) - -#define CMC_SSRS_DAP_MASK (0x200U) -#define CMC_SSRS_DAP_SHIFT (9U) -/*! DAP - DAP Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_DAP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_DAP_SHIFT)) & CMC_SSRS_DAP_MASK) - -#define CMC_SSRS_RSTACK_MASK (0x400U) -#define CMC_SSRS_RSTACK_SHIFT (10U) -/*! RSTACK - Reset Timeout - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_RSTACK(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_RSTACK_SHIFT)) & CMC_SSRS_RSTACK_MASK) - -#define CMC_SSRS_LPACK_MASK (0x800U) -#define CMC_SSRS_LPACK_SHIFT (11U) -/*! LPACK - Low Power Acknowledge Timeout Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_LPACK(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_LPACK_SHIFT)) & CMC_SSRS_LPACK_MASK) - -#define CMC_SSRS_SCG_MASK (0x1000U) -#define CMC_SSRS_SCG_SHIFT (12U) -/*! SCG - System Clock Generation Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SSRS_SCG(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_SCG_SHIFT)) & CMC_SSRS_SCG_MASK) - -#define CMC_SSRS_WWDT0_MASK (0x2000U) -#define CMC_SSRS_WWDT0_SHIFT (13U) -/*! WWDT0 - Windowed Watchdog 0 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SSRS_WWDT0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_WWDT0_SHIFT)) & CMC_SSRS_WWDT0_MASK) - -#define CMC_SSRS_SW_MASK (0x4000U) -#define CMC_SSRS_SW_SHIFT (14U) -/*! SW - Software Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_SW(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_SW_SHIFT)) & CMC_SSRS_SW_MASK) - -#define CMC_SSRS_LOCKUP_MASK (0x8000U) -#define CMC_SSRS_LOCKUP_SHIFT (15U) -/*! LOCKUP - Lockup Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_LOCKUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_LOCKUP_SHIFT)) & CMC_SSRS_LOCKUP_MASK) - -#define CMC_SSRS_CPU1_MASK (0x10000U) -#define CMC_SSRS_CPU1_SHIFT (16U) -/*! CPU1 - CPU1 Reset - * 0b0..Reset not generated from CPU1 reset source. - * 0b1..Reset generated from CPU1 reset source. - */ -#define CMC_SSRS_CPU1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_CPU1_SHIFT)) & CMC_SSRS_CPU1_MASK) - -#define CMC_SSRS_VBAT_MASK (0x1000000U) -#define CMC_SSRS_VBAT_SHIFT (24U) -/*! VBAT - VBAT System Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_VBAT(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_VBAT_SHIFT)) & CMC_SSRS_VBAT_MASK) - -#define CMC_SSRS_WWDT1_MASK (0x2000000U) -#define CMC_SSRS_WWDT1_SHIFT (25U) -/*! WWDT1 - Windowed Watchdog 1 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SSRS_WWDT1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_WWDT1_SHIFT)) & CMC_SSRS_WWDT1_MASK) - -#define CMC_SSRS_CDOG0_MASK (0x4000000U) -#define CMC_SSRS_CDOG0_SHIFT (26U) -/*! CDOG0 - Code Watchdog 0 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SSRS_CDOG0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_CDOG0_SHIFT)) & CMC_SSRS_CDOG0_MASK) - -#define CMC_SSRS_CDOG1_MASK (0x8000000U) -#define CMC_SSRS_CDOG1_SHIFT (27U) -/*! CDOG1 - Code Watchdog 1 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SSRS_CDOG1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_CDOG1_SHIFT)) & CMC_SSRS_CDOG1_MASK) - -#define CMC_SSRS_JTAG_MASK (0x10000000U) -#define CMC_SSRS_JTAG_SHIFT (28U) -/*! JTAG - JTAG System Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_JTAG(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_JTAG_SHIFT)) & CMC_SSRS_JTAG_MASK) - -#define CMC_SSRS_SECVIO_MASK (0x40000000U) -#define CMC_SSRS_SECVIO_SHIFT (30U) -/*! SECVIO - Security Violation Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_SECVIO(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_SECVIO_SHIFT)) & CMC_SSRS_SECVIO_MASK) - -#define CMC_SSRS_TAMPER_MASK (0x80000000U) -#define CMC_SSRS_TAMPER_SHIFT (31U) -/*! TAMPER - Tamper Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_TAMPER(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_TAMPER_SHIFT)) & CMC_SSRS_TAMPER_MASK) -/*! @} */ - -/*! @name SRIE - System Reset Interrupt Enable */ -/*! @{ */ - -#define CMC_SRIE_PIN_MASK (0x100U) -#define CMC_SRIE_PIN_SHIFT (8U) -/*! PIN - Pin Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_PIN(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_PIN_SHIFT)) & CMC_SRIE_PIN_MASK) - -#define CMC_SRIE_DAP_MASK (0x200U) -#define CMC_SRIE_DAP_SHIFT (9U) -/*! DAP - DAP Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_DAP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_DAP_SHIFT)) & CMC_SRIE_DAP_MASK) - -#define CMC_SRIE_LPACK_MASK (0x800U) -#define CMC_SRIE_LPACK_SHIFT (11U) -/*! LPACK - Low Power Acknowledge Timeout Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_LPACK(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_LPACK_SHIFT)) & CMC_SRIE_LPACK_MASK) - -#define CMC_SRIE_SCG_MASK (0x1000U) -#define CMC_SRIE_SCG_SHIFT (12U) -/*! SCG - System Clock Generation Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_SCG(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_SCG_SHIFT)) & CMC_SRIE_SCG_MASK) - -#define CMC_SRIE_WWDT0_MASK (0x2000U) -#define CMC_SRIE_WWDT0_SHIFT (13U) -/*! WWDT0 - Windowed Watchdog 0 Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_WWDT0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_WWDT0_SHIFT)) & CMC_SRIE_WWDT0_MASK) - -#define CMC_SRIE_SW_MASK (0x4000U) -#define CMC_SRIE_SW_SHIFT (14U) -/*! SW - Software Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_SW(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_SW_SHIFT)) & CMC_SRIE_SW_MASK) - -#define CMC_SRIE_LOCKUP_MASK (0x8000U) -#define CMC_SRIE_LOCKUP_SHIFT (15U) -/*! LOCKUP - Lockup Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_LOCKUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_LOCKUP_SHIFT)) & CMC_SRIE_LOCKUP_MASK) - -#define CMC_SRIE_CPU1_MASK (0x10000U) -#define CMC_SRIE_CPU1_SHIFT (16U) -/*! CPU1 - CPU1 Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_CPU1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_CPU1_SHIFT)) & CMC_SRIE_CPU1_MASK) - -#define CMC_SRIE_VBAT_MASK (0x1000000U) -#define CMC_SRIE_VBAT_SHIFT (24U) -/*! VBAT - VBAT System Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_VBAT(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_VBAT_SHIFT)) & CMC_SRIE_VBAT_MASK) - -#define CMC_SRIE_WWDT1_MASK (0x2000000U) -#define CMC_SRIE_WWDT1_SHIFT (25U) -/*! WWDT1 - Windowed Watchdog 1 Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_WWDT1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_WWDT1_SHIFT)) & CMC_SRIE_WWDT1_MASK) - -#define CMC_SRIE_CDOG0_MASK (0x4000000U) -#define CMC_SRIE_CDOG0_SHIFT (26U) -/*! CDOG0 - Code Watchdog 0 Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_CDOG0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_CDOG0_SHIFT)) & CMC_SRIE_CDOG0_MASK) - -#define CMC_SRIE_CDOG1_MASK (0x8000000U) -#define CMC_SRIE_CDOG1_SHIFT (27U) -/*! CDOG1 - Code Watchdog 1 Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_CDOG1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_CDOG1_SHIFT)) & CMC_SRIE_CDOG1_MASK) -/*! @} */ - -/*! @name SRIF - System Reset Interrupt Flag */ -/*! @{ */ - -#define CMC_SRIF_PIN_MASK (0x100U) -#define CMC_SRIF_PIN_SHIFT (8U) -/*! PIN - Pin Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_PIN(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_PIN_SHIFT)) & CMC_SRIF_PIN_MASK) - -#define CMC_SRIF_DAP_MASK (0x200U) -#define CMC_SRIF_DAP_SHIFT (9U) -/*! DAP - DAP Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_DAP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_DAP_SHIFT)) & CMC_SRIF_DAP_MASK) - -#define CMC_SRIF_LPACK_MASK (0x800U) -#define CMC_SRIF_LPACK_SHIFT (11U) -/*! LPACK - Low Power Acknowledge Timeout Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_LPACK(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_LPACK_SHIFT)) & CMC_SRIF_LPACK_MASK) - -#define CMC_SRIF_WWDT0_MASK (0x2000U) -#define CMC_SRIF_WWDT0_SHIFT (13U) -/*! WWDT0 - Windowed Watchdog 0 Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_WWDT0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_WWDT0_SHIFT)) & CMC_SRIF_WWDT0_MASK) - -#define CMC_SRIF_SW_MASK (0x4000U) -#define CMC_SRIF_SW_SHIFT (14U) -/*! SW - Software Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_SW(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_SW_SHIFT)) & CMC_SRIF_SW_MASK) - -#define CMC_SRIF_LOCKUP_MASK (0x8000U) -#define CMC_SRIF_LOCKUP_SHIFT (15U) -/*! LOCKUP - Lockup Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_LOCKUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_LOCKUP_SHIFT)) & CMC_SRIF_LOCKUP_MASK) - -#define CMC_SRIF_CPU1_MASK (0x10000U) -#define CMC_SRIF_CPU1_SHIFT (16U) -/*! CPU1 - CPU1 Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_CPU1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_CPU1_SHIFT)) & CMC_SRIF_CPU1_MASK) - -#define CMC_SRIF_VBAT_MASK (0x1000000U) -#define CMC_SRIF_VBAT_SHIFT (24U) -/*! VBAT - VBAT System Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_VBAT(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_VBAT_SHIFT)) & CMC_SRIF_VBAT_MASK) - -#define CMC_SRIF_WWDT1_MASK (0x2000000U) -#define CMC_SRIF_WWDT1_SHIFT (25U) -/*! WWDT1 - Windowed Watchdog 1 Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_WWDT1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_WWDT1_SHIFT)) & CMC_SRIF_WWDT1_MASK) - -#define CMC_SRIF_CDOG0_MASK (0x4000000U) -#define CMC_SRIF_CDOG0_SHIFT (26U) -/*! CDOG0 - Code Watchdog 0 Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_CDOG0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_CDOG0_SHIFT)) & CMC_SRIF_CDOG0_MASK) - -#define CMC_SRIF_CDOG1_MASK (0x8000000U) -#define CMC_SRIF_CDOG1_SHIFT (27U) -/*! CDOG1 - Code Watchdog 1 Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_CDOG1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_CDOG1_SHIFT)) & CMC_SRIF_CDOG1_MASK) -/*! @} */ - -/*! @name RSTCNT - Reset Count Register */ -/*! @{ */ - -#define CMC_RSTCNT_COUNT_MASK (0xFFU) -#define CMC_RSTCNT_COUNT_SHIFT (0U) -/*! COUNT - Count */ -#define CMC_RSTCNT_COUNT(x) (((uint32_t)(((uint32_t)(x)) << CMC_RSTCNT_COUNT_SHIFT)) & CMC_RSTCNT_COUNT_MASK) -/*! @} */ - -/*! @name MR - Mode */ -/*! @{ */ - -#define CMC_MR_ISPMODE_n_MASK (0x1U) -#define CMC_MR_ISPMODE_n_SHIFT (0U) -/*! ISPMODE_n - In System Programming Mode */ -#define CMC_MR_ISPMODE_n(x) (((uint32_t)(((uint32_t)(x)) << CMC_MR_ISPMODE_n_SHIFT)) & CMC_MR_ISPMODE_n_MASK) -/*! @} */ - -/* The count of CMC_MR */ -#define CMC_MR_COUNT (1U) - -/*! @name FM - Force Mode */ -/*! @{ */ - -#define CMC_FM_FORCECFG_MASK (0x1U) -#define CMC_FM_FORCECFG_SHIFT (0U) -/*! FORCECFG - Boot Configuration - * 0b0..No effect - * 0b1..Asserts - */ -#define CMC_FM_FORCECFG(x) (((uint32_t)(((uint32_t)(x)) << CMC_FM_FORCECFG_SHIFT)) & CMC_FM_FORCECFG_MASK) -/*! @} */ - -/* The count of CMC_FM */ -#define CMC_FM_COUNT (1U) - -/*! @name SRAMDIS - SRAM Disable */ -/*! @{ */ - -#define CMC_SRAMDIS_DIS0_MASK (0x1U) -#define CMC_SRAMDIS_DIS0_SHIFT (0U) -/*! DIS0 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS0_SHIFT)) & CMC_SRAMDIS_DIS0_MASK) - -#define CMC_SRAMDIS_DIS1_MASK (0x2U) -#define CMC_SRAMDIS_DIS1_SHIFT (1U) -/*! DIS1 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS1_SHIFT)) & CMC_SRAMDIS_DIS1_MASK) - -#define CMC_SRAMDIS_DIS2_MASK (0x4U) -#define CMC_SRAMDIS_DIS2_SHIFT (2U) -/*! DIS2 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS2(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS2_SHIFT)) & CMC_SRAMDIS_DIS2_MASK) - -#define CMC_SRAMDIS_DIS3_MASK (0x8U) -#define CMC_SRAMDIS_DIS3_SHIFT (3U) -/*! DIS3 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS3(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS3_SHIFT)) & CMC_SRAMDIS_DIS3_MASK) - -#define CMC_SRAMDIS_DIS4_MASK (0x10U) -#define CMC_SRAMDIS_DIS4_SHIFT (4U) -/*! DIS4 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS4(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS4_SHIFT)) & CMC_SRAMDIS_DIS4_MASK) - -#define CMC_SRAMDIS_DIS5_MASK (0x20U) -#define CMC_SRAMDIS_DIS5_SHIFT (5U) -/*! DIS5 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS5(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS5_SHIFT)) & CMC_SRAMDIS_DIS5_MASK) - -#define CMC_SRAMDIS_DIS6_MASK (0x40U) -#define CMC_SRAMDIS_DIS6_SHIFT (6U) -/*! DIS6 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS6(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS6_SHIFT)) & CMC_SRAMDIS_DIS6_MASK) - -#define CMC_SRAMDIS_DIS7_MASK (0x80U) -#define CMC_SRAMDIS_DIS7_SHIFT (7U) -/*! DIS7 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS7(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS7_SHIFT)) & CMC_SRAMDIS_DIS7_MASK) - -#define CMC_SRAMDIS_DIS8_MASK (0x100U) -#define CMC_SRAMDIS_DIS8_SHIFT (8U) -/*! DIS8 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS8(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS8_SHIFT)) & CMC_SRAMDIS_DIS8_MASK) - -#define CMC_SRAMDIS_DIS9_MASK (0x200U) -#define CMC_SRAMDIS_DIS9_SHIFT (9U) -/*! DIS9 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS9(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS9_SHIFT)) & CMC_SRAMDIS_DIS9_MASK) - -#define CMC_SRAMDIS_DIS10_MASK (0x400U) -#define CMC_SRAMDIS_DIS10_SHIFT (10U) -/*! DIS10 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS10(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS10_SHIFT)) & CMC_SRAMDIS_DIS10_MASK) - -#define CMC_SRAMDIS_DIS11_MASK (0x800U) -#define CMC_SRAMDIS_DIS11_SHIFT (11U) -/*! DIS11 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS11(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS11_SHIFT)) & CMC_SRAMDIS_DIS11_MASK) - -#define CMC_SRAMDIS_DIS12_MASK (0x1000U) -#define CMC_SRAMDIS_DIS12_SHIFT (12U) -/*! DIS12 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS12(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS12_SHIFT)) & CMC_SRAMDIS_DIS12_MASK) - -#define CMC_SRAMDIS_DIS13_MASK (0x2000U) -#define CMC_SRAMDIS_DIS13_SHIFT (13U) -/*! DIS13 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS13(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS13_SHIFT)) & CMC_SRAMDIS_DIS13_MASK) - -#define CMC_SRAMDIS_DIS14_MASK (0x4000U) -#define CMC_SRAMDIS_DIS14_SHIFT (14U) -/*! DIS14 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS14(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS14_SHIFT)) & CMC_SRAMDIS_DIS14_MASK) - -#define CMC_SRAMDIS_DIS15_MASK (0x8000U) -#define CMC_SRAMDIS_DIS15_SHIFT (15U) -/*! DIS15 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS15(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS15_SHIFT)) & CMC_SRAMDIS_DIS15_MASK) - -#define CMC_SRAMDIS_DIS16_MASK (0x10000U) -#define CMC_SRAMDIS_DIS16_SHIFT (16U) -/*! DIS16 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS16(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS16_SHIFT)) & CMC_SRAMDIS_DIS16_MASK) - -#define CMC_SRAMDIS_DIS17_MASK (0x20000U) -#define CMC_SRAMDIS_DIS17_SHIFT (17U) -/*! DIS17 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS17(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS17_SHIFT)) & CMC_SRAMDIS_DIS17_MASK) - -#define CMC_SRAMDIS_DIS18_MASK (0x40000U) -#define CMC_SRAMDIS_DIS18_SHIFT (18U) -/*! DIS18 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS18(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS18_SHIFT)) & CMC_SRAMDIS_DIS18_MASK) - -#define CMC_SRAMDIS_DIS19_MASK (0x80000U) -#define CMC_SRAMDIS_DIS19_SHIFT (19U) -/*! DIS19 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS19(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS19_SHIFT)) & CMC_SRAMDIS_DIS19_MASK) - -#define CMC_SRAMDIS_DIS20_MASK (0x100000U) -#define CMC_SRAMDIS_DIS20_SHIFT (20U) -/*! DIS20 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS20(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS20_SHIFT)) & CMC_SRAMDIS_DIS20_MASK) - -#define CMC_SRAMDIS_DIS21_MASK (0x200000U) -#define CMC_SRAMDIS_DIS21_SHIFT (21U) -/*! DIS21 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS21(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS21_SHIFT)) & CMC_SRAMDIS_DIS21_MASK) - -#define CMC_SRAMDIS_DIS22_MASK (0x400000U) -#define CMC_SRAMDIS_DIS22_SHIFT (22U) -/*! DIS22 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS22(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS22_SHIFT)) & CMC_SRAMDIS_DIS22_MASK) - -#define CMC_SRAMDIS_DIS23_MASK (0x800000U) -#define CMC_SRAMDIS_DIS23_SHIFT (23U) -/*! DIS23 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS23(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS23_SHIFT)) & CMC_SRAMDIS_DIS23_MASK) - -#define CMC_SRAMDIS_DIS24_MASK (0x1000000U) -#define CMC_SRAMDIS_DIS24_SHIFT (24U) -/*! DIS24 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS24(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS24_SHIFT)) & CMC_SRAMDIS_DIS24_MASK) - -#define CMC_SRAMDIS_DIS25_MASK (0x2000000U) -#define CMC_SRAMDIS_DIS25_SHIFT (25U) -/*! DIS25 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS25(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS25_SHIFT)) & CMC_SRAMDIS_DIS25_MASK) - -#define CMC_SRAMDIS_DIS26_MASK (0x4000000U) -#define CMC_SRAMDIS_DIS26_SHIFT (26U) -/*! DIS26 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS26(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS26_SHIFT)) & CMC_SRAMDIS_DIS26_MASK) - -#define CMC_SRAMDIS_DIS27_MASK (0x8000000U) -#define CMC_SRAMDIS_DIS27_SHIFT (27U) -/*! DIS27 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS27(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS27_SHIFT)) & CMC_SRAMDIS_DIS27_MASK) - -#define CMC_SRAMDIS_DIS28_MASK (0x10000000U) -#define CMC_SRAMDIS_DIS28_SHIFT (28U) -/*! DIS28 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS28(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS28_SHIFT)) & CMC_SRAMDIS_DIS28_MASK) - -#define CMC_SRAMDIS_DIS29_MASK (0x20000000U) -#define CMC_SRAMDIS_DIS29_SHIFT (29U) -/*! DIS29 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS29(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS29_SHIFT)) & CMC_SRAMDIS_DIS29_MASK) - -#define CMC_SRAMDIS_DIS30_MASK (0x40000000U) -#define CMC_SRAMDIS_DIS30_SHIFT (30U) -/*! DIS30 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS30(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS30_SHIFT)) & CMC_SRAMDIS_DIS30_MASK) - -#define CMC_SRAMDIS_DIS31_MASK (0x80000000U) -#define CMC_SRAMDIS_DIS31_SHIFT (31U) -/*! DIS31 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS31(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS31_SHIFT)) & CMC_SRAMDIS_DIS31_MASK) -/*! @} */ - -/* The count of CMC_SRAMDIS */ -#define CMC_SRAMDIS_COUNT (1U) - -/*! @name SRAMRET - SRAM Retention */ -/*! @{ */ - -#define CMC_SRAMRET_RET0_MASK (0x1U) -#define CMC_SRAMRET_RET0_SHIFT (0U) -/*! RET0 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET0_SHIFT)) & CMC_SRAMRET_RET0_MASK) - -#define CMC_SRAMRET_RET1_MASK (0x2U) -#define CMC_SRAMRET_RET1_SHIFT (1U) -/*! RET1 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET1_SHIFT)) & CMC_SRAMRET_RET1_MASK) - -#define CMC_SRAMRET_RET2_MASK (0x4U) -#define CMC_SRAMRET_RET2_SHIFT (2U) -/*! RET2 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET2(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET2_SHIFT)) & CMC_SRAMRET_RET2_MASK) - -#define CMC_SRAMRET_RET3_MASK (0x8U) -#define CMC_SRAMRET_RET3_SHIFT (3U) -/*! RET3 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET3(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET3_SHIFT)) & CMC_SRAMRET_RET3_MASK) - -#define CMC_SRAMRET_RET4_MASK (0x10U) -#define CMC_SRAMRET_RET4_SHIFT (4U) -/*! RET4 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET4(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET4_SHIFT)) & CMC_SRAMRET_RET4_MASK) - -#define CMC_SRAMRET_RET5_MASK (0x20U) -#define CMC_SRAMRET_RET5_SHIFT (5U) -/*! RET5 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET5(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET5_SHIFT)) & CMC_SRAMRET_RET5_MASK) - -#define CMC_SRAMRET_RET6_MASK (0x40U) -#define CMC_SRAMRET_RET6_SHIFT (6U) -/*! RET6 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET6(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET6_SHIFT)) & CMC_SRAMRET_RET6_MASK) - -#define CMC_SRAMRET_RET7_MASK (0x80U) -#define CMC_SRAMRET_RET7_SHIFT (7U) -/*! RET7 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET7(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET7_SHIFT)) & CMC_SRAMRET_RET7_MASK) - -#define CMC_SRAMRET_RET8_MASK (0x100U) -#define CMC_SRAMRET_RET8_SHIFT (8U) -/*! RET8 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET8(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET8_SHIFT)) & CMC_SRAMRET_RET8_MASK) - -#define CMC_SRAMRET_RET9_MASK (0x200U) -#define CMC_SRAMRET_RET9_SHIFT (9U) -/*! RET9 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET9(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET9_SHIFT)) & CMC_SRAMRET_RET9_MASK) - -#define CMC_SRAMRET_RET10_MASK (0x400U) -#define CMC_SRAMRET_RET10_SHIFT (10U) -/*! RET10 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET10(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET10_SHIFT)) & CMC_SRAMRET_RET10_MASK) - -#define CMC_SRAMRET_RET11_MASK (0x800U) -#define CMC_SRAMRET_RET11_SHIFT (11U) -/*! RET11 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET11(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET11_SHIFT)) & CMC_SRAMRET_RET11_MASK) - -#define CMC_SRAMRET_RET12_MASK (0x1000U) -#define CMC_SRAMRET_RET12_SHIFT (12U) -/*! RET12 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET12(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET12_SHIFT)) & CMC_SRAMRET_RET12_MASK) - -#define CMC_SRAMRET_RET13_MASK (0x2000U) -#define CMC_SRAMRET_RET13_SHIFT (13U) -/*! RET13 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET13(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET13_SHIFT)) & CMC_SRAMRET_RET13_MASK) - -#define CMC_SRAMRET_RET14_MASK (0x4000U) -#define CMC_SRAMRET_RET14_SHIFT (14U) -/*! RET14 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET14(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET14_SHIFT)) & CMC_SRAMRET_RET14_MASK) - -#define CMC_SRAMRET_RET15_MASK (0x8000U) -#define CMC_SRAMRET_RET15_SHIFT (15U) -/*! RET15 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET15(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET15_SHIFT)) & CMC_SRAMRET_RET15_MASK) - -#define CMC_SRAMRET_RET16_MASK (0x10000U) -#define CMC_SRAMRET_RET16_SHIFT (16U) -/*! RET16 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET16(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET16_SHIFT)) & CMC_SRAMRET_RET16_MASK) - -#define CMC_SRAMRET_RET17_MASK (0x20000U) -#define CMC_SRAMRET_RET17_SHIFT (17U) -/*! RET17 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET17(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET17_SHIFT)) & CMC_SRAMRET_RET17_MASK) - -#define CMC_SRAMRET_RET18_MASK (0x40000U) -#define CMC_SRAMRET_RET18_SHIFT (18U) -/*! RET18 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET18(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET18_SHIFT)) & CMC_SRAMRET_RET18_MASK) - -#define CMC_SRAMRET_RET19_MASK (0x80000U) -#define CMC_SRAMRET_RET19_SHIFT (19U) -/*! RET19 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET19(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET19_SHIFT)) & CMC_SRAMRET_RET19_MASK) - -#define CMC_SRAMRET_RET20_MASK (0x100000U) -#define CMC_SRAMRET_RET20_SHIFT (20U) -/*! RET20 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET20(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET20_SHIFT)) & CMC_SRAMRET_RET20_MASK) - -#define CMC_SRAMRET_RET21_MASK (0x200000U) -#define CMC_SRAMRET_RET21_SHIFT (21U) -/*! RET21 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET21(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET21_SHIFT)) & CMC_SRAMRET_RET21_MASK) - -#define CMC_SRAMRET_RET22_MASK (0x400000U) -#define CMC_SRAMRET_RET22_SHIFT (22U) -/*! RET22 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET22(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET22_SHIFT)) & CMC_SRAMRET_RET22_MASK) - -#define CMC_SRAMRET_RET23_MASK (0x800000U) -#define CMC_SRAMRET_RET23_SHIFT (23U) -/*! RET23 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET23(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET23_SHIFT)) & CMC_SRAMRET_RET23_MASK) - -#define CMC_SRAMRET_RET24_MASK (0x1000000U) -#define CMC_SRAMRET_RET24_SHIFT (24U) -/*! RET24 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET24(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET24_SHIFT)) & CMC_SRAMRET_RET24_MASK) - -#define CMC_SRAMRET_RET25_MASK (0x2000000U) -#define CMC_SRAMRET_RET25_SHIFT (25U) -/*! RET25 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET25(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET25_SHIFT)) & CMC_SRAMRET_RET25_MASK) - -#define CMC_SRAMRET_RET26_MASK (0x4000000U) -#define CMC_SRAMRET_RET26_SHIFT (26U) -/*! RET26 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET26(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET26_SHIFT)) & CMC_SRAMRET_RET26_MASK) - -#define CMC_SRAMRET_RET27_MASK (0x8000000U) -#define CMC_SRAMRET_RET27_SHIFT (27U) -/*! RET27 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET27(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET27_SHIFT)) & CMC_SRAMRET_RET27_MASK) - -#define CMC_SRAMRET_RET28_MASK (0x10000000U) -#define CMC_SRAMRET_RET28_SHIFT (28U) -/*! RET28 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET28(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET28_SHIFT)) & CMC_SRAMRET_RET28_MASK) - -#define CMC_SRAMRET_RET29_MASK (0x20000000U) -#define CMC_SRAMRET_RET29_SHIFT (29U) -/*! RET29 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET29(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET29_SHIFT)) & CMC_SRAMRET_RET29_MASK) - -#define CMC_SRAMRET_RET30_MASK (0x40000000U) -#define CMC_SRAMRET_RET30_SHIFT (30U) -/*! RET30 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET30(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET30_SHIFT)) & CMC_SRAMRET_RET30_MASK) - -#define CMC_SRAMRET_RET31_MASK (0x80000000U) -#define CMC_SRAMRET_RET31_SHIFT (31U) -/*! RET31 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET31(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET31_SHIFT)) & CMC_SRAMRET_RET31_MASK) -/*! @} */ - -/* The count of CMC_SRAMRET */ -#define CMC_SRAMRET_COUNT (1U) - -/*! @name FLASHCR - Flash Control */ -/*! @{ */ - -#define CMC_FLASHCR_FLASHDIS_MASK (0x1U) -#define CMC_FLASHCR_FLASHDIS_SHIFT (0U) -/*! FLASHDIS - Flash Disable - * 0b0..No effect - * 0b1..Flash memory is disabled - */ -#define CMC_FLASHCR_FLASHDIS(x) (((uint32_t)(((uint32_t)(x)) << CMC_FLASHCR_FLASHDIS_SHIFT)) & CMC_FLASHCR_FLASHDIS_MASK) - -#define CMC_FLASHCR_FLASHDOZE_MASK (0x2U) -#define CMC_FLASHCR_FLASHDOZE_SHIFT (1U) -/*! FLASHDOZE - Flash Doze - * 0b0..No effect - * 0b1..Flash memory is disabled when core is sleeping (CKMODE > 0) - */ -#define CMC_FLASHCR_FLASHDOZE(x) (((uint32_t)(((uint32_t)(x)) << CMC_FLASHCR_FLASHDOZE_SHIFT)) & CMC_FLASHCR_FLASHDOZE_MASK) -/*! @} */ - -/*! @name BSR - BootROM Status Register */ -/*! @{ */ - -#define CMC_BSR_STAT_MASK (0xFFFFFFFFU) -#define CMC_BSR_STAT_SHIFT (0U) -/*! STAT - Provides status information written by the BootROM. */ -#define CMC_BSR_STAT(x) (((uint32_t)(((uint32_t)(x)) << CMC_BSR_STAT_SHIFT)) & CMC_BSR_STAT_MASK) -/*! @} */ - -/*! @name BLR - BootROM Lock Register */ -/*! @{ */ - -#define CMC_BLR_LOCK_MASK (0x7U) -#define CMC_BLR_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b010..BootROM Status and Lock Registers can be written - * 0b101..BootROM Status and Lock Registers cannot be written - */ -#define CMC_BLR_LOCK(x) (((uint32_t)(((uint32_t)(x)) << CMC_BLR_LOCK_SHIFT)) & CMC_BLR_LOCK_MASK) -/*! @} */ - -/*! @name CORECTL - Core Control */ -/*! @{ */ - -#define CMC_CORECTL_NPIE_MASK (0x1U) -#define CMC_CORECTL_NPIE_SHIFT (0U) -/*! NPIE - Non-maskable Pin Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define CMC_CORECTL_NPIE(x) (((uint32_t)(((uint32_t)(x)) << CMC_CORECTL_NPIE_SHIFT)) & CMC_CORECTL_NPIE_MASK) -/*! @} */ - -/*! @name DBGCTL - Debug Control */ -/*! @{ */ - -#define CMC_DBGCTL_SOD_MASK (0x1U) -#define CMC_DBGCTL_SOD_SHIFT (0U) -/*! SOD - Sleep Or Debug - * 0b0..Remains enabled - * 0b1..Disabled - */ -#define CMC_DBGCTL_SOD(x) (((uint32_t)(((uint32_t)(x)) << CMC_DBGCTL_SOD_SHIFT)) & CMC_DBGCTL_SOD_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group CMC_Register_Masks */ - - -/* CMC - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral CMC0 base address */ - #define CMC0_BASE (0x50048000u) - /** Peripheral CMC0 base address */ - #define CMC0_BASE_NS (0x40048000u) - /** Peripheral CMC0 base pointer */ - #define CMC0 ((CMC_Type *)CMC0_BASE) - /** Peripheral CMC0 base pointer */ - #define CMC0_NS ((CMC_Type *)CMC0_BASE_NS) - /** Array initializer of CMC peripheral base addresses */ - #define CMC_BASE_ADDRS { CMC0_BASE } - /** Array initializer of CMC peripheral base pointers */ - #define CMC_BASE_PTRS { CMC0 } - /** Array initializer of CMC peripheral base addresses */ - #define CMC_BASE_ADDRS_NS { CMC0_BASE_NS } - /** Array initializer of CMC peripheral base pointers */ - #define CMC_BASE_PTRS_NS { CMC0_NS } -#else - /** Peripheral CMC0 base address */ - #define CMC0_BASE (0x40048000u) - /** Peripheral CMC0 base pointer */ - #define CMC0 ((CMC_Type *)CMC0_BASE) - /** Array initializer of CMC peripheral base addresses */ - #define CMC_BASE_ADDRS { CMC0_BASE } - /** Array initializer of CMC peripheral base pointers */ - #define CMC_BASE_PTRS { CMC0 } -#endif -/* Backward compatibility for CMC */ -#define CMC_SRAMDIS_DIS_MASK (0xFFFFFFFFU) -#define CMC_SRAMDIS_DIS_SHIFT (0U) -/*! DIS - SRAM Disable */ -#define CMC_SRAMDIS_DIS(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS_SHIFT)) & CMC_SRAMDIS_DIS_MASK) - -#define CMC_SRAMRET_RET_MASK (0xFFFFFFFFU) -#define CMC_SRAMRET_RET_SHIFT (0U) -/*! RET - SRAM Retention */ -#define CMC_SRAMRET_RET(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET_SHIFT)) & CMC_SRAMRET_RET_MASK) - - -/*! - * @} - */ /* end of group CMC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- CRC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CRC_Peripheral_Access_Layer CRC Peripheral Access Layer - * @{ - */ - -/** CRC - Register Layout Typedef */ -typedef struct { - union { /* offset: 0x0 */ - struct { /* offset: 0x0 */ - __IO uint8_t DATALL; /**< CRC_DATALL register, offset: 0x0 */ - __IO uint8_t DATALU; /**< CRC_DATALU register, offset: 0x1 */ - __IO uint8_t DATAHL; /**< CRC_DATAHL register, offset: 0x2 */ - __IO uint8_t DATAHU; /**< CRC_DATAHU register, offset: 0x3 */ - } ACCESS8BIT; - struct { /* offset: 0x0 */ - __IO uint16_t DATAL; /**< CRC_DATAL register, offset: 0x0 */ - __IO uint16_t DATAH; /**< CRC_DATAH register, offset: 0x2 */ - } ACCESS16BIT; - __IO uint32_t DATA; /**< Data, offset: 0x0 */ - }; - union { /* offset: 0x4 */ - struct { /* offset: 0x4 */ - __IO uint8_t GPOLYLL; /**< CRC_GPOLYLL register, offset: 0x4 */ - __IO uint8_t GPOLYLU; /**< CRC_GPOLYLU register, offset: 0x5 */ - __IO uint8_t GPOLYHL; /**< CRC_GPOLYHL register, offset: 0x6 */ - __IO uint8_t GPOLYHU; /**< CRC_GPOLYHU register, offset: 0x7 */ - } GPOLY_ACCESS8BIT; - struct { /* offset: 0x4 */ - __IO uint16_t GPOLYL; /**< CRC_GPOLYL register, offset: 0x4 */ - __IO uint16_t GPOLYH; /**< CRC_GPOLYH register, offset: 0x6 */ - } GPOLY_ACCESS16BIT; - __IO uint32_t GPOLY; /**< Polynomial, offset: 0x4 */ - }; - union { /* offset: 0x8 */ - struct { /* offset: 0x8 */ - uint8_t RESERVED_0[3]; - __IO uint8_t CTRLHU; /**< CRC_CTRLHU register, offset: 0xB */ - } CTRL_ACCESS8BIT; - __IO uint32_t CTRL; /**< Control, offset: 0x8 */ - }; -} CRC_Type; - -/* ---------------------------------------------------------------------------- - -- CRC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CRC_Register_Masks CRC Register Masks - * @{ - */ - -/*! @name DATALL - CRC_DATALL register */ -/*! @{ */ - -#define CRC_DATALL_DATALL_MASK (0xFFU) -#define CRC_DATALL_DATALL_SHIFT (0U) -#define CRC_DATALL_DATALL(x) (((uint8_t)(((uint8_t)(x)) << CRC_DATALL_DATALL_SHIFT)) & CRC_DATALL_DATALL_MASK) -/*! @} */ - -/*! @name DATALU - CRC_DATALU register */ -/*! @{ */ - -#define CRC_DATALU_DATALU_MASK (0xFFU) -#define CRC_DATALU_DATALU_SHIFT (0U) -#define CRC_DATALU_DATALU(x) (((uint8_t)(((uint8_t)(x)) << CRC_DATALU_DATALU_SHIFT)) & CRC_DATALU_DATALU_MASK) -/*! @} */ - -/*! @name DATAHL - CRC_DATAHL register */ -/*! @{ */ - -#define CRC_DATAHL_DATAHL_MASK (0xFFU) -#define CRC_DATAHL_DATAHL_SHIFT (0U) -#define CRC_DATAHL_DATAHL(x) (((uint8_t)(((uint8_t)(x)) << CRC_DATAHL_DATAHL_SHIFT)) & CRC_DATAHL_DATAHL_MASK) -/*! @} */ - -/*! @name DATAHU - CRC_DATAHU register */ -/*! @{ */ - -#define CRC_DATAHU_DATAHU_MASK (0xFFU) -#define CRC_DATAHU_DATAHU_SHIFT (0U) -#define CRC_DATAHU_DATAHU(x) (((uint8_t)(((uint8_t)(x)) << CRC_DATAHU_DATAHU_SHIFT)) & CRC_DATAHU_DATAHU_MASK) -/*! @} */ - -/*! @name DATAL - CRC_DATAL register */ -/*! @{ */ - -#define CRC_DATAL_DATAL_MASK (0xFFFFU) -#define CRC_DATAL_DATAL_SHIFT (0U) -#define CRC_DATAL_DATAL(x) (((uint16_t)(((uint16_t)(x)) << CRC_DATAL_DATAL_SHIFT)) & CRC_DATAL_DATAL_MASK) -/*! @} */ - -/*! @name DATAH - CRC_DATAH register */ -/*! @{ */ - -#define CRC_DATAH_DATAH_MASK (0xFFFFU) -#define CRC_DATAH_DATAH_SHIFT (0U) -#define CRC_DATAH_DATAH(x) (((uint16_t)(((uint16_t)(x)) << CRC_DATAH_DATAH_SHIFT)) & CRC_DATAH_DATAH_MASK) -/*! @} */ - -/*! @name DATA - Data */ -/*! @{ */ - -#define CRC_DATA_LL_MASK (0xFFU) -#define CRC_DATA_LL_SHIFT (0U) -/*! LL - Lower Part of Low Byte */ -#define CRC_DATA_LL(x) (((uint32_t)(((uint32_t)(x)) << CRC_DATA_LL_SHIFT)) & CRC_DATA_LL_MASK) - -#define CRC_DATA_LU_MASK (0xFF00U) -#define CRC_DATA_LU_SHIFT (8U) -/*! LU - Upper Part of Low Byte */ -#define CRC_DATA_LU(x) (((uint32_t)(((uint32_t)(x)) << CRC_DATA_LU_SHIFT)) & CRC_DATA_LU_MASK) - -#define CRC_DATA_HL_MASK (0xFF0000U) -#define CRC_DATA_HL_SHIFT (16U) -/*! HL - Lower Part of High Byte */ -#define CRC_DATA_HL(x) (((uint32_t)(((uint32_t)(x)) << CRC_DATA_HL_SHIFT)) & CRC_DATA_HL_MASK) - -#define CRC_DATA_HU_MASK (0xFF000000U) -#define CRC_DATA_HU_SHIFT (24U) -/*! HU - Upper Part of High Byte */ -#define CRC_DATA_HU(x) (((uint32_t)(((uint32_t)(x)) << CRC_DATA_HU_SHIFT)) & CRC_DATA_HU_MASK) -/*! @} */ - -/*! @name GPOLYLL - CRC_GPOLYLL register */ -/*! @{ */ - -#define CRC_GPOLYLL_GPOLYLL_MASK (0xFFU) -#define CRC_GPOLYLL_GPOLYLL_SHIFT (0U) -#define CRC_GPOLYLL_GPOLYLL(x) (((uint8_t)(((uint8_t)(x)) << CRC_GPOLYLL_GPOLYLL_SHIFT)) & CRC_GPOLYLL_GPOLYLL_MASK) -/*! @} */ - -/*! @name GPOLYLU - CRC_GPOLYLU register */ -/*! @{ */ - -#define CRC_GPOLYLU_GPOLYLU_MASK (0xFFU) -#define CRC_GPOLYLU_GPOLYLU_SHIFT (0U) -#define CRC_GPOLYLU_GPOLYLU(x) (((uint8_t)(((uint8_t)(x)) << CRC_GPOLYLU_GPOLYLU_SHIFT)) & CRC_GPOLYLU_GPOLYLU_MASK) -/*! @} */ - -/*! @name GPOLYHL - CRC_GPOLYHL register */ -/*! @{ */ - -#define CRC_GPOLYHL_GPOLYHL_MASK (0xFFU) -#define CRC_GPOLYHL_GPOLYHL_SHIFT (0U) -#define CRC_GPOLYHL_GPOLYHL(x) (((uint8_t)(((uint8_t)(x)) << CRC_GPOLYHL_GPOLYHL_SHIFT)) & CRC_GPOLYHL_GPOLYHL_MASK) -/*! @} */ - -/*! @name GPOLYHU - CRC_GPOLYHU register */ -/*! @{ */ - -#define CRC_GPOLYHU_GPOLYHU_MASK (0xFFU) -#define CRC_GPOLYHU_GPOLYHU_SHIFT (0U) -#define CRC_GPOLYHU_GPOLYHU(x) (((uint8_t)(((uint8_t)(x)) << CRC_GPOLYHU_GPOLYHU_SHIFT)) & CRC_GPOLYHU_GPOLYHU_MASK) -/*! @} */ - -/*! @name GPOLYL - CRC_GPOLYL register */ -/*! @{ */ - -#define CRC_GPOLYL_GPOLYL_MASK (0xFFFFU) -#define CRC_GPOLYL_GPOLYL_SHIFT (0U) -#define CRC_GPOLYL_GPOLYL(x) (((uint16_t)(((uint16_t)(x)) << CRC_GPOLYL_GPOLYL_SHIFT)) & CRC_GPOLYL_GPOLYL_MASK) -/*! @} */ - -/*! @name GPOLYH - CRC_GPOLYH register */ -/*! @{ */ - -#define CRC_GPOLYH_GPOLYH_MASK (0xFFFFU) -#define CRC_GPOLYH_GPOLYH_SHIFT (0U) -#define CRC_GPOLYH_GPOLYH(x) (((uint16_t)(((uint16_t)(x)) << CRC_GPOLYH_GPOLYH_SHIFT)) & CRC_GPOLYH_GPOLYH_MASK) -/*! @} */ - -/*! @name GPOLY - Polynomial */ -/*! @{ */ - -#define CRC_GPOLY_LOW_MASK (0xFFFFU) -#define CRC_GPOLY_LOW_SHIFT (0U) -/*! LOW - Low Half-Word */ -#define CRC_GPOLY_LOW(x) (((uint32_t)(((uint32_t)(x)) << CRC_GPOLY_LOW_SHIFT)) & CRC_GPOLY_LOW_MASK) - -#define CRC_GPOLY_HIGH_MASK (0xFFFF0000U) -#define CRC_GPOLY_HIGH_SHIFT (16U) -/*! HIGH - High Half-Word */ -#define CRC_GPOLY_HIGH(x) (((uint32_t)(((uint32_t)(x)) << CRC_GPOLY_HIGH_SHIFT)) & CRC_GPOLY_HIGH_MASK) -/*! @} */ - -/*! @name CTRLHU - CRC_CTRLHU register */ -/*! @{ */ - -#define CRC_CTRLHU_TCRC_MASK (0x1U) -#define CRC_CTRLHU_TCRC_SHIFT (0U) -/*! TCRC - TCRC - * 0b0..16 bits - * 0b1..32 bits - */ -#define CRC_CTRLHU_TCRC(x) (((uint8_t)(((uint8_t)(x)) << CRC_CTRLHU_TCRC_SHIFT)) & CRC_CTRLHU_TCRC_MASK) - -#define CRC_CTRLHU_WAS_MASK (0x2U) -#define CRC_CTRLHU_WAS_SHIFT (1U) -/*! WAS - Write as Seed - * 0b0..Data values - * 0b1..Seed values - */ -#define CRC_CTRLHU_WAS(x) (((uint8_t)(((uint8_t)(x)) << CRC_CTRLHU_WAS_SHIFT)) & CRC_CTRLHU_WAS_MASK) - -#define CRC_CTRLHU_FXOR_MASK (0x4U) -#define CRC_CTRLHU_FXOR_SHIFT (2U) -/*! FXOR - Complement Read of CRC Data Register - * 0b0..Disables XOR on reading data. - * 0b1..Inverts or complements the read value of the CRC Data. - */ -#define CRC_CTRLHU_FXOR(x) (((uint8_t)(((uint8_t)(x)) << CRC_CTRLHU_FXOR_SHIFT)) & CRC_CTRLHU_FXOR_MASK) - -#define CRC_CTRLHU_TOTR_MASK (0x30U) -#define CRC_CTRLHU_TOTR_SHIFT (4U) -/*! TOTR - Transpose Type for Read - * 0b00..No transposition - * 0b01..Bits in bytes are transposed, but bytes are not transposed. - * 0b10..Both bits in bytes and bytes are transposed. - * 0b11..Only bytes are transposed, no bits in a byte are transposed. - */ -#define CRC_CTRLHU_TOTR(x) (((uint8_t)(((uint8_t)(x)) << CRC_CTRLHU_TOTR_SHIFT)) & CRC_CTRLHU_TOTR_MASK) - -#define CRC_CTRLHU_TOT_MASK (0xC0U) -#define CRC_CTRLHU_TOT_SHIFT (6U) -/*! TOT - Transpose Type for Write - * 0b00..No transposition - * 0b01..Bits in bytes are transposed, but bytes are not transposed. - * 0b10..Both bits in bytes and bytes are transposed. - * 0b11..Only bytes are transposed, no bits in a byte are transposed. - */ -#define CRC_CTRLHU_TOT(x) (((uint8_t)(((uint8_t)(x)) << CRC_CTRLHU_TOT_SHIFT)) & CRC_CTRLHU_TOT_MASK) -/*! @} */ - -/*! @name CTRL - Control */ -/*! @{ */ - -#define CRC_CTRL_TCRC_MASK (0x1000000U) -#define CRC_CTRL_TCRC_SHIFT (24U) -/*! TCRC - TCRC - * 0b0..16 bits - * 0b1..32 bits - */ -#define CRC_CTRL_TCRC(x) (((uint32_t)(((uint32_t)(x)) << CRC_CTRL_TCRC_SHIFT)) & CRC_CTRL_TCRC_MASK) - -#define CRC_CTRL_WAS_MASK (0x2000000U) -#define CRC_CTRL_WAS_SHIFT (25U) -/*! WAS - Write as Seed - * 0b0..Data values - * 0b1..Seed values - */ -#define CRC_CTRL_WAS(x) (((uint32_t)(((uint32_t)(x)) << CRC_CTRL_WAS_SHIFT)) & CRC_CTRL_WAS_MASK) - -#define CRC_CTRL_FXOR_MASK (0x4000000U) -#define CRC_CTRL_FXOR_SHIFT (26U) -/*! FXOR - Complement Read of CRC Data Register - * 0b0..Disables XOR on reading data. - * 0b1..Inverts or complements the read value of the CRC Data. - */ -#define CRC_CTRL_FXOR(x) (((uint32_t)(((uint32_t)(x)) << CRC_CTRL_FXOR_SHIFT)) & CRC_CTRL_FXOR_MASK) - -#define CRC_CTRL_TOTR_MASK (0x30000000U) -#define CRC_CTRL_TOTR_SHIFT (28U) -/*! TOTR - Transpose Type for Read - * 0b00..No transposition - * 0b01..Bits in bytes are transposed, but bytes are not transposed. - * 0b10..Both bits in bytes and bytes are transposed. - * 0b11..Only bytes are transposed, no bits in a byte are transposed. - */ -#define CRC_CTRL_TOTR(x) (((uint32_t)(((uint32_t)(x)) << CRC_CTRL_TOTR_SHIFT)) & CRC_CTRL_TOTR_MASK) - -#define CRC_CTRL_TOT_MASK (0xC0000000U) -#define CRC_CTRL_TOT_SHIFT (30U) -/*! TOT - Transpose Type for Write - * 0b00..No transposition - * 0b01..Bits in bytes are transposed, but bytes are not transposed. - * 0b10..Both bits in bytes and bytes are transposed. - * 0b11..Only bytes are transposed, no bits in a byte are transposed. - */ -#define CRC_CTRL_TOT(x) (((uint32_t)(((uint32_t)(x)) << CRC_CTRL_TOT_SHIFT)) & CRC_CTRL_TOT_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group CRC_Register_Masks */ - - -/* CRC - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral CRC0 base address */ - #define CRC0_BASE (0x500CB000u) - /** Peripheral CRC0 base address */ - #define CRC0_BASE_NS (0x400CB000u) - /** Peripheral CRC0 base pointer */ - #define CRC0 ((CRC_Type *)CRC0_BASE) - /** Peripheral CRC0 base pointer */ - #define CRC0_NS ((CRC_Type *)CRC0_BASE_NS) - /** Array initializer of CRC peripheral base addresses */ - #define CRC_BASE_ADDRS { CRC0_BASE } - /** Array initializer of CRC peripheral base pointers */ - #define CRC_BASE_PTRS { CRC0 } - /** Array initializer of CRC peripheral base addresses */ - #define CRC_BASE_ADDRS_NS { CRC0_BASE_NS } - /** Array initializer of CRC peripheral base pointers */ - #define CRC_BASE_PTRS_NS { CRC0_NS } -#else - /** Peripheral CRC0 base address */ - #define CRC0_BASE (0x400CB000u) - /** Peripheral CRC0 base pointer */ - #define CRC0 ((CRC_Type *)CRC0_BASE) - /** Array initializer of CRC peripheral base addresses */ - #define CRC_BASE_ADDRS { CRC0_BASE } - /** Array initializer of CRC peripheral base pointers */ - #define CRC_BASE_PTRS { CRC0 } -#endif - -/*! - * @} - */ /* end of group CRC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- CTIMER Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CTIMER_Peripheral_Access_Layer CTIMER Peripheral Access Layer - * @{ - */ - -/** CTIMER - Register Layout Typedef */ -typedef struct { - __IO uint32_t IR; /**< Interrupt, offset: 0x0 */ - __IO uint32_t TCR; /**< Timer Control, offset: 0x4 */ - __IO uint32_t TC; /**< Timer Counter, offset: 0x8 */ - __IO uint32_t PR; /**< Prescale, offset: 0xC */ - __IO uint32_t PC; /**< Prescale Counter, offset: 0x10 */ - __IO uint32_t MCR; /**< Match Control, offset: 0x14 */ - __IO uint32_t MR[4]; /**< Match, array offset: 0x18, array step: 0x4 */ - __IO uint32_t CCR; /**< Capture Control, offset: 0x28 */ - __I uint32_t CR[4]; /**< Capture, array offset: 0x2C, array step: 0x4 */ - __IO uint32_t EMR; /**< External Match, offset: 0x3C */ - uint8_t RESERVED_0[48]; - __IO uint32_t CTCR; /**< Count Control, offset: 0x70 */ - __IO uint32_t PWMC; /**< PWM Control, offset: 0x74 */ - __IO uint32_t MSR[4]; /**< Match Shadow, array offset: 0x78, array step: 0x4 */ -} CTIMER_Type; - -/* ---------------------------------------------------------------------------- - -- CTIMER Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CTIMER_Register_Masks CTIMER Register Masks - * @{ - */ - -/*! @name IR - Interrupt */ -/*! @{ */ - -#define CTIMER_IR_MR0INT_MASK (0x1U) -#define CTIMER_IR_MR0INT_SHIFT (0U) -/*! MR0INT - Interrupt Flag for Match Channel 0 Event */ -#define CTIMER_IR_MR0INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_MR0INT_SHIFT)) & CTIMER_IR_MR0INT_MASK) - -#define CTIMER_IR_MR1INT_MASK (0x2U) -#define CTIMER_IR_MR1INT_SHIFT (1U) -/*! MR1INT - Interrupt Flag for Match Channel 1 Event */ -#define CTIMER_IR_MR1INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_MR1INT_SHIFT)) & CTIMER_IR_MR1INT_MASK) - -#define CTIMER_IR_MR2INT_MASK (0x4U) -#define CTIMER_IR_MR2INT_SHIFT (2U) -/*! MR2INT - Interrupt Flag for Match Channel 2 Event */ -#define CTIMER_IR_MR2INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_MR2INT_SHIFT)) & CTIMER_IR_MR2INT_MASK) - -#define CTIMER_IR_MR3INT_MASK (0x8U) -#define CTIMER_IR_MR3INT_SHIFT (3U) -/*! MR3INT - Interrupt Flag for Match Channel 3 Event */ -#define CTIMER_IR_MR3INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_MR3INT_SHIFT)) & CTIMER_IR_MR3INT_MASK) - -#define CTIMER_IR_CR0INT_MASK (0x10U) -#define CTIMER_IR_CR0INT_SHIFT (4U) -/*! CR0INT - Interrupt Flag for Capture Channel 0 Event */ -#define CTIMER_IR_CR0INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_CR0INT_SHIFT)) & CTIMER_IR_CR0INT_MASK) - -#define CTIMER_IR_CR1INT_MASK (0x20U) -#define CTIMER_IR_CR1INT_SHIFT (5U) -/*! CR1INT - Interrupt Flag for Capture Channel 1 Event */ -#define CTIMER_IR_CR1INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_CR1INT_SHIFT)) & CTIMER_IR_CR1INT_MASK) - -#define CTIMER_IR_CR2INT_MASK (0x40U) -#define CTIMER_IR_CR2INT_SHIFT (6U) -/*! CR2INT - Interrupt Flag for Capture Channel 2 Event */ -#define CTIMER_IR_CR2INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_CR2INT_SHIFT)) & CTIMER_IR_CR2INT_MASK) - -#define CTIMER_IR_CR3INT_MASK (0x80U) -#define CTIMER_IR_CR3INT_SHIFT (7U) -/*! CR3INT - Interrupt Flag for Capture Channel 3 Event */ -#define CTIMER_IR_CR3INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_CR3INT_SHIFT)) & CTIMER_IR_CR3INT_MASK) -/*! @} */ - -/*! @name TCR - Timer Control */ -/*! @{ */ - -#define CTIMER_TCR_CEN_MASK (0x1U) -#define CTIMER_TCR_CEN_SHIFT (0U) -/*! CEN - Counter Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_TCR_CEN(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TCR_CEN_SHIFT)) & CTIMER_TCR_CEN_MASK) - -#define CTIMER_TCR_CRST_MASK (0x2U) -#define CTIMER_TCR_CRST_SHIFT (1U) -/*! CRST - Counter Reset Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_TCR_CRST(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TCR_CRST_SHIFT)) & CTIMER_TCR_CRST_MASK) - -#define CTIMER_TCR_AGCEN_MASK (0x10U) -#define CTIMER_TCR_AGCEN_SHIFT (4U) -/*! AGCEN - Allow Global Count Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_TCR_AGCEN(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TCR_AGCEN_SHIFT)) & CTIMER_TCR_AGCEN_MASK) - -#define CTIMER_TCR_ATCEN_MASK (0x20U) -#define CTIMER_TCR_ATCEN_SHIFT (5U) -/*! ATCEN - Allow Trigger Count Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_TCR_ATCEN(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TCR_ATCEN_SHIFT)) & CTIMER_TCR_ATCEN_MASK) -/*! @} */ - -/*! @name TC - Timer Counter */ -/*! @{ */ - -#define CTIMER_TC_TCVAL_MASK (0xFFFFFFFFU) -#define CTIMER_TC_TCVAL_SHIFT (0U) -/*! TCVAL - Timer Counter Value */ -#define CTIMER_TC_TCVAL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TC_TCVAL_SHIFT)) & CTIMER_TC_TCVAL_MASK) -/*! @} */ - -/*! @name PR - Prescale */ -/*! @{ */ - -#define CTIMER_PR_PRVAL_MASK (0xFFFFFFFFU) -#define CTIMER_PR_PRVAL_SHIFT (0U) -/*! PRVAL - Prescale Reload Value */ -#define CTIMER_PR_PRVAL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PR_PRVAL_SHIFT)) & CTIMER_PR_PRVAL_MASK) -/*! @} */ - -/*! @name PC - Prescale Counter */ -/*! @{ */ - -#define CTIMER_PC_PCVAL_MASK (0xFFFFFFFFU) -#define CTIMER_PC_PCVAL_SHIFT (0U) -/*! PCVAL - Prescale Counter Value */ -#define CTIMER_PC_PCVAL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PC_PCVAL_SHIFT)) & CTIMER_PC_PCVAL_MASK) -/*! @} */ - -/*! @name MCR - Match Control */ -/*! @{ */ - -#define CTIMER_MCR_MR0I_MASK (0x1U) -#define CTIMER_MCR_MR0I_SHIFT (0U) -/*! MR0I - Interrupt on MR0 - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_MCR_MR0I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR0I_SHIFT)) & CTIMER_MCR_MR0I_MASK) - -#define CTIMER_MCR_MR0R_MASK (0x2U) -#define CTIMER_MCR_MR0R_SHIFT (1U) -/*! MR0R - Reset on MR0 - * 0b0..Does not reset - * 0b1..Resets - */ -#define CTIMER_MCR_MR0R(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR0R_SHIFT)) & CTIMER_MCR_MR0R_MASK) - -#define CTIMER_MCR_MR0S_MASK (0x4U) -#define CTIMER_MCR_MR0S_SHIFT (2U) -/*! MR0S - Stop on MR0 - * 0b0..Does not stop - * 0b1..Stops - */ -#define CTIMER_MCR_MR0S(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR0S_SHIFT)) & CTIMER_MCR_MR0S_MASK) - -#define CTIMER_MCR_MR1I_MASK (0x8U) -#define CTIMER_MCR_MR1I_SHIFT (3U) -/*! MR1I - Interrupt on MR1 - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_MCR_MR1I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR1I_SHIFT)) & CTIMER_MCR_MR1I_MASK) - -#define CTIMER_MCR_MR1R_MASK (0x10U) -#define CTIMER_MCR_MR1R_SHIFT (4U) -/*! MR1R - Reset on MR1 - * 0b0..Does not reset - * 0b1..Resets - */ -#define CTIMER_MCR_MR1R(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR1R_SHIFT)) & CTIMER_MCR_MR1R_MASK) - -#define CTIMER_MCR_MR1S_MASK (0x20U) -#define CTIMER_MCR_MR1S_SHIFT (5U) -/*! MR1S - Stop on MR1 - * 0b0..Does not stop - * 0b1..Stops - */ -#define CTIMER_MCR_MR1S(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR1S_SHIFT)) & CTIMER_MCR_MR1S_MASK) - -#define CTIMER_MCR_MR2I_MASK (0x40U) -#define CTIMER_MCR_MR2I_SHIFT (6U) -/*! MR2I - Interrupt on MR2 - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_MCR_MR2I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR2I_SHIFT)) & CTIMER_MCR_MR2I_MASK) - -#define CTIMER_MCR_MR2R_MASK (0x80U) -#define CTIMER_MCR_MR2R_SHIFT (7U) -/*! MR2R - Reset on MR2 - * 0b0..Does not reset - * 0b1..Resets - */ -#define CTIMER_MCR_MR2R(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR2R_SHIFT)) & CTIMER_MCR_MR2R_MASK) - -#define CTIMER_MCR_MR2S_MASK (0x100U) -#define CTIMER_MCR_MR2S_SHIFT (8U) -/*! MR2S - Stop on MR2 - * 0b0..Does not stop - * 0b1..Stops - */ -#define CTIMER_MCR_MR2S(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR2S_SHIFT)) & CTIMER_MCR_MR2S_MASK) - -#define CTIMER_MCR_MR3I_MASK (0x200U) -#define CTIMER_MCR_MR3I_SHIFT (9U) -/*! MR3I - Interrupt on MR3 - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_MCR_MR3I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR3I_SHIFT)) & CTIMER_MCR_MR3I_MASK) - -#define CTIMER_MCR_MR3R_MASK (0x400U) -#define CTIMER_MCR_MR3R_SHIFT (10U) -/*! MR3R - Reset on MR3 - * 0b0..Does not reset - * 0b1..Resets - */ -#define CTIMER_MCR_MR3R(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR3R_SHIFT)) & CTIMER_MCR_MR3R_MASK) - -#define CTIMER_MCR_MR3S_MASK (0x800U) -#define CTIMER_MCR_MR3S_SHIFT (11U) -/*! MR3S - Stop on MR3 - * 0b0..Does not stop - * 0b1..Stops - */ -#define CTIMER_MCR_MR3S(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR3S_SHIFT)) & CTIMER_MCR_MR3S_MASK) - -#define CTIMER_MCR_MR0RL_MASK (0x1000000U) -#define CTIMER_MCR_MR0RL_SHIFT (24U) -/*! MR0RL - Reload MR - * 0b0..Does not reload - * 0b1..Reloads - */ -#define CTIMER_MCR_MR0RL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR0RL_SHIFT)) & CTIMER_MCR_MR0RL_MASK) - -#define CTIMER_MCR_MR1RL_MASK (0x2000000U) -#define CTIMER_MCR_MR1RL_SHIFT (25U) -/*! MR1RL - Reload MR - * 0b0..Does not reload - * 0b1..Reloads - */ -#define CTIMER_MCR_MR1RL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR1RL_SHIFT)) & CTIMER_MCR_MR1RL_MASK) - -#define CTIMER_MCR_MR2RL_MASK (0x4000000U) -#define CTIMER_MCR_MR2RL_SHIFT (26U) -/*! MR2RL - Reload MR - * 0b0..Does not reload - * 0b1..Reloads - */ -#define CTIMER_MCR_MR2RL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR2RL_SHIFT)) & CTIMER_MCR_MR2RL_MASK) - -#define CTIMER_MCR_MR3RL_MASK (0x8000000U) -#define CTIMER_MCR_MR3RL_SHIFT (27U) -/*! MR3RL - Reload MR - * 0b0..Does not reload - * 0b1..Reloads - */ -#define CTIMER_MCR_MR3RL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR3RL_SHIFT)) & CTIMER_MCR_MR3RL_MASK) -/*! @} */ - -/*! @name MR - Match */ -/*! @{ */ - -#define CTIMER_MR_MATCH_MASK (0xFFFFFFFFU) -#define CTIMER_MR_MATCH_SHIFT (0U) -/*! MATCH - Timer Counter Match Value */ -#define CTIMER_MR_MATCH(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MR_MATCH_SHIFT)) & CTIMER_MR_MATCH_MASK) -/*! @} */ - -/* The count of CTIMER_MR */ -#define CTIMER_MR_COUNT (4U) - -/*! @name CCR - Capture Control */ -/*! @{ */ - -#define CTIMER_CCR_CAP0RE_MASK (0x1U) -#define CTIMER_CCR_CAP0RE_SHIFT (0U) -/*! CAP0RE - Rising Edge of Capture Channel 0 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP0RE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP0RE_SHIFT)) & CTIMER_CCR_CAP0RE_MASK) - -#define CTIMER_CCR_CAP0FE_MASK (0x2U) -#define CTIMER_CCR_CAP0FE_SHIFT (1U) -/*! CAP0FE - Falling Edge of Capture Channel 0 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP0FE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP0FE_SHIFT)) & CTIMER_CCR_CAP0FE_MASK) - -#define CTIMER_CCR_CAP0I_MASK (0x4U) -#define CTIMER_CCR_CAP0I_SHIFT (2U) -/*! CAP0I - Generate Interrupt on Channel 0 Capture Event - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_CCR_CAP0I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP0I_SHIFT)) & CTIMER_CCR_CAP0I_MASK) - -#define CTIMER_CCR_CAP1RE_MASK (0x8U) -#define CTIMER_CCR_CAP1RE_SHIFT (3U) -/*! CAP1RE - Rising Edge of Capture Channel 1 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP1RE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP1RE_SHIFT)) & CTIMER_CCR_CAP1RE_MASK) - -#define CTIMER_CCR_CAP1FE_MASK (0x10U) -#define CTIMER_CCR_CAP1FE_SHIFT (4U) -/*! CAP1FE - Falling Edge of Capture Channel 1 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP1FE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP1FE_SHIFT)) & CTIMER_CCR_CAP1FE_MASK) - -#define CTIMER_CCR_CAP1I_MASK (0x20U) -#define CTIMER_CCR_CAP1I_SHIFT (5U) -/*! CAP1I - Generate Interrupt on Channel 1 Capture Event - * 0b0..Does not generates - * 0b1..Generates - */ -#define CTIMER_CCR_CAP1I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP1I_SHIFT)) & CTIMER_CCR_CAP1I_MASK) - -#define CTIMER_CCR_CAP2RE_MASK (0x40U) -#define CTIMER_CCR_CAP2RE_SHIFT (6U) -/*! CAP2RE - Rising Edge of Capture Channel 2 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP2RE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP2RE_SHIFT)) & CTIMER_CCR_CAP2RE_MASK) - -#define CTIMER_CCR_CAP2FE_MASK (0x80U) -#define CTIMER_CCR_CAP2FE_SHIFT (7U) -/*! CAP2FE - Falling Edge of Capture Channel 2 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP2FE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP2FE_SHIFT)) & CTIMER_CCR_CAP2FE_MASK) - -#define CTIMER_CCR_CAP2I_MASK (0x100U) -#define CTIMER_CCR_CAP2I_SHIFT (8U) -/*! CAP2I - Generate Interrupt on Channel 2 Capture Event - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_CCR_CAP2I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP2I_SHIFT)) & CTIMER_CCR_CAP2I_MASK) - -#define CTIMER_CCR_CAP3RE_MASK (0x200U) -#define CTIMER_CCR_CAP3RE_SHIFT (9U) -/*! CAP3RE - Rising Edge of Capture Channel 3 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP3RE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP3RE_SHIFT)) & CTIMER_CCR_CAP3RE_MASK) - -#define CTIMER_CCR_CAP3FE_MASK (0x400U) -#define CTIMER_CCR_CAP3FE_SHIFT (10U) -/*! CAP3FE - Falling Edge of Capture Channel 3 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP3FE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP3FE_SHIFT)) & CTIMER_CCR_CAP3FE_MASK) - -#define CTIMER_CCR_CAP3I_MASK (0x800U) -#define CTIMER_CCR_CAP3I_SHIFT (11U) -/*! CAP3I - Generate Interrupt on Channel 3 Capture Event - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_CCR_CAP3I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP3I_SHIFT)) & CTIMER_CCR_CAP3I_MASK) -/*! @} */ - -/*! @name CR - Capture */ -/*! @{ */ - -#define CTIMER_CR_CAP_MASK (0xFFFFFFFFU) -#define CTIMER_CR_CAP_SHIFT (0U) -/*! CAP - Timer Counter Capture Value */ -#define CTIMER_CR_CAP(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CR_CAP_SHIFT)) & CTIMER_CR_CAP_MASK) -/*! @} */ - -/* The count of CTIMER_CR */ -#define CTIMER_CR_COUNT (4U) - -/*! @name EMR - External Match */ -/*! @{ */ - -#define CTIMER_EMR_EM0_MASK (0x1U) -#define CTIMER_EMR_EM0_SHIFT (0U) -/*! EM0 - External Match 0 - * 0b0..Low - * 0b1..High - */ -#define CTIMER_EMR_EM0(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EM0_SHIFT)) & CTIMER_EMR_EM0_MASK) - -#define CTIMER_EMR_EM1_MASK (0x2U) -#define CTIMER_EMR_EM1_SHIFT (1U) -/*! EM1 - External Match 1 - * 0b0..Low - * 0b1..High - */ -#define CTIMER_EMR_EM1(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EM1_SHIFT)) & CTIMER_EMR_EM1_MASK) - -#define CTIMER_EMR_EM2_MASK (0x4U) -#define CTIMER_EMR_EM2_SHIFT (2U) -/*! EM2 - External Match 2 - * 0b0..Low - * 0b1..High - */ -#define CTIMER_EMR_EM2(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EM2_SHIFT)) & CTIMER_EMR_EM2_MASK) - -#define CTIMER_EMR_EM3_MASK (0x8U) -#define CTIMER_EMR_EM3_SHIFT (3U) -/*! EM3 - External Match 3 - * 0b0..Low - * 0b1..High - */ -#define CTIMER_EMR_EM3(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EM3_SHIFT)) & CTIMER_EMR_EM3_MASK) - -#define CTIMER_EMR_EMC0_MASK (0x30U) -#define CTIMER_EMR_EMC0_SHIFT (4U) -/*! EMC0 - External Match Control 0 - * 0b00..Does nothing - * 0b01..Goes low - * 0b10..Goes high - * 0b11..Toggles - */ -#define CTIMER_EMR_EMC0(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EMC0_SHIFT)) & CTIMER_EMR_EMC0_MASK) - -#define CTIMER_EMR_EMC1_MASK (0xC0U) -#define CTIMER_EMR_EMC1_SHIFT (6U) -/*! EMC1 - External Match Control 1 - * 0b00..Does nothing - * 0b01..Goes low - * 0b10..Goes high - * 0b11..Toggles - */ -#define CTIMER_EMR_EMC1(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EMC1_SHIFT)) & CTIMER_EMR_EMC1_MASK) - -#define CTIMER_EMR_EMC2_MASK (0x300U) -#define CTIMER_EMR_EMC2_SHIFT (8U) -/*! EMC2 - External Match Control 2 - * 0b00..Does nothing - * 0b01..Goes low - * 0b10..Goes high - * 0b11..Toggles - */ -#define CTIMER_EMR_EMC2(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EMC2_SHIFT)) & CTIMER_EMR_EMC2_MASK) - -#define CTIMER_EMR_EMC3_MASK (0xC00U) -#define CTIMER_EMR_EMC3_SHIFT (10U) -/*! EMC3 - External Match Control 3 - * 0b00..Does nothing - * 0b01..Goes low - * 0b10..Goes high - * 0b11..Toggles - */ -#define CTIMER_EMR_EMC3(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EMC3_SHIFT)) & CTIMER_EMR_EMC3_MASK) -/*! @} */ - -/*! @name CTCR - Count Control */ -/*! @{ */ - -#define CTIMER_CTCR_CTMODE_MASK (0x3U) -#define CTIMER_CTCR_CTMODE_SHIFT (0U) -/*! CTMODE - Counter Timer Mode - * 0b00..Timer mode - * 0b01..Counter mode rising edge - * 0b10..Counter mode falling edge - * 0b11..Counter mode dual edge - */ -#define CTIMER_CTCR_CTMODE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CTCR_CTMODE_SHIFT)) & CTIMER_CTCR_CTMODE_MASK) - -#define CTIMER_CTCR_CINSEL_MASK (0xCU) -#define CTIMER_CTCR_CINSEL_SHIFT (2U) -/*! CINSEL - Count Input Select - * 0b00..Channel 0, CAPn[0] for CTIMERn - * 0b01..Channel 1, CAPn[1] for CTIMERn - * 0b10..Channel 2, CAPn[2] for CTIMERn - * 0b11..Channel 3, CAPn[3] for CTIMERn - */ -#define CTIMER_CTCR_CINSEL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CTCR_CINSEL_SHIFT)) & CTIMER_CTCR_CINSEL_MASK) - -#define CTIMER_CTCR_ENCC_MASK (0x10U) -#define CTIMER_CTCR_ENCC_SHIFT (4U) -/*! ENCC - Capture Channel Enable */ -#define CTIMER_CTCR_ENCC(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CTCR_ENCC_SHIFT)) & CTIMER_CTCR_ENCC_MASK) - -#define CTIMER_CTCR_SELCC_MASK (0xE0U) -#define CTIMER_CTCR_SELCC_SHIFT (5U) -/*! SELCC - Edge Select - * 0b000..Capture channel 0 rising edge - * 0b001..Capture channel 0 falling edge - * 0b010..Capture channel 1 rising edge - * 0b011..Capture channel 1 falling edge - * 0b100..Capture channel 2 rising edge - * 0b101..Capture channel 2 falling edge - */ -#define CTIMER_CTCR_SELCC(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CTCR_SELCC_SHIFT)) & CTIMER_CTCR_SELCC_MASK) -/*! @} */ - -/*! @name PWMC - PWM Control */ -/*! @{ */ - -#define CTIMER_PWMC_PWMEN0_MASK (0x1U) -#define CTIMER_PWMC_PWMEN0_SHIFT (0U) -/*! PWMEN0 - PWM Mode Enable for Channel 0 - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_PWMC_PWMEN0(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PWMC_PWMEN0_SHIFT)) & CTIMER_PWMC_PWMEN0_MASK) - -#define CTIMER_PWMC_PWMEN1_MASK (0x2U) -#define CTIMER_PWMC_PWMEN1_SHIFT (1U) -/*! PWMEN1 - PWM Mode Enable for Channel 1 - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_PWMC_PWMEN1(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PWMC_PWMEN1_SHIFT)) & CTIMER_PWMC_PWMEN1_MASK) - -#define CTIMER_PWMC_PWMEN2_MASK (0x4U) -#define CTIMER_PWMC_PWMEN2_SHIFT (2U) -/*! PWMEN2 - PWM Mode Enable for Channel 2 - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_PWMC_PWMEN2(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PWMC_PWMEN2_SHIFT)) & CTIMER_PWMC_PWMEN2_MASK) - -#define CTIMER_PWMC_PWMEN3_MASK (0x8U) -#define CTIMER_PWMC_PWMEN3_SHIFT (3U) -/*! PWMEN3 - PWM Mode Enable for Channel 3 - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_PWMC_PWMEN3(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PWMC_PWMEN3_SHIFT)) & CTIMER_PWMC_PWMEN3_MASK) -/*! @} */ - -/*! @name MSR - Match Shadow */ -/*! @{ */ - -#define CTIMER_MSR_MATCH_SHADOW_MASK (0xFFFFFFFFU) -#define CTIMER_MSR_MATCH_SHADOW_SHIFT (0U) -/*! MATCH_SHADOW - Timer Counter Match Shadow Value */ -#define CTIMER_MSR_MATCH_SHADOW(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MSR_MATCH_SHADOW_SHIFT)) & CTIMER_MSR_MATCH_SHADOW_MASK) -/*! @} */ - -/* The count of CTIMER_MSR */ -#define CTIMER_MSR_COUNT (4U) - - -/*! - * @} - */ /* end of group CTIMER_Register_Masks */ - - -/* CTIMER - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral CTIMER0 base address */ - #define CTIMER0_BASE (0x5000C000u) - /** Peripheral CTIMER0 base address */ - #define CTIMER0_BASE_NS (0x4000C000u) - /** Peripheral CTIMER0 base pointer */ - #define CTIMER0 ((CTIMER_Type *)CTIMER0_BASE) - /** Peripheral CTIMER0 base pointer */ - #define CTIMER0_NS ((CTIMER_Type *)CTIMER0_BASE_NS) - /** Peripheral CTIMER1 base address */ - #define CTIMER1_BASE (0x5000D000u) - /** Peripheral CTIMER1 base address */ - #define CTIMER1_BASE_NS (0x4000D000u) - /** Peripheral CTIMER1 base pointer */ - #define CTIMER1 ((CTIMER_Type *)CTIMER1_BASE) - /** Peripheral CTIMER1 base pointer */ - #define CTIMER1_NS ((CTIMER_Type *)CTIMER1_BASE_NS) - /** Peripheral CTIMER2 base address */ - #define CTIMER2_BASE (0x5000E000u) - /** Peripheral CTIMER2 base address */ - #define CTIMER2_BASE_NS (0x4000E000u) - /** Peripheral CTIMER2 base pointer */ - #define CTIMER2 ((CTIMER_Type *)CTIMER2_BASE) - /** Peripheral CTIMER2 base pointer */ - #define CTIMER2_NS ((CTIMER_Type *)CTIMER2_BASE_NS) - /** Peripheral CTIMER3 base address */ - #define CTIMER3_BASE (0x5000F000u) - /** Peripheral CTIMER3 base address */ - #define CTIMER3_BASE_NS (0x4000F000u) - /** Peripheral CTIMER3 base pointer */ - #define CTIMER3 ((CTIMER_Type *)CTIMER3_BASE) - /** Peripheral CTIMER3 base pointer */ - #define CTIMER3_NS ((CTIMER_Type *)CTIMER3_BASE_NS) - /** Peripheral CTIMER4 base address */ - #define CTIMER4_BASE (0x50010000u) - /** Peripheral CTIMER4 base address */ - #define CTIMER4_BASE_NS (0x40010000u) - /** Peripheral CTIMER4 base pointer */ - #define CTIMER4 ((CTIMER_Type *)CTIMER4_BASE) - /** Peripheral CTIMER4 base pointer */ - #define CTIMER4_NS ((CTIMER_Type *)CTIMER4_BASE_NS) - /** Array initializer of CTIMER peripheral base addresses */ - #define CTIMER_BASE_ADDRS { CTIMER0_BASE, CTIMER1_BASE, CTIMER2_BASE, CTIMER3_BASE, CTIMER4_BASE } - /** Array initializer of CTIMER peripheral base pointers */ - #define CTIMER_BASE_PTRS { CTIMER0, CTIMER1, CTIMER2, CTIMER3, CTIMER4 } - /** Array initializer of CTIMER peripheral base addresses */ - #define CTIMER_BASE_ADDRS_NS { CTIMER0_BASE_NS, CTIMER1_BASE_NS, CTIMER2_BASE_NS, CTIMER3_BASE_NS, CTIMER4_BASE_NS } - /** Array initializer of CTIMER peripheral base pointers */ - #define CTIMER_BASE_PTRS_NS { CTIMER0_NS, CTIMER1_NS, CTIMER2_NS, CTIMER3_NS, CTIMER4_NS } -#else - /** Peripheral CTIMER0 base address */ - #define CTIMER0_BASE (0x4000C000u) - /** Peripheral CTIMER0 base pointer */ - #define CTIMER0 ((CTIMER_Type *)CTIMER0_BASE) - /** Peripheral CTIMER1 base address */ - #define CTIMER1_BASE (0x4000D000u) - /** Peripheral CTIMER1 base pointer */ - #define CTIMER1 ((CTIMER_Type *)CTIMER1_BASE) - /** Peripheral CTIMER2 base address */ - #define CTIMER2_BASE (0x4000E000u) - /** Peripheral CTIMER2 base pointer */ - #define CTIMER2 ((CTIMER_Type *)CTIMER2_BASE) - /** Peripheral CTIMER3 base address */ - #define CTIMER3_BASE (0x4000F000u) - /** Peripheral CTIMER3 base pointer */ - #define CTIMER3 ((CTIMER_Type *)CTIMER3_BASE) - /** Peripheral CTIMER4 base address */ - #define CTIMER4_BASE (0x40010000u) - /** Peripheral CTIMER4 base pointer */ - #define CTIMER4 ((CTIMER_Type *)CTIMER4_BASE) - /** Array initializer of CTIMER peripheral base addresses */ - #define CTIMER_BASE_ADDRS { CTIMER0_BASE, CTIMER1_BASE, CTIMER2_BASE, CTIMER3_BASE, CTIMER4_BASE } - /** Array initializer of CTIMER peripheral base pointers */ - #define CTIMER_BASE_PTRS { CTIMER0, CTIMER1, CTIMER2, CTIMER3, CTIMER4 } -#endif -/** Interrupt vectors for the CTIMER peripheral type */ -#define CTIMER_IRQS { CTIMER0_IRQn, CTIMER1_IRQn, CTIMER2_IRQn, CTIMER3_IRQn, CTIMER4_IRQn } - -/*! - * @} - */ /* end of group CTIMER_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- DIGTMP Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DIGTMP_Peripheral_Access_Layer DIGTMP Peripheral Access Layer - * @{ - */ - -/** DIGTMP - Register Layout Typedef */ -typedef struct { - uint8_t RESERVED_0[16]; - __IO uint32_t CR; /**< Control, offset: 0x10 */ - __IO uint32_t SR; /**< Status, offset: 0x14 */ - __IO uint32_t LR; /**< Lock, offset: 0x18 */ - __IO uint32_t IER; /**< Interrupt Enable, offset: 0x1C */ - __IO uint32_t TSR; /**< Tamper Seconds, offset: 0x20 */ - __IO uint32_t TER; /**< Tamper Enable, offset: 0x24 */ - __IO uint32_t PDR; /**< Pin Direction, offset: 0x28 */ - __IO uint32_t PPR; /**< Pin Polarity, offset: 0x2C */ - __IO uint32_t ATR[2]; /**< Active Tamper, array offset: 0x30, array step: 0x4 */ - uint8_t RESERVED_1[8]; - __IO uint32_t PGFR[8]; /**< Pin Glitch Filter, array offset: 0x40, array step: 0x4 */ -} DIGTMP_Type; - -/* ---------------------------------------------------------------------------- - -- DIGTMP Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DIGTMP_Register_Masks DIGTMP Register Masks - * @{ - */ - -/*! @name CR - Control */ -/*! @{ */ - -#define DIGTMP_CR_SWR_MASK (0x1U) -#define DIGTMP_CR_SWR_SHIFT (0U) -/*! SWR - Software Reset - * 0b0..No effect - * 0b1..Perform a software reset - */ -#define DIGTMP_CR_SWR(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_CR_SWR_SHIFT)) & DIGTMP_CR_SWR_MASK) - -#define DIGTMP_CR_DEN_MASK (0x2U) -#define DIGTMP_CR_DEN_SHIFT (1U) -/*! DEN - Digital Tamper Enable - * 0b0..Disables TDET clock and prescaler - * 0b1..Enables TDET clock and prescaler - */ -#define DIGTMP_CR_DEN(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_CR_DEN_SHIFT)) & DIGTMP_CR_DEN_MASK) - -#define DIGTMP_CR_TFSR_MASK (0x4U) -#define DIGTMP_CR_TFSR_SHIFT (2U) -/*! TFSR - Tamper Force System Reset - * 0b0..Do not force chip reset - * 0b1..Force chip reset - */ -#define DIGTMP_CR_TFSR(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_CR_TFSR_SHIFT)) & DIGTMP_CR_TFSR_MASK) - -#define DIGTMP_CR_UM_MASK (0x8U) -#define DIGTMP_CR_UM_SHIFT (3U) -/*! UM - Update Mode - * 0b0..No effect - * 0b1..Allows the clearing of interrupts - */ -#define DIGTMP_CR_UM(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_CR_UM_SHIFT)) & DIGTMP_CR_UM_MASK) - -#define DIGTMP_CR_ATCS0_MASK (0x10U) -#define DIGTMP_CR_ATCS0_SHIFT (4U) -/*! ATCS0 - Active Tamper Clock Source - * 0b0..1 Hz prescaler clock - * 0b1..64 Hz prescaler clock - */ -#define DIGTMP_CR_ATCS0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_CR_ATCS0_SHIFT)) & DIGTMP_CR_ATCS0_MASK) - -#define DIGTMP_CR_ATCS1_MASK (0x20U) -#define DIGTMP_CR_ATCS1_SHIFT (5U) -/*! ATCS1 - Active Tamper Clock Source - * 0b0..1 Hz prescaler clock - * 0b1..64 Hz prescaler clock - */ -#define DIGTMP_CR_ATCS1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_CR_ATCS1_SHIFT)) & DIGTMP_CR_ATCS1_MASK) - -#define DIGTMP_CR_DISTAM_MASK (0x100U) -#define DIGTMP_CR_DISTAM_SHIFT (8U) -/*! DISTAM - Disable Prescaler On Tamper - * 0b0..No effect - * 0b1..Automatically disables the prescaler after tamper detection - */ -#define DIGTMP_CR_DISTAM(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_CR_DISTAM_SHIFT)) & DIGTMP_CR_DISTAM_MASK) - -#define DIGTMP_CR_DPR_MASK (0xFFFE0000U) -#define DIGTMP_CR_DPR_SHIFT (17U) -/*! DPR - Digital Tamper Prescaler */ -#define DIGTMP_CR_DPR(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_CR_DPR_SHIFT)) & DIGTMP_CR_DPR_MASK) -/*! @} */ - -/*! @name SR - Status */ -/*! @{ */ - -#define DIGTMP_SR_DTF_MASK (0x1U) -#define DIGTMP_SR_DTF_SHIFT (0U) -/*! DTF - Digital Tamper Flag - * 0b0..TDET tampering not detected - * 0b1..TDET tampering detected - */ -#define DIGTMP_SR_DTF(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_DTF_SHIFT)) & DIGTMP_SR_DTF_MASK) - -#define DIGTMP_SR_TAF_MASK (0x2U) -#define DIGTMP_SR_TAF_SHIFT (1U) -/*! TAF - Tamper Acknowledge Flag - * 0b0..Digital Tamper Flag (SR[DTF]) is clear or chip reset has not occurred after Digital Tamper Flag (SR[DTF]) was set. - * 0b1..Chip reset has occurred after Digital Tamper Flag (SR[DTF]) was set. - */ -#define DIGTMP_SR_TAF(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TAF_SHIFT)) & DIGTMP_SR_TAF_MASK) - -#define DIGTMP_SR_TIF0_MASK (0x4U) -#define DIGTMP_SR_TIF0_SHIFT (2U) -/*! TIF0 - Tamper Input n Flag - * 0b0..On-chip tamper not detected - * 0b1..On-chip tamper detected - */ -#define DIGTMP_SR_TIF0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TIF0_SHIFT)) & DIGTMP_SR_TIF0_MASK) - -#define DIGTMP_SR_TIF1_MASK (0x8U) -#define DIGTMP_SR_TIF1_SHIFT (3U) -/*! TIF1 - Tamper Input n Flag - * 0b0..On-chip tamper not detected - * 0b1..On-chip tamper detected - */ -#define DIGTMP_SR_TIF1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TIF1_SHIFT)) & DIGTMP_SR_TIF1_MASK) - -#define DIGTMP_SR_TIF2_MASK (0x10U) -#define DIGTMP_SR_TIF2_SHIFT (4U) -/*! TIF2 - Tamper Input n Flag - * 0b0..On-chip tamper not detected - * 0b1..On-chip tamper detected - */ -#define DIGTMP_SR_TIF2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TIF2_SHIFT)) & DIGTMP_SR_TIF2_MASK) - -#define DIGTMP_SR_TIF3_MASK (0x20U) -#define DIGTMP_SR_TIF3_SHIFT (5U) -/*! TIF3 - Tamper Input n Flag - * 0b0..On-chip tamper not detected - * 0b1..On-chip tamper detected - */ -#define DIGTMP_SR_TIF3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TIF3_SHIFT)) & DIGTMP_SR_TIF3_MASK) - -#define DIGTMP_SR_TIF4_MASK (0x40U) -#define DIGTMP_SR_TIF4_SHIFT (6U) -/*! TIF4 - Tamper Input n Flag - * 0b0..On-chip tamper not detected - * 0b1..On-chip tamper detected - */ -#define DIGTMP_SR_TIF4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TIF4_SHIFT)) & DIGTMP_SR_TIF4_MASK) - -#define DIGTMP_SR_TIF5_MASK (0x80U) -#define DIGTMP_SR_TIF5_SHIFT (7U) -/*! TIF5 - Tamper Input n Flag - * 0b0..On-chip tamper not detected - * 0b1..On-chip tamper detected - */ -#define DIGTMP_SR_TIF5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TIF5_SHIFT)) & DIGTMP_SR_TIF5_MASK) - -#define DIGTMP_SR_TIF6_MASK (0x100U) -#define DIGTMP_SR_TIF6_SHIFT (8U) -/*! TIF6 - Tamper Input n Flag - * 0b0..On-chip tamper not detected - * 0b1..On-chip tamper detected - */ -#define DIGTMP_SR_TIF6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TIF6_SHIFT)) & DIGTMP_SR_TIF6_MASK) - -#define DIGTMP_SR_TIF7_MASK (0x200U) -#define DIGTMP_SR_TIF7_SHIFT (9U) -/*! TIF7 - Tamper Input n Flag - * 0b0..On-chip tamper not detected - * 0b1..On-chip tamper detected - */ -#define DIGTMP_SR_TIF7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TIF7_SHIFT)) & DIGTMP_SR_TIF7_MASK) - -#define DIGTMP_SR_TIF8_MASK (0x400U) -#define DIGTMP_SR_TIF8_SHIFT (10U) -/*! TIF8 - Tamper Input n Flag - * 0b0..On-chip tamper not detected - * 0b1..On-chip tamper detected - */ -#define DIGTMP_SR_TIF8(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TIF8_SHIFT)) & DIGTMP_SR_TIF8_MASK) - -#define DIGTMP_SR_TIF9_MASK (0x800U) -#define DIGTMP_SR_TIF9_SHIFT (11U) -/*! TIF9 - Tamper Input n Flag - * 0b0..On-chip tamper not detected - * 0b1..On-chip tamper detected - */ -#define DIGTMP_SR_TIF9(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TIF9_SHIFT)) & DIGTMP_SR_TIF9_MASK) - -#define DIGTMP_SR_TPF0_MASK (0x10000U) -#define DIGTMP_SR_TPF0_SHIFT (16U) -/*! TPF0 - Tamper Pin n Flag - * 0b0..Pin tamper not detected - * 0b1..Pin tamper detected - */ -#define DIGTMP_SR_TPF0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TPF0_SHIFT)) & DIGTMP_SR_TPF0_MASK) - -#define DIGTMP_SR_TPF1_MASK (0x20000U) -#define DIGTMP_SR_TPF1_SHIFT (17U) -/*! TPF1 - Tamper Pin n Flag - * 0b0..Pin tamper not detected - * 0b1..Pin tamper detected - */ -#define DIGTMP_SR_TPF1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TPF1_SHIFT)) & DIGTMP_SR_TPF1_MASK) - -#define DIGTMP_SR_TPF2_MASK (0x40000U) -#define DIGTMP_SR_TPF2_SHIFT (18U) -/*! TPF2 - Tamper Pin n Flag - * 0b0..Pin tamper not detected - * 0b1..Pin tamper detected - */ -#define DIGTMP_SR_TPF2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TPF2_SHIFT)) & DIGTMP_SR_TPF2_MASK) - -#define DIGTMP_SR_TPF3_MASK (0x80000U) -#define DIGTMP_SR_TPF3_SHIFT (19U) -/*! TPF3 - Tamper Pin n Flag - * 0b0..Pin tamper not detected - * 0b1..Pin tamper detected - */ -#define DIGTMP_SR_TPF3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TPF3_SHIFT)) & DIGTMP_SR_TPF3_MASK) - -#define DIGTMP_SR_TPF4_MASK (0x100000U) -#define DIGTMP_SR_TPF4_SHIFT (20U) -/*! TPF4 - Tamper Pin n Flag - * 0b0..Pin tamper not detected - * 0b1..Pin tamper detected - */ -#define DIGTMP_SR_TPF4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TPF4_SHIFT)) & DIGTMP_SR_TPF4_MASK) - -#define DIGTMP_SR_TPF5_MASK (0x200000U) -#define DIGTMP_SR_TPF5_SHIFT (21U) -/*! TPF5 - Tamper Pin n Flag - * 0b0..Pin tamper not detected - * 0b1..Pin tamper detected - */ -#define DIGTMP_SR_TPF5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TPF5_SHIFT)) & DIGTMP_SR_TPF5_MASK) - -#define DIGTMP_SR_TPF6_MASK (0x400000U) -#define DIGTMP_SR_TPF6_SHIFT (22U) -/*! TPF6 - Tamper Pin n Flag - * 0b0..Pin tamper not detected - * 0b1..Pin tamper detected - */ -#define DIGTMP_SR_TPF6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TPF6_SHIFT)) & DIGTMP_SR_TPF6_MASK) - -#define DIGTMP_SR_TPF7_MASK (0x800000U) -#define DIGTMP_SR_TPF7_SHIFT (23U) -/*! TPF7 - Tamper Pin n Flag - * 0b0..Pin tamper not detected - * 0b1..Pin tamper detected - */ -#define DIGTMP_SR_TPF7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TPF7_SHIFT)) & DIGTMP_SR_TPF7_MASK) -/*! @} */ - -/*! @name LR - Lock */ -/*! @{ */ - -#define DIGTMP_LR_CRL_MASK (0x10U) -#define DIGTMP_LR_CRL_SHIFT (4U) -/*! CRL - Control Register Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_CRL(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_CRL_SHIFT)) & DIGTMP_LR_CRL_MASK) - -#define DIGTMP_LR_SRL_MASK (0x20U) -#define DIGTMP_LR_SRL_SHIFT (5U) -/*! SRL - Status Register Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_SRL(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_SRL_SHIFT)) & DIGTMP_LR_SRL_MASK) - -#define DIGTMP_LR_LRL_MASK (0x40U) -#define DIGTMP_LR_LRL_SHIFT (6U) -/*! LRL - Lock Register Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_LRL(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_LRL_SHIFT)) & DIGTMP_LR_LRL_MASK) - -#define DIGTMP_LR_IEL_MASK (0x80U) -#define DIGTMP_LR_IEL_SHIFT (7U) -/*! IEL - Interrupt Enable Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_IEL(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_IEL_SHIFT)) & DIGTMP_LR_IEL_MASK) - -#define DIGTMP_LR_TSL_MASK (0x100U) -#define DIGTMP_LR_TSL_SHIFT (8U) -/*! TSL - Tamper Seconds Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_TSL(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_TSL_SHIFT)) & DIGTMP_LR_TSL_MASK) - -#define DIGTMP_LR_TEL_MASK (0x200U) -#define DIGTMP_LR_TEL_SHIFT (9U) -/*! TEL - Tamper Enable Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_TEL(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_TEL_SHIFT)) & DIGTMP_LR_TEL_MASK) - -#define DIGTMP_LR_PDL_MASK (0x400U) -#define DIGTMP_LR_PDL_SHIFT (10U) -/*! PDL - Pin Direction Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_PDL(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_PDL_SHIFT)) & DIGTMP_LR_PDL_MASK) - -#define DIGTMP_LR_PPL_MASK (0x800U) -#define DIGTMP_LR_PPL_SHIFT (11U) -/*! PPL - Pin Polarity Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_PPL(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_PPL_SHIFT)) & DIGTMP_LR_PPL_MASK) - -#define DIGTMP_LR_ATL0_MASK (0x1000U) -#define DIGTMP_LR_ATL0_SHIFT (12U) -/*! ATL0 - Active Tamper Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_ATL0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_ATL0_SHIFT)) & DIGTMP_LR_ATL0_MASK) - -#define DIGTMP_LR_ATL1_MASK (0x2000U) -#define DIGTMP_LR_ATL1_SHIFT (13U) -/*! ATL1 - Active Tamper Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_ATL1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_ATL1_SHIFT)) & DIGTMP_LR_ATL1_MASK) - -#define DIGTMP_LR_GFL0_MASK (0x10000U) -#define DIGTMP_LR_GFL0_SHIFT (16U) -/*! GFL0 - Glitch Filter Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_GFL0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_GFL0_SHIFT)) & DIGTMP_LR_GFL0_MASK) - -#define DIGTMP_LR_GFL1_MASK (0x20000U) -#define DIGTMP_LR_GFL1_SHIFT (17U) -/*! GFL1 - Glitch Filter Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_GFL1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_GFL1_SHIFT)) & DIGTMP_LR_GFL1_MASK) - -#define DIGTMP_LR_GFL2_MASK (0x40000U) -#define DIGTMP_LR_GFL2_SHIFT (18U) -/*! GFL2 - Glitch Filter Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_GFL2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_GFL2_SHIFT)) & DIGTMP_LR_GFL2_MASK) - -#define DIGTMP_LR_GFL3_MASK (0x80000U) -#define DIGTMP_LR_GFL3_SHIFT (19U) -/*! GFL3 - Glitch Filter Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_GFL3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_GFL3_SHIFT)) & DIGTMP_LR_GFL3_MASK) - -#define DIGTMP_LR_GFL4_MASK (0x100000U) -#define DIGTMP_LR_GFL4_SHIFT (20U) -/*! GFL4 - Glitch Filter Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_GFL4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_GFL4_SHIFT)) & DIGTMP_LR_GFL4_MASK) - -#define DIGTMP_LR_GFL5_MASK (0x200000U) -#define DIGTMP_LR_GFL5_SHIFT (21U) -/*! GFL5 - Glitch Filter Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_GFL5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_GFL5_SHIFT)) & DIGTMP_LR_GFL5_MASK) - -#define DIGTMP_LR_GFL6_MASK (0x400000U) -#define DIGTMP_LR_GFL6_SHIFT (22U) -/*! GFL6 - Glitch Filter Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_GFL6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_GFL6_SHIFT)) & DIGTMP_LR_GFL6_MASK) - -#define DIGTMP_LR_GFL7_MASK (0x800000U) -#define DIGTMP_LR_GFL7_SHIFT (23U) -/*! GFL7 - Glitch Filter Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_GFL7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_GFL7_SHIFT)) & DIGTMP_LR_GFL7_MASK) -/*! @} */ - -/*! @name IER - Interrupt Enable */ -/*! @{ */ - -#define DIGTMP_IER_DTIE_MASK (0x1U) -#define DIGTMP_IER_DTIE_SHIFT (0U) -/*! DTIE - Digital Tamper Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_DTIE(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_DTIE_SHIFT)) & DIGTMP_IER_DTIE_MASK) - -#define DIGTMP_IER_TIIE0_MASK (0x4U) -#define DIGTMP_IER_TIIE0_SHIFT (2U) -/*! TIIE0 - Tamper Input n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TIIE0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TIIE0_SHIFT)) & DIGTMP_IER_TIIE0_MASK) - -#define DIGTMP_IER_TIIE1_MASK (0x8U) -#define DIGTMP_IER_TIIE1_SHIFT (3U) -/*! TIIE1 - Tamper Input n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TIIE1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TIIE1_SHIFT)) & DIGTMP_IER_TIIE1_MASK) - -#define DIGTMP_IER_TIIE2_MASK (0x10U) -#define DIGTMP_IER_TIIE2_SHIFT (4U) -/*! TIIE2 - Tamper Input n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TIIE2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TIIE2_SHIFT)) & DIGTMP_IER_TIIE2_MASK) - -#define DIGTMP_IER_TIIE3_MASK (0x20U) -#define DIGTMP_IER_TIIE3_SHIFT (5U) -/*! TIIE3 - Tamper Input n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TIIE3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TIIE3_SHIFT)) & DIGTMP_IER_TIIE3_MASK) - -#define DIGTMP_IER_TIIE4_MASK (0x40U) -#define DIGTMP_IER_TIIE4_SHIFT (6U) -/*! TIIE4 - Tamper Input n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TIIE4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TIIE4_SHIFT)) & DIGTMP_IER_TIIE4_MASK) - -#define DIGTMP_IER_TIIE5_MASK (0x80U) -#define DIGTMP_IER_TIIE5_SHIFT (7U) -/*! TIIE5 - Tamper Input n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TIIE5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TIIE5_SHIFT)) & DIGTMP_IER_TIIE5_MASK) - -#define DIGTMP_IER_TIIE6_MASK (0x100U) -#define DIGTMP_IER_TIIE6_SHIFT (8U) -/*! TIIE6 - Tamper Input n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TIIE6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TIIE6_SHIFT)) & DIGTMP_IER_TIIE6_MASK) - -#define DIGTMP_IER_TIIE7_MASK (0x200U) -#define DIGTMP_IER_TIIE7_SHIFT (9U) -/*! TIIE7 - Tamper Input n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TIIE7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TIIE7_SHIFT)) & DIGTMP_IER_TIIE7_MASK) - -#define DIGTMP_IER_TIIE8_MASK (0x400U) -#define DIGTMP_IER_TIIE8_SHIFT (10U) -/*! TIIE8 - Tamper Input n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TIIE8(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TIIE8_SHIFT)) & DIGTMP_IER_TIIE8_MASK) - -#define DIGTMP_IER_TIIE9_MASK (0x800U) -#define DIGTMP_IER_TIIE9_SHIFT (11U) -/*! TIIE9 - Tamper Input n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TIIE9(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TIIE9_SHIFT)) & DIGTMP_IER_TIIE9_MASK) - -#define DIGTMP_IER_TPIE0_MASK (0x10000U) -#define DIGTMP_IER_TPIE0_SHIFT (16U) -/*! TPIE0 - Tamper Pin n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TPIE0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TPIE0_SHIFT)) & DIGTMP_IER_TPIE0_MASK) - -#define DIGTMP_IER_TPIE1_MASK (0x20000U) -#define DIGTMP_IER_TPIE1_SHIFT (17U) -/*! TPIE1 - Tamper Pin n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TPIE1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TPIE1_SHIFT)) & DIGTMP_IER_TPIE1_MASK) - -#define DIGTMP_IER_TPIE2_MASK (0x40000U) -#define DIGTMP_IER_TPIE2_SHIFT (18U) -/*! TPIE2 - Tamper Pin n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TPIE2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TPIE2_SHIFT)) & DIGTMP_IER_TPIE2_MASK) - -#define DIGTMP_IER_TPIE3_MASK (0x80000U) -#define DIGTMP_IER_TPIE3_SHIFT (19U) -/*! TPIE3 - Tamper Pin n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TPIE3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TPIE3_SHIFT)) & DIGTMP_IER_TPIE3_MASK) - -#define DIGTMP_IER_TPIE4_MASK (0x100000U) -#define DIGTMP_IER_TPIE4_SHIFT (20U) -/*! TPIE4 - Tamper Pin n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TPIE4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TPIE4_SHIFT)) & DIGTMP_IER_TPIE4_MASK) - -#define DIGTMP_IER_TPIE5_MASK (0x200000U) -#define DIGTMP_IER_TPIE5_SHIFT (21U) -/*! TPIE5 - Tamper Pin n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TPIE5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TPIE5_SHIFT)) & DIGTMP_IER_TPIE5_MASK) - -#define DIGTMP_IER_TPIE6_MASK (0x400000U) -#define DIGTMP_IER_TPIE6_SHIFT (22U) -/*! TPIE6 - Tamper Pin n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TPIE6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TPIE6_SHIFT)) & DIGTMP_IER_TPIE6_MASK) - -#define DIGTMP_IER_TPIE7_MASK (0x800000U) -#define DIGTMP_IER_TPIE7_SHIFT (23U) -/*! TPIE7 - Tamper Pin n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TPIE7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TPIE7_SHIFT)) & DIGTMP_IER_TPIE7_MASK) -/*! @} */ - -/*! @name TSR - Tamper Seconds */ -/*! @{ */ - -#define DIGTMP_TSR_TTS_MASK (0xFFFFFFFFU) -#define DIGTMP_TSR_TTS_SHIFT (0U) -/*! TTS - Tamper Time Seconds */ -#define DIGTMP_TSR_TTS(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TSR_TTS_SHIFT)) & DIGTMP_TSR_TTS_MASK) -/*! @} */ - -/*! @name TER - Tamper Enable */ -/*! @{ */ - -#define DIGTMP_TER_TIE0_MASK (0x4U) -#define DIGTMP_TER_TIE0_SHIFT (2U) -/*! TIE0 - Tamper Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TIE0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TIE0_SHIFT)) & DIGTMP_TER_TIE0_MASK) - -#define DIGTMP_TER_TIE1_MASK (0x8U) -#define DIGTMP_TER_TIE1_SHIFT (3U) -/*! TIE1 - Tamper Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TIE1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TIE1_SHIFT)) & DIGTMP_TER_TIE1_MASK) - -#define DIGTMP_TER_TIE2_MASK (0x10U) -#define DIGTMP_TER_TIE2_SHIFT (4U) -/*! TIE2 - Tamper Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TIE2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TIE2_SHIFT)) & DIGTMP_TER_TIE2_MASK) - -#define DIGTMP_TER_TIE3_MASK (0x20U) -#define DIGTMP_TER_TIE3_SHIFT (5U) -/*! TIE3 - Tamper Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TIE3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TIE3_SHIFT)) & DIGTMP_TER_TIE3_MASK) - -#define DIGTMP_TER_TIE4_MASK (0x40U) -#define DIGTMP_TER_TIE4_SHIFT (6U) -/*! TIE4 - Tamper Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TIE4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TIE4_SHIFT)) & DIGTMP_TER_TIE4_MASK) - -#define DIGTMP_TER_TIE5_MASK (0x80U) -#define DIGTMP_TER_TIE5_SHIFT (7U) -/*! TIE5 - Tamper Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TIE5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TIE5_SHIFT)) & DIGTMP_TER_TIE5_MASK) - -#define DIGTMP_TER_TIE6_MASK (0x100U) -#define DIGTMP_TER_TIE6_SHIFT (8U) -/*! TIE6 - Tamper Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TIE6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TIE6_SHIFT)) & DIGTMP_TER_TIE6_MASK) - -#define DIGTMP_TER_TIE7_MASK (0x200U) -#define DIGTMP_TER_TIE7_SHIFT (9U) -/*! TIE7 - Tamper Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TIE7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TIE7_SHIFT)) & DIGTMP_TER_TIE7_MASK) - -#define DIGTMP_TER_TIE8_MASK (0x400U) -#define DIGTMP_TER_TIE8_SHIFT (10U) -/*! TIE8 - Tamper Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TIE8(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TIE8_SHIFT)) & DIGTMP_TER_TIE8_MASK) - -#define DIGTMP_TER_TIE9_MASK (0x800U) -#define DIGTMP_TER_TIE9_SHIFT (11U) -/*! TIE9 - Tamper Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TIE9(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TIE9_SHIFT)) & DIGTMP_TER_TIE9_MASK) - -#define DIGTMP_TER_TPE0_MASK (0x10000U) -#define DIGTMP_TER_TPE0_SHIFT (16U) -/*! TPE0 - Tamper Pin Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TPE0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TPE0_SHIFT)) & DIGTMP_TER_TPE0_MASK) - -#define DIGTMP_TER_TPE1_MASK (0x20000U) -#define DIGTMP_TER_TPE1_SHIFT (17U) -/*! TPE1 - Tamper Pin Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TPE1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TPE1_SHIFT)) & DIGTMP_TER_TPE1_MASK) - -#define DIGTMP_TER_TPE2_MASK (0x40000U) -#define DIGTMP_TER_TPE2_SHIFT (18U) -/*! TPE2 - Tamper Pin Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TPE2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TPE2_SHIFT)) & DIGTMP_TER_TPE2_MASK) - -#define DIGTMP_TER_TPE3_MASK (0x80000U) -#define DIGTMP_TER_TPE3_SHIFT (19U) -/*! TPE3 - Tamper Pin Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TPE3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TPE3_SHIFT)) & DIGTMP_TER_TPE3_MASK) - -#define DIGTMP_TER_TPE4_MASK (0x100000U) -#define DIGTMP_TER_TPE4_SHIFT (20U) -/*! TPE4 - Tamper Pin Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TPE4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TPE4_SHIFT)) & DIGTMP_TER_TPE4_MASK) - -#define DIGTMP_TER_TPE5_MASK (0x200000U) -#define DIGTMP_TER_TPE5_SHIFT (21U) -/*! TPE5 - Tamper Pin Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TPE5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TPE5_SHIFT)) & DIGTMP_TER_TPE5_MASK) - -#define DIGTMP_TER_TPE6_MASK (0x400000U) -#define DIGTMP_TER_TPE6_SHIFT (22U) -/*! TPE6 - Tamper Pin Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TPE6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TPE6_SHIFT)) & DIGTMP_TER_TPE6_MASK) - -#define DIGTMP_TER_TPE7_MASK (0x800000U) -#define DIGTMP_TER_TPE7_SHIFT (23U) -/*! TPE7 - Tamper Pin Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TPE7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TPE7_SHIFT)) & DIGTMP_TER_TPE7_MASK) -/*! @} */ - -/*! @name PDR - Pin Direction */ -/*! @{ */ - -#define DIGTMP_PDR_TPD0_MASK (0x1U) -#define DIGTMP_PDR_TPD0_SHIFT (0U) -/*! TPD0 - Tamper Pin Direction - * 0b0..Input - * 0b1..Output and drives the inverse of the expected value (tamper pin is asserted) - */ -#define DIGTMP_PDR_TPD0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPD0_SHIFT)) & DIGTMP_PDR_TPD0_MASK) - -#define DIGTMP_PDR_TPD1_MASK (0x2U) -#define DIGTMP_PDR_TPD1_SHIFT (1U) -/*! TPD1 - Tamper Pin Direction - * 0b0..Input - * 0b1..Output and drives the inverse of the expected value (tamper pin is asserted) - */ -#define DIGTMP_PDR_TPD1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPD1_SHIFT)) & DIGTMP_PDR_TPD1_MASK) - -#define DIGTMP_PDR_TPD2_MASK (0x4U) -#define DIGTMP_PDR_TPD2_SHIFT (2U) -/*! TPD2 - Tamper Pin Direction - * 0b0..Input - * 0b1..Output and drives the inverse of the expected value (tamper pin is asserted) - */ -#define DIGTMP_PDR_TPD2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPD2_SHIFT)) & DIGTMP_PDR_TPD2_MASK) - -#define DIGTMP_PDR_TPD3_MASK (0x8U) -#define DIGTMP_PDR_TPD3_SHIFT (3U) -/*! TPD3 - Tamper Pin Direction - * 0b0..Input - * 0b1..Output and drives the inverse of the expected value (tamper pin is asserted) - */ -#define DIGTMP_PDR_TPD3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPD3_SHIFT)) & DIGTMP_PDR_TPD3_MASK) - -#define DIGTMP_PDR_TPD4_MASK (0x10U) -#define DIGTMP_PDR_TPD4_SHIFT (4U) -/*! TPD4 - Tamper Pin Direction - * 0b0..Input - * 0b1..Output and drives the inverse of the expected value (tamper pin is asserted) - */ -#define DIGTMP_PDR_TPD4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPD4_SHIFT)) & DIGTMP_PDR_TPD4_MASK) - -#define DIGTMP_PDR_TPD5_MASK (0x20U) -#define DIGTMP_PDR_TPD5_SHIFT (5U) -/*! TPD5 - Tamper Pin Direction - * 0b0..Input - * 0b1..Output and drives the inverse of the expected value (tamper pin is asserted) - */ -#define DIGTMP_PDR_TPD5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPD5_SHIFT)) & DIGTMP_PDR_TPD5_MASK) - -#define DIGTMP_PDR_TPD6_MASK (0x40U) -#define DIGTMP_PDR_TPD6_SHIFT (6U) -/*! TPD6 - Tamper Pin Direction - * 0b0..Input - * 0b1..Output and drives the inverse of the expected value (tamper pin is asserted) - */ -#define DIGTMP_PDR_TPD6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPD6_SHIFT)) & DIGTMP_PDR_TPD6_MASK) - -#define DIGTMP_PDR_TPD7_MASK (0x80U) -#define DIGTMP_PDR_TPD7_SHIFT (7U) -/*! TPD7 - Tamper Pin Direction - * 0b0..Input - * 0b1..Output and drives the inverse of the expected value (tamper pin is asserted) - */ -#define DIGTMP_PDR_TPD7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPD7_SHIFT)) & DIGTMP_PDR_TPD7_MASK) - -#define DIGTMP_PDR_TPOD0_MASK (0x10000U) -#define DIGTMP_PDR_TPOD0_SHIFT (16U) -/*! TPOD0 - Tamper Pin Output Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PDR_TPOD0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPOD0_SHIFT)) & DIGTMP_PDR_TPOD0_MASK) - -#define DIGTMP_PDR_TPOD1_MASK (0x20000U) -#define DIGTMP_PDR_TPOD1_SHIFT (17U) -/*! TPOD1 - Tamper Pin Output Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PDR_TPOD1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPOD1_SHIFT)) & DIGTMP_PDR_TPOD1_MASK) - -#define DIGTMP_PDR_TPOD2_MASK (0x40000U) -#define DIGTMP_PDR_TPOD2_SHIFT (18U) -/*! TPOD2 - Tamper Pin Output Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PDR_TPOD2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPOD2_SHIFT)) & DIGTMP_PDR_TPOD2_MASK) - -#define DIGTMP_PDR_TPOD3_MASK (0x80000U) -#define DIGTMP_PDR_TPOD3_SHIFT (19U) -/*! TPOD3 - Tamper Pin Output Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PDR_TPOD3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPOD3_SHIFT)) & DIGTMP_PDR_TPOD3_MASK) - -#define DIGTMP_PDR_TPOD4_MASK (0x100000U) -#define DIGTMP_PDR_TPOD4_SHIFT (20U) -/*! TPOD4 - Tamper Pin Output Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PDR_TPOD4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPOD4_SHIFT)) & DIGTMP_PDR_TPOD4_MASK) - -#define DIGTMP_PDR_TPOD5_MASK (0x200000U) -#define DIGTMP_PDR_TPOD5_SHIFT (21U) -/*! TPOD5 - Tamper Pin Output Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PDR_TPOD5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPOD5_SHIFT)) & DIGTMP_PDR_TPOD5_MASK) - -#define DIGTMP_PDR_TPOD6_MASK (0x400000U) -#define DIGTMP_PDR_TPOD6_SHIFT (22U) -/*! TPOD6 - Tamper Pin Output Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PDR_TPOD6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPOD6_SHIFT)) & DIGTMP_PDR_TPOD6_MASK) - -#define DIGTMP_PDR_TPOD7_MASK (0x800000U) -#define DIGTMP_PDR_TPOD7_SHIFT (23U) -/*! TPOD7 - Tamper Pin Output Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PDR_TPOD7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPOD7_SHIFT)) & DIGTMP_PDR_TPOD7_MASK) -/*! @} */ - -/*! @name PPR - Pin Polarity */ -/*! @{ */ - -#define DIGTMP_PPR_TPP0_MASK (0x1U) -#define DIGTMP_PPR_TPP0_SHIFT (0U) -/*! TPP0 - Tamper Pin n Polarity - * 0b0..Not inverted - * 0b1..Inverted - */ -#define DIGTMP_PPR_TPP0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPP0_SHIFT)) & DIGTMP_PPR_TPP0_MASK) - -#define DIGTMP_PPR_TPP1_MASK (0x2U) -#define DIGTMP_PPR_TPP1_SHIFT (1U) -/*! TPP1 - Tamper Pin n Polarity - * 0b0..Not inverted - * 0b1..Inverted - */ -#define DIGTMP_PPR_TPP1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPP1_SHIFT)) & DIGTMP_PPR_TPP1_MASK) - -#define DIGTMP_PPR_TPP2_MASK (0x4U) -#define DIGTMP_PPR_TPP2_SHIFT (2U) -/*! TPP2 - Tamper Pin n Polarity - * 0b0..Not inverted - * 0b1..Inverted - */ -#define DIGTMP_PPR_TPP2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPP2_SHIFT)) & DIGTMP_PPR_TPP2_MASK) - -#define DIGTMP_PPR_TPP3_MASK (0x8U) -#define DIGTMP_PPR_TPP3_SHIFT (3U) -/*! TPP3 - Tamper Pin n Polarity - * 0b0..Not inverted - * 0b1..Inverted - */ -#define DIGTMP_PPR_TPP3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPP3_SHIFT)) & DIGTMP_PPR_TPP3_MASK) - -#define DIGTMP_PPR_TPP4_MASK (0x10U) -#define DIGTMP_PPR_TPP4_SHIFT (4U) -/*! TPP4 - Tamper Pin n Polarity - * 0b0..Not inverted - * 0b1..Inverted - */ -#define DIGTMP_PPR_TPP4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPP4_SHIFT)) & DIGTMP_PPR_TPP4_MASK) - -#define DIGTMP_PPR_TPP5_MASK (0x20U) -#define DIGTMP_PPR_TPP5_SHIFT (5U) -/*! TPP5 - Tamper Pin n Polarity - * 0b0..Not inverted - * 0b1..Inverted - */ -#define DIGTMP_PPR_TPP5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPP5_SHIFT)) & DIGTMP_PPR_TPP5_MASK) - -#define DIGTMP_PPR_TPP6_MASK (0x40U) -#define DIGTMP_PPR_TPP6_SHIFT (6U) -/*! TPP6 - Tamper Pin n Polarity - * 0b0..Not inverted - * 0b1..Inverted - */ -#define DIGTMP_PPR_TPP6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPP6_SHIFT)) & DIGTMP_PPR_TPP6_MASK) - -#define DIGTMP_PPR_TPP7_MASK (0x80U) -#define DIGTMP_PPR_TPP7_SHIFT (7U) -/*! TPP7 - Tamper Pin n Polarity - * 0b0..Not inverted - * 0b1..Inverted - */ -#define DIGTMP_PPR_TPP7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPP7_SHIFT)) & DIGTMP_PPR_TPP7_MASK) - -#define DIGTMP_PPR_TPID0_MASK (0x10000U) -#define DIGTMP_PPR_TPID0_SHIFT (16U) -/*! TPID0 - Tamper Pin n Input Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PPR_TPID0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPID0_SHIFT)) & DIGTMP_PPR_TPID0_MASK) - -#define DIGTMP_PPR_TPID1_MASK (0x20000U) -#define DIGTMP_PPR_TPID1_SHIFT (17U) -/*! TPID1 - Tamper Pin n Input Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PPR_TPID1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPID1_SHIFT)) & DIGTMP_PPR_TPID1_MASK) - -#define DIGTMP_PPR_TPID2_MASK (0x40000U) -#define DIGTMP_PPR_TPID2_SHIFT (18U) -/*! TPID2 - Tamper Pin n Input Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PPR_TPID2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPID2_SHIFT)) & DIGTMP_PPR_TPID2_MASK) - -#define DIGTMP_PPR_TPID3_MASK (0x80000U) -#define DIGTMP_PPR_TPID3_SHIFT (19U) -/*! TPID3 - Tamper Pin n Input Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PPR_TPID3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPID3_SHIFT)) & DIGTMP_PPR_TPID3_MASK) - -#define DIGTMP_PPR_TPID4_MASK (0x100000U) -#define DIGTMP_PPR_TPID4_SHIFT (20U) -/*! TPID4 - Tamper Pin n Input Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PPR_TPID4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPID4_SHIFT)) & DIGTMP_PPR_TPID4_MASK) - -#define DIGTMP_PPR_TPID5_MASK (0x200000U) -#define DIGTMP_PPR_TPID5_SHIFT (21U) -/*! TPID5 - Tamper Pin n Input Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PPR_TPID5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPID5_SHIFT)) & DIGTMP_PPR_TPID5_MASK) - -#define DIGTMP_PPR_TPID6_MASK (0x400000U) -#define DIGTMP_PPR_TPID6_SHIFT (22U) -/*! TPID6 - Tamper Pin n Input Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PPR_TPID6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPID6_SHIFT)) & DIGTMP_PPR_TPID6_MASK) - -#define DIGTMP_PPR_TPID7_MASK (0x800000U) -#define DIGTMP_PPR_TPID7_SHIFT (23U) -/*! TPID7 - Tamper Pin n Input Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PPR_TPID7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPID7_SHIFT)) & DIGTMP_PPR_TPID7_MASK) -/*! @} */ - -/*! @name ATR - Active Tamper */ -/*! @{ */ - -#define DIGTMP_ATR_ATSR_MASK (0xFFFFU) -#define DIGTMP_ATR_ATSR_SHIFT (0U) -/*! ATSR - Active Tamper Shift Register */ -#define DIGTMP_ATR_ATSR(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_ATR_ATSR_SHIFT)) & DIGTMP_ATR_ATSR_MASK) - -#define DIGTMP_ATR_ATP_MASK (0xFFFF0000U) -#define DIGTMP_ATR_ATP_SHIFT (16U) -/*! ATP - Active Tamper Polynomial */ -#define DIGTMP_ATR_ATP(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_ATR_ATP_SHIFT)) & DIGTMP_ATR_ATP_MASK) -/*! @} */ - -/* The count of DIGTMP_ATR */ -#define DIGTMP_ATR_COUNT (2U) - -/*! @name PGFR - Pin Glitch Filter */ -/*! @{ */ - -#define DIGTMP_PGFR_GFW_MASK (0x3FU) -#define DIGTMP_PGFR_GFW_SHIFT (0U) -/*! GFW - Glitch Filter Width */ -#define DIGTMP_PGFR_GFW(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PGFR_GFW_SHIFT)) & DIGTMP_PGFR_GFW_MASK) - -#define DIGTMP_PGFR_GFP_MASK (0x40U) -#define DIGTMP_PGFR_GFP_SHIFT (6U) -/*! GFP - Glitch Filter Prescaler - * 0b0..512 Hz prescaler clock - * 0b1..32.768 kHz clock - */ -#define DIGTMP_PGFR_GFP(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PGFR_GFP_SHIFT)) & DIGTMP_PGFR_GFP_MASK) - -#define DIGTMP_PGFR_GFE_MASK (0x80U) -#define DIGTMP_PGFR_GFE_SHIFT (7U) -/*! GFE - Glitch Filter Enable - * 0b0..Bypasses - * 0b1..Enables - */ -#define DIGTMP_PGFR_GFE(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PGFR_GFE_SHIFT)) & DIGTMP_PGFR_GFE_MASK) - -#define DIGTMP_PGFR_TPSW_MASK (0x300U) -#define DIGTMP_PGFR_TPSW_SHIFT (8U) -/*! TPSW - Tamper Pin Sample Width - * 0b00..Continuous monitoring, pin sampling disabled - * 0b01..2 cycles for pull enable and 1 cycle for input buffer enable - * 0b10..4 cycles for pull enable and 2 cycles for input buffer enable - * 0b11..8 cycles for pull enable and 4 cycles for input buffer enable - */ -#define DIGTMP_PGFR_TPSW(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PGFR_TPSW_SHIFT)) & DIGTMP_PGFR_TPSW_MASK) - -#define DIGTMP_PGFR_TPSF_MASK (0xC00U) -#define DIGTMP_PGFR_TPSF_SHIFT (10U) -/*! TPSF - Tamper Pin Sample Frequency - * 0b00..Every 8 cycles - * 0b01..Every 32 cycles - * 0b10..Every 128 cycles - * 0b11..Every 512 cycles - */ -#define DIGTMP_PGFR_TPSF(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PGFR_TPSF_SHIFT)) & DIGTMP_PGFR_TPSF_MASK) - -#define DIGTMP_PGFR_TPEX_MASK (0x30000U) -#define DIGTMP_PGFR_TPEX_SHIFT (16U) -/*! TPEX - Tamper Pin Expected - * 0b00..Zero/passive tamper - * 0b01..Active Tamper 0 output - * 0b10..Active Tamper 1 output - * 0b11..Active Tamper 0 output XORed with Active Tamper 1 output - */ -#define DIGTMP_PGFR_TPEX(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PGFR_TPEX_SHIFT)) & DIGTMP_PGFR_TPEX_MASK) - -#define DIGTMP_PGFR_TPE_MASK (0x1000000U) -#define DIGTMP_PGFR_TPE_SHIFT (24U) -/*! TPE - Tamper Pull Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_PGFR_TPE(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PGFR_TPE_SHIFT)) & DIGTMP_PGFR_TPE_MASK) - -#define DIGTMP_PGFR_TPS_MASK (0x2000000U) -#define DIGTMP_PGFR_TPS_SHIFT (25U) -/*! TPS - Tamper Pull Select - * 0b0..Asserts - * 0b1..Negates - */ -#define DIGTMP_PGFR_TPS(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PGFR_TPS_SHIFT)) & DIGTMP_PGFR_TPS_MASK) -/*! @} */ - -/* The count of DIGTMP_PGFR */ -#define DIGTMP_PGFR_COUNT (8U) - - -/*! - * @} - */ /* end of group DIGTMP_Register_Masks */ - - -/* DIGTMP - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral TDET0 base address */ - #define TDET0_BASE (0x50058000u) - /** Peripheral TDET0 base address */ - #define TDET0_BASE_NS (0x40058000u) - /** Peripheral TDET0 base pointer */ - #define TDET0 ((DIGTMP_Type *)TDET0_BASE) - /** Peripheral TDET0 base pointer */ - #define TDET0_NS ((DIGTMP_Type *)TDET0_BASE_NS) - /** Array initializer of DIGTMP peripheral base addresses */ - #define DIGTMP_BASE_ADDRS { TDET0_BASE } - /** Array initializer of DIGTMP peripheral base pointers */ - #define DIGTMP_BASE_PTRS { TDET0 } - /** Array initializer of DIGTMP peripheral base addresses */ - #define DIGTMP_BASE_ADDRS_NS { TDET0_BASE_NS } - /** Array initializer of DIGTMP peripheral base pointers */ - #define DIGTMP_BASE_PTRS_NS { TDET0_NS } -#else - /** Peripheral TDET0 base address */ - #define TDET0_BASE (0x40058000u) - /** Peripheral TDET0 base pointer */ - #define TDET0 ((DIGTMP_Type *)TDET0_BASE) - /** Array initializer of DIGTMP peripheral base addresses */ - #define DIGTMP_BASE_ADDRS { TDET0_BASE } - /** Array initializer of DIGTMP peripheral base pointers */ - #define DIGTMP_BASE_PTRS { TDET0 } -#endif - -/*! - * @} - */ /* end of group DIGTMP_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- DM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DM_Peripheral_Access_Layer DM Peripheral Access Layer - * @{ - */ - -/** DM - Register Layout Typedef */ -typedef struct { - __IO uint32_t CSW; /**< Command and Status Word, offset: 0x0 */ - __IO uint32_t REQUEST; /**< Request Value, offset: 0x4 */ - __IO uint32_t RETURN; /**< Return Value, offset: 0x8 */ - uint8_t RESERVED_0[240]; - __I uint32_t ID; /**< Identification, offset: 0xFC */ -} DM_Type; - -/* ---------------------------------------------------------------------------- - -- DM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DM_Register_Masks DM Register Masks - * @{ - */ - -/*! @name CSW - Command and Status Word */ -/*! @{ */ - -#define DM_CSW_RESYNCH_REQ_MASK (0x1U) -#define DM_CSW_RESYNCH_REQ_SHIFT (0U) -/*! RESYNCH_REQ - Resynchronization Request - * 0b0..No request - * 0b1..Request for resynchronization - */ -#define DM_CSW_RESYNCH_REQ(x) (((uint32_t)(((uint32_t)(x)) << DM_CSW_RESYNCH_REQ_SHIFT)) & DM_CSW_RESYNCH_REQ_MASK) - -#define DM_CSW_REQ_PENDING_MASK (0x2U) -#define DM_CSW_REQ_PENDING_SHIFT (1U) -/*! REQ_PENDING - Request Pending - * 0b0..No request pending - * 0b1..Request for resynchronization pending - */ -#define DM_CSW_REQ_PENDING(x) (((uint32_t)(((uint32_t)(x)) << DM_CSW_REQ_PENDING_SHIFT)) & DM_CSW_REQ_PENDING_MASK) - -#define DM_CSW_DBG_OR_ERR_MASK (0x4U) -#define DM_CSW_DBG_OR_ERR_SHIFT (2U) -/*! DBG_OR_ERR - DBGMB Overrun Error - * 0b0..No DBGMB Overrun error - * 0b1..DBGMB overrun error. A DBGMB overrun occurred. - */ -#define DM_CSW_DBG_OR_ERR(x) (((uint32_t)(((uint32_t)(x)) << DM_CSW_DBG_OR_ERR_SHIFT)) & DM_CSW_DBG_OR_ERR_MASK) - -#define DM_CSW_AHB_OR_ERR_MASK (0x8U) -#define DM_CSW_AHB_OR_ERR_SHIFT (3U) -/*! AHB_OR_ERR - AHB Overrun Error - * 0b0..No AHB Overrun Error - * 0b1..AHB Overrun Error. An AHB overrun occurred. - */ -#define DM_CSW_AHB_OR_ERR(x) (((uint32_t)(((uint32_t)(x)) << DM_CSW_AHB_OR_ERR_SHIFT)) & DM_CSW_AHB_OR_ERR_MASK) - -#define DM_CSW_SOFT_RESET_MASK (0x10U) -#define DM_CSW_SOFT_RESET_SHIFT (4U) -/*! SOFT_RESET - Soft Reset */ -#define DM_CSW_SOFT_RESET(x) (((uint32_t)(((uint32_t)(x)) << DM_CSW_SOFT_RESET_SHIFT)) & DM_CSW_SOFT_RESET_MASK) - -#define DM_CSW_CHIP_RESET_REQ_MASK (0x20U) -#define DM_CSW_CHIP_RESET_REQ_SHIFT (5U) -/*! CHIP_RESET_REQ - Chip Reset Request */ -#define DM_CSW_CHIP_RESET_REQ(x) (((uint32_t)(((uint32_t)(x)) << DM_CSW_CHIP_RESET_REQ_SHIFT)) & DM_CSW_CHIP_RESET_REQ_MASK) -/*! @} */ - -/*! @name REQUEST - Request Value */ -/*! @{ */ - -#define DM_REQUEST_REQUEST_MASK (0xFFFFFFFFU) -#define DM_REQUEST_REQUEST_SHIFT (0U) -/*! REQUEST - Request Value */ -#define DM_REQUEST_REQUEST(x) (((uint32_t)(((uint32_t)(x)) << DM_REQUEST_REQUEST_SHIFT)) & DM_REQUEST_REQUEST_MASK) -/*! @} */ - -/*! @name RETURN - Return Value */ -/*! @{ */ - -#define DM_RETURN_RET_MASK (0xFFFFFFFFU) -#define DM_RETURN_RET_SHIFT (0U) -/*! RET - Return Value */ -#define DM_RETURN_RET(x) (((uint32_t)(((uint32_t)(x)) << DM_RETURN_RET_SHIFT)) & DM_RETURN_RET_MASK) -/*! @} */ - -/*! @name ID - Identification */ -/*! @{ */ - -#define DM_ID_ID_MASK (0xFFFFFFFFU) -#define DM_ID_ID_SHIFT (0U) -/*! ID - Identification Value */ -#define DM_ID_ID(x) (((uint32_t)(((uint32_t)(x)) << DM_ID_ID_SHIFT)) & DM_ID_ID_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group DM_Register_Masks */ - - -/* DM - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral DM0 base address */ - #define DM0_BASE (0x500BD000u) - /** Peripheral DM0 base address */ - #define DM0_BASE_NS (0x400BD000u) - /** Peripheral DM0 base pointer */ - #define DM0 ((DM_Type *)DM0_BASE) - /** Peripheral DM0 base pointer */ - #define DM0_NS ((DM_Type *)DM0_BASE_NS) - /** Array initializer of DM peripheral base addresses */ - #define DM_BASE_ADDRS { DM0_BASE } - /** Array initializer of DM peripheral base pointers */ - #define DM_BASE_PTRS { DM0 } - /** Array initializer of DM peripheral base addresses */ - #define DM_BASE_ADDRS_NS { DM0_BASE_NS } - /** Array initializer of DM peripheral base pointers */ - #define DM_BASE_PTRS_NS { DM0_NS } -#else - /** Peripheral DM0 base address */ - #define DM0_BASE (0x400BD000u) - /** Peripheral DM0 base pointer */ - #define DM0 ((DM_Type *)DM0_BASE) - /** Array initializer of DM peripheral base addresses */ - #define DM_BASE_ADDRS { DM0_BASE } - /** Array initializer of DM peripheral base pointers */ - #define DM_BASE_PTRS { DM0 } -#endif - -/*! - * @} - */ /* end of group DM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- DMA Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DMA_Peripheral_Access_Layer DMA Peripheral Access Layer - * @{ - */ - -/** DMA - Register Layout Typedef */ -typedef struct { - __IO uint32_t MP_CSR; /**< Management Page Control, offset: 0x0 */ - __I uint32_t MP_ES; /**< Management Page Error Status, offset: 0x4 */ - __I uint32_t MP_INT; /**< Management Page Interrupt Request Status, offset: 0x8 */ - __I uint32_t MP_HRS; /**< Management Page Hardware Request Status, offset: 0xC */ - uint8_t RESERVED_0[240]; - __IO uint32_t CH_GRPRI[16]; /**< Channel Arbitration Group, array offset: 0x100, array step: 0x4 */ - uint8_t RESERVED_1[3776]; - struct { /* offset: 0x1000, array step: 0x1000 */ - __IO uint32_t CH_CSR; /**< Channel Control and Status, array offset: 0x1000, array step: 0x1000 */ - __IO uint32_t CH_ES; /**< Channel Error Status, array offset: 0x1004, array step: 0x1000 */ - __IO uint32_t CH_INT; /**< Channel Interrupt Status, array offset: 0x1008, array step: 0x1000 */ - __IO uint32_t CH_SBR; /**< Channel System Bus, array offset: 0x100C, array step: 0x1000 */ - __IO uint32_t CH_PRI; /**< Channel Priority, array offset: 0x1010, array step: 0x1000 */ - __IO uint32_t CH_MUX; /**< Channel Multiplexor Configuration, array offset: 0x1014, array step: 0x1000 */ - uint8_t RESERVED_0[8]; - __IO uint32_t TCD_SADDR; /**< TCD Source Address, array offset: 0x1020, array step: 0x1000 */ - __IO uint16_t TCD_SOFF; /**< TCD Signed Source Address Offset, array offset: 0x1024, array step: 0x1000 */ - __IO uint16_t TCD_ATTR; /**< TCD Transfer Attributes, array offset: 0x1026, array step: 0x1000 */ - union { /* offset: 0x1028, array step: 0x1000 */ - __IO uint32_t TCD_NBYTES_MLOFFNO; /**< TCD Transfer Size Without Minor Loop Offsets, array offset: 0x1028, array step: 0x1000 */ - __IO uint32_t TCD_NBYTES_MLOFFYES; /**< TCD Transfer Size with Minor Loop Offsets, array offset: 0x1028, array step: 0x1000 */ - }; - __IO uint32_t TCD_SLAST_SDA; /**< TCD Last Source Address Adjustment / Store DADDR Address, array offset: 0x102C, array step: 0x1000 */ - __IO uint32_t TCD_DADDR; /**< TCD Destination Address, array offset: 0x1030, array step: 0x1000 */ - __IO uint16_t TCD_DOFF; /**< TCD Signed Destination Address Offset, array offset: 0x1034, array step: 0x1000 */ - union { /* offset: 0x1036, array step: 0x1000 */ - __IO uint16_t TCD_CITER_ELINKNO; /**< TCD Current Major Loop Count (Minor Loop Channel Linking Disabled), array offset: 0x1036, array step: 0x1000 */ - __IO uint16_t TCD_CITER_ELINKYES; /**< TCD Current Major Loop Count (Minor Loop Channel Linking Enabled), array offset: 0x1036, array step: 0x1000 */ - }; - __IO uint32_t TCD_DLAST_SGA; /**< TCD Last Destination Address Adjustment / Scatter Gather Address, array offset: 0x1038, array step: 0x1000 */ - __IO uint16_t TCD_CSR; /**< TCD Control and Status, array offset: 0x103C, array step: 0x1000 */ - union { /* offset: 0x103E, array step: 0x1000 */ - __IO uint16_t TCD_BITER_ELINKNO; /**< TCD Beginning Major Loop Count (Minor Loop Channel Linking Disabled), array offset: 0x103E, array step: 0x1000 */ - __IO uint16_t TCD_BITER_ELINKYES; /**< TCD Beginning Major Loop Count (Minor Loop Channel Linking Enabled), array offset: 0x103E, array step: 0x1000 */ - }; - uint8_t RESERVED_1[4032]; - } CH[16]; -} DMA_Type; - -/* ---------------------------------------------------------------------------- - -- DMA Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DMA_Register_Masks DMA Register Masks - * @{ - */ - -/*! @name MP_CSR - Management Page Control */ -/*! @{ */ - -#define DMA_MP_CSR_EDBG_MASK (0x2U) -#define DMA_MP_CSR_EDBG_SHIFT (1U) -/*! EDBG - Enable Debug - * 0b0..Debug mode disabled - * 0b1..Debug mode is enabled. - */ -#define DMA_MP_CSR_EDBG(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_EDBG_SHIFT)) & DMA_MP_CSR_EDBG_MASK) - -#define DMA_MP_CSR_ERCA_MASK (0x4U) -#define DMA_MP_CSR_ERCA_SHIFT (2U) -/*! ERCA - Enable Round Robin Channel Arbitration - * 0b0..Round-robin channel arbitration disabled - * 0b1..Round-robin channel arbitration enabled - */ -#define DMA_MP_CSR_ERCA(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_ERCA_SHIFT)) & DMA_MP_CSR_ERCA_MASK) - -#define DMA_MP_CSR_HAE_MASK (0x10U) -#define DMA_MP_CSR_HAE_SHIFT (4U) -/*! HAE - Halt After Error - * 0b0..Normal operation - * 0b1..Any error causes the HALT field to be set to 1 - */ -#define DMA_MP_CSR_HAE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_HAE_SHIFT)) & DMA_MP_CSR_HAE_MASK) - -#define DMA_MP_CSR_HALT_MASK (0x20U) -#define DMA_MP_CSR_HALT_SHIFT (5U) -/*! HALT - Halt DMA Operations - * 0b0..Normal operation - * 0b1..Stall the start of any new channels - */ -#define DMA_MP_CSR_HALT(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_HALT_SHIFT)) & DMA_MP_CSR_HALT_MASK) - -#define DMA_MP_CSR_GCLC_MASK (0x40U) -#define DMA_MP_CSR_GCLC_SHIFT (6U) -/*! GCLC - Global Channel Linking Control - * 0b0..Channel linking disabled for all channels - * 0b1..Channel linking available and controlled by each channel's link settings - */ -#define DMA_MP_CSR_GCLC(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_GCLC_SHIFT)) & DMA_MP_CSR_GCLC_MASK) - -#define DMA_MP_CSR_GMRC_MASK (0x80U) -#define DMA_MP_CSR_GMRC_SHIFT (7U) -/*! GMRC - Global Master ID Replication Control - * 0b0..Master ID replication disabled for all channels - * 0b1..Master ID replication available and controlled by each channel's CHn_SBR[EMI] setting - */ -#define DMA_MP_CSR_GMRC(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_GMRC_SHIFT)) & DMA_MP_CSR_GMRC_MASK) - -#define DMA_MP_CSR_ECX_MASK (0x100U) -#define DMA_MP_CSR_ECX_SHIFT (8U) -/*! ECX - Cancel Transfer With Error - * 0b0..Normal operation - * 0b1..Cancel the remaining data transfer - */ -#define DMA_MP_CSR_ECX(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_ECX_SHIFT)) & DMA_MP_CSR_ECX_MASK) - -#define DMA_MP_CSR_CX_MASK (0x200U) -#define DMA_MP_CSR_CX_SHIFT (9U) -/*! CX - Cancel Transfer - * 0b0..Normal operation - * 0b1..Cancel the remaining data transfer - */ -#define DMA_MP_CSR_CX(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_CX_SHIFT)) & DMA_MP_CSR_CX_MASK) - -#define DMA_MP_CSR_ACTIVE_ID_MASK (0xF000000U) -#define DMA_MP_CSR_ACTIVE_ID_SHIFT (24U) -/*! ACTIVE_ID - Active Channel ID */ -#define DMA_MP_CSR_ACTIVE_ID(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_ACTIVE_ID_SHIFT)) & DMA_MP_CSR_ACTIVE_ID_MASK) - -#define DMA_MP_CSR_ACTIVE_MASK (0x80000000U) -#define DMA_MP_CSR_ACTIVE_SHIFT (31U) -/*! ACTIVE - DMA Active Status - * 0b0..eDMA is idle - * 0b1..eDMA is executing a channel - */ -#define DMA_MP_CSR_ACTIVE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_ACTIVE_SHIFT)) & DMA_MP_CSR_ACTIVE_MASK) -/*! @} */ - -/*! @name MP_ES - Management Page Error Status */ -/*! @{ */ - -#define DMA_MP_ES_DBE_MASK (0x1U) -#define DMA_MP_ES_DBE_SHIFT (0U) -/*! DBE - Destination Bus Error - * 0b0..No destination bus error - * 0b1..Last recorded error was a bus error on a destination write - */ -#define DMA_MP_ES_DBE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_DBE_SHIFT)) & DMA_MP_ES_DBE_MASK) - -#define DMA_MP_ES_SBE_MASK (0x2U) -#define DMA_MP_ES_SBE_SHIFT (1U) -/*! SBE - Source Bus Error - * 0b0..No source bus error - * 0b1..Last recorded error was a bus error on a source read - */ -#define DMA_MP_ES_SBE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_SBE_SHIFT)) & DMA_MP_ES_SBE_MASK) - -#define DMA_MP_ES_SGE_MASK (0x4U) -#define DMA_MP_ES_SGE_SHIFT (2U) -/*! SGE - Scatter/Gather Configuration Error - * 0b0..No scatter/gather configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_DLAST_SGA field - */ -#define DMA_MP_ES_SGE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_SGE_SHIFT)) & DMA_MP_ES_SGE_MASK) - -#define DMA_MP_ES_NCE_MASK (0x8U) -#define DMA_MP_ES_NCE_SHIFT (3U) -/*! NCE - NBYTES/CITER Configuration Error - * 0b0..No NBYTES/CITER configuration error - * 0b1..The last recorded error was NBYTES equal to zero or a CITER not equal to BITER error - */ -#define DMA_MP_ES_NCE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_NCE_SHIFT)) & DMA_MP_ES_NCE_MASK) - -#define DMA_MP_ES_DOE_MASK (0x10U) -#define DMA_MP_ES_DOE_SHIFT (4U) -/*! DOE - Destination Offset Error - * 0b0..No destination offset configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_DOFF field - */ -#define DMA_MP_ES_DOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_DOE_SHIFT)) & DMA_MP_ES_DOE_MASK) - -#define DMA_MP_ES_DAE_MASK (0x20U) -#define DMA_MP_ES_DAE_SHIFT (5U) -/*! DAE - Destination Address Error - * 0b0..No destination address configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_DADDR field - */ -#define DMA_MP_ES_DAE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_DAE_SHIFT)) & DMA_MP_ES_DAE_MASK) - -#define DMA_MP_ES_SOE_MASK (0x40U) -#define DMA_MP_ES_SOE_SHIFT (6U) -/*! SOE - Source Offset Error - * 0b0..No source offset configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_SOFF field - */ -#define DMA_MP_ES_SOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_SOE_SHIFT)) & DMA_MP_ES_SOE_MASK) - -#define DMA_MP_ES_SAE_MASK (0x80U) -#define DMA_MP_ES_SAE_SHIFT (7U) -/*! SAE - Source Address Error - * 0b0..No source address configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_SADDR field - */ -#define DMA_MP_ES_SAE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_SAE_SHIFT)) & DMA_MP_ES_SAE_MASK) - -#define DMA_MP_ES_ECX_MASK (0x100U) -#define DMA_MP_ES_ECX_SHIFT (8U) -/*! ECX - Transfer Canceled - * 0b0..No canceled transfers - * 0b1..Last recorded entry was a canceled transfer by the error cancel transfer input - */ -#define DMA_MP_ES_ECX(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_ECX_SHIFT)) & DMA_MP_ES_ECX_MASK) - -#define DMA_MP_ES_ERRCHN_MASK (0xF000000U) -#define DMA_MP_ES_ERRCHN_SHIFT (24U) -/*! ERRCHN - Error Channel Number or Canceled Channel Number */ -#define DMA_MP_ES_ERRCHN(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_ERRCHN_SHIFT)) & DMA_MP_ES_ERRCHN_MASK) - -#define DMA_MP_ES_VLD_MASK (0x80000000U) -#define DMA_MP_ES_VLD_SHIFT (31U) -/*! VLD - Valid - * 0b0..No CHn_ES[ERR] fields are set to 1 - * 0b1..At least one CHn_ES[ERR] field is set to 1, indicating a valid error exists that software has not cleared - */ -#define DMA_MP_ES_VLD(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_VLD_SHIFT)) & DMA_MP_ES_VLD_MASK) -/*! @} */ - -/*! @name MP_INT - Management Page Interrupt Request Status */ -/*! @{ */ - -#define DMA_MP_INT_INT_MASK (0xFFFFU) -#define DMA_MP_INT_INT_SHIFT (0U) -/*! INT - Interrupt Request Status */ -#define DMA_MP_INT_INT(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_INT_INT_SHIFT)) & DMA_MP_INT_INT_MASK) -/*! @} */ - -/*! @name MP_HRS - Management Page Hardware Request Status */ -/*! @{ */ - -#define DMA_MP_HRS_HRS_MASK (0xFFFFFFFFU) -#define DMA_MP_HRS_HRS_SHIFT (0U) -/*! HRS - Hardware Request Status */ -#define DMA_MP_HRS_HRS(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_HRS_HRS_SHIFT)) & DMA_MP_HRS_HRS_MASK) -/*! @} */ - -/*! @name CH_GRPRI - Channel Arbitration Group */ -/*! @{ */ - -#define DMA_CH_GRPRI_GRPRI_MASK (0x1FU) -#define DMA_CH_GRPRI_GRPRI_SHIFT (0U) -/*! GRPRI - Arbitration Group For Channel n */ -#define DMA_CH_GRPRI_GRPRI(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_GRPRI_GRPRI_SHIFT)) & DMA_CH_GRPRI_GRPRI_MASK) -/*! @} */ - -/* The count of DMA_CH_GRPRI */ -#define DMA_CH_GRPRI_COUNT (16U) - -/*! @name CH_CSR - Channel Control and Status */ -/*! @{ */ - -#define DMA_CH_CSR_ERQ_MASK (0x1U) -#define DMA_CH_CSR_ERQ_SHIFT (0U) -/*! ERQ - Enable DMA Request - * 0b0..DMA hardware request signal for corresponding channel disabled - * 0b1..DMA hardware request signal for corresponding channel enabled - */ -#define DMA_CH_CSR_ERQ(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_CSR_ERQ_SHIFT)) & DMA_CH_CSR_ERQ_MASK) - -#define DMA_CH_CSR_EARQ_MASK (0x2U) -#define DMA_CH_CSR_EARQ_SHIFT (1U) -/*! EARQ - Enable Asynchronous DMA Request - * 0b0..Disable asynchronous DMA request for the channel - * 0b1..Enable asynchronous DMA request for the channel - */ -#define DMA_CH_CSR_EARQ(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_CSR_EARQ_SHIFT)) & DMA_CH_CSR_EARQ_MASK) - -#define DMA_CH_CSR_EEI_MASK (0x4U) -#define DMA_CH_CSR_EEI_SHIFT (2U) -/*! EEI - Enable Error Interrupt - * 0b0..Error signal for corresponding channel does not generate error interrupt - * 0b1..Assertion of error signal for corresponding channel generates error interrupt request - */ -#define DMA_CH_CSR_EEI(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_CSR_EEI_SHIFT)) & DMA_CH_CSR_EEI_MASK) - -#define DMA_CH_CSR_EBW_MASK (0x8U) -#define DMA_CH_CSR_EBW_SHIFT (3U) -/*! EBW - Enable Buffered Writes - * 0b0..Buffered writes on system bus disabled - * 0b1..Buffered writes on system bus enabled - */ -#define DMA_CH_CSR_EBW(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_CSR_EBW_SHIFT)) & DMA_CH_CSR_EBW_MASK) - -#define DMA_CH_CSR_DONE_MASK (0x40000000U) -#define DMA_CH_CSR_DONE_SHIFT (30U) -/*! DONE - Channel Done */ -#define DMA_CH_CSR_DONE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_CSR_DONE_SHIFT)) & DMA_CH_CSR_DONE_MASK) - -#define DMA_CH_CSR_ACTIVE_MASK (0x80000000U) -#define DMA_CH_CSR_ACTIVE_SHIFT (31U) -/*! ACTIVE - Channel Active */ -#define DMA_CH_CSR_ACTIVE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_CSR_ACTIVE_SHIFT)) & DMA_CH_CSR_ACTIVE_MASK) -/*! @} */ - -/* The count of DMA_CH_CSR */ -#define DMA_CH_CSR_COUNT (16U) - -/*! @name CH_ES - Channel Error Status */ -/*! @{ */ - -#define DMA_CH_ES_DBE_MASK (0x1U) -#define DMA_CH_ES_DBE_SHIFT (0U) -/*! DBE - Destination Bus Error - * 0b0..No destination bus error - * 0b1..Last recorded error was bus error on destination write - */ -#define DMA_CH_ES_DBE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_DBE_SHIFT)) & DMA_CH_ES_DBE_MASK) - -#define DMA_CH_ES_SBE_MASK (0x2U) -#define DMA_CH_ES_SBE_SHIFT (1U) -/*! SBE - Source Bus Error - * 0b0..No source bus error - * 0b1..Last recorded error was bus error on source read - */ -#define DMA_CH_ES_SBE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_SBE_SHIFT)) & DMA_CH_ES_SBE_MASK) - -#define DMA_CH_ES_SGE_MASK (0x4U) -#define DMA_CH_ES_SGE_SHIFT (2U) -/*! SGE - Scatter/Gather Configuration Error - * 0b0..No scatter/gather configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_DLAST_SGA field - */ -#define DMA_CH_ES_SGE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_SGE_SHIFT)) & DMA_CH_ES_SGE_MASK) - -#define DMA_CH_ES_NCE_MASK (0x8U) -#define DMA_CH_ES_NCE_SHIFT (3U) -/*! NCE - NBYTES/CITER Configuration Error - * 0b0..No NBYTES/CITER configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_NBYTES or TCDn_CITER fields - */ -#define DMA_CH_ES_NCE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_NCE_SHIFT)) & DMA_CH_ES_NCE_MASK) - -#define DMA_CH_ES_DOE_MASK (0x10U) -#define DMA_CH_ES_DOE_SHIFT (4U) -/*! DOE - Destination Offset Error - * 0b0..No destination offset configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_DOFF field - */ -#define DMA_CH_ES_DOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_DOE_SHIFT)) & DMA_CH_ES_DOE_MASK) - -#define DMA_CH_ES_DAE_MASK (0x20U) -#define DMA_CH_ES_DAE_SHIFT (5U) -/*! DAE - Destination Address Error - * 0b0..No destination address configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_DADDR field - */ -#define DMA_CH_ES_DAE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_DAE_SHIFT)) & DMA_CH_ES_DAE_MASK) - -#define DMA_CH_ES_SOE_MASK (0x40U) -#define DMA_CH_ES_SOE_SHIFT (6U) -/*! SOE - Source Offset Error - * 0b0..No source offset configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_SOFF field - */ -#define DMA_CH_ES_SOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_SOE_SHIFT)) & DMA_CH_ES_SOE_MASK) - -#define DMA_CH_ES_SAE_MASK (0x80U) -#define DMA_CH_ES_SAE_SHIFT (7U) -/*! SAE - Source Address Error - * 0b0..No source address configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_SADDR field - */ -#define DMA_CH_ES_SAE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_SAE_SHIFT)) & DMA_CH_ES_SAE_MASK) - -#define DMA_CH_ES_ERR_MASK (0x80000000U) -#define DMA_CH_ES_ERR_SHIFT (31U) -/*! ERR - Error In Channel - * 0b0..An error in this channel has not occurred - * 0b1..An error in this channel has occurred - */ -#define DMA_CH_ES_ERR(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_ERR_SHIFT)) & DMA_CH_ES_ERR_MASK) -/*! @} */ - -/* The count of DMA_CH_ES */ -#define DMA_CH_ES_COUNT (16U) - -/*! @name CH_INT - Channel Interrupt Status */ -/*! @{ */ - -#define DMA_CH_INT_INT_MASK (0x1U) -#define DMA_CH_INT_INT_SHIFT (0U) -/*! INT - Interrupt Request - * 0b0..Interrupt request for corresponding channel cleared - * 0b1..Interrupt request for corresponding channel active - */ -#define DMA_CH_INT_INT(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_INT_INT_SHIFT)) & DMA_CH_INT_INT_MASK) -/*! @} */ - -/* The count of DMA_CH_INT */ -#define DMA_CH_INT_COUNT (16U) - -/*! @name CH_SBR - Channel System Bus */ -/*! @{ */ - -#define DMA_CH_SBR_MID_MASK (0x1FU) -#define DMA_CH_SBR_MID_SHIFT (0U) -/*! MID - Master ID */ -#define DMA_CH_SBR_MID(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_SBR_MID_SHIFT)) & DMA_CH_SBR_MID_MASK) - -#define DMA_CH_SBR_SEC_MASK (0x4000U) -#define DMA_CH_SBR_SEC_SHIFT (14U) -/*! SEC - Security Level - * 0b0..Nonsecure protection level for DMA transfers - * 0b1..Secure protection level for DMA transfers - */ -#define DMA_CH_SBR_SEC(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_SBR_SEC_SHIFT)) & DMA_CH_SBR_SEC_MASK) - -#define DMA_CH_SBR_PAL_MASK (0x8000U) -#define DMA_CH_SBR_PAL_SHIFT (15U) -/*! PAL - Privileged Access Level - * 0b0..User protection level for DMA transfers - * 0b1..Privileged protection level for DMA transfers - */ -#define DMA_CH_SBR_PAL(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_SBR_PAL_SHIFT)) & DMA_CH_SBR_PAL_MASK) - -#define DMA_CH_SBR_EMI_MASK (0x10000U) -#define DMA_CH_SBR_EMI_SHIFT (16U) -/*! EMI - Enable Master ID Replication - * 0b0..Master ID replication is disabled - * 0b1..Master ID replication is enabled - */ -#define DMA_CH_SBR_EMI(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_SBR_EMI_SHIFT)) & DMA_CH_SBR_EMI_MASK) -/*! @} */ - -/* The count of DMA_CH_SBR */ -#define DMA_CH_SBR_COUNT (16U) - -/*! @name CH_PRI - Channel Priority */ -/*! @{ */ - -#define DMA_CH_PRI_APL_MASK (0x7U) -#define DMA_CH_PRI_APL_SHIFT (0U) -/*! APL - Arbitration Priority Level */ -#define DMA_CH_PRI_APL(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_PRI_APL_SHIFT)) & DMA_CH_PRI_APL_MASK) - -#define DMA_CH_PRI_DPA_MASK (0x40000000U) -#define DMA_CH_PRI_DPA_SHIFT (30U) -/*! DPA - Disable Preempt Ability - * 0b0..Channel can suspend a lower-priority channel - * 0b1..Channel cannot suspend any other channel, regardless of channel priority - */ -#define DMA_CH_PRI_DPA(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_PRI_DPA_SHIFT)) & DMA_CH_PRI_DPA_MASK) - -#define DMA_CH_PRI_ECP_MASK (0x80000000U) -#define DMA_CH_PRI_ECP_SHIFT (31U) -/*! ECP - Enable Channel Preemption - * 0b0..Channel cannot be suspended by a higher-priority channel's service request - * 0b1..Channel can be temporarily suspended by a higher-priority channel's service request - */ -#define DMA_CH_PRI_ECP(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_PRI_ECP_SHIFT)) & DMA_CH_PRI_ECP_MASK) -/*! @} */ - -/* The count of DMA_CH_PRI */ -#define DMA_CH_PRI_COUNT (16U) - -/*! @name CH_MUX - Channel Multiplexor Configuration */ -/*! @{ */ - -#define DMA_CH_MUX_SRC_MASK (0x7FU) -#define DMA_CH_MUX_SRC_SHIFT (0U) -/*! SRC - Service Request Source */ -#define DMA_CH_MUX_SRC(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_MUX_SRC_SHIFT)) & DMA_CH_MUX_SRC_MASK) -/*! @} */ - -/* The count of DMA_CH_MUX */ -#define DMA_CH_MUX_COUNT (16U) - -/*! @name TCD_SADDR - TCD Source Address */ -/*! @{ */ - -#define DMA_TCD_SADDR_SADDR_MASK (0xFFFFFFFFU) -#define DMA_TCD_SADDR_SADDR_SHIFT (0U) -/*! SADDR - Source Address */ -#define DMA_TCD_SADDR_SADDR(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_SADDR_SADDR_SHIFT)) & DMA_TCD_SADDR_SADDR_MASK) -/*! @} */ - -/* The count of DMA_TCD_SADDR */ -#define DMA_TCD_SADDR_COUNT (16U) - -/*! @name TCD_SOFF - TCD Signed Source Address Offset */ -/*! @{ */ - -#define DMA_TCD_SOFF_SOFF_MASK (0xFFFFU) -#define DMA_TCD_SOFF_SOFF_SHIFT (0U) -/*! SOFF - Source Address Signed Offset */ -#define DMA_TCD_SOFF_SOFF(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_SOFF_SOFF_SHIFT)) & DMA_TCD_SOFF_SOFF_MASK) -/*! @} */ - -/* The count of DMA_TCD_SOFF */ -#define DMA_TCD_SOFF_COUNT (16U) - -/*! @name TCD_ATTR - TCD Transfer Attributes */ -/*! @{ */ - -#define DMA_TCD_ATTR_DSIZE_MASK (0x7U) -#define DMA_TCD_ATTR_DSIZE_SHIFT (0U) -/*! DSIZE - Destination Data Transfer Size */ -#define DMA_TCD_ATTR_DSIZE(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_ATTR_DSIZE_SHIFT)) & DMA_TCD_ATTR_DSIZE_MASK) - -#define DMA_TCD_ATTR_DMOD_MASK (0xF8U) -#define DMA_TCD_ATTR_DMOD_SHIFT (3U) -/*! DMOD - Destination Address Modulo */ -#define DMA_TCD_ATTR_DMOD(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_ATTR_DMOD_SHIFT)) & DMA_TCD_ATTR_DMOD_MASK) - -#define DMA_TCD_ATTR_SSIZE_MASK (0x700U) -#define DMA_TCD_ATTR_SSIZE_SHIFT (8U) -/*! SSIZE - Source Data Transfer Size - * 0b000..8-bit - * 0b001..16-bit - * 0b010..32-bit - * 0b011..64-bit - * 0b100..16-byte - * 0b101..32-byte - * 0b110.. - * 0b111.. - */ -#define DMA_TCD_ATTR_SSIZE(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_ATTR_SSIZE_SHIFT)) & DMA_TCD_ATTR_SSIZE_MASK) - -#define DMA_TCD_ATTR_SMOD_MASK (0xF800U) -#define DMA_TCD_ATTR_SMOD_SHIFT (11U) -/*! SMOD - Source Address Modulo - * 0b00000..Source address modulo feature disabled - * 0b00001..Source address modulo feature enabled for any non-zero value [1-31] - */ -#define DMA_TCD_ATTR_SMOD(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_ATTR_SMOD_SHIFT)) & DMA_TCD_ATTR_SMOD_MASK) -/*! @} */ - -/* The count of DMA_TCD_ATTR */ -#define DMA_TCD_ATTR_COUNT (16U) - -/*! @name TCD_NBYTES_MLOFFNO - TCD Transfer Size Without Minor Loop Offsets */ -/*! @{ */ - -#define DMA_TCD_NBYTES_MLOFFNO_NBYTES_MASK (0x3FFFFFFFU) -#define DMA_TCD_NBYTES_MLOFFNO_NBYTES_SHIFT (0U) -/*! NBYTES - Number of Bytes To Transfer Per Service Request */ -#define DMA_TCD_NBYTES_MLOFFNO_NBYTES(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFNO_NBYTES_SHIFT)) & DMA_TCD_NBYTES_MLOFFNO_NBYTES_MASK) - -#define DMA_TCD_NBYTES_MLOFFNO_DMLOE_MASK (0x40000000U) -#define DMA_TCD_NBYTES_MLOFFNO_DMLOE_SHIFT (30U) -/*! DMLOE - Destination Minor Loop Offset Enable - * 0b0..Minor loop offset not applied to DADDR - * 0b1..Minor loop offset applied to DADDR - */ -#define DMA_TCD_NBYTES_MLOFFNO_DMLOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFNO_DMLOE_SHIFT)) & DMA_TCD_NBYTES_MLOFFNO_DMLOE_MASK) - -#define DMA_TCD_NBYTES_MLOFFNO_SMLOE_MASK (0x80000000U) -#define DMA_TCD_NBYTES_MLOFFNO_SMLOE_SHIFT (31U) -/*! SMLOE - Source Minor Loop Offset Enable - * 0b0..Minor loop offset not applied to SADDR - * 0b1..Minor loop offset applied to SADDR - */ -#define DMA_TCD_NBYTES_MLOFFNO_SMLOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFNO_SMLOE_SHIFT)) & DMA_TCD_NBYTES_MLOFFNO_SMLOE_MASK) -/*! @} */ - -/* The count of DMA_TCD_NBYTES_MLOFFNO */ -#define DMA_TCD_NBYTES_MLOFFNO_COUNT (16U) - -/*! @name TCD_NBYTES_MLOFFYES - TCD Transfer Size with Minor Loop Offsets */ -/*! @{ */ - -#define DMA_TCD_NBYTES_MLOFFYES_NBYTES_MASK (0x3FFU) -#define DMA_TCD_NBYTES_MLOFFYES_NBYTES_SHIFT (0U) -/*! NBYTES - Number of Bytes To Transfer Per Service Request */ -#define DMA_TCD_NBYTES_MLOFFYES_NBYTES(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFYES_NBYTES_SHIFT)) & DMA_TCD_NBYTES_MLOFFYES_NBYTES_MASK) - -#define DMA_TCD_NBYTES_MLOFFYES_MLOFF_MASK (0x3FFFFC00U) -#define DMA_TCD_NBYTES_MLOFFYES_MLOFF_SHIFT (10U) -/*! MLOFF - Minor Loop Offset */ -#define DMA_TCD_NBYTES_MLOFFYES_MLOFF(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFYES_MLOFF_SHIFT)) & DMA_TCD_NBYTES_MLOFFYES_MLOFF_MASK) - -#define DMA_TCD_NBYTES_MLOFFYES_DMLOE_MASK (0x40000000U) -#define DMA_TCD_NBYTES_MLOFFYES_DMLOE_SHIFT (30U) -/*! DMLOE - Destination Minor Loop Offset Enable - * 0b0..Minor loop offset not applied to DADDR - * 0b1..Minor loop offset applied to DADDR - */ -#define DMA_TCD_NBYTES_MLOFFYES_DMLOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFYES_DMLOE_SHIFT)) & DMA_TCD_NBYTES_MLOFFYES_DMLOE_MASK) - -#define DMA_TCD_NBYTES_MLOFFYES_SMLOE_MASK (0x80000000U) -#define DMA_TCD_NBYTES_MLOFFYES_SMLOE_SHIFT (31U) -/*! SMLOE - Source Minor Loop Offset Enable - * 0b0..Minor loop offset not applied to SADDR - * 0b1..Minor loop offset applied to SADDR - */ -#define DMA_TCD_NBYTES_MLOFFYES_SMLOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFYES_SMLOE_SHIFT)) & DMA_TCD_NBYTES_MLOFFYES_SMLOE_MASK) -/*! @} */ - -/* The count of DMA_TCD_NBYTES_MLOFFYES */ -#define DMA_TCD_NBYTES_MLOFFYES_COUNT (16U) - -/*! @name TCD_SLAST_SDA - TCD Last Source Address Adjustment / Store DADDR Address */ -/*! @{ */ - -#define DMA_TCD_SLAST_SDA_SLAST_SDA_MASK (0xFFFFFFFFU) -#define DMA_TCD_SLAST_SDA_SLAST_SDA_SHIFT (0U) -/*! SLAST_SDA - Last Source Address Adjustment / Store DADDR Address */ -#define DMA_TCD_SLAST_SDA_SLAST_SDA(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_SLAST_SDA_SLAST_SDA_SHIFT)) & DMA_TCD_SLAST_SDA_SLAST_SDA_MASK) -/*! @} */ - -/* The count of DMA_TCD_SLAST_SDA */ -#define DMA_TCD_SLAST_SDA_COUNT (16U) - -/*! @name TCD_DADDR - TCD Destination Address */ -/*! @{ */ - -#define DMA_TCD_DADDR_DADDR_MASK (0xFFFFFFFFU) -#define DMA_TCD_DADDR_DADDR_SHIFT (0U) -/*! DADDR - Destination Address */ -#define DMA_TCD_DADDR_DADDR(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_DADDR_DADDR_SHIFT)) & DMA_TCD_DADDR_DADDR_MASK) -/*! @} */ - -/* The count of DMA_TCD_DADDR */ -#define DMA_TCD_DADDR_COUNT (16U) - -/*! @name TCD_DOFF - TCD Signed Destination Address Offset */ -/*! @{ */ - -#define DMA_TCD_DOFF_DOFF_MASK (0xFFFFU) -#define DMA_TCD_DOFF_DOFF_SHIFT (0U) -/*! DOFF - Destination Address Signed Offset */ -#define DMA_TCD_DOFF_DOFF(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_DOFF_DOFF_SHIFT)) & DMA_TCD_DOFF_DOFF_MASK) -/*! @} */ - -/* The count of DMA_TCD_DOFF */ -#define DMA_TCD_DOFF_COUNT (16U) - -/*! @name TCD_CITER_ELINKNO - TCD Current Major Loop Count (Minor Loop Channel Linking Disabled) */ -/*! @{ */ - -#define DMA_TCD_CITER_ELINKNO_CITER_MASK (0x7FFFU) -#define DMA_TCD_CITER_ELINKNO_CITER_SHIFT (0U) -/*! CITER - Current Major Iteration Count */ -#define DMA_TCD_CITER_ELINKNO_CITER(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CITER_ELINKNO_CITER_SHIFT)) & DMA_TCD_CITER_ELINKNO_CITER_MASK) - -#define DMA_TCD_CITER_ELINKNO_ELINK_MASK (0x8000U) -#define DMA_TCD_CITER_ELINKNO_ELINK_SHIFT (15U) -/*! ELINK - Enable Link - * 0b0..Channel-to-channel linking disabled - * 0b1..Channel-to-channel linking enabled - */ -#define DMA_TCD_CITER_ELINKNO_ELINK(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CITER_ELINKNO_ELINK_SHIFT)) & DMA_TCD_CITER_ELINKNO_ELINK_MASK) -/*! @} */ - -/* The count of DMA_TCD_CITER_ELINKNO */ -#define DMA_TCD_CITER_ELINKNO_COUNT (16U) - -/*! @name TCD_CITER_ELINKYES - TCD Current Major Loop Count (Minor Loop Channel Linking Enabled) */ -/*! @{ */ - -#define DMA_TCD_CITER_ELINKYES_CITER_MASK (0x1FFU) -#define DMA_TCD_CITER_ELINKYES_CITER_SHIFT (0U) -/*! CITER - Current Major Iteration Count */ -#define DMA_TCD_CITER_ELINKYES_CITER(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CITER_ELINKYES_CITER_SHIFT)) & DMA_TCD_CITER_ELINKYES_CITER_MASK) - -#define DMA_TCD_CITER_ELINKYES_LINKCH_MASK (0x1E00U) -#define DMA_TCD_CITER_ELINKYES_LINKCH_SHIFT (9U) -/*! LINKCH - Minor Loop Link Channel Number */ -#define DMA_TCD_CITER_ELINKYES_LINKCH(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CITER_ELINKYES_LINKCH_SHIFT)) & DMA_TCD_CITER_ELINKYES_LINKCH_MASK) - -#define DMA_TCD_CITER_ELINKYES_ELINK_MASK (0x8000U) -#define DMA_TCD_CITER_ELINKYES_ELINK_SHIFT (15U) -/*! ELINK - Enable Link - * 0b0..Channel-to-channel linking disabled - * 0b1..Channel-to-channel linking enabled - */ -#define DMA_TCD_CITER_ELINKYES_ELINK(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CITER_ELINKYES_ELINK_SHIFT)) & DMA_TCD_CITER_ELINKYES_ELINK_MASK) -/*! @} */ - -/* The count of DMA_TCD_CITER_ELINKYES */ -#define DMA_TCD_CITER_ELINKYES_COUNT (16U) - -/*! @name TCD_DLAST_SGA - TCD Last Destination Address Adjustment / Scatter Gather Address */ -/*! @{ */ - -#define DMA_TCD_DLAST_SGA_DLAST_SGA_MASK (0xFFFFFFFFU) -#define DMA_TCD_DLAST_SGA_DLAST_SGA_SHIFT (0U) -/*! DLAST_SGA - Last Destination Address Adjustment / Scatter Gather Address */ -#define DMA_TCD_DLAST_SGA_DLAST_SGA(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_DLAST_SGA_DLAST_SGA_SHIFT)) & DMA_TCD_DLAST_SGA_DLAST_SGA_MASK) -/*! @} */ - -/* The count of DMA_TCD_DLAST_SGA */ -#define DMA_TCD_DLAST_SGA_COUNT (16U) - -/*! @name TCD_CSR - TCD Control and Status */ -/*! @{ */ - -#define DMA_TCD_CSR_START_MASK (0x1U) -#define DMA_TCD_CSR_START_SHIFT (0U) -/*! START - Channel Start - * 0b0..Channel not explicitly started - * 0b1..Channel explicitly started via a software-initiated service request - */ -#define DMA_TCD_CSR_START(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_START_SHIFT)) & DMA_TCD_CSR_START_MASK) - -#define DMA_TCD_CSR_INTMAJOR_MASK (0x2U) -#define DMA_TCD_CSR_INTMAJOR_SHIFT (1U) -/*! INTMAJOR - Enable Interrupt If Major count complete - * 0b0..End-of-major loop interrupt disabled - * 0b1..End-of-major loop interrupt enabled - */ -#define DMA_TCD_CSR_INTMAJOR(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_INTMAJOR_SHIFT)) & DMA_TCD_CSR_INTMAJOR_MASK) - -#define DMA_TCD_CSR_INTHALF_MASK (0x4U) -#define DMA_TCD_CSR_INTHALF_SHIFT (2U) -/*! INTHALF - Enable Interrupt If Major Counter Half-complete - * 0b0..Halfway point interrupt disabled - * 0b1..Halfway point interrupt enabled - */ -#define DMA_TCD_CSR_INTHALF(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_INTHALF_SHIFT)) & DMA_TCD_CSR_INTHALF_MASK) - -#define DMA_TCD_CSR_DREQ_MASK (0x8U) -#define DMA_TCD_CSR_DREQ_SHIFT (3U) -/*! DREQ - Disable Request - * 0b0..No operation - * 0b1..Clear the ERQ field to 0 upon major loop completion, thus disabling hardware service requests - */ -#define DMA_TCD_CSR_DREQ(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_DREQ_SHIFT)) & DMA_TCD_CSR_DREQ_MASK) - -#define DMA_TCD_CSR_ESG_MASK (0x10U) -#define DMA_TCD_CSR_ESG_SHIFT (4U) -/*! ESG - Enable Scatter/Gather Processing - * 0b0..Current channel's TCD is normal format - * 0b1..Current channel's TCD specifies scatter/gather format. - */ -#define DMA_TCD_CSR_ESG(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_ESG_SHIFT)) & DMA_TCD_CSR_ESG_MASK) - -#define DMA_TCD_CSR_MAJORELINK_MASK (0x20U) -#define DMA_TCD_CSR_MAJORELINK_SHIFT (5U) -/*! MAJORELINK - Enable Link When Major Loop Complete - * 0b0..Channel-to-channel linking disabled - * 0b1..Channel-to-channel linking enabled - */ -#define DMA_TCD_CSR_MAJORELINK(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_MAJORELINK_SHIFT)) & DMA_TCD_CSR_MAJORELINK_MASK) - -#define DMA_TCD_CSR_EEOP_MASK (0x40U) -#define DMA_TCD_CSR_EEOP_SHIFT (6U) -/*! EEOP - Enable End-Of-Packet Processing - * 0b0..End-of-packet operation disabled - * 0b1..End-of-packet hardware input signal enabled - */ -#define DMA_TCD_CSR_EEOP(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_EEOP_SHIFT)) & DMA_TCD_CSR_EEOP_MASK) - -#define DMA_TCD_CSR_ESDA_MASK (0x80U) -#define DMA_TCD_CSR_ESDA_SHIFT (7U) -/*! ESDA - Enable Store Destination Address - * 0b0..Ability to store destination address to system memory disabled - * 0b1..Ability to store destination address to system memory enabled - */ -#define DMA_TCD_CSR_ESDA(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_ESDA_SHIFT)) & DMA_TCD_CSR_ESDA_MASK) - -#define DMA_TCD_CSR_MAJORLINKCH_MASK (0xF00U) -#define DMA_TCD_CSR_MAJORLINKCH_SHIFT (8U) -/*! MAJORLINKCH - Major Loop Link Channel Number */ -#define DMA_TCD_CSR_MAJORLINKCH(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_MAJORLINKCH_SHIFT)) & DMA_TCD_CSR_MAJORLINKCH_MASK) - -#define DMA_TCD_CSR_BWC_MASK (0xC000U) -#define DMA_TCD_CSR_BWC_SHIFT (14U) -/*! BWC - Bandwidth Control - * 0b00..No eDMA engine stalls - * 0b01.. - * 0b10..eDMA engine stalls for 4 cycles after each R/W - * 0b11..eDMA engine stalls for 8 cycles after each R/W - */ -#define DMA_TCD_CSR_BWC(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_BWC_SHIFT)) & DMA_TCD_CSR_BWC_MASK) -/*! @} */ - -/* The count of DMA_TCD_CSR */ -#define DMA_TCD_CSR_COUNT (16U) - -/*! @name TCD_BITER_ELINKNO - TCD Beginning Major Loop Count (Minor Loop Channel Linking Disabled) */ -/*! @{ */ - -#define DMA_TCD_BITER_ELINKNO_BITER_MASK (0x7FFFU) -#define DMA_TCD_BITER_ELINKNO_BITER_SHIFT (0U) -/*! BITER - Starting Major Iteration Count */ -#define DMA_TCD_BITER_ELINKNO_BITER(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_BITER_ELINKNO_BITER_SHIFT)) & DMA_TCD_BITER_ELINKNO_BITER_MASK) - -#define DMA_TCD_BITER_ELINKNO_ELINK_MASK (0x8000U) -#define DMA_TCD_BITER_ELINKNO_ELINK_SHIFT (15U) -/*! ELINK - Enables Link - * 0b0..Channel-to-channel linking disabled - * 0b1..Channel-to-channel linking enabled - */ -#define DMA_TCD_BITER_ELINKNO_ELINK(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_BITER_ELINKNO_ELINK_SHIFT)) & DMA_TCD_BITER_ELINKNO_ELINK_MASK) -/*! @} */ - -/* The count of DMA_TCD_BITER_ELINKNO */ -#define DMA_TCD_BITER_ELINKNO_COUNT (16U) - -/*! @name TCD_BITER_ELINKYES - TCD Beginning Major Loop Count (Minor Loop Channel Linking Enabled) */ -/*! @{ */ - -#define DMA_TCD_BITER_ELINKYES_BITER_MASK (0x1FFU) -#define DMA_TCD_BITER_ELINKYES_BITER_SHIFT (0U) -/*! BITER - Starting Major Iteration Count */ -#define DMA_TCD_BITER_ELINKYES_BITER(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_BITER_ELINKYES_BITER_SHIFT)) & DMA_TCD_BITER_ELINKYES_BITER_MASK) - -#define DMA_TCD_BITER_ELINKYES_LINKCH_MASK (0x1E00U) -#define DMA_TCD_BITER_ELINKYES_LINKCH_SHIFT (9U) -/*! LINKCH - Link Channel Number */ -#define DMA_TCD_BITER_ELINKYES_LINKCH(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_BITER_ELINKYES_LINKCH_SHIFT)) & DMA_TCD_BITER_ELINKYES_LINKCH_MASK) - -#define DMA_TCD_BITER_ELINKYES_ELINK_MASK (0x8000U) -#define DMA_TCD_BITER_ELINKYES_ELINK_SHIFT (15U) -/*! ELINK - Enable Link - * 0b0..Channel-to-channel linking disabled - * 0b1..Channel-to-channel linking enabled - */ -#define DMA_TCD_BITER_ELINKYES_ELINK(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_BITER_ELINKYES_ELINK_SHIFT)) & DMA_TCD_BITER_ELINKYES_ELINK_MASK) -/*! @} */ - -/* The count of DMA_TCD_BITER_ELINKYES */ -#define DMA_TCD_BITER_ELINKYES_COUNT (16U) - - -/*! - * @} - */ /* end of group DMA_Register_Masks */ - - -/* DMA - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral DMA0 base address */ - #define DMA0_BASE (0x50080000u) - /** Peripheral DMA0 base address */ - #define DMA0_BASE_NS (0x40080000u) - /** Peripheral DMA0 base pointer */ - #define DMA0 ((DMA_Type *)DMA0_BASE) - /** Peripheral DMA0 base pointer */ - #define DMA0_NS ((DMA_Type *)DMA0_BASE_NS) - /** Peripheral DMA1 base address */ - #define DMA1_BASE (0x500A0000u) - /** Peripheral DMA1 base address */ - #define DMA1_BASE_NS (0x400A0000u) - /** Peripheral DMA1 base pointer */ - #define DMA1 ((DMA_Type *)DMA1_BASE) - /** Peripheral DMA1 base pointer */ - #define DMA1_NS ((DMA_Type *)DMA1_BASE_NS) - /** Array initializer of DMA peripheral base addresses */ - #define DMA_BASE_ADDRS { DMA0_BASE, DMA1_BASE } - /** Array initializer of DMA peripheral base pointers */ - #define DMA_BASE_PTRS { DMA0, DMA1 } - /** Array initializer of DMA peripheral base addresses */ - #define DMA_BASE_ADDRS_NS { DMA0_BASE_NS, DMA1_BASE_NS } - /** Array initializer of DMA peripheral base pointers */ - #define DMA_BASE_PTRS_NS { DMA0_NS, DMA1_NS } -#else - /** Peripheral DMA0 base address */ - #define DMA0_BASE (0x40080000u) - /** Peripheral DMA0 base pointer */ - #define DMA0 ((DMA_Type *)DMA0_BASE) - /** Peripheral DMA1 base address */ - #define DMA1_BASE (0x400A0000u) - /** Peripheral DMA1 base pointer */ - #define DMA1 ((DMA_Type *)DMA1_BASE) - /** Array initializer of DMA peripheral base addresses */ - #define DMA_BASE_ADDRS { DMA0_BASE, DMA1_BASE } - /** Array initializer of DMA peripheral base pointers */ - #define DMA_BASE_PTRS { DMA0, DMA1 } -#endif -/** Interrupt vectors for the DMA peripheral type */ -#define DMA_IRQS { { EDMA_0_CH0_IRQn, EDMA_0_CH1_IRQn, EDMA_0_CH2_IRQn, EDMA_0_CH3_IRQn, EDMA_0_CH4_IRQn, EDMA_0_CH5_IRQn, EDMA_0_CH6_IRQn, EDMA_0_CH7_IRQn, EDMA_0_CH8_IRQn, EDMA_0_CH9_IRQn, EDMA_0_CH10_IRQn, EDMA_0_CH11_IRQn, EDMA_0_CH12_IRQn, EDMA_0_CH13_IRQn, EDMA_0_CH14_IRQn, EDMA_0_CH15_IRQn }, \ - { EDMA_1_CH0_IRQn, EDMA_1_CH1_IRQn, EDMA_1_CH2_IRQn, EDMA_1_CH3_IRQn, EDMA_1_CH4_IRQn, EDMA_1_CH5_IRQn, EDMA_1_CH6_IRQn, EDMA_1_CH7_IRQn, EDMA_1_CH8_IRQn, EDMA_1_CH9_IRQn, EDMA_1_CH10_IRQn, EDMA_1_CH11_IRQn, EDMA_1_CH12_IRQn, EDMA_1_CH13_IRQn, EDMA_1_CH14_IRQn, EDMA_1_CH15_IRQn } } - -/*! - * @} - */ /* end of group DMA_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- EIM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup EIM_Peripheral_Access_Layer EIM Peripheral Access Layer - * @{ - */ - -/** EIM - Register Layout Typedef */ -typedef struct { - __IO uint32_t EIMCR; /**< Error Injection Module Configuration Register, offset: 0x0 */ - __IO uint32_t EICHEN; /**< Error Injection Channel Enable register, offset: 0x4 */ - uint8_t RESERVED_0[248]; - __IO uint32_t EICHD0_WORD0; /**< Error Injection Channel Descriptor 0, Word0, offset: 0x100 */ - __IO uint32_t EICHD0_WORD1; /**< Error Injection Channel Descriptor 0, Word1, offset: 0x104 */ - uint8_t RESERVED_1[56]; - __IO uint32_t EICHD1_WORD0; /**< Error Injection Channel Descriptor 1, Word0, offset: 0x140 */ - __IO uint32_t EICHD1_WORD1; /**< Error Injection Channel Descriptor 1, Word1, offset: 0x144 */ - uint8_t RESERVED_2[56]; - __IO uint32_t EICHD2_WORD0; /**< Error Injection Channel Descriptor 2, Word0, offset: 0x180 */ - __IO uint32_t EICHD2_WORD1; /**< Error Injection Channel Descriptor 2, Word1, offset: 0x184 */ - uint8_t RESERVED_3[56]; - __IO uint32_t EICHD3_WORD0; /**< Error Injection Channel Descriptor 3, Word0, offset: 0x1C0 */ - __IO uint32_t EICHD3_WORD1; /**< Error Injection Channel Descriptor 3, Word1, offset: 0x1C4 */ - uint8_t RESERVED_4[56]; - __IO uint32_t EICHD4_WORD0; /**< Error Injection Channel Descriptor 4, Word0, offset: 0x200 */ - __IO uint32_t EICHD4_WORD1; /**< Error Injection Channel Descriptor 4, Word1, offset: 0x204 */ - uint8_t RESERVED_5[56]; - __IO uint32_t EICHD5_WORD0; /**< Error Injection Channel Descriptor 5, Word0, offset: 0x240 */ - __IO uint32_t EICHD5_WORD1; /**< Error Injection Channel Descriptor 5, Word1, offset: 0x244 */ - uint8_t RESERVED_6[56]; - __IO uint32_t EICHD6_WORD0; /**< Error Injection Channel Descriptor 6, Word0, offset: 0x280 */ - __IO uint32_t EICHD6_WORD1; /**< Error Injection Channel Descriptor 6, Word1, offset: 0x284 */ - uint8_t RESERVED_7[56]; - __IO uint32_t EICHD7_WORD0; /**< Error Injection Channel Descriptor 7, Word0, offset: 0x2C0 */ - __IO uint32_t EICHD7_WORD1; /**< Error Injection Channel Descriptor 7, Word1, offset: 0x2C4 */ - uint8_t RESERVED_8[56]; - __IO uint32_t EICHD8_WORD0; /**< Error Injection Channel Descriptor 8, Word0, offset: 0x300 */ - __IO uint32_t EICHD8_WORD1; /**< Error Injection Channel Descriptor 8, Word1, offset: 0x304 */ -} EIM_Type; - -/* ---------------------------------------------------------------------------- - -- EIM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup EIM_Register_Masks EIM Register Masks - * @{ - */ - -/*! @name EIMCR - Error Injection Module Configuration Register */ -/*! @{ */ - -#define EIM_EIMCR_GEIEN_MASK (0x1U) -#define EIM_EIMCR_GEIEN_SHIFT (0U) -/*! GEIEN - Global Error Injection Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EIM_EIMCR_GEIEN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EIMCR_GEIEN_SHIFT)) & EIM_EIMCR_GEIEN_MASK) -/*! @} */ - -/*! @name EICHEN - Error Injection Channel Enable register */ -/*! @{ */ - -#define EIM_EICHEN_EICH8EN_MASK (0x800000U) -#define EIM_EICHEN_EICH8EN_SHIFT (23U) -/*! EICH8EN - Error Injection Channel 8 Enable - * 0b0..Error injection is disabled on Error Injection Channel 8 - * 0b1..Error injection is enabled on Error Injection Channel 8 - */ -#define EIM_EICHEN_EICH8EN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHEN_EICH8EN_SHIFT)) & EIM_EICHEN_EICH8EN_MASK) - -#define EIM_EICHEN_EICH7EN_MASK (0x1000000U) -#define EIM_EICHEN_EICH7EN_SHIFT (24U) -/*! EICH7EN - Error Injection Channel 7 Enable - * 0b0..Error injection is disabled on Error Injection Channel 7 - * 0b1..Error injection is enabled on Error Injection Channel 7 - */ -#define EIM_EICHEN_EICH7EN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHEN_EICH7EN_SHIFT)) & EIM_EICHEN_EICH7EN_MASK) - -#define EIM_EICHEN_EICH6EN_MASK (0x2000000U) -#define EIM_EICHEN_EICH6EN_SHIFT (25U) -/*! EICH6EN - Error Injection Channel 6 Enable - * 0b0..Error injection is disabled on Error Injection Channel 6 - * 0b1..Error injection is enabled on Error Injection Channel 6 - */ -#define EIM_EICHEN_EICH6EN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHEN_EICH6EN_SHIFT)) & EIM_EICHEN_EICH6EN_MASK) - -#define EIM_EICHEN_EICH5EN_MASK (0x4000000U) -#define EIM_EICHEN_EICH5EN_SHIFT (26U) -/*! EICH5EN - Error Injection Channel 5 Enable - * 0b0..Error injection is disabled on Error Injection Channel 5 - * 0b1..Error injection is enabled on Error Injection Channel 5 - */ -#define EIM_EICHEN_EICH5EN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHEN_EICH5EN_SHIFT)) & EIM_EICHEN_EICH5EN_MASK) - -#define EIM_EICHEN_EICH4EN_MASK (0x8000000U) -#define EIM_EICHEN_EICH4EN_SHIFT (27U) -/*! EICH4EN - Error Injection Channel 4 Enable - * 0b0..Error injection is disabled on Error Injection Channel 4 - * 0b1..Error injection is enabled on Error Injection Channel 4 - */ -#define EIM_EICHEN_EICH4EN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHEN_EICH4EN_SHIFT)) & EIM_EICHEN_EICH4EN_MASK) - -#define EIM_EICHEN_EICH3EN_MASK (0x10000000U) -#define EIM_EICHEN_EICH3EN_SHIFT (28U) -/*! EICH3EN - Error Injection Channel 3 Enable - * 0b0..Error injection is disabled on Error Injection Channel 3 - * 0b1..Error injection is enabled on Error Injection Channel 3 - */ -#define EIM_EICHEN_EICH3EN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHEN_EICH3EN_SHIFT)) & EIM_EICHEN_EICH3EN_MASK) - -#define EIM_EICHEN_EICH2EN_MASK (0x20000000U) -#define EIM_EICHEN_EICH2EN_SHIFT (29U) -/*! EICH2EN - Error Injection Channel 2 Enable - * 0b0..Error injection is disabled on Error Injection Channel 2 - * 0b1..Error injection is enabled on Error Injection Channel 2 - */ -#define EIM_EICHEN_EICH2EN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHEN_EICH2EN_SHIFT)) & EIM_EICHEN_EICH2EN_MASK) - -#define EIM_EICHEN_EICH1EN_MASK (0x40000000U) -#define EIM_EICHEN_EICH1EN_SHIFT (30U) -/*! EICH1EN - Error Injection Channel 1 Enable - * 0b0..Error injection is disabled on Error Injection Channel 1 - * 0b1..Error injection is enabled on Error Injection Channel 1 - */ -#define EIM_EICHEN_EICH1EN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHEN_EICH1EN_SHIFT)) & EIM_EICHEN_EICH1EN_MASK) - -#define EIM_EICHEN_EICH0EN_MASK (0x80000000U) -#define EIM_EICHEN_EICH0EN_SHIFT (31U) -/*! EICH0EN - Error Injection Channel 0 Enable - * 0b0..Error injection is disabled on Error Injection Channel 0 - * 0b1..Error injection is enabled on Error Injection Channel 0 - */ -#define EIM_EICHEN_EICH0EN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHEN_EICH0EN_SHIFT)) & EIM_EICHEN_EICH0EN_MASK) -/*! @} */ - -/*! @name EICHD0_WORD0 - Error Injection Channel Descriptor 0, Word0 */ -/*! @{ */ - -#define EIM_EICHD0_WORD0_CHKBIT_MASK_MASK (0xFE000000U) -#define EIM_EICHD0_WORD0_CHKBIT_MASK_SHIFT (25U) -/*! CHKBIT_MASK - Checkbit Mask */ -#define EIM_EICHD0_WORD0_CHKBIT_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD0_WORD0_CHKBIT_MASK_SHIFT)) & EIM_EICHD0_WORD0_CHKBIT_MASK_MASK) -/*! @} */ - -/*! @name EICHD0_WORD1 - Error Injection Channel Descriptor 0, Word1 */ -/*! @{ */ - -#define EIM_EICHD0_WORD1_B0_3DATA_MASK_MASK (0xFFFFFFFFU) -#define EIM_EICHD0_WORD1_B0_3DATA_MASK_SHIFT (0U) -/*! B0_3DATA_MASK - Data Mask Bytes 0-3 */ -#define EIM_EICHD0_WORD1_B0_3DATA_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD0_WORD1_B0_3DATA_MASK_SHIFT)) & EIM_EICHD0_WORD1_B0_3DATA_MASK_MASK) -/*! @} */ - -/*! @name EICHD1_WORD0 - Error Injection Channel Descriptor 1, Word0 */ -/*! @{ */ - -#define EIM_EICHD1_WORD0_CHKBIT_MASK_MASK (0xFE000000U) -#define EIM_EICHD1_WORD0_CHKBIT_MASK_SHIFT (25U) -/*! CHKBIT_MASK - Checkbit Mask */ -#define EIM_EICHD1_WORD0_CHKBIT_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD1_WORD0_CHKBIT_MASK_SHIFT)) & EIM_EICHD1_WORD0_CHKBIT_MASK_MASK) -/*! @} */ - -/*! @name EICHD1_WORD1 - Error Injection Channel Descriptor 1, Word1 */ -/*! @{ */ - -#define EIM_EICHD1_WORD1_B0_3DATA_MASK_MASK (0xFFFFFFFFU) -#define EIM_EICHD1_WORD1_B0_3DATA_MASK_SHIFT (0U) -/*! B0_3DATA_MASK - Data Mask Bytes 0-3 */ -#define EIM_EICHD1_WORD1_B0_3DATA_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD1_WORD1_B0_3DATA_MASK_SHIFT)) & EIM_EICHD1_WORD1_B0_3DATA_MASK_MASK) -/*! @} */ - -/*! @name EICHD2_WORD0 - Error Injection Channel Descriptor 2, Word0 */ -/*! @{ */ - -#define EIM_EICHD2_WORD0_CHKBIT_MASK_MASK (0xFE000000U) -#define EIM_EICHD2_WORD0_CHKBIT_MASK_SHIFT (25U) -/*! CHKBIT_MASK - Checkbit Mask */ -#define EIM_EICHD2_WORD0_CHKBIT_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD2_WORD0_CHKBIT_MASK_SHIFT)) & EIM_EICHD2_WORD0_CHKBIT_MASK_MASK) -/*! @} */ - -/*! @name EICHD2_WORD1 - Error Injection Channel Descriptor 2, Word1 */ -/*! @{ */ - -#define EIM_EICHD2_WORD1_B0_3DATA_MASK_MASK (0xFFFFFFFFU) -#define EIM_EICHD2_WORD1_B0_3DATA_MASK_SHIFT (0U) -/*! B0_3DATA_MASK - Data Mask Bytes 0-3 */ -#define EIM_EICHD2_WORD1_B0_3DATA_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD2_WORD1_B0_3DATA_MASK_SHIFT)) & EIM_EICHD2_WORD1_B0_3DATA_MASK_MASK) -/*! @} */ - -/*! @name EICHD3_WORD0 - Error Injection Channel Descriptor 3, Word0 */ -/*! @{ */ - -#define EIM_EICHD3_WORD0_CHKBIT_MASK_MASK (0xFE000000U) -#define EIM_EICHD3_WORD0_CHKBIT_MASK_SHIFT (25U) -/*! CHKBIT_MASK - Checkbit Mask */ -#define EIM_EICHD3_WORD0_CHKBIT_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD3_WORD0_CHKBIT_MASK_SHIFT)) & EIM_EICHD3_WORD0_CHKBIT_MASK_MASK) -/*! @} */ - -/*! @name EICHD3_WORD1 - Error Injection Channel Descriptor 3, Word1 */ -/*! @{ */ - -#define EIM_EICHD3_WORD1_B0_3DATA_MASK_MASK (0xFFFFFFFFU) -#define EIM_EICHD3_WORD1_B0_3DATA_MASK_SHIFT (0U) -/*! B0_3DATA_MASK - Data Mask Bytes 0-3 */ -#define EIM_EICHD3_WORD1_B0_3DATA_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD3_WORD1_B0_3DATA_MASK_SHIFT)) & EIM_EICHD3_WORD1_B0_3DATA_MASK_MASK) -/*! @} */ - -/*! @name EICHD4_WORD0 - Error Injection Channel Descriptor 4, Word0 */ -/*! @{ */ - -#define EIM_EICHD4_WORD0_CHKBIT_MASK_MASK (0xFE000000U) -#define EIM_EICHD4_WORD0_CHKBIT_MASK_SHIFT (25U) -/*! CHKBIT_MASK - Checkbit Mask */ -#define EIM_EICHD4_WORD0_CHKBIT_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD4_WORD0_CHKBIT_MASK_SHIFT)) & EIM_EICHD4_WORD0_CHKBIT_MASK_MASK) -/*! @} */ - -/*! @name EICHD4_WORD1 - Error Injection Channel Descriptor 4, Word1 */ -/*! @{ */ - -#define EIM_EICHD4_WORD1_B0_3DATA_MASK_MASK (0xFFFFFFFFU) -#define EIM_EICHD4_WORD1_B0_3DATA_MASK_SHIFT (0U) -/*! B0_3DATA_MASK - Data Mask Bytes 0-3 */ -#define EIM_EICHD4_WORD1_B0_3DATA_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD4_WORD1_B0_3DATA_MASK_SHIFT)) & EIM_EICHD4_WORD1_B0_3DATA_MASK_MASK) -/*! @} */ - -/*! @name EICHD5_WORD0 - Error Injection Channel Descriptor 5, Word0 */ -/*! @{ */ - -#define EIM_EICHD5_WORD0_CHKBIT_MASK_MASK (0xFE000000U) -#define EIM_EICHD5_WORD0_CHKBIT_MASK_SHIFT (25U) -/*! CHKBIT_MASK - Checkbit Mask */ -#define EIM_EICHD5_WORD0_CHKBIT_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD5_WORD0_CHKBIT_MASK_SHIFT)) & EIM_EICHD5_WORD0_CHKBIT_MASK_MASK) -/*! @} */ - -/*! @name EICHD5_WORD1 - Error Injection Channel Descriptor 5, Word1 */ -/*! @{ */ - -#define EIM_EICHD5_WORD1_B0_3DATA_MASK_MASK (0xFFFFFFFFU) -#define EIM_EICHD5_WORD1_B0_3DATA_MASK_SHIFT (0U) -/*! B0_3DATA_MASK - Data Mask Bytes 0-3 */ -#define EIM_EICHD5_WORD1_B0_3DATA_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD5_WORD1_B0_3DATA_MASK_SHIFT)) & EIM_EICHD5_WORD1_B0_3DATA_MASK_MASK) -/*! @} */ - -/*! @name EICHD6_WORD0 - Error Injection Channel Descriptor 6, Word0 */ -/*! @{ */ - -#define EIM_EICHD6_WORD0_CHKBIT_MASK_MASK (0xFE000000U) -#define EIM_EICHD6_WORD0_CHKBIT_MASK_SHIFT (25U) -/*! CHKBIT_MASK - Checkbit Mask */ -#define EIM_EICHD6_WORD0_CHKBIT_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD6_WORD0_CHKBIT_MASK_SHIFT)) & EIM_EICHD6_WORD0_CHKBIT_MASK_MASK) -/*! @} */ - -/*! @name EICHD6_WORD1 - Error Injection Channel Descriptor 6, Word1 */ -/*! @{ */ - -#define EIM_EICHD6_WORD1_B0_3DATA_MASK_MASK (0xFFFFFFFFU) -#define EIM_EICHD6_WORD1_B0_3DATA_MASK_SHIFT (0U) -/*! B0_3DATA_MASK - Data Mask Bytes 0-3 */ -#define EIM_EICHD6_WORD1_B0_3DATA_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD6_WORD1_B0_3DATA_MASK_SHIFT)) & EIM_EICHD6_WORD1_B0_3DATA_MASK_MASK) -/*! @} */ - -/*! @name EICHD7_WORD0 - Error Injection Channel Descriptor 7, Word0 */ -/*! @{ */ - -#define EIM_EICHD7_WORD0_CHKBIT_MASK_MASK (0x80000000U) -#define EIM_EICHD7_WORD0_CHKBIT_MASK_SHIFT (31U) -/*! CHKBIT_MASK - Checkbit Mask */ -#define EIM_EICHD7_WORD0_CHKBIT_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD7_WORD0_CHKBIT_MASK_SHIFT)) & EIM_EICHD7_WORD0_CHKBIT_MASK_MASK) -/*! @} */ - -/*! @name EICHD7_WORD1 - Error Injection Channel Descriptor 7, Word1 */ -/*! @{ */ - -#define EIM_EICHD7_WORD1_B0_3DATA_MASK_MASK (0xFFFFFFFFU) -#define EIM_EICHD7_WORD1_B0_3DATA_MASK_SHIFT (0U) -/*! B0_3DATA_MASK - Data Mask Bytes 0-3 */ -#define EIM_EICHD7_WORD1_B0_3DATA_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD7_WORD1_B0_3DATA_MASK_SHIFT)) & EIM_EICHD7_WORD1_B0_3DATA_MASK_MASK) -/*! @} */ - -/*! @name EICHD8_WORD0 - Error Injection Channel Descriptor 8, Word0 */ -/*! @{ */ - -#define EIM_EICHD8_WORD0_CHKBIT_MASK_MASK (0xF0000000U) -#define EIM_EICHD8_WORD0_CHKBIT_MASK_SHIFT (28U) -/*! CHKBIT_MASK - Checkbit Mask */ -#define EIM_EICHD8_WORD0_CHKBIT_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD8_WORD0_CHKBIT_MASK_SHIFT)) & EIM_EICHD8_WORD0_CHKBIT_MASK_MASK) -/*! @} */ - -/*! @name EICHD8_WORD1 - Error Injection Channel Descriptor 8, Word1 */ -/*! @{ */ - -#define EIM_EICHD8_WORD1_B0_3DATA_MASK_MASK (0xFFFFFFFFU) -#define EIM_EICHD8_WORD1_B0_3DATA_MASK_SHIFT (0U) -/*! B0_3DATA_MASK - Data Mask Bytes 0-3 */ -#define EIM_EICHD8_WORD1_B0_3DATA_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD8_WORD1_B0_3DATA_MASK_SHIFT)) & EIM_EICHD8_WORD1_B0_3DATA_MASK_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group EIM_Register_Masks */ - - -/* EIM - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral EIM0 base address */ - #define EIM0_BASE (0x5005B000u) - /** Peripheral EIM0 base address */ - #define EIM0_BASE_NS (0x4005B000u) - /** Peripheral EIM0 base pointer */ - #define EIM0 ((EIM_Type *)EIM0_BASE) - /** Peripheral EIM0 base pointer */ - #define EIM0_NS ((EIM_Type *)EIM0_BASE_NS) - /** Array initializer of EIM peripheral base addresses */ - #define EIM_BASE_ADDRS { EIM0_BASE } - /** Array initializer of EIM peripheral base pointers */ - #define EIM_BASE_PTRS { EIM0 } - /** Array initializer of EIM peripheral base addresses */ - #define EIM_BASE_ADDRS_NS { EIM0_BASE_NS } - /** Array initializer of EIM peripheral base pointers */ - #define EIM_BASE_PTRS_NS { EIM0_NS } -#else - /** Peripheral EIM0 base address */ - #define EIM0_BASE (0x4005B000u) - /** Peripheral EIM0 base pointer */ - #define EIM0 ((EIM_Type *)EIM0_BASE) - /** Array initializer of EIM peripheral base addresses */ - #define EIM_BASE_ADDRS { EIM0_BASE } - /** Array initializer of EIM peripheral base pointers */ - #define EIM_BASE_PTRS { EIM0 } -#endif - -/*! - * @} - */ /* end of group EIM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- EMVSIM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup EMVSIM_Peripheral_Access_Layer EMVSIM Peripheral Access Layer - * @{ - */ - -/** EMVSIM - Register Layout Typedef */ -typedef struct { - __I uint32_t VER_ID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameters, offset: 0x4 */ - __IO uint32_t CLKCFG; /**< Clock Configuration, offset: 0x8 */ - __IO uint32_t DIVISOR; /**< Baud Rate Divisor, offset: 0xC */ - __IO uint32_t CTRL; /**< Control, offset: 0x10 */ - __IO uint32_t INT_MASK; /**< Interrupt Mask, offset: 0x14 */ - __IO uint32_t RX_THD; /**< Receiver Threshold, offset: 0x18 */ - __IO uint32_t TX_THD; /**< Transmitter Threshold, offset: 0x1C */ - __IO uint32_t RX_STATUS; /**< Receive Status, offset: 0x20 */ - __IO uint32_t TX_STATUS; /**< Transmitter Status, offset: 0x24 */ - __IO uint32_t PCSR; /**< Port Control and Status, offset: 0x28 */ - __I uint32_t RX_BUF; /**< Receive Data Read Buffer, offset: 0x2C */ - __O uint32_t TX_BUF; /**< Transmit Data Buffer, offset: 0x30 */ - __IO uint32_t TX_GETU; /**< Transmitter Guard ETU Value, offset: 0x34 */ - __IO uint32_t CWT_VAL; /**< Character Wait Time Value, offset: 0x38 */ - __IO uint32_t BWT_VAL; /**< Block Wait Time Value, offset: 0x3C */ - __IO uint32_t BGT_VAL; /**< Block Guard Time Value, offset: 0x40 */ - __IO uint32_t GPCNT0_VAL; /**< General Purpose Counter 0 Timeout Value, offset: 0x44 */ - __IO uint32_t GPCNT1_VAL; /**< General Purpose Counter 1 Timeout Value, offset: 0x48 */ -} EMVSIM_Type; - -/* ---------------------------------------------------------------------------- - -- EMVSIM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup EMVSIM_Register_Masks EMVSIM Register Masks - * @{ - */ - -/*! @name VER_ID - Version ID */ -/*! @{ */ - -#define EMVSIM_VER_ID_VER_MASK (0xFFFFFFFFU) -#define EMVSIM_VER_ID_VER_SHIFT (0U) -/*! VER - Version ID */ -#define EMVSIM_VER_ID_VER(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_VER_ID_VER_SHIFT)) & EMVSIM_VER_ID_VER_MASK) -/*! @} */ - -/*! @name PARAM - Parameters */ -/*! @{ */ - -#define EMVSIM_PARAM_RX_FIFO_DEPTH_MASK (0xFFU) -#define EMVSIM_PARAM_RX_FIFO_DEPTH_SHIFT (0U) -/*! RX_FIFO_DEPTH - Receive FIFO Depth */ -#define EMVSIM_PARAM_RX_FIFO_DEPTH(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_PARAM_RX_FIFO_DEPTH_SHIFT)) & EMVSIM_PARAM_RX_FIFO_DEPTH_MASK) - -#define EMVSIM_PARAM_TX_FIFO_DEPTH_MASK (0xFF00U) -#define EMVSIM_PARAM_TX_FIFO_DEPTH_SHIFT (8U) -/*! TX_FIFO_DEPTH - Transmit FIFO Depth */ -#define EMVSIM_PARAM_TX_FIFO_DEPTH(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_PARAM_TX_FIFO_DEPTH_SHIFT)) & EMVSIM_PARAM_TX_FIFO_DEPTH_MASK) -/*! @} */ - -/*! @name CLKCFG - Clock Configuration */ -/*! @{ */ - -#define EMVSIM_CLKCFG_CLK_PRSC_MASK (0xFFU) -#define EMVSIM_CLKCFG_CLK_PRSC_SHIFT (0U) -/*! CLK_PRSC - Clock Prescaler Value */ -#define EMVSIM_CLKCFG_CLK_PRSC(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CLKCFG_CLK_PRSC_SHIFT)) & EMVSIM_CLKCFG_CLK_PRSC_MASK) - -#define EMVSIM_CLKCFG_GPCNT1_CLK_SEL_MASK (0x300U) -#define EMVSIM_CLKCFG_GPCNT1_CLK_SEL_SHIFT (8U) -/*! GPCNT1_CLK_SEL - General Purpose Counter 1 Clock Select - * 0b00..Disable/reset - * 0b01..Card clock - * 0b10..Receive clock - * 0b11..ETU clock (transmit clock) - */ -#define EMVSIM_CLKCFG_GPCNT1_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CLKCFG_GPCNT1_CLK_SEL_SHIFT)) & EMVSIM_CLKCFG_GPCNT1_CLK_SEL_MASK) - -#define EMVSIM_CLKCFG_GPCNT0_CLK_SEL_MASK (0xC00U) -#define EMVSIM_CLKCFG_GPCNT0_CLK_SEL_SHIFT (10U) -/*! GPCNT0_CLK_SEL - General Purpose Counter 0 Clock Select - * 0b00..Disable/reset - * 0b01..Card clock - * 0b10..Receive clock - * 0b11..ETU clock (transmit clock) - */ -#define EMVSIM_CLKCFG_GPCNT0_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CLKCFG_GPCNT0_CLK_SEL_SHIFT)) & EMVSIM_CLKCFG_GPCNT0_CLK_SEL_MASK) -/*! @} */ - -/*! @name DIVISOR - Baud Rate Divisor */ -/*! @{ */ - -#define EMVSIM_DIVISOR_DIVISOR_VALUE_MASK (0x1FFU) -#define EMVSIM_DIVISOR_DIVISOR_VALUE_SHIFT (0U) -/*! DIVISOR_VALUE - Divisor (F/D) Value - * 0b000000000-0b000000100..Invalid. As per ISO 7816 specification, the minimum value of F/D is 5. - * 0b000000101-0b011111111..Divisor value F/D - */ -#define EMVSIM_DIVISOR_DIVISOR_VALUE(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_DIVISOR_DIVISOR_VALUE_SHIFT)) & EMVSIM_DIVISOR_DIVISOR_VALUE_MASK) -/*! @} */ - -/*! @name CTRL - Control */ -/*! @{ */ - -#define EMVSIM_CTRL_IC_MASK (0x1U) -#define EMVSIM_CTRL_IC_SHIFT (0U) -/*! IC - Inverse Convention - * 0b0..Direct - * 0b1..Inverse - */ -#define EMVSIM_CTRL_IC(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_IC_SHIFT)) & EMVSIM_CTRL_IC_MASK) - -#define EMVSIM_CTRL_ICM_MASK (0x2U) -#define EMVSIM_CTRL_ICM_SHIFT (1U) -/*! ICM - Initial Character Mode - * 0b0..Disable - * 0b1..Enable - */ -#define EMVSIM_CTRL_ICM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_ICM_SHIFT)) & EMVSIM_CTRL_ICM_MASK) - -#define EMVSIM_CTRL_ANACK_MASK (0x4U) -#define EMVSIM_CTRL_ANACK_SHIFT (2U) -/*! ANACK - Auto NACK Enable - * 0b0..Disable - * 0b1..Enable - */ -#define EMVSIM_CTRL_ANACK(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_ANACK_SHIFT)) & EMVSIM_CTRL_ANACK_MASK) - -#define EMVSIM_CTRL_ONACK_MASK (0x8U) -#define EMVSIM_CTRL_ONACK_SHIFT (3U) -/*! ONACK - Overrun NACK Enable - * 0b0..Disable - * 0b1..Enable - */ -#define EMVSIM_CTRL_ONACK(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_ONACK_SHIFT)) & EMVSIM_CTRL_ONACK_MASK) - -#define EMVSIM_CTRL_FLSH_RX_MASK (0x100U) -#define EMVSIM_CTRL_FLSH_RX_SHIFT (8U) -/*! FLSH_RX - Flush Receiver - * 0b0..Normal - * 0b1..Reset - */ -#define EMVSIM_CTRL_FLSH_RX(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_FLSH_RX_SHIFT)) & EMVSIM_CTRL_FLSH_RX_MASK) - -#define EMVSIM_CTRL_FLSH_TX_MASK (0x200U) -#define EMVSIM_CTRL_FLSH_TX_SHIFT (9U) -/*! FLSH_TX - Flush Transmitter - * 0b0..Normal - * 0b1..Reset - */ -#define EMVSIM_CTRL_FLSH_TX(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_FLSH_TX_SHIFT)) & EMVSIM_CTRL_FLSH_TX_MASK) - -#define EMVSIM_CTRL_SW_RST_MASK (0x400U) -#define EMVSIM_CTRL_SW_RST_SHIFT (10U) -/*! SW_RST - Software Reset - * 0b0..Normal - * 0b1..Reset - */ -#define EMVSIM_CTRL_SW_RST(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_SW_RST_SHIFT)) & EMVSIM_CTRL_SW_RST_MASK) - -#define EMVSIM_CTRL_KILL_CLOCKS_MASK (0x800U) -#define EMVSIM_CTRL_KILL_CLOCKS_SHIFT (11U) -/*! KILL_CLOCKS - Kill Internal Clocks - * 0b0..Enable - * 0b1..Disable - */ -#define EMVSIM_CTRL_KILL_CLOCKS(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_KILL_CLOCKS_SHIFT)) & EMVSIM_CTRL_KILL_CLOCKS_MASK) - -#define EMVSIM_CTRL_DOZE_EN_MASK (0x1000U) -#define EMVSIM_CTRL_DOZE_EN_SHIFT (12U) -/*! DOZE_EN - Doze Enable - * 0b0..Disable - * 0b1..Enable - */ -#define EMVSIM_CTRL_DOZE_EN(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_DOZE_EN_SHIFT)) & EMVSIM_CTRL_DOZE_EN_MASK) - -#define EMVSIM_CTRL_STOP_EN_MASK (0x2000U) -#define EMVSIM_CTRL_STOP_EN_SHIFT (13U) -/*! STOP_EN - STOP Enable - * 0b0..Disable - * 0b1..Enable - */ -#define EMVSIM_CTRL_STOP_EN(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_STOP_EN_SHIFT)) & EMVSIM_CTRL_STOP_EN_MASK) - -#define EMVSIM_CTRL_RCV_EN_MASK (0x10000U) -#define EMVSIM_CTRL_RCV_EN_SHIFT (16U) -/*! RCV_EN - Receiver Enable - * 0b0..Disable - * 0b1..Enable - */ -#define EMVSIM_CTRL_RCV_EN(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_RCV_EN_SHIFT)) & EMVSIM_CTRL_RCV_EN_MASK) - -#define EMVSIM_CTRL_XMT_EN_MASK (0x20000U) -#define EMVSIM_CTRL_XMT_EN_SHIFT (17U) -/*! XMT_EN - Transmitter Enable - * 0b0..Disable - * 0b1..Enable - */ -#define EMVSIM_CTRL_XMT_EN(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_XMT_EN_SHIFT)) & EMVSIM_CTRL_XMT_EN_MASK) - -#define EMVSIM_CTRL_RCVR_11_MASK (0x40000U) -#define EMVSIM_CTRL_RCVR_11_SHIFT (18U) -/*! RCVR_11 - Receiver 11 ETU Mode Enable - * 0b0..12 ETU operation - * 0b1..11 ETU operation - */ -#define EMVSIM_CTRL_RCVR_11(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_RCVR_11_SHIFT)) & EMVSIM_CTRL_RCVR_11_MASK) - -#define EMVSIM_CTRL_RX_DMA_EN_MASK (0x80000U) -#define EMVSIM_CTRL_RX_DMA_EN_SHIFT (19U) -/*! RX_DMA_EN - Receive DMA Enable - * 0b0..Not asserted - * 0b1..Asserted - */ -#define EMVSIM_CTRL_RX_DMA_EN(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_RX_DMA_EN_SHIFT)) & EMVSIM_CTRL_RX_DMA_EN_MASK) - -#define EMVSIM_CTRL_TX_DMA_EN_MASK (0x100000U) -#define EMVSIM_CTRL_TX_DMA_EN_SHIFT (20U) -/*! TX_DMA_EN - Transmit DMA Enable - * 0b0..Not asserted - * 0b1..Asserted - */ -#define EMVSIM_CTRL_TX_DMA_EN(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_TX_DMA_EN_SHIFT)) & EMVSIM_CTRL_TX_DMA_EN_MASK) - -#define EMVSIM_CTRL_INV_CRC_VAL_MASK (0x1000000U) -#define EMVSIM_CTRL_INV_CRC_VAL_SHIFT (24U) -/*! INV_CRC_VAL - Invert CRC Output Value Bits - * 0b0..Not inverted - * 0b1..Inverted - */ -#define EMVSIM_CTRL_INV_CRC_VAL(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_INV_CRC_VAL_SHIFT)) & EMVSIM_CTRL_INV_CRC_VAL_MASK) - -#define EMVSIM_CTRL_CRC_OUT_FLIP_MASK (0x2000000U) -#define EMVSIM_CTRL_CRC_OUT_FLIP_SHIFT (25U) -/*! CRC_OUT_FLIP - CRC Output Value Bit Reversal Or Flip Control - * 0b0..Not reversed - * 0b1..Reversed - */ -#define EMVSIM_CTRL_CRC_OUT_FLIP(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_CRC_OUT_FLIP_SHIFT)) & EMVSIM_CTRL_CRC_OUT_FLIP_MASK) - -#define EMVSIM_CTRL_CRC_IN_FLIP_MASK (0x4000000U) -#define EMVSIM_CTRL_CRC_IN_FLIP_SHIFT (26U) -/*! CRC_IN_FLIP - CRC Input Byte's Bit Reversal Or Flip Control - * 0b0..Not reversed - * 0b1..Reversed - */ -#define EMVSIM_CTRL_CRC_IN_FLIP(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_CRC_IN_FLIP_SHIFT)) & EMVSIM_CTRL_CRC_IN_FLIP_MASK) - -#define EMVSIM_CTRL_CWT_EN_MASK (0x8000000U) -#define EMVSIM_CTRL_CWT_EN_SHIFT (27U) -/*! CWT_EN - CWT Counter Enable - * 0b0..Disable - * 0b1..Enable - */ -#define EMVSIM_CTRL_CWT_EN(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_CWT_EN_SHIFT)) & EMVSIM_CTRL_CWT_EN_MASK) - -#define EMVSIM_CTRL_LRC_EN_MASK (0x10000000U) -#define EMVSIM_CTRL_LRC_EN_SHIFT (28U) -/*! LRC_EN - LRC Enable - * 0b0..Disable - * 0b1..Enable - */ -#define EMVSIM_CTRL_LRC_EN(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_LRC_EN_SHIFT)) & EMVSIM_CTRL_LRC_EN_MASK) - -#define EMVSIM_CTRL_CRC_EN_MASK (0x20000000U) -#define EMVSIM_CTRL_CRC_EN_SHIFT (29U) -/*! CRC_EN - CRC Enable - * 0b0..Disable - * 0b1..Enable - */ -#define EMVSIM_CTRL_CRC_EN(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_CRC_EN_SHIFT)) & EMVSIM_CTRL_CRC_EN_MASK) - -#define EMVSIM_CTRL_XMT_CRC_LRC_MASK (0x40000000U) -#define EMVSIM_CTRL_XMT_CRC_LRC_SHIFT (30U) -/*! XMT_CRC_LRC - Transmit CRC or LRC Enable - * 0b0..Do not transmit - * 0b1..Transmit - */ -#define EMVSIM_CTRL_XMT_CRC_LRC(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_XMT_CRC_LRC_SHIFT)) & EMVSIM_CTRL_XMT_CRC_LRC_MASK) - -#define EMVSIM_CTRL_BWT_EN_MASK (0x80000000U) -#define EMVSIM_CTRL_BWT_EN_SHIFT (31U) -/*! BWT_EN - Block Wait Time Counter Enable - * 0b0..Disable - * 0b1..Enable - */ -#define EMVSIM_CTRL_BWT_EN(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_BWT_EN_SHIFT)) & EMVSIM_CTRL_BWT_EN_MASK) -/*! @} */ - -/*! @name INT_MASK - Interrupt Mask */ -/*! @{ */ - -#define EMVSIM_INT_MASK_RDT_IM_MASK (0x1U) -#define EMVSIM_INT_MASK_RDT_IM_SHIFT (0U) -/*! RDT_IM - Receive Data Threshold Interrupt Mask - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_RDT_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_RDT_IM_SHIFT)) & EMVSIM_INT_MASK_RDT_IM_MASK) - -#define EMVSIM_INT_MASK_TC_IM_MASK (0x2U) -#define EMVSIM_INT_MASK_TC_IM_SHIFT (1U) -/*! TC_IM - Transmit Complete Interrupt Mask - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_TC_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_TC_IM_SHIFT)) & EMVSIM_INT_MASK_TC_IM_MASK) - -#define EMVSIM_INT_MASK_RFO_IM_MASK (0x4U) -#define EMVSIM_INT_MASK_RFO_IM_SHIFT (2U) -/*! RFO_IM - Receive FIFO Overflow Interrupt Mask - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_RFO_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_RFO_IM_SHIFT)) & EMVSIM_INT_MASK_RFO_IM_MASK) - -#define EMVSIM_INT_MASK_ETC_IM_MASK (0x8U) -#define EMVSIM_INT_MASK_ETC_IM_SHIFT (3U) -/*! ETC_IM - Early Transmit Complete Interrupt Mask - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_ETC_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_ETC_IM_SHIFT)) & EMVSIM_INT_MASK_ETC_IM_MASK) - -#define EMVSIM_INT_MASK_TFE_IM_MASK (0x10U) -#define EMVSIM_INT_MASK_TFE_IM_SHIFT (4U) -/*! TFE_IM - Transmit FIFO Empty Interrupt Mask - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_TFE_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_TFE_IM_SHIFT)) & EMVSIM_INT_MASK_TFE_IM_MASK) - -#define EMVSIM_INT_MASK_TNACK_IM_MASK (0x20U) -#define EMVSIM_INT_MASK_TNACK_IM_SHIFT (5U) -/*! TNACK_IM - Transmit NACK Threshold Interrupt Mask - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_TNACK_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_TNACK_IM_SHIFT)) & EMVSIM_INT_MASK_TNACK_IM_MASK) - -#define EMVSIM_INT_MASK_TFF_IM_MASK (0x40U) -#define EMVSIM_INT_MASK_TFF_IM_SHIFT (6U) -/*! TFF_IM - Transmit FIFO Full Interrupt Mask - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_TFF_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_TFF_IM_SHIFT)) & EMVSIM_INT_MASK_TFF_IM_MASK) - -#define EMVSIM_INT_MASK_TDT_IM_MASK (0x80U) -#define EMVSIM_INT_MASK_TDT_IM_SHIFT (7U) -/*! TDT_IM - Transmit Data Threshold Interrupt Mask - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_TDT_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_TDT_IM_SHIFT)) & EMVSIM_INT_MASK_TDT_IM_MASK) - -#define EMVSIM_INT_MASK_GPCNT0_IM_MASK (0x100U) -#define EMVSIM_INT_MASK_GPCNT0_IM_SHIFT (8U) -/*! GPCNT0_IM - General Purpose Timer 0 Timeout Interrupt Mask - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_GPCNT0_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_GPCNT0_IM_SHIFT)) & EMVSIM_INT_MASK_GPCNT0_IM_MASK) - -#define EMVSIM_INT_MASK_CWT_ERR_IM_MASK (0x200U) -#define EMVSIM_INT_MASK_CWT_ERR_IM_SHIFT (9U) -/*! CWT_ERR_IM - Character Wait Time Error Interrupt Mask - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_CWT_ERR_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_CWT_ERR_IM_SHIFT)) & EMVSIM_INT_MASK_CWT_ERR_IM_MASK) - -#define EMVSIM_INT_MASK_RNACK_IM_MASK (0x400U) -#define EMVSIM_INT_MASK_RNACK_IM_SHIFT (10U) -/*! RNACK_IM - Receiver NACK Threshold Interrupt Mask - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_RNACK_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_RNACK_IM_SHIFT)) & EMVSIM_INT_MASK_RNACK_IM_MASK) - -#define EMVSIM_INT_MASK_BWT_ERR_IM_MASK (0x800U) -#define EMVSIM_INT_MASK_BWT_ERR_IM_SHIFT (11U) -/*! BWT_ERR_IM - Block Wait Time Error Interrupt Mask - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_BWT_ERR_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_BWT_ERR_IM_SHIFT)) & EMVSIM_INT_MASK_BWT_ERR_IM_MASK) - -#define EMVSIM_INT_MASK_BGT_ERR_IM_MASK (0x1000U) -#define EMVSIM_INT_MASK_BGT_ERR_IM_SHIFT (12U) -/*! BGT_ERR_IM - Block Guard Time Error Interrupt - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_BGT_ERR_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_BGT_ERR_IM_SHIFT)) & EMVSIM_INT_MASK_BGT_ERR_IM_MASK) - -#define EMVSIM_INT_MASK_GPCNT1_IM_MASK (0x2000U) -#define EMVSIM_INT_MASK_GPCNT1_IM_SHIFT (13U) -/*! GPCNT1_IM - General Purpose Counter 1 Timeout Interrupt Mask - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_GPCNT1_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_GPCNT1_IM_SHIFT)) & EMVSIM_INT_MASK_GPCNT1_IM_MASK) - -#define EMVSIM_INT_MASK_RX_DATA_IM_MASK (0x4000U) -#define EMVSIM_INT_MASK_RX_DATA_IM_SHIFT (14U) -/*! RX_DATA_IM - Receive Data Interrupt Mask - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_RX_DATA_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_RX_DATA_IM_SHIFT)) & EMVSIM_INT_MASK_RX_DATA_IM_MASK) - -#define EMVSIM_INT_MASK_PEF_IM_MASK (0x8000U) -#define EMVSIM_INT_MASK_PEF_IM_SHIFT (15U) -/*! PEF_IM - Parity Error Interrupt Mask - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_PEF_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_PEF_IM_SHIFT)) & EMVSIM_INT_MASK_PEF_IM_MASK) -/*! @} */ - -/*! @name RX_THD - Receiver Threshold */ -/*! @{ */ - -#define EMVSIM_RX_THD_RDT_MASK (0xFU) -#define EMVSIM_RX_THD_RDT_SHIFT (0U) -/*! RDT - Receiver Data Threshold Value */ -#define EMVSIM_RX_THD_RDT(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_THD_RDT_SHIFT)) & EMVSIM_RX_THD_RDT_MASK) - -#define EMVSIM_RX_THD_RNCK_THD_MASK (0xF00U) -#define EMVSIM_RX_THD_RNCK_THD_SHIFT (8U) -/*! RNCK_THD - Receiver NACK Threshold Value */ -#define EMVSIM_RX_THD_RNCK_THD(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_THD_RNCK_THD_SHIFT)) & EMVSIM_RX_THD_RNCK_THD_MASK) -/*! @} */ - -/*! @name TX_THD - Transmitter Threshold */ -/*! @{ */ - -#define EMVSIM_TX_THD_TDT_MASK (0xFU) -#define EMVSIM_TX_THD_TDT_SHIFT (0U) -/*! TDT - Transmitter Data Threshold Value */ -#define EMVSIM_TX_THD_TDT(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_TX_THD_TDT_SHIFT)) & EMVSIM_TX_THD_TDT_MASK) - -#define EMVSIM_TX_THD_TNCK_THD_MASK (0xF00U) -#define EMVSIM_TX_THD_TNCK_THD_SHIFT (8U) -/*! TNCK_THD - Transmitter NACK Threshold Value */ -#define EMVSIM_TX_THD_TNCK_THD(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_TX_THD_TNCK_THD_SHIFT)) & EMVSIM_TX_THD_TNCK_THD_MASK) -/*! @} */ - -/*! @name RX_STATUS - Receive Status */ -/*! @{ */ - -#define EMVSIM_RX_STATUS_RFO_MASK (0x1U) -#define EMVSIM_RX_STATUS_RFO_SHIFT (0U) -/*! RFO - Receive FIFO Overflow Flag - * 0b0..No overrun error - * 0b1..Overrun error - */ -#define EMVSIM_RX_STATUS_RFO(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_STATUS_RFO_SHIFT)) & EMVSIM_RX_STATUS_RFO_MASK) - -#define EMVSIM_RX_STATUS_RX_DATA_MASK (0x10U) -#define EMVSIM_RX_STATUS_RX_DATA_SHIFT (4U) -/*! RX_DATA - Receive Data Interrupt Flag - * 0b0..No new byte - * 0b1..New byte - */ -#define EMVSIM_RX_STATUS_RX_DATA(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_STATUS_RX_DATA_SHIFT)) & EMVSIM_RX_STATUS_RX_DATA_MASK) - -#define EMVSIM_RX_STATUS_RDTF_MASK (0x20U) -#define EMVSIM_RX_STATUS_RDTF_SHIFT (5U) -/*! RDTF - Receive Data Threshold Interrupt Flag - * 0b0..Less than threshold - * 0b1..Greater than or equal to threshold - */ -#define EMVSIM_RX_STATUS_RDTF(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_STATUS_RDTF_SHIFT)) & EMVSIM_RX_STATUS_RDTF_MASK) - -#define EMVSIM_RX_STATUS_LRC_OK_MASK (0x40U) -#define EMVSIM_RX_STATUS_LRC_OK_SHIFT (6U) -/*! LRC_OK - LRC Check OK Flag - * 0b0..No match - * 0b1..Match - */ -#define EMVSIM_RX_STATUS_LRC_OK(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_STATUS_LRC_OK_SHIFT)) & EMVSIM_RX_STATUS_LRC_OK_MASK) - -#define EMVSIM_RX_STATUS_CRC_OK_MASK (0x80U) -#define EMVSIM_RX_STATUS_CRC_OK_SHIFT (7U) -/*! CRC_OK - CRC Check OK Flag - * 0b0..Current CRC value does not match remainder. - * 0b1..Current calculated CRC value matches the expected result. - */ -#define EMVSIM_RX_STATUS_CRC_OK(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_STATUS_CRC_OK_SHIFT)) & EMVSIM_RX_STATUS_CRC_OK_MASK) - -#define EMVSIM_RX_STATUS_CWT_ERR_MASK (0x100U) -#define EMVSIM_RX_STATUS_CWT_ERR_SHIFT (8U) -/*! CWT_ERR - Character Wait Time Error Flag - * 0b0..No CWT violation - * 0b1..CWT violation - */ -#define EMVSIM_RX_STATUS_CWT_ERR(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_STATUS_CWT_ERR_SHIFT)) & EMVSIM_RX_STATUS_CWT_ERR_MASK) - -#define EMVSIM_RX_STATUS_RTE_MASK (0x200U) -#define EMVSIM_RX_STATUS_RTE_SHIFT (9U) -/*! RTE - Received NACK Threshold Error Flag - * 0b0..Less than - * 0b1..Equal to - */ -#define EMVSIM_RX_STATUS_RTE(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_STATUS_RTE_SHIFT)) & EMVSIM_RX_STATUS_RTE_MASK) - -#define EMVSIM_RX_STATUS_BWT_ERR_MASK (0x400U) -#define EMVSIM_RX_STATUS_BWT_ERR_SHIFT (10U) -/*! BWT_ERR - Block Wait Time Error Flag - * 0b0..Not exceeded - * 0b1..Exceeded - */ -#define EMVSIM_RX_STATUS_BWT_ERR(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_STATUS_BWT_ERR_SHIFT)) & EMVSIM_RX_STATUS_BWT_ERR_MASK) - -#define EMVSIM_RX_STATUS_BGT_ERR_MASK (0x800U) -#define EMVSIM_RX_STATUS_BGT_ERR_SHIFT (11U) -/*! BGT_ERR - Block Guard Time Error Flag - * 0b0..Sufficient - * 0b1..Too small - */ -#define EMVSIM_RX_STATUS_BGT_ERR(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_STATUS_BGT_ERR_SHIFT)) & EMVSIM_RX_STATUS_BGT_ERR_MASK) - -#define EMVSIM_RX_STATUS_PEF_MASK (0x1000U) -#define EMVSIM_RX_STATUS_PEF_SHIFT (12U) -/*! PEF - Parity Error Flag - * 0b0..No error - * 0b1..Error - */ -#define EMVSIM_RX_STATUS_PEF(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_STATUS_PEF_SHIFT)) & EMVSIM_RX_STATUS_PEF_MASK) - -#define EMVSIM_RX_STATUS_FEF_MASK (0x2000U) -#define EMVSIM_RX_STATUS_FEF_SHIFT (13U) -/*! FEF - Frame Error Flag - * 0b0..No error - * 0b1..Error - */ -#define EMVSIM_RX_STATUS_FEF(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_STATUS_FEF_SHIFT)) & EMVSIM_RX_STATUS_FEF_MASK) - -#define EMVSIM_RX_STATUS_RX_WPTR_MASK (0xF0000U) -#define EMVSIM_RX_STATUS_RX_WPTR_SHIFT (16U) -/*! RX_WPTR - Receive FIFO Write Pointer Value */ -#define EMVSIM_RX_STATUS_RX_WPTR(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_STATUS_RX_WPTR_SHIFT)) & EMVSIM_RX_STATUS_RX_WPTR_MASK) - -#define EMVSIM_RX_STATUS_RX_CNT_MASK (0xF000000U) -#define EMVSIM_RX_STATUS_RX_CNT_SHIFT (24U) -/*! RX_CNT - Receive FIFO Byte Count - * 0b0000..FIFO empty - */ -#define EMVSIM_RX_STATUS_RX_CNT(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_STATUS_RX_CNT_SHIFT)) & EMVSIM_RX_STATUS_RX_CNT_MASK) -/*! @} */ - -/*! @name TX_STATUS - Transmitter Status */ -/*! @{ */ - -#define EMVSIM_TX_STATUS_TNTE_MASK (0x1U) -#define EMVSIM_TX_STATUS_TNTE_SHIFT (0U) -/*! TNTE - Transmit NACK Threshold Error Flag - * 0b0..Threshold not reached - * 0b1..Threshold reached - */ -#define EMVSIM_TX_STATUS_TNTE(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_TX_STATUS_TNTE_SHIFT)) & EMVSIM_TX_STATUS_TNTE_MASK) - -#define EMVSIM_TX_STATUS_TFE_MASK (0x8U) -#define EMVSIM_TX_STATUS_TFE_SHIFT (3U) -/*! TFE - Transmit FIFO Empty Flag - * 0b0..Not empty - * 0b1..Empty - */ -#define EMVSIM_TX_STATUS_TFE(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_TX_STATUS_TFE_SHIFT)) & EMVSIM_TX_STATUS_TFE_MASK) - -#define EMVSIM_TX_STATUS_ETCF_MASK (0x10U) -#define EMVSIM_TX_STATUS_ETCF_SHIFT (4U) -/*! ETCF - Early Transmit Complete Flag - * 0b0..Pending or incomplete - * 0b1..Complete - */ -#define EMVSIM_TX_STATUS_ETCF(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_TX_STATUS_ETCF_SHIFT)) & EMVSIM_TX_STATUS_ETCF_MASK) - -#define EMVSIM_TX_STATUS_TCF_MASK (0x20U) -#define EMVSIM_TX_STATUS_TCF_SHIFT (5U) -/*! TCF - Transmit Complete Flag - * 0b0..Pending or incomplete - * 0b1..Complete - */ -#define EMVSIM_TX_STATUS_TCF(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_TX_STATUS_TCF_SHIFT)) & EMVSIM_TX_STATUS_TCF_MASK) - -#define EMVSIM_TX_STATUS_TFF_MASK (0x40U) -#define EMVSIM_TX_STATUS_TFF_SHIFT (6U) -/*! TFF - Transmit FIFO Full Flag - * 0b0..Not full - * 0b1..Full - */ -#define EMVSIM_TX_STATUS_TFF(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_TX_STATUS_TFF_SHIFT)) & EMVSIM_TX_STATUS_TFF_MASK) - -#define EMVSIM_TX_STATUS_TDTF_MASK (0x80U) -#define EMVSIM_TX_STATUS_TDTF_SHIFT (7U) -/*! TDTF - Transmit Data Threshold Flag - * 0b0..Threshold exceeded or this field written to 0 - * 0b1..Threshold not exceeded - */ -#define EMVSIM_TX_STATUS_TDTF(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_TX_STATUS_TDTF_SHIFT)) & EMVSIM_TX_STATUS_TDTF_MASK) - -#define EMVSIM_TX_STATUS_GPCNT0_TO_MASK (0x100U) -#define EMVSIM_TX_STATUS_GPCNT0_TO_SHIFT (8U) -/*! GPCNT0_TO - General Purpose Counter 0 Timeout Flag - * 0b0..GPCNT0 not reached, or flag cleared - * 0b1..GPCNT0 reached - */ -#define EMVSIM_TX_STATUS_GPCNT0_TO(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_TX_STATUS_GPCNT0_TO_SHIFT)) & EMVSIM_TX_STATUS_GPCNT0_TO_MASK) - -#define EMVSIM_TX_STATUS_GPCNT1_TO_MASK (0x200U) -#define EMVSIM_TX_STATUS_GPCNT1_TO_SHIFT (9U) -/*! GPCNT1_TO - General Purpose Counter 1 Timeout Flag - * 0b0..GPCNT1 not reached, or flag cleared - * 0b1..GPCNT1 reached - */ -#define EMVSIM_TX_STATUS_GPCNT1_TO(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_TX_STATUS_GPCNT1_TO_SHIFT)) & EMVSIM_TX_STATUS_GPCNT1_TO_MASK) - -#define EMVSIM_TX_STATUS_TX_RPTR_MASK (0xF0000U) -#define EMVSIM_TX_STATUS_TX_RPTR_SHIFT (16U) -/*! TX_RPTR - Transmit FIFO Read Pointer */ -#define EMVSIM_TX_STATUS_TX_RPTR(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_TX_STATUS_TX_RPTR_SHIFT)) & EMVSIM_TX_STATUS_TX_RPTR_MASK) - -#define EMVSIM_TX_STATUS_TX_CNT_MASK (0xF000000U) -#define EMVSIM_TX_STATUS_TX_CNT_SHIFT (24U) -/*! TX_CNT - Transmit FIFO Byte Count - * 0b0000..FIFO empty - */ -#define EMVSIM_TX_STATUS_TX_CNT(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_TX_STATUS_TX_CNT_SHIFT)) & EMVSIM_TX_STATUS_TX_CNT_MASK) -/*! @} */ - -/*! @name PCSR - Port Control and Status */ -/*! @{ */ - -#define EMVSIM_PCSR_SAPD_MASK (0x1U) -#define EMVSIM_PCSR_SAPD_SHIFT (0U) -/*! SAPD - Auto Power Down Enable - * 0b0..Disable - * 0b1..Enable - */ -#define EMVSIM_PCSR_SAPD(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_PCSR_SAPD_SHIFT)) & EMVSIM_PCSR_SAPD_MASK) - -#define EMVSIM_PCSR_SVCC_EN_MASK (0x2U) -#define EMVSIM_PCSR_SVCC_EN_SHIFT (1U) -/*! SVCC_EN - Vcc Enable for Smart Card - * 0b0..Disable - * 0b1..Enable - */ -#define EMVSIM_PCSR_SVCC_EN(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_PCSR_SVCC_EN_SHIFT)) & EMVSIM_PCSR_SVCC_EN_MASK) - -#define EMVSIM_PCSR_VCCENP_MASK (0x4U) -#define EMVSIM_PCSR_VCCENP_SHIFT (2U) -/*! VCCENP - VCC Enable Polarity Control - * 0b0..Active high - * 0b1..Active low - */ -#define EMVSIM_PCSR_VCCENP(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_PCSR_VCCENP_SHIFT)) & EMVSIM_PCSR_VCCENP_MASK) - -#define EMVSIM_PCSR_SRST_MASK (0x8U) -#define EMVSIM_PCSR_SRST_SHIFT (3U) -/*! SRST - Reset Smart Card - * 0b0..Assert - * 0b1..Deassert - */ -#define EMVSIM_PCSR_SRST(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_PCSR_SRST_SHIFT)) & EMVSIM_PCSR_SRST_MASK) - -#define EMVSIM_PCSR_SCEN_MASK (0x10U) -#define EMVSIM_PCSR_SCEN_SHIFT (4U) -/*! SCEN - Clock Enable for Smart Card - * 0b0..Disable - * 0b1..Enable - */ -#define EMVSIM_PCSR_SCEN(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_PCSR_SCEN_SHIFT)) & EMVSIM_PCSR_SCEN_MASK) - -#define EMVSIM_PCSR_SCSP_MASK (0x20U) -#define EMVSIM_PCSR_SCSP_SHIFT (5U) -/*! SCSP - Smart Card Clock Stop Polarity - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define EMVSIM_PCSR_SCSP(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_PCSR_SCSP_SHIFT)) & EMVSIM_PCSR_SCSP_MASK) - -#define EMVSIM_PCSR_SPD_MASK (0x80U) -#define EMVSIM_PCSR_SPD_SHIFT (7U) -/*! SPD - Auto Power-Down Control - * 0b0..No - * 0b1..Yes - */ -#define EMVSIM_PCSR_SPD(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_PCSR_SPD_SHIFT)) & EMVSIM_PCSR_SPD_MASK) - -#define EMVSIM_PCSR_SPDIM_MASK (0x1000000U) -#define EMVSIM_PCSR_SPDIM_SHIFT (24U) -/*! SPDIM - Smart Card Presence Detect Interrupt Mask - * 0b0..Enable - * 0b1..Mask - */ -#define EMVSIM_PCSR_SPDIM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_PCSR_SPDIM_SHIFT)) & EMVSIM_PCSR_SPDIM_MASK) - -#define EMVSIM_PCSR_SPDIF_MASK (0x2000000U) -#define EMVSIM_PCSR_SPDIF_SHIFT (25U) -/*! SPDIF - Smart Card Presence Detect Interrupt Flag - * 0b0..No insertion or removal - * 0b1..Insertion or removal - */ -#define EMVSIM_PCSR_SPDIF(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_PCSR_SPDIF_SHIFT)) & EMVSIM_PCSR_SPDIF_MASK) - -#define EMVSIM_PCSR_SPDP_MASK (0x4000000U) -#define EMVSIM_PCSR_SPDP_SHIFT (26U) -/*! SPDP - Smart Card Presence Detect Pin Status - * 0b0..Logic low - * 0b1..Logic high - */ -#define EMVSIM_PCSR_SPDP(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_PCSR_SPDP_SHIFT)) & EMVSIM_PCSR_SPDP_MASK) - -#define EMVSIM_PCSR_SPDES_MASK (0x8000000U) -#define EMVSIM_PCSR_SPDES_SHIFT (27U) -/*! SPDES - SIM Presence Detect Edge Select - * 0b0..Falling edge - * 0b1..Rising edge - */ -#define EMVSIM_PCSR_SPDES(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_PCSR_SPDES_SHIFT)) & EMVSIM_PCSR_SPDES_MASK) -/*! @} */ - -/*! @name RX_BUF - Receive Data Read Buffer */ -/*! @{ */ - -#define EMVSIM_RX_BUF_RX_BYTE_MASK (0xFFU) -#define EMVSIM_RX_BUF_RX_BYTE_SHIFT (0U) -/*! RX_BYTE - Receive Data Byte Read */ -#define EMVSIM_RX_BUF_RX_BYTE(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_BUF_RX_BYTE_SHIFT)) & EMVSIM_RX_BUF_RX_BYTE_MASK) -/*! @} */ - -/*! @name TX_BUF - Transmit Data Buffer */ -/*! @{ */ - -#define EMVSIM_TX_BUF_TX_BYTE_MASK (0xFFU) -#define EMVSIM_TX_BUF_TX_BYTE_SHIFT (0U) -/*! TX_BYTE - Transmit Data Byte */ -#define EMVSIM_TX_BUF_TX_BYTE(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_TX_BUF_TX_BYTE_SHIFT)) & EMVSIM_TX_BUF_TX_BYTE_MASK) -/*! @} */ - -/*! @name TX_GETU - Transmitter Guard ETU Value */ -/*! @{ */ - -#define EMVSIM_TX_GETU_GETU_MASK (0xFFU) -#define EMVSIM_TX_GETU_GETU_SHIFT (0U) -/*! GETU - Transmitter Guard Time Value in ETU */ -#define EMVSIM_TX_GETU_GETU(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_TX_GETU_GETU_SHIFT)) & EMVSIM_TX_GETU_GETU_MASK) -/*! @} */ - -/*! @name CWT_VAL - Character Wait Time Value */ -/*! @{ */ - -#define EMVSIM_CWT_VAL_CWT_MASK (0xFFFFU) -#define EMVSIM_CWT_VAL_CWT_SHIFT (0U) -/*! CWT - Character Wait Time Value */ -#define EMVSIM_CWT_VAL_CWT(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CWT_VAL_CWT_SHIFT)) & EMVSIM_CWT_VAL_CWT_MASK) -/*! @} */ - -/*! @name BWT_VAL - Block Wait Time Value */ -/*! @{ */ - -#define EMVSIM_BWT_VAL_BWT_MASK (0xFFFFFFFFU) -#define EMVSIM_BWT_VAL_BWT_SHIFT (0U) -/*! BWT - Block Wait Time Value */ -#define EMVSIM_BWT_VAL_BWT(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_BWT_VAL_BWT_SHIFT)) & EMVSIM_BWT_VAL_BWT_MASK) -/*! @} */ - -/*! @name BGT_VAL - Block Guard Time Value */ -/*! @{ */ - -#define EMVSIM_BGT_VAL_BGT_MASK (0xFFFFU) -#define EMVSIM_BGT_VAL_BGT_SHIFT (0U) -/*! BGT - Block Guard Time Value */ -#define EMVSIM_BGT_VAL_BGT(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_BGT_VAL_BGT_SHIFT)) & EMVSIM_BGT_VAL_BGT_MASK) -/*! @} */ - -/*! @name GPCNT0_VAL - General Purpose Counter 0 Timeout Value */ -/*! @{ */ - -#define EMVSIM_GPCNT0_VAL_GPCNT0_MASK (0xFFFFU) -#define EMVSIM_GPCNT0_VAL_GPCNT0_SHIFT (0U) -/*! GPCNT0 - General Purpose Counter 0 Timeout Value */ -#define EMVSIM_GPCNT0_VAL_GPCNT0(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_GPCNT0_VAL_GPCNT0_SHIFT)) & EMVSIM_GPCNT0_VAL_GPCNT0_MASK) -/*! @} */ - -/*! @name GPCNT1_VAL - General Purpose Counter 1 Timeout Value */ -/*! @{ */ - -#define EMVSIM_GPCNT1_VAL_GPCNT1_MASK (0xFFFFU) -#define EMVSIM_GPCNT1_VAL_GPCNT1_SHIFT (0U) -/*! GPCNT1 - General Purpose Counter 1 Timeout Value */ -#define EMVSIM_GPCNT1_VAL_GPCNT1(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_GPCNT1_VAL_GPCNT1_SHIFT)) & EMVSIM_GPCNT1_VAL_GPCNT1_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group EMVSIM_Register_Masks */ - - -/* EMVSIM - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral EMVSIM0 base address */ - #define EMVSIM0_BASE (0x50103000u) - /** Peripheral EMVSIM0 base address */ - #define EMVSIM0_BASE_NS (0x40103000u) - /** Peripheral EMVSIM0 base pointer */ - #define EMVSIM0 ((EMVSIM_Type *)EMVSIM0_BASE) - /** Peripheral EMVSIM0 base pointer */ - #define EMVSIM0_NS ((EMVSIM_Type *)EMVSIM0_BASE_NS) - /** Peripheral EMVSIM1 base address */ - #define EMVSIM1_BASE (0x50104000u) - /** Peripheral EMVSIM1 base address */ - #define EMVSIM1_BASE_NS (0x40104000u) - /** Peripheral EMVSIM1 base pointer */ - #define EMVSIM1 ((EMVSIM_Type *)EMVSIM1_BASE) - /** Peripheral EMVSIM1 base pointer */ - #define EMVSIM1_NS ((EMVSIM_Type *)EMVSIM1_BASE_NS) - /** Array initializer of EMVSIM peripheral base addresses */ - #define EMVSIM_BASE_ADDRS { EMVSIM0_BASE, EMVSIM1_BASE } - /** Array initializer of EMVSIM peripheral base pointers */ - #define EMVSIM_BASE_PTRS { EMVSIM0, EMVSIM1 } - /** Array initializer of EMVSIM peripheral base addresses */ - #define EMVSIM_BASE_ADDRS_NS { EMVSIM0_BASE_NS, EMVSIM1_BASE_NS } - /** Array initializer of EMVSIM peripheral base pointers */ - #define EMVSIM_BASE_PTRS_NS { EMVSIM0_NS, EMVSIM1_NS } -#else - /** Peripheral EMVSIM0 base address */ - #define EMVSIM0_BASE (0x40103000u) - /** Peripheral EMVSIM0 base pointer */ - #define EMVSIM0 ((EMVSIM_Type *)EMVSIM0_BASE) - /** Peripheral EMVSIM1 base address */ - #define EMVSIM1_BASE (0x40104000u) - /** Peripheral EMVSIM1 base pointer */ - #define EMVSIM1 ((EMVSIM_Type *)EMVSIM1_BASE) - /** Array initializer of EMVSIM peripheral base addresses */ - #define EMVSIM_BASE_ADDRS { EMVSIM0_BASE, EMVSIM1_BASE } - /** Array initializer of EMVSIM peripheral base pointers */ - #define EMVSIM_BASE_PTRS { EMVSIM0, EMVSIM1 } -#endif -/** Interrupt vectors for the EMVSIM peripheral type */ -#define EMVSIM_IRQS { EMVSIM0_IRQn, EMVSIM1_IRQn } - -/*! - * @} - */ /* end of group EMVSIM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- ENET Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ENET_Peripheral_Access_Layer ENET Peripheral Access Layer - * @{ - */ - -/** ENET - Register Layout Typedef */ -typedef struct { - __IO uint32_t MAC_CONFIGURATION; /**< MAC Configuration, offset: 0x0 */ - __IO uint32_t MAC_EXT_CONFIGURATION; /**< MAC Extended Configuration Register, offset: 0x4 */ - __IO uint32_t MAC_PACKET_FILTER; /**< MAC Packet Filter, offset: 0x8 */ - __IO uint32_t MAC_WATCHDOG_TIMEOUT; /**< Watchdog Timeout, offset: 0xC */ - uint8_t RESERVED_0[64]; - __IO uint32_t MAC_VLAN_TAG_CTRL; /**< MAC VLAN Tag Control, offset: 0x50 */ - uint8_t RESERVED_1[12]; - __IO uint32_t MAC_VLAN_INCL; /**< VLAN Tag Inclusion or Replacement, offset: 0x60 */ - __IO uint32_t MAC_INNER_VLAN_INCL; /**< MAC Inner VLAN Tag Inclusion or Replacement, offset: 0x64 */ - uint8_t RESERVED_2[8]; - __IO uint32_t MAC_TX_FLOW_CTRL_Q[1]; /**< MAC Q0 Tx Flow Control, array offset: 0x70, array step: 0x4 */ - uint8_t RESERVED_3[28]; - __IO uint32_t MAC_RX_FLOW_CTRL; /**< MAC Rx Flow Control, offset: 0x90 */ - __IO uint32_t MAC_RXQ_CTRL4; /**< Receive Queue Control 4, offset: 0x94 */ - uint8_t RESERVED_4[8]; - __IO uint32_t MAC_RXQ_CTRL[3]; /**< Receive Queue Control 0..Receive Queue Control 2, array offset: 0xA0, array step: 0x4 */ - uint8_t RESERVED_5[4]; - __I uint32_t MAC_INTERRUPT_STATUS; /**< Interrupt Status, offset: 0xB0 */ - __IO uint32_t MAC_INTERRUPT_ENABLE; /**< Interrupt Enable, offset: 0xB4 */ - __I uint32_t MAC_RX_TX_STATUS; /**< Receive Transmit Status, offset: 0xB8 */ - uint8_t RESERVED_6[4]; - __IO uint32_t MAC_PMT_CONTROL_STATUS; /**< PMT Control and Status, offset: 0xC0 */ - __IO uint32_t MAC_RWK_PACKET_FILTER; /**< Remote Wakeup Filter, offset: 0xC4 */ - uint8_t RESERVED_7[8]; - __IO uint32_t MAC_LPI_CONTROL_STATUS; /**< LPI Control and Status, offset: 0xD0 */ - __IO uint32_t MAC_LPI_TIMERS_CONTROL; /**< LPI Timers Control, offset: 0xD4 */ - __IO uint32_t MAC_LPI_ENTRY_TIMER; /**< Tx LPI Entry Timer Control, offset: 0xD8 */ - __IO uint32_t MAC_ONEUS_TIC_COUNTER; /**< One-microsecond Reference Timer, offset: 0xDC */ - uint8_t RESERVED_8[48]; - __I uint32_t MAC_VERSION; /**< MAC Version, offset: 0x110 */ - __I uint32_t MAC_DEBUG; /**< MAC Debug, offset: 0x114 */ - uint8_t RESERVED_9[4]; - __I uint32_t MAC_HW_FEAT[4]; /**< Hardware Features 0..Hardware Features 3, array offset: 0x11C, array step: 0x4 */ - uint8_t RESERVED_10[212]; - __IO uint32_t MAC_MDIO_ADDRESS; /**< MDIO Address, offset: 0x200 */ - __IO uint32_t MAC_MDIO_DATA; /**< MAC MDIO Data, offset: 0x204 */ - uint8_t RESERVED_11[40]; - __IO uint32_t MAC_CSR_SW_CTRL; /**< CSR Software Control, offset: 0x230 */ - uint8_t RESERVED_12[204]; - __IO uint32_t MAC_ADDRESS0_HIGH; /**< MAC Address0 High, offset: 0x300 */ - __IO uint32_t MAC_ADDRESS0_LOW; /**< MAC Address0 Low, offset: 0x304 */ - uint8_t RESERVED_13[1896]; - __IO uint32_t INDIR_ACCESS_CTRL; /**< Indirect Access Control, offset: 0xA70 */ - __IO uint32_t INDIR_ACCESS_DATA; /**< Indirect Access Data, offset: 0xA74 */ - uint8_t RESERVED_14[136]; - __IO uint32_t MAC_TIMESTAMP_CONTROL; /**< Timestamp Control, offset: 0xB00 */ - __IO uint32_t MAC_SUB_SECOND_INCREMENT; /**< Subsecond Increment, offset: 0xB04 */ - __I uint32_t MAC_SYSTEM_TIME_SECONDS; /**< System Time Seconds, offset: 0xB08 */ - __I uint32_t MAC_SYSTEM_TIME_NANOSECONDS; /**< System Time Nanoseconds, offset: 0xB0C */ - __IO uint32_t MAC_SYSTEM_TIME_SECONDS_UPDATE; /**< System Time Seconds Update, offset: 0xB10 */ - __IO uint32_t MAC_SYSTEM_TIME_NANOSECONDS_UPDATE; /**< System Time Nanoseconds Update, offset: 0xB14 */ - __IO uint32_t MAC_TIMESTAMP_ADDEND; /**< Timestamp Addend, offset: 0xB18 */ - uint8_t RESERVED_15[4]; - __I uint32_t MAC_TIMESTAMP_STATUS; /**< Timestamp Status, offset: 0xB20 */ - uint8_t RESERVED_16[12]; - __I uint32_t MAC_TX_TIMESTAMP_STATUS_NANOSECONDS; /**< Transmit Timestamp Status Nanoseconds, offset: 0xB30 */ - __I uint32_t MAC_TX_TIMESTAMP_STATUS_SECONDS; /**< Transmit Timestamp Status Seconds, offset: 0xB34 */ - uint8_t RESERVED_17[32]; - __IO uint32_t MAC_TIMESTAMP_INGRESS_CORR_NANOSECOND; /**< Timestamp Ingress Correction Nanosecond, offset: 0xB58 */ - __IO uint32_t MAC_TIMESTAMP_EGRESS_CORR_NANOSECOND; /**< Timestamp Egress Correction Nanosecond, offset: 0xB5C */ - uint8_t RESERVED_18[8]; - __I uint32_t MAC_TIMESTAMP_INGRESS_LATENCY; /**< Timestamp Ingress Latency, offset: 0xB68 */ - __I uint32_t MAC_TIMESTAMP_EGRESS_LATENCY; /**< Timestamp Egress Latency, offset: 0xB6C */ - __IO uint32_t MAC_PPS_CONTROL; /**< PPS Control, offset: 0xB70 */ - uint8_t RESERVED_19[12]; - __IO uint32_t PPS0_TARGET_TIME_SECONDS; /**< PPS0 Target Time Seconds, offset: 0xB80 */ - __IO uint32_t PPS0_TARGET_TIME_NANOSECONDS; /**< PPS0 Target Time Nanoseconds, offset: 0xB84 */ - uint8_t RESERVED_20[120]; - __IO uint32_t MTL_OPERATION_MODE; /**< MTL Operation Mode, offset: 0xC00 */ - uint8_t RESERVED_21[28]; - __I uint32_t MTL_INTERRUPT_STATUS; /**< MTL Interrupt Status, offset: 0xC20 */ - uint8_t RESERVED_22[12]; - __IO uint32_t MTL_RXQ_DMA_MAP0; /**< Receive Queue and DMA Channel Mapping 0, offset: 0xC30 */ - uint8_t RESERVED_23[204]; - struct { /* offset: 0xD00, array step: 0x40 */ - __IO uint32_t MTL_TXQX_OP_MODE; /**< Queue 0 Transmit Operation Mode..Queue 1 Transmit Operation Mode, array offset: 0xD00, array step: 0x40 */ - __I uint32_t MTL_TXQX_UNDRFLW; /**< Queue 0 Underflow Counter..Queue 1 Underflow Counter, array offset: 0xD04, array step: 0x40 */ - __I uint32_t MTL_TXQX_DBG; /**< Queue 0 Transmit Debug..Queue 1 Transmit Debug, array offset: 0xD08, array step: 0x40 */ - uint8_t RESERVED_0[4]; - __IO uint32_t MTL_TXQX_ETS_CTRL; /**< Queue 1 ETS Control, array offset: 0xD10, array step: 0x40, valid indices: [1] */ - __I uint32_t MTL_TXQX_ETS_STAT; /**< Queue 0 ETS Status..Queue 1 ETS Status, array offset: 0xD14, array step: 0x40 */ - __IO uint32_t MTL_TXQX_QNTM_WGHT; /**< Queue 0 Quantum or Weights..Queue 1 idleSlopeCredit, Quantum or Weights, array offset: 0xD18, array step: 0x40 */ - __IO uint32_t MTL_TXQX_SNDSLP_CRDT; /**< Queue 1 sendSlopeCredit, array offset: 0xD1C, array step: 0x40, valid indices: [1] */ - __IO uint32_t MTL_TXQX_HI_CRDT; /**< Queue 1 hiCredit, array offset: 0xD20, array step: 0x40, valid indices: [1] */ - __IO uint32_t MTL_TXQX_LO_CRDT; /**< Queue 1 loCredit, array offset: 0xD24, array step: 0x40, valid indices: [1] */ - uint8_t RESERVED_1[4]; - __IO uint32_t MTL_QX_INTCTRL_STAT; /**< Queue 0 Interrupt Control Status..Queue 1 Interrupt Control Status, array offset: 0xD2C, array step: 0x40 */ - __IO uint32_t MTL_RXQX_OP_MODE; /**< Queue 0 Receive Operation Mode..Queue 1 Receive Operation Mode, array offset: 0xD30, array step: 0x40 */ - __I uint32_t MTL_RXQX_MISSPKT_OVRFLW_CNT; /**< Queue 0 Missed Packet and Overflow Counter..Queue 1 Missed Packet and Overflow Counter, array offset: 0xD34, array step: 0x40 */ - __I uint32_t MTL_RXQX_DBG; /**< Queue 0 Receive Debug..Queue 1 Receive Debug, array offset: 0xD38, array step: 0x40 */ - __IO uint32_t MTL_RXQX_CTRL; /**< Queue 0 Receive Control..Queue 1 Receive Control, array offset: 0xD3C, array step: 0x40 */ - } MTL_QUEUE[2]; - uint8_t RESERVED_24[640]; - __IO uint32_t DMA_MODE; /**< DMA Bus Mode, offset: 0x1000 */ - __IO uint32_t DMA_SYSBUS_MODE; /**< DMA System Bus Mode, offset: 0x1004 */ - __I uint32_t DMA_INTERRUPT_STATUS; /**< DMA Interrupt Status, offset: 0x1008 */ - __I uint32_t DMA_DEBUG_STATUS0; /**< DMA Debug Status 0, offset: 0x100C */ - uint8_t RESERVED_25[240]; - struct { /* offset: 0x1100, array step: 0x80 */ - __IO uint32_t DMA_CHX_CTRL; /**< DMA Channel 0 Control..DMA Channel 1 Control, array offset: 0x1100, array step: 0x80 */ - __IO uint32_t DMA_CHX_TX_CTRL; /**< DMA Channel 0 Transmit Control..DMA Channel 1 Transmit Control, array offset: 0x1104, array step: 0x80 */ - __IO uint32_t DMA_CHX_RX_CTRL; /**< DMA Channel 0 Receive Control..DMA Channel 1 Receive Control, array offset: 0x1108, array step: 0x80 */ - uint8_t RESERVED_0[8]; - __IO uint32_t DMA_CHX_TXDESC_LIST_ADDR; /**< Channel 0 Tx Descriptor List Address register..Channel 1 Tx Descriptor List Address, array offset: 0x1114, array step: 0x80 */ - uint8_t RESERVED_1[4]; - __IO uint32_t DMA_CHX_RXDESC_LIST_ADDR; /**< Channel 0 Rx Descriptor List Address register..Channel 1 Rx Descriptor List Address, array offset: 0x111C, array step: 0x80 */ - __IO uint32_t DMA_CHX_TXDESC_TAIL_PTR; /**< Channel 0 Tx Descriptor Tail Pointer..Channel 1 Tx Descriptor Tail Pointer, array offset: 0x1120, array step: 0x80 */ - uint8_t RESERVED_2[4]; - __IO uint32_t DMA_CHX_RXDESC_TAIL_PTR; /**< Channel 0 Rx Descriptor Tail Pointer..Channel 1 Rx Descriptor Tail Pointer, array offset: 0x1128, array step: 0x80 */ - __IO uint32_t DMA_CHX_TXDESC_RING_LENGTH; /**< Channel 0 Tx Descriptor Ring Length..Channel 1 Tx Descriptor Ring Length, array offset: 0x112C, array step: 0x80 */ - __IO uint32_t DMA_CHX_RX_CONTROL2; /**< Channeli Receive Control..DMA Channel 1 Receive Control, array offset: 0x1130, array step: 0x80 */ - __IO uint32_t DMA_CHX_INT_EN; /**< Channeli Interrupt Enable..Channel 1 Interrupt Enable, array offset: 0x1134, array step: 0x80 */ - __IO uint32_t DMA_CHX_RX_INT_WDTIMER; /**< Channel 0 Receive Interrupt Watchdog Timer..Channel 1 Receive Interrupt Watchdog Timer, array offset: 0x1138, array step: 0x80 */ - __IO uint32_t DMA_CHX_SLOT_FUNC_CTRL_STAT; /**< Channel 0 Slot Function Control and Status..Channel 1 Slot Function Control and Status, array offset: 0x113C, array step: 0x80 */ - uint8_t RESERVED_3[4]; - __I uint32_t DMA_CHX_CUR_HST_TXDESC; /**< Channel 0 Current Application Transmit Descriptor..Channel 1 Current Application Transmit Descriptor, array offset: 0x1144, array step: 0x80 */ - uint8_t RESERVED_4[4]; - __I uint32_t DMA_CHX_CUR_HST_RXDESC; /**< Channel 0 Current Application Receive Descriptor..Channel 1 Current Application Receive Descriptor, array offset: 0x114C, array step: 0x80 */ - uint8_t RESERVED_5[4]; - __I uint32_t DMA_CHX_CUR_HST_TXBUF; /**< Channel 0 Current Application Transmit Buffer Address..Channel 1 Current Application Transmit Buffer Address, array offset: 0x1154, array step: 0x80 */ - uint8_t RESERVED_6[4]; - __I uint32_t DMA_CHX_CUR_HST_RXBUF; /**< Channel 0 Current Application Receive Buffer Address..Channel 1 Current Application Receive Buffer Address, array offset: 0x115C, array step: 0x80 */ - __IO uint32_t DMA_CHX_STAT; /**< DMA Channel 0 Status..DMA Channel 1 Status, array offset: 0x1160, array step: 0x80 */ - __I uint32_t DMA_CHX_MISS_FRAME_CNT; /**< Channel 0 Missed Frame Counter..Channel 1 Missed Frame Counter, array offset: 0x1164, array step: 0x80 */ - uint8_t RESERVED_7[4]; - __I uint32_t DMA_CHX_RX_ERI_CNT; /**< Channel 0 Receive ERI Counter..Channel 1 Receive ERI Counter, array offset: 0x116C, array step: 0x80 */ - uint8_t RESERVED_8[16]; - } DMA_CH[2]; -} ENET_Type; - -/* ---------------------------------------------------------------------------- - -- ENET Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ENET_Register_Masks ENET Register Masks - * @{ - */ - -/*! @name MAC_CONFIGURATION - MAC Configuration */ -/*! @{ */ - -#define ENET_MAC_CONFIGURATION_RE_MASK (0x1U) -#define ENET_MAC_CONFIGURATION_RE_SHIFT (0U) -/*! RE - Receiver Enable - * 0b0..Receiver is disabled - * 0b1..Receiver is enabled - */ -#define ENET_MAC_CONFIGURATION_RE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_RE_SHIFT)) & ENET_MAC_CONFIGURATION_RE_MASK) - -#define ENET_MAC_CONFIGURATION_TE_MASK (0x2U) -#define ENET_MAC_CONFIGURATION_TE_SHIFT (1U) -/*! TE - Transmitter Enable - * 0b0..Transmitter is disabled - * 0b1..Transmitter is enabled - */ -#define ENET_MAC_CONFIGURATION_TE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_TE_SHIFT)) & ENET_MAC_CONFIGURATION_TE_MASK) - -#define ENET_MAC_CONFIGURATION_PRELEN_MASK (0xCU) -#define ENET_MAC_CONFIGURATION_PRELEN_SHIFT (2U) -/*! PRELEN - Preamble Length for Transmit packets - * 0b10..3 bytes of preamble - * 0b01..5 bytes of preamble - * 0b00..7 bytes of preamble - * 0b11..Reserved - */ -#define ENET_MAC_CONFIGURATION_PRELEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_PRELEN_SHIFT)) & ENET_MAC_CONFIGURATION_PRELEN_MASK) - -#define ENET_MAC_CONFIGURATION_DC_MASK (0x10U) -#define ENET_MAC_CONFIGURATION_DC_SHIFT (4U) -/*! DC - Deferral Check - * 0b0..Deferral check function is disabled - * 0b1..Deferral check function is enabled - */ -#define ENET_MAC_CONFIGURATION_DC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_DC_SHIFT)) & ENET_MAC_CONFIGURATION_DC_MASK) - -#define ENET_MAC_CONFIGURATION_BL_MASK (0x60U) -#define ENET_MAC_CONFIGURATION_BL_SHIFT (5U) -/*! BL - Back-Off Limit - * 0b11..k = min(n,1) - * 0b00..k = min(n,10) - * 0b10..k = min(n,4) - * 0b01..k = min(n,8) - */ -#define ENET_MAC_CONFIGURATION_BL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_BL_SHIFT)) & ENET_MAC_CONFIGURATION_BL_MASK) - -#define ENET_MAC_CONFIGURATION_DR_MASK (0x100U) -#define ENET_MAC_CONFIGURATION_DR_SHIFT (8U) -/*! DR - Disable Retry - * 0b1..Disable Retry - * 0b0..Enable Retry - */ -#define ENET_MAC_CONFIGURATION_DR(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_DR_SHIFT)) & ENET_MAC_CONFIGURATION_DR_MASK) - -#define ENET_MAC_CONFIGURATION_DCRS_MASK (0x200U) -#define ENET_MAC_CONFIGURATION_DCRS_SHIFT (9U) -/*! DCRS - Disable Carrier Sense During Transmission - * 0b1..Disable Carrier Sense During Transmission - * 0b0..Enable Carrier Sense During Transmission - */ -#define ENET_MAC_CONFIGURATION_DCRS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_DCRS_SHIFT)) & ENET_MAC_CONFIGURATION_DCRS_MASK) - -#define ENET_MAC_CONFIGURATION_DO_MASK (0x400U) -#define ENET_MAC_CONFIGURATION_DO_SHIFT (10U) -/*! DO - Disable Receive Own - * 0b1..Disable Receive Own - * 0b0..Enable Receive Own - */ -#define ENET_MAC_CONFIGURATION_DO(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_DO_SHIFT)) & ENET_MAC_CONFIGURATION_DO_MASK) - -#define ENET_MAC_CONFIGURATION_ECRSFD_MASK (0x800U) -#define ENET_MAC_CONFIGURATION_ECRSFD_SHIFT (11U) -/*! ECRSFD - Enable Carrier Sense Before Transmission in Full-Duplex Mode - * 0b0..ECRSFD is disabled - * 0b1..ECRSFD is enabled - */ -#define ENET_MAC_CONFIGURATION_ECRSFD(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_ECRSFD_SHIFT)) & ENET_MAC_CONFIGURATION_ECRSFD_MASK) - -#define ENET_MAC_CONFIGURATION_LM_MASK (0x1000U) -#define ENET_MAC_CONFIGURATION_LM_SHIFT (12U) -/*! LM - Loopback Mode - * 0b0..Loopback is disabled - * 0b1..Loopback is enabled - */ -#define ENET_MAC_CONFIGURATION_LM(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_LM_SHIFT)) & ENET_MAC_CONFIGURATION_LM_MASK) - -#define ENET_MAC_CONFIGURATION_DM_MASK (0x2000U) -#define ENET_MAC_CONFIGURATION_DM_SHIFT (13U) -/*! DM - Duplex Mode - * 0b1..Full-duplex mode - * 0b0..Half-duplex mode - */ -#define ENET_MAC_CONFIGURATION_DM(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_DM_SHIFT)) & ENET_MAC_CONFIGURATION_DM_MASK) - -#define ENET_MAC_CONFIGURATION_FES_MASK (0x4000U) -#define ENET_MAC_CONFIGURATION_FES_SHIFT (14U) -/*! FES - Speed - * 0b1..100 Mbps when PS bit is 1 and 2.5 Gbps when PS bit is 0 - * 0b0..10 Mbps when PS bit is 1 and 1 Gbps when PS bit is 0 - */ -#define ENET_MAC_CONFIGURATION_FES(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_FES_SHIFT)) & ENET_MAC_CONFIGURATION_FES_MASK) - -#define ENET_MAC_CONFIGURATION_PS_MASK (0x8000U) -#define ENET_MAC_CONFIGURATION_PS_SHIFT (15U) -/*! PS - Port Select - * 0b0..For 1000 or 2500 Mbps operations - * 0b1..For 10 or 100 Mbps operations - */ -#define ENET_MAC_CONFIGURATION_PS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_PS_SHIFT)) & ENET_MAC_CONFIGURATION_PS_MASK) - -#define ENET_MAC_CONFIGURATION_JE_MASK (0x10000U) -#define ENET_MAC_CONFIGURATION_JE_SHIFT (16U) -/*! JE - Jumbo Packet Enable - * 0b0..Jumbo packet is disabled - * 0b1..Jumbo packet is enabled - */ -#define ENET_MAC_CONFIGURATION_JE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_JE_SHIFT)) & ENET_MAC_CONFIGURATION_JE_MASK) - -#define ENET_MAC_CONFIGURATION_JD_MASK (0x20000U) -#define ENET_MAC_CONFIGURATION_JD_SHIFT (17U) -/*! JD - Jabber Disable - * 0b1..Jabber is disabled - * 0b0..Jabber is enabled - */ -#define ENET_MAC_CONFIGURATION_JD(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_JD_SHIFT)) & ENET_MAC_CONFIGURATION_JD_MASK) - -#define ENET_MAC_CONFIGURATION_WD_MASK (0x80000U) -#define ENET_MAC_CONFIGURATION_WD_SHIFT (19U) -/*! WD - Watchdog Disable - * 0b1..Watchdog is disabled - * 0b0..Watchdog is enabled - */ -#define ENET_MAC_CONFIGURATION_WD(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_WD_SHIFT)) & ENET_MAC_CONFIGURATION_WD_MASK) - -#define ENET_MAC_CONFIGURATION_ACS_MASK (0x100000U) -#define ENET_MAC_CONFIGURATION_ACS_SHIFT (20U) -/*! ACS - Automatic Pad or CRC Stripping - * 0b0..Automatic Pad or CRC Stripping is disabled - * 0b1..Automatic Pad or CRC Stripping is enabled - */ -#define ENET_MAC_CONFIGURATION_ACS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_ACS_SHIFT)) & ENET_MAC_CONFIGURATION_ACS_MASK) - -#define ENET_MAC_CONFIGURATION_CST_MASK (0x200000U) -#define ENET_MAC_CONFIGURATION_CST_SHIFT (21U) -/*! CST - CRC stripping for Type packets - * 0b0..CRC stripping for Type packets is disabled - * 0b1..CRC stripping for Type packets is enabled - */ -#define ENET_MAC_CONFIGURATION_CST(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_CST_SHIFT)) & ENET_MAC_CONFIGURATION_CST_MASK) - -#define ENET_MAC_CONFIGURATION_S2KP_MASK (0x400000U) -#define ENET_MAC_CONFIGURATION_S2KP_SHIFT (22U) -/*! S2KP - IEEE 802.3as Support for 2K Packets - * 0b0..Support upto 2K packet is disabled - * 0b1..Support upto 2K packet is Enabled - */ -#define ENET_MAC_CONFIGURATION_S2KP(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_S2KP_SHIFT)) & ENET_MAC_CONFIGURATION_S2KP_MASK) - -#define ENET_MAC_CONFIGURATION_GPSLCE_MASK (0x800000U) -#define ENET_MAC_CONFIGURATION_GPSLCE_SHIFT (23U) -/*! GPSLCE - Giant Packet Size Limit Control Enable - * 0b0..Giant Packet Size Limit Control is disabled - * 0b1..Giant Packet Size Limit Control is enabled - */ -#define ENET_MAC_CONFIGURATION_GPSLCE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_GPSLCE_SHIFT)) & ENET_MAC_CONFIGURATION_GPSLCE_MASK) - -#define ENET_MAC_CONFIGURATION_IPG_MASK (0x7000000U) -#define ENET_MAC_CONFIGURATION_IPG_SHIFT (24U) -/*! IPG - Inter-Packet Gap - * 0b111..40 bit times IPG - * 0b110..48 bit times IPG - * 0b101..56 bit times IPG - * 0b100..64 bit times IPG - * 0b011..72 bit times IPG - * 0b010..80 bit times IPG - * 0b001..88 bit times IPG - * 0b000..96 bit times IPG - */ -#define ENET_MAC_CONFIGURATION_IPG(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_IPG_SHIFT)) & ENET_MAC_CONFIGURATION_IPG_MASK) - -#define ENET_MAC_CONFIGURATION_IPC_MASK (0x8000000U) -#define ENET_MAC_CONFIGURATION_IPC_SHIFT (27U) -/*! IPC - Checksum Offload - * 0b0..IP header/payload checksum checking is disabled - * 0b1..IP header/payload checksum checking is enabled - */ -#define ENET_MAC_CONFIGURATION_IPC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_IPC_SHIFT)) & ENET_MAC_CONFIGURATION_IPC_MASK) - -#define ENET_MAC_CONFIGURATION_SARC_MASK (0x70000000U) -#define ENET_MAC_CONFIGURATION_SARC_SHIFT (28U) -/*! SARC - Source Address Insertion or Replacement Control - * 0b010..Contents of MAC Addr-0 inserted in SA field - * 0b011..Contents of MAC Addr-0 replaces SA field - * 0b110..Contents of MAC Addr-1 inserted in SA field - * 0b111..Contents of MAC Addr-1 replaces SA field - * 0b000..mti_sa_ctrl_i and ati_sa_ctrl_i input signals control the SA field generation - */ -#define ENET_MAC_CONFIGURATION_SARC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_SARC_SHIFT)) & ENET_MAC_CONFIGURATION_SARC_MASK) -/*! @} */ - -/*! @name MAC_EXT_CONFIGURATION - MAC Extended Configuration Register */ -/*! @{ */ - -#define ENET_MAC_EXT_CONFIGURATION_GPSL_MASK (0x3FFFU) -#define ENET_MAC_EXT_CONFIGURATION_GPSL_SHIFT (0U) -/*! GPSL - Giant Packet Size Limit */ -#define ENET_MAC_EXT_CONFIGURATION_GPSL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_EXT_CONFIGURATION_GPSL_SHIFT)) & ENET_MAC_EXT_CONFIGURATION_GPSL_MASK) - -#define ENET_MAC_EXT_CONFIGURATION_DCRCC_MASK (0x10000U) -#define ENET_MAC_EXT_CONFIGURATION_DCRCC_SHIFT (16U) -/*! DCRCC - Disable CRC Checking for Received Packets - * 0b1..CRC Checking is disabled - * 0b0..CRC Checking is enabled - */ -#define ENET_MAC_EXT_CONFIGURATION_DCRCC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_EXT_CONFIGURATION_DCRCC_SHIFT)) & ENET_MAC_EXT_CONFIGURATION_DCRCC_MASK) - -#define ENET_MAC_EXT_CONFIGURATION_SPEN_MASK (0x20000U) -#define ENET_MAC_EXT_CONFIGURATION_SPEN_SHIFT (17U) -/*! SPEN - Slow Protocol Detection Enable - * 0b0..Slow Protocol Detection is disabled - * 0b1..Slow Protocol Detection is enabled - */ -#define ENET_MAC_EXT_CONFIGURATION_SPEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_EXT_CONFIGURATION_SPEN_SHIFT)) & ENET_MAC_EXT_CONFIGURATION_SPEN_MASK) - -#define ENET_MAC_EXT_CONFIGURATION_USP_MASK (0x40000U) -#define ENET_MAC_EXT_CONFIGURATION_USP_SHIFT (18U) -/*! USP - Unicast Slow Protocol Packet Detect - * 0b0..Unicast Slow Protocol Packet Detection is disabled - * 0b1..Unicast Slow Protocol Packet Detection is enabled - */ -#define ENET_MAC_EXT_CONFIGURATION_USP(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_EXT_CONFIGURATION_USP_SHIFT)) & ENET_MAC_EXT_CONFIGURATION_USP_MASK) - -#define ENET_MAC_EXT_CONFIGURATION_PDC_MASK (0x80000U) -#define ENET_MAC_EXT_CONFIGURATION_PDC_SHIFT (19U) -/*! PDC - Packet Duplication Control - * 0b0..Packet Duplication Control is disabled - * 0b1..Packet Duplication Control is enabled - */ -#define ENET_MAC_EXT_CONFIGURATION_PDC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_EXT_CONFIGURATION_PDC_SHIFT)) & ENET_MAC_EXT_CONFIGURATION_PDC_MASK) - -#define ENET_MAC_EXT_CONFIGURATION_EIPGEN_MASK (0x1000000U) -#define ENET_MAC_EXT_CONFIGURATION_EIPGEN_SHIFT (24U) -/*! EIPGEN - Extended Inter-Packet Gap Enable - * 0b0..Extended Inter-Packet Gap is disabled - * 0b1..Extended Inter-Packet Gap is enabled - */ -#define ENET_MAC_EXT_CONFIGURATION_EIPGEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_EXT_CONFIGURATION_EIPGEN_SHIFT)) & ENET_MAC_EXT_CONFIGURATION_EIPGEN_MASK) - -#define ENET_MAC_EXT_CONFIGURATION_EIPG_MASK (0x3E000000U) -#define ENET_MAC_EXT_CONFIGURATION_EIPG_SHIFT (25U) -/*! EIPG - Extended Inter-Packet Gap */ -#define ENET_MAC_EXT_CONFIGURATION_EIPG(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_EXT_CONFIGURATION_EIPG_SHIFT)) & ENET_MAC_EXT_CONFIGURATION_EIPG_MASK) -/*! @} */ - -/*! @name MAC_PACKET_FILTER - MAC Packet Filter */ -/*! @{ */ - -#define ENET_MAC_PACKET_FILTER_PR_MASK (0x1U) -#define ENET_MAC_PACKET_FILTER_PR_SHIFT (0U) -/*! PR - Promiscuous Mode - * 0b0..Promiscuous Mode is disabled - * 0b1..Promiscuous Mode is enabled - */ -#define ENET_MAC_PACKET_FILTER_PR(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PACKET_FILTER_PR_SHIFT)) & ENET_MAC_PACKET_FILTER_PR_MASK) - -#define ENET_MAC_PACKET_FILTER_DAIF_MASK (0x8U) -#define ENET_MAC_PACKET_FILTER_DAIF_SHIFT (3U) -/*! DAIF - DA Inverse Filtering - * 0b0..DA Inverse Filtering is disabled - * 0b1..DA Inverse Filtering is enabled - */ -#define ENET_MAC_PACKET_FILTER_DAIF(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PACKET_FILTER_DAIF_SHIFT)) & ENET_MAC_PACKET_FILTER_DAIF_MASK) - -#define ENET_MAC_PACKET_FILTER_PM_MASK (0x10U) -#define ENET_MAC_PACKET_FILTER_PM_SHIFT (4U) -/*! PM - Pass All Multicast - * 0b0..Pass All Multicast is disabled - * 0b1..Pass All Multicast is enabled - */ -#define ENET_MAC_PACKET_FILTER_PM(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PACKET_FILTER_PM_SHIFT)) & ENET_MAC_PACKET_FILTER_PM_MASK) - -#define ENET_MAC_PACKET_FILTER_DBF_MASK (0x20U) -#define ENET_MAC_PACKET_FILTER_DBF_SHIFT (5U) -/*! DBF - Disable Broadcast Packets - * 0b1..Disable Broadcast Packets - * 0b0..Enable Broadcast Packets - */ -#define ENET_MAC_PACKET_FILTER_DBF(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PACKET_FILTER_DBF_SHIFT)) & ENET_MAC_PACKET_FILTER_DBF_MASK) - -#define ENET_MAC_PACKET_FILTER_PCF_MASK (0xC0U) -#define ENET_MAC_PACKET_FILTER_PCF_SHIFT (6U) -/*! PCF - Pass Control Packets - * 0b00..MAC filters all control packets from reaching the application - * 0b10..MAC forwards all control packets to the application even if they fail the address filter - * 0b11..MAC forwards the control packets that pass the Address filter - * 0b01..MAC forwards all control packets except Pause packets to the application even if they fail the address filter - */ -#define ENET_MAC_PACKET_FILTER_PCF(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PACKET_FILTER_PCF_SHIFT)) & ENET_MAC_PACKET_FILTER_PCF_MASK) - -#define ENET_MAC_PACKET_FILTER_VTFE_MASK (0x10000U) -#define ENET_MAC_PACKET_FILTER_VTFE_SHIFT (16U) -/*! VTFE - VLAN Tag Filter Enable - * 0b0..VLAN Tag Filter is disabled - * 0b1..VLAN Tag Filter is enabled - */ -#define ENET_MAC_PACKET_FILTER_VTFE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PACKET_FILTER_VTFE_SHIFT)) & ENET_MAC_PACKET_FILTER_VTFE_MASK) - -#define ENET_MAC_PACKET_FILTER_RA_MASK (0x80000000U) -#define ENET_MAC_PACKET_FILTER_RA_SHIFT (31U) -/*! RA - Receive All - * 0b0..Receive All is disabled - * 0b1..Receive All is enabled - */ -#define ENET_MAC_PACKET_FILTER_RA(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PACKET_FILTER_RA_SHIFT)) & ENET_MAC_PACKET_FILTER_RA_MASK) -/*! @} */ - -/*! @name MAC_WATCHDOG_TIMEOUT - Watchdog Timeout */ -/*! @{ */ - -#define ENET_MAC_WATCHDOG_TIMEOUT_WTO_MASK (0xFU) -#define ENET_MAC_WATCHDOG_TIMEOUT_WTO_SHIFT (0U) -/*! WTO - Watchdog Timeout - * 0b1000..10 KB - * 0b1001..11 KB - * 0b1010..12 KB - * 0b1011..13 KB - * 0b1100..14 KB - * 0b1101..15 KB - * 0b1110..16383 Bytes - * 0b0000..2 KB - * 0b0001..3 KB - * 0b0010..4 KB - * 0b0011..5 KB - * 0b0100..6 KB - * 0b0101..7 KB - * 0b0110..8 KB - * 0b0111..9 KB - * 0b1111..Reserved - */ -#define ENET_MAC_WATCHDOG_TIMEOUT_WTO(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_WATCHDOG_TIMEOUT_WTO_SHIFT)) & ENET_MAC_WATCHDOG_TIMEOUT_WTO_MASK) - -#define ENET_MAC_WATCHDOG_TIMEOUT_PWE_MASK (0x100U) -#define ENET_MAC_WATCHDOG_TIMEOUT_PWE_SHIFT (8U) -/*! PWE - Programmable Watchdog Enable - * 0b0..Programmable Watchdog is disabled - * 0b1..Programmable Watchdog is enabled - */ -#define ENET_MAC_WATCHDOG_TIMEOUT_PWE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_WATCHDOG_TIMEOUT_PWE_SHIFT)) & ENET_MAC_WATCHDOG_TIMEOUT_PWE_MASK) -/*! @} */ - -/*! @name MAC_VLAN_TAG_CTRL - MAC VLAN Tag Control */ -/*! @{ */ - -#define ENET_MAC_VLAN_TAG_CTRL_VL_MASK (0xFFFFU) -#define ENET_MAC_VLAN_TAG_CTRL_VL_SHIFT (0U) -/*! VL - VLAN Tag Identifier for Receive Packets */ -#define ENET_MAC_VLAN_TAG_CTRL_VL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_TAG_CTRL_VL_SHIFT)) & ENET_MAC_VLAN_TAG_CTRL_VL_MASK) - -#define ENET_MAC_VLAN_TAG_CTRL_ETV_MASK (0x10000U) -#define ENET_MAC_VLAN_TAG_CTRL_ETV_SHIFT (16U) -/*! ETV - Enable 12-Bit VLAN Tag Comparison - * 0b0..12-bit VLAN Tag Comparison is disabled - * 0b1..12-bit VLAN Tag Comparison is enabled - */ -#define ENET_MAC_VLAN_TAG_CTRL_ETV(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_TAG_CTRL_ETV_SHIFT)) & ENET_MAC_VLAN_TAG_CTRL_ETV_MASK) - -#define ENET_MAC_VLAN_TAG_CTRL_VTIM_MASK (0x20000U) -#define ENET_MAC_VLAN_TAG_CTRL_VTIM_SHIFT (17U) -/*! VTIM - VLAN Tag Inverse Match Enable - * 0b0..VLAN Tag Inverse Match is disabled - * 0b1..VLAN Tag Inverse Match is enabled - */ -#define ENET_MAC_VLAN_TAG_CTRL_VTIM(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_TAG_CTRL_VTIM_SHIFT)) & ENET_MAC_VLAN_TAG_CTRL_VTIM_MASK) - -#define ENET_MAC_VLAN_TAG_CTRL_ESVL_MASK (0x40000U) -#define ENET_MAC_VLAN_TAG_CTRL_ESVL_SHIFT (18U) -/*! ESVL - Enable S-VLAN - * 0b0..S-VLAN is disabled - * 0b1..S-VLAN is enabled - */ -#define ENET_MAC_VLAN_TAG_CTRL_ESVL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_TAG_CTRL_ESVL_SHIFT)) & ENET_MAC_VLAN_TAG_CTRL_ESVL_MASK) - -#define ENET_MAC_VLAN_TAG_CTRL_ERSVLM_MASK (0x80000U) -#define ENET_MAC_VLAN_TAG_CTRL_ERSVLM_SHIFT (19U) -/*! ERSVLM - Enable Receive S-VLAN Match - * 0b0..Receive S-VLAN Match is disabled - * 0b1..Receive S-VLAN Match is enabled - */ -#define ENET_MAC_VLAN_TAG_CTRL_ERSVLM(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_TAG_CTRL_ERSVLM_SHIFT)) & ENET_MAC_VLAN_TAG_CTRL_ERSVLM_MASK) - -#define ENET_MAC_VLAN_TAG_CTRL_DOVLTC_MASK (0x100000U) -#define ENET_MAC_VLAN_TAG_CTRL_DOVLTC_SHIFT (20U) -/*! DOVLTC - Disable VLAN Type Check - * 0b1..VLAN Type Check is disabled - * 0b0..VLAN Type Check is enabled - */ -#define ENET_MAC_VLAN_TAG_CTRL_DOVLTC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_TAG_CTRL_DOVLTC_SHIFT)) & ENET_MAC_VLAN_TAG_CTRL_DOVLTC_MASK) - -#define ENET_MAC_VLAN_TAG_CTRL_EVLS_MASK (0x600000U) -#define ENET_MAC_VLAN_TAG_CTRL_EVLS_SHIFT (21U) -/*! EVLS - Enable VLAN Tag Stripping on Receive - * 0b11..Always strip - * 0b00..Do not strip - * 0b10..Strip if VLAN filter fails - * 0b01..Strip if VLAN filter passes - */ -#define ENET_MAC_VLAN_TAG_CTRL_EVLS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_TAG_CTRL_EVLS_SHIFT)) & ENET_MAC_VLAN_TAG_CTRL_EVLS_MASK) - -#define ENET_MAC_VLAN_TAG_CTRL_EVLRXS_MASK (0x1000000U) -#define ENET_MAC_VLAN_TAG_CTRL_EVLRXS_SHIFT (24U) -/*! EVLRXS - Enable VLAN Tag in Rx status - * 0b0..VLAN Tag in Rx status is disabled - * 0b1..VLAN Tag in Rx status is enabled - */ -#define ENET_MAC_VLAN_TAG_CTRL_EVLRXS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_TAG_CTRL_EVLRXS_SHIFT)) & ENET_MAC_VLAN_TAG_CTRL_EVLRXS_MASK) - -#define ENET_MAC_VLAN_TAG_CTRL_EDVLP_MASK (0x4000000U) -#define ENET_MAC_VLAN_TAG_CTRL_EDVLP_SHIFT (26U) -/*! EDVLP - Enable Double VLAN Processing - * 0b0..Double VLAN Processing is disabled - * 0b1..Double VLAN Processing is enabled - */ -#define ENET_MAC_VLAN_TAG_CTRL_EDVLP(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_TAG_CTRL_EDVLP_SHIFT)) & ENET_MAC_VLAN_TAG_CTRL_EDVLP_MASK) - -#define ENET_MAC_VLAN_TAG_CTRL_ERIVLT_MASK (0x8000000U) -#define ENET_MAC_VLAN_TAG_CTRL_ERIVLT_SHIFT (27U) -/*! ERIVLT - Enable Inner VLAN Tag - * 0b0..Inner VLAN tag is disabled - * 0b1..Inner VLAN tag is enabled - */ -#define ENET_MAC_VLAN_TAG_CTRL_ERIVLT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_TAG_CTRL_ERIVLT_SHIFT)) & ENET_MAC_VLAN_TAG_CTRL_ERIVLT_MASK) - -#define ENET_MAC_VLAN_TAG_CTRL_EIVLS_MASK (0x30000000U) -#define ENET_MAC_VLAN_TAG_CTRL_EIVLS_SHIFT (28U) -/*! EIVLS - Enable Inner VLAN Tag Stripping on Receive - * 0b11..Always strip - * 0b00..Do not strip - * 0b10..Strip if VLAN filter fails - * 0b01..Strip if VLAN filter passes - */ -#define ENET_MAC_VLAN_TAG_CTRL_EIVLS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_TAG_CTRL_EIVLS_SHIFT)) & ENET_MAC_VLAN_TAG_CTRL_EIVLS_MASK) - -#define ENET_MAC_VLAN_TAG_CTRL_EIVLRXS_MASK (0x80000000U) -#define ENET_MAC_VLAN_TAG_CTRL_EIVLRXS_SHIFT (31U) -/*! EIVLRXS - Enable Inner VLAN Tag in Rx Status - * 0b0..Inner VLAN Tag in Rx status is disabled - * 0b1..Inner VLAN Tag in Rx status is enabled - */ -#define ENET_MAC_VLAN_TAG_CTRL_EIVLRXS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_TAG_CTRL_EIVLRXS_SHIFT)) & ENET_MAC_VLAN_TAG_CTRL_EIVLRXS_MASK) -/*! @} */ - -/*! @name MAC_VLAN_INCL - VLAN Tag Inclusion or Replacement */ -/*! @{ */ - -#define ENET_MAC_VLAN_INCL_VLT_MASK (0xFFFFU) -#define ENET_MAC_VLAN_INCL_VLT_SHIFT (0U) -/*! VLT - VLAN Tag for Transmit Packets */ -#define ENET_MAC_VLAN_INCL_VLT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_INCL_VLT_SHIFT)) & ENET_MAC_VLAN_INCL_VLT_MASK) - -#define ENET_MAC_VLAN_INCL_VLC_MASK (0x30000U) -#define ENET_MAC_VLAN_INCL_VLC_SHIFT (16U) -/*! VLC - VLAN Tag Control in Transmit Packets - * 0b01..VLAN tag deletion - * 0b10..VLAN tag insertion - * 0b00..No VLAN tag deletion, insertion, or replacement - * 0b11..VLAN tag replacement - */ -#define ENET_MAC_VLAN_INCL_VLC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_INCL_VLC_SHIFT)) & ENET_MAC_VLAN_INCL_VLC_MASK) - -#define ENET_MAC_VLAN_INCL_VLP_MASK (0x40000U) -#define ENET_MAC_VLAN_INCL_VLP_SHIFT (18U) -/*! VLP - VLAN Priority Control - * 0b0..VLAN Priority Control is disabled - * 0b1..VLAN Priority Control is enabled - */ -#define ENET_MAC_VLAN_INCL_VLP(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_INCL_VLP_SHIFT)) & ENET_MAC_VLAN_INCL_VLP_MASK) - -#define ENET_MAC_VLAN_INCL_CSVL_MASK (0x80000U) -#define ENET_MAC_VLAN_INCL_CSVL_SHIFT (19U) -/*! CSVL - C-VLAN or S-VLAN - * 0b0..C-VLAN type (0x8100) is inserted or replaced - * 0b1..S-VLAN type (0x88A8) is inserted or replaced - */ -#define ENET_MAC_VLAN_INCL_CSVL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_INCL_CSVL_SHIFT)) & ENET_MAC_VLAN_INCL_CSVL_MASK) - -#define ENET_MAC_VLAN_INCL_VLTI_MASK (0x100000U) -#define ENET_MAC_VLAN_INCL_VLTI_SHIFT (20U) -/*! VLTI - VLAN Tag Input - * 0b0..VLAN Tag Input is disabled - * 0b1..VLAN Tag Input is enabled - */ -#define ENET_MAC_VLAN_INCL_VLTI(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_INCL_VLTI_SHIFT)) & ENET_MAC_VLAN_INCL_VLTI_MASK) - -#define ENET_MAC_VLAN_INCL_CBTI_MASK (0x200000U) -#define ENET_MAC_VLAN_INCL_CBTI_SHIFT (21U) -/*! CBTI - Channel based tag insertion - * 0b0..Channel based tag insertion is disabled - * 0b1..Channel based tag insertion is enabled - */ -#define ENET_MAC_VLAN_INCL_CBTI(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_INCL_CBTI_SHIFT)) & ENET_MAC_VLAN_INCL_CBTI_MASK) - -#define ENET_MAC_VLAN_INCL_ADDR_MASK (0x1000000U) -#define ENET_MAC_VLAN_INCL_ADDR_SHIFT (24U) -/*! ADDR - Address */ -#define ENET_MAC_VLAN_INCL_ADDR(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_INCL_ADDR_SHIFT)) & ENET_MAC_VLAN_INCL_ADDR_MASK) - -#define ENET_MAC_VLAN_INCL_RDWR_MASK (0x40000000U) -#define ENET_MAC_VLAN_INCL_RDWR_SHIFT (30U) -/*! RDWR - Read write control - * 0b0..Read operation of indirect access - * 0b1..Write operation of indirect access - */ -#define ENET_MAC_VLAN_INCL_RDWR(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_INCL_RDWR_SHIFT)) & ENET_MAC_VLAN_INCL_RDWR_MASK) - -#define ENET_MAC_VLAN_INCL_BUSY_MASK (0x80000000U) -#define ENET_MAC_VLAN_INCL_BUSY_SHIFT (31U) -/*! BUSY - Busy - * 0b1..Busy status detected - * 0b0..Busy status not detected - */ -#define ENET_MAC_VLAN_INCL_BUSY(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_INCL_BUSY_SHIFT)) & ENET_MAC_VLAN_INCL_BUSY_MASK) -/*! @} */ - -/*! @name MAC_INNER_VLAN_INCL - MAC Inner VLAN Tag Inclusion or Replacement */ -/*! @{ */ - -#define ENET_MAC_INNER_VLAN_INCL_VLT_MASK (0xFFFFU) -#define ENET_MAC_INNER_VLAN_INCL_VLT_SHIFT (0U) -/*! VLT - VLAN Tag for Transmit Packets */ -#define ENET_MAC_INNER_VLAN_INCL_VLT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INNER_VLAN_INCL_VLT_SHIFT)) & ENET_MAC_INNER_VLAN_INCL_VLT_MASK) - -#define ENET_MAC_INNER_VLAN_INCL_VLC_MASK (0x30000U) -#define ENET_MAC_INNER_VLAN_INCL_VLC_SHIFT (16U) -/*! VLC - VLAN Tag Control in Transmit Packets - * 0b01..VLAN tag deletion - * 0b10..VLAN tag insertion - * 0b00..No VLAN tag deletion, insertion, or replacement - * 0b11..VLAN tag replacement - */ -#define ENET_MAC_INNER_VLAN_INCL_VLC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INNER_VLAN_INCL_VLC_SHIFT)) & ENET_MAC_INNER_VLAN_INCL_VLC_MASK) - -#define ENET_MAC_INNER_VLAN_INCL_VLP_MASK (0x40000U) -#define ENET_MAC_INNER_VLAN_INCL_VLP_SHIFT (18U) -/*! VLP - VLAN Priority Control - * 0b0..VLAN Priority Control is disabled - * 0b1..VLAN Priority Control is enabled - */ -#define ENET_MAC_INNER_VLAN_INCL_VLP(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INNER_VLAN_INCL_VLP_SHIFT)) & ENET_MAC_INNER_VLAN_INCL_VLP_MASK) - -#define ENET_MAC_INNER_VLAN_INCL_CSVL_MASK (0x80000U) -#define ENET_MAC_INNER_VLAN_INCL_CSVL_SHIFT (19U) -/*! CSVL - C-VLAN or S-VLAN - * 0b0..C-VLAN type (0x8100) is inserted - * 0b1..S-VLAN type (0x88A8) is inserted - */ -#define ENET_MAC_INNER_VLAN_INCL_CSVL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INNER_VLAN_INCL_CSVL_SHIFT)) & ENET_MAC_INNER_VLAN_INCL_CSVL_MASK) - -#define ENET_MAC_INNER_VLAN_INCL_VLTI_MASK (0x100000U) -#define ENET_MAC_INNER_VLAN_INCL_VLTI_SHIFT (20U) -/*! VLTI - VLAN Tag Input - * 0b0..VLAN Tag Input is disabled - * 0b1..VLAN Tag Input is enabled - */ -#define ENET_MAC_INNER_VLAN_INCL_VLTI(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INNER_VLAN_INCL_VLTI_SHIFT)) & ENET_MAC_INNER_VLAN_INCL_VLTI_MASK) -/*! @} */ - -/*! @name MAC_TX_FLOW_CTRL_Q - MAC Q0 Tx Flow Control */ -/*! @{ */ - -#define ENET_MAC_TX_FLOW_CTRL_Q_FCB_BPA_MASK (0x1U) -#define ENET_MAC_TX_FLOW_CTRL_Q_FCB_BPA_SHIFT (0U) -/*! FCB_BPA - Flow Control Busy or Backpressure Activate - * 0b0..Flow Control Busy or Backpressure Activate is disabled - * 0b1..Flow Control Busy or Backpressure Activate is enabled - */ -#define ENET_MAC_TX_FLOW_CTRL_Q_FCB_BPA(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TX_FLOW_CTRL_Q_FCB_BPA_SHIFT)) & ENET_MAC_TX_FLOW_CTRL_Q_FCB_BPA_MASK) - -#define ENET_MAC_TX_FLOW_CTRL_Q_TFE_MASK (0x2U) -#define ENET_MAC_TX_FLOW_CTRL_Q_TFE_SHIFT (1U) -/*! TFE - Transmit Flow Control Enable - * 0b0..Transmit Flow Control is disabled - * 0b1..Transmit Flow Control is enabled - */ -#define ENET_MAC_TX_FLOW_CTRL_Q_TFE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TX_FLOW_CTRL_Q_TFE_SHIFT)) & ENET_MAC_TX_FLOW_CTRL_Q_TFE_MASK) - -#define ENET_MAC_TX_FLOW_CTRL_Q_PLT_MASK (0x70U) -#define ENET_MAC_TX_FLOW_CTRL_Q_PLT_SHIFT (4U) -/*! PLT - Pause Low Threshold - * 0b011..Pause Time minus 144 Slot Times (PT -144 slot times) - * 0b100..Pause Time minus 256 Slot Times (PT -256 slot times) - * 0b001..Pause Time minus 28 Slot Times (PT -28 slot times) - * 0b010..Pause Time minus 36 Slot Times (PT -36 slot times) - * 0b000..Pause Time minus 4 Slot Times (PT -4 slot times) - * 0b101..Pause Time minus 512 Slot Times (PT -512 slot times) - * 0b110..Reserved - */ -#define ENET_MAC_TX_FLOW_CTRL_Q_PLT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TX_FLOW_CTRL_Q_PLT_SHIFT)) & ENET_MAC_TX_FLOW_CTRL_Q_PLT_MASK) - -#define ENET_MAC_TX_FLOW_CTRL_Q_DZPQ_MASK (0x80U) -#define ENET_MAC_TX_FLOW_CTRL_Q_DZPQ_SHIFT (7U) -/*! DZPQ - Disable Zero-Quanta Pause - * 0b1..Zero-Quanta Pause packet generation is disabled - * 0b0..Zero-Quanta Pause packet generation is enabled - */ -#define ENET_MAC_TX_FLOW_CTRL_Q_DZPQ(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TX_FLOW_CTRL_Q_DZPQ_SHIFT)) & ENET_MAC_TX_FLOW_CTRL_Q_DZPQ_MASK) - -#define ENET_MAC_TX_FLOW_CTRL_Q_PT_MASK (0xFFFF0000U) -#define ENET_MAC_TX_FLOW_CTRL_Q_PT_SHIFT (16U) -/*! PT - Pause Time */ -#define ENET_MAC_TX_FLOW_CTRL_Q_PT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TX_FLOW_CTRL_Q_PT_SHIFT)) & ENET_MAC_TX_FLOW_CTRL_Q_PT_MASK) -/*! @} */ - -/* The count of ENET_MAC_TX_FLOW_CTRL_Q */ -#define ENET_MAC_TX_FLOW_CTRL_Q_COUNT (1U) - -/*! @name MAC_RX_FLOW_CTRL - MAC Rx Flow Control */ -/*! @{ */ - -#define ENET_MAC_RX_FLOW_CTRL_RFE_MASK (0x1U) -#define ENET_MAC_RX_FLOW_CTRL_RFE_SHIFT (0U) -/*! RFE - Receive Flow Control Enable - * 0b0..Receive Flow Control is disabled - * 0b1..Receive Flow Control is enabled - */ -#define ENET_MAC_RX_FLOW_CTRL_RFE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RX_FLOW_CTRL_RFE_SHIFT)) & ENET_MAC_RX_FLOW_CTRL_RFE_MASK) - -#define ENET_MAC_RX_FLOW_CTRL_UP_MASK (0x2U) -#define ENET_MAC_RX_FLOW_CTRL_UP_SHIFT (1U) -/*! UP - Unicast Pause Packet Detect - * 0b0..Unicast Pause Packet Detect disabled - * 0b1..Unicast Pause Packet Detect enabled - */ -#define ENET_MAC_RX_FLOW_CTRL_UP(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RX_FLOW_CTRL_UP_SHIFT)) & ENET_MAC_RX_FLOW_CTRL_UP_MASK) -/*! @} */ - -/*! @name MAC_RXQ_CTRL4 - Receive Queue Control 4 */ -/*! @{ */ - -#define ENET_MAC_RXQ_CTRL4_UFFQE_MASK (0x1U) -#define ENET_MAC_RXQ_CTRL4_UFFQE_SHIFT (0U) -/*! UFFQE - Unicast Address Filter Fail Packets Queuing Enable. - * 0b0..Unicast Address Filter Fail Packets Queuing is disabled - * 0b1..Unicast Address Filter Fail Packets Queuing is enabled - */ -#define ENET_MAC_RXQ_CTRL4_UFFQE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL4_UFFQE_SHIFT)) & ENET_MAC_RXQ_CTRL4_UFFQE_MASK) - -#define ENET_MAC_RXQ_CTRL4_UFFQ_MASK (0x2U) -#define ENET_MAC_RXQ_CTRL4_UFFQ_SHIFT (1U) -/*! UFFQ - Unicast Address Filter Fail Packets Queue. */ -#define ENET_MAC_RXQ_CTRL4_UFFQ(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL4_UFFQ_SHIFT)) & ENET_MAC_RXQ_CTRL4_UFFQ_MASK) - -#define ENET_MAC_RXQ_CTRL4_MFFQE_MASK (0x100U) -#define ENET_MAC_RXQ_CTRL4_MFFQE_SHIFT (8U) -/*! MFFQE - Multicast Address Filter Fail Packets Queuing Enable. - * 0b0..Multicast Address Filter Fail Packets Queuing is disabled - * 0b1..Multicast Address Filter Fail Packets Queuing is enabled - */ -#define ENET_MAC_RXQ_CTRL4_MFFQE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL4_MFFQE_SHIFT)) & ENET_MAC_RXQ_CTRL4_MFFQE_MASK) - -#define ENET_MAC_RXQ_CTRL4_MFFQ_MASK (0x200U) -#define ENET_MAC_RXQ_CTRL4_MFFQ_SHIFT (9U) -/*! MFFQ - Multicast Address Filter Fail Packets Queue. */ -#define ENET_MAC_RXQ_CTRL4_MFFQ(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL4_MFFQ_SHIFT)) & ENET_MAC_RXQ_CTRL4_MFFQ_MASK) - -#define ENET_MAC_RXQ_CTRL4_VFFQE_MASK (0x10000U) -#define ENET_MAC_RXQ_CTRL4_VFFQE_SHIFT (16U) -/*! VFFQE - VLAN Tag Filter Fail Packets Queuing Enable - * 0b0..VLAN tag Filter Fail Packets Queuing is disabled - * 0b1..VLAN tag Filter Fail Packets Queuing is enabled - */ -#define ENET_MAC_RXQ_CTRL4_VFFQE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL4_VFFQE_SHIFT)) & ENET_MAC_RXQ_CTRL4_VFFQE_MASK) - -#define ENET_MAC_RXQ_CTRL4_VFFQ_MASK (0x20000U) -#define ENET_MAC_RXQ_CTRL4_VFFQ_SHIFT (17U) -/*! VFFQ - VLAN Tag Filter Fail Packets Queue */ -#define ENET_MAC_RXQ_CTRL4_VFFQ(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL4_VFFQ_SHIFT)) & ENET_MAC_RXQ_CTRL4_VFFQ_MASK) -/*! @} */ - -/*! @name MAC_RXQ_CTRL - Receive Queue Control 0..Receive Queue Control 2 */ -/*! @{ */ - -#define ENET_MAC_RXQ_CTRL_AVCPQ_MASK (0x7U) -#define ENET_MAC_RXQ_CTRL_AVCPQ_SHIFT (0U) -/*! AVCPQ - AV Untagged Control Packets Queue - * 0b000..Receive Queue 0 - * 0b001..Receive Queue 1 - */ -#define ENET_MAC_RXQ_CTRL_AVCPQ(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL_AVCPQ_SHIFT)) & ENET_MAC_RXQ_CTRL_AVCPQ_MASK) - -#define ENET_MAC_RXQ_CTRL_PSRQ0_MASK (0xFFU) -#define ENET_MAC_RXQ_CTRL_PSRQ0_SHIFT (0U) -/*! PSRQ0 - Priorities Selected in the Receive Queue 0 */ -#define ENET_MAC_RXQ_CTRL_PSRQ0(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL_PSRQ0_SHIFT)) & ENET_MAC_RXQ_CTRL_PSRQ0_MASK) - -#define ENET_MAC_RXQ_CTRL_RXQ0EN_MASK (0x3U) -#define ENET_MAC_RXQ_CTRL_RXQ0EN_SHIFT (0U) -/*! RXQ0EN - Receive Queue 0 Enable - * 0b00..Queue not enabled - * 0b01..Queue enabled for AV - * 0b10..Queue enabled for DCB/Generic - * 0b11..Reserved - */ -#define ENET_MAC_RXQ_CTRL_RXQ0EN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL_RXQ0EN_SHIFT)) & ENET_MAC_RXQ_CTRL_RXQ0EN_MASK) - -#define ENET_MAC_RXQ_CTRL_RXQ1EN_MASK (0xCU) -#define ENET_MAC_RXQ_CTRL_RXQ1EN_SHIFT (2U) -/*! RXQ1EN - Receive Queue 1 Enable - * 0b00..Queue not enabled - * 0b01..Queue enabled for AV - * 0b10..Queue enabled for DCB/Generic - * 0b11..Reserved - */ -#define ENET_MAC_RXQ_CTRL_RXQ1EN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL_RXQ1EN_SHIFT)) & ENET_MAC_RXQ_CTRL_RXQ1EN_MASK) - -#define ENET_MAC_RXQ_CTRL_PTPQ_MASK (0x70U) -#define ENET_MAC_RXQ_CTRL_PTPQ_SHIFT (4U) -/*! PTPQ - PTP Packets Queue - * 0b000..Receive Queue 0 - * 0b001..Receive Queue 1 - */ -#define ENET_MAC_RXQ_CTRL_PTPQ(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL_PTPQ_SHIFT)) & ENET_MAC_RXQ_CTRL_PTPQ_MASK) - -#define ENET_MAC_RXQ_CTRL_PSRQ1_MASK (0xFF00U) -#define ENET_MAC_RXQ_CTRL_PSRQ1_SHIFT (8U) -/*! PSRQ1 - Priorities Selected in the Receive Queue 1 */ -#define ENET_MAC_RXQ_CTRL_PSRQ1(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL_PSRQ1_SHIFT)) & ENET_MAC_RXQ_CTRL_PSRQ1_MASK) - -#define ENET_MAC_RXQ_CTRL_UPQ_MASK (0x7000U) -#define ENET_MAC_RXQ_CTRL_UPQ_SHIFT (12U) -/*! UPQ - Untagged Packet Queue - * 0b000..Receive Queue 0 - * 0b001..Receive Queue 1 - */ -#define ENET_MAC_RXQ_CTRL_UPQ(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL_UPQ_SHIFT)) & ENET_MAC_RXQ_CTRL_UPQ_MASK) - -#define ENET_MAC_RXQ_CTRL_MCBCQ_MASK (0x70000U) -#define ENET_MAC_RXQ_CTRL_MCBCQ_SHIFT (16U) -/*! MCBCQ - Multicast and Broadcast Queue - * 0b000..Receive Queue 0 - * 0b001..Receive Queue 1 - */ -#define ENET_MAC_RXQ_CTRL_MCBCQ(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL_MCBCQ_SHIFT)) & ENET_MAC_RXQ_CTRL_MCBCQ_MASK) - -#define ENET_MAC_RXQ_CTRL_MCBCQEN_MASK (0x100000U) -#define ENET_MAC_RXQ_CTRL_MCBCQEN_SHIFT (20U) -/*! MCBCQEN - Multicast and Broadcast Queue Enable - * 0b0..Multicast and Broadcast Queue is disabled - * 0b1..Multicast and Broadcast Queue is enabled - */ -#define ENET_MAC_RXQ_CTRL_MCBCQEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL_MCBCQEN_SHIFT)) & ENET_MAC_RXQ_CTRL_MCBCQEN_MASK) - -#define ENET_MAC_RXQ_CTRL_TACPQE_MASK (0x200000U) -#define ENET_MAC_RXQ_CTRL_TACPQE_SHIFT (21U) -/*! TACPQE - Tagged AV Control Packets Queuing Enable. - * 0b0..Tagged AV Control Packets Queuing is disabled - * 0b1..Tagged AV Control Packets Queuing is enabled - */ -#define ENET_MAC_RXQ_CTRL_TACPQE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL_TACPQE_SHIFT)) & ENET_MAC_RXQ_CTRL_TACPQE_MASK) - -#define ENET_MAC_RXQ_CTRL_TPQC_MASK (0xC00000U) -#define ENET_MAC_RXQ_CTRL_TPQC_SHIFT (22U) -/*! TPQC - Tagged PTP over Ethernet Packets Queuing Control. */ -#define ENET_MAC_RXQ_CTRL_TPQC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL_TPQC_SHIFT)) & ENET_MAC_RXQ_CTRL_TPQC_MASK) - -#define ENET_MAC_RXQ_CTRL_OMCBCQ_MASK (0x10000000U) -#define ENET_MAC_RXQ_CTRL_OMCBCQ_SHIFT (28U) -/*! OMCBCQ - OMCBCQ - * 0b0..overriding MCBCQ priority disabled - * 0b1..overriding MCBCQ priority enabled - */ -#define ENET_MAC_RXQ_CTRL_OMCBCQ(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL_OMCBCQ_SHIFT)) & ENET_MAC_RXQ_CTRL_OMCBCQ_MASK) - -#define ENET_MAC_RXQ_CTRL_TBRQE_MASK (0x20000000U) -#define ENET_MAC_RXQ_CTRL_TBRQE_SHIFT (29U) -/*! TBRQE - Type Field Based Rx Queuing Enable */ -#define ENET_MAC_RXQ_CTRL_TBRQE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL_TBRQE_SHIFT)) & ENET_MAC_RXQ_CTRL_TBRQE_MASK) -/*! @} */ - -/* The count of ENET_MAC_RXQ_CTRL */ -#define ENET_MAC_RXQ_CTRL_COUNT (3U) - -/*! @name MAC_INTERRUPT_STATUS - Interrupt Status */ -/*! @{ */ - -#define ENET_MAC_INTERRUPT_STATUS_PHYIS_MASK (0x8U) -#define ENET_MAC_INTERRUPT_STATUS_PHYIS_SHIFT (3U) -/*! PHYIS - PHY Interrupt - * 0b1..PHY Interrupt detected - * 0b0..PHY Interrupt not detected - */ -#define ENET_MAC_INTERRUPT_STATUS_PHYIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INTERRUPT_STATUS_PHYIS_SHIFT)) & ENET_MAC_INTERRUPT_STATUS_PHYIS_MASK) - -#define ENET_MAC_INTERRUPT_STATUS_PMTIS_MASK (0x10U) -#define ENET_MAC_INTERRUPT_STATUS_PMTIS_SHIFT (4U) -/*! PMTIS - PMTIS - * 0b1..PMT Interrupt status active - * 0b0..PMT Interrupt status not active - */ -#define ENET_MAC_INTERRUPT_STATUS_PMTIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INTERRUPT_STATUS_PMTIS_SHIFT)) & ENET_MAC_INTERRUPT_STATUS_PMTIS_MASK) - -#define ENET_MAC_INTERRUPT_STATUS_LPIIS_MASK (0x20U) -#define ENET_MAC_INTERRUPT_STATUS_LPIIS_SHIFT (5U) -/*! LPIIS - LPIIS - * 0b1..LPI Interrupt status active - * 0b0..LPI Interrupt status not active - */ -#define ENET_MAC_INTERRUPT_STATUS_LPIIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INTERRUPT_STATUS_LPIIS_SHIFT)) & ENET_MAC_INTERRUPT_STATUS_LPIIS_MASK) - -#define ENET_MAC_INTERRUPT_STATUS_TSIS_MASK (0x1000U) -#define ENET_MAC_INTERRUPT_STATUS_TSIS_SHIFT (12U) -/*! TSIS - TSIS - * 0b1..Timestamp Interrupt status active - * 0b0..Timestamp Interrupt status not active - */ -#define ENET_MAC_INTERRUPT_STATUS_TSIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INTERRUPT_STATUS_TSIS_SHIFT)) & ENET_MAC_INTERRUPT_STATUS_TSIS_MASK) - -#define ENET_MAC_INTERRUPT_STATUS_TXSTSIS_MASK (0x2000U) -#define ENET_MAC_INTERRUPT_STATUS_TXSTSIS_SHIFT (13U) -/*! TXSTSIS - Transmit Status Interrupt - * 0b1..Transmit Interrupt status active - * 0b0..Transmit Interrupt status not active - */ -#define ENET_MAC_INTERRUPT_STATUS_TXSTSIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INTERRUPT_STATUS_TXSTSIS_SHIFT)) & ENET_MAC_INTERRUPT_STATUS_TXSTSIS_MASK) - -#define ENET_MAC_INTERRUPT_STATUS_RXSTSIS_MASK (0x4000U) -#define ENET_MAC_INTERRUPT_STATUS_RXSTSIS_SHIFT (14U) -/*! RXSTSIS - Receive Status Interrupt - * 0b1..Receive Interrupt status active - * 0b0..Receive Interrupt status not active - */ -#define ENET_MAC_INTERRUPT_STATUS_RXSTSIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INTERRUPT_STATUS_RXSTSIS_SHIFT)) & ENET_MAC_INTERRUPT_STATUS_RXSTSIS_MASK) - -#define ENET_MAC_INTERRUPT_STATUS_MDIOIS_MASK (0x40000U) -#define ENET_MAC_INTERRUPT_STATUS_MDIOIS_SHIFT (18U) -/*! MDIOIS - MDIO Interrupt Status - * 0b1..MDIO Interrupt status active - * 0b0..MDIO Interrupt status not active - */ -#define ENET_MAC_INTERRUPT_STATUS_MDIOIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INTERRUPT_STATUS_MDIOIS_SHIFT)) & ENET_MAC_INTERRUPT_STATUS_MDIOIS_MASK) -/*! @} */ - -/*! @name MAC_INTERRUPT_ENABLE - Interrupt Enable */ -/*! @{ */ - -#define ENET_MAC_INTERRUPT_ENABLE_PHYIE_MASK (0x8U) -#define ENET_MAC_INTERRUPT_ENABLE_PHYIE_SHIFT (3U) -/*! PHYIE - PHY Interrupt Enable - * 0b0..PHY Interrupt is disabled - * 0b1..PHY Interrupt is enabled - */ -#define ENET_MAC_INTERRUPT_ENABLE_PHYIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INTERRUPT_ENABLE_PHYIE_SHIFT)) & ENET_MAC_INTERRUPT_ENABLE_PHYIE_MASK) - -#define ENET_MAC_INTERRUPT_ENABLE_PMTIE_MASK (0x10U) -#define ENET_MAC_INTERRUPT_ENABLE_PMTIE_SHIFT (4U) -/*! PMTIE - PMT Interrupt Enable - * 0b0..PMT Interrupt is disabled - * 0b1..PMT Interrupt is enabled - */ -#define ENET_MAC_INTERRUPT_ENABLE_PMTIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INTERRUPT_ENABLE_PMTIE_SHIFT)) & ENET_MAC_INTERRUPT_ENABLE_PMTIE_MASK) - -#define ENET_MAC_INTERRUPT_ENABLE_LPIIE_MASK (0x20U) -#define ENET_MAC_INTERRUPT_ENABLE_LPIIE_SHIFT (5U) -/*! LPIIE - LPI Interrupt Enable - * 0b0..LPI Interrupt is disabled - * 0b1..LPI Interrupt is enabled - */ -#define ENET_MAC_INTERRUPT_ENABLE_LPIIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INTERRUPT_ENABLE_LPIIE_SHIFT)) & ENET_MAC_INTERRUPT_ENABLE_LPIIE_MASK) - -#define ENET_MAC_INTERRUPT_ENABLE_TSIE_MASK (0x1000U) -#define ENET_MAC_INTERRUPT_ENABLE_TSIE_SHIFT (12U) -/*! TSIE - Timestamp Interrupt Enable - * 0b0..Timestamp Interrupt is disabled - * 0b1..Timestamp Interrupt is enabled - */ -#define ENET_MAC_INTERRUPT_ENABLE_TSIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INTERRUPT_ENABLE_TSIE_SHIFT)) & ENET_MAC_INTERRUPT_ENABLE_TSIE_MASK) - -#define ENET_MAC_INTERRUPT_ENABLE_TXSTSIE_MASK (0x2000U) -#define ENET_MAC_INTERRUPT_ENABLE_TXSTSIE_SHIFT (13U) -/*! TXSTSIE - Transmit Status Interrupt Enable - * 0b0..Timestamp Status Interrupt is disabled - * 0b1..Timestamp Status Interrupt is enabled - */ -#define ENET_MAC_INTERRUPT_ENABLE_TXSTSIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INTERRUPT_ENABLE_TXSTSIE_SHIFT)) & ENET_MAC_INTERRUPT_ENABLE_TXSTSIE_MASK) - -#define ENET_MAC_INTERRUPT_ENABLE_RXSTSIE_MASK (0x4000U) -#define ENET_MAC_INTERRUPT_ENABLE_RXSTSIE_SHIFT (14U) -/*! RXSTSIE - Receive Status Interrupt Enable - * 0b0..Receive Status Interrupt is disabled - * 0b1..Receive Status Interrupt is enabled - */ -#define ENET_MAC_INTERRUPT_ENABLE_RXSTSIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INTERRUPT_ENABLE_RXSTSIE_SHIFT)) & ENET_MAC_INTERRUPT_ENABLE_RXSTSIE_MASK) - -#define ENET_MAC_INTERRUPT_ENABLE_MDIOIE_MASK (0x40000U) -#define ENET_MAC_INTERRUPT_ENABLE_MDIOIE_SHIFT (18U) -/*! MDIOIE - MDIO Interrupt Enable - * 0b0..MDIO Interrupt is disabled - * 0b1..MDIO Interrupt is enabled - */ -#define ENET_MAC_INTERRUPT_ENABLE_MDIOIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INTERRUPT_ENABLE_MDIOIE_SHIFT)) & ENET_MAC_INTERRUPT_ENABLE_MDIOIE_MASK) -/*! @} */ - -/*! @name MAC_RX_TX_STATUS - Receive Transmit Status */ -/*! @{ */ - -#define ENET_MAC_RX_TX_STATUS_TJT_MASK (0x1U) -#define ENET_MAC_RX_TX_STATUS_TJT_SHIFT (0U) -/*! TJT - Transmit Jabber Timeout - * 0b1..Transmit Jabber Timeout occurred - * 0b0..No Transmit Jabber Timeout - */ -#define ENET_MAC_RX_TX_STATUS_TJT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RX_TX_STATUS_TJT_SHIFT)) & ENET_MAC_RX_TX_STATUS_TJT_MASK) - -#define ENET_MAC_RX_TX_STATUS_NCARR_MASK (0x2U) -#define ENET_MAC_RX_TX_STATUS_NCARR_SHIFT (1U) -/*! NCARR - No Carrier - * 0b1..No carrier - * 0b0..Carrier is present - */ -#define ENET_MAC_RX_TX_STATUS_NCARR(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RX_TX_STATUS_NCARR_SHIFT)) & ENET_MAC_RX_TX_STATUS_NCARR_MASK) - -#define ENET_MAC_RX_TX_STATUS_LCARR_MASK (0x4U) -#define ENET_MAC_RX_TX_STATUS_LCARR_SHIFT (2U) -/*! LCARR - Loss of Carrier - * 0b1..Loss of carrier - * 0b0..Carrier is present - */ -#define ENET_MAC_RX_TX_STATUS_LCARR(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RX_TX_STATUS_LCARR_SHIFT)) & ENET_MAC_RX_TX_STATUS_LCARR_MASK) - -#define ENET_MAC_RX_TX_STATUS_EXDEF_MASK (0x8U) -#define ENET_MAC_RX_TX_STATUS_EXDEF_SHIFT (3U) -/*! EXDEF - Excessive Deferral - * 0b1..Excessive deferral - * 0b0..No Excessive deferral - */ -#define ENET_MAC_RX_TX_STATUS_EXDEF(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RX_TX_STATUS_EXDEF_SHIFT)) & ENET_MAC_RX_TX_STATUS_EXDEF_MASK) - -#define ENET_MAC_RX_TX_STATUS_LCOL_MASK (0x10U) -#define ENET_MAC_RX_TX_STATUS_LCOL_SHIFT (4U) -/*! LCOL - Late Collision - * 0b1..Late collision is sensed - * 0b0..No collision - */ -#define ENET_MAC_RX_TX_STATUS_LCOL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RX_TX_STATUS_LCOL_SHIFT)) & ENET_MAC_RX_TX_STATUS_LCOL_MASK) - -#define ENET_MAC_RX_TX_STATUS_EXCOL_MASK (0x20U) -#define ENET_MAC_RX_TX_STATUS_EXCOL_SHIFT (5U) -/*! EXCOL - Excessive Collisions - * 0b1..Excessive collision is sensed - * 0b0..No collision - */ -#define ENET_MAC_RX_TX_STATUS_EXCOL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RX_TX_STATUS_EXCOL_SHIFT)) & ENET_MAC_RX_TX_STATUS_EXCOL_MASK) - -#define ENET_MAC_RX_TX_STATUS_RWT_MASK (0x100U) -#define ENET_MAC_RX_TX_STATUS_RWT_SHIFT (8U) -/*! RWT - Receive Watchdog Timeout - * 0b1..Receive watchdog timed out - * 0b0..No receive watchdog timeout - */ -#define ENET_MAC_RX_TX_STATUS_RWT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RX_TX_STATUS_RWT_SHIFT)) & ENET_MAC_RX_TX_STATUS_RWT_MASK) -/*! @} */ - -/*! @name MAC_PMT_CONTROL_STATUS - PMT Control and Status */ -/*! @{ */ - -#define ENET_MAC_PMT_CONTROL_STATUS_PWRDWN_MASK (0x1U) -#define ENET_MAC_PMT_CONTROL_STATUS_PWRDWN_SHIFT (0U) -/*! PWRDWN - Power Down - * 0b0..Power down is disabled - * 0b1..Power down is enabled - */ -#define ENET_MAC_PMT_CONTROL_STATUS_PWRDWN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PMT_CONTROL_STATUS_PWRDWN_SHIFT)) & ENET_MAC_PMT_CONTROL_STATUS_PWRDWN_MASK) - -#define ENET_MAC_PMT_CONTROL_STATUS_MGKPKTEN_MASK (0x2U) -#define ENET_MAC_PMT_CONTROL_STATUS_MGKPKTEN_SHIFT (1U) -/*! MGKPKTEN - Magic Packet Enable - * 0b0..Magic Packet is disabled - * 0b1..Magic Packet is enabled - */ -#define ENET_MAC_PMT_CONTROL_STATUS_MGKPKTEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PMT_CONTROL_STATUS_MGKPKTEN_SHIFT)) & ENET_MAC_PMT_CONTROL_STATUS_MGKPKTEN_MASK) - -#define ENET_MAC_PMT_CONTROL_STATUS_RWKPKTEN_MASK (0x4U) -#define ENET_MAC_PMT_CONTROL_STATUS_RWKPKTEN_SHIFT (2U) -/*! RWKPKTEN - Remote Wake-Up Packet Enable - * 0b0..Remote wake-up packet is disabled - * 0b1..Remote wake-up packet is enabled - */ -#define ENET_MAC_PMT_CONTROL_STATUS_RWKPKTEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PMT_CONTROL_STATUS_RWKPKTEN_SHIFT)) & ENET_MAC_PMT_CONTROL_STATUS_RWKPKTEN_MASK) - -#define ENET_MAC_PMT_CONTROL_STATUS_MGKPRCVD_MASK (0x20U) -#define ENET_MAC_PMT_CONTROL_STATUS_MGKPRCVD_SHIFT (5U) -/*! MGKPRCVD - Magic Packet Received - * 0b1..Magic packet is received - * 0b0..No Magic packet is received - */ -#define ENET_MAC_PMT_CONTROL_STATUS_MGKPRCVD(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PMT_CONTROL_STATUS_MGKPRCVD_SHIFT)) & ENET_MAC_PMT_CONTROL_STATUS_MGKPRCVD_MASK) - -#define ENET_MAC_PMT_CONTROL_STATUS_RWKPRCVD_MASK (0x40U) -#define ENET_MAC_PMT_CONTROL_STATUS_RWKPRCVD_SHIFT (6U) -/*! RWKPRCVD - Remote Wake-Up Packet Received - * 0b1..Remote wake-up packet is received - * 0b0..Remote wake-up packet is received - */ -#define ENET_MAC_PMT_CONTROL_STATUS_RWKPRCVD(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PMT_CONTROL_STATUS_RWKPRCVD_SHIFT)) & ENET_MAC_PMT_CONTROL_STATUS_RWKPRCVD_MASK) - -#define ENET_MAC_PMT_CONTROL_STATUS_GLBLUCAST_MASK (0x200U) -#define ENET_MAC_PMT_CONTROL_STATUS_GLBLUCAST_SHIFT (9U) -/*! GLBLUCAST - Global Unicast - * 0b0..Global unicast is disabled - * 0b1..Global unicast is enabled - */ -#define ENET_MAC_PMT_CONTROL_STATUS_GLBLUCAST(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PMT_CONTROL_STATUS_GLBLUCAST_SHIFT)) & ENET_MAC_PMT_CONTROL_STATUS_GLBLUCAST_MASK) - -#define ENET_MAC_PMT_CONTROL_STATUS_RWKPFE_MASK (0x400U) -#define ENET_MAC_PMT_CONTROL_STATUS_RWKPFE_SHIFT (10U) -/*! RWKPFE - Remote Wake-up Packet Forwarding Enable - * 0b0..Remote Wake-up Packet Forwarding is disabled - * 0b1..Remote Wake-up Packet Forwarding is enabled - */ -#define ENET_MAC_PMT_CONTROL_STATUS_RWKPFE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PMT_CONTROL_STATUS_RWKPFE_SHIFT)) & ENET_MAC_PMT_CONTROL_STATUS_RWKPFE_MASK) - -#define ENET_MAC_PMT_CONTROL_STATUS_RWKPTR_MASK (0x1F000000U) -#define ENET_MAC_PMT_CONTROL_STATUS_RWKPTR_SHIFT (24U) -/*! RWKPTR - Remote Wake-up FIFO Pointer */ -#define ENET_MAC_PMT_CONTROL_STATUS_RWKPTR(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PMT_CONTROL_STATUS_RWKPTR_SHIFT)) & ENET_MAC_PMT_CONTROL_STATUS_RWKPTR_MASK) - -#define ENET_MAC_PMT_CONTROL_STATUS_RWKFILTRST_MASK (0x80000000U) -#define ENET_MAC_PMT_CONTROL_STATUS_RWKFILTRST_SHIFT (31U) -/*! RWKFILTRST - Remote Wake-Up Packet Filter Register Pointer Reset - * 0b0..Remote Wake-Up Packet Filter Register Pointer is not Reset - * 0b1..Remote Wake-Up Packet Filter Register Pointer is Reset - */ -#define ENET_MAC_PMT_CONTROL_STATUS_RWKFILTRST(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PMT_CONTROL_STATUS_RWKFILTRST_SHIFT)) & ENET_MAC_PMT_CONTROL_STATUS_RWKFILTRST_MASK) -/*! @} */ - -/*! @name MAC_RWK_PACKET_FILTER - Remote Wakeup Filter */ -/*! @{ */ - -#define ENET_MAC_RWK_PACKET_FILTER_WKUPFRMFTR_MASK (0xFFFFFFFFU) -#define ENET_MAC_RWK_PACKET_FILTER_WKUPFRMFTR_SHIFT (0U) -/*! WKUPFRMFTR - RWK Packet Filter */ -#define ENET_MAC_RWK_PACKET_FILTER_WKUPFRMFTR(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RWK_PACKET_FILTER_WKUPFRMFTR_SHIFT)) & ENET_MAC_RWK_PACKET_FILTER_WKUPFRMFTR_MASK) -/*! @} */ - -/*! @name MAC_LPI_CONTROL_STATUS - LPI Control and Status */ -/*! @{ */ - -#define ENET_MAC_LPI_CONTROL_STATUS_TLPIEN_MASK (0x1U) -#define ENET_MAC_LPI_CONTROL_STATUS_TLPIEN_SHIFT (0U) -/*! TLPIEN - Transmit LPI Entry - * 0b1..Transmit LPI entry detected - * 0b0..Transmit LPI entry not detected - */ -#define ENET_MAC_LPI_CONTROL_STATUS_TLPIEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_LPI_CONTROL_STATUS_TLPIEN_SHIFT)) & ENET_MAC_LPI_CONTROL_STATUS_TLPIEN_MASK) - -#define ENET_MAC_LPI_CONTROL_STATUS_TLPIEX_MASK (0x2U) -#define ENET_MAC_LPI_CONTROL_STATUS_TLPIEX_SHIFT (1U) -/*! TLPIEX - Transmit LPI Exit - * 0b1..Transmit LPI exit detected - * 0b0..Transmit LPI exit not detected - */ -#define ENET_MAC_LPI_CONTROL_STATUS_TLPIEX(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_LPI_CONTROL_STATUS_TLPIEX_SHIFT)) & ENET_MAC_LPI_CONTROL_STATUS_TLPIEX_MASK) - -#define ENET_MAC_LPI_CONTROL_STATUS_RLPIEN_MASK (0x4U) -#define ENET_MAC_LPI_CONTROL_STATUS_RLPIEN_SHIFT (2U) -/*! RLPIEN - Receive LPI Entry - * 0b1..Receive LPI entry detected - * 0b0..Receive LPI entry not detected - */ -#define ENET_MAC_LPI_CONTROL_STATUS_RLPIEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_LPI_CONTROL_STATUS_RLPIEN_SHIFT)) & ENET_MAC_LPI_CONTROL_STATUS_RLPIEN_MASK) - -#define ENET_MAC_LPI_CONTROL_STATUS_RLPIEX_MASK (0x8U) -#define ENET_MAC_LPI_CONTROL_STATUS_RLPIEX_SHIFT (3U) -/*! RLPIEX - Receive LPI Exit - * 0b1..Receive LPI exit detected - * 0b0..Receive LPI exit not detected - */ -#define ENET_MAC_LPI_CONTROL_STATUS_RLPIEX(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_LPI_CONTROL_STATUS_RLPIEX_SHIFT)) & ENET_MAC_LPI_CONTROL_STATUS_RLPIEX_MASK) - -#define ENET_MAC_LPI_CONTROL_STATUS_TLPIST_MASK (0x100U) -#define ENET_MAC_LPI_CONTROL_STATUS_TLPIST_SHIFT (8U) -/*! TLPIST - Transmit LPI State - * 0b1..Transmit LPI state detected - * 0b0..Transmit LPI state not detected - */ -#define ENET_MAC_LPI_CONTROL_STATUS_TLPIST(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_LPI_CONTROL_STATUS_TLPIST_SHIFT)) & ENET_MAC_LPI_CONTROL_STATUS_TLPIST_MASK) - -#define ENET_MAC_LPI_CONTROL_STATUS_RLPIST_MASK (0x200U) -#define ENET_MAC_LPI_CONTROL_STATUS_RLPIST_SHIFT (9U) -/*! RLPIST - Receive LPI State - * 0b1..Receive LPI state detected - * 0b0..Receive LPI state not detected - */ -#define ENET_MAC_LPI_CONTROL_STATUS_RLPIST(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_LPI_CONTROL_STATUS_RLPIST_SHIFT)) & ENET_MAC_LPI_CONTROL_STATUS_RLPIST_MASK) - -#define ENET_MAC_LPI_CONTROL_STATUS_LPIEN_MASK (0x10000U) -#define ENET_MAC_LPI_CONTROL_STATUS_LPIEN_SHIFT (16U) -/*! LPIEN - LPI Enable - * 0b0..LPI state is disabled - * 0b1..LPI state is enabled - */ -#define ENET_MAC_LPI_CONTROL_STATUS_LPIEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_LPI_CONTROL_STATUS_LPIEN_SHIFT)) & ENET_MAC_LPI_CONTROL_STATUS_LPIEN_MASK) - -#define ENET_MAC_LPI_CONTROL_STATUS_PLS_MASK (0x20000U) -#define ENET_MAC_LPI_CONTROL_STATUS_PLS_SHIFT (17U) -/*! PLS - PHY Link Status - * 0b0..link is down - * 0b1..link is okay (UP) - */ -#define ENET_MAC_LPI_CONTROL_STATUS_PLS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_LPI_CONTROL_STATUS_PLS_SHIFT)) & ENET_MAC_LPI_CONTROL_STATUS_PLS_MASK) - -#define ENET_MAC_LPI_CONTROL_STATUS_LPITXA_MASK (0x80000U) -#define ENET_MAC_LPI_CONTROL_STATUS_LPITXA_SHIFT (19U) -/*! LPITXA - LPI Tx Automate - * 0b0..LPI Tx Automate is disabled - * 0b1..LPI Tx Automate is enabled - */ -#define ENET_MAC_LPI_CONTROL_STATUS_LPITXA(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_LPI_CONTROL_STATUS_LPITXA_SHIFT)) & ENET_MAC_LPI_CONTROL_STATUS_LPITXA_MASK) - -#define ENET_MAC_LPI_CONTROL_STATUS_LPIATE_MASK (0x100000U) -#define ENET_MAC_LPI_CONTROL_STATUS_LPIATE_SHIFT (20U) -/*! LPIATE - LPI Timer Enable - * 0b0..LPI Timer is disabled - * 0b1..LPI Timer is enabled - */ -#define ENET_MAC_LPI_CONTROL_STATUS_LPIATE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_LPI_CONTROL_STATUS_LPIATE_SHIFT)) & ENET_MAC_LPI_CONTROL_STATUS_LPIATE_MASK) - -#define ENET_MAC_LPI_CONTROL_STATUS_LPITCSE_MASK (0x200000U) -#define ENET_MAC_LPI_CONTROL_STATUS_LPITCSE_SHIFT (21U) -/*! LPITCSE - LPI Tx Clock Stop Enable - * 0b0..LPI Tx Clock Stop is disabled - * 0b1..LPI Tx Clock Stop is enabled - */ -#define ENET_MAC_LPI_CONTROL_STATUS_LPITCSE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_LPI_CONTROL_STATUS_LPITCSE_SHIFT)) & ENET_MAC_LPI_CONTROL_STATUS_LPITCSE_MASK) -/*! @} */ - -/*! @name MAC_LPI_TIMERS_CONTROL - LPI Timers Control */ -/*! @{ */ - -#define ENET_MAC_LPI_TIMERS_CONTROL_TWT_MASK (0xFFFFU) -#define ENET_MAC_LPI_TIMERS_CONTROL_TWT_SHIFT (0U) -/*! TWT - LPI TW Timer */ -#define ENET_MAC_LPI_TIMERS_CONTROL_TWT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_LPI_TIMERS_CONTROL_TWT_SHIFT)) & ENET_MAC_LPI_TIMERS_CONTROL_TWT_MASK) - -#define ENET_MAC_LPI_TIMERS_CONTROL_LST_MASK (0x3FF0000U) -#define ENET_MAC_LPI_TIMERS_CONTROL_LST_SHIFT (16U) -/*! LST - LPI LS Timer */ -#define ENET_MAC_LPI_TIMERS_CONTROL_LST(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_LPI_TIMERS_CONTROL_LST_SHIFT)) & ENET_MAC_LPI_TIMERS_CONTROL_LST_MASK) -/*! @} */ - -/*! @name MAC_LPI_ENTRY_TIMER - Tx LPI Entry Timer Control */ -/*! @{ */ - -#define ENET_MAC_LPI_ENTRY_TIMER_LPIET_MASK (0xFFFF8U) -#define ENET_MAC_LPI_ENTRY_TIMER_LPIET_SHIFT (3U) -/*! LPIET - LPI Entry Timer */ -#define ENET_MAC_LPI_ENTRY_TIMER_LPIET(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_LPI_ENTRY_TIMER_LPIET_SHIFT)) & ENET_MAC_LPI_ENTRY_TIMER_LPIET_MASK) -/*! @} */ - -/*! @name MAC_ONEUS_TIC_COUNTER - One-microsecond Reference Timer */ -/*! @{ */ - -#define ENET_MAC_ONEUS_TIC_COUNTER_TIC_1US_CNTR_MASK (0xFFFU) -#define ENET_MAC_ONEUS_TIC_COUNTER_TIC_1US_CNTR_SHIFT (0U) -/*! TIC_1US_CNTR - 1US TIC Counter */ -#define ENET_MAC_ONEUS_TIC_COUNTER_TIC_1US_CNTR(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_ONEUS_TIC_COUNTER_TIC_1US_CNTR_SHIFT)) & ENET_MAC_ONEUS_TIC_COUNTER_TIC_1US_CNTR_MASK) -/*! @} */ - -/*! @name MAC_VERSION - MAC Version */ -/*! @{ */ - -#define ENET_MAC_VERSION_SNPSVER_MASK (0xFFU) -#define ENET_MAC_VERSION_SNPSVER_SHIFT (0U) -/*! SNPSVER - Synopsys-defined Version */ -#define ENET_MAC_VERSION_SNPSVER(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VERSION_SNPSVER_SHIFT)) & ENET_MAC_VERSION_SNPSVER_MASK) - -#define ENET_MAC_VERSION_USERVER_MASK (0xFF00U) -#define ENET_MAC_VERSION_USERVER_SHIFT (8U) -/*! USERVER - User-defined Version */ -#define ENET_MAC_VERSION_USERVER(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VERSION_USERVER_SHIFT)) & ENET_MAC_VERSION_USERVER_MASK) -/*! @} */ - -/*! @name MAC_DEBUG - MAC Debug */ -/*! @{ */ - -#define ENET_MAC_DEBUG_RPESTS_MASK (0x1U) -#define ENET_MAC_DEBUG_RPESTS_SHIFT (0U) -/*! RPESTS - MAC GMII or MII Receive Protocol Engine Status - * 0b1..MAC GMII or MII Receive Protocol Engine Status detected - * 0b0..MAC GMII or MII Receive Protocol Engine Status not detected - */ -#define ENET_MAC_DEBUG_RPESTS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_DEBUG_RPESTS_SHIFT)) & ENET_MAC_DEBUG_RPESTS_MASK) - -#define ENET_MAC_DEBUG_RFCFCSTS_MASK (0x6U) -#define ENET_MAC_DEBUG_RFCFCSTS_SHIFT (1U) -/*! RFCFCSTS - MAC Receive Packet Controller FIFO Status */ -#define ENET_MAC_DEBUG_RFCFCSTS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_DEBUG_RFCFCSTS_SHIFT)) & ENET_MAC_DEBUG_RFCFCSTS_MASK) - -#define ENET_MAC_DEBUG_TPESTS_MASK (0x10000U) -#define ENET_MAC_DEBUG_TPESTS_SHIFT (16U) -/*! TPESTS - MAC GMII or MII Transmit Protocol Engine Status - * 0b1..MAC GMII or MII Transmit Protocol Engine Status detected - * 0b0..MAC GMII or MII Transmit Protocol Engine Status not detected - */ -#define ENET_MAC_DEBUG_TPESTS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_DEBUG_TPESTS_SHIFT)) & ENET_MAC_DEBUG_TPESTS_MASK) - -#define ENET_MAC_DEBUG_TFCSTS_MASK (0x60000U) -#define ENET_MAC_DEBUG_TFCSTS_SHIFT (17U) -/*! TFCSTS - MAC Transmit Packet Controller Status - * 0b10..Generating and transmitting a Pause control packet (in full-duplex mode) - * 0b00..Idle state - * 0b11..Transferring input packet for transmission - * 0b01..Waiting for one of the following: Status of the previous packet OR IPG or back off period to be over - */ -#define ENET_MAC_DEBUG_TFCSTS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_DEBUG_TFCSTS_SHIFT)) & ENET_MAC_DEBUG_TFCSTS_MASK) -/*! @} */ - -/*! @name MAC_HW_FEAT - Hardware Features 0..Hardware Features 3 */ -/*! @{ */ - -#define ENET_MAC_HW_FEAT_MIISEL_MASK (0x1U) -#define ENET_MAC_HW_FEAT_MIISEL_SHIFT (0U) -/*! MIISEL - 10 or 100 Mbps Support - * 0b1..10 or 100 Mbps support - * 0b0..No 10 or 100 Mbps support - */ -#define ENET_MAC_HW_FEAT_MIISEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_MIISEL_SHIFT)) & ENET_MAC_HW_FEAT_MIISEL_MASK) - -#define ENET_MAC_HW_FEAT_NRVF_MASK (0x7U) -#define ENET_MAC_HW_FEAT_NRVF_SHIFT (0U) -/*! NRVF - Number of Extended VLAN Tag Filters Enabled - * 0b011..16 Extended Rx VLAN Filters - * 0b100..24 Extended Rx VLAN Filters - * 0b101..32 Extended Rx VLAN Filters - * 0b001..4 Extended Rx VLAN Filters - * 0b010..8 Extended Rx VLAN Filters - * 0b000..No Extended Rx VLAN Filters - * 0b110..Reserved - */ -#define ENET_MAC_HW_FEAT_NRVF(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_NRVF_SHIFT)) & ENET_MAC_HW_FEAT_NRVF_MASK) - -#define ENET_MAC_HW_FEAT_RXFIFOSIZE_MASK (0x1FU) -#define ENET_MAC_HW_FEAT_RXFIFOSIZE_SHIFT (0U) -/*! RXFIFOSIZE - MTL Receive FIFO Size - * 0b00011..1024 bytes - * 0b00000..128 bytes - * 0b01010..128 KB - * 0b00111..16384 bytes - * 0b00100..2048 bytes - * 0b00001..256 bytes - * 0b01011..256 KB - * 0b01000..32 KB - * 0b00101..4096 bytes - * 0b00010..512 bytes - * 0b01001..64 KB - * 0b00110..8192 bytes - * 0b01100..Reserved - */ -#define ENET_MAC_HW_FEAT_RXFIFOSIZE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_RXFIFOSIZE_SHIFT)) & ENET_MAC_HW_FEAT_RXFIFOSIZE_MASK) - -#define ENET_MAC_HW_FEAT_RXQCNT_MASK (0xFU) -#define ENET_MAC_HW_FEAT_RXQCNT_SHIFT (0U) -/*! RXQCNT - Number of MTL Receive Queues - * 0b0000..1 MTL Rx Queue - * 0b0001..2 MTL Rx Queues - * 0b0010..3 MTL Rx Queues - * 0b0011..4 MTL Rx Queues - * 0b0100..5 MTL Rx Queues - * 0b0101..6 MTL Rx Queues - * 0b0110..7 MTL Rx Queues - * 0b0111..8 MTL Rx Queues - */ -#define ENET_MAC_HW_FEAT_RXQCNT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_RXQCNT_SHIFT)) & ENET_MAC_HW_FEAT_RXQCNT_MASK) - -#define ENET_MAC_HW_FEAT_GMIISEL_MASK (0x2U) -#define ENET_MAC_HW_FEAT_GMIISEL_SHIFT (1U) -/*! GMIISEL - 1000 Mbps Support - * 0b1..1000 Mbps support - * 0b0..No 1000 Mbps support - */ -#define ENET_MAC_HW_FEAT_GMIISEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_GMIISEL_SHIFT)) & ENET_MAC_HW_FEAT_GMIISEL_MASK) - -#define ENET_MAC_HW_FEAT_HDSEL_MASK (0x4U) -#define ENET_MAC_HW_FEAT_HDSEL_SHIFT (2U) -/*! HDSEL - Half-duplex Support - * 0b1..Half-duplex support - * 0b0..No Half-duplex support - */ -#define ENET_MAC_HW_FEAT_HDSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_HDSEL_SHIFT)) & ENET_MAC_HW_FEAT_HDSEL_MASK) - -#define ENET_MAC_HW_FEAT_PCSSEL_MASK (0x8U) -#define ENET_MAC_HW_FEAT_PCSSEL_SHIFT (3U) -/*! PCSSEL - PCS Registers (TBI, SGMII, or RTBI PHY interface) - * 0b1..PCS Registers (TBI, SGMII, or RTBI PHY interface) - * 0b0..No PCS Registers (TBI, SGMII, or RTBI PHY interface) - */ -#define ENET_MAC_HW_FEAT_PCSSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_PCSSEL_SHIFT)) & ENET_MAC_HW_FEAT_PCSSEL_MASK) - -#define ENET_MAC_HW_FEAT_CBTISEL_MASK (0x10U) -#define ENET_MAC_HW_FEAT_CBTISEL_SHIFT (4U) -/*! CBTISEL - Queue/Channel based VLAN tag insertion on Tx Enable - * 0b1..Enable Queue/Channel based VLAN tag insertion on Tx feature is selected - * 0b0..Enable Queue/Channel based VLAN tag insertion on Tx feature is not selected - */ -#define ENET_MAC_HW_FEAT_CBTISEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_CBTISEL_SHIFT)) & ENET_MAC_HW_FEAT_CBTISEL_MASK) - -#define ENET_MAC_HW_FEAT_VLHASH_MASK (0x10U) -#define ENET_MAC_HW_FEAT_VLHASH_SHIFT (4U) -/*! VLHASH - VLAN Hash Filter Selected - * 0b1..VLAN Hash Filter selected - * 0b0..VLAN Hash Filter not selected - */ -#define ENET_MAC_HW_FEAT_VLHASH(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_VLHASH_SHIFT)) & ENET_MAC_HW_FEAT_VLHASH_MASK) - -#define ENET_MAC_HW_FEAT_DVLAN_MASK (0x20U) -#define ENET_MAC_HW_FEAT_DVLAN_SHIFT (5U) -/*! DVLAN - Double VLAN Tag Processing Selected - * 0b1..Double VLAN option is selected - * 0b0..Double VLAN option is not selected - */ -#define ENET_MAC_HW_FEAT_DVLAN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_DVLAN_SHIFT)) & ENET_MAC_HW_FEAT_DVLAN_MASK) - -#define ENET_MAC_HW_FEAT_SMASEL_MASK (0x20U) -#define ENET_MAC_HW_FEAT_SMASEL_SHIFT (5U) -/*! SMASEL - SMA (MDIO) Interface - * 0b1..SMA (MDIO) Interface selected - * 0b0..SMA (MDIO) Interface not selected - */ -#define ENET_MAC_HW_FEAT_SMASEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_SMASEL_SHIFT)) & ENET_MAC_HW_FEAT_SMASEL_MASK) - -#define ENET_MAC_HW_FEAT_SPRAM_MASK (0x20U) -#define ENET_MAC_HW_FEAT_SPRAM_SHIFT (5U) -/*! SPRAM - Single Port RAM Enable - * 0b1..Single Port RAM feature is selected - * 0b0..Single Port RAM feature is not selected - */ -#define ENET_MAC_HW_FEAT_SPRAM(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_SPRAM_SHIFT)) & ENET_MAC_HW_FEAT_SPRAM_MASK) - -#define ENET_MAC_HW_FEAT_RWKSEL_MASK (0x40U) -#define ENET_MAC_HW_FEAT_RWKSEL_SHIFT (6U) -/*! RWKSEL - PMT Remote Wake-up Packet Enable - * 0b1..PMT Remote Wake-up Packet Enable option is selected - * 0b0..PMT Remote Wake-up Packet Enable option is not selected - */ -#define ENET_MAC_HW_FEAT_RWKSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_RWKSEL_SHIFT)) & ENET_MAC_HW_FEAT_RWKSEL_MASK) - -#define ENET_MAC_HW_FEAT_TXFIFOSIZE_MASK (0x7C0U) -#define ENET_MAC_HW_FEAT_TXFIFOSIZE_SHIFT (6U) -/*! TXFIFOSIZE - MTL Transmit FIFO Size - * 0b00011..1024 bytes - * 0b00000..128 bytes - * 0b01010..128 KB - * 0b00111..16384 bytes - * 0b00100..2048 bytes - * 0b00001..256 bytes - * 0b01000..32 KB - * 0b00101..4096 bytes - * 0b00010..512 bytes - * 0b01001..64 KB - * 0b00110..8192 bytes - * 0b01011..Reserved - */ -#define ENET_MAC_HW_FEAT_TXFIFOSIZE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_TXFIFOSIZE_SHIFT)) & ENET_MAC_HW_FEAT_TXFIFOSIZE_MASK) - -#define ENET_MAC_HW_FEAT_TXQCNT_MASK (0x3C0U) -#define ENET_MAC_HW_FEAT_TXQCNT_SHIFT (6U) -/*! TXQCNT - Number of MTL Transmit Queues - * 0b0000..1 MTL Tx Queue - * 0b0001..2 MTL Tx Queues - * 0b0010..3 MTL Tx Queues - * 0b0011..4 MTL Tx Queues - * 0b0100..5 MTL Tx Queues - * 0b0101..6 MTL Tx Queues - * 0b0110..7 MTL Tx Queues - * 0b0111..8 MTL Tx Queues - */ -#define ENET_MAC_HW_FEAT_TXQCNT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_TXQCNT_SHIFT)) & ENET_MAC_HW_FEAT_TXQCNT_MASK) - -#define ENET_MAC_HW_FEAT_MGKSEL_MASK (0x80U) -#define ENET_MAC_HW_FEAT_MGKSEL_SHIFT (7U) -/*! MGKSEL - PMT Magic Packet Enable - * 0b1..PMT Magic Packet Enable option is selected - * 0b0..PMT Magic Packet Enable option is not selected - */ -#define ENET_MAC_HW_FEAT_MGKSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_MGKSEL_SHIFT)) & ENET_MAC_HW_FEAT_MGKSEL_MASK) - -#define ENET_MAC_HW_FEAT_MMCSEL_MASK (0x100U) -#define ENET_MAC_HW_FEAT_MMCSEL_SHIFT (8U) -/*! MMCSEL - RMON Module Enable - * 0b1..RMON Module Enable option is selected - * 0b0..RMON Module Enable option is not selected - */ -#define ENET_MAC_HW_FEAT_MMCSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_MMCSEL_SHIFT)) & ENET_MAC_HW_FEAT_MMCSEL_MASK) - -#define ENET_MAC_HW_FEAT_ARPOFFSEL_MASK (0x200U) -#define ENET_MAC_HW_FEAT_ARPOFFSEL_SHIFT (9U) -/*! ARPOFFSEL - ARP Offload Enabled - * 0b1..ARP Offload Enable option is selected - * 0b0..ARP Offload Enable option is not selected - */ -#define ENET_MAC_HW_FEAT_ARPOFFSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_ARPOFFSEL_SHIFT)) & ENET_MAC_HW_FEAT_ARPOFFSEL_MASK) - -#define ENET_MAC_HW_FEAT_PDUPSEL_MASK (0x200U) -#define ENET_MAC_HW_FEAT_PDUPSEL_SHIFT (9U) -/*! PDUPSEL - Broadcast/Multicast Packet Duplication - * 0b1..Broadcast/Multicast Packet Duplication feature is selected - * 0b0..Broadcast/Multicast Packet Duplication feature is not selected - */ -#define ENET_MAC_HW_FEAT_PDUPSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_PDUPSEL_SHIFT)) & ENET_MAC_HW_FEAT_PDUPSEL_MASK) - -#define ENET_MAC_HW_FEAT_FRPSEL_MASK (0x400U) -#define ENET_MAC_HW_FEAT_FRPSEL_SHIFT (10U) -/*! FRPSEL - Flexible Receive Parser Selected - * 0b1..Flexible Receive Parser feature is selected - * 0b0..Flexible Receive Parser feature is not selected - */ -#define ENET_MAC_HW_FEAT_FRPSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_FRPSEL_SHIFT)) & ENET_MAC_HW_FEAT_FRPSEL_MASK) - -#define ENET_MAC_HW_FEAT_FRPBS_MASK (0x1800U) -#define ENET_MAC_HW_FEAT_FRPBS_SHIFT (11U) -/*! FRPBS - Flexible Receive Parser Buffer size - * 0b01..128 Bytes - * 0b10..256 Bytes - * 0b00..64 Bytes - * 0b11..Reserved - */ -#define ENET_MAC_HW_FEAT_FRPBS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_FRPBS_SHIFT)) & ENET_MAC_HW_FEAT_FRPBS_MASK) - -#define ENET_MAC_HW_FEAT_OSTEN_MASK (0x800U) -#define ENET_MAC_HW_FEAT_OSTEN_SHIFT (11U) -/*! OSTEN - One-Step Timestamping Enable - * 0b1..One-Step Timestamping feature is selected - * 0b0..One-Step Timestamping feature is not selected - */ -#define ENET_MAC_HW_FEAT_OSTEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_OSTEN_SHIFT)) & ENET_MAC_HW_FEAT_OSTEN_MASK) - -#define ENET_MAC_HW_FEAT_PTOEN_MASK (0x1000U) -#define ENET_MAC_HW_FEAT_PTOEN_SHIFT (12U) -/*! PTOEN - PTP Offload Enable - * 0b1..PTP Offload feature is selected - * 0b0..PTP Offload feature is not selected - */ -#define ENET_MAC_HW_FEAT_PTOEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_PTOEN_SHIFT)) & ENET_MAC_HW_FEAT_PTOEN_MASK) - -#define ENET_MAC_HW_FEAT_RXCHCNT_MASK (0xF000U) -#define ENET_MAC_HW_FEAT_RXCHCNT_SHIFT (12U) -/*! RXCHCNT - Number of DMA Receive Channels - * 0b0000..1 MTL Rx Channel - * 0b0001..2 MTL Rx Channels - * 0b0010..3 MTL Rx Channels - * 0b0011..4 MTL Rx Channels - * 0b0100..5 MTL Rx Channels - * 0b0101..6 MTL Rx Channels - * 0b0110..7 MTL Rx Channels - * 0b0111..8 MTL Rx Channels - */ -#define ENET_MAC_HW_FEAT_RXCHCNT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_RXCHCNT_SHIFT)) & ENET_MAC_HW_FEAT_RXCHCNT_MASK) - -#define ENET_MAC_HW_FEAT_TSSEL_MASK (0x1000U) -#define ENET_MAC_HW_FEAT_TSSEL_SHIFT (12U) -/*! TSSEL - IEEE 1588-2008 Timestamp Enabled - * 0b1..IEEE 1588-2008 Timestamp Enable option is selected - * 0b0..IEEE 1588-2008 Timestamp Enable option is not selected - */ -#define ENET_MAC_HW_FEAT_TSSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_TSSEL_SHIFT)) & ENET_MAC_HW_FEAT_TSSEL_MASK) - -#define ENET_MAC_HW_FEAT_ADVTHWORD_MASK (0x2000U) -#define ENET_MAC_HW_FEAT_ADVTHWORD_SHIFT (13U) -/*! ADVTHWORD - IEEE 1588 High Word Register Enable - * 0b1..IEEE 1588 High Word Register option is selected - * 0b0..IEEE 1588 High Word Register option is not selected - */ -#define ENET_MAC_HW_FEAT_ADVTHWORD(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_ADVTHWORD_SHIFT)) & ENET_MAC_HW_FEAT_ADVTHWORD_MASK) - -#define ENET_MAC_HW_FEAT_EEESEL_MASK (0x2000U) -#define ENET_MAC_HW_FEAT_EEESEL_SHIFT (13U) -/*! EEESEL - Energy Efficient Ethernet Enabled - * 0b1..Energy Efficient Ethernet Enable option is selected - * 0b0..Energy Efficient Ethernet Enable option is not selected - */ -#define ENET_MAC_HW_FEAT_EEESEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_EEESEL_SHIFT)) & ENET_MAC_HW_FEAT_EEESEL_MASK) - -#define ENET_MAC_HW_FEAT_FRPES_MASK (0x6000U) -#define ENET_MAC_HW_FEAT_FRPES_SHIFT (13U) -/*! FRPES - Flexible Receive Parser Table Entries size - * 0b01..128 Entries - * 0b10..256 Entries - * 0b00..64 Entries - * 0b11..Reserved - */ -#define ENET_MAC_HW_FEAT_FRPES(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_FRPES_SHIFT)) & ENET_MAC_HW_FEAT_FRPES_MASK) - -#define ENET_MAC_HW_FEAT_ADDR64_MASK (0xC000U) -#define ENET_MAC_HW_FEAT_ADDR64_SHIFT (14U) -/*! ADDR64 - Address Width. - * 0b00..32 - * 0b01..40 - * 0b10..48 - * 0b11..Reserved - */ -#define ENET_MAC_HW_FEAT_ADDR64(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_ADDR64_SHIFT)) & ENET_MAC_HW_FEAT_ADDR64_MASK) - -#define ENET_MAC_HW_FEAT_TXCOESEL_MASK (0x4000U) -#define ENET_MAC_HW_FEAT_TXCOESEL_SHIFT (14U) -/*! TXCOESEL - Transmit Checksum Offload Enabled - * 0b1..Transmit Checksum Offload Enable option is selected - * 0b0..Transmit Checksum Offload Enable option is not selected - */ -#define ENET_MAC_HW_FEAT_TXCOESEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_TXCOESEL_SHIFT)) & ENET_MAC_HW_FEAT_TXCOESEL_MASK) - -#define ENET_MAC_HW_FEAT_DCBEN_MASK (0x10000U) -#define ENET_MAC_HW_FEAT_DCBEN_SHIFT (16U) -/*! DCBEN - DCB Feature Enable - * 0b1..DCB Feature is selected - * 0b0..DCB Feature is not selected - */ -#define ENET_MAC_HW_FEAT_DCBEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_DCBEN_SHIFT)) & ENET_MAC_HW_FEAT_DCBEN_MASK) - -#define ENET_MAC_HW_FEAT_ESTSEL_MASK (0x10000U) -#define ENET_MAC_HW_FEAT_ESTSEL_SHIFT (16U) -/*! ESTSEL - Enhancements to Scheduled Traffic Enable - * 0b1..Enable Enhancements to Scheduling Traffic feature is selected - * 0b0..Enable Enhancements to Scheduling Traffic feature is not selected - */ -#define ENET_MAC_HW_FEAT_ESTSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_ESTSEL_SHIFT)) & ENET_MAC_HW_FEAT_ESTSEL_MASK) - -#define ENET_MAC_HW_FEAT_RDCSZ_MASK (0x30000U) -#define ENET_MAC_HW_FEAT_RDCSZ_SHIFT (16U) -/*! RDCSZ - Rx DMA Descriptor Cache Size in terms of 16 bytes descriptors: */ -#define ENET_MAC_HW_FEAT_RDCSZ(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_RDCSZ_SHIFT)) & ENET_MAC_HW_FEAT_RDCSZ_MASK) - -#define ENET_MAC_HW_FEAT_RXCOESEL_MASK (0x10000U) -#define ENET_MAC_HW_FEAT_RXCOESEL_SHIFT (16U) -/*! RXCOESEL - Receive Checksum Offload Enabled - * 0b1..Receive Checksum Offload Enable option is selected - * 0b0..Receive Checksum Offload Enable option is not selected - */ -#define ENET_MAC_HW_FEAT_RXCOESEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_RXCOESEL_SHIFT)) & ENET_MAC_HW_FEAT_RXCOESEL_MASK) - -#define ENET_MAC_HW_FEAT_ESTDEP_MASK (0xE0000U) -#define ENET_MAC_HW_FEAT_ESTDEP_SHIFT (17U) -/*! ESTDEP - Depth of the Gate Control List - * 0b101..1024 - * 0b010..128 - * 0b011..256 - * 0b100..512 - * 0b001..64 - * 0b000..No Depth configured - * 0b110..Reserved - */ -#define ENET_MAC_HW_FEAT_ESTDEP(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_ESTDEP_SHIFT)) & ENET_MAC_HW_FEAT_ESTDEP_MASK) - -#define ENET_MAC_HW_FEAT_SPHEN_MASK (0x20000U) -#define ENET_MAC_HW_FEAT_SPHEN_SHIFT (17U) -/*! SPHEN - Split Header Feature Enable - * 0b1..Split Header Feature is selected - * 0b0..Split Header Feature is not selected - */ -#define ENET_MAC_HW_FEAT_SPHEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_SPHEN_SHIFT)) & ENET_MAC_HW_FEAT_SPHEN_MASK) - -#define ENET_MAC_HW_FEAT_ADDMACADRSEL_MASK (0x7C0000U) -#define ENET_MAC_HW_FEAT_ADDMACADRSEL_SHIFT (18U) -/*! ADDMACADRSEL - MAC Addresses 1-31 Selected */ -#define ENET_MAC_HW_FEAT_ADDMACADRSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_ADDMACADRSEL_SHIFT)) & ENET_MAC_HW_FEAT_ADDMACADRSEL_MASK) - -#define ENET_MAC_HW_FEAT_TSOEN_MASK (0x40000U) -#define ENET_MAC_HW_FEAT_TSOEN_SHIFT (18U) -/*! TSOEN - TCP Segmentation Offload Enable - * 0b1..TCP Segmentation Offload Feature is selected - * 0b0..TCP Segmentation Offload Feature is not selected - */ -#define ENET_MAC_HW_FEAT_TSOEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_TSOEN_SHIFT)) & ENET_MAC_HW_FEAT_TSOEN_MASK) - -#define ENET_MAC_HW_FEAT_TXCHCNT_MASK (0x3C0000U) -#define ENET_MAC_HW_FEAT_TXCHCNT_SHIFT (18U) -/*! TXCHCNT - Number of DMA Transmit Channels - * 0b0000..1 MTL Tx Channel - * 0b0001..2 MTL Tx Channels - * 0b0010..3 MTL Tx Channels - * 0b0011..4 MTL Tx Channels - * 0b0100..5 MTL Tx Channels - * 0b0101..6 MTL Tx Channels - * 0b0110..7 MTL Tx Channels - * 0b0111..8 MTL Tx Channels - */ -#define ENET_MAC_HW_FEAT_TXCHCNT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_TXCHCNT_SHIFT)) & ENET_MAC_HW_FEAT_TXCHCNT_MASK) - -#define ENET_MAC_HW_FEAT_DBGMEMA_MASK (0x80000U) -#define ENET_MAC_HW_FEAT_DBGMEMA_SHIFT (19U) -/*! DBGMEMA - DMA Debug Registers Enable - * 0b1..DMA Debug Registers option is selected - * 0b0..DMA Debug Registers option is not selected - */ -#define ENET_MAC_HW_FEAT_DBGMEMA(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_DBGMEMA_SHIFT)) & ENET_MAC_HW_FEAT_DBGMEMA_MASK) - -#define ENET_MAC_HW_FEAT_AVSEL_MASK (0x100000U) -#define ENET_MAC_HW_FEAT_AVSEL_SHIFT (20U) -/*! AVSEL - AV Feature Enable - * 0b1..AV Feature is selected - * 0b0..AV Feature is not selected - */ -#define ENET_MAC_HW_FEAT_AVSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_AVSEL_SHIFT)) & ENET_MAC_HW_FEAT_AVSEL_MASK) - -#define ENET_MAC_HW_FEAT_ESTWID_MASK (0x300000U) -#define ENET_MAC_HW_FEAT_ESTWID_SHIFT (20U) -/*! ESTWID - Width of the Time Interval field in the Gate Control List - * 0b00..Width not configured - * 0b01..16 - * 0b10..20 - * 0b11..24 - */ -#define ENET_MAC_HW_FEAT_ESTWID(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_ESTWID_SHIFT)) & ENET_MAC_HW_FEAT_ESTWID_MASK) - -#define ENET_MAC_HW_FEAT_RAVSEL_MASK (0x200000U) -#define ENET_MAC_HW_FEAT_RAVSEL_SHIFT (21U) -/*! RAVSEL - Rx Side Only AV Feature Enable - * 0b1..Rx Side Only AV Feature is selected - * 0b0..Rx Side Only AV Feature is not selected - */ -#define ENET_MAC_HW_FEAT_RAVSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_RAVSEL_SHIFT)) & ENET_MAC_HW_FEAT_RAVSEL_MASK) - -#define ENET_MAC_HW_FEAT_TDCSZ_MASK (0xC00000U) -#define ENET_MAC_HW_FEAT_TDCSZ_SHIFT (22U) -/*! TDCSZ - Tx DMA Descriptor Cache Size in terms of 16 bytes descriptors: */ -#define ENET_MAC_HW_FEAT_TDCSZ(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_TDCSZ_SHIFT)) & ENET_MAC_HW_FEAT_TDCSZ_MASK) - -#define ENET_MAC_HW_FEAT_MACADR32SEL_MASK (0x800000U) -#define ENET_MAC_HW_FEAT_MACADR32SEL_SHIFT (23U) -/*! MACADR32SEL - MAC Addresses 32-63 Selected - * 0b1..MAC Addresses 32-63 Select option is selected - * 0b0..MAC Addresses 32-63 Select option is not selected - */ -#define ENET_MAC_HW_FEAT_MACADR32SEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_MACADR32SEL_SHIFT)) & ENET_MAC_HW_FEAT_MACADR32SEL_MASK) - -#define ENET_MAC_HW_FEAT_POUOST_MASK (0x800000U) -#define ENET_MAC_HW_FEAT_POUOST_SHIFT (23U) -/*! POUOST - One Step for PTP over UDP/IP Feature Enable - * 0b1..One Step for PTP over UDP/IP Feature is selected - * 0b0..One Step for PTP over UDP/IP Feature is not selected - */ -#define ENET_MAC_HW_FEAT_POUOST(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_POUOST_SHIFT)) & ENET_MAC_HW_FEAT_POUOST_MASK) - -#define ENET_MAC_HW_FEAT_HASHTBLSZ_MASK (0x3000000U) -#define ENET_MAC_HW_FEAT_HASHTBLSZ_SHIFT (24U) -/*! HASHTBLSZ - Hash Table Size - * 0b10..128 - * 0b11..256 - * 0b01..64 - * 0b00..No hash table - */ -#define ENET_MAC_HW_FEAT_HASHTBLSZ(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_HASHTBLSZ_SHIFT)) & ENET_MAC_HW_FEAT_HASHTBLSZ_MASK) - -#define ENET_MAC_HW_FEAT_MACADR64SEL_MASK (0x1000000U) -#define ENET_MAC_HW_FEAT_MACADR64SEL_SHIFT (24U) -/*! MACADR64SEL - MAC Addresses 64-127 Selected - * 0b1..MAC Addresses 64-127 Select option is selected - * 0b0..MAC Addresses 64-127 Select option is not selected - */ -#define ENET_MAC_HW_FEAT_MACADR64SEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_MACADR64SEL_SHIFT)) & ENET_MAC_HW_FEAT_MACADR64SEL_MASK) - -#define ENET_MAC_HW_FEAT_PPSOUTNUM_MASK (0x7000000U) -#define ENET_MAC_HW_FEAT_PPSOUTNUM_SHIFT (24U) -/*! PPSOUTNUM - Number of PPS Outputs - * 0b001..1 PPS output - * 0b010..2 PPS output - * 0b011..3 PPS output - * 0b100..4 PPS output - * 0b000..No PPS output - * 0b101..Reserved - */ -#define ENET_MAC_HW_FEAT_PPSOUTNUM(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_PPSOUTNUM_SHIFT)) & ENET_MAC_HW_FEAT_PPSOUTNUM_MASK) - -#define ENET_MAC_HW_FEAT_TSSTSSEL_MASK (0x6000000U) -#define ENET_MAC_HW_FEAT_TSSTSSEL_SHIFT (25U) -/*! TSSTSSEL - Timestamp System Time Source - * 0b10..Both - * 0b01..External - * 0b00..Internal - * 0b11..Reserved - */ -#define ENET_MAC_HW_FEAT_TSSTSSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_TSSTSSEL_SHIFT)) & ENET_MAC_HW_FEAT_TSSTSSEL_MASK) - -#define ENET_MAC_HW_FEAT_FPESEL_MASK (0x4000000U) -#define ENET_MAC_HW_FEAT_FPESEL_SHIFT (26U) -/*! FPESEL - Frame Preemption Enable - * 0b1..Frame Preemption Enable feature is selected - * 0b0..Frame Preemption Enable feature is not selected - */ -#define ENET_MAC_HW_FEAT_FPESEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_FPESEL_SHIFT)) & ENET_MAC_HW_FEAT_FPESEL_MASK) - -#define ENET_MAC_HW_FEAT_L3L4FNUM_MASK (0x78000000U) -#define ENET_MAC_HW_FEAT_L3L4FNUM_SHIFT (27U) -/*! L3L4FNUM - Total number of L3 or L4 Filters - * 0b0001..1 L3 or L4 Filter - * 0b0010..2 L3 or L4 Filters - * 0b0011..3 L3 or L4 Filters - * 0b0100..4 L3 or L4 Filters - * 0b0101..5 L3 or L4 Filters - * 0b0110..6 L3 or L4 Filters - * 0b0111..7 L3 or L4 Filters - * 0b1000..8 L3 or L4 Filters - * 0b0000..No L3 or L4 Filter - */ -#define ENET_MAC_HW_FEAT_L3L4FNUM(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_L3L4FNUM_SHIFT)) & ENET_MAC_HW_FEAT_L3L4FNUM_MASK) - -#define ENET_MAC_HW_FEAT_SAVLANINS_MASK (0x8000000U) -#define ENET_MAC_HW_FEAT_SAVLANINS_SHIFT (27U) -/*! SAVLANINS - Source Address or VLAN Insertion Enable - * 0b1..Source Address or VLAN Insertion Enable option is selected - * 0b0..Source Address or VLAN Insertion Enable option is not selected - */ -#define ENET_MAC_HW_FEAT_SAVLANINS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_SAVLANINS_SHIFT)) & ENET_MAC_HW_FEAT_SAVLANINS_MASK) - -#define ENET_MAC_HW_FEAT_TBSSEL_MASK (0x8000000U) -#define ENET_MAC_HW_FEAT_TBSSEL_SHIFT (27U) -/*! TBSSEL - Time Based Scheduling Enable - * 0b1..Time Based Scheduling Enable feature is selected - * 0b0..Time Based Scheduling Enable feature is not selected - */ -#define ENET_MAC_HW_FEAT_TBSSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_TBSSEL_SHIFT)) & ENET_MAC_HW_FEAT_TBSSEL_MASK) - -#define ENET_MAC_HW_FEAT_ACTPHYSEL_MASK (0x70000000U) -#define ENET_MAC_HW_FEAT_ACTPHYSEL_SHIFT (28U) -/*! ACTPHYSEL - Active PHY Selected - * 0b000..GMII or MII - * 0b111..RevMII - * 0b001..RGMII - * 0b100..RMII - * 0b101..RTBI - * 0b010..SGMII - * 0b110..SMII - * 0b011..TBI - */ -#define ENET_MAC_HW_FEAT_ACTPHYSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_ACTPHYSEL_SHIFT)) & ENET_MAC_HW_FEAT_ACTPHYSEL_MASK) - -#define ENET_MAC_HW_FEAT_ASP_MASK (0x30000000U) -#define ENET_MAC_HW_FEAT_ASP_SHIFT (28U) -/*! ASP - Automotive Safety Package - * 0b10..All the Automotive Safety features are selected without the "Parity Port Enable for external interface" feature - * 0b11..All the Automotive Safety features are selected with the "Parity Port Enable for external interface" feature - * 0b01..Only "ECC protection for external memory" feature is selected - * 0b00..No Safety features selected - */ -#define ENET_MAC_HW_FEAT_ASP(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_ASP_SHIFT)) & ENET_MAC_HW_FEAT_ASP_MASK) - -#define ENET_MAC_HW_FEAT_AUXSNAPNUM_MASK (0x70000000U) -#define ENET_MAC_HW_FEAT_AUXSNAPNUM_SHIFT (28U) -/*! AUXSNAPNUM - Number of Auxiliary Snapshot Inputs - * 0b001..1 auxiliary input - * 0b010..2 auxiliary input - * 0b011..3 auxiliary input - * 0b100..4 auxiliary input - * 0b000..No auxiliary input - * 0b101..Reserved - */ -#define ENET_MAC_HW_FEAT_AUXSNAPNUM(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_AUXSNAPNUM_SHIFT)) & ENET_MAC_HW_FEAT_AUXSNAPNUM_MASK) -/*! @} */ - -/* The count of ENET_MAC_HW_FEAT */ -#define ENET_MAC_HW_FEAT_COUNT (4U) - -/*! @name MAC_MDIO_ADDRESS - MDIO Address */ -/*! @{ */ - -#define ENET_MAC_MDIO_ADDRESS_GB_MASK (0x1U) -#define ENET_MAC_MDIO_ADDRESS_GB_SHIFT (0U) -/*! GB - GMII Busy - * 0b0..GMII Busy is disabled - * 0b1..GMII Busy is enabled - */ -#define ENET_MAC_MDIO_ADDRESS_GB(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_MDIO_ADDRESS_GB_SHIFT)) & ENET_MAC_MDIO_ADDRESS_GB_MASK) - -#define ENET_MAC_MDIO_ADDRESS_C45E_MASK (0x2U) -#define ENET_MAC_MDIO_ADDRESS_C45E_SHIFT (1U) -/*! C45E - Clause 45 PHY Enable - * 0b0..Clause 45 PHY is disabled - * 0b1..Clause 45 PHY is enabled - */ -#define ENET_MAC_MDIO_ADDRESS_C45E(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_MDIO_ADDRESS_C45E_SHIFT)) & ENET_MAC_MDIO_ADDRESS_C45E_MASK) - -#define ENET_MAC_MDIO_ADDRESS_GOC_0_MASK (0x4U) -#define ENET_MAC_MDIO_ADDRESS_GOC_0_SHIFT (2U) -/*! GOC_0 - GMII Operation Command 0 - * 0b0..GMII Operation Command 0 is disabled - * 0b1..GMII Operation Command 0 is enabled - */ -#define ENET_MAC_MDIO_ADDRESS_GOC_0(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_MDIO_ADDRESS_GOC_0_SHIFT)) & ENET_MAC_MDIO_ADDRESS_GOC_0_MASK) - -#define ENET_MAC_MDIO_ADDRESS_GOC_1_MASK (0x8U) -#define ENET_MAC_MDIO_ADDRESS_GOC_1_SHIFT (3U) -/*! GOC_1 - GMII Operation Command 1 - * 0b0..GMII Operation Command 1 is disabled - * 0b1..GMII Operation Command 1 is enabled - */ -#define ENET_MAC_MDIO_ADDRESS_GOC_1(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_MDIO_ADDRESS_GOC_1_SHIFT)) & ENET_MAC_MDIO_ADDRESS_GOC_1_MASK) - -#define ENET_MAC_MDIO_ADDRESS_SKAP_MASK (0x10U) -#define ENET_MAC_MDIO_ADDRESS_SKAP_SHIFT (4U) -/*! SKAP - Skip Address Packet - * 0b0..Skip Address Packet is disabled - * 0b1..Skip Address Packet is enabled - */ -#define ENET_MAC_MDIO_ADDRESS_SKAP(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_MDIO_ADDRESS_SKAP_SHIFT)) & ENET_MAC_MDIO_ADDRESS_SKAP_MASK) - -#define ENET_MAC_MDIO_ADDRESS_CR_MASK (0xF00U) -#define ENET_MAC_MDIO_ADDRESS_CR_SHIFT (8U) -/*! CR - CR */ -#define ENET_MAC_MDIO_ADDRESS_CR(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_MDIO_ADDRESS_CR_SHIFT)) & ENET_MAC_MDIO_ADDRESS_CR_MASK) - -#define ENET_MAC_MDIO_ADDRESS_NTC_MASK (0x7000U) -#define ENET_MAC_MDIO_ADDRESS_NTC_SHIFT (12U) -/*! NTC - NTC */ -#define ENET_MAC_MDIO_ADDRESS_NTC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_MDIO_ADDRESS_NTC_SHIFT)) & ENET_MAC_MDIO_ADDRESS_NTC_MASK) - -#define ENET_MAC_MDIO_ADDRESS_RDA_MASK (0x1F0000U) -#define ENET_MAC_MDIO_ADDRESS_RDA_SHIFT (16U) -/*! RDA - Register/Device Address */ -#define ENET_MAC_MDIO_ADDRESS_RDA(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_MDIO_ADDRESS_RDA_SHIFT)) & ENET_MAC_MDIO_ADDRESS_RDA_MASK) - -#define ENET_MAC_MDIO_ADDRESS_PA_MASK (0x3E00000U) -#define ENET_MAC_MDIO_ADDRESS_PA_SHIFT (21U) -/*! PA - Physical Layer Address */ -#define ENET_MAC_MDIO_ADDRESS_PA(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_MDIO_ADDRESS_PA_SHIFT)) & ENET_MAC_MDIO_ADDRESS_PA_MASK) - -#define ENET_MAC_MDIO_ADDRESS_BTB_MASK (0x4000000U) -#define ENET_MAC_MDIO_ADDRESS_BTB_SHIFT (26U) -/*! BTB - Back to Back transactions - * 0b0..Back to Back transactions disabled - * 0b1..Back to Back transactions enabled - */ -#define ENET_MAC_MDIO_ADDRESS_BTB(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_MDIO_ADDRESS_BTB_SHIFT)) & ENET_MAC_MDIO_ADDRESS_BTB_MASK) - -#define ENET_MAC_MDIO_ADDRESS_PSE_MASK (0x8000000U) -#define ENET_MAC_MDIO_ADDRESS_PSE_SHIFT (27U) -/*! PSE - Preamble Suppression Enable - * 0b0..Preamble Suppression disabled - * 0b1..Preamble Suppression enabled - */ -#define ENET_MAC_MDIO_ADDRESS_PSE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_MDIO_ADDRESS_PSE_SHIFT)) & ENET_MAC_MDIO_ADDRESS_PSE_MASK) -/*! @} */ - -/*! @name MAC_MDIO_DATA - MAC MDIO Data */ -/*! @{ */ - -#define ENET_MAC_MDIO_DATA_GD_MASK (0xFFFFU) -#define ENET_MAC_MDIO_DATA_GD_SHIFT (0U) -/*! GD - GMII Data */ -#define ENET_MAC_MDIO_DATA_GD(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_MDIO_DATA_GD_SHIFT)) & ENET_MAC_MDIO_DATA_GD_MASK) - -#define ENET_MAC_MDIO_DATA_RA_MASK (0xFFFF0000U) -#define ENET_MAC_MDIO_DATA_RA_SHIFT (16U) -/*! RA - Register Address */ -#define ENET_MAC_MDIO_DATA_RA(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_MDIO_DATA_RA_SHIFT)) & ENET_MAC_MDIO_DATA_RA_MASK) -/*! @} */ - -/*! @name MAC_CSR_SW_CTRL - CSR Software Control */ -/*! @{ */ - -#define ENET_MAC_CSR_SW_CTRL_RCWE_MASK (0x1U) -#define ENET_MAC_CSR_SW_CTRL_RCWE_SHIFT (0U) -/*! RCWE - Register Clear on Write 1 Enable - * 0b0..Register Clear on Write 1 is disabled - * 0b1..Register Clear on Write 1 is enabled - */ -#define ENET_MAC_CSR_SW_CTRL_RCWE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CSR_SW_CTRL_RCWE_SHIFT)) & ENET_MAC_CSR_SW_CTRL_RCWE_MASK) -/*! @} */ - -/*! @name MAC_ADDRESS0_HIGH - MAC Address0 High */ -/*! @{ */ - -#define ENET_MAC_ADDRESS0_HIGH_ADDRHI_MASK (0xFFFFU) -#define ENET_MAC_ADDRESS0_HIGH_ADDRHI_SHIFT (0U) -/*! ADDRHI - MAC Address0[47:32] */ -#define ENET_MAC_ADDRESS0_HIGH_ADDRHI(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_ADDRESS0_HIGH_ADDRHI_SHIFT)) & ENET_MAC_ADDRESS0_HIGH_ADDRHI_MASK) - -#define ENET_MAC_ADDRESS0_HIGH_DCS_MASK (0x30000U) -#define ENET_MAC_ADDRESS0_HIGH_DCS_SHIFT (16U) -/*! DCS - DMA Channel Select */ -#define ENET_MAC_ADDRESS0_HIGH_DCS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_ADDRESS0_HIGH_DCS_SHIFT)) & ENET_MAC_ADDRESS0_HIGH_DCS_MASK) - -#define ENET_MAC_ADDRESS0_HIGH_AE_MASK (0x80000000U) -#define ENET_MAC_ADDRESS0_HIGH_AE_SHIFT (31U) -/*! AE - Address Enable - * 0b0..INVALID : This bit must be always set to 1 - * 0b1..This bit is always set to 1 - */ -#define ENET_MAC_ADDRESS0_HIGH_AE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_ADDRESS0_HIGH_AE_SHIFT)) & ENET_MAC_ADDRESS0_HIGH_AE_MASK) -/*! @} */ - -/*! @name MAC_ADDRESS0_LOW - MAC Address0 Low */ -/*! @{ */ - -#define ENET_MAC_ADDRESS0_LOW_ADDRLO_MASK (0xFFFFFFFFU) -#define ENET_MAC_ADDRESS0_LOW_ADDRLO_SHIFT (0U) -/*! ADDRLO - MAC Address0[31:0] */ -#define ENET_MAC_ADDRESS0_LOW_ADDRLO(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_ADDRESS0_LOW_ADDRLO_SHIFT)) & ENET_MAC_ADDRESS0_LOW_ADDRLO_MASK) -/*! @} */ - -/*! @name INDIR_ACCESS_CTRL - Indirect Access Control */ -/*! @{ */ - -#define ENET_INDIR_ACCESS_CTRL_OB_MASK (0x1U) -#define ENET_INDIR_ACCESS_CTRL_OB_SHIFT (0U) -/*! OB - Operation Busy. */ -#define ENET_INDIR_ACCESS_CTRL_OB(x) (((uint32_t)(((uint32_t)(x)) << ENET_INDIR_ACCESS_CTRL_OB_SHIFT)) & ENET_INDIR_ACCESS_CTRL_OB_MASK) - -#define ENET_INDIR_ACCESS_CTRL_COM_MASK (0x2U) -#define ENET_INDIR_ACCESS_CTRL_COM_SHIFT (1U) -/*! COM - Command type - * 0b1..Read operation - * 0b0..Write operation - */ -#define ENET_INDIR_ACCESS_CTRL_COM(x) (((uint32_t)(((uint32_t)(x)) << ENET_INDIR_ACCESS_CTRL_COM_SHIFT)) & ENET_INDIR_ACCESS_CTRL_COM_MASK) - -#define ENET_INDIR_ACCESS_CTRL_AUTO_MASK (0x20U) -#define ENET_INDIR_ACCESS_CTRL_AUTO_SHIFT (5U) -/*! AUTO - Auto increment */ -#define ENET_INDIR_ACCESS_CTRL_AUTO(x) (((uint32_t)(((uint32_t)(x)) << ENET_INDIR_ACCESS_CTRL_AUTO_SHIFT)) & ENET_INDIR_ACCESS_CTRL_AUTO_MASK) - -#define ENET_INDIR_ACCESS_CTRL_AOFF_MASK (0xFF00U) -#define ENET_INDIR_ACCESS_CTRL_AOFF_SHIFT (8U) -/*! AOFF - Address Offset */ -#define ENET_INDIR_ACCESS_CTRL_AOFF(x) (((uint32_t)(((uint32_t)(x)) << ENET_INDIR_ACCESS_CTRL_AOFF_SHIFT)) & ENET_INDIR_ACCESS_CTRL_AOFF_MASK) - -#define ENET_INDIR_ACCESS_CTRL_MSEL_MASK (0xF0000U) -#define ENET_INDIR_ACCESS_CTRL_MSEL_SHIFT (16U) -/*! MSEL - Mode Select */ -#define ENET_INDIR_ACCESS_CTRL_MSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_INDIR_ACCESS_CTRL_MSEL_SHIFT)) & ENET_INDIR_ACCESS_CTRL_MSEL_MASK) -/*! @} */ - -/*! @name INDIR_ACCESS_DATA - Indirect Access Data */ -/*! @{ */ - -#define ENET_INDIR_ACCESS_DATA_DATA_MASK (0xFFFFFFFFU) -#define ENET_INDIR_ACCESS_DATA_DATA_SHIFT (0U) -/*! DATA - This field contains data to read/write for Indirect address access associated with MAC_Indir_Access_Ctrl */ -#define ENET_INDIR_ACCESS_DATA_DATA(x) (((uint32_t)(((uint32_t)(x)) << ENET_INDIR_ACCESS_DATA_DATA_SHIFT)) & ENET_INDIR_ACCESS_DATA_DATA_MASK) -/*! @} */ - -/*! @name MAC_TIMESTAMP_CONTROL - Timestamp Control */ -/*! @{ */ - -#define ENET_MAC_TIMESTAMP_CONTROL_TSENA_MASK (0x1U) -#define ENET_MAC_TIMESTAMP_CONTROL_TSENA_SHIFT (0U) -/*! TSENA - Enable Timestamp - * 0b0..Timestamp is disabled - * 0b1..Timestamp is enabled - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TSENA(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TSENA_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TSENA_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_TSCFUPDT_MASK (0x2U) -#define ENET_MAC_TIMESTAMP_CONTROL_TSCFUPDT_SHIFT (1U) -/*! TSCFUPDT - Fine or Coarse Timestamp Update - * 0b0..Coarse method is used to update system timestamp - * 0b1..Fine method is used to update system timestamp - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TSCFUPDT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TSCFUPDT_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TSCFUPDT_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_TSINIT_MASK (0x4U) -#define ENET_MAC_TIMESTAMP_CONTROL_TSINIT_SHIFT (2U) -/*! TSINIT - Initialize Timestamp - * 0b0..Timestamp is not initialized - * 0b1..Timestamp is initialized - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TSINIT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TSINIT_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TSINIT_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_TSUPDT_MASK (0x8U) -#define ENET_MAC_TIMESTAMP_CONTROL_TSUPDT_SHIFT (3U) -/*! TSUPDT - Update Timestamp - * 0b0..Timestamp is not updated - * 0b1..Timestamp is updated - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TSUPDT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TSUPDT_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TSUPDT_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_TSTRIG_MASK (0x10U) -#define ENET_MAC_TIMESTAMP_CONTROL_TSTRIG_SHIFT (4U) -/*! TSTRIG - Enable Timestamp Interrupt Trigger - * 0b0..Timestamp Interrupt Trigger is not enabled - * 0b1..Timestamp Interrupt Trigger is enabled - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TSTRIG(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TSTRIG_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TSTRIG_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_TSADDREG_MASK (0x20U) -#define ENET_MAC_TIMESTAMP_CONTROL_TSADDREG_SHIFT (5U) -/*! TSADDREG - Update Addend Register - * 0b0..Addend Register is not updated - * 0b1..Addend Register is updated - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TSADDREG(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TSADDREG_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TSADDREG_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_TSENALL_MASK (0x100U) -#define ENET_MAC_TIMESTAMP_CONTROL_TSENALL_SHIFT (8U) -/*! TSENALL - Enable Timestamp for All Packets - * 0b0..Timestamp for All Packets disabled - * 0b1..Timestamp for All Packets enabled - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TSENALL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TSENALL_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TSENALL_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_TSCTRLSSR_MASK (0x200U) -#define ENET_MAC_TIMESTAMP_CONTROL_TSCTRLSSR_SHIFT (9U) -/*! TSCTRLSSR - Timestamp Digital or Binary Rollover Control - * 0b0..Timestamp Digital Rollover Control is disabled and Binary Rollover Control is enabled - * 0b1..Timestamp Digital Rollover Control is enabled and Binary Rollover Control is disabled - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TSCTRLSSR(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TSCTRLSSR_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TSCTRLSSR_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_TSVER2ENA_MASK (0x400U) -#define ENET_MAC_TIMESTAMP_CONTROL_TSVER2ENA_SHIFT (10U) -/*! TSVER2ENA - Enable PTP Packet Processing for Version 2 Format - * 0b0..PTP Packet Processing for Version 2 Format is disabled - * 0b1..PTP Packet Processing for Version 2 Format is enabled - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TSVER2ENA(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TSVER2ENA_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TSVER2ENA_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_TSIPENA_MASK (0x800U) -#define ENET_MAC_TIMESTAMP_CONTROL_TSIPENA_SHIFT (11U) -/*! TSIPENA - Enable Processing of PTP over Ethernet Packets - * 0b0..Processing of PTP over Ethernet Packets is disabled - * 0b1..Processing of PTP over Ethernet Packets is enabled - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TSIPENA(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TSIPENA_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TSIPENA_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_TSIPV6ENA_MASK (0x1000U) -#define ENET_MAC_TIMESTAMP_CONTROL_TSIPV6ENA_SHIFT (12U) -/*! TSIPV6ENA - Enable Processing of PTP Packets Sent over IPv6-UDP - * 0b0..Processing of PTP Packets Sent over IPv6-UDP is disabled - * 0b1..Processing of PTP Packets Sent over IPv6-UDP is enabled - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TSIPV6ENA(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TSIPV6ENA_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TSIPV6ENA_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_TSIPV4ENA_MASK (0x2000U) -#define ENET_MAC_TIMESTAMP_CONTROL_TSIPV4ENA_SHIFT (13U) -/*! TSIPV4ENA - Enable Processing of PTP Packets Sent over IPv4-UDP - * 0b0..Processing of PTP Packets Sent over IPv4-UDP is disabled - * 0b1..Processing of PTP Packets Sent over IPv4-UDP is enabled - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TSIPV4ENA(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TSIPV4ENA_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TSIPV4ENA_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_TSEVNTENA_MASK (0x4000U) -#define ENET_MAC_TIMESTAMP_CONTROL_TSEVNTENA_SHIFT (14U) -/*! TSEVNTENA - Enable Timestamp Snapshot for Event Messages - * 0b0..Timestamp Snapshot for Event Messages is disabled - * 0b1..Timestamp Snapshot for Event Messages is enabled - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TSEVNTENA(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TSEVNTENA_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TSEVNTENA_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_TSMSTRENA_MASK (0x8000U) -#define ENET_MAC_TIMESTAMP_CONTROL_TSMSTRENA_SHIFT (15U) -/*! TSMSTRENA - Enable Snapshot for Messages Relevant to Master - * 0b0..Snapshot for Messages Relevant to Master is disabled - * 0b1..Snapshot for Messages Relevant to Master is enabled - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TSMSTRENA(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TSMSTRENA_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TSMSTRENA_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_SNAPTYPSEL_MASK (0x30000U) -#define ENET_MAC_TIMESTAMP_CONTROL_SNAPTYPSEL_SHIFT (16U) -/*! SNAPTYPSEL - Select PTP packets for Taking Snapshots */ -#define ENET_MAC_TIMESTAMP_CONTROL_SNAPTYPSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_SNAPTYPSEL_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_SNAPTYPSEL_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_TSENMACADDR_MASK (0x40000U) -#define ENET_MAC_TIMESTAMP_CONTROL_TSENMACADDR_SHIFT (18U) -/*! TSENMACADDR - Enable MAC Address for PTP Packet Filtering - * 0b0..MAC Address for PTP Packet Filtering is disabled - * 0b1..MAC Address for PTP Packet Filtering is enabled - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TSENMACADDR(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TSENMACADDR_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TSENMACADDR_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_ESTI_MASK (0x100000U) -#define ENET_MAC_TIMESTAMP_CONTROL_ESTI_SHIFT (20U) -/*! ESTI - External System Time Input - * 0b0..External System Time Input is disabled - * 0b1..External System Time Input is enabled - */ -#define ENET_MAC_TIMESTAMP_CONTROL_ESTI(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_ESTI_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_ESTI_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_TXTSSTSM_MASK (0x1000000U) -#define ENET_MAC_TIMESTAMP_CONTROL_TXTSSTSM_SHIFT (24U) -/*! TXTSSTSM - Transmit Timestamp Status Mode - * 0b0..Transmit Timestamp Status Mode is disabled - * 0b1..Transmit Timestamp Status Mode is enabled - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TXTSSTSM(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TXTSSTSM_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TXTSSTSM_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_AV8021ASMEN_MASK (0x10000000U) -#define ENET_MAC_TIMESTAMP_CONTROL_AV8021ASMEN_SHIFT (28U) -/*! AV8021ASMEN - AV 802. - * 0b0..AV 802.1AS Mode is disabled - * 0b1..AV 802.1AS Mode is enabled - */ -#define ENET_MAC_TIMESTAMP_CONTROL_AV8021ASMEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_AV8021ASMEN_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_AV8021ASMEN_MASK) -/*! @} */ - -/*! @name MAC_SUB_SECOND_INCREMENT - Subsecond Increment */ -/*! @{ */ - -#define ENET_MAC_SUB_SECOND_INCREMENT_SNSINC_MASK (0xFF0000U) -#define ENET_MAC_SUB_SECOND_INCREMENT_SNSINC_SHIFT (16U) -/*! SNSINC - Sub-nanosecond Increment Value */ -#define ENET_MAC_SUB_SECOND_INCREMENT_SNSINC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_SUB_SECOND_INCREMENT_SNSINC_SHIFT)) & ENET_MAC_SUB_SECOND_INCREMENT_SNSINC_MASK) -/*! @} */ - -/*! @name MAC_SYSTEM_TIME_SECONDS - System Time Seconds */ -/*! @{ */ - -#define ENET_MAC_SYSTEM_TIME_SECONDS_TSS_MASK (0xFFFFFFFFU) -#define ENET_MAC_SYSTEM_TIME_SECONDS_TSS_SHIFT (0U) -/*! TSS - Timestamp Second */ -#define ENET_MAC_SYSTEM_TIME_SECONDS_TSS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_SYSTEM_TIME_SECONDS_TSS_SHIFT)) & ENET_MAC_SYSTEM_TIME_SECONDS_TSS_MASK) -/*! @} */ - -/*! @name MAC_SYSTEM_TIME_NANOSECONDS - System Time Nanoseconds */ -/*! @{ */ - -#define ENET_MAC_SYSTEM_TIME_NANOSECONDS_TSSS_MASK (0x7FFFFFFFU) -#define ENET_MAC_SYSTEM_TIME_NANOSECONDS_TSSS_SHIFT (0U) -/*! TSSS - Timestamp Sub Seconds */ -#define ENET_MAC_SYSTEM_TIME_NANOSECONDS_TSSS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_SYSTEM_TIME_NANOSECONDS_TSSS_SHIFT)) & ENET_MAC_SYSTEM_TIME_NANOSECONDS_TSSS_MASK) -/*! @} */ - -/*! @name MAC_SYSTEM_TIME_SECONDS_UPDATE - System Time Seconds Update */ -/*! @{ */ - -#define ENET_MAC_SYSTEM_TIME_SECONDS_UPDATE_TSS_MASK (0xFFFFFFFFU) -#define ENET_MAC_SYSTEM_TIME_SECONDS_UPDATE_TSS_SHIFT (0U) -/*! TSS - Timestamp Seconds */ -#define ENET_MAC_SYSTEM_TIME_SECONDS_UPDATE_TSS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_SYSTEM_TIME_SECONDS_UPDATE_TSS_SHIFT)) & ENET_MAC_SYSTEM_TIME_SECONDS_UPDATE_TSS_MASK) -/*! @} */ - -/*! @name MAC_SYSTEM_TIME_NANOSECONDS_UPDATE - System Time Nanoseconds Update */ -/*! @{ */ - -#define ENET_MAC_SYSTEM_TIME_NANOSECONDS_UPDATE_TSSS_MASK (0x7FFFFFFFU) -#define ENET_MAC_SYSTEM_TIME_NANOSECONDS_UPDATE_TSSS_SHIFT (0U) -/*! TSSS - Timestamp Sub Seconds */ -#define ENET_MAC_SYSTEM_TIME_NANOSECONDS_UPDATE_TSSS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_SYSTEM_TIME_NANOSECONDS_UPDATE_TSSS_SHIFT)) & ENET_MAC_SYSTEM_TIME_NANOSECONDS_UPDATE_TSSS_MASK) - -#define ENET_MAC_SYSTEM_TIME_NANOSECONDS_UPDATE_ADDSUB_MASK (0x80000000U) -#define ENET_MAC_SYSTEM_TIME_NANOSECONDS_UPDATE_ADDSUB_SHIFT (31U) -/*! ADDSUB - Add or Subtract Time - * 0b0..Add time - * 0b1..Subtract time - */ -#define ENET_MAC_SYSTEM_TIME_NANOSECONDS_UPDATE_ADDSUB(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_SYSTEM_TIME_NANOSECONDS_UPDATE_ADDSUB_SHIFT)) & ENET_MAC_SYSTEM_TIME_NANOSECONDS_UPDATE_ADDSUB_MASK) -/*! @} */ - -/*! @name MAC_TIMESTAMP_ADDEND - Timestamp Addend */ -/*! @{ */ - -#define ENET_MAC_TIMESTAMP_ADDEND_TSAR_MASK (0xFFFFFFFFU) -#define ENET_MAC_TIMESTAMP_ADDEND_TSAR_SHIFT (0U) -/*! TSAR - Timestamp Addend Register */ -#define ENET_MAC_TIMESTAMP_ADDEND_TSAR(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_ADDEND_TSAR_SHIFT)) & ENET_MAC_TIMESTAMP_ADDEND_TSAR_MASK) -/*! @} */ - -/*! @name MAC_TIMESTAMP_STATUS - Timestamp Status */ -/*! @{ */ - -#define ENET_MAC_TIMESTAMP_STATUS_TSSOVF_MASK (0x1U) -#define ENET_MAC_TIMESTAMP_STATUS_TSSOVF_SHIFT (0U) -/*! TSSOVF - Timestamp Seconds Overflow - * 0b1..Timestamp Seconds Overflow status detected - * 0b0..Timestamp Seconds Overflow status not detected - */ -#define ENET_MAC_TIMESTAMP_STATUS_TSSOVF(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_STATUS_TSSOVF_SHIFT)) & ENET_MAC_TIMESTAMP_STATUS_TSSOVF_MASK) - -#define ENET_MAC_TIMESTAMP_STATUS_TSTARGT0_MASK (0x2U) -#define ENET_MAC_TIMESTAMP_STATUS_TSTARGT0_SHIFT (1U) -/*! TSTARGT0 - Timestamp Target Time Reached - * 0b1..Timestamp Target Time Reached status detected - * 0b0..Timestamp Target Time Reached status not detected - */ -#define ENET_MAC_TIMESTAMP_STATUS_TSTARGT0(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_STATUS_TSTARGT0_SHIFT)) & ENET_MAC_TIMESTAMP_STATUS_TSTARGT0_MASK) - -#define ENET_MAC_TIMESTAMP_STATUS_TSTRGTERR0_MASK (0x8U) -#define ENET_MAC_TIMESTAMP_STATUS_TSTRGTERR0_SHIFT (3U) -/*! TSTRGTERR0 - Timestamp Target Time Error - * 0b1..Timestamp Target Time Error status detected - * 0b0..Timestamp Target Time Error status not detected - */ -#define ENET_MAC_TIMESTAMP_STATUS_TSTRGTERR0(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_STATUS_TSTRGTERR0_SHIFT)) & ENET_MAC_TIMESTAMP_STATUS_TSTRGTERR0_MASK) - -#define ENET_MAC_TIMESTAMP_STATUS_TXTSSIS_MASK (0x8000U) -#define ENET_MAC_TIMESTAMP_STATUS_TXTSSIS_SHIFT (15U) -/*! TXTSSIS - Tx Timestamp Status Interrupt Status - * 0b1..Tx Timestamp Status Interrupt status detected - * 0b0..Tx Timestamp Status Interrupt status not detected - */ -#define ENET_MAC_TIMESTAMP_STATUS_TXTSSIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_STATUS_TXTSSIS_SHIFT)) & ENET_MAC_TIMESTAMP_STATUS_TXTSSIS_MASK) -/*! @} */ - -/*! @name MAC_TX_TIMESTAMP_STATUS_NANOSECONDS - Transmit Timestamp Status Nanoseconds */ -/*! @{ */ - -#define ENET_MAC_TX_TIMESTAMP_STATUS_NANOSECONDS_TXTSSLO_MASK (0x7FFFFFFFU) -#define ENET_MAC_TX_TIMESTAMP_STATUS_NANOSECONDS_TXTSSLO_SHIFT (0U) -/*! TXTSSLO - Transmit Timestamp Status Low */ -#define ENET_MAC_TX_TIMESTAMP_STATUS_NANOSECONDS_TXTSSLO(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TX_TIMESTAMP_STATUS_NANOSECONDS_TXTSSLO_SHIFT)) & ENET_MAC_TX_TIMESTAMP_STATUS_NANOSECONDS_TXTSSLO_MASK) - -#define ENET_MAC_TX_TIMESTAMP_STATUS_NANOSECONDS_TXTSSMIS_MASK (0x80000000U) -#define ENET_MAC_TX_TIMESTAMP_STATUS_NANOSECONDS_TXTSSMIS_SHIFT (31U) -/*! TXTSSMIS - TXTSSMIS - * 0b1..Transmit Timestamp Status Missed status detected - * 0b0..Transmit Timestamp Status Missed status not detected - */ -#define ENET_MAC_TX_TIMESTAMP_STATUS_NANOSECONDS_TXTSSMIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TX_TIMESTAMP_STATUS_NANOSECONDS_TXTSSMIS_SHIFT)) & ENET_MAC_TX_TIMESTAMP_STATUS_NANOSECONDS_TXTSSMIS_MASK) -/*! @} */ - -/*! @name MAC_TX_TIMESTAMP_STATUS_SECONDS - Transmit Timestamp Status Seconds */ -/*! @{ */ - -#define ENET_MAC_TX_TIMESTAMP_STATUS_SECONDS_TXTSSHI_MASK (0xFFFFFFFFU) -#define ENET_MAC_TX_TIMESTAMP_STATUS_SECONDS_TXTSSHI_SHIFT (0U) -/*! TXTSSHI - Transmit Timestamp Status High */ -#define ENET_MAC_TX_TIMESTAMP_STATUS_SECONDS_TXTSSHI(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TX_TIMESTAMP_STATUS_SECONDS_TXTSSHI_SHIFT)) & ENET_MAC_TX_TIMESTAMP_STATUS_SECONDS_TXTSSHI_MASK) -/*! @} */ - -/*! @name MAC_TIMESTAMP_INGRESS_CORR_NANOSECOND - Timestamp Ingress Correction Nanosecond */ -/*! @{ */ - -#define ENET_MAC_TIMESTAMP_INGRESS_CORR_NANOSECOND_TSIC_MASK (0xFFFFFFFFU) -#define ENET_MAC_TIMESTAMP_INGRESS_CORR_NANOSECOND_TSIC_SHIFT (0U) -/*! TSIC - Timestamp Ingress Correction */ -#define ENET_MAC_TIMESTAMP_INGRESS_CORR_NANOSECOND_TSIC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_INGRESS_CORR_NANOSECOND_TSIC_SHIFT)) & ENET_MAC_TIMESTAMP_INGRESS_CORR_NANOSECOND_TSIC_MASK) -/*! @} */ - -/*! @name MAC_TIMESTAMP_EGRESS_CORR_NANOSECOND - Timestamp Egress Correction Nanosecond */ -/*! @{ */ - -#define ENET_MAC_TIMESTAMP_EGRESS_CORR_NANOSECOND_TSEC_MASK (0xFFFFFFFFU) -#define ENET_MAC_TIMESTAMP_EGRESS_CORR_NANOSECOND_TSEC_SHIFT (0U) -/*! TSEC - Timestamp Egress Correction */ -#define ENET_MAC_TIMESTAMP_EGRESS_CORR_NANOSECOND_TSEC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_EGRESS_CORR_NANOSECOND_TSEC_SHIFT)) & ENET_MAC_TIMESTAMP_EGRESS_CORR_NANOSECOND_TSEC_MASK) -/*! @} */ - -/*! @name MAC_TIMESTAMP_INGRESS_LATENCY - Timestamp Ingress Latency */ -/*! @{ */ - -#define ENET_MAC_TIMESTAMP_INGRESS_LATENCY_ITLSNS_MASK (0xFF00U) -#define ENET_MAC_TIMESTAMP_INGRESS_LATENCY_ITLSNS_SHIFT (8U) -/*! ITLSNS - ITLSNS */ -#define ENET_MAC_TIMESTAMP_INGRESS_LATENCY_ITLSNS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_INGRESS_LATENCY_ITLSNS_SHIFT)) & ENET_MAC_TIMESTAMP_INGRESS_LATENCY_ITLSNS_MASK) - -#define ENET_MAC_TIMESTAMP_INGRESS_LATENCY_ITLNS_MASK (0xFFF0000U) -#define ENET_MAC_TIMESTAMP_INGRESS_LATENCY_ITLNS_SHIFT (16U) -/*! ITLNS - ITLNS */ -#define ENET_MAC_TIMESTAMP_INGRESS_LATENCY_ITLNS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_INGRESS_LATENCY_ITLNS_SHIFT)) & ENET_MAC_TIMESTAMP_INGRESS_LATENCY_ITLNS_MASK) -/*! @} */ - -/*! @name MAC_TIMESTAMP_EGRESS_LATENCY - Timestamp Egress Latency */ -/*! @{ */ - -#define ENET_MAC_TIMESTAMP_EGRESS_LATENCY_ETLSNS_MASK (0xFF00U) -#define ENET_MAC_TIMESTAMP_EGRESS_LATENCY_ETLSNS_SHIFT (8U) -/*! ETLSNS - Egress Timestamp Latency, in sub-nanoseconds */ -#define ENET_MAC_TIMESTAMP_EGRESS_LATENCY_ETLSNS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_EGRESS_LATENCY_ETLSNS_SHIFT)) & ENET_MAC_TIMESTAMP_EGRESS_LATENCY_ETLSNS_MASK) - -#define ENET_MAC_TIMESTAMP_EGRESS_LATENCY_ETLNS_MASK (0xFFF0000U) -#define ENET_MAC_TIMESTAMP_EGRESS_LATENCY_ETLNS_SHIFT (16U) -/*! ETLNS - Egress Timestamp Latency, in nanoseconds */ -#define ENET_MAC_TIMESTAMP_EGRESS_LATENCY_ETLNS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_EGRESS_LATENCY_ETLNS_SHIFT)) & ENET_MAC_TIMESTAMP_EGRESS_LATENCY_ETLNS_MASK) -/*! @} */ - -/*! @name MAC_PPS_CONTROL - PPS Control */ -/*! @{ */ - -#define ENET_MAC_PPS_CONTROL_PPSCTRL_PPSCMD_MASK (0xFU) -#define ENET_MAC_PPS_CONTROL_PPSCTRL_PPSCMD_SHIFT (0U) -/*! PPSCTRL_PPSCMD - PPS Output Frequency Control */ -#define ENET_MAC_PPS_CONTROL_PPSCTRL_PPSCMD(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PPS_CONTROL_PPSCTRL_PPSCMD_SHIFT)) & ENET_MAC_PPS_CONTROL_PPSCTRL_PPSCMD_MASK) -/*! @} */ - -/*! @name PPS0_TARGET_TIME_SECONDS - PPS0 Target Time Seconds */ -/*! @{ */ - -#define ENET_PPS0_TARGET_TIME_SECONDS_TSTRH0_MASK (0xFFFFFFFFU) -#define ENET_PPS0_TARGET_TIME_SECONDS_TSTRH0_SHIFT (0U) -/*! TSTRH0 - PPS Target Time Seconds Register */ -#define ENET_PPS0_TARGET_TIME_SECONDS_TSTRH0(x) (((uint32_t)(((uint32_t)(x)) << ENET_PPS0_TARGET_TIME_SECONDS_TSTRH0_SHIFT)) & ENET_PPS0_TARGET_TIME_SECONDS_TSTRH0_MASK) -/*! @} */ - -/*! @name PPS0_TARGET_TIME_NANOSECONDS - PPS0 Target Time Nanoseconds */ -/*! @{ */ - -#define ENET_PPS0_TARGET_TIME_NANOSECONDS_TTSL0_MASK (0x7FFFFFFFU) -#define ENET_PPS0_TARGET_TIME_NANOSECONDS_TTSL0_SHIFT (0U) -/*! TTSL0 - Target Time Low for PPS Register */ -#define ENET_PPS0_TARGET_TIME_NANOSECONDS_TTSL0(x) (((uint32_t)(((uint32_t)(x)) << ENET_PPS0_TARGET_TIME_NANOSECONDS_TTSL0_SHIFT)) & ENET_PPS0_TARGET_TIME_NANOSECONDS_TTSL0_MASK) -/*! @} */ - -/*! @name MTL_OPERATION_MODE - MTL Operation Mode */ -/*! @{ */ - -#define ENET_MTL_OPERATION_MODE_DTXSTS_MASK (0x2U) -#define ENET_MTL_OPERATION_MODE_DTXSTS_SHIFT (1U) -/*! DTXSTS - Drop Transmit Status - * 0b0..Drop Transmit Status is disabled - * 0b1..Drop Transmit Status is enabled - */ -#define ENET_MTL_OPERATION_MODE_DTXSTS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_OPERATION_MODE_DTXSTS_SHIFT)) & ENET_MTL_OPERATION_MODE_DTXSTS_MASK) - -#define ENET_MTL_OPERATION_MODE_RAA_MASK (0x4U) -#define ENET_MTL_OPERATION_MODE_RAA_SHIFT (2U) -/*! RAA - Receive Arbitration Algorithm - * 0b0..Strict priority (SP) - * 0b1..Weighted Strict Priority (WSP) - */ -#define ENET_MTL_OPERATION_MODE_RAA(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_OPERATION_MODE_RAA_SHIFT)) & ENET_MTL_OPERATION_MODE_RAA_MASK) - -#define ENET_MTL_OPERATION_MODE_SCHALG_MASK (0x60U) -#define ENET_MTL_OPERATION_MODE_SCHALG_SHIFT (5U) -/*! SCHALG - Tx Scheduling Algorithm - * 0b10..DWRR algorithm when DCB feature is selected.Otherwise, Reserved - * 0b11..Strict priority algorithm - * 0b01..WFQ algorithm when DCB feature is selected.Otherwise, Reserved - * 0b00..WRR algorithm - */ -#define ENET_MTL_OPERATION_MODE_SCHALG(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_OPERATION_MODE_SCHALG_SHIFT)) & ENET_MTL_OPERATION_MODE_SCHALG_MASK) - -#define ENET_MTL_OPERATION_MODE_CNTPRST_MASK (0x100U) -#define ENET_MTL_OPERATION_MODE_CNTPRST_SHIFT (8U) -/*! CNTPRST - Counters Preset - * 0b0..Counters Preset is disabled - * 0b1..Counters Preset is enabled - */ -#define ENET_MTL_OPERATION_MODE_CNTPRST(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_OPERATION_MODE_CNTPRST_SHIFT)) & ENET_MTL_OPERATION_MODE_CNTPRST_MASK) - -#define ENET_MTL_OPERATION_MODE_CNTCLR_MASK (0x200U) -#define ENET_MTL_OPERATION_MODE_CNTCLR_SHIFT (9U) -/*! CNTCLR - Counters Reset - * 0b0..Counters are not reset - * 0b1..All counters are reset - */ -#define ENET_MTL_OPERATION_MODE_CNTCLR(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_OPERATION_MODE_CNTCLR_SHIFT)) & ENET_MTL_OPERATION_MODE_CNTCLR_MASK) -/*! @} */ - -/*! @name MTL_INTERRUPT_STATUS - MTL Interrupt Status */ -/*! @{ */ - -#define ENET_MTL_INTERRUPT_STATUS_Q0IS_MASK (0x1U) -#define ENET_MTL_INTERRUPT_STATUS_Q0IS_SHIFT (0U) -/*! Q0IS - Queue 0 Interrupt status - * 0b1..Queue 0 Interrupt status detected - * 0b0..Queue 0 Interrupt status not detected - */ -#define ENET_MTL_INTERRUPT_STATUS_Q0IS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_INTERRUPT_STATUS_Q0IS_SHIFT)) & ENET_MTL_INTERRUPT_STATUS_Q0IS_MASK) - -#define ENET_MTL_INTERRUPT_STATUS_Q1IS_MASK (0x2U) -#define ENET_MTL_INTERRUPT_STATUS_Q1IS_SHIFT (1U) -/*! Q1IS - Queue 1 Interrupt status - * 0b1..Queue 1 Interrupt status detected - * 0b0..Queue 1 Interrupt status not detected - */ -#define ENET_MTL_INTERRUPT_STATUS_Q1IS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_INTERRUPT_STATUS_Q1IS_SHIFT)) & ENET_MTL_INTERRUPT_STATUS_Q1IS_MASK) -/*! @} */ - -/*! @name MTL_RXQ_DMA_MAP0 - Receive Queue and DMA Channel Mapping 0 */ -/*! @{ */ - -#define ENET_MTL_RXQ_DMA_MAP0_Q0MDMACH_MASK (0x1U) -#define ENET_MTL_RXQ_DMA_MAP0_Q0MDMACH_SHIFT (0U) -/*! Q0MDMACH - Queue 0 Mapped to DMA Channel */ -#define ENET_MTL_RXQ_DMA_MAP0_Q0MDMACH(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_RXQ_DMA_MAP0_Q0MDMACH_SHIFT)) & ENET_MTL_RXQ_DMA_MAP0_Q0MDMACH_MASK) - -#define ENET_MTL_RXQ_DMA_MAP0_Q0DDMACH_MASK (0x10U) -#define ENET_MTL_RXQ_DMA_MAP0_Q0DDMACH_SHIFT (4U) -/*! Q0DDMACH - Queue 0 Enabled for DA-based DMA Channel Selection - * 0b0..Queue 0 disabled for DA-based DMA Channel Selection - * 0b1..Queue 0 enabled for DA-based DMA Channel Selection - */ -#define ENET_MTL_RXQ_DMA_MAP0_Q0DDMACH(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_RXQ_DMA_MAP0_Q0DDMACH_SHIFT)) & ENET_MTL_RXQ_DMA_MAP0_Q0DDMACH_MASK) - -#define ENET_MTL_RXQ_DMA_MAP0_Q1MDMACH_MASK (0x100U) -#define ENET_MTL_RXQ_DMA_MAP0_Q1MDMACH_SHIFT (8U) -/*! Q1MDMACH - Queue 1 Mapped to DMA Channel */ -#define ENET_MTL_RXQ_DMA_MAP0_Q1MDMACH(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_RXQ_DMA_MAP0_Q1MDMACH_SHIFT)) & ENET_MTL_RXQ_DMA_MAP0_Q1MDMACH_MASK) - -#define ENET_MTL_RXQ_DMA_MAP0_Q1DDMACH_MASK (0x1000U) -#define ENET_MTL_RXQ_DMA_MAP0_Q1DDMACH_SHIFT (12U) -/*! Q1DDMACH - Queue 1 Enabled for DA-based DMA Channel Selection - * 0b0..Queue 1 disabled for DA-based DMA Channel Selection - * 0b1..Queue 1 enabled for DA-based DMA Channel Selection - */ -#define ENET_MTL_RXQ_DMA_MAP0_Q1DDMACH(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_RXQ_DMA_MAP0_Q1DDMACH_SHIFT)) & ENET_MTL_RXQ_DMA_MAP0_Q1DDMACH_MASK) -/*! @} */ - -/*! @name MTL_QUEUE_MTL_TXQX_OP_MODE - Queue 0 Transmit Operation Mode..Queue 1 Transmit Operation Mode */ -/*! @{ */ - -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_FTQ_MASK (0x1U) -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_FTQ_SHIFT (0U) -/*! FTQ - Flush Transmit Queue - * 0b0..Flush Transmit Queue is disabled - * 0b1..Flush Transmit Queue is enabled - */ -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_FTQ(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_FTQ_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_FTQ_MASK) - -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TSF_MASK (0x2U) -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TSF_SHIFT (1U) -/*! TSF - Transmit Store and Forward - * 0b0..Transmit Store and Forward is disabled - * 0b1..Transmit Store and Forward is enabled - */ -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TSF(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TSF_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TSF_MASK) - -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TXQEN_MASK (0xCU) -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TXQEN_SHIFT (2U) -/*! TXQEN - Transmit Queue Enable - * 0b00..Not enabled - * 0b10..Enabled - * 0b01..Enable in AV mode (Reserved in non-AV) - * 0b11..Reserved - */ -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TXQEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TXQEN_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TXQEN_MASK) - -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TTC_MASK (0x70U) -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TTC_SHIFT (4U) -/*! TTC - Transmit Threshold Control - * 0b011..128 - * 0b100..192 - * 0b101..256 - * 0b000..32 - * 0b110..384 - * 0b111..512 - * 0b001..64 - * 0b010..96 - */ -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TTC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TTC_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TTC_MASK) - -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TQS_MASK (0x70000U) -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TQS_SHIFT (16U) -/*! TQS - Transmit Queue Size */ -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TQS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TQS_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TQS_MASK) -/*! @} */ - -/* The count of ENET_MTL_QUEUE_MTL_TXQX_OP_MODE */ -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_COUNT (2U) - -/*! @name MTL_QUEUE_MTL_TXQX_UNDRFLW - Queue 0 Underflow Counter..Queue 1 Underflow Counter */ -/*! @{ */ - -#define ENET_MTL_QUEUE_MTL_TXQX_UNDRFLW_UFFRMCNT_MASK (0x7FFU) -#define ENET_MTL_QUEUE_MTL_TXQX_UNDRFLW_UFFRMCNT_SHIFT (0U) -/*! UFFRMCNT - Underflow Packet Counter */ -#define ENET_MTL_QUEUE_MTL_TXQX_UNDRFLW_UFFRMCNT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_UNDRFLW_UFFRMCNT_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_UNDRFLW_UFFRMCNT_MASK) - -#define ENET_MTL_QUEUE_MTL_TXQX_UNDRFLW_UFCNTOVF_MASK (0x800U) -#define ENET_MTL_QUEUE_MTL_TXQX_UNDRFLW_UFCNTOVF_SHIFT (11U) -/*! UFCNTOVF - Overflow Bit for Underflow Packet Counter - * 0b1..Overflow detected for Underflow Packet Counter - * 0b0..Overflow not detected for Underflow Packet Counter - */ -#define ENET_MTL_QUEUE_MTL_TXQX_UNDRFLW_UFCNTOVF(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_UNDRFLW_UFCNTOVF_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_UNDRFLW_UFCNTOVF_MASK) -/*! @} */ - -/* The count of ENET_MTL_QUEUE_MTL_TXQX_UNDRFLW */ -#define ENET_MTL_QUEUE_MTL_TXQX_UNDRFLW_COUNT (2U) - -/*! @name MTL_QUEUE_MTL_TXQX_DBG - Queue 0 Transmit Debug..Queue 1 Transmit Debug */ -/*! @{ */ - -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_TXQPAUSED_MASK (0x1U) -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_TXQPAUSED_SHIFT (0U) -/*! TXQPAUSED - Transmit Queue in Pause - * 0b1..Transmit Queue in Pause status is detected - * 0b0..Transmit Queue in Pause status is not detected - */ -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_TXQPAUSED(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_DBG_TXQPAUSED_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_DBG_TXQPAUSED_MASK) - -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_TRCSTS_MASK (0x6U) -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_TRCSTS_SHIFT (1U) -/*! TRCSTS - MTL Tx Queue Read Controller Status - * 0b11..Flushing the Tx queue because of the Packet Abort request from the MAC - * 0b00..Idle state - * 0b01..Read state (transferring data to the MAC transmitter) - * 0b10..Waiting for pending Tx Status from the MAC transmitter - */ -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_TRCSTS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_DBG_TRCSTS_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_DBG_TRCSTS_MASK) - -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_TWCSTS_MASK (0x8U) -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_TWCSTS_SHIFT (3U) -/*! TWCSTS - MTL Tx Queue Write Controller Status - * 0b1..MTL Tx Queue Write Controller status is detected - * 0b0..MTL Tx Queue Write Controller status is not detected - */ -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_TWCSTS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_DBG_TWCSTS_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_DBG_TWCSTS_MASK) - -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_TXQSTS_MASK (0x10U) -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_TXQSTS_SHIFT (4U) -/*! TXQSTS - MTL Tx Queue Not Empty Status - * 0b1..MTL Tx Queue Not Empty status is detected - * 0b0..MTL Tx Queue Not Empty status is not detected - */ -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_TXQSTS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_DBG_TXQSTS_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_DBG_TXQSTS_MASK) - -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_TXSTSFSTS_MASK (0x20U) -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_TXSTSFSTS_SHIFT (5U) -/*! TXSTSFSTS - MTL Tx Status FIFO Full Status - * 0b1..MTL Tx Status FIFO Full status is detected - * 0b0..MTL Tx Status FIFO Full status is not detected - */ -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_TXSTSFSTS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_DBG_TXSTSFSTS_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_DBG_TXSTSFSTS_MASK) - -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_PTXQ_MASK (0x70000U) -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_PTXQ_SHIFT (16U) -/*! PTXQ - Number of Packets in the Transmit Queue */ -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_PTXQ(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_DBG_PTXQ_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_DBG_PTXQ_MASK) - -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_STXSTSF_MASK (0x700000U) -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_STXSTSF_SHIFT (20U) -/*! STXSTSF - Number of Status Words in Tx Status FIFO of Queue */ -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_STXSTSF(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_DBG_STXSTSF_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_DBG_STXSTSF_MASK) -/*! @} */ - -/* The count of ENET_MTL_QUEUE_MTL_TXQX_DBG */ -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_COUNT (2U) - -/*! @name MTL_QUEUE_MTL_TXQX_ETS_CTRL - Queue 1 ETS Control */ -/*! @{ */ - -#define ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_AVALG_MASK (0x4U) -#define ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_AVALG_SHIFT (2U) -/*! AVALG - AV Algorithm - * 0b0..CBS Algorithm is disabled - * 0b1..CBS Algorithm is enabled - */ -#define ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_AVALG(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_AVALG_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_AVALG_MASK) - -#define ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_CC_MASK (0x8U) -#define ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_CC_SHIFT (3U) -/*! CC - Credit Control - * 0b0..Credit Control is disabled - * 0b1..Credit Control is enabled - */ -#define ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_CC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_CC_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_CC_MASK) - -#define ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_SLC_MASK (0x70U) -#define ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_SLC_SHIFT (4U) -/*! SLC - Slot Count - * 0b100..16 slots - * 0b000..1 slot - * 0b001..2 slots - * 0b010..4 slots - * 0b011..8 slots - * 0b101..Reserved - */ -#define ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_SLC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_SLC_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_SLC_MASK) -/*! @} */ - -/* The count of ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL */ -#define ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_COUNT (2U) - -/*! @name MTL_QUEUE_MTL_TXQX_ETS_STAT - Queue 0 ETS Status..Queue 1 ETS Status */ -/*! @{ */ - -#define ENET_MTL_QUEUE_MTL_TXQX_ETS_STAT_ABS_MASK (0xFFFFFFU) -#define ENET_MTL_QUEUE_MTL_TXQX_ETS_STAT_ABS_SHIFT (0U) -/*! ABS - Average Bits per Slot */ -#define ENET_MTL_QUEUE_MTL_TXQX_ETS_STAT_ABS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_ETS_STAT_ABS_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_ETS_STAT_ABS_MASK) -/*! @} */ - -/* The count of ENET_MTL_QUEUE_MTL_TXQX_ETS_STAT */ -#define ENET_MTL_QUEUE_MTL_TXQX_ETS_STAT_COUNT (2U) - -/*! @name MTL_QUEUE_MTL_TXQX_QNTM_WGHT - Queue 0 Quantum or Weights..Queue 1 idleSlopeCredit, Quantum or Weights */ -/*! @{ */ - -#define ENET_MTL_QUEUE_MTL_TXQX_QNTM_WGHT_ISCQW_MASK (0x1FFFFFU) -#define ENET_MTL_QUEUE_MTL_TXQX_QNTM_WGHT_ISCQW_SHIFT (0U) -/*! ISCQW - idleSlopeCredit, Quantum or Weights */ -#define ENET_MTL_QUEUE_MTL_TXQX_QNTM_WGHT_ISCQW(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_QNTM_WGHT_ISCQW_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_QNTM_WGHT_ISCQW_MASK) -/*! @} */ - -/* The count of ENET_MTL_QUEUE_MTL_TXQX_QNTM_WGHT */ -#define ENET_MTL_QUEUE_MTL_TXQX_QNTM_WGHT_COUNT (2U) - -/*! @name MTL_QUEUE_MTL_TXQX_SNDSLP_CRDT - Queue 1 sendSlopeCredit */ -/*! @{ */ - -#define ENET_MTL_QUEUE_MTL_TXQX_SNDSLP_CRDT_SSC_MASK (0x3FFFU) -#define ENET_MTL_QUEUE_MTL_TXQX_SNDSLP_CRDT_SSC_SHIFT (0U) -/*! SSC - sendSlopeCredit Value */ -#define ENET_MTL_QUEUE_MTL_TXQX_SNDSLP_CRDT_SSC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_SNDSLP_CRDT_SSC_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_SNDSLP_CRDT_SSC_MASK) -/*! @} */ - -/* The count of ENET_MTL_QUEUE_MTL_TXQX_SNDSLP_CRDT */ -#define ENET_MTL_QUEUE_MTL_TXQX_SNDSLP_CRDT_COUNT (2U) - -/*! @name MTL_QUEUE_MTL_TXQX_HI_CRDT - Queue 1 hiCredit */ -/*! @{ */ - -#define ENET_MTL_QUEUE_MTL_TXQX_HI_CRDT_HC_MASK (0x1FFFFFFFU) -#define ENET_MTL_QUEUE_MTL_TXQX_HI_CRDT_HC_SHIFT (0U) -/*! HC - hiCredit Value */ -#define ENET_MTL_QUEUE_MTL_TXQX_HI_CRDT_HC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_HI_CRDT_HC_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_HI_CRDT_HC_MASK) -/*! @} */ - -/* The count of ENET_MTL_QUEUE_MTL_TXQX_HI_CRDT */ -#define ENET_MTL_QUEUE_MTL_TXQX_HI_CRDT_COUNT (2U) - -/*! @name MTL_QUEUE_MTL_TXQX_LO_CRDT - Queue 1 loCredit */ -/*! @{ */ - -#define ENET_MTL_QUEUE_MTL_TXQX_LO_CRDT_LC_MASK (0x1FFFFFFFU) -#define ENET_MTL_QUEUE_MTL_TXQX_LO_CRDT_LC_SHIFT (0U) -/*! LC - loCredit Value */ -#define ENET_MTL_QUEUE_MTL_TXQX_LO_CRDT_LC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_LO_CRDT_LC_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_LO_CRDT_LC_MASK) -/*! @} */ - -/* The count of ENET_MTL_QUEUE_MTL_TXQX_LO_CRDT */ -#define ENET_MTL_QUEUE_MTL_TXQX_LO_CRDT_COUNT (2U) - -/*! @name MTL_QUEUE_MTL_QX_INTCTRL_STAT - Queue 0 Interrupt Control Status..Queue 1 Interrupt Control Status */ -/*! @{ */ - -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_TXUNFIS_MASK (0x1U) -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_TXUNFIS_SHIFT (0U) -/*! TXUNFIS - Transmit Queue Underflow Interrupt Status - * 0b1..Transmit Queue Underflow Interrupt Status detected - * 0b0..Transmit Queue Underflow Interrupt Status not detected - */ -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_TXUNFIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_TXUNFIS_SHIFT)) & ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_TXUNFIS_MASK) - -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_ABPSIS_MASK (0x2U) -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_ABPSIS_SHIFT (1U) -/*! ABPSIS - Average Bits Per Slot Interrupt Status - * 0b1..Average Bits Per Slot Interrupt Status detected - * 0b0..Average Bits Per Slot Interrupt Status not detected - */ -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_ABPSIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_ABPSIS_SHIFT)) & ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_ABPSIS_MASK) - -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_TXUIE_MASK (0x100U) -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_TXUIE_SHIFT (8U) -/*! TXUIE - Transmit Queue Underflow Interrupt Enable - * 0b0..Transmit Queue Underflow Interrupt Status is disabled - * 0b1..Transmit Queue Underflow Interrupt Status is enabled - */ -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_TXUIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_TXUIE_SHIFT)) & ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_TXUIE_MASK) - -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_ABPSIE_MASK (0x200U) -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_ABPSIE_SHIFT (9U) -/*! ABPSIE - Average Bits Per Slot Interrupt Enable - * 0b0..Average Bits Per Slot Interrupt is disabled - * 0b1..Average Bits Per Slot Interrupt is enabled - */ -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_ABPSIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_ABPSIE_SHIFT)) & ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_ABPSIE_MASK) - -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_RXOVFIS_MASK (0x10000U) -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_RXOVFIS_SHIFT (16U) -/*! RXOVFIS - Receive Queue Overflow Interrupt Status - * 0b1..Receive Queue Overflow Interrupt Status detected - * 0b0..Receive Queue Overflow Interrupt Status not detected - */ -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_RXOVFIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_RXOVFIS_SHIFT)) & ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_RXOVFIS_MASK) - -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_RXOIE_MASK (0x1000000U) -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_RXOIE_SHIFT (24U) -/*! RXOIE - Receive Queue Overflow Interrupt Enable - * 0b0..Receive Queue Overflow Interrupt is disabled - * 0b1..Receive Queue Overflow Interrupt is enabled - */ -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_RXOIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_RXOIE_SHIFT)) & ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_RXOIE_MASK) -/*! @} */ - -/* The count of ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT */ -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_COUNT (2U) - -/*! @name MTL_QUEUE_MTL_RXQX_OP_MODE - Queue 0 Receive Operation Mode..Queue 1 Receive Operation Mode */ -/*! @{ */ - -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RTC_MASK (0x3U) -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RTC_SHIFT (0U) -/*! RTC - Receive Queue Threshold Control - * 0b11..128 - * 0b01..32 - * 0b00..64 - * 0b10..96 - */ -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RTC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RTC_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RTC_MASK) - -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_FUP_MASK (0x8U) -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_FUP_SHIFT (3U) -/*! FUP - Forward Undersized Good Packets - * 0b0..Forward Undersized Good Packets is disabled - * 0b1..Forward Undersized Good Packets is enabled - */ -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_FUP(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_FUP_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_FUP_MASK) - -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_FEP_MASK (0x10U) -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_FEP_SHIFT (4U) -/*! FEP - Forward Error Packets - * 0b0..Forward Error Packets is disabled - * 0b1..Forward Error Packets is enabled - */ -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_FEP(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_FEP_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_FEP_MASK) - -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RSF_MASK (0x20U) -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RSF_SHIFT (5U) -/*! RSF - Receive Queue Store and Forward - * 0b0..Receive Queue Store and Forward is disabled - * 0b1..Receive Queue Store and Forward is enabled - */ -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RSF(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RSF_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RSF_MASK) - -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_DIS_TCP_EF_MASK (0x40U) -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_DIS_TCP_EF_SHIFT (6U) -/*! DIS_TCP_EF - Disable Dropping of TCP/IP Checksum Error Packets - * 0b1..Dropping of TCP/IP Checksum Error Packets is disabled - * 0b0..Dropping of TCP/IP Checksum Error Packets is enabled - */ -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_DIS_TCP_EF(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_DIS_TCP_EF_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_DIS_TCP_EF_MASK) - -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RQS_MASK (0x700000U) -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RQS_SHIFT (20U) -/*! RQS - Receive Queue Size */ -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RQS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RQS_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RQS_MASK) -/*! @} */ - -/* The count of ENET_MTL_QUEUE_MTL_RXQX_OP_MODE */ -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_COUNT (2U) - -/*! @name MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT - Queue 0 Missed Packet and Overflow Counter..Queue 1 Missed Packet and Overflow Counter */ -/*! @{ */ - -#define ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_OVFPKTCNT_MASK (0x7FFU) -#define ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_OVFPKTCNT_SHIFT (0U) -/*! OVFPKTCNT - Overflow Packet Counter */ -#define ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_OVFPKTCNT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_OVFPKTCNT_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_OVFPKTCNT_MASK) - -#define ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_OVFCNTOVF_MASK (0x800U) -#define ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_OVFCNTOVF_SHIFT (11U) -/*! OVFCNTOVF - Overflow Counter Overflow Bit - * 0b1..Overflow Counter overflow detected - * 0b0..Overflow Counter overflow not detected - */ -#define ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_OVFCNTOVF(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_OVFCNTOVF_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_OVFCNTOVF_MASK) - -#define ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_MISPKTCNT_MASK (0x7FF0000U) -#define ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_MISPKTCNT_SHIFT (16U) -/*! MISPKTCNT - Missed Packet Counter */ -#define ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_MISPKTCNT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_MISPKTCNT_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_MISPKTCNT_MASK) - -#define ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_MISCNTOVF_MASK (0x8000000U) -#define ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_MISCNTOVF_SHIFT (27U) -/*! MISCNTOVF - Missed Packet Counter Overflow Bit - * 0b1..Missed Packet Counter overflow detected - * 0b0..Missed Packet Counter overflow not detected - */ -#define ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_MISCNTOVF(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_MISCNTOVF_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_MISCNTOVF_MASK) -/*! @} */ - -/* The count of ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT */ -#define ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_COUNT (2U) - -/*! @name MTL_QUEUE_MTL_RXQX_DBG - Queue 0 Receive Debug..Queue 1 Receive Debug */ -/*! @{ */ - -#define ENET_MTL_QUEUE_MTL_RXQX_DBG_RWCSTS_MASK (0x1U) -#define ENET_MTL_QUEUE_MTL_RXQX_DBG_RWCSTS_SHIFT (0U) -/*! RWCSTS - MTL Rx Queue Write Controller Active Status - * 0b1..MTL Rx Queue Write Controller Active Status detected - * 0b0..MTL Rx Queue Write Controller Active Status not detected - */ -#define ENET_MTL_QUEUE_MTL_RXQX_DBG_RWCSTS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_DBG_RWCSTS_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_DBG_RWCSTS_MASK) - -#define ENET_MTL_QUEUE_MTL_RXQX_DBG_RRCSTS_MASK (0x6U) -#define ENET_MTL_QUEUE_MTL_RXQX_DBG_RRCSTS_SHIFT (1U) -/*! RRCSTS - MTL Rx Queue Read Controller State - * 0b11..Flushing the packet data and status - * 0b00..Idle state - * 0b01..Reading packet data - * 0b10..Reading packet status (or timestamp) - */ -#define ENET_MTL_QUEUE_MTL_RXQX_DBG_RRCSTS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_DBG_RRCSTS_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_DBG_RRCSTS_MASK) - -#define ENET_MTL_QUEUE_MTL_RXQX_DBG_RXQSTS_MASK (0x30U) -#define ENET_MTL_QUEUE_MTL_RXQX_DBG_RXQSTS_SHIFT (4U) -/*! RXQSTS - MTL Rx Queue Fill-Level Status - * 0b10..Rx Queue fill-level above flow-control activate threshold - * 0b01..Rx Queue fill-level below flow-control deactivate threshold - * 0b00..Rx Queue empty - * 0b11..Rx Queue full - */ -#define ENET_MTL_QUEUE_MTL_RXQX_DBG_RXQSTS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_DBG_RXQSTS_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_DBG_RXQSTS_MASK) - -#define ENET_MTL_QUEUE_MTL_RXQX_DBG_PRXQ_MASK (0x3FFF0000U) -#define ENET_MTL_QUEUE_MTL_RXQX_DBG_PRXQ_SHIFT (16U) -/*! PRXQ - Number of Packets in Receive Queue */ -#define ENET_MTL_QUEUE_MTL_RXQX_DBG_PRXQ(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_DBG_PRXQ_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_DBG_PRXQ_MASK) -/*! @} */ - -/* The count of ENET_MTL_QUEUE_MTL_RXQX_DBG */ -#define ENET_MTL_QUEUE_MTL_RXQX_DBG_COUNT (2U) - -/*! @name MTL_QUEUE_MTL_RXQX_CTRL - Queue 0 Receive Control..Queue 1 Receive Control */ -/*! @{ */ - -#define ENET_MTL_QUEUE_MTL_RXQX_CTRL_RXQ_WEGT_MASK (0x7U) -#define ENET_MTL_QUEUE_MTL_RXQX_CTRL_RXQ_WEGT_SHIFT (0U) -/*! RXQ_WEGT - Receive Queue Weight */ -#define ENET_MTL_QUEUE_MTL_RXQX_CTRL_RXQ_WEGT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_CTRL_RXQ_WEGT_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_CTRL_RXQ_WEGT_MASK) - -#define ENET_MTL_QUEUE_MTL_RXQX_CTRL_RXQ_FRM_ARBIT_MASK (0x8U) -#define ENET_MTL_QUEUE_MTL_RXQX_CTRL_RXQ_FRM_ARBIT_SHIFT (3U) -/*! RXQ_FRM_ARBIT - Receive Queue Packet Arbitration - * 0b0..Receive Queue Packet Arbitration is disabled - * 0b1..Receive Queue Packet Arbitration is enabled - */ -#define ENET_MTL_QUEUE_MTL_RXQX_CTRL_RXQ_FRM_ARBIT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_CTRL_RXQ_FRM_ARBIT_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_CTRL_RXQ_FRM_ARBIT_MASK) -/*! @} */ - -/* The count of ENET_MTL_QUEUE_MTL_RXQX_CTRL */ -#define ENET_MTL_QUEUE_MTL_RXQX_CTRL_COUNT (2U) - -/*! @name DMA_MODE - DMA Bus Mode */ -/*! @{ */ - -#define ENET_DMA_MODE_SWR_MASK (0x1U) -#define ENET_DMA_MODE_SWR_SHIFT (0U) -/*! SWR - Software Reset - * 0b0..Software Reset is disabled - * 0b1..Software Reset is enabled - */ -#define ENET_DMA_MODE_SWR(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_MODE_SWR_SHIFT)) & ENET_DMA_MODE_SWR_MASK) - -#define ENET_DMA_MODE_DA_MASK (0x2U) -#define ENET_DMA_MODE_DA_SHIFT (1U) -/*! DA - DMA Tx or Rx Arbitration Scheme - * 0b1..Fixed Priority - * 0b0..Weighted Round-Robin with Rx:Tx or Tx:Rx - */ -#define ENET_DMA_MODE_DA(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_MODE_DA_SHIFT)) & ENET_DMA_MODE_DA_MASK) - -#define ENET_DMA_MODE_TAA_MASK (0x1CU) -#define ENET_DMA_MODE_TAA_SHIFT (2U) -/*! TAA - Transmit Arbitration Algorithm - * 0b000..Fixed priority - * 0b011..Reserved (for 3'b011 to 3'b111) - * 0b010..Weighted Round-Robin (WRR) - * 0b001..Weighted Strict Priority (WSP) - */ -#define ENET_DMA_MODE_TAA(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_MODE_TAA_SHIFT)) & ENET_DMA_MODE_TAA_MASK) - -#define ENET_DMA_MODE_TXPR_MASK (0x800U) -#define ENET_DMA_MODE_TXPR_SHIFT (11U) -/*! TXPR - Transmit Priority - * 0b0..Transmit Priority is disabled - * 0b1..Transmit Priority is enabled - */ -#define ENET_DMA_MODE_TXPR(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_MODE_TXPR_SHIFT)) & ENET_DMA_MODE_TXPR_MASK) - -#define ENET_DMA_MODE_PR_MASK (0x7000U) -#define ENET_DMA_MODE_PR_SHIFT (12U) -/*! PR - Priority Ratio - * 0b000..The priority ratio is 1:1 - * 0b001..The priority ratio is 2:1 - * 0b010..The priority ratio is 3:1 - * 0b011..The priority ratio is 4:1 - * 0b100..The priority ratio is 5:1 - * 0b101..The priority ratio is 6:1 - * 0b110..The priority ratio is 7:1 - * 0b111..The priority ratio is 8:1 - */ -#define ENET_DMA_MODE_PR(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_MODE_PR_SHIFT)) & ENET_DMA_MODE_PR_MASK) -/*! @} */ - -/*! @name DMA_SYSBUS_MODE - DMA System Bus Mode */ -/*! @{ */ - -#define ENET_DMA_SYSBUS_MODE_FB_MASK (0x1U) -#define ENET_DMA_SYSBUS_MODE_FB_SHIFT (0U) -/*! FB - Fixed Burst Length - * 0b0..Fixed Burst Length is disabled - * 0b1..Fixed Burst Length is enabled - */ -#define ENET_DMA_SYSBUS_MODE_FB(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_SYSBUS_MODE_FB_SHIFT)) & ENET_DMA_SYSBUS_MODE_FB_MASK) - -#define ENET_DMA_SYSBUS_MODE_AAL_MASK (0x1000U) -#define ENET_DMA_SYSBUS_MODE_AAL_SHIFT (12U) -/*! AAL - Address-Aligned Beats - * 0b0..Address-Aligned Beats is disabled - * 0b1..Address-Aligned Beats is enabled - */ -#define ENET_DMA_SYSBUS_MODE_AAL(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_SYSBUS_MODE_AAL_SHIFT)) & ENET_DMA_SYSBUS_MODE_AAL_MASK) - -#define ENET_DMA_SYSBUS_MODE_MB_MASK (0x4000U) -#define ENET_DMA_SYSBUS_MODE_MB_SHIFT (14U) -/*! MB - Mixed Burst - * 0b0..Mixed Burst is disabled - * 0b1..Mixed Burst is enabled - */ -#define ENET_DMA_SYSBUS_MODE_MB(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_SYSBUS_MODE_MB_SHIFT)) & ENET_DMA_SYSBUS_MODE_MB_MASK) - -#define ENET_DMA_SYSBUS_MODE_RB_MASK (0x8000U) -#define ENET_DMA_SYSBUS_MODE_RB_SHIFT (15U) -/*! RB - Rebuild INCRx Burst - * 0b0..Rebuild INCRx Burst is disabled - * 0b1..Rebuild INCRx Burst is enabled - */ -#define ENET_DMA_SYSBUS_MODE_RB(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_SYSBUS_MODE_RB_SHIFT)) & ENET_DMA_SYSBUS_MODE_RB_MASK) -/*! @} */ - -/*! @name DMA_INTERRUPT_STATUS - DMA Interrupt Status */ -/*! @{ */ - -#define ENET_DMA_INTERRUPT_STATUS_DC0IS_MASK (0x1U) -#define ENET_DMA_INTERRUPT_STATUS_DC0IS_SHIFT (0U) -/*! DC0IS - DMA Channel 0 Interrupt Status - * 0b1..DMA Channel 0 Interrupt Status detected - * 0b0..DMA Channel 0 Interrupt Status not detected - */ -#define ENET_DMA_INTERRUPT_STATUS_DC0IS(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_INTERRUPT_STATUS_DC0IS_SHIFT)) & ENET_DMA_INTERRUPT_STATUS_DC0IS_MASK) - -#define ENET_DMA_INTERRUPT_STATUS_DC1IS_MASK (0x2U) -#define ENET_DMA_INTERRUPT_STATUS_DC1IS_SHIFT (1U) -/*! DC1IS - DMA Channel 1 Interrupt Status - * 0b1..DMA Channel 1 Interrupt Status detected - * 0b0..DMA Channel 1 Interrupt Status not detected - */ -#define ENET_DMA_INTERRUPT_STATUS_DC1IS(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_INTERRUPT_STATUS_DC1IS_SHIFT)) & ENET_DMA_INTERRUPT_STATUS_DC1IS_MASK) - -#define ENET_DMA_INTERRUPT_STATUS_MTLIS_MASK (0x10000U) -#define ENET_DMA_INTERRUPT_STATUS_MTLIS_SHIFT (16U) -/*! MTLIS - MTL Interrupt Status - * 0b1..MTL Interrupt Status detected - * 0b0..MTL Interrupt Status not detected - */ -#define ENET_DMA_INTERRUPT_STATUS_MTLIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_INTERRUPT_STATUS_MTLIS_SHIFT)) & ENET_DMA_INTERRUPT_STATUS_MTLIS_MASK) - -#define ENET_DMA_INTERRUPT_STATUS_MACIS_MASK (0x20000U) -#define ENET_DMA_INTERRUPT_STATUS_MACIS_SHIFT (17U) -/*! MACIS - MAC Interrupt Status - * 0b1..MAC Interrupt Status detected - * 0b0..MAC Interrupt Status not detected - */ -#define ENET_DMA_INTERRUPT_STATUS_MACIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_INTERRUPT_STATUS_MACIS_SHIFT)) & ENET_DMA_INTERRUPT_STATUS_MACIS_MASK) -/*! @} */ - -/*! @name DMA_DEBUG_STATUS0 - DMA Debug Status 0 */ -/*! @{ */ - -#define ENET_DMA_DEBUG_STATUS0_AXWHSTS_MASK (0x1U) -#define ENET_DMA_DEBUG_STATUS0_AXWHSTS_SHIFT (0U) -/*! AXWHSTS - AHB Master Status - * 0b1..AXI Master Write Channel or AHB Master Status detected - * 0b0..AXI Master Write Channel or AHB Master Status not detected - */ -#define ENET_DMA_DEBUG_STATUS0_AXWHSTS(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_DEBUG_STATUS0_AXWHSTS_SHIFT)) & ENET_DMA_DEBUG_STATUS0_AXWHSTS_MASK) - -#define ENET_DMA_DEBUG_STATUS0_RPS0_MASK (0xF00U) -#define ENET_DMA_DEBUG_STATUS0_RPS0_SHIFT (8U) -/*! RPS0 - DMA Channel 0 Receive Process State - * 0b0010..Reserved for future use - * 0b0101..Running (Closing the Rx Descriptor) - * 0b0001..Running (Fetching Rx Transfer Descriptor) - * 0b0111..Running (Transferring the received packet data from the Rx buffer to the system memory) - * 0b0011..Running (Waiting for Rx packet) - * 0b0000..Stopped (Reset or Stop Receive Command issued) - * 0b0100..Suspended (Rx Descriptor Unavailable) - * 0b0110..Timestamp write state - */ -#define ENET_DMA_DEBUG_STATUS0_RPS0(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_DEBUG_STATUS0_RPS0_SHIFT)) & ENET_DMA_DEBUG_STATUS0_RPS0_MASK) - -#define ENET_DMA_DEBUG_STATUS0_TPS0_MASK (0xF000U) -#define ENET_DMA_DEBUG_STATUS0_TPS0_SHIFT (12U) -/*! TPS0 - DMA Channel 0 Transmit Process State - * 0b0101..Reserved for future use - * 0b0111..Running (Closing Tx Descriptor) - * 0b0001..Running (Fetching Tx Transfer Descriptor) - * 0b0011..Running (Reading Data from system memory buffer and queuing it to the Tx buffer (Tx FIFO)) - * 0b0010..Running (Waiting for status) - * 0b0000..Stopped (Reset or Stop Transmit Command issued) - * 0b0110..Suspended (Tx Descriptor Unavailable or Tx Buffer Underflow) - * 0b0100..Timestamp write state - */ -#define ENET_DMA_DEBUG_STATUS0_TPS0(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_DEBUG_STATUS0_TPS0_SHIFT)) & ENET_DMA_DEBUG_STATUS0_TPS0_MASK) - -#define ENET_DMA_DEBUG_STATUS0_RPS1_MASK (0xF0000U) -#define ENET_DMA_DEBUG_STATUS0_RPS1_SHIFT (16U) -/*! RPS1 - DMA Channel 1 Receive Process State - * 0b0010..Reserved for future use - * 0b0101..Running (Closing the Rx Descriptor) - * 0b0001..Running (Fetching Rx Transfer Descriptor) - * 0b0111..Running (Transferring the received packet data from the Rx buffer to the system memory) - * 0b0011..Running (Waiting for Rx packet) - * 0b0000..Stopped (Reset or Stop Receive Command issued) - * 0b0100..Suspended (Rx Descriptor Unavailable) - * 0b0110..Timestamp write state - */ -#define ENET_DMA_DEBUG_STATUS0_RPS1(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_DEBUG_STATUS0_RPS1_SHIFT)) & ENET_DMA_DEBUG_STATUS0_RPS1_MASK) - -#define ENET_DMA_DEBUG_STATUS0_TPS1_MASK (0xF00000U) -#define ENET_DMA_DEBUG_STATUS0_TPS1_SHIFT (20U) -/*! TPS1 - DMA Channel 1 Transmit Process State - * 0b0101..Reserved for future use - * 0b0111..Running (Closing Tx Descriptor) - * 0b0001..Running (Fetching Tx Transfer Descriptor) - * 0b0011..Running (Reading Data from system memory buffer and queuing it to the Tx buffer (Tx FIFO)) - * 0b0010..Running (Waiting for status) - * 0b0000..Stopped (Reset or Stop Transmit Command issued) - * 0b0110..Suspended (Tx Descriptor Unavailable or Tx Buffer Underflow) - * 0b0100..Timestamp write state - */ -#define ENET_DMA_DEBUG_STATUS0_TPS1(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_DEBUG_STATUS0_TPS1_SHIFT)) & ENET_DMA_DEBUG_STATUS0_TPS1_MASK) -/*! @} */ - -/*! @name DMA_CH_DMA_CHX_CTRL - DMA Channel 0 Control..DMA Channel 1 Control */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_CTRL_PBLx8_MASK (0x10000U) -#define ENET_DMA_CH_DMA_CHX_CTRL_PBLx8_SHIFT (16U) -/*! PBLx8 - 8xPBL mode - * 0b0..8xPBL mode is disabled - * 0b1..8xPBL mode is enabled - */ -#define ENET_DMA_CH_DMA_CHX_CTRL_PBLx8(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_CTRL_PBLx8_SHIFT)) & ENET_DMA_CH_DMA_CHX_CTRL_PBLx8_MASK) - -#define ENET_DMA_CH_DMA_CHX_CTRL_DSL_MASK (0x1C0000U) -#define ENET_DMA_CH_DMA_CHX_CTRL_DSL_SHIFT (18U) -/*! DSL - Descriptor Skip Length */ -#define ENET_DMA_CH_DMA_CHX_CTRL_DSL(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_CTRL_DSL_SHIFT)) & ENET_DMA_CH_DMA_CHX_CTRL_DSL_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_CTRL */ -#define ENET_DMA_CH_DMA_CHX_CTRL_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_TX_CTRL - DMA Channel 0 Transmit Control..DMA Channel 1 Transmit Control */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_ST_MASK (0x1U) -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_ST_SHIFT (0U) -/*! ST - Start or Stop Transmission Command - * 0b1..Start Transmission Command - * 0b0..Stop Transmission Command - */ -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_ST(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_TX_CTRL_ST_SHIFT)) & ENET_DMA_CH_DMA_CHX_TX_CTRL_ST_MASK) - -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_TCW_MASK (0xEU) -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_TCW_SHIFT (1U) -/*! TCW - Transmit Channel Weight */ -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_TCW(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_TX_CTRL_TCW_SHIFT)) & ENET_DMA_CH_DMA_CHX_TX_CTRL_TCW_MASK) - -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_OSF_MASK (0x10U) -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_OSF_SHIFT (4U) -/*! OSF - Operate on Second Packet - * 0b0..Operate on Second Packet disabled - * 0b1..Operate on Second Packet enabled - */ -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_OSF(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_TX_CTRL_OSF_SHIFT)) & ENET_DMA_CH_DMA_CHX_TX_CTRL_OSF_MASK) - -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_TxPBL_MASK (0x3F0000U) -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_TxPBL_SHIFT (16U) -/*! TxPBL - Transmit Programmable Burst Length */ -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_TxPBL(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_TX_CTRL_TxPBL_SHIFT)) & ENET_DMA_CH_DMA_CHX_TX_CTRL_TxPBL_MASK) - -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_ETIC_MASK (0x400000U) -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_ETIC_SHIFT (22U) -/*! ETIC - Early Transmit Interrupt Control - * 0b0..Early Transmit Interrupt is disabled - * 0b1..Early Transmit Interrupt is enabled - */ -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_ETIC(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_TX_CTRL_ETIC_SHIFT)) & ENET_DMA_CH_DMA_CHX_TX_CTRL_ETIC_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_TX_CTRL */ -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_RX_CTRL - DMA Channel 0 Receive Control..DMA Channel 1 Receive Control */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_SR_MASK (0x1U) -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_SR_SHIFT (0U) -/*! SR - Start or Stop Receive - * 0b1..Start Receive - * 0b0..Stop Receive - */ -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_SR(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_RX_CTRL_SR_SHIFT)) & ENET_DMA_CH_DMA_CHX_RX_CTRL_SR_MASK) - -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_RBSZ_X_0_MASK (0x6U) -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_RBSZ_X_0_SHIFT (1U) -/*! RBSZ_X_0 - Receive Buffer size Low */ -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_RBSZ_X_0(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_RX_CTRL_RBSZ_X_0_SHIFT)) & ENET_DMA_CH_DMA_CHX_RX_CTRL_RBSZ_X_0_MASK) - -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_RBSZ_13_Y_MASK (0x7FF8U) -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_RBSZ_13_Y_SHIFT (3U) -/*! RBSZ_13_Y - Receive Buffer size High */ -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_RBSZ_13_Y(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_RX_CTRL_RBSZ_13_Y_SHIFT)) & ENET_DMA_CH_DMA_CHX_RX_CTRL_RBSZ_13_Y_MASK) - -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_RxPBL_MASK (0x3F0000U) -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_RxPBL_SHIFT (16U) -/*! RxPBL - Receive Programmable Burst Length */ -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_RxPBL(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_RX_CTRL_RxPBL_SHIFT)) & ENET_DMA_CH_DMA_CHX_RX_CTRL_RxPBL_MASK) - -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_ERIC_MASK (0x400000U) -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_ERIC_SHIFT (22U) -/*! ERIC - Early Receive Interrupt Control - * 0b0..Early Receive Interrupt is disabled - * 0b1..Early Receive Interrupt is enabled - */ -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_ERIC(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_RX_CTRL_ERIC_SHIFT)) & ENET_DMA_CH_DMA_CHX_RX_CTRL_ERIC_MASK) - -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_RPF_MASK (0x80000000U) -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_RPF_SHIFT (31U) -/*! RPF - Rx Packet Flush. - * 0b0..Rx Packet Flush is disabled - * 0b1..Rx Packet Flush is enabled - */ -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_RPF(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_RX_CTRL_RPF_SHIFT)) & ENET_DMA_CH_DMA_CHX_RX_CTRL_RPF_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_RX_CTRL */ -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_TXDESC_LIST_ADDR - Channel 0 Tx Descriptor List Address register..Channel 1 Tx Descriptor List Address */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_TXDESC_LIST_ADDR_TDESLA_MASK (0xFFFFFFFCU) -#define ENET_DMA_CH_DMA_CHX_TXDESC_LIST_ADDR_TDESLA_SHIFT (2U) -/*! TDESLA - Start of Transmit List */ -#define ENET_DMA_CH_DMA_CHX_TXDESC_LIST_ADDR_TDESLA(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_TXDESC_LIST_ADDR_TDESLA_SHIFT)) & ENET_DMA_CH_DMA_CHX_TXDESC_LIST_ADDR_TDESLA_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_TXDESC_LIST_ADDR */ -#define ENET_DMA_CH_DMA_CHX_TXDESC_LIST_ADDR_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_RXDESC_LIST_ADDR - Channel 0 Rx Descriptor List Address register..Channel 1 Rx Descriptor List Address */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_RXDESC_LIST_ADDR_RDESLA_MASK (0xFFFFFFFCU) -#define ENET_DMA_CH_DMA_CHX_RXDESC_LIST_ADDR_RDESLA_SHIFT (2U) -/*! RDESLA - Start of Receive List */ -#define ENET_DMA_CH_DMA_CHX_RXDESC_LIST_ADDR_RDESLA(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_RXDESC_LIST_ADDR_RDESLA_SHIFT)) & ENET_DMA_CH_DMA_CHX_RXDESC_LIST_ADDR_RDESLA_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_RXDESC_LIST_ADDR */ -#define ENET_DMA_CH_DMA_CHX_RXDESC_LIST_ADDR_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_TXDESC_TAIL_PTR - Channel 0 Tx Descriptor Tail Pointer..Channel 1 Tx Descriptor Tail Pointer */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_TXDESC_TAIL_PTR_TDTP_MASK (0xFFFFFFFCU) -#define ENET_DMA_CH_DMA_CHX_TXDESC_TAIL_PTR_TDTP_SHIFT (2U) -/*! TDTP - Transmit Descriptor Tail Pointer */ -#define ENET_DMA_CH_DMA_CHX_TXDESC_TAIL_PTR_TDTP(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_TXDESC_TAIL_PTR_TDTP_SHIFT)) & ENET_DMA_CH_DMA_CHX_TXDESC_TAIL_PTR_TDTP_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_TXDESC_TAIL_PTR */ -#define ENET_DMA_CH_DMA_CHX_TXDESC_TAIL_PTR_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_RXDESC_TAIL_PTR - Channel 0 Rx Descriptor Tail Pointer..Channel 1 Rx Descriptor Tail Pointer */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_RXDESC_TAIL_PTR_RDTP_MASK (0xFFFFFFFCU) -#define ENET_DMA_CH_DMA_CHX_RXDESC_TAIL_PTR_RDTP_SHIFT (2U) -/*! RDTP - Receive Descriptor Tail Pointer */ -#define ENET_DMA_CH_DMA_CHX_RXDESC_TAIL_PTR_RDTP(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_RXDESC_TAIL_PTR_RDTP_SHIFT)) & ENET_DMA_CH_DMA_CHX_RXDESC_TAIL_PTR_RDTP_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_RXDESC_TAIL_PTR */ -#define ENET_DMA_CH_DMA_CHX_RXDESC_TAIL_PTR_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_TXDESC_RING_LENGTH - Channel 0 Tx Descriptor Ring Length..Channel 1 Tx Descriptor Ring Length */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_TXDESC_RING_LENGTH_TDRL_MASK (0x3FFU) -#define ENET_DMA_CH_DMA_CHX_TXDESC_RING_LENGTH_TDRL_SHIFT (0U) -/*! TDRL - Transmit Descriptor Ring Length */ -#define ENET_DMA_CH_DMA_CHX_TXDESC_RING_LENGTH_TDRL(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_TXDESC_RING_LENGTH_TDRL_SHIFT)) & ENET_DMA_CH_DMA_CHX_TXDESC_RING_LENGTH_TDRL_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_TXDESC_RING_LENGTH */ -#define ENET_DMA_CH_DMA_CHX_TXDESC_RING_LENGTH_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_RX_CONTROL2 - Channeli Receive Control..DMA Channel 1 Receive Control */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_RX_CONTROL2_RDRL_MASK (0x3FFU) -#define ENET_DMA_CH_DMA_CHX_RX_CONTROL2_RDRL_SHIFT (0U) -/*! RDRL - Receive Descriptor Ring Length */ -#define ENET_DMA_CH_DMA_CHX_RX_CONTROL2_RDRL(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_RX_CONTROL2_RDRL_SHIFT)) & ENET_DMA_CH_DMA_CHX_RX_CONTROL2_RDRL_MASK) - -#define ENET_DMA_CH_DMA_CHX_RX_CONTROL2_ARBS_MASK (0xFF0000U) -#define ENET_DMA_CH_DMA_CHX_RX_CONTROL2_ARBS_SHIFT (16U) -/*! ARBS - Alternate Receive Buffer Size */ -#define ENET_DMA_CH_DMA_CHX_RX_CONTROL2_ARBS(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_RX_CONTROL2_ARBS_SHIFT)) & ENET_DMA_CH_DMA_CHX_RX_CONTROL2_ARBS_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_RX_CONTROL2 */ -#define ENET_DMA_CH_DMA_CHX_RX_CONTROL2_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_INT_EN - Channeli Interrupt Enable..Channel 1 Interrupt Enable */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_INT_EN_TIE_MASK (0x1U) -#define ENET_DMA_CH_DMA_CHX_INT_EN_TIE_SHIFT (0U) -/*! TIE - Transmit Interrupt Enable - * 0b0..Transmit Interrupt is disabled - * 0b1..Transmit Interrupt is enabled - */ -#define ENET_DMA_CH_DMA_CHX_INT_EN_TIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_INT_EN_TIE_SHIFT)) & ENET_DMA_CH_DMA_CHX_INT_EN_TIE_MASK) - -#define ENET_DMA_CH_DMA_CHX_INT_EN_TXSE_MASK (0x2U) -#define ENET_DMA_CH_DMA_CHX_INT_EN_TXSE_SHIFT (1U) -/*! TXSE - Transmit Stopped Enable - * 0b0..Transmit Stopped is disabled - * 0b1..Transmit Stopped is enabled - */ -#define ENET_DMA_CH_DMA_CHX_INT_EN_TXSE(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_INT_EN_TXSE_SHIFT)) & ENET_DMA_CH_DMA_CHX_INT_EN_TXSE_MASK) - -#define ENET_DMA_CH_DMA_CHX_INT_EN_TBUE_MASK (0x4U) -#define ENET_DMA_CH_DMA_CHX_INT_EN_TBUE_SHIFT (2U) -/*! TBUE - Transmit Buffer Unavailable Enable - * 0b0..Transmit Buffer Unavailable is disabled - * 0b1..Transmit Buffer Unavailable is enabled - */ -#define ENET_DMA_CH_DMA_CHX_INT_EN_TBUE(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_INT_EN_TBUE_SHIFT)) & ENET_DMA_CH_DMA_CHX_INT_EN_TBUE_MASK) - -#define ENET_DMA_CH_DMA_CHX_INT_EN_RIE_MASK (0x40U) -#define ENET_DMA_CH_DMA_CHX_INT_EN_RIE_SHIFT (6U) -/*! RIE - Receive Interrupt Enable - * 0b0..Receive Interrupt is disabled - * 0b1..Receive Interrupt is enabled - */ -#define ENET_DMA_CH_DMA_CHX_INT_EN_RIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_INT_EN_RIE_SHIFT)) & ENET_DMA_CH_DMA_CHX_INT_EN_RIE_MASK) - -#define ENET_DMA_CH_DMA_CHX_INT_EN_RBUE_MASK (0x80U) -#define ENET_DMA_CH_DMA_CHX_INT_EN_RBUE_SHIFT (7U) -/*! RBUE - Receive Buffer Unavailable Enable - * 0b0..Receive Buffer Unavailable is disabled - * 0b1..Receive Buffer Unavailable is enabled - */ -#define ENET_DMA_CH_DMA_CHX_INT_EN_RBUE(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_INT_EN_RBUE_SHIFT)) & ENET_DMA_CH_DMA_CHX_INT_EN_RBUE_MASK) - -#define ENET_DMA_CH_DMA_CHX_INT_EN_RSE_MASK (0x100U) -#define ENET_DMA_CH_DMA_CHX_INT_EN_RSE_SHIFT (8U) -/*! RSE - Receive Stopped Enable - * 0b0..Receive Stopped is disabled - * 0b1..Receive Stopped is enabled - */ -#define ENET_DMA_CH_DMA_CHX_INT_EN_RSE(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_INT_EN_RSE_SHIFT)) & ENET_DMA_CH_DMA_CHX_INT_EN_RSE_MASK) - -#define ENET_DMA_CH_DMA_CHX_INT_EN_RWTE_MASK (0x200U) -#define ENET_DMA_CH_DMA_CHX_INT_EN_RWTE_SHIFT (9U) -/*! RWTE - Receive Watchdog Timeout Enable - * 0b0..Receive Watchdog Timeout is disabled - * 0b1..Receive Watchdog Timeout is enabled - */ -#define ENET_DMA_CH_DMA_CHX_INT_EN_RWTE(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_INT_EN_RWTE_SHIFT)) & ENET_DMA_CH_DMA_CHX_INT_EN_RWTE_MASK) - -#define ENET_DMA_CH_DMA_CHX_INT_EN_ETIE_MASK (0x400U) -#define ENET_DMA_CH_DMA_CHX_INT_EN_ETIE_SHIFT (10U) -/*! ETIE - Early Transmit Interrupt Enable - * 0b0..Early Transmit Interrupt is disabled - * 0b1..Early Transmit Interrupt is enabled - */ -#define ENET_DMA_CH_DMA_CHX_INT_EN_ETIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_INT_EN_ETIE_SHIFT)) & ENET_DMA_CH_DMA_CHX_INT_EN_ETIE_MASK) - -#define ENET_DMA_CH_DMA_CHX_INT_EN_ERIE_MASK (0x800U) -#define ENET_DMA_CH_DMA_CHX_INT_EN_ERIE_SHIFT (11U) -/*! ERIE - Early Receive Interrupt Enable - * 0b0..Early Receive Interrupt is disabled - * 0b1..Early Receive Interrupt is enabled - */ -#define ENET_DMA_CH_DMA_CHX_INT_EN_ERIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_INT_EN_ERIE_SHIFT)) & ENET_DMA_CH_DMA_CHX_INT_EN_ERIE_MASK) - -#define ENET_DMA_CH_DMA_CHX_INT_EN_FBEE_MASK (0x1000U) -#define ENET_DMA_CH_DMA_CHX_INT_EN_FBEE_SHIFT (12U) -/*! FBEE - Fatal Bus Error Enable - * 0b0..Fatal Bus Error is disabled - * 0b1..Fatal Bus Error is enabled - */ -#define ENET_DMA_CH_DMA_CHX_INT_EN_FBEE(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_INT_EN_FBEE_SHIFT)) & ENET_DMA_CH_DMA_CHX_INT_EN_FBEE_MASK) - -#define ENET_DMA_CH_DMA_CHX_INT_EN_CDEE_MASK (0x2000U) -#define ENET_DMA_CH_DMA_CHX_INT_EN_CDEE_SHIFT (13U) -/*! CDEE - Context Descriptor Error Enable - * 0b0..Context Descriptor Error is disabled - * 0b1..Context Descriptor Error is enabled - */ -#define ENET_DMA_CH_DMA_CHX_INT_EN_CDEE(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_INT_EN_CDEE_SHIFT)) & ENET_DMA_CH_DMA_CHX_INT_EN_CDEE_MASK) - -#define ENET_DMA_CH_DMA_CHX_INT_EN_AIE_MASK (0x4000U) -#define ENET_DMA_CH_DMA_CHX_INT_EN_AIE_SHIFT (14U) -/*! AIE - Abnormal Interrupt Summary Enable - * 0b0..Abnormal Interrupt Summary is disabled - * 0b1..Abnormal Interrupt Summary is enabled - */ -#define ENET_DMA_CH_DMA_CHX_INT_EN_AIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_INT_EN_AIE_SHIFT)) & ENET_DMA_CH_DMA_CHX_INT_EN_AIE_MASK) - -#define ENET_DMA_CH_DMA_CHX_INT_EN_NIE_MASK (0x8000U) -#define ENET_DMA_CH_DMA_CHX_INT_EN_NIE_SHIFT (15U) -/*! NIE - Normal Interrupt Summary Enable - * 0b0..Normal Interrupt Summary is disabled - * 0b1..Normal Interrupt Summary is enabled - */ -#define ENET_DMA_CH_DMA_CHX_INT_EN_NIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_INT_EN_NIE_SHIFT)) & ENET_DMA_CH_DMA_CHX_INT_EN_NIE_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_INT_EN */ -#define ENET_DMA_CH_DMA_CHX_INT_EN_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_RX_INT_WDTIMER - Channel 0 Receive Interrupt Watchdog Timer..Channel 1 Receive Interrupt Watchdog Timer */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_RX_INT_WDTIMER_RWT_MASK (0xFFU) -#define ENET_DMA_CH_DMA_CHX_RX_INT_WDTIMER_RWT_SHIFT (0U) -/*! RWT - Receive Interrupt Watchdog Timer Count */ -#define ENET_DMA_CH_DMA_CHX_RX_INT_WDTIMER_RWT(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_RX_INT_WDTIMER_RWT_SHIFT)) & ENET_DMA_CH_DMA_CHX_RX_INT_WDTIMER_RWT_MASK) - -#define ENET_DMA_CH_DMA_CHX_RX_INT_WDTIMER_RWTU_MASK (0x30000U) -#define ENET_DMA_CH_DMA_CHX_RX_INT_WDTIMER_RWTU_SHIFT (16U) -/*! RWTU - Receive Interrupt Watchdog Timer Count Units */ -#define ENET_DMA_CH_DMA_CHX_RX_INT_WDTIMER_RWTU(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_RX_INT_WDTIMER_RWTU_SHIFT)) & ENET_DMA_CH_DMA_CHX_RX_INT_WDTIMER_RWTU_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_RX_INT_WDTIMER */ -#define ENET_DMA_CH_DMA_CHX_RX_INT_WDTIMER_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT - Channel 0 Slot Function Control and Status..Channel 1 Slot Function Control and Status */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_ESC_MASK (0x1U) -#define ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_ESC_SHIFT (0U) -/*! ESC - Enable Slot Comparison - * 0b0..Slot Comparison is disabled - * 0b1..Slot Comparison is enabled - */ -#define ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_ESC(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_ESC_SHIFT)) & ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_ESC_MASK) - -#define ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_ASC_MASK (0x2U) -#define ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_ASC_SHIFT (1U) -/*! ASC - Advance Slot Check - * 0b0..Advance Slot Check is disabled - * 0b1..Advance Slot Check is enabled - */ -#define ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_ASC(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_ASC_SHIFT)) & ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_ASC_MASK) - -#define ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_SIV_MASK (0xFFF0U) -#define ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_SIV_SHIFT (4U) -/*! SIV - Slot Interval Value */ -#define ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_SIV(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_SIV_SHIFT)) & ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_SIV_MASK) - -#define ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_RSN_MASK (0xF0000U) -#define ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_RSN_SHIFT (16U) -/*! RSN - Reference Slot Number */ -#define ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_RSN(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_RSN_SHIFT)) & ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_RSN_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT */ -#define ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_CUR_HST_TXDESC - Channel 0 Current Application Transmit Descriptor..Channel 1 Current Application Transmit Descriptor */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_CUR_HST_TXDESC_CURTDESAPTR_MASK (0xFFFFFFFFU) -#define ENET_DMA_CH_DMA_CHX_CUR_HST_TXDESC_CURTDESAPTR_SHIFT (0U) -/*! CURTDESAPTR - Application Transmit Descriptor Address Pointer */ -#define ENET_DMA_CH_DMA_CHX_CUR_HST_TXDESC_CURTDESAPTR(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_CUR_HST_TXDESC_CURTDESAPTR_SHIFT)) & ENET_DMA_CH_DMA_CHX_CUR_HST_TXDESC_CURTDESAPTR_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_CUR_HST_TXDESC */ -#define ENET_DMA_CH_DMA_CHX_CUR_HST_TXDESC_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_CUR_HST_RXDESC - Channel 0 Current Application Receive Descriptor..Channel 1 Current Application Receive Descriptor */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_CUR_HST_RXDESC_CURRDESAPTR_MASK (0xFFFFFFFFU) -#define ENET_DMA_CH_DMA_CHX_CUR_HST_RXDESC_CURRDESAPTR_SHIFT (0U) -/*! CURRDESAPTR - Application Receive Descriptor Address Pointer */ -#define ENET_DMA_CH_DMA_CHX_CUR_HST_RXDESC_CURRDESAPTR(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_CUR_HST_RXDESC_CURRDESAPTR_SHIFT)) & ENET_DMA_CH_DMA_CHX_CUR_HST_RXDESC_CURRDESAPTR_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_CUR_HST_RXDESC */ -#define ENET_DMA_CH_DMA_CHX_CUR_HST_RXDESC_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_CUR_HST_TXBUF - Channel 0 Current Application Transmit Buffer Address..Channel 1 Current Application Transmit Buffer Address */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_CUR_HST_TXBUF_CURTBUFAPTR_MASK (0xFFFFFFFFU) -#define ENET_DMA_CH_DMA_CHX_CUR_HST_TXBUF_CURTBUFAPTR_SHIFT (0U) -/*! CURTBUFAPTR - Application Transmit Buffer Address Pointer */ -#define ENET_DMA_CH_DMA_CHX_CUR_HST_TXBUF_CURTBUFAPTR(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_CUR_HST_TXBUF_CURTBUFAPTR_SHIFT)) & ENET_DMA_CH_DMA_CHX_CUR_HST_TXBUF_CURTBUFAPTR_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_CUR_HST_TXBUF */ -#define ENET_DMA_CH_DMA_CHX_CUR_HST_TXBUF_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_CUR_HST_RXBUF - Channel 0 Current Application Receive Buffer Address..Channel 1 Current Application Receive Buffer Address */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_CUR_HST_RXBUF_CURRBUFAPTR_MASK (0xFFFFFFFFU) -#define ENET_DMA_CH_DMA_CHX_CUR_HST_RXBUF_CURRBUFAPTR_SHIFT (0U) -/*! CURRBUFAPTR - Application Receive Buffer Address Pointer */ -#define ENET_DMA_CH_DMA_CHX_CUR_HST_RXBUF_CURRBUFAPTR(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_CUR_HST_RXBUF_CURRBUFAPTR_SHIFT)) & ENET_DMA_CH_DMA_CHX_CUR_HST_RXBUF_CURRBUFAPTR_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_CUR_HST_RXBUF */ -#define ENET_DMA_CH_DMA_CHX_CUR_HST_RXBUF_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_STAT - DMA Channel 0 Status..DMA Channel 1 Status */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_STAT_TI_MASK (0x1U) -#define ENET_DMA_CH_DMA_CHX_STAT_TI_SHIFT (0U) -/*! TI - Transmit Interrupt - * 0b1..Transmit Interrupt status detected - * 0b0..Transmit Interrupt status not detected - */ -#define ENET_DMA_CH_DMA_CHX_STAT_TI(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_STAT_TI_SHIFT)) & ENET_DMA_CH_DMA_CHX_STAT_TI_MASK) - -#define ENET_DMA_CH_DMA_CHX_STAT_TPS_MASK (0x2U) -#define ENET_DMA_CH_DMA_CHX_STAT_TPS_SHIFT (1U) -/*! TPS - Transmit Process Stopped - * 0b1..Transmit Process Stopped status detected - * 0b0..Transmit Process Stopped status not detected - */ -#define ENET_DMA_CH_DMA_CHX_STAT_TPS(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_STAT_TPS_SHIFT)) & ENET_DMA_CH_DMA_CHX_STAT_TPS_MASK) - -#define ENET_DMA_CH_DMA_CHX_STAT_TBU_MASK (0x4U) -#define ENET_DMA_CH_DMA_CHX_STAT_TBU_SHIFT (2U) -/*! TBU - Transmit Buffer Unavailable - * 0b1..Transmit Buffer Unavailable status detected - * 0b0..Transmit Buffer Unavailable status not detected - */ -#define ENET_DMA_CH_DMA_CHX_STAT_TBU(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_STAT_TBU_SHIFT)) & ENET_DMA_CH_DMA_CHX_STAT_TBU_MASK) - -#define ENET_DMA_CH_DMA_CHX_STAT_RI_MASK (0x40U) -#define ENET_DMA_CH_DMA_CHX_STAT_RI_SHIFT (6U) -/*! RI - Receive Interrupt - * 0b1..Receive Interrupt status detected - * 0b0..Receive Interrupt status not detected - */ -#define ENET_DMA_CH_DMA_CHX_STAT_RI(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_STAT_RI_SHIFT)) & ENET_DMA_CH_DMA_CHX_STAT_RI_MASK) - -#define ENET_DMA_CH_DMA_CHX_STAT_RBU_MASK (0x80U) -#define ENET_DMA_CH_DMA_CHX_STAT_RBU_SHIFT (7U) -/*! RBU - Receive Buffer Unavailable - * 0b1..Receive Buffer Unavailable status detected - * 0b0..Receive Buffer Unavailable status not detected - */ -#define ENET_DMA_CH_DMA_CHX_STAT_RBU(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_STAT_RBU_SHIFT)) & ENET_DMA_CH_DMA_CHX_STAT_RBU_MASK) - -#define ENET_DMA_CH_DMA_CHX_STAT_RPS_MASK (0x100U) -#define ENET_DMA_CH_DMA_CHX_STAT_RPS_SHIFT (8U) -/*! RPS - Receive Process Stopped - * 0b1..Receive Process Stopped status detected - * 0b0..Receive Process Stopped status not detected - */ -#define ENET_DMA_CH_DMA_CHX_STAT_RPS(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_STAT_RPS_SHIFT)) & ENET_DMA_CH_DMA_CHX_STAT_RPS_MASK) - -#define ENET_DMA_CH_DMA_CHX_STAT_RWT_MASK (0x200U) -#define ENET_DMA_CH_DMA_CHX_STAT_RWT_SHIFT (9U) -/*! RWT - Receive Watchdog Timeout - * 0b1..Receive Watchdog Timeout status detected - * 0b0..Receive Watchdog Timeout status not detected - */ -#define ENET_DMA_CH_DMA_CHX_STAT_RWT(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_STAT_RWT_SHIFT)) & ENET_DMA_CH_DMA_CHX_STAT_RWT_MASK) - -#define ENET_DMA_CH_DMA_CHX_STAT_ETI_MASK (0x400U) -#define ENET_DMA_CH_DMA_CHX_STAT_ETI_SHIFT (10U) -/*! ETI - Early Transmit Interrupt - * 0b1..Early Transmit Interrupt status detected - * 0b0..Early Transmit Interrupt status not detected - */ -#define ENET_DMA_CH_DMA_CHX_STAT_ETI(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_STAT_ETI_SHIFT)) & ENET_DMA_CH_DMA_CHX_STAT_ETI_MASK) - -#define ENET_DMA_CH_DMA_CHX_STAT_ERI_MASK (0x800U) -#define ENET_DMA_CH_DMA_CHX_STAT_ERI_SHIFT (11U) -/*! ERI - Early Receive Interrupt - * 0b1..Early Receive Interrupt status detected - * 0b0..Early Receive Interrupt status not detected - */ -#define ENET_DMA_CH_DMA_CHX_STAT_ERI(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_STAT_ERI_SHIFT)) & ENET_DMA_CH_DMA_CHX_STAT_ERI_MASK) - -#define ENET_DMA_CH_DMA_CHX_STAT_FBE_MASK (0x1000U) -#define ENET_DMA_CH_DMA_CHX_STAT_FBE_SHIFT (12U) -/*! FBE - Fatal Bus Error - * 0b1..Fatal Bus Error status detected - * 0b0..Fatal Bus Error status not detected - */ -#define ENET_DMA_CH_DMA_CHX_STAT_FBE(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_STAT_FBE_SHIFT)) & ENET_DMA_CH_DMA_CHX_STAT_FBE_MASK) - -#define ENET_DMA_CH_DMA_CHX_STAT_CDE_MASK (0x2000U) -#define ENET_DMA_CH_DMA_CHX_STAT_CDE_SHIFT (13U) -/*! CDE - Context Descriptor Error - * 0b1..Context Descriptor Error status detected - * 0b0..Context Descriptor Error status not detected - */ -#define ENET_DMA_CH_DMA_CHX_STAT_CDE(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_STAT_CDE_SHIFT)) & ENET_DMA_CH_DMA_CHX_STAT_CDE_MASK) - -#define ENET_DMA_CH_DMA_CHX_STAT_AIS_MASK (0x4000U) -#define ENET_DMA_CH_DMA_CHX_STAT_AIS_SHIFT (14U) -/*! AIS - Abnormal Interrupt Summary - * 0b1..Abnormal Interrupt Summary status detected - * 0b0..Abnormal Interrupt Summary status not detected - */ -#define ENET_DMA_CH_DMA_CHX_STAT_AIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_STAT_AIS_SHIFT)) & ENET_DMA_CH_DMA_CHX_STAT_AIS_MASK) - -#define ENET_DMA_CH_DMA_CHX_STAT_NIS_MASK (0x8000U) -#define ENET_DMA_CH_DMA_CHX_STAT_NIS_SHIFT (15U) -/*! NIS - Normal Interrupt Summary - * 0b1..Normal Interrupt Summary status detected - * 0b0..Normal Interrupt Summary status not detected - */ -#define ENET_DMA_CH_DMA_CHX_STAT_NIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_STAT_NIS_SHIFT)) & ENET_DMA_CH_DMA_CHX_STAT_NIS_MASK) - -#define ENET_DMA_CH_DMA_CHX_STAT_TEB_MASK (0x70000U) -#define ENET_DMA_CH_DMA_CHX_STAT_TEB_SHIFT (16U) -/*! TEB - Tx DMA Error Bits */ -#define ENET_DMA_CH_DMA_CHX_STAT_TEB(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_STAT_TEB_SHIFT)) & ENET_DMA_CH_DMA_CHX_STAT_TEB_MASK) - -#define ENET_DMA_CH_DMA_CHX_STAT_REB_MASK (0x380000U) -#define ENET_DMA_CH_DMA_CHX_STAT_REB_SHIFT (19U) -/*! REB - Rx DMA Error Bits */ -#define ENET_DMA_CH_DMA_CHX_STAT_REB(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_STAT_REB_SHIFT)) & ENET_DMA_CH_DMA_CHX_STAT_REB_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_STAT */ -#define ENET_DMA_CH_DMA_CHX_STAT_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_MISS_FRAME_CNT - Channel 0 Missed Frame Counter..Channel 1 Missed Frame Counter */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_MISS_FRAME_CNT_MFC_MASK (0x7FFU) -#define ENET_DMA_CH_DMA_CHX_MISS_FRAME_CNT_MFC_SHIFT (0U) -/*! MFC - Dropped Packet Counters */ -#define ENET_DMA_CH_DMA_CHX_MISS_FRAME_CNT_MFC(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_MISS_FRAME_CNT_MFC_SHIFT)) & ENET_DMA_CH_DMA_CHX_MISS_FRAME_CNT_MFC_MASK) - -#define ENET_DMA_CH_DMA_CHX_MISS_FRAME_CNT_MFCO_MASK (0x8000U) -#define ENET_DMA_CH_DMA_CHX_MISS_FRAME_CNT_MFCO_SHIFT (15U) -/*! MFCO - Overflow status of the MFC Counter - * 0b1..Miss Frame Counter overflow occurred - * 0b0..Miss Frame Counter overflow not occurred - */ -#define ENET_DMA_CH_DMA_CHX_MISS_FRAME_CNT_MFCO(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_MISS_FRAME_CNT_MFCO_SHIFT)) & ENET_DMA_CH_DMA_CHX_MISS_FRAME_CNT_MFCO_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_MISS_FRAME_CNT */ -#define ENET_DMA_CH_DMA_CHX_MISS_FRAME_CNT_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_RX_ERI_CNT - Channel 0 Receive ERI Counter..Channel 1 Receive ERI Counter */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_RX_ERI_CNT_ECNT_MASK (0xFFFU) -#define ENET_DMA_CH_DMA_CHX_RX_ERI_CNT_ECNT_SHIFT (0U) -/*! ECNT - ERI Counter */ -#define ENET_DMA_CH_DMA_CHX_RX_ERI_CNT_ECNT(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_RX_ERI_CNT_ECNT_SHIFT)) & ENET_DMA_CH_DMA_CHX_RX_ERI_CNT_ECNT_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_RX_ERI_CNT */ -#define ENET_DMA_CH_DMA_CHX_RX_ERI_CNT_COUNT (2U) - - -/*! - * @} - */ /* end of group ENET_Register_Masks */ - - -/* ENET - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral ENET0 base address */ - #define ENET0_BASE (0x50100000u) - /** Peripheral ENET0 base address */ - #define ENET0_BASE_NS (0x40100000u) - /** Peripheral ENET0 base pointer */ - #define ENET0 ((ENET_Type *)ENET0_BASE) - /** Peripheral ENET0 base pointer */ - #define ENET0_NS ((ENET_Type *)ENET0_BASE_NS) - /** Array initializer of ENET peripheral base addresses */ - #define ENET_BASE_ADDRS { ENET0_BASE } - /** Array initializer of ENET peripheral base pointers */ - #define ENET_BASE_PTRS { ENET0 } - /** Array initializer of ENET peripheral base addresses */ - #define ENET_BASE_ADDRS_NS { ENET0_BASE_NS } - /** Array initializer of ENET peripheral base pointers */ - #define ENET_BASE_PTRS_NS { ENET0_NS } -#else - /** Peripheral ENET0 base address */ - #define ENET0_BASE (0x40100000u) - /** Peripheral ENET0 base pointer */ - #define ENET0 ((ENET_Type *)ENET0_BASE) - /** Array initializer of ENET peripheral base addresses */ - #define ENET_BASE_ADDRS { ENET0_BASE } - /** Array initializer of ENET peripheral base pointers */ - #define ENET_BASE_PTRS { ENET0 } -#endif -/** Interrupt vectors for the ENET peripheral type */ -#define ENET_IRQS { ETHERNET_IRQn } -#define ENET_PMT_IRQS { ETHERNET_PMT_IRQn } -#define ENET_MACLP_IRQS { ETHERNET_MACLP_IRQn } -/* Backward compatibility */ -#define ENET ENET0 - - -/*! - * @} - */ /* end of group ENET_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- ERM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ERM_Peripheral_Access_Layer ERM Peripheral Access Layer - * @{ - */ - -/** ERM - Register Layout Typedef */ -typedef struct { - __IO uint32_t CR0; /**< ERM Configuration Register 0, offset: 0x0 */ - __IO uint32_t CR1; /**< ERM Configuration Register 1, offset: 0x4 */ - uint8_t RESERVED_0[8]; - __IO uint32_t SR0; /**< ERM Status Register 0, offset: 0x10 */ - __IO uint32_t SR1; /**< ERM Status Register 1, offset: 0x14 */ - uint8_t RESERVED_1[232]; - __I uint32_t EAR0; /**< ERM Memory 0 Error Address Register, offset: 0x100 */ - __I uint32_t SYN0; /**< ERM Memory 0 Syndrome Register, offset: 0x104 */ - __IO uint32_t CORR_ERR_CNT0; /**< ERM Memory 0 Correctable Error Count Register, offset: 0x108 */ - uint8_t RESERVED_2[4]; - __I uint32_t EAR1; /**< ERM Memory 1 Error Address Register, offset: 0x110 */ - __I uint32_t SYN1; /**< ERM Memory 1 Syndrome Register, offset: 0x114 */ - __IO uint32_t CORR_ERR_CNT1; /**< ERM Memory 1 Correctable Error Count Register, offset: 0x118 */ - uint8_t RESERVED_3[4]; - __I uint32_t EAR2; /**< ERM Memory 2 Error Address Register, offset: 0x120 */ - __I uint32_t SYN2; /**< ERM Memory 2 Syndrome Register, offset: 0x124 */ - __IO uint32_t CORR_ERR_CNT2; /**< ERM Memory 2 Correctable Error Count Register, offset: 0x128 */ - uint8_t RESERVED_4[4]; - __I uint32_t EAR3; /**< ERM Memory 3 Error Address Register, offset: 0x130 */ - __I uint32_t SYN3; /**< ERM Memory 3 Syndrome Register, offset: 0x134 */ - __IO uint32_t CORR_ERR_CNT3; /**< ERM Memory 3 Correctable Error Count Register, offset: 0x138 */ - uint8_t RESERVED_5[4]; - __I uint32_t EAR4; /**< ERM Memory 4 Error Address Register, offset: 0x140 */ - __I uint32_t SYN4; /**< ERM Memory 4 Syndrome Register, offset: 0x144 */ - __IO uint32_t CORR_ERR_CNT4; /**< ERM Memory 4 Correctable Error Count Register, offset: 0x148 */ - uint8_t RESERVED_6[4]; - __I uint32_t EAR5; /**< ERM Memory 5 Error Address Register, offset: 0x150 */ - __I uint32_t SYN5; /**< ERM Memory 5 Syndrome Register, offset: 0x154 */ - __IO uint32_t CORR_ERR_CNT5; /**< ERM Memory 5 Correctable Error Count Register, offset: 0x158 */ - uint8_t RESERVED_7[4]; - __I uint32_t EAR6; /**< ERM Memory 6 Error Address Register, offset: 0x160 */ - __I uint32_t SYN6; /**< ERM Memory 6 Syndrome Register, offset: 0x164 */ - __IO uint32_t CORR_ERR_CNT6; /**< ERM Memory 6 Correctable Error Count Register, offset: 0x168 */ - uint8_t RESERVED_8[12]; - __IO uint32_t CORR_ERR_CNT7; /**< ERM Memory 7 Correctable Error Count Register, offset: 0x178 */ - uint8_t RESERVED_9[8]; - __I uint32_t SYN8; /**< ERM Memory 8 Syndrome Register, offset: 0x184 */ - __IO uint32_t CORR_ERR_CNT8; /**< ERM Memory 8 Correctable Error Count Register, offset: 0x188 */ - uint8_t RESERVED_10[12]; - __IO uint32_t CORR_ERR_CNT9; /**< ERM Memory 9 Correctable Error Count Register, offset: 0x198 */ -} ERM_Type; - -/* ---------------------------------------------------------------------------- - -- ERM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ERM_Register_Masks ERM Register Masks - * @{ - */ - -/*! @name CR0 - ERM Configuration Register 0 */ -/*! @{ */ - -#define ERM_CR0_ENCIE7_MASK (0x4U) -#define ERM_CR0_ENCIE7_SHIFT (2U) -/*! ENCIE7 - ENCIE7 - * 0b0..Interrupt notification of Memory 7 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 7 non-correctable error events is enabled. - */ -#define ERM_CR0_ENCIE7(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ENCIE7_SHIFT)) & ERM_CR0_ENCIE7_MASK) - -#define ERM_CR0_ESCIE7_MASK (0x8U) -#define ERM_CR0_ESCIE7_SHIFT (3U) -/*! ESCIE7 - ESCIE7 - * 0b0..Interrupt notification of Memory 7 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 7 single-bit correction events is enabled. - */ -#define ERM_CR0_ESCIE7(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ESCIE7_SHIFT)) & ERM_CR0_ESCIE7_MASK) - -#define ERM_CR0_ENCIE6_MASK (0x40U) -#define ERM_CR0_ENCIE6_SHIFT (6U) -/*! ENCIE6 - ENCIE6 - * 0b0..Interrupt notification of Memory 6 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 6 non-correctable error events is enabled. - */ -#define ERM_CR0_ENCIE6(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ENCIE6_SHIFT)) & ERM_CR0_ENCIE6_MASK) - -#define ERM_CR0_ESCIE6_MASK (0x80U) -#define ERM_CR0_ESCIE6_SHIFT (7U) -/*! ESCIE6 - ESCIE6 - * 0b0..Interrupt notification of Memory 6 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 6 single-bit correction events is enabled. - */ -#define ERM_CR0_ESCIE6(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ESCIE6_SHIFT)) & ERM_CR0_ESCIE6_MASK) - -#define ERM_CR0_ENCIE5_MASK (0x400U) -#define ERM_CR0_ENCIE5_SHIFT (10U) -/*! ENCIE5 - ENCIE5 - * 0b0..Interrupt notification of Memory 5 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 5 non-correctable error events is enabled. - */ -#define ERM_CR0_ENCIE5(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ENCIE5_SHIFT)) & ERM_CR0_ENCIE5_MASK) - -#define ERM_CR0_ESCIE5_MASK (0x800U) -#define ERM_CR0_ESCIE5_SHIFT (11U) -/*! ESCIE5 - ESCIE5 - * 0b0..Interrupt notification of Memory 5 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 5 single-bit correction events is enabled. - */ -#define ERM_CR0_ESCIE5(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ESCIE5_SHIFT)) & ERM_CR0_ESCIE5_MASK) - -#define ERM_CR0_ENCIE4_MASK (0x4000U) -#define ERM_CR0_ENCIE4_SHIFT (14U) -/*! ENCIE4 - ENCIE4 - * 0b0..Interrupt notification of Memory 4 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 4 non-correctable error events is enabled. - */ -#define ERM_CR0_ENCIE4(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ENCIE4_SHIFT)) & ERM_CR0_ENCIE4_MASK) - -#define ERM_CR0_ESCIE4_MASK (0x8000U) -#define ERM_CR0_ESCIE4_SHIFT (15U) -/*! ESCIE4 - ESCIE4 - * 0b0..Interrupt notification of Memory 4 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 4 single-bit correction events is enabled. - */ -#define ERM_CR0_ESCIE4(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ESCIE4_SHIFT)) & ERM_CR0_ESCIE4_MASK) - -#define ERM_CR0_ENCIE3_MASK (0x40000U) -#define ERM_CR0_ENCIE3_SHIFT (18U) -/*! ENCIE3 - ENCIE3 - * 0b0..Interrupt notification of Memory 3 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 3 non-correctable error events is enabled. - */ -#define ERM_CR0_ENCIE3(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ENCIE3_SHIFT)) & ERM_CR0_ENCIE3_MASK) - -#define ERM_CR0_ESCIE3_MASK (0x80000U) -#define ERM_CR0_ESCIE3_SHIFT (19U) -/*! ESCIE3 - ESCIE3 - * 0b0..Interrupt notification of Memory 3 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 3 single-bit correction events is enabled. - */ -#define ERM_CR0_ESCIE3(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ESCIE3_SHIFT)) & ERM_CR0_ESCIE3_MASK) - -#define ERM_CR0_ENCIE2_MASK (0x400000U) -#define ERM_CR0_ENCIE2_SHIFT (22U) -/*! ENCIE2 - ENCIE2 - * 0b0..Interrupt notification of Memory 2 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 2 non-correctable error events is enabled. - */ -#define ERM_CR0_ENCIE2(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ENCIE2_SHIFT)) & ERM_CR0_ENCIE2_MASK) - -#define ERM_CR0_ESCIE2_MASK (0x800000U) -#define ERM_CR0_ESCIE2_SHIFT (23U) -/*! ESCIE2 - ESCIE2 - * 0b0..Interrupt notification of Memory 2 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 2 single-bit correction events is enabled. - */ -#define ERM_CR0_ESCIE2(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ESCIE2_SHIFT)) & ERM_CR0_ESCIE2_MASK) - -#define ERM_CR0_ENCIE1_MASK (0x4000000U) -#define ERM_CR0_ENCIE1_SHIFT (26U) -/*! ENCIE1 - ENCIE1 - * 0b0..Interrupt notification of Memory 1 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 1 non-correctable error events is enabled. - */ -#define ERM_CR0_ENCIE1(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ENCIE1_SHIFT)) & ERM_CR0_ENCIE1_MASK) - -#define ERM_CR0_ESCIE1_MASK (0x8000000U) -#define ERM_CR0_ESCIE1_SHIFT (27U) -/*! ESCIE1 - ESCIE1 - * 0b0..Interrupt notification of Memory 1 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 1 single-bit correction events is enabled. - */ -#define ERM_CR0_ESCIE1(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ESCIE1_SHIFT)) & ERM_CR0_ESCIE1_MASK) - -#define ERM_CR0_ENCIE0_MASK (0x40000000U) -#define ERM_CR0_ENCIE0_SHIFT (30U) -/*! ENCIE0 - ENCIE0 - * 0b0..Interrupt notification of Memory 0 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 0 non-correctable error events is enabled. - */ -#define ERM_CR0_ENCIE0(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ENCIE0_SHIFT)) & ERM_CR0_ENCIE0_MASK) - -#define ERM_CR0_ESCIE0_MASK (0x80000000U) -#define ERM_CR0_ESCIE0_SHIFT (31U) -/*! ESCIE0 - ESCIE0 - * 0b0..Interrupt notification of Memory 0 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 0 single-bit correction events is enabled. - */ -#define ERM_CR0_ESCIE0(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ESCIE0_SHIFT)) & ERM_CR0_ESCIE0_MASK) -/*! @} */ - -/*! @name CR1 - ERM Configuration Register 1 */ -/*! @{ */ - -#define ERM_CR1_ENCIE9_MASK (0x4000000U) -#define ERM_CR1_ENCIE9_SHIFT (26U) -/*! ENCIE9 - ENCIE9 - * 0b0..Interrupt notification of Memory 9 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 9 non-correctable error events is enabled. - */ -#define ERM_CR1_ENCIE9(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR1_ENCIE9_SHIFT)) & ERM_CR1_ENCIE9_MASK) - -#define ERM_CR1_ESCIE9_MASK (0x8000000U) -#define ERM_CR1_ESCIE9_SHIFT (27U) -/*! ESCIE9 - ESCIE9 - * 0b0..Interrupt notification of Memory 9 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 9 single-bit correction events is enabled. - */ -#define ERM_CR1_ESCIE9(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR1_ESCIE9_SHIFT)) & ERM_CR1_ESCIE9_MASK) - -#define ERM_CR1_ENCIE8_MASK (0x40000000U) -#define ERM_CR1_ENCIE8_SHIFT (30U) -/*! ENCIE8 - ENCIE8 - * 0b0..Interrupt notification of Memory 8 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 8 non-correctable error events is enabled. - */ -#define ERM_CR1_ENCIE8(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR1_ENCIE8_SHIFT)) & ERM_CR1_ENCIE8_MASK) - -#define ERM_CR1_ESCIE8_MASK (0x80000000U) -#define ERM_CR1_ESCIE8_SHIFT (31U) -/*! ESCIE8 - ESCIE8 - * 0b0..Interrupt notification of Memory 8 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 8 single-bit correction events is enabled. - */ -#define ERM_CR1_ESCIE8(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR1_ESCIE8_SHIFT)) & ERM_CR1_ESCIE8_MASK) -/*! @} */ - -/*! @name SR0 - ERM Status Register 0 */ -/*! @{ */ - -#define ERM_SR0_NCE7_MASK (0x4U) -#define ERM_SR0_NCE7_SHIFT (2U) -/*! NCE7 - NCE7 - * 0b0..No non-correctable error event on Memory 7 detected. - * 0b1..Non-correctable error event on Memory 7 detected. - */ -#define ERM_SR0_NCE7(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_NCE7_SHIFT)) & ERM_SR0_NCE7_MASK) - -#define ERM_SR0_SBC7_MASK (0x8U) -#define ERM_SR0_SBC7_SHIFT (3U) -/*! SBC7 - SBC7 - * 0b0..No single-bit correction event on Memory 7 detected. - * 0b1..Single-bit correction event on Memory 7 detected. - */ -#define ERM_SR0_SBC7(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_SBC7_SHIFT)) & ERM_SR0_SBC7_MASK) - -#define ERM_SR0_NCE6_MASK (0x40U) -#define ERM_SR0_NCE6_SHIFT (6U) -/*! NCE6 - NCE6 - * 0b0..No non-correctable error event on Memory 6 detected. - * 0b1..Non-correctable error event on Memory 6 detected. - */ -#define ERM_SR0_NCE6(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_NCE6_SHIFT)) & ERM_SR0_NCE6_MASK) - -#define ERM_SR0_SBC6_MASK (0x80U) -#define ERM_SR0_SBC6_SHIFT (7U) -/*! SBC6 - SBC6 - * 0b0..No single-bit correction event on Memory 6 detected. - * 0b1..Single-bit correction event on Memory 6 detected. - */ -#define ERM_SR0_SBC6(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_SBC6_SHIFT)) & ERM_SR0_SBC6_MASK) - -#define ERM_SR0_NCE5_MASK (0x400U) -#define ERM_SR0_NCE5_SHIFT (10U) -/*! NCE5 - NCE5 - * 0b0..No non-correctable error event on Memory 5 detected. - * 0b1..Non-correctable error event on Memory 5 detected. - */ -#define ERM_SR0_NCE5(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_NCE5_SHIFT)) & ERM_SR0_NCE5_MASK) - -#define ERM_SR0_SBC5_MASK (0x800U) -#define ERM_SR0_SBC5_SHIFT (11U) -/*! SBC5 - SBC5 - * 0b0..No single-bit correction event on Memory 5 detected. - * 0b1..Single-bit correction event on Memory 5 detected. - */ -#define ERM_SR0_SBC5(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_SBC5_SHIFT)) & ERM_SR0_SBC5_MASK) - -#define ERM_SR0_NCE4_MASK (0x4000U) -#define ERM_SR0_NCE4_SHIFT (14U) -/*! NCE4 - NCE4 - * 0b0..No non-correctable error event on Memory 4 detected. - * 0b1..Non-correctable error event on Memory 4 detected. - */ -#define ERM_SR0_NCE4(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_NCE4_SHIFT)) & ERM_SR0_NCE4_MASK) - -#define ERM_SR0_SBC4_MASK (0x8000U) -#define ERM_SR0_SBC4_SHIFT (15U) -/*! SBC4 - SBC4 - * 0b0..No single-bit correction event on Memory 4 detected. - * 0b1..Single-bit correction event on Memory 4 detected. - */ -#define ERM_SR0_SBC4(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_SBC4_SHIFT)) & ERM_SR0_SBC4_MASK) - -#define ERM_SR0_NCE3_MASK (0x40000U) -#define ERM_SR0_NCE3_SHIFT (18U) -/*! NCE3 - NCE3 - * 0b0..No non-correctable error event on Memory 3 detected. - * 0b1..Non-correctable error event on Memory 3 detected. - */ -#define ERM_SR0_NCE3(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_NCE3_SHIFT)) & ERM_SR0_NCE3_MASK) - -#define ERM_SR0_SBC3_MASK (0x80000U) -#define ERM_SR0_SBC3_SHIFT (19U) -/*! SBC3 - SBC3 - * 0b0..No single-bit correction event on Memory 3 detected. - * 0b1..Single-bit correction event on Memory 3 detected. - */ -#define ERM_SR0_SBC3(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_SBC3_SHIFT)) & ERM_SR0_SBC3_MASK) - -#define ERM_SR0_NCE2_MASK (0x400000U) -#define ERM_SR0_NCE2_SHIFT (22U) -/*! NCE2 - NCE2 - * 0b0..No non-correctable error event on Memory 2 detected. - * 0b1..Non-correctable error event on Memory 2 detected. - */ -#define ERM_SR0_NCE2(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_NCE2_SHIFT)) & ERM_SR0_NCE2_MASK) - -#define ERM_SR0_SBC2_MASK (0x800000U) -#define ERM_SR0_SBC2_SHIFT (23U) -/*! SBC2 - SBC2 - * 0b0..No single-bit correction event on Memory 2 detected. - * 0b1..Single-bit correction event on Memory 2 detected. - */ -#define ERM_SR0_SBC2(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_SBC2_SHIFT)) & ERM_SR0_SBC2_MASK) - -#define ERM_SR0_NCE1_MASK (0x4000000U) -#define ERM_SR0_NCE1_SHIFT (26U) -/*! NCE1 - NCE1 - * 0b0..No non-correctable error event on Memory 1 detected. - * 0b1..Non-correctable error event on Memory 1 detected. - */ -#define ERM_SR0_NCE1(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_NCE1_SHIFT)) & ERM_SR0_NCE1_MASK) - -#define ERM_SR0_SBC1_MASK (0x8000000U) -#define ERM_SR0_SBC1_SHIFT (27U) -/*! SBC1 - SBC1 - * 0b0..No single-bit correction event on Memory 1 detected. - * 0b1..Single-bit correction event on Memory 1 detected. - */ -#define ERM_SR0_SBC1(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_SBC1_SHIFT)) & ERM_SR0_SBC1_MASK) - -#define ERM_SR0_NCE0_MASK (0x40000000U) -#define ERM_SR0_NCE0_SHIFT (30U) -/*! NCE0 - NCE0 - * 0b0..No non-correctable error event on Memory 0 detected. - * 0b1..Non-correctable error event on Memory 0 detected. - */ -#define ERM_SR0_NCE0(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_NCE0_SHIFT)) & ERM_SR0_NCE0_MASK) - -#define ERM_SR0_SBC0_MASK (0x80000000U) -#define ERM_SR0_SBC0_SHIFT (31U) -/*! SBC0 - SBC0 - * 0b0..No single-bit correction event on Memory 0 detected. - * 0b1..Single-bit correction event on Memory 0 detected. - */ -#define ERM_SR0_SBC0(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_SBC0_SHIFT)) & ERM_SR0_SBC0_MASK) -/*! @} */ - -/*! @name SR1 - ERM Status Register 1 */ -/*! @{ */ - -#define ERM_SR1_NCE9_MASK (0x4000000U) -#define ERM_SR1_NCE9_SHIFT (26U) -/*! NCE9 - NCE9 - * 0b0..No non-correctable error event on Memory 9 detected. - * 0b1..Non-correctable error event on Memory 9 detected. - */ -#define ERM_SR1_NCE9(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR1_NCE9_SHIFT)) & ERM_SR1_NCE9_MASK) - -#define ERM_SR1_SBC9_MASK (0x8000000U) -#define ERM_SR1_SBC9_SHIFT (27U) -/*! SBC9 - SBC9 - * 0b0..No single-bit correction event on Memory 9 detected. - * 0b1..Single-bit correction event on Memory 9 detected. - */ -#define ERM_SR1_SBC9(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR1_SBC9_SHIFT)) & ERM_SR1_SBC9_MASK) - -#define ERM_SR1_NCE8_MASK (0x40000000U) -#define ERM_SR1_NCE8_SHIFT (30U) -/*! NCE8 - NCE8 - * 0b0..No non-correctable error event on Memory 8 detected. - * 0b1..Non-correctable error event on Memory 8 detected. - */ -#define ERM_SR1_NCE8(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR1_NCE8_SHIFT)) & ERM_SR1_NCE8_MASK) - -#define ERM_SR1_SBC8_MASK (0x80000000U) -#define ERM_SR1_SBC8_SHIFT (31U) -/*! SBC8 - SBC8 - * 0b0..No single-bit correction event on Memory 8 detected. - * 0b1..Single-bit correction event on Memory 8 detected. - */ -#define ERM_SR1_SBC8(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR1_SBC8_SHIFT)) & ERM_SR1_SBC8_MASK) -/*! @} */ - -/*! @name EAR0 - ERM Memory 0 Error Address Register */ -/*! @{ */ - -#define ERM_EAR0_EAR_MASK (0xFFFFFFFFU) -#define ERM_EAR0_EAR_SHIFT (0U) -/*! EAR - EAR */ -#define ERM_EAR0_EAR(x) (((uint32_t)(((uint32_t)(x)) << ERM_EAR0_EAR_SHIFT)) & ERM_EAR0_EAR_MASK) -/*! @} */ - -/*! @name SYN0 - ERM Memory 0 Syndrome Register */ -/*! @{ */ - -#define ERM_SYN0_SYNDROME_MASK (0xFF000000U) -#define ERM_SYN0_SYNDROME_SHIFT (24U) -/*! SYNDROME - SYNDROME */ -#define ERM_SYN0_SYNDROME(x) (((uint32_t)(((uint32_t)(x)) << ERM_SYN0_SYNDROME_SHIFT)) & ERM_SYN0_SYNDROME_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT0 - ERM Memory 0 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT0_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT0_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT0_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT0_COUNT_SHIFT)) & ERM_CORR_ERR_CNT0_COUNT_MASK) -/*! @} */ - -/*! @name EAR1 - ERM Memory 1 Error Address Register */ -/*! @{ */ - -#define ERM_EAR1_EAR_MASK (0xFFFFFFFFU) -#define ERM_EAR1_EAR_SHIFT (0U) -/*! EAR - EAR */ -#define ERM_EAR1_EAR(x) (((uint32_t)(((uint32_t)(x)) << ERM_EAR1_EAR_SHIFT)) & ERM_EAR1_EAR_MASK) -/*! @} */ - -/*! @name SYN1 - ERM Memory 1 Syndrome Register */ -/*! @{ */ - -#define ERM_SYN1_SYNDROME_MASK (0xFF000000U) -#define ERM_SYN1_SYNDROME_SHIFT (24U) -/*! SYNDROME - SYNDROME */ -#define ERM_SYN1_SYNDROME(x) (((uint32_t)(((uint32_t)(x)) << ERM_SYN1_SYNDROME_SHIFT)) & ERM_SYN1_SYNDROME_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT1 - ERM Memory 1 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT1_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT1_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT1_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT1_COUNT_SHIFT)) & ERM_CORR_ERR_CNT1_COUNT_MASK) -/*! @} */ - -/*! @name EAR2 - ERM Memory 2 Error Address Register */ -/*! @{ */ - -#define ERM_EAR2_EAR_MASK (0xFFFFFFFFU) -#define ERM_EAR2_EAR_SHIFT (0U) -/*! EAR - EAR */ -#define ERM_EAR2_EAR(x) (((uint32_t)(((uint32_t)(x)) << ERM_EAR2_EAR_SHIFT)) & ERM_EAR2_EAR_MASK) -/*! @} */ - -/*! @name SYN2 - ERM Memory 2 Syndrome Register */ -/*! @{ */ - -#define ERM_SYN2_SYNDROME_MASK (0xFF000000U) -#define ERM_SYN2_SYNDROME_SHIFT (24U) -/*! SYNDROME - SYNDROME */ -#define ERM_SYN2_SYNDROME(x) (((uint32_t)(((uint32_t)(x)) << ERM_SYN2_SYNDROME_SHIFT)) & ERM_SYN2_SYNDROME_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT2 - ERM Memory 2 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT2_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT2_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT2_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT2_COUNT_SHIFT)) & ERM_CORR_ERR_CNT2_COUNT_MASK) -/*! @} */ - -/*! @name EAR3 - ERM Memory 3 Error Address Register */ -/*! @{ */ - -#define ERM_EAR3_EAR_MASK (0xFFFFFFFFU) -#define ERM_EAR3_EAR_SHIFT (0U) -/*! EAR - EAR */ -#define ERM_EAR3_EAR(x) (((uint32_t)(((uint32_t)(x)) << ERM_EAR3_EAR_SHIFT)) & ERM_EAR3_EAR_MASK) -/*! @} */ - -/*! @name SYN3 - ERM Memory 3 Syndrome Register */ -/*! @{ */ - -#define ERM_SYN3_SYNDROME_MASK (0xFF000000U) -#define ERM_SYN3_SYNDROME_SHIFT (24U) -/*! SYNDROME - SYNDROME */ -#define ERM_SYN3_SYNDROME(x) (((uint32_t)(((uint32_t)(x)) << ERM_SYN3_SYNDROME_SHIFT)) & ERM_SYN3_SYNDROME_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT3 - ERM Memory 3 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT3_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT3_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT3_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT3_COUNT_SHIFT)) & ERM_CORR_ERR_CNT3_COUNT_MASK) -/*! @} */ - -/*! @name EAR4 - ERM Memory 4 Error Address Register */ -/*! @{ */ - -#define ERM_EAR4_EAR_MASK (0xFFFFFFFFU) -#define ERM_EAR4_EAR_SHIFT (0U) -/*! EAR - EAR */ -#define ERM_EAR4_EAR(x) (((uint32_t)(((uint32_t)(x)) << ERM_EAR4_EAR_SHIFT)) & ERM_EAR4_EAR_MASK) -/*! @} */ - -/*! @name SYN4 - ERM Memory 4 Syndrome Register */ -/*! @{ */ - -#define ERM_SYN4_SYNDROME_MASK (0xFF000000U) -#define ERM_SYN4_SYNDROME_SHIFT (24U) -/*! SYNDROME - SYNDROME */ -#define ERM_SYN4_SYNDROME(x) (((uint32_t)(((uint32_t)(x)) << ERM_SYN4_SYNDROME_SHIFT)) & ERM_SYN4_SYNDROME_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT4 - ERM Memory 4 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT4_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT4_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT4_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT4_COUNT_SHIFT)) & ERM_CORR_ERR_CNT4_COUNT_MASK) -/*! @} */ - -/*! @name EAR5 - ERM Memory 5 Error Address Register */ -/*! @{ */ - -#define ERM_EAR5_EAR_MASK (0xFFFFFFFFU) -#define ERM_EAR5_EAR_SHIFT (0U) -/*! EAR - EAR */ -#define ERM_EAR5_EAR(x) (((uint32_t)(((uint32_t)(x)) << ERM_EAR5_EAR_SHIFT)) & ERM_EAR5_EAR_MASK) -/*! @} */ - -/*! @name SYN5 - ERM Memory 5 Syndrome Register */ -/*! @{ */ - -#define ERM_SYN5_SYNDROME_MASK (0xFF000000U) -#define ERM_SYN5_SYNDROME_SHIFT (24U) -/*! SYNDROME - SYNDROME */ -#define ERM_SYN5_SYNDROME(x) (((uint32_t)(((uint32_t)(x)) << ERM_SYN5_SYNDROME_SHIFT)) & ERM_SYN5_SYNDROME_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT5 - ERM Memory 5 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT5_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT5_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT5_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT5_COUNT_SHIFT)) & ERM_CORR_ERR_CNT5_COUNT_MASK) -/*! @} */ - -/*! @name EAR6 - ERM Memory 6 Error Address Register */ -/*! @{ */ - -#define ERM_EAR6_EAR_MASK (0xFFFFFFFFU) -#define ERM_EAR6_EAR_SHIFT (0U) -/*! EAR - EAR */ -#define ERM_EAR6_EAR(x) (((uint32_t)(((uint32_t)(x)) << ERM_EAR6_EAR_SHIFT)) & ERM_EAR6_EAR_MASK) -/*! @} */ - -/*! @name SYN6 - ERM Memory 6 Syndrome Register */ -/*! @{ */ - -#define ERM_SYN6_SYNDROME_MASK (0xFF000000U) -#define ERM_SYN6_SYNDROME_SHIFT (24U) -/*! SYNDROME - SYNDROME */ -#define ERM_SYN6_SYNDROME(x) (((uint32_t)(((uint32_t)(x)) << ERM_SYN6_SYNDROME_SHIFT)) & ERM_SYN6_SYNDROME_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT6 - ERM Memory 6 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT6_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT6_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT6_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT6_COUNT_SHIFT)) & ERM_CORR_ERR_CNT6_COUNT_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT7 - ERM Memory 7 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT7_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT7_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT7_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT7_COUNT_SHIFT)) & ERM_CORR_ERR_CNT7_COUNT_MASK) -/*! @} */ - -/*! @name SYN8 - ERM Memory 8 Syndrome Register */ -/*! @{ */ - -#define ERM_SYN8_SYNDROME_MASK (0xFF000000U) -#define ERM_SYN8_SYNDROME_SHIFT (24U) -/*! SYNDROME - SYNDROME */ -#define ERM_SYN8_SYNDROME(x) (((uint32_t)(((uint32_t)(x)) << ERM_SYN8_SYNDROME_SHIFT)) & ERM_SYN8_SYNDROME_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT8 - ERM Memory 8 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT8_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT8_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT8_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT8_COUNT_SHIFT)) & ERM_CORR_ERR_CNT8_COUNT_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT9 - ERM Memory 9 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT9_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT9_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT9_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT9_COUNT_SHIFT)) & ERM_CORR_ERR_CNT9_COUNT_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group ERM_Register_Masks */ - - -/* ERM - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral ERM0 base address */ - #define ERM0_BASE (0x5005C000u) - /** Peripheral ERM0 base address */ - #define ERM0_BASE_NS (0x4005C000u) - /** Peripheral ERM0 base pointer */ - #define ERM0 ((ERM_Type *)ERM0_BASE) - /** Peripheral ERM0 base pointer */ - #define ERM0_NS ((ERM_Type *)ERM0_BASE_NS) - /** Array initializer of ERM peripheral base addresses */ - #define ERM_BASE_ADDRS { ERM0_BASE } - /** Array initializer of ERM peripheral base pointers */ - #define ERM_BASE_PTRS { ERM0 } - /** Array initializer of ERM peripheral base addresses */ - #define ERM_BASE_ADDRS_NS { ERM0_BASE_NS } - /** Array initializer of ERM peripheral base pointers */ - #define ERM_BASE_PTRS_NS { ERM0_NS } -#else - /** Peripheral ERM0 base address */ - #define ERM0_BASE (0x4005C000u) - /** Peripheral ERM0 base pointer */ - #define ERM0 ((ERM_Type *)ERM0_BASE) - /** Array initializer of ERM peripheral base addresses */ - #define ERM_BASE_ADDRS { ERM0_BASE } - /** Array initializer of ERM peripheral base pointers */ - #define ERM_BASE_PTRS { ERM0 } -#endif - -/*! - * @} - */ /* end of group ERM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- EVTG Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup EVTG_Peripheral_Access_Layer EVTG Peripheral Access Layer - * @{ - */ - -/** EVTG - Register Layout Typedef */ -typedef struct { - struct { /* offset: 0x0, array step: 0x10 */ - __IO uint16_t EVTG_AOI0_BFT01; /**< AOI0 Boolean Function Term 0 and 1 Configuration, array offset: 0x0, array step: 0x10 */ - __IO uint16_t EVTG_AOI0_BFT23; /**< AOI0 Boolean Function Term 2 and 3 Configuration, array offset: 0x2, array step: 0x10 */ - __IO uint16_t EVTG_AOI1_BFT01; /**< AOI1 Boolean Function Term 0 and 1 Configuration, array offset: 0x4, array step: 0x10 */ - __IO uint16_t EVTG_AOI1_BFT23; /**< AOI1 Boolean Function Term 2 and 3 Configuration, array offset: 0x6, array step: 0x10 */ - uint8_t RESERVED_0[2]; - __IO uint16_t EVTG_CTRL; /**< Control and Status, array offset: 0xA, array step: 0x10 */ - __IO uint16_t EVTG_AOI0_FILT; /**< AOI0 Output Filter, array offset: 0xC, array step: 0x10 */ - __IO uint16_t EVTG_AOI1_FILT; /**< AOI1 Output Filter, array offset: 0xE, array step: 0x10 */ - } EVTG_INST[4]; -} EVTG_Type; - -/* ---------------------------------------------------------------------------- - -- EVTG Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup EVTG_Register_Masks EVTG Register Masks - * @{ - */ - -/*! @name EVTG_INST_EVTG_AOI0_BFT01 - AOI0 Boolean Function Term 0 and 1 Configuration */ -/*! @{ */ - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_DC_MASK (0x3U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_DC_SHIFT (0U) -/*! PT1_DC - Product Term 1, D Input Configuration - * 0b00..Force the D input in this product term to a logical zero - * 0b01..Pass the D input in this product term - * 0b10..Complement the D input in this product term - * 0b11..Force the D input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_DC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_DC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_DC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_CC_MASK (0xCU) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_CC_SHIFT (2U) -/*! PT1_CC - Product Term 1, C Input Configuration - * 0b00..Force the C input in this product term to a logical zero - * 0b01..Pass the C input in this product term - * 0b10..Complement the C input in this product term - * 0b11..Force the C input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_CC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_CC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_CC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_BC_MASK (0x30U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_BC_SHIFT (4U) -/*! PT1_BC - Product Term 1, B Input Configuration - * 0b00..Force the B input in this product term to a logical zero - * 0b01..Pass the B input in this product term - * 0b10..Complement the B input in this product term - * 0b11..Force the B input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_BC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_BC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_BC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_AC_MASK (0xC0U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_AC_SHIFT (6U) -/*! PT1_AC - Product Term 1, A Input Configuration - * 0b00..Force the A input in this product term to a logical zero - * 0b01..Pass the A input in this product term - * 0b10..Complement the A input in this product term - * 0b11..Force the A input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_AC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_AC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_AC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_DC_MASK (0x300U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_DC_SHIFT (8U) -/*! PT0_DC - Product Term 0, D Input Configuration - * 0b00..Force the D input in this product term to a logical zero - * 0b01..Pass the D input in this product term - * 0b10..Complement the D input in this product term - * 0b11..Force the D input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_DC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_DC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_DC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_CC_MASK (0xC00U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_CC_SHIFT (10U) -/*! PT0_CC - Product Term 0, C Input Configuration - * 0b00..Force the C input in this product term to a logical zero - * 0b01..Pass the C input in this product term - * 0b10..Complement the C input in this product term - * 0b11..Force the C input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_CC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_CC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_CC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_BC_MASK (0x3000U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_BC_SHIFT (12U) -/*! PT0_BC - Product Term 0, B Input Configuration - * 0b00..Force the B input in this product term to a logical zero - * 0b01..Pass the B input in this product term - * 0b10..Complement the B input in this product term - * 0b11..Force the B input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_BC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_BC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_BC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_AC_MASK (0xC000U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_AC_SHIFT (14U) -/*! PT0_AC - Product Term 0, A Input Configuration - * 0b00..Force the A input in this product term to a logical zero - * 0b01..Pass the A input in this product term - * 0b10..Complement the A input in this product term - * 0b11..Force the A input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_AC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_AC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_AC_MASK) -/*! @} */ - -/* The count of EVTG_EVTG_INST_EVTG_AOI0_BFT01 */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_COUNT (4U) - -/*! @name EVTG_INST_EVTG_AOI0_BFT23 - AOI0 Boolean Function Term 2 and 3 Configuration */ -/*! @{ */ - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_DC_MASK (0x3U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_DC_SHIFT (0U) -/*! PT3_DC - Product Term 3, D Input Configuration - * 0b00..Force the D input in this product term to a logical zero - * 0b01..Pass the D input in this product term - * 0b10..Complement the D input in this product term - * 0b11..Force the D input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_DC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_DC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_DC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_CC_MASK (0xCU) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_CC_SHIFT (2U) -/*! PT3_CC - Product Term 3, C Input Configuration - * 0b00..Force the C input in this product term to a logical zero - * 0b01..Pass the C input in this product term - * 0b10..Complement the C input in this product term - * 0b11..Force the C input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_CC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_CC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_CC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_BC_MASK (0x30U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_BC_SHIFT (4U) -/*! PT3_BC - Product Term 3, B Input Configuration - * 0b00..Force the B input in this product term to a logical zero - * 0b01..Pass the B input in this product term - * 0b10..Complement the B input in this product term - * 0b11..Force the B input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_BC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_BC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_BC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_AC_MASK (0xC0U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_AC_SHIFT (6U) -/*! PT3_AC - Product Term 3, A Input Configuration - * 0b00..Force the A input in this product term to a logical zero - * 0b01..Pass the A input in this product term - * 0b10..Complement the A input in this product term - * 0b11..Force the A input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_AC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_AC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_AC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_DC_MASK (0x300U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_DC_SHIFT (8U) -/*! PT2_DC - Product Term 2, D Input Configuration - * 0b00..Force the D input in this product term to a logical zero - * 0b01..Pass the D input in this product term - * 0b10..Complement the D input in this product term - * 0b11..Force the D input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_DC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_DC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_DC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_CC_MASK (0xC00U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_CC_SHIFT (10U) -/*! PT2_CC - Product Term 2, C Input Configuration - * 0b00..Force the C input in this product term to a logical zero - * 0b01..Pass the C input in this product term - * 0b10..Complement the C input in this product term - * 0b11..Force the C input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_CC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_CC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_CC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_BC_MASK (0x3000U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_BC_SHIFT (12U) -/*! PT2_BC - Product Term 2, B Input Configuration - * 0b00..Force the B input in this product term to a logical zero - * 0b01..Pass the B input in this product term - * 0b10..Complement the B input in this product term - * 0b11..Force the B input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_BC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_BC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_BC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_AC_MASK (0xC000U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_AC_SHIFT (14U) -/*! PT2_AC - Product Term 2, A Input Configuration - * 0b00..Force the A input in this product term to a logical zero - * 0b01..Pass the A input in this product term - * 0b10..Complement the A input in this product term - * 0b11..Force the A input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_AC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_AC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_AC_MASK) -/*! @} */ - -/* The count of EVTG_EVTG_INST_EVTG_AOI0_BFT23 */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_COUNT (4U) - -/*! @name EVTG_INST_EVTG_AOI1_BFT01 - AOI1 Boolean Function Term 0 and 1 Configuration */ -/*! @{ */ - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_DC_MASK (0x3U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_DC_SHIFT (0U) -/*! PT1_DC - Product Term 1, D Input Configuration - * 0b00..Force the D input in this product term to a logical zero - * 0b01..Pass the D input in this product term - * 0b10..Complement the D input in this product term - * 0b11..Force the D input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_DC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_DC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_DC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_CC_MASK (0xCU) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_CC_SHIFT (2U) -/*! PT1_CC - Product Term 1, C Input Configuration - * 0b00..Force the C input in this product term to a logical zero - * 0b01..Pass the C input in this product term - * 0b10..Complement the C input in this product term - * 0b11..Force the C input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_CC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_CC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_CC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_BC_MASK (0x30U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_BC_SHIFT (4U) -/*! PT1_BC - Product Term 1, B Input Configuration - * 0b00..Force the B input in this product term to a logical zero - * 0b01..Pass the B input in this product term - * 0b10..Complement the B input in this product term - * 0b11..Force the B input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_BC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_BC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_BC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_AC_MASK (0xC0U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_AC_SHIFT (6U) -/*! PT1_AC - Product Term 1, A Input Configuration - * 0b00..Force the A input in this product term to a logical zero - * 0b01..Pass the A input in this product term - * 0b10..Complement the A input in this product term - * 0b11..Force the A input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_AC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_AC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_AC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_DC_MASK (0x300U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_DC_SHIFT (8U) -/*! PT0_DC - Product Term 0, D Input Configuration - * 0b00..Force the D input in this product term to a logical zero - * 0b01..Pass the D input in this product term - * 0b10..Complement the D input in this product term - * 0b11..Force the D input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_DC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_DC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_DC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_CC_MASK (0xC00U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_CC_SHIFT (10U) -/*! PT0_CC - Product Term 0, C Input Configuration - * 0b00..Force the C input in this product term to a logical zero - * 0b01..Pass the C input in this product term - * 0b10..Complement the C input in this product term - * 0b11..Force the C input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_CC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_CC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_CC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_BC_MASK (0x3000U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_BC_SHIFT (12U) -/*! PT0_BC - Product Term 0, B Input Configuration - * 0b00..Force the B input in this product term to a logical zero - * 0b01..Pass the B input in this product term - * 0b10..Complement the B input in this product term - * 0b11..Force the B input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_BC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_BC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_BC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_AC_MASK (0xC000U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_AC_SHIFT (14U) -/*! PT0_AC - Product Term 0, A Input Configuration - * 0b00..Force the A input in this product term to a logical zero - * 0b01..Pass the A input in this product term - * 0b10..Complement the A input in this product term - * 0b11..Force the A input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_AC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_AC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_AC_MASK) -/*! @} */ - -/* The count of EVTG_EVTG_INST_EVTG_AOI1_BFT01 */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_COUNT (4U) - -/*! @name EVTG_INST_EVTG_AOI1_BFT23 - AOI1 Boolean Function Term 2 and 3 Configuration */ -/*! @{ */ - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_DC_MASK (0x3U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_DC_SHIFT (0U) -/*! PT3_DC - Product Term 3, D Input Configuration - * 0b00..Force the D input in this product term to a logical zero - * 0b01..Pass the D input in this product term - * 0b10..Complement the D input in this product term - * 0b11..Force the D input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_DC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_DC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_DC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_CC_MASK (0xCU) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_CC_SHIFT (2U) -/*! PT3_CC - Product Term 3, C Input Configuration - * 0b00..Force the C input in this product term to a logical zero - * 0b01..Pass the C input in this product term - * 0b10..Complement the C input in this product term - * 0b11..Force the C input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_CC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_CC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_CC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_BC_MASK (0x30U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_BC_SHIFT (4U) -/*! PT3_BC - Product Term 3, B Input Configuration - * 0b00..Force the B input in this product term to a logical zero - * 0b01..Pass the B input in this product term - * 0b10..Complement the B input in this product term - * 0b11..Force the B input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_BC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_BC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_BC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_AC_MASK (0xC0U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_AC_SHIFT (6U) -/*! PT3_AC - Product Term 3, A Input Configuration - * 0b00..Force the A input in this product term to a logical zero - * 0b01..Pass the A input in this product term - * 0b10..Complement the A input in this product term - * 0b11..Force the A input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_AC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_AC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_AC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_DC_MASK (0x300U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_DC_SHIFT (8U) -/*! PT2_DC - Product Term 2, D Input Configuration - * 0b00..Force the D input in this product term to a logical zero - * 0b01..Pass the D input in this product term - * 0b10..Complement the D input in this product term - * 0b11..Force the D input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_DC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_DC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_DC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_CC_MASK (0xC00U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_CC_SHIFT (10U) -/*! PT2_CC - Product Term 2, C Input Configuration - * 0b00..Force the C input in this product term to a logical zero - * 0b01..Pass the C input in this product term - * 0b10..Complement the C input in this product term - * 0b11..Force the C input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_CC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_CC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_CC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_BC_MASK (0x3000U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_BC_SHIFT (12U) -/*! PT2_BC - Product Term 2, B Input Configuration - * 0b00..Force the B input in this product term to a logical zero - * 0b01..Pass the B input in this product term - * 0b10..Complement the B input in this product term - * 0b11..Force the B input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_BC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_BC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_BC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_AC_MASK (0xC000U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_AC_SHIFT (14U) -/*! PT2_AC - Product Term 2, A Input Configuration - * 0b00..Force the A input in this product term to a logical zero - * 0b01..Pass the A input in this product term - * 0b10..Complement the A input in this product term - * 0b11..Force the A input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_AC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_AC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_AC_MASK) -/*! @} */ - -/* The count of EVTG_EVTG_INST_EVTG_AOI1_BFT23 */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_COUNT (4U) - -/*! @name EVTG_INST_EVTG_CTRL - Control and Status */ -/*! @{ */ - -#define EVTG_EVTG_INST_EVTG_CTRL_FF_INIT_MASK (0x1U) -#define EVTG_EVTG_INST_EVTG_CTRL_FF_INIT_SHIFT (0U) -/*! FF_INIT - Flip flop Initial Value Configuration - * 0b0..0 - * 0b1..1 - */ -#define EVTG_EVTG_INST_EVTG_CTRL_FF_INIT(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_CTRL_FF_INIT_SHIFT)) & EVTG_EVTG_INST_EVTG_CTRL_FF_INIT_MASK) - -#define EVTG_EVTG_INST_EVTG_CTRL_INIT_EN_MASK (0x2U) -#define EVTG_EVTG_INST_EVTG_CTRL_INIT_EN_SHIFT (1U) -/*! INIT_EN - Flip-Flop Initial Output Enable Control - * 0b0..Write 0 does not generate enable pulse - * 0b1..Write 1 generates enable pulse - */ -#define EVTG_EVTG_INST_EVTG_CTRL_INIT_EN(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_CTRL_INIT_EN_SHIFT)) & EVTG_EVTG_INST_EVTG_CTRL_INIT_EN_MASK) - -#define EVTG_EVTG_INST_EVTG_CTRL_MODE_SEL_MASK (0x1CU) -#define EVTG_EVTG_INST_EVTG_CTRL_MODE_SEL_SHIFT (2U) -/*! MODE_SEL - Flip-Flop Mode Selection - * 0b000..Bypass mode - * 0b001..RS Trigger mode - * 0b010..T-FF mode - * 0b011..D-FF mode - * 0b100..JK-FF mode - * 0b101..Latch mode - * 0b110..Reserved - * 0b111..Reserved - */ -#define EVTG_EVTG_INST_EVTG_CTRL_MODE_SEL(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_CTRL_MODE_SEL_SHIFT)) & EVTG_EVTG_INST_EVTG_CTRL_MODE_SEL_MASK) - -#define EVTG_EVTG_INST_EVTG_CTRL_FB_OVRD_MASK (0xC0U) -#define EVTG_EVTG_INST_EVTG_CTRL_FB_OVRD_SHIFT (6U) -/*! FB_OVRD - EVTG Output Feedback Override Control - * 0b00..Replace An - * 0b01..Replace Bn - * 0b10..Replace Cn - * 0b11..Replace Dn - */ -#define EVTG_EVTG_INST_EVTG_CTRL_FB_OVRD(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_CTRL_FB_OVRD_SHIFT)) & EVTG_EVTG_INST_EVTG_CTRL_FB_OVRD_MASK) - -#define EVTG_EVTG_INST_EVTG_CTRL_SYNC_CTRL_MASK (0xF00U) -#define EVTG_EVTG_INST_EVTG_CTRL_SYNC_CTRL_SHIFT (8U) -/*! SYNC_CTRL - Synchronize Control - * 0bxxx1..EVTG input "An" will be synced by two bus clk cycles - * 0bxxx0..EVTG input "An" will not be synced - * 0bxx1x..EVTG input "Bn" will be synced by two bus clk cycles - * 0bxx0x..EVTG input "Bn" will not be synced - * 0bx1xx..EVTG input "Cn" will be synced by two bus clk cycles - * 0bx0xx..EVTG input "Cn" will not be synced - * 0b1xxx..EVTG input "Dn" will be synced by two bus clk cycles - * 0b0xxx..EVTG input "Dn" will not be synced - */ -#define EVTG_EVTG_INST_EVTG_CTRL_SYNC_CTRL(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_CTRL_SYNC_CTRL_SHIFT)) & EVTG_EVTG_INST_EVTG_CTRL_SYNC_CTRL_MASK) - -#define EVTG_EVTG_INST_EVTG_CTRL_FORCE_BYPASS_MASK (0x3000U) -#define EVTG_EVTG_INST_EVTG_CTRL_FORCE_BYPASS_SHIFT (12U) -/*! FORCE_BYPASS - Force Bypass Control - * 0bx1..Whatever MODE_SEL is, will force bypass flip-flop and route the AOI_0(Filter_0) value directly to EVTG_OUTA - * 0bx0..Will not force the bypass - * 0b1x..Whatever MODE_SEL is, will force bypass flip-flop and route the AOI_1(Filter_1) value directly to EVTG_OUTB - * 0b0x..Will not force the bypass - */ -#define EVTG_EVTG_INST_EVTG_CTRL_FORCE_BYPASS(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_CTRL_FORCE_BYPASS_SHIFT)) & EVTG_EVTG_INST_EVTG_CTRL_FORCE_BYPASS_MASK) -/*! @} */ - -/* The count of EVTG_EVTG_INST_EVTG_CTRL */ -#define EVTG_EVTG_INST_EVTG_CTRL_COUNT (4U) - -/*! @name EVTG_INST_EVTG_AOI0_FILT - AOI0 Output Filter */ -/*! @{ */ - -#define EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_PER_MASK (0xFFU) -#define EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_PER_SHIFT (0U) -/*! FILT_PER - Output Filter Sample Period */ -#define EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_PER(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_PER_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_PER_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_CNT_MASK (0x700U) -#define EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_CNT_SHIFT (8U) -/*! FILT_CNT - Output Filter Sample Count */ -#define EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_CNT(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_CNT_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_CNT_MASK) -/*! @} */ - -/* The count of EVTG_EVTG_INST_EVTG_AOI0_FILT */ -#define EVTG_EVTG_INST_EVTG_AOI0_FILT_COUNT (4U) - -/*! @name EVTG_INST_EVTG_AOI1_FILT - AOI1 Output Filter */ -/*! @{ */ - -#define EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_PER_MASK (0xFFU) -#define EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_PER_SHIFT (0U) -/*! FILT_PER - Output Filter Sample Period */ -#define EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_PER(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_PER_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_PER_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_CNT_MASK (0x700U) -#define EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_CNT_SHIFT (8U) -/*! FILT_CNT - Output Filter Sample Count */ -#define EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_CNT(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_CNT_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_CNT_MASK) -/*! @} */ - -/* The count of EVTG_EVTG_INST_EVTG_AOI1_FILT */ -#define EVTG_EVTG_INST_EVTG_AOI1_FILT_COUNT (4U) - - -/*! - * @} - */ /* end of group EVTG_Register_Masks */ - - -/* EVTG - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral EVTG0 base address */ - #define EVTG0_BASE (0x500D2000u) - /** Peripheral EVTG0 base address */ - #define EVTG0_BASE_NS (0x400D2000u) - /** Peripheral EVTG0 base pointer */ - #define EVTG0 ((EVTG_Type *)EVTG0_BASE) - /** Peripheral EVTG0 base pointer */ - #define EVTG0_NS ((EVTG_Type *)EVTG0_BASE_NS) - /** Array initializer of EVTG peripheral base addresses */ - #define EVTG_BASE_ADDRS { EVTG0_BASE } - /** Array initializer of EVTG peripheral base pointers */ - #define EVTG_BASE_PTRS { EVTG0 } - /** Array initializer of EVTG peripheral base addresses */ - #define EVTG_BASE_ADDRS_NS { EVTG0_BASE_NS } - /** Array initializer of EVTG peripheral base pointers */ - #define EVTG_BASE_PTRS_NS { EVTG0_NS } -#else - /** Peripheral EVTG0 base address */ - #define EVTG0_BASE (0x400D2000u) - /** Peripheral EVTG0 base pointer */ - #define EVTG0 ((EVTG_Type *)EVTG0_BASE) - /** Array initializer of EVTG peripheral base addresses */ - #define EVTG_BASE_ADDRS { EVTG0_BASE } - /** Array initializer of EVTG peripheral base pointers */ - #define EVTG_BASE_PTRS { EVTG0 } -#endif - -/*! - * @} - */ /* end of group EVTG_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- EWM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup EWM_Peripheral_Access_Layer EWM Peripheral Access Layer - * @{ - */ - -/** EWM - Register Layout Typedef */ -typedef struct { - __IO uint8_t CTRL; /**< Control, offset: 0x0 */ - __O uint8_t SERV; /**< Service, offset: 0x1 */ - __IO uint8_t CMPL; /**< Compare Low, offset: 0x2 */ - __IO uint8_t CMPH; /**< Compare High, offset: 0x3 */ - __IO uint8_t CLKCTRL; /**< Clock Control, offset: 0x4 */ - __IO uint8_t CLKPRESCALER; /**< Clock Prescaler, offset: 0x5 */ -} EWM_Type; - -/* ---------------------------------------------------------------------------- - -- EWM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup EWM_Register_Masks EWM Register Masks - * @{ - */ - -/*! @name CTRL - Control */ -/*! @{ */ - -#define EWM_CTRL_EWMEN_MASK (0x1U) -#define EWM_CTRL_EWMEN_SHIFT (0U) -/*! EWMEN - EWM Enable - * 0b0..Disables - * 0b1..Enables - */ -#define EWM_CTRL_EWMEN(x) (((uint8_t)(((uint8_t)(x)) << EWM_CTRL_EWMEN_SHIFT)) & EWM_CTRL_EWMEN_MASK) - -#define EWM_CTRL_ASSIN_MASK (0x2U) -#define EWM_CTRL_ASSIN_SHIFT (1U) -/*! ASSIN - Assertion State Select - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define EWM_CTRL_ASSIN(x) (((uint8_t)(((uint8_t)(x)) << EWM_CTRL_ASSIN_SHIFT)) & EWM_CTRL_ASSIN_MASK) - -#define EWM_CTRL_INEN_MASK (0x4U) -#define EWM_CTRL_INEN_SHIFT (2U) -/*! INEN - Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define EWM_CTRL_INEN(x) (((uint8_t)(((uint8_t)(x)) << EWM_CTRL_INEN_SHIFT)) & EWM_CTRL_INEN_MASK) - -#define EWM_CTRL_INTEN_MASK (0x8U) -#define EWM_CTRL_INTEN_SHIFT (3U) -/*! INTEN - Interrupt Enable - * 0b1..Generates interrupt requests - * 0b0..Deasserts interrupt requests - */ -#define EWM_CTRL_INTEN(x) (((uint8_t)(((uint8_t)(x)) << EWM_CTRL_INTEN_SHIFT)) & EWM_CTRL_INTEN_MASK) -/*! @} */ - -/*! @name SERV - Service */ -/*! @{ */ - -#define EWM_SERV_SERVICE_MASK (0xFFU) -#define EWM_SERV_SERVICE_SHIFT (0U) -/*! SERVICE - Service */ -#define EWM_SERV_SERVICE(x) (((uint8_t)(((uint8_t)(x)) << EWM_SERV_SERVICE_SHIFT)) & EWM_SERV_SERVICE_MASK) -/*! @} */ - -/*! @name CMPL - Compare Low */ -/*! @{ */ - -#define EWM_CMPL_COMPAREL_MASK (0xFFU) -#define EWM_CMPL_COMPAREL_SHIFT (0U) -/*! COMPAREL - Compare Low */ -#define EWM_CMPL_COMPAREL(x) (((uint8_t)(((uint8_t)(x)) << EWM_CMPL_COMPAREL_SHIFT)) & EWM_CMPL_COMPAREL_MASK) -/*! @} */ - -/*! @name CMPH - Compare High */ -/*! @{ */ - -#define EWM_CMPH_COMPAREH_MASK (0xFFU) -#define EWM_CMPH_COMPAREH_SHIFT (0U) -/*! COMPAREH - Compare High */ -#define EWM_CMPH_COMPAREH(x) (((uint8_t)(((uint8_t)(x)) << EWM_CMPH_COMPAREH_SHIFT)) & EWM_CMPH_COMPAREH_MASK) -/*! @} */ - -/*! @name CLKCTRL - Clock Control */ -/*! @{ */ - -#define EWM_CLKCTRL_CLKSEL_MASK (0x3U) -#define EWM_CLKCTRL_CLKSEL_SHIFT (0U) -/*! CLKSEL - Clock Select */ -#define EWM_CLKCTRL_CLKSEL(x) (((uint8_t)(((uint8_t)(x)) << EWM_CLKCTRL_CLKSEL_SHIFT)) & EWM_CLKCTRL_CLKSEL_MASK) -/*! @} */ - -/*! @name CLKPRESCALER - Clock Prescaler */ -/*! @{ */ - -#define EWM_CLKPRESCALER_CLK_DIV_MASK (0xFFU) -#define EWM_CLKPRESCALER_CLK_DIV_SHIFT (0U) -/*! CLK_DIV - Clock Divider */ -#define EWM_CLKPRESCALER_CLK_DIV(x) (((uint8_t)(((uint8_t)(x)) << EWM_CLKPRESCALER_CLK_DIV_SHIFT)) & EWM_CLKPRESCALER_CLK_DIV_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group EWM_Register_Masks */ - - -/* EWM - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral EWM0 base address */ - #define EWM0_BASE (0x500C0000u) - /** Peripheral EWM0 base address */ - #define EWM0_BASE_NS (0x400C0000u) - /** Peripheral EWM0 base pointer */ - #define EWM0 ((EWM_Type *)EWM0_BASE) - /** Peripheral EWM0 base pointer */ - #define EWM0_NS ((EWM_Type *)EWM0_BASE_NS) - /** Array initializer of EWM peripheral base addresses */ - #define EWM_BASE_ADDRS { EWM0_BASE } - /** Array initializer of EWM peripheral base pointers */ - #define EWM_BASE_PTRS { EWM0 } - /** Array initializer of EWM peripheral base addresses */ - #define EWM_BASE_ADDRS_NS { EWM0_BASE_NS } - /** Array initializer of EWM peripheral base pointers */ - #define EWM_BASE_PTRS_NS { EWM0_NS } -#else - /** Peripheral EWM0 base address */ - #define EWM0_BASE (0x400C0000u) - /** Peripheral EWM0 base pointer */ - #define EWM0 ((EWM_Type *)EWM0_BASE) - /** Array initializer of EWM peripheral base addresses */ - #define EWM_BASE_ADDRS { EWM0_BASE } - /** Array initializer of EWM peripheral base pointers */ - #define EWM_BASE_PTRS { EWM0 } -#endif - -/*! - * @} - */ /* end of group EWM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- FLEXIO Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FLEXIO_Peripheral_Access_Layer FLEXIO Peripheral Access Layer - * @{ - */ - -/** FLEXIO - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - __IO uint32_t CTRL; /**< FLEXIO Control, offset: 0x8 */ - __I uint32_t PIN; /**< Pin State, offset: 0xC */ - __IO uint32_t SHIFTSTAT; /**< Shifter Status, offset: 0x10 */ - __IO uint32_t SHIFTERR; /**< Shifter Error, offset: 0x14 */ - __IO uint32_t TIMSTAT; /**< Timer Status Flag, offset: 0x18 */ - uint8_t RESERVED_0[4]; - __IO uint32_t SHIFTSIEN; /**< Shifter Status Interrupt Enable, offset: 0x20 */ - __IO uint32_t SHIFTEIEN; /**< Shifter Error Interrupt Enable, offset: 0x24 */ - __IO uint32_t TIMIEN; /**< Timer Interrupt Enable, offset: 0x28 */ - uint8_t RESERVED_1[4]; - __IO uint32_t SHIFTSDEN; /**< Shifter Status DMA Enable, offset: 0x30 */ - uint8_t RESERVED_2[4]; - __IO uint32_t TIMERSDEN; /**< Timer Status DMA Enable, offset: 0x38 */ - uint8_t RESERVED_3[4]; - __IO uint32_t SHIFTSTATE; /**< Shifter State, offset: 0x40 */ - uint8_t RESERVED_4[4]; - __IO uint32_t TRGSTAT; /**< Trigger Status, offset: 0x48 */ - __IO uint32_t TRIGIEN; /**< External Trigger Interrupt Enable, offset: 0x4C */ - __IO uint32_t PINSTAT; /**< Pin Status, offset: 0x50 */ - __IO uint32_t PINIEN; /**< Pin Interrupt Enable, offset: 0x54 */ - __IO uint32_t PINREN; /**< Pin Rising Edge Enable, offset: 0x58 */ - __IO uint32_t PINFEN; /**< Pin Falling Edge Enable, offset: 0x5C */ - __IO uint32_t PINOUTD; /**< Pin Output Data, offset: 0x60 */ - __IO uint32_t PINOUTE; /**< Pin Output Enable, offset: 0x64 */ - __O uint32_t PINOUTDIS; /**< Pin Output Disable, offset: 0x68 */ - __O uint32_t PINOUTCLR; /**< Pin Output Clear, offset: 0x6C */ - __O uint32_t PINOUTSET; /**< Pin Output Set, offset: 0x70 */ - __O uint32_t PINOUTTOG; /**< Pin Output Toggle, offset: 0x74 */ - uint8_t RESERVED_5[8]; - __IO uint32_t SHIFTCTL[8]; /**< Shifter Control, array offset: 0x80, array step: 0x4 */ - uint8_t RESERVED_6[96]; - __IO uint32_t SHIFTCFG[8]; /**< Shifter Configuration, array offset: 0x100, array step: 0x4 */ - uint8_t RESERVED_7[224]; - __IO uint32_t SHIFTBUF[8]; /**< Shifter Buffer, array offset: 0x200, array step: 0x4 */ - uint8_t RESERVED_8[96]; - __IO uint32_t SHIFTBUFBIS[8]; /**< Shifter Buffer Bit Swapped, array offset: 0x280, array step: 0x4 */ - uint8_t RESERVED_9[96]; - __IO uint32_t SHIFTBUFBYS[8]; /**< Shifter Buffer Byte Swapped, array offset: 0x300, array step: 0x4 */ - uint8_t RESERVED_10[96]; - __IO uint32_t SHIFTBUFBBS[8]; /**< Shifter Buffer Bit Byte Swapped, array offset: 0x380, array step: 0x4 */ - uint8_t RESERVED_11[96]; - __IO uint32_t TIMCTL[8]; /**< Timer Control, array offset: 0x400, array step: 0x4 */ - uint8_t RESERVED_12[96]; - __IO uint32_t TIMCFG[8]; /**< Timer Configuration, array offset: 0x480, array step: 0x4 */ - uint8_t RESERVED_13[96]; - __IO uint32_t TIMCMP[8]; /**< Timer Compare, array offset: 0x500, array step: 0x4 */ - uint8_t RESERVED_14[352]; - __IO uint32_t SHIFTBUFNBS[8]; /**< Shifter Buffer Nibble Byte Swapped, array offset: 0x680, array step: 0x4 */ - uint8_t RESERVED_15[96]; - __IO uint32_t SHIFTBUFHWS[8]; /**< Shifter Buffer Halfword Swapped, array offset: 0x700, array step: 0x4 */ - uint8_t RESERVED_16[96]; - __IO uint32_t SHIFTBUFNIS[8]; /**< Shifter Buffer Nibble Swapped, array offset: 0x780, array step: 0x4 */ - uint8_t RESERVED_17[96]; - __IO uint32_t SHIFTBUFOES[8]; /**< Shifter Buffer Odd Even Swapped, array offset: 0x800, array step: 0x4 */ - uint8_t RESERVED_18[96]; - __IO uint32_t SHIFTBUFEOS[8]; /**< Shifter Buffer Even Odd Swapped, array offset: 0x880, array step: 0x4 */ - uint8_t RESERVED_19[96]; - __IO uint32_t SHIFTBUFHBS[8]; /**< Shifter Buffer Halfword Byte Swapped, array offset: 0x900, array step: 0x4 */ -} FLEXIO_Type; - -/* ---------------------------------------------------------------------------- - -- FLEXIO Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FLEXIO_Register_Masks FLEXIO Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define FLEXIO_VERID_FEATURE_MASK (0xFFFFU) -#define FLEXIO_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Standard features implemented - * 0b0000000000000001..State, logic, and parallel modes supported - * 0b0000000000000010..Pin control registers supported - * 0b0000000000000011..State, logic, and parallel modes, plus pin control registers supported - */ -#define FLEXIO_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_VERID_FEATURE_SHIFT)) & FLEXIO_VERID_FEATURE_MASK) - -#define FLEXIO_VERID_MINOR_MASK (0xFF0000U) -#define FLEXIO_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define FLEXIO_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_VERID_MINOR_SHIFT)) & FLEXIO_VERID_MINOR_MASK) - -#define FLEXIO_VERID_MAJOR_MASK (0xFF000000U) -#define FLEXIO_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define FLEXIO_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_VERID_MAJOR_SHIFT)) & FLEXIO_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define FLEXIO_PARAM_SHIFTER_MASK (0xFFU) -#define FLEXIO_PARAM_SHIFTER_SHIFT (0U) -/*! SHIFTER - Shifter Number */ -#define FLEXIO_PARAM_SHIFTER(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PARAM_SHIFTER_SHIFT)) & FLEXIO_PARAM_SHIFTER_MASK) - -#define FLEXIO_PARAM_TIMER_MASK (0xFF00U) -#define FLEXIO_PARAM_TIMER_SHIFT (8U) -/*! TIMER - Timer Number */ -#define FLEXIO_PARAM_TIMER(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PARAM_TIMER_SHIFT)) & FLEXIO_PARAM_TIMER_MASK) - -#define FLEXIO_PARAM_PIN_MASK (0xFF0000U) -#define FLEXIO_PARAM_PIN_SHIFT (16U) -/*! PIN - Pin Number */ -#define FLEXIO_PARAM_PIN(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PARAM_PIN_SHIFT)) & FLEXIO_PARAM_PIN_MASK) - -#define FLEXIO_PARAM_TRIGGER_MASK (0xFF000000U) -#define FLEXIO_PARAM_TRIGGER_SHIFT (24U) -/*! TRIGGER - Trigger Number */ -#define FLEXIO_PARAM_TRIGGER(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PARAM_TRIGGER_SHIFT)) & FLEXIO_PARAM_TRIGGER_MASK) -/*! @} */ - -/*! @name CTRL - FLEXIO Control */ -/*! @{ */ - -#define FLEXIO_CTRL_FLEXEN_MASK (0x1U) -#define FLEXIO_CTRL_FLEXEN_SHIFT (0U) -/*! FLEXEN - FLEXIO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXIO_CTRL_FLEXEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_CTRL_FLEXEN_SHIFT)) & FLEXIO_CTRL_FLEXEN_MASK) - -#define FLEXIO_CTRL_SWRST_MASK (0x2U) -#define FLEXIO_CTRL_SWRST_SHIFT (1U) -/*! SWRST - Software Reset - * 0b0..Disabled - * 0b1..Enabled - */ -#define FLEXIO_CTRL_SWRST(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_CTRL_SWRST_SHIFT)) & FLEXIO_CTRL_SWRST_MASK) - -#define FLEXIO_CTRL_FASTACC_MASK (0x4U) -#define FLEXIO_CTRL_FASTACC_SHIFT (2U) -/*! FASTACC - Fast Access - * 0b0..Normal - * 0b1..Fast - */ -#define FLEXIO_CTRL_FASTACC(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_CTRL_FASTACC_SHIFT)) & FLEXIO_CTRL_FASTACC_MASK) - -#define FLEXIO_CTRL_DBGE_MASK (0x40000000U) -#define FLEXIO_CTRL_DBGE_SHIFT (30U) -/*! DBGE - Debug Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXIO_CTRL_DBGE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_CTRL_DBGE_SHIFT)) & FLEXIO_CTRL_DBGE_MASK) - -#define FLEXIO_CTRL_DOZEN_MASK (0x80000000U) -#define FLEXIO_CTRL_DOZEN_SHIFT (31U) -/*! DOZEN - Doze Enable - * 0b0..Enable - * 0b1..Disable - */ -#define FLEXIO_CTRL_DOZEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_CTRL_DOZEN_SHIFT)) & FLEXIO_CTRL_DOZEN_MASK) -/*! @} */ - -/*! @name PIN - Pin State */ -/*! @{ */ - -#define FLEXIO_PIN_PDI_MASK (0xFFFFFFFFU) -#define FLEXIO_PIN_PDI_SHIFT (0U) -/*! PDI - Pin Data Input */ -#define FLEXIO_PIN_PDI(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PIN_PDI_SHIFT)) & FLEXIO_PIN_PDI_MASK) -/*! @} */ - -/*! @name SHIFTSTAT - Shifter Status */ -/*! @{ */ - -#define FLEXIO_SHIFTSTAT_SSF_MASK (0xFFU) -#define FLEXIO_SHIFTSTAT_SSF_SHIFT (0U) -/*! SSF - Shifter Status Flag - * 0b00000000..Clear - * 0b00000001..Set - * 0b00000000..No effect - * 0b00000001..Clear the flag - */ -#define FLEXIO_SHIFTSTAT_SSF(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTSTAT_SSF_SHIFT)) & FLEXIO_SHIFTSTAT_SSF_MASK) -/*! @} */ - -/*! @name SHIFTERR - Shifter Error */ -/*! @{ */ - -#define FLEXIO_SHIFTERR_SEF_MASK (0xFFU) -#define FLEXIO_SHIFTERR_SEF_SHIFT (0U) -/*! SEF - Shifter Error Flag - * 0b00000000..Clear - * 0b00000001..Set - * 0b00000000..No effect - * 0b00000001..Clear the flag - */ -#define FLEXIO_SHIFTERR_SEF(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTERR_SEF_SHIFT)) & FLEXIO_SHIFTERR_SEF_MASK) -/*! @} */ - -/*! @name TIMSTAT - Timer Status Flag */ -/*! @{ */ - -#define FLEXIO_TIMSTAT_TSF_MASK (0xFFU) -#define FLEXIO_TIMSTAT_TSF_SHIFT (0U) -/*! TSF - Timer Status Flag - * 0b00000000..Clear - * 0b00000001..Set - * 0b00000000..No effect - * 0b00000001..Clear the flag - */ -#define FLEXIO_TIMSTAT_TSF(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMSTAT_TSF_SHIFT)) & FLEXIO_TIMSTAT_TSF_MASK) -/*! @} */ - -/*! @name SHIFTSIEN - Shifter Status Interrupt Enable */ -/*! @{ */ - -#define FLEXIO_SHIFTSIEN_SSIE_MASK (0xFFU) -#define FLEXIO_SHIFTSIEN_SSIE_SHIFT (0U) -/*! SSIE - Shifter Status Interrupt Enable */ -#define FLEXIO_SHIFTSIEN_SSIE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTSIEN_SSIE_SHIFT)) & FLEXIO_SHIFTSIEN_SSIE_MASK) -/*! @} */ - -/*! @name SHIFTEIEN - Shifter Error Interrupt Enable */ -/*! @{ */ - -#define FLEXIO_SHIFTEIEN_SEIE_MASK (0xFFU) -#define FLEXIO_SHIFTEIEN_SEIE_SHIFT (0U) -/*! SEIE - Shifter Error Interrupt Enable */ -#define FLEXIO_SHIFTEIEN_SEIE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTEIEN_SEIE_SHIFT)) & FLEXIO_SHIFTEIEN_SEIE_MASK) -/*! @} */ - -/*! @name TIMIEN - Timer Interrupt Enable */ -/*! @{ */ - -#define FLEXIO_TIMIEN_TEIE_MASK (0xFFU) -#define FLEXIO_TIMIEN_TEIE_SHIFT (0U) -/*! TEIE - Timer Status Interrupt Enable */ -#define FLEXIO_TIMIEN_TEIE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMIEN_TEIE_SHIFT)) & FLEXIO_TIMIEN_TEIE_MASK) -/*! @} */ - -/*! @name SHIFTSDEN - Shifter Status DMA Enable */ -/*! @{ */ - -#define FLEXIO_SHIFTSDEN_SSDE_MASK (0xFFU) -#define FLEXIO_SHIFTSDEN_SSDE_SHIFT (0U) -/*! SSDE - Shifter Status DMA Enable */ -#define FLEXIO_SHIFTSDEN_SSDE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTSDEN_SSDE_SHIFT)) & FLEXIO_SHIFTSDEN_SSDE_MASK) -/*! @} */ - -/*! @name TIMERSDEN - Timer Status DMA Enable */ -/*! @{ */ - -#define FLEXIO_TIMERSDEN_TSDE_MASK (0xFFU) -#define FLEXIO_TIMERSDEN_TSDE_SHIFT (0U) -/*! TSDE - Timer Status DMA Enable */ -#define FLEXIO_TIMERSDEN_TSDE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMERSDEN_TSDE_SHIFT)) & FLEXIO_TIMERSDEN_TSDE_MASK) -/*! @} */ - -/*! @name SHIFTSTATE - Shifter State */ -/*! @{ */ - -#define FLEXIO_SHIFTSTATE_STATE_MASK (0x7U) -#define FLEXIO_SHIFTSTATE_STATE_SHIFT (0U) -/*! STATE - Current State Pointer */ -#define FLEXIO_SHIFTSTATE_STATE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTSTATE_STATE_SHIFT)) & FLEXIO_SHIFTSTATE_STATE_MASK) -/*! @} */ - -/*! @name TRGSTAT - Trigger Status */ -/*! @{ */ - -#define FLEXIO_TRGSTAT_ETSF_MASK (0xFFU) -#define FLEXIO_TRGSTAT_ETSF_SHIFT (0U) -/*! ETSF - External Trigger Status Flag - * 0b00000000..Clear - * 0b00000001..Set - * 0b00000000..No effect - * 0b00000001..Clear the flag - */ -#define FLEXIO_TRGSTAT_ETSF(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TRGSTAT_ETSF_SHIFT)) & FLEXIO_TRGSTAT_ETSF_MASK) -/*! @} */ - -/*! @name TRIGIEN - External Trigger Interrupt Enable */ -/*! @{ */ - -#define FLEXIO_TRIGIEN_TRIE_MASK (0xFFU) -#define FLEXIO_TRIGIEN_TRIE_SHIFT (0U) -/*! TRIE - External Trigger Interrupt Enable */ -#define FLEXIO_TRIGIEN_TRIE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TRIGIEN_TRIE_SHIFT)) & FLEXIO_TRIGIEN_TRIE_MASK) -/*! @} */ - -/*! @name PINSTAT - Pin Status */ -/*! @{ */ - -#define FLEXIO_PINSTAT_PSF_MASK (0xFFFFFFFFU) -#define FLEXIO_PINSTAT_PSF_SHIFT (0U) -/*! PSF - Pin Status Flag - * 0b00000000000000000000000000000000..Clear - * 0b00000000000000000000000000000001..Set - * 0b00000000000000000000000000000000..No effect - * 0b00000000000000000000000000000001..Clear the flag - */ -#define FLEXIO_PINSTAT_PSF(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINSTAT_PSF_SHIFT)) & FLEXIO_PINSTAT_PSF_MASK) -/*! @} */ - -/*! @name PINIEN - Pin Interrupt Enable */ -/*! @{ */ - -#define FLEXIO_PINIEN_PSIE_MASK (0xFFFFFFFFU) -#define FLEXIO_PINIEN_PSIE_SHIFT (0U) -/*! PSIE - Pin Status Interrupt Enable */ -#define FLEXIO_PINIEN_PSIE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINIEN_PSIE_SHIFT)) & FLEXIO_PINIEN_PSIE_MASK) -/*! @} */ - -/*! @name PINREN - Pin Rising Edge Enable */ -/*! @{ */ - -#define FLEXIO_PINREN_PRE_MASK (0xFFFFFFFFU) -#define FLEXIO_PINREN_PRE_SHIFT (0U) -/*! PRE - Pin Rising Edge */ -#define FLEXIO_PINREN_PRE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINREN_PRE_SHIFT)) & FLEXIO_PINREN_PRE_MASK) -/*! @} */ - -/*! @name PINFEN - Pin Falling Edge Enable */ -/*! @{ */ - -#define FLEXIO_PINFEN_PFE_MASK (0xFFFFFFFFU) -#define FLEXIO_PINFEN_PFE_SHIFT (0U) -/*! PFE - Pin Falling Edge */ -#define FLEXIO_PINFEN_PFE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINFEN_PFE_SHIFT)) & FLEXIO_PINFEN_PFE_MASK) -/*! @} */ - -/*! @name PINOUTD - Pin Output Data */ -/*! @{ */ - -#define FLEXIO_PINOUTD_OUTD_MASK (0xFFFFFFFFU) -#define FLEXIO_PINOUTD_OUTD_SHIFT (0U) -/*! OUTD - Output Data */ -#define FLEXIO_PINOUTD_OUTD(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINOUTD_OUTD_SHIFT)) & FLEXIO_PINOUTD_OUTD_MASK) -/*! @} */ - -/*! @name PINOUTE - Pin Output Enable */ -/*! @{ */ - -#define FLEXIO_PINOUTE_OUTE_MASK (0xFFFFFFFFU) -#define FLEXIO_PINOUTE_OUTE_SHIFT (0U) -/*! OUTE - Output Enable */ -#define FLEXIO_PINOUTE_OUTE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINOUTE_OUTE_SHIFT)) & FLEXIO_PINOUTE_OUTE_MASK) -/*! @} */ - -/*! @name PINOUTDIS - Pin Output Disable */ -/*! @{ */ - -#define FLEXIO_PINOUTDIS_OUTDIS_MASK (0xFFFFFFFFU) -#define FLEXIO_PINOUTDIS_OUTDIS_SHIFT (0U) -/*! OUTDIS - Output Disable */ -#define FLEXIO_PINOUTDIS_OUTDIS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINOUTDIS_OUTDIS_SHIFT)) & FLEXIO_PINOUTDIS_OUTDIS_MASK) -/*! @} */ - -/*! @name PINOUTCLR - Pin Output Clear */ -/*! @{ */ - -#define FLEXIO_PINOUTCLR_OUTCLR_MASK (0xFFFFFFFFU) -#define FLEXIO_PINOUTCLR_OUTCLR_SHIFT (0U) -/*! OUTCLR - Output Clear */ -#define FLEXIO_PINOUTCLR_OUTCLR(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINOUTCLR_OUTCLR_SHIFT)) & FLEXIO_PINOUTCLR_OUTCLR_MASK) -/*! @} */ - -/*! @name PINOUTSET - Pin Output Set */ -/*! @{ */ - -#define FLEXIO_PINOUTSET_OUTSET_MASK (0xFFFFFFFFU) -#define FLEXIO_PINOUTSET_OUTSET_SHIFT (0U) -/*! OUTSET - Output Set */ -#define FLEXIO_PINOUTSET_OUTSET(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINOUTSET_OUTSET_SHIFT)) & FLEXIO_PINOUTSET_OUTSET_MASK) -/*! @} */ - -/*! @name PINOUTTOG - Pin Output Toggle */ -/*! @{ */ - -#define FLEXIO_PINOUTTOG_OUTTOG_MASK (0xFFFFFFFFU) -#define FLEXIO_PINOUTTOG_OUTTOG_SHIFT (0U) -/*! OUTTOG - Output Toggle */ -#define FLEXIO_PINOUTTOG_OUTTOG(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINOUTTOG_OUTTOG_SHIFT)) & FLEXIO_PINOUTTOG_OUTTOG_MASK) -/*! @} */ - -/*! @name SHIFTCTL - Shifter Control */ -/*! @{ */ - -#define FLEXIO_SHIFTCTL_SMOD_MASK (0x7U) -#define FLEXIO_SHIFTCTL_SMOD_SHIFT (0U) -/*! SMOD - Shifter Mode - * 0b000..Disable - * 0b001..Receive mode; capture the current shifter content into SHIFTBUF on expiration of the timer - * 0b010..Transmit mode; load SHIFTBUF contents into the shifter on expiration of the timer - * 0b011..Reserved - * 0b100..Match Store mode; shifter data is compared to SHIFTBUF content on expiration of the timer - * 0b101..Match Continuous mode; shifter data is continuously compared to SHIFTBUF contents - * 0b110..State mode; SHIFTBUF contents store programmable state attributes - * 0b111..Logic mode; SHIFTBUF contents implement programmable logic lookup table - */ -#define FLEXIO_SHIFTCTL_SMOD(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCTL_SMOD_SHIFT)) & FLEXIO_SHIFTCTL_SMOD_MASK) - -#define FLEXIO_SHIFTCTL_PINPOL_MASK (0x80U) -#define FLEXIO_SHIFTCTL_PINPOL_SHIFT (7U) -/*! PINPOL - Shifter Pin Polarity - * 0b0..Active high - * 0b1..Active low - */ -#define FLEXIO_SHIFTCTL_PINPOL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCTL_PINPOL_SHIFT)) & FLEXIO_SHIFTCTL_PINPOL_MASK) - -#define FLEXIO_SHIFTCTL_PINSEL_MASK (0x1F00U) -#define FLEXIO_SHIFTCTL_PINSEL_SHIFT (8U) -/*! PINSEL - Shifter Pin Select */ -#define FLEXIO_SHIFTCTL_PINSEL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCTL_PINSEL_SHIFT)) & FLEXIO_SHIFTCTL_PINSEL_MASK) - -#define FLEXIO_SHIFTCTL_PINCFG_MASK (0x30000U) -#define FLEXIO_SHIFTCTL_PINCFG_SHIFT (16U) -/*! PINCFG - Shifter Pin Configuration - * 0b00..Shifter pin output disabled - * 0b01..Shifter pin open-drain or bidirectional output enable - * 0b10..Shifter pin bidirectional output data - * 0b11..Shifter pin output - */ -#define FLEXIO_SHIFTCTL_PINCFG(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCTL_PINCFG_SHIFT)) & FLEXIO_SHIFTCTL_PINCFG_MASK) - -#define FLEXIO_SHIFTCTL_TIMPOL_MASK (0x800000U) -#define FLEXIO_SHIFTCTL_TIMPOL_SHIFT (23U) -/*! TIMPOL - Timer Polarity - * 0b0..Positive edge - * 0b1..Negative edge - */ -#define FLEXIO_SHIFTCTL_TIMPOL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCTL_TIMPOL_SHIFT)) & FLEXIO_SHIFTCTL_TIMPOL_MASK) - -#define FLEXIO_SHIFTCTL_TIMSEL_MASK (0x7000000U) -#define FLEXIO_SHIFTCTL_TIMSEL_SHIFT (24U) -/*! TIMSEL - Timer Select */ -#define FLEXIO_SHIFTCTL_TIMSEL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCTL_TIMSEL_SHIFT)) & FLEXIO_SHIFTCTL_TIMSEL_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTCTL */ -#define FLEXIO_SHIFTCTL_COUNT (8U) - -/*! @name SHIFTCFG - Shifter Configuration */ -/*! @{ */ - -#define FLEXIO_SHIFTCFG_SSTART_MASK (0x3U) -#define FLEXIO_SHIFTCFG_SSTART_SHIFT (0U) -/*! SSTART - Shifter Start - * 0b00..Start bit disabled for Transmitter, Receiver, and Match Store modes; Transmitter mode loads data on enable - * 0b01..Start bit disabled for Transmitter, Receiver, and Match Store modes; Transmitter mode loads data on first shift - * 0b10..Transmitter mode outputs start bit value 0 before loading data on first shift; if start bit is not 0, - * Receiver and Match Store modes set error flag - * 0b11..Transmitter mode outputs start bit value 1 before loading data on first shift; if start bit is not 1, - * Receiver and Match Store modes set error flag - */ -#define FLEXIO_SHIFTCFG_SSTART(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCFG_SSTART_SHIFT)) & FLEXIO_SHIFTCFG_SSTART_MASK) - -#define FLEXIO_SHIFTCFG_SSTOP_MASK (0x30U) -#define FLEXIO_SHIFTCFG_SSTOP_SHIFT (4U) -/*! SSTOP - Shifter Stop - * 0b00..Stop bit disabled for Transmitter, Receiver, and Match Store modes - * 0b01..Stop bit disabled for Transmitter, Receiver, and Match Store modes; when timer is in stop condition, - * Receiver and Match Store modes store receive data on the configured shift edge - * 0b10..Transmitter mode outputs stop bit value 0 in Match Store mode; if stop bit is not 0, Receiver and Match - * Store modes set error flag (when timer is in stop condition, these modes also store receive data on the - * configured shift edge) - * 0b11..Transmitter mode outputs stop bit value 1 in Match Store mode; if stop bit is not 1, Receiver and Match - * Store modes set error flag (when timer is in stop condition, these modes also store receive data on the - * configured shift edge) - */ -#define FLEXIO_SHIFTCFG_SSTOP(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCFG_SSTOP_SHIFT)) & FLEXIO_SHIFTCFG_SSTOP_MASK) - -#define FLEXIO_SHIFTCFG_INSRC_MASK (0x100U) -#define FLEXIO_SHIFTCFG_INSRC_SHIFT (8U) -/*! INSRC - Input Source - * 0b0..Pin - * 0b1..Shifter n+1 output - */ -#define FLEXIO_SHIFTCFG_INSRC(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCFG_INSRC_SHIFT)) & FLEXIO_SHIFTCFG_INSRC_MASK) - -#define FLEXIO_SHIFTCFG_LATST_MASK (0x200U) -#define FLEXIO_SHIFTCFG_LATST_SHIFT (9U) -/*! LATST - Late Store - * 0b0..Store the pre-shift register state - * 0b1..Store the post-shift register state - */ -#define FLEXIO_SHIFTCFG_LATST(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCFG_LATST_SHIFT)) & FLEXIO_SHIFTCFG_LATST_MASK) - -#define FLEXIO_SHIFTCFG_SSIZE_MASK (0x1000U) -#define FLEXIO_SHIFTCFG_SSIZE_SHIFT (12U) -/*! SSIZE - Shifter Size - * 0b0..32-bit - * 0b1..24-bit - */ -#define FLEXIO_SHIFTCFG_SSIZE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCFG_SSIZE_SHIFT)) & FLEXIO_SHIFTCFG_SSIZE_MASK) - -#define FLEXIO_SHIFTCFG_PWIDTH_MASK (0x1F0000U) -#define FLEXIO_SHIFTCFG_PWIDTH_SHIFT (16U) -/*! PWIDTH - Parallel Width */ -#define FLEXIO_SHIFTCFG_PWIDTH(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCFG_PWIDTH_SHIFT)) & FLEXIO_SHIFTCFG_PWIDTH_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTCFG */ -#define FLEXIO_SHIFTCFG_COUNT (8U) - -/*! @name SHIFTBUF - Shifter Buffer */ -/*! @{ */ - -#define FLEXIO_SHIFTBUF_SHIFTBUF_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUF_SHIFTBUF_SHIFT (0U) -/*! SHIFTBUF - Shift Buffer */ -#define FLEXIO_SHIFTBUF_SHIFTBUF(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUF_SHIFTBUF_SHIFT)) & FLEXIO_SHIFTBUF_SHIFTBUF_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUF */ -#define FLEXIO_SHIFTBUF_COUNT (8U) - -/*! @name SHIFTBUFBIS - Shifter Buffer Bit Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFBIS_SHIFTBUFBIS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFBIS_SHIFTBUFBIS_SHIFT (0U) -/*! SHIFTBUFBIS - Shift Buffer */ -#define FLEXIO_SHIFTBUFBIS_SHIFTBUFBIS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFBIS_SHIFTBUFBIS_SHIFT)) & FLEXIO_SHIFTBUFBIS_SHIFTBUFBIS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFBIS */ -#define FLEXIO_SHIFTBUFBIS_COUNT (8U) - -/*! @name SHIFTBUFBYS - Shifter Buffer Byte Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFBYS_SHIFTBUFBYS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFBYS_SHIFTBUFBYS_SHIFT (0U) -/*! SHIFTBUFBYS - Shift Buffer */ -#define FLEXIO_SHIFTBUFBYS_SHIFTBUFBYS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFBYS_SHIFTBUFBYS_SHIFT)) & FLEXIO_SHIFTBUFBYS_SHIFTBUFBYS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFBYS */ -#define FLEXIO_SHIFTBUFBYS_COUNT (8U) - -/*! @name SHIFTBUFBBS - Shifter Buffer Bit Byte Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFBBS_SHIFTBUFBBS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFBBS_SHIFTBUFBBS_SHIFT (0U) -/*! SHIFTBUFBBS - Shift Buffer */ -#define FLEXIO_SHIFTBUFBBS_SHIFTBUFBBS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFBBS_SHIFTBUFBBS_SHIFT)) & FLEXIO_SHIFTBUFBBS_SHIFTBUFBBS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFBBS */ -#define FLEXIO_SHIFTBUFBBS_COUNT (8U) - -/*! @name TIMCTL - Timer Control */ -/*! @{ */ - -#define FLEXIO_TIMCTL_TIMOD_MASK (0x7U) -#define FLEXIO_TIMCTL_TIMOD_SHIFT (0U) -/*! TIMOD - Timer Mode - * 0b000..Timer disabled - * 0b001..Dual 8-bit counters baud mode - * 0b010..Dual 8-bit counters PWM high mode - * 0b011..Single 16-bit counter mode - * 0b100..Single 16-bit counter disable mode - * 0b101..Dual 8-bit counters word mode - * 0b110..Dual 8-bit counters PWM low mode - * 0b111..Single 16-bit input capture mode - */ -#define FLEXIO_TIMCTL_TIMOD(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_TIMOD_SHIFT)) & FLEXIO_TIMCTL_TIMOD_MASK) - -#define FLEXIO_TIMCTL_ONETIM_MASK (0x20U) -#define FLEXIO_TIMCTL_ONETIM_SHIFT (5U) -/*! ONETIM - Timer One Time Operation - * 0b0..Generate the timer enable event as normal - * 0b1..Block the timer enable event unless the timer status flag is clear - */ -#define FLEXIO_TIMCTL_ONETIM(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_ONETIM_SHIFT)) & FLEXIO_TIMCTL_ONETIM_MASK) - -#define FLEXIO_TIMCTL_PININS_MASK (0x40U) -#define FLEXIO_TIMCTL_PININS_SHIFT (6U) -/*! PININS - Timer Pin Input Select - * 0b0..PINSEL selects timer pin input and output - * 0b1..PINSEL + 1 selects the timer pin input; timer pin output remains selected by PINSEL - */ -#define FLEXIO_TIMCTL_PININS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_PININS_SHIFT)) & FLEXIO_TIMCTL_PININS_MASK) - -#define FLEXIO_TIMCTL_PINPOL_MASK (0x80U) -#define FLEXIO_TIMCTL_PINPOL_SHIFT (7U) -/*! PINPOL - Timer Pin Polarity - * 0b0..Active high - * 0b1..Active low - */ -#define FLEXIO_TIMCTL_PINPOL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_PINPOL_SHIFT)) & FLEXIO_TIMCTL_PINPOL_MASK) - -#define FLEXIO_TIMCTL_PINSEL_MASK (0x1F00U) -#define FLEXIO_TIMCTL_PINSEL_SHIFT (8U) -/*! PINSEL - Timer Pin Select */ -#define FLEXIO_TIMCTL_PINSEL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_PINSEL_SHIFT)) & FLEXIO_TIMCTL_PINSEL_MASK) - -#define FLEXIO_TIMCTL_PINCFG_MASK (0x30000U) -#define FLEXIO_TIMCTL_PINCFG_SHIFT (16U) -/*! PINCFG - Timer Pin Configuration - * 0b00..Timer pin output disabled - * 0b01..Timer pin open-drain or bidirectional output enable - * 0b10..Timer pin bidirectional output data - * 0b11..Timer pin output - */ -#define FLEXIO_TIMCTL_PINCFG(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_PINCFG_SHIFT)) & FLEXIO_TIMCTL_PINCFG_MASK) - -#define FLEXIO_TIMCTL_TRGSRC_MASK (0x400000U) -#define FLEXIO_TIMCTL_TRGSRC_SHIFT (22U) -/*! TRGSRC - Trigger Source - * 0b0..External - * 0b1..Internal - */ -#define FLEXIO_TIMCTL_TRGSRC(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_TRGSRC_SHIFT)) & FLEXIO_TIMCTL_TRGSRC_MASK) - -#define FLEXIO_TIMCTL_TRGPOL_MASK (0x800000U) -#define FLEXIO_TIMCTL_TRGPOL_SHIFT (23U) -/*! TRGPOL - Trigger Polarity - * 0b0..Active high - * 0b1..Active low - */ -#define FLEXIO_TIMCTL_TRGPOL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_TRGPOL_SHIFT)) & FLEXIO_TIMCTL_TRGPOL_MASK) - -#define FLEXIO_TIMCTL_TRGSEL_MASK (0x3F000000U) -#define FLEXIO_TIMCTL_TRGSEL_SHIFT (24U) -/*! TRGSEL - Trigger Select */ -#define FLEXIO_TIMCTL_TRGSEL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_TRGSEL_SHIFT)) & FLEXIO_TIMCTL_TRGSEL_MASK) -/*! @} */ - -/* The count of FLEXIO_TIMCTL */ -#define FLEXIO_TIMCTL_COUNT (8U) - -/*! @name TIMCFG - Timer Configuration */ -/*! @{ */ - -#define FLEXIO_TIMCFG_TSTART_MASK (0x2U) -#define FLEXIO_TIMCFG_TSTART_SHIFT (1U) -/*! TSTART - Timer Start - * 0b0..Disabled - * 0b1..Enabled - */ -#define FLEXIO_TIMCFG_TSTART(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TSTART_SHIFT)) & FLEXIO_TIMCFG_TSTART_MASK) - -#define FLEXIO_TIMCFG_TSTOP_MASK (0x30U) -#define FLEXIO_TIMCFG_TSTOP_SHIFT (4U) -/*! TSTOP - Timer Stop - * 0b00..Disabled - * 0b01..Enabled on timer compare - * 0b10..Enabled on timer disable - * 0b11..Enabled on timer compare and timer disable - */ -#define FLEXIO_TIMCFG_TSTOP(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TSTOP_SHIFT)) & FLEXIO_TIMCFG_TSTOP_MASK) - -#define FLEXIO_TIMCFG_TIMENA_MASK (0x700U) -#define FLEXIO_TIMCFG_TIMENA_SHIFT (8U) -/*! TIMENA - Timer Enable - * 0b000..Timer always enabled - * 0b001..Timer enabled on timer n-1 enable - * 0b010..Timer enabled on trigger high - * 0b011..Timer enabled on trigger high and pin high - * 0b100..Timer enabled on pin rising edge - * 0b101..Timer enabled on pin rising edge and trigger high - * 0b110..Timer enabled on trigger rising edge - * 0b111..Timer enabled on trigger rising or falling edge - */ -#define FLEXIO_TIMCFG_TIMENA(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TIMENA_SHIFT)) & FLEXIO_TIMCFG_TIMENA_MASK) - -#define FLEXIO_TIMCFG_TIMDIS_MASK (0x7000U) -#define FLEXIO_TIMCFG_TIMDIS_SHIFT (12U) -/*! TIMDIS - Timer Disable - * 0b000..Timer never disabled - * 0b001..Timer disabled on timer n-1 disable - * 0b010..Timer disabled on timer compare (upper 8 bits match and decrement) - * 0b011..Timer disabled on timer compare (upper 8 bits match and decrement) and trigger low - * 0b100..Timer disabled on pin rising or falling edge - * 0b101..Timer disabled on pin rising or falling edge provided trigger is high - * 0b110..Timer disabled on trigger falling edge - * 0b111..Reserved - */ -#define FLEXIO_TIMCFG_TIMDIS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TIMDIS_SHIFT)) & FLEXIO_TIMCFG_TIMDIS_MASK) - -#define FLEXIO_TIMCFG_TIMRST_MASK (0x70000U) -#define FLEXIO_TIMCFG_TIMRST_SHIFT (16U) -/*! TIMRST - Timer Reset - * 0b000..Never reset timer - * 0b001..Timer reset on timer output high. - * 0b010..Timer reset on timer pin equal to timer output - * 0b011..Timer reset on timer trigger equal to timer output - * 0b100..Timer reset on timer pin rising edge - * 0b101..Reserved - * 0b110..Timer reset on trigger rising edge - * 0b111..Timer reset on trigger rising or falling edge - */ -#define FLEXIO_TIMCFG_TIMRST(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TIMRST_SHIFT)) & FLEXIO_TIMCFG_TIMRST_MASK) - -#define FLEXIO_TIMCFG_TIMDEC_MASK (0x700000U) -#define FLEXIO_TIMCFG_TIMDEC_SHIFT (20U) -/*! TIMDEC - Timer Decrement - * 0b000..Decrement counter on FLEXIO clock; shift clock equals timer output - * 0b001..Decrement counter on trigger input (both edges); shift clock equals timer output - * 0b010..Decrement counter on pin input (both edges); shift clock equals pin input - * 0b011..Decrement counter on trigger input (both edges); shift clock equals trigger input - * 0b100..Decrement counter on FLEXIO clock divided by 16; shift clock equals timer output - * 0b101..Decrement counter on FLEXIO clock divided by 256; shift clock equals timer output - * 0b110..Decrement counter on pin input (rising edge); shift clock equals pin input - * 0b111..Decrement counter on trigger input (rising edge); shift clock equals trigger input - */ -#define FLEXIO_TIMCFG_TIMDEC(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TIMDEC_SHIFT)) & FLEXIO_TIMCFG_TIMDEC_MASK) - -#define FLEXIO_TIMCFG_TIMOUT_MASK (0x3000000U) -#define FLEXIO_TIMCFG_TIMOUT_SHIFT (24U) -/*! TIMOUT - Timer Output - * 0b00..Logic one when enabled; not affected by timer reset - * 0b01..Logic zero when enabled; not affected by timer reset - * 0b10..Logic one when enabled and on timer reset - * 0b11..Logic zero when enabled and on timer reset - */ -#define FLEXIO_TIMCFG_TIMOUT(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TIMOUT_SHIFT)) & FLEXIO_TIMCFG_TIMOUT_MASK) -/*! @} */ - -/* The count of FLEXIO_TIMCFG */ -#define FLEXIO_TIMCFG_COUNT (8U) - -/*! @name TIMCMP - Timer Compare */ -/*! @{ */ - -#define FLEXIO_TIMCMP_CMP_MASK (0xFFFFU) -#define FLEXIO_TIMCMP_CMP_SHIFT (0U) -/*! CMP - Timer Compare Value */ -#define FLEXIO_TIMCMP_CMP(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCMP_CMP_SHIFT)) & FLEXIO_TIMCMP_CMP_MASK) -/*! @} */ - -/* The count of FLEXIO_TIMCMP */ -#define FLEXIO_TIMCMP_COUNT (8U) - -/*! @name SHIFTBUFNBS - Shifter Buffer Nibble Byte Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFNBS_SHIFTBUFNBS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFNBS_SHIFTBUFNBS_SHIFT (0U) -/*! SHIFTBUFNBS - Shift Buffer */ -#define FLEXIO_SHIFTBUFNBS_SHIFTBUFNBS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFNBS_SHIFTBUFNBS_SHIFT)) & FLEXIO_SHIFTBUFNBS_SHIFTBUFNBS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFNBS */ -#define FLEXIO_SHIFTBUFNBS_COUNT (8U) - -/*! @name SHIFTBUFHWS - Shifter Buffer Halfword Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFHWS_SHIFTBUFHWS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFHWS_SHIFTBUFHWS_SHIFT (0U) -/*! SHIFTBUFHWS - Shift Buffer */ -#define FLEXIO_SHIFTBUFHWS_SHIFTBUFHWS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFHWS_SHIFTBUFHWS_SHIFT)) & FLEXIO_SHIFTBUFHWS_SHIFTBUFHWS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFHWS */ -#define FLEXIO_SHIFTBUFHWS_COUNT (8U) - -/*! @name SHIFTBUFNIS - Shifter Buffer Nibble Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFNIS_SHIFTBUFNIS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFNIS_SHIFTBUFNIS_SHIFT (0U) -/*! SHIFTBUFNIS - Shift Buffer */ -#define FLEXIO_SHIFTBUFNIS_SHIFTBUFNIS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFNIS_SHIFTBUFNIS_SHIFT)) & FLEXIO_SHIFTBUFNIS_SHIFTBUFNIS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFNIS */ -#define FLEXIO_SHIFTBUFNIS_COUNT (8U) - -/*! @name SHIFTBUFOES - Shifter Buffer Odd Even Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFOES_SHIFTBUFOES_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFOES_SHIFTBUFOES_SHIFT (0U) -/*! SHIFTBUFOES - Shift Buffer */ -#define FLEXIO_SHIFTBUFOES_SHIFTBUFOES(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFOES_SHIFTBUFOES_SHIFT)) & FLEXIO_SHIFTBUFOES_SHIFTBUFOES_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFOES */ -#define FLEXIO_SHIFTBUFOES_COUNT (8U) - -/*! @name SHIFTBUFEOS - Shifter Buffer Even Odd Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFEOS_SHIFTBUFEOS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFEOS_SHIFTBUFEOS_SHIFT (0U) -/*! SHIFTBUFEOS - Shift Buffer */ -#define FLEXIO_SHIFTBUFEOS_SHIFTBUFEOS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFEOS_SHIFTBUFEOS_SHIFT)) & FLEXIO_SHIFTBUFEOS_SHIFTBUFEOS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFEOS */ -#define FLEXIO_SHIFTBUFEOS_COUNT (8U) - -/*! @name SHIFTBUFHBS - Shifter Buffer Halfword Byte Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFHBS_SHIFTBUFHBS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFHBS_SHIFTBUFHBS_SHIFT (0U) -/*! SHIFTBUFHBS - Shift Buffer */ -#define FLEXIO_SHIFTBUFHBS_SHIFTBUFHBS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFHBS_SHIFTBUFHBS_SHIFT)) & FLEXIO_SHIFTBUFHBS_SHIFTBUFHBS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFHBS */ -#define FLEXIO_SHIFTBUFHBS_COUNT (8U) - - -/*! - * @} - */ /* end of group FLEXIO_Register_Masks */ - - -/* FLEXIO - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral FLEXIO0 base address */ - #define FLEXIO0_BASE (0x50105000u) - /** Peripheral FLEXIO0 base address */ - #define FLEXIO0_BASE_NS (0x40105000u) - /** Peripheral FLEXIO0 base pointer */ - #define FLEXIO0 ((FLEXIO_Type *)FLEXIO0_BASE) - /** Peripheral FLEXIO0 base pointer */ - #define FLEXIO0_NS ((FLEXIO_Type *)FLEXIO0_BASE_NS) - /** Array initializer of FLEXIO peripheral base addresses */ - #define FLEXIO_BASE_ADDRS { FLEXIO0_BASE } - /** Array initializer of FLEXIO peripheral base pointers */ - #define FLEXIO_BASE_PTRS { FLEXIO0 } - /** Array initializer of FLEXIO peripheral base addresses */ - #define FLEXIO_BASE_ADDRS_NS { FLEXIO0_BASE_NS } - /** Array initializer of FLEXIO peripheral base pointers */ - #define FLEXIO_BASE_PTRS_NS { FLEXIO0_NS } -#else - /** Peripheral FLEXIO0 base address */ - #define FLEXIO0_BASE (0x40105000u) - /** Peripheral FLEXIO0 base pointer */ - #define FLEXIO0 ((FLEXIO_Type *)FLEXIO0_BASE) - /** Array initializer of FLEXIO peripheral base addresses */ - #define FLEXIO_BASE_ADDRS { FLEXIO0_BASE } - /** Array initializer of FLEXIO peripheral base pointers */ - #define FLEXIO_BASE_PTRS { FLEXIO0 } -#endif -/** Interrupt vectors for the FLEXIO peripheral type */ -#define FLEXIO_IRQS { FLEXIO_IRQn } - -/*! - * @} - */ /* end of group FLEXIO_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- FLEXSPI Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FLEXSPI_Peripheral_Access_Layer FLEXSPI Peripheral Access Layer - * @{ - */ - -/** FLEXSPI - Register Layout Typedef */ -typedef struct { - __IO uint32_t MCR0; /**< Module Control 0, offset: 0x0 */ - __IO uint32_t MCR1; /**< Module Control 1, offset: 0x4 */ - __IO uint32_t MCR2; /**< Module Control 2, offset: 0x8 */ - __IO uint32_t AHBCR; /**< AHB Bus Control, offset: 0xC */ - __IO uint32_t INTEN; /**< Interrupt Enable, offset: 0x10 */ - __IO uint32_t INTR; /**< Interrupt, offset: 0x14 */ - __IO uint32_t LUTKEY; /**< LUT Key, offset: 0x18 */ - __IO uint32_t LUTCR; /**< LUT Control, offset: 0x1C */ - __IO uint32_t AHBRXBUFCR0[8]; /**< AHB Receive Buffer 0 Control 0..AHB Receive Buffer 7 Control 0, array offset: 0x20, array step: 0x4 */ - uint8_t RESERVED_0[32]; - __IO uint32_t FLSHCR0[4]; /**< Flash Control 0, array offset: 0x60, array step: 0x4 */ - __IO uint32_t FLSHCR1[4]; /**< Flash Control 1, array offset: 0x70, array step: 0x4 */ - __IO uint32_t FLSHCR2[4]; /**< Flash Control 2, array offset: 0x80, array step: 0x4 */ - uint8_t RESERVED_1[4]; - __IO uint32_t FLSHCR4; /**< Flash Control 4, offset: 0x94 */ - uint8_t RESERVED_2[8]; - __IO uint32_t IPCR0; /**< IP Control 0, offset: 0xA0 */ - __IO uint32_t IPCR1; /**< IP Control 1, offset: 0xA4 */ - __IO uint32_t IPCR2; /**< IP Control 2, offset: 0xA8 */ - uint8_t RESERVED_3[4]; - __O uint32_t IPCMD; /**< IP Command, offset: 0xB0 */ - __IO uint32_t DLPR; /**< Data Learning Pattern, offset: 0xB4 */ - __IO uint32_t IPRXFCR; /**< IP Receive FIFO Control, offset: 0xB8 */ - __IO uint32_t IPTXFCR; /**< IP Transmit FIFO Control, offset: 0xBC */ - __IO uint32_t DLLCR[2]; /**< DLL Control 0, array offset: 0xC0, array step: 0x4 */ - uint8_t RESERVED_4[24]; - __I uint32_t STS0; /**< Status 0, offset: 0xE0 */ - __I uint32_t STS1; /**< Status 1, offset: 0xE4 */ - __I uint32_t STS2; /**< Status 2, offset: 0xE8 */ - __I uint32_t AHBSPNDSTS; /**< AHB Suspend Status, offset: 0xEC */ - __I uint32_t IPRXFSTS; /**< IP Receive FIFO Status, offset: 0xF0 */ - __I uint32_t IPTXFSTS; /**< IP Transmit FIFO Status, offset: 0xF4 */ - uint8_t RESERVED_5[8]; - __I uint32_t RFDR[32]; /**< IP Receive FIFO Data 0..IP Receive FIFO Data 31, array offset: 0x100, array step: 0x4 */ - __O uint32_t TFDR[32]; /**< IP TX FIFO Data 0..IP TX FIFO Data 31, array offset: 0x180, array step: 0x4 */ - __IO uint32_t LUT[64]; /**< Lookup Table 0..Lookup Table 63, array offset: 0x200, array step: 0x4 */ - uint8_t RESERVED_6[288]; - __IO uint32_t HADDRSTART; /**< HADDR REMAP Start Address, offset: 0x420 */ - __IO uint32_t HADDREND; /**< HADDR REMAP END ADDR, offset: 0x424 */ - __IO uint32_t HADDROFFSET; /**< HADDR Remap Offset, offset: 0x428 */ - __IO uint32_t IPEDCTRL; /**< IPED Function Control, offset: 0x42C */ - __IO uint32_t IPSNSZSTART0; /**< IPS Nonsecure Region 0 Start Address, offset: 0x430 */ - __IO uint32_t IPSNSZEND0; /**< IPS Nonsecure Region 0 End Address, offset: 0x434 */ - __IO uint32_t IPSNSZSTART1; /**< IPS Nonsecure Region 1 Start Address, offset: 0x438 */ - __IO uint32_t IPSNSZEND1; /**< IPS Nonsecure Region 1 End Address, offset: 0x43C */ - __IO uint32_t AHBBUFREGIONSTART0; /**< Receive Buffer Start Address of Region 0, offset: 0x440 */ - __IO uint32_t AHBBUFREGIONEND0; /**< Receive Buffer Region 0 End Address, offset: 0x444 */ - __IO uint32_t AHBBUFREGIONSTART1; /**< Receive Buffer Start Address of Region 1, offset: 0x448 */ - __IO uint32_t AHBBUFREGIONEND1; /**< Receive Buffer Region 1 End Address, offset: 0x44C */ - __IO uint32_t AHBBUFREGIONSTART2; /**< Receive Buffer Start Address of Region 2, offset: 0x450 */ - __IO uint32_t AHBBUFREGIONEND2; /**< Receive Buffer Region 2 End Address, offset: 0x454 */ - __IO uint32_t AHBBUFREGIONSTART3; /**< Receive Buffer Start Address of Region 3, offset: 0x458 */ - __IO uint32_t AHBBUFREGIONEND3; /**< Receive Buffer Region 3 End Address, offset: 0x45C */ - uint8_t RESERVED_7[160]; - __IO uint32_t IPEDCTXCTRL[2]; /**< IPED context control 0..IPED context control 1, array offset: 0x500, array step: 0x4 */ - uint8_t RESERVED_8[24]; - __IO uint32_t IPEDCTX0IV0; /**< IPED Context0 IV0, offset: 0x520 */ - __IO uint32_t IPEDCTX0IV1; /**< IPED Context0 IV1, offset: 0x524 */ - __IO uint32_t IPEDCTX0START; /**< Start Address of Region, offset: 0x528 */ - __IO uint32_t IPEDCTX0END; /**< End Address of Region, offset: 0x52C */ - __IO uint32_t IPEDCTX0AAD0; /**< IPED Context0 Additional Authenticated Data0, offset: 0x530 */ - __IO uint32_t IPEDCTX0AAD1; /**< IPED Context0 Additional Authenticated Data1, offset: 0x534 */ - uint8_t RESERVED_9[8]; - __IO uint32_t IPEDCTX1IV0; /**< IPED Context1 IV0, offset: 0x540 */ - __IO uint32_t IPEDCTX1IV1; /**< IPED Context1 IV1, offset: 0x544 */ - __IO uint32_t IPEDCTX1START; /**< Start Address of Region, offset: 0x548 */ - __IO uint32_t IPEDCTX1END; /**< End Address of Region, offset: 0x54C */ - __IO uint32_t IPEDCTX1AAD0; /**< IPED Context1 Additional Authenticated Data0, offset: 0x550 */ - __IO uint32_t IPEDCTX1AAD1; /**< IPED Context1 Additional Authenticated Data1, offset: 0x554 */ - uint8_t RESERVED_10[8]; - __IO uint32_t IPEDCTX2IV0; /**< IPED Context2 IV0, offset: 0x560 */ - __IO uint32_t IPEDCTX2IV1; /**< IPED Context2 IV1, offset: 0x564 */ - __IO uint32_t IPEDCTX2START; /**< Start Address of Region, offset: 0x568 */ - __IO uint32_t IPEDCTX2END; /**< End Address of Region, offset: 0x56C */ - __IO uint32_t IPEDCTX2AAD0; /**< IPED Context2 Additional Authenticated Data0, offset: 0x570 */ - __IO uint32_t IPEDCTX2AAD1; /**< IPED Context2 Additional Authenticated Data1, offset: 0x574 */ - uint8_t RESERVED_11[8]; - __IO uint32_t IPEDCTX3IV0; /**< IPED Context3 IV0, offset: 0x580 */ - __IO uint32_t IPEDCTX3IV1; /**< IPED Context3 IV1, offset: 0x584 */ - __IO uint32_t IPEDCTX3START; /**< Start Address of Region, offset: 0x588 */ - __IO uint32_t IPEDCTX3END; /**< End Address of Region, offset: 0x58C */ - __IO uint32_t IPEDCTX3AAD0; /**< IPED Context3 Additional Authenticated Data0, offset: 0x590 */ - __IO uint32_t IPEDCTX3AAD1; /**< IPED Context3 Additional Authenticated Data1, offset: 0x594 */ - uint8_t RESERVED_12[8]; - __IO uint32_t IPEDCTX4IV0; /**< IPED Context4 IV0, offset: 0x5A0 */ - __IO uint32_t IPEDCTX4IV1; /**< IPED Context4 IV1, offset: 0x5A4 */ - __IO uint32_t IPEDCTX4START; /**< Start Address of Region, offset: 0x5A8 */ - __IO uint32_t IPEDCTX4END; /**< End Address of Region, offset: 0x5AC */ - __IO uint32_t IPEDCTX4AAD0; /**< IPED Context4 Additional Authenticated Data0, offset: 0x5B0 */ - __IO uint32_t IPEDCTX4AAD1; /**< IPED Context4 Additional Authenticated Data1, offset: 0x5B4 */ - uint8_t RESERVED_13[8]; - __IO uint32_t IPEDCTX5IV0; /**< IPED Context5 IV0, offset: 0x5C0 */ - __IO uint32_t IPEDCTX5IV1; /**< IPED Context5 IV1, offset: 0x5C4 */ - __IO uint32_t IPEDCTX5START; /**< Start Address of Region, offset: 0x5C8 */ - __IO uint32_t IPEDCTX5END; /**< End Address of Region, offset: 0x5CC */ - __IO uint32_t IPEDCTX5AAD0; /**< IPED Context5 Additional Authenticated Data0, offset: 0x5D0 */ - __IO uint32_t IPEDCTX5AAD1; /**< IPED Context5 Additional Authenticated Data1, offset: 0x5D4 */ - uint8_t RESERVED_14[8]; - __IO uint32_t IPEDCTX6IV0; /**< IPED Context6 IV0, offset: 0x5E0 */ - __IO uint32_t IPEDCTX6IV1; /**< IPED Context6 IV1, offset: 0x5E4 */ - __IO uint32_t IPEDCTX6START; /**< Start Address of Region, offset: 0x5E8 */ - __IO uint32_t IPEDCTX6END; /**< End Address of Region, offset: 0x5EC */ - __IO uint32_t IPEDCTX6AAD0; /**< IPED Context6 Additional Authenticated Data0, offset: 0x5F0 */ - __IO uint32_t IPEDCTX6AAD1; /**< IPED Context6 Additional Authenticated Data1, offset: 0x5F4 */ -} FLEXSPI_Type; - -/* ---------------------------------------------------------------------------- - -- FLEXSPI Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FLEXSPI_Register_Masks FLEXSPI Register Masks - * @{ - */ - -/*! @name MCR0 - Module Control 0 */ -/*! @{ */ - -#define FLEXSPI_MCR0_SWRESET_MASK (0x1U) -#define FLEXSPI_MCR0_SWRESET_SHIFT (0U) -/*! SWRESET - Software Reset - * 0b0..No impact - * 0b1..Software reset - */ -#define FLEXSPI_MCR0_SWRESET(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR0_SWRESET_SHIFT)) & FLEXSPI_MCR0_SWRESET_MASK) - -#define FLEXSPI_MCR0_MDIS_MASK (0x2U) -#define FLEXSPI_MCR0_MDIS_SHIFT (1U) -/*! MDIS - Module Disable - * 0b0..No impact - * 0b1..Module disable - */ -#define FLEXSPI_MCR0_MDIS(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR0_MDIS_SHIFT)) & FLEXSPI_MCR0_MDIS_MASK) - -#define FLEXSPI_MCR0_RXCLKSRC_MASK (0x30U) -#define FLEXSPI_MCR0_RXCLKSRC_SHIFT (4U) -/*! RXCLKSRC - Sample Clock Source for Flash Reading - * 0b00..Dummy Read strobe that FlexSPI generates, looped back internally - * 0b01..Dummy Read strobe that FlexSPI generates, looped back from DQS pad - * 0b10..SCLK output clock and looped back from SCLK pad - * 0b11..Flash-memory-provided read strobe and input from DQS pad - */ -#define FLEXSPI_MCR0_RXCLKSRC(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR0_RXCLKSRC_SHIFT)) & FLEXSPI_MCR0_RXCLKSRC_MASK) - -#define FLEXSPI_MCR0_ARDFEN_MASK (0x40U) -#define FLEXSPI_MCR0_ARDFEN_SHIFT (6U) -/*! ARDFEN - AHB Read Access to IP Receive FIFO Enable - * 0b0..AHB read access disabled. IP bus reads IP receive FIFO. AHB Bus read access to IP receive FIFO memory space produces bus error. - * 0b1..AHB read access enabled. AHB bus reads IP receive FIFO. IP Bus read access to IP receive FIFO memory - * space returns data zero and causes no bus error. - */ -#define FLEXSPI_MCR0_ARDFEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR0_ARDFEN_SHIFT)) & FLEXSPI_MCR0_ARDFEN_MASK) - -#define FLEXSPI_MCR0_ATDFEN_MASK (0x80U) -#define FLEXSPI_MCR0_ATDFEN_SHIFT (7U) -/*! ATDFEN - AHB Write Access to IP Transmit FIFO Enable - * 0b0..AHB write access disabled. IP bus writes to IP transmit FIFO. AHB bus write access to IP transmit FIFO memory space produces bus error. - * 0b1..AHB write access enabled. AHB bus writes to IP transmit FIFO. IP Bus write access to IP transmit FIFO - * memory space is ignored and causes no bus error. - */ -#define FLEXSPI_MCR0_ATDFEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR0_ATDFEN_SHIFT)) & FLEXSPI_MCR0_ATDFEN_MASK) - -#define FLEXSPI_MCR0_SERCLKDIV_MASK (0x700U) -#define FLEXSPI_MCR0_SERCLKDIV_SHIFT (8U) -/*! SERCLKDIV - Serial Root Clock Divider - * 0b000..Divided by 1 - * 0b001..Divided by 2 - * 0b010..Divided by 3 - * 0b011..Divided by 4 - * 0b100..Divided by 5 - * 0b101..Divided by 6 - * 0b110..Divided by 7 - * 0b111..Divided by 8 - */ -#define FLEXSPI_MCR0_SERCLKDIV(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR0_SERCLKDIV_SHIFT)) & FLEXSPI_MCR0_SERCLKDIV_MASK) - -#define FLEXSPI_MCR0_HSEN_MASK (0x800U) -#define FLEXSPI_MCR0_HSEN_SHIFT (11U) -/*! HSEN - Half Speed Serial Flash Memory Access Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_MCR0_HSEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR0_HSEN_SHIFT)) & FLEXSPI_MCR0_HSEN_MASK) - -#define FLEXSPI_MCR0_DOZEEN_MASK (0x1000U) -#define FLEXSPI_MCR0_DOZEEN_SHIFT (12U) -/*! DOZEEN - Doze Mode Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_MCR0_DOZEEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR0_DOZEEN_SHIFT)) & FLEXSPI_MCR0_DOZEEN_MASK) - -#define FLEXSPI_MCR0_COMBINATIONEN_MASK (0x2000U) -#define FLEXSPI_MCR0_COMBINATIONEN_SHIFT (13U) -/*! COMBINATIONEN - Combination Mode Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_MCR0_COMBINATIONEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR0_COMBINATIONEN_SHIFT)) & FLEXSPI_MCR0_COMBINATIONEN_MASK) - -#define FLEXSPI_MCR0_SCKFREERUNEN_MASK (0x4000U) -#define FLEXSPI_MCR0_SCKFREERUNEN_SHIFT (14U) -/*! SCKFREERUNEN - SCLK Free-running Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_MCR0_SCKFREERUNEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR0_SCKFREERUNEN_SHIFT)) & FLEXSPI_MCR0_SCKFREERUNEN_MASK) - -#define FLEXSPI_MCR0_LEARNEN_MASK (0x8000U) -#define FLEXSPI_MCR0_LEARNEN_SHIFT (15U) -/*! LEARNEN - Data Learning Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_MCR0_LEARNEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR0_LEARNEN_SHIFT)) & FLEXSPI_MCR0_LEARNEN_MASK) - -#define FLEXSPI_MCR0_IPGRANTWAIT_MASK (0xFF0000U) -#define FLEXSPI_MCR0_IPGRANTWAIT_SHIFT (16U) -/*! IPGRANTWAIT - Timeout Wait Cycle for IP Command Grant */ -#define FLEXSPI_MCR0_IPGRANTWAIT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR0_IPGRANTWAIT_SHIFT)) & FLEXSPI_MCR0_IPGRANTWAIT_MASK) - -#define FLEXSPI_MCR0_AHBGRANTWAIT_MASK (0xFF000000U) -#define FLEXSPI_MCR0_AHBGRANTWAIT_SHIFT (24U) -/*! AHBGRANTWAIT - Timeouts Wait Cycle for AHB command Grant */ -#define FLEXSPI_MCR0_AHBGRANTWAIT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR0_AHBGRANTWAIT_SHIFT)) & FLEXSPI_MCR0_AHBGRANTWAIT_MASK) -/*! @} */ - -/*! @name MCR1 - Module Control 1 */ -/*! @{ */ - -#define FLEXSPI_MCR1_AHBBUSWAIT_MASK (0xFFFFU) -#define FLEXSPI_MCR1_AHBBUSWAIT_SHIFT (0U) -/*! AHBBUSWAIT - AHB Bus Wait */ -#define FLEXSPI_MCR1_AHBBUSWAIT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR1_AHBBUSWAIT_SHIFT)) & FLEXSPI_MCR1_AHBBUSWAIT_MASK) - -#define FLEXSPI_MCR1_SEQWAIT_MASK (0xFFFF0000U) -#define FLEXSPI_MCR1_SEQWAIT_SHIFT (16U) -/*! SEQWAIT - Command Sequence Wait */ -#define FLEXSPI_MCR1_SEQWAIT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR1_SEQWAIT_SHIFT)) & FLEXSPI_MCR1_SEQWAIT_MASK) -/*! @} */ - -/*! @name MCR2 - Module Control 2 */ -/*! @{ */ - -#define FLEXSPI_MCR2_CLRAHBBUFOPT_MASK (0x800U) -#define FLEXSPI_MCR2_CLRAHBBUFOPT_SHIFT (11U) -/*! CLRAHBBUFOPT - Clear AHB Buffer - * 0b0..Not cleared automatically - * 0b1..Cleared automatically - */ -#define FLEXSPI_MCR2_CLRAHBBUFOPT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR2_CLRAHBBUFOPT_SHIFT)) & FLEXSPI_MCR2_CLRAHBBUFOPT_MASK) - -#define FLEXSPI_MCR2_CLRLEARNPHASE_MASK (0x4000U) -#define FLEXSPI_MCR2_CLRLEARNPHASE_SHIFT (14U) -/*! CLRLEARNPHASE - Clear Learn Phase Selection - * 0b0..No impact - * 0b1..Reset sample clock phase selection to 0 - */ -#define FLEXSPI_MCR2_CLRLEARNPHASE(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR2_CLRLEARNPHASE_SHIFT)) & FLEXSPI_MCR2_CLRLEARNPHASE_MASK) - -#define FLEXSPI_MCR2_SAMEDEVICEEN_MASK (0x8000U) -#define FLEXSPI_MCR2_SAMEDEVICEEN_SHIFT (15U) -/*! SAMEDEVICEEN - Same Device Enable - * 0b0..In Individual mode, FLSHA1CRx and FLSHA2CRx, FLSHB1CRx and FLSHB2CRx settings are applied to Flash A1, - * A2, B1, B2 separately. In Parallel mode, FLSHA1CRx register setting is applied to Flash A1 and B1, FLSHA2CRx - * register setting is applied to Flash A2 and B2. FLSHB1CRx and FLSHB2CRx register settings are ignored. - * 0b1..FLSHA1CR0, FLSHA1CR1, and FLSHA1CR2 register settings are applied to Flash A1, A2, B1, B2. FLSHA2CRx, - * FLSHB1CRx, and FLSHB2CRx settings are ignored. - */ -#define FLEXSPI_MCR2_SAMEDEVICEEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR2_SAMEDEVICEEN_SHIFT)) & FLEXSPI_MCR2_SAMEDEVICEEN_MASK) - -#define FLEXSPI_MCR2_SCKBDIFFOPT_MASK (0x80000U) -#define FLEXSPI_MCR2_SCKBDIFFOPT_SHIFT (19U) -/*! SCKBDIFFOPT - SCLK Port B Differential Output - * 0b1..Use B_SCLK pad as port A SCLK inverted clock output (Differential clock to A_SCLK). Port B flash memory access is not available. - * 0b0..Use B_SCLK pad as port B SCLK clock output. Port B flash memory access is available. - */ -#define FLEXSPI_MCR2_SCKBDIFFOPT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR2_SCKBDIFFOPT_SHIFT)) & FLEXSPI_MCR2_SCKBDIFFOPT_MASK) - -#define FLEXSPI_MCR2_RXCLKSRC_B_MASK (0x600000U) -#define FLEXSPI_MCR2_RXCLKSRC_B_SHIFT (21U) -/*! RXCLKSRC_B - Port B Receiver Clock Source - * 0b00..Dummy read strobe that FlexSPI generates, looped back internally. - * 0b01..Dummy read strobe that FlexSPI generates, looped back from DQS pad. - * 0b10..SCLK output clock and looped back from SCLK pad - * 0b11..Flash-memory-provided read strobe and input from DQS pad - */ -#define FLEXSPI_MCR2_RXCLKSRC_B(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR2_RXCLKSRC_B_SHIFT)) & FLEXSPI_MCR2_RXCLKSRC_B_MASK) - -#define FLEXSPI_MCR2_RX_CLK_SRC_DIFF_MASK (0x800000U) -#define FLEXSPI_MCR2_RX_CLK_SRC_DIFF_SHIFT (23U) -/*! RX_CLK_SRC_DIFF - Sample Clock Source Different - * 0b0..Use MCR0[RXCLKSRC] for Port A and Port B. MCR2[RXCLKSRC_B] is ignored and MCR0[RXCLKSRC] selects the - * Sample Clock source for Flash Reading of both ports A and B. - * 0b1..Use MCR0[RXCLKSRC] for Port A, and MCR2[RXCLKSRC_B] for Port B. MCR0[RXCLKSRC] selects the Sample Clock - * source for Flash Reading of port A (A_SCLK) and MCR2[RXCLKSRC_B] selects the Sample Clock source for Flash - * Reading of port B (B_SCLK). - */ -#define FLEXSPI_MCR2_RX_CLK_SRC_DIFF(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR2_RX_CLK_SRC_DIFF_SHIFT)) & FLEXSPI_MCR2_RX_CLK_SRC_DIFF_MASK) - -#define FLEXSPI_MCR2_RESUMEWAIT_MASK (0xFF000000U) -#define FLEXSPI_MCR2_RESUMEWAIT_SHIFT (24U) -/*! RESUMEWAIT - Resume Wait Duration */ -#define FLEXSPI_MCR2_RESUMEWAIT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR2_RESUMEWAIT_SHIFT)) & FLEXSPI_MCR2_RESUMEWAIT_MASK) -/*! @} */ - -/*! @name AHBCR - AHB Bus Control */ -/*! @{ */ - -#define FLEXSPI_AHBCR_APAREN_MASK (0x1U) -#define FLEXSPI_AHBCR_APAREN_SHIFT (0U) -/*! APAREN - AHB Parallel Mode Enable - * 0b0..Flash is accessed in Individual mode. - * 0b1..Flash is accessed in Parallel mode. - */ -#define FLEXSPI_AHBCR_APAREN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBCR_APAREN_SHIFT)) & FLEXSPI_AHBCR_APAREN_MASK) - -#define FLEXSPI_AHBCR_CLRAHBRXBUF_MASK (0x2U) -#define FLEXSPI_AHBCR_CLRAHBRXBUF_SHIFT (1U) -/*! CLRAHBRXBUF - Clear AHB Receive Buffer - * 0b0..No impact. - * 0b1..Enable clear operation. - */ -#define FLEXSPI_AHBCR_CLRAHBRXBUF(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBCR_CLRAHBRXBUF_SHIFT)) & FLEXSPI_AHBCR_CLRAHBRXBUF_MASK) - -#define FLEXSPI_AHBCR_CLRAHBTXBUF_MASK (0x4U) -#define FLEXSPI_AHBCR_CLRAHBTXBUF_SHIFT (2U) -/*! CLRAHBTXBUF - Clear AHB Transmit Buffer - * 0b0..No impact. - * 0b1..Enable clear operation. - */ -#define FLEXSPI_AHBCR_CLRAHBTXBUF(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBCR_CLRAHBTXBUF_SHIFT)) & FLEXSPI_AHBCR_CLRAHBTXBUF_MASK) - -#define FLEXSPI_AHBCR_CACHABLEEN_MASK (0x8U) -#define FLEXSPI_AHBCR_CACHABLEEN_SHIFT (3U) -/*! CACHABLEEN - Cacheable Read Access Enable - * 0b0..Disabled. When an AHB bus cacheable read access occurs, FlexSPI does not check whether it hit the AHB transmit buffer. - * 0b1..Enabled. When an AHB bus cacheable read access occurs, FlexSPI first checks whether the access hit the AHB transmit buffer. - */ -#define FLEXSPI_AHBCR_CACHABLEEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBCR_CACHABLEEN_SHIFT)) & FLEXSPI_AHBCR_CACHABLEEN_MASK) - -#define FLEXSPI_AHBCR_BUFFERABLEEN_MASK (0x10U) -#define FLEXSPI_AHBCR_BUFFERABLEEN_SHIFT (4U) -/*! BUFFERABLEEN - Bufferable Write Access Enable - * 0b0..Disabled. For all AHB write accesses (bufferable or nonbufferable), FlexSPI returns AHB Bus Ready after - * transmitting all data and finishing command. - * 0b1..Enabled. For AHB bufferable write access, FlexSPI returns AHB Bus Ready when the arbitrator grants the - * AHB command. FlexSPI does not wait for the AHB command to finish. - */ -#define FLEXSPI_AHBCR_BUFFERABLEEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBCR_BUFFERABLEEN_SHIFT)) & FLEXSPI_AHBCR_BUFFERABLEEN_MASK) - -#define FLEXSPI_AHBCR_PREFETCHEN_MASK (0x20U) -#define FLEXSPI_AHBCR_PREFETCHEN_SHIFT (5U) -/*! PREFETCHEN - AHB Read Prefetch Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_AHBCR_PREFETCHEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBCR_PREFETCHEN_SHIFT)) & FLEXSPI_AHBCR_PREFETCHEN_MASK) - -#define FLEXSPI_AHBCR_READADDROPT_MASK (0x40U) -#define FLEXSPI_AHBCR_READADDROPT_SHIFT (6U) -/*! READADDROPT - AHB Read Address Option - * 0b0..AHB read burst start address alignment is limited when flash memory is accessed in parallel mode or flash is word-addressable. - * 0b1..AHB read burst start address alignment is not limited. FlexSPI fetches more data than the AHB burst requires for address alignment. - */ -#define FLEXSPI_AHBCR_READADDROPT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBCR_READADDROPT_SHIFT)) & FLEXSPI_AHBCR_READADDROPT_MASK) - -#define FLEXSPI_AHBCR_RESUMEDISABLE_MASK (0x80U) -#define FLEXSPI_AHBCR_RESUMEDISABLE_SHIFT (7U) -/*! RESUMEDISABLE - AHB Read Resume Disable - * 0b0..Suspended AHB read prefetch resumes when AHB is IDLE. - * 0b1..Suspended AHB read prefetch does not resume once aborted, - */ -#define FLEXSPI_AHBCR_RESUMEDISABLE(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBCR_RESUMEDISABLE_SHIFT)) & FLEXSPI_AHBCR_RESUMEDISABLE_MASK) - -#define FLEXSPI_AHBCR_READSZALIGN_MASK (0x400U) -#define FLEXSPI_AHBCR_READSZALIGN_SHIFT (10U) -/*! READSZALIGN - AHB Read Size Alignment - * 0b0..Register settings such as PREFETCH_EN determine AHB read size. - * 0b1..AHB read size to up size to 8 bytes aligned, no prefetching - */ -#define FLEXSPI_AHBCR_READSZALIGN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBCR_READSZALIGN_SHIFT)) & FLEXSPI_AHBCR_READSZALIGN_MASK) - -#define FLEXSPI_AHBCR_ALIGNMENT_MASK (0x300000U) -#define FLEXSPI_AHBCR_ALIGNMENT_SHIFT (20U) -/*! ALIGNMENT - AHB Boundary Alignment - * 0b00..No limit - * 0b01..1 KB - * 0b10..512 bytes - * 0b11..256 bytes - */ -#define FLEXSPI_AHBCR_ALIGNMENT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBCR_ALIGNMENT_SHIFT)) & FLEXSPI_AHBCR_ALIGNMENT_MASK) - -#define FLEXSPI_AHBCR_AFLASHBASE_MASK (0xE0000000U) -#define FLEXSPI_AHBCR_AFLASHBASE_SHIFT (29U) -/*! AFLASHBASE - AHB Memory-Mapped Flash Base Address */ -#define FLEXSPI_AHBCR_AFLASHBASE(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBCR_AFLASHBASE_SHIFT)) & FLEXSPI_AHBCR_AFLASHBASE_MASK) -/*! @} */ - -/*! @name INTEN - Interrupt Enable */ -/*! @{ */ - -#define FLEXSPI_INTEN_IPCMDDONEEN_MASK (0x1U) -#define FLEXSPI_INTEN_IPCMDDONEEN_SHIFT (0U) -/*! IPCMDDONEEN - IP-Triggered Command Sequences Execution Finished Interrupt Enable - * 0b0..Disable interrupt or no impact - * 0b1..Enable interrupt - */ -#define FLEXSPI_INTEN_IPCMDDONEEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTEN_IPCMDDONEEN_SHIFT)) & FLEXSPI_INTEN_IPCMDDONEEN_MASK) - -#define FLEXSPI_INTEN_IPCMDGEEN_MASK (0x2U) -#define FLEXSPI_INTEN_IPCMDGEEN_SHIFT (1U) -/*! IPCMDGEEN - IP-Triggered Command Sequences Grant Timeout Interrupt Enable - * 0b0..Disable interrupt or no impact - * 0b1..Enable interrupt - */ -#define FLEXSPI_INTEN_IPCMDGEEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTEN_IPCMDGEEN_SHIFT)) & FLEXSPI_INTEN_IPCMDGEEN_MASK) - -#define FLEXSPI_INTEN_AHBCMDGEEN_MASK (0x4U) -#define FLEXSPI_INTEN_AHBCMDGEEN_SHIFT (2U) -/*! AHBCMDGEEN - AHB-Triggered Command Sequences Grant Timeout Interrupt Enable. - * 0b0..Disable interrupt or no impact - * 0b1..Enable interrupt - */ -#define FLEXSPI_INTEN_AHBCMDGEEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTEN_AHBCMDGEEN_SHIFT)) & FLEXSPI_INTEN_AHBCMDGEEN_MASK) - -#define FLEXSPI_INTEN_IPCMDERREN_MASK (0x8U) -#define FLEXSPI_INTEN_IPCMDERREN_SHIFT (3U) -/*! IPCMDERREN - IP-Triggered Command Sequences Error Detected Interrupt Enable - * 0b0..Disable interrupt or no impact - * 0b1..Enable interrupt - */ -#define FLEXSPI_INTEN_IPCMDERREN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTEN_IPCMDERREN_SHIFT)) & FLEXSPI_INTEN_IPCMDERREN_MASK) - -#define FLEXSPI_INTEN_AHBCMDERREN_MASK (0x10U) -#define FLEXSPI_INTEN_AHBCMDERREN_SHIFT (4U) -/*! AHBCMDERREN - AHB-Triggered Command Sequences Error Detected Interrupt Enable - * 0b0..Disable interrupt or no impact - * 0b1..Enable interrupt - */ -#define FLEXSPI_INTEN_AHBCMDERREN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTEN_AHBCMDERREN_SHIFT)) & FLEXSPI_INTEN_AHBCMDERREN_MASK) - -#define FLEXSPI_INTEN_IPRXWAEN_MASK (0x20U) -#define FLEXSPI_INTEN_IPRXWAEN_SHIFT (5U) -/*! IPRXWAEN - IP Receive FIFO Watermark Available Interrupt Enable - * 0b0..Disable interrupt or no impact - * 0b1..Enable interrupt - */ -#define FLEXSPI_INTEN_IPRXWAEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTEN_IPRXWAEN_SHIFT)) & FLEXSPI_INTEN_IPRXWAEN_MASK) - -#define FLEXSPI_INTEN_IPTXWEEN_MASK (0x40U) -#define FLEXSPI_INTEN_IPTXWEEN_SHIFT (6U) -/*! IPTXWEEN - IP Transmit FIFO Watermark Empty Interrupt Enable - * 0b0..Disable interrupt or no impact - * 0b1..Enable interrupt - */ -#define FLEXSPI_INTEN_IPTXWEEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTEN_IPTXWEEN_SHIFT)) & FLEXSPI_INTEN_IPTXWEEN_MASK) - -#define FLEXSPI_INTEN_DATALEARNFAILEN_MASK (0x80U) -#define FLEXSPI_INTEN_DATALEARNFAILEN_SHIFT (7U) -/*! DATALEARNFAILEN - Data Learning Failed Interrupt Enable - * 0b0..Disable interrupt or no impact - * 0b1..Enable interrupt - */ -#define FLEXSPI_INTEN_DATALEARNFAILEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTEN_DATALEARNFAILEN_SHIFT)) & FLEXSPI_INTEN_DATALEARNFAILEN_MASK) - -#define FLEXSPI_INTEN_SCKSTOPBYRDEN_MASK (0x100U) -#define FLEXSPI_INTEN_SCKSTOPBYRDEN_SHIFT (8U) -/*! SCKSTOPBYRDEN - SCLK Stopped By Read Interrupt Enable - * 0b0..Disable interrupt or no impact - * 0b1..Enable interrupt - */ -#define FLEXSPI_INTEN_SCKSTOPBYRDEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTEN_SCKSTOPBYRDEN_SHIFT)) & FLEXSPI_INTEN_SCKSTOPBYRDEN_MASK) - -#define FLEXSPI_INTEN_SCKSTOPBYWREN_MASK (0x200U) -#define FLEXSPI_INTEN_SCKSTOPBYWREN_SHIFT (9U) -/*! SCKSTOPBYWREN - SCLK Stopped By Write Interrupt Enable - * 0b0..Disable interrupt or no impact - * 0b1..Enable interrupt - */ -#define FLEXSPI_INTEN_SCKSTOPBYWREN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTEN_SCKSTOPBYWREN_SHIFT)) & FLEXSPI_INTEN_SCKSTOPBYWREN_MASK) - -#define FLEXSPI_INTEN_AHBBUSTIMEOUTEN_MASK (0x400U) -#define FLEXSPI_INTEN_AHBBUSTIMEOUTEN_SHIFT (10U) -/*! AHBBUSTIMEOUTEN - AHB Bus Timeout Interrupt Enable - * 0b0..Disable interrupt or no impact - * 0b1..Enable interrupt - */ -#define FLEXSPI_INTEN_AHBBUSTIMEOUTEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTEN_AHBBUSTIMEOUTEN_SHIFT)) & FLEXSPI_INTEN_AHBBUSTIMEOUTEN_MASK) - -#define FLEXSPI_INTEN_SEQTIMEOUTEN_MASK (0x800U) -#define FLEXSPI_INTEN_SEQTIMEOUTEN_SHIFT (11U) -/*! SEQTIMEOUTEN - Sequence execution Timeout Interrupt Enable - * 0b0..Disable interrupt or no impact - * 0b1..Enable interrupt - */ -#define FLEXSPI_INTEN_SEQTIMEOUTEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTEN_SEQTIMEOUTEN_SHIFT)) & FLEXSPI_INTEN_SEQTIMEOUTEN_MASK) - -#define FLEXSPI_INTEN_IPCMDSECUREVIOEN_MASK (0x10000U) -#define FLEXSPI_INTEN_IPCMDSECUREVIOEN_SHIFT (16U) -/*! IPCMDSECUREVIOEN - IP Command Security Violation Interrupt Enable - * 0b0..Disable interrupt or no impact - * 0b1..Enable interrupt - */ -#define FLEXSPI_INTEN_IPCMDSECUREVIOEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTEN_IPCMDSECUREVIOEN_SHIFT)) & FLEXSPI_INTEN_IPCMDSECUREVIOEN_MASK) - -#define FLEXSPI_INTEN_AHBGCMERREN_MASK (0x20000U) -#define FLEXSPI_INTEN_AHBGCMERREN_SHIFT (17U) -/*! AHBGCMERREN - AHB Read GCM Error Interrupt Enable - * 0b0..Disable interrupt or no impact - * 0b1..Enable interrupt - */ -#define FLEXSPI_INTEN_AHBGCMERREN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTEN_AHBGCMERREN_SHIFT)) & FLEXSPI_INTEN_AHBGCMERREN_MASK) -/*! @} */ - -/*! @name INTR - Interrupt */ -/*! @{ */ - -#define FLEXSPI_INTR_IPCMDDONE_MASK (0x1U) -#define FLEXSPI_INTR_IPCMDDONE_SHIFT (0U) -/*! IPCMDDONE - IP-Triggered Command Sequences Execution Finished - * 0b0..Interrupt condition has not occurred - * 0b1..Interrupt condition has occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define FLEXSPI_INTR_IPCMDDONE(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTR_IPCMDDONE_SHIFT)) & FLEXSPI_INTR_IPCMDDONE_MASK) - -#define FLEXSPI_INTR_IPCMDGE_MASK (0x2U) -#define FLEXSPI_INTR_IPCMDGE_SHIFT (1U) -/*! IPCMDGE - IP-Triggered Command Sequences Grant Timeout - * 0b0..Interrupt condition has not occurred - * 0b1..Interrupt condition has occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define FLEXSPI_INTR_IPCMDGE(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTR_IPCMDGE_SHIFT)) & FLEXSPI_INTR_IPCMDGE_MASK) - -#define FLEXSPI_INTR_AHBCMDGE_MASK (0x4U) -#define FLEXSPI_INTR_AHBCMDGE_SHIFT (2U) -/*! AHBCMDGE - AHB-Triggered Command Sequences Grant Timeout - * 0b0..Interrupt condition has not occurred - * 0b1..Interrupt condition has occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define FLEXSPI_INTR_AHBCMDGE(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTR_AHBCMDGE_SHIFT)) & FLEXSPI_INTR_AHBCMDGE_MASK) - -#define FLEXSPI_INTR_IPCMDERR_MASK (0x8U) -#define FLEXSPI_INTR_IPCMDERR_SHIFT (3U) -/*! IPCMDERR - IP-Triggered Command Sequences Error - * 0b0..Interrupt condition has not occurred - * 0b1..Interrupt condition has occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define FLEXSPI_INTR_IPCMDERR(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTR_IPCMDERR_SHIFT)) & FLEXSPI_INTR_IPCMDERR_MASK) - -#define FLEXSPI_INTR_AHBCMDERR_MASK (0x10U) -#define FLEXSPI_INTR_AHBCMDERR_SHIFT (4U) -/*! AHBCMDERR - AHB-Triggered Command Sequences Error - * 0b0..Interrupt condition has not occurred - * 0b1..Interrupt condition has occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define FLEXSPI_INTR_AHBCMDERR(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTR_AHBCMDERR_SHIFT)) & FLEXSPI_INTR_AHBCMDERR_MASK) - -#define FLEXSPI_INTR_IPRXWA_MASK (0x20U) -#define FLEXSPI_INTR_IPRXWA_SHIFT (5U) -/*! IPRXWA - IP Receive FIFO Watermark Available - * 0b0..Interrupt condition has not occurred - * 0b1..Interrupt condition has occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define FLEXSPI_INTR_IPRXWA(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTR_IPRXWA_SHIFT)) & FLEXSPI_INTR_IPRXWA_MASK) - -#define FLEXSPI_INTR_IPTXWE_MASK (0x40U) -#define FLEXSPI_INTR_IPTXWE_SHIFT (6U) -/*! IPTXWE - IP Transmit FIFO Watermark Empty - * 0b0..Interrupt condition has not occurred - * 0b1..Interrupt condition has occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define FLEXSPI_INTR_IPTXWE(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTR_IPTXWE_SHIFT)) & FLEXSPI_INTR_IPTXWE_MASK) - -#define FLEXSPI_INTR_DATALEARNFAIL_MASK (0x80U) -#define FLEXSPI_INTR_DATALEARNFAIL_SHIFT (7U) -/*! DATALEARNFAIL - Data Learning Failed - * 0b0..Interrupt condition has not occurred - * 0b1..Interrupt condition has occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define FLEXSPI_INTR_DATALEARNFAIL(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTR_DATALEARNFAIL_SHIFT)) & FLEXSPI_INTR_DATALEARNFAIL_MASK) - -#define FLEXSPI_INTR_SCKSTOPBYRD_MASK (0x100U) -#define FLEXSPI_INTR_SCKSTOPBYRD_SHIFT (8U) -/*! SCKSTOPBYRD - SCLK Stopped Due To Full Receive FIFO - * 0b0..Interrupt condition has not occurred - * 0b1..Interrupt condition has occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define FLEXSPI_INTR_SCKSTOPBYRD(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTR_SCKSTOPBYRD_SHIFT)) & FLEXSPI_INTR_SCKSTOPBYRD_MASK) - -#define FLEXSPI_INTR_SCKSTOPBYWR_MASK (0x200U) -#define FLEXSPI_INTR_SCKSTOPBYWR_SHIFT (9U) -/*! SCKSTOPBYWR - SCLK Stopped Due To Empty Transmit FIFO - * 0b0..Interrupt condition has not occurred - * 0b1..Interrupt condition has occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define FLEXSPI_INTR_SCKSTOPBYWR(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTR_SCKSTOPBYWR_SHIFT)) & FLEXSPI_INTR_SCKSTOPBYWR_MASK) - -#define FLEXSPI_INTR_AHBBUSTIMEOUT_MASK (0x400U) -#define FLEXSPI_INTR_AHBBUSTIMEOUT_SHIFT (10U) -/*! AHBBUSTIMEOUT - AHB Bus Timeout - * 0b0..Interrupt condition has not occurred - * 0b1..Interrupt condition has occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define FLEXSPI_INTR_AHBBUSTIMEOUT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTR_AHBBUSTIMEOUT_SHIFT)) & FLEXSPI_INTR_AHBBUSTIMEOUT_MASK) - -#define FLEXSPI_INTR_SEQTIMEOUT_MASK (0x800U) -#define FLEXSPI_INTR_SEQTIMEOUT_SHIFT (11U) -/*! SEQTIMEOUT - Sequence Execution Timeout - * 0b0..Interrupt condition has not occurred - * 0b1..Interrupt condition has occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define FLEXSPI_INTR_SEQTIMEOUT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTR_SEQTIMEOUT_SHIFT)) & FLEXSPI_INTR_SEQTIMEOUT_MASK) - -#define FLEXSPI_INTR_IPCMDSECUREVIO_MASK (0x10000U) -#define FLEXSPI_INTR_IPCMDSECUREVIO_SHIFT (16U) -/*! IPCMDSECUREVIO - IP Command Security Violation - * 0b0..Interrupt condition has not occurred - * 0b1..Interrupt condition has occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define FLEXSPI_INTR_IPCMDSECUREVIO(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTR_IPCMDSECUREVIO_SHIFT)) & FLEXSPI_INTR_IPCMDSECUREVIO_MASK) - -#define FLEXSPI_INTR_AHBGCMERR_MASK (0x20000U) -#define FLEXSPI_INTR_AHBGCMERR_SHIFT (17U) -/*! AHBGCMERR - AHB Read GCM Error - * 0b0..Interrupt condition has not occurred - * 0b1..Interrupt condition has occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define FLEXSPI_INTR_AHBGCMERR(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTR_AHBGCMERR_SHIFT)) & FLEXSPI_INTR_AHBGCMERR_MASK) -/*! @} */ - -/*! @name LUTKEY - LUT Key */ -/*! @{ */ - -#define FLEXSPI_LUTKEY_KEY_MASK (0xFFFFFFFFU) -#define FLEXSPI_LUTKEY_KEY_SHIFT (0U) -/*! KEY - LUT Key */ -#define FLEXSPI_LUTKEY_KEY(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_LUTKEY_KEY_SHIFT)) & FLEXSPI_LUTKEY_KEY_MASK) -/*! @} */ - -/*! @name LUTCR - LUT Control */ -/*! @{ */ - -#define FLEXSPI_LUTCR_LOCK_MASK (0x1U) -#define FLEXSPI_LUTCR_LOCK_SHIFT (0U) -/*! LOCK - Lock LUT - * 0b0..LUT is unlocked (LUTCR[UNLOCK] must be 1) - * 0b1..LUT is locked and cannot be written - */ -#define FLEXSPI_LUTCR_LOCK(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_LUTCR_LOCK_SHIFT)) & FLEXSPI_LUTCR_LOCK_MASK) - -#define FLEXSPI_LUTCR_UNLOCK_MASK (0x2U) -#define FLEXSPI_LUTCR_UNLOCK_SHIFT (1U) -/*! UNLOCK - Unlock LUT - * 0b0..LUT is locked (LUTCR[LOCK] must be 1) - * 0b1..LUT is unlocked and can be written - */ -#define FLEXSPI_LUTCR_UNLOCK(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_LUTCR_UNLOCK_SHIFT)) & FLEXSPI_LUTCR_UNLOCK_MASK) - -#define FLEXSPI_LUTCR_PROTECT_MASK (0x4U) -#define FLEXSPI_LUTCR_PROTECT_SHIFT (2U) -/*! PROTECT - LUT Protection - * 0b0..Not protected. All IPS controllers can access LUTCR and LUT memory. - * 0b1..Protected. Only secure IPS controller can change the value of LUTCR and write to LUT memory. - */ -#define FLEXSPI_LUTCR_PROTECT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_LUTCR_PROTECT_SHIFT)) & FLEXSPI_LUTCR_PROTECT_MASK) -/*! @} */ - -/*! @name AHBRXBUFCR0 - AHB Receive Buffer 0 Control 0..AHB Receive Buffer 7 Control 0 */ -/*! @{ */ - -#define FLEXSPI_AHBRXBUFCR0_BUFSZ_MASK (0xFFU) -#define FLEXSPI_AHBRXBUFCR0_BUFSZ_SHIFT (0U) -/*! BUFSZ - AHB Receive Buffer Size */ -#define FLEXSPI_AHBRXBUFCR0_BUFSZ(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBRXBUFCR0_BUFSZ_SHIFT)) & FLEXSPI_AHBRXBUFCR0_BUFSZ_MASK) - -#define FLEXSPI_AHBRXBUFCR0_MSTRID_MASK (0x1F0000U) -#define FLEXSPI_AHBRXBUFCR0_MSTRID_SHIFT (16U) -/*! MSTRID - AHB Controller ID */ -#define FLEXSPI_AHBRXBUFCR0_MSTRID(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBRXBUFCR0_MSTRID_SHIFT)) & FLEXSPI_AHBRXBUFCR0_MSTRID_MASK) - -#define FLEXSPI_AHBRXBUFCR0_PRIORITY_MASK (0x7000000U) -#define FLEXSPI_AHBRXBUFCR0_PRIORITY_SHIFT (24U) -/*! PRIORITY - AHB Controller Read Priority */ -#define FLEXSPI_AHBRXBUFCR0_PRIORITY(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBRXBUFCR0_PRIORITY_SHIFT)) & FLEXSPI_AHBRXBUFCR0_PRIORITY_MASK) - -#define FLEXSPI_AHBRXBUFCR0_REGIONEN_MASK (0x40000000U) -#define FLEXSPI_AHBRXBUFCR0_REGIONEN_SHIFT (30U) -/*! REGIONEN - AHB Receive Buffer Address Region Enable - * 0b0..Disabled. The buffer hit is based on the value of MSTRID only. - * 0b1..Enabled. The buffer hit is based on the value of MSTRID and the address within AHBBUFREGIONSTARTn and AHBREGIONENDn. - */ -#define FLEXSPI_AHBRXBUFCR0_REGIONEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBRXBUFCR0_REGIONEN_SHIFT)) & FLEXSPI_AHBRXBUFCR0_REGIONEN_MASK) - -#define FLEXSPI_AHBRXBUFCR0_PREFETCHEN_MASK (0x80000000U) -#define FLEXSPI_AHBRXBUFCR0_PREFETCHEN_SHIFT (31U) -/*! PREFETCHEN - AHB Read Prefetch Enable - * 0b0..Disabled - * 0b1..Enabled when is enabled. - */ -#define FLEXSPI_AHBRXBUFCR0_PREFETCHEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBRXBUFCR0_PREFETCHEN_SHIFT)) & FLEXSPI_AHBRXBUFCR0_PREFETCHEN_MASK) -/*! @} */ - -/* The count of FLEXSPI_AHBRXBUFCR0 */ -#define FLEXSPI_AHBRXBUFCR0_COUNT (8U) - -/*! @name FLSHCR0 - Flash Control 0 */ -/*! @{ */ - -#define FLEXSPI_FLSHCR0_FLSHSZ_MASK (0x7FFFFFU) -#define FLEXSPI_FLSHCR0_FLSHSZ_SHIFT (0U) -/*! FLSHSZ - Flash Size in KB */ -#define FLEXSPI_FLSHCR0_FLSHSZ(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR0_FLSHSZ_SHIFT)) & FLEXSPI_FLSHCR0_FLSHSZ_MASK) - -#define FLEXSPI_FLSHCR0_ADDRSHIFT_MASK (0x20000000U) -#define FLEXSPI_FLSHCR0_ADDRSHIFT_SHIFT (29U) -/*! ADDRSHIFT - AHB Address Shift Function control - * 0b0..Disabled - * 0b1..Enabled - */ -#define FLEXSPI_FLSHCR0_ADDRSHIFT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR0_ADDRSHIFT_SHIFT)) & FLEXSPI_FLSHCR0_ADDRSHIFT_MASK) - -#define FLEXSPI_FLSHCR0_SPLITWREN_MASK (0x40000000U) -#define FLEXSPI_FLSHCR0_SPLITWREN_SHIFT (30U) -/*! SPLITWREN - AHB Write Access Split Function Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_FLSHCR0_SPLITWREN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR0_SPLITWREN_SHIFT)) & FLEXSPI_FLSHCR0_SPLITWREN_MASK) - -#define FLEXSPI_FLSHCR0_SPLITRDEN_MASK (0x80000000U) -#define FLEXSPI_FLSHCR0_SPLITRDEN_SHIFT (31U) -/*! SPLITRDEN - AHB Read Access Split Function Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_FLSHCR0_SPLITRDEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR0_SPLITRDEN_SHIFT)) & FLEXSPI_FLSHCR0_SPLITRDEN_MASK) -/*! @} */ - -/* The count of FLEXSPI_FLSHCR0 */ -#define FLEXSPI_FLSHCR0_COUNT (4U) - -/*! @name FLSHCR1 - Flash Control 1 */ -/*! @{ */ - -#define FLEXSPI_FLSHCR1_TCSS_MASK (0x1FU) -#define FLEXSPI_FLSHCR1_TCSS_SHIFT (0U) -/*! TCSS - Serial Flash CS Setup Time */ -#define FLEXSPI_FLSHCR1_TCSS(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR1_TCSS_SHIFT)) & FLEXSPI_FLSHCR1_TCSS_MASK) - -#define FLEXSPI_FLSHCR1_TCSH_MASK (0x3E0U) -#define FLEXSPI_FLSHCR1_TCSH_SHIFT (5U) -/*! TCSH - Serial Flash CS Hold Time */ -#define FLEXSPI_FLSHCR1_TCSH(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR1_TCSH_SHIFT)) & FLEXSPI_FLSHCR1_TCSH_MASK) - -#define FLEXSPI_FLSHCR1_WA_MASK (0x400U) -#define FLEXSPI_FLSHCR1_WA_SHIFT (10U) -/*! WA - Word-Addressable - * 0b0..Byte-addressable - * 0b1..Word-addressable - */ -#define FLEXSPI_FLSHCR1_WA(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR1_WA_SHIFT)) & FLEXSPI_FLSHCR1_WA_MASK) - -#define FLEXSPI_FLSHCR1_CAS_MASK (0x7800U) -#define FLEXSPI_FLSHCR1_CAS_SHIFT (11U) -/*! CAS - Column Address Size */ -#define FLEXSPI_FLSHCR1_CAS(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR1_CAS_SHIFT)) & FLEXSPI_FLSHCR1_CAS_MASK) - -#define FLEXSPI_FLSHCR1_CSINTERVALUNIT_MASK (0x8000U) -#define FLEXSPI_FLSHCR1_CSINTERVALUNIT_SHIFT (15U) -/*! CSINTERVALUNIT - Chip Select Interval Unit - * 0b0..1 serial clock cycle - * 0b1..256 serial clock cycles - */ -#define FLEXSPI_FLSHCR1_CSINTERVALUNIT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR1_CSINTERVALUNIT_SHIFT)) & FLEXSPI_FLSHCR1_CSINTERVALUNIT_MASK) - -#define FLEXSPI_FLSHCR1_CSINTERVAL_MASK (0xFFFF0000U) -#define FLEXSPI_FLSHCR1_CSINTERVAL_SHIFT (16U) -/*! CSINTERVAL - Chip Select Interval */ -#define FLEXSPI_FLSHCR1_CSINTERVAL(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR1_CSINTERVAL_SHIFT)) & FLEXSPI_FLSHCR1_CSINTERVAL_MASK) -/*! @} */ - -/* The count of FLEXSPI_FLSHCR1 */ -#define FLEXSPI_FLSHCR1_COUNT (4U) - -/*! @name FLSHCR2 - Flash Control 2 */ -/*! @{ */ - -#define FLEXSPI_FLSHCR2_ARDSEQID_MASK (0xFU) -#define FLEXSPI_FLSHCR2_ARDSEQID_SHIFT (0U) -/*! ARDSEQID - Sequence Index for AHB Read-Triggered Command in LUT */ -#define FLEXSPI_FLSHCR2_ARDSEQID(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR2_ARDSEQID_SHIFT)) & FLEXSPI_FLSHCR2_ARDSEQID_MASK) - -#define FLEXSPI_FLSHCR2_ARDSEQNUM_MASK (0xE0U) -#define FLEXSPI_FLSHCR2_ARDSEQNUM_SHIFT (5U) -/*! ARDSEQNUM - Sequence Number for AHB Read-Triggered Command */ -#define FLEXSPI_FLSHCR2_ARDSEQNUM(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR2_ARDSEQNUM_SHIFT)) & FLEXSPI_FLSHCR2_ARDSEQNUM_MASK) - -#define FLEXSPI_FLSHCR2_AWRSEQID_MASK (0xF00U) -#define FLEXSPI_FLSHCR2_AWRSEQID_SHIFT (8U) -/*! AWRSEQID - Sequence Index for AHB Write-Triggered Command */ -#define FLEXSPI_FLSHCR2_AWRSEQID(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR2_AWRSEQID_SHIFT)) & FLEXSPI_FLSHCR2_AWRSEQID_MASK) - -#define FLEXSPI_FLSHCR2_AWRSEQNUM_MASK (0xE000U) -#define FLEXSPI_FLSHCR2_AWRSEQNUM_SHIFT (13U) -/*! AWRSEQNUM - Sequence Number for AHB Write-Triggered Command */ -#define FLEXSPI_FLSHCR2_AWRSEQNUM(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR2_AWRSEQNUM_SHIFT)) & FLEXSPI_FLSHCR2_AWRSEQNUM_MASK) - -#define FLEXSPI_FLSHCR2_AWRWAIT_MASK (0xFFF0000U) -#define FLEXSPI_FLSHCR2_AWRWAIT_SHIFT (16U) -/*! AWRWAIT - AHB Write Wait */ -#define FLEXSPI_FLSHCR2_AWRWAIT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR2_AWRWAIT_SHIFT)) & FLEXSPI_FLSHCR2_AWRWAIT_MASK) - -#define FLEXSPI_FLSHCR2_AWRWAITUNIT_MASK (0x70000000U) -#define FLEXSPI_FLSHCR2_AWRWAITUNIT_SHIFT (28U) -/*! AWRWAITUNIT - AWRWAIT Unit - * 0b000..2 - * 0b001..8 - * 0b010..32 - * 0b011..128 - * 0b100..512 - * 0b101..2048 - * 0b110..8192 - * 0b111..32768 - */ -#define FLEXSPI_FLSHCR2_AWRWAITUNIT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR2_AWRWAITUNIT_SHIFT)) & FLEXSPI_FLSHCR2_AWRWAITUNIT_MASK) - -#define FLEXSPI_FLSHCR2_CLRINSTRPTR_MASK (0x80000000U) -#define FLEXSPI_FLSHCR2_CLRINSTRPTR_SHIFT (31U) -/*! CLRINSTRPTR - Clear Instruction Pointer */ -#define FLEXSPI_FLSHCR2_CLRINSTRPTR(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR2_CLRINSTRPTR_SHIFT)) & FLEXSPI_FLSHCR2_CLRINSTRPTR_MASK) -/*! @} */ - -/* The count of FLEXSPI_FLSHCR2 */ -#define FLEXSPI_FLSHCR2_COUNT (4U) - -/*! @name FLSHCR4 - Flash Control 4 */ -/*! @{ */ - -#define FLEXSPI_FLSHCR4_WMOPT1_MASK (0x1U) -#define FLEXSPI_FLSHCR4_WMOPT1_SHIFT (0U) -/*! WMOPT1 - Write Mask Option 1 - * 0b0..When writing to an external device, DQS pin is used as write mask. When flash memory is accessed in - * individual mode, AHB or IP write burst start address alignment is not limited. - * 0b1..When writing to an external device, DQS pin is not used as write mask. When flash memory is accessed in - * individual mode, AHB or IP write burst start address alignment is limited. - */ -#define FLEXSPI_FLSHCR4_WMOPT1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR4_WMOPT1_SHIFT)) & FLEXSPI_FLSHCR4_WMOPT1_MASK) - -#define FLEXSPI_FLSHCR4_WMENA_MASK (0x4U) -#define FLEXSPI_FLSHCR4_WMENA_SHIFT (2U) -/*! WMENA - Write Mask Enable for Port A - * 0b0..Disabled. When writing to external device, DQS(RWDS) pin is not driven. - * 0b1..Enabled. When writing to external device, FlexSPI drives DQS(RWDS) pin as write mask output. - */ -#define FLEXSPI_FLSHCR4_WMENA(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR4_WMENA_SHIFT)) & FLEXSPI_FLSHCR4_WMENA_MASK) - -#define FLEXSPI_FLSHCR4_WMENB_MASK (0x8U) -#define FLEXSPI_FLSHCR4_WMENB_SHIFT (3U) -/*! WMENB - Write Mask Enable for Port B - * 0b0..Disabled. When writing to external device, DQS(RWDS) pin is not driven. - * 0b1..Enabled. When writing to external device, FlexSPI drives DQS(RWDS) pin as write mask output. - */ -#define FLEXSPI_FLSHCR4_WMENB(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR4_WMENB_SHIFT)) & FLEXSPI_FLSHCR4_WMENB_MASK) -/*! @} */ - -/*! @name IPCR0 - IP Control 0 */ -/*! @{ */ - -#define FLEXSPI_IPCR0_SFAR_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPCR0_SFAR_SHIFT (0U) -/*! SFAR - Serial Flash Address */ -#define FLEXSPI_IPCR0_SFAR(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPCR0_SFAR_SHIFT)) & FLEXSPI_IPCR0_SFAR_MASK) -/*! @} */ - -/*! @name IPCR1 - IP Control 1 */ -/*! @{ */ - -#define FLEXSPI_IPCR1_IDATSZ_MASK (0xFFFFU) -#define FLEXSPI_IPCR1_IDATSZ_SHIFT (0U) -/*! IDATSZ - Flash Read/Program Data Size (in bytes) for IP command. */ -#define FLEXSPI_IPCR1_IDATSZ(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPCR1_IDATSZ_SHIFT)) & FLEXSPI_IPCR1_IDATSZ_MASK) - -#define FLEXSPI_IPCR1_ISEQID_MASK (0xF0000U) -#define FLEXSPI_IPCR1_ISEQID_SHIFT (16U) -/*! ISEQID - Sequence Index in LUT for IP command. */ -#define FLEXSPI_IPCR1_ISEQID(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPCR1_ISEQID_SHIFT)) & FLEXSPI_IPCR1_ISEQID_MASK) - -#define FLEXSPI_IPCR1_ISEQNUM_MASK (0x7000000U) -#define FLEXSPI_IPCR1_ISEQNUM_SHIFT (24U) -/*! ISEQNUM - Sequence Number for IP command: ISEQNUM+1. */ -#define FLEXSPI_IPCR1_ISEQNUM(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPCR1_ISEQNUM_SHIFT)) & FLEXSPI_IPCR1_ISEQNUM_MASK) - -#define FLEXSPI_IPCR1_IPAREN_MASK (0x80000000U) -#define FLEXSPI_IPCR1_IPAREN_SHIFT (31U) -/*! IPAREN - Parallel Mode Enable for IP Commands - * 0b0..Disabled. Flash memory is accessed in Individual mode. - * 0b1..Enabled. Flash memory is accessed in Parallel mode. - */ -#define FLEXSPI_IPCR1_IPAREN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPCR1_IPAREN_SHIFT)) & FLEXSPI_IPCR1_IPAREN_MASK) -/*! @} */ - -/*! @name IPCR2 - IP Control 2 */ -/*! @{ */ - -#define FLEXSPI_IPCR2_IPBLKAHBREQ_MASK (0x1U) -#define FLEXSPI_IPCR2_IPBLKAHBREQ_SHIFT (0U) -/*! IPBLKAHBREQ - IP Command Blocking AHB Command Request Enable - * 0b0..IP commands do not block AHB command requests. - * 0b1..IP commands block AHB command requests. - */ -#define FLEXSPI_IPCR2_IPBLKAHBREQ(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPCR2_IPBLKAHBREQ_SHIFT)) & FLEXSPI_IPCR2_IPBLKAHBREQ_MASK) - -#define FLEXSPI_IPCR2_IPBLKAHBACK_MASK (0x2U) -#define FLEXSPI_IPCR2_IPBLKAHBACK_SHIFT (1U) -/*! IPBLKAHBACK - IP Command Blocking AHB Command Acknowledgment Enable - * 0b0..IP commands do not block AHB command acknowledgment. - * 0b1..IP commands block AHB command acknowledgment. - */ -#define FLEXSPI_IPCR2_IPBLKAHBACK(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPCR2_IPBLKAHBACK_SHIFT)) & FLEXSPI_IPCR2_IPBLKAHBACK_MASK) - -#define FLEXSPI_IPCR2_IPBLKALLAHB_MASK (0x4U) -#define FLEXSPI_IPCR2_IPBLKALLAHB_SHIFT (2U) -/*! IPBLKALLAHB - IP Command Blocking All AHB Command Enable - * 0b0..IP commands only block AHB commands that affect the IPED region. - * 0b1..IP commands block all AHB commands. - */ -#define FLEXSPI_IPCR2_IPBLKALLAHB(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPCR2_IPBLKALLAHB_SHIFT)) & FLEXSPI_IPCR2_IPBLKALLAHB_MASK) -/*! @} */ - -/*! @name IPCMD - IP Command */ -/*! @{ */ - -#define FLEXSPI_IPCMD_TRG_MASK (0x1U) -#define FLEXSPI_IPCMD_TRG_SHIFT (0U) -/*! TRG - Command Trigger - * 0b0..No action - * 0b1..Start the IP command that the IPCR0 and IPCR1 registers define. - */ -#define FLEXSPI_IPCMD_TRG(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPCMD_TRG_SHIFT)) & FLEXSPI_IPCMD_TRG_MASK) -/*! @} */ - -/*! @name DLPR - Data Learning Pattern */ -/*! @{ */ - -#define FLEXSPI_DLPR_DLP_MASK (0xFFFFFFFFU) -#define FLEXSPI_DLPR_DLP_SHIFT (0U) -/*! DLP - Data Learning Pattern */ -#define FLEXSPI_DLPR_DLP(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_DLPR_DLP_SHIFT)) & FLEXSPI_DLPR_DLP_MASK) -/*! @} */ - -/*! @name IPRXFCR - IP Receive FIFO Control */ -/*! @{ */ - -#define FLEXSPI_IPRXFCR_CLRIPRXF_MASK (0x1U) -#define FLEXSPI_IPRXFCR_CLRIPRXF_SHIFT (0U) -/*! CLRIPRXF - Clear IP Receive FIFO - * 0b0..No function - * 0b1..A clock cycle pulse clears all valid data entries in IP receive FIFO. - */ -#define FLEXSPI_IPRXFCR_CLRIPRXF(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPRXFCR_CLRIPRXF_SHIFT)) & FLEXSPI_IPRXFCR_CLRIPRXF_MASK) - -#define FLEXSPI_IPRXFCR_RXDMAEN_MASK (0x2U) -#define FLEXSPI_IPRXFCR_RXDMAEN_SHIFT (1U) -/*! RXDMAEN - IP Receive FIFO Reading by DMA Enable - * 0b0..Disabled. The processor reads the FIFO. - * 0b1..Enabled. DMA reads the FIFO. - */ -#define FLEXSPI_IPRXFCR_RXDMAEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPRXFCR_RXDMAEN_SHIFT)) & FLEXSPI_IPRXFCR_RXDMAEN_MASK) - -#define FLEXSPI_IPRXFCR_RXWMRK_MASK (0x1FCU) -#define FLEXSPI_IPRXFCR_RXWMRK_SHIFT (2U) -/*! RXWMRK - IP Receive FIFO Watermark Level */ -#define FLEXSPI_IPRXFCR_RXWMRK(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPRXFCR_RXWMRK_SHIFT)) & FLEXSPI_IPRXFCR_RXWMRK_MASK) -/*! @} */ - -/*! @name IPTXFCR - IP Transmit FIFO Control */ -/*! @{ */ - -#define FLEXSPI_IPTXFCR_CLRIPTXF_MASK (0x1U) -#define FLEXSPI_IPTXFCR_CLRIPTXF_SHIFT (0U) -/*! CLRIPTXF - Clear IP Transmit FIFO - * 0b0..No function - * 0b1..A clock cycle pulse clears all valid data entries in the IP transmit FIFO. - */ -#define FLEXSPI_IPTXFCR_CLRIPTXF(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPTXFCR_CLRIPTXF_SHIFT)) & FLEXSPI_IPTXFCR_CLRIPTXF_MASK) - -#define FLEXSPI_IPTXFCR_TXDMAEN_MASK (0x2U) -#define FLEXSPI_IPTXFCR_TXDMAEN_SHIFT (1U) -/*! TXDMAEN - Transmit FIFO DMA Enable - * 0b0..Processor - * 0b1..DMA - */ -#define FLEXSPI_IPTXFCR_TXDMAEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPTXFCR_TXDMAEN_SHIFT)) & FLEXSPI_IPTXFCR_TXDMAEN_MASK) - -#define FLEXSPI_IPTXFCR_TXWMRK_MASK (0x1FCU) -#define FLEXSPI_IPTXFCR_TXWMRK_SHIFT (2U) -/*! TXWMRK - Transmit Watermark Level */ -#define FLEXSPI_IPTXFCR_TXWMRK(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPTXFCR_TXWMRK_SHIFT)) & FLEXSPI_IPTXFCR_TXWMRK_MASK) -/*! @} */ - -/*! @name DLLCR - DLL Control 0 */ -/*! @{ */ - -#define FLEXSPI_DLLCR_DLLEN_MASK (0x1U) -#define FLEXSPI_DLLCR_DLLEN_SHIFT (0U) -/*! DLLEN - DLL Calibration Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_DLLCR_DLLEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_DLLCR_DLLEN_SHIFT)) & FLEXSPI_DLLCR_DLLEN_MASK) - -#define FLEXSPI_DLLCR_DLLRESET_MASK (0x2U) -#define FLEXSPI_DLLCR_DLLRESET_SHIFT (1U) -/*! DLLRESET - DLL reset - * 0b0..No function - * 0b1..Force DLL reset. - */ -#define FLEXSPI_DLLCR_DLLRESET(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_DLLCR_DLLRESET_SHIFT)) & FLEXSPI_DLLCR_DLLRESET_MASK) - -#define FLEXSPI_DLLCR_SLVDLYTARGET_MASK (0x78U) -#define FLEXSPI_DLLCR_SLVDLYTARGET_SHIFT (3U) -/*! SLVDLYTARGET - Target Delay Line */ -#define FLEXSPI_DLLCR_SLVDLYTARGET(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_DLLCR_SLVDLYTARGET_SHIFT)) & FLEXSPI_DLLCR_SLVDLYTARGET_MASK) - -#define FLEXSPI_DLLCR_OVRDEN_MASK (0x100U) -#define FLEXSPI_DLLCR_OVRDEN_SHIFT (8U) -/*! OVRDEN - Target Clock Delay Line Override Value Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_DLLCR_OVRDEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_DLLCR_OVRDEN_SHIFT)) & FLEXSPI_DLLCR_OVRDEN_MASK) - -#define FLEXSPI_DLLCR_OVRDVAL_MASK (0x7E00U) -#define FLEXSPI_DLLCR_OVRDVAL_SHIFT (9U) -/*! OVRDVAL - Target Clock Delay Line Override Value */ -#define FLEXSPI_DLLCR_OVRDVAL(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_DLLCR_OVRDVAL_SHIFT)) & FLEXSPI_DLLCR_OVRDVAL_MASK) - -#define FLEXSPI_DLLCR_REFPHASEGAP_MASK (0x18000U) -#define FLEXSPI_DLLCR_REFPHASEGAP_SHIFT (15U) -/*! REFPHASEGAP - Reference Clock Delay Line Phase Adjust Gap. REFPHASEGAP setting of 2h is recommended if DLLEN is set. */ -#define FLEXSPI_DLLCR_REFPHASEGAP(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_DLLCR_REFPHASEGAP_SHIFT)) & FLEXSPI_DLLCR_REFPHASEGAP_MASK) -/*! @} */ - -/* The count of FLEXSPI_DLLCR */ -#define FLEXSPI_DLLCR_COUNT (2U) - -/*! @name STS0 - Status 0 */ -/*! @{ */ - -#define FLEXSPI_STS0_SEQIDLE_MASK (0x1U) -#define FLEXSPI_STS0_SEQIDLE_SHIFT (0U) -/*! SEQIDLE - SEQ_CTL State Machine Idle - * 0b0..Not idle - * 0b1..Idle - */ -#define FLEXSPI_STS0_SEQIDLE(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS0_SEQIDLE_SHIFT)) & FLEXSPI_STS0_SEQIDLE_MASK) - -#define FLEXSPI_STS0_ARBIDLE_MASK (0x2U) -#define FLEXSPI_STS0_ARBIDLE_SHIFT (1U) -/*! ARBIDLE - ARB_CTL State Machine Idle - * 0b0..Not idle - * 0b1..Idle - */ -#define FLEXSPI_STS0_ARBIDLE(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS0_ARBIDLE_SHIFT)) & FLEXSPI_STS0_ARBIDLE_MASK) - -#define FLEXSPI_STS0_ARBCMDSRC_MASK (0xCU) -#define FLEXSPI_STS0_ARBCMDSRC_SHIFT (2U) -/*! ARBCMDSRC - ARB Command Source - * 0b00..Trigger source is AHB read command. - * 0b01..Trigger source is AHB write command. - * 0b10..Trigger source is IP command (by writing 1 to IPCMD[TRG]). - * 0b11..Trigger source is a suspended command that has resumed. - */ -#define FLEXSPI_STS0_ARBCMDSRC(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS0_ARBCMDSRC_SHIFT)) & FLEXSPI_STS0_ARBCMDSRC_MASK) - -#define FLEXSPI_STS0_DATALEARNPHASEA_MASK (0xF0U) -#define FLEXSPI_STS0_DATALEARNPHASEA_SHIFT (4U) -/*! DATALEARNPHASEA - Data Learning Phase Selection on Port A */ -#define FLEXSPI_STS0_DATALEARNPHASEA(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS0_DATALEARNPHASEA_SHIFT)) & FLEXSPI_STS0_DATALEARNPHASEA_MASK) - -#define FLEXSPI_STS0_DATALEARNPHASEB_MASK (0xF00U) -#define FLEXSPI_STS0_DATALEARNPHASEB_SHIFT (8U) -/*! DATALEARNPHASEB - Data Learning Phase Selection on Port B */ -#define FLEXSPI_STS0_DATALEARNPHASEB(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS0_DATALEARNPHASEB_SHIFT)) & FLEXSPI_STS0_DATALEARNPHASEB_MASK) -/*! @} */ - -/*! @name STS1 - Status 1 */ -/*! @{ */ - -#define FLEXSPI_STS1_AHBCMDERRID_MASK (0xFU) -#define FLEXSPI_STS1_AHBCMDERRID_SHIFT (0U) -/*! AHBCMDERRID - AHB Command Error ID */ -#define FLEXSPI_STS1_AHBCMDERRID(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS1_AHBCMDERRID_SHIFT)) & FLEXSPI_STS1_AHBCMDERRID_MASK) - -#define FLEXSPI_STS1_AHBCMDERRCODE_MASK (0xF00U) -#define FLEXSPI_STS1_AHBCMDERRCODE_SHIFT (8U) -/*! AHBCMDERRCODE - AHB Command Error Code - * 0b0000..No error - * 0b0010..AHB Write command with JMP_ON_CS instruction used in the sequence - * 0b0011..Unknown instruction opcode in the sequence - * 0b0100..DUMMY_SDR or DUMMY_RWDS_SDR instruction used in DDR sequence - * 0b0101..DUMMY_DDR or DUMMY_RWDS_DDR instruction used in SDR sequence - * 0b1110..Sequence execution timeout - */ -#define FLEXSPI_STS1_AHBCMDERRCODE(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS1_AHBCMDERRCODE_SHIFT)) & FLEXSPI_STS1_AHBCMDERRCODE_MASK) - -#define FLEXSPI_STS1_IPCMDERRID_MASK (0xF0000U) -#define FLEXSPI_STS1_IPCMDERRID_SHIFT (16U) -/*! IPCMDERRID - IP Command Error ID */ -#define FLEXSPI_STS1_IPCMDERRID(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS1_IPCMDERRID_SHIFT)) & FLEXSPI_STS1_IPCMDERRID_MASK) - -#define FLEXSPI_STS1_IPCMDERRCODE_MASK (0xF000000U) -#define FLEXSPI_STS1_IPCMDERRCODE_SHIFT (24U) -/*! IPCMDERRCODE - IP Command Error Code - * 0b0000..No error - * 0b0010..IP command with JMP_ON_CS instruction used in the sequence - * 0b0011..Unknown instruction opcode in the sequence - * 0b0100..DUMMY_SDR or DUMMY_RWDS_SDR instruction used in DDR sequence - * 0b0101..DUMMY_DDR or DUMMY_RWDS_DDR instruction used in SDR sequence - * 0b0110..Flash memory access start address exceeds entire flash address range (A1, A2, B1, and B2) - * 0b1110..Sequence execution timeout - * 0b1111..Flash boundary crossed - */ -#define FLEXSPI_STS1_IPCMDERRCODE(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS1_IPCMDERRCODE_SHIFT)) & FLEXSPI_STS1_IPCMDERRCODE_MASK) -/*! @} */ - -/*! @name STS2 - Status 2 */ -/*! @{ */ - -#define FLEXSPI_STS2_ASLVLOCK_MASK (0x1U) -#define FLEXSPI_STS2_ASLVLOCK_SHIFT (0U) -/*! ASLVLOCK - Flash A Sample Target Delay Line Locked - * 0b0..Not locked - * 0b1..Locked - */ -#define FLEXSPI_STS2_ASLVLOCK(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS2_ASLVLOCK_SHIFT)) & FLEXSPI_STS2_ASLVLOCK_MASK) - -#define FLEXSPI_STS2_AREFLOCK_MASK (0x2U) -#define FLEXSPI_STS2_AREFLOCK_SHIFT (1U) -/*! AREFLOCK - Flash A Sample Clock Reference Delay Line Locked - * 0b0..Not locked - * 0b1..Locked - */ -#define FLEXSPI_STS2_AREFLOCK(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS2_AREFLOCK_SHIFT)) & FLEXSPI_STS2_AREFLOCK_MASK) - -#define FLEXSPI_STS2_ASLVSEL_MASK (0xFCU) -#define FLEXSPI_STS2_ASLVSEL_SHIFT (2U) -/*! ASLVSEL - Flash A Sample Clock Target Delay Line Delay Cell Number */ -#define FLEXSPI_STS2_ASLVSEL(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS2_ASLVSEL_SHIFT)) & FLEXSPI_STS2_ASLVSEL_MASK) - -#define FLEXSPI_STS2_AREFSEL_MASK (0x3F00U) -#define FLEXSPI_STS2_AREFSEL_SHIFT (8U) -/*! AREFSEL - Flash A Sample Clock Reference Delay Line Delay Cell Number */ -#define FLEXSPI_STS2_AREFSEL(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS2_AREFSEL_SHIFT)) & FLEXSPI_STS2_AREFSEL_MASK) - -#define FLEXSPI_STS2_BSLVLOCK_MASK (0x10000U) -#define FLEXSPI_STS2_BSLVLOCK_SHIFT (16U) -/*! BSLVLOCK - Flash B Sample Target Reference Delay Line Locked - * 0b0..Not locked - * 0b1..Locked - */ -#define FLEXSPI_STS2_BSLVLOCK(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS2_BSLVLOCK_SHIFT)) & FLEXSPI_STS2_BSLVLOCK_MASK) - -#define FLEXSPI_STS2_BREFLOCK_MASK (0x20000U) -#define FLEXSPI_STS2_BREFLOCK_SHIFT (17U) -/*! BREFLOCK - Flash B Sample Clock Reference Delay Line Locked - * 0b0..Not locked - * 0b1..Locked - */ -#define FLEXSPI_STS2_BREFLOCK(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS2_BREFLOCK_SHIFT)) & FLEXSPI_STS2_BREFLOCK_MASK) - -#define FLEXSPI_STS2_BSLVSEL_MASK (0xFC0000U) -#define FLEXSPI_STS2_BSLVSEL_SHIFT (18U) -/*! BSLVSEL - Flash B Sample Clock Target Delay Line Delay Cell Number */ -#define FLEXSPI_STS2_BSLVSEL(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS2_BSLVSEL_SHIFT)) & FLEXSPI_STS2_BSLVSEL_MASK) - -#define FLEXSPI_STS2_BREFSEL_MASK (0x3F000000U) -#define FLEXSPI_STS2_BREFSEL_SHIFT (24U) -/*! BREFSEL - Flash B Sample Clock Reference Delay Line Delay Cell Number */ -#define FLEXSPI_STS2_BREFSEL(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS2_BREFSEL_SHIFT)) & FLEXSPI_STS2_BREFSEL_MASK) -/*! @} */ - -/*! @name AHBSPNDSTS - AHB Suspend Status */ -/*! @{ */ - -#define FLEXSPI_AHBSPNDSTS_ACTIVE_MASK (0x1U) -#define FLEXSPI_AHBSPNDSTS_ACTIVE_SHIFT (0U) -/*! ACTIVE - Active AHB Read Prefetch Suspended - * 0b0..No suspended AHB read prefetch command. - * 0b1..An AHB read prefetch command sequence has been suspended. - */ -#define FLEXSPI_AHBSPNDSTS_ACTIVE(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBSPNDSTS_ACTIVE_SHIFT)) & FLEXSPI_AHBSPNDSTS_ACTIVE_MASK) - -#define FLEXSPI_AHBSPNDSTS_BUFID_MASK (0xEU) -#define FLEXSPI_AHBSPNDSTS_BUFID_SHIFT (1U) -/*! BUFID - AHB Receive Buffer ID for Suspended Command Sequence */ -#define FLEXSPI_AHBSPNDSTS_BUFID(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBSPNDSTS_BUFID_SHIFT)) & FLEXSPI_AHBSPNDSTS_BUFID_MASK) - -#define FLEXSPI_AHBSPNDSTS_DATLFT_MASK (0xFFFF0000U) -#define FLEXSPI_AHBSPNDSTS_DATLFT_SHIFT (16U) -/*! DATLFT - Data Left */ -#define FLEXSPI_AHBSPNDSTS_DATLFT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBSPNDSTS_DATLFT_SHIFT)) & FLEXSPI_AHBSPNDSTS_DATLFT_MASK) -/*! @} */ - -/*! @name IPRXFSTS - IP Receive FIFO Status */ -/*! @{ */ - -#define FLEXSPI_IPRXFSTS_FILL_MASK (0xFFU) -#define FLEXSPI_IPRXFSTS_FILL_SHIFT (0U) -/*! FILL - Fill Level of IP Receive FIFO */ -#define FLEXSPI_IPRXFSTS_FILL(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPRXFSTS_FILL_SHIFT)) & FLEXSPI_IPRXFSTS_FILL_MASK) - -#define FLEXSPI_IPRXFSTS_RDCNTR_MASK (0xFFFF0000U) -#define FLEXSPI_IPRXFSTS_RDCNTR_SHIFT (16U) -/*! RDCNTR - Read Data Counter */ -#define FLEXSPI_IPRXFSTS_RDCNTR(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPRXFSTS_RDCNTR_SHIFT)) & FLEXSPI_IPRXFSTS_RDCNTR_MASK) -/*! @} */ - -/*! @name IPTXFSTS - IP Transmit FIFO Status */ -/*! @{ */ - -#define FLEXSPI_IPTXFSTS_FILL_MASK (0xFFU) -#define FLEXSPI_IPTXFSTS_FILL_SHIFT (0U) -/*! FILL - Fill Level of IP Transmit FIFO */ -#define FLEXSPI_IPTXFSTS_FILL(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPTXFSTS_FILL_SHIFT)) & FLEXSPI_IPTXFSTS_FILL_MASK) - -#define FLEXSPI_IPTXFSTS_WRCNTR_MASK (0xFFFF0000U) -#define FLEXSPI_IPTXFSTS_WRCNTR_SHIFT (16U) -/*! WRCNTR - Write Data Counter */ -#define FLEXSPI_IPTXFSTS_WRCNTR(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPTXFSTS_WRCNTR_SHIFT)) & FLEXSPI_IPTXFSTS_WRCNTR_MASK) -/*! @} */ - -/*! @name RFDR - IP Receive FIFO Data 0..IP Receive FIFO Data 31 */ -/*! @{ */ - -#define FLEXSPI_RFDR_RXDATA_MASK (0xFFFFFFFFU) -#define FLEXSPI_RFDR_RXDATA_SHIFT (0U) -/*! RXDATA - Receive Data */ -#define FLEXSPI_RFDR_RXDATA(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_RFDR_RXDATA_SHIFT)) & FLEXSPI_RFDR_RXDATA_MASK) -/*! @} */ - -/* The count of FLEXSPI_RFDR */ -#define FLEXSPI_RFDR_COUNT (32U) - -/*! @name TFDR - IP TX FIFO Data 0..IP TX FIFO Data 31 */ -/*! @{ */ - -#define FLEXSPI_TFDR_TXDATA_MASK (0xFFFFFFFFU) -#define FLEXSPI_TFDR_TXDATA_SHIFT (0U) -/*! TXDATA - Transmit Data */ -#define FLEXSPI_TFDR_TXDATA(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_TFDR_TXDATA_SHIFT)) & FLEXSPI_TFDR_TXDATA_MASK) -/*! @} */ - -/* The count of FLEXSPI_TFDR */ -#define FLEXSPI_TFDR_COUNT (32U) - -/*! @name LUT - Lookup Table 0..Lookup Table 63 */ -/*! @{ */ - -#define FLEXSPI_LUT_OPERAND0_MASK (0xFFU) -#define FLEXSPI_LUT_OPERAND0_SHIFT (0U) -/*! OPERAND0 - OPERAND0 */ -#define FLEXSPI_LUT_OPERAND0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_LUT_OPERAND0_SHIFT)) & FLEXSPI_LUT_OPERAND0_MASK) - -#define FLEXSPI_LUT_NUM_PADS0_MASK (0x300U) -#define FLEXSPI_LUT_NUM_PADS0_SHIFT (8U) -/*! NUM_PADS0 - NUM_PADS0 */ -#define FLEXSPI_LUT_NUM_PADS0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_LUT_NUM_PADS0_SHIFT)) & FLEXSPI_LUT_NUM_PADS0_MASK) - -#define FLEXSPI_LUT_OPCODE0_MASK (0xFC00U) -#define FLEXSPI_LUT_OPCODE0_SHIFT (10U) -/*! OPCODE0 - OPCODE */ -#define FLEXSPI_LUT_OPCODE0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_LUT_OPCODE0_SHIFT)) & FLEXSPI_LUT_OPCODE0_MASK) - -#define FLEXSPI_LUT_OPERAND1_MASK (0xFF0000U) -#define FLEXSPI_LUT_OPERAND1_SHIFT (16U) -/*! OPERAND1 - OPERAND1 */ -#define FLEXSPI_LUT_OPERAND1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_LUT_OPERAND1_SHIFT)) & FLEXSPI_LUT_OPERAND1_MASK) - -#define FLEXSPI_LUT_NUM_PADS1_MASK (0x3000000U) -#define FLEXSPI_LUT_NUM_PADS1_SHIFT (24U) -/*! NUM_PADS1 - NUM_PADS1 */ -#define FLEXSPI_LUT_NUM_PADS1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_LUT_NUM_PADS1_SHIFT)) & FLEXSPI_LUT_NUM_PADS1_MASK) - -#define FLEXSPI_LUT_OPCODE1_MASK (0xFC000000U) -#define FLEXSPI_LUT_OPCODE1_SHIFT (26U) -/*! OPCODE1 - OPCODE1 */ -#define FLEXSPI_LUT_OPCODE1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_LUT_OPCODE1_SHIFT)) & FLEXSPI_LUT_OPCODE1_MASK) -/*! @} */ - -/* The count of FLEXSPI_LUT */ -#define FLEXSPI_LUT_COUNT (64U) - -/*! @name HADDRSTART - HADDR REMAP Start Address */ -/*! @{ */ - -#define FLEXSPI_HADDRSTART_REMAPEN_MASK (0x1U) -#define FLEXSPI_HADDRSTART_REMAPEN_SHIFT (0U) -/*! REMAPEN - AHB Bus Address Remap Enable - * 0b0..HADDR REMAP Disabled - * 0b1..HADDR REMAP Enabled - */ -#define FLEXSPI_HADDRSTART_REMAPEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_HADDRSTART_REMAPEN_SHIFT)) & FLEXSPI_HADDRSTART_REMAPEN_MASK) - -#define FLEXSPI_HADDRSTART_ADDRSTART_MASK (0xFFFFF000U) -#define FLEXSPI_HADDRSTART_ADDRSTART_SHIFT (12U) -/*! ADDRSTART - HADDR Start Address */ -#define FLEXSPI_HADDRSTART_ADDRSTART(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_HADDRSTART_ADDRSTART_SHIFT)) & FLEXSPI_HADDRSTART_ADDRSTART_MASK) -/*! @} */ - -/*! @name HADDREND - HADDR REMAP END ADDR */ -/*! @{ */ - -#define FLEXSPI_HADDREND_ENDSTART_MASK (0xFFFFF000U) -#define FLEXSPI_HADDREND_ENDSTART_SHIFT (12U) -/*! ENDSTART - End Address of HADDR Remap Range */ -#define FLEXSPI_HADDREND_ENDSTART(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_HADDREND_ENDSTART_SHIFT)) & FLEXSPI_HADDREND_ENDSTART_MASK) -/*! @} */ - -/*! @name HADDROFFSET - HADDR Remap Offset */ -/*! @{ */ - -#define FLEXSPI_HADDROFFSET_ADDROFFSET_MASK (0xFFFFF000U) -#define FLEXSPI_HADDROFFSET_ADDROFFSET_SHIFT (12U) -/*! ADDROFFSET - HADDR Offset */ -#define FLEXSPI_HADDROFFSET_ADDROFFSET(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_HADDROFFSET_ADDROFFSET_SHIFT)) & FLEXSPI_HADDROFFSET_ADDROFFSET_MASK) -/*! @} */ - -/*! @name IPEDCTRL - IPED Function Control */ -/*! @{ */ - -#define FLEXSPI_IPEDCTRL_CONFIG_MASK (0x1U) -#define FLEXSPI_IPEDCTRL_CONFIG_SHIFT (0U) -/*! CONFIG - IPED Mode Select - * 0b0..Fully pipelined - * 0b1..Not fully pipelined - */ -#define FLEXSPI_IPEDCTRL_CONFIG(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTRL_CONFIG_SHIFT)) & FLEXSPI_IPEDCTRL_CONFIG_MASK) - -#define FLEXSPI_IPEDCTRL_IPED_EN_MASK (0x2U) -#define FLEXSPI_IPEDCTRL_IPED_EN_SHIFT (1U) -/*! IPED_EN - IPED Encryption and Decryption Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_IPEDCTRL_IPED_EN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTRL_IPED_EN_SHIFT)) & FLEXSPI_IPEDCTRL_IPED_EN_MASK) - -#define FLEXSPI_IPEDCTRL_IPWR_EN_MASK (0x4U) -#define FLEXSPI_IPEDCTRL_IPWR_EN_SHIFT (2U) -/*! IPWR_EN - IP Write IPED CTR Mode Encryption Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_IPEDCTRL_IPWR_EN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTRL_IPWR_EN_SHIFT)) & FLEXSPI_IPEDCTRL_IPWR_EN_MASK) - -#define FLEXSPI_IPEDCTRL_AHBWR_EN_MASK (0x8U) -#define FLEXSPI_IPEDCTRL_AHBWR_EN_SHIFT (3U) -/*! AHBWR_EN - AHB Write IPED CTR Mode Encryption Enable. - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_IPEDCTRL_AHBWR_EN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTRL_AHBWR_EN_SHIFT)) & FLEXSPI_IPEDCTRL_AHBWR_EN_MASK) - -#define FLEXSPI_IPEDCTRL_AHBRD_EN_MASK (0x10U) -#define FLEXSPI_IPEDCTRL_AHBRD_EN_SHIFT (4U) -/*! AHBRD_EN - AHB Read IPED CTR Mode Decryption Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_IPEDCTRL_AHBRD_EN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTRL_AHBRD_EN_SHIFT)) & FLEXSPI_IPEDCTRL_AHBRD_EN_MASK) - -#define FLEXSPI_IPEDCTRL_IPGCMWR_MASK (0x40U) -#define FLEXSPI_IPEDCTRL_IPGCMWR_SHIFT (6U) -/*! IPGCMWR - IP Write GCM Mode Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define FLEXSPI_IPEDCTRL_IPGCMWR(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTRL_IPGCMWR_SHIFT)) & FLEXSPI_IPEDCTRL_IPGCMWR_MASK) - -#define FLEXSPI_IPEDCTRL_AHGCMWR_MASK (0x80U) -#define FLEXSPI_IPEDCTRL_AHGCMWR_SHIFT (7U) -/*! AHGCMWR - AHB Write IPED GCM Mode Encryption Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_IPEDCTRL_AHGCMWR(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTRL_AHGCMWR_SHIFT)) & FLEXSPI_IPEDCTRL_AHGCMWR_MASK) - -#define FLEXSPI_IPEDCTRL_AHBGCMRD_MASK (0x100U) -#define FLEXSPI_IPEDCTRL_AHBGCMRD_SHIFT (8U) -/*! AHBGCMRD - AHB Read IPED GCM Mode Decryption Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_IPEDCTRL_AHBGCMRD(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTRL_AHBGCMRD_SHIFT)) & FLEXSPI_IPEDCTRL_AHBGCMRD_MASK) - -#define FLEXSPI_IPEDCTRL_IPED_PROTECT_MASK (0x200U) -#define FLEXSPI_IPEDCTRL_IPED_PROTECT_SHIFT (9U) -/*! IPED_PROTECT - IPED Protection - * 0b0..No restrictions - * 0b1..Only privileged controllers can write IPED registers. - */ -#define FLEXSPI_IPEDCTRL_IPED_PROTECT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTRL_IPED_PROTECT_SHIFT)) & FLEXSPI_IPEDCTRL_IPED_PROTECT_MASK) - -#define FLEXSPI_IPEDCTRL_IPED_SWRESET_MASK (0x400U) -#define FLEXSPI_IPEDCTRL_IPED_SWRESET_SHIFT (10U) -/*! IPED_SWRESET - Abort Current Decryption or Encryption - * 0b0..No function. - * 0b1..Aborts current decryption or encryption and waits for the next start operation. - */ -#define FLEXSPI_IPEDCTRL_IPED_SWRESET(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTRL_IPED_SWRESET_SHIFT)) & FLEXSPI_IPEDCTRL_IPED_SWRESET_MASK) -/*! @} */ - -/*! @name IPSNSZSTART0 - IPS Nonsecure Region 0 Start Address */ -/*! @{ */ - -#define FLEXSPI_IPSNSZSTART0_start_address_MASK (0xFFFFF000U) -#define FLEXSPI_IPSNSZSTART0_start_address_SHIFT (12U) -/*! start_address - Start Address of Nonsecure Region */ -#define FLEXSPI_IPSNSZSTART0_start_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPSNSZSTART0_start_address_SHIFT)) & FLEXSPI_IPSNSZSTART0_start_address_MASK) -/*! @} */ - -/*! @name IPSNSZEND0 - IPS Nonsecure Region 0 End Address */ -/*! @{ */ - -#define FLEXSPI_IPSNSZEND0_end_address_MASK (0xFFFFF000U) -#define FLEXSPI_IPSNSZEND0_end_address_SHIFT (12U) -/*! end_address - End Address of Nonsecure Region */ -#define FLEXSPI_IPSNSZEND0_end_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPSNSZEND0_end_address_SHIFT)) & FLEXSPI_IPSNSZEND0_end_address_MASK) -/*! @} */ - -/*! @name IPSNSZSTART1 - IPS Nonsecure Region 1 Start Address */ -/*! @{ */ - -#define FLEXSPI_IPSNSZSTART1_start_address_MASK (0xFFFFF000U) -#define FLEXSPI_IPSNSZSTART1_start_address_SHIFT (12U) -/*! start_address - Start Address of Nonsecure Region */ -#define FLEXSPI_IPSNSZSTART1_start_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPSNSZSTART1_start_address_SHIFT)) & FLEXSPI_IPSNSZSTART1_start_address_MASK) -/*! @} */ - -/*! @name IPSNSZEND1 - IPS Nonsecure Region 1 End Address */ -/*! @{ */ - -#define FLEXSPI_IPSNSZEND1_end_address_MASK (0xFFFFF000U) -#define FLEXSPI_IPSNSZEND1_end_address_SHIFT (12U) -/*! end_address - End Address of Nonsecure Region */ -#define FLEXSPI_IPSNSZEND1_end_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPSNSZEND1_end_address_SHIFT)) & FLEXSPI_IPSNSZEND1_end_address_MASK) -/*! @} */ - -/*! @name AHBBUFREGIONSTART0 - Receive Buffer Start Address of Region 0 */ -/*! @{ */ - -#define FLEXSPI_AHBBUFREGIONSTART0_START_ADDRESS_MASK (0xFFFFF000U) -#define FLEXSPI_AHBBUFREGIONSTART0_START_ADDRESS_SHIFT (12U) -/*! START_ADDRESS - Start Address of Prefetch Sub-Buffer Region */ -#define FLEXSPI_AHBBUFREGIONSTART0_START_ADDRESS(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBBUFREGIONSTART0_START_ADDRESS_SHIFT)) & FLEXSPI_AHBBUFREGIONSTART0_START_ADDRESS_MASK) -/*! @} */ - -/*! @name AHBBUFREGIONEND0 - Receive Buffer Region 0 End Address */ -/*! @{ */ - -#define FLEXSPI_AHBBUFREGIONEND0_END_ADDRESS_MASK (0xFFFFF000U) -#define FLEXSPI_AHBBUFREGIONEND0_END_ADDRESS_SHIFT (12U) -/*! END_ADDRESS - End Address of Prefetch Sub-Buffer Region */ -#define FLEXSPI_AHBBUFREGIONEND0_END_ADDRESS(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBBUFREGIONEND0_END_ADDRESS_SHIFT)) & FLEXSPI_AHBBUFREGIONEND0_END_ADDRESS_MASK) -/*! @} */ - -/*! @name AHBBUFREGIONSTART1 - Receive Buffer Start Address of Region 1 */ -/*! @{ */ - -#define FLEXSPI_AHBBUFREGIONSTART1_START_ADDRESS_MASK (0xFFFFF000U) -#define FLEXSPI_AHBBUFREGIONSTART1_START_ADDRESS_SHIFT (12U) -/*! START_ADDRESS - Start Address of Prefetch Sub-Buffer Region */ -#define FLEXSPI_AHBBUFREGIONSTART1_START_ADDRESS(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBBUFREGIONSTART1_START_ADDRESS_SHIFT)) & FLEXSPI_AHBBUFREGIONSTART1_START_ADDRESS_MASK) -/*! @} */ - -/*! @name AHBBUFREGIONEND1 - Receive Buffer Region 1 End Address */ -/*! @{ */ - -#define FLEXSPI_AHBBUFREGIONEND1_END_ADDRESS_MASK (0xFFFFF000U) -#define FLEXSPI_AHBBUFREGIONEND1_END_ADDRESS_SHIFT (12U) -/*! END_ADDRESS - End Address of Prefetch Sub-Buffer Region */ -#define FLEXSPI_AHBBUFREGIONEND1_END_ADDRESS(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBBUFREGIONEND1_END_ADDRESS_SHIFT)) & FLEXSPI_AHBBUFREGIONEND1_END_ADDRESS_MASK) -/*! @} */ - -/*! @name AHBBUFREGIONSTART2 - Receive Buffer Start Address of Region 2 */ -/*! @{ */ - -#define FLEXSPI_AHBBUFREGIONSTART2_START_ADDRESS_MASK (0xFFFFF000U) -#define FLEXSPI_AHBBUFREGIONSTART2_START_ADDRESS_SHIFT (12U) -/*! START_ADDRESS - Start Address of Prefetch Sub-Buffer Region */ -#define FLEXSPI_AHBBUFREGIONSTART2_START_ADDRESS(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBBUFREGIONSTART2_START_ADDRESS_SHIFT)) & FLEXSPI_AHBBUFREGIONSTART2_START_ADDRESS_MASK) -/*! @} */ - -/*! @name AHBBUFREGIONEND2 - Receive Buffer Region 2 End Address */ -/*! @{ */ - -#define FLEXSPI_AHBBUFREGIONEND2_END_ADDRESS_MASK (0xFFFFF000U) -#define FLEXSPI_AHBBUFREGIONEND2_END_ADDRESS_SHIFT (12U) -/*! END_ADDRESS - End Address of Prefetch Sub-Buffer Region */ -#define FLEXSPI_AHBBUFREGIONEND2_END_ADDRESS(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBBUFREGIONEND2_END_ADDRESS_SHIFT)) & FLEXSPI_AHBBUFREGIONEND2_END_ADDRESS_MASK) -/*! @} */ - -/*! @name AHBBUFREGIONSTART3 - Receive Buffer Start Address of Region 3 */ -/*! @{ */ - -#define FLEXSPI_AHBBUFREGIONSTART3_START_ADDRESS_MASK (0xFFFFF000U) -#define FLEXSPI_AHBBUFREGIONSTART3_START_ADDRESS_SHIFT (12U) -/*! START_ADDRESS - Start Address of Prefetch Sub-Buffer Region */ -#define FLEXSPI_AHBBUFREGIONSTART3_START_ADDRESS(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBBUFREGIONSTART3_START_ADDRESS_SHIFT)) & FLEXSPI_AHBBUFREGIONSTART3_START_ADDRESS_MASK) -/*! @} */ - -/*! @name AHBBUFREGIONEND3 - Receive Buffer Region 3 End Address */ -/*! @{ */ - -#define FLEXSPI_AHBBUFREGIONEND3_END_ADDRESS_MASK (0xFFFFF000U) -#define FLEXSPI_AHBBUFREGIONEND3_END_ADDRESS_SHIFT (12U) -/*! END_ADDRESS - End Address of Prefetch Sub-Buffer Region */ -#define FLEXSPI_AHBBUFREGIONEND3_END_ADDRESS(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBBUFREGIONEND3_END_ADDRESS_SHIFT)) & FLEXSPI_AHBBUFREGIONEND3_END_ADDRESS_MASK) -/*! @} */ - -/*! @name IPEDCTXCTRLX_IPEDCTXCTRL - IPED context control 0..IPED context control 1 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX0_FREEZE0_MASK (0x3U) -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX0_FREEZE0_SHIFT (0U) -/*! CTX0_FREEZE0 - Context Register Freeze for Region 0 */ -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX0_FREEZE0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX0_FREEZE0_SHIFT)) & FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX0_FREEZE0_MASK) - -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX0_FREEZE1_MASK (0x3U) -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX0_FREEZE1_SHIFT (0U) -/*! CTX0_FREEZE1 - Context Register Freeze for Region 0 */ -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX0_FREEZE1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX0_FREEZE1_SHIFT)) & FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX0_FREEZE1_MASK) - -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX1_FREEZE0_MASK (0xCU) -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX1_FREEZE0_SHIFT (2U) -/*! CTX1_FREEZE0 - Context Register Freeze for Region 1 */ -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX1_FREEZE0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX1_FREEZE0_SHIFT)) & FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX1_FREEZE0_MASK) - -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX1_FREEZE1_MASK (0xCU) -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX1_FREEZE1_SHIFT (2U) -/*! CTX1_FREEZE1 - Context Register Freeze for Region 1 */ -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX1_FREEZE1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX1_FREEZE1_SHIFT)) & FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX1_FREEZE1_MASK) - -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX2_FREEZE0_MASK (0x30U) -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX2_FREEZE0_SHIFT (4U) -/*! CTX2_FREEZE0 - Context Register Freeze for Region 2 */ -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX2_FREEZE0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX2_FREEZE0_SHIFT)) & FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX2_FREEZE0_MASK) - -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX2_FREEZE1_MASK (0x30U) -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX2_FREEZE1_SHIFT (4U) -/*! CTX2_FREEZE1 - Context Register Freeze for Region 2 */ -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX2_FREEZE1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX2_FREEZE1_SHIFT)) & FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX2_FREEZE1_MASK) - -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX3_FREEZE0_MASK (0xC0U) -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX3_FREEZE0_SHIFT (6U) -/*! CTX3_FREEZE0 - Context Register Freeze for Region 3 */ -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX3_FREEZE0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX3_FREEZE0_SHIFT)) & FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX3_FREEZE0_MASK) - -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX3_FREEZE1_MASK (0xC0U) -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX3_FREEZE1_SHIFT (6U) -/*! CTX3_FREEZE1 - Context Register Freeze for Region 3 */ -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX3_FREEZE1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX3_FREEZE1_SHIFT)) & FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX3_FREEZE1_MASK) - -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX4_FREEZE0_MASK (0x300U) -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX4_FREEZE0_SHIFT (8U) -/*! CTX4_FREEZE0 - Context Register Freeze for Region 4 */ -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX4_FREEZE0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX4_FREEZE0_SHIFT)) & FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX4_FREEZE0_MASK) - -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX4_FREEZE1_MASK (0x300U) -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX4_FREEZE1_SHIFT (8U) -/*! CTX4_FREEZE1 - Context Register Freeze for Region 4 */ -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX4_FREEZE1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX4_FREEZE1_SHIFT)) & FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX4_FREEZE1_MASK) - -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX5_FREEZE0_MASK (0xC00U) -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX5_FREEZE0_SHIFT (10U) -/*! CTX5_FREEZE0 - Context Register Freeze for Region 5 */ -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX5_FREEZE0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX5_FREEZE0_SHIFT)) & FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX5_FREEZE0_MASK) - -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX5_FREEZE1_MASK (0xC00U) -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX5_FREEZE1_SHIFT (10U) -/*! CTX5_FREEZE1 - Context Register Freeze for Region 5 */ -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX5_FREEZE1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX5_FREEZE1_SHIFT)) & FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX5_FREEZE1_MASK) - -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX6_FREEZE0_MASK (0x3000U) -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX6_FREEZE0_SHIFT (12U) -/*! CTX6_FREEZE0 - Context Register Freeze for Region 6 */ -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX6_FREEZE0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX6_FREEZE0_SHIFT)) & FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX6_FREEZE0_MASK) - -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX6_FREEZE1_MASK (0x3000U) -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX6_FREEZE1_SHIFT (12U) -/*! CTX6_FREEZE1 - Context Register Freeze for Region 6 */ -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX6_FREEZE1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX6_FREEZE1_SHIFT)) & FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX6_FREEZE1_MASK) -/*! @} */ - -/* The count of FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL */ -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_COUNT (2U) - -/*! @name IPEDCTX0IV0 - IPED Context0 IV0 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX0IV0_CTX0_IV0_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX0IV0_CTX0_IV0_SHIFT (0U) -/*! CTX0_IV0 - Lowest 32 bits of IV for region 0. */ -#define FLEXSPI_IPEDCTX0IV0_CTX0_IV0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX0IV0_CTX0_IV0_SHIFT)) & FLEXSPI_IPEDCTX0IV0_CTX0_IV0_MASK) -/*! @} */ - -/*! @name IPEDCTX0IV1 - IPED Context0 IV1 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX0IV1_CTX0_IV1_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX0IV1_CTX0_IV1_SHIFT (0U) -/*! CTX0_IV1 - Highest 32 bits of IV for region 0. */ -#define FLEXSPI_IPEDCTX0IV1_CTX0_IV1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX0IV1_CTX0_IV1_SHIFT)) & FLEXSPI_IPEDCTX0IV1_CTX0_IV1_MASK) -/*! @} */ - -/*! @name IPEDCTX0START - Start Address of Region */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX0START_GCM_MASK (0x1U) -#define FLEXSPI_IPEDCTX0START_GCM_SHIFT (0U) -/*! GCM - GCM Mode Enable - * 0b0..Disabled. CTR mode is used. - * 0b1..Enabled. GCM mode is used. - */ -#define FLEXSPI_IPEDCTX0START_GCM(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX0START_GCM_SHIFT)) & FLEXSPI_IPEDCTX0START_GCM_MASK) - -#define FLEXSPI_IPEDCTX0START_ahbbuserror_dis_MASK (0x2U) -#define FLEXSPI_IPEDCTX0START_ahbbuserror_dis_SHIFT (1U) -/*! ahbbuserror_dis - AHB Bus Error Disable - * 0b0..AHB bus errors enabled - * 0b1..AHB bus errors disabled - */ -#define FLEXSPI_IPEDCTX0START_ahbbuserror_dis(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX0START_ahbbuserror_dis_SHIFT)) & FLEXSPI_IPEDCTX0START_ahbbuserror_dis_MASK) - -#define FLEXSPI_IPEDCTX0START_start_address_MASK (0xFFFFFF00U) -#define FLEXSPI_IPEDCTX0START_start_address_SHIFT (8U) -/*! start_address - Start Address */ -#define FLEXSPI_IPEDCTX0START_start_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX0START_start_address_SHIFT)) & FLEXSPI_IPEDCTX0START_start_address_MASK) -/*! @} */ - -/*! @name IPEDCTX0END - End Address of Region */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX0END_end_address_MASK (0xFFFFFF00U) -#define FLEXSPI_IPEDCTX0END_end_address_SHIFT (8U) -/*! end_address - End Address of IPED Region */ -#define FLEXSPI_IPEDCTX0END_end_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX0END_end_address_SHIFT)) & FLEXSPI_IPEDCTX0END_end_address_MASK) -/*! @} */ - -/*! @name IPEDCTX0AAD0 - IPED Context0 Additional Authenticated Data0 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX0AAD0_CTX0_AAD0_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX0AAD0_CTX0_AAD0_SHIFT (0U) -/*! CTX0_AAD0 - CTX AAD */ -#define FLEXSPI_IPEDCTX0AAD0_CTX0_AAD0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX0AAD0_CTX0_AAD0_SHIFT)) & FLEXSPI_IPEDCTX0AAD0_CTX0_AAD0_MASK) -/*! @} */ - -/*! @name IPEDCTX0AAD1 - IPED Context0 Additional Authenticated Data1 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX0AAD1_CTX0_AAD1_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX0AAD1_CTX0_AAD1_SHIFT (0U) -/*! CTX0_AAD1 - CTX AAD */ -#define FLEXSPI_IPEDCTX0AAD1_CTX0_AAD1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX0AAD1_CTX0_AAD1_SHIFT)) & FLEXSPI_IPEDCTX0AAD1_CTX0_AAD1_MASK) -/*! @} */ - -/*! @name IPEDCTX1IV0 - IPED Context1 IV0 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX1IV0_CTX1_IV0_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX1IV0_CTX1_IV0_SHIFT (0U) -/*! CTX1_IV0 - Lowest 32 bits of IV for region 1. */ -#define FLEXSPI_IPEDCTX1IV0_CTX1_IV0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX1IV0_CTX1_IV0_SHIFT)) & FLEXSPI_IPEDCTX1IV0_CTX1_IV0_MASK) -/*! @} */ - -/*! @name IPEDCTX1IV1 - IPED Context1 IV1 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX1IV1_CTX1_IV1_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX1IV1_CTX1_IV1_SHIFT (0U) -/*! CTX1_IV1 - Highest 32 bits of IV for region 1. */ -#define FLEXSPI_IPEDCTX1IV1_CTX1_IV1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX1IV1_CTX1_IV1_SHIFT)) & FLEXSPI_IPEDCTX1IV1_CTX1_IV1_MASK) -/*! @} */ - -/*! @name IPEDCTX1START - Start Address of Region */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX1START_GCM_MASK (0x1U) -#define FLEXSPI_IPEDCTX1START_GCM_SHIFT (0U) -/*! GCM - GCM Mode Enable - * 0b0..Disabled. CTR mode is used. - * 0b1..Enabled. GCM mode is used. - */ -#define FLEXSPI_IPEDCTX1START_GCM(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX1START_GCM_SHIFT)) & FLEXSPI_IPEDCTX1START_GCM_MASK) - -#define FLEXSPI_IPEDCTX1START_ahbbuserror_dis_MASK (0x2U) -#define FLEXSPI_IPEDCTX1START_ahbbuserror_dis_SHIFT (1U) -/*! ahbbuserror_dis - AHB Bus Error Disable - * 0b0..AHB bus errors enabled - * 0b1..AHB bus errors disabled - */ -#define FLEXSPI_IPEDCTX1START_ahbbuserror_dis(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX1START_ahbbuserror_dis_SHIFT)) & FLEXSPI_IPEDCTX1START_ahbbuserror_dis_MASK) - -#define FLEXSPI_IPEDCTX1START_start_address_MASK (0xFFFFFF00U) -#define FLEXSPI_IPEDCTX1START_start_address_SHIFT (8U) -/*! start_address - Start Address */ -#define FLEXSPI_IPEDCTX1START_start_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX1START_start_address_SHIFT)) & FLEXSPI_IPEDCTX1START_start_address_MASK) -/*! @} */ - -/*! @name IPEDCTX1END - End Address of Region */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX1END_end_address_MASK (0xFFFFFF00U) -#define FLEXSPI_IPEDCTX1END_end_address_SHIFT (8U) -/*! end_address - End Address of IPED Region */ -#define FLEXSPI_IPEDCTX1END_end_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX1END_end_address_SHIFT)) & FLEXSPI_IPEDCTX1END_end_address_MASK) -/*! @} */ - -/*! @name IPEDCTX1AAD0 - IPED Context1 Additional Authenticated Data0 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX1AAD0_CTX1_AAD0_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX1AAD0_CTX1_AAD0_SHIFT (0U) -/*! CTX1_AAD0 - CTX AAD */ -#define FLEXSPI_IPEDCTX1AAD0_CTX1_AAD0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX1AAD0_CTX1_AAD0_SHIFT)) & FLEXSPI_IPEDCTX1AAD0_CTX1_AAD0_MASK) -/*! @} */ - -/*! @name IPEDCTX1AAD1 - IPED Context1 Additional Authenticated Data1 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX1AAD1_CTX1_AAD1_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX1AAD1_CTX1_AAD1_SHIFT (0U) -/*! CTX1_AAD1 - CTX AAD */ -#define FLEXSPI_IPEDCTX1AAD1_CTX1_AAD1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX1AAD1_CTX1_AAD1_SHIFT)) & FLEXSPI_IPEDCTX1AAD1_CTX1_AAD1_MASK) -/*! @} */ - -/*! @name IPEDCTX2IV0 - IPED Context2 IV0 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX2IV0_CTX2_IV0_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX2IV0_CTX2_IV0_SHIFT (0U) -/*! CTX2_IV0 - Lowest 32 bits of IV for region 2. */ -#define FLEXSPI_IPEDCTX2IV0_CTX2_IV0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX2IV0_CTX2_IV0_SHIFT)) & FLEXSPI_IPEDCTX2IV0_CTX2_IV0_MASK) -/*! @} */ - -/*! @name IPEDCTX2IV1 - IPED Context2 IV1 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX2IV1_CTX2_IV1_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX2IV1_CTX2_IV1_SHIFT (0U) -/*! CTX2_IV1 - Highest 32 bits of IV for region 2. */ -#define FLEXSPI_IPEDCTX2IV1_CTX2_IV1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX2IV1_CTX2_IV1_SHIFT)) & FLEXSPI_IPEDCTX2IV1_CTX2_IV1_MASK) -/*! @} */ - -/*! @name IPEDCTX2START - Start Address of Region */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX2START_GCM_MASK (0x1U) -#define FLEXSPI_IPEDCTX2START_GCM_SHIFT (0U) -/*! GCM - GCM Mode Enable - * 0b0..Disabled. CTR mode is used. - * 0b1..Enabled. GCM mode is used. - */ -#define FLEXSPI_IPEDCTX2START_GCM(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX2START_GCM_SHIFT)) & FLEXSPI_IPEDCTX2START_GCM_MASK) - -#define FLEXSPI_IPEDCTX2START_ahbbuserror_dis_MASK (0x2U) -#define FLEXSPI_IPEDCTX2START_ahbbuserror_dis_SHIFT (1U) -/*! ahbbuserror_dis - AHB Bus Error Disable - * 0b0..AHB bus errors enabled - * 0b1..AHB bus errors disabled - */ -#define FLEXSPI_IPEDCTX2START_ahbbuserror_dis(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX2START_ahbbuserror_dis_SHIFT)) & FLEXSPI_IPEDCTX2START_ahbbuserror_dis_MASK) - -#define FLEXSPI_IPEDCTX2START_start_address_MASK (0xFFFFFF00U) -#define FLEXSPI_IPEDCTX2START_start_address_SHIFT (8U) -/*! start_address - Start Address */ -#define FLEXSPI_IPEDCTX2START_start_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX2START_start_address_SHIFT)) & FLEXSPI_IPEDCTX2START_start_address_MASK) -/*! @} */ - -/*! @name IPEDCTX2END - End Address of Region */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX2END_end_address_MASK (0xFFFFFF00U) -#define FLEXSPI_IPEDCTX2END_end_address_SHIFT (8U) -/*! end_address - End Address of IPED Region */ -#define FLEXSPI_IPEDCTX2END_end_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX2END_end_address_SHIFT)) & FLEXSPI_IPEDCTX2END_end_address_MASK) -/*! @} */ - -/*! @name IPEDCTX2AAD0 - IPED Context2 Additional Authenticated Data0 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX2AAD0_CTX2_AAD0_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX2AAD0_CTX2_AAD0_SHIFT (0U) -/*! CTX2_AAD0 - CTX AAD */ -#define FLEXSPI_IPEDCTX2AAD0_CTX2_AAD0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX2AAD0_CTX2_AAD0_SHIFT)) & FLEXSPI_IPEDCTX2AAD0_CTX2_AAD0_MASK) -/*! @} */ - -/*! @name IPEDCTX2AAD1 - IPED Context2 Additional Authenticated Data1 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX2AAD1_CTX2_AAD1_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX2AAD1_CTX2_AAD1_SHIFT (0U) -/*! CTX2_AAD1 - CTX AAD */ -#define FLEXSPI_IPEDCTX2AAD1_CTX2_AAD1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX2AAD1_CTX2_AAD1_SHIFT)) & FLEXSPI_IPEDCTX2AAD1_CTX2_AAD1_MASK) -/*! @} */ - -/*! @name IPEDCTX3IV0 - IPED Context3 IV0 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX3IV0_CTX3_IV0_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX3IV0_CTX3_IV0_SHIFT (0U) -/*! CTX3_IV0 - Lowest 32 bits of IV for region 3. */ -#define FLEXSPI_IPEDCTX3IV0_CTX3_IV0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX3IV0_CTX3_IV0_SHIFT)) & FLEXSPI_IPEDCTX3IV0_CTX3_IV0_MASK) -/*! @} */ - -/*! @name IPEDCTX3IV1 - IPED Context3 IV1 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX3IV1_CTX3_IV1_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX3IV1_CTX3_IV1_SHIFT (0U) -/*! CTX3_IV1 - Highest 32 bits of IV for region 3. */ -#define FLEXSPI_IPEDCTX3IV1_CTX3_IV1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX3IV1_CTX3_IV1_SHIFT)) & FLEXSPI_IPEDCTX3IV1_CTX3_IV1_MASK) -/*! @} */ - -/*! @name IPEDCTX3START - Start Address of Region */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX3START_GCM_MASK (0x1U) -#define FLEXSPI_IPEDCTX3START_GCM_SHIFT (0U) -/*! GCM - GCM Mode Enable - * 0b0..Disabled. CTR mode is used. - * 0b1..Enabled. GCM mode is used. - */ -#define FLEXSPI_IPEDCTX3START_GCM(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX3START_GCM_SHIFT)) & FLEXSPI_IPEDCTX3START_GCM_MASK) - -#define FLEXSPI_IPEDCTX3START_ahbbuserror_dis_MASK (0x2U) -#define FLEXSPI_IPEDCTX3START_ahbbuserror_dis_SHIFT (1U) -/*! ahbbuserror_dis - AHB Bus Error Disable - * 0b0..AHB bus errors enabled - * 0b1..AHB bus errors disabled - */ -#define FLEXSPI_IPEDCTX3START_ahbbuserror_dis(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX3START_ahbbuserror_dis_SHIFT)) & FLEXSPI_IPEDCTX3START_ahbbuserror_dis_MASK) - -#define FLEXSPI_IPEDCTX3START_start_address_MASK (0xFFFFFF00U) -#define FLEXSPI_IPEDCTX3START_start_address_SHIFT (8U) -/*! start_address - Start Address */ -#define FLEXSPI_IPEDCTX3START_start_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX3START_start_address_SHIFT)) & FLEXSPI_IPEDCTX3START_start_address_MASK) -/*! @} */ - -/*! @name IPEDCTX3END - End Address of Region */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX3END_end_address_MASK (0xFFFFFF00U) -#define FLEXSPI_IPEDCTX3END_end_address_SHIFT (8U) -/*! end_address - End Address of IPED Region */ -#define FLEXSPI_IPEDCTX3END_end_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX3END_end_address_SHIFT)) & FLEXSPI_IPEDCTX3END_end_address_MASK) -/*! @} */ - -/*! @name IPEDCTX3AAD0 - IPED Context3 Additional Authenticated Data0 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX3AAD0_CTX3_AAD0_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX3AAD0_CTX3_AAD0_SHIFT (0U) -/*! CTX3_AAD0 - CTX AAD */ -#define FLEXSPI_IPEDCTX3AAD0_CTX3_AAD0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX3AAD0_CTX3_AAD0_SHIFT)) & FLEXSPI_IPEDCTX3AAD0_CTX3_AAD0_MASK) -/*! @} */ - -/*! @name IPEDCTX3AAD1 - IPED Context3 Additional Authenticated Data1 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX3AAD1_CTX3_AAD1_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX3AAD1_CTX3_AAD1_SHIFT (0U) -/*! CTX3_AAD1 - CTX AAD */ -#define FLEXSPI_IPEDCTX3AAD1_CTX3_AAD1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX3AAD1_CTX3_AAD1_SHIFT)) & FLEXSPI_IPEDCTX3AAD1_CTX3_AAD1_MASK) -/*! @} */ - -/*! @name IPEDCTX4IV0 - IPED Context4 IV0 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX4IV0_CTX4_IV0_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX4IV0_CTX4_IV0_SHIFT (0U) -/*! CTX4_IV0 - Lowest 32 bits of IV for region 4. */ -#define FLEXSPI_IPEDCTX4IV0_CTX4_IV0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX4IV0_CTX4_IV0_SHIFT)) & FLEXSPI_IPEDCTX4IV0_CTX4_IV0_MASK) -/*! @} */ - -/*! @name IPEDCTX4IV1 - IPED Context4 IV1 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX4IV1_CTX4_IV1_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX4IV1_CTX4_IV1_SHIFT (0U) -/*! CTX4_IV1 - Highest 32 bits of IV for region 4. */ -#define FLEXSPI_IPEDCTX4IV1_CTX4_IV1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX4IV1_CTX4_IV1_SHIFT)) & FLEXSPI_IPEDCTX4IV1_CTX4_IV1_MASK) -/*! @} */ - -/*! @name IPEDCTX4START - Start Address of Region */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX4START_GCM_MASK (0x1U) -#define FLEXSPI_IPEDCTX4START_GCM_SHIFT (0U) -/*! GCM - GCM Mode Enable - * 0b0..Disabled. CTR mode is used. - * 0b1..Enabled. GCM mode is used. - */ -#define FLEXSPI_IPEDCTX4START_GCM(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX4START_GCM_SHIFT)) & FLEXSPI_IPEDCTX4START_GCM_MASK) - -#define FLEXSPI_IPEDCTX4START_ahbbuserror_dis_MASK (0x2U) -#define FLEXSPI_IPEDCTX4START_ahbbuserror_dis_SHIFT (1U) -/*! ahbbuserror_dis - AHB Bus Error Disable - * 0b0..AHB bus errors enabled - * 0b1..AHB bus errors disabled - */ -#define FLEXSPI_IPEDCTX4START_ahbbuserror_dis(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX4START_ahbbuserror_dis_SHIFT)) & FLEXSPI_IPEDCTX4START_ahbbuserror_dis_MASK) - -#define FLEXSPI_IPEDCTX4START_start_address_MASK (0xFFFFFF00U) -#define FLEXSPI_IPEDCTX4START_start_address_SHIFT (8U) -/*! start_address - Start Address */ -#define FLEXSPI_IPEDCTX4START_start_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX4START_start_address_SHIFT)) & FLEXSPI_IPEDCTX4START_start_address_MASK) -/*! @} */ - -/*! @name IPEDCTX4END - End Address of Region */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX4END_end_address_MASK (0xFFFFFF00U) -#define FLEXSPI_IPEDCTX4END_end_address_SHIFT (8U) -/*! end_address - End Address of IPED Region */ -#define FLEXSPI_IPEDCTX4END_end_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX4END_end_address_SHIFT)) & FLEXSPI_IPEDCTX4END_end_address_MASK) -/*! @} */ - -/*! @name IPEDCTX4AAD0 - IPED Context4 Additional Authenticated Data0 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX4AAD0_CTX4_AAD0_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX4AAD0_CTX4_AAD0_SHIFT (0U) -/*! CTX4_AAD0 - CTX AAD */ -#define FLEXSPI_IPEDCTX4AAD0_CTX4_AAD0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX4AAD0_CTX4_AAD0_SHIFT)) & FLEXSPI_IPEDCTX4AAD0_CTX4_AAD0_MASK) -/*! @} */ - -/*! @name IPEDCTX4AAD1 - IPED Context4 Additional Authenticated Data1 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX4AAD1_CTX4_AAD1_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX4AAD1_CTX4_AAD1_SHIFT (0U) -/*! CTX4_AAD1 - CTX AAD */ -#define FLEXSPI_IPEDCTX4AAD1_CTX4_AAD1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX4AAD1_CTX4_AAD1_SHIFT)) & FLEXSPI_IPEDCTX4AAD1_CTX4_AAD1_MASK) -/*! @} */ - -/*! @name IPEDCTX5IV0 - IPED Context5 IV0 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX5IV0_CTX5_IV0_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX5IV0_CTX5_IV0_SHIFT (0U) -/*! CTX5_IV0 - Lowest 32 bits of IV for region 5. */ -#define FLEXSPI_IPEDCTX5IV0_CTX5_IV0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX5IV0_CTX5_IV0_SHIFT)) & FLEXSPI_IPEDCTX5IV0_CTX5_IV0_MASK) -/*! @} */ - -/*! @name IPEDCTX5IV1 - IPED Context5 IV1 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX5IV1_CTX5_IV1_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX5IV1_CTX5_IV1_SHIFT (0U) -/*! CTX5_IV1 - Highest 32 bits of IV for region 5. */ -#define FLEXSPI_IPEDCTX5IV1_CTX5_IV1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX5IV1_CTX5_IV1_SHIFT)) & FLEXSPI_IPEDCTX5IV1_CTX5_IV1_MASK) -/*! @} */ - -/*! @name IPEDCTX5START - Start Address of Region */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX5START_GCM_MASK (0x1U) -#define FLEXSPI_IPEDCTX5START_GCM_SHIFT (0U) -/*! GCM - GCM Mode Enable - * 0b0..Disabled. CTR mode is used. - * 0b1..Enabled. GCM mode is used. - */ -#define FLEXSPI_IPEDCTX5START_GCM(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX5START_GCM_SHIFT)) & FLEXSPI_IPEDCTX5START_GCM_MASK) - -#define FLEXSPI_IPEDCTX5START_ahbbuserror_dis_MASK (0x2U) -#define FLEXSPI_IPEDCTX5START_ahbbuserror_dis_SHIFT (1U) -/*! ahbbuserror_dis - AHB Bus Error Disable - * 0b0..AHB bus errors enabled - * 0b1..AHB bus errors disabled - */ -#define FLEXSPI_IPEDCTX5START_ahbbuserror_dis(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX5START_ahbbuserror_dis_SHIFT)) & FLEXSPI_IPEDCTX5START_ahbbuserror_dis_MASK) - -#define FLEXSPI_IPEDCTX5START_start_address_MASK (0xFFFFFF00U) -#define FLEXSPI_IPEDCTX5START_start_address_SHIFT (8U) -/*! start_address - Start Address */ -#define FLEXSPI_IPEDCTX5START_start_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX5START_start_address_SHIFT)) & FLEXSPI_IPEDCTX5START_start_address_MASK) -/*! @} */ - -/*! @name IPEDCTX5END - End Address of Region */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX5END_end_address_MASK (0xFFFFFF00U) -#define FLEXSPI_IPEDCTX5END_end_address_SHIFT (8U) -/*! end_address - End Address of IPED Region */ -#define FLEXSPI_IPEDCTX5END_end_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX5END_end_address_SHIFT)) & FLEXSPI_IPEDCTX5END_end_address_MASK) -/*! @} */ - -/*! @name IPEDCTX5AAD0 - IPED Context5 Additional Authenticated Data0 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX5AAD0_CTX5_AAD0_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX5AAD0_CTX5_AAD0_SHIFT (0U) -/*! CTX5_AAD0 - CTX AAD */ -#define FLEXSPI_IPEDCTX5AAD0_CTX5_AAD0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX5AAD0_CTX5_AAD0_SHIFT)) & FLEXSPI_IPEDCTX5AAD0_CTX5_AAD0_MASK) -/*! @} */ - -/*! @name IPEDCTX5AAD1 - IPED Context5 Additional Authenticated Data1 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX5AAD1_CTX5_AAD1_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX5AAD1_CTX5_AAD1_SHIFT (0U) -/*! CTX5_AAD1 - CTX AAD */ -#define FLEXSPI_IPEDCTX5AAD1_CTX5_AAD1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX5AAD1_CTX5_AAD1_SHIFT)) & FLEXSPI_IPEDCTX5AAD1_CTX5_AAD1_MASK) -/*! @} */ - -/*! @name IPEDCTX6IV0 - IPED Context6 IV0 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX6IV0_CTX6_IV0_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX6IV0_CTX6_IV0_SHIFT (0U) -/*! CTX6_IV0 - Lowest 32 bits of IV for region 6. */ -#define FLEXSPI_IPEDCTX6IV0_CTX6_IV0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX6IV0_CTX6_IV0_SHIFT)) & FLEXSPI_IPEDCTX6IV0_CTX6_IV0_MASK) -/*! @} */ - -/*! @name IPEDCTX6IV1 - IPED Context6 IV1 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX6IV1_CTX6_IV1_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX6IV1_CTX6_IV1_SHIFT (0U) -/*! CTX6_IV1 - Highest 32 bits of IV for region 6. */ -#define FLEXSPI_IPEDCTX6IV1_CTX6_IV1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX6IV1_CTX6_IV1_SHIFT)) & FLEXSPI_IPEDCTX6IV1_CTX6_IV1_MASK) -/*! @} */ - -/*! @name IPEDCTX6START - Start Address of Region */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX6START_GCM_MASK (0x1U) -#define FLEXSPI_IPEDCTX6START_GCM_SHIFT (0U) -/*! GCM - GCM Mode Enable - * 0b0..Disabled. CTR mode is used. - * 0b1..Enabled. GCM mode is used. - */ -#define FLEXSPI_IPEDCTX6START_GCM(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX6START_GCM_SHIFT)) & FLEXSPI_IPEDCTX6START_GCM_MASK) - -#define FLEXSPI_IPEDCTX6START_ahbbuserror_dis_MASK (0x2U) -#define FLEXSPI_IPEDCTX6START_ahbbuserror_dis_SHIFT (1U) -/*! ahbbuserror_dis - AHB Bus Error Disable - * 0b0..AHB bus errors enabled - * 0b1..AHB bus errors disabled - */ -#define FLEXSPI_IPEDCTX6START_ahbbuserror_dis(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX6START_ahbbuserror_dis_SHIFT)) & FLEXSPI_IPEDCTX6START_ahbbuserror_dis_MASK) - -#define FLEXSPI_IPEDCTX6START_start_address_MASK (0xFFFFFF00U) -#define FLEXSPI_IPEDCTX6START_start_address_SHIFT (8U) -/*! start_address - Start Address */ -#define FLEXSPI_IPEDCTX6START_start_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX6START_start_address_SHIFT)) & FLEXSPI_IPEDCTX6START_start_address_MASK) -/*! @} */ - -/*! @name IPEDCTX6END - End Address of Region */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX6END_end_address_MASK (0xFFFFFF00U) -#define FLEXSPI_IPEDCTX6END_end_address_SHIFT (8U) -/*! end_address - End Address of IPED Region */ -#define FLEXSPI_IPEDCTX6END_end_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX6END_end_address_SHIFT)) & FLEXSPI_IPEDCTX6END_end_address_MASK) -/*! @} */ - -/*! @name IPEDCTX6AAD0 - IPED Context6 Additional Authenticated Data0 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX6AAD0_CTX6_AAD0_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX6AAD0_CTX6_AAD0_SHIFT (0U) -/*! CTX6_AAD0 - CTX AAD */ -#define FLEXSPI_IPEDCTX6AAD0_CTX6_AAD0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX6AAD0_CTX6_AAD0_SHIFT)) & FLEXSPI_IPEDCTX6AAD0_CTX6_AAD0_MASK) -/*! @} */ - -/*! @name IPEDCTX6AAD1 - IPED Context6 Additional Authenticated Data1 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX6AAD1_CTX6_AAD1_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX6AAD1_CTX6_AAD1_SHIFT (0U) -/*! CTX6_AAD1 - CTX AAD */ -#define FLEXSPI_IPEDCTX6AAD1_CTX6_AAD1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX6AAD1_CTX6_AAD1_SHIFT)) & FLEXSPI_IPEDCTX6AAD1_CTX6_AAD1_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group FLEXSPI_Register_Masks */ - - -/* FLEXSPI - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral FLEXSPI0 base address */ - #define FLEXSPI0_BASE (0x500C8000u) - /** Peripheral FLEXSPI0 base address */ - #define FLEXSPI0_BASE_NS (0x400C8000u) - /** Peripheral FLEXSPI0 base pointer */ - #define FLEXSPI0 ((FLEXSPI_Type *)FLEXSPI0_BASE) - /** Peripheral FLEXSPI0 base pointer */ - #define FLEXSPI0_NS ((FLEXSPI_Type *)FLEXSPI0_BASE_NS) - /** Array initializer of FLEXSPI peripheral base addresses */ - #define FLEXSPI_BASE_ADDRS { FLEXSPI0_BASE } - /** Array initializer of FLEXSPI peripheral base pointers */ - #define FLEXSPI_BASE_PTRS { FLEXSPI0 } - /** Array initializer of FLEXSPI peripheral base addresses */ - #define FLEXSPI_BASE_ADDRS_NS { FLEXSPI0_BASE_NS } - /** Array initializer of FLEXSPI peripheral base pointers */ - #define FLEXSPI_BASE_PTRS_NS { FLEXSPI0_NS } -#else - /** Peripheral FLEXSPI0 base address */ - #define FLEXSPI0_BASE (0x400C8000u) - /** Peripheral FLEXSPI0 base pointer */ - #define FLEXSPI0 ((FLEXSPI_Type *)FLEXSPI0_BASE) - /** Array initializer of FLEXSPI peripheral base addresses */ - #define FLEXSPI_BASE_ADDRS { FLEXSPI0_BASE } - /** Array initializer of FLEXSPI peripheral base pointers */ - #define FLEXSPI_BASE_PTRS { FLEXSPI0 } -#endif -/** Interrupt vectors for the FLEXSPI peripheral type */ -#define FLEXSPI_IRQS { FLEXSPI0_IRQn } -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) -/** FlexSPI0 AMBA base address */ -#define FlexSPI0_AMBA_BASE (0x18000000u) -/** FlexSPI0 AMBA end address */ -#define FlexSPI0_AMBA_END (0x1FFFFFFFu) -/** FlexSPI0 AMBA base address */ -#define FlexSPI0_AMBA_BASE_NS (0x08000000U) -/** FlexSPI0 AMBA end address */ -#define FlexSPI0_AMBA_END_NS (0x0FFFFFFFU) -/* FlexSPI0 alias1 base address. */ -#define FlexSPI0_ALIAS1_BASE (0x80000000U) -/* FlexSPI0 alias1 base NS address. */ -#define FlexSPI0_ALIAS1_BASE_NS (0x90000000U) -/* FlexSPI0 alias2 base address. */ -#define FlexSPI0_ALIAS2_BASE (0xA0000000U) -/* FlexSPI0 alias2 base NS address. */ -#define FlexSPI0_ALIAS2_BASE_NS (0xB0000000U) -#else -/** FlexSPI0 AMBA base address */ -#define FlexSPI0_AMBA_BASE (0x08000000U) -/** FlexSPI0 AMBA end address */ -#define FlexSPI0_AMBA_END (0x0FFFFFFFU) -/* FlexSPI0 alias1 base address. */ -#define FlexSPI0_ALIAS1_BASE (0x80000000U) -/* FlexSPI0 alias2 base address. */ -#define FlexSPI0_ALIAS2_BASE (0xA0000000U) -#endif - - -/*! - * @} - */ /* end of group FLEXSPI_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- FMU Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FMU_Peripheral_Access_Layer FMU Peripheral Access Layer - * @{ - */ - -/** FMU - Register Layout Typedef */ -typedef struct { - __IO uint32_t FSTAT; /**< Flash Status Register, offset: 0x0 */ - __IO uint32_t FCNFG; /**< Flash Configuration Register, offset: 0x4 */ - __IO uint32_t FCTRL; /**< Flash Control Register, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __IO uint32_t FCCOB[8]; /**< Flash Common Command Object Registers, array offset: 0x10, array step: 0x4 */ -} FMU_Type; - -/* ---------------------------------------------------------------------------- - -- FMU Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FMU_Register_Masks FMU Register Masks - * @{ - */ - -/*! @name FSTAT - Flash Status Register */ -/*! @{ */ - -#define FMU_FSTAT_FAIL_MASK (0x1U) -#define FMU_FSTAT_FAIL_SHIFT (0U) -/*! FAIL - Command Fail Flag - * 0b0..Error not detected - * 0b1..Error detected - */ -#define FMU_FSTAT_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_FAIL_SHIFT)) & FMU_FSTAT_FAIL_MASK) - -#define FMU_FSTAT_CMDABT_MASK (0x4U) -#define FMU_FSTAT_CMDABT_SHIFT (2U) -/*! CMDABT - Command Abort Flag - * 0b0..No command abort detected - * 0b1..Command abort detected - */ -#define FMU_FSTAT_CMDABT(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_CMDABT_SHIFT)) & FMU_FSTAT_CMDABT_MASK) - -#define FMU_FSTAT_PVIOL_MASK (0x10U) -#define FMU_FSTAT_PVIOL_SHIFT (4U) -/*! PVIOL - Command Protection Violation Flag - * 0b0..No protection violation detected - * 0b1..Protection violation detected - */ -#define FMU_FSTAT_PVIOL(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_PVIOL_SHIFT)) & FMU_FSTAT_PVIOL_MASK) - -#define FMU_FSTAT_ACCERR_MASK (0x20U) -#define FMU_FSTAT_ACCERR_SHIFT (5U) -/*! ACCERR - Command Access Error Flag - * 0b0..No access error detected - * 0b1..Access error detected - */ -#define FMU_FSTAT_ACCERR(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_ACCERR_SHIFT)) & FMU_FSTAT_ACCERR_MASK) - -#define FMU_FSTAT_CWSABT_MASK (0x40U) -#define FMU_FSTAT_CWSABT_SHIFT (6U) -/*! CWSABT - Command Write Sequence Abort Flag - * 0b0..Command write sequence not aborted - * 0b1..Command write sequence aborted - */ -#define FMU_FSTAT_CWSABT(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_CWSABT_SHIFT)) & FMU_FSTAT_CWSABT_MASK) - -#define FMU_FSTAT_CCIF_MASK (0x80U) -#define FMU_FSTAT_CCIF_SHIFT (7U) -/*! CCIF - Command Complete Interrupt Flag - * 0b0..Flash command, initialization, or power mode recovery in progress - * 0b1..Flash command, initialization, or power mode recovery has completed - */ -#define FMU_FSTAT_CCIF(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_CCIF_SHIFT)) & FMU_FSTAT_CCIF_MASK) - -#define FMU_FSTAT_CMDPRT_MASK (0x300U) -#define FMU_FSTAT_CMDPRT_SHIFT (8U) -/*! CMDPRT - Command protection level - * 0b00..Secure, normal access - * 0b01..Secure, privileged access - * 0b10..Nonsecure, normal access - * 0b11..Nonsecure, privileged access - */ -#define FMU_FSTAT_CMDPRT(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_CMDPRT_SHIFT)) & FMU_FSTAT_CMDPRT_MASK) - -#define FMU_FSTAT_CMDP_MASK (0x800U) -#define FMU_FSTAT_CMDP_SHIFT (11U) -/*! CMDP - Command protection status flag - * 0b0..Command protection level and domain ID are stale - * 0b1..Command protection level (CMDPRT) and domain ID (CMDDID) are set - */ -#define FMU_FSTAT_CMDP(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_CMDP_SHIFT)) & FMU_FSTAT_CMDP_MASK) - -#define FMU_FSTAT_CMDDID_MASK (0xF000U) -#define FMU_FSTAT_CMDDID_SHIFT (12U) -/*! CMDDID - Command domain ID */ -#define FMU_FSTAT_CMDDID(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_CMDDID_SHIFT)) & FMU_FSTAT_CMDDID_MASK) - -#define FMU_FSTAT_DFDIF_MASK (0x10000U) -#define FMU_FSTAT_DFDIF_SHIFT (16U) -/*! DFDIF - Double Bit Fault Detect Interrupt Flag - * 0b0..Double bit fault not detected during a valid flash read access - * 0b1..Double bit fault detected (or FCTRL[FDFD] is set) during a valid flash read access - */ -#define FMU_FSTAT_DFDIF(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_DFDIF_SHIFT)) & FMU_FSTAT_DFDIF_MASK) - -#define FMU_FSTAT_SALV_USED_MASK (0x20000U) -#define FMU_FSTAT_SALV_USED_SHIFT (17U) -/*! SALV_USED - Salvage Used for Erase operation - * 0b0..Salvage not used during last operation - * 0b1..Salvage used during the last erase operation - */ -#define FMU_FSTAT_SALV_USED(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_SALV_USED_SHIFT)) & FMU_FSTAT_SALV_USED_MASK) - -#define FMU_FSTAT_PEWEN_MASK (0x3000000U) -#define FMU_FSTAT_PEWEN_SHIFT (24U) -/*! PEWEN - Program-Erase Write Enable Control - * 0b00..Writes are not enabled - * 0b01..Writes are enabled for one flash or IFR phrase (phrase programming, sector erase) - * 0b10..Writes are enabled for one flash or IFR page (page programming) - * 0b11..Reserved - */ -#define FMU_FSTAT_PEWEN(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_PEWEN_SHIFT)) & FMU_FSTAT_PEWEN_MASK) - -#define FMU_FSTAT_PERDY_MASK (0x80000000U) -#define FMU_FSTAT_PERDY_SHIFT (31U) -/*! PERDY - Program-Erase Ready Control/Status Flag - * 0b0..Program or sector erase command operation not stalled - * 0b1..Program or sector erase command operation ready to execute - */ -#define FMU_FSTAT_PERDY(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_PERDY_SHIFT)) & FMU_FSTAT_PERDY_MASK) -/*! @} */ - -/*! @name FCNFG - Flash Configuration Register */ -/*! @{ */ - -#define FMU_FCNFG_CCIE_MASK (0x80U) -#define FMU_FCNFG_CCIE_SHIFT (7U) -/*! CCIE - Command Complete Interrupt Enable - * 0b0..Command complete interrupt disabled - * 0b1..Command complete interrupt enabled - */ -#define FMU_FCNFG_CCIE(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCNFG_CCIE_SHIFT)) & FMU_FCNFG_CCIE_MASK) - -#define FMU_FCNFG_ERSREQ_MASK (0x100U) -#define FMU_FCNFG_ERSREQ_SHIFT (8U) -/*! ERSREQ - Mass Erase Request - * 0b0..No request or request complete - * 0b1..Request to run the Mass Erase operation - */ -#define FMU_FCNFG_ERSREQ(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCNFG_ERSREQ_SHIFT)) & FMU_FCNFG_ERSREQ_MASK) - -#define FMU_FCNFG_DFDIE_MASK (0x10000U) -#define FMU_FCNFG_DFDIE_SHIFT (16U) -/*! DFDIE - Double Bit Fault Detect Interrupt Enable - * 0b0..Double bit fault detect interrupt disabled - * 0b1..Double bit fault detect interrupt enabled - */ -#define FMU_FCNFG_DFDIE(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCNFG_DFDIE_SHIFT)) & FMU_FCNFG_DFDIE_MASK) - -#define FMU_FCNFG_ERSIEN0_MASK (0xF000000U) -#define FMU_FCNFG_ERSIEN0_SHIFT (24U) -/*! ERSIEN0 - Erase IFR Sector Enable - Block 0 - * 0b0000..Block 0 IFR Sector X is protected from erase by ERSSCR command - * 0b0001..Block 0 IFR Sector X is not protected from erase by ERSSCR command - */ -#define FMU_FCNFG_ERSIEN0(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCNFG_ERSIEN0_SHIFT)) & FMU_FCNFG_ERSIEN0_MASK) - -#define FMU_FCNFG_ERSIEN1_MASK (0xF0000000U) -#define FMU_FCNFG_ERSIEN1_SHIFT (28U) -/*! ERSIEN1 - Erase IFR Sector Enable - Block 1 (for dual block configs) - * 0b0000..Block 1 IFR Sector X is protected from erase by ERSSCR command - * 0b0001..Block 1 IFR Sector X is not protected from erase by ERSSCR command - */ -#define FMU_FCNFG_ERSIEN1(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCNFG_ERSIEN1_SHIFT)) & FMU_FCNFG_ERSIEN1_MASK) -/*! @} */ - -/*! @name FCTRL - Flash Control Register */ -/*! @{ */ - -#define FMU_FCTRL_RWSC_MASK (0xFU) -#define FMU_FCTRL_RWSC_SHIFT (0U) -/*! RWSC - Read Wait-State Control */ -#define FMU_FCTRL_RWSC(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCTRL_RWSC_SHIFT)) & FMU_FCTRL_RWSC_MASK) - -#define FMU_FCTRL_FDFD_MASK (0x10000U) -#define FMU_FCTRL_FDFD_SHIFT (16U) -/*! FDFD - Force Double Bit Fault Detect - * 0b0..FSTAT[DFDIF] sets only if a double bit fault is detected during a valid flash read access from the platform flash controller - * 0b1..FSTAT[DFDIF] sets during any valid flash read access from the platform flash controller. An interrupt - * request is generated if the DFDIE bit is set. - */ -#define FMU_FCTRL_FDFD(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCTRL_FDFD_SHIFT)) & FMU_FCTRL_FDFD_MASK) - -#define FMU_FCTRL_ABTREQ_MASK (0x1000000U) -#define FMU_FCTRL_ABTREQ_SHIFT (24U) -/*! ABTREQ - Abort Request - * 0b0..No request to abort a command write sequence - * 0b1..Request to abort a command write sequence - */ -#define FMU_FCTRL_ABTREQ(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCTRL_ABTREQ_SHIFT)) & FMU_FCTRL_ABTREQ_MASK) -/*! @} */ - -/*! @name FCCOB - Flash Common Command Object Registers */ -/*! @{ */ - -#define FMU_FCCOB_CCOBn_MASK (0xFFFFFFFFU) -#define FMU_FCCOB_CCOBn_SHIFT (0U) -/*! CCOBn - CCOBn */ -#define FMU_FCCOB_CCOBn(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCCOB_CCOBn_SHIFT)) & FMU_FCCOB_CCOBn_MASK) -/*! @} */ - -/* The count of FMU_FCCOB */ -#define FMU_FCCOB_COUNT (8U) - - -/*! - * @} - */ /* end of group FMU_Register_Masks */ - - -/* FMU - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral FMU0 base address */ - #define FMU0_BASE (0x50043000u) - /** Peripheral FMU0 base address */ - #define FMU0_BASE_NS (0x40043000u) - /** Peripheral FMU0 base pointer */ - #define FMU0 ((FMU_Type *)FMU0_BASE) - /** Peripheral FMU0 base pointer */ - #define FMU0_NS ((FMU_Type *)FMU0_BASE_NS) - /** Array initializer of FMU peripheral base addresses */ - #define FMU_BASE_ADDRS { FMU0_BASE } - /** Array initializer of FMU peripheral base pointers */ - #define FMU_BASE_PTRS { FMU0 } - /** Array initializer of FMU peripheral base addresses */ - #define FMU_BASE_ADDRS_NS { FMU0_BASE_NS } - /** Array initializer of FMU peripheral base pointers */ - #define FMU_BASE_PTRS_NS { FMU0_NS } -#else - /** Peripheral FMU0 base address */ - #define FMU0_BASE (0x40043000u) - /** Peripheral FMU0 base pointer */ - #define FMU0 ((FMU_Type *)FMU0_BASE) - /** Array initializer of FMU peripheral base addresses */ - #define FMU_BASE_ADDRS { FMU0_BASE } - /** Array initializer of FMU peripheral base pointers */ - #define FMU_BASE_PTRS { FMU0 } -#endif - -/*! - * @} - */ /* end of group FMU_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- FMUTEST Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FMUTEST_Peripheral_Access_Layer FMUTEST Peripheral Access Layer - * @{ - */ - -/** FMUTEST - Register Layout Typedef */ -typedef struct { - __IO uint32_t FSTAT; /**< Flash Status Register, offset: 0x0 */ - __IO uint32_t FCNFG; /**< Flash Configuration Register, offset: 0x4 */ - __IO uint32_t FCTRL; /**< Flash Control Register, offset: 0x8 */ - __I uint32_t FTEST; /**< Flash Test Register, offset: 0xC */ - __IO uint32_t FCCOB0; /**< Flash Command Control 0 Register, offset: 0x10 */ - __IO uint32_t FCCOB1; /**< Flash Command Control 1 Register, offset: 0x14 */ - __IO uint32_t FCCOB2; /**< Flash Command Control 2 Register, offset: 0x18 */ - __IO uint32_t FCCOB3; /**< Flash Command Control 3 Register, offset: 0x1C */ - __IO uint32_t FCCOB4; /**< Flash Command Control 4 Register, offset: 0x20 */ - __IO uint32_t FCCOB5; /**< Flash Command Control 5 Register, offset: 0x24 */ - __IO uint32_t FCCOB6; /**< Flash Command Control 6 Register, offset: 0x28 */ - __IO uint32_t FCCOB7; /**< Flash Command Control 7 Register, offset: 0x2C */ - uint8_t RESERVED_0[208]; - __IO uint32_t RESET_STATUS; /**< FMU Initialization Tracking Register, offset: 0x100 */ - __IO uint32_t MCTL; /**< FMU Control Register, offset: 0x104 */ - __I uint32_t BSEL_GEN; /**< FMU Block Select Generation Register, offset: 0x108 */ - __IO uint32_t PWR_OPT; /**< Power Mode Options Register, offset: 0x10C */ - __I uint32_t CMD_CHECK; /**< FMU Command Check Register, offset: 0x110 */ - uint8_t RESERVED_1[12]; - __IO uint32_t BSEL; /**< FMU Block Select Register, offset: 0x120 */ - __IO uint32_t MSIZE; /**< FMU Memory Size Register, offset: 0x124 */ - __IO uint32_t FLASH_RD_ADD; /**< Flash Read Address Register, offset: 0x128 */ - uint8_t RESERVED_2[4]; - __IO uint32_t FLASH_STOP_ADD; /**< Flash Stop Address Register, offset: 0x130 */ - __IO uint32_t FLASH_RD_CTRL; /**< Flash Read Control Register, offset: 0x134 */ - __IO uint32_t MM_ADDR; /**< Memory Map Address Register, offset: 0x138 */ - uint8_t RESERVED_3[4]; - __IO uint32_t MM_WDATA; /**< Memory Map Write Data Register, offset: 0x140 */ - __IO uint32_t MM_CTL; /**< Memory Map Control Register, offset: 0x144 */ - __IO uint32_t UINT_CTL; /**< User Interface Control Register, offset: 0x148 */ - __IO uint32_t RD_DATA0; /**< Read Data 0 Register, offset: 0x14C */ - __IO uint32_t RD_DATA1; /**< Read Data 1 Register, offset: 0x150 */ - __IO uint32_t RD_DATA2; /**< Read Data 2 Register, offset: 0x154 */ - __IO uint32_t RD_DATA3; /**< Read Data 3 Register, offset: 0x158 */ - __IO uint32_t PARITY; /**< Parity Register, offset: 0x15C */ - __IO uint32_t RD_PATH_CTRL_STATUS; /**< Read Path Control and Status Register, offset: 0x160 */ - __IO uint32_t SMW_DIN0; /**< SMW DIN 0 Register, offset: 0x164 */ - __IO uint32_t SMW_DIN1; /**< SMW DIN 1 Register, offset: 0x168 */ - __IO uint32_t SMW_DIN2; /**< SMW DIN 2 Register, offset: 0x16C */ - __IO uint32_t SMW_DIN3; /**< SMW DIN 3 Register, offset: 0x170 */ - __IO uint32_t SMW_ADDR; /**< SMW Address Register, offset: 0x174 */ - __IO uint32_t SMW_CMD_WAIT; /**< SMW Command and Wait Register, offset: 0x178 */ - __I uint32_t SMW_STATUS; /**< SMW Status Register, offset: 0x17C */ - __IO uint32_t SOCTRIM0_0; /**< SoC Trim Phrase 0 Word 0 Register, offset: 0x180 */ - __IO uint32_t SOCTRIM0_1; /**< SoC Trim Phrase 0 Word 1 Register, offset: 0x184 */ - __IO uint32_t SOCTRIM0_2; /**< SoC Trim Phrase 0 Word 2 Register, offset: 0x188 */ - __IO uint32_t SOCTRIM0_3; /**< SoC Trim Phrase 0 Word 3 Register, offset: 0x18C */ - __IO uint32_t SOCTRIM1_0; /**< SoC Trim Phrase 1 Word 0 Register, offset: 0x190 */ - __IO uint32_t SOCTRIM1_1; /**< SoC Trim Phrase 1 Word 1 Register, offset: 0x194 */ - __IO uint32_t SOCTRIM1_2; /**< SoC Trim Phrase 1 Word 2 Register, offset: 0x198 */ - __IO uint32_t SOCTRIM1_3; /**< SoC Trim Phrase 1 Word 3 Register, offset: 0x19C */ - __IO uint32_t SOCTRIM2_0; /**< SoC Trim Phrase 2 Word 0 Register, offset: 0x1A0 */ - __IO uint32_t SOCTRIM2_1; /**< SoC Trim Phrase 2 Word 1 Register, offset: 0x1A4 */ - __IO uint32_t SOCTRIM2_2; /**< SoC Trim Phrase 2 Word 2 Register, offset: 0x1A8 */ - __IO uint32_t SOCTRIM2_3; /**< SoC Trim Phrase 2 Word 3 Register, offset: 0x1AC */ - __IO uint32_t SOCTRIM3_0; /**< SoC Trim Phrase 3 Word 0 Register, offset: 0x1B0 */ - __IO uint32_t SOCTRIM3_1; /**< SoC Trim Phrase 3 Word 1 Register, offset: 0x1B4 */ - __IO uint32_t SOCTRIM3_2; /**< SoC Trim Phrase 3 Word 2 Register, offset: 0x1B8 */ - __IO uint32_t SOCTRIM3_3; /**< SoC Trim Phrase 3 Word 3 Register, offset: 0x1BC */ - __IO uint32_t SOCTRIM4_0; /**< SoC Trim Phrase 4 Word 0 Register, offset: 0x1C0 */ - __IO uint32_t SOCTRIM4_1; /**< SoC Trim Phrase 4 Word 1 Register, offset: 0x1C4 */ - __IO uint32_t SOCTRIM4_2; /**< SoC Trim Phrase 4 Word 2 Register, offset: 0x1C8 */ - __IO uint32_t SOCTRIM4_3; /**< SoC Trim Phrase 4 Word 3 Register, offset: 0x1CC */ - __IO uint32_t SOCTRIM5_0; /**< SoC Trim Phrase 5 Word 0 Register, offset: 0x1D0 */ - __IO uint32_t SOCTRIM5_1; /**< SoC Trim Phrase 5 Word 1 Register, offset: 0x1D4 */ - __IO uint32_t SOCTRIM5_2; /**< SoC Trim Phrase 5 Word 2 Register, offset: 0x1D8 */ - __IO uint32_t SOCTRIM5_3; /**< SoC Trim Phrase 5 Word 3 Register, offset: 0x1DC */ - __IO uint32_t SOCTRIM6_0; /**< SoC Trim Phrase 6 Word 0 Register, offset: 0x1E0 */ - __IO uint32_t SOCTRIM6_1; /**< SoC Trim Phrase 6 Word 1 Register, offset: 0x1E4 */ - __IO uint32_t SOCTRIM6_2; /**< SoC Trim Phrase 6 Word 2 Register, offset: 0x1E8 */ - __IO uint32_t SOCTRIM6_3; /**< SoC Trim Phrase 6 Word 3 Register, offset: 0x1EC */ - __IO uint32_t SOCTRIM7_0; /**< SoC Trim Phrase 7 Word 0 Register, offset: 0x1F0 */ - __IO uint32_t SOCTRIM7_1; /**< SoC Trim Phrase 7 Word 1 Register, offset: 0x1F4 */ - __IO uint32_t SOCTRIM7_2; /**< SoC Trim Phrase 7 Word 2 Register, offset: 0x1F8 */ - __IO uint32_t SOCTRIM7_3; /**< SoC Trim Phrase 7 Word 3 Register, offset: 0x1FC */ - uint8_t RESERVED_4[4]; - __IO uint32_t R_IP_CONFIG; /**< BIST Configuration Register, offset: 0x204 */ - __IO uint32_t R_TESTCODE; /**< BIST Test Code Register, offset: 0x208 */ - __IO uint32_t R_DFT_CTRL; /**< BIST DFT Control Register, offset: 0x20C */ - __IO uint32_t R_ADR_CTRL; /**< BIST Address Control Register, offset: 0x210 */ - __IO uint32_t R_DATA_CTRL0; /**< BIST Data Control 0 Register, offset: 0x214 */ - __IO uint32_t R_PIN_CTRL; /**< BIST Pin Control Register, offset: 0x218 */ - __IO uint32_t R_CNT_LOOP_CTRL; /**< BIST Loop Count Control Register, offset: 0x21C */ - __IO uint32_t R_TIMER_CTRL; /**< BIST Timer Control Register, offset: 0x220 */ - __IO uint32_t R_TEST_CTRL; /**< BIST Test Control Register, offset: 0x224 */ - __O uint32_t R_ABORT_LOOP; /**< BIST Abort Loop Register, offset: 0x228 */ - __I uint32_t R_ADR_QUERY; /**< BIST Address Query Register, offset: 0x22C */ - __I uint32_t R_DOUT_QUERY0; /**< BIST DOUT Query 0 Register, offset: 0x230 */ - uint8_t RESERVED_5[8]; - __I uint32_t R_SMW_QUERY; /**< BIST SMW Query Register, offset: 0x23C */ - __IO uint32_t R_SMW_SETTING0; /**< BIST SMW Setting 0 Register, offset: 0x240 */ - __IO uint32_t R_SMW_SETTING1; /**< BIST SMW Setting 1 Register, offset: 0x244 */ - __IO uint32_t R_SMP_WHV0; /**< BIST SMP WHV Setting 0 Register, offset: 0x248 */ - __IO uint32_t R_SMP_WHV1; /**< BIST SMP WHV Setting 1 Register, offset: 0x24C */ - __IO uint32_t R_SME_WHV0; /**< BIST SME WHV Setting 0 Register, offset: 0x250 */ - __IO uint32_t R_SME_WHV1; /**< BIST SME WHV Setting 1 Register, offset: 0x254 */ - __IO uint32_t R_SMW_SETTING2; /**< BIST SMW Setting 2 Register, offset: 0x258 */ - __I uint32_t R_D_MISR0; /**< BIST DIN MISR 0 Register, offset: 0x25C */ - __I uint32_t R_A_MISR0; /**< BIST Address MISR 0 Register, offset: 0x260 */ - __I uint32_t R_C_MISR0; /**< BIST Control MISR 0 Register, offset: 0x264 */ - __IO uint32_t R_SMW_SETTING3; /**< BIST SMW Setting 3 Register, offset: 0x268 */ - __IO uint32_t R_DATA_CTRL1; /**< BIST Data Control 1 Register, offset: 0x26C */ - __IO uint32_t R_DATA_CTRL2; /**< BIST Data Control 2 Register, offset: 0x270 */ - __IO uint32_t R_DATA_CTRL3; /**< BIST Data Control 3 Register, offset: 0x274 */ - uint8_t RESERVED_6[8]; - __I uint32_t R_REPAIR0_0; /**< BIST Repair 0 for Block 0 Register, offset: 0x280 */ - __I uint32_t R_REPAIR0_1; /**< BIST Repair 1 Block 0 Register, offset: 0x284 */ - __I uint32_t R_REPAIR1_0; /**< BIST Repair 0 Block 1 Register, offset: 0x288 */ - __I uint32_t R_REPAIR1_1; /**< BIST Repair 1 Block 1 Register, offset: 0x28C */ - uint8_t RESERVED_7[132]; - __IO uint32_t R_DATA_CTRL0_EX; /**< BIST Data Control 0 Extension Register, offset: 0x314 */ - uint8_t RESERVED_8[8]; - __IO uint32_t R_TIMER_CTRL_EX; /**< BIST Timer Control Extension Register, offset: 0x320 */ - uint8_t RESERVED_9[12]; - __I uint32_t R_DOUT_QUERY1; /**< BIST DOUT Query 1 Register, offset: 0x330 */ - uint8_t RESERVED_10[40]; - __I uint32_t R_D_MISR1; /**< BIST DIN MISR 1 Register, offset: 0x35C */ - __I uint32_t R_A_MISR1; /**< BIST Address MISR 1 Register, offset: 0x360 */ - __I uint32_t R_C_MISR1; /**< BIST Control MISR 1 Register, offset: 0x364 */ - uint8_t RESERVED_11[4]; - __IO uint32_t R_DATA_CTRL1_EX; /**< BIST Data Control 1 Extension Register, offset: 0x36C */ - __IO uint32_t R_DATA_CTRL2_EX; /**< BIST Data Control 2 Extension Register, offset: 0x370 */ - __IO uint32_t R_DATA_CTRL3_EX; /**< BIST Data Control 3 Extension Register, offset: 0x374 */ - uint8_t RESERVED_12[136]; - __IO uint32_t SMW_TIMER_OPTION; /**< SMW Timer Option Register, offset: 0x400 */ - __IO uint32_t SMW_SETTING_OPTION0; /**< SMW Setting Option 0 Register, offset: 0x404 */ - __IO uint32_t SMW_SETTING_OPTION2; /**< SMW Setting Option 2 Register, offset: 0x408 */ - __IO uint32_t SMW_SETTING_OPTION3; /**< SMW Setting Option 3 Register, offset: 0x40C */ - __IO uint32_t SMW_SMP_WHV_OPTION0; /**< SMW SMP WHV Option 0 Register, offset: 0x410 */ - __IO uint32_t SMW_SME_WHV_OPTION0; /**< SMW SME WHV Option 0 Register, offset: 0x414 */ - __IO uint32_t SMW_SETTING_OPTION1; /**< SMW Setting Option 1 Register, offset: 0x418 */ - __IO uint32_t SMW_SMP_WHV_OPTION1; /**< SMW SMP WHV Option 1 Register, offset: 0x41C */ - __IO uint32_t SMW_SME_WHV_OPTION1; /**< SMW SME WHV Option 1 Register, offset: 0x420 */ - uint8_t RESERVED_13[220]; - __IO uint32_t REPAIR0_0; /**< FMU Repair 0 Block 0 Register, offset: 0x500 */ - __IO uint32_t REPAIR0_1; /**< FMU Repair 1 Block 0 Register, offset: 0x504 */ - __IO uint32_t REPAIR1_0; /**< FMU Repair 0 Block 1 Register, offset: 0x508 */ - __IO uint32_t REPAIR1_1; /**< FMU Repair 1 Block 1 Register, offset: 0x50C */ - uint8_t RESERVED_14[240]; - __IO uint32_t SMW_HB_SIGNALS; /**< SMW HB Signals Register, offset: 0x600 */ - __IO uint32_t BIST_DUMP_CTRL; /**< BIST Datadump Control Register, offset: 0x604 */ - uint8_t RESERVED_15[4]; - __IO uint32_t ATX_PIN_CTRL; /**< ATX Pin Control Register, offset: 0x60C */ - __IO uint32_t FAILCNT; /**< Fail Count Register, offset: 0x610 */ - __IO uint32_t PGM_PULSE_CNT0; /**< Block 0 Program Pulse Count Register, offset: 0x614 */ - __IO uint32_t PGM_PULSE_CNT1; /**< Block 1 Program Pulse Count Register, offset: 0x618 */ - __IO uint32_t ERS_PULSE_CNT; /**< Erase Pulse Count Register, offset: 0x61C */ - __IO uint32_t MAX_PULSE_CNT; /**< Maximum Pulse Count Register, offset: 0x620 */ - __IO uint32_t PORT_CTRL; /**< Port Control Register, offset: 0x624 */ -} FMUTEST_Type; - -/* ---------------------------------------------------------------------------- - -- FMUTEST Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FMUTEST_Register_Masks FMUTEST Register Masks - * @{ - */ - -/*! @name FSTAT - Flash Status Register */ -/*! @{ */ - -#define FMUTEST_FSTAT_FAIL_MASK (0x1U) -#define FMUTEST_FSTAT_FAIL_SHIFT (0U) -/*! FAIL - Command Fail Flag - * 0b0..Error not detected - * 0b1..Error detected - */ -#define FMUTEST_FSTAT_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_FAIL_SHIFT)) & FMUTEST_FSTAT_FAIL_MASK) - -#define FMUTEST_FSTAT_CMDABT_MASK (0x4U) -#define FMUTEST_FSTAT_CMDABT_SHIFT (2U) -/*! CMDABT - Command Abort Flag - * 0b0..No command abort detected - * 0b1..Command abort detected - */ -#define FMUTEST_FSTAT_CMDABT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_CMDABT_SHIFT)) & FMUTEST_FSTAT_CMDABT_MASK) - -#define FMUTEST_FSTAT_PVIOL_MASK (0x10U) -#define FMUTEST_FSTAT_PVIOL_SHIFT (4U) -/*! PVIOL - Command Protection Violation Flag - * 0b0..No protection violation detected - * 0b1..Protection violation detected - */ -#define FMUTEST_FSTAT_PVIOL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_PVIOL_SHIFT)) & FMUTEST_FSTAT_PVIOL_MASK) - -#define FMUTEST_FSTAT_ACCERR_MASK (0x20U) -#define FMUTEST_FSTAT_ACCERR_SHIFT (5U) -/*! ACCERR - Command Access Error Flag - * 0b0..No access error detected - * 0b1..Access error detected - */ -#define FMUTEST_FSTAT_ACCERR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_ACCERR_SHIFT)) & FMUTEST_FSTAT_ACCERR_MASK) - -#define FMUTEST_FSTAT_CWSABT_MASK (0x40U) -#define FMUTEST_FSTAT_CWSABT_SHIFT (6U) -/*! CWSABT - Command Write Sequence Abort Flag - * 0b0..Command write sequence not aborted - * 0b1..Command write sequence aborted - */ -#define FMUTEST_FSTAT_CWSABT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_CWSABT_SHIFT)) & FMUTEST_FSTAT_CWSABT_MASK) - -#define FMUTEST_FSTAT_CCIF_MASK (0x80U) -#define FMUTEST_FSTAT_CCIF_SHIFT (7U) -/*! CCIF - Command Complete Interrupt Flag - * 0b0..Flash command or initialization in progress - * 0b1..Flash command or initialization has completed - */ -#define FMUTEST_FSTAT_CCIF(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_CCIF_SHIFT)) & FMUTEST_FSTAT_CCIF_MASK) - -#define FMUTEST_FSTAT_CMDPRT_MASK (0x300U) -#define FMUTEST_FSTAT_CMDPRT_SHIFT (8U) -/*! CMDPRT - Command Protection Level - * 0b00..Secure, normal access - * 0b01..Secure, privileged access - * 0b10..Nonsecure, normal access - * 0b11..Nonsecure, privileged access - */ -#define FMUTEST_FSTAT_CMDPRT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_CMDPRT_SHIFT)) & FMUTEST_FSTAT_CMDPRT_MASK) - -#define FMUTEST_FSTAT_CMDP_MASK (0x800U) -#define FMUTEST_FSTAT_CMDP_SHIFT (11U) -/*! CMDP - Command Protection Status Flag - * 0b0..Command protection level and domain ID are stale - * 0b1..Command protection level (CMDPRT) and domain ID (CMDDID) are set - */ -#define FMUTEST_FSTAT_CMDP(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_CMDP_SHIFT)) & FMUTEST_FSTAT_CMDP_MASK) - -#define FMUTEST_FSTAT_CMDDID_MASK (0xF000U) -#define FMUTEST_FSTAT_CMDDID_SHIFT (12U) -/*! CMDDID - Command Domain ID */ -#define FMUTEST_FSTAT_CMDDID(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_CMDDID_SHIFT)) & FMUTEST_FSTAT_CMDDID_MASK) - -#define FMUTEST_FSTAT_DFDIF_MASK (0x10000U) -#define FMUTEST_FSTAT_DFDIF_SHIFT (16U) -/*! DFDIF - Double Bit Fault Detect Interrupt Flag - * 0b0..Double bit fault not detected during a valid flash read access from the FMC - * 0b1..Double bit fault detected (or FCTRL[FDFD] is set) during a valid flash read access from the FMC - */ -#define FMUTEST_FSTAT_DFDIF(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_DFDIF_SHIFT)) & FMUTEST_FSTAT_DFDIF_MASK) - -#define FMUTEST_FSTAT_SALV_USED_MASK (0x20000U) -#define FMUTEST_FSTAT_SALV_USED_SHIFT (17U) -/*! SALV_USED - Salvage Used for Erase operation - * 0b0..Salvage not used during the last operation - * 0b1..Salvage used during the last erase operation - */ -#define FMUTEST_FSTAT_SALV_USED(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_SALV_USED_SHIFT)) & FMUTEST_FSTAT_SALV_USED_MASK) - -#define FMUTEST_FSTAT_PEWEN_MASK (0x3000000U) -#define FMUTEST_FSTAT_PEWEN_SHIFT (24U) -/*! PEWEN - Program-Erase Write Enable Control - * 0b00..Writes are not enabled - * 0b01..Writes are enabled for one flash or IFR phrase (phrase programming, sector erase) - * 0b10..Writes are enabled for one flash or IFR page (page programming) - * 0b11..Reserved - */ -#define FMUTEST_FSTAT_PEWEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_PEWEN_SHIFT)) & FMUTEST_FSTAT_PEWEN_MASK) - -#define FMUTEST_FSTAT_PERDY_MASK (0x80000000U) -#define FMUTEST_FSTAT_PERDY_SHIFT (31U) -/*! PERDY - Program/Erase Ready Control/Status Flag - * 0b0..Program or sector erase command operation is not stalled - * 0b1..Program or sector erase command operation is stalled - */ -#define FMUTEST_FSTAT_PERDY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_PERDY_SHIFT)) & FMUTEST_FSTAT_PERDY_MASK) -/*! @} */ - -/*! @name FCNFG - Flash Configuration Register */ -/*! @{ */ - -#define FMUTEST_FCNFG_CCIE_MASK (0x80U) -#define FMUTEST_FCNFG_CCIE_SHIFT (7U) -/*! CCIE - Command Complete Interrupt Enable - * 0b0..Command complete interrupt disabled - * 0b1..Command complete interrupt enabled. An interrupt request is generated whenever the FSTAT[CCIF] flag is set. - */ -#define FMUTEST_FCNFG_CCIE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCNFG_CCIE_SHIFT)) & FMUTEST_FCNFG_CCIE_MASK) - -#define FMUTEST_FCNFG_ERSREQ_MASK (0x100U) -#define FMUTEST_FCNFG_ERSREQ_SHIFT (8U) -/*! ERSREQ - Mass Erase (Erase All) Request - * 0b0..No request or request complete - * 0b1..Request to run the Mass Erase operation - */ -#define FMUTEST_FCNFG_ERSREQ(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCNFG_ERSREQ_SHIFT)) & FMUTEST_FCNFG_ERSREQ_MASK) - -#define FMUTEST_FCNFG_DFDIE_MASK (0x10000U) -#define FMUTEST_FCNFG_DFDIE_SHIFT (16U) -/*! DFDIE - Double Bit Fault Detect Interrupt Enable - * 0b0..Double bit fault detect interrupt disabled - * 0b1..Double bit fault detect interrupt enabled; an interrupt request is generated whenever the FSTAT[DFDIF] flag is set - */ -#define FMUTEST_FCNFG_DFDIE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCNFG_DFDIE_SHIFT)) & FMUTEST_FCNFG_DFDIE_MASK) - -#define FMUTEST_FCNFG_ERSIEN0_MASK (0xF000000U) -#define FMUTEST_FCNFG_ERSIEN0_SHIFT (24U) -/*! ERSIEN0 - Erase IFR Sector Enable - Block 0 - * 0b0000..Block 0 IFR Sector X is protected from erase by ERSSCR command - * 0b0001..Block 0 IFR Sector X is not protected from erase by ERSSCR command - */ -#define FMUTEST_FCNFG_ERSIEN0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCNFG_ERSIEN0_SHIFT)) & FMUTEST_FCNFG_ERSIEN0_MASK) - -#define FMUTEST_FCNFG_ERSIEN1_MASK (0xF0000000U) -#define FMUTEST_FCNFG_ERSIEN1_SHIFT (28U) -/*! ERSIEN1 - Erase IFR Sector Enable - Block 1 (for dual block configs) - * 0b0000..Block 1 IFR Sector X is protected from erase by ERSSCR command - * 0b0001..Block 1 IFR Sector X is not protected from erase by ERSSCR command - */ -#define FMUTEST_FCNFG_ERSIEN1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCNFG_ERSIEN1_SHIFT)) & FMUTEST_FCNFG_ERSIEN1_MASK) -/*! @} */ - -/*! @name FCTRL - Flash Control Register */ -/*! @{ */ - -#define FMUTEST_FCTRL_RWSC_MASK (0xFU) -#define FMUTEST_FCTRL_RWSC_SHIFT (0U) -/*! RWSC - Read Wait-State Control - * 0b0000..no additional wait-states are added (single cycle access) - * 0b0001..1 additional wait-state is added - * 0b0010..2 additional wait-states are added - * 0b0011..3 additional wait-states are added - * 0b0100..4 additional wait-states are added - * 0b0101..5 additional wait-states are added - * 0b0110..6 additional wait-states are added - * 0b0111..7 additional wait-states are added - * 0b1000..8 additional wait-states are added - * 0b1001..9 additional wait-states are added - * 0b1010..10 additional wait-states are added - * 0b1011..11 additional wait-states are added - * 0b1100..12 additional wait-states are added - * 0b1101..13 additional wait-states are added - * 0b1110..14 additional wait-states are added - * 0b1111..15 additional wait-states are added - */ -#define FMUTEST_FCTRL_RWSC(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCTRL_RWSC_SHIFT)) & FMUTEST_FCTRL_RWSC_MASK) - -#define FMUTEST_FCTRL_LSACTIVE_MASK (0x100U) -#define FMUTEST_FCTRL_LSACTIVE_SHIFT (8U) -/*! LSACTIVE - Low Speed Active Mode - * 0b0..Full speed active mode requested - * 0b1..Low speed active mode requested - */ -#define FMUTEST_FCTRL_LSACTIVE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCTRL_LSACTIVE_SHIFT)) & FMUTEST_FCTRL_LSACTIVE_MASK) - -#define FMUTEST_FCTRL_FDFD_MASK (0x10000U) -#define FMUTEST_FCTRL_FDFD_SHIFT (16U) -/*! FDFD - Force Double Bit Fault Detect - * 0b0..FSTAT[DFDIF] sets only if a double bit fault is detected during a valid flash read access from the FMC - * 0b1..FSTAT[DFDIF] sets during any valid flash read access from the FMC; an interrupt request is generated if the DFDIE bit is set - */ -#define FMUTEST_FCTRL_FDFD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCTRL_FDFD_SHIFT)) & FMUTEST_FCTRL_FDFD_MASK) - -#define FMUTEST_FCTRL_ABTREQ_MASK (0x1000000U) -#define FMUTEST_FCTRL_ABTREQ_SHIFT (24U) -/*! ABTREQ - Abort Request - * 0b0..No request to abort a command write sequence - * 0b1..Request to abort a command write sequence - */ -#define FMUTEST_FCTRL_ABTREQ(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCTRL_ABTREQ_SHIFT)) & FMUTEST_FCTRL_ABTREQ_MASK) -/*! @} */ - -/*! @name FTEST - Flash Test Register */ -/*! @{ */ - -#define FMUTEST_FTEST_TMECTL_MASK (0x1U) -#define FMUTEST_FTEST_TMECTL_SHIFT (0U) -/*! TMECTL - Test Mode Entry Control - * 0b0..FTEST register always reads 0 and writes to FTEST are ignored - * 0b1..FTEST register is readable and can be written to enable writability of TME - */ -#define FMUTEST_FTEST_TMECTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FTEST_TMECTL_SHIFT)) & FMUTEST_FTEST_TMECTL_MASK) - -#define FMUTEST_FTEST_TMEWR_MASK (0x2U) -#define FMUTEST_FTEST_TMEWR_SHIFT (1U) -/*! TMEWR - Test Mode Entry Writable - * 0b0..TME bit is not writable - * 0b1..TME bit is writable - */ -#define FMUTEST_FTEST_TMEWR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FTEST_TMEWR_SHIFT)) & FMUTEST_FTEST_TMEWR_MASK) - -#define FMUTEST_FTEST_TME_MASK (0x4U) -#define FMUTEST_FTEST_TME_SHIFT (2U) -/*! TME - Test Mode Entry - * 0b0..Test mode entry not requested - * 0b1..Test mode entry requested - */ -#define FMUTEST_FTEST_TME(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FTEST_TME_SHIFT)) & FMUTEST_FTEST_TME_MASK) - -#define FMUTEST_FTEST_TMODE_MASK (0x8U) -#define FMUTEST_FTEST_TMODE_SHIFT (3U) -/*! TMODE - Test Mode Status - * 0b0..Test mode not active - * 0b1..Test mode active - */ -#define FMUTEST_FTEST_TMODE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FTEST_TMODE_SHIFT)) & FMUTEST_FTEST_TMODE_MASK) - -#define FMUTEST_FTEST_TMELOCK_MASK (0x10U) -#define FMUTEST_FTEST_TMELOCK_SHIFT (4U) -/*! TMELOCK - Test Mode Entry Lock - * 0b0..FTEST register not locked from accepting writes - * 0b1..FTEST register locked from accepting writes - */ -#define FMUTEST_FTEST_TMELOCK(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FTEST_TMELOCK_SHIFT)) & FMUTEST_FTEST_TMELOCK_MASK) -/*! @} */ - -/*! @name FCCOB0 - Flash Command Control 0 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB0_CMDCODE_MASK (0xFFU) -#define FMUTEST_FCCOB0_CMDCODE_SHIFT (0U) -/*! CMDCODE - Command code */ -#define FMUTEST_FCCOB0_CMDCODE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB0_CMDCODE_SHIFT)) & FMUTEST_FCCOB0_CMDCODE_MASK) -/*! @} */ - -/*! @name FCCOB1 - Flash Command Control 1 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB1_CMDOPT_MASK (0xFFU) -#define FMUTEST_FCCOB1_CMDOPT_SHIFT (0U) -/*! CMDOPT - Command options */ -#define FMUTEST_FCCOB1_CMDOPT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB1_CMDOPT_SHIFT)) & FMUTEST_FCCOB1_CMDOPT_MASK) -/*! @} */ - -/*! @name FCCOB2 - Flash Command Control 2 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB2_CMDADDR_MASK (0xFFFFFFFFU) -#define FMUTEST_FCCOB2_CMDADDR_SHIFT (0U) -/*! CMDADDR - Command starting address */ -#define FMUTEST_FCCOB2_CMDADDR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB2_CMDADDR_SHIFT)) & FMUTEST_FCCOB2_CMDADDR_MASK) -/*! @} */ - -/*! @name FCCOB3 - Flash Command Control 3 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB3_CMDADDRE_MASK (0xFFFFFFFFU) -#define FMUTEST_FCCOB3_CMDADDRE_SHIFT (0U) -/*! CMDADDRE - Command ending address */ -#define FMUTEST_FCCOB3_CMDADDRE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB3_CMDADDRE_SHIFT)) & FMUTEST_FCCOB3_CMDADDRE_MASK) -/*! @} */ - -/*! @name FCCOB4 - Flash Command Control 4 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB4_CMDDATA0_MASK (0xFFFFFFFFU) -#define FMUTEST_FCCOB4_CMDDATA0_SHIFT (0U) -/*! CMDDATA0 - Command data word 0 */ -#define FMUTEST_FCCOB4_CMDDATA0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB4_CMDDATA0_SHIFT)) & FMUTEST_FCCOB4_CMDDATA0_MASK) -/*! @} */ - -/*! @name FCCOB5 - Flash Command Control 5 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB5_CMDDATA1_MASK (0xFFFFFFFFU) -#define FMUTEST_FCCOB5_CMDDATA1_SHIFT (0U) -/*! CMDDATA1 - Command data word 1 */ -#define FMUTEST_FCCOB5_CMDDATA1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB5_CMDDATA1_SHIFT)) & FMUTEST_FCCOB5_CMDDATA1_MASK) -/*! @} */ - -/*! @name FCCOB6 - Flash Command Control 6 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB6_CMDDATA2_MASK (0xFFFFFFFFU) -#define FMUTEST_FCCOB6_CMDDATA2_SHIFT (0U) -/*! CMDDATA2 - Command data word 2 */ -#define FMUTEST_FCCOB6_CMDDATA2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB6_CMDDATA2_SHIFT)) & FMUTEST_FCCOB6_CMDDATA2_MASK) -/*! @} */ - -/*! @name FCCOB7 - Flash Command Control 7 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB7_CMDDATA3_MASK (0xFFFFFFFFU) -#define FMUTEST_FCCOB7_CMDDATA3_SHIFT (0U) -/*! CMDDATA3 - Command data word 3 */ -#define FMUTEST_FCCOB7_CMDDATA3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB7_CMDDATA3_SHIFT)) & FMUTEST_FCCOB7_CMDDATA3_MASK) -/*! @} */ - -/*! @name RESET_STATUS - FMU Initialization Tracking Register */ -/*! @{ */ - -#define FMUTEST_RESET_STATUS_ARY_TRIM_DONE_MASK (0x1U) -#define FMUTEST_RESET_STATUS_ARY_TRIM_DONE_SHIFT (0U) -/*! ARY_TRIM_DONE - Array Trim Complete - * 0b0..Recall register load operation has not been completed - * 0b1..Recall register load operation has completed - */ -#define FMUTEST_RESET_STATUS_ARY_TRIM_DONE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_ARY_TRIM_DONE_SHIFT)) & FMUTEST_RESET_STATUS_ARY_TRIM_DONE_MASK) - -#define FMUTEST_RESET_STATUS_FMU_PARM_EN_MASK (0x2U) -#define FMUTEST_RESET_STATUS_FMU_PARM_EN_SHIFT (1U) -/*! FMU_PARM_EN - Status of the C0DE_C0DEh check to enable loading of the FMU parameters - * 0b0..C0DE_C0DEh check not attempted - * 0b1..C0DE_C0DEh check completed - */ -#define FMUTEST_RESET_STATUS_FMU_PARM_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_FMU_PARM_EN_SHIFT)) & FMUTEST_RESET_STATUS_FMU_PARM_EN_MASK) - -#define FMUTEST_RESET_STATUS_FMU_PARM_DONE_MASK (0x4U) -#define FMUTEST_RESET_STATUS_FMU_PARM_DONE_SHIFT (2U) -/*! FMU_PARM_DONE - FMU Register Load Complete - * 0b0..FMU registers have not been loaded - * 0b1..FMU registers have been loaded - */ -#define FMUTEST_RESET_STATUS_FMU_PARM_DONE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_FMU_PARM_DONE_SHIFT)) & FMUTEST_RESET_STATUS_FMU_PARM_DONE_MASK) - -#define FMUTEST_RESET_STATUS_SOC_TRIM_EN_MASK (0x8U) -#define FMUTEST_RESET_STATUS_SOC_TRIM_EN_SHIFT (3U) -/*! SOC_TRIM_EN - Status of the C0DE_C0DEh check to enable loading of the SoC trim settings - * 0b0..C0DE_C0DEh check not attempted - * 0b1..C0DE_C0DEh check completed - */ -#define FMUTEST_RESET_STATUS_SOC_TRIM_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_SOC_TRIM_EN_SHIFT)) & FMUTEST_RESET_STATUS_SOC_TRIM_EN_MASK) - -#define FMUTEST_RESET_STATUS_SOC_TRIM_ECC_MASK (0x10U) -#define FMUTEST_RESET_STATUS_SOC_TRIM_ECC_SHIFT (4U) -/*! SOC_TRIM_ECC - Status of the C0DE_C0DEh check for enabling ECC decoder during reads of SoC trim settings - * 0b0..C0DE_C0DEh check failed - * 0b1..C0DE_C0DEh check passed - */ -#define FMUTEST_RESET_STATUS_SOC_TRIM_ECC(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_SOC_TRIM_ECC_SHIFT)) & FMUTEST_RESET_STATUS_SOC_TRIM_ECC_MASK) - -#define FMUTEST_RESET_STATUS_SOC_TRIM_DONE_MASK (0x20U) -#define FMUTEST_RESET_STATUS_SOC_TRIM_DONE_SHIFT (5U) -/*! SOC_TRIM_DONE - SoC Trim Complete - * 0b0..SoC Trim registers have not been updated - * 0b1..All SoC Trim registers have been updated - */ -#define FMUTEST_RESET_STATUS_SOC_TRIM_DONE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_SOC_TRIM_DONE_SHIFT)) & FMUTEST_RESET_STATUS_SOC_TRIM_DONE_MASK) - -#define FMUTEST_RESET_STATUS_RPR_DONE_MASK (0x40U) -#define FMUTEST_RESET_STATUS_RPR_DONE_SHIFT (6U) -/*! RPR_DONE - Array Repair Complete - * 0b0..Repair registers have not been loaded - * 0b1..Repair registers have been loaded - */ -#define FMUTEST_RESET_STATUS_RPR_DONE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_RPR_DONE_SHIFT)) & FMUTEST_RESET_STATUS_RPR_DONE_MASK) - -#define FMUTEST_RESET_STATUS_INIT_DONE_MASK (0x80U) -#define FMUTEST_RESET_STATUS_INIT_DONE_SHIFT (7U) -/*! INIT_DONE - Initialization Done - * 0b0..All initialization steps did not complete - * 0b1..All initialization steps completed - */ -#define FMUTEST_RESET_STATUS_INIT_DONE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_INIT_DONE_SHIFT)) & FMUTEST_RESET_STATUS_INIT_DONE_MASK) - -#define FMUTEST_RESET_STATUS_RST_SF_ERR_MASK (0x100U) -#define FMUTEST_RESET_STATUS_RST_SF_ERR_SHIFT (8U) -/*! RST_SF_ERR - ECC Single Fault during Reset Recovery - * 0b0..No single-bit faults detected during initialization - * 0b1..At least one single ECC fault was detected during initialization - */ -#define FMUTEST_RESET_STATUS_RST_SF_ERR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_RST_SF_ERR_SHIFT)) & FMUTEST_RESET_STATUS_RST_SF_ERR_MASK) - -#define FMUTEST_RESET_STATUS_RST_DF_ERR_MASK (0x200U) -#define FMUTEST_RESET_STATUS_RST_DF_ERR_SHIFT (9U) -/*! RST_DF_ERR - ECC Double Fault during Reset Recovery - * 0b0..No double-bit faults detected during initialization - * 0b1..Double-bit ECC fault was detected during initialization - */ -#define FMUTEST_RESET_STATUS_RST_DF_ERR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_RST_DF_ERR_SHIFT)) & FMUTEST_RESET_STATUS_RST_DF_ERR_MASK) - -#define FMUTEST_RESET_STATUS_SOC_TRIM_DF_ERR_MASK (0x3FC00U) -#define FMUTEST_RESET_STATUS_SOC_TRIM_DF_ERR_SHIFT (10U) -/*! SOC_TRIM_DF_ERR - ECC Double Fault during load of SoC Trim phrases */ -#define FMUTEST_RESET_STATUS_SOC_TRIM_DF_ERR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_SOC_TRIM_DF_ERR_SHIFT)) & FMUTEST_RESET_STATUS_SOC_TRIM_DF_ERR_MASK) - -#define FMUTEST_RESET_STATUS_RST_PATCH_LD_MASK (0x40000U) -#define FMUTEST_RESET_STATUS_RST_PATCH_LD_SHIFT (18U) -/*! RST_PATCH_LD - Reset Patch Required - * 0b0..No patch required to be loaded during reset - * 0b1..Patch loaded during reset - */ -#define FMUTEST_RESET_STATUS_RST_PATCH_LD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_RST_PATCH_LD_SHIFT)) & FMUTEST_RESET_STATUS_RST_PATCH_LD_MASK) - -#define FMUTEST_RESET_STATUS_RECALL_DATA_MISMATCH_MASK (0x80000U) -#define FMUTEST_RESET_STATUS_RECALL_DATA_MISMATCH_SHIFT (19U) -/*! RECALL_DATA_MISMATCH - Recall Data Mismatch - * 0b0..Data read towards end of reset matched data read for Recall - * 0b1..Data read towards end of reset did not match data read for recall - */ -#define FMUTEST_RESET_STATUS_RECALL_DATA_MISMATCH(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_RECALL_DATA_MISMATCH_SHIFT)) & FMUTEST_RESET_STATUS_RECALL_DATA_MISMATCH_MASK) -/*! @} */ - -/*! @name MCTL - FMU Control Register */ -/*! @{ */ - -#define FMUTEST_MCTL_COREHLD_MASK (0x1U) -#define FMUTEST_MCTL_COREHLD_SHIFT (0U) -/*! COREHLD - Core Hold - * 0b0..CPU access is allowed - * 0b1..CPU access must be blocked - */ -#define FMUTEST_MCTL_COREHLD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_COREHLD_SHIFT)) & FMUTEST_MCTL_COREHLD_MASK) - -#define FMUTEST_MCTL_LSACT_EN_MASK (0x4U) -#define FMUTEST_MCTL_LSACT_EN_SHIFT (2U) -/*! LSACT_EN - LSACTIVE Feature Enable - * 0b0..LSACTIVE feature disabled completely: FCTRL[LSACTIVE] is forced low and no longer writable, LVE cannot assert at the TSMC array interface. - * 0b1..LSACTIVE feature fully enabled and controllable by SoC and internal UINT SM. - */ -#define FMUTEST_MCTL_LSACT_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_LSACT_EN_SHIFT)) & FMUTEST_MCTL_LSACT_EN_MASK) - -#define FMUTEST_MCTL_LSACTWREN_MASK (0x8U) -#define FMUTEST_MCTL_LSACTWREN_SHIFT (3U) -/*! LSACTWREN - LSACTIVE Write Enable - * 0b0..Unrestricted write access allowed - * 0b1..Write access while CMP set must match CMDDID and CMDPRT - */ -#define FMUTEST_MCTL_LSACTWREN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_LSACTWREN_SHIFT)) & FMUTEST_MCTL_LSACTWREN_MASK) - -#define FMUTEST_MCTL_MASTER_REPAIR_EN_MASK (0x10U) -#define FMUTEST_MCTL_MASTER_REPAIR_EN_SHIFT (4U) -/*! MASTER_REPAIR_EN - Master Repair Enable - * 0b0..Repair disabled - * 0b1..Repair enable determined by bit 0 of each REPAIR register - */ -#define FMUTEST_MCTL_MASTER_REPAIR_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_MASTER_REPAIR_EN_SHIFT)) & FMUTEST_MCTL_MASTER_REPAIR_EN_MASK) - -#define FMUTEST_MCTL_RFCMDEN_MASK (0x20U) -#define FMUTEST_MCTL_RFCMDEN_SHIFT (5U) -/*! RFCMDEN - RF Active Command Enable Control - * 0b0..Flash commands blocked (CCIF not writable) - * 0b1..Flash commands allowed - */ -#define FMUTEST_MCTL_RFCMDEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_RFCMDEN_SHIFT)) & FMUTEST_MCTL_RFCMDEN_MASK) - -#define FMUTEST_MCTL_CWSABTEN_MASK (0x40U) -#define FMUTEST_MCTL_CWSABTEN_SHIFT (6U) -/*! CWSABTEN - Command Write Sequence Abort Enable - * 0b0..CWS abort feature is disabled - * 0b1..CWS abort feature is enabled - */ -#define FMUTEST_MCTL_CWSABTEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_CWSABTEN_SHIFT)) & FMUTEST_MCTL_CWSABTEN_MASK) - -#define FMUTEST_MCTL_MRGRDDIS_MASK (0x80U) -#define FMUTEST_MCTL_MRGRDDIS_SHIFT (7U) -/*! MRGRDDIS - Margin Read Disable - * 0b0..Margin Read Settings are enabled - * 0b1..Margin Read Settings are disabled - */ -#define FMUTEST_MCTL_MRGRDDIS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_MRGRDDIS_SHIFT)) & FMUTEST_MCTL_MRGRDDIS_MASK) - -#define FMUTEST_MCTL_MRGRD0_MASK (0xF00U) -#define FMUTEST_MCTL_MRGRD0_SHIFT (8U) -/*! MRGRD0 - Margin Read Setting for Program */ -#define FMUTEST_MCTL_MRGRD0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_MRGRD0_SHIFT)) & FMUTEST_MCTL_MRGRD0_MASK) - -#define FMUTEST_MCTL_MRGRD1_MASK (0xF000U) -#define FMUTEST_MCTL_MRGRD1_SHIFT (12U) -/*! MRGRD1 - Margin Read Setting for Erase */ -#define FMUTEST_MCTL_MRGRD1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_MRGRD1_SHIFT)) & FMUTEST_MCTL_MRGRD1_MASK) - -#define FMUTEST_MCTL_ERSAACK_MASK (0x10000U) -#define FMUTEST_MCTL_ERSAACK_SHIFT (16U) -/*! ERSAACK - Mass Erase (Erase All) Acknowledge - * 0b0..Mass Erase operation is not active (operation has completed or has not started) - * 0b1..Mass Erase operation is active (controller acknowledges that the soc_ersall_req input is asserted and will continue with the operation) - */ -#define FMUTEST_MCTL_ERSAACK(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_ERSAACK_SHIFT)) & FMUTEST_MCTL_ERSAACK_MASK) - -#define FMUTEST_MCTL_SCAN_OBS_MASK (0x80000U) -#define FMUTEST_MCTL_SCAN_OBS_SHIFT (19U) -/*! SCAN_OBS - Scan Observability Control - * 0b0..Normal functional behavior - * 0b1..Enables observation of signals that may otherwise be ATPG untestable - */ -#define FMUTEST_MCTL_SCAN_OBS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_SCAN_OBS_SHIFT)) & FMUTEST_MCTL_SCAN_OBS_MASK) - -#define FMUTEST_MCTL_BIST_CTL_MASK (0x100000U) -#define FMUTEST_MCTL_BIST_CTL_SHIFT (20U) -/*! BIST_CTL - BIST IP Control - * 0b0..BIST IP disabled - * 0b1..BIST IP enabled - */ -#define FMUTEST_MCTL_BIST_CTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_BIST_CTL_SHIFT)) & FMUTEST_MCTL_BIST_CTL_MASK) - -#define FMUTEST_MCTL_SMWR_CTL_MASK (0x200000U) -#define FMUTEST_MCTL_SMWR_CTL_SHIFT (21U) -/*! SMWR_CTL - SMWR IP Control - * 0b0..SMWR IP disabled - * 0b1..SMWR IP enabled - */ -#define FMUTEST_MCTL_SMWR_CTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_SMWR_CTL_SHIFT)) & FMUTEST_MCTL_SMWR_CTL_MASK) - -#define FMUTEST_MCTL_SALV_DIS_MASK (0x1000000U) -#define FMUTEST_MCTL_SALV_DIS_SHIFT (24U) -/*! SALV_DIS - Salvage Disable - * 0b0..Salvage enabled (ECC used during erase verify) - * 0b1..Salvage disabled (ECC not used during erase verify) - */ -#define FMUTEST_MCTL_SALV_DIS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_SALV_DIS_SHIFT)) & FMUTEST_MCTL_SALV_DIS_MASK) - -#define FMUTEST_MCTL_SOC_ECC_CTL_MASK (0x2000000U) -#define FMUTEST_MCTL_SOC_ECC_CTL_SHIFT (25U) -/*! SOC_ECC_CTL - SOC ECC Control - * 0b0..ECC is enabled for SOC read access - * 0b1..ECC is disabled for SOC read access - */ -#define FMUTEST_MCTL_SOC_ECC_CTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_SOC_ECC_CTL_SHIFT)) & FMUTEST_MCTL_SOC_ECC_CTL_MASK) - -#define FMUTEST_MCTL_FMU_ECC_CTL_MASK (0x4000000U) -#define FMUTEST_MCTL_FMU_ECC_CTL_SHIFT (26U) -/*! FMU_ECC_CTL - FMU ECC Control - * 0b0..ECC is enabled for FMU program operations - * 0b1..ECC is disabled for FMU program operations - */ -#define FMUTEST_MCTL_FMU_ECC_CTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_FMU_ECC_CTL_SHIFT)) & FMUTEST_MCTL_FMU_ECC_CTL_MASK) - -#define FMUTEST_MCTL_BIST_PWR_DIS_MASK (0x20000000U) -#define FMUTEST_MCTL_BIST_PWR_DIS_SHIFT (29U) -/*! BIST_PWR_DIS - BIST Power Mode Disable - * 0b0..BIST DFT logic has full control of SLM and LVE when BIST is enabled (including during commands) - * 0b1..BIST DFT logic has no control of SLM and LVE; power mode RTL is in complete control of SLM and LVE values - */ -#define FMUTEST_MCTL_BIST_PWR_DIS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_BIST_PWR_DIS_SHIFT)) & FMUTEST_MCTL_BIST_PWR_DIS_MASK) - -#define FMUTEST_MCTL_OSC_H_MASK (0x80000000U) -#define FMUTEST_MCTL_OSC_H_SHIFT (31U) -/*! OSC_H - Oscillator control - * 0b0..Use APB clock - * 0b1..Use a known fixed-frequency clock, e.g. 12 MHz - */ -#define FMUTEST_MCTL_OSC_H(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_OSC_H_SHIFT)) & FMUTEST_MCTL_OSC_H_MASK) -/*! @} */ - -/*! @name BSEL_GEN - FMU Block Select Generation Register */ -/*! @{ */ - -#define FMUTEST_BSEL_GEN_SBSEL_GEN_MASK (0x3U) -#define FMUTEST_BSEL_GEN_SBSEL_GEN_SHIFT (0U) -/*! SBSEL_GEN - Generated SBSEL */ -#define FMUTEST_BSEL_GEN_SBSEL_GEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BSEL_GEN_SBSEL_GEN_SHIFT)) & FMUTEST_BSEL_GEN_SBSEL_GEN_MASK) - -#define FMUTEST_BSEL_GEN_MBSEL_GEN_MASK (0x300U) -#define FMUTEST_BSEL_GEN_MBSEL_GEN_SHIFT (8U) -/*! MBSEL_GEN - Generated MBSEL */ -#define FMUTEST_BSEL_GEN_MBSEL_GEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BSEL_GEN_MBSEL_GEN_SHIFT)) & FMUTEST_BSEL_GEN_MBSEL_GEN_MASK) -/*! @} */ - -/*! @name PWR_OPT - Power Mode Options Register */ -/*! @{ */ - -#define FMUTEST_PWR_OPT_PD_CDIV_MASK (0xFFU) -#define FMUTEST_PWR_OPT_PD_CDIV_SHIFT (0U) -/*! PD_CDIV - Power Down Clock Divider Setting */ -#define FMUTEST_PWR_OPT_PD_CDIV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PWR_OPT_PD_CDIV_SHIFT)) & FMUTEST_PWR_OPT_PD_CDIV_MASK) - -#define FMUTEST_PWR_OPT_SLM_COUNT_MASK (0x3FF0000U) -#define FMUTEST_PWR_OPT_SLM_COUNT_SHIFT (16U) -/*! SLM_COUNT - Sleep Recovery Timer Count */ -#define FMUTEST_PWR_OPT_SLM_COUNT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PWR_OPT_SLM_COUNT_SHIFT)) & FMUTEST_PWR_OPT_SLM_COUNT_MASK) - -#define FMUTEST_PWR_OPT_PD_TIMER_EN_MASK (0x80000000U) -#define FMUTEST_PWR_OPT_PD_TIMER_EN_SHIFT (31U) -/*! PD_TIMER_EN - Power Down BIST Timer Enable - * 0b0..BIST timer is not triggered during Power Down recovery - * 0b1..BIST timer is triggered during Power Down recovery (default behavior) - */ -#define FMUTEST_PWR_OPT_PD_TIMER_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PWR_OPT_PD_TIMER_EN_SHIFT)) & FMUTEST_PWR_OPT_PD_TIMER_EN_MASK) -/*! @} */ - -/*! @name CMD_CHECK - FMU Command Check Register */ -/*! @{ */ - -#define FMUTEST_CMD_CHECK_ALIGNFAIL_PHR_MASK (0x1U) -#define FMUTEST_CMD_CHECK_ALIGNFAIL_PHR_SHIFT (0U) -/*! ALIGNFAIL_PHR - Phrase Alignment Fail - * 0b0..The address is phrase-aligned - * 0b1..The address is not phrase-aligned - */ -#define FMUTEST_CMD_CHECK_ALIGNFAIL_PHR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ALIGNFAIL_PHR_SHIFT)) & FMUTEST_CMD_CHECK_ALIGNFAIL_PHR_MASK) - -#define FMUTEST_CMD_CHECK_ALIGNFAIL_PG_MASK (0x2U) -#define FMUTEST_CMD_CHECK_ALIGNFAIL_PG_SHIFT (1U) -/*! ALIGNFAIL_PG - Page Alignment Fail - * 0b0..The address is page-aligned - * 0b1..The address is not page-aligned - */ -#define FMUTEST_CMD_CHECK_ALIGNFAIL_PG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ALIGNFAIL_PG_SHIFT)) & FMUTEST_CMD_CHECK_ALIGNFAIL_PG_MASK) - -#define FMUTEST_CMD_CHECK_ALIGNFAIL_SCR_MASK (0x4U) -#define FMUTEST_CMD_CHECK_ALIGNFAIL_SCR_SHIFT (2U) -/*! ALIGNFAIL_SCR - Sector Alignment Fail - * 0b0..The address is sector-aligned - * 0b1..The address is not sector-aligned - */ -#define FMUTEST_CMD_CHECK_ALIGNFAIL_SCR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ALIGNFAIL_SCR_SHIFT)) & FMUTEST_CMD_CHECK_ALIGNFAIL_SCR_MASK) - -#define FMUTEST_CMD_CHECK_ALIGNFAIL_BLK_MASK (0x8U) -#define FMUTEST_CMD_CHECK_ALIGNFAIL_BLK_SHIFT (3U) -/*! ALIGNFAIL_BLK - Block Alignment Fail - * 0b0..The address is block-aligned - * 0b1..The address is not block-aligned - */ -#define FMUTEST_CMD_CHECK_ALIGNFAIL_BLK(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ALIGNFAIL_BLK_SHIFT)) & FMUTEST_CMD_CHECK_ALIGNFAIL_BLK_MASK) - -#define FMUTEST_CMD_CHECK_ADDR_FAIL_MASK (0x10U) -#define FMUTEST_CMD_CHECK_ADDR_FAIL_SHIFT (4U) -/*! ADDR_FAIL - Address Fail - * 0b0..The address is within the flash or IFR address space - * 0b1..The address is outside the flash or IFR address space - */ -#define FMUTEST_CMD_CHECK_ADDR_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ADDR_FAIL_SHIFT)) & FMUTEST_CMD_CHECK_ADDR_FAIL_MASK) - -#define FMUTEST_CMD_CHECK_IFR_CMD_MASK (0x20U) -#define FMUTEST_CMD_CHECK_IFR_CMD_SHIFT (5U) -/*! IFR_CMD - IFR Command - * 0b0..The command operates on a main flash address - * 0b1..The command operates on an IFR address - */ -#define FMUTEST_CMD_CHECK_IFR_CMD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_IFR_CMD_SHIFT)) & FMUTEST_CMD_CHECK_IFR_CMD_MASK) - -#define FMUTEST_CMD_CHECK_ALL_CMD_MASK (0x40U) -#define FMUTEST_CMD_CHECK_ALL_CMD_SHIFT (6U) -/*! ALL_CMD - All Blocks Command - * 0b0..The command operates on a single flash block - * 0b1..The command operates on all flash blocks - */ -#define FMUTEST_CMD_CHECK_ALL_CMD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ALL_CMD_SHIFT)) & FMUTEST_CMD_CHECK_ALL_CMD_MASK) - -#define FMUTEST_CMD_CHECK_RANGE_FAIL_MASK (0x80U) -#define FMUTEST_CMD_CHECK_RANGE_FAIL_SHIFT (7U) -/*! RANGE_FAIL - Address Range Fail - * 0b0..The address range is valid - * 0b1..The address range is invalid - */ -#define FMUTEST_CMD_CHECK_RANGE_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_RANGE_FAIL_SHIFT)) & FMUTEST_CMD_CHECK_RANGE_FAIL_MASK) - -#define FMUTEST_CMD_CHECK_SCR_ALIGN_CHK_MASK (0x100U) -#define FMUTEST_CMD_CHECK_SCR_ALIGN_CHK_SHIFT (8U) -/*! SCR_ALIGN_CHK - Sector Alignment Check - * 0b0..No sector alignment check - * 0b1..Sector alignment check - */ -#define FMUTEST_CMD_CHECK_SCR_ALIGN_CHK(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_SCR_ALIGN_CHK_SHIFT)) & FMUTEST_CMD_CHECK_SCR_ALIGN_CHK_MASK) - -#define FMUTEST_CMD_CHECK_OPTION_FAIL_MASK (0x200U) -#define FMUTEST_CMD_CHECK_OPTION_FAIL_SHIFT (9U) -/*! OPTION_FAIL - Option Check Fail - * 0b0..Option check passes for read command or command is not a read command - * 0b1..Option check fails for read command - */ -#define FMUTEST_CMD_CHECK_OPTION_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_OPTION_FAIL_SHIFT)) & FMUTEST_CMD_CHECK_OPTION_FAIL_MASK) - -#define FMUTEST_CMD_CHECK_ILLEGAL_CMD_MASK (0x400U) -#define FMUTEST_CMD_CHECK_ILLEGAL_CMD_SHIFT (10U) -/*! ILLEGAL_CMD - Illegal Command - * 0b0..Command is legal - * 0b1..Command is illegal - */ -#define FMUTEST_CMD_CHECK_ILLEGAL_CMD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ILLEGAL_CMD_SHIFT)) & FMUTEST_CMD_CHECK_ILLEGAL_CMD_MASK) -/*! @} */ - -/*! @name BSEL - FMU Block Select Register */ -/*! @{ */ - -#define FMUTEST_BSEL_SBSEL_MASK (0x3U) -#define FMUTEST_BSEL_SBSEL_SHIFT (0U) -/*! SBSEL - Slave Block Select */ -#define FMUTEST_BSEL_SBSEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BSEL_SBSEL_SHIFT)) & FMUTEST_BSEL_SBSEL_MASK) - -#define FMUTEST_BSEL_MBSEL_MASK (0x300U) -#define FMUTEST_BSEL_MBSEL_SHIFT (8U) -/*! MBSEL - Master Block Select */ -#define FMUTEST_BSEL_MBSEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BSEL_MBSEL_SHIFT)) & FMUTEST_BSEL_MBSEL_MASK) -/*! @} */ - -/*! @name MSIZE - FMU Memory Size Register */ -/*! @{ */ - -#define FMUTEST_MSIZE_MAXADDR0_MASK (0xFFU) -#define FMUTEST_MSIZE_MAXADDR0_SHIFT (0U) -/*! MAXADDR0 - Size of Flash Block 0 */ -#define FMUTEST_MSIZE_MAXADDR0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MSIZE_MAXADDR0_SHIFT)) & FMUTEST_MSIZE_MAXADDR0_MASK) - -#define FMUTEST_MSIZE_MAXADDR1_MASK (0xFF00U) -#define FMUTEST_MSIZE_MAXADDR1_SHIFT (8U) -/*! MAXADDR1 - Size of Flash Block 1 */ -#define FMUTEST_MSIZE_MAXADDR1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MSIZE_MAXADDR1_SHIFT)) & FMUTEST_MSIZE_MAXADDR1_MASK) -/*! @} */ - -/*! @name FLASH_RD_ADD - Flash Read Address Register */ -/*! @{ */ - -#define FMUTEST_FLASH_RD_ADD_FLASH_RD_ADD_MASK (0xFFFFFFFFU) -#define FMUTEST_FLASH_RD_ADD_FLASH_RD_ADD_SHIFT (0U) -/*! FLASH_RD_ADD - Flash Read Address */ -#define FMUTEST_FLASH_RD_ADD_FLASH_RD_ADD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FLASH_RD_ADD_FLASH_RD_ADD_SHIFT)) & FMUTEST_FLASH_RD_ADD_FLASH_RD_ADD_MASK) -/*! @} */ - -/*! @name FLASH_STOP_ADD - Flash Stop Address Register */ -/*! @{ */ - -#define FMUTEST_FLASH_STOP_ADD_FLASH_STOP_ADD_MASK (0xFFFFFFFFU) -#define FMUTEST_FLASH_STOP_ADD_FLASH_STOP_ADD_SHIFT (0U) -/*! FLASH_STOP_ADD - Flash Stop Address */ -#define FMUTEST_FLASH_STOP_ADD_FLASH_STOP_ADD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FLASH_STOP_ADD_FLASH_STOP_ADD_SHIFT)) & FMUTEST_FLASH_STOP_ADD_FLASH_STOP_ADD_MASK) -/*! @} */ - -/*! @name FLASH_RD_CTRL - Flash Read Control Register */ -/*! @{ */ - -#define FMUTEST_FLASH_RD_CTRL_FLASH_RD_MASK (0x1U) -#define FMUTEST_FLASH_RD_CTRL_FLASH_RD_SHIFT (0U) -/*! FLASH_RD - Flash Read Enable - * 0b0..Manual flash read not enabled.(default) - * 0b1..Manual flash read enabled - */ -#define FMUTEST_FLASH_RD_CTRL_FLASH_RD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FLASH_RD_CTRL_FLASH_RD_SHIFT)) & FMUTEST_FLASH_RD_CTRL_FLASH_RD_MASK) - -#define FMUTEST_FLASH_RD_CTRL_WIDE_LOAD_MASK (0x2U) -#define FMUTEST_FLASH_RD_CTRL_WIDE_LOAD_SHIFT (1U) -/*! WIDE_LOAD - Wide Load Enable - * 0b0..Wide load mode disabled (default) - * 0b1..Wide load mode enabled - */ -#define FMUTEST_FLASH_RD_CTRL_WIDE_LOAD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FLASH_RD_CTRL_WIDE_LOAD_SHIFT)) & FMUTEST_FLASH_RD_CTRL_WIDE_LOAD_MASK) - -#define FMUTEST_FLASH_RD_CTRL_SINGLE_RD_MASK (0x4U) -#define FMUTEST_FLASH_RD_CTRL_SINGLE_RD_SHIFT (2U) -/*! SINGLE_RD - Single Flash Read - * 0b0..Normal UINT operation - * 0b1..UINT configured for single cycle reads - */ -#define FMUTEST_FLASH_RD_CTRL_SINGLE_RD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FLASH_RD_CTRL_SINGLE_RD_SHIFT)) & FMUTEST_FLASH_RD_CTRL_SINGLE_RD_MASK) -/*! @} */ - -/*! @name MM_ADDR - Memory Map Address Register */ -/*! @{ */ - -#define FMUTEST_MM_ADDR_MM_ADDR_MASK (0xFFFFFFFFU) -#define FMUTEST_MM_ADDR_MM_ADDR_SHIFT (0U) -/*! MM_ADDR - Memory Map Address */ -#define FMUTEST_MM_ADDR_MM_ADDR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MM_ADDR_MM_ADDR_SHIFT)) & FMUTEST_MM_ADDR_MM_ADDR_MASK) -/*! @} */ - -/*! @name MM_WDATA - Memory Map Write Data Register */ -/*! @{ */ - -#define FMUTEST_MM_WDATA_MM_WDATA_MASK (0xFFFFFFFFU) -#define FMUTEST_MM_WDATA_MM_WDATA_SHIFT (0U) -/*! MM_WDATA - Memory Map Write Data */ -#define FMUTEST_MM_WDATA_MM_WDATA(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MM_WDATA_MM_WDATA_SHIFT)) & FMUTEST_MM_WDATA_MM_WDATA_MASK) -/*! @} */ - -/*! @name MM_CTL - Memory Map Control Register */ -/*! @{ */ - -#define FMUTEST_MM_CTL_MM_SEL_MASK (0x1U) -#define FMUTEST_MM_CTL_MM_SEL_SHIFT (0U) -/*! MM_SEL - Register Access Enable */ -#define FMUTEST_MM_CTL_MM_SEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MM_CTL_MM_SEL_SHIFT)) & FMUTEST_MM_CTL_MM_SEL_MASK) - -#define FMUTEST_MM_CTL_MM_RD_MASK (0x2U) -#define FMUTEST_MM_CTL_MM_RD_SHIFT (1U) -/*! MM_RD - Register R/W Control - * 0b0..Write to register - * 0b1..Read register - */ -#define FMUTEST_MM_CTL_MM_RD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MM_CTL_MM_RD_SHIFT)) & FMUTEST_MM_CTL_MM_RD_MASK) - -#define FMUTEST_MM_CTL_BIST_ON_MASK (0x4U) -#define FMUTEST_MM_CTL_BIST_ON_SHIFT (2U) -/*! BIST_ON - BIST on - * 0b0..BIST enable not forced by user interface - * 0b1..BIST enable control by user interface - */ -#define FMUTEST_MM_CTL_BIST_ON(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MM_CTL_BIST_ON_SHIFT)) & FMUTEST_MM_CTL_BIST_ON_MASK) - -#define FMUTEST_MM_CTL_FORCE_SW_CLK_MASK (0x8U) -#define FMUTEST_MM_CTL_FORCE_SW_CLK_SHIFT (3U) -/*! FORCE_SW_CLK - Force Switch Clock - * 0b0..Switch clock not forced on (gated normally) - * 0b1..Switch clock forced on - */ -#define FMUTEST_MM_CTL_FORCE_SW_CLK(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MM_CTL_FORCE_SW_CLK_SHIFT)) & FMUTEST_MM_CTL_FORCE_SW_CLK_MASK) -/*! @} */ - -/*! @name UINT_CTL - User Interface Control Register */ -/*! @{ */ - -#define FMUTEST_UINT_CTL_SET_FAIL_MASK (0x1U) -#define FMUTEST_UINT_CTL_SET_FAIL_SHIFT (0U) -/*! SET_FAIL - Set Fail On Exit - * 0b0..FAIL flag should not be set on command exit (no failure detected) - * 0b1..FAIL flag should be set on command exit - */ -#define FMUTEST_UINT_CTL_SET_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_UINT_CTL_SET_FAIL_SHIFT)) & FMUTEST_UINT_CTL_SET_FAIL_MASK) - -#define FMUTEST_UINT_CTL_DBERR_MASK (0x2U) -#define FMUTEST_UINT_CTL_DBERR_SHIFT (1U) -/*! DBERR - Double-Bit ECC Fault Detect - * 0b0..No double-bit fault detected during UINT-driven read sequence - * 0b1..Double-bit fault detected during UINT-driven read sequence - */ -#define FMUTEST_UINT_CTL_DBERR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_UINT_CTL_DBERR_SHIFT)) & FMUTEST_UINT_CTL_DBERR_MASK) -/*! @} */ - -/*! @name RD_DATA0 - Read Data 0 Register */ -/*! @{ */ - -#define FMUTEST_RD_DATA0_RD_DATA0_MASK (0xFFFFFFFFU) -#define FMUTEST_RD_DATA0_RD_DATA0_SHIFT (0U) -/*! RD_DATA0 - Read Data 0 */ -#define FMUTEST_RD_DATA0_RD_DATA0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_DATA0_RD_DATA0_SHIFT)) & FMUTEST_RD_DATA0_RD_DATA0_MASK) -/*! @} */ - -/*! @name RD_DATA1 - Read Data 1 Register */ -/*! @{ */ - -#define FMUTEST_RD_DATA1_RD_DATA1_MASK (0xFFFFFFFFU) -#define FMUTEST_RD_DATA1_RD_DATA1_SHIFT (0U) -/*! RD_DATA1 - Read Data 1 */ -#define FMUTEST_RD_DATA1_RD_DATA1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_DATA1_RD_DATA1_SHIFT)) & FMUTEST_RD_DATA1_RD_DATA1_MASK) -/*! @} */ - -/*! @name RD_DATA2 - Read Data 2 Register */ -/*! @{ */ - -#define FMUTEST_RD_DATA2_RD_DATA2_MASK (0xFFFFFFFFU) -#define FMUTEST_RD_DATA2_RD_DATA2_SHIFT (0U) -/*! RD_DATA2 - Read Data 2 */ -#define FMUTEST_RD_DATA2_RD_DATA2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_DATA2_RD_DATA2_SHIFT)) & FMUTEST_RD_DATA2_RD_DATA2_MASK) -/*! @} */ - -/*! @name RD_DATA3 - Read Data 3 Register */ -/*! @{ */ - -#define FMUTEST_RD_DATA3_RD_DATA3_MASK (0xFFFFFFFFU) -#define FMUTEST_RD_DATA3_RD_DATA3_SHIFT (0U) -/*! RD_DATA3 - Read Data 3 */ -#define FMUTEST_RD_DATA3_RD_DATA3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_DATA3_RD_DATA3_SHIFT)) & FMUTEST_RD_DATA3_RD_DATA3_MASK) -/*! @} */ - -/*! @name PARITY - Parity Register */ -/*! @{ */ - -#define FMUTEST_PARITY_PARITY_MASK (0x1FFU) -#define FMUTEST_PARITY_PARITY_SHIFT (0U) -/*! PARITY - Read data [136:128] */ -#define FMUTEST_PARITY_PARITY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PARITY_PARITY_SHIFT)) & FMUTEST_PARITY_PARITY_MASK) -/*! @} */ - -/*! @name RD_PATH_CTRL_STATUS - Read Path Control and Status Register */ -/*! @{ */ - -#define FMUTEST_RD_PATH_CTRL_STATUS_RD_CAPT_MASK (0xFFU) -#define FMUTEST_RD_PATH_CTRL_STATUS_RD_CAPT_SHIFT (0U) -/*! RD_CAPT - Read Capture Clock Periods */ -#define FMUTEST_RD_PATH_CTRL_STATUS_RD_CAPT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_RD_CAPT_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_RD_CAPT_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_SE_SIZE_MASK (0xFF00U) -#define FMUTEST_RD_PATH_CTRL_STATUS_SE_SIZE_SHIFT (8U) -/*! SE_SIZE - SE Clock Periods */ -#define FMUTEST_RD_PATH_CTRL_STATUS_SE_SIZE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_SE_SIZE_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_SE_SIZE_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_ECC_ENABLEB_MASK (0x10000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_ECC_ENABLEB_SHIFT (16U) -/*! ECC_ENABLEB - ECC Decoder Control - * 0b0..ECC decoder enabled (default) - * 0b1..ECC decoder disabled - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_ECC_ENABLEB(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_ECC_ENABLEB_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_ECC_ENABLEB_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_MISR_EN_MASK (0x20000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_MISR_EN_SHIFT (17U) -/*! MISR_EN - MISR Enable - * 0b0..MISR option disabled (default) - * 0b1..MISR option enabled - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_MISR_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_MISR_EN_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_MISR_EN_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_CPY_PAR_EN_MASK (0x40000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_CPY_PAR_EN_SHIFT (18U) -/*! CPY_PAR_EN - Copy Parity Enable - * 0b0..Copy parity disabled - * 0b1..Copy parity enabled - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_CPY_PAR_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_CPY_PAR_EN_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_CPY_PAR_EN_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_BIST_MUX_TO_SMW_MASK (0x80000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_BIST_MUX_TO_SMW_SHIFT (19U) -/*! BIST_MUX_TO_SMW - BIST Mux to SMW - * 0b0..BIST drives fields - * 0b1..SMW registers drive fields - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_BIST_MUX_TO_SMW(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_BIST_MUX_TO_SMW_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_BIST_MUX_TO_SMW_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_AD_SET_MASK (0xF00000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_AD_SET_SHIFT (20U) -/*! AD_SET - Multi-Cycle Address Setup Time */ -#define FMUTEST_RD_PATH_CTRL_STATUS_AD_SET(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_AD_SET_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_AD_SET_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_EN_MASK (0x1000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_EN_SHIFT (24U) -/*! WR_PATH_EN - Write Path Enable - * 0b0..Writes to BIST setting registers driven by MM_WDATA - * 0b1..Writes to BIST setting registers driven by SMW_DIN - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_EN_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_EN_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_ECC_EN_MASK (0x2000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_ECC_EN_SHIFT (25U) -/*! WR_PATH_ECC_EN - Write Path ECC Enable - * 0b0..ECC encoding disabled - * 0b1..ECC encoding enabled - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_ECC_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_ECC_EN_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_ECC_EN_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_DBERR_REG_MASK (0x4000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_DBERR_REG_SHIFT (26U) -/*! DBERR_REG - Double-Bit Error - * 0b0..Double-bit fault not detected - * 0b1..Double-bit fault detected on previous UINT flash read - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_DBERR_REG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_DBERR_REG_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_DBERR_REG_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_SBERR_REG_MASK (0x8000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_SBERR_REG_SHIFT (27U) -/*! SBERR_REG - Single-Bit Error - * 0b0..Single-bit fault not detected - * 0b1..Single-bit fault detected on previous UINT flash read - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_SBERR_REG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_SBERR_REG_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_SBERR_REG_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_CPY_PHRASE_EN_MASK (0x10000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_CPY_PHRASE_EN_SHIFT (28U) -/*! CPY_PHRASE_EN - Copy Phrase Enable - * 0b0..Copy Flash read data disabled - * 0b1..Copy Flash read data enabled - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_CPY_PHRASE_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_CPY_PHRASE_EN_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_CPY_PHRASE_EN_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_SMW_ARRAY1_SMW0_SEL_MASK (0x20000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_SMW_ARRAY1_SMW0_SEL_SHIFT (29U) -/*! SMW_ARRAY1_SMW0_SEL - SMW_ARRAY1_SMW0_SEL - * 0b0..Select block 0 - * 0b1..Select block 1 - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_SMW_ARRAY1_SMW0_SEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_SMW_ARRAY1_SMW0_SEL_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_SMW_ARRAY1_SMW0_SEL_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_BIST_ECC_EN_MASK (0x40000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_BIST_ECC_EN_SHIFT (30U) -/*! BIST_ECC_EN - BIST ECC Enable - * 0b0..ECC correction disabled - * 0b1..ECC correction enabled - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_BIST_ECC_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_BIST_ECC_EN_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_BIST_ECC_EN_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_LAST_READ_MASK (0x80000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_LAST_READ_SHIFT (31U) -/*! LAST_READ - Last Read - * 0b0..Latest read not last in multi-address operation - * 0b1..Latest read last in multi-address operation - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_LAST_READ(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_LAST_READ_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_LAST_READ_MASK) -/*! @} */ - -/*! @name SMW_DIN0 - SMW DIN 0 Register */ -/*! @{ */ - -#define FMUTEST_SMW_DIN0_SMW_DIN0_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_DIN0_SMW_DIN0_SHIFT (0U) -/*! SMW_DIN0 - SMW DIN 0 */ -#define FMUTEST_SMW_DIN0_SMW_DIN0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_DIN0_SMW_DIN0_SHIFT)) & FMUTEST_SMW_DIN0_SMW_DIN0_MASK) -/*! @} */ - -/*! @name SMW_DIN1 - SMW DIN 1 Register */ -/*! @{ */ - -#define FMUTEST_SMW_DIN1_SMW_DIN1_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_DIN1_SMW_DIN1_SHIFT (0U) -/*! SMW_DIN1 - SMW DIN 1 */ -#define FMUTEST_SMW_DIN1_SMW_DIN1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_DIN1_SMW_DIN1_SHIFT)) & FMUTEST_SMW_DIN1_SMW_DIN1_MASK) -/*! @} */ - -/*! @name SMW_DIN2 - SMW DIN 2 Register */ -/*! @{ */ - -#define FMUTEST_SMW_DIN2_SMW_DIN2_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_DIN2_SMW_DIN2_SHIFT (0U) -/*! SMW_DIN2 - SMW DIN 2 */ -#define FMUTEST_SMW_DIN2_SMW_DIN2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_DIN2_SMW_DIN2_SHIFT)) & FMUTEST_SMW_DIN2_SMW_DIN2_MASK) -/*! @} */ - -/*! @name SMW_DIN3 - SMW DIN 3 Register */ -/*! @{ */ - -#define FMUTEST_SMW_DIN3_SMW_DIN3_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_DIN3_SMW_DIN3_SHIFT (0U) -/*! SMW_DIN3 - SMW DIN 3 */ -#define FMUTEST_SMW_DIN3_SMW_DIN3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_DIN3_SMW_DIN3_SHIFT)) & FMUTEST_SMW_DIN3_SMW_DIN3_MASK) -/*! @} */ - -/*! @name SMW_ADDR - SMW Address Register */ -/*! @{ */ - -#define FMUTEST_SMW_ADDR_SMW_ADDR_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_ADDR_SMW_ADDR_SHIFT (0U) -/*! SMW_ADDR - SMW Address */ -#define FMUTEST_SMW_ADDR_SMW_ADDR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_ADDR_SMW_ADDR_SHIFT)) & FMUTEST_SMW_ADDR_SMW_ADDR_MASK) -/*! @} */ - -/*! @name SMW_CMD_WAIT - SMW Command and Wait Register */ -/*! @{ */ - -#define FMUTEST_SMW_CMD_WAIT_CMD_MASK (0x7U) -#define FMUTEST_SMW_CMD_WAIT_CMD_SHIFT (0U) -/*! CMD - SMW Command - * 0b000..IDLE - * 0b001..ABORT - * 0b010..SME2 to one-shot mass erase - * 0b011..SME3 to sector erase on selected array - * 0b100..SMP1 to program phrase or page on selected array with shot disabled on previously programmed bit - * 0b101..Reserved for SME4 (multi-sector erase) - * 0b110..SMP2 to program phrase or page on selected array to repair cells of weak program after power loss - * 0b111..Reserved - */ -#define FMUTEST_SMW_CMD_WAIT_CMD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_CMD_WAIT_CMD_SHIFT)) & FMUTEST_SMW_CMD_WAIT_CMD_MASK) - -#define FMUTEST_SMW_CMD_WAIT_WAIT_EN_MASK (0x8U) -#define FMUTEST_SMW_CMD_WAIT_WAIT_EN_SHIFT (3U) -/*! WAIT_EN - SMW Wait Enable - * 0b0..Wait feature disabled - * 0b1..Wait feature enabled - */ -#define FMUTEST_SMW_CMD_WAIT_WAIT_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_CMD_WAIT_WAIT_EN_SHIFT)) & FMUTEST_SMW_CMD_WAIT_WAIT_EN_MASK) - -#define FMUTEST_SMW_CMD_WAIT_WAIT_AUTO_SET_MASK (0x10U) -#define FMUTEST_SMW_CMD_WAIT_WAIT_AUTO_SET_SHIFT (4U) -/*! WAIT_AUTO_SET - SMW Wait Auto Set */ -#define FMUTEST_SMW_CMD_WAIT_WAIT_AUTO_SET(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_CMD_WAIT_WAIT_AUTO_SET_SHIFT)) & FMUTEST_SMW_CMD_WAIT_WAIT_AUTO_SET_MASK) -/*! @} */ - -/*! @name SMW_STATUS - SMW Status Register */ -/*! @{ */ - -#define FMUTEST_SMW_STATUS_SMW_ERR_MASK (0x1U) -#define FMUTEST_SMW_STATUS_SMW_ERR_SHIFT (0U) -/*! SMW_ERR - SMW Error - * 0b0..Error not detected - * 0b1..Error detected - */ -#define FMUTEST_SMW_STATUS_SMW_ERR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_STATUS_SMW_ERR_SHIFT)) & FMUTEST_SMW_STATUS_SMW_ERR_MASK) - -#define FMUTEST_SMW_STATUS_SMW_BUSY_MASK (0x2U) -#define FMUTEST_SMW_STATUS_SMW_BUSY_SHIFT (1U) -/*! SMW_BUSY - SMW Busy - * 0b0..SMW command not active - * 0b1..SMW command is active - */ -#define FMUTEST_SMW_STATUS_SMW_BUSY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_STATUS_SMW_BUSY_SHIFT)) & FMUTEST_SMW_STATUS_SMW_BUSY_MASK) - -#define FMUTEST_SMW_STATUS_BIST_BUSY_MASK (0x4U) -#define FMUTEST_SMW_STATUS_BIST_BUSY_SHIFT (2U) -/*! BIST_BUSY - BIST Busy - * 0b0..BIST Command not active - * 0b1..BIST Command is active - */ -#define FMUTEST_SMW_STATUS_BIST_BUSY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_STATUS_BIST_BUSY_SHIFT)) & FMUTEST_SMW_STATUS_BIST_BUSY_MASK) -/*! @} */ - -/*! @name SOCTRIM0_0 - SoC Trim Phrase 0 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM0_0_TRIM0_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM0_0_TRIM0_0_SHIFT (0U) -/*! TRIM0_0 - TRIM0_0 */ -#define FMUTEST_SOCTRIM0_0_TRIM0_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM0_0_TRIM0_0_SHIFT)) & FMUTEST_SOCTRIM0_0_TRIM0_0_MASK) -/*! @} */ - -/*! @name SOCTRIM0_1 - SoC Trim Phrase 0 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM0_1_TRIM0_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM0_1_TRIM0_1_SHIFT (0U) -/*! TRIM0_1 - TRIM0_1 */ -#define FMUTEST_SOCTRIM0_1_TRIM0_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM0_1_TRIM0_1_SHIFT)) & FMUTEST_SOCTRIM0_1_TRIM0_1_MASK) -/*! @} */ - -/*! @name SOCTRIM0_2 - SoC Trim Phrase 0 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM0_2_TRIM0_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM0_2_TRIM0_2_SHIFT (0U) -/*! TRIM0_2 - TRIM0_2 */ -#define FMUTEST_SOCTRIM0_2_TRIM0_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM0_2_TRIM0_2_SHIFT)) & FMUTEST_SOCTRIM0_2_TRIM0_2_MASK) -/*! @} */ - -/*! @name SOCTRIM0_3 - SoC Trim Phrase 0 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM0_3_TRIM0_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM0_3_TRIM0_3_SHIFT (0U) -/*! TRIM0_3 - TRIM0_3 */ -#define FMUTEST_SOCTRIM0_3_TRIM0_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM0_3_TRIM0_3_SHIFT)) & FMUTEST_SOCTRIM0_3_TRIM0_3_MASK) -/*! @} */ - -/*! @name SOCTRIM1_0 - SoC Trim Phrase 1 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM1_0_TRIM1_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM1_0_TRIM1_0_SHIFT (0U) -/*! TRIM1_0 - TRIM1_0 */ -#define FMUTEST_SOCTRIM1_0_TRIM1_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM1_0_TRIM1_0_SHIFT)) & FMUTEST_SOCTRIM1_0_TRIM1_0_MASK) -/*! @} */ - -/*! @name SOCTRIM1_1 - SoC Trim Phrase 1 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM1_1_TRIM1_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM1_1_TRIM1_1_SHIFT (0U) -/*! TRIM1_1 - TRIM1_1 */ -#define FMUTEST_SOCTRIM1_1_TRIM1_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM1_1_TRIM1_1_SHIFT)) & FMUTEST_SOCTRIM1_1_TRIM1_1_MASK) -/*! @} */ - -/*! @name SOCTRIM1_2 - SoC Trim Phrase 1 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM1_2_TRIM1_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM1_2_TRIM1_2_SHIFT (0U) -/*! TRIM1_2 - TRIM1_2 */ -#define FMUTEST_SOCTRIM1_2_TRIM1_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM1_2_TRIM1_2_SHIFT)) & FMUTEST_SOCTRIM1_2_TRIM1_2_MASK) -/*! @} */ - -/*! @name SOCTRIM1_3 - SoC Trim Phrase 1 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM1_3_TRIM1_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM1_3_TRIM1_3_SHIFT (0U) -/*! TRIM1_3 - TRIM1_3 */ -#define FMUTEST_SOCTRIM1_3_TRIM1_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM1_3_TRIM1_3_SHIFT)) & FMUTEST_SOCTRIM1_3_TRIM1_3_MASK) -/*! @} */ - -/*! @name SOCTRIM2_0 - SoC Trim Phrase 2 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM2_0_TRIM2_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM2_0_TRIM2_0_SHIFT (0U) -/*! TRIM2_0 - TRIM2_0 */ -#define FMUTEST_SOCTRIM2_0_TRIM2_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM2_0_TRIM2_0_SHIFT)) & FMUTEST_SOCTRIM2_0_TRIM2_0_MASK) -/*! @} */ - -/*! @name SOCTRIM2_1 - SoC Trim Phrase 2 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM2_1_TRIM2_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM2_1_TRIM2_1_SHIFT (0U) -/*! TRIM2_1 - TRIM2_1 */ -#define FMUTEST_SOCTRIM2_1_TRIM2_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM2_1_TRIM2_1_SHIFT)) & FMUTEST_SOCTRIM2_1_TRIM2_1_MASK) -/*! @} */ - -/*! @name SOCTRIM2_2 - SoC Trim Phrase 2 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM2_2_TRIM2_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM2_2_TRIM2_2_SHIFT (0U) -/*! TRIM2_2 - TRIM2_2 */ -#define FMUTEST_SOCTRIM2_2_TRIM2_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM2_2_TRIM2_2_SHIFT)) & FMUTEST_SOCTRIM2_2_TRIM2_2_MASK) -/*! @} */ - -/*! @name SOCTRIM2_3 - SoC Trim Phrase 2 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM2_3_TRIM2_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM2_3_TRIM2_3_SHIFT (0U) -/*! TRIM2_3 - TRIM2_3 */ -#define FMUTEST_SOCTRIM2_3_TRIM2_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM2_3_TRIM2_3_SHIFT)) & FMUTEST_SOCTRIM2_3_TRIM2_3_MASK) -/*! @} */ - -/*! @name SOCTRIM3_0 - SoC Trim Phrase 3 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM3_0_TRIM3_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM3_0_TRIM3_0_SHIFT (0U) -/*! TRIM3_0 - TRIM3_0 */ -#define FMUTEST_SOCTRIM3_0_TRIM3_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM3_0_TRIM3_0_SHIFT)) & FMUTEST_SOCTRIM3_0_TRIM3_0_MASK) -/*! @} */ - -/*! @name SOCTRIM3_1 - SoC Trim Phrase 3 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM3_1_TRIM3_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM3_1_TRIM3_1_SHIFT (0U) -/*! TRIM3_1 - TRIM3_1 */ -#define FMUTEST_SOCTRIM3_1_TRIM3_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM3_1_TRIM3_1_SHIFT)) & FMUTEST_SOCTRIM3_1_TRIM3_1_MASK) -/*! @} */ - -/*! @name SOCTRIM3_2 - SoC Trim Phrase 3 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM3_2_TRIM3_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM3_2_TRIM3_2_SHIFT (0U) -/*! TRIM3_2 - TRIM3_2 */ -#define FMUTEST_SOCTRIM3_2_TRIM3_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM3_2_TRIM3_2_SHIFT)) & FMUTEST_SOCTRIM3_2_TRIM3_2_MASK) -/*! @} */ - -/*! @name SOCTRIM3_3 - SoC Trim Phrase 3 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM3_3_TRIM3_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM3_3_TRIM3_3_SHIFT (0U) -/*! TRIM3_3 - TRIM3_3 */ -#define FMUTEST_SOCTRIM3_3_TRIM3_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM3_3_TRIM3_3_SHIFT)) & FMUTEST_SOCTRIM3_3_TRIM3_3_MASK) -/*! @} */ - -/*! @name SOCTRIM4_0 - SoC Trim Phrase 4 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM4_0_TRIM4_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM4_0_TRIM4_0_SHIFT (0U) -/*! TRIM4_0 - TRIM4_0 */ -#define FMUTEST_SOCTRIM4_0_TRIM4_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM4_0_TRIM4_0_SHIFT)) & FMUTEST_SOCTRIM4_0_TRIM4_0_MASK) -/*! @} */ - -/*! @name SOCTRIM4_1 - SoC Trim Phrase 4 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM4_1_TRIM4_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM4_1_TRIM4_1_SHIFT (0U) -/*! TRIM4_1 - TRIM4_1 */ -#define FMUTEST_SOCTRIM4_1_TRIM4_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM4_1_TRIM4_1_SHIFT)) & FMUTEST_SOCTRIM4_1_TRIM4_1_MASK) -/*! @} */ - -/*! @name SOCTRIM4_2 - SoC Trim Phrase 4 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM4_2_TRIM4_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM4_2_TRIM4_2_SHIFT (0U) -/*! TRIM4_2 - TRIM4_2 */ -#define FMUTEST_SOCTRIM4_2_TRIM4_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM4_2_TRIM4_2_SHIFT)) & FMUTEST_SOCTRIM4_2_TRIM4_2_MASK) -/*! @} */ - -/*! @name SOCTRIM4_3 - SoC Trim Phrase 4 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM4_3_TRIM4_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM4_3_TRIM4_3_SHIFT (0U) -/*! TRIM4_3 - TRIM4_3 */ -#define FMUTEST_SOCTRIM4_3_TRIM4_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM4_3_TRIM4_3_SHIFT)) & FMUTEST_SOCTRIM4_3_TRIM4_3_MASK) -/*! @} */ - -/*! @name SOCTRIM5_0 - SoC Trim Phrase 5 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM5_0_TRIM5_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM5_0_TRIM5_0_SHIFT (0U) -/*! TRIM5_0 - TRIM5_0 */ -#define FMUTEST_SOCTRIM5_0_TRIM5_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM5_0_TRIM5_0_SHIFT)) & FMUTEST_SOCTRIM5_0_TRIM5_0_MASK) -/*! @} */ - -/*! @name SOCTRIM5_1 - SoC Trim Phrase 5 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM5_1_TRIM5_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM5_1_TRIM5_1_SHIFT (0U) -/*! TRIM5_1 - TRIM5_1 */ -#define FMUTEST_SOCTRIM5_1_TRIM5_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM5_1_TRIM5_1_SHIFT)) & FMUTEST_SOCTRIM5_1_TRIM5_1_MASK) -/*! @} */ - -/*! @name SOCTRIM5_2 - SoC Trim Phrase 5 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM5_2_TRIM5_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM5_2_TRIM5_2_SHIFT (0U) -/*! TRIM5_2 - TRIM5_2 */ -#define FMUTEST_SOCTRIM5_2_TRIM5_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM5_2_TRIM5_2_SHIFT)) & FMUTEST_SOCTRIM5_2_TRIM5_2_MASK) -/*! @} */ - -/*! @name SOCTRIM5_3 - SoC Trim Phrase 5 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM5_3_TRIM5_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM5_3_TRIM5_3_SHIFT (0U) -/*! TRIM5_3 - TRIM5_3 */ -#define FMUTEST_SOCTRIM5_3_TRIM5_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM5_3_TRIM5_3_SHIFT)) & FMUTEST_SOCTRIM5_3_TRIM5_3_MASK) -/*! @} */ - -/*! @name SOCTRIM6_0 - SoC Trim Phrase 6 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM6_0_TRIM6_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM6_0_TRIM6_0_SHIFT (0U) -/*! TRIM6_0 - TRIM6_0 */ -#define FMUTEST_SOCTRIM6_0_TRIM6_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM6_0_TRIM6_0_SHIFT)) & FMUTEST_SOCTRIM6_0_TRIM6_0_MASK) -/*! @} */ - -/*! @name SOCTRIM6_1 - SoC Trim Phrase 6 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM6_1_TRIM6_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM6_1_TRIM6_1_SHIFT (0U) -/*! TRIM6_1 - TRIM6_1 */ -#define FMUTEST_SOCTRIM6_1_TRIM6_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM6_1_TRIM6_1_SHIFT)) & FMUTEST_SOCTRIM6_1_TRIM6_1_MASK) -/*! @} */ - -/*! @name SOCTRIM6_2 - SoC Trim Phrase 6 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM6_2_TRIM6_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM6_2_TRIM6_2_SHIFT (0U) -/*! TRIM6_2 - TRIM6_2 */ -#define FMUTEST_SOCTRIM6_2_TRIM6_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM6_2_TRIM6_2_SHIFT)) & FMUTEST_SOCTRIM6_2_TRIM6_2_MASK) -/*! @} */ - -/*! @name SOCTRIM6_3 - SoC Trim Phrase 6 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM6_3_TRIM6_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM6_3_TRIM6_3_SHIFT (0U) -/*! TRIM6_3 - TRIM6_3 */ -#define FMUTEST_SOCTRIM6_3_TRIM6_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM6_3_TRIM6_3_SHIFT)) & FMUTEST_SOCTRIM6_3_TRIM6_3_MASK) -/*! @} */ - -/*! @name SOCTRIM7_0 - SoC Trim Phrase 7 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM7_0_TRIM7_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM7_0_TRIM7_0_SHIFT (0U) -/*! TRIM7_0 - TRIM7_0 */ -#define FMUTEST_SOCTRIM7_0_TRIM7_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM7_0_TRIM7_0_SHIFT)) & FMUTEST_SOCTRIM7_0_TRIM7_0_MASK) -/*! @} */ - -/*! @name SOCTRIM7_1 - SoC Trim Phrase 7 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM7_1_TRIM7_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM7_1_TRIM7_1_SHIFT (0U) -/*! TRIM7_1 - TRIM7_1 */ -#define FMUTEST_SOCTRIM7_1_TRIM7_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM7_1_TRIM7_1_SHIFT)) & FMUTEST_SOCTRIM7_1_TRIM7_1_MASK) -/*! @} */ - -/*! @name SOCTRIM7_2 - SoC Trim Phrase 7 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM7_2_TRIM7_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM7_2_TRIM7_2_SHIFT (0U) -/*! TRIM7_2 - TRIM7_2 */ -#define FMUTEST_SOCTRIM7_2_TRIM7_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM7_2_TRIM7_2_SHIFT)) & FMUTEST_SOCTRIM7_2_TRIM7_2_MASK) -/*! @} */ - -/*! @name SOCTRIM7_3 - SoC Trim Phrase 7 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM7_3_TRIM7_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM7_3_TRIM7_3_SHIFT (0U) -/*! TRIM7_3 - TRIM7_3 */ -#define FMUTEST_SOCTRIM7_3_TRIM7_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM7_3_TRIM7_3_SHIFT)) & FMUTEST_SOCTRIM7_3_TRIM7_3_MASK) -/*! @} */ - -/*! @name R_IP_CONFIG - BIST Configuration Register */ -/*! @{ */ - -#define FMUTEST_R_IP_CONFIG_IPSEL0_MASK (0x3U) -#define FMUTEST_R_IP_CONFIG_IPSEL0_SHIFT (0U) -/*! IPSEL0 - Block 0 Select Control - * 0b00..Unselect block 0 - * 0b01..not used, reserved - * 0b10..Enable block 0 test, repair off (default) - * 0b11..Enable block 0 test, repair on - */ -#define FMUTEST_R_IP_CONFIG_IPSEL0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_IPSEL0_SHIFT)) & FMUTEST_R_IP_CONFIG_IPSEL0_MASK) - -#define FMUTEST_R_IP_CONFIG_IPSEL1_MASK (0xCU) -#define FMUTEST_R_IP_CONFIG_IPSEL1_SHIFT (2U) -/*! IPSEL1 - Block 1 Select Control - * 0b00..Unselect block 1 - * 0b01..not used, reserved - * 0b10..Enable block 1 test, repair off (default) - * 0b11..Enable block 1 test, repair on - */ -#define FMUTEST_R_IP_CONFIG_IPSEL1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_IPSEL1_SHIFT)) & FMUTEST_R_IP_CONFIG_IPSEL1_MASK) - -#define FMUTEST_R_IP_CONFIG_BIST_CDIVL_MASK (0xFF0U) -#define FMUTEST_R_IP_CONFIG_BIST_CDIVL_SHIFT (4U) -/*! BIST_CDIVL - Clock Divide Scalar for Long Pulse */ -#define FMUTEST_R_IP_CONFIG_BIST_CDIVL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_BIST_CDIVL_SHIFT)) & FMUTEST_R_IP_CONFIG_BIST_CDIVL_MASK) - -#define FMUTEST_R_IP_CONFIG_CDIVS_MASK (0x7000U) -#define FMUTEST_R_IP_CONFIG_CDIVS_SHIFT (12U) -/*! CDIVS - Number of clock cycles to generate short pulse */ -#define FMUTEST_R_IP_CONFIG_CDIVS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_CDIVS_SHIFT)) & FMUTEST_R_IP_CONFIG_CDIVS_MASK) - -#define FMUTEST_R_IP_CONFIG_BIST_TVFY_MASK (0xF8000U) -#define FMUTEST_R_IP_CONFIG_BIST_TVFY_SHIFT (15U) -/*! BIST_TVFY - Timer adjust for verify */ -#define FMUTEST_R_IP_CONFIG_BIST_TVFY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_BIST_TVFY_SHIFT)) & FMUTEST_R_IP_CONFIG_BIST_TVFY_MASK) - -#define FMUTEST_R_IP_CONFIG_TSTCTL_MASK (0x300000U) -#define FMUTEST_R_IP_CONFIG_TSTCTL_SHIFT (20U) -/*! TSTCTL - BIST self-test control - * 0b00..Default, disable both BIST self-test and MISR - * 0b01..Enable BIST self-test mode DOUT from macro will be forced to '0', and disable MISR. - * 0b10..Enable MISR - * 0b11..Enable both BIST self-test mode and MISR - */ -#define FMUTEST_R_IP_CONFIG_TSTCTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_TSTCTL_SHIFT)) & FMUTEST_R_IP_CONFIG_TSTCTL_MASK) - -#define FMUTEST_R_IP_CONFIG_DBGCTL_MASK (0x400000U) -#define FMUTEST_R_IP_CONFIG_DBGCTL_SHIFT (22U) -/*! DBGCTL - Debug feature control - * 0b0..Default - * 0b1..Enable debug feature to collect failure address and data. - */ -#define FMUTEST_R_IP_CONFIG_DBGCTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_DBGCTL_SHIFT)) & FMUTEST_R_IP_CONFIG_DBGCTL_MASK) - -#define FMUTEST_R_IP_CONFIG_BIST_CLK_SEL_MASK (0x800000U) -#define FMUTEST_R_IP_CONFIG_BIST_CLK_SEL_SHIFT (23U) -/*! BIST_CLK_SEL - BIST Clock Select */ -#define FMUTEST_R_IP_CONFIG_BIST_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_BIST_CLK_SEL_SHIFT)) & FMUTEST_R_IP_CONFIG_BIST_CLK_SEL_MASK) - -#define FMUTEST_R_IP_CONFIG_SMWTST_MASK (0x3000000U) -#define FMUTEST_R_IP_CONFIG_SMWTST_SHIFT (24U) -/*! SMWTST - SMWR DOUT Function Control - * 0b00..Default - * 0b01..Enable SMWR self-test mode, DOUT from macro will be forced to all 0 - * 0b10..Enable SMWR self-test mode, DOUT from macro will be forced to all 1 - * 0b11..Reserved (unused) - */ -#define FMUTEST_R_IP_CONFIG_SMWTST(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_SMWTST_SHIFT)) & FMUTEST_R_IP_CONFIG_SMWTST_MASK) - -#define FMUTEST_R_IP_CONFIG_ECCEN_MASK (0x4000000U) -#define FMUTEST_R_IP_CONFIG_ECCEN_SHIFT (26U) -/*! ECCEN - BIST ECC Control - * 0b0..Default mode (no ECC encode or decode) - * 0b1..Enable ECC encode/decode - */ -#define FMUTEST_R_IP_CONFIG_ECCEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_ECCEN_SHIFT)) & FMUTEST_R_IP_CONFIG_ECCEN_MASK) -/*! @} */ - -/*! @name R_TESTCODE - BIST Test Code Register */ -/*! @{ */ - -#define FMUTEST_R_TESTCODE_TESTCODE_MASK (0x3FU) -#define FMUTEST_R_TESTCODE_TESTCODE_SHIFT (0U) -/*! TESTCODE - Used to store test code information before running TMR-RST/TMRSET BIST command */ -#define FMUTEST_R_TESTCODE_TESTCODE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TESTCODE_TESTCODE_SHIFT)) & FMUTEST_R_TESTCODE_TESTCODE_MASK) -/*! @} */ - -/*! @name R_DFT_CTRL - BIST DFT Control Register */ -/*! @{ */ - -#define FMUTEST_R_DFT_CTRL_DFT_XADR_MASK (0xFU) -#define FMUTEST_R_DFT_CTRL_DFT_XADR_SHIFT (0U) -/*! DFT_XADR - DFT XADR Pattern - * 0b0000..XADR fixed, no change at all - * 0b0001..XADR increased by 1 after row. For READ operation, XADR increases by 1 after reading the last word of - * row. For PROG operation, XADR increases by 1 after NVSTR falls. - * 0b0010..XADR increased for diagonal. For PROG-DIAGONAL operation, XADR is increased to create diagonal pattern. - * 0b0011..XADR increased by sector. During ERASE operation, XADR increased by number of rows in a sector when NVSTR falls. - * 0b0100..XADR inversed. XADR is inversed after reading one word or after programming one row when NVSTR falls. - * 0b0101..XADR increased by 2 after row. For READ operation, XADR is increased by 2 after reading the last word - * of a row. For PROG operation, XADR is increased by 2 when NVSTR falls. - * 0b0110..XADR[0] inversed. XADR[0] is inversed after reading one word or after programming one row when NVSTR falls. - * 0b0111..XADR increased by 1. For READ operations only, XADR increased by 1 after each read cycle. - * 0b1000..XADR decreased by 1 after row. For READ operations only, XADR is decreased by 1 after YADR decreases to 0. - * 0b1001..XADR decreased by 1. For READ operations only, XADR is decreased by 1 after each read cycle. - */ -#define FMUTEST_R_DFT_CTRL_DFT_XADR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DFT_CTRL_DFT_XADR_SHIFT)) & FMUTEST_R_DFT_CTRL_DFT_XADR_MASK) - -#define FMUTEST_R_DFT_CTRL_DFT_YADR_MASK (0xF0U) -#define FMUTEST_R_DFT_CTRL_DFT_YADR_SHIFT (4U) -/*! DFT_YADR - DFT YADR Pattern - * 0b0000..YADR fixed, no change at all - * 0b0001..YADR for ICKBD. For PROG and READ operations, YADR changed to generate inverse checkerboard pattern. - * 0b0010..YADR for CKBD. For PROG and READ operations, YADR changed to generate checkerboard pattern. - * 0b0011..YADR increased by 1. For READ operations, YADR increased by 1 after each read cycle. For PROG - * operations, YADR increased by 1 after YE falls. - * 0b0100..YADR increased for diagonal. For PROG-DIAGONAL operation, YADR is increased to create diagonal pattern. - * 0b0101..YADR inversed. YADR is inversed after reading one word or after programming one word when YE falls. - * 0b0110..YADR[0] inversed. YADR[0] is inversed after reading one word or after programming one word when YE falls. - * 0b0111..YADR increased by 1 after last row. For READ operations only, YADR is increased by 1 after XADR reaches last row. - * 0b1000..YADR decreased by 1. For READ operations only, YADR is decreased by 1 after each read cycle. - * 0b1001..YADR decreased by 1 after first row. For READ operations only, YADR is decreased by 1 after XADR decreases to 0. - */ -#define FMUTEST_R_DFT_CTRL_DFT_YADR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DFT_CTRL_DFT_YADR_SHIFT)) & FMUTEST_R_DFT_CTRL_DFT_YADR_MASK) - -#define FMUTEST_R_DFT_CTRL_DFT_DATA_MASK (0xF00U) -#define FMUTEST_R_DFT_CTRL_DFT_DATA_SHIFT (8U) -/*! DFT_DATA - DFT Data Pattern - * 0b0000..CKBD pattern. For READ operations only, compare DOUT with checkerboard data pattern for each read cycle. - * 0b0001..ICKBD pattern. For READ operations only, compare DOUT with inverse checkerboard data pattern for each read cycle. - * 0b0010..Diagonal pattern. Used for READ operations only, compare DOUT to diagonal pattern. - * 0b0011..Fixed data pattern. For READ operations, comparison to DOUT for selected groups; refer to - * R_ADR_CTRL[GRPSEL] for modules with multiple groups. - * 0b0100..Random data pattern which will be generated based on the initial seed set in R_DATA; for READ - * operations, used for DOUT comparison of selected groups. For PROG operations, used to control DIN of selected - * groups. - * 0b0101..DOUT based pattern. For READ operations only, DOUT of selected group will be latched in R_DATA. If - * more than one group is selected in R_ADR_CTRL[GRPSEL], the group with the lower index will be latched. - * 0b0110..R_DATA based pattern. For READ operations, expected DOUT value of selected groups equals to R_DATA - * when XADR[0]==YADR[0] or ~R_DATA when XADR[0]!=YADR[0]. For PROG operations, DIN of selected groups equals - * R_DATA when XADR[0]==YADR[0] or ~R_DATA when XADR[0]!=YADR[0]. - * 0b0111..SCAN-IO pattern. For READ operations, control expected DOUT value of selected groups to SCAN-IO data - * pattern. For PROG operations, control DIN of selected groups to SCAN-IO data pattern. - * 0b1000..REPAIR set. For PROG operation to IFR1(7,1) and IFR1(7,2), R_REPAIR0_0 and R_REPAIR0_1 or R_REPAIR1_0 - * and R_REPAIR1_1 will control DIN. For READ operation on IFR1(7,1) and IFR1(7,2), DOUT will be compared - * against R_REPAIR0_0 and R_REPAIR0_1 or R_REPAIR1_0 andR_REPAIR1_1. When this option is selected, only - * one flash block can be selected. - * 0b1001..REPAIR load. For READ operation only, DOUT from IFR1(7,1) and IFR1(7,2) is loaded to R_REPAIR0 and R_REPAIR1. - */ -#define FMUTEST_R_DFT_CTRL_DFT_DATA(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DFT_CTRL_DFT_DATA_SHIFT)) & FMUTEST_R_DFT_CTRL_DFT_DATA_MASK) - -#define FMUTEST_R_DFT_CTRL_CMP_MASK_MASK (0x3000U) -#define FMUTEST_R_DFT_CTRL_CMP_MASK_SHIFT (12U) -/*! CMP_MASK - Data Compare Mask - * 0b00..Expected data is compared to DOUT - * 0b01..Expected data (only 0s are considered) are compared to DOUT - * 0b10..Expected data (only 1s are considered) are compared to DOUT - */ -#define FMUTEST_R_DFT_CTRL_CMP_MASK(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DFT_CTRL_CMP_MASK_SHIFT)) & FMUTEST_R_DFT_CTRL_CMP_MASK_MASK) - -#define FMUTEST_R_DFT_CTRL_DFT_DATA_SRC_MASK (0x4000U) -#define FMUTEST_R_DFT_CTRL_DFT_DATA_SRC_SHIFT (14U) -/*! DFT_DATA_SRC - DFT Data Source - * 0b0..{R_DATA_CTRL0,R_DATA_CTRL_EX[2:0],R_DATA_CTRL0,R_DATA_CTRL_EX[2:0],R_DATA_CTRL0,R_DATA_CTRL_EX[2:0],R_DATA_CTRL0} is used - * 0b1..{R_DATA_CTRL3,R_DATA_CTRL2_EX[2:0],R_DATA_CTRL2,R_DATA_CTRL1_EX[2:0],R_DATA_CTRL1,R_DATA_CTRL_EX[2:0],R_DATA_CTRL0} is used - */ -#define FMUTEST_R_DFT_CTRL_DFT_DATA_SRC(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DFT_CTRL_DFT_DATA_SRC_SHIFT)) & FMUTEST_R_DFT_CTRL_DFT_DATA_SRC_MASK) -/*! @} */ - -/*! @name R_ADR_CTRL - BIST Address Control Register */ -/*! @{ */ - -#define FMUTEST_R_ADR_CTRL_GRPSEL_MASK (0xFU) -#define FMUTEST_R_ADR_CTRL_GRPSEL_SHIFT (0U) -/*! GRPSEL - Data Group Select - * 0b0000..Select no data - * 0b0001..Select data slice [34:0] - * 0b0010..Select data slice [69:35] - * 0b0100..Select data slice [104:70] - * 0b1000..Select data slice [136:105] - * 0b1111..Select data [136:0] - */ -#define FMUTEST_R_ADR_CTRL_GRPSEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ADR_CTRL_GRPSEL_SHIFT)) & FMUTEST_R_ADR_CTRL_GRPSEL_MASK) - -#define FMUTEST_R_ADR_CTRL_XADR_MASK (0xFFF0U) -#define FMUTEST_R_ADR_CTRL_XADR_SHIFT (4U) -/*! XADR - BIST XADR */ -#define FMUTEST_R_ADR_CTRL_XADR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ADR_CTRL_XADR_SHIFT)) & FMUTEST_R_ADR_CTRL_XADR_MASK) - -#define FMUTEST_R_ADR_CTRL_YADR_MASK (0x1F0000U) -#define FMUTEST_R_ADR_CTRL_YADR_SHIFT (16U) -/*! YADR - BIST YADR */ -#define FMUTEST_R_ADR_CTRL_YADR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ADR_CTRL_YADR_SHIFT)) & FMUTEST_R_ADR_CTRL_YADR_MASK) - -#define FMUTEST_R_ADR_CTRL_PROG_ATTR_MASK (0xE00000U) -#define FMUTEST_R_ADR_CTRL_PROG_ATTR_SHIFT (21U) -/*! PROG_ATTR - Program Attribute - * 0b000..One YE pulse will program one data slice group - * 0b001..One YE pulse will program two data slice groups - * 0b010..One YE pulse will program three data slice groups (reserved) - * 0b011..One YE pulse will program four data slice groups - * 0b100..One YE pulse will program five data slice groups (reserved) - * 0b101..One YE pulse will program six data slice groups (reserved) - * 0b110..One YE pulse will program seven data slice groups (reserved) - * 0b111..One YE pulse will program eight data slice groups (reserved) - */ -#define FMUTEST_R_ADR_CTRL_PROG_ATTR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ADR_CTRL_PROG_ATTR_SHIFT)) & FMUTEST_R_ADR_CTRL_PROG_ATTR_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL0 - BIST Data Control 0 Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL0_DATA0_MASK (0xFFFFFFFFU) -#define FMUTEST_R_DATA_CTRL0_DATA0_SHIFT (0U) -/*! DATA0 - BIST Data 0 Low */ -#define FMUTEST_R_DATA_CTRL0_DATA0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL0_DATA0_SHIFT)) & FMUTEST_R_DATA_CTRL0_DATA0_MASK) -/*! @} */ - -/*! @name R_PIN_CTRL - BIST Pin Control Register */ -/*! @{ */ - -#define FMUTEST_R_PIN_CTRL_MAS1_MASK (0x1U) -#define FMUTEST_R_PIN_CTRL_MAS1_SHIFT (0U) -/*! MAS1 - Mass Erase */ -#define FMUTEST_R_PIN_CTRL_MAS1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_MAS1_SHIFT)) & FMUTEST_R_PIN_CTRL_MAS1_MASK) - -#define FMUTEST_R_PIN_CTRL_IFREN_MASK (0x2U) -#define FMUTEST_R_PIN_CTRL_IFREN_SHIFT (1U) -/*! IFREN - IFR Enable */ -#define FMUTEST_R_PIN_CTRL_IFREN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_IFREN_SHIFT)) & FMUTEST_R_PIN_CTRL_IFREN_MASK) - -#define FMUTEST_R_PIN_CTRL_IFREN1_MASK (0x4U) -#define FMUTEST_R_PIN_CTRL_IFREN1_SHIFT (2U) -/*! IFREN1 - IFR1 Enable */ -#define FMUTEST_R_PIN_CTRL_IFREN1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_IFREN1_SHIFT)) & FMUTEST_R_PIN_CTRL_IFREN1_MASK) - -#define FMUTEST_R_PIN_CTRL_REDEN_MASK (0x8U) -#define FMUTEST_R_PIN_CTRL_REDEN_SHIFT (3U) -/*! REDEN - Redundancy Block Enable */ -#define FMUTEST_R_PIN_CTRL_REDEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_REDEN_SHIFT)) & FMUTEST_R_PIN_CTRL_REDEN_MASK) - -#define FMUTEST_R_PIN_CTRL_LVE_MASK (0x10U) -#define FMUTEST_R_PIN_CTRL_LVE_SHIFT (4U) -/*! LVE - Low Voltage Enable */ -#define FMUTEST_R_PIN_CTRL_LVE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_LVE_SHIFT)) & FMUTEST_R_PIN_CTRL_LVE_MASK) - -#define FMUTEST_R_PIN_CTRL_PV_MASK (0x20U) -#define FMUTEST_R_PIN_CTRL_PV_SHIFT (5U) -/*! PV - Program Verify Enable */ -#define FMUTEST_R_PIN_CTRL_PV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_PV_SHIFT)) & FMUTEST_R_PIN_CTRL_PV_MASK) - -#define FMUTEST_R_PIN_CTRL_EV_MASK (0x40U) -#define FMUTEST_R_PIN_CTRL_EV_SHIFT (6U) -/*! EV - Erase Verify Enable */ -#define FMUTEST_R_PIN_CTRL_EV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_EV_SHIFT)) & FMUTEST_R_PIN_CTRL_EV_MASK) - -#define FMUTEST_R_PIN_CTRL_WIPGM_MASK (0x180U) -#define FMUTEST_R_PIN_CTRL_WIPGM_SHIFT (7U) -/*! WIPGM - Program Current */ -#define FMUTEST_R_PIN_CTRL_WIPGM(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_WIPGM_SHIFT)) & FMUTEST_R_PIN_CTRL_WIPGM_MASK) - -#define FMUTEST_R_PIN_CTRL_WHV_MASK (0x1E00U) -#define FMUTEST_R_PIN_CTRL_WHV_SHIFT (9U) -/*! WHV - High Voltage Level */ -#define FMUTEST_R_PIN_CTRL_WHV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_WHV_SHIFT)) & FMUTEST_R_PIN_CTRL_WHV_MASK) - -#define FMUTEST_R_PIN_CTRL_WMV_MASK (0xE000U) -#define FMUTEST_R_PIN_CTRL_WMV_SHIFT (13U) -/*! WMV - Medium Voltage Level */ -#define FMUTEST_R_PIN_CTRL_WMV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_WMV_SHIFT)) & FMUTEST_R_PIN_CTRL_WMV_MASK) - -#define FMUTEST_R_PIN_CTRL_XE_MASK (0x10000U) -#define FMUTEST_R_PIN_CTRL_XE_SHIFT (16U) -/*! XE - X Address Enable */ -#define FMUTEST_R_PIN_CTRL_XE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_XE_SHIFT)) & FMUTEST_R_PIN_CTRL_XE_MASK) - -#define FMUTEST_R_PIN_CTRL_YE_MASK (0x20000U) -#define FMUTEST_R_PIN_CTRL_YE_SHIFT (17U) -/*! YE - Y Address Enable */ -#define FMUTEST_R_PIN_CTRL_YE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_YE_SHIFT)) & FMUTEST_R_PIN_CTRL_YE_MASK) - -#define FMUTEST_R_PIN_CTRL_SE_MASK (0x40000U) -#define FMUTEST_R_PIN_CTRL_SE_SHIFT (18U) -/*! SE - Sense Amp Enable */ -#define FMUTEST_R_PIN_CTRL_SE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_SE_SHIFT)) & FMUTEST_R_PIN_CTRL_SE_MASK) - -#define FMUTEST_R_PIN_CTRL_ERASE_MASK (0x80000U) -#define FMUTEST_R_PIN_CTRL_ERASE_SHIFT (19U) -/*! ERASE - Erase Mode */ -#define FMUTEST_R_PIN_CTRL_ERASE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_ERASE_SHIFT)) & FMUTEST_R_PIN_CTRL_ERASE_MASK) - -#define FMUTEST_R_PIN_CTRL_PROG_MASK (0x100000U) -#define FMUTEST_R_PIN_CTRL_PROG_SHIFT (20U) -/*! PROG - Program Mode */ -#define FMUTEST_R_PIN_CTRL_PROG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_PROG_SHIFT)) & FMUTEST_R_PIN_CTRL_PROG_MASK) - -#define FMUTEST_R_PIN_CTRL_NVSTR_MASK (0x200000U) -#define FMUTEST_R_PIN_CTRL_NVSTR_SHIFT (21U) -/*! NVSTR - NVM Store */ -#define FMUTEST_R_PIN_CTRL_NVSTR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_NVSTR_SHIFT)) & FMUTEST_R_PIN_CTRL_NVSTR_MASK) - -#define FMUTEST_R_PIN_CTRL_SLM_MASK (0x400000U) -#define FMUTEST_R_PIN_CTRL_SLM_SHIFT (22U) -/*! SLM - Sleep Mode Enable */ -#define FMUTEST_R_PIN_CTRL_SLM(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_SLM_SHIFT)) & FMUTEST_R_PIN_CTRL_SLM_MASK) - -#define FMUTEST_R_PIN_CTRL_RECALL_MASK (0x800000U) -#define FMUTEST_R_PIN_CTRL_RECALL_SHIFT (23U) -/*! RECALL - Recall Trim Code */ -#define FMUTEST_R_PIN_CTRL_RECALL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_RECALL_SHIFT)) & FMUTEST_R_PIN_CTRL_RECALL_MASK) - -#define FMUTEST_R_PIN_CTRL_HEM_MASK (0x1000000U) -#define FMUTEST_R_PIN_CTRL_HEM_SHIFT (24U) -/*! HEM - HEM Control */ -#define FMUTEST_R_PIN_CTRL_HEM(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_HEM_SHIFT)) & FMUTEST_R_PIN_CTRL_HEM_MASK) -/*! @} */ - -/*! @name R_CNT_LOOP_CTRL - BIST Loop Count Control Register */ -/*! @{ */ - -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPCNT_MASK (0xFFFU) -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPCNT_SHIFT (0U) -/*! LOOPCNT - Loop Count Control */ -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPCNT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_CNT_LOOP_CTRL_LOOPCNT_SHIFT)) & FMUTEST_R_CNT_LOOP_CTRL_LOOPCNT_MASK) - -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPOPT_MASK (0x7000U) -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPOPT_SHIFT (12U) -/*! LOOPOPT - Loop Option - * 0b000..Loop is disabled; selected BIST operation is run once - * 0b001..Loop is enabled; XADR increments by 1 XADR increments by 1 for each new loop. Stops when total loop count meets LOOPCNT+1. - * 0b010..Loop is enabled; YADR increments by 1 YADR increments by 1 for each new loop. Stops when total loop count meets LOOPCNT+1. - * 0b011..Loop is enabled; XADR increments by 2 XADR increments by 2 for each new loop. Stops when total loop count meets LOOPCNT+1. - * 0b100..Loop is enabled; XADR increments by sector XADR increments by 16 for each new loop. Stops when total loop count meets LOOPCNT+1. - */ -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPOPT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_CNT_LOOP_CTRL_LOOPOPT_SHIFT)) & FMUTEST_R_CNT_LOOP_CTRL_LOOPOPT_MASK) - -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPUNIT_MASK (0x38000U) -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPUNIT_SHIFT (15U) -/*! LOOPUNIT - Loop Time Unit - * 0b000..Clock cycles - * 0b001..0.5 usec - * 0b010..1 usec - * 0b011..10 usec - * 0b100..100 usec - * 0b101..1 msec - * 0b110..10 msec - * 0b111..100 msec - */ -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPUNIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_CNT_LOOP_CTRL_LOOPUNIT_SHIFT)) & FMUTEST_R_CNT_LOOP_CTRL_LOOPUNIT_MASK) - -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPDLY_MASK (0x1FC0000U) -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPDLY_SHIFT (18U) -/*! LOOPDLY - Loop Time Delay Scalar */ -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPDLY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_CNT_LOOP_CTRL_LOOPDLY_SHIFT)) & FMUTEST_R_CNT_LOOP_CTRL_LOOPDLY_MASK) -/*! @} */ - -/*! @name R_TIMER_CTRL - BIST Timer Control Register */ -/*! @{ */ - -#define FMUTEST_R_TIMER_CTRL_TNVSUNIT_MASK (0x7U) -#define FMUTEST_R_TIMER_CTRL_TNVSUNIT_SHIFT (0U) -/*! TNVSUNIT - Tnvs Time Unit - * 0b000..Clock cycles - * 0b001..0.5 usec - * 0b010..1 usec - * 0b011..10 usec - * 0b100..100 usec - * 0b101..1 msec - * 0b110..10 msec - * 0b111..100 msec - */ -#define FMUTEST_R_TIMER_CTRL_TNVSUNIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TNVSUNIT_SHIFT)) & FMUTEST_R_TIMER_CTRL_TNVSUNIT_MASK) - -#define FMUTEST_R_TIMER_CTRL_TNVSDLY_MASK (0x78U) -#define FMUTEST_R_TIMER_CTRL_TNVSDLY_SHIFT (3U) -/*! TNVSDLY - Tnvs Time Delay Scalar */ -#define FMUTEST_R_TIMER_CTRL_TNVSDLY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TNVSDLY_SHIFT)) & FMUTEST_R_TIMER_CTRL_TNVSDLY_MASK) - -#define FMUTEST_R_TIMER_CTRL_TNVHUNIT_MASK (0x380U) -#define FMUTEST_R_TIMER_CTRL_TNVHUNIT_SHIFT (7U) -/*! TNVHUNIT - Tnvh Time Unit - * 0b000..Clock cycles - * 0b001..0.5 usec - * 0b010..1 usec - * 0b011..10 usec - * 0b100..100 usec - * 0b101..1 msec - * 0b110..10 msec - * 0b111..100 msec - */ -#define FMUTEST_R_TIMER_CTRL_TNVHUNIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TNVHUNIT_SHIFT)) & FMUTEST_R_TIMER_CTRL_TNVHUNIT_MASK) - -#define FMUTEST_R_TIMER_CTRL_TNVHDLY_MASK (0x3C00U) -#define FMUTEST_R_TIMER_CTRL_TNVHDLY_SHIFT (10U) -/*! TNVHDLY - Tnvh Time Delay Scalar */ -#define FMUTEST_R_TIMER_CTRL_TNVHDLY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TNVHDLY_SHIFT)) & FMUTEST_R_TIMER_CTRL_TNVHDLY_MASK) - -#define FMUTEST_R_TIMER_CTRL_TPGSUNIT_MASK (0x1C000U) -#define FMUTEST_R_TIMER_CTRL_TPGSUNIT_SHIFT (14U) -/*! TPGSUNIT - Tpgs Time Unit - * 0b000..Clock cycles - * 0b001..0.5 usec - * 0b010..1 usec - * 0b011..10 usec - * 0b100..100 usec - * 0b101..1 msec - * 0b110..10 msec - * 0b111..100 msec - */ -#define FMUTEST_R_TIMER_CTRL_TPGSUNIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TPGSUNIT_SHIFT)) & FMUTEST_R_TIMER_CTRL_TPGSUNIT_MASK) - -#define FMUTEST_R_TIMER_CTRL_TPGSDLY_MASK (0x1E0000U) -#define FMUTEST_R_TIMER_CTRL_TPGSDLY_SHIFT (17U) -/*! TPGSDLY - Tpgs Time Delay Scalar */ -#define FMUTEST_R_TIMER_CTRL_TPGSDLY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TPGSDLY_SHIFT)) & FMUTEST_R_TIMER_CTRL_TPGSDLY_MASK) - -#define FMUTEST_R_TIMER_CTRL_TRCVUNIT_MASK (0xE00000U) -#define FMUTEST_R_TIMER_CTRL_TRCVUNIT_SHIFT (21U) -/*! TRCVUNIT - Trcv Time Unit - * 0b000..Clock cycles - * 0b001..0.5 usec - * 0b010..1 usec - * 0b011..10 usec - * 0b100..100 usec - * 0b101..1 msec - * 0b110..10 msec - * 0b111..100 msec - */ -#define FMUTEST_R_TIMER_CTRL_TRCVUNIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TRCVUNIT_SHIFT)) & FMUTEST_R_TIMER_CTRL_TRCVUNIT_MASK) - -#define FMUTEST_R_TIMER_CTRL_TRCVDLY_MASK (0xF000000U) -#define FMUTEST_R_TIMER_CTRL_TRCVDLY_SHIFT (24U) -/*! TRCVDLY - Trcv Time Delay Scalar */ -#define FMUTEST_R_TIMER_CTRL_TRCVDLY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TRCVDLY_SHIFT)) & FMUTEST_R_TIMER_CTRL_TRCVDLY_MASK) - -#define FMUTEST_R_TIMER_CTRL_TLVSUNIT_MASK (0x70000000U) -#define FMUTEST_R_TIMER_CTRL_TLVSUNIT_SHIFT (28U) -/*! TLVSUNIT - Tlvs Time Unit - * 0b000..Clock cycles - * 0b001..0.5 usec - * 0b010..1 usec - * 0b011..10 usec - * 0b100..100 usec - * 0b101..1 msec - * 0b110..10 msec - * 0b111..100 msec - */ -#define FMUTEST_R_TIMER_CTRL_TLVSUNIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TLVSUNIT_SHIFT)) & FMUTEST_R_TIMER_CTRL_TLVSUNIT_MASK) - -#define FMUTEST_R_TIMER_CTRL_TLVSDLY_L_MASK (0x80000000U) -#define FMUTEST_R_TIMER_CTRL_TLVSDLY_L_SHIFT (31U) -/*! TLVSDLY_L - Tlvs Time Delay Scalar Low */ -#define FMUTEST_R_TIMER_CTRL_TLVSDLY_L(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TLVSDLY_L_SHIFT)) & FMUTEST_R_TIMER_CTRL_TLVSDLY_L_MASK) -/*! @} */ - -/*! @name R_TEST_CTRL - BIST Test Control Register */ -/*! @{ */ - -#define FMUTEST_R_TEST_CTRL_BUSY_MASK (0x1U) -#define FMUTEST_R_TEST_CTRL_BUSY_SHIFT (0U) -/*! BUSY - BIST Busy Status - * 0b0..BIST is idle - * 0b1..BIST is busy - */ -#define FMUTEST_R_TEST_CTRL_BUSY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_BUSY_SHIFT)) & FMUTEST_R_TEST_CTRL_BUSY_MASK) - -#define FMUTEST_R_TEST_CTRL_DEBUG_MASK (0x2U) -#define FMUTEST_R_TEST_CTRL_DEBUG_SHIFT (1U) -/*! DEBUG - BIST Debug Status */ -#define FMUTEST_R_TEST_CTRL_DEBUG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_DEBUG_SHIFT)) & FMUTEST_R_TEST_CTRL_DEBUG_MASK) - -#define FMUTEST_R_TEST_CTRL_STATUS0_MASK (0x4U) -#define FMUTEST_R_TEST_CTRL_STATUS0_SHIFT (2U) -/*! STATUS0 - BIST Status 0 - * 0b0..BIST test passed on flash block 0 - * 0b1..BIST test failed on flash block 0 - */ -#define FMUTEST_R_TEST_CTRL_STATUS0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_STATUS0_SHIFT)) & FMUTEST_R_TEST_CTRL_STATUS0_MASK) - -#define FMUTEST_R_TEST_CTRL_STATUS1_MASK (0x8U) -#define FMUTEST_R_TEST_CTRL_STATUS1_SHIFT (3U) -/*! STATUS1 - BIST status 1 - * 0b0..BIST test passed on flash block 1 - * 0b1..BIST test failed on flash block 1 - */ -#define FMUTEST_R_TEST_CTRL_STATUS1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_STATUS1_SHIFT)) & FMUTEST_R_TEST_CTRL_STATUS1_MASK) - -#define FMUTEST_R_TEST_CTRL_DEBUGRUN_MASK (0x10U) -#define FMUTEST_R_TEST_CTRL_DEBUGRUN_SHIFT (4U) -/*! DEBUGRUN - BIST Continue Debug Run */ -#define FMUTEST_R_TEST_CTRL_DEBUGRUN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_DEBUGRUN_SHIFT)) & FMUTEST_R_TEST_CTRL_DEBUGRUN_MASK) - -#define FMUTEST_R_TEST_CTRL_STARTRUN_MASK (0x20U) -#define FMUTEST_R_TEST_CTRL_STARTRUN_SHIFT (5U) -/*! STARTRUN - Run New BIST Operation */ -#define FMUTEST_R_TEST_CTRL_STARTRUN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_STARTRUN_SHIFT)) & FMUTEST_R_TEST_CTRL_STARTRUN_MASK) - -#define FMUTEST_R_TEST_CTRL_CMDINDEX_MASK (0xFFC0U) -#define FMUTEST_R_TEST_CTRL_CMDINDEX_SHIFT (6U) -/*! CMDINDEX - BIST Command Index (code) */ -#define FMUTEST_R_TEST_CTRL_CMDINDEX(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_CMDINDEX_SHIFT)) & FMUTEST_R_TEST_CTRL_CMDINDEX_MASK) - -#define FMUTEST_R_TEST_CTRL_DISABLE_IP1_MASK (0x10000U) -#define FMUTEST_R_TEST_CTRL_DISABLE_IP1_SHIFT (16U) -/*! DISABLE_IP1 - BIST Disable IP1 */ -#define FMUTEST_R_TEST_CTRL_DISABLE_IP1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_DISABLE_IP1_SHIFT)) & FMUTEST_R_TEST_CTRL_DISABLE_IP1_MASK) -/*! @} */ - -/*! @name R_ABORT_LOOP - BIST Abort Loop Register */ -/*! @{ */ - -#define FMUTEST_R_ABORT_LOOP_ABORT_LOOP_MASK (0x1U) -#define FMUTEST_R_ABORT_LOOP_ABORT_LOOP_SHIFT (0U) -/*! ABORT_LOOP - Abort Loop - * 0b0..No effect - * 0b1..Abort BIST loop commands and force the loop counter to return to 0x0 - */ -#define FMUTEST_R_ABORT_LOOP_ABORT_LOOP(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ABORT_LOOP_ABORT_LOOP_SHIFT)) & FMUTEST_R_ABORT_LOOP_ABORT_LOOP_MASK) -/*! @} */ - -/*! @name R_ADR_QUERY - BIST Address Query Register */ -/*! @{ */ - -#define FMUTEST_R_ADR_QUERY_YADRFAIL_MASK (0x1FU) -#define FMUTEST_R_ADR_QUERY_YADRFAIL_SHIFT (0U) -/*! YADRFAIL - Failing YADR */ -#define FMUTEST_R_ADR_QUERY_YADRFAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ADR_QUERY_YADRFAIL_SHIFT)) & FMUTEST_R_ADR_QUERY_YADRFAIL_MASK) - -#define FMUTEST_R_ADR_QUERY_XADRFAIL_MASK (0x1FFE0U) -#define FMUTEST_R_ADR_QUERY_XADRFAIL_SHIFT (5U) -/*! XADRFAIL - Failing XADR */ -#define FMUTEST_R_ADR_QUERY_XADRFAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ADR_QUERY_XADRFAIL_SHIFT)) & FMUTEST_R_ADR_QUERY_XADRFAIL_MASK) -/*! @} */ - -/*! @name R_DOUT_QUERY0 - BIST DOUT Query 0 Register */ -/*! @{ */ - -#define FMUTEST_R_DOUT_QUERY0_DOUTFAIL_MASK (0xFFFFFFFFU) -#define FMUTEST_R_DOUT_QUERY0_DOUTFAIL_SHIFT (0U) -/*! DOUTFAIL - Failing DOUT Low */ -#define FMUTEST_R_DOUT_QUERY0_DOUTFAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DOUT_QUERY0_DOUTFAIL_SHIFT)) & FMUTEST_R_DOUT_QUERY0_DOUTFAIL_MASK) -/*! @} */ - -/*! @name R_SMW_QUERY - BIST SMW Query Register */ -/*! @{ */ - -#define FMUTEST_R_SMW_QUERY_SMWLOOP_MASK (0x3FFU) -#define FMUTEST_R_SMW_QUERY_SMWLOOP_SHIFT (0U) -/*! SMWLOOP - SMW Total Loop Count */ -#define FMUTEST_R_SMW_QUERY_SMWLOOP(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMW_QUERY_SMWLOOP_SHIFT)) & FMUTEST_R_SMW_QUERY_SMWLOOP_MASK) - -#define FMUTEST_R_SMW_QUERY_SMWLAST_MASK (0x7FC00U) -#define FMUTEST_R_SMW_QUERY_SMWLAST_SHIFT (10U) -/*! SMWLAST - SMW Last Voltage Setting */ -#define FMUTEST_R_SMW_QUERY_SMWLAST(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMW_QUERY_SMWLAST_SHIFT)) & FMUTEST_R_SMW_QUERY_SMWLAST_MASK) -/*! @} */ - -/*! @name R_SMW_SETTING0 - BIST SMW Setting 0 Register */ -/*! @{ */ - -#define FMUTEST_R_SMW_SETTING0_SMWPARM0_MASK (0x7FFFFFFFU) -#define FMUTEST_R_SMW_SETTING0_SMWPARM0_SHIFT (0U) -/*! SMWPARM0 - SMW Parameter Set 0 */ -#define FMUTEST_R_SMW_SETTING0_SMWPARM0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMW_SETTING0_SMWPARM0_SHIFT)) & FMUTEST_R_SMW_SETTING0_SMWPARM0_MASK) -/*! @} */ - -/*! @name R_SMW_SETTING1 - BIST SMW Setting 1 Register */ -/*! @{ */ - -#define FMUTEST_R_SMW_SETTING1_SMWPARM1_MASK (0xFFFFFFFU) -#define FMUTEST_R_SMW_SETTING1_SMWPARM1_SHIFT (0U) -/*! SMWPARM1 - SMW Parameter Set 1 */ -#define FMUTEST_R_SMW_SETTING1_SMWPARM1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMW_SETTING1_SMWPARM1_SHIFT)) & FMUTEST_R_SMW_SETTING1_SMWPARM1_MASK) -/*! @} */ - -/*! @name R_SMP_WHV0 - BIST SMP WHV Setting 0 Register */ -/*! @{ */ - -#define FMUTEST_R_SMP_WHV0_SMPWHV0_MASK (0xFFFFFFFFU) -#define FMUTEST_R_SMP_WHV0_SMPWHV0_SHIFT (0U) -/*! SMPWHV0 - SMP WHV Parameter Set 0 */ -#define FMUTEST_R_SMP_WHV0_SMPWHV0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMP_WHV0_SMPWHV0_SHIFT)) & FMUTEST_R_SMP_WHV0_SMPWHV0_MASK) -/*! @} */ - -/*! @name R_SMP_WHV1 - BIST SMP WHV Setting 1 Register */ -/*! @{ */ - -#define FMUTEST_R_SMP_WHV1_SMPWHV1_MASK (0xFFFFFFFFU) -#define FMUTEST_R_SMP_WHV1_SMPWHV1_SHIFT (0U) -/*! SMPWHV1 - SMP WHV Parameter Set 1 */ -#define FMUTEST_R_SMP_WHV1_SMPWHV1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMP_WHV1_SMPWHV1_SHIFT)) & FMUTEST_R_SMP_WHV1_SMPWHV1_MASK) -/*! @} */ - -/*! @name R_SME_WHV0 - BIST SME WHV Setting 0 Register */ -/*! @{ */ - -#define FMUTEST_R_SME_WHV0_SMEWHV0_MASK (0xFFFFFFFFU) -#define FMUTEST_R_SME_WHV0_SMEWHV0_SHIFT (0U) -/*! SMEWHV0 - SME WHV Parameter Set 0 */ -#define FMUTEST_R_SME_WHV0_SMEWHV0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SME_WHV0_SMEWHV0_SHIFT)) & FMUTEST_R_SME_WHV0_SMEWHV0_MASK) -/*! @} */ - -/*! @name R_SME_WHV1 - BIST SME WHV Setting 1 Register */ -/*! @{ */ - -#define FMUTEST_R_SME_WHV1_SMEWHV1_MASK (0xFFFFFFFFU) -#define FMUTEST_R_SME_WHV1_SMEWHV1_SHIFT (0U) -/*! SMEWHV1 - SME WHV Parameter Set 1 */ -#define FMUTEST_R_SME_WHV1_SMEWHV1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SME_WHV1_SMEWHV1_SHIFT)) & FMUTEST_R_SME_WHV1_SMEWHV1_MASK) -/*! @} */ - -/*! @name R_SMW_SETTING2 - BIST SMW Setting 2 Register */ -/*! @{ */ - -#define FMUTEST_R_SMW_SETTING2_SMWPARM2_MASK (0x1FFFFFFFU) -#define FMUTEST_R_SMW_SETTING2_SMWPARM2_SHIFT (0U) -/*! SMWPARM2 - SMW Parameter Set 2 */ -#define FMUTEST_R_SMW_SETTING2_SMWPARM2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMW_SETTING2_SMWPARM2_SHIFT)) & FMUTEST_R_SMW_SETTING2_SMWPARM2_MASK) -/*! @} */ - -/*! @name R_D_MISR0 - BIST DIN MISR 0 Register */ -/*! @{ */ - -#define FMUTEST_R_D_MISR0_DATASIG0_MASK (0xFFFFFFFFU) -#define FMUTEST_R_D_MISR0_DATASIG0_SHIFT (0U) -/*! DATASIG0 - Data Signature */ -#define FMUTEST_R_D_MISR0_DATASIG0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_D_MISR0_DATASIG0_SHIFT)) & FMUTEST_R_D_MISR0_DATASIG0_MASK) -/*! @} */ - -/*! @name R_A_MISR0 - BIST Address MISR 0 Register */ -/*! @{ */ - -#define FMUTEST_R_A_MISR0_ADRSIG0_MASK (0xFFFFFFFFU) -#define FMUTEST_R_A_MISR0_ADRSIG0_SHIFT (0U) -/*! ADRSIG0 - Address Signature */ -#define FMUTEST_R_A_MISR0_ADRSIG0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_A_MISR0_ADRSIG0_SHIFT)) & FMUTEST_R_A_MISR0_ADRSIG0_MASK) -/*! @} */ - -/*! @name R_C_MISR0 - BIST Control MISR 0 Register */ -/*! @{ */ - -#define FMUTEST_R_C_MISR0_CTRLSIG0_MASK (0xFFFFFFFFU) -#define FMUTEST_R_C_MISR0_CTRLSIG0_SHIFT (0U) -/*! CTRLSIG0 - Control Signature */ -#define FMUTEST_R_C_MISR0_CTRLSIG0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_C_MISR0_CTRLSIG0_SHIFT)) & FMUTEST_R_C_MISR0_CTRLSIG0_MASK) -/*! @} */ - -/*! @name R_SMW_SETTING3 - BIST SMW Setting 3 Register */ -/*! @{ */ - -#define FMUTEST_R_SMW_SETTING3_SMWPARM3_MASK (0x1FFFFU) -#define FMUTEST_R_SMW_SETTING3_SMWPARM3_SHIFT (0U) -/*! SMWPARM3 - SMW Parameter Set 3 */ -#define FMUTEST_R_SMW_SETTING3_SMWPARM3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMW_SETTING3_SMWPARM3_SHIFT)) & FMUTEST_R_SMW_SETTING3_SMWPARM3_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL1 - BIST Data Control 1 Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL1_DATA1_MASK (0xFFFFFFFFU) -#define FMUTEST_R_DATA_CTRL1_DATA1_SHIFT (0U) -/*! DATA1 - BIST Data 1 Low */ -#define FMUTEST_R_DATA_CTRL1_DATA1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL1_DATA1_SHIFT)) & FMUTEST_R_DATA_CTRL1_DATA1_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL2 - BIST Data Control 2 Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL2_DATA2_MASK (0xFFFFFFFFU) -#define FMUTEST_R_DATA_CTRL2_DATA2_SHIFT (0U) -/*! DATA2 - BIST Data 2 Low */ -#define FMUTEST_R_DATA_CTRL2_DATA2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL2_DATA2_SHIFT)) & FMUTEST_R_DATA_CTRL2_DATA2_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL3 - BIST Data Control 3 Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL3_DATA3_MASK (0xFFFFFFFFU) -#define FMUTEST_R_DATA_CTRL3_DATA3_SHIFT (0U) -/*! DATA3 - BIST Data 3 Low */ -#define FMUTEST_R_DATA_CTRL3_DATA3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL3_DATA3_SHIFT)) & FMUTEST_R_DATA_CTRL3_DATA3_MASK) -/*! @} */ - -/*! @name R_REPAIR0_0 - BIST Repair 0 for Block 0 Register */ -/*! @{ */ - -#define FMUTEST_R_REPAIR0_0_RDIS0_0_MASK (0x1U) -#define FMUTEST_R_REPAIR0_0_RDIS0_0_SHIFT (0U) -/*! RDIS0_0 - Control Repair 0 in Block 0. - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_R_REPAIR0_0_RDIS0_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR0_0_RDIS0_0_SHIFT)) & FMUTEST_R_REPAIR0_0_RDIS0_0_MASK) - -#define FMUTEST_R_REPAIR0_0_RADR0_0_MASK (0x1FEU) -#define FMUTEST_R_REPAIR0_0_RADR0_0_SHIFT (1U) -/*! RADR0_0 - XADR for Repair 0 in Block 0 */ -#define FMUTEST_R_REPAIR0_0_RADR0_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR0_0_RADR0_0_SHIFT)) & FMUTEST_R_REPAIR0_0_RADR0_0_MASK) -/*! @} */ - -/*! @name R_REPAIR0_1 - BIST Repair 1 Block 0 Register */ -/*! @{ */ - -#define FMUTEST_R_REPAIR0_1_RDIS0_1_MASK (0x1U) -#define FMUTEST_R_REPAIR0_1_RDIS0_1_SHIFT (0U) -/*! RDIS0_1 - Control Repair 1 in Block 0. - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_R_REPAIR0_1_RDIS0_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR0_1_RDIS0_1_SHIFT)) & FMUTEST_R_REPAIR0_1_RDIS0_1_MASK) - -#define FMUTEST_R_REPAIR0_1_RADR0_1_MASK (0x1FEU) -#define FMUTEST_R_REPAIR0_1_RADR0_1_SHIFT (1U) -/*! RADR0_1 - XADR for Repair 1 in Block 0. */ -#define FMUTEST_R_REPAIR0_1_RADR0_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR0_1_RADR0_1_SHIFT)) & FMUTEST_R_REPAIR0_1_RADR0_1_MASK) -/*! @} */ - -/*! @name R_REPAIR1_0 - BIST Repair 0 Block 1 Register */ -/*! @{ */ - -#define FMUTEST_R_REPAIR1_0_RDIS1_0_MASK (0x1U) -#define FMUTEST_R_REPAIR1_0_RDIS1_0_SHIFT (0U) -/*! RDIS1_0 - Control Repair 0 in Block 1. - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_R_REPAIR1_0_RDIS1_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR1_0_RDIS1_0_SHIFT)) & FMUTEST_R_REPAIR1_0_RDIS1_0_MASK) - -#define FMUTEST_R_REPAIR1_0_RADR1_0_MASK (0x1FEU) -#define FMUTEST_R_REPAIR1_0_RADR1_0_SHIFT (1U) -/*! RADR1_0 - XADR for Repair 0 in Block 1. */ -#define FMUTEST_R_REPAIR1_0_RADR1_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR1_0_RADR1_0_SHIFT)) & FMUTEST_R_REPAIR1_0_RADR1_0_MASK) -/*! @} */ - -/*! @name R_REPAIR1_1 - BIST Repair 1 Block 1 Register */ -/*! @{ */ - -#define FMUTEST_R_REPAIR1_1_RDIS1_1_MASK (0x1U) -#define FMUTEST_R_REPAIR1_1_RDIS1_1_SHIFT (0U) -/*! RDIS1_1 - Control Repair 1 in Block 1. - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_R_REPAIR1_1_RDIS1_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR1_1_RDIS1_1_SHIFT)) & FMUTEST_R_REPAIR1_1_RDIS1_1_MASK) - -#define FMUTEST_R_REPAIR1_1_RADR1_1_MASK (0x1FEU) -#define FMUTEST_R_REPAIR1_1_RADR1_1_SHIFT (1U) -/*! RADR1_1 - XADR for Repair 1 in Block 1. */ -#define FMUTEST_R_REPAIR1_1_RADR1_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR1_1_RADR1_1_SHIFT)) & FMUTEST_R_REPAIR1_1_RADR1_1_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL0_EX - BIST Data Control 0 Extension Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL0_EX_DATA0X_MASK (0x7U) -#define FMUTEST_R_DATA_CTRL0_EX_DATA0X_SHIFT (0U) -/*! DATA0X - BIST Data 0 High */ -#define FMUTEST_R_DATA_CTRL0_EX_DATA0X(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL0_EX_DATA0X_SHIFT)) & FMUTEST_R_DATA_CTRL0_EX_DATA0X_MASK) -/*! @} */ - -/*! @name R_TIMER_CTRL_EX - BIST Timer Control Extension Register */ -/*! @{ */ - -#define FMUTEST_R_TIMER_CTRL_EX_TLVSDLY_H_MASK (0x7U) -#define FMUTEST_R_TIMER_CTRL_EX_TLVSDLY_H_SHIFT (0U) -/*! TLVSDLY_H - Tlvs Time Delay Scalar High */ -#define FMUTEST_R_TIMER_CTRL_EX_TLVSDLY_H(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_EX_TLVSDLY_H_SHIFT)) & FMUTEST_R_TIMER_CTRL_EX_TLVSDLY_H_MASK) -/*! @} */ - -/*! @name R_DOUT_QUERY1 - BIST DOUT Query 1 Register */ -/*! @{ */ - -#define FMUTEST_R_DOUT_QUERY1_DOUT_MASK (0x7U) -#define FMUTEST_R_DOUT_QUERY1_DOUT_SHIFT (0U) -/*! DOUT - Failing DOUT High */ -#define FMUTEST_R_DOUT_QUERY1_DOUT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DOUT_QUERY1_DOUT_SHIFT)) & FMUTEST_R_DOUT_QUERY1_DOUT_MASK) -/*! @} */ - -/*! @name R_D_MISR1 - BIST DIN MISR 1 Register */ -/*! @{ */ - -#define FMUTEST_R_D_MISR1_DATASIG1_MASK (0xFFU) -#define FMUTEST_R_D_MISR1_DATASIG1_SHIFT (0U) -/*! DATASIG1 - MISR Data Signature High */ -#define FMUTEST_R_D_MISR1_DATASIG1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_D_MISR1_DATASIG1_SHIFT)) & FMUTEST_R_D_MISR1_DATASIG1_MASK) -/*! @} */ - -/*! @name R_A_MISR1 - BIST Address MISR 1 Register */ -/*! @{ */ - -#define FMUTEST_R_A_MISR1_ADRSIG1_MASK (0xFFU) -#define FMUTEST_R_A_MISR1_ADRSIG1_SHIFT (0U) -/*! ADRSIG1 - MISR Address Signature High */ -#define FMUTEST_R_A_MISR1_ADRSIG1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_A_MISR1_ADRSIG1_SHIFT)) & FMUTEST_R_A_MISR1_ADRSIG1_MASK) -/*! @} */ - -/*! @name R_C_MISR1 - BIST Control MISR 1 Register */ -/*! @{ */ - -#define FMUTEST_R_C_MISR1_CTRLSIG1_MASK (0xFFU) -#define FMUTEST_R_C_MISR1_CTRLSIG1_SHIFT (0U) -/*! CTRLSIG1 - MISR Control Signature High */ -#define FMUTEST_R_C_MISR1_CTRLSIG1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_C_MISR1_CTRLSIG1_SHIFT)) & FMUTEST_R_C_MISR1_CTRLSIG1_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL1_EX - BIST Data Control 1 Extension Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL1_EX_DATA1X_MASK (0x7U) -#define FMUTEST_R_DATA_CTRL1_EX_DATA1X_SHIFT (0U) -/*! DATA1X - BIST Data 1 High */ -#define FMUTEST_R_DATA_CTRL1_EX_DATA1X(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL1_EX_DATA1X_SHIFT)) & FMUTEST_R_DATA_CTRL1_EX_DATA1X_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL2_EX - BIST Data Control 2 Extension Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL2_EX_DATA2X_MASK (0x7U) -#define FMUTEST_R_DATA_CTRL2_EX_DATA2X_SHIFT (0U) -/*! DATA2X - BIST Data 2 High */ -#define FMUTEST_R_DATA_CTRL2_EX_DATA2X(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL2_EX_DATA2X_SHIFT)) & FMUTEST_R_DATA_CTRL2_EX_DATA2X_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL3_EX - BIST Data Control 3 Extension Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL3_EX_DATA3X_MASK (0x7U) -#define FMUTEST_R_DATA_CTRL3_EX_DATA3X_SHIFT (0U) -/*! DATA3X - BIST Data 3 High */ -#define FMUTEST_R_DATA_CTRL3_EX_DATA3X(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL3_EX_DATA3X_SHIFT)) & FMUTEST_R_DATA_CTRL3_EX_DATA3X_MASK) -/*! @} */ - -/*! @name SMW_TIMER_OPTION - SMW Timer Option Register */ -/*! @{ */ - -#define FMUTEST_SMW_TIMER_OPTION_SMW_CDIVL_MASK (0xFFU) -#define FMUTEST_SMW_TIMER_OPTION_SMW_CDIVL_SHIFT (0U) -/*! SMW_CDIVL - Clock Divide Scalar for Long Pulse */ -#define FMUTEST_SMW_TIMER_OPTION_SMW_CDIVL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_TIMER_OPTION_SMW_CDIVL_SHIFT)) & FMUTEST_SMW_TIMER_OPTION_SMW_CDIVL_MASK) - -#define FMUTEST_SMW_TIMER_OPTION_SMW_TVFY_MASK (0x1F00U) -#define FMUTEST_SMW_TIMER_OPTION_SMW_TVFY_SHIFT (8U) -/*! SMW_TVFY - Timer Adjust for Verify */ -#define FMUTEST_SMW_TIMER_OPTION_SMW_TVFY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_TIMER_OPTION_SMW_TVFY_SHIFT)) & FMUTEST_SMW_TIMER_OPTION_SMW_TVFY_MASK) -/*! @} */ - -/*! @name SMW_SETTING_OPTION0 - SMW Setting Option 0 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SETTING_OPTION0_MV_INIT_MASK (0x1C000U) -#define FMUTEST_SMW_SETTING_OPTION0_MV_INIT_SHIFT (14U) -/*! MV_INIT - Medium Voltage Level Select Initial */ -#define FMUTEST_SMW_SETTING_OPTION0_MV_INIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION0_MV_INIT_SHIFT)) & FMUTEST_SMW_SETTING_OPTION0_MV_INIT_MASK) - -#define FMUTEST_SMW_SETTING_OPTION0_MV_END_MASK (0xE0000U) -#define FMUTEST_SMW_SETTING_OPTION0_MV_END_SHIFT (17U) -/*! MV_END - Medium Voltage Level Select Final */ -#define FMUTEST_SMW_SETTING_OPTION0_MV_END(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION0_MV_END_SHIFT)) & FMUTEST_SMW_SETTING_OPTION0_MV_END_MASK) - -#define FMUTEST_SMW_SETTING_OPTION0_MV_MISC_MASK (0xF00000U) -#define FMUTEST_SMW_SETTING_OPTION0_MV_MISC_SHIFT (20U) -/*! MV_MISC - Medium Voltage Control Misc */ -#define FMUTEST_SMW_SETTING_OPTION0_MV_MISC(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION0_MV_MISC_SHIFT)) & FMUTEST_SMW_SETTING_OPTION0_MV_MISC_MASK) - -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_INIT_MASK (0x3000000U) -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_INIT_SHIFT (24U) -/*! IPGM_INIT - Program Current Control Initial */ -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_INIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION0_IPGM_INIT_SHIFT)) & FMUTEST_SMW_SETTING_OPTION0_IPGM_INIT_MASK) - -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_END_MASK (0xC000000U) -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_END_SHIFT (26U) -/*! IPGM_END - Program Current Control Final */ -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_END(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION0_IPGM_END_SHIFT)) & FMUTEST_SMW_SETTING_OPTION0_IPGM_END_MASK) - -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_MISC_MASK (0x70000000U) -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_MISC_SHIFT (28U) -/*! IPGM_MISC - Program Current Control Misc */ -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_MISC(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION0_IPGM_MISC_SHIFT)) & FMUTEST_SMW_SETTING_OPTION0_IPGM_MISC_MASK) -/*! @} */ - -/*! @name SMW_SETTING_OPTION2 - SMW Setting Option 2 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SETTING_OPTION2_THVS_CTRL_MASK (0x7U) -#define FMUTEST_SMW_SETTING_OPTION2_THVS_CTRL_SHIFT (0U) -/*! THVS_CTRL - Thvs control */ -#define FMUTEST_SMW_SETTING_OPTION2_THVS_CTRL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_THVS_CTRL_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_THVS_CTRL_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_TRCV_CTRL_MASK (0x38U) -#define FMUTEST_SMW_SETTING_OPTION2_TRCV_CTRL_SHIFT (3U) -/*! TRCV_CTRL - Trcv Control */ -#define FMUTEST_SMW_SETTING_OPTION2_TRCV_CTRL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_TRCV_CTRL_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_TRCV_CTRL_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_XTRA_ERS_MASK (0xC0U) -#define FMUTEST_SMW_SETTING_OPTION2_XTRA_ERS_SHIFT (6U) -/*! XTRA_ERS - Number of Post Shots for SME */ -#define FMUTEST_SMW_SETTING_OPTION2_XTRA_ERS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_XTRA_ERS_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_XTRA_ERS_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_XTRA_PGM_MASK (0x300U) -#define FMUTEST_SMW_SETTING_OPTION2_XTRA_PGM_SHIFT (8U) -/*! XTRA_PGM - Number of Post Shots for SMP */ -#define FMUTEST_SMW_SETTING_OPTION2_XTRA_PGM(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_XTRA_PGM_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_XTRA_PGM_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_WHV_CNTR_MASK (0x3FC00U) -#define FMUTEST_SMW_SETTING_OPTION2_WHV_CNTR_SHIFT (10U) -/*! WHV_CNTR - WHV Counter */ -#define FMUTEST_SMW_SETTING_OPTION2_WHV_CNTR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_WHV_CNTR_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_WHV_CNTR_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_POST_TERS_MASK (0x1C0000U) -#define FMUTEST_SMW_SETTING_OPTION2_POST_TERS_SHIFT (18U) -/*! POST_TERS - Post Ters Time - * 0b000..50 usec - * 0b001..100 usec - * 0b010..200 usec - * 0b011..300 usec - * 0b100..500 usec - * 0b101..1 msec - * 0b110..1.5 msec - * 0b111..2 msec - */ -#define FMUTEST_SMW_SETTING_OPTION2_POST_TERS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_POST_TERS_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_POST_TERS_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_POST_TPGM_MASK (0x600000U) -#define FMUTEST_SMW_SETTING_OPTION2_POST_TPGM_SHIFT (21U) -/*! POST_TPGM - Post Tpgm Time - * 0b00..1 usec - * 0b01..2 usec - * 0b10..4 usec - * 0b11..8 usec - */ -#define FMUTEST_SMW_SETTING_OPTION2_POST_TPGM(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_POST_TPGM_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_POST_TPGM_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_VFY_OPT_MASK (0x1800000U) -#define FMUTEST_SMW_SETTING_OPTION2_VFY_OPT_SHIFT (23U) -/*! VFY_OPT - Verify Option - * 0b00..Skip verify for post shot only, verify for all other shots - * 0b01..Skip verify for the 1st and post shots - * 0b10..Skip the 1st, 2nd, and post shots - * 0b11..Skip verify for all shots - */ -#define FMUTEST_SMW_SETTING_OPTION2_VFY_OPT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_VFY_OPT_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_VFY_OPT_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_TPGM_OPT_MASK (0x6000000U) -#define FMUTEST_SMW_SETTING_OPTION2_TPGM_OPT_SHIFT (25U) -/*! TPGM_OPT - Tpgm Option - * 0b00..Fixed Tpgm for all shots, except post shot - * 0b01..Increase Tpgm option by 1 for each loop until Tpgm reaches 4 usec - * 0b10..Increase Tpgm option by 1 for each loop until Tpgm reaches 8 usec - * 0b11..Unused - */ -#define FMUTEST_SMW_SETTING_OPTION2_TPGM_OPT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_TPGM_OPT_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_TPGM_OPT_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_MASK0_OPT_MASK (0x8000000U) -#define FMUTEST_SMW_SETTING_OPTION2_MASK0_OPT_SHIFT (27U) -/*! MASK0_OPT - MASK0_OPT - * 0b0..Mask programmed bits passing PV until extra shot - * 0b1..Always program bits even if they pass PV - */ -#define FMUTEST_SMW_SETTING_OPTION2_MASK0_OPT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_MASK0_OPT_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_MASK0_OPT_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_DIS_PRER_MASK (0x10000000U) -#define FMUTEST_SMW_SETTING_OPTION2_DIS_PRER_SHIFT (28U) -/*! DIS_PRER - Disable pre-PV Read before First Program Shot - * 0b0..Enable pre-PV read before first program shot - * 0b1..Disable pre-PV read before first program shot - */ -#define FMUTEST_SMW_SETTING_OPTION2_DIS_PRER(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_DIS_PRER_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_DIS_PRER_MASK) -/*! @} */ - -/*! @name SMW_SETTING_OPTION3 - SMW Setting Option 3 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SETTING_OPTION3_HEM_WHV_CNTR_MASK (0xFFU) -#define FMUTEST_SMW_SETTING_OPTION3_HEM_WHV_CNTR_SHIFT (0U) -/*! HEM_WHV_CNTR - WHV_COUNTER for HEM-erase Cycle */ -#define FMUTEST_SMW_SETTING_OPTION3_HEM_WHV_CNTR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION3_HEM_WHV_CNTR_SHIFT)) & FMUTEST_SMW_SETTING_OPTION3_HEM_WHV_CNTR_MASK) - -#define FMUTEST_SMW_SETTING_OPTION3_HEM_MAX_ERS_MASK (0x1FF00U) -#define FMUTEST_SMW_SETTING_OPTION3_HEM_MAX_ERS_SHIFT (8U) -/*! HEM_MAX_ERS - HEM Max Erase Shot Count */ -#define FMUTEST_SMW_SETTING_OPTION3_HEM_MAX_ERS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION3_HEM_MAX_ERS_SHIFT)) & FMUTEST_SMW_SETTING_OPTION3_HEM_MAX_ERS_MASK) -/*! @} */ - -/*! @name SMW_SMP_WHV_OPTION0 - SMW SMP WHV Option 0 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SMP_WHV_OPTION0_SMP_WHV_OPT0_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_SMP_WHV_OPTION0_SMP_WHV_OPT0_SHIFT (0U) -/*! SMP_WHV_OPT0 - Smart Program WHV Option Low */ -#define FMUTEST_SMW_SMP_WHV_OPTION0_SMP_WHV_OPT0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SMP_WHV_OPTION0_SMP_WHV_OPT0_SHIFT)) & FMUTEST_SMW_SMP_WHV_OPTION0_SMP_WHV_OPT0_MASK) -/*! @} */ - -/*! @name SMW_SME_WHV_OPTION0 - SMW SME WHV Option 0 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SME_WHV_OPTION0_SME_WHV_OPT0_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_SME_WHV_OPTION0_SME_WHV_OPT0_SHIFT (0U) -/*! SME_WHV_OPT0 - Smart Erase WHV Option Low */ -#define FMUTEST_SMW_SME_WHV_OPTION0_SME_WHV_OPT0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SME_WHV_OPTION0_SME_WHV_OPT0_SHIFT)) & FMUTEST_SMW_SME_WHV_OPTION0_SME_WHV_OPT0_MASK) -/*! @} */ - -/*! @name SMW_SETTING_OPTION1 - SMW Setting Option 1 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SETTING_OPTION1_TERS_CTRL0_MASK (0x7U) -#define FMUTEST_SMW_SETTING_OPTION1_TERS_CTRL0_SHIFT (0U) -/*! TERS_CTRL0 - Ters Control - * 0b000..50 usec - * 0b001..100 usec - * 0b010..200 usec - * 0b011..300 usec - * 0b100..500 usec - * 0b101..1 msec - * 0b110..1.5 msec - * 0b111..2 msec - */ -#define FMUTEST_SMW_SETTING_OPTION1_TERS_CTRL0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_TERS_CTRL0_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_TERS_CTRL0_MASK) - -#define FMUTEST_SMW_SETTING_OPTION1_TPGM_CTRL_MASK (0x18U) -#define FMUTEST_SMW_SETTING_OPTION1_TPGM_CTRL_SHIFT (3U) -/*! TPGM_CTRL - Tpgm Control - * 0b00..1 usec - * 0b01..2 usec - * 0b10..4 usec - * 0b11..8 usec - */ -#define FMUTEST_SMW_SETTING_OPTION1_TPGM_CTRL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_TPGM_CTRL_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_TPGM_CTRL_MASK) - -#define FMUTEST_SMW_SETTING_OPTION1_TNVS_CTRL_MASK (0xE0U) -#define FMUTEST_SMW_SETTING_OPTION1_TNVS_CTRL_SHIFT (5U) -/*! TNVS_CTRL - Tnvs Control - * 0b000..5 usec - * 0b001..8 usec - * 0b010..11 usec - * 0b011..14 usec - * 0b100..17 usec - * 0b101..20 usec - * 0b110..23 usec - * 0b111..26 usec - */ -#define FMUTEST_SMW_SETTING_OPTION1_TNVS_CTRL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_TNVS_CTRL_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_TNVS_CTRL_MASK) - -#define FMUTEST_SMW_SETTING_OPTION1_TNVH_CTRL_MASK (0x700U) -#define FMUTEST_SMW_SETTING_OPTION1_TNVH_CTRL_SHIFT (8U) -/*! TNVH_CTRL - Tnvh Control - * 0b000..2 usec - * 0b001..2.5 usec - * 0b010..3 usec - * 0b011..3.5 usec - * 0b100..4 usec - * 0b101..4.5 usec - * 0b110..5 usec - * 0b111..5.5 usec - */ -#define FMUTEST_SMW_SETTING_OPTION1_TNVH_CTRL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_TNVH_CTRL_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_TNVH_CTRL_MASK) - -#define FMUTEST_SMW_SETTING_OPTION1_TPGS_CTRL_MASK (0x3800U) -#define FMUTEST_SMW_SETTING_OPTION1_TPGS_CTRL_SHIFT (11U) -/*! TPGS_CTRL - Tpgs Control - * 0b000..1 usec - * 0b001..2 usec - * 0b010..3 usec - * 0b011..4 usec - * 0b100..5 usec - * 0b101..6 usec - * 0b110..7 usec - * 0b111..8 usec - */ -#define FMUTEST_SMW_SETTING_OPTION1_TPGS_CTRL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_TPGS_CTRL_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_TPGS_CTRL_MASK) - -#define FMUTEST_SMW_SETTING_OPTION1_MAX_ERASE_MASK (0x7FC000U) -#define FMUTEST_SMW_SETTING_OPTION1_MAX_ERASE_SHIFT (14U) -/*! MAX_ERASE - Number of Erase Shots */ -#define FMUTEST_SMW_SETTING_OPTION1_MAX_ERASE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_MAX_ERASE_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_MAX_ERASE_MASK) - -#define FMUTEST_SMW_SETTING_OPTION1_MAX_PROG_MASK (0xF800000U) -#define FMUTEST_SMW_SETTING_OPTION1_MAX_PROG_SHIFT (23U) -/*! MAX_PROG - Number of Program Shots */ -#define FMUTEST_SMW_SETTING_OPTION1_MAX_PROG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_MAX_PROG_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_MAX_PROG_MASK) -/*! @} */ - -/*! @name SMW_SMP_WHV_OPTION1 - SMW SMP WHV Option 1 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SMP_WHV_OPTION1_SMP_WHV_OPT1_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_SMP_WHV_OPTION1_SMP_WHV_OPT1_SHIFT (0U) -/*! SMP_WHV_OPT1 - Smart Program WHV Option High */ -#define FMUTEST_SMW_SMP_WHV_OPTION1_SMP_WHV_OPT1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SMP_WHV_OPTION1_SMP_WHV_OPT1_SHIFT)) & FMUTEST_SMW_SMP_WHV_OPTION1_SMP_WHV_OPT1_MASK) -/*! @} */ - -/*! @name SMW_SME_WHV_OPTION1 - SMW SME WHV Option 1 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SME_WHV_OPTION1_SME_WHV_OPT1_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_SME_WHV_OPTION1_SME_WHV_OPT1_SHIFT (0U) -/*! SME_WHV_OPT1 - Smart Erase WHV Option High */ -#define FMUTEST_SMW_SME_WHV_OPTION1_SME_WHV_OPT1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SME_WHV_OPTION1_SME_WHV_OPT1_SHIFT)) & FMUTEST_SMW_SME_WHV_OPTION1_SME_WHV_OPT1_MASK) -/*! @} */ - -/*! @name REPAIR0_0 - FMU Repair 0 Block 0 Register */ -/*! @{ */ - -#define FMUTEST_REPAIR0_0_RDIS0_0_MASK (0x1U) -#define FMUTEST_REPAIR0_0_RDIS0_0_SHIFT (0U) -/*! RDIS0_0 - RDIS0_0 - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_REPAIR0_0_RDIS0_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR0_0_RDIS0_0_SHIFT)) & FMUTEST_REPAIR0_0_RDIS0_0_MASK) - -#define FMUTEST_REPAIR0_0_RADR0_0_MASK (0x1FEU) -#define FMUTEST_REPAIR0_0_RADR0_0_SHIFT (1U) -/*! RADR0_0 - RADR0_0 */ -#define FMUTEST_REPAIR0_0_RADR0_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR0_0_RADR0_0_SHIFT)) & FMUTEST_REPAIR0_0_RADR0_0_MASK) -/*! @} */ - -/*! @name REPAIR0_1 - FMU Repair 1 Block 0 Register */ -/*! @{ */ - -#define FMUTEST_REPAIR0_1_RDIS0_1_MASK (0x1U) -#define FMUTEST_REPAIR0_1_RDIS0_1_SHIFT (0U) -/*! RDIS0_1 - RDIS0_1 - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_REPAIR0_1_RDIS0_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR0_1_RDIS0_1_SHIFT)) & FMUTEST_REPAIR0_1_RDIS0_1_MASK) - -#define FMUTEST_REPAIR0_1_RADR0_1_MASK (0x1FEU) -#define FMUTEST_REPAIR0_1_RADR0_1_SHIFT (1U) -/*! RADR0_1 - RADR0_1 */ -#define FMUTEST_REPAIR0_1_RADR0_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR0_1_RADR0_1_SHIFT)) & FMUTEST_REPAIR0_1_RADR0_1_MASK) -/*! @} */ - -/*! @name REPAIR1_0 - FMU Repair 0 Block 1 Register */ -/*! @{ */ - -#define FMUTEST_REPAIR1_0_RDIS1_0_MASK (0x1U) -#define FMUTEST_REPAIR1_0_RDIS1_0_SHIFT (0U) -/*! RDIS1_0 - RDIS1_0 - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_REPAIR1_0_RDIS1_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR1_0_RDIS1_0_SHIFT)) & FMUTEST_REPAIR1_0_RDIS1_0_MASK) - -#define FMUTEST_REPAIR1_0_RADR1_0_MASK (0x1FEU) -#define FMUTEST_REPAIR1_0_RADR1_0_SHIFT (1U) -/*! RADR1_0 - RADR1_0 */ -#define FMUTEST_REPAIR1_0_RADR1_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR1_0_RADR1_0_SHIFT)) & FMUTEST_REPAIR1_0_RADR1_0_MASK) -/*! @} */ - -/*! @name REPAIR1_1 - FMU Repair 1 Block 1 Register */ -/*! @{ */ - -#define FMUTEST_REPAIR1_1_RDIS1_1_MASK (0x1U) -#define FMUTEST_REPAIR1_1_RDIS1_1_SHIFT (0U) -/*! RDIS1_1 - RDIS1_1 - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_REPAIR1_1_RDIS1_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR1_1_RDIS1_1_SHIFT)) & FMUTEST_REPAIR1_1_RDIS1_1_MASK) - -#define FMUTEST_REPAIR1_1_RADR1_1_MASK (0x1FEU) -#define FMUTEST_REPAIR1_1_RADR1_1_SHIFT (1U) -/*! RADR1_1 - RADR1_1 */ -#define FMUTEST_REPAIR1_1_RADR1_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR1_1_RADR1_1_SHIFT)) & FMUTEST_REPAIR1_1_RADR1_1_MASK) -/*! @} */ - -/*! @name SMW_HB_SIGNALS - SMW HB Signals Register */ -/*! @{ */ - -#define FMUTEST_SMW_HB_SIGNALS_SMW_ARRAY_MASK (0x7U) -#define FMUTEST_SMW_HB_SIGNALS_SMW_ARRAY_SHIFT (0U) -/*! SMW_ARRAY - SMW Region Select - * 0b000..Main array - * 0b001..IFR space only or main (and REDEN space) with IFR space for mass erase - * 0b010..IFR1 space - * 0b100..REDEN space - */ -#define FMUTEST_SMW_HB_SIGNALS_SMW_ARRAY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_SMW_ARRAY_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_SMW_ARRAY_MASK) - -#define FMUTEST_SMW_HB_SIGNALS_USER_IFREN1_MASK (0x8U) -#define FMUTEST_SMW_HB_SIGNALS_USER_IFREN1_SHIFT (3U) -/*! USER_IFREN1 - IFR1 Enable - * 0b0..IFREN1 input to the flash array is driven LOW - * 0b1..IFREN1 input to the flash array is driven HIGH - */ -#define FMUTEST_SMW_HB_SIGNALS_USER_IFREN1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_USER_IFREN1_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_USER_IFREN1_MASK) - -#define FMUTEST_SMW_HB_SIGNALS_USER_PV_MASK (0x10U) -#define FMUTEST_SMW_HB_SIGNALS_USER_PV_SHIFT (4U) -/*! USER_PV - Program Verify - * 0b0..PV input to the flash array is driven LOW - * 0b1..PV input to the flash array is driven HIGH - */ -#define FMUTEST_SMW_HB_SIGNALS_USER_PV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_USER_PV_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_USER_PV_MASK) - -#define FMUTEST_SMW_HB_SIGNALS_USER_EV_MASK (0x20U) -#define FMUTEST_SMW_HB_SIGNALS_USER_EV_SHIFT (5U) -/*! USER_EV - Erase Verify - * 0b0..EV input to the flash array is driven LOW - * 0b1..EV input to the flash array is driven HIGH - */ -#define FMUTEST_SMW_HB_SIGNALS_USER_EV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_USER_EV_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_USER_EV_MASK) - -#define FMUTEST_SMW_HB_SIGNALS_USER_IFREN_MASK (0x40U) -#define FMUTEST_SMW_HB_SIGNALS_USER_IFREN_SHIFT (6U) -/*! USER_IFREN - IFR Enable - * 0b0..IFREN input to the flash array is driven LOW - * 0b1..IFREN input to the flash array is driven HIGH - */ -#define FMUTEST_SMW_HB_SIGNALS_USER_IFREN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_USER_IFREN_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_USER_IFREN_MASK) - -#define FMUTEST_SMW_HB_SIGNALS_USER_REDEN_MASK (0x80U) -#define FMUTEST_SMW_HB_SIGNALS_USER_REDEN_SHIFT (7U) -/*! USER_REDEN - Repair Read Enable - * 0b0..REDEN input to the flash array is driven LOW - * 0b1..REDEN input to the flash array is driven HIGH - */ -#define FMUTEST_SMW_HB_SIGNALS_USER_REDEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_USER_REDEN_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_USER_REDEN_MASK) - -#define FMUTEST_SMW_HB_SIGNALS_USER_HEM_MASK (0x100U) -#define FMUTEST_SMW_HB_SIGNALS_USER_HEM_SHIFT (8U) -/*! USER_HEM - High Endurance Enable - * 0b0..HEM input to SMW / BIST PIN_CTRL[24] is driven LOW - * 0b1..HEM input to SMW / BIST PIN_CTRL[24] is driven HIGH - */ -#define FMUTEST_SMW_HB_SIGNALS_USER_HEM(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_USER_HEM_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_USER_HEM_MASK) -/*! @} */ - -/*! @name BIST_DUMP_CTRL - BIST Datadump Control Register */ -/*! @{ */ - -#define FMUTEST_BIST_DUMP_CTRL_BIST_DONE_MASK (0x10000U) -#define FMUTEST_BIST_DUMP_CTRL_BIST_DONE_SHIFT (16U) -/*! BIST_DONE - BIST Done - * 0b0..The BIST (or data dump) is running - * 0b1..The BIST (or data dump) has completed - */ -#define FMUTEST_BIST_DUMP_CTRL_BIST_DONE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_BIST_DONE_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_BIST_DONE_MASK) - -#define FMUTEST_BIST_DUMP_CTRL_BIST_FAIL_MASK (0x20000U) -#define FMUTEST_BIST_DUMP_CTRL_BIST_FAIL_SHIFT (17U) -/*! BIST_FAIL - BIST Fail - * 0b0..The last BIST operation completed successfully (or could not fail) - * 0b1..The last BIST operation failed - */ -#define FMUTEST_BIST_DUMP_CTRL_BIST_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_BIST_FAIL_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_BIST_FAIL_MASK) - -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MASK (0x40000U) -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_SHIFT (18U) -/*! DATADUMP - Data Dump Enable */ -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_DATADUMP_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_DATADUMP_MASK) - -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_TRIG_MASK (0x80000U) -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_TRIG_SHIFT (19U) -/*! DATADUMP_TRIG - Data Dump Trigger */ -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_TRIG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_DATADUMP_TRIG_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_DATADUMP_TRIG_MASK) - -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_PATT_MASK (0x300000U) -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_PATT_SHIFT (20U) -/*! DATADUMP_PATT - Data Dump Pattern Select - * 0b00..All ones - * 0b01..All zeroes - * 0b10..Checkerboard - * 0b11..Inverse checkerboard - */ -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_PATT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_DATADUMP_PATT_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_DATADUMP_PATT_MASK) - -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGEN_MASK (0x400000U) -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGEN_SHIFT (22U) -/*! DATADUMP_MRGEN - Data Dump Margin Enable - * 0b0..Normal read pulse shape - * 0b1..Margin read pulse shape - */ -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGEN_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGEN_MASK) - -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGTYPE_MASK (0x800000U) -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGTYPE_SHIFT (23U) -/*! DATADUMP_MRGTYPE - Data Dump Margin Type - * 0b0..DIN method used - * 0b1..TM method used - */ -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGTYPE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGTYPE_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGTYPE_MASK) -/*! @} */ - -/*! @name ATX_PIN_CTRL - ATX Pin Control Register */ -/*! @{ */ - -#define FMUTEST_ATX_PIN_CTRL_TM_TO_ATX_MASK (0xFFU) -#define FMUTEST_ATX_PIN_CTRL_TM_TO_ATX_SHIFT (0U) -/*! TM_TO_ATX - TM to ATX - * 0b00000001..TM[0] to ATX0 - * 0b00000010..TM[1] to ATX0 - * 0b00000100..TM[2] to ATX0 - * 0b00001000..TM[3] to ATX0 - * 0b00010000..TM[0] to ATX1 - * 0b00100000..TM[1] to ATX1 - * 0b01000000..TM[2] to ATX1 - * 0b10000000..TM[3] to ATX1 - */ -#define FMUTEST_ATX_PIN_CTRL_TM_TO_ATX(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_ATX_PIN_CTRL_TM_TO_ATX_SHIFT)) & FMUTEST_ATX_PIN_CTRL_TM_TO_ATX_MASK) -/*! @} */ - -/*! @name FAILCNT - Fail Count Register */ -/*! @{ */ - -#define FMUTEST_FAILCNT_FAILCNT_MASK (0xFFFFFFFFU) -#define FMUTEST_FAILCNT_FAILCNT_SHIFT (0U) -/*! FAILCNT - Fail Count */ -#define FMUTEST_FAILCNT_FAILCNT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FAILCNT_FAILCNT_SHIFT)) & FMUTEST_FAILCNT_FAILCNT_MASK) -/*! @} */ - -/*! @name PGM_PULSE_CNT0 - Block 0 Program Pulse Count Register */ -/*! @{ */ - -#define FMUTEST_PGM_PULSE_CNT0_PGM_CNT0_MASK (0xFFFFFFFFU) -#define FMUTEST_PGM_PULSE_CNT0_PGM_CNT0_SHIFT (0U) -/*! PGM_CNT0 - Program Pulse Count */ -#define FMUTEST_PGM_PULSE_CNT0_PGM_CNT0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PGM_PULSE_CNT0_PGM_CNT0_SHIFT)) & FMUTEST_PGM_PULSE_CNT0_PGM_CNT0_MASK) -/*! @} */ - -/*! @name PGM_PULSE_CNT1 - Block 1 Program Pulse Count Register */ -/*! @{ */ - -#define FMUTEST_PGM_PULSE_CNT1_PGM_CNT1_MASK (0xFFFFFFFFU) -#define FMUTEST_PGM_PULSE_CNT1_PGM_CNT1_SHIFT (0U) -/*! PGM_CNT1 - Program Pulse Count */ -#define FMUTEST_PGM_PULSE_CNT1_PGM_CNT1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PGM_PULSE_CNT1_PGM_CNT1_SHIFT)) & FMUTEST_PGM_PULSE_CNT1_PGM_CNT1_MASK) -/*! @} */ - -/*! @name ERS_PULSE_CNT - Erase Pulse Count Register */ -/*! @{ */ - -#define FMUTEST_ERS_PULSE_CNT_ERS_CNT0_MASK (0xFFFFU) -#define FMUTEST_ERS_PULSE_CNT_ERS_CNT0_SHIFT (0U) -/*! ERS_CNT0 - Block 0 Erase Pulse Count */ -#define FMUTEST_ERS_PULSE_CNT_ERS_CNT0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_ERS_PULSE_CNT_ERS_CNT0_SHIFT)) & FMUTEST_ERS_PULSE_CNT_ERS_CNT0_MASK) - -#define FMUTEST_ERS_PULSE_CNT_ERS_CNT1_MASK (0xFFFF0000U) -#define FMUTEST_ERS_PULSE_CNT_ERS_CNT1_SHIFT (16U) -/*! ERS_CNT1 - Block 1 Erase Pulse Count */ -#define FMUTEST_ERS_PULSE_CNT_ERS_CNT1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_ERS_PULSE_CNT_ERS_CNT1_SHIFT)) & FMUTEST_ERS_PULSE_CNT_ERS_CNT1_MASK) -/*! @} */ - -/*! @name MAX_PULSE_CNT - Maximum Pulse Count Register */ -/*! @{ */ - -#define FMUTEST_MAX_PULSE_CNT_LAST_PCNT_MASK (0x1FFU) -#define FMUTEST_MAX_PULSE_CNT_LAST_PCNT_SHIFT (0U) -/*! LAST_PCNT - Last SMW Operation's Pulse Count */ -#define FMUTEST_MAX_PULSE_CNT_LAST_PCNT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MAX_PULSE_CNT_LAST_PCNT_SHIFT)) & FMUTEST_MAX_PULSE_CNT_LAST_PCNT_MASK) - -#define FMUTEST_MAX_PULSE_CNT_MAX_ERS_CNT_MASK (0x1FF0000U) -#define FMUTEST_MAX_PULSE_CNT_MAX_ERS_CNT_SHIFT (16U) -/*! MAX_ERS_CNT - Maximum Erase Pulse Count */ -#define FMUTEST_MAX_PULSE_CNT_MAX_ERS_CNT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MAX_PULSE_CNT_MAX_ERS_CNT_SHIFT)) & FMUTEST_MAX_PULSE_CNT_MAX_ERS_CNT_MASK) - -#define FMUTEST_MAX_PULSE_CNT_MAX_PGM_CNT_MASK (0xF8000000U) -#define FMUTEST_MAX_PULSE_CNT_MAX_PGM_CNT_SHIFT (27U) -/*! MAX_PGM_CNT - Maximum Program Pulse Count */ -#define FMUTEST_MAX_PULSE_CNT_MAX_PGM_CNT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MAX_PULSE_CNT_MAX_PGM_CNT_SHIFT)) & FMUTEST_MAX_PULSE_CNT_MAX_PGM_CNT_MASK) -/*! @} */ - -/*! @name PORT_CTRL - Port Control Register */ -/*! @{ */ - -#define FMUTEST_PORT_CTRL_BDONE_SEL_MASK (0x3U) -#define FMUTEST_PORT_CTRL_BDONE_SEL_SHIFT (0U) -/*! BDONE_SEL - BIST Done Select - * 0b00..Select internal bist_done signal from current module instantiation - * 0b01..Select ipt_bist_fail signal from current module instantiation - * 0b10..Select ipt_bist_done signal from other module instantiation - * 0b11..Select AND of internal bist_done signal from current module instantiation with ipt_bist_done signal from other module instantiation - */ -#define FMUTEST_PORT_CTRL_BDONE_SEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PORT_CTRL_BDONE_SEL_SHIFT)) & FMUTEST_PORT_CTRL_BDONE_SEL_MASK) - -#define FMUTEST_PORT_CTRL_BSDO_SEL_MASK (0xCU) -#define FMUTEST_PORT_CTRL_BSDO_SEL_SHIFT (2U) -/*! BSDO_SEL - BIST Serial Data Output Select - * 0b00..Select internal bist_sdo signal from current module instantiation - * 0b01..Select ipt_bist_done signal from current module instantiation - * 0b10..Select ipt_bist_sdo signal from other module instantiation - * 0b11..Select ipt_bist_done signal from other module instantiation - */ -#define FMUTEST_PORT_CTRL_BSDO_SEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PORT_CTRL_BSDO_SEL_SHIFT)) & FMUTEST_PORT_CTRL_BSDO_SEL_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group FMUTEST_Register_Masks */ - - -/* FMUTEST - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral FMU0TEST base address */ - #define FMU0TEST_BASE (0x50043000u) - /** Peripheral FMU0TEST base address */ - #define FMU0TEST_BASE_NS (0x40043000u) - /** Peripheral FMU0TEST base pointer */ - #define FMU0TEST ((FMUTEST_Type *)FMU0TEST_BASE) - /** Peripheral FMU0TEST base pointer */ - #define FMU0TEST_NS ((FMUTEST_Type *)FMU0TEST_BASE_NS) - /** Array initializer of FMUTEST peripheral base addresses */ - #define FMUTEST_BASE_ADDRS { FMU0TEST_BASE } - /** Array initializer of FMUTEST peripheral base pointers */ - #define FMUTEST_BASE_PTRS { FMU0TEST } - /** Array initializer of FMUTEST peripheral base addresses */ - #define FMUTEST_BASE_ADDRS_NS { FMU0TEST_BASE_NS } - /** Array initializer of FMUTEST peripheral base pointers */ - #define FMUTEST_BASE_PTRS_NS { FMU0TEST_NS } -#else - /** Peripheral FMU0TEST base address */ - #define FMU0TEST_BASE (0x40043000u) - /** Peripheral FMU0TEST base pointer */ - #define FMU0TEST ((FMUTEST_Type *)FMU0TEST_BASE) - /** Array initializer of FMUTEST peripheral base addresses */ - #define FMUTEST_BASE_ADDRS { FMU0TEST_BASE } - /** Array initializer of FMUTEST peripheral base pointers */ - #define FMUTEST_BASE_PTRS { FMU0TEST } -#endif - -/*! - * @} - */ /* end of group FMUTEST_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- FREQME Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FREQME_Peripheral_Access_Layer FREQME Peripheral Access Layer - * @{ - */ - -/** FREQME - Register Layout Typedef */ -typedef struct { - union { /* offset: 0x0 */ - __I uint32_t CTRL_R; /**< Control (in Read mode), offset: 0x0 */ - __O uint32_t CTRL_W; /**< Control (in Write mode), offset: 0x0 */ - }; - __IO uint32_t CTRLSTAT; /**< Control Status, offset: 0x4 */ - __IO uint32_t MIN; /**< Minimum, offset: 0x8 */ - __IO uint32_t MAX; /**< Maximum, offset: 0xC */ -} FREQME_Type; - -/* ---------------------------------------------------------------------------- - -- FREQME Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FREQME_Register_Masks FREQME Register Masks - * @{ - */ - -/*! @name CTRL_R - Control (in Read mode) */ -/*! @{ */ - -#define FREQME_CTRL_R_RESULT_MASK (0x7FFFFFFFU) -#define FREQME_CTRL_R_RESULT_SHIFT (0U) -#define FREQME_CTRL_R_RESULT(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_R_RESULT_SHIFT)) & FREQME_CTRL_R_RESULT_MASK) - -#define FREQME_CTRL_R_MEASURE_IN_PROGRESS_MASK (0x80000000U) -#define FREQME_CTRL_R_MEASURE_IN_PROGRESS_SHIFT (31U) -/*! MEASURE_IN_PROGRESS - Measurement In Progress - * 0b0..Complete - * 0b1..In progress - */ -#define FREQME_CTRL_R_MEASURE_IN_PROGRESS(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_R_MEASURE_IN_PROGRESS_SHIFT)) & FREQME_CTRL_R_MEASURE_IN_PROGRESS_MASK) -/*! @} */ - -/*! @name CTRL_W - Control (in Write mode) */ -/*! @{ */ - -#define FREQME_CTRL_W_REF_SCALE_MASK (0x1FU) -#define FREQME_CTRL_W_REF_SCALE_SHIFT (0U) -/*! REF_SCALE - Reference Clock Scaling Factor */ -#define FREQME_CTRL_W_REF_SCALE(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_REF_SCALE_SHIFT)) & FREQME_CTRL_W_REF_SCALE_MASK) - -#define FREQME_CTRL_W_PULSE_MODE_MASK (0x100U) -#define FREQME_CTRL_W_PULSE_MODE_SHIFT (8U) -/*! PULSE_MODE - Pulse Width Measurement Mode Select - * 0b0..Frequency Measurement mode - * 0b1..Pulse Width Measurement mode - */ -#define FREQME_CTRL_W_PULSE_MODE(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_PULSE_MODE_SHIFT)) & FREQME_CTRL_W_PULSE_MODE_MASK) - -#define FREQME_CTRL_W_PULSE_POL_MASK (0x200U) -#define FREQME_CTRL_W_PULSE_POL_SHIFT (9U) -/*! PULSE_POL - Pulse Polarity - * 0b0..High period - * 0b1..Low period - */ -#define FREQME_CTRL_W_PULSE_POL(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_PULSE_POL_SHIFT)) & FREQME_CTRL_W_PULSE_POL_MASK) - -#define FREQME_CTRL_W_LT_MIN_INT_EN_MASK (0x1000U) -#define FREQME_CTRL_W_LT_MIN_INT_EN_SHIFT (12U) -/*! LT_MIN_INT_EN - Less Than Minimum Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FREQME_CTRL_W_LT_MIN_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_LT_MIN_INT_EN_SHIFT)) & FREQME_CTRL_W_LT_MIN_INT_EN_MASK) - -#define FREQME_CTRL_W_GT_MAX_INT_EN_MASK (0x2000U) -#define FREQME_CTRL_W_GT_MAX_INT_EN_SHIFT (13U) -/*! GT_MAX_INT_EN - Greater Than Maximum Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FREQME_CTRL_W_GT_MAX_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_GT_MAX_INT_EN_SHIFT)) & FREQME_CTRL_W_GT_MAX_INT_EN_MASK) - -#define FREQME_CTRL_W_RESULT_READY_INT_EN_MASK (0x4000U) -#define FREQME_CTRL_W_RESULT_READY_INT_EN_SHIFT (14U) -/*! RESULT_READY_INT_EN - Result Ready Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FREQME_CTRL_W_RESULT_READY_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_RESULT_READY_INT_EN_SHIFT)) & FREQME_CTRL_W_RESULT_READY_INT_EN_MASK) - -#define FREQME_CTRL_W_CONTINUOUS_MODE_EN_MASK (0x40000000U) -#define FREQME_CTRL_W_CONTINUOUS_MODE_EN_SHIFT (30U) -/*! CONTINUOUS_MODE_EN - Continuous Mode Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FREQME_CTRL_W_CONTINUOUS_MODE_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_CONTINUOUS_MODE_EN_SHIFT)) & FREQME_CTRL_W_CONTINUOUS_MODE_EN_MASK) - -#define FREQME_CTRL_W_MEASURE_IN_PROGRESS_MASK (0x80000000U) -#define FREQME_CTRL_W_MEASURE_IN_PROGRESS_SHIFT (31U) -/*! MEASURE_IN_PROGRESS - Measurement In Progress - * 0b0..Terminates measurement - * 0b1..Initiates measurement - */ -#define FREQME_CTRL_W_MEASURE_IN_PROGRESS(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_MEASURE_IN_PROGRESS_SHIFT)) & FREQME_CTRL_W_MEASURE_IN_PROGRESS_MASK) -/*! @} */ - -/*! @name CTRLSTAT - Control Status */ -/*! @{ */ - -#define FREQME_CTRLSTAT_REF_SCALE_MASK (0x1FU) -#define FREQME_CTRLSTAT_REF_SCALE_SHIFT (0U) -/*! REF_SCALE - Reference Scale */ -#define FREQME_CTRLSTAT_REF_SCALE(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_REF_SCALE_SHIFT)) & FREQME_CTRLSTAT_REF_SCALE_MASK) - -#define FREQME_CTRLSTAT_PULSE_MODE_MASK (0x100U) -#define FREQME_CTRLSTAT_PULSE_MODE_SHIFT (8U) -/*! PULSE_MODE - Pulse Mode - * 0b0..Frequency Measurement mode - * 0b1..Pulse Width Measurement mode - */ -#define FREQME_CTRLSTAT_PULSE_MODE(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_PULSE_MODE_SHIFT)) & FREQME_CTRLSTAT_PULSE_MODE_MASK) - -#define FREQME_CTRLSTAT_PULSE_POL_MASK (0x200U) -#define FREQME_CTRLSTAT_PULSE_POL_SHIFT (9U) -/*! PULSE_POL - Pulse Polarity - * 0b0..High period - * 0b1..Low period - */ -#define FREQME_CTRLSTAT_PULSE_POL(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_PULSE_POL_SHIFT)) & FREQME_CTRLSTAT_PULSE_POL_MASK) - -#define FREQME_CTRLSTAT_LT_MIN_INT_EN_MASK (0x1000U) -#define FREQME_CTRLSTAT_LT_MIN_INT_EN_SHIFT (12U) -/*! LT_MIN_INT_EN - Less Than Minimum Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define FREQME_CTRLSTAT_LT_MIN_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_LT_MIN_INT_EN_SHIFT)) & FREQME_CTRLSTAT_LT_MIN_INT_EN_MASK) - -#define FREQME_CTRLSTAT_GT_MAX_INT_EN_MASK (0x2000U) -#define FREQME_CTRLSTAT_GT_MAX_INT_EN_SHIFT (13U) -/*! GT_MAX_INT_EN - Greater Than Maximum Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define FREQME_CTRLSTAT_GT_MAX_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_GT_MAX_INT_EN_SHIFT)) & FREQME_CTRLSTAT_GT_MAX_INT_EN_MASK) - -#define FREQME_CTRLSTAT_RESULT_READY_INT_EN_MASK (0x4000U) -#define FREQME_CTRLSTAT_RESULT_READY_INT_EN_SHIFT (14U) -/*! RESULT_READY_INT_EN - Result Ready Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define FREQME_CTRLSTAT_RESULT_READY_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_RESULT_READY_INT_EN_SHIFT)) & FREQME_CTRLSTAT_RESULT_READY_INT_EN_MASK) - -#define FREQME_CTRLSTAT_LT_MIN_STAT_MASK (0x1000000U) -#define FREQME_CTRLSTAT_LT_MIN_STAT_SHIFT (24U) -/*! LT_MIN_STAT - Less Than Minimum Results Status - * 0b0..Greater than MIN[MIN_VALUE] - * 0b1..Less than MIN[MIN_VALUE] - */ -#define FREQME_CTRLSTAT_LT_MIN_STAT(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_LT_MIN_STAT_SHIFT)) & FREQME_CTRLSTAT_LT_MIN_STAT_MASK) - -#define FREQME_CTRLSTAT_GT_MAX_STAT_MASK (0x2000000U) -#define FREQME_CTRLSTAT_GT_MAX_STAT_SHIFT (25U) -/*! GT_MAX_STAT - Greater Than Maximum Result Status - * 0b0..Less than MAX[MAX_VALUE] - * 0b1..Greater than MAX[MAX_VALUE] - */ -#define FREQME_CTRLSTAT_GT_MAX_STAT(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_GT_MAX_STAT_SHIFT)) & FREQME_CTRLSTAT_GT_MAX_STAT_MASK) - -#define FREQME_CTRLSTAT_RESULT_READY_STAT_MASK (0x4000000U) -#define FREQME_CTRLSTAT_RESULT_READY_STAT_SHIFT (26U) -/*! RESULT_READY_STAT - Result Ready Status - * 0b0..Not complete - * 0b1..Complete - */ -#define FREQME_CTRLSTAT_RESULT_READY_STAT(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_RESULT_READY_STAT_SHIFT)) & FREQME_CTRLSTAT_RESULT_READY_STAT_MASK) - -#define FREQME_CTRLSTAT_CONTINUOUS_MODE_EN_MASK (0x40000000U) -#define FREQME_CTRLSTAT_CONTINUOUS_MODE_EN_SHIFT (30U) -/*! CONTINUOUS_MODE_EN - Continuous Mode Enable Status - * 0b0..Disabled - * 0b1..Enabled - */ -#define FREQME_CTRLSTAT_CONTINUOUS_MODE_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_CONTINUOUS_MODE_EN_SHIFT)) & FREQME_CTRLSTAT_CONTINUOUS_MODE_EN_MASK) - -#define FREQME_CTRLSTAT_MEASURE_IN_PROGRESS_MASK (0x80000000U) -#define FREQME_CTRLSTAT_MEASURE_IN_PROGRESS_SHIFT (31U) -/*! MEASURE_IN_PROGRESS - Measurement in Progress Status - * 0b0..Not in progress - * 0b1..In progress - */ -#define FREQME_CTRLSTAT_MEASURE_IN_PROGRESS(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_MEASURE_IN_PROGRESS_SHIFT)) & FREQME_CTRLSTAT_MEASURE_IN_PROGRESS_MASK) -/*! @} */ - -/*! @name MIN - Minimum */ -/*! @{ */ - -#define FREQME_MIN_MIN_VALUE_MASK (0x7FFFFFFFU) -#define FREQME_MIN_MIN_VALUE_SHIFT (0U) -/*! MIN_VALUE - Minimum Value */ -#define FREQME_MIN_MIN_VALUE(x) (((uint32_t)(((uint32_t)(x)) << FREQME_MIN_MIN_VALUE_SHIFT)) & FREQME_MIN_MIN_VALUE_MASK) -/*! @} */ - -/*! @name MAX - Maximum */ -/*! @{ */ - -#define FREQME_MAX_MAX_VALUE_MASK (0x7FFFFFFFU) -#define FREQME_MAX_MAX_VALUE_SHIFT (0U) -/*! MAX_VALUE - Maximum Value */ -#define FREQME_MAX_MAX_VALUE(x) (((uint32_t)(((uint32_t)(x)) << FREQME_MAX_MAX_VALUE_SHIFT)) & FREQME_MAX_MAX_VALUE_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group FREQME_Register_Masks */ - - -/* FREQME - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral FREQME0 base address */ - #define FREQME0_BASE (0x50011000u) - /** Peripheral FREQME0 base address */ - #define FREQME0_BASE_NS (0x40011000u) - /** Peripheral FREQME0 base pointer */ - #define FREQME0 ((FREQME_Type *)FREQME0_BASE) - /** Peripheral FREQME0 base pointer */ - #define FREQME0_NS ((FREQME_Type *)FREQME0_BASE_NS) - /** Array initializer of FREQME peripheral base addresses */ - #define FREQME_BASE_ADDRS { FREQME0_BASE } - /** Array initializer of FREQME peripheral base pointers */ - #define FREQME_BASE_PTRS { FREQME0 } - /** Array initializer of FREQME peripheral base addresses */ - #define FREQME_BASE_ADDRS_NS { FREQME0_BASE_NS } - /** Array initializer of FREQME peripheral base pointers */ - #define FREQME_BASE_PTRS_NS { FREQME0_NS } -#else - /** Peripheral FREQME0 base address */ - #define FREQME0_BASE (0x40011000u) - /** Peripheral FREQME0 base pointer */ - #define FREQME0 ((FREQME_Type *)FREQME0_BASE) - /** Array initializer of FREQME peripheral base addresses */ - #define FREQME_BASE_ADDRS { FREQME0_BASE } - /** Array initializer of FREQME peripheral base pointers */ - #define FREQME_BASE_PTRS { FREQME0 } -#endif -/** Interrupt vectors for the FREQME peripheral type */ -#define FREQME_IRQS { Freqme_IRQn } - -/*! - * @} - */ /* end of group FREQME_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- GDET Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup GDET_Peripheral_Access_Layer GDET Peripheral Access Layer - * @{ - */ - -/** GDET - Register Layout Typedef */ -typedef struct { - __IO uint32_t GDET_CONF_0; /**< GDET Configuration 0 Register, offset: 0x0 */ - __IO uint32_t GDET_CONF_1; /**< GDET Configuration 1 Register, offset: 0x4 */ - __IO uint32_t GDET_ENABLE1; /**< GDET Enable Register, offset: 0x8 */ - __IO uint32_t GDET_CONF_2; /**< GDET Configuration 2 Register, offset: 0xC */ - __IO uint32_t GDET_CONF_3; /**< GDET Configuration 3 Register, offset: 0x10 */ - __IO uint32_t GDET_CONF_4; /**< GDET Configuration 4 Register, offset: 0x14 */ - __IO uint32_t GDET_CONF_5; /**< GDET Configuration 5 Register, offset: 0x18 */ - uint8_t RESERVED_0[4004]; - __IO uint32_t GDET_RESET; /**< GDET Reset Register, offset: 0xFC0 */ - __IO uint32_t GDET_TEST; /**< GDET Test Register, offset: 0xFC4 */ - uint8_t RESERVED_1[4]; - __IO uint32_t GDET_DLY_CTRL; /**< GDET Delay Control Register, offset: 0xFCC */ -} GDET_Type; - -/* ---------------------------------------------------------------------------- - -- GDET Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup GDET_Register_Masks GDET Register Masks - * @{ - */ - -/*! @name GDET_CONF_0 - GDET Configuration 0 Register */ -/*! @{ */ - -#define GDET_GDET_CONF_0_FIELD_3_0_MASK (0xFU) -#define GDET_GDET_CONF_0_FIELD_3_0_SHIFT (0U) -/*! FIELD_3_0 - GDET Configuration 0 Field 3_0 */ -#define GDET_GDET_CONF_0_FIELD_3_0(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_0_FIELD_3_0_SHIFT)) & GDET_GDET_CONF_0_FIELD_3_0_MASK) - -#define GDET_GDET_CONF_0_FIELD_3_0_MASK (0xFU) -#define GDET_GDET_CONF_0_FIELD_3_0_SHIFT (0U) -/*! field_3_0 - GDET configuration 0 Field 3_0 */ -#define GDET_GDET_CONF_0_FIELD_3_0(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_0_FIELD_3_0_SHIFT)) & GDET_GDET_CONF_0_FIELD_3_0_MASK) - -#define GDET_GDET_CONF_0_SBZ_MASK (0x10U) -#define GDET_GDET_CONF_0_SBZ_SHIFT (4U) -/*! SBZ - Should Be Left to Zero */ -#define GDET_GDET_CONF_0_SBZ(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_0_SBZ_SHIFT)) & GDET_GDET_CONF_0_SBZ_MASK) - -#define GDET_GDET_CONF_0_SBZ_MASK (0x10U) -#define GDET_GDET_CONF_0_SBZ_SHIFT (4U) -/*! sbz - Should be left to zero */ -#define GDET_GDET_CONF_0_SBZ(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_0_SBZ_SHIFT)) & GDET_GDET_CONF_0_SBZ_MASK) - -#define GDET_GDET_CONF_0_RFU_MASK (0xFFFFFFE0U) -#define GDET_GDET_CONF_0_RFU_SHIFT (5U) -/*! RFU - Reserved for Future Use */ -#define GDET_GDET_CONF_0_RFU(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_0_RFU_SHIFT)) & GDET_GDET_CONF_0_RFU_MASK) - -#define GDET_GDET_CONF_0_RFU_MASK (0xFFFFFFE0U) -#define GDET_GDET_CONF_0_RFU_SHIFT (5U) -/*! rfu - Reserved for Future Use */ -#define GDET_GDET_CONF_0_RFU(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_0_RFU_SHIFT)) & GDET_GDET_CONF_0_RFU_MASK) -/*! @} */ - -/*! @name GDET_CONF_1 - GDET Configuration 1 Register */ -/*! @{ */ - -#define GDET_GDET_CONF_1_FIELD_1_0_MASK (0x3U) -#define GDET_GDET_CONF_1_FIELD_1_0_SHIFT (0U) -/*! FIELD_1_0 - GDET Configuration 1 Field 1_0 */ -#define GDET_GDET_CONF_1_FIELD_1_0(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_FIELD_1_0_SHIFT)) & GDET_GDET_CONF_1_FIELD_1_0_MASK) - -#define GDET_GDET_CONF_1_FIELD_1_0_MASK (0x3U) -#define GDET_GDET_CONF_1_FIELD_1_0_SHIFT (0U) -/*! field_1_0 - GDET configuration 1 Field 1_0 */ -#define GDET_GDET_CONF_1_FIELD_1_0(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_FIELD_1_0_SHIFT)) & GDET_GDET_CONF_1_FIELD_1_0_MASK) - -#define GDET_GDET_CONF_1_FIELD_3_2_MASK (0xCU) -#define GDET_GDET_CONF_1_FIELD_3_2_SHIFT (2U) -/*! FIELD_3_2 - GDET Configuration 1 Field 3_2 */ -#define GDET_GDET_CONF_1_FIELD_3_2(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_FIELD_3_2_SHIFT)) & GDET_GDET_CONF_1_FIELD_3_2_MASK) - -#define GDET_GDET_CONF_1_FIELD_3_2_MASK (0xCU) -#define GDET_GDET_CONF_1_FIELD_3_2_SHIFT (2U) -/*! field_3_2 - GDET configuration 1 Field 3_2 */ -#define GDET_GDET_CONF_1_FIELD_3_2(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_FIELD_3_2_SHIFT)) & GDET_GDET_CONF_1_FIELD_3_2_MASK) - -#define GDET_GDET_CONF_1_SBZ1_MASK (0x10U) -#define GDET_GDET_CONF_1_SBZ1_SHIFT (4U) -/*! SBZ1 - Should Be Left to Zero */ -#define GDET_GDET_CONF_1_SBZ1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_SBZ1_SHIFT)) & GDET_GDET_CONF_1_SBZ1_MASK) - -#define GDET_GDET_CONF_1_SBZ1_MASK (0x10U) -#define GDET_GDET_CONF_1_SBZ1_SHIFT (4U) -/*! sbz1 - Should be left to zero */ -#define GDET_GDET_CONF_1_SBZ1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_SBZ1_SHIFT)) & GDET_GDET_CONF_1_SBZ1_MASK) - -#define GDET_GDET_CONF_1_SBZ2_MASK (0x20U) -#define GDET_GDET_CONF_1_SBZ2_SHIFT (5U) -/*! SBZ2 - Should Be Left to Zero */ -#define GDET_GDET_CONF_1_SBZ2(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_SBZ2_SHIFT)) & GDET_GDET_CONF_1_SBZ2_MASK) - -#define GDET_GDET_CONF_1_SBZ2_MASK (0x20U) -#define GDET_GDET_CONF_1_SBZ2_SHIFT (5U) -/*! sbz2 - Should be left to zero */ -#define GDET_GDET_CONF_1_SBZ2(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_SBZ2_SHIFT)) & GDET_GDET_CONF_1_SBZ2_MASK) - -#define GDET_GDET_CONF_1_SBZ3_MASK (0x40U) -#define GDET_GDET_CONF_1_SBZ3_SHIFT (6U) -/*! SBZ3 - Should Be Left to Zero */ -#define GDET_GDET_CONF_1_SBZ3(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_SBZ3_SHIFT)) & GDET_GDET_CONF_1_SBZ3_MASK) - -#define GDET_GDET_CONF_1_SBZ3_MASK (0x40U) -#define GDET_GDET_CONF_1_SBZ3_SHIFT (6U) -/*! sbz3 - Should be left to zero */ -#define GDET_GDET_CONF_1_SBZ3(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_SBZ3_SHIFT)) & GDET_GDET_CONF_1_SBZ3_MASK) - -#define GDET_GDET_CONF_1_FIELD_7_MASK (0x80U) -#define GDET_GDET_CONF_1_FIELD_7_SHIFT (7U) -/*! FIELD_7 - GDET Configuration 1 Field 7 */ -#define GDET_GDET_CONF_1_FIELD_7(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_FIELD_7_SHIFT)) & GDET_GDET_CONF_1_FIELD_7_MASK) - -#define GDET_GDET_CONF_1_FIELD_7_MASK (0x80U) -#define GDET_GDET_CONF_1_FIELD_7_SHIFT (7U) -/*! field_7 - GDET configuration 1 Field 7 */ -#define GDET_GDET_CONF_1_FIELD_7(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_FIELD_7_SHIFT)) & GDET_GDET_CONF_1_FIELD_7_MASK) - -#define GDET_GDET_CONF_1_FIELD_8_MASK (0x100U) -#define GDET_GDET_CONF_1_FIELD_8_SHIFT (8U) -/*! FIELD_8 - GDET Configuration 1 Field 8 */ -#define GDET_GDET_CONF_1_FIELD_8(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_FIELD_8_SHIFT)) & GDET_GDET_CONF_1_FIELD_8_MASK) - -#define GDET_GDET_CONF_1_FIELD_8_MASK (0x100U) -#define GDET_GDET_CONF_1_FIELD_8_SHIFT (8U) -/*! field_8 - GDET configuration 1 Field 8 */ -#define GDET_GDET_CONF_1_FIELD_8(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_FIELD_8_SHIFT)) & GDET_GDET_CONF_1_FIELD_8_MASK) - -#define GDET_GDET_CONF_1_SBZ4_MASK (0x200U) -#define GDET_GDET_CONF_1_SBZ4_SHIFT (9U) -/*! SBZ4 - Should Be Left to Zero */ -#define GDET_GDET_CONF_1_SBZ4(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_SBZ4_SHIFT)) & GDET_GDET_CONF_1_SBZ4_MASK) - -#define GDET_GDET_CONF_1_SBZ4_MASK (0x200U) -#define GDET_GDET_CONF_1_SBZ4_SHIFT (9U) -/*! sbz4 - Should be left to zero */ -#define GDET_GDET_CONF_1_SBZ4(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_SBZ4_SHIFT)) & GDET_GDET_CONF_1_SBZ4_MASK) - -#define GDET_GDET_CONF_1_SBZ5_MASK (0x400U) -#define GDET_GDET_CONF_1_SBZ5_SHIFT (10U) -/*! SBZ5 - Should Be Left to Zero */ -#define GDET_GDET_CONF_1_SBZ5(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_SBZ5_SHIFT)) & GDET_GDET_CONF_1_SBZ5_MASK) - -#define GDET_GDET_CONF_1_SBZ5_MASK (0x400U) -#define GDET_GDET_CONF_1_SBZ5_SHIFT (10U) -/*! sbz5 - Should be left to zero */ -#define GDET_GDET_CONF_1_SBZ5(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_SBZ5_SHIFT)) & GDET_GDET_CONF_1_SBZ5_MASK) - -#define GDET_GDET_CONF_1_RFU_MASK (0xFFFFF800U) -#define GDET_GDET_CONF_1_RFU_SHIFT (11U) -/*! RFU - Reserved for Future Use */ -#define GDET_GDET_CONF_1_RFU(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_RFU_SHIFT)) & GDET_GDET_CONF_1_RFU_MASK) - -#define GDET_GDET_CONF_1_RFU_MASK (0xFFFFF800U) -#define GDET_GDET_CONF_1_RFU_SHIFT (11U) -/*! rfu - Reserved for Future Use */ -#define GDET_GDET_CONF_1_RFU(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_RFU_SHIFT)) & GDET_GDET_CONF_1_RFU_MASK) -/*! @} */ - -/*! @name GDET_ENABLE1 - GDET Enable Register */ -/*! @{ */ - -#define GDET_GDET_ENABLE1_EN1_MASK (0x1U) -#define GDET_GDET_ENABLE1_EN1_SHIFT (0U) -/*! EN1 - If set, the detector will be clock gated */ -#define GDET_GDET_ENABLE1_EN1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_ENABLE1_EN1_SHIFT)) & GDET_GDET_ENABLE1_EN1_MASK) - -#define GDET_GDET_ENABLE1_EN1_MASK (0x1U) -#define GDET_GDET_ENABLE1_EN1_SHIFT (0U) -/*! en1 - If set, the detector will be clock gated */ -#define GDET_GDET_ENABLE1_EN1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_ENABLE1_EN1_SHIFT)) & GDET_GDET_ENABLE1_EN1_MASK) - -#define GDET_GDET_ENABLE1_RFU_MASK (0xFFFFFFFEU) -#define GDET_GDET_ENABLE1_RFU_SHIFT (1U) -/*! RFU - Reserved for Future Use */ -#define GDET_GDET_ENABLE1_RFU(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_ENABLE1_RFU_SHIFT)) & GDET_GDET_ENABLE1_RFU_MASK) - -#define GDET_GDET_ENABLE1_RFU_MASK (0xFFFFFFFEU) -#define GDET_GDET_ENABLE1_RFU_SHIFT (1U) -/*! rfu - Reserved for Future Use */ -#define GDET_GDET_ENABLE1_RFU(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_ENABLE1_RFU_SHIFT)) & GDET_GDET_ENABLE1_RFU_MASK) -/*! @} */ - -/*! @name GDET_CONF_2 - GDET Configuration 2 Register */ -/*! @{ */ - -#define GDET_GDET_CONF_2_FIELD_6_0_MASK (0x7FU) -#define GDET_GDET_CONF_2_FIELD_6_0_SHIFT (0U) -/*! FIELD_6_0 - GDET Configuration 2 Field 6_0 */ -#define GDET_GDET_CONF_2_FIELD_6_0(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_2_FIELD_6_0_SHIFT)) & GDET_GDET_CONF_2_FIELD_6_0_MASK) - -#define GDET_GDET_CONF_2_FIELD_6_0_MASK (0x7FU) -#define GDET_GDET_CONF_2_FIELD_6_0_SHIFT (0U) -/*! field_6_0 - GDET configuration 2 Field 6_0 */ -#define GDET_GDET_CONF_2_FIELD_6_0(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_2_FIELD_6_0_SHIFT)) & GDET_GDET_CONF_2_FIELD_6_0_MASK) - -#define GDET_GDET_CONF_2_RFU1_MASK (0xFF80U) -#define GDET_GDET_CONF_2_RFU1_SHIFT (7U) -/*! RFU1 - Reserved for Future Use */ -#define GDET_GDET_CONF_2_RFU1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_2_RFU1_SHIFT)) & GDET_GDET_CONF_2_RFU1_MASK) - -#define GDET_GDET_CONF_2_RFU1_MASK (0xFF80U) -#define GDET_GDET_CONF_2_RFU1_SHIFT (7U) -/*! rfu1 - Reserved for Future Use */ -#define GDET_GDET_CONF_2_RFU1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_2_RFU1_SHIFT)) & GDET_GDET_CONF_2_RFU1_MASK) - -#define GDET_GDET_CONF_2_FIELD_21_16_MASK (0x3F0000U) -#define GDET_GDET_CONF_2_FIELD_21_16_SHIFT (16U) -/*! FIELD_21_16 - GDET Configuration 2 Field 21_16 */ -#define GDET_GDET_CONF_2_FIELD_21_16(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_2_FIELD_21_16_SHIFT)) & GDET_GDET_CONF_2_FIELD_21_16_MASK) - -#define GDET_GDET_CONF_2_FIELD_21_16_MASK (0x3F0000U) -#define GDET_GDET_CONF_2_FIELD_21_16_SHIFT (16U) -/*! field_21_16 - GDET configuration 2 Field 21_16 */ -#define GDET_GDET_CONF_2_FIELD_21_16(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_2_FIELD_21_16_SHIFT)) & GDET_GDET_CONF_2_FIELD_21_16_MASK) - -#define GDET_GDET_CONF_2_RFU2_MASK (0xC00000U) -#define GDET_GDET_CONF_2_RFU2_SHIFT (22U) -/*! RFU2 - Reserved for Future Use */ -#define GDET_GDET_CONF_2_RFU2(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_2_RFU2_SHIFT)) & GDET_GDET_CONF_2_RFU2_MASK) - -#define GDET_GDET_CONF_2_RFU2_MASK (0xC00000U) -#define GDET_GDET_CONF_2_RFU2_SHIFT (22U) -/*! rfu2 - Reserved for Future Use */ -#define GDET_GDET_CONF_2_RFU2(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_2_RFU2_SHIFT)) & GDET_GDET_CONF_2_RFU2_MASK) - -#define GDET_GDET_CONF_2_FIELD_29_24_MASK (0x3F000000U) -#define GDET_GDET_CONF_2_FIELD_29_24_SHIFT (24U) -/*! FIELD_29_24 - GDET Configuration 2 Field 29_24 */ -#define GDET_GDET_CONF_2_FIELD_29_24(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_2_FIELD_29_24_SHIFT)) & GDET_GDET_CONF_2_FIELD_29_24_MASK) - -#define GDET_GDET_CONF_2_FIELD_29_24_MASK (0x3F000000U) -#define GDET_GDET_CONF_2_FIELD_29_24_SHIFT (24U) -/*! field_29_24 - GDET configuration 2 Field 29_24 */ -#define GDET_GDET_CONF_2_FIELD_29_24(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_2_FIELD_29_24_SHIFT)) & GDET_GDET_CONF_2_FIELD_29_24_MASK) - -#define GDET_GDET_CONF_2_RFU3_MASK (0xC0000000U) -#define GDET_GDET_CONF_2_RFU3_SHIFT (30U) -/*! RFU3 - Reserved for Future Use */ -#define GDET_GDET_CONF_2_RFU3(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_2_RFU3_SHIFT)) & GDET_GDET_CONF_2_RFU3_MASK) - -#define GDET_GDET_CONF_2_RFU3_MASK (0xC0000000U) -#define GDET_GDET_CONF_2_RFU3_SHIFT (30U) -/*! rfu3 - Reserved for Future Use */ -#define GDET_GDET_CONF_2_RFU3(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_2_RFU3_SHIFT)) & GDET_GDET_CONF_2_RFU3_MASK) -/*! @} */ - -/*! @name GDET_CONF_3 - GDET Configuration 3 Register */ -/*! @{ */ - -#define GDET_GDET_CONF_3_FIELD_6_0_MASK (0x7FU) -#define GDET_GDET_CONF_3_FIELD_6_0_SHIFT (0U) -/*! FIELD_6_0 - GDET Configuration 3 Field 6_0 */ -#define GDET_GDET_CONF_3_FIELD_6_0(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_3_FIELD_6_0_SHIFT)) & GDET_GDET_CONF_3_FIELD_6_0_MASK) - -#define GDET_GDET_CONF_3_FIELD_6_0_MASK (0x7FU) -#define GDET_GDET_CONF_3_FIELD_6_0_SHIFT (0U) -/*! field_6_0 - GDET configuration 3 Field 6_0 */ -#define GDET_GDET_CONF_3_FIELD_6_0(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_3_FIELD_6_0_SHIFT)) & GDET_GDET_CONF_3_FIELD_6_0_MASK) - -#define GDET_GDET_CONF_3_RFU1_MASK (0xFFFFFF80U) -#define GDET_GDET_CONF_3_RFU1_SHIFT (7U) -/*! RFU1 - Reserved for Future Use */ -#define GDET_GDET_CONF_3_RFU1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_3_RFU1_SHIFT)) & GDET_GDET_CONF_3_RFU1_MASK) - -#define GDET_GDET_CONF_3_RFU1_MASK (0xFFFFFF80U) -#define GDET_GDET_CONF_3_RFU1_SHIFT (7U) -/*! rfu1 - Reserved for Future Use */ -#define GDET_GDET_CONF_3_RFU1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_3_RFU1_SHIFT)) & GDET_GDET_CONF_3_RFU1_MASK) -/*! @} */ - -/*! @name GDET_CONF_4 - GDET Configuration 4 Register */ -/*! @{ */ - -#define GDET_GDET_CONF_4_FIELD_6_0_MASK (0x7FU) -#define GDET_GDET_CONF_4_FIELD_6_0_SHIFT (0U) -/*! FIELD_6_0 - GDET Configuration 4 Field 6_0 */ -#define GDET_GDET_CONF_4_FIELD_6_0(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_4_FIELD_6_0_SHIFT)) & GDET_GDET_CONF_4_FIELD_6_0_MASK) - -#define GDET_GDET_CONF_4_FIELD_6_0_MASK (0x7FU) -#define GDET_GDET_CONF_4_FIELD_6_0_SHIFT (0U) -/*! field_6_0 - GDET configuration 4 Field 6_0 */ -#define GDET_GDET_CONF_4_FIELD_6_0(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_4_FIELD_6_0_SHIFT)) & GDET_GDET_CONF_4_FIELD_6_0_MASK) - -#define GDET_GDET_CONF_4_RFU1_MASK (0xFFFFFF80U) -#define GDET_GDET_CONF_4_RFU1_SHIFT (7U) -/*! RFU1 - Reserved for Future Use */ -#define GDET_GDET_CONF_4_RFU1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_4_RFU1_SHIFT)) & GDET_GDET_CONF_4_RFU1_MASK) - -#define GDET_GDET_CONF_4_RFU1_MASK (0xFFFFFF80U) -#define GDET_GDET_CONF_4_RFU1_SHIFT (7U) -/*! rfu1 - Reserved for Future Use */ -#define GDET_GDET_CONF_4_RFU1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_4_RFU1_SHIFT)) & GDET_GDET_CONF_4_RFU1_MASK) -/*! @} */ - -/*! @name GDET_CONF_5 - GDET Configuration 5 Register */ -/*! @{ */ - -#define GDET_GDET_CONF_5_FIELD_5_0_MASK (0x3FU) -#define GDET_GDET_CONF_5_FIELD_5_0_SHIFT (0U) -/*! FIELD_5_0 - GDET Configuration 5 Field 5_0 */ -#define GDET_GDET_CONF_5_FIELD_5_0(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_5_FIELD_5_0_SHIFT)) & GDET_GDET_CONF_5_FIELD_5_0_MASK) - -#define GDET_GDET_CONF_5_FIELD_5_0_MASK (0x3FU) -#define GDET_GDET_CONF_5_FIELD_5_0_SHIFT (0U) -/*! field_5_0 - GDET configuration 5 Field 5_0 */ -#define GDET_GDET_CONF_5_FIELD_5_0(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_5_FIELD_5_0_SHIFT)) & GDET_GDET_CONF_5_FIELD_5_0_MASK) - -#define GDET_GDET_CONF_5_FIELD_11_6_MASK (0xFC0U) -#define GDET_GDET_CONF_5_FIELD_11_6_SHIFT (6U) -/*! FIELD_11_6 - GDET Configuration 5 Field 11_6 */ -#define GDET_GDET_CONF_5_FIELD_11_6(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_5_FIELD_11_6_SHIFT)) & GDET_GDET_CONF_5_FIELD_11_6_MASK) - -#define GDET_GDET_CONF_5_FIELD_11_6_MASK (0xFC0U) -#define GDET_GDET_CONF_5_FIELD_11_6_SHIFT (6U) -/*! field_11_6 - GDET configuration 5 Field 11_6 */ -#define GDET_GDET_CONF_5_FIELD_11_6(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_5_FIELD_11_6_SHIFT)) & GDET_GDET_CONF_5_FIELD_11_6_MASK) - -#define GDET_GDET_CONF_5_RFU1_MASK (0xFFFFF000U) -#define GDET_GDET_CONF_5_RFU1_SHIFT (12U) -/*! RFU1 - Reserved for Future Use */ -#define GDET_GDET_CONF_5_RFU1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_5_RFU1_SHIFT)) & GDET_GDET_CONF_5_RFU1_MASK) - -#define GDET_GDET_CONF_5_RFU1_MASK (0xFFFFF000U) -#define GDET_GDET_CONF_5_RFU1_SHIFT (12U) -/*! rfu1 - Reserved for Future Use */ -#define GDET_GDET_CONF_5_RFU1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_5_RFU1_SHIFT)) & GDET_GDET_CONF_5_RFU1_MASK) -/*! @} */ - -/*! @name GDET_RESET - GDET Reset Register */ -/*! @{ */ - -#define GDET_GDET_RESET_RFU1_MASK (0x7U) -#define GDET_GDET_RESET_RFU1_SHIFT (0U) -/*! RFU1 - Reserved for Future Use */ -#define GDET_GDET_RESET_RFU1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_RESET_RFU1_SHIFT)) & GDET_GDET_RESET_RFU1_MASK) - -#define GDET_GDET_RESET_RFU1_MASK (0x7U) -#define GDET_GDET_RESET_RFU1_SHIFT (0U) -/*! rfu1 - Reserved for Future Use */ -#define GDET_GDET_RESET_RFU1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_RESET_RFU1_SHIFT)) & GDET_GDET_RESET_RFU1_MASK) - -#define GDET_GDET_RESET_SFT_RST_MASK (0x8U) -#define GDET_GDET_RESET_SFT_RST_SHIFT (3U) -/*! SFT_RST - Soft Reset for the Core Reset */ -#define GDET_GDET_RESET_SFT_RST(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_RESET_SFT_RST_SHIFT)) & GDET_GDET_RESET_SFT_RST_MASK) - -#define GDET_GDET_RESET_SFT_RST_MASK (0x8U) -#define GDET_GDET_RESET_SFT_RST_SHIFT (3U) -/*! sft_rst - Soft reset for the core reset (SFR configuration will be preseved).This register reads as 0 */ -#define GDET_GDET_RESET_SFT_RST(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_RESET_SFT_RST_SHIFT)) & GDET_GDET_RESET_SFT_RST_MASK) - -#define GDET_GDET_RESET_RFU2_MASK (0xFFFFFFF0U) -#define GDET_GDET_RESET_RFU2_SHIFT (4U) -/*! RFU2 - Reserved for Future Use */ -#define GDET_GDET_RESET_RFU2(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_RESET_RFU2_SHIFT)) & GDET_GDET_RESET_RFU2_MASK) - -#define GDET_GDET_RESET_RFU2_MASK (0xFFFFFFF0U) -#define GDET_GDET_RESET_RFU2_SHIFT (4U) -/*! rfu2 - Reserved for Future Use */ -#define GDET_GDET_RESET_RFU2(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_RESET_RFU2_SHIFT)) & GDET_GDET_RESET_RFU2_MASK) -/*! @} */ - -/*! @name GDET_TEST - GDET Test Register */ -/*! @{ */ - -#define GDET_GDET_TEST_SBZ_MASK (0x1U) -#define GDET_GDET_TEST_SBZ_SHIFT (0U) -/*! SBZ - Should Be Left to Zero */ -#define GDET_GDET_TEST_SBZ(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_TEST_SBZ_SHIFT)) & GDET_GDET_TEST_SBZ_MASK) - -#define GDET_GDET_TEST_SBZ_MASK (0x1U) -#define GDET_GDET_TEST_SBZ_SHIFT (0U) -/*! sbz - Should be left to zero */ -#define GDET_GDET_TEST_SBZ(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_TEST_SBZ_SHIFT)) & GDET_GDET_TEST_SBZ_MASK) - -#define GDET_GDET_TEST_RFU_MASK (0xFFFFFFFEU) -#define GDET_GDET_TEST_RFU_SHIFT (1U) -/*! RFU - Reserved for Future Use */ -#define GDET_GDET_TEST_RFU(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_TEST_RFU_SHIFT)) & GDET_GDET_TEST_RFU_MASK) - -#define GDET_GDET_TEST_RFU_MASK (0xFFFFFFFEU) -#define GDET_GDET_TEST_RFU_SHIFT (1U) -/*! rfu - Reserved for Future Use */ -#define GDET_GDET_TEST_RFU(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_TEST_RFU_SHIFT)) & GDET_GDET_TEST_RFU_MASK) -/*! @} */ - -/*! @name GDET_DLY_CTRL - GDET Delay Control Register */ -/*! @{ */ - -#define GDET_GDET_DLY_CTRL_VOL_SEL_MASK (0x3U) -#define GDET_GDET_DLY_CTRL_VOL_SEL_SHIFT (0U) -/*! VOL_SEL - GDET Delay Control of the Voltage Mode */ -#define GDET_GDET_DLY_CTRL_VOL_SEL(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_DLY_CTRL_VOL_SEL_SHIFT)) & GDET_GDET_DLY_CTRL_VOL_SEL_MASK) - -#define GDET_GDET_DLY_CTRL_VOL_SEL_MASK (0x3U) -#define GDET_GDET_DLY_CTRL_VOL_SEL_SHIFT (0U) -/*! vol_sel - GDET delay control of the voltage mode. Used to select the trim code appropiate to the voltage mode. */ -#define GDET_GDET_DLY_CTRL_VOL_SEL(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_DLY_CTRL_VOL_SEL_SHIFT)) & GDET_GDET_DLY_CTRL_VOL_SEL_MASK) - -#define GDET_GDET_DLY_CTRL_SW_VOL_CTRL_MASK (0x4U) -#define GDET_GDET_DLY_CTRL_SW_VOL_CTRL_SHIFT (2U) -/*! SW_VOL_CTRL - Select the Control of the Trim Code to the Delay Line */ -#define GDET_GDET_DLY_CTRL_SW_VOL_CTRL(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_DLY_CTRL_SW_VOL_CTRL_SHIFT)) & GDET_GDET_DLY_CTRL_SW_VOL_CTRL_MASK) - -#define GDET_GDET_DLY_CTRL_SW_VOL_CTRL_MASK (0x4U) -#define GDET_GDET_DLY_CTRL_SW_VOL_CTRL_SHIFT (2U) -/*! sw_vol_ctrl - Select the control of the trim code to the delay line via HW port (0) or SW SFR (1) */ -#define GDET_GDET_DLY_CTRL_SW_VOL_CTRL(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_DLY_CTRL_SW_VOL_CTRL_SHIFT)) & GDET_GDET_DLY_CTRL_SW_VOL_CTRL_MASK) - -#define GDET_GDET_DLY_CTRL_RFU_MASK (0xFFFFFFF8U) -#define GDET_GDET_DLY_CTRL_RFU_SHIFT (3U) -/*! RFU - Reserved for Future Use */ -#define GDET_GDET_DLY_CTRL_RFU(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_DLY_CTRL_RFU_SHIFT)) & GDET_GDET_DLY_CTRL_RFU_MASK) - -#define GDET_GDET_DLY_CTRL_RFU_MASK (0xFFFFFFF8U) -#define GDET_GDET_DLY_CTRL_RFU_SHIFT (3U) -/*! rfu - Reserved for Future Use */ -#define GDET_GDET_DLY_CTRL_RFU(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_DLY_CTRL_RFU_SHIFT)) & GDET_GDET_DLY_CTRL_RFU_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group GDET_Register_Masks */ - - -/* GDET - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral GDET0 base address */ - #define GDET0_BASE (0x50024000u) - /** Peripheral GDET0 base address */ - #define GDET0_BASE_NS (0x40024000u) - /** Peripheral GDET0 base pointer */ - #define GDET0 ((GDET_Type *)GDET0_BASE) - /** Peripheral GDET0 base pointer */ - #define GDET0_NS ((GDET_Type *)GDET0_BASE_NS) - /** Peripheral GDET1 base address */ - #define GDET1_BASE (0x50025000u) - /** Peripheral GDET1 base address */ - #define GDET1_BASE_NS (0x40025000u) - /** Peripheral GDET1 base pointer */ - #define GDET1 ((GDET_Type *)GDET1_BASE) - /** Peripheral GDET1 base pointer */ - #define GDET1_NS ((GDET_Type *)GDET1_BASE_NS) - /** Array initializer of GDET peripheral base addresses */ - #define GDET_BASE_ADDRS { GDET0_BASE, GDET1_BASE } - /** Array initializer of GDET peripheral base pointers */ - #define GDET_BASE_PTRS { GDET0, GDET1 } - /** Array initializer of GDET peripheral base addresses */ - #define GDET_BASE_ADDRS_NS { GDET0_BASE_NS, GDET1_BASE_NS } - /** Array initializer of GDET peripheral base pointers */ - #define GDET_BASE_PTRS_NS { GDET0_NS, GDET1_NS } -#else - /** Peripheral GDET0 base address */ - #define GDET0_BASE (0x40024000u) - /** Peripheral GDET0 base pointer */ - #define GDET0 ((GDET_Type *)GDET0_BASE) - /** Peripheral GDET1 base address */ - #define GDET1_BASE (0x40025000u) - /** Peripheral GDET1 base pointer */ - #define GDET1 ((GDET_Type *)GDET1_BASE) - /** Array initializer of GDET peripheral base addresses */ - #define GDET_BASE_ADDRS { GDET0_BASE, GDET1_BASE } - /** Array initializer of GDET peripheral base pointers */ - #define GDET_BASE_PTRS { GDET0, GDET1 } -#endif - -/*! - * @} - */ /* end of group GDET_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- GPIO Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup GPIO_Peripheral_Access_Layer GPIO Peripheral Access Layer - * @{ - */ - -/** GPIO - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - uint8_t RESERVED_0[4]; - __IO uint32_t LOCK; /**< Lock, offset: 0xC */ - __IO uint32_t PCNS; /**< Pin Control Nonsecure, offset: 0x10 */ - __IO uint32_t ICNS; /**< Interrupt Control Nonsecure, offset: 0x14 */ - __IO uint32_t PCNP; /**< Pin Control Nonprivilege, offset: 0x18 */ - __IO uint32_t ICNP; /**< Interrupt Control Nonprivilege, offset: 0x1C */ - uint8_t RESERVED_1[32]; - __IO uint32_t PDOR; /**< Port Data Output, offset: 0x40 */ - __O uint32_t PSOR; /**< Port Set Output, offset: 0x44 */ - __O uint32_t PCOR; /**< Port Clear Output, offset: 0x48 */ - __O uint32_t PTOR; /**< Port Toggle Output, offset: 0x4C */ - __I uint32_t PDIR; /**< Port Data Input, offset: 0x50 */ - __IO uint32_t PDDR; /**< Port Data Direction, offset: 0x54 */ - __IO uint32_t PIDR; /**< Port Input Disable, offset: 0x58 */ - uint8_t RESERVED_2[4]; - __IO uint8_t PDR[32]; /**< Pin Data, array offset: 0x60, array step: 0x1 */ - __IO uint32_t ICR[32]; /**< Interrupt Control 0..Interrupt Control 31, array offset: 0x80, array step: 0x4 */ - __O uint32_t GICLR; /**< Global Interrupt Control Low, offset: 0x100 */ - __O uint32_t GICHR; /**< Global Interrupt Control High, offset: 0x104 */ - uint8_t RESERVED_3[24]; - __IO uint32_t ISFR[2]; /**< Interrupt Status Flag, array offset: 0x120, array step: 0x4 */ -} GPIO_Type; - -/* ---------------------------------------------------------------------------- - -- GPIO Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup GPIO_Register_Masks GPIO Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define GPIO_VERID_FEATURE_MASK (0xFFFFU) -#define GPIO_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Basic implementation - * 0b0000000000000001..Protection registers implemented - */ -#define GPIO_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << GPIO_VERID_FEATURE_SHIFT)) & GPIO_VERID_FEATURE_MASK) - -#define GPIO_VERID_MINOR_MASK (0xFF0000U) -#define GPIO_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define GPIO_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << GPIO_VERID_MINOR_SHIFT)) & GPIO_VERID_MINOR_MASK) - -#define GPIO_VERID_MAJOR_MASK (0xFF000000U) -#define GPIO_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define GPIO_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << GPIO_VERID_MAJOR_SHIFT)) & GPIO_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define GPIO_PARAM_IRQNUM_MASK (0xFU) -#define GPIO_PARAM_IRQNUM_SHIFT (0U) -/*! IRQNUM - Interrupt Number */ -#define GPIO_PARAM_IRQNUM(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PARAM_IRQNUM_SHIFT)) & GPIO_PARAM_IRQNUM_MASK) -/*! @} */ - -/*! @name LOCK - Lock */ -/*! @{ */ - -#define GPIO_LOCK_PCNS_MASK (0x1U) -#define GPIO_LOCK_PCNS_SHIFT (0U) -/*! PCNS - Lock PCNS - * 0b0..Writable in Secure-Privilege state - * 0b1..Not writable until the next reset - */ -#define GPIO_LOCK_PCNS(x) (((uint32_t)(((uint32_t)(x)) << GPIO_LOCK_PCNS_SHIFT)) & GPIO_LOCK_PCNS_MASK) - -#define GPIO_LOCK_ICNS_MASK (0x2U) -#define GPIO_LOCK_ICNS_SHIFT (1U) -/*! ICNS - Lock ICNS - * 0b0..Writable in Secure-Privilege state - * 0b1..Not writable until the next reset - */ -#define GPIO_LOCK_ICNS(x) (((uint32_t)(((uint32_t)(x)) << GPIO_LOCK_ICNS_SHIFT)) & GPIO_LOCK_ICNS_MASK) - -#define GPIO_LOCK_PCNP_MASK (0x4U) -#define GPIO_LOCK_PCNP_SHIFT (2U) -/*! PCNP - Lock PCNP - * 0b0..Writable in Secure-Privilege state - * 0b1..Not writable until the next reset - */ -#define GPIO_LOCK_PCNP(x) (((uint32_t)(((uint32_t)(x)) << GPIO_LOCK_PCNP_SHIFT)) & GPIO_LOCK_PCNP_MASK) - -#define GPIO_LOCK_ICNP_MASK (0x8U) -#define GPIO_LOCK_ICNP_SHIFT (3U) -/*! ICNP - Lock ICNP - * 0b0..Writable in Secure-Privilege state - * 0b1..Not writable until the next reset - */ -#define GPIO_LOCK_ICNP(x) (((uint32_t)(((uint32_t)(x)) << GPIO_LOCK_ICNP_SHIFT)) & GPIO_LOCK_ICNP_MASK) -/*! @} */ - -/*! @name PCNS - Pin Control Nonsecure */ -/*! @{ */ - -#define GPIO_PCNS_NSE0_MASK (0x1U) -#define GPIO_PCNS_NSE0_SHIFT (0U) -/*! NSE0 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE0_SHIFT)) & GPIO_PCNS_NSE0_MASK) - -#define GPIO_PCNS_NSE1_MASK (0x2U) -#define GPIO_PCNS_NSE1_SHIFT (1U) -/*! NSE1 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE1_SHIFT)) & GPIO_PCNS_NSE1_MASK) - -#define GPIO_PCNS_NSE2_MASK (0x4U) -#define GPIO_PCNS_NSE2_SHIFT (2U) -/*! NSE2 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE2_SHIFT)) & GPIO_PCNS_NSE2_MASK) - -#define GPIO_PCNS_NSE3_MASK (0x8U) -#define GPIO_PCNS_NSE3_SHIFT (3U) -/*! NSE3 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE3_SHIFT)) & GPIO_PCNS_NSE3_MASK) - -#define GPIO_PCNS_NSE4_MASK (0x10U) -#define GPIO_PCNS_NSE4_SHIFT (4U) -/*! NSE4 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE4_SHIFT)) & GPIO_PCNS_NSE4_MASK) - -#define GPIO_PCNS_NSE5_MASK (0x20U) -#define GPIO_PCNS_NSE5_SHIFT (5U) -/*! NSE5 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE5_SHIFT)) & GPIO_PCNS_NSE5_MASK) - -#define GPIO_PCNS_NSE6_MASK (0x40U) -#define GPIO_PCNS_NSE6_SHIFT (6U) -/*! NSE6 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE6_SHIFT)) & GPIO_PCNS_NSE6_MASK) - -#define GPIO_PCNS_NSE7_MASK (0x80U) -#define GPIO_PCNS_NSE7_SHIFT (7U) -/*! NSE7 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE7_SHIFT)) & GPIO_PCNS_NSE7_MASK) - -#define GPIO_PCNS_NSE8_MASK (0x100U) -#define GPIO_PCNS_NSE8_SHIFT (8U) -/*! NSE8 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE8_SHIFT)) & GPIO_PCNS_NSE8_MASK) - -#define GPIO_PCNS_NSE9_MASK (0x200U) -#define GPIO_PCNS_NSE9_SHIFT (9U) -/*! NSE9 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE9_SHIFT)) & GPIO_PCNS_NSE9_MASK) - -#define GPIO_PCNS_NSE10_MASK (0x400U) -#define GPIO_PCNS_NSE10_SHIFT (10U) -/*! NSE10 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE10_SHIFT)) & GPIO_PCNS_NSE10_MASK) - -#define GPIO_PCNS_NSE11_MASK (0x800U) -#define GPIO_PCNS_NSE11_SHIFT (11U) -/*! NSE11 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE11_SHIFT)) & GPIO_PCNS_NSE11_MASK) - -#define GPIO_PCNS_NSE12_MASK (0x1000U) -#define GPIO_PCNS_NSE12_SHIFT (12U) -/*! NSE12 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE12_SHIFT)) & GPIO_PCNS_NSE12_MASK) - -#define GPIO_PCNS_NSE13_MASK (0x2000U) -#define GPIO_PCNS_NSE13_SHIFT (13U) -/*! NSE13 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE13_SHIFT)) & GPIO_PCNS_NSE13_MASK) - -#define GPIO_PCNS_NSE14_MASK (0x4000U) -#define GPIO_PCNS_NSE14_SHIFT (14U) -/*! NSE14 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE14_SHIFT)) & GPIO_PCNS_NSE14_MASK) - -#define GPIO_PCNS_NSE15_MASK (0x8000U) -#define GPIO_PCNS_NSE15_SHIFT (15U) -/*! NSE15 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE15_SHIFT)) & GPIO_PCNS_NSE15_MASK) - -#define GPIO_PCNS_NSE16_MASK (0x10000U) -#define GPIO_PCNS_NSE16_SHIFT (16U) -/*! NSE16 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE16_SHIFT)) & GPIO_PCNS_NSE16_MASK) - -#define GPIO_PCNS_NSE17_MASK (0x20000U) -#define GPIO_PCNS_NSE17_SHIFT (17U) -/*! NSE17 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE17_SHIFT)) & GPIO_PCNS_NSE17_MASK) - -#define GPIO_PCNS_NSE18_MASK (0x40000U) -#define GPIO_PCNS_NSE18_SHIFT (18U) -/*! NSE18 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE18_SHIFT)) & GPIO_PCNS_NSE18_MASK) - -#define GPIO_PCNS_NSE19_MASK (0x80000U) -#define GPIO_PCNS_NSE19_SHIFT (19U) -/*! NSE19 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE19_SHIFT)) & GPIO_PCNS_NSE19_MASK) - -#define GPIO_PCNS_NSE20_MASK (0x100000U) -#define GPIO_PCNS_NSE20_SHIFT (20U) -/*! NSE20 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE20_SHIFT)) & GPIO_PCNS_NSE20_MASK) - -#define GPIO_PCNS_NSE21_MASK (0x200000U) -#define GPIO_PCNS_NSE21_SHIFT (21U) -/*! NSE21 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE21_SHIFT)) & GPIO_PCNS_NSE21_MASK) - -#define GPIO_PCNS_NSE22_MASK (0x400000U) -#define GPIO_PCNS_NSE22_SHIFT (22U) -/*! NSE22 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE22_SHIFT)) & GPIO_PCNS_NSE22_MASK) - -#define GPIO_PCNS_NSE23_MASK (0x800000U) -#define GPIO_PCNS_NSE23_SHIFT (23U) -/*! NSE23 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE23_SHIFT)) & GPIO_PCNS_NSE23_MASK) - -#define GPIO_PCNS_NSE24_MASK (0x1000000U) -#define GPIO_PCNS_NSE24_SHIFT (24U) -/*! NSE24 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE24_SHIFT)) & GPIO_PCNS_NSE24_MASK) - -#define GPIO_PCNS_NSE25_MASK (0x2000000U) -#define GPIO_PCNS_NSE25_SHIFT (25U) -/*! NSE25 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE25_SHIFT)) & GPIO_PCNS_NSE25_MASK) - -#define GPIO_PCNS_NSE26_MASK (0x4000000U) -#define GPIO_PCNS_NSE26_SHIFT (26U) -/*! NSE26 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE26_SHIFT)) & GPIO_PCNS_NSE26_MASK) - -#define GPIO_PCNS_NSE27_MASK (0x8000000U) -#define GPIO_PCNS_NSE27_SHIFT (27U) -/*! NSE27 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE27_SHIFT)) & GPIO_PCNS_NSE27_MASK) - -#define GPIO_PCNS_NSE28_MASK (0x10000000U) -#define GPIO_PCNS_NSE28_SHIFT (28U) -/*! NSE28 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE28_SHIFT)) & GPIO_PCNS_NSE28_MASK) - -#define GPIO_PCNS_NSE29_MASK (0x20000000U) -#define GPIO_PCNS_NSE29_SHIFT (29U) -/*! NSE29 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE29_SHIFT)) & GPIO_PCNS_NSE29_MASK) - -#define GPIO_PCNS_NSE30_MASK (0x40000000U) -#define GPIO_PCNS_NSE30_SHIFT (30U) -/*! NSE30 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE30_SHIFT)) & GPIO_PCNS_NSE30_MASK) - -#define GPIO_PCNS_NSE31_MASK (0x80000000U) -#define GPIO_PCNS_NSE31_SHIFT (31U) -/*! NSE31 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE31_SHIFT)) & GPIO_PCNS_NSE31_MASK) -/*! @} */ - -/*! @name ICNS - Interrupt Control Nonsecure */ -/*! @{ */ - -#define GPIO_ICNS_NSE0_MASK (0x1U) -#define GPIO_ICNS_NSE0_SHIFT (0U) -/*! NSE0 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_ICNS_NSE0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ICNS_NSE0_SHIFT)) & GPIO_ICNS_NSE0_MASK) - -#define GPIO_ICNS_NSE1_MASK (0x2U) -#define GPIO_ICNS_NSE1_SHIFT (1U) -/*! NSE1 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_ICNS_NSE1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ICNS_NSE1_SHIFT)) & GPIO_ICNS_NSE1_MASK) -/*! @} */ - -/*! @name PCNP - Pin Control Nonprivilege */ -/*! @{ */ - -#define GPIO_PCNP_NPE0_MASK (0x1U) -#define GPIO_PCNP_NPE0_SHIFT (0U) -/*! NPE0 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE0_SHIFT)) & GPIO_PCNP_NPE0_MASK) - -#define GPIO_PCNP_NPE1_MASK (0x2U) -#define GPIO_PCNP_NPE1_SHIFT (1U) -/*! NPE1 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE1_SHIFT)) & GPIO_PCNP_NPE1_MASK) - -#define GPIO_PCNP_NPE2_MASK (0x4U) -#define GPIO_PCNP_NPE2_SHIFT (2U) -/*! NPE2 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE2_SHIFT)) & GPIO_PCNP_NPE2_MASK) - -#define GPIO_PCNP_NPE3_MASK (0x8U) -#define GPIO_PCNP_NPE3_SHIFT (3U) -/*! NPE3 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE3_SHIFT)) & GPIO_PCNP_NPE3_MASK) - -#define GPIO_PCNP_NPE4_MASK (0x10U) -#define GPIO_PCNP_NPE4_SHIFT (4U) -/*! NPE4 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE4_SHIFT)) & GPIO_PCNP_NPE4_MASK) - -#define GPIO_PCNP_NPE5_MASK (0x20U) -#define GPIO_PCNP_NPE5_SHIFT (5U) -/*! NPE5 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE5_SHIFT)) & GPIO_PCNP_NPE5_MASK) - -#define GPIO_PCNP_NPE6_MASK (0x40U) -#define GPIO_PCNP_NPE6_SHIFT (6U) -/*! NPE6 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE6_SHIFT)) & GPIO_PCNP_NPE6_MASK) - -#define GPIO_PCNP_NPE7_MASK (0x80U) -#define GPIO_PCNP_NPE7_SHIFT (7U) -/*! NPE7 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE7_SHIFT)) & GPIO_PCNP_NPE7_MASK) - -#define GPIO_PCNP_NPE8_MASK (0x100U) -#define GPIO_PCNP_NPE8_SHIFT (8U) -/*! NPE8 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE8_SHIFT)) & GPIO_PCNP_NPE8_MASK) - -#define GPIO_PCNP_NPE9_MASK (0x200U) -#define GPIO_PCNP_NPE9_SHIFT (9U) -/*! NPE9 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE9_SHIFT)) & GPIO_PCNP_NPE9_MASK) - -#define GPIO_PCNP_NPE10_MASK (0x400U) -#define GPIO_PCNP_NPE10_SHIFT (10U) -/*! NPE10 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE10_SHIFT)) & GPIO_PCNP_NPE10_MASK) - -#define GPIO_PCNP_NPE11_MASK (0x800U) -#define GPIO_PCNP_NPE11_SHIFT (11U) -/*! NPE11 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE11_SHIFT)) & GPIO_PCNP_NPE11_MASK) - -#define GPIO_PCNP_NPE12_MASK (0x1000U) -#define GPIO_PCNP_NPE12_SHIFT (12U) -/*! NPE12 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE12_SHIFT)) & GPIO_PCNP_NPE12_MASK) - -#define GPIO_PCNP_NPE13_MASK (0x2000U) -#define GPIO_PCNP_NPE13_SHIFT (13U) -/*! NPE13 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE13_SHIFT)) & GPIO_PCNP_NPE13_MASK) - -#define GPIO_PCNP_NPE14_MASK (0x4000U) -#define GPIO_PCNP_NPE14_SHIFT (14U) -/*! NPE14 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE14_SHIFT)) & GPIO_PCNP_NPE14_MASK) - -#define GPIO_PCNP_NPE15_MASK (0x8000U) -#define GPIO_PCNP_NPE15_SHIFT (15U) -/*! NPE15 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE15_SHIFT)) & GPIO_PCNP_NPE15_MASK) - -#define GPIO_PCNP_NPE16_MASK (0x10000U) -#define GPIO_PCNP_NPE16_SHIFT (16U) -/*! NPE16 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE16_SHIFT)) & GPIO_PCNP_NPE16_MASK) - -#define GPIO_PCNP_NPE17_MASK (0x20000U) -#define GPIO_PCNP_NPE17_SHIFT (17U) -/*! NPE17 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE17_SHIFT)) & GPIO_PCNP_NPE17_MASK) - -#define GPIO_PCNP_NPE18_MASK (0x40000U) -#define GPIO_PCNP_NPE18_SHIFT (18U) -/*! NPE18 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE18_SHIFT)) & GPIO_PCNP_NPE18_MASK) - -#define GPIO_PCNP_NPE19_MASK (0x80000U) -#define GPIO_PCNP_NPE19_SHIFT (19U) -/*! NPE19 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE19_SHIFT)) & GPIO_PCNP_NPE19_MASK) - -#define GPIO_PCNP_NPE20_MASK (0x100000U) -#define GPIO_PCNP_NPE20_SHIFT (20U) -/*! NPE20 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE20_SHIFT)) & GPIO_PCNP_NPE20_MASK) - -#define GPIO_PCNP_NPE21_MASK (0x200000U) -#define GPIO_PCNP_NPE21_SHIFT (21U) -/*! NPE21 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE21_SHIFT)) & GPIO_PCNP_NPE21_MASK) - -#define GPIO_PCNP_NPE22_MASK (0x400000U) -#define GPIO_PCNP_NPE22_SHIFT (22U) -/*! NPE22 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE22_SHIFT)) & GPIO_PCNP_NPE22_MASK) - -#define GPIO_PCNP_NPE23_MASK (0x800000U) -#define GPIO_PCNP_NPE23_SHIFT (23U) -/*! NPE23 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE23_SHIFT)) & GPIO_PCNP_NPE23_MASK) - -#define GPIO_PCNP_NPE24_MASK (0x1000000U) -#define GPIO_PCNP_NPE24_SHIFT (24U) -/*! NPE24 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE24_SHIFT)) & GPIO_PCNP_NPE24_MASK) - -#define GPIO_PCNP_NPE25_MASK (0x2000000U) -#define GPIO_PCNP_NPE25_SHIFT (25U) -/*! NPE25 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE25_SHIFT)) & GPIO_PCNP_NPE25_MASK) - -#define GPIO_PCNP_NPE26_MASK (0x4000000U) -#define GPIO_PCNP_NPE26_SHIFT (26U) -/*! NPE26 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE26_SHIFT)) & GPIO_PCNP_NPE26_MASK) - -#define GPIO_PCNP_NPE27_MASK (0x8000000U) -#define GPIO_PCNP_NPE27_SHIFT (27U) -/*! NPE27 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE27_SHIFT)) & GPIO_PCNP_NPE27_MASK) - -#define GPIO_PCNP_NPE28_MASK (0x10000000U) -#define GPIO_PCNP_NPE28_SHIFT (28U) -/*! NPE28 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE28_SHIFT)) & GPIO_PCNP_NPE28_MASK) - -#define GPIO_PCNP_NPE29_MASK (0x20000000U) -#define GPIO_PCNP_NPE29_SHIFT (29U) -/*! NPE29 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE29_SHIFT)) & GPIO_PCNP_NPE29_MASK) - -#define GPIO_PCNP_NPE30_MASK (0x40000000U) -#define GPIO_PCNP_NPE30_SHIFT (30U) -/*! NPE30 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE30_SHIFT)) & GPIO_PCNP_NPE30_MASK) - -#define GPIO_PCNP_NPE31_MASK (0x80000000U) -#define GPIO_PCNP_NPE31_SHIFT (31U) -/*! NPE31 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE31_SHIFT)) & GPIO_PCNP_NPE31_MASK) -/*! @} */ - -/*! @name ICNP - Interrupt Control Nonprivilege */ -/*! @{ */ - -#define GPIO_ICNP_NPE0_MASK (0x1U) -#define GPIO_ICNP_NPE0_SHIFT (0U) -/*! NPE0 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_ICNP_NPE0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ICNP_NPE0_SHIFT)) & GPIO_ICNP_NPE0_MASK) - -#define GPIO_ICNP_NPE1_MASK (0x2U) -#define GPIO_ICNP_NPE1_SHIFT (1U) -/*! NPE1 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_ICNP_NPE1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ICNP_NPE1_SHIFT)) & GPIO_ICNP_NPE1_MASK) -/*! @} */ - -/*! @name PDOR - Port Data Output */ -/*! @{ */ - -#define GPIO_PDOR_PDO0_MASK (0x1U) -#define GPIO_PDOR_PDO0_SHIFT (0U) -/*! PDO0 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO0_SHIFT)) & GPIO_PDOR_PDO0_MASK) - -#define GPIO_PDOR_PDO1_MASK (0x2U) -#define GPIO_PDOR_PDO1_SHIFT (1U) -/*! PDO1 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO1_SHIFT)) & GPIO_PDOR_PDO1_MASK) - -#define GPIO_PDOR_PDO2_MASK (0x4U) -#define GPIO_PDOR_PDO2_SHIFT (2U) -/*! PDO2 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO2_SHIFT)) & GPIO_PDOR_PDO2_MASK) - -#define GPIO_PDOR_PDO3_MASK (0x8U) -#define GPIO_PDOR_PDO3_SHIFT (3U) -/*! PDO3 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO3_SHIFT)) & GPIO_PDOR_PDO3_MASK) - -#define GPIO_PDOR_PDO4_MASK (0x10U) -#define GPIO_PDOR_PDO4_SHIFT (4U) -/*! PDO4 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO4_SHIFT)) & GPIO_PDOR_PDO4_MASK) - -#define GPIO_PDOR_PDO5_MASK (0x20U) -#define GPIO_PDOR_PDO5_SHIFT (5U) -/*! PDO5 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO5_SHIFT)) & GPIO_PDOR_PDO5_MASK) - -#define GPIO_PDOR_PDO6_MASK (0x40U) -#define GPIO_PDOR_PDO6_SHIFT (6U) -/*! PDO6 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO6_SHIFT)) & GPIO_PDOR_PDO6_MASK) - -#define GPIO_PDOR_PDO7_MASK (0x80U) -#define GPIO_PDOR_PDO7_SHIFT (7U) -/*! PDO7 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO7_SHIFT)) & GPIO_PDOR_PDO7_MASK) - -#define GPIO_PDOR_PDO8_MASK (0x100U) -#define GPIO_PDOR_PDO8_SHIFT (8U) -/*! PDO8 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO8_SHIFT)) & GPIO_PDOR_PDO8_MASK) - -#define GPIO_PDOR_PDO9_MASK (0x200U) -#define GPIO_PDOR_PDO9_SHIFT (9U) -/*! PDO9 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO9_SHIFT)) & GPIO_PDOR_PDO9_MASK) - -#define GPIO_PDOR_PDO10_MASK (0x400U) -#define GPIO_PDOR_PDO10_SHIFT (10U) -/*! PDO10 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO10_SHIFT)) & GPIO_PDOR_PDO10_MASK) - -#define GPIO_PDOR_PDO11_MASK (0x800U) -#define GPIO_PDOR_PDO11_SHIFT (11U) -/*! PDO11 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO11_SHIFT)) & GPIO_PDOR_PDO11_MASK) - -#define GPIO_PDOR_PDO12_MASK (0x1000U) -#define GPIO_PDOR_PDO12_SHIFT (12U) -/*! PDO12 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO12_SHIFT)) & GPIO_PDOR_PDO12_MASK) - -#define GPIO_PDOR_PDO13_MASK (0x2000U) -#define GPIO_PDOR_PDO13_SHIFT (13U) -/*! PDO13 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO13_SHIFT)) & GPIO_PDOR_PDO13_MASK) - -#define GPIO_PDOR_PDO14_MASK (0x4000U) -#define GPIO_PDOR_PDO14_SHIFT (14U) -/*! PDO14 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO14_SHIFT)) & GPIO_PDOR_PDO14_MASK) - -#define GPIO_PDOR_PDO15_MASK (0x8000U) -#define GPIO_PDOR_PDO15_SHIFT (15U) -/*! PDO15 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO15_SHIFT)) & GPIO_PDOR_PDO15_MASK) - -#define GPIO_PDOR_PDO16_MASK (0x10000U) -#define GPIO_PDOR_PDO16_SHIFT (16U) -/*! PDO16 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO16_SHIFT)) & GPIO_PDOR_PDO16_MASK) - -#define GPIO_PDOR_PDO17_MASK (0x20000U) -#define GPIO_PDOR_PDO17_SHIFT (17U) -/*! PDO17 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO17_SHIFT)) & GPIO_PDOR_PDO17_MASK) - -#define GPIO_PDOR_PDO18_MASK (0x40000U) -#define GPIO_PDOR_PDO18_SHIFT (18U) -/*! PDO18 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO18_SHIFT)) & GPIO_PDOR_PDO18_MASK) - -#define GPIO_PDOR_PDO19_MASK (0x80000U) -#define GPIO_PDOR_PDO19_SHIFT (19U) -/*! PDO19 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO19_SHIFT)) & GPIO_PDOR_PDO19_MASK) - -#define GPIO_PDOR_PDO20_MASK (0x100000U) -#define GPIO_PDOR_PDO20_SHIFT (20U) -/*! PDO20 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO20_SHIFT)) & GPIO_PDOR_PDO20_MASK) - -#define GPIO_PDOR_PDO21_MASK (0x200000U) -#define GPIO_PDOR_PDO21_SHIFT (21U) -/*! PDO21 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO21_SHIFT)) & GPIO_PDOR_PDO21_MASK) - -#define GPIO_PDOR_PDO22_MASK (0x400000U) -#define GPIO_PDOR_PDO22_SHIFT (22U) -/*! PDO22 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO22_SHIFT)) & GPIO_PDOR_PDO22_MASK) - -#define GPIO_PDOR_PDO23_MASK (0x800000U) -#define GPIO_PDOR_PDO23_SHIFT (23U) -/*! PDO23 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO23_SHIFT)) & GPIO_PDOR_PDO23_MASK) - -#define GPIO_PDOR_PDO24_MASK (0x1000000U) -#define GPIO_PDOR_PDO24_SHIFT (24U) -/*! PDO24 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO24_SHIFT)) & GPIO_PDOR_PDO24_MASK) - -#define GPIO_PDOR_PDO25_MASK (0x2000000U) -#define GPIO_PDOR_PDO25_SHIFT (25U) -/*! PDO25 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO25_SHIFT)) & GPIO_PDOR_PDO25_MASK) - -#define GPIO_PDOR_PDO26_MASK (0x4000000U) -#define GPIO_PDOR_PDO26_SHIFT (26U) -/*! PDO26 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO26_SHIFT)) & GPIO_PDOR_PDO26_MASK) - -#define GPIO_PDOR_PDO27_MASK (0x8000000U) -#define GPIO_PDOR_PDO27_SHIFT (27U) -/*! PDO27 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO27_SHIFT)) & GPIO_PDOR_PDO27_MASK) - -#define GPIO_PDOR_PDO28_MASK (0x10000000U) -#define GPIO_PDOR_PDO28_SHIFT (28U) -/*! PDO28 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO28_SHIFT)) & GPIO_PDOR_PDO28_MASK) - -#define GPIO_PDOR_PDO29_MASK (0x20000000U) -#define GPIO_PDOR_PDO29_SHIFT (29U) -/*! PDO29 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO29_SHIFT)) & GPIO_PDOR_PDO29_MASK) - -#define GPIO_PDOR_PDO30_MASK (0x40000000U) -#define GPIO_PDOR_PDO30_SHIFT (30U) -/*! PDO30 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO30_SHIFT)) & GPIO_PDOR_PDO30_MASK) - -#define GPIO_PDOR_PDO31_MASK (0x80000000U) -#define GPIO_PDOR_PDO31_SHIFT (31U) -/*! PDO31 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO31_SHIFT)) & GPIO_PDOR_PDO31_MASK) -/*! @} */ - -/*! @name PSOR - Port Set Output */ -/*! @{ */ - -#define GPIO_PSOR_PTSO0_MASK (0x1U) -#define GPIO_PSOR_PTSO0_SHIFT (0U) -/*! PTSO0 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO0_SHIFT)) & GPIO_PSOR_PTSO0_MASK) - -#define GPIO_PSOR_PTSO1_MASK (0x2U) -#define GPIO_PSOR_PTSO1_SHIFT (1U) -/*! PTSO1 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO1_SHIFT)) & GPIO_PSOR_PTSO1_MASK) - -#define GPIO_PSOR_PTSO2_MASK (0x4U) -#define GPIO_PSOR_PTSO2_SHIFT (2U) -/*! PTSO2 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO2_SHIFT)) & GPIO_PSOR_PTSO2_MASK) - -#define GPIO_PSOR_PTSO3_MASK (0x8U) -#define GPIO_PSOR_PTSO3_SHIFT (3U) -/*! PTSO3 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO3_SHIFT)) & GPIO_PSOR_PTSO3_MASK) - -#define GPIO_PSOR_PTSO4_MASK (0x10U) -#define GPIO_PSOR_PTSO4_SHIFT (4U) -/*! PTSO4 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO4_SHIFT)) & GPIO_PSOR_PTSO4_MASK) - -#define GPIO_PSOR_PTSO5_MASK (0x20U) -#define GPIO_PSOR_PTSO5_SHIFT (5U) -/*! PTSO5 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO5_SHIFT)) & GPIO_PSOR_PTSO5_MASK) - -#define GPIO_PSOR_PTSO6_MASK (0x40U) -#define GPIO_PSOR_PTSO6_SHIFT (6U) -/*! PTSO6 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO6_SHIFT)) & GPIO_PSOR_PTSO6_MASK) - -#define GPIO_PSOR_PTSO7_MASK (0x80U) -#define GPIO_PSOR_PTSO7_SHIFT (7U) -/*! PTSO7 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO7_SHIFT)) & GPIO_PSOR_PTSO7_MASK) - -#define GPIO_PSOR_PTSO8_MASK (0x100U) -#define GPIO_PSOR_PTSO8_SHIFT (8U) -/*! PTSO8 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO8_SHIFT)) & GPIO_PSOR_PTSO8_MASK) - -#define GPIO_PSOR_PTSO9_MASK (0x200U) -#define GPIO_PSOR_PTSO9_SHIFT (9U) -/*! PTSO9 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO9_SHIFT)) & GPIO_PSOR_PTSO9_MASK) - -#define GPIO_PSOR_PTSO10_MASK (0x400U) -#define GPIO_PSOR_PTSO10_SHIFT (10U) -/*! PTSO10 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO10_SHIFT)) & GPIO_PSOR_PTSO10_MASK) - -#define GPIO_PSOR_PTSO11_MASK (0x800U) -#define GPIO_PSOR_PTSO11_SHIFT (11U) -/*! PTSO11 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO11_SHIFT)) & GPIO_PSOR_PTSO11_MASK) - -#define GPIO_PSOR_PTSO12_MASK (0x1000U) -#define GPIO_PSOR_PTSO12_SHIFT (12U) -/*! PTSO12 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO12_SHIFT)) & GPIO_PSOR_PTSO12_MASK) - -#define GPIO_PSOR_PTSO13_MASK (0x2000U) -#define GPIO_PSOR_PTSO13_SHIFT (13U) -/*! PTSO13 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO13_SHIFT)) & GPIO_PSOR_PTSO13_MASK) - -#define GPIO_PSOR_PTSO14_MASK (0x4000U) -#define GPIO_PSOR_PTSO14_SHIFT (14U) -/*! PTSO14 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO14_SHIFT)) & GPIO_PSOR_PTSO14_MASK) - -#define GPIO_PSOR_PTSO15_MASK (0x8000U) -#define GPIO_PSOR_PTSO15_SHIFT (15U) -/*! PTSO15 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO15_SHIFT)) & GPIO_PSOR_PTSO15_MASK) - -#define GPIO_PSOR_PTSO16_MASK (0x10000U) -#define GPIO_PSOR_PTSO16_SHIFT (16U) -/*! PTSO16 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO16_SHIFT)) & GPIO_PSOR_PTSO16_MASK) - -#define GPIO_PSOR_PTSO17_MASK (0x20000U) -#define GPIO_PSOR_PTSO17_SHIFT (17U) -/*! PTSO17 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO17_SHIFT)) & GPIO_PSOR_PTSO17_MASK) - -#define GPIO_PSOR_PTSO18_MASK (0x40000U) -#define GPIO_PSOR_PTSO18_SHIFT (18U) -/*! PTSO18 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO18_SHIFT)) & GPIO_PSOR_PTSO18_MASK) - -#define GPIO_PSOR_PTSO19_MASK (0x80000U) -#define GPIO_PSOR_PTSO19_SHIFT (19U) -/*! PTSO19 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO19_SHIFT)) & GPIO_PSOR_PTSO19_MASK) - -#define GPIO_PSOR_PTSO20_MASK (0x100000U) -#define GPIO_PSOR_PTSO20_SHIFT (20U) -/*! PTSO20 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO20_SHIFT)) & GPIO_PSOR_PTSO20_MASK) - -#define GPIO_PSOR_PTSO21_MASK (0x200000U) -#define GPIO_PSOR_PTSO21_SHIFT (21U) -/*! PTSO21 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO21_SHIFT)) & GPIO_PSOR_PTSO21_MASK) - -#define GPIO_PSOR_PTSO22_MASK (0x400000U) -#define GPIO_PSOR_PTSO22_SHIFT (22U) -/*! PTSO22 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO22_SHIFT)) & GPIO_PSOR_PTSO22_MASK) - -#define GPIO_PSOR_PTSO23_MASK (0x800000U) -#define GPIO_PSOR_PTSO23_SHIFT (23U) -/*! PTSO23 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO23_SHIFT)) & GPIO_PSOR_PTSO23_MASK) - -#define GPIO_PSOR_PTSO24_MASK (0x1000000U) -#define GPIO_PSOR_PTSO24_SHIFT (24U) -/*! PTSO24 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO24_SHIFT)) & GPIO_PSOR_PTSO24_MASK) - -#define GPIO_PSOR_PTSO25_MASK (0x2000000U) -#define GPIO_PSOR_PTSO25_SHIFT (25U) -/*! PTSO25 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO25_SHIFT)) & GPIO_PSOR_PTSO25_MASK) - -#define GPIO_PSOR_PTSO26_MASK (0x4000000U) -#define GPIO_PSOR_PTSO26_SHIFT (26U) -/*! PTSO26 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO26_SHIFT)) & GPIO_PSOR_PTSO26_MASK) - -#define GPIO_PSOR_PTSO27_MASK (0x8000000U) -#define GPIO_PSOR_PTSO27_SHIFT (27U) -/*! PTSO27 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO27_SHIFT)) & GPIO_PSOR_PTSO27_MASK) - -#define GPIO_PSOR_PTSO28_MASK (0x10000000U) -#define GPIO_PSOR_PTSO28_SHIFT (28U) -/*! PTSO28 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO28_SHIFT)) & GPIO_PSOR_PTSO28_MASK) - -#define GPIO_PSOR_PTSO29_MASK (0x20000000U) -#define GPIO_PSOR_PTSO29_SHIFT (29U) -/*! PTSO29 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO29_SHIFT)) & GPIO_PSOR_PTSO29_MASK) - -#define GPIO_PSOR_PTSO30_MASK (0x40000000U) -#define GPIO_PSOR_PTSO30_SHIFT (30U) -/*! PTSO30 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO30_SHIFT)) & GPIO_PSOR_PTSO30_MASK) - -#define GPIO_PSOR_PTSO31_MASK (0x80000000U) -#define GPIO_PSOR_PTSO31_SHIFT (31U) -/*! PTSO31 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO31_SHIFT)) & GPIO_PSOR_PTSO31_MASK) -/*! @} */ - -/*! @name PCOR - Port Clear Output */ -/*! @{ */ - -#define GPIO_PCOR_PTCO0_MASK (0x1U) -#define GPIO_PCOR_PTCO0_SHIFT (0U) -/*! PTCO0 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO0_SHIFT)) & GPIO_PCOR_PTCO0_MASK) - -#define GPIO_PCOR_PTCO1_MASK (0x2U) -#define GPIO_PCOR_PTCO1_SHIFT (1U) -/*! PTCO1 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO1_SHIFT)) & GPIO_PCOR_PTCO1_MASK) - -#define GPIO_PCOR_PTCO2_MASK (0x4U) -#define GPIO_PCOR_PTCO2_SHIFT (2U) -/*! PTCO2 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO2_SHIFT)) & GPIO_PCOR_PTCO2_MASK) - -#define GPIO_PCOR_PTCO3_MASK (0x8U) -#define GPIO_PCOR_PTCO3_SHIFT (3U) -/*! PTCO3 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO3_SHIFT)) & GPIO_PCOR_PTCO3_MASK) - -#define GPIO_PCOR_PTCO4_MASK (0x10U) -#define GPIO_PCOR_PTCO4_SHIFT (4U) -/*! PTCO4 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO4_SHIFT)) & GPIO_PCOR_PTCO4_MASK) - -#define GPIO_PCOR_PTCO5_MASK (0x20U) -#define GPIO_PCOR_PTCO5_SHIFT (5U) -/*! PTCO5 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO5_SHIFT)) & GPIO_PCOR_PTCO5_MASK) - -#define GPIO_PCOR_PTCO6_MASK (0x40U) -#define GPIO_PCOR_PTCO6_SHIFT (6U) -/*! PTCO6 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO6_SHIFT)) & GPIO_PCOR_PTCO6_MASK) - -#define GPIO_PCOR_PTCO7_MASK (0x80U) -#define GPIO_PCOR_PTCO7_SHIFT (7U) -/*! PTCO7 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO7_SHIFT)) & GPIO_PCOR_PTCO7_MASK) - -#define GPIO_PCOR_PTCO8_MASK (0x100U) -#define GPIO_PCOR_PTCO8_SHIFT (8U) -/*! PTCO8 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO8_SHIFT)) & GPIO_PCOR_PTCO8_MASK) - -#define GPIO_PCOR_PTCO9_MASK (0x200U) -#define GPIO_PCOR_PTCO9_SHIFT (9U) -/*! PTCO9 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO9_SHIFT)) & GPIO_PCOR_PTCO9_MASK) - -#define GPIO_PCOR_PTCO10_MASK (0x400U) -#define GPIO_PCOR_PTCO10_SHIFT (10U) -/*! PTCO10 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO10_SHIFT)) & GPIO_PCOR_PTCO10_MASK) - -#define GPIO_PCOR_PTCO11_MASK (0x800U) -#define GPIO_PCOR_PTCO11_SHIFT (11U) -/*! PTCO11 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO11_SHIFT)) & GPIO_PCOR_PTCO11_MASK) - -#define GPIO_PCOR_PTCO12_MASK (0x1000U) -#define GPIO_PCOR_PTCO12_SHIFT (12U) -/*! PTCO12 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO12_SHIFT)) & GPIO_PCOR_PTCO12_MASK) - -#define GPIO_PCOR_PTCO13_MASK (0x2000U) -#define GPIO_PCOR_PTCO13_SHIFT (13U) -/*! PTCO13 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO13_SHIFT)) & GPIO_PCOR_PTCO13_MASK) - -#define GPIO_PCOR_PTCO14_MASK (0x4000U) -#define GPIO_PCOR_PTCO14_SHIFT (14U) -/*! PTCO14 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO14_SHIFT)) & GPIO_PCOR_PTCO14_MASK) - -#define GPIO_PCOR_PTCO15_MASK (0x8000U) -#define GPIO_PCOR_PTCO15_SHIFT (15U) -/*! PTCO15 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO15_SHIFT)) & GPIO_PCOR_PTCO15_MASK) - -#define GPIO_PCOR_PTCO16_MASK (0x10000U) -#define GPIO_PCOR_PTCO16_SHIFT (16U) -/*! PTCO16 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO16_SHIFT)) & GPIO_PCOR_PTCO16_MASK) - -#define GPIO_PCOR_PTCO17_MASK (0x20000U) -#define GPIO_PCOR_PTCO17_SHIFT (17U) -/*! PTCO17 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO17_SHIFT)) & GPIO_PCOR_PTCO17_MASK) - -#define GPIO_PCOR_PTCO18_MASK (0x40000U) -#define GPIO_PCOR_PTCO18_SHIFT (18U) -/*! PTCO18 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO18_SHIFT)) & GPIO_PCOR_PTCO18_MASK) - -#define GPIO_PCOR_PTCO19_MASK (0x80000U) -#define GPIO_PCOR_PTCO19_SHIFT (19U) -/*! PTCO19 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO19_SHIFT)) & GPIO_PCOR_PTCO19_MASK) - -#define GPIO_PCOR_PTCO20_MASK (0x100000U) -#define GPIO_PCOR_PTCO20_SHIFT (20U) -/*! PTCO20 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO20_SHIFT)) & GPIO_PCOR_PTCO20_MASK) - -#define GPIO_PCOR_PTCO21_MASK (0x200000U) -#define GPIO_PCOR_PTCO21_SHIFT (21U) -/*! PTCO21 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO21_SHIFT)) & GPIO_PCOR_PTCO21_MASK) - -#define GPIO_PCOR_PTCO22_MASK (0x400000U) -#define GPIO_PCOR_PTCO22_SHIFT (22U) -/*! PTCO22 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO22_SHIFT)) & GPIO_PCOR_PTCO22_MASK) - -#define GPIO_PCOR_PTCO23_MASK (0x800000U) -#define GPIO_PCOR_PTCO23_SHIFT (23U) -/*! PTCO23 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO23_SHIFT)) & GPIO_PCOR_PTCO23_MASK) - -#define GPIO_PCOR_PTCO24_MASK (0x1000000U) -#define GPIO_PCOR_PTCO24_SHIFT (24U) -/*! PTCO24 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO24_SHIFT)) & GPIO_PCOR_PTCO24_MASK) - -#define GPIO_PCOR_PTCO25_MASK (0x2000000U) -#define GPIO_PCOR_PTCO25_SHIFT (25U) -/*! PTCO25 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO25_SHIFT)) & GPIO_PCOR_PTCO25_MASK) - -#define GPIO_PCOR_PTCO26_MASK (0x4000000U) -#define GPIO_PCOR_PTCO26_SHIFT (26U) -/*! PTCO26 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO26_SHIFT)) & GPIO_PCOR_PTCO26_MASK) - -#define GPIO_PCOR_PTCO27_MASK (0x8000000U) -#define GPIO_PCOR_PTCO27_SHIFT (27U) -/*! PTCO27 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO27_SHIFT)) & GPIO_PCOR_PTCO27_MASK) - -#define GPIO_PCOR_PTCO28_MASK (0x10000000U) -#define GPIO_PCOR_PTCO28_SHIFT (28U) -/*! PTCO28 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO28_SHIFT)) & GPIO_PCOR_PTCO28_MASK) - -#define GPIO_PCOR_PTCO29_MASK (0x20000000U) -#define GPIO_PCOR_PTCO29_SHIFT (29U) -/*! PTCO29 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO29_SHIFT)) & GPIO_PCOR_PTCO29_MASK) - -#define GPIO_PCOR_PTCO30_MASK (0x40000000U) -#define GPIO_PCOR_PTCO30_SHIFT (30U) -/*! PTCO30 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO30_SHIFT)) & GPIO_PCOR_PTCO30_MASK) - -#define GPIO_PCOR_PTCO31_MASK (0x80000000U) -#define GPIO_PCOR_PTCO31_SHIFT (31U) -/*! PTCO31 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO31_SHIFT)) & GPIO_PCOR_PTCO31_MASK) -/*! @} */ - -/*! @name PTOR - Port Toggle Output */ -/*! @{ */ - -#define GPIO_PTOR_PTTO0_MASK (0x1U) -#define GPIO_PTOR_PTTO0_SHIFT (0U) -/*! PTTO0 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO0_SHIFT)) & GPIO_PTOR_PTTO0_MASK) - -#define GPIO_PTOR_PTTO1_MASK (0x2U) -#define GPIO_PTOR_PTTO1_SHIFT (1U) -/*! PTTO1 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO1_SHIFT)) & GPIO_PTOR_PTTO1_MASK) - -#define GPIO_PTOR_PTTO2_MASK (0x4U) -#define GPIO_PTOR_PTTO2_SHIFT (2U) -/*! PTTO2 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO2_SHIFT)) & GPIO_PTOR_PTTO2_MASK) - -#define GPIO_PTOR_PTTO3_MASK (0x8U) -#define GPIO_PTOR_PTTO3_SHIFT (3U) -/*! PTTO3 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO3_SHIFT)) & GPIO_PTOR_PTTO3_MASK) - -#define GPIO_PTOR_PTTO4_MASK (0x10U) -#define GPIO_PTOR_PTTO4_SHIFT (4U) -/*! PTTO4 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO4_SHIFT)) & GPIO_PTOR_PTTO4_MASK) - -#define GPIO_PTOR_PTTO5_MASK (0x20U) -#define GPIO_PTOR_PTTO5_SHIFT (5U) -/*! PTTO5 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO5_SHIFT)) & GPIO_PTOR_PTTO5_MASK) - -#define GPIO_PTOR_PTTO6_MASK (0x40U) -#define GPIO_PTOR_PTTO6_SHIFT (6U) -/*! PTTO6 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO6_SHIFT)) & GPIO_PTOR_PTTO6_MASK) - -#define GPIO_PTOR_PTTO7_MASK (0x80U) -#define GPIO_PTOR_PTTO7_SHIFT (7U) -/*! PTTO7 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO7_SHIFT)) & GPIO_PTOR_PTTO7_MASK) - -#define GPIO_PTOR_PTTO8_MASK (0x100U) -#define GPIO_PTOR_PTTO8_SHIFT (8U) -/*! PTTO8 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO8_SHIFT)) & GPIO_PTOR_PTTO8_MASK) - -#define GPIO_PTOR_PTTO9_MASK (0x200U) -#define GPIO_PTOR_PTTO9_SHIFT (9U) -/*! PTTO9 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO9_SHIFT)) & GPIO_PTOR_PTTO9_MASK) - -#define GPIO_PTOR_PTTO10_MASK (0x400U) -#define GPIO_PTOR_PTTO10_SHIFT (10U) -/*! PTTO10 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO10_SHIFT)) & GPIO_PTOR_PTTO10_MASK) - -#define GPIO_PTOR_PTTO11_MASK (0x800U) -#define GPIO_PTOR_PTTO11_SHIFT (11U) -/*! PTTO11 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO11_SHIFT)) & GPIO_PTOR_PTTO11_MASK) - -#define GPIO_PTOR_PTTO12_MASK (0x1000U) -#define GPIO_PTOR_PTTO12_SHIFT (12U) -/*! PTTO12 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO12_SHIFT)) & GPIO_PTOR_PTTO12_MASK) - -#define GPIO_PTOR_PTTO13_MASK (0x2000U) -#define GPIO_PTOR_PTTO13_SHIFT (13U) -/*! PTTO13 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO13_SHIFT)) & GPIO_PTOR_PTTO13_MASK) - -#define GPIO_PTOR_PTTO14_MASK (0x4000U) -#define GPIO_PTOR_PTTO14_SHIFT (14U) -/*! PTTO14 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO14_SHIFT)) & GPIO_PTOR_PTTO14_MASK) - -#define GPIO_PTOR_PTTO15_MASK (0x8000U) -#define GPIO_PTOR_PTTO15_SHIFT (15U) -/*! PTTO15 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO15_SHIFT)) & GPIO_PTOR_PTTO15_MASK) - -#define GPIO_PTOR_PTTO16_MASK (0x10000U) -#define GPIO_PTOR_PTTO16_SHIFT (16U) -/*! PTTO16 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO16_SHIFT)) & GPIO_PTOR_PTTO16_MASK) - -#define GPIO_PTOR_PTTO17_MASK (0x20000U) -#define GPIO_PTOR_PTTO17_SHIFT (17U) -/*! PTTO17 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO17_SHIFT)) & GPIO_PTOR_PTTO17_MASK) - -#define GPIO_PTOR_PTTO18_MASK (0x40000U) -#define GPIO_PTOR_PTTO18_SHIFT (18U) -/*! PTTO18 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO18_SHIFT)) & GPIO_PTOR_PTTO18_MASK) - -#define GPIO_PTOR_PTTO19_MASK (0x80000U) -#define GPIO_PTOR_PTTO19_SHIFT (19U) -/*! PTTO19 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO19_SHIFT)) & GPIO_PTOR_PTTO19_MASK) - -#define GPIO_PTOR_PTTO20_MASK (0x100000U) -#define GPIO_PTOR_PTTO20_SHIFT (20U) -/*! PTTO20 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO20_SHIFT)) & GPIO_PTOR_PTTO20_MASK) - -#define GPIO_PTOR_PTTO21_MASK (0x200000U) -#define GPIO_PTOR_PTTO21_SHIFT (21U) -/*! PTTO21 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO21_SHIFT)) & GPIO_PTOR_PTTO21_MASK) - -#define GPIO_PTOR_PTTO22_MASK (0x400000U) -#define GPIO_PTOR_PTTO22_SHIFT (22U) -/*! PTTO22 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO22_SHIFT)) & GPIO_PTOR_PTTO22_MASK) - -#define GPIO_PTOR_PTTO23_MASK (0x800000U) -#define GPIO_PTOR_PTTO23_SHIFT (23U) -/*! PTTO23 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO23_SHIFT)) & GPIO_PTOR_PTTO23_MASK) - -#define GPIO_PTOR_PTTO24_MASK (0x1000000U) -#define GPIO_PTOR_PTTO24_SHIFT (24U) -/*! PTTO24 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO24_SHIFT)) & GPIO_PTOR_PTTO24_MASK) - -#define GPIO_PTOR_PTTO25_MASK (0x2000000U) -#define GPIO_PTOR_PTTO25_SHIFT (25U) -/*! PTTO25 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO25_SHIFT)) & GPIO_PTOR_PTTO25_MASK) - -#define GPIO_PTOR_PTTO26_MASK (0x4000000U) -#define GPIO_PTOR_PTTO26_SHIFT (26U) -/*! PTTO26 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO26_SHIFT)) & GPIO_PTOR_PTTO26_MASK) - -#define GPIO_PTOR_PTTO27_MASK (0x8000000U) -#define GPIO_PTOR_PTTO27_SHIFT (27U) -/*! PTTO27 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO27_SHIFT)) & GPIO_PTOR_PTTO27_MASK) - -#define GPIO_PTOR_PTTO28_MASK (0x10000000U) -#define GPIO_PTOR_PTTO28_SHIFT (28U) -/*! PTTO28 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO28_SHIFT)) & GPIO_PTOR_PTTO28_MASK) - -#define GPIO_PTOR_PTTO29_MASK (0x20000000U) -#define GPIO_PTOR_PTTO29_SHIFT (29U) -/*! PTTO29 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO29_SHIFT)) & GPIO_PTOR_PTTO29_MASK) - -#define GPIO_PTOR_PTTO30_MASK (0x40000000U) -#define GPIO_PTOR_PTTO30_SHIFT (30U) -/*! PTTO30 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO30_SHIFT)) & GPIO_PTOR_PTTO30_MASK) - -#define GPIO_PTOR_PTTO31_MASK (0x80000000U) -#define GPIO_PTOR_PTTO31_SHIFT (31U) -/*! PTTO31 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO31_SHIFT)) & GPIO_PTOR_PTTO31_MASK) -/*! @} */ - -/*! @name PDIR - Port Data Input */ -/*! @{ */ - -#define GPIO_PDIR_PDI0_MASK (0x1U) -#define GPIO_PDIR_PDI0_SHIFT (0U) -/*! PDI0 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI0_SHIFT)) & GPIO_PDIR_PDI0_MASK) - -#define GPIO_PDIR_PDI1_MASK (0x2U) -#define GPIO_PDIR_PDI1_SHIFT (1U) -/*! PDI1 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI1_SHIFT)) & GPIO_PDIR_PDI1_MASK) - -#define GPIO_PDIR_PDI2_MASK (0x4U) -#define GPIO_PDIR_PDI2_SHIFT (2U) -/*! PDI2 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI2_SHIFT)) & GPIO_PDIR_PDI2_MASK) - -#define GPIO_PDIR_PDI3_MASK (0x8U) -#define GPIO_PDIR_PDI3_SHIFT (3U) -/*! PDI3 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI3_SHIFT)) & GPIO_PDIR_PDI3_MASK) - -#define GPIO_PDIR_PDI4_MASK (0x10U) -#define GPIO_PDIR_PDI4_SHIFT (4U) -/*! PDI4 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI4_SHIFT)) & GPIO_PDIR_PDI4_MASK) - -#define GPIO_PDIR_PDI5_MASK (0x20U) -#define GPIO_PDIR_PDI5_SHIFT (5U) -/*! PDI5 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI5_SHIFT)) & GPIO_PDIR_PDI5_MASK) - -#define GPIO_PDIR_PDI6_MASK (0x40U) -#define GPIO_PDIR_PDI6_SHIFT (6U) -/*! PDI6 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI6_SHIFT)) & GPIO_PDIR_PDI6_MASK) - -#define GPIO_PDIR_PDI7_MASK (0x80U) -#define GPIO_PDIR_PDI7_SHIFT (7U) -/*! PDI7 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI7_SHIFT)) & GPIO_PDIR_PDI7_MASK) - -#define GPIO_PDIR_PDI8_MASK (0x100U) -#define GPIO_PDIR_PDI8_SHIFT (8U) -/*! PDI8 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI8_SHIFT)) & GPIO_PDIR_PDI8_MASK) - -#define GPIO_PDIR_PDI9_MASK (0x200U) -#define GPIO_PDIR_PDI9_SHIFT (9U) -/*! PDI9 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI9_SHIFT)) & GPIO_PDIR_PDI9_MASK) - -#define GPIO_PDIR_PDI10_MASK (0x400U) -#define GPIO_PDIR_PDI10_SHIFT (10U) -/*! PDI10 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI10_SHIFT)) & GPIO_PDIR_PDI10_MASK) - -#define GPIO_PDIR_PDI11_MASK (0x800U) -#define GPIO_PDIR_PDI11_SHIFT (11U) -/*! PDI11 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI11_SHIFT)) & GPIO_PDIR_PDI11_MASK) - -#define GPIO_PDIR_PDI12_MASK (0x1000U) -#define GPIO_PDIR_PDI12_SHIFT (12U) -/*! PDI12 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI12_SHIFT)) & GPIO_PDIR_PDI12_MASK) - -#define GPIO_PDIR_PDI13_MASK (0x2000U) -#define GPIO_PDIR_PDI13_SHIFT (13U) -/*! PDI13 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI13_SHIFT)) & GPIO_PDIR_PDI13_MASK) - -#define GPIO_PDIR_PDI14_MASK (0x4000U) -#define GPIO_PDIR_PDI14_SHIFT (14U) -/*! PDI14 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI14_SHIFT)) & GPIO_PDIR_PDI14_MASK) - -#define GPIO_PDIR_PDI15_MASK (0x8000U) -#define GPIO_PDIR_PDI15_SHIFT (15U) -/*! PDI15 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI15_SHIFT)) & GPIO_PDIR_PDI15_MASK) - -#define GPIO_PDIR_PDI16_MASK (0x10000U) -#define GPIO_PDIR_PDI16_SHIFT (16U) -/*! PDI16 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI16_SHIFT)) & GPIO_PDIR_PDI16_MASK) - -#define GPIO_PDIR_PDI17_MASK (0x20000U) -#define GPIO_PDIR_PDI17_SHIFT (17U) -/*! PDI17 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI17_SHIFT)) & GPIO_PDIR_PDI17_MASK) - -#define GPIO_PDIR_PDI18_MASK (0x40000U) -#define GPIO_PDIR_PDI18_SHIFT (18U) -/*! PDI18 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI18_SHIFT)) & GPIO_PDIR_PDI18_MASK) - -#define GPIO_PDIR_PDI19_MASK (0x80000U) -#define GPIO_PDIR_PDI19_SHIFT (19U) -/*! PDI19 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI19_SHIFT)) & GPIO_PDIR_PDI19_MASK) - -#define GPIO_PDIR_PDI20_MASK (0x100000U) -#define GPIO_PDIR_PDI20_SHIFT (20U) -/*! PDI20 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI20_SHIFT)) & GPIO_PDIR_PDI20_MASK) - -#define GPIO_PDIR_PDI21_MASK (0x200000U) -#define GPIO_PDIR_PDI21_SHIFT (21U) -/*! PDI21 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI21_SHIFT)) & GPIO_PDIR_PDI21_MASK) - -#define GPIO_PDIR_PDI22_MASK (0x400000U) -#define GPIO_PDIR_PDI22_SHIFT (22U) -/*! PDI22 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI22_SHIFT)) & GPIO_PDIR_PDI22_MASK) - -#define GPIO_PDIR_PDI23_MASK (0x800000U) -#define GPIO_PDIR_PDI23_SHIFT (23U) -/*! PDI23 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI23_SHIFT)) & GPIO_PDIR_PDI23_MASK) - -#define GPIO_PDIR_PDI24_MASK (0x1000000U) -#define GPIO_PDIR_PDI24_SHIFT (24U) -/*! PDI24 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI24_SHIFT)) & GPIO_PDIR_PDI24_MASK) - -#define GPIO_PDIR_PDI25_MASK (0x2000000U) -#define GPIO_PDIR_PDI25_SHIFT (25U) -/*! PDI25 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI25_SHIFT)) & GPIO_PDIR_PDI25_MASK) - -#define GPIO_PDIR_PDI26_MASK (0x4000000U) -#define GPIO_PDIR_PDI26_SHIFT (26U) -/*! PDI26 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI26_SHIFT)) & GPIO_PDIR_PDI26_MASK) - -#define GPIO_PDIR_PDI27_MASK (0x8000000U) -#define GPIO_PDIR_PDI27_SHIFT (27U) -/*! PDI27 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI27_SHIFT)) & GPIO_PDIR_PDI27_MASK) - -#define GPIO_PDIR_PDI28_MASK (0x10000000U) -#define GPIO_PDIR_PDI28_SHIFT (28U) -/*! PDI28 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI28_SHIFT)) & GPIO_PDIR_PDI28_MASK) - -#define GPIO_PDIR_PDI29_MASK (0x20000000U) -#define GPIO_PDIR_PDI29_SHIFT (29U) -/*! PDI29 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI29_SHIFT)) & GPIO_PDIR_PDI29_MASK) - -#define GPIO_PDIR_PDI30_MASK (0x40000000U) -#define GPIO_PDIR_PDI30_SHIFT (30U) -/*! PDI30 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI30_SHIFT)) & GPIO_PDIR_PDI30_MASK) - -#define GPIO_PDIR_PDI31_MASK (0x80000000U) -#define GPIO_PDIR_PDI31_SHIFT (31U) -/*! PDI31 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI31_SHIFT)) & GPIO_PDIR_PDI31_MASK) -/*! @} */ - -/*! @name PDDR - Port Data Direction */ -/*! @{ */ - -#define GPIO_PDDR_PDD0_MASK (0x1U) -#define GPIO_PDDR_PDD0_SHIFT (0U) -/*! PDD0 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD0_SHIFT)) & GPIO_PDDR_PDD0_MASK) - -#define GPIO_PDDR_PDD1_MASK (0x2U) -#define GPIO_PDDR_PDD1_SHIFT (1U) -/*! PDD1 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD1_SHIFT)) & GPIO_PDDR_PDD1_MASK) - -#define GPIO_PDDR_PDD2_MASK (0x4U) -#define GPIO_PDDR_PDD2_SHIFT (2U) -/*! PDD2 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD2_SHIFT)) & GPIO_PDDR_PDD2_MASK) - -#define GPIO_PDDR_PDD3_MASK (0x8U) -#define GPIO_PDDR_PDD3_SHIFT (3U) -/*! PDD3 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD3_SHIFT)) & GPIO_PDDR_PDD3_MASK) - -#define GPIO_PDDR_PDD4_MASK (0x10U) -#define GPIO_PDDR_PDD4_SHIFT (4U) -/*! PDD4 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD4_SHIFT)) & GPIO_PDDR_PDD4_MASK) - -#define GPIO_PDDR_PDD5_MASK (0x20U) -#define GPIO_PDDR_PDD5_SHIFT (5U) -/*! PDD5 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD5_SHIFT)) & GPIO_PDDR_PDD5_MASK) - -#define GPIO_PDDR_PDD6_MASK (0x40U) -#define GPIO_PDDR_PDD6_SHIFT (6U) -/*! PDD6 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD6_SHIFT)) & GPIO_PDDR_PDD6_MASK) - -#define GPIO_PDDR_PDD7_MASK (0x80U) -#define GPIO_PDDR_PDD7_SHIFT (7U) -/*! PDD7 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD7_SHIFT)) & GPIO_PDDR_PDD7_MASK) - -#define GPIO_PDDR_PDD8_MASK (0x100U) -#define GPIO_PDDR_PDD8_SHIFT (8U) -/*! PDD8 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD8_SHIFT)) & GPIO_PDDR_PDD8_MASK) - -#define GPIO_PDDR_PDD9_MASK (0x200U) -#define GPIO_PDDR_PDD9_SHIFT (9U) -/*! PDD9 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD9_SHIFT)) & GPIO_PDDR_PDD9_MASK) - -#define GPIO_PDDR_PDD10_MASK (0x400U) -#define GPIO_PDDR_PDD10_SHIFT (10U) -/*! PDD10 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD10_SHIFT)) & GPIO_PDDR_PDD10_MASK) - -#define GPIO_PDDR_PDD11_MASK (0x800U) -#define GPIO_PDDR_PDD11_SHIFT (11U) -/*! PDD11 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD11_SHIFT)) & GPIO_PDDR_PDD11_MASK) - -#define GPIO_PDDR_PDD12_MASK (0x1000U) -#define GPIO_PDDR_PDD12_SHIFT (12U) -/*! PDD12 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD12_SHIFT)) & GPIO_PDDR_PDD12_MASK) - -#define GPIO_PDDR_PDD13_MASK (0x2000U) -#define GPIO_PDDR_PDD13_SHIFT (13U) -/*! PDD13 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD13_SHIFT)) & GPIO_PDDR_PDD13_MASK) - -#define GPIO_PDDR_PDD14_MASK (0x4000U) -#define GPIO_PDDR_PDD14_SHIFT (14U) -/*! PDD14 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD14_SHIFT)) & GPIO_PDDR_PDD14_MASK) - -#define GPIO_PDDR_PDD15_MASK (0x8000U) -#define GPIO_PDDR_PDD15_SHIFT (15U) -/*! PDD15 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD15_SHIFT)) & GPIO_PDDR_PDD15_MASK) - -#define GPIO_PDDR_PDD16_MASK (0x10000U) -#define GPIO_PDDR_PDD16_SHIFT (16U) -/*! PDD16 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD16_SHIFT)) & GPIO_PDDR_PDD16_MASK) - -#define GPIO_PDDR_PDD17_MASK (0x20000U) -#define GPIO_PDDR_PDD17_SHIFT (17U) -/*! PDD17 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD17_SHIFT)) & GPIO_PDDR_PDD17_MASK) - -#define GPIO_PDDR_PDD18_MASK (0x40000U) -#define GPIO_PDDR_PDD18_SHIFT (18U) -/*! PDD18 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD18_SHIFT)) & GPIO_PDDR_PDD18_MASK) - -#define GPIO_PDDR_PDD19_MASK (0x80000U) -#define GPIO_PDDR_PDD19_SHIFT (19U) -/*! PDD19 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD19_SHIFT)) & GPIO_PDDR_PDD19_MASK) - -#define GPIO_PDDR_PDD20_MASK (0x100000U) -#define GPIO_PDDR_PDD20_SHIFT (20U) -/*! PDD20 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD20_SHIFT)) & GPIO_PDDR_PDD20_MASK) - -#define GPIO_PDDR_PDD21_MASK (0x200000U) -#define GPIO_PDDR_PDD21_SHIFT (21U) -/*! PDD21 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD21_SHIFT)) & GPIO_PDDR_PDD21_MASK) - -#define GPIO_PDDR_PDD22_MASK (0x400000U) -#define GPIO_PDDR_PDD22_SHIFT (22U) -/*! PDD22 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD22_SHIFT)) & GPIO_PDDR_PDD22_MASK) - -#define GPIO_PDDR_PDD23_MASK (0x800000U) -#define GPIO_PDDR_PDD23_SHIFT (23U) -/*! PDD23 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD23_SHIFT)) & GPIO_PDDR_PDD23_MASK) - -#define GPIO_PDDR_PDD24_MASK (0x1000000U) -#define GPIO_PDDR_PDD24_SHIFT (24U) -/*! PDD24 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD24_SHIFT)) & GPIO_PDDR_PDD24_MASK) - -#define GPIO_PDDR_PDD25_MASK (0x2000000U) -#define GPIO_PDDR_PDD25_SHIFT (25U) -/*! PDD25 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD25_SHIFT)) & GPIO_PDDR_PDD25_MASK) - -#define GPIO_PDDR_PDD26_MASK (0x4000000U) -#define GPIO_PDDR_PDD26_SHIFT (26U) -/*! PDD26 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD26_SHIFT)) & GPIO_PDDR_PDD26_MASK) - -#define GPIO_PDDR_PDD27_MASK (0x8000000U) -#define GPIO_PDDR_PDD27_SHIFT (27U) -/*! PDD27 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD27_SHIFT)) & GPIO_PDDR_PDD27_MASK) - -#define GPIO_PDDR_PDD28_MASK (0x10000000U) -#define GPIO_PDDR_PDD28_SHIFT (28U) -/*! PDD28 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD28_SHIFT)) & GPIO_PDDR_PDD28_MASK) - -#define GPIO_PDDR_PDD29_MASK (0x20000000U) -#define GPIO_PDDR_PDD29_SHIFT (29U) -/*! PDD29 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD29_SHIFT)) & GPIO_PDDR_PDD29_MASK) - -#define GPIO_PDDR_PDD30_MASK (0x40000000U) -#define GPIO_PDDR_PDD30_SHIFT (30U) -/*! PDD30 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD30_SHIFT)) & GPIO_PDDR_PDD30_MASK) - -#define GPIO_PDDR_PDD31_MASK (0x80000000U) -#define GPIO_PDDR_PDD31_SHIFT (31U) -/*! PDD31 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD31_SHIFT)) & GPIO_PDDR_PDD31_MASK) -/*! @} */ - -/*! @name PIDR - Port Input Disable */ -/*! @{ */ - -#define GPIO_PIDR_PID0_MASK (0x1U) -#define GPIO_PIDR_PID0_SHIFT (0U) -/*! PID0 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID0_SHIFT)) & GPIO_PIDR_PID0_MASK) - -#define GPIO_PIDR_PID1_MASK (0x2U) -#define GPIO_PIDR_PID1_SHIFT (1U) -/*! PID1 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID1_SHIFT)) & GPIO_PIDR_PID1_MASK) - -#define GPIO_PIDR_PID2_MASK (0x4U) -#define GPIO_PIDR_PID2_SHIFT (2U) -/*! PID2 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID2_SHIFT)) & GPIO_PIDR_PID2_MASK) - -#define GPIO_PIDR_PID3_MASK (0x8U) -#define GPIO_PIDR_PID3_SHIFT (3U) -/*! PID3 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID3_SHIFT)) & GPIO_PIDR_PID3_MASK) - -#define GPIO_PIDR_PID4_MASK (0x10U) -#define GPIO_PIDR_PID4_SHIFT (4U) -/*! PID4 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID4_SHIFT)) & GPIO_PIDR_PID4_MASK) - -#define GPIO_PIDR_PID5_MASK (0x20U) -#define GPIO_PIDR_PID5_SHIFT (5U) -/*! PID5 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID5_SHIFT)) & GPIO_PIDR_PID5_MASK) - -#define GPIO_PIDR_PID6_MASK (0x40U) -#define GPIO_PIDR_PID6_SHIFT (6U) -/*! PID6 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID6_SHIFT)) & GPIO_PIDR_PID6_MASK) - -#define GPIO_PIDR_PID7_MASK (0x80U) -#define GPIO_PIDR_PID7_SHIFT (7U) -/*! PID7 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID7_SHIFT)) & GPIO_PIDR_PID7_MASK) - -#define GPIO_PIDR_PID8_MASK (0x100U) -#define GPIO_PIDR_PID8_SHIFT (8U) -/*! PID8 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID8_SHIFT)) & GPIO_PIDR_PID8_MASK) - -#define GPIO_PIDR_PID9_MASK (0x200U) -#define GPIO_PIDR_PID9_SHIFT (9U) -/*! PID9 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID9_SHIFT)) & GPIO_PIDR_PID9_MASK) - -#define GPIO_PIDR_PID10_MASK (0x400U) -#define GPIO_PIDR_PID10_SHIFT (10U) -/*! PID10 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID10_SHIFT)) & GPIO_PIDR_PID10_MASK) - -#define GPIO_PIDR_PID11_MASK (0x800U) -#define GPIO_PIDR_PID11_SHIFT (11U) -/*! PID11 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID11_SHIFT)) & GPIO_PIDR_PID11_MASK) - -#define GPIO_PIDR_PID12_MASK (0x1000U) -#define GPIO_PIDR_PID12_SHIFT (12U) -/*! PID12 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID12_SHIFT)) & GPIO_PIDR_PID12_MASK) - -#define GPIO_PIDR_PID13_MASK (0x2000U) -#define GPIO_PIDR_PID13_SHIFT (13U) -/*! PID13 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID13_SHIFT)) & GPIO_PIDR_PID13_MASK) - -#define GPIO_PIDR_PID14_MASK (0x4000U) -#define GPIO_PIDR_PID14_SHIFT (14U) -/*! PID14 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID14_SHIFT)) & GPIO_PIDR_PID14_MASK) - -#define GPIO_PIDR_PID15_MASK (0x8000U) -#define GPIO_PIDR_PID15_SHIFT (15U) -/*! PID15 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID15_SHIFT)) & GPIO_PIDR_PID15_MASK) - -#define GPIO_PIDR_PID16_MASK (0x10000U) -#define GPIO_PIDR_PID16_SHIFT (16U) -/*! PID16 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID16_SHIFT)) & GPIO_PIDR_PID16_MASK) - -#define GPIO_PIDR_PID17_MASK (0x20000U) -#define GPIO_PIDR_PID17_SHIFT (17U) -/*! PID17 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID17_SHIFT)) & GPIO_PIDR_PID17_MASK) - -#define GPIO_PIDR_PID18_MASK (0x40000U) -#define GPIO_PIDR_PID18_SHIFT (18U) -/*! PID18 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID18_SHIFT)) & GPIO_PIDR_PID18_MASK) - -#define GPIO_PIDR_PID19_MASK (0x80000U) -#define GPIO_PIDR_PID19_SHIFT (19U) -/*! PID19 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID19_SHIFT)) & GPIO_PIDR_PID19_MASK) - -#define GPIO_PIDR_PID20_MASK (0x100000U) -#define GPIO_PIDR_PID20_SHIFT (20U) -/*! PID20 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID20_SHIFT)) & GPIO_PIDR_PID20_MASK) - -#define GPIO_PIDR_PID21_MASK (0x200000U) -#define GPIO_PIDR_PID21_SHIFT (21U) -/*! PID21 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID21_SHIFT)) & GPIO_PIDR_PID21_MASK) - -#define GPIO_PIDR_PID22_MASK (0x400000U) -#define GPIO_PIDR_PID22_SHIFT (22U) -/*! PID22 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID22_SHIFT)) & GPIO_PIDR_PID22_MASK) - -#define GPIO_PIDR_PID23_MASK (0x800000U) -#define GPIO_PIDR_PID23_SHIFT (23U) -/*! PID23 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID23_SHIFT)) & GPIO_PIDR_PID23_MASK) - -#define GPIO_PIDR_PID24_MASK (0x1000000U) -#define GPIO_PIDR_PID24_SHIFT (24U) -/*! PID24 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID24_SHIFT)) & GPIO_PIDR_PID24_MASK) - -#define GPIO_PIDR_PID25_MASK (0x2000000U) -#define GPIO_PIDR_PID25_SHIFT (25U) -/*! PID25 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID25_SHIFT)) & GPIO_PIDR_PID25_MASK) - -#define GPIO_PIDR_PID26_MASK (0x4000000U) -#define GPIO_PIDR_PID26_SHIFT (26U) -/*! PID26 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID26_SHIFT)) & GPIO_PIDR_PID26_MASK) - -#define GPIO_PIDR_PID27_MASK (0x8000000U) -#define GPIO_PIDR_PID27_SHIFT (27U) -/*! PID27 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID27_SHIFT)) & GPIO_PIDR_PID27_MASK) - -#define GPIO_PIDR_PID28_MASK (0x10000000U) -#define GPIO_PIDR_PID28_SHIFT (28U) -/*! PID28 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID28_SHIFT)) & GPIO_PIDR_PID28_MASK) - -#define GPIO_PIDR_PID29_MASK (0x20000000U) -#define GPIO_PIDR_PID29_SHIFT (29U) -/*! PID29 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID29_SHIFT)) & GPIO_PIDR_PID29_MASK) - -#define GPIO_PIDR_PID30_MASK (0x40000000U) -#define GPIO_PIDR_PID30_SHIFT (30U) -/*! PID30 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID30_SHIFT)) & GPIO_PIDR_PID30_MASK) - -#define GPIO_PIDR_PID31_MASK (0x80000000U) -#define GPIO_PIDR_PID31_SHIFT (31U) -/*! PID31 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID31_SHIFT)) & GPIO_PIDR_PID31_MASK) -/*! @} */ - -/*! @name PDR - Pin Data */ -/*! @{ */ - -#define GPIO_PDR_PD_MASK (0x1U) -#define GPIO_PDR_PD_SHIFT (0U) -/*! PD - Pin Data (I/O) - * 0b0..Logic zero - * 0b1..Logic one - */ -#define GPIO_PDR_PD(x) (((uint8_t)(((uint8_t)(x)) << GPIO_PDR_PD_SHIFT)) & GPIO_PDR_PD_MASK) -/*! @} */ - -/* The count of GPIO_PDR */ -#define GPIO_PDR_COUNT (32U) - -/*! @name ICR - Interrupt Control 0..Interrupt Control 31 */ -/*! @{ */ - -#define GPIO_ICR_IRQC_MASK (0xF0000U) -#define GPIO_ICR_IRQC_SHIFT (16U) -/*! IRQC - Interrupt Configuration - * 0b0000..ISF is disabled - * 0b0001..ISF and DMA request on rising edge - * 0b0010..ISF and DMA request on falling edge - * 0b0011..ISF and DMA request on either edge - * 0b0100..Reserved - * 0b0101..ISF sets on rising edge - * 0b0110..ISF sets on falling edge - * 0b0111..ISF sets on either edge - * 0b1000..ISF and interrupt when logic 0 - * 0b1001..ISF and interrupt on rising edge - * 0b1010..ISF and interrupt on falling edge - * 0b1011..ISF and Interrupt on either edge - * 0b1100..ISF and interrupt when logic 1 - * 0b1101..Enable active-high trigger output; ISF on rising edge (pin state is ORed with other enabled triggers - * to generate the output trigger for use by other peripherals) - * 0b1110..Enable active-low trigger output; ISF on falling edge (pin state is inverted and ORed with other - * enabled triggers to generate the output trigger for use by other peripherals) - * 0b1111..Reserved - */ -#define GPIO_ICR_IRQC(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ICR_IRQC_SHIFT)) & GPIO_ICR_IRQC_MASK) - -#define GPIO_ICR_IRQS_MASK (0x100000U) -#define GPIO_ICR_IRQS_SHIFT (20U) -/*! IRQS - Interrupt Select - * 0b0..Interrupt, trigger output, or DMA request 0 - * 0b1..Interrupt, trigger output, or DMA request 1 - */ -#define GPIO_ICR_IRQS(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ICR_IRQS_SHIFT)) & GPIO_ICR_IRQS_MASK) - -#define GPIO_ICR_LK_MASK (0x800000U) -#define GPIO_ICR_LK_SHIFT (23U) -/*! LK - Lock - * 0b0..Lock - * 0b1..Do not lock - */ -#define GPIO_ICR_LK(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ICR_LK_SHIFT)) & GPIO_ICR_LK_MASK) - -#define GPIO_ICR_ISF_MASK (0x1000000U) -#define GPIO_ICR_ISF_SHIFT (24U) -/*! ISF - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ICR_ISF(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ICR_ISF_SHIFT)) & GPIO_ICR_ISF_MASK) -/*! @} */ - -/* The count of GPIO_ICR */ -#define GPIO_ICR_COUNT (32U) - -/*! @name GICLR - Global Interrupt Control Low */ -/*! @{ */ - -#define GPIO_GICLR_GIWE0_MASK (0x1U) -#define GPIO_GICLR_GIWE0_SHIFT (0U) -/*! GIWE0 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE0_SHIFT)) & GPIO_GICLR_GIWE0_MASK) - -#define GPIO_GICLR_GIWE1_MASK (0x2U) -#define GPIO_GICLR_GIWE1_SHIFT (1U) -/*! GIWE1 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE1_SHIFT)) & GPIO_GICLR_GIWE1_MASK) - -#define GPIO_GICLR_GIWE2_MASK (0x4U) -#define GPIO_GICLR_GIWE2_SHIFT (2U) -/*! GIWE2 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE2_SHIFT)) & GPIO_GICLR_GIWE2_MASK) - -#define GPIO_GICLR_GIWE3_MASK (0x8U) -#define GPIO_GICLR_GIWE3_SHIFT (3U) -/*! GIWE3 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE3_SHIFT)) & GPIO_GICLR_GIWE3_MASK) - -#define GPIO_GICLR_GIWE4_MASK (0x10U) -#define GPIO_GICLR_GIWE4_SHIFT (4U) -/*! GIWE4 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE4_SHIFT)) & GPIO_GICLR_GIWE4_MASK) - -#define GPIO_GICLR_GIWE5_MASK (0x20U) -#define GPIO_GICLR_GIWE5_SHIFT (5U) -/*! GIWE5 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE5_SHIFT)) & GPIO_GICLR_GIWE5_MASK) - -#define GPIO_GICLR_GIWE6_MASK (0x40U) -#define GPIO_GICLR_GIWE6_SHIFT (6U) -/*! GIWE6 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE6_SHIFT)) & GPIO_GICLR_GIWE6_MASK) - -#define GPIO_GICLR_GIWE7_MASK (0x80U) -#define GPIO_GICLR_GIWE7_SHIFT (7U) -/*! GIWE7 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE7_SHIFT)) & GPIO_GICLR_GIWE7_MASK) - -#define GPIO_GICLR_GIWE8_MASK (0x100U) -#define GPIO_GICLR_GIWE8_SHIFT (8U) -/*! GIWE8 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE8_SHIFT)) & GPIO_GICLR_GIWE8_MASK) - -#define GPIO_GICLR_GIWE9_MASK (0x200U) -#define GPIO_GICLR_GIWE9_SHIFT (9U) -/*! GIWE9 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE9_SHIFT)) & GPIO_GICLR_GIWE9_MASK) - -#define GPIO_GICLR_GIWE10_MASK (0x400U) -#define GPIO_GICLR_GIWE10_SHIFT (10U) -/*! GIWE10 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE10_SHIFT)) & GPIO_GICLR_GIWE10_MASK) - -#define GPIO_GICLR_GIWE11_MASK (0x800U) -#define GPIO_GICLR_GIWE11_SHIFT (11U) -/*! GIWE11 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE11_SHIFT)) & GPIO_GICLR_GIWE11_MASK) - -#define GPIO_GICLR_GIWE12_MASK (0x1000U) -#define GPIO_GICLR_GIWE12_SHIFT (12U) -/*! GIWE12 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE12_SHIFT)) & GPIO_GICLR_GIWE12_MASK) - -#define GPIO_GICLR_GIWE13_MASK (0x2000U) -#define GPIO_GICLR_GIWE13_SHIFT (13U) -/*! GIWE13 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE13_SHIFT)) & GPIO_GICLR_GIWE13_MASK) - -#define GPIO_GICLR_GIWE14_MASK (0x4000U) -#define GPIO_GICLR_GIWE14_SHIFT (14U) -/*! GIWE14 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE14_SHIFT)) & GPIO_GICLR_GIWE14_MASK) - -#define GPIO_GICLR_GIWE15_MASK (0x8000U) -#define GPIO_GICLR_GIWE15_SHIFT (15U) -/*! GIWE15 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE15_SHIFT)) & GPIO_GICLR_GIWE15_MASK) - -#define GPIO_GICLR_GIWD_MASK (0xFFFF0000U) -#define GPIO_GICLR_GIWD_SHIFT (16U) -/*! GIWD - Global Interrupt Write Data */ -#define GPIO_GICLR_GIWD(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWD_SHIFT)) & GPIO_GICLR_GIWD_MASK) -/*! @} */ - -/*! @name GICHR - Global Interrupt Control High */ -/*! @{ */ - -#define GPIO_GICHR_GIWE16_MASK (0x1U) -#define GPIO_GICHR_GIWE16_SHIFT (0U) -/*! GIWE16 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE16_SHIFT)) & GPIO_GICHR_GIWE16_MASK) - -#define GPIO_GICHR_GIWE17_MASK (0x2U) -#define GPIO_GICHR_GIWE17_SHIFT (1U) -/*! GIWE17 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE17_SHIFT)) & GPIO_GICHR_GIWE17_MASK) - -#define GPIO_GICHR_GIWE18_MASK (0x4U) -#define GPIO_GICHR_GIWE18_SHIFT (2U) -/*! GIWE18 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE18_SHIFT)) & GPIO_GICHR_GIWE18_MASK) - -#define GPIO_GICHR_GIWE19_MASK (0x8U) -#define GPIO_GICHR_GIWE19_SHIFT (3U) -/*! GIWE19 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE19_SHIFT)) & GPIO_GICHR_GIWE19_MASK) - -#define GPIO_GICHR_GIWE20_MASK (0x10U) -#define GPIO_GICHR_GIWE20_SHIFT (4U) -/*! GIWE20 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE20_SHIFT)) & GPIO_GICHR_GIWE20_MASK) - -#define GPIO_GICHR_GIWE21_MASK (0x20U) -#define GPIO_GICHR_GIWE21_SHIFT (5U) -/*! GIWE21 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE21_SHIFT)) & GPIO_GICHR_GIWE21_MASK) - -#define GPIO_GICHR_GIWE22_MASK (0x40U) -#define GPIO_GICHR_GIWE22_SHIFT (6U) -/*! GIWE22 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE22_SHIFT)) & GPIO_GICHR_GIWE22_MASK) - -#define GPIO_GICHR_GIWE23_MASK (0x80U) -#define GPIO_GICHR_GIWE23_SHIFT (7U) -/*! GIWE23 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE23_SHIFT)) & GPIO_GICHR_GIWE23_MASK) - -#define GPIO_GICHR_GIWE24_MASK (0x100U) -#define GPIO_GICHR_GIWE24_SHIFT (8U) -/*! GIWE24 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE24_SHIFT)) & GPIO_GICHR_GIWE24_MASK) - -#define GPIO_GICHR_GIWE25_MASK (0x200U) -#define GPIO_GICHR_GIWE25_SHIFT (9U) -/*! GIWE25 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE25_SHIFT)) & GPIO_GICHR_GIWE25_MASK) - -#define GPIO_GICHR_GIWE26_MASK (0x400U) -#define GPIO_GICHR_GIWE26_SHIFT (10U) -/*! GIWE26 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE26_SHIFT)) & GPIO_GICHR_GIWE26_MASK) - -#define GPIO_GICHR_GIWE27_MASK (0x800U) -#define GPIO_GICHR_GIWE27_SHIFT (11U) -/*! GIWE27 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE27_SHIFT)) & GPIO_GICHR_GIWE27_MASK) - -#define GPIO_GICHR_GIWE28_MASK (0x1000U) -#define GPIO_GICHR_GIWE28_SHIFT (12U) -/*! GIWE28 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE28_SHIFT)) & GPIO_GICHR_GIWE28_MASK) - -#define GPIO_GICHR_GIWE29_MASK (0x2000U) -#define GPIO_GICHR_GIWE29_SHIFT (13U) -/*! GIWE29 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE29_SHIFT)) & GPIO_GICHR_GIWE29_MASK) - -#define GPIO_GICHR_GIWE30_MASK (0x4000U) -#define GPIO_GICHR_GIWE30_SHIFT (14U) -/*! GIWE30 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE30_SHIFT)) & GPIO_GICHR_GIWE30_MASK) - -#define GPIO_GICHR_GIWE31_MASK (0x8000U) -#define GPIO_GICHR_GIWE31_SHIFT (15U) -/*! GIWE31 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE31_SHIFT)) & GPIO_GICHR_GIWE31_MASK) - -#define GPIO_GICHR_GIWD_MASK (0xFFFF0000U) -#define GPIO_GICHR_GIWD_SHIFT (16U) -/*! GIWD - Global Interrupt Write Data */ -#define GPIO_GICHR_GIWD(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWD_SHIFT)) & GPIO_GICHR_GIWD_MASK) -/*! @} */ - -/*! @name ISFR - Interrupt Status Flag */ -/*! @{ */ - -#define GPIO_ISFR_ISF0_MASK (0x1U) -#define GPIO_ISFR_ISF0_SHIFT (0U) -/*! ISF0 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF0_SHIFT)) & GPIO_ISFR_ISF0_MASK) - -#define GPIO_ISFR_ISF1_MASK (0x2U) -#define GPIO_ISFR_ISF1_SHIFT (1U) -/*! ISF1 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF1_SHIFT)) & GPIO_ISFR_ISF1_MASK) - -#define GPIO_ISFR_ISF2_MASK (0x4U) -#define GPIO_ISFR_ISF2_SHIFT (2U) -/*! ISF2 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF2_SHIFT)) & GPIO_ISFR_ISF2_MASK) - -#define GPIO_ISFR_ISF3_MASK (0x8U) -#define GPIO_ISFR_ISF3_SHIFT (3U) -/*! ISF3 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF3_SHIFT)) & GPIO_ISFR_ISF3_MASK) - -#define GPIO_ISFR_ISF4_MASK (0x10U) -#define GPIO_ISFR_ISF4_SHIFT (4U) -/*! ISF4 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF4_SHIFT)) & GPIO_ISFR_ISF4_MASK) - -#define GPIO_ISFR_ISF5_MASK (0x20U) -#define GPIO_ISFR_ISF5_SHIFT (5U) -/*! ISF5 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF5_SHIFT)) & GPIO_ISFR_ISF5_MASK) - -#define GPIO_ISFR_ISF6_MASK (0x40U) -#define GPIO_ISFR_ISF6_SHIFT (6U) -/*! ISF6 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF6_SHIFT)) & GPIO_ISFR_ISF6_MASK) - -#define GPIO_ISFR_ISF7_MASK (0x80U) -#define GPIO_ISFR_ISF7_SHIFT (7U) -/*! ISF7 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF7_SHIFT)) & GPIO_ISFR_ISF7_MASK) - -#define GPIO_ISFR_ISF8_MASK (0x100U) -#define GPIO_ISFR_ISF8_SHIFT (8U) -/*! ISF8 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF8_SHIFT)) & GPIO_ISFR_ISF8_MASK) - -#define GPIO_ISFR_ISF9_MASK (0x200U) -#define GPIO_ISFR_ISF9_SHIFT (9U) -/*! ISF9 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF9_SHIFT)) & GPIO_ISFR_ISF9_MASK) - -#define GPIO_ISFR_ISF10_MASK (0x400U) -#define GPIO_ISFR_ISF10_SHIFT (10U) -/*! ISF10 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF10_SHIFT)) & GPIO_ISFR_ISF10_MASK) - -#define GPIO_ISFR_ISF11_MASK (0x800U) -#define GPIO_ISFR_ISF11_SHIFT (11U) -/*! ISF11 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF11_SHIFT)) & GPIO_ISFR_ISF11_MASK) - -#define GPIO_ISFR_ISF12_MASK (0x1000U) -#define GPIO_ISFR_ISF12_SHIFT (12U) -/*! ISF12 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF12_SHIFT)) & GPIO_ISFR_ISF12_MASK) - -#define GPIO_ISFR_ISF13_MASK (0x2000U) -#define GPIO_ISFR_ISF13_SHIFT (13U) -/*! ISF13 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF13_SHIFT)) & GPIO_ISFR_ISF13_MASK) - -#define GPIO_ISFR_ISF14_MASK (0x4000U) -#define GPIO_ISFR_ISF14_SHIFT (14U) -/*! ISF14 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF14_SHIFT)) & GPIO_ISFR_ISF14_MASK) - -#define GPIO_ISFR_ISF15_MASK (0x8000U) -#define GPIO_ISFR_ISF15_SHIFT (15U) -/*! ISF15 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF15_SHIFT)) & GPIO_ISFR_ISF15_MASK) - -#define GPIO_ISFR_ISF16_MASK (0x10000U) -#define GPIO_ISFR_ISF16_SHIFT (16U) -/*! ISF16 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF16_SHIFT)) & GPIO_ISFR_ISF16_MASK) - -#define GPIO_ISFR_ISF17_MASK (0x20000U) -#define GPIO_ISFR_ISF17_SHIFT (17U) -/*! ISF17 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF17_SHIFT)) & GPIO_ISFR_ISF17_MASK) - -#define GPIO_ISFR_ISF18_MASK (0x40000U) -#define GPIO_ISFR_ISF18_SHIFT (18U) -/*! ISF18 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF18_SHIFT)) & GPIO_ISFR_ISF18_MASK) - -#define GPIO_ISFR_ISF19_MASK (0x80000U) -#define GPIO_ISFR_ISF19_SHIFT (19U) -/*! ISF19 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF19_SHIFT)) & GPIO_ISFR_ISF19_MASK) - -#define GPIO_ISFR_ISF20_MASK (0x100000U) -#define GPIO_ISFR_ISF20_SHIFT (20U) -/*! ISF20 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF20_SHIFT)) & GPIO_ISFR_ISF20_MASK) - -#define GPIO_ISFR_ISF21_MASK (0x200000U) -#define GPIO_ISFR_ISF21_SHIFT (21U) -/*! ISF21 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF21_SHIFT)) & GPIO_ISFR_ISF21_MASK) - -#define GPIO_ISFR_ISF22_MASK (0x400000U) -#define GPIO_ISFR_ISF22_SHIFT (22U) -/*! ISF22 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF22_SHIFT)) & GPIO_ISFR_ISF22_MASK) - -#define GPIO_ISFR_ISF23_MASK (0x800000U) -#define GPIO_ISFR_ISF23_SHIFT (23U) -/*! ISF23 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF23_SHIFT)) & GPIO_ISFR_ISF23_MASK) - -#define GPIO_ISFR_ISF24_MASK (0x1000000U) -#define GPIO_ISFR_ISF24_SHIFT (24U) -/*! ISF24 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF24_SHIFT)) & GPIO_ISFR_ISF24_MASK) - -#define GPIO_ISFR_ISF25_MASK (0x2000000U) -#define GPIO_ISFR_ISF25_SHIFT (25U) -/*! ISF25 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF25_SHIFT)) & GPIO_ISFR_ISF25_MASK) - -#define GPIO_ISFR_ISF26_MASK (0x4000000U) -#define GPIO_ISFR_ISF26_SHIFT (26U) -/*! ISF26 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF26_SHIFT)) & GPIO_ISFR_ISF26_MASK) - -#define GPIO_ISFR_ISF27_MASK (0x8000000U) -#define GPIO_ISFR_ISF27_SHIFT (27U) -/*! ISF27 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF27_SHIFT)) & GPIO_ISFR_ISF27_MASK) - -#define GPIO_ISFR_ISF28_MASK (0x10000000U) -#define GPIO_ISFR_ISF28_SHIFT (28U) -/*! ISF28 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF28_SHIFT)) & GPIO_ISFR_ISF28_MASK) - -#define GPIO_ISFR_ISF29_MASK (0x20000000U) -#define GPIO_ISFR_ISF29_SHIFT (29U) -/*! ISF29 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF29_SHIFT)) & GPIO_ISFR_ISF29_MASK) - -#define GPIO_ISFR_ISF30_MASK (0x40000000U) -#define GPIO_ISFR_ISF30_SHIFT (30U) -/*! ISF30 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF30_SHIFT)) & GPIO_ISFR_ISF30_MASK) - -#define GPIO_ISFR_ISF31_MASK (0x80000000U) -#define GPIO_ISFR_ISF31_SHIFT (31U) -/*! ISF31 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF31_SHIFT)) & GPIO_ISFR_ISF31_MASK) -/*! @} */ - -/* The count of GPIO_ISFR */ -#define GPIO_ISFR_COUNT (2U) - - -/*! - * @} - */ /* end of group GPIO_Register_Masks */ - - -/* GPIO - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral GPIO0 base address */ - #define GPIO0_BASE (0x50096000u) - /** Peripheral GPIO0 base address */ - #define GPIO0_BASE_NS (0x40096000u) - /** Peripheral GPIO0 base pointer */ - #define GPIO0 ((GPIO_Type *)GPIO0_BASE) - /** Peripheral GPIO0 base pointer */ - #define GPIO0_NS ((GPIO_Type *)GPIO0_BASE_NS) - /** Peripheral GPIO0_ALIAS1 base address */ - #define GPIO0_ALIAS1_BASE (0x50097000u) - /** Peripheral GPIO0_ALIAS1 base address */ - #define GPIO0_ALIAS1_BASE_NS (0x40097000u) - /** Peripheral GPIO0_ALIAS1 base pointer */ - #define GPIO0_ALIAS1 ((GPIO_Type *)GPIO0_ALIAS1_BASE) - /** Peripheral GPIO0_ALIAS1 base pointer */ - #define GPIO0_ALIAS1_NS ((GPIO_Type *)GPIO0_ALIAS1_BASE_NS) - /** Peripheral GPIO1 base address */ - #define GPIO1_BASE (0x50098000u) - /** Peripheral GPIO1 base address */ - #define GPIO1_BASE_NS (0x40098000u) - /** Peripheral GPIO1 base pointer */ - #define GPIO1 ((GPIO_Type *)GPIO1_BASE) - /** Peripheral GPIO1 base pointer */ - #define GPIO1_NS ((GPIO_Type *)GPIO1_BASE_NS) - /** Peripheral GPIO1_ALIAS1 base address */ - #define GPIO1_ALIAS1_BASE (0x50099000u) - /** Peripheral GPIO1_ALIAS1 base address */ - #define GPIO1_ALIAS1_BASE_NS (0x40099000u) - /** Peripheral GPIO1_ALIAS1 base pointer */ - #define GPIO1_ALIAS1 ((GPIO_Type *)GPIO1_ALIAS1_BASE) - /** Peripheral GPIO1_ALIAS1 base pointer */ - #define GPIO1_ALIAS1_NS ((GPIO_Type *)GPIO1_ALIAS1_BASE_NS) - /** Peripheral GPIO2 base address */ - #define GPIO2_BASE (0x5009A000u) - /** Peripheral GPIO2 base address */ - #define GPIO2_BASE_NS (0x4009A000u) - /** Peripheral GPIO2 base pointer */ - #define GPIO2 ((GPIO_Type *)GPIO2_BASE) - /** Peripheral GPIO2 base pointer */ - #define GPIO2_NS ((GPIO_Type *)GPIO2_BASE_NS) - /** Peripheral GPIO2_ALIAS1 base address */ - #define GPIO2_ALIAS1_BASE (0x5009B000u) - /** Peripheral GPIO2_ALIAS1 base address */ - #define GPIO2_ALIAS1_BASE_NS (0x4009B000u) - /** Peripheral GPIO2_ALIAS1 base pointer */ - #define GPIO2_ALIAS1 ((GPIO_Type *)GPIO2_ALIAS1_BASE) - /** Peripheral GPIO2_ALIAS1 base pointer */ - #define GPIO2_ALIAS1_NS ((GPIO_Type *)GPIO2_ALIAS1_BASE_NS) - /** Peripheral GPIO3 base address */ - #define GPIO3_BASE (0x5009C000u) - /** Peripheral GPIO3 base address */ - #define GPIO3_BASE_NS (0x4009C000u) - /** Peripheral GPIO3 base pointer */ - #define GPIO3 ((GPIO_Type *)GPIO3_BASE) - /** Peripheral GPIO3 base pointer */ - #define GPIO3_NS ((GPIO_Type *)GPIO3_BASE_NS) - /** Peripheral GPIO3_ALIAS1 base address */ - #define GPIO3_ALIAS1_BASE (0x5009D000u) - /** Peripheral GPIO3_ALIAS1 base address */ - #define GPIO3_ALIAS1_BASE_NS (0x4009D000u) - /** Peripheral GPIO3_ALIAS1 base pointer */ - #define GPIO3_ALIAS1 ((GPIO_Type *)GPIO3_ALIAS1_BASE) - /** Peripheral GPIO3_ALIAS1 base pointer */ - #define GPIO3_ALIAS1_NS ((GPIO_Type *)GPIO3_ALIAS1_BASE_NS) - /** Peripheral GPIO4 base address */ - #define GPIO4_BASE (0x5009E000u) - /** Peripheral GPIO4 base address */ - #define GPIO4_BASE_NS (0x4009E000u) - /** Peripheral GPIO4 base pointer */ - #define GPIO4 ((GPIO_Type *)GPIO4_BASE) - /** Peripheral GPIO4 base pointer */ - #define GPIO4_NS ((GPIO_Type *)GPIO4_BASE_NS) - /** Peripheral GPIO4_ALIAS1 base address */ - #define GPIO4_ALIAS1_BASE (0x5009F000u) - /** Peripheral GPIO4_ALIAS1 base address */ - #define GPIO4_ALIAS1_BASE_NS (0x4009F000u) - /** Peripheral GPIO4_ALIAS1 base pointer */ - #define GPIO4_ALIAS1 ((GPIO_Type *)GPIO4_ALIAS1_BASE) - /** Peripheral GPIO4_ALIAS1 base pointer */ - #define GPIO4_ALIAS1_NS ((GPIO_Type *)GPIO4_ALIAS1_BASE_NS) - /** Peripheral GPIO5 base address */ - #define GPIO5_BASE (0x50040000u) - /** Peripheral GPIO5 base address */ - #define GPIO5_BASE_NS (0x40040000u) - /** Peripheral GPIO5 base pointer */ - #define GPIO5 ((GPIO_Type *)GPIO5_BASE) - /** Peripheral GPIO5 base pointer */ - #define GPIO5_NS ((GPIO_Type *)GPIO5_BASE_NS) - /** Peripheral GPIO5_ALIAS1 base address */ - #define GPIO5_ALIAS1_BASE (0x50041000u) - /** Peripheral GPIO5_ALIAS1 base address */ - #define GPIO5_ALIAS1_BASE_NS (0x40041000u) - /** Peripheral GPIO5_ALIAS1 base pointer */ - #define GPIO5_ALIAS1 ((GPIO_Type *)GPIO5_ALIAS1_BASE) - /** Peripheral GPIO5_ALIAS1 base pointer */ - #define GPIO5_ALIAS1_NS ((GPIO_Type *)GPIO5_ALIAS1_BASE_NS) - /** Array initializer of GPIO peripheral base addresses */ - #define GPIO_BASE_ADDRS { GPIO0_BASE, GPIO1_BASE, GPIO2_BASE, GPIO3_BASE, GPIO4_BASE, GPIO5_BASE } - #define GPIO_ALIAS1_BASE_ADDRS { GPIO0_ALIAS1_BASE, GPIO1_ALIAS1_BASE, GPIO2_ALIAS1_BASE, GPIO3_ALIAS1_BASE, GPIO4_ALIAS1_BASE, GPIO5_ALIAS1_BASE } - /** Array initializer of GPIO peripheral base pointers */ - #define GPIO_BASE_PTRS { GPIO0, GPIO1, GPIO2, GPIO3, GPIO4, GPIO5 } - #define GPIO_ALIAS1_BASE_PTRS { GPIO0_ALIAS1, GPIO1_ALIAS1, GPIO2_ALIAS1, GPIO3_ALIAS1, GPIO4_ALIAS1, GPIO5_ALIAS1 } - /** Array initializer of GPIO peripheral base addresses */ - #define GPIO_BASE_ADDRS_NS { GPIO0_BASE_NS, GPIO1_BASE_NS, GPIO2_BASE_NS, GPIO3_BASE_NS, GPIO4_BASE_NS, GPIO5_BASE_NS } - #define GPIO_ALIAS1_BASE_ADDRS_NS { GPIO0_ALIAS1_BASE_NS, GPIO1_ALIAS1_BASE_NS, GPIO2_ALIAS1_BASE_NS, GPIO3_ALIAS1_BASE_NS, GPIO4_ALIAS1_BASE_NS, GPIO5_ALIAS1_BASE_NS } - /** Array initializer of GPIO peripheral base pointers */ - #define GPIO_BASE_PTRS_NS { GPIO0_NS, GPIO1_NS, GPIO2_NS, GPIO3_NS, GPIO4_NS, GPIO5_NS } - #define GPIO_ALIAS1_BASE_PTRS_NS { GPIO0_ALIAS1_NS, GPIO1_ALIAS1_NS, GPIO2_ALIAS1_NS, GPIO3_ALIAS1_NS, GPIO4_ALIAS1_NS, GPIO5_ALIAS1_NS } -#else - /** Peripheral GPIO0 base address */ - #define GPIO0_BASE (0x40096000u) - /** Peripheral GPIO0 base pointer */ - #define GPIO0 ((GPIO_Type *)GPIO0_BASE) - /** Peripheral GPIO0_ALIAS1 base address */ - #define GPIO0_ALIAS1_BASE (0x40097000u) - /** Peripheral GPIO0_ALIAS1 base pointer */ - #define GPIO0_ALIAS1 ((GPIO_Type *)GPIO0_ALIAS1_BASE) - /** Peripheral GPIO1 base address */ - #define GPIO1_BASE (0x40098000u) - /** Peripheral GPIO1 base pointer */ - #define GPIO1 ((GPIO_Type *)GPIO1_BASE) - /** Peripheral GPIO1_ALIAS1 base address */ - #define GPIO1_ALIAS1_BASE (0x40099000u) - /** Peripheral GPIO1_ALIAS1 base pointer */ - #define GPIO1_ALIAS1 ((GPIO_Type *)GPIO1_ALIAS1_BASE) - /** Peripheral GPIO2 base address */ - #define GPIO2_BASE (0x4009A000u) - /** Peripheral GPIO2 base pointer */ - #define GPIO2 ((GPIO_Type *)GPIO2_BASE) - /** Peripheral GPIO2_ALIAS1 base address */ - #define GPIO2_ALIAS1_BASE (0x4009B000u) - /** Peripheral GPIO2_ALIAS1 base pointer */ - #define GPIO2_ALIAS1 ((GPIO_Type *)GPIO2_ALIAS1_BASE) - /** Peripheral GPIO3 base address */ - #define GPIO3_BASE (0x4009C000u) - /** Peripheral GPIO3 base pointer */ - #define GPIO3 ((GPIO_Type *)GPIO3_BASE) - /** Peripheral GPIO3_ALIAS1 base address */ - #define GPIO3_ALIAS1_BASE (0x4009D000u) - /** Peripheral GPIO3_ALIAS1 base pointer */ - #define GPIO3_ALIAS1 ((GPIO_Type *)GPIO3_ALIAS1_BASE) - /** Peripheral GPIO4 base address */ - #define GPIO4_BASE (0x4009E000u) - /** Peripheral GPIO4 base pointer */ - #define GPIO4 ((GPIO_Type *)GPIO4_BASE) - /** Peripheral GPIO4_ALIAS1 base address */ - #define GPIO4_ALIAS1_BASE (0x4009F000u) - /** Peripheral GPIO4_ALIAS1 base pointer */ - #define GPIO4_ALIAS1 ((GPIO_Type *)GPIO4_ALIAS1_BASE) - /** Peripheral GPIO5 base address */ - #define GPIO5_BASE (0x40040000u) - /** Peripheral GPIO5 base pointer */ - #define GPIO5 ((GPIO_Type *)GPIO5_BASE) - /** Peripheral GPIO5_ALIAS1 base address */ - #define GPIO5_ALIAS1_BASE (0x40041000u) - /** Peripheral GPIO5_ALIAS1 base pointer */ - #define GPIO5_ALIAS1 ((GPIO_Type *)GPIO5_ALIAS1_BASE) - /** Array initializer of GPIO peripheral base addresses */ - #define GPIO_BASE_ADDRS { GPIO0_BASE, GPIO1_BASE, GPIO2_BASE, GPIO3_BASE, GPIO4_BASE, GPIO5_BASE } - #define GPIO_ALIAS1_BASE_ADDRS { GPIO0_ALIAS1_BASE, GPIO1_ALIAS1_BASE, GPIO2_ALIAS1_BASE, GPIO3_ALIAS1_BASE, GPIO4_ALIAS1_BASE, GPIO5_ALIAS1_BASE } - /** Array initializer of GPIO peripheral base pointers */ - #define GPIO_BASE_PTRS { GPIO0, GPIO1, GPIO2, GPIO3, GPIO4, GPIO5 } - #define GPIO_ALIAS1_BASE_PTRS { GPIO0_ALIAS1, GPIO1_ALIAS1, GPIO2_ALIAS1, GPIO3_ALIAS1, GPIO4_ALIAS1, GPIO5_ALIAS1 } -#endif -/* Interrupt vectors for the GPIO peripheral type */ -#define GPIO_IRQS {GPIO00_IRQn, GPIO10_IRQn, GPIO20_IRQn, GPIO30_IRQn,GPIO40_IRQn,GPIO50_IRQn} -#define GPIO_IRQS_1 {GPIO01_IRQn, GPIO11_IRQn, GPIO21_IRQn, GPIO31_IRQn,GPIO41_IRQn,GPIO51_IRQn} - - -/*! - * @} - */ /* end of group GPIO_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- HPDAC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup HPDAC_Peripheral_Access_Layer HPDAC Peripheral Access Layer - * @{ - */ - -/** HPDAC - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version Identifier, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - __O uint32_t DATA; /**< Data, offset: 0x8 */ - __IO uint32_t GCR; /**< Global Control, offset: 0xC */ - __IO uint32_t FCR; /**< DAC FIFO Control, offset: 0x10 */ - __I uint32_t FPR; /**< DAC FIFO Pointer, offset: 0x14 */ - __IO uint32_t FSR; /**< FIFO Status, offset: 0x18 */ - __IO uint32_t IER; /**< Interrupt Enable, offset: 0x1C */ - __IO uint32_t DER; /**< DMA Enable, offset: 0x20 */ - __IO uint32_t RCR; /**< Reset Control, offset: 0x24 */ - __O uint32_t TCR; /**< Trigger Control, offset: 0x28 */ - __IO uint32_t PCR; /**< Periodic Trigger Control, offset: 0x2C */ -} HPDAC_Type; - -/* ---------------------------------------------------------------------------- - -- HPDAC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup HPDAC_Register_Masks HPDAC Register Masks - * @{ - */ - -/*! @name VERID - Version Identifier */ -/*! @{ */ - -#define HPDAC_VERID_FEATURE_MASK (0xFFFFU) -#define HPDAC_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Identification Number */ -#define HPDAC_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_VERID_FEATURE_SHIFT)) & HPDAC_VERID_FEATURE_MASK) - -#define HPDAC_VERID_MINOR_MASK (0xFF0000U) -#define HPDAC_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define HPDAC_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_VERID_MINOR_SHIFT)) & HPDAC_VERID_MINOR_MASK) - -#define HPDAC_VERID_MAJOR_MASK (0xFF000000U) -#define HPDAC_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define HPDAC_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_VERID_MAJOR_SHIFT)) & HPDAC_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define HPDAC_PARAM_FIFOSZ_MASK (0x7U) -#define HPDAC_PARAM_FIFOSZ_SHIFT (0U) -/*! FIFOSZ - FIFO Size - * 0b000..Reserved - * 0b001..FIFO depth is 4 - * 0b010..FIFO depth is 8 - * 0b011..FIFO depth is 16 - * 0b100..FIFO depth is 32 - * 0b101..FIFO depth is 64 - * 0b110..FIFO depth is 128 - * 0b111..FIFO depth is 256 - */ -#define HPDAC_PARAM_FIFOSZ(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_PARAM_FIFOSZ_SHIFT)) & HPDAC_PARAM_FIFOSZ_MASK) -/*! @} */ - -/*! @name DATA - Data */ -/*! @{ */ - -#define HPDAC_DATA_DATA_MASK (0x3FFFU) -#define HPDAC_DATA_DATA_SHIFT (0U) -/*! DATA - FIFO Entry or Buffer Entry */ -#define HPDAC_DATA_DATA(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_DATA_DATA_SHIFT)) & HPDAC_DATA_DATA_MASK) -/*! @} */ - -/*! @name GCR - Global Control */ -/*! @{ */ - -#define HPDAC_GCR_DACEN_MASK (0x1U) -#define HPDAC_GCR_DACEN_SHIFT (0U) -/*! DACEN - DAC Enable - * 0b0..Disables - * 0b1..Enables - */ -#define HPDAC_GCR_DACEN(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_GCR_DACEN_SHIFT)) & HPDAC_GCR_DACEN_MASK) - -#define HPDAC_GCR_FIFOEN_MASK (0x8U) -#define HPDAC_GCR_FIFOEN_SHIFT (3U) -/*! FIFOEN - FIFO Enable - * 0b0..Enables FIFO mode and disables Buffer mode. Any data written to DATA[DATA] goes to buffer then goes to conversion. - * 0b1..Enables FIFO mode. Data will be first read from FIFO to buffer and then goes to conversion. - */ -#define HPDAC_GCR_FIFOEN(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_GCR_FIFOEN_SHIFT)) & HPDAC_GCR_FIFOEN_MASK) - -#define HPDAC_GCR_SWMD_MASK (0x10U) -#define HPDAC_GCR_SWMD_SHIFT (4U) -/*! SWMD - Swing Back Mode - * 0b0..Disables - * 0b1..Enables - */ -#define HPDAC_GCR_SWMD(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_GCR_SWMD_SHIFT)) & HPDAC_GCR_SWMD_MASK) - -#define HPDAC_GCR_TRGSEL_MASK (0x20U) -#define HPDAC_GCR_TRGSEL_SHIFT (5U) -/*! TRGSEL - DAC Trigger Select - * 0b0..Hardware trigger - * 0b1..Software trigger - */ -#define HPDAC_GCR_TRGSEL(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_GCR_TRGSEL_SHIFT)) & HPDAC_GCR_TRGSEL_MASK) - -#define HPDAC_GCR_PTGEN_MASK (0x40U) -#define HPDAC_GCR_PTGEN_SHIFT (6U) -/*! PTGEN - DAC Periodic Trigger Mode Enable - * 0b0..Disables - * 0b1..Enables - */ -#define HPDAC_GCR_PTGEN(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_GCR_PTGEN_SHIFT)) & HPDAC_GCR_PTGEN_MASK) - -#define HPDAC_GCR_BUF_EN_MASK (0x20000U) -#define HPDAC_GCR_BUF_EN_SHIFT (17U) -/*! BUF_EN - Buffer Enable - * 0b0..Not used - * 0b1..Used - */ -#define HPDAC_GCR_BUF_EN(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_GCR_BUF_EN_SHIFT)) & HPDAC_GCR_BUF_EN_MASK) -/*! @} */ - -/*! @name FCR - DAC FIFO Control */ -/*! @{ */ - -#define HPDAC_FCR_WML_MASK (0x1FU) -#define HPDAC_FCR_WML_SHIFT (0U) -/*! WML - Watermark Level */ -#define HPDAC_FCR_WML(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_FCR_WML_SHIFT)) & HPDAC_FCR_WML_MASK) -/*! @} */ - -/*! @name FPR - DAC FIFO Pointer */ -/*! @{ */ - -#define HPDAC_FPR_FIFO_RPT_MASK (0x1FU) -#define HPDAC_FPR_FIFO_RPT_SHIFT (0U) -/*! FIFO_RPT - FIFO Read Pointer */ -#define HPDAC_FPR_FIFO_RPT(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_FPR_FIFO_RPT_SHIFT)) & HPDAC_FPR_FIFO_RPT_MASK) - -#define HPDAC_FPR_FIFO_WPT_MASK (0x1F0000U) -#define HPDAC_FPR_FIFO_WPT_SHIFT (16U) -/*! FIFO_WPT - FIFO Write Pointer */ -#define HPDAC_FPR_FIFO_WPT(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_FPR_FIFO_WPT_SHIFT)) & HPDAC_FPR_FIFO_WPT_MASK) -/*! @} */ - -/*! @name FSR - FIFO Status */ -/*! @{ */ - -#define HPDAC_FSR_FULL_MASK (0x1U) -#define HPDAC_FSR_FULL_SHIFT (0U) -/*! FULL - FIFO Full Flag - * 0b0..Not full - * 0b1..Full - */ -#define HPDAC_FSR_FULL(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_FSR_FULL_SHIFT)) & HPDAC_FSR_FULL_MASK) - -#define HPDAC_FSR_EMPTY_MASK (0x2U) -#define HPDAC_FSR_EMPTY_SHIFT (1U) -/*! EMPTY - FIFO Empty Flag - * 0b0..Not empty - * 0b1..Empty - */ -#define HPDAC_FSR_EMPTY(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_FSR_EMPTY_SHIFT)) & HPDAC_FSR_EMPTY_MASK) - -#define HPDAC_FSR_WM_MASK (0x4U) -#define HPDAC_FSR_WM_SHIFT (2U) -/*! WM - FIFO Watermark Status Flag - * 0b0..Data in FIFO is more than watermark level - * 0b1..Data in FIFO is less than or equal to watermark level - */ -#define HPDAC_FSR_WM(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_FSR_WM_SHIFT)) & HPDAC_FSR_WM_MASK) - -#define HPDAC_FSR_SWBK_MASK (0x8U) -#define HPDAC_FSR_SWBK_SHIFT (3U) -/*! SWBK - Swing Back One Cycle Complete Flag - * 0b0..No swing back cycle has completed since the last time the flag was cleared - * 0b1..At least one swing back cycle has occurred since the last time the flag was cleared - */ -#define HPDAC_FSR_SWBK(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_FSR_SWBK_SHIFT)) & HPDAC_FSR_SWBK_MASK) - -#define HPDAC_FSR_OF_MASK (0x40U) -#define HPDAC_FSR_OF_SHIFT (6U) -/*! OF - FIFO Overflow Flag - * 0b0..No overflow has occurred since the last time the flag was cleared - * 0b1..At least one FIFO overflow has occurred since the last time the flag was cleared - */ -#define HPDAC_FSR_OF(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_FSR_OF_SHIFT)) & HPDAC_FSR_OF_MASK) - -#define HPDAC_FSR_UF_MASK (0x80U) -#define HPDAC_FSR_UF_SHIFT (7U) -/*! UF - FIFO Underflow Flag - * 0b0..No underflow has occurred since the last time the flag was cleared - * 0b1..At least one trigger underflow has occurred since the last time the flag was cleared - */ -#define HPDAC_FSR_UF(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_FSR_UF_SHIFT)) & HPDAC_FSR_UF_MASK) - -#define HPDAC_FSR_PTGCOCO_MASK (0x100U) -#define HPDAC_FSR_PTGCOCO_SHIFT (8U) -/*! PTGCOCO - Period Trigger Mode Conversion Complete Flag - * 0b0..Not completed or not started - * 0b1..Completed - */ -#define HPDAC_FSR_PTGCOCO(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_FSR_PTGCOCO_SHIFT)) & HPDAC_FSR_PTGCOCO_MASK) -/*! @} */ - -/*! @name IER - Interrupt Enable */ -/*! @{ */ - -#define HPDAC_IER_FULL_IE_MASK (0x1U) -#define HPDAC_IER_FULL_IE_SHIFT (0U) -/*! FULL_IE - FIFO Full Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define HPDAC_IER_FULL_IE(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_IER_FULL_IE_SHIFT)) & HPDAC_IER_FULL_IE_MASK) - -#define HPDAC_IER_EMPTY_IE_MASK (0x2U) -#define HPDAC_IER_EMPTY_IE_SHIFT (1U) -/*! EMPTY_IE - FIFO Empty Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define HPDAC_IER_EMPTY_IE(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_IER_EMPTY_IE_SHIFT)) & HPDAC_IER_EMPTY_IE_MASK) - -#define HPDAC_IER_WM_IE_MASK (0x4U) -#define HPDAC_IER_WM_IE_SHIFT (2U) -/*! WM_IE - FIFO Watermark Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define HPDAC_IER_WM_IE(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_IER_WM_IE_SHIFT)) & HPDAC_IER_WM_IE_MASK) - -#define HPDAC_IER_SWBK_IE_MASK (0x8U) -#define HPDAC_IER_SWBK_IE_SHIFT (3U) -/*! SWBK_IE - Swing Back One Cycle Complete Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define HPDAC_IER_SWBK_IE(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_IER_SWBK_IE_SHIFT)) & HPDAC_IER_SWBK_IE_MASK) - -#define HPDAC_IER_OF_IE_MASK (0x40U) -#define HPDAC_IER_OF_IE_SHIFT (6U) -/*! OF_IE - FIFO Overflow Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define HPDAC_IER_OF_IE(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_IER_OF_IE_SHIFT)) & HPDAC_IER_OF_IE_MASK) - -#define HPDAC_IER_UF_IE_MASK (0x80U) -#define HPDAC_IER_UF_IE_SHIFT (7U) -/*! UF_IE - FIFO Underflow Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define HPDAC_IER_UF_IE(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_IER_UF_IE_SHIFT)) & HPDAC_IER_UF_IE_MASK) - -#define HPDAC_IER_PTGCOCO_IE_MASK (0x100U) -#define HPDAC_IER_PTGCOCO_IE_SHIFT (8U) -/*! PTGCOCO_IE - PTG Mode Conversion Complete Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define HPDAC_IER_PTGCOCO_IE(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_IER_PTGCOCO_IE_SHIFT)) & HPDAC_IER_PTGCOCO_IE_MASK) -/*! @} */ - -/*! @name DER - DMA Enable */ -/*! @{ */ - -#define HPDAC_DER_EMPTY_DMAEN_MASK (0x2U) -#define HPDAC_DER_EMPTY_DMAEN_SHIFT (1U) -/*! EMPTY_DMAEN - FIFO Empty DMA Enable - * 0b0..Disables - * 0b1..Enables - */ -#define HPDAC_DER_EMPTY_DMAEN(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_DER_EMPTY_DMAEN_SHIFT)) & HPDAC_DER_EMPTY_DMAEN_MASK) - -#define HPDAC_DER_WM_DMAEN_MASK (0x4U) -#define HPDAC_DER_WM_DMAEN_SHIFT (2U) -/*! WM_DMAEN - FIFO Watermark DMA Enable - * 0b0..Disables - * 0b1..Enables - */ -#define HPDAC_DER_WM_DMAEN(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_DER_WM_DMAEN_SHIFT)) & HPDAC_DER_WM_DMAEN_MASK) -/*! @} */ - -/*! @name RCR - Reset Control */ -/*! @{ */ - -#define HPDAC_RCR_SWRST_MASK (0x1U) -#define HPDAC_RCR_SWRST_SHIFT (0U) -/*! SWRST - Software Reset - * 0b0..No effect - * 0b1..Software reset - */ -#define HPDAC_RCR_SWRST(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_RCR_SWRST_SHIFT)) & HPDAC_RCR_SWRST_MASK) - -#define HPDAC_RCR_FIFORST_MASK (0x2U) -#define HPDAC_RCR_FIFORST_SHIFT (1U) -/*! FIFORST - FIFO Reset - * 0b0..No effect - * 0b1..FIFO reset - */ -#define HPDAC_RCR_FIFORST(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_RCR_FIFORST_SHIFT)) & HPDAC_RCR_FIFORST_MASK) -/*! @} */ - -/*! @name TCR - Trigger Control */ -/*! @{ */ - -#define HPDAC_TCR_SWTRG_MASK (0x1U) -#define HPDAC_TCR_SWTRG_SHIFT (0U) -/*! SWTRG - Software Trigger - * 0b0..Not valid - * 0b1..Valid - */ -#define HPDAC_TCR_SWTRG(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_TCR_SWTRG_SHIFT)) & HPDAC_TCR_SWTRG_MASK) -/*! @} */ - -/*! @name PCR - Periodic Trigger Control */ -/*! @{ */ - -#define HPDAC_PCR_PTG_NUM_MASK (0xFFFFU) -#define HPDAC_PCR_PTG_NUM_SHIFT (0U) -/*! PTG_NUM - Periodic Trigger Number */ -#define HPDAC_PCR_PTG_NUM(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_PCR_PTG_NUM_SHIFT)) & HPDAC_PCR_PTG_NUM_MASK) - -#define HPDAC_PCR_PTG_PERIOD_MASK (0xFFFF0000U) -#define HPDAC_PCR_PTG_PERIOD_SHIFT (16U) -/*! PTG_PERIOD - Periodic Trigger Period Width */ -#define HPDAC_PCR_PTG_PERIOD(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_PCR_PTG_PERIOD_SHIFT)) & HPDAC_PCR_PTG_PERIOD_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group HPDAC_Register_Masks */ - - -/* HPDAC - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral DAC2 base address */ - #define DAC2_BASE (0x50114000u) - /** Peripheral DAC2 base address */ - #define DAC2_BASE_NS (0x40114000u) - /** Peripheral DAC2 base pointer */ - #define DAC2 ((HPDAC_Type *)DAC2_BASE) - /** Peripheral DAC2 base pointer */ - #define DAC2_NS ((HPDAC_Type *)DAC2_BASE_NS) - /** Array initializer of HPDAC peripheral base addresses */ - #define HPDAC_BASE_ADDRS { DAC2_BASE } - /** Array initializer of HPDAC peripheral base pointers */ - #define HPDAC_BASE_PTRS { DAC2 } - /** Array initializer of HPDAC peripheral base addresses */ - #define HPDAC_BASE_ADDRS_NS { DAC2_BASE_NS } - /** Array initializer of HPDAC peripheral base pointers */ - #define HPDAC_BASE_PTRS_NS { DAC2_NS } -#else - /** Peripheral DAC2 base address */ - #define DAC2_BASE (0x40114000u) - /** Peripheral DAC2 base pointer */ - #define DAC2 ((HPDAC_Type *)DAC2_BASE) - /** Array initializer of HPDAC peripheral base addresses */ - #define HPDAC_BASE_ADDRS { DAC2_BASE } - /** Array initializer of HPDAC peripheral base pointers */ - #define HPDAC_BASE_PTRS { DAC2 } -#endif - -/*! - * @} - */ /* end of group HPDAC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- I2S Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup I2S_Peripheral_Access_Layer I2S Peripheral Access Layer - * @{ - */ - -/** I2S - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - __IO uint32_t TCSR; /**< Transmit Control, offset: 0x8 */ - __IO uint32_t TCR1; /**< Transmit Configuration 1, offset: 0xC */ - __IO uint32_t TCR2; /**< Transmit Configuration 2, offset: 0x10 */ - __IO uint32_t TCR3; /**< Transmit Configuration 3, offset: 0x14 */ - __IO uint32_t TCR4; /**< Transmit Configuration 4, offset: 0x18 */ - __IO uint32_t TCR5; /**< Transmit Configuration 5, offset: 0x1C */ - __O uint32_t TDR[2]; /**< Transmit Data, array offset: 0x20, array step: 0x4 */ - uint8_t RESERVED_0[24]; - __I uint32_t TFR[2]; /**< Transmit FIFO, array offset: 0x40, array step: 0x4 */ - uint8_t RESERVED_1[24]; - __IO uint32_t TMR; /**< Transmit Mask, offset: 0x60 */ - uint8_t RESERVED_2[36]; - __IO uint32_t RCSR; /**< Receive Control, offset: 0x88 */ - __IO uint32_t RCR1; /**< Receive Configuration 1, offset: 0x8C */ - __IO uint32_t RCR2; /**< Receive Configuration 2, offset: 0x90 */ - __IO uint32_t RCR3; /**< Receive Configuration 3, offset: 0x94 */ - __IO uint32_t RCR4; /**< Receive Configuration 4, offset: 0x98 */ - __IO uint32_t RCR5; /**< Receive Configuration 5, offset: 0x9C */ - __I uint32_t RDR[2]; /**< Receive Data, array offset: 0xA0, array step: 0x4 */ - uint8_t RESERVED_3[24]; - __I uint32_t RFR[2]; /**< Receive FIFO, array offset: 0xC0, array step: 0x4 */ - uint8_t RESERVED_4[24]; - __IO uint32_t RMR; /**< Receive Mask, offset: 0xE0 */ - uint8_t RESERVED_5[28]; - __IO uint32_t MCR; /**< MCLK Control, offset: 0x100 */ -} I2S_Type; - -/* ---------------------------------------------------------------------------- - -- I2S Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup I2S_Register_Masks I2S Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define I2S_VERID_FEATURE_MASK (0xFFFFU) -#define I2S_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Standard feature set - */ -#define I2S_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << I2S_VERID_FEATURE_SHIFT)) & I2S_VERID_FEATURE_MASK) - -#define I2S_VERID_MINOR_MASK (0xFF0000U) -#define I2S_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define I2S_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << I2S_VERID_MINOR_SHIFT)) & I2S_VERID_MINOR_MASK) - -#define I2S_VERID_MAJOR_MASK (0xFF000000U) -#define I2S_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define I2S_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << I2S_VERID_MAJOR_SHIFT)) & I2S_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define I2S_PARAM_DATALINE_MASK (0xFU) -#define I2S_PARAM_DATALINE_SHIFT (0U) -/*! DATALINE - Number of Data Lines */ -#define I2S_PARAM_DATALINE(x) (((uint32_t)(((uint32_t)(x)) << I2S_PARAM_DATALINE_SHIFT)) & I2S_PARAM_DATALINE_MASK) - -#define I2S_PARAM_FIFO_MASK (0xF00U) -#define I2S_PARAM_FIFO_SHIFT (8U) -/*! FIFO - FIFO Size */ -#define I2S_PARAM_FIFO(x) (((uint32_t)(((uint32_t)(x)) << I2S_PARAM_FIFO_SHIFT)) & I2S_PARAM_FIFO_MASK) - -#define I2S_PARAM_FRAME_MASK (0xF0000U) -#define I2S_PARAM_FRAME_SHIFT (16U) -/*! FRAME - Frame Size */ -#define I2S_PARAM_FRAME(x) (((uint32_t)(((uint32_t)(x)) << I2S_PARAM_FRAME_SHIFT)) & I2S_PARAM_FRAME_MASK) -/*! @} */ - -/*! @name TCSR - Transmit Control */ -/*! @{ */ - -#define I2S_TCSR_FRDE_MASK (0x1U) -#define I2S_TCSR_FRDE_SHIFT (0U) -/*! FRDE - FIFO Request DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCSR_FRDE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FRDE_SHIFT)) & I2S_TCSR_FRDE_MASK) - -#define I2S_TCSR_FWDE_MASK (0x2U) -#define I2S_TCSR_FWDE_SHIFT (1U) -/*! FWDE - FIFO Warning DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCSR_FWDE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FWDE_SHIFT)) & I2S_TCSR_FWDE_MASK) - -#define I2S_TCSR_FRIE_MASK (0x100U) -#define I2S_TCSR_FRIE_SHIFT (8U) -/*! FRIE - FIFO Request Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCSR_FRIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FRIE_SHIFT)) & I2S_TCSR_FRIE_MASK) - -#define I2S_TCSR_FWIE_MASK (0x200U) -#define I2S_TCSR_FWIE_SHIFT (9U) -/*! FWIE - FIFO Warning Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCSR_FWIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FWIE_SHIFT)) & I2S_TCSR_FWIE_MASK) - -#define I2S_TCSR_FEIE_MASK (0x400U) -#define I2S_TCSR_FEIE_SHIFT (10U) -/*! FEIE - FIFO Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCSR_FEIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FEIE_SHIFT)) & I2S_TCSR_FEIE_MASK) - -#define I2S_TCSR_SEIE_MASK (0x800U) -#define I2S_TCSR_SEIE_SHIFT (11U) -/*! SEIE - Sync Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCSR_SEIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_SEIE_SHIFT)) & I2S_TCSR_SEIE_MASK) - -#define I2S_TCSR_WSIE_MASK (0x1000U) -#define I2S_TCSR_WSIE_SHIFT (12U) -/*! WSIE - Word Start Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCSR_WSIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_WSIE_SHIFT)) & I2S_TCSR_WSIE_MASK) - -#define I2S_TCSR_FRF_MASK (0x10000U) -#define I2S_TCSR_FRF_SHIFT (16U) -/*! FRF - FIFO Request Flag - * 0b0..Watermark not reached - * 0b1..Watermark reached - */ -#define I2S_TCSR_FRF(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FRF_SHIFT)) & I2S_TCSR_FRF_MASK) - -#define I2S_TCSR_FWF_MASK (0x20000U) -#define I2S_TCSR_FWF_SHIFT (17U) -/*! FWF - FIFO Warning Flag - * 0b0..Not empty - * 0b1..Empty - */ -#define I2S_TCSR_FWF(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FWF_SHIFT)) & I2S_TCSR_FWF_MASK) - -#define I2S_TCSR_FEF_MASK (0x40000U) -#define I2S_TCSR_FEF_SHIFT (18U) -/*! FEF - FIFO Error Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I2S_TCSR_FEF(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FEF_SHIFT)) & I2S_TCSR_FEF_MASK) - -#define I2S_TCSR_SEF_MASK (0x80000U) -#define I2S_TCSR_SEF_SHIFT (19U) -/*! SEF - Sync Error Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I2S_TCSR_SEF(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_SEF_SHIFT)) & I2S_TCSR_SEF_MASK) - -#define I2S_TCSR_WSF_MASK (0x100000U) -#define I2S_TCSR_WSF_SHIFT (20U) -/*! WSF - Word Start Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I2S_TCSR_WSF(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_WSF_SHIFT)) & I2S_TCSR_WSF_MASK) - -#define I2S_TCSR_SR_MASK (0x1000000U) -#define I2S_TCSR_SR_SHIFT (24U) -/*! SR - Software Reset - * 0b0..No effect - * 0b1..Software reset - */ -#define I2S_TCSR_SR(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_SR_SHIFT)) & I2S_TCSR_SR_MASK) - -#define I2S_TCSR_FR_MASK (0x2000000U) -#define I2S_TCSR_FR_SHIFT (25U) -/*! FR - FIFO Reset - * 0b0..No effect - * 0b1..FIFO reset - */ -#define I2S_TCSR_FR(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FR_SHIFT)) & I2S_TCSR_FR_MASK) - -#define I2S_TCSR_BCE_MASK (0x10000000U) -#define I2S_TCSR_BCE_SHIFT (28U) -/*! BCE - Bit Clock Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCSR_BCE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_BCE_SHIFT)) & I2S_TCSR_BCE_MASK) - -#define I2S_TCSR_DBGE_MASK (0x20000000U) -#define I2S_TCSR_DBGE_SHIFT (29U) -/*! DBGE - Debug Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCSR_DBGE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_DBGE_SHIFT)) & I2S_TCSR_DBGE_MASK) - -#define I2S_TCSR_STOPE_MASK (0x40000000U) -#define I2S_TCSR_STOPE_SHIFT (30U) -/*! STOPE - Stop Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCSR_STOPE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_STOPE_SHIFT)) & I2S_TCSR_STOPE_MASK) - -#define I2S_TCSR_TE_MASK (0x80000000U) -#define I2S_TCSR_TE_SHIFT (31U) -/*! TE - Transmitter Enable - * 0b0..Disable - * 0b1..Enable (or transmitter has been disabled and has not yet reached the end of the frame) - */ -#define I2S_TCSR_TE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_TE_SHIFT)) & I2S_TCSR_TE_MASK) -/*! @} */ - -/*! @name TCR1 - Transmit Configuration 1 */ -/*! @{ */ - -#define I2S_TCR1_TFW_MASK (0x7U) -#define I2S_TCR1_TFW_SHIFT (0U) -/*! TFW - Transmit FIFO Watermark - * 0b000..1 - * 0b001..2 - * 0b010-0b110..(TFW +1) - * 0b111..8 - */ -#define I2S_TCR1_TFW(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR1_TFW_SHIFT)) & I2S_TCR1_TFW_MASK) -/*! @} */ - -/*! @name TCR2 - Transmit Configuration 2 */ -/*! @{ */ - -#define I2S_TCR2_DIV_MASK (0xFFU) -#define I2S_TCR2_DIV_SHIFT (0U) -/*! DIV - Bit Clock Divide */ -#define I2S_TCR2_DIV(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_DIV_SHIFT)) & I2S_TCR2_DIV_MASK) - -#define I2S_TCR2_BYP_MASK (0x800000U) -#define I2S_TCR2_BYP_SHIFT (23U) -/*! BYP - Bit Clock Bypass - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCR2_BYP(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_BYP_SHIFT)) & I2S_TCR2_BYP_MASK) - -#define I2S_TCR2_BCD_MASK (0x1000000U) -#define I2S_TCR2_BCD_SHIFT (24U) -/*! BCD - Bit Clock Direction - * 0b0..Generate externally in Target mode - * 0b1..Generate internally in Controller mode - */ -#define I2S_TCR2_BCD(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_BCD_SHIFT)) & I2S_TCR2_BCD_MASK) - -#define I2S_TCR2_BCP_MASK (0x2000000U) -#define I2S_TCR2_BCP_SHIFT (25U) -/*! BCP - Bit Clock Polarity - * 0b0..Active high - * 0b1..Active low - */ -#define I2S_TCR2_BCP(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_BCP_SHIFT)) & I2S_TCR2_BCP_MASK) - -#define I2S_TCR2_MSEL_MASK (0xC000000U) -#define I2S_TCR2_MSEL_SHIFT (26U) -/*! MSEL - MCLK Select - * 0b00..Bus clock - * 0b01..Controller clock (MCLK) option 1 - * 0b10..Controller clock (MCLK) option 2 - * 0b11..Controller clock (MCLK) option 3 - */ -#define I2S_TCR2_MSEL(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_MSEL_SHIFT)) & I2S_TCR2_MSEL_MASK) - -#define I2S_TCR2_BCI_MASK (0x10000000U) -#define I2S_TCR2_BCI_SHIFT (28U) -/*! BCI - Bit Clock Input - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCR2_BCI(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_BCI_SHIFT)) & I2S_TCR2_BCI_MASK) - -#define I2S_TCR2_BCS_MASK (0x20000000U) -#define I2S_TCR2_BCS_SHIFT (29U) -/*! BCS - Bit Clock Swap - * 0b0..Use the normal bit clock source - * 0b1..Swap the bit clock source - */ -#define I2S_TCR2_BCS(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_BCS_SHIFT)) & I2S_TCR2_BCS_MASK) - -#define I2S_TCR2_SYNC_MASK (0xC0000000U) -#define I2S_TCR2_SYNC_SHIFT (30U) -/*! SYNC - Synchronous Mode - * 0b00..Asynchronous mode - * 0b01..Synchronous with receiver - * 0b10..Synchronous with another SAI transmitter - * 0b11..Synchronous with another SAI receiver - */ -#define I2S_TCR2_SYNC(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_SYNC_SHIFT)) & I2S_TCR2_SYNC_MASK) -/*! @} */ - -/*! @name TCR3 - Transmit Configuration 3 */ -/*! @{ */ - -#define I2S_TCR3_WDFL_MASK (0x1FU) -#define I2S_TCR3_WDFL_SHIFT (0U) -/*! WDFL - Word Flag Configuration */ -#define I2S_TCR3_WDFL(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR3_WDFL_SHIFT)) & I2S_TCR3_WDFL_MASK) - -#define I2S_TCR3_TCE_MASK (0x30000U) -#define I2S_TCR3_TCE_SHIFT (16U) -/*! TCE - Transmit Channel Enable */ -#define I2S_TCR3_TCE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR3_TCE_SHIFT)) & I2S_TCR3_TCE_MASK) - -#define I2S_TCR3_CFR_MASK (0x3000000U) -#define I2S_TCR3_CFR_SHIFT (24U) -/*! CFR - Channel FIFO Reset */ -#define I2S_TCR3_CFR(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR3_CFR_SHIFT)) & I2S_TCR3_CFR_MASK) -/*! @} */ - -/*! @name TCR4 - Transmit Configuration 4 */ -/*! @{ */ - -#define I2S_TCR4_FSD_MASK (0x1U) -#define I2S_TCR4_FSD_SHIFT (0U) -/*! FSD - Frame Sync Direction - * 0b0..Generated externally in Target mode - * 0b1..Generated internally in Controller mode - */ -#define I2S_TCR4_FSD(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_FSD_SHIFT)) & I2S_TCR4_FSD_MASK) - -#define I2S_TCR4_FSP_MASK (0x2U) -#define I2S_TCR4_FSP_SHIFT (1U) -/*! FSP - Frame Sync Polarity - * 0b0..Active high - * 0b1..Active low - */ -#define I2S_TCR4_FSP(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_FSP_SHIFT)) & I2S_TCR4_FSP_MASK) - -#define I2S_TCR4_ONDEM_MASK (0x4U) -#define I2S_TCR4_ONDEM_SHIFT (2U) -/*! ONDEM - On-Demand Mode - * 0b0..Generated continuously - * 0b1..Generated after the FIFO warning flag is cleared - */ -#define I2S_TCR4_ONDEM(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_ONDEM_SHIFT)) & I2S_TCR4_ONDEM_MASK) - -#define I2S_TCR4_FSE_MASK (0x8U) -#define I2S_TCR4_FSE_SHIFT (3U) -/*! FSE - Frame Sync Early - * 0b0..First bit of the frame - * 0b1..One bit before the first bit of the frame - */ -#define I2S_TCR4_FSE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_FSE_SHIFT)) & I2S_TCR4_FSE_MASK) - -#define I2S_TCR4_MF_MASK (0x10U) -#define I2S_TCR4_MF_SHIFT (4U) -/*! MF - MSB First - * 0b0..LSB - * 0b1..MSB - */ -#define I2S_TCR4_MF(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_MF_SHIFT)) & I2S_TCR4_MF_MASK) - -#define I2S_TCR4_CHMOD_MASK (0x20U) -#define I2S_TCR4_CHMOD_SHIFT (5U) -/*! CHMOD - Channel Mode - * 0b0..TDM mode - * 0b1..Output mode - */ -#define I2S_TCR4_CHMOD(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_CHMOD_SHIFT)) & I2S_TCR4_CHMOD_MASK) - -#define I2S_TCR4_SYWD_MASK (0x1F00U) -#define I2S_TCR4_SYWD_SHIFT (8U) -/*! SYWD - Sync Width */ -#define I2S_TCR4_SYWD(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_SYWD_SHIFT)) & I2S_TCR4_SYWD_MASK) - -#define I2S_TCR4_FRSZ_MASK (0x1F0000U) -#define I2S_TCR4_FRSZ_SHIFT (16U) -/*! FRSZ - Frame Size */ -#define I2S_TCR4_FRSZ(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_FRSZ_SHIFT)) & I2S_TCR4_FRSZ_MASK) - -#define I2S_TCR4_FPACK_MASK (0x3000000U) -#define I2S_TCR4_FPACK_SHIFT (24U) -/*! FPACK - FIFO Packing Mode - * 0b00..Disable FIFO packing - * 0b01..Reserved - * 0b10..Enable 8-bit FIFO packing - * 0b11..Enable 16-bit FIFO packing - */ -#define I2S_TCR4_FPACK(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_FPACK_SHIFT)) & I2S_TCR4_FPACK_MASK) - -#define I2S_TCR4_FCOMB_MASK (0xC000000U) -#define I2S_TCR4_FCOMB_SHIFT (26U) -/*! FCOMB - FIFO Combine Mode - * 0b00..Disable - * 0b01..Enable on FIFO reads (from transmit shift registers) - * 0b10..Enable on FIFO writes (by software) - * 0b11..Enable on FIFO reads (from transmit shift registers) and writes (by software) - */ -#define I2S_TCR4_FCOMB(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_FCOMB_SHIFT)) & I2S_TCR4_FCOMB_MASK) - -#define I2S_TCR4_FCONT_MASK (0x10000000U) -#define I2S_TCR4_FCONT_SHIFT (28U) -/*! FCONT - FIFO Continue on Error - * 0b0..Continue from the start of the next frame - * 0b1..Continue from the same word that caused the FIFO error - */ -#define I2S_TCR4_FCONT(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_FCONT_SHIFT)) & I2S_TCR4_FCONT_MASK) -/*! @} */ - -/*! @name TCR5 - Transmit Configuration 5 */ -/*! @{ */ - -#define I2S_TCR5_FBT_MASK (0x1F00U) -#define I2S_TCR5_FBT_SHIFT (8U) -/*! FBT - First Bit Shifted - * 0b00000..0 - * 0b00001-0b11110..FBT - * 0b11111..31 - */ -#define I2S_TCR5_FBT(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR5_FBT_SHIFT)) & I2S_TCR5_FBT_MASK) - -#define I2S_TCR5_W0W_MASK (0x1F0000U) -#define I2S_TCR5_W0W_SHIFT (16U) -/*! W0W - Word 0 Width - * 0b00111..8 - * 0b01000..9 - * 0b01001-0b11110..(W0W value + 1) - * 0b11111..32 - */ -#define I2S_TCR5_W0W(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR5_W0W_SHIFT)) & I2S_TCR5_W0W_MASK) - -#define I2S_TCR5_WNW_MASK (0x1F000000U) -#define I2S_TCR5_WNW_SHIFT (24U) -/*! WNW - Word N Width - * 0b00111..8 - * 0b01000..9 - * 0b01001-0b11110..(WNW value + 1) - * 0b11111..32 - */ -#define I2S_TCR5_WNW(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR5_WNW_SHIFT)) & I2S_TCR5_WNW_MASK) -/*! @} */ - -/*! @name TDR - Transmit Data */ -/*! @{ */ - -#define I2S_TDR_TDR_MASK (0xFFFFFFFFU) -#define I2S_TDR_TDR_SHIFT (0U) -/*! TDR - Transmit Data */ -#define I2S_TDR_TDR(x) (((uint32_t)(((uint32_t)(x)) << I2S_TDR_TDR_SHIFT)) & I2S_TDR_TDR_MASK) -/*! @} */ - -/* The count of I2S_TDR */ -#define I2S_TDR_COUNT (2U) - -/*! @name TFR - Transmit FIFO */ -/*! @{ */ - -#define I2S_TFR_RFP_MASK (0xFU) -#define I2S_TFR_RFP_SHIFT (0U) -/*! RFP - Read FIFO Pointer */ -#define I2S_TFR_RFP(x) (((uint32_t)(((uint32_t)(x)) << I2S_TFR_RFP_SHIFT)) & I2S_TFR_RFP_MASK) - -#define I2S_TFR_WFP_MASK (0xF0000U) -#define I2S_TFR_WFP_SHIFT (16U) -/*! WFP - Write FIFO Pointer */ -#define I2S_TFR_WFP(x) (((uint32_t)(((uint32_t)(x)) << I2S_TFR_WFP_SHIFT)) & I2S_TFR_WFP_MASK) - -#define I2S_TFR_WCP_MASK (0x80000000U) -#define I2S_TFR_WCP_SHIFT (31U) -/*! WCP - Write Channel Pointer - * 0b0..No effect - * 0b1..Next FIFO to be written - */ -#define I2S_TFR_WCP(x) (((uint32_t)(((uint32_t)(x)) << I2S_TFR_WCP_SHIFT)) & I2S_TFR_WCP_MASK) -/*! @} */ - -/* The count of I2S_TFR */ -#define I2S_TFR_COUNT (2U) - -/*! @name TMR - Transmit Mask */ -/*! @{ */ - -#define I2S_TMR_TWM_MASK (0xFFFFFFFFU) -#define I2S_TMR_TWM_SHIFT (0U) -/*! TWM - Transmit Word Mask - * 0b00000000000000000000000000000000..Enable - * 0b00000000000000000000000000000001..Mask - */ -#define I2S_TMR_TWM(x) (((uint32_t)(((uint32_t)(x)) << I2S_TMR_TWM_SHIFT)) & I2S_TMR_TWM_MASK) -/*! @} */ - -/*! @name RCSR - Receive Control */ -/*! @{ */ - -#define I2S_RCSR_FRDE_MASK (0x1U) -#define I2S_RCSR_FRDE_SHIFT (0U) -/*! FRDE - FIFO Request DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCSR_FRDE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FRDE_SHIFT)) & I2S_RCSR_FRDE_MASK) - -#define I2S_RCSR_FWDE_MASK (0x2U) -#define I2S_RCSR_FWDE_SHIFT (1U) -/*! FWDE - FIFO Warning DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCSR_FWDE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FWDE_SHIFT)) & I2S_RCSR_FWDE_MASK) - -#define I2S_RCSR_FRIE_MASK (0x100U) -#define I2S_RCSR_FRIE_SHIFT (8U) -/*! FRIE - FIFO Request Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCSR_FRIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FRIE_SHIFT)) & I2S_RCSR_FRIE_MASK) - -#define I2S_RCSR_FWIE_MASK (0x200U) -#define I2S_RCSR_FWIE_SHIFT (9U) -/*! FWIE - FIFO Warning Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCSR_FWIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FWIE_SHIFT)) & I2S_RCSR_FWIE_MASK) - -#define I2S_RCSR_FEIE_MASK (0x400U) -#define I2S_RCSR_FEIE_SHIFT (10U) -/*! FEIE - FIFO Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCSR_FEIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FEIE_SHIFT)) & I2S_RCSR_FEIE_MASK) - -#define I2S_RCSR_SEIE_MASK (0x800U) -#define I2S_RCSR_SEIE_SHIFT (11U) -/*! SEIE - Sync Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCSR_SEIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_SEIE_SHIFT)) & I2S_RCSR_SEIE_MASK) - -#define I2S_RCSR_WSIE_MASK (0x1000U) -#define I2S_RCSR_WSIE_SHIFT (12U) -/*! WSIE - Word Start Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCSR_WSIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_WSIE_SHIFT)) & I2S_RCSR_WSIE_MASK) - -#define I2S_RCSR_FRF_MASK (0x10000U) -#define I2S_RCSR_FRF_SHIFT (16U) -/*! FRF - FIFO Request Flag - * 0b0..Watermark not reached - * 0b1..Watermark reached - */ -#define I2S_RCSR_FRF(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FRF_SHIFT)) & I2S_RCSR_FRF_MASK) - -#define I2S_RCSR_FWF_MASK (0x20000U) -#define I2S_RCSR_FWF_SHIFT (17U) -/*! FWF - FIFO Warning Flag - * 0b0..Not full - * 0b1..Full - */ -#define I2S_RCSR_FWF(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FWF_SHIFT)) & I2S_RCSR_FWF_MASK) - -#define I2S_RCSR_FEF_MASK (0x40000U) -#define I2S_RCSR_FEF_SHIFT (18U) -/*! FEF - FIFO Error Flag - * 0b0..No error - * 0b1..Receive overflow detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I2S_RCSR_FEF(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FEF_SHIFT)) & I2S_RCSR_FEF_MASK) - -#define I2S_RCSR_SEF_MASK (0x80000U) -#define I2S_RCSR_SEF_SHIFT (19U) -/*! SEF - Sync Error Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I2S_RCSR_SEF(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_SEF_SHIFT)) & I2S_RCSR_SEF_MASK) - -#define I2S_RCSR_WSF_MASK (0x100000U) -#define I2S_RCSR_WSF_SHIFT (20U) -/*! WSF - Word Start Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I2S_RCSR_WSF(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_WSF_SHIFT)) & I2S_RCSR_WSF_MASK) - -#define I2S_RCSR_SR_MASK (0x1000000U) -#define I2S_RCSR_SR_SHIFT (24U) -/*! SR - Software Reset - * 0b0..No effect - * 0b1..Software reset - */ -#define I2S_RCSR_SR(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_SR_SHIFT)) & I2S_RCSR_SR_MASK) - -#define I2S_RCSR_FR_MASK (0x2000000U) -#define I2S_RCSR_FR_SHIFT (25U) -/*! FR - FIFO Reset - * 0b0..No effect - * 0b1..Reset - */ -#define I2S_RCSR_FR(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FR_SHIFT)) & I2S_RCSR_FR_MASK) - -#define I2S_RCSR_BCE_MASK (0x10000000U) -#define I2S_RCSR_BCE_SHIFT (28U) -/*! BCE - Bit Clock Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCSR_BCE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_BCE_SHIFT)) & I2S_RCSR_BCE_MASK) - -#define I2S_RCSR_DBGE_MASK (0x20000000U) -#define I2S_RCSR_DBGE_SHIFT (29U) -/*! DBGE - Debug Enable - * 0b0..Disable after completing the current frame - * 0b1..Enable - */ -#define I2S_RCSR_DBGE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_DBGE_SHIFT)) & I2S_RCSR_DBGE_MASK) - -#define I2S_RCSR_STOPE_MASK (0x40000000U) -#define I2S_RCSR_STOPE_SHIFT (30U) -/*! STOPE - Stop Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCSR_STOPE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_STOPE_SHIFT)) & I2S_RCSR_STOPE_MASK) - -#define I2S_RCSR_RE_MASK (0x80000000U) -#define I2S_RCSR_RE_SHIFT (31U) -/*! RE - Receiver Enable - * 0b0..Disable - * 0b1..Enable (or receiver disabled and not yet reached end of frame) - */ -#define I2S_RCSR_RE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_RE_SHIFT)) & I2S_RCSR_RE_MASK) -/*! @} */ - -/*! @name RCR1 - Receive Configuration 1 */ -/*! @{ */ - -#define I2S_RCR1_RFW_MASK (0x7U) -#define I2S_RCR1_RFW_SHIFT (0U) -/*! RFW - Receive FIFO Watermark - * 0b000..1 - * 0b001..2 - * 0b010-0b110..(RFW value + 1) - * 0b111..8 - */ -#define I2S_RCR1_RFW(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR1_RFW_SHIFT)) & I2S_RCR1_RFW_MASK) -/*! @} */ - -/*! @name RCR2 - Receive Configuration 2 */ -/*! @{ */ - -#define I2S_RCR2_DIV_MASK (0xFFU) -#define I2S_RCR2_DIV_SHIFT (0U) -/*! DIV - Bit Clock Divide */ -#define I2S_RCR2_DIV(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_DIV_SHIFT)) & I2S_RCR2_DIV_MASK) - -#define I2S_RCR2_BYP_MASK (0x800000U) -#define I2S_RCR2_BYP_SHIFT (23U) -/*! BYP - Bit Clock Bypass - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCR2_BYP(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_BYP_SHIFT)) & I2S_RCR2_BYP_MASK) - -#define I2S_RCR2_BCD_MASK (0x1000000U) -#define I2S_RCR2_BCD_SHIFT (24U) -/*! BCD - Bit Clock Direction - * 0b0..Generated externally in Target mode - * 0b1..Generated internally in Controller mode - */ -#define I2S_RCR2_BCD(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_BCD_SHIFT)) & I2S_RCR2_BCD_MASK) - -#define I2S_RCR2_BCP_MASK (0x2000000U) -#define I2S_RCR2_BCP_SHIFT (25U) -/*! BCP - Bit Clock Polarity - * 0b0..Active high - * 0b1..Active low - */ -#define I2S_RCR2_BCP(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_BCP_SHIFT)) & I2S_RCR2_BCP_MASK) - -#define I2S_RCR2_MSEL_MASK (0xC000000U) -#define I2S_RCR2_MSEL_SHIFT (26U) -/*! MSEL - MCLK Select - * 0b00..Bus clock - * 0b01..Controller clock (MCLK) option 1 - * 0b10..Controller clock (MCLK) option 2 - * 0b11..Controller clock (MCLK) option 3 - */ -#define I2S_RCR2_MSEL(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_MSEL_SHIFT)) & I2S_RCR2_MSEL_MASK) - -#define I2S_RCR2_BCI_MASK (0x10000000U) -#define I2S_RCR2_BCI_SHIFT (28U) -/*! BCI - Bit Clock Input - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCR2_BCI(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_BCI_SHIFT)) & I2S_RCR2_BCI_MASK) - -#define I2S_RCR2_BCS_MASK (0x20000000U) -#define I2S_RCR2_BCS_SHIFT (29U) -/*! BCS - Bit Clock Swap - * 0b0..Use the normal bit clock source - * 0b1..Swap the bit clock source - */ -#define I2S_RCR2_BCS(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_BCS_SHIFT)) & I2S_RCR2_BCS_MASK) - -#define I2S_RCR2_SYNC_MASK (0xC0000000U) -#define I2S_RCR2_SYNC_SHIFT (30U) -/*! SYNC - Synchronous Mode - * 0b00..Asynchronous mode - * 0b01..Synchronous with transmitter - * 0b10..Synchronous with another SAI receiver - * 0b11..Synchronous with another SAI transmitter - */ -#define I2S_RCR2_SYNC(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_SYNC_SHIFT)) & I2S_RCR2_SYNC_MASK) -/*! @} */ - -/*! @name RCR3 - Receive Configuration 3 */ -/*! @{ */ - -#define I2S_RCR3_WDFL_MASK (0x1FU) -#define I2S_RCR3_WDFL_SHIFT (0U) -/*! WDFL - Word Flag Configuration - * 0b00000..Word 1 - * 0b00001..Word 2 - * 0b00010-0b11110..Word (WDFL value + 1) - * 0b11111..Word 32 - */ -#define I2S_RCR3_WDFL(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR3_WDFL_SHIFT)) & I2S_RCR3_WDFL_MASK) - -#define I2S_RCR3_RCE_MASK (0x30000U) -#define I2S_RCR3_RCE_SHIFT (16U) -/*! RCE - Receive Channel Enable */ -#define I2S_RCR3_RCE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR3_RCE_SHIFT)) & I2S_RCR3_RCE_MASK) - -#define I2S_RCR3_CFR_MASK (0x3000000U) -#define I2S_RCR3_CFR_SHIFT (24U) -/*! CFR - Channel FIFO Reset */ -#define I2S_RCR3_CFR(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR3_CFR_SHIFT)) & I2S_RCR3_CFR_MASK) -/*! @} */ - -/*! @name RCR4 - Receive Configuration 4 */ -/*! @{ */ - -#define I2S_RCR4_FSD_MASK (0x1U) -#define I2S_RCR4_FSD_SHIFT (0U) -/*! FSD - Frame Sync Direction - * 0b0..Generated externally in Target mode - * 0b1..Generated internally in Controller mode - */ -#define I2S_RCR4_FSD(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_FSD_SHIFT)) & I2S_RCR4_FSD_MASK) - -#define I2S_RCR4_FSP_MASK (0x2U) -#define I2S_RCR4_FSP_SHIFT (1U) -/*! FSP - Frame Sync Polarity - * 0b0..Active high - * 0b1..Active low - */ -#define I2S_RCR4_FSP(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_FSP_SHIFT)) & I2S_RCR4_FSP_MASK) - -#define I2S_RCR4_ONDEM_MASK (0x4U) -#define I2S_RCR4_ONDEM_SHIFT (2U) -/*! ONDEM - On-Demand Mode - * 0b0..Generated continuously - * 0b1..Generated when the FIFO warning flag is 0 - */ -#define I2S_RCR4_ONDEM(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_ONDEM_SHIFT)) & I2S_RCR4_ONDEM_MASK) - -#define I2S_RCR4_FSE_MASK (0x8U) -#define I2S_RCR4_FSE_SHIFT (3U) -/*! FSE - Frame Sync Early - * 0b0..First bit of the frame - * 0b1..One bit before the first bit of the frame - */ -#define I2S_RCR4_FSE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_FSE_SHIFT)) & I2S_RCR4_FSE_MASK) - -#define I2S_RCR4_MF_MASK (0x10U) -#define I2S_RCR4_MF_SHIFT (4U) -/*! MF - MSB First - * 0b0..LSB - * 0b1..MSB - */ -#define I2S_RCR4_MF(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_MF_SHIFT)) & I2S_RCR4_MF_MASK) - -#define I2S_RCR4_SYWD_MASK (0x1F00U) -#define I2S_RCR4_SYWD_SHIFT (8U) -/*! SYWD - Sync Width - * 0b00000..1 - * 0b00001..2 - * 0b00010-0b11110..(SYWD value + 1) - * 0b11111..32 - */ -#define I2S_RCR4_SYWD(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_SYWD_SHIFT)) & I2S_RCR4_SYWD_MASK) - -#define I2S_RCR4_FRSZ_MASK (0x1F0000U) -#define I2S_RCR4_FRSZ_SHIFT (16U) -/*! FRSZ - Frame Size - * 0b00000..1 - * 0b00001..2 - * 0b00010-0b11110..(FRSZ value + 1) - * 0b11111..32 - */ -#define I2S_RCR4_FRSZ(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_FRSZ_SHIFT)) & I2S_RCR4_FRSZ_MASK) - -#define I2S_RCR4_FPACK_MASK (0x3000000U) -#define I2S_RCR4_FPACK_SHIFT (24U) -/*! FPACK - FIFO Packing Mode - * 0b00..Disable - * 0b01..Reserved - * 0b10..Enable 8-bit FIFO packing - * 0b11..Enable 16-bit FIFO packing - */ -#define I2S_RCR4_FPACK(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_FPACK_SHIFT)) & I2S_RCR4_FPACK_MASK) - -#define I2S_RCR4_FCOMB_MASK (0xC000000U) -#define I2S_RCR4_FCOMB_SHIFT (26U) -/*! FCOMB - FIFO Combine Mode - * 0b00..Disable - * 0b01..Enable on FIFO writes (from receive shift registers) - * 0b10..Enable on FIFO reads (by software) - * 0b11..Enable on FIFO writes (from receive shift registers) and reads (by software) - */ -#define I2S_RCR4_FCOMB(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_FCOMB_SHIFT)) & I2S_RCR4_FCOMB_MASK) - -#define I2S_RCR4_FCONT_MASK (0x10000000U) -#define I2S_RCR4_FCONT_SHIFT (28U) -/*! FCONT - FIFO Continue on Error - * 0b0..From the start of the next frame after the FIFO error flag is cleared - * 0b1..From the same word that caused the FIFO error to become 1 after the FIFO warning flag is cleared - */ -#define I2S_RCR4_FCONT(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_FCONT_SHIFT)) & I2S_RCR4_FCONT_MASK) -/*! @} */ - -/*! @name RCR5 - Receive Configuration 5 */ -/*! @{ */ - -#define I2S_RCR5_FBT_MASK (0x1F00U) -#define I2S_RCR5_FBT_SHIFT (8U) -/*! FBT - First Bit Shifted - * 0b00000..0 - * 0b00001-0b11110..FBT value - * 0b11111..31 - */ -#define I2S_RCR5_FBT(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR5_FBT_SHIFT)) & I2S_RCR5_FBT_MASK) - -#define I2S_RCR5_W0W_MASK (0x1F0000U) -#define I2S_RCR5_W0W_SHIFT (16U) -/*! W0W - Word 0 Width - * 0b00000..1 - * 0b00001..2 - * 0b00010-0b11110..(W0W value + 1) - * 0b11111..32 - */ -#define I2S_RCR5_W0W(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR5_W0W_SHIFT)) & I2S_RCR5_W0W_MASK) - -#define I2S_RCR5_WNW_MASK (0x1F000000U) -#define I2S_RCR5_WNW_SHIFT (24U) -/*! WNW - Word N Width - * 0b00111..8 - * 0b01000..9 - * 0b01001-0b11110..(WNW value + 1) - * 0b11111..32 - */ -#define I2S_RCR5_WNW(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR5_WNW_SHIFT)) & I2S_RCR5_WNW_MASK) -/*! @} */ - -/*! @name RDR - Receive Data */ -/*! @{ */ - -#define I2S_RDR_RDR_MASK (0xFFFFFFFFU) -#define I2S_RDR_RDR_SHIFT (0U) -/*! RDR - Receive Data */ -#define I2S_RDR_RDR(x) (((uint32_t)(((uint32_t)(x)) << I2S_RDR_RDR_SHIFT)) & I2S_RDR_RDR_MASK) -/*! @} */ - -/* The count of I2S_RDR */ -#define I2S_RDR_COUNT (2U) - -/*! @name RFR - Receive FIFO */ -/*! @{ */ - -#define I2S_RFR_RFP_MASK (0xFU) -#define I2S_RFR_RFP_SHIFT (0U) -/*! RFP - Read FIFO Pointer */ -#define I2S_RFR_RFP(x) (((uint32_t)(((uint32_t)(x)) << I2S_RFR_RFP_SHIFT)) & I2S_RFR_RFP_MASK) - -#define I2S_RFR_RCP_MASK (0x8000U) -#define I2S_RFR_RCP_SHIFT (15U) -/*! RCP - Read Channel Pointer - * 0b0..No effect - * 0b1..Next FIFO to be read - */ -#define I2S_RFR_RCP(x) (((uint32_t)(((uint32_t)(x)) << I2S_RFR_RCP_SHIFT)) & I2S_RFR_RCP_MASK) - -#define I2S_RFR_WFP_MASK (0xF0000U) -#define I2S_RFR_WFP_SHIFT (16U) -/*! WFP - Write FIFO Pointer */ -#define I2S_RFR_WFP(x) (((uint32_t)(((uint32_t)(x)) << I2S_RFR_WFP_SHIFT)) & I2S_RFR_WFP_MASK) -/*! @} */ - -/* The count of I2S_RFR */ -#define I2S_RFR_COUNT (2U) - -/*! @name RMR - Receive Mask */ -/*! @{ */ - -#define I2S_RMR_RWM_MASK (0xFFFFFFFFU) -#define I2S_RMR_RWM_SHIFT (0U) -/*! RWM - Receive Word Mask - * 0b00000000000000000000000000000000..Enable - * 0b00000000000000000000000000000001..Mask - */ -#define I2S_RMR_RWM(x) (((uint32_t)(((uint32_t)(x)) << I2S_RMR_RWM_SHIFT)) & I2S_RMR_RWM_MASK) -/*! @} */ - -/*! @name MCR - MCLK Control */ -/*! @{ */ - -#define I2S_MCR_DIV_MASK (0xFFU) -#define I2S_MCR_DIV_SHIFT (0U) -/*! DIV - MCLK Post Divide */ -#define I2S_MCR_DIV(x) (((uint32_t)(((uint32_t)(x)) << I2S_MCR_DIV_SHIFT)) & I2S_MCR_DIV_MASK) - -#define I2S_MCR_DIVEN_MASK (0x800000U) -#define I2S_MCR_DIVEN_SHIFT (23U) -/*! DIVEN - MCLK Post Divide Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_MCR_DIVEN(x) (((uint32_t)(((uint32_t)(x)) << I2S_MCR_DIVEN_SHIFT)) & I2S_MCR_DIVEN_MASK) - -#define I2S_MCR_MSEL_MASK (0x3000000U) -#define I2S_MCR_MSEL_SHIFT (24U) -/*! MSEL - MCLK Select - * 0b00..Controller clock (MCLK) option 1 - * 0b01..Reserved - * 0b10..Controller clock (MCLK) option 2 - * 0b11..Controller clock (MCLK) option 3 - */ -#define I2S_MCR_MSEL(x) (((uint32_t)(((uint32_t)(x)) << I2S_MCR_MSEL_SHIFT)) & I2S_MCR_MSEL_MASK) - -#define I2S_MCR_MOE_MASK (0x40000000U) -#define I2S_MCR_MOE_SHIFT (30U) -/*! MOE - MCLK Output Enable - * 0b0..Input - * 0b1..Output - */ -#define I2S_MCR_MOE(x) (((uint32_t)(((uint32_t)(x)) << I2S_MCR_MOE_SHIFT)) & I2S_MCR_MOE_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group I2S_Register_Masks */ - - -/* I2S - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral SAI0 base address */ - #define SAI0_BASE (0x50106000u) - /** Peripheral SAI0 base address */ - #define SAI0_BASE_NS (0x40106000u) - /** Peripheral SAI0 base pointer */ - #define SAI0 ((I2S_Type *)SAI0_BASE) - /** Peripheral SAI0 base pointer */ - #define SAI0_NS ((I2S_Type *)SAI0_BASE_NS) - /** Peripheral SAI1 base address */ - #define SAI1_BASE (0x50107000u) - /** Peripheral SAI1 base address */ - #define SAI1_BASE_NS (0x40107000u) - /** Peripheral SAI1 base pointer */ - #define SAI1 ((I2S_Type *)SAI1_BASE) - /** Peripheral SAI1 base pointer */ - #define SAI1_NS ((I2S_Type *)SAI1_BASE_NS) - /** Array initializer of I2S peripheral base addresses */ - #define I2S_BASE_ADDRS { SAI0_BASE, SAI1_BASE } - /** Array initializer of I2S peripheral base pointers */ - #define I2S_BASE_PTRS { SAI0, SAI1 } - /** Array initializer of I2S peripheral base addresses */ - #define I2S_BASE_ADDRS_NS { SAI0_BASE_NS, SAI1_BASE_NS } - /** Array initializer of I2S peripheral base pointers */ - #define I2S_BASE_PTRS_NS { SAI0_NS, SAI1_NS } -#else - /** Peripheral SAI0 base address */ - #define SAI0_BASE (0x40106000u) - /** Peripheral SAI0 base pointer */ - #define SAI0 ((I2S_Type *)SAI0_BASE) - /** Peripheral SAI1 base address */ - #define SAI1_BASE (0x40107000u) - /** Peripheral SAI1 base pointer */ - #define SAI1 ((I2S_Type *)SAI1_BASE) - /** Array initializer of I2S peripheral base addresses */ - #define I2S_BASE_ADDRS { SAI0_BASE, SAI1_BASE } - /** Array initializer of I2S peripheral base pointers */ - #define I2S_BASE_PTRS { SAI0, SAI1 } -#endif -/** Interrupt vectors for the I2S peripheral type */ -#define I2S_RX_IRQS { SAI0_IRQn, SAI1_IRQn } -#define I2S_TX_IRQS { SAI0_IRQn, SAI1_IRQn } - -/*! - * @} - */ /* end of group I2S_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- I3C Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup I3C_Peripheral_Access_Layer I3C Peripheral Access Layer - * @{ - */ - -/** I3C - Register Layout Typedef */ -typedef struct { - __IO uint32_t MCONFIG; /**< Controller Configuration, offset: 0x0 */ - __IO uint32_t SCONFIG; /**< Target Configuration, offset: 0x4 */ - __IO uint32_t SSTATUS; /**< Target Status, offset: 0x8 */ - __IO uint32_t SCTRL; /**< Target Control, offset: 0xC */ - __IO uint32_t SINTSET; /**< Target Interrupt Set, offset: 0x10 */ - __IO uint32_t SINTCLR; /**< Target Interrupt Clear, offset: 0x14 */ - __I uint32_t SINTMASKED; /**< Target Interrupt Mask, offset: 0x18 */ - __IO uint32_t SERRWARN; /**< Target Errors and Warnings, offset: 0x1C */ - __IO uint32_t SDMACTRL; /**< Target DMA Control, offset: 0x20 */ - uint8_t RESERVED_0[8]; - __IO uint32_t SDATACTRL; /**< Target Data Control, offset: 0x2C */ - __O uint32_t SWDATAB; /**< Target Write Data Byte, offset: 0x30 */ - __O uint32_t SWDATABE; /**< Target Write Data Byte End, offset: 0x34 */ - __O uint32_t SWDATAH; /**< Target Write Data Halfword, offset: 0x38 */ - __O uint32_t SWDATAHE; /**< Target Write Data Halfword End, offset: 0x3C */ - __I uint32_t SRDATAB; /**< Target Read Data Byte, offset: 0x40 */ - uint8_t RESERVED_1[4]; - __I uint32_t SRDATAH; /**< Target Read Data Halfword, offset: 0x48 */ - uint8_t RESERVED_2[8]; - __O uint32_t SWDATAB1; /**< Target Write Data Byte, offset: 0x54 */ - uint8_t RESERVED_3[4]; - __I uint32_t SCAPABILITIES2; /**< Target Capabilities 2, offset: 0x5C */ - __I uint32_t SCAPABILITIES; /**< Target Capabilities, offset: 0x60 */ - __IO uint32_t SDYNADDR; /**< Target Dynamic Address, offset: 0x64 */ - __IO uint32_t SMAXLIMITS; /**< Target Maximum Limits, offset: 0x68 */ - __IO uint32_t SIDPARTNO; /**< Target ID Part Number, offset: 0x6C */ - __IO uint32_t SIDEXT; /**< Target ID Extension, offset: 0x70 */ - __IO uint32_t SVENDORID; /**< Target Vendor ID, offset: 0x74 */ - __IO uint32_t STCCLOCK; /**< Target Time Control Clock, offset: 0x78 */ - __I uint32_t SMSGMAPADDR; /**< Target Message Map Address, offset: 0x7C */ - uint8_t RESERVED_4[4]; - __IO uint32_t MCTRL; /**< Controller Control, offset: 0x84 */ - __IO uint32_t MSTATUS; /**< Controller Status, offset: 0x88 */ - __IO uint32_t MIBIRULES; /**< Controller In-band Interrupt Registry and Rules, offset: 0x8C */ - __IO uint32_t MINTSET; /**< Controller Interrupt Set, offset: 0x90 */ - __IO uint32_t MINTCLR; /**< Controller Interrupt Clear, offset: 0x94 */ - __I uint32_t MINTMASKED; /**< Controller Interrupt Mask, offset: 0x98 */ - __IO uint32_t MERRWARN; /**< Controller Errors and Warnings, offset: 0x9C */ - __IO uint32_t MDMACTRL; /**< Controller DMA Control, offset: 0xA0 */ - uint8_t RESERVED_5[8]; - __IO uint32_t MDATACTRL; /**< Controller Data Control, offset: 0xAC */ - __O uint32_t MWDATAB; /**< Controller Write Data Byte, offset: 0xB0 */ - __O uint32_t MWDATABE; /**< Controller Write Data Byte End, offset: 0xB4 */ - __O uint32_t MWDATAH; /**< Controller Write Data Halfword, offset: 0xB8 */ - __O uint32_t MWDATAHE; /**< Controller Write Data Halfword End, offset: 0xBC */ - __I uint32_t MRDATAB; /**< Controller Read Data Byte, offset: 0xC0 */ - uint8_t RESERVED_6[4]; - __I uint32_t MRDATAH; /**< Controller Read Data Halfword, offset: 0xC8 */ - __O uint32_t MWDATAB1; /**< Controller Write Byte Data 1 (to Bus), offset: 0xCC */ - union { /* offset: 0xD0 */ - __O uint32_t MWMSG_SDR_CONTROL; /**< Controller Write Message Control in SDR mode, offset: 0xD0 */ - __O uint32_t MWMSG_SDR_DATA; /**< Controller Write Message Data in SDR mode, offset: 0xD0 */ - }; - __I uint32_t MRMSG_SDR; /**< Controller Read Message in SDR mode, offset: 0xD4 */ - union { /* offset: 0xD8 */ - __O uint32_t MWMSG_DDR_CONTROL; /**< Controller Write Message in DDR mode: First Control Word, offset: 0xD8 */ - __O uint32_t MWMSG_DDR_CONTROL2; /**< Controller Write Message in DDR Mode Control 2, offset: 0xD8 */ - __O uint32_t MWMSG_DDR_DATA; /**< Controller Write Message Data in DDR mode, offset: 0xD8 */ - }; - __I uint32_t MRMSG_DDR; /**< Controller Read Message in DDR mode, offset: 0xDC */ - uint8_t RESERVED_7[4]; - __IO uint32_t MDYNADDR; /**< Controller Dynamic Address, offset: 0xE4 */ - uint8_t RESERVED_8[52]; - __I uint32_t SMAPCTRL0; /**< Map Feature Control 0, offset: 0x11C */ - uint8_t RESERVED_9[32]; - __IO uint32_t IBIEXT1; /**< Extended IBI Data 1, offset: 0x140 */ - __IO uint32_t IBIEXT2; /**< Extended IBI Data 2, offset: 0x144 */ - uint8_t RESERVED_10[3764]; - __I uint32_t SID; /**< Target Module ID, offset: 0xFFC */ -} I3C_Type; - -/* ---------------------------------------------------------------------------- - -- I3C Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup I3C_Register_Masks I3C Register Masks - * @{ - */ - -/*! @name MCONFIG - Controller Configuration */ -/*! @{ */ - -#define I3C_MCONFIG_MSTENA_MASK (0x3U) -#define I3C_MCONFIG_MSTENA_SHIFT (0U) -/*! MSTENA - Controller Enable - * 0b00..CONTROLLER_OFF - * 0b01..CONTROLLER_ON - * 0b10..CONTROLLER_CAPABLE - * 0b11..I2C_CONTROLLER_MODE - */ -#define I3C_MCONFIG_MSTENA(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_MSTENA_SHIFT)) & I3C_MCONFIG_MSTENA_MASK) - -#define I3C_MCONFIG_DISTO_MASK (0x8U) -#define I3C_MCONFIG_DISTO_SHIFT (3U) -/*! DISTO - Disable Timeout - * 0b1..Disabled, if configured - * 0b0..Enabled - */ -#define I3C_MCONFIG_DISTO(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_DISTO_SHIFT)) & I3C_MCONFIG_DISTO_MASK) - -#define I3C_MCONFIG_HKEEP_MASK (0x30U) -#define I3C_MCONFIG_HKEEP_SHIFT (4U) -/*! HKEEP - High-Keeper - * 0b00..None - * 0b01..WIRED_IN - * 0b10..PASSIVE_SDA - * 0b11..PASSIVE_ON_SDA_SCL - */ -#define I3C_MCONFIG_HKEEP(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_HKEEP_SHIFT)) & I3C_MCONFIG_HKEEP_MASK) - -#define I3C_MCONFIG_ODSTOP_MASK (0x40U) -#define I3C_MCONFIG_ODSTOP_SHIFT (6U) -/*! ODSTOP - Open Drain Stop - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MCONFIG_ODSTOP(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_ODSTOP_SHIFT)) & I3C_MCONFIG_ODSTOP_MASK) - -#define I3C_MCONFIG_PPBAUD_MASK (0xF00U) -#define I3C_MCONFIG_PPBAUD_SHIFT (8U) -/*! PPBAUD - Push-Pull Baud Rate */ -#define I3C_MCONFIG_PPBAUD(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_PPBAUD_SHIFT)) & I3C_MCONFIG_PPBAUD_MASK) - -#define I3C_MCONFIG_PPLOW_MASK (0xF000U) -#define I3C_MCONFIG_PPLOW_SHIFT (12U) -/*! PPLOW - Push-Pull Low */ -#define I3C_MCONFIG_PPLOW(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_PPLOW_SHIFT)) & I3C_MCONFIG_PPLOW_MASK) - -#define I3C_MCONFIG_ODBAUD_MASK (0xFF0000U) -#define I3C_MCONFIG_ODBAUD_SHIFT (16U) -/*! ODBAUD - Open Drain Baud Rate */ -#define I3C_MCONFIG_ODBAUD(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_ODBAUD_SHIFT)) & I3C_MCONFIG_ODBAUD_MASK) - -#define I3C_MCONFIG_ODHPP_MASK (0x1000000U) -#define I3C_MCONFIG_ODHPP_SHIFT (24U) -/*! ODHPP - Open Drain High Push-Pull - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MCONFIG_ODHPP(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_ODHPP_SHIFT)) & I3C_MCONFIG_ODHPP_MASK) - -#define I3C_MCONFIG_SKEW_MASK (0xE000000U) -#define I3C_MCONFIG_SKEW_SHIFT (25U) -/*! SKEW - Skew */ -#define I3C_MCONFIG_SKEW(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_SKEW_SHIFT)) & I3C_MCONFIG_SKEW_MASK) - -#define I3C_MCONFIG_I2CBAUD_MASK (0xF0000000U) -#define I3C_MCONFIG_I2CBAUD_SHIFT (28U) -/*! I2CBAUD - I2C Baud Rate */ -#define I3C_MCONFIG_I2CBAUD(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_I2CBAUD_SHIFT)) & I3C_MCONFIG_I2CBAUD_MASK) -/*! @} */ - -/*! @name SCONFIG - Target Configuration */ -/*! @{ */ - -#define I3C_SCONFIG_SLVENA_MASK (0x1U) -#define I3C_SCONFIG_SLVENA_SHIFT (0U) -/*! SLVENA - Target Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SCONFIG_SLVENA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_SLVENA_SHIFT)) & I3C_SCONFIG_SLVENA_MASK) - -#define I3C_SCONFIG_NACK_MASK (0x2U) -#define I3C_SCONFIG_NACK_SHIFT (1U) -/*! NACK - Not Acknowledge - * 0b1..Always enable NACK mode (works normally) - * 0b0..Always disable NACK mode - */ -#define I3C_SCONFIG_NACK(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_NACK_SHIFT)) & I3C_SCONFIG_NACK_MASK) - -#define I3C_SCONFIG_MATCHSS_MASK (0x4U) -#define I3C_SCONFIG_MATCHSS_SHIFT (2U) -/*! MATCHSS - Match Start or Stop - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SCONFIG_MATCHSS(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_MATCHSS_SHIFT)) & I3C_SCONFIG_MATCHSS_MASK) - -#define I3C_SCONFIG_S0IGNORE_MASK (0x8U) -#define I3C_SCONFIG_S0IGNORE_SHIFT (3U) -/*! S0IGNORE - Ignore TE0 or TE1 Errors - * 0b1..Ignore TE0 or TE1 errors - * 0b0..Do not ignore TE0 or TE1 errors - */ -#define I3C_SCONFIG_S0IGNORE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_S0IGNORE_SHIFT)) & I3C_SCONFIG_S0IGNORE_MASK) - -#define I3C_SCONFIG_DDROK_MASK (0x10U) -#define I3C_SCONFIG_DDROK_SHIFT (4U) -/*! DDROK - Double Data Rate OK - * 0b1..Allow HDR-DDR messaging - * 0b0..Do not allow HDR-DDR messaging - */ -#define I3C_SCONFIG_DDROK(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_DDROK_SHIFT)) & I3C_SCONFIG_DDROK_MASK) - -#define I3C_SCONFIG_IDRAND_MASK (0x100U) -#define I3C_SCONFIG_IDRAND_SHIFT (8U) -/*! IDRAND - ID random - * 0b1..Random value - * 0b0..Part number and an instance - */ -#define I3C_SCONFIG_IDRAND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_IDRAND_SHIFT)) & I3C_SCONFIG_IDRAND_MASK) - -#define I3C_SCONFIG_OFFLINE_MASK (0x200U) -#define I3C_SCONFIG_OFFLINE_SHIFT (9U) -/*! OFFLINE - Offline - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SCONFIG_OFFLINE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_OFFLINE_SHIFT)) & I3C_SCONFIG_OFFLINE_MASK) - -#define I3C_SCONFIG_BAMATCH_MASK (0xFF0000U) -#define I3C_SCONFIG_BAMATCH_SHIFT (16U) -/*! BAMATCH - Bus Available Match */ -#define I3C_SCONFIG_BAMATCH(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_BAMATCH_SHIFT)) & I3C_SCONFIG_BAMATCH_MASK) - -#define I3C_SCONFIG_SADDR_MASK (0xFE000000U) -#define I3C_SCONFIG_SADDR_SHIFT (25U) -/*! SADDR - Static Address */ -#define I3C_SCONFIG_SADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_SADDR_SHIFT)) & I3C_SCONFIG_SADDR_MASK) -/*! @} */ - -/*! @name SSTATUS - Target Status */ -/*! @{ */ - -#define I3C_SSTATUS_STNOTSTOP_MASK (0x1U) -#define I3C_SSTATUS_STNOTSTOP_SHIFT (0U) -/*! STNOTSTOP - Status not Stop - * 0b1..Busy - * 0b0..In STOP condition - */ -#define I3C_SSTATUS_STNOTSTOP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STNOTSTOP_SHIFT)) & I3C_SSTATUS_STNOTSTOP_MASK) - -#define I3C_SSTATUS_STMSG_MASK (0x2U) -#define I3C_SSTATUS_STMSG_SHIFT (1U) -/*! STMSG - Status Message - * 0b1..Busy - * 0b0..Idle - */ -#define I3C_SSTATUS_STMSG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STMSG_SHIFT)) & I3C_SSTATUS_STMSG_MASK) - -#define I3C_SSTATUS_STCCCH_MASK (0x4U) -#define I3C_SSTATUS_STCCCH_SHIFT (2U) -/*! STCCCH - Status Common Command Code Handler - * 0b1..Handled automatically - * 0b0..No CCC message handled - */ -#define I3C_SSTATUS_STCCCH(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STCCCH_SHIFT)) & I3C_SSTATUS_STCCCH_MASK) - -#define I3C_SSTATUS_STREQRD_MASK (0x8U) -#define I3C_SSTATUS_STREQRD_SHIFT (3U) -/*! STREQRD - Status Request Read - * 0b1..SDR read from this target or an IBI is being pushed out - * 0b0..Not an SDR read - */ -#define I3C_SSTATUS_STREQRD(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STREQRD_SHIFT)) & I3C_SSTATUS_STREQRD_MASK) - -#define I3C_SSTATUS_STREQWR_MASK (0x10U) -#define I3C_SSTATUS_STREQWR_SHIFT (4U) -/*! STREQWR - Status Request Write - * 0b1..SDR write data from the controller, but not in ENTDAA mode - * 0b0..Not an SDR write - */ -#define I3C_SSTATUS_STREQWR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STREQWR_SHIFT)) & I3C_SSTATUS_STREQWR_MASK) - -#define I3C_SSTATUS_STDAA_MASK (0x20U) -#define I3C_SSTATUS_STDAA_SHIFT (5U) -/*! STDAA - Status Dynamic Address Assignment - * 0b1..In ENTDAA mode - * 0b0..Not in ENTDAA mode - */ -#define I3C_SSTATUS_STDAA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STDAA_SHIFT)) & I3C_SSTATUS_STDAA_MASK) - -#define I3C_SSTATUS_STHDR_MASK (0x40U) -#define I3C_SSTATUS_STHDR_SHIFT (6U) -/*! STHDR - Status High Data Rate - * 0b1..I3C bus in HDR-DDR mode - * 0b0..I3C bus not in HDR-DDR mode - */ -#define I3C_SSTATUS_STHDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STHDR_SHIFT)) & I3C_SSTATUS_STHDR_MASK) - -#define I3C_SSTATUS_START_MASK (0x100U) -#define I3C_SSTATUS_START_SHIFT (8U) -/*! START - Start - * 0b1..Detected - * 0b0..Not detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_START(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_START_SHIFT)) & I3C_SSTATUS_START_MASK) - -#define I3C_SSTATUS_MATCHED_MASK (0x200U) -#define I3C_SSTATUS_MATCHED_SHIFT (9U) -/*! MATCHED - Matched - * 0b1..Header matched - * 0b0..Header not matched - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_MATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_MATCHED_SHIFT)) & I3C_SSTATUS_MATCHED_MASK) - -#define I3C_SSTATUS_STOP_MASK (0x400U) -#define I3C_SSTATUS_STOP_SHIFT (10U) -/*! STOP - Stop - * 0b1..Stopped state detected - * 0b0..No Stopped state detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_STOP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STOP_SHIFT)) & I3C_SSTATUS_STOP_MASK) - -#define I3C_SSTATUS_RX_PEND_MASK (0x800U) -#define I3C_SSTATUS_RX_PEND_SHIFT (11U) -/*! RX_PEND - Received Message Pending - * 0b1..Received message pending - * 0b0..No received message pending - */ -#define I3C_SSTATUS_RX_PEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_RX_PEND_SHIFT)) & I3C_SSTATUS_RX_PEND_MASK) - -#define I3C_SSTATUS_TXNOTFULL_MASK (0x1000U) -#define I3C_SSTATUS_TXNOTFULL_SHIFT (12U) -/*! TXNOTFULL - Transmit Buffer Not Full - * 0b1..Transmit buffer not full - * 0b0..Transmit buffer full - */ -#define I3C_SSTATUS_TXNOTFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_TXNOTFULL_SHIFT)) & I3C_SSTATUS_TXNOTFULL_MASK) - -#define I3C_SSTATUS_DACHG_MASK (0x2000U) -#define I3C_SSTATUS_DACHG_SHIFT (13U) -/*! DACHG - Dynamic Address Change - * 0b1..DA change detected - * 0b0..No DA change detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_DACHG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_DACHG_SHIFT)) & I3C_SSTATUS_DACHG_MASK) - -#define I3C_SSTATUS_CCC_MASK (0x4000U) -#define I3C_SSTATUS_CCC_SHIFT (14U) -/*! CCC - Common Command Code - * 0b1..CCC received - * 0b0..CCC not received - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_CCC(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_CCC_SHIFT)) & I3C_SSTATUS_CCC_MASK) - -#define I3C_SSTATUS_ERRWARN_MASK (0x8000U) -#define I3C_SSTATUS_ERRWARN_SHIFT (15U) -/*! ERRWARN - Error Warning */ -#define I3C_SSTATUS_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_ERRWARN_SHIFT)) & I3C_SSTATUS_ERRWARN_MASK) - -#define I3C_SSTATUS_HDRMATCH_MASK (0x10000U) -#define I3C_SSTATUS_HDRMATCH_SHIFT (16U) -/*! HDRMATCH - High Data Rate Command Match - * 0b1..Matched the I3C dynamic address - * 0b0..Did not match - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_HDRMATCH(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_HDRMATCH_SHIFT)) & I3C_SSTATUS_HDRMATCH_MASK) - -#define I3C_SSTATUS_CHANDLED_MASK (0x20000U) -#define I3C_SSTATUS_CHANDLED_SHIFT (17U) -/*! CHANDLED - Common Command Code Handled - * 0b1..CCC handling in progress - * 0b0..CCC handling not in progress - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_CHANDLED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_CHANDLED_SHIFT)) & I3C_SSTATUS_CHANDLED_MASK) - -#define I3C_SSTATUS_EVENT_MASK (0x40000U) -#define I3C_SSTATUS_EVENT_SHIFT (18U) -/*! EVENT - Event - * 0b1..IBI, CR, or HJ occurred - * 0b0..No event occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_EVENT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_EVENT_SHIFT)) & I3C_SSTATUS_EVENT_MASK) - -#define I3C_SSTATUS_EVDET_MASK (0x300000U) -#define I3C_SSTATUS_EVDET_SHIFT (20U) -/*! EVDET - Event Details - * 0b00..NONE (no event or no pending event) - * 0b01..NO_REQUEST (request is not sent yet; either there is no START condition yet, or is waiting for Bus-Available or Bus-Idle (HJ)) - * 0b10..NACKed (not acknowledged, request sent and rejected); I3C tries again - * 0b11..ACKed (acknowledged; request sent and accepted), so done (unless the time control data is still being sent) - */ -#define I3C_SSTATUS_EVDET(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_EVDET_SHIFT)) & I3C_SSTATUS_EVDET_MASK) - -#define I3C_SSTATUS_IBIDIS_MASK (0x1000000U) -#define I3C_SSTATUS_IBIDIS_SHIFT (24U) -/*! IBIDIS - In-Band Interrupts Disable - * 0b1..Disabled - * 0b0..Enabled - */ -#define I3C_SSTATUS_IBIDIS(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_IBIDIS_SHIFT)) & I3C_SSTATUS_IBIDIS_MASK) - -#define I3C_SSTATUS_MRDIS_MASK (0x2000000U) -#define I3C_SSTATUS_MRDIS_SHIFT (25U) -/*! MRDIS - Controller Requests Disable - * 0b1..Disabled - * 0b0..Enabled - */ -#define I3C_SSTATUS_MRDIS(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_MRDIS_SHIFT)) & I3C_SSTATUS_MRDIS_MASK) - -#define I3C_SSTATUS_HJDIS_MASK (0x8000000U) -#define I3C_SSTATUS_HJDIS_SHIFT (27U) -/*! HJDIS - Hot-Join Disabled - * 0b1..Disabled - * 0b0..Enabled - */ -#define I3C_SSTATUS_HJDIS(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_HJDIS_SHIFT)) & I3C_SSTATUS_HJDIS_MASK) - -#define I3C_SSTATUS_ACTSTATE_MASK (0x30000000U) -#define I3C_SSTATUS_ACTSTATE_SHIFT (28U) -/*! ACTSTATE - Activity State from Common Command Codes (CCC) - * 0b00..NO_LATENCY (normal bus operations) - * 0b01..LATENCY_1MS (1 ms of latency) - * 0b10..LATENCY_100MS (100 ms of latency) - * 0b11..LATENCY_10S (10 seconds of latency) - */ -#define I3C_SSTATUS_ACTSTATE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_ACTSTATE_SHIFT)) & I3C_SSTATUS_ACTSTATE_MASK) - -#define I3C_SSTATUS_TIMECTRL_MASK (0xC0000000U) -#define I3C_SSTATUS_TIMECTRL_SHIFT (30U) -/*! TIMECTRL - Time Control - * 0b00..NO_TIME_CONTROL (no time control is enabled) - * 0b01..SYNC_MODE (Synchronous mode is enabled) - * 0b10..ASYNC_MODE (Asynchronous standard mode (0 or 1) is enabled) - * 0b11..BOTHSYNCASYNC (both Synchronous and Asynchronous modes are enabled) - */ -#define I3C_SSTATUS_TIMECTRL(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_TIMECTRL_SHIFT)) & I3C_SSTATUS_TIMECTRL_MASK) -/*! @} */ - -/*! @name SCTRL - Target Control */ -/*! @{ */ - -#define I3C_SCTRL_EVENT_MASK (0x3U) -#define I3C_SCTRL_EVENT_SHIFT (0U) -/*! EVENT - Event - * 0b00..NORMAL_MODE - * 0b01..IBI - * 0b10..CONTROLLER_REQUEST - * 0b11..HOT_JOIN_REQUEST - */ -#define I3C_SCTRL_EVENT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCTRL_EVENT_SHIFT)) & I3C_SCTRL_EVENT_MASK) - -#define I3C_SCTRL_EXTDATA_MASK (0x8U) -#define I3C_SCTRL_EXTDATA_SHIFT (3U) -/*! EXTDATA - Extended Data - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SCTRL_EXTDATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCTRL_EXTDATA_SHIFT)) & I3C_SCTRL_EXTDATA_MASK) - -#define I3C_SCTRL_IBIDATA_MASK (0xFF00U) -#define I3C_SCTRL_IBIDATA_SHIFT (8U) -/*! IBIDATA - In-Band Interrupt Data */ -#define I3C_SCTRL_IBIDATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCTRL_IBIDATA_SHIFT)) & I3C_SCTRL_IBIDATA_MASK) - -#define I3C_SCTRL_PENDINT_MASK (0xF0000U) -#define I3C_SCTRL_PENDINT_SHIFT (16U) -/*! PENDINT - Pending Interrupt */ -#define I3C_SCTRL_PENDINT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCTRL_PENDINT_SHIFT)) & I3C_SCTRL_PENDINT_MASK) - -#define I3C_SCTRL_ACTSTATE_MASK (0x300000U) -#define I3C_SCTRL_ACTSTATE_SHIFT (20U) -/*! ACTSTATE - Activity State of Target */ -#define I3C_SCTRL_ACTSTATE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCTRL_ACTSTATE_SHIFT)) & I3C_SCTRL_ACTSTATE_MASK) - -#define I3C_SCTRL_VENDINFO_MASK (0xFF000000U) -#define I3C_SCTRL_VENDINFO_SHIFT (24U) -/*! VENDINFO - Vendor Information */ -#define I3C_SCTRL_VENDINFO(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCTRL_VENDINFO_SHIFT)) & I3C_SCTRL_VENDINFO_MASK) -/*! @} */ - -/*! @name SINTSET - Target Interrupt Set */ -/*! @{ */ - -#define I3C_SINTSET_START_MASK (0x100U) -#define I3C_SINTSET_START_SHIFT (8U) -/*! START - Start Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_START(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_START_SHIFT)) & I3C_SINTSET_START_MASK) - -#define I3C_SINTSET_MATCHED_MASK (0x200U) -#define I3C_SINTSET_MATCHED_SHIFT (9U) -/*! MATCHED - Match Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_MATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_MATCHED_SHIFT)) & I3C_SINTSET_MATCHED_MASK) - -#define I3C_SINTSET_STOP_MASK (0x400U) -#define I3C_SINTSET_STOP_SHIFT (10U) -/*! STOP - Stop Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_STOP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_STOP_SHIFT)) & I3C_SINTSET_STOP_MASK) - -#define I3C_SINTSET_RXPEND_MASK (0x800U) -#define I3C_SINTSET_RXPEND_SHIFT (11U) -/*! RXPEND - Receive Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_RXPEND_SHIFT)) & I3C_SINTSET_RXPEND_MASK) - -#define I3C_SINTSET_TXSEND_MASK (0x1000U) -#define I3C_SINTSET_TXSEND_SHIFT (12U) -/*! TXSEND - Transmit Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_TXSEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_TXSEND_SHIFT)) & I3C_SINTSET_TXSEND_MASK) - -#define I3C_SINTSET_DACHG_MASK (0x2000U) -#define I3C_SINTSET_DACHG_SHIFT (13U) -/*! DACHG - Dynamic Address Change Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_DACHG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_DACHG_SHIFT)) & I3C_SINTSET_DACHG_MASK) - -#define I3C_SINTSET_CCC_MASK (0x4000U) -#define I3C_SINTSET_CCC_SHIFT (14U) -/*! CCC - Common Command Code (CCC) Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_CCC(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_CCC_SHIFT)) & I3C_SINTSET_CCC_MASK) - -#define I3C_SINTSET_ERRWARN_MASK (0x8000U) -#define I3C_SINTSET_ERRWARN_SHIFT (15U) -/*! ERRWARN - Error or Warning Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_ERRWARN_SHIFT)) & I3C_SINTSET_ERRWARN_MASK) - -#define I3C_SINTSET_DDRMATCHED_MASK (0x10000U) -#define I3C_SINTSET_DDRMATCHED_SHIFT (16U) -/*! DDRMATCHED - Double Data Rate Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_DDRMATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_DDRMATCHED_SHIFT)) & I3C_SINTSET_DDRMATCHED_MASK) - -#define I3C_SINTSET_CHANDLED_MASK (0x20000U) -#define I3C_SINTSET_CHANDLED_SHIFT (17U) -/*! CHANDLED - Common Command Code (CCC) Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_CHANDLED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_CHANDLED_SHIFT)) & I3C_SINTSET_CHANDLED_MASK) - -#define I3C_SINTSET_EVENT_MASK (0x40000U) -#define I3C_SINTSET_EVENT_SHIFT (18U) -/*! EVENT - Event Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_EVENT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_EVENT_SHIFT)) & I3C_SINTSET_EVENT_MASK) -/*! @} */ - -/*! @name SINTCLR - Target Interrupt Clear */ -/*! @{ */ - -#define I3C_SINTCLR_START_MASK (0x100U) -#define I3C_SINTCLR_START_SHIFT (8U) -/*! START - START Interrupt Enable Clear */ -#define I3C_SINTCLR_START(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_START_SHIFT)) & I3C_SINTCLR_START_MASK) - -#define I3C_SINTCLR_MATCHED_MASK (0x200U) -#define I3C_SINTCLR_MATCHED_SHIFT (9U) -/*! MATCHED - Matched Interrupt Enable Clear */ -#define I3C_SINTCLR_MATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_MATCHED_SHIFT)) & I3C_SINTCLR_MATCHED_MASK) - -#define I3C_SINTCLR_STOP_MASK (0x400U) -#define I3C_SINTCLR_STOP_SHIFT (10U) -/*! STOP - STOP Interrupt Enable Clear */ -#define I3C_SINTCLR_STOP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_STOP_SHIFT)) & I3C_SINTCLR_STOP_MASK) - -#define I3C_SINTCLR_RXPEND_MASK (0x800U) -#define I3C_SINTCLR_RXPEND_SHIFT (11U) -/*! RXPEND - RXPEND Interrupt Enable Clear */ -#define I3C_SINTCLR_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_RXPEND_SHIFT)) & I3C_SINTCLR_RXPEND_MASK) - -#define I3C_SINTCLR_TXSEND_MASK (0x1000U) -#define I3C_SINTCLR_TXSEND_SHIFT (12U) -/*! TXSEND - TXSEND Interrupt Enable Clear */ -#define I3C_SINTCLR_TXSEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_TXSEND_SHIFT)) & I3C_SINTCLR_TXSEND_MASK) - -#define I3C_SINTCLR_DACHG_MASK (0x2000U) -#define I3C_SINTCLR_DACHG_SHIFT (13U) -/*! DACHG - DACHG Interrupt Enable Clear */ -#define I3C_SINTCLR_DACHG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_DACHG_SHIFT)) & I3C_SINTCLR_DACHG_MASK) - -#define I3C_SINTCLR_CCC_MASK (0x4000U) -#define I3C_SINTCLR_CCC_SHIFT (14U) -/*! CCC - CCC Interrupt Enable Clear */ -#define I3C_SINTCLR_CCC(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_CCC_SHIFT)) & I3C_SINTCLR_CCC_MASK) - -#define I3C_SINTCLR_ERRWARN_MASK (0x8000U) -#define I3C_SINTCLR_ERRWARN_SHIFT (15U) -/*! ERRWARN - ERRWARN Interrupt Enable Clear */ -#define I3C_SINTCLR_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_ERRWARN_SHIFT)) & I3C_SINTCLR_ERRWARN_MASK) - -#define I3C_SINTCLR_DDRMATCHED_MASK (0x10000U) -#define I3C_SINTCLR_DDRMATCHED_SHIFT (16U) -/*! DDRMATCHED - DDRMATCHED Interrupt Enable Clear */ -#define I3C_SINTCLR_DDRMATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_DDRMATCHED_SHIFT)) & I3C_SINTCLR_DDRMATCHED_MASK) - -#define I3C_SINTCLR_CHANDLED_MASK (0x20000U) -#define I3C_SINTCLR_CHANDLED_SHIFT (17U) -/*! CHANDLED - CHANDLED Interrupt Enable Clear */ -#define I3C_SINTCLR_CHANDLED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_CHANDLED_SHIFT)) & I3C_SINTCLR_CHANDLED_MASK) - -#define I3C_SINTCLR_EVENT_MASK (0x40000U) -#define I3C_SINTCLR_EVENT_SHIFT (18U) -/*! EVENT - EVENT Interrupt Enable Clear */ -#define I3C_SINTCLR_EVENT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_EVENT_SHIFT)) & I3C_SINTCLR_EVENT_MASK) -/*! @} */ - -/*! @name SINTMASKED - Target Interrupt Mask */ -/*! @{ */ - -#define I3C_SINTMASKED_START_MASK (0x100U) -#define I3C_SINTMASKED_START_SHIFT (8U) -/*! START - START Interrupt Mask */ -#define I3C_SINTMASKED_START(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_START_SHIFT)) & I3C_SINTMASKED_START_MASK) - -#define I3C_SINTMASKED_MATCHED_MASK (0x200U) -#define I3C_SINTMASKED_MATCHED_SHIFT (9U) -/*! MATCHED - MATCHED Interrupt Mask */ -#define I3C_SINTMASKED_MATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_MATCHED_SHIFT)) & I3C_SINTMASKED_MATCHED_MASK) - -#define I3C_SINTMASKED_STOP_MASK (0x400U) -#define I3C_SINTMASKED_STOP_SHIFT (10U) -/*! STOP - STOP Interrupt Mask */ -#define I3C_SINTMASKED_STOP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_STOP_SHIFT)) & I3C_SINTMASKED_STOP_MASK) - -#define I3C_SINTMASKED_RXPEND_MASK (0x800U) -#define I3C_SINTMASKED_RXPEND_SHIFT (11U) -/*! RXPEND - RXPEND Interrupt Mask */ -#define I3C_SINTMASKED_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_RXPEND_SHIFT)) & I3C_SINTMASKED_RXPEND_MASK) - -#define I3C_SINTMASKED_TXSEND_MASK (0x1000U) -#define I3C_SINTMASKED_TXSEND_SHIFT (12U) -/*! TXSEND - TXSEND Interrupt Mask */ -#define I3C_SINTMASKED_TXSEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_TXSEND_SHIFT)) & I3C_SINTMASKED_TXSEND_MASK) - -#define I3C_SINTMASKED_DACHG_MASK (0x2000U) -#define I3C_SINTMASKED_DACHG_SHIFT (13U) -/*! DACHG - DACHG Interrupt Mask */ -#define I3C_SINTMASKED_DACHG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_DACHG_SHIFT)) & I3C_SINTMASKED_DACHG_MASK) - -#define I3C_SINTMASKED_CCC_MASK (0x4000U) -#define I3C_SINTMASKED_CCC_SHIFT (14U) -/*! CCC - CCC Interrupt Mask */ -#define I3C_SINTMASKED_CCC(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_CCC_SHIFT)) & I3C_SINTMASKED_CCC_MASK) - -#define I3C_SINTMASKED_ERRWARN_MASK (0x8000U) -#define I3C_SINTMASKED_ERRWARN_SHIFT (15U) -/*! ERRWARN - ERRWARN Interrupt Mask */ -#define I3C_SINTMASKED_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_ERRWARN_SHIFT)) & I3C_SINTMASKED_ERRWARN_MASK) - -#define I3C_SINTMASKED_DDRMATCHED_MASK (0x10000U) -#define I3C_SINTMASKED_DDRMATCHED_SHIFT (16U) -/*! DDRMATCHED - DDRMATCHED Interrupt Mask */ -#define I3C_SINTMASKED_DDRMATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_DDRMATCHED_SHIFT)) & I3C_SINTMASKED_DDRMATCHED_MASK) - -#define I3C_SINTMASKED_CHANDLED_MASK (0x20000U) -#define I3C_SINTMASKED_CHANDLED_SHIFT (17U) -/*! CHANDLED - CHANDLED Interrupt Mask */ -#define I3C_SINTMASKED_CHANDLED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_CHANDLED_SHIFT)) & I3C_SINTMASKED_CHANDLED_MASK) - -#define I3C_SINTMASKED_EVENT_MASK (0x40000U) -#define I3C_SINTMASKED_EVENT_SHIFT (18U) -/*! EVENT - EVENT Interrupt Mask */ -#define I3C_SINTMASKED_EVENT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_EVENT_SHIFT)) & I3C_SINTMASKED_EVENT_MASK) -/*! @} */ - -/*! @name SERRWARN - Target Errors and Warnings */ -/*! @{ */ - -#define I3C_SERRWARN_ORUN_MASK (0x1U) -#define I3C_SERRWARN_ORUN_SHIFT (0U) -/*! ORUN - Overrun Error - * 0b1..Overrun error - * 0b0..No overrun error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_ORUN(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_ORUN_SHIFT)) & I3C_SERRWARN_ORUN_MASK) - -#define I3C_SERRWARN_URUN_MASK (0x2U) -#define I3C_SERRWARN_URUN_SHIFT (1U) -/*! URUN - Underrun Error - * 0b1..Underrun error - * 0b0..No underrun error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_URUN(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_URUN_SHIFT)) & I3C_SERRWARN_URUN_MASK) - -#define I3C_SERRWARN_URUNNACK_MASK (0x4U) -#define I3C_SERRWARN_URUNNACK_SHIFT (2U) -/*! URUNNACK - Underrun and Not Acknowledged (NACKed) Error - * 0b1..Underrun; not acknowledged error - * 0b0..No underrun; not acknowledged error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_URUNNACK(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_URUNNACK_SHIFT)) & I3C_SERRWARN_URUNNACK_MASK) - -#define I3C_SERRWARN_TERM_MASK (0x8U) -#define I3C_SERRWARN_TERM_SHIFT (3U) -/*! TERM - Terminated Error - * 0b1..Terminated error - * 0b0..No terminated error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_TERM(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_TERM_SHIFT)) & I3C_SERRWARN_TERM_MASK) - -#define I3C_SERRWARN_INVSTART_MASK (0x10U) -#define I3C_SERRWARN_INVSTART_SHIFT (4U) -/*! INVSTART - Invalid Start Error - * 0b1..Invalid start error - * 0b0..No invalid start error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_INVSTART(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_INVSTART_SHIFT)) & I3C_SERRWARN_INVSTART_MASK) - -#define I3C_SERRWARN_SPAR_MASK (0x100U) -#define I3C_SERRWARN_SPAR_SHIFT (8U) -/*! SPAR - SDR Parity Error - * 0b1..SDR parity error - * 0b0..No SDR parity error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_SPAR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_SPAR_SHIFT)) & I3C_SERRWARN_SPAR_MASK) - -#define I3C_SERRWARN_HPAR_MASK (0x200U) -#define I3C_SERRWARN_HPAR_SHIFT (9U) -/*! HPAR - HDR Parity Error - * 0b1..HDR parity error - * 0b0..No HDR parity error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_HPAR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_HPAR_SHIFT)) & I3C_SERRWARN_HPAR_MASK) - -#define I3C_SERRWARN_HCRC_MASK (0x400U) -#define I3C_SERRWARN_HCRC_SHIFT (10U) -/*! HCRC - HDR-DDR CRC Error - * 0b1..HDR-DDR CRC error occurred - * 0b0..No HDR-DDR CRC error occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_HCRC(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_HCRC_SHIFT)) & I3C_SERRWARN_HCRC_MASK) - -#define I3C_SERRWARN_S0S1_MASK (0x800U) -#define I3C_SERRWARN_S0S1_SHIFT (11U) -/*! S0S1 - TE0 or TE1 Error - * 0b1..TE0 or TE1 error occurred - * 0b0..No TE0 or TE1 error occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_S0S1(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_S0S1_SHIFT)) & I3C_SERRWARN_S0S1_MASK) - -#define I3C_SERRWARN_OREAD_MASK (0x10000U) -#define I3C_SERRWARN_OREAD_SHIFT (16U) -/*! OREAD - Over-Read Error - * 0b1..Over-read error - * 0b0..No over-read error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_OREAD(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_OREAD_SHIFT)) & I3C_SERRWARN_OREAD_MASK) - -#define I3C_SERRWARN_OWRITE_MASK (0x20000U) -#define I3C_SERRWARN_OWRITE_SHIFT (17U) -/*! OWRITE - Over-Write Error - * 0b1..Overwrite error - * 0b0..No overwrite error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_OWRITE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_OWRITE_SHIFT)) & I3C_SERRWARN_OWRITE_MASK) -/*! @} */ - -/*! @name SDMACTRL - Target DMA Control */ -/*! @{ */ - -#define I3C_SDMACTRL_DMAFB_MASK (0x3U) -#define I3C_SDMACTRL_DMAFB_SHIFT (0U) -/*! DMAFB - DMA Read (From-Bus) Trigger - * 0b00..DMA not used - * 0b01..DMA enabled for one frame - * 0b10..DMA enabled until turned off - * 0b11.. - */ -#define I3C_SDMACTRL_DMAFB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDMACTRL_DMAFB_SHIFT)) & I3C_SDMACTRL_DMAFB_MASK) - -#define I3C_SDMACTRL_DMATB_MASK (0xCU) -#define I3C_SDMACTRL_DMATB_SHIFT (2U) -/*! DMATB - DMA Write (To-Bus) Trigger - * 0b00..DMA not used - * 0b01..DMA enabled for one frame - * 0b10..DMA enabled until turned off - * 0b11.. - */ -#define I3C_SDMACTRL_DMATB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDMACTRL_DMATB_SHIFT)) & I3C_SDMACTRL_DMATB_MASK) - -#define I3C_SDMACTRL_DMAWIDTH_MASK (0x30U) -#define I3C_SDMACTRL_DMAWIDTH_SHIFT (4U) -/*! DMAWIDTH - Width of DMA Operations - * 0b00, 0b01..Byte - * 0b10..Halfword (16 bits) (this value ensures that two bytes are available in the FIFO) - * 0b11.. - */ -#define I3C_SDMACTRL_DMAWIDTH(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDMACTRL_DMAWIDTH_SHIFT)) & I3C_SDMACTRL_DMAWIDTH_MASK) -/*! @} */ - -/*! @name SDATACTRL - Target Data Control */ -/*! @{ */ - -#define I3C_SDATACTRL_FLUSHTB_MASK (0x1U) -#define I3C_SDATACTRL_FLUSHTB_SHIFT (0U) -/*! FLUSHTB - Flush To-Bus Buffer or FIFO */ -#define I3C_SDATACTRL_FLUSHTB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_FLUSHTB_SHIFT)) & I3C_SDATACTRL_FLUSHTB_MASK) - -#define I3C_SDATACTRL_FLUSHFB_MASK (0x2U) -#define I3C_SDATACTRL_FLUSHFB_SHIFT (1U) -/*! FLUSHFB - Flush From-Bus Buffer or FIFO */ -#define I3C_SDATACTRL_FLUSHFB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_FLUSHFB_SHIFT)) & I3C_SDATACTRL_FLUSHFB_MASK) - -#define I3C_SDATACTRL_UNLOCK_MASK (0x8U) -#define I3C_SDATACTRL_UNLOCK_SHIFT (3U) -/*! UNLOCK - Unlock - * 0b0..Cannot be changed - * 0b1..Can be changed - */ -#define I3C_SDATACTRL_UNLOCK(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_UNLOCK_SHIFT)) & I3C_SDATACTRL_UNLOCK_MASK) - -#define I3C_SDATACTRL_TXTRIG_MASK (0x30U) -#define I3C_SDATACTRL_TXTRIG_SHIFT (4U) -/*! TXTRIG - Transmit Trigger Level - * 0b00..Trigger when empty - * 0b01..Trigger when 1/4 full or less - * 0b10..Trigger when 1/2 full or less - * 0b11..Default (trigger when 1 less than full or less) - */ -#define I3C_SDATACTRL_TXTRIG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_TXTRIG_SHIFT)) & I3C_SDATACTRL_TXTRIG_MASK) - -#define I3C_SDATACTRL_RXTRIG_MASK (0xC0U) -#define I3C_SDATACTRL_RXTRIG_SHIFT (6U) -/*! RXTRIG - Receive Trigger Level - * 0b00..Trigger when not empty - * 0b01..Trigger when 1/4 or more full - * 0b10..Trigger when 1/2 or more full - * 0b11..Trigger when 3/4 or more full - */ -#define I3C_SDATACTRL_RXTRIG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_RXTRIG_SHIFT)) & I3C_SDATACTRL_RXTRIG_MASK) - -#define I3C_SDATACTRL_TXCOUNT_MASK (0x1F0000U) -#define I3C_SDATACTRL_TXCOUNT_SHIFT (16U) -/*! TXCOUNT - Count of Bytes in Transmit */ -#define I3C_SDATACTRL_TXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_TXCOUNT_SHIFT)) & I3C_SDATACTRL_TXCOUNT_MASK) - -#define I3C_SDATACTRL_RXCOUNT_MASK (0x1F000000U) -#define I3C_SDATACTRL_RXCOUNT_SHIFT (24U) -/*! RXCOUNT - Count of Bytes in Receive */ -#define I3C_SDATACTRL_RXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_RXCOUNT_SHIFT)) & I3C_SDATACTRL_RXCOUNT_MASK) - -#define I3C_SDATACTRL_TXFULL_MASK (0x40000000U) -#define I3C_SDATACTRL_TXFULL_SHIFT (30U) -/*! TXFULL - Transmit is Full - * 0b1..Full - * 0b0..Not full - */ -#define I3C_SDATACTRL_TXFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_TXFULL_SHIFT)) & I3C_SDATACTRL_TXFULL_MASK) - -#define I3C_SDATACTRL_RXEMPTY_MASK (0x80000000U) -#define I3C_SDATACTRL_RXEMPTY_SHIFT (31U) -/*! RXEMPTY - Receive is Empty - * 0b1..Empty - * 0b0..Not empty - */ -#define I3C_SDATACTRL_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_RXEMPTY_SHIFT)) & I3C_SDATACTRL_RXEMPTY_MASK) -/*! @} */ - -/*! @name SWDATAB - Target Write Data Byte */ -/*! @{ */ - -#define I3C_SWDATAB_DATA_MASK (0xFFU) -#define I3C_SWDATAB_DATA_SHIFT (0U) -/*! DATA - Data */ -#define I3C_SWDATAB_DATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAB_DATA_SHIFT)) & I3C_SWDATAB_DATA_MASK) - -#define I3C_SWDATAB_END_MASK (0x100U) -#define I3C_SWDATAB_END_SHIFT (8U) -/*! END - End - * 0b1..End - * 0b0..Not the end - */ -#define I3C_SWDATAB_END(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAB_END_SHIFT)) & I3C_SWDATAB_END_MASK) - -#define I3C_SWDATAB_END_ALSO_MASK (0x10000U) -#define I3C_SWDATAB_END_ALSO_SHIFT (16U) -/*! END_ALSO - End Also - * 0b1..End - * 0b0..Not the end - */ -#define I3C_SWDATAB_END_ALSO(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAB_END_ALSO_SHIFT)) & I3C_SWDATAB_END_ALSO_MASK) -/*! @} */ - -/*! @name SWDATABE - Target Write Data Byte End */ -/*! @{ */ - -#define I3C_SWDATABE_DATA_MASK (0xFFU) -#define I3C_SWDATABE_DATA_SHIFT (0U) -/*! DATA - Data */ -#define I3C_SWDATABE_DATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATABE_DATA_SHIFT)) & I3C_SWDATABE_DATA_MASK) -/*! @} */ - -/*! @name SWDATAH - Target Write Data Halfword */ -/*! @{ */ - -#define I3C_SWDATAH_DATA0_MASK (0xFFU) -#define I3C_SWDATAH_DATA0_SHIFT (0U) -/*! DATA0 - Data 0 */ -#define I3C_SWDATAH_DATA0(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAH_DATA0_SHIFT)) & I3C_SWDATAH_DATA0_MASK) - -#define I3C_SWDATAH_DATA1_MASK (0xFF00U) -#define I3C_SWDATAH_DATA1_SHIFT (8U) -/*! DATA1 - Data 1 */ -#define I3C_SWDATAH_DATA1(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAH_DATA1_SHIFT)) & I3C_SWDATAH_DATA1_MASK) - -#define I3C_SWDATAH_END_MASK (0x10000U) -#define I3C_SWDATAH_END_SHIFT (16U) -/*! END - End of Message - * 0b1..End - * 0b0..Not the end - */ -#define I3C_SWDATAH_END(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAH_END_SHIFT)) & I3C_SWDATAH_END_MASK) -/*! @} */ - -/*! @name SWDATAHE - Target Write Data Halfword End */ -/*! @{ */ - -#define I3C_SWDATAHE_DATA0_MASK (0xFFU) -#define I3C_SWDATAHE_DATA0_SHIFT (0U) -/*! DATA0 - Data 0 */ -#define I3C_SWDATAHE_DATA0(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAHE_DATA0_SHIFT)) & I3C_SWDATAHE_DATA0_MASK) - -#define I3C_SWDATAHE_DATA1_MASK (0xFF00U) -#define I3C_SWDATAHE_DATA1_SHIFT (8U) -/*! DATA1 - Data 1 */ -#define I3C_SWDATAHE_DATA1(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAHE_DATA1_SHIFT)) & I3C_SWDATAHE_DATA1_MASK) -/*! @} */ - -/*! @name SRDATAB - Target Read Data Byte */ -/*! @{ */ - -#define I3C_SRDATAB_DATA0_MASK (0xFFU) -#define I3C_SRDATAB_DATA0_SHIFT (0U) -/*! DATA0 - Data 0 */ -#define I3C_SRDATAB_DATA0(x) (((uint32_t)(((uint32_t)(x)) << I3C_SRDATAB_DATA0_SHIFT)) & I3C_SRDATAB_DATA0_MASK) -/*! @} */ - -/*! @name SRDATAH - Target Read Data Halfword */ -/*! @{ */ - -#define I3C_SRDATAH_LSB_MASK (0xFFU) -#define I3C_SRDATAH_LSB_SHIFT (0U) -/*! LSB - Low Byte */ -#define I3C_SRDATAH_LSB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SRDATAH_LSB_SHIFT)) & I3C_SRDATAH_LSB_MASK) - -#define I3C_SRDATAH_MSB_MASK (0xFF00U) -#define I3C_SRDATAH_MSB_SHIFT (8U) -/*! MSB - High Byte */ -#define I3C_SRDATAH_MSB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SRDATAH_MSB_SHIFT)) & I3C_SRDATAH_MSB_MASK) -/*! @} */ - -/*! @name SWDATAB1 - Target Write Data Byte */ -/*! @{ */ - -#define I3C_SWDATAB1_DATA_MASK (0xFFU) -#define I3C_SWDATAB1_DATA_SHIFT (0U) -/*! DATA - Data */ -#define I3C_SWDATAB1_DATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAB1_DATA_SHIFT)) & I3C_SWDATAB1_DATA_MASK) -/*! @} */ - -/*! @name SCAPABILITIES2 - Target Capabilities 2 */ -/*! @{ */ - -#define I3C_SCAPABILITIES2_MAPCNT_MASK (0xFU) -#define I3C_SCAPABILITIES2_MAPCNT_SHIFT (0U) -/*! MAPCNT - Map Count */ -#define I3C_SCAPABILITIES2_MAPCNT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_MAPCNT_SHIFT)) & I3C_SCAPABILITIES2_MAPCNT_MASK) - -#define I3C_SCAPABILITIES2_I2C10B_MASK (0x10U) -#define I3C_SCAPABILITIES2_I2C10B_SHIFT (4U) -/*! I2C10B - I2C 10-bit Address - * 0b0..Not supported - * 0b1..Supported - */ -#define I3C_SCAPABILITIES2_I2C10B(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_I2C10B_SHIFT)) & I3C_SCAPABILITIES2_I2C10B_MASK) - -#define I3C_SCAPABILITIES2_I2CRST_MASK (0x20U) -#define I3C_SCAPABILITIES2_I2CRST_SHIFT (5U) -/*! I2CRST - I2C Software Reset - * 0b0..Not supported - * 0b1..Supported - */ -#define I3C_SCAPABILITIES2_I2CRST(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_I2CRST_SHIFT)) & I3C_SCAPABILITIES2_I2CRST_MASK) - -#define I3C_SCAPABILITIES2_I2CDEVID_MASK (0x40U) -#define I3C_SCAPABILITIES2_I2CDEVID_SHIFT (6U) -/*! I2CDEVID - I2C Device ID - * 0b0..Not supported - * 0b1..Supported - */ -#define I3C_SCAPABILITIES2_I2CDEVID(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_I2CDEVID_SHIFT)) & I3C_SCAPABILITIES2_I2CDEVID_MASK) - -#define I3C_SCAPABILITIES2_IBIEXT_MASK (0x100U) -#define I3C_SCAPABILITIES2_IBIEXT_SHIFT (8U) -/*! IBIEXT - In-Band Interrupt EXTDATA - * 0b0..Not supported - * 0b1..Supported - */ -#define I3C_SCAPABILITIES2_IBIEXT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_IBIEXT_SHIFT)) & I3C_SCAPABILITIES2_IBIEXT_MASK) - -#define I3C_SCAPABILITIES2_IBIXREG_MASK (0x200U) -#define I3C_SCAPABILITIES2_IBIXREG_SHIFT (9U) -/*! IBIXREG - In-Band Interrupt Extended Register - * 0b0..Not supported - * 0b1..Supported - */ -#define I3C_SCAPABILITIES2_IBIXREG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_IBIXREG_SHIFT)) & I3C_SCAPABILITIES2_IBIXREG_MASK) - -#define I3C_SCAPABILITIES2_SLVRST_MASK (0x20000U) -#define I3C_SCAPABILITIES2_SLVRST_SHIFT (17U) -/*! SLVRST - Target Reset - * 0b0..Not supported - * 0b1..Supported - */ -#define I3C_SCAPABILITIES2_SLVRST(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_SLVRST_SHIFT)) & I3C_SCAPABILITIES2_SLVRST_MASK) - -#define I3C_SCAPABILITIES2_GROUP_MASK (0xC0000U) -#define I3C_SCAPABILITIES2_GROUP_SHIFT (18U) -/*! GROUP - Group - * 0b00..v1.1 group addressing not supported - * 0b01..One group supported - * 0b10..Two groups supported - * 0b11..Three groups supported - */ -#define I3C_SCAPABILITIES2_GROUP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_GROUP_SHIFT)) & I3C_SCAPABILITIES2_GROUP_MASK) - -#define I3C_SCAPABILITIES2_AASA_MASK (0x200000U) -#define I3C_SCAPABILITIES2_AASA_SHIFT (21U) -/*! AASA - SETAASA - * 0b1..SETAASA supported - * 0b0..SETAASA not supported - */ -#define I3C_SCAPABILITIES2_AASA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_AASA_SHIFT)) & I3C_SCAPABILITIES2_AASA_MASK) - -#define I3C_SCAPABILITIES2_SSTSUB_MASK (0x400000U) -#define I3C_SCAPABILITIES2_SSTSUB_SHIFT (22U) -/*! SSTSUB - Target-Target(s)-Tunnel Subscriber Capable - * 0b1..Subscriber capable - * 0b0..Not subscriber capable - */ -#define I3C_SCAPABILITIES2_SSTSUB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_SSTSUB_SHIFT)) & I3C_SCAPABILITIES2_SSTSUB_MASK) - -#define I3C_SCAPABILITIES2_SSTWR_MASK (0x800000U) -#define I3C_SCAPABILITIES2_SSTWR_SHIFT (23U) -/*! SSTWR - Target-Target(s)-Tunnel Write Capable - * 0b1..Write capable - * 0b0..Not write capable - */ -#define I3C_SCAPABILITIES2_SSTWR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_SSTWR_SHIFT)) & I3C_SCAPABILITIES2_SSTWR_MASK) -/*! @} */ - -/*! @name SCAPABILITIES - Target Capabilities */ -/*! @{ */ - -#define I3C_SCAPABILITIES_IDENA_MASK (0x3U) -#define I3C_SCAPABILITIES_IDENA_SHIFT (0U) -/*! IDENA - ID 48b Handler - * 0b00..Application - * 0b01..Hardware - * 0b10..Hardware, but the I3C module instance handles ID 48b - * 0b11..A part number register (PARTNO) - */ -#define I3C_SCAPABILITIES_IDENA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_IDENA_SHIFT)) & I3C_SCAPABILITIES_IDENA_MASK) - -#define I3C_SCAPABILITIES_IDREG_MASK (0x3CU) -#define I3C_SCAPABILITIES_IDREG_SHIFT (2U) -/*! IDREG - ID Register - * 0b0000..All ID register features disabled - * 0bxxx1..ID Instance is a register; used if there is no PARTNO register - * 0bxx1x..An ID Random field is available - * 0bx1xx..A Device Characteristic Register (DCR) is available - * 0b1xxx..A Bus Characteristics Register (BCR) is available - */ -#define I3C_SCAPABILITIES_IDREG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_IDREG_SHIFT)) & I3C_SCAPABILITIES_IDREG_MASK) - -#define I3C_SCAPABILITIES_HDRSUPP_MASK (0xC0U) -#define I3C_SCAPABILITIES_HDRSUPP_SHIFT (6U) -/*! HDRSUPP - High Data Rate Support - * 0b00..No HDR modes supported - * 0b01..DDR mode supported - * *.. - */ -#define I3C_SCAPABILITIES_HDRSUPP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_HDRSUPP_SHIFT)) & I3C_SCAPABILITIES_HDRSUPP_MASK) - -#define I3C_SCAPABILITIES_MASTER_MASK (0x200U) -#define I3C_SCAPABILITIES_MASTER_SHIFT (9U) -/*! MASTER - Controller - * 0b0..Not supported - * 0b1..Supported - */ -#define I3C_SCAPABILITIES_MASTER(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_MASTER_SHIFT)) & I3C_SCAPABILITIES_MASTER_MASK) - -#define I3C_SCAPABILITIES_SADDR_MASK (0xC00U) -#define I3C_SCAPABILITIES_SADDR_SHIFT (10U) -/*! SADDR - Static Address - * 0b00..No static address - * 0b01..Static address is fixed in hardware - * 0b10..Hardware controls the static address dynamically (for example, from the pin strap) - * 0b11..SCONFIG register supplies the static address - */ -#define I3C_SCAPABILITIES_SADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_SADDR_SHIFT)) & I3C_SCAPABILITIES_SADDR_MASK) - -#define I3C_SCAPABILITIES_CCCHANDLE_MASK (0xF000U) -#define I3C_SCAPABILITIES_CCCHANDLE_SHIFT (12U) -/*! CCCHANDLE - Common Command Codes Handling - * 0b0000..All handling features disabled - * 0bxxx1..The I3C module manages events, activities, status, HDR, and if enabled for it, ID and static-address-related items - * 0bxx1x..The I3C module manages maximum read and write lengths, and max data speed - * 0bx1xx..GETSTATUS CCC returns the values of SCTRL[PENDINT] and SCTRL[ACTSTATE] - * 0b1xxx..GETSTATUS CCC returns the value of SCTRL[VENDINFO] - */ -#define I3C_SCAPABILITIES_CCCHANDLE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_CCCHANDLE_SHIFT)) & I3C_SCAPABILITIES_CCCHANDLE_MASK) - -#define I3C_SCAPABILITIES_IBI_MR_HJ_MASK (0x1F0000U) -#define I3C_SCAPABILITIES_IBI_MR_HJ_SHIFT (16U) -/*! IBI_MR_HJ - In-Band Interrupts, Controller Requests, Hot-Join Events - * 0b00000..Application cannot generate IBI, CR, or HJ - * 0bxxxx1..Application can generate an IBI - * 0bxxx1x..When bit 0 = 1, the IBI has data from the SCTRL register - * 0bxx1xx..Application can generate a controller request for a secondary controller - * 0bx1xxx..Application can generate a Hot-Join event - * 0b1xxxx..Application can use SCONFIG[BAMATCH] for bus-available timing - */ -#define I3C_SCAPABILITIES_IBI_MR_HJ(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_IBI_MR_HJ_SHIFT)) & I3C_SCAPABILITIES_IBI_MR_HJ_MASK) - -#define I3C_SCAPABILITIES_TIMECTRL_MASK (0x200000U) -#define I3C_SCAPABILITIES_TIMECTRL_SHIFT (21U) -/*! TIMECTRL - Time Control - * 0b0..No time control supported - * 0b1..At least one time-control type supported - */ -#define I3C_SCAPABILITIES_TIMECTRL(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_TIMECTRL_SHIFT)) & I3C_SCAPABILITIES_TIMECTRL_MASK) - -#define I3C_SCAPABILITIES_EXTFIFO_MASK (0x3800000U) -#define I3C_SCAPABILITIES_EXTFIFO_SHIFT (23U) -/*! EXTFIFO - External FIFO - * 0b000..No external FIFO available - * 0b001..Standard available or free external FIFO - * 0b010..Request track external FIFO - * *.. - */ -#define I3C_SCAPABILITIES_EXTFIFO(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_EXTFIFO_SHIFT)) & I3C_SCAPABILITIES_EXTFIFO_MASK) - -#define I3C_SCAPABILITIES_FIFOTX_MASK (0xC000000U) -#define I3C_SCAPABILITIES_FIFOTX_SHIFT (26U) -/*! FIFOTX - FIFO Transmit - * 0b00..Two - * 0b01..Four - * 0b10..Eight - * 0b11..16 or larger - */ -#define I3C_SCAPABILITIES_FIFOTX(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_FIFOTX_SHIFT)) & I3C_SCAPABILITIES_FIFOTX_MASK) - -#define I3C_SCAPABILITIES_FIFORX_MASK (0x30000000U) -#define I3C_SCAPABILITIES_FIFORX_SHIFT (28U) -/*! FIFORX - FIFO Receive - * 0b00..Two or three - * 0b01..Four - * 0b10..Eight - * 0b11..16 or larger - */ -#define I3C_SCAPABILITIES_FIFORX(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_FIFORX_SHIFT)) & I3C_SCAPABILITIES_FIFORX_MASK) - -#define I3C_SCAPABILITIES_INT_MASK (0x40000000U) -#define I3C_SCAPABILITIES_INT_SHIFT (30U) -/*! INT - Interrupts - * 0b1..Supported - * 0b0..Not supported - */ -#define I3C_SCAPABILITIES_INT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_INT_SHIFT)) & I3C_SCAPABILITIES_INT_MASK) - -#define I3C_SCAPABILITIES_DMA_MASK (0x80000000U) -#define I3C_SCAPABILITIES_DMA_SHIFT (31U) -/*! DMA - Direct Memory Access - * 0b1..Supported - * 0b0..Not supported - */ -#define I3C_SCAPABILITIES_DMA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_DMA_SHIFT)) & I3C_SCAPABILITIES_DMA_MASK) -/*! @} */ - -/*! @name SDYNADDR - Target Dynamic Address */ -/*! @{ */ - -#define I3C_SDYNADDR_DAVALID_MASK (0x1U) -#define I3C_SDYNADDR_DAVALID_SHIFT (0U) -/*! DAVALID - Dynamic Address Valid - * 0b0..DANOTASSIGNED: a dynamic address is not assigned - * 0b1..DAASSIGNED: a dynamic address is assigned - */ -#define I3C_SDYNADDR_DAVALID(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDYNADDR_DAVALID_SHIFT)) & I3C_SDYNADDR_DAVALID_MASK) - -#define I3C_SDYNADDR_DADDR_MASK (0xFEU) -#define I3C_SDYNADDR_DADDR_SHIFT (1U) -/*! DADDR - Dynamic Address */ -#define I3C_SDYNADDR_DADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDYNADDR_DADDR_SHIFT)) & I3C_SDYNADDR_DADDR_MASK) - -#define I3C_SDYNADDR_MAPSA_MASK (0x1000U) -#define I3C_SDYNADDR_MAPSA_SHIFT (12U) -/*! MAPSA - Map a Static Address */ -#define I3C_SDYNADDR_MAPSA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDYNADDR_MAPSA_SHIFT)) & I3C_SDYNADDR_MAPSA_MASK) - -#define I3C_SDYNADDR_SA10B_MASK (0xE000U) -#define I3C_SDYNADDR_SA10B_SHIFT (13U) -/*! SA10B - 10-Bit Static Address */ -#define I3C_SDYNADDR_SA10B(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDYNADDR_SA10B_SHIFT)) & I3C_SDYNADDR_SA10B_MASK) - -#define I3C_SDYNADDR_KEY_MASK (0xFFFF0000U) -#define I3C_SDYNADDR_KEY_SHIFT (16U) -/*! KEY - Key */ -#define I3C_SDYNADDR_KEY(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDYNADDR_KEY_SHIFT)) & I3C_SDYNADDR_KEY_MASK) -/*! @} */ - -/*! @name SMAXLIMITS - Target Maximum Limits */ -/*! @{ */ - -#define I3C_SMAXLIMITS_MAXRD_MASK (0xFFFU) -#define I3C_SMAXLIMITS_MAXRD_SHIFT (0U) -/*! MAXRD - Maximum Read Length */ -#define I3C_SMAXLIMITS_MAXRD(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMAXLIMITS_MAXRD_SHIFT)) & I3C_SMAXLIMITS_MAXRD_MASK) - -#define I3C_SMAXLIMITS_MAXWR_MASK (0xFFF0000U) -#define I3C_SMAXLIMITS_MAXWR_SHIFT (16U) -/*! MAXWR - Maximum Write Length */ -#define I3C_SMAXLIMITS_MAXWR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMAXLIMITS_MAXWR_SHIFT)) & I3C_SMAXLIMITS_MAXWR_MASK) -/*! @} */ - -/*! @name SIDPARTNO - Target ID Part Number */ -/*! @{ */ - -#define I3C_SIDPARTNO_PARTNO_MASK (0xFFFFFFFFU) -#define I3C_SIDPARTNO_PARTNO_SHIFT (0U) -/*! PARTNO - Part Number */ -#define I3C_SIDPARTNO_PARTNO(x) (((uint32_t)(((uint32_t)(x)) << I3C_SIDPARTNO_PARTNO_SHIFT)) & I3C_SIDPARTNO_PARTNO_MASK) -/*! @} */ - -/*! @name SIDEXT - Target ID Extension */ -/*! @{ */ - -#define I3C_SIDEXT_DCR_MASK (0xFF00U) -#define I3C_SIDEXT_DCR_SHIFT (8U) -/*! DCR - Device Characteristic Register */ -#define I3C_SIDEXT_DCR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SIDEXT_DCR_SHIFT)) & I3C_SIDEXT_DCR_MASK) - -#define I3C_SIDEXT_BCR_MASK (0xFF0000U) -#define I3C_SIDEXT_BCR_SHIFT (16U) -/*! BCR - Bus Characteristics Register */ -#define I3C_SIDEXT_BCR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SIDEXT_BCR_SHIFT)) & I3C_SIDEXT_BCR_MASK) -/*! @} */ - -/*! @name SVENDORID - Target Vendor ID */ -/*! @{ */ - -#define I3C_SVENDORID_VID_MASK (0x7FFFU) -#define I3C_SVENDORID_VID_SHIFT (0U) -/*! VID - Vendor ID */ -#define I3C_SVENDORID_VID(x) (((uint32_t)(((uint32_t)(x)) << I3C_SVENDORID_VID_SHIFT)) & I3C_SVENDORID_VID_MASK) -/*! @} */ - -/*! @name STCCLOCK - Target Time Control Clock */ -/*! @{ */ - -#define I3C_STCCLOCK_ACCURACY_MASK (0xFFU) -#define I3C_STCCLOCK_ACCURACY_SHIFT (0U) -/*! ACCURACY - Clock Accuracy */ -#define I3C_STCCLOCK_ACCURACY(x) (((uint32_t)(((uint32_t)(x)) << I3C_STCCLOCK_ACCURACY_SHIFT)) & I3C_STCCLOCK_ACCURACY_MASK) - -#define I3C_STCCLOCK_FREQ_MASK (0xFF00U) -#define I3C_STCCLOCK_FREQ_SHIFT (8U) -/*! FREQ - Clock Frequency */ -#define I3C_STCCLOCK_FREQ(x) (((uint32_t)(((uint32_t)(x)) << I3C_STCCLOCK_FREQ_SHIFT)) & I3C_STCCLOCK_FREQ_MASK) -/*! @} */ - -/*! @name SMSGMAPADDR - Target Message Map Address */ -/*! @{ */ - -#define I3C_SMSGMAPADDR_MAPLAST_MASK (0xFU) -#define I3C_SMSGMAPADDR_MAPLAST_SHIFT (0U) -/*! MAPLAST - Matched Address Index */ -#define I3C_SMSGMAPADDR_MAPLAST(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMSGMAPADDR_MAPLAST_SHIFT)) & I3C_SMSGMAPADDR_MAPLAST_MASK) - -#define I3C_SMSGMAPADDR_LASTSTATIC_MASK (0x10U) -#define I3C_SMSGMAPADDR_LASTSTATIC_SHIFT (4U) -/*! LASTSTATIC - Last Static Address Matched - * 0b1..I2C static address - * 0b0..I3C dynamic address - */ -#define I3C_SMSGMAPADDR_LASTSTATIC(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMSGMAPADDR_LASTSTATIC_SHIFT)) & I3C_SMSGMAPADDR_LASTSTATIC_MASK) - -#define I3C_SMSGMAPADDR_MAPLASTM1_MASK (0xF00U) -#define I3C_SMSGMAPADDR_MAPLASTM1_SHIFT (8U) -/*! MAPLASTM1 - Matched Previous Address Index 1 */ -#define I3C_SMSGMAPADDR_MAPLASTM1(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMSGMAPADDR_MAPLASTM1_SHIFT)) & I3C_SMSGMAPADDR_MAPLASTM1_MASK) - -#define I3C_SMSGMAPADDR_MAPLASTM2_MASK (0xF0000U) -#define I3C_SMSGMAPADDR_MAPLASTM2_SHIFT (16U) -/*! MAPLASTM2 - Matched Previous Index 2 */ -#define I3C_SMSGMAPADDR_MAPLASTM2(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMSGMAPADDR_MAPLASTM2_SHIFT)) & I3C_SMSGMAPADDR_MAPLASTM2_MASK) -/*! @} */ - -/*! @name MCTRL - Controller Control */ -/*! @{ */ - -#define I3C_MCTRL_REQUEST_MASK (0x7U) -#define I3C_MCTRL_REQUEST_SHIFT (0U) -/*! REQUEST - Request - * 0b000..NONE - * 0b001..EMITSTARTADDR - * 0b010..EMITSTOP - * 0b011..IBIACKNACK - * 0b100..PROCESSDAA - * 0b101.. - * 0b110..Force Exit and Target Reset - * 0b111..AUTOIBI - */ -#define I3C_MCTRL_REQUEST(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCTRL_REQUEST_SHIFT)) & I3C_MCTRL_REQUEST_MASK) - -#define I3C_MCTRL_TYPE_MASK (0x30U) -#define I3C_MCTRL_TYPE_SHIFT (4U) -/*! TYPE - Bus Type with EmitStartAddr - * 0b00..I3C - * 0b01..I2C - * 0b10..DDR - * 0b11.. - */ -#define I3C_MCTRL_TYPE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCTRL_TYPE_SHIFT)) & I3C_MCTRL_TYPE_MASK) - -#define I3C_MCTRL_IBIRESP_MASK (0xC0U) -#define I3C_MCTRL_IBIRESP_SHIFT (6U) -/*! IBIRESP - In-Band Interrupt Response - * 0b00..ACK (acknowledge) - * 0b01..NACK (reject) - * 0b10..Acknowledge with mandatory byte - * 0b11..Manual - */ -#define I3C_MCTRL_IBIRESP(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCTRL_IBIRESP_SHIFT)) & I3C_MCTRL_IBIRESP_MASK) - -#define I3C_MCTRL_DIR_MASK (0x100U) -#define I3C_MCTRL_DIR_SHIFT (8U) -/*! DIR - Direction - * 0b0..Write - * 0b1..Read - */ -#define I3C_MCTRL_DIR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCTRL_DIR_SHIFT)) & I3C_MCTRL_DIR_MASK) - -#define I3C_MCTRL_ADDR_MASK (0xFE00U) -#define I3C_MCTRL_ADDR_SHIFT (9U) -/*! ADDR - Address */ -#define I3C_MCTRL_ADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCTRL_ADDR_SHIFT)) & I3C_MCTRL_ADDR_MASK) - -#define I3C_MCTRL_RDTERM_MASK (0xFF0000U) -#define I3C_MCTRL_RDTERM_SHIFT (16U) -/*! RDTERM - Read Terminate Counter */ -#define I3C_MCTRL_RDTERM(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCTRL_RDTERM_SHIFT)) & I3C_MCTRL_RDTERM_MASK) -/*! @} */ - -/*! @name MSTATUS - Controller Status */ -/*! @{ */ - -#define I3C_MSTATUS_STATE_MASK (0x7U) -#define I3C_MSTATUS_STATE_SHIFT (0U) -/*! STATE - State of the Controller - * 0b000..IDLE (bus has stopped) - * 0b001..SLVREQ (target request) - * 0b010..MSGSDR - * 0b011..NORMACT - * 0b100..MSGDDR - * 0b101..DAA - * 0b110..IBIACK - * 0b111..IBIRCV - */ -#define I3C_MSTATUS_STATE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_STATE_SHIFT)) & I3C_MSTATUS_STATE_MASK) - -#define I3C_MSTATUS_BETWEEN_MASK (0x10U) -#define I3C_MSTATUS_BETWEEN_SHIFT (4U) -/*! BETWEEN - Between - * 0b0..Inactive (for other cases) - * 0b1..Active - */ -#define I3C_MSTATUS_BETWEEN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_BETWEEN_SHIFT)) & I3C_MSTATUS_BETWEEN_MASK) - -#define I3C_MSTATUS_NACKED_MASK (0x20U) -#define I3C_MSTATUS_NACKED_SHIFT (5U) -/*! NACKED - Not Acknowledged - * 0b1..NACKed (not acknowledged) - * 0b0..Not NACKed - */ -#define I3C_MSTATUS_NACKED(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_NACKED_SHIFT)) & I3C_MSTATUS_NACKED_MASK) - -#define I3C_MSTATUS_IBITYPE_MASK (0xC0U) -#define I3C_MSTATUS_IBITYPE_SHIFT (6U) -/*! IBITYPE - In-Band Interrupt (IBI) Type - * 0b00..NONE (no IBI: this status occurs when MSTATUS[IBIWON] becomes 0) - * 0b01..IBI - * 0b10..CR - * 0b11..HJ - */ -#define I3C_MSTATUS_IBITYPE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_IBITYPE_SHIFT)) & I3C_MSTATUS_IBITYPE_MASK) - -#define I3C_MSTATUS_SLVSTART_MASK (0x100U) -#define I3C_MSTATUS_SLVSTART_SHIFT (8U) -/*! SLVSTART - Target Start - * 0b1..Target requesting START - * 0b0..Target not requesting START - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MSTATUS_SLVSTART(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_SLVSTART_SHIFT)) & I3C_MSTATUS_SLVSTART_MASK) - -#define I3C_MSTATUS_MCTRLDONE_MASK (0x200U) -#define I3C_MSTATUS_MCTRLDONE_SHIFT (9U) -/*! MCTRLDONE - Controller Control Done - * 0b1..Done - * 0b0..Not done - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MSTATUS_MCTRLDONE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_MCTRLDONE_SHIFT)) & I3C_MSTATUS_MCTRLDONE_MASK) - -#define I3C_MSTATUS_COMPLETE_MASK (0x400U) -#define I3C_MSTATUS_COMPLETE_SHIFT (10U) -/*! COMPLETE - Complete - * 0b1..Complete - * 0b0..Not complete - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MSTATUS_COMPLETE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_COMPLETE_SHIFT)) & I3C_MSTATUS_COMPLETE_MASK) - -#define I3C_MSTATUS_RXPEND_MASK (0x800U) -#define I3C_MSTATUS_RXPEND_SHIFT (11U) -/*! RXPEND - RXPEND - * 0b1..Receive message pending - * 0b0..No receive message pending - */ -#define I3C_MSTATUS_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_RXPEND_SHIFT)) & I3C_MSTATUS_RXPEND_MASK) - -#define I3C_MSTATUS_TXNOTFULL_MASK (0x1000U) -#define I3C_MSTATUS_TXNOTFULL_SHIFT (12U) -/*! TXNOTFULL - TX Buffer or FIFO Not Full - * 0b1..Receive buffer or FIFO not full - * 0b0..Receive buffer or FIFO full - */ -#define I3C_MSTATUS_TXNOTFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_TXNOTFULL_SHIFT)) & I3C_MSTATUS_TXNOTFULL_MASK) - -#define I3C_MSTATUS_IBIWON_MASK (0x2000U) -#define I3C_MSTATUS_IBIWON_SHIFT (13U) -/*! IBIWON - In-Band Interrupt (IBI) Won - * 0b1..IBI arbitration won - * 0b0..No IBI arbitration won - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MSTATUS_IBIWON(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_IBIWON_SHIFT)) & I3C_MSTATUS_IBIWON_MASK) - -#define I3C_MSTATUS_ERRWARN_MASK (0x8000U) -#define I3C_MSTATUS_ERRWARN_SHIFT (15U) -/*! ERRWARN - Error or Warning - * 0b1..Error or warning - * 0b0..No error or warning - */ -#define I3C_MSTATUS_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_ERRWARN_SHIFT)) & I3C_MSTATUS_ERRWARN_MASK) - -#define I3C_MSTATUS_NOWMASTER_MASK (0x80000U) -#define I3C_MSTATUS_NOWMASTER_SHIFT (19U) -/*! NOWMASTER - Module is now Controller - * 0b1..Controller - * 0b0..Not a controller - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MSTATUS_NOWMASTER(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_NOWMASTER_SHIFT)) & I3C_MSTATUS_NOWMASTER_MASK) - -#define I3C_MSTATUS_IBIADDR_MASK (0x7F000000U) -#define I3C_MSTATUS_IBIADDR_SHIFT (24U) -/*! IBIADDR - IBI Address */ -#define I3C_MSTATUS_IBIADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_IBIADDR_SHIFT)) & I3C_MSTATUS_IBIADDR_MASK) -/*! @} */ - -/*! @name MIBIRULES - Controller In-band Interrupt Registry and Rules */ -/*! @{ */ - -#define I3C_MIBIRULES_ADDR0_MASK (0x3FU) -#define I3C_MIBIRULES_ADDR0_SHIFT (0U) -/*! ADDR0 - ADDR0 */ -#define I3C_MIBIRULES_ADDR0(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_ADDR0_SHIFT)) & I3C_MIBIRULES_ADDR0_MASK) - -#define I3C_MIBIRULES_ADDR1_MASK (0xFC0U) -#define I3C_MIBIRULES_ADDR1_SHIFT (6U) -/*! ADDR1 - ADDR1 */ -#define I3C_MIBIRULES_ADDR1(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_ADDR1_SHIFT)) & I3C_MIBIRULES_ADDR1_MASK) - -#define I3C_MIBIRULES_ADDR2_MASK (0x3F000U) -#define I3C_MIBIRULES_ADDR2_SHIFT (12U) -/*! ADDR2 - ADDR2 */ -#define I3C_MIBIRULES_ADDR2(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_ADDR2_SHIFT)) & I3C_MIBIRULES_ADDR2_MASK) - -#define I3C_MIBIRULES_ADDR3_MASK (0xFC0000U) -#define I3C_MIBIRULES_ADDR3_SHIFT (18U) -/*! ADDR3 - ADDR3 */ -#define I3C_MIBIRULES_ADDR3(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_ADDR3_SHIFT)) & I3C_MIBIRULES_ADDR3_MASK) - -#define I3C_MIBIRULES_ADDR4_MASK (0x3F000000U) -#define I3C_MIBIRULES_ADDR4_SHIFT (24U) -/*! ADDR4 - ADDR4 */ -#define I3C_MIBIRULES_ADDR4(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_ADDR4_SHIFT)) & I3C_MIBIRULES_ADDR4_MASK) - -#define I3C_MIBIRULES_MSB0_MASK (0x40000000U) -#define I3C_MIBIRULES_MSB0_SHIFT (30U) -/*! MSB0 - Most Significant Address Bit is 0 - * 0b1..MSB is 0 - * 0b0..MSB is not 0 - */ -#define I3C_MIBIRULES_MSB0(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_MSB0_SHIFT)) & I3C_MIBIRULES_MSB0_MASK) - -#define I3C_MIBIRULES_NOBYTE_MASK (0x80000000U) -#define I3C_MIBIRULES_NOBYTE_SHIFT (31U) -/*! NOBYTE - No IBI byte - * 0b1..Without mandatory IBI byte - * 0b0..With mandatory IBI byte - */ -#define I3C_MIBIRULES_NOBYTE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_NOBYTE_SHIFT)) & I3C_MIBIRULES_NOBYTE_MASK) -/*! @} */ - -/*! @name MINTSET - Controller Interrupt Set */ -/*! @{ */ - -#define I3C_MINTSET_SLVSTART_MASK (0x100U) -#define I3C_MINTSET_SLVSTART_SHIFT (8U) -/*! SLVSTART - Target Start Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_SLVSTART(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_SLVSTART_SHIFT)) & I3C_MINTSET_SLVSTART_MASK) - -#define I3C_MINTSET_MCTRLDONE_MASK (0x200U) -#define I3C_MINTSET_MCTRLDONE_SHIFT (9U) -/*! MCTRLDONE - Controller Control Done Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_MCTRLDONE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_MCTRLDONE_SHIFT)) & I3C_MINTSET_MCTRLDONE_MASK) - -#define I3C_MINTSET_COMPLETE_MASK (0x400U) -#define I3C_MINTSET_COMPLETE_SHIFT (10U) -/*! COMPLETE - Completed Message Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_COMPLETE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_COMPLETE_SHIFT)) & I3C_MINTSET_COMPLETE_MASK) - -#define I3C_MINTSET_RXPEND_MASK (0x800U) -#define I3C_MINTSET_RXPEND_SHIFT (11U) -/*! RXPEND - Receive Pending Interrupt Enable */ -#define I3C_MINTSET_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_RXPEND_SHIFT)) & I3C_MINTSET_RXPEND_MASK) - -#define I3C_MINTSET_TXNOTFULL_MASK (0x1000U) -#define I3C_MINTSET_TXNOTFULL_SHIFT (12U) -/*! TXNOTFULL - Transmit Buffer/FIFO Not Full Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_TXNOTFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_TXNOTFULL_SHIFT)) & I3C_MINTSET_TXNOTFULL_MASK) - -#define I3C_MINTSET_IBIWON_MASK (0x2000U) -#define I3C_MINTSET_IBIWON_SHIFT (13U) -/*! IBIWON - IBI Won Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_IBIWON(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_IBIWON_SHIFT)) & I3C_MINTSET_IBIWON_MASK) - -#define I3C_MINTSET_ERRWARN_MASK (0x8000U) -#define I3C_MINTSET_ERRWARN_SHIFT (15U) -/*! ERRWARN - Error or Warning (ERRWARN) Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_ERRWARN_SHIFT)) & I3C_MINTSET_ERRWARN_MASK) - -#define I3C_MINTSET_NOWMASTER_MASK (0x80000U) -#define I3C_MINTSET_NOWMASTER_SHIFT (19U) -/*! NOWMASTER - Now Controller Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_NOWMASTER(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_NOWMASTER_SHIFT)) & I3C_MINTSET_NOWMASTER_MASK) -/*! @} */ - -/*! @name MINTCLR - Controller Interrupt Clear */ -/*! @{ */ - -#define I3C_MINTCLR_SLVSTART_MASK (0x100U) -#define I3C_MINTCLR_SLVSTART_SHIFT (8U) -/*! SLVSTART - SLVSTART Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_SLVSTART(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_SLVSTART_SHIFT)) & I3C_MINTCLR_SLVSTART_MASK) - -#define I3C_MINTCLR_MCTRLDONE_MASK (0x200U) -#define I3C_MINTCLR_MCTRLDONE_SHIFT (9U) -/*! MCTRLDONE - MCTRLDONE Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_MCTRLDONE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_MCTRLDONE_SHIFT)) & I3C_MINTCLR_MCTRLDONE_MASK) - -#define I3C_MINTCLR_COMPLETE_MASK (0x400U) -#define I3C_MINTCLR_COMPLETE_SHIFT (10U) -/*! COMPLETE - COMPLETE Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_COMPLETE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_COMPLETE_SHIFT)) & I3C_MINTCLR_COMPLETE_MASK) - -#define I3C_MINTCLR_RXPEND_MASK (0x800U) -#define I3C_MINTCLR_RXPEND_SHIFT (11U) -/*! RXPEND - RXPEND Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_RXPEND_SHIFT)) & I3C_MINTCLR_RXPEND_MASK) - -#define I3C_MINTCLR_TXNOTFULL_MASK (0x1000U) -#define I3C_MINTCLR_TXNOTFULL_SHIFT (12U) -/*! TXNOTFULL - TXNOTFULL Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_TXNOTFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_TXNOTFULL_SHIFT)) & I3C_MINTCLR_TXNOTFULL_MASK) - -#define I3C_MINTCLR_IBIWON_MASK (0x2000U) -#define I3C_MINTCLR_IBIWON_SHIFT (13U) -/*! IBIWON - IBIWON Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_IBIWON(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_IBIWON_SHIFT)) & I3C_MINTCLR_IBIWON_MASK) - -#define I3C_MINTCLR_ERRWARN_MASK (0x8000U) -#define I3C_MINTCLR_ERRWARN_SHIFT (15U) -/*! ERRWARN - ERRWARN Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_ERRWARN_SHIFT)) & I3C_MINTCLR_ERRWARN_MASK) - -#define I3C_MINTCLR_NOWMASTER_MASK (0x80000U) -#define I3C_MINTCLR_NOWMASTER_SHIFT (19U) -/*! NOWMASTER - NOWCONTROLLER Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_NOWMASTER(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_NOWMASTER_SHIFT)) & I3C_MINTCLR_NOWMASTER_MASK) -/*! @} */ - -/*! @name MINTMASKED - Controller Interrupt Mask */ -/*! @{ */ - -#define I3C_MINTMASKED_SLVSTART_MASK (0x100U) -#define I3C_MINTMASKED_SLVSTART_SHIFT (8U) -/*! SLVSTART - SLVSTART Interrupt Mask - * 0b1..Enabled - * 0b0..Disabled - */ -#define I3C_MINTMASKED_SLVSTART(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_SLVSTART_SHIFT)) & I3C_MINTMASKED_SLVSTART_MASK) - -#define I3C_MINTMASKED_MCTRLDONE_MASK (0x200U) -#define I3C_MINTMASKED_MCTRLDONE_SHIFT (9U) -/*! MCTRLDONE - MCTRLDONE Interrupt Mask - * 0b1..Enabled - * 0b0..Disabled - */ -#define I3C_MINTMASKED_MCTRLDONE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_MCTRLDONE_SHIFT)) & I3C_MINTMASKED_MCTRLDONE_MASK) - -#define I3C_MINTMASKED_COMPLETE_MASK (0x400U) -#define I3C_MINTMASKED_COMPLETE_SHIFT (10U) -/*! COMPLETE - COMPLETE Interrupt Mask - * 0b1..Enabled - * 0b0..Disabled - */ -#define I3C_MINTMASKED_COMPLETE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_COMPLETE_SHIFT)) & I3C_MINTMASKED_COMPLETE_MASK) - -#define I3C_MINTMASKED_RXPEND_MASK (0x800U) -#define I3C_MINTMASKED_RXPEND_SHIFT (11U) -/*! RXPEND - RXPEND Interrupt Mask */ -#define I3C_MINTMASKED_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_RXPEND_SHIFT)) & I3C_MINTMASKED_RXPEND_MASK) - -#define I3C_MINTMASKED_TXNOTFULL_MASK (0x1000U) -#define I3C_MINTMASKED_TXNOTFULL_SHIFT (12U) -/*! TXNOTFULL - TXNOTFULL Interrupt Mask - * 0b1..Enabled - * 0b0..Disabled - */ -#define I3C_MINTMASKED_TXNOTFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_TXNOTFULL_SHIFT)) & I3C_MINTMASKED_TXNOTFULL_MASK) - -#define I3C_MINTMASKED_IBIWON_MASK (0x2000U) -#define I3C_MINTMASKED_IBIWON_SHIFT (13U) -/*! IBIWON - IBIWON Interrupt Mask - * 0b1..Enabled - * 0b0..Disabled - */ -#define I3C_MINTMASKED_IBIWON(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_IBIWON_SHIFT)) & I3C_MINTMASKED_IBIWON_MASK) - -#define I3C_MINTMASKED_ERRWARN_MASK (0x8000U) -#define I3C_MINTMASKED_ERRWARN_SHIFT (15U) -/*! ERRWARN - ERRWARN Interrupt Mask - * 0b1..Enabled - * 0b0..Disabled - */ -#define I3C_MINTMASKED_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_ERRWARN_SHIFT)) & I3C_MINTMASKED_ERRWARN_MASK) - -#define I3C_MINTMASKED_NOWMASTER_MASK (0x80000U) -#define I3C_MINTMASKED_NOWMASTER_SHIFT (19U) -/*! NOWMASTER - NOWCONTROLLER Interrupt Mask - * 0b1..Enabled - * 0b0..Disabled - */ -#define I3C_MINTMASKED_NOWMASTER(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_NOWMASTER_SHIFT)) & I3C_MINTMASKED_NOWMASTER_MASK) -/*! @} */ - -/*! @name MERRWARN - Controller Errors and Warnings */ -/*! @{ */ - -#define I3C_MERRWARN_NACK_MASK (0x4U) -#define I3C_MERRWARN_NACK_SHIFT (2U) -/*! NACK - Not Acknowledge Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_NACK(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_NACK_SHIFT)) & I3C_MERRWARN_NACK_MASK) - -#define I3C_MERRWARN_WRABT_MASK (0x8U) -#define I3C_MERRWARN_WRABT_SHIFT (3U) -/*! WRABT - Write Abort Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_WRABT(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_WRABT_SHIFT)) & I3C_MERRWARN_WRABT_MASK) - -#define I3C_MERRWARN_HPAR_MASK (0x200U) -#define I3C_MERRWARN_HPAR_SHIFT (9U) -/*! HPAR - High Data Rate Parity - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_HPAR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_HPAR_SHIFT)) & I3C_MERRWARN_HPAR_MASK) - -#define I3C_MERRWARN_HCRC_MASK (0x400U) -#define I3C_MERRWARN_HCRC_SHIFT (10U) -/*! HCRC - High Data Rate CRC Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_HCRC(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_HCRC_SHIFT)) & I3C_MERRWARN_HCRC_MASK) - -#define I3C_MERRWARN_OREAD_MASK (0x10000U) -#define I3C_MERRWARN_OREAD_SHIFT (16U) -/*! OREAD - Overread Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_OREAD(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_OREAD_SHIFT)) & I3C_MERRWARN_OREAD_MASK) - -#define I3C_MERRWARN_OWRITE_MASK (0x20000U) -#define I3C_MERRWARN_OWRITE_SHIFT (17U) -/*! OWRITE - Overwrite Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_OWRITE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_OWRITE_SHIFT)) & I3C_MERRWARN_OWRITE_MASK) - -#define I3C_MERRWARN_MSGERR_MASK (0x40000U) -#define I3C_MERRWARN_MSGERR_SHIFT (18U) -/*! MSGERR - Message Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_MSGERR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_MSGERR_SHIFT)) & I3C_MERRWARN_MSGERR_MASK) - -#define I3C_MERRWARN_INVREQ_MASK (0x80000U) -#define I3C_MERRWARN_INVREQ_SHIFT (19U) -/*! INVREQ - Invalid Request Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_INVREQ(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_INVREQ_SHIFT)) & I3C_MERRWARN_INVREQ_MASK) - -#define I3C_MERRWARN_TIMEOUT_MASK (0x100000U) -#define I3C_MERRWARN_TIMEOUT_SHIFT (20U) -/*! TIMEOUT - Timeout Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_TIMEOUT(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_TIMEOUT_SHIFT)) & I3C_MERRWARN_TIMEOUT_MASK) -/*! @} */ - -/*! @name MDMACTRL - Controller DMA Control */ -/*! @{ */ - -#define I3C_MDMACTRL_DMAFB_MASK (0x3U) -#define I3C_MDMACTRL_DMAFB_SHIFT (0U) -/*! DMAFB - DMA from Bus - * 0b00..DMA not used - * 0b01..Enable DMA for one frame - * 0b10..Enable DMA until DMA is turned off - * 0b11.. - */ -#define I3C_MDMACTRL_DMAFB(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDMACTRL_DMAFB_SHIFT)) & I3C_MDMACTRL_DMAFB_MASK) - -#define I3C_MDMACTRL_DMATB_MASK (0xCU) -#define I3C_MDMACTRL_DMATB_SHIFT (2U) -/*! DMATB - DMA to Bus - * 0b00..DMA not used - * 0b01..Enable DMA for one frame (ended by DMA or terminated) - * 0b10..Enable DMA until DMA is turned off - * 0b11.. - */ -#define I3C_MDMACTRL_DMATB(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDMACTRL_DMATB_SHIFT)) & I3C_MDMACTRL_DMATB_MASK) - -#define I3C_MDMACTRL_DMAWIDTH_MASK (0x30U) -#define I3C_MDMACTRL_DMAWIDTH_SHIFT (4U) -/*! DMAWIDTH - DMA Width - * 0b00, 0b01..Byte - * 0b10..Halfword (16 bits) - * 0b11.. - */ -#define I3C_MDMACTRL_DMAWIDTH(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDMACTRL_DMAWIDTH_SHIFT)) & I3C_MDMACTRL_DMAWIDTH_MASK) -/*! @} */ - -/*! @name MDATACTRL - Controller Data Control */ -/*! @{ */ - -#define I3C_MDATACTRL_FLUSHTB_MASK (0x1U) -#define I3C_MDATACTRL_FLUSHTB_SHIFT (0U) -/*! FLUSHTB - Flush To-Bus Buffer or FIFO - * 0b1..Flush the buffer - * 0b0..No action - */ -#define I3C_MDATACTRL_FLUSHTB(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_FLUSHTB_SHIFT)) & I3C_MDATACTRL_FLUSHTB_MASK) - -#define I3C_MDATACTRL_FLUSHFB_MASK (0x2U) -#define I3C_MDATACTRL_FLUSHFB_SHIFT (1U) -/*! FLUSHFB - Flush From-Bus Buffer or FIFO - * 0b1..Flush the buffer - * 0b0..No action - */ -#define I3C_MDATACTRL_FLUSHFB(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_FLUSHFB_SHIFT)) & I3C_MDATACTRL_FLUSHFB_MASK) - -#define I3C_MDATACTRL_UNLOCK_MASK (0x8U) -#define I3C_MDATACTRL_UNLOCK_SHIFT (3U) -/*! UNLOCK - Unlock - * 0b0..Locked - * 0b1..Unlocked - */ -#define I3C_MDATACTRL_UNLOCK(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_UNLOCK_SHIFT)) & I3C_MDATACTRL_UNLOCK_MASK) - -#define I3C_MDATACTRL_TXTRIG_MASK (0x30U) -#define I3C_MDATACTRL_TXTRIG_SHIFT (4U) -/*! TXTRIG - Transmit Trigger Level - * 0b00..Trigger when empty - * 0b01..Trigger when 1/4 full or less - * 0b10..Trigger when 1/2 full or less - * 0b11..Trigger when 1 less than full or less (default) - */ -#define I3C_MDATACTRL_TXTRIG(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_TXTRIG_SHIFT)) & I3C_MDATACTRL_TXTRIG_MASK) - -#define I3C_MDATACTRL_RXTRIG_MASK (0xC0U) -#define I3C_MDATACTRL_RXTRIG_SHIFT (6U) -/*! RXTRIG - Receive Trigger Level - * 0b00..Trigger when not empty - * 0b01..Trigger when 1/4 full or more - * 0b10..Trigger when 1/2 full or more - * 0b11..Trigger when 3/4 full or more - */ -#define I3C_MDATACTRL_RXTRIG(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_RXTRIG_SHIFT)) & I3C_MDATACTRL_RXTRIG_MASK) - -#define I3C_MDATACTRL_TXCOUNT_MASK (0x1F0000U) -#define I3C_MDATACTRL_TXCOUNT_SHIFT (16U) -/*! TXCOUNT - Transmit Byte Count */ -#define I3C_MDATACTRL_TXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_TXCOUNT_SHIFT)) & I3C_MDATACTRL_TXCOUNT_MASK) - -#define I3C_MDATACTRL_RXCOUNT_MASK (0x1F000000U) -#define I3C_MDATACTRL_RXCOUNT_SHIFT (24U) -/*! RXCOUNT - Receive Byte Count */ -#define I3C_MDATACTRL_RXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_RXCOUNT_SHIFT)) & I3C_MDATACTRL_RXCOUNT_MASK) - -#define I3C_MDATACTRL_TXFULL_MASK (0x40000000U) -#define I3C_MDATACTRL_TXFULL_SHIFT (30U) -/*! TXFULL - Transmit is Full - * 0b0..Not full - * 0b1..Full - */ -#define I3C_MDATACTRL_TXFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_TXFULL_SHIFT)) & I3C_MDATACTRL_TXFULL_MASK) - -#define I3C_MDATACTRL_RXEMPTY_MASK (0x80000000U) -#define I3C_MDATACTRL_RXEMPTY_SHIFT (31U) -/*! RXEMPTY - Receive is Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define I3C_MDATACTRL_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_RXEMPTY_SHIFT)) & I3C_MDATACTRL_RXEMPTY_MASK) -/*! @} */ - -/*! @name MWDATAB - Controller Write Data Byte */ -/*! @{ */ - -#define I3C_MWDATAB_VALUE_MASK (0xFFU) -#define I3C_MWDATAB_VALUE_SHIFT (0U) -/*! VALUE - Data Byte */ -#define I3C_MWDATAB_VALUE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAB_VALUE_SHIFT)) & I3C_MWDATAB_VALUE_MASK) - -#define I3C_MWDATAB_END_MASK (0x100U) -#define I3C_MWDATAB_END_SHIFT (8U) -/*! END - End of Message - * 0b0..Not the end - * 0b1..End - */ -#define I3C_MWDATAB_END(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAB_END_SHIFT)) & I3C_MWDATAB_END_MASK) - -#define I3C_MWDATAB_END_ALSO_MASK (0x10000U) -#define I3C_MWDATAB_END_ALSO_SHIFT (16U) -/*! END_ALSO - End of Message ALSO - * 0b0..Not the end - * 0b1..End - */ -#define I3C_MWDATAB_END_ALSO(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAB_END_ALSO_SHIFT)) & I3C_MWDATAB_END_ALSO_MASK) -/*! @} */ - -/*! @name MWDATABE - Controller Write Data Byte End */ -/*! @{ */ - -#define I3C_MWDATABE_VALUE_MASK (0xFFU) -#define I3C_MWDATABE_VALUE_SHIFT (0U) -/*! VALUE - Data */ -#define I3C_MWDATABE_VALUE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATABE_VALUE_SHIFT)) & I3C_MWDATABE_VALUE_MASK) -/*! @} */ - -/*! @name MWDATAH - Controller Write Data Halfword */ -/*! @{ */ - -#define I3C_MWDATAH_DATA0_MASK (0xFFU) -#define I3C_MWDATAH_DATA0_SHIFT (0U) -/*! DATA0 - Data Byte 0 */ -#define I3C_MWDATAH_DATA0(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAH_DATA0_SHIFT)) & I3C_MWDATAH_DATA0_MASK) - -#define I3C_MWDATAH_DATA1_MASK (0xFF00U) -#define I3C_MWDATAH_DATA1_SHIFT (8U) -/*! DATA1 - Data Byte 1 */ -#define I3C_MWDATAH_DATA1(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAH_DATA1_SHIFT)) & I3C_MWDATAH_DATA1_MASK) - -#define I3C_MWDATAH_END_MASK (0x10000U) -#define I3C_MWDATAH_END_SHIFT (16U) -/*! END - End of Message - * 0b0..Not the end - * 0b1..End - */ -#define I3C_MWDATAH_END(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAH_END_SHIFT)) & I3C_MWDATAH_END_MASK) -/*! @} */ - -/*! @name MWDATAHE - Controller Write Data Halfword End */ -/*! @{ */ - -#define I3C_MWDATAHE_DATA0_MASK (0xFFU) -#define I3C_MWDATAHE_DATA0_SHIFT (0U) -/*! DATA0 - Data Byte 0 */ -#define I3C_MWDATAHE_DATA0(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAHE_DATA0_SHIFT)) & I3C_MWDATAHE_DATA0_MASK) - -#define I3C_MWDATAHE_DATA1_MASK (0xFF00U) -#define I3C_MWDATAHE_DATA1_SHIFT (8U) -/*! DATA1 - Data Byte 1 */ -#define I3C_MWDATAHE_DATA1(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAHE_DATA1_SHIFT)) & I3C_MWDATAHE_DATA1_MASK) -/*! @} */ - -/*! @name MRDATAB - Controller Read Data Byte */ -/*! @{ */ - -#define I3C_MRDATAB_VALUE_MASK (0xFFU) -#define I3C_MRDATAB_VALUE_SHIFT (0U) -/*! VALUE - Value */ -#define I3C_MRDATAB_VALUE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MRDATAB_VALUE_SHIFT)) & I3C_MRDATAB_VALUE_MASK) -/*! @} */ - -/*! @name MRDATAH - Controller Read Data Halfword */ -/*! @{ */ - -#define I3C_MRDATAH_LSB_MASK (0xFFU) -#define I3C_MRDATAH_LSB_SHIFT (0U) -/*! LSB - Low Byte */ -#define I3C_MRDATAH_LSB(x) (((uint32_t)(((uint32_t)(x)) << I3C_MRDATAH_LSB_SHIFT)) & I3C_MRDATAH_LSB_MASK) - -#define I3C_MRDATAH_MSB_MASK (0xFF00U) -#define I3C_MRDATAH_MSB_SHIFT (8U) -/*! MSB - High Byte */ -#define I3C_MRDATAH_MSB(x) (((uint32_t)(((uint32_t)(x)) << I3C_MRDATAH_MSB_SHIFT)) & I3C_MRDATAH_MSB_MASK) -/*! @} */ - -/*! @name MWDATAB1 - Controller Write Byte Data 1 (to Bus) */ -/*! @{ */ - -#define I3C_MWDATAB1_VALUE_MASK (0xFFU) -#define I3C_MWDATAB1_VALUE_SHIFT (0U) -/*! VALUE - Value */ -#define I3C_MWDATAB1_VALUE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAB1_VALUE_SHIFT)) & I3C_MWDATAB1_VALUE_MASK) -/*! @} */ - -/*! @name MWMSG_SDR_CONTROL - Controller Write Message Control in SDR mode */ -/*! @{ */ - -#define I3C_MWMSG_SDR_CONTROL_DIR_MASK (0x1U) -#define I3C_MWMSG_SDR_CONTROL_DIR_SHIFT (0U) -/*! DIR - Direction - * 0b0..Write - * 0b1..Read - */ -#define I3C_MWMSG_SDR_CONTROL_DIR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_SDR_CONTROL_DIR_SHIFT)) & I3C_MWMSG_SDR_CONTROL_DIR_MASK) - -#define I3C_MWMSG_SDR_CONTROL_ADDR_MASK (0xFEU) -#define I3C_MWMSG_SDR_CONTROL_ADDR_SHIFT (1U) -/*! ADDR - Address */ -#define I3C_MWMSG_SDR_CONTROL_ADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_SDR_CONTROL_ADDR_SHIFT)) & I3C_MWMSG_SDR_CONTROL_ADDR_MASK) - -#define I3C_MWMSG_SDR_CONTROL_END_MASK (0x100U) -#define I3C_MWMSG_SDR_CONTROL_END_SHIFT (8U) -/*! END - End of SDR Message - * 0b0..Not the end - * 0b1..End - */ -#define I3C_MWMSG_SDR_CONTROL_END(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_SDR_CONTROL_END_SHIFT)) & I3C_MWMSG_SDR_CONTROL_END_MASK) - -#define I3C_MWMSG_SDR_CONTROL_I2C_MASK (0x400U) -#define I3C_MWMSG_SDR_CONTROL_I2C_SHIFT (10U) -/*! I2C - I2C - * 0b0..I3C message - * 0b1..I2C message - */ -#define I3C_MWMSG_SDR_CONTROL_I2C(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_SDR_CONTROL_I2C_SHIFT)) & I3C_MWMSG_SDR_CONTROL_I2C_MASK) - -#define I3C_MWMSG_SDR_CONTROL_LEN_MASK (0xF800U) -#define I3C_MWMSG_SDR_CONTROL_LEN_SHIFT (11U) -/*! LEN - Length */ -#define I3C_MWMSG_SDR_CONTROL_LEN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_SDR_CONTROL_LEN_SHIFT)) & I3C_MWMSG_SDR_CONTROL_LEN_MASK) -/*! @} */ - -/*! @name MWMSG_SDR_DATA - Controller Write Message Data in SDR mode */ -/*! @{ */ - -#define I3C_MWMSG_SDR_DATA_DATA16B_MASK (0xFFFFU) -#define I3C_MWMSG_SDR_DATA_DATA16B_SHIFT (0U) -/*! DATA16B - Data */ -#define I3C_MWMSG_SDR_DATA_DATA16B(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_SDR_DATA_DATA16B_SHIFT)) & I3C_MWMSG_SDR_DATA_DATA16B_MASK) -/*! @} */ - -/*! @name MRMSG_SDR - Controller Read Message in SDR mode */ -/*! @{ */ - -#define I3C_MRMSG_SDR_DATA_MASK (0xFFFFU) -#define I3C_MRMSG_SDR_DATA_SHIFT (0U) -/*! DATA - Data */ -#define I3C_MRMSG_SDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_MRMSG_SDR_DATA_SHIFT)) & I3C_MRMSG_SDR_DATA_MASK) -/*! @} */ - -/*! @name MWMSG_DDR_CONTROL - Controller Write Message in DDR mode: First Control Word */ -/*! @{ */ - -#define I3C_MWMSG_DDR_CONTROL_ADDRCMD_MASK (0xFFFFU) -#define I3C_MWMSG_DDR_CONTROL_ADDRCMD_SHIFT (0U) -/*! ADDRCMD - Address Command */ -#define I3C_MWMSG_DDR_CONTROL_ADDRCMD(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_DDR_CONTROL_ADDRCMD_SHIFT)) & I3C_MWMSG_DDR_CONTROL_ADDRCMD_MASK) -/*! @} */ - -/*! @name MWMSG_DDR_CONTROL2 - Controller Write Message in DDR Mode Control 2 */ -/*! @{ */ - -#define I3C_MWMSG_DDR_CONTROL2_LEN_MASK (0x3FFU) -#define I3C_MWMSG_DDR_CONTROL2_LEN_SHIFT (0U) -/*! LEN - Length of Message */ -#define I3C_MWMSG_DDR_CONTROL2_LEN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_DDR_CONTROL2_LEN_SHIFT)) & I3C_MWMSG_DDR_CONTROL2_LEN_MASK) - -#define I3C_MWMSG_DDR_CONTROL2_END_MASK (0x4000U) -#define I3C_MWMSG_DDR_CONTROL2_END_SHIFT (14U) -/*! END - End of Message - * 0b1..End - * 0b0..Not the end - */ -#define I3C_MWMSG_DDR_CONTROL2_END(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_DDR_CONTROL2_END_SHIFT)) & I3C_MWMSG_DDR_CONTROL2_END_MASK) -/*! @} */ - -/*! @name MWMSG_DDR_DATA - Controller Write Message Data in DDR mode */ -/*! @{ */ - -#define I3C_MWMSG_DDR_DATA_DATA16B_MASK (0xFFFFU) -#define I3C_MWMSG_DDR_DATA_DATA16B_SHIFT (0U) -/*! DATA16B - Data */ -#define I3C_MWMSG_DDR_DATA_DATA16B(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_DDR_DATA_DATA16B_SHIFT)) & I3C_MWMSG_DDR_DATA_DATA16B_MASK) -/*! @} */ - -/*! @name MRMSG_DDR - Controller Read Message in DDR mode */ -/*! @{ */ - -#define I3C_MRMSG_DDR_DATA_MASK (0xFFFFU) -#define I3C_MRMSG_DDR_DATA_SHIFT (0U) -/*! DATA - Data */ -#define I3C_MRMSG_DDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_MRMSG_DDR_DATA_SHIFT)) & I3C_MRMSG_DDR_DATA_MASK) -/*! @} */ - -/*! @name MDYNADDR - Controller Dynamic Address */ -/*! @{ */ - -#define I3C_MDYNADDR_DAVALID_MASK (0x1U) -#define I3C_MDYNADDR_DAVALID_SHIFT (0U) -/*! DAVALID - Dynamic Address Valid - * 0b1..Valid DA assigned - * 0b0..No valid DA assigned - */ -#define I3C_MDYNADDR_DAVALID(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDYNADDR_DAVALID_SHIFT)) & I3C_MDYNADDR_DAVALID_MASK) - -#define I3C_MDYNADDR_DADDR_MASK (0xFEU) -#define I3C_MDYNADDR_DADDR_SHIFT (1U) -/*! DADDR - Dynamic Address */ -#define I3C_MDYNADDR_DADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDYNADDR_DADDR_SHIFT)) & I3C_MDYNADDR_DADDR_MASK) -/*! @} */ - -/*! @name SMAPCTRL0 - Map Feature Control 0 */ -/*! @{ */ - -#define I3C_SMAPCTRL0_ENA_MASK (0x1U) -#define I3C_SMAPCTRL0_ENA_SHIFT (0U) -/*! ENA - Enable Primary Dynamic Address - * 0b0..Disabled - * 0b1..Enabled - */ -#define I3C_SMAPCTRL0_ENA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMAPCTRL0_ENA_SHIFT)) & I3C_SMAPCTRL0_ENA_MASK) - -#define I3C_SMAPCTRL0_DA_MASK (0xFEU) -#define I3C_SMAPCTRL0_DA_SHIFT (1U) -/*! DA - Dynamic Address */ -#define I3C_SMAPCTRL0_DA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMAPCTRL0_DA_SHIFT)) & I3C_SMAPCTRL0_DA_MASK) - -#define I3C_SMAPCTRL0_CAUSE_MASK (0x700U) -#define I3C_SMAPCTRL0_CAUSE_SHIFT (8U) -/*! CAUSE - Cause - * 0b000..No information (this value occurs when not configured to write DA) - * 0b001..Set using ENTDAA - * 0b010..Set using SETDASA, SETAASA, or SETNEWDA - * 0b011..Cleared using RSTDAA - * 0b100..Auto MAP change happened last - * *.. - */ -#define I3C_SMAPCTRL0_CAUSE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMAPCTRL0_CAUSE_SHIFT)) & I3C_SMAPCTRL0_CAUSE_MASK) -/*! @} */ - -/*! @name IBIEXT1 - Extended IBI Data 1 */ -/*! @{ */ - -#define I3C_IBIEXT1_CNT_MASK (0x7U) -#define I3C_IBIEXT1_CNT_SHIFT (0U) -/*! CNT - Count */ -#define I3C_IBIEXT1_CNT(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT1_CNT_SHIFT)) & I3C_IBIEXT1_CNT_MASK) - -#define I3C_IBIEXT1_MAX_MASK (0x70U) -#define I3C_IBIEXT1_MAX_SHIFT (4U) -/*! MAX - Maximum */ -#define I3C_IBIEXT1_MAX(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT1_MAX_SHIFT)) & I3C_IBIEXT1_MAX_MASK) - -#define I3C_IBIEXT1_EXT1_MASK (0xFF00U) -#define I3C_IBIEXT1_EXT1_SHIFT (8U) -/*! EXT1 - Extra Byte 1 */ -#define I3C_IBIEXT1_EXT1(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT1_EXT1_SHIFT)) & I3C_IBIEXT1_EXT1_MASK) - -#define I3C_IBIEXT1_EXT2_MASK (0xFF0000U) -#define I3C_IBIEXT1_EXT2_SHIFT (16U) -/*! EXT2 - Extra Byte 2 */ -#define I3C_IBIEXT1_EXT2(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT1_EXT2_SHIFT)) & I3C_IBIEXT1_EXT2_MASK) - -#define I3C_IBIEXT1_EXT3_MASK (0xFF000000U) -#define I3C_IBIEXT1_EXT3_SHIFT (24U) -/*! EXT3 - Extra Byte 3 */ -#define I3C_IBIEXT1_EXT3(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT1_EXT3_SHIFT)) & I3C_IBIEXT1_EXT3_MASK) -/*! @} */ - -/*! @name IBIEXT2 - Extended IBI Data 2 */ -/*! @{ */ - -#define I3C_IBIEXT2_EXT4_MASK (0xFFU) -#define I3C_IBIEXT2_EXT4_SHIFT (0U) -/*! EXT4 - Extra Byte 4 */ -#define I3C_IBIEXT2_EXT4(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT2_EXT4_SHIFT)) & I3C_IBIEXT2_EXT4_MASK) - -#define I3C_IBIEXT2_EXT5_MASK (0xFF00U) -#define I3C_IBIEXT2_EXT5_SHIFT (8U) -/*! EXT5 - Extra Byte 5 */ -#define I3C_IBIEXT2_EXT5(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT2_EXT5_SHIFT)) & I3C_IBIEXT2_EXT5_MASK) - -#define I3C_IBIEXT2_EXT6_MASK (0xFF0000U) -#define I3C_IBIEXT2_EXT6_SHIFT (16U) -/*! EXT6 - Extra Byte 6 */ -#define I3C_IBIEXT2_EXT6(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT2_EXT6_SHIFT)) & I3C_IBIEXT2_EXT6_MASK) - -#define I3C_IBIEXT2_EXT7_MASK (0xFF000000U) -#define I3C_IBIEXT2_EXT7_SHIFT (24U) -/*! EXT7 - Extra Byte 7 */ -#define I3C_IBIEXT2_EXT7(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT2_EXT7_SHIFT)) & I3C_IBIEXT2_EXT7_MASK) -/*! @} */ - -/*! @name SID - Target Module ID */ -/*! @{ */ - -#define I3C_SID_ID_MASK (0xFFFFFFFFU) -#define I3C_SID_ID_SHIFT (0U) -/*! ID - ID */ -#define I3C_SID_ID(x) (((uint32_t)(((uint32_t)(x)) << I3C_SID_ID_SHIFT)) & I3C_SID_ID_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group I3C_Register_Masks */ - - -/* I3C - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral I3C0 base address */ - #define I3C0_BASE (0x50021000u) - /** Peripheral I3C0 base address */ - #define I3C0_BASE_NS (0x40021000u) - /** Peripheral I3C0 base pointer */ - #define I3C0 ((I3C_Type *)I3C0_BASE) - /** Peripheral I3C0 base pointer */ - #define I3C0_NS ((I3C_Type *)I3C0_BASE_NS) - /** Peripheral I3C1 base address */ - #define I3C1_BASE (0x50022000u) - /** Peripheral I3C1 base address */ - #define I3C1_BASE_NS (0x40022000u) - /** Peripheral I3C1 base pointer */ - #define I3C1 ((I3C_Type *)I3C1_BASE) - /** Peripheral I3C1 base pointer */ - #define I3C1_NS ((I3C_Type *)I3C1_BASE_NS) - /** Array initializer of I3C peripheral base addresses */ - #define I3C_BASE_ADDRS { I3C0_BASE, I3C1_BASE } - /** Array initializer of I3C peripheral base pointers */ - #define I3C_BASE_PTRS { I3C0, I3C1 } - /** Array initializer of I3C peripheral base addresses */ - #define I3C_BASE_ADDRS_NS { I3C0_BASE_NS, I3C1_BASE_NS } - /** Array initializer of I3C peripheral base pointers */ - #define I3C_BASE_PTRS_NS { I3C0_NS, I3C1_NS } -#else - /** Peripheral I3C0 base address */ - #define I3C0_BASE (0x40021000u) - /** Peripheral I3C0 base pointer */ - #define I3C0 ((I3C_Type *)I3C0_BASE) - /** Peripheral I3C1 base address */ - #define I3C1_BASE (0x40022000u) - /** Peripheral I3C1 base pointer */ - #define I3C1 ((I3C_Type *)I3C1_BASE) - /** Array initializer of I3C peripheral base addresses */ - #define I3C_BASE_ADDRS { I3C0_BASE, I3C1_BASE } - /** Array initializer of I3C peripheral base pointers */ - #define I3C_BASE_PTRS { I3C0, I3C1 } -#endif -/** Interrupt vectors for the I3C peripheral type */ -#define I3C_IRQS { I3C0_IRQn, I3C1_IRQn } - -/*! - * @} - */ /* end of group I3C_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- INPUTMUX Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup INPUTMUX_Peripheral_Access_Layer INPUTMUX Peripheral Access Layer - * @{ - */ - -/** INPUTMUX - Register Layout Typedef */ -typedef struct { - __IO uint32_t SCT0_INMUX[8]; /**< Inputmux Register for SCT0 Input, array offset: 0x0, array step: 0x4 */ - __IO uint32_t CTIMER0CAP0; /**< Capture Select Register for CTIMER Inputs, offset: 0x20 */ - __IO uint32_t CTIMER0CAP1; /**< Capture Select Register for CTIMER Inputs, offset: 0x24 */ - __IO uint32_t CTIMER0CAP2; /**< Capture Select Register for CTIMER Inputs, offset: 0x28 */ - __IO uint32_t CTIMER0CAP3; /**< Capture Select Register for CTIMER Inputs, offset: 0x2C */ - __IO uint32_t TIMER0TRIG; /**< Trigger Register for CTIMER, offset: 0x30 */ - uint8_t RESERVED_0[12]; - __IO uint32_t CTIMER1CAP0; /**< Capture Select Register for CTIMER Inputs, offset: 0x40 */ - __IO uint32_t CTIMER1CAP1; /**< Capture Select Register for CTIMER Inputs, offset: 0x44 */ - __IO uint32_t CTIMER1CAP2; /**< Capture Select Register for CTIMER Inputs, offset: 0x48 */ - __IO uint32_t CTIMER1CAP3; /**< Capture Select Register for CTIMER Inputs, offset: 0x4C */ - __IO uint32_t TIMER1TRIG; /**< Trigger Register for CTIMER, offset: 0x50 */ - uint8_t RESERVED_1[12]; - __IO uint32_t CTIMER2CAP0; /**< Capture Select Register for CTIMER Inputs, offset: 0x60 */ - __IO uint32_t CTIMER2CAP1; /**< Capture Select Register for CTIMER Inputs, offset: 0x64 */ - __IO uint32_t CTIMER2CAP2; /**< Capture Select Register for CTIMER Inputs, offset: 0x68 */ - __IO uint32_t CTIMER2CAP3; /**< Capture Select Register for CTIMER Inputs, offset: 0x6C */ - __IO uint32_t TIMER2TRIG; /**< Trigger Register for CTIMER, offset: 0x70 */ - uint8_t RESERVED_2[44]; - __IO uint32_t SMARTDMAARCHB_INMUX[8]; /**< Inputmux Register for SMARTDMA Arch B Inputs, array offset: 0xA0, array step: 0x4 */ - __IO uint32_t PINTSEL[8]; /**< Pin Interrupt Select, array offset: 0xC0, array step: 0x4 */ - uint8_t RESERVED_3[160]; - __IO uint32_t FREQMEAS_REF; /**< Selection for Frequency Measurement Reference Clock, offset: 0x180 */ - __IO uint32_t FREQMEAS_TAR; /**< Selection for Frequency Measurement Target Clock, offset: 0x184 */ - uint8_t RESERVED_4[24]; - __IO uint32_t CTIMER3CAP0; /**< Capture Select Register for CTIMER Inputs, offset: 0x1A0 */ - __IO uint32_t CTIMER3CAP1; /**< Capture Select Register for CTIMER Inputs, offset: 0x1A4 */ - __IO uint32_t CTIMER3CAP2; /**< Capture Select Register for CTIMER Inputs, offset: 0x1A8 */ - __IO uint32_t CTIMER3CAP3; /**< Capture Select Register for CTIMER Inputs, offset: 0x1AC */ - __IO uint32_t TIMER3TRIG; /**< Trigger Register for CTIMER, offset: 0x1B0 */ - uint8_t RESERVED_5[12]; - __IO uint32_t CTIMER4CAP0; /**< Capture Select Register for CTIMER Inputs, offset: 0x1C0 */ - __IO uint32_t CTIMER4CAP1; /**< Capture Select Register for CTIMER Inputs, offset: 0x1C4 */ - __IO uint32_t CTIMER4CAP2; /**< Capture Select Register for CTIMER Inputs, offset: 0x1C8 */ - __IO uint32_t CTIMER4CAP3; /**< Capture Select Register for CTIMER Inputs, offset: 0x1CC */ - __IO uint32_t TIMER4TRIG; /**< Trigger Register for CTIMER, offset: 0x1D0 */ - uint8_t RESERVED_6[140]; - __IO uint32_t CMP0_TRIG; /**< CMP0 Input Connections, offset: 0x260 */ - uint8_t RESERVED_7[28]; - __IO uint32_t ADC0_TRIG[4]; /**< ADC Trigger Input Connections, array offset: 0x280, array step: 0x4 */ - uint8_t RESERVED_8[48]; - __IO uint32_t ADC1_TRIG[4]; /**< ADC Trigger Input Connections, array offset: 0x2C0, array step: 0x4 */ - uint8_t RESERVED_9[48]; - __IO uint32_t DAC0_TRIG; /**< DAC0 Trigger Inputs, offset: 0x300 */ - uint8_t RESERVED_10[28]; - __IO uint32_t DAC1_TRIG; /**< DAC1 Trigger Inputs, offset: 0x320 */ - uint8_t RESERVED_11[28]; - __IO uint32_t DAC2_TRIG; /**< DAC2 Trigger Inputs, offset: 0x340 */ - uint8_t RESERVED_12[28]; - struct { /* offset: 0x360, array step: 0x20 */ - __IO uint32_t QDC_TRIG; /**< QDC0 Trigger Input Connections..QDC1 Trigger Input Connections, array offset: 0x360, array step: 0x20 */ - __IO uint32_t QDC_HOME; /**< QDC0 Input Connections..QDC1 Input Connections, array offset: 0x364, array step: 0x20 */ - __IO uint32_t QDC_INDEX; /**< QDC0 Input Connections..QDC1 Input Connections, array offset: 0x368, array step: 0x20 */ - __IO uint32_t QDC_PHASEB; /**< QDC0 Input Connections..QDC1 Input Connections, array offset: 0x36C, array step: 0x20 */ - __IO uint32_t QDC_PHASEA; /**< QDC0 Input Connections..QDC1 Input Connections, array offset: 0x370, array step: 0x20 */ - uint8_t RESERVED_0[12]; - } QDCN[2]; - __IO uint32_t FLEXPWM0_SM_EXTSYNC[4]; /**< PWM0 External Synchronization, array offset: 0x3A0, array step: 0x4 */ - __IO uint32_t FLEXPWM0_SM_EXTA[4]; /**< PWM0 Input Trigger Connections, array offset: 0x3B0, array step: 0x4 */ - __IO uint32_t FLEXPWM0_EXTFORCE; /**< PWM0 External Force Trigger Connections, offset: 0x3C0 */ - __IO uint32_t FLEXPWM0_FAULT[4]; /**< PWM0 Fault Input Trigger Connections, array offset: 0x3C4, array step: 0x4 */ - uint8_t RESERVED_13[12]; - __IO uint32_t FLEXPWM1_SM_EXTSYNC[4]; /**< PWM1 External Synchronization, array offset: 0x3E0, array step: 0x4 */ - __IO uint32_t FLEXPWM1_SM_EXTA[4]; /**< PWM1 Input EXTA Connections, array offset: 0x3F0, array step: 0x4 */ - __IO uint32_t FLEXPWM1_EXTFORCE; /**< PWM1 External Force Trigger Connections, offset: 0x400 */ - __IO uint32_t FLEXPWM1_FAULT[4]; /**< PWM1 Fault Input Trigger Connections, array offset: 0x404, array step: 0x4 */ - uint8_t RESERVED_14[12]; - __IO uint32_t PWM0_EXT_CLK; /**< PWM0 External Clock Trigger, offset: 0x420 */ - __IO uint32_t PWM1_EXT_CLK; /**< PWM1 External Clock Trigger, offset: 0x424 */ - uint8_t RESERVED_15[24]; - __IO uint32_t EVTG_TRIG[16]; /**< EVTG Trigger Input Connections, array offset: 0x440, array step: 0x4 */ - __IO uint32_t USBFS_TRIG; /**< USB-FS Trigger Input Connections, offset: 0x480 */ - uint8_t RESERVED_16[28]; - __IO uint32_t TSI_TRIG; /**< TSI Trigger Input Connections, offset: 0x4A0 */ - uint8_t RESERVED_17[28]; - __IO uint32_t EXT_TRIG[8]; /**< EXT Trigger Connections, array offset: 0x4C0, array step: 0x4 */ - __IO uint32_t CMP1_TRIG; /**< CMP1 Input Connections, offset: 0x4E0 */ - uint8_t RESERVED_18[28]; - __IO uint32_t CMP2_TRIG; /**< CMP2 Input Connections, offset: 0x500 */ - uint8_t RESERVED_19[28]; - __IO uint32_t SINC_FILTER_CH[5]; /**< SINC Filter Channel Trigger Input Connections, array offset: 0x520, array step: 0x4 */ - uint8_t RESERVED_20[76]; - __IO uint32_t OPAMP_TRIG[3]; /**< OPAMP Trigger Input Connections, array offset: 0x580, array step: 0x4 */ - uint8_t RESERVED_21[20]; - __IO uint32_t FLEXCOMM0_TRIG; /**< LP_FLEXCOMM0 Trigger Input Connections, offset: 0x5A0 */ - uint8_t RESERVED_22[28]; - __IO uint32_t FLEXCOMM1_TRIG; /**< LP_FLEXCOMM1 Trigger Input Connections, offset: 0x5C0 */ - uint8_t RESERVED_23[28]; - __IO uint32_t FLEXCOMM2_TRIG; /**< LP_FLEXCOMM2 Trigger Input Connections, offset: 0x5E0 */ - uint8_t RESERVED_24[28]; - __IO uint32_t FLEXCOMM3_TRIG; /**< LP_FLEXCOMM3 Trigger Input Connections, offset: 0x600 */ - uint8_t RESERVED_25[28]; - __IO uint32_t FLEXCOMM4_TRIG; /**< LP_FLEXCOMM4 Trigger Input Connections, offset: 0x620 */ - uint8_t RESERVED_26[28]; - __IO uint32_t FLEXCOMM5_TRIG; /**< LP_FLEXCOMM5 Trigger Input Connections, offset: 0x640 */ - uint8_t RESERVED_27[28]; - __IO uint32_t FLEXCOMM6_TRIG; /**< LP_FLEXCOMM6 Trigger Input Connections, offset: 0x660 */ - uint8_t RESERVED_28[28]; - __IO uint32_t FLEXCOMM7_TRIG; /**< LP_FLEXCOMM7 Trigger Input Connections, offset: 0x680 */ - uint8_t RESERVED_29[28]; - __IO uint32_t FLEXCOMM8_TRIG; /**< LP_FLEXCOMM8 Trigger Input Connections, offset: 0x6A0 */ - uint8_t RESERVED_30[28]; - __IO uint32_t FLEXCOMM9_TRIG; /**< LP_FLEXCOMM9 Trigger Input Connections, offset: 0x6C0 */ - uint8_t RESERVED_31[28]; - __IO uint32_t FLEXIO_TRIG[8]; /**< FlexIO Trigger Input Connections, array offset: 0x6E0, array step: 0x4 */ - __IO uint32_t DMA0_REQ_ENABLE0; /**< DMA0 Request Enable0, offset: 0x700 */ - __O uint32_t DMA0_REQ_ENABLE0_SET; /**< DMA0 Request Enable0, offset: 0x704 */ - __O uint32_t DMA0_REQ_ENABLE0_CLR; /**< DMA0 Request Enable0, offset: 0x708 */ - __O uint32_t DMA0_REQ_ENABLE0_TOG; /**< DMA0 Request Enable0, offset: 0x70C */ - __IO uint32_t DMA0_REQ_ENABLE1; /**< DMA0 Request Enable1, offset: 0x710 */ - __O uint32_t DMA0_REQ_ENABLE1_SET; /**< DMA0 Request Enable1, offset: 0x714 */ - __O uint32_t DMA0_REQ_ENABLE1_CLR; /**< DMA0 Request Enable1, offset: 0x718 */ - __O uint32_t DMA0_REQ_ENABLE1_TOG; /**< DMA0 Request Enable1, offset: 0x71C */ - __IO uint32_t DMA0_REQ_ENABLE2; /**< DMA0 Request Enable2, offset: 0x720 */ - __O uint32_t DMA0_REQ_ENABLE2_SET; /**< DMA0 Request Enable2, offset: 0x724 */ - __O uint32_t DMA0_REQ_ENABLE2_CLR; /**< DMA0 Request Enable2, offset: 0x728 */ - __O uint32_t DMA0_REQ_ENABLE2_TOG; /**< DMA0 Request Enable2, offset: 0x72C */ - __IO uint32_t DMA0_REQ_ENABLE3; /**< DMA0 Request Enable3, offset: 0x730 */ - __O uint32_t DMA0_REQ_ENABLE3_SET; /**< DMA0 Request Enable3, offset: 0x734 */ - __O uint32_t DMA0_REQ_ENABLE3_CLR; /**< DMA0 Request Enable3, offset: 0x738 */ - uint8_t RESERVED_32[68]; - __IO uint32_t DMA1_REQ_ENABLE0; /**< DMA1 Request Enable0, offset: 0x780 */ - __O uint32_t DMA1_REQ_ENABLE0_SET; /**< DMA1 Request Enable0, offset: 0x784 */ - __O uint32_t DMA1_REQ_ENABLE0_CLR; /**< DMA1 Request Enable0, offset: 0x788 */ - __O uint32_t DMA1_REQ_ENABLE0_TOG; /**< DMA1 Request Enable0, offset: 0x78C */ - __IO uint32_t DMA1_REQ_ENABLE1; /**< DMA1 Request Enable1, offset: 0x790 */ - __O uint32_t DMA1_REQ_ENABLE1_SET; /**< DMA1 Request Enable1, offset: 0x794 */ - __O uint32_t DMA1_REQ_ENABLE1_CLR; /**< DMA1 Request Enable1, offset: 0x798 */ - __O uint32_t DMA1_REQ_ENABLE1_TOG; /**< DMA1 Request Enable1, offset: 0x79C */ - __IO uint32_t DMA1_REQ_ENABLE2; /**< DMA1 Request Enable2, offset: 0x7A0 */ - __O uint32_t DMA1_REQ_ENABLE2_SET; /**< DMA1 Request Enable2, offset: 0x7A4 */ - __O uint32_t DMA1_REQ_ENABLE2_CLR; /**< DMA1 Request Enable2, offset: 0x7A8 */ - __O uint32_t DMA1_REQ_ENABLE2_TOG; /**< DMA1 Request Enable2, offset: 0x7AC */ - __IO uint32_t DMA1_REQ_ENABLE3; /**< DMA1 Request Enable3, offset: 0x7B0 */ - __O uint32_t DMA1_REQ_ENABLE3_SET; /**< DMA1 Request Enable3, offset: 0x7B4 */ - __O uint32_t DMA1_REQ_ENABLE3_CLR; /**< DMA1 Request Enable3, offset: 0x7B8 */ -} INPUTMUX_Type; - -/* ---------------------------------------------------------------------------- - -- INPUTMUX Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup INPUTMUX_Register_Masks INPUTMUX Register Masks - * @{ - */ - -/*! @name INPUTMUX_SCT0_SCT0_INMUX - Inputmux Register for SCT0 Input */ -/*! @{ */ - -#define INPUTMUX_INPUTMUX_SCT0_SCT0_INMUX_INP_MASK (0x7FU) -#define INPUTMUX_INPUTMUX_SCT0_SCT0_INMUX_INP_SHIFT (0U) -/*! INP - Input number to SCT0 inputs. - * 0b0000000..SCT0_IN0 input is selected - * 0b0000001..SCT0_IN1 input is selected - * 0b0000010..SCT0_IN2 input is selected - * 0b0000011..SCT0_IN3 input is selected - * 0b0000100..SCT0_IN4 input is selected - * 0b0000101..SCT0_IN5 input is selected - * 0b0000110..SCT0_IN6 input is selected - * 0b0000111..SCT0_IN7 input is selected - * 0b0001000..CTIMER0_MAT0 input is selected - * 0b0001001..CTIMER1_MAT0 input is selected - * 0b0001010..CTIMER2_MAT0 input is selected - * 0b0001011..CTIMER3_MAT0 input is selected - * 0b0001100..CTIMER4_MAT0 input is selected - * 0b0001101..ADC0 ADC0_IRQ input is selected - * 0b0001110..PINT GPIO_INT_BMAT input is selected - * 0b0001111..usb0 start of frame input is selected - * 0b0010000..usb1 start of frame input is selected - * 0b0010001..SINC Filter CH0 Conversion Complete input is selected - * 0b0010010..SINC Filter CH1 Conversion Complete input is selected - * 0b0010011..SINC Filter CH2 Conversion Complete input is selected - * 0b0010100..SINC Filter CH3 Conversion Complete input is selected - * 0b0010101..SINC Filter CH4 Conversion Complete input is selected - * 0b0010110..Reserved - * 0b0010111..DEBUG_HALTED input is selected - * 0b0011000..ADC1_IRQ input is selected - * 0b0011001..ADC0_tcomp[0] input is selected - * 0b0011010..ADC0_tcomp[1] input is selected - * 0b0011011..ADC0_tcomp[2] input is selected - * 0b0011100..ADC0_tcomp[3] input is selected - * 0b0011101..ADC1_tcomp[0] input is selected - * 0b0011110..ADC1_tcomp[1] input is selected - * 0b0011111..ADC1_tcomp[2] input is selected - * 0b0100000..ADC1_tcomp[3] input is selected - * 0b0100001..CMP0_OUT input is selected - * 0b0100010..CMP1_OUT input is selected - * 0b0100011..CMP2_OUT input is selected - * 0b0100100..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0100101..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100110..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100111..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0101000..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0101001..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0101010..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0101011..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0101100..QDC0_CMP/POS_MATCH input is selected - * 0b0101101..QDC1_CMP/POS_MATCH input is selected - * 0b0101110..EVTG_OUT0A input is selected - * 0b0101111..EVTG_OUT0B input is selected - * 0b0110000..EVTG_OUT1A input is selected - * 0b0110001..EVTG_OUT1B input is selected - * 0b0110010..EVTG_OUT2A input is selected - * 0b0110011..EVTG_OUT2B input is selected - * 0b0110100..EVTG_OUT3A input is selected - * 0b0110101..EVTG_OUT3B input is selected - * 0b0110110..FC3_P0 (SDO, SDA) input is selected - * 0b0110111..FC3_P1 (SCK, TXD, SCL) input is selected - * 0b0111000..FC3_P2 (RTS, SCLS, TXD) input is selected - * 0b0111001..FC3_P3 (PCS[0], CTS, SDAS) input is selected - * 0b0111010..Reserved - * 0b0111011..Reserved - * 0b0111100..LP_FLEXCOMM0 trig 0 (lpuart_trg_txword) input is selected - * 0b0111101..LP_FLEXCOMM0 trig 1 (lpuart_trg_rxword) input is selected - * 0b0111110..LP_FLEXCOMM0 trig 2 (lpuart_trg_rxidle) input is selected - * 0b0111111..LP_FLEXCOMM1 trig 0 input is selected - * 0b1000000..LP_FLEXCOMM1 trig 1 input is selected - * 0b1000001..LP_FLEXCOMM1 trig 2 input is selected - * 0b1000010..LP_FLEXCOMM2 trig 0 input is selected - * 0b1000011..LP_FLEXCOMM2 trig 1 input is selected - * 0b1000100..LP_FLEXCOMM2 trig 2 input is selected - * 0b1000101..LP_FLEXCOMM3 trig 0 input is selected - * 0b1000110..LP_FLEXCOMM3 trig 1 input is selected - * 0b1000111..LP_FLEXCOMM3 trig 2 input is selected - * 0b1001000..LP_FLEXCOMM3 trig 3 input is selected - * 0b1001001..SAI0 TX BCLK input is selected - * 0b1001010..SAI0 RX BCLK input is selected - * 0b1001011..SAI1 TX BCLK input is selected - * 0b1001100..SAI1 RX BCLK input is selected - * *.. - */ -#define INPUTMUX_INPUTMUX_SCT0_SCT0_INMUX_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_INPUTMUX_SCT0_SCT0_INMUX_INP_SHIFT)) & INPUTMUX_INPUTMUX_SCT0_SCT0_INMUX_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_INPUTMUX_SCT0_SCT0_INMUX */ -#define INPUTMUX_INPUTMUX_SCT0_SCT0_INMUX_COUNT (8U) - -/*! @name CTIMER0CAP0 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER0CAP0_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER0CAP0_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER0CAP0_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER0CAP0_INP_SHIFT)) & INPUTMUX_CTIMER0CAP0_INP_MASK) -/*! @} */ - -/*! @name CTIMER0CAP1 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER0CAP1_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER0CAP1_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER0CAP1_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER0CAP1_INP_SHIFT)) & INPUTMUX_CTIMER0CAP1_INP_MASK) -/*! @} */ - -/*! @name CTIMER0CAP2 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER0CAP2_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER0CAP2_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER0CAP2_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER0CAP2_INP_SHIFT)) & INPUTMUX_CTIMER0CAP2_INP_MASK) -/*! @} */ - -/*! @name CTIMER0CAP3 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER0CAP3_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER0CAP3_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER0CAP3_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER0CAP3_INP_SHIFT)) & INPUTMUX_CTIMER0CAP3_INP_MASK) -/*! @} */ - -/*! @name TIMER0TRIG - Trigger Register for CTIMER */ -/*! @{ */ - -#define INPUTMUX_TIMER0TRIG_INP_MASK (0x7FU) -#define INPUTMUX_TIMER0TRIG_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_TIMER0TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_TIMER0TRIG_INP_SHIFT)) & INPUTMUX_TIMER0TRIG_INP_MASK) -/*! @} */ - -/*! @name CTIMER1CAP0 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER1CAP0_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER1CAP0_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER1CAP0_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER1CAP0_INP_SHIFT)) & INPUTMUX_CTIMER1CAP0_INP_MASK) -/*! @} */ - -/*! @name CTIMER1CAP1 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER1CAP1_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER1CAP1_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER1CAP1_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER1CAP1_INP_SHIFT)) & INPUTMUX_CTIMER1CAP1_INP_MASK) -/*! @} */ - -/*! @name CTIMER1CAP2 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER1CAP2_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER1CAP2_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER1CAP2_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER1CAP2_INP_SHIFT)) & INPUTMUX_CTIMER1CAP2_INP_MASK) -/*! @} */ - -/*! @name CTIMER1CAP3 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER1CAP3_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER1CAP3_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER1CAP3_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER1CAP3_INP_SHIFT)) & INPUTMUX_CTIMER1CAP3_INP_MASK) -/*! @} */ - -/*! @name TIMER1TRIG - Trigger Register for CTIMER */ -/*! @{ */ - -#define INPUTMUX_TIMER1TRIG_INP_MASK (0x7FU) -#define INPUTMUX_TIMER1TRIG_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_TIMER1TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_TIMER1TRIG_INP_SHIFT)) & INPUTMUX_TIMER1TRIG_INP_MASK) -/*! @} */ - -/*! @name CTIMER2CAP0 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER2CAP0_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER2CAP0_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER2CAP0_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER2CAP0_INP_SHIFT)) & INPUTMUX_CTIMER2CAP0_INP_MASK) -/*! @} */ - -/*! @name CTIMER2CAP1 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER2CAP1_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER2CAP1_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER2CAP1_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER2CAP1_INP_SHIFT)) & INPUTMUX_CTIMER2CAP1_INP_MASK) -/*! @} */ - -/*! @name CTIMER2CAP2 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER2CAP2_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER2CAP2_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER2CAP2_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER2CAP2_INP_SHIFT)) & INPUTMUX_CTIMER2CAP2_INP_MASK) -/*! @} */ - -/*! @name CTIMER2CAP3 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER2CAP3_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER2CAP3_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER2CAP3_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER2CAP3_INP_SHIFT)) & INPUTMUX_CTIMER2CAP3_INP_MASK) -/*! @} */ - -/*! @name TIMER2TRIG - Trigger Register for CTIMER */ -/*! @{ */ - -#define INPUTMUX_TIMER2TRIG_INP_MASK (0x7FU) -#define INPUTMUX_TIMER2TRIG_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_TIMER2TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_TIMER2TRIG_INP_SHIFT)) & INPUTMUX_TIMER2TRIG_INP_MASK) -/*! @} */ - -/*! @name INPUTMUX_SMARTDMA_SMARTDMAARCHB_INMUX - Inputmux Register for SMARTDMA Arch B Inputs */ -/*! @{ */ - -#define INPUTMUX_INPUTMUX_SMARTDMA_SMARTDMAARCHB_INMUX_INP_MASK (0x7FU) -#define INPUTMUX_INPUTMUX_SMARTDMA_SMARTDMAARCHB_INMUX_INP_SHIFT (0U) -/*! INP - Input number select to SmartDMA ARCHB input - * 0b0000000..FlexIO interrupt is selected as input - * 0b0000001..GPIO P0_1 input is selected - * 0b0000010..GPIO P0_2 input is selected - * 0b0000011..GPIO P0_3 input is selected - * 0b0000100..GPIO P0_4 input is selected - * 0b0000101..GPIO P0_5 input is selected - * 0b0000110..GPIO P0_6 input is selected - * 0b0000111..GPIO P0_7 input is selected - * 0b0001000..GPIO P0_8 input is selected - * 0b0001001..GPIO P0_9 input is selected - * 0b0001010..GPIO P0_10 input is selected - * 0b0001011..GPIO P0_11 input is selected - * 0b0001100..GPIO P0_12 input is selected - * 0b0001101..GPIO P0_13 input is selected - * 0b0001110..GPIO P0_14 input is selected - * 0b0001111..GPIO P0_15 input is selected - * 0b0010000..SCT0 SCT_OUT8 input is selected - * 0b0010001..SCT0 SCT_OUT9 input is selected - * 0b0010010..Reserved - * 0b0010011..Reserved - * 0b0010100..MRT0 MRT_CH0_IRQ input is selected - * 0b0010101..MRT0 MRT_CH1_IRQ input is selected - * 0b0010110..CTIMER4_MAT3 input is selected - * 0b0010111..CTIMER4_MAT2 input is selected - * 0b0011000..CTIMER3_MAT3 input is selected - * 0b0011001..CTIMER3_MAT2 input is selected - * 0b0011010..CTIMER1_MAT3 input is selected - * 0b0011011..CTIMER1_MAT2 input is selected - * 0b0011100..UTICK0 UTICK_IRQ input is selected - * 0b0011101..WWDT0 WDT0_IRQ input is selected - * 0b0011110..ADC0 ADC0_IRQ input is selected - * 0b0011111..CMP0_IRQ input is selected - * 0b0100000..Reserved - * 0b0100001..LP_FLEXCOMM7_IRQ input is selected - * 0b0100010..LP_FLEXCOMM6_IRQ input is selected - * 0b0100011..LP_FLEXCOMM5_IRQ input is selected - * 0b0100100..LP_FLEXCOMM4_IRQ input is selected - * 0b0100101..LP_FLEXCOMM3_IRQ input is selected - * 0b0100110..LP_FLEXCOMM2_IRQ input is selected - * 0b0100111..LP_FLEXCOMM1_IRQ input is selected - * 0b0101000..LP_FLEXCOMM0_IRQ input is selected - * 0b0101001..DMA0_IRQ input is selected - * 0b0101010..DMA1_IRQ input is selected - * 0b0101011..SYS_IRQSYS_IRQ combines the CDOG IRQ, WWDT IRQ, MBC secure violation IRQ, Secure AHB Matrix secure - * violation IRQ, GDET IRQ, ELS S50 error IRQ, PKC error IRQ, and VBAT IRQ using the logical OR - * operation. input is selected - * 0b0101100..RTC_COMBO_IRQ input is selected - * 0b0101101..ARM_TXEV input is selected - * 0b0101110..PINT0 GPIO_INT_BMATCH input is selected - * 0b0101111..Reserved - * 0b0110000..Reserved - * 0b0110001..CMP0_OUT input is selected - * 0b0110010..usb0 start of frame input is selected - * 0b0110011..usb1 start of frame input is selected - * 0b0110100..OSTIMER0 OS_EVENT_TIMER_IRQ input is selected - * 0b0110101..ADC1_IRQ input is selected - * 0b0110110..CMP0_IRQ/CMP1_IRQ/CMP2_IRQ input is selected - * 0b0110111..DAC0_IRQ input is selected - * 0b0111000..DAC1_IRQ/DAC2_IRQ input is selected - * 0b0111001..PWM0_IRQ input is selected - * 0b0111010..PWM1_IRQ input is selected - * 0b0111011..QDC0_IRQ input is selected - * 0b0111100..QDC1_IRQ input is selected - * 0b0111101..EVTG_OUT0A input is selected - * 0b0111110..EVTG_OUT1A input is selected - * 0b0111111..Reserved - * 0b1000000..Reserved - * 0b1000001..GPIO1_alias0 GPIO1 Pin Event Trig 0 input is selected - * 0b1000010..GPIO1_alias1 GPIO1 Pin Event Trig 1 input is selected - * 0b1000011..GPIO2_alias0 GPIO2 Pin Event Trig 0 input is selected - * 0b1000100..GPIO2_alias1 GPIO2 Pin Event Trig 1 input is selected - * 0b1000101..GPIO3_alias0 GPIO3 Pin Event Trig 0 input is selected - * 0b1000110..GPIO3_alias1 GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_INPUTMUX_SMARTDMA_SMARTDMAARCHB_INMUX_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_INPUTMUX_SMARTDMA_SMARTDMAARCHB_INMUX_INP_SHIFT)) & INPUTMUX_INPUTMUX_SMARTDMA_SMARTDMAARCHB_INMUX_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_INPUTMUX_SMARTDMA_SMARTDMAARCHB_INMUX */ -#define INPUTMUX_INPUTMUX_SMARTDMA_SMARTDMAARCHB_INMUX_COUNT (8U) - -/*! @name INPUTMUX_GPIO_INT_PINTSEL - Pin Interrupt Select */ -/*! @{ */ - -#define INPUTMUX_INPUTMUX_GPIO_INT_PINTSEL_INP_MASK (0x7FU) -#define INPUTMUX_INPUTMUX_GPIO_INT_PINTSEL_INP_SHIFT (0U) -/*! INP - Pin number select for pin interrupt or pattern match engine input. For PIOx_y: INP = (x * - * 32) + y. PIO0_0 to PIO1_31 correspond to numbers 0 to 63. - * 0b0000000..GPIO P0_0 input is selected - * 0b0000001..GPIO P0_1 input is selected - * 0b0000010..GPIO P0_2 input is selected - * 0b0000011..GPIO P0_3 input is selected - * 0b0000100..GPIO P0_4 input is selected - * 0b0000101..GPIO P0_5 input is selected - * 0b0000110..GPIO P0_6 input is selected - * 0b0000111..GPIO P0_7 input is selected - * 0b0001000..GPIO P0_8 input is selected - * 0b0001001..GPIO P0_9 input is selected - * 0b0001010..GPIO P0_10 input is selected - * 0b0001011..GPIO P0_11 input is selected - * 0b0001100..GPIO P0_12 input is selected - * 0b0001101..GPIO P0_13 input is selected - * 0b0001110..GPIO P0_14 input is selected - * 0b0001111..GPIO P0_15 input is selected - * 0b0010000..GPIO P0_16 input is selected - * 0b0010001..GPIO P0_17 input is selected - * 0b0010010..GPIO P0_18 input is selected - * 0b0010011..GPIO P0_19 input is selected - * 0b0010100..GPIO P0_20 input is selected - * 0b0010101..GPIO P0_21 input is selected - * 0b0010110..GPIO P0_22 input is selected - * 0b0010111..GPIO P0_23 input is selected - * 0b0011000..GPIO P0_24 input is selected - * 0b0011001..GPIO P0_25 input is selected - * 0b0011010..GPIO P0_26 input is selected - * 0b0011011..GPIO P0_27 input is selected - * 0b0011100..GPIO P0_28 input is selected - * 0b0011101..GPIO P0_29 input is selected - * 0b0011110..GPIO P0_30 input is selected - * 0b0011111..GPIO P0_31 input is selected - * 0b0100000..GPIO P1_0 input is selected - * 0b0100001..GPIO P1_1 input is selected - * 0b0100010..GPIO P1_2 input is selected - * 0b0100011..GPIO P1_3 input is selected - * 0b0100100..GPIO P1_4 input is selected - * 0b0100101..GPIO P1_5 input is selected - * 0b0100110..GPIO P1_6 input is selected - * 0b0100111..GPIO P1_7 input is selected - * 0b0101000..GPIO P1_8 input is selected - * 0b0101001..GPIO P1_9 input is selected - * 0b0101010..GPIO P1_10 input is selected - * 0b0101011..GPIO P1_11 input is selected - * 0b0101100..GPIO P1_12 input is selected - * 0b0101101..GPIO P1_13 input is selected - * 0b0101110..GPIO P1_14 input is selected - * 0b0101111..GPIO P1_15 input is selected - * 0b0110000..GPIO P1_16 input is selected - * 0b0110001..GPIO P1_17 input is selected - * 0b0110010..GPIO P1_18 input is selected - * 0b0110011..GPIO P1_19 input is selected - * 0b0110100..GPIO P1_20 input is selected - * 0b0110101..GPIO P1_21 input is selected - * 0b0110110..GPIO P1_22 input is selected - * 0b0110111..GPIO P1_23 input is selected - * 0b0111000..Reserved - * 0b0111001..Reserved - * 0b0111010..Reserved - * 0b0111011..Reserved - * 0b0111100..Reserved - * 0b0111101..Reserved - * 0b0111110..GPIO P1_30 input is selected - * 0b0111111..GPIO P1_31 input is selected - * *.. - */ -#define INPUTMUX_INPUTMUX_GPIO_INT_PINTSEL_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_INPUTMUX_GPIO_INT_PINTSEL_INP_SHIFT)) & INPUTMUX_INPUTMUX_GPIO_INT_PINTSEL_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_INPUTMUX_GPIO_INT_PINTSEL */ -#define INPUTMUX_INPUTMUX_GPIO_INT_PINTSEL_COUNT (8U) - -/*! @name FREQMEAS_REF - Selection for Frequency Measurement Reference Clock */ -/*! @{ */ - -#define INPUTMUX_FREQMEAS_REF_INP_MASK (0x3FU) -#define INPUTMUX_FREQMEAS_REF_INP_SHIFT (0U) -/*! INP - Clock source number (binary value) for frequency measure function reference clock. - * 0b000000..clk_in (output of clk_in or XTAL mux in Clockgen) input is selected - * 0b000001..FRO_12M input is selected - * 0b000010..FRO_144M input is selected - * 0b000011..Reserved - * 0b000100..OSC_32K input is selected - * 0b000101..CPU/system_clk input is selected - * 0b000110..FREQME_CLK_IN0 input is selected - * 0b000111..FREQME_CLK_IN1 input is selected - * 0b001000..EVTG_OUT0A input is selected - * 0b001001..EVTG_OUT1A input is selected - * *.. - */ -#define INPUTMUX_FREQMEAS_REF_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FREQMEAS_REF_INP_SHIFT)) & INPUTMUX_FREQMEAS_REF_INP_MASK) -/*! @} */ - -/*! @name FREQMEAS_TAR - Selection for Frequency Measurement Target Clock */ -/*! @{ */ - -#define INPUTMUX_FREQMEAS_TAR_INP_MASK (0x3FU) -#define INPUTMUX_FREQMEAS_TAR_INP_SHIFT (0U) -/*! INP - Clock source number (binary value) for frequency measure function target clock. - * 0b000000..clk_in (output of clk_in or XTAL mux in Clockgen) input is selected - * 0b000001..FRO_12M input is selected - * 0b000010..FRO_144M input is selected - * 0b000011..Reserved - * 0b000100..OSC_32K input is selected - * 0b000101..CPU/system_clk input is selected - * 0b000110..FREQME_CLK_IN0 input is selected - * 0b000111..FREQME_CLK_IN1 input is selected - * 0b001000..EVTG_OUT0A input is selected - * 0b001001..EVTG_OUT1A input is selected - * *.. - */ -#define INPUTMUX_FREQMEAS_TAR_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FREQMEAS_TAR_INP_SHIFT)) & INPUTMUX_FREQMEAS_TAR_INP_MASK) -/*! @} */ - -/*! @name CTIMER3CAP0 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER3CAP0_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER3CAP0_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0 ADC0_IRQ input is selected - * 0b0011010..ADC0 ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER3CAP0_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER3CAP0_INP_SHIFT)) & INPUTMUX_CTIMER3CAP0_INP_MASK) -/*! @} */ - -/*! @name CTIMER3CAP1 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER3CAP1_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER3CAP1_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0 ADC0_IRQ input is selected - * 0b0011010..ADC0 ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER3CAP1_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER3CAP1_INP_SHIFT)) & INPUTMUX_CTIMER3CAP1_INP_MASK) -/*! @} */ - -/*! @name CTIMER3CAP2 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER3CAP2_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER3CAP2_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0 ADC0_IRQ input is selected - * 0b0011010..ADC0 ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER3CAP2_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER3CAP2_INP_SHIFT)) & INPUTMUX_CTIMER3CAP2_INP_MASK) -/*! @} */ - -/*! @name CTIMER3CAP3 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER3CAP3_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER3CAP3_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0 ADC0_IRQ input is selected - * 0b0011010..ADC0 ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER3CAP3_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER3CAP3_INP_SHIFT)) & INPUTMUX_CTIMER3CAP3_INP_MASK) -/*! @} */ - -/*! @name TIMER3TRIG - Trigger Register for CTIMER */ -/*! @{ */ - -#define INPUTMUX_TIMER3TRIG_INP_MASK (0x7FU) -#define INPUTMUX_TIMER3TRIG_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0 ADC0_IRQ input is selected - * 0b0011010..ADC0 ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_TIMER3TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_TIMER3TRIG_INP_SHIFT)) & INPUTMUX_TIMER3TRIG_INP_MASK) -/*! @} */ - -/*! @name CTIMER4CAP0 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER4CAP0_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER4CAP0_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0 ADC0_IRQ input is selected - * 0b0011010..ADC0 ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER4CAP0_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER4CAP0_INP_SHIFT)) & INPUTMUX_CTIMER4CAP0_INP_MASK) -/*! @} */ - -/*! @name CTIMER4CAP1 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER4CAP1_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER4CAP1_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0 ADC0_IRQ input is selected - * 0b0011010..ADC0 ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER4CAP1_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER4CAP1_INP_SHIFT)) & INPUTMUX_CTIMER4CAP1_INP_MASK) -/*! @} */ - -/*! @name CTIMER4CAP2 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER4CAP2_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER4CAP2_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0 ADC0_IRQ input is selected - * 0b0011010..ADC0 ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER4CAP2_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER4CAP2_INP_SHIFT)) & INPUTMUX_CTIMER4CAP2_INP_MASK) -/*! @} */ - -/*! @name CTIMER4CAP3 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER4CAP3_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER4CAP3_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0 ADC0_IRQ input is selected - * 0b0011010..ADC0 ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER4CAP3_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER4CAP3_INP_SHIFT)) & INPUTMUX_CTIMER4CAP3_INP_MASK) -/*! @} */ - -/*! @name TIMER4TRIG - Trigger Register for CTIMER */ -/*! @{ */ - -#define INPUTMUX_TIMER4TRIG_INP_MASK (0x7FU) -#define INPUTMUX_TIMER4TRIG_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0 ADC0_IRQ input is selected - * 0b0011010..ADC0 ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_TIMER4TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_TIMER4TRIG_INP_SHIFT)) & INPUTMUX_TIMER4TRIG_INP_MASK) -/*! @} */ - -/*! @name CMP0_TRIG - CMP0 Input Connections */ -/*! @{ */ - -#define INPUTMUX_CMP0_TRIG_TRIGIN_MASK (0x3FU) -#define INPUTMUX_CMP0_TRIG_TRIGIN_SHIFT (0U) -/*! TRIGIN - CMP0 input trigger - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT6 input is selected - * 0b000010..SCT_OUT4 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT6 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER0_MAT0 input is selected - * 0b001001..CTIMER4_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..Reserved - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC1_tcomp[0] input is selected - * 0b001111..Reserved - * 0b010000..Reserved - * 0b010001..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b010010..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b010011..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b010100..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b010101..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b010110..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b010111..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b011000..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b011001..QDC0_CMP/POS_MATCH input is selected - * 0b011010..QDC1_CMP/POS_MATCH input is selected - * 0b011011..EVTG_OUT0A input is selected - * 0b011100..EVTG_OUT0B input is selected - * 0b011101..EVTG_OUT1A input is selected - * 0b011110..EVTG_OUT1B input is selected - * 0b011111..EVTG_OUT2A input is selected - * 0b100000..EVTG_OUT2B input is selected - * 0b100001..EVTG_OUT3A input is selected - * 0b100010..EVTG_OUT3B input is selected - * 0b100011..LPTMR0 input is selected - * 0b100100..LPTMR1 input is selected - * 0b100101..GPIO2 Pin Event Trig 0 input is selected - * 0b100110..GPIO2 Pin Event Trig 1 input is selected - * 0b100111..GPIO3 Pin Event Trig 0 input is selected - * 0b101000..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_CMP0_TRIG_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CMP0_TRIG_TRIGIN_SHIFT)) & INPUTMUX_CMP0_TRIG_TRIGIN_MASK) -/*! @} */ - -/*! @name ADC0_TRIGM_ADC0_TRIG - ADC Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_ADC0_TRIGM_ADC0_TRIG_TRIGIN_MASK (0xFFU) -#define INPUTMUX_ADC0_TRIGM_ADC0_TRIG_TRIGIN_SHIFT (0U) -/*! TRIGIN - ADC0 trigger inputs - * 0b00000000..PINT PIN_INT0 input is selected - * 0b00000001..PINT PIN_INT1 input is selected - * 0b00000010..SCT0 SCT_OUT4 input is selected - * 0b00000011..SCT0 SCT_OUT5 input is selected - * 0b00000100..SCT0 SCT_OUT9 input is selected - * 0b00000101..CTIMER0_MAT3 input is selected - * 0b00000110..CTIMER1_MAT3 input is selected - * 0b00000111..CTIMER2_MAT3 input is selected - * 0b00001000..CTIMER3_MAT3 input is selected - * 0b00001001..CTIMER4_MAT3 input is selected - * 0b00001010..DCDC_Burst_Done_Trig input is selected - * 0b00001011..Reserved - * 0b00001100..PINT GPIO_INT_BMAT input is selected - * 0b00001101..ADC0_tcomp[0] input is selected - * 0b00001110..ADC0_tcomp[1] input is selected - * 0b00001111..ADC0_tcomp[2] input is selected - * 0b00010000..ADC0_tcomp[3] input is selected - * 0b00010001..ADC1_tcomp[0] input is selected - * 0b00010010..ADC1_tcomp[1] input is selected - * 0b00010011..ADC1_tcomp[2] input is selected - * 0b00010100..ADC1_tcomp[3] input is selected - * 0b00010101..CMP0_OUT input is selected - * 0b00010110..CMP1_OUT input is selected - * 0b00010111..CMP2_OUT input is selected - * 0b00011000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b00011001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b00011010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b00011011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b00011100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b00011101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b00011110..PWM0_SM3_MUX_TRIG0 input is selected - * 0b00011111..PWM0_SM3_MUX_TRIG1 input is selected - * 0b00100000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b00100001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b00100010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b00100011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b00100100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b00100101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b00100110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b00100111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b00101000..QDC0_CMP/POS_MATCH input is selected - * 0b00101001..QDC1_CMP/POS_MATCH input is selected - * 0b00101010..EVTG_OUT0A input is selected - * 0b00101011..EVTG_OUT0B input is selected - * 0b00101100..EVTG_OUT1A input is selected - * 0b00101101..EVTG_OUT1B input is selected - * 0b00101110..EVTG_OUT2A input is selected - * 0b00101111..EVTG_OUT2B input is selected - * 0b00110000..EVTG_OUT3A input is selected - * 0b00110001..EVTG_OUT3B input is selected - * 0b00110010..LPTMR0 input is selected - * 0b00110011..LPTMR1 input is selected - * 0b00110100..FlexIO CH0 input is selected - * 0b00110101..FlexIO CH1 input is selected - * 0b00110110..FlexIO CH2 input is selected - * 0b00110111..FlexIO CH3 input is selected - * 0b00111000..SINC Filter CH0 Conversion Complete input is selected - * 0b00111001..SINC Filter CH1 Conversion Complete input is selected - * 0b00111010..SINC Filter CH2 Conversion Complete input is selected - * 0b00111011..SINC Filter CH3 Conversion Complete input is selected - * 0b00111100..SINC Filter CH4 Conversion Complete input is selected - * 0b00111101..GPIO2 Pin Event Trig 0 input is selected - * 0b00111110..GPIO2 Pin Event Trig 1 input is selected - * 0b00111111..GPIO3 Pin Event Trig 0 input is selected - * 0b01000000..GPIO3 Pin Event Trig 1 input is selected - * 0b01000001..WUU input is selected - * *.. - */ -#define INPUTMUX_ADC0_TRIGM_ADC0_TRIG_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_ADC0_TRIGM_ADC0_TRIG_TRIGIN_SHIFT)) & INPUTMUX_ADC0_TRIGM_ADC0_TRIG_TRIGIN_MASK) -/*! @} */ - -/* The count of INPUTMUX_ADC0_TRIGM_ADC0_TRIG */ -#define INPUTMUX_ADC0_TRIGM_ADC0_TRIG_COUNT (4U) - -/*! @name ADC1_TRIGN_ADC1_TRIG - ADC Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_ADC1_TRIGN_ADC1_TRIG_TRIGIN_MASK (0xFFU) -#define INPUTMUX_ADC1_TRIGN_ADC1_TRIG_TRIGIN_SHIFT (0U) -/*! TRIGIN - ADC1 trigger inputs - * 0b00000000..PINT PIN_INT0 input is selected - * 0b00000001..PINT PIN_INT2 input is selected - * 0b00000010..SCT0 SCT_OUT4 input is selected - * 0b00000011..SCT0 SCT_OUT5 input is selected - * 0b00000100..SCT0 SCT_OUT3 input is selected - * 0b00000101..CTIMER0_MAT3 input is selected - * 0b00000110..CTIMER1_MAT3 input is selected - * 0b00000111..CTIMER2_MAT3 input is selected - * 0b00001000..CTIMER3_MAT2 input is selected - * 0b00001001..CTIMER4_MAT1 input is selected - * 0b00001010..DCDC_Burst_Done_Trig input is selected - * 0b00001011..Reserved - * 0b00001100..PINT GPIO_INT_BMAT input is selected - * 0b00001101..ADC0_tcomp[0] input is selected - * 0b00001110..ADC0_tcomp[1] input is selected - * 0b00001111..ADC0_tcomp[2] input is selected - * 0b00010000..ADC0_tcomp[3] input is selected - * 0b00010001..ADC1_tcomp[0] input is selected - * 0b00010010..ADC1_tcomp[1] input is selected - * 0b00010011..ADC1_tcomp[2] input is selected - * 0b00010100..ADC1_tcomp[3] input is selected - * 0b00010101..CMP0_OUT input is selected - * 0b00010110..CMP1_OUT input is selected - * 0b00010111..CMP2_OUT input is selected - * 0b00011000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b00011001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b00011010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b00011011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b00011100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b00011101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b00011110..PWM0_SM3_MUX_TRIG0 input is selected - * 0b00011111..PWM0_SM3_MUX_TRIG1 input is selected - * 0b00100000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b00100001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b00100010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b00100011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b00100100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b00100101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b00100110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b00100111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b00101000..QDC0_CMP/POS_MATCH input is selected - * 0b00101001..QDC1_CMP/POS_MATCH input is selected - * 0b00101010..EVTG_OUT0A input is selected - * 0b00101011..EVTG_OUT0B input is selected - * 0b00101100..EVTG_OUT1A input is selected - * 0b00101101..EVTG_OUT1B input is selected - * 0b00101110..EVTG_OUT2A input is selected - * 0b00101111..EVTG_OUT2B input is selected - * 0b00110000..EVTG_OUT3A input is selected - * 0b00110001..EVTG_OUT3B input is selected - * 0b00110010..LPTMR0 input is selected - * 0b00110011..LPTMR1 input is selected - * 0b00110100..FlexIO CH0 input is selected - * 0b00110101..FlexIO CH1 input is selected - * 0b00110110..FlexIO CH2 input is selected - * 0b00110111..FlexIO CH3 input is selected - * 0b00111000..SINC Filter CH0 Conversion Complete input is selected - * 0b00111001..SINC Filter CH1 Conversion Complete input is selected - * 0b00111010..SINC Filter CH2 Conversion Complete input is selected - * 0b00111011..SINC Filter CH3 Conversion Complete input is selected - * 0b00111100..SINC Filter CH4 Conversion Complete input is selected - * 0b00111101..GPIO2 Pin Event Trig 0 input is selected - * 0b00111110..GPIO2 Pin Event Trig 1 input is selected - * 0b00111111..GPIO3 Pin Event Trig 0 input is selected - * 0b01000000..GPIO3 Pin Event Trig 1 input is selected - * 0b01000001..WUU input is selected - * *.. - */ -#define INPUTMUX_ADC1_TRIGN_ADC1_TRIG_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_ADC1_TRIGN_ADC1_TRIG_TRIGIN_SHIFT)) & INPUTMUX_ADC1_TRIGN_ADC1_TRIG_TRIGIN_MASK) -/*! @} */ - -/* The count of INPUTMUX_ADC1_TRIGN_ADC1_TRIG */ -#define INPUTMUX_ADC1_TRIGN_ADC1_TRIG_COUNT (4U) - -/*! @name DAC0_TRIG - DAC0 Trigger Inputs */ -/*! @{ */ - -#define INPUTMUX_DAC0_TRIG_TRIGIN_MASK (0x3FU) -#define INPUTMUX_DAC0_TRIG_TRIGIN_SHIFT (0U) -/*! TRIGIN - DAC0 trigger input - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT3 input is selected - * 0b000010..SCT0 SCT_OUT4 input is selected - * 0b000011..SCT0 SCT_OUT5 input is selected - * 0b000100..SCT0 SCT_OUT0 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER2_MAT0 input is selected - * 0b001001..CTIMER3_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..Reserved - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC1_tcomp[0] input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..CMP2_OUT input is selected - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..LPTMR0 input is selected - * 0b011011..LPTMR1 input is selected - * 0b011100..GPIO2 Pin Event Trig 0 input is selected - * 0b011101..GPIO2 Pin Event Trig 1 input is selected - * 0b011110..GPIO3 Pin Event Trig 0 input is selected - * 0b011111..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_DAC0_TRIG_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DAC0_TRIG_TRIGIN_SHIFT)) & INPUTMUX_DAC0_TRIG_TRIGIN_MASK) -/*! @} */ - -/*! @name DAC1_TRIG - DAC1 Trigger Inputs */ -/*! @{ */ - -#define INPUTMUX_DAC1_TRIG_TRIGIN_MASK (0x3FU) -#define INPUTMUX_DAC1_TRIG_TRIGIN_SHIFT (0U) -/*! TRIGIN - DAC1 trigger input - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT4 input is selected - * 0b000010..SCT0 SCT_OUT4 input is selected - * 0b000011..SCT0 SCT_OUT5 input is selected - * 0b000100..SCT0 SCT_OUT1 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER2_MAT1 input is selected - * 0b001001..CTIMER3_MAT1 input is selected - * 0b001010..Reserved - * 0b001011..Reserved - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[1] input is selected - * 0b001110..ADC1_tcomp[1] input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..CMP2_OUT input is selected - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..LPTMR0 input is selected - * 0b011011..LPTMR1 input is selected - * 0b011100..GPIO2 Pin Event Trig 0 input is selected - * 0b011101..GPIO2 Pin Event Trig 1 input is selected - * 0b011110..GPIO3 Pin Event Trig 0 input is selected - * 0b011111..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_DAC1_TRIG_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DAC1_TRIG_TRIGIN_SHIFT)) & INPUTMUX_DAC1_TRIG_TRIGIN_MASK) -/*! @} */ - -/*! @name DAC2_TRIG - DAC2 Trigger Inputs */ -/*! @{ */ - -#define INPUTMUX_DAC2_TRIG_TRIGIN_MASK (0x3FU) -#define INPUTMUX_DAC2_TRIG_TRIGIN_SHIFT (0U) -/*! TRIGIN - DAC2 trigger input - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..SCT0 SCT_OUT4 input is selected - * 0b000011..SCT0 SCT_OUT5 input is selected - * 0b000100..SCT0 SCT_OUT2 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER2_MAT2 input is selected - * 0b001001..CTIMER3_MAT2 input is selected - * 0b001010..Reserved - * 0b001011..Reserved - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[2] input is selected - * 0b001110..ADC1_tcomp[2] input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..CMP2_OUT input is selected - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..LPTMR0 input is selected - * 0b011011..LPTMR1 input is selected - * 0b011100..GPIO2 Pin Event Trig 0 input is selected - * 0b011101..GPIO2 Pin Event Trig 1 input is selected - * 0b011110..GPIO3 Pin Event Trig 0 input is selected - * 0b011111..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_DAC2_TRIG_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DAC2_TRIG_TRIGIN_SHIFT)) & INPUTMUX_DAC2_TRIG_TRIGIN_MASK) -/*! @} */ - -/*! @name QDCN_QDC_TRIG - QDC0 Trigger Input Connections..QDC1 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDCN_QDC_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_QDCN_QDC_TRIG_INP_SHIFT (0U) -/*! INP - QDC1 trigger input connections - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT4 input is selected - * 0b000010..SCT_OUT4 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT1 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER1_MAT0 input is selected - * 0b001001..CTIMER3_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..CMP2_OUT input is selected - * 0b011000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * *.. - */ -#define INPUTMUX_QDCN_QDC_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDCN_QDC_TRIG_INP_SHIFT)) & INPUTMUX_QDCN_QDC_TRIG_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_QDCN_QDC_TRIG */ -#define INPUTMUX_QDCN_QDC_TRIG_COUNT (2U) - -/*! @name QDCN_QDC_HOME - QDC0 Input Connections..QDC1 Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDCN_QDC_HOME_INP_MASK (0x3FU) -#define INPUTMUX_QDCN_QDC_HOME_INP_SHIFT (0U) -/*! INP - QDC1 HOME input connections - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT4 input is selected - * 0b000010..SCT0 SCT_OUT4 input is selected - * 0b000011..SCT0 SCT_OUT5 input is selected - * 0b000100..SCT0 SCT_OUT1 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER1_MAT0 input is selected - * 0b001001..CTIMER3_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..CMP2_OUT input is selected - * 0b011000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * *.. - */ -#define INPUTMUX_QDCN_QDC_HOME_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDCN_QDC_HOME_INP_SHIFT)) & INPUTMUX_QDCN_QDC_HOME_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_QDCN_QDC_HOME */ -#define INPUTMUX_QDCN_QDC_HOME_COUNT (2U) - -/*! @name QDCN_QDC_INDEX - QDC0 Input Connections..QDC1 Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDCN_QDC_INDEX_INP_MASK (0x3FU) -#define INPUTMUX_QDCN_QDC_INDEX_INP_SHIFT (0U) -/*! INP - QDC1 INDEX input connections - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT4 input is selected - * 0b000010..SCT_OUT4 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT1 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER1_MAT0 input is selected - * 0b001001..CTIMER3_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..CMP2_OUT input is selected - * 0b011000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * *.. - */ -#define INPUTMUX_QDCN_QDC_INDEX_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDCN_QDC_INDEX_INP_SHIFT)) & INPUTMUX_QDCN_QDC_INDEX_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_QDCN_QDC_INDEX */ -#define INPUTMUX_QDCN_QDC_INDEX_COUNT (2U) - -/*! @name QDCN_QDC_PHASEB - QDC0 Input Connections..QDC1 Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDCN_QDC_PHASEB_INP_MASK (0x3FU) -#define INPUTMUX_QDCN_QDC_PHASEB_INP_SHIFT (0U) -/*! INP - QDC1 PHASEB input connections - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT4 input is selected - * 0b000010..SCT_OUT4 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT1 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER1_MAT0 input is selected - * 0b001001..CTIMER3_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..CMP2_OUT input is selected - * 0b011000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * *.. - */ -#define INPUTMUX_QDCN_QDC_PHASEB_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDCN_QDC_PHASEB_INP_SHIFT)) & INPUTMUX_QDCN_QDC_PHASEB_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_QDCN_QDC_PHASEB */ -#define INPUTMUX_QDCN_QDC_PHASEB_COUNT (2U) - -/*! @name QDCN_QDC_PHASEA - QDC0 Input Connections..QDC1 Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDCN_QDC_PHASEA_INP_MASK (0x3FU) -#define INPUTMUX_QDCN_QDC_PHASEA_INP_SHIFT (0U) -/*! INP - QDC1 PHASEA input connections - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT4 input is selected - * 0b000010..SCT_OUT4 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT1 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER1_MAT0 input is selected - * 0b001001..CTIMER3_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..CMP2_OUT input is selected - * 0b011000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * *.. - */ -#define INPUTMUX_QDCN_QDC_PHASEA_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDCN_QDC_PHASEA_INP_SHIFT)) & INPUTMUX_QDCN_QDC_PHASEA_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_QDCN_QDC_PHASEA */ -#define INPUTMUX_QDCN_QDC_PHASEA_COUNT (2U) - -/*! @name FLEXPWM_SM_EXTSYNC_FLEXPWM0_SM_EXTSYNC - PWM0 External Synchronization */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM_SM_EXTSYNC_FLEXPWM0_SM_EXTSYNC_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM_SM_EXTSYNC_FLEXPWM0_SM_EXTSYNC_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXTSYNC input connections for PWM0 - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..SCT_OUT4 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT2 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER2_MAT0 input is selected - * 0b001001..CTIMER4_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..CMP2_OUT input is selected - * 0b011000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * 0b110100..SINC Filter CH0 sync Break input is selected - * 0b110101..SINC Filter CH1 sync Break input is selected - * 0b110110..SINC Filter CH2 sync Break input is selected - * 0b110111..SINC Filter CH3 sync Break input is selected - * 0b111000..SINC Filter CH4 sync Break input is selected - * 0b111001..GPIO2 Pin Event Trig 0 input is selected - * 0b111010..GPIO2 Pin Event Trig 1 input is selected - * 0b111011..GPIO3 Pin Event Trig 0 input is selected - * 0b111100..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM_SM_EXTSYNC_FLEXPWM0_SM_EXTSYNC_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM_SM_EXTSYNC_FLEXPWM0_SM_EXTSYNC_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM_SM_EXTSYNC_FLEXPWM0_SM_EXTSYNC_TRIGIN_MASK) -/*! @} */ - -/* The count of INPUTMUX_FLEXPWM_SM_EXTSYNC_FLEXPWM0_SM_EXTSYNC */ -#define INPUTMUX_FLEXPWM_SM_EXTSYNC_FLEXPWM0_SM_EXTSYNC_COUNT (4U) - -/*! @name FLEXPWM_SM_EXT_FLEXPWM0_SM_EXTA - PWM0 Input Trigger Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM_SM_EXT_FLEXPWM0_SM_EXTA_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM_SM_EXT_FLEXPWM0_SM_EXTA_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXTA input connections for PWM0 - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..SCT_OUT4 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT2 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER2_MAT0 input is selected - * 0b001001..CTIMER4_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..CMP2_OUT input is selected - * 0b011000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * 0b110100..SINC Filter CH0 sync Break input is selected - * 0b110101..SINC Filter CH1 sync Break input is selected - * 0b110110..SINC Filter CH2 sync Break input is selected - * 0b110111..SINC Filter CH3 sync Break input is selected - * 0b111000..SINC Filter CH4 sync Break input is selected - * 0b111001..GPIO2 Pin Event Trig 0 input is selected - * 0b111010..GPIO2 Pin Event Trig 1 input is selected - * 0b111011..GPIO3 Pin Event Trig 0 input is selected - * 0b111100..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM_SM_EXT_FLEXPWM0_SM_EXTA_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM_SM_EXT_FLEXPWM0_SM_EXTA_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM_SM_EXT_FLEXPWM0_SM_EXTA_TRIGIN_MASK) -/*! @} */ - -/* The count of INPUTMUX_FLEXPWM_SM_EXT_FLEXPWM0_SM_EXTA */ -#define INPUTMUX_FLEXPWM_SM_EXT_FLEXPWM0_SM_EXTA_COUNT (4U) - -/*! @name FLEXPWM0_EXTFORCE - PWM0 External Force Trigger Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM0_EXTFORCE_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM0_EXTFORCE_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXTFORCE input connections for PWM0 - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..SCT_OUT4 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT2 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER2_MAT0 input is selected - * 0b001001..CTIMER4_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..CMP2_OUT input is selected - * 0b011000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * 0b110100..SINC Filter CH0 sync Break input is selected - * 0b110101..SINC Filter CH1 sync Break input is selected - * 0b110110..SINC Filter CH2 sync Break input is selected - * 0b110111..SINC Filter CH3 sync Break input is selected - * 0b111000..SINC Filter CH4 sync Break input is selected - * 0b111001..GPIO2 Pin Event Trig 0 input is selected - * 0b111010..GPIO2 Pin Event Trig 1 input is selected - * 0b111011..GPIO3 Pin Event Trig 0 input is selected - * 0b111100..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM0_EXTFORCE_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM0_EXTFORCE_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM0_EXTFORCE_TRIGIN_MASK) -/*! @} */ - -/*! @name FLEXPWM_FAULT_FLEXPWM0_FAULT - PWM0 Fault Input Trigger Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM_FAULT_FLEXPWM0_FAULT_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM_FAULT_FLEXPWM0_FAULT_TRIGIN_SHIFT (0U) -/*! TRIGIN - FAULT input connections for PWM0 - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..SCT_OUT4 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT2 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER2_MAT0 input is selected - * 0b001001..CTIMER4_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..CMP2_OUT input is selected - * 0b011000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * 0b110100..SINC Filter CH0 sync Break input is selected - * 0b110101..SINC Filter CH1 sync Break input is selected - * 0b110110..SINC Filter CH2 sync Break input is selected - * 0b110111..SINC Filter CH3 sync Break input is selected - * 0b111000..SINC Filter CH4 sync Break input is selected - * 0b111001..GPIO2 Pin Event Trig 0 input is selected - * 0b111010..GPIO2 Pin Event Trig 1 input is selected - * 0b111011..GPIO3 Pin Event Trig 0 input is selected - * 0b111100..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM_FAULT_FLEXPWM0_FAULT_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM_FAULT_FLEXPWM0_FAULT_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM_FAULT_FLEXPWM0_FAULT_TRIGIN_MASK) -/*! @} */ - -/* The count of INPUTMUX_FLEXPWM_FAULT_FLEXPWM0_FAULT */ -#define INPUTMUX_FLEXPWM_FAULT_FLEXPWM0_FAULT_COUNT (4U) - -/*! @name FLEXPWM1_SM_EXTSYNC_ARRAY_FLEXPWM1_SM_EXTSYNC - PWM1 External Synchronization */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM1_SM_EXTSYNC_ARRAY_FLEXPWM1_SM_EXTSYNC_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM1_SM_EXTSYNC_ARRAY_FLEXPWM1_SM_EXTSYNC_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXTSYNC input connections for PWM1 - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT2 input is selected - * 0b000010..SCT_OUT4 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT3 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER2_MAT1 input is selected - * 0b001001..CTIMER4_MAT1 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..CMP2_OUT input is selected - * 0b011000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM0_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM0_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * 0b110100..SINC Filter CH0 sync Break input is selected - * 0b110101..SINC Filter CH1 sync Break input is selected - * 0b110110..SINC Filter CH2 sync Break input is selected - * 0b110111..SINC Filter CH3 sync Break input is selected - * 0b111000..SINC Filter CH4 sync Break input is selected - * 0b111001..GPIO2 Pin Event Trig 0 input is selected - * 0b111010..GPIO2 Pin Event Trig 1 input is selected - * 0b111011..GPIO3 Pin Event Trig 0 input is selected - * 0b111100..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM1_SM_EXTSYNC_ARRAY_FLEXPWM1_SM_EXTSYNC_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM1_SM_EXTSYNC_ARRAY_FLEXPWM1_SM_EXTSYNC_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM1_SM_EXTSYNC_ARRAY_FLEXPWM1_SM_EXTSYNC_TRIGIN_MASK) -/*! @} */ - -/* The count of INPUTMUX_FLEXPWM1_SM_EXTSYNC_ARRAY_FLEXPWM1_SM_EXTSYNC */ -#define INPUTMUX_FLEXPWM1_SM_EXTSYNC_ARRAY_FLEXPWM1_SM_EXTSYNC_COUNT (4U) - -/*! @name FLEXPWM_SM1_EXTA_ARRAY_FLEXPWM1_SM_EXTA - PWM1 Input EXTA Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM_SM1_EXTA_ARRAY_FLEXPWM1_SM_EXTA_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM_SM1_EXTA_ARRAY_FLEXPWM1_SM_EXTA_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXTA input connections for PWM1 - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT2 input is selected - * 0b000010..SCT_OUT4 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT3 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER2_MAT1 input is selected - * 0b001001..CTIMER4_MAT1 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..CMP2_OUT input is selected - * 0b011000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM0_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM0_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * 0b110100..SINC Filter CH0 sync Break input is selected - * 0b110101..SINC Filter CH1 sync Break input is selected - * 0b110110..SINC Filter CH2 sync Break input is selected - * 0b110111..SINC Filter CH3 sync Break input is selected - * 0b111000..SINC Filter CH4 sync Break input is selected - * 0b111001..GPIO2 Pin Event Trig 0 input is selected - * 0b111010..GPIO2 Pin Event Trig 1 input is selected - * 0b111011..GPIO3 Pin Event Trig 0 input is selected - * 0b111100..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM_SM1_EXTA_ARRAY_FLEXPWM1_SM_EXTA_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM_SM1_EXTA_ARRAY_FLEXPWM1_SM_EXTA_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM_SM1_EXTA_ARRAY_FLEXPWM1_SM_EXTA_TRIGIN_MASK) -/*! @} */ - -/* The count of INPUTMUX_FLEXPWM_SM1_EXTA_ARRAY_FLEXPWM1_SM_EXTA */ -#define INPUTMUX_FLEXPWM_SM1_EXTA_ARRAY_FLEXPWM1_SM_EXTA_COUNT (4U) - -/*! @name FLEXPWM1_EXTFORCE - PWM1 External Force Trigger Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM1_EXTFORCE_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM1_EXTFORCE_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXTFORCE input connections for PWM1 - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT2 input is selected - * 0b000010..SCT_OUT4 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT3 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER2_MAT1 input is selected - * 0b001001..CTIMER4_MAT1 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..CMP2_OUT input is selected - * 0b011000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM0_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM0_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * 0b110100..SINC Filter CH0 sync Break input is selected - * 0b110101..SINC Filter CH1 sync Break input is selected - * 0b110110..SINC Filter CH2 sync Break input is selected - * 0b110111..SINC Filter CH3 sync Break input is selected - * 0b111000..SINC Filter CH4 sync Break input is selected - * 0b111001..GPIO2 Pin Event Trig 0 input is selected - * 0b111010..GPIO2 Pin Event Trig 1 input is selected - * 0b111011..GPIO3 Pin Event Trig 0 input is selected - * 0b111100..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM1_EXTFORCE_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM1_EXTFORCE_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM1_EXTFORCE_TRIGIN_MASK) -/*! @} */ - -/*! @name FLEXPWM1_FAULT - PWM1 Fault Input Trigger Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM1_FAULT_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM1_FAULT_TRIGIN_SHIFT (0U) -/*! TRIGIN - FAULT input connections for PWM1 - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT2 input is selected - * 0b000010..SCT_OUT4 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT3 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER2_MAT1 input is selected - * 0b001001..CTIMER4_MAT1 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..CMP2_OUT input is selected - * 0b011000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM0_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM0_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * 0b110100..SINC Filter CH0 sync Break input is selected - * 0b110101..SINC Filter CH1 sync Break input is selected - * 0b110110..SINC Filter CH2 sync Break input is selected - * 0b110111..SINC Filter CH3 sync Break input is selected - * 0b111000..SINC Filter CH4 sync Break input is selected - * 0b111001..GPIO2 Pin Event Trig 0 input is selected - * 0b111010..GPIO2 Pin Event Trig 1 input is selected - * 0b111011..GPIO3 Pin Event Trig 0 input is selected - * 0b111100..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM1_FAULT_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM1_FAULT_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM1_FAULT_TRIGIN_MASK) -/*! @} */ - -/* The count of INPUTMUX_FLEXPWM1_FAULT */ -#define INPUTMUX_FLEXPWM1_FAULT_COUNT (4U) - -/*! @name PWM0_EXT_CLK - PWM0 External Clock Trigger */ -/*! @{ */ - -#define INPUTMUX_PWM0_EXT_CLK_TRIGIN_MASK (0x7U) -#define INPUTMUX_PWM0_EXT_CLK_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXT_CLK input connections for PWM0 - * 0b000..FRO16K input is selected - * 0b001..OSC_32k input is selected - * 0b010..EVTG_OUT0A input is selected - * 0b011..EVTG_OUT1A input is selected - * 0b100..TRIG_IN0 input is selected - * 0b101..TRIG_IN7 input is selected - * *.. - */ -#define INPUTMUX_PWM0_EXT_CLK_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_PWM0_EXT_CLK_TRIGIN_SHIFT)) & INPUTMUX_PWM0_EXT_CLK_TRIGIN_MASK) -/*! @} */ - -/*! @name PWM1_EXT_CLK - PWM1 External Clock Trigger */ -/*! @{ */ - -#define INPUTMUX_PWM1_EXT_CLK_TRIGIN_MASK (0xFU) -#define INPUTMUX_PWM1_EXT_CLK_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXT_CLK input connections for PWM1 - * 0b0000..FRO16K input is selected - * 0b0001..OSC_32k input is selected - * 0b0010..EVTG_OUT0A input is selected - * 0b0011..EVTG_OUT1A input is selected - * 0b0100..TRIG_IN0 input is selected - * 0b0101..TRIG_IN7 input is selected - * *.. - */ -#define INPUTMUX_PWM1_EXT_CLK_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_PWM1_EXT_CLK_TRIGIN_SHIFT)) & INPUTMUX_PWM1_EXT_CLK_TRIGIN_MASK) -/*! @} */ - -/*! @name EVTG_TRIGN_EVTG_TRIG - EVTG Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_EVTG_TRIGN_EVTG_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_EVTG_TRIGN_EVTG_TRIG_INP_SHIFT (0U) -/*! INP - EVTG trigger input connections - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT1 input is selected - * 0b000010..SCT_OUT0 input is selected - * 0b000011..SCT_OUT1 input is selected - * 0b000100..SCT_OUT2 input is selected - * 0b000101..SCT_OUT3 input is selected - * 0b000110..CTIMER0_MAT3 input is selected - * 0b000111..CTIMER1_MAT3 input is selected - * 0b001000..CTIMER2_MAT3 input is selected - * 0b001001..CTIMER2_MAT2 input is selected - * 0b001010..CTIMER3_MAT2 input is selected - * 0b001011..CTIMER4_MAT2 input is selected - * 0b001100..Reserved - * 0b001101..PINT GPIO_INT_BMAT input is selected - * 0b001110..ADC0_IRQ input is selected - * 0b001111..ADC1_IRQ input is selected - * 0b010000..ADC0_tcomp[0] input is selected - * 0b010001..ADC0_tcomp[1] input is selected - * 0b010010..ADC0_tcomp[2] input is selected - * 0b010011..ADC0_tcomp[3] input is selected - * 0b010100..ADC1_tcomp[0] input is selected - * 0b010101..ADC1_tcomp[1] input is selected - * 0b010110..ADC1_tcomp[2] input is selected - * 0b010111..ADC1_tcomp[3] input is selected - * 0b011000..CMP0_OUT input is selected - * 0b011001..CMP1_OUT input is selected - * 0b011010..CMP2_OUT input is selected - * 0b011011..PWM0_SM0_MUX_TRIG0 input is selected - * 0b011100..PWM0_SM0_MUX_TRIG1 input is selected - * 0b011101..PWM0_SM1_MUX_TRIG0 input is selected - * 0b011110..PWM0_SM1_MUX_TRIG1 input is selected - * 0b011111..PWM0_SM2_MUX_TRIG0 input is selected - * 0b100000..PWM0_SM2_MUX_TRIG1 input is selected - * 0b100001..PWM0_SM3_MUX_TRIG0 input is selected - * 0b100010..PWM0_SM3_MUX_TRIG1 input is selected - * 0b100011..PWM1_SM0_MUX_TRIG0 input is selected - * 0b100100..PWM1_SM0_MUX_TRIG1 input is selected - * 0b100101..PWM1_SM1_MUX_TRIG0 input is selected - * 0b100110..PWM1_SM1_MUX_TRIG1 input is selected - * 0b100111..PWM1_SM2_MUX_TRIG0 input is selected - * 0b101000..PWM1_SM2_MUX_TRIG1 input is selected - * 0b101001..PWM1_SM3_MUX_TRIG0 input is selected - * 0b101010..PWM1_SM3_MUX_TRIG1 input is selected - * 0b101011..QDC0_CMP/POS_MATCH input is selected - * 0b101100..QDC1_CMP/POS_MATCH input is selected - * 0b101101..TRIG_IN0 input is selected - * 0b101110..TRIG_IN1 input is selected - * 0b101111..TRIG_IN2 input is selected - * 0b110000..TRIG_IN3 input is selected - * 0b110001..LPTMR0 input is selected - * 0b110010..LPTMR1 input is selected - * 0b110011..SINC Filter CH0 Break input is selected - * 0b110100..SINC Filter CH1 Break input is selected - * 0b110101..SINC Filter CH2 Break input is selected - * 0b110110..SINC Filter CH3 Break input is selected - * 0b110111..SINC Filter CH4 Break input is selected - * 0b111000..Reserved - * 0b111001..Reserved - * *.. - */ -#define INPUTMUX_EVTG_TRIGN_EVTG_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_EVTG_TRIGN_EVTG_TRIG_INP_SHIFT)) & INPUTMUX_EVTG_TRIGN_EVTG_TRIG_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_EVTG_TRIGN_EVTG_TRIG */ -#define INPUTMUX_EVTG_TRIGN_EVTG_TRIG_COUNT (16U) - -/*! @name USBFS_TRIG - USB-FS Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_USBFS_TRIG_INP_MASK (0xFU) -#define INPUTMUX_USBFS_TRIG_INP_SHIFT (0U) -/*! INP - USB-FS trigger input connections. The trigger output of LP_FLEXCOMM is an input of peripheral INPUTMUX. - * 0b0000..LP_FLEXCOMM 0 trigger out [3] input is selected - * 0b0001..LP_FLEXCOMM 1 trigger out [3] input is selected - * 0b0010..LP_FLEXCOMM 2 trigger out [3] input is selected - * 0b0011..LP_FLEXCOMM 3 trigger out [3] input is selected - * 0b0100..LP_FLEXCOMM 4 trigger out [3] input is selected - * 0b0101..LP_FLEXCOMM 5 trigger out [3] input is selected - * 0b0110..LP_FLEXCOMM 6 trigger out [3] input is selected - * 0b0111..LP_FLEXCOMM 7 trigger out [3] input is selected - * 0b1000..LP_FLEXCOMM 8 trigger out [3] input is selected - * 0b1001..LP_FLEXCOMM 9 trigger out [3] input is selected - * *.. - */ -#define INPUTMUX_USBFS_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_USBFS_TRIG_INP_SHIFT)) & INPUTMUX_USBFS_TRIG_INP_MASK) -/*! @} */ - -/*! @name TSI_TRIG - TSI Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_TSI_TRIG_INP_MASK (0x3U) -#define INPUTMUX_TSI_TRIG_INP_SHIFT (0U) -/*! INP - TSI trigger input connections - * 0b00..LPTMR0 input is selected - * 0b01..LPTMR1 input is selected - * *.. - */ -#define INPUTMUX_TSI_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_TSI_TRIG_INP_SHIFT)) & INPUTMUX_TSI_TRIG_INP_MASK) -/*! @} */ - -/*! @name EXT_TRIGN_EXT_TRIG - EXT Trigger Connections */ -/*! @{ */ - -#define INPUTMUX_EXT_TRIGN_EXT_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_EXT_TRIGN_EXT_TRIG_INP_SHIFT (0U) -/*! INP - TRIG_OUTa pin input connections - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT1 input is selected - * 0b000010..ADC0_IRQ input is selected - * 0b000011..ADC1_IRQ input is selected - * 0b000100..ADC0_tcomp[0] input is selected - * 0b000101..ADC1_tcomp[0] input is selected - * 0b000110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b000111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b001000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b001001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b001010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b001011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b001100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b001101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b001110..QDC0_CMP/POS_MATCH input is selected - * 0b001111..QDC1_CMP/POS_MATCH input is selected - * 0b010000..EVTG_OUT0A input is selected - * 0b010001..EVTG_OUT0B input is selected - * 0b010010..EVTG_OUT1A input is selected - * 0b010011..EVTG_OUT1B input is selected - * 0b010100..EVTG_OUT2A input is selected - * 0b010101..EVTG_OUT2B input is selected - * 0b010110..EVTG_OUT3A input is selected - * 0b010111..EVTG_OUT3B input is selected - * 0b011000..Reserved - * 0b011001..Reserved - * 0b011010..LPTMR0 input is selected - * 0b011011..LPTMR1 input is selected - * 0b011100..SCT Out0 input is selected - * 0b011101..SCT Out1 input is selected - * 0b011110..SCT Out2 input is selected - * 0b011111..SCT Out3 input is selected - * 0b100000..SCT Out4 input is selected - * 0b100001..SCT Out5 input is selected - * 0b100010..LP_FLEXCOMM0 trigger output 3 input is selected - * 0b100011..LP_FLEXCOMM1 trigger output 3 input is selected - * 0b100100..LP_FLEXCOMM2 trigger output 3 input is selected - * 0b100101..LP_FLEXCOMM3 trigger output 3 input is selected - * 0b100110..LP_FLEXCOMM4 trigger output 3 input is selected - * 0b100111..LP_FLEXCOMM5 trigger output 3 input is selected - * 0b101000..LP_FLEXCOMM6 trigger output 3 input is selected - * 0b101001..LP_FLEXCOMM7 trigger output 3 input is selected - * 0b101010..LP_FLEXCOMM8 trigger output 3 input is selected - * 0b101011..LP_FLEXCOMM9 trigger output 3 input is selected - * 0b101100..CMP0_OUT input is selected - * 0b101101..CMP1_OUT input is selected - * 0b101110..CMP2_OUT input is selected - * 0b101111..ENET_PPS_OUT_0 input is selected - * *.. - */ -#define INPUTMUX_EXT_TRIGN_EXT_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_EXT_TRIGN_EXT_TRIG_INP_SHIFT)) & INPUTMUX_EXT_TRIGN_EXT_TRIG_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_EXT_TRIGN_EXT_TRIG */ -#define INPUTMUX_EXT_TRIGN_EXT_TRIG_COUNT (8U) - -/*! @name CMP1_TRIG - CMP1 Input Connections */ -/*! @{ */ - -#define INPUTMUX_CMP1_TRIG_TRIGIN_MASK (0x3FU) -#define INPUTMUX_CMP1_TRIG_TRIGIN_SHIFT (0U) -/*! TRIGIN - CMP1 input trigger - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT7 input is selected - * 0b000010..SCT0 SCT_OUT4 input is selected - * 0b000011..SCT0 SCT_OUT5 input is selected - * 0b000100..SCT0 SCT_OUT7 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER3_MAT1 input is selected - * 0b001001..CTIMER4_MAT1 input is selected - * 0b001010..Reserved - * 0b001011..Reserved - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[1] input is selected - * 0b001110..ADC1_tcomp[1] input is selected - * 0b001111..Reserved - * 0b010000..Reserved - * 0b010001..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b010010..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b010011..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b010100..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b010101..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b010110..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b010111..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b011000..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b011001..QDC0_CMP/POS_MATCH input is selected - * 0b011010..QDC1_CMP/POS_MATCH input is selected - * 0b011011..EVTG_OUT0A input is selected - * 0b011100..EVTG_OUT0B input is selected - * 0b011101..EVTG_OUT1A input is selected - * 0b011110..EVTG_OUT1B input is selected - * 0b011111..EVTG_OUT2A input is selected - * 0b100000..EVTG_OUT2B input is selected - * 0b100001..EVTG_OUT3A input is selected - * 0b100010..EVTG_OUT3B input is selected - * 0b100011..LPTMR0 input is selected - * 0b100100..LPTMR1 input is selected - * 0b100101..GPIO2 Pin Event Trig 0 input is selected - * 0b100110..GPIO2 Pin Event Trig 1 input is selected - * 0b100111..GPIO3 Pin Event Trig 0 input is selected - * 0b101000..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_CMP1_TRIG_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CMP1_TRIG_TRIGIN_SHIFT)) & INPUTMUX_CMP1_TRIG_TRIGIN_MASK) -/*! @} */ - -/*! @name CMP2_TRIG - CMP2 Input Connections */ -/*! @{ */ - -#define INPUTMUX_CMP2_TRIG_TRIGIN_MASK (0x3FU) -#define INPUTMUX_CMP2_TRIG_TRIGIN_SHIFT (0U) -/*! TRIGIN - CMP2 input trigger - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT4 input is selected - * 0b000010..SCT0 SCT_OUT4 input is selected - * 0b000011..SCT0 SCT_OUT5 input is selected - * 0b000100..SCT0 SCT_OUT8 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER3_MAT2 input is selected - * 0b001001..CTIMER4_MAT2 input is selected - * 0b001010..Reserved - * 0b001011..Reserved - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[2] input is selected - * 0b001110..ADC1_tcomp[2] input is selected - * 0b001111..Reserved - * 0b010000..Reserved - * 0b010001..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b010010..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b010011..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b010100..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b010101..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b010110..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b010111..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b011000..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b011001..QDC0_CMP/POS_MATCH input is selected - * 0b011010..QDC1_CMP/POS_MATCH input is selected - * 0b011011..EVTG_OUT0A input is selected - * 0b011100..EVTG_OUT0B input is selected - * 0b011101..EVTG_OUT1A input is selected - * 0b011110..EVTG_OUT1B input is selected - * 0b011111..EVTG_OUT2A input is selected - * 0b100000..EVTG_OUT2B input is selected - * 0b100001..EVTG_OUT3A input is selected - * 0b100010..EVTG_OUT3B input is selected - * 0b100011..LPTMR0 input is selected - * 0b100100..LPTMR1 input is selected - * 0b100101..GPIO2 Pin Event Trig 0 input is selected - * 0b100110..GPIO2 Pin Event Trig 1 input is selected - * 0b100111..GPIO3 Pin Event Trig 0 input is selected - * 0b101000..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_CMP2_TRIG_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CMP2_TRIG_TRIGIN_SHIFT)) & INPUTMUX_CMP2_TRIG_TRIGIN_MASK) -/*! @} */ - -/*! @name SINC_FILTER_CHN_SINC_FILTER_CH - SINC Filter Channel Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_SINC_FILTER_CHN_SINC_FILTER_CH_INP_MASK (0x3FU) -#define INPUTMUX_SINC_FILTER_CHN_SINC_FILTER_CH_INP_SHIFT (0U) -/*! INP - SINC FILTER trigger input connections - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT1 input is selected - * 0b000010..SCT_OUT4 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT9 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER3_MAT3 input is selected - * 0b001001..CTIMER4_MAT3 input is selected - * 0b001010..Reserved - * 0b001011..Reserved - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..CMP2_OUT input is selected - * 0b011000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM0_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM0_SM3_MUX_TRIG1 input is selected - * 0b100000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b100001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b100010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b100011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b100100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b100101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b100110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b100111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b101000..QDC0_CMP/POS_MATCH input is selected - * 0b101001..QDC1_CMP/POS_MATCH input is selected - * 0b101010..EVTG_OUT0A input is selected - * 0b101011..EVTG_OUT0B input is selected - * 0b101100..EVTG_OUT1A input is selected - * 0b101101..EVTG_OUT1B input is selected - * 0b101110..EVTG_OUT2A input is selected - * 0b101111..EVTG_OUT2B input is selected - * 0b110000..EVTG_OUT3A input is selected - * 0b110001..EVTG_OUT3B input is selected - * 0b110010..LPTMR0 input is selected - * 0b110011..LPTMR1 input is selected - * 0b110100..FlexIO CH0 input is selected - * 0b110101..FlexIO CH1 input is selected - * 0b110110..FlexIO CH2 input is selected - * 0b110111..FlexIO CH3 input is selected - * 0b111000..WUU input is selected - * *.. - */ -#define INPUTMUX_SINC_FILTER_CHN_SINC_FILTER_CH_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_SINC_FILTER_CHN_SINC_FILTER_CH_INP_SHIFT)) & INPUTMUX_SINC_FILTER_CHN_SINC_FILTER_CH_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_SINC_FILTER_CHN_SINC_FILTER_CH */ -#define INPUTMUX_SINC_FILTER_CHN_SINC_FILTER_CH_COUNT (5U) - -/*! @name OPAMPN_TRIG_OPAMP_TRIG - OPAMP Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_OPAMPN_TRIG_OPAMP_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_OPAMPN_TRIG_OPAMP_TRIG_INP_SHIFT (0U) -/*! INP - OPAMP trigger input connections - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT1 input is selected - * 0b000010..PINT PIN_INT2 input is selected - * 0b000011..PINT PIN_INT3 input is selected - * 0b000100..SCT_OUT4 input is selected - * 0b000101..SCT_OUT5 input is selected - * 0b000110..SCT_OUT6 input is selected - * 0b000111..SCT_OUT7 input is selected - * 0b001000..SCT_OUT8 input is selected - * 0b001001..CTIMER0_MAT3 input is selected - * 0b001010..CTIMER1_MAT3 input is selected - * 0b001011..CTIMER2_MAT3 input is selected - * 0b001100..CTIMER3_MAT3 input is selected - * 0b001101..CTIMER4_MAT3 input is selected - * 0b001110..PINT GPIO_INT_BMAT input is selected - * 0b001111..ADC0_tcomp[0] input is selected - * 0b010000..ADC0_tcomp[1] input is selected - * 0b010001..ADC0_tcomp[2] input is selected - * 0b010010..ADC0_tcomp[3] input is selected - * 0b010011..ADC1_tcomp[0] input is selected - * 0b010100..ADC1_tcomp[1] input is selected - * 0b010101..ADC1_tcomp[2] input is selected - * 0b010110..ADC1_tcomp[3] input is selected - * 0b010111..PWM0_SM0_MUX_TRIG0 input is selected - * 0b011000..PWM0_SM0_MUX_TRIG1 input is selected - * 0b011001..PWM0_SM1_MUX_TRIG0 input is selected - * 0b011010..PWM0_SM1_MUX_TRIG1 input is selected - * 0b011011..PWM0_SM2_MUX_TRIG0 input is selected - * 0b011100..PWM0_SM2_MUX_TRIG1 input is selected - * 0b011101..PWM0_SM3_MUX_TRIG0 input is selected - * 0b011110..PWM0_SM3_MUX_TRIG1 input is selected - * 0b011111..PWM1_SM0_MUX_TRIG0 input is selected - * 0b100000..PWM1_SM0_MUX_TRIG1 input is selected - * 0b100001..PWM1_SM1_MUX_TRIG0 input is selected - * 0b100010..PWM1_SM1_MUX_TRIG1 input is selected - * 0b100011..PWM1_SM2_MUX_TRIG0 input is selected - * 0b100100..PWM1_SM2_MUX_TRIG1 input is selected - * 0b100101..PWM1_SM3_MUX_TRIG0 input is selected - * 0b100110..PWM1_SM3_MUX_TRIG1 input is selected - * 0b100111..EVTG_OUT0A input is selected - * 0b101000..EVTG_OUT0B input is selected - * 0b101001..EVTG_OUT1A input is selected - * 0b101010..EVTG_OUT1B input is selected - * 0b101011..EVTG_OUT2A input is selected - * 0b101100..EVTG_OUT2B input is selected - * 0b101101..EVTG_OUT3A input is selected - * 0b101110..EVTG_OUT3B input is selected - * 0b101111..TRIG_IN0 input is selected - * 0b110000..TRIG_IN1 input is selected - * 0b110001..TRIG_IN2 input is selected - * 0b110010..TRIG_IN3 input is selected - * 0b110011..FlexIO CH4 input is selected - * 0b110100..FlexIO CH5 input is selected - * 0b110101..FlexIO CH6 input is selected - * 0b110110..FlexIO CH7 input is selected - * *.. - */ -#define INPUTMUX_OPAMPN_TRIG_OPAMP_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_OPAMPN_TRIG_OPAMP_TRIG_INP_SHIFT)) & INPUTMUX_OPAMPN_TRIG_OPAMP_TRIG_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_OPAMPN_TRIG_OPAMP_TRIG */ -#define INPUTMUX_OPAMPN_TRIG_OPAMP_TRIG_COUNT (3U) - -/*! @name FLEXCOMM0_TRIG - LP_FLEXCOMM0 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXCOMM0_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_FLEXCOMM0_TRIG_INP_SHIFT (0U) -/*! INP - LP_FLEXCOMM0 trigger input connections - * 0b000000..PINT PIN_INT4 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..PINT PIN_INT6 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT6 input is selected - * 0b000101..SCT_OUT7 input is selected - * 0b000110..CTIMER0_MAT1 input is selected - * 0b000111..CTIMER1_MAT1 input is selected - * 0b001000..CTIMER2_MAT0 input is selected - * 0b001001..CTIMER3_MAT0 input is selected - * 0b001010..CTIMER4_MAT0 input is selected - * 0b001011..LPTMR0 input is selected - * 0b001100..LPTMR1 input is selected - * 0b001101..Reserved - * 0b001110..PINT GPIO_INT_BMAT input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..CMP2_OUT input is selected - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..TRIG_IN0 input is selected - * 0b011011..TRIG_IN1 input is selected - * 0b011100..TRIG_IN2 input is selected - * 0b011101..TRIG_IN3 input is selected - * 0b011110..TRIG_IN4 input is selected - * 0b011111..TRIG_IN10 input is selected - * 0b100000..TRIG_IN11 input is selected - * 0b100001..FlexIO CH4 input is selected - * 0b100010..FlexIO CH5 input is selected - * 0b100011..FlexIO CH6 input is selected - * 0b100100..FlexIO CH7 input is selected - * 0b100101..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO2 Pin Event Trig 1 input is selected - * 0b101000..GPIO3 Pin Event Trig 0 input is selected - * 0b101001..GPIO3 Pin Event Trig 1 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXCOMM0_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXCOMM0_TRIG_INP_SHIFT)) & INPUTMUX_FLEXCOMM0_TRIG_INP_MASK) -/*! @} */ - -/*! @name FLEXCOMM1_TRIG - LP_FLEXCOMM1 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXCOMM1_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_FLEXCOMM1_TRIG_INP_SHIFT (0U) -/*! INP - LP_FLEXCOMM1 trigger input connections - * 0b000000..PINT PIN_INT4 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..PINT PIN_INT6 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT6 input is selected - * 0b000101..SCT_OUT7 input is selected - * 0b000110..CTIMER0_MAT1 input is selected - * 0b000111..CTIMER1_MAT1 input is selected - * 0b001000..CTIMER2_MAT0 input is selected - * 0b001001..CTIMER3_MAT0 input is selected - * 0b001010..CTIMER4_MAT0 input is selected - * 0b001011..LPTMR0 input is selected - * 0b001100..LPTMR1 input is selected - * 0b001101..Reserved - * 0b001110..PINT GPIO_INT_BMAT input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..CMP2_OUT input is selected - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..TRIG_IN0 input is selected - * 0b011011..TRIG_IN1 input is selected - * 0b011100..TRIG_IN2 input is selected - * 0b011101..TRIG_IN3 input is selected - * 0b011110..TRIG_IN4 input is selected - * 0b011111..TRIG_IN10 input is selected - * 0b100000..TRIG_IN11 input is selected - * 0b100001..FlexIO CH4 input is selected - * 0b100010..FlexIO CH5 input is selected - * 0b100011..FlexIO CH6 input is selected - * 0b100100..FlexIO CH7 input is selected - * 0b100101..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO2 Pin Event Trig 1 input is selected - * 0b101000..GPIO3 Pin Event Trig 0 input is selected - * 0b101001..GPIO3 Pin Event Trig 1 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXCOMM1_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXCOMM1_TRIG_INP_SHIFT)) & INPUTMUX_FLEXCOMM1_TRIG_INP_MASK) -/*! @} */ - -/*! @name FLEXCOMM2_TRIG - LP_FLEXCOMM2 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXCOMM2_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_FLEXCOMM2_TRIG_INP_SHIFT (0U) -/*! INP - LP_FLEXCOMM2 trigger input connections - * 0b000000..PINT PIN_INT4 input is selected - * 0b000001..PINT PIN_INT6 input is selected - * 0b000010..PINT PIN_INT7 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT8 input is selected - * 0b000101..SCT_OUT9 input is selected - * 0b000110..CTIMER0_MAT1 input is selected - * 0b000111..CTIMER1_MAT1 input is selected - * 0b001000..CTIMER2_MAT1 input is selected - * 0b001001..CTIMER3_MAT1 input is selected - * 0b001010..CTIMER4_MAT1 input is selected - * 0b001011..LPTMR0 input is selected - * 0b001100..LPTMR1 input is selected - * 0b001101..Reserved - * 0b001110..PINT GPIO_INT_BMAT input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..CMP2_OUT input is selected - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..TRIG_IN0 input is selected - * 0b011011..TRIG_IN1 input is selected - * 0b011100..TRIG_IN2 input is selected - * 0b011101..TRIG_IN3 input is selected - * 0b011110..TRIG_IN4 input is selected - * 0b011111..TRIG_IN10 input is selected - * 0b100000..TRIG_IN11 input is selected - * 0b100001..FlexIO CH4 input is selected - * 0b100010..FlexIO CH5 input is selected - * 0b100011..FlexIO CH6 input is selected - * 0b100100..FlexIO CH7 input is selected - * 0b100101..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO2 Pin Event Trig 1 input is selected - * 0b101000..GPIO3 Pin Event Trig 0 input is selected - * 0b101001..GPIO3 Pin Event Trig 1 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXCOMM2_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXCOMM2_TRIG_INP_SHIFT)) & INPUTMUX_FLEXCOMM2_TRIG_INP_MASK) -/*! @} */ - -/*! @name FLEXCOMM3_TRIG - LP_FLEXCOMM3 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXCOMM3_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_FLEXCOMM3_TRIG_INP_SHIFT (0U) -/*! INP - LP_FLEXCOMM3 trigger input connections - * 0b000000..PINT PIN_INT4 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..PINT PIN_INT7 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT8 input is selected - * 0b000101..SCT_OUT9 input is selected - * 0b000110..CTIMER0_MAT1 input is selected - * 0b000111..CTIMER1_MAT1 input is selected - * 0b001000..CTIMER2_MAT1 input is selected - * 0b001001..CTIMER3_MAT1 input is selected - * 0b001010..CTIMER4_MAT1 input is selected - * 0b001011..LPTMR0 input is selected - * 0b001100..LPTMR1 input is selected - * 0b001101..Reserved - * 0b001110..PINT GPIO_INT_BMAT input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..CMP2_OUT input is selected - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..TRIG_IN0 input is selected - * 0b011011..TRIG_IN1 input is selected - * 0b011100..TRIG_IN2 input is selected - * 0b011101..TRIG_IN3 input is selected - * 0b011110..TRIG_IN4 input is selected - * 0b011111..TRIG_IN10 input is selected - * 0b100000..TRIG_IN11 input is selected - * 0b100001..FlexIO CH4 input is selected - * 0b100010..FlexIO CH5 input is selected - * 0b100011..FlexIO CH6 input is selected - * 0b100100..FlexIO CH7 input is selected - * 0b100101..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO2 Pin Event Trig 1 input is selected - * 0b101000..GPIO3 Pin Event Trig 0 input is selected - * 0b101001..GPIO3 Pin Event Trig 1 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXCOMM3_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXCOMM3_TRIG_INP_SHIFT)) & INPUTMUX_FLEXCOMM3_TRIG_INP_MASK) -/*! @} */ - -/*! @name FLEXCOMM4_TRIG - LP_FLEXCOMM4 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXCOMM4_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_FLEXCOMM4_TRIG_INP_SHIFT (0U) -/*! INP - LP_FLEXCOMM4 trigger input connections - * 0b000000..PINT PIN_INT4 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..PINT PIN_INT7 input is selected - * 0b000011..SCT_OUT0 input is selected - * 0b000100..SCT_OUT1 input is selected - * 0b000101..SCT_OUT2 input is selected - * 0b000110..CTIMER0_MAT1 input is selected - * 0b000111..CTIMER1_MAT1 input is selected - * 0b001000..CTIMER2_MAT2 input is selected - * 0b001001..CTIMER3_MAT2 input is selected - * 0b001010..CTIMER4_MAT2 input is selected - * 0b001011..LPTMR0 input is selected - * 0b001100..LPTMR1 input is selected - * 0b001101..Reserved - * 0b001110..PINT GPIO_INT_BMAT input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..CMP2_OUT input is selected - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..TRIG_IN0 input is selected - * 0b011011..TRIG_IN1 input is selected - * 0b011100..TRIG_IN2 input is selected - * 0b011101..TRIG_IN3 input is selected - * 0b011110..TRIG_IN4 input is selected - * 0b011111..TRIG_IN10 input is selected - * 0b100000..TRIG_IN11 input is selected - * 0b100001..FlexIO CH4 input is selected - * 0b100010..FlexIO CH5 input is selected - * 0b100011..FlexIO CH6 input is selected - * 0b100100..FlexIO CH7 input is selected - * 0b100101..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO2 Pin Event Trig 1 input is selected - * 0b101000..GPIO3 Pin Event Trig 0 input is selected - * 0b101001..GPIO3 Pin Event Trig 1 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXCOMM4_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXCOMM4_TRIG_INP_SHIFT)) & INPUTMUX_FLEXCOMM4_TRIG_INP_MASK) -/*! @} */ - -/*! @name FLEXCOMM5_TRIG - LP_FLEXCOMM5 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXCOMM5_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_FLEXCOMM5_TRIG_INP_SHIFT (0U) -/*! INP - LP_FLEXCOMM5 trigger input connections - * 0b000000..PINT PIN_INT4 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..PINT PIN_INT7 input is selected - * 0b000011..SCT_OUT0 input is selected - * 0b000100..SCT_OUT1 input is selected - * 0b000101..SCT_OUT2 input is selected - * 0b000110..CTIMER0_MAT1 input is selected - * 0b000111..CTIMER1_MAT1 input is selected - * 0b001000..CTIMER2_MAT2 input is selected - * 0b001001..CTIMER3_MAT2 input is selected - * 0b001010..CTIMER4_MAT2 input is selected - * 0b001011..LPTMR0 input is selected - * 0b001100..LPTMR1 input is selected - * 0b001101..Reserved - * 0b001110..PINT GPIO_INT_BMAT input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..CMP2_OUT input is selected - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..TRIG_IN0 input is selected - * 0b011011..TRIG_IN1 input is selected - * 0b011100..TRIG_IN2 input is selected - * 0b011101..TRIG_IN3 input is selected - * 0b011110..TRIG_IN4 input is selected - * 0b011111..TRIG_IN10 input is selected - * 0b100000..TRIG_IN11 input is selected - * 0b100001..FlexIO CH4 input is selected - * 0b100010..FlexIO CH5 input is selected - * 0b100011..FlexIO CH6 input is selected - * 0b100100..FlexIO CH7 input is selected - * 0b100101..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO2 Pin Event Trig 1 input is selected - * 0b101000..GPIO3 Pin Event Trig 0 input is selected - * 0b101001..GPIO3 Pin Event Trig 1 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXCOMM5_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXCOMM5_TRIG_INP_SHIFT)) & INPUTMUX_FLEXCOMM5_TRIG_INP_MASK) -/*! @} */ - -/*! @name FLEXCOMM6_TRIG - LP_FLEXCOMM6 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXCOMM6_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_FLEXCOMM6_TRIG_INP_SHIFT (0U) -/*! INP - LP_FLEXCOMM6 trigger input connections - * 0b000000..PINT PIN_INT4 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..PINT PIN_INT7 input is selected - * 0b000011..SCT_OUT0 input is selected - * 0b000100..SCT_OUT3 input is selected - * 0b000101..SCT_OUT4 input is selected - * 0b000110..CTIMER0_MAT1 input is selected - * 0b000111..CTIMER1_MAT1 input is selected - * 0b001000..CTIMER2_MAT3 input is selected - * 0b001001..CTIMER3_MAT3 input is selected - * 0b001010..CTIMER4_MAT3 input is selected - * 0b001011..LPTMR0 input is selected - * 0b001100..LPTMR1 input is selected - * 0b001101..Reserved - * 0b001110..PINT GPIO_INT_BMAT input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..CMP2_OUT input is selected - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..TRIG_IN0 input is selected - * 0b011011..TRIG_IN1 input is selected - * 0b011100..TRIG_IN2 input is selected - * 0b011101..TRIG_IN3 input is selected - * 0b011110..TRIG_IN4 input is selected - * 0b011111..TRIG_IN10 input is selected - * 0b100000..TRIG_IN11 input is selected - * 0b100001..FlexIO CH4 input is selected - * 0b100010..FlexIO CH5 input is selected - * 0b100011..FlexIO CH6 input is selected - * 0b100100..FlexIO CH7 input is selected - * 0b100101..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO2 Pin Event Trig 1 input is selected - * 0b101000..GPIO3 Pin Event Trig 0 input is selected - * 0b101001..GPIO3 Pin Event Trig 1 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXCOMM6_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXCOMM6_TRIG_INP_SHIFT)) & INPUTMUX_FLEXCOMM6_TRIG_INP_MASK) -/*! @} */ - -/*! @name FLEXCOMM7_TRIG - LP_FLEXCOMM7 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXCOMM7_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_FLEXCOMM7_TRIG_INP_SHIFT (0U) -/*! INP - LP_FLEXCOMM7 trigger input connections - * 0b000000..PINT PIN_INT4 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..PINT PIN_INT7 input is selected - * 0b000011..SCT_OUT0 input is selected - * 0b000100..SCT_OUT3 input is selected - * 0b000101..SCT_OUT4 input is selected - * 0b000110..CTIMER0_MAT1 input is selected - * 0b000111..CTIMER1_MAT1 input is selected - * 0b001000..CTIMER2_MAT3 input is selected - * 0b001001..CTIMER3_MAT3 input is selected - * 0b001010..CTIMER4_MAT3 input is selected - * 0b001011..LPTMR0 input is selected - * 0b001100..LPTMR1 input is selected - * 0b001101..Reserved - * 0b001110..PINT GPIO_INT_BMAT input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..CMP2_OUT input is selected - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..TRIG_IN0 input is selected - * 0b011011..TRIG_IN1 input is selected - * 0b011100..TRIG_IN2 input is selected - * 0b011101..TRIG_IN3 input is selected - * 0b011110..TRIG_IN4 input is selected - * 0b011111..TRIG_IN10 input is selected - * 0b100000..TRIG_IN11 input is selected - * 0b100001..FlexIO CH4 input is selected - * 0b100010..FlexIO CH5 input is selected - * 0b100011..FlexIO CH6 input is selected - * 0b100100..FlexIO CH7 input is selected - * 0b100101..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO2 Pin Event Trig 1 input is selected - * 0b101000..GPIO3 Pin Event Trig 0 input is selected - * 0b101001..GPIO3 Pin Event Trig 1 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXCOMM7_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXCOMM7_TRIG_INP_SHIFT)) & INPUTMUX_FLEXCOMM7_TRIG_INP_MASK) -/*! @} */ - -/*! @name FLEXCOMM8_TRIG - LP_FLEXCOMM8 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXCOMM8_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_FLEXCOMM8_TRIG_INP_SHIFT (0U) -/*! INP - LP_FLEXCOMM8 trigger input connections - * 0b000000..PINT PIN_INT4 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..PINT PIN_INT7 input is selected - * 0b000011..SCT_OUT0 input is selected - * 0b000100..SCT_OUT3 input is selected - * 0b000101..SCT_OUT4 input is selected - * 0b000110..CTIMER0_MAT1 input is selected - * 0b000111..CTIMER1_MAT1 input is selected - * 0b001000..CTIMER2_MAT3 input is selected - * 0b001001..CTIMER3_MAT3 input is selected - * 0b001010..CTIMER4_MAT3 input is selected - * 0b001011..LPTMR0 input is selected - * 0b001100..LPTMR1 input is selected - * 0b001101..Reserved - * 0b001110..PINT GPIO_INT_BMAT input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..CMP2_OUT input is selected - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..TRIG_IN0 input is selected - * 0b011011..TRIG_IN1 input is selected - * 0b011100..TRIG_IN2 input is selected - * 0b011101..TRIG_IN3 input is selected - * 0b011110..TRIG_IN4 input is selected - * 0b011111..TRIG_IN10 input is selected - * 0b100000..TRIG_IN11 input is selected - * 0b100001..FlexIO CH4 input is selected - * 0b100010..FlexIO CH5 input is selected - * 0b100011..FlexIO CH6 input is selected - * 0b100100..FlexIO CH7 input is selected - * 0b100101..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO2 Pin Event Trig 1 input is selected - * 0b101000..GPIO3 Pin Event Trig 0 input is selected - * 0b101001..GPIO3 Pin Event Trig 1 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXCOMM8_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXCOMM8_TRIG_INP_SHIFT)) & INPUTMUX_FLEXCOMM8_TRIG_INP_MASK) -/*! @} */ - -/*! @name FLEXCOMM9_TRIG - LP_FLEXCOMM9 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXCOMM9_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_FLEXCOMM9_TRIG_INP_SHIFT (0U) -/*! INP - LP_FLEXCOMM9 trigger input connections - * 0b000000..PINT PIN_INT4 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..PINT PIN_INT7 input is selected - * 0b000011..SCT_OUT0 input is selected - * 0b000100..SCT_OUT3 input is selected - * 0b000101..SCT_OUT4 input is selected - * 0b000110..CTIMER0_MAT1 input is selected - * 0b000111..CTIMER1_MAT1 input is selected - * 0b001000..CTIMER2_MAT0 input is selected - * 0b001001..CTIMER3_MAT0 input is selected - * 0b001010..CTIMER4_MAT0 input is selected - * 0b001011..LPTMR0 input is selected - * 0b001100..LPTMR1 input is selected - * 0b001101..Reserved - * 0b001110..PINT GPIO_INT_BMAT input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..CMP2_OUT input is selected - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..TRIG_IN0 input is selected - * 0b011011..TRIG_IN1 input is selected - * 0b011100..TRIG_IN2 input is selected - * 0b011101..TRIG_IN3 input is selected - * 0b011110..TRIG_IN4 input is selected - * 0b011111..TRIG_IN10 input is selected - * 0b100000..TRIG_IN11 input is selected - * 0b100001..FlexIO CH4 input is selected - * 0b100010..FlexIO CH5 input is selected - * 0b100011..FlexIO CH6 input is selected - * 0b100100..FlexIO CH7 input is selected - * 0b100101..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO2 Pin Event Trig 1 input is selected - * 0b101000..GPIO3 Pin Event Trig 0 input is selected - * 0b101001..GPIO3 Pin Event Trig 1 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXCOMM9_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXCOMM9_TRIG_INP_SHIFT)) & INPUTMUX_FLEXCOMM9_TRIG_INP_MASK) -/*! @} */ - -/*! @name FLEXIO_TRIGN_FLEXIO_TRIG - FlexIO Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXIO_TRIGN_FLEXIO_TRIG_INP_MASK (0x7FU) -#define INPUTMUX_FLEXIO_TRIGN_FLEXIO_TRIG_INP_SHIFT (0U) -/*! INP - Input number for FlexIO0. - * 0b0000000..PINT PIN_INT4 input is selected - * 0b0000001..PINT PIN_INT5 input is selected - * 0b0000010..PINT PIN_INT6 input is selected - * 0b0000011..PINT PIN_INT7 input is selected - * 0b0000100..SCT_OUT5 input is selected - * 0b0000101..SCT_OUT6 input is selected - * 0b0000110..SCT_OUT7 input is selected - * 0b0000111..SCT_OUT8 input is selected - * 0b0001000..SCT_OUT9 input is selected - * 0b0001001..T0_MAT1 input is selected - * 0b0001010..T1_MAT1 input is selected - * 0b0001011..T2_MAT1 input is selected - * 0b0001100..T3_MAT1 input is selected - * 0b0001101..T4_MAT1 input is selected - * 0b0001110..LPTMR0 input is selected - * 0b0001111..LPTMR1 input is selected - * 0b0010000..Reserved - * 0b0010001..PINT GPIO_INT_BMAT input is selected - * 0b0010010..ADC0_tcomp[0] input is selected - * 0b0010011..ADC0_tcomp[1] input is selected - * 0b0010100..ADC0_tcomp[2] input is selected - * 0b0010101..ADC0_tcomp[3] input is selected - * 0b0010110..ADC1_tcomp[0] input is selected - * 0b0010111..ADC1_tcomp[1] input is selected - * 0b0011000..ADC1_tcomp[2] input is selected - * 0b0011001..ADC1_tcomp[3] input is selected - * 0b0011010..CMP0_OUT input is selected - * 0b0011011..CMP1_OUT input is selected - * 0b0011100..CMP2_OUT input is selected - * 0b0011101..PWM0_SM0_MUX_TRIG0 input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0100000..PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0100010..PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100011..PWM0_SM3_MUX_TRIG0 input is selected - * 0b0100100..PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM0_MUX_TRIG0 input is selected - * 0b0100110..PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100111..PWM1_SM1_MUX_TRIG0 input is selected - * 0b0101000..PWM1_SM1_MUX_TRIG1 input is selected - * 0b0101001..PWM1_SM2_MUX_TRIG0 input is selected - * 0b0101010..PWM1_SM2_MUX_TRIG1 input is selected - * 0b0101011..PWM1_SM3_MUX_TRIG0 input is selected - * 0b0101100..PWM1_SM3_MUX_TRIG1 input is selected - * 0b0101101..EVTG_OUT0A input is selected - * 0b0101110..EVTG_OUT0B input is selected - * 0b0101111..EVTG_OUT1A input is selected - * 0b0110000..EVTG_OUT1B input is selected - * 0b0110001..EVTG_OUT2A input is selected - * 0b0110010..EVTG_OUT2B input is selected - * 0b0110011..EVTG_OUT3A input is selected - * 0b0110100..EVTG_OUT3B input is selected - * 0b0110101..TRIG_IN0 input is selected - * 0b0110110..TRIG_IN1 input is selected - * 0b0110111..TRIG_IN2 input is selected - * 0b0111000..TRIG_IN3 input is selected - * 0b0111001..TRIG_IN4 input is selected - * 0b0111010..SINC Filter CH0 Conversion Complete input is selected - * 0b0111011..SINC Filter CH1 Conversion Complete input is selected - * 0b0111100..SINC Filter CH2 Conversion Complete input is selected - * 0b0111101..SINC Filter CH3 Conversion Complete input is selected - * 0b0111110..SINC Filter CH4 Conversion Complete input is selected - * 0b0111111..LP_FLEXCOMM0 trig 0 (lpuart_trg_txword) input is selected - * 0b1000000..LP_FLEXCOMM0 trig 1 (lpuart_trg_rxword) input is selected - * 0b1000001..LP_FLEXCOMM0 trig 2 (lpuart_trg_rxidle) input is selected - * 0b1000010..LP_FLEXCOMM1 trig 0 input is selected - * 0b1000011..LP_FLEXCOMM1 trig 1 input is selected - * 0b1000100..LP_FLEXCOMM1 trig 2 input is selected - * 0b1000101..LP_FLEXCOMM2 trig 0 input is selected - * 0b1000110..LP_FLEXCOMM2 trig 1 input is selected - * 0b1000111..LP_FLEXCOMM2 trig 2 input is selected - * 0b1001000..LP_FLEXCOMM3 trig 0 input is selected - * 0b1001001..LP_FLEXCOMM3 trig 1 input is selected - * 0b1001010..LP_FLEXCOMM3 trig 2 input is selected - * 0b1001011..LP_FLEXCOMM3 trig 3 input is selected - * 0b1001100..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXIO_TRIGN_FLEXIO_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXIO_TRIGN_FLEXIO_TRIG_INP_SHIFT)) & INPUTMUX_FLEXIO_TRIGN_FLEXIO_TRIG_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_FLEXIO_TRIGN_FLEXIO_TRIG */ -#define INPUTMUX_FLEXIO_TRIGN_FLEXIO_TRIG_COUNT (8U) - -/*! @name DMA0_REQ_ENABLE0 - DMA0 Request Enable0 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ1_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ1_EN0_SHIFT (1U) -/*! REQ1_EN0 - This register is used to enable and disable FLEXSPI0 receive event request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ1_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ1_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ1_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ2_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ2_EN0_SHIFT (2U) -/*! REQ2_EN0 - This register is used to enable and disable FLEXSPI0 transmit event request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ2_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ2_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ2_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ3_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ3_EN0_SHIFT (3U) -/*! REQ3_EN0 - This register is used to enable and disable PINT0 INT0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ3_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ3_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ3_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ4_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ4_EN0_SHIFT (4U) -/*! REQ4_EN0 - This register is used to enable and disable PINT0 INT1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ4_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ4_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ4_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ5_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ5_EN0_SHIFT (5U) -/*! REQ5_EN0 - This register is used to enable and disable PINT0 INT2 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ5_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ5_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ5_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ6_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ6_EN0_SHIFT (6U) -/*! REQ6_EN0 - This register is used to enable and disable PINT0 INT3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ6_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ6_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ6_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ7_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ7_EN0_SHIFT (7U) -/*! REQ7_EN0 - This register is used to enable and disable CTIMER0 DMAREQ_M0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ7_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ7_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ7_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ8_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ8_EN0_SHIFT (8U) -/*! REQ8_EN0 - This register is used to enable and disable CTIMER0 DMAREQ_M1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ8_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ8_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ8_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ9_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ9_EN0_SHIFT (9U) -/*! REQ9_EN0 - This register is used to enable and disable CTIMER1 DMAREQ_M0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ9_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ9_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ9_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ10_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ10_EN0_SHIFT (10U) -/*! REQ10_EN0 - This register is used to enable and disable CTIMER1 DMAREQ_M1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ10_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ10_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ10_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ11_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ11_EN0_SHIFT (11U) -/*! REQ11_EN0 - This register is used to enable and disable CTIMER2 DMAREQ_M0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ11_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ11_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ11_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ12_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ12_EN0_SHIFT (12U) -/*! REQ12_EN0 - This register is used to enable and disable CTIMER2 DMAREQ_M1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ12_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ12_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ12_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ13_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ13_EN0_SHIFT (13U) -/*! REQ13_EN0 - This register is used to enable and disable CTIMER3 DMAREQ_M0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ13_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ13_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ13_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ14_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ14_EN0_SHIFT (14U) -/*! REQ14_EN0 - This register is used to enable and disable CTIMER3 DMAREQ_M1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ14_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ14_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ14_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ15_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ15_EN0_SHIFT (15U) -/*! REQ15_EN0 - This register is used to enable and disable CTIMER4 DMAREQ_M0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ15_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ15_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ15_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ16_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ16_EN0_SHIFT (16U) -/*! REQ16_EN0 - This register is used to enable and disable CTIMER4 DMAREQ_M1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ16_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ16_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ16_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ17_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ17_EN0_SHIFT (17U) -/*! REQ17_EN0 - This register is used to enable and disable WUU0 wake up event request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ17_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ17_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ17_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ18_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ18_EN0_SHIFT (18U) -/*! REQ18_EN0 - This register is used to enable and disable MICFIL0 FIFO_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ18_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ18_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ18_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ19_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ19_EN0_SHIFT (19U) -/*! REQ19_EN0 - This register is used to enable and disable SCT0 DMA0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ19_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ19_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ19_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ20_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ20_EN0_SHIFT (20U) -/*! REQ20_EN0 - This register is used to enable and disable SCT0 DMA1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ20_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ20_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ20_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ21_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ21_EN0_SHIFT (21U) -/*! REQ21_EN0 - This register is used to enable and disable ADC0 FIFO A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ21_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ21_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ21_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ22_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ22_EN0_SHIFT (22U) -/*! REQ22_EN0 - This register is used to enable and disable ADC0 FIFO B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ22_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ22_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ22_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ23_EN0_MASK (0x800000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ23_EN0_SHIFT (23U) -/*! REQ23_EN0 - This register is used to enable and disable ADC1 FIFO A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ23_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ23_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ23_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ24_EN0_MASK (0x1000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ24_EN0_SHIFT (24U) -/*! REQ24_EN0 - This register is used to enable and disable ADC1 FIFO B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ24_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ24_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ24_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ25_EN0_MASK (0x2000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ25_EN0_SHIFT (25U) -/*! REQ25_EN0 - This register is used to enable and disable DAC0 FIFO_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ25_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ25_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ25_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ26_EN0_MASK (0x4000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ26_EN0_SHIFT (26U) -/*! REQ26_EN0 - This register is used to enable and disable DAC1 FIFO_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ26_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ26_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ26_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ27_EN0_MASK (0x8000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ27_EN0_SHIFT (27U) -/*! REQ27_EN0 - This register is used to enable and disable DAC2 FIFO_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ27_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ27_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ27_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ28_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ28_EN0_SHIFT (28U) -/*! REQ28_EN0 - This register is used to enable and disable CMP0 DMA_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ28_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ28_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ28_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ29_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ29_EN0_SHIFT (29U) -/*! REQ29_EN0 - This register is used to enable and disable CMP1 DMA_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ29_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ29_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ29_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ30_EN0_MASK (0x40000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ30_EN0_SHIFT (30U) -/*! REQ30_EN0 - This register is used to enable and disable CMP2 DMA_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ30_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ30_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ30_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ31_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ31_EN0_SHIFT (31U) -/*! REQ31_EN0 - This register is used to enable and disable EVTG0 OUT0A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ31_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ31_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ31_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE0_SET - DMA0 Request Enable0 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ1_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ1_EN0_SHIFT (1U) -/*! REQ1_EN0 - Writing a 1 to REQ1_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ1_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ1_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ1_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ2_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ2_EN0_SHIFT (2U) -/*! REQ2_EN0 - Writing a 1 to REQ2_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ2_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ2_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ2_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ3_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ3_EN0_SHIFT (3U) -/*! REQ3_EN0 - Writing a 1 to REQ3_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ3_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ3_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ3_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ4_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ4_EN0_SHIFT (4U) -/*! REQ4_EN0 - Writing a 1 to REQ4_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ4_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ4_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ4_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ5_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ5_EN0_SHIFT (5U) -/*! REQ5_EN0 - Writing a 1 to REQ5_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ5_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ5_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ5_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ6_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ6_EN0_SHIFT (6U) -/*! REQ6_EN0 - Writing a 1 to REQ6_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ6_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ6_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ6_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ7_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ7_EN0_SHIFT (7U) -/*! REQ7_EN0 - Writing a 1 to REQ7_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ7_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ7_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ7_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ8_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ8_EN0_SHIFT (8U) -/*! REQ8_EN0 - Writing a 1 to REQ8_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ8_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ8_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ8_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ9_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ9_EN0_SHIFT (9U) -/*! REQ9_EN0 - Writing a 1 to REQ9_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ9_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ9_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ9_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ10_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ10_EN0_SHIFT (10U) -/*! REQ10_EN0 - Writing a 1 to REQ10_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ10_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ10_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ10_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ11_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ11_EN0_SHIFT (11U) -/*! REQ11_EN0 - Writing a 1 to REQ11_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ11_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ11_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ11_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ12_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ12_EN0_SHIFT (12U) -/*! REQ12_EN0 - Writing a 1 to REQ12_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ12_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ12_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ12_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ13_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ13_EN0_SHIFT (13U) -/*! REQ13_EN0 - Writing a 1 to REQ13_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ13_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ13_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ13_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ14_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ14_EN0_SHIFT (14U) -/*! REQ14_EN0 - Writing a 1 to REQ14_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ14_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ14_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ14_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ15_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ15_EN0_SHIFT (15U) -/*! REQ15_EN0 - Writing a 1 to REQ15_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ15_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ15_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ15_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ16_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ16_EN0_SHIFT (16U) -/*! REQ16_EN0 - Writing a 1 to REQ16_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ16_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ16_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ16_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ17_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ17_EN0_SHIFT (17U) -/*! REQ17_EN0 - Writing a 1 to REQ17_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ17_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ17_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ17_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ18_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ18_EN0_SHIFT (18U) -/*! REQ18_EN0 - Writing a 1 to REQ18_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ18_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ18_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ18_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ19_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ19_EN0_SHIFT (19U) -/*! REQ19_EN0 - Writing a 1 to REQ19_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ19_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ19_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ19_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ20_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ20_EN0_SHIFT (20U) -/*! REQ20_EN0 - Writing a 1 to REQ20_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ20_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ20_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ20_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ21_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ21_EN0_SHIFT (21U) -/*! REQ21_EN0 - Writing a 1 to REQ21_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ21_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ21_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ21_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ22_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ22_EN0_SHIFT (22U) -/*! REQ22_EN0 - Writing a 1 to REQ22_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ22_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ22_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ22_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ23_EN0_MASK (0x800000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ23_EN0_SHIFT (23U) -/*! REQ23_EN0 - Writing a 1 to REQ23_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ23_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ23_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ23_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ24_EN0_MASK (0x1000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ24_EN0_SHIFT (24U) -/*! REQ24_EN0 - Writing a 1 to REQ24_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ24_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ24_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ24_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ25_EN0_MASK (0x2000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ25_EN0_SHIFT (25U) -/*! REQ25_EN0 - Writing a 1 to REQ25_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ25_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ25_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ25_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ26_EN0_MASK (0x4000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ26_EN0_SHIFT (26U) -/*! REQ26_EN0 - Writing a 1 to REQ26_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ26_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ26_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ26_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ27_EN0_MASK (0x8000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ27_EN0_SHIFT (27U) -/*! REQ27_EN0 - Writing a 1 to REQ27_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ27_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ27_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ27_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ28_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ28_EN0_SHIFT (28U) -/*! REQ28_EN0 - Writing a 1 to REQ28_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ28_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ28_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ28_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ29_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ29_EN0_SHIFT (29U) -/*! REQ29_EN0 - Writing a 1 to REQ29_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ29_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ29_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ29_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ30_EN0_MASK (0x40000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ30_EN0_SHIFT (30U) -/*! REQ30_EN0 - Writing a 1 to REQ30_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ30_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ30_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ30_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ31_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ31_EN0_SHIFT (31U) -/*! REQ31_EN0 - Writing a 1 to REQ31_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ31_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ31_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ31_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE0_CLR - DMA0 Request Enable0 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ1_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ1_EN0_SHIFT (1U) -/*! REQ1_EN0 - Writing a 1 to REQ1_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ1_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ1_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ1_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ2_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ2_EN0_SHIFT (2U) -/*! REQ2_EN0 - Writing a 1 to REQ2_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ2_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ2_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ2_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ3_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ3_EN0_SHIFT (3U) -/*! REQ3_EN0 - Writing a 1 to REQ3_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ3_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ3_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ3_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ4_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ4_EN0_SHIFT (4U) -/*! REQ4_EN0 - Writing a 1 to REQ4_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ4_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ4_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ4_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ5_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ5_EN0_SHIFT (5U) -/*! REQ5_EN0 - Writing a 1 to REQ5_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ5_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ5_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ5_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ6_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ6_EN0_SHIFT (6U) -/*! REQ6_EN0 - Writing a 1 to REQ6_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ6_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ6_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ6_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ7_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ7_EN0_SHIFT (7U) -/*! REQ7_EN0 - Writing a 1 to REQ7_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ7_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ7_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ7_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ8_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ8_EN0_SHIFT (8U) -/*! REQ8_EN0 - Writing a 1 to REQ8_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ8_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ8_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ8_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ9_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ9_EN0_SHIFT (9U) -/*! REQ9_EN0 - Writing a 1 to REQ9_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ9_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ9_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ9_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ10_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ10_EN0_SHIFT (10U) -/*! REQ10_EN0 - Writing a 1 to REQ10_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ10_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ10_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ10_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ11_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ11_EN0_SHIFT (11U) -/*! REQ11_EN0 - Writing a 1 to REQ11_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ11_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ11_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ11_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ12_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ12_EN0_SHIFT (12U) -/*! REQ12_EN0 - Writing a 1 to REQ12_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ12_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ12_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ12_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ13_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ13_EN0_SHIFT (13U) -/*! REQ13_EN0 - Writing a 1 to REQ13_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ13_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ13_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ13_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ14_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ14_EN0_SHIFT (14U) -/*! REQ14_EN0 - Writing a 1 to REQ14_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ14_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ14_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ14_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ15_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ15_EN0_SHIFT (15U) -/*! REQ15_EN0 - Writing a 1 to REQ15_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ15_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ15_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ15_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ16_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ16_EN0_SHIFT (16U) -/*! REQ16_EN0 - Writing a 1 to REQ16_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ16_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ16_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ16_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ17_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ17_EN0_SHIFT (17U) -/*! REQ17_EN0 - Writing a 1 to REQ17_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ17_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ17_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ17_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ18_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ18_EN0_SHIFT (18U) -/*! REQ18_EN0 - Writing a 1 to REQ18_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ18_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ18_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ18_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ19_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ19_EN0_SHIFT (19U) -/*! REQ19_EN0 - Writing a 1 to REQ19_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ19_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ19_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ19_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ20_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ20_EN0_SHIFT (20U) -/*! REQ20_EN0 - Writing a 1 to REQ20_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ20_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ20_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ20_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ21_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ21_EN0_SHIFT (21U) -/*! REQ21_EN0 - Writing a 1 to REQ21_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ21_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ21_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ21_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ22_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ22_EN0_SHIFT (22U) -/*! REQ22_EN0 - Writing a 1 to REQ22_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ22_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ22_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ22_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ23_EN0_MASK (0x800000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ23_EN0_SHIFT (23U) -/*! REQ23_EN0 - Writing a 1 to REQ23_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ23_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ23_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ23_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ24_EN0_MASK (0x1000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ24_EN0_SHIFT (24U) -/*! REQ24_EN0 - Writing a 1 to REQ24_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ24_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ24_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ24_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ25_EN0_MASK (0x2000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ25_EN0_SHIFT (25U) -/*! REQ25_EN0 - Writing a 1 to REQ25_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ25_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ25_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ25_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ26_EN0_MASK (0x4000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ26_EN0_SHIFT (26U) -/*! REQ26_EN0 - Writing a 1 to REQ26_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ26_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ26_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ26_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ27_EN0_MASK (0x8000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ27_EN0_SHIFT (27U) -/*! REQ27_EN0 - Writing a 1 to REQ27_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ27_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ27_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ27_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ28_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ28_EN0_SHIFT (28U) -/*! REQ28_EN0 - Writing a 1 to REQ28_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ28_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ28_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ28_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ29_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ29_EN0_SHIFT (29U) -/*! REQ29_EN0 - Writing a 1 to REQ29_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ29_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ29_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ29_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ30_EN0_MASK (0x40000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ30_EN0_SHIFT (30U) -/*! REQ30_EN0 - Writing a 1 to REQ30_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ30_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ30_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ30_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ31_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ31_EN0_SHIFT (31U) -/*! REQ31_EN0 - Writing a 1 to REQ31_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ31_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ31_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ31_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE0_TOG - DMA0 Request Enable0 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ1_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ1_EN0_SHIFT (1U) -/*! REQ1_EN0 - Writing a 1 to REQ1_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ1_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ1_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ1_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ2_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ2_EN0_SHIFT (2U) -/*! REQ2_EN0 - Writing a 1 to REQ2_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ2_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ2_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ2_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ3_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ3_EN0_SHIFT (3U) -/*! REQ3_EN0 - Writing a 1 to REQ3_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ3_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ3_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ3_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ4_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ4_EN0_SHIFT (4U) -/*! REQ4_EN0 - Writing a 1 to REQ4_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ4_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ4_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ4_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ5_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ5_EN0_SHIFT (5U) -/*! REQ5_EN0 - Writing a 1 to REQ5_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ5_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ5_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ5_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ6_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ6_EN0_SHIFT (6U) -/*! REQ6_EN0 - Writing a 1 to REQ6_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ6_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ6_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ6_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ7_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ7_EN0_SHIFT (7U) -/*! REQ7_EN0 - Writing a 1 to REQ7_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ7_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ7_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ7_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ8_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ8_EN0_SHIFT (8U) -/*! REQ8_EN0 - Writing a 1 to REQ8_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ8_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ8_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ8_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ9_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ9_EN0_SHIFT (9U) -/*! REQ9_EN0 - Writing a 1 to RE9_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ9_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ9_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ9_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ10_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ10_EN0_SHIFT (10U) -/*! REQ10_EN0 - Writing a 1 to REQ10_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ10_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ10_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ10_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ11_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ11_EN0_SHIFT (11U) -/*! REQ11_EN0 - Writing a 1 to REQ11_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ11_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ11_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ11_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ12_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ12_EN0_SHIFT (12U) -/*! REQ12_EN0 - Writing a 1 to REQ12_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ12_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ12_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ12_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ13_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ13_EN0_SHIFT (13U) -/*! REQ13_EN0 - Writing a 1 to REQ13_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ13_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ13_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ13_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ14_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ14_EN0_SHIFT (14U) -/*! REQ14_EN0 - Writing a 1 to REQ14_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ14_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ14_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ14_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ15_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ15_EN0_SHIFT (15U) -/*! REQ15_EN0 - Writing a 1 to REQ15_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ15_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ15_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ15_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ16_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ16_EN0_SHIFT (16U) -/*! REQ16_EN0 - Writing a 1 to REQ16_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ16_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ16_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ16_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ17_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ17_EN0_SHIFT (17U) -/*! REQ17_EN0 - Writing a 1 to REQ17_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ17_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ17_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ17_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ18_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ18_EN0_SHIFT (18U) -/*! REQ18_EN0 - Writing a 1 to REQ18_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ18_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ18_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ18_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ19_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ19_EN0_SHIFT (19U) -/*! REQ19_EN0 - Writing a 1 to REQ19_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ19_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ19_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ19_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ20_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ20_EN0_SHIFT (20U) -/*! REQ20_EN0 - Writing a 1 to REQ20_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ20_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ20_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ20_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ21_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ21_EN0_SHIFT (21U) -/*! REQ21_EN0 - Writing a 1 to REQ21_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ21_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ21_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ21_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ22_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ22_EN0_SHIFT (22U) -/*! REQ22_EN0 - Writing a 1 to REQ22_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ22_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ22_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ22_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ23_EN0_MASK (0x800000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ23_EN0_SHIFT (23U) -/*! REQ23_EN0 - Writing a 1 to REQ23_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ23_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ23_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ23_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ24_EN0_MASK (0x1000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ24_EN0_SHIFT (24U) -/*! REQ24_EN0 - Writing a 1 to REQ24_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ24_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ24_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ24_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ25_EN0_MASK (0x2000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ25_EN0_SHIFT (25U) -/*! REQ25_EN0 - Writing a 1 to REQ25_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ25_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ25_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ25_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ26_EN0_MASK (0x4000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ26_EN0_SHIFT (26U) -/*! REQ26_EN0 - Writing a 1 to REQ26_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ26_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ26_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ26_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ27_EN0_MASK (0x8000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ27_EN0_SHIFT (27U) -/*! REQ27_EN0 - Writing a 1 to REQ27_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ27_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ27_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ27_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ28_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ28_EN0_SHIFT (28U) -/*! REQ28_EN0 - Writing a 1 to REQ28_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ28_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ28_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ28_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ29_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ29_EN0_SHIFT (29U) -/*! REQ29_EN0 - Writing a 1 to REQ29_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ29_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ29_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ29_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ30_EN0_MASK (0x40000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ30_EN0_SHIFT (30U) -/*! REQ30_EN0 - Writing a 1 to REQ30_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ30_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ30_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ30_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ31_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ31_EN0_SHIFT (31U) -/*! REQ31_EN0 - Writing a 1 to REQ31_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ31_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ31_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ31_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE1 - DMA0 Request Enable1 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ32_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ32_EN0_SHIFT (0U) -/*! REQ32_EN0 - This register is used to enable and disable EVTG0 OUT0B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ32_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ32_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ32_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ33_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ33_EN0_SHIFT (1U) -/*! REQ33_EN0 - This register is used to enable and disable EVTG0 OUT1A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ33_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ33_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ33_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ34_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ34_EN0_SHIFT (2U) -/*! REQ34_EN0 - This register is used to enable and disable EVTG0 OUT1B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ34_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ34_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ34_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ35_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ35_EN0_SHIFT (3U) -/*! REQ35_EN0 - This register is used to enable and disable EVTG0 OUT2A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ35_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ35_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ35_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ36_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ36_EN0_SHIFT (4U) -/*! REQ36_EN0 - This register is used to enable and disable EVTG0 OUT2B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ36_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ36_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ36_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ37_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ37_EN0_SHIFT (5U) -/*! REQ37_EN0 - This register is used to enable and disable EVTG0 OUT3A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ37_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ37_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ37_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ38_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ38_EN0_SHIFT (6U) -/*! REQ38_EN0 - This register is used to enable and disable EVTG0 OUT3B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ38_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ38_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ38_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ39_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ39_EN0_SHIFT (7U) -/*! REQ39_EN0 - This register is used to enable and disable PWM0 Req_capt0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ39_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ39_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ39_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ40_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ40_EN0_SHIFT (8U) -/*! REQ40_EN0 - This register is used to enable and disable PWM0 Req_capt1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ40_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ40_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ40_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ41_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ41_EN0_SHIFT (9U) -/*! REQ41_EN0 - This register is used to enable and disable PWM0 Req_capt2 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ41_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ41_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ41_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ42_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ42_EN0_SHIFT (10U) -/*! REQ42_EN0 - This register is used to enable and disable PWM0 Req_capt3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ42_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ42_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ42_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ43_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ43_EN0_SHIFT (11U) -/*! REQ43_EN0 - This register is used to enable and disable PWM0 Req_val0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ43_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ43_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ43_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ44_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ44_EN0_SHIFT (12U) -/*! REQ44_EN0 - This register is used to enable and disable PWM0 Req_val1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ44_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ44_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ44_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ45_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ45_EN0_SHIFT (13U) -/*! REQ45_EN0 - This register is used to enable and disable PWM0 Req_val2 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ45_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ45_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ45_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ46_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ46_EN0_SHIFT (14U) -/*! REQ46_EN0 - This register is used to enable and disable PWM0 Req_val3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ46_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ46_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ46_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ47_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ47_EN0_SHIFT (15U) -/*! REQ47_EN0 - This register is used to enable and disable PWM1 Req_capt0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ47_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ47_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ47_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ48_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ48_EN0_SHIFT (16U) -/*! REQ48_EN0 - This register is used to enable and disable PWM1 Req_capt1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ48_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ48_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ48_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ49_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ49_EN0_SHIFT (17U) -/*! REQ49_EN0 - This register is used to enable and disable PWM1 Req_capt2 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ49_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ49_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ49_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ50_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ50_EN0_SHIFT (18U) -/*! REQ50_EN0 - This register is used to enable and disable PWM1 Req_capt3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ50_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ50_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ50_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ51_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ51_EN0_SHIFT (19U) -/*! REQ51_EN0 - This register is used to enable and disable PWM1 Req_val0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ51_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ51_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ51_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ52_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ52_EN0_SHIFT (20U) -/*! REQ52_EN0 - This register is used to enable and disable PWM1 Req_val1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ52_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ52_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ52_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ53_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ53_EN0_SHIFT (21U) -/*! REQ53_EN0 - This register is used to enable and disable PWM1 Req_val2 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ53_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ53_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ53_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ54_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ54_EN0_SHIFT (22U) -/*! REQ54_EN0 - This register is used to enable and disable PWM1 Req_val3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ54_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ54_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ54_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ57_EN0_MASK (0x2000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ57_EN0_SHIFT (25U) -/*! REQ57_EN0 - This register is used to enable and disable LPTMR0 counter match event request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ57_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ57_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ57_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ58_EN0_MASK (0x4000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ58_EN0_SHIFT (26U) -/*! REQ58_EN0 - This register is used to enable and disable LPTMR1 counter match event request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ58_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ58_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ58_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ59_EN0_MASK (0x8000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ59_EN0_SHIFT (27U) -/*! REQ59_EN0 - This register is used to enable and disable CAN0 DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ59_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ59_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ59_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ60_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ60_EN0_SHIFT (28U) -/*! REQ60_EN0 - This register is used to enable and disable CAN1 DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ60_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ60_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ60_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ61_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ61_EN0_SHIFT (29U) -/*! REQ61_EN0 - This register is used to enable and disable FlexIO0 Shifter0 Status DMA request OR Timer0 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ61_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ61_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ61_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ62_EN0_MASK (0x40000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ62_EN0_SHIFT (30U) -/*! REQ62_EN0 - This register is used to enable and disable FlexIO0 Shifter1 Status DMA request OR Timer1 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ62_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ62_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ62_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ63_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ63_EN0_SHIFT (31U) -/*! REQ63_EN0 - This register is used to enable and disable FlexIO0 Shifter2 Status DMA request OR Timer2 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ63_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ63_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ63_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE1_SET - DMA0 Request Enable1 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ32_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ32_EN0_SHIFT (0U) -/*! REQ32_EN0 - Writing a 1 to REQ32_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ32_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ32_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ32_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ33_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ33_EN0_SHIFT (1U) -/*! REQ33_EN0 - Writing a 1 to REQ33_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ33_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ33_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ33_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ34_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ34_EN0_SHIFT (2U) -/*! REQ34_EN0 - Writing a 1 to REQ34_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ34_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ34_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ34_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ35_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ35_EN0_SHIFT (3U) -/*! REQ35_EN0 - Writing a 1 to REQ35_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ35_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ35_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ35_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ36_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ36_EN0_SHIFT (4U) -/*! REQ36_EN0 - Writing a 1 to REQ36_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ36_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ36_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ36_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ37_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ37_EN0_SHIFT (5U) -/*! REQ37_EN0 - Writing a 1 to REQ37_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ37_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ37_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ37_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ38_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ38_EN0_SHIFT (6U) -/*! REQ38_EN0 - Writing a 1 to REQ38_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ38_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ38_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ38_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ39_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ39_EN0_SHIFT (7U) -/*! REQ39_EN0 - Writing a 1 to REQ39_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ39_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ39_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ39_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ40_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ40_EN0_SHIFT (8U) -/*! REQ40_EN0 - Writing a 1 to REQ40_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ40_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ40_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ40_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ41_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ41_EN0_SHIFT (9U) -/*! REQ41_EN0 - Writing a 1 to REQ41_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ41_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ41_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ41_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ42_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ42_EN0_SHIFT (10U) -/*! REQ42_EN0 - Writing a 1 to REQ42_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ42_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ42_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ42_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ43_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ43_EN0_SHIFT (11U) -/*! REQ43_EN0 - Writing a 1 to REQ43_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ43_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ43_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ43_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ44_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ44_EN0_SHIFT (12U) -/*! REQ44_EN0 - Writing a 1 to REQ44_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ44_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ44_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ44_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ45_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ45_EN0_SHIFT (13U) -/*! REQ45_EN0 - Writing a 1 to REQ45_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ45_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ45_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ45_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ46_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ46_EN0_SHIFT (14U) -/*! REQ46_EN0 - Writing a 1 to REQ46_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ46_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ46_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ46_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ47_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ47_EN0_SHIFT (15U) -/*! REQ47_EN0 - Writing a 1 to REQ47_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ47_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ47_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ47_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ48_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ48_EN0_SHIFT (16U) -/*! REQ48_EN0 - Writing a 1 to REQ48_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ48_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ48_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ48_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ49_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ49_EN0_SHIFT (17U) -/*! REQ49_EN0 - Writing a 1 to REQ49_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ49_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ49_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ49_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ50_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ50_EN0_SHIFT (18U) -/*! REQ50_EN0 - Writing a 1 to REQ50_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ50_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ50_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ50_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ51_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ51_EN0_SHIFT (19U) -/*! REQ51_EN0 - Writing a 1 to REQ51_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ51_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ51_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ51_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ52_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ52_EN0_SHIFT (20U) -/*! REQ52_EN0 - Writing a 1 to REQ52_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ52_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ52_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ52_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ53_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ53_EN0_SHIFT (21U) -/*! REQ53_EN0 - Writing a 1 to REQ53_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ53_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ53_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ53_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ54_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ54_EN0_SHIFT (22U) -/*! REQ54_EN0 - Writing a 1 to REQ54_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ54_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ54_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ54_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ57_EN0_MASK (0x2000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ57_EN0_SHIFT (25U) -/*! REQ57_EN0 - Writing a 1 to REQ57_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ57_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ57_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ57_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ58_EN0_MASK (0x4000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ58_EN0_SHIFT (26U) -/*! REQ58_EN0 - Writing a 1 to REQ58_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ58_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ58_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ58_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ59_EN0_MASK (0x8000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ59_EN0_SHIFT (27U) -/*! REQ59_EN0 - Writing a 1 to REQ59_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ59_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ59_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ59_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ60_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ60_EN0_SHIFT (28U) -/*! REQ60_EN0 - Writing a 1 to REQ60_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ60_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ60_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ60_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ61_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ61_EN0_SHIFT (29U) -/*! REQ61_EN0 - Writing a 1 to REQ61_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ61_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ61_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ61_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ62_EN0_MASK (0x40000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ62_EN0_SHIFT (30U) -/*! REQ62_EN0 - Writing a 1 to REQ62_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ62_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ62_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ62_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ63_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ63_EN0_SHIFT (31U) -/*! REQ63_EN0 - Writing a 1 to REQ63_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ63_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ63_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ63_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE1_CLR - DMA0 Request Enable1 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ32_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ32_EN0_SHIFT (0U) -/*! REQ32_EN0 - Writing a 1 to REQ32_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ32_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ32_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ32_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ33_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ33_EN0_SHIFT (1U) -/*! REQ33_EN0 - Writing a 1 to REQ33_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ33_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ33_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ33_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ34_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ34_EN0_SHIFT (2U) -/*! REQ34_EN0 - Writing a 1 to REQ34_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ34_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ34_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ34_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ35_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ35_EN0_SHIFT (3U) -/*! REQ35_EN0 - Writing a 1 to REQ35_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ35_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ35_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ35_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ36_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ36_EN0_SHIFT (4U) -/*! REQ36_EN0 - Writing a 1 to REQ36_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ36_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ36_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ36_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ37_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ37_EN0_SHIFT (5U) -/*! REQ37_EN0 - Writing a 1 to REQ37_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ37_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ37_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ37_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ38_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ38_EN0_SHIFT (6U) -/*! REQ38_EN0 - Writing a 1 to REQ38_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ38_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ38_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ38_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ39_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ39_EN0_SHIFT (7U) -/*! REQ39_EN0 - Writing a 1 to REQ39_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ39_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ39_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ39_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ40_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ40_EN0_SHIFT (8U) -/*! REQ40_EN0 - Writing a 1 to REQ40_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ40_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ40_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ40_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ41_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ41_EN0_SHIFT (9U) -/*! REQ41_EN0 - Writing a 1 to REQ41_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ41_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ41_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ41_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ42_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ42_EN0_SHIFT (10U) -/*! REQ42_EN0 - Writing a 1 to REQ42_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ42_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ42_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ42_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ43_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ43_EN0_SHIFT (11U) -/*! REQ43_EN0 - Writing a 1 to REQ43_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ43_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ43_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ43_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ44_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ44_EN0_SHIFT (12U) -/*! REQ44_EN0 - Writing a 1 to REQ44_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ44_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ44_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ44_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ45_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ45_EN0_SHIFT (13U) -/*! REQ45_EN0 - Writing a 1 to REQ45_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ45_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ45_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ45_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ46_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ46_EN0_SHIFT (14U) -/*! REQ46_EN0 - Writing a 1 to REQ46_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ46_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ46_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ46_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ47_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ47_EN0_SHIFT (15U) -/*! REQ47_EN0 - Writing a 1 to REQ47_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ47_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ47_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ47_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ48_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ48_EN0_SHIFT (16U) -/*! REQ48_EN0 - Writing a 1 to REQ48_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ48_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ48_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ48_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ49_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ49_EN0_SHIFT (17U) -/*! REQ49_EN0 - Writing a 1 to REQ49_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ49_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ49_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ49_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ50_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ50_EN0_SHIFT (18U) -/*! REQ50_EN0 - Writing a 1 to REQ50_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ50_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ50_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ50_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ51_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ51_EN0_SHIFT (19U) -/*! REQ51_EN0 - Writing a 1 to REQ51_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ51_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ51_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ51_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ52_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ52_EN0_SHIFT (20U) -/*! REQ52_EN0 - Writing a 1 to REQ52_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ52_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ52_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ52_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ53_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ53_EN0_SHIFT (21U) -/*! REQ53_EN0 - Writing a 1 to REQ53_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ53_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ53_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ53_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ54_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ54_EN0_SHIFT (22U) -/*! REQ54_EN0 - Writing a 1 to REQ54_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ54_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ54_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ54_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ57_EN0_MASK (0x2000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ57_EN0_SHIFT (25U) -/*! REQ57_EN0 - Writing a 1 to REQ57_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ57_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ57_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ57_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ58_EN0_MASK (0x4000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ58_EN0_SHIFT (26U) -/*! REQ58_EN0 - Writing a 1 to REQ58_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ58_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ58_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ58_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ59_EN0_MASK (0x8000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ59_EN0_SHIFT (27U) -/*! REQ59_EN0 - Writing a 1 to REQ59_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ59_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ59_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ59_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ60_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ60_EN0_SHIFT (28U) -/*! REQ60_EN0 - Writing a 1 to REQ60_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ60_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ60_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ60_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ61_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ61_EN0_SHIFT (29U) -/*! REQ61_EN0 - Writing a 1 to REQ61_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ61_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ61_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ61_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ62_EN0_MASK (0x40000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ62_EN0_SHIFT (30U) -/*! REQ62_EN0 - Writing a 1 to REQ62_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ62_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ62_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ62_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ63_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ63_EN0_SHIFT (31U) -/*! REQ63_EN0 - Writing a 1 to REQ63_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ63_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ63_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ63_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE1_TOG - DMA0 Request Enable1 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ32_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ32_EN0_SHIFT (0U) -/*! REQ32_EN0 - Writing a 1 to REQ32_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ32_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ32_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ32_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ33_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ33_EN0_SHIFT (1U) -/*! REQ33_EN0 - Writing a 1 to REQ33_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ33_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ33_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ33_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ34_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ34_EN0_SHIFT (2U) -/*! REQ34_EN0 - Writing a 1 to REQ34_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ34_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ34_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ34_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ35_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ35_EN0_SHIFT (3U) -/*! REQ35_EN0 - Writing a 1 to REQ35_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ35_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ35_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ35_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ36_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ36_EN0_SHIFT (4U) -/*! REQ36_EN0 - Writing a 1 to REQ36_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ36_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ36_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ36_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ37_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ37_EN0_SHIFT (5U) -/*! REQ37_EN0 - Writing a 1 to REQ37_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ37_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ37_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ37_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ38_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ38_EN0_SHIFT (6U) -/*! REQ38_EN0 - Writing a 1 to REQ38_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ38_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ38_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ38_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ39_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ39_EN0_SHIFT (7U) -/*! REQ39_EN0 - Writing a 1 to REQ39_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ39_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ39_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ39_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ40_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ40_EN0_SHIFT (8U) -/*! REQ40_EN0 - Writing a 1 to REQ40_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ40_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ40_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ40_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ41_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ41_EN0_SHIFT (9U) -/*! REQ41_EN0 - Writing a 1 to REQ41_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ41_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ41_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ41_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ42_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ42_EN0_SHIFT (10U) -/*! REQ42_EN0 - Writing a 1 to REQ42_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ42_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ42_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ42_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ43_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ43_EN0_SHIFT (11U) -/*! REQ43_EN0 - Writing a 1 to REQ43_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ43_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ43_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ43_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ44_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ44_EN0_SHIFT (12U) -/*! REQ44_EN0 - Writing a 1 to REQ44_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ44_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ44_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ44_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ45_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ45_EN0_SHIFT (13U) -/*! REQ45_EN0 - Writing a 1 to REQ55_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ45_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ45_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ45_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ46_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ46_EN0_SHIFT (14U) -/*! REQ46_EN0 - Writing a 1 to REQ46_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ46_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ46_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ46_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ47_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ47_EN0_SHIFT (15U) -/*! REQ47_EN0 - Writing a 1 to REQ47_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ47_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ47_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ47_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ48_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ48_EN0_SHIFT (16U) -/*! REQ48_EN0 - Writing a 1 to REQ48_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ48_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ48_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ48_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ49_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ49_EN0_SHIFT (17U) -/*! REQ49_EN0 - Writing a 1 to REQ49_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ49_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ49_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ49_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ50_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ50_EN0_SHIFT (18U) -/*! REQ50_EN0 - Writing a 1 to REQ50_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ50_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ50_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ50_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ51_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ51_EN0_SHIFT (19U) -/*! REQ51_EN0 - Writing a 1 to REQ51_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ51_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ51_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ51_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ52_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ52_EN0_SHIFT (20U) -/*! REQ52_EN0 - Writing a 1 to REQ52_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ52_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ52_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ52_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ53_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ53_EN0_SHIFT (21U) -/*! REQ53_EN0 - Writing a 1 to REQ53_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ53_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ53_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ53_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ54_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ54_EN0_SHIFT (22U) -/*! REQ54_EN0 - Writing a 1 to REQ54_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ54_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ54_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ54_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ57_EN0_MASK (0x2000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ57_EN0_SHIFT (25U) -/*! REQ57_EN0 - Writing a 1 to REQ57_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ57_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ57_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ57_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ58_EN0_MASK (0x4000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ58_EN0_SHIFT (26U) -/*! REQ58_EN0 - Writing a 1 to REQ58_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ58_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ58_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ58_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ59_EN0_MASK (0x8000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ59_EN0_SHIFT (27U) -/*! REQ59_EN0 - Writing a 1 to REQ59_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ59_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ59_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ59_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ60_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ60_EN0_SHIFT (28U) -/*! REQ60_EN0 - Writing a 1 to REQ60_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ60_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ60_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ60_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ61_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ61_EN0_SHIFT (29U) -/*! REQ61_EN0 - Writing a 1 to REQ61_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ61_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ61_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ61_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ62_EN0_MASK (0x40000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ62_EN0_SHIFT (30U) -/*! REQ62_EN0 - Writing a 1 to REQ62_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ62_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ62_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ62_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ63_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ63_EN0_SHIFT (31U) -/*! REQ63_EN0 - Writing a 1 to REQ63_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ63_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ63_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ63_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE2 - DMA0 Request Enable2 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ64_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ64_EN0_SHIFT (0U) -/*! REQ64_EN0 - This register is used to enable and disable FlexIO0 shift register 3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ64_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ64_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ64_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ65_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ65_EN0_SHIFT (1U) -/*! REQ65_EN0 - This register is used to enable and disable FlexIO0 shift register 4 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ65_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ65_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ65_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ66_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ66_EN0_SHIFT (2U) -/*! REQ66_EN0 - This register is used to enable and disable FlexIO0 shift register 5 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ66_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ66_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ66_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ67_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ67_EN0_SHIFT (3U) -/*! REQ67_EN0 - This register is used to enable and disable FlexIO0 shift register 6 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ67_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ67_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ67_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ68_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ68_EN0_SHIFT (4U) -/*! REQ68_EN0 - This register is used to enable and disable FlexIO0 shift register 7 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ68_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ68_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ68_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ69_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ69_EN0_SHIFT (5U) -/*! REQ69_EN0 - This register is used to enable and disable LP_FLEXCOMM0 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ69_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ69_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ69_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ70_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ70_EN0_SHIFT (6U) -/*! REQ70_EN0 - This register is used to enable and disable LP_FLEXCOMM0 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ70_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ70_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ70_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ71_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ71_EN0_SHIFT (7U) -/*! REQ71_EN0 - This register is used to enable and disable LP_FLEXCOMM1 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ71_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ71_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ71_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ72_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ72_EN0_SHIFT (8U) -/*! REQ72_EN0 - This register is used to enable and disable LP_FLEXCOMM1 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ72_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ72_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ72_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ73_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ73_EN0_SHIFT (9U) -/*! REQ73_EN0 - This register is used to enable and disable LP_FLEXCOMM2 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ73_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ73_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ73_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ74_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ74_EN0_SHIFT (10U) -/*! REQ74_EN0 - This register is used to enable and disable LP_FLEXCOMM2 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ74_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ74_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ74_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ75_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ75_EN0_SHIFT (11U) -/*! REQ75_EN0 - This register is used to enable and disable LP_FLEXCOMM3 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ75_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ75_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ75_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ76_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ76_EN0_SHIFT (12U) -/*! REQ76_EN0 - This register is used to enable and disable LP_FLEXCOMM3 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ76_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ76_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ76_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ77_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ77_EN0_SHIFT (13U) -/*! REQ77_EN0 - This register is used to enable and disable LP_FLEXCOMM4 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ77_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ77_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ77_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ78_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ78_EN0_SHIFT (14U) -/*! REQ78_EN0 - This register is used to enable and disable LP_FLEXCOMM4 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ78_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ78_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ78_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ79_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ79_EN0_SHIFT (15U) -/*! REQ79_EN0 - This register is used to enable and disable LP_FLEXCOMM5 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ79_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ79_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ79_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ80_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ80_EN0_SHIFT (16U) -/*! REQ80_EN0 - This register is used to enable and disable LP_FLEXCOMM5 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ80_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ80_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ80_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ81_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ81_EN0_SHIFT (17U) -/*! REQ81_EN0 - This register is used to enable and disable LP_FLEXCOMM6 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ81_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ81_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ81_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ82_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ82_EN0_SHIFT (18U) -/*! REQ82_EN0 - This register is used to enable and disable LP_FLEXCOMM6 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ82_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ82_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ82_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ83_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ83_EN0_SHIFT (19U) -/*! REQ83_EN0 - This register is used to enable and disable LP_FLEXCOMM7 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ83_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ83_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ83_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ84_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ84_EN0_SHIFT (20U) -/*! REQ84_EN0 - This register is used to enable and disable LP_FLEXCOMM7 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ84_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ84_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ84_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ85_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ85_EN0_SHIFT (21U) -/*! REQ85_EN0 - This register is used to enable and disable LP_FLEXCOMM8 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ85_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ85_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ85_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ86_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ86_EN0_SHIFT (22U) -/*! REQ86_EN0 - This register is used to enable and disable LP_FLEXCOMM8 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ86_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ86_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ86_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ87_EN0_MASK (0x800000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ87_EN0_SHIFT (23U) -/*! REQ87_EN0 - This register is used to enable and disable LP_FLEXCOMM9 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ87_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ87_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ87_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ88_EN0_MASK (0x1000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ88_EN0_SHIFT (24U) -/*! REQ88_EN0 - This register is used to enable and disable LP_FLEXCOMM9 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ88_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ88_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ88_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ91_EN0_MASK (0x8000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ91_EN0_SHIFT (27U) -/*! REQ91_EN0 - This register is used to enable and disable EMVSIM0 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ91_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ91_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ91_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ92_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ92_EN0_SHIFT (28U) -/*! REQ92_EN0 - This register is used to enable and disable EMVSIM0 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ92_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ92_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ92_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ93_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ93_EN0_SHIFT (29U) -/*! REQ93_EN0 - This register is used to enable and disable EMVSIM1 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ93_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ93_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ93_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ94_EN0_MASK (0x40000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ94_EN0_SHIFT (30U) -/*! REQ94_EN0 - This register is used to enable and disable EMVSIM1 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ94_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ94_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ94_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ95_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ95_EN0_SHIFT (31U) -/*! REQ95_EN0 - This register is used to enable and disable I3C0 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ95_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ95_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ95_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE2_SET - DMA0 Request Enable2 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ64_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ64_EN0_SHIFT (0U) -/*! REQ64_EN0 - Writing a 1 to REQ64_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ64_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ64_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ64_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ65_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ65_EN0_SHIFT (1U) -/*! REQ65_EN0 - Writing a 1 to REQ65_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ65_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ65_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ65_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ66_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ66_EN0_SHIFT (2U) -/*! REQ66_EN0 - Writing a 1 to REQ66_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ66_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ66_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ66_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ67_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ67_EN0_SHIFT (3U) -/*! REQ67_EN0 - Writing a 1 to REQ67_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ67_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ67_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ67_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ68_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ68_EN0_SHIFT (4U) -/*! REQ68_EN0 - Writing a 1 to REQ68_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ68_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ68_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ68_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ69_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ69_EN0_SHIFT (5U) -/*! REQ69_EN0 - Writing a 1 to REQ69_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ69_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ69_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ69_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ70_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ70_EN0_SHIFT (6U) -/*! REQ70_EN0 - Writing a 1 to REQ70_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ70_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ70_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ70_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ71_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ71_EN0_SHIFT (7U) -/*! REQ71_EN0 - Writing a 1 to REQ71_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ71_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ71_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ71_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ72_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ72_EN0_SHIFT (8U) -/*! REQ72_EN0 - Writing a 1 to REQ72_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ72_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ72_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ72_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ73_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ73_EN0_SHIFT (9U) -/*! REQ73_EN0 - Writing a 1 to REQ73_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ73_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ73_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ73_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ74_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ74_EN0_SHIFT (10U) -/*! REQ74_EN0 - Writing a 1 to REQ74_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ74_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ74_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ74_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ75_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ75_EN0_SHIFT (11U) -/*! REQ75_EN0 - Writing a 1 to REQ75_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ75_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ75_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ75_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ76_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ76_EN0_SHIFT (12U) -/*! REQ76_EN0 - Writing a 1 to REQ876_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ76_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ76_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ76_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ77_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ77_EN0_SHIFT (13U) -/*! REQ77_EN0 - Writing a 1 to REQ77_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ77_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ77_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ77_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ78_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ78_EN0_SHIFT (14U) -/*! REQ78_EN0 - Writing a 1 to REQ78_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ78_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ78_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ78_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ79_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ79_EN0_SHIFT (15U) -/*! REQ79_EN0 - Writing a 1 to REQ79_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ79_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ79_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ79_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ80_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ80_EN0_SHIFT (16U) -/*! REQ80_EN0 - Writing a 1 to REQ80_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ80_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ80_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ80_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ81_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ81_EN0_SHIFT (17U) -/*! REQ81_EN0 - Writing a 1 to REQ81_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ81_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ81_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ81_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ82_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ82_EN0_SHIFT (18U) -/*! REQ82_EN0 - Writing a 1 to REQ82_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ82_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ82_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ82_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ83_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ83_EN0_SHIFT (19U) -/*! REQ83_EN0 - Writing a 1 to REQ83_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ83_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ83_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ83_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ84_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ84_EN0_SHIFT (20U) -/*! REQ84_EN0 - Writing a 1 to REQ84_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ84_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ84_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ84_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ85_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ85_EN0_SHIFT (21U) -/*! REQ85_EN0 - Writing a 1 to REQ85_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ85_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ85_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ85_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ86_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ86_EN0_SHIFT (22U) -/*! REQ86_EN0 - Writing a 1 to REQ86_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ86_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ86_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ86_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ87_EN0_MASK (0x800000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ87_EN0_SHIFT (23U) -/*! REQ87_EN0 - Writing a 1 to REQ87_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ87_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ87_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ87_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ88_EN0_MASK (0x1000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ88_EN0_SHIFT (24U) -/*! REQ88_EN0 - Writing a 1 to REQ88_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ88_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ88_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ88_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ91_EN0_MASK (0x8000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ91_EN0_SHIFT (27U) -/*! REQ91_EN0 - Writing a 1 to REQ91_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ91_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ91_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ91_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ92_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ92_EN0_SHIFT (28U) -/*! REQ92_EN0 - Writing a 1 to REQ92_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ92_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ92_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ92_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ93_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ93_EN0_SHIFT (29U) -/*! REQ93_EN0 - Writing a 1 to REQ93_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ93_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ93_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ93_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ94_EN0_MASK (0x40000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ94_EN0_SHIFT (30U) -/*! REQ94_EN0 - Writing a 1 to REQ94_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ94_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ94_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ94_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ95_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ95_EN0_SHIFT (31U) -/*! REQ95_EN0 - Writing a 1 to REQ95_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ95_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ95_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ95_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE2_CLR - DMA0 Request Enable2 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ64_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ64_EN0_SHIFT (0U) -/*! REQ64_EN0 - Writing a 1 to REQ64_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ64_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ64_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ64_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ65_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ65_EN0_SHIFT (1U) -/*! REQ65_EN0 - Writing a 1 to REQ65_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ65_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ65_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ65_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ66_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ66_EN0_SHIFT (2U) -/*! REQ66_EN0 - Writing a 1 to REQ66_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ66_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ66_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ66_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ67_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ67_EN0_SHIFT (3U) -/*! REQ67_EN0 - Writing a 1 to REQ67_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ67_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ67_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ67_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ68_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ68_EN0_SHIFT (4U) -/*! REQ68_EN0 - Writing a 1 to REQ68_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ68_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ68_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ68_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ69_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ69_EN0_SHIFT (5U) -/*! REQ69_EN0 - Writing a 1 to REQ69_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ69_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ69_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ69_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ70_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ70_EN0_SHIFT (6U) -/*! REQ70_EN0 - Writing a 1 to REQ70_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ70_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ70_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ70_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ71_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ71_EN0_SHIFT (7U) -/*! REQ71_EN0 - Writing a 1 to REQ71_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ71_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ71_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ71_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ72_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ72_EN0_SHIFT (8U) -/*! REQ72_EN0 - Writing a 1 to REQ72_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ72_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ72_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ72_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ73_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ73_EN0_SHIFT (9U) -/*! REQ73_EN0 - Writing a 1 to REQ73_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ73_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ73_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ73_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ74_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ74_EN0_SHIFT (10U) -/*! REQ74_EN0 - Writing a 1 to REQ74_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ74_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ74_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ74_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ75_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ75_EN0_SHIFT (11U) -/*! REQ75_EN0 - Writing a 1 to REQ75_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ75_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ75_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ75_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ76_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ76_EN0_SHIFT (12U) -/*! REQ76_EN0 - Writing a 1 to REQ76_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ76_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ76_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ76_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ77_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ77_EN0_SHIFT (13U) -/*! REQ77_EN0 - Writing a 1 to REQ77_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ77_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ77_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ77_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ78_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ78_EN0_SHIFT (14U) -/*! REQ78_EN0 - Writing a 1 to REQ78_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ78_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ78_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ78_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ79_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ79_EN0_SHIFT (15U) -/*! REQ79_EN0 - Writing a 1 to REQ79_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ79_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ79_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ79_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ80_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ80_EN0_SHIFT (16U) -/*! REQ80_EN0 - Writing a 1 to REQ80_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ80_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ80_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ80_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ81_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ81_EN0_SHIFT (17U) -/*! REQ81_EN0 - Writing a 1 to REQ81_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ81_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ81_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ81_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ82_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ82_EN0_SHIFT (18U) -/*! REQ82_EN0 - Writing a 1 to REQ82_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ82_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ82_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ82_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ83_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ83_EN0_SHIFT (19U) -/*! REQ83_EN0 - Writing a 1 to REQ83_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ83_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ83_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ83_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ84_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ84_EN0_SHIFT (20U) -/*! REQ84_EN0 - Writing a 1 to REQ84_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ84_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ84_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ84_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ85_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ85_EN0_SHIFT (21U) -/*! REQ85_EN0 - Writing a 1 to REQ85_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ85_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ85_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ85_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ86_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ86_EN0_SHIFT (22U) -/*! REQ86_EN0 - Writing a 1 to REQ86_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ86_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ86_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ86_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ87_EN0_MASK (0x800000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ87_EN0_SHIFT (23U) -/*! REQ87_EN0 - Writing a 1 to REQ87_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ87_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ87_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ87_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ88_EN0_MASK (0x1000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ88_EN0_SHIFT (24U) -/*! REQ88_EN0 - Writing a 1 to REQ88_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ88_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ88_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ88_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ91_EN0_MASK (0x8000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ91_EN0_SHIFT (27U) -/*! REQ91_EN0 - Writing a 1 to REQ91_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ91_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ91_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ91_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ92_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ92_EN0_SHIFT (28U) -/*! REQ92_EN0 - Writing a 1 to REQ92_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ92_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ92_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ92_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ93_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ93_EN0_SHIFT (29U) -/*! REQ93_EN0 - Writing a 1 to REQ93_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ93_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ93_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ93_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ94_EN0_MASK (0x40000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ94_EN0_SHIFT (30U) -/*! REQ94_EN0 - Writing a 1 to REQ94_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ94_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ94_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ94_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ95_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ95_EN0_SHIFT (31U) -/*! REQ95_EN0 - Writing a 1 to REQ95_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ95_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ95_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ95_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE2_TOG - DMA0 Request Enable2 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ64_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ64_EN0_SHIFT (0U) -/*! REQ64_EN0 - Writing a 1 to REQ64_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ64_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ64_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ64_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ65_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ65_EN0_SHIFT (1U) -/*! REQ65_EN0 - Writing a 1 to REQ65_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ65_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ65_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ65_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ66_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ66_EN0_SHIFT (2U) -/*! REQ66_EN0 - Writing a 1 to REQ66_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ66_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ66_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ66_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ67_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ67_EN0_SHIFT (3U) -/*! REQ67_EN0 - Writing a 1 to REQ67_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ67_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ67_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ67_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ68_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ68_EN0_SHIFT (4U) -/*! REQ68_EN0 - Writing a 1 to REQ68_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ68_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ68_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ68_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ69_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ69_EN0_SHIFT (5U) -/*! REQ69_EN0 - Writing a 1 to REQ69_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ69_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ69_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ69_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ70_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ70_EN0_SHIFT (6U) -/*! REQ70_EN0 - Writing a 1 to REQ70_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ70_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ70_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ70_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ71_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ71_EN0_SHIFT (7U) -/*! REQ71_EN0 - Writing a 1 to REQ71_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ71_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ71_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ71_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ72_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ72_EN0_SHIFT (8U) -/*! REQ72_EN0 - Writing a 1 to REQ72_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ72_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ72_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ72_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ73_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ73_EN0_SHIFT (9U) -/*! REQ73_EN0 - Writing a 1 to REQ73_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ73_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ73_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ73_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ74_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ74_EN0_SHIFT (10U) -/*! REQ74_EN0 - Writing a 1 to REQ74_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ74_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ74_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ74_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ75_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ75_EN0_SHIFT (11U) -/*! REQ75_EN0 - Writing a 1 to REQ75_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ75_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ75_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ75_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ76_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ76_EN0_SHIFT (12U) -/*! REQ76_EN0 - Writing a 1 to REQ76_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ76_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ76_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ76_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ77_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ77_EN0_SHIFT (13U) -/*! REQ77_EN0 - Writing a 1 to REQ77_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ77_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ77_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ77_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ78_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ78_EN0_SHIFT (14U) -/*! REQ78_EN0 - Writing a 1 to REQ78_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ78_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ78_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ78_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ79_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ79_EN0_SHIFT (15U) -/*! REQ79_EN0 - Writing a 1 to REQ79_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ79_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ79_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ79_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ80_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ80_EN0_SHIFT (16U) -/*! REQ80_EN0 - Writing a 1 to REQ80_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ80_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ80_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ80_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ81_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ81_EN0_SHIFT (17U) -/*! REQ81_EN0 - Writing a 1 to REQ81_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ81_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ81_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ81_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ82_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ82_EN0_SHIFT (18U) -/*! REQ82_EN0 - Writing a 1 to REQ82_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ82_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ82_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ82_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ83_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ83_EN0_SHIFT (19U) -/*! REQ83_EN0 - Writing a 1 to REQ83_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ83_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ83_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ83_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ84_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ84_EN0_SHIFT (20U) -/*! REQ84_EN0 - Writing a 1 to REQ84_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ84_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ84_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ84_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ85_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ85_EN0_SHIFT (21U) -/*! REQ85_EN0 - Writing a 1 to REQ85_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ85_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ85_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ85_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ86_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ86_EN0_SHIFT (22U) -/*! REQ86_EN0 - Writing a 1 to REQ86_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ86_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ86_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ86_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ87_EN0_MASK (0x800000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ87_EN0_SHIFT (23U) -/*! REQ87_EN0 - Writing a 1 to REQ87_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ87_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ87_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ87_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ88_EN0_MASK (0x1000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ88_EN0_SHIFT (24U) -/*! REQ88_EN0 - Writing a 1 to REQ88_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ88_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ88_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ88_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ91_EN0_MASK (0x8000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ91_EN0_SHIFT (27U) -/*! REQ91_EN0 - Writing a 1 to REQ91_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ91_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ91_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ91_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ92_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ92_EN0_SHIFT (28U) -/*! REQ92_EN0 - Writing a 1 to REQ92_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ92_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ92_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ92_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ93_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ93_EN0_SHIFT (29U) -/*! REQ93_EN0 - Writing a 1 to REQ93_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ93_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ93_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ93_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ94_EN0_MASK (0x40000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ94_EN0_SHIFT (30U) -/*! REQ94_EN0 - Writing a 1 to REQ94_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ94_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ94_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ94_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ95_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ95_EN0_SHIFT (31U) -/*! REQ95_EN0 - Writing a 1 to REQ95_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ95_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ95_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ95_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE3 - DMA0 Request Enable3 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ96_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ96_EN0_SHIFT (0U) -/*! REQ96_EN0 - This register is used to enable and disable I3C0 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ96_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ96_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ96_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ97_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ97_EN0_SHIFT (1U) -/*! REQ97_EN0 - This register is used to enable and disable I3C1 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ97_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ97_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ97_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ98_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ98_EN0_SHIFT (2U) -/*! REQ98_EN0 - This register is used to enable and disable I3C1 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ98_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ98_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ98_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ99_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ99_EN0_SHIFT (3U) -/*! REQ99_EN0 - This register is used to enable and disable SAI0 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ99_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ99_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ99_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ100_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ100_EN0_SHIFT (4U) -/*! REQ100_EN0 - This register is used to enable and disable SAI0 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ100_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ100_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ100_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ101_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ101_EN0_SHIFT (5U) -/*! REQ101_EN0 - This register is used to enable and disable SAI1 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ101_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ101_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ101_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ102_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ102_EN0_SHIFT (6U) -/*! REQ102_EN0 - This register is used to enable and disable SAI1 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ102_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ102_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ102_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ103_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ103_EN0_SHIFT (7U) -/*! REQ103_EN0 - This register is used to enable and disable SINC0 ipd_req_sinc[0] or ipd_req_alt [0] request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ103_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ103_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ103_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ104_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ104_EN0_SHIFT (8U) -/*! REQ104_EN0 - This register is used to enable and disable SINC0 ipd_req_sinc[1] or ipd_req_alt [1] request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ104_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ104_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ104_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ105_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ105_EN0_SHIFT (9U) -/*! REQ105_EN0 - This register is used to enable and disable SINC0 ipd_req_sinc[2] or ipd_req_alt [2] request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ105_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ105_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ105_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ106_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ106_EN0_SHIFT (10U) -/*! REQ106_EN0 - This register is used to enable and disable SINC0 ipd_req_sinc[3] or ipd_req_alt [3] request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ106_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ106_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ106_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ107_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ107_EN0_SHIFT (11U) -/*! REQ107_EN0 - This register is used to enable and disable SINC0 ipd_req_sinc[4] or ipd_req_alt [4] request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ107_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ107_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ107_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ108_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ108_EN0_SHIFT (12U) -/*! REQ108_EN0 - This register is used to enable and disable GPIO0 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ108_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ108_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ108_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ109_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ109_EN0_SHIFT (13U) -/*! REQ109_EN0 - This register is used to enable and disable GPIO0 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ109_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ109_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ109_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ110_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ110_EN0_SHIFT (14U) -/*! REQ110_EN0 - This register is used to enable and disable GPIO1 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ110_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ110_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ110_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ111_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ111_EN0_SHIFT (15U) -/*! REQ111_EN0 - This register is used to enable and disable GPIO1 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ111_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ111_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ111_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ112_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ112_EN0_SHIFT (16U) -/*! REQ112_EN0 - This register is used to enable and disable GPIO2 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ112_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ112_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ112_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ113_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ113_EN0_SHIFT (17U) -/*! REQ113_EN0 - This register is used to enable and disable GPIO2 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ113_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ113_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ113_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ114_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ114_EN0_SHIFT (18U) -/*! REQ114_EN0 - This register is used to enable and disable GPIO3 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ114_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ114_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ114_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ115_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ115_EN0_SHIFT (19U) -/*! REQ115_EN0 - This register is used to enable and disable GPIO3 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ115_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ115_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ115_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ116_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ116_EN0_SHIFT (20U) -/*! REQ116_EN0 - This register is used to enable and disable GPIO4 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ116_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ116_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ116_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ117_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ117_EN0_SHIFT (21U) -/*! REQ117_EN0 - This register is used to enable and disable GPIO4 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ117_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ117_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ117_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ118_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ118_EN0_SHIFT (22U) -/*! REQ118_EN0 - This register is used to enable and disable GPIO5 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ118_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ118_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ118_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ119_EN0_MASK (0x800000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ119_EN0_SHIFT (23U) -/*! REQ119_EN0 - This register is used to enable and disable GPIO5 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ119_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ119_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ119_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ120_EN0_MASK (0x1000000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ120_EN0_SHIFT (24U) -/*! REQ120_EN0 - This register is used to enable and disable TSI0 end of scan request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ120_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ120_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ120_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ121_EN0_MASK (0x2000000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ121_EN0_SHIFT (25U) -/*! REQ121_EN0 - This register is used to enable and disable TSI0 out of range request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ121_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ121_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ121_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE3_SET - DMA0 Request Enable3 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ96_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ96_EN0_SHIFT (0U) -/*! REQ96_EN0 - Writing a 1 to REQ96_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ96_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ96_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ96_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ97_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ97_EN0_SHIFT (1U) -/*! REQ97_EN0 - Writing a 1 to REQ97_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ97_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ97_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ97_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ98_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ98_EN0_SHIFT (2U) -/*! REQ98_EN0 - Writing a 1 to REQ98_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ98_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ98_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ98_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ99_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ99_EN0_SHIFT (3U) -/*! REQ99_EN0 - Writing a 1 to REQ99_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ99_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ99_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ99_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ100_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ100_EN0_SHIFT (4U) -/*! REQ100_EN0 - Writing a 1 to REQ100_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ100_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ100_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ100_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ101_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ101_EN0_SHIFT (5U) -/*! REQ101_EN0 - Writing a 1 to REQ101_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ101_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ101_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ101_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ102_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ102_EN0_SHIFT (6U) -/*! REQ102_EN0 - Writing a 1 to REQ102_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ102_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ102_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ102_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ103_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ103_EN0_SHIFT (7U) -/*! REQ103_EN0 - Writing a 1 to REQ103_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ103_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ103_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ103_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ104_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ104_EN0_SHIFT (8U) -/*! REQ104_EN0 - Writing a 1 to REQ104_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ104_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ104_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ104_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ105_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ105_EN0_SHIFT (9U) -/*! REQ105_EN0 - Writing a 1 to REQ105_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ105_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ105_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ105_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ106_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ106_EN0_SHIFT (10U) -/*! REQ106_EN0 - Writing a 1 to REQ106_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ106_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ106_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ106_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ107_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ107_EN0_SHIFT (11U) -/*! REQ107_EN0 - Writing a 1 to REQ107_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ107_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ107_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ107_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ108_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ108_EN0_SHIFT (12U) -/*! REQ108_EN0 - Writing a 1 to REQ108_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ108_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ108_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ108_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ109_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ109_EN0_SHIFT (13U) -/*! REQ109_EN0 - Writing a 1 to REQ109_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ109_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ109_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ109_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ110_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ110_EN0_SHIFT (14U) -/*! REQ110_EN0 - Writing a 1 to REQ110_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ110_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ110_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ110_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ111_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ111_EN0_SHIFT (15U) -/*! REQ111_EN0 - Writing a 1 to REQ111_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ111_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ111_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ111_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ112_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ112_EN0_SHIFT (16U) -/*! REQ112_EN0 - Writing a 1 to REQ112_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ112_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ112_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ112_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ113_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ113_EN0_SHIFT (17U) -/*! REQ113_EN0 - Writing a 1 to REQ113_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ113_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ113_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ113_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ114_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ114_EN0_SHIFT (18U) -/*! REQ114_EN0 - Writing a 1 to REQ114_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ114_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ114_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ114_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ115_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ115_EN0_SHIFT (19U) -/*! REQ115_EN0 - Writing a 1 to REQ115_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ115_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ115_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ115_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ116_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ116_EN0_SHIFT (20U) -/*! REQ116_EN0 - Writing a 1 to REQ116_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ116_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ116_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ116_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ117_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ117_EN0_SHIFT (21U) -/*! REQ117_EN0 - Writing a 1 to REQ117_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ117_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ117_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ117_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ118_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ118_EN0_SHIFT (22U) -/*! REQ118_EN0 - Writing a 1 to REQ118_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ118_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ118_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ118_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ119_EN0_MASK (0x800000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ119_EN0_SHIFT (23U) -/*! REQ119_EN0 - Writing a 1 to REQ119_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ119_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ119_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ119_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ120_EN0_MASK (0x1000000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ120_EN0_SHIFT (24U) -/*! REQ120_EN0 - Writing a 1 to REQ120_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ120_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ120_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ120_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ121_EN0_MASK (0x2000000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ121_EN0_SHIFT (25U) -/*! REQ121_EN0 - Writing a 1 to REQ121_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ121_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ121_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ121_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE3_CLR - DMA0 Request Enable3 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ96_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ96_EN0_SHIFT (0U) -/*! REQ96_EN0 - Writing a 1 to REQ96_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ96_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ96_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ96_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ97_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ97_EN0_SHIFT (1U) -/*! REQ97_EN0 - Writing a 1 to REQ97_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ97_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ97_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ97_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ98_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ98_EN0_SHIFT (2U) -/*! REQ98_EN0 - Writing a 1 to REQ98_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ98_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ98_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ98_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ99_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ99_EN0_SHIFT (3U) -/*! REQ99_EN0 - Writing a 1 to REQ99_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ99_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ99_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ99_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ100_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ100_EN0_SHIFT (4U) -/*! REQ100_EN0 - Writing a 1 to REQ100_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ100_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ100_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ100_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ101_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ101_EN0_SHIFT (5U) -/*! REQ101_EN0 - Writing a 1 to REQ101_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ101_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ101_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ101_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ102_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ102_EN0_SHIFT (6U) -/*! REQ102_EN0 - Writing a 1 to REQ102_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ102_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ102_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ102_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ103_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ103_EN0_SHIFT (7U) -/*! REQ103_EN0 - Writing a 1 to REQ103_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ103_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ103_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ103_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ104_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ104_EN0_SHIFT (8U) -/*! REQ104_EN0 - Writing a 1 to REQ104_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ104_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ104_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ104_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ105_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ105_EN0_SHIFT (9U) -/*! REQ105_EN0 - Writing a 1 to REQ105_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ105_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ105_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ105_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ106_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ106_EN0_SHIFT (10U) -/*! REQ106_EN0 - Writing a 1 to REQ106_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ106_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ106_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ106_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ107_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ107_EN0_SHIFT (11U) -/*! REQ107_EN0 - Writing a 1 to REQ107_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ107_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ107_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ107_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ108_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ108_EN0_SHIFT (12U) -/*! REQ108_EN0 - Writing a 1 to REQ108_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ108_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ108_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ108_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ109_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ109_EN0_SHIFT (13U) -/*! REQ109_EN0 - Writing a 1 to REQ109_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ109_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ109_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ109_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ110_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ110_EN0_SHIFT (14U) -/*! REQ110_EN0 - Writing a 1 to REQ110_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ110_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ110_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ110_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ111_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ111_EN0_SHIFT (15U) -/*! REQ111_EN0 - Writing a 1 to REQ111_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ111_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ111_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ111_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ112_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ112_EN0_SHIFT (16U) -/*! REQ112_EN0 - Writing a 1 to REQ112_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ112_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ112_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ112_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ113_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ113_EN0_SHIFT (17U) -/*! REQ113_EN0 - Writing a 1 to REQ113_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ113_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ113_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ113_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ114_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ114_EN0_SHIFT (18U) -/*! REQ114_EN0 - Writing a 1 to REQ114_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ114_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ114_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ114_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ115_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ115_EN0_SHIFT (19U) -/*! REQ115_EN0 - Writing a 1 to REQ115_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ115_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ115_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ115_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ116_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ116_EN0_SHIFT (20U) -/*! REQ116_EN0 - Writing a 1 to REQ116_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ116_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ116_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ116_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ117_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ117_EN0_SHIFT (21U) -/*! REQ117_EN0 - Writing a 1 to REQ117_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ117_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ117_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ117_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ118_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ118_EN0_SHIFT (22U) -/*! REQ118_EN0 - Writing a 1 to REQ118_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ118_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ118_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ118_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ119_EN0_MASK (0x800000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ119_EN0_SHIFT (23U) -/*! REQ119_EN0 - Writing a 1 to REQ119_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ119_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ119_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ119_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ120_EN0_MASK (0x1000000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ120_EN0_SHIFT (24U) -/*! REQ120_EN0 - Writing a 1 to REQ120_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ120_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ120_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ120_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ121_EN0_MASK (0x2000000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ121_EN0_SHIFT (25U) -/*! REQ121_EN0 - Writing a 1 to REQ121_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ121_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ121_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ121_EN0_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE0 - DMA1 Request Enable0 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ1_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ1_EN1_SHIFT (1U) -/*! REQ1_EN1 - This register is used to enable and disable FLEXSPI0 receive event request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ1_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ1_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ1_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ2_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ2_EN1_SHIFT (2U) -/*! REQ2_EN1 - This register is used to enable and disable FLEXSPI0 transmit event request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ2_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ2_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ2_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ3_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ3_EN1_SHIFT (3U) -/*! REQ3_EN1 - This register is used to enable and disable PINT0 INT0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ3_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ3_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ3_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ4_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ4_EN1_SHIFT (4U) -/*! REQ4_EN1 - This register is used to enable and disable PINT0 INT1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ4_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ4_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ4_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ5_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ5_EN1_SHIFT (5U) -/*! REQ5_EN1 - This register is used to enable and disable PINT0 INT2 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ5_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ5_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ5_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ6_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ6_EN1_SHIFT (6U) -/*! REQ6_EN1 - This register is used to enable and disable PINT0 INT3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ6_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ6_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ6_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ7_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ7_EN1_SHIFT (7U) -/*! REQ7_EN1 - This register is used to enable and disable CTIMER0 DMAREQ_M0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ7_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ7_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ7_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ8_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ8_EN1_SHIFT (8U) -/*! REQ8_EN1 - This register is used to enable and disable CTIMER0 DMAREQ_M1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ8_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ8_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ8_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ9_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ9_EN1_SHIFT (9U) -/*! REQ9_EN1 - This register is used to enable and disable CTIMER1 DMAREQ_M0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ9_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ9_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ9_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ10_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ10_EN1_SHIFT (10U) -/*! REQ10_EN1 - This register is used to enable and disable CTIMER1 DMAREQ_M1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ10_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ10_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ10_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ11_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ11_EN1_SHIFT (11U) -/*! REQ11_EN1 - This register is used to enable and disable CTIMER2 DMAREQ_M0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ11_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ11_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ11_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ12_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ12_EN1_SHIFT (12U) -/*! REQ12_EN1 - This register is used to enable and disable CTIMER2 DMAREQ_M1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ12_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ12_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ12_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ13_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ13_EN1_SHIFT (13U) -/*! REQ13_EN1 - This register is used to enable and disable CTIMER3 DMAREQ_M0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ13_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ13_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ13_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ14_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ14_EN1_SHIFT (14U) -/*! REQ14_EN1 - This register is used to enable and disable CTIMER3 DMAREQ_M1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ14_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ14_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ14_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ15_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ15_EN1_SHIFT (15U) -/*! REQ15_EN1 - This register is used to enable and disable CTIMER4 DMAREQ_M0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ15_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ15_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ15_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ16_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ16_EN1_SHIFT (16U) -/*! REQ16_EN1 - This register is used to enable and disable CTIMER4 DMAREQ_M1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ16_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ16_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ16_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ17_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ17_EN1_SHIFT (17U) -/*! REQ17_EN1 - This register is used to enable and disable WUU0 wake up event request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ17_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ17_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ17_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ18_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ18_EN1_SHIFT (18U) -/*! REQ18_EN1 - This register is used to enable and disable MICFIL0 FIFO_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ18_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ18_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ18_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ19_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ19_EN1_SHIFT (19U) -/*! REQ19_EN1 - This register is used to enable and disable SCT0 DMA0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ19_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ19_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ19_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ20_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ20_EN1_SHIFT (20U) -/*! REQ20_EN1 - This register is used to enable and disable SCT0 DMA1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ20_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ20_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ20_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ21_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ21_EN1_SHIFT (21U) -/*! REQ21_EN1 - This register is used to enable and disable ADC0 FIFO A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ21_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ21_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ21_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ22_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ22_EN1_SHIFT (22U) -/*! REQ22_EN1 - This register is used to enable and disable ADC0 FIFO B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ22_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ22_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ22_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ23_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ23_EN1_SHIFT (23U) -/*! REQ23_EN1 - This register is used to enable and disable ADC1 FIFO A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ23_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ23_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ23_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ24_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ24_EN1_SHIFT (24U) -/*! REQ24_EN1 - This register is used to enable and disable ADC1 FIFO B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ24_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ24_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ24_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ25_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ25_EN1_SHIFT (25U) -/*! REQ25_EN1 - This register is used to enable and disable DAC0 FIFO_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ25_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ25_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ25_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ26_EN1_MASK (0x4000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ26_EN1_SHIFT (26U) -/*! REQ26_EN1 - This register is used to enable and disable DAC1 FIFO_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ26_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ26_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ26_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ27_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ27_EN1_SHIFT (27U) -/*! REQ27_EN1 - This register is used to enable and disable DAC2 FIFO_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ27_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ27_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ27_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ28_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ28_EN1_SHIFT (28U) -/*! REQ28_EN1 - This register is used to enable and disable CMP0 DMA_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ28_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ28_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ28_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ29_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ29_EN1_SHIFT (29U) -/*! REQ29_EN1 - This register is used to enable and disable CMP1 DMA_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ29_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ29_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ29_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ30_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ30_EN1_SHIFT (30U) -/*! REQ30_EN1 - This register is used to enable and disable CMP2 DMA_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ30_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ30_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ30_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ31_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ31_EN1_SHIFT (31U) -/*! REQ31_EN1 - This register is used to enable and disable EVTG0 OUT0A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ31_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ31_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ31_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE0_SET - DMA1 Request Enable0 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ1_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ1_EN1_SHIFT (1U) -/*! REQ1_EN1 - Writing a 1 to REQ1_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ1_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ1_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ1_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ2_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ2_EN1_SHIFT (2U) -/*! REQ2_EN1 - Writing a 1 to REQ2_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ2_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ2_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ2_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ3_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ3_EN1_SHIFT (3U) -/*! REQ3_EN1 - Writing a 1 to REQ3_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ3_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ3_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ3_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ4_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ4_EN1_SHIFT (4U) -/*! REQ4_EN1 - Writing a 1 to REQ4_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ4_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ4_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ4_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ5_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ5_EN1_SHIFT (5U) -/*! REQ5_EN1 - Writing a 1 to REQ5_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ5_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ5_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ5_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ6_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ6_EN1_SHIFT (6U) -/*! REQ6_EN1 - Writing a 1 to REQ6_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ6_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ6_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ6_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ7_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ7_EN1_SHIFT (7U) -/*! REQ7_EN1 - Writing a 1 to REQ7_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ7_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ7_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ7_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ8_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ8_EN1_SHIFT (8U) -/*! REQ8_EN1 - Writing a 1 to REQ8_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ8_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ8_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ8_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ9_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ9_EN1_SHIFT (9U) -/*! REQ9_EN1 - Writing a 1 to REQ9_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ9_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ9_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ9_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ10_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ10_EN1_SHIFT (10U) -/*! REQ10_EN1 - Writing a 1 to REQ10_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ10_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ10_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ10_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ11_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ11_EN1_SHIFT (11U) -/*! REQ11_EN1 - Writing a 1 to REQ11_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ11_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ11_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ11_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ12_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ12_EN1_SHIFT (12U) -/*! REQ12_EN1 - Writing a 1 to REQ12_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ12_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ12_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ12_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ13_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ13_EN1_SHIFT (13U) -/*! REQ13_EN1 - Writing a 1 to REQ13_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ13_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ13_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ13_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ14_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ14_EN1_SHIFT (14U) -/*! REQ14_EN1 - Writing a 1 to REQ14_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ14_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ14_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ14_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ15_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ15_EN1_SHIFT (15U) -/*! REQ15_EN1 - Writing a 1 to REQ15_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ15_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ15_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ15_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ16_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ16_EN1_SHIFT (16U) -/*! REQ16_EN1 - Writing a 1 to REQ16_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ16_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ16_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ16_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ17_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ17_EN1_SHIFT (17U) -/*! REQ17_EN1 - Writing a 1 to REQ17_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ17_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ17_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ17_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ18_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ18_EN1_SHIFT (18U) -/*! REQ18_EN1 - Writing a 1 to REQ18_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ18_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ18_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ18_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ19_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ19_EN1_SHIFT (19U) -/*! REQ19_EN1 - Writing a 1 to REQ19_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ19_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ19_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ19_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ20_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ20_EN1_SHIFT (20U) -/*! REQ20_EN1 - Writing a 1 to REQ20_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ20_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ20_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ20_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ21_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ21_EN1_SHIFT (21U) -/*! REQ21_EN1 - Writing a 1 to REQ21_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ21_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ21_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ21_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ22_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ22_EN1_SHIFT (22U) -/*! REQ22_EN1 - Writing a 1 to REQ22_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ22_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ22_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ22_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ23_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ23_EN1_SHIFT (23U) -/*! REQ23_EN1 - Writing a 1 to REQ23_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ23_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ23_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ23_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ24_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ24_EN1_SHIFT (24U) -/*! REQ24_EN1 - Writing a 1 to REQ24_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ24_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ24_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ24_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ25_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ25_EN1_SHIFT (25U) -/*! REQ25_EN1 - Writing a 1 to REQ25_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ25_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ25_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ25_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ26_EN1_MASK (0x4000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ26_EN1_SHIFT (26U) -/*! REQ26_EN1 - Writing a 1 to REQ26_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ26_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ26_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ26_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ27_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ27_EN1_SHIFT (27U) -/*! REQ27_EN1 - Writing a 1 to REQ27_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ27_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ27_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ27_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ28_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ28_EN1_SHIFT (28U) -/*! REQ28_EN1 - Writing a 1 to REQ28_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ28_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ28_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ28_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ29_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ29_EN1_SHIFT (29U) -/*! REQ29_EN1 - Writing a 1 to REQ29_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ29_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ29_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ29_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ30_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ30_EN1_SHIFT (30U) -/*! REQ30_EN1 - Writing a 1 to REQ30_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ30_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ30_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ30_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ31_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ31_EN1_SHIFT (31U) -/*! REQ31_EN1 - Writing a 1 to REQ31_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ31_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ31_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ31_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE0_CLR - DMA1 Request Enable0 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ1_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ1_EN1_SHIFT (1U) -/*! REQ1_EN1 - Writing a 1 to REQ1_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ1_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ1_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ1_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ2_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ2_EN1_SHIFT (2U) -/*! REQ2_EN1 - Writing a 1 to REQ2_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ2_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ2_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ2_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ3_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ3_EN1_SHIFT (3U) -/*! REQ3_EN1 - Writing a 1 to REQ3_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ3_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ3_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ3_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ4_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ4_EN1_SHIFT (4U) -/*! REQ4_EN1 - Writing a 1 to REQ4_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ4_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ4_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ4_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ5_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ5_EN1_SHIFT (5U) -/*! REQ5_EN1 - Writing a 1 to REQ5_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ5_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ5_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ5_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ6_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ6_EN1_SHIFT (6U) -/*! REQ6_EN1 - Writing a 1 to REQ6_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ6_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ6_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ6_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ7_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ7_EN1_SHIFT (7U) -/*! REQ7_EN1 - Writing a 1 to REQ7_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ7_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ7_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ7_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ8_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ8_EN1_SHIFT (8U) -/*! REQ8_EN1 - Writing a 1 to REQ8_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ8_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ8_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ8_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ9_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ9_EN1_SHIFT (9U) -/*! REQ9_EN1 - Writing a 1 to REQ9_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ9_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ9_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ9_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ10_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ10_EN1_SHIFT (10U) -/*! REQ10_EN1 - Writing a 1 to REQ10_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ10_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ10_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ10_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ11_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ11_EN1_SHIFT (11U) -/*! REQ11_EN1 - Writing a 1 to REQ11_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ11_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ11_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ11_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ12_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ12_EN1_SHIFT (12U) -/*! REQ12_EN1 - Writing a 1 to REQ12_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ12_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ12_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ12_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ13_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ13_EN1_SHIFT (13U) -/*! REQ13_EN1 - Writing a 1 to REQ13_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ13_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ13_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ13_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ14_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ14_EN1_SHIFT (14U) -/*! REQ14_EN1 - Writing a 1 to REQ14_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ14_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ14_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ14_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ15_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ15_EN1_SHIFT (15U) -/*! REQ15_EN1 - Writing a 1 to REQ15_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ15_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ15_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ15_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ16_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ16_EN1_SHIFT (16U) -/*! REQ16_EN1 - Writing a 1 to REQ16_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ16_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ16_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ16_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ17_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ17_EN1_SHIFT (17U) -/*! REQ17_EN1 - Writing a 1 to REQ17_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ17_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ17_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ17_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ18_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ18_EN1_SHIFT (18U) -/*! REQ18_EN1 - Writing a 1 to REQ18_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ18_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ18_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ18_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ19_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ19_EN1_SHIFT (19U) -/*! REQ19_EN1 - Writing a 1 to REQ19_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ19_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ19_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ19_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ20_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ20_EN1_SHIFT (20U) -/*! REQ20_EN1 - Writing a 1 to REQ20_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ20_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ20_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ20_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ21_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ21_EN1_SHIFT (21U) -/*! REQ21_EN1 - Writing a 1 to REQ21_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ21_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ21_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ21_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ22_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ22_EN1_SHIFT (22U) -/*! REQ22_EN1 - Writing a 1 to REQ22_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ22_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ22_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ22_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ23_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ23_EN1_SHIFT (23U) -/*! REQ23_EN1 - Writing a 1 to REQ23_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ23_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ23_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ23_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ24_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ24_EN1_SHIFT (24U) -/*! REQ24_EN1 - Writing a 1 to REQ24_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ24_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ24_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ24_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ25_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ25_EN1_SHIFT (25U) -/*! REQ25_EN1 - Writing a 1 to REQ25_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ25_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ25_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ25_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ26_EN1_MASK (0x4000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ26_EN1_SHIFT (26U) -/*! REQ26_EN1 - Writing a 1 to REQ26_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ26_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ26_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ26_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ27_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ27_EN1_SHIFT (27U) -/*! REQ27_EN1 - Writing a 1 to REQ27_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ27_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ27_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ27_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ28_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ28_EN1_SHIFT (28U) -/*! REQ28_EN1 - Writing a 1 to REQ28_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ28_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ28_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ28_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ29_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ29_EN1_SHIFT (29U) -/*! REQ29_EN1 - Writing a 1 to REQ29_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ29_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ29_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ29_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ30_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ30_EN1_SHIFT (30U) -/*! REQ30_EN1 - Writing a 1 to REQ30_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ30_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ30_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ30_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ31_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ31_EN1_SHIFT (31U) -/*! REQ31_EN1 - Writing a 1 to REQ31_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ31_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ31_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ31_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE0_TOG - DMA1 Request Enable0 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ1_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ1_EN1_SHIFT (1U) -/*! REQ1_EN1 - Writing a 1 to REQ1_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ1_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ1_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ1_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ2_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ2_EN1_SHIFT (2U) -/*! REQ2_EN1 - Writing a 1 to REQ2_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ2_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ2_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ2_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ3_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ3_EN1_SHIFT (3U) -/*! REQ3_EN1 - Writing a 1 to REQ3_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ3_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ3_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ3_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ4_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ4_EN1_SHIFT (4U) -/*! REQ4_EN1 - Writing a 1 to REQ4_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ4_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ4_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ4_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ5_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ5_EN1_SHIFT (5U) -/*! REQ5_EN1 - Writing a 1 to REQ5_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ5_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ5_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ5_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ6_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ6_EN1_SHIFT (6U) -/*! REQ6_EN1 - Writing a 1 to REQ6_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ6_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ6_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ6_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ7_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ7_EN1_SHIFT (7U) -/*! REQ7_EN1 - Writing a 1 to REQ7_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ7_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ7_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ7_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ8_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ8_EN1_SHIFT (8U) -/*! REQ8_EN1 - Writing a 1 to REQ8_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ8_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ8_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ8_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ9_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ9_EN1_SHIFT (9U) -/*! REQ9_EN1 - Writing a 1 to RE9_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ9_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ9_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ9_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ10_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ10_EN1_SHIFT (10U) -/*! REQ10_EN1 - Writing a 1 to REQ10_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ10_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ10_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ10_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ11_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ11_EN1_SHIFT (11U) -/*! REQ11_EN1 - Writing a 1 to REQ11_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ11_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ11_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ11_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ12_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ12_EN1_SHIFT (12U) -/*! REQ12_EN1 - Writing a 1 to REQ12_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ12_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ12_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ12_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ13_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ13_EN1_SHIFT (13U) -/*! REQ13_EN1 - Writing a 1 to REQ13_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ13_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ13_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ13_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ14_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ14_EN1_SHIFT (14U) -/*! REQ14_EN1 - Writing a 1 to REQ14_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ14_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ14_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ14_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ15_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ15_EN1_SHIFT (15U) -/*! REQ15_EN1 - Writing a 1 to REQ15_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ15_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ15_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ15_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ16_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ16_EN1_SHIFT (16U) -/*! REQ16_EN1 - Writing a 1 to REQ16_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ16_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ16_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ16_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ17_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ17_EN1_SHIFT (17U) -/*! REQ17_EN1 - Writing a 1 to REQ17_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ17_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ17_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ17_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ18_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ18_EN1_SHIFT (18U) -/*! REQ18_EN1 - Writing a 1 to REQ18_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ18_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ18_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ18_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ19_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ19_EN1_SHIFT (19U) -/*! REQ19_EN1 - Writing a 1 to REQ19_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ19_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ19_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ19_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ20_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ20_EN1_SHIFT (20U) -/*! REQ20_EN1 - Writing a 1 to REQ20_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ20_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ20_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ20_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ21_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ21_EN1_SHIFT (21U) -/*! REQ21_EN1 - Writing a 1 to REQ21_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ21_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ21_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ21_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ22_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ22_EN1_SHIFT (22U) -/*! REQ22_EN1 - Writing a 1 to REQ22_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ22_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ22_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ22_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ23_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ23_EN1_SHIFT (23U) -/*! REQ23_EN1 - Writing a 1 to REQ23_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ23_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ23_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ23_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ24_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ24_EN1_SHIFT (24U) -/*! REQ24_EN1 - Writing a 1 to REQ24_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ24_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ24_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ24_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ25_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ25_EN1_SHIFT (25U) -/*! REQ25_EN1 - Writing a 1 to REQ25_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ25_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ25_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ25_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ26_EN1_MASK (0x4000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ26_EN1_SHIFT (26U) -/*! REQ26_EN1 - Writing a 1 to REQ26_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ26_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ26_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ26_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ27_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ27_EN1_SHIFT (27U) -/*! REQ27_EN1 - Writing a 1 to REQ27_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ27_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ27_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ27_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ28_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ28_EN1_SHIFT (28U) -/*! REQ28_EN1 - Writing a 1 to REQ28_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ28_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ28_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ28_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ29_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ29_EN1_SHIFT (29U) -/*! REQ29_EN1 - Writing a 1 to REQ29_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ29_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ29_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ29_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ30_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ30_EN1_SHIFT (30U) -/*! REQ30_EN1 - Writing a 1 to REQ30_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ30_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ30_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ30_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ31_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ31_EN1_SHIFT (31U) -/*! REQ31_EN1 - Writing a 1 to REQ31_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ31_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ31_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ31_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE1 - DMA1 Request Enable1 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ32_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ32_EN1_SHIFT (0U) -/*! REQ32_EN1 - This register is used to enable and disable EVTG0 OUT0B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ32_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ32_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ32_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ33_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ33_EN1_SHIFT (1U) -/*! REQ33_EN1 - This register is used to enable and disable EVTG0 OUT1A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ33_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ33_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ33_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ34_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ34_EN1_SHIFT (2U) -/*! REQ34_EN1 - This register is used to enable and disable EVTG0 OUT1B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ34_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ34_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ34_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ35_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ35_EN1_SHIFT (3U) -/*! REQ35_EN1 - This register is used to enable and disable EVTG0 OUT2A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ35_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ35_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ35_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ36_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ36_EN1_SHIFT (4U) -/*! REQ36_EN1 - This register is used to enable and disable EVTG0 OUT2B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ36_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ36_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ36_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ37_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ37_EN1_SHIFT (5U) -/*! REQ37_EN1 - This register is used to enable and disable EVTG0 OUT3A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ37_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ37_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ37_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ38_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ38_EN1_SHIFT (6U) -/*! REQ38_EN1 - This register is used to enable and disable EVTG0 OUT3B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ38_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ38_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ38_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ39_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ39_EN1_SHIFT (7U) -/*! REQ39_EN1 - This register is used to enable and disable PWM0 Req_capt0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ39_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ39_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ39_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ40_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ40_EN1_SHIFT (8U) -/*! REQ40_EN1 - This register is used to enable and disable PWM0 Req_capt1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ40_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ40_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ40_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ41_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ41_EN1_SHIFT (9U) -/*! REQ41_EN1 - This register is used to enable and disable PWM0 Req_capt2 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ41_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ41_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ41_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ42_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ42_EN1_SHIFT (10U) -/*! REQ42_EN1 - This register is used to enable and disable PWM0 Req_capt3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ42_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ42_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ42_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ43_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ43_EN1_SHIFT (11U) -/*! REQ43_EN1 - This register is used to enable and disable PWM0 Req_val0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ43_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ43_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ43_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ44_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ44_EN1_SHIFT (12U) -/*! REQ44_EN1 - This register is used to enable and disable PWM0 Req_val1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ44_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ44_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ44_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ45_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ45_EN1_SHIFT (13U) -/*! REQ45_EN1 - This register is used to enable and disable PWM0 Req_val2 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ45_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ45_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ45_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ46_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ46_EN1_SHIFT (14U) -/*! REQ46_EN1 - This register is used to enable and disable PWM0 Req_val3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ46_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ46_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ46_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ47_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ47_EN1_SHIFT (15U) -/*! REQ47_EN1 - This register is used to enable and disable PWM1 Req_capt0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ47_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ47_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ47_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ48_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ48_EN1_SHIFT (16U) -/*! REQ48_EN1 - This register is used to enable and disable PWM1 Req_capt1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ48_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ48_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ48_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ49_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ49_EN1_SHIFT (17U) -/*! REQ49_EN1 - This register is used to enable and disable PWM1 Req_capt2 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ49_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ49_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ49_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ50_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ50_EN1_SHIFT (18U) -/*! REQ50_EN1 - This register is used to enable and disable PWM1 Req_capt3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ50_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ50_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ50_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ51_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ51_EN1_SHIFT (19U) -/*! REQ51_EN1 - This register is used to enable and disable PWM1 Req_val0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ51_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ51_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ51_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ52_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ52_EN1_SHIFT (20U) -/*! REQ52_EN1 - This register is used to enable and disable PWM1 Req_val1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ52_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ52_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ52_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ53_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ53_EN1_SHIFT (21U) -/*! REQ53_EN1 - This register is used to enable and disable PWM1 Req_val2 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ53_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ53_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ53_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ54_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ54_EN1_SHIFT (22U) -/*! REQ54_EN1 - This register is used to enable and disable PWM1 Req_val3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ54_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ54_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ54_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ57_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ57_EN1_SHIFT (25U) -/*! REQ57_EN1 - This register is used to enable and disable LPTMR0 counter match event request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ57_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ57_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ57_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ58_EN1_MASK (0x4000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ58_EN1_SHIFT (26U) -/*! REQ58_EN1 - This register is used to enable and disable LPTMR1 counter match event request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ58_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ58_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ58_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ59_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ59_EN1_SHIFT (27U) -/*! REQ59_EN1 - This register is used to enable and disable CAN0 DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ59_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ59_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ59_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ60_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ60_EN1_SHIFT (28U) -/*! REQ60_EN1 - This register is used to enable and disable CAN1 DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ60_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ60_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ60_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ61_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ61_EN1_SHIFT (29U) -/*! REQ61_EN1 - This register is used to enable and disable FlexIO0 Shifter0 Status DMA request OR Timer0 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ61_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ61_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ61_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ62_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ62_EN1_SHIFT (30U) -/*! REQ62_EN1 - This register is used to enable and disable FlexIO0 Shifter1 Status DMA request OR Timer1 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ62_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ62_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ62_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ63_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ63_EN1_SHIFT (31U) -/*! REQ63_EN1 - This register is used to enable and disable FlexIO0 Shifter2 Status DMA request OR Timer2 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ63_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ63_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ63_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE1_SET - DMA1 Request Enable1 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ32_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ32_EN1_SHIFT (0U) -/*! REQ32_EN1 - Writing a 1 to REQ32_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ32_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ32_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ32_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ33_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ33_EN1_SHIFT (1U) -/*! REQ33_EN1 - Writing a 1 to REQ33_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ33_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ33_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ33_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ34_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ34_EN1_SHIFT (2U) -/*! REQ34_EN1 - Writing a 1 to REQ34_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ34_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ34_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ34_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ35_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ35_EN1_SHIFT (3U) -/*! REQ35_EN1 - Writing a 1 to REQ35_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ35_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ35_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ35_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ36_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ36_EN1_SHIFT (4U) -/*! REQ36_EN1 - Writing a 1 to REQ36_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ36_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ36_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ36_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ37_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ37_EN1_SHIFT (5U) -/*! REQ37_EN1 - Writing a 1 to REQ37_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ37_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ37_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ37_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ38_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ38_EN1_SHIFT (6U) -/*! REQ38_EN1 - Writing a 1 to REQ38_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ38_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ38_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ38_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ39_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ39_EN1_SHIFT (7U) -/*! REQ39_EN1 - Writing a 1 to REQ39_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ39_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ39_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ39_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ40_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ40_EN1_SHIFT (8U) -/*! REQ40_EN1 - Writing a 1 to REQ40_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ40_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ40_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ40_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ41_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ41_EN1_SHIFT (9U) -/*! REQ41_EN1 - Writing a 1 to REQ41_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ41_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ41_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ41_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ42_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ42_EN1_SHIFT (10U) -/*! REQ42_EN1 - Writing a 1 to REQ42_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ42_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ42_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ42_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ43_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ43_EN1_SHIFT (11U) -/*! REQ43_EN1 - Writing a 1 to REQ43_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ43_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ43_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ43_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ44_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ44_EN1_SHIFT (12U) -/*! REQ44_EN1 - Writing a 1 to REQ44_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ44_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ44_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ44_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ45_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ45_EN1_SHIFT (13U) -/*! REQ45_EN1 - Writing a 1 to REQ45_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ45_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ45_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ45_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ46_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ46_EN1_SHIFT (14U) -/*! REQ46_EN1 - Writing a 1 to REQ46_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ46_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ46_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ46_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ47_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ47_EN1_SHIFT (15U) -/*! REQ47_EN1 - Writing a 1 to REQ47_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ47_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ47_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ47_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ48_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ48_EN1_SHIFT (16U) -/*! REQ48_EN1 - Writing a 1 to REQ48_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ48_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ48_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ48_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ49_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ49_EN1_SHIFT (17U) -/*! REQ49_EN1 - Writing a 1 to REQ49_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ49_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ49_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ49_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ50_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ50_EN1_SHIFT (18U) -/*! REQ50_EN1 - Writing a 1 to REQ50_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ50_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ50_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ50_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ51_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ51_EN1_SHIFT (19U) -/*! REQ51_EN1 - Writing a 1 to REQ51_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ51_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ51_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ51_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ52_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ52_EN1_SHIFT (20U) -/*! REQ52_EN1 - Writing a 1 to REQ52_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ52_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ52_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ52_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ53_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ53_EN1_SHIFT (21U) -/*! REQ53_EN1 - Writing a 1 to REQ53_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ53_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ53_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ53_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ54_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ54_EN1_SHIFT (22U) -/*! REQ54_EN1 - Writing a 1 to REQ54_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ54_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ54_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ54_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ57_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ57_EN1_SHIFT (25U) -/*! REQ57_EN1 - Writing a 1 to REQ57_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ57_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ57_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ57_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ58_EN1_MASK (0x4000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ58_EN1_SHIFT (26U) -/*! REQ58_EN1 - Writing a 1 to REQ58_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ58_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ58_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ58_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ59_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ59_EN1_SHIFT (27U) -/*! REQ59_EN1 - Writing a 1 to REQ59_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ59_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ59_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ59_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ60_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ60_EN1_SHIFT (28U) -/*! REQ60_EN1 - Writing a 1 to REQ60_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ60_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ60_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ60_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ61_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ61_EN1_SHIFT (29U) -/*! REQ61_EN1 - Writing a 1 to REQ61_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ61_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ61_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ61_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ62_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ62_EN1_SHIFT (30U) -/*! REQ62_EN1 - Writing a 1 to REQ62_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ62_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ62_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ62_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ63_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ63_EN1_SHIFT (31U) -/*! REQ63_EN1 - Writing a 1 to REQ63_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ63_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ63_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ63_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE1_CLR - DMA1 Request Enable1 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ32_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ32_EN1_SHIFT (0U) -/*! REQ32_EN1 - Writing a 1 to REQ32_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ32_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ32_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ32_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ33_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ33_EN1_SHIFT (1U) -/*! REQ33_EN1 - Writing a 1 to REQ33_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ33_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ33_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ33_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ34_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ34_EN1_SHIFT (2U) -/*! REQ34_EN1 - Writing a 1 to REQ34_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ34_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ34_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ34_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ35_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ35_EN1_SHIFT (3U) -/*! REQ35_EN1 - Writing a 1 to REQ35_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ35_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ35_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ35_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ36_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ36_EN1_SHIFT (4U) -/*! REQ36_EN1 - Writing a 1 to REQ36_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ36_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ36_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ36_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ37_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ37_EN1_SHIFT (5U) -/*! REQ37_EN1 - Writing a 1 to REQ37_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ37_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ37_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ37_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ38_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ38_EN1_SHIFT (6U) -/*! REQ38_EN1 - Writing a 1 to REQ38_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ38_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ38_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ38_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ39_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ39_EN1_SHIFT (7U) -/*! REQ39_EN1 - Writing a 1 to REQ39_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ39_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ39_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ39_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ40_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ40_EN1_SHIFT (8U) -/*! REQ40_EN1 - Writing a 1 to REQ40_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ40_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ40_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ40_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ41_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ41_EN1_SHIFT (9U) -/*! REQ41_EN1 - Writing a 1 to REQ41_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ41_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ41_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ41_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ42_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ42_EN1_SHIFT (10U) -/*! REQ42_EN1 - Writing a 1 to REQ42_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ42_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ42_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ42_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ43_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ43_EN1_SHIFT (11U) -/*! REQ43_EN1 - Writing a 1 to REQ43_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ43_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ43_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ43_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ44_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ44_EN1_SHIFT (12U) -/*! REQ44_EN1 - Writing a 1 to REQ44_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ44_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ44_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ44_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ45_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ45_EN1_SHIFT (13U) -/*! REQ45_EN1 - Writing a 1 to REQ45_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ45_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ45_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ45_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ46_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ46_EN1_SHIFT (14U) -/*! REQ46_EN1 - Writing a 1 to REQ46_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ46_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ46_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ46_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ47_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ47_EN1_SHIFT (15U) -/*! REQ47_EN1 - Writing a 1 to REQ47_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ47_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ47_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ47_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ48_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ48_EN1_SHIFT (16U) -/*! REQ48_EN1 - Writing a 1 to REQ48_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ48_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ48_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ48_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ49_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ49_EN1_SHIFT (17U) -/*! REQ49_EN1 - Writing a 1 to REQ49_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ49_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ49_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ49_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ50_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ50_EN1_SHIFT (18U) -/*! REQ50_EN1 - Writing a 1 to REQ50_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ50_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ50_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ50_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ51_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ51_EN1_SHIFT (19U) -/*! REQ51_EN1 - Writing a 1 to REQ51_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ51_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ51_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ51_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ52_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ52_EN1_SHIFT (20U) -/*! REQ52_EN1 - Writing a 1 to REQ52_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ52_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ52_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ52_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ53_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ53_EN1_SHIFT (21U) -/*! REQ53_EN1 - Writing a 1 to REQ53_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ53_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ53_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ53_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ54_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ54_EN1_SHIFT (22U) -/*! REQ54_EN1 - Writing a 1 to REQ54_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ54_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ54_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ54_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ57_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ57_EN1_SHIFT (25U) -/*! REQ57_EN1 - Writing a 1 to REQ57_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ57_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ57_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ57_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ58_EN1_MASK (0x4000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ58_EN1_SHIFT (26U) -/*! REQ58_EN1 - Writing a 1 to REQ58_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ58_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ58_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ58_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ59_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ59_EN1_SHIFT (27U) -/*! REQ59_EN1 - Writing a 1 to REQ59_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ59_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ59_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ59_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ60_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ60_EN1_SHIFT (28U) -/*! REQ60_EN1 - Writing a 1 to REQ60_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ60_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ60_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ60_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ61_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ61_EN1_SHIFT (29U) -/*! REQ61_EN1 - Writing a 1 to REQ61_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ61_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ61_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ61_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ62_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ62_EN1_SHIFT (30U) -/*! REQ62_EN1 - Writing a 1 to REQ62_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ62_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ62_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ62_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ63_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ63_EN1_SHIFT (31U) -/*! REQ63_EN1 - Writing a 1 to REQ63_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ63_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ63_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ63_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE1_TOG - DMA1 Request Enable1 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ32_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ32_EN1_SHIFT (0U) -/*! REQ32_EN1 - Writing a 1 to REQ32_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ32_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ32_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ32_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ33_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ33_EN1_SHIFT (1U) -/*! REQ33_EN1 - Writing a 1 to REQ33_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ33_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ33_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ33_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ34_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ34_EN1_SHIFT (2U) -/*! REQ34_EN1 - Writing a 1 to REQ34_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ34_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ34_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ34_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ35_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ35_EN1_SHIFT (3U) -/*! REQ35_EN1 - Writing a 1 to REQ35_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ35_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ35_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ35_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ36_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ36_EN1_SHIFT (4U) -/*! REQ36_EN1 - Writing a 1 to REQ36_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ36_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ36_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ36_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ37_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ37_EN1_SHIFT (5U) -/*! REQ37_EN1 - Writing a 1 to REQ37_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ37_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ37_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ37_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ38_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ38_EN1_SHIFT (6U) -/*! REQ38_EN1 - Writing a 1 to REQ38_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ38_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ38_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ38_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ39_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ39_EN1_SHIFT (7U) -/*! REQ39_EN1 - Writing a 1 to REQ39_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ39_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ39_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ39_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ40_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ40_EN1_SHIFT (8U) -/*! REQ40_EN1 - Writing a 1 to REQ40_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ40_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ40_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ40_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ41_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ41_EN1_SHIFT (9U) -/*! REQ41_EN1 - Writing a 1 to REQ41_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ41_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ41_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ41_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ42_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ42_EN1_SHIFT (10U) -/*! REQ42_EN1 - Writing a 1 to REQ42_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ42_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ42_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ42_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ43_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ43_EN1_SHIFT (11U) -/*! REQ43_EN1 - Writing a 1 to REQ43_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ43_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ43_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ43_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ44_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ44_EN1_SHIFT (12U) -/*! REQ44_EN1 - Writing a 1 to REQ44_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ44_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ44_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ44_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ45_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ45_EN1_SHIFT (13U) -/*! REQ45_EN1 - Writing a 1 to REQ55_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ45_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ45_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ45_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ46_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ46_EN1_SHIFT (14U) -/*! REQ46_EN1 - Writing a 1 to REQ46_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ46_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ46_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ46_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ47_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ47_EN1_SHIFT (15U) -/*! REQ47_EN1 - Writing a 1 to REQ47_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ47_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ47_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ47_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ48_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ48_EN1_SHIFT (16U) -/*! REQ48_EN1 - Writing a 1 to REQ48_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ48_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ48_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ48_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ49_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ49_EN1_SHIFT (17U) -/*! REQ49_EN1 - Writing a 1 to REQ49_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ49_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ49_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ49_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ50_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ50_EN1_SHIFT (18U) -/*! REQ50_EN1 - Writing a 1 to REQ50_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ50_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ50_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ50_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ51_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ51_EN1_SHIFT (19U) -/*! REQ51_EN1 - Writing a 1 to REQ51_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ51_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ51_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ51_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ52_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ52_EN1_SHIFT (20U) -/*! REQ52_EN1 - Writing a 1 to REQ52_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ52_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ52_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ52_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ53_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ53_EN1_SHIFT (21U) -/*! REQ53_EN1 - Writing a 1 to REQ53_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ53_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ53_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ53_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ54_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ54_EN1_SHIFT (22U) -/*! REQ54_EN1 - Writing a 1 to REQ54_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ54_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ54_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ54_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ57_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ57_EN1_SHIFT (25U) -/*! REQ57_EN1 - Writing a 1 to REQ57_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ57_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ57_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ57_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ58_EN1_MASK (0x4000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ58_EN1_SHIFT (26U) -/*! REQ58_EN1 - Writing a 1 to REQ58_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ58_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ58_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ58_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ59_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ59_EN1_SHIFT (27U) -/*! REQ59_EN1 - Writing a 1 to REQ59_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ59_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ59_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ59_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ60_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ60_EN1_SHIFT (28U) -/*! REQ60_EN1 - Writing a 1 to REQ60_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ60_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ60_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ60_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ61_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ61_EN1_SHIFT (29U) -/*! REQ61_EN1 - Writing a 1 to REQ61_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ61_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ61_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ61_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ62_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ62_EN1_SHIFT (30U) -/*! REQ62_EN1 - Writing a 1 to REQ62_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ62_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ62_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ62_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ63_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ63_EN1_SHIFT (31U) -/*! REQ63_EN1 - Writing a 1 to REQ63_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ63_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ63_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ63_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE2 - DMA1 Request Enable2 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ64_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ64_EN1_SHIFT (0U) -/*! REQ64_EN1 - This register is used to enable and disable FlexIO0 Shifter3 Status DMA request OR Timer3 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ64_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ64_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ64_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ65_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ65_EN1_SHIFT (1U) -/*! REQ65_EN1 - This register is used to enable and disable FlexIO0 Shifter4 Status DMA request OR Timer4 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ65_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ65_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ65_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ66_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ66_EN1_SHIFT (2U) -/*! REQ66_EN1 - This register is used to enable and disable FlexIO0 Shifter5 Status DMA request OR Timer5 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ66_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ66_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ66_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ67_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ67_EN1_SHIFT (3U) -/*! REQ67_EN1 - This register is used to enable and disable FlexIO0 Shifter6 Status DMA request OR Timer6 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ67_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ67_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ67_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ68_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ68_EN1_SHIFT (4U) -/*! REQ68_EN1 - This register is used to enable and disable FlexIO0 Shifter7 Status DMA request OR Timer7 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ68_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ68_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ68_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ69_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ69_EN1_SHIFT (5U) -/*! REQ69_EN1 - This register is used to enable and disable LP_FLEXCOMM0 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ69_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ69_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ69_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ70_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ70_EN1_SHIFT (6U) -/*! REQ70_EN1 - This register is used to enable and disable LP_FLEXCOMM0 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ70_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ70_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ70_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ71_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ71_EN1_SHIFT (7U) -/*! REQ71_EN1 - This register is used to enable and disable LP_FLEXCOMM1 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ71_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ71_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ71_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ72_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ72_EN1_SHIFT (8U) -/*! REQ72_EN1 - This register is used to enable and disable LP_FLEXCOMM1 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ72_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ72_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ72_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ73_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ73_EN1_SHIFT (9U) -/*! REQ73_EN1 - This register is used to enable and disable LP_FLEXCOMM2 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ73_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ73_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ73_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ74_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ74_EN1_SHIFT (10U) -/*! REQ74_EN1 - This register is used to enable and disable LP_FLEXCOMM2 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ74_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ74_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ74_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ75_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ75_EN1_SHIFT (11U) -/*! REQ75_EN1 - This register is used to enable and disable LP_FLEXCOMM3 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ75_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ75_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ75_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ76_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ76_EN1_SHIFT (12U) -/*! REQ76_EN1 - This register is used to enable and disable LP_FLEXCOMM3 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ76_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ76_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ76_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ77_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ77_EN1_SHIFT (13U) -/*! REQ77_EN1 - This register is used to enable and disable LP_FLEXCOMM4 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ77_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ77_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ77_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ78_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ78_EN1_SHIFT (14U) -/*! REQ78_EN1 - This register is used to enable and disable LP_FLEXCOMM4 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ78_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ78_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ78_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ79_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ79_EN1_SHIFT (15U) -/*! REQ79_EN1 - This register is used to enable and disable LP_FLEXCOMM5 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ79_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ79_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ79_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ80_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ80_EN1_SHIFT (16U) -/*! REQ80_EN1 - This register is used to enable and disable LP_FLEXCOMM5 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ80_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ80_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ80_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ81_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ81_EN1_SHIFT (17U) -/*! REQ81_EN1 - This register is used to enable and disable LP_FLEXCOMM6 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ81_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ81_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ81_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ82_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ82_EN1_SHIFT (18U) -/*! REQ82_EN1 - This register is used to enable and disable LP_FLEXCOMM6 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ82_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ82_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ82_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ83_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ83_EN1_SHIFT (19U) -/*! REQ83_EN1 - This register is used to enable and disable LP_FLEXCOMM7 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ83_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ83_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ83_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ84_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ84_EN1_SHIFT (20U) -/*! REQ84_EN1 - This register is used to enable and disable LP_FLEXCOMM7 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ84_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ84_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ84_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ85_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ85_EN1_SHIFT (21U) -/*! REQ85_EN1 - This register is used to enable and disable LP_FLEXCOMM8 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ85_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ85_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ85_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ86_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ86_EN1_SHIFT (22U) -/*! REQ86_EN1 - This register is used to enable and disable LP_FLEXCOMM8 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ86_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ86_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ86_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ87_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ87_EN1_SHIFT (23U) -/*! REQ87_EN1 - This register is used to enable and disable LP_FLEXCOMM9 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ87_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ87_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ87_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ88_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ88_EN1_SHIFT (24U) -/*! REQ88_EN1 - This register is used to enable and disable LP_FLEXCOMM9 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ88_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ88_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ88_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ91_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ91_EN1_SHIFT (27U) -/*! REQ91_EN1 - This register is used to enable and disable EMVSIM0 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ91_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ91_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ91_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ92_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ92_EN1_SHIFT (28U) -/*! REQ92_EN1 - This register is used to enable and disable EMVSIM0 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ92_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ92_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ92_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ93_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ93_EN1_SHIFT (29U) -/*! REQ93_EN1 - This register is used to enable and disable EMVSIM1 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ93_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ93_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ93_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ94_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ94_EN1_SHIFT (30U) -/*! REQ94_EN1 - This register is used to enable and disable EMVSIM1 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ94_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ94_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ94_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ95_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ95_EN1_SHIFT (31U) -/*! REQ95_EN1 - This register is used to enable and disable I3C0 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ95_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ95_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ95_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE2_SET - DMA1 Request Enable2 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ64_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ64_EN1_SHIFT (0U) -/*! REQ64_EN1 - Writing a 1 to REQ64_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ64_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ64_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ64_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ65_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ65_EN1_SHIFT (1U) -/*! REQ65_EN1 - Writing a 1 to REQ65_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ65_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ65_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ65_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ66_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ66_EN1_SHIFT (2U) -/*! REQ66_EN1 - Writing a 1 to REQ66_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ66_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ66_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ66_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ67_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ67_EN1_SHIFT (3U) -/*! REQ67_EN1 - Writing a 1 to REQ67_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ67_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ67_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ67_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ68_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ68_EN1_SHIFT (4U) -/*! REQ68_EN1 - Writing a 1 to REQ68_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ68_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ68_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ68_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ69_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ69_EN1_SHIFT (5U) -/*! REQ69_EN1 - Writing a 1 to REQ69_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ69_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ69_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ69_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ70_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ70_EN1_SHIFT (6U) -/*! REQ70_EN1 - Writing a 1 to REQ70_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ70_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ70_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ70_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ71_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ71_EN1_SHIFT (7U) -/*! REQ71_EN1 - Writing a 1 to REQ71_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ71_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ71_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ71_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ72_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ72_EN1_SHIFT (8U) -/*! REQ72_EN1 - Writing a 1 to REQ72_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ72_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ72_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ72_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ73_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ73_EN1_SHIFT (9U) -/*! REQ73_EN1 - Writing a 1 to REQ73_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ73_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ73_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ73_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ74_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ74_EN1_SHIFT (10U) -/*! REQ74_EN1 - Writing a 1 to REQ74_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ74_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ74_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ74_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ75_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ75_EN1_SHIFT (11U) -/*! REQ75_EN1 - Writing a 1 to REQ75_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ75_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ75_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ75_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ76_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ76_EN1_SHIFT (12U) -/*! REQ76_EN1 - Writing a 1 to REQ876_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ76_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ76_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ76_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ77_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ77_EN1_SHIFT (13U) -/*! REQ77_EN1 - Writing a 1 to REQ77_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ77_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ77_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ77_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ78_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ78_EN1_SHIFT (14U) -/*! REQ78_EN1 - Writing a 1 to REQ78_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ78_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ78_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ78_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ79_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ79_EN1_SHIFT (15U) -/*! REQ79_EN1 - Writing a 1 to REQ79_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ79_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ79_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ79_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ80_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ80_EN1_SHIFT (16U) -/*! REQ80_EN1 - Writing a 1 to REQ80_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ80_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ80_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ80_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ81_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ81_EN1_SHIFT (17U) -/*! REQ81_EN1 - Writing a 1 to REQ81_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ81_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ81_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ81_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ82_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ82_EN1_SHIFT (18U) -/*! REQ82_EN1 - Writing a 1 to REQ82_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ82_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ82_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ82_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ83_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ83_EN1_SHIFT (19U) -/*! REQ83_EN1 - Writing a 1 to REQ83_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ83_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ83_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ83_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ84_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ84_EN1_SHIFT (20U) -/*! REQ84_EN1 - Writing a 1 to REQ84_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ84_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ84_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ84_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ85_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ85_EN1_SHIFT (21U) -/*! REQ85_EN1 - Writing a 1 to REQ85_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ85_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ85_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ85_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ86_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ86_EN1_SHIFT (22U) -/*! REQ86_EN1 - Writing a 1 to REQ86_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ86_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ86_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ86_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ87_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ87_EN1_SHIFT (23U) -/*! REQ87_EN1 - Writing a 1 to REQ87_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ87_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ87_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ87_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ88_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ88_EN1_SHIFT (24U) -/*! REQ88_EN1 - Writing a 1 to REQ88_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ88_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ88_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ88_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ89_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ89_EN1_SHIFT (25U) -/*! REQ89_EN1 - Writing a 1 to REQ89_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ89_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ89_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ89_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ90_EN1_MASK (0x4000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ90_EN1_SHIFT (26U) -/*! REQ90_EN1 - Writing a 1 to REQ90_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ90_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ90_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ90_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ91_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ91_EN1_SHIFT (27U) -/*! REQ91_EN1 - Writing a 1 to REQ91_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ91_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ91_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ91_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ92_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ92_EN1_SHIFT (28U) -/*! REQ92_EN1 - Writing a 1 to REQ92_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ92_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ92_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ92_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ93_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ93_EN1_SHIFT (29U) -/*! REQ93_EN1 - Writing a 1 to REQ93_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ93_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ93_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ93_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ94_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ94_EN1_SHIFT (30U) -/*! REQ94_EN1 - Writing a 1 to REQ94_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ94_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ94_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ94_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ95_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ95_EN1_SHIFT (31U) -/*! REQ95_EN1 - Writing a 1 to REQ95_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ95_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ95_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ95_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE2_CLR - DMA1 Request Enable2 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ64_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ64_EN1_SHIFT (0U) -/*! REQ64_EN1 - Writing a 1 to REQ64_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ64_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ64_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ64_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ65_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ65_EN1_SHIFT (1U) -/*! REQ65_EN1 - Writing a 1 to REQ65_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ65_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ65_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ65_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ66_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ66_EN1_SHIFT (2U) -/*! REQ66_EN1 - Writing a 1 to REQ66_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ66_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ66_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ66_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ67_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ67_EN1_SHIFT (3U) -/*! REQ67_EN1 - Writing a 1 to REQ67_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ67_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ67_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ67_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ68_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ68_EN1_SHIFT (4U) -/*! REQ68_EN1 - Writing a 1 to REQ68_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ68_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ68_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ68_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ69_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ69_EN1_SHIFT (5U) -/*! REQ69_EN1 - Writing a 1 to REQ69_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ69_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ69_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ69_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ70_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ70_EN1_SHIFT (6U) -/*! REQ70_EN1 - Writing a 1 to REQ70_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ70_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ70_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ70_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ71_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ71_EN1_SHIFT (7U) -/*! REQ71_EN1 - Writing a 1 to REQ71_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ71_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ71_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ71_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ72_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ72_EN1_SHIFT (8U) -/*! REQ72_EN1 - Writing a 1 to REQ72_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ72_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ72_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ72_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ73_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ73_EN1_SHIFT (9U) -/*! REQ73_EN1 - Writing a 1 to REQ73_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ73_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ73_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ73_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ74_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ74_EN1_SHIFT (10U) -/*! REQ74_EN1 - Writing a 1 to REQ74_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ74_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ74_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ74_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ75_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ75_EN1_SHIFT (11U) -/*! REQ75_EN1 - Writing a 1 to REQ75_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ75_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ75_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ75_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ76_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ76_EN1_SHIFT (12U) -/*! REQ76_EN1 - Writing a 1 to REQ76_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ76_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ76_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ76_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ77_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ77_EN1_SHIFT (13U) -/*! REQ77_EN1 - Writing a 1 to REQ77_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ77_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ77_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ77_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ78_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ78_EN1_SHIFT (14U) -/*! REQ78_EN1 - Writing a 1 to REQ78_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ78_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ78_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ78_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ79_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ79_EN1_SHIFT (15U) -/*! REQ79_EN1 - Writing a 1 to REQ79_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ79_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ79_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ79_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ80_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ80_EN1_SHIFT (16U) -/*! REQ80_EN1 - Writing a 1 to REQ80_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ80_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ80_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ80_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ81_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ81_EN1_SHIFT (17U) -/*! REQ81_EN1 - Writing a 1 to REQ81_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ81_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ81_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ81_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ82_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ82_EN1_SHIFT (18U) -/*! REQ82_EN1 - Writing a 1 to REQ82_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ82_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ82_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ82_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ83_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ83_EN1_SHIFT (19U) -/*! REQ83_EN1 - Writing a 1 to REQ83_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ83_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ83_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ83_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ84_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ84_EN1_SHIFT (20U) -/*! REQ84_EN1 - Writing a 1 to REQ84_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ84_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ84_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ84_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ85_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ85_EN1_SHIFT (21U) -/*! REQ85_EN1 - Writing a 1 to REQ85_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ85_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ85_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ85_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ86_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ86_EN1_SHIFT (22U) -/*! REQ86_EN1 - Writing a 1 to REQ86_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ86_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ86_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ86_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ87_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ87_EN1_SHIFT (23U) -/*! REQ87_EN1 - Writing a 1 to REQ87_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ87_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ87_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ87_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ88_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ88_EN1_SHIFT (24U) -/*! REQ88_EN1 - Writing a 1 to REQ88_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ88_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ88_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ88_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ89_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ89_EN1_SHIFT (25U) -/*! REQ89_EN1 - Writing a 1 to REQ89_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ89_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ89_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ89_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ90_EN1_MASK (0x4000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ90_EN1_SHIFT (26U) -/*! REQ90_EN1 - Writing a 1 to REQ90_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ90_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ90_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ90_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ91_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ91_EN1_SHIFT (27U) -/*! REQ91_EN1 - Writing a 1 to REQ91_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ91_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ91_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ91_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ92_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ92_EN1_SHIFT (28U) -/*! REQ92_EN1 - Writing a 1 to REQ92_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ92_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ92_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ92_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ93_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ93_EN1_SHIFT (29U) -/*! REQ93_EN1 - Writing a 1 to REQ93_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ93_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ93_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ93_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ94_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ94_EN1_SHIFT (30U) -/*! REQ94_EN1 - Writing a 1 to REQ94_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ94_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ94_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ94_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ95_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ95_EN1_SHIFT (31U) -/*! REQ95_EN1 - Writing a 1 to REQ95_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ95_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ95_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ95_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE2_TOG - DMA1 Request Enable2 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ64_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ64_EN1_SHIFT (0U) -/*! REQ64_EN1 - Writing a 1 to REQ64_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ64_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ64_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ64_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ65_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ65_EN1_SHIFT (1U) -/*! REQ65_EN1 - Writing a 1 to REQ65_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ65_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ65_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ65_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ66_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ66_EN1_SHIFT (2U) -/*! REQ66_EN1 - Writing a 1 to REQ66_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ66_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ66_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ66_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ67_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ67_EN1_SHIFT (3U) -/*! REQ67_EN1 - Writing a 1 to REQ67_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ67_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ67_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ67_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ68_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ68_EN1_SHIFT (4U) -/*! REQ68_EN1 - Writing a 1 to REQ68_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ68_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ68_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ68_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ69_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ69_EN1_SHIFT (5U) -/*! REQ69_EN1 - Writing a 1 to REQ69_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ69_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ69_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ69_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ70_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ70_EN1_SHIFT (6U) -/*! REQ70_EN1 - Writing a 1 to REQ70_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ70_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ70_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ70_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ71_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ71_EN1_SHIFT (7U) -/*! REQ71_EN1 - Writing a 1 to REQ71_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ71_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ71_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ71_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ72_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ72_EN1_SHIFT (8U) -/*! REQ72_EN1 - Writing a 1 to REQ72_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ72_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ72_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ72_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ73_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ73_EN1_SHIFT (9U) -/*! REQ73_EN1 - Writing a 1 to REQ73_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ73_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ73_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ73_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ74_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ74_EN1_SHIFT (10U) -/*! REQ74_EN1 - Writing a 1 to REQ74_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ74_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ74_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ74_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ75_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ75_EN1_SHIFT (11U) -/*! REQ75_EN1 - Writing a 1 to REQ75_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ75_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ75_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ75_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ76_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ76_EN1_SHIFT (12U) -/*! REQ76_EN1 - Writing a 1 to REQ76_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ76_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ76_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ76_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ77_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ77_EN1_SHIFT (13U) -/*! REQ77_EN1 - Writing a 1 to REQ77_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ77_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ77_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ77_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ78_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ78_EN1_SHIFT (14U) -/*! REQ78_EN1 - Writing a 1 to REQ78_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ78_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ78_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ78_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ79_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ79_EN1_SHIFT (15U) -/*! REQ79_EN1 - Writing a 1 to REQ79_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ79_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ79_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ79_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ80_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ80_EN1_SHIFT (16U) -/*! REQ80_EN1 - Writing a 1 to REQ80_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ80_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ80_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ80_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ81_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ81_EN1_SHIFT (17U) -/*! REQ81_EN1 - Writing a 1 to REQ81_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ81_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ81_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ81_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ82_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ82_EN1_SHIFT (18U) -/*! REQ82_EN1 - Writing a 1 to REQ82_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ82_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ82_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ82_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ83_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ83_EN1_SHIFT (19U) -/*! REQ83_EN1 - Writing a 1 to REQ83_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ83_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ83_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ83_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ84_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ84_EN1_SHIFT (20U) -/*! REQ84_EN1 - Writing a 1 to REQ84_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ84_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ84_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ84_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ85_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ85_EN1_SHIFT (21U) -/*! REQ85_EN1 - Writing a 1 to REQ85_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ85_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ85_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ85_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ86_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ86_EN1_SHIFT (22U) -/*! REQ86_EN1 - Writing a 1 to REQ86_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ86_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ86_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ86_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ87_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ87_EN1_SHIFT (23U) -/*! REQ87_EN1 - Writing a 1 to REQ87_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ87_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ87_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ87_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ88_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ88_EN1_SHIFT (24U) -/*! REQ88_EN1 - Writing a 1 to REQ88_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ88_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ88_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ88_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ89_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ89_EN1_SHIFT (25U) -/*! REQ89_EN1 - Writing a 1 to REQ89_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ89_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ89_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ89_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ90_EN1_MASK (0x4000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ90_EN1_SHIFT (26U) -/*! REQ90_EN1 - Writing a 1 to REQ90_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ90_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ90_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ90_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ91_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ91_EN1_SHIFT (27U) -/*! REQ91_EN1 - Writing a 1 to REQ91_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ91_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ91_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ91_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ92_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ92_EN1_SHIFT (28U) -/*! REQ92_EN1 - Writing a 1 to REQ92_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ92_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ92_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ92_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ93_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ93_EN1_SHIFT (29U) -/*! REQ93_EN1 - Writing a 1 to REQ93_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ93_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ93_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ93_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ94_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ94_EN1_SHIFT (30U) -/*! REQ94_EN1 - Writing a 1 to REQ94_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ94_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ94_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ94_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ95_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ95_EN1_SHIFT (31U) -/*! REQ95_EN1 - Writing a 1 to REQ95_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ95_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ95_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ95_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE3 - DMA1 Request Enable3 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ96_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ96_EN1_SHIFT (0U) -/*! REQ96_EN1 - This register is used to enable and disable I3C0 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ96_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ96_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ96_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ97_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ97_EN1_SHIFT (1U) -/*! REQ97_EN1 - This register is used to enable and disable I3C1 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ97_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ97_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ97_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ98_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ98_EN1_SHIFT (2U) -/*! REQ98_EN1 - This register is used to enable and disable I3C1 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ98_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ98_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ98_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ99_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ99_EN1_SHIFT (3U) -/*! REQ99_EN1 - This register is used to enable and disable SAI0 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ99_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ99_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ99_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ100_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ100_EN1_SHIFT (4U) -/*! REQ100_EN1 - This register is used to enable and disable SAI0 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ100_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ100_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ100_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ101_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ101_EN1_SHIFT (5U) -/*! REQ101_EN1 - This register is used to enable and disable SAI1 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ101_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ101_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ101_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ102_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ102_EN1_SHIFT (6U) -/*! REQ102_EN1 - This register is used to enable and disable SAI1 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ102_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ102_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ102_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ103_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ103_EN1_SHIFT (7U) -/*! REQ103_EN1 - This register is used to enable and disable SINC0 ipd_req_sinc[0] or ipd_req_alt [0] request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ103_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ103_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ103_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ104_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ104_EN1_SHIFT (8U) -/*! REQ104_EN1 - This register is used to enable and disable SINC0 ipd_req_sinc[1] or ipd_req_alt [1] request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ104_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ104_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ104_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ105_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ105_EN1_SHIFT (9U) -/*! REQ105_EN1 - This register is used to enable and disable SINC0 ipd_req_sinc[2] or ipd_req_alt [2] request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ105_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ105_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ105_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ106_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ106_EN1_SHIFT (10U) -/*! REQ106_EN1 - This register is used to enable and disable SINC0 ipd_req_sinc[3] or ipd_req_alt [3] request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ106_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ106_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ106_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ107_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ107_EN1_SHIFT (11U) -/*! REQ107_EN1 - This register is used to enable and disable SINC0 ipd_req_sinc[4] or ipd_req_alt [4] request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ107_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ107_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ107_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ108_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ108_EN1_SHIFT (12U) -/*! REQ108_EN1 - This register is used to enable and disable GPIO0 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ108_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ108_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ108_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ109_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ109_EN1_SHIFT (13U) -/*! REQ109_EN1 - This register is used to enable and disable GPIO0 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ109_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ109_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ109_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ110_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ110_EN1_SHIFT (14U) -/*! REQ110_EN1 - This register is used to enable and disable GPIO1 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ110_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ110_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ110_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ111_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ111_EN1_SHIFT (15U) -/*! REQ111_EN1 - This register is used to enable and disable GPIO1 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ111_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ111_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ111_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ112_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ112_EN1_SHIFT (16U) -/*! REQ112_EN1 - This register is used to enable and disable GPIO2 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ112_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ112_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ112_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ113_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ113_EN1_SHIFT (17U) -/*! REQ113_EN1 - This register is used to enable and disable GPIO2 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ113_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ113_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ113_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ114_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ114_EN1_SHIFT (18U) -/*! REQ114_EN1 - This register is used to enable and disable GPIO3 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ114_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ114_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ114_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ115_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ115_EN1_SHIFT (19U) -/*! REQ115_EN1 - This register is used to enable and disable GPIO3 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ115_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ115_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ115_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ116_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ116_EN1_SHIFT (20U) -/*! REQ116_EN1 - This register is used to enable and disable GPIO4 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ116_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ116_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ116_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ117_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ117_EN1_SHIFT (21U) -/*! REQ117_EN1 - This register is used to enable and disable GPIO4 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ117_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ117_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ117_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ118_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ118_EN1_SHIFT (22U) -/*! REQ118_EN1 - This register is used to enable and disable GPIO5 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ118_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ118_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ118_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ119_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ119_EN1_SHIFT (23U) -/*! REQ119_EN1 - This register is used to enable and disable GPIO5 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ119_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ119_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ119_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ120_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ120_EN1_SHIFT (24U) -/*! REQ120_EN1 - This register is used to enable and disable TSI0 end of scan request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ120_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ120_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ120_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ121_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ121_EN1_SHIFT (25U) -/*! REQ121_EN1 - This register is used to enable and disable TSI0 out of range request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ121_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ121_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ121_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE3_SET - DMA1 Request Enable3 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ96_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ96_EN1_SHIFT (0U) -/*! REQ96_EN1 - Writing a 1 to REQ96_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ96_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ96_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ96_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ97_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ97_EN1_SHIFT (1U) -/*! REQ97_EN1 - Writing a 1 to REQ97_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ97_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ97_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ97_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ98_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ98_EN1_SHIFT (2U) -/*! REQ98_EN1 - Writing a 1 to REQ98_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ98_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ98_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ98_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ99_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ99_EN1_SHIFT (3U) -/*! REQ99_EN1 - Writing a 1 to REQ99_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ99_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ99_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ99_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ100_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ100_EN1_SHIFT (4U) -/*! REQ100_EN1 - Writing a 1 to REQ100_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ100_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ100_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ100_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ101_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ101_EN1_SHIFT (5U) -/*! REQ101_EN1 - Writing a 1 to REQ101_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ101_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ101_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ101_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ102_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ102_EN1_SHIFT (6U) -/*! REQ102_EN1 - Writing a 1 to REQ102_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ102_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ102_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ102_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ103_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ103_EN1_SHIFT (7U) -/*! REQ103_EN1 - Writing a 1 to REQ103_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ103_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ103_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ103_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ104_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ104_EN1_SHIFT (8U) -/*! REQ104_EN1 - Writing a 1 to REQ104_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ104_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ104_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ104_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ105_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ105_EN1_SHIFT (9U) -/*! REQ105_EN1 - Writing a 1 to REQ105_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ105_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ105_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ105_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ106_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ106_EN1_SHIFT (10U) -/*! REQ106_EN1 - Writing a 1 to REQ106_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ106_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ106_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ106_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ107_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ107_EN1_SHIFT (11U) -/*! REQ107_EN1 - Writing a 1 to REQ107_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ107_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ107_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ107_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ108_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ108_EN1_SHIFT (12U) -/*! REQ108_EN1 - Writing a 1 to REQ108_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ108_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ108_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ108_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ109_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ109_EN1_SHIFT (13U) -/*! REQ109_EN1 - Writing a 1 to REQ109_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ109_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ109_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ109_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ110_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ110_EN1_SHIFT (14U) -/*! REQ110_EN1 - Writing a 1 to REQ110_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ110_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ110_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ110_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ111_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ111_EN1_SHIFT (15U) -/*! REQ111_EN1 - Writing a 1 to REQ111_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ111_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ111_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ111_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ112_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ112_EN1_SHIFT (16U) -/*! REQ112_EN1 - Writing a 1 to REQ112_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ112_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ112_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ112_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ113_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ113_EN1_SHIFT (17U) -/*! REQ113_EN1 - Writing a 1 to REQ113_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ113_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ113_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ113_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ114_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ114_EN1_SHIFT (18U) -/*! REQ114_EN1 - Writing a 1 to REQ114_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ114_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ114_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ114_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ115_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ115_EN1_SHIFT (19U) -/*! REQ115_EN1 - Writing a 1 to REQ115_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ115_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ115_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ115_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ116_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ116_EN1_SHIFT (20U) -/*! REQ116_EN1 - Writing a 1 to REQ116_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ116_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ116_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ116_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ117_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ117_EN1_SHIFT (21U) -/*! REQ117_EN1 - Writing a 1 to REQ117_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ117_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ117_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ117_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ118_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ118_EN1_SHIFT (22U) -/*! REQ118_EN1 - Writing a 1 to REQ118_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ118_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ118_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ118_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ119_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ119_EN1_SHIFT (23U) -/*! REQ119_EN1 - Writing a 1 to REQ119_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ119_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ119_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ119_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ120_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ120_EN1_SHIFT (24U) -/*! REQ120_EN1 - Writing a 1 to REQ120_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ120_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ120_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ120_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ121_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ121_EN1_SHIFT (25U) -/*! REQ121_EN1 - Writing a 1 to REQ121_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ121_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ121_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ121_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE3_CLR - DMA1 Request Enable3 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ96_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ96_EN1_SHIFT (0U) -/*! REQ96_EN1 - Writing a 1 to REQ96_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ96_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ96_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ96_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ97_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ97_EN1_SHIFT (1U) -/*! REQ97_EN1 - Writing a 1 to REQ97_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ97_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ97_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ97_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ98_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ98_EN1_SHIFT (2U) -/*! REQ98_EN1 - Writing a 1 to REQ98_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ98_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ98_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ98_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ99_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ99_EN1_SHIFT (3U) -/*! REQ99_EN1 - Writing a 1 to REQ99_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ99_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ99_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ99_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ100_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ100_EN1_SHIFT (4U) -/*! REQ100_EN1 - Writing a 1 to REQ100_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ100_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ100_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ100_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ101_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ101_EN1_SHIFT (5U) -/*! REQ101_EN1 - Writing a 1 to REQ101_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ101_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ101_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ101_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ102_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ102_EN1_SHIFT (6U) -/*! REQ102_EN1 - Writing a 1 to REQ102_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ102_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ102_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ102_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ103_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ103_EN1_SHIFT (7U) -/*! REQ103_EN1 - Writing a 1 to REQ103_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ103_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ103_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ103_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ104_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ104_EN1_SHIFT (8U) -/*! REQ104_EN1 - Writing a 1 to REQ104_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ104_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ104_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ104_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ105_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ105_EN1_SHIFT (9U) -/*! REQ105_EN1 - Writing a 1 to REQ105_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ105_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ105_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ105_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ106_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ106_EN1_SHIFT (10U) -/*! REQ106_EN1 - Writing a 1 to REQ106_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ106_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ106_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ106_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ107_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ107_EN1_SHIFT (11U) -/*! REQ107_EN1 - Writing a 1 to REQ107_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ107_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ107_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ107_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ108_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ108_EN1_SHIFT (12U) -/*! REQ108_EN1 - Writing a 1 to REQ108_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ108_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ108_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ108_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ109_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ109_EN1_SHIFT (13U) -/*! REQ109_EN1 - Writing a 1 to REQ109_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ109_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ109_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ109_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ110_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ110_EN1_SHIFT (14U) -/*! REQ110_EN1 - Writing a 1 to REQ110_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ110_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ110_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ110_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ111_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ111_EN1_SHIFT (15U) -/*! REQ111_EN1 - Writing a 1 to REQ111_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ111_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ111_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ111_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ112_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ112_EN1_SHIFT (16U) -/*! REQ112_EN1 - Writing a 1 to REQ112_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ112_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ112_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ112_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ113_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ113_EN1_SHIFT (17U) -/*! REQ113_EN1 - Writing a 1 to REQ113_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ113_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ113_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ113_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ114_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ114_EN1_SHIFT (18U) -/*! REQ114_EN1 - Writing a 1 to REQ114_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ114_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ114_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ114_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ115_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ115_EN1_SHIFT (19U) -/*! REQ115_EN1 - Writing a 1 to REQ115_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ115_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ115_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ115_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ116_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ116_EN1_SHIFT (20U) -/*! REQ116_EN1 - Writing a 1 to REQ116_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ116_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ116_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ116_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ117_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ117_EN1_SHIFT (21U) -/*! REQ117_EN1 - Writing a 1 to REQ117_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ117_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ117_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ117_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ118_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ118_EN1_SHIFT (22U) -/*! REQ118_EN1 - Writing a 1 to REQ118_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ118_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ118_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ118_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ119_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ119_EN1_SHIFT (23U) -/*! REQ119_EN1 - Writing a 1 to REQ119_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ119_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ119_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ119_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ120_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ120_EN1_SHIFT (24U) -/*! REQ120_EN1 - Writing a 1 to REQ120_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ120_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ120_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ120_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ121_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ121_EN1_SHIFT (25U) -/*! REQ121_EN1 - Writing a 1 to REQ121_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3. */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ121_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ121_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ121_EN1_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group INPUTMUX_Register_Masks */ - - -/* INPUTMUX - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral INPUTMUX0 base address */ - #define INPUTMUX0_BASE (0x50006000u) - /** Peripheral INPUTMUX0 base address */ - #define INPUTMUX0_BASE_NS (0x40006000u) - /** Peripheral INPUTMUX0 base pointer */ - #define INPUTMUX0 ((INPUTMUX_Type *)INPUTMUX0_BASE) - /** Peripheral INPUTMUX0 base pointer */ - #define INPUTMUX0_NS ((INPUTMUX_Type *)INPUTMUX0_BASE_NS) - /** Array initializer of INPUTMUX peripheral base addresses */ - #define INPUTMUX_BASE_ADDRS { INPUTMUX0_BASE } - /** Array initializer of INPUTMUX peripheral base pointers */ - #define INPUTMUX_BASE_PTRS { INPUTMUX0 } - /** Array initializer of INPUTMUX peripheral base addresses */ - #define INPUTMUX_BASE_ADDRS_NS { INPUTMUX0_BASE_NS } - /** Array initializer of INPUTMUX peripheral base pointers */ - #define INPUTMUX_BASE_PTRS_NS { INPUTMUX0_NS } -#else - /** Peripheral INPUTMUX0 base address */ - #define INPUTMUX0_BASE (0x40006000u) - /** Peripheral INPUTMUX0 base pointer */ - #define INPUTMUX0 ((INPUTMUX_Type *)INPUTMUX0_BASE) - /** Array initializer of INPUTMUX peripheral base addresses */ - #define INPUTMUX_BASE_ADDRS { INPUTMUX0_BASE } - /** Array initializer of INPUTMUX peripheral base pointers */ - #define INPUTMUX_BASE_PTRS { INPUTMUX0 } -#endif -/* Backward compatibility for INPUTMUX */ -#define INPUTMUX INPUTMUX0 - - -/*! - * @} - */ /* end of group INPUTMUX_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- INTM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup INTM_Peripheral_Access_Layer INTM Peripheral Access Layer - * @{ - */ - -/** INTM - Register Layout Typedef */ -typedef struct { - __IO uint32_t INTM_MM; /**< Monitor Mode, offset: 0x0 */ - __O uint32_t INTM_IACK; /**< Interrupt Acknowledge, offset: 0x4 */ - struct { /* offset: 0x8, array step: 0x10 */ - __IO uint32_t INTM_IRQSEL; /**< Interrupt Request Select for Monitor 0..Interrupt Request Select for Monitor 3, array offset: 0x8, array step: 0x10 */ - __IO uint32_t INTM_LATENCY; /**< Interrupt Latency for Monitor 0..Interrupt Latency for Monitor 3, array offset: 0xC, array step: 0x10 */ - __IO uint32_t INTM_TIMER; /**< Timer for Monitor 0..Timer for Monitor 3, array offset: 0x10, array step: 0x10 */ - __I uint32_t INTM_STATUS; /**< Status for Monitor 0..Status for Monitor 3, array offset: 0x14, array step: 0x10 */ - } MON[4]; -} INTM_Type; - -/* ---------------------------------------------------------------------------- - -- INTM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup INTM_Register_Masks INTM Register Masks - * @{ - */ - -/*! @name INTM_MM - Monitor Mode */ -/*! @{ */ - -#define INTM_INTM_MM_MM_MASK (0x1U) -#define INTM_INTM_MM_MM_SHIFT (0U) -/*! MM - Monitor Mode - * 0b1..Enable - * 0b0..Disable - */ -#define INTM_INTM_MM_MM(x) (((uint32_t)(((uint32_t)(x)) << INTM_INTM_MM_MM_SHIFT)) & INTM_INTM_MM_MM_MASK) -/*! @} */ - -/*! @name INTM_IACK - Interrupt Acknowledge */ -/*! @{ */ - -#define INTM_INTM_IACK_IRQ_MASK (0x3FFU) -#define INTM_INTM_IACK_IRQ_SHIFT (0U) -/*! IRQ - Interrupt Request */ -#define INTM_INTM_IACK_IRQ(x) (((uint32_t)(((uint32_t)(x)) << INTM_INTM_IACK_IRQ_SHIFT)) & INTM_INTM_IACK_IRQ_MASK) -/*! @} */ - -/*! @name MON_INTM_IRQSEL - Interrupt Request Select for Monitor 0..Interrupt Request Select for Monitor 3 */ -/*! @{ */ - -#define INTM_MON_INTM_IRQSEL_IRQ_MASK (0x3FFU) -#define INTM_MON_INTM_IRQSEL_IRQ_SHIFT (0U) -/*! IRQ - Interrupt Request */ -#define INTM_MON_INTM_IRQSEL_IRQ(x) (((uint32_t)(((uint32_t)(x)) << INTM_MON_INTM_IRQSEL_IRQ_SHIFT)) & INTM_MON_INTM_IRQSEL_IRQ_MASK) -/*! @} */ - -/* The count of INTM_MON_INTM_IRQSEL */ -#define INTM_MON_INTM_IRQSEL_COUNT (4U) - -/*! @name MON_INTM_LATENCY - Interrupt Latency for Monitor 0..Interrupt Latency for Monitor 3 */ -/*! @{ */ - -#define INTM_MON_INTM_LATENCY_LAT_MASK (0xFFFFFFU) -#define INTM_MON_INTM_LATENCY_LAT_SHIFT (0U) -/*! LAT - Latency */ -#define INTM_MON_INTM_LATENCY_LAT(x) (((uint32_t)(((uint32_t)(x)) << INTM_MON_INTM_LATENCY_LAT_SHIFT)) & INTM_MON_INTM_LATENCY_LAT_MASK) -/*! @} */ - -/* The count of INTM_MON_INTM_LATENCY */ -#define INTM_MON_INTM_LATENCY_COUNT (4U) - -/*! @name MON_INTM_TIMER - Timer for Monitor 0..Timer for Monitor 3 */ -/*! @{ */ - -#define INTM_MON_INTM_TIMER_TIMER_MASK (0xFFFFFFU) -#define INTM_MON_INTM_TIMER_TIMER_SHIFT (0U) -/*! TIMER - Timer */ -#define INTM_MON_INTM_TIMER_TIMER(x) (((uint32_t)(((uint32_t)(x)) << INTM_MON_INTM_TIMER_TIMER_SHIFT)) & INTM_MON_INTM_TIMER_TIMER_MASK) -/*! @} */ - -/* The count of INTM_MON_INTM_TIMER */ -#define INTM_MON_INTM_TIMER_COUNT (4U) - -/*! @name MON_INTM_STATUS - Status for Monitor 0..Status for Monitor 3 */ -/*! @{ */ - -#define INTM_MON_INTM_STATUS_STATUS_MASK (0x1U) -#define INTM_MON_INTM_STATUS_STATUS_SHIFT (0U) -/*! STATUS - Monitor status - * 0b1..Exceeded - * 0b0..Did not exceed - */ -#define INTM_MON_INTM_STATUS_STATUS(x) (((uint32_t)(((uint32_t)(x)) << INTM_MON_INTM_STATUS_STATUS_SHIFT)) & INTM_MON_INTM_STATUS_STATUS_MASK) -/*! @} */ - -/* The count of INTM_MON_INTM_STATUS */ -#define INTM_MON_INTM_STATUS_COUNT (4U) - - -/*! - * @} - */ /* end of group INTM_Register_Masks */ - - -/* INTM - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral INTM0 base address */ - #define INTM0_BASE (0x5005D000u) - /** Peripheral INTM0 base address */ - #define INTM0_BASE_NS (0x4005D000u) - /** Peripheral INTM0 base pointer */ - #define INTM0 ((INTM_Type *)INTM0_BASE) - /** Peripheral INTM0 base pointer */ - #define INTM0_NS ((INTM_Type *)INTM0_BASE_NS) - /** Array initializer of INTM peripheral base addresses */ - #define INTM_BASE_ADDRS { INTM0_BASE } - /** Array initializer of INTM peripheral base pointers */ - #define INTM_BASE_PTRS { INTM0 } - /** Array initializer of INTM peripheral base addresses */ - #define INTM_BASE_ADDRS_NS { INTM0_BASE_NS } - /** Array initializer of INTM peripheral base pointers */ - #define INTM_BASE_PTRS_NS { INTM0_NS } -#else - /** Peripheral INTM0 base address */ - #define INTM0_BASE (0x4005D000u) - /** Peripheral INTM0 base pointer */ - #define INTM0 ((INTM_Type *)INTM0_BASE) - /** Array initializer of INTM peripheral base addresses */ - #define INTM_BASE_ADDRS { INTM0_BASE } - /** Array initializer of INTM peripheral base pointers */ - #define INTM_BASE_PTRS { INTM0 } -#endif - -/*! - * @} - */ /* end of group INTM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- ITRC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ITRC_Peripheral_Access_Layer ITRC Peripheral Access Layer - * @{ - */ - -/** ITRC - Register Layout Typedef */ -typedef struct { - __IO uint32_t STATUS; /**< ITRC outputs and IN0 to IN15 Status, offset: 0x0 */ - __IO uint32_t STATUS1; /**< ITRC IN16 to IN47 Status, offset: 0x4 */ - __IO uint32_t OUT_SEL[7][2]; /**< Trigger Source IN0 to IN15 selector, array offset: 0x8, array step: index*0x8, index2*0x4 */ - uint8_t RESERVED_0[8]; - __IO uint32_t OUT_SEL_1[7][2]; /**< Trigger Source IN16 to IN31 selector, array offset: 0x48, array step: index*0x8, index2*0x4 */ - uint8_t RESERVED_1[8]; - __IO uint32_t OUT_SEL_2[7][2]; /**< Trigger source IN32 to IN47 selector, array offset: 0x88, array step: index*0x8, index2*0x4 */ - uint8_t RESERVED_2[48]; - __O uint32_t SW_EVENT0; /**< Software event 0, offset: 0xF0 */ - __O uint32_t SW_EVENT1; /**< Software event 1, offset: 0xF4 */ -} ITRC_Type; - -/* ---------------------------------------------------------------------------- - -- ITRC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ITRC_Register_Masks ITRC Register Masks - * @{ - */ - -/*! @name STATUS - ITRC outputs and IN0 to IN15 Status */ -/*! @{ */ - -#define ITRC_STATUS_IN0_STATUS_MASK (0x1U) -#define ITRC_STATUS_IN0_STATUS_SHIFT (0U) -/*! IN0_STATUS - GDET0 & 1 interrupt. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN0_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN0_STATUS_SHIFT)) & ITRC_STATUS_IN0_STATUS_MASK) - -#define ITRC_STATUS_IN1_STATUS_MASK (0x2U) -#define ITRC_STATUS_IN1_STATUS_SHIFT (1U) -/*! IN1_STATUS - TDET tamper output. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN1_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN1_STATUS_SHIFT)) & ITRC_STATUS_IN1_STATUS_MASK) - -#define ITRC_STATUS_IN2_STATUS_MASK (0x4U) -#define ITRC_STATUS_IN2_STATUS_SHIFT (2U) -/*! IN2_STATUS - Code Watchdog 0 interrupt. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN2_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN2_STATUS_SHIFT)) & ITRC_STATUS_IN2_STATUS_MASK) - -#define ITRC_STATUS_IN3_STATUS_MASK (0x8U) -#define ITRC_STATUS_IN3_STATUS_SHIFT (3U) -/*! IN3_STATUS - VBAT volt tamper output. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN3_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN3_STATUS_SHIFT)) & ITRC_STATUS_IN3_STATUS_MASK) - -#define ITRC_STATUS_IN4_STATUS_MASK (0x10U) -#define ITRC_STATUS_IN4_STATUS_SHIFT (4U) -/*! IN4_STATUS - SPC VDD_CORE_LVD detect. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN4_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN4_STATUS_SHIFT)) & ITRC_STATUS_IN4_STATUS_MASK) - -#define ITRC_STATUS_IN5_STATUS_MASK (0x20U) -#define ITRC_STATUS_IN5_STATUS_SHIFT (5U) -/*! IN5_STATUS - Watch Dog timer event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN5_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN5_STATUS_SHIFT)) & ITRC_STATUS_IN5_STATUS_MASK) - -#define ITRC_STATUS_IN6_STATUS_MASK (0x40U) -#define ITRC_STATUS_IN6_STATUS_SHIFT (6U) -/*! IN6_STATUS - Flash ECC mismatch event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN6_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN6_STATUS_SHIFT)) & ITRC_STATUS_IN6_STATUS_MASK) - -#define ITRC_STATUS_IN7_STATUS_MASK (0x80U) -#define ITRC_STATUS_IN7_STATUS_SHIFT (7U) -/*! IN7_STATUS - AHB secure bus checkers detected illegal access. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN7_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN7_STATUS_SHIFT)) & ITRC_STATUS_IN7_STATUS_MASK) - -#define ITRC_STATUS_IN8_STATUS_MASK (0x100U) -#define ITRC_STATUS_IN8_STATUS_SHIFT (8U) -/*! IN8_STATUS - ELS error event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN8_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN8_STATUS_SHIFT)) & ITRC_STATUS_IN8_STATUS_MASK) - -#define ITRC_STATUS_IN9_STATUS_MASK (0x200U) -#define ITRC_STATUS_IN9_STATUS_SHIFT (9U) -/*! IN9_STATUS - SPC VDD_CORE glitch detect event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN9_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN9_STATUS_SHIFT)) & ITRC_STATUS_IN9_STATUS_MASK) - -#define ITRC_STATUS_IN10_STATUS_MASK (0x400U) -#define ITRC_STATUS_IN10_STATUS_SHIFT (10U) -/*! IN10_STATUS - PKC module detected an error event. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN10_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN10_STATUS_SHIFT)) & ITRC_STATUS_IN10_STATUS_MASK) - -#define ITRC_STATUS_IN11_STATUS_MASK (0x800U) -#define ITRC_STATUS_IN11_STATUS_SHIFT (11U) -/*! IN11_STATUS - Code Watchdog 1 interrupt. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN11_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN11_STATUS_SHIFT)) & ITRC_STATUS_IN11_STATUS_MASK) - -#define ITRC_STATUS_IN112_STATUS_MASK (0x1000U) -#define ITRC_STATUS_IN112_STATUS_SHIFT (12U) -/*! IN112_STATUS - Watchdog 1 timer event interrupt. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN112_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN112_STATUS_SHIFT)) & ITRC_STATUS_IN112_STATUS_MASK) - -#define ITRC_STATUS_IN113_STATUS_MASK (0x2000U) -#define ITRC_STATUS_IN113_STATUS_SHIFT (13U) -/*! IN113_STATUS - FREQME out of range status output. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN113_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN113_STATUS_SHIFT)) & ITRC_STATUS_IN113_STATUS_MASK) - -#define ITRC_STATUS_IN14_STATUS_MASK (0x4000U) -#define ITRC_STATUS_IN14_STATUS_SHIFT (14U) -/*! IN14_STATUS - Software event 0 occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN14_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN14_STATUS_SHIFT)) & ITRC_STATUS_IN14_STATUS_MASK) - -#define ITRC_STATUS_IN15_STATUS_MASK (0x8000U) -#define ITRC_STATUS_IN15_STATUS_SHIFT (15U) -/*! IN15_STATUS - Software event 1 occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN15_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN15_STATUS_SHIFT)) & ITRC_STATUS_IN15_STATUS_MASK) - -#define ITRC_STATUS_OUT0_STATUS_MASK (0x10000U) -#define ITRC_STATUS_OUT0_STATUS_SHIFT (16U) -/*! OUT0_STATUS - ITRC triggered ITRC_IRQ output. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_OUT0_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_OUT0_STATUS_SHIFT)) & ITRC_STATUS_OUT0_STATUS_MASK) - -#define ITRC_STATUS_OUT1_STATUS_MASK (0x20000U) -#define ITRC_STATUS_OUT1_STATUS_SHIFT (17U) -/*! OUT1_STATUS - ITRC triggered ELS_RESET to clear ELS key store. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_OUT1_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_OUT1_STATUS_SHIFT)) & ITRC_STATUS_OUT1_STATUS_MASK) - -#define ITRC_STATUS_OUT2_STATUS_MASK (0x40000U) -#define ITRC_STATUS_OUT2_STATUS_SHIFT (18U) -/*! OUT2_STATUS - ITRC triggered PUF_ZEROIZE to clear PUF key store and RAM. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_OUT2_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_OUT2_STATUS_SHIFT)) & ITRC_STATUS_OUT2_STATUS_MASK) - -#define ITRC_STATUS_OUT3_STATUS_MASK (0x80000U) -#define ITRC_STATUS_OUT3_STATUS_SHIFT (19U) -/*! OUT3_STATUS - ITRC triggered RAM_ZEROIZE. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_OUT3_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_OUT3_STATUS_SHIFT)) & ITRC_STATUS_OUT3_STATUS_MASK) - -#define ITRC_STATUS_OUT4_STATUS_MASK (0x100000U) -#define ITRC_STATUS_OUT4_STATUS_SHIFT (20U) -/*! OUT4_STATUS - ITRC triggered CHIP_RESET to reset the chip after all other response process finished. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_OUT4_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_OUT4_STATUS_SHIFT)) & ITRC_STATUS_OUT4_STATUS_MASK) - -#define ITRC_STATUS_OUT5_STATUS_MASK (0x200000U) -#define ITRC_STATUS_OUT5_STATUS_SHIFT (21U) -/*! OUT5_STATUS - ITRC triggered TMPR_OUT0 internal signal connected to various on-chip multiplexers. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_OUT5_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_OUT5_STATUS_SHIFT)) & ITRC_STATUS_OUT5_STATUS_MASK) - -#define ITRC_STATUS_OUT6_STATUS_MASK (0x400000U) -#define ITRC_STATUS_OUT6_STATUS_SHIFT (22U) -/*! OUT6_STATUS - ITRC triggered TMPR_OUT1 internal signal connected to various on-chip multiplexers. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_OUT6_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_OUT6_STATUS_SHIFT)) & ITRC_STATUS_OUT6_STATUS_MASK) -/*! @} */ - -/*! @name STATUS1 - ITRC IN16 to IN47 Status */ -/*! @{ */ - -#define ITRC_STATUS1_IN16_STATUS_MASK (0x1U) -#define ITRC_STATUS1_IN16_STATUS_SHIFT (0U) -/*! IN16_STATUS - SSPC VDD_SYS_LVD detect event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN16_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN16_STATUS_SHIFT)) & ITRC_STATUS1_IN16_STATUS_MASK) - -#define ITRC_STATUS1_IN17_STATUS_MASK (0x2U) -#define ITRC_STATUS1_IN17_STATUS_SHIFT (1U) -/*! IN17_STATUS - SPC VDD_IO_LVD detect event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN17_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN17_STATUS_SHIFT)) & ITRC_STATUS1_IN17_STATUS_MASK) - -#define ITRC_STATUS1_IN18_STATUS_MASK (0x4U) -#define ITRC_STATUS1_IN18_STATUS_SHIFT (2U) -/*! IN18_STATUS - Reserved - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN18_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN18_STATUS_SHIFT)) & ITRC_STATUS1_IN18_STATUS_MASK) - -#define ITRC_STATUS1_IN19_STATUS_MASK (0x8U) -#define ITRC_STATUS1_IN19_STATUS_SHIFT (3U) -/*! IN19_STATUS - Reserved - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN19_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN19_STATUS_SHIFT)) & ITRC_STATUS1_IN19_STATUS_MASK) - -#define ITRC_STATUS1_IN20_STATUS_MASK (0x10U) -#define ITRC_STATUS1_IN20_STATUS_SHIFT (4U) -/*! IN20_STATUS - VBAT clock tamper output event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN20_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN20_STATUS_SHIFT)) & ITRC_STATUS1_IN20_STATUS_MASK) - -#define ITRC_STATUS1_IN24_21_STATUS_MASK (0x1E0U) -#define ITRC_STATUS1_IN24_21_STATUS_SHIFT (5U) -/*! IN24_21_STATUS - INTM interrupt monitor error 3~0 event occurred. - * 0b0000..Output not triggered. - * 0b0001..Output has been triggered. - */ -#define ITRC_STATUS1_IN24_21_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN24_21_STATUS_SHIFT)) & ITRC_STATUS1_IN24_21_STATUS_MASK) - -#define ITRC_STATUS1_IN32_25_STATUS_MASK (0x1FE00U) -#define ITRC_STATUS1_IN32_25_STATUS_SHIFT (9U) -/*! IN32_25_STATUS - MSF SOCTRIM 7~0 ECC error event occurred. - * 0b00000000..Output not triggered. - * 0b00000001..Output has been triggered. - */ -#define ITRC_STATUS1_IN32_25_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN32_25_STATUS_SHIFT)) & ITRC_STATUS1_IN32_25_STATUS_MASK) - -#define ITRC_STATUS1_IN33_STATUS_MASK (0x20000U) -#define ITRC_STATUS1_IN33_STATUS_SHIFT (17U) -/*! IN33_STATUS - GDET0/1 SFR error event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN33_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN33_STATUS_SHIFT)) & ITRC_STATUS1_IN33_STATUS_MASK) - -#define ITRC_STATUS1_IN34_STATUS_MASK (0x40000U) -#define ITRC_STATUS1_IN34_STATUS_SHIFT (18U) -/*! IN34_STATUS - SPC VDD_CORE high voltage detect event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN34_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN34_STATUS_SHIFT)) & ITRC_STATUS1_IN34_STATUS_MASK) - -#define ITRC_STATUS1_IN35_STATUS_MASK (0x80000U) -#define ITRC_STATUS1_IN35_STATUS_SHIFT (19U) -/*! IN35_STATUS - SPC VDD_SYS_HVD high voltage detect event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN35_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN35_STATUS_SHIFT)) & ITRC_STATUS1_IN35_STATUS_MASK) - -#define ITRC_STATUS1_IN36_STATUS_MASK (0x100000U) -#define ITRC_STATUS1_IN36_STATUS_SHIFT (20U) -/*! IN36_STATUS - SPC VDD_IO high voltage detect event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN36_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN36_STATUS_SHIFT)) & ITRC_STATUS1_IN36_STATUS_MASK) - -#define ITRC_STATUS1_IN37_STATUS_MASK (0x200000U) -#define ITRC_STATUS1_IN37_STATUS_SHIFT (21U) -/*! IN37_STATUS - FLEXSPI GCM error event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN37_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN37_STATUS_SHIFT)) & ITRC_STATUS1_IN37_STATUS_MASK) - -#define ITRC_STATUS1_IN46_STATUS_MASK (0x40000000U) -#define ITRC_STATUS1_IN46_STATUS_SHIFT (30U) -/*! IN46_STATUS - SM3 SGI error event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN46_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN46_STATUS_SHIFT)) & ITRC_STATUS1_IN46_STATUS_MASK) - -#define ITRC_STATUS1_IN47_STATUS_MASK (0x80000000U) -#define ITRC_STATUS1_IN47_STATUS_SHIFT (31U) -/*! IN47_STATUS - TRNG HW error event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN47_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN47_STATUS_SHIFT)) & ITRC_STATUS1_IN47_STATUS_MASK) -/*! @} */ - -/*! @name OUTX_SEL_OUTX_SELY_OUT_SEL - Trigger Source IN0 to IN15 selector */ -/*! @{ */ - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN0_SELn_MASK (0x3U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN0_SELn_SHIFT (0U) -/*! IN0_SELn - Selects digital glitch detector as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN0_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN0_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN0_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN1_SELn_MASK (0xCU) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN1_SELn_SHIFT (2U) -/*! IN1_SELn - Selects TDET event as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN1_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN1_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN1_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN2_SELn_MASK (0x30U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN2_SELn_SHIFT (4U) -/*! IN2_SELn - Selects Code Watchdog 0 event as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN2_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN2_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN2_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN3_SELn_MASK (0xC0U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN3_SELn_SHIFT (6U) -/*! IN3_SELn - Selects VBAT voltage tamper event as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN3_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN3_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN3_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN4_SELn_MASK (0x300U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN4_SELn_SHIFT (8U) -/*! IN4_SELn - Selects low-voltage event on VDD_CORE rail as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN4_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN4_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN4_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN5_SELn_MASK (0xC00U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN5_SELn_SHIFT (10U) -/*! IN5_SELn - Selects Watchdog 0 timer event as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN5_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN5_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN5_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN6_SELn_MASK (0x3000U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN6_SELn_SHIFT (12U) -/*! IN6_SELn - Selects Flash ECC mismatch event as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN6_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN6_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN6_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN7_SELn_MASK (0xC000U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN7_SELn_SHIFT (14U) -/*! IN7_SELn - Selects AHB secure bus or MBC bus illegal access event as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN7_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN7_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN7_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN8_SELn_MASK (0x30000U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN8_SELn_SHIFT (16U) -/*! IN8_SELn - Selects ELS error event as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN8_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN8_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN8_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN9_SELn_MASK (0xC0000U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN9_SELn_SHIFT (18U) -/*! IN9_SELn - Selects SPC VDD_CORE glitch detector as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN9_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN9_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN9_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN10_SELn_MASK (0x300000U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN10_SELn_SHIFT (20U) -/*! IN10_SELn - Selects PKC error event as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN10_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN10_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN10_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN11_SELn_MASK (0xC00000U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN11_SELn_SHIFT (22U) -/*! IN11_SELn - Selects Code Watchdog 1 event as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN11_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN11_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN11_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN12_SELn_MASK (0x3000000U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN12_SELn_SHIFT (24U) -/*! IN12_SELn - Selects Watchdog 1 timer event as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN12_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN12_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN12_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN13_SELn_MASK (0xC000000U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN13_SELn_SHIFT (26U) -/*! IN13_SELn - Selects FREQME out of range status output as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN13_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN13_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN13_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN14_SELn_MASK (0x30000000U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN14_SELn_SHIFT (28U) -/*! IN14_SELn - Selects software event 0 as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN14_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN14_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN14_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN15_SELn_MASK (0xC0000000U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN15_SELn_SHIFT (30U) -/*! IN15_SELn - Selects software event 1 as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN15_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN15_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN15_SELn_MASK) -/*! @} */ - -/* The count of ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_COUNT (7U) - -/* The count of ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_COUNT2 (2U) - -/*! @name OUTX_SEL_1_OUTX_SELY_OUT_SEL_1 - Trigger Source IN16 to IN31 selector */ -/*! @{ */ - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN16_SELn_MASK (0x3U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN16_SELn_SHIFT (0U) -/*! IN16_SELn - Selects SPC VDD_SYS_LVD detect as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN16_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN16_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN16_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN17_SELn_MASK (0xCU) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN17_SELn_SHIFT (2U) -/*! IN17_SELn - Selects SPC VDD_IO_LVD detect as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN17_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN17_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN17_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN18_SELn_MASK (0x30U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN18_SELn_SHIFT (4U) -/*! IN18_SELn - Reserved. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN18_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN18_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN18_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN19_SELn_MASK (0xC0U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN19_SELn_SHIFT (6U) -/*! IN19_SELn - Selects VBAT temperature tamper output event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN19_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN19_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN19_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN20_SELn_MASK (0x300U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN20_SELn_SHIFT (8U) -/*! IN20_SELn - Selects VBAT clock tamper output event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN20_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN20_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN20_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN21_SELn_MASK (0xC00U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN21_SELn_SHIFT (10U) -/*! IN21_SELn - Selects INTM interrupt monitor error 0 event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN21_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN21_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN21_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN22_SELn_MASK (0x3000U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN22_SELn_SHIFT (12U) -/*! IN22_SELn - Selects INTM interrupt monitor error 1 event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN22_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN22_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN22_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN23_SELn_MASK (0xC000U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN23_SELn_SHIFT (14U) -/*! IN23_SELn - Selects INTM interrupt monitor error 2 event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN23_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN23_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN23_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN24_SELn_MASK (0x30000U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN24_SELn_SHIFT (16U) -/*! IN24_SELn - Selects INTM interrupt monitor error 3 event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN24_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN24_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN24_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN25_SELn_MASK (0xC0000U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN25_SELn_SHIFT (18U) -/*! IN25_SELn - Selects MSF SOCTRIM 0 ECC error event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN25_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN25_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN25_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN26_SELn_MASK (0x300000U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN26_SELn_SHIFT (20U) -/*! IN26_SELn - Selects MSF SOCTRIM 1 ECC error event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN26_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN26_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN26_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN27_SELn_MASK (0xC00000U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN27_SELn_SHIFT (22U) -/*! IN27_SELn - Selects MSF SOCTRIM 2 ECC error event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN27_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN27_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN27_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN28_SELn_MASK (0x3000000U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN28_SELn_SHIFT (24U) -/*! IN28_SELn - Selects MSF SOCTRIM 3 ECC error event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN28_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN28_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN28_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN29_SELn_MASK (0xC000000U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN29_SELn_SHIFT (26U) -/*! IN29_SELn - Selects MSF SOCTRIM 4 ECC error event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN29_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN29_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN29_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN30_SELn_MASK (0x30000000U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN30_SELn_SHIFT (28U) -/*! IN30_SELn - Selects MSF SOCTRIM 5 ECC error event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN30_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN30_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN30_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN31_SELn_MASK (0xC0000000U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN31_SELn_SHIFT (30U) -/*! IN31_SELn - Selects MSF SOCTRIM 6 ECC error event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN31_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN31_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN31_SELn_MASK) -/*! @} */ - -/* The count of ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1 */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_COUNT (7U) - -/* The count of ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1 */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_COUNT2 (2U) - -/*! @name OUTX_SEL_2_OUTX_SELY_OUT_SEL_2 - Trigger source IN32 to IN47 selector */ -/*! @{ */ - -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN32_SELn_MASK (0x3U) -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN32_SELn_SHIFT (0U) -/*! IN32_SELn - Selects MSF SOCTRIM 7 ECC error event as a trigger source. */ -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN32_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN32_SELn_SHIFT)) & ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN32_SELn_MASK) - -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN33_SELn_MASK (0xCU) -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN33_SELn_SHIFT (2U) -/*! IN33_SELn - Selects GDET0 & 1 SFR error detect as a trigger source. */ -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN33_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN33_SELn_SHIFT)) & ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN33_SELn_MASK) - -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN34_SELn_MASK (0x30U) -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN34_SELn_SHIFT (4U) -/*! IN34_SELn - Selects SPC VDD_CORE_HVD as a trigger source. */ -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN34_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN34_SELn_SHIFT)) & ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN34_SELn_MASK) - -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN35_SELn_MASK (0xC0U) -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN35_SELn_SHIFT (6U) -/*! IN35_SELn - Selects VDD_SYS_HVD as a trigger source. */ -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN35_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN35_SELn_SHIFT)) & ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN35_SELn_MASK) - -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN36_SELn_MASK (0x300U) -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN36_SELn_SHIFT (8U) -/*! IN36_SELn - Selects VDD_IO_HVD as a trigger source. */ -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN36_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN36_SELn_SHIFT)) & ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN36_SELn_MASK) - -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN37_SELn_MASK (0xC00U) -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN37_SELn_SHIFT (10U) -/*! IN37_SELn - Selects FLEXSPI GCM error as a trigger source. */ -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN37_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN37_SELn_SHIFT)) & ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN37_SELn_MASK) - -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN46_SELn_MASK (0x30000000U) -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN46_SELn_SHIFT (28U) -/*! IN46_SELn - Selects SM3 SGI error as a trigger source. */ -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN46_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN46_SELn_SHIFT)) & ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN46_SELn_MASK) - -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN47_SELn_MASK (0xC0000000U) -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN47_SELn_SHIFT (30U) -/*! IN47_SELn - Selects TRNG HW Error as a trigger source. */ -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN47_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN47_SELn_SHIFT)) & ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN47_SELn_MASK) -/*! @} */ - -/* The count of ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2 */ -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_COUNT (7U) - -/* The count of ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2 */ -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_COUNT2 (2U) - -/*! @name SW_EVENT0 - Software event 0 */ -/*! @{ */ - -#define ITRC_SW_EVENT0_TRIGGER_SW_EVENT_0_MASK (0xFFFFFFFFU) -#define ITRC_SW_EVENT0_TRIGGER_SW_EVENT_0_SHIFT (0U) -/*! TRIGGER_SW_EVENT_0 - Trigger software event 0. */ -#define ITRC_SW_EVENT0_TRIGGER_SW_EVENT_0(x) (((uint32_t)(((uint32_t)(x)) << ITRC_SW_EVENT0_TRIGGER_SW_EVENT_0_SHIFT)) & ITRC_SW_EVENT0_TRIGGER_SW_EVENT_0_MASK) -/*! @} */ - -/*! @name SW_EVENT1 - Software event 1 */ -/*! @{ */ - -#define ITRC_SW_EVENT1_TRIGGER_SW_EVENT_1_MASK (0xFFFFFFFFU) -#define ITRC_SW_EVENT1_TRIGGER_SW_EVENT_1_SHIFT (0U) -/*! TRIGGER_SW_EVENT_1 - Trigger software event 1. */ -#define ITRC_SW_EVENT1_TRIGGER_SW_EVENT_1(x) (((uint32_t)(((uint32_t)(x)) << ITRC_SW_EVENT1_TRIGGER_SW_EVENT_1_SHIFT)) & ITRC_SW_EVENT1_TRIGGER_SW_EVENT_1_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group ITRC_Register_Masks */ - - -/* ITRC - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral ITRC0 base address */ - #define ITRC0_BASE (0x50026000u) - /** Peripheral ITRC0 base address */ - #define ITRC0_BASE_NS (0x40026000u) - /** Peripheral ITRC0 base pointer */ - #define ITRC0 ((ITRC_Type *)ITRC0_BASE) - /** Peripheral ITRC0 base pointer */ - #define ITRC0_NS ((ITRC_Type *)ITRC0_BASE_NS) - /** Array initializer of ITRC peripheral base addresses */ - #define ITRC_BASE_ADDRS { ITRC0_BASE } - /** Array initializer of ITRC peripheral base pointers */ - #define ITRC_BASE_PTRS { ITRC0 } - /** Array initializer of ITRC peripheral base addresses */ - #define ITRC_BASE_ADDRS_NS { ITRC0_BASE_NS } - /** Array initializer of ITRC peripheral base pointers */ - #define ITRC_BASE_PTRS_NS { ITRC0_NS } -#else - /** Peripheral ITRC0 base address */ - #define ITRC0_BASE (0x40026000u) - /** Peripheral ITRC0 base pointer */ - #define ITRC0 ((ITRC_Type *)ITRC0_BASE) - /** Array initializer of ITRC peripheral base addresses */ - #define ITRC_BASE_ADDRS { ITRC0_BASE } - /** Array initializer of ITRC peripheral base pointers */ - #define ITRC_BASE_PTRS { ITRC0 } -#endif - -/*! - * @} - */ /* end of group ITRC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LPCMP Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPCMP_Peripheral_Access_Layer LPCMP Peripheral Access Layer - * @{ - */ - -/** LPCMP - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - __IO uint32_t CCR0; /**< Comparator Control Register 0, offset: 0x8 */ - __IO uint32_t CCR1; /**< Comparator Control Register 1, offset: 0xC */ - __IO uint32_t CCR2; /**< Comparator Control Register 2, offset: 0x10 */ - uint8_t RESERVED_0[4]; - __IO uint32_t DCR; /**< DAC Control, offset: 0x18 */ - __IO uint32_t IER; /**< Interrupt Enable, offset: 0x1C */ - __IO uint32_t CSR; /**< Comparator Status, offset: 0x20 */ - __IO uint32_t RRCR0; /**< Round Robin Control Register 0, offset: 0x24 */ - __IO uint32_t RRCR1; /**< Round Robin Control Register 1, offset: 0x28 */ - __IO uint32_t RRCSR; /**< Round Robin Control and Status, offset: 0x2C */ - __IO uint32_t RRSR; /**< Round Robin Status, offset: 0x30 */ - uint8_t RESERVED_1[4]; - __IO uint32_t RRCR2; /**< Round Robin Control Register 2, offset: 0x38 */ -} LPCMP_Type; - -/* ---------------------------------------------------------------------------- - -- LPCMP Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPCMP_Register_Masks LPCMP Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define LPCMP_VERID_FEATURE_MASK (0xFFFFU) -#define LPCMP_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000001..Round robin feature - */ -#define LPCMP_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_VERID_FEATURE_SHIFT)) & LPCMP_VERID_FEATURE_MASK) - -#define LPCMP_VERID_MINOR_MASK (0xFF0000U) -#define LPCMP_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define LPCMP_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_VERID_MINOR_SHIFT)) & LPCMP_VERID_MINOR_MASK) - -#define LPCMP_VERID_MAJOR_MASK (0xFF000000U) -#define LPCMP_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define LPCMP_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_VERID_MAJOR_SHIFT)) & LPCMP_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define LPCMP_PARAM_DAC_RES_MASK (0xFU) -#define LPCMP_PARAM_DAC_RES_SHIFT (0U) -/*! DAC_RES - DAC Resolution - * 0b0000..4-bit DAC - * 0b0001..6-bit DAC - * 0b0010..8-bit DAC - * 0b0011..10-bit DAC - * 0b0100..12-bit DAC - * 0b0101..14-bit DAC - * 0b0110..16-bit DAC - */ -#define LPCMP_PARAM_DAC_RES(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_PARAM_DAC_RES_SHIFT)) & LPCMP_PARAM_DAC_RES_MASK) -/*! @} */ - -/*! @name CCR0 - Comparator Control Register 0 */ -/*! @{ */ - -#define LPCMP_CCR0_CMP_EN_MASK (0x1U) -#define LPCMP_CCR0_CMP_EN_SHIFT (0U) -/*! CMP_EN - Comparator Enable - * 0b0..Disable (The analog logic remains off and consumes no power.) - * 0b1..Enable - */ -#define LPCMP_CCR0_CMP_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR0_CMP_EN_SHIFT)) & LPCMP_CCR0_CMP_EN_MASK) - -#define LPCMP_CCR0_CMP_STOP_EN_MASK (0x2U) -#define LPCMP_CCR0_CMP_STOP_EN_SHIFT (1U) -/*! CMP_STOP_EN - Comparator Deep sleep Mode Enable - * 0b0..Disables the analog comparator regardless of CMP_EN. - * 0b1..Allows CMP_EN to enable the analog comparator. - */ -#define LPCMP_CCR0_CMP_STOP_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR0_CMP_STOP_EN_SHIFT)) & LPCMP_CCR0_CMP_STOP_EN_MASK) -/*! @} */ - -/*! @name CCR1 - Comparator Control Register 1 */ -/*! @{ */ - -#define LPCMP_CCR1_WINDOW_EN_MASK (0x1U) -#define LPCMP_CCR1_WINDOW_EN_SHIFT (0U) -/*! WINDOW_EN - Windowing Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPCMP_CCR1_WINDOW_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_WINDOW_EN_SHIFT)) & LPCMP_CCR1_WINDOW_EN_MASK) - -#define LPCMP_CCR1_SAMPLE_EN_MASK (0x2U) -#define LPCMP_CCR1_SAMPLE_EN_SHIFT (1U) -/*! SAMPLE_EN - Sampling Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPCMP_CCR1_SAMPLE_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_SAMPLE_EN_SHIFT)) & LPCMP_CCR1_SAMPLE_EN_MASK) - -#define LPCMP_CCR1_DMA_EN_MASK (0x4U) -#define LPCMP_CCR1_DMA_EN_SHIFT (2U) -/*! DMA_EN - DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPCMP_CCR1_DMA_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_DMA_EN_SHIFT)) & LPCMP_CCR1_DMA_EN_MASK) - -#define LPCMP_CCR1_COUT_INV_MASK (0x8U) -#define LPCMP_CCR1_COUT_INV_SHIFT (3U) -/*! COUT_INV - Comparator Invert - * 0b0..Do not invert - * 0b1..Invert - */ -#define LPCMP_CCR1_COUT_INV(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_COUT_INV_SHIFT)) & LPCMP_CCR1_COUT_INV_MASK) - -#define LPCMP_CCR1_COUT_SEL_MASK (0x10U) -#define LPCMP_CCR1_COUT_SEL_SHIFT (4U) -/*! COUT_SEL - Comparator Output Select - * 0b0..Use COUT (filtered) - * 0b1..Use COUTA (unfiltered) - */ -#define LPCMP_CCR1_COUT_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_COUT_SEL_SHIFT)) & LPCMP_CCR1_COUT_SEL_MASK) - -#define LPCMP_CCR1_COUT_PEN_MASK (0x20U) -#define LPCMP_CCR1_COUT_PEN_SHIFT (5U) -/*! COUT_PEN - Comparator Output Pin Enable - * 0b0..Not available - * 0b1..Available - */ -#define LPCMP_CCR1_COUT_PEN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_COUT_PEN_SHIFT)) & LPCMP_CCR1_COUT_PEN_MASK) - -#define LPCMP_CCR1_COUTA_OWEN_MASK (0x40U) -#define LPCMP_CCR1_COUTA_OWEN_SHIFT (6U) -/*! COUTA_OWEN - COUTA_OW Enable - * 0b0..COUTA holds the last sampled value. - * 0b1..Enables the COUTA signal value to be defined by COUTA_OW. - */ -#define LPCMP_CCR1_COUTA_OWEN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_COUTA_OWEN_SHIFT)) & LPCMP_CCR1_COUTA_OWEN_MASK) - -#define LPCMP_CCR1_COUTA_OW_MASK (0x80U) -#define LPCMP_CCR1_COUTA_OW_SHIFT (7U) -/*! COUTA_OW - COUTA Output Level for Closed Window - * 0b0..COUTA is 0 - * 0b1..COUTA is 1 - */ -#define LPCMP_CCR1_COUTA_OW(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_COUTA_OW_SHIFT)) & LPCMP_CCR1_COUTA_OW_MASK) - -#define LPCMP_CCR1_WINDOW_INV_MASK (0x100U) -#define LPCMP_CCR1_WINDOW_INV_SHIFT (8U) -/*! WINDOW_INV - WINDOW/SAMPLE Signal Invert - * 0b0..Do not invert - * 0b1..Invert - */ -#define LPCMP_CCR1_WINDOW_INV(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_WINDOW_INV_SHIFT)) & LPCMP_CCR1_WINDOW_INV_MASK) - -#define LPCMP_CCR1_WINDOW_CLS_MASK (0x200U) -#define LPCMP_CCR1_WINDOW_CLS_SHIFT (9U) -/*! WINDOW_CLS - COUT Event Window Close - * 0b0..COUT event cannot close the window - * 0b1..COUT event can close the window - */ -#define LPCMP_CCR1_WINDOW_CLS(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_WINDOW_CLS_SHIFT)) & LPCMP_CCR1_WINDOW_CLS_MASK) - -#define LPCMP_CCR1_EVT_SEL_MASK (0xC00U) -#define LPCMP_CCR1_EVT_SEL_SHIFT (10U) -/*! EVT_SEL - COUT Event Select - * 0b00..Rising edge - * 0b01..Falling edge - * 0b1x..Both edges - */ -#define LPCMP_CCR1_EVT_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_EVT_SEL_SHIFT)) & LPCMP_CCR1_EVT_SEL_MASK) - -#define LPCMP_CCR1_FUNC_CLK_SEL_MASK (0x3000U) -#define LPCMP_CCR1_FUNC_CLK_SEL_SHIFT (12U) -/*! FUNC_CLK_SEL - Functional Clock Source Select - * 0b00..Select functional clock source 0 - * 0b01..Select functional clock source 1 - * 0b10..Select functional clock source 2 - * 0b11..Select functional clock source 3 - */ -#define LPCMP_CCR1_FUNC_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_FUNC_CLK_SEL_SHIFT)) & LPCMP_CCR1_FUNC_CLK_SEL_MASK) - -#define LPCMP_CCR1_FILT_CNT_MASK (0x70000U) -#define LPCMP_CCR1_FILT_CNT_SHIFT (16U) -/*! FILT_CNT - Filter Sample Count - * 0b000..Filter is bypassed: COUT = COUTA - * 0b001..1 consecutive sample (Comparator output is simply sampled.) - * 0b010..2 consecutive samples - * 0b011..3 consecutive samples - * 0b100..4 consecutive samples - * 0b101..5 consecutive samples - * 0b110..6 consecutive samples - * 0b111..7 consecutive samples - */ -#define LPCMP_CCR1_FILT_CNT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_FILT_CNT_SHIFT)) & LPCMP_CCR1_FILT_CNT_MASK) - -#define LPCMP_CCR1_FILT_PER_MASK (0xFF000000U) -#define LPCMP_CCR1_FILT_PER_SHIFT (24U) -/*! FILT_PER - Filter Sample Period */ -#define LPCMP_CCR1_FILT_PER(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_FILT_PER_SHIFT)) & LPCMP_CCR1_FILT_PER_MASK) -/*! @} */ - -/*! @name CCR2 - Comparator Control Register 2 */ -/*! @{ */ - -#define LPCMP_CCR2_CMP_HPMD_MASK (0x1U) -#define LPCMP_CCR2_CMP_HPMD_SHIFT (0U) -/*! CMP_HPMD - CMP High Power Mode Select - * 0b0..Low power (speed) comparison mode - * 0b1..High power (speed) comparison mode - */ -#define LPCMP_CCR2_CMP_HPMD(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR2_CMP_HPMD_SHIFT)) & LPCMP_CCR2_CMP_HPMD_MASK) - -#define LPCMP_CCR2_CMP_NPMD_MASK (0x2U) -#define LPCMP_CCR2_CMP_NPMD_SHIFT (1U) -/*! CMP_NPMD - CMP Nano Power Mode Select - * 0b0..Disables CMP Nano power mode. CCR2[CMP_HPMD] determines the mode for the comparator. - * 0b1..Enables CMP Nano power mode. - */ -#define LPCMP_CCR2_CMP_NPMD(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR2_CMP_NPMD_SHIFT)) & LPCMP_CCR2_CMP_NPMD_MASK) - -#define LPCMP_CCR2_HYSTCTR_MASK (0x30U) -#define LPCMP_CCR2_HYSTCTR_SHIFT (4U) -/*! HYSTCTR - Comparator Hysteresis Control - * 0b00..Level 0: Analog comparator hysteresis 0 mV. - * 0b01..Level 1: Analog comparator hysteresis 10 mV. - * 0b10..Level 2: Analog comparator hysteresis 20 mV. - * 0b11..Level 3: Analog comparator hysteresis 30 mV. - */ -#define LPCMP_CCR2_HYSTCTR(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR2_HYSTCTR_SHIFT)) & LPCMP_CCR2_HYSTCTR_MASK) - -#define LPCMP_CCR2_PSEL_MASK (0x70000U) -#define LPCMP_CCR2_PSEL_SHIFT (16U) -/*! PSEL - Plus Input MUX Select - * 0b000..Input 0p - * 0b001..Input 1p - * 0b010..Input 2p - * 0b011..Input 3p - * 0b100..Input 4p - * 0b101..Input 5p - * 0b110..Reserved - * 0b111..Internal DAC output - */ -#define LPCMP_CCR2_PSEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR2_PSEL_SHIFT)) & LPCMP_CCR2_PSEL_MASK) - -#define LPCMP_CCR2_MSEL_MASK (0x700000U) -#define LPCMP_CCR2_MSEL_SHIFT (20U) -/*! MSEL - Minus Input MUX Select - * 0b000..Input 0m - * 0b001..Input 1m - * 0b010..Input 2m - * 0b011..Input 3m - * 0b100..Input 4m - * 0b101..Input 5m - * 0b110..Reserved - * 0b111..Internal DAC output - */ -#define LPCMP_CCR2_MSEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR2_MSEL_SHIFT)) & LPCMP_CCR2_MSEL_MASK) -/*! @} */ - -/*! @name DCR - DAC Control */ -/*! @{ */ - -#define LPCMP_DCR_DAC_EN_MASK (0x1U) -#define LPCMP_DCR_DAC_EN_SHIFT (0U) -/*! DAC_EN - DAC Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPCMP_DCR_DAC_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_DCR_DAC_EN_SHIFT)) & LPCMP_DCR_DAC_EN_MASK) - -#define LPCMP_DCR_DAC_HPMD_MASK (0x2U) -#define LPCMP_DCR_DAC_HPMD_SHIFT (1U) -/*! DAC_HPMD - DAC High Power Mode - * 0b0..Disable - * 0b1..Enable - */ -#define LPCMP_DCR_DAC_HPMD(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_DCR_DAC_HPMD_SHIFT)) & LPCMP_DCR_DAC_HPMD_MASK) - -#define LPCMP_DCR_VRSEL_MASK (0x100U) -#define LPCMP_DCR_VRSEL_SHIFT (8U) -/*! VRSEL - DAC Reference High Voltage Source Select - * 0b0..VREFH0 - * 0b1..VREFH1 - */ -#define LPCMP_DCR_VRSEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_DCR_VRSEL_SHIFT)) & LPCMP_DCR_VRSEL_MASK) - -#define LPCMP_DCR_DAC_DATA_MASK (0xFF0000U) -#define LPCMP_DCR_DAC_DATA_SHIFT (16U) -/*! DAC_DATA - DAC Output Voltage Select */ -#define LPCMP_DCR_DAC_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_DCR_DAC_DATA_SHIFT)) & LPCMP_DCR_DAC_DATA_MASK) -/*! @} */ - -/*! @name IER - Interrupt Enable */ -/*! @{ */ - -#define LPCMP_IER_CFR_IE_MASK (0x1U) -#define LPCMP_IER_CFR_IE_SHIFT (0U) -/*! CFR_IE - Comparator Flag Rising Interrupt Enable - * 0b0..Disables the comparator flag rising interrupt. - * 0b1..Enables the comparator flag rising interrupt when CFR is set. - */ -#define LPCMP_IER_CFR_IE(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_IER_CFR_IE_SHIFT)) & LPCMP_IER_CFR_IE_MASK) - -#define LPCMP_IER_CFF_IE_MASK (0x2U) -#define LPCMP_IER_CFF_IE_SHIFT (1U) -/*! CFF_IE - Comparator Flag Falling Interrupt Enable - * 0b0..Disables the comparator flag falling interrupt. - * 0b1..Enables the comparator flag falling interrupt when CFF is set. - */ -#define LPCMP_IER_CFF_IE(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_IER_CFF_IE_SHIFT)) & LPCMP_IER_CFF_IE_MASK) - -#define LPCMP_IER_RRF_IE_MASK (0x4U) -#define LPCMP_IER_RRF_IE_SHIFT (2U) -/*! RRF_IE - Round-Robin Flag Interrupt Enable - * 0b0..Disables the round-robin flag interrupt. - * 0b1..Enables the round-robin flag interrupt when the comparison result changes for a given channel. - */ -#define LPCMP_IER_RRF_IE(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_IER_RRF_IE_SHIFT)) & LPCMP_IER_RRF_IE_MASK) -/*! @} */ - -/*! @name CSR - Comparator Status */ -/*! @{ */ - -#define LPCMP_CSR_CFR_MASK (0x1U) -#define LPCMP_CSR_CFR_SHIFT (0U) -/*! CFR - Analog Comparator Flag Rising - * 0b0..Not detected - * 0b1..Detected - */ -#define LPCMP_CSR_CFR(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CSR_CFR_SHIFT)) & LPCMP_CSR_CFR_MASK) - -#define LPCMP_CSR_CFF_MASK (0x2U) -#define LPCMP_CSR_CFF_SHIFT (1U) -/*! CFF - Analog Comparator Flag Falling - * 0b0..Not detected - * 0b1..Detected - */ -#define LPCMP_CSR_CFF(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CSR_CFF_SHIFT)) & LPCMP_CSR_CFF_MASK) - -#define LPCMP_CSR_RRF_MASK (0x4U) -#define LPCMP_CSR_RRF_SHIFT (2U) -/*! RRF - Round-Robin Flag - * 0b0..Not detected - * 0b1..Detected - */ -#define LPCMP_CSR_RRF(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CSR_RRF_SHIFT)) & LPCMP_CSR_RRF_MASK) - -#define LPCMP_CSR_COUT_MASK (0x100U) -#define LPCMP_CSR_COUT_SHIFT (8U) -/*! COUT - Analog Comparator Output */ -#define LPCMP_CSR_COUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CSR_COUT_SHIFT)) & LPCMP_CSR_COUT_MASK) -/*! @} */ - -/*! @name RRCR0 - Round Robin Control Register 0 */ -/*! @{ */ - -#define LPCMP_RRCR0_RR_EN_MASK (0x1U) -#define LPCMP_RRCR0_RR_EN_SHIFT (0U) -/*! RR_EN - Round-Robin Enable - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR0_RR_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_EN_SHIFT)) & LPCMP_RRCR0_RR_EN_MASK) - -#define LPCMP_RRCR0_RR_TRG_SEL_MASK (0x2U) -#define LPCMP_RRCR0_RR_TRG_SEL_SHIFT (1U) -/*! RR_TRG_SEL - Round-Robin Trigger Select - * 0b0..External trigger - * 0b1..Internal trigger - */ -#define LPCMP_RRCR0_RR_TRG_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_TRG_SEL_SHIFT)) & LPCMP_RRCR0_RR_TRG_SEL_MASK) - -#define LPCMP_RRCR0_RR_EXTTRG_SEL_MASK (0x3CU) -#define LPCMP_RRCR0_RR_EXTTRG_SEL_SHIFT (2U) -/*! RR_EXTTRG_SEL - External Trigger Source Select - * 0b0000..Select external trigger source 0 - * 0b0001..Select external trigger source 1 - * 0b0010..Select external trigger source 2 - * 0b0011..Select external trigger source 3 - * 0b0100..Select external trigger source 4 - * 0b0101..Select external trigger source 5 - * 0b0110..Select external trigger source 6 - * 0b0111..Select external trigger source 7 - * 0b1000..Select external trigger source 8 - * 0b1001..Select external trigger source 9 - * 0b1010..Select external trigger source 10 - * 0b1011..Select external trigger source 11 - * 0b1100..Select external trigger source 12 - * 0b1101..Select external trigger source 13 - * 0b1110..Select external trigger source 14 - * 0b1111..Select external trigger source 15 - */ -#define LPCMP_RRCR0_RR_EXTTRG_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_EXTTRG_SEL_SHIFT)) & LPCMP_RRCR0_RR_EXTTRG_SEL_MASK) - -#define LPCMP_RRCR0_RR_NSAM_MASK (0x300U) -#define LPCMP_RRCR0_RR_NSAM_SHIFT (8U) -/*! RR_NSAM - Number of Sample Clocks - * 0b00..0 clock - * 0b01..1 clock - * 0b10..2 clocks - * 0b11..3 clocks - */ -#define LPCMP_RRCR0_RR_NSAM(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_NSAM_SHIFT)) & LPCMP_RRCR0_RR_NSAM_MASK) - -#define LPCMP_RRCR0_RR_CLK_SEL_MASK (0x3000U) -#define LPCMP_RRCR0_RR_CLK_SEL_SHIFT (12U) -/*! RR_CLK_SEL - Round Robin Clock Source Select - * 0b00..Select Round Robin clock Source 0 - * 0b01..Select Round Robin clock Source 1 - * 0b10..Select Round Robin clock Source 2 - * 0b11..Select Round Robin clock Source 3 - */ -#define LPCMP_RRCR0_RR_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_CLK_SEL_SHIFT)) & LPCMP_RRCR0_RR_CLK_SEL_MASK) - -#define LPCMP_RRCR0_RR_INITMOD_MASK (0x3F0000U) -#define LPCMP_RRCR0_RR_INITMOD_SHIFT (16U) -/*! RR_INITMOD - Initialization Delay Modulus - * 0b000000..63 cycles (same as 111111b) - * 0b000001-0b111111..1 to 63 cycles - */ -#define LPCMP_RRCR0_RR_INITMOD(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_INITMOD_SHIFT)) & LPCMP_RRCR0_RR_INITMOD_MASK) - -#define LPCMP_RRCR0_RR_SAMPLE_CNT_MASK (0xF000000U) -#define LPCMP_RRCR0_RR_SAMPLE_CNT_SHIFT (24U) -/*! RR_SAMPLE_CNT - Number of Sample for One Channel - * 0b0000..1 samples - * 0b0001..2 samples - * 0b0010..3 samples - * 0b0011..4 samples - * 0b0100..5 samples - * 0b0101..6 samples - * 0b0110..7 samples - * 0b0111..8 samples - * 0b1000..9 samples - * 0b1001..10 samples - * 0b1010..11 samples - * 0b1011..12 samples - * 0b1100..13 samples - * 0b1101..14 samples - * 0b1110..15 samples - * 0b1111..16 samples - */ -#define LPCMP_RRCR0_RR_SAMPLE_CNT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_SAMPLE_CNT_SHIFT)) & LPCMP_RRCR0_RR_SAMPLE_CNT_MASK) - -#define LPCMP_RRCR0_RR_SAMPLE_THRESHOLD_MASK (0xF0000000U) -#define LPCMP_RRCR0_RR_SAMPLE_THRESHOLD_SHIFT (28U) -/*! RR_SAMPLE_THRESHOLD - Sample Time Threshold - * 0b0000..At least 1 sampled "1", the final result is "1" - * 0b0001..At least 2 sampled "1", the final result is "1" - * 0b0010..At least 3 sampled "1", the final result is "1" - * 0b0011..At least 4 sampled "1", the final result is "1" - * 0b0100..At least 5 sampled "1", the final result is "1" - * 0b0101..At least 6 sampled "1", the final result is "1" - * 0b0110..At least 7 sampled "1", the final result is "1" - * 0b0111..At least 8 sampled "1", the final result is "1" - * 0b1000..At least 9 sampled "1", the final result is "1" - * 0b1001..At least 10 sampled "1", the final result is "1" - * 0b1010..At least 11 sampled "1", the final result is "1" - * 0b1011..At least 12 sampled "1", the final result is "1" - * 0b1100..At least 13 sampled "1", the final result is "1" - * 0b1101..At least 14 sampled "1", the final result is "1" - * 0b1110..At least 15 sampled "1", the final result is "1" - * 0b1111..At least 16 sampled "1", the final result is "1" - */ -#define LPCMP_RRCR0_RR_SAMPLE_THRESHOLD(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_SAMPLE_THRESHOLD_SHIFT)) & LPCMP_RRCR0_RR_SAMPLE_THRESHOLD_MASK) -/*! @} */ - -/*! @name RRCR1 - Round Robin Control Register 1 */ -/*! @{ */ - -#define LPCMP_RRCR1_RR_CH0EN_MASK (0x1U) -#define LPCMP_RRCR1_RR_CH0EN_SHIFT (0U) -/*! RR_CH0EN - Channel 0 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH0EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH0EN_SHIFT)) & LPCMP_RRCR1_RR_CH0EN_MASK) - -#define LPCMP_RRCR1_RR_CH1EN_MASK (0x2U) -#define LPCMP_RRCR1_RR_CH1EN_SHIFT (1U) -/*! RR_CH1EN - Channel 1 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH1EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH1EN_SHIFT)) & LPCMP_RRCR1_RR_CH1EN_MASK) - -#define LPCMP_RRCR1_RR_CH2EN_MASK (0x4U) -#define LPCMP_RRCR1_RR_CH2EN_SHIFT (2U) -/*! RR_CH2EN - Channel 2 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH2EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH2EN_SHIFT)) & LPCMP_RRCR1_RR_CH2EN_MASK) - -#define LPCMP_RRCR1_RR_CH3EN_MASK (0x8U) -#define LPCMP_RRCR1_RR_CH3EN_SHIFT (3U) -/*! RR_CH3EN - Channel 3 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH3EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH3EN_SHIFT)) & LPCMP_RRCR1_RR_CH3EN_MASK) - -#define LPCMP_RRCR1_RR_CH4EN_MASK (0x10U) -#define LPCMP_RRCR1_RR_CH4EN_SHIFT (4U) -/*! RR_CH4EN - Channel 4 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH4EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH4EN_SHIFT)) & LPCMP_RRCR1_RR_CH4EN_MASK) - -#define LPCMP_RRCR1_RR_CH5EN_MASK (0x20U) -#define LPCMP_RRCR1_RR_CH5EN_SHIFT (5U) -/*! RR_CH5EN - Channel 5 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH5EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH5EN_SHIFT)) & LPCMP_RRCR1_RR_CH5EN_MASK) - -#define LPCMP_RRCR1_RR_CH6EN_MASK (0x40U) -#define LPCMP_RRCR1_RR_CH6EN_SHIFT (6U) -/*! RR_CH6EN - Channel 6 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH6EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH6EN_SHIFT)) & LPCMP_RRCR1_RR_CH6EN_MASK) - -#define LPCMP_RRCR1_RR_CH7EN_MASK (0x80U) -#define LPCMP_RRCR1_RR_CH7EN_SHIFT (7U) -/*! RR_CH7EN - Channel 7 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH7EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH7EN_SHIFT)) & LPCMP_RRCR1_RR_CH7EN_MASK) - -#define LPCMP_RRCR1_FIXP_MASK (0x10000U) -#define LPCMP_RRCR1_FIXP_SHIFT (16U) -/*! FIXP - Fixed Port - * 0b0..Fix the plus port. Sweep only the inputs to the minus port. - * 0b1..Fix the minus port. Sweep only the inputs to the plus port. - */ -#define LPCMP_RRCR1_FIXP(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_FIXP_SHIFT)) & LPCMP_RRCR1_FIXP_MASK) - -#define LPCMP_RRCR1_FIXCH_MASK (0x700000U) -#define LPCMP_RRCR1_FIXCH_SHIFT (20U) -/*! FIXCH - Fixed Channel Select - * 0b000..Channel 0 - * 0b001..Channel 1 - * 0b010..Channel 2 - * 0b011..Channel 3 - * 0b100..Channel 4 - * 0b101..Channel 5 - * 0b110..Channel 6 - * 0b111..Channel 7 - */ -#define LPCMP_RRCR1_FIXCH(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_FIXCH_SHIFT)) & LPCMP_RRCR1_FIXCH_MASK) -/*! @} */ - -/*! @name RRCSR - Round Robin Control and Status */ -/*! @{ */ - -#define LPCMP_RRCSR_RR_CH0OUT_MASK (0x1U) -#define LPCMP_RRCSR_RR_CH0OUT_SHIFT (0U) -/*! RR_CH0OUT - Comparison Result for Channel 0 */ -#define LPCMP_RRCSR_RR_CH0OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH0OUT_SHIFT)) & LPCMP_RRCSR_RR_CH0OUT_MASK) - -#define LPCMP_RRCSR_RR_CH1OUT_MASK (0x2U) -#define LPCMP_RRCSR_RR_CH1OUT_SHIFT (1U) -/*! RR_CH1OUT - Comparison Result for Channel 1 */ -#define LPCMP_RRCSR_RR_CH1OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH1OUT_SHIFT)) & LPCMP_RRCSR_RR_CH1OUT_MASK) - -#define LPCMP_RRCSR_RR_CH2OUT_MASK (0x4U) -#define LPCMP_RRCSR_RR_CH2OUT_SHIFT (2U) -/*! RR_CH2OUT - Comparison Result for Channel 2 */ -#define LPCMP_RRCSR_RR_CH2OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH2OUT_SHIFT)) & LPCMP_RRCSR_RR_CH2OUT_MASK) - -#define LPCMP_RRCSR_RR_CH3OUT_MASK (0x8U) -#define LPCMP_RRCSR_RR_CH3OUT_SHIFT (3U) -/*! RR_CH3OUT - Comparison Result for Channel 3 */ -#define LPCMP_RRCSR_RR_CH3OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH3OUT_SHIFT)) & LPCMP_RRCSR_RR_CH3OUT_MASK) - -#define LPCMP_RRCSR_RR_CH4OUT_MASK (0x10U) -#define LPCMP_RRCSR_RR_CH4OUT_SHIFT (4U) -/*! RR_CH4OUT - Comparison Result for Channel 4 */ -#define LPCMP_RRCSR_RR_CH4OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH4OUT_SHIFT)) & LPCMP_RRCSR_RR_CH4OUT_MASK) - -#define LPCMP_RRCSR_RR_CH5OUT_MASK (0x20U) -#define LPCMP_RRCSR_RR_CH5OUT_SHIFT (5U) -/*! RR_CH5OUT - Comparison Result for Channel 5 */ -#define LPCMP_RRCSR_RR_CH5OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH5OUT_SHIFT)) & LPCMP_RRCSR_RR_CH5OUT_MASK) - -#define LPCMP_RRCSR_RR_CH6OUT_MASK (0x40U) -#define LPCMP_RRCSR_RR_CH6OUT_SHIFT (6U) -/*! RR_CH6OUT - Comparison Result for Channel 6 */ -#define LPCMP_RRCSR_RR_CH6OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH6OUT_SHIFT)) & LPCMP_RRCSR_RR_CH6OUT_MASK) - -#define LPCMP_RRCSR_RR_CH7OUT_MASK (0x80U) -#define LPCMP_RRCSR_RR_CH7OUT_SHIFT (7U) -/*! RR_CH7OUT - Comparison Result for Channel 7 */ -#define LPCMP_RRCSR_RR_CH7OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH7OUT_SHIFT)) & LPCMP_RRCSR_RR_CH7OUT_MASK) -/*! @} */ - -/*! @name RRSR - Round Robin Status */ -/*! @{ */ - -#define LPCMP_RRSR_RR_CH0F_MASK (0x1U) -#define LPCMP_RRSR_RR_CH0F_SHIFT (0U) -/*! RR_CH0F - Channel 0 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH0F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH0F_SHIFT)) & LPCMP_RRSR_RR_CH0F_MASK) - -#define LPCMP_RRSR_RR_CH1F_MASK (0x2U) -#define LPCMP_RRSR_RR_CH1F_SHIFT (1U) -/*! RR_CH1F - Channel 1 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH1F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH1F_SHIFT)) & LPCMP_RRSR_RR_CH1F_MASK) - -#define LPCMP_RRSR_RR_CH2F_MASK (0x4U) -#define LPCMP_RRSR_RR_CH2F_SHIFT (2U) -/*! RR_CH2F - Channel 2 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH2F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH2F_SHIFT)) & LPCMP_RRSR_RR_CH2F_MASK) - -#define LPCMP_RRSR_RR_CH3F_MASK (0x8U) -#define LPCMP_RRSR_RR_CH3F_SHIFT (3U) -/*! RR_CH3F - Channel 3 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH3F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH3F_SHIFT)) & LPCMP_RRSR_RR_CH3F_MASK) - -#define LPCMP_RRSR_RR_CH4F_MASK (0x10U) -#define LPCMP_RRSR_RR_CH4F_SHIFT (4U) -/*! RR_CH4F - Channel 4 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH4F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH4F_SHIFT)) & LPCMP_RRSR_RR_CH4F_MASK) - -#define LPCMP_RRSR_RR_CH5F_MASK (0x20U) -#define LPCMP_RRSR_RR_CH5F_SHIFT (5U) -/*! RR_CH5F - Channel 5 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH5F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH5F_SHIFT)) & LPCMP_RRSR_RR_CH5F_MASK) - -#define LPCMP_RRSR_RR_CH6F_MASK (0x40U) -#define LPCMP_RRSR_RR_CH6F_SHIFT (6U) -/*! RR_CH6F - Channel 6 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH6F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH6F_SHIFT)) & LPCMP_RRSR_RR_CH6F_MASK) - -#define LPCMP_RRSR_RR_CH7F_MASK (0x80U) -#define LPCMP_RRSR_RR_CH7F_SHIFT (7U) -/*! RR_CH7F - Channel 7 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH7F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH7F_SHIFT)) & LPCMP_RRSR_RR_CH7F_MASK) -/*! @} */ - -/*! @name RRCR2 - Round Robin Control Register 2 */ -/*! @{ */ - -#define LPCMP_RRCR2_RR_TIMER_RELOAD_MASK (0xFFFFFFFU) -#define LPCMP_RRCR2_RR_TIMER_RELOAD_SHIFT (0U) -/*! RR_TIMER_RELOAD - Number of Sample Clocks */ -#define LPCMP_RRCR2_RR_TIMER_RELOAD(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR2_RR_TIMER_RELOAD_SHIFT)) & LPCMP_RRCR2_RR_TIMER_RELOAD_MASK) - -#define LPCMP_RRCR2_RR_TIMER_EN_MASK (0x80000000U) -#define LPCMP_RRCR2_RR_TIMER_EN_SHIFT (31U) -/*! RR_TIMER_EN - Round-Robin Internal Timer Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPCMP_RRCR2_RR_TIMER_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR2_RR_TIMER_EN_SHIFT)) & LPCMP_RRCR2_RR_TIMER_EN_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group LPCMP_Register_Masks */ - - -/* LPCMP - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral CMP0 base address */ - #define CMP0_BASE (0x50051000u) - /** Peripheral CMP0 base address */ - #define CMP0_BASE_NS (0x40051000u) - /** Peripheral CMP0 base pointer */ - #define CMP0 ((LPCMP_Type *)CMP0_BASE) - /** Peripheral CMP0 base pointer */ - #define CMP0_NS ((LPCMP_Type *)CMP0_BASE_NS) - /** Peripheral CMP1 base address */ - #define CMP1_BASE (0x50052000u) - /** Peripheral CMP1 base address */ - #define CMP1_BASE_NS (0x40052000u) - /** Peripheral CMP1 base pointer */ - #define CMP1 ((LPCMP_Type *)CMP1_BASE) - /** Peripheral CMP1 base pointer */ - #define CMP1_NS ((LPCMP_Type *)CMP1_BASE_NS) - /** Peripheral CMP2 base address */ - #define CMP2_BASE (0x50053000u) - /** Peripheral CMP2 base address */ - #define CMP2_BASE_NS (0x40053000u) - /** Peripheral CMP2 base pointer */ - #define CMP2 ((LPCMP_Type *)CMP2_BASE) - /** Peripheral CMP2 base pointer */ - #define CMP2_NS ((LPCMP_Type *)CMP2_BASE_NS) - /** Array initializer of LPCMP peripheral base addresses */ - #define LPCMP_BASE_ADDRS { CMP0_BASE, CMP1_BASE, CMP2_BASE } - /** Array initializer of LPCMP peripheral base pointers */ - #define LPCMP_BASE_PTRS { CMP0, CMP1, CMP2 } - /** Array initializer of LPCMP peripheral base addresses */ - #define LPCMP_BASE_ADDRS_NS { CMP0_BASE_NS, CMP1_BASE_NS, CMP2_BASE_NS } - /** Array initializer of LPCMP peripheral base pointers */ - #define LPCMP_BASE_PTRS_NS { CMP0_NS, CMP1_NS, CMP2_NS } -#else - /** Peripheral CMP0 base address */ - #define CMP0_BASE (0x40051000u) - /** Peripheral CMP0 base pointer */ - #define CMP0 ((LPCMP_Type *)CMP0_BASE) - /** Peripheral CMP1 base address */ - #define CMP1_BASE (0x40052000u) - /** Peripheral CMP1 base pointer */ - #define CMP1 ((LPCMP_Type *)CMP1_BASE) - /** Peripheral CMP2 base address */ - #define CMP2_BASE (0x40053000u) - /** Peripheral CMP2 base pointer */ - #define CMP2 ((LPCMP_Type *)CMP2_BASE) - /** Array initializer of LPCMP peripheral base addresses */ - #define LPCMP_BASE_ADDRS { CMP0_BASE, CMP1_BASE, CMP2_BASE } - /** Array initializer of LPCMP peripheral base pointers */ - #define LPCMP_BASE_PTRS { CMP0, CMP1, CMP2 } -#endif -/** Interrupt vectors for the LPCMP peripheral type */ -#define LPCMP_IRQS { HSCMP0_IRQn, HSCMP1_IRQn, HSCMP2_IRQn } - -/*! - * @} - */ /* end of group LPCMP_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LPDAC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPDAC_Peripheral_Access_Layer LPDAC Peripheral Access Layer - * @{ - */ - -/** LPDAC - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version Identifier, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - __O uint32_t DATA; /**< Data, offset: 0x8 */ - __IO uint32_t GCR; /**< Global Control, offset: 0xC */ - __IO uint32_t FCR; /**< DAC FIFO Control, offset: 0x10 */ - __I uint32_t FPR; /**< DAC FIFO Pointer, offset: 0x14 */ - __IO uint32_t FSR; /**< FIFO Status, offset: 0x18 */ - __IO uint32_t IER; /**< Interrupt Enable, offset: 0x1C */ - __IO uint32_t DER; /**< DMA Enable, offset: 0x20 */ - __IO uint32_t RCR; /**< Reset Control, offset: 0x24 */ - __O uint32_t TCR; /**< Trigger Control, offset: 0x28 */ - __IO uint32_t PCR; /**< Periodic Trigger Control, offset: 0x2C */ -} LPDAC_Type; - -/* ---------------------------------------------------------------------------- - -- LPDAC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPDAC_Register_Masks LPDAC Register Masks - * @{ - */ - -/*! @name VERID - Version Identifier */ -/*! @{ */ - -#define LPDAC_VERID_FEATURE_MASK (0xFFFFU) -#define LPDAC_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Identification Number */ -#define LPDAC_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_VERID_FEATURE_SHIFT)) & LPDAC_VERID_FEATURE_MASK) - -#define LPDAC_VERID_MINOR_MASK (0xFF0000U) -#define LPDAC_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define LPDAC_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_VERID_MINOR_SHIFT)) & LPDAC_VERID_MINOR_MASK) - -#define LPDAC_VERID_MAJOR_MASK (0xFF000000U) -#define LPDAC_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define LPDAC_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_VERID_MAJOR_SHIFT)) & LPDAC_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define LPDAC_PARAM_FIFOSZ_MASK (0x7U) -#define LPDAC_PARAM_FIFOSZ_SHIFT (0U) -/*! FIFOSZ - FIFO Size - * 0b000..Reserved - * 0b001..FIFO depth is 4 - * 0b010..FIFO depth is 8 - * 0b011..FIFO depth is 16 - * 0b100..FIFO depth is 32 - * 0b101..FIFO depth is 64 - * 0b110..FIFO depth is 128 - * 0b111..FIFO depth is 256 - */ -#define LPDAC_PARAM_FIFOSZ(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_PARAM_FIFOSZ_SHIFT)) & LPDAC_PARAM_FIFOSZ_MASK) -/*! @} */ - -/*! @name DATA - Data */ -/*! @{ */ - -#define LPDAC_DATA_DATA_MASK (0xFFFU) -#define LPDAC_DATA_DATA_SHIFT (0U) -/*! DATA - FIFO Entry or Buffer Entry */ -#define LPDAC_DATA_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_DATA_DATA_SHIFT)) & LPDAC_DATA_DATA_MASK) -/*! @} */ - -/*! @name GCR - Global Control */ -/*! @{ */ - -#define LPDAC_GCR_DACEN_MASK (0x1U) -#define LPDAC_GCR_DACEN_SHIFT (0U) -/*! DACEN - DAC Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_GCR_DACEN(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_DACEN_SHIFT)) & LPDAC_GCR_DACEN_MASK) - -#define LPDAC_GCR_DACRFS_MASK (0x6U) -#define LPDAC_GCR_DACRFS_SHIFT (1U) -/*! DACRFS - DAC Reference Select - * 0b00..Selects VREFH0 as the reference voltage. - * 0b01..Selects VREFH1 as the reference voltage. - * 0b10..Selects VREFH2 as the reference voltage. - * 0b11..Reserved. - */ -#define LPDAC_GCR_DACRFS(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_DACRFS_SHIFT)) & LPDAC_GCR_DACRFS_MASK) - -#define LPDAC_GCR_FIFOEN_MASK (0x8U) -#define LPDAC_GCR_FIFOEN_SHIFT (3U) -/*! FIFOEN - FIFO Enable - * 0b0..Enables FIFO mode and disables Buffer mode. Any data written to DATA[DATA] goes to buffer then goes to conversion. - * 0b1..Enables FIFO mode. Data will be first read from FIFO to buffer and then goes to conversion. - */ -#define LPDAC_GCR_FIFOEN(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_FIFOEN_SHIFT)) & LPDAC_GCR_FIFOEN_MASK) - -#define LPDAC_GCR_SWMD_MASK (0x10U) -#define LPDAC_GCR_SWMD_SHIFT (4U) -/*! SWMD - Swing Back Mode - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_GCR_SWMD(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_SWMD_SHIFT)) & LPDAC_GCR_SWMD_MASK) - -#define LPDAC_GCR_TRGSEL_MASK (0x20U) -#define LPDAC_GCR_TRGSEL_SHIFT (5U) -/*! TRGSEL - DAC Trigger Select - * 0b0..Hardware trigger - * 0b1..Software trigger - */ -#define LPDAC_GCR_TRGSEL(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_TRGSEL_SHIFT)) & LPDAC_GCR_TRGSEL_MASK) - -#define LPDAC_GCR_PTGEN_MASK (0x40U) -#define LPDAC_GCR_PTGEN_SHIFT (6U) -/*! PTGEN - DAC Periodic Trigger Mode Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_GCR_PTGEN(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_PTGEN_SHIFT)) & LPDAC_GCR_PTGEN_MASK) - -#define LPDAC_GCR_LATCH_CYC_MASK (0xF00U) -#define LPDAC_GCR_LATCH_CYC_SHIFT (8U) -/*! LATCH_CYC - RCLK Cycles Before Data Latch */ -#define LPDAC_GCR_LATCH_CYC(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_LATCH_CYC_SHIFT)) & LPDAC_GCR_LATCH_CYC_MASK) - -#define LPDAC_GCR_BUF_EN_MASK (0x20000U) -#define LPDAC_GCR_BUF_EN_SHIFT (17U) -/*! BUF_EN - Buffer Enable - * 0b0..Not used - * 0b1..Used - */ -#define LPDAC_GCR_BUF_EN(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_BUF_EN_SHIFT)) & LPDAC_GCR_BUF_EN_MASK) - -#define LPDAC_GCR_IREF_PTAT_EXT_SEL_MASK (0x100000U) -#define LPDAC_GCR_IREF_PTAT_EXT_SEL_SHIFT (20U) -/*! IREF_PTAT_EXT_SEL - External On-Chip PTAT Current Reference Select - * 0b0..Not selected - * 0b1..Selected - */ -#define LPDAC_GCR_IREF_PTAT_EXT_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_IREF_PTAT_EXT_SEL_SHIFT)) & LPDAC_GCR_IREF_PTAT_EXT_SEL_MASK) - -#define LPDAC_GCR_IREF_ZTC_EXT_SEL_MASK (0x200000U) -#define LPDAC_GCR_IREF_ZTC_EXT_SEL_SHIFT (21U) -/*! IREF_ZTC_EXT_SEL - External On-Chip ZTC Current Reference Select - * 0b0..Not selected - * 0b1..Selected - */ -#define LPDAC_GCR_IREF_ZTC_EXT_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_IREF_ZTC_EXT_SEL_SHIFT)) & LPDAC_GCR_IREF_ZTC_EXT_SEL_MASK) - -#define LPDAC_GCR_BUF_SPD_CTRL_MASK (0x800000U) -#define LPDAC_GCR_BUF_SPD_CTRL_SHIFT (23U) -/*! BUF_SPD_CTRL - OPAMP as Buffer, Speed Control Signal - * 0b0..Lower Low-Power mode - * 0b1..Low-Power mode - */ -#define LPDAC_GCR_BUF_SPD_CTRL(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_BUF_SPD_CTRL_SHIFT)) & LPDAC_GCR_BUF_SPD_CTRL_MASK) -/*! @} */ - -/*! @name FCR - DAC FIFO Control */ -/*! @{ */ - -#define LPDAC_FCR_WML_MASK (0xFU) -#define LPDAC_FCR_WML_SHIFT (0U) -/*! WML - Watermark Level */ -#define LPDAC_FCR_WML(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_FCR_WML_SHIFT)) & LPDAC_FCR_WML_MASK) -/*! @} */ - -/*! @name FPR - DAC FIFO Pointer */ -/*! @{ */ - -#define LPDAC_FPR_FIFO_RPT_MASK (0xFU) -#define LPDAC_FPR_FIFO_RPT_SHIFT (0U) -/*! FIFO_RPT - FIFO Read Pointer */ -#define LPDAC_FPR_FIFO_RPT(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_FPR_FIFO_RPT_SHIFT)) & LPDAC_FPR_FIFO_RPT_MASK) - -#define LPDAC_FPR_FIFO_WPT_MASK (0xF0000U) -#define LPDAC_FPR_FIFO_WPT_SHIFT (16U) -/*! FIFO_WPT - FIFO Write Pointer */ -#define LPDAC_FPR_FIFO_WPT(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_FPR_FIFO_WPT_SHIFT)) & LPDAC_FPR_FIFO_WPT_MASK) -/*! @} */ - -/*! @name FSR - FIFO Status */ -/*! @{ */ - -#define LPDAC_FSR_FULL_MASK (0x1U) -#define LPDAC_FSR_FULL_SHIFT (0U) -/*! FULL - FIFO Full Flag - * 0b0..Not full - * 0b1..Full - */ -#define LPDAC_FSR_FULL(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_FSR_FULL_SHIFT)) & LPDAC_FSR_FULL_MASK) - -#define LPDAC_FSR_EMPTY_MASK (0x2U) -#define LPDAC_FSR_EMPTY_SHIFT (1U) -/*! EMPTY - FIFO Empty Flag - * 0b0..Not empty - * 0b1..Empty - */ -#define LPDAC_FSR_EMPTY(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_FSR_EMPTY_SHIFT)) & LPDAC_FSR_EMPTY_MASK) - -#define LPDAC_FSR_WM_MASK (0x4U) -#define LPDAC_FSR_WM_SHIFT (2U) -/*! WM - FIFO Watermark Status Flag - * 0b0..Data in FIFO is more than watermark level - * 0b1..Data in FIFO is less than or equal to watermark level - */ -#define LPDAC_FSR_WM(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_FSR_WM_SHIFT)) & LPDAC_FSR_WM_MASK) - -#define LPDAC_FSR_SWBK_MASK (0x8U) -#define LPDAC_FSR_SWBK_SHIFT (3U) -/*! SWBK - Swing Back One Cycle Complete Flag - * 0b0..No swing back cycle has completed since the last time the flag was cleared - * 0b1..At least one swing back cycle has occurred since the last time the flag was cleared - */ -#define LPDAC_FSR_SWBK(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_FSR_SWBK_SHIFT)) & LPDAC_FSR_SWBK_MASK) - -#define LPDAC_FSR_OF_MASK (0x40U) -#define LPDAC_FSR_OF_SHIFT (6U) -/*! OF - FIFO Overflow Flag - * 0b0..No overflow has occurred since the last time the flag was cleared - * 0b1..At least one FIFO overflow has occurred since the last time the flag was cleared - */ -#define LPDAC_FSR_OF(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_FSR_OF_SHIFT)) & LPDAC_FSR_OF_MASK) - -#define LPDAC_FSR_UF_MASK (0x80U) -#define LPDAC_FSR_UF_SHIFT (7U) -/*! UF - FIFO Underflow Flag - * 0b0..No underflow has occurred since the last time the flag was cleared - * 0b1..At least one trigger underflow has occurred since the last time the flag was cleared - */ -#define LPDAC_FSR_UF(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_FSR_UF_SHIFT)) & LPDAC_FSR_UF_MASK) - -#define LPDAC_FSR_PTGCOCO_MASK (0x100U) -#define LPDAC_FSR_PTGCOCO_SHIFT (8U) -/*! PTGCOCO - Period Trigger Mode Conversion Complete Flag - * 0b0..Not completed or not started - * 0b1..Completed - */ -#define LPDAC_FSR_PTGCOCO(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_FSR_PTGCOCO_SHIFT)) & LPDAC_FSR_PTGCOCO_MASK) -/*! @} */ - -/*! @name IER - Interrupt Enable */ -/*! @{ */ - -#define LPDAC_IER_FULL_IE_MASK (0x1U) -#define LPDAC_IER_FULL_IE_SHIFT (0U) -/*! FULL_IE - FIFO Full Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_IER_FULL_IE(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_IER_FULL_IE_SHIFT)) & LPDAC_IER_FULL_IE_MASK) - -#define LPDAC_IER_EMPTY_IE_MASK (0x2U) -#define LPDAC_IER_EMPTY_IE_SHIFT (1U) -/*! EMPTY_IE - FIFO Empty Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_IER_EMPTY_IE(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_IER_EMPTY_IE_SHIFT)) & LPDAC_IER_EMPTY_IE_MASK) - -#define LPDAC_IER_WM_IE_MASK (0x4U) -#define LPDAC_IER_WM_IE_SHIFT (2U) -/*! WM_IE - FIFO Watermark Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_IER_WM_IE(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_IER_WM_IE_SHIFT)) & LPDAC_IER_WM_IE_MASK) - -#define LPDAC_IER_SWBK_IE_MASK (0x8U) -#define LPDAC_IER_SWBK_IE_SHIFT (3U) -/*! SWBK_IE - Swing Back One Cycle Complete Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_IER_SWBK_IE(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_IER_SWBK_IE_SHIFT)) & LPDAC_IER_SWBK_IE_MASK) - -#define LPDAC_IER_OF_IE_MASK (0x40U) -#define LPDAC_IER_OF_IE_SHIFT (6U) -/*! OF_IE - FIFO Overflow Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_IER_OF_IE(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_IER_OF_IE_SHIFT)) & LPDAC_IER_OF_IE_MASK) - -#define LPDAC_IER_UF_IE_MASK (0x80U) -#define LPDAC_IER_UF_IE_SHIFT (7U) -/*! UF_IE - FIFO Underflow Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_IER_UF_IE(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_IER_UF_IE_SHIFT)) & LPDAC_IER_UF_IE_MASK) - -#define LPDAC_IER_PTGCOCO_IE_MASK (0x100U) -#define LPDAC_IER_PTGCOCO_IE_SHIFT (8U) -/*! PTGCOCO_IE - PTG Mode Conversion Complete Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_IER_PTGCOCO_IE(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_IER_PTGCOCO_IE_SHIFT)) & LPDAC_IER_PTGCOCO_IE_MASK) -/*! @} */ - -/*! @name DER - DMA Enable */ -/*! @{ */ - -#define LPDAC_DER_EMPTY_DMAEN_MASK (0x2U) -#define LPDAC_DER_EMPTY_DMAEN_SHIFT (1U) -/*! EMPTY_DMAEN - FIFO Empty DMA Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_DER_EMPTY_DMAEN(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_DER_EMPTY_DMAEN_SHIFT)) & LPDAC_DER_EMPTY_DMAEN_MASK) - -#define LPDAC_DER_WM_DMAEN_MASK (0x4U) -#define LPDAC_DER_WM_DMAEN_SHIFT (2U) -/*! WM_DMAEN - FIFO Watermark DMA Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_DER_WM_DMAEN(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_DER_WM_DMAEN_SHIFT)) & LPDAC_DER_WM_DMAEN_MASK) -/*! @} */ - -/*! @name RCR - Reset Control */ -/*! @{ */ - -#define LPDAC_RCR_SWRST_MASK (0x1U) -#define LPDAC_RCR_SWRST_SHIFT (0U) -/*! SWRST - Software Reset - * 0b0..No effect - * 0b1..Software reset - */ -#define LPDAC_RCR_SWRST(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_RCR_SWRST_SHIFT)) & LPDAC_RCR_SWRST_MASK) - -#define LPDAC_RCR_FIFORST_MASK (0x2U) -#define LPDAC_RCR_FIFORST_SHIFT (1U) -/*! FIFORST - FIFO Reset - * 0b0..No effect - * 0b1..FIFO reset - */ -#define LPDAC_RCR_FIFORST(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_RCR_FIFORST_SHIFT)) & LPDAC_RCR_FIFORST_MASK) -/*! @} */ - -/*! @name TCR - Trigger Control */ -/*! @{ */ - -#define LPDAC_TCR_SWTRG_MASK (0x1U) -#define LPDAC_TCR_SWTRG_SHIFT (0U) -/*! SWTRG - Software Trigger - * 0b0..Not valid - * 0b1..Valid - */ -#define LPDAC_TCR_SWTRG(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_TCR_SWTRG_SHIFT)) & LPDAC_TCR_SWTRG_MASK) -/*! @} */ - -/*! @name PCR - Periodic Trigger Control */ -/*! @{ */ - -#define LPDAC_PCR_PTG_NUM_MASK (0xFFFFU) -#define LPDAC_PCR_PTG_NUM_SHIFT (0U) -/*! PTG_NUM - Periodic Trigger Number */ -#define LPDAC_PCR_PTG_NUM(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_PCR_PTG_NUM_SHIFT)) & LPDAC_PCR_PTG_NUM_MASK) - -#define LPDAC_PCR_PTG_PERIOD_MASK (0xFFFF0000U) -#define LPDAC_PCR_PTG_PERIOD_SHIFT (16U) -/*! PTG_PERIOD - Periodic Trigger Period Width */ -#define LPDAC_PCR_PTG_PERIOD(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_PCR_PTG_PERIOD_SHIFT)) & LPDAC_PCR_PTG_PERIOD_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group LPDAC_Register_Masks */ - - -/* LPDAC - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral DAC0 base address */ - #define DAC0_BASE (0x5010F000u) - /** Peripheral DAC0 base address */ - #define DAC0_BASE_NS (0x4010F000u) - /** Peripheral DAC0 base pointer */ - #define DAC0 ((LPDAC_Type *)DAC0_BASE) - /** Peripheral DAC0 base pointer */ - #define DAC0_NS ((LPDAC_Type *)DAC0_BASE_NS) - /** Peripheral DAC1 base address */ - #define DAC1_BASE (0x50112000u) - /** Peripheral DAC1 base address */ - #define DAC1_BASE_NS (0x40112000u) - /** Peripheral DAC1 base pointer */ - #define DAC1 ((LPDAC_Type *)DAC1_BASE) - /** Peripheral DAC1 base pointer */ - #define DAC1_NS ((LPDAC_Type *)DAC1_BASE_NS) - /** Array initializer of LPDAC peripheral base addresses */ - #define LPDAC_BASE_ADDRS { DAC0_BASE, DAC1_BASE } - /** Array initializer of LPDAC peripheral base pointers */ - #define LPDAC_BASE_PTRS { DAC0, DAC1 } - /** Array initializer of LPDAC peripheral base addresses */ - #define LPDAC_BASE_ADDRS_NS { DAC0_BASE_NS, DAC1_BASE_NS } - /** Array initializer of LPDAC peripheral base pointers */ - #define LPDAC_BASE_PTRS_NS { DAC0_NS, DAC1_NS } -#else - /** Peripheral DAC0 base address */ - #define DAC0_BASE (0x4010F000u) - /** Peripheral DAC0 base pointer */ - #define DAC0 ((LPDAC_Type *)DAC0_BASE) - /** Peripheral DAC1 base address */ - #define DAC1_BASE (0x40112000u) - /** Peripheral DAC1 base pointer */ - #define DAC1 ((LPDAC_Type *)DAC1_BASE) - /** Array initializer of LPDAC peripheral base addresses */ - #define LPDAC_BASE_ADDRS { DAC0_BASE, DAC1_BASE } - /** Array initializer of LPDAC peripheral base pointers */ - #define LPDAC_BASE_PTRS { DAC0, DAC1 } -#endif -/** Interrupt vectors for the LPDAC peripheral type */ -#define LPDAC_IRQS { DAC0_IRQn, DAC1_IRQn } - -/*! - * @} - */ /* end of group LPDAC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LPI2C Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPI2C_Peripheral_Access_Layer LPI2C Peripheral Access Layer - * @{ - */ - -/** LPI2C - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - uint8_t RESERVED_0[8]; - __IO uint32_t MCR; /**< Controller Control, offset: 0x10 */ - __IO uint32_t MSR; /**< Controller Status, offset: 0x14 */ - __IO uint32_t MIER; /**< Controller Interrupt Enable, offset: 0x18 */ - __IO uint32_t MDER; /**< Controller DMA Enable, offset: 0x1C */ - __IO uint32_t MCFGR0; /**< Controller Configuration 0, offset: 0x20 */ - __IO uint32_t MCFGR1; /**< Controller Configuration 1, offset: 0x24 */ - __IO uint32_t MCFGR2; /**< Controller Configuration 2, offset: 0x28 */ - __IO uint32_t MCFGR3; /**< Controller Configuration 3, offset: 0x2C */ - uint8_t RESERVED_1[16]; - __IO uint32_t MDMR; /**< Controller Data Match, offset: 0x40 */ - uint8_t RESERVED_2[4]; - __IO uint32_t MCCR0; /**< Controller Clock Configuration 0, offset: 0x48 */ - uint8_t RESERVED_3[4]; - __IO uint32_t MCCR1; /**< Controller Clock Configuration 1, offset: 0x50 */ - uint8_t RESERVED_4[4]; - __IO uint32_t MFCR; /**< Controller FIFO Control, offset: 0x58 */ - __I uint32_t MFSR; /**< Controller FIFO Status, offset: 0x5C */ - __O uint32_t MTDR; /**< Controller Transmit Data, offset: 0x60 */ - uint8_t RESERVED_5[12]; - __I uint32_t MRDR; /**< Controller Receive Data, offset: 0x70 */ - uint8_t RESERVED_6[4]; - __I uint32_t MRDROR; /**< Controller Receive Data Read Only, offset: 0x78 */ - uint8_t RESERVED_7[148]; - __IO uint32_t SCR; /**< Target Control, offset: 0x110 */ - __IO uint32_t SSR; /**< Target Status, offset: 0x114 */ - __IO uint32_t SIER; /**< Target Interrupt Enable, offset: 0x118 */ - __IO uint32_t SDER; /**< Target DMA Enable, offset: 0x11C */ - __IO uint32_t SCFGR0; /**< Target Configuration 0, offset: 0x120 */ - __IO uint32_t SCFGR1; /**< Target Configuration 1, offset: 0x124 */ - __IO uint32_t SCFGR2; /**< Target Configuration 2, offset: 0x128 */ - uint8_t RESERVED_8[20]; - __IO uint32_t SAMR; /**< Target Address Match, offset: 0x140 */ - uint8_t RESERVED_9[12]; - __I uint32_t SASR; /**< Target Address Status, offset: 0x150 */ - __IO uint32_t STAR; /**< Target Transmit ACK, offset: 0x154 */ - uint8_t RESERVED_10[8]; - __O uint32_t STDR; /**< Target Transmit Data, offset: 0x160 */ - uint8_t RESERVED_11[12]; - __I uint32_t SRDR; /**< Target Receive Data, offset: 0x170 */ - uint8_t RESERVED_12[4]; - __I uint32_t SRDROR; /**< Target Receive Data Read Only, offset: 0x178 */ - uint8_t RESERVED_13[132]; - __O uint32_t MTCBR[128]; /**< Controller Transmit Command Burst, array offset: 0x200, array step: 0x4 */ - __O uint32_t MTDBR[253]; /**< Transmit Data Burst, array offset: 0x400, array step: 0x4 */ -} LPI2C_Type; - -/* ---------------------------------------------------------------------------- - -- LPI2C Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPI2C_Register_Masks LPI2C Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define LPI2C_VERID_FEATURE_MASK (0xFFFFU) -#define LPI2C_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000010..Controller only, with standard feature set - * 0b0000000000000011..Controller and target, with standard feature set - */ -#define LPI2C_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_VERID_FEATURE_SHIFT)) & LPI2C_VERID_FEATURE_MASK) - -#define LPI2C_VERID_MINOR_MASK (0xFF0000U) -#define LPI2C_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define LPI2C_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_VERID_MINOR_SHIFT)) & LPI2C_VERID_MINOR_MASK) - -#define LPI2C_VERID_MAJOR_MASK (0xFF000000U) -#define LPI2C_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define LPI2C_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_VERID_MAJOR_SHIFT)) & LPI2C_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define LPI2C_PARAM_MTXFIFO_MASK (0xFU) -#define LPI2C_PARAM_MTXFIFO_SHIFT (0U) -/*! MTXFIFO - Controller Transmit FIFO Size */ -#define LPI2C_PARAM_MTXFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_PARAM_MTXFIFO_SHIFT)) & LPI2C_PARAM_MTXFIFO_MASK) - -#define LPI2C_PARAM_MRXFIFO_MASK (0xF00U) -#define LPI2C_PARAM_MRXFIFO_SHIFT (8U) -/*! MRXFIFO - Controller Receive FIFO Size */ -#define LPI2C_PARAM_MRXFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_PARAM_MRXFIFO_SHIFT)) & LPI2C_PARAM_MRXFIFO_MASK) -/*! @} */ - -/*! @name MCR - Controller Control */ -/*! @{ */ - -#define LPI2C_MCR_MEN_MASK (0x1U) -#define LPI2C_MCR_MEN_SHIFT (0U) -/*! MEN - Controller Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MCR_MEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCR_MEN_SHIFT)) & LPI2C_MCR_MEN_MASK) - -#define LPI2C_MCR_RST_MASK (0x2U) -#define LPI2C_MCR_RST_SHIFT (1U) -/*! RST - Software Reset - * 0b0..No effect - * 0b1..Reset - */ -#define LPI2C_MCR_RST(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCR_RST_SHIFT)) & LPI2C_MCR_RST_MASK) - -#define LPI2C_MCR_DOZEN_MASK (0x4U) -#define LPI2C_MCR_DOZEN_SHIFT (2U) -/*! DOZEN - Doze Mode Enable - * 0b0..Enable - * 0b1..Disable - */ -#define LPI2C_MCR_DOZEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCR_DOZEN_SHIFT)) & LPI2C_MCR_DOZEN_MASK) - -#define LPI2C_MCR_DBGEN_MASK (0x8U) -#define LPI2C_MCR_DBGEN_SHIFT (3U) -/*! DBGEN - Debug Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MCR_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCR_DBGEN_SHIFT)) & LPI2C_MCR_DBGEN_MASK) - -#define LPI2C_MCR_RTF_MASK (0x100U) -#define LPI2C_MCR_RTF_SHIFT (8U) -/*! RTF - Reset Transmit FIFO - * 0b0..No effect - * 0b1..Reset transmit FIFO - */ -#define LPI2C_MCR_RTF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCR_RTF_SHIFT)) & LPI2C_MCR_RTF_MASK) - -#define LPI2C_MCR_RRF_MASK (0x200U) -#define LPI2C_MCR_RRF_SHIFT (9U) -/*! RRF - Reset Receive FIFO - * 0b0..No effect - * 0b1..Reset receive FIFO - */ -#define LPI2C_MCR_RRF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCR_RRF_SHIFT)) & LPI2C_MCR_RRF_MASK) -/*! @} */ - -/*! @name MSR - Controller Status */ -/*! @{ */ - -#define LPI2C_MSR_TDF_MASK (0x1U) -#define LPI2C_MSR_TDF_SHIFT (0U) -/*! TDF - Transmit Data Flag - * 0b0..Transmit data not requested - * 0b1..Transmit data requested - */ -#define LPI2C_MSR_TDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_TDF_SHIFT)) & LPI2C_MSR_TDF_MASK) - -#define LPI2C_MSR_RDF_MASK (0x2U) -#define LPI2C_MSR_RDF_SHIFT (1U) -/*! RDF - Receive Data Flag - * 0b0..Receive data not ready - * 0b1..Receive data ready - */ -#define LPI2C_MSR_RDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_RDF_SHIFT)) & LPI2C_MSR_RDF_MASK) - -#define LPI2C_MSR_EPF_MASK (0x100U) -#define LPI2C_MSR_EPF_SHIFT (8U) -/*! EPF - End Packet Flag - * 0b0..No Stop or repeated Start generated - * 0b1..Stop or repeated Start generated - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_EPF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_EPF_SHIFT)) & LPI2C_MSR_EPF_MASK) - -#define LPI2C_MSR_SDF_MASK (0x200U) -#define LPI2C_MSR_SDF_SHIFT (9U) -/*! SDF - Stop Detect Flag - * 0b0..No Stop condition generated - * 0b1..Stop condition generated - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_SDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_SDF_SHIFT)) & LPI2C_MSR_SDF_MASK) - -#define LPI2C_MSR_NDF_MASK (0x400U) -#define LPI2C_MSR_NDF_SHIFT (10U) -/*! NDF - NACK Detect Flag - * 0b0..No unexpected NACK detected - * 0b1..Unexpected NACK detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_NDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_NDF_SHIFT)) & LPI2C_MSR_NDF_MASK) - -#define LPI2C_MSR_ALF_MASK (0x800U) -#define LPI2C_MSR_ALF_SHIFT (11U) -/*! ALF - Arbitration Lost Flag - * 0b0..Controller did not lose arbitration - * 0b1..Controller lost arbitration - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_ALF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_ALF_SHIFT)) & LPI2C_MSR_ALF_MASK) - -#define LPI2C_MSR_FEF_MASK (0x1000U) -#define LPI2C_MSR_FEF_SHIFT (12U) -/*! FEF - FIFO Error Flag - * 0b0..No FIFO error - * 0b1..FIFO error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_FEF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_FEF_SHIFT)) & LPI2C_MSR_FEF_MASK) - -#define LPI2C_MSR_PLTF_MASK (0x2000U) -#define LPI2C_MSR_PLTF_SHIFT (13U) -/*! PLTF - Pin Low Timeout Flag - * 0b0..Pin low timeout did not occur - * 0b1..Pin low timeout occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_PLTF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_PLTF_SHIFT)) & LPI2C_MSR_PLTF_MASK) - -#define LPI2C_MSR_DMF_MASK (0x4000U) -#define LPI2C_MSR_DMF_SHIFT (14U) -/*! DMF - Data Match Flag - * 0b0..Matching data not received - * 0b1..Matching data received - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_DMF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_DMF_SHIFT)) & LPI2C_MSR_DMF_MASK) - -#define LPI2C_MSR_STF_MASK (0x8000U) -#define LPI2C_MSR_STF_SHIFT (15U) -/*! STF - Start Flag - * 0b0..Start condition not detected - * 0b1..Start condition detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_STF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_STF_SHIFT)) & LPI2C_MSR_STF_MASK) - -#define LPI2C_MSR_MBF_MASK (0x1000000U) -#define LPI2C_MSR_MBF_SHIFT (24U) -/*! MBF - Controller Busy Flag - * 0b0..Idle - * 0b1..Busy - */ -#define LPI2C_MSR_MBF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_MBF_SHIFT)) & LPI2C_MSR_MBF_MASK) - -#define LPI2C_MSR_BBF_MASK (0x2000000U) -#define LPI2C_MSR_BBF_SHIFT (25U) -/*! BBF - Bus Busy Flag - * 0b0..Idle - * 0b1..Busy - */ -#define LPI2C_MSR_BBF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_BBF_SHIFT)) & LPI2C_MSR_BBF_MASK) -/*! @} */ - -/*! @name MIER - Controller Interrupt Enable */ -/*! @{ */ - -#define LPI2C_MIER_TDIE_MASK (0x1U) -#define LPI2C_MIER_TDIE_SHIFT (0U) -/*! TDIE - Transmit Data Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_TDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_TDIE_SHIFT)) & LPI2C_MIER_TDIE_MASK) - -#define LPI2C_MIER_RDIE_MASK (0x2U) -#define LPI2C_MIER_RDIE_SHIFT (1U) -/*! RDIE - Receive Data Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_RDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_RDIE_SHIFT)) & LPI2C_MIER_RDIE_MASK) - -#define LPI2C_MIER_EPIE_MASK (0x100U) -#define LPI2C_MIER_EPIE_SHIFT (8U) -/*! EPIE - End Packet Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_EPIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_EPIE_SHIFT)) & LPI2C_MIER_EPIE_MASK) - -#define LPI2C_MIER_SDIE_MASK (0x200U) -#define LPI2C_MIER_SDIE_SHIFT (9U) -/*! SDIE - Stop Detect Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_SDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_SDIE_SHIFT)) & LPI2C_MIER_SDIE_MASK) - -#define LPI2C_MIER_NDIE_MASK (0x400U) -#define LPI2C_MIER_NDIE_SHIFT (10U) -/*! NDIE - NACK Detect Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_NDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_NDIE_SHIFT)) & LPI2C_MIER_NDIE_MASK) - -#define LPI2C_MIER_ALIE_MASK (0x800U) -#define LPI2C_MIER_ALIE_SHIFT (11U) -/*! ALIE - Arbitration Lost Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_ALIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_ALIE_SHIFT)) & LPI2C_MIER_ALIE_MASK) - -#define LPI2C_MIER_FEIE_MASK (0x1000U) -#define LPI2C_MIER_FEIE_SHIFT (12U) -/*! FEIE - FIFO Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_FEIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_FEIE_SHIFT)) & LPI2C_MIER_FEIE_MASK) - -#define LPI2C_MIER_PLTIE_MASK (0x2000U) -#define LPI2C_MIER_PLTIE_SHIFT (13U) -/*! PLTIE - Pin Low Timeout Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_PLTIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_PLTIE_SHIFT)) & LPI2C_MIER_PLTIE_MASK) - -#define LPI2C_MIER_DMIE_MASK (0x4000U) -#define LPI2C_MIER_DMIE_SHIFT (14U) -/*! DMIE - Data Match Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_DMIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_DMIE_SHIFT)) & LPI2C_MIER_DMIE_MASK) - -#define LPI2C_MIER_STIE_MASK (0x8000U) -#define LPI2C_MIER_STIE_SHIFT (15U) -/*! STIE - Start Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_STIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_STIE_SHIFT)) & LPI2C_MIER_STIE_MASK) -/*! @} */ - -/*! @name MDER - Controller DMA Enable */ -/*! @{ */ - -#define LPI2C_MDER_TDDE_MASK (0x1U) -#define LPI2C_MDER_TDDE_SHIFT (0U) -/*! TDDE - Transmit Data DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MDER_TDDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MDER_TDDE_SHIFT)) & LPI2C_MDER_TDDE_MASK) - -#define LPI2C_MDER_RDDE_MASK (0x2U) -#define LPI2C_MDER_RDDE_SHIFT (1U) -/*! RDDE - Receive Data DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MDER_RDDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MDER_RDDE_SHIFT)) & LPI2C_MDER_RDDE_MASK) -/*! @} */ - -/*! @name MCFGR0 - Controller Configuration 0 */ -/*! @{ */ - -#define LPI2C_MCFGR0_HREN_MASK (0x1U) -#define LPI2C_MCFGR0_HREN_SHIFT (0U) -/*! HREN - Host Request Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MCFGR0_HREN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_HREN_SHIFT)) & LPI2C_MCFGR0_HREN_MASK) - -#define LPI2C_MCFGR0_HRPOL_MASK (0x2U) -#define LPI2C_MCFGR0_HRPOL_SHIFT (1U) -/*! HRPOL - Host Request Polarity - * 0b0..Active low - * 0b1..Active high - */ -#define LPI2C_MCFGR0_HRPOL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_HRPOL_SHIFT)) & LPI2C_MCFGR0_HRPOL_MASK) - -#define LPI2C_MCFGR0_HRSEL_MASK (0x4U) -#define LPI2C_MCFGR0_HRSEL_SHIFT (2U) -/*! HRSEL - Host Request Select - * 0b0..Host request input is pin HREQ - * 0b1..Host request input is input trigger - */ -#define LPI2C_MCFGR0_HRSEL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_HRSEL_SHIFT)) & LPI2C_MCFGR0_HRSEL_MASK) - -#define LPI2C_MCFGR0_HRDIR_MASK (0x8U) -#define LPI2C_MCFGR0_HRDIR_SHIFT (3U) -/*! HRDIR - Host Request Direction - * 0b0..HREQ pin is input (for LPI2C controller) - * 0b1..HREQ pin is output (for LPI2C target) - */ -#define LPI2C_MCFGR0_HRDIR(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_HRDIR_SHIFT)) & LPI2C_MCFGR0_HRDIR_MASK) - -#define LPI2C_MCFGR0_CIRFIFO_MASK (0x100U) -#define LPI2C_MCFGR0_CIRFIFO_SHIFT (8U) -/*! CIRFIFO - Circular FIFO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MCFGR0_CIRFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_CIRFIFO_SHIFT)) & LPI2C_MCFGR0_CIRFIFO_MASK) - -#define LPI2C_MCFGR0_RDMO_MASK (0x200U) -#define LPI2C_MCFGR0_RDMO_SHIFT (9U) -/*! RDMO - Receive Data Match Only - * 0b0..Received data is stored in the receive FIFO - * 0b1..Received data is discarded unless MSR[DMF] is set - */ -#define LPI2C_MCFGR0_RDMO(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_RDMO_SHIFT)) & LPI2C_MCFGR0_RDMO_MASK) - -#define LPI2C_MCFGR0_RELAX_MASK (0x10000U) -#define LPI2C_MCFGR0_RELAX_SHIFT (16U) -/*! RELAX - Relaxed Mode - * 0b0..Normal transfer - * 0b1..Relaxed transfer - */ -#define LPI2C_MCFGR0_RELAX(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_RELAX_SHIFT)) & LPI2C_MCFGR0_RELAX_MASK) - -#define LPI2C_MCFGR0_ABORT_MASK (0x20000U) -#define LPI2C_MCFGR0_ABORT_SHIFT (17U) -/*! ABORT - Abort Transfer - * 0b0..Normal transfer - * 0b1..Abort existing transfer and do not start a new one - */ -#define LPI2C_MCFGR0_ABORT(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_ABORT_SHIFT)) & LPI2C_MCFGR0_ABORT_MASK) -/*! @} */ - -/*! @name MCFGR1 - Controller Configuration 1 */ -/*! @{ */ - -#define LPI2C_MCFGR1_PRESCALE_MASK (0x7U) -#define LPI2C_MCFGR1_PRESCALE_SHIFT (0U) -/*! PRESCALE - Prescaler - * 0b000..Divide by 1 - * 0b001..Divide by 2 - * 0b010..Divide by 4 - * 0b011..Divide by 8 - * 0b100..Divide by 16 - * 0b101..Divide by 32 - * 0b110..Divide by 64 - * 0b111..Divide by 128 - */ -#define LPI2C_MCFGR1_PRESCALE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_PRESCALE_SHIFT)) & LPI2C_MCFGR1_PRESCALE_MASK) - -#define LPI2C_MCFGR1_AUTOSTOP_MASK (0x100U) -#define LPI2C_MCFGR1_AUTOSTOP_SHIFT (8U) -/*! AUTOSTOP - Automatic Stop Generation - * 0b0..No effect - * 0b1..Stop automatically generated - */ -#define LPI2C_MCFGR1_AUTOSTOP(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_AUTOSTOP_SHIFT)) & LPI2C_MCFGR1_AUTOSTOP_MASK) - -#define LPI2C_MCFGR1_IGNACK_MASK (0x200U) -#define LPI2C_MCFGR1_IGNACK_SHIFT (9U) -/*! IGNACK - Ignore NACK - * 0b0..No effect - * 0b1..Treat a received NACK as an ACK - */ -#define LPI2C_MCFGR1_IGNACK(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_IGNACK_SHIFT)) & LPI2C_MCFGR1_IGNACK_MASK) - -#define LPI2C_MCFGR1_TIMECFG_MASK (0x400U) -#define LPI2C_MCFGR1_TIMECFG_SHIFT (10U) -/*! TIMECFG - Timeout Configuration - * 0b0..SCL - * 0b1..SCL or SDA - */ -#define LPI2C_MCFGR1_TIMECFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_TIMECFG_SHIFT)) & LPI2C_MCFGR1_TIMECFG_MASK) - -#define LPI2C_MCFGR1_STOPCFG_MASK (0x800U) -#define LPI2C_MCFGR1_STOPCFG_SHIFT (11U) -/*! STOPCFG - Stop Configuration - * 0b0..Any Stop condition - * 0b1..Last Stop condition - */ -#define LPI2C_MCFGR1_STOPCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_STOPCFG_SHIFT)) & LPI2C_MCFGR1_STOPCFG_MASK) - -#define LPI2C_MCFGR1_STARTCFG_MASK (0x1000U) -#define LPI2C_MCFGR1_STARTCFG_SHIFT (12U) -/*! STARTCFG - Start Configuration - * 0b0..Sets when both I2C bus and LPI2C controller are idle - * 0b1..Sets when I2C bus is idle - */ -#define LPI2C_MCFGR1_STARTCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_STARTCFG_SHIFT)) & LPI2C_MCFGR1_STARTCFG_MASK) - -#define LPI2C_MCFGR1_MATCFG_MASK (0x70000U) -#define LPI2C_MCFGR1_MATCFG_SHIFT (16U) -/*! MATCFG - Match Configuration - * 0b000..Match is disabled - * 0b001..Reserved - * 0b010..Match is enabled: first data word equals MDMR[MATCH0] OR MDMR[MATCH1] - * 0b011..Match is enabled: any data word equals MDMR[MATCH0] OR MDMR[MATCH1] - * 0b100..Match is enabled: (first data word equals MDMR[MATCH0]) AND (second data word equals MDMR[MATCH1) - * 0b101..Match is enabled: (any data word equals MDMR[MATCH0]) AND (next data word equals MDMR[MATCH1) - * 0b110..Match is enabled: (first data word AND MDMR[MATCH1]) equals (MDMR[MATCH0] AND MDMR[MATCH1]) - * 0b111..Match is enabled: (any data word AND MDMR[MATCH1]) equals (MDMR[MATCH0] AND MDMR[MATCH1]) - */ -#define LPI2C_MCFGR1_MATCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_MATCFG_SHIFT)) & LPI2C_MCFGR1_MATCFG_MASK) - -#define LPI2C_MCFGR1_PINCFG_MASK (0x7000000U) -#define LPI2C_MCFGR1_PINCFG_SHIFT (24U) -/*! PINCFG - Pin Configuration - * 0b000..Two-pin open drain mode - * 0b001..Two-pin output only mode (Ultra-Fast mode) - * 0b010..Two-pin push-pull mode - * 0b011..Four-pin push-pull mode - * 0b100..Two-pin open-drain mode with separate LPI2C target - * 0b101..Two-pin output only mode (Ultra-Fast mode) with separate LPI2C target - * 0b110..Two-pin push-pull mode with separate LPI2C target - * 0b111..Four-pin push-pull mode (inverted outputs) - */ -#define LPI2C_MCFGR1_PINCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_PINCFG_SHIFT)) & LPI2C_MCFGR1_PINCFG_MASK) -/*! @} */ - -/*! @name MCFGR2 - Controller Configuration 2 */ -/*! @{ */ - -#define LPI2C_MCFGR2_BUSIDLE_MASK (0xFFFU) -#define LPI2C_MCFGR2_BUSIDLE_SHIFT (0U) -/*! BUSIDLE - Bus Idle Timeout */ -#define LPI2C_MCFGR2_BUSIDLE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR2_BUSIDLE_SHIFT)) & LPI2C_MCFGR2_BUSIDLE_MASK) - -#define LPI2C_MCFGR2_FILTSCL_MASK (0xF0000U) -#define LPI2C_MCFGR2_FILTSCL_SHIFT (16U) -/*! FILTSCL - Glitch Filter SCL */ -#define LPI2C_MCFGR2_FILTSCL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR2_FILTSCL_SHIFT)) & LPI2C_MCFGR2_FILTSCL_MASK) - -#define LPI2C_MCFGR2_FILTSDA_MASK (0xF000000U) -#define LPI2C_MCFGR2_FILTSDA_SHIFT (24U) -/*! FILTSDA - Glitch Filter SDA */ -#define LPI2C_MCFGR2_FILTSDA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR2_FILTSDA_SHIFT)) & LPI2C_MCFGR2_FILTSDA_MASK) -/*! @} */ - -/*! @name MCFGR3 - Controller Configuration 3 */ -/*! @{ */ - -#define LPI2C_MCFGR3_PINLOW_MASK (0xFFF00U) -#define LPI2C_MCFGR3_PINLOW_SHIFT (8U) -/*! PINLOW - Pin Low Timeout */ -#define LPI2C_MCFGR3_PINLOW(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR3_PINLOW_SHIFT)) & LPI2C_MCFGR3_PINLOW_MASK) -/*! @} */ - -/*! @name MDMR - Controller Data Match */ -/*! @{ */ - -#define LPI2C_MDMR_MATCH0_MASK (0xFFU) -#define LPI2C_MDMR_MATCH0_SHIFT (0U) -/*! MATCH0 - Match 0 Value */ -#define LPI2C_MDMR_MATCH0(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MDMR_MATCH0_SHIFT)) & LPI2C_MDMR_MATCH0_MASK) - -#define LPI2C_MDMR_MATCH1_MASK (0xFF0000U) -#define LPI2C_MDMR_MATCH1_SHIFT (16U) -/*! MATCH1 - Match 1 Value */ -#define LPI2C_MDMR_MATCH1(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MDMR_MATCH1_SHIFT)) & LPI2C_MDMR_MATCH1_MASK) -/*! @} */ - -/*! @name MCCR0 - Controller Clock Configuration 0 */ -/*! @{ */ - -#define LPI2C_MCCR0_CLKLO_MASK (0x3FU) -#define LPI2C_MCCR0_CLKLO_SHIFT (0U) -/*! CLKLO - Clock Low Period */ -#define LPI2C_MCCR0_CLKLO(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR0_CLKLO_SHIFT)) & LPI2C_MCCR0_CLKLO_MASK) - -#define LPI2C_MCCR0_CLKHI_MASK (0x3F00U) -#define LPI2C_MCCR0_CLKHI_SHIFT (8U) -/*! CLKHI - Clock High Period */ -#define LPI2C_MCCR0_CLKHI(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR0_CLKHI_SHIFT)) & LPI2C_MCCR0_CLKHI_MASK) - -#define LPI2C_MCCR0_SETHOLD_MASK (0x3F0000U) -#define LPI2C_MCCR0_SETHOLD_SHIFT (16U) -/*! SETHOLD - Setup Hold Delay */ -#define LPI2C_MCCR0_SETHOLD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR0_SETHOLD_SHIFT)) & LPI2C_MCCR0_SETHOLD_MASK) - -#define LPI2C_MCCR0_DATAVD_MASK (0x3F000000U) -#define LPI2C_MCCR0_DATAVD_SHIFT (24U) -/*! DATAVD - Data Valid Delay */ -#define LPI2C_MCCR0_DATAVD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR0_DATAVD_SHIFT)) & LPI2C_MCCR0_DATAVD_MASK) -/*! @} */ - -/*! @name MCCR1 - Controller Clock Configuration 1 */ -/*! @{ */ - -#define LPI2C_MCCR1_CLKLO_MASK (0x3FU) -#define LPI2C_MCCR1_CLKLO_SHIFT (0U) -/*! CLKLO - Clock Low Period */ -#define LPI2C_MCCR1_CLKLO(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR1_CLKLO_SHIFT)) & LPI2C_MCCR1_CLKLO_MASK) - -#define LPI2C_MCCR1_CLKHI_MASK (0x3F00U) -#define LPI2C_MCCR1_CLKHI_SHIFT (8U) -/*! CLKHI - Clock High Period */ -#define LPI2C_MCCR1_CLKHI(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR1_CLKHI_SHIFT)) & LPI2C_MCCR1_CLKHI_MASK) - -#define LPI2C_MCCR1_SETHOLD_MASK (0x3F0000U) -#define LPI2C_MCCR1_SETHOLD_SHIFT (16U) -/*! SETHOLD - Setup Hold Delay */ -#define LPI2C_MCCR1_SETHOLD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR1_SETHOLD_SHIFT)) & LPI2C_MCCR1_SETHOLD_MASK) - -#define LPI2C_MCCR1_DATAVD_MASK (0x3F000000U) -#define LPI2C_MCCR1_DATAVD_SHIFT (24U) -/*! DATAVD - Data Valid Delay */ -#define LPI2C_MCCR1_DATAVD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR1_DATAVD_SHIFT)) & LPI2C_MCCR1_DATAVD_MASK) -/*! @} */ - -/*! @name MFCR - Controller FIFO Control */ -/*! @{ */ - -#define LPI2C_MFCR_TXWATER_MASK (0x7U) -#define LPI2C_MFCR_TXWATER_SHIFT (0U) -/*! TXWATER - Transmit FIFO Watermark */ -#define LPI2C_MFCR_TXWATER(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MFCR_TXWATER_SHIFT)) & LPI2C_MFCR_TXWATER_MASK) - -#define LPI2C_MFCR_RXWATER_MASK (0x70000U) -#define LPI2C_MFCR_RXWATER_SHIFT (16U) -/*! RXWATER - Receive FIFO Watermark */ -#define LPI2C_MFCR_RXWATER(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MFCR_RXWATER_SHIFT)) & LPI2C_MFCR_RXWATER_MASK) -/*! @} */ - -/*! @name MFSR - Controller FIFO Status */ -/*! @{ */ - -#define LPI2C_MFSR_TXCOUNT_MASK (0xFU) -#define LPI2C_MFSR_TXCOUNT_SHIFT (0U) -/*! TXCOUNT - Transmit FIFO Count */ -#define LPI2C_MFSR_TXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MFSR_TXCOUNT_SHIFT)) & LPI2C_MFSR_TXCOUNT_MASK) - -#define LPI2C_MFSR_RXCOUNT_MASK (0xF0000U) -#define LPI2C_MFSR_RXCOUNT_SHIFT (16U) -/*! RXCOUNT - Receive FIFO Count */ -#define LPI2C_MFSR_RXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MFSR_RXCOUNT_SHIFT)) & LPI2C_MFSR_RXCOUNT_MASK) -/*! @} */ - -/*! @name MTDR - Controller Transmit Data */ -/*! @{ */ - -#define LPI2C_MTDR_DATA_MASK (0xFFU) -#define LPI2C_MTDR_DATA_SHIFT (0U) -/*! DATA - Transmit Data */ -#define LPI2C_MTDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MTDR_DATA_SHIFT)) & LPI2C_MTDR_DATA_MASK) - -#define LPI2C_MTDR_CMD_MASK (0x700U) -#define LPI2C_MTDR_CMD_SHIFT (8U) -/*! CMD - Command Data - * 0b000..Transmit the value in DATA[7:0] - * 0b001..Receive (DATA[7:0] + 1) bytes - * 0b010..Generate Stop condition on I2C bus - * 0b011..Receive and discard (DATA[7:0] + 1) bytes - * 0b100..Generate (repeated) Start on the I2C bus and transmit the address in DATA[7:0] - * 0b101..Generate (repeated) Start on the I2C bus and transmit the address in DATA[7:0] (this transfer expects a NACK to be returned) - * 0b110..Generate (repeated) Start on the I2C bus and transmit the address in DATA[7:0] using HS mode - * 0b111..Generate (repeated) Start on the I2C bus and transmit the address in DATA[7:0] using HS mode (this transfer expects a NACK to be returned) - */ -#define LPI2C_MTDR_CMD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MTDR_CMD_SHIFT)) & LPI2C_MTDR_CMD_MASK) -/*! @} */ - -/*! @name MRDR - Controller Receive Data */ -/*! @{ */ - -#define LPI2C_MRDR_DATA_MASK (0xFFU) -#define LPI2C_MRDR_DATA_SHIFT (0U) -/*! DATA - Receive Data */ -#define LPI2C_MRDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MRDR_DATA_SHIFT)) & LPI2C_MRDR_DATA_MASK) - -#define LPI2C_MRDR_RXEMPTY_MASK (0x4000U) -#define LPI2C_MRDR_RXEMPTY_SHIFT (14U) -/*! RXEMPTY - Receive Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPI2C_MRDR_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MRDR_RXEMPTY_SHIFT)) & LPI2C_MRDR_RXEMPTY_MASK) -/*! @} */ - -/*! @name MRDROR - Controller Receive Data Read Only */ -/*! @{ */ - -#define LPI2C_MRDROR_DATA_MASK (0xFFU) -#define LPI2C_MRDROR_DATA_SHIFT (0U) -/*! DATA - Receive Data */ -#define LPI2C_MRDROR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MRDROR_DATA_SHIFT)) & LPI2C_MRDROR_DATA_MASK) - -#define LPI2C_MRDROR_RXEMPTY_MASK (0x4000U) -#define LPI2C_MRDROR_RXEMPTY_SHIFT (14U) -/*! RXEMPTY - RX Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPI2C_MRDROR_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MRDROR_RXEMPTY_SHIFT)) & LPI2C_MRDROR_RXEMPTY_MASK) -/*! @} */ - -/*! @name SCR - Target Control */ -/*! @{ */ - -#define LPI2C_SCR_SEN_MASK (0x1U) -#define LPI2C_SCR_SEN_SHIFT (0U) -/*! SEN - Target Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCR_SEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCR_SEN_SHIFT)) & LPI2C_SCR_SEN_MASK) - -#define LPI2C_SCR_RST_MASK (0x2U) -#define LPI2C_SCR_RST_SHIFT (1U) -/*! RST - Software Reset - * 0b0..Not reset - * 0b1..Reset - */ -#define LPI2C_SCR_RST(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCR_RST_SHIFT)) & LPI2C_SCR_RST_MASK) - -#define LPI2C_SCR_FILTEN_MASK (0x10U) -#define LPI2C_SCR_FILTEN_SHIFT (4U) -/*! FILTEN - Filter Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCR_FILTEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCR_FILTEN_SHIFT)) & LPI2C_SCR_FILTEN_MASK) - -#define LPI2C_SCR_FILTDZ_MASK (0x20U) -#define LPI2C_SCR_FILTDZ_SHIFT (5U) -/*! FILTDZ - Filter Doze Enable - * 0b0..Enable - * 0b1..Disable - */ -#define LPI2C_SCR_FILTDZ(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCR_FILTDZ_SHIFT)) & LPI2C_SCR_FILTDZ_MASK) - -#define LPI2C_SCR_RTF_MASK (0x100U) -#define LPI2C_SCR_RTF_SHIFT (8U) -/*! RTF - Reset Transmit FIFO - * 0b0..No effect - * 0b1..STDR is now empty - */ -#define LPI2C_SCR_RTF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCR_RTF_SHIFT)) & LPI2C_SCR_RTF_MASK) - -#define LPI2C_SCR_RRF_MASK (0x200U) -#define LPI2C_SCR_RRF_SHIFT (9U) -/*! RRF - Reset Receive FIFO - * 0b0..No effect - * 0b1..SRDR is now empty - */ -#define LPI2C_SCR_RRF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCR_RRF_SHIFT)) & LPI2C_SCR_RRF_MASK) -/*! @} */ - -/*! @name SSR - Target Status */ -/*! @{ */ - -#define LPI2C_SSR_TDF_MASK (0x1U) -#define LPI2C_SSR_TDF_SHIFT (0U) -/*! TDF - Transmit Data Flag - * 0b0..Transmit data not requested - * 0b1..Transmit data is requested - */ -#define LPI2C_SSR_TDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_TDF_SHIFT)) & LPI2C_SSR_TDF_MASK) - -#define LPI2C_SSR_RDF_MASK (0x2U) -#define LPI2C_SSR_RDF_SHIFT (1U) -/*! RDF - Receive Data Flag - * 0b0..Not ready - * 0b1..Ready - */ -#define LPI2C_SSR_RDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_RDF_SHIFT)) & LPI2C_SSR_RDF_MASK) - -#define LPI2C_SSR_AVF_MASK (0x4U) -#define LPI2C_SSR_AVF_SHIFT (2U) -/*! AVF - Address Valid Flag - * 0b0..Not valid - * 0b1..Valid - */ -#define LPI2C_SSR_AVF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_AVF_SHIFT)) & LPI2C_SSR_AVF_MASK) - -#define LPI2C_SSR_TAF_MASK (0x8U) -#define LPI2C_SSR_TAF_SHIFT (3U) -/*! TAF - Transmit ACK Flag - * 0b0..Not required - * 0b1..Required - */ -#define LPI2C_SSR_TAF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_TAF_SHIFT)) & LPI2C_SSR_TAF_MASK) - -#define LPI2C_SSR_RSF_MASK (0x100U) -#define LPI2C_SSR_RSF_SHIFT (8U) -/*! RSF - Repeated Start Flag - * 0b0..No repeated Start detected - * 0b1..Repeated Start detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_SSR_RSF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_RSF_SHIFT)) & LPI2C_SSR_RSF_MASK) - -#define LPI2C_SSR_SDF_MASK (0x200U) -#define LPI2C_SSR_SDF_SHIFT (9U) -/*! SDF - Stop Detect Flag - * 0b0..No Stop detected - * 0b1..Stop detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_SSR_SDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_SDF_SHIFT)) & LPI2C_SSR_SDF_MASK) - -#define LPI2C_SSR_BEF_MASK (0x400U) -#define LPI2C_SSR_BEF_SHIFT (10U) -/*! BEF - Bit Error Flag - * 0b0..No bit error occurred - * 0b1..Bit error occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_SSR_BEF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_BEF_SHIFT)) & LPI2C_SSR_BEF_MASK) - -#define LPI2C_SSR_FEF_MASK (0x800U) -#define LPI2C_SSR_FEF_SHIFT (11U) -/*! FEF - FIFO Error Flag - * 0b0..No FIFO error - * 0b1..FIFO error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_SSR_FEF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_FEF_SHIFT)) & LPI2C_SSR_FEF_MASK) - -#define LPI2C_SSR_AM0F_MASK (0x1000U) -#define LPI2C_SSR_AM0F_SHIFT (12U) -/*! AM0F - Address Match 0 Flag - * 0b0..ADDR0 matching address not received - * 0b1..ADDR0 matching address received - */ -#define LPI2C_SSR_AM0F(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_AM0F_SHIFT)) & LPI2C_SSR_AM0F_MASK) - -#define LPI2C_SSR_AM1F_MASK (0x2000U) -#define LPI2C_SSR_AM1F_SHIFT (13U) -/*! AM1F - Address Match 1 Flag - * 0b0..Matching address not received - * 0b1..Matching address received - */ -#define LPI2C_SSR_AM1F(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_AM1F_SHIFT)) & LPI2C_SSR_AM1F_MASK) - -#define LPI2C_SSR_GCF_MASK (0x4000U) -#define LPI2C_SSR_GCF_SHIFT (14U) -/*! GCF - General Call Flag - * 0b0..General call address disabled or not detected - * 0b1..General call address detected - */ -#define LPI2C_SSR_GCF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_GCF_SHIFT)) & LPI2C_SSR_GCF_MASK) - -#define LPI2C_SSR_SARF_MASK (0x8000U) -#define LPI2C_SSR_SARF_SHIFT (15U) -/*! SARF - SMBus Alert Response Flag - * 0b0..Disabled or not detected - * 0b1..Enabled and detected - */ -#define LPI2C_SSR_SARF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_SARF_SHIFT)) & LPI2C_SSR_SARF_MASK) - -#define LPI2C_SSR_SBF_MASK (0x1000000U) -#define LPI2C_SSR_SBF_SHIFT (24U) -/*! SBF - Target Busy Flag - * 0b0..Idle - * 0b1..Busy - */ -#define LPI2C_SSR_SBF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_SBF_SHIFT)) & LPI2C_SSR_SBF_MASK) - -#define LPI2C_SSR_BBF_MASK (0x2000000U) -#define LPI2C_SSR_BBF_SHIFT (25U) -/*! BBF - Bus Busy Flag - * 0b0..Idle - * 0b1..Busy - */ -#define LPI2C_SSR_BBF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_BBF_SHIFT)) & LPI2C_SSR_BBF_MASK) -/*! @} */ - -/*! @name SIER - Target Interrupt Enable */ -/*! @{ */ - -#define LPI2C_SIER_TDIE_MASK (0x1U) -#define LPI2C_SIER_TDIE_SHIFT (0U) -/*! TDIE - Transmit Data Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_TDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_TDIE_SHIFT)) & LPI2C_SIER_TDIE_MASK) - -#define LPI2C_SIER_RDIE_MASK (0x2U) -#define LPI2C_SIER_RDIE_SHIFT (1U) -/*! RDIE - Receive Data Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_RDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_RDIE_SHIFT)) & LPI2C_SIER_RDIE_MASK) - -#define LPI2C_SIER_AVIE_MASK (0x4U) -#define LPI2C_SIER_AVIE_SHIFT (2U) -/*! AVIE - Address Valid Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_AVIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_AVIE_SHIFT)) & LPI2C_SIER_AVIE_MASK) - -#define LPI2C_SIER_TAIE_MASK (0x8U) -#define LPI2C_SIER_TAIE_SHIFT (3U) -/*! TAIE - Transmit ACK Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_TAIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_TAIE_SHIFT)) & LPI2C_SIER_TAIE_MASK) - -#define LPI2C_SIER_RSIE_MASK (0x100U) -#define LPI2C_SIER_RSIE_SHIFT (8U) -/*! RSIE - Repeated Start Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_RSIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_RSIE_SHIFT)) & LPI2C_SIER_RSIE_MASK) - -#define LPI2C_SIER_SDIE_MASK (0x200U) -#define LPI2C_SIER_SDIE_SHIFT (9U) -/*! SDIE - Stop Detect Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_SDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_SDIE_SHIFT)) & LPI2C_SIER_SDIE_MASK) - -#define LPI2C_SIER_BEIE_MASK (0x400U) -#define LPI2C_SIER_BEIE_SHIFT (10U) -/*! BEIE - Bit Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_BEIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_BEIE_SHIFT)) & LPI2C_SIER_BEIE_MASK) - -#define LPI2C_SIER_FEIE_MASK (0x800U) -#define LPI2C_SIER_FEIE_SHIFT (11U) -/*! FEIE - FIFO Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_FEIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_FEIE_SHIFT)) & LPI2C_SIER_FEIE_MASK) - -#define LPI2C_SIER_AM0IE_MASK (0x1000U) -#define LPI2C_SIER_AM0IE_SHIFT (12U) -/*! AM0IE - Address Match 0 Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_AM0IE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_AM0IE_SHIFT)) & LPI2C_SIER_AM0IE_MASK) - -#define LPI2C_SIER_AM1IE_MASK (0x2000U) -#define LPI2C_SIER_AM1IE_SHIFT (13U) -/*! AM1IE - Address Match 1 Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_AM1IE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_AM1IE_SHIFT)) & LPI2C_SIER_AM1IE_MASK) - -#define LPI2C_SIER_GCIE_MASK (0x4000U) -#define LPI2C_SIER_GCIE_SHIFT (14U) -/*! GCIE - General Call Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define LPI2C_SIER_GCIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_GCIE_SHIFT)) & LPI2C_SIER_GCIE_MASK) - -#define LPI2C_SIER_SARIE_MASK (0x8000U) -#define LPI2C_SIER_SARIE_SHIFT (15U) -/*! SARIE - SMBus Alert Response Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_SARIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_SARIE_SHIFT)) & LPI2C_SIER_SARIE_MASK) -/*! @} */ - -/*! @name SDER - Target DMA Enable */ -/*! @{ */ - -#define LPI2C_SDER_TDDE_MASK (0x1U) -#define LPI2C_SDER_TDDE_SHIFT (0U) -/*! TDDE - Transmit Data DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SDER_TDDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SDER_TDDE_SHIFT)) & LPI2C_SDER_TDDE_MASK) - -#define LPI2C_SDER_RDDE_MASK (0x2U) -#define LPI2C_SDER_RDDE_SHIFT (1U) -/*! RDDE - Receive Data DMA Enable - * 0b0..Disable DMA request - * 0b1..Enable DMA request - */ -#define LPI2C_SDER_RDDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SDER_RDDE_SHIFT)) & LPI2C_SDER_RDDE_MASK) - -#define LPI2C_SDER_AVDE_MASK (0x4U) -#define LPI2C_SDER_AVDE_SHIFT (2U) -/*! AVDE - Address Valid DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SDER_AVDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SDER_AVDE_SHIFT)) & LPI2C_SDER_AVDE_MASK) - -#define LPI2C_SDER_RSDE_MASK (0x100U) -#define LPI2C_SDER_RSDE_SHIFT (8U) -/*! RSDE - Repeated Start DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SDER_RSDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SDER_RSDE_SHIFT)) & LPI2C_SDER_RSDE_MASK) - -#define LPI2C_SDER_SDDE_MASK (0x200U) -#define LPI2C_SDER_SDDE_SHIFT (9U) -/*! SDDE - Stop Detect DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SDER_SDDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SDER_SDDE_SHIFT)) & LPI2C_SDER_SDDE_MASK) -/*! @} */ - -/*! @name SCFGR0 - Target Configuration 0 */ -/*! @{ */ - -#define LPI2C_SCFGR0_RDREQ_MASK (0x1U) -#define LPI2C_SCFGR0_RDREQ_SHIFT (0U) -/*! RDREQ - Read Request - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR0_RDREQ(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR0_RDREQ_SHIFT)) & LPI2C_SCFGR0_RDREQ_MASK) - -#define LPI2C_SCFGR0_RDACK_MASK (0x2U) -#define LPI2C_SCFGR0_RDACK_SHIFT (1U) -/*! RDACK - Read Acknowledge Flag - * 0b0..Read Request not acknowledged - * 0b1..Read Request acknowledged - */ -#define LPI2C_SCFGR0_RDACK(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR0_RDACK_SHIFT)) & LPI2C_SCFGR0_RDACK_MASK) -/*! @} */ - -/*! @name SCFGR1 - Target Configuration 1 */ -/*! @{ */ - -#define LPI2C_SCFGR1_ADRSTALL_MASK (0x1U) -#define LPI2C_SCFGR1_ADRSTALL_SHIFT (0U) -/*! ADRSTALL - Address SCL Stall - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_ADRSTALL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_ADRSTALL_SHIFT)) & LPI2C_SCFGR1_ADRSTALL_MASK) - -#define LPI2C_SCFGR1_RXSTALL_MASK (0x2U) -#define LPI2C_SCFGR1_RXSTALL_SHIFT (1U) -/*! RXSTALL - RX SCL Stall - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_RXSTALL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_RXSTALL_SHIFT)) & LPI2C_SCFGR1_RXSTALL_MASK) - -#define LPI2C_SCFGR1_TXDSTALL_MASK (0x4U) -#define LPI2C_SCFGR1_TXDSTALL_SHIFT (2U) -/*! TXDSTALL - Transmit Data SCL Stall - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_TXDSTALL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_TXDSTALL_SHIFT)) & LPI2C_SCFGR1_TXDSTALL_MASK) - -#define LPI2C_SCFGR1_ACKSTALL_MASK (0x8U) -#define LPI2C_SCFGR1_ACKSTALL_SHIFT (3U) -/*! ACKSTALL - ACK SCL Stall - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_ACKSTALL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_ACKSTALL_SHIFT)) & LPI2C_SCFGR1_ACKSTALL_MASK) - -#define LPI2C_SCFGR1_RXNACK_MASK (0x10U) -#define LPI2C_SCFGR1_RXNACK_SHIFT (4U) -/*! RXNACK - Receive NACK - * 0b0..ACK or NACK always determined by STAR[TXNACK] - * 0b1..NACK always generated on address overrun or receive data overrun, otherwise ACK or NACK is determined by STAR[TXNACK] - */ -#define LPI2C_SCFGR1_RXNACK(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_RXNACK_SHIFT)) & LPI2C_SCFGR1_RXNACK_MASK) - -#define LPI2C_SCFGR1_GCEN_MASK (0x100U) -#define LPI2C_SCFGR1_GCEN_SHIFT (8U) -/*! GCEN - General Call Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_GCEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_GCEN_SHIFT)) & LPI2C_SCFGR1_GCEN_MASK) - -#define LPI2C_SCFGR1_SAEN_MASK (0x200U) -#define LPI2C_SCFGR1_SAEN_SHIFT (9U) -/*! SAEN - SMBus Alert Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_SAEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_SAEN_SHIFT)) & LPI2C_SCFGR1_SAEN_MASK) - -#define LPI2C_SCFGR1_TXCFG_MASK (0x400U) -#define LPI2C_SCFGR1_TXCFG_SHIFT (10U) -/*! TXCFG - Transmit Flag Configuration - * 0b0..MSR[TDF] is set only during a target-transmit transfer when STDR is empty - * 0b1..MSR[TDF] is set whenever STDR is empty - */ -#define LPI2C_SCFGR1_TXCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_TXCFG_SHIFT)) & LPI2C_SCFGR1_TXCFG_MASK) - -#define LPI2C_SCFGR1_RXCFG_MASK (0x800U) -#define LPI2C_SCFGR1_RXCFG_SHIFT (11U) -/*! RXCFG - Receive Data Configuration - * 0b0..Return received data, clear MSR[RDF] - * 0b1..Return SASR and clear SSR[AVF] when SSR[AVF] is set, return received data and clear MSR[RDF] when SSR[AFV] is not set - */ -#define LPI2C_SCFGR1_RXCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_RXCFG_SHIFT)) & LPI2C_SCFGR1_RXCFG_MASK) - -#define LPI2C_SCFGR1_IGNACK_MASK (0x1000U) -#define LPI2C_SCFGR1_IGNACK_SHIFT (12U) -/*! IGNACK - Ignore NACK - * 0b0..End transfer on NACK - * 0b1..Do not end transfer on NACK - */ -#define LPI2C_SCFGR1_IGNACK(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_IGNACK_SHIFT)) & LPI2C_SCFGR1_IGNACK_MASK) - -#define LPI2C_SCFGR1_HSMEN_MASK (0x2000U) -#define LPI2C_SCFGR1_HSMEN_SHIFT (13U) -/*! HSMEN - HS Mode Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_HSMEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_HSMEN_SHIFT)) & LPI2C_SCFGR1_HSMEN_MASK) - -#define LPI2C_SCFGR1_ADDRCFG_MASK (0x70000U) -#define LPI2C_SCFGR1_ADDRCFG_SHIFT (16U) -/*! ADDRCFG - Address Configuration - * 0b000..Address match 0 (7-bit) - * 0b001..Address match 0 (10-bit) - * 0b010..Address match 0 (7-bit) or address match 1 (7-bit) - * 0b011..Address match 0 (10-bit) or address match 1 (10-bit) - * 0b100..Address match 0 (7-bit) or address match 1 (10-bit) - * 0b101..Address match 0 (10-bit) or address match 1 (7-bit) - * 0b110..From address match 0 (7-bit) to address match 1 (7-bit) - * 0b111..From address match 0 (10-bit) to address match 1 (10-bit) - */ -#define LPI2C_SCFGR1_ADDRCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_ADDRCFG_SHIFT)) & LPI2C_SCFGR1_ADDRCFG_MASK) - -#define LPI2C_SCFGR1_RXALL_MASK (0x1000000U) -#define LPI2C_SCFGR1_RXALL_SHIFT (24U) -/*! RXALL - Receive All - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_RXALL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_RXALL_SHIFT)) & LPI2C_SCFGR1_RXALL_MASK) - -#define LPI2C_SCFGR1_RSCFG_MASK (0x2000000U) -#define LPI2C_SCFGR1_RSCFG_SHIFT (25U) -/*! RSCFG - Repeated Start Configuration - * 0b0..Any repeated Start condition following an address match - * 0b1..Any repeated Start condition - */ -#define LPI2C_SCFGR1_RSCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_RSCFG_SHIFT)) & LPI2C_SCFGR1_RSCFG_MASK) - -#define LPI2C_SCFGR1_SDCFG_MASK (0x4000000U) -#define LPI2C_SCFGR1_SDCFG_SHIFT (26U) -/*! SDCFG - Stop Detect Configuration - * 0b0..Any Stop condition following an address match - * 0b1..Any Stop condition - */ -#define LPI2C_SCFGR1_SDCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_SDCFG_SHIFT)) & LPI2C_SCFGR1_SDCFG_MASK) -/*! @} */ - -/*! @name SCFGR2 - Target Configuration 2 */ -/*! @{ */ - -#define LPI2C_SCFGR2_CLKHOLD_MASK (0xFU) -#define LPI2C_SCFGR2_CLKHOLD_SHIFT (0U) -/*! CLKHOLD - Clock Hold Time */ -#define LPI2C_SCFGR2_CLKHOLD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR2_CLKHOLD_SHIFT)) & LPI2C_SCFGR2_CLKHOLD_MASK) - -#define LPI2C_SCFGR2_DATAVD_MASK (0x3F00U) -#define LPI2C_SCFGR2_DATAVD_SHIFT (8U) -/*! DATAVD - Data Valid Delay */ -#define LPI2C_SCFGR2_DATAVD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR2_DATAVD_SHIFT)) & LPI2C_SCFGR2_DATAVD_MASK) - -#define LPI2C_SCFGR2_FILTSCL_MASK (0xF0000U) -#define LPI2C_SCFGR2_FILTSCL_SHIFT (16U) -/*! FILTSCL - Glitch Filter SCL */ -#define LPI2C_SCFGR2_FILTSCL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR2_FILTSCL_SHIFT)) & LPI2C_SCFGR2_FILTSCL_MASK) - -#define LPI2C_SCFGR2_FILTSDA_MASK (0xF000000U) -#define LPI2C_SCFGR2_FILTSDA_SHIFT (24U) -/*! FILTSDA - Glitch Filter SDA */ -#define LPI2C_SCFGR2_FILTSDA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR2_FILTSDA_SHIFT)) & LPI2C_SCFGR2_FILTSDA_MASK) -/*! @} */ - -/*! @name SAMR - Target Address Match */ -/*! @{ */ - -#define LPI2C_SAMR_ADDR0_MASK (0x7FEU) -#define LPI2C_SAMR_ADDR0_SHIFT (1U) -/*! ADDR0 - Address 0 Value */ -#define LPI2C_SAMR_ADDR0(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SAMR_ADDR0_SHIFT)) & LPI2C_SAMR_ADDR0_MASK) - -#define LPI2C_SAMR_ADDR1_MASK (0x7FE0000U) -#define LPI2C_SAMR_ADDR1_SHIFT (17U) -/*! ADDR1 - Address 1 Value */ -#define LPI2C_SAMR_ADDR1(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SAMR_ADDR1_SHIFT)) & LPI2C_SAMR_ADDR1_MASK) -/*! @} */ - -/*! @name SASR - Target Address Status */ -/*! @{ */ - -#define LPI2C_SASR_RADDR_MASK (0x7FFU) -#define LPI2C_SASR_RADDR_SHIFT (0U) -/*! RADDR - Received Address */ -#define LPI2C_SASR_RADDR(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SASR_RADDR_SHIFT)) & LPI2C_SASR_RADDR_MASK) - -#define LPI2C_SASR_ANV_MASK (0x4000U) -#define LPI2C_SASR_ANV_SHIFT (14U) -/*! ANV - Address Not Valid - * 0b0..Valid - * 0b1..Not valid - */ -#define LPI2C_SASR_ANV(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SASR_ANV_SHIFT)) & LPI2C_SASR_ANV_MASK) -/*! @} */ - -/*! @name STAR - Target Transmit ACK */ -/*! @{ */ - -#define LPI2C_STAR_TXNACK_MASK (0x1U) -#define LPI2C_STAR_TXNACK_SHIFT (0U) -/*! TXNACK - Transmit NACK - * 0b0..Transmit ACK - * 0b1..Transmit NACK - */ -#define LPI2C_STAR_TXNACK(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_STAR_TXNACK_SHIFT)) & LPI2C_STAR_TXNACK_MASK) -/*! @} */ - -/*! @name STDR - Target Transmit Data */ -/*! @{ */ - -#define LPI2C_STDR_DATA_MASK (0xFFU) -#define LPI2C_STDR_DATA_SHIFT (0U) -/*! DATA - Transmit Data */ -#define LPI2C_STDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_STDR_DATA_SHIFT)) & LPI2C_STDR_DATA_MASK) -/*! @} */ - -/*! @name SRDR - Target Receive Data */ -/*! @{ */ - -#define LPI2C_SRDR_DATA_MASK (0xFFU) -#define LPI2C_SRDR_DATA_SHIFT (0U) -/*! DATA - Received Data */ -#define LPI2C_SRDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDR_DATA_SHIFT)) & LPI2C_SRDR_DATA_MASK) - -#define LPI2C_SRDR_RADDR_MASK (0x700U) -#define LPI2C_SRDR_RADDR_SHIFT (8U) -/*! RADDR - Received Address */ -#define LPI2C_SRDR_RADDR(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDR_RADDR_SHIFT)) & LPI2C_SRDR_RADDR_MASK) - -#define LPI2C_SRDR_RXEMPTY_MASK (0x4000U) -#define LPI2C_SRDR_RXEMPTY_SHIFT (14U) -/*! RXEMPTY - Receive Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPI2C_SRDR_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDR_RXEMPTY_SHIFT)) & LPI2C_SRDR_RXEMPTY_MASK) - -#define LPI2C_SRDR_SOF_MASK (0x8000U) -#define LPI2C_SRDR_SOF_SHIFT (15U) -/*! SOF - Start of Frame - * 0b0..Not first - * 0b1..First - */ -#define LPI2C_SRDR_SOF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDR_SOF_SHIFT)) & LPI2C_SRDR_SOF_MASK) -/*! @} */ - -/*! @name SRDROR - Target Receive Data Read Only */ -/*! @{ */ - -#define LPI2C_SRDROR_DATA_MASK (0xFFU) -#define LPI2C_SRDROR_DATA_SHIFT (0U) -/*! DATA - Receive Data */ -#define LPI2C_SRDROR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDROR_DATA_SHIFT)) & LPI2C_SRDROR_DATA_MASK) - -#define LPI2C_SRDROR_RADDR_MASK (0x700U) -#define LPI2C_SRDROR_RADDR_SHIFT (8U) -/*! RADDR - Received Address */ -#define LPI2C_SRDROR_RADDR(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDROR_RADDR_SHIFT)) & LPI2C_SRDROR_RADDR_MASK) - -#define LPI2C_SRDROR_RXEMPTY_MASK (0x4000U) -#define LPI2C_SRDROR_RXEMPTY_SHIFT (14U) -/*! RXEMPTY - Receive Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPI2C_SRDROR_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDROR_RXEMPTY_SHIFT)) & LPI2C_SRDROR_RXEMPTY_MASK) - -#define LPI2C_SRDROR_SOF_MASK (0x8000U) -#define LPI2C_SRDROR_SOF_SHIFT (15U) -/*! SOF - Start of Frame - * 0b0..Not the first - * 0b1..First - */ -#define LPI2C_SRDROR_SOF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDROR_SOF_SHIFT)) & LPI2C_SRDROR_SOF_MASK) -/*! @} */ - -/*! @name MTCBR - Controller Transmit Command Burst */ -/*! @{ */ - -#define LPI2C_MTCBR_DATA_MASK (0xFFU) -#define LPI2C_MTCBR_DATA_SHIFT (0U) -/*! DATA - Data */ -#define LPI2C_MTCBR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MTCBR_DATA_SHIFT)) & LPI2C_MTCBR_DATA_MASK) - -#define LPI2C_MTCBR_CMD_MASK (0x700U) -#define LPI2C_MTCBR_CMD_SHIFT (8U) -/*! CMD - Command */ -#define LPI2C_MTCBR_CMD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MTCBR_CMD_SHIFT)) & LPI2C_MTCBR_CMD_MASK) -/*! @} */ - -/* The count of LPI2C_MTCBR */ -#define LPI2C_MTCBR_COUNT (128U) - -/*! @name MTDBR - Transmit Data Burst */ -/*! @{ */ - -#define LPI2C_MTDBR_DATA0_MASK (0xFFU) -#define LPI2C_MTDBR_DATA0_SHIFT (0U) -/*! DATA0 - Data */ -#define LPI2C_MTDBR_DATA0(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MTDBR_DATA0_SHIFT)) & LPI2C_MTDBR_DATA0_MASK) - -#define LPI2C_MTDBR_DATA1_MASK (0xFF00U) -#define LPI2C_MTDBR_DATA1_SHIFT (8U) -/*! DATA1 - Data */ -#define LPI2C_MTDBR_DATA1(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MTDBR_DATA1_SHIFT)) & LPI2C_MTDBR_DATA1_MASK) - -#define LPI2C_MTDBR_DATA2_MASK (0xFF0000U) -#define LPI2C_MTDBR_DATA2_SHIFT (16U) -/*! DATA2 - Data */ -#define LPI2C_MTDBR_DATA2(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MTDBR_DATA2_SHIFT)) & LPI2C_MTDBR_DATA2_MASK) - -#define LPI2C_MTDBR_DATA3_MASK (0xFF000000U) -#define LPI2C_MTDBR_DATA3_SHIFT (24U) -/*! DATA3 - Data */ -#define LPI2C_MTDBR_DATA3(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MTDBR_DATA3_SHIFT)) & LPI2C_MTDBR_DATA3_MASK) -/*! @} */ - -/* The count of LPI2C_MTDBR */ -#define LPI2C_MTDBR_COUNT (253U) - - -/*! - * @} - */ /* end of group LPI2C_Register_Masks */ - - -/* LPI2C - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral LPI2C0 base address */ - #define LPI2C0_BASE (0x50092800u) - /** Peripheral LPI2C0 base address */ - #define LPI2C0_BASE_NS (0x40092800u) - /** Peripheral LPI2C0 base pointer */ - #define LPI2C0 ((LPI2C_Type *)LPI2C0_BASE) - /** Peripheral LPI2C0 base pointer */ - #define LPI2C0_NS ((LPI2C_Type *)LPI2C0_BASE_NS) - /** Peripheral LPI2C1 base address */ - #define LPI2C1_BASE (0x50093800u) - /** Peripheral LPI2C1 base address */ - #define LPI2C1_BASE_NS (0x40093800u) - /** Peripheral LPI2C1 base pointer */ - #define LPI2C1 ((LPI2C_Type *)LPI2C1_BASE) - /** Peripheral LPI2C1 base pointer */ - #define LPI2C1_NS ((LPI2C_Type *)LPI2C1_BASE_NS) - /** Peripheral LPI2C2 base address */ - #define LPI2C2_BASE (0x50094800u) - /** Peripheral LPI2C2 base address */ - #define LPI2C2_BASE_NS (0x40094800u) - /** Peripheral LPI2C2 base pointer */ - #define LPI2C2 ((LPI2C_Type *)LPI2C2_BASE) - /** Peripheral LPI2C2 base pointer */ - #define LPI2C2_NS ((LPI2C_Type *)LPI2C2_BASE_NS) - /** Peripheral LPI2C3 base address */ - #define LPI2C3_BASE (0x50095800u) - /** Peripheral LPI2C3 base address */ - #define LPI2C3_BASE_NS (0x40095800u) - /** Peripheral LPI2C3 base pointer */ - #define LPI2C3 ((LPI2C_Type *)LPI2C3_BASE) - /** Peripheral LPI2C3 base pointer */ - #define LPI2C3_NS ((LPI2C_Type *)LPI2C3_BASE_NS) - /** Peripheral LPI2C4 base address */ - #define LPI2C4_BASE (0x500B4800u) - /** Peripheral LPI2C4 base address */ - #define LPI2C4_BASE_NS (0x400B4800u) - /** Peripheral LPI2C4 base pointer */ - #define LPI2C4 ((LPI2C_Type *)LPI2C4_BASE) - /** Peripheral LPI2C4 base pointer */ - #define LPI2C4_NS ((LPI2C_Type *)LPI2C4_BASE_NS) - /** Peripheral LPI2C5 base address */ - #define LPI2C5_BASE (0x500B5800u) - /** Peripheral LPI2C5 base address */ - #define LPI2C5_BASE_NS (0x400B5800u) - /** Peripheral LPI2C5 base pointer */ - #define LPI2C5 ((LPI2C_Type *)LPI2C5_BASE) - /** Peripheral LPI2C5 base pointer */ - #define LPI2C5_NS ((LPI2C_Type *)LPI2C5_BASE_NS) - /** Peripheral LPI2C6 base address */ - #define LPI2C6_BASE (0x500B6800u) - /** Peripheral LPI2C6 base address */ - #define LPI2C6_BASE_NS (0x400B6800u) - /** Peripheral LPI2C6 base pointer */ - #define LPI2C6 ((LPI2C_Type *)LPI2C6_BASE) - /** Peripheral LPI2C6 base pointer */ - #define LPI2C6_NS ((LPI2C_Type *)LPI2C6_BASE_NS) - /** Peripheral LPI2C7 base address */ - #define LPI2C7_BASE (0x500B7800u) - /** Peripheral LPI2C7 base address */ - #define LPI2C7_BASE_NS (0x400B7800u) - /** Peripheral LPI2C7 base pointer */ - #define LPI2C7 ((LPI2C_Type *)LPI2C7_BASE) - /** Peripheral LPI2C7 base pointer */ - #define LPI2C7_NS ((LPI2C_Type *)LPI2C7_BASE_NS) - /** Peripheral LPI2C8 base address */ - #define LPI2C8_BASE (0x500B8800u) - /** Peripheral LPI2C8 base address */ - #define LPI2C8_BASE_NS (0x400B8800u) - /** Peripheral LPI2C8 base pointer */ - #define LPI2C8 ((LPI2C_Type *)LPI2C8_BASE) - /** Peripheral LPI2C8 base pointer */ - #define LPI2C8_NS ((LPI2C_Type *)LPI2C8_BASE_NS) - /** Peripheral LPI2C9 base address */ - #define LPI2C9_BASE (0x500B9800u) - /** Peripheral LPI2C9 base address */ - #define LPI2C9_BASE_NS (0x400B9800u) - /** Peripheral LPI2C9 base pointer */ - #define LPI2C9 ((LPI2C_Type *)LPI2C9_BASE) - /** Peripheral LPI2C9 base pointer */ - #define LPI2C9_NS ((LPI2C_Type *)LPI2C9_BASE_NS) - /** Array initializer of LPI2C peripheral base addresses */ - #define LPI2C_BASE_ADDRS { LPI2C0_BASE, LPI2C1_BASE, LPI2C2_BASE, LPI2C3_BASE, LPI2C4_BASE, LPI2C5_BASE, LPI2C6_BASE, LPI2C7_BASE, LPI2C8_BASE, LPI2C9_BASE } - /** Array initializer of LPI2C peripheral base pointers */ - #define LPI2C_BASE_PTRS { LPI2C0, LPI2C1, LPI2C2, LPI2C3, LPI2C4, LPI2C5, LPI2C6, LPI2C7, LPI2C8, LPI2C9 } - /** Array initializer of LPI2C peripheral base addresses */ - #define LPI2C_BASE_ADDRS_NS { LPI2C0_BASE_NS, LPI2C1_BASE_NS, LPI2C2_BASE_NS, LPI2C3_BASE_NS, LPI2C4_BASE_NS, LPI2C5_BASE_NS, LPI2C6_BASE_NS, LPI2C7_BASE_NS, LPI2C8_BASE_NS, LPI2C9_BASE_NS } - /** Array initializer of LPI2C peripheral base pointers */ - #define LPI2C_BASE_PTRS_NS { LPI2C0_NS, LPI2C1_NS, LPI2C2_NS, LPI2C3_NS, LPI2C4_NS, LPI2C5_NS, LPI2C6_NS, LPI2C7_NS, LPI2C8_NS, LPI2C9_NS } -#else - /** Peripheral LPI2C0 base address */ - #define LPI2C0_BASE (0x40092800u) - /** Peripheral LPI2C0 base pointer */ - #define LPI2C0 ((LPI2C_Type *)LPI2C0_BASE) - /** Peripheral LPI2C1 base address */ - #define LPI2C1_BASE (0x40093800u) - /** Peripheral LPI2C1 base pointer */ - #define LPI2C1 ((LPI2C_Type *)LPI2C1_BASE) - /** Peripheral LPI2C2 base address */ - #define LPI2C2_BASE (0x40094800u) - /** Peripheral LPI2C2 base pointer */ - #define LPI2C2 ((LPI2C_Type *)LPI2C2_BASE) - /** Peripheral LPI2C3 base address */ - #define LPI2C3_BASE (0x40095800u) - /** Peripheral LPI2C3 base pointer */ - #define LPI2C3 ((LPI2C_Type *)LPI2C3_BASE) - /** Peripheral LPI2C4 base address */ - #define LPI2C4_BASE (0x400B4800u) - /** Peripheral LPI2C4 base pointer */ - #define LPI2C4 ((LPI2C_Type *)LPI2C4_BASE) - /** Peripheral LPI2C5 base address */ - #define LPI2C5_BASE (0x400B5800u) - /** Peripheral LPI2C5 base pointer */ - #define LPI2C5 ((LPI2C_Type *)LPI2C5_BASE) - /** Peripheral LPI2C6 base address */ - #define LPI2C6_BASE (0x400B6800u) - /** Peripheral LPI2C6 base pointer */ - #define LPI2C6 ((LPI2C_Type *)LPI2C6_BASE) - /** Peripheral LPI2C7 base address */ - #define LPI2C7_BASE (0x400B7800u) - /** Peripheral LPI2C7 base pointer */ - #define LPI2C7 ((LPI2C_Type *)LPI2C7_BASE) - /** Peripheral LPI2C8 base address */ - #define LPI2C8_BASE (0x400B8800u) - /** Peripheral LPI2C8 base pointer */ - #define LPI2C8 ((LPI2C_Type *)LPI2C8_BASE) - /** Peripheral LPI2C9 base address */ - #define LPI2C9_BASE (0x400B9800u) - /** Peripheral LPI2C9 base pointer */ - #define LPI2C9 ((LPI2C_Type *)LPI2C9_BASE) - /** Array initializer of LPI2C peripheral base addresses */ - #define LPI2C_BASE_ADDRS { LPI2C0_BASE, LPI2C1_BASE, LPI2C2_BASE, LPI2C3_BASE, LPI2C4_BASE, LPI2C5_BASE, LPI2C6_BASE, LPI2C7_BASE, LPI2C8_BASE, LPI2C9_BASE } - /** Array initializer of LPI2C peripheral base pointers */ - #define LPI2C_BASE_PTRS { LPI2C0, LPI2C1, LPI2C2, LPI2C3, LPI2C4, LPI2C5, LPI2C6, LPI2C7, LPI2C8, LPI2C9 } -#endif -/** Interrupt vectors for the LPI2C peripheral type */ -#define LPI2C_IRQS { LP_FLEXCOMM0_IRQn, LP_FLEXCOMM1_IRQn, LP_FLEXCOMM2_IRQn, LP_FLEXCOMM3_IRQn, LP_FLEXCOMM4_IRQn, LP_FLEXCOMM5_IRQn, LP_FLEXCOMM6_IRQn, LP_FLEXCOMM7_IRQn, LP_FLEXCOMM8_IRQn, LP_FLEXCOMM9_IRQn } - -/*! - * @} - */ /* end of group LPI2C_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LPSPI Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPSPI_Peripheral_Access_Layer LPSPI Peripheral Access Layer - * @{ - */ - -/** LPSPI - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - uint8_t RESERVED_0[8]; - __IO uint32_t CR; /**< Control, offset: 0x10 */ - __IO uint32_t SR; /**< Status, offset: 0x14 */ - __IO uint32_t IER; /**< Interrupt Enable, offset: 0x18 */ - __IO uint32_t DER; /**< DMA Enable, offset: 0x1C */ - __IO uint32_t CFGR0; /**< Configuration 0, offset: 0x20 */ - __IO uint32_t CFGR1; /**< Configuration 1, offset: 0x24 */ - uint8_t RESERVED_1[8]; - __IO uint32_t DMR0; /**< Data Match 0, offset: 0x30 */ - __IO uint32_t DMR1; /**< Data Match 1, offset: 0x34 */ - uint8_t RESERVED_2[8]; - __IO uint32_t CCR; /**< Clock Configuration, offset: 0x40 */ - __IO uint32_t CCR1; /**< Clock Configuration 1, offset: 0x44 */ - uint8_t RESERVED_3[16]; - __IO uint32_t FCR; /**< FIFO Control, offset: 0x58 */ - __I uint32_t FSR; /**< FIFO Status, offset: 0x5C */ - __IO uint32_t TCR; /**< Transmit Command, offset: 0x60 */ - __O uint32_t TDR; /**< Transmit Data, offset: 0x64 */ - uint8_t RESERVED_4[8]; - __I uint32_t RSR; /**< Receive Status, offset: 0x70 */ - __I uint32_t RDR; /**< Receive Data, offset: 0x74 */ - __I uint32_t RDROR; /**< Receive Data Read Only, offset: 0x78 */ - uint8_t RESERVED_5[896]; - __O uint32_t TCBR; /**< Transmit Command Burst, offset: 0x3FC */ - __O uint32_t TDBR[128]; /**< Transmit Data Burst, array offset: 0x400, array step: 0x4 */ - __I uint32_t RDBR[128]; /**< Receive Data Burst, array offset: 0x600, array step: 0x4 */ -} LPSPI_Type; - -/* ---------------------------------------------------------------------------- - -- LPSPI Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPSPI_Register_Masks LPSPI Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define LPSPI_VERID_FEATURE_MASK (0xFFFFU) -#define LPSPI_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Module Identification Number - * 0b0000000000000100..Standard feature set supporting a 32-bit shift register. - * *.. - */ -#define LPSPI_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_VERID_FEATURE_SHIFT)) & LPSPI_VERID_FEATURE_MASK) - -#define LPSPI_VERID_MINOR_MASK (0xFF0000U) -#define LPSPI_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define LPSPI_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_VERID_MINOR_SHIFT)) & LPSPI_VERID_MINOR_MASK) - -#define LPSPI_VERID_MAJOR_MASK (0xFF000000U) -#define LPSPI_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define LPSPI_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_VERID_MAJOR_SHIFT)) & LPSPI_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define LPSPI_PARAM_TXFIFO_MASK (0xFFU) -#define LPSPI_PARAM_TXFIFO_SHIFT (0U) -/*! TXFIFO - Transmit FIFO Size */ -#define LPSPI_PARAM_TXFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_PARAM_TXFIFO_SHIFT)) & LPSPI_PARAM_TXFIFO_MASK) - -#define LPSPI_PARAM_RXFIFO_MASK (0xFF00U) -#define LPSPI_PARAM_RXFIFO_SHIFT (8U) -/*! RXFIFO - Receive FIFO Size */ -#define LPSPI_PARAM_RXFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_PARAM_RXFIFO_SHIFT)) & LPSPI_PARAM_RXFIFO_MASK) - -#define LPSPI_PARAM_PCSNUM_MASK (0xFF0000U) -#define LPSPI_PARAM_PCSNUM_SHIFT (16U) -/*! PCSNUM - PCS Number */ -#define LPSPI_PARAM_PCSNUM(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_PARAM_PCSNUM_SHIFT)) & LPSPI_PARAM_PCSNUM_MASK) -/*! @} */ - -/*! @name CR - Control */ -/*! @{ */ - -#define LPSPI_CR_MEN_MASK (0x1U) -#define LPSPI_CR_MEN_SHIFT (0U) -/*! MEN - Module Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CR_MEN(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CR_MEN_SHIFT)) & LPSPI_CR_MEN_MASK) - -#define LPSPI_CR_RST_MASK (0x2U) -#define LPSPI_CR_RST_SHIFT (1U) -/*! RST - Software Reset - * 0b0..Not reset - * 0b1..Reset - */ -#define LPSPI_CR_RST(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CR_RST_SHIFT)) & LPSPI_CR_RST_MASK) - -#define LPSPI_CR_DBGEN_MASK (0x8U) -#define LPSPI_CR_DBGEN_SHIFT (3U) -/*! DBGEN - Debug Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CR_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CR_DBGEN_SHIFT)) & LPSPI_CR_DBGEN_MASK) - -#define LPSPI_CR_RTF_MASK (0x100U) -#define LPSPI_CR_RTF_SHIFT (8U) -/*! RTF - Reset Transmit FIFO - * 0b0..No effect - * 0b1..Reset - */ -#define LPSPI_CR_RTF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CR_RTF_SHIFT)) & LPSPI_CR_RTF_MASK) - -#define LPSPI_CR_RRF_MASK (0x200U) -#define LPSPI_CR_RRF_SHIFT (9U) -/*! RRF - Reset Receive FIFO - * 0b0..No effect - * 0b1..Reset - */ -#define LPSPI_CR_RRF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CR_RRF_SHIFT)) & LPSPI_CR_RRF_MASK) -/*! @} */ - -/*! @name SR - Status */ -/*! @{ */ - -#define LPSPI_SR_TDF_MASK (0x1U) -#define LPSPI_SR_TDF_SHIFT (0U) -/*! TDF - Transmit Data Flag - * 0b0..Transmit data not requested - * 0b1..Transmit data requested - */ -#define LPSPI_SR_TDF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_TDF_SHIFT)) & LPSPI_SR_TDF_MASK) - -#define LPSPI_SR_RDF_MASK (0x2U) -#define LPSPI_SR_RDF_SHIFT (1U) -/*! RDF - Receive Data Flag - * 0b0..Receive data not ready - * 0b1..Receive data ready - */ -#define LPSPI_SR_RDF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_RDF_SHIFT)) & LPSPI_SR_RDF_MASK) - -#define LPSPI_SR_WCF_MASK (0x100U) -#define LPSPI_SR_WCF_SHIFT (8U) -/*! WCF - Word Complete Flag - * 0b0..Not complete - * 0b1..Complete - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPSPI_SR_WCF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_WCF_SHIFT)) & LPSPI_SR_WCF_MASK) - -#define LPSPI_SR_FCF_MASK (0x200U) -#define LPSPI_SR_FCF_SHIFT (9U) -/*! FCF - Frame Complete Flag - * 0b0..Not complete - * 0b1..Complete - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPSPI_SR_FCF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_FCF_SHIFT)) & LPSPI_SR_FCF_MASK) - -#define LPSPI_SR_TCF_MASK (0x400U) -#define LPSPI_SR_TCF_SHIFT (10U) -/*! TCF - Transfer Complete Flag - * 0b0..Not complete - * 0b1..Complete - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPSPI_SR_TCF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_TCF_SHIFT)) & LPSPI_SR_TCF_MASK) - -#define LPSPI_SR_TEF_MASK (0x800U) -#define LPSPI_SR_TEF_SHIFT (11U) -/*! TEF - Transmit Error Flag - * 0b0..No underrun - * 0b1..Underrun - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPSPI_SR_TEF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_TEF_SHIFT)) & LPSPI_SR_TEF_MASK) - -#define LPSPI_SR_REF_MASK (0x1000U) -#define LPSPI_SR_REF_SHIFT (12U) -/*! REF - Receive Error Flag - * 0b0..No overflow - * 0b1..Overflow - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPSPI_SR_REF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_REF_SHIFT)) & LPSPI_SR_REF_MASK) - -#define LPSPI_SR_DMF_MASK (0x2000U) -#define LPSPI_SR_DMF_SHIFT (13U) -/*! DMF - Data Match Flag - * 0b0..No match - * 0b1..Match - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPSPI_SR_DMF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_DMF_SHIFT)) & LPSPI_SR_DMF_MASK) - -#define LPSPI_SR_MBF_MASK (0x1000000U) -#define LPSPI_SR_MBF_SHIFT (24U) -/*! MBF - Module Busy Flag - * 0b0..LPSPI is idle - * 0b1..LPSPI is busy - */ -#define LPSPI_SR_MBF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_MBF_SHIFT)) & LPSPI_SR_MBF_MASK) -/*! @} */ - -/*! @name IER - Interrupt Enable */ -/*! @{ */ - -#define LPSPI_IER_TDIE_MASK (0x1U) -#define LPSPI_IER_TDIE_SHIFT (0U) -/*! TDIE - Transmit Data Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_TDIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_TDIE_SHIFT)) & LPSPI_IER_TDIE_MASK) - -#define LPSPI_IER_RDIE_MASK (0x2U) -#define LPSPI_IER_RDIE_SHIFT (1U) -/*! RDIE - Receive Data Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_RDIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_RDIE_SHIFT)) & LPSPI_IER_RDIE_MASK) - -#define LPSPI_IER_WCIE_MASK (0x100U) -#define LPSPI_IER_WCIE_SHIFT (8U) -/*! WCIE - Word Complete Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_WCIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_WCIE_SHIFT)) & LPSPI_IER_WCIE_MASK) - -#define LPSPI_IER_FCIE_MASK (0x200U) -#define LPSPI_IER_FCIE_SHIFT (9U) -/*! FCIE - Frame Complete Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_FCIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_FCIE_SHIFT)) & LPSPI_IER_FCIE_MASK) - -#define LPSPI_IER_TCIE_MASK (0x400U) -#define LPSPI_IER_TCIE_SHIFT (10U) -/*! TCIE - Transfer Complete Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_TCIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_TCIE_SHIFT)) & LPSPI_IER_TCIE_MASK) - -#define LPSPI_IER_TEIE_MASK (0x800U) -#define LPSPI_IER_TEIE_SHIFT (11U) -/*! TEIE - Transmit Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_TEIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_TEIE_SHIFT)) & LPSPI_IER_TEIE_MASK) - -#define LPSPI_IER_REIE_MASK (0x1000U) -#define LPSPI_IER_REIE_SHIFT (12U) -/*! REIE - Receive Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_REIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_REIE_SHIFT)) & LPSPI_IER_REIE_MASK) - -#define LPSPI_IER_DMIE_MASK (0x2000U) -#define LPSPI_IER_DMIE_SHIFT (13U) -/*! DMIE - Data Match Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_DMIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_DMIE_SHIFT)) & LPSPI_IER_DMIE_MASK) -/*! @} */ - -/*! @name DER - DMA Enable */ -/*! @{ */ - -#define LPSPI_DER_TDDE_MASK (0x1U) -#define LPSPI_DER_TDDE_SHIFT (0U) -/*! TDDE - Transmit Data DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_DER_TDDE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_DER_TDDE_SHIFT)) & LPSPI_DER_TDDE_MASK) - -#define LPSPI_DER_RDDE_MASK (0x2U) -#define LPSPI_DER_RDDE_SHIFT (1U) -/*! RDDE - Receive Data DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_DER_RDDE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_DER_RDDE_SHIFT)) & LPSPI_DER_RDDE_MASK) - -#define LPSPI_DER_FCDE_MASK (0x200U) -#define LPSPI_DER_FCDE_SHIFT (9U) -/*! FCDE - Frame Complete DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_DER_FCDE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_DER_FCDE_SHIFT)) & LPSPI_DER_FCDE_MASK) -/*! @} */ - -/*! @name CFGR0 - Configuration 0 */ -/*! @{ */ - -#define LPSPI_CFGR0_HREN_MASK (0x1U) -#define LPSPI_CFGR0_HREN_SHIFT (0U) -/*! HREN - Host Request Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CFGR0_HREN(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR0_HREN_SHIFT)) & LPSPI_CFGR0_HREN_MASK) - -#define LPSPI_CFGR0_HRPOL_MASK (0x2U) -#define LPSPI_CFGR0_HRPOL_SHIFT (1U) -/*! HRPOL - Host Request Polarity - * 0b0..Active high - * 0b1..Active low - */ -#define LPSPI_CFGR0_HRPOL(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR0_HRPOL_SHIFT)) & LPSPI_CFGR0_HRPOL_MASK) - -#define LPSPI_CFGR0_HRSEL_MASK (0x4U) -#define LPSPI_CFGR0_HRSEL_SHIFT (2U) -/*! HRSEL - Host Request Select - * 0b0..HREQ pin - * 0b1..Input trigger - */ -#define LPSPI_CFGR0_HRSEL(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR0_HRSEL_SHIFT)) & LPSPI_CFGR0_HRSEL_MASK) - -#define LPSPI_CFGR0_HRDIR_MASK (0x8U) -#define LPSPI_CFGR0_HRDIR_SHIFT (3U) -/*! HRDIR - Host Request Direction - * 0b0..Input - * 0b1..Output - */ -#define LPSPI_CFGR0_HRDIR(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR0_HRDIR_SHIFT)) & LPSPI_CFGR0_HRDIR_MASK) - -#define LPSPI_CFGR0_CIRFIFO_MASK (0x100U) -#define LPSPI_CFGR0_CIRFIFO_SHIFT (8U) -/*! CIRFIFO - Circular FIFO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CFGR0_CIRFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR0_CIRFIFO_SHIFT)) & LPSPI_CFGR0_CIRFIFO_MASK) - -#define LPSPI_CFGR0_RDMO_MASK (0x200U) -#define LPSPI_CFGR0_RDMO_SHIFT (9U) -/*! RDMO - Receive Data Match Only - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CFGR0_RDMO(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR0_RDMO_SHIFT)) & LPSPI_CFGR0_RDMO_MASK) -/*! @} */ - -/*! @name CFGR1 - Configuration 1 */ -/*! @{ */ - -#define LPSPI_CFGR1_MASTER_MASK (0x1U) -#define LPSPI_CFGR1_MASTER_SHIFT (0U) -/*! MASTER - Master Mode - * 0b0..Slave mode - * 0b1..Master mode - */ -#define LPSPI_CFGR1_MASTER(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_MASTER_SHIFT)) & LPSPI_CFGR1_MASTER_MASK) - -#define LPSPI_CFGR1_SAMPLE_MASK (0x2U) -#define LPSPI_CFGR1_SAMPLE_SHIFT (1U) -/*! SAMPLE - Sample Point - * 0b0..SCK edge - * 0b1..Delayed SCK edge - */ -#define LPSPI_CFGR1_SAMPLE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_SAMPLE_SHIFT)) & LPSPI_CFGR1_SAMPLE_MASK) - -#define LPSPI_CFGR1_AUTOPCS_MASK (0x4U) -#define LPSPI_CFGR1_AUTOPCS_SHIFT (2U) -/*! AUTOPCS - Automatic PCS - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CFGR1_AUTOPCS(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_AUTOPCS_SHIFT)) & LPSPI_CFGR1_AUTOPCS_MASK) - -#define LPSPI_CFGR1_NOSTALL_MASK (0x8U) -#define LPSPI_CFGR1_NOSTALL_SHIFT (3U) -/*! NOSTALL - No Stall - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CFGR1_NOSTALL(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_NOSTALL_SHIFT)) & LPSPI_CFGR1_NOSTALL_MASK) - -#define LPSPI_CFGR1_PARTIAL_MASK (0x10U) -#define LPSPI_CFGR1_PARTIAL_SHIFT (4U) -/*! PARTIAL - Partial Enable - * 0b0..Discard - * 0b1..Store - */ -#define LPSPI_CFGR1_PARTIAL(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_PARTIAL_SHIFT)) & LPSPI_CFGR1_PARTIAL_MASK) - -#define LPSPI_CFGR1_PCSPOL_MASK (0xF00U) -#define LPSPI_CFGR1_PCSPOL_SHIFT (8U) -/*! PCSPOL - Peripheral Chip Select Polarity - * 0b0000..Active low - * 0b0001..Active high - */ -#define LPSPI_CFGR1_PCSPOL(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_PCSPOL_SHIFT)) & LPSPI_CFGR1_PCSPOL_MASK) - -#define LPSPI_CFGR1_MATCFG_MASK (0x70000U) -#define LPSPI_CFGR1_MATCFG_SHIFT (16U) -/*! MATCFG - Match Configuration - * 0b000..Match is disabled - * 0b001.. - * 0b010..Match first data word with compare word - * 0b011..Match any data word with compare word - * 0b100..Sequential match, first data word - * 0b101..Sequential match, any data word - * 0b110..Match first data word (masked) with compare word (masked) - * 0b111..Match any data word (masked) with compare word (masked) - */ -#define LPSPI_CFGR1_MATCFG(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_MATCFG_SHIFT)) & LPSPI_CFGR1_MATCFG_MASK) - -#define LPSPI_CFGR1_PINCFG_MASK (0x3000000U) -#define LPSPI_CFGR1_PINCFG_SHIFT (24U) -/*! PINCFG - Pin Configuration - * 0b00..SIN is used for input data; SOUT is used for output data - * 0b01..SIN is used for both input and output data; only half-duplex serial transfers are supported - * 0b10..SOUT is used for both input and output data; only half-duplex serial transfers are supported - * 0b11..SOUT is used for input data; SIN is used for output data - */ -#define LPSPI_CFGR1_PINCFG(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_PINCFG_SHIFT)) & LPSPI_CFGR1_PINCFG_MASK) - -#define LPSPI_CFGR1_OUTCFG_MASK (0x4000000U) -#define LPSPI_CFGR1_OUTCFG_SHIFT (26U) -/*! OUTCFG - Output Configuration - * 0b0..Retain last value - * 0b1..3-stated - */ -#define LPSPI_CFGR1_OUTCFG(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_OUTCFG_SHIFT)) & LPSPI_CFGR1_OUTCFG_MASK) - -#define LPSPI_CFGR1_PCSCFG_MASK (0x8000000U) -#define LPSPI_CFGR1_PCSCFG_SHIFT (27U) -/*! PCSCFG - Peripheral Chip Select Configuration - * 0b0..PCS[3:2] configured for chip select function - * 0b1..PCS[3:2] configured for half-duplex 4-bit transfers (PCS[3:2] = DATA[3:2]) - */ -#define LPSPI_CFGR1_PCSCFG(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_PCSCFG_SHIFT)) & LPSPI_CFGR1_PCSCFG_MASK) -/*! @} */ - -/*! @name DMR0 - Data Match 0 */ -/*! @{ */ - -#define LPSPI_DMR0_MATCH0_MASK (0xFFFFFFFFU) -#define LPSPI_DMR0_MATCH0_SHIFT (0U) -/*! MATCH0 - Match 0 Value */ -#define LPSPI_DMR0_MATCH0(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_DMR0_MATCH0_SHIFT)) & LPSPI_DMR0_MATCH0_MASK) -/*! @} */ - -/*! @name DMR1 - Data Match 1 */ -/*! @{ */ - -#define LPSPI_DMR1_MATCH1_MASK (0xFFFFFFFFU) -#define LPSPI_DMR1_MATCH1_SHIFT (0U) -/*! MATCH1 - Match 1 Value */ -#define LPSPI_DMR1_MATCH1(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_DMR1_MATCH1_SHIFT)) & LPSPI_DMR1_MATCH1_MASK) -/*! @} */ - -/*! @name CCR - Clock Configuration */ -/*! @{ */ - -#define LPSPI_CCR_SCKDIV_MASK (0xFFU) -#define LPSPI_CCR_SCKDIV_SHIFT (0U) -/*! SCKDIV - SCK Divider */ -#define LPSPI_CCR_SCKDIV(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR_SCKDIV_SHIFT)) & LPSPI_CCR_SCKDIV_MASK) - -#define LPSPI_CCR_DBT_MASK (0xFF00U) -#define LPSPI_CCR_DBT_SHIFT (8U) -/*! DBT - Delay Between Transfers */ -#define LPSPI_CCR_DBT(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR_DBT_SHIFT)) & LPSPI_CCR_DBT_MASK) - -#define LPSPI_CCR_PCSSCK_MASK (0xFF0000U) -#define LPSPI_CCR_PCSSCK_SHIFT (16U) -/*! PCSSCK - PCS-to-SCK Delay */ -#define LPSPI_CCR_PCSSCK(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR_PCSSCK_SHIFT)) & LPSPI_CCR_PCSSCK_MASK) - -#define LPSPI_CCR_SCKPCS_MASK (0xFF000000U) -#define LPSPI_CCR_SCKPCS_SHIFT (24U) -/*! SCKPCS - SCK-to-PCS Delay */ -#define LPSPI_CCR_SCKPCS(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR_SCKPCS_SHIFT)) & LPSPI_CCR_SCKPCS_MASK) -/*! @} */ - -/*! @name CCR1 - Clock Configuration 1 */ -/*! @{ */ - -#define LPSPI_CCR1_SCKSET_MASK (0xFFU) -#define LPSPI_CCR1_SCKSET_SHIFT (0U) -/*! SCKSET - SCK Setup */ -#define LPSPI_CCR1_SCKSET(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR1_SCKSET_SHIFT)) & LPSPI_CCR1_SCKSET_MASK) - -#define LPSPI_CCR1_SCKHLD_MASK (0xFF00U) -#define LPSPI_CCR1_SCKHLD_SHIFT (8U) -/*! SCKHLD - SCK Hold */ -#define LPSPI_CCR1_SCKHLD(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR1_SCKHLD_SHIFT)) & LPSPI_CCR1_SCKHLD_MASK) - -#define LPSPI_CCR1_PCSPCS_MASK (0xFF0000U) -#define LPSPI_CCR1_PCSPCS_SHIFT (16U) -/*! PCSPCS - PCS to PCS Delay */ -#define LPSPI_CCR1_PCSPCS(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR1_PCSPCS_SHIFT)) & LPSPI_CCR1_PCSPCS_MASK) - -#define LPSPI_CCR1_SCKSCK_MASK (0xFF000000U) -#define LPSPI_CCR1_SCKSCK_SHIFT (24U) -/*! SCKSCK - SCK Inter-Frame Delay */ -#define LPSPI_CCR1_SCKSCK(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR1_SCKSCK_SHIFT)) & LPSPI_CCR1_SCKSCK_MASK) -/*! @} */ - -/*! @name FCR - FIFO Control */ -/*! @{ */ - -#define LPSPI_FCR_TXWATER_MASK (0x7U) -#define LPSPI_FCR_TXWATER_SHIFT (0U) -/*! TXWATER - Transmit FIFO Watermark */ -#define LPSPI_FCR_TXWATER(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_FCR_TXWATER_SHIFT)) & LPSPI_FCR_TXWATER_MASK) - -#define LPSPI_FCR_RXWATER_MASK (0x70000U) -#define LPSPI_FCR_RXWATER_SHIFT (16U) -/*! RXWATER - Receive FIFO Watermark */ -#define LPSPI_FCR_RXWATER(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_FCR_RXWATER_SHIFT)) & LPSPI_FCR_RXWATER_MASK) -/*! @} */ - -/*! @name FSR - FIFO Status */ -/*! @{ */ - -#define LPSPI_FSR_TXCOUNT_MASK (0xFU) -#define LPSPI_FSR_TXCOUNT_SHIFT (0U) -/*! TXCOUNT - Transmit FIFO Count */ -#define LPSPI_FSR_TXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_FSR_TXCOUNT_SHIFT)) & LPSPI_FSR_TXCOUNT_MASK) - -#define LPSPI_FSR_RXCOUNT_MASK (0xF0000U) -#define LPSPI_FSR_RXCOUNT_SHIFT (16U) -/*! RXCOUNT - Receive FIFO Count */ -#define LPSPI_FSR_RXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_FSR_RXCOUNT_SHIFT)) & LPSPI_FSR_RXCOUNT_MASK) -/*! @} */ - -/*! @name TCR - Transmit Command */ -/*! @{ */ - -#define LPSPI_TCR_FRAMESZ_MASK (0xFFFU) -#define LPSPI_TCR_FRAMESZ_SHIFT (0U) -/*! FRAMESZ - Frame Size */ -#define LPSPI_TCR_FRAMESZ(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_FRAMESZ_SHIFT)) & LPSPI_TCR_FRAMESZ_MASK) - -#define LPSPI_TCR_WIDTH_MASK (0x30000U) -#define LPSPI_TCR_WIDTH_SHIFT (16U) -/*! WIDTH - Transfer Width - * 0b00..1-bit transfer - * 0b01..2-bit transfer - * 0b10..4-bit transfer - * 0b11..Reserved - */ -#define LPSPI_TCR_WIDTH(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_WIDTH_SHIFT)) & LPSPI_TCR_WIDTH_MASK) - -#define LPSPI_TCR_TXMSK_MASK (0x40000U) -#define LPSPI_TCR_TXMSK_SHIFT (18U) -/*! TXMSK - Transmit Data Mask - * 0b0..Normal transfer - * 0b1..Mask transmit data - */ -#define LPSPI_TCR_TXMSK(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_TXMSK_SHIFT)) & LPSPI_TCR_TXMSK_MASK) - -#define LPSPI_TCR_RXMSK_MASK (0x80000U) -#define LPSPI_TCR_RXMSK_SHIFT (19U) -/*! RXMSK - Receive Data Mask - * 0b0..Normal transfer - * 0b1..Mask receive data - */ -#define LPSPI_TCR_RXMSK(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_RXMSK_SHIFT)) & LPSPI_TCR_RXMSK_MASK) - -#define LPSPI_TCR_CONTC_MASK (0x100000U) -#define LPSPI_TCR_CONTC_SHIFT (20U) -/*! CONTC - Continuing Command - * 0b0..Command word for start of new transfer - * 0b1..Command word for continuing transfer - */ -#define LPSPI_TCR_CONTC(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_CONTC_SHIFT)) & LPSPI_TCR_CONTC_MASK) - -#define LPSPI_TCR_CONT_MASK (0x200000U) -#define LPSPI_TCR_CONT_SHIFT (21U) -/*! CONT - Continuous Transfer - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_TCR_CONT(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_CONT_SHIFT)) & LPSPI_TCR_CONT_MASK) - -#define LPSPI_TCR_BYSW_MASK (0x400000U) -#define LPSPI_TCR_BYSW_SHIFT (22U) -/*! BYSW - Byte Swap - * 0b0..Disable byte swap - * 0b1..Enable byte swap - */ -#define LPSPI_TCR_BYSW(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_BYSW_SHIFT)) & LPSPI_TCR_BYSW_MASK) - -#define LPSPI_TCR_LSBF_MASK (0x800000U) -#define LPSPI_TCR_LSBF_SHIFT (23U) -/*! LSBF - LSB First - * 0b0..MSB first - * 0b1..LSB first - */ -#define LPSPI_TCR_LSBF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_LSBF_SHIFT)) & LPSPI_TCR_LSBF_MASK) - -#define LPSPI_TCR_PCS_MASK (0x3000000U) -#define LPSPI_TCR_PCS_SHIFT (24U) -/*! PCS - Peripheral Chip Select - * 0b00..Transfer using PCS[0] - * 0b01..Transfer using PCS[1] - * 0b10..Transfer using PCS[2] - * 0b11..Transfer using PCS[3] - */ -#define LPSPI_TCR_PCS(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_PCS_SHIFT)) & LPSPI_TCR_PCS_MASK) - -#define LPSPI_TCR_PRESCALE_MASK (0x38000000U) -#define LPSPI_TCR_PRESCALE_SHIFT (27U) -/*! PRESCALE - Prescaler Value - * 0b000..Divide by 1 - * 0b001..Divide by 2 - * 0b010..Divide by 4 - * 0b011..Divide by 8 - * 0b100..Divide by 16 - * 0b101..Divide by 32 - * 0b110..Divide by 64 - * 0b111..Divide by 128 - */ -#define LPSPI_TCR_PRESCALE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_PRESCALE_SHIFT)) & LPSPI_TCR_PRESCALE_MASK) - -#define LPSPI_TCR_CPHA_MASK (0x40000000U) -#define LPSPI_TCR_CPHA_SHIFT (30U) -/*! CPHA - Clock Phase - * 0b0..Captured - * 0b1..Changed - */ -#define LPSPI_TCR_CPHA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_CPHA_SHIFT)) & LPSPI_TCR_CPHA_MASK) - -#define LPSPI_TCR_CPOL_MASK (0x80000000U) -#define LPSPI_TCR_CPOL_SHIFT (31U) -/*! CPOL - Clock Polarity - * 0b0..Inactive low - * 0b1..Inactive high - */ -#define LPSPI_TCR_CPOL(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_CPOL_SHIFT)) & LPSPI_TCR_CPOL_MASK) -/*! @} */ - -/*! @name TDR - Transmit Data */ -/*! @{ */ - -#define LPSPI_TDR_DATA_MASK (0xFFFFFFFFU) -#define LPSPI_TDR_DATA_SHIFT (0U) -/*! DATA - Transmit Data */ -#define LPSPI_TDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TDR_DATA_SHIFT)) & LPSPI_TDR_DATA_MASK) -/*! @} */ - -/*! @name RSR - Receive Status */ -/*! @{ */ - -#define LPSPI_RSR_SOF_MASK (0x1U) -#define LPSPI_RSR_SOF_SHIFT (0U) -/*! SOF - Start of Frame - * 0b0..Subsequent data word - * 0b1..First data word - */ -#define LPSPI_RSR_SOF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_RSR_SOF_SHIFT)) & LPSPI_RSR_SOF_MASK) - -#define LPSPI_RSR_RXEMPTY_MASK (0x2U) -#define LPSPI_RSR_RXEMPTY_SHIFT (1U) -/*! RXEMPTY - RX FIFO Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPSPI_RSR_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_RSR_RXEMPTY_SHIFT)) & LPSPI_RSR_RXEMPTY_MASK) -/*! @} */ - -/*! @name RDR - Receive Data */ -/*! @{ */ - -#define LPSPI_RDR_DATA_MASK (0xFFFFFFFFU) -#define LPSPI_RDR_DATA_SHIFT (0U) -/*! DATA - Receive Data */ -#define LPSPI_RDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_RDR_DATA_SHIFT)) & LPSPI_RDR_DATA_MASK) -/*! @} */ - -/*! @name RDROR - Receive Data Read Only */ -/*! @{ */ - -#define LPSPI_RDROR_DATA_MASK (0xFFFFFFFFU) -#define LPSPI_RDROR_DATA_SHIFT (0U) -/*! DATA - Receive Data */ -#define LPSPI_RDROR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_RDROR_DATA_SHIFT)) & LPSPI_RDROR_DATA_MASK) -/*! @} */ - -/*! @name TCBR - Transmit Command Burst */ -/*! @{ */ - -#define LPSPI_TCBR_DATA_MASK (0xFFFFFFFFU) -#define LPSPI_TCBR_DATA_SHIFT (0U) -/*! DATA - Command Data */ -#define LPSPI_TCBR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCBR_DATA_SHIFT)) & LPSPI_TCBR_DATA_MASK) -/*! @} */ - -/*! @name TDBR - Transmit Data Burst */ -/*! @{ */ - -#define LPSPI_TDBR_DATA_MASK (0xFFFFFFFFU) -#define LPSPI_TDBR_DATA_SHIFT (0U) -/*! DATA - Data */ -#define LPSPI_TDBR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TDBR_DATA_SHIFT)) & LPSPI_TDBR_DATA_MASK) -/*! @} */ - -/* The count of LPSPI_TDBR */ -#define LPSPI_TDBR_COUNT (128U) - -/*! @name RDBR - Receive Data Burst */ -/*! @{ */ - -#define LPSPI_RDBR_DATA_MASK (0xFFFFFFFFU) -#define LPSPI_RDBR_DATA_SHIFT (0U) -/*! DATA - Data */ -#define LPSPI_RDBR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_RDBR_DATA_SHIFT)) & LPSPI_RDBR_DATA_MASK) -/*! @} */ - -/* The count of LPSPI_RDBR */ -#define LPSPI_RDBR_COUNT (128U) - - -/*! - * @} - */ /* end of group LPSPI_Register_Masks */ - - -/* LPSPI - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral LPSPI0 base address */ - #define LPSPI0_BASE (0x50092000u) - /** Peripheral LPSPI0 base address */ - #define LPSPI0_BASE_NS (0x40092000u) - /** Peripheral LPSPI0 base pointer */ - #define LPSPI0 ((LPSPI_Type *)LPSPI0_BASE) - /** Peripheral LPSPI0 base pointer */ - #define LPSPI0_NS ((LPSPI_Type *)LPSPI0_BASE_NS) - /** Peripheral LPSPI1 base address */ - #define LPSPI1_BASE (0x50093000u) - /** Peripheral LPSPI1 base address */ - #define LPSPI1_BASE_NS (0x40093000u) - /** Peripheral LPSPI1 base pointer */ - #define LPSPI1 ((LPSPI_Type *)LPSPI1_BASE) - /** Peripheral LPSPI1 base pointer */ - #define LPSPI1_NS ((LPSPI_Type *)LPSPI1_BASE_NS) - /** Peripheral LPSPI2 base address */ - #define LPSPI2_BASE (0x50094000u) - /** Peripheral LPSPI2 base address */ - #define LPSPI2_BASE_NS (0x40094000u) - /** Peripheral LPSPI2 base pointer */ - #define LPSPI2 ((LPSPI_Type *)LPSPI2_BASE) - /** Peripheral LPSPI2 base pointer */ - #define LPSPI2_NS ((LPSPI_Type *)LPSPI2_BASE_NS) - /** Peripheral LPSPI3 base address */ - #define LPSPI3_BASE (0x50095000u) - /** Peripheral LPSPI3 base address */ - #define LPSPI3_BASE_NS (0x40095000u) - /** Peripheral LPSPI3 base pointer */ - #define LPSPI3 ((LPSPI_Type *)LPSPI3_BASE) - /** Peripheral LPSPI3 base pointer */ - #define LPSPI3_NS ((LPSPI_Type *)LPSPI3_BASE_NS) - /** Peripheral LPSPI4 base address */ - #define LPSPI4_BASE (0x500B4000u) - /** Peripheral LPSPI4 base address */ - #define LPSPI4_BASE_NS (0x400B4000u) - /** Peripheral LPSPI4 base pointer */ - #define LPSPI4 ((LPSPI_Type *)LPSPI4_BASE) - /** Peripheral LPSPI4 base pointer */ - #define LPSPI4_NS ((LPSPI_Type *)LPSPI4_BASE_NS) - /** Peripheral LPSPI5 base address */ - #define LPSPI5_BASE (0x500B5000u) - /** Peripheral LPSPI5 base address */ - #define LPSPI5_BASE_NS (0x400B5000u) - /** Peripheral LPSPI5 base pointer */ - #define LPSPI5 ((LPSPI_Type *)LPSPI5_BASE) - /** Peripheral LPSPI5 base pointer */ - #define LPSPI5_NS ((LPSPI_Type *)LPSPI5_BASE_NS) - /** Peripheral LPSPI6 base address */ - #define LPSPI6_BASE (0x500B6000u) - /** Peripheral LPSPI6 base address */ - #define LPSPI6_BASE_NS (0x400B6000u) - /** Peripheral LPSPI6 base pointer */ - #define LPSPI6 ((LPSPI_Type *)LPSPI6_BASE) - /** Peripheral LPSPI6 base pointer */ - #define LPSPI6_NS ((LPSPI_Type *)LPSPI6_BASE_NS) - /** Peripheral LPSPI7 base address */ - #define LPSPI7_BASE (0x500B7000u) - /** Peripheral LPSPI7 base address */ - #define LPSPI7_BASE_NS (0x400B7000u) - /** Peripheral LPSPI7 base pointer */ - #define LPSPI7 ((LPSPI_Type *)LPSPI7_BASE) - /** Peripheral LPSPI7 base pointer */ - #define LPSPI7_NS ((LPSPI_Type *)LPSPI7_BASE_NS) - /** Peripheral LPSPI8 base address */ - #define LPSPI8_BASE (0x500B8000u) - /** Peripheral LPSPI8 base address */ - #define LPSPI8_BASE_NS (0x400B8000u) - /** Peripheral LPSPI8 base pointer */ - #define LPSPI8 ((LPSPI_Type *)LPSPI8_BASE) - /** Peripheral LPSPI8 base pointer */ - #define LPSPI8_NS ((LPSPI_Type *)LPSPI8_BASE_NS) - /** Peripheral LPSPI9 base address */ - #define LPSPI9_BASE (0x500B9000u) - /** Peripheral LPSPI9 base address */ - #define LPSPI9_BASE_NS (0x400B9000u) - /** Peripheral LPSPI9 base pointer */ - #define LPSPI9 ((LPSPI_Type *)LPSPI9_BASE) - /** Peripheral LPSPI9 base pointer */ - #define LPSPI9_NS ((LPSPI_Type *)LPSPI9_BASE_NS) - /** Array initializer of LPSPI peripheral base addresses */ - #define LPSPI_BASE_ADDRS { LPSPI0_BASE, LPSPI1_BASE, LPSPI2_BASE, LPSPI3_BASE, LPSPI4_BASE, LPSPI5_BASE, LPSPI6_BASE, LPSPI7_BASE, LPSPI8_BASE, LPSPI9_BASE } - /** Array initializer of LPSPI peripheral base pointers */ - #define LPSPI_BASE_PTRS { LPSPI0, LPSPI1, LPSPI2, LPSPI3, LPSPI4, LPSPI5, LPSPI6, LPSPI7, LPSPI8, LPSPI9 } - /** Array initializer of LPSPI peripheral base addresses */ - #define LPSPI_BASE_ADDRS_NS { LPSPI0_BASE_NS, LPSPI1_BASE_NS, LPSPI2_BASE_NS, LPSPI3_BASE_NS, LPSPI4_BASE_NS, LPSPI5_BASE_NS, LPSPI6_BASE_NS, LPSPI7_BASE_NS, LPSPI8_BASE_NS, LPSPI9_BASE_NS } - /** Array initializer of LPSPI peripheral base pointers */ - #define LPSPI_BASE_PTRS_NS { LPSPI0_NS, LPSPI1_NS, LPSPI2_NS, LPSPI3_NS, LPSPI4_NS, LPSPI5_NS, LPSPI6_NS, LPSPI7_NS, LPSPI8_NS, LPSPI9_NS } -#else - /** Peripheral LPSPI0 base address */ - #define LPSPI0_BASE (0x40092000u) - /** Peripheral LPSPI0 base pointer */ - #define LPSPI0 ((LPSPI_Type *)LPSPI0_BASE) - /** Peripheral LPSPI1 base address */ - #define LPSPI1_BASE (0x40093000u) - /** Peripheral LPSPI1 base pointer */ - #define LPSPI1 ((LPSPI_Type *)LPSPI1_BASE) - /** Peripheral LPSPI2 base address */ - #define LPSPI2_BASE (0x40094000u) - /** Peripheral LPSPI2 base pointer */ - #define LPSPI2 ((LPSPI_Type *)LPSPI2_BASE) - /** Peripheral LPSPI3 base address */ - #define LPSPI3_BASE (0x40095000u) - /** Peripheral LPSPI3 base pointer */ - #define LPSPI3 ((LPSPI_Type *)LPSPI3_BASE) - /** Peripheral LPSPI4 base address */ - #define LPSPI4_BASE (0x400B4000u) - /** Peripheral LPSPI4 base pointer */ - #define LPSPI4 ((LPSPI_Type *)LPSPI4_BASE) - /** Peripheral LPSPI5 base address */ - #define LPSPI5_BASE (0x400B5000u) - /** Peripheral LPSPI5 base pointer */ - #define LPSPI5 ((LPSPI_Type *)LPSPI5_BASE) - /** Peripheral LPSPI6 base address */ - #define LPSPI6_BASE (0x400B6000u) - /** Peripheral LPSPI6 base pointer */ - #define LPSPI6 ((LPSPI_Type *)LPSPI6_BASE) - /** Peripheral LPSPI7 base address */ - #define LPSPI7_BASE (0x400B7000u) - /** Peripheral LPSPI7 base pointer */ - #define LPSPI7 ((LPSPI_Type *)LPSPI7_BASE) - /** Peripheral LPSPI8 base address */ - #define LPSPI8_BASE (0x400B8000u) - /** Peripheral LPSPI8 base pointer */ - #define LPSPI8 ((LPSPI_Type *)LPSPI8_BASE) - /** Peripheral LPSPI9 base address */ - #define LPSPI9_BASE (0x400B9000u) - /** Peripheral LPSPI9 base pointer */ - #define LPSPI9 ((LPSPI_Type *)LPSPI9_BASE) - /** Array initializer of LPSPI peripheral base addresses */ - #define LPSPI_BASE_ADDRS { LPSPI0_BASE, LPSPI1_BASE, LPSPI2_BASE, LPSPI3_BASE, LPSPI4_BASE, LPSPI5_BASE, LPSPI6_BASE, LPSPI7_BASE, LPSPI8_BASE, LPSPI9_BASE } - /** Array initializer of LPSPI peripheral base pointers */ - #define LPSPI_BASE_PTRS { LPSPI0, LPSPI1, LPSPI2, LPSPI3, LPSPI4, LPSPI5, LPSPI6, LPSPI7, LPSPI8, LPSPI9 } -#endif -/** Interrupt vectors for the LPSPI peripheral type */ -#define LPSPI_IRQS { LP_FLEXCOMM0_IRQn, LP_FLEXCOMM1_IRQn, LP_FLEXCOMM2_IRQn, LP_FLEXCOMM3_IRQn, LP_FLEXCOMM4_IRQn, LP_FLEXCOMM5_IRQn, LP_FLEXCOMM6_IRQn, LP_FLEXCOMM7_IRQn, LP_FLEXCOMM8_IRQn, LP_FLEXCOMM9_IRQn } - -/*! - * @} - */ /* end of group LPSPI_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LPTMR Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPTMR_Peripheral_Access_Layer LPTMR Peripheral Access Layer - * @{ - */ - -/** LPTMR - Register Layout Typedef */ -typedef struct { - __IO uint32_t CSR; /**< Control Status, offset: 0x0 */ - __IO uint32_t PSR; /**< Prescaler and Glitch Filter, offset: 0x4 */ - __IO uint32_t CMR; /**< Compare, offset: 0x8 */ - __IO uint32_t CNR; /**< Counter, offset: 0xC */ -} LPTMR_Type; - -/* ---------------------------------------------------------------------------- - -- LPTMR Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPTMR_Register_Masks LPTMR Register Masks - * @{ - */ - -/*! @name CSR - Control Status */ -/*! @{ */ - -#define LPTMR_CSR_TEN_MASK (0x1U) -#define LPTMR_CSR_TEN_SHIFT (0U) -/*! TEN - Timer Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPTMR_CSR_TEN(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TEN_SHIFT)) & LPTMR_CSR_TEN_MASK) - -#define LPTMR_CSR_TMS_MASK (0x2U) -#define LPTMR_CSR_TMS_SHIFT (1U) -/*! TMS - Timer Mode Select - * 0b0..Time Counter - * 0b1..Pulse Counter - */ -#define LPTMR_CSR_TMS(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TMS_SHIFT)) & LPTMR_CSR_TMS_MASK) - -#define LPTMR_CSR_TFC_MASK (0x4U) -#define LPTMR_CSR_TFC_SHIFT (2U) -/*! TFC - Timer Free-Running Counter - * 0b0..Reset when TCF asserts - * 0b1..Reset on overflow - */ -#define LPTMR_CSR_TFC(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TFC_SHIFT)) & LPTMR_CSR_TFC_MASK) - -#define LPTMR_CSR_TPP_MASK (0x8U) -#define LPTMR_CSR_TPP_SHIFT (3U) -/*! TPP - Timer Pin Polarity - * 0b0..Active-high - * 0b1..Active-low - */ -#define LPTMR_CSR_TPP(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TPP_SHIFT)) & LPTMR_CSR_TPP_MASK) - -#define LPTMR_CSR_TPS_MASK (0x30U) -#define LPTMR_CSR_TPS_SHIFT (4U) -/*! TPS - Timer Pin Select - * 0b00..Input 0 - * 0b01..Input 1 - * 0b10..Input 2 - * 0b11..Input 3 - */ -#define LPTMR_CSR_TPS(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TPS_SHIFT)) & LPTMR_CSR_TPS_MASK) - -#define LPTMR_CSR_TIE_MASK (0x40U) -#define LPTMR_CSR_TIE_SHIFT (6U) -/*! TIE - Timer Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPTMR_CSR_TIE(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TIE_SHIFT)) & LPTMR_CSR_TIE_MASK) - -#define LPTMR_CSR_TCF_MASK (0x80U) -#define LPTMR_CSR_TCF_SHIFT (7U) -/*! TCF - Timer Compare Flag - * 0b0..CNR != (CMR + 1) - * 0b1..CNR = (CMR + 1) - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPTMR_CSR_TCF(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TCF_SHIFT)) & LPTMR_CSR_TCF_MASK) - -#define LPTMR_CSR_TDRE_MASK (0x100U) -#define LPTMR_CSR_TDRE_SHIFT (8U) -/*! TDRE - Timer DMA Request Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPTMR_CSR_TDRE(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TDRE_SHIFT)) & LPTMR_CSR_TDRE_MASK) -/*! @} */ - -/*! @name PSR - Prescaler and Glitch Filter */ -/*! @{ */ - -#define LPTMR_PSR_PCS_MASK (0x3U) -#define LPTMR_PSR_PCS_SHIFT (0U) -/*! PCS - Prescaler and Glitch Filter Clock Select - * 0b00..Clock 0 - * 0b01..Clock 1 - * 0b10..Clock 2 - * 0b11..Clock 3 - */ -#define LPTMR_PSR_PCS(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_PSR_PCS_SHIFT)) & LPTMR_PSR_PCS_MASK) - -#define LPTMR_PSR_PBYP_MASK (0x4U) -#define LPTMR_PSR_PBYP_SHIFT (2U) -/*! PBYP - Prescaler and Glitch Filter Bypass - * 0b0..Prescaler and glitch filter enable - * 0b1..Prescaler and glitch filter bypass - */ -#define LPTMR_PSR_PBYP(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_PSR_PBYP_SHIFT)) & LPTMR_PSR_PBYP_MASK) - -#define LPTMR_PSR_PRESCALE_MASK (0x78U) -#define LPTMR_PSR_PRESCALE_SHIFT (3U) -/*! PRESCALE - Prescaler and Glitch Filter Value - * 0b0000..Prescaler divides the prescaler clock by 2; glitch filter does not support this configuration - * 0b0001..Prescaler divides the prescaler clock by 4; glitch filter recognizes change on input pin after two rising clock edges - * 0b0010..Prescaler divides the prescaler clock by 8; glitch filter recognizes change on input pin after four rising clock edges - * 0b0011..Prescaler divides the prescaler clock by 16; glitch filter recognizes change on input pin after eight rising clock edges - * 0b0100..Prescaler divides the prescaler clock by 32; glitch filter recognizes change on input pin after 16 rising clock edges - * 0b0101..Prescaler divides the prescaler clock by 64; glitch filter recognizes change on input pin after 32 rising clock edges - * 0b0110..Prescaler divides the prescaler clock by 128; glitch filter recognizes change on input pin after 64 rising clock edges - * 0b0111..Prescaler divides the prescaler clock by 256; glitch filter recognizes change on input pin after 128 rising clock edges - * 0b1000..Prescaler divides the prescaler clock by 512; glitch filter recognizes change on input pin after 256 rising clock edges - * 0b1001..Prescaler divides the prescaler clock by 1024; glitch filter recognizes change on input pin after 512 rising clock edges - * 0b1010..Prescaler divides the prescaler clock by 2048; glitch filter recognizes change on input pin after 1024 rising clock edges - * 0b1011..Prescaler divides the prescaler clock by 4096; glitch filter recognizes change on input pin after 2048 rising clock edges - * 0b1100..Prescaler divides the prescaler clock by 8192; glitch filter recognizes change on input pin after 4096 rising clock edges - * 0b1101..Prescaler divides the prescaler clock by 16,384; glitch filter recognizes change on input pin after 8192 rising clock edges - * 0b1110..Prescaler divides the prescaler clock by 32,768; glitch filter recognizes change on input pin after 16,384 rising clock edges - * 0b1111..Prescaler divides the prescaler clock by 65,536; glitch filter recognizes change on input pin after 32,768 rising clock edges - */ -#define LPTMR_PSR_PRESCALE(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_PSR_PRESCALE_SHIFT)) & LPTMR_PSR_PRESCALE_MASK) -/*! @} */ - -/*! @name CMR - Compare */ -/*! @{ */ - -#define LPTMR_CMR_COMPARE_MASK (0xFFFFFFFFU) -#define LPTMR_CMR_COMPARE_SHIFT (0U) -/*! COMPARE - Compare Value */ -#define LPTMR_CMR_COMPARE(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CMR_COMPARE_SHIFT)) & LPTMR_CMR_COMPARE_MASK) -/*! @} */ - -/*! @name CNR - Counter */ -/*! @{ */ - -#define LPTMR_CNR_COUNTER_MASK (0xFFFFFFFFU) -#define LPTMR_CNR_COUNTER_SHIFT (0U) -/*! COUNTER - Counter Value */ -#define LPTMR_CNR_COUNTER(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CNR_COUNTER_SHIFT)) & LPTMR_CNR_COUNTER_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group LPTMR_Register_Masks */ - - -/* LPTMR - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral LPTMR0 base address */ - #define LPTMR0_BASE (0x5004A000u) - /** Peripheral LPTMR0 base address */ - #define LPTMR0_BASE_NS (0x4004A000u) - /** Peripheral LPTMR0 base pointer */ - #define LPTMR0 ((LPTMR_Type *)LPTMR0_BASE) - /** Peripheral LPTMR0 base pointer */ - #define LPTMR0_NS ((LPTMR_Type *)LPTMR0_BASE_NS) - /** Peripheral LPTMR1 base address */ - #define LPTMR1_BASE (0x5004B000u) - /** Peripheral LPTMR1 base address */ - #define LPTMR1_BASE_NS (0x4004B000u) - /** Peripheral LPTMR1 base pointer */ - #define LPTMR1 ((LPTMR_Type *)LPTMR1_BASE) - /** Peripheral LPTMR1 base pointer */ - #define LPTMR1_NS ((LPTMR_Type *)LPTMR1_BASE_NS) - /** Array initializer of LPTMR peripheral base addresses */ - #define LPTMR_BASE_ADDRS { LPTMR0_BASE, LPTMR1_BASE } - /** Array initializer of LPTMR peripheral base pointers */ - #define LPTMR_BASE_PTRS { LPTMR0, LPTMR1 } - /** Array initializer of LPTMR peripheral base addresses */ - #define LPTMR_BASE_ADDRS_NS { LPTMR0_BASE_NS, LPTMR1_BASE_NS } - /** Array initializer of LPTMR peripheral base pointers */ - #define LPTMR_BASE_PTRS_NS { LPTMR0_NS, LPTMR1_NS } -#else - /** Peripheral LPTMR0 base address */ - #define LPTMR0_BASE (0x4004A000u) - /** Peripheral LPTMR0 base pointer */ - #define LPTMR0 ((LPTMR_Type *)LPTMR0_BASE) - /** Peripheral LPTMR1 base address */ - #define LPTMR1_BASE (0x4004B000u) - /** Peripheral LPTMR1 base pointer */ - #define LPTMR1 ((LPTMR_Type *)LPTMR1_BASE) - /** Array initializer of LPTMR peripheral base addresses */ - #define LPTMR_BASE_ADDRS { LPTMR0_BASE, LPTMR1_BASE } - /** Array initializer of LPTMR peripheral base pointers */ - #define LPTMR_BASE_PTRS { LPTMR0, LPTMR1 } -#endif -/** Interrupt vectors for the LPTMR peripheral type */ -#define LPTMR_IRQS { LPTMR0_IRQn, LPTMR1_IRQn } - -/*! - * @} - */ /* end of group LPTMR_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LPUART Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPUART_Peripheral_Access_Layer LPUART Peripheral Access Layer - * @{ - */ - -/** LPUART - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - __IO uint32_t GLOBAL; /**< Global, offset: 0x8 */ - __IO uint32_t PINCFG; /**< Pin Configuration, offset: 0xC */ - __IO uint32_t BAUD; /**< Baud Rate, offset: 0x10 */ - __IO uint32_t STAT; /**< Status, offset: 0x14 */ - __IO uint32_t CTRL; /**< Control, offset: 0x18 */ - __IO uint32_t DATA; /**< Data, offset: 0x1C */ - __IO uint32_t MATCH; /**< Match Address, offset: 0x20 */ - __IO uint32_t MODIR; /**< MODEM IrDA, offset: 0x24 */ - __IO uint32_t FIFO; /**< FIFO, offset: 0x28 */ - __IO uint32_t WATER; /**< Watermark, offset: 0x2C */ - __I uint32_t DATARO; /**< Data Read-Only, offset: 0x30 */ - uint8_t RESERVED_0[12]; - __IO uint32_t MCR; /**< MODEM Control, offset: 0x40 */ - __IO uint32_t MSR; /**< MODEM Status, offset: 0x44 */ - __IO uint32_t REIR; /**< Receiver Extended Idle, offset: 0x48 */ - __IO uint32_t TEIR; /**< Transmitter Extended Idle, offset: 0x4C */ - __IO uint32_t HDCR; /**< Half Duplex Control, offset: 0x50 */ - uint8_t RESERVED_1[4]; - __IO uint32_t TOCR; /**< Timeout Control, offset: 0x58 */ - __IO uint32_t TOSR; /**< Timeout Status, offset: 0x5C */ - __IO uint32_t TIMEOUT[4]; /**< Timeout N, array offset: 0x60, array step: 0x4 */ - uint8_t RESERVED_2[400]; - __O uint32_t TCBR[128]; /**< Transmit Command Burst, array offset: 0x200, array step: 0x4 */ - __O uint32_t TDBR[256]; /**< Transmit Data Burst, array offset: 0x400, array step: 0x4 */ -} LPUART_Type; - -/* ---------------------------------------------------------------------------- - -- LPUART Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPUART_Register_Masks LPUART Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define LPUART_VERID_FEATURE_MASK (0xFFFFU) -#define LPUART_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Identification Number - * 0b0000000000000001..Standard feature set - * 0b0000000000000011..Standard feature set with MODEM and IrDA support - * 0b0000000000000111..Enhanced feature set with full MODEM, IrDA, and enhanced idle detection - */ -#define LPUART_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_VERID_FEATURE_SHIFT)) & LPUART_VERID_FEATURE_MASK) - -#define LPUART_VERID_MINOR_MASK (0xFF0000U) -#define LPUART_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define LPUART_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_VERID_MINOR_SHIFT)) & LPUART_VERID_MINOR_MASK) - -#define LPUART_VERID_MAJOR_MASK (0xFF000000U) -#define LPUART_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define LPUART_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_VERID_MAJOR_SHIFT)) & LPUART_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define LPUART_PARAM_TXFIFO_MASK (0xFFU) -#define LPUART_PARAM_TXFIFO_SHIFT (0U) -/*! TXFIFO - Transmit FIFO Size */ -#define LPUART_PARAM_TXFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPUART_PARAM_TXFIFO_SHIFT)) & LPUART_PARAM_TXFIFO_MASK) - -#define LPUART_PARAM_RXFIFO_MASK (0xFF00U) -#define LPUART_PARAM_RXFIFO_SHIFT (8U) -/*! RXFIFO - Receive FIFO Size */ -#define LPUART_PARAM_RXFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPUART_PARAM_RXFIFO_SHIFT)) & LPUART_PARAM_RXFIFO_MASK) -/*! @} */ - -/*! @name GLOBAL - Global */ -/*! @{ */ - -#define LPUART_GLOBAL_RST_MASK (0x2U) -#define LPUART_GLOBAL_RST_SHIFT (1U) -/*! RST - Software Reset - * 0b0..Not reset - * 0b1..Reset - */ -#define LPUART_GLOBAL_RST(x) (((uint32_t)(((uint32_t)(x)) << LPUART_GLOBAL_RST_SHIFT)) & LPUART_GLOBAL_RST_MASK) -/*! @} */ - -/*! @name PINCFG - Pin Configuration */ -/*! @{ */ - -#define LPUART_PINCFG_TRGSEL_MASK (0x3U) -#define LPUART_PINCFG_TRGSEL_SHIFT (0U) -/*! TRGSEL - Trigger Select - * 0b00..Input trigger disabled - * 0b01..Input trigger used instead of the RXD pin input - * 0b10..Input trigger used instead of the CTS_B pin input - * 0b11..Input trigger used to modulate the TXD pin output, which (after TXINV configuration) is internally ANDed with the input trigger - */ -#define LPUART_PINCFG_TRGSEL(x) (((uint32_t)(((uint32_t)(x)) << LPUART_PINCFG_TRGSEL_SHIFT)) & LPUART_PINCFG_TRGSEL_MASK) -/*! @} */ - -/*! @name BAUD - Baud Rate */ -/*! @{ */ - -#define LPUART_BAUD_SBR_MASK (0x1FFFU) -#define LPUART_BAUD_SBR_SHIFT (0U) -/*! SBR - Baud Rate Modulo Divisor */ -#define LPUART_BAUD_SBR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_SBR_SHIFT)) & LPUART_BAUD_SBR_MASK) - -#define LPUART_BAUD_SBNS_MASK (0x2000U) -#define LPUART_BAUD_SBNS_SHIFT (13U) -/*! SBNS - Stop Bit Number Select - * 0b0..One stop bit - * 0b1..Two stop bits - */ -#define LPUART_BAUD_SBNS(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_SBNS_SHIFT)) & LPUART_BAUD_SBNS_MASK) - -#define LPUART_BAUD_RXEDGIE_MASK (0x4000U) -#define LPUART_BAUD_RXEDGIE_SHIFT (14U) -/*! RXEDGIE - RX Input Active Edge Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_RXEDGIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_RXEDGIE_SHIFT)) & LPUART_BAUD_RXEDGIE_MASK) - -#define LPUART_BAUD_LBKDIE_MASK (0x8000U) -#define LPUART_BAUD_LBKDIE_SHIFT (15U) -/*! LBKDIE - LIN Break Detect Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_LBKDIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_LBKDIE_SHIFT)) & LPUART_BAUD_LBKDIE_MASK) - -#define LPUART_BAUD_RESYNCDIS_MASK (0x10000U) -#define LPUART_BAUD_RESYNCDIS_SHIFT (16U) -/*! RESYNCDIS - Resynchronization Disable - * 0b0..Enable - * 0b1..Disable - */ -#define LPUART_BAUD_RESYNCDIS(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_RESYNCDIS_SHIFT)) & LPUART_BAUD_RESYNCDIS_MASK) - -#define LPUART_BAUD_BOTHEDGE_MASK (0x20000U) -#define LPUART_BAUD_BOTHEDGE_SHIFT (17U) -/*! BOTHEDGE - Both Edge Sampling - * 0b0..Rising edge - * 0b1..Both rising and falling edges - */ -#define LPUART_BAUD_BOTHEDGE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_BOTHEDGE_SHIFT)) & LPUART_BAUD_BOTHEDGE_MASK) - -#define LPUART_BAUD_MATCFG_MASK (0xC0000U) -#define LPUART_BAUD_MATCFG_SHIFT (18U) -/*! MATCFG - Match Configuration - * 0b00..Address match wake-up - * 0b01..Idle match wake-up - * 0b10..Match on and match off - * 0b11..Enables RWU on data match and match on or off for the transmitter CTS input - */ -#define LPUART_BAUD_MATCFG(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_MATCFG_SHIFT)) & LPUART_BAUD_MATCFG_MASK) - -#define LPUART_BAUD_RIDMAE_MASK (0x100000U) -#define LPUART_BAUD_RIDMAE_SHIFT (20U) -/*! RIDMAE - Receiver Idle DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_RIDMAE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_RIDMAE_SHIFT)) & LPUART_BAUD_RIDMAE_MASK) - -#define LPUART_BAUD_RDMAE_MASK (0x200000U) -#define LPUART_BAUD_RDMAE_SHIFT (21U) -/*! RDMAE - Receiver Full DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_RDMAE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_RDMAE_SHIFT)) & LPUART_BAUD_RDMAE_MASK) - -#define LPUART_BAUD_TDMAE_MASK (0x800000U) -#define LPUART_BAUD_TDMAE_SHIFT (23U) -/*! TDMAE - Transmitter DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_TDMAE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_TDMAE_SHIFT)) & LPUART_BAUD_TDMAE_MASK) - -#define LPUART_BAUD_OSR_MASK (0x1F000000U) -#define LPUART_BAUD_OSR_SHIFT (24U) -/*! OSR - Oversampling Ratio - * 0b00000..Results in an OSR of 16 - * 0b00001..Reserved - * 0b00010..Reserved - * 0b00011..Results in an OSR of 4 (requires BAUD[BOTHEDGE] to be 1) - * 0b00100..Results in an OSR of 5 (requires BAUD[BOTHEDGE] to be 1) - * 0b00101..Results in an OSR of 6 (requires BAUD[BOTHEDGE] to be 1) - * 0b00110..Results in an OSR of 7 (requires BAUD[BOTHEDGE] to be 1) - * 0b00111..Results in an OSR of 8 - * 0b01000..Results in an OSR of 9 - * 0b01001..Results in an OSR of 10 - * 0b01010..Results in an OSR of 11 - * 0b01011..Results in an OSR of 12 - * 0b01100..Results in an OSR of 13 - * 0b01101..Results in an OSR of 14 - * 0b01110..Results in an OSR of 15 - * 0b01111..Results in an OSR of 16 - * 0b10000..Results in an OSR of 17 - * 0b10001..Results in an OSR of 18 - * 0b10010..Results in an OSR of 19 - * 0b10011..Results in an OSR of 20 - * 0b10100..Results in an OSR of 21 - * 0b10101..Results in an OSR of 22 - * 0b10110..Results in an OSR of 23 - * 0b10111..Results in an OSR of 24 - * 0b11000..Results in an OSR of 25 - * 0b11001..Results in an OSR of 26 - * 0b11010..Results in an OSR of 27 - * 0b11011..Results in an OSR of 28 - * 0b11100..Results in an OSR of 29 - * 0b11101..Results in an OSR of 30 - * 0b11110..Results in an OSR of 31 - * 0b11111..Results in an OSR of 32 - */ -#define LPUART_BAUD_OSR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_OSR_SHIFT)) & LPUART_BAUD_OSR_MASK) - -#define LPUART_BAUD_M10_MASK (0x20000000U) -#define LPUART_BAUD_M10_SHIFT (29U) -/*! M10 - 10-Bit Mode Select - * 0b0..Receiver and transmitter use 7-bit to 9-bit data characters - * 0b1..Receiver and transmitter use 10-bit data characters - */ -#define LPUART_BAUD_M10(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_M10_SHIFT)) & LPUART_BAUD_M10_MASK) - -#define LPUART_BAUD_MAEN2_MASK (0x40000000U) -#define LPUART_BAUD_MAEN2_SHIFT (30U) -/*! MAEN2 - Match Address Mode Enable 2 - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_MAEN2(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_MAEN2_SHIFT)) & LPUART_BAUD_MAEN2_MASK) - -#define LPUART_BAUD_MAEN1_MASK (0x80000000U) -#define LPUART_BAUD_MAEN1_SHIFT (31U) -/*! MAEN1 - Match Address Mode Enable 1 - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_MAEN1(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_MAEN1_SHIFT)) & LPUART_BAUD_MAEN1_MASK) -/*! @} */ - -/*! @name STAT - Status */ -/*! @{ */ - -#define LPUART_STAT_LBKFE_MASK (0x1U) -#define LPUART_STAT_LBKFE_SHIFT (0U) -/*! LBKFE - LIN Break Flag Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_STAT_LBKFE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_LBKFE_SHIFT)) & LPUART_STAT_LBKFE_MASK) - -#define LPUART_STAT_AME_MASK (0x2U) -#define LPUART_STAT_AME_SHIFT (1U) -/*! AME - Address Mark Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_STAT_AME(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_AME_SHIFT)) & LPUART_STAT_AME_MASK) - -#define LPUART_STAT_MSF_MASK (0x100U) -#define LPUART_STAT_MSF_SHIFT (8U) -/*! MSF - MODEM Status Flag - * 0b0..Field is 0 - * 0b1..Field is 1 - */ -#define LPUART_STAT_MSF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_MSF_SHIFT)) & LPUART_STAT_MSF_MASK) - -#define LPUART_STAT_TSF_MASK (0x200U) -#define LPUART_STAT_TSF_SHIFT (9U) -/*! TSF - Timeout Status Flag - * 0b0..Field is 0 - * 0b1..Field is 1 - */ -#define LPUART_STAT_TSF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_TSF_SHIFT)) & LPUART_STAT_TSF_MASK) - -#define LPUART_STAT_MA2F_MASK (0x4000U) -#define LPUART_STAT_MA2F_SHIFT (14U) -/*! MA2F - Match 2 Flag - * 0b0..Not equal to MA2 - * 0b1..Equal to MA2 - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_MA2F(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_MA2F_SHIFT)) & LPUART_STAT_MA2F_MASK) - -#define LPUART_STAT_MA1F_MASK (0x8000U) -#define LPUART_STAT_MA1F_SHIFT (15U) -/*! MA1F - Match 1 Flag - * 0b0..Not equal to MA1 - * 0b1..Equal to MA1 - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_MA1F(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_MA1F_SHIFT)) & LPUART_STAT_MA1F_MASK) - -#define LPUART_STAT_PF_MASK (0x10000U) -#define LPUART_STAT_PF_SHIFT (16U) -/*! PF - Parity Error Flag - * 0b0..No parity error detected - * 0b1..Parity error detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_PF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_PF_SHIFT)) & LPUART_STAT_PF_MASK) - -#define LPUART_STAT_FE_MASK (0x20000U) -#define LPUART_STAT_FE_SHIFT (17U) -/*! FE - Framing Error Flag - * 0b0..No framing error detected (this does not guarantee that the framing is correct) - * 0b1..Framing error detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_FE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_FE_SHIFT)) & LPUART_STAT_FE_MASK) - -#define LPUART_STAT_NF_MASK (0x40000U) -#define LPUART_STAT_NF_SHIFT (18U) -/*! NF - Noise Flag - * 0b0..No noise detected - * 0b1..Noise detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_NF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_NF_SHIFT)) & LPUART_STAT_NF_MASK) - -#define LPUART_STAT_OR_MASK (0x80000U) -#define LPUART_STAT_OR_SHIFT (19U) -/*! OR - Receiver Overrun Flag - * 0b0..No overrun - * 0b1..Receive overrun (new LPUART data is lost) - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_OR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_OR_SHIFT)) & LPUART_STAT_OR_MASK) - -#define LPUART_STAT_IDLE_MASK (0x100000U) -#define LPUART_STAT_IDLE_SHIFT (20U) -/*! IDLE - Idle Line Flag - * 0b0..Idle line detected - * 0b1..Idle line not detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_IDLE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_IDLE_SHIFT)) & LPUART_STAT_IDLE_MASK) - -#define LPUART_STAT_RDRF_MASK (0x200000U) -#define LPUART_STAT_RDRF_SHIFT (21U) -/*! RDRF - Receive Data Register Full Flag - * 0b0..Equal to or less than watermark - * 0b1..Greater than watermark - */ -#define LPUART_STAT_RDRF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_RDRF_SHIFT)) & LPUART_STAT_RDRF_MASK) - -#define LPUART_STAT_TC_MASK (0x400000U) -#define LPUART_STAT_TC_SHIFT (22U) -/*! TC - Transmission Complete Flag - * 0b0..Transmitter active - * 0b1..Transmitter idle - */ -#define LPUART_STAT_TC(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_TC_SHIFT)) & LPUART_STAT_TC_MASK) - -#define LPUART_STAT_TDRE_MASK (0x800000U) -#define LPUART_STAT_TDRE_SHIFT (23U) -/*! TDRE - Transmit Data Register Empty Flag - * 0b0..Greater than watermark - * 0b1..Equal to or less than watermark - */ -#define LPUART_STAT_TDRE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_TDRE_SHIFT)) & LPUART_STAT_TDRE_MASK) - -#define LPUART_STAT_RAF_MASK (0x1000000U) -#define LPUART_STAT_RAF_SHIFT (24U) -/*! RAF - Receiver Active Flag - * 0b0..Idle, waiting for a start bit - * 0b1..Receiver active (RXD pin input not idle) - */ -#define LPUART_STAT_RAF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_RAF_SHIFT)) & LPUART_STAT_RAF_MASK) - -#define LPUART_STAT_LBKDE_MASK (0x2000000U) -#define LPUART_STAT_LBKDE_SHIFT (25U) -/*! LBKDE - LIN Break Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_STAT_LBKDE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_LBKDE_SHIFT)) & LPUART_STAT_LBKDE_MASK) - -#define LPUART_STAT_BRK13_MASK (0x4000000U) -#define LPUART_STAT_BRK13_SHIFT (26U) -/*! BRK13 - Break Character Generation Length - * 0b0..9 to 13 bit times - * 0b1..12 to 15 bit times - */ -#define LPUART_STAT_BRK13(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_BRK13_SHIFT)) & LPUART_STAT_BRK13_MASK) - -#define LPUART_STAT_RWUID_MASK (0x8000000U) -#define LPUART_STAT_RWUID_SHIFT (27U) -/*! RWUID - Receive Wake Up Idle Detect - * 0b0..STAT[IDLE] does not become 1 - * 0b1..STAT[IDLE] becomes 1 - */ -#define LPUART_STAT_RWUID(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_RWUID_SHIFT)) & LPUART_STAT_RWUID_MASK) - -#define LPUART_STAT_RXINV_MASK (0x10000000U) -#define LPUART_STAT_RXINV_SHIFT (28U) -/*! RXINV - Receive Data Inversion - * 0b0..Inverted - * 0b1..Not inverted - */ -#define LPUART_STAT_RXINV(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_RXINV_SHIFT)) & LPUART_STAT_RXINV_MASK) - -#define LPUART_STAT_MSBF_MASK (0x20000000U) -#define LPUART_STAT_MSBF_SHIFT (29U) -/*! MSBF - MSB First - * 0b0..LSB - * 0b1..MSB - */ -#define LPUART_STAT_MSBF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_MSBF_SHIFT)) & LPUART_STAT_MSBF_MASK) - -#define LPUART_STAT_RXEDGIF_MASK (0x40000000U) -#define LPUART_STAT_RXEDGIF_SHIFT (30U) -/*! RXEDGIF - RXD Pin Active Edge Interrupt Flag - * 0b0..Not occurred - * 0b1..Occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_RXEDGIF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_RXEDGIF_SHIFT)) & LPUART_STAT_RXEDGIF_MASK) - -#define LPUART_STAT_LBKDIF_MASK (0x80000000U) -#define LPUART_STAT_LBKDIF_SHIFT (31U) -/*! LBKDIF - LIN Break Detect Interrupt Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_LBKDIF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_LBKDIF_SHIFT)) & LPUART_STAT_LBKDIF_MASK) -/*! @} */ - -/*! @name CTRL - Control */ -/*! @{ */ - -#define LPUART_CTRL_PT_MASK (0x1U) -#define LPUART_CTRL_PT_SHIFT (0U) -/*! PT - Parity Type - * 0b0..Even parity - * 0b1..Odd parity - */ -#define LPUART_CTRL_PT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_PT_SHIFT)) & LPUART_CTRL_PT_MASK) - -#define LPUART_CTRL_PE_MASK (0x2U) -#define LPUART_CTRL_PE_SHIFT (1U) -/*! PE - Parity Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_PE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_PE_SHIFT)) & LPUART_CTRL_PE_MASK) - -#define LPUART_CTRL_ILT_MASK (0x4U) -#define LPUART_CTRL_ILT_SHIFT (2U) -/*! ILT - Idle Line Type Select - * 0b0..After the start bit - * 0b1..After the stop bit - */ -#define LPUART_CTRL_ILT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_ILT_SHIFT)) & LPUART_CTRL_ILT_MASK) - -#define LPUART_CTRL_WAKE_MASK (0x8U) -#define LPUART_CTRL_WAKE_SHIFT (3U) -/*! WAKE - Receiver Wake-Up Method Select - * 0b0..Idle - * 0b1..Mark - */ -#define LPUART_CTRL_WAKE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_WAKE_SHIFT)) & LPUART_CTRL_WAKE_MASK) - -#define LPUART_CTRL_M_MASK (0x10U) -#define LPUART_CTRL_M_SHIFT (4U) -/*! M - 9-Bit Or 8-Bit Mode Select - * 0b0..8-bit - * 0b1..9-bit - */ -#define LPUART_CTRL_M(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_M_SHIFT)) & LPUART_CTRL_M_MASK) - -#define LPUART_CTRL_RSRC_MASK (0x20U) -#define LPUART_CTRL_RSRC_SHIFT (5U) -/*! RSRC - Receiver Source Select - * 0b0..Internal Loopback mode - * 0b1..Single-wire mode - */ -#define LPUART_CTRL_RSRC(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_RSRC_SHIFT)) & LPUART_CTRL_RSRC_MASK) - -#define LPUART_CTRL_DOZEEN_MASK (0x40U) -#define LPUART_CTRL_DOZEEN_SHIFT (6U) -/*! DOZEEN - Doze Mode - * 0b0..Enable - * 0b1..Disable - */ -#define LPUART_CTRL_DOZEEN(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_DOZEEN_SHIFT)) & LPUART_CTRL_DOZEEN_MASK) - -#define LPUART_CTRL_LOOPS_MASK (0x80U) -#define LPUART_CTRL_LOOPS_SHIFT (7U) -/*! LOOPS - Loop Mode Select - * 0b0..Normal operation: RXD and TXD use separate pins - * 0b1..Loop mode or Single-Wire mode - */ -#define LPUART_CTRL_LOOPS(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_LOOPS_SHIFT)) & LPUART_CTRL_LOOPS_MASK) - -#define LPUART_CTRL_IDLECFG_MASK (0x700U) -#define LPUART_CTRL_IDLECFG_SHIFT (8U) -/*! IDLECFG - Idle Configuration - * 0b000..1 - * 0b001..2 - * 0b010..4 - * 0b011..8 - * 0b100..16 - * 0b101..32 - * 0b110..64 - * 0b111..128 - */ -#define LPUART_CTRL_IDLECFG(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_IDLECFG_SHIFT)) & LPUART_CTRL_IDLECFG_MASK) - -#define LPUART_CTRL_M7_MASK (0x800U) -#define LPUART_CTRL_M7_SHIFT (11U) -/*! M7 - 7-Bit Mode Select - * 0b0..8-bit to 10-bit - * 0b1..7-bit - */ -#define LPUART_CTRL_M7(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_M7_SHIFT)) & LPUART_CTRL_M7_MASK) - -#define LPUART_CTRL_MA2IE_MASK (0x4000U) -#define LPUART_CTRL_MA2IE_SHIFT (14U) -/*! MA2IE - Match 2 (MA2F) Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_MA2IE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_MA2IE_SHIFT)) & LPUART_CTRL_MA2IE_MASK) - -#define LPUART_CTRL_MA1IE_MASK (0x8000U) -#define LPUART_CTRL_MA1IE_SHIFT (15U) -/*! MA1IE - Match 1 (MA1F) Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_MA1IE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_MA1IE_SHIFT)) & LPUART_CTRL_MA1IE_MASK) - -#define LPUART_CTRL_SBK_MASK (0x10000U) -#define LPUART_CTRL_SBK_SHIFT (16U) -/*! SBK - Send Break - * 0b0..Normal transmitter operation - * 0b1..Queue break character(s) to be sent - */ -#define LPUART_CTRL_SBK(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_SBK_SHIFT)) & LPUART_CTRL_SBK_MASK) - -#define LPUART_CTRL_RWU_MASK (0x20000U) -#define LPUART_CTRL_RWU_SHIFT (17U) -/*! RWU - Receiver Wake-Up Control - * 0b0..Normal receiver operation - * 0b1..LPUART receiver in standby, waiting for a wake-up condition - */ -#define LPUART_CTRL_RWU(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_RWU_SHIFT)) & LPUART_CTRL_RWU_MASK) - -#define LPUART_CTRL_RE_MASK (0x40000U) -#define LPUART_CTRL_RE_SHIFT (18U) -/*! RE - Receiver Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_RE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_RE_SHIFT)) & LPUART_CTRL_RE_MASK) - -#define LPUART_CTRL_TE_MASK (0x80000U) -#define LPUART_CTRL_TE_SHIFT (19U) -/*! TE - Transmitter Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_TE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_TE_SHIFT)) & LPUART_CTRL_TE_MASK) - -#define LPUART_CTRL_ILIE_MASK (0x100000U) -#define LPUART_CTRL_ILIE_SHIFT (20U) -/*! ILIE - Idle Line Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_ILIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_ILIE_SHIFT)) & LPUART_CTRL_ILIE_MASK) - -#define LPUART_CTRL_RIE_MASK (0x200000U) -#define LPUART_CTRL_RIE_SHIFT (21U) -/*! RIE - Receiver Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_RIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_RIE_SHIFT)) & LPUART_CTRL_RIE_MASK) - -#define LPUART_CTRL_TCIE_MASK (0x400000U) -#define LPUART_CTRL_TCIE_SHIFT (22U) -/*! TCIE - Transmission Complete Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_TCIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_TCIE_SHIFT)) & LPUART_CTRL_TCIE_MASK) - -#define LPUART_CTRL_TIE_MASK (0x800000U) -#define LPUART_CTRL_TIE_SHIFT (23U) -/*! TIE - Transmit Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_TIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_TIE_SHIFT)) & LPUART_CTRL_TIE_MASK) - -#define LPUART_CTRL_PEIE_MASK (0x1000000U) -#define LPUART_CTRL_PEIE_SHIFT (24U) -/*! PEIE - Parity Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_PEIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_PEIE_SHIFT)) & LPUART_CTRL_PEIE_MASK) - -#define LPUART_CTRL_FEIE_MASK (0x2000000U) -#define LPUART_CTRL_FEIE_SHIFT (25U) -/*! FEIE - Framing Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_FEIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_FEIE_SHIFT)) & LPUART_CTRL_FEIE_MASK) - -#define LPUART_CTRL_NEIE_MASK (0x4000000U) -#define LPUART_CTRL_NEIE_SHIFT (26U) -/*! NEIE - Noise Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_NEIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_NEIE_SHIFT)) & LPUART_CTRL_NEIE_MASK) - -#define LPUART_CTRL_ORIE_MASK (0x8000000U) -#define LPUART_CTRL_ORIE_SHIFT (27U) -/*! ORIE - Overrun Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_ORIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_ORIE_SHIFT)) & LPUART_CTRL_ORIE_MASK) - -#define LPUART_CTRL_TXINV_MASK (0x10000000U) -#define LPUART_CTRL_TXINV_SHIFT (28U) -/*! TXINV - Transmit Data Inversion - * 0b0..Not inverted - * 0b1..Inverted - */ -#define LPUART_CTRL_TXINV(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_TXINV_SHIFT)) & LPUART_CTRL_TXINV_MASK) - -#define LPUART_CTRL_TXDIR_MASK (0x20000000U) -#define LPUART_CTRL_TXDIR_SHIFT (29U) -/*! TXDIR - TXD Pin Direction in Single-Wire Mode - * 0b0..Input - * 0b1..Output - */ -#define LPUART_CTRL_TXDIR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_TXDIR_SHIFT)) & LPUART_CTRL_TXDIR_MASK) - -#define LPUART_CTRL_R9T8_MASK (0x40000000U) -#define LPUART_CTRL_R9T8_SHIFT (30U) -/*! R9T8 - Receive Bit 9 Transmit Bit 8 */ -#define LPUART_CTRL_R9T8(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_R9T8_SHIFT)) & LPUART_CTRL_R9T8_MASK) - -#define LPUART_CTRL_R8T9_MASK (0x80000000U) -#define LPUART_CTRL_R8T9_SHIFT (31U) -/*! R8T9 - Receive Bit 8 Transmit Bit 9 */ -#define LPUART_CTRL_R8T9(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_R8T9_SHIFT)) & LPUART_CTRL_R8T9_MASK) -/*! @} */ - -/*! @name DATA - Data */ -/*! @{ */ - -#define LPUART_DATA_R0T0_MASK (0x1U) -#define LPUART_DATA_R0T0_SHIFT (0U) -/*! R0T0 - Read receive FIFO bit 0 or write transmit FIFO bit 0 */ -#define LPUART_DATA_R0T0(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R0T0_SHIFT)) & LPUART_DATA_R0T0_MASK) - -#define LPUART_DATA_R1T1_MASK (0x2U) -#define LPUART_DATA_R1T1_SHIFT (1U) -/*! R1T1 - Read receive FIFO bit 1 or write transmit FIFO bit 1 */ -#define LPUART_DATA_R1T1(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R1T1_SHIFT)) & LPUART_DATA_R1T1_MASK) - -#define LPUART_DATA_R2T2_MASK (0x4U) -#define LPUART_DATA_R2T2_SHIFT (2U) -/*! R2T2 - Read receive FIFO bit 2 or write transmit FIFO bit 2 */ -#define LPUART_DATA_R2T2(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R2T2_SHIFT)) & LPUART_DATA_R2T2_MASK) - -#define LPUART_DATA_R3T3_MASK (0x8U) -#define LPUART_DATA_R3T3_SHIFT (3U) -/*! R3T3 - Read receive FIFO bit 3 or write transmit FIFO bit 3 */ -#define LPUART_DATA_R3T3(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R3T3_SHIFT)) & LPUART_DATA_R3T3_MASK) - -#define LPUART_DATA_R4T4_MASK (0x10U) -#define LPUART_DATA_R4T4_SHIFT (4U) -/*! R4T4 - Read receive FIFO bit 4 or write transmit FIFO bit 4 */ -#define LPUART_DATA_R4T4(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R4T4_SHIFT)) & LPUART_DATA_R4T4_MASK) - -#define LPUART_DATA_R5T5_MASK (0x20U) -#define LPUART_DATA_R5T5_SHIFT (5U) -/*! R5T5 - Read receive FIFO bit 5 or write transmit FIFO bit 5 */ -#define LPUART_DATA_R5T5(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R5T5_SHIFT)) & LPUART_DATA_R5T5_MASK) - -#define LPUART_DATA_R6T6_MASK (0x40U) -#define LPUART_DATA_R6T6_SHIFT (6U) -/*! R6T6 - Read receive FIFO bit 6 or write transmit FIFO bit 6 */ -#define LPUART_DATA_R6T6(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R6T6_SHIFT)) & LPUART_DATA_R6T6_MASK) - -#define LPUART_DATA_R7T7_MASK (0x80U) -#define LPUART_DATA_R7T7_SHIFT (7U) -/*! R7T7 - Read receive FIFO bit 7 or write transmit FIFO bit 7 */ -#define LPUART_DATA_R7T7(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R7T7_SHIFT)) & LPUART_DATA_R7T7_MASK) - -#define LPUART_DATA_R8T8_MASK (0x100U) -#define LPUART_DATA_R8T8_SHIFT (8U) -/*! R8T8 - Read receive FIFO bit 8 or write transmit FIFO bit 8 */ -#define LPUART_DATA_R8T8(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R8T8_SHIFT)) & LPUART_DATA_R8T8_MASK) - -#define LPUART_DATA_R9T9_MASK (0x200U) -#define LPUART_DATA_R9T9_SHIFT (9U) -/*! R9T9 - Read receive FIFO bit 9 or write transmit FIFO bit 9 */ -#define LPUART_DATA_R9T9(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R9T9_SHIFT)) & LPUART_DATA_R9T9_MASK) - -#define LPUART_DATA_LINBRK_MASK (0x400U) -#define LPUART_DATA_LINBRK_SHIFT (10U) -/*! LINBRK - LIN Break - * 0b0..Not detected - * 0b1..Detected - */ -#define LPUART_DATA_LINBRK(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_LINBRK_SHIFT)) & LPUART_DATA_LINBRK_MASK) - -#define LPUART_DATA_IDLINE_MASK (0x800U) -#define LPUART_DATA_IDLINE_SHIFT (11U) -/*! IDLINE - Idle Line - * 0b0..Not idle - * 0b1..Idle - */ -#define LPUART_DATA_IDLINE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_IDLINE_SHIFT)) & LPUART_DATA_IDLINE_MASK) - -#define LPUART_DATA_RXEMPT_MASK (0x1000U) -#define LPUART_DATA_RXEMPT_SHIFT (12U) -/*! RXEMPT - Receive Buffer Empty - * 0b0..Valid data - * 0b1..Invalid data and empty - */ -#define LPUART_DATA_RXEMPT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_RXEMPT_SHIFT)) & LPUART_DATA_RXEMPT_MASK) - -#define LPUART_DATA_FRETSC_MASK (0x2000U) -#define LPUART_DATA_FRETSC_SHIFT (13U) -/*! FRETSC - Frame Error Transmit Special Character - * 0b0..Received without a frame error on reads or transmits a normal character on writes - * 0b1..Received with a frame error on reads or transmits an idle or break character on writes - */ -#define LPUART_DATA_FRETSC(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_FRETSC_SHIFT)) & LPUART_DATA_FRETSC_MASK) - -#define LPUART_DATA_PARITYE_MASK (0x4000U) -#define LPUART_DATA_PARITYE_SHIFT (14U) -/*! PARITYE - Parity Error - * 0b0..Received without a parity error - * 0b1..Received with a parity error - */ -#define LPUART_DATA_PARITYE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_PARITYE_SHIFT)) & LPUART_DATA_PARITYE_MASK) - -#define LPUART_DATA_NOISY_MASK (0x8000U) -#define LPUART_DATA_NOISY_SHIFT (15U) -/*! NOISY - Noisy Data Received - * 0b0..Received without noise - * 0b1..Received with noise - */ -#define LPUART_DATA_NOISY(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_NOISY_SHIFT)) & LPUART_DATA_NOISY_MASK) -/*! @} */ - -/*! @name MATCH - Match Address */ -/*! @{ */ - -#define LPUART_MATCH_MA1_MASK (0x3FFU) -#define LPUART_MATCH_MA1_SHIFT (0U) -/*! MA1 - Match Address 1 */ -#define LPUART_MATCH_MA1(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MATCH_MA1_SHIFT)) & LPUART_MATCH_MA1_MASK) - -#define LPUART_MATCH_MA2_MASK (0x3FF0000U) -#define LPUART_MATCH_MA2_SHIFT (16U) -/*! MA2 - Match Address 2 */ -#define LPUART_MATCH_MA2(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MATCH_MA2_SHIFT)) & LPUART_MATCH_MA2_MASK) -/*! @} */ - -/*! @name MODIR - MODEM IrDA */ -/*! @{ */ - -#define LPUART_MODIR_TXCTSE_MASK (0x1U) -#define LPUART_MODIR_TXCTSE_SHIFT (0U) -/*! TXCTSE - Transmitter CTS Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_MODIR_TXCTSE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_TXCTSE_SHIFT)) & LPUART_MODIR_TXCTSE_MASK) - -#define LPUART_MODIR_TXRTSE_MASK (0x2U) -#define LPUART_MODIR_TXRTSE_SHIFT (1U) -/*! TXRTSE - Transmitter RTS Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_MODIR_TXRTSE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_TXRTSE_SHIFT)) & LPUART_MODIR_TXRTSE_MASK) - -#define LPUART_MODIR_TXRTSPOL_MASK (0x4U) -#define LPUART_MODIR_TXRTSPOL_SHIFT (2U) -/*! TXRTSPOL - Transmitter RTS Polarity - * 0b0..Active low - * 0b1..Active high - */ -#define LPUART_MODIR_TXRTSPOL(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_TXRTSPOL_SHIFT)) & LPUART_MODIR_TXRTSPOL_MASK) - -#define LPUART_MODIR_RXRTSE_MASK (0x8U) -#define LPUART_MODIR_RXRTSE_SHIFT (3U) -/*! RXRTSE - Receiver RTS Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_MODIR_RXRTSE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_RXRTSE_SHIFT)) & LPUART_MODIR_RXRTSE_MASK) - -#define LPUART_MODIR_TXCTSC_MASK (0x10U) -#define LPUART_MODIR_TXCTSC_SHIFT (4U) -/*! TXCTSC - Transmit CTS Configuration - * 0b0..Sampled at the start of each character - * 0b1..Sampled when the transmitter is idle - */ -#define LPUART_MODIR_TXCTSC(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_TXCTSC_SHIFT)) & LPUART_MODIR_TXCTSC_MASK) - -#define LPUART_MODIR_TXCTSSRC_MASK (0x20U) -#define LPUART_MODIR_TXCTSSRC_SHIFT (5U) -/*! TXCTSSRC - Transmit CTS Source - * 0b0..The CTS_B pin - * 0b1..An internal connection to the receiver address match result - */ -#define LPUART_MODIR_TXCTSSRC(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_TXCTSSRC_SHIFT)) & LPUART_MODIR_TXCTSSRC_MASK) - -#define LPUART_MODIR_RTSWATER_MASK (0x700U) -#define LPUART_MODIR_RTSWATER_SHIFT (8U) -/*! RTSWATER - Receive RTS Configuration */ -#define LPUART_MODIR_RTSWATER(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_RTSWATER_SHIFT)) & LPUART_MODIR_RTSWATER_MASK) - -#define LPUART_MODIR_TNP_MASK (0x30000U) -#define LPUART_MODIR_TNP_SHIFT (16U) -/*! TNP - Transmitter Narrow Pulse - * 0b00..1 / OSR - * 0b01..2 / OSR - * 0b10..3 / OSR - * 0b11..4 / OSR - */ -#define LPUART_MODIR_TNP(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_TNP_SHIFT)) & LPUART_MODIR_TNP_MASK) - -#define LPUART_MODIR_IREN_MASK (0x40000U) -#define LPUART_MODIR_IREN_SHIFT (18U) -/*! IREN - IR Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_MODIR_IREN(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_IREN_SHIFT)) & LPUART_MODIR_IREN_MASK) -/*! @} */ - -/*! @name FIFO - FIFO */ -/*! @{ */ - -#define LPUART_FIFO_RXFIFOSIZE_MASK (0x7U) -#define LPUART_FIFO_RXFIFOSIZE_SHIFT (0U) -/*! RXFIFOSIZE - Receive FIFO Buffer Depth - * 0b000..1 - * 0b001..4 - * 0b010..8 - * 0b011..16 - * 0b100..32 - * 0b101..64 - * 0b110..128 - * 0b111..256 - */ -#define LPUART_FIFO_RXFIFOSIZE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXFIFOSIZE_SHIFT)) & LPUART_FIFO_RXFIFOSIZE_MASK) - -#define LPUART_FIFO_RXFE_MASK (0x8U) -#define LPUART_FIFO_RXFE_SHIFT (3U) -/*! RXFE - Receive FIFO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_FIFO_RXFE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXFE_SHIFT)) & LPUART_FIFO_RXFE_MASK) - -#define LPUART_FIFO_TXFIFOSIZE_MASK (0x70U) -#define LPUART_FIFO_TXFIFOSIZE_SHIFT (4U) -/*! TXFIFOSIZE - Transmit FIFO Buffer Depth - * 0b000..1 - * 0b001..4 - * 0b010..8 - * 0b011..16 - * 0b100..32 - * 0b101..64 - * 0b110..128 - * 0b111..256 - */ -#define LPUART_FIFO_TXFIFOSIZE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_TXFIFOSIZE_SHIFT)) & LPUART_FIFO_TXFIFOSIZE_MASK) - -#define LPUART_FIFO_TXFE_MASK (0x80U) -#define LPUART_FIFO_TXFE_SHIFT (7U) -/*! TXFE - Transmit FIFO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_FIFO_TXFE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_TXFE_SHIFT)) & LPUART_FIFO_TXFE_MASK) - -#define LPUART_FIFO_RXUFE_MASK (0x100U) -#define LPUART_FIFO_RXUFE_SHIFT (8U) -/*! RXUFE - Receive FIFO Underflow Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_FIFO_RXUFE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXUFE_SHIFT)) & LPUART_FIFO_RXUFE_MASK) - -#define LPUART_FIFO_TXOFE_MASK (0x200U) -#define LPUART_FIFO_TXOFE_SHIFT (9U) -/*! TXOFE - Transmit FIFO Overflow Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_FIFO_TXOFE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_TXOFE_SHIFT)) & LPUART_FIFO_TXOFE_MASK) - -#define LPUART_FIFO_RXIDEN_MASK (0x1C00U) -#define LPUART_FIFO_RXIDEN_SHIFT (10U) -/*! RXIDEN - Receiver Idle Empty Enable - * 0b000..Disable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle - * 0b001..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for one character - * 0b010..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for two characters - * 0b011..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for four characters - * 0b100..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for eight characters - * 0b101..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for 16 characters - * 0b110..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for 32 characters - * 0b111..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for 64 characters - */ -#define LPUART_FIFO_RXIDEN(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXIDEN_SHIFT)) & LPUART_FIFO_RXIDEN_MASK) - -#define LPUART_FIFO_RXFLUSH_MASK (0x4000U) -#define LPUART_FIFO_RXFLUSH_SHIFT (14U) -/*! RXFLUSH - Receive FIFO Flush - * 0b0..No effect - * 0b1..All data flushed out - */ -#define LPUART_FIFO_RXFLUSH(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXFLUSH_SHIFT)) & LPUART_FIFO_RXFLUSH_MASK) - -#define LPUART_FIFO_TXFLUSH_MASK (0x8000U) -#define LPUART_FIFO_TXFLUSH_SHIFT (15U) -/*! TXFLUSH - Transmit FIFO Flush - * 0b0..No effect - * 0b1..All data flushed out - */ -#define LPUART_FIFO_TXFLUSH(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_TXFLUSH_SHIFT)) & LPUART_FIFO_TXFLUSH_MASK) - -#define LPUART_FIFO_RXUF_MASK (0x10000U) -#define LPUART_FIFO_RXUF_SHIFT (16U) -/*! RXUF - Receiver FIFO Underflow Flag - * 0b0..No underflow - * 0b1..Underflow - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_FIFO_RXUF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXUF_SHIFT)) & LPUART_FIFO_RXUF_MASK) - -#define LPUART_FIFO_TXOF_MASK (0x20000U) -#define LPUART_FIFO_TXOF_SHIFT (17U) -/*! TXOF - Transmitter FIFO Overflow Flag - * 0b0..No overflow - * 0b1..Overflow - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_FIFO_TXOF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_TXOF_SHIFT)) & LPUART_FIFO_TXOF_MASK) - -#define LPUART_FIFO_RXEMPT_MASK (0x400000U) -#define LPUART_FIFO_RXEMPT_SHIFT (22U) -/*! RXEMPT - Receive FIFO Or Buffer Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPUART_FIFO_RXEMPT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXEMPT_SHIFT)) & LPUART_FIFO_RXEMPT_MASK) - -#define LPUART_FIFO_TXEMPT_MASK (0x800000U) -#define LPUART_FIFO_TXEMPT_SHIFT (23U) -/*! TXEMPT - Transmit FIFO Or Buffer Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPUART_FIFO_TXEMPT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_TXEMPT_SHIFT)) & LPUART_FIFO_TXEMPT_MASK) -/*! @} */ - -/*! @name WATER - Watermark */ -/*! @{ */ - -#define LPUART_WATER_TXWATER_MASK (0x7U) -#define LPUART_WATER_TXWATER_SHIFT (0U) -/*! TXWATER - Transmit Watermark */ -#define LPUART_WATER_TXWATER(x) (((uint32_t)(((uint32_t)(x)) << LPUART_WATER_TXWATER_SHIFT)) & LPUART_WATER_TXWATER_MASK) - -#define LPUART_WATER_TXCOUNT_MASK (0xF00U) -#define LPUART_WATER_TXCOUNT_SHIFT (8U) -/*! TXCOUNT - Transmit Counter */ -#define LPUART_WATER_TXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_WATER_TXCOUNT_SHIFT)) & LPUART_WATER_TXCOUNT_MASK) - -#define LPUART_WATER_RXWATER_MASK (0x70000U) -#define LPUART_WATER_RXWATER_SHIFT (16U) -/*! RXWATER - Receive Watermark */ -#define LPUART_WATER_RXWATER(x) (((uint32_t)(((uint32_t)(x)) << LPUART_WATER_RXWATER_SHIFT)) & LPUART_WATER_RXWATER_MASK) - -#define LPUART_WATER_RXCOUNT_MASK (0xF000000U) -#define LPUART_WATER_RXCOUNT_SHIFT (24U) -/*! RXCOUNT - Receive Counter */ -#define LPUART_WATER_RXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_WATER_RXCOUNT_SHIFT)) & LPUART_WATER_RXCOUNT_MASK) -/*! @} */ - -/*! @name DATARO - Data Read-Only */ -/*! @{ */ - -#define LPUART_DATARO_DATA_MASK (0xFFFFU) -#define LPUART_DATARO_DATA_SHIFT (0U) -/*! DATA - Receive Data */ -#define LPUART_DATARO_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATARO_DATA_SHIFT)) & LPUART_DATARO_DATA_MASK) -/*! @} */ - -/*! @name MCR - MODEM Control */ -/*! @{ */ - -#define LPUART_MCR_CTS_MASK (0x1U) -#define LPUART_MCR_CTS_SHIFT (0U) -/*! CTS - Clear To Send - * 0b0..Disable interrupt - * 0b1..Enable interrupt - */ -#define LPUART_MCR_CTS(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MCR_CTS_SHIFT)) & LPUART_MCR_CTS_MASK) - -#define LPUART_MCR_DSR_MASK (0x2U) -#define LPUART_MCR_DSR_SHIFT (1U) -/*! DSR - Data Set Ready - * 0b0..Disable interrupt - * 0b1..Enable interrupt - */ -#define LPUART_MCR_DSR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MCR_DSR_SHIFT)) & LPUART_MCR_DSR_MASK) - -#define LPUART_MCR_RIN_MASK (0x4U) -#define LPUART_MCR_RIN_SHIFT (2U) -/*! RIN - Ring Indicator - * 0b0..Disable interrupt - * 0b1..Enable interrupt - */ -#define LPUART_MCR_RIN(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MCR_RIN_SHIFT)) & LPUART_MCR_RIN_MASK) - -#define LPUART_MCR_DCD_MASK (0x8U) -#define LPUART_MCR_DCD_SHIFT (3U) -/*! DCD - Data Carrier Detect - * 0b0..Disable interrupt - * 0b1..Enable interrupt - */ -#define LPUART_MCR_DCD(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MCR_DCD_SHIFT)) & LPUART_MCR_DCD_MASK) - -#define LPUART_MCR_DTR_MASK (0x100U) -#define LPUART_MCR_DTR_SHIFT (8U) -/*! DTR - Data Terminal Ready - * 0b0..Logic one - * 0b1..Logic zero - */ -#define LPUART_MCR_DTR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MCR_DTR_SHIFT)) & LPUART_MCR_DTR_MASK) - -#define LPUART_MCR_RTS_MASK (0x200U) -#define LPUART_MCR_RTS_SHIFT (9U) -/*! RTS - Request To Send - * 0b0..Logic one - * 0b1..Logic zero - */ -#define LPUART_MCR_RTS(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MCR_RTS_SHIFT)) & LPUART_MCR_RTS_MASK) -/*! @} */ - -/*! @name MSR - MODEM Status */ -/*! @{ */ - -#define LPUART_MSR_DCTS_MASK (0x1U) -#define LPUART_MSR_DCTS_SHIFT (0U) -/*! DCTS - Delta Clear To Send - * 0b0..Did not change state - * 0b1..Changed state - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_MSR_DCTS(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MSR_DCTS_SHIFT)) & LPUART_MSR_DCTS_MASK) - -#define LPUART_MSR_DDSR_MASK (0x2U) -#define LPUART_MSR_DDSR_SHIFT (1U) -/*! DDSR - Delta Data Set Ready - * 0b0..Did not change state - * 0b1..Changed state - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_MSR_DDSR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MSR_DDSR_SHIFT)) & LPUART_MSR_DDSR_MASK) - -#define LPUART_MSR_DRI_MASK (0x4U) -#define LPUART_MSR_DRI_SHIFT (2U) -/*! DRI - Delta Ring Indicator - * 0b0..Did not change state - * 0b1..Changed state - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_MSR_DRI(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MSR_DRI_SHIFT)) & LPUART_MSR_DRI_MASK) - -#define LPUART_MSR_DDCD_MASK (0x8U) -#define LPUART_MSR_DDCD_SHIFT (3U) -/*! DDCD - Delta Data Carrier Detect - * 0b0..Did not change state - * 0b1..Changed state - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_MSR_DDCD(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MSR_DDCD_SHIFT)) & LPUART_MSR_DDCD_MASK) - -#define LPUART_MSR_CTS_MASK (0x10U) -#define LPUART_MSR_CTS_SHIFT (4U) -/*! CTS - Clear To Send - * 0b0..Logic one - * 0b1..Logic zero - */ -#define LPUART_MSR_CTS(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MSR_CTS_SHIFT)) & LPUART_MSR_CTS_MASK) - -#define LPUART_MSR_DSR_MASK (0x20U) -#define LPUART_MSR_DSR_SHIFT (5U) -/*! DSR - Data Set Ready - * 0b0..Logic one - * 0b1..Logic zero - */ -#define LPUART_MSR_DSR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MSR_DSR_SHIFT)) & LPUART_MSR_DSR_MASK) - -#define LPUART_MSR_RIN_MASK (0x40U) -#define LPUART_MSR_RIN_SHIFT (6U) -/*! RIN - Ring Indicator - * 0b0..Logic one - * 0b1..Logic zero - */ -#define LPUART_MSR_RIN(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MSR_RIN_SHIFT)) & LPUART_MSR_RIN_MASK) - -#define LPUART_MSR_DCD_MASK (0x80U) -#define LPUART_MSR_DCD_SHIFT (7U) -/*! DCD - Data Carrier Detect - * 0b0..Logic one - * 0b1..Logic zero - */ -#define LPUART_MSR_DCD(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MSR_DCD_SHIFT)) & LPUART_MSR_DCD_MASK) -/*! @} */ - -/*! @name REIR - Receiver Extended Idle */ -/*! @{ */ - -#define LPUART_REIR_IDTIME_MASK (0x3FFFU) -#define LPUART_REIR_IDTIME_SHIFT (0U) -/*! IDTIME - Idle Time */ -#define LPUART_REIR_IDTIME(x) (((uint32_t)(((uint32_t)(x)) << LPUART_REIR_IDTIME_SHIFT)) & LPUART_REIR_IDTIME_MASK) -/*! @} */ - -/*! @name TEIR - Transmitter Extended Idle */ -/*! @{ */ - -#define LPUART_TEIR_IDTIME_MASK (0x3FFFU) -#define LPUART_TEIR_IDTIME_SHIFT (0U) -/*! IDTIME - Idle Time */ -#define LPUART_TEIR_IDTIME(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TEIR_IDTIME_SHIFT)) & LPUART_TEIR_IDTIME_MASK) -/*! @} */ - -/*! @name HDCR - Half Duplex Control */ -/*! @{ */ - -#define LPUART_HDCR_TXSTALL_MASK (0x1U) -#define LPUART_HDCR_TXSTALL_SHIFT (0U) -/*! TXSTALL - Transmit Stall - * 0b0..No effect - * 0b1..Does not become busy - */ -#define LPUART_HDCR_TXSTALL(x) (((uint32_t)(((uint32_t)(x)) << LPUART_HDCR_TXSTALL_SHIFT)) & LPUART_HDCR_TXSTALL_MASK) - -#define LPUART_HDCR_RXSEL_MASK (0x2U) -#define LPUART_HDCR_RXSEL_SHIFT (1U) -/*! RXSEL - Receive Select - * 0b0..RXD - * 0b1..TXD - */ -#define LPUART_HDCR_RXSEL(x) (((uint32_t)(((uint32_t)(x)) << LPUART_HDCR_RXSEL_SHIFT)) & LPUART_HDCR_RXSEL_MASK) - -#define LPUART_HDCR_RXWRMSK_MASK (0x4U) -#define LPUART_HDCR_RXWRMSK_SHIFT (2U) -/*! RXWRMSK - Receive FIFO Write Mask - * 0b0..Do not mask - * 0b1..Mask - */ -#define LPUART_HDCR_RXWRMSK(x) (((uint32_t)(((uint32_t)(x)) << LPUART_HDCR_RXWRMSK_SHIFT)) & LPUART_HDCR_RXWRMSK_MASK) - -#define LPUART_HDCR_RXMSK_MASK (0x8U) -#define LPUART_HDCR_RXMSK_SHIFT (3U) -/*! RXMSK - Receive Mask - * 0b0..Do not mask - * 0b1..Mask - */ -#define LPUART_HDCR_RXMSK(x) (((uint32_t)(((uint32_t)(x)) << LPUART_HDCR_RXMSK_SHIFT)) & LPUART_HDCR_RXMSK_MASK) - -#define LPUART_HDCR_RTSEXT_MASK (0xFF00U) -#define LPUART_HDCR_RTSEXT_SHIFT (8U) -/*! RTSEXT - RTS Extended */ -#define LPUART_HDCR_RTSEXT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_HDCR_RTSEXT_SHIFT)) & LPUART_HDCR_RTSEXT_MASK) -/*! @} */ - -/*! @name TOCR - Timeout Control */ -/*! @{ */ - -#define LPUART_TOCR_TOEN_MASK (0xFU) -#define LPUART_TOCR_TOEN_SHIFT (0U) -/*! TOEN - Timeout Enable */ -#define LPUART_TOCR_TOEN(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TOCR_TOEN_SHIFT)) & LPUART_TOCR_TOEN_MASK) - -#define LPUART_TOCR_TOIE_MASK (0xF00U) -#define LPUART_TOCR_TOIE_SHIFT (8U) -/*! TOIE - Timeout Interrupt Enable */ -#define LPUART_TOCR_TOIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TOCR_TOIE_SHIFT)) & LPUART_TOCR_TOIE_MASK) -/*! @} */ - -/*! @name TOSR - Timeout Status */ -/*! @{ */ - -#define LPUART_TOSR_TOZ_MASK (0xFU) -#define LPUART_TOSR_TOZ_SHIFT (0U) -/*! TOZ - Timeout Zero */ -#define LPUART_TOSR_TOZ(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TOSR_TOZ_SHIFT)) & LPUART_TOSR_TOZ_MASK) - -#define LPUART_TOSR_TOF_MASK (0xF00U) -#define LPUART_TOSR_TOF_SHIFT (8U) -/*! TOF - Timeout Flag - * 0b0000..Not occurred - * 0b0001..Occurred - * 0b0000..No effect - * 0b0001..Clear the flag - */ -#define LPUART_TOSR_TOF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TOSR_TOF_SHIFT)) & LPUART_TOSR_TOF_MASK) -/*! @} */ - -/*! @name TIMEOUT - Timeout N */ -/*! @{ */ - -#define LPUART_TIMEOUT_TIMEOUT_MASK (0x3FFFU) -#define LPUART_TIMEOUT_TIMEOUT_SHIFT (0U) -/*! TIMEOUT - Timeout Value */ -#define LPUART_TIMEOUT_TIMEOUT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TIMEOUT_TIMEOUT_SHIFT)) & LPUART_TIMEOUT_TIMEOUT_MASK) - -#define LPUART_TIMEOUT_CFG_MASK (0xC0000000U) -#define LPUART_TIMEOUT_CFG_SHIFT (30U) -/*! CFG - Idle Configuration - * 0b00..Becomes 1 after timeout characters are received - * 0b01..Becomes 1 when idle for timeout bit clocks - * 0b10..Becomes 1 when idle for timeout bit clocks following the next character - * 0b11..Becomes 1 when idle for at least timeout bit clocks, but a new character is detected before the extended idle timeout is reached - */ -#define LPUART_TIMEOUT_CFG(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TIMEOUT_CFG_SHIFT)) & LPUART_TIMEOUT_CFG_MASK) -/*! @} */ - -/* The count of LPUART_TIMEOUT */ -#define LPUART_TIMEOUT_COUNT (4U) - -/*! @name TCBR - Transmit Command Burst */ -/*! @{ */ - -#define LPUART_TCBR_DATA_MASK (0xFFFFU) -#define LPUART_TCBR_DATA_SHIFT (0U) -/*! DATA - Data */ -#define LPUART_TCBR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TCBR_DATA_SHIFT)) & LPUART_TCBR_DATA_MASK) -/*! @} */ - -/* The count of LPUART_TCBR */ -#define LPUART_TCBR_COUNT (128U) - -/*! @name TDBR - Transmit Data Burst */ -/*! @{ */ - -#define LPUART_TDBR_DATA0_MASK (0xFFU) -#define LPUART_TDBR_DATA0_SHIFT (0U) -/*! DATA0 - Data0 */ -#define LPUART_TDBR_DATA0(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TDBR_DATA0_SHIFT)) & LPUART_TDBR_DATA0_MASK) - -#define LPUART_TDBR_DATA1_MASK (0xFF00U) -#define LPUART_TDBR_DATA1_SHIFT (8U) -/*! DATA1 - Data1 */ -#define LPUART_TDBR_DATA1(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TDBR_DATA1_SHIFT)) & LPUART_TDBR_DATA1_MASK) - -#define LPUART_TDBR_DATA2_MASK (0xFF0000U) -#define LPUART_TDBR_DATA2_SHIFT (16U) -/*! DATA2 - Data2 */ -#define LPUART_TDBR_DATA2(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TDBR_DATA2_SHIFT)) & LPUART_TDBR_DATA2_MASK) - -#define LPUART_TDBR_DATA3_MASK (0xFF000000U) -#define LPUART_TDBR_DATA3_SHIFT (24U) -/*! DATA3 - Data3 */ -#define LPUART_TDBR_DATA3(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TDBR_DATA3_SHIFT)) & LPUART_TDBR_DATA3_MASK) -/*! @} */ - -/* The count of LPUART_TDBR */ -#define LPUART_TDBR_COUNT (256U) - - -/*! - * @} - */ /* end of group LPUART_Register_Masks */ - - -/* LPUART - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral LPUART0 base address */ - #define LPUART0_BASE (0x50092000u) - /** Peripheral LPUART0 base address */ - #define LPUART0_BASE_NS (0x40092000u) - /** Peripheral LPUART0 base pointer */ - #define LPUART0 ((LPUART_Type *)LPUART0_BASE) - /** Peripheral LPUART0 base pointer */ - #define LPUART0_NS ((LPUART_Type *)LPUART0_BASE_NS) - /** Peripheral LPUART1 base address */ - #define LPUART1_BASE (0x50093000u) - /** Peripheral LPUART1 base address */ - #define LPUART1_BASE_NS (0x40093000u) - /** Peripheral LPUART1 base pointer */ - #define LPUART1 ((LPUART_Type *)LPUART1_BASE) - /** Peripheral LPUART1 base pointer */ - #define LPUART1_NS ((LPUART_Type *)LPUART1_BASE_NS) - /** Peripheral LPUART2 base address */ - #define LPUART2_BASE (0x50094000u) - /** Peripheral LPUART2 base address */ - #define LPUART2_BASE_NS (0x40094000u) - /** Peripheral LPUART2 base pointer */ - #define LPUART2 ((LPUART_Type *)LPUART2_BASE) - /** Peripheral LPUART2 base pointer */ - #define LPUART2_NS ((LPUART_Type *)LPUART2_BASE_NS) - /** Peripheral LPUART3 base address */ - #define LPUART3_BASE (0x50095000u) - /** Peripheral LPUART3 base address */ - #define LPUART3_BASE_NS (0x40095000u) - /** Peripheral LPUART3 base pointer */ - #define LPUART3 ((LPUART_Type *)LPUART3_BASE) - /** Peripheral LPUART3 base pointer */ - #define LPUART3_NS ((LPUART_Type *)LPUART3_BASE_NS) - /** Peripheral LPUART4 base address */ - #define LPUART4_BASE (0x500B4000u) - /** Peripheral LPUART4 base address */ - #define LPUART4_BASE_NS (0x400B4000u) - /** Peripheral LPUART4 base pointer */ - #define LPUART4 ((LPUART_Type *)LPUART4_BASE) - /** Peripheral LPUART4 base pointer */ - #define LPUART4_NS ((LPUART_Type *)LPUART4_BASE_NS) - /** Peripheral LPUART5 base address */ - #define LPUART5_BASE (0x500B5000u) - /** Peripheral LPUART5 base address */ - #define LPUART5_BASE_NS (0x400B5000u) - /** Peripheral LPUART5 base pointer */ - #define LPUART5 ((LPUART_Type *)LPUART5_BASE) - /** Peripheral LPUART5 base pointer */ - #define LPUART5_NS ((LPUART_Type *)LPUART5_BASE_NS) - /** Peripheral LPUART6 base address */ - #define LPUART6_BASE (0x500B6000u) - /** Peripheral LPUART6 base address */ - #define LPUART6_BASE_NS (0x400B6000u) - /** Peripheral LPUART6 base pointer */ - #define LPUART6 ((LPUART_Type *)LPUART6_BASE) - /** Peripheral LPUART6 base pointer */ - #define LPUART6_NS ((LPUART_Type *)LPUART6_BASE_NS) - /** Peripheral LPUART7 base address */ - #define LPUART7_BASE (0x500B7000u) - /** Peripheral LPUART7 base address */ - #define LPUART7_BASE_NS (0x400B7000u) - /** Peripheral LPUART7 base pointer */ - #define LPUART7 ((LPUART_Type *)LPUART7_BASE) - /** Peripheral LPUART7 base pointer */ - #define LPUART7_NS ((LPUART_Type *)LPUART7_BASE_NS) - /** Peripheral LPUART8 base address */ - #define LPUART8_BASE (0x500B8000u) - /** Peripheral LPUART8 base address */ - #define LPUART8_BASE_NS (0x400B8000u) - /** Peripheral LPUART8 base pointer */ - #define LPUART8 ((LPUART_Type *)LPUART8_BASE) - /** Peripheral LPUART8 base pointer */ - #define LPUART8_NS ((LPUART_Type *)LPUART8_BASE_NS) - /** Peripheral LPUART9 base address */ - #define LPUART9_BASE (0x500B9000u) - /** Peripheral LPUART9 base address */ - #define LPUART9_BASE_NS (0x400B9000u) - /** Peripheral LPUART9 base pointer */ - #define LPUART9 ((LPUART_Type *)LPUART9_BASE) - /** Peripheral LPUART9 base pointer */ - #define LPUART9_NS ((LPUART_Type *)LPUART9_BASE_NS) - /** Array initializer of LPUART peripheral base addresses */ - #define LPUART_BASE_ADDRS { LPUART0_BASE, LPUART1_BASE, LPUART2_BASE, LPUART3_BASE, LPUART4_BASE, LPUART5_BASE, LPUART6_BASE, LPUART7_BASE, LPUART8_BASE, LPUART9_BASE } - /** Array initializer of LPUART peripheral base pointers */ - #define LPUART_BASE_PTRS { LPUART0, LPUART1, LPUART2, LPUART3, LPUART4, LPUART5, LPUART6, LPUART7, LPUART8, LPUART9 } - /** Array initializer of LPUART peripheral base addresses */ - #define LPUART_BASE_ADDRS_NS { LPUART0_BASE_NS, LPUART1_BASE_NS, LPUART2_BASE_NS, LPUART3_BASE_NS, LPUART4_BASE_NS, LPUART5_BASE_NS, LPUART6_BASE_NS, LPUART7_BASE_NS, LPUART8_BASE_NS, LPUART9_BASE_NS } - /** Array initializer of LPUART peripheral base pointers */ - #define LPUART_BASE_PTRS_NS { LPUART0_NS, LPUART1_NS, LPUART2_NS, LPUART3_NS, LPUART4_NS, LPUART5_NS, LPUART6_NS, LPUART7_NS, LPUART8_NS, LPUART9_NS } -#else - /** Peripheral LPUART0 base address */ - #define LPUART0_BASE (0x40092000u) - /** Peripheral LPUART0 base pointer */ - #define LPUART0 ((LPUART_Type *)LPUART0_BASE) - /** Peripheral LPUART1 base address */ - #define LPUART1_BASE (0x40093000u) - /** Peripheral LPUART1 base pointer */ - #define LPUART1 ((LPUART_Type *)LPUART1_BASE) - /** Peripheral LPUART2 base address */ - #define LPUART2_BASE (0x40094000u) - /** Peripheral LPUART2 base pointer */ - #define LPUART2 ((LPUART_Type *)LPUART2_BASE) - /** Peripheral LPUART3 base address */ - #define LPUART3_BASE (0x40095000u) - /** Peripheral LPUART3 base pointer */ - #define LPUART3 ((LPUART_Type *)LPUART3_BASE) - /** Peripheral LPUART4 base address */ - #define LPUART4_BASE (0x400B4000u) - /** Peripheral LPUART4 base pointer */ - #define LPUART4 ((LPUART_Type *)LPUART4_BASE) - /** Peripheral LPUART5 base address */ - #define LPUART5_BASE (0x400B5000u) - /** Peripheral LPUART5 base pointer */ - #define LPUART5 ((LPUART_Type *)LPUART5_BASE) - /** Peripheral LPUART6 base address */ - #define LPUART6_BASE (0x400B6000u) - /** Peripheral LPUART6 base pointer */ - #define LPUART6 ((LPUART_Type *)LPUART6_BASE) - /** Peripheral LPUART7 base address */ - #define LPUART7_BASE (0x400B7000u) - /** Peripheral LPUART7 base pointer */ - #define LPUART7 ((LPUART_Type *)LPUART7_BASE) - /** Peripheral LPUART8 base address */ - #define LPUART8_BASE (0x400B8000u) - /** Peripheral LPUART8 base pointer */ - #define LPUART8 ((LPUART_Type *)LPUART8_BASE) - /** Peripheral LPUART9 base address */ - #define LPUART9_BASE (0x400B9000u) - /** Peripheral LPUART9 base pointer */ - #define LPUART9 ((LPUART_Type *)LPUART9_BASE) - /** Array initializer of LPUART peripheral base addresses */ - #define LPUART_BASE_ADDRS { LPUART0_BASE, LPUART1_BASE, LPUART2_BASE, LPUART3_BASE, LPUART4_BASE, LPUART5_BASE, LPUART6_BASE, LPUART7_BASE, LPUART8_BASE, LPUART9_BASE } - /** Array initializer of LPUART peripheral base pointers */ - #define LPUART_BASE_PTRS { LPUART0, LPUART1, LPUART2, LPUART3, LPUART4, LPUART5, LPUART6, LPUART7, LPUART8, LPUART9 } -#endif -/** Interrupt vectors for the LPUART peripheral type */ -#define LPUART_RX_TX_IRQS { LP_FLEXCOMM0_IRQn, LP_FLEXCOMM1_IRQn, LP_FLEXCOMM2_IRQn, LP_FLEXCOMM3_IRQn, LP_FLEXCOMM4_IRQn, LP_FLEXCOMM5_IRQn, LP_FLEXCOMM6_IRQn, LP_FLEXCOMM7_IRQn, LP_FLEXCOMM8_IRQn, LP_FLEXCOMM9_IRQn } -#define LPUART_ERR_IRQS { LP_FLEXCOMM0_IRQn, LP_FLEXCOMM1_IRQn, LP_FLEXCOMM2_IRQn, LP_FLEXCOMM3_IRQn, LP_FLEXCOMM4_IRQn, LP_FLEXCOMM5_IRQn, LP_FLEXCOMM6_IRQn, LP_FLEXCOMM7_IRQn, LP_FLEXCOMM8_IRQn, LP_FLEXCOMM9_IRQn } - -/*! - * @} - */ /* end of group LPUART_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LP_FLEXCOMM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LP_FLEXCOMM_Peripheral_Access_Layer LP_FLEXCOMM Peripheral Access Layer - * @{ - */ - -/** LP_FLEXCOMM - Register Layout Typedef */ -typedef struct { - uint8_t RESERVED_0[4084]; - __I uint32_t ISTAT; /**< Interrupt Status, offset: 0xFF4 */ - __IO uint32_t PSELID; /**< Peripheral Select and ID, offset: 0xFF8 */ -} LP_FLEXCOMM_Type; - -/* ---------------------------------------------------------------------------- - -- LP_FLEXCOMM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LP_FLEXCOMM_Register_Masks LP_FLEXCOMM Register Masks - * @{ - */ - -/*! @name ISTAT - Interrupt Status */ -/*! @{ */ - -#define LP_FLEXCOMM_ISTAT_UARTTX_MASK (0x1U) -#define LP_FLEXCOMM_ISTAT_UARTTX_SHIFT (0U) -/*! UARTTX - UART TX Interrupt - * 0b0..Clear - * 0b1..Set - */ -#define LP_FLEXCOMM_ISTAT_UARTTX(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_ISTAT_UARTTX_SHIFT)) & LP_FLEXCOMM_ISTAT_UARTTX_MASK) - -#define LP_FLEXCOMM_ISTAT_UARTRX_MASK (0x2U) -#define LP_FLEXCOMM_ISTAT_UARTRX_SHIFT (1U) -/*! UARTRX - UART RX Interrupt - * 0b0..Clear - * 0b1..Set - */ -#define LP_FLEXCOMM_ISTAT_UARTRX(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_ISTAT_UARTRX_SHIFT)) & LP_FLEXCOMM_ISTAT_UARTRX_MASK) - -#define LP_FLEXCOMM_ISTAT_SPI_MASK (0x4U) -#define LP_FLEXCOMM_ISTAT_SPI_SHIFT (2U) -/*! SPI - SPI Interrupt - * 0b0..Clear - * 0b1..Set - */ -#define LP_FLEXCOMM_ISTAT_SPI(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_ISTAT_SPI_SHIFT)) & LP_FLEXCOMM_ISTAT_SPI_MASK) - -#define LP_FLEXCOMM_ISTAT_I2CM_MASK (0x10U) -#define LP_FLEXCOMM_ISTAT_I2CM_SHIFT (4U) -/*! I2CM - I2C Controller Interrupt - * 0b0..Clear - * 0b1..Set - */ -#define LP_FLEXCOMM_ISTAT_I2CM(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_ISTAT_I2CM_SHIFT)) & LP_FLEXCOMM_ISTAT_I2CM_MASK) - -#define LP_FLEXCOMM_ISTAT_I2CS_MASK (0x20U) -#define LP_FLEXCOMM_ISTAT_I2CS_SHIFT (5U) -/*! I2CS - I2C Subordinate Interrupt - * 0b0..Clear - * 0b1..Set - */ -#define LP_FLEXCOMM_ISTAT_I2CS(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_ISTAT_I2CS_SHIFT)) & LP_FLEXCOMM_ISTAT_I2CS_MASK) -/*! @} */ - -/*! @name PSELID - Peripheral Select and ID */ -/*! @{ */ - -#define LP_FLEXCOMM_PSELID_PERSEL_MASK (0x7U) -#define LP_FLEXCOMM_PSELID_PERSEL_SHIFT (0U) -/*! PERSEL - Peripheral Select - * 0b000..No peripheral selected - * 0b001..UART - * 0b011..I2C - * 0b111..UART and I2C - * 0b010..SPI - */ -#define LP_FLEXCOMM_PSELID_PERSEL(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_PSELID_PERSEL_SHIFT)) & LP_FLEXCOMM_PSELID_PERSEL_MASK) - -#define LP_FLEXCOMM_PSELID_LOCK_MASK (0x8U) -#define LP_FLEXCOMM_PSELID_LOCK_SHIFT (3U) -/*! LOCK - Lock - * 0b0..PERSEL is writable - * 0b1..PERSEL is not writable - */ -#define LP_FLEXCOMM_PSELID_LOCK(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_PSELID_LOCK_SHIFT)) & LP_FLEXCOMM_PSELID_LOCK_MASK) - -#define LP_FLEXCOMM_PSELID_UARTPRESENT_MASK (0x10U) -#define LP_FLEXCOMM_PSELID_UARTPRESENT_SHIFT (4U) -/*! UARTPRESENT - UART Present - * 0b0..Not supported - * 0b1..Supported - */ -#define LP_FLEXCOMM_PSELID_UARTPRESENT(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_PSELID_UARTPRESENT_SHIFT)) & LP_FLEXCOMM_PSELID_UARTPRESENT_MASK) - -#define LP_FLEXCOMM_PSELID_SPIPRESENT_MASK (0x20U) -#define LP_FLEXCOMM_PSELID_SPIPRESENT_SHIFT (5U) -/*! SPIPRESENT - SPI Present - * 0b0..Not supported - * 0b1..Supported - */ -#define LP_FLEXCOMM_PSELID_SPIPRESENT(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_PSELID_SPIPRESENT_SHIFT)) & LP_FLEXCOMM_PSELID_SPIPRESENT_MASK) - -#define LP_FLEXCOMM_PSELID_I2CPRESENT_MASK (0x40U) -#define LP_FLEXCOMM_PSELID_I2CPRESENT_SHIFT (6U) -/*! I2CPRESENT - I2C Present - * 0b0..Not supported - * 0b1..Supported - */ -#define LP_FLEXCOMM_PSELID_I2CPRESENT(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_PSELID_I2CPRESENT_SHIFT)) & LP_FLEXCOMM_PSELID_I2CPRESENT_MASK) - -#define LP_FLEXCOMM_PSELID_ID_MASK (0xFFFFF000U) -#define LP_FLEXCOMM_PSELID_ID_SHIFT (12U) -/*! ID - LP_FLEXCOMM interface ID */ -#define LP_FLEXCOMM_PSELID_ID(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_PSELID_ID_SHIFT)) & LP_FLEXCOMM_PSELID_ID_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group LP_FLEXCOMM_Register_Masks */ - - -/* LP_FLEXCOMM - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral LP_FLEXCOMM0 base address */ - #define LP_FLEXCOMM0_BASE (0x50092000u) - /** Peripheral LP_FLEXCOMM0 base address */ - #define LP_FLEXCOMM0_BASE_NS (0x40092000u) - /** Peripheral LP_FLEXCOMM0 base pointer */ - #define LP_FLEXCOMM0 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM0_BASE) - /** Peripheral LP_FLEXCOMM0 base pointer */ - #define LP_FLEXCOMM0_NS ((LP_FLEXCOMM_Type *)LP_FLEXCOMM0_BASE_NS) - /** Peripheral LP_FLEXCOMM1 base address */ - #define LP_FLEXCOMM1_BASE (0x50093000u) - /** Peripheral LP_FLEXCOMM1 base address */ - #define LP_FLEXCOMM1_BASE_NS (0x40093000u) - /** Peripheral LP_FLEXCOMM1 base pointer */ - #define LP_FLEXCOMM1 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM1_BASE) - /** Peripheral LP_FLEXCOMM1 base pointer */ - #define LP_FLEXCOMM1_NS ((LP_FLEXCOMM_Type *)LP_FLEXCOMM1_BASE_NS) - /** Peripheral LP_FLEXCOMM2 base address */ - #define LP_FLEXCOMM2_BASE (0x50094000u) - /** Peripheral LP_FLEXCOMM2 base address */ - #define LP_FLEXCOMM2_BASE_NS (0x40094000u) - /** Peripheral LP_FLEXCOMM2 base pointer */ - #define LP_FLEXCOMM2 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM2_BASE) - /** Peripheral LP_FLEXCOMM2 base pointer */ - #define LP_FLEXCOMM2_NS ((LP_FLEXCOMM_Type *)LP_FLEXCOMM2_BASE_NS) - /** Peripheral LP_FLEXCOMM3 base address */ - #define LP_FLEXCOMM3_BASE (0x50095000u) - /** Peripheral LP_FLEXCOMM3 base address */ - #define LP_FLEXCOMM3_BASE_NS (0x40095000u) - /** Peripheral LP_FLEXCOMM3 base pointer */ - #define LP_FLEXCOMM3 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM3_BASE) - /** Peripheral LP_FLEXCOMM3 base pointer */ - #define LP_FLEXCOMM3_NS ((LP_FLEXCOMM_Type *)LP_FLEXCOMM3_BASE_NS) - /** Peripheral LP_FLEXCOMM4 base address */ - #define LP_FLEXCOMM4_BASE (0x500B4000u) - /** Peripheral LP_FLEXCOMM4 base address */ - #define LP_FLEXCOMM4_BASE_NS (0x400B4000u) - /** Peripheral LP_FLEXCOMM4 base pointer */ - #define LP_FLEXCOMM4 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM4_BASE) - /** Peripheral LP_FLEXCOMM4 base pointer */ - #define LP_FLEXCOMM4_NS ((LP_FLEXCOMM_Type *)LP_FLEXCOMM4_BASE_NS) - /** Peripheral LP_FLEXCOMM5 base address */ - #define LP_FLEXCOMM5_BASE (0x500B5000u) - /** Peripheral LP_FLEXCOMM5 base address */ - #define LP_FLEXCOMM5_BASE_NS (0x400B5000u) - /** Peripheral LP_FLEXCOMM5 base pointer */ - #define LP_FLEXCOMM5 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM5_BASE) - /** Peripheral LP_FLEXCOMM5 base pointer */ - #define LP_FLEXCOMM5_NS ((LP_FLEXCOMM_Type *)LP_FLEXCOMM5_BASE_NS) - /** Peripheral LP_FLEXCOMM6 base address */ - #define LP_FLEXCOMM6_BASE (0x500B6000u) - /** Peripheral LP_FLEXCOMM6 base address */ - #define LP_FLEXCOMM6_BASE_NS (0x400B6000u) - /** Peripheral LP_FLEXCOMM6 base pointer */ - #define LP_FLEXCOMM6 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM6_BASE) - /** Peripheral LP_FLEXCOMM6 base pointer */ - #define LP_FLEXCOMM6_NS ((LP_FLEXCOMM_Type *)LP_FLEXCOMM6_BASE_NS) - /** Peripheral LP_FLEXCOMM7 base address */ - #define LP_FLEXCOMM7_BASE (0x500B7000u) - /** Peripheral LP_FLEXCOMM7 base address */ - #define LP_FLEXCOMM7_BASE_NS (0x400B7000u) - /** Peripheral LP_FLEXCOMM7 base pointer */ - #define LP_FLEXCOMM7 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM7_BASE) - /** Peripheral LP_FLEXCOMM7 base pointer */ - #define LP_FLEXCOMM7_NS ((LP_FLEXCOMM_Type *)LP_FLEXCOMM7_BASE_NS) - /** Peripheral LP_FLEXCOMM8 base address */ - #define LP_FLEXCOMM8_BASE (0x500B8000u) - /** Peripheral LP_FLEXCOMM8 base address */ - #define LP_FLEXCOMM8_BASE_NS (0x400B8000u) - /** Peripheral LP_FLEXCOMM8 base pointer */ - #define LP_FLEXCOMM8 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM8_BASE) - /** Peripheral LP_FLEXCOMM8 base pointer */ - #define LP_FLEXCOMM8_NS ((LP_FLEXCOMM_Type *)LP_FLEXCOMM8_BASE_NS) - /** Peripheral LP_FLEXCOMM9 base address */ - #define LP_FLEXCOMM9_BASE (0x500B9000u) - /** Peripheral LP_FLEXCOMM9 base address */ - #define LP_FLEXCOMM9_BASE_NS (0x400B9000u) - /** Peripheral LP_FLEXCOMM9 base pointer */ - #define LP_FLEXCOMM9 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM9_BASE) - /** Peripheral LP_FLEXCOMM9 base pointer */ - #define LP_FLEXCOMM9_NS ((LP_FLEXCOMM_Type *)LP_FLEXCOMM9_BASE_NS) - /** Array initializer of LP_FLEXCOMM peripheral base addresses */ - #define LP_FLEXCOMM_BASE_ADDRS { LP_FLEXCOMM0_BASE, LP_FLEXCOMM1_BASE, LP_FLEXCOMM2_BASE, LP_FLEXCOMM3_BASE, LP_FLEXCOMM4_BASE, LP_FLEXCOMM5_BASE, LP_FLEXCOMM6_BASE, LP_FLEXCOMM7_BASE, LP_FLEXCOMM8_BASE, LP_FLEXCOMM9_BASE } - /** Array initializer of LP_FLEXCOMM peripheral base pointers */ - #define LP_FLEXCOMM_BASE_PTRS { LP_FLEXCOMM0, LP_FLEXCOMM1, LP_FLEXCOMM2, LP_FLEXCOMM3, LP_FLEXCOMM4, LP_FLEXCOMM5, LP_FLEXCOMM6, LP_FLEXCOMM7, LP_FLEXCOMM8, LP_FLEXCOMM9 } - /** Array initializer of LP_FLEXCOMM peripheral base addresses */ - #define LP_FLEXCOMM_BASE_ADDRS_NS { LP_FLEXCOMM0_BASE_NS, LP_FLEXCOMM1_BASE_NS, LP_FLEXCOMM2_BASE_NS, LP_FLEXCOMM3_BASE_NS, LP_FLEXCOMM4_BASE_NS, LP_FLEXCOMM5_BASE_NS, LP_FLEXCOMM6_BASE_NS, LP_FLEXCOMM7_BASE_NS, LP_FLEXCOMM8_BASE_NS, LP_FLEXCOMM9_BASE_NS } - /** Array initializer of LP_FLEXCOMM peripheral base pointers */ - #define LP_FLEXCOMM_BASE_PTRS_NS { LP_FLEXCOMM0_NS, LP_FLEXCOMM1_NS, LP_FLEXCOMM2_NS, LP_FLEXCOMM3_NS, LP_FLEXCOMM4_NS, LP_FLEXCOMM5_NS, LP_FLEXCOMM6_NS, LP_FLEXCOMM7_NS, LP_FLEXCOMM8_NS, LP_FLEXCOMM9_NS } -#else - /** Peripheral LP_FLEXCOMM0 base address */ - #define LP_FLEXCOMM0_BASE (0x40092000u) - /** Peripheral LP_FLEXCOMM0 base pointer */ - #define LP_FLEXCOMM0 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM0_BASE) - /** Peripheral LP_FLEXCOMM1 base address */ - #define LP_FLEXCOMM1_BASE (0x40093000u) - /** Peripheral LP_FLEXCOMM1 base pointer */ - #define LP_FLEXCOMM1 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM1_BASE) - /** Peripheral LP_FLEXCOMM2 base address */ - #define LP_FLEXCOMM2_BASE (0x40094000u) - /** Peripheral LP_FLEXCOMM2 base pointer */ - #define LP_FLEXCOMM2 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM2_BASE) - /** Peripheral LP_FLEXCOMM3 base address */ - #define LP_FLEXCOMM3_BASE (0x40095000u) - /** Peripheral LP_FLEXCOMM3 base pointer */ - #define LP_FLEXCOMM3 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM3_BASE) - /** Peripheral LP_FLEXCOMM4 base address */ - #define LP_FLEXCOMM4_BASE (0x400B4000u) - /** Peripheral LP_FLEXCOMM4 base pointer */ - #define LP_FLEXCOMM4 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM4_BASE) - /** Peripheral LP_FLEXCOMM5 base address */ - #define LP_FLEXCOMM5_BASE (0x400B5000u) - /** Peripheral LP_FLEXCOMM5 base pointer */ - #define LP_FLEXCOMM5 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM5_BASE) - /** Peripheral LP_FLEXCOMM6 base address */ - #define LP_FLEXCOMM6_BASE (0x400B6000u) - /** Peripheral LP_FLEXCOMM6 base pointer */ - #define LP_FLEXCOMM6 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM6_BASE) - /** Peripheral LP_FLEXCOMM7 base address */ - #define LP_FLEXCOMM7_BASE (0x400B7000u) - /** Peripheral LP_FLEXCOMM7 base pointer */ - #define LP_FLEXCOMM7 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM7_BASE) - /** Peripheral LP_FLEXCOMM8 base address */ - #define LP_FLEXCOMM8_BASE (0x400B8000u) - /** Peripheral LP_FLEXCOMM8 base pointer */ - #define LP_FLEXCOMM8 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM8_BASE) - /** Peripheral LP_FLEXCOMM9 base address */ - #define LP_FLEXCOMM9_BASE (0x400B9000u) - /** Peripheral LP_FLEXCOMM9 base pointer */ - #define LP_FLEXCOMM9 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM9_BASE) - /** Array initializer of LP_FLEXCOMM peripheral base addresses */ - #define LP_FLEXCOMM_BASE_ADDRS { LP_FLEXCOMM0_BASE, LP_FLEXCOMM1_BASE, LP_FLEXCOMM2_BASE, LP_FLEXCOMM3_BASE, LP_FLEXCOMM4_BASE, LP_FLEXCOMM5_BASE, LP_FLEXCOMM6_BASE, LP_FLEXCOMM7_BASE, LP_FLEXCOMM8_BASE, LP_FLEXCOMM9_BASE } - /** Array initializer of LP_FLEXCOMM peripheral base pointers */ - #define LP_FLEXCOMM_BASE_PTRS { LP_FLEXCOMM0, LP_FLEXCOMM1, LP_FLEXCOMM2, LP_FLEXCOMM3, LP_FLEXCOMM4, LP_FLEXCOMM5, LP_FLEXCOMM6, LP_FLEXCOMM7, LP_FLEXCOMM8, LP_FLEXCOMM9 } -#endif -/** Interrupt vectors for the LP_FLEXCOMM peripheral type */ -#define LP_FLEXCOMM_IRQS { LP_FLEXCOMM0_IRQn, LP_FLEXCOMM1_IRQn, LP_FLEXCOMM2_IRQn, LP_FLEXCOMM3_IRQn, LP_FLEXCOMM4_IRQn, LP_FLEXCOMM5_IRQn, LP_FLEXCOMM6_IRQn, LP_FLEXCOMM7_IRQn, LP_FLEXCOMM8_IRQn, LP_FLEXCOMM9_IRQn } - -/*! - * @} - */ /* end of group LP_FLEXCOMM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- MAILBOX Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup MAILBOX_Peripheral_Access_Layer MAILBOX Peripheral Access Layer - * @{ - */ - -/** MAILBOX - Register Layout Typedef */ -typedef struct { - struct { /* offset: 0x0, array step: 0x10 */ - __IO uint32_t IRQ; /**< Cortex-M33 (CPU0) Interrupt..CoolFlux (CPU1) Interrupt, array offset: 0x0, array step: 0x10 */ - __O uint32_t IRQSET; /**< Cortex-M33 (CPU0) Interrupt Set..CoolFlux (CPU1) Interrupt Set, array offset: 0x4, array step: 0x10 */ - __O uint32_t IRQCLR; /**< Cortex-M33 (CPU0) Interrupt Clear..CoolFlux (CPU1) Interrupt Clear, array offset: 0x8, array step: 0x10 */ - uint8_t RESERVED_0[4]; - } MBOXIRQ[2]; - uint8_t RESERVED_0[216]; - __IO uint32_t MUTEX; /**< Mutual Exclusion, offset: 0xF8 */ -} MAILBOX_Type; - -/* ---------------------------------------------------------------------------- - -- MAILBOX Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup MAILBOX_Register_Masks MAILBOX Register Masks - * @{ - */ - -/*! @name MBOXIRQ_IRQ - Cortex-M33 (CPU0) Interrupt..CoolFlux (CPU1) Interrupt */ -/*! @{ */ - -#define MAILBOX_MBOXIRQ_IRQ_INTREQ_MASK (0xFFFFFFFFU) -#define MAILBOX_MBOXIRQ_IRQ_INTREQ_SHIFT (0U) -/*! INTREQ - Interrupt Request */ -#define MAILBOX_MBOXIRQ_IRQ_INTREQ(x) (((uint32_t)(((uint32_t)(x)) << MAILBOX_MBOXIRQ_IRQ_INTREQ_SHIFT)) & MAILBOX_MBOXIRQ_IRQ_INTREQ_MASK) -/*! @} */ - -/* The count of MAILBOX_MBOXIRQ_IRQ */ -#define MAILBOX_MBOXIRQ_IRQ_COUNT (2U) - -/*! @name MBOXIRQ_IRQSET - Cortex-M33 (CPU0) Interrupt Set..CoolFlux (CPU1) Interrupt Set */ -/*! @{ */ - -#define MAILBOX_MBOXIRQ_IRQSET_INTREQSET_MASK (0xFFFFFFFFU) -#define MAILBOX_MBOXIRQ_IRQSET_INTREQSET_SHIFT (0U) -/*! INTREQSET - Interrupt Request Set 1 */ -#define MAILBOX_MBOXIRQ_IRQSET_INTREQSET(x) (((uint32_t)(((uint32_t)(x)) << MAILBOX_MBOXIRQ_IRQSET_INTREQSET_SHIFT)) & MAILBOX_MBOXIRQ_IRQSET_INTREQSET_MASK) -/*! @} */ - -/* The count of MAILBOX_MBOXIRQ_IRQSET */ -#define MAILBOX_MBOXIRQ_IRQSET_COUNT (2U) - -/*! @name MBOXIRQ_IRQCLR - Cortex-M33 (CPU0) Interrupt Clear..CoolFlux (CPU1) Interrupt Clear */ -/*! @{ */ - -#define MAILBOX_MBOXIRQ_IRQCLR_INTREQCLR_MASK (0xFFFFFFFFU) -#define MAILBOX_MBOXIRQ_IRQCLR_INTREQCLR_SHIFT (0U) -/*! INTREQCLR - Interrupt Request Clear 1 */ -#define MAILBOX_MBOXIRQ_IRQCLR_INTREQCLR(x) (((uint32_t)(((uint32_t)(x)) << MAILBOX_MBOXIRQ_IRQCLR_INTREQCLR_SHIFT)) & MAILBOX_MBOXIRQ_IRQCLR_INTREQCLR_MASK) -/*! @} */ - -/* The count of MAILBOX_MBOXIRQ_IRQCLR */ -#define MAILBOX_MBOXIRQ_IRQCLR_COUNT (2U) - -/*! @name MUTEX - Mutual Exclusion */ -/*! @{ */ - -#define MAILBOX_MUTEX_EX_MASK (0x1U) -#define MAILBOX_MUTEX_EX_SHIFT (0U) -/*! EX - Mutual Exclusion Request - * 0b0..Resource unavailable - * 0b1..Resource available - */ -#define MAILBOX_MUTEX_EX(x) (((uint32_t)(((uint32_t)(x)) << MAILBOX_MUTEX_EX_SHIFT)) & MAILBOX_MUTEX_EX_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group MAILBOX_Register_Masks */ - - -/* MAILBOX - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral MAILBOX base address */ - #define MAILBOX_BASE (0x500B2000u) - /** Peripheral MAILBOX base address */ - #define MAILBOX_BASE_NS (0x400B2000u) - /** Peripheral MAILBOX base pointer */ - #define MAILBOX ((MAILBOX_Type *)MAILBOX_BASE) - /** Peripheral MAILBOX base pointer */ - #define MAILBOX_NS ((MAILBOX_Type *)MAILBOX_BASE_NS) - /** Array initializer of MAILBOX peripheral base addresses */ - #define MAILBOX_BASE_ADDRS { MAILBOX_BASE } - /** Array initializer of MAILBOX peripheral base pointers */ - #define MAILBOX_BASE_PTRS { MAILBOX } - /** Array initializer of MAILBOX peripheral base addresses */ - #define MAILBOX_BASE_ADDRS_NS { MAILBOX_BASE_NS } - /** Array initializer of MAILBOX peripheral base pointers */ - #define MAILBOX_BASE_PTRS_NS { MAILBOX_NS } -#else - /** Peripheral MAILBOX base address */ - #define MAILBOX_BASE (0x400B2000u) - /** Peripheral MAILBOX base pointer */ - #define MAILBOX ((MAILBOX_Type *)MAILBOX_BASE) - /** Array initializer of MAILBOX peripheral base addresses */ - #define MAILBOX_BASE_ADDRS { MAILBOX_BASE } - /** Array initializer of MAILBOX peripheral base pointers */ - #define MAILBOX_BASE_PTRS { MAILBOX } -#endif - -/*! - * @} - */ /* end of group MAILBOX_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- MRT Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup MRT_Peripheral_Access_Layer MRT Peripheral Access Layer - * @{ - */ - -/** MRT - Register Layout Typedef */ -typedef struct { - struct { /* offset: 0x0, array step: 0x10 */ - __IO uint32_t INTVAL; /**< Time Interval Value, array offset: 0x0, array step: 0x10 */ - __I uint32_t TIMER; /**< Timer, array offset: 0x4, array step: 0x10 */ - __IO uint32_t CTRL; /**< Control, array offset: 0x8, array step: 0x10 */ - __IO uint32_t STAT; /**< Status, array offset: 0xC, array step: 0x10 */ - } CHANNEL[4]; - uint8_t RESERVED_0[176]; - __IO uint32_t MODCFG; /**< Module Configuration, offset: 0xF0 */ - __I uint32_t IDLE_CH; /**< Idle Channel, offset: 0xF4 */ - __IO uint32_t IRQ_FLAG; /**< Global Interrupt Flag, offset: 0xF8 */ -} MRT_Type; - -/* ---------------------------------------------------------------------------- - -- MRT Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup MRT_Register_Masks MRT Register Masks - * @{ - */ - -/*! @name CHANNEL_INTVAL - Time Interval Value */ -/*! @{ */ - -#define MRT_CHANNEL_INTVAL_IVALUE_MASK (0xFFFFFFU) -#define MRT_CHANNEL_INTVAL_IVALUE_SHIFT (0U) -/*! IVALUE - Time Interval Load Value. */ -#define MRT_CHANNEL_INTVAL_IVALUE(x) (((uint32_t)(((uint32_t)(x)) << MRT_CHANNEL_INTVAL_IVALUE_SHIFT)) & MRT_CHANNEL_INTVAL_IVALUE_MASK) - -#define MRT_CHANNEL_INTVAL_LOAD_MASK (0x80000000U) -#define MRT_CHANNEL_INTVAL_LOAD_SHIFT (31U) -/*! LOAD - Force Load Enable - * 0b0..No force load - * 0b1..Force load - */ -#define MRT_CHANNEL_INTVAL_LOAD(x) (((uint32_t)(((uint32_t)(x)) << MRT_CHANNEL_INTVAL_LOAD_SHIFT)) & MRT_CHANNEL_INTVAL_LOAD_MASK) -/*! @} */ - -/* The count of MRT_CHANNEL_INTVAL */ -#define MRT_CHANNEL_INTVAL_COUNT (4U) - -/*! @name CHANNEL_TIMER - Timer */ -/*! @{ */ - -#define MRT_CHANNEL_TIMER_VALUE_MASK (0xFFFFFFU) -#define MRT_CHANNEL_TIMER_VALUE_SHIFT (0U) -/*! VALUE - Current Timer Value */ -#define MRT_CHANNEL_TIMER_VALUE(x) (((uint32_t)(((uint32_t)(x)) << MRT_CHANNEL_TIMER_VALUE_SHIFT)) & MRT_CHANNEL_TIMER_VALUE_MASK) -/*! @} */ - -/* The count of MRT_CHANNEL_TIMER */ -#define MRT_CHANNEL_TIMER_COUNT (4U) - -/*! @name CHANNEL_CTRL - Control */ -/*! @{ */ - -#define MRT_CHANNEL_CTRL_INTEN_MASK (0x1U) -#define MRT_CHANNEL_CTRL_INTEN_SHIFT (0U) -/*! INTEN - Interrupt request - * 0b0..Disabled - * 0b1..Enabled - */ -#define MRT_CHANNEL_CTRL_INTEN(x) (((uint32_t)(((uint32_t)(x)) << MRT_CHANNEL_CTRL_INTEN_SHIFT)) & MRT_CHANNEL_CTRL_INTEN_MASK) - -#define MRT_CHANNEL_CTRL_MODE_MASK (0x6U) -#define MRT_CHANNEL_CTRL_MODE_SHIFT (1U) -/*! MODE - MRT Operating mode - * 0b00..Repeat Interrupt mode - * 0b01..One-Shot Interrupt mode - * 0b10..One-Shot Stall mode - * 0b11..Reserved - */ -#define MRT_CHANNEL_CTRL_MODE(x) (((uint32_t)(((uint32_t)(x)) << MRT_CHANNEL_CTRL_MODE_SHIFT)) & MRT_CHANNEL_CTRL_MODE_MASK) -/*! @} */ - -/* The count of MRT_CHANNEL_CTRL */ -#define MRT_CHANNEL_CTRL_COUNT (4U) - -/*! @name CHANNEL_STAT - Status */ -/*! @{ */ - -#define MRT_CHANNEL_STAT_INTFLAG_MASK (0x1U) -#define MRT_CHANNEL_STAT_INTFLAG_SHIFT (0U) -/*! INTFLAG - Interrupt Flag - * 0b0..No pending interrupt. - * 0b1..Pending interrupt. - */ -#define MRT_CHANNEL_STAT_INTFLAG(x) (((uint32_t)(((uint32_t)(x)) << MRT_CHANNEL_STAT_INTFLAG_SHIFT)) & MRT_CHANNEL_STAT_INTFLAG_MASK) - -#define MRT_CHANNEL_STAT_RUN_MASK (0x2U) -#define MRT_CHANNEL_STAT_RUN_SHIFT (1U) -/*! RUN - Timer n State - * 0b0..Idle state. - * 0b1..Running. - */ -#define MRT_CHANNEL_STAT_RUN(x) (((uint32_t)(((uint32_t)(x)) << MRT_CHANNEL_STAT_RUN_SHIFT)) & MRT_CHANNEL_STAT_RUN_MASK) - -#define MRT_CHANNEL_STAT_INUSE_MASK (0x4U) -#define MRT_CHANNEL_STAT_INUSE_SHIFT (2U) -/*! INUSE - Channel-In-Use flag - * 0b0..This timer channel is not in use. - * 0b1..This timer channel is in use. - */ -#define MRT_CHANNEL_STAT_INUSE(x) (((uint32_t)(((uint32_t)(x)) << MRT_CHANNEL_STAT_INUSE_SHIFT)) & MRT_CHANNEL_STAT_INUSE_MASK) -/*! @} */ - -/* The count of MRT_CHANNEL_STAT */ -#define MRT_CHANNEL_STAT_COUNT (4U) - -/*! @name MODCFG - Module Configuration */ -/*! @{ */ - -#define MRT_MODCFG_NOC_MASK (0xFU) -#define MRT_MODCFG_NOC_SHIFT (0U) -/*! NOC - Number of Channels */ -#define MRT_MODCFG_NOC(x) (((uint32_t)(((uint32_t)(x)) << MRT_MODCFG_NOC_SHIFT)) & MRT_MODCFG_NOC_MASK) - -#define MRT_MODCFG_NOB_MASK (0x1F0U) -#define MRT_MODCFG_NOB_SHIFT (4U) -/*! NOB - Number of Bits */ -#define MRT_MODCFG_NOB(x) (((uint32_t)(((uint32_t)(x)) << MRT_MODCFG_NOB_SHIFT)) & MRT_MODCFG_NOB_MASK) - -#define MRT_MODCFG_MULTITASK_MASK (0x80000000U) -#define MRT_MODCFG_MULTITASK_SHIFT (31U) -/*! MULTITASK - MULTITASK - * 0b0..Hardware status mode. - * 0b1..Multitask mode - */ -#define MRT_MODCFG_MULTITASK(x) (((uint32_t)(((uint32_t)(x)) << MRT_MODCFG_MULTITASK_SHIFT)) & MRT_MODCFG_MULTITASK_MASK) -/*! @} */ - -/*! @name IDLE_CH - Idle Channel */ -/*! @{ */ - -#define MRT_IDLE_CH_CHAN_MASK (0xF0U) -#define MRT_IDLE_CH_CHAN_SHIFT (4U) -/*! CHAN - Idle Channel */ -#define MRT_IDLE_CH_CHAN(x) (((uint32_t)(((uint32_t)(x)) << MRT_IDLE_CH_CHAN_SHIFT)) & MRT_IDLE_CH_CHAN_MASK) -/*! @} */ - -/*! @name IRQ_FLAG - Global Interrupt Flag */ -/*! @{ */ - -#define MRT_IRQ_FLAG_GFLAG0_MASK (0x1U) -#define MRT_IRQ_FLAG_GFLAG0_SHIFT (0U) -/*! GFLAG0 - Interrupt Flag - * 0b0..No pending interrupt. - * 0b1..Pending interrupt - */ -#define MRT_IRQ_FLAG_GFLAG0(x) (((uint32_t)(((uint32_t)(x)) << MRT_IRQ_FLAG_GFLAG0_SHIFT)) & MRT_IRQ_FLAG_GFLAG0_MASK) - -#define MRT_IRQ_FLAG_GFLAG1_MASK (0x2U) -#define MRT_IRQ_FLAG_GFLAG1_SHIFT (1U) -/*! GFLAG1 - Interrupt Flag */ -#define MRT_IRQ_FLAG_GFLAG1(x) (((uint32_t)(((uint32_t)(x)) << MRT_IRQ_FLAG_GFLAG1_SHIFT)) & MRT_IRQ_FLAG_GFLAG1_MASK) - -#define MRT_IRQ_FLAG_GFLAG2_MASK (0x4U) -#define MRT_IRQ_FLAG_GFLAG2_SHIFT (2U) -/*! GFLAG2 - Interrupt Flag */ -#define MRT_IRQ_FLAG_GFLAG2(x) (((uint32_t)(((uint32_t)(x)) << MRT_IRQ_FLAG_GFLAG2_SHIFT)) & MRT_IRQ_FLAG_GFLAG2_MASK) - -#define MRT_IRQ_FLAG_GFLAG3_MASK (0x8U) -#define MRT_IRQ_FLAG_GFLAG3_SHIFT (3U) -/*! GFLAG3 - Interrupt Flag */ -#define MRT_IRQ_FLAG_GFLAG3(x) (((uint32_t)(((uint32_t)(x)) << MRT_IRQ_FLAG_GFLAG3_SHIFT)) & MRT_IRQ_FLAG_GFLAG3_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group MRT_Register_Masks */ - - -/* MRT - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral MRT0 base address */ - #define MRT0_BASE (0x50013000u) - /** Peripheral MRT0 base address */ - #define MRT0_BASE_NS (0x40013000u) - /** Peripheral MRT0 base pointer */ - #define MRT0 ((MRT_Type *)MRT0_BASE) - /** Peripheral MRT0 base pointer */ - #define MRT0_NS ((MRT_Type *)MRT0_BASE_NS) - /** Array initializer of MRT peripheral base addresses */ - #define MRT_BASE_ADDRS { MRT0_BASE } - /** Array initializer of MRT peripheral base pointers */ - #define MRT_BASE_PTRS { MRT0 } - /** Array initializer of MRT peripheral base addresses */ - #define MRT_BASE_ADDRS_NS { MRT0_BASE_NS } - /** Array initializer of MRT peripheral base pointers */ - #define MRT_BASE_PTRS_NS { MRT0_NS } -#else - /** Peripheral MRT0 base address */ - #define MRT0_BASE (0x40013000u) - /** Peripheral MRT0 base pointer */ - #define MRT0 ((MRT_Type *)MRT0_BASE) - /** Array initializer of MRT peripheral base addresses */ - #define MRT_BASE_ADDRS { MRT0_BASE } - /** Array initializer of MRT peripheral base pointers */ - #define MRT_BASE_PTRS { MRT0 } -#endif -/** Interrupt vectors for the MRT peripheral type */ -#define MRT_IRQS { MRT0_IRQn } - -/*! - * @} - */ /* end of group MRT_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- NPX Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup NPX_Peripheral_Access_Layer NPX Peripheral Access Layer - * @{ - */ - -/** NPX - Register Layout Typedef */ -typedef struct { - __IO uint32_t NPXCR; /**< NPX Control Register, offset: 0x0 */ - uint8_t RESERVED_0[4]; - __I uint32_t NPXSR; /**< NPX Status Register, offset: 0x8 */ - uint8_t RESERVED_1[4]; - __O uint32_t CACMSK; /**< Flash Cache Obfuscation Mask, offset: 0x10 */ - uint8_t RESERVED_2[12]; - __IO uint32_t REMAP; /**< Data Remap, offset: 0x20 */ - uint8_t RESERVED_3[28]; - struct { /* offset: 0x40, array step: 0x10 */ - __IO uint32_t VMAPCTX_WD[2]; /**< Bitmap of Valid Control for Memory Context 0..Bitmap of Valid Control for Memory Context 3, array offset: 0x40, array step: index*0x10, index2*0x4 */ - __O uint32_t BIVCTX_WD[2]; /**< Block Initial Vector for Memory Context 0..Block Initial Vector for Memory Context 3, array offset: 0x48, array step: index*0x10, index2*0x4 */ - } CTX_VALID_IV_ARRAY[4]; -} NPX_Type; - -/* ---------------------------------------------------------------------------- - -- NPX Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup NPX_Register_Masks NPX Register Masks - * @{ - */ - -/*! @name NPXCR - NPX Control Register */ -/*! @{ */ - -#define NPX_NPXCR_GEE_MASK (0x1U) -#define NPX_NPXCR_GEE_SHIFT (0U) -/*! GEE - Global Encryption Enable - * 0b1..Global encryption enabled. NPX on-the-fly encryption is enabled if the flash access hits in a valid - * memory context. Subsequent reads return 1. - * 0b0..Global encryption disabled. NPX on-the-fly encryption is disabled. Subsequent reads return 0. - */ -#define NPX_NPXCR_GEE(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXCR_GEE_SHIFT)) & NPX_NPXCR_GEE_MASK) - -#define NPX_NPXCR_GDE_MASK (0x4U) -#define NPX_NPXCR_GDE_SHIFT (2U) -/*! GDE - Global Decryption Enable - * 0b1..Global decryption enabled. NPX on-the-fly decryption is globally enabled. Subsequent reads return 1. - * 0b0..Global decryption disabled. NPX on-the-fly decryption is globally disabled. Subsequent reads return 0. - */ -#define NPX_NPXCR_GDE(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXCR_GDE_SHIFT)) & NPX_NPXCR_GDE_MASK) - -#define NPX_NPXCR_GLK_MASK (0x10U) -#define NPX_NPXCR_GLK_SHIFT (4U) -/*! GLK - Global Lock Enable - * 0b1..Lock enabled: cannot write to VMAPCTXn, NPXCR, or CACMSK. Subsequent reads return 1. - * 0b0..Lock disabled. Subsequent reads return 0. - */ -#define NPX_NPXCR_GLK(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXCR_GLK_SHIFT)) & NPX_NPXCR_GLK_MASK) - -#define NPX_NPXCR_MLK_MASK (0x40U) -#define NPX_NPXCR_MLK_SHIFT (6U) -/*! MLK - Mask Lock Enable - * 0b1..Lock enabled: cannot write to mask. Subsequent reads return 1. - * 0b0..Lock disabled. Subsequent reads return 0. - */ -#define NPX_NPXCR_MLK(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXCR_MLK_SHIFT)) & NPX_NPXCR_MLK_MASK) - -#define NPX_NPXCR_CTX0LK_MASK (0x100U) -#define NPX_NPXCR_CTX0LK_SHIFT (8U) -/*! CTX0LK - Lock Enable for Context 0 - * 0b1..Lock enabled: cannot write to VMAPCTX0 (becomes read-only) - * 0b0..Lock disabled: VMAPCTX0 remains read-write - */ -#define NPX_NPXCR_CTX0LK(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXCR_CTX0LK_SHIFT)) & NPX_NPXCR_CTX0LK_MASK) - -#define NPX_NPXCR_CTX1LK_MASK (0x400U) -#define NPX_NPXCR_CTX1LK_SHIFT (10U) -/*! CTX1LK - Lock Enable for Context 1 - * 0b1..Lock enabled: cannot write to VMAPCTX1 (becomes read-only) - * 0b0..Lock disabled: VMAPCTX1 remains read-write - */ -#define NPX_NPXCR_CTX1LK(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXCR_CTX1LK_SHIFT)) & NPX_NPXCR_CTX1LK_MASK) - -#define NPX_NPXCR_CTX2LK_MASK (0x1000U) -#define NPX_NPXCR_CTX2LK_SHIFT (12U) -/*! CTX2LK - Lock Enable for Context 2 - * 0b1..Lock enabled: cannot write to VMAPCTX2 (becomes read-only) - * 0b0..Lock disabled: VMAPCTX2 remains read-write - */ -#define NPX_NPXCR_CTX2LK(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXCR_CTX2LK_SHIFT)) & NPX_NPXCR_CTX2LK_MASK) - -#define NPX_NPXCR_CTX3LK_MASK (0x4000U) -#define NPX_NPXCR_CTX3LK_SHIFT (14U) -/*! CTX3LK - Lock Enable for Context 3 - * 0b1..Lock enabled: cannot write to VMAPCTX3 (becomes read-only) - * 0b0..Lock disabled: VMAPCTX3 remains read-write - */ -#define NPX_NPXCR_CTX3LK(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXCR_CTX3LK_SHIFT)) & NPX_NPXCR_CTX3LK_MASK) -/*! @} */ - -/*! @name NPXSR - NPX Status Register */ -/*! @{ */ - -#define NPX_NPXSR_NUMCTX_MASK (0xFU) -#define NPX_NPXSR_NUMCTX_SHIFT (0U) -/*! NUMCTX - Number of implemented memory contexts - * 0b0000..No (zero) implemented memory contexts - * 0b0001..1 implemented memory contexts - * 0b0010..2 implemented memory contexts - * 0b0011..3 implemented memory contexts - * 0b0100..4 implemented memory contexts - */ -#define NPX_NPXSR_NUMCTX(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXSR_NUMCTX_SHIFT)) & NPX_NPXSR_NUMCTX_MASK) - -#define NPX_NPXSR_V0_MASK (0x100U) -#define NPX_NPXSR_V0_SHIFT (8U) -/*! V0 - Key n Valid - * 0b0..Not valid - * 0b1..Valid - */ -#define NPX_NPXSR_V0(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXSR_V0_SHIFT)) & NPX_NPXSR_V0_MASK) - -#define NPX_NPXSR_V1_MASK (0x200U) -#define NPX_NPXSR_V1_SHIFT (9U) -/*! V1 - Key n Valid - * 0b0..Not valid - * 0b1..Valid - */ -#define NPX_NPXSR_V1(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXSR_V1_SHIFT)) & NPX_NPXSR_V1_MASK) - -#define NPX_NPXSR_V2_MASK (0x400U) -#define NPX_NPXSR_V2_SHIFT (10U) -/*! V2 - Key n Valid - * 0b0..Not valid - * 0b1..Valid - */ -#define NPX_NPXSR_V2(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXSR_V2_SHIFT)) & NPX_NPXSR_V2_MASK) - -#define NPX_NPXSR_V3_MASK (0x800U) -#define NPX_NPXSR_V3_SHIFT (11U) -/*! V3 - Key n Valid - * 0b0..Not valid - * 0b1..Valid - */ -#define NPX_NPXSR_V3(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXSR_V3_SHIFT)) & NPX_NPXSR_V3_MASK) -/*! @} */ - -/*! @name CACMSK - Flash Cache Obfuscation Mask */ -/*! @{ */ - -#define NPX_CACMSK_OBMASK_MASK (0xFFFFFFFFU) -#define NPX_CACMSK_OBMASK_SHIFT (0U) -/*! OBMASK - Obfuscation Mask */ -#define NPX_CACMSK_OBMASK(x) (((uint32_t)(((uint32_t)(x)) << NPX_CACMSK_OBMASK_SHIFT)) & NPX_CACMSK_OBMASK_MASK) -/*! @} */ - -/*! @name REMAP - Data Remap */ -/*! @{ */ - -#define NPX_REMAP_REMAPLK_MASK (0x1U) -#define NPX_REMAP_REMAPLK_SHIFT (0U) -/*! REMAPLK - Remap Lock Enable - * 0b1..Lock enabled: cannot write to REMAP - * 0b0..Lock disabled: can write to REMAP - */ -#define NPX_REMAP_REMAPLK(x) (((uint32_t)(((uint32_t)(x)) << NPX_REMAP_REMAPLK_SHIFT)) & NPX_REMAP_REMAPLK_MASK) - -#define NPX_REMAP_LIM_MASK (0x1F0000U) -#define NPX_REMAP_LIM_SHIFT (16U) -/*! LIM - LIM Remapping Address */ -#define NPX_REMAP_LIM(x) (((uint32_t)(((uint32_t)(x)) << NPX_REMAP_LIM_SHIFT)) & NPX_REMAP_LIM_MASK) - -#define NPX_REMAP_LIMDP_MASK (0x1F000000U) -#define NPX_REMAP_LIMDP_SHIFT (24U) -/*! LIMDP - LIMDP Remapping Address */ -#define NPX_REMAP_LIMDP(x) (((uint32_t)(((uint32_t)(x)) << NPX_REMAP_LIMDP_SHIFT)) & NPX_REMAP_LIMDP_MASK) -/*! @} */ - -/*! @name CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD - Bitmap of Valid Control for Memory Context 0..Bitmap of Valid Control for Memory Context 3 */ -/*! @{ */ - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL0_MASK (0x1U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL0_SHIFT (0U) -/*! VAL0 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL0(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL0_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL0_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL32_MASK (0x1U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL32_SHIFT (0U) -/*! VAL32 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL32(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL32_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL32_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL1_MASK (0x2U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL1_SHIFT (1U) -/*! VAL1 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL1(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL1_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL1_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL33_MASK (0x2U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL33_SHIFT (1U) -/*! VAL33 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL33(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL33_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL33_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL2_MASK (0x4U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL2_SHIFT (2U) -/*! VAL2 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL2(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL2_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL2_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL34_MASK (0x4U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL34_SHIFT (2U) -/*! VAL34 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL34(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL34_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL34_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL3_MASK (0x8U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL3_SHIFT (3U) -/*! VAL3 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL3(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL3_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL3_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL35_MASK (0x8U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL35_SHIFT (3U) -/*! VAL35 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL35(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL35_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL35_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL4_MASK (0x10U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL4_SHIFT (4U) -/*! VAL4 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL4(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL4_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL4_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL36_MASK (0x10U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL36_SHIFT (4U) -/*! VAL36 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL36(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL36_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL36_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL5_MASK (0x20U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL5_SHIFT (5U) -/*! VAL5 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL5(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL5_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL5_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL37_MASK (0x20U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL37_SHIFT (5U) -/*! VAL37 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL37(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL37_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL37_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL6_MASK (0x40U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL6_SHIFT (6U) -/*! VAL6 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL6(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL6_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL6_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL38_MASK (0x40U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL38_SHIFT (6U) -/*! VAL38 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL38(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL38_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL38_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL7_MASK (0x80U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL7_SHIFT (7U) -/*! VAL7 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL7(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL7_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL7_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL39_MASK (0x80U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL39_SHIFT (7U) -/*! VAL39 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL39(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL39_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL39_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL8_MASK (0x100U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL8_SHIFT (8U) -/*! VAL8 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL8(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL8_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL8_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL40_MASK (0x100U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL40_SHIFT (8U) -/*! VAL40 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL40(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL40_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL40_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL9_MASK (0x200U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL9_SHIFT (9U) -/*! VAL9 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL9(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL9_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL9_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL41_MASK (0x200U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL41_SHIFT (9U) -/*! VAL41 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL41(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL41_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL41_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL10_MASK (0x400U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL10_SHIFT (10U) -/*! VAL10 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL10(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL10_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL10_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL42_MASK (0x400U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL42_SHIFT (10U) -/*! VAL42 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL42(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL42_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL42_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL11_MASK (0x800U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL11_SHIFT (11U) -/*! VAL11 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL11(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL11_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL11_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL43_MASK (0x800U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL43_SHIFT (11U) -/*! VAL43 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL43(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL43_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL43_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL12_MASK (0x1000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL12_SHIFT (12U) -/*! VAL12 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL12(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL12_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL12_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL44_MASK (0x1000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL44_SHIFT (12U) -/*! VAL44 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL44(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL44_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL44_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL13_MASK (0x2000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL13_SHIFT (13U) -/*! VAL13 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL13(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL13_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL13_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL45_MASK (0x2000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL45_SHIFT (13U) -/*! VAL45 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL45(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL45_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL45_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL14_MASK (0x4000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL14_SHIFT (14U) -/*! VAL14 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL14(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL14_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL14_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL46_MASK (0x4000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL46_SHIFT (14U) -/*! VAL46 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL46(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL46_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL46_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL15_MASK (0x8000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL15_SHIFT (15U) -/*! VAL15 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL15(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL15_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL15_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL47_MASK (0x8000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL47_SHIFT (15U) -/*! VAL47 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL47(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL47_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL47_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL16_MASK (0x10000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL16_SHIFT (16U) -/*! VAL16 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL16(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL16_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL16_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL48_MASK (0x10000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL48_SHIFT (16U) -/*! VAL48 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL48(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL48_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL48_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL17_MASK (0x20000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL17_SHIFT (17U) -/*! VAL17 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL17(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL17_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL17_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL49_MASK (0x20000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL49_SHIFT (17U) -/*! VAL49 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL49(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL49_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL49_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL18_MASK (0x40000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL18_SHIFT (18U) -/*! VAL18 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL18(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL18_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL18_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL50_MASK (0x40000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL50_SHIFT (18U) -/*! VAL50 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL50(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL50_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL50_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL19_MASK (0x80000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL19_SHIFT (19U) -/*! VAL19 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL19(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL19_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL19_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL51_MASK (0x80000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL51_SHIFT (19U) -/*! VAL51 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL51(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL51_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL51_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL20_MASK (0x100000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL20_SHIFT (20U) -/*! VAL20 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL20(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL20_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL20_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL52_MASK (0x100000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL52_SHIFT (20U) -/*! VAL52 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL52(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL52_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL52_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL21_MASK (0x200000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL21_SHIFT (21U) -/*! VAL21 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL21(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL21_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL21_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL53_MASK (0x200000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL53_SHIFT (21U) -/*! VAL53 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL53(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL53_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL53_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL22_MASK (0x400000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL22_SHIFT (22U) -/*! VAL22 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL22(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL22_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL22_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL54_MASK (0x400000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL54_SHIFT (22U) -/*! VAL54 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL54(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL54_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL54_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL23_MASK (0x800000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL23_SHIFT (23U) -/*! VAL23 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL23(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL23_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL23_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL55_MASK (0x800000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL55_SHIFT (23U) -/*! VAL55 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL55(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL55_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL55_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL24_MASK (0x1000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL24_SHIFT (24U) -/*! VAL24 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL24(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL24_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL24_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL56_MASK (0x1000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL56_SHIFT (24U) -/*! VAL56 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL56(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL56_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL56_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL25_MASK (0x2000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL25_SHIFT (25U) -/*! VAL25 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL25(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL25_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL25_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL57_MASK (0x2000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL57_SHIFT (25U) -/*! VAL57 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL57(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL57_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL57_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL26_MASK (0x4000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL26_SHIFT (26U) -/*! VAL26 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL26(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL26_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL26_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL58_MASK (0x4000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL58_SHIFT (26U) -/*! VAL58 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL58(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL58_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL58_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL27_MASK (0x8000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL27_SHIFT (27U) -/*! VAL27 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL27(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL27_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL27_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL59_MASK (0x8000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL59_SHIFT (27U) -/*! VAL59 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL59(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL59_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL59_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL28_MASK (0x10000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL28_SHIFT (28U) -/*! VAL28 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL28(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL28_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL28_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL60_MASK (0x10000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL60_SHIFT (28U) -/*! VAL60 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL60(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL60_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL60_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL29_MASK (0x20000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL29_SHIFT (29U) -/*! VAL29 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL29(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL29_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL29_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL61_MASK (0x20000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL61_SHIFT (29U) -/*! VAL61 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL61(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL61_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL61_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL30_MASK (0x40000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL30_SHIFT (30U) -/*! VAL30 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL30(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL30_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL30_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL62_MASK (0x40000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL62_SHIFT (30U) -/*! VAL62 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL62(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL62_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL62_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL31_MASK (0x80000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL31_SHIFT (31U) -/*! VAL31 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL31(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL31_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL31_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL63_MASK (0x80000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL63_SHIFT (31U) -/*! VAL63 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL63(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL63_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL63_MASK) -/*! @} */ - -/* The count of NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_COUNT (4U) - -/* The count of NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_COUNT2 (2U) - -/*! @name CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD - Block Initial Vector for Memory Context 0..Block Initial Vector for Memory Context 3 */ -/*! @{ */ - -#define NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_BIV_WD0_MASK (0xFFFFFFFFU) -#define NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_BIV_WD0_SHIFT (0U) -/*! BIV_WD0 - Block Initial Vector Word0 */ -#define NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_BIV_WD0(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_BIV_WD0_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_BIV_WD0_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_BIV_WD1_MASK (0xFFFFFFFFU) -#define NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_BIV_WD1_SHIFT (0U) -/*! BIV_WD1 - Block Initial Vector Word1 */ -#define NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_BIV_WD1(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_BIV_WD1_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_BIV_WD1_MASK) -/*! @} */ - -/* The count of NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD */ -#define NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_COUNT (4U) - -/* The count of NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD */ -#define NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_COUNT2 (2U) - - -/*! - * @} - */ /* end of group NPX_Register_Masks */ - - -/* NPX - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral NPX0 base address */ - #define NPX0_BASE (0x500CC000u) - /** Peripheral NPX0 base address */ - #define NPX0_BASE_NS (0x400CC000u) - /** Peripheral NPX0 base pointer */ - #define NPX0 ((NPX_Type *)NPX0_BASE) - /** Peripheral NPX0 base pointer */ - #define NPX0_NS ((NPX_Type *)NPX0_BASE_NS) - /** Array initializer of NPX peripheral base addresses */ - #define NPX_BASE_ADDRS { NPX0_BASE } - /** Array initializer of NPX peripheral base pointers */ - #define NPX_BASE_PTRS { NPX0 } - /** Array initializer of NPX peripheral base addresses */ - #define NPX_BASE_ADDRS_NS { NPX0_BASE_NS } - /** Array initializer of NPX peripheral base pointers */ - #define NPX_BASE_PTRS_NS { NPX0_NS } -#else - /** Peripheral NPX0 base address */ - #define NPX0_BASE (0x400CC000u) - /** Peripheral NPX0 base pointer */ - #define NPX0 ((NPX_Type *)NPX0_BASE) - /** Array initializer of NPX peripheral base addresses */ - #define NPX_BASE_ADDRS { NPX0_BASE } - /** Array initializer of NPX peripheral base pointers */ - #define NPX_BASE_PTRS { NPX0 } -#endif - -/*! - * @} - */ /* end of group NPX_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- OPAMP Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup OPAMP_Peripheral_Access_Layer OPAMP Peripheral Access Layer - * @{ - */ - -/** OPAMP - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - __IO uint32_t OPAMP_CTR; /**< OPAMP Control, offset: 0x8 */ -} OPAMP_Type; - -/* ---------------------------------------------------------------------------- - -- OPAMP Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup OPAMP_Register_Masks OPAMP Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define OPAMP_VERID_FEATURE_MASK (0xFFFFU) -#define OPAMP_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number */ -#define OPAMP_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_VERID_FEATURE_SHIFT)) & OPAMP_VERID_FEATURE_MASK) - -#define OPAMP_VERID_MINOR_MASK (0xFF0000U) -#define OPAMP_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define OPAMP_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_VERID_MINOR_SHIFT)) & OPAMP_VERID_MINOR_MASK) - -#define OPAMP_VERID_MAJOR_MASK (0xFF000000U) -#define OPAMP_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define OPAMP_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_VERID_MAJOR_SHIFT)) & OPAMP_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define OPAMP_PARAM_PGA_FUNCTION_MASK (0x1U) -#define OPAMP_PARAM_PGA_FUNCTION_SHIFT (0U) -/*! PGA_FUNCTION - PGA Function Option - * 0b0..Core amplifier enabled - * 0b1..PGA function enabled - */ -#define OPAMP_PARAM_PGA_FUNCTION(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_PARAM_PGA_FUNCTION_SHIFT)) & OPAMP_PARAM_PGA_FUNCTION_MASK) -/*! @} */ - -/*! @name OPAMP_CTR - OPAMP Control */ -/*! @{ */ - -#define OPAMP_OPAMP_CTR_EN_MASK (0x1U) -#define OPAMP_OPAMP_CTR_EN_SHIFT (0U) -/*! EN - OPAMP Enable - * 0b0..Disable - * 0b1..Enable - */ -#define OPAMP_OPAMP_CTR_EN(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_EN_SHIFT)) & OPAMP_OPAMP_CTR_EN_MASK) - -#define OPAMP_OPAMP_CTR_MODE_MASK (0x2U) -#define OPAMP_OPAMP_CTR_MODE_SHIFT (1U) -/*! MODE - Mode Selection - * 0b0..High performance mode - * 0b1..Low power mode - */ -#define OPAMP_OPAMP_CTR_MODE(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_MODE_SHIFT)) & OPAMP_OPAMP_CTR_MODE_MASK) - -#define OPAMP_OPAMP_CTR_BIASC_MASK (0xCU) -#define OPAMP_OPAMP_CTR_BIASC_SHIFT (2U) -/*! BIASC - Bias Current Trim Selection - * 0b00..Default - * 0b01..Increase current - * 0b10..Decrease current - * 0b11..Further decrease current - */ -#define OPAMP_OPAMP_CTR_BIASC(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_BIASC_SHIFT)) & OPAMP_OPAMP_CTR_BIASC_MASK) - -#define OPAMP_OPAMP_CTR_INTREF_MASK (0x30U) -#define OPAMP_OPAMP_CTR_INTREF_SHIFT (4U) -/*! INTREF - Provide OPAMP rail to rail voltage selection - * 0b00..Select OPAMP input rail to rail voltage from 0 to VDD_ANA - * 0b01..Select OPAMP input rail to rail voltage from 0 to VDD_ANA-0.8V - * 0b10..Select OPAMP input rail to rail voltage from 0.8V to VDD_ANA - * 0b11..Not allowed - */ -#define OPAMP_OPAMP_CTR_INTREF(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_INTREF_SHIFT)) & OPAMP_OPAMP_CTR_INTREF_MASK) - -#define OPAMP_OPAMP_CTR_TRIGMD_MASK (0x100U) -#define OPAMP_OPAMP_CTR_TRIGMD_SHIFT (8U) -/*! TRIGMD - Trigger Mode - * 0b0..Disable - * 0b1..Enable - */ -#define OPAMP_OPAMP_CTR_TRIGMD(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_TRIGMD_SHIFT)) & OPAMP_OPAMP_CTR_TRIGMD_MASK) - -#define OPAMP_OPAMP_CTR_INPSEL_MASK (0x200U) -#define OPAMP_OPAMP_CTR_INPSEL_SHIFT (9U) -/*! INPSEL - Positive Input Channel Selection - * 0b0..When OPAMP is not in trigger mode, select positive input 0 (INP0) - * 0b1..When OPAMP is not in trigger mode, select positive input 1 (INP1) - */ -#define OPAMP_OPAMP_CTR_INPSEL(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_INPSEL_SHIFT)) & OPAMP_OPAMP_CTR_INPSEL_MASK) - -#define OPAMP_OPAMP_CTR_INPF_MASK (0x1000U) -#define OPAMP_OPAMP_CTR_INPF_SHIFT (12U) -/*! INPF - Positive Input Connection Status - * 0b0..Positive input 0 (INP0) - * 0b1..Positive input 1 (INP1) - */ -#define OPAMP_OPAMP_CTR_INPF(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_INPF_SHIFT)) & OPAMP_OPAMP_CTR_INPF_MASK) - -#define OPAMP_OPAMP_CTR_BUFEN_MASK (0x10000U) -#define OPAMP_OPAMP_CTR_BUFEN_SHIFT (16U) -/*! BUFEN - Reference Buffer - * 0b0..Disables - * 0b1..Enables - */ -#define OPAMP_OPAMP_CTR_BUFEN(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_BUFEN_SHIFT)) & OPAMP_OPAMP_CTR_BUFEN_MASK) - -#define OPAMP_OPAMP_CTR_PREF_MASK (0x60000U) -#define OPAMP_OPAMP_CTR_PREF_SHIFT (17U) -/*! PREF - Positive Reference Voltage Selection - * 0b00..Input 0 - * 0b01..Input 1 - * 0b10..Input 2 - * 0b11..Input 3 - */ -#define OPAMP_OPAMP_CTR_PREF(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_PREF_SHIFT)) & OPAMP_OPAMP_CTR_PREF_MASK) - -#define OPAMP_OPAMP_CTR_ADCSW1_MASK (0x100000U) -#define OPAMP_OPAMP_CTR_ADCSW1_SHIFT (20U) -/*! ADCSW1 - Measure Switch 1 - * 0b0..Measure negative gain resistor ladder voltage switch off - * 0b1..Measure negative gain resistor ladder voltage switch on - */ -#define OPAMP_OPAMP_CTR_ADCSW1(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_ADCSW1_SHIFT)) & OPAMP_OPAMP_CTR_ADCSW1_MASK) - -#define OPAMP_OPAMP_CTR_ADCSW2_MASK (0x200000U) -#define OPAMP_OPAMP_CTR_ADCSW2_SHIFT (21U) -/*! ADCSW2 - Measure Switch 2 - * 0b0..Measure positive gain resistor ladder reference voltage switch off - * 0b1..Measure positive gain resistor ladder reference voltage switch on - */ -#define OPAMP_OPAMP_CTR_ADCSW2(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_ADCSW2_SHIFT)) & OPAMP_OPAMP_CTR_ADCSW2_MASK) - -#define OPAMP_OPAMP_CTR_OUTSW_MASK (0x400000U) -#define OPAMP_OPAMP_CTR_OUTSW_SHIFT (22U) -/*! OUTSW - Output Switch - * 0b0..OPAMP out to negative gain resistor ladder switch off - * 0b1..OPAMP out to negative gain resistor ladder switch on - */ -#define OPAMP_OPAMP_CTR_OUTSW(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_OUTSW_SHIFT)) & OPAMP_OPAMP_CTR_OUTSW_MASK) - -#define OPAMP_OPAMP_CTR_PGAIN_MASK (0x7000000U) -#define OPAMP_OPAMP_CTR_PGAIN_SHIFT (24U) -/*! PGAIN - Positive PGA Selection - * 0b000..Positive input 1 (INP1) - * 0b001..Pgain=1 - * 0b010..Pgain=2 - * 0b011..Pgain=4 - * 0b100..Pgain=8 - * 0b101..Pgain=16 - * 0b110..Pgain=33 - * 0b111..Pgain=64 - */ -#define OPAMP_OPAMP_CTR_PGAIN(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_PGAIN_SHIFT)) & OPAMP_OPAMP_CTR_PGAIN_MASK) - -#define OPAMP_OPAMP_CTR_NGAIN_MASK (0x70000000U) -#define OPAMP_OPAMP_CTR_NGAIN_SHIFT (28U) -/*! NGAIN - Negative PGA Selection - * 0b000..Buffer - * 0b001..Ngain=1 - * 0b010..Ngain=2 - * 0b011..Ngain=4 - * 0b100..Ngain=8 - * 0b101..Ngain=16 - * 0b110..Ngain=33 - * 0b111..Ngain=64 - */ -#define OPAMP_OPAMP_CTR_NGAIN(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_NGAIN_SHIFT)) & OPAMP_OPAMP_CTR_NGAIN_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group OPAMP_Register_Masks */ - - -/* OPAMP - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral OPAMP0 base address */ - #define OPAMP0_BASE (0x50110000u) - /** Peripheral OPAMP0 base address */ - #define OPAMP0_BASE_NS (0x40110000u) - /** Peripheral OPAMP0 base pointer */ - #define OPAMP0 ((OPAMP_Type *)OPAMP0_BASE) - /** Peripheral OPAMP0 base pointer */ - #define OPAMP0_NS ((OPAMP_Type *)OPAMP0_BASE_NS) - /** Peripheral OPAMP1 base address */ - #define OPAMP1_BASE (0x50113000u) - /** Peripheral OPAMP1 base address */ - #define OPAMP1_BASE_NS (0x40113000u) - /** Peripheral OPAMP1 base pointer */ - #define OPAMP1 ((OPAMP_Type *)OPAMP1_BASE) - /** Peripheral OPAMP1 base pointer */ - #define OPAMP1_NS ((OPAMP_Type *)OPAMP1_BASE_NS) - /** Peripheral OPAMP2 base address */ - #define OPAMP2_BASE (0x50115000u) - /** Peripheral OPAMP2 base address */ - #define OPAMP2_BASE_NS (0x40115000u) - /** Peripheral OPAMP2 base pointer */ - #define OPAMP2 ((OPAMP_Type *)OPAMP2_BASE) - /** Peripheral OPAMP2 base pointer */ - #define OPAMP2_NS ((OPAMP_Type *)OPAMP2_BASE_NS) - /** Array initializer of OPAMP peripheral base addresses */ - #define OPAMP_BASE_ADDRS { OPAMP0_BASE, OPAMP1_BASE, OPAMP2_BASE } - /** Array initializer of OPAMP peripheral base pointers */ - #define OPAMP_BASE_PTRS { OPAMP0, OPAMP1, OPAMP2 } - /** Array initializer of OPAMP peripheral base addresses */ - #define OPAMP_BASE_ADDRS_NS { OPAMP0_BASE_NS, OPAMP1_BASE_NS, OPAMP2_BASE_NS } - /** Array initializer of OPAMP peripheral base pointers */ - #define OPAMP_BASE_PTRS_NS { OPAMP0_NS, OPAMP1_NS, OPAMP2_NS } -#else - /** Peripheral OPAMP0 base address */ - #define OPAMP0_BASE (0x40110000u) - /** Peripheral OPAMP0 base pointer */ - #define OPAMP0 ((OPAMP_Type *)OPAMP0_BASE) - /** Peripheral OPAMP1 base address */ - #define OPAMP1_BASE (0x40113000u) - /** Peripheral OPAMP1 base pointer */ - #define OPAMP1 ((OPAMP_Type *)OPAMP1_BASE) - /** Peripheral OPAMP2 base address */ - #define OPAMP2_BASE (0x40115000u) - /** Peripheral OPAMP2 base pointer */ - #define OPAMP2 ((OPAMP_Type *)OPAMP2_BASE) - /** Array initializer of OPAMP peripheral base addresses */ - #define OPAMP_BASE_ADDRS { OPAMP0_BASE, OPAMP1_BASE, OPAMP2_BASE } - /** Array initializer of OPAMP peripheral base pointers */ - #define OPAMP_BASE_PTRS { OPAMP0, OPAMP1, OPAMP2 } -#endif - -/*! - * @} - */ /* end of group OPAMP_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- OSTIMER Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup OSTIMER_Peripheral_Access_Layer OSTIMER Peripheral Access Layer - * @{ - */ - -/** OSTIMER - Register Layout Typedef */ -typedef struct { - __I uint32_t EVTIMERL; /**< EVTIMER Low, offset: 0x0 */ - __I uint32_t EVTIMERH; /**< EVTIMER High, offset: 0x4 */ - __I uint32_t CAPTURE_L; /**< Local Capture Low for CPU, offset: 0x8 */ - __I uint32_t CAPTURE_H; /**< Local Capture High for CPU, offset: 0xC */ - __IO uint32_t MATCH_L; /**< Local Match Low for CPU, offset: 0x10 */ - __IO uint32_t MATCH_H; /**< Local Match High for CPU, offset: 0x14 */ - uint8_t RESERVED_0[4]; - __IO uint32_t OSEVENT_CTRL; /**< OSTIMER Control for CPU, offset: 0x1C */ -} OSTIMER_Type; - -/* ---------------------------------------------------------------------------- - -- OSTIMER Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup OSTIMER_Register_Masks OSTIMER Register Masks - * @{ - */ - -/*! @name EVTIMERL - EVTIMER Low */ -/*! @{ */ - -#define OSTIMER_EVTIMERL_EVTIMER_COUNT_VALUE_MASK (0xFFFFFFFFU) -#define OSTIMER_EVTIMERL_EVTIMER_COUNT_VALUE_SHIFT (0U) -/*! EVTIMER_COUNT_VALUE - EVTimer Count Value */ -#define OSTIMER_EVTIMERL_EVTIMER_COUNT_VALUE(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_EVTIMERL_EVTIMER_COUNT_VALUE_SHIFT)) & OSTIMER_EVTIMERL_EVTIMER_COUNT_VALUE_MASK) -/*! @} */ - -/*! @name EVTIMERH - EVTIMER High */ -/*! @{ */ - -#define OSTIMER_EVTIMERH_EVTIMER_COUNT_VALUE_MASK (0x3FFU) -#define OSTIMER_EVTIMERH_EVTIMER_COUNT_VALUE_SHIFT (0U) -/*! EVTIMER_COUNT_VALUE - EVTimer Count Value */ -#define OSTIMER_EVTIMERH_EVTIMER_COUNT_VALUE(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_EVTIMERH_EVTIMER_COUNT_VALUE_SHIFT)) & OSTIMER_EVTIMERH_EVTIMER_COUNT_VALUE_MASK) -/*! @} */ - -/*! @name CAPTURE_L - Local Capture Low for CPU */ -/*! @{ */ - -#define OSTIMER_CAPTURE_L_CAPTURE_VALUE_MASK (0xFFFFFFFFU) -#define OSTIMER_CAPTURE_L_CAPTURE_VALUE_SHIFT (0U) -/*! CAPTURE_VALUE - EVTimer Capture Value */ -#define OSTIMER_CAPTURE_L_CAPTURE_VALUE(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_CAPTURE_L_CAPTURE_VALUE_SHIFT)) & OSTIMER_CAPTURE_L_CAPTURE_VALUE_MASK) -/*! @} */ - -/*! @name CAPTURE_H - Local Capture High for CPU */ -/*! @{ */ - -#define OSTIMER_CAPTURE_H_CAPTURE_VALUE_MASK (0x3FFU) -#define OSTIMER_CAPTURE_H_CAPTURE_VALUE_SHIFT (0U) -/*! CAPTURE_VALUE - EVTimer Capture Value */ -#define OSTIMER_CAPTURE_H_CAPTURE_VALUE(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_CAPTURE_H_CAPTURE_VALUE_SHIFT)) & OSTIMER_CAPTURE_H_CAPTURE_VALUE_MASK) -/*! @} */ - -/*! @name MATCH_L - Local Match Low for CPU */ -/*! @{ */ - -#define OSTIMER_MATCH_L_MATCH_VALUE_MASK (0xFFFFFFFFU) -#define OSTIMER_MATCH_L_MATCH_VALUE_SHIFT (0U) -/*! MATCH_VALUE - EVTimer Match Value */ -#define OSTIMER_MATCH_L_MATCH_VALUE(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_MATCH_L_MATCH_VALUE_SHIFT)) & OSTIMER_MATCH_L_MATCH_VALUE_MASK) -/*! @} */ - -/*! @name MATCH_H - Local Match High for CPU */ -/*! @{ */ - -#define OSTIMER_MATCH_H_MATCH_VALUE_MASK (0x3FFU) -#define OSTIMER_MATCH_H_MATCH_VALUE_SHIFT (0U) -/*! MATCH_VALUE - EVTimer Match Value */ -#define OSTIMER_MATCH_H_MATCH_VALUE(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_MATCH_H_MATCH_VALUE_SHIFT)) & OSTIMER_MATCH_H_MATCH_VALUE_MASK) -/*! @} */ - -/*! @name OSEVENT_CTRL - OSTIMER Control for CPU */ -/*! @{ */ - -#define OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG_MASK (0x1U) -#define OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG_SHIFT (0U) -/*! OSTIMER_INTRFLAG - Interrupt Flag */ -#define OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG_SHIFT)) & OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG_MASK) - -#define OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_MASK (0x2U) -#define OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_SHIFT (1U) -/*! OSTIMER_INTENA - Interrupt or Wake-Up Request - * 0b0..Interrupts blocked - * 0b1..Interrupts enabled - */ -#define OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_SHIFT)) & OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_MASK) - -#define OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK (0x4U) -#define OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_SHIFT (2U) -/*! MATCH_WR_RDY - EVTimer Match Write Ready */ -#define OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_SHIFT)) & OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group OSTIMER_Register_Masks */ - - -/* OSTIMER - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral OSTIMER0 base address */ - #define OSTIMER0_BASE (0x50049000u) - /** Peripheral OSTIMER0 base address */ - #define OSTIMER0_BASE_NS (0x40049000u) - /** Peripheral OSTIMER0 base pointer */ - #define OSTIMER0 ((OSTIMER_Type *)OSTIMER0_BASE) - /** Peripheral OSTIMER0 base pointer */ - #define OSTIMER0_NS ((OSTIMER_Type *)OSTIMER0_BASE_NS) - /** Array initializer of OSTIMER peripheral base addresses */ - #define OSTIMER_BASE_ADDRS { OSTIMER0_BASE } - /** Array initializer of OSTIMER peripheral base pointers */ - #define OSTIMER_BASE_PTRS { OSTIMER0 } - /** Array initializer of OSTIMER peripheral base addresses */ - #define OSTIMER_BASE_ADDRS_NS { OSTIMER0_BASE_NS } - /** Array initializer of OSTIMER peripheral base pointers */ - #define OSTIMER_BASE_PTRS_NS { OSTIMER0_NS } -#else - /** Peripheral OSTIMER0 base address */ - #define OSTIMER0_BASE (0x40049000u) - /** Peripheral OSTIMER0 base pointer */ - #define OSTIMER0 ((OSTIMER_Type *)OSTIMER0_BASE) - /** Array initializer of OSTIMER peripheral base addresses */ - #define OSTIMER_BASE_ADDRS { OSTIMER0_BASE } - /** Array initializer of OSTIMER peripheral base pointers */ - #define OSTIMER_BASE_PTRS { OSTIMER0 } -#endif -/** Interrupt vectors for the OSTIMER peripheral type */ -#define OSTIMER_IRQS { OS_EVENT_IRQn } - -/*! - * @} - */ /* end of group OSTIMER_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- OTPC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup OTPC_Peripheral_Access_Layer OTPC Peripheral Access Layer - * @{ - */ - -/** OTPC - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameters, offset: 0x4 */ - __IO uint32_t SR; /**< Status, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __IO uint32_t RWC; /**< Read and Write Control, offset: 0x10 */ - __IO uint32_t RLC; /**< Reload Control, offset: 0x14 */ - __IO uint32_t PCR; /**< Power Control, offset: 0x18 */ - uint8_t RESERVED_1[4]; - __IO uint32_t WDATA; /**< Write Data, offset: 0x20 */ - __I uint32_t RDATA; /**< Read Data, offset: 0x24 */ - uint8_t RESERVED_2[8]; - __IO uint32_t TIMING1; /**< Timing1, offset: 0x30 */ - __IO uint32_t TIMING2; /**< Timing2, offset: 0x34 */ - uint8_t RESERVED_3[456]; - __I uint32_t LOCK; /**< Lock, offset: 0x200 */ - __I uint32_t SECURE; /**< Secure, offset: 0x204 */ - __I uint32_t SECURE_INV; /**< Inverted Secure, offset: 0x208 */ - __I uint32_t DBG_KEY; /**< Debug and Key, offset: 0x20C */ - __IO uint32_t MISC_CFG; /**< MISC Config, offset: 0x210 */ - __IO uint32_t PHANTOM_CFG; /**< PHANTOM Config, offset: 0x214 */ - __IO uint32_t FLEX_CFG0; /**< Flexible Config 0, offset: 0x218 */ - __IO uint32_t FLEX_CFG1; /**< Flexible Config 1, offset: 0x21C */ -} OTPC_Type; - -/* ---------------------------------------------------------------------------- - -- OTPC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup OTPC_Register_Masks OTPC Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define OTPC_VERID_FEATURE_MASK (0xFFFFU) -#define OTPC_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Standard feature set - */ -#define OTPC_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << OTPC_VERID_FEATURE_SHIFT)) & OTPC_VERID_FEATURE_MASK) - -#define OTPC_VERID_MINOR_MASK (0xFF0000U) -#define OTPC_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define OTPC_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << OTPC_VERID_MINOR_SHIFT)) & OTPC_VERID_MINOR_MASK) - -#define OTPC_VERID_MAJOR_MASK (0xFF000000U) -#define OTPC_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define OTPC_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << OTPC_VERID_MAJOR_SHIFT)) & OTPC_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameters */ -/*! @{ */ - -#define OTPC_PARAM_NUM_FUSE_MASK (0xFFFFU) -#define OTPC_PARAM_NUM_FUSE_SHIFT (0U) -/*! NUM_FUSE - Number of fuse bytes */ -#define OTPC_PARAM_NUM_FUSE(x) (((uint32_t)(((uint32_t)(x)) << OTPC_PARAM_NUM_FUSE_SHIFT)) & OTPC_PARAM_NUM_FUSE_MASK) -/*! @} */ - -/*! @name SR - Status */ -/*! @{ */ - -#define OTPC_SR_BUSY_MASK (0x1U) -#define OTPC_SR_BUSY_SHIFT (0U) -/*! BUSY - Busy status - * 0b0..Not busy (transaction complete) - * 0b1..Busy - */ -#define OTPC_SR_BUSY(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_BUSY_SHIFT)) & OTPC_SR_BUSY_MASK) - -#define OTPC_SR_ERROR_MASK (0x2U) -#define OTPC_SR_ERROR_SHIFT (1U) -/*! ERROR - Error flag - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_ERROR(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_ERROR_SHIFT)) & OTPC_SR_ERROR_MASK) - -#define OTPC_SR_ECC_SF_MASK (0x4U) -#define OTPC_SR_ECC_SF_SHIFT (2U) -/*! ECC_SF - ECC single fault - * 0b0..No fault - * 0b1..Fault - */ -#define OTPC_SR_ECC_SF(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_ECC_SF_SHIFT)) & OTPC_SR_ECC_SF_MASK) - -#define OTPC_SR_ECC_DF_MASK (0x8U) -#define OTPC_SR_ECC_DF_SHIFT (3U) -/*! ECC_DF - ECC double fault - * 0b0..No fault - * 0b1..Fault - */ -#define OTPC_SR_ECC_DF(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_ECC_DF_SHIFT)) & OTPC_SR_ECC_DF_MASK) - -#define OTPC_SR_TRI_F_MASK (0x10U) -#define OTPC_SR_TRI_F_SHIFT (4U) -/*! TRI_F - Triple voting fault - * 0b0..No fault - * 0b1..Fault - */ -#define OTPC_SR_TRI_F(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_TRI_F_SHIFT)) & OTPC_SR_TRI_F_MASK) - -#define OTPC_SR_RD_FUSE_LOCK_MASK (0x100U) -#define OTPC_SR_RD_FUSE_LOCK_SHIFT (8U) -/*! RD_FUSE_LOCK - Read fuse lock error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_RD_FUSE_LOCK(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_RD_FUSE_LOCK_SHIFT)) & OTPC_SR_RD_FUSE_LOCK_MASK) - -#define OTPC_SR_WR_FUSE_LOCK_MASK (0x200U) -#define OTPC_SR_WR_FUSE_LOCK_SHIFT (9U) -/*! WR_FUSE_LOCK - Write fuse lock error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_WR_FUSE_LOCK(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_WR_FUSE_LOCK_SHIFT)) & OTPC_SR_WR_FUSE_LOCK_MASK) - -#define OTPC_SR_RD_REG_LOCK_MASK (0x400U) -#define OTPC_SR_RD_REG_LOCK_SHIFT (10U) -/*! RD_REG_LOCK - Read register lock error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_RD_REG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_RD_REG_LOCK_SHIFT)) & OTPC_SR_RD_REG_LOCK_MASK) - -#define OTPC_SR_WR_REG_LOCK_MASK (0x800U) -#define OTPC_SR_WR_REG_LOCK_SHIFT (11U) -/*! WR_REG_LOCK - Write register lock error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_WR_REG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_WR_REG_LOCK_SHIFT)) & OTPC_SR_WR_REG_LOCK_MASK) - -#define OTPC_SR_WR_REG_BUSY_MASK (0x1000U) -#define OTPC_SR_WR_REG_BUSY_SHIFT (12U) -/*! WR_REG_BUSY - Write register when busy error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_WR_REG_BUSY(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_WR_REG_BUSY_SHIFT)) & OTPC_SR_WR_REG_BUSY_MASK) - -#define OTPC_SR_WR_POWER_OFF_MASK (0x2000U) -#define OTPC_SR_WR_POWER_OFF_SHIFT (13U) -/*! WR_POWER_OFF - Write when power off error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_WR_POWER_OFF(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_WR_POWER_OFF_SHIFT)) & OTPC_SR_WR_POWER_OFF_MASK) - -#define OTPC_SR_FSM_MASK (0x10000U) -#define OTPC_SR_FSM_SHIFT (16U) -/*! FSM - Finite-state machine error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_FSM(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_FSM_SHIFT)) & OTPC_SR_FSM_MASK) - -#define OTPC_SR_FLC_MASK (0x20000U) -#define OTPC_SR_FLC_SHIFT (17U) -/*! FLC - Fuse load counter error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_FLC(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_FLC_SHIFT)) & OTPC_SR_FLC_MASK) - -#define OTPC_SR_ADC_MASK (0x40000U) -#define OTPC_SR_ADC_SHIFT (18U) -/*! ADC - Address and data compare error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_ADC(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_ADC_SHIFT)) & OTPC_SR_ADC_MASK) - -#define OTPC_SR_IRC_MASK (0x80000U) -#define OTPC_SR_IRC_SHIFT (19U) -/*! IRC - Inverted register compare error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_IRC(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_IRC_SHIFT)) & OTPC_SR_IRC_MASK) - -#define OTPC_SR_FSC_MASK (0x100000U) -#define OTPC_SR_FSC_SHIFT (20U) -/*! FSC - Fuse and shadow register compare error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_FSC(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_FSC_SHIFT)) & OTPC_SR_FSC_MASK) -/*! @} */ - -/*! @name RWC - Read and Write Control */ -/*! @{ */ - -#define OTPC_RWC_ADDR_MASK (0x7FU) -#define OTPC_RWC_ADDR_SHIFT (0U) -/*! ADDR - EFUSE address */ -#define OTPC_RWC_ADDR(x) (((uint32_t)(((uint32_t)(x)) << OTPC_RWC_ADDR_SHIFT)) & OTPC_RWC_ADDR_MASK) - -#define OTPC_RWC_WR_ALL1S_MASK (0x1000U) -#define OTPC_RWC_WR_ALL1S_SHIFT (12U) -/*! WR_ALL1S - Write all 1s - * 0b0..Uses the WDATA value - * 0b1..Writes all 1s - */ -#define OTPC_RWC_WR_ALL1S(x) (((uint32_t)(((uint32_t)(x)) << OTPC_RWC_WR_ALL1S_SHIFT)) & OTPC_RWC_WR_ALL1S_MASK) - -#define OTPC_RWC_READ_EFUSE_MASK (0x2000U) -#define OTPC_RWC_READ_EFUSE_SHIFT (13U) -/*! READ_EFUSE - Read EFUSE - * 0b0..Starts program operation when the WR_UNLOCK value is 0x9527; otherwise, takes no action. - * 0b1..Starts read operation - */ -#define OTPC_RWC_READ_EFUSE(x) (((uint32_t)(((uint32_t)(x)) << OTPC_RWC_READ_EFUSE_SHIFT)) & OTPC_RWC_READ_EFUSE_MASK) - -#define OTPC_RWC_READ_UPDATE_MASK (0x4000U) -#define OTPC_RWC_READ_UPDATE_SHIFT (14U) -/*! READ_UPDATE - Read update - * 0b0..Shadow register does not update - * 0b1..Shadow register updates - */ -#define OTPC_RWC_READ_UPDATE(x) (((uint32_t)(((uint32_t)(x)) << OTPC_RWC_READ_UPDATE_SHIFT)) & OTPC_RWC_READ_UPDATE_MASK) - -#define OTPC_RWC_WR_UNLOCK_MASK (0xFFFF0000U) -#define OTPC_RWC_WR_UNLOCK_SHIFT (16U) -/*! WR_UNLOCK - Write Unlock */ -#define OTPC_RWC_WR_UNLOCK(x) (((uint32_t)(((uint32_t)(x)) << OTPC_RWC_WR_UNLOCK_SHIFT)) & OTPC_RWC_WR_UNLOCK_MASK) -/*! @} */ - -/*! @name RLC - Reload Control */ -/*! @{ */ - -#define OTPC_RLC_RELOAD_SHADOWS_MASK (0x1U) -#define OTPC_RLC_RELOAD_SHADOWS_SHIFT (0U) -/*! RELOAD_SHADOWS - Reload shadow registers - * 0b0..No action (when writing) or reload complete (when reading) - * 0b1..Reload - */ -#define OTPC_RLC_RELOAD_SHADOWS(x) (((uint32_t)(((uint32_t)(x)) << OTPC_RLC_RELOAD_SHADOWS_SHIFT)) & OTPC_RLC_RELOAD_SHADOWS_MASK) -/*! @} */ - -/*! @name PCR - Power Control */ -/*! @{ */ - -#define OTPC_PCR_HVREQ_MASK (0x1U) -#define OTPC_PCR_HVREQ_SHIFT (0U) -/*! HVREQ - Strong switch request - * 0b0..Turn off - * 0b1..Turn on - */ -#define OTPC_PCR_HVREQ(x) (((uint32_t)(((uint32_t)(x)) << OTPC_PCR_HVREQ_SHIFT)) & OTPC_PCR_HVREQ_MASK) - -#define OTPC_PCR_LVREQ_MASK (0x2U) -#define OTPC_PCR_LVREQ_SHIFT (1U) -/*! LVREQ - Weak switch request - * 0b0..Turn off - * 0b1..Turn on - */ -#define OTPC_PCR_LVREQ(x) (((uint32_t)(((uint32_t)(x)) << OTPC_PCR_LVREQ_SHIFT)) & OTPC_PCR_LVREQ_MASK) - -#define OTPC_PCR_PDREQ_MASK (0x4U) -#define OTPC_PCR_PDREQ_SHIFT (2U) -/*! PDREQ - Power down request - * 0b0..PD pin is set to low when OTPC is in idle state. It means EFUSE hardmacro is in standby mode. Idle state - * means OTPC is not in read and program modes. - * 0b1..PD pin is set to high when OTPC is in idle state. It means EFUSE hardmacro is in power down mode. - */ -#define OTPC_PCR_PDREQ(x) (((uint32_t)(((uint32_t)(x)) << OTPC_PCR_PDREQ_SHIFT)) & OTPC_PCR_PDREQ_MASK) -/*! @} */ - -/*! @name WDATA - Write Data */ -/*! @{ */ - -#define OTPC_WDATA_DAT_MASK (0xFFFFFFFFU) -#define OTPC_WDATA_DAT_SHIFT (0U) -/*! DAT - Write data */ -#define OTPC_WDATA_DAT(x) (((uint32_t)(((uint32_t)(x)) << OTPC_WDATA_DAT_SHIFT)) & OTPC_WDATA_DAT_MASK) -/*! @} */ - -/*! @name RDATA - Read Data */ -/*! @{ */ - -#define OTPC_RDATA_DAT_MASK (0xFFFFFFFFU) -#define OTPC_RDATA_DAT_SHIFT (0U) -/*! DAT - Read data */ -#define OTPC_RDATA_DAT(x) (((uint32_t)(((uint32_t)(x)) << OTPC_RDATA_DAT_SHIFT)) & OTPC_RDATA_DAT_MASK) -/*! @} */ - -/*! @name TIMING1 - Timing1 */ -/*! @{ */ - -#define OTPC_TIMING1_TADDR_MASK (0xFU) -#define OTPC_TIMING1_TADDR_SHIFT (0U) -/*! TADDR - Address to STROBE setup and hold time */ -#define OTPC_TIMING1_TADDR(x) (((uint32_t)(((uint32_t)(x)) << OTPC_TIMING1_TADDR_SHIFT)) & OTPC_TIMING1_TADDR_MASK) - -#define OTPC_TIMING1_TRELAX_MASK (0xF0U) -#define OTPC_TIMING1_TRELAX_SHIFT (4U) -/*! TRELAX - CSB, PGENB and LOAD to STROBE setup and hold time */ -#define OTPC_TIMING1_TRELAX(x) (((uint32_t)(((uint32_t)(x)) << OTPC_TIMING1_TRELAX_SHIFT)) & OTPC_TIMING1_TRELAX_MASK) - -#define OTPC_TIMING1_TRD_MASK (0x3F00U) -#define OTPC_TIMING1_TRD_SHIFT (8U) -/*! TRD - Read strobe pulse width time */ -#define OTPC_TIMING1_TRD(x) (((uint32_t)(((uint32_t)(x)) << OTPC_TIMING1_TRD_SHIFT)) & OTPC_TIMING1_TRD_MASK) - -#define OTPC_TIMING1_TPS_MASK (0x3F0000U) -#define OTPC_TIMING1_TPS_SHIFT (16U) -/*! TPS - PS to CSB setup and hold time between power switch and chip select assertion */ -#define OTPC_TIMING1_TPS(x) (((uint32_t)(((uint32_t)(x)) << OTPC_TIMING1_TPS_SHIFT)) & OTPC_TIMING1_TPS_MASK) - -#define OTPC_TIMING1_TPD_MASK (0xFF000000U) -#define OTPC_TIMING1_TPD_SHIFT (24U) -/*! TPD - PD to CSB setup time between power down signal deassertion and chip select signal assertion */ -#define OTPC_TIMING1_TPD(x) (((uint32_t)(((uint32_t)(x)) << OTPC_TIMING1_TPD_SHIFT)) & OTPC_TIMING1_TPD_MASK) -/*! @} */ - -/*! @name TIMING2 - Timing2 */ -/*! @{ */ - -#define OTPC_TIMING2_TPGM_MASK (0xFFFU) -#define OTPC_TIMING2_TPGM_SHIFT (0U) -/*! TPGM - Typical program strobe pulse width time */ -#define OTPC_TIMING2_TPGM(x) (((uint32_t)(((uint32_t)(x)) << OTPC_TIMING2_TPGM_SHIFT)) & OTPC_TIMING2_TPGM_MASK) -/*! @} */ - -/*! @name LOCK - Lock */ -/*! @{ */ - -#define OTPC_LOCK_NXP_PART_CFG_LOCK_MASK (0x7U) -#define OTPC_LOCK_NXP_PART_CFG_LOCK_SHIFT (0U) -/*! NXP_PART_CFG_LOCK - NXP Part Config Lock */ -#define OTPC_LOCK_NXP_PART_CFG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << OTPC_LOCK_NXP_PART_CFG_LOCK_SHIFT)) & OTPC_LOCK_NXP_PART_CFG_LOCK_MASK) - -#define OTPC_LOCK_NXP_EXT_LOCK_MASK (0x38U) -#define OTPC_LOCK_NXP_EXT_LOCK_SHIFT (3U) -/*! NXP_EXT_LOCK - NXP EXT Lock */ -#define OTPC_LOCK_NXP_EXT_LOCK(x) (((uint32_t)(((uint32_t)(x)) << OTPC_LOCK_NXP_EXT_LOCK_SHIFT)) & OTPC_LOCK_NXP_EXT_LOCK_MASK) - -#define OTPC_LOCK_BOOT_CFG_LOCK_MASK (0xE00U) -#define OTPC_LOCK_BOOT_CFG_LOCK_SHIFT (9U) -/*! BOOT_CFG_LOCK - Boot config Lock */ -#define OTPC_LOCK_BOOT_CFG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << OTPC_LOCK_BOOT_CFG_LOCK_SHIFT)) & OTPC_LOCK_BOOT_CFG_LOCK_MASK) - -#define OTPC_LOCK_PRINCE_CFG_LOCK_MASK (0x7000U) -#define OTPC_LOCK_PRINCE_CFG_LOCK_SHIFT (12U) -/*! PRINCE_CFG_LOCK - Prince Config Lock */ -#define OTPC_LOCK_PRINCE_CFG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << OTPC_LOCK_PRINCE_CFG_LOCK_SHIFT)) & OTPC_LOCK_PRINCE_CFG_LOCK_MASK) - -#define OTPC_LOCK_OSCAA_KEY_LOCK_MASK (0x38000U) -#define OTPC_LOCK_OSCAA_KEY_LOCK_SHIFT (15U) -/*! OSCAA_KEY_LOCK - OSCAA Key Lock */ -#define OTPC_LOCK_OSCAA_KEY_LOCK(x) (((uint32_t)(((uint32_t)(x)) << OTPC_LOCK_OSCAA_KEY_LOCK_SHIFT)) & OTPC_LOCK_OSCAA_KEY_LOCK_MASK) - -#define OTPC_LOCK_CUST_LOCK0_MASK (0x1C0000U) -#define OTPC_LOCK_CUST_LOCK0_SHIFT (18U) -/*! CUST_LOCK0 - CUST Lock 0 */ -#define OTPC_LOCK_CUST_LOCK0(x) (((uint32_t)(((uint32_t)(x)) << OTPC_LOCK_CUST_LOCK0_SHIFT)) & OTPC_LOCK_CUST_LOCK0_MASK) - -#define OTPC_LOCK_CUST_LOCK1_MASK (0xE00000U) -#define OTPC_LOCK_CUST_LOCK1_SHIFT (21U) -/*! CUST_LOCK1 - CUST Lock 1 */ -#define OTPC_LOCK_CUST_LOCK1(x) (((uint32_t)(((uint32_t)(x)) << OTPC_LOCK_CUST_LOCK1_SHIFT)) & OTPC_LOCK_CUST_LOCK1_MASK) - -#define OTPC_LOCK_CUST_LOCK2_MASK (0x7000000U) -#define OTPC_LOCK_CUST_LOCK2_SHIFT (24U) -/*! CUST_LOCK2 - CUST Lock 2 */ -#define OTPC_LOCK_CUST_LOCK2(x) (((uint32_t)(((uint32_t)(x)) << OTPC_LOCK_CUST_LOCK2_SHIFT)) & OTPC_LOCK_CUST_LOCK2_MASK) - -#define OTPC_LOCK_CUST_LOCK3_MASK (0x38000000U) -#define OTPC_LOCK_CUST_LOCK3_SHIFT (27U) -/*! CUST_LOCK3 - CUST Lock 3 */ -#define OTPC_LOCK_CUST_LOCK3(x) (((uint32_t)(((uint32_t)(x)) << OTPC_LOCK_CUST_LOCK3_SHIFT)) & OTPC_LOCK_CUST_LOCK3_MASK) -/*! @} */ - -/*! @name SECURE - Secure */ -/*! @{ */ - -#define OTPC_SECURE_DAT_MASK (0xFFFFFFFFU) -#define OTPC_SECURE_DAT_SHIFT (0U) -/*! DAT - Data */ -#define OTPC_SECURE_DAT(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SECURE_DAT_SHIFT)) & OTPC_SECURE_DAT_MASK) -/*! @} */ - -/*! @name SECURE_INV - Inverted Secure */ -/*! @{ */ - -#define OTPC_SECURE_INV_DAT_MASK (0xFFFFFFFFU) -#define OTPC_SECURE_INV_DAT_SHIFT (0U) -/*! DAT - Data */ -#define OTPC_SECURE_INV_DAT(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SECURE_INV_DAT_SHIFT)) & OTPC_SECURE_INV_DAT_MASK) -/*! @} */ - -/*! @name DBG_KEY - Debug and Key */ -/*! @{ */ - -#define OTPC_DBG_KEY_DAT_MASK (0xFFFFFFFFU) -#define OTPC_DBG_KEY_DAT_SHIFT (0U) -/*! DAT - Data */ -#define OTPC_DBG_KEY_DAT(x) (((uint32_t)(((uint32_t)(x)) << OTPC_DBG_KEY_DAT_SHIFT)) & OTPC_DBG_KEY_DAT_MASK) -/*! @} */ - -/*! @name MISC_CFG - MISC Config */ -/*! @{ */ - -#define OTPC_MISC_CFG_DAT_MASK (0xFFFFFFFFU) -#define OTPC_MISC_CFG_DAT_SHIFT (0U) -/*! DAT - Data */ -#define OTPC_MISC_CFG_DAT(x) (((uint32_t)(((uint32_t)(x)) << OTPC_MISC_CFG_DAT_SHIFT)) & OTPC_MISC_CFG_DAT_MASK) -/*! @} */ - -/*! @name PHANTOM_CFG - PHANTOM Config */ -/*! @{ */ - -#define OTPC_PHANTOM_CFG_DAT_MASK (0xFFFFFFFFU) -#define OTPC_PHANTOM_CFG_DAT_SHIFT (0U) -/*! DAT - Data */ -#define OTPC_PHANTOM_CFG_DAT(x) (((uint32_t)(((uint32_t)(x)) << OTPC_PHANTOM_CFG_DAT_SHIFT)) & OTPC_PHANTOM_CFG_DAT_MASK) -/*! @} */ - -/*! @name FLEX_CFG0 - Flexible Config 0 */ -/*! @{ */ - -#define OTPC_FLEX_CFG0_DAT_MASK (0xFFFFFFFFU) -#define OTPC_FLEX_CFG0_DAT_SHIFT (0U) -/*! DAT - Data */ -#define OTPC_FLEX_CFG0_DAT(x) (((uint32_t)(((uint32_t)(x)) << OTPC_FLEX_CFG0_DAT_SHIFT)) & OTPC_FLEX_CFG0_DAT_MASK) -/*! @} */ - -/*! @name FLEX_CFG1 - Flexible Config 1 */ -/*! @{ */ - -#define OTPC_FLEX_CFG1_DAT_MASK (0xFFFFFFFFU) -#define OTPC_FLEX_CFG1_DAT_SHIFT (0U) -/*! DAT - Data */ -#define OTPC_FLEX_CFG1_DAT(x) (((uint32_t)(((uint32_t)(x)) << OTPC_FLEX_CFG1_DAT_SHIFT)) & OTPC_FLEX_CFG1_DAT_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group OTPC_Register_Masks */ - - -/* OTPC - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral OTPC0 base address */ - #define OTPC0_BASE (0x500C9000u) - /** Peripheral OTPC0 base address */ - #define OTPC0_BASE_NS (0x400C9000u) - /** Peripheral OTPC0 base pointer */ - #define OTPC0 ((OTPC_Type *)OTPC0_BASE) - /** Peripheral OTPC0 base pointer */ - #define OTPC0_NS ((OTPC_Type *)OTPC0_BASE_NS) - /** Array initializer of OTPC peripheral base addresses */ - #define OTPC_BASE_ADDRS { OTPC0_BASE } - /** Array initializer of OTPC peripheral base pointers */ - #define OTPC_BASE_PTRS { OTPC0 } - /** Array initializer of OTPC peripheral base addresses */ - #define OTPC_BASE_ADDRS_NS { OTPC0_BASE_NS } - /** Array initializer of OTPC peripheral base pointers */ - #define OTPC_BASE_PTRS_NS { OTPC0_NS } -#else - /** Peripheral OTPC0 base address */ - #define OTPC0_BASE (0x400C9000u) - /** Peripheral OTPC0 base pointer */ - #define OTPC0 ((OTPC_Type *)OTPC0_BASE) - /** Array initializer of OTPC peripheral base addresses */ - #define OTPC_BASE_ADDRS { OTPC0_BASE } - /** Array initializer of OTPC peripheral base pointers */ - #define OTPC_BASE_PTRS { OTPC0 } -#endif - -/*! - * @} - */ /* end of group OTPC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- PDM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PDM_Peripheral_Access_Layer PDM Peripheral Access Layer - * @{ - */ - -/** PDM - Register Layout Typedef */ -typedef struct { - __IO uint32_t CTRL_1; /**< MICFIL Control 1, offset: 0x0 */ - __IO uint32_t CTRL_2; /**< MICFIL Control 2, offset: 0x4 */ - __IO uint32_t STAT; /**< MICFIL Status, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __IO uint32_t FIFO_CTRL; /**< MICFIL FIFO Control, offset: 0x10 */ - __IO uint32_t FIFO_STAT; /**< MICFIL FIFO Status, offset: 0x14 */ - uint8_t RESERVED_1[12]; - __I uint32_t DATACH[4]; /**< MICFIL Output Result, array offset: 0x24, array step: 0x4 */ - uint8_t RESERVED_2[48]; - __I uint32_t DC_CTRL; /**< MICFIL DC Remover Control, offset: 0x64 */ - __IO uint32_t DC_OUT_CTRL; /**< MICFIL Output DC Remover Control, offset: 0x68 */ - uint8_t RESERVED_3[8]; - __IO uint32_t RANGE_CTRL; /**< MICFIL Range Control, offset: 0x74 */ - uint8_t RESERVED_4[4]; - __IO uint32_t RANGE_STAT; /**< MICFIL Range Status, offset: 0x7C */ - __IO uint32_t FSYNC_CTRL; /**< Frame Synchronization Control, offset: 0x80 */ - __I uint32_t VERID; /**< Version ID, offset: 0x84 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x88 */ -} PDM_Type; - -/* ---------------------------------------------------------------------------- - -- PDM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PDM_Register_Masks PDM Register Masks - * @{ - */ - -/*! @name CTRL_1 - MICFIL Control 1 */ -/*! @{ */ - -#define PDM_CTRL_1_CH0EN_MASK (0x1U) -#define PDM_CTRL_1_CH0EN_SHIFT (0U) -/*! CH0EN - Channel 0 Enable */ -#define PDM_CTRL_1_CH0EN(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_CH0EN_SHIFT)) & PDM_CTRL_1_CH0EN_MASK) - -#define PDM_CTRL_1_CH1EN_MASK (0x2U) -#define PDM_CTRL_1_CH1EN_SHIFT (1U) -/*! CH1EN - Channel 1 Enable */ -#define PDM_CTRL_1_CH1EN(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_CH1EN_SHIFT)) & PDM_CTRL_1_CH1EN_MASK) - -#define PDM_CTRL_1_CH2EN_MASK (0x4U) -#define PDM_CTRL_1_CH2EN_SHIFT (2U) -/*! CH2EN - Channel 2 Enable */ -#define PDM_CTRL_1_CH2EN(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_CH2EN_SHIFT)) & PDM_CTRL_1_CH2EN_MASK) - -#define PDM_CTRL_1_CH3EN_MASK (0x8U) -#define PDM_CTRL_1_CH3EN_SHIFT (3U) -/*! CH3EN - Channel 3 Enable */ -#define PDM_CTRL_1_CH3EN(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_CH3EN_SHIFT)) & PDM_CTRL_1_CH3EN_MASK) - -#define PDM_CTRL_1_FSYNCEN_MASK (0x10000U) -#define PDM_CTRL_1_FSYNCEN_SHIFT (16U) -/*! FSYNCEN - Frame Synchronization Enable - * 0b0..Disables - * 0b1..Enables - */ -#define PDM_CTRL_1_FSYNCEN(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_FSYNCEN_SHIFT)) & PDM_CTRL_1_FSYNCEN_MASK) - -#define PDM_CTRL_1_DECFILS_MASK (0x100000U) -#define PDM_CTRL_1_DECFILS_SHIFT (20U) -/*! DECFILS - Decimation Filter Enable in Stop - * 0b0..Stops decimation filter - * 0b1..Keeps decimation filter running - */ -#define PDM_CTRL_1_DECFILS(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_DECFILS_SHIFT)) & PDM_CTRL_1_DECFILS_MASK) - -#define PDM_CTRL_1_ERREN_MASK (0x800000U) -#define PDM_CTRL_1_ERREN_SHIFT (23U) -/*! ERREN - Error Interruption Enable - * 0b0..Disables - * 0b1..Enables - */ -#define PDM_CTRL_1_ERREN(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_ERREN_SHIFT)) & PDM_CTRL_1_ERREN_MASK) - -#define PDM_CTRL_1_DISEL_MASK (0x3000000U) -#define PDM_CTRL_1_DISEL_SHIFT (24U) -/*! DISEL - DMA Interrupt Selection - * 0b00..Disables DMA and interrupt requests - * 0b01..Enables DMA requests - * 0b10..Enables interrupt requests - * 0b11..Reserved - */ -#define PDM_CTRL_1_DISEL(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_DISEL_SHIFT)) & PDM_CTRL_1_DISEL_MASK) - -#define PDM_CTRL_1_DBGE_MASK (0x4000000U) -#define PDM_CTRL_1_DBGE_SHIFT (26U) -/*! DBGE - Module Enable in Debug - * 0b0..Disables after completing the current frame - * 0b1..Enables operation - */ -#define PDM_CTRL_1_DBGE(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_DBGE_SHIFT)) & PDM_CTRL_1_DBGE_MASK) - -#define PDM_CTRL_1_SRES_MASK (0x8000000U) -#define PDM_CTRL_1_SRES_SHIFT (27U) -/*! SRES - Software Reset - * 0b0..No action - * 0b1..Software reset - */ -#define PDM_CTRL_1_SRES(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_SRES_SHIFT)) & PDM_CTRL_1_SRES_MASK) - -#define PDM_CTRL_1_DBG_MASK (0x10000000U) -#define PDM_CTRL_1_DBG_SHIFT (28U) -/*! DBG - Debug Mode - * 0b0..Normal - * 0b1..Debug - */ -#define PDM_CTRL_1_DBG(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_DBG_SHIFT)) & PDM_CTRL_1_DBG_MASK) - -#define PDM_CTRL_1_PDMIEN_MASK (0x20000000U) -#define PDM_CTRL_1_PDMIEN_SHIFT (29U) -/*! PDMIEN - MICFIL Enable - * 0b0..Stops MICFIL operation - * 0b1..Starts MICFIL operation - */ -#define PDM_CTRL_1_PDMIEN(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_PDMIEN_SHIFT)) & PDM_CTRL_1_PDMIEN_MASK) - -#define PDM_CTRL_1_DOZEN_MASK (0x40000000U) -#define PDM_CTRL_1_DOZEN_SHIFT (30U) -/*! DOZEN - Stop Enable - * 0b0..Disables - * 0b1..Enables - */ -#define PDM_CTRL_1_DOZEN(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_DOZEN_SHIFT)) & PDM_CTRL_1_DOZEN_MASK) - -#define PDM_CTRL_1_MDIS_MASK (0x80000000U) -#define PDM_CTRL_1_MDIS_SHIFT (31U) -/*! MDIS - Module Disable - * 0b0..Normal mode - * 0b1..DLL mode - */ -#define PDM_CTRL_1_MDIS(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_MDIS_SHIFT)) & PDM_CTRL_1_MDIS_MASK) -/*! @} */ - -/*! @name CTRL_2 - MICFIL Control 2 */ -/*! @{ */ - -#define PDM_CTRL_2_CLKDIV_MASK (0xFFU) -#define PDM_CTRL_2_CLKDIV_SHIFT (0U) -/*! CLKDIV - Clock Divider - * 0b00000000..Internal clock divider value = 0 - * 0b00000001..Internal clock divider value = 1 - * 0b00000010-0b11111110..... - * 0b11111111..Internal clock divider value = 255 - */ -#define PDM_CTRL_2_CLKDIV(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_2_CLKDIV_SHIFT)) & PDM_CTRL_2_CLKDIV_MASK) - -#define PDM_CTRL_2_CLKDIVDIS_MASK (0x8000U) -#define PDM_CTRL_2_CLKDIVDIS_SHIFT (15U) -/*! CLKDIVDIS - Clock Divider Disable - * 0b0..Enables - * 0b1..Disables - */ -#define PDM_CTRL_2_CLKDIVDIS(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_2_CLKDIVDIS_SHIFT)) & PDM_CTRL_2_CLKDIVDIS_MASK) - -#define PDM_CTRL_2_CICOSR_MASK (0xF0000U) -#define PDM_CTRL_2_CICOSR_SHIFT (16U) -/*! CICOSR - CIC Decimation Rate - * 0b0000..CIC oversampling rate = 0 - * 0b0001..CIC oversampling rate = 1 - * 0b0010-0b1110..... - * 0b1111..CIC oversampling rate = 15 - */ -#define PDM_CTRL_2_CICOSR(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_2_CICOSR_SHIFT)) & PDM_CTRL_2_CICOSR_MASK) - -#define PDM_CTRL_2_QSEL_MASK (0xE000000U) -#define PDM_CTRL_2_QSEL_SHIFT (25U) -/*! QSEL - Quality Mode - * 0b001..High-Quality mode - * 0b000..Medium-Quality mode - * 0b111..Low-Quality mode - * 0b110..Very-Low-Quality 0 mode - * 0b101..Very-Low-Quality 1 mode - * 0b100..Very-Low-Quality 2 mode - */ -#define PDM_CTRL_2_QSEL(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_2_QSEL_SHIFT)) & PDM_CTRL_2_QSEL_MASK) -/*! @} */ - -/*! @name STAT - MICFIL Status */ -/*! @{ */ - -#define PDM_STAT_CH0F_MASK (0x1U) -#define PDM_STAT_CH0F_SHIFT (0U) -/*! CH0F - Channel 0 Output Data Flag - * 0b0..Not surpassed - * 0b1..Surpassed - */ -#define PDM_STAT_CH0F(x) (((uint32_t)(((uint32_t)(x)) << PDM_STAT_CH0F_SHIFT)) & PDM_STAT_CH0F_MASK) - -#define PDM_STAT_CH1F_MASK (0x2U) -#define PDM_STAT_CH1F_SHIFT (1U) -/*! CH1F - Channel 1 Output Data Flag - * 0b0..Not surpassed - * 0b1..Surpassed - */ -#define PDM_STAT_CH1F(x) (((uint32_t)(((uint32_t)(x)) << PDM_STAT_CH1F_SHIFT)) & PDM_STAT_CH1F_MASK) - -#define PDM_STAT_CH2F_MASK (0x4U) -#define PDM_STAT_CH2F_SHIFT (2U) -/*! CH2F - Channel 2 Output Data Flag - * 0b0..Not surpassed - * 0b1..Surpassed - */ -#define PDM_STAT_CH2F(x) (((uint32_t)(((uint32_t)(x)) << PDM_STAT_CH2F_SHIFT)) & PDM_STAT_CH2F_MASK) - -#define PDM_STAT_CH3F_MASK (0x8U) -#define PDM_STAT_CH3F_SHIFT (3U) -/*! CH3F - Channel 3 Output Data Flag - * 0b0..Not surpassed - * 0b1..Surpassed - */ -#define PDM_STAT_CH3F(x) (((uint32_t)(((uint32_t)(x)) << PDM_STAT_CH3F_SHIFT)) & PDM_STAT_CH3F_MASK) - -#define PDM_STAT_BSY_FIL_MASK (0x80000000U) -#define PDM_STAT_BSY_FIL_SHIFT (31U) -/*! BSY_FIL - Busy Flag - * 0b1..MICFIL is running - * 0b0..MICFIL is stopped - */ -#define PDM_STAT_BSY_FIL(x) (((uint32_t)(((uint32_t)(x)) << PDM_STAT_BSY_FIL_SHIFT)) & PDM_STAT_BSY_FIL_MASK) -/*! @} */ - -/*! @name FIFO_CTRL - MICFIL FIFO Control */ -/*! @{ */ - -#define PDM_FIFO_CTRL_FIFOWMK_MASK (0xFU) -#define PDM_FIFO_CTRL_FIFOWMK_SHIFT (0U) -/*! FIFOWMK - FIFO Watermark Control */ -#define PDM_FIFO_CTRL_FIFOWMK(x) (((uint32_t)(((uint32_t)(x)) << PDM_FIFO_CTRL_FIFOWMK_SHIFT)) & PDM_FIFO_CTRL_FIFOWMK_MASK) -/*! @} */ - -/*! @name FIFO_STAT - MICFIL FIFO Status */ -/*! @{ */ - -#define PDM_FIFO_STAT_FIFOOVF0_MASK (0x1U) -#define PDM_FIFO_STAT_FIFOOVF0_SHIFT (0U) -/*! FIFOOVF0 - FIFO Overflow Exception Flag for Channel 0 - * 0b0..No exception by FIFO overflow - * 0b1..Exception by FIFO overflow - */ -#define PDM_FIFO_STAT_FIFOOVF0(x) (((uint32_t)(((uint32_t)(x)) << PDM_FIFO_STAT_FIFOOVF0_SHIFT)) & PDM_FIFO_STAT_FIFOOVF0_MASK) - -#define PDM_FIFO_STAT_FIFOOVF1_MASK (0x2U) -#define PDM_FIFO_STAT_FIFOOVF1_SHIFT (1U) -/*! FIFOOVF1 - FIFO Overflow Exception Flag for Channel 1 - * 0b0..No exception by FIFO overflow - * 0b1..Exception by FIFO overflow - */ -#define PDM_FIFO_STAT_FIFOOVF1(x) (((uint32_t)(((uint32_t)(x)) << PDM_FIFO_STAT_FIFOOVF1_SHIFT)) & PDM_FIFO_STAT_FIFOOVF1_MASK) - -#define PDM_FIFO_STAT_FIFOOVF2_MASK (0x4U) -#define PDM_FIFO_STAT_FIFOOVF2_SHIFT (2U) -/*! FIFOOVF2 - FIFO Overflow Exception Flag for Channel 2 - * 0b0..No exception by FIFO overflow - * 0b1..Exception by FIFO overflow - */ -#define PDM_FIFO_STAT_FIFOOVF2(x) (((uint32_t)(((uint32_t)(x)) << PDM_FIFO_STAT_FIFOOVF2_SHIFT)) & PDM_FIFO_STAT_FIFOOVF2_MASK) - -#define PDM_FIFO_STAT_FIFOOVF3_MASK (0x8U) -#define PDM_FIFO_STAT_FIFOOVF3_SHIFT (3U) -/*! FIFOOVF3 - FIFO Overflow Exception Flag for Channel 3 - * 0b0..No exception by FIFO overflow - * 0b1..Exception by FIFO overflow - */ -#define PDM_FIFO_STAT_FIFOOVF3(x) (((uint32_t)(((uint32_t)(x)) << PDM_FIFO_STAT_FIFOOVF3_SHIFT)) & PDM_FIFO_STAT_FIFOOVF3_MASK) - -#define PDM_FIFO_STAT_FIFOUND0_MASK (0x100U) -#define PDM_FIFO_STAT_FIFOUND0_SHIFT (8U) -/*! FIFOUND0 - FIFO Underflow Exception Flag for Channel 0 - * 0b0..No exception by FIFO underflow - * 0b1..Exception by FIFO underflow - */ -#define PDM_FIFO_STAT_FIFOUND0(x) (((uint32_t)(((uint32_t)(x)) << PDM_FIFO_STAT_FIFOUND0_SHIFT)) & PDM_FIFO_STAT_FIFOUND0_MASK) - -#define PDM_FIFO_STAT_FIFOUND1_MASK (0x200U) -#define PDM_FIFO_STAT_FIFOUND1_SHIFT (9U) -/*! FIFOUND1 - FIFO Underflow Exception Flag for Channel 1 - * 0b0..No exception by FIFO underflow - * 0b1..Exception by FIFO underflow - */ -#define PDM_FIFO_STAT_FIFOUND1(x) (((uint32_t)(((uint32_t)(x)) << PDM_FIFO_STAT_FIFOUND1_SHIFT)) & PDM_FIFO_STAT_FIFOUND1_MASK) - -#define PDM_FIFO_STAT_FIFOUND2_MASK (0x400U) -#define PDM_FIFO_STAT_FIFOUND2_SHIFT (10U) -/*! FIFOUND2 - FIFO Underflow Exception Flag for Channel 2 - * 0b0..No exception by FIFO underflow - * 0b1..Exception by FIFO underflow - */ -#define PDM_FIFO_STAT_FIFOUND2(x) (((uint32_t)(((uint32_t)(x)) << PDM_FIFO_STAT_FIFOUND2_SHIFT)) & PDM_FIFO_STAT_FIFOUND2_MASK) - -#define PDM_FIFO_STAT_FIFOUND3_MASK (0x800U) -#define PDM_FIFO_STAT_FIFOUND3_SHIFT (11U) -/*! FIFOUND3 - FIFO Underflow Exception Flag for Channel 3 - * 0b0..No exception by FIFO underflow - * 0b1..Exception by FIFO underflow - */ -#define PDM_FIFO_STAT_FIFOUND3(x) (((uint32_t)(((uint32_t)(x)) << PDM_FIFO_STAT_FIFOUND3_SHIFT)) & PDM_FIFO_STAT_FIFOUND3_MASK) -/*! @} */ - -/*! @name DATACHN_DATACH - MICFIL Output Result */ -/*! @{ */ - -#define PDM_DATACHN_DATACH_DATA_MASK (0xFFFFFFFFU) -#define PDM_DATACHN_DATACH_DATA_SHIFT (0U) -/*! DATA - Channel n Data */ -#define PDM_DATACHN_DATACH_DATA(x) (((uint32_t)(((uint32_t)(x)) << PDM_DATACHN_DATACH_DATA_SHIFT)) & PDM_DATACHN_DATACH_DATA_MASK) -/*! @} */ - -/* The count of PDM_DATACHN_DATACH */ -#define PDM_DATACHN_DATACH_COUNT (4U) - -/*! @name DC_CTRL - MICFIL DC Remover Control */ -/*! @{ */ - -#define PDM_DC_CTRL_DCCONFIG0_MASK (0x3U) -#define PDM_DC_CTRL_DCCONFIG0_SHIFT (0U) -/*! DCCONFIG0 - Channel 0 DC Remover Configuration - * 0b11..DC remover is bypassed - * 0b00..20 Hz (PDM_CLK = 3.072 MHz) - * 0b01..13.3 Hz (PDM_CLK = 3.072 MHz) - * 0b10..40 Hz (PDM_CLK = 3.072 MHz) - */ -#define PDM_DC_CTRL_DCCONFIG0(x) (((uint32_t)(((uint32_t)(x)) << PDM_DC_CTRL_DCCONFIG0_SHIFT)) & PDM_DC_CTRL_DCCONFIG0_MASK) - -#define PDM_DC_CTRL_DCCONFIG1_MASK (0xCU) -#define PDM_DC_CTRL_DCCONFIG1_SHIFT (2U) -/*! DCCONFIG1 - Channel 1 DC Remover Configuration - * 0b11..DC remover is bypassed - * 0b00..20 Hz (PDM_CLK = 3.072 MHz) - * 0b01..13.3 Hz (PDM_CLK = 3.072 MHz) - * 0b10..40 Hz (PDM_CLK = 3.072 MHz) - */ -#define PDM_DC_CTRL_DCCONFIG1(x) (((uint32_t)(((uint32_t)(x)) << PDM_DC_CTRL_DCCONFIG1_SHIFT)) & PDM_DC_CTRL_DCCONFIG1_MASK) - -#define PDM_DC_CTRL_DCCONFIG2_MASK (0x30U) -#define PDM_DC_CTRL_DCCONFIG2_SHIFT (4U) -/*! DCCONFIG2 - Channel 2 DC Remover Configuration - * 0b11..DC remover is bypassed - * 0b00..20 Hz (PDM_CLK = 3.072 MHz) - * 0b01..13.3 Hz (PDM_CLK = 3.072 MHz) - * 0b10..40 Hz (PDM_CLK = 3.072 MHz) - */ -#define PDM_DC_CTRL_DCCONFIG2(x) (((uint32_t)(((uint32_t)(x)) << PDM_DC_CTRL_DCCONFIG2_SHIFT)) & PDM_DC_CTRL_DCCONFIG2_MASK) - -#define PDM_DC_CTRL_DCCONFIG3_MASK (0xC0U) -#define PDM_DC_CTRL_DCCONFIG3_SHIFT (6U) -/*! DCCONFIG3 - Channel 3 DC Remover Configuration - * 0b11..DC remover is bypassed - * 0b00..20 Hz (PDM_CLK = 3.072 MHz) - * 0b01..13.3 Hz (PDM_CLK = 3.072 MHz) - * 0b10..40 Hz (PDM_CLK = 3.072 MHz) - */ -#define PDM_DC_CTRL_DCCONFIG3(x) (((uint32_t)(((uint32_t)(x)) << PDM_DC_CTRL_DCCONFIG3_SHIFT)) & PDM_DC_CTRL_DCCONFIG3_MASK) -/*! @} */ - -/*! @name DC_OUT_CTRL - MICFIL Output DC Remover Control */ -/*! @{ */ - -#define PDM_DC_OUT_CTRL_DCCONFIG0_MASK (0x3U) -#define PDM_DC_OUT_CTRL_DCCONFIG0_SHIFT (0U) -/*! DCCONFIG0 - Channel 0 DC Remover Configuration - * 0b11..DC remover is bypassed - * 0b00..20 Hz (FS = 48 kHz) - * 0b01..13.3 Hz (FS = 48 kHz) - * 0b10..40 Hz (FS = 48 kHz) - */ -#define PDM_DC_OUT_CTRL_DCCONFIG0(x) (((uint32_t)(((uint32_t)(x)) << PDM_DC_OUT_CTRL_DCCONFIG0_SHIFT)) & PDM_DC_OUT_CTRL_DCCONFIG0_MASK) - -#define PDM_DC_OUT_CTRL_DCCONFIG1_MASK (0xCU) -#define PDM_DC_OUT_CTRL_DCCONFIG1_SHIFT (2U) -/*! DCCONFIG1 - Channel 1 DC Remover Configuration - * 0b11..DC remover is bypassed - * 0b00..20 Hz (FS = 48 kHz) - * 0b01..13.3 Hz (FS = 48 kHz) - * 0b10..40 Hz (FS = 48 kHz) - */ -#define PDM_DC_OUT_CTRL_DCCONFIG1(x) (((uint32_t)(((uint32_t)(x)) << PDM_DC_OUT_CTRL_DCCONFIG1_SHIFT)) & PDM_DC_OUT_CTRL_DCCONFIG1_MASK) - -#define PDM_DC_OUT_CTRL_DCCONFIG2_MASK (0x30U) -#define PDM_DC_OUT_CTRL_DCCONFIG2_SHIFT (4U) -/*! DCCONFIG2 - Channel 2 DC Remover Configuration - * 0b11..DC remover is bypassed - * 0b00..20 Hz (FS = 48 kHz) - * 0b01..13.3 Hz (FS = 48 kHz) - * 0b10..40 Hz (FS = 48 kHz) - */ -#define PDM_DC_OUT_CTRL_DCCONFIG2(x) (((uint32_t)(((uint32_t)(x)) << PDM_DC_OUT_CTRL_DCCONFIG2_SHIFT)) & PDM_DC_OUT_CTRL_DCCONFIG2_MASK) - -#define PDM_DC_OUT_CTRL_DCCONFIG3_MASK (0xC0U) -#define PDM_DC_OUT_CTRL_DCCONFIG3_SHIFT (6U) -/*! DCCONFIG3 - Channel 3 DC Remover Configuration - * 0b11..DC remover is bypassed - * 0b00..20 Hz (FS = 48 kHz) - * 0b01..13.3 Hz (FS = 48 kHz) - * 0b10..40 Hz (FS = 48 kHz) - */ -#define PDM_DC_OUT_CTRL_DCCONFIG3(x) (((uint32_t)(((uint32_t)(x)) << PDM_DC_OUT_CTRL_DCCONFIG3_SHIFT)) & PDM_DC_OUT_CTRL_DCCONFIG3_MASK) -/*! @} */ - -/*! @name RANGE_CTRL - MICFIL Range Control */ -/*! @{ */ - -#define PDM_RANGE_CTRL_RANGEADJ0_MASK (0xFU) -#define PDM_RANGE_CTRL_RANGEADJ0_SHIFT (0U) -/*! RANGEADJ0 - Channel 0 Range Adjustment */ -#define PDM_RANGE_CTRL_RANGEADJ0(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_CTRL_RANGEADJ0_SHIFT)) & PDM_RANGE_CTRL_RANGEADJ0_MASK) - -#define PDM_RANGE_CTRL_RANGEADJ1_MASK (0xF0U) -#define PDM_RANGE_CTRL_RANGEADJ1_SHIFT (4U) -/*! RANGEADJ1 - Channel 1 Range Adjustment */ -#define PDM_RANGE_CTRL_RANGEADJ1(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_CTRL_RANGEADJ1_SHIFT)) & PDM_RANGE_CTRL_RANGEADJ1_MASK) - -#define PDM_RANGE_CTRL_RANGEADJ2_MASK (0xF00U) -#define PDM_RANGE_CTRL_RANGEADJ2_SHIFT (8U) -/*! RANGEADJ2 - Channel 2 Range Adjustment */ -#define PDM_RANGE_CTRL_RANGEADJ2(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_CTRL_RANGEADJ2_SHIFT)) & PDM_RANGE_CTRL_RANGEADJ2_MASK) - -#define PDM_RANGE_CTRL_RANGEADJ3_MASK (0xF000U) -#define PDM_RANGE_CTRL_RANGEADJ3_SHIFT (12U) -/*! RANGEADJ3 - Channel 3 Range Adjustment */ -#define PDM_RANGE_CTRL_RANGEADJ3(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_CTRL_RANGEADJ3_SHIFT)) & PDM_RANGE_CTRL_RANGEADJ3_MASK) -/*! @} */ - -/*! @name RANGE_STAT - MICFIL Range Status */ -/*! @{ */ - -#define PDM_RANGE_STAT_RANGEOVF0_MASK (0x1U) -#define PDM_RANGE_STAT_RANGEOVF0_SHIFT (0U) -/*! RANGEOVF0 - Channel 0 Range Overflow Error Flag - * 0b0..No exception by range overflow - * 0b1..Exception by range overflow - */ -#define PDM_RANGE_STAT_RANGEOVF0(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_STAT_RANGEOVF0_SHIFT)) & PDM_RANGE_STAT_RANGEOVF0_MASK) - -#define PDM_RANGE_STAT_RANGEOVF1_MASK (0x2U) -#define PDM_RANGE_STAT_RANGEOVF1_SHIFT (1U) -/*! RANGEOVF1 - Channel 1 Range Overflow Error Flag - * 0b0..No exception by range overflow - * 0b1..Exception by range overflow - */ -#define PDM_RANGE_STAT_RANGEOVF1(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_STAT_RANGEOVF1_SHIFT)) & PDM_RANGE_STAT_RANGEOVF1_MASK) - -#define PDM_RANGE_STAT_RANGEOVF2_MASK (0x4U) -#define PDM_RANGE_STAT_RANGEOVF2_SHIFT (2U) -/*! RANGEOVF2 - Channel 2 Range Overflow Error Flag - * 0b0..No exception by range overflow - * 0b1..Exception by range overflow - */ -#define PDM_RANGE_STAT_RANGEOVF2(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_STAT_RANGEOVF2_SHIFT)) & PDM_RANGE_STAT_RANGEOVF2_MASK) - -#define PDM_RANGE_STAT_RANGEOVF3_MASK (0x8U) -#define PDM_RANGE_STAT_RANGEOVF3_SHIFT (3U) -/*! RANGEOVF3 - Channel 3 Range Overflow Error Flag - * 0b0..No exception by range overflow - * 0b1..Exception by range overflow - */ -#define PDM_RANGE_STAT_RANGEOVF3(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_STAT_RANGEOVF3_SHIFT)) & PDM_RANGE_STAT_RANGEOVF3_MASK) - -#define PDM_RANGE_STAT_RANGEUNF0_MASK (0x10000U) -#define PDM_RANGE_STAT_RANGEUNF0_SHIFT (16U) -/*! RANGEUNF0 - Channel 0 Range Underflow Error Flag - * 0b0..No exception by range underflow - * 0b1..Exception by range underflow - */ -#define PDM_RANGE_STAT_RANGEUNF0(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_STAT_RANGEUNF0_SHIFT)) & PDM_RANGE_STAT_RANGEUNF0_MASK) - -#define PDM_RANGE_STAT_RANGEUNF1_MASK (0x20000U) -#define PDM_RANGE_STAT_RANGEUNF1_SHIFT (17U) -/*! RANGEUNF1 - Channel 1 Range Underflow Error Flag - * 0b0..No exception by range underflow - * 0b1..Exception by range underflow - */ -#define PDM_RANGE_STAT_RANGEUNF1(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_STAT_RANGEUNF1_SHIFT)) & PDM_RANGE_STAT_RANGEUNF1_MASK) - -#define PDM_RANGE_STAT_RANGEUNF2_MASK (0x40000U) -#define PDM_RANGE_STAT_RANGEUNF2_SHIFT (18U) -/*! RANGEUNF2 - Channel 2 Range Underflow Error Flag - * 0b0..No exception by range underflow - * 0b1..Exception by range underflow - */ -#define PDM_RANGE_STAT_RANGEUNF2(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_STAT_RANGEUNF2_SHIFT)) & PDM_RANGE_STAT_RANGEUNF2_MASK) - -#define PDM_RANGE_STAT_RANGEUNF3_MASK (0x80000U) -#define PDM_RANGE_STAT_RANGEUNF3_SHIFT (19U) -/*! RANGEUNF3 - Channel 3 Range Underflow Error Flag - * 0b0..No exception by range underflow - * 0b1..Exception by range underflow - */ -#define PDM_RANGE_STAT_RANGEUNF3(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_STAT_RANGEUNF3_SHIFT)) & PDM_RANGE_STAT_RANGEUNF3_MASK) -/*! @} */ - -/*! @name FSYNC_CTRL - Frame Synchronization Control */ -/*! @{ */ - -#define PDM_FSYNC_CTRL_FSYNCLEN_MASK (0xFFFFFFFFU) -#define PDM_FSYNC_CTRL_FSYNCLEN_SHIFT (0U) -/*! FSYNCLEN - Frame Synchronization Window Length */ -#define PDM_FSYNC_CTRL_FSYNCLEN(x) (((uint32_t)(((uint32_t)(x)) << PDM_FSYNC_CTRL_FSYNCLEN_SHIFT)) & PDM_FSYNC_CTRL_FSYNCLEN_MASK) -/*! @} */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define PDM_VERID_FEATURE_MASK (0xFFFFU) -#define PDM_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number */ -#define PDM_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << PDM_VERID_FEATURE_SHIFT)) & PDM_VERID_FEATURE_MASK) - -#define PDM_VERID_MINOR_MASK (0xFF0000U) -#define PDM_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define PDM_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << PDM_VERID_MINOR_SHIFT)) & PDM_VERID_MINOR_MASK) - -#define PDM_VERID_MAJOR_MASK (0xFF000000U) -#define PDM_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define PDM_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << PDM_VERID_MAJOR_SHIFT)) & PDM_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define PDM_PARAM_NPAIR_MASK (0xFU) -#define PDM_PARAM_NPAIR_SHIFT (0U) -/*! NPAIR - Number of Microphone Pairs - * 0b0000..None - * 0b0001..1 pair - * 0b0010..2 pairs - * 0b0011-0b1110..... - * 0b1111..15 pairs - */ -#define PDM_PARAM_NPAIR(x) (((uint32_t)(((uint32_t)(x)) << PDM_PARAM_NPAIR_SHIFT)) & PDM_PARAM_NPAIR_MASK) - -#define PDM_PARAM_FIFO_PTRWID_MASK (0xF0U) -#define PDM_PARAM_FIFO_PTRWID_SHIFT (4U) -/*! FIFO_PTRWID - FIFO Pointer Width - * 0b0000..0 bits - * 0b0001..1 bit - * 0b0010..2 bits - * 0b0011-0b1110..... - * 0b1111..15 bits - */ -#define PDM_PARAM_FIFO_PTRWID(x) (((uint32_t)(((uint32_t)(x)) << PDM_PARAM_FIFO_PTRWID_SHIFT)) & PDM_PARAM_FIFO_PTRWID_MASK) - -#define PDM_PARAM_FIL_OUT_WIDTH_24B_MASK (0x100U) -#define PDM_PARAM_FIL_OUT_WIDTH_24B_SHIFT (8U) -/*! FIL_OUT_WIDTH_24B - Filter Output Width - * 0b0..16 bits - * 0b1..24 bits - */ -#define PDM_PARAM_FIL_OUT_WIDTH_24B(x) (((uint32_t)(((uint32_t)(x)) << PDM_PARAM_FIL_OUT_WIDTH_24B_SHIFT)) & PDM_PARAM_FIL_OUT_WIDTH_24B_MASK) - -#define PDM_PARAM_LOW_POWER_MASK (0x200U) -#define PDM_PARAM_LOW_POWER_SHIFT (9U) -/*! LOW_POWER - Low-Power Decimation Filter - * 0b0..Disables - * 0b1..Enables - */ -#define PDM_PARAM_LOW_POWER(x) (((uint32_t)(((uint32_t)(x)) << PDM_PARAM_LOW_POWER_SHIFT)) & PDM_PARAM_LOW_POWER_MASK) - -#define PDM_PARAM_DC_BYPASS_MASK (0x400U) -#define PDM_PARAM_DC_BYPASS_SHIFT (10U) -/*! DC_BYPASS - Input DC Remover Bypass - * 0b0..Active - * 0b1..Disabled - */ -#define PDM_PARAM_DC_BYPASS(x) (((uint32_t)(((uint32_t)(x)) << PDM_PARAM_DC_BYPASS_SHIFT)) & PDM_PARAM_DC_BYPASS_MASK) - -#define PDM_PARAM_DC_OUT_BYPASS_MASK (0x800U) -#define PDM_PARAM_DC_OUT_BYPASS_SHIFT (11U) -/*! DC_OUT_BYPASS - Output DC Remover Bypass - * 0b0..Active - * 0b1..Disabled - */ -#define PDM_PARAM_DC_OUT_BYPASS(x) (((uint32_t)(((uint32_t)(x)) << PDM_PARAM_DC_OUT_BYPASS_SHIFT)) & PDM_PARAM_DC_OUT_BYPASS_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group PDM_Register_Masks */ - - -/* PDM - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral PDM base address */ - #define PDM_BASE (0x5010C000u) - /** Peripheral PDM base address */ - #define PDM_BASE_NS (0x4010C000u) - /** Peripheral PDM base pointer */ - #define PDM ((PDM_Type *)PDM_BASE) - /** Peripheral PDM base pointer */ - #define PDM_NS ((PDM_Type *)PDM_BASE_NS) - /** Array initializer of PDM peripheral base addresses */ - #define PDM_BASE_ADDRS { PDM_BASE } - /** Array initializer of PDM peripheral base pointers */ - #define PDM_BASE_PTRS { PDM } - /** Array initializer of PDM peripheral base addresses */ - #define PDM_BASE_ADDRS_NS { PDM_BASE_NS } - /** Array initializer of PDM peripheral base pointers */ - #define PDM_BASE_PTRS_NS { PDM_NS } -#else - /** Peripheral PDM base address */ - #define PDM_BASE (0x4010C000u) - /** Peripheral PDM base pointer */ - #define PDM ((PDM_Type *)PDM_BASE) - /** Array initializer of PDM peripheral base addresses */ - #define PDM_BASE_ADDRS { PDM_BASE } - /** Array initializer of PDM peripheral base pointers */ - #define PDM_BASE_PTRS { PDM } -#endif -/** Interrupt vectors for the PDM peripheral type */ -#define PDM_IRQS { PDM_EVENT_IRQn } - -/*! - * @} - */ /* end of group PDM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- PINT Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PINT_Peripheral_Access_Layer PINT Peripheral Access Layer - * @{ - */ - -/** PINT - Register Layout Typedef */ -typedef struct { - __IO uint32_t ISEL; /**< Pin Interrupt Mode, offset: 0x0 */ - __IO uint32_t IENR; /**< Pin Interrupt Level or Rising-Edge Interrupt Enable, offset: 0x4 */ - __O uint32_t SIENR; /**< Pin Interrupt Level or Rising-Edge Interrupt Set, offset: 0x8 */ - __IO uint32_t CIENR; /**< Pin Interrupt Level (Rising-Edge Interrupt) Clear, offset: 0xC */ - __IO uint32_t IENF; /**< Pin Interrupt Active Level or Falling-Edge Interrupt Enable, offset: 0x10 */ - __O uint32_t SIENF; /**< Pin Interrupt Active Level or Falling-Edge Interrupt Set, offset: 0x14 */ - __O uint32_t CIENF; /**< Pin Interrupt Active Level or Falling-Edge Interrupt Clear, offset: 0x18 */ - __IO uint32_t RISE; /**< Pin Interrupt Rising Edge, offset: 0x1C */ - __IO uint32_t FALL; /**< Pin Interrupt Falling Edge, offset: 0x20 */ - __IO uint32_t IST; /**< Pin Interrupt Status, offset: 0x24 */ - __IO uint32_t PMCTRL; /**< Pattern-Match Interrupt Control, offset: 0x28 */ - __IO uint32_t PMSRC; /**< Pattern-Match Interrupt Bit-Slice Source, offset: 0x2C */ - __IO uint32_t PMCFG; /**< Pattern-Match Interrupt Bit Slice Configuration, offset: 0x30 */ -} PINT_Type; - -/* ---------------------------------------------------------------------------- - -- PINT Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PINT_Register_Masks PINT Register Masks - * @{ - */ - -/*! @name ISEL - Pin Interrupt Mode */ -/*! @{ */ - -#define PINT_ISEL_PMODE_MASK (0xFFU) -#define PINT_ISEL_PMODE_SHIFT (0U) -/*! PMODE - Interrupt mode - * 0b00000000..In bit n configures the interrupt to be edge-sensitive - * 0b00000001..In bit n configures the interrupt to be level-sensitive - */ -#define PINT_ISEL_PMODE(x) (((uint32_t)(((uint32_t)(x)) << PINT_ISEL_PMODE_SHIFT)) & PINT_ISEL_PMODE_MASK) -/*! @} */ - -/*! @name IENR - Pin Interrupt Level or Rising-Edge Interrupt Enable */ -/*! @{ */ - -#define PINT_IENR_ENRL_MASK (0xFFU) -#define PINT_IENR_ENRL_SHIFT (0U) -/*! ENRL - Enables Interrupt - * 0b00000000..In bit n disables the corresponding interrupt - * 0b00000001..In bit n enables the corresponding interrupt - */ -#define PINT_IENR_ENRL(x) (((uint32_t)(((uint32_t)(x)) << PINT_IENR_ENRL_SHIFT)) & PINT_IENR_ENRL_MASK) -/*! @} */ - -/*! @name SIENR - Pin Interrupt Level or Rising-Edge Interrupt Set */ -/*! @{ */ - -#define PINT_SIENR_SETENRL_MASK (0xFFU) -#define PINT_SIENR_SETENRL_SHIFT (0U) -/*! SETENRL - Configures IENR - * 0b00000000..No operation for interrupt n - * 0b00000001..Enable rising edge or level interrupt for interrupt n - */ -#define PINT_SIENR_SETENRL(x) (((uint32_t)(((uint32_t)(x)) << PINT_SIENR_SETENRL_SHIFT)) & PINT_SIENR_SETENRL_MASK) -/*! @} */ - -/*! @name CIENR - Pin Interrupt Level (Rising-Edge Interrupt) Clear */ -/*! @{ */ - -#define PINT_CIENR_CENRL_MASK (0xFFU) -#define PINT_CIENR_CENRL_SHIFT (0U) -/*! CENRL - Clear bits in IENR - * 0b00000000..No operation - * 0b00000001..Disable rising edge or level interrupt - */ -#define PINT_CIENR_CENRL(x) (((uint32_t)(((uint32_t)(x)) << PINT_CIENR_CENRL_SHIFT)) & PINT_CIENR_CENRL_MASK) -/*! @} */ - -/*! @name IENF - Pin Interrupt Active Level or Falling-Edge Interrupt Enable */ -/*! @{ */ - -#define PINT_IENF_ENAF_MASK (0xFFU) -#define PINT_IENF_ENAF_SHIFT (0U) -/*! ENAF - Enables Interrupt - * 0b00000000..Disable (set active interrupt level LOW) - * 0b00000001..Enable (set active interrupt level HIGH) - */ -#define PINT_IENF_ENAF(x) (((uint32_t)(((uint32_t)(x)) << PINT_IENF_ENAF_SHIFT)) & PINT_IENF_ENAF_MASK) -/*! @} */ - -/*! @name SIENF - Pin Interrupt Active Level or Falling-Edge Interrupt Set */ -/*! @{ */ - -#define PINT_SIENF_SETENAF_MASK (0xFFU) -#define PINT_SIENF_SETENAF_SHIFT (0U) -/*! SETENAF - * 0b00000000..Writes 0 to IENF. - * 0b00000001..Select HIGH-active interrupt or enable falling-edge interrupt - */ -#define PINT_SIENF_SETENAF(x) (((uint32_t)(((uint32_t)(x)) << PINT_SIENF_SETENAF_SHIFT)) & PINT_SIENF_SETENAF_MASK) -/*! @} */ - -/*! @name CIENF - Pin Interrupt Active Level or Falling-Edge Interrupt Clear */ -/*! @{ */ - -#define PINT_CIENF_CENAF_MASK (0xFFU) -#define PINT_CIENF_CENAF_SHIFT (0U) -/*! CENAF - Writes 0 to IENF - * 0b00000000..No operation - * 0b00000001..LOW-active interrupt selected or falling-edge interrupt disabled - */ -#define PINT_CIENF_CENAF(x) (((uint32_t)(((uint32_t)(x)) << PINT_CIENF_CENAF_SHIFT)) & PINT_CIENF_CENAF_MASK) -/*! @} */ - -/*! @name RISE - Pin Interrupt Rising Edge */ -/*! @{ */ - -#define PINT_RISE_RDET_MASK (0xFFU) -#define PINT_RISE_RDET_SHIFT (0U) -/*! RDET - Rising-Edge Detect - * 0b00000000..Read 0- No rising edge (since Reset or you wrote a 1 to this field last time), Write 0- No operation - * 0b00000001..Read 1- Rising edge (since Reset or you wrote a 1 to this field last time), Write 1- Clear rising-edge detection for this pin - */ -#define PINT_RISE_RDET(x) (((uint32_t)(((uint32_t)(x)) << PINT_RISE_RDET_SHIFT)) & PINT_RISE_RDET_MASK) -/*! @} */ - -/*! @name FALL - Pin Interrupt Falling Edge */ -/*! @{ */ - -#define PINT_FALL_FDET_MASK (0xFFU) -#define PINT_FALL_FDET_SHIFT (0U) -/*! FDET - Falling-Edge Detect - * 0b00000000..Read 0- No falling edge (since Reset or you wrote a 1 to this field last time), Write 0- No operation - * 0b00000001..Read 1- Falling edge (since Reset or you wrote a 1 to this field last time), Write 1- Clear falling-edge detection for this bit - */ -#define PINT_FALL_FDET(x) (((uint32_t)(((uint32_t)(x)) << PINT_FALL_FDET_SHIFT)) & PINT_FALL_FDET_MASK) -/*! @} */ - -/*! @name IST - Pin Interrupt Status */ -/*! @{ */ - -#define PINT_IST_PSTAT_MASK (0xFFU) -#define PINT_IST_PSTAT_SHIFT (0U) -/*! PSTAT - Pin Interrupt Status - * 0b00000000..Read 0- Interrupt is not requested, Write 0- No operation - * 0b00000001..Read 1- Interrupt is requested, Write 1 (edge-sensitive)- clear rising- and falling-edge detection - * for this pin, Write 1 (level-sensitive)- switch the active level for this pin in - */ -#define PINT_IST_PSTAT(x) (((uint32_t)(((uint32_t)(x)) << PINT_IST_PSTAT_SHIFT)) & PINT_IST_PSTAT_MASK) -/*! @} */ - -/*! @name PMCTRL - Pattern-Match Interrupt Control */ -/*! @{ */ - -#define PINT_PMCTRL_SEL_PMATCH_MASK (0x1U) -#define PINT_PMCTRL_SEL_PMATCH_SHIFT (0U) -/*! SEL_PMATCH - Specifies whether the pin interrupts are controlled by the pin interrupt function - * or by the pattern-match function. If this value is 0b, interrupts are driven in response to the - * standard pin interrupt function. If this value is 1b, interrupts are driven in response to - * pattern matches. - * 0b0..Pin interrupt - * 0b1..Pattern match - */ -#define PINT_PMCTRL_SEL_PMATCH(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCTRL_SEL_PMATCH_SHIFT)) & PINT_PMCTRL_SEL_PMATCH_MASK) - -#define PINT_PMCTRL_ENA_RXEV_MASK (0x2U) -#define PINT_PMCTRL_ENA_RXEV_SHIFT (1U) -/*! ENA_RXEV - Enables the RXEV output to the CPU and/or to a GPIO output, when the specified - * Boolean expression evaluates to true. If this value is 0b, RXEV output to the CPU is disabled. If - * this value is 1b, RXEV output to the CPU is enabled. - * 0b0..Disabled - * 0b1..Enabled - */ -#define PINT_PMCTRL_ENA_RXEV(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCTRL_ENA_RXEV_SHIFT)) & PINT_PMCTRL_ENA_RXEV_MASK) - -#define PINT_PMCTRL_PMAT_MASK (0xFF000000U) -#define PINT_PMCTRL_PMAT_SHIFT (24U) -/*! PMAT - Pattern Matches - * 0b00000001..The corresponding product term is matched by the current state of the appropriate inputs - */ -#define PINT_PMCTRL_PMAT(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCTRL_PMAT_SHIFT)) & PINT_PMCTRL_PMAT_MASK) -/*! @} */ - -/*! @name PMSRC - Pattern-Match Interrupt Bit-Slice Source */ -/*! @{ */ - -#define PINT_PMSRC_SRC0_MASK (0x700U) -#define PINT_PMSRC_SRC0_SHIFT (8U) -/*! SRC0 - Selects the input source for bit slice 0 - * 0b000..Input 0 (selects the pin identified in PINSEL0) - * 0b001..Input 1 (selects the pin identified in PINSEL1) - * 0b010..Input 2 (selects the pin identified in PINSEL2) - * 0b011..Input 3 (selects the pin identified in PINSEL3) - * 0b100..Input 4 (selects the pin identified in PINSEL4) - * 0b101..Input 5 (selects the pin identified in PINSEL5) - * 0b110..Input 6 (selects the pin identified in PINSEL6) - * 0b111..Input 7 (selects the pin identified in PINSEL7) - */ -#define PINT_PMSRC_SRC0(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMSRC_SRC0_SHIFT)) & PINT_PMSRC_SRC0_MASK) - -#define PINT_PMSRC_SRC1_MASK (0x3800U) -#define PINT_PMSRC_SRC1_SHIFT (11U) -/*! SRC1 - Selects the input source for bit slice 1 - * 0b000..Input 0 (selects the pin identified in PINSEL0) - * 0b001..Input 1 (selects the pin identified in PINSEL1) - * 0b010..Input 2 (selects the pin identified in PINSEL2) - * 0b011..Input 3 (selects the pin identified in PINSEL3) - * 0b100..Input 4 (selects the pin identified in PINSEL4) - * 0b101..Input 5 (selects the pin identified in PINSEL5) - * 0b110..Input 6 (selects the pin identified in PINSEL6) - * 0b111..Input 7 (selects the pin identified in PINSEL7) - */ -#define PINT_PMSRC_SRC1(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMSRC_SRC1_SHIFT)) & PINT_PMSRC_SRC1_MASK) - -#define PINT_PMSRC_SRC2_MASK (0x1C000U) -#define PINT_PMSRC_SRC2_SHIFT (14U) -/*! SRC2 - Selects the input source for bit slice 2 - * 0b000..Input 0 (selects the pin identified in PINSEL0) - * 0b001..Input 1 (selects the pin identified in PINSEL1) - * 0b010..Input 2 (selects the pin identified in PINSEL2) - * 0b011..Input 3 (selects the pin identified in PINSEL3) - * 0b100..Input 4 (selects the pin identified in PINSEL4) - * 0b101..Input 5 (selects the pin identified in PINSEL5) - * 0b110..Input 6 (selects the pin identified in PINSEL6) - * 0b111..Input 7 (selects the pin identified in PINSEL7) - */ -#define PINT_PMSRC_SRC2(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMSRC_SRC2_SHIFT)) & PINT_PMSRC_SRC2_MASK) - -#define PINT_PMSRC_SRC3_MASK (0xE0000U) -#define PINT_PMSRC_SRC3_SHIFT (17U) -/*! SRC3 - Selects the input source for bit slice 3 - * 0b000..Input 0 (selects the pin identified in PINSEL0) - * 0b001..Input 1 (selects the pin identified in PINSEL1) - * 0b010..Input 2 (selects the pin identified in PINSEL2) - * 0b011..Input 3 (selects the pin identified in PINSEL3) - * 0b100..Input 4 (selects the pin identified in PINSEL4) - * 0b101..Input 5 (selects the pin identified in PINSEL5) - * 0b110..Input 6 (selects the pin identified in PINSEL6) - * 0b111..Input 7 (selects the pin identified in PINSEL7) - */ -#define PINT_PMSRC_SRC3(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMSRC_SRC3_SHIFT)) & PINT_PMSRC_SRC3_MASK) - -#define PINT_PMSRC_SRC4_MASK (0x700000U) -#define PINT_PMSRC_SRC4_SHIFT (20U) -/*! SRC4 - Selects the input source for bit slice 4 - * 0b000..Input 0 (selects the pin identified in PINSEL0) - * 0b001..Input 1 (selects the pin identified in PINSEL1) - * 0b010..Input 2 (selects the pin identified in PINSEL2) - * 0b011..Input 3 (selects the pin identified in PINSEL3) - * 0b100..Input 4 (selects the pin identified in PINSEL4) - * 0b101..Input 5 (selects the pin identified in PINSEL5) - * 0b110..Input 6 (selects the pin identified in PINSEL6) - * 0b111..Input 7 (selects the pin identified in PINSEL7) - */ -#define PINT_PMSRC_SRC4(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMSRC_SRC4_SHIFT)) & PINT_PMSRC_SRC4_MASK) - -#define PINT_PMSRC_SRC5_MASK (0x3800000U) -#define PINT_PMSRC_SRC5_SHIFT (23U) -/*! SRC5 - Selects the input source for bit slice 5 - * 0b000..Input 0 (selects the pin identified in PINSEL0) - * 0b001..Input 1 (selects the pin identified in PINSEL1) - * 0b010..Input 2 (selects the pin identified in PINSEL2) - * 0b011..Input 3 (selects the pin identified in PINSEL3) - * 0b100..Input 4 (selects the pin identified in PINSEL4) - * 0b101..Input 5 (selects the pin identified in PINSEL5) - * 0b110..Input 6 (selects the pin identified in PINSEL6) - * 0b111..Input 7 (selects the pin identified in PINSEL7) - */ -#define PINT_PMSRC_SRC5(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMSRC_SRC5_SHIFT)) & PINT_PMSRC_SRC5_MASK) - -#define PINT_PMSRC_SRC6_MASK (0x1C000000U) -#define PINT_PMSRC_SRC6_SHIFT (26U) -/*! SRC6 - Selects the input source for bit slice 6 - * 0b000..Input 0 (selects the pin identified in PINSEL0) - * 0b001..Input 1 (selects the pin identified in PINSEL1) - * 0b010..Input 2 (selects the pin identified in PINSEL2) - * 0b011..Input 3 (selects the pin identified in PINSEL3) - * 0b100..Input 4 (selects the pin identified in PINSEL4) - * 0b101..Input 5 (selects the pin identified in PINSEL5) - * 0b110..Input 6 (selects the pin identified in PINSEL6) - * 0b111..Input 7 (selects the pin identified in PINSEL7) - */ -#define PINT_PMSRC_SRC6(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMSRC_SRC6_SHIFT)) & PINT_PMSRC_SRC6_MASK) - -#define PINT_PMSRC_SRC7_MASK (0xE0000000U) -#define PINT_PMSRC_SRC7_SHIFT (29U) -/*! SRC7 - Selects the input source for bit slice 7 - * 0b000..Input 0 (selects the pin identified in PINSEL0) - * 0b001..Input 1 (selects the pin identified in PINSEL1) - * 0b010..Input 2 (selects the pin identified in PINSEL2) - * 0b011..Input 3 (selects the pin identified in PINSEL3) - * 0b100..Input 4 (selects the pin identified in PINSEL4) - * 0b101..Input 5 (selects the pin identified in PINSEL5) - * 0b110..Input 6 (selects the pin identified in PINSEL6) - * 0b111..Input 7 (selects the pin identified in PINSEL7) - */ -#define PINT_PMSRC_SRC7(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMSRC_SRC7_SHIFT)) & PINT_PMSRC_SRC7_MASK) -/*! @} */ - -/*! @name PMCFG - Pattern-Match Interrupt Bit Slice Configuration */ -/*! @{ */ - -#define PINT_PMCFG_PROD_ENDPTS0_MASK (0x1U) -#define PINT_PMCFG_PROD_ENDPTS0_SHIFT (0U) -/*! PROD_ENDPTS0 - Determines whether slice 0 is an endpoint. Slice 0 is not an endpoint. Slice 0 is - * the endpoint of a product term (minterm). Pin interrupt 0 in the NVIC is raised if the - * minterm evaluates as true. - * 0b0..No effect - * 0b1..Endpoint - */ -#define PINT_PMCFG_PROD_ENDPTS0(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_PROD_ENDPTS0_SHIFT)) & PINT_PMCFG_PROD_ENDPTS0_MASK) - -#define PINT_PMCFG_PROD_ENDPTS1_MASK (0x2U) -#define PINT_PMCFG_PROD_ENDPTS1_SHIFT (1U) -/*! PROD_ENDPTS1 - Determines whether slice 1 is an endpoint. Slice 1 is not an endpoint. Slice 1 is - * the endpoint of a product term (minterm). Pin interrupt 1 in the NVIC is raised if the - * minterm evaluates as true. - * 0b0..No effect - * 0b1..Endpoint - */ -#define PINT_PMCFG_PROD_ENDPTS1(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_PROD_ENDPTS1_SHIFT)) & PINT_PMCFG_PROD_ENDPTS1_MASK) - -#define PINT_PMCFG_PROD_ENDPTS2_MASK (0x4U) -#define PINT_PMCFG_PROD_ENDPTS2_SHIFT (2U) -/*! PROD_ENDPTS2 - Determines whether slice 2 is an endpoint. Slice 2 is not an endpoint. Slice 2 is - * the endpoint of a product term (minterm). Pin interrupt 2 in the NVIC is raised if the - * minterm evaluates as true. - * 0b0..No effect - * 0b1..Endpoint - */ -#define PINT_PMCFG_PROD_ENDPTS2(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_PROD_ENDPTS2_SHIFT)) & PINT_PMCFG_PROD_ENDPTS2_MASK) - -#define PINT_PMCFG_PROD_ENDPTS3_MASK (0x8U) -#define PINT_PMCFG_PROD_ENDPTS3_SHIFT (3U) -/*! PROD_ENDPTS3 - Determines whether slice 3 is an endpoint. Slice 3 is not an endpoint. Slice 3 is - * the endpoint of a product term (minterm). Pin interrupt 3 in the NVIC is raised if the - * minterm evaluates as true. - * 0b0..No effect - * 0b1..Endpoint - */ -#define PINT_PMCFG_PROD_ENDPTS3(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_PROD_ENDPTS3_SHIFT)) & PINT_PMCFG_PROD_ENDPTS3_MASK) - -#define PINT_PMCFG_PROD_ENDPTS4_MASK (0x10U) -#define PINT_PMCFG_PROD_ENDPTS4_SHIFT (4U) -/*! PROD_ENDPTS4 - Determines whether slice 4 is an endpoint. Slice 4 is not an endpoint. Slice 4 is - * the endpoint of a product term (minterm). Pin interrupt 4 in the NVIC is raised if the - * minterm evaluates as true. - * 0b0..No effect - * 0b1..Endpoint - */ -#define PINT_PMCFG_PROD_ENDPTS4(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_PROD_ENDPTS4_SHIFT)) & PINT_PMCFG_PROD_ENDPTS4_MASK) - -#define PINT_PMCFG_PROD_ENDPTS5_MASK (0x20U) -#define PINT_PMCFG_PROD_ENDPTS5_SHIFT (5U) -/*! PROD_ENDPTS5 - Determines whether slice 5 is an endpoint. Slice 5 is not an endpoint. Slice 5 is - * the endpoint of a product term (minterm). Pin interrupt 5 in the NVIC is raised if the - * minterm evaluates as true. - * 0b0..No effect - * 0b1..Endpoint - */ -#define PINT_PMCFG_PROD_ENDPTS5(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_PROD_ENDPTS5_SHIFT)) & PINT_PMCFG_PROD_ENDPTS5_MASK) - -#define PINT_PMCFG_PROD_ENDPTS6_MASK (0x40U) -#define PINT_PMCFG_PROD_ENDPTS6_SHIFT (6U) -/*! PROD_ENDPTS6 - Determines whether slice 6 is an endpoint. Slice 6 is not an endpoint. Slice 6 is - * the endpoint of a product term (minterm). Pin interrupt 6 in the NVIC is raised if the - * minterm evaluates as true. - * 0b0..No effect - * 0b1..Endpoint - */ -#define PINT_PMCFG_PROD_ENDPTS6(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_PROD_ENDPTS6_SHIFT)) & PINT_PMCFG_PROD_ENDPTS6_MASK) - -#define PINT_PMCFG_CFG0_MASK (0x700U) -#define PINT_PMCFG_CFG0_SHIFT (8U) -/*! CFG0 - Match Configuration - * 0b000..Constant HIGH - * 0b001..Sticky rising edge - * 0b010..Sticky falling edge - * 0b011..Sticky rising or falling edge - * 0b100..High level - * 0b101..Low level - * 0b110..Constant 0 - * 0b111..Event (Nonsticky rising or falling edge) - */ -#define PINT_PMCFG_CFG0(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_CFG0_SHIFT)) & PINT_PMCFG_CFG0_MASK) - -#define PINT_PMCFG_CFG1_MASK (0x3800U) -#define PINT_PMCFG_CFG1_SHIFT (11U) -/*! CFG1 - Match Configuration - * 0b000..Constant HIGH - * 0b001..Sticky rising edge - * 0b010..Sticky falling edge - * 0b011..Sticky rising or falling edge - * 0b100..High level - * 0b101..Low level - * 0b110..Constant 0 - * 0b111..Event (Nonsticky rising or falling edge) - */ -#define PINT_PMCFG_CFG1(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_CFG1_SHIFT)) & PINT_PMCFG_CFG1_MASK) - -#define PINT_PMCFG_CFG2_MASK (0x1C000U) -#define PINT_PMCFG_CFG2_SHIFT (14U) -/*! CFG2 - Match Configuration - * 0b000..Constant HIGH - * 0b001..Sticky rising edge - * 0b010..Sticky falling edge - * 0b011..Sticky rising or falling edge - * 0b100..High level - * 0b101..Low level - * 0b110..Constant 0 - * 0b111..Event (Nonsticky rising or falling edge) - */ -#define PINT_PMCFG_CFG2(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_CFG2_SHIFT)) & PINT_PMCFG_CFG2_MASK) - -#define PINT_PMCFG_CFG3_MASK (0xE0000U) -#define PINT_PMCFG_CFG3_SHIFT (17U) -/*! CFG3 - Match Configuration - * 0b000..Constant HIGH - * 0b001..Sticky rising edge - * 0b010..Sticky falling edge - * 0b011..Sticky rising or falling edge - * 0b100..High level - * 0b101..Low level - * 0b110..Constant 0 - * 0b111..Event (Nonsticky rising or falling edge) - */ -#define PINT_PMCFG_CFG3(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_CFG3_SHIFT)) & PINT_PMCFG_CFG3_MASK) - -#define PINT_PMCFG_CFG4_MASK (0x700000U) -#define PINT_PMCFG_CFG4_SHIFT (20U) -/*! CFG4 - Match Configuration - * 0b000..Constant HIGH - * 0b001..Sticky rising edge - * 0b010..Sticky falling edge - * 0b011..Sticky rising or falling edge - * 0b100..High level - * 0b101..Low level - * 0b110..Constant 0 - * 0b111..Event (Nonsticky rising or falling edge) - */ -#define PINT_PMCFG_CFG4(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_CFG4_SHIFT)) & PINT_PMCFG_CFG4_MASK) - -#define PINT_PMCFG_CFG5_MASK (0x3800000U) -#define PINT_PMCFG_CFG5_SHIFT (23U) -/*! CFG5 - Match Configuration - * 0b000..Constant HIGH - * 0b001..Sticky rising edge - * 0b010..Sticky falling edge - * 0b011..Sticky rising or falling edge - * 0b100..High level - * 0b101..Low level - * 0b110..Constant 0 - * 0b111..Event (Nonsticky rising or falling edge) - */ -#define PINT_PMCFG_CFG5(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_CFG5_SHIFT)) & PINT_PMCFG_CFG5_MASK) - -#define PINT_PMCFG_CFG6_MASK (0x1C000000U) -#define PINT_PMCFG_CFG6_SHIFT (26U) -/*! CFG6 - Match Configuration - * 0b000..Constant HIGH - * 0b001..Sticky rising edge - * 0b010..Sticky falling edge - * 0b011..Sticky rising or falling edge - * 0b100..High level - * 0b101..Low level - * 0b110..Constant 0 - * 0b111..Event (Nonsticky rising or falling edge) - */ -#define PINT_PMCFG_CFG6(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_CFG6_SHIFT)) & PINT_PMCFG_CFG6_MASK) - -#define PINT_PMCFG_CFG7_MASK (0xE0000000U) -#define PINT_PMCFG_CFG7_SHIFT (29U) -/*! CFG7 - Match Configuration - * 0b000..Constant HIGH - * 0b001..Sticky rising edge - * 0b010..Sticky falling edge - * 0b011..Sticky rising or falling edge - * 0b100..High level - * 0b101..Low level - * 0b110..Constant 0 - * 0b111..Event (Nonsticky rising or falling edge) - */ -#define PINT_PMCFG_CFG7(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_CFG7_SHIFT)) & PINT_PMCFG_CFG7_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group PINT_Register_Masks */ - - -/* PINT - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral PINT0 base address */ - #define PINT0_BASE (0x50004000u) - /** Peripheral PINT0 base address */ - #define PINT0_BASE_NS (0x40004000u) - /** Peripheral PINT0 base pointer */ - #define PINT0 ((PINT_Type *)PINT0_BASE) - /** Peripheral PINT0 base pointer */ - #define PINT0_NS ((PINT_Type *)PINT0_BASE_NS) - /** Array initializer of PINT peripheral base addresses */ - #define PINT_BASE_ADDRS { PINT0_BASE } - /** Array initializer of PINT peripheral base pointers */ - #define PINT_BASE_PTRS { PINT0 } - /** Array initializer of PINT peripheral base addresses */ - #define PINT_BASE_ADDRS_NS { PINT0_BASE_NS } - /** Array initializer of PINT peripheral base pointers */ - #define PINT_BASE_PTRS_NS { PINT0_NS } -#else - /** Peripheral PINT0 base address */ - #define PINT0_BASE (0x40004000u) - /** Peripheral PINT0 base pointer */ - #define PINT0 ((PINT_Type *)PINT0_BASE) - /** Array initializer of PINT peripheral base addresses */ - #define PINT_BASE_ADDRS { PINT0_BASE } - /** Array initializer of PINT peripheral base pointers */ - #define PINT_BASE_PTRS { PINT0 } -#endif -/** Interrupt vectors for the PINT peripheral type */ -#define PINT_IRQS { PINT0_IRQn } -/* Backward compatibility */ -#define PINT PINT0 - - -/*! - * @} - */ /* end of group PINT_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- PKC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PKC_Peripheral_Access_Layer PKC Peripheral Access Layer - * @{ - */ - -/** PKC - Register Layout Typedef */ -typedef struct { - __I uint32_t PKC_STATUS; /**< Status Register, offset: 0x0 */ - __IO uint32_t PKC_CTRL; /**< Control Register, offset: 0x4 */ - __IO uint32_t PKC_CFG; /**< Configuration register, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __IO uint32_t PKC_MODE1; /**< Mode register, parameter set 1, offset: 0x10 */ - __IO uint32_t PKC_XYPTR1; /**< X+Y pointer register, parameter set 1, offset: 0x14 */ - __IO uint32_t PKC_ZRPTR1; /**< Z+R pointer register, parameter set 1, offset: 0x18 */ - __IO uint32_t PKC_LEN1; /**< Length register, parameter set 1, offset: 0x1C */ - __IO uint32_t PKC_MODE2; /**< Mode register, parameter set 2, offset: 0x20 */ - __IO uint32_t PKC_XYPTR2; /**< X+Y pointer register, parameter set 2, offset: 0x24 */ - __IO uint32_t PKC_ZRPTR2; /**< Z+R pointer register, parameter set 2, offset: 0x28 */ - __IO uint32_t PKC_LEN2; /**< Length register, parameter set 2, offset: 0x2C */ - uint8_t RESERVED_1[16]; - __IO uint32_t PKC_UPTR; /**< Universal pointer FUP program, offset: 0x40 */ - __IO uint32_t PKC_UPTRT; /**< Universal pointer FUP table, offset: 0x44 */ - __IO uint32_t PKC_ULEN; /**< Universal pointer length, offset: 0x48 */ - uint8_t RESERVED_2[4]; - __IO uint32_t PKC_MCDATA; /**< MC pattern data interface, offset: 0x50 */ - uint8_t RESERVED_3[12]; - __I uint32_t PKC_VERSION; /**< PKC version register, offset: 0x60 */ - uint8_t RESERVED_4[3916]; - __O uint32_t PKC_SOFT_RST; /**< Software reset, offset: 0xFB0 */ - uint8_t RESERVED_5[12]; - __I uint32_t PKC_ACCESS_ERR; /**< Access Error, offset: 0xFC0 */ - __O uint32_t PKC_ACCESS_ERR_CLR; /**< Clear Access Error, offset: 0xFC4 */ - uint8_t RESERVED_6[16]; - __O uint32_t PKC_INT_CLR_ENABLE; /**< Interrupt enable clear, offset: 0xFD8 */ - __O uint32_t PKC_INT_SET_ENABLE; /**< Interrupt enable set, offset: 0xFDC */ - __I uint32_t PKC_INT_STATUS; /**< Interrupt status, offset: 0xFE0 */ - __I uint32_t PKC_INT_ENABLE; /**< Interrupt enable, offset: 0xFE4 */ - __O uint32_t PKC_INT_CLR_STATUS; /**< Interrupt status clear, offset: 0xFE8 */ - __O uint32_t PKC_INT_SET_STATUS; /**< Interrupt status set, offset: 0xFEC */ - uint8_t RESERVED_7[12]; - __I uint32_t PKC_MODULE_ID; /**< Module ID, offset: 0xFFC */ -} PKC_Type; - -/* ---------------------------------------------------------------------------- - -- PKC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PKC_Register_Masks PKC Register Masks - * @{ - */ - -/*! @name PKC_STATUS - Status Register */ -/*! @{ */ - -#define PKC_PKC_STATUS_ACTIV_MASK (0x1U) -#define PKC_PKC_STATUS_ACTIV_SHIFT (0U) -/*! ACTIV - PKC ACTIV */ -#define PKC_PKC_STATUS_ACTIV(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_STATUS_ACTIV_SHIFT)) & PKC_PKC_STATUS_ACTIV_MASK) - -#define PKC_PKC_STATUS_CARRY_MASK (0x2U) -#define PKC_PKC_STATUS_CARRY_SHIFT (1U) -/*! CARRY - Carry overflow flag */ -#define PKC_PKC_STATUS_CARRY(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_STATUS_CARRY_SHIFT)) & PKC_PKC_STATUS_CARRY_MASK) - -#define PKC_PKC_STATUS_ZERO_MASK (0x4U) -#define PKC_PKC_STATUS_ZERO_SHIFT (2U) -/*! ZERO - Zero result flag */ -#define PKC_PKC_STATUS_ZERO(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_STATUS_ZERO_SHIFT)) & PKC_PKC_STATUS_ZERO_MASK) - -#define PKC_PKC_STATUS_GOANY_MASK (0x8U) -#define PKC_PKC_STATUS_GOANY_SHIFT (3U) -/*! GOANY - Combined GO status flag */ -#define PKC_PKC_STATUS_GOANY(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_STATUS_GOANY_SHIFT)) & PKC_PKC_STATUS_GOANY_MASK) - -#define PKC_PKC_STATUS_LOCKED_MASK (0x60U) -#define PKC_PKC_STATUS_LOCKED_SHIFT (5U) -/*! LOCKED - Parameter set locked */ -#define PKC_PKC_STATUS_LOCKED(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_STATUS_LOCKED_SHIFT)) & PKC_PKC_STATUS_LOCKED_MASK) -/*! @} */ - -/*! @name PKC_CTRL - Control Register */ -/*! @{ */ - -#define PKC_PKC_CTRL_RESET_MASK (0x1U) -#define PKC_PKC_CTRL_RESET_SHIFT (0U) -/*! RESET - PKC reset control bit */ -#define PKC_PKC_CTRL_RESET(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_RESET_SHIFT)) & PKC_PKC_CTRL_RESET_MASK) - -#define PKC_PKC_CTRL_STOP_MASK (0x2U) -#define PKC_PKC_CTRL_STOP_SHIFT (1U) -/*! STOP - Freeze PKC calculation */ -#define PKC_PKC_CTRL_STOP(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_STOP_SHIFT)) & PKC_PKC_CTRL_STOP_MASK) - -#define PKC_PKC_CTRL_GOD1_MASK (0x4U) -#define PKC_PKC_CTRL_GOD1_SHIFT (2U) -/*! GOD1 - Control bit to start direct operation using parameter set 1 */ -#define PKC_PKC_CTRL_GOD1(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_GOD1_SHIFT)) & PKC_PKC_CTRL_GOD1_MASK) - -#define PKC_PKC_CTRL_GOD2_MASK (0x8U) -#define PKC_PKC_CTRL_GOD2_SHIFT (3U) -/*! GOD2 - Control bit to start direct operation using parameter set 2 */ -#define PKC_PKC_CTRL_GOD2(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_GOD2_SHIFT)) & PKC_PKC_CTRL_GOD2_MASK) - -#define PKC_PKC_CTRL_GOM1_MASK (0x10U) -#define PKC_PKC_CTRL_GOM1_SHIFT (4U) -/*! GOM1 - Control bit to start MC pattern using parameter set 1 */ -#define PKC_PKC_CTRL_GOM1(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_GOM1_SHIFT)) & PKC_PKC_CTRL_GOM1_MASK) - -#define PKC_PKC_CTRL_GOM2_MASK (0x20U) -#define PKC_PKC_CTRL_GOM2_SHIFT (5U) -/*! GOM2 - Control bit to start MC pattern using parameter set 2 */ -#define PKC_PKC_CTRL_GOM2(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_GOM2_SHIFT)) & PKC_PKC_CTRL_GOM2_MASK) - -#define PKC_PKC_CTRL_GOU_MASK (0x40U) -#define PKC_PKC_CTRL_GOU_SHIFT (6U) -/*! GOU - Control bit to start pipe operation */ -#define PKC_PKC_CTRL_GOU(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_GOU_SHIFT)) & PKC_PKC_CTRL_GOU_MASK) - -#define PKC_PKC_CTRL_GF2CONV_MASK (0x80U) -#define PKC_PKC_CTRL_GF2CONV_SHIFT (7U) -/*! GF2CONV - Convert to GF2 calculation modes */ -#define PKC_PKC_CTRL_GF2CONV(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_GF2CONV_SHIFT)) & PKC_PKC_CTRL_GF2CONV_MASK) - -#define PKC_PKC_CTRL_CLRCACHE_MASK (0x100U) -#define PKC_PKC_CTRL_CLRCACHE_SHIFT (8U) -/*! CLRCACHE - Clear universal pointer cache */ -#define PKC_PKC_CTRL_CLRCACHE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_CLRCACHE_SHIFT)) & PKC_PKC_CTRL_CLRCACHE_MASK) - -#define PKC_PKC_CTRL_CACHE_EN_MASK (0x200U) -#define PKC_PKC_CTRL_CACHE_EN_SHIFT (9U) -/*! CACHE_EN - Enable universal pointer cache */ -#define PKC_PKC_CTRL_CACHE_EN(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_CACHE_EN_SHIFT)) & PKC_PKC_CTRL_CACHE_EN_MASK) - -#define PKC_PKC_CTRL_REDMUL_MASK (0xC00U) -#define PKC_PKC_CTRL_REDMUL_SHIFT (10U) -/*! REDMUL - Reduced multiplier mode - * 0b00..full size mode, 3 least significant bits of pointer and length are ignored, minimum supported length 0x0008 - * 0b01..Reserved - Error Generated if selected - * 0b10..64-bit mode, 3 least significant bits of pointer and length are ignored, minimum supported length 0x0008 - * 0b11..Reserved - Error Generated if selected - */ -#define PKC_PKC_CTRL_REDMUL(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_REDMUL_SHIFT)) & PKC_PKC_CTRL_REDMUL_MASK) -/*! @} */ - -/*! @name PKC_CFG - Configuration register */ -/*! @{ */ - -#define PKC_PKC_CFG_IDLEOP_MASK (0x1U) -#define PKC_PKC_CFG_IDLEOP_SHIFT (0U) -#define PKC_PKC_CFG_IDLEOP(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CFG_IDLEOP_SHIFT)) & PKC_PKC_CFG_IDLEOP_MASK) - -#define PKC_PKC_CFG_RFU1_MASK (0x2U) -#define PKC_PKC_CFG_RFU1_SHIFT (1U) -#define PKC_PKC_CFG_RFU1(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CFG_RFU1_SHIFT)) & PKC_PKC_CFG_RFU1_MASK) - -#define PKC_PKC_CFG_RFU2_MASK (0x4U) -#define PKC_PKC_CFG_RFU2_SHIFT (2U) -#define PKC_PKC_CFG_RFU2(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CFG_RFU2_SHIFT)) & PKC_PKC_CFG_RFU2_MASK) - -#define PKC_PKC_CFG_CLKRND_MASK (0x8U) -#define PKC_PKC_CFG_CLKRND_SHIFT (3U) -#define PKC_PKC_CFG_CLKRND(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CFG_CLKRND_SHIFT)) & PKC_PKC_CFG_CLKRND_MASK) - -#define PKC_PKC_CFG_REDMULNOISE_MASK (0x10U) -#define PKC_PKC_CFG_REDMULNOISE_SHIFT (4U) -#define PKC_PKC_CFG_REDMULNOISE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CFG_REDMULNOISE_SHIFT)) & PKC_PKC_CFG_REDMULNOISE_MASK) - -#define PKC_PKC_CFG_RNDDLY_MASK (0xE0U) -#define PKC_PKC_CFG_RNDDLY_SHIFT (5U) -#define PKC_PKC_CFG_RNDDLY(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CFG_RNDDLY_SHIFT)) & PKC_PKC_CFG_RNDDLY_MASK) - -#define PKC_PKC_CFG_SBXNOISE_MASK (0x100U) -#define PKC_PKC_CFG_SBXNOISE_SHIFT (8U) -#define PKC_PKC_CFG_SBXNOISE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CFG_SBXNOISE_SHIFT)) & PKC_PKC_CFG_SBXNOISE_MASK) - -#define PKC_PKC_CFG_ALPNOISE_MASK (0x200U) -#define PKC_PKC_CFG_ALPNOISE_SHIFT (9U) -#define PKC_PKC_CFG_ALPNOISE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CFG_ALPNOISE_SHIFT)) & PKC_PKC_CFG_ALPNOISE_MASK) - -#define PKC_PKC_CFG_FMULNOISE_MASK (0x400U) -#define PKC_PKC_CFG_FMULNOISE_SHIFT (10U) -#define PKC_PKC_CFG_FMULNOISE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CFG_FMULNOISE_SHIFT)) & PKC_PKC_CFG_FMULNOISE_MASK) -/*! @} */ - -/*! @name PKC_MODE1 - Mode register, parameter set 1 */ -/*! @{ */ - -#define PKC_PKC_MODE1_MODE_MASK (0xFFU) -#define PKC_PKC_MODE1_MODE_SHIFT (0U) -/*! MODE - Calculation Mode / MC Start address */ -#define PKC_PKC_MODE1_MODE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_MODE1_MODE_SHIFT)) & PKC_PKC_MODE1_MODE_MASK) -/*! @} */ - -/*! @name PKC_XYPTR1 - X+Y pointer register, parameter set 1 */ -/*! @{ */ - -#define PKC_PKC_XYPTR1_XPTR_MASK (0xFFFFU) -#define PKC_PKC_XYPTR1_XPTR_SHIFT (0U) -/*! XPTR - Start address of X operand in PKCRAM with byte granularity */ -#define PKC_PKC_XYPTR1_XPTR(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_XYPTR1_XPTR_SHIFT)) & PKC_PKC_XYPTR1_XPTR_MASK) - -#define PKC_PKC_XYPTR1_YPTR_MASK (0xFFFF0000U) -#define PKC_PKC_XYPTR1_YPTR_SHIFT (16U) -/*! YPTR - Start address of Y operand in PKCRAM with byte granularity */ -#define PKC_PKC_XYPTR1_YPTR(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_XYPTR1_YPTR_SHIFT)) & PKC_PKC_XYPTR1_YPTR_MASK) -/*! @} */ - -/*! @name PKC_ZRPTR1 - Z+R pointer register, parameter set 1 */ -/*! @{ */ - -#define PKC_PKC_ZRPTR1_ZPTR_MASK (0xFFFFU) -#define PKC_PKC_ZRPTR1_ZPTR_SHIFT (0U) -/*! ZPTR - Start address of Z operand in PKCRAM with byte granularity or constant for calculation modes using CONST */ -#define PKC_PKC_ZRPTR1_ZPTR(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ZRPTR1_ZPTR_SHIFT)) & PKC_PKC_ZRPTR1_ZPTR_MASK) - -#define PKC_PKC_ZRPTR1_RPTR_MASK (0xFFFF0000U) -#define PKC_PKC_ZRPTR1_RPTR_SHIFT (16U) -/*! RPTR - Start address of R result in PKCRAM with byte granularity */ -#define PKC_PKC_ZRPTR1_RPTR(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ZRPTR1_RPTR_SHIFT)) & PKC_PKC_ZRPTR1_RPTR_MASK) -/*! @} */ - -/*! @name PKC_LEN1 - Length register, parameter set 1 */ -/*! @{ */ - -#define PKC_PKC_LEN1_LEN_MASK (0xFFFFU) -#define PKC_PKC_LEN1_LEN_SHIFT (0U) -/*! LEN - Operand length */ -#define PKC_PKC_LEN1_LEN(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_LEN1_LEN_SHIFT)) & PKC_PKC_LEN1_LEN_MASK) - -#define PKC_PKC_LEN1_MCLEN_MASK (0xFFFF0000U) -#define PKC_PKC_LEN1_MCLEN_SHIFT (16U) -/*! MCLEN - Loop counter for microcode pattern */ -#define PKC_PKC_LEN1_MCLEN(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_LEN1_MCLEN_SHIFT)) & PKC_PKC_LEN1_MCLEN_MASK) -/*! @} */ - -/*! @name PKC_MODE2 - Mode register, parameter set 2 */ -/*! @{ */ - -#define PKC_PKC_MODE2_MODE_MASK (0xFFU) -#define PKC_PKC_MODE2_MODE_SHIFT (0U) -/*! MODE - Calculation Mode / MC Start address */ -#define PKC_PKC_MODE2_MODE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_MODE2_MODE_SHIFT)) & PKC_PKC_MODE2_MODE_MASK) -/*! @} */ - -/*! @name PKC_XYPTR2 - X+Y pointer register, parameter set 2 */ -/*! @{ */ - -#define PKC_PKC_XYPTR2_XPTR_MASK (0xFFFFU) -#define PKC_PKC_XYPTR2_XPTR_SHIFT (0U) -/*! XPTR - Start address of X operand in PKCRAM with byte granularity */ -#define PKC_PKC_XYPTR2_XPTR(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_XYPTR2_XPTR_SHIFT)) & PKC_PKC_XYPTR2_XPTR_MASK) - -#define PKC_PKC_XYPTR2_YPTR_MASK (0xFFFF0000U) -#define PKC_PKC_XYPTR2_YPTR_SHIFT (16U) -/*! YPTR - Start address of Y operand in PKCRAM with byte granularity */ -#define PKC_PKC_XYPTR2_YPTR(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_XYPTR2_YPTR_SHIFT)) & PKC_PKC_XYPTR2_YPTR_MASK) -/*! @} */ - -/*! @name PKC_ZRPTR2 - Z+R pointer register, parameter set 2 */ -/*! @{ */ - -#define PKC_PKC_ZRPTR2_ZPT_MASK (0xFFFFU) -#define PKC_PKC_ZRPTR2_ZPT_SHIFT (0U) -/*! ZPT - Start address of Z operand in PKCRAM with byte granularity or constant for calculation modes using CONST */ -#define PKC_PKC_ZRPTR2_ZPT(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ZRPTR2_ZPT_SHIFT)) & PKC_PKC_ZRPTR2_ZPT_MASK) - -#define PKC_PKC_ZRPTR2_RPTR_MASK (0xFFFF0000U) -#define PKC_PKC_ZRPTR2_RPTR_SHIFT (16U) -/*! RPTR - Start address of R result in PKCRAM with byte granularity */ -#define PKC_PKC_ZRPTR2_RPTR(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ZRPTR2_RPTR_SHIFT)) & PKC_PKC_ZRPTR2_RPTR_MASK) -/*! @} */ - -/*! @name PKC_LEN2 - Length register, parameter set 2 */ -/*! @{ */ - -#define PKC_PKC_LEN2_LEN_MASK (0xFFFFU) -#define PKC_PKC_LEN2_LEN_SHIFT (0U) -/*! LEN - Operand length */ -#define PKC_PKC_LEN2_LEN(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_LEN2_LEN_SHIFT)) & PKC_PKC_LEN2_LEN_MASK) - -#define PKC_PKC_LEN2_MCLEN_MASK (0xFFFF0000U) -#define PKC_PKC_LEN2_MCLEN_SHIFT (16U) -/*! MCLEN - Loop counter for microcode pattern */ -#define PKC_PKC_LEN2_MCLEN(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_LEN2_MCLEN_SHIFT)) & PKC_PKC_LEN2_MCLEN_MASK) -/*! @} */ - -/*! @name PKC_UPTR - Universal pointer FUP program */ -/*! @{ */ - -#define PKC_PKC_UPTR_PTR_MASK (0xFFFFFFFFU) -#define PKC_PKC_UPTR_PTR_SHIFT (0U) -/*! PTR - Pointer to start address of PKC FUP program */ -#define PKC_PKC_UPTR_PTR(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_UPTR_PTR_SHIFT)) & PKC_PKC_UPTR_PTR_MASK) -/*! @} */ - -/*! @name PKC_UPTRT - Universal pointer FUP table */ -/*! @{ */ - -#define PKC_PKC_UPTRT_PTR_MASK (0xFFFFFFFFU) -#define PKC_PKC_UPTRT_PTR_SHIFT (0U) -/*! PTR - Pointer to start address of PKC FUP table */ -#define PKC_PKC_UPTRT_PTR(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_UPTRT_PTR_SHIFT)) & PKC_PKC_UPTRT_PTR_MASK) -/*! @} */ - -/*! @name PKC_ULEN - Universal pointer length */ -/*! @{ */ - -#define PKC_PKC_ULEN_LEN_MASK (0xFFU) -#define PKC_PKC_ULEN_LEN_SHIFT (0U) -/*! LEN - Length of universal pointer calculation */ -#define PKC_PKC_ULEN_LEN(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ULEN_LEN_SHIFT)) & PKC_PKC_ULEN_LEN_MASK) -/*! @} */ - -/*! @name PKC_MCDATA - MC pattern data interface */ -/*! @{ */ - -#define PKC_PKC_MCDATA_MCDATA_MASK (0xFFFFFFFFU) -#define PKC_PKC_MCDATA_MCDATA_SHIFT (0U) -/*! MCDATA - Microcode read/write data */ -#define PKC_PKC_MCDATA_MCDATA(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_MCDATA_MCDATA_SHIFT)) & PKC_PKC_MCDATA_MCDATA_MASK) -/*! @} */ - -/*! @name PKC_VERSION - PKC version register */ -/*! @{ */ - -#define PKC_PKC_VERSION_MULSIZE_MASK (0x3U) -#define PKC_PKC_VERSION_MULSIZE_SHIFT (0U) -/*! MULSIZE - * 0b01..32-bit multiplier - * 0b10..64-bit multiplier - * 0b11..128-bit multiplier - * 0b10..128-bit multiplier - * 0b01..64-bit multiplier - */ -#define PKC_PKC_VERSION_MULSIZE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_MULSIZE_SHIFT)) & PKC_PKC_VERSION_MULSIZE_MASK) - -#define PKC_PKC_VERSION_MCAVAIL_MASK (0x4U) -#define PKC_PKC_VERSION_MCAVAIL_SHIFT (2U) -#define PKC_PKC_VERSION_MCAVAIL(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_MCAVAIL_SHIFT)) & PKC_PKC_VERSION_MCAVAIL_MASK) - -#define PKC_PKC_VERSION_UPAVAIL_MASK (0x8U) -#define PKC_PKC_VERSION_UPAVAIL_SHIFT (3U) -#define PKC_PKC_VERSION_UPAVAIL(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_UPAVAIL_SHIFT)) & PKC_PKC_VERSION_UPAVAIL_MASK) - -#define PKC_PKC_VERSION_UPCACHEAVAIL_MASK (0x10U) -#define PKC_PKC_VERSION_UPCACHEAVAIL_SHIFT (4U) -#define PKC_PKC_VERSION_UPCACHEAVAIL(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_UPCACHEAVAIL_SHIFT)) & PKC_PKC_VERSION_UPCACHEAVAIL_MASK) - -#define PKC_PKC_VERSION_GF2AVAIL_MASK (0x20U) -#define PKC_PKC_VERSION_GF2AVAIL_SHIFT (5U) -#define PKC_PKC_VERSION_GF2AVAIL(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_GF2AVAIL_SHIFT)) & PKC_PKC_VERSION_GF2AVAIL_MASK) - -#define PKC_PKC_VERSION_PARAMNUM_MASK (0xC0U) -#define PKC_PKC_VERSION_PARAMNUM_SHIFT (6U) -#define PKC_PKC_VERSION_PARAMNUM(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_PARAMNUM_SHIFT)) & PKC_PKC_VERSION_PARAMNUM_MASK) - -#define PKC_PKC_VERSION_SBX0AVAIL_MASK (0x100U) -#define PKC_PKC_VERSION_SBX0AVAIL_SHIFT (8U) -#define PKC_PKC_VERSION_SBX0AVAIL(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_SBX0AVAIL_SHIFT)) & PKC_PKC_VERSION_SBX0AVAIL_MASK) - -#define PKC_PKC_VERSION_SBX1AVAIL_MASK (0x200U) -#define PKC_PKC_VERSION_SBX1AVAIL_SHIFT (9U) -#define PKC_PKC_VERSION_SBX1AVAIL(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_SBX1AVAIL_SHIFT)) & PKC_PKC_VERSION_SBX1AVAIL_MASK) - -#define PKC_PKC_VERSION_SBX2AVAIL_MASK (0x400U) -#define PKC_PKC_VERSION_SBX2AVAIL_SHIFT (10U) -#define PKC_PKC_VERSION_SBX2AVAIL(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_SBX2AVAIL_SHIFT)) & PKC_PKC_VERSION_SBX2AVAIL_MASK) - -#define PKC_PKC_VERSION_SBX3AVAIL_MASK (0x800U) -#define PKC_PKC_VERSION_SBX3AVAIL_SHIFT (11U) -#define PKC_PKC_VERSION_SBX3AVAIL(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_SBX3AVAIL_SHIFT)) & PKC_PKC_VERSION_SBX3AVAIL_MASK) - -#define PKC_PKC_VERSION_MCRECONF_SIZE_MASK (0xFF000U) -#define PKC_PKC_VERSION_MCRECONF_SIZE_SHIFT (12U) -#define PKC_PKC_VERSION_MCRECONF_SIZE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_MCRECONF_SIZE_SHIFT)) & PKC_PKC_VERSION_MCRECONF_SIZE_MASK) -/*! @} */ - -/*! @name PKC_SOFT_RST - Software reset */ -/*! @{ */ - -#define PKC_PKC_SOFT_RST_SOFT_RST_MASK (0x1U) -#define PKC_PKC_SOFT_RST_SOFT_RST_SHIFT (0U) -#define PKC_PKC_SOFT_RST_SOFT_RST(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_SOFT_RST_SOFT_RST_SHIFT)) & PKC_PKC_SOFT_RST_SOFT_RST_MASK) -/*! @} */ - -/*! @name PKC_ACCESS_ERR - Access Error */ -/*! @{ */ - -#define PKC_PKC_ACCESS_ERR_APB_NOTAV_MASK (0x1U) -#define PKC_PKC_ACCESS_ERR_APB_NOTAV_SHIFT (0U) -/*! APB_NOTAV - APB Error */ -#define PKC_PKC_ACCESS_ERR_APB_NOTAV(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ACCESS_ERR_APB_NOTAV_SHIFT)) & PKC_PKC_ACCESS_ERR_APB_NOTAV_MASK) - -#define PKC_PKC_ACCESS_ERR_APB_WRGMD_MASK (0x2U) -#define PKC_PKC_ACCESS_ERR_APB_WRGMD_SHIFT (1U) -/*! APB_WRGMD - APB Error */ -#define PKC_PKC_ACCESS_ERR_APB_WRGMD(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ACCESS_ERR_APB_WRGMD_SHIFT)) & PKC_PKC_ACCESS_ERR_APB_WRGMD_MASK) - -#define PKC_PKC_ACCESS_ERR_APB_MASTER_MASK (0xF0U) -#define PKC_PKC_ACCESS_ERR_APB_MASTER_SHIFT (4U) -#define PKC_PKC_ACCESS_ERR_APB_MASTER(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ACCESS_ERR_APB_MASTER_SHIFT)) & PKC_PKC_ACCESS_ERR_APB_MASTER_MASK) - -#define PKC_PKC_ACCESS_ERR_AHB_MASK (0x400U) -#define PKC_PKC_ACCESS_ERR_AHB_SHIFT (10U) -/*! AHB - AHB Error */ -#define PKC_PKC_ACCESS_ERR_AHB(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ACCESS_ERR_AHB_SHIFT)) & PKC_PKC_ACCESS_ERR_AHB_MASK) - -#define PKC_PKC_ACCESS_ERR_PKCC_MASK (0x10000U) -#define PKC_PKC_ACCESS_ERR_PKCC_SHIFT (16U) -#define PKC_PKC_ACCESS_ERR_PKCC(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ACCESS_ERR_PKCC_SHIFT)) & PKC_PKC_ACCESS_ERR_PKCC_MASK) - -#define PKC_PKC_ACCESS_ERR_FDET_MASK (0x20000U) -#define PKC_PKC_ACCESS_ERR_FDET_SHIFT (17U) -#define PKC_PKC_ACCESS_ERR_FDET(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ACCESS_ERR_FDET_SHIFT)) & PKC_PKC_ACCESS_ERR_FDET_MASK) - -#define PKC_PKC_ACCESS_ERR_CTRL_MASK (0x40000U) -#define PKC_PKC_ACCESS_ERR_CTRL_SHIFT (18U) -#define PKC_PKC_ACCESS_ERR_CTRL(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ACCESS_ERR_CTRL_SHIFT)) & PKC_PKC_ACCESS_ERR_CTRL_MASK) - -#define PKC_PKC_ACCESS_ERR_UCRC_MASK (0x80000U) -#define PKC_PKC_ACCESS_ERR_UCRC_SHIFT (19U) -#define PKC_PKC_ACCESS_ERR_UCRC(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ACCESS_ERR_UCRC_SHIFT)) & PKC_PKC_ACCESS_ERR_UCRC_MASK) -/*! @} */ - -/*! @name PKC_ACCESS_ERR_CLR - Clear Access Error */ -/*! @{ */ - -#define PKC_PKC_ACCESS_ERR_CLR_ERR_CLR_MASK (0x1U) -#define PKC_PKC_ACCESS_ERR_CLR_ERR_CLR_SHIFT (0U) -#define PKC_PKC_ACCESS_ERR_CLR_ERR_CLR(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ACCESS_ERR_CLR_ERR_CLR_SHIFT)) & PKC_PKC_ACCESS_ERR_CLR_ERR_CLR_MASK) -/*! @} */ - -/*! @name PKC_INT_CLR_ENABLE - Interrupt enable clear */ -/*! @{ */ - -#define PKC_PKC_INT_CLR_ENABLE_EN_PDONE_MASK (0x1U) -#define PKC_PKC_INT_CLR_ENABLE_EN_PDONE_SHIFT (0U) -#define PKC_PKC_INT_CLR_ENABLE_EN_PDONE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_INT_CLR_ENABLE_EN_PDONE_SHIFT)) & PKC_PKC_INT_CLR_ENABLE_EN_PDONE_MASK) -/*! @} */ - -/*! @name PKC_INT_SET_ENABLE - Interrupt enable set */ -/*! @{ */ - -#define PKC_PKC_INT_SET_ENABLE_EN_PDONE_MASK (0x1U) -#define PKC_PKC_INT_SET_ENABLE_EN_PDONE_SHIFT (0U) -#define PKC_PKC_INT_SET_ENABLE_EN_PDONE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_INT_SET_ENABLE_EN_PDONE_SHIFT)) & PKC_PKC_INT_SET_ENABLE_EN_PDONE_MASK) -/*! @} */ - -/*! @name PKC_INT_STATUS - Interrupt status */ -/*! @{ */ - -#define PKC_PKC_INT_STATUS_INT_PDONE_MASK (0x1U) -#define PKC_PKC_INT_STATUS_INT_PDONE_SHIFT (0U) -/*! INT_PDONE - End-of-computation status flag */ -#define PKC_PKC_INT_STATUS_INT_PDONE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_INT_STATUS_INT_PDONE_SHIFT)) & PKC_PKC_INT_STATUS_INT_PDONE_MASK) -/*! @} */ - -/*! @name PKC_INT_ENABLE - Interrupt enable */ -/*! @{ */ - -#define PKC_PKC_INT_ENABLE_EN_PDONE_MASK (0x1U) -#define PKC_PKC_INT_ENABLE_EN_PDONE_SHIFT (0U) -/*! EN_PDONE - PDONE interrupt enable flag */ -#define PKC_PKC_INT_ENABLE_EN_PDONE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_INT_ENABLE_EN_PDONE_SHIFT)) & PKC_PKC_INT_ENABLE_EN_PDONE_MASK) -/*! @} */ - -/*! @name PKC_INT_CLR_STATUS - Interrupt status clear */ -/*! @{ */ - -#define PKC_PKC_INT_CLR_STATUS_INT_PDONE_MASK (0x1U) -#define PKC_PKC_INT_CLR_STATUS_INT_PDONE_SHIFT (0U) -#define PKC_PKC_INT_CLR_STATUS_INT_PDONE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_INT_CLR_STATUS_INT_PDONE_SHIFT)) & PKC_PKC_INT_CLR_STATUS_INT_PDONE_MASK) -/*! @} */ - -/*! @name PKC_INT_SET_STATUS - Interrupt status set */ -/*! @{ */ - -#define PKC_PKC_INT_SET_STATUS_INT_PDONE_MASK (0x1U) -#define PKC_PKC_INT_SET_STATUS_INT_PDONE_SHIFT (0U) -#define PKC_PKC_INT_SET_STATUS_INT_PDONE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_INT_SET_STATUS_INT_PDONE_SHIFT)) & PKC_PKC_INT_SET_STATUS_INT_PDONE_MASK) -/*! @} */ - -/*! @name PKC_MODULE_ID - Module ID */ -/*! @{ */ - -#define PKC_PKC_MODULE_ID_SIZE_MASK (0xFFU) -#define PKC_PKC_MODULE_ID_SIZE_SHIFT (0U) -#define PKC_PKC_MODULE_ID_SIZE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_MODULE_ID_SIZE_SHIFT)) & PKC_PKC_MODULE_ID_SIZE_MASK) - -#define PKC_PKC_MODULE_ID_MINOR_REV_MASK (0xF00U) -#define PKC_PKC_MODULE_ID_MINOR_REV_SHIFT (8U) -#define PKC_PKC_MODULE_ID_MINOR_REV(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_MODULE_ID_MINOR_REV_SHIFT)) & PKC_PKC_MODULE_ID_MINOR_REV_MASK) - -#define PKC_PKC_MODULE_ID_MAJOR_REV_MASK (0xF000U) -#define PKC_PKC_MODULE_ID_MAJOR_REV_SHIFT (12U) -#define PKC_PKC_MODULE_ID_MAJOR_REV(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_MODULE_ID_MAJOR_REV_SHIFT)) & PKC_PKC_MODULE_ID_MAJOR_REV_MASK) - -#define PKC_PKC_MODULE_ID_ID_MASK (0xFFFF0000U) -#define PKC_PKC_MODULE_ID_ID_SHIFT (16U) -#define PKC_PKC_MODULE_ID_ID(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_MODULE_ID_ID_SHIFT)) & PKC_PKC_MODULE_ID_ID_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group PKC_Register_Masks */ - - -/* PKC - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral PKC0 base address */ - #define PKC0_BASE (0x5002B000u) - /** Peripheral PKC0 base address */ - #define PKC0_BASE_NS (0x4002B000u) - /** Peripheral PKC0 base pointer */ - #define PKC0 ((PKC_Type *)PKC0_BASE) - /** Peripheral PKC0 base pointer */ - #define PKC0_NS ((PKC_Type *)PKC0_BASE_NS) - /** Array initializer of PKC peripheral base addresses */ - #define PKC_BASE_ADDRS { PKC0_BASE } - /** Array initializer of PKC peripheral base pointers */ - #define PKC_BASE_PTRS { PKC0 } - /** Array initializer of PKC peripheral base addresses */ - #define PKC_BASE_ADDRS_NS { PKC0_BASE_NS } - /** Array initializer of PKC peripheral base pointers */ - #define PKC_BASE_PTRS_NS { PKC0_NS } -#else - /** Peripheral PKC0 base address */ - #define PKC0_BASE (0x4002B000u) - /** Peripheral PKC0 base pointer */ - #define PKC0 ((PKC_Type *)PKC0_BASE) - /** Array initializer of PKC peripheral base addresses */ - #define PKC_BASE_ADDRS { PKC0_BASE } - /** Array initializer of PKC peripheral base pointers */ - #define PKC_BASE_PTRS { PKC0 } -#endif - -/*! - * @} - */ /* end of group PKC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- PLU Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PLU_Peripheral_Access_Layer PLU Peripheral Access Layer - * @{ - */ - -/** PLU - Register Layout Typedef */ -typedef struct { - struct { /* offset: 0x0, array step: 0x20 */ - __IO uint32_t INP_MUX[5]; /**< Input select register for LUTn (0 to 25), Inputx (5 inputs), array offset: 0x0, array step: index*0x20, index2*0x4 */ - uint8_t RESERVED_0[12]; - } LUT[26]; - uint8_t RESERVED_0[1216]; - __IO uint32_t LUT_TRUTH[26]; /**< PLU LUT truth table, array offset: 0x800, array step: 0x4 */ - uint8_t RESERVED_1[152]; - __I uint32_t OUTPUTS; /**< PLU outputs, offset: 0x900 */ - __IO uint32_t WAKEINT_CTRL; /**< Wakeup interrupt control, offset: 0x904 */ - uint8_t RESERVED_2[760]; - __IO uint32_t OUTPUT_MUX[8]; /**< PLU output multiplexer, array offset: 0xC00, array step: 0x4 */ -} PLU_Type; - -/* ---------------------------------------------------------------------------- - -- PLU Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PLU_Register_Masks PLU Register Masks - * @{ - */ - -/*! @name LUT_INP_MUX - Input select register for LUTn (0 to 25), Inputx (5 inputs) */ -/*! @{ */ - -#define PLU_LUT_INP_MUX_LUTn_INPx_MASK (0x3FU) -#define PLU_LUT_INP_MUX_LUTn_INPx_SHIFT (0U) -/*! LUTn_INPx - Selects the input source to be connected to LUTn_INPx - * 0b000000..PLU primary inputs 0 - * 0b000001..PLU primary inputs 1 - * 0b000010..PLU primary inputs 2 - * 0b000011..PLU primary inputs 3 - * 0b000100..PLU primary inputs 4 - * 0b000101..PLU primary inputs 5 - * 0b000110..Output of LUT0 - * 0b000111..Output of LUT1 - * 0b001000..Output of LUT2 - * 0b001001..Output of LUT3 - * 0b001010..Output of LUT4 - * 0b001011..Output of LUT5 - * 0b001100..Output of LUT6 - * 0b001101..Output of LUT7 - * 0b001110..Output of LUT8 - * 0b001111..Output of LUT9 - * 0b010000..Output of LUT10 - * 0b010001..Output of LUT11 - * 0b010010..Output of LUT12 - * 0b010011..Output of LUT13 - * 0b010100..Output of LUT14 - * 0b010101..Output of LUT15 - * 0b010110..Output of LUT16 - * 0b010111..Output of LUT17 - * 0b011000..Output of LUT18 - * 0b011001..Output of LUT19 - * 0b011010..Output of LUT20 - * 0b011011..Output of LUT21 - * 0b011100..Output of LUT22 - * 0b011101..Output of LUT23 - * 0b011110..Output of LUT24 - * 0b011111..Output of LUT25 - * 0b100000..State[0] - * 0b100001..State[1] - * 0b100010..State[2] - * 0b100011..State[3] - */ -#define PLU_LUT_INP_MUX_LUTn_INPx(x) (((uint32_t)(((uint32_t)(x)) << PLU_LUT_INP_MUX_LUTn_INPx_SHIFT)) & PLU_LUT_INP_MUX_LUTn_INPx_MASK) -/*! @} */ - -/* The count of PLU_LUT_INP_MUX */ -#define PLU_LUT_INP_MUX_COUNT (26U) - -/* The count of PLU_LUT_INP_MUX */ -#define PLU_LUT_INP_MUX_COUNT2 (5U) - -/*! @name LUT_TRUTH - PLU LUT truth table */ -/*! @{ */ - -#define PLU_LUT_TRUTH_LUT_TRUTH_MASK (0xFFFFFFFFU) -#define PLU_LUT_TRUTH_LUT_TRUTH_SHIFT (0U) -/*! LUT_TRUTH - LUT truth table */ -#define PLU_LUT_TRUTH_LUT_TRUTH(x) (((uint32_t)(((uint32_t)(x)) << PLU_LUT_TRUTH_LUT_TRUTH_SHIFT)) & PLU_LUT_TRUTH_LUT_TRUTH_MASK) -/*! @} */ - -/* The count of PLU_LUT_TRUTH */ -#define PLU_LUT_TRUTH_COUNT (26U) - -/*! @name OUTPUTS - PLU outputs */ -/*! @{ */ - -#define PLU_OUTPUTS_OUTPUT_STATE_MASK (0xFFU) -#define PLU_OUTPUTS_OUTPUT_STATE_SHIFT (0U) -/*! OUTPUT_STATE - Output state */ -#define PLU_OUTPUTS_OUTPUT_STATE(x) (((uint32_t)(((uint32_t)(x)) << PLU_OUTPUTS_OUTPUT_STATE_SHIFT)) & PLU_OUTPUTS_OUTPUT_STATE_MASK) -/*! @} */ - -/*! @name WAKEINT_CTRL - Wakeup interrupt control */ -/*! @{ */ - -#define PLU_WAKEINT_CTRL_MASK_MASK (0xFFU) -#define PLU_WAKEINT_CTRL_MASK_SHIFT (0U) -/*! MASK - Interrupt mask */ -#define PLU_WAKEINT_CTRL_MASK(x) (((uint32_t)(((uint32_t)(x)) << PLU_WAKEINT_CTRL_MASK_SHIFT)) & PLU_WAKEINT_CTRL_MASK_MASK) - -#define PLU_WAKEINT_CTRL_FILTER_MODE_MASK (0x300U) -#define PLU_WAKEINT_CTRL_FILTER_MODE_SHIFT (8U) -/*! FILTER_MODE - Filter Mode - * 0b00..Bypass mode - * 0b01..Filter 1 clock period - * 0b10..Filter 2 clock period - * 0b11..Filter 3 clock period - */ -#define PLU_WAKEINT_CTRL_FILTER_MODE(x) (((uint32_t)(((uint32_t)(x)) << PLU_WAKEINT_CTRL_FILTER_MODE_SHIFT)) & PLU_WAKEINT_CTRL_FILTER_MODE_MASK) - -#define PLU_WAKEINT_CTRL_FILTER_CLKSEL_MASK (0xC00U) -#define PLU_WAKEINT_CTRL_FILTER_CLKSEL_SHIFT (10U) -/*! FILTER_CLKSEL - Filter clock select - * 0b00..Selects the 1 MHz low-power oscillator as the filter clock. - * 0b01..Selects the 12 MHz FRO as the filter clock. - * 0b10..Reserved - * 0b11..Reserved - */ -#define PLU_WAKEINT_CTRL_FILTER_CLKSEL(x) (((uint32_t)(((uint32_t)(x)) << PLU_WAKEINT_CTRL_FILTER_CLKSEL_SHIFT)) & PLU_WAKEINT_CTRL_FILTER_CLKSEL_MASK) - -#define PLU_WAKEINT_CTRL_LATCH_ENABLE_MASK (0x1000U) -#define PLU_WAKEINT_CTRL_LATCH_ENABLE_SHIFT (12U) -/*! LATCH_ENABLE - Latch the interrupt */ -#define PLU_WAKEINT_CTRL_LATCH_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << PLU_WAKEINT_CTRL_LATCH_ENABLE_SHIFT)) & PLU_WAKEINT_CTRL_LATCH_ENABLE_MASK) - -#define PLU_WAKEINT_CTRL_INTR_CLEAR_MASK (0x2000U) -#define PLU_WAKEINT_CTRL_INTR_CLEAR_SHIFT (13U) -/*! INTR_CLEAR - Write to clear wakeint_latched */ -#define PLU_WAKEINT_CTRL_INTR_CLEAR(x) (((uint32_t)(((uint32_t)(x)) << PLU_WAKEINT_CTRL_INTR_CLEAR_SHIFT)) & PLU_WAKEINT_CTRL_INTR_CLEAR_MASK) -/*! @} */ - -/*! @name OUTPUT_MUX - PLU output multiplexer */ -/*! @{ */ - -#define PLU_OUTPUT_MUX_OUTPUT_MASK (0x1FU) -#define PLU_OUTPUT_MUX_OUTPUT_SHIFT (0U) -/*! OUTPUT - Selects the source to be connected to PLU output n. - * 0b00000..LUT output 0 - * 0b00001..LUT output 1 - * 0b00010..LUT output 2 - * 0b00011..LUT output 3 - * 0b00100..LUT output 4 - * 0b00101..LUT output 5 - * 0b00110..LUT output 6 - * 0b00111..LUT output 7 - * 0b01000..LUT output 8 - * 0b01001..LUT output 9 - * 0b01010..LUT output 10 - * 0b01011..LUT output 11 - * 0b01100..LUT output 12 - * 0b01101..LUT output 13 - * 0b01110..LUT output 14 - * 0b01111..LUT output 15 - * 0b10000..LUT output 16 - * 0b10001..LUT output 17 - * 0b10010..LUT output 18 - * 0b10011..LUT output 19 - * 0b10100..LUT output 20 - * 0b10101..LUT output 21 - * 0b10110..LUT output 22 - * 0b10111..LUT output 23 - * 0b11000..LUT output 24 - * 0b11001..LUT output 25 - * 0b11010..State[0] - * 0b11011..State[1] - * 0b11100..State[2] - * 0b11101..State[3] - */ -#define PLU_OUTPUT_MUX_OUTPUT(x) (((uint32_t)(((uint32_t)(x)) << PLU_OUTPUT_MUX_OUTPUT_SHIFT)) & PLU_OUTPUT_MUX_OUTPUT_MASK) -/*! @} */ - -/* The count of PLU_OUTPUT_MUX */ -#define PLU_OUTPUT_MUX_COUNT (8U) - - -/*! - * @} - */ /* end of group PLU_Register_Masks */ - - -/* PLU - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral PLU0 base address */ - #define PLU0_BASE (0x50034000u) - /** Peripheral PLU0 base address */ - #define PLU0_BASE_NS (0x40034000u) - /** Peripheral PLU0 base pointer */ - #define PLU0 ((PLU_Type *)PLU0_BASE) - /** Peripheral PLU0 base pointer */ - #define PLU0_NS ((PLU_Type *)PLU0_BASE_NS) - /** Array initializer of PLU peripheral base addresses */ - #define PLU_BASE_ADDRS { PLU0_BASE } - /** Array initializer of PLU peripheral base pointers */ - #define PLU_BASE_PTRS { PLU0 } - /** Array initializer of PLU peripheral base addresses */ - #define PLU_BASE_ADDRS_NS { PLU0_BASE_NS } - /** Array initializer of PLU peripheral base pointers */ - #define PLU_BASE_PTRS_NS { PLU0_NS } -#else - /** Peripheral PLU0 base address */ - #define PLU0_BASE (0x40034000u) - /** Peripheral PLU0 base pointer */ - #define PLU0 ((PLU_Type *)PLU0_BASE) - /** Array initializer of PLU peripheral base addresses */ - #define PLU_BASE_ADDRS { PLU0_BASE } - /** Array initializer of PLU peripheral base pointers */ - #define PLU_BASE_PTRS { PLU0 } -#endif -/* Backward compatibility */ -#define PLU PLU0 - - -/*! - * @} - */ /* end of group PLU_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- PORT Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PORT_Peripheral_Access_Layer PORT Peripheral Access Layer - * @{ - */ - -/** PORT - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - uint8_t RESERVED_0[12]; - __O uint32_t GPCLR; /**< Global Pin Control Low, offset: 0x10 */ - __O uint32_t GPCHR; /**< Global Pin Control High, offset: 0x14 */ - uint8_t RESERVED_1[8]; - __IO uint32_t CONFIG; /**< Configuration, offset: 0x20 */ - uint8_t RESERVED_2[28]; - __I uint32_t EDFR; /**< EFT Detect Flag, offset: 0x40 */ - __IO uint32_t EDIER; /**< EFT Detect Interrupt Enable, offset: 0x44 */ - __IO uint32_t EDCR; /**< EFT Detect Clear, offset: 0x48 */ - uint8_t RESERVED_3[20]; - __IO uint32_t CALIB0; /**< Calibration 0, offset: 0x60, available only on: PORT0, PORT1, PORT2, PORT3 (missing on PORT4, PORT5) */ - __IO uint32_t CALIB1; /**< Calibration 1, offset: 0x64, available only on: PORT0, PORT1, PORT2, PORT3 (missing on PORT4, PORT5) */ - uint8_t RESERVED_4[24]; - __IO uint32_t PCR[32]; /**< Pin Control 0..Pin Control 31, array offset: 0x80, array step: 0x4, irregular array, not all indices are valid */ -} PORT_Type; - -/* ---------------------------------------------------------------------------- - -- PORT Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PORT_Register_Masks PORT Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define PORT_VERID_FEATURE_MASK (0xFFFFU) -#define PORT_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Basic implementation - */ -#define PORT_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << PORT_VERID_FEATURE_SHIFT)) & PORT_VERID_FEATURE_MASK) - -#define PORT_VERID_MINOR_MASK (0xFF0000U) -#define PORT_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define PORT_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << PORT_VERID_MINOR_SHIFT)) & PORT_VERID_MINOR_MASK) - -#define PORT_VERID_MAJOR_MASK (0xFF000000U) -#define PORT_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define PORT_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << PORT_VERID_MAJOR_SHIFT)) & PORT_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name GPCLR - Global Pin Control Low */ -/*! @{ */ - -#define PORT_GPCLR_GPWD_MASK (0xFFFFU) -#define PORT_GPCLR_GPWD_SHIFT (0U) -/*! GPWD - Global Pin Write Data */ -#define PORT_GPCLR_GPWD(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWD_SHIFT)) & PORT_GPCLR_GPWD_MASK) - -#define PORT_GPCLR_GPWE0_MASK (0x10000U) -#define PORT_GPCLR_GPWE0_SHIFT (16U) -/*! GPWE0 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE0(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE0_SHIFT)) & PORT_GPCLR_GPWE0_MASK) - -#define PORT_GPCLR_GPWE1_MASK (0x20000U) -#define PORT_GPCLR_GPWE1_SHIFT (17U) -/*! GPWE1 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE1(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE1_SHIFT)) & PORT_GPCLR_GPWE1_MASK) - -#define PORT_GPCLR_GPWE2_MASK (0x40000U) -#define PORT_GPCLR_GPWE2_SHIFT (18U) -/*! GPWE2 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE2(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE2_SHIFT)) & PORT_GPCLR_GPWE2_MASK) - -#define PORT_GPCLR_GPWE3_MASK (0x80000U) -#define PORT_GPCLR_GPWE3_SHIFT (19U) -/*! GPWE3 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE3(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE3_SHIFT)) & PORT_GPCLR_GPWE3_MASK) - -#define PORT_GPCLR_GPWE4_MASK (0x100000U) -#define PORT_GPCLR_GPWE4_SHIFT (20U) -/*! GPWE4 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE4(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE4_SHIFT)) & PORT_GPCLR_GPWE4_MASK) - -#define PORT_GPCLR_GPWE5_MASK (0x200000U) -#define PORT_GPCLR_GPWE5_SHIFT (21U) -/*! GPWE5 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE5(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE5_SHIFT)) & PORT_GPCLR_GPWE5_MASK) - -#define PORT_GPCLR_GPWE6_MASK (0x400000U) -#define PORT_GPCLR_GPWE6_SHIFT (22U) -/*! GPWE6 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE6(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE6_SHIFT)) & PORT_GPCLR_GPWE6_MASK) - -#define PORT_GPCLR_GPWE7_MASK (0x800000U) -#define PORT_GPCLR_GPWE7_SHIFT (23U) -/*! GPWE7 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE7(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE7_SHIFT)) & PORT_GPCLR_GPWE7_MASK) - -#define PORT_GPCLR_GPWE8_MASK (0x1000000U) -#define PORT_GPCLR_GPWE8_SHIFT (24U) -/*! GPWE8 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE8(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE8_SHIFT)) & PORT_GPCLR_GPWE8_MASK) - -#define PORT_GPCLR_GPWE9_MASK (0x2000000U) -#define PORT_GPCLR_GPWE9_SHIFT (25U) -/*! GPWE9 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE9(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE9_SHIFT)) & PORT_GPCLR_GPWE9_MASK) - -#define PORT_GPCLR_GPWE10_MASK (0x4000000U) -#define PORT_GPCLR_GPWE10_SHIFT (26U) -/*! GPWE10 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE10(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE10_SHIFT)) & PORT_GPCLR_GPWE10_MASK) - -#define PORT_GPCLR_GPWE11_MASK (0x8000000U) -#define PORT_GPCLR_GPWE11_SHIFT (27U) -/*! GPWE11 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE11(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE11_SHIFT)) & PORT_GPCLR_GPWE11_MASK) - -#define PORT_GPCLR_GPWE12_MASK (0x10000000U) -#define PORT_GPCLR_GPWE12_SHIFT (28U) -/*! GPWE12 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE12(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE12_SHIFT)) & PORT_GPCLR_GPWE12_MASK) - -#define PORT_GPCLR_GPWE13_MASK (0x20000000U) -#define PORT_GPCLR_GPWE13_SHIFT (29U) -/*! GPWE13 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE13(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE13_SHIFT)) & PORT_GPCLR_GPWE13_MASK) - -#define PORT_GPCLR_GPWE14_MASK (0x40000000U) -#define PORT_GPCLR_GPWE14_SHIFT (30U) -/*! GPWE14 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE14(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE14_SHIFT)) & PORT_GPCLR_GPWE14_MASK) - -#define PORT_GPCLR_GPWE15_MASK (0x80000000U) -#define PORT_GPCLR_GPWE15_SHIFT (31U) -/*! GPWE15 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE15(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE15_SHIFT)) & PORT_GPCLR_GPWE15_MASK) -/*! @} */ - -/*! @name GPCHR - Global Pin Control High */ -/*! @{ */ - -#define PORT_GPCHR_GPWD_MASK (0xFFFFU) -#define PORT_GPCHR_GPWD_SHIFT (0U) -/*! GPWD - Global Pin Write Data */ -#define PORT_GPCHR_GPWD(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWD_SHIFT)) & PORT_GPCHR_GPWD_MASK) - -#define PORT_GPCHR_GPWE16_MASK (0x10000U) -#define PORT_GPCHR_GPWE16_SHIFT (16U) -/*! GPWE16 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE16(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE16_SHIFT)) & PORT_GPCHR_GPWE16_MASK) - -#define PORT_GPCHR_GPWE17_MASK (0x20000U) -#define PORT_GPCHR_GPWE17_SHIFT (17U) -/*! GPWE17 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE17(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE17_SHIFT)) & PORT_GPCHR_GPWE17_MASK) - -#define PORT_GPCHR_GPWE18_MASK (0x40000U) -#define PORT_GPCHR_GPWE18_SHIFT (18U) -/*! GPWE18 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE18(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE18_SHIFT)) & PORT_GPCHR_GPWE18_MASK) - -#define PORT_GPCHR_GPWE19_MASK (0x80000U) -#define PORT_GPCHR_GPWE19_SHIFT (19U) -/*! GPWE19 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE19(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE19_SHIFT)) & PORT_GPCHR_GPWE19_MASK) - -#define PORT_GPCHR_GPWE20_MASK (0x100000U) -#define PORT_GPCHR_GPWE20_SHIFT (20U) -/*! GPWE20 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE20(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE20_SHIFT)) & PORT_GPCHR_GPWE20_MASK) - -#define PORT_GPCHR_GPWE21_MASK (0x200000U) -#define PORT_GPCHR_GPWE21_SHIFT (21U) -/*! GPWE21 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE21(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE21_SHIFT)) & PORT_GPCHR_GPWE21_MASK) - -#define PORT_GPCHR_GPWE22_MASK (0x400000U) -#define PORT_GPCHR_GPWE22_SHIFT (22U) -/*! GPWE22 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE22(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE22_SHIFT)) & PORT_GPCHR_GPWE22_MASK) - -#define PORT_GPCHR_GPWE23_MASK (0x800000U) -#define PORT_GPCHR_GPWE23_SHIFT (23U) -/*! GPWE23 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE23(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE23_SHIFT)) & PORT_GPCHR_GPWE23_MASK) - -#define PORT_GPCHR_GPWE24_MASK (0x1000000U) -#define PORT_GPCHR_GPWE24_SHIFT (24U) -/*! GPWE24 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE24(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE24_SHIFT)) & PORT_GPCHR_GPWE24_MASK) - -#define PORT_GPCHR_GPWE25_MASK (0x2000000U) -#define PORT_GPCHR_GPWE25_SHIFT (25U) -/*! GPWE25 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE25(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE25_SHIFT)) & PORT_GPCHR_GPWE25_MASK) - -#define PORT_GPCHR_GPWE26_MASK (0x4000000U) -#define PORT_GPCHR_GPWE26_SHIFT (26U) -/*! GPWE26 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE26(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE26_SHIFT)) & PORT_GPCHR_GPWE26_MASK) - -#define PORT_GPCHR_GPWE27_MASK (0x8000000U) -#define PORT_GPCHR_GPWE27_SHIFT (27U) -/*! GPWE27 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE27(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE27_SHIFT)) & PORT_GPCHR_GPWE27_MASK) - -#define PORT_GPCHR_GPWE28_MASK (0x10000000U) -#define PORT_GPCHR_GPWE28_SHIFT (28U) -/*! GPWE28 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE28(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE28_SHIFT)) & PORT_GPCHR_GPWE28_MASK) - -#define PORT_GPCHR_GPWE29_MASK (0x20000000U) -#define PORT_GPCHR_GPWE29_SHIFT (29U) -/*! GPWE29 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE29(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE29_SHIFT)) & PORT_GPCHR_GPWE29_MASK) - -#define PORT_GPCHR_GPWE30_MASK (0x40000000U) -#define PORT_GPCHR_GPWE30_SHIFT (30U) -/*! GPWE30 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE30(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE30_SHIFT)) & PORT_GPCHR_GPWE30_MASK) - -#define PORT_GPCHR_GPWE31_MASK (0x80000000U) -#define PORT_GPCHR_GPWE31_SHIFT (31U) -/*! GPWE31 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE31(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE31_SHIFT)) & PORT_GPCHR_GPWE31_MASK) -/*! @} */ - -/*! @name CONFIG - Configuration */ -/*! @{ */ - -#define PORT_CONFIG_RANGE_MASK (0x1U) -#define PORT_CONFIG_RANGE_SHIFT (0U) -/*! RANGE - Port Voltage Range - * 0b0..1.71 V-3.6 V - * 0b1..2.70 V-3.6 V - */ -#define PORT_CONFIG_RANGE(x) (((uint32_t)(((uint32_t)(x)) << PORT_CONFIG_RANGE_SHIFT)) & PORT_CONFIG_RANGE_MASK) -/*! @} */ - -/*! @name EDFR - EFT Detect Flag */ -/*! @{ */ - -#define PORT_EDFR_EDF0_MASK (0x1U) -#define PORT_EDFR_EDF0_SHIFT (0U) -/*! EDF0 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF0(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF0_SHIFT)) & PORT_EDFR_EDF0_MASK) - -#define PORT_EDFR_EDF1_MASK (0x2U) -#define PORT_EDFR_EDF1_SHIFT (1U) -/*! EDF1 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF1(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF1_SHIFT)) & PORT_EDFR_EDF1_MASK) - -#define PORT_EDFR_EDF2_MASK (0x4U) -#define PORT_EDFR_EDF2_SHIFT (2U) -/*! EDF2 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF2(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF2_SHIFT)) & PORT_EDFR_EDF2_MASK) - -#define PORT_EDFR_EDF3_MASK (0x8U) -#define PORT_EDFR_EDF3_SHIFT (3U) -/*! EDF3 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF3(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF3_SHIFT)) & PORT_EDFR_EDF3_MASK) - -#define PORT_EDFR_EDF4_MASK (0x10U) -#define PORT_EDFR_EDF4_SHIFT (4U) -/*! EDF4 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF4(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF4_SHIFT)) & PORT_EDFR_EDF4_MASK) - -#define PORT_EDFR_EDF5_MASK (0x20U) -#define PORT_EDFR_EDF5_SHIFT (5U) -/*! EDF5 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF5(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF5_SHIFT)) & PORT_EDFR_EDF5_MASK) - -#define PORT_EDFR_EDF6_MASK (0x40U) -#define PORT_EDFR_EDF6_SHIFT (6U) -/*! EDF6 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF6(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF6_SHIFT)) & PORT_EDFR_EDF6_MASK) - -#define PORT_EDFR_EDF7_MASK (0x80U) -#define PORT_EDFR_EDF7_SHIFT (7U) -/*! EDF7 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF7(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF7_SHIFT)) & PORT_EDFR_EDF7_MASK) - -#define PORT_EDFR_EDF8_MASK (0x100U) -#define PORT_EDFR_EDF8_SHIFT (8U) -/*! EDF8 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF8(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF8_SHIFT)) & PORT_EDFR_EDF8_MASK) - -#define PORT_EDFR_EDF9_MASK (0x200U) -#define PORT_EDFR_EDF9_SHIFT (9U) -/*! EDF9 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF9(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF9_SHIFT)) & PORT_EDFR_EDF9_MASK) - -#define PORT_EDFR_EDF10_MASK (0x400U) -#define PORT_EDFR_EDF10_SHIFT (10U) -/*! EDF10 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF10(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF10_SHIFT)) & PORT_EDFR_EDF10_MASK) - -#define PORT_EDFR_EDF11_MASK (0x800U) -#define PORT_EDFR_EDF11_SHIFT (11U) -/*! EDF11 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF11(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF11_SHIFT)) & PORT_EDFR_EDF11_MASK) - -#define PORT_EDFR_EDF12_MASK (0x1000U) -#define PORT_EDFR_EDF12_SHIFT (12U) -/*! EDF12 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF12(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF12_SHIFT)) & PORT_EDFR_EDF12_MASK) - -#define PORT_EDFR_EDF13_MASK (0x2000U) -#define PORT_EDFR_EDF13_SHIFT (13U) -/*! EDF13 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF13(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF13_SHIFT)) & PORT_EDFR_EDF13_MASK) - -#define PORT_EDFR_EDF14_MASK (0x4000U) -#define PORT_EDFR_EDF14_SHIFT (14U) -/*! EDF14 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF14(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF14_SHIFT)) & PORT_EDFR_EDF14_MASK) - -#define PORT_EDFR_EDF15_MASK (0x8000U) -#define PORT_EDFR_EDF15_SHIFT (15U) -/*! EDF15 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF15(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF15_SHIFT)) & PORT_EDFR_EDF15_MASK) - -#define PORT_EDFR_EDF16_MASK (0x10000U) -#define PORT_EDFR_EDF16_SHIFT (16U) -/*! EDF16 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF16(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF16_SHIFT)) & PORT_EDFR_EDF16_MASK) - -#define PORT_EDFR_EDF17_MASK (0x20000U) -#define PORT_EDFR_EDF17_SHIFT (17U) -/*! EDF17 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF17(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF17_SHIFT)) & PORT_EDFR_EDF17_MASK) - -#define PORT_EDFR_EDF18_MASK (0x40000U) -#define PORT_EDFR_EDF18_SHIFT (18U) -/*! EDF18 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF18(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF18_SHIFT)) & PORT_EDFR_EDF18_MASK) - -#define PORT_EDFR_EDF19_MASK (0x80000U) -#define PORT_EDFR_EDF19_SHIFT (19U) -/*! EDF19 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF19(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF19_SHIFT)) & PORT_EDFR_EDF19_MASK) - -#define PORT_EDFR_EDF20_MASK (0x100000U) -#define PORT_EDFR_EDF20_SHIFT (20U) -/*! EDF20 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF20(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF20_SHIFT)) & PORT_EDFR_EDF20_MASK) - -#define PORT_EDFR_EDF21_MASK (0x200000U) -#define PORT_EDFR_EDF21_SHIFT (21U) -/*! EDF21 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF21(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF21_SHIFT)) & PORT_EDFR_EDF21_MASK) - -#define PORT_EDFR_EDF22_MASK (0x400000U) -#define PORT_EDFR_EDF22_SHIFT (22U) -/*! EDF22 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF22(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF22_SHIFT)) & PORT_EDFR_EDF22_MASK) - -#define PORT_EDFR_EDF23_MASK (0x800000U) -#define PORT_EDFR_EDF23_SHIFT (23U) -/*! EDF23 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF23(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF23_SHIFT)) & PORT_EDFR_EDF23_MASK) - -#define PORT_EDFR_EDF24_MASK (0x1000000U) -#define PORT_EDFR_EDF24_SHIFT (24U) -/*! EDF24 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF24(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF24_SHIFT)) & PORT_EDFR_EDF24_MASK) - -#define PORT_EDFR_EDF25_MASK (0x2000000U) -#define PORT_EDFR_EDF25_SHIFT (25U) -/*! EDF25 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF25(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF25_SHIFT)) & PORT_EDFR_EDF25_MASK) - -#define PORT_EDFR_EDF26_MASK (0x4000000U) -#define PORT_EDFR_EDF26_SHIFT (26U) -/*! EDF26 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF26(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF26_SHIFT)) & PORT_EDFR_EDF26_MASK) - -#define PORT_EDFR_EDF27_MASK (0x8000000U) -#define PORT_EDFR_EDF27_SHIFT (27U) -/*! EDF27 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF27(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF27_SHIFT)) & PORT_EDFR_EDF27_MASK) - -#define PORT_EDFR_EDF28_MASK (0x10000000U) -#define PORT_EDFR_EDF28_SHIFT (28U) -/*! EDF28 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF28(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF28_SHIFT)) & PORT_EDFR_EDF28_MASK) - -#define PORT_EDFR_EDF29_MASK (0x20000000U) -#define PORT_EDFR_EDF29_SHIFT (29U) -/*! EDF29 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF29(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF29_SHIFT)) & PORT_EDFR_EDF29_MASK) - -#define PORT_EDFR_EDF30_MASK (0x40000000U) -#define PORT_EDFR_EDF30_SHIFT (30U) -/*! EDF30 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF30(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF30_SHIFT)) & PORT_EDFR_EDF30_MASK) - -#define PORT_EDFR_EDF31_MASK (0x80000000U) -#define PORT_EDFR_EDF31_SHIFT (31U) -/*! EDF31 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF31(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF31_SHIFT)) & PORT_EDFR_EDF31_MASK) -/*! @} */ - -/*! @name EDIER - EFT Detect Interrupt Enable */ -/*! @{ */ - -#define PORT_EDIER_EDIE0_MASK (0x1U) -#define PORT_EDIER_EDIE0_SHIFT (0U) -/*! EDIE0 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE0(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE0_SHIFT)) & PORT_EDIER_EDIE0_MASK) - -#define PORT_EDIER_EDIE1_MASK (0x2U) -#define PORT_EDIER_EDIE1_SHIFT (1U) -/*! EDIE1 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE1(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE1_SHIFT)) & PORT_EDIER_EDIE1_MASK) - -#define PORT_EDIER_EDIE2_MASK (0x4U) -#define PORT_EDIER_EDIE2_SHIFT (2U) -/*! EDIE2 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE2(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE2_SHIFT)) & PORT_EDIER_EDIE2_MASK) - -#define PORT_EDIER_EDIE3_MASK (0x8U) -#define PORT_EDIER_EDIE3_SHIFT (3U) -/*! EDIE3 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE3(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE3_SHIFT)) & PORT_EDIER_EDIE3_MASK) - -#define PORT_EDIER_EDIE4_MASK (0x10U) -#define PORT_EDIER_EDIE4_SHIFT (4U) -/*! EDIE4 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE4(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE4_SHIFT)) & PORT_EDIER_EDIE4_MASK) - -#define PORT_EDIER_EDIE5_MASK (0x20U) -#define PORT_EDIER_EDIE5_SHIFT (5U) -/*! EDIE5 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE5(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE5_SHIFT)) & PORT_EDIER_EDIE5_MASK) - -#define PORT_EDIER_EDIE6_MASK (0x40U) -#define PORT_EDIER_EDIE6_SHIFT (6U) -/*! EDIE6 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE6(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE6_SHIFT)) & PORT_EDIER_EDIE6_MASK) - -#define PORT_EDIER_EDIE7_MASK (0x80U) -#define PORT_EDIER_EDIE7_SHIFT (7U) -/*! EDIE7 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE7(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE7_SHIFT)) & PORT_EDIER_EDIE7_MASK) - -#define PORT_EDIER_EDIE8_MASK (0x100U) -#define PORT_EDIER_EDIE8_SHIFT (8U) -/*! EDIE8 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE8(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE8_SHIFT)) & PORT_EDIER_EDIE8_MASK) - -#define PORT_EDIER_EDIE9_MASK (0x200U) -#define PORT_EDIER_EDIE9_SHIFT (9U) -/*! EDIE9 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE9(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE9_SHIFT)) & PORT_EDIER_EDIE9_MASK) - -#define PORT_EDIER_EDIE10_MASK (0x400U) -#define PORT_EDIER_EDIE10_SHIFT (10U) -/*! EDIE10 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE10(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE10_SHIFT)) & PORT_EDIER_EDIE10_MASK) - -#define PORT_EDIER_EDIE11_MASK (0x800U) -#define PORT_EDIER_EDIE11_SHIFT (11U) -/*! EDIE11 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE11(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE11_SHIFT)) & PORT_EDIER_EDIE11_MASK) - -#define PORT_EDIER_EDIE12_MASK (0x1000U) -#define PORT_EDIER_EDIE12_SHIFT (12U) -/*! EDIE12 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE12(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE12_SHIFT)) & PORT_EDIER_EDIE12_MASK) - -#define PORT_EDIER_EDIE13_MASK (0x2000U) -#define PORT_EDIER_EDIE13_SHIFT (13U) -/*! EDIE13 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE13(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE13_SHIFT)) & PORT_EDIER_EDIE13_MASK) - -#define PORT_EDIER_EDIE14_MASK (0x4000U) -#define PORT_EDIER_EDIE14_SHIFT (14U) -/*! EDIE14 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE14(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE14_SHIFT)) & PORT_EDIER_EDIE14_MASK) - -#define PORT_EDIER_EDIE15_MASK (0x8000U) -#define PORT_EDIER_EDIE15_SHIFT (15U) -/*! EDIE15 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE15(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE15_SHIFT)) & PORT_EDIER_EDIE15_MASK) - -#define PORT_EDIER_EDIE16_MASK (0x10000U) -#define PORT_EDIER_EDIE16_SHIFT (16U) -/*! EDIE16 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE16(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE16_SHIFT)) & PORT_EDIER_EDIE16_MASK) - -#define PORT_EDIER_EDIE17_MASK (0x20000U) -#define PORT_EDIER_EDIE17_SHIFT (17U) -/*! EDIE17 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE17(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE17_SHIFT)) & PORT_EDIER_EDIE17_MASK) - -#define PORT_EDIER_EDIE18_MASK (0x40000U) -#define PORT_EDIER_EDIE18_SHIFT (18U) -/*! EDIE18 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE18(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE18_SHIFT)) & PORT_EDIER_EDIE18_MASK) - -#define PORT_EDIER_EDIE19_MASK (0x80000U) -#define PORT_EDIER_EDIE19_SHIFT (19U) -/*! EDIE19 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE19(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE19_SHIFT)) & PORT_EDIER_EDIE19_MASK) - -#define PORT_EDIER_EDIE20_MASK (0x100000U) -#define PORT_EDIER_EDIE20_SHIFT (20U) -/*! EDIE20 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE20(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE20_SHIFT)) & PORT_EDIER_EDIE20_MASK) - -#define PORT_EDIER_EDIE21_MASK (0x200000U) -#define PORT_EDIER_EDIE21_SHIFT (21U) -/*! EDIE21 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE21(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE21_SHIFT)) & PORT_EDIER_EDIE21_MASK) - -#define PORT_EDIER_EDIE22_MASK (0x400000U) -#define PORT_EDIER_EDIE22_SHIFT (22U) -/*! EDIE22 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE22(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE22_SHIFT)) & PORT_EDIER_EDIE22_MASK) - -#define PORT_EDIER_EDIE23_MASK (0x800000U) -#define PORT_EDIER_EDIE23_SHIFT (23U) -/*! EDIE23 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE23(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE23_SHIFT)) & PORT_EDIER_EDIE23_MASK) - -#define PORT_EDIER_EDIE24_MASK (0x1000000U) -#define PORT_EDIER_EDIE24_SHIFT (24U) -/*! EDIE24 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE24(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE24_SHIFT)) & PORT_EDIER_EDIE24_MASK) - -#define PORT_EDIER_EDIE25_MASK (0x2000000U) -#define PORT_EDIER_EDIE25_SHIFT (25U) -/*! EDIE25 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE25(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE25_SHIFT)) & PORT_EDIER_EDIE25_MASK) - -#define PORT_EDIER_EDIE26_MASK (0x4000000U) -#define PORT_EDIER_EDIE26_SHIFT (26U) -/*! EDIE26 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE26(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE26_SHIFT)) & PORT_EDIER_EDIE26_MASK) - -#define PORT_EDIER_EDIE27_MASK (0x8000000U) -#define PORT_EDIER_EDIE27_SHIFT (27U) -/*! EDIE27 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE27(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE27_SHIFT)) & PORT_EDIER_EDIE27_MASK) - -#define PORT_EDIER_EDIE28_MASK (0x10000000U) -#define PORT_EDIER_EDIE28_SHIFT (28U) -/*! EDIE28 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE28(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE28_SHIFT)) & PORT_EDIER_EDIE28_MASK) - -#define PORT_EDIER_EDIE29_MASK (0x20000000U) -#define PORT_EDIER_EDIE29_SHIFT (29U) -/*! EDIE29 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE29(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE29_SHIFT)) & PORT_EDIER_EDIE29_MASK) - -#define PORT_EDIER_EDIE30_MASK (0x40000000U) -#define PORT_EDIER_EDIE30_SHIFT (30U) -/*! EDIE30 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE30(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE30_SHIFT)) & PORT_EDIER_EDIE30_MASK) - -#define PORT_EDIER_EDIE31_MASK (0x80000000U) -#define PORT_EDIER_EDIE31_SHIFT (31U) -/*! EDIE31 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE31(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE31_SHIFT)) & PORT_EDIER_EDIE31_MASK) -/*! @} */ - -/*! @name EDCR - EFT Detect Clear */ -/*! @{ */ - -#define PORT_EDCR_EDHC_MASK (0x1U) -#define PORT_EDCR_EDHC_SHIFT (0U) -/*! EDHC - EFT Detect High Clear - * 0b0..Does not clear - * 0b1..Clears - */ -#define PORT_EDCR_EDHC(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDCR_EDHC_SHIFT)) & PORT_EDCR_EDHC_MASK) - -#define PORT_EDCR_EDLC_MASK (0x2U) -#define PORT_EDCR_EDLC_SHIFT (1U) -/*! EDLC - EFT Detect Low Clear - * 0b0..Does not clear - * 0b1..Clears - */ -#define PORT_EDCR_EDLC(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDCR_EDLC_SHIFT)) & PORT_EDCR_EDLC_MASK) -/*! @} */ - -/*! @name CALIB0 - Calibration 0 */ -/*! @{ */ - -#define PORT_CALIB0_NCAL_MASK (0x3FU) -#define PORT_CALIB0_NCAL_SHIFT (0U) -/*! NCAL - Calibration of NMOS Output Driver */ -#define PORT_CALIB0_NCAL(x) (((uint32_t)(((uint32_t)(x)) << PORT_CALIB0_NCAL_SHIFT)) & PORT_CALIB0_NCAL_MASK) - -#define PORT_CALIB0_PCAL_MASK (0x3F0000U) -#define PORT_CALIB0_PCAL_SHIFT (16U) -/*! PCAL - Calibration of PMOS Output Driver */ -#define PORT_CALIB0_PCAL(x) (((uint32_t)(((uint32_t)(x)) << PORT_CALIB0_PCAL_SHIFT)) & PORT_CALIB0_PCAL_MASK) -/*! @} */ - -/*! @name CALIB1 - Calibration 1 */ -/*! @{ */ - -#define PORT_CALIB1_NCAL_MASK (0x3FU) -#define PORT_CALIB1_NCAL_SHIFT (0U) -/*! NCAL - Calibration of NMOS Output Driver */ -#define PORT_CALIB1_NCAL(x) (((uint32_t)(((uint32_t)(x)) << PORT_CALIB1_NCAL_SHIFT)) & PORT_CALIB1_NCAL_MASK) - -#define PORT_CALIB1_PCAL_MASK (0x3F0000U) -#define PORT_CALIB1_PCAL_SHIFT (16U) -/*! PCAL - Calibration of PMOS Output Driver */ -#define PORT_CALIB1_PCAL(x) (((uint32_t)(((uint32_t)(x)) << PORT_CALIB1_PCAL_SHIFT)) & PORT_CALIB1_PCAL_MASK) -/*! @} */ - -/*! @name PCR - Pin Control 0..Pin Control 31 */ -/*! @{ */ - -#define PORT_PCR_PS_MASK (0x1U) -#define PORT_PCR_PS_SHIFT (0U) -/*! PS - Pull Select - * 0b0..Enables internal pulldown resistor - * 0b1..Enables internal pullup resistor - */ -#define PORT_PCR_PS(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_PS_SHIFT)) & PORT_PCR_PS_MASK) - -#define PORT_PCR_PE_MASK (0x2U) -#define PORT_PCR_PE_SHIFT (1U) -/*! PE - Pull Enable - * 0b0..Disables - * 0b1..Enables - */ -#define PORT_PCR_PE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_PE_SHIFT)) & PORT_PCR_PE_MASK) - -#define PORT_PCR_PV_MASK (0x4U) -#define PORT_PCR_PV_SHIFT (2U) -/*! PV - Pull Value - * 0b0..Low - * 0b1..High - */ -#define PORT_PCR_PV(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_PV_SHIFT)) & PORT_PCR_PV_MASK) - -#define PORT_PCR_SRE_MASK (0x8U) -#define PORT_PCR_SRE_SHIFT (3U) -/*! SRE - Slew Rate Enable - * 0b0..Fast - * 0b1..Slow - */ -#define PORT_PCR_SRE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_SRE_SHIFT)) & PORT_PCR_SRE_MASK) - -#define PORT_PCR_PFE_MASK (0x10U) -#define PORT_PCR_PFE_SHIFT (4U) -/*! PFE - Passive Filter Enable - * 0b0..Disables - * 0b1..Enables - */ -#define PORT_PCR_PFE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_PFE_SHIFT)) & PORT_PCR_PFE_MASK) - -#define PORT_PCR_ODE_MASK (0x20U) -#define PORT_PCR_ODE_SHIFT (5U) -/*! ODE - Open Drain Enable - * 0b0..Disables - * 0b1..Enables - */ -#define PORT_PCR_ODE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_ODE_SHIFT)) & PORT_PCR_ODE_MASK) - -#define PORT_PCR_DSE_MASK (0x40U) -#define PORT_PCR_DSE_SHIFT (6U) -/*! DSE - Drive Strength Enable - * 0b0..Low - * 0b1..High - */ -#define PORT_PCR_DSE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_DSE_SHIFT)) & PORT_PCR_DSE_MASK) - -#define PORT_PCR_MUX_MASK (0xF00U) /* Merged from fields with different position or width, of widths (2, 4), largest definition used */ -#define PORT_PCR_MUX_SHIFT (8U) -/*! MUX - Pin Multiplex Control - * 0b0000..Alternative 0 (GPIO) - * 0b0001..Alternative 1 (chip-specific) - * 0b0010..Alternative 2 (chip-specific) - * 0b0011..Alternative 3 (chip-specific) - * 0b0100..Alternative 4 (chip-specific) - * 0b0101..Alternative 5 (chip-specific) - * 0b0110..Alternative 6 (chip-specific) - * 0b0111..Alternative 7 (chip-specific) - * 0b1000..Alternative 8 (chip-specific) - * 0b1001..Alternative 9 (chip-specific) - * 0b1010..Alternative 10 (chip-specific) - * 0b1011..Alternative 11 (chip-specific) - * 0b1100..Alternative 12 (chip-specific) - * 0b1101..Alternative 13 (chip-specific) - */ -#define PORT_PCR_MUX(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_MUX_SHIFT)) & PORT_PCR_MUX_MASK) /* Merged from fields with different position or width, of widths (2, 4), largest definition used */ - -#define PORT_PCR_IBE_MASK (0x1000U) -#define PORT_PCR_IBE_SHIFT (12U) -/*! IBE - Input Buffer Enable - * 0b0..Disables - * 0b1..Enables - */ -#define PORT_PCR_IBE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_IBE_SHIFT)) & PORT_PCR_IBE_MASK) - -#define PORT_PCR_INV_MASK (0x2000U) -#define PORT_PCR_INV_SHIFT (13U) -/*! INV - Invert Input - * 0b0..Does not invert - * 0b1..Inverts - */ -#define PORT_PCR_INV(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_INV_SHIFT)) & PORT_PCR_INV_MASK) - -#define PORT_PCR_LK_MASK (0x8000U) -#define PORT_PCR_LK_SHIFT (15U) -/*! LK - Lock Register - * 0b0..Does not lock - * 0b1..Locks - */ -#define PORT_PCR_LK(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_LK_SHIFT)) & PORT_PCR_LK_MASK) -/*! @} */ - -/* The count of PORT_PCR */ -#define PORT_PCR_COUNT (32U) - - -/*! - * @} - */ /* end of group PORT_Register_Masks */ - - -/* PORT - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral PORT0 base address */ - #define PORT0_BASE (0x50116000u) - /** Peripheral PORT0 base address */ - #define PORT0_BASE_NS (0x40116000u) - /** Peripheral PORT0 base pointer */ - #define PORT0 ((PORT_Type *)PORT0_BASE) - /** Peripheral PORT0 base pointer */ - #define PORT0_NS ((PORT_Type *)PORT0_BASE_NS) - /** Peripheral PORT1 base address */ - #define PORT1_BASE (0x50117000u) - /** Peripheral PORT1 base address */ - #define PORT1_BASE_NS (0x40117000u) - /** Peripheral PORT1 base pointer */ - #define PORT1 ((PORT_Type *)PORT1_BASE) - /** Peripheral PORT1 base pointer */ - #define PORT1_NS ((PORT_Type *)PORT1_BASE_NS) - /** Peripheral PORT2 base address */ - #define PORT2_BASE (0x50118000u) - /** Peripheral PORT2 base address */ - #define PORT2_BASE_NS (0x40118000u) - /** Peripheral PORT2 base pointer */ - #define PORT2 ((PORT_Type *)PORT2_BASE) - /** Peripheral PORT2 base pointer */ - #define PORT2_NS ((PORT_Type *)PORT2_BASE_NS) - /** Peripheral PORT3 base address */ - #define PORT3_BASE (0x50119000u) - /** Peripheral PORT3 base address */ - #define PORT3_BASE_NS (0x40119000u) - /** Peripheral PORT3 base pointer */ - #define PORT3 ((PORT_Type *)PORT3_BASE) - /** Peripheral PORT3 base pointer */ - #define PORT3_NS ((PORT_Type *)PORT3_BASE_NS) - /** Peripheral PORT4 base address */ - #define PORT4_BASE (0x5011A000u) - /** Peripheral PORT4 base address */ - #define PORT4_BASE_NS (0x4011A000u) - /** Peripheral PORT4 base pointer */ - #define PORT4 ((PORT_Type *)PORT4_BASE) - /** Peripheral PORT4 base pointer */ - #define PORT4_NS ((PORT_Type *)PORT4_BASE_NS) - /** Peripheral PORT5 base address */ - #define PORT5_BASE (0x50042000u) - /** Peripheral PORT5 base address */ - #define PORT5_BASE_NS (0x40042000u) - /** Peripheral PORT5 base pointer */ - #define PORT5 ((PORT_Type *)PORT5_BASE) - /** Peripheral PORT5 base pointer */ - #define PORT5_NS ((PORT_Type *)PORT5_BASE_NS) - /** Array initializer of PORT peripheral base addresses */ - #define PORT_BASE_ADDRS { PORT0_BASE, PORT1_BASE, PORT2_BASE, PORT3_BASE, PORT4_BASE, PORT5_BASE } - /** Array initializer of PORT peripheral base pointers */ - #define PORT_BASE_PTRS { PORT0, PORT1, PORT2, PORT3, PORT4, PORT5 } - /** Array initializer of PORT peripheral base addresses */ - #define PORT_BASE_ADDRS_NS { PORT0_BASE_NS, PORT1_BASE_NS, PORT2_BASE_NS, PORT3_BASE_NS, PORT4_BASE_NS, PORT5_BASE_NS } - /** Array initializer of PORT peripheral base pointers */ - #define PORT_BASE_PTRS_NS { PORT0_NS, PORT1_NS, PORT2_NS, PORT3_NS, PORT4_NS, PORT5_NS } -#else - /** Peripheral PORT0 base address */ - #define PORT0_BASE (0x40116000u) - /** Peripheral PORT0 base pointer */ - #define PORT0 ((PORT_Type *)PORT0_BASE) - /** Peripheral PORT1 base address */ - #define PORT1_BASE (0x40117000u) - /** Peripheral PORT1 base pointer */ - #define PORT1 ((PORT_Type *)PORT1_BASE) - /** Peripheral PORT2 base address */ - #define PORT2_BASE (0x40118000u) - /** Peripheral PORT2 base pointer */ - #define PORT2 ((PORT_Type *)PORT2_BASE) - /** Peripheral PORT3 base address */ - #define PORT3_BASE (0x40119000u) - /** Peripheral PORT3 base pointer */ - #define PORT3 ((PORT_Type *)PORT3_BASE) - /** Peripheral PORT4 base address */ - #define PORT4_BASE (0x4011A000u) - /** Peripheral PORT4 base pointer */ - #define PORT4 ((PORT_Type *)PORT4_BASE) - /** Peripheral PORT5 base address */ - #define PORT5_BASE (0x40042000u) - /** Peripheral PORT5 base pointer */ - #define PORT5 ((PORT_Type *)PORT5_BASE) - /** Array initializer of PORT peripheral base addresses */ - #define PORT_BASE_ADDRS { PORT0_BASE, PORT1_BASE, PORT2_BASE, PORT3_BASE, PORT4_BASE, PORT5_BASE } - /** Array initializer of PORT peripheral base pointers */ - #define PORT_BASE_PTRS { PORT0, PORT1, PORT2, PORT3, PORT4, PORT5 } -#endif - -/*! - * @} - */ /* end of group PORT_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- POWERQUAD Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup POWERQUAD_Peripheral_Access_Layer POWERQUAD Peripheral Access Layer - * @{ - */ - -/** POWERQUAD - Register Layout Typedef */ -typedef struct { - __IO uint32_t OUTBASE; /**< Output Base, offset: 0x0 */ - __IO uint32_t OUTFORMAT; /**< Output Format, offset: 0x4 */ - __IO uint32_t TMPBASE; /**< Temporary Base, offset: 0x8 */ - __IO uint32_t TMPFORMAT; /**< Temporary Format, offset: 0xC */ - __IO uint32_t INABASE; /**< Input A Base, offset: 0x10 */ - __IO uint32_t INAFORMAT; /**< Input A Format, offset: 0x14 */ - __IO uint32_t INBBASE; /**< Input B Base, offset: 0x18 */ - __IO uint32_t INBFORMAT; /**< Input B Format, offset: 0x1C */ - uint8_t RESERVED_0[224]; - __IO uint32_t CONTROL; /**< Control, offset: 0x100 */ - __IO uint32_t LENGTH; /**< Length, offset: 0x104 */ - __IO uint32_t CPPRE; /**< Coprocessor Prescale, offset: 0x108 */ - __IO uint32_t MISC; /**< Miscellaneous, offset: 0x10C */ - __IO uint32_t CURSORY; /**< Cursory, offset: 0x110 */ - uint8_t RESERVED_1[108]; - __IO uint32_t CORDIC_X; /**< CORDIC Input X, offset: 0x180 */ - __IO uint32_t CORDIC_Y; /**< CORDIC Input Y, offset: 0x184 */ - __IO uint32_t CORDIC_Z; /**< CORDIC Input Z, offset: 0x188 */ - __IO uint32_t ERRSTAT; /**< Error Status, offset: 0x18C */ - __IO uint32_t INTREN; /**< Interrupt Enable, offset: 0x190 */ - __IO uint32_t EVENTEN; /**< Event Enable, offset: 0x194 */ - __IO uint32_t INTRSTAT; /**< Interrupt Status, offset: 0x198 */ - uint8_t RESERVED_2[100]; - __IO uint32_t GPREG[16]; /**< General Purpose Register Bank n, array offset: 0x200, array step: 0x4 */ - __IO uint32_t COMPREG[8]; /**< Compute Register Bank n, array offset: 0x240, array step: 0x4 */ -} POWERQUAD_Type; - -/* ---------------------------------------------------------------------------- - -- POWERQUAD Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup POWERQUAD_Register_Masks POWERQUAD Register Masks - * @{ - */ - -/*! @name OUTBASE - Output Base */ -/*! @{ */ - -#define POWERQUAD_OUTBASE_OUTBASE_MASK (0xFFFFFFFFU) -#define POWERQUAD_OUTBASE_OUTBASE_SHIFT (0U) -/*! OUTBASE - Output Region Base Address */ -#define POWERQUAD_OUTBASE_OUTBASE(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_OUTBASE_OUTBASE_SHIFT)) & POWERQUAD_OUTBASE_OUTBASE_MASK) -/*! @} */ - -/*! @name OUTFORMAT - Output Format */ -/*! @{ */ - -#define POWERQUAD_OUTFORMAT_OUT_FORMATINT_MASK (0x3U) -#define POWERQUAD_OUTFORMAT_OUT_FORMATINT_SHIFT (0U) -/*! OUT_FORMATINT - Output Internal Format - * 0b00..Q15 16-bit fixed-point integer - * 0b01..Q31 32-bit fixed-point integer - * 0b10..F32 32-bit floating-point format - * 0b11.. - */ -#define POWERQUAD_OUTFORMAT_OUT_FORMATINT(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_OUTFORMAT_OUT_FORMATINT_SHIFT)) & POWERQUAD_OUTFORMAT_OUT_FORMATINT_MASK) - -#define POWERQUAD_OUTFORMAT_OUT_FORMATEXT_MASK (0x30U) -#define POWERQUAD_OUTFORMAT_OUT_FORMATEXT_SHIFT (4U) -/*! OUT_FORMATEXT - Output External Format - * 0b00..Q15 16-bit fixed-point integer - * 0b01..Q31 32-bit fixed-point integer - * 0b10..F32 32-bit floating-point format - * 0b11.. - */ -#define POWERQUAD_OUTFORMAT_OUT_FORMATEXT(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_OUTFORMAT_OUT_FORMATEXT_SHIFT)) & POWERQUAD_OUTFORMAT_OUT_FORMATEXT_MASK) - -#define POWERQUAD_OUTFORMAT_OUT_SCALER_MASK (0xFF00U) -#define POWERQUAD_OUTFORMAT_OUT_SCALER_SHIFT (8U) -/*! OUT_SCALER - 8-bit Scaling Value for Result Data */ -#define POWERQUAD_OUTFORMAT_OUT_SCALER(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_OUTFORMAT_OUT_SCALER_SHIFT)) & POWERQUAD_OUTFORMAT_OUT_SCALER_MASK) -/*! @} */ - -/*! @name TMPBASE - Temporary Base */ -/*! @{ */ - -#define POWERQUAD_TMPBASE_TMPBASE_MASK (0xFFFFFFFFU) -#define POWERQUAD_TMPBASE_TMPBASE_SHIFT (0U) -/*! TMPBASE - Base Address for the Temporary Region */ -#define POWERQUAD_TMPBASE_TMPBASE(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_TMPBASE_TMPBASE_SHIFT)) & POWERQUAD_TMPBASE_TMPBASE_MASK) -/*! @} */ - -/*! @name TMPFORMAT - Temporary Format */ -/*! @{ */ - -#define POWERQUAD_TMPFORMAT_TMP_FORMATINT_MASK (0x3U) -#define POWERQUAD_TMPFORMAT_TMP_FORMATINT_SHIFT (0U) -/*! TMP_FORMATINT - Temporary Internal Format - * 0b00..Q15 16-bit fixed-point integer - * 0b01..Q31 32-bit fixed-point integer - * 0b10..F32 32-bit floating-point format - * 0b11.. - */ -#define POWERQUAD_TMPFORMAT_TMP_FORMATINT(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_TMPFORMAT_TMP_FORMATINT_SHIFT)) & POWERQUAD_TMPFORMAT_TMP_FORMATINT_MASK) - -#define POWERQUAD_TMPFORMAT_TMP_FORMATEXT_MASK (0x30U) -#define POWERQUAD_TMPFORMAT_TMP_FORMATEXT_SHIFT (4U) -/*! TMP_FORMATEXT - Temporary External Format - * 0b00..Q15 16-bit fixed-point integer - * 0b01..Q31 32-bit fixed-point integer - * 0b10..F32 32-bit floating-point format - * 0b11.. - */ -#define POWERQUAD_TMPFORMAT_TMP_FORMATEXT(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_TMPFORMAT_TMP_FORMATEXT_SHIFT)) & POWERQUAD_TMPFORMAT_TMP_FORMATEXT_MASK) - -#define POWERQUAD_TMPFORMAT_TMP_SCALER_MASK (0xFF00U) -#define POWERQUAD_TMPFORMAT_TMP_SCALER_SHIFT (8U) -/*! TMP_SCALER - Scaling Value for Temporary Data. */ -#define POWERQUAD_TMPFORMAT_TMP_SCALER(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_TMPFORMAT_TMP_SCALER_SHIFT)) & POWERQUAD_TMPFORMAT_TMP_SCALER_MASK) -/*! @} */ - -/*! @name INABASE - Input A Base */ -/*! @{ */ - -#define POWERQUAD_INABASE_INABASE_MASK (0xFFFFFFFFU) -#define POWERQUAD_INABASE_INABASE_SHIFT (0U) -/*! INABASE - Input A Base */ -#define POWERQUAD_INABASE_INABASE(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_INABASE_INABASE_SHIFT)) & POWERQUAD_INABASE_INABASE_MASK) -/*! @} */ - -/*! @name INAFORMAT - Input A Format */ -/*! @{ */ - -#define POWERQUAD_INAFORMAT_INA_FORMATINT_MASK (0x3U) -#define POWERQUAD_INAFORMAT_INA_FORMATINT_SHIFT (0U) -/*! INA_FORMATINT - Input A Internal Format - * 0b00..Q15 16-bit fixed-point integer - * 0b01..Q31 32-bit fixed-point integer - * 0b10..F32 32-bit floating-point format - * 0b11.. - */ -#define POWERQUAD_INAFORMAT_INA_FORMATINT(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_INAFORMAT_INA_FORMATINT_SHIFT)) & POWERQUAD_INAFORMAT_INA_FORMATINT_MASK) - -#define POWERQUAD_INAFORMAT_INA_FORMATEXT_MASK (0x30U) -#define POWERQUAD_INAFORMAT_INA_FORMATEXT_SHIFT (4U) -/*! INA_FORMATEXT - Input A External Format - * 0b00..Q15 16-bit fixed-point integer - * 0b01..Q31 32-bit fixed-point integer - * 0b10..F32 32-bit floating-point format - * 0b11.. - */ -#define POWERQUAD_INAFORMAT_INA_FORMATEXT(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_INAFORMAT_INA_FORMATEXT_SHIFT)) & POWERQUAD_INAFORMAT_INA_FORMATEXT_MASK) - -#define POWERQUAD_INAFORMAT_INA_SCALER_MASK (0xFF00U) -#define POWERQUAD_INAFORMAT_INA_SCALER_SHIFT (8U) -/*! INA_SCALER - Input A Scaler Value */ -#define POWERQUAD_INAFORMAT_INA_SCALER(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_INAFORMAT_INA_SCALER_SHIFT)) & POWERQUAD_INAFORMAT_INA_SCALER_MASK) -/*! @} */ - -/*! @name INBBASE - Input B Base */ -/*! @{ */ - -#define POWERQUAD_INBBASE_INBBASE_MASK (0xFFFFFFFFU) -#define POWERQUAD_INBBASE_INBBASE_SHIFT (0U) -/*! INBBASE - Input B Base */ -#define POWERQUAD_INBBASE_INBBASE(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_INBBASE_INBBASE_SHIFT)) & POWERQUAD_INBBASE_INBBASE_MASK) -/*! @} */ - -/*! @name INBFORMAT - Input B Format */ -/*! @{ */ - -#define POWERQUAD_INBFORMAT_INB_FORMATINT_MASK (0x3U) -#define POWERQUAD_INBFORMAT_INB_FORMATINT_SHIFT (0U) -/*! INB_FORMATINT - Input B Internal Format - * 0b00..Q15 16-bit fixed-point integer - * 0b01..Q31 32-bit fixed-point integer - * 0b10..F32 32-bit floating-point format - * 0b11.. - */ -#define POWERQUAD_INBFORMAT_INB_FORMATINT(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_INBFORMAT_INB_FORMATINT_SHIFT)) & POWERQUAD_INBFORMAT_INB_FORMATINT_MASK) - -#define POWERQUAD_INBFORMAT_INB_FORMATEXT_MASK (0x30U) -#define POWERQUAD_INBFORMAT_INB_FORMATEXT_SHIFT (4U) -/*! INB_FORMATEXT - Input B External Format - * 0b00..Q15 16-bit fixed-point integer - * 0b01..Q31 32-bit fixed-point integer - * 0b10..F32 32-bit floating-point format - * 0b11.. - */ -#define POWERQUAD_INBFORMAT_INB_FORMATEXT(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_INBFORMAT_INB_FORMATEXT_SHIFT)) & POWERQUAD_INBFORMAT_INB_FORMATEXT_MASK) - -#define POWERQUAD_INBFORMAT_INB_SCALER_MASK (0xFF00U) -#define POWERQUAD_INBFORMAT_INB_SCALER_SHIFT (8U) -/*! INB_SCALER - Input B Scaler */ -#define POWERQUAD_INBFORMAT_INB_SCALER(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_INBFORMAT_INB_SCALER_SHIFT)) & POWERQUAD_INBFORMAT_INB_SCALER_MASK) -/*! @} */ - -/*! @name CONTROL - Control */ -/*! @{ */ - -#define POWERQUAD_CONTROL_DECODE_OPCODE_MASK (0xFU) -#define POWERQUAD_CONTROL_DECODE_OPCODE_SHIFT (0U) -/*! DECODE_OPCODE - Decode Opcode */ -#define POWERQUAD_CONTROL_DECODE_OPCODE(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_CONTROL_DECODE_OPCODE_SHIFT)) & POWERQUAD_CONTROL_DECODE_OPCODE_MASK) - -#define POWERQUAD_CONTROL_DECODE_MACHINE_MASK (0xF0U) -#define POWERQUAD_CONTROL_DECODE_MACHINE_SHIFT (4U) -/*! DECODE_MACHINE - Decode Machine - * 0b0000..Coprocessor - * 0b0001..Matrix engine - * 0b0010..Transform engine - * 0b0011..Filter engine - * 0b0101..CORDIC engine - * 0b0100, 0b0110-0b1111.. - */ -#define POWERQUAD_CONTROL_DECODE_MACHINE(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_CONTROL_DECODE_MACHINE_SHIFT)) & POWERQUAD_CONTROL_DECODE_MACHINE_MASK) - -#define POWERQUAD_CONTROL_INST_BUSY_MASK (0x80000000U) -#define POWERQUAD_CONTROL_INST_BUSY_SHIFT (31U) -/*! INST_BUSY - Instruction Busy - * 0b1..Busy - * 0b0..Not busy - */ -#define POWERQUAD_CONTROL_INST_BUSY(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_CONTROL_INST_BUSY_SHIFT)) & POWERQUAD_CONTROL_INST_BUSY_MASK) -/*! @} */ - -/*! @name LENGTH - Length */ -/*! @{ */ - -#define POWERQUAD_LENGTH_INST_LENGTH_MASK (0xFFFFFFFFU) -#define POWERQUAD_LENGTH_INST_LENGTH_SHIFT (0U) -/*! INST_LENGTH - Instruction length */ -#define POWERQUAD_LENGTH_INST_LENGTH(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_LENGTH_INST_LENGTH_SHIFT)) & POWERQUAD_LENGTH_INST_LENGTH_MASK) -/*! @} */ - -/*! @name CPPRE - Coprocessor Prescale */ -/*! @{ */ - -#define POWERQUAD_CPPRE_CPPRE_IN_MASK (0xFFU) -#define POWERQUAD_CPPRE_CPPRE_IN_SHIFT (0U) -/*! CPPRE_IN - Prescaling Input */ -#define POWERQUAD_CPPRE_CPPRE_IN(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_CPPRE_CPPRE_IN_SHIFT)) & POWERQUAD_CPPRE_CPPRE_IN_MASK) - -#define POWERQUAD_CPPRE_CPPRE_OUT_MASK (0xFF00U) -#define POWERQUAD_CPPRE_CPPRE_OUT_SHIFT (8U) -/*! CPPRE_OUT - Postscaling Output */ -#define POWERQUAD_CPPRE_CPPRE_OUT(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_CPPRE_CPPRE_OUT_SHIFT)) & POWERQUAD_CPPRE_CPPRE_OUT_MASK) - -#define POWERQUAD_CPPRE_CPPRE_SAT_MASK (0x10000U) -#define POWERQUAD_CPPRE_CPPRE_SAT_SHIFT (16U) -/*! CPPRE_SAT - Saturation - * 0b0..No saturation - * 0b1..Forces sub-32 bit saturation - */ -#define POWERQUAD_CPPRE_CPPRE_SAT(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_CPPRE_CPPRE_SAT_SHIFT)) & POWERQUAD_CPPRE_CPPRE_SAT_MASK) - -#define POWERQUAD_CPPRE_CPPRE_SAT8_MASK (0x20000U) -#define POWERQUAD_CPPRE_CPPRE_SAT8_SHIFT (17U) -/*! CPPRE_SAT8 - Saturation 8 - * 0b0..8 bits - * 0b1..16 bits - */ -#define POWERQUAD_CPPRE_CPPRE_SAT8(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_CPPRE_CPPRE_SAT8_SHIFT)) & POWERQUAD_CPPRE_CPPRE_SAT8_MASK) -/*! @} */ - -/*! @name MISC - Miscellaneous */ -/*! @{ */ - -#define POWERQUAD_MISC_INST_MISC_MASK (0xFFFFFFFFU) -#define POWERQUAD_MISC_INST_MISC_SHIFT (0U) -/*! INST_MISC - Scaling Factor */ -#define POWERQUAD_MISC_INST_MISC(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_MISC_INST_MISC_SHIFT)) & POWERQUAD_MISC_INST_MISC_MASK) -/*! @} */ - -/*! @name CURSORY - Cursory */ -/*! @{ */ - -#define POWERQUAD_CURSORY_CURSORY_MASK (0x1U) -#define POWERQUAD_CURSORY_CURSORY_SHIFT (0U) -/*! CURSORY - Cursory Mode - * 0b0..Disable cursory mode, full floating-point accuracy (24-bit mantissa + 2 bits before rounding). - * 0b1..Enable cursory Mode, 16-bit mantissa (bottom bits are zeroed for inputs and outputs of MACs). - */ -#define POWERQUAD_CURSORY_CURSORY(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_CURSORY_CURSORY_SHIFT)) & POWERQUAD_CURSORY_CURSORY_MASK) -/*! @} */ - -/*! @name CORDIC_X - CORDIC Input X */ -/*! @{ */ - -#define POWERQUAD_CORDIC_X_CORDIC_X_MASK (0xFFFFFFFFU) -#define POWERQUAD_CORDIC_X_CORDIC_X_SHIFT (0U) -/*! CORDIC_X - CORDIC Input X */ -#define POWERQUAD_CORDIC_X_CORDIC_X(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_CORDIC_X_CORDIC_X_SHIFT)) & POWERQUAD_CORDIC_X_CORDIC_X_MASK) -/*! @} */ - -/*! @name CORDIC_Y - CORDIC Input Y */ -/*! @{ */ - -#define POWERQUAD_CORDIC_Y_CORDIC_Y_MASK (0xFFFFFFFFU) -#define POWERQUAD_CORDIC_Y_CORDIC_Y_SHIFT (0U) -/*! CORDIC_Y - CORDIC Input Y */ -#define POWERQUAD_CORDIC_Y_CORDIC_Y(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_CORDIC_Y_CORDIC_Y_SHIFT)) & POWERQUAD_CORDIC_Y_CORDIC_Y_MASK) -/*! @} */ - -/*! @name CORDIC_Z - CORDIC Input Z */ -/*! @{ */ - -#define POWERQUAD_CORDIC_Z_CORDIC_Z_MASK (0xFFFFFFFFU) -#define POWERQUAD_CORDIC_Z_CORDIC_Z_SHIFT (0U) -/*! CORDIC_Z - CORDIC Input Z */ -#define POWERQUAD_CORDIC_Z_CORDIC_Z(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_CORDIC_Z_CORDIC_Z_SHIFT)) & POWERQUAD_CORDIC_Z_CORDIC_Z_MASK) -/*! @} */ - -/*! @name ERRSTAT - Error Status */ -/*! @{ */ - -#define POWERQUAD_ERRSTAT_OVERFLOW_MASK (0x1U) -#define POWERQUAD_ERRSTAT_OVERFLOW_SHIFT (0U) -/*! OVERFLOW - Floating-point Overflow - * 0b0..No error - * 0b1..Error on floating-point overflow - */ -#define POWERQUAD_ERRSTAT_OVERFLOW(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_ERRSTAT_OVERFLOW_SHIFT)) & POWERQUAD_ERRSTAT_OVERFLOW_MASK) - -#define POWERQUAD_ERRSTAT_NAN_MASK (0x2U) -#define POWERQUAD_ERRSTAT_NAN_SHIFT (1U) -/*! NAN - Floating-Point Not-a-Number (NaN) - * 0b0..No error - * 0b1..Error on floating-point NaN - */ -#define POWERQUAD_ERRSTAT_NAN(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_ERRSTAT_NAN_SHIFT)) & POWERQUAD_ERRSTAT_NAN_MASK) - -#define POWERQUAD_ERRSTAT_FIXEDOVERFLOW_MASK (0x4U) -#define POWERQUAD_ERRSTAT_FIXEDOVERFLOW_SHIFT (2U) -/*! FIXEDOVERFLOW - Fixed-point Overflow - * 0b0..No error - * 0b1..Error on fixed-point overflow - */ -#define POWERQUAD_ERRSTAT_FIXEDOVERFLOW(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_ERRSTAT_FIXEDOVERFLOW_SHIFT)) & POWERQUAD_ERRSTAT_FIXEDOVERFLOW_MASK) - -#define POWERQUAD_ERRSTAT_UNDERFLOW_MASK (0x8U) -#define POWERQUAD_ERRSTAT_UNDERFLOW_SHIFT (3U) -/*! UNDERFLOW - Underflow - * 0b0..No error - * 0b1..Error on underflow - */ -#define POWERQUAD_ERRSTAT_UNDERFLOW(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_ERRSTAT_UNDERFLOW_SHIFT)) & POWERQUAD_ERRSTAT_UNDERFLOW_MASK) - -#define POWERQUAD_ERRSTAT_BUSERROR_MASK (0x10U) -#define POWERQUAD_ERRSTAT_BUSERROR_SHIFT (4U) -/*! BUSERROR - Bus Error - * 0b0..No error - * 0b1..Error on bus - */ -#define POWERQUAD_ERRSTAT_BUSERROR(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_ERRSTAT_BUSERROR_SHIFT)) & POWERQUAD_ERRSTAT_BUSERROR_MASK) -/*! @} */ - -/*! @name INTREN - Interrupt Enable */ -/*! @{ */ - -#define POWERQUAD_INTREN_INTR_OFLOW_MASK (0x1U) -#define POWERQUAD_INTREN_INTR_OFLOW_SHIFT (0U) -/*! INTR_OFLOW - Interrupt Floating-point Overflow - * 0b0..Disable interrupt - * 0b1..Enable interrupt - */ -#define POWERQUAD_INTREN_INTR_OFLOW(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_INTREN_INTR_OFLOW_SHIFT)) & POWERQUAD_INTREN_INTR_OFLOW_MASK) - -#define POWERQUAD_INTREN_INTR_NAN_MASK (0x2U) -#define POWERQUAD_INTREN_INTR_NAN_SHIFT (1U) -/*! INTR_NAN - Interrupt Floating-point NaN - * 0b0..Disable interrupt - * 0b1..Enable interrupt - */ -#define POWERQUAD_INTREN_INTR_NAN(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_INTREN_INTR_NAN_SHIFT)) & POWERQUAD_INTREN_INTR_NAN_MASK) - -#define POWERQUAD_INTREN_INTR_FIXED_MASK (0x4U) -#define POWERQUAD_INTREN_INTR_FIXED_SHIFT (2U) -/*! INTR_FIXED - Interrupt on Fixed-point Overflow - * 0b0..Disable interrupt - * 0b1..Enable interrupt - */ -#define POWERQUAD_INTREN_INTR_FIXED(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_INTREN_INTR_FIXED_SHIFT)) & POWERQUAD_INTREN_INTR_FIXED_MASK) - -#define POWERQUAD_INTREN_INTR_UFLOW_MASK (0x8U) -#define POWERQUAD_INTREN_INTR_UFLOW_SHIFT (3U) -/*! INTR_UFLOW - Interrupt on Underflow - * 0b0..Disable interrupt - * 0b1..Enable interrupt - */ -#define POWERQUAD_INTREN_INTR_UFLOW(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_INTREN_INTR_UFLOW_SHIFT)) & POWERQUAD_INTREN_INTR_UFLOW_MASK) - -#define POWERQUAD_INTREN_INTR_BERR_MASK (0x10U) -#define POWERQUAD_INTREN_INTR_BERR_SHIFT (4U) -/*! INTR_BERR - Interrupt on AHBM Bus Error - * 0b0..Disable interrupt - * 0b1..Enable interrupt - */ -#define POWERQUAD_INTREN_INTR_BERR(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_INTREN_INTR_BERR_SHIFT)) & POWERQUAD_INTREN_INTR_BERR_MASK) - -#define POWERQUAD_INTREN_INTR_COMP_MASK (0x80U) -#define POWERQUAD_INTREN_INTR_COMP_SHIFT (7U) -/*! INTR_COMP - Interrupt on Instruction Completion - * 0b0..Disable interrupt - * 0b1..Enable interrupt - */ -#define POWERQUAD_INTREN_INTR_COMP(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_INTREN_INTR_COMP_SHIFT)) & POWERQUAD_INTREN_INTR_COMP_MASK) -/*! @} */ - -/*! @name EVENTEN - Event Enable */ -/*! @{ */ - -#define POWERQUAD_EVENTEN_EVENT_OFLOW_MASK (0x1U) -#define POWERQUAD_EVENTEN_EVENT_OFLOW_SHIFT (0U) -/*! EVENT_OFLOW - Event Trigger on Floating-point Overflow - * 0b0..Disable event trigger - * 0b1..Enable event trigger - */ -#define POWERQUAD_EVENTEN_EVENT_OFLOW(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_EVENTEN_EVENT_OFLOW_SHIFT)) & POWERQUAD_EVENTEN_EVENT_OFLOW_MASK) - -#define POWERQUAD_EVENTEN_EVENT_NAN_MASK (0x2U) -#define POWERQUAD_EVENTEN_EVENT_NAN_SHIFT (1U) -/*! EVENT_NAN - Event Trigger on Floating-Point NaN - * 0b0..Disable event trigger - * 0b1..Enable event trigger - */ -#define POWERQUAD_EVENTEN_EVENT_NAN(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_EVENTEN_EVENT_NAN_SHIFT)) & POWERQUAD_EVENTEN_EVENT_NAN_MASK) - -#define POWERQUAD_EVENTEN_EVENT_FIXED_MASK (0x4U) -#define POWERQUAD_EVENTEN_EVENT_FIXED_SHIFT (2U) -/*! EVENT_FIXED - Event Trigger on Fixed-point Overflow - * 0b0..Disable event trigger - * 0b1..Enable event trigger - */ -#define POWERQUAD_EVENTEN_EVENT_FIXED(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_EVENTEN_EVENT_FIXED_SHIFT)) & POWERQUAD_EVENTEN_EVENT_FIXED_MASK) - -#define POWERQUAD_EVENTEN_EVENT_UFLOW_MASK (0x8U) -#define POWERQUAD_EVENTEN_EVENT_UFLOW_SHIFT (3U) -/*! EVENT_UFLOW - Event Trigger on Underflow - * 0b0..Disable event trigger - * 0b1..Enable event trigger - */ -#define POWERQUAD_EVENTEN_EVENT_UFLOW(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_EVENTEN_EVENT_UFLOW_SHIFT)) & POWERQUAD_EVENTEN_EVENT_UFLOW_MASK) - -#define POWERQUAD_EVENTEN_EVENT_BERR_MASK (0x10U) -#define POWERQUAD_EVENTEN_EVENT_BERR_SHIFT (4U) -/*! EVENT_BERR - Event Trigger on AHBM Bus Error - * 0b0..Disable event trigger - * 0b1..Enable event trigger - */ -#define POWERQUAD_EVENTEN_EVENT_BERR(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_EVENTEN_EVENT_BERR_SHIFT)) & POWERQUAD_EVENTEN_EVENT_BERR_MASK) - -#define POWERQUAD_EVENTEN_EVENT_COMP_MASK (0x80U) -#define POWERQUAD_EVENTEN_EVENT_COMP_SHIFT (7U) -/*! EVENT_COMP - Event Trigger on Instruction Completion - * 0b0..Disable event trigger - * 0b1..Enable event trigger - */ -#define POWERQUAD_EVENTEN_EVENT_COMP(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_EVENTEN_EVENT_COMP_SHIFT)) & POWERQUAD_EVENTEN_EVENT_COMP_MASK) -/*! @} */ - -/*! @name INTRSTAT - Interrupt Status */ -/*! @{ */ - -#define POWERQUAD_INTRSTAT_INTR_STAT_MASK (0x1U) -#define POWERQUAD_INTRSTAT_INTR_STAT_SHIFT (0U) -/*! INTR_STAT - Interrupt Status - * 0b0..No new interrupt - * 0b1..Interrupt captured - */ -#define POWERQUAD_INTRSTAT_INTR_STAT(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_INTRSTAT_INTR_STAT_SHIFT)) & POWERQUAD_INTRSTAT_INTR_STAT_MASK) -/*! @} */ - -/*! @name GPREG - General Purpose Register Bank n */ -/*! @{ */ - -#define POWERQUAD_GPREG_GPREG_MASK (0xFFFFFFFFU) -#define POWERQUAD_GPREG_GPREG_SHIFT (0U) -/*! GPREG - General Purpose Bank */ -#define POWERQUAD_GPREG_GPREG(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_GPREG_GPREG_SHIFT)) & POWERQUAD_GPREG_GPREG_MASK) -/*! @} */ - -/* The count of POWERQUAD_GPREG */ -#define POWERQUAD_GPREG_COUNT (16U) - -/*! @name COMPREGS_COMPREG - Compute Register Bank n */ -/*! @{ */ - -#define POWERQUAD_COMPREGS_COMPREG_COMPREG_MASK (0xFFFFFFFFU) -#define POWERQUAD_COMPREGS_COMPREG_COMPREG_SHIFT (0U) -/*! COMPREG - Compute bank */ -#define POWERQUAD_COMPREGS_COMPREG_COMPREG(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_COMPREGS_COMPREG_COMPREG_SHIFT)) & POWERQUAD_COMPREGS_COMPREG_COMPREG_MASK) -/*! @} */ - -/* The count of POWERQUAD_COMPREGS_COMPREG */ -#define POWERQUAD_COMPREGS_COMPREG_COUNT (8U) - - -/*! - * @} - */ /* end of group POWERQUAD_Register_Masks */ - - -/* POWERQUAD - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral POWERQUAD base address */ - #define POWERQUAD_BASE (0x500BF000u) - /** Peripheral POWERQUAD base address */ - #define POWERQUAD_BASE_NS (0x400BF000u) - /** Peripheral POWERQUAD base pointer */ - #define POWERQUAD ((POWERQUAD_Type *)POWERQUAD_BASE) - /** Peripheral POWERQUAD base pointer */ - #define POWERQUAD_NS ((POWERQUAD_Type *)POWERQUAD_BASE_NS) - /** Array initializer of POWERQUAD peripheral base addresses */ - #define POWERQUAD_BASE_ADDRS { POWERQUAD_BASE } - /** Array initializer of POWERQUAD peripheral base pointers */ - #define POWERQUAD_BASE_PTRS { POWERQUAD } - /** Array initializer of POWERQUAD peripheral base addresses */ - #define POWERQUAD_BASE_ADDRS_NS { POWERQUAD_BASE_NS } - /** Array initializer of POWERQUAD peripheral base pointers */ - #define POWERQUAD_BASE_PTRS_NS { POWERQUAD_NS } -#else - /** Peripheral POWERQUAD base address */ - #define POWERQUAD_BASE (0x400BF000u) - /** Peripheral POWERQUAD base pointer */ - #define POWERQUAD ((POWERQUAD_Type *)POWERQUAD_BASE) - /** Array initializer of POWERQUAD peripheral base addresses */ - #define POWERQUAD_BASE_ADDRS { POWERQUAD_BASE } - /** Array initializer of POWERQUAD peripheral base pointers */ - #define POWERQUAD_BASE_PTRS { POWERQUAD } -#endif -/** Interrupt vectors for the POWERQUAD peripheral type */ -#define POWERQUAD_IRQS { PQ_IRQn } - -/*! - * @} - */ /* end of group POWERQUAD_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- PUF Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PUF_Peripheral_Access_Layer PUF Peripheral Access Layer - * @{ - */ - -/** PUF - Register Layout Typedef */ -typedef struct { - __IO uint32_t CR; /**< Control, offset: 0x0 */ - __I uint32_t ORR; /**< Operation Result, offset: 0x4 */ - __IO uint32_t SR; /**< Status, offset: 0x8 */ - __I uint32_t AR; /**< Allow, offset: 0xC */ - __IO uint32_t IER; /**< Interrupt Enable, offset: 0x10 */ - __IO uint32_t IMR; /**< Interrupt Mask, offset: 0x14 */ - __IO uint32_t ISR; /**< Interrupt Status, offset: 0x18 */ - uint8_t RESERVED_0[4]; - __IO uint32_t DATA_DEST; /**< Data Destination, offset: 0x20 */ - __IO uint32_t DATA_SRC; /**< Data Source, offset: 0x24 */ - uint8_t RESERVED_1[120]; - __O uint32_t DIR; /**< Data Input, offset: 0xA0 */ - uint8_t RESERVED_2[4]; - __I uint32_t DOR; /**< Data Output, offset: 0xA8 */ - uint8_t RESERVED_3[20]; - __IO uint32_t MISC; /**< Miscellaneous, offset: 0xC0 */ - uint8_t RESERVED_4[12]; - __IO uint32_t IF_SR; /**< Interface Status, offset: 0xD0 */ - uint8_t RESERVED_5[8]; - __I uint32_t PSR; /**< PUF Score, offset: 0xDC */ - __I uint32_t HW_RUC0; /**< Hardware Restrict User Context 0, offset: 0xE0 */ - __I uint32_t HW_RUC1; /**< Hardware Restrict User Context 1, offset: 0xE4 */ - uint8_t RESERVED_6[12]; - __I uint32_t HW_INFO; /**< Hardware Information, offset: 0xF4 */ - __I uint32_t HW_ID; /**< Hardware Identifier, offset: 0xF8 */ - __I uint32_t HW_VER; /**< Hardware Version, offset: 0xFC */ - __IO uint32_t CONFIG; /**< PUF command blocking configuration, offset: 0x100 */ - __IO uint32_t SEC_LOCK; /**< Security level lock, offset: 0x104 */ - __IO uint32_t APP_CTX_MASK; /**< Application defined context mask, offset: 0x108 */ - uint8_t RESERVED_7[500]; - __IO uint32_t SRAM_CFG; /**< SRAM Configuration, offset: 0x300 */ - __I uint32_t SRAM_STATUS; /**< Status, offset: 0x304 */ - uint8_t RESERVED_8[208]; - __O uint32_t SRAM_INT_CLR_ENABLE; /**< Interrupt Enable Clear, offset: 0x3D8 */ - __O uint32_t SRAM_INT_SET_ENABLE; /**< Interrupt Enable Set, offset: 0x3DC */ - __I uint32_t SRAM_INT_STATUS; /**< Interrupt Status, offset: 0x3E0 */ - __I uint32_t SRAM_INT_ENABLE; /**< Interrupt Enable, offset: 0x3E4 */ - __O uint32_t SRAM_INT_CLR_STATUS; /**< Interrupt Status Clear, offset: 0x3E8 */ - __O uint32_t SRAM_INT_SET_STATUS; /**< Interrupt Status set, offset: 0x3EC */ -} PUF_Type; - -/* ---------------------------------------------------------------------------- - -- PUF Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PUF_Register_Masks PUF Register Masks - * @{ - */ - -/*! @name CR - Control */ -/*! @{ */ - -#define PUF_CR_ZEROIZE_MASK (0x1U) -#define PUF_CR_ZEROIZE_SHIFT (0U) -/*! ZEROIZE - Zeroize operation */ -#define PUF_CR_ZEROIZE(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_ZEROIZE_SHIFT)) & PUF_CR_ZEROIZE_MASK) - -#define PUF_CR_ENROLL_MASK (0x2U) -#define PUF_CR_ENROLL_SHIFT (1U) -/*! ENROLL - Enroll operation */ -#define PUF_CR_ENROLL(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_ENROLL_SHIFT)) & PUF_CR_ENROLL_MASK) - -#define PUF_CR_START_MASK (0x4U) -#define PUF_CR_START_SHIFT (2U) -/*! START - Start operation */ -#define PUF_CR_START(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_START_SHIFT)) & PUF_CR_START_MASK) - -#define PUF_CR_RECONSTRUCT_MASK (0x8U) -#define PUF_CR_RECONSTRUCT_SHIFT (3U) -/*! RECONSTRUCT - Reconstruct operation */ -#define PUF_CR_RECONSTRUCT(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_RECONSTRUCT_SHIFT)) & PUF_CR_RECONSTRUCT_MASK) - -#define PUF_CR_STOP_MASK (0x20U) -#define PUF_CR_STOP_SHIFT (5U) -/*! STOP - Stop operation */ -#define PUF_CR_STOP(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_STOP_SHIFT)) & PUF_CR_STOP_MASK) - -#define PUF_CR_GET_KEY_MASK (0x40U) -#define PUF_CR_GET_KEY_SHIFT (6U) -/*! GET_KEY - Get Key operation */ -#define PUF_CR_GET_KEY(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_GET_KEY_SHIFT)) & PUF_CR_GET_KEY_MASK) - -#define PUF_CR_UNWRAP_MASK (0x80U) -#define PUF_CR_UNWRAP_SHIFT (7U) -/*! UNWRAP - Unwrap operation */ -#define PUF_CR_UNWRAP(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_UNWRAP_SHIFT)) & PUF_CR_UNWRAP_MASK) - -#define PUF_CR_WRAP_GENERATED_RANDOM_MASK (0x100U) -#define PUF_CR_WRAP_GENERATED_RANDOM_SHIFT (8U) -/*! WRAP_GENERATED_RANDOM - Wrap Generated Random operation */ -#define PUF_CR_WRAP_GENERATED_RANDOM(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_WRAP_GENERATED_RANDOM_SHIFT)) & PUF_CR_WRAP_GENERATED_RANDOM_MASK) - -#define PUF_CR_WRAP_MASK (0x200U) -#define PUF_CR_WRAP_SHIFT (9U) -/*! WRAP - Wrap operation */ -#define PUF_CR_WRAP(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_WRAP_SHIFT)) & PUF_CR_WRAP_MASK) - -#define PUF_CR_GENERATE_RANDOM_MASK (0x8000U) -#define PUF_CR_GENERATE_RANDOM_SHIFT (15U) -/*! GENERATE_RANDOM - Generate Random operation */ -#define PUF_CR_GENERATE_RANDOM(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_GENERATE_RANDOM_SHIFT)) & PUF_CR_GENERATE_RANDOM_MASK) - -#define PUF_CR_TEST_MEMORY_MASK (0x40000000U) -#define PUF_CR_TEST_MEMORY_SHIFT (30U) -/*! TEST_MEMORY - Test memory operation */ -#define PUF_CR_TEST_MEMORY(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_TEST_MEMORY_SHIFT)) & PUF_CR_TEST_MEMORY_MASK) - -#define PUF_CR_TEST_PUF_MASK (0x80000000U) -#define PUF_CR_TEST_PUF_SHIFT (31U) -/*! TEST_PUF - Test PUF operation */ -#define PUF_CR_TEST_PUF(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_TEST_PUF_SHIFT)) & PUF_CR_TEST_PUF_MASK) -/*! @} */ - -/*! @name ORR - Operation Result */ -/*! @{ */ - -#define PUF_ORR_RESULT_CODE_MASK (0xFFU) -#define PUF_ORR_RESULT_CODE_SHIFT (0U) -/*! RESULT_CODE - Result code of last operation - * 0b00000000..Indicates that the last operation was successful or operation is in progress. - * 0b11110000..Indicates that the AC is not for the current product/version. - * 0b11110001..Indicates that the AC in the second phase is not for the current product/version. - * 0b11110010..Indicates that the AC is corrupted. - * 0b11110011..Indicates that the AC in the second phase is corrupted. - * 0b11110100..Indicates that the authentication of the provided AC failed. - * 0b11110101..Indicates that the authentication of the provided AC failed in the second phase. - * 0b11110110..Indicates that the SRAM PUF quality verification fails. - * 0b11110111..Indicates that the incorrect or unsupported context is provided. - * 0b11111000..Indicates that a data destination was set that is not allowed according to other settings and the current PUF state. - * 0b11111111..Indicates that the PUF SRAM access has failed. - */ -#define PUF_ORR_RESULT_CODE(x) (((uint32_t)(((uint32_t)(x)) << PUF_ORR_RESULT_CODE_SHIFT)) & PUF_ORR_RESULT_CODE_MASK) - -#define PUF_ORR_LAST_OPERATION_MASK (0xFF000000U) -#define PUF_ORR_LAST_OPERATION_SHIFT (24U) -/*! LAST_OPERATION - Last operation type - * 0b00000000..Indicates that the operation is in progress. - * 0b00000001..Indicates that the last operation was Enroll. - * 0b00000010..Indicates that the last operation was Start. - * 0b00000011..Indicates that the last operation was Reconstruct - * 0b00000101..Indicates that the last operation was Stop. - * 0b00000110..Indicates that the last operation was Get Key. - * 0b00000111..Indicates that the last operation was Unwrap. - * 0b00001000..Indicates that the last operation was Wrap Generated Random. - * 0b00001001..Indicates that the last operation was Wrap. - * 0b00001111..Indicates that the last operation was Generate Random. - * 0b00011110..Indicates that the last operation was Test Memory. - * 0b00011111..Indicates that the last operation was Test PUF. - * 0b00100000..Indicates that the last operation was Initialization. - * 0b00101111..Indicates that the last operation was Zeroize. - */ -#define PUF_ORR_LAST_OPERATION(x) (((uint32_t)(((uint32_t)(x)) << PUF_ORR_LAST_OPERATION_SHIFT)) & PUF_ORR_LAST_OPERATION_MASK) -/*! @} */ - -/*! @name SR - Status */ -/*! @{ */ - -#define PUF_SR_BUSY_MASK (0x1U) -#define PUF_SR_BUSY_SHIFT (0U) -/*! BUSY - Operation in progress */ -#define PUF_SR_BUSY(x) (((uint32_t)(((uint32_t)(x)) << PUF_SR_BUSY_SHIFT)) & PUF_SR_BUSY_MASK) - -#define PUF_SR_OK_MASK (0x2U) -#define PUF_SR_OK_SHIFT (1U) -/*! OK - Last operation successful */ -#define PUF_SR_OK(x) (((uint32_t)(((uint32_t)(x)) << PUF_SR_OK_SHIFT)) & PUF_SR_OK_MASK) - -#define PUF_SR_ERROR_MASK (0x4U) -#define PUF_SR_ERROR_SHIFT (2U) -/*! ERROR - Last operation failed */ -#define PUF_SR_ERROR(x) (((uint32_t)(((uint32_t)(x)) << PUF_SR_ERROR_SHIFT)) & PUF_SR_ERROR_MASK) - -#define PUF_SR_ZEROIZED_MASK (0x8U) -#define PUF_SR_ZEROIZED_SHIFT (3U) -/*! ZEROIZED - Zeroized or Locked state */ -#define PUF_SR_ZEROIZED(x) (((uint32_t)(((uint32_t)(x)) << PUF_SR_ZEROIZED_SHIFT)) & PUF_SR_ZEROIZED_MASK) - -#define PUF_SR_REJECTED_MASK (0x10U) -#define PUF_SR_REJECTED_SHIFT (4U) -/*! REJECTED - Operation rejected */ -#define PUF_SR_REJECTED(x) (((uint32_t)(((uint32_t)(x)) << PUF_SR_REJECTED_SHIFT)) & PUF_SR_REJECTED_MASK) - -#define PUF_SR_DI_REQUEST_MASK (0x20U) -#define PUF_SR_DI_REQUEST_SHIFT (5U) -/*! DI_REQUEST - Indicates the request for data in transfer via the DIR register */ -#define PUF_SR_DI_REQUEST(x) (((uint32_t)(((uint32_t)(x)) << PUF_SR_DI_REQUEST_SHIFT)) & PUF_SR_DI_REQUEST_MASK) - -#define PUF_SR_DO_REQUEST_MASK (0x40U) -#define PUF_SR_DO_REQUEST_SHIFT (6U) -/*! DO_REQUEST - Indicates the request for data out transfer via the DOR register */ -#define PUF_SR_DO_REQUEST(x) (((uint32_t)(((uint32_t)(x)) << PUF_SR_DO_REQUEST_SHIFT)) & PUF_SR_DO_REQUEST_MASK) -/*! @} */ - -/*! @name AR - Allow */ -/*! @{ */ - -#define PUF_AR_ALLOW_ENROLL_MASK (0x2U) -#define PUF_AR_ALLOW_ENROLL_SHIFT (1U) -/*! ALLOW_ENROLL - Enroll operation - * 0b0..Indicates that the Enroll operation is not allowed - * 0b1..Indicates that the Enroll operation is allowed - */ -#define PUF_AR_ALLOW_ENROLL(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_ENROLL_SHIFT)) & PUF_AR_ALLOW_ENROLL_MASK) - -#define PUF_AR_ALLOW_START_MASK (0x4U) -#define PUF_AR_ALLOW_START_SHIFT (2U) -/*! ALLOW_START - Start operation - * 0b0..Indicates that the Start operation is not allowed - * 0b1..Indicates that the Start operation is allowed - */ -#define PUF_AR_ALLOW_START(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_START_SHIFT)) & PUF_AR_ALLOW_START_MASK) - -#define PUF_AR_ALLOW_RECONSTRUCT_MASK (0x8U) -#define PUF_AR_ALLOW_RECONSTRUCT_SHIFT (3U) -/*! ALLOW_RECONSTRUCT - Reconstruct operation - * 0b0..Indicates that the Reconstruct operation is not allowed - * 0b1..Indicates that the Reconstruct operation is allowed - */ -#define PUF_AR_ALLOW_RECONSTRUCT(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_RECONSTRUCT_SHIFT)) & PUF_AR_ALLOW_RECONSTRUCT_MASK) - -#define PUF_AR_ALLOW_STOP_MASK (0x20U) -#define PUF_AR_ALLOW_STOP_SHIFT (5U) -/*! ALLOW_STOP - Stop operation - * 0b0..Indicates that the Stop operation is not allowed - * 0b1..Indicates that the Stop operation is allowed - */ -#define PUF_AR_ALLOW_STOP(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_STOP_SHIFT)) & PUF_AR_ALLOW_STOP_MASK) - -#define PUF_AR_ALLOW_GET_KEY_MASK (0x40U) -#define PUF_AR_ALLOW_GET_KEY_SHIFT (6U) -/*! ALLOW_GET_KEY - Get Key operation - * 0b0..Indicates that the Get Key operation is not allowed - * 0b1..Indicates that the Get Key operation is allowed - */ -#define PUF_AR_ALLOW_GET_KEY(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_GET_KEY_SHIFT)) & PUF_AR_ALLOW_GET_KEY_MASK) - -#define PUF_AR_ALLOW_UNWRAP_MASK (0x80U) -#define PUF_AR_ALLOW_UNWRAP_SHIFT (7U) -/*! ALLOW_UNWRAP - Unwrap operation - * 0b0..Indicates that the Unwrap operation is not allowed - * 0b1..Indicates that the Unwrap operation is allowed - */ -#define PUF_AR_ALLOW_UNWRAP(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_UNWRAP_SHIFT)) & PUF_AR_ALLOW_UNWRAP_MASK) - -#define PUF_AR_ALLOW_WRAP_GENERATED_RANDOM_MASK (0x100U) -#define PUF_AR_ALLOW_WRAP_GENERATED_RANDOM_SHIFT (8U) -/*! ALLOW_WRAP_GENERATED_RANDOM - Wrap Generated Random operation - * 0b0..Indicates that the Wrap Generated Random operation is not allowed - * 0b1..Indicates that the Wrap Generated Random operation is allowed - */ -#define PUF_AR_ALLOW_WRAP_GENERATED_RANDOM(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_WRAP_GENERATED_RANDOM_SHIFT)) & PUF_AR_ALLOW_WRAP_GENERATED_RANDOM_MASK) - -#define PUF_AR_ALLOW_WRAP_MASK (0x200U) -#define PUF_AR_ALLOW_WRAP_SHIFT (9U) -/*! ALLOW_WRAP - Wrap operation - * 0b0..Indicates that the Wrap operation is not allowed - * 0b1..Indicates that the Wrap operation is allowed - */ -#define PUF_AR_ALLOW_WRAP(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_WRAP_SHIFT)) & PUF_AR_ALLOW_WRAP_MASK) - -#define PUF_AR_ALLOW_GENERATE_RANDOM_MASK (0x8000U) -#define PUF_AR_ALLOW_GENERATE_RANDOM_SHIFT (15U) -/*! ALLOW_GENERATE_RANDOM - Generate Random operation - * 0b0..Indicates that the Generate Random operation is not allowed - * 0b1..Indicates that the Generate Random operation is allowed - */ -#define PUF_AR_ALLOW_GENERATE_RANDOM(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_GENERATE_RANDOM_SHIFT)) & PUF_AR_ALLOW_GENERATE_RANDOM_MASK) - -#define PUF_AR_ALLOW_TEST_MEMORY_MASK (0x40000000U) -#define PUF_AR_ALLOW_TEST_MEMORY_SHIFT (30U) -/*! ALLOW_TEST_MEMORY - * 0b0..Indicates that the Test Memory operation is not allowed - * 0b1..Indicates that the Test Memory operation is allowed - */ -#define PUF_AR_ALLOW_TEST_MEMORY(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_TEST_MEMORY_SHIFT)) & PUF_AR_ALLOW_TEST_MEMORY_MASK) - -#define PUF_AR_ALLOW_TEST_PUF_MASK (0x80000000U) -#define PUF_AR_ALLOW_TEST_PUF_SHIFT (31U) -/*! ALLOW_TEST_PUF - Test PUF operation - * 0b0..Test PUF operation is not allowed - * 0b1..Test PUF operation is allowed - */ -#define PUF_AR_ALLOW_TEST_PUF(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_TEST_PUF_SHIFT)) & PUF_AR_ALLOW_TEST_PUF_MASK) -/*! @} */ - -/*! @name IER - Interrupt Enable */ -/*! @{ */ - -#define PUF_IER_INT_EN_MASK (0x1U) -#define PUF_IER_INT_EN_SHIFT (0U) -/*! INT_EN - Interrupt enable - * 0b0..Disables all PUF interrupts - * 0b1..Enables all PUF interrupts that are enabled in the Interrupt Mask register - */ -#define PUF_IER_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << PUF_IER_INT_EN_SHIFT)) & PUF_IER_INT_EN_MASK) -/*! @} */ - -/*! @name IMR - Interrupt Mask */ -/*! @{ */ - -#define PUF_IMR_INT_EN_BUSY_MASK (0x1U) -#define PUF_IMR_INT_EN_BUSY_SHIFT (0U) -/*! INT_EN_BUSY - Busy interrupt */ -#define PUF_IMR_INT_EN_BUSY(x) (((uint32_t)(((uint32_t)(x)) << PUF_IMR_INT_EN_BUSY_SHIFT)) & PUF_IMR_INT_EN_BUSY_MASK) - -#define PUF_IMR_INT_EN_OK_MASK (0x2U) -#define PUF_IMR_INT_EN_OK_SHIFT (1U) -/*! INT_EN_OK - Ok interrupt */ -#define PUF_IMR_INT_EN_OK(x) (((uint32_t)(((uint32_t)(x)) << PUF_IMR_INT_EN_OK_SHIFT)) & PUF_IMR_INT_EN_OK_MASK) - -#define PUF_IMR_INT_EN_ERROR_MASK (0x4U) -#define PUF_IMR_INT_EN_ERROR_SHIFT (2U) -/*! INT_EN_ERROR - Error interrupt */ -#define PUF_IMR_INT_EN_ERROR(x) (((uint32_t)(((uint32_t)(x)) << PUF_IMR_INT_EN_ERROR_SHIFT)) & PUF_IMR_INT_EN_ERROR_MASK) - -#define PUF_IMR_INT_EN_ZEROIZED_MASK (0x8U) -#define PUF_IMR_INT_EN_ZEROIZED_SHIFT (3U) -/*! INT_EN_ZEROIZED - Zeroized interrupt */ -#define PUF_IMR_INT_EN_ZEROIZED(x) (((uint32_t)(((uint32_t)(x)) << PUF_IMR_INT_EN_ZEROIZED_SHIFT)) & PUF_IMR_INT_EN_ZEROIZED_MASK) - -#define PUF_IMR_INT_EN_REJECTED_MASK (0x10U) -#define PUF_IMR_INT_EN_REJECTED_SHIFT (4U) -/*! INT_EN_REJECTED - Rejected interrupt */ -#define PUF_IMR_INT_EN_REJECTED(x) (((uint32_t)(((uint32_t)(x)) << PUF_IMR_INT_EN_REJECTED_SHIFT)) & PUF_IMR_INT_EN_REJECTED_MASK) - -#define PUF_IMR_INT_EN_DI_REQUEST_MASK (0x20U) -#define PUF_IMR_INT_EN_DI_REQUEST_SHIFT (5U) -/*! INT_EN_DI_REQUEST - Data in request interrupt */ -#define PUF_IMR_INT_EN_DI_REQUEST(x) (((uint32_t)(((uint32_t)(x)) << PUF_IMR_INT_EN_DI_REQUEST_SHIFT)) & PUF_IMR_INT_EN_DI_REQUEST_MASK) - -#define PUF_IMR_INT_EN_DO_REQUEST_MASK (0x40U) -#define PUF_IMR_INT_EN_DO_REQUEST_SHIFT (6U) -/*! INT_EN_DO_REQUEST - Data out request interrupt */ -#define PUF_IMR_INT_EN_DO_REQUEST(x) (((uint32_t)(((uint32_t)(x)) << PUF_IMR_INT_EN_DO_REQUEST_SHIFT)) & PUF_IMR_INT_EN_DO_REQUEST_MASK) -/*! @} */ - -/*! @name ISR - Interrupt Status */ -/*! @{ */ - -#define PUF_ISR_INT_BUSY_MASK (0x1U) -#define PUF_ISR_INT_BUSY_SHIFT (0U) -/*! INT_BUSY - Negative edge occurred on Busy */ -#define PUF_ISR_INT_BUSY(x) (((uint32_t)(((uint32_t)(x)) << PUF_ISR_INT_BUSY_SHIFT)) & PUF_ISR_INT_BUSY_MASK) - -#define PUF_ISR_INT_OK_MASK (0x2U) -#define PUF_ISR_INT_OK_SHIFT (1U) -/*! INT_OK - Positive edge occurred on Ok */ -#define PUF_ISR_INT_OK(x) (((uint32_t)(((uint32_t)(x)) << PUF_ISR_INT_OK_SHIFT)) & PUF_ISR_INT_OK_MASK) - -#define PUF_ISR_INT_ERROR_MASK (0x4U) -#define PUF_ISR_INT_ERROR_SHIFT (2U) -/*! INT_ERROR - Positive edge occurred on Error */ -#define PUF_ISR_INT_ERROR(x) (((uint32_t)(((uint32_t)(x)) << PUF_ISR_INT_ERROR_SHIFT)) & PUF_ISR_INT_ERROR_MASK) - -#define PUF_ISR_INT_ZEROIZED_MASK (0x8U) -#define PUF_ISR_INT_ZEROIZED_SHIFT (3U) -/*! INT_ZEROIZED - Positive edge occurred on Zeroized */ -#define PUF_ISR_INT_ZEROIZED(x) (((uint32_t)(((uint32_t)(x)) << PUF_ISR_INT_ZEROIZED_SHIFT)) & PUF_ISR_INT_ZEROIZED_MASK) - -#define PUF_ISR_INT_REJECTED_MASK (0x10U) -#define PUF_ISR_INT_REJECTED_SHIFT (4U) -/*! INT_REJECTED - Positive edge occurred on Rejected */ -#define PUF_ISR_INT_REJECTED(x) (((uint32_t)(((uint32_t)(x)) << PUF_ISR_INT_REJECTED_SHIFT)) & PUF_ISR_INT_REJECTED_MASK) - -#define PUF_ISR_INT_DI_REQUEST_MASK (0x20U) -#define PUF_ISR_INT_DI_REQUEST_SHIFT (5U) -/*! INT_DI_REQUEST - Positive edge occurred on di_request */ -#define PUF_ISR_INT_DI_REQUEST(x) (((uint32_t)(((uint32_t)(x)) << PUF_ISR_INT_DI_REQUEST_SHIFT)) & PUF_ISR_INT_DI_REQUEST_MASK) - -#define PUF_ISR_INT_DO_REQUEST_MASK (0x40U) -#define PUF_ISR_INT_DO_REQUEST_SHIFT (6U) -/*! INT_DO_REQUEST - Positive edge occurred on do_request */ -#define PUF_ISR_INT_DO_REQUEST(x) (((uint32_t)(((uint32_t)(x)) << PUF_ISR_INT_DO_REQUEST_SHIFT)) & PUF_ISR_INT_DO_REQUEST_MASK) -/*! @} */ - -/*! @name DATA_DEST - Data Destination */ -/*! @{ */ - -#define PUF_DATA_DEST_DEST_DOR_MASK (0x1U) -#define PUF_DATA_DEST_DEST_DOR_SHIFT (0U) -/*! DEST_DOR - Key available via the DOR register */ -#define PUF_DATA_DEST_DEST_DOR(x) (((uint32_t)(((uint32_t)(x)) << PUF_DATA_DEST_DEST_DOR_SHIFT)) & PUF_DATA_DEST_DEST_DOR_MASK) - -#define PUF_DATA_DEST_DEST_SO_MASK (0x2U) -#define PUF_DATA_DEST_DEST_SO_SHIFT (1U) -/*! DEST_SO - Key available to ELS */ -#define PUF_DATA_DEST_DEST_SO(x) (((uint32_t)(((uint32_t)(x)) << PUF_DATA_DEST_DEST_SO_SHIFT)) & PUF_DATA_DEST_DEST_SO_MASK) -/*! @} */ - -/*! @name DATA_SRC - Data Source */ -/*! @{ */ - -#define PUF_DATA_SRC_SRC_DIR_MASK (0x1U) -#define PUF_DATA_SRC_SRC_DIR_SHIFT (0U) -/*! SRC_DIR - Data provided via the DIR register */ -#define PUF_DATA_SRC_SRC_DIR(x) (((uint32_t)(((uint32_t)(x)) << PUF_DATA_SRC_SRC_DIR_SHIFT)) & PUF_DATA_SRC_SRC_DIR_MASK) - -#define PUF_DATA_SRC_SRC_SI_MASK (0x2U) -#define PUF_DATA_SRC_SRC_SI_SHIFT (1U) -/*! SRC_SI - Data provided via the SI interface */ -#define PUF_DATA_SRC_SRC_SI(x) (((uint32_t)(((uint32_t)(x)) << PUF_DATA_SRC_SRC_SI_SHIFT)) & PUF_DATA_SRC_SRC_SI_MASK) -/*! @} */ - -/*! @name DIR - Data Input */ -/*! @{ */ - -#define PUF_DIR_DI_MASK (0xFFFFFFFFU) -#define PUF_DIR_DI_SHIFT (0U) -/*! DI - Input data */ -#define PUF_DIR_DI(x) (((uint32_t)(((uint32_t)(x)) << PUF_DIR_DI_SHIFT)) & PUF_DIR_DI_MASK) -/*! @} */ - -/*! @name DOR - Data Output */ -/*! @{ */ - -#define PUF_DOR_DO_MASK (0xFFFFFFFFU) -#define PUF_DOR_DO_SHIFT (0U) -/*! DO - Output data */ -#define PUF_DOR_DO(x) (((uint32_t)(((uint32_t)(x)) << PUF_DOR_DO_SHIFT)) & PUF_DOR_DO_MASK) -/*! @} */ - -/*! @name MISC - Miscellaneous */ -/*! @{ */ - -#define PUF_MISC_DATA_ENDIANNESS_MASK (0x1U) -#define PUF_MISC_DATA_ENDIANNESS_SHIFT (0U) -/*! DATA_ENDIANNESS - Defines the endianness of data in DIR and DOR: - * 0b0..Little endian - * 0b1..Big endian (default) - */ -#define PUF_MISC_DATA_ENDIANNESS(x) (((uint32_t)(((uint32_t)(x)) << PUF_MISC_DATA_ENDIANNESS_SHIFT)) & PUF_MISC_DATA_ENDIANNESS_MASK) -/*! @} */ - -/*! @name IF_SR - Interface Status */ -/*! @{ */ - -#define PUF_IF_SR_APB_ERROR_MASK (0x1U) -#define PUF_IF_SR_APB_ERROR_SHIFT (0U) -/*! APB_ERROR - APB error */ -#define PUF_IF_SR_APB_ERROR(x) (((uint32_t)(((uint32_t)(x)) << PUF_IF_SR_APB_ERROR_SHIFT)) & PUF_IF_SR_APB_ERROR_MASK) -/*! @} */ - -/*! @name PSR - PUF Score */ -/*! @{ */ - -#define PUF_PSR_PUF_SCORE_MASK (0xFU) -#define PUF_PSR_PUF_SCORE_SHIFT (0U) -/*! PUF_SCORE - Provides the PUF score obtained during the last Test PUF, Enroll or Start operation. */ -#define PUF_PSR_PUF_SCORE(x) (((uint32_t)(((uint32_t)(x)) << PUF_PSR_PUF_SCORE_SHIFT)) & PUF_PSR_PUF_SCORE_MASK) -/*! @} */ - -/*! @name HW_RUC0 - Hardware Restrict User Context 0 */ -/*! @{ */ - -#define PUF_HW_RUC0_LC_STATE_MASK (0xFFU) -#define PUF_HW_RUC0_LC_STATE_SHIFT (0U) -/*! LC_STATE - Life cycle state based restrictions - * 0b00000011..OEM Develop - * 0b00000111..OEM Develop 2 - * 0b00001111..OEM In-field - * 0b00011111..OEM Field return - * 0b00111111..NXP Field Return/Failure Analysis - * 0b11001111..In-field Locked - * 0b11111111..Bricked - */ -#define PUF_HW_RUC0_LC_STATE(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_RUC0_LC_STATE_SHIFT)) & PUF_HW_RUC0_LC_STATE_MASK) - -#define PUF_HW_RUC0_BOOT_STATE_MASK (0xFFFF00U) -#define PUF_HW_RUC0_BOOT_STATE_SHIFT (8U) -/*! BOOT_STATE - Temporal boot state */ -#define PUF_HW_RUC0_BOOT_STATE(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_RUC0_BOOT_STATE_SHIFT)) & PUF_HW_RUC0_BOOT_STATE_MASK) - -#define PUF_HW_RUC0_CPU0_DEBUG_MASK (0x1000000U) -#define PUF_HW_RUC0_CPU0_DEBUG_SHIFT (24U) -/*! CPU0_DEBUG - Disable key access when debugger is attached to CPU0 after power-up */ -#define PUF_HW_RUC0_CPU0_DEBUG(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_RUC0_CPU0_DEBUG_SHIFT)) & PUF_HW_RUC0_CPU0_DEBUG_MASK) - -#define PUF_HW_RUC0_COOLFLUX_DEBUG_MASK (0x2000000U) -#define PUF_HW_RUC0_COOLFLUX_DEBUG_SHIFT (25U) -/*! COOLFLUX_DEBUG - Disable key access when debugger is attached to COOLFLUX after power-up */ -#define PUF_HW_RUC0_COOLFLUX_DEBUG(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_RUC0_COOLFLUX_DEBUG_SHIFT)) & PUF_HW_RUC0_COOLFLUX_DEBUG_MASK) - -#define PUF_HW_RUC0_dsp_debug_MASK (0x4000000U) -#define PUF_HW_RUC0_dsp_debug_SHIFT (26U) -/*! dsp_debug - DSP debug status. */ -#define PUF_HW_RUC0_dsp_debug(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_RUC0_dsp_debug_SHIFT)) & PUF_HW_RUC0_dsp_debug_MASK) - -#define PUF_HW_RUC0_ACCESS_LEVEL_MASK (0xF0000000U) -#define PUF_HW_RUC0_ACCESS_LEVEL_SHIFT (28U) -/*! ACCESS_LEVEL - Restrict the key access based on TrustZone security level */ -#define PUF_HW_RUC0_ACCESS_LEVEL(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_RUC0_ACCESS_LEVEL_SHIFT)) & PUF_HW_RUC0_ACCESS_LEVEL_MASK) -/*! @} */ - -/*! @name HW_RUC1 - Hardware Restrict User Context 1 */ -/*! @{ */ - -#define PUF_HW_RUC1_APP_CTX_MASK (0xFFFFFFFFU) -#define PUF_HW_RUC1_APP_CTX_SHIFT (0U) -/*! APP_CTX - Application customizable context */ -#define PUF_HW_RUC1_APP_CTX(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_RUC1_APP_CTX_SHIFT)) & PUF_HW_RUC1_APP_CTX_MASK) -/*! @} */ - -/*! @name HW_INFO - Hardware Information */ -/*! @{ */ - -#define PUF_HW_INFO_CONFIG_WRAP_MASK (0x1000000U) -#define PUF_HW_INFO_CONFIG_WRAP_SHIFT (24U) -/*! CONFIG_WRAP - Wrap configuration - * 0b0..Indicates that Wrap is not included - * 0b1..Indicates that Wrap is included - */ -#define PUF_HW_INFO_CONFIG_WRAP(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_INFO_CONFIG_WRAP_SHIFT)) & PUF_HW_INFO_CONFIG_WRAP_MASK) - -#define PUF_HW_INFO_CONFIG_TYPE_MASK (0xF0000000U) -#define PUF_HW_INFO_CONFIG_TYPE_SHIFT (28U) -/*! CONFIG_TYPE - PUF configuration - * 0b0001..Indicates that PUF configuration is Safe. - * 0b0010..Indicates that PUF configuration is Plus. - */ -#define PUF_HW_INFO_CONFIG_TYPE(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_INFO_CONFIG_TYPE_SHIFT)) & PUF_HW_INFO_CONFIG_TYPE_MASK) -/*! @} */ - -/*! @name HW_ID - Hardware Identifier */ -/*! @{ */ - -#define PUF_HW_ID_HW_ID_MASK (0xFFFFFFFFU) -#define PUF_HW_ID_HW_ID_SHIFT (0U) -/*! HW_ID - Provides the hardware identifier */ -#define PUF_HW_ID_HW_ID(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_ID_HW_ID_SHIFT)) & PUF_HW_ID_HW_ID_MASK) -/*! @} */ - -/*! @name HW_VER - Hardware Version */ -/*! @{ */ - -#define PUF_HW_VER_HW_REV_MASK (0xFFU) -#define PUF_HW_VER_HW_REV_SHIFT (0U) -/*! HW_REV - Provides the hardware version, patch part */ -#define PUF_HW_VER_HW_REV(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_VER_HW_REV_SHIFT)) & PUF_HW_VER_HW_REV_MASK) - -#define PUF_HW_VER_HW_VERSION_MINOR_MASK (0xFF00U) -#define PUF_HW_VER_HW_VERSION_MINOR_SHIFT (8U) -/*! HW_VERSION_MINOR - Provides the hardware version, minor part */ -#define PUF_HW_VER_HW_VERSION_MINOR(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_VER_HW_VERSION_MINOR_SHIFT)) & PUF_HW_VER_HW_VERSION_MINOR_MASK) - -#define PUF_HW_VER_HW_VERSION_MAJOR_MASK (0xFF0000U) -#define PUF_HW_VER_HW_VERSION_MAJOR_SHIFT (16U) -/*! HW_VERSION_MAJOR - Provides the hardware version, major part */ -#define PUF_HW_VER_HW_VERSION_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_VER_HW_VERSION_MAJOR_SHIFT)) & PUF_HW_VER_HW_VERSION_MAJOR_MASK) -/*! @} */ - -/*! @name CONFIG - PUF command blocking configuration */ -/*! @{ */ - -#define PUF_CONFIG_DIS_PUF_ENROLL_MASK (0x2U) -#define PUF_CONFIG_DIS_PUF_ENROLL_SHIFT (1U) -/*! DIS_PUF_ENROLL - Disable PUF enroll command - * 0b0..Command enabled - * 0b1..Command disabled - */ -#define PUF_CONFIG_DIS_PUF_ENROLL(x) (((uint32_t)(((uint32_t)(x)) << PUF_CONFIG_DIS_PUF_ENROLL_SHIFT)) & PUF_CONFIG_DIS_PUF_ENROLL_MASK) - -#define PUF_CONFIG_DIS_PUF_START_MASK (0x4U) -#define PUF_CONFIG_DIS_PUF_START_SHIFT (2U) -/*! DIS_PUF_START - Disable PUF start command - * 0b0..Command enabled - * 0b1..Command disabled - */ -#define PUF_CONFIG_DIS_PUF_START(x) (((uint32_t)(((uint32_t)(x)) << PUF_CONFIG_DIS_PUF_START_SHIFT)) & PUF_CONFIG_DIS_PUF_START_MASK) - -#define PUF_CONFIG_DIS_PUF_STOP_MASK (0x20U) -#define PUF_CONFIG_DIS_PUF_STOP_SHIFT (5U) -/*! DIS_PUF_STOP - Disable PUF stop command - * 0b0..Command enabled - * 0b1..Command disabled - */ -#define PUF_CONFIG_DIS_PUF_STOP(x) (((uint32_t)(((uint32_t)(x)) << PUF_CONFIG_DIS_PUF_STOP_SHIFT)) & PUF_CONFIG_DIS_PUF_STOP_MASK) - -#define PUF_CONFIG_DIS_PUF_GET_KEY_MASK (0x40U) -#define PUF_CONFIG_DIS_PUF_GET_KEY_SHIFT (6U) -/*! DIS_PUF_GET_KEY - Disable PUF get key command - * 0b0..Command enabled - * 0b1..Command disabled - */ -#define PUF_CONFIG_DIS_PUF_GET_KEY(x) (((uint32_t)(((uint32_t)(x)) << PUF_CONFIG_DIS_PUF_GET_KEY_SHIFT)) & PUF_CONFIG_DIS_PUF_GET_KEY_MASK) - -#define PUF_CONFIG_DIS_PUF_UNWRAP_KEY_MASK (0x80U) -#define PUF_CONFIG_DIS_PUF_UNWRAP_KEY_SHIFT (7U) -/*! DIS_PUF_UNWRAP_KEY - Disable PUF unwrap key command - * 0b0..Command enabled - * 0b1..Command disabled - */ -#define PUF_CONFIG_DIS_PUF_UNWRAP_KEY(x) (((uint32_t)(((uint32_t)(x)) << PUF_CONFIG_DIS_PUF_UNWRAP_KEY_SHIFT)) & PUF_CONFIG_DIS_PUF_UNWRAP_KEY_MASK) - -#define PUF_CONFIG_DIS_PUF_GEN_WRAP_KEY_MASK (0x100U) -#define PUF_CONFIG_DIS_PUF_GEN_WRAP_KEY_SHIFT (8U) -/*! DIS_PUF_GEN_WRAP_KEY - Disable PUF generate and wrap key command - * 0b0..Command enabled - * 0b1..Command disabled - */ -#define PUF_CONFIG_DIS_PUF_GEN_WRAP_KEY(x) (((uint32_t)(((uint32_t)(x)) << PUF_CONFIG_DIS_PUF_GEN_WRAP_KEY_SHIFT)) & PUF_CONFIG_DIS_PUF_GEN_WRAP_KEY_MASK) - -#define PUF_CONFIG_DIS_PUF_WRAP_KEY_MASK (0x200U) -#define PUF_CONFIG_DIS_PUF_WRAP_KEY_SHIFT (9U) -/*! DIS_PUF_WRAP_KEY - Disable PUF wrap key command - * 0b0..Command enabled - * 0b1..Command disabled - */ -#define PUF_CONFIG_DIS_PUF_WRAP_KEY(x) (((uint32_t)(((uint32_t)(x)) << PUF_CONFIG_DIS_PUF_WRAP_KEY_SHIFT)) & PUF_CONFIG_DIS_PUF_WRAP_KEY_MASK) - -#define PUF_CONFIG_DIS_PUF_GEN_RANDOM_NUMBER_MASK (0x8000U) -#define PUF_CONFIG_DIS_PUF_GEN_RANDOM_NUMBER_SHIFT (15U) -/*! DIS_PUF_GEN_RANDOM_NUMBER - Disable PUF generate and wrap key command - * 0b0..Command enabled - * 0b1..Command disabled - */ -#define PUF_CONFIG_DIS_PUF_GEN_RANDOM_NUMBER(x) (((uint32_t)(((uint32_t)(x)) << PUF_CONFIG_DIS_PUF_GEN_RANDOM_NUMBER_SHIFT)) & PUF_CONFIG_DIS_PUF_GEN_RANDOM_NUMBER_MASK) - -#define PUF_CONFIG_DIS_PUF_TEST_MASK (0x80000000U) -#define PUF_CONFIG_DIS_PUF_TEST_SHIFT (31U) -/*! DIS_PUF_TEST - Disable PUF test command - * 0b0..Command enabled - * 0b1..Command disabled - */ -#define PUF_CONFIG_DIS_PUF_TEST(x) (((uint32_t)(((uint32_t)(x)) << PUF_CONFIG_DIS_PUF_TEST_SHIFT)) & PUF_CONFIG_DIS_PUF_TEST_MASK) -/*! @} */ - -/*! @name SEC_LOCK - Security level lock */ -/*! @{ */ - -#define PUF_SEC_LOCK_SEC_LEVEL_MASK (0x3U) -#define PUF_SEC_LOCK_SEC_LEVEL_SHIFT (0U) -/*! SEC_LEVEL - Security Level - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define PUF_SEC_LOCK_SEC_LEVEL(x) (((uint32_t)(((uint32_t)(x)) << PUF_SEC_LOCK_SEC_LEVEL_SHIFT)) & PUF_SEC_LOCK_SEC_LEVEL_MASK) - -#define PUF_SEC_LOCK_ANTI_POLE_SEC_LEVEL_MASK (0xCU) -#define PUF_SEC_LOCK_ANTI_POLE_SEC_LEVEL_SHIFT (2U) -/*! ANTI_POLE_SEC_LEVEL - Anti-pole of security level - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define PUF_SEC_LOCK_ANTI_POLE_SEC_LEVEL(x) (((uint32_t)(((uint32_t)(x)) << PUF_SEC_LOCK_ANTI_POLE_SEC_LEVEL_SHIFT)) & PUF_SEC_LOCK_ANTI_POLE_SEC_LEVEL_MASK) - -#define PUF_SEC_LOCK_PATTERN_MASK (0xFFF0U) -#define PUF_SEC_LOCK_PATTERN_SHIFT (4U) -/*! PATTERN - Pattern */ -#define PUF_SEC_LOCK_PATTERN(x) (((uint32_t)(((uint32_t)(x)) << PUF_SEC_LOCK_PATTERN_SHIFT)) & PUF_SEC_LOCK_PATTERN_MASK) -/*! @} */ - -/*! @name APP_CTX_MASK - Application defined context mask */ -/*! @{ */ - -#define PUF_APP_CTX_MASK_APP_CTX_MASK_MASK (0xFFFFFFFFU) -#define PUF_APP_CTX_MASK_APP_CTX_MASK_SHIFT (0U) -/*! APP_CTX_MASK - Application defined context */ -#define PUF_APP_CTX_MASK_APP_CTX_MASK(x) (((uint32_t)(((uint32_t)(x)) << PUF_APP_CTX_MASK_APP_CTX_MASK_SHIFT)) & PUF_APP_CTX_MASK_APP_CTX_MASK_MASK) -/*! @} */ - -/*! @name SRAM_CFG - SRAM Configuration */ -/*! @{ */ - -#define PUF_SRAM_CFG_ENABLE_MASK (0x1U) -#define PUF_SRAM_CFG_ENABLE_SHIFT (0U) -/*! ENABLE - PUF SRAM Controller activation - * 0b0..Disabled - * 0b1..Enabled - */ -#define PUF_SRAM_CFG_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_CFG_ENABLE_SHIFT)) & PUF_SRAM_CFG_ENABLE_MASK) - -#define PUF_SRAM_CFG_CKGATING_MASK (0x4U) -#define PUF_SRAM_CFG_CKGATING_SHIFT (2U) -/*! CKGATING - PUF SRAM Clock Gating control - * 0b0..Disabled - * 0b1..Enabled - */ -#define PUF_SRAM_CFG_CKGATING(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_CFG_CKGATING_SHIFT)) & PUF_SRAM_CFG_CKGATING_MASK) -/*! @} */ - -/*! @name SRAM_STATUS - Status */ -/*! @{ */ - -#define PUF_SRAM_STATUS_READY_MASK (0x1U) -#define PUF_SRAM_STATUS_READY_SHIFT (0U) -/*! READY - PUF SRAM Controller State */ -#define PUF_SRAM_STATUS_READY(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_STATUS_READY_SHIFT)) & PUF_SRAM_STATUS_READY_MASK) -/*! @} */ - -/*! @name SRAM_INT_CLR_ENABLE - Interrupt Enable Clear */ -/*! @{ */ - -#define PUF_SRAM_INT_CLR_ENABLE_READY_MASK (0x1U) -#define PUF_SRAM_INT_CLR_ENABLE_READY_SHIFT (0U) -/*! READY - READY Interrupt Enable clear */ -#define PUF_SRAM_INT_CLR_ENABLE_READY(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_CLR_ENABLE_READY_SHIFT)) & PUF_SRAM_INT_CLR_ENABLE_READY_MASK) - -#define PUF_SRAM_INT_CLR_ENABLE_APB_ERR_MASK (0x2U) -#define PUF_SRAM_INT_CLR_ENABLE_APB_ERR_SHIFT (1U) -/*! APB_ERR - APB_ERR Interrupt Enable clear */ -#define PUF_SRAM_INT_CLR_ENABLE_APB_ERR(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_CLR_ENABLE_APB_ERR_SHIFT)) & PUF_SRAM_INT_CLR_ENABLE_APB_ERR_MASK) -/*! @} */ - -/*! @name SRAM_INT_SET_ENABLE - Interrupt Enable Set */ -/*! @{ */ - -#define PUF_SRAM_INT_SET_ENABLE_READY_MASK (0x1U) -#define PUF_SRAM_INT_SET_ENABLE_READY_SHIFT (0U) -/*! READY - READY Interrupt Enable set */ -#define PUF_SRAM_INT_SET_ENABLE_READY(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_SET_ENABLE_READY_SHIFT)) & PUF_SRAM_INT_SET_ENABLE_READY_MASK) - -#define PUF_SRAM_INT_SET_ENABLE_APB_ERR_MASK (0x2U) -#define PUF_SRAM_INT_SET_ENABLE_APB_ERR_SHIFT (1U) -/*! APB_ERR - APB_ERR Interrupt Enable set */ -#define PUF_SRAM_INT_SET_ENABLE_APB_ERR(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_SET_ENABLE_APB_ERR_SHIFT)) & PUF_SRAM_INT_SET_ENABLE_APB_ERR_MASK) -/*! @} */ - -/*! @name SRAM_INT_STATUS - Interrupt Status */ -/*! @{ */ - -#define PUF_SRAM_INT_STATUS_READY_MASK (0x1U) -#define PUF_SRAM_INT_STATUS_READY_SHIFT (0U) -/*! READY - READY Interrupt Status */ -#define PUF_SRAM_INT_STATUS_READY(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_STATUS_READY_SHIFT)) & PUF_SRAM_INT_STATUS_READY_MASK) - -#define PUF_SRAM_INT_STATUS_APB_ERR_MASK (0x2U) -#define PUF_SRAM_INT_STATUS_APB_ERR_SHIFT (1U) -/*! APB_ERR - APB_ERR Interrupt Status */ -#define PUF_SRAM_INT_STATUS_APB_ERR(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_STATUS_APB_ERR_SHIFT)) & PUF_SRAM_INT_STATUS_APB_ERR_MASK) -/*! @} */ - -/*! @name SRAM_INT_ENABLE - Interrupt Enable */ -/*! @{ */ - -#define PUF_SRAM_INT_ENABLE_READY_MASK (0x1U) -#define PUF_SRAM_INT_ENABLE_READY_SHIFT (0U) -/*! READY - READY Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define PUF_SRAM_INT_ENABLE_READY(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_ENABLE_READY_SHIFT)) & PUF_SRAM_INT_ENABLE_READY_MASK) - -#define PUF_SRAM_INT_ENABLE_SRAM_APB_ERR_MASK (0x2U) -#define PUF_SRAM_INT_ENABLE_SRAM_APB_ERR_SHIFT (1U) -/*! SRAM_APB_ERR - APB_ERR Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define PUF_SRAM_INT_ENABLE_SRAM_APB_ERR(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_ENABLE_SRAM_APB_ERR_SHIFT)) & PUF_SRAM_INT_ENABLE_SRAM_APB_ERR_MASK) -/*! @} */ - -/*! @name SRAM_INT_CLR_STATUS - Interrupt Status Clear */ -/*! @{ */ - -#define PUF_SRAM_INT_CLR_STATUS_READY_MASK (0x1U) -#define PUF_SRAM_INT_CLR_STATUS_READY_SHIFT (0U) -/*! READY - READY Interrupt Status clear */ -#define PUF_SRAM_INT_CLR_STATUS_READY(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_CLR_STATUS_READY_SHIFT)) & PUF_SRAM_INT_CLR_STATUS_READY_MASK) - -#define PUF_SRAM_INT_CLR_STATUS_APB_ERR_MASK (0x2U) -#define PUF_SRAM_INT_CLR_STATUS_APB_ERR_SHIFT (1U) -/*! APB_ERR - APB_ERR Interrupt Status Clear - * 0b0..No effect - * 0b1..Clears the APB_ERR bit field in register INT_STATUS. Automatically reset by the Hardware - */ -#define PUF_SRAM_INT_CLR_STATUS_APB_ERR(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_CLR_STATUS_APB_ERR_SHIFT)) & PUF_SRAM_INT_CLR_STATUS_APB_ERR_MASK) -/*! @} */ - -/*! @name SRAM_INT_SET_STATUS - Interrupt Status set */ -/*! @{ */ - -#define PUF_SRAM_INT_SET_STATUS_READY_MASK (0x1U) -#define PUF_SRAM_INT_SET_STATUS_READY_SHIFT (0U) -/*! READY - READY Interrupt Status set */ -#define PUF_SRAM_INT_SET_STATUS_READY(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_SET_STATUS_READY_SHIFT)) & PUF_SRAM_INT_SET_STATUS_READY_MASK) - -#define PUF_SRAM_INT_SET_STATUS_APB_ERR_MASK (0x2U) -#define PUF_SRAM_INT_SET_STATUS_APB_ERR_SHIFT (1U) -/*! APB_ERR - APB_ERR Interrupt Status Set - * 0b0..No effect - * 0b1..Clears the APB_ERR bit field in register INT_STATUS. Automatically reset by the Hardware - */ -#define PUF_SRAM_INT_SET_STATUS_APB_ERR(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_SET_STATUS_APB_ERR_SHIFT)) & PUF_SRAM_INT_SET_STATUS_APB_ERR_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group PUF_Register_Masks */ - - -/* PUF - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral PUF base address */ - #define PUF_BASE (0x5002C000u) - /** Peripheral PUF base address */ - #define PUF_BASE_NS (0x4002C000u) - /** Peripheral PUF base pointer */ - #define PUF ((PUF_Type *)PUF_BASE) - /** Peripheral PUF base pointer */ - #define PUF_NS ((PUF_Type *)PUF_BASE_NS) - /** Peripheral PUF_ALIAS1 base address */ - #define PUF_ALIAS1_BASE (0x5002D000u) - /** Peripheral PUF_ALIAS1 base address */ - #define PUF_ALIAS1_BASE_NS (0x4002D000u) - /** Peripheral PUF_ALIAS1 base pointer */ - #define PUF_ALIAS1 ((PUF_Type *)PUF_ALIAS1_BASE) - /** Peripheral PUF_ALIAS1 base pointer */ - #define PUF_ALIAS1_NS ((PUF_Type *)PUF_ALIAS1_BASE_NS) - /** Peripheral PUF_ALIAS2 base address */ - #define PUF_ALIAS2_BASE (0x5002E000u) - /** Peripheral PUF_ALIAS2 base address */ - #define PUF_ALIAS2_BASE_NS (0x4002E000u) - /** Peripheral PUF_ALIAS2 base pointer */ - #define PUF_ALIAS2 ((PUF_Type *)PUF_ALIAS2_BASE) - /** Peripheral PUF_ALIAS2 base pointer */ - #define PUF_ALIAS2_NS ((PUF_Type *)PUF_ALIAS2_BASE_NS) - /** Peripheral PUF_ALIAS3 base address */ - #define PUF_ALIAS3_BASE (0x5002F000u) - /** Peripheral PUF_ALIAS3 base address */ - #define PUF_ALIAS3_BASE_NS (0x4002F000u) - /** Peripheral PUF_ALIAS3 base pointer */ - #define PUF_ALIAS3 ((PUF_Type *)PUF_ALIAS3_BASE) - /** Peripheral PUF_ALIAS3 base pointer */ - #define PUF_ALIAS3_NS ((PUF_Type *)PUF_ALIAS3_BASE_NS) - /** Array initializer of PUF peripheral base addresses */ - #define PUF_BASE_ADDRS { PUF_BASE, PUF_ALIAS1_BASE, PUF_ALIAS2_BASE, PUF_ALIAS3_BASE } - /** Array initializer of PUF peripheral base pointers */ - #define PUF_BASE_PTRS { PUF, PUF_ALIAS1, PUF_ALIAS2, PUF_ALIAS3 } - /** Array initializer of PUF peripheral base addresses */ - #define PUF_BASE_ADDRS_NS { PUF_BASE_NS, PUF_ALIAS1_BASE_NS, PUF_ALIAS2_BASE_NS, PUF_ALIAS3_BASE_NS } - /** Array initializer of PUF peripheral base pointers */ - #define PUF_BASE_PTRS_NS { PUF_NS, PUF_ALIAS1_NS, PUF_ALIAS2_NS, PUF_ALIAS3_NS } -#else - /** Peripheral PUF base address */ - #define PUF_BASE (0x4002C000u) - /** Peripheral PUF base pointer */ - #define PUF ((PUF_Type *)PUF_BASE) - /** Peripheral PUF_ALIAS1 base address */ - #define PUF_ALIAS1_BASE (0x4002D000u) - /** Peripheral PUF_ALIAS1 base pointer */ - #define PUF_ALIAS1 ((PUF_Type *)PUF_ALIAS1_BASE) - /** Peripheral PUF_ALIAS2 base address */ - #define PUF_ALIAS2_BASE (0x4002E000u) - /** Peripheral PUF_ALIAS2 base pointer */ - #define PUF_ALIAS2 ((PUF_Type *)PUF_ALIAS2_BASE) - /** Peripheral PUF_ALIAS3 base address */ - #define PUF_ALIAS3_BASE (0x4002F000u) - /** Peripheral PUF_ALIAS3 base pointer */ - #define PUF_ALIAS3 ((PUF_Type *)PUF_ALIAS3_BASE) - /** Array initializer of PUF peripheral base addresses */ - #define PUF_BASE_ADDRS { PUF_BASE, PUF_ALIAS1_BASE, PUF_ALIAS2_BASE, PUF_ALIAS3_BASE } - /** Array initializer of PUF peripheral base pointers */ - #define PUF_BASE_PTRS { PUF, PUF_ALIAS1, PUF_ALIAS2, PUF_ALIAS3 } -#endif - -/*! - * @} - */ /* end of group PUF_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- PWM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PWM_Peripheral_Access_Layer PWM Peripheral Access Layer - * @{ - */ - -/** PWM - Register Layout Typedef */ -typedef struct { - struct { /* offset: 0x0, array step: 0x60 */ - __I uint16_t CNT; /**< Counter Register, array offset: 0x0, array step: 0x60 */ - __IO uint16_t INIT; /**< Initial Count Register, array offset: 0x2, array step: 0x60 */ - __IO uint16_t CTRL2; /**< Control 2 Register, array offset: 0x4, array step: 0x60 */ - __IO uint16_t CTRL; /**< Control Register, array offset: 0x6, array step: 0x60 */ - uint8_t RESERVED_0[2]; - __IO uint16_t VAL0; /**< Value Register 0, array offset: 0xA, array step: 0x60 */ - __IO uint16_t FRACVAL1; /**< Fractional Value Register 1, array offset: 0xC, array step: 0x60 */ - __IO uint16_t VAL1; /**< Value Register 1, array offset: 0xE, array step: 0x60 */ - __IO uint16_t FRACVAL2; /**< Fractional Value Register 2, array offset: 0x10, array step: 0x60 */ - __IO uint16_t VAL2; /**< Value Register 2, array offset: 0x12, array step: 0x60 */ - __IO uint16_t FRACVAL3; /**< Fractional Value Register 3, array offset: 0x14, array step: 0x60 */ - __IO uint16_t VAL3; /**< Value Register 3, array offset: 0x16, array step: 0x60 */ - __IO uint16_t FRACVAL4; /**< Fractional Value Register 4, array offset: 0x18, array step: 0x60 */ - __IO uint16_t VAL4; /**< Value Register 4, array offset: 0x1A, array step: 0x60 */ - __IO uint16_t FRACVAL5; /**< Fractional Value Register 5, array offset: 0x1C, array step: 0x60 */ - __IO uint16_t VAL5; /**< Value Register 5, array offset: 0x1E, array step: 0x60 */ - __IO uint16_t FRCTRL; /**< Fractional Control Register, array offset: 0x20, array step: 0x60 */ - __IO uint16_t OCTRL; /**< Output Control Register, array offset: 0x22, array step: 0x60 */ - __IO uint16_t STS; /**< Status Register, array offset: 0x24, array step: 0x60 */ - __IO uint16_t INTEN; /**< Interrupt Enable Register, array offset: 0x26, array step: 0x60 */ - __IO uint16_t DMAEN; /**< DMA Enable Register, array offset: 0x28, array step: 0x60 */ - __IO uint16_t TCTRL; /**< Output Trigger Control Register, array offset: 0x2A, array step: 0x60 */ - __IO uint16_t DISMAP[1]; /**< Fault Disable Mapping Register 0, array offset: 0x2C, array step: index*0x60, index2*0x2 */ - uint8_t RESERVED_1[2]; - __IO uint16_t DTCNT0; /**< Deadtime Count Register 0, array offset: 0x30, array step: 0x60 */ - __IO uint16_t DTCNT1; /**< Deadtime Count Register 1, array offset: 0x32, array step: 0x60 */ - __IO uint16_t CAPTCTRLA; /**< Capture Control A Register, array offset: 0x34, array step: 0x60 */ - __IO uint16_t CAPTCOMPA; /**< Capture Compare A Register, array offset: 0x36, array step: 0x60 */ - __IO uint16_t CAPTCTRLB; /**< Capture Control B Register, array offset: 0x38, array step: 0x60 */ - __IO uint16_t CAPTCOMPB; /**< Capture Compare B Register, array offset: 0x3A, array step: 0x60 */ - __IO uint16_t CAPTCTRLX; /**< Capture Control X Register, array offset: 0x3C, array step: 0x60 */ - __IO uint16_t CAPTCOMPX; /**< Capture Compare X Register, array offset: 0x3E, array step: 0x60 */ - __I uint16_t CVAL0; /**< Capture Value 0 Register, array offset: 0x40, array step: 0x60 */ - __I uint16_t CVAL0CYC; /**< Capture Value 0 Cycle Register, array offset: 0x42, array step: 0x60 */ - __I uint16_t CVAL1; /**< Capture Value 1 Register, array offset: 0x44, array step: 0x60 */ - __I uint16_t CVAL1CYC; /**< Capture Value 1 Cycle Register, array offset: 0x46, array step: 0x60 */ - __I uint16_t CVAL2; /**< Capture Value 2 Register, array offset: 0x48, array step: 0x60 */ - __I uint16_t CVAL2CYC; /**< Capture Value 2 Cycle Register, array offset: 0x4A, array step: 0x60 */ - __I uint16_t CVAL3; /**< Capture Value 3 Register, array offset: 0x4C, array step: 0x60 */ - __I uint16_t CVAL3CYC; /**< Capture Value 3 Cycle Register, array offset: 0x4E, array step: 0x60 */ - __I uint16_t CVAL4; /**< Capture Value 4 Register, array offset: 0x50, array step: 0x60 */ - __I uint16_t CVAL4CYC; /**< Capture Value 4 Cycle Register, array offset: 0x52, array step: 0x60 */ - __I uint16_t CVAL5; /**< Capture Value 5 Register, array offset: 0x54, array step: 0x60 */ - __I uint16_t CVAL5CYC; /**< Capture Value 5 Cycle Register, array offset: 0x56, array step: 0x60 */ - __IO uint16_t PHASEDLY; /**< Phase Delay Register, array offset: 0x58, array step: 0x60, valid indices: [1-3] */ - __IO uint16_t CAPTFILTA; /**< Capture PWM_A Input Filter Register, array offset: 0x5A, array step: 0x60 */ - __IO uint16_t CAPTFILTB; /**< Capture PWM_B Input Filter Register, array offset: 0x5C, array step: 0x60 */ - __IO uint16_t CAPTFILTX; /**< Capture PWM_X Input Filter Register, array offset: 0x5E, array step: 0x60 */ - } SM[4]; - __IO uint16_t OUTEN; /**< Output Enable Register, offset: 0x180 */ - __IO uint16_t MASK; /**< Mask Register, offset: 0x182 */ - __IO uint16_t SWCOUT; /**< Software Controlled Output Register, offset: 0x184 */ - __IO uint16_t DTSRCSEL; /**< PWM Source Select Register, offset: 0x186 */ - __IO uint16_t MCTRL; /**< Master Control Register, offset: 0x188 */ - __IO uint16_t MCTRL2; /**< Master Control 2 Register, offset: 0x18A */ - __IO uint16_t FCTRL; /**< Fault Control Register, offset: 0x18C */ - __IO uint16_t FSTS; /**< Fault Status Register, offset: 0x18E */ - __IO uint16_t FFILT; /**< Fault Filter Register, offset: 0x190 */ - __IO uint16_t FTST; /**< Fault Test Register, offset: 0x192 */ - __IO uint16_t FCTRL2; /**< Fault Control 2 Register, offset: 0x194 */ -} PWM_Type; - -/* ---------------------------------------------------------------------------- - -- PWM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PWM_Register_Masks PWM Register Masks - * @{ - */ - -/*! @name CNT - Counter Register */ -/*! @{ */ - -#define PWM_CNT_CNT_MASK (0xFFFFU) -#define PWM_CNT_CNT_SHIFT (0U) -/*! CNT - Counter Register Bits */ -#define PWM_CNT_CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CNT_CNT_SHIFT)) & PWM_CNT_CNT_MASK) -/*! @} */ - -/* The count of PWM_CNT */ -#define PWM_CNT_COUNT (4U) - -/*! @name INIT - Initial Count Register */ -/*! @{ */ - -#define PWM_INIT_INIT_MASK (0xFFFFU) -#define PWM_INIT_INIT_SHIFT (0U) -/*! INIT - Initial Count Register Bits */ -#define PWM_INIT_INIT(x) (((uint16_t)(((uint16_t)(x)) << PWM_INIT_INIT_SHIFT)) & PWM_INIT_INIT_MASK) -/*! @} */ - -/* The count of PWM_INIT */ -#define PWM_INIT_COUNT (4U) - -/*! @name CTRL2 - Control 2 Register */ -/*! @{ */ - -#define PWM_CTRL2_CLK_SEL_MASK (0x3U) -#define PWM_CTRL2_CLK_SEL_SHIFT (0U) -/*! CLK_SEL - Clock Source Select - * 0b00..The IPBus clock is used as the clock for the local prescaler and counter. - * 0b01..EXT_CLK is used as the clock for the local prescaler and counter. - * 0b10..Submodule 0's clock (AUX_CLK) is used as the source clock for the local prescaler and counter. This - * setting should not be used in submodule 0 as it forces the clock to logic 0. - * 0b11..Reserved - */ -#define PWM_CTRL2_CLK_SEL(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_CLK_SEL_SHIFT)) & PWM_CTRL2_CLK_SEL_MASK) - -#define PWM_CTRL2_RELOAD_SEL_MASK (0x4U) -#define PWM_CTRL2_RELOAD_SEL_SHIFT (2U) -/*! RELOAD_SEL - Reload Source Select - * 0b0..The local RELOAD signal is used to reload registers. - * 0b1..The master RELOAD signal (from submodule 0) is used to reload registers. This setting should not be used - * in submodule 0 as it forces the RELOAD signal to logic 0. - */ -#define PWM_CTRL2_RELOAD_SEL(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_RELOAD_SEL_SHIFT)) & PWM_CTRL2_RELOAD_SEL_MASK) - -#define PWM_CTRL2_FORCE_SEL_MASK (0x38U) -#define PWM_CTRL2_FORCE_SEL_SHIFT (3U) -/*! FORCE_SEL - Force Select - * 0b000..The local force signal, CTRL2[FORCE], from this submodule is used to force updates. - * 0b001..The master force signal from submodule 0 is used to force updates. This setting should not be used in - * submodule 0 as it holds the FORCE OUTPUT signal to logic 0. - * 0b010..The local reload signal from this submodule is used to force updates without regard to the state of LDOK. - * 0b011..The master reload signal from submodule0 is used to force updates if LDOK is set. This setting should - * not be used in submodule0 as it holds the FORCE OUTPUT signal to logic 0. - * 0b100..The local sync signal from this submodule is used to force updates. - * 0b101..The master sync signal from submodule0 is used to force updates. This setting should not be used in - * submodule0 as it holds the FORCE OUTPUT signal to logic 0. - * 0b110..The external force signal, EXT_FORCE, from outside the PWM module causes updates. - * 0b111..The external sync signal, EXT_SYNC, from outside the PWM module causes updates. - */ -#define PWM_CTRL2_FORCE_SEL(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_FORCE_SEL_SHIFT)) & PWM_CTRL2_FORCE_SEL_MASK) - -#define PWM_CTRL2_FORCE_MASK (0x40U) -#define PWM_CTRL2_FORCE_SHIFT (6U) -/*! FORCE - Force Initialization */ -#define PWM_CTRL2_FORCE(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_FORCE_SHIFT)) & PWM_CTRL2_FORCE_MASK) - -#define PWM_CTRL2_FRCEN_MASK (0x80U) -#define PWM_CTRL2_FRCEN_SHIFT (7U) -/*! FRCEN - Force Enable - * 0b0..Initialization from a FORCE_OUT is disabled. - * 0b1..Initialization from a FORCE_OUT is enabled. - */ -#define PWM_CTRL2_FRCEN(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_FRCEN_SHIFT)) & PWM_CTRL2_FRCEN_MASK) - -#define PWM_CTRL2_INIT_SEL_MASK (0x300U) -#define PWM_CTRL2_INIT_SEL_SHIFT (8U) -/*! INIT_SEL - Initialization Control Select - * 0b00..Local sync (PWM_X) causes initialization. - * 0b01..Master reload from submodule 0 causes initialization. This setting should not be used in submodule 0 as - * it forces the INIT signal to logic 0. The submodule counter will only re-initialize when a master reload - * occurs. - * 0b10..Master sync from submodule 0 causes initialization. This setting should not be used in submodule 0 as it forces the INIT signal to logic 0. - * 0b11..EXT_SYNC causes initialization. - */ -#define PWM_CTRL2_INIT_SEL(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_INIT_SEL_SHIFT)) & PWM_CTRL2_INIT_SEL_MASK) - -#define PWM_CTRL2_PWMX_INIT_MASK (0x400U) -#define PWM_CTRL2_PWMX_INIT_SHIFT (10U) -/*! PWMX_INIT - PWM_X Initial Value */ -#define PWM_CTRL2_PWMX_INIT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_PWMX_INIT_SHIFT)) & PWM_CTRL2_PWMX_INIT_MASK) - -#define PWM_CTRL2_PWM45_INIT_MASK (0x800U) -#define PWM_CTRL2_PWM45_INIT_SHIFT (11U) -/*! PWM45_INIT - PWM45 Initial Value */ -#define PWM_CTRL2_PWM45_INIT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_PWM45_INIT_SHIFT)) & PWM_CTRL2_PWM45_INIT_MASK) - -#define PWM_CTRL2_PWM23_INIT_MASK (0x1000U) -#define PWM_CTRL2_PWM23_INIT_SHIFT (12U) -/*! PWM23_INIT - PWM23 Initial Value */ -#define PWM_CTRL2_PWM23_INIT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_PWM23_INIT_SHIFT)) & PWM_CTRL2_PWM23_INIT_MASK) - -#define PWM_CTRL2_INDEP_MASK (0x2000U) -#define PWM_CTRL2_INDEP_SHIFT (13U) -/*! INDEP - Independent or Complementary Pair Operation - * 0b0..PWM_A and PWM_B form a complementary PWM pair. - * 0b1..PWM_A and PWM_B outputs are independent PWMs. - */ -#define PWM_CTRL2_INDEP(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_INDEP_SHIFT)) & PWM_CTRL2_INDEP_MASK) - -#define PWM_CTRL2_DBGEN_MASK (0x8000U) -#define PWM_CTRL2_DBGEN_SHIFT (15U) -/*! DBGEN - Debug Enable */ -#define PWM_CTRL2_DBGEN(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_DBGEN_SHIFT)) & PWM_CTRL2_DBGEN_MASK) -/*! @} */ - -/* The count of PWM_CTRL2 */ -#define PWM_CTRL2_COUNT (4U) - -/*! @name CTRL - Control Register */ -/*! @{ */ - -#define PWM_CTRL_DBLEN_MASK (0x1U) -#define PWM_CTRL_DBLEN_SHIFT (0U) -/*! DBLEN - Double Switching Enable - * 0b0..Double switching disabled. - * 0b1..Double switching enabled. - */ -#define PWM_CTRL_DBLEN(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_DBLEN_SHIFT)) & PWM_CTRL_DBLEN_MASK) - -#define PWM_CTRL_DBLX_MASK (0x2U) -#define PWM_CTRL_DBLX_SHIFT (1U) -/*! DBLX - PWM_X Double Switching Enable - * 0b0..PWM_X double pulse disabled. - * 0b1..PWM_X double pulse enabled. - */ -#define PWM_CTRL_DBLX(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_DBLX_SHIFT)) & PWM_CTRL_DBLX_MASK) - -#define PWM_CTRL_LDMOD_MASK (0x4U) -#define PWM_CTRL_LDMOD_SHIFT (2U) -/*! LDMOD - Load Mode Select - * 0b0..Buffered registers of this submodule are loaded and take effect at the next PWM reload if MCTRL[LDOK] is set. - * 0b1..Buffered registers of this submodule are loaded and take effect immediately upon MCTRL[LDOK] being set. - * In this case, it is not necessary to set CTRL[FULL] or CTRL[HALF]. - */ -#define PWM_CTRL_LDMOD(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_LDMOD_SHIFT)) & PWM_CTRL_LDMOD_MASK) - -#define PWM_CTRL_SPLIT_MASK (0x8U) -#define PWM_CTRL_SPLIT_SHIFT (3U) -/*! SPLIT - Split the DBLPWM signal to PWM_A and PWM_B - * 0b0..DBLPWM is not split. PWM_A and PWM_B each have double pulses. - * 0b1..DBLPWM is split to PWM_A and PWM_B. - */ -#define PWM_CTRL_SPLIT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_SPLIT_SHIFT)) & PWM_CTRL_SPLIT_MASK) - -#define PWM_CTRL_PRSC_MASK (0x70U) -#define PWM_CTRL_PRSC_SHIFT (4U) -/*! PRSC - Prescaler - * 0b000..Prescaler 1 - * 0b001..Prescaler 2 - * 0b010..Prescaler 4 - * 0b011..Prescaler 8 - * 0b100..Prescaler 16 - * 0b101..Prescaler 32 - * 0b110..Prescaler 64 - * 0b111..Prescaler 128 - */ -#define PWM_CTRL_PRSC(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_PRSC_SHIFT)) & PWM_CTRL_PRSC_MASK) - -#define PWM_CTRL_COMPMODE_MASK (0x80U) -#define PWM_CTRL_COMPMODE_SHIFT (7U) -/*! COMPMODE - Compare Mode - * 0b0..The VAL* registers and the PWM counter are compared using an "equal to" method. This means that PWM edges - * are only produced when the counter is equal to one of the VAL* register values. This implies that a PWM_A - * output that is high at the end of a period maintains this state until a match with VAL3 clears the output - * in the following period. - * 0b1..The VAL* registers and the PWM counter are compared using an "equal to or greater than" method. This - * means that PWM edges are produced when the counter is equal to or greater than one of the VAL* register - * values. This implies that a PWM_A output that is high at the end of a period could go low at the start of the - * next period if the starting counter value is greater than (but not necessarily equal to) the new VAL3 value. - */ -#define PWM_CTRL_COMPMODE(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_COMPMODE_SHIFT)) & PWM_CTRL_COMPMODE_MASK) - -#define PWM_CTRL_DT_MASK (0x300U) -#define PWM_CTRL_DT_SHIFT (8U) -/*! DT - Deadtime */ -#define PWM_CTRL_DT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_DT_SHIFT)) & PWM_CTRL_DT_MASK) - -#define PWM_CTRL_FULL_MASK (0x400U) -#define PWM_CTRL_FULL_SHIFT (10U) -/*! FULL - Full Cycle Reload - * 0b0..Full-cycle reloads disabled. - * 0b1..Full-cycle reloads enabled. - */ -#define PWM_CTRL_FULL(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_FULL_SHIFT)) & PWM_CTRL_FULL_MASK) - -#define PWM_CTRL_HALF_MASK (0x800U) -#define PWM_CTRL_HALF_SHIFT (11U) -/*! HALF - Half Cycle Reload - * 0b0..Half-cycle reloads disabled. - * 0b1..Half-cycle reloads enabled. - */ -#define PWM_CTRL_HALF(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_HALF_SHIFT)) & PWM_CTRL_HALF_MASK) - -#define PWM_CTRL_LDFQ_MASK (0xF000U) -#define PWM_CTRL_LDFQ_SHIFT (12U) -/*! LDFQ - Load Frequency - * 0b0000..Every PWM opportunity - * 0b0001..Every 2 PWM opportunities - * 0b0010..Every 3 PWM opportunities - * 0b0011..Every 4 PWM opportunities - * 0b0100..Every 5 PWM opportunities - * 0b0101..Every 6 PWM opportunities - * 0b0110..Every 7 PWM opportunities - * 0b0111..Every 8 PWM opportunities - * 0b1000..Every 9 PWM opportunities - * 0b1001..Every 10 PWM opportunities - * 0b1010..Every 11 PWM opportunities - * 0b1011..Every 12 PWM opportunities - * 0b1100..Every 13 PWM opportunities - * 0b1101..Every 14 PWM opportunities - * 0b1110..Every 15 PWM opportunities - * 0b1111..Every 16 PWM opportunities - */ -#define PWM_CTRL_LDFQ(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_LDFQ_SHIFT)) & PWM_CTRL_LDFQ_MASK) -/*! @} */ - -/* The count of PWM_CTRL */ -#define PWM_CTRL_COUNT (4U) - -/*! @name VAL0 - Value Register 0 */ -/*! @{ */ - -#define PWM_VAL0_VAL0_MASK (0xFFFFU) -#define PWM_VAL0_VAL0_SHIFT (0U) -/*! VAL0 - Value 0 */ -#define PWM_VAL0_VAL0(x) (((uint16_t)(((uint16_t)(x)) << PWM_VAL0_VAL0_SHIFT)) & PWM_VAL0_VAL0_MASK) -/*! @} */ - -/* The count of PWM_VAL0 */ -#define PWM_VAL0_COUNT (4U) - -/*! @name FRACVAL1 - Fractional Value Register 1 */ -/*! @{ */ - -#define PWM_FRACVAL1_FRACVAL1_MASK (0xF800U) -#define PWM_FRACVAL1_FRACVAL1_SHIFT (11U) -/*! FRACVAL1 - Fractional Value 1 */ -#define PWM_FRACVAL1_FRACVAL1(x) (((uint16_t)(((uint16_t)(x)) << PWM_FRACVAL1_FRACVAL1_SHIFT)) & PWM_FRACVAL1_FRACVAL1_MASK) -/*! @} */ - -/* The count of PWM_FRACVAL1 */ -#define PWM_FRACVAL1_COUNT (4U) - -/*! @name VAL1 - Value Register 1 */ -/*! @{ */ - -#define PWM_VAL1_VAL1_MASK (0xFFFFU) -#define PWM_VAL1_VAL1_SHIFT (0U) -/*! VAL1 - Value 1 */ -#define PWM_VAL1_VAL1(x) (((uint16_t)(((uint16_t)(x)) << PWM_VAL1_VAL1_SHIFT)) & PWM_VAL1_VAL1_MASK) -/*! @} */ - -/* The count of PWM_VAL1 */ -#define PWM_VAL1_COUNT (4U) - -/*! @name FRACVAL2 - Fractional Value Register 2 */ -/*! @{ */ - -#define PWM_FRACVAL2_FRACVAL2_MASK (0xF800U) -#define PWM_FRACVAL2_FRACVAL2_SHIFT (11U) -/*! FRACVAL2 - Fractional Value 2 */ -#define PWM_FRACVAL2_FRACVAL2(x) (((uint16_t)(((uint16_t)(x)) << PWM_FRACVAL2_FRACVAL2_SHIFT)) & PWM_FRACVAL2_FRACVAL2_MASK) -/*! @} */ - -/* The count of PWM_FRACVAL2 */ -#define PWM_FRACVAL2_COUNT (4U) - -/*! @name VAL2 - Value Register 2 */ -/*! @{ */ - -#define PWM_VAL2_VAL2_MASK (0xFFFFU) -#define PWM_VAL2_VAL2_SHIFT (0U) -/*! VAL2 - Value 2 */ -#define PWM_VAL2_VAL2(x) (((uint16_t)(((uint16_t)(x)) << PWM_VAL2_VAL2_SHIFT)) & PWM_VAL2_VAL2_MASK) -/*! @} */ - -/* The count of PWM_VAL2 */ -#define PWM_VAL2_COUNT (4U) - -/*! @name FRACVAL3 - Fractional Value Register 3 */ -/*! @{ */ - -#define PWM_FRACVAL3_FRACVAL3_MASK (0xF800U) -#define PWM_FRACVAL3_FRACVAL3_SHIFT (11U) -/*! FRACVAL3 - Fractional Value 3 */ -#define PWM_FRACVAL3_FRACVAL3(x) (((uint16_t)(((uint16_t)(x)) << PWM_FRACVAL3_FRACVAL3_SHIFT)) & PWM_FRACVAL3_FRACVAL3_MASK) -/*! @} */ - -/* The count of PWM_FRACVAL3 */ -#define PWM_FRACVAL3_COUNT (4U) - -/*! @name VAL3 - Value Register 3 */ -/*! @{ */ - -#define PWM_VAL3_VAL3_MASK (0xFFFFU) -#define PWM_VAL3_VAL3_SHIFT (0U) -/*! VAL3 - Value 3 */ -#define PWM_VAL3_VAL3(x) (((uint16_t)(((uint16_t)(x)) << PWM_VAL3_VAL3_SHIFT)) & PWM_VAL3_VAL3_MASK) -/*! @} */ - -/* The count of PWM_VAL3 */ -#define PWM_VAL3_COUNT (4U) - -/*! @name FRACVAL4 - Fractional Value Register 4 */ -/*! @{ */ - -#define PWM_FRACVAL4_FRACVAL4_MASK (0xF800U) -#define PWM_FRACVAL4_FRACVAL4_SHIFT (11U) -/*! FRACVAL4 - Fractional Value 4 */ -#define PWM_FRACVAL4_FRACVAL4(x) (((uint16_t)(((uint16_t)(x)) << PWM_FRACVAL4_FRACVAL4_SHIFT)) & PWM_FRACVAL4_FRACVAL4_MASK) -/*! @} */ - -/* The count of PWM_FRACVAL4 */ -#define PWM_FRACVAL4_COUNT (4U) - -/*! @name VAL4 - Value Register 4 */ -/*! @{ */ - -#define PWM_VAL4_VAL4_MASK (0xFFFFU) -#define PWM_VAL4_VAL4_SHIFT (0U) -/*! VAL4 - Value 4 */ -#define PWM_VAL4_VAL4(x) (((uint16_t)(((uint16_t)(x)) << PWM_VAL4_VAL4_SHIFT)) & PWM_VAL4_VAL4_MASK) -/*! @} */ - -/* The count of PWM_VAL4 */ -#define PWM_VAL4_COUNT (4U) - -/*! @name FRACVAL5 - Fractional Value Register 5 */ -/*! @{ */ - -#define PWM_FRACVAL5_FRACVAL5_MASK (0xF800U) -#define PWM_FRACVAL5_FRACVAL5_SHIFT (11U) -/*! FRACVAL5 - Fractional Value 5 */ -#define PWM_FRACVAL5_FRACVAL5(x) (((uint16_t)(((uint16_t)(x)) << PWM_FRACVAL5_FRACVAL5_SHIFT)) & PWM_FRACVAL5_FRACVAL5_MASK) -/*! @} */ - -/* The count of PWM_FRACVAL5 */ -#define PWM_FRACVAL5_COUNT (4U) - -/*! @name VAL5 - Value Register 5 */ -/*! @{ */ - -#define PWM_VAL5_VAL5_MASK (0xFFFFU) -#define PWM_VAL5_VAL5_SHIFT (0U) -/*! VAL5 - Value 5 */ -#define PWM_VAL5_VAL5(x) (((uint16_t)(((uint16_t)(x)) << PWM_VAL5_VAL5_SHIFT)) & PWM_VAL5_VAL5_MASK) -/*! @} */ - -/* The count of PWM_VAL5 */ -#define PWM_VAL5_COUNT (4U) - -/*! @name FRCTRL - Fractional Control Register */ -/*! @{ */ - -#define PWM_FRCTRL_FRAC1_EN_MASK (0x2U) -#define PWM_FRCTRL_FRAC1_EN_SHIFT (1U) -/*! FRAC1_EN - Fractional Cycle PWM Period Enable - * 0b0..Disable fractional cycle length for the PWM period. - * 0b1..Enable fractional cycle length for the PWM period. - */ -#define PWM_FRCTRL_FRAC1_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_FRCTRL_FRAC1_EN_SHIFT)) & PWM_FRCTRL_FRAC1_EN_MASK) - -#define PWM_FRCTRL_FRAC23_EN_MASK (0x4U) -#define PWM_FRCTRL_FRAC23_EN_SHIFT (2U) -/*! FRAC23_EN - Fractional Cycle Placement Enable for PWM_A - * 0b0..Disable fractional cycle placement for PWM_A. - * 0b1..Enable fractional cycle placement for PWM_A. - */ -#define PWM_FRCTRL_FRAC23_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_FRCTRL_FRAC23_EN_SHIFT)) & PWM_FRCTRL_FRAC23_EN_MASK) - -#define PWM_FRCTRL_FRAC45_EN_MASK (0x10U) -#define PWM_FRCTRL_FRAC45_EN_SHIFT (4U) -/*! FRAC45_EN - Fractional Cycle Placement Enable for PWM_B - * 0b0..Disable fractional cycle placement for PWM_B. - * 0b1..Enable fractional cycle placement for PWM_B. - */ -#define PWM_FRCTRL_FRAC45_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_FRCTRL_FRAC45_EN_SHIFT)) & PWM_FRCTRL_FRAC45_EN_MASK) - -#define PWM_FRCTRL_TEST_MASK (0x8000U) -#define PWM_FRCTRL_TEST_SHIFT (15U) -/*! TEST - Test Status Bit */ -#define PWM_FRCTRL_TEST(x) (((uint16_t)(((uint16_t)(x)) << PWM_FRCTRL_TEST_SHIFT)) & PWM_FRCTRL_TEST_MASK) -/*! @} */ - -/* The count of PWM_FRCTRL */ -#define PWM_FRCTRL_COUNT (4U) - -/*! @name OCTRL - Output Control Register */ -/*! @{ */ - -#define PWM_OCTRL_PWMXFS_MASK (0x3U) -#define PWM_OCTRL_PWMXFS_SHIFT (0U) -/*! PWMXFS - PWM_X Fault State - * 0b00..Output is forced to logic 0 state prior to consideration of output polarity control. - * 0b01..Output is forced to logic 1 state prior to consideration of output polarity control. - * 0b10, 0b11..Output is put in a high-impedance state. - */ -#define PWM_OCTRL_PWMXFS(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_PWMXFS_SHIFT)) & PWM_OCTRL_PWMXFS_MASK) - -#define PWM_OCTRL_PWMBFS_MASK (0xCU) -#define PWM_OCTRL_PWMBFS_SHIFT (2U) -/*! PWMBFS - PWM_B Fault State - * 0b00..Output is forced to logic 0 state prior to consideration of output polarity control. - * 0b01..Output is forced to logic 1 state prior to consideration of output polarity control. - * 0b10, 0b11..Output is put in a high-impedance state. - */ -#define PWM_OCTRL_PWMBFS(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_PWMBFS_SHIFT)) & PWM_OCTRL_PWMBFS_MASK) - -#define PWM_OCTRL_PWMAFS_MASK (0x30U) -#define PWM_OCTRL_PWMAFS_SHIFT (4U) -/*! PWMAFS - PWM_A Fault State - * 0b00..Output is forced to logic 0 state prior to consideration of output polarity control. - * 0b01..Output is forced to logic 1 state prior to consideration of output polarity control. - * 0b10, 0b11..Output is put in a high-impedance state. - */ -#define PWM_OCTRL_PWMAFS(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_PWMAFS_SHIFT)) & PWM_OCTRL_PWMAFS_MASK) - -#define PWM_OCTRL_POLX_MASK (0x100U) -#define PWM_OCTRL_POLX_SHIFT (8U) -/*! POLX - PWM_X Output Polarity - * 0b0..PWM_X output not inverted. A high level on the PWM_X pin represents the "on" or "active" state. - * 0b1..PWM_X output inverted. A low level on the PWM_X pin represents the "on" or "active" state. - */ -#define PWM_OCTRL_POLX(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_POLX_SHIFT)) & PWM_OCTRL_POLX_MASK) - -#define PWM_OCTRL_POLB_MASK (0x200U) -#define PWM_OCTRL_POLB_SHIFT (9U) -/*! POLB - PWM_B Output Polarity - * 0b0..PWM_B output not inverted. A high level on the PWM_B pin represents the "on" or "active" state. - * 0b1..PWM_B output inverted. A low level on the PWM_B pin represents the "on" or "active" state. - */ -#define PWM_OCTRL_POLB(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_POLB_SHIFT)) & PWM_OCTRL_POLB_MASK) - -#define PWM_OCTRL_POLA_MASK (0x400U) -#define PWM_OCTRL_POLA_SHIFT (10U) -/*! POLA - PWM_A Output Polarity - * 0b0..PWM_A output not inverted. A high level on the PWM_A pin represents the "on" or "active" state. - * 0b1..PWM_A output inverted. A low level on the PWM_A pin represents the "on" or "active" state. - */ -#define PWM_OCTRL_POLA(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_POLA_SHIFT)) & PWM_OCTRL_POLA_MASK) - -#define PWM_OCTRL_PWMX_IN_MASK (0x2000U) -#define PWM_OCTRL_PWMX_IN_SHIFT (13U) -/*! PWMX_IN - PWM_X Input */ -#define PWM_OCTRL_PWMX_IN(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_PWMX_IN_SHIFT)) & PWM_OCTRL_PWMX_IN_MASK) - -#define PWM_OCTRL_PWMB_IN_MASK (0x4000U) -#define PWM_OCTRL_PWMB_IN_SHIFT (14U) -/*! PWMB_IN - PWM_B Input */ -#define PWM_OCTRL_PWMB_IN(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_PWMB_IN_SHIFT)) & PWM_OCTRL_PWMB_IN_MASK) - -#define PWM_OCTRL_PWMA_IN_MASK (0x8000U) -#define PWM_OCTRL_PWMA_IN_SHIFT (15U) -/*! PWMA_IN - PWM_A Input */ -#define PWM_OCTRL_PWMA_IN(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_PWMA_IN_SHIFT)) & PWM_OCTRL_PWMA_IN_MASK) -/*! @} */ - -/* The count of PWM_OCTRL */ -#define PWM_OCTRL_COUNT (4U) - -/*! @name STS - Status Register */ -/*! @{ */ - -#define PWM_STS_CMPF_MASK (0x3FU) -#define PWM_STS_CMPF_SHIFT (0U) -/*! CMPF - Compare Flags - * 0b000000..No compare event has occurred for a particular VALx value. - * 0b000001..A compare event has occurred for a particular VALx value. - */ -#define PWM_STS_CMPF(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_CMPF_SHIFT)) & PWM_STS_CMPF_MASK) - -#define PWM_STS_CFX0_MASK (0x40U) -#define PWM_STS_CFX0_SHIFT (6U) -/*! CFX0 - Capture Flag X0 */ -#define PWM_STS_CFX0(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_CFX0_SHIFT)) & PWM_STS_CFX0_MASK) - -#define PWM_STS_CFX1_MASK (0x80U) -#define PWM_STS_CFX1_SHIFT (7U) -/*! CFX1 - Capture Flag X1 */ -#define PWM_STS_CFX1(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_CFX1_SHIFT)) & PWM_STS_CFX1_MASK) - -#define PWM_STS_CFB0_MASK (0x100U) -#define PWM_STS_CFB0_SHIFT (8U) -/*! CFB0 - Capture Flag B0 */ -#define PWM_STS_CFB0(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_CFB0_SHIFT)) & PWM_STS_CFB0_MASK) - -#define PWM_STS_CFB1_MASK (0x200U) -#define PWM_STS_CFB1_SHIFT (9U) -/*! CFB1 - Capture Flag B1 */ -#define PWM_STS_CFB1(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_CFB1_SHIFT)) & PWM_STS_CFB1_MASK) - -#define PWM_STS_CFA0_MASK (0x400U) -#define PWM_STS_CFA0_SHIFT (10U) -/*! CFA0 - Capture Flag A0 */ -#define PWM_STS_CFA0(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_CFA0_SHIFT)) & PWM_STS_CFA0_MASK) - -#define PWM_STS_CFA1_MASK (0x800U) -#define PWM_STS_CFA1_SHIFT (11U) -/*! CFA1 - Capture Flag A1 */ -#define PWM_STS_CFA1(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_CFA1_SHIFT)) & PWM_STS_CFA1_MASK) - -#define PWM_STS_RF_MASK (0x1000U) -#define PWM_STS_RF_SHIFT (12U) -/*! RF - Reload Flag - * 0b0..No new reload cycle since last STS[RF] clearing - * 0b1..New reload cycle since last STS[RF] clearing - */ -#define PWM_STS_RF(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_RF_SHIFT)) & PWM_STS_RF_MASK) - -#define PWM_STS_REF_MASK (0x2000U) -#define PWM_STS_REF_SHIFT (13U) -/*! REF - Reload Error Flag - * 0b0..No reload error occurred. - * 0b1..Reload signal occurred with non-coherent data and MCTRL[LDOK] = 0. - */ -#define PWM_STS_REF(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_REF_SHIFT)) & PWM_STS_REF_MASK) - -#define PWM_STS_RUF_MASK (0x4000U) -#define PWM_STS_RUF_SHIFT (14U) -/*! RUF - Registers Updated Flag - * 0b0..No register update has occurred since last reload. - * 0b1..At least one of the double buffered registers has been updated since the last reload. - */ -#define PWM_STS_RUF(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_RUF_SHIFT)) & PWM_STS_RUF_MASK) -/*! @} */ - -/* The count of PWM_STS */ -#define PWM_STS_COUNT (4U) - -/*! @name INTEN - Interrupt Enable Register */ -/*! @{ */ - -#define PWM_INTEN_CMPIE_MASK (0x3FU) -#define PWM_INTEN_CMPIE_SHIFT (0U) -/*! CMPIE - Compare Interrupt Enables - * 0b000000..The corresponding STS[CMPF] bit will not cause an interrupt request. - * 0b000001..The corresponding STS[CMPF] bit will cause an interrupt request. - */ -#define PWM_INTEN_CMPIE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_CMPIE_SHIFT)) & PWM_INTEN_CMPIE_MASK) - -#define PWM_INTEN_CX0IE_MASK (0x40U) -#define PWM_INTEN_CX0IE_SHIFT (6U) -/*! CX0IE - Capture X 0 Interrupt Enable - * 0b0..Interrupt request disabled for STS[CFX0]. - * 0b1..Interrupt request enabled for STS[CFX0]. - */ -#define PWM_INTEN_CX0IE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_CX0IE_SHIFT)) & PWM_INTEN_CX0IE_MASK) - -#define PWM_INTEN_CX1IE_MASK (0x80U) -#define PWM_INTEN_CX1IE_SHIFT (7U) -/*! CX1IE - Capture X 1 Interrupt Enable - * 0b0..Interrupt request disabled for STS[CFX1]. - * 0b1..Interrupt request enabled for STS[CFX1]. - */ -#define PWM_INTEN_CX1IE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_CX1IE_SHIFT)) & PWM_INTEN_CX1IE_MASK) - -#define PWM_INTEN_CB0IE_MASK (0x100U) -#define PWM_INTEN_CB0IE_SHIFT (8U) -/*! CB0IE - Capture B 0 Interrupt Enable - * 0b0..Interrupt request disabled for STS[CFB0]. - * 0b1..Interrupt request enabled for STS[CFB0]. - */ -#define PWM_INTEN_CB0IE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_CB0IE_SHIFT)) & PWM_INTEN_CB0IE_MASK) - -#define PWM_INTEN_CB1IE_MASK (0x200U) -#define PWM_INTEN_CB1IE_SHIFT (9U) -/*! CB1IE - Capture B 1 Interrupt Enable - * 0b0..Interrupt request disabled for STS[CFB1]. - * 0b1..Interrupt request enabled for STS[CFB1]. - */ -#define PWM_INTEN_CB1IE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_CB1IE_SHIFT)) & PWM_INTEN_CB1IE_MASK) - -#define PWM_INTEN_CA0IE_MASK (0x400U) -#define PWM_INTEN_CA0IE_SHIFT (10U) -/*! CA0IE - Capture A 0 Interrupt Enable - * 0b0..Interrupt request disabled for STS[CFA0]. - * 0b1..Interrupt request enabled for STS[CFA0]. - */ -#define PWM_INTEN_CA0IE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_CA0IE_SHIFT)) & PWM_INTEN_CA0IE_MASK) - -#define PWM_INTEN_CA1IE_MASK (0x800U) -#define PWM_INTEN_CA1IE_SHIFT (11U) -/*! CA1IE - Capture A 1 Interrupt Enable - * 0b0..Interrupt request disabled for STS[CFA1] - * 0b1..Interrupt request enabled for STS[CFA1] - */ -#define PWM_INTEN_CA1IE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_CA1IE_SHIFT)) & PWM_INTEN_CA1IE_MASK) - -#define PWM_INTEN_RIE_MASK (0x1000U) -#define PWM_INTEN_RIE_SHIFT (12U) -/*! RIE - Reload Interrupt Enable - * 0b0..STS[RF] CPU interrupt requests disabled - * 0b1..STS[RF] CPU interrupt requests enabled - */ -#define PWM_INTEN_RIE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_RIE_SHIFT)) & PWM_INTEN_RIE_MASK) - -#define PWM_INTEN_REIE_MASK (0x2000U) -#define PWM_INTEN_REIE_SHIFT (13U) -/*! REIE - Reload Error Interrupt Enable - * 0b0..STS[REF] CPU interrupt requests disabled - * 0b1..STS[REF] CPU interrupt requests enabled - */ -#define PWM_INTEN_REIE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_REIE_SHIFT)) & PWM_INTEN_REIE_MASK) -/*! @} */ - -/* The count of PWM_INTEN */ -#define PWM_INTEN_COUNT (4U) - -/*! @name DMAEN - DMA Enable Register */ -/*! @{ */ - -#define PWM_DMAEN_CX0DE_MASK (0x1U) -#define PWM_DMAEN_CX0DE_SHIFT (0U) -/*! CX0DE - Capture X0 FIFO DMA Enable */ -#define PWM_DMAEN_CX0DE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_CX0DE_SHIFT)) & PWM_DMAEN_CX0DE_MASK) - -#define PWM_DMAEN_CX1DE_MASK (0x2U) -#define PWM_DMAEN_CX1DE_SHIFT (1U) -/*! CX1DE - Capture X1 FIFO DMA Enable */ -#define PWM_DMAEN_CX1DE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_CX1DE_SHIFT)) & PWM_DMAEN_CX1DE_MASK) - -#define PWM_DMAEN_CB0DE_MASK (0x4U) -#define PWM_DMAEN_CB0DE_SHIFT (2U) -/*! CB0DE - Capture B0 FIFO DMA Enable */ -#define PWM_DMAEN_CB0DE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_CB0DE_SHIFT)) & PWM_DMAEN_CB0DE_MASK) - -#define PWM_DMAEN_CB1DE_MASK (0x8U) -#define PWM_DMAEN_CB1DE_SHIFT (3U) -/*! CB1DE - Capture B1 FIFO DMA Enable */ -#define PWM_DMAEN_CB1DE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_CB1DE_SHIFT)) & PWM_DMAEN_CB1DE_MASK) - -#define PWM_DMAEN_CA0DE_MASK (0x10U) -#define PWM_DMAEN_CA0DE_SHIFT (4U) -/*! CA0DE - Capture A0 FIFO DMA Enable */ -#define PWM_DMAEN_CA0DE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_CA0DE_SHIFT)) & PWM_DMAEN_CA0DE_MASK) - -#define PWM_DMAEN_CA1DE_MASK (0x20U) -#define PWM_DMAEN_CA1DE_SHIFT (5U) -/*! CA1DE - Capture A1 FIFO DMA Enable */ -#define PWM_DMAEN_CA1DE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_CA1DE_SHIFT)) & PWM_DMAEN_CA1DE_MASK) - -#define PWM_DMAEN_CAPTDE_MASK (0xC0U) -#define PWM_DMAEN_CAPTDE_SHIFT (6U) -/*! CAPTDE - Capture DMA Enable Source Select - * 0b00..Read DMA requests disabled. - * 0b01..Exceeding a FIFO watermark sets the DMA read request. This requires at least one of DMAEN[CA1DE], - * DMAEN[CA0DE], DMAEN[CB1DE], DMAEN[CB0DE], DMAEN[CX1DE], or DMAEN[CX0DE] to be set to determine which - * watermark(s) the DMA request is sensitive. - * 0b10..A local synchronization (VAL1 matches counter) sets the read DMA request. - * 0b11..A local reload (STS[RF] being set) sets the read DMA request. - */ -#define PWM_DMAEN_CAPTDE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_CAPTDE_SHIFT)) & PWM_DMAEN_CAPTDE_MASK) - -#define PWM_DMAEN_FAND_MASK (0x100U) -#define PWM_DMAEN_FAND_SHIFT (8U) -/*! FAND - FIFO Watermark AND Control - * 0b0..Selected FIFO watermarks are OR'ed together. - * 0b1..Selected FIFO watermarks are AND'ed together. - */ -#define PWM_DMAEN_FAND(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_FAND_SHIFT)) & PWM_DMAEN_FAND_MASK) - -#define PWM_DMAEN_VALDE_MASK (0x200U) -#define PWM_DMAEN_VALDE_SHIFT (9U) -/*! VALDE - Value Registers DMA Enable - * 0b0..DMA write requests disabled - * 0b1..Enabled - */ -#define PWM_DMAEN_VALDE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_VALDE_SHIFT)) & PWM_DMAEN_VALDE_MASK) -/*! @} */ - -/* The count of PWM_DMAEN */ -#define PWM_DMAEN_COUNT (4U) - -/*! @name TCTRL - Output Trigger Control Register */ -/*! @{ */ - -#define PWM_TCTRL_OUT_TRIG_EN_MASK (0x3FU) -#define PWM_TCTRL_OUT_TRIG_EN_SHIFT (0U) -/*! OUT_TRIG_EN - Output Trigger Enables - * 0bxxxxx1..PWM_OUT_TRIG0 will set when the counter value matches the VAL0 value. - * 0bxxxx1x..PWM_OUT_TRIG1 will set when the counter value matches the VAL1 value. - * 0bxxx1xx..PWM_OUT_TRIG0 will set when the counter value matches the VAL2 value. - * 0bxx1xxx..PWM_OUT_TRIG1 will set when the counter value matches the VAL3 value. - * 0bx1xxxx..PWM_OUT_TRIG0 will set when the counter value matches the VAL4 value. - * 0b1xxxxx..PWM_OUT_TRIG1 will set when the counter value matches the VAL5 value. - */ -#define PWM_TCTRL_OUT_TRIG_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_TCTRL_OUT_TRIG_EN_SHIFT)) & PWM_TCTRL_OUT_TRIG_EN_MASK) - -#define PWM_TCTRL_TRGFRQ_MASK (0x1000U) -#define PWM_TCTRL_TRGFRQ_SHIFT (12U) -/*! TRGFRQ - Trigger Frequency - * 0b0..Trigger outputs are generated during every PWM period even if the PWM is not reloaded every period due to CTRL[LDFQ] being non-zero. - * 0b1..Trigger outputs are generated only during the final PWM period prior to a reload opportunity when the PWM - * is not reloaded every period due to CTRL[LDFQ] being non-zero. - */ -#define PWM_TCTRL_TRGFRQ(x) (((uint16_t)(((uint16_t)(x)) << PWM_TCTRL_TRGFRQ_SHIFT)) & PWM_TCTRL_TRGFRQ_MASK) - -#define PWM_TCTRL_PWBOT1_MASK (0x4000U) -#define PWM_TCTRL_PWBOT1_SHIFT (14U) -/*! PWBOT1 - Mux Output Trigger 1 Source Select - * 0b0..Route the PWM_OUT_TRIG1 signal to PWM_MUX_TRIG1 port. - * 0b1..Route the PWM_B output to the PWM_MUX_TRIG1 port. - */ -#define PWM_TCTRL_PWBOT1(x) (((uint16_t)(((uint16_t)(x)) << PWM_TCTRL_PWBOT1_SHIFT)) & PWM_TCTRL_PWBOT1_MASK) - -#define PWM_TCTRL_PWAOT0_MASK (0x8000U) -#define PWM_TCTRL_PWAOT0_SHIFT (15U) -/*! PWAOT0 - Mux Output Trigger 0 Source Select - * 0b0..Route the PWM_OUT_TRIG0 signal to PWM_MUX_TRIG0 port. - * 0b1..Route the PWM_A output to the PWM_MUX_TRIG0 port. - */ -#define PWM_TCTRL_PWAOT0(x) (((uint16_t)(((uint16_t)(x)) << PWM_TCTRL_PWAOT0_SHIFT)) & PWM_TCTRL_PWAOT0_MASK) -/*! @} */ - -/* The count of PWM_TCTRL */ -#define PWM_TCTRL_COUNT (4U) - -/*! @name DISMAP - Fault Disable Mapping Register 0 */ -/*! @{ */ - -#define PWM_DISMAP_DIS0A_MASK (0xFU) -#define PWM_DISMAP_DIS0A_SHIFT (0U) -/*! DIS0A - PWM_A Fault Disable Mask 0 */ -#define PWM_DISMAP_DIS0A(x) (((uint16_t)(((uint16_t)(x)) << PWM_DISMAP_DIS0A_SHIFT)) & PWM_DISMAP_DIS0A_MASK) - -#define PWM_DISMAP_DIS0B_MASK (0xF0U) -#define PWM_DISMAP_DIS0B_SHIFT (4U) -/*! DIS0B - PWM_B Fault Disable Mask 0 */ -#define PWM_DISMAP_DIS0B(x) (((uint16_t)(((uint16_t)(x)) << PWM_DISMAP_DIS0B_SHIFT)) & PWM_DISMAP_DIS0B_MASK) - -#define PWM_DISMAP_DIS0X_MASK (0xF00U) -#define PWM_DISMAP_DIS0X_SHIFT (8U) -/*! DIS0X - PWM_X Fault Disable Mask 0 */ -#define PWM_DISMAP_DIS0X(x) (((uint16_t)(((uint16_t)(x)) << PWM_DISMAP_DIS0X_SHIFT)) & PWM_DISMAP_DIS0X_MASK) -/*! @} */ - -/* The count of PWM_DISMAP */ -#define PWM_DISMAP_COUNT (4U) - -/* The count of PWM_DISMAP */ -#define PWM_DISMAP_COUNT2 (1U) - -/*! @name DTCNT0 - Deadtime Count Register 0 */ -/*! @{ */ - -#define PWM_DTCNT0_DTCNT0_MASK (0x7FFU) -#define PWM_DTCNT0_DTCNT0_SHIFT (0U) -/*! DTCNT0 - Deadtime Count Register 0 */ -#define PWM_DTCNT0_DTCNT0(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTCNT0_DTCNT0_SHIFT)) & PWM_DTCNT0_DTCNT0_MASK) -/*! @} */ - -/* The count of PWM_DTCNT0 */ -#define PWM_DTCNT0_COUNT (4U) - -/*! @name DTCNT1 - Deadtime Count Register 1 */ -/*! @{ */ - -#define PWM_DTCNT1_DTCNT1_MASK (0x7FFU) -#define PWM_DTCNT1_DTCNT1_SHIFT (0U) -/*! DTCNT1 - Deadtime Count Register 1 */ -#define PWM_DTCNT1_DTCNT1(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTCNT1_DTCNT1_SHIFT)) & PWM_DTCNT1_DTCNT1_MASK) -/*! @} */ - -/* The count of PWM_DTCNT1 */ -#define PWM_DTCNT1_COUNT (4U) - -/*! @name CAPTCTRLA - Capture Control A Register */ -/*! @{ */ - -#define PWM_CAPTCTRLA_ARMA_MASK (0x1U) -#define PWM_CAPTCTRLA_ARMA_SHIFT (0U) -/*! ARMA - Arm A - * 0b0..Input capture operation is disabled. - * 0b1..Input capture operation as specified by CAPTCTRLA[EDGAx] is enabled. - */ -#define PWM_CAPTCTRLA_ARMA(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLA_ARMA_SHIFT)) & PWM_CAPTCTRLA_ARMA_MASK) - -#define PWM_CAPTCTRLA_ONESHOTA_MASK (0x2U) -#define PWM_CAPTCTRLA_ONESHOTA_SHIFT (1U) -/*! ONESHOTA - One Shot Mode A - * 0b0..Free Running - * 0b1..One Shot - */ -#define PWM_CAPTCTRLA_ONESHOTA(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLA_ONESHOTA_SHIFT)) & PWM_CAPTCTRLA_ONESHOTA_MASK) - -#define PWM_CAPTCTRLA_EDGA0_MASK (0xCU) -#define PWM_CAPTCTRLA_EDGA0_SHIFT (2U) -/*! EDGA0 - Edge A 0 - * 0b00..Disabled - * 0b01..Capture falling edges - * 0b10..Capture rising edges - * 0b11..Capture any edge - */ -#define PWM_CAPTCTRLA_EDGA0(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLA_EDGA0_SHIFT)) & PWM_CAPTCTRLA_EDGA0_MASK) - -#define PWM_CAPTCTRLA_EDGA1_MASK (0x30U) -#define PWM_CAPTCTRLA_EDGA1_SHIFT (4U) -/*! EDGA1 - Edge A 1 - * 0b00..Disabled - * 0b01..Capture falling edges - * 0b10..Capture rising edges - * 0b11..Capture any edge - */ -#define PWM_CAPTCTRLA_EDGA1(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLA_EDGA1_SHIFT)) & PWM_CAPTCTRLA_EDGA1_MASK) - -#define PWM_CAPTCTRLA_INP_SELA_MASK (0x40U) -#define PWM_CAPTCTRLA_INP_SELA_SHIFT (6U) -/*! INP_SELA - Input Select A - * 0b0..Raw PWM_A input signal selected as source. - * 0b1..Edge Counter - */ -#define PWM_CAPTCTRLA_INP_SELA(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLA_INP_SELA_SHIFT)) & PWM_CAPTCTRLA_INP_SELA_MASK) - -#define PWM_CAPTCTRLA_EDGCNTA_EN_MASK (0x80U) -#define PWM_CAPTCTRLA_EDGCNTA_EN_SHIFT (7U) -/*! EDGCNTA_EN - Edge Counter A Enable - * 0b0..Edge counter disabled and held in reset - * 0b1..Edge counter enabled - */ -#define PWM_CAPTCTRLA_EDGCNTA_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLA_EDGCNTA_EN_SHIFT)) & PWM_CAPTCTRLA_EDGCNTA_EN_MASK) - -#define PWM_CAPTCTRLA_CFAWM_MASK (0x300U) -#define PWM_CAPTCTRLA_CFAWM_SHIFT (8U) -/*! CFAWM - Capture A FIFOs Water Mark */ -#define PWM_CAPTCTRLA_CFAWM(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLA_CFAWM_SHIFT)) & PWM_CAPTCTRLA_CFAWM_MASK) - -#define PWM_CAPTCTRLA_CA0CNT_MASK (0x1C00U) -#define PWM_CAPTCTRLA_CA0CNT_SHIFT (10U) -/*! CA0CNT - Capture A0 FIFO Word Count */ -#define PWM_CAPTCTRLA_CA0CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLA_CA0CNT_SHIFT)) & PWM_CAPTCTRLA_CA0CNT_MASK) - -#define PWM_CAPTCTRLA_CA1CNT_MASK (0xE000U) -#define PWM_CAPTCTRLA_CA1CNT_SHIFT (13U) -/*! CA1CNT - Capture A1 FIFO Word Count */ -#define PWM_CAPTCTRLA_CA1CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLA_CA1CNT_SHIFT)) & PWM_CAPTCTRLA_CA1CNT_MASK) -/*! @} */ - -/* The count of PWM_CAPTCTRLA */ -#define PWM_CAPTCTRLA_COUNT (4U) - -/*! @name CAPTCOMPA - Capture Compare A Register */ -/*! @{ */ - -#define PWM_CAPTCOMPA_EDGCMPA_MASK (0xFFU) -#define PWM_CAPTCOMPA_EDGCMPA_SHIFT (0U) -/*! EDGCMPA - Edge Compare A */ -#define PWM_CAPTCOMPA_EDGCMPA(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCOMPA_EDGCMPA_SHIFT)) & PWM_CAPTCOMPA_EDGCMPA_MASK) - -#define PWM_CAPTCOMPA_EDGCNTA_MASK (0xFF00U) -#define PWM_CAPTCOMPA_EDGCNTA_SHIFT (8U) -/*! EDGCNTA - Edge Counter A */ -#define PWM_CAPTCOMPA_EDGCNTA(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCOMPA_EDGCNTA_SHIFT)) & PWM_CAPTCOMPA_EDGCNTA_MASK) -/*! @} */ - -/* The count of PWM_CAPTCOMPA */ -#define PWM_CAPTCOMPA_COUNT (4U) - -/*! @name CAPTCTRLB - Capture Control B Register */ -/*! @{ */ - -#define PWM_CAPTCTRLB_ARMB_MASK (0x1U) -#define PWM_CAPTCTRLB_ARMB_SHIFT (0U) -/*! ARMB - Arm B - * 0b0..Input capture operation is disabled. - * 0b1..Input capture operation as specified by CAPTCTRLB[EDGBx] is enabled. - */ -#define PWM_CAPTCTRLB_ARMB(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLB_ARMB_SHIFT)) & PWM_CAPTCTRLB_ARMB_MASK) - -#define PWM_CAPTCTRLB_ONESHOTB_MASK (0x2U) -#define PWM_CAPTCTRLB_ONESHOTB_SHIFT (1U) -/*! ONESHOTB - One Shot Mode B - * 0b0..Free Running - * 0b1..One Shot - */ -#define PWM_CAPTCTRLB_ONESHOTB(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLB_ONESHOTB_SHIFT)) & PWM_CAPTCTRLB_ONESHOTB_MASK) - -#define PWM_CAPTCTRLB_EDGB0_MASK (0xCU) -#define PWM_CAPTCTRLB_EDGB0_SHIFT (2U) -/*! EDGB0 - Edge B 0 - * 0b00..Disabled - * 0b01..Capture falling edges - * 0b10..Capture rising edges - * 0b11..Capture any edge - */ -#define PWM_CAPTCTRLB_EDGB0(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLB_EDGB0_SHIFT)) & PWM_CAPTCTRLB_EDGB0_MASK) - -#define PWM_CAPTCTRLB_EDGB1_MASK (0x30U) -#define PWM_CAPTCTRLB_EDGB1_SHIFT (4U) -/*! EDGB1 - Edge B 1 - * 0b00..Disabled - * 0b01..Capture falling edges - * 0b10..Capture rising edges - * 0b11..Capture any edge - */ -#define PWM_CAPTCTRLB_EDGB1(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLB_EDGB1_SHIFT)) & PWM_CAPTCTRLB_EDGB1_MASK) - -#define PWM_CAPTCTRLB_INP_SELB_MASK (0x40U) -#define PWM_CAPTCTRLB_INP_SELB_SHIFT (6U) -/*! INP_SELB - Input Select B - * 0b0..Raw PWM_B input signal selected as source. - * 0b1..Edge Counter - */ -#define PWM_CAPTCTRLB_INP_SELB(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLB_INP_SELB_SHIFT)) & PWM_CAPTCTRLB_INP_SELB_MASK) - -#define PWM_CAPTCTRLB_EDGCNTB_EN_MASK (0x80U) -#define PWM_CAPTCTRLB_EDGCNTB_EN_SHIFT (7U) -/*! EDGCNTB_EN - Edge Counter B Enable - * 0b0..Edge counter disabled and held in reset - * 0b1..Edge counter enabled - */ -#define PWM_CAPTCTRLB_EDGCNTB_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLB_EDGCNTB_EN_SHIFT)) & PWM_CAPTCTRLB_EDGCNTB_EN_MASK) - -#define PWM_CAPTCTRLB_CFBWM_MASK (0x300U) -#define PWM_CAPTCTRLB_CFBWM_SHIFT (8U) -/*! CFBWM - Capture B FIFOs Water Mark */ -#define PWM_CAPTCTRLB_CFBWM(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLB_CFBWM_SHIFT)) & PWM_CAPTCTRLB_CFBWM_MASK) - -#define PWM_CAPTCTRLB_CB0CNT_MASK (0x1C00U) -#define PWM_CAPTCTRLB_CB0CNT_SHIFT (10U) -/*! CB0CNT - Capture B0 FIFO Word Count */ -#define PWM_CAPTCTRLB_CB0CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLB_CB0CNT_SHIFT)) & PWM_CAPTCTRLB_CB0CNT_MASK) - -#define PWM_CAPTCTRLB_CB1CNT_MASK (0xE000U) -#define PWM_CAPTCTRLB_CB1CNT_SHIFT (13U) -/*! CB1CNT - Capture B1 FIFO Word Count */ -#define PWM_CAPTCTRLB_CB1CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLB_CB1CNT_SHIFT)) & PWM_CAPTCTRLB_CB1CNT_MASK) -/*! @} */ - -/* The count of PWM_CAPTCTRLB */ -#define PWM_CAPTCTRLB_COUNT (4U) - -/*! @name CAPTCOMPB - Capture Compare B Register */ -/*! @{ */ - -#define PWM_CAPTCOMPB_EDGCMPB_MASK (0xFFU) -#define PWM_CAPTCOMPB_EDGCMPB_SHIFT (0U) -/*! EDGCMPB - Edge Compare B */ -#define PWM_CAPTCOMPB_EDGCMPB(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCOMPB_EDGCMPB_SHIFT)) & PWM_CAPTCOMPB_EDGCMPB_MASK) - -#define PWM_CAPTCOMPB_EDGCNTB_MASK (0xFF00U) -#define PWM_CAPTCOMPB_EDGCNTB_SHIFT (8U) -/*! EDGCNTB - Edge Counter B */ -#define PWM_CAPTCOMPB_EDGCNTB(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCOMPB_EDGCNTB_SHIFT)) & PWM_CAPTCOMPB_EDGCNTB_MASK) -/*! @} */ - -/* The count of PWM_CAPTCOMPB */ -#define PWM_CAPTCOMPB_COUNT (4U) - -/*! @name CAPTCTRLX - Capture Control X Register */ -/*! @{ */ - -#define PWM_CAPTCTRLX_ARMX_MASK (0x1U) -#define PWM_CAPTCTRLX_ARMX_SHIFT (0U) -/*! ARMX - Arm X - * 0b0..Input capture operation is disabled. - * 0b1..Input capture operation as specified by CAPTCTRLX[EDGXx] is enabled. - */ -#define PWM_CAPTCTRLX_ARMX(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_ARMX_SHIFT)) & PWM_CAPTCTRLX_ARMX_MASK) - -#define PWM_CAPTCTRLX_ONESHOTX_MASK (0x2U) -#define PWM_CAPTCTRLX_ONESHOTX_SHIFT (1U) -/*! ONESHOTX - One Shot Mode Aux - * 0b0..Free Running - * 0b1..One Shot - */ -#define PWM_CAPTCTRLX_ONESHOTX(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_ONESHOTX_SHIFT)) & PWM_CAPTCTRLX_ONESHOTX_MASK) - -#define PWM_CAPTCTRLX_EDGX0_MASK (0xCU) -#define PWM_CAPTCTRLX_EDGX0_SHIFT (2U) -/*! EDGX0 - Edge X 0 - * 0b00..Disabled - * 0b01..Capture falling edges - * 0b10..Capture rising edges - * 0b11..Capture any edge - */ -#define PWM_CAPTCTRLX_EDGX0(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_EDGX0_SHIFT)) & PWM_CAPTCTRLX_EDGX0_MASK) - -#define PWM_CAPTCTRLX_EDGX1_MASK (0x30U) -#define PWM_CAPTCTRLX_EDGX1_SHIFT (4U) -/*! EDGX1 - Edge X 1 - * 0b00..Disabled - * 0b01..Capture falling edges - * 0b10..Capture rising edges - * 0b11..Capture any edge - */ -#define PWM_CAPTCTRLX_EDGX1(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_EDGX1_SHIFT)) & PWM_CAPTCTRLX_EDGX1_MASK) - -#define PWM_CAPTCTRLX_INP_SELX_MASK (0x40U) -#define PWM_CAPTCTRLX_INP_SELX_SHIFT (6U) -/*! INP_SELX - Input Select X - * 0b0..Raw PWM_X input signal selected as source. - * 0b1..Edge Counter - */ -#define PWM_CAPTCTRLX_INP_SELX(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_INP_SELX_SHIFT)) & PWM_CAPTCTRLX_INP_SELX_MASK) - -#define PWM_CAPTCTRLX_EDGCNTX_EN_MASK (0x80U) -#define PWM_CAPTCTRLX_EDGCNTX_EN_SHIFT (7U) -/*! EDGCNTX_EN - Edge Counter X Enable - * 0b0..Edge counter disabled and held in reset - * 0b1..Edge counter enabled - */ -#define PWM_CAPTCTRLX_EDGCNTX_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_EDGCNTX_EN_SHIFT)) & PWM_CAPTCTRLX_EDGCNTX_EN_MASK) - -#define PWM_CAPTCTRLX_CFXWM_MASK (0x300U) -#define PWM_CAPTCTRLX_CFXWM_SHIFT (8U) -/*! CFXWM - Capture X FIFOs Water Mark */ -#define PWM_CAPTCTRLX_CFXWM(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_CFXWM_SHIFT)) & PWM_CAPTCTRLX_CFXWM_MASK) - -#define PWM_CAPTCTRLX_CX0CNT_MASK (0x1C00U) -#define PWM_CAPTCTRLX_CX0CNT_SHIFT (10U) -/*! CX0CNT - Capture X0 FIFO Word Count */ -#define PWM_CAPTCTRLX_CX0CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_CX0CNT_SHIFT)) & PWM_CAPTCTRLX_CX0CNT_MASK) - -#define PWM_CAPTCTRLX_CX1CNT_MASK (0xE000U) -#define PWM_CAPTCTRLX_CX1CNT_SHIFT (13U) -/*! CX1CNT - Capture X1 FIFO Word Count */ -#define PWM_CAPTCTRLX_CX1CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_CX1CNT_SHIFT)) & PWM_CAPTCTRLX_CX1CNT_MASK) -/*! @} */ - -/* The count of PWM_CAPTCTRLX */ -#define PWM_CAPTCTRLX_COUNT (4U) - -/*! @name CAPTCOMPX - Capture Compare X Register */ -/*! @{ */ - -#define PWM_CAPTCOMPX_EDGCMPX_MASK (0xFFU) -#define PWM_CAPTCOMPX_EDGCMPX_SHIFT (0U) -/*! EDGCMPX - Edge Compare X */ -#define PWM_CAPTCOMPX_EDGCMPX(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCOMPX_EDGCMPX_SHIFT)) & PWM_CAPTCOMPX_EDGCMPX_MASK) - -#define PWM_CAPTCOMPX_EDGCNTX_MASK (0xFF00U) -#define PWM_CAPTCOMPX_EDGCNTX_SHIFT (8U) -/*! EDGCNTX - Edge Counter X */ -#define PWM_CAPTCOMPX_EDGCNTX(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCOMPX_EDGCNTX_SHIFT)) & PWM_CAPTCOMPX_EDGCNTX_MASK) -/*! @} */ - -/* The count of PWM_CAPTCOMPX */ -#define PWM_CAPTCOMPX_COUNT (4U) - -/*! @name CVAL0 - Capture Value 0 Register */ -/*! @{ */ - -#define PWM_CVAL0_CAPTVAL0_MASK (0xFFFFU) -#define PWM_CVAL0_CAPTVAL0_SHIFT (0U) -/*! CAPTVAL0 - Capture Value 0 */ -#define PWM_CVAL0_CAPTVAL0(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL0_CAPTVAL0_SHIFT)) & PWM_CVAL0_CAPTVAL0_MASK) -/*! @} */ - -/* The count of PWM_CVAL0 */ -#define PWM_CVAL0_COUNT (4U) - -/*! @name CVAL0CYC - Capture Value 0 Cycle Register */ -/*! @{ */ - -#define PWM_CVAL0CYC_CVAL0CYC_MASK (0xFU) -#define PWM_CVAL0CYC_CVAL0CYC_SHIFT (0U) -/*! CVAL0CYC - Capture Value 0 Cycle */ -#define PWM_CVAL0CYC_CVAL0CYC(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL0CYC_CVAL0CYC_SHIFT)) & PWM_CVAL0CYC_CVAL0CYC_MASK) -/*! @} */ - -/* The count of PWM_CVAL0CYC */ -#define PWM_CVAL0CYC_COUNT (4U) - -/*! @name CVAL1 - Capture Value 1 Register */ -/*! @{ */ - -#define PWM_CVAL1_CAPTVAL1_MASK (0xFFFFU) -#define PWM_CVAL1_CAPTVAL1_SHIFT (0U) -/*! CAPTVAL1 - Capture Value 1 */ -#define PWM_CVAL1_CAPTVAL1(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL1_CAPTVAL1_SHIFT)) & PWM_CVAL1_CAPTVAL1_MASK) -/*! @} */ - -/* The count of PWM_CVAL1 */ -#define PWM_CVAL1_COUNT (4U) - -/*! @name CVAL1CYC - Capture Value 1 Cycle Register */ -/*! @{ */ - -#define PWM_CVAL1CYC_CVAL1CYC_MASK (0xFU) -#define PWM_CVAL1CYC_CVAL1CYC_SHIFT (0U) -/*! CVAL1CYC - Capture Value 1 Cycle */ -#define PWM_CVAL1CYC_CVAL1CYC(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL1CYC_CVAL1CYC_SHIFT)) & PWM_CVAL1CYC_CVAL1CYC_MASK) -/*! @} */ - -/* The count of PWM_CVAL1CYC */ -#define PWM_CVAL1CYC_COUNT (4U) - -/*! @name CVAL2 - Capture Value 2 Register */ -/*! @{ */ - -#define PWM_CVAL2_CAPTVAL2_MASK (0xFFFFU) -#define PWM_CVAL2_CAPTVAL2_SHIFT (0U) -/*! CAPTVAL2 - Capture Value 2 */ -#define PWM_CVAL2_CAPTVAL2(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL2_CAPTVAL2_SHIFT)) & PWM_CVAL2_CAPTVAL2_MASK) -/*! @} */ - -/* The count of PWM_CVAL2 */ -#define PWM_CVAL2_COUNT (4U) - -/*! @name CVAL2CYC - Capture Value 2 Cycle Register */ -/*! @{ */ - -#define PWM_CVAL2CYC_CVAL2CYC_MASK (0xFU) -#define PWM_CVAL2CYC_CVAL2CYC_SHIFT (0U) -/*! CVAL2CYC - Capture Value 2 Cycle */ -#define PWM_CVAL2CYC_CVAL2CYC(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL2CYC_CVAL2CYC_SHIFT)) & PWM_CVAL2CYC_CVAL2CYC_MASK) -/*! @} */ - -/* The count of PWM_CVAL2CYC */ -#define PWM_CVAL2CYC_COUNT (4U) - -/*! @name CVAL3 - Capture Value 3 Register */ -/*! @{ */ - -#define PWM_CVAL3_CAPTVAL3_MASK (0xFFFFU) -#define PWM_CVAL3_CAPTVAL3_SHIFT (0U) -/*! CAPTVAL3 - Capture Value 3 */ -#define PWM_CVAL3_CAPTVAL3(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL3_CAPTVAL3_SHIFT)) & PWM_CVAL3_CAPTVAL3_MASK) -/*! @} */ - -/* The count of PWM_CVAL3 */ -#define PWM_CVAL3_COUNT (4U) - -/*! @name CVAL3CYC - Capture Value 3 Cycle Register */ -/*! @{ */ - -#define PWM_CVAL3CYC_CVAL3CYC_MASK (0xFU) -#define PWM_CVAL3CYC_CVAL3CYC_SHIFT (0U) -/*! CVAL3CYC - Capture Value 3 Cycle */ -#define PWM_CVAL3CYC_CVAL3CYC(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL3CYC_CVAL3CYC_SHIFT)) & PWM_CVAL3CYC_CVAL3CYC_MASK) -/*! @} */ - -/* The count of PWM_CVAL3CYC */ -#define PWM_CVAL3CYC_COUNT (4U) - -/*! @name CVAL4 - Capture Value 4 Register */ -/*! @{ */ - -#define PWM_CVAL4_CAPTVAL4_MASK (0xFFFFU) -#define PWM_CVAL4_CAPTVAL4_SHIFT (0U) -/*! CAPTVAL4 - Capture Value 4 */ -#define PWM_CVAL4_CAPTVAL4(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL4_CAPTVAL4_SHIFT)) & PWM_CVAL4_CAPTVAL4_MASK) -/*! @} */ - -/* The count of PWM_CVAL4 */ -#define PWM_CVAL4_COUNT (4U) - -/*! @name CVAL4CYC - Capture Value 4 Cycle Register */ -/*! @{ */ - -#define PWM_CVAL4CYC_CVAL4CYC_MASK (0xFU) -#define PWM_CVAL4CYC_CVAL4CYC_SHIFT (0U) -/*! CVAL4CYC - Capture Value 4 Cycle */ -#define PWM_CVAL4CYC_CVAL4CYC(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL4CYC_CVAL4CYC_SHIFT)) & PWM_CVAL4CYC_CVAL4CYC_MASK) -/*! @} */ - -/* The count of PWM_CVAL4CYC */ -#define PWM_CVAL4CYC_COUNT (4U) - -/*! @name CVAL5 - Capture Value 5 Register */ -/*! @{ */ - -#define PWM_CVAL5_CAPTVAL5_MASK (0xFFFFU) -#define PWM_CVAL5_CAPTVAL5_SHIFT (0U) -/*! CAPTVAL5 - Capture Value 5 */ -#define PWM_CVAL5_CAPTVAL5(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL5_CAPTVAL5_SHIFT)) & PWM_CVAL5_CAPTVAL5_MASK) -/*! @} */ - -/* The count of PWM_CVAL5 */ -#define PWM_CVAL5_COUNT (4U) - -/*! @name CVAL5CYC - Capture Value 5 Cycle Register */ -/*! @{ */ - -#define PWM_CVAL5CYC_CVAL5CYC_MASK (0xFU) -#define PWM_CVAL5CYC_CVAL5CYC_SHIFT (0U) -/*! CVAL5CYC - Capture Value 5 Cycle */ -#define PWM_CVAL5CYC_CVAL5CYC(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL5CYC_CVAL5CYC_SHIFT)) & PWM_CVAL5CYC_CVAL5CYC_MASK) -/*! @} */ - -/* The count of PWM_CVAL5CYC */ -#define PWM_CVAL5CYC_COUNT (4U) - -/*! @name PHASEDLY - Phase Delay Register */ -/*! @{ */ - -#define PWM_PHASEDLY_PHASEDLY_MASK (0xFFFFU) -#define PWM_PHASEDLY_PHASEDLY_SHIFT (0U) -/*! PHASEDLY - Initial Count Register Bits */ -#define PWM_PHASEDLY_PHASEDLY(x) (((uint16_t)(((uint16_t)(x)) << PWM_PHASEDLY_PHASEDLY_SHIFT)) & PWM_PHASEDLY_PHASEDLY_MASK) -/*! @} */ - -/* The count of PWM_PHASEDLY */ -#define PWM_PHASEDLY_COUNT (4U) - -/*! @name CAPTFILTA - Capture PWM_A Input Filter Register */ -/*! @{ */ - -#define PWM_CAPTFILTA_CAPTA_FILT_PER_MASK (0xFFU) -#define PWM_CAPTFILTA_CAPTA_FILT_PER_SHIFT (0U) -/*! CAPTA_FILT_PER - Input Capture Filter Period */ -#define PWM_CAPTFILTA_CAPTA_FILT_PER(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTFILTA_CAPTA_FILT_PER_SHIFT)) & PWM_CAPTFILTA_CAPTA_FILT_PER_MASK) - -#define PWM_CAPTFILTA_CAPTA_FILT_CNT_MASK (0x700U) -#define PWM_CAPTFILTA_CAPTA_FILT_CNT_SHIFT (8U) -/*! CAPTA_FILT_CNT - Input Capture Filter Count */ -#define PWM_CAPTFILTA_CAPTA_FILT_CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTFILTA_CAPTA_FILT_CNT_SHIFT)) & PWM_CAPTFILTA_CAPTA_FILT_CNT_MASK) -/*! @} */ - -/* The count of PWM_CAPTFILTA */ -#define PWM_CAPTFILTA_COUNT (4U) - -/*! @name CAPTFILTB - Capture PWM_B Input Filter Register */ -/*! @{ */ - -#define PWM_CAPTFILTB_CAPTB_FILT_PER_MASK (0xFFU) -#define PWM_CAPTFILTB_CAPTB_FILT_PER_SHIFT (0U) -/*! CAPTB_FILT_PER - Input Capture Filter Period */ -#define PWM_CAPTFILTB_CAPTB_FILT_PER(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTFILTB_CAPTB_FILT_PER_SHIFT)) & PWM_CAPTFILTB_CAPTB_FILT_PER_MASK) - -#define PWM_CAPTFILTB_CAPTB_FILT_CNT_MASK (0x700U) -#define PWM_CAPTFILTB_CAPTB_FILT_CNT_SHIFT (8U) -/*! CAPTB_FILT_CNT - Input Capture Filter Count */ -#define PWM_CAPTFILTB_CAPTB_FILT_CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTFILTB_CAPTB_FILT_CNT_SHIFT)) & PWM_CAPTFILTB_CAPTB_FILT_CNT_MASK) -/*! @} */ - -/* The count of PWM_CAPTFILTB */ -#define PWM_CAPTFILTB_COUNT (4U) - -/*! @name CAPTFILTX - Capture PWM_X Input Filter Register */ -/*! @{ */ - -#define PWM_CAPTFILTX_CAPTX_FILT_PER_MASK (0xFFU) -#define PWM_CAPTFILTX_CAPTX_FILT_PER_SHIFT (0U) -/*! CAPTX_FILT_PER - Input Capture Filter Period */ -#define PWM_CAPTFILTX_CAPTX_FILT_PER(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTFILTX_CAPTX_FILT_PER_SHIFT)) & PWM_CAPTFILTX_CAPTX_FILT_PER_MASK) - -#define PWM_CAPTFILTX_CAPTX_FILT_CNT_MASK (0x700U) -#define PWM_CAPTFILTX_CAPTX_FILT_CNT_SHIFT (8U) -/*! CAPTX_FILT_CNT - Input Capture Filter Count */ -#define PWM_CAPTFILTX_CAPTX_FILT_CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTFILTX_CAPTX_FILT_CNT_SHIFT)) & PWM_CAPTFILTX_CAPTX_FILT_CNT_MASK) -/*! @} */ - -/* The count of PWM_CAPTFILTX */ -#define PWM_CAPTFILTX_COUNT (4U) - -/*! @name OUTEN - Output Enable Register */ -/*! @{ */ - -#define PWM_OUTEN_PWMX_EN_MASK (0xFU) -#define PWM_OUTEN_PWMX_EN_SHIFT (0U) -/*! PWMX_EN - PWM_X Output Enables */ -#define PWM_OUTEN_PWMX_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_OUTEN_PWMX_EN_SHIFT)) & PWM_OUTEN_PWMX_EN_MASK) - -#define PWM_OUTEN_PWMB_EN_MASK (0xF0U) -#define PWM_OUTEN_PWMB_EN_SHIFT (4U) -/*! PWMB_EN - PWM_B Output Enables */ -#define PWM_OUTEN_PWMB_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_OUTEN_PWMB_EN_SHIFT)) & PWM_OUTEN_PWMB_EN_MASK) - -#define PWM_OUTEN_PWMA_EN_MASK (0xF00U) -#define PWM_OUTEN_PWMA_EN_SHIFT (8U) -/*! PWMA_EN - PWM_A Output Enables */ -#define PWM_OUTEN_PWMA_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_OUTEN_PWMA_EN_SHIFT)) & PWM_OUTEN_PWMA_EN_MASK) -/*! @} */ - -/*! @name MASK - Mask Register */ -/*! @{ */ - -#define PWM_MASK_MASKX_MASK (0xFU) -#define PWM_MASK_MASKX_SHIFT (0U) -/*! MASKX - PWM_X Masks */ -#define PWM_MASK_MASKX(x) (((uint16_t)(((uint16_t)(x)) << PWM_MASK_MASKX_SHIFT)) & PWM_MASK_MASKX_MASK) - -#define PWM_MASK_MASKB_MASK (0xF0U) -#define PWM_MASK_MASKB_SHIFT (4U) -/*! MASKB - PWM_B Masks */ -#define PWM_MASK_MASKB(x) (((uint16_t)(((uint16_t)(x)) << PWM_MASK_MASKB_SHIFT)) & PWM_MASK_MASKB_MASK) - -#define PWM_MASK_MASKA_MASK (0xF00U) -#define PWM_MASK_MASKA_SHIFT (8U) -/*! MASKA - PWM_A Masks */ -#define PWM_MASK_MASKA(x) (((uint16_t)(((uint16_t)(x)) << PWM_MASK_MASKA_SHIFT)) & PWM_MASK_MASKA_MASK) - -#define PWM_MASK_UPDATE_MASK_MASK (0xF000U) -#define PWM_MASK_UPDATE_MASK_SHIFT (12U) -/*! UPDATE_MASK - Update Mask Bits Immediately */ -#define PWM_MASK_UPDATE_MASK(x) (((uint16_t)(((uint16_t)(x)) << PWM_MASK_UPDATE_MASK_SHIFT)) & PWM_MASK_UPDATE_MASK_MASK) -/*! @} */ - -/*! @name SWCOUT - Software Controlled Output Register */ -/*! @{ */ - -#define PWM_SWCOUT_SM0OUT45_MASK (0x1U) -#define PWM_SWCOUT_SM0OUT45_SHIFT (0U) -/*! SM0OUT45 - Submodule 0 Software Controlled Output 45 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 0 instead of PWM45. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 0 instead of PWM45. - */ -#define PWM_SWCOUT_SM0OUT45(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM0OUT45_SHIFT)) & PWM_SWCOUT_SM0OUT45_MASK) - -#define PWM_SWCOUT_SM0OUT23_MASK (0x2U) -#define PWM_SWCOUT_SM0OUT23_SHIFT (1U) -/*! SM0OUT23 - Submodule 0 Software Controlled Output 23 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 0 instead of PWM23. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 0 instead of PWM23. - */ -#define PWM_SWCOUT_SM0OUT23(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM0OUT23_SHIFT)) & PWM_SWCOUT_SM0OUT23_MASK) - -#define PWM_SWCOUT_SM1OUT45_MASK (0x4U) -#define PWM_SWCOUT_SM1OUT45_SHIFT (2U) -/*! SM1OUT45 - Submodule 1 Software Controlled Output 45 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 1 instead of PWM45. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 1 instead of PWM45. - */ -#define PWM_SWCOUT_SM1OUT45(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM1OUT45_SHIFT)) & PWM_SWCOUT_SM1OUT45_MASK) - -#define PWM_SWCOUT_SM1OUT23_MASK (0x8U) -#define PWM_SWCOUT_SM1OUT23_SHIFT (3U) -/*! SM1OUT23 - Submodule 1 Software Controlled Output 23 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 1 instead of PWM23. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 1 instead of PWM23. - */ -#define PWM_SWCOUT_SM1OUT23(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM1OUT23_SHIFT)) & PWM_SWCOUT_SM1OUT23_MASK) - -#define PWM_SWCOUT_SM2OUT45_MASK (0x10U) -#define PWM_SWCOUT_SM2OUT45_SHIFT (4U) -/*! SM2OUT45 - Submodule 2 Software Controlled Output 45 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 2 instead of PWM45. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 2 instead of PWM45. - */ -#define PWM_SWCOUT_SM2OUT45(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM2OUT45_SHIFT)) & PWM_SWCOUT_SM2OUT45_MASK) - -#define PWM_SWCOUT_SM2OUT23_MASK (0x20U) -#define PWM_SWCOUT_SM2OUT23_SHIFT (5U) -/*! SM2OUT23 - Submodule 2 Software Controlled Output 23 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 2 instead of PWM23. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 2 instead of PWM23. - */ -#define PWM_SWCOUT_SM2OUT23(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM2OUT23_SHIFT)) & PWM_SWCOUT_SM2OUT23_MASK) - -#define PWM_SWCOUT_SM3OUT45_MASK (0x40U) -#define PWM_SWCOUT_SM3OUT45_SHIFT (6U) -/*! SM3OUT45 - Submodule 3 Software Controlled Output 45 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 3 instead of PWM45. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 3 instead of PWM45. - */ -#define PWM_SWCOUT_SM3OUT45(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM3OUT45_SHIFT)) & PWM_SWCOUT_SM3OUT45_MASK) - -#define PWM_SWCOUT_SM3OUT23_MASK (0x80U) -#define PWM_SWCOUT_SM3OUT23_SHIFT (7U) -/*! SM3OUT23 - Submodule 3 Software Controlled Output 23 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 3 instead of PWM23. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 3 instead of PWM23. - */ -#define PWM_SWCOUT_SM3OUT23(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM3OUT23_SHIFT)) & PWM_SWCOUT_SM3OUT23_MASK) -/*! @} */ - -/*! @name DTSRCSEL - PWM Source Select Register */ -/*! @{ */ - -#define PWM_DTSRCSEL_SM0SEL45_MASK (0x3U) -#define PWM_DTSRCSEL_SM0SEL45_SHIFT (0U) -/*! SM0SEL45 - Submodule 0 PWM45 Control Select - * 0b00..Generated SM0PWM45 signal used by the deadtime logic. - * 0b01..Inverted generated SM0PWM45 signal used by the deadtime logic. - * 0b10..SWCOUT[SM0OUT45] used by the deadtime logic. - * 0b11..Reserved - */ -#define PWM_DTSRCSEL_SM0SEL45(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM0SEL45_SHIFT)) & PWM_DTSRCSEL_SM0SEL45_MASK) - -#define PWM_DTSRCSEL_SM0SEL23_MASK (0xCU) -#define PWM_DTSRCSEL_SM0SEL23_SHIFT (2U) -/*! SM0SEL23 - Submodule 0 PWM23 Control Select - * 0b00..Generated SM0PWM23 signal used by the deadtime logic. - * 0b01..Inverted generated SM0PWM23 signal used by the deadtime logic. - * 0b10..SWCOUT[SM0OUT23] used by the deadtime logic. - * 0b11..PWM0_EXTA signal used by the deadtime logic. - */ -#define PWM_DTSRCSEL_SM0SEL23(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM0SEL23_SHIFT)) & PWM_DTSRCSEL_SM0SEL23_MASK) - -#define PWM_DTSRCSEL_SM1SEL45_MASK (0x30U) -#define PWM_DTSRCSEL_SM1SEL45_SHIFT (4U) -/*! SM1SEL45 - Submodule 1 PWM45 Control Select - * 0b00..Generated SM1PWM45 signal used by the deadtime logic. - * 0b01..Inverted generated SM1PWM45 signal used by the deadtime logic. - * 0b10..SWCOUT[SM1OUT45] used by the deadtime logic. - * 0b11..Reserved - */ -#define PWM_DTSRCSEL_SM1SEL45(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM1SEL45_SHIFT)) & PWM_DTSRCSEL_SM1SEL45_MASK) - -#define PWM_DTSRCSEL_SM1SEL23_MASK (0xC0U) -#define PWM_DTSRCSEL_SM1SEL23_SHIFT (6U) -/*! SM1SEL23 - Submodule 1 PWM23 Control Select - * 0b00..Generated SM1PWM23 signal used by the deadtime logic. - * 0b01..Inverted generated SM1PWM23 signal used by the deadtime logic. - * 0b10..SWCOUT[SM1OUT23] used by the deadtime logic. - * 0b11..PWM1_EXTA signal used by the deadtime logic. - */ -#define PWM_DTSRCSEL_SM1SEL23(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM1SEL23_SHIFT)) & PWM_DTSRCSEL_SM1SEL23_MASK) - -#define PWM_DTSRCSEL_SM2SEL45_MASK (0x300U) -#define PWM_DTSRCSEL_SM2SEL45_SHIFT (8U) -/*! SM2SEL45 - Submodule 2 PWM45 Control Select - * 0b00..Generated SM2PWM45 signal used by the deadtime logic. - * 0b01..Inverted generated SM2PWM45 signal used by the deadtime logic. - * 0b10..SWCOUT[SM2OUT45] used by the deadtime logic. - * 0b11..Reserved - */ -#define PWM_DTSRCSEL_SM2SEL45(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM2SEL45_SHIFT)) & PWM_DTSRCSEL_SM2SEL45_MASK) - -#define PWM_DTSRCSEL_SM2SEL23_MASK (0xC00U) -#define PWM_DTSRCSEL_SM2SEL23_SHIFT (10U) -/*! SM2SEL23 - Submodule 2 PWM23 Control Select - * 0b00..Generated SM2PWM23 signal used by the deadtime logic. - * 0b01..Inverted generated SM2PWM23 signal used by the deadtime logic. - * 0b10..SWCOUT[SM2OUT23] used by the deadtime logic. - * 0b11..PWM2_EXTA signal used by the deadtime logic. - */ -#define PWM_DTSRCSEL_SM2SEL23(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM2SEL23_SHIFT)) & PWM_DTSRCSEL_SM2SEL23_MASK) - -#define PWM_DTSRCSEL_SM3SEL45_MASK (0x3000U) -#define PWM_DTSRCSEL_SM3SEL45_SHIFT (12U) -/*! SM3SEL45 - Submodule 3 PWM45 Control Select - * 0b00..Generated SM3PWM45 signal used by the deadtime logic. - * 0b01..Inverted generated SM3PWM45 signal used by the deadtime logic. - * 0b10..SWCOUT[SM3OUT45] used by the deadtime logic. - * 0b11..Reserved - */ -#define PWM_DTSRCSEL_SM3SEL45(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM3SEL45_SHIFT)) & PWM_DTSRCSEL_SM3SEL45_MASK) - -#define PWM_DTSRCSEL_SM3SEL23_MASK (0xC000U) -#define PWM_DTSRCSEL_SM3SEL23_SHIFT (14U) -/*! SM3SEL23 - Submodule 3 PWM23 Control Select - * 0b00..Generated SM3PWM23 signal used by the deadtime logic. - * 0b01..Inverted generated SM3PWM23 signal used by the deadtime logic. - * 0b10..SWCOUT[SM3OUT23] used by the deadtime logic. - * 0b11..PWM3_EXTA signal used by the deadtime logic. - */ -#define PWM_DTSRCSEL_SM3SEL23(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM3SEL23_SHIFT)) & PWM_DTSRCSEL_SM3SEL23_MASK) -/*! @} */ - -/*! @name MCTRL - Master Control Register */ -/*! @{ */ - -#define PWM_MCTRL_LDOK_MASK (0xFU) -#define PWM_MCTRL_LDOK_SHIFT (0U) -/*! LDOK - Load Okay - * 0b0000..Do not load new values. - * 0b0001..Load prescaler, modulus, and PWM values of the corresponding submodule. - */ -#define PWM_MCTRL_LDOK(x) (((uint16_t)(((uint16_t)(x)) << PWM_MCTRL_LDOK_SHIFT)) & PWM_MCTRL_LDOK_MASK) - -#define PWM_MCTRL_CLDOK_MASK (0xF0U) -#define PWM_MCTRL_CLDOK_SHIFT (4U) -/*! CLDOK - Clear Load Okay */ -#define PWM_MCTRL_CLDOK(x) (((uint16_t)(((uint16_t)(x)) << PWM_MCTRL_CLDOK_SHIFT)) & PWM_MCTRL_CLDOK_MASK) - -#define PWM_MCTRL_RUN_MASK (0xF00U) -#define PWM_MCTRL_RUN_SHIFT (8U) -/*! RUN - Run - * 0b0000..PWM counter is stopped, but PWM outputs hold the current state. - * 0b0001..PWM counter is started in the corresponding submodule. - */ -#define PWM_MCTRL_RUN(x) (((uint16_t)(((uint16_t)(x)) << PWM_MCTRL_RUN_SHIFT)) & PWM_MCTRL_RUN_MASK) - -#define PWM_MCTRL_IPOL_MASK (0xF000U) -#define PWM_MCTRL_IPOL_SHIFT (12U) -/*! IPOL - Current Polarity - * 0b0000..PWM23 is used to generate complementary PWM pair in the corresponding submodule. - * 0b0001..PWM45 is used to generate complementary PWM pair in the corresponding submodule. - */ -#define PWM_MCTRL_IPOL(x) (((uint16_t)(((uint16_t)(x)) << PWM_MCTRL_IPOL_SHIFT)) & PWM_MCTRL_IPOL_MASK) -/*! @} */ - -/*! @name MCTRL2 - Master Control 2 Register */ -/*! @{ */ - -#define PWM_MCTRL2_WRPROT_MASK (0xCU) -#define PWM_MCTRL2_WRPROT_SHIFT (2U) -/*! WRPROT - Write protect - * 0b00..Write protection off (default). - * 0b01..Write protection on. - * 0b10..Write protection off and locked until chip reset. - * 0b11..Write protection on and locked until chip reset. - */ -#define PWM_MCTRL2_WRPROT(x) (((uint16_t)(((uint16_t)(x)) << PWM_MCTRL2_WRPROT_SHIFT)) & PWM_MCTRL2_WRPROT_MASK) - -#define PWM_MCTRL2_STRETCH_CNT_PRSC_MASK (0xC0U) -#define PWM_MCTRL2_STRETCH_CNT_PRSC_SHIFT (6U) -/*! STRETCH_CNT_PRSC - Stretch IPBus clock count prescaler for mux0_trig/mux1_trig/out0_trig/out1_trig/pwma_trig/pwmb_trig - * 0b00..Stretch count is zero, no stretch. - * 0b01..Stretch mux0_trig/mux1_trig/out0_trig/out1_trig/pwma_trig/pwmb_trig for 2 IPBus clock period. - * 0b10..Stretch mux0_trig/mux1_trig/out0_trig/out1_trig/pwma_trig/pwmb_trig for 4 IPBus clock period. - * 0b11..Stretch mux0_trig/mux1_trig/out0_trig/out1_trig/pwma_trig/pwmb_trig for 8 IPBus clock period. - */ -#define PWM_MCTRL2_STRETCH_CNT_PRSC(x) (((uint16_t)(((uint16_t)(x)) << PWM_MCTRL2_STRETCH_CNT_PRSC_SHIFT)) & PWM_MCTRL2_STRETCH_CNT_PRSC_MASK) -/*! @} */ - -/*! @name FCTRL - Fault Control Register */ -/*! @{ */ - -#define PWM_FCTRL_FIE_MASK (0xFU) -#define PWM_FCTRL_FIE_SHIFT (0U) -/*! FIE - Fault Interrupt Enables - * 0b0000..FAULTx CPU interrupt requests disabled. - * 0b0001..FAULTx CPU interrupt requests enabled. - */ -#define PWM_FCTRL_FIE(x) (((uint16_t)(((uint16_t)(x)) << PWM_FCTRL_FIE_SHIFT)) & PWM_FCTRL_FIE_MASK) - -#define PWM_FCTRL_FSAFE_MASK (0xF0U) -#define PWM_FCTRL_FSAFE_SHIFT (4U) -/*! FSAFE - Fault Safety Mode - * 0b0000..Normal mode. PWM outputs disabled by this fault are not enabled until FSTS[FFLAGx] is clear at the - * start of a half cycle or full cycle depending on the states of FSTS[FHALF] and FSTS[FFULL] without regard - * to the state of FSTS[FFPINx]. If neither FHALF nor FFULL is set, then the fault condition cannot be - * cleared. The PWM outputs disabled by this fault input will not be re-enabled until the actual FAULTx input - * signal de-asserts since the fault input will combinationally disable the PWM outputs (as programmed in - * DISMAPn). - * 0b0001..Safe mode. PWM outputs disabled by this fault are not enabled until FSTS[FFLAGx] is clear and - * FSTS[FFPINx] is clear at the start of a half cycle or full cycle depending on the states of FSTS[FHALF] and - * FSTS[FFULL]. If neither FHLAF nor FFULL is set, then the fault condition cannot be cleared. - */ -#define PWM_FCTRL_FSAFE(x) (((uint16_t)(((uint16_t)(x)) << PWM_FCTRL_FSAFE_SHIFT)) & PWM_FCTRL_FSAFE_MASK) - -#define PWM_FCTRL_FAUTO_MASK (0xF00U) -#define PWM_FCTRL_FAUTO_SHIFT (8U) -/*! FAUTO - Automatic Fault Clearing - * 0b0000..Manual fault clearing. PWM outputs disabled by this fault are not enabled until FSTS[FFLAGx] is clear - * at the start of a half cycle or full cycle depending on the states of FSTS[FHALF] and FSTS[FFULL]. If - * neither FFULL nor FHALF is set, then the fault condition cannot be cleared. This is further controlled - * by FCTRL[FSAFE]. - * 0b0001..Automatic fault clearing. PWM outputs disabled by this fault are enabled when FSTS[FFPINx] is clear at - * the start of a half cycle or full cycle depending on the states of FSTS[FHALF] and FSTS[FFULL] without - * regard to the state of FSTS[FFLAGx]. If neither FFULL nor FHALF is set, then the fault condition - * cannot be cleared. - */ -#define PWM_FCTRL_FAUTO(x) (((uint16_t)(((uint16_t)(x)) << PWM_FCTRL_FAUTO_SHIFT)) & PWM_FCTRL_FAUTO_MASK) - -#define PWM_FCTRL_FLVL_MASK (0xF000U) -#define PWM_FCTRL_FLVL_SHIFT (12U) -/*! FLVL - Fault Level - * 0b0000..A logic 0 on the fault input indicates a fault condition. - * 0b0001..A logic 1 on the fault input indicates a fault condition. - */ -#define PWM_FCTRL_FLVL(x) (((uint16_t)(((uint16_t)(x)) << PWM_FCTRL_FLVL_SHIFT)) & PWM_FCTRL_FLVL_MASK) -/*! @} */ - -/*! @name FSTS - Fault Status Register */ -/*! @{ */ - -#define PWM_FSTS_FFLAG_MASK (0xFU) -#define PWM_FSTS_FFLAG_SHIFT (0U) -/*! FFLAG - Fault Flags - * 0b0000..No fault on the FAULTx pin. - * 0b0001..Fault on the FAULTx pin. - */ -#define PWM_FSTS_FFLAG(x) (((uint16_t)(((uint16_t)(x)) << PWM_FSTS_FFLAG_SHIFT)) & PWM_FSTS_FFLAG_MASK) - -#define PWM_FSTS_FFULL_MASK (0xF0U) -#define PWM_FSTS_FFULL_SHIFT (4U) -/*! FFULL - Full Cycle - * 0b0000..PWM outputs are not re-enabled at the start of a full cycle - * 0b0001..PWM outputs are re-enabled at the start of a full cycle - */ -#define PWM_FSTS_FFULL(x) (((uint16_t)(((uint16_t)(x)) << PWM_FSTS_FFULL_SHIFT)) & PWM_FSTS_FFULL_MASK) - -#define PWM_FSTS_FFPIN_MASK (0xF00U) -#define PWM_FSTS_FFPIN_SHIFT (8U) -/*! FFPIN - Filtered Fault Pins */ -#define PWM_FSTS_FFPIN(x) (((uint16_t)(((uint16_t)(x)) << PWM_FSTS_FFPIN_SHIFT)) & PWM_FSTS_FFPIN_MASK) - -#define PWM_FSTS_FHALF_MASK (0xF000U) -#define PWM_FSTS_FHALF_SHIFT (12U) -/*! FHALF - Half Cycle Fault Recovery - * 0b0000..PWM outputs are not re-enabled at the start of a half cycle. - * 0b0001..PWM outputs are re-enabled at the start of a half cycle (as defined by VAL0). - */ -#define PWM_FSTS_FHALF(x) (((uint16_t)(((uint16_t)(x)) << PWM_FSTS_FHALF_SHIFT)) & PWM_FSTS_FHALF_MASK) -/*! @} */ - -/*! @name FFILT - Fault Filter Register */ -/*! @{ */ - -#define PWM_FFILT_FILT_PER_MASK (0xFFU) -#define PWM_FFILT_FILT_PER_SHIFT (0U) -/*! FILT_PER - Fault Filter Period */ -#define PWM_FFILT_FILT_PER(x) (((uint16_t)(((uint16_t)(x)) << PWM_FFILT_FILT_PER_SHIFT)) & PWM_FFILT_FILT_PER_MASK) - -#define PWM_FFILT_FILT_CNT_MASK (0x700U) -#define PWM_FFILT_FILT_CNT_SHIFT (8U) -/*! FILT_CNT - Fault Filter Count */ -#define PWM_FFILT_FILT_CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_FFILT_FILT_CNT_SHIFT)) & PWM_FFILT_FILT_CNT_MASK) - -#define PWM_FFILT_GSTR_MASK (0x8000U) -#define PWM_FFILT_GSTR_SHIFT (15U) -/*! GSTR - Fault Glitch Stretch Enable - * 0b0..Fault input glitch stretching is disabled. - * 0b1..Input fault signals are stretched to at least 2 IPBus clock cycles. - */ -#define PWM_FFILT_GSTR(x) (((uint16_t)(((uint16_t)(x)) << PWM_FFILT_GSTR_SHIFT)) & PWM_FFILT_GSTR_MASK) -/*! @} */ - -/*! @name FTST - Fault Test Register */ -/*! @{ */ - -#define PWM_FTST_FTEST_MASK (0x1U) -#define PWM_FTST_FTEST_SHIFT (0U) -/*! FTEST - Fault Test - * 0b0..No fault - * 0b1..Cause a simulated fault - */ -#define PWM_FTST_FTEST(x) (((uint16_t)(((uint16_t)(x)) << PWM_FTST_FTEST_SHIFT)) & PWM_FTST_FTEST_MASK) -/*! @} */ - -/*! @name FCTRL2 - Fault Control 2 Register */ -/*! @{ */ - -#define PWM_FCTRL2_NOCOMB_MASK (0xFU) -#define PWM_FCTRL2_NOCOMB_SHIFT (0U) -/*! NOCOMB - No Combinational Path From Fault Input To PWM Output - * 0b0000..There is a combinational link from the fault inputs to the PWM outputs. The fault inputs are combined - * with the filtered and latched fault signals to disable the PWM outputs. - * 0b0001..The direct combinational path from the fault inputs to the PWM outputs is disabled and the filtered - * and latched fault signals are used to disable the PWM outputs. - */ -#define PWM_FCTRL2_NOCOMB(x) (((uint16_t)(((uint16_t)(x)) << PWM_FCTRL2_NOCOMB_SHIFT)) & PWM_FCTRL2_NOCOMB_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group PWM_Register_Masks */ - - -/* PWM - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral PWM0 base address */ - #define PWM0_BASE (0x500CE000u) - /** Peripheral PWM0 base address */ - #define PWM0_BASE_NS (0x400CE000u) - /** Peripheral PWM0 base pointer */ - #define PWM0 ((PWM_Type *)PWM0_BASE) - /** Peripheral PWM0 base pointer */ - #define PWM0_NS ((PWM_Type *)PWM0_BASE_NS) - /** Peripheral PWM1 base address */ - #define PWM1_BASE (0x500D0000u) - /** Peripheral PWM1 base address */ - #define PWM1_BASE_NS (0x400D0000u) - /** Peripheral PWM1 base pointer */ - #define PWM1 ((PWM_Type *)PWM1_BASE) - /** Peripheral PWM1 base pointer */ - #define PWM1_NS ((PWM_Type *)PWM1_BASE_NS) - /** Array initializer of PWM peripheral base addresses */ - #define PWM_BASE_ADDRS { PWM0_BASE, PWM1_BASE } - /** Array initializer of PWM peripheral base pointers */ - #define PWM_BASE_PTRS { PWM0, PWM1 } - /** Array initializer of PWM peripheral base addresses */ - #define PWM_BASE_ADDRS_NS { PWM0_BASE_NS, PWM1_BASE_NS } - /** Array initializer of PWM peripheral base pointers */ - #define PWM_BASE_PTRS_NS { PWM0_NS, PWM1_NS } -#else - /** Peripheral PWM0 base address */ - #define PWM0_BASE (0x400CE000u) - /** Peripheral PWM0 base pointer */ - #define PWM0 ((PWM_Type *)PWM0_BASE) - /** Peripheral PWM1 base address */ - #define PWM1_BASE (0x400D0000u) - /** Peripheral PWM1 base pointer */ - #define PWM1 ((PWM_Type *)PWM1_BASE) - /** Array initializer of PWM peripheral base addresses */ - #define PWM_BASE_ADDRS { PWM0_BASE, PWM1_BASE } - /** Array initializer of PWM peripheral base pointers */ - #define PWM_BASE_PTRS { PWM0, PWM1 } -#endif -/** Interrupt vectors for the PWM peripheral type */ -#define PWM_CMP_IRQS { { FLEXPWM0_SUBMODULE0_IRQn, FLEXPWM0_SUBMODULE1_IRQn, FLEXPWM0_SUBMODULE2_IRQn, FLEXPWM0_SUBMODULE3_IRQn }, { FLEXPWM1_SUBMODULE0_IRQn, FLEXPWM1_SUBMODULE1_IRQn, FLEXPWM1_SUBMODULE2_IRQn, FLEXPWM1_SUBMODULE3_IRQn } } -#define PWM_RELOAD_IRQS { { FLEXPWM0_SUBMODULE0_IRQn, FLEXPWM0_SUBMODULE1_IRQn, FLEXPWM0_SUBMODULE2_IRQn, FLEXPWM0_SUBMODULE3_IRQn }, { FLEXPWM1_SUBMODULE0_IRQn, FLEXPWM1_SUBMODULE1_IRQn, FLEXPWM1_SUBMODULE2_IRQn, FLEXPWM1_SUBMODULE3_IRQn } } -#define PWM_CAPTURE_IRQS { { FLEXPWM0_SUBMODULE0_IRQn, FLEXPWM0_SUBMODULE1_IRQn, FLEXPWM0_SUBMODULE2_IRQn, FLEXPWM0_SUBMODULE3_IRQn }, { FLEXPWM1_SUBMODULE0_IRQn, FLEXPWM1_SUBMODULE1_IRQn, FLEXPWM1_SUBMODULE2_IRQn, FLEXPWM1_SUBMODULE3_IRQn } } -#define PWM_FAULT_IRQS { FLEXPWM0_FAULT_IRQn, FLEXPWM1_FAULT_IRQn } -#define PWM_RELOAD_ERROR_IRQS { FLEXPWM0_RELOAD_ERROR_IRQn, FLEXPWM1_RELOAD_ERROR_IRQn } - -/*! - * @} - */ /* end of group PWM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- QDC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup QDC_Peripheral_Access_Layer QDC Peripheral Access Layer - * @{ - */ - -/** QDC - Register Layout Typedef */ -typedef struct { - __IO uint16_t CTRL; /**< Control, offset: 0x0 */ - __IO uint16_t FILT; /**< Input Filter, offset: 0x2 */ - __IO uint16_t WTR; /**< Watchdog Timeout, offset: 0x4 */ - __IO uint16_t POSD; /**< Position Difference Counter, offset: 0x6 */ - __I uint16_t POSDH; /**< Position Difference Hold, offset: 0x8 */ - __IO uint16_t REV; /**< Revolution Counter, offset: 0xA */ - __I uint16_t REVH; /**< Revolution Hold, offset: 0xC */ - __IO uint16_t UPOS; /**< Upper Position Counter, offset: 0xE */ - __IO uint16_t LPOS; /**< Lower Position Counter, offset: 0x10 */ - __I uint16_t UPOSH; /**< Upper Position Hold, offset: 0x12 */ - __I uint16_t LPOSH; /**< Lower Position Hold, offset: 0x14 */ - __IO uint16_t UINIT; /**< Upper Initialization, offset: 0x16 */ - __IO uint16_t LINIT; /**< Lower Initialization, offset: 0x18 */ - __I uint16_t IMR; /**< Input Monitor, offset: 0x1A */ - __IO uint16_t TST; /**< Test, offset: 0x1C */ - __IO uint16_t CTRL2; /**< Control 2, offset: 0x1E */ - __IO uint16_t UMOD; /**< Upper Modulus, offset: 0x20 */ - __IO uint16_t LMOD; /**< Lower Modulus, offset: 0x22 */ - __IO uint16_t UCOMP; /**< Upper Position Compare, offset: 0x24 */ - __IO uint16_t LCOMP; /**< Lower Position Compare, offset: 0x26 */ - __I uint16_t LASTEDGE; /**< Last Edge Time, offset: 0x28 */ - __I uint16_t LASTEDGEH; /**< Last Edge Time Hold, offset: 0x2A */ - __I uint16_t POSDPER; /**< Position Difference Period Counter, offset: 0x2C */ - __I uint16_t POSDPERBFR; /**< Position Difference Period Buffer, offset: 0x2E */ - __I uint16_t POSDPERH; /**< Position Difference Period Hold, offset: 0x30 */ - __IO uint16_t CTRL3; /**< Control 3, offset: 0x32 */ -} QDC_Type; - -/* ---------------------------------------------------------------------------- - -- QDC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup QDC_Register_Masks QDC Register Masks - * @{ - */ - -/*! @name CTRL - Control */ -/*! @{ */ - -#define QDC_CTRL_CMPIE_MASK (0x1U) -#define QDC_CTRL_CMPIE_SHIFT (0U) -/*! CMPIE - Compare Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL_CMPIE(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_CMPIE_SHIFT)) & QDC_CTRL_CMPIE_MASK) - -#define QDC_CTRL_CMPIRQ_MASK (0x2U) -#define QDC_CTRL_CMPIRQ_SHIFT (1U) -/*! CMPIRQ - Compare Interrupt Request - * 0b0..No match has occurred - * 0b1..COMP match has occurred - */ -#define QDC_CTRL_CMPIRQ(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_CMPIRQ_SHIFT)) & QDC_CTRL_CMPIRQ_MASK) - -#define QDC_CTRL_WDE_MASK (0x4U) -#define QDC_CTRL_WDE_SHIFT (2U) -/*! WDE - Watchdog Enable - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL_WDE(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_WDE_SHIFT)) & QDC_CTRL_WDE_MASK) - -#define QDC_CTRL_DIE_MASK (0x8U) -#define QDC_CTRL_DIE_SHIFT (3U) -/*! DIE - Watchdog Timeout Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL_DIE(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_DIE_SHIFT)) & QDC_CTRL_DIE_MASK) - -#define QDC_CTRL_DIRQ_MASK (0x10U) -#define QDC_CTRL_DIRQ_SHIFT (4U) -/*! DIRQ - Watchdog Timeout Interrupt Request - * 0b0..Not occurred - * 0b1..Occurred - */ -#define QDC_CTRL_DIRQ(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_DIRQ_SHIFT)) & QDC_CTRL_DIRQ_MASK) - -#define QDC_CTRL_XNE_MASK (0x20U) -#define QDC_CTRL_XNE_SHIFT (5U) -/*! XNE - Select Positive and Negative Edge of INDEX Pulse - * 0b0..Use positive edge - * 0b1..Use negative edge - */ -#define QDC_CTRL_XNE(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_XNE_SHIFT)) & QDC_CTRL_XNE_MASK) - -#define QDC_CTRL_XIP_MASK (0x40U) -#define QDC_CTRL_XIP_SHIFT (6U) -/*! XIP - INDEX Triggered Initialization of Position Counters UPOS and LPOS - * 0b0..Does not initialize - * 0b1..Initializes - */ -#define QDC_CTRL_XIP(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_XIP_SHIFT)) & QDC_CTRL_XIP_MASK) - -#define QDC_CTRL_XIE_MASK (0x80U) -#define QDC_CTRL_XIE_SHIFT (7U) -/*! XIE - INDEX Pulse Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL_XIE(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_XIE_SHIFT)) & QDC_CTRL_XIE_MASK) - -#define QDC_CTRL_XIRQ_MASK (0x100U) -#define QDC_CTRL_XIRQ_SHIFT (8U) -/*! XIRQ - INDEX Pulse Interrupt Request - * 0b0..Not occurred - * 0b1..Occurred - */ -#define QDC_CTRL_XIRQ(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_XIRQ_SHIFT)) & QDC_CTRL_XIRQ_MASK) - -#define QDC_CTRL_PH1_MASK (0x200U) -#define QDC_CTRL_PH1_SHIFT (9U) -/*! PH1 - Enable Signal Phase Count Mode - * 0b0..Uses the standard quadrature decoder, where PHASEA and PHASEB represent a two-phase quadrature signal. - * 0b1..Bypasses the quadrature decoder. A positive transition of the PHASEA input generates a count signal. - * PHASEB input and CTRL[REV] controls the counter direction. If the value of CTRL[REV] and PHASEB are identical; - * then count is up. If the value of CTRL[REV] and PHASEB is different, then count is down. - */ -#define QDC_CTRL_PH1(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_PH1_SHIFT)) & QDC_CTRL_PH1_MASK) - -#define QDC_CTRL_REV_MASK (0x400U) -#define QDC_CTRL_REV_SHIFT (10U) -/*! REV - Enable Reverse Direction Counting - * 0b0..Counts normally - * 0b1..Counts in the reverse direction - */ -#define QDC_CTRL_REV(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_REV_SHIFT)) & QDC_CTRL_REV_MASK) - -#define QDC_CTRL_SWIP_MASK (0x800U) -#define QDC_CTRL_SWIP_SHIFT (11U) -/*! SWIP - Software-Triggered Initialization of Position Counters UPOS and LPOS - * 0b0..No action - * 0b1..Initialize position counter - */ -#define QDC_CTRL_SWIP(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_SWIP_SHIFT)) & QDC_CTRL_SWIP_MASK) - -#define QDC_CTRL_HNE_MASK (0x1000U) -#define QDC_CTRL_HNE_SHIFT (12U) -/*! HNE - Use Negative Edge of HOME Input - * 0b0..Use positive-going edge-to-trigger initialization of position counters UPOS and LPOS - * 0b1..Use negative-going edge-to-trigger initialization of position counters UPOS and LPOS - */ -#define QDC_CTRL_HNE(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_HNE_SHIFT)) & QDC_CTRL_HNE_MASK) - -#define QDC_CTRL_HIP_MASK (0x2000U) -#define QDC_CTRL_HIP_SHIFT (13U) -/*! HIP - Enable HOME to Initialize Position Counters UPOS and LPOS - * 0b0..No action - * 0b1..HOME signal initializes the position counter - */ -#define QDC_CTRL_HIP(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_HIP_SHIFT)) & QDC_CTRL_HIP_MASK) - -#define QDC_CTRL_HIE_MASK (0x4000U) -#define QDC_CTRL_HIE_SHIFT (14U) -/*! HIE - HOME Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL_HIE(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_HIE_SHIFT)) & QDC_CTRL_HIE_MASK) - -#define QDC_CTRL_HIRQ_MASK (0x8000U) -#define QDC_CTRL_HIRQ_SHIFT (15U) -/*! HIRQ - HOME Signal Transition Interrupt Request - * 0b0..Not occurred - * 0b1..Occurred - */ -#define QDC_CTRL_HIRQ(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_HIRQ_SHIFT)) & QDC_CTRL_HIRQ_MASK) -/*! @} */ - -/*! @name FILT - Input Filter */ -/*! @{ */ - -#define QDC_FILT_FILT_PER_MASK (0xFFU) -#define QDC_FILT_FILT_PER_SHIFT (0U) -/*! FILT_PER - Input Filter Sample Period */ -#define QDC_FILT_FILT_PER(x) (((uint16_t)(((uint16_t)(x)) << QDC_FILT_FILT_PER_SHIFT)) & QDC_FILT_FILT_PER_MASK) - -#define QDC_FILT_FILT_CNT_MASK (0x700U) -#define QDC_FILT_FILT_CNT_SHIFT (8U) -/*! FILT_CNT - Input Filter Sample Count */ -#define QDC_FILT_FILT_CNT(x) (((uint16_t)(((uint16_t)(x)) << QDC_FILT_FILT_CNT_SHIFT)) & QDC_FILT_FILT_CNT_MASK) - -#define QDC_FILT_FILT_PRSC_MASK (0xE000U) -#define QDC_FILT_FILT_PRSC_SHIFT (13U) -/*! FILT_PRSC - Prescaler Divide IPBus Clock to FILT Clock */ -#define QDC_FILT_FILT_PRSC(x) (((uint16_t)(((uint16_t)(x)) << QDC_FILT_FILT_PRSC_SHIFT)) & QDC_FILT_FILT_PRSC_MASK) -/*! @} */ - -/*! @name WTR - Watchdog Timeout */ -/*! @{ */ - -#define QDC_WTR_WDOG_MASK (0xFFFFU) -#define QDC_WTR_WDOG_SHIFT (0U) -/*! WDOG - WDOG */ -#define QDC_WTR_WDOG(x) (((uint16_t)(((uint16_t)(x)) << QDC_WTR_WDOG_SHIFT)) & QDC_WTR_WDOG_MASK) -/*! @} */ - -/*! @name POSD - Position Difference Counter */ -/*! @{ */ - -#define QDC_POSD_POSD_MASK (0xFFFFU) -#define QDC_POSD_POSD_SHIFT (0U) -/*! POSD - POSD */ -#define QDC_POSD_POSD(x) (((uint16_t)(((uint16_t)(x)) << QDC_POSD_POSD_SHIFT)) & QDC_POSD_POSD_MASK) -/*! @} */ - -/*! @name POSDH - Position Difference Hold */ -/*! @{ */ - -#define QDC_POSDH_POSDH_MASK (0xFFFFU) -#define QDC_POSDH_POSDH_SHIFT (0U) -/*! POSDH - POSDH */ -#define QDC_POSDH_POSDH(x) (((uint16_t)(((uint16_t)(x)) << QDC_POSDH_POSDH_SHIFT)) & QDC_POSDH_POSDH_MASK) -/*! @} */ - -/*! @name REV - Revolution Counter */ -/*! @{ */ - -#define QDC_REV_REV_MASK (0xFFFFU) -#define QDC_REV_REV_SHIFT (0U) -/*! REV - REV */ -#define QDC_REV_REV(x) (((uint16_t)(((uint16_t)(x)) << QDC_REV_REV_SHIFT)) & QDC_REV_REV_MASK) -/*! @} */ - -/*! @name REVH - Revolution Hold */ -/*! @{ */ - -#define QDC_REVH_REVH_MASK (0xFFFFU) -#define QDC_REVH_REVH_SHIFT (0U) -/*! REVH - REVH */ -#define QDC_REVH_REVH(x) (((uint16_t)(((uint16_t)(x)) << QDC_REVH_REVH_SHIFT)) & QDC_REVH_REVH_MASK) -/*! @} */ - -/*! @name UPOS - Upper Position Counter */ -/*! @{ */ - -#define QDC_UPOS_POS_MASK (0xFFFFU) -#define QDC_UPOS_POS_SHIFT (0U) -/*! POS - POS */ -#define QDC_UPOS_POS(x) (((uint16_t)(((uint16_t)(x)) << QDC_UPOS_POS_SHIFT)) & QDC_UPOS_POS_MASK) -/*! @} */ - -/*! @name LPOS - Lower Position Counter */ -/*! @{ */ - -#define QDC_LPOS_POS_MASK (0xFFFFU) -#define QDC_LPOS_POS_SHIFT (0U) -/*! POS - POS */ -#define QDC_LPOS_POS(x) (((uint16_t)(((uint16_t)(x)) << QDC_LPOS_POS_SHIFT)) & QDC_LPOS_POS_MASK) -/*! @} */ - -/*! @name UPOSH - Upper Position Hold */ -/*! @{ */ - -#define QDC_UPOSH_POSH_MASK (0xFFFFU) -#define QDC_UPOSH_POSH_SHIFT (0U) -/*! POSH - POSH */ -#define QDC_UPOSH_POSH(x) (((uint16_t)(((uint16_t)(x)) << QDC_UPOSH_POSH_SHIFT)) & QDC_UPOSH_POSH_MASK) -/*! @} */ - -/*! @name LPOSH - Lower Position Hold */ -/*! @{ */ - -#define QDC_LPOSH_POSH_MASK (0xFFFFU) -#define QDC_LPOSH_POSH_SHIFT (0U) -/*! POSH - POSH */ -#define QDC_LPOSH_POSH(x) (((uint16_t)(((uint16_t)(x)) << QDC_LPOSH_POSH_SHIFT)) & QDC_LPOSH_POSH_MASK) -/*! @} */ - -/*! @name UINIT - Upper Initialization */ -/*! @{ */ - -#define QDC_UINIT_INIT_MASK (0xFFFFU) -#define QDC_UINIT_INIT_SHIFT (0U) -/*! INIT - INIT */ -#define QDC_UINIT_INIT(x) (((uint16_t)(((uint16_t)(x)) << QDC_UINIT_INIT_SHIFT)) & QDC_UINIT_INIT_MASK) -/*! @} */ - -/*! @name LINIT - Lower Initialization */ -/*! @{ */ - -#define QDC_LINIT_INIT_MASK (0xFFFFU) -#define QDC_LINIT_INIT_SHIFT (0U) -/*! INIT - INIT */ -#define QDC_LINIT_INIT(x) (((uint16_t)(((uint16_t)(x)) << QDC_LINIT_INIT_SHIFT)) & QDC_LINIT_INIT_MASK) -/*! @} */ - -/*! @name IMR - Input Monitor */ -/*! @{ */ - -#define QDC_IMR_HOME_MASK (0x1U) -#define QDC_IMR_HOME_SHIFT (0U) -/*! HOME - HOME */ -#define QDC_IMR_HOME(x) (((uint16_t)(((uint16_t)(x)) << QDC_IMR_HOME_SHIFT)) & QDC_IMR_HOME_MASK) - -#define QDC_IMR_INDEX_MASK (0x2U) -#define QDC_IMR_INDEX_SHIFT (1U) -/*! INDEX - INDEX */ -#define QDC_IMR_INDEX(x) (((uint16_t)(((uint16_t)(x)) << QDC_IMR_INDEX_SHIFT)) & QDC_IMR_INDEX_MASK) - -#define QDC_IMR_PHB_MASK (0x4U) -#define QDC_IMR_PHB_SHIFT (2U) -/*! PHB - PHB */ -#define QDC_IMR_PHB(x) (((uint16_t)(((uint16_t)(x)) << QDC_IMR_PHB_SHIFT)) & QDC_IMR_PHB_MASK) - -#define QDC_IMR_PHA_MASK (0x8U) -#define QDC_IMR_PHA_SHIFT (3U) -/*! PHA - PHA */ -#define QDC_IMR_PHA(x) (((uint16_t)(((uint16_t)(x)) << QDC_IMR_PHA_SHIFT)) & QDC_IMR_PHA_MASK) - -#define QDC_IMR_FHOM_MASK (0x10U) -#define QDC_IMR_FHOM_SHIFT (4U) -/*! FHOM - FHOM */ -#define QDC_IMR_FHOM(x) (((uint16_t)(((uint16_t)(x)) << QDC_IMR_FHOM_SHIFT)) & QDC_IMR_FHOM_MASK) - -#define QDC_IMR_FIND_MASK (0x20U) -#define QDC_IMR_FIND_SHIFT (5U) -/*! FIND - FIND */ -#define QDC_IMR_FIND(x) (((uint16_t)(((uint16_t)(x)) << QDC_IMR_FIND_SHIFT)) & QDC_IMR_FIND_MASK) - -#define QDC_IMR_FPHB_MASK (0x40U) -#define QDC_IMR_FPHB_SHIFT (6U) -/*! FPHB - FPHB */ -#define QDC_IMR_FPHB(x) (((uint16_t)(((uint16_t)(x)) << QDC_IMR_FPHB_SHIFT)) & QDC_IMR_FPHB_MASK) - -#define QDC_IMR_FPHA_MASK (0x80U) -#define QDC_IMR_FPHA_SHIFT (7U) -/*! FPHA - FPHA */ -#define QDC_IMR_FPHA(x) (((uint16_t)(((uint16_t)(x)) << QDC_IMR_FPHA_SHIFT)) & QDC_IMR_FPHA_MASK) -/*! @} */ - -/*! @name TST - Test */ -/*! @{ */ - -#define QDC_TST_TEST_COUNT_MASK (0xFFU) -#define QDC_TST_TEST_COUNT_SHIFT (0U) -/*! TEST_COUNT - TEST_COUNT */ -#define QDC_TST_TEST_COUNT(x) (((uint16_t)(((uint16_t)(x)) << QDC_TST_TEST_COUNT_SHIFT)) & QDC_TST_TEST_COUNT_MASK) - -#define QDC_TST_TEST_PERIOD_MASK (0x1F00U) -#define QDC_TST_TEST_PERIOD_SHIFT (8U) -/*! TEST_PERIOD - TEST_PERIOD */ -#define QDC_TST_TEST_PERIOD(x) (((uint16_t)(((uint16_t)(x)) << QDC_TST_TEST_PERIOD_SHIFT)) & QDC_TST_TEST_PERIOD_MASK) - -#define QDC_TST_QDN_MASK (0x2000U) -#define QDC_TST_QDN_SHIFT (13U) -/*! QDN - Quadrature Decoder Negative Signal - * 0b0..Positive quadrature decoder signal - * 0b1..Negative quadrature decoder signal - */ -#define QDC_TST_QDN(x) (((uint16_t)(((uint16_t)(x)) << QDC_TST_QDN_SHIFT)) & QDC_TST_QDN_MASK) - -#define QDC_TST_TCE_MASK (0x4000U) -#define QDC_TST_TCE_SHIFT (14U) -/*! TCE - Test Counter Enable - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_TST_TCE(x) (((uint16_t)(((uint16_t)(x)) << QDC_TST_TCE_SHIFT)) & QDC_TST_TCE_MASK) - -#define QDC_TST_TEN_MASK (0x8000U) -#define QDC_TST_TEN_SHIFT (15U) -/*! TEN - Test Mode Enable - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_TST_TEN(x) (((uint16_t)(((uint16_t)(x)) << QDC_TST_TEN_SHIFT)) & QDC_TST_TEN_MASK) -/*! @} */ - -/*! @name CTRL2 - Control 2 */ -/*! @{ */ - -#define QDC_CTRL2_UPDHLD_MASK (0x1U) -#define QDC_CTRL2_UPDHLD_SHIFT (0U) -/*! UPDHLD - Update Hold Registers - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL2_UPDHLD(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_UPDHLD_SHIFT)) & QDC_CTRL2_UPDHLD_MASK) - -#define QDC_CTRL2_UPDPOS_MASK (0x2U) -#define QDC_CTRL2_UPDPOS_SHIFT (1U) -/*! UPDPOS - Update Position Registers - * 0b0..No action - * 0b1..Clear - */ -#define QDC_CTRL2_UPDPOS(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_UPDPOS_SHIFT)) & QDC_CTRL2_UPDPOS_MASK) - -#define QDC_CTRL2_MOD_MASK (0x4U) -#define QDC_CTRL2_MOD_SHIFT (2U) -/*! MOD - Enable Modulo Counting - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL2_MOD(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_MOD_SHIFT)) & QDC_CTRL2_MOD_MASK) - -#define QDC_CTRL2_DIR_MASK (0x8U) -#define QDC_CTRL2_DIR_SHIFT (3U) -/*! DIR - Count Direction Flag - * 0b0..Down direction - * 0b1..Up direction - */ -#define QDC_CTRL2_DIR(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_DIR_SHIFT)) & QDC_CTRL2_DIR_MASK) - -#define QDC_CTRL2_RUIE_MASK (0x10U) -#define QDC_CTRL2_RUIE_SHIFT (4U) -/*! RUIE - Roll-under Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL2_RUIE(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_RUIE_SHIFT)) & QDC_CTRL2_RUIE_MASK) - -#define QDC_CTRL2_RUIRQ_MASK (0x20U) -#define QDC_CTRL2_RUIRQ_SHIFT (5U) -/*! RUIRQ - Roll-under Interrupt Request - * 0b0..No roll-under has occurred - * 0b1..Roll-under has occurred - */ -#define QDC_CTRL2_RUIRQ(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_RUIRQ_SHIFT)) & QDC_CTRL2_RUIRQ_MASK) - -#define QDC_CTRL2_ROIE_MASK (0x40U) -#define QDC_CTRL2_ROIE_SHIFT (6U) -/*! ROIE - Roll-over Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL2_ROIE(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_ROIE_SHIFT)) & QDC_CTRL2_ROIE_MASK) - -#define QDC_CTRL2_ROIRQ_MASK (0x80U) -#define QDC_CTRL2_ROIRQ_SHIFT (7U) -/*! ROIRQ - Roll-over Interrupt Request - * 0b0..Did not occur - * 0b1..Occurred - */ -#define QDC_CTRL2_ROIRQ(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_ROIRQ_SHIFT)) & QDC_CTRL2_ROIRQ_MASK) - -#define QDC_CTRL2_REVMOD_MASK (0x100U) -#define QDC_CTRL2_REVMOD_SHIFT (8U) -/*! REVMOD - Revolution Counter Modulus Enable - * 0b0..Use INDEX pulse - * 0b1..Use modulus counting roll-over or roll-under - */ -#define QDC_CTRL2_REVMOD(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_REVMOD_SHIFT)) & QDC_CTRL2_REVMOD_MASK) - -#define QDC_CTRL2_OUTCTL_MASK (0x200U) -#define QDC_CTRL2_OUTCTL_SHIFT (9U) -/*! OUTCTL - Output Control - * 0b0..POSMATCH pulses when a match occurs between the position counters (POS) and the corresponding compare value (COMP ) - * 0b1..POSMATCH pulses when the UPOS, LPOS, REV, or POSD registers are read - */ -#define QDC_CTRL2_OUTCTL(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_OUTCTL_SHIFT)) & QDC_CTRL2_OUTCTL_MASK) - -#define QDC_CTRL2_SABIE_MASK (0x400U) -#define QDC_CTRL2_SABIE_SHIFT (10U) -/*! SABIE - Simultaneous PHASEA and PHASEB Change Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL2_SABIE(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_SABIE_SHIFT)) & QDC_CTRL2_SABIE_MASK) - -#define QDC_CTRL2_SABIRQ_MASK (0x800U) -#define QDC_CTRL2_SABIRQ_SHIFT (11U) -/*! SABIRQ - Simultaneous PHASEA and PHASEB Change Interrupt Request - * 0b0..No simultaneous change has occurred - * 0b1..A simultaneous change has occurred - */ -#define QDC_CTRL2_SABIRQ(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_SABIRQ_SHIFT)) & QDC_CTRL2_SABIRQ_MASK) - -#define QDC_CTRL2_INITPOS_MASK (0x1000U) -#define QDC_CTRL2_INITPOS_SHIFT (12U) -/*! INITPOS - Initialize Position Registers - * 0b0..Don't initialize position counter - * 0b1..Initialize position counter - */ -#define QDC_CTRL2_INITPOS(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_INITPOS_SHIFT)) & QDC_CTRL2_INITPOS_MASK) -/*! @} */ - -/*! @name UMOD - Upper Modulus */ -/*! @{ */ - -#define QDC_UMOD_MOD_MASK (0xFFFFU) -#define QDC_UMOD_MOD_SHIFT (0U) -/*! MOD - MOD */ -#define QDC_UMOD_MOD(x) (((uint16_t)(((uint16_t)(x)) << QDC_UMOD_MOD_SHIFT)) & QDC_UMOD_MOD_MASK) -/*! @} */ - -/*! @name LMOD - Lower Modulus */ -/*! @{ */ - -#define QDC_LMOD_MOD_MASK (0xFFFFU) -#define QDC_LMOD_MOD_SHIFT (0U) -/*! MOD - MOD */ -#define QDC_LMOD_MOD(x) (((uint16_t)(((uint16_t)(x)) << QDC_LMOD_MOD_SHIFT)) & QDC_LMOD_MOD_MASK) -/*! @} */ - -/*! @name UCOMP - Upper Position Compare */ -/*! @{ */ - -#define QDC_UCOMP_COMP_MASK (0xFFFFU) -#define QDC_UCOMP_COMP_SHIFT (0U) -/*! COMP - COMP */ -#define QDC_UCOMP_COMP(x) (((uint16_t)(((uint16_t)(x)) << QDC_UCOMP_COMP_SHIFT)) & QDC_UCOMP_COMP_MASK) -/*! @} */ - -/*! @name LCOMP - Lower Position Compare */ -/*! @{ */ - -#define QDC_LCOMP_COMP_MASK (0xFFFFU) -#define QDC_LCOMP_COMP_SHIFT (0U) -/*! COMP - COMP */ -#define QDC_LCOMP_COMP(x) (((uint16_t)(((uint16_t)(x)) << QDC_LCOMP_COMP_SHIFT)) & QDC_LCOMP_COMP_MASK) -/*! @} */ - -/*! @name LASTEDGE - Last Edge Time */ -/*! @{ */ - -#define QDC_LASTEDGE_LASTEDGE_MASK (0xFFFFU) -#define QDC_LASTEDGE_LASTEDGE_SHIFT (0U) -/*! LASTEDGE - Last Edge Time Counter */ -#define QDC_LASTEDGE_LASTEDGE(x) (((uint16_t)(((uint16_t)(x)) << QDC_LASTEDGE_LASTEDGE_SHIFT)) & QDC_LASTEDGE_LASTEDGE_MASK) -/*! @} */ - -/*! @name LASTEDGEH - Last Edge Time Hold */ -/*! @{ */ - -#define QDC_LASTEDGEH_LASTEDGEH_MASK (0xFFFFU) -#define QDC_LASTEDGEH_LASTEDGEH_SHIFT (0U) -/*! LASTEDGEH - Last Edge Time Hold */ -#define QDC_LASTEDGEH_LASTEDGEH(x) (((uint16_t)(((uint16_t)(x)) << QDC_LASTEDGEH_LASTEDGEH_SHIFT)) & QDC_LASTEDGEH_LASTEDGEH_MASK) -/*! @} */ - -/*! @name POSDPER - Position Difference Period Counter */ -/*! @{ */ - -#define QDC_POSDPER_POSDPER_MASK (0xFFFFU) -#define QDC_POSDPER_POSDPER_SHIFT (0U) -/*! POSDPER - Position difference period */ -#define QDC_POSDPER_POSDPER(x) (((uint16_t)(((uint16_t)(x)) << QDC_POSDPER_POSDPER_SHIFT)) & QDC_POSDPER_POSDPER_MASK) -/*! @} */ - -/*! @name POSDPERBFR - Position Difference Period Buffer */ -/*! @{ */ - -#define QDC_POSDPERBFR_POSDPERBFR_MASK (0xFFFFU) -#define QDC_POSDPERBFR_POSDPERBFR_SHIFT (0U) -/*! POSDPERBFR - Position difference period buffer */ -#define QDC_POSDPERBFR_POSDPERBFR(x) (((uint16_t)(((uint16_t)(x)) << QDC_POSDPERBFR_POSDPERBFR_SHIFT)) & QDC_POSDPERBFR_POSDPERBFR_MASK) -/*! @} */ - -/*! @name POSDPERH - Position Difference Period Hold */ -/*! @{ */ - -#define QDC_POSDPERH_POSDPERH_MASK (0xFFFFU) -#define QDC_POSDPERH_POSDPERH_SHIFT (0U) -/*! POSDPERH - Position difference period hold */ -#define QDC_POSDPERH_POSDPERH(x) (((uint16_t)(((uint16_t)(x)) << QDC_POSDPERH_POSDPERH_SHIFT)) & QDC_POSDPERH_POSDPERH_MASK) -/*! @} */ - -/*! @name CTRL3 - Control 3 */ -/*! @{ */ - -#define QDC_CTRL3_PMEN_MASK (0x1U) -#define QDC_CTRL3_PMEN_SHIFT (0U) -/*! PMEN - Period Measurement Function Enable - * 0b0..Not used - * 0b1..Used - */ -#define QDC_CTRL3_PMEN(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL3_PMEN_SHIFT)) & QDC_CTRL3_PMEN_MASK) - -#define QDC_CTRL3_PRSC_MASK (0xF0U) -#define QDC_CTRL3_PRSC_SHIFT (4U) -/*! PRSC - Prescaler */ -#define QDC_CTRL3_PRSC(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL3_PRSC_SHIFT)) & QDC_CTRL3_PRSC_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group QDC_Register_Masks */ - - -/* QDC - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral QDC0 base address */ - #define QDC0_BASE (0x500CF000u) - /** Peripheral QDC0 base address */ - #define QDC0_BASE_NS (0x400CF000u) - /** Peripheral QDC0 base pointer */ - #define QDC0 ((QDC_Type *)QDC0_BASE) - /** Peripheral QDC0 base pointer */ - #define QDC0_NS ((QDC_Type *)QDC0_BASE_NS) - /** Peripheral QDC1 base address */ - #define QDC1_BASE (0x500D1000u) - /** Peripheral QDC1 base address */ - #define QDC1_BASE_NS (0x400D1000u) - /** Peripheral QDC1 base pointer */ - #define QDC1 ((QDC_Type *)QDC1_BASE) - /** Peripheral QDC1 base pointer */ - #define QDC1_NS ((QDC_Type *)QDC1_BASE_NS) - /** Array initializer of QDC peripheral base addresses */ - #define QDC_BASE_ADDRS { QDC0_BASE, QDC1_BASE } - /** Array initializer of QDC peripheral base pointers */ - #define QDC_BASE_PTRS { QDC0, QDC1 } - /** Array initializer of QDC peripheral base addresses */ - #define QDC_BASE_ADDRS_NS { QDC0_BASE_NS, QDC1_BASE_NS } - /** Array initializer of QDC peripheral base pointers */ - #define QDC_BASE_PTRS_NS { QDC0_NS, QDC1_NS } -#else - /** Peripheral QDC0 base address */ - #define QDC0_BASE (0x400CF000u) - /** Peripheral QDC0 base pointer */ - #define QDC0 ((QDC_Type *)QDC0_BASE) - /** Peripheral QDC1 base address */ - #define QDC1_BASE (0x400D1000u) - /** Peripheral QDC1 base pointer */ - #define QDC1 ((QDC_Type *)QDC1_BASE) - /** Array initializer of QDC peripheral base addresses */ - #define QDC_BASE_ADDRS { QDC0_BASE, QDC1_BASE } - /** Array initializer of QDC peripheral base pointers */ - #define QDC_BASE_PTRS { QDC0, QDC1 } -#endif -/** Interrupt vectors for the QDC peripheral type */ -#define QDC_COMPARE_IRQS { QDC0_COMPARE_IRQn, QDC1_COMPARE_IRQn } -#define QDC_HOME_IRQS { QDC0_HOME_IRQn, QDC1_HOME_IRQn } -#define QDC_WDOG_IRQS { QDC0_WDG_SAB_IRQn, QDC1_WDG_SAB_IRQn } -#define QDC_INDEX_IRQS { QDC0_IDX_IRQn, QDC1_IDX_IRQn } - -/*! - * @} - */ /* end of group QDC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- RTC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup RTC_Peripheral_Access_Layer RTC Peripheral Access Layer - * @{ - */ - -/** RTC - Register Layout Typedef */ -typedef struct { - __IO uint16_t YEARMON; /**< Year and Month Counters, offset: 0x0 */ - __IO uint16_t DAYS; /**< Days and Day-of-Week Counters, offset: 0x2 */ - __IO uint16_t HOURMIN; /**< Hours and Minutes Counters, offset: 0x4 */ - __IO uint16_t SECONDS; /**< Seconds Counters, offset: 0x6 */ - __IO uint16_t ALM_YEARMON; /**< Year and Months Alarm, offset: 0x8 */ - __IO uint16_t ALM_DAYS; /**< Days Alarm, offset: 0xA */ - __IO uint16_t ALM_HOURMIN; /**< Hours and Minutes Alarm, offset: 0xC */ - __IO uint16_t ALM_SECONDS; /**< Seconds Alarm, offset: 0xE */ - __IO uint16_t CTRL; /**< Control, offset: 0x10 */ - __IO uint16_t STATUS; /**< Status, offset: 0x12 */ - __IO uint16_t ISR; /**< Interrupt Status, offset: 0x14 */ - __IO uint16_t IER; /**< Interrupt Enable, offset: 0x16 */ - uint8_t RESERVED_0[4]; - __I uint16_t RTC_TEST2; /**< Sub Second Counter, offset: 0x1C */ - uint8_t RESERVED_1[4]; - __IO uint16_t DST_HOUR; /**< Daylight Saving Hour, offset: 0x22 */ - __IO uint16_t DST_MONTH; /**< Daylight Saving Month, offset: 0x24 */ - __IO uint16_t DST_DAY; /**< Daylight Saving Day, offset: 0x26 */ - __IO uint16_t COMPEN; /**< Compensation, offset: 0x28 */ - uint8_t RESERVED_2[2006]; - __IO uint32_t SUBSECOND_CTRL; /**< Subsecond Control, offset: 0x800 */ - __I uint32_t SUBSECOND_CNT; /**< Subsecond Counter, offset: 0x804 */ - uint8_t RESERVED_3[1016]; - __IO uint32_t WAKE_TIMER_CTRL; /**< Wake Timer Control, offset: 0xC00 */ - uint8_t RESERVED_4[8]; - __IO uint32_t WAKE_TIMER_CNT; /**< Wake Timer Counter, offset: 0xC0C */ -} RTC_Type; - -/* ---------------------------------------------------------------------------- - -- RTC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup RTC_Register_Masks RTC Register Masks - * @{ - */ - -/*! @name YEARMON - Year and Month Counters */ -/*! @{ */ - -#define RTC_YEARMON_MON_CNT_MASK (0xFU) -#define RTC_YEARMON_MON_CNT_SHIFT (0U) -/*! MON_CNT - Month Counter - * 0b0000, 0b1101, 0b1110, 0b1111..Illegal Value - * 0b0001..January - * 0b0010..February - * 0b0011..March - * 0b0100..April - * 0b0101..May - * 0b0110..June - * 0b0111..July - * 0b1000..August - * 0b1001..September - * 0b1010..October - * 0b1011..November - * 0b1100..December - */ -#define RTC_YEARMON_MON_CNT(x) (((uint16_t)(((uint16_t)(x)) << RTC_YEARMON_MON_CNT_SHIFT)) & RTC_YEARMON_MON_CNT_MASK) - -#define RTC_YEARMON_YROFST_MASK (0xFF00U) -#define RTC_YEARMON_YROFST_SHIFT (8U) -/*! YROFST - Year Offset Count Value */ -#define RTC_YEARMON_YROFST(x) (((uint16_t)(((uint16_t)(x)) << RTC_YEARMON_YROFST_SHIFT)) & RTC_YEARMON_YROFST_MASK) -/*! @} */ - -/*! @name DAYS - Days and Day-of-Week Counters */ -/*! @{ */ - -#define RTC_DAYS_DAY_CNT_MASK (0x1FU) -#define RTC_DAYS_DAY_CNT_SHIFT (0U) -/*! DAY_CNT - Days Counter Value */ -#define RTC_DAYS_DAY_CNT(x) (((uint16_t)(((uint16_t)(x)) << RTC_DAYS_DAY_CNT_SHIFT)) & RTC_DAYS_DAY_CNT_MASK) - -#define RTC_DAYS_DOW_MASK (0x700U) -#define RTC_DAYS_DOW_SHIFT (8U) -/*! DOW - Day of Week Counter Value - * 0b000..Sunday - * 0b001..Monday - * 0b010..Tuesday - * 0b011..Wednesday - * 0b100..Thursday - * 0b101..Friday - * 0b110..Saturday - * 0b111.. - */ -#define RTC_DAYS_DOW(x) (((uint16_t)(((uint16_t)(x)) << RTC_DAYS_DOW_SHIFT)) & RTC_DAYS_DOW_MASK) -/*! @} */ - -/*! @name HOURMIN - Hours and Minutes Counters */ -/*! @{ */ - -#define RTC_HOURMIN_MIN_CNT_MASK (0x3FU) -#define RTC_HOURMIN_MIN_CNT_SHIFT (0U) -/*! MIN_CNT - Minutes Counter Value */ -#define RTC_HOURMIN_MIN_CNT(x) (((uint16_t)(((uint16_t)(x)) << RTC_HOURMIN_MIN_CNT_SHIFT)) & RTC_HOURMIN_MIN_CNT_MASK) - -#define RTC_HOURMIN_HOUR_CNT_MASK (0x1F00U) -#define RTC_HOURMIN_HOUR_CNT_SHIFT (8U) -/*! HOUR_CNT - Hours Counter Value */ -#define RTC_HOURMIN_HOUR_CNT(x) (((uint16_t)(((uint16_t)(x)) << RTC_HOURMIN_HOUR_CNT_SHIFT)) & RTC_HOURMIN_HOUR_CNT_MASK) -/*! @} */ - -/*! @name SECONDS - Seconds Counters */ -/*! @{ */ - -#define RTC_SECONDS_SEC_CNT_MASK (0x3FU) -#define RTC_SECONDS_SEC_CNT_SHIFT (0U) -/*! SEC_CNT - Seconds Counter Value */ -#define RTC_SECONDS_SEC_CNT(x) (((uint16_t)(((uint16_t)(x)) << RTC_SECONDS_SEC_CNT_SHIFT)) & RTC_SECONDS_SEC_CNT_MASK) -/*! @} */ - -/*! @name ALM_YEARMON - Year and Months Alarm */ -/*! @{ */ - -#define RTC_ALM_YEARMON_ALM_MON_MASK (0xFU) -#define RTC_ALM_YEARMON_ALM_MON_SHIFT (0U) -/*! ALM_MON - Months Value for Alarm */ -#define RTC_ALM_YEARMON_ALM_MON(x) (((uint16_t)(((uint16_t)(x)) << RTC_ALM_YEARMON_ALM_MON_SHIFT)) & RTC_ALM_YEARMON_ALM_MON_MASK) - -#define RTC_ALM_YEARMON_ALM_YEAR_MASK (0xFF00U) -#define RTC_ALM_YEARMON_ALM_YEAR_SHIFT (8U) -/*! ALM_YEAR - Year Value for Alarm */ -#define RTC_ALM_YEARMON_ALM_YEAR(x) (((uint16_t)(((uint16_t)(x)) << RTC_ALM_YEARMON_ALM_YEAR_SHIFT)) & RTC_ALM_YEARMON_ALM_YEAR_MASK) -/*! @} */ - -/*! @name ALM_DAYS - Days Alarm */ -/*! @{ */ - -#define RTC_ALM_DAYS_ALM_DAY_MASK (0x1FU) -#define RTC_ALM_DAYS_ALM_DAY_SHIFT (0U) -/*! ALM_DAY - Days Value for Alarm */ -#define RTC_ALM_DAYS_ALM_DAY(x) (((uint16_t)(((uint16_t)(x)) << RTC_ALM_DAYS_ALM_DAY_SHIFT)) & RTC_ALM_DAYS_ALM_DAY_MASK) -/*! @} */ - -/*! @name ALM_HOURMIN - Hours and Minutes Alarm */ -/*! @{ */ - -#define RTC_ALM_HOURMIN_ALM_MIN_MASK (0x3FU) -#define RTC_ALM_HOURMIN_ALM_MIN_SHIFT (0U) -/*! ALM_MIN - Minutes Value for Alarm */ -#define RTC_ALM_HOURMIN_ALM_MIN(x) (((uint16_t)(((uint16_t)(x)) << RTC_ALM_HOURMIN_ALM_MIN_SHIFT)) & RTC_ALM_HOURMIN_ALM_MIN_MASK) - -#define RTC_ALM_HOURMIN_ALM_HOUR_MASK (0x1F00U) -#define RTC_ALM_HOURMIN_ALM_HOUR_SHIFT (8U) -/*! ALM_HOUR - Hours Value for Alarm */ -#define RTC_ALM_HOURMIN_ALM_HOUR(x) (((uint16_t)(((uint16_t)(x)) << RTC_ALM_HOURMIN_ALM_HOUR_SHIFT)) & RTC_ALM_HOURMIN_ALM_HOUR_MASK) -/*! @} */ - -/*! @name ALM_SECONDS - Seconds Alarm */ -/*! @{ */ - -#define RTC_ALM_SECONDS_ALM_SEC_MASK (0x3FU) -#define RTC_ALM_SECONDS_ALM_SEC_SHIFT (0U) -/*! ALM_SEC - Seconds Alarm Value */ -#define RTC_ALM_SECONDS_ALM_SEC(x) (((uint16_t)(((uint16_t)(x)) << RTC_ALM_SECONDS_ALM_SEC_SHIFT)) & RTC_ALM_SECONDS_ALM_SEC_MASK) - -#define RTC_ALM_SECONDS_DEC_SEC_MASK (0x100U) -#define RTC_ALM_SECONDS_DEC_SEC_SHIFT (8U) -/*! DEC_SEC - Decrement Seconds Counter by 1. */ -#define RTC_ALM_SECONDS_DEC_SEC(x) (((uint16_t)(((uint16_t)(x)) << RTC_ALM_SECONDS_DEC_SEC_SHIFT)) & RTC_ALM_SECONDS_DEC_SEC_MASK) - -#define RTC_ALM_SECONDS_INC_SEC_MASK (0x200U) -#define RTC_ALM_SECONDS_INC_SEC_SHIFT (9U) -/*! INC_SEC - Increment Seconds Counter by 1. */ -#define RTC_ALM_SECONDS_INC_SEC(x) (((uint16_t)(((uint16_t)(x)) << RTC_ALM_SECONDS_INC_SEC_SHIFT)) & RTC_ALM_SECONDS_INC_SEC_MASK) -/*! @} */ - -/*! @name CTRL - Control */ -/*! @{ */ - -#define RTC_CTRL_FINEEN_MASK (0x1U) -#define RTC_CTRL_FINEEN_SHIFT (0U) -/*! FINEEN - Fine Compensation Enable - * 0b1..Fine compensation is enabled. - * 0b0..Fine compensation is disabled - */ -#define RTC_CTRL_FINEEN(x) (((uint16_t)(((uint16_t)(x)) << RTC_CTRL_FINEEN_SHIFT)) & RTC_CTRL_FINEEN_MASK) - -#define RTC_CTRL_COMP_EN_MASK (0x2U) -#define RTC_CTRL_COMP_EN_SHIFT (1U) -/*! COMP_EN - Compensation Enable - * 0b0..Coarse compensation is disabled. - * 0b1..Coarse compensation is enabled. - */ -#define RTC_CTRL_COMP_EN(x) (((uint16_t)(((uint16_t)(x)) << RTC_CTRL_COMP_EN_SHIFT)) & RTC_CTRL_COMP_EN_MASK) - -#define RTC_CTRL_ALM_MATCH_MASK (0xCU) -#define RTC_CTRL_ALM_MATCH_SHIFT (2U) -/*! ALM_MATCH - Alarm Match - * 0b00..Only seconds, minutes, and hours matched. - * 0b01..Only seconds, minutes, hours, and days matched. - * 0b10..Only seconds, minutes, hours, days, and months matched. - * 0b11..Only seconds, minutes, hours, days, months, and year (offset) matched. - */ -#define RTC_CTRL_ALM_MATCH(x) (((uint16_t)(((uint16_t)(x)) << RTC_CTRL_ALM_MATCH_SHIFT)) & RTC_CTRL_ALM_MATCH_MASK) - -#define RTC_CTRL_DST_EN_MASK (0x40U) -#define RTC_CTRL_DST_EN_SHIFT (6U) -/*! DST_EN - Daylight Saving Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define RTC_CTRL_DST_EN(x) (((uint16_t)(((uint16_t)(x)) << RTC_CTRL_DST_EN_SHIFT)) & RTC_CTRL_DST_EN_MASK) - -#define RTC_CTRL_SWR_MASK (0x100U) -#define RTC_CTRL_SWR_SHIFT (8U) -/*! SWR - Software Reset - * 0b0..Software Reset cleared - * 0b1..Software Reset asserted - */ -#define RTC_CTRL_SWR(x) (((uint16_t)(((uint16_t)(x)) << RTC_CTRL_SWR_SHIFT)) & RTC_CTRL_SWR_MASK) - -#define RTC_CTRL_CLK_SEL_MASK (0x200U) -#define RTC_CTRL_CLK_SEL_SHIFT (9U) -/*! CLK_SEL - RTC Clock Select - * 0b0..16.384 kHz clock is selected - * 0b1..32.768 kHz clock is selected - */ -#define RTC_CTRL_CLK_SEL(x) (((uint16_t)(((uint16_t)(x)) << RTC_CTRL_CLK_SEL_SHIFT)) & RTC_CTRL_CLK_SEL_MASK) - -#define RTC_CTRL_CLKO_DIS_MASK (0x400U) -#define RTC_CTRL_CLKO_DIS_SHIFT (10U) -/*! CLKO_DIS - Clock Output Disable - * 0b0..The selected clock is output to other peripherals. - * 0b1..The selected clock is not output to other peripherals. - */ -#define RTC_CTRL_CLKO_DIS(x) (((uint16_t)(((uint16_t)(x)) << RTC_CTRL_CLKO_DIS_SHIFT)) & RTC_CTRL_CLKO_DIS_MASK) - -#define RTC_CTRL_CLKOUT_MASK (0x6000U) -#define RTC_CTRL_CLKOUT_SHIFT (13U) -/*! CLKOUT - RTC Clock Output Selection - * 0b00..No output clock - * 0b01..Fine 1 Hz clock with both precise edges - * 0b10..32.768 or 16.384 kHz clock - * 0b11..Coarse 1 Hz clock with both precise edges - */ -#define RTC_CTRL_CLKOUT(x) (((uint16_t)(((uint16_t)(x)) << RTC_CTRL_CLKOUT_SHIFT)) & RTC_CTRL_CLKOUT_MASK) -/*! @} */ - -/*! @name STATUS - Status */ -/*! @{ */ - -#define RTC_STATUS_INVAL_BIT_MASK (0x1U) -#define RTC_STATUS_INVAL_BIT_SHIFT (0U) -/*! INVAL_BIT - Invalidate CPU Read/Write Access - * 0b0..Time and date counters can be read or written. Time and date is valid. - * 0b1..Time and date counter values are changing or time and date is invalid and cannot be read or written. - */ -#define RTC_STATUS_INVAL_BIT(x) (((uint16_t)(((uint16_t)(x)) << RTC_STATUS_INVAL_BIT_SHIFT)) & RTC_STATUS_INVAL_BIT_MASK) - -#define RTC_STATUS_WRITE_PROT_EN_MASK (0x2U) -#define RTC_STATUS_WRITE_PROT_EN_SHIFT (1U) -/*! WRITE_PROT_EN - Write Protect Enable Status - * 0b0..Registers are unlocked and can be accessed. - * 0b1..Registers are locked and in read-only mode. - */ -#define RTC_STATUS_WRITE_PROT_EN(x) (((uint16_t)(((uint16_t)(x)) << RTC_STATUS_WRITE_PROT_EN_SHIFT)) & RTC_STATUS_WRITE_PROT_EN_MASK) - -#define RTC_STATUS_CMP_INT_MASK (0x20U) -#define RTC_STATUS_CMP_INT_SHIFT (5U) -/*! CMP_INT - Compensation Interval */ -#define RTC_STATUS_CMP_INT(x) (((uint16_t)(((uint16_t)(x)) << RTC_STATUS_CMP_INT_SHIFT)) & RTC_STATUS_CMP_INT_MASK) - -#define RTC_STATUS_WE_MASK (0xC0U) -#define RTC_STATUS_WE_SHIFT (6U) -/*! WE - Write Enable - * 0b10..Enable Write Protection - Registers are locked. - */ -#define RTC_STATUS_WE(x) (((uint16_t)(((uint16_t)(x)) << RTC_STATUS_WE_SHIFT)) & RTC_STATUS_WE_MASK) - -#define RTC_STATUS_BUS_ERR_MASK (0x100U) -#define RTC_STATUS_BUS_ERR_SHIFT (8U) -/*! BUS_ERR - Bus Error - * 0b0..Read and write accesses are normal. - * 0b1..Read or write accesses occurred when STATUS[INVAL_BIT] was asserted. - */ -#define RTC_STATUS_BUS_ERR(x) (((uint16_t)(((uint16_t)(x)) << RTC_STATUS_BUS_ERR_SHIFT)) & RTC_STATUS_BUS_ERR_MASK) - -#define RTC_STATUS_CMP_DONE_MASK (0x800U) -#define RTC_STATUS_CMP_DONE_SHIFT (11U) -/*! CMP_DONE - Compensation Done - * 0b0..Compensation busy or not enabled - * 0b1..Compensation completed - */ -#define RTC_STATUS_CMP_DONE(x) (((uint16_t)(((uint16_t)(x)) << RTC_STATUS_CMP_DONE_SHIFT)) & RTC_STATUS_CMP_DONE_MASK) -/*! @} */ - -/*! @name ISR - Interrupt Status */ -/*! @{ */ - -#define RTC_ISR_ALM_IS_MASK (0x4U) -#define RTC_ISR_ALM_IS_SHIFT (2U) -/*! ALM_IS - Alarm Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_ALM_IS(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_ALM_IS_SHIFT)) & RTC_ISR_ALM_IS_MASK) - -#define RTC_ISR_DAY_IS_MASK (0x8U) -#define RTC_ISR_DAY_IS_SHIFT (3U) -/*! DAY_IS - Days Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_DAY_IS(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_DAY_IS_SHIFT)) & RTC_ISR_DAY_IS_MASK) - -#define RTC_ISR_HOUR_IS_MASK (0x10U) -#define RTC_ISR_HOUR_IS_SHIFT (4U) -/*! HOUR_IS - Hours Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_HOUR_IS(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_HOUR_IS_SHIFT)) & RTC_ISR_HOUR_IS_MASK) - -#define RTC_ISR_MIN_IS_MASK (0x20U) -#define RTC_ISR_MIN_IS_SHIFT (5U) -/*! MIN_IS - Minutes Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_MIN_IS(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_MIN_IS_SHIFT)) & RTC_ISR_MIN_IS_MASK) - -#define RTC_ISR_IS_1HZ_MASK (0x40U) -#define RTC_ISR_IS_1HZ_SHIFT (6U) -/*! IS_1HZ - 1 Hz Interval Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_IS_1HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_IS_1HZ_SHIFT)) & RTC_ISR_IS_1HZ_MASK) - -#define RTC_ISR_IS_2HZ_MASK (0x80U) -#define RTC_ISR_IS_2HZ_SHIFT (7U) -/*! IS_2HZ - 2 Hz Interval Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_IS_2HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_IS_2HZ_SHIFT)) & RTC_ISR_IS_2HZ_MASK) - -#define RTC_ISR_IS_4HZ_MASK (0x100U) -#define RTC_ISR_IS_4HZ_SHIFT (8U) -/*! IS_4HZ - 4 Hz Interval Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_IS_4HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_IS_4HZ_SHIFT)) & RTC_ISR_IS_4HZ_MASK) - -#define RTC_ISR_IS_8HZ_MASK (0x200U) -#define RTC_ISR_IS_8HZ_SHIFT (9U) -/*! IS_8HZ - 8 Hz Interval Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_IS_8HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_IS_8HZ_SHIFT)) & RTC_ISR_IS_8HZ_MASK) - -#define RTC_ISR_IS_16HZ_MASK (0x400U) -#define RTC_ISR_IS_16HZ_SHIFT (10U) -/*! IS_16HZ - 16 Hz Interval Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_IS_16HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_IS_16HZ_SHIFT)) & RTC_ISR_IS_16HZ_MASK) - -#define RTC_ISR_IS_32HZ_MASK (0x800U) -#define RTC_ISR_IS_32HZ_SHIFT (11U) -/*! IS_32HZ - 32 Hz Interval Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_IS_32HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_IS_32HZ_SHIFT)) & RTC_ISR_IS_32HZ_MASK) - -#define RTC_ISR_IS_64HZ_MASK (0x1000U) -#define RTC_ISR_IS_64HZ_SHIFT (12U) -/*! IS_64HZ - 64 Hz Interval Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_IS_64HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_IS_64HZ_SHIFT)) & RTC_ISR_IS_64HZ_MASK) - -#define RTC_ISR_IS_128HZ_MASK (0x2000U) -#define RTC_ISR_IS_128HZ_SHIFT (13U) -/*! IS_128HZ - 128 Hz Interval Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_IS_128HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_IS_128HZ_SHIFT)) & RTC_ISR_IS_128HZ_MASK) - -#define RTC_ISR_IS_256HZ_MASK (0x4000U) -#define RTC_ISR_IS_256HZ_SHIFT (14U) -/*! IS_256HZ - 256 Hz Interval Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_IS_256HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_IS_256HZ_SHIFT)) & RTC_ISR_IS_256HZ_MASK) - -#define RTC_ISR_IS_512HZ_MASK (0x8000U) -#define RTC_ISR_IS_512HZ_SHIFT (15U) -/*! IS_512HZ - 512 Hz Interval Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_IS_512HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_IS_512HZ_SHIFT)) & RTC_ISR_IS_512HZ_MASK) -/*! @} */ - -/*! @name IER - Interrupt Enable */ -/*! @{ */ - -#define RTC_IER_ALM_IE_MASK (0x4U) -#define RTC_IER_ALM_IE_SHIFT (2U) -/*! ALM_IE - Alarm Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_ALM_IE(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_ALM_IE_SHIFT)) & RTC_IER_ALM_IE_MASK) - -#define RTC_IER_DAY_IE_MASK (0x8U) -#define RTC_IER_DAY_IE_SHIFT (3U) -/*! DAY_IE - Days Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_DAY_IE(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_DAY_IE_SHIFT)) & RTC_IER_DAY_IE_MASK) - -#define RTC_IER_HOUR_IE_MASK (0x10U) -#define RTC_IER_HOUR_IE_SHIFT (4U) -/*! HOUR_IE - Hours Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_HOUR_IE(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_HOUR_IE_SHIFT)) & RTC_IER_HOUR_IE_MASK) - -#define RTC_IER_MIN_IE_MASK (0x20U) -#define RTC_IER_MIN_IE_SHIFT (5U) -/*! MIN_IE - Minutes Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_MIN_IE(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_MIN_IE_SHIFT)) & RTC_IER_MIN_IE_MASK) - -#define RTC_IER_IE_1HZ_MASK (0x40U) -#define RTC_IER_IE_1HZ_SHIFT (6U) -/*! IE_1HZ - 1 Hz Interval Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_IE_1HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_IE_1HZ_SHIFT)) & RTC_IER_IE_1HZ_MASK) - -#define RTC_IER_IE_2HZ_MASK (0x80U) -#define RTC_IER_IE_2HZ_SHIFT (7U) -/*! IE_2HZ - 2 Hz Interval Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_IE_2HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_IE_2HZ_SHIFT)) & RTC_IER_IE_2HZ_MASK) - -#define RTC_IER_IE_4HZ_MASK (0x100U) -#define RTC_IER_IE_4HZ_SHIFT (8U) -/*! IE_4HZ - 4 Hz Interval Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_IE_4HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_IE_4HZ_SHIFT)) & RTC_IER_IE_4HZ_MASK) - -#define RTC_IER_IE_8HZ_MASK (0x200U) -#define RTC_IER_IE_8HZ_SHIFT (9U) -/*! IE_8HZ - 8 Hz Interval Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_IE_8HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_IE_8HZ_SHIFT)) & RTC_IER_IE_8HZ_MASK) - -#define RTC_IER_IE_16HZ_MASK (0x400U) -#define RTC_IER_IE_16HZ_SHIFT (10U) -/*! IE_16HZ - 16 Hz Interval Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_IE_16HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_IE_16HZ_SHIFT)) & RTC_IER_IE_16HZ_MASK) - -#define RTC_IER_IE_32HZ_MASK (0x800U) -#define RTC_IER_IE_32HZ_SHIFT (11U) -/*! IE_32HZ - 32 Hz Interval Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_IE_32HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_IE_32HZ_SHIFT)) & RTC_IER_IE_32HZ_MASK) - -#define RTC_IER_IE_64HZ_MASK (0x1000U) -#define RTC_IER_IE_64HZ_SHIFT (12U) -/*! IE_64HZ - 64 Hz Interval Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_IE_64HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_IE_64HZ_SHIFT)) & RTC_IER_IE_64HZ_MASK) - -#define RTC_IER_IE_128HZ_MASK (0x2000U) -#define RTC_IER_IE_128HZ_SHIFT (13U) -/*! IE_128HZ - 128 Hz Interval Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_IE_128HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_IE_128HZ_SHIFT)) & RTC_IER_IE_128HZ_MASK) - -#define RTC_IER_IE_256HZ_MASK (0x4000U) -#define RTC_IER_IE_256HZ_SHIFT (14U) -/*! IE_256HZ - 256 Hz Interval Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_IE_256HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_IE_256HZ_SHIFT)) & RTC_IER_IE_256HZ_MASK) - -#define RTC_IER_IE_512HZ_MASK (0x8000U) -#define RTC_IER_IE_512HZ_SHIFT (15U) -/*! IE_512HZ - 512 Hz Interval Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_IE_512HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_IE_512HZ_SHIFT)) & RTC_IER_IE_512HZ_MASK) -/*! @} */ - -/*! @name RTC_TEST2 - Sub Second Counter */ -/*! @{ */ - -#define RTC_RTC_TEST2_SUB_SECOND_COUNT_MASK (0xFFFFU) -#define RTC_RTC_TEST2_SUB_SECOND_COUNT_SHIFT (0U) -/*! SUB_SECOND_COUNT - Sub Second Counter Value */ -#define RTC_RTC_TEST2_SUB_SECOND_COUNT(x) (((uint16_t)(((uint16_t)(x)) << RTC_RTC_TEST2_SUB_SECOND_COUNT_SHIFT)) & RTC_RTC_TEST2_SUB_SECOND_COUNT_MASK) -/*! @} */ - -/*! @name DST_HOUR - Daylight Saving Hour */ -/*! @{ */ - -#define RTC_DST_HOUR_DST_END_HOUR_MASK (0x1FU) -#define RTC_DST_HOUR_DST_END_HOUR_SHIFT (0U) -/*! DST_END_HOUR - Daylight Saving Time (DST) Hours End Value */ -#define RTC_DST_HOUR_DST_END_HOUR(x) (((uint16_t)(((uint16_t)(x)) << RTC_DST_HOUR_DST_END_HOUR_SHIFT)) & RTC_DST_HOUR_DST_END_HOUR_MASK) - -#define RTC_DST_HOUR_DST_START_HOUR_MASK (0x1F00U) -#define RTC_DST_HOUR_DST_START_HOUR_SHIFT (8U) -/*! DST_START_HOUR - Daylight Saving Time (DST) Hours Start Value */ -#define RTC_DST_HOUR_DST_START_HOUR(x) (((uint16_t)(((uint16_t)(x)) << RTC_DST_HOUR_DST_START_HOUR_SHIFT)) & RTC_DST_HOUR_DST_START_HOUR_MASK) -/*! @} */ - -/*! @name DST_MONTH - Daylight Saving Month */ -/*! @{ */ - -#define RTC_DST_MONTH_DST_END_MONTH_MASK (0xFU) -#define RTC_DST_MONTH_DST_END_MONTH_SHIFT (0U) -/*! DST_END_MONTH - Daylight Saving Time (DST) Month End Value */ -#define RTC_DST_MONTH_DST_END_MONTH(x) (((uint16_t)(((uint16_t)(x)) << RTC_DST_MONTH_DST_END_MONTH_SHIFT)) & RTC_DST_MONTH_DST_END_MONTH_MASK) - -#define RTC_DST_MONTH_DST_START_MONTH_MASK (0xF00U) -#define RTC_DST_MONTH_DST_START_MONTH_SHIFT (8U) -/*! DST_START_MONTH - Daylight Saving Time (DST) Month Start Value */ -#define RTC_DST_MONTH_DST_START_MONTH(x) (((uint16_t)(((uint16_t)(x)) << RTC_DST_MONTH_DST_START_MONTH_SHIFT)) & RTC_DST_MONTH_DST_START_MONTH_MASK) -/*! @} */ - -/*! @name DST_DAY - Daylight Saving Day */ -/*! @{ */ - -#define RTC_DST_DAY_DST_END_DAY_MASK (0x1FU) -#define RTC_DST_DAY_DST_END_DAY_SHIFT (0U) -/*! DST_END_DAY - Daylight Saving Time (DST) Day End Value */ -#define RTC_DST_DAY_DST_END_DAY(x) (((uint16_t)(((uint16_t)(x)) << RTC_DST_DAY_DST_END_DAY_SHIFT)) & RTC_DST_DAY_DST_END_DAY_MASK) - -#define RTC_DST_DAY_DST_START_DAY_MASK (0x1F00U) -#define RTC_DST_DAY_DST_START_DAY_SHIFT (8U) -/*! DST_START_DAY - Daylight Saving Time (DST) Day Start Value */ -#define RTC_DST_DAY_DST_START_DAY(x) (((uint16_t)(((uint16_t)(x)) << RTC_DST_DAY_DST_START_DAY_SHIFT)) & RTC_DST_DAY_DST_START_DAY_MASK) -/*! @} */ - -/*! @name COMPEN - Compensation */ -/*! @{ */ - -#define RTC_COMPEN_COMPEN_VAL_MASK (0xFFFFU) -#define RTC_COMPEN_COMPEN_VAL_SHIFT (0U) -/*! COMPEN_VAL - Compensation Value */ -#define RTC_COMPEN_COMPEN_VAL(x) (((uint16_t)(((uint16_t)(x)) << RTC_COMPEN_COMPEN_VAL_SHIFT)) & RTC_COMPEN_COMPEN_VAL_MASK) -/*! @} */ - -/*! @name SUBSECOND_CTRL - Subsecond Control */ -/*! @{ */ - -#define RTC_SUBSECOND_CTRL_SUB_SECOND_CNT_EN_MASK (0x1U) -#define RTC_SUBSECOND_CTRL_SUB_SECOND_CNT_EN_SHIFT (0U) -/*! SUB_SECOND_CNT_EN - Subsecond Counter Enable - * 0b0..Disable - * 0b1..Enable - */ -#define RTC_SUBSECOND_CTRL_SUB_SECOND_CNT_EN(x) (((uint32_t)(((uint32_t)(x)) << RTC_SUBSECOND_CTRL_SUB_SECOND_CNT_EN_SHIFT)) & RTC_SUBSECOND_CTRL_SUB_SECOND_CNT_EN_MASK) -/*! @} */ - -/*! @name SUBSECOND_CNT - Subsecond Counter */ -/*! @{ */ - -#define RTC_SUBSECOND_CNT_SUBSECOND_CNT_MASK (0xFFFFU) -#define RTC_SUBSECOND_CNT_SUBSECOND_CNT_SHIFT (0U) -/*! SUBSECOND_CNT - Current Subsecond Counter Value */ -#define RTC_SUBSECOND_CNT_SUBSECOND_CNT(x) (((uint32_t)(((uint32_t)(x)) << RTC_SUBSECOND_CNT_SUBSECOND_CNT_SHIFT)) & RTC_SUBSECOND_CNT_SUBSECOND_CNT_MASK) -/*! @} */ - -/*! @name WAKE_TIMER_CTRL - Wake Timer Control */ -/*! @{ */ - -#define RTC_WAKE_TIMER_CTRL_WAKE_FLAG_MASK (0x2U) -#define RTC_WAKE_TIMER_CTRL_WAKE_FLAG_SHIFT (1U) -/*! WAKE_FLAG - Wake Timer Status Flag - * 0b0..Not timed out - * 0b1..Timed out - */ -#define RTC_WAKE_TIMER_CTRL_WAKE_FLAG(x) (((uint32_t)(((uint32_t)(x)) << RTC_WAKE_TIMER_CTRL_WAKE_FLAG_SHIFT)) & RTC_WAKE_TIMER_CTRL_WAKE_FLAG_MASK) - -#define RTC_WAKE_TIMER_CTRL_CLR_WAKE_TIMER_MASK (0x4U) -#define RTC_WAKE_TIMER_CTRL_CLR_WAKE_TIMER_SHIFT (2U) -/*! CLR_WAKE_TIMER - Clear Wake Timer - * 0b0..No effect - * 0b1..Clear the wake timer counter - */ -#define RTC_WAKE_TIMER_CTRL_CLR_WAKE_TIMER(x) (((uint32_t)(((uint32_t)(x)) << RTC_WAKE_TIMER_CTRL_CLR_WAKE_TIMER_SHIFT)) & RTC_WAKE_TIMER_CTRL_CLR_WAKE_TIMER_MASK) - -#define RTC_WAKE_TIMER_CTRL_OSC_DIV_ENA_MASK (0x10U) -#define RTC_WAKE_TIMER_CTRL_OSC_DIV_ENA_SHIFT (4U) -/*! OSC_DIV_ENA - OSC Divide Enable - * 0b0..Disable - * 0b1..Enable - */ -#define RTC_WAKE_TIMER_CTRL_OSC_DIV_ENA(x) (((uint32_t)(((uint32_t)(x)) << RTC_WAKE_TIMER_CTRL_OSC_DIV_ENA_SHIFT)) & RTC_WAKE_TIMER_CTRL_OSC_DIV_ENA_MASK) - -#define RTC_WAKE_TIMER_CTRL_INTR_EN_MASK (0x20U) -#define RTC_WAKE_TIMER_CTRL_INTR_EN_SHIFT (5U) -/*! INTR_EN - Enable Interrupt - * 0b0..Disable - * 0b1..Enable - */ -#define RTC_WAKE_TIMER_CTRL_INTR_EN(x) (((uint32_t)(((uint32_t)(x)) << RTC_WAKE_TIMER_CTRL_INTR_EN_SHIFT)) & RTC_WAKE_TIMER_CTRL_INTR_EN_MASK) -/*! @} */ - -/*! @name WAKE_TIMER_CNT - Wake Timer Counter */ -/*! @{ */ - -#define RTC_WAKE_TIMER_CNT_WAKE_CNT_MASK (0xFFFFFFFFU) -#define RTC_WAKE_TIMER_CNT_WAKE_CNT_SHIFT (0U) -/*! WAKE_CNT - Wake Counter */ -#define RTC_WAKE_TIMER_CNT_WAKE_CNT(x) (((uint32_t)(((uint32_t)(x)) << RTC_WAKE_TIMER_CNT_WAKE_CNT_SHIFT)) & RTC_WAKE_TIMER_CNT_WAKE_CNT_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group RTC_Register_Masks */ - - -/* RTC - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral RTC0 base address */ - #define RTC0_BASE (0x5004C000u) - /** Peripheral RTC0 base address */ - #define RTC0_BASE_NS (0x4004C000u) - /** Peripheral RTC0 base pointer */ - #define RTC0 ((RTC_Type *)RTC0_BASE) - /** Peripheral RTC0 base pointer */ - #define RTC0_NS ((RTC_Type *)RTC0_BASE_NS) - /** Array initializer of RTC peripheral base addresses */ - #define RTC_BASE_ADDRS { RTC0_BASE } - /** Array initializer of RTC peripheral base pointers */ - #define RTC_BASE_PTRS { RTC0 } - /** Array initializer of RTC peripheral base addresses */ - #define RTC_BASE_ADDRS_NS { RTC0_BASE_NS } - /** Array initializer of RTC peripheral base pointers */ - #define RTC_BASE_PTRS_NS { RTC0_NS } -#else - /** Peripheral RTC0 base address */ - #define RTC0_BASE (0x4004C000u) - /** Peripheral RTC0 base pointer */ - #define RTC0 ((RTC_Type *)RTC0_BASE) - /** Array initializer of RTC peripheral base addresses */ - #define RTC_BASE_ADDRS { RTC0_BASE } - /** Array initializer of RTC peripheral base pointers */ - #define RTC_BASE_PTRS { RTC0 } -#endif -/** Interrupt vectors for the RTC peripheral type */ -#define RTC_IRQS { RTC_IRQn } -/* Backward compatibility for RTC */ -#define RTC RTC0 - - -/*! - * @} - */ /* end of group RTC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- S50 Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup S50_Peripheral_Access_Layer S50 Peripheral Access Layer - * @{ - */ - -/** S50 - Register Layout Typedef */ -typedef struct { - __I uint32_t ELS_STATUS; /**< Status Register, offset: 0x0 */ - __IO uint32_t ELS_CTRL; /**< Control Register, offset: 0x4 */ - __IO uint32_t ELS_CMDCFG0; /**< Command Configuration, offset: 0x8 */ - __IO uint32_t ELS_CFG; /**< Configuration Register, offset: 0xC */ - __IO uint32_t ELS_KIDX0; /**< Keystore Index 0, offset: 0x10 */ - __IO uint32_t ELS_KIDX1; /**< Keystore Index 1, offset: 0x14 */ - __IO uint32_t ELS_KPROPIN; /**< Key Properties Request, offset: 0x18 */ - uint8_t RESERVED_0[4]; - __IO uint32_t ELS_DMA_SRC0; /**< DMA Source 0, offset: 0x20 */ - __IO uint32_t ELS_DMA_SRC0_LEN; /**< DMA Source 0 Length, offset: 0x24 */ - __IO uint32_t ELS_DMA_SRC1; /**< DMA Source 1, offset: 0x28 */ - uint8_t RESERVED_1[4]; - __IO uint32_t ELS_DMA_SRC2; /**< DMA Source 2, offset: 0x30 */ - __IO uint32_t ELS_DMA_SRC2_LEN; /**< DMA Source 2 Length, offset: 0x34 */ - __IO uint32_t ELS_DMA_RES0; /**< DMA Result 0, offset: 0x38 */ - __IO uint32_t ELS_DMA_RES0_LEN; /**< DMA Result 0 Length, offset: 0x3C */ - __IO uint32_t ELS_INT_ENABLE; /**< Interrupt Enable, offset: 0x40 */ - __O uint32_t ELS_INT_STATUS_CLR; /**< Interrupt Status Clear, offset: 0x44 */ - __O uint32_t ELS_INT_STATUS_SET; /**< Interrupt Status Set, offset: 0x48 */ - __I uint32_t ELS_ERR_STATUS; /**< Error Status, offset: 0x4C */ - __O uint32_t ELS_ERR_STATUS_CLR; /**< Error Status Clear, offset: 0x50 */ - __I uint32_t ELS_VERSION; /**< Version Register, offset: 0x54 */ - uint8_t RESERVED_2[4]; - __I uint32_t ELS_PRNG_DATOUT; /**< PRNG SW Read Out, offset: 0x5C */ - __IO uint32_t ELS_CMDCRC_CTRL; /**< CRC Configuration, offset: 0x60 */ - __I uint32_t ELS_CMDCRC; /**< Command CRC Value, offset: 0x64 */ - __IO uint32_t ELS_SESSION_ID; /**< Session ID, offset: 0x68 */ - uint8_t RESERVED_3[4]; - __I uint32_t ELS_DMA_FIN_ADDR; /**< Final DMA Address, offset: 0x70 */ - __IO uint32_t ELS_MASTER_ID; /**< Master ID, offset: 0x74 */ - __IO uint32_t ELS_KIDX2; /**< Keystore Index 2, offset: 0x78 */ - uint8_t RESERVED_4[212]; - __I uint32_t ELS_KS0; /**< Status Register, offset: 0x150 */ - __I uint32_t ELS_KS1; /**< Status Register, offset: 0x154 */ - __I uint32_t ELS_KS2; /**< Status Register, offset: 0x158 */ - __I uint32_t ELS_KS3; /**< Status Register, offset: 0x15C */ - __I uint32_t ELS_KS4; /**< Status Register, offset: 0x160 */ - __I uint32_t ELS_KS5; /**< Status Register, offset: 0x164 */ - __I uint32_t ELS_KS6; /**< Status Register, offset: 0x168 */ - __I uint32_t ELS_KS7; /**< Status Register, offset: 0x16C */ - __I uint32_t ELS_KS8; /**< Status Register, offset: 0x170 */ - __I uint32_t ELS_KS9; /**< Status Register, offset: 0x174 */ - __I uint32_t ELS_KS10; /**< Status Register, offset: 0x178 */ - __I uint32_t ELS_KS11; /**< Status Register, offset: 0x17C */ - __I uint32_t ELS_KS12; /**< Status Register, offset: 0x180 */ - __I uint32_t ELS_KS13; /**< Status Register, offset: 0x184 */ - __I uint32_t ELS_KS14; /**< Status Register, offset: 0x188 */ - __I uint32_t ELS_KS15; /**< Status Register, offset: 0x18C */ - __I uint32_t ELS_KS16; /**< Status Register, offset: 0x190 */ - __I uint32_t ELS_KS17; /**< Status Register, offset: 0x194 */ - __I uint32_t ELS_KS18; /**< Status Register, offset: 0x198 */ - __I uint32_t ELS_KS19; /**< Status Register, offset: 0x19C */ -} S50_Type; - -/* ---------------------------------------------------------------------------- - -- S50 Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup S50_Register_Masks S50 Register Masks - * @{ - */ - -/*! @name ELS_STATUS - Status Register */ -/*! @{ */ - -#define S50_ELS_STATUS_ELS_BUSY_MASK (0x1U) -#define S50_ELS_STATUS_ELS_BUSY_SHIFT (0U) -/*! ELS_BUSY - * 0b1..Crypto sequence executing - * 0b0..Crypto sequence not executing - */ -#define S50_ELS_STATUS_ELS_BUSY(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_STATUS_ELS_BUSY_SHIFT)) & S50_ELS_STATUS_ELS_BUSY_MASK) - -#define S50_ELS_STATUS_ELS_IRQ_MASK (0x2U) -#define S50_ELS_STATUS_ELS_IRQ_SHIFT (1U) -/*! ELS_IRQ - * 0b1..Active interrupt - * 0b0..No active interrupt - */ -#define S50_ELS_STATUS_ELS_IRQ(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_STATUS_ELS_IRQ_SHIFT)) & S50_ELS_STATUS_ELS_IRQ_MASK) - -#define S50_ELS_STATUS_ELS_ERR_MASK (0x4U) -#define S50_ELS_STATUS_ELS_ERR_SHIFT (2U) -/*! ELS_ERR - * 0b1..Internal error detected - * 0b0..Internal error not detected - */ -#define S50_ELS_STATUS_ELS_ERR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_STATUS_ELS_ERR_SHIFT)) & S50_ELS_STATUS_ELS_ERR_MASK) - -#define S50_ELS_STATUS_PRNG_RDY_MASK (0x8U) -#define S50_ELS_STATUS_PRNG_RDY_SHIFT (3U) -/*! PRNG_RDY - * 0b0..Internal PRNG not ready - * 0b1..Internal PRNG ready - */ -#define S50_ELS_STATUS_PRNG_RDY(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_STATUS_PRNG_RDY_SHIFT)) & S50_ELS_STATUS_PRNG_RDY_MASK) - -#define S50_ELS_STATUS_ECDSA_VFY_STATUS_MASK (0x30U) -#define S50_ELS_STATUS_ECDSA_VFY_STATUS_SHIFT (4U) -/*! ECDSA_VFY_STATUS - * 0b11..Invalid, Error - * 0b00..No verify run - * 0b01..Signature verify failed - * 0b10..Signature verify passed - */ -#define S50_ELS_STATUS_ECDSA_VFY_STATUS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_STATUS_ECDSA_VFY_STATUS_SHIFT)) & S50_ELS_STATUS_ECDSA_VFY_STATUS_MASK) - -#define S50_ELS_STATUS_PPROT_MASK (0xC0U) -#define S50_ELS_STATUS_PPROT_SHIFT (6U) -/*! PPROT - * 0b10..Non-secure, non-privileged - * 0b11..Non-secure, privileged - * 0b00..Secure, non-privileged - * 0b01..Secure, privileged - */ -#define S50_ELS_STATUS_PPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_STATUS_PPROT_SHIFT)) & S50_ELS_STATUS_PPROT_MASK) - -#define S50_ELS_STATUS_DRBG_ENT_LVL_MASK (0x300U) -#define S50_ELS_STATUS_DRBG_ENT_LVL_SHIFT (8U) -/*! DRBG_ENT_LVL - * 0b10..HIGH, DRBG generates random numbers of high quality entropy - * 0b01..LOW, DRBG generates random numbers of low quality entropy - * 0b00..NONE - * 0b11..RFU, Reserved for Future Use - */ -#define S50_ELS_STATUS_DRBG_ENT_LVL(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_STATUS_DRBG_ENT_LVL_SHIFT)) & S50_ELS_STATUS_DRBG_ENT_LVL_MASK) - -#define S50_ELS_STATUS_DTRNG_BUSY_MASK (0x400U) -#define S50_ELS_STATUS_DTRNG_BUSY_SHIFT (10U) -/*! DTRNG_BUSY - * 0b1..Gathering entropy - * 0b0..Not gathering entropy - */ -#define S50_ELS_STATUS_DTRNG_BUSY(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_STATUS_DTRNG_BUSY_SHIFT)) & S50_ELS_STATUS_DTRNG_BUSY_MASK) - -#define S50_ELS_STATUS_ELS_LOCKED_MASK (0x10000U) -#define S50_ELS_STATUS_ELS_LOCKED_SHIFT (16U) -/*! ELS_LOCKED - * 0b1..Locked by master - * 0b0..Not locked by master - */ -#define S50_ELS_STATUS_ELS_LOCKED(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_STATUS_ELS_LOCKED_SHIFT)) & S50_ELS_STATUS_ELS_LOCKED_MASK) -/*! @} */ - -/*! @name ELS_CTRL - Control Register */ -/*! @{ */ - -#define S50_ELS_CTRL_ELS_EN_MASK (0x1U) -#define S50_ELS_CTRL_ELS_EN_SHIFT (0U) -/*! ELS_EN - * 0b0..Disabled - * 0b1..Enabled - */ -#define S50_ELS_CTRL_ELS_EN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_CTRL_ELS_EN_SHIFT)) & S50_ELS_CTRL_ELS_EN_MASK) - -#define S50_ELS_CTRL_ELS_START_MASK (0x2U) -#define S50_ELS_CTRL_ELS_START_SHIFT (1U) -#define S50_ELS_CTRL_ELS_START(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_CTRL_ELS_START_SHIFT)) & S50_ELS_CTRL_ELS_START_MASK) - -#define S50_ELS_CTRL_ELS_RESET_MASK (0x4U) -#define S50_ELS_CTRL_ELS_RESET_SHIFT (2U) -#define S50_ELS_CTRL_ELS_RESET(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_CTRL_ELS_RESET_SHIFT)) & S50_ELS_CTRL_ELS_RESET_MASK) - -#define S50_ELS_CTRL_ELS_CMD_MASK (0xF8U) -#define S50_ELS_CTRL_ELS_CMD_SHIFT (3U) -/*! ELS_CMD - ELS Command ID */ -#define S50_ELS_CTRL_ELS_CMD(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_CTRL_ELS_CMD_SHIFT)) & S50_ELS_CTRL_ELS_CMD_MASK) - -#define S50_ELS_CTRL_BYTE_ORDER_MASK (0x100U) -#define S50_ELS_CTRL_BYTE_ORDER_SHIFT (8U) -/*! BYTE_ORDER - * 0b1..Big endian - * 0b0..Little endian - */ -#define S50_ELS_CTRL_BYTE_ORDER(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_CTRL_BYTE_ORDER_SHIFT)) & S50_ELS_CTRL_BYTE_ORDER_MASK) -/*! @} */ - -/*! @name ELS_CMDCFG0 - Command Configuration */ -/*! @{ */ - -#define S50_ELS_CMDCFG0_CMDCFG0_MASK (0xFFFFFFFFU) -#define S50_ELS_CMDCFG0_CMDCFG0_SHIFT (0U) -#define S50_ELS_CMDCFG0_CMDCFG0(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_CMDCFG0_CMDCFG0_SHIFT)) & S50_ELS_CMDCFG0_CMDCFG0_MASK) -/*! @} */ - -/*! @name ELS_CFG - Configuration Register */ -/*! @{ */ - -#define S50_ELS_CFG_ADCTRL_MASK (0x3FF0000U) -#define S50_ELS_CFG_ADCTRL_SHIFT (16U) -#define S50_ELS_CFG_ADCTRL(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_CFG_ADCTRL_SHIFT)) & S50_ELS_CFG_ADCTRL_MASK) -/*! @} */ - -/*! @name ELS_KIDX0 - Keystore Index 0 */ -/*! @{ */ - -#define S50_ELS_KIDX0_KIDX0_MASK (0x1FU) -#define S50_ELS_KIDX0_KIDX0_SHIFT (0U) -#define S50_ELS_KIDX0_KIDX0(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KIDX0_KIDX0_SHIFT)) & S50_ELS_KIDX0_KIDX0_MASK) -/*! @} */ - -/*! @name ELS_KIDX1 - Keystore Index 1 */ -/*! @{ */ - -#define S50_ELS_KIDX1_KIDX1_MASK (0x1FU) -#define S50_ELS_KIDX1_KIDX1_SHIFT (0U) -#define S50_ELS_KIDX1_KIDX1(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KIDX1_KIDX1_SHIFT)) & S50_ELS_KIDX1_KIDX1_MASK) -/*! @} */ - -/*! @name ELS_KPROPIN - Key Properties Request */ -/*! @{ */ - -#define S50_ELS_KPROPIN_KPROPIN_MASK (0xFFFFFFFFU) -#define S50_ELS_KPROPIN_KPROPIN_SHIFT (0U) -#define S50_ELS_KPROPIN_KPROPIN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KPROPIN_KPROPIN_SHIFT)) & S50_ELS_KPROPIN_KPROPIN_MASK) -/*! @} */ - -/*! @name ELS_DMA_SRC0 - DMA Source 0 */ -/*! @{ */ - -#define S50_ELS_DMA_SRC0_ADDR_SRC0_MASK (0xFFFFFFFFU) -#define S50_ELS_DMA_SRC0_ADDR_SRC0_SHIFT (0U) -#define S50_ELS_DMA_SRC0_ADDR_SRC0(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_DMA_SRC0_ADDR_SRC0_SHIFT)) & S50_ELS_DMA_SRC0_ADDR_SRC0_MASK) -/*! @} */ - -/*! @name ELS_DMA_SRC0_LEN - DMA Source 0 Length */ -/*! @{ */ - -#define S50_ELS_DMA_SRC0_LEN_SIZE_SRC0_LEN_MASK (0xFFFFFFFFU) -#define S50_ELS_DMA_SRC0_LEN_SIZE_SRC0_LEN_SHIFT (0U) -#define S50_ELS_DMA_SRC0_LEN_SIZE_SRC0_LEN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_DMA_SRC0_LEN_SIZE_SRC0_LEN_SHIFT)) & S50_ELS_DMA_SRC0_LEN_SIZE_SRC0_LEN_MASK) -/*! @} */ - -/*! @name ELS_DMA_SRC1 - DMA Source 1 */ -/*! @{ */ - -#define S50_ELS_DMA_SRC1_ADDR_SRC1_MASK (0xFFFFFFFFU) -#define S50_ELS_DMA_SRC1_ADDR_SRC1_SHIFT (0U) -#define S50_ELS_DMA_SRC1_ADDR_SRC1(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_DMA_SRC1_ADDR_SRC1_SHIFT)) & S50_ELS_DMA_SRC1_ADDR_SRC1_MASK) -/*! @} */ - -/*! @name ELS_DMA_SRC2 - DMA Source 2 */ -/*! @{ */ - -#define S50_ELS_DMA_SRC2_ADDR_SRC2_MASK (0xFFFFFFFFU) -#define S50_ELS_DMA_SRC2_ADDR_SRC2_SHIFT (0U) -#define S50_ELS_DMA_SRC2_ADDR_SRC2(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_DMA_SRC2_ADDR_SRC2_SHIFT)) & S50_ELS_DMA_SRC2_ADDR_SRC2_MASK) -/*! @} */ - -/*! @name ELS_DMA_SRC2_LEN - DMA Source 2 Length */ -/*! @{ */ - -#define S50_ELS_DMA_SRC2_LEN_SIZE_SRC2_LEN_MASK (0xFFFFFFFFU) -#define S50_ELS_DMA_SRC2_LEN_SIZE_SRC2_LEN_SHIFT (0U) -#define S50_ELS_DMA_SRC2_LEN_SIZE_SRC2_LEN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_DMA_SRC2_LEN_SIZE_SRC2_LEN_SHIFT)) & S50_ELS_DMA_SRC2_LEN_SIZE_SRC2_LEN_MASK) -/*! @} */ - -/*! @name ELS_DMA_RES0 - DMA Result 0 */ -/*! @{ */ - -#define S50_ELS_DMA_RES0_ADDR_RES0_MASK (0xFFFFFFFFU) -#define S50_ELS_DMA_RES0_ADDR_RES0_SHIFT (0U) -#define S50_ELS_DMA_RES0_ADDR_RES0(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_DMA_RES0_ADDR_RES0_SHIFT)) & S50_ELS_DMA_RES0_ADDR_RES0_MASK) -/*! @} */ - -/*! @name ELS_DMA_RES0_LEN - DMA Result 0 Length */ -/*! @{ */ - -#define S50_ELS_DMA_RES0_LEN_SIZE_RES0_LEN_MASK (0xFFFFFFFFU) -#define S50_ELS_DMA_RES0_LEN_SIZE_RES0_LEN_SHIFT (0U) -#define S50_ELS_DMA_RES0_LEN_SIZE_RES0_LEN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_DMA_RES0_LEN_SIZE_RES0_LEN_SHIFT)) & S50_ELS_DMA_RES0_LEN_SIZE_RES0_LEN_MASK) -/*! @} */ - -/*! @name ELS_INT_ENABLE - Interrupt Enable */ -/*! @{ */ - -#define S50_ELS_INT_ENABLE_INT_EN_MASK (0x1U) -#define S50_ELS_INT_ENABLE_INT_EN_SHIFT (0U) -/*! INT_EN - * 0b0..Disables - * 0b1..Enables - */ -#define S50_ELS_INT_ENABLE_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_INT_ENABLE_INT_EN_SHIFT)) & S50_ELS_INT_ENABLE_INT_EN_MASK) -/*! @} */ - -/*! @name ELS_INT_STATUS_CLR - Interrupt Status Clear */ -/*! @{ */ - -#define S50_ELS_INT_STATUS_CLR_INT_CLR_MASK (0x1U) -#define S50_ELS_INT_STATUS_CLR_INT_CLR_SHIFT (0U) -#define S50_ELS_INT_STATUS_CLR_INT_CLR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_INT_STATUS_CLR_INT_CLR_SHIFT)) & S50_ELS_INT_STATUS_CLR_INT_CLR_MASK) -/*! @} */ - -/*! @name ELS_INT_STATUS_SET - Interrupt Status Set */ -/*! @{ */ - -#define S50_ELS_INT_STATUS_SET_INT_SET_MASK (0x1U) -#define S50_ELS_INT_STATUS_SET_INT_SET_SHIFT (0U) -#define S50_ELS_INT_STATUS_SET_INT_SET(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_INT_STATUS_SET_INT_SET_SHIFT)) & S50_ELS_INT_STATUS_SET_INT_SET_MASK) -/*! @} */ - -/*! @name ELS_ERR_STATUS - Error Status */ -/*! @{ */ - -#define S50_ELS_ERR_STATUS_BUS_ERR_MASK (0x1U) -#define S50_ELS_ERR_STATUS_BUS_ERR_SHIFT (0U) -/*! BUS_ERR - * 0b0..No error - * 0b1..Error occurred - */ -#define S50_ELS_ERR_STATUS_BUS_ERR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_ERR_STATUS_BUS_ERR_SHIFT)) & S50_ELS_ERR_STATUS_BUS_ERR_MASK) - -#define S50_ELS_ERR_STATUS_OPN_ERR_MASK (0x2U) -#define S50_ELS_ERR_STATUS_OPN_ERR_SHIFT (1U) -/*! OPN_ERR - * 0b0..No error - * 0b1..Error occurred - */ -#define S50_ELS_ERR_STATUS_OPN_ERR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_ERR_STATUS_OPN_ERR_SHIFT)) & S50_ELS_ERR_STATUS_OPN_ERR_MASK) - -#define S50_ELS_ERR_STATUS_ALG_ERR_MASK (0x4U) -#define S50_ELS_ERR_STATUS_ALG_ERR_SHIFT (2U) -/*! ALG_ERR - * 0b0..No error - * 0b1..Error occurred - */ -#define S50_ELS_ERR_STATUS_ALG_ERR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_ERR_STATUS_ALG_ERR_SHIFT)) & S50_ELS_ERR_STATUS_ALG_ERR_MASK) - -#define S50_ELS_ERR_STATUS_ITG_ERR_MASK (0x8U) -#define S50_ELS_ERR_STATUS_ITG_ERR_SHIFT (3U) -/*! ITG_ERR - * 0b0..No error - * 0b1..Error occurred - */ -#define S50_ELS_ERR_STATUS_ITG_ERR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_ERR_STATUS_ITG_ERR_SHIFT)) & S50_ELS_ERR_STATUS_ITG_ERR_MASK) - -#define S50_ELS_ERR_STATUS_FLT_ERR_MASK (0x10U) -#define S50_ELS_ERR_STATUS_FLT_ERR_SHIFT (4U) -/*! FLT_ERR - * 0b0..No error - * 0b1..Error occurred - */ -#define S50_ELS_ERR_STATUS_FLT_ERR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_ERR_STATUS_FLT_ERR_SHIFT)) & S50_ELS_ERR_STATUS_FLT_ERR_MASK) - -#define S50_ELS_ERR_STATUS_PRNG_ERR_MASK (0x20U) -#define S50_ELS_ERR_STATUS_PRNG_ERR_SHIFT (5U) -/*! PRNG_ERR - * 0b0..No error - * 0b1..Error occurred - */ -#define S50_ELS_ERR_STATUS_PRNG_ERR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_ERR_STATUS_PRNG_ERR_SHIFT)) & S50_ELS_ERR_STATUS_PRNG_ERR_MASK) - -#define S50_ELS_ERR_STATUS_ERR_LVL_MASK (0xC0U) -#define S50_ELS_ERR_STATUS_ERR_LVL_SHIFT (6U) -#define S50_ELS_ERR_STATUS_ERR_LVL(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_ERR_STATUS_ERR_LVL_SHIFT)) & S50_ELS_ERR_STATUS_ERR_LVL_MASK) - -#define S50_ELS_ERR_STATUS_DTRNG_ERR_MASK (0x100U) -#define S50_ELS_ERR_STATUS_DTRNG_ERR_SHIFT (8U) -/*! DTRNG_ERR - * 0b0..No error - * 0b1..TRNG error occurred - */ -#define S50_ELS_ERR_STATUS_DTRNG_ERR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_ERR_STATUS_DTRNG_ERR_SHIFT)) & S50_ELS_ERR_STATUS_DTRNG_ERR_MASK) -/*! @} */ - -/*! @name ELS_ERR_STATUS_CLR - Error Status Clear */ -/*! @{ */ - -#define S50_ELS_ERR_STATUS_CLR_ERR_CLR_MASK (0x1U) -#define S50_ELS_ERR_STATUS_CLR_ERR_CLR_SHIFT (0U) -/*! ERR_CLR - * 0b1..Clears ELS error state - * 0b0..Exits ELS error state - */ -#define S50_ELS_ERR_STATUS_CLR_ERR_CLR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_ERR_STATUS_CLR_ERR_CLR_SHIFT)) & S50_ELS_ERR_STATUS_CLR_ERR_CLR_MASK) -/*! @} */ - -/*! @name ELS_VERSION - Version Register */ -/*! @{ */ - -#define S50_ELS_VERSION_Z_MASK (0xFU) -#define S50_ELS_VERSION_Z_SHIFT (0U) -#define S50_ELS_VERSION_Z(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_VERSION_Z_SHIFT)) & S50_ELS_VERSION_Z_MASK) - -#define S50_ELS_VERSION_Y2_MASK (0xF0U) -#define S50_ELS_VERSION_Y2_SHIFT (4U) -#define S50_ELS_VERSION_Y2(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_VERSION_Y2_SHIFT)) & S50_ELS_VERSION_Y2_MASK) - -#define S50_ELS_VERSION_Y1_MASK (0xF00U) -#define S50_ELS_VERSION_Y1_SHIFT (8U) -#define S50_ELS_VERSION_Y1(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_VERSION_Y1_SHIFT)) & S50_ELS_VERSION_Y1_MASK) - -#define S50_ELS_VERSION_X_MASK (0xF000U) -#define S50_ELS_VERSION_X_SHIFT (12U) -#define S50_ELS_VERSION_X(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_VERSION_X_SHIFT)) & S50_ELS_VERSION_X_MASK) - -#define S50_ELS_VERSION_SW_Z_MASK (0xF0000U) -#define S50_ELS_VERSION_SW_Z_SHIFT (16U) -#define S50_ELS_VERSION_SW_Z(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_VERSION_SW_Z_SHIFT)) & S50_ELS_VERSION_SW_Z_MASK) - -#define S50_ELS_VERSION_SW_Y2_MASK (0xF00000U) -#define S50_ELS_VERSION_SW_Y2_SHIFT (20U) -#define S50_ELS_VERSION_SW_Y2(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_VERSION_SW_Y2_SHIFT)) & S50_ELS_VERSION_SW_Y2_MASK) - -#define S50_ELS_VERSION_SW_Y1_MASK (0xF000000U) -#define S50_ELS_VERSION_SW_Y1_SHIFT (24U) -#define S50_ELS_VERSION_SW_Y1(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_VERSION_SW_Y1_SHIFT)) & S50_ELS_VERSION_SW_Y1_MASK) - -#define S50_ELS_VERSION_SW_X_MASK (0xF0000000U) -#define S50_ELS_VERSION_SW_X_SHIFT (28U) -#define S50_ELS_VERSION_SW_X(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_VERSION_SW_X_SHIFT)) & S50_ELS_VERSION_SW_X_MASK) -/*! @} */ - -/*! @name ELS_PRNG_DATOUT - PRNG SW Read Out */ -/*! @{ */ - -#define S50_ELS_PRNG_DATOUT_PRNG_DATOUT_MASK (0xFFFFFFFFU) -#define S50_ELS_PRNG_DATOUT_PRNG_DATOUT_SHIFT (0U) -#define S50_ELS_PRNG_DATOUT_PRNG_DATOUT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_PRNG_DATOUT_PRNG_DATOUT_SHIFT)) & S50_ELS_PRNG_DATOUT_PRNG_DATOUT_MASK) -/*! @} */ - -/*! @name ELS_CMDCRC_CTRL - CRC Configuration */ -/*! @{ */ - -#define S50_ELS_CMDCRC_CTRL_CMDCRC_RST_MASK (0x1U) -#define S50_ELS_CMDCRC_CTRL_CMDCRC_RST_SHIFT (0U) -/*! CMDCRC_RST - * 0b1..Resets the CRC command to its default value - * 0b0..No effect - */ -#define S50_ELS_CMDCRC_CTRL_CMDCRC_RST(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_CMDCRC_CTRL_CMDCRC_RST_SHIFT)) & S50_ELS_CMDCRC_CTRL_CMDCRC_RST_MASK) - -#define S50_ELS_CMDCRC_CTRL_CMDCRC_EN_MASK (0x2U) -#define S50_ELS_CMDCRC_CTRL_CMDCRC_EN_SHIFT (1U) -/*! CMDCRC_EN - * 0b1..Enables the CRC command. The CRC command will be updated on completion of each ELS command. - * 0b0..Disables the CRC command CRC. The CRC command will not be updated on completion of each ELS command. - */ -#define S50_ELS_CMDCRC_CTRL_CMDCRC_EN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_CMDCRC_CTRL_CMDCRC_EN_SHIFT)) & S50_ELS_CMDCRC_CTRL_CMDCRC_EN_MASK) -/*! @} */ - -/*! @name ELS_CMDCRC - Command CRC Value */ -/*! @{ */ - -#define S50_ELS_CMDCRC_CMDCRC_MASK (0xFFFFFFFFU) -#define S50_ELS_CMDCRC_CMDCRC_SHIFT (0U) -#define S50_ELS_CMDCRC_CMDCRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_CMDCRC_CMDCRC_SHIFT)) & S50_ELS_CMDCRC_CMDCRC_MASK) -/*! @} */ - -/*! @name ELS_SESSION_ID - Session ID */ -/*! @{ */ - -#define S50_ELS_SESSION_ID_SESSION_ID_MASK (0xFFFFFFFFU) -#define S50_ELS_SESSION_ID_SESSION_ID_SHIFT (0U) -#define S50_ELS_SESSION_ID_SESSION_ID(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_SESSION_ID_SESSION_ID_SHIFT)) & S50_ELS_SESSION_ID_SESSION_ID_MASK) -/*! @} */ - -/*! @name ELS_DMA_FIN_ADDR - Final DMA Address */ -/*! @{ */ - -#define S50_ELS_DMA_FIN_ADDR_DMA_FIN_ADDR_MASK (0xFFFFFFFFU) -#define S50_ELS_DMA_FIN_ADDR_DMA_FIN_ADDR_SHIFT (0U) -#define S50_ELS_DMA_FIN_ADDR_DMA_FIN_ADDR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_DMA_FIN_ADDR_DMA_FIN_ADDR_SHIFT)) & S50_ELS_DMA_FIN_ADDR_DMA_FIN_ADDR_MASK) -/*! @} */ - -/*! @name ELS_MASTER_ID - Master ID */ -/*! @{ */ - -#define S50_ELS_MASTER_ID_MASTER_ID_MASK (0x1FU) -#define S50_ELS_MASTER_ID_MASTER_ID_SHIFT (0U) -#define S50_ELS_MASTER_ID_MASTER_ID(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_MASTER_ID_MASTER_ID_SHIFT)) & S50_ELS_MASTER_ID_MASTER_ID_MASK) -/*! @} */ - -/*! @name ELS_KIDX2 - Keystore Index 2 */ -/*! @{ */ - -#define S50_ELS_KIDX2_KIDX2_MASK (0x1FU) -#define S50_ELS_KIDX2_KIDX2_SHIFT (0U) -#define S50_ELS_KIDX2_KIDX2(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KIDX2_KIDX2_SHIFT)) & S50_ELS_KIDX2_KIDX2_MASK) -/*! @} */ - -/*! @name ELS_KS0 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS0_KS0_KSIZE_MASK (0x3U) -#define S50_ELS_KS0_KS0_KSIZE_SHIFT (0U) -/*! KS0_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS0_KS0_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_KSIZE_SHIFT)) & S50_ELS_KS0_KS0_KSIZE_MASK) - -#define S50_ELS_KS0_KS0_KACT_MASK (0x20U) -#define S50_ELS_KS0_KS0_KACT_SHIFT (5U) -#define S50_ELS_KS0_KS0_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_KACT_SHIFT)) & S50_ELS_KS0_KS0_KACT_MASK) - -#define S50_ELS_KS0_KS0_KBASE_MASK (0x40U) -#define S50_ELS_KS0_KS0_KBASE_SHIFT (6U) -#define S50_ELS_KS0_KS0_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_KBASE_SHIFT)) & S50_ELS_KS0_KS0_KBASE_MASK) - -#define S50_ELS_KS0_KS0_FGP_MASK (0x80U) -#define S50_ELS_KS0_KS0_FGP_SHIFT (7U) -#define S50_ELS_KS0_KS0_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_FGP_SHIFT)) & S50_ELS_KS0_KS0_FGP_MASK) - -#define S50_ELS_KS0_KS0_FRTN_MASK (0x100U) -#define S50_ELS_KS0_KS0_FRTN_SHIFT (8U) -#define S50_ELS_KS0_KS0_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_FRTN_SHIFT)) & S50_ELS_KS0_KS0_FRTN_MASK) - -#define S50_ELS_KS0_KS0_FHWO_MASK (0x200U) -#define S50_ELS_KS0_KS0_FHWO_SHIFT (9U) -#define S50_ELS_KS0_KS0_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_FHWO_SHIFT)) & S50_ELS_KS0_KS0_FHWO_MASK) - -#define S50_ELS_KS0_KS0_UKPUK_MASK (0x800U) -#define S50_ELS_KS0_KS0_UKPUK_SHIFT (11U) -#define S50_ELS_KS0_KS0_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UKPUK_SHIFT)) & S50_ELS_KS0_KS0_UKPUK_MASK) - -#define S50_ELS_KS0_KS0_UTECDH_MASK (0x1000U) -#define S50_ELS_KS0_KS0_UTECDH_SHIFT (12U) -#define S50_ELS_KS0_KS0_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UTECDH_SHIFT)) & S50_ELS_KS0_KS0_UTECDH_MASK) - -#define S50_ELS_KS0_KS0_UCMAC_MASK (0x2000U) -#define S50_ELS_KS0_KS0_UCMAC_SHIFT (13U) -#define S50_ELS_KS0_KS0_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UCMAC_SHIFT)) & S50_ELS_KS0_KS0_UCMAC_MASK) - -#define S50_ELS_KS0_KS0_UKSK_MASK (0x4000U) -#define S50_ELS_KS0_KS0_UKSK_SHIFT (14U) -#define S50_ELS_KS0_KS0_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UKSK_SHIFT)) & S50_ELS_KS0_KS0_UKSK_MASK) - -#define S50_ELS_KS0_KS0_URTF_MASK (0x8000U) -#define S50_ELS_KS0_KS0_URTF_SHIFT (15U) -#define S50_ELS_KS0_KS0_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_URTF_SHIFT)) & S50_ELS_KS0_KS0_URTF_MASK) - -#define S50_ELS_KS0_KS0_UCKDF_MASK (0x10000U) -#define S50_ELS_KS0_KS0_UCKDF_SHIFT (16U) -#define S50_ELS_KS0_KS0_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UCKDF_SHIFT)) & S50_ELS_KS0_KS0_UCKDF_MASK) - -#define S50_ELS_KS0_KS0_UHKDF_MASK (0x20000U) -#define S50_ELS_KS0_KS0_UHKDF_SHIFT (17U) -#define S50_ELS_KS0_KS0_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UHKDF_SHIFT)) & S50_ELS_KS0_KS0_UHKDF_MASK) - -#define S50_ELS_KS0_KS0_UECSG_MASK (0x40000U) -#define S50_ELS_KS0_KS0_UECSG_SHIFT (18U) -#define S50_ELS_KS0_KS0_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UECSG_SHIFT)) & S50_ELS_KS0_KS0_UECSG_MASK) - -#define S50_ELS_KS0_KS0_UECDH_MASK (0x80000U) -#define S50_ELS_KS0_KS0_UECDH_SHIFT (19U) -#define S50_ELS_KS0_KS0_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UECDH_SHIFT)) & S50_ELS_KS0_KS0_UECDH_MASK) - -#define S50_ELS_KS0_KS0_UAES_MASK (0x100000U) -#define S50_ELS_KS0_KS0_UAES_SHIFT (20U) -#define S50_ELS_KS0_KS0_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UAES_SHIFT)) & S50_ELS_KS0_KS0_UAES_MASK) - -#define S50_ELS_KS0_KS0_UHMAC_MASK (0x200000U) -#define S50_ELS_KS0_KS0_UHMAC_SHIFT (21U) -#define S50_ELS_KS0_KS0_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UHMAC_SHIFT)) & S50_ELS_KS0_KS0_UHMAC_MASK) - -#define S50_ELS_KS0_KS0_UKWK_MASK (0x400000U) -#define S50_ELS_KS0_KS0_UKWK_SHIFT (22U) -#define S50_ELS_KS0_KS0_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UKWK_SHIFT)) & S50_ELS_KS0_KS0_UKWK_MASK) - -#define S50_ELS_KS0_KS0_UKUOK_MASK (0x800000U) -#define S50_ELS_KS0_KS0_UKUOK_SHIFT (23U) -#define S50_ELS_KS0_KS0_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UKUOK_SHIFT)) & S50_ELS_KS0_KS0_UKUOK_MASK) - -#define S50_ELS_KS0_KS0_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS0_KS0_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS0_KS0_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UTLSPMS_SHIFT)) & S50_ELS_KS0_KS0_UTLSPMS_MASK) - -#define S50_ELS_KS0_KS0_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS0_KS0_UTLSMS_SHIFT (25U) -#define S50_ELS_KS0_KS0_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UTLSMS_SHIFT)) & S50_ELS_KS0_KS0_UTLSMS_MASK) - -#define S50_ELS_KS0_KS0_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS0_KS0_UKGSRC_SHIFT (26U) -#define S50_ELS_KS0_KS0_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UKGSRC_SHIFT)) & S50_ELS_KS0_KS0_UKGSRC_MASK) - -#define S50_ELS_KS0_KS0_UHWO_MASK (0x8000000U) -#define S50_ELS_KS0_KS0_UHWO_SHIFT (27U) -#define S50_ELS_KS0_KS0_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UHWO_SHIFT)) & S50_ELS_KS0_KS0_UHWO_MASK) - -#define S50_ELS_KS0_KS0_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS0_KS0_UWRPOK_SHIFT (28U) -#define S50_ELS_KS0_KS0_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UWRPOK_SHIFT)) & S50_ELS_KS0_KS0_UWRPOK_MASK) - -#define S50_ELS_KS0_KS0_UDUK_MASK (0x20000000U) -#define S50_ELS_KS0_KS0_UDUK_SHIFT (29U) -#define S50_ELS_KS0_KS0_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UDUK_SHIFT)) & S50_ELS_KS0_KS0_UDUK_MASK) - -#define S50_ELS_KS0_KS0_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS0_KS0_UPPROT_SHIFT (30U) -#define S50_ELS_KS0_KS0_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UPPROT_SHIFT)) & S50_ELS_KS0_KS0_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS1 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS1_KS1_KSIZE_MASK (0x3U) -#define S50_ELS_KS1_KS1_KSIZE_SHIFT (0U) -/*! KS1_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS1_KS1_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_KSIZE_SHIFT)) & S50_ELS_KS1_KS1_KSIZE_MASK) - -#define S50_ELS_KS1_KS1_KACT_MASK (0x20U) -#define S50_ELS_KS1_KS1_KACT_SHIFT (5U) -#define S50_ELS_KS1_KS1_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_KACT_SHIFT)) & S50_ELS_KS1_KS1_KACT_MASK) - -#define S50_ELS_KS1_KS1_KBASE_MASK (0x40U) -#define S50_ELS_KS1_KS1_KBASE_SHIFT (6U) -#define S50_ELS_KS1_KS1_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_KBASE_SHIFT)) & S50_ELS_KS1_KS1_KBASE_MASK) - -#define S50_ELS_KS1_KS1_FGP_MASK (0x80U) -#define S50_ELS_KS1_KS1_FGP_SHIFT (7U) -#define S50_ELS_KS1_KS1_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_FGP_SHIFT)) & S50_ELS_KS1_KS1_FGP_MASK) - -#define S50_ELS_KS1_KS1_FRTN_MASK (0x100U) -#define S50_ELS_KS1_KS1_FRTN_SHIFT (8U) -#define S50_ELS_KS1_KS1_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_FRTN_SHIFT)) & S50_ELS_KS1_KS1_FRTN_MASK) - -#define S50_ELS_KS1_KS1_FHWO_MASK (0x200U) -#define S50_ELS_KS1_KS1_FHWO_SHIFT (9U) -#define S50_ELS_KS1_KS1_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_FHWO_SHIFT)) & S50_ELS_KS1_KS1_FHWO_MASK) - -#define S50_ELS_KS1_KS1_UKPUK_MASK (0x800U) -#define S50_ELS_KS1_KS1_UKPUK_SHIFT (11U) -#define S50_ELS_KS1_KS1_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UKPUK_SHIFT)) & S50_ELS_KS1_KS1_UKPUK_MASK) - -#define S50_ELS_KS1_KS1_UTECDH_MASK (0x1000U) -#define S50_ELS_KS1_KS1_UTECDH_SHIFT (12U) -#define S50_ELS_KS1_KS1_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UTECDH_SHIFT)) & S50_ELS_KS1_KS1_UTECDH_MASK) - -#define S50_ELS_KS1_KS1_UCMAC_MASK (0x2000U) -#define S50_ELS_KS1_KS1_UCMAC_SHIFT (13U) -#define S50_ELS_KS1_KS1_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UCMAC_SHIFT)) & S50_ELS_KS1_KS1_UCMAC_MASK) - -#define S50_ELS_KS1_KS1_UKSK_MASK (0x4000U) -#define S50_ELS_KS1_KS1_UKSK_SHIFT (14U) -#define S50_ELS_KS1_KS1_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UKSK_SHIFT)) & S50_ELS_KS1_KS1_UKSK_MASK) - -#define S50_ELS_KS1_KS1_URTF_MASK (0x8000U) -#define S50_ELS_KS1_KS1_URTF_SHIFT (15U) -#define S50_ELS_KS1_KS1_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_URTF_SHIFT)) & S50_ELS_KS1_KS1_URTF_MASK) - -#define S50_ELS_KS1_KS1_UCKDF_MASK (0x10000U) -#define S50_ELS_KS1_KS1_UCKDF_SHIFT (16U) -#define S50_ELS_KS1_KS1_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UCKDF_SHIFT)) & S50_ELS_KS1_KS1_UCKDF_MASK) - -#define S50_ELS_KS1_KS1_UHKDF_MASK (0x20000U) -#define S50_ELS_KS1_KS1_UHKDF_SHIFT (17U) -#define S50_ELS_KS1_KS1_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UHKDF_SHIFT)) & S50_ELS_KS1_KS1_UHKDF_MASK) - -#define S50_ELS_KS1_KS1_UECSG_MASK (0x40000U) -#define S50_ELS_KS1_KS1_UECSG_SHIFT (18U) -#define S50_ELS_KS1_KS1_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UECSG_SHIFT)) & S50_ELS_KS1_KS1_UECSG_MASK) - -#define S50_ELS_KS1_KS1_UECDH_MASK (0x80000U) -#define S50_ELS_KS1_KS1_UECDH_SHIFT (19U) -#define S50_ELS_KS1_KS1_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UECDH_SHIFT)) & S50_ELS_KS1_KS1_UECDH_MASK) - -#define S50_ELS_KS1_KS1_UAES_MASK (0x100000U) -#define S50_ELS_KS1_KS1_UAES_SHIFT (20U) -#define S50_ELS_KS1_KS1_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UAES_SHIFT)) & S50_ELS_KS1_KS1_UAES_MASK) - -#define S50_ELS_KS1_KS1_UHMAC_MASK (0x200000U) -#define S50_ELS_KS1_KS1_UHMAC_SHIFT (21U) -#define S50_ELS_KS1_KS1_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UHMAC_SHIFT)) & S50_ELS_KS1_KS1_UHMAC_MASK) - -#define S50_ELS_KS1_KS1_UKWK_MASK (0x400000U) -#define S50_ELS_KS1_KS1_UKWK_SHIFT (22U) -#define S50_ELS_KS1_KS1_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UKWK_SHIFT)) & S50_ELS_KS1_KS1_UKWK_MASK) - -#define S50_ELS_KS1_KS1_UKUOK_MASK (0x800000U) -#define S50_ELS_KS1_KS1_UKUOK_SHIFT (23U) -#define S50_ELS_KS1_KS1_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UKUOK_SHIFT)) & S50_ELS_KS1_KS1_UKUOK_MASK) - -#define S50_ELS_KS1_KS1_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS1_KS1_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS1_KS1_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UTLSPMS_SHIFT)) & S50_ELS_KS1_KS1_UTLSPMS_MASK) - -#define S50_ELS_KS1_KS1_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS1_KS1_UTLSMS_SHIFT (25U) -#define S50_ELS_KS1_KS1_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UTLSMS_SHIFT)) & S50_ELS_KS1_KS1_UTLSMS_MASK) - -#define S50_ELS_KS1_KS1_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS1_KS1_UKGSRC_SHIFT (26U) -#define S50_ELS_KS1_KS1_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UKGSRC_SHIFT)) & S50_ELS_KS1_KS1_UKGSRC_MASK) - -#define S50_ELS_KS1_KS1_UHWO_MASK (0x8000000U) -#define S50_ELS_KS1_KS1_UHWO_SHIFT (27U) -#define S50_ELS_KS1_KS1_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UHWO_SHIFT)) & S50_ELS_KS1_KS1_UHWO_MASK) - -#define S50_ELS_KS1_KS1_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS1_KS1_UWRPOK_SHIFT (28U) -#define S50_ELS_KS1_KS1_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UWRPOK_SHIFT)) & S50_ELS_KS1_KS1_UWRPOK_MASK) - -#define S50_ELS_KS1_KS1_UDUK_MASK (0x20000000U) -#define S50_ELS_KS1_KS1_UDUK_SHIFT (29U) -#define S50_ELS_KS1_KS1_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UDUK_SHIFT)) & S50_ELS_KS1_KS1_UDUK_MASK) - -#define S50_ELS_KS1_KS1_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS1_KS1_UPPROT_SHIFT (30U) -#define S50_ELS_KS1_KS1_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UPPROT_SHIFT)) & S50_ELS_KS1_KS1_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS2 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS2_KS2_KSIZE_MASK (0x3U) -#define S50_ELS_KS2_KS2_KSIZE_SHIFT (0U) -/*! KS2_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS2_KS2_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_KSIZE_SHIFT)) & S50_ELS_KS2_KS2_KSIZE_MASK) - -#define S50_ELS_KS2_KS2_KACT_MASK (0x20U) -#define S50_ELS_KS2_KS2_KACT_SHIFT (5U) -#define S50_ELS_KS2_KS2_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_KACT_SHIFT)) & S50_ELS_KS2_KS2_KACT_MASK) - -#define S50_ELS_KS2_KS2_KBASE_MASK (0x40U) -#define S50_ELS_KS2_KS2_KBASE_SHIFT (6U) -#define S50_ELS_KS2_KS2_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_KBASE_SHIFT)) & S50_ELS_KS2_KS2_KBASE_MASK) - -#define S50_ELS_KS2_KS2_FGP_MASK (0x80U) -#define S50_ELS_KS2_KS2_FGP_SHIFT (7U) -#define S50_ELS_KS2_KS2_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_FGP_SHIFT)) & S50_ELS_KS2_KS2_FGP_MASK) - -#define S50_ELS_KS2_KS2_FRTN_MASK (0x100U) -#define S50_ELS_KS2_KS2_FRTN_SHIFT (8U) -#define S50_ELS_KS2_KS2_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_FRTN_SHIFT)) & S50_ELS_KS2_KS2_FRTN_MASK) - -#define S50_ELS_KS2_KS2_FHWO_MASK (0x200U) -#define S50_ELS_KS2_KS2_FHWO_SHIFT (9U) -#define S50_ELS_KS2_KS2_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_FHWO_SHIFT)) & S50_ELS_KS2_KS2_FHWO_MASK) - -#define S50_ELS_KS2_KS2_UKPUK_MASK (0x800U) -#define S50_ELS_KS2_KS2_UKPUK_SHIFT (11U) -#define S50_ELS_KS2_KS2_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UKPUK_SHIFT)) & S50_ELS_KS2_KS2_UKPUK_MASK) - -#define S50_ELS_KS2_KS2_UTECDH_MASK (0x1000U) -#define S50_ELS_KS2_KS2_UTECDH_SHIFT (12U) -#define S50_ELS_KS2_KS2_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UTECDH_SHIFT)) & S50_ELS_KS2_KS2_UTECDH_MASK) - -#define S50_ELS_KS2_KS2_UCMAC_MASK (0x2000U) -#define S50_ELS_KS2_KS2_UCMAC_SHIFT (13U) -#define S50_ELS_KS2_KS2_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UCMAC_SHIFT)) & S50_ELS_KS2_KS2_UCMAC_MASK) - -#define S50_ELS_KS2_KS2_UKSK_MASK (0x4000U) -#define S50_ELS_KS2_KS2_UKSK_SHIFT (14U) -#define S50_ELS_KS2_KS2_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UKSK_SHIFT)) & S50_ELS_KS2_KS2_UKSK_MASK) - -#define S50_ELS_KS2_KS2_URTF_MASK (0x8000U) -#define S50_ELS_KS2_KS2_URTF_SHIFT (15U) -#define S50_ELS_KS2_KS2_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_URTF_SHIFT)) & S50_ELS_KS2_KS2_URTF_MASK) - -#define S50_ELS_KS2_KS2_UCKDF_MASK (0x10000U) -#define S50_ELS_KS2_KS2_UCKDF_SHIFT (16U) -#define S50_ELS_KS2_KS2_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UCKDF_SHIFT)) & S50_ELS_KS2_KS2_UCKDF_MASK) - -#define S50_ELS_KS2_KS2_UHKDF_MASK (0x20000U) -#define S50_ELS_KS2_KS2_UHKDF_SHIFT (17U) -#define S50_ELS_KS2_KS2_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UHKDF_SHIFT)) & S50_ELS_KS2_KS2_UHKDF_MASK) - -#define S50_ELS_KS2_KS2_UECSG_MASK (0x40000U) -#define S50_ELS_KS2_KS2_UECSG_SHIFT (18U) -#define S50_ELS_KS2_KS2_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UECSG_SHIFT)) & S50_ELS_KS2_KS2_UECSG_MASK) - -#define S50_ELS_KS2_KS2_UECDH_MASK (0x80000U) -#define S50_ELS_KS2_KS2_UECDH_SHIFT (19U) -#define S50_ELS_KS2_KS2_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UECDH_SHIFT)) & S50_ELS_KS2_KS2_UECDH_MASK) - -#define S50_ELS_KS2_KS2_UAES_MASK (0x100000U) -#define S50_ELS_KS2_KS2_UAES_SHIFT (20U) -#define S50_ELS_KS2_KS2_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UAES_SHIFT)) & S50_ELS_KS2_KS2_UAES_MASK) - -#define S50_ELS_KS2_KS2_UHMAC_MASK (0x200000U) -#define S50_ELS_KS2_KS2_UHMAC_SHIFT (21U) -#define S50_ELS_KS2_KS2_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UHMAC_SHIFT)) & S50_ELS_KS2_KS2_UHMAC_MASK) - -#define S50_ELS_KS2_KS2_UKWK_MASK (0x400000U) -#define S50_ELS_KS2_KS2_UKWK_SHIFT (22U) -#define S50_ELS_KS2_KS2_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UKWK_SHIFT)) & S50_ELS_KS2_KS2_UKWK_MASK) - -#define S50_ELS_KS2_KS2_UKUOK_MASK (0x800000U) -#define S50_ELS_KS2_KS2_UKUOK_SHIFT (23U) -#define S50_ELS_KS2_KS2_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UKUOK_SHIFT)) & S50_ELS_KS2_KS2_UKUOK_MASK) - -#define S50_ELS_KS2_KS2_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS2_KS2_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS2_KS2_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UTLSPMS_SHIFT)) & S50_ELS_KS2_KS2_UTLSPMS_MASK) - -#define S50_ELS_KS2_KS2_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS2_KS2_UTLSMS_SHIFT (25U) -#define S50_ELS_KS2_KS2_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UTLSMS_SHIFT)) & S50_ELS_KS2_KS2_UTLSMS_MASK) - -#define S50_ELS_KS2_KS2_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS2_KS2_UKGSRC_SHIFT (26U) -#define S50_ELS_KS2_KS2_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UKGSRC_SHIFT)) & S50_ELS_KS2_KS2_UKGSRC_MASK) - -#define S50_ELS_KS2_KS2_UHWO_MASK (0x8000000U) -#define S50_ELS_KS2_KS2_UHWO_SHIFT (27U) -#define S50_ELS_KS2_KS2_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UHWO_SHIFT)) & S50_ELS_KS2_KS2_UHWO_MASK) - -#define S50_ELS_KS2_KS2_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS2_KS2_UWRPOK_SHIFT (28U) -#define S50_ELS_KS2_KS2_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UWRPOK_SHIFT)) & S50_ELS_KS2_KS2_UWRPOK_MASK) - -#define S50_ELS_KS2_KS2_UDUK_MASK (0x20000000U) -#define S50_ELS_KS2_KS2_UDUK_SHIFT (29U) -#define S50_ELS_KS2_KS2_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UDUK_SHIFT)) & S50_ELS_KS2_KS2_UDUK_MASK) - -#define S50_ELS_KS2_KS2_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS2_KS2_UPPROT_SHIFT (30U) -#define S50_ELS_KS2_KS2_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UPPROT_SHIFT)) & S50_ELS_KS2_KS2_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS3 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS3_KS3_KSIZE_MASK (0x3U) -#define S50_ELS_KS3_KS3_KSIZE_SHIFT (0U) -/*! KS3_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS3_KS3_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_KSIZE_SHIFT)) & S50_ELS_KS3_KS3_KSIZE_MASK) - -#define S50_ELS_KS3_KS3_KACT_MASK (0x20U) -#define S50_ELS_KS3_KS3_KACT_SHIFT (5U) -#define S50_ELS_KS3_KS3_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_KACT_SHIFT)) & S50_ELS_KS3_KS3_KACT_MASK) - -#define S50_ELS_KS3_KS3_KBASE_MASK (0x40U) -#define S50_ELS_KS3_KS3_KBASE_SHIFT (6U) -#define S50_ELS_KS3_KS3_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_KBASE_SHIFT)) & S50_ELS_KS3_KS3_KBASE_MASK) - -#define S50_ELS_KS3_KS3_FGP_MASK (0x80U) -#define S50_ELS_KS3_KS3_FGP_SHIFT (7U) -#define S50_ELS_KS3_KS3_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_FGP_SHIFT)) & S50_ELS_KS3_KS3_FGP_MASK) - -#define S50_ELS_KS3_KS3_FRTN_MASK (0x100U) -#define S50_ELS_KS3_KS3_FRTN_SHIFT (8U) -#define S50_ELS_KS3_KS3_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_FRTN_SHIFT)) & S50_ELS_KS3_KS3_FRTN_MASK) - -#define S50_ELS_KS3_KS3_FHWO_MASK (0x200U) -#define S50_ELS_KS3_KS3_FHWO_SHIFT (9U) -#define S50_ELS_KS3_KS3_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_FHWO_SHIFT)) & S50_ELS_KS3_KS3_FHWO_MASK) - -#define S50_ELS_KS3_KS3_UKPUK_MASK (0x800U) -#define S50_ELS_KS3_KS3_UKPUK_SHIFT (11U) -#define S50_ELS_KS3_KS3_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UKPUK_SHIFT)) & S50_ELS_KS3_KS3_UKPUK_MASK) - -#define S50_ELS_KS3_KS3_UTECDH_MASK (0x1000U) -#define S50_ELS_KS3_KS3_UTECDH_SHIFT (12U) -#define S50_ELS_KS3_KS3_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UTECDH_SHIFT)) & S50_ELS_KS3_KS3_UTECDH_MASK) - -#define S50_ELS_KS3_KS3_UCMAC_MASK (0x2000U) -#define S50_ELS_KS3_KS3_UCMAC_SHIFT (13U) -#define S50_ELS_KS3_KS3_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UCMAC_SHIFT)) & S50_ELS_KS3_KS3_UCMAC_MASK) - -#define S50_ELS_KS3_KS3_UKSK_MASK (0x4000U) -#define S50_ELS_KS3_KS3_UKSK_SHIFT (14U) -#define S50_ELS_KS3_KS3_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UKSK_SHIFT)) & S50_ELS_KS3_KS3_UKSK_MASK) - -#define S50_ELS_KS3_KS3_URTF_MASK (0x8000U) -#define S50_ELS_KS3_KS3_URTF_SHIFT (15U) -#define S50_ELS_KS3_KS3_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_URTF_SHIFT)) & S50_ELS_KS3_KS3_URTF_MASK) - -#define S50_ELS_KS3_KS3_UCKDF_MASK (0x10000U) -#define S50_ELS_KS3_KS3_UCKDF_SHIFT (16U) -#define S50_ELS_KS3_KS3_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UCKDF_SHIFT)) & S50_ELS_KS3_KS3_UCKDF_MASK) - -#define S50_ELS_KS3_KS3_UHKDF_MASK (0x20000U) -#define S50_ELS_KS3_KS3_UHKDF_SHIFT (17U) -#define S50_ELS_KS3_KS3_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UHKDF_SHIFT)) & S50_ELS_KS3_KS3_UHKDF_MASK) - -#define S50_ELS_KS3_KS3_UECSG_MASK (0x40000U) -#define S50_ELS_KS3_KS3_UECSG_SHIFT (18U) -#define S50_ELS_KS3_KS3_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UECSG_SHIFT)) & S50_ELS_KS3_KS3_UECSG_MASK) - -#define S50_ELS_KS3_KS3_UECDH_MASK (0x80000U) -#define S50_ELS_KS3_KS3_UECDH_SHIFT (19U) -#define S50_ELS_KS3_KS3_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UECDH_SHIFT)) & S50_ELS_KS3_KS3_UECDH_MASK) - -#define S50_ELS_KS3_KS3_UAES_MASK (0x100000U) -#define S50_ELS_KS3_KS3_UAES_SHIFT (20U) -#define S50_ELS_KS3_KS3_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UAES_SHIFT)) & S50_ELS_KS3_KS3_UAES_MASK) - -#define S50_ELS_KS3_KS3_UHMAC_MASK (0x200000U) -#define S50_ELS_KS3_KS3_UHMAC_SHIFT (21U) -#define S50_ELS_KS3_KS3_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UHMAC_SHIFT)) & S50_ELS_KS3_KS3_UHMAC_MASK) - -#define S50_ELS_KS3_KS3_UKWK_MASK (0x400000U) -#define S50_ELS_KS3_KS3_UKWK_SHIFT (22U) -#define S50_ELS_KS3_KS3_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UKWK_SHIFT)) & S50_ELS_KS3_KS3_UKWK_MASK) - -#define S50_ELS_KS3_KS3_UKUOK_MASK (0x800000U) -#define S50_ELS_KS3_KS3_UKUOK_SHIFT (23U) -#define S50_ELS_KS3_KS3_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UKUOK_SHIFT)) & S50_ELS_KS3_KS3_UKUOK_MASK) - -#define S50_ELS_KS3_KS3_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS3_KS3_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS3_KS3_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UTLSPMS_SHIFT)) & S50_ELS_KS3_KS3_UTLSPMS_MASK) - -#define S50_ELS_KS3_KS3_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS3_KS3_UTLSMS_SHIFT (25U) -#define S50_ELS_KS3_KS3_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UTLSMS_SHIFT)) & S50_ELS_KS3_KS3_UTLSMS_MASK) - -#define S50_ELS_KS3_KS3_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS3_KS3_UKGSRC_SHIFT (26U) -#define S50_ELS_KS3_KS3_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UKGSRC_SHIFT)) & S50_ELS_KS3_KS3_UKGSRC_MASK) - -#define S50_ELS_KS3_KS3_UHWO_MASK (0x8000000U) -#define S50_ELS_KS3_KS3_UHWO_SHIFT (27U) -#define S50_ELS_KS3_KS3_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UHWO_SHIFT)) & S50_ELS_KS3_KS3_UHWO_MASK) - -#define S50_ELS_KS3_KS3_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS3_KS3_UWRPOK_SHIFT (28U) -#define S50_ELS_KS3_KS3_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UWRPOK_SHIFT)) & S50_ELS_KS3_KS3_UWRPOK_MASK) - -#define S50_ELS_KS3_KS3_UDUK_MASK (0x20000000U) -#define S50_ELS_KS3_KS3_UDUK_SHIFT (29U) -#define S50_ELS_KS3_KS3_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UDUK_SHIFT)) & S50_ELS_KS3_KS3_UDUK_MASK) - -#define S50_ELS_KS3_KS3_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS3_KS3_UPPROT_SHIFT (30U) -#define S50_ELS_KS3_KS3_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UPPROT_SHIFT)) & S50_ELS_KS3_KS3_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS4 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS4_KS4_KSIZE_MASK (0x3U) -#define S50_ELS_KS4_KS4_KSIZE_SHIFT (0U) -/*! KS4_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS4_KS4_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_KSIZE_SHIFT)) & S50_ELS_KS4_KS4_KSIZE_MASK) - -#define S50_ELS_KS4_KS4_KACT_MASK (0x20U) -#define S50_ELS_KS4_KS4_KACT_SHIFT (5U) -#define S50_ELS_KS4_KS4_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_KACT_SHIFT)) & S50_ELS_KS4_KS4_KACT_MASK) - -#define S50_ELS_KS4_KS4_KBASE_MASK (0x40U) -#define S50_ELS_KS4_KS4_KBASE_SHIFT (6U) -#define S50_ELS_KS4_KS4_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_KBASE_SHIFT)) & S50_ELS_KS4_KS4_KBASE_MASK) - -#define S50_ELS_KS4_KS4_FGP_MASK (0x80U) -#define S50_ELS_KS4_KS4_FGP_SHIFT (7U) -#define S50_ELS_KS4_KS4_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_FGP_SHIFT)) & S50_ELS_KS4_KS4_FGP_MASK) - -#define S50_ELS_KS4_KS4_FRTN_MASK (0x100U) -#define S50_ELS_KS4_KS4_FRTN_SHIFT (8U) -#define S50_ELS_KS4_KS4_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_FRTN_SHIFT)) & S50_ELS_KS4_KS4_FRTN_MASK) - -#define S50_ELS_KS4_KS4_FHWO_MASK (0x200U) -#define S50_ELS_KS4_KS4_FHWO_SHIFT (9U) -#define S50_ELS_KS4_KS4_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_FHWO_SHIFT)) & S50_ELS_KS4_KS4_FHWO_MASK) - -#define S50_ELS_KS4_KS4_UKPUK_MASK (0x800U) -#define S50_ELS_KS4_KS4_UKPUK_SHIFT (11U) -#define S50_ELS_KS4_KS4_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UKPUK_SHIFT)) & S50_ELS_KS4_KS4_UKPUK_MASK) - -#define S50_ELS_KS4_KS4_UTECDH_MASK (0x1000U) -#define S50_ELS_KS4_KS4_UTECDH_SHIFT (12U) -#define S50_ELS_KS4_KS4_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UTECDH_SHIFT)) & S50_ELS_KS4_KS4_UTECDH_MASK) - -#define S50_ELS_KS4_KS4_UCMAC_MASK (0x2000U) -#define S50_ELS_KS4_KS4_UCMAC_SHIFT (13U) -#define S50_ELS_KS4_KS4_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UCMAC_SHIFT)) & S50_ELS_KS4_KS4_UCMAC_MASK) - -#define S50_ELS_KS4_KS4_UKSK_MASK (0x4000U) -#define S50_ELS_KS4_KS4_UKSK_SHIFT (14U) -#define S50_ELS_KS4_KS4_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UKSK_SHIFT)) & S50_ELS_KS4_KS4_UKSK_MASK) - -#define S50_ELS_KS4_KS4_URTF_MASK (0x8000U) -#define S50_ELS_KS4_KS4_URTF_SHIFT (15U) -#define S50_ELS_KS4_KS4_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_URTF_SHIFT)) & S50_ELS_KS4_KS4_URTF_MASK) - -#define S50_ELS_KS4_KS4_UCKDF_MASK (0x10000U) -#define S50_ELS_KS4_KS4_UCKDF_SHIFT (16U) -#define S50_ELS_KS4_KS4_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UCKDF_SHIFT)) & S50_ELS_KS4_KS4_UCKDF_MASK) - -#define S50_ELS_KS4_KS4_UHKDF_MASK (0x20000U) -#define S50_ELS_KS4_KS4_UHKDF_SHIFT (17U) -#define S50_ELS_KS4_KS4_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UHKDF_SHIFT)) & S50_ELS_KS4_KS4_UHKDF_MASK) - -#define S50_ELS_KS4_KS4_UECSG_MASK (0x40000U) -#define S50_ELS_KS4_KS4_UECSG_SHIFT (18U) -#define S50_ELS_KS4_KS4_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UECSG_SHIFT)) & S50_ELS_KS4_KS4_UECSG_MASK) - -#define S50_ELS_KS4_KS4_UECDH_MASK (0x80000U) -#define S50_ELS_KS4_KS4_UECDH_SHIFT (19U) -#define S50_ELS_KS4_KS4_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UECDH_SHIFT)) & S50_ELS_KS4_KS4_UECDH_MASK) - -#define S50_ELS_KS4_KS4_UAES_MASK (0x100000U) -#define S50_ELS_KS4_KS4_UAES_SHIFT (20U) -#define S50_ELS_KS4_KS4_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UAES_SHIFT)) & S50_ELS_KS4_KS4_UAES_MASK) - -#define S50_ELS_KS4_KS4_UHMAC_MASK (0x200000U) -#define S50_ELS_KS4_KS4_UHMAC_SHIFT (21U) -#define S50_ELS_KS4_KS4_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UHMAC_SHIFT)) & S50_ELS_KS4_KS4_UHMAC_MASK) - -#define S50_ELS_KS4_KS4_UKWK_MASK (0x400000U) -#define S50_ELS_KS4_KS4_UKWK_SHIFT (22U) -#define S50_ELS_KS4_KS4_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UKWK_SHIFT)) & S50_ELS_KS4_KS4_UKWK_MASK) - -#define S50_ELS_KS4_KS4_UKUOK_MASK (0x800000U) -#define S50_ELS_KS4_KS4_UKUOK_SHIFT (23U) -#define S50_ELS_KS4_KS4_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UKUOK_SHIFT)) & S50_ELS_KS4_KS4_UKUOK_MASK) - -#define S50_ELS_KS4_KS4_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS4_KS4_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS4_KS4_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UTLSPMS_SHIFT)) & S50_ELS_KS4_KS4_UTLSPMS_MASK) - -#define S50_ELS_KS4_KS4_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS4_KS4_UTLSMS_SHIFT (25U) -#define S50_ELS_KS4_KS4_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UTLSMS_SHIFT)) & S50_ELS_KS4_KS4_UTLSMS_MASK) - -#define S50_ELS_KS4_KS4_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS4_KS4_UKGSRC_SHIFT (26U) -#define S50_ELS_KS4_KS4_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UKGSRC_SHIFT)) & S50_ELS_KS4_KS4_UKGSRC_MASK) - -#define S50_ELS_KS4_KS4_UHWO_MASK (0x8000000U) -#define S50_ELS_KS4_KS4_UHWO_SHIFT (27U) -#define S50_ELS_KS4_KS4_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UHWO_SHIFT)) & S50_ELS_KS4_KS4_UHWO_MASK) - -#define S50_ELS_KS4_KS4_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS4_KS4_UWRPOK_SHIFT (28U) -#define S50_ELS_KS4_KS4_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UWRPOK_SHIFT)) & S50_ELS_KS4_KS4_UWRPOK_MASK) - -#define S50_ELS_KS4_KS4_UDUK_MASK (0x20000000U) -#define S50_ELS_KS4_KS4_UDUK_SHIFT (29U) -#define S50_ELS_KS4_KS4_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UDUK_SHIFT)) & S50_ELS_KS4_KS4_UDUK_MASK) - -#define S50_ELS_KS4_KS4_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS4_KS4_UPPROT_SHIFT (30U) -#define S50_ELS_KS4_KS4_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UPPROT_SHIFT)) & S50_ELS_KS4_KS4_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS5 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS5_KS5_KSIZE_MASK (0x3U) -#define S50_ELS_KS5_KS5_KSIZE_SHIFT (0U) -/*! KS5_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS5_KS5_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_KSIZE_SHIFT)) & S50_ELS_KS5_KS5_KSIZE_MASK) - -#define S50_ELS_KS5_KS5_KACT_MASK (0x20U) -#define S50_ELS_KS5_KS5_KACT_SHIFT (5U) -#define S50_ELS_KS5_KS5_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_KACT_SHIFT)) & S50_ELS_KS5_KS5_KACT_MASK) - -#define S50_ELS_KS5_KS5_KBASE_MASK (0x40U) -#define S50_ELS_KS5_KS5_KBASE_SHIFT (6U) -#define S50_ELS_KS5_KS5_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_KBASE_SHIFT)) & S50_ELS_KS5_KS5_KBASE_MASK) - -#define S50_ELS_KS5_KS5_FGP_MASK (0x80U) -#define S50_ELS_KS5_KS5_FGP_SHIFT (7U) -#define S50_ELS_KS5_KS5_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_FGP_SHIFT)) & S50_ELS_KS5_KS5_FGP_MASK) - -#define S50_ELS_KS5_KS5_FRTN_MASK (0x100U) -#define S50_ELS_KS5_KS5_FRTN_SHIFT (8U) -#define S50_ELS_KS5_KS5_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_FRTN_SHIFT)) & S50_ELS_KS5_KS5_FRTN_MASK) - -#define S50_ELS_KS5_KS5_FHWO_MASK (0x200U) -#define S50_ELS_KS5_KS5_FHWO_SHIFT (9U) -#define S50_ELS_KS5_KS5_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_FHWO_SHIFT)) & S50_ELS_KS5_KS5_FHWO_MASK) - -#define S50_ELS_KS5_KS5_UKPUK_MASK (0x800U) -#define S50_ELS_KS5_KS5_UKPUK_SHIFT (11U) -#define S50_ELS_KS5_KS5_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UKPUK_SHIFT)) & S50_ELS_KS5_KS5_UKPUK_MASK) - -#define S50_ELS_KS5_KS5_UTECDH_MASK (0x1000U) -#define S50_ELS_KS5_KS5_UTECDH_SHIFT (12U) -#define S50_ELS_KS5_KS5_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UTECDH_SHIFT)) & S50_ELS_KS5_KS5_UTECDH_MASK) - -#define S50_ELS_KS5_KS5_UCMAC_MASK (0x2000U) -#define S50_ELS_KS5_KS5_UCMAC_SHIFT (13U) -#define S50_ELS_KS5_KS5_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UCMAC_SHIFT)) & S50_ELS_KS5_KS5_UCMAC_MASK) - -#define S50_ELS_KS5_KS5_UKSK_MASK (0x4000U) -#define S50_ELS_KS5_KS5_UKSK_SHIFT (14U) -#define S50_ELS_KS5_KS5_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UKSK_SHIFT)) & S50_ELS_KS5_KS5_UKSK_MASK) - -#define S50_ELS_KS5_KS5_URTF_MASK (0x8000U) -#define S50_ELS_KS5_KS5_URTF_SHIFT (15U) -#define S50_ELS_KS5_KS5_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_URTF_SHIFT)) & S50_ELS_KS5_KS5_URTF_MASK) - -#define S50_ELS_KS5_KS5_UCKDF_MASK (0x10000U) -#define S50_ELS_KS5_KS5_UCKDF_SHIFT (16U) -#define S50_ELS_KS5_KS5_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UCKDF_SHIFT)) & S50_ELS_KS5_KS5_UCKDF_MASK) - -#define S50_ELS_KS5_KS5_UHKDF_MASK (0x20000U) -#define S50_ELS_KS5_KS5_UHKDF_SHIFT (17U) -#define S50_ELS_KS5_KS5_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UHKDF_SHIFT)) & S50_ELS_KS5_KS5_UHKDF_MASK) - -#define S50_ELS_KS5_KS5_UECSG_MASK (0x40000U) -#define S50_ELS_KS5_KS5_UECSG_SHIFT (18U) -#define S50_ELS_KS5_KS5_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UECSG_SHIFT)) & S50_ELS_KS5_KS5_UECSG_MASK) - -#define S50_ELS_KS5_KS5_UECDH_MASK (0x80000U) -#define S50_ELS_KS5_KS5_UECDH_SHIFT (19U) -#define S50_ELS_KS5_KS5_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UECDH_SHIFT)) & S50_ELS_KS5_KS5_UECDH_MASK) - -#define S50_ELS_KS5_KS5_UAES_MASK (0x100000U) -#define S50_ELS_KS5_KS5_UAES_SHIFT (20U) -#define S50_ELS_KS5_KS5_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UAES_SHIFT)) & S50_ELS_KS5_KS5_UAES_MASK) - -#define S50_ELS_KS5_KS5_UHMAC_MASK (0x200000U) -#define S50_ELS_KS5_KS5_UHMAC_SHIFT (21U) -#define S50_ELS_KS5_KS5_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UHMAC_SHIFT)) & S50_ELS_KS5_KS5_UHMAC_MASK) - -#define S50_ELS_KS5_KS5_UKWK_MASK (0x400000U) -#define S50_ELS_KS5_KS5_UKWK_SHIFT (22U) -#define S50_ELS_KS5_KS5_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UKWK_SHIFT)) & S50_ELS_KS5_KS5_UKWK_MASK) - -#define S50_ELS_KS5_KS5_UKUOK_MASK (0x800000U) -#define S50_ELS_KS5_KS5_UKUOK_SHIFT (23U) -#define S50_ELS_KS5_KS5_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UKUOK_SHIFT)) & S50_ELS_KS5_KS5_UKUOK_MASK) - -#define S50_ELS_KS5_KS5_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS5_KS5_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS5_KS5_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UTLSPMS_SHIFT)) & S50_ELS_KS5_KS5_UTLSPMS_MASK) - -#define S50_ELS_KS5_KS5_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS5_KS5_UTLSMS_SHIFT (25U) -#define S50_ELS_KS5_KS5_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UTLSMS_SHIFT)) & S50_ELS_KS5_KS5_UTLSMS_MASK) - -#define S50_ELS_KS5_KS5_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS5_KS5_UKGSRC_SHIFT (26U) -#define S50_ELS_KS5_KS5_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UKGSRC_SHIFT)) & S50_ELS_KS5_KS5_UKGSRC_MASK) - -#define S50_ELS_KS5_KS5_UHWO_MASK (0x8000000U) -#define S50_ELS_KS5_KS5_UHWO_SHIFT (27U) -#define S50_ELS_KS5_KS5_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UHWO_SHIFT)) & S50_ELS_KS5_KS5_UHWO_MASK) - -#define S50_ELS_KS5_KS5_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS5_KS5_UWRPOK_SHIFT (28U) -#define S50_ELS_KS5_KS5_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UWRPOK_SHIFT)) & S50_ELS_KS5_KS5_UWRPOK_MASK) - -#define S50_ELS_KS5_KS5_UDUK_MASK (0x20000000U) -#define S50_ELS_KS5_KS5_UDUK_SHIFT (29U) -#define S50_ELS_KS5_KS5_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UDUK_SHIFT)) & S50_ELS_KS5_KS5_UDUK_MASK) - -#define S50_ELS_KS5_KS5_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS5_KS5_UPPROT_SHIFT (30U) -#define S50_ELS_KS5_KS5_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UPPROT_SHIFT)) & S50_ELS_KS5_KS5_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS6 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS6_KS6_KSIZE_MASK (0x3U) -#define S50_ELS_KS6_KS6_KSIZE_SHIFT (0U) -/*! KS6_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS6_KS6_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_KSIZE_SHIFT)) & S50_ELS_KS6_KS6_KSIZE_MASK) - -#define S50_ELS_KS6_KS6_KACT_MASK (0x20U) -#define S50_ELS_KS6_KS6_KACT_SHIFT (5U) -#define S50_ELS_KS6_KS6_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_KACT_SHIFT)) & S50_ELS_KS6_KS6_KACT_MASK) - -#define S50_ELS_KS6_KS6_KBASE_MASK (0x40U) -#define S50_ELS_KS6_KS6_KBASE_SHIFT (6U) -#define S50_ELS_KS6_KS6_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_KBASE_SHIFT)) & S50_ELS_KS6_KS6_KBASE_MASK) - -#define S50_ELS_KS6_KS6_FGP_MASK (0x80U) -#define S50_ELS_KS6_KS6_FGP_SHIFT (7U) -#define S50_ELS_KS6_KS6_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_FGP_SHIFT)) & S50_ELS_KS6_KS6_FGP_MASK) - -#define S50_ELS_KS6_KS6_FRTN_MASK (0x100U) -#define S50_ELS_KS6_KS6_FRTN_SHIFT (8U) -#define S50_ELS_KS6_KS6_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_FRTN_SHIFT)) & S50_ELS_KS6_KS6_FRTN_MASK) - -#define S50_ELS_KS6_KS6_FHWO_MASK (0x200U) -#define S50_ELS_KS6_KS6_FHWO_SHIFT (9U) -#define S50_ELS_KS6_KS6_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_FHWO_SHIFT)) & S50_ELS_KS6_KS6_FHWO_MASK) - -#define S50_ELS_KS6_KS6_UKPUK_MASK (0x800U) -#define S50_ELS_KS6_KS6_UKPUK_SHIFT (11U) -#define S50_ELS_KS6_KS6_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UKPUK_SHIFT)) & S50_ELS_KS6_KS6_UKPUK_MASK) - -#define S50_ELS_KS6_KS6_UTECDH_MASK (0x1000U) -#define S50_ELS_KS6_KS6_UTECDH_SHIFT (12U) -#define S50_ELS_KS6_KS6_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UTECDH_SHIFT)) & S50_ELS_KS6_KS6_UTECDH_MASK) - -#define S50_ELS_KS6_KS6_UCMAC_MASK (0x2000U) -#define S50_ELS_KS6_KS6_UCMAC_SHIFT (13U) -#define S50_ELS_KS6_KS6_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UCMAC_SHIFT)) & S50_ELS_KS6_KS6_UCMAC_MASK) - -#define S50_ELS_KS6_KS6_UKSK_MASK (0x4000U) -#define S50_ELS_KS6_KS6_UKSK_SHIFT (14U) -#define S50_ELS_KS6_KS6_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UKSK_SHIFT)) & S50_ELS_KS6_KS6_UKSK_MASK) - -#define S50_ELS_KS6_KS6_URTF_MASK (0x8000U) -#define S50_ELS_KS6_KS6_URTF_SHIFT (15U) -#define S50_ELS_KS6_KS6_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_URTF_SHIFT)) & S50_ELS_KS6_KS6_URTF_MASK) - -#define S50_ELS_KS6_KS6_UCKDF_MASK (0x10000U) -#define S50_ELS_KS6_KS6_UCKDF_SHIFT (16U) -#define S50_ELS_KS6_KS6_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UCKDF_SHIFT)) & S50_ELS_KS6_KS6_UCKDF_MASK) - -#define S50_ELS_KS6_KS6_UHKDF_MASK (0x20000U) -#define S50_ELS_KS6_KS6_UHKDF_SHIFT (17U) -#define S50_ELS_KS6_KS6_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UHKDF_SHIFT)) & S50_ELS_KS6_KS6_UHKDF_MASK) - -#define S50_ELS_KS6_KS6_UECSG_MASK (0x40000U) -#define S50_ELS_KS6_KS6_UECSG_SHIFT (18U) -#define S50_ELS_KS6_KS6_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UECSG_SHIFT)) & S50_ELS_KS6_KS6_UECSG_MASK) - -#define S50_ELS_KS6_KS6_UECDH_MASK (0x80000U) -#define S50_ELS_KS6_KS6_UECDH_SHIFT (19U) -#define S50_ELS_KS6_KS6_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UECDH_SHIFT)) & S50_ELS_KS6_KS6_UECDH_MASK) - -#define S50_ELS_KS6_KS6_UAES_MASK (0x100000U) -#define S50_ELS_KS6_KS6_UAES_SHIFT (20U) -#define S50_ELS_KS6_KS6_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UAES_SHIFT)) & S50_ELS_KS6_KS6_UAES_MASK) - -#define S50_ELS_KS6_KS6_UHMAC_MASK (0x200000U) -#define S50_ELS_KS6_KS6_UHMAC_SHIFT (21U) -#define S50_ELS_KS6_KS6_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UHMAC_SHIFT)) & S50_ELS_KS6_KS6_UHMAC_MASK) - -#define S50_ELS_KS6_KS6_UKWK_MASK (0x400000U) -#define S50_ELS_KS6_KS6_UKWK_SHIFT (22U) -#define S50_ELS_KS6_KS6_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UKWK_SHIFT)) & S50_ELS_KS6_KS6_UKWK_MASK) - -#define S50_ELS_KS6_KS6_UKUOK_MASK (0x800000U) -#define S50_ELS_KS6_KS6_UKUOK_SHIFT (23U) -#define S50_ELS_KS6_KS6_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UKUOK_SHIFT)) & S50_ELS_KS6_KS6_UKUOK_MASK) - -#define S50_ELS_KS6_KS6_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS6_KS6_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS6_KS6_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UTLSPMS_SHIFT)) & S50_ELS_KS6_KS6_UTLSPMS_MASK) - -#define S50_ELS_KS6_KS6_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS6_KS6_UTLSMS_SHIFT (25U) -#define S50_ELS_KS6_KS6_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UTLSMS_SHIFT)) & S50_ELS_KS6_KS6_UTLSMS_MASK) - -#define S50_ELS_KS6_KS6_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS6_KS6_UKGSRC_SHIFT (26U) -#define S50_ELS_KS6_KS6_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UKGSRC_SHIFT)) & S50_ELS_KS6_KS6_UKGSRC_MASK) - -#define S50_ELS_KS6_KS6_UHWO_MASK (0x8000000U) -#define S50_ELS_KS6_KS6_UHWO_SHIFT (27U) -#define S50_ELS_KS6_KS6_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UHWO_SHIFT)) & S50_ELS_KS6_KS6_UHWO_MASK) - -#define S50_ELS_KS6_KS6_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS6_KS6_UWRPOK_SHIFT (28U) -#define S50_ELS_KS6_KS6_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UWRPOK_SHIFT)) & S50_ELS_KS6_KS6_UWRPOK_MASK) - -#define S50_ELS_KS6_KS6_UDUK_MASK (0x20000000U) -#define S50_ELS_KS6_KS6_UDUK_SHIFT (29U) -#define S50_ELS_KS6_KS6_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UDUK_SHIFT)) & S50_ELS_KS6_KS6_UDUK_MASK) - -#define S50_ELS_KS6_KS6_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS6_KS6_UPPROT_SHIFT (30U) -#define S50_ELS_KS6_KS6_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UPPROT_SHIFT)) & S50_ELS_KS6_KS6_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS7 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS7_KS7_KSIZE_MASK (0x3U) -#define S50_ELS_KS7_KS7_KSIZE_SHIFT (0U) -/*! KS7_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS7_KS7_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_KSIZE_SHIFT)) & S50_ELS_KS7_KS7_KSIZE_MASK) - -#define S50_ELS_KS7_KS7_KACT_MASK (0x20U) -#define S50_ELS_KS7_KS7_KACT_SHIFT (5U) -#define S50_ELS_KS7_KS7_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_KACT_SHIFT)) & S50_ELS_KS7_KS7_KACT_MASK) - -#define S50_ELS_KS7_KS7_KBASE_MASK (0x40U) -#define S50_ELS_KS7_KS7_KBASE_SHIFT (6U) -#define S50_ELS_KS7_KS7_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_KBASE_SHIFT)) & S50_ELS_KS7_KS7_KBASE_MASK) - -#define S50_ELS_KS7_KS7_FGP_MASK (0x80U) -#define S50_ELS_KS7_KS7_FGP_SHIFT (7U) -#define S50_ELS_KS7_KS7_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_FGP_SHIFT)) & S50_ELS_KS7_KS7_FGP_MASK) - -#define S50_ELS_KS7_KS7_FRTN_MASK (0x100U) -#define S50_ELS_KS7_KS7_FRTN_SHIFT (8U) -#define S50_ELS_KS7_KS7_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_FRTN_SHIFT)) & S50_ELS_KS7_KS7_FRTN_MASK) - -#define S50_ELS_KS7_KS7_FHWO_MASK (0x200U) -#define S50_ELS_KS7_KS7_FHWO_SHIFT (9U) -#define S50_ELS_KS7_KS7_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_FHWO_SHIFT)) & S50_ELS_KS7_KS7_FHWO_MASK) - -#define S50_ELS_KS7_KS7_UKPUK_MASK (0x800U) -#define S50_ELS_KS7_KS7_UKPUK_SHIFT (11U) -#define S50_ELS_KS7_KS7_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UKPUK_SHIFT)) & S50_ELS_KS7_KS7_UKPUK_MASK) - -#define S50_ELS_KS7_KS7_UTECDH_MASK (0x1000U) -#define S50_ELS_KS7_KS7_UTECDH_SHIFT (12U) -#define S50_ELS_KS7_KS7_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UTECDH_SHIFT)) & S50_ELS_KS7_KS7_UTECDH_MASK) - -#define S50_ELS_KS7_KS7_UCMAC_MASK (0x2000U) -#define S50_ELS_KS7_KS7_UCMAC_SHIFT (13U) -#define S50_ELS_KS7_KS7_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UCMAC_SHIFT)) & S50_ELS_KS7_KS7_UCMAC_MASK) - -#define S50_ELS_KS7_KS7_UKSK_MASK (0x4000U) -#define S50_ELS_KS7_KS7_UKSK_SHIFT (14U) -#define S50_ELS_KS7_KS7_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UKSK_SHIFT)) & S50_ELS_KS7_KS7_UKSK_MASK) - -#define S50_ELS_KS7_KS7_URTF_MASK (0x8000U) -#define S50_ELS_KS7_KS7_URTF_SHIFT (15U) -#define S50_ELS_KS7_KS7_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_URTF_SHIFT)) & S50_ELS_KS7_KS7_URTF_MASK) - -#define S50_ELS_KS7_KS7_UCKDF_MASK (0x10000U) -#define S50_ELS_KS7_KS7_UCKDF_SHIFT (16U) -#define S50_ELS_KS7_KS7_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UCKDF_SHIFT)) & S50_ELS_KS7_KS7_UCKDF_MASK) - -#define S50_ELS_KS7_KS7_UHKDF_MASK (0x20000U) -#define S50_ELS_KS7_KS7_UHKDF_SHIFT (17U) -#define S50_ELS_KS7_KS7_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UHKDF_SHIFT)) & S50_ELS_KS7_KS7_UHKDF_MASK) - -#define S50_ELS_KS7_KS7_UECSG_MASK (0x40000U) -#define S50_ELS_KS7_KS7_UECSG_SHIFT (18U) -#define S50_ELS_KS7_KS7_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UECSG_SHIFT)) & S50_ELS_KS7_KS7_UECSG_MASK) - -#define S50_ELS_KS7_KS7_UECDH_MASK (0x80000U) -#define S50_ELS_KS7_KS7_UECDH_SHIFT (19U) -#define S50_ELS_KS7_KS7_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UECDH_SHIFT)) & S50_ELS_KS7_KS7_UECDH_MASK) - -#define S50_ELS_KS7_KS7_UAES_MASK (0x100000U) -#define S50_ELS_KS7_KS7_UAES_SHIFT (20U) -#define S50_ELS_KS7_KS7_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UAES_SHIFT)) & S50_ELS_KS7_KS7_UAES_MASK) - -#define S50_ELS_KS7_KS7_UHMAC_MASK (0x200000U) -#define S50_ELS_KS7_KS7_UHMAC_SHIFT (21U) -#define S50_ELS_KS7_KS7_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UHMAC_SHIFT)) & S50_ELS_KS7_KS7_UHMAC_MASK) - -#define S50_ELS_KS7_KS7_UKWK_MASK (0x400000U) -#define S50_ELS_KS7_KS7_UKWK_SHIFT (22U) -#define S50_ELS_KS7_KS7_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UKWK_SHIFT)) & S50_ELS_KS7_KS7_UKWK_MASK) - -#define S50_ELS_KS7_KS7_UKUOK_MASK (0x800000U) -#define S50_ELS_KS7_KS7_UKUOK_SHIFT (23U) -#define S50_ELS_KS7_KS7_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UKUOK_SHIFT)) & S50_ELS_KS7_KS7_UKUOK_MASK) - -#define S50_ELS_KS7_KS7_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS7_KS7_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS7_KS7_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UTLSPMS_SHIFT)) & S50_ELS_KS7_KS7_UTLSPMS_MASK) - -#define S50_ELS_KS7_KS7_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS7_KS7_UTLSMS_SHIFT (25U) -#define S50_ELS_KS7_KS7_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UTLSMS_SHIFT)) & S50_ELS_KS7_KS7_UTLSMS_MASK) - -#define S50_ELS_KS7_KS7_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS7_KS7_UKGSRC_SHIFT (26U) -#define S50_ELS_KS7_KS7_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UKGSRC_SHIFT)) & S50_ELS_KS7_KS7_UKGSRC_MASK) - -#define S50_ELS_KS7_KS7_UHWO_MASK (0x8000000U) -#define S50_ELS_KS7_KS7_UHWO_SHIFT (27U) -#define S50_ELS_KS7_KS7_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UHWO_SHIFT)) & S50_ELS_KS7_KS7_UHWO_MASK) - -#define S50_ELS_KS7_KS7_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS7_KS7_UWRPOK_SHIFT (28U) -#define S50_ELS_KS7_KS7_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UWRPOK_SHIFT)) & S50_ELS_KS7_KS7_UWRPOK_MASK) - -#define S50_ELS_KS7_KS7_UDUK_MASK (0x20000000U) -#define S50_ELS_KS7_KS7_UDUK_SHIFT (29U) -#define S50_ELS_KS7_KS7_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UDUK_SHIFT)) & S50_ELS_KS7_KS7_UDUK_MASK) - -#define S50_ELS_KS7_KS7_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS7_KS7_UPPROT_SHIFT (30U) -#define S50_ELS_KS7_KS7_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UPPROT_SHIFT)) & S50_ELS_KS7_KS7_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS8 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS8_KS8_KSIZE_MASK (0x3U) -#define S50_ELS_KS8_KS8_KSIZE_SHIFT (0U) -/*! KS8_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS8_KS8_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_KSIZE_SHIFT)) & S50_ELS_KS8_KS8_KSIZE_MASK) - -#define S50_ELS_KS8_KS8_KACT_MASK (0x20U) -#define S50_ELS_KS8_KS8_KACT_SHIFT (5U) -#define S50_ELS_KS8_KS8_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_KACT_SHIFT)) & S50_ELS_KS8_KS8_KACT_MASK) - -#define S50_ELS_KS8_KS8_KBASE_MASK (0x40U) -#define S50_ELS_KS8_KS8_KBASE_SHIFT (6U) -#define S50_ELS_KS8_KS8_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_KBASE_SHIFT)) & S50_ELS_KS8_KS8_KBASE_MASK) - -#define S50_ELS_KS8_KS8_FGP_MASK (0x80U) -#define S50_ELS_KS8_KS8_FGP_SHIFT (7U) -#define S50_ELS_KS8_KS8_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_FGP_SHIFT)) & S50_ELS_KS8_KS8_FGP_MASK) - -#define S50_ELS_KS8_KS8_FRTN_MASK (0x100U) -#define S50_ELS_KS8_KS8_FRTN_SHIFT (8U) -#define S50_ELS_KS8_KS8_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_FRTN_SHIFT)) & S50_ELS_KS8_KS8_FRTN_MASK) - -#define S50_ELS_KS8_KS8_FHWO_MASK (0x200U) -#define S50_ELS_KS8_KS8_FHWO_SHIFT (9U) -#define S50_ELS_KS8_KS8_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_FHWO_SHIFT)) & S50_ELS_KS8_KS8_FHWO_MASK) - -#define S50_ELS_KS8_KS8_UKPUK_MASK (0x800U) -#define S50_ELS_KS8_KS8_UKPUK_SHIFT (11U) -#define S50_ELS_KS8_KS8_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UKPUK_SHIFT)) & S50_ELS_KS8_KS8_UKPUK_MASK) - -#define S50_ELS_KS8_KS8_UTECDH_MASK (0x1000U) -#define S50_ELS_KS8_KS8_UTECDH_SHIFT (12U) -#define S50_ELS_KS8_KS8_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UTECDH_SHIFT)) & S50_ELS_KS8_KS8_UTECDH_MASK) - -#define S50_ELS_KS8_KS8_UCMAC_MASK (0x2000U) -#define S50_ELS_KS8_KS8_UCMAC_SHIFT (13U) -#define S50_ELS_KS8_KS8_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UCMAC_SHIFT)) & S50_ELS_KS8_KS8_UCMAC_MASK) - -#define S50_ELS_KS8_KS8_UKSK_MASK (0x4000U) -#define S50_ELS_KS8_KS8_UKSK_SHIFT (14U) -#define S50_ELS_KS8_KS8_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UKSK_SHIFT)) & S50_ELS_KS8_KS8_UKSK_MASK) - -#define S50_ELS_KS8_KS8_URTF_MASK (0x8000U) -#define S50_ELS_KS8_KS8_URTF_SHIFT (15U) -#define S50_ELS_KS8_KS8_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_URTF_SHIFT)) & S50_ELS_KS8_KS8_URTF_MASK) - -#define S50_ELS_KS8_KS8_UCKDF_MASK (0x10000U) -#define S50_ELS_KS8_KS8_UCKDF_SHIFT (16U) -#define S50_ELS_KS8_KS8_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UCKDF_SHIFT)) & S50_ELS_KS8_KS8_UCKDF_MASK) - -#define S50_ELS_KS8_KS8_UHKDF_MASK (0x20000U) -#define S50_ELS_KS8_KS8_UHKDF_SHIFT (17U) -#define S50_ELS_KS8_KS8_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UHKDF_SHIFT)) & S50_ELS_KS8_KS8_UHKDF_MASK) - -#define S50_ELS_KS8_KS8_UECSG_MASK (0x40000U) -#define S50_ELS_KS8_KS8_UECSG_SHIFT (18U) -#define S50_ELS_KS8_KS8_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UECSG_SHIFT)) & S50_ELS_KS8_KS8_UECSG_MASK) - -#define S50_ELS_KS8_KS8_UECDH_MASK (0x80000U) -#define S50_ELS_KS8_KS8_UECDH_SHIFT (19U) -#define S50_ELS_KS8_KS8_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UECDH_SHIFT)) & S50_ELS_KS8_KS8_UECDH_MASK) - -#define S50_ELS_KS8_KS8_UAES_MASK (0x100000U) -#define S50_ELS_KS8_KS8_UAES_SHIFT (20U) -#define S50_ELS_KS8_KS8_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UAES_SHIFT)) & S50_ELS_KS8_KS8_UAES_MASK) - -#define S50_ELS_KS8_KS8_UHMAC_MASK (0x200000U) -#define S50_ELS_KS8_KS8_UHMAC_SHIFT (21U) -#define S50_ELS_KS8_KS8_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UHMAC_SHIFT)) & S50_ELS_KS8_KS8_UHMAC_MASK) - -#define S50_ELS_KS8_KS8_UKWK_MASK (0x400000U) -#define S50_ELS_KS8_KS8_UKWK_SHIFT (22U) -#define S50_ELS_KS8_KS8_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UKWK_SHIFT)) & S50_ELS_KS8_KS8_UKWK_MASK) - -#define S50_ELS_KS8_KS8_UKUOK_MASK (0x800000U) -#define S50_ELS_KS8_KS8_UKUOK_SHIFT (23U) -#define S50_ELS_KS8_KS8_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UKUOK_SHIFT)) & S50_ELS_KS8_KS8_UKUOK_MASK) - -#define S50_ELS_KS8_KS8_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS8_KS8_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS8_KS8_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UTLSPMS_SHIFT)) & S50_ELS_KS8_KS8_UTLSPMS_MASK) - -#define S50_ELS_KS8_KS8_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS8_KS8_UTLSMS_SHIFT (25U) -#define S50_ELS_KS8_KS8_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UTLSMS_SHIFT)) & S50_ELS_KS8_KS8_UTLSMS_MASK) - -#define S50_ELS_KS8_KS8_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS8_KS8_UKGSRC_SHIFT (26U) -#define S50_ELS_KS8_KS8_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UKGSRC_SHIFT)) & S50_ELS_KS8_KS8_UKGSRC_MASK) - -#define S50_ELS_KS8_KS8_UHWO_MASK (0x8000000U) -#define S50_ELS_KS8_KS8_UHWO_SHIFT (27U) -#define S50_ELS_KS8_KS8_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UHWO_SHIFT)) & S50_ELS_KS8_KS8_UHWO_MASK) - -#define S50_ELS_KS8_KS8_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS8_KS8_UWRPOK_SHIFT (28U) -#define S50_ELS_KS8_KS8_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UWRPOK_SHIFT)) & S50_ELS_KS8_KS8_UWRPOK_MASK) - -#define S50_ELS_KS8_KS8_UDUK_MASK (0x20000000U) -#define S50_ELS_KS8_KS8_UDUK_SHIFT (29U) -#define S50_ELS_KS8_KS8_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UDUK_SHIFT)) & S50_ELS_KS8_KS8_UDUK_MASK) - -#define S50_ELS_KS8_KS8_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS8_KS8_UPPROT_SHIFT (30U) -#define S50_ELS_KS8_KS8_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UPPROT_SHIFT)) & S50_ELS_KS8_KS8_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS9 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS9_KS9_KSIZE_MASK (0x3U) -#define S50_ELS_KS9_KS9_KSIZE_SHIFT (0U) -/*! KS9_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS9_KS9_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_KSIZE_SHIFT)) & S50_ELS_KS9_KS9_KSIZE_MASK) - -#define S50_ELS_KS9_KS9_KACT_MASK (0x20U) -#define S50_ELS_KS9_KS9_KACT_SHIFT (5U) -#define S50_ELS_KS9_KS9_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_KACT_SHIFT)) & S50_ELS_KS9_KS9_KACT_MASK) - -#define S50_ELS_KS9_KS9_KBASE_MASK (0x40U) -#define S50_ELS_KS9_KS9_KBASE_SHIFT (6U) -#define S50_ELS_KS9_KS9_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_KBASE_SHIFT)) & S50_ELS_KS9_KS9_KBASE_MASK) - -#define S50_ELS_KS9_KS9_FGP_MASK (0x80U) -#define S50_ELS_KS9_KS9_FGP_SHIFT (7U) -#define S50_ELS_KS9_KS9_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_FGP_SHIFT)) & S50_ELS_KS9_KS9_FGP_MASK) - -#define S50_ELS_KS9_KS9_FRTN_MASK (0x100U) -#define S50_ELS_KS9_KS9_FRTN_SHIFT (8U) -#define S50_ELS_KS9_KS9_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_FRTN_SHIFT)) & S50_ELS_KS9_KS9_FRTN_MASK) - -#define S50_ELS_KS9_KS9_FHWO_MASK (0x200U) -#define S50_ELS_KS9_KS9_FHWO_SHIFT (9U) -#define S50_ELS_KS9_KS9_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_FHWO_SHIFT)) & S50_ELS_KS9_KS9_FHWO_MASK) - -#define S50_ELS_KS9_KS9_UKPUK_MASK (0x800U) -#define S50_ELS_KS9_KS9_UKPUK_SHIFT (11U) -#define S50_ELS_KS9_KS9_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UKPUK_SHIFT)) & S50_ELS_KS9_KS9_UKPUK_MASK) - -#define S50_ELS_KS9_KS9_UTECDH_MASK (0x1000U) -#define S50_ELS_KS9_KS9_UTECDH_SHIFT (12U) -#define S50_ELS_KS9_KS9_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UTECDH_SHIFT)) & S50_ELS_KS9_KS9_UTECDH_MASK) - -#define S50_ELS_KS9_KS9_UCMAC_MASK (0x2000U) -#define S50_ELS_KS9_KS9_UCMAC_SHIFT (13U) -#define S50_ELS_KS9_KS9_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UCMAC_SHIFT)) & S50_ELS_KS9_KS9_UCMAC_MASK) - -#define S50_ELS_KS9_KS9_UKSK_MASK (0x4000U) -#define S50_ELS_KS9_KS9_UKSK_SHIFT (14U) -#define S50_ELS_KS9_KS9_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UKSK_SHIFT)) & S50_ELS_KS9_KS9_UKSK_MASK) - -#define S50_ELS_KS9_KS9_URTF_MASK (0x8000U) -#define S50_ELS_KS9_KS9_URTF_SHIFT (15U) -#define S50_ELS_KS9_KS9_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_URTF_SHIFT)) & S50_ELS_KS9_KS9_URTF_MASK) - -#define S50_ELS_KS9_KS9_UCKDF_MASK (0x10000U) -#define S50_ELS_KS9_KS9_UCKDF_SHIFT (16U) -#define S50_ELS_KS9_KS9_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UCKDF_SHIFT)) & S50_ELS_KS9_KS9_UCKDF_MASK) - -#define S50_ELS_KS9_KS9_UHKDF_MASK (0x20000U) -#define S50_ELS_KS9_KS9_UHKDF_SHIFT (17U) -#define S50_ELS_KS9_KS9_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UHKDF_SHIFT)) & S50_ELS_KS9_KS9_UHKDF_MASK) - -#define S50_ELS_KS9_KS9_UECSG_MASK (0x40000U) -#define S50_ELS_KS9_KS9_UECSG_SHIFT (18U) -#define S50_ELS_KS9_KS9_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UECSG_SHIFT)) & S50_ELS_KS9_KS9_UECSG_MASK) - -#define S50_ELS_KS9_KS9_UECDH_MASK (0x80000U) -#define S50_ELS_KS9_KS9_UECDH_SHIFT (19U) -#define S50_ELS_KS9_KS9_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UECDH_SHIFT)) & S50_ELS_KS9_KS9_UECDH_MASK) - -#define S50_ELS_KS9_KS9_UAES_MASK (0x100000U) -#define S50_ELS_KS9_KS9_UAES_SHIFT (20U) -#define S50_ELS_KS9_KS9_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UAES_SHIFT)) & S50_ELS_KS9_KS9_UAES_MASK) - -#define S50_ELS_KS9_KS9_UHMAC_MASK (0x200000U) -#define S50_ELS_KS9_KS9_UHMAC_SHIFT (21U) -#define S50_ELS_KS9_KS9_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UHMAC_SHIFT)) & S50_ELS_KS9_KS9_UHMAC_MASK) - -#define S50_ELS_KS9_KS9_UKWK_MASK (0x400000U) -#define S50_ELS_KS9_KS9_UKWK_SHIFT (22U) -#define S50_ELS_KS9_KS9_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UKWK_SHIFT)) & S50_ELS_KS9_KS9_UKWK_MASK) - -#define S50_ELS_KS9_KS9_UKUOK_MASK (0x800000U) -#define S50_ELS_KS9_KS9_UKUOK_SHIFT (23U) -#define S50_ELS_KS9_KS9_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UKUOK_SHIFT)) & S50_ELS_KS9_KS9_UKUOK_MASK) - -#define S50_ELS_KS9_KS9_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS9_KS9_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS9_KS9_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UTLSPMS_SHIFT)) & S50_ELS_KS9_KS9_UTLSPMS_MASK) - -#define S50_ELS_KS9_KS9_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS9_KS9_UTLSMS_SHIFT (25U) -#define S50_ELS_KS9_KS9_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UTLSMS_SHIFT)) & S50_ELS_KS9_KS9_UTLSMS_MASK) - -#define S50_ELS_KS9_KS9_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS9_KS9_UKGSRC_SHIFT (26U) -#define S50_ELS_KS9_KS9_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UKGSRC_SHIFT)) & S50_ELS_KS9_KS9_UKGSRC_MASK) - -#define S50_ELS_KS9_KS9_UHWO_MASK (0x8000000U) -#define S50_ELS_KS9_KS9_UHWO_SHIFT (27U) -#define S50_ELS_KS9_KS9_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UHWO_SHIFT)) & S50_ELS_KS9_KS9_UHWO_MASK) - -#define S50_ELS_KS9_KS9_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS9_KS9_UWRPOK_SHIFT (28U) -#define S50_ELS_KS9_KS9_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UWRPOK_SHIFT)) & S50_ELS_KS9_KS9_UWRPOK_MASK) - -#define S50_ELS_KS9_KS9_UDUK_MASK (0x20000000U) -#define S50_ELS_KS9_KS9_UDUK_SHIFT (29U) -#define S50_ELS_KS9_KS9_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UDUK_SHIFT)) & S50_ELS_KS9_KS9_UDUK_MASK) - -#define S50_ELS_KS9_KS9_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS9_KS9_UPPROT_SHIFT (30U) -#define S50_ELS_KS9_KS9_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UPPROT_SHIFT)) & S50_ELS_KS9_KS9_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS10 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS10_KS10_KSIZE_MASK (0x3U) -#define S50_ELS_KS10_KS10_KSIZE_SHIFT (0U) -/*! KS10_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS10_KS10_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_KSIZE_SHIFT)) & S50_ELS_KS10_KS10_KSIZE_MASK) - -#define S50_ELS_KS10_KS10_KACT_MASK (0x20U) -#define S50_ELS_KS10_KS10_KACT_SHIFT (5U) -#define S50_ELS_KS10_KS10_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_KACT_SHIFT)) & S50_ELS_KS10_KS10_KACT_MASK) - -#define S50_ELS_KS10_KS10_KBASE_MASK (0x40U) -#define S50_ELS_KS10_KS10_KBASE_SHIFT (6U) -#define S50_ELS_KS10_KS10_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_KBASE_SHIFT)) & S50_ELS_KS10_KS10_KBASE_MASK) - -#define S50_ELS_KS10_KS10_FGP_MASK (0x80U) -#define S50_ELS_KS10_KS10_FGP_SHIFT (7U) -#define S50_ELS_KS10_KS10_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_FGP_SHIFT)) & S50_ELS_KS10_KS10_FGP_MASK) - -#define S50_ELS_KS10_KS10_FRTN_MASK (0x100U) -#define S50_ELS_KS10_KS10_FRTN_SHIFT (8U) -#define S50_ELS_KS10_KS10_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_FRTN_SHIFT)) & S50_ELS_KS10_KS10_FRTN_MASK) - -#define S50_ELS_KS10_KS10_FHWO_MASK (0x200U) -#define S50_ELS_KS10_KS10_FHWO_SHIFT (9U) -#define S50_ELS_KS10_KS10_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_FHWO_SHIFT)) & S50_ELS_KS10_KS10_FHWO_MASK) - -#define S50_ELS_KS10_KS10_UKPUK_MASK (0x800U) -#define S50_ELS_KS10_KS10_UKPUK_SHIFT (11U) -#define S50_ELS_KS10_KS10_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UKPUK_SHIFT)) & S50_ELS_KS10_KS10_UKPUK_MASK) - -#define S50_ELS_KS10_KS10_UTECDH_MASK (0x1000U) -#define S50_ELS_KS10_KS10_UTECDH_SHIFT (12U) -#define S50_ELS_KS10_KS10_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UTECDH_SHIFT)) & S50_ELS_KS10_KS10_UTECDH_MASK) - -#define S50_ELS_KS10_KS10_UCMAC_MASK (0x2000U) -#define S50_ELS_KS10_KS10_UCMAC_SHIFT (13U) -#define S50_ELS_KS10_KS10_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UCMAC_SHIFT)) & S50_ELS_KS10_KS10_UCMAC_MASK) - -#define S50_ELS_KS10_KS10_UKSK_MASK (0x4000U) -#define S50_ELS_KS10_KS10_UKSK_SHIFT (14U) -#define S50_ELS_KS10_KS10_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UKSK_SHIFT)) & S50_ELS_KS10_KS10_UKSK_MASK) - -#define S50_ELS_KS10_KS10_URTF_MASK (0x8000U) -#define S50_ELS_KS10_KS10_URTF_SHIFT (15U) -#define S50_ELS_KS10_KS10_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_URTF_SHIFT)) & S50_ELS_KS10_KS10_URTF_MASK) - -#define S50_ELS_KS10_KS10_UCKDF_MASK (0x10000U) -#define S50_ELS_KS10_KS10_UCKDF_SHIFT (16U) -#define S50_ELS_KS10_KS10_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UCKDF_SHIFT)) & S50_ELS_KS10_KS10_UCKDF_MASK) - -#define S50_ELS_KS10_KS10_UHKDF_MASK (0x20000U) -#define S50_ELS_KS10_KS10_UHKDF_SHIFT (17U) -#define S50_ELS_KS10_KS10_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UHKDF_SHIFT)) & S50_ELS_KS10_KS10_UHKDF_MASK) - -#define S50_ELS_KS10_KS10_UECSG_MASK (0x40000U) -#define S50_ELS_KS10_KS10_UECSG_SHIFT (18U) -#define S50_ELS_KS10_KS10_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UECSG_SHIFT)) & S50_ELS_KS10_KS10_UECSG_MASK) - -#define S50_ELS_KS10_KS10_UECDH_MASK (0x80000U) -#define S50_ELS_KS10_KS10_UECDH_SHIFT (19U) -#define S50_ELS_KS10_KS10_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UECDH_SHIFT)) & S50_ELS_KS10_KS10_UECDH_MASK) - -#define S50_ELS_KS10_KS10_UAES_MASK (0x100000U) -#define S50_ELS_KS10_KS10_UAES_SHIFT (20U) -#define S50_ELS_KS10_KS10_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UAES_SHIFT)) & S50_ELS_KS10_KS10_UAES_MASK) - -#define S50_ELS_KS10_KS10_UHMAC_MASK (0x200000U) -#define S50_ELS_KS10_KS10_UHMAC_SHIFT (21U) -#define S50_ELS_KS10_KS10_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UHMAC_SHIFT)) & S50_ELS_KS10_KS10_UHMAC_MASK) - -#define S50_ELS_KS10_KS10_UKWK_MASK (0x400000U) -#define S50_ELS_KS10_KS10_UKWK_SHIFT (22U) -#define S50_ELS_KS10_KS10_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UKWK_SHIFT)) & S50_ELS_KS10_KS10_UKWK_MASK) - -#define S50_ELS_KS10_KS10_UKUOK_MASK (0x800000U) -#define S50_ELS_KS10_KS10_UKUOK_SHIFT (23U) -#define S50_ELS_KS10_KS10_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UKUOK_SHIFT)) & S50_ELS_KS10_KS10_UKUOK_MASK) - -#define S50_ELS_KS10_KS10_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS10_KS10_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS10_KS10_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UTLSPMS_SHIFT)) & S50_ELS_KS10_KS10_UTLSPMS_MASK) - -#define S50_ELS_KS10_KS10_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS10_KS10_UTLSMS_SHIFT (25U) -#define S50_ELS_KS10_KS10_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UTLSMS_SHIFT)) & S50_ELS_KS10_KS10_UTLSMS_MASK) - -#define S50_ELS_KS10_KS10_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS10_KS10_UKGSRC_SHIFT (26U) -#define S50_ELS_KS10_KS10_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UKGSRC_SHIFT)) & S50_ELS_KS10_KS10_UKGSRC_MASK) - -#define S50_ELS_KS10_KS10_UHWO_MASK (0x8000000U) -#define S50_ELS_KS10_KS10_UHWO_SHIFT (27U) -#define S50_ELS_KS10_KS10_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UHWO_SHIFT)) & S50_ELS_KS10_KS10_UHWO_MASK) - -#define S50_ELS_KS10_KS10_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS10_KS10_UWRPOK_SHIFT (28U) -#define S50_ELS_KS10_KS10_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UWRPOK_SHIFT)) & S50_ELS_KS10_KS10_UWRPOK_MASK) - -#define S50_ELS_KS10_KS10_UDUK_MASK (0x20000000U) -#define S50_ELS_KS10_KS10_UDUK_SHIFT (29U) -#define S50_ELS_KS10_KS10_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UDUK_SHIFT)) & S50_ELS_KS10_KS10_UDUK_MASK) - -#define S50_ELS_KS10_KS10_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS10_KS10_UPPROT_SHIFT (30U) -#define S50_ELS_KS10_KS10_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UPPROT_SHIFT)) & S50_ELS_KS10_KS10_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS11 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS11_KS11_KSIZE_MASK (0x3U) -#define S50_ELS_KS11_KS11_KSIZE_SHIFT (0U) -/*! KS11_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS11_KS11_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_KSIZE_SHIFT)) & S50_ELS_KS11_KS11_KSIZE_MASK) - -#define S50_ELS_KS11_KS11_KACT_MASK (0x20U) -#define S50_ELS_KS11_KS11_KACT_SHIFT (5U) -#define S50_ELS_KS11_KS11_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_KACT_SHIFT)) & S50_ELS_KS11_KS11_KACT_MASK) - -#define S50_ELS_KS11_KS11_KBASE_MASK (0x40U) -#define S50_ELS_KS11_KS11_KBASE_SHIFT (6U) -#define S50_ELS_KS11_KS11_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_KBASE_SHIFT)) & S50_ELS_KS11_KS11_KBASE_MASK) - -#define S50_ELS_KS11_KS11_FGP_MASK (0x80U) -#define S50_ELS_KS11_KS11_FGP_SHIFT (7U) -#define S50_ELS_KS11_KS11_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_FGP_SHIFT)) & S50_ELS_KS11_KS11_FGP_MASK) - -#define S50_ELS_KS11_KS11_FRTN_MASK (0x100U) -#define S50_ELS_KS11_KS11_FRTN_SHIFT (8U) -#define S50_ELS_KS11_KS11_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_FRTN_SHIFT)) & S50_ELS_KS11_KS11_FRTN_MASK) - -#define S50_ELS_KS11_KS11_FHWO_MASK (0x200U) -#define S50_ELS_KS11_KS11_FHWO_SHIFT (9U) -#define S50_ELS_KS11_KS11_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_FHWO_SHIFT)) & S50_ELS_KS11_KS11_FHWO_MASK) - -#define S50_ELS_KS11_KS11_UKPUK_MASK (0x800U) -#define S50_ELS_KS11_KS11_UKPUK_SHIFT (11U) -#define S50_ELS_KS11_KS11_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UKPUK_SHIFT)) & S50_ELS_KS11_KS11_UKPUK_MASK) - -#define S50_ELS_KS11_KS11_UTECDH_MASK (0x1000U) -#define S50_ELS_KS11_KS11_UTECDH_SHIFT (12U) -#define S50_ELS_KS11_KS11_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UTECDH_SHIFT)) & S50_ELS_KS11_KS11_UTECDH_MASK) - -#define S50_ELS_KS11_KS11_UCMAC_MASK (0x2000U) -#define S50_ELS_KS11_KS11_UCMAC_SHIFT (13U) -#define S50_ELS_KS11_KS11_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UCMAC_SHIFT)) & S50_ELS_KS11_KS11_UCMAC_MASK) - -#define S50_ELS_KS11_KS11_UKSK_MASK (0x4000U) -#define S50_ELS_KS11_KS11_UKSK_SHIFT (14U) -#define S50_ELS_KS11_KS11_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UKSK_SHIFT)) & S50_ELS_KS11_KS11_UKSK_MASK) - -#define S50_ELS_KS11_KS11_URTF_MASK (0x8000U) -#define S50_ELS_KS11_KS11_URTF_SHIFT (15U) -#define S50_ELS_KS11_KS11_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_URTF_SHIFT)) & S50_ELS_KS11_KS11_URTF_MASK) - -#define S50_ELS_KS11_KS11_UCKDF_MASK (0x10000U) -#define S50_ELS_KS11_KS11_UCKDF_SHIFT (16U) -#define S50_ELS_KS11_KS11_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UCKDF_SHIFT)) & S50_ELS_KS11_KS11_UCKDF_MASK) - -#define S50_ELS_KS11_KS11_UHKDF_MASK (0x20000U) -#define S50_ELS_KS11_KS11_UHKDF_SHIFT (17U) -#define S50_ELS_KS11_KS11_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UHKDF_SHIFT)) & S50_ELS_KS11_KS11_UHKDF_MASK) - -#define S50_ELS_KS11_KS11_UECSG_MASK (0x40000U) -#define S50_ELS_KS11_KS11_UECSG_SHIFT (18U) -#define S50_ELS_KS11_KS11_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UECSG_SHIFT)) & S50_ELS_KS11_KS11_UECSG_MASK) - -#define S50_ELS_KS11_KS11_UECDH_MASK (0x80000U) -#define S50_ELS_KS11_KS11_UECDH_SHIFT (19U) -#define S50_ELS_KS11_KS11_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UECDH_SHIFT)) & S50_ELS_KS11_KS11_UECDH_MASK) - -#define S50_ELS_KS11_KS11_UAES_MASK (0x100000U) -#define S50_ELS_KS11_KS11_UAES_SHIFT (20U) -#define S50_ELS_KS11_KS11_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UAES_SHIFT)) & S50_ELS_KS11_KS11_UAES_MASK) - -#define S50_ELS_KS11_KS11_UHMAC_MASK (0x200000U) -#define S50_ELS_KS11_KS11_UHMAC_SHIFT (21U) -#define S50_ELS_KS11_KS11_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UHMAC_SHIFT)) & S50_ELS_KS11_KS11_UHMAC_MASK) - -#define S50_ELS_KS11_KS11_UKWK_MASK (0x400000U) -#define S50_ELS_KS11_KS11_UKWK_SHIFT (22U) -#define S50_ELS_KS11_KS11_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UKWK_SHIFT)) & S50_ELS_KS11_KS11_UKWK_MASK) - -#define S50_ELS_KS11_KS11_UKUOK_MASK (0x800000U) -#define S50_ELS_KS11_KS11_UKUOK_SHIFT (23U) -#define S50_ELS_KS11_KS11_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UKUOK_SHIFT)) & S50_ELS_KS11_KS11_UKUOK_MASK) - -#define S50_ELS_KS11_KS11_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS11_KS11_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS11_KS11_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UTLSPMS_SHIFT)) & S50_ELS_KS11_KS11_UTLSPMS_MASK) - -#define S50_ELS_KS11_KS11_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS11_KS11_UTLSMS_SHIFT (25U) -#define S50_ELS_KS11_KS11_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UTLSMS_SHIFT)) & S50_ELS_KS11_KS11_UTLSMS_MASK) - -#define S50_ELS_KS11_KS11_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS11_KS11_UKGSRC_SHIFT (26U) -#define S50_ELS_KS11_KS11_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UKGSRC_SHIFT)) & S50_ELS_KS11_KS11_UKGSRC_MASK) - -#define S50_ELS_KS11_KS11_UHWO_MASK (0x8000000U) -#define S50_ELS_KS11_KS11_UHWO_SHIFT (27U) -#define S50_ELS_KS11_KS11_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UHWO_SHIFT)) & S50_ELS_KS11_KS11_UHWO_MASK) - -#define S50_ELS_KS11_KS11_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS11_KS11_UWRPOK_SHIFT (28U) -#define S50_ELS_KS11_KS11_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UWRPOK_SHIFT)) & S50_ELS_KS11_KS11_UWRPOK_MASK) - -#define S50_ELS_KS11_KS11_UDUK_MASK (0x20000000U) -#define S50_ELS_KS11_KS11_UDUK_SHIFT (29U) -#define S50_ELS_KS11_KS11_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UDUK_SHIFT)) & S50_ELS_KS11_KS11_UDUK_MASK) - -#define S50_ELS_KS11_KS11_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS11_KS11_UPPROT_SHIFT (30U) -#define S50_ELS_KS11_KS11_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UPPROT_SHIFT)) & S50_ELS_KS11_KS11_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS12 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS12_KS12_KSIZE_MASK (0x3U) -#define S50_ELS_KS12_KS12_KSIZE_SHIFT (0U) -/*! KS12_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS12_KS12_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_KSIZE_SHIFT)) & S50_ELS_KS12_KS12_KSIZE_MASK) - -#define S50_ELS_KS12_KS12_KACT_MASK (0x20U) -#define S50_ELS_KS12_KS12_KACT_SHIFT (5U) -#define S50_ELS_KS12_KS12_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_KACT_SHIFT)) & S50_ELS_KS12_KS12_KACT_MASK) - -#define S50_ELS_KS12_KS12_KBASE_MASK (0x40U) -#define S50_ELS_KS12_KS12_KBASE_SHIFT (6U) -#define S50_ELS_KS12_KS12_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_KBASE_SHIFT)) & S50_ELS_KS12_KS12_KBASE_MASK) - -#define S50_ELS_KS12_KS12_FGP_MASK (0x80U) -#define S50_ELS_KS12_KS12_FGP_SHIFT (7U) -#define S50_ELS_KS12_KS12_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_FGP_SHIFT)) & S50_ELS_KS12_KS12_FGP_MASK) - -#define S50_ELS_KS12_KS12_FRTN_MASK (0x100U) -#define S50_ELS_KS12_KS12_FRTN_SHIFT (8U) -#define S50_ELS_KS12_KS12_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_FRTN_SHIFT)) & S50_ELS_KS12_KS12_FRTN_MASK) - -#define S50_ELS_KS12_KS12_FHWO_MASK (0x200U) -#define S50_ELS_KS12_KS12_FHWO_SHIFT (9U) -#define S50_ELS_KS12_KS12_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_FHWO_SHIFT)) & S50_ELS_KS12_KS12_FHWO_MASK) - -#define S50_ELS_KS12_KS12_UKPUK_MASK (0x800U) -#define S50_ELS_KS12_KS12_UKPUK_SHIFT (11U) -#define S50_ELS_KS12_KS12_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UKPUK_SHIFT)) & S50_ELS_KS12_KS12_UKPUK_MASK) - -#define S50_ELS_KS12_KS12_UTECDH_MASK (0x1000U) -#define S50_ELS_KS12_KS12_UTECDH_SHIFT (12U) -#define S50_ELS_KS12_KS12_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UTECDH_SHIFT)) & S50_ELS_KS12_KS12_UTECDH_MASK) - -#define S50_ELS_KS12_KS12_UCMAC_MASK (0x2000U) -#define S50_ELS_KS12_KS12_UCMAC_SHIFT (13U) -#define S50_ELS_KS12_KS12_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UCMAC_SHIFT)) & S50_ELS_KS12_KS12_UCMAC_MASK) - -#define S50_ELS_KS12_KS12_UKSK_MASK (0x4000U) -#define S50_ELS_KS12_KS12_UKSK_SHIFT (14U) -#define S50_ELS_KS12_KS12_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UKSK_SHIFT)) & S50_ELS_KS12_KS12_UKSK_MASK) - -#define S50_ELS_KS12_KS12_URTF_MASK (0x8000U) -#define S50_ELS_KS12_KS12_URTF_SHIFT (15U) -#define S50_ELS_KS12_KS12_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_URTF_SHIFT)) & S50_ELS_KS12_KS12_URTF_MASK) - -#define S50_ELS_KS12_KS12_UCKDF_MASK (0x10000U) -#define S50_ELS_KS12_KS12_UCKDF_SHIFT (16U) -#define S50_ELS_KS12_KS12_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UCKDF_SHIFT)) & S50_ELS_KS12_KS12_UCKDF_MASK) - -#define S50_ELS_KS12_KS12_UHKDF_MASK (0x20000U) -#define S50_ELS_KS12_KS12_UHKDF_SHIFT (17U) -#define S50_ELS_KS12_KS12_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UHKDF_SHIFT)) & S50_ELS_KS12_KS12_UHKDF_MASK) - -#define S50_ELS_KS12_KS12_UECSG_MASK (0x40000U) -#define S50_ELS_KS12_KS12_UECSG_SHIFT (18U) -#define S50_ELS_KS12_KS12_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UECSG_SHIFT)) & S50_ELS_KS12_KS12_UECSG_MASK) - -#define S50_ELS_KS12_KS12_UECDH_MASK (0x80000U) -#define S50_ELS_KS12_KS12_UECDH_SHIFT (19U) -#define S50_ELS_KS12_KS12_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UECDH_SHIFT)) & S50_ELS_KS12_KS12_UECDH_MASK) - -#define S50_ELS_KS12_KS12_UAES_MASK (0x100000U) -#define S50_ELS_KS12_KS12_UAES_SHIFT (20U) -#define S50_ELS_KS12_KS12_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UAES_SHIFT)) & S50_ELS_KS12_KS12_UAES_MASK) - -#define S50_ELS_KS12_KS12_UHMAC_MASK (0x200000U) -#define S50_ELS_KS12_KS12_UHMAC_SHIFT (21U) -#define S50_ELS_KS12_KS12_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UHMAC_SHIFT)) & S50_ELS_KS12_KS12_UHMAC_MASK) - -#define S50_ELS_KS12_KS12_UKWK_MASK (0x400000U) -#define S50_ELS_KS12_KS12_UKWK_SHIFT (22U) -#define S50_ELS_KS12_KS12_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UKWK_SHIFT)) & S50_ELS_KS12_KS12_UKWK_MASK) - -#define S50_ELS_KS12_KS12_UKUOK_MASK (0x800000U) -#define S50_ELS_KS12_KS12_UKUOK_SHIFT (23U) -#define S50_ELS_KS12_KS12_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UKUOK_SHIFT)) & S50_ELS_KS12_KS12_UKUOK_MASK) - -#define S50_ELS_KS12_KS12_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS12_KS12_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS12_KS12_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UTLSPMS_SHIFT)) & S50_ELS_KS12_KS12_UTLSPMS_MASK) - -#define S50_ELS_KS12_KS12_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS12_KS12_UTLSMS_SHIFT (25U) -#define S50_ELS_KS12_KS12_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UTLSMS_SHIFT)) & S50_ELS_KS12_KS12_UTLSMS_MASK) - -#define S50_ELS_KS12_KS12_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS12_KS12_UKGSRC_SHIFT (26U) -#define S50_ELS_KS12_KS12_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UKGSRC_SHIFT)) & S50_ELS_KS12_KS12_UKGSRC_MASK) - -#define S50_ELS_KS12_KS12_UHWO_MASK (0x8000000U) -#define S50_ELS_KS12_KS12_UHWO_SHIFT (27U) -#define S50_ELS_KS12_KS12_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UHWO_SHIFT)) & S50_ELS_KS12_KS12_UHWO_MASK) - -#define S50_ELS_KS12_KS12_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS12_KS12_UWRPOK_SHIFT (28U) -#define S50_ELS_KS12_KS12_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UWRPOK_SHIFT)) & S50_ELS_KS12_KS12_UWRPOK_MASK) - -#define S50_ELS_KS12_KS12_UDUK_MASK (0x20000000U) -#define S50_ELS_KS12_KS12_UDUK_SHIFT (29U) -#define S50_ELS_KS12_KS12_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UDUK_SHIFT)) & S50_ELS_KS12_KS12_UDUK_MASK) - -#define S50_ELS_KS12_KS12_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS12_KS12_UPPROT_SHIFT (30U) -#define S50_ELS_KS12_KS12_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UPPROT_SHIFT)) & S50_ELS_KS12_KS12_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS13 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS13_KS13_KSIZE_MASK (0x3U) -#define S50_ELS_KS13_KS13_KSIZE_SHIFT (0U) -/*! KS13_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS13_KS13_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_KSIZE_SHIFT)) & S50_ELS_KS13_KS13_KSIZE_MASK) - -#define S50_ELS_KS13_KS13_KACT_MASK (0x20U) -#define S50_ELS_KS13_KS13_KACT_SHIFT (5U) -#define S50_ELS_KS13_KS13_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_KACT_SHIFT)) & S50_ELS_KS13_KS13_KACT_MASK) - -#define S50_ELS_KS13_KS13_KBASE_MASK (0x40U) -#define S50_ELS_KS13_KS13_KBASE_SHIFT (6U) -#define S50_ELS_KS13_KS13_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_KBASE_SHIFT)) & S50_ELS_KS13_KS13_KBASE_MASK) - -#define S50_ELS_KS13_KS13_FGP_MASK (0x80U) -#define S50_ELS_KS13_KS13_FGP_SHIFT (7U) -#define S50_ELS_KS13_KS13_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_FGP_SHIFT)) & S50_ELS_KS13_KS13_FGP_MASK) - -#define S50_ELS_KS13_KS13_FRTN_MASK (0x100U) -#define S50_ELS_KS13_KS13_FRTN_SHIFT (8U) -#define S50_ELS_KS13_KS13_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_FRTN_SHIFT)) & S50_ELS_KS13_KS13_FRTN_MASK) - -#define S50_ELS_KS13_KS13_FHWO_MASK (0x200U) -#define S50_ELS_KS13_KS13_FHWO_SHIFT (9U) -#define S50_ELS_KS13_KS13_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_FHWO_SHIFT)) & S50_ELS_KS13_KS13_FHWO_MASK) - -#define S50_ELS_KS13_KS13_UKPUK_MASK (0x800U) -#define S50_ELS_KS13_KS13_UKPUK_SHIFT (11U) -#define S50_ELS_KS13_KS13_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UKPUK_SHIFT)) & S50_ELS_KS13_KS13_UKPUK_MASK) - -#define S50_ELS_KS13_KS13_UTECDH_MASK (0x1000U) -#define S50_ELS_KS13_KS13_UTECDH_SHIFT (12U) -#define S50_ELS_KS13_KS13_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UTECDH_SHIFT)) & S50_ELS_KS13_KS13_UTECDH_MASK) - -#define S50_ELS_KS13_KS13_UCMAC_MASK (0x2000U) -#define S50_ELS_KS13_KS13_UCMAC_SHIFT (13U) -#define S50_ELS_KS13_KS13_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UCMAC_SHIFT)) & S50_ELS_KS13_KS13_UCMAC_MASK) - -#define S50_ELS_KS13_KS13_UKSK_MASK (0x4000U) -#define S50_ELS_KS13_KS13_UKSK_SHIFT (14U) -#define S50_ELS_KS13_KS13_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UKSK_SHIFT)) & S50_ELS_KS13_KS13_UKSK_MASK) - -#define S50_ELS_KS13_KS13_URTF_MASK (0x8000U) -#define S50_ELS_KS13_KS13_URTF_SHIFT (15U) -#define S50_ELS_KS13_KS13_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_URTF_SHIFT)) & S50_ELS_KS13_KS13_URTF_MASK) - -#define S50_ELS_KS13_KS13_UCKDF_MASK (0x10000U) -#define S50_ELS_KS13_KS13_UCKDF_SHIFT (16U) -#define S50_ELS_KS13_KS13_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UCKDF_SHIFT)) & S50_ELS_KS13_KS13_UCKDF_MASK) - -#define S50_ELS_KS13_KS13_UHKDF_MASK (0x20000U) -#define S50_ELS_KS13_KS13_UHKDF_SHIFT (17U) -#define S50_ELS_KS13_KS13_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UHKDF_SHIFT)) & S50_ELS_KS13_KS13_UHKDF_MASK) - -#define S50_ELS_KS13_KS13_UECSG_MASK (0x40000U) -#define S50_ELS_KS13_KS13_UECSG_SHIFT (18U) -#define S50_ELS_KS13_KS13_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UECSG_SHIFT)) & S50_ELS_KS13_KS13_UECSG_MASK) - -#define S50_ELS_KS13_KS13_UECDH_MASK (0x80000U) -#define S50_ELS_KS13_KS13_UECDH_SHIFT (19U) -#define S50_ELS_KS13_KS13_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UECDH_SHIFT)) & S50_ELS_KS13_KS13_UECDH_MASK) - -#define S50_ELS_KS13_KS13_UAES_MASK (0x100000U) -#define S50_ELS_KS13_KS13_UAES_SHIFT (20U) -#define S50_ELS_KS13_KS13_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UAES_SHIFT)) & S50_ELS_KS13_KS13_UAES_MASK) - -#define S50_ELS_KS13_KS13_UHMAC_MASK (0x200000U) -#define S50_ELS_KS13_KS13_UHMAC_SHIFT (21U) -#define S50_ELS_KS13_KS13_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UHMAC_SHIFT)) & S50_ELS_KS13_KS13_UHMAC_MASK) - -#define S50_ELS_KS13_KS13_UKWK_MASK (0x400000U) -#define S50_ELS_KS13_KS13_UKWK_SHIFT (22U) -#define S50_ELS_KS13_KS13_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UKWK_SHIFT)) & S50_ELS_KS13_KS13_UKWK_MASK) - -#define S50_ELS_KS13_KS13_UKUOK_MASK (0x800000U) -#define S50_ELS_KS13_KS13_UKUOK_SHIFT (23U) -#define S50_ELS_KS13_KS13_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UKUOK_SHIFT)) & S50_ELS_KS13_KS13_UKUOK_MASK) - -#define S50_ELS_KS13_KS13_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS13_KS13_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS13_KS13_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UTLSPMS_SHIFT)) & S50_ELS_KS13_KS13_UTLSPMS_MASK) - -#define S50_ELS_KS13_KS13_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS13_KS13_UTLSMS_SHIFT (25U) -#define S50_ELS_KS13_KS13_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UTLSMS_SHIFT)) & S50_ELS_KS13_KS13_UTLSMS_MASK) - -#define S50_ELS_KS13_KS13_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS13_KS13_UKGSRC_SHIFT (26U) -#define S50_ELS_KS13_KS13_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UKGSRC_SHIFT)) & S50_ELS_KS13_KS13_UKGSRC_MASK) - -#define S50_ELS_KS13_KS13_UHWO_MASK (0x8000000U) -#define S50_ELS_KS13_KS13_UHWO_SHIFT (27U) -#define S50_ELS_KS13_KS13_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UHWO_SHIFT)) & S50_ELS_KS13_KS13_UHWO_MASK) - -#define S50_ELS_KS13_KS13_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS13_KS13_UWRPOK_SHIFT (28U) -#define S50_ELS_KS13_KS13_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UWRPOK_SHIFT)) & S50_ELS_KS13_KS13_UWRPOK_MASK) - -#define S50_ELS_KS13_KS13_UDUK_MASK (0x20000000U) -#define S50_ELS_KS13_KS13_UDUK_SHIFT (29U) -#define S50_ELS_KS13_KS13_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UDUK_SHIFT)) & S50_ELS_KS13_KS13_UDUK_MASK) - -#define S50_ELS_KS13_KS13_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS13_KS13_UPPROT_SHIFT (30U) -#define S50_ELS_KS13_KS13_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UPPROT_SHIFT)) & S50_ELS_KS13_KS13_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS14 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS14_KS14_KSIZE_MASK (0x3U) -#define S50_ELS_KS14_KS14_KSIZE_SHIFT (0U) -/*! KS14_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS14_KS14_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_KSIZE_SHIFT)) & S50_ELS_KS14_KS14_KSIZE_MASK) - -#define S50_ELS_KS14_KS14_KACT_MASK (0x20U) -#define S50_ELS_KS14_KS14_KACT_SHIFT (5U) -#define S50_ELS_KS14_KS14_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_KACT_SHIFT)) & S50_ELS_KS14_KS14_KACT_MASK) - -#define S50_ELS_KS14_KS14_KBASE_MASK (0x40U) -#define S50_ELS_KS14_KS14_KBASE_SHIFT (6U) -#define S50_ELS_KS14_KS14_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_KBASE_SHIFT)) & S50_ELS_KS14_KS14_KBASE_MASK) - -#define S50_ELS_KS14_KS14_FGP_MASK (0x80U) -#define S50_ELS_KS14_KS14_FGP_SHIFT (7U) -#define S50_ELS_KS14_KS14_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_FGP_SHIFT)) & S50_ELS_KS14_KS14_FGP_MASK) - -#define S50_ELS_KS14_KS14_FRTN_MASK (0x100U) -#define S50_ELS_KS14_KS14_FRTN_SHIFT (8U) -#define S50_ELS_KS14_KS14_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_FRTN_SHIFT)) & S50_ELS_KS14_KS14_FRTN_MASK) - -#define S50_ELS_KS14_KS14_FHWO_MASK (0x200U) -#define S50_ELS_KS14_KS14_FHWO_SHIFT (9U) -#define S50_ELS_KS14_KS14_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_FHWO_SHIFT)) & S50_ELS_KS14_KS14_FHWO_MASK) - -#define S50_ELS_KS14_KS14_UKPUK_MASK (0x800U) -#define S50_ELS_KS14_KS14_UKPUK_SHIFT (11U) -#define S50_ELS_KS14_KS14_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UKPUK_SHIFT)) & S50_ELS_KS14_KS14_UKPUK_MASK) - -#define S50_ELS_KS14_KS14_UTECDH_MASK (0x1000U) -#define S50_ELS_KS14_KS14_UTECDH_SHIFT (12U) -#define S50_ELS_KS14_KS14_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UTECDH_SHIFT)) & S50_ELS_KS14_KS14_UTECDH_MASK) - -#define S50_ELS_KS14_KS14_UCMAC_MASK (0x2000U) -#define S50_ELS_KS14_KS14_UCMAC_SHIFT (13U) -#define S50_ELS_KS14_KS14_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UCMAC_SHIFT)) & S50_ELS_KS14_KS14_UCMAC_MASK) - -#define S50_ELS_KS14_KS14_UKSK_MASK (0x4000U) -#define S50_ELS_KS14_KS14_UKSK_SHIFT (14U) -#define S50_ELS_KS14_KS14_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UKSK_SHIFT)) & S50_ELS_KS14_KS14_UKSK_MASK) - -#define S50_ELS_KS14_KS14_URTF_MASK (0x8000U) -#define S50_ELS_KS14_KS14_URTF_SHIFT (15U) -#define S50_ELS_KS14_KS14_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_URTF_SHIFT)) & S50_ELS_KS14_KS14_URTF_MASK) - -#define S50_ELS_KS14_KS14_UCKDF_MASK (0x10000U) -#define S50_ELS_KS14_KS14_UCKDF_SHIFT (16U) -#define S50_ELS_KS14_KS14_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UCKDF_SHIFT)) & S50_ELS_KS14_KS14_UCKDF_MASK) - -#define S50_ELS_KS14_KS14_UHKDF_MASK (0x20000U) -#define S50_ELS_KS14_KS14_UHKDF_SHIFT (17U) -#define S50_ELS_KS14_KS14_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UHKDF_SHIFT)) & S50_ELS_KS14_KS14_UHKDF_MASK) - -#define S50_ELS_KS14_KS14_UECSG_MASK (0x40000U) -#define S50_ELS_KS14_KS14_UECSG_SHIFT (18U) -#define S50_ELS_KS14_KS14_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UECSG_SHIFT)) & S50_ELS_KS14_KS14_UECSG_MASK) - -#define S50_ELS_KS14_KS14_UECDH_MASK (0x80000U) -#define S50_ELS_KS14_KS14_UECDH_SHIFT (19U) -#define S50_ELS_KS14_KS14_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UECDH_SHIFT)) & S50_ELS_KS14_KS14_UECDH_MASK) - -#define S50_ELS_KS14_KS14_UAES_MASK (0x100000U) -#define S50_ELS_KS14_KS14_UAES_SHIFT (20U) -#define S50_ELS_KS14_KS14_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UAES_SHIFT)) & S50_ELS_KS14_KS14_UAES_MASK) - -#define S50_ELS_KS14_KS14_UHMAC_MASK (0x200000U) -#define S50_ELS_KS14_KS14_UHMAC_SHIFT (21U) -#define S50_ELS_KS14_KS14_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UHMAC_SHIFT)) & S50_ELS_KS14_KS14_UHMAC_MASK) - -#define S50_ELS_KS14_KS14_UKWK_MASK (0x400000U) -#define S50_ELS_KS14_KS14_UKWK_SHIFT (22U) -#define S50_ELS_KS14_KS14_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UKWK_SHIFT)) & S50_ELS_KS14_KS14_UKWK_MASK) - -#define S50_ELS_KS14_KS14_UKUOK_MASK (0x800000U) -#define S50_ELS_KS14_KS14_UKUOK_SHIFT (23U) -#define S50_ELS_KS14_KS14_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UKUOK_SHIFT)) & S50_ELS_KS14_KS14_UKUOK_MASK) - -#define S50_ELS_KS14_KS14_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS14_KS14_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS14_KS14_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UTLSPMS_SHIFT)) & S50_ELS_KS14_KS14_UTLSPMS_MASK) - -#define S50_ELS_KS14_KS14_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS14_KS14_UTLSMS_SHIFT (25U) -#define S50_ELS_KS14_KS14_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UTLSMS_SHIFT)) & S50_ELS_KS14_KS14_UTLSMS_MASK) - -#define S50_ELS_KS14_KS14_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS14_KS14_UKGSRC_SHIFT (26U) -#define S50_ELS_KS14_KS14_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UKGSRC_SHIFT)) & S50_ELS_KS14_KS14_UKGSRC_MASK) - -#define S50_ELS_KS14_KS14_UHWO_MASK (0x8000000U) -#define S50_ELS_KS14_KS14_UHWO_SHIFT (27U) -#define S50_ELS_KS14_KS14_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UHWO_SHIFT)) & S50_ELS_KS14_KS14_UHWO_MASK) - -#define S50_ELS_KS14_KS14_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS14_KS14_UWRPOK_SHIFT (28U) -#define S50_ELS_KS14_KS14_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UWRPOK_SHIFT)) & S50_ELS_KS14_KS14_UWRPOK_MASK) - -#define S50_ELS_KS14_KS14_UDUK_MASK (0x20000000U) -#define S50_ELS_KS14_KS14_UDUK_SHIFT (29U) -#define S50_ELS_KS14_KS14_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UDUK_SHIFT)) & S50_ELS_KS14_KS14_UDUK_MASK) - -#define S50_ELS_KS14_KS14_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS14_KS14_UPPROT_SHIFT (30U) -#define S50_ELS_KS14_KS14_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UPPROT_SHIFT)) & S50_ELS_KS14_KS14_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS15 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS15_KS15_KSIZE_MASK (0x3U) -#define S50_ELS_KS15_KS15_KSIZE_SHIFT (0U) -/*! KS15_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS15_KS15_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_KSIZE_SHIFT)) & S50_ELS_KS15_KS15_KSIZE_MASK) - -#define S50_ELS_KS15_KS15_KACT_MASK (0x20U) -#define S50_ELS_KS15_KS15_KACT_SHIFT (5U) -#define S50_ELS_KS15_KS15_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_KACT_SHIFT)) & S50_ELS_KS15_KS15_KACT_MASK) - -#define S50_ELS_KS15_KS15_KBASE_MASK (0x40U) -#define S50_ELS_KS15_KS15_KBASE_SHIFT (6U) -#define S50_ELS_KS15_KS15_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_KBASE_SHIFT)) & S50_ELS_KS15_KS15_KBASE_MASK) - -#define S50_ELS_KS15_KS15_FGP_MASK (0x80U) -#define S50_ELS_KS15_KS15_FGP_SHIFT (7U) -#define S50_ELS_KS15_KS15_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_FGP_SHIFT)) & S50_ELS_KS15_KS15_FGP_MASK) - -#define S50_ELS_KS15_KS15_FRTN_MASK (0x100U) -#define S50_ELS_KS15_KS15_FRTN_SHIFT (8U) -#define S50_ELS_KS15_KS15_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_FRTN_SHIFT)) & S50_ELS_KS15_KS15_FRTN_MASK) - -#define S50_ELS_KS15_KS15_FHWO_MASK (0x200U) -#define S50_ELS_KS15_KS15_FHWO_SHIFT (9U) -#define S50_ELS_KS15_KS15_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_FHWO_SHIFT)) & S50_ELS_KS15_KS15_FHWO_MASK) - -#define S50_ELS_KS15_KS15_UKPUK_MASK (0x800U) -#define S50_ELS_KS15_KS15_UKPUK_SHIFT (11U) -#define S50_ELS_KS15_KS15_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UKPUK_SHIFT)) & S50_ELS_KS15_KS15_UKPUK_MASK) - -#define S50_ELS_KS15_KS15_UTECDH_MASK (0x1000U) -#define S50_ELS_KS15_KS15_UTECDH_SHIFT (12U) -#define S50_ELS_KS15_KS15_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UTECDH_SHIFT)) & S50_ELS_KS15_KS15_UTECDH_MASK) - -#define S50_ELS_KS15_KS15_UCMAC_MASK (0x2000U) -#define S50_ELS_KS15_KS15_UCMAC_SHIFT (13U) -#define S50_ELS_KS15_KS15_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UCMAC_SHIFT)) & S50_ELS_KS15_KS15_UCMAC_MASK) - -#define S50_ELS_KS15_KS15_UKSK_MASK (0x4000U) -#define S50_ELS_KS15_KS15_UKSK_SHIFT (14U) -#define S50_ELS_KS15_KS15_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UKSK_SHIFT)) & S50_ELS_KS15_KS15_UKSK_MASK) - -#define S50_ELS_KS15_KS15_URTF_MASK (0x8000U) -#define S50_ELS_KS15_KS15_URTF_SHIFT (15U) -#define S50_ELS_KS15_KS15_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_URTF_SHIFT)) & S50_ELS_KS15_KS15_URTF_MASK) - -#define S50_ELS_KS15_KS15_UCKDF_MASK (0x10000U) -#define S50_ELS_KS15_KS15_UCKDF_SHIFT (16U) -#define S50_ELS_KS15_KS15_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UCKDF_SHIFT)) & S50_ELS_KS15_KS15_UCKDF_MASK) - -#define S50_ELS_KS15_KS15_UHKDF_MASK (0x20000U) -#define S50_ELS_KS15_KS15_UHKDF_SHIFT (17U) -#define S50_ELS_KS15_KS15_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UHKDF_SHIFT)) & S50_ELS_KS15_KS15_UHKDF_MASK) - -#define S50_ELS_KS15_KS15_UECSG_MASK (0x40000U) -#define S50_ELS_KS15_KS15_UECSG_SHIFT (18U) -#define S50_ELS_KS15_KS15_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UECSG_SHIFT)) & S50_ELS_KS15_KS15_UECSG_MASK) - -#define S50_ELS_KS15_KS15_UECDH_MASK (0x80000U) -#define S50_ELS_KS15_KS15_UECDH_SHIFT (19U) -#define S50_ELS_KS15_KS15_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UECDH_SHIFT)) & S50_ELS_KS15_KS15_UECDH_MASK) - -#define S50_ELS_KS15_KS15_UAES_MASK (0x100000U) -#define S50_ELS_KS15_KS15_UAES_SHIFT (20U) -#define S50_ELS_KS15_KS15_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UAES_SHIFT)) & S50_ELS_KS15_KS15_UAES_MASK) - -#define S50_ELS_KS15_KS15_UHMAC_MASK (0x200000U) -#define S50_ELS_KS15_KS15_UHMAC_SHIFT (21U) -#define S50_ELS_KS15_KS15_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UHMAC_SHIFT)) & S50_ELS_KS15_KS15_UHMAC_MASK) - -#define S50_ELS_KS15_KS15_UKWK_MASK (0x400000U) -#define S50_ELS_KS15_KS15_UKWK_SHIFT (22U) -#define S50_ELS_KS15_KS15_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UKWK_SHIFT)) & S50_ELS_KS15_KS15_UKWK_MASK) - -#define S50_ELS_KS15_KS15_UKUOK_MASK (0x800000U) -#define S50_ELS_KS15_KS15_UKUOK_SHIFT (23U) -#define S50_ELS_KS15_KS15_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UKUOK_SHIFT)) & S50_ELS_KS15_KS15_UKUOK_MASK) - -#define S50_ELS_KS15_KS15_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS15_KS15_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS15_KS15_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UTLSPMS_SHIFT)) & S50_ELS_KS15_KS15_UTLSPMS_MASK) - -#define S50_ELS_KS15_KS15_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS15_KS15_UTLSMS_SHIFT (25U) -#define S50_ELS_KS15_KS15_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UTLSMS_SHIFT)) & S50_ELS_KS15_KS15_UTLSMS_MASK) - -#define S50_ELS_KS15_KS15_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS15_KS15_UKGSRC_SHIFT (26U) -#define S50_ELS_KS15_KS15_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UKGSRC_SHIFT)) & S50_ELS_KS15_KS15_UKGSRC_MASK) - -#define S50_ELS_KS15_KS15_UHWO_MASK (0x8000000U) -#define S50_ELS_KS15_KS15_UHWO_SHIFT (27U) -#define S50_ELS_KS15_KS15_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UHWO_SHIFT)) & S50_ELS_KS15_KS15_UHWO_MASK) - -#define S50_ELS_KS15_KS15_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS15_KS15_UWRPOK_SHIFT (28U) -#define S50_ELS_KS15_KS15_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UWRPOK_SHIFT)) & S50_ELS_KS15_KS15_UWRPOK_MASK) - -#define S50_ELS_KS15_KS15_UDUK_MASK (0x20000000U) -#define S50_ELS_KS15_KS15_UDUK_SHIFT (29U) -#define S50_ELS_KS15_KS15_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UDUK_SHIFT)) & S50_ELS_KS15_KS15_UDUK_MASK) - -#define S50_ELS_KS15_KS15_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS15_KS15_UPPROT_SHIFT (30U) -#define S50_ELS_KS15_KS15_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UPPROT_SHIFT)) & S50_ELS_KS15_KS15_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS16 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS16_KS16_KSIZE_MASK (0x3U) -#define S50_ELS_KS16_KS16_KSIZE_SHIFT (0U) -/*! KS16_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS16_KS16_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_KSIZE_SHIFT)) & S50_ELS_KS16_KS16_KSIZE_MASK) - -#define S50_ELS_KS16_KS16_KACT_MASK (0x20U) -#define S50_ELS_KS16_KS16_KACT_SHIFT (5U) -#define S50_ELS_KS16_KS16_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_KACT_SHIFT)) & S50_ELS_KS16_KS16_KACT_MASK) - -#define S50_ELS_KS16_KS16_KBASE_MASK (0x40U) -#define S50_ELS_KS16_KS16_KBASE_SHIFT (6U) -#define S50_ELS_KS16_KS16_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_KBASE_SHIFT)) & S50_ELS_KS16_KS16_KBASE_MASK) - -#define S50_ELS_KS16_KS16_FGP_MASK (0x80U) -#define S50_ELS_KS16_KS16_FGP_SHIFT (7U) -#define S50_ELS_KS16_KS16_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_FGP_SHIFT)) & S50_ELS_KS16_KS16_FGP_MASK) - -#define S50_ELS_KS16_KS16_FRTN_MASK (0x100U) -#define S50_ELS_KS16_KS16_FRTN_SHIFT (8U) -#define S50_ELS_KS16_KS16_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_FRTN_SHIFT)) & S50_ELS_KS16_KS16_FRTN_MASK) - -#define S50_ELS_KS16_KS16_FHWO_MASK (0x200U) -#define S50_ELS_KS16_KS16_FHWO_SHIFT (9U) -#define S50_ELS_KS16_KS16_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_FHWO_SHIFT)) & S50_ELS_KS16_KS16_FHWO_MASK) - -#define S50_ELS_KS16_KS16_UKPUK_MASK (0x800U) -#define S50_ELS_KS16_KS16_UKPUK_SHIFT (11U) -#define S50_ELS_KS16_KS16_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UKPUK_SHIFT)) & S50_ELS_KS16_KS16_UKPUK_MASK) - -#define S50_ELS_KS16_KS16_UTECDH_MASK (0x1000U) -#define S50_ELS_KS16_KS16_UTECDH_SHIFT (12U) -#define S50_ELS_KS16_KS16_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UTECDH_SHIFT)) & S50_ELS_KS16_KS16_UTECDH_MASK) - -#define S50_ELS_KS16_KS16_UCMAC_MASK (0x2000U) -#define S50_ELS_KS16_KS16_UCMAC_SHIFT (13U) -#define S50_ELS_KS16_KS16_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UCMAC_SHIFT)) & S50_ELS_KS16_KS16_UCMAC_MASK) - -#define S50_ELS_KS16_KS16_UKSK_MASK (0x4000U) -#define S50_ELS_KS16_KS16_UKSK_SHIFT (14U) -#define S50_ELS_KS16_KS16_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UKSK_SHIFT)) & S50_ELS_KS16_KS16_UKSK_MASK) - -#define S50_ELS_KS16_KS16_URTF_MASK (0x8000U) -#define S50_ELS_KS16_KS16_URTF_SHIFT (15U) -#define S50_ELS_KS16_KS16_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_URTF_SHIFT)) & S50_ELS_KS16_KS16_URTF_MASK) - -#define S50_ELS_KS16_KS16_UCKDF_MASK (0x10000U) -#define S50_ELS_KS16_KS16_UCKDF_SHIFT (16U) -#define S50_ELS_KS16_KS16_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UCKDF_SHIFT)) & S50_ELS_KS16_KS16_UCKDF_MASK) - -#define S50_ELS_KS16_KS16_UHKDF_MASK (0x20000U) -#define S50_ELS_KS16_KS16_UHKDF_SHIFT (17U) -#define S50_ELS_KS16_KS16_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UHKDF_SHIFT)) & S50_ELS_KS16_KS16_UHKDF_MASK) - -#define S50_ELS_KS16_KS16_UECSG_MASK (0x40000U) -#define S50_ELS_KS16_KS16_UECSG_SHIFT (18U) -#define S50_ELS_KS16_KS16_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UECSG_SHIFT)) & S50_ELS_KS16_KS16_UECSG_MASK) - -#define S50_ELS_KS16_KS16_UECDH_MASK (0x80000U) -#define S50_ELS_KS16_KS16_UECDH_SHIFT (19U) -#define S50_ELS_KS16_KS16_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UECDH_SHIFT)) & S50_ELS_KS16_KS16_UECDH_MASK) - -#define S50_ELS_KS16_KS16_UAES_MASK (0x100000U) -#define S50_ELS_KS16_KS16_UAES_SHIFT (20U) -#define S50_ELS_KS16_KS16_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UAES_SHIFT)) & S50_ELS_KS16_KS16_UAES_MASK) - -#define S50_ELS_KS16_KS16_UHMAC_MASK (0x200000U) -#define S50_ELS_KS16_KS16_UHMAC_SHIFT (21U) -#define S50_ELS_KS16_KS16_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UHMAC_SHIFT)) & S50_ELS_KS16_KS16_UHMAC_MASK) - -#define S50_ELS_KS16_KS16_UKWK_MASK (0x400000U) -#define S50_ELS_KS16_KS16_UKWK_SHIFT (22U) -#define S50_ELS_KS16_KS16_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UKWK_SHIFT)) & S50_ELS_KS16_KS16_UKWK_MASK) - -#define S50_ELS_KS16_KS16_UKUOK_MASK (0x800000U) -#define S50_ELS_KS16_KS16_UKUOK_SHIFT (23U) -#define S50_ELS_KS16_KS16_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UKUOK_SHIFT)) & S50_ELS_KS16_KS16_UKUOK_MASK) - -#define S50_ELS_KS16_KS16_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS16_KS16_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS16_KS16_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UTLSPMS_SHIFT)) & S50_ELS_KS16_KS16_UTLSPMS_MASK) - -#define S50_ELS_KS16_KS16_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS16_KS16_UTLSMS_SHIFT (25U) -#define S50_ELS_KS16_KS16_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UTLSMS_SHIFT)) & S50_ELS_KS16_KS16_UTLSMS_MASK) - -#define S50_ELS_KS16_KS16_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS16_KS16_UKGSRC_SHIFT (26U) -#define S50_ELS_KS16_KS16_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UKGSRC_SHIFT)) & S50_ELS_KS16_KS16_UKGSRC_MASK) - -#define S50_ELS_KS16_KS16_UHWO_MASK (0x8000000U) -#define S50_ELS_KS16_KS16_UHWO_SHIFT (27U) -#define S50_ELS_KS16_KS16_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UHWO_SHIFT)) & S50_ELS_KS16_KS16_UHWO_MASK) - -#define S50_ELS_KS16_KS16_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS16_KS16_UWRPOK_SHIFT (28U) -#define S50_ELS_KS16_KS16_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UWRPOK_SHIFT)) & S50_ELS_KS16_KS16_UWRPOK_MASK) - -#define S50_ELS_KS16_KS16_UDUK_MASK (0x20000000U) -#define S50_ELS_KS16_KS16_UDUK_SHIFT (29U) -#define S50_ELS_KS16_KS16_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UDUK_SHIFT)) & S50_ELS_KS16_KS16_UDUK_MASK) - -#define S50_ELS_KS16_KS16_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS16_KS16_UPPROT_SHIFT (30U) -#define S50_ELS_KS16_KS16_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UPPROT_SHIFT)) & S50_ELS_KS16_KS16_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS17 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS17_KS17_KSIZE_MASK (0x3U) -#define S50_ELS_KS17_KS17_KSIZE_SHIFT (0U) -/*! KS17_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS17_KS17_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_KSIZE_SHIFT)) & S50_ELS_KS17_KS17_KSIZE_MASK) - -#define S50_ELS_KS17_KS17_KACT_MASK (0x20U) -#define S50_ELS_KS17_KS17_KACT_SHIFT (5U) -#define S50_ELS_KS17_KS17_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_KACT_SHIFT)) & S50_ELS_KS17_KS17_KACT_MASK) - -#define S50_ELS_KS17_KS17_KBASE_MASK (0x40U) -#define S50_ELS_KS17_KS17_KBASE_SHIFT (6U) -#define S50_ELS_KS17_KS17_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_KBASE_SHIFT)) & S50_ELS_KS17_KS17_KBASE_MASK) - -#define S50_ELS_KS17_KS17_FGP_MASK (0x80U) -#define S50_ELS_KS17_KS17_FGP_SHIFT (7U) -#define S50_ELS_KS17_KS17_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_FGP_SHIFT)) & S50_ELS_KS17_KS17_FGP_MASK) - -#define S50_ELS_KS17_KS17_FRTN_MASK (0x100U) -#define S50_ELS_KS17_KS17_FRTN_SHIFT (8U) -#define S50_ELS_KS17_KS17_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_FRTN_SHIFT)) & S50_ELS_KS17_KS17_FRTN_MASK) - -#define S50_ELS_KS17_KS17_FHWO_MASK (0x200U) -#define S50_ELS_KS17_KS17_FHWO_SHIFT (9U) -#define S50_ELS_KS17_KS17_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_FHWO_SHIFT)) & S50_ELS_KS17_KS17_FHWO_MASK) - -#define S50_ELS_KS17_KS17_UKPUK_MASK (0x800U) -#define S50_ELS_KS17_KS17_UKPUK_SHIFT (11U) -#define S50_ELS_KS17_KS17_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UKPUK_SHIFT)) & S50_ELS_KS17_KS17_UKPUK_MASK) - -#define S50_ELS_KS17_KS17_UTECDH_MASK (0x1000U) -#define S50_ELS_KS17_KS17_UTECDH_SHIFT (12U) -#define S50_ELS_KS17_KS17_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UTECDH_SHIFT)) & S50_ELS_KS17_KS17_UTECDH_MASK) - -#define S50_ELS_KS17_KS17_UCMAC_MASK (0x2000U) -#define S50_ELS_KS17_KS17_UCMAC_SHIFT (13U) -#define S50_ELS_KS17_KS17_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UCMAC_SHIFT)) & S50_ELS_KS17_KS17_UCMAC_MASK) - -#define S50_ELS_KS17_KS17_UKSK_MASK (0x4000U) -#define S50_ELS_KS17_KS17_UKSK_SHIFT (14U) -#define S50_ELS_KS17_KS17_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UKSK_SHIFT)) & S50_ELS_KS17_KS17_UKSK_MASK) - -#define S50_ELS_KS17_KS17_URTF_MASK (0x8000U) -#define S50_ELS_KS17_KS17_URTF_SHIFT (15U) -#define S50_ELS_KS17_KS17_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_URTF_SHIFT)) & S50_ELS_KS17_KS17_URTF_MASK) - -#define S50_ELS_KS17_KS17_UCKDF_MASK (0x10000U) -#define S50_ELS_KS17_KS17_UCKDF_SHIFT (16U) -#define S50_ELS_KS17_KS17_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UCKDF_SHIFT)) & S50_ELS_KS17_KS17_UCKDF_MASK) - -#define S50_ELS_KS17_KS17_UHKDF_MASK (0x20000U) -#define S50_ELS_KS17_KS17_UHKDF_SHIFT (17U) -#define S50_ELS_KS17_KS17_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UHKDF_SHIFT)) & S50_ELS_KS17_KS17_UHKDF_MASK) - -#define S50_ELS_KS17_KS17_UECSG_MASK (0x40000U) -#define S50_ELS_KS17_KS17_UECSG_SHIFT (18U) -#define S50_ELS_KS17_KS17_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UECSG_SHIFT)) & S50_ELS_KS17_KS17_UECSG_MASK) - -#define S50_ELS_KS17_KS17_UECDH_MASK (0x80000U) -#define S50_ELS_KS17_KS17_UECDH_SHIFT (19U) -#define S50_ELS_KS17_KS17_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UECDH_SHIFT)) & S50_ELS_KS17_KS17_UECDH_MASK) - -#define S50_ELS_KS17_KS17_UAES_MASK (0x100000U) -#define S50_ELS_KS17_KS17_UAES_SHIFT (20U) -#define S50_ELS_KS17_KS17_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UAES_SHIFT)) & S50_ELS_KS17_KS17_UAES_MASK) - -#define S50_ELS_KS17_KS17_UHMAC_MASK (0x200000U) -#define S50_ELS_KS17_KS17_UHMAC_SHIFT (21U) -#define S50_ELS_KS17_KS17_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UHMAC_SHIFT)) & S50_ELS_KS17_KS17_UHMAC_MASK) - -#define S50_ELS_KS17_KS17_UKWK_MASK (0x400000U) -#define S50_ELS_KS17_KS17_UKWK_SHIFT (22U) -#define S50_ELS_KS17_KS17_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UKWK_SHIFT)) & S50_ELS_KS17_KS17_UKWK_MASK) - -#define S50_ELS_KS17_KS17_UKUOK_MASK (0x800000U) -#define S50_ELS_KS17_KS17_UKUOK_SHIFT (23U) -#define S50_ELS_KS17_KS17_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UKUOK_SHIFT)) & S50_ELS_KS17_KS17_UKUOK_MASK) - -#define S50_ELS_KS17_KS17_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS17_KS17_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS17_KS17_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UTLSPMS_SHIFT)) & S50_ELS_KS17_KS17_UTLSPMS_MASK) - -#define S50_ELS_KS17_KS17_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS17_KS17_UTLSMS_SHIFT (25U) -#define S50_ELS_KS17_KS17_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UTLSMS_SHIFT)) & S50_ELS_KS17_KS17_UTLSMS_MASK) - -#define S50_ELS_KS17_KS17_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS17_KS17_UKGSRC_SHIFT (26U) -#define S50_ELS_KS17_KS17_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UKGSRC_SHIFT)) & S50_ELS_KS17_KS17_UKGSRC_MASK) - -#define S50_ELS_KS17_KS17_UHWO_MASK (0x8000000U) -#define S50_ELS_KS17_KS17_UHWO_SHIFT (27U) -#define S50_ELS_KS17_KS17_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UHWO_SHIFT)) & S50_ELS_KS17_KS17_UHWO_MASK) - -#define S50_ELS_KS17_KS17_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS17_KS17_UWRPOK_SHIFT (28U) -#define S50_ELS_KS17_KS17_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UWRPOK_SHIFT)) & S50_ELS_KS17_KS17_UWRPOK_MASK) - -#define S50_ELS_KS17_KS17_UDUK_MASK (0x20000000U) -#define S50_ELS_KS17_KS17_UDUK_SHIFT (29U) -#define S50_ELS_KS17_KS17_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UDUK_SHIFT)) & S50_ELS_KS17_KS17_UDUK_MASK) - -#define S50_ELS_KS17_KS17_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS17_KS17_UPPROT_SHIFT (30U) -#define S50_ELS_KS17_KS17_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UPPROT_SHIFT)) & S50_ELS_KS17_KS17_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS18 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS18_KS18_KSIZE_MASK (0x3U) -#define S50_ELS_KS18_KS18_KSIZE_SHIFT (0U) -/*! KS18_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS18_KS18_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_KSIZE_SHIFT)) & S50_ELS_KS18_KS18_KSIZE_MASK) - -#define S50_ELS_KS18_KS18_KACT_MASK (0x20U) -#define S50_ELS_KS18_KS18_KACT_SHIFT (5U) -#define S50_ELS_KS18_KS18_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_KACT_SHIFT)) & S50_ELS_KS18_KS18_KACT_MASK) - -#define S50_ELS_KS18_KS18_KBASE_MASK (0x40U) -#define S50_ELS_KS18_KS18_KBASE_SHIFT (6U) -#define S50_ELS_KS18_KS18_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_KBASE_SHIFT)) & S50_ELS_KS18_KS18_KBASE_MASK) - -#define S50_ELS_KS18_KS18_FGP_MASK (0x80U) -#define S50_ELS_KS18_KS18_FGP_SHIFT (7U) -#define S50_ELS_KS18_KS18_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_FGP_SHIFT)) & S50_ELS_KS18_KS18_FGP_MASK) - -#define S50_ELS_KS18_KS18_FRTN_MASK (0x100U) -#define S50_ELS_KS18_KS18_FRTN_SHIFT (8U) -#define S50_ELS_KS18_KS18_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_FRTN_SHIFT)) & S50_ELS_KS18_KS18_FRTN_MASK) - -#define S50_ELS_KS18_KS18_FHWO_MASK (0x200U) -#define S50_ELS_KS18_KS18_FHWO_SHIFT (9U) -#define S50_ELS_KS18_KS18_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_FHWO_SHIFT)) & S50_ELS_KS18_KS18_FHWO_MASK) - -#define S50_ELS_KS18_KS18_UKPUK_MASK (0x800U) -#define S50_ELS_KS18_KS18_UKPUK_SHIFT (11U) -#define S50_ELS_KS18_KS18_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UKPUK_SHIFT)) & S50_ELS_KS18_KS18_UKPUK_MASK) - -#define S50_ELS_KS18_KS18_UTECDH_MASK (0x1000U) -#define S50_ELS_KS18_KS18_UTECDH_SHIFT (12U) -#define S50_ELS_KS18_KS18_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UTECDH_SHIFT)) & S50_ELS_KS18_KS18_UTECDH_MASK) - -#define S50_ELS_KS18_KS18_UCMAC_MASK (0x2000U) -#define S50_ELS_KS18_KS18_UCMAC_SHIFT (13U) -#define S50_ELS_KS18_KS18_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UCMAC_SHIFT)) & S50_ELS_KS18_KS18_UCMAC_MASK) - -#define S50_ELS_KS18_KS18_UKSK_MASK (0x4000U) -#define S50_ELS_KS18_KS18_UKSK_SHIFT (14U) -#define S50_ELS_KS18_KS18_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UKSK_SHIFT)) & S50_ELS_KS18_KS18_UKSK_MASK) - -#define S50_ELS_KS18_KS18_URTF_MASK (0x8000U) -#define S50_ELS_KS18_KS18_URTF_SHIFT (15U) -#define S50_ELS_KS18_KS18_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_URTF_SHIFT)) & S50_ELS_KS18_KS18_URTF_MASK) - -#define S50_ELS_KS18_KS18_UCKDF_MASK (0x10000U) -#define S50_ELS_KS18_KS18_UCKDF_SHIFT (16U) -#define S50_ELS_KS18_KS18_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UCKDF_SHIFT)) & S50_ELS_KS18_KS18_UCKDF_MASK) - -#define S50_ELS_KS18_KS18_UHKDF_MASK (0x20000U) -#define S50_ELS_KS18_KS18_UHKDF_SHIFT (17U) -#define S50_ELS_KS18_KS18_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UHKDF_SHIFT)) & S50_ELS_KS18_KS18_UHKDF_MASK) - -#define S50_ELS_KS18_KS18_UECSG_MASK (0x40000U) -#define S50_ELS_KS18_KS18_UECSG_SHIFT (18U) -#define S50_ELS_KS18_KS18_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UECSG_SHIFT)) & S50_ELS_KS18_KS18_UECSG_MASK) - -#define S50_ELS_KS18_KS18_UECDH_MASK (0x80000U) -#define S50_ELS_KS18_KS18_UECDH_SHIFT (19U) -#define S50_ELS_KS18_KS18_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UECDH_SHIFT)) & S50_ELS_KS18_KS18_UECDH_MASK) - -#define S50_ELS_KS18_KS18_UAES_MASK (0x100000U) -#define S50_ELS_KS18_KS18_UAES_SHIFT (20U) -#define S50_ELS_KS18_KS18_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UAES_SHIFT)) & S50_ELS_KS18_KS18_UAES_MASK) - -#define S50_ELS_KS18_KS18_UHMAC_MASK (0x200000U) -#define S50_ELS_KS18_KS18_UHMAC_SHIFT (21U) -#define S50_ELS_KS18_KS18_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UHMAC_SHIFT)) & S50_ELS_KS18_KS18_UHMAC_MASK) - -#define S50_ELS_KS18_KS18_UKWK_MASK (0x400000U) -#define S50_ELS_KS18_KS18_UKWK_SHIFT (22U) -#define S50_ELS_KS18_KS18_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UKWK_SHIFT)) & S50_ELS_KS18_KS18_UKWK_MASK) - -#define S50_ELS_KS18_KS18_UKUOK_MASK (0x800000U) -#define S50_ELS_KS18_KS18_UKUOK_SHIFT (23U) -#define S50_ELS_KS18_KS18_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UKUOK_SHIFT)) & S50_ELS_KS18_KS18_UKUOK_MASK) - -#define S50_ELS_KS18_KS18_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS18_KS18_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS18_KS18_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UTLSPMS_SHIFT)) & S50_ELS_KS18_KS18_UTLSPMS_MASK) - -#define S50_ELS_KS18_KS18_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS18_KS18_UTLSMS_SHIFT (25U) -#define S50_ELS_KS18_KS18_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UTLSMS_SHIFT)) & S50_ELS_KS18_KS18_UTLSMS_MASK) - -#define S50_ELS_KS18_KS18_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS18_KS18_UKGSRC_SHIFT (26U) -#define S50_ELS_KS18_KS18_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UKGSRC_SHIFT)) & S50_ELS_KS18_KS18_UKGSRC_MASK) - -#define S50_ELS_KS18_KS18_UHWO_MASK (0x8000000U) -#define S50_ELS_KS18_KS18_UHWO_SHIFT (27U) -#define S50_ELS_KS18_KS18_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UHWO_SHIFT)) & S50_ELS_KS18_KS18_UHWO_MASK) - -#define S50_ELS_KS18_KS18_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS18_KS18_UWRPOK_SHIFT (28U) -#define S50_ELS_KS18_KS18_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UWRPOK_SHIFT)) & S50_ELS_KS18_KS18_UWRPOK_MASK) - -#define S50_ELS_KS18_KS18_UDUK_MASK (0x20000000U) -#define S50_ELS_KS18_KS18_UDUK_SHIFT (29U) -#define S50_ELS_KS18_KS18_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UDUK_SHIFT)) & S50_ELS_KS18_KS18_UDUK_MASK) - -#define S50_ELS_KS18_KS18_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS18_KS18_UPPROT_SHIFT (30U) -#define S50_ELS_KS18_KS18_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UPPROT_SHIFT)) & S50_ELS_KS18_KS18_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS19 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS19_KS19_KSIZE_MASK (0x3U) -#define S50_ELS_KS19_KS19_KSIZE_SHIFT (0U) -/*! KS19_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS19_KS19_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_KSIZE_SHIFT)) & S50_ELS_KS19_KS19_KSIZE_MASK) - -#define S50_ELS_KS19_KS19_KACT_MASK (0x20U) -#define S50_ELS_KS19_KS19_KACT_SHIFT (5U) -#define S50_ELS_KS19_KS19_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_KACT_SHIFT)) & S50_ELS_KS19_KS19_KACT_MASK) - -#define S50_ELS_KS19_KS19_KBASE_MASK (0x40U) -#define S50_ELS_KS19_KS19_KBASE_SHIFT (6U) -#define S50_ELS_KS19_KS19_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_KBASE_SHIFT)) & S50_ELS_KS19_KS19_KBASE_MASK) - -#define S50_ELS_KS19_KS19_FGP_MASK (0x80U) -#define S50_ELS_KS19_KS19_FGP_SHIFT (7U) -#define S50_ELS_KS19_KS19_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_FGP_SHIFT)) & S50_ELS_KS19_KS19_FGP_MASK) - -#define S50_ELS_KS19_KS19_FRTN_MASK (0x100U) -#define S50_ELS_KS19_KS19_FRTN_SHIFT (8U) -#define S50_ELS_KS19_KS19_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_FRTN_SHIFT)) & S50_ELS_KS19_KS19_FRTN_MASK) - -#define S50_ELS_KS19_KS19_FHWO_MASK (0x200U) -#define S50_ELS_KS19_KS19_FHWO_SHIFT (9U) -#define S50_ELS_KS19_KS19_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_FHWO_SHIFT)) & S50_ELS_KS19_KS19_FHWO_MASK) - -#define S50_ELS_KS19_KS19_UKPUK_MASK (0x800U) -#define S50_ELS_KS19_KS19_UKPUK_SHIFT (11U) -#define S50_ELS_KS19_KS19_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UKPUK_SHIFT)) & S50_ELS_KS19_KS19_UKPUK_MASK) - -#define S50_ELS_KS19_KS19_UTECDH_MASK (0x1000U) -#define S50_ELS_KS19_KS19_UTECDH_SHIFT (12U) -#define S50_ELS_KS19_KS19_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UTECDH_SHIFT)) & S50_ELS_KS19_KS19_UTECDH_MASK) - -#define S50_ELS_KS19_KS19_UCMAC_MASK (0x2000U) -#define S50_ELS_KS19_KS19_UCMAC_SHIFT (13U) -#define S50_ELS_KS19_KS19_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UCMAC_SHIFT)) & S50_ELS_KS19_KS19_UCMAC_MASK) - -#define S50_ELS_KS19_KS19_UKSK_MASK (0x4000U) -#define S50_ELS_KS19_KS19_UKSK_SHIFT (14U) -#define S50_ELS_KS19_KS19_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UKSK_SHIFT)) & S50_ELS_KS19_KS19_UKSK_MASK) - -#define S50_ELS_KS19_KS19_URTF_MASK (0x8000U) -#define S50_ELS_KS19_KS19_URTF_SHIFT (15U) -#define S50_ELS_KS19_KS19_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_URTF_SHIFT)) & S50_ELS_KS19_KS19_URTF_MASK) - -#define S50_ELS_KS19_KS19_UCKDF_MASK (0x10000U) -#define S50_ELS_KS19_KS19_UCKDF_SHIFT (16U) -#define S50_ELS_KS19_KS19_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UCKDF_SHIFT)) & S50_ELS_KS19_KS19_UCKDF_MASK) - -#define S50_ELS_KS19_KS19_UHKDF_MASK (0x20000U) -#define S50_ELS_KS19_KS19_UHKDF_SHIFT (17U) -#define S50_ELS_KS19_KS19_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UHKDF_SHIFT)) & S50_ELS_KS19_KS19_UHKDF_MASK) - -#define S50_ELS_KS19_KS19_UECSG_MASK (0x40000U) -#define S50_ELS_KS19_KS19_UECSG_SHIFT (18U) -#define S50_ELS_KS19_KS19_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UECSG_SHIFT)) & S50_ELS_KS19_KS19_UECSG_MASK) - -#define S50_ELS_KS19_KS19_UECDH_MASK (0x80000U) -#define S50_ELS_KS19_KS19_UECDH_SHIFT (19U) -#define S50_ELS_KS19_KS19_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UECDH_SHIFT)) & S50_ELS_KS19_KS19_UECDH_MASK) - -#define S50_ELS_KS19_KS19_UAES_MASK (0x100000U) -#define S50_ELS_KS19_KS19_UAES_SHIFT (20U) -#define S50_ELS_KS19_KS19_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UAES_SHIFT)) & S50_ELS_KS19_KS19_UAES_MASK) - -#define S50_ELS_KS19_KS19_UHMAC_MASK (0x200000U) -#define S50_ELS_KS19_KS19_UHMAC_SHIFT (21U) -#define S50_ELS_KS19_KS19_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UHMAC_SHIFT)) & S50_ELS_KS19_KS19_UHMAC_MASK) - -#define S50_ELS_KS19_KS19_UKWK_MASK (0x400000U) -#define S50_ELS_KS19_KS19_UKWK_SHIFT (22U) -#define S50_ELS_KS19_KS19_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UKWK_SHIFT)) & S50_ELS_KS19_KS19_UKWK_MASK) - -#define S50_ELS_KS19_KS19_UKUOK_MASK (0x800000U) -#define S50_ELS_KS19_KS19_UKUOK_SHIFT (23U) -#define S50_ELS_KS19_KS19_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UKUOK_SHIFT)) & S50_ELS_KS19_KS19_UKUOK_MASK) - -#define S50_ELS_KS19_KS19_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS19_KS19_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS19_KS19_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UTLSPMS_SHIFT)) & S50_ELS_KS19_KS19_UTLSPMS_MASK) - -#define S50_ELS_KS19_KS19_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS19_KS19_UTLSMS_SHIFT (25U) -#define S50_ELS_KS19_KS19_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UTLSMS_SHIFT)) & S50_ELS_KS19_KS19_UTLSMS_MASK) - -#define S50_ELS_KS19_KS19_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS19_KS19_UKGSRC_SHIFT (26U) -#define S50_ELS_KS19_KS19_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UKGSRC_SHIFT)) & S50_ELS_KS19_KS19_UKGSRC_MASK) - -#define S50_ELS_KS19_KS19_UHWO_MASK (0x8000000U) -#define S50_ELS_KS19_KS19_UHWO_SHIFT (27U) -#define S50_ELS_KS19_KS19_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UHWO_SHIFT)) & S50_ELS_KS19_KS19_UHWO_MASK) - -#define S50_ELS_KS19_KS19_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS19_KS19_UWRPOK_SHIFT (28U) -#define S50_ELS_KS19_KS19_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UWRPOK_SHIFT)) & S50_ELS_KS19_KS19_UWRPOK_MASK) - -#define S50_ELS_KS19_KS19_UDUK_MASK (0x20000000U) -#define S50_ELS_KS19_KS19_UDUK_SHIFT (29U) -#define S50_ELS_KS19_KS19_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UDUK_SHIFT)) & S50_ELS_KS19_KS19_UDUK_MASK) - -#define S50_ELS_KS19_KS19_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS19_KS19_UPPROT_SHIFT (30U) -#define S50_ELS_KS19_KS19_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UPPROT_SHIFT)) & S50_ELS_KS19_KS19_UPPROT_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group S50_Register_Masks */ - - -/* S50 - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral ELS base address */ - #define ELS_BASE (0x50054000u) - /** Peripheral ELS base address */ - #define ELS_BASE_NS (0x40054000u) - /** Peripheral ELS base pointer */ - #define ELS ((S50_Type *)ELS_BASE) - /** Peripheral ELS base pointer */ - #define ELS_NS ((S50_Type *)ELS_BASE_NS) - /** Peripheral ELS_ALIAS1 base address */ - #define ELS_ALIAS1_BASE (0x50055000u) - /** Peripheral ELS_ALIAS1 base address */ - #define ELS_ALIAS1_BASE_NS (0x40055000u) - /** Peripheral ELS_ALIAS1 base pointer */ - #define ELS_ALIAS1 ((S50_Type *)ELS_ALIAS1_BASE) - /** Peripheral ELS_ALIAS1 base pointer */ - #define ELS_ALIAS1_NS ((S50_Type *)ELS_ALIAS1_BASE_NS) - /** Peripheral ELS_ALIAS2 base address */ - #define ELS_ALIAS2_BASE (0x50056000u) - /** Peripheral ELS_ALIAS2 base address */ - #define ELS_ALIAS2_BASE_NS (0x40056000u) - /** Peripheral ELS_ALIAS2 base pointer */ - #define ELS_ALIAS2 ((S50_Type *)ELS_ALIAS2_BASE) - /** Peripheral ELS_ALIAS2 base pointer */ - #define ELS_ALIAS2_NS ((S50_Type *)ELS_ALIAS2_BASE_NS) - /** Peripheral ELS_ALIAS3 base address */ - #define ELS_ALIAS3_BASE (0x50057000u) - /** Peripheral ELS_ALIAS3 base address */ - #define ELS_ALIAS3_BASE_NS (0x40057000u) - /** Peripheral ELS_ALIAS3 base pointer */ - #define ELS_ALIAS3 ((S50_Type *)ELS_ALIAS3_BASE) - /** Peripheral ELS_ALIAS3 base pointer */ - #define ELS_ALIAS3_NS ((S50_Type *)ELS_ALIAS3_BASE_NS) - /** Array initializer of S50 peripheral base addresses */ - #define S50_BASE_ADDRS { ELS_BASE, ELS_ALIAS1_BASE, ELS_ALIAS2_BASE, ELS_ALIAS3_BASE } - /** Array initializer of S50 peripheral base pointers */ - #define S50_BASE_PTRS { ELS, ELS_ALIAS1, ELS_ALIAS2, ELS_ALIAS3 } - /** Array initializer of S50 peripheral base addresses */ - #define S50_BASE_ADDRS_NS { ELS_BASE_NS, ELS_ALIAS1_BASE_NS, ELS_ALIAS2_BASE_NS, ELS_ALIAS3_BASE_NS } - /** Array initializer of S50 peripheral base pointers */ - #define S50_BASE_PTRS_NS { ELS_NS, ELS_ALIAS1_NS, ELS_ALIAS2_NS, ELS_ALIAS3_NS } -#else - /** Peripheral ELS base address */ - #define ELS_BASE (0x40054000u) - /** Peripheral ELS base pointer */ - #define ELS ((S50_Type *)ELS_BASE) - /** Peripheral ELS_ALIAS1 base address */ - #define ELS_ALIAS1_BASE (0x40055000u) - /** Peripheral ELS_ALIAS1 base pointer */ - #define ELS_ALIAS1 ((S50_Type *)ELS_ALIAS1_BASE) - /** Peripheral ELS_ALIAS2 base address */ - #define ELS_ALIAS2_BASE (0x40056000u) - /** Peripheral ELS_ALIAS2 base pointer */ - #define ELS_ALIAS2 ((S50_Type *)ELS_ALIAS2_BASE) - /** Peripheral ELS_ALIAS3 base address */ - #define ELS_ALIAS3_BASE (0x40057000u) - /** Peripheral ELS_ALIAS3 base pointer */ - #define ELS_ALIAS3 ((S50_Type *)ELS_ALIAS3_BASE) - /** Array initializer of S50 peripheral base addresses */ - #define S50_BASE_ADDRS { ELS_BASE, ELS_ALIAS1_BASE, ELS_ALIAS2_BASE, ELS_ALIAS3_BASE } - /** Array initializer of S50 peripheral base pointers */ - #define S50_BASE_PTRS { ELS, ELS_ALIAS1, ELS_ALIAS2, ELS_ALIAS3 } -#endif - -/*! - * @} - */ /* end of group S50_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- SCG Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SCG_Peripheral_Access_Layer SCG Peripheral Access Layer - * @{ - */ - -/** SCG - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID Register, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter Register, offset: 0x4 */ - __IO uint32_t TRIM_LOCK; /**< Trim Lock register, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __I uint32_t CSR; /**< Clock Status Register, offset: 0x10 */ - __IO uint32_t RCCR; /**< Run Clock Control Register, offset: 0x14 */ - uint8_t RESERVED_1[232]; - __IO uint32_t SOSCCSR; /**< SOSC Control Status Register, offset: 0x100 */ - uint8_t RESERVED_2[4]; - __IO uint32_t SOSCCFG; /**< SOSC Configuration Register, offset: 0x108 */ - uint8_t RESERVED_3[244]; - __IO uint32_t SIRCCSR; /**< SIRC Control Status Register, offset: 0x200 */ - uint8_t RESERVED_4[8]; - __IO uint32_t SIRCTCFG; /**< SIRC Trim Configuration Register, offset: 0x20C */ - __IO uint32_t SIRCTRIM; /**< SIRC Trim Register, offset: 0x210 */ - uint8_t RESERVED_5[4]; - __IO uint32_t SIRCSTAT; /**< SIRC Auto-trimming Status Register, offset: 0x218 */ - uint8_t RESERVED_6[228]; - __IO uint32_t FIRCCSR; /**< FIRC Control Status Register, offset: 0x300 */ - uint8_t RESERVED_7[4]; - __IO uint32_t FIRCCFG; /**< FIRC Configuration Register, offset: 0x308 */ - __IO uint32_t FIRCTCFG; /**< FIRC Trim Configuration Register, offset: 0x30C */ - __IO uint32_t FIRCTRIM; /**< FIRC Trim Register, offset: 0x310 */ - uint8_t RESERVED_8[4]; - __IO uint32_t FIRCSTAT; /**< FIRC Auto-trimming Status Register, offset: 0x318 */ - uint8_t RESERVED_9[228]; - __IO uint32_t ROSCCSR; /**< ROSC Control Status Register, offset: 0x400 */ - uint8_t RESERVED_10[252]; - __IO uint32_t APLLCSR; /**< APLL Control Status Register, offset: 0x500 */ - __IO uint32_t APLLCTRL; /**< APLL Control Register, offset: 0x504 */ - __I uint32_t APLLSTAT; /**< APLL Status Register, offset: 0x508 */ - __IO uint32_t APLLNDIV; /**< APLL N Divider Register, offset: 0x50C */ - __IO uint32_t APLLMDIV; /**< APLL M Divider Register, offset: 0x510 */ - __IO uint32_t APLLPDIV; /**< APLL P Divider Register, offset: 0x514 */ - __IO uint32_t APLLLOCK_CNFG; /**< APLL LOCK Configuration Register, offset: 0x518 */ - uint8_t RESERVED_11[4]; - __I uint32_t APLLSSCGSTAT; /**< APLL SSCG Status Register, offset: 0x520 */ - __IO uint32_t APLLSSCG0; /**< APLL Spread Spectrum Control 0 Register, offset: 0x524 */ - __IO uint32_t APLLSSCG1; /**< APLL Spread Spectrum Control 1 Register, offset: 0x528 */ - uint8_t RESERVED_12[200]; - __IO uint32_t APLL_OVRD; /**< APLL Override Register, offset: 0x5F4 */ - uint8_t RESERVED_13[8]; - __IO uint32_t SPLLCSR; /**< SPLL Control Status Register, offset: 0x600 */ - __IO uint32_t SPLLCTRL; /**< SPLL Control Register, offset: 0x604 */ - __I uint32_t SPLLSTAT; /**< SPLL Status Register, offset: 0x608 */ - __IO uint32_t SPLLNDIV; /**< SPLL N Divider Register, offset: 0x60C */ - __IO uint32_t SPLLMDIV; /**< SPLL M Divider Register, offset: 0x610 */ - __IO uint32_t SPLLPDIV; /**< SPLL P Divider Register, offset: 0x614 */ - __IO uint32_t SPLLLOCK_CNFG; /**< SPLL LOCK Configuration Register, offset: 0x618 */ - uint8_t RESERVED_14[4]; - __I uint32_t SPLLSSCGSTAT; /**< SPLL SSCG Status Register, offset: 0x620 */ - __IO uint32_t SPLLSSCG0; /**< SPLL Spread Spectrum Control 0 Register, offset: 0x624 */ - __IO uint32_t SPLLSSCG1; /**< SPLL Spread Spectrum Control 1 Register, offset: 0x628 */ - uint8_t RESERVED_15[200]; - __IO uint32_t SPLL_OVRD; /**< SPLL Override Register, offset: 0x6F4 */ - uint8_t RESERVED_16[8]; - __IO uint32_t UPLLCSR; /**< UPLL Control Status Register, offset: 0x700 */ - uint8_t RESERVED_17[252]; - __IO uint32_t LDOCSR; /**< LDO Control and Status Register, offset: 0x800 */ -} SCG_Type; - -/* ---------------------------------------------------------------------------- - -- SCG Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SCG_Register_Masks SCG Register Masks - * @{ - */ - -/*! @name VERID - Version ID Register */ -/*! @{ */ - -#define SCG_VERID_VERSION_MASK (0xFFFFFFFFU) -#define SCG_VERID_VERSION_SHIFT (0U) -/*! VERSION - SCG Version Number */ -#define SCG_VERID_VERSION(x) (((uint32_t)(((uint32_t)(x)) << SCG_VERID_VERSION_SHIFT)) & SCG_VERID_VERSION_MASK) -/*! @} */ - -/*! @name PARAM - Parameter Register */ -/*! @{ */ - -#define SCG_PARAM_SOSCCLKPRES_MASK (0x2U) -#define SCG_PARAM_SOSCCLKPRES_SHIFT (1U) -/*! SOSCCLKPRES - SOSC Clock Present - * 0b1..SOSC clock source is present - * 0b0..SOSC clock source is not present - */ -#define SCG_PARAM_SOSCCLKPRES(x) (((uint32_t)(((uint32_t)(x)) << SCG_PARAM_SOSCCLKPRES_SHIFT)) & SCG_PARAM_SOSCCLKPRES_MASK) - -#define SCG_PARAM_SIRCCLKPRES_MASK (0x4U) -#define SCG_PARAM_SIRCCLKPRES_SHIFT (2U) -/*! SIRCCLKPRES - SIRC Clock Present - * 0b1..SIRC clock source is present - * 0b0..SIRC clock source is not present - */ -#define SCG_PARAM_SIRCCLKPRES(x) (((uint32_t)(((uint32_t)(x)) << SCG_PARAM_SIRCCLKPRES_SHIFT)) & SCG_PARAM_SIRCCLKPRES_MASK) - -#define SCG_PARAM_FIRCCLKPRES_MASK (0x8U) -#define SCG_PARAM_FIRCCLKPRES_SHIFT (3U) -/*! FIRCCLKPRES - FIRC Clock Present - * 0b1..FIRC clock source is present - * 0b0..FIRC clock source is not present - */ -#define SCG_PARAM_FIRCCLKPRES(x) (((uint32_t)(((uint32_t)(x)) << SCG_PARAM_FIRCCLKPRES_SHIFT)) & SCG_PARAM_FIRCCLKPRES_MASK) - -#define SCG_PARAM_ROSCCLKPRES_MASK (0x10U) -#define SCG_PARAM_ROSCCLKPRES_SHIFT (4U) -/*! ROSCCLKPRES - ROSC Clock Present - * 0b1..ROSC clock source is present - * 0b0..ROSC clock source is not present - */ -#define SCG_PARAM_ROSCCLKPRES(x) (((uint32_t)(((uint32_t)(x)) << SCG_PARAM_ROSCCLKPRES_SHIFT)) & SCG_PARAM_ROSCCLKPRES_MASK) - -#define SCG_PARAM_APLLCLKPRES_MASK (0x20U) -#define SCG_PARAM_APLLCLKPRES_SHIFT (5U) -/*! APLLCLKPRES - APLL Clock Present - * 0b1..APLL clock source is present - * 0b0..APLL clock source is not present - */ -#define SCG_PARAM_APLLCLKPRES(x) (((uint32_t)(((uint32_t)(x)) << SCG_PARAM_APLLCLKPRES_SHIFT)) & SCG_PARAM_APLLCLKPRES_MASK) - -#define SCG_PARAM_SPLLCLKPRES_MASK (0x40U) -#define SCG_PARAM_SPLLCLKPRES_SHIFT (6U) -/*! SPLLCLKPRES - SPLL Clock Present - * 0b1..SPLL clock source is present - * 0b0..SPLL clock source is not present - */ -#define SCG_PARAM_SPLLCLKPRES(x) (((uint32_t)(((uint32_t)(x)) << SCG_PARAM_SPLLCLKPRES_SHIFT)) & SCG_PARAM_SPLLCLKPRES_MASK) - -#define SCG_PARAM_UPLLCLKPRES_MASK (0x80U) -#define SCG_PARAM_UPLLCLKPRES_SHIFT (7U) -/*! UPLLCLKPRES - UPLL Clock Present - * 0b1..UPLL clock source is present - * 0b0..UPLL clock source is not present - */ -#define SCG_PARAM_UPLLCLKPRES(x) (((uint32_t)(((uint32_t)(x)) << SCG_PARAM_UPLLCLKPRES_SHIFT)) & SCG_PARAM_UPLLCLKPRES_MASK) -/*! @} */ - -/*! @name TRIM_LOCK - Trim Lock register */ -/*! @{ */ - -#define SCG_TRIM_LOCK_TRIM_UNLOCK_MASK (0x1U) -#define SCG_TRIM_LOCK_TRIM_UNLOCK_SHIFT (0U) -/*! TRIM_UNLOCK - TRIM_UNLOCK - * 0b0..SCG Trim registers are locked and not writable. - * 0b1..SCG Trim registers are unlocked and writable. - */ -#define SCG_TRIM_LOCK_TRIM_UNLOCK(x) (((uint32_t)(((uint32_t)(x)) << SCG_TRIM_LOCK_TRIM_UNLOCK_SHIFT)) & SCG_TRIM_LOCK_TRIM_UNLOCK_MASK) - -#define SCG_TRIM_LOCK_IFR_DISABLE_MASK (0x2U) -#define SCG_TRIM_LOCK_IFR_DISABLE_SHIFT (1U) -/*! IFR_DISABLE - IFR_DISABLE - * 0b0..IFR write access to SCG trim registers not disabled. The SCG Trim registers are reprogrammed with the IFR values after any system reset. - * 0b1..IFR write access to SCG trim registers during system reset is blocked. - */ -#define SCG_TRIM_LOCK_IFR_DISABLE(x) (((uint32_t)(((uint32_t)(x)) << SCG_TRIM_LOCK_IFR_DISABLE_SHIFT)) & SCG_TRIM_LOCK_IFR_DISABLE_MASK) - -#define SCG_TRIM_LOCK_TRIM_LOCK_KEY_MASK (0xFFFF0000U) -#define SCG_TRIM_LOCK_TRIM_LOCK_KEY_SHIFT (16U) -/*! TRIM_LOCK_KEY - TRIM_LOCK_KEY */ -#define SCG_TRIM_LOCK_TRIM_LOCK_KEY(x) (((uint32_t)(((uint32_t)(x)) << SCG_TRIM_LOCK_TRIM_LOCK_KEY_SHIFT)) & SCG_TRIM_LOCK_TRIM_LOCK_KEY_MASK) -/*! @} */ - -/*! @name CSR - Clock Status Register */ -/*! @{ */ - -#define SCG_CSR_SCS_MASK (0xF000000U) -#define SCG_CSR_SCS_SHIFT (24U) -/*! SCS - System Clock Source - * 0b0000..Reserved - * 0b0001..SOSC - * 0b0010..SIRC - * 0b0011..FIRC - * 0b0100..ROSC - * 0b0101..APLL - * 0b0110..SPLL - * 0b0111..UPLL - * 0b1000-0b1111..Reserved - */ -#define SCG_CSR_SCS(x) (((uint32_t)(((uint32_t)(x)) << SCG_CSR_SCS_SHIFT)) & SCG_CSR_SCS_MASK) -/*! @} */ - -/*! @name RCCR - Run Clock Control Register */ -/*! @{ */ - -#define SCG_RCCR_SCS_MASK (0xF000000U) -#define SCG_RCCR_SCS_SHIFT (24U) -/*! SCS - System Clock Source - * 0b0000..Reserved - * 0b0001..SOSC - * 0b0010..SIRC - * 0b0011..FIRC - * 0b0100..ROSC - * 0b0101..APLL - * 0b0110..SPLL - * 0b0111..UPLL - * 0b1000-0b1111..Reserved - */ -#define SCG_RCCR_SCS(x) (((uint32_t)(((uint32_t)(x)) << SCG_RCCR_SCS_SHIFT)) & SCG_RCCR_SCS_MASK) -/*! @} */ - -/*! @name SOSCCSR - SOSC Control Status Register */ -/*! @{ */ - -#define SCG_SOSCCSR_SOSCEN_MASK (0x1U) -#define SCG_SOSCCSR_SOSCEN_SHIFT (0U) -/*! SOSCEN - SOSC Enable - * 0b0..SOSC is disabled - * 0b1..SOSC is enabled - */ -#define SCG_SOSCCSR_SOSCEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCEN_SHIFT)) & SCG_SOSCCSR_SOSCEN_MASK) - -#define SCG_SOSCCSR_SOSCSTEN_MASK (0x2U) -#define SCG_SOSCCSR_SOSCSTEN_SHIFT (1U) -/*! SOSCSTEN - SOSC Stop Enable - * 0b0..SOSC is disabled in Deep Sleep mode - * 0b1..SOSC is enabled in Deep Sleep mode only if SOSCEN is set - */ -#define SCG_SOSCCSR_SOSCSTEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCSTEN_SHIFT)) & SCG_SOSCCSR_SOSCSTEN_MASK) - -#define SCG_SOSCCSR_SOSCCM_MASK (0x10000U) -#define SCG_SOSCCSR_SOSCCM_SHIFT (16U) -/*! SOSCCM - SOSC Clock Monitor Enable - * 0b0..SOSC Clock Monitor is disabled - * 0b1..SOSC Clock Monitor is enabled - */ -#define SCG_SOSCCSR_SOSCCM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCCM_SHIFT)) & SCG_SOSCCSR_SOSCCM_MASK) - -#define SCG_SOSCCSR_SOSCCMRE_MASK (0x20000U) -#define SCG_SOSCCSR_SOSCCMRE_SHIFT (17U) -/*! SOSCCMRE - SOSC Clock Monitor Reset Enable - * 0b0..Clock monitor generates an interrupt when an error is detected - * 0b1..Clock monitor generates a reset when an error is detected - */ -#define SCG_SOSCCSR_SOSCCMRE(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCCMRE_SHIFT)) & SCG_SOSCCSR_SOSCCMRE_MASK) - -#define SCG_SOSCCSR_LK_MASK (0x800000U) -#define SCG_SOSCCSR_LK_SHIFT (23U) -/*! LK - Lock Register - * 0b0..This Control Status Register can be written - * 0b1..This Control Status Register cannot be written - */ -#define SCG_SOSCCSR_LK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_LK_SHIFT)) & SCG_SOSCCSR_LK_MASK) - -#define SCG_SOSCCSR_SOSCVLD_MASK (0x1000000U) -#define SCG_SOSCCSR_SOSCVLD_SHIFT (24U) -/*! SOSCVLD - SOSC Valid - * 0b0..SOSC is not enabled or clock is not valid - * 0b1..SOSC is enabled and output clock is valid - */ -#define SCG_SOSCCSR_SOSCVLD(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCVLD_SHIFT)) & SCG_SOSCCSR_SOSCVLD_MASK) - -#define SCG_SOSCCSR_SOSCSEL_MASK (0x2000000U) -#define SCG_SOSCCSR_SOSCSEL_SHIFT (25U) -/*! SOSCSEL - SOSC Selected - * 0b0..SOSC is not the system clock source - * 0b1..SOSC is the system clock source - */ -#define SCG_SOSCCSR_SOSCSEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCSEL_SHIFT)) & SCG_SOSCCSR_SOSCSEL_MASK) - -#define SCG_SOSCCSR_SOSCERR_MASK (0x4000000U) -#define SCG_SOSCCSR_SOSCERR_SHIFT (26U) -/*! SOSCERR - SOSC Clock Error - * 0b0..SOSC Clock Monitor is disabled or has not detected an error - * 0b1..SOSC Clock Monitor is enabled and detected an error - */ -#define SCG_SOSCCSR_SOSCERR(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCERR_SHIFT)) & SCG_SOSCCSR_SOSCERR_MASK) - -#define SCG_SOSCCSR_SOSCVLD_IE_MASK (0x40000000U) -#define SCG_SOSCCSR_SOSCVLD_IE_SHIFT (30U) -/*! SOSCVLD_IE - SOSC Valid Interrupt Enable - * 0b0..SOSCVLD interrupt is not enabled - * 0b1..SOSCVLD interrupt is enabled - */ -#define SCG_SOSCCSR_SOSCVLD_IE(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCVLD_IE_SHIFT)) & SCG_SOSCCSR_SOSCVLD_IE_MASK) -/*! @} */ - -/*! @name SOSCCFG - SOSC Configuration Register */ -/*! @{ */ - -#define SCG_SOSCCFG_EREFS_MASK (0x4U) -#define SCG_SOSCCFG_EREFS_SHIFT (2U) -/*! EREFS - External Reference Select - * 0b0..External reference clock selected. LDO can be disabled in this case. - * 0b1..Internal crystal oscillator of OSC selected. - */ -#define SCG_SOSCCFG_EREFS(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCFG_EREFS_SHIFT)) & SCG_SOSCCFG_EREFS_MASK) - -#define SCG_SOSCCFG_RANGE_MASK (0x30U) -#define SCG_SOSCCFG_RANGE_SHIFT (4U) -/*! RANGE - SOSC Range Select - * 0b00..Frequency range select of 16-20 MHz. - * 0b01..Frequency range select of 20-30 MHz. - * 0b10..Frequency range select of 30-50 MHz. - * 0b11..Frequency range select of 50-66 MHz. - */ -#define SCG_SOSCCFG_RANGE(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCFG_RANGE_SHIFT)) & SCG_SOSCCFG_RANGE_MASK) -/*! @} */ - -/*! @name SIRCCSR - SIRC Control Status Register */ -/*! @{ */ - -#define SCG_SIRCCSR_SIRCSTEN_MASK (0x2U) -#define SCG_SIRCCSR_SIRCSTEN_SHIFT (1U) -/*! SIRCSTEN - SIRC Stop Enable - * 0b0..SIRC is disabled in Deep Sleep mode - * 0b1..SIRC is enabled in Deep Sleep mode - */ -#define SCG_SIRCCSR_SIRCSTEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCSTEN_SHIFT)) & SCG_SIRCCSR_SIRCSTEN_MASK) - -#define SCG_SIRCCSR_SIRC_CLK_PERIPH_EN_MASK (0x20U) -#define SCG_SIRCCSR_SIRC_CLK_PERIPH_EN_SHIFT (5U) -/*! SIRC_CLK_PERIPH_EN - SIRC Clock to Peripherals Enable - * 0b0..SIRC clock to peripherals is disabled - * 0b1..SIRC clock to peripherals is enabled - */ -#define SCG_SIRCCSR_SIRC_CLK_PERIPH_EN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRC_CLK_PERIPH_EN_SHIFT)) & SCG_SIRCCSR_SIRC_CLK_PERIPH_EN_MASK) - -#define SCG_SIRCCSR_SIRCTREN_MASK (0x100U) -#define SCG_SIRCCSR_SIRCTREN_SHIFT (8U) -/*! SIRCTREN - SIRC 12 MHz Trim Enable (SIRCCFG[RANGE]=1) - * 0b0..Disables trimming SIRC to an external clock source - * 0b1..Enables trimming SIRC to an external clock source - */ -#define SCG_SIRCCSR_SIRCTREN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCTREN_SHIFT)) & SCG_SIRCCSR_SIRCTREN_MASK) - -#define SCG_SIRCCSR_SIRCTRUP_MASK (0x200U) -#define SCG_SIRCCSR_SIRCTRUP_SHIFT (9U) -/*! SIRCTRUP - SIRC Trim Update - * 0b0..Disables SIRC trimming updates - * 0b1..Enables SIRC trimming updates - */ -#define SCG_SIRCCSR_SIRCTRUP(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCTRUP_SHIFT)) & SCG_SIRCCSR_SIRCTRUP_MASK) - -#define SCG_SIRCCSR_TRIM_LOCK_MASK (0x400U) -#define SCG_SIRCCSR_TRIM_LOCK_SHIFT (10U) -/*! TRIM_LOCK - SIRC TRIM LOCK - * 0b0..SIRC auto trim not locked to target frequency range - * 0b1..SIRC auto trim locked to target frequency range - */ -#define SCG_SIRCCSR_TRIM_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_TRIM_LOCK_SHIFT)) & SCG_SIRCCSR_TRIM_LOCK_MASK) - -#define SCG_SIRCCSR_COARSE_TRIM_BYPASS_MASK (0x800U) -#define SCG_SIRCCSR_COARSE_TRIM_BYPASS_SHIFT (11U) -/*! COARSE_TRIM_BYPASS - Coarse Auto Trim Bypass - * 0b0..SIRC coarse auto-trim is not bypassed - * 0b1..SIRC coarse auto-trim is bypassed - */ -#define SCG_SIRCCSR_COARSE_TRIM_BYPASS(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_COARSE_TRIM_BYPASS_SHIFT)) & SCG_SIRCCSR_COARSE_TRIM_BYPASS_MASK) - -#define SCG_SIRCCSR_LK_MASK (0x800000U) -#define SCG_SIRCCSR_LK_SHIFT (23U) -/*! LK - Lock Register - * 0b0..Control Status Register can be written - * 0b1..Control Status Register cannot be written - */ -#define SCG_SIRCCSR_LK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_LK_SHIFT)) & SCG_SIRCCSR_LK_MASK) - -#define SCG_SIRCCSR_SIRCVLD_MASK (0x1000000U) -#define SCG_SIRCCSR_SIRCVLD_SHIFT (24U) -/*! SIRCVLD - SIRC Valid - * 0b0..SIRC is not enabled or clock is not valid - * 0b1..SIRC is enabled and output clock is valid - */ -#define SCG_SIRCCSR_SIRCVLD(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCVLD_SHIFT)) & SCG_SIRCCSR_SIRCVLD_MASK) - -#define SCG_SIRCCSR_SIRCSEL_MASK (0x2000000U) -#define SCG_SIRCCSR_SIRCSEL_SHIFT (25U) -/*! SIRCSEL - SIRC Selected - * 0b0..SIRC is not the system clock source - * 0b1..SIRC is the system clock source - */ -#define SCG_SIRCCSR_SIRCSEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCSEL_SHIFT)) & SCG_SIRCCSR_SIRCSEL_MASK) - -#define SCG_SIRCCSR_SIRCERR_MASK (0x4000000U) -#define SCG_SIRCCSR_SIRCERR_SHIFT (26U) -/*! SIRCERR - SIRC Clock Error - * 0b0..Error not detected with the SIRC trimming - * 0b1..Error detected with the SIRC trimming - */ -#define SCG_SIRCCSR_SIRCERR(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCERR_SHIFT)) & SCG_SIRCCSR_SIRCERR_MASK) - -#define SCG_SIRCCSR_SIRCERR_IE_MASK (0x8000000U) -#define SCG_SIRCCSR_SIRCERR_IE_SHIFT (27U) -/*! SIRCERR_IE - SIRC Clock Error Interrupt Enable - * 0b0..SIRCERR interrupt is not enabled - * 0b1..SIRCERR interrupt is enabled - */ -#define SCG_SIRCCSR_SIRCERR_IE(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCERR_IE_SHIFT)) & SCG_SIRCCSR_SIRCERR_IE_MASK) -/*! @} */ - -/*! @name SIRCTCFG - SIRC Trim Configuration Register */ -/*! @{ */ - -#define SCG_SIRCTCFG_TRIMSRC_MASK (0x3U) -#define SCG_SIRCTCFG_TRIMSRC_SHIFT (0U) -/*! TRIMSRC - Trim Source - * 0b00..Reserved - * 0b01..Reserved - * 0b10..SOSC - * 0b11..ROSC (32.768 kHz) - */ -#define SCG_SIRCTCFG_TRIMSRC(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCTCFG_TRIMSRC_SHIFT)) & SCG_SIRCTCFG_TRIMSRC_MASK) - -#define SCG_SIRCTCFG_TRIMDIV_MASK (0x7F0000U) -#define SCG_SIRCTCFG_TRIMDIV_SHIFT (16U) -/*! TRIMDIV - SIRC Trim Predivider */ -#define SCG_SIRCTCFG_TRIMDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCTCFG_TRIMDIV_SHIFT)) & SCG_SIRCTCFG_TRIMDIV_MASK) -/*! @} */ - -/*! @name SIRCTRIM - SIRC Trim Register */ -/*! @{ */ - -#define SCG_SIRCTRIM_CCOTRIM_MASK (0x3FU) -#define SCG_SIRCTRIM_CCOTRIM_SHIFT (0U) -/*! CCOTRIM - CCO Trim */ -#define SCG_SIRCTRIM_CCOTRIM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCTRIM_CCOTRIM_SHIFT)) & SCG_SIRCTRIM_CCOTRIM_MASK) - -#define SCG_SIRCTRIM_CLTRIM_MASK (0x3F00U) -#define SCG_SIRCTRIM_CLTRIM_SHIFT (8U) -/*! CLTRIM - CL Trim */ -#define SCG_SIRCTRIM_CLTRIM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCTRIM_CLTRIM_SHIFT)) & SCG_SIRCTRIM_CLTRIM_MASK) - -#define SCG_SIRCTRIM_TCTRIM_MASK (0x1F0000U) -#define SCG_SIRCTRIM_TCTRIM_SHIFT (16U) -/*! TCTRIM - Trim Temp */ -#define SCG_SIRCTRIM_TCTRIM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCTRIM_TCTRIM_SHIFT)) & SCG_SIRCTRIM_TCTRIM_MASK) - -#define SCG_SIRCTRIM_FVCHTRIM_MASK (0x1F000000U) -#define SCG_SIRCTRIM_FVCHTRIM_SHIFT (24U) -#define SCG_SIRCTRIM_FVCHTRIM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCTRIM_FVCHTRIM_SHIFT)) & SCG_SIRCTRIM_FVCHTRIM_MASK) -/*! @} */ - -/*! @name SIRCSTAT - SIRC Auto-trimming Status Register */ -/*! @{ */ - -#define SCG_SIRCSTAT_CCOTRIM_MASK (0x3FU) -#define SCG_SIRCSTAT_CCOTRIM_SHIFT (0U) -/*! CCOTRIM - CCO Trim */ -#define SCG_SIRCSTAT_CCOTRIM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCSTAT_CCOTRIM_SHIFT)) & SCG_SIRCSTAT_CCOTRIM_MASK) - -#define SCG_SIRCSTAT_CLTRIM_MASK (0x3F00U) -#define SCG_SIRCSTAT_CLTRIM_SHIFT (8U) -/*! CLTRIM - CL Trim */ -#define SCG_SIRCSTAT_CLTRIM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCSTAT_CLTRIM_SHIFT)) & SCG_SIRCSTAT_CLTRIM_MASK) -/*! @} */ - -/*! @name FIRCCSR - FIRC Control Status Register */ -/*! @{ */ - -#define SCG_FIRCCSR_FIRCEN_MASK (0x1U) -#define SCG_FIRCCSR_FIRCEN_SHIFT (0U) -/*! FIRCEN - FIRC Enable - * 0b0..FIRC is disabled - * 0b1..FIRC is enabled - */ -#define SCG_FIRCCSR_FIRCEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCEN_SHIFT)) & SCG_FIRCCSR_FIRCEN_MASK) - -#define SCG_FIRCCSR_FIRCSTEN_MASK (0x2U) -#define SCG_FIRCCSR_FIRCSTEN_SHIFT (1U) -/*! FIRCSTEN - FIRC Stop Enable - * 0b0..FIRC is disabled in Deep Sleep mode - * 0b1..FIRC is enabled in Deep Sleep mode - */ -#define SCG_FIRCCSR_FIRCSTEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCSTEN_SHIFT)) & SCG_FIRCCSR_FIRCSTEN_MASK) - -#define SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_MASK (0x10U) -#define SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_SHIFT (4U) -/*! FIRC_SCLK_PERIPH_EN - FIRC 48 MHz Clock to peripherals Enable - * 0b0..FIRC 48 MHz to peripherals is disabled - * 0b1..FIRC 48 MHz to peripherals is enabled - */ -#define SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_SHIFT)) & SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_MASK) - -#define SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN_MASK (0x20U) -#define SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN_SHIFT (5U) -/*! FIRC_FCLK_PERIPH_EN - FIRC 144 MHz Clock to peripherals Enable - * 0b0..FIRC 144 MHz to peripherals is disabled - * 0b1..FIRC 144 MHz to peripherals is enabled - */ -#define SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN_SHIFT)) & SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN_MASK) - -#define SCG_FIRCCSR_FIRCTREN_MASK (0x100U) -#define SCG_FIRCCSR_FIRCTREN_SHIFT (8U) -/*! FIRCTREN - FIRC 144 MHz Trim Enable (FIRCCFG[RANGE]=1) - * 0b0..Disables trimming FIRC to an external clock source - * 0b1..Enables trimming FIRC to an external clock source - */ -#define SCG_FIRCCSR_FIRCTREN(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCTREN_SHIFT)) & SCG_FIRCCSR_FIRCTREN_MASK) - -#define SCG_FIRCCSR_FIRCTRUP_MASK (0x200U) -#define SCG_FIRCCSR_FIRCTRUP_SHIFT (9U) -/*! FIRCTRUP - FIRC Trim Update - * 0b0..Disables FIRC trimming updates - * 0b1..Enables FIRC trimming updates - */ -#define SCG_FIRCCSR_FIRCTRUP(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCTRUP_SHIFT)) & SCG_FIRCCSR_FIRCTRUP_MASK) - -#define SCG_FIRCCSR_TRIM_LOCK_MASK (0x400U) -#define SCG_FIRCCSR_TRIM_LOCK_SHIFT (10U) -/*! TRIM_LOCK - FIRC TRIM LOCK - * 0b0..FIRC auto trim not locked to target frequency range - * 0b1..FIRC auto trim locked to target frequency range - */ -#define SCG_FIRCCSR_TRIM_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_TRIM_LOCK_SHIFT)) & SCG_FIRCCSR_TRIM_LOCK_MASK) - -#define SCG_FIRCCSR_COARSE_TRIM_BYPASS_MASK (0x800U) -#define SCG_FIRCCSR_COARSE_TRIM_BYPASS_SHIFT (11U) -/*! COARSE_TRIM_BYPASS - Coarse Auto Trim Bypass - * 0b0..FIRC coarse auto trim is not bypassed - * 0b1..FIRC coarse auto trim is bypassed - */ -#define SCG_FIRCCSR_COARSE_TRIM_BYPASS(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_COARSE_TRIM_BYPASS_SHIFT)) & SCG_FIRCCSR_COARSE_TRIM_BYPASS_MASK) - -#define SCG_FIRCCSR_LK_MASK (0x800000U) -#define SCG_FIRCCSR_LK_SHIFT (23U) -/*! LK - Lock Register - * 0b0..Control Status Register can be written - * 0b1..Control Status Register cannot be written - */ -#define SCG_FIRCCSR_LK(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_LK_SHIFT)) & SCG_FIRCCSR_LK_MASK) - -#define SCG_FIRCCSR_FIRCVLD_MASK (0x1000000U) -#define SCG_FIRCCSR_FIRCVLD_SHIFT (24U) -/*! FIRCVLD - FIRC Valid status - * 0b0..FIRC is not enabled or clock is not valid. - * 0b1..FIRC is enabled and output clock is valid. The clock is valid after there is an output clock from the FIRC analog. - */ -#define SCG_FIRCCSR_FIRCVLD(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCVLD_SHIFT)) & SCG_FIRCCSR_FIRCVLD_MASK) - -#define SCG_FIRCCSR_FIRCSEL_MASK (0x2000000U) -#define SCG_FIRCCSR_FIRCSEL_SHIFT (25U) -/*! FIRCSEL - FIRC Selected - * 0b0..FIRC is not the system clock source - * 0b1..FIRC is the system clock source - */ -#define SCG_FIRCCSR_FIRCSEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCSEL_SHIFT)) & SCG_FIRCCSR_FIRCSEL_MASK) - -#define SCG_FIRCCSR_FIRCERR_MASK (0x4000000U) -#define SCG_FIRCCSR_FIRCERR_SHIFT (26U) -/*! FIRCERR - FIRC Clock Error - * 0b0..Error not detected with the FIRC trimming - * 0b1..Error detected with the FIRC trimming - */ -#define SCG_FIRCCSR_FIRCERR(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCERR_SHIFT)) & SCG_FIRCCSR_FIRCERR_MASK) - -#define SCG_FIRCCSR_FIRCERR_IE_MASK (0x8000000U) -#define SCG_FIRCCSR_FIRCERR_IE_SHIFT (27U) -/*! FIRCERR_IE - FIRC Clock Error Interrupt Enable - * 0b0..FIRCERR interrupt is not enabled - * 0b1..FIRCERR interrupt is enabled - */ -#define SCG_FIRCCSR_FIRCERR_IE(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCERR_IE_SHIFT)) & SCG_FIRCCSR_FIRCERR_IE_MASK) - -#define SCG_FIRCCSR_FIRCACC_IE_MASK (0x40000000U) -#define SCG_FIRCCSR_FIRCACC_IE_SHIFT (30U) -/*! FIRCACC_IE - FIRC Accurate Interrupt Enable - * 0b0..FIRCACC interrupt is not enabled - * 0b1..FIRCACC interrupt is enabled - */ -#define SCG_FIRCCSR_FIRCACC_IE(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCACC_IE_SHIFT)) & SCG_FIRCCSR_FIRCACC_IE_MASK) - -#define SCG_FIRCCSR_FIRCACC_MASK (0x80000000U) -#define SCG_FIRCCSR_FIRCACC_SHIFT (31U) -/*! FIRCACC - FIRC Frequency Accurate - * 0b0..FIRC is not enabled or clock is not accurate. - * 0b1..FIRC is enabled and output clock is accurate. The clock is accurate after 4096 clock cycles of 144 MHz - * (RANGE=1) or 1365 clock cycles of 48 MHz(RANGE=0) from the FIRC analog. - */ -#define SCG_FIRCCSR_FIRCACC(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCACC_SHIFT)) & SCG_FIRCCSR_FIRCACC_MASK) -/*! @} */ - -/*! @name FIRCCFG - FIRC Configuration Register */ -/*! @{ */ - -#define SCG_FIRCCFG_RANGE_MASK (0x1U) -#define SCG_FIRCCFG_RANGE_SHIFT (0U) -/*! RANGE - Frequency Range - * 0b0..48 MHz FIRC clock selected - * 0b1..144 MHz FIRC clock selected - */ -#define SCG_FIRCCFG_RANGE(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCFG_RANGE_SHIFT)) & SCG_FIRCCFG_RANGE_MASK) -/*! @} */ - -/*! @name FIRCTCFG - FIRC Trim Configuration Register */ -/*! @{ */ - -#define SCG_FIRCTCFG_TRIMSRC_MASK (0x3U) -#define SCG_FIRCTCFG_TRIMSRC_SHIFT (0U) -/*! TRIMSRC - Trim Source - * 0b00..USB0 Start of Frame (1 kHz). This option does not use TRIMDIV - * 0b01..Reserved - * 0b10..SOSC - * 0b11..ROSC - */ -#define SCG_FIRCTCFG_TRIMSRC(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTCFG_TRIMSRC_SHIFT)) & SCG_FIRCTCFG_TRIMSRC_MASK) - -#define SCG_FIRCTCFG_TRIMDIV_MASK (0x7F0000U) -#define SCG_FIRCTCFG_TRIMDIV_SHIFT (16U) -/*! TRIMDIV - FIRC Trim Predivider */ -#define SCG_FIRCTCFG_TRIMDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTCFG_TRIMDIV_SHIFT)) & SCG_FIRCTCFG_TRIMDIV_MASK) -/*! @} */ - -/*! @name FIRCTRIM - FIRC Trim Register */ -/*! @{ */ - -#define SCG_FIRCTRIM_TRIMFINE_MASK (0xFFU) -#define SCG_FIRCTRIM_TRIMFINE_SHIFT (0U) -/*! TRIMFINE - Trim Fine */ -#define SCG_FIRCTRIM_TRIMFINE(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTRIM_TRIMFINE_SHIFT)) & SCG_FIRCTRIM_TRIMFINE_MASK) - -#define SCG_FIRCTRIM_TRIMCOAR_MASK (0x3F00U) -#define SCG_FIRCTRIM_TRIMCOAR_SHIFT (8U) -/*! TRIMCOAR - Trim Coarse */ -#define SCG_FIRCTRIM_TRIMCOAR(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTRIM_TRIMCOAR_SHIFT)) & SCG_FIRCTRIM_TRIMCOAR_MASK) - -#define SCG_FIRCTRIM_TRIMTEMP_MASK (0x30000U) -#define SCG_FIRCTRIM_TRIMTEMP_SHIFT (16U) -/*! TRIMTEMP - Trim Temperature */ -#define SCG_FIRCTRIM_TRIMTEMP(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTRIM_TRIMTEMP_SHIFT)) & SCG_FIRCTRIM_TRIMTEMP_MASK) - -#define SCG_FIRCTRIM_TRIMSTART_MASK (0x3F000000U) -#define SCG_FIRCTRIM_TRIMSTART_SHIFT (24U) -/*! TRIMSTART - Trim Start */ -#define SCG_FIRCTRIM_TRIMSTART(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTRIM_TRIMSTART_SHIFT)) & SCG_FIRCTRIM_TRIMSTART_MASK) -/*! @} */ - -/*! @name FIRCSTAT - FIRC Auto-trimming Status Register */ -/*! @{ */ - -#define SCG_FIRCSTAT_TRIMFINE_MASK (0xFFU) -#define SCG_FIRCSTAT_TRIMFINE_SHIFT (0U) -/*! TRIMFINE - Trim Fine */ -#define SCG_FIRCSTAT_TRIMFINE(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCSTAT_TRIMFINE_SHIFT)) & SCG_FIRCSTAT_TRIMFINE_MASK) - -#define SCG_FIRCSTAT_TRIMCOAR_MASK (0x3F00U) -#define SCG_FIRCSTAT_TRIMCOAR_SHIFT (8U) -/*! TRIMCOAR - Trim Coarse */ -#define SCG_FIRCSTAT_TRIMCOAR(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCSTAT_TRIMCOAR_SHIFT)) & SCG_FIRCSTAT_TRIMCOAR_MASK) -/*! @} */ - -/*! @name ROSCCSR - ROSC Control Status Register */ -/*! @{ */ - -#define SCG_ROSCCSR_ROSCCM_MASK (0x10000U) -#define SCG_ROSCCSR_ROSCCM_SHIFT (16U) -/*! ROSCCM - ROSC Clock Monitor - * 0b0..ROSC clock monitor is disabled - * 0b1..ROSC clock monitor is enabled - */ -#define SCG_ROSCCSR_ROSCCM(x) (((uint32_t)(((uint32_t)(x)) << SCG_ROSCCSR_ROSCCM_SHIFT)) & SCG_ROSCCSR_ROSCCM_MASK) - -#define SCG_ROSCCSR_ROSCCMRE_MASK (0x20000U) -#define SCG_ROSCCSR_ROSCCMRE_SHIFT (17U) -/*! ROSCCMRE - ROSC Clock Monitor Reset Enable - * 0b0..Clock monitor generates an interrupt when an error is detected - * 0b1..Clock monitor generates a reset when an error is detected - */ -#define SCG_ROSCCSR_ROSCCMRE(x) (((uint32_t)(((uint32_t)(x)) << SCG_ROSCCSR_ROSCCMRE_SHIFT)) & SCG_ROSCCSR_ROSCCMRE_MASK) - -#define SCG_ROSCCSR_LK_MASK (0x800000U) -#define SCG_ROSCCSR_LK_SHIFT (23U) -/*! LK - Lock Register - * 0b0..Control Status Register can be written - * 0b1..Control Status Register cannot be written - */ -#define SCG_ROSCCSR_LK(x) (((uint32_t)(((uint32_t)(x)) << SCG_ROSCCSR_LK_SHIFT)) & SCG_ROSCCSR_LK_MASK) - -#define SCG_ROSCCSR_ROSCVLD_MASK (0x1000000U) -#define SCG_ROSCCSR_ROSCVLD_SHIFT (24U) -/*! ROSCVLD - ROSC Valid - * 0b0..ROSC is not enabled or clock is not valid - * 0b1..ROSC is enabled and output clock is valid - */ -#define SCG_ROSCCSR_ROSCVLD(x) (((uint32_t)(((uint32_t)(x)) << SCG_ROSCCSR_ROSCVLD_SHIFT)) & SCG_ROSCCSR_ROSCVLD_MASK) - -#define SCG_ROSCCSR_ROSCSEL_MASK (0x2000000U) -#define SCG_ROSCCSR_ROSCSEL_SHIFT (25U) -/*! ROSCSEL - ROSC Selected - * 0b0..ROSC is not the system clock source - * 0b1..ROSC is the system clock source - */ -#define SCG_ROSCCSR_ROSCSEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_ROSCCSR_ROSCSEL_SHIFT)) & SCG_ROSCCSR_ROSCSEL_MASK) - -#define SCG_ROSCCSR_ROSCERR_MASK (0x4000000U) -#define SCG_ROSCCSR_ROSCERR_SHIFT (26U) -/*! ROSCERR - ROSC Clock Error - * 0b0..ROSC Clock Monitor is disabled or has not detected an error - * 0b1..ROSC Clock Monitor is enabled and detected an RTC loss of clock error - */ -#define SCG_ROSCCSR_ROSCERR(x) (((uint32_t)(((uint32_t)(x)) << SCG_ROSCCSR_ROSCERR_SHIFT)) & SCG_ROSCCSR_ROSCERR_MASK) -/*! @} */ - -/*! @name APLLCSR - APLL Control Status Register */ -/*! @{ */ - -#define SCG_APLLCSR_APLLPWREN_MASK (0x1U) -#define SCG_APLLCSR_APLLPWREN_SHIFT (0U) -/*! APLLPWREN - APLL Power Enable - * 0b0..APLL clock is powered off - * 0b1..APLL clock is powered on - */ -#define SCG_APLLCSR_APLLPWREN(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_APLLPWREN_SHIFT)) & SCG_APLLCSR_APLLPWREN_MASK) - -#define SCG_APLLCSR_APLLCLKEN_MASK (0x2U) -#define SCG_APLLCSR_APLLCLKEN_SHIFT (1U) -/*! APLLCLKEN - APLL Clock Enable - * 0b0..APLL clock is disabled - * 0b1..APLL clock is enabled - */ -#define SCG_APLLCSR_APLLCLKEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_APLLCLKEN_SHIFT)) & SCG_APLLCSR_APLLCLKEN_MASK) - -#define SCG_APLLCSR_APLLSTEN_MASK (0x4U) -#define SCG_APLLCSR_APLLSTEN_SHIFT (2U) -/*! APLLSTEN - APLL Stop Enable - * 0b0..APLL is disabled in Deep Sleep mode - * 0b1..APLL is enabled in Deep Sleep mode - */ -#define SCG_APLLCSR_APLLSTEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_APLLSTEN_SHIFT)) & SCG_APLLCSR_APLLSTEN_MASK) - -#define SCG_APLLCSR_APLLCM_MASK (0x10000U) -#define SCG_APLLCSR_APLLCM_SHIFT (16U) -/*! APLLCM - APLL Clock Monitor - * 0b0..APLL Clock Monitor is disabled - * 0b1..APLL Clock Monitor is enabled - */ -#define SCG_APLLCSR_APLLCM(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_APLLCM_SHIFT)) & SCG_APLLCSR_APLLCM_MASK) - -#define SCG_APLLCSR_APLLCMRE_MASK (0x20000U) -#define SCG_APLLCSR_APLLCMRE_SHIFT (17U) -/*! APLLCMRE - APLL Clock Monitor Reset Enable - * 0b0..Clock monitor generates an interrupt when an error is detected - * 0b1..Clock monitor generates a reset when an error is detected - */ -#define SCG_APLLCSR_APLLCMRE(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_APLLCMRE_SHIFT)) & SCG_APLLCSR_APLLCMRE_MASK) - -#define SCG_APLLCSR_LK_MASK (0x800000U) -#define SCG_APLLCSR_LK_SHIFT (23U) -/*! LK - Lock Register - * 0b0..Control Status Register can be written - * 0b1..Control Status Register cannot be written - */ -#define SCG_APLLCSR_LK(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_LK_SHIFT)) & SCG_APLLCSR_LK_MASK) - -#define SCG_APLLCSR_APLL_LOCK_MASK (0x1000000U) -#define SCG_APLLCSR_APLL_LOCK_SHIFT (24U) -/*! APLL_LOCK - APLL LOCK - * 0b0..APLL is not powered on or not locked - * 0b1..APLL is locked - */ -#define SCG_APLLCSR_APLL_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_APLL_LOCK_SHIFT)) & SCG_APLLCSR_APLL_LOCK_MASK) - -#define SCG_APLLCSR_APLLSEL_MASK (0x2000000U) -#define SCG_APLLCSR_APLLSEL_SHIFT (25U) -/*! APLLSEL - APLL Selected - * 0b0..APLL is not the system clock source - * 0b1..APLL is the system clock source - */ -#define SCG_APLLCSR_APLLSEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_APLLSEL_SHIFT)) & SCG_APLLCSR_APLLSEL_MASK) - -#define SCG_APLLCSR_APLLERR_MASK (0x4000000U) -#define SCG_APLLCSR_APLLERR_SHIFT (26U) -/*! APLLERR - APLL Clock Error - * 0b0..APLL Clock Monitor is disabled or has not detected an error - * 0b1..APLL Clock Monitor is enabled and detected an error - */ -#define SCG_APLLCSR_APLLERR(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_APLLERR_SHIFT)) & SCG_APLLCSR_APLLERR_MASK) - -#define SCG_APLLCSR_APLL_LOCK_IE_MASK (0x40000000U) -#define SCG_APLLCSR_APLL_LOCK_IE_SHIFT (30U) -/*! APLL_LOCK_IE - APLL LOCK Interrupt Enable - * 0b0..APLL_LOCK interrupt is not enabled - * 0b1..APLL_LOCK interrupt is enabled - */ -#define SCG_APLLCSR_APLL_LOCK_IE(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_APLL_LOCK_IE_SHIFT)) & SCG_APLLCSR_APLL_LOCK_IE_MASK) -/*! @} */ - -/*! @name APLLCTRL - APLL Control Register */ -/*! @{ */ - -#define SCG_APLLCTRL_SELR_MASK (0xFU) -#define SCG_APLLCTRL_SELR_SHIFT (0U) -/*! SELR - Bandwidth select R (resistor) value. */ -#define SCG_APLLCTRL_SELR(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCTRL_SELR_SHIFT)) & SCG_APLLCTRL_SELR_MASK) - -#define SCG_APLLCTRL_SELI_MASK (0x3F0U) -#define SCG_APLLCTRL_SELI_SHIFT (4U) -/*! SELI - Bandwidth select I (integration) value. */ -#define SCG_APLLCTRL_SELI(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCTRL_SELI_SHIFT)) & SCG_APLLCTRL_SELI_MASK) - -#define SCG_APLLCTRL_SELP_MASK (0x7C00U) -#define SCG_APLLCTRL_SELP_SHIFT (10U) -/*! SELP - Bandwidth select P (proportional) value. */ -#define SCG_APLLCTRL_SELP(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCTRL_SELP_SHIFT)) & SCG_APLLCTRL_SELP_MASK) - -#define SCG_APLLCTRL_BYPASSPOSTDIV2_MASK (0x10000U) -#define SCG_APLLCTRL_BYPASSPOSTDIV2_SHIFT (16U) -/*! BYPASSPOSTDIV2 - Bypass of Divide-by-2 Divider - * 0b0..Use the divide-by-2 divider in the postdivider - * 0b1..Bypass of the divide-by-2 divider in the postdivider - */ -#define SCG_APLLCTRL_BYPASSPOSTDIV2(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCTRL_BYPASSPOSTDIV2_SHIFT)) & SCG_APLLCTRL_BYPASSPOSTDIV2_MASK) - -#define SCG_APLLCTRL_LIMUPOFF_MASK (0x20000U) -#define SCG_APLLCTRL_LIMUPOFF_SHIFT (17U) -/*! LIMUPOFF - Up Limiter - * 0b0..Application set to non-Spectrum and Fractional applications. - * 0b1..Application set to Spectrum and Fractional applications. - */ -#define SCG_APLLCTRL_LIMUPOFF(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCTRL_LIMUPOFF_SHIFT)) & SCG_APLLCTRL_LIMUPOFF_MASK) - -#define SCG_APLLCTRL_BANDDIRECT_MASK (0x40000U) -#define SCG_APLLCTRL_BANDDIRECT_SHIFT (18U) -/*! BANDDIRECT - Control of the bandwidth of the PLL. - * 0b0..The bandwidth is changed synchronously with the feedback-divider - * 0b1..Modifies the bandwidth of the PLL directly - */ -#define SCG_APLLCTRL_BANDDIRECT(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCTRL_BANDDIRECT_SHIFT)) & SCG_APLLCTRL_BANDDIRECT_MASK) - -#define SCG_APLLCTRL_BYPASSPREDIV_MASK (0x80000U) -#define SCG_APLLCTRL_BYPASSPREDIV_SHIFT (19U) -/*! BYPASSPREDIV - Bypass of the predivider - * 0b0..Use the predivider. - * 0b1..Bypass of the predivider. - */ -#define SCG_APLLCTRL_BYPASSPREDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCTRL_BYPASSPREDIV_SHIFT)) & SCG_APLLCTRL_BYPASSPREDIV_MASK) - -#define SCG_APLLCTRL_BYPASSPOSTDIV_MASK (0x100000U) -#define SCG_APLLCTRL_BYPASSPOSTDIV_SHIFT (20U) -/*! BYPASSPOSTDIV - Bypass of the postdivider - * 0b0..Use the postdivider. - * 0b1..Bypass of the postdivider - */ -#define SCG_APLLCTRL_BYPASSPOSTDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCTRL_BYPASSPOSTDIV_SHIFT)) & SCG_APLLCTRL_BYPASSPOSTDIV_MASK) - -#define SCG_APLLCTRL_SOURCE_MASK (0x6000000U) -#define SCG_APLLCTRL_SOURCE_SHIFT (25U) -/*! SOURCE - Clock Source - * 0b00..SOSC - * 0b01..FIRC 48 MHz clock. FIRC_SCLK_PERIPH_EN must be set to use FIRC 48 MHz clock. - * 0b10..Reserved - * 0b11..No clock - */ -#define SCG_APLLCTRL_SOURCE(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCTRL_SOURCE_SHIFT)) & SCG_APLLCTRL_SOURCE_MASK) -/*! @} */ - -/*! @name APLLSTAT - APLL Status Register */ -/*! @{ */ - -#define SCG_APLLSTAT_NDIVACK_MASK (0x2U) -#define SCG_APLLSTAT_NDIVACK_SHIFT (1U) -/*! NDIVACK - Predivider(N) ratio change acknowledge. - * 0b0..The predivider (N) ratio change is not accepted by the analog PLL - * 0b1..The predivider (N) ratio change is accepted by the analog PLL - */ -#define SCG_APLLSTAT_NDIVACK(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSTAT_NDIVACK_SHIFT)) & SCG_APLLSTAT_NDIVACK_MASK) - -#define SCG_APLLSTAT_MDIVACK_MASK (0x4U) -#define SCG_APLLSTAT_MDIVACK_SHIFT (2U) -/*! MDIVACK - Feedback(M) divider ratio change acknowledge. - * 0b0..The feedback (M) ratio change is not accepted by the analog PLL - * 0b1..The feedback (M) ratio change is accepted by the analog PLL - */ -#define SCG_APLLSTAT_MDIVACK(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSTAT_MDIVACK_SHIFT)) & SCG_APLLSTAT_MDIVACK_MASK) - -#define SCG_APLLSTAT_PDIVACK_MASK (0x8U) -#define SCG_APLLSTAT_PDIVACK_SHIFT (3U) -/*! PDIVACK - Postdivider(P) ratio change acknowledge. - * 0b0..The postdivider (P) ratio change is not accepted by the analog PLL - * 0b1..The postdivider (P) ratio change is accepted by the analog PLL - */ -#define SCG_APLLSTAT_PDIVACK(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSTAT_PDIVACK_SHIFT)) & SCG_APLLSTAT_PDIVACK_MASK) -/*! @} */ - -/*! @name APLLNDIV - APLL N Divider Register */ -/*! @{ */ - -#define SCG_APLLNDIV_NDIV_MASK (0xFFU) -#define SCG_APLLNDIV_NDIV_SHIFT (0U) -/*! NDIV - Predivider divider ratio (N-divider). */ -#define SCG_APLLNDIV_NDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLNDIV_NDIV_SHIFT)) & SCG_APLLNDIV_NDIV_MASK) - -#define SCG_APLLNDIV_NREQ_MASK (0x80000000U) -#define SCG_APLLNDIV_NREQ_SHIFT (31U) -/*! NREQ - Predivider ratio change request. - * 0b0..Predivider ratio change is not requested - * 0b1..Predivider ratio change is requested - */ -#define SCG_APLLNDIV_NREQ(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLNDIV_NREQ_SHIFT)) & SCG_APLLNDIV_NREQ_MASK) -/*! @} */ - -/*! @name APLLMDIV - APLL M Divider Register */ -/*! @{ */ - -#define SCG_APLLMDIV_MDIV_MASK (0xFFFFU) -#define SCG_APLLMDIV_MDIV_SHIFT (0U) -/*! MDIV - Feedback divider divider ratio (M-divider). */ -#define SCG_APLLMDIV_MDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLMDIV_MDIV_SHIFT)) & SCG_APLLMDIV_MDIV_MASK) - -#define SCG_APLLMDIV_MREQ_MASK (0x80000000U) -#define SCG_APLLMDIV_MREQ_SHIFT (31U) -/*! MREQ - Feedback ratio change request. - * 0b0..Feedback ratio change is not requested - * 0b1..Feedback ratio change is requested - */ -#define SCG_APLLMDIV_MREQ(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLMDIV_MREQ_SHIFT)) & SCG_APLLMDIV_MREQ_MASK) -/*! @} */ - -/*! @name APLLPDIV - APLL P Divider Register */ -/*! @{ */ - -#define SCG_APLLPDIV_PDIV_MASK (0x1FU) -#define SCG_APLLPDIV_PDIV_SHIFT (0U) -/*! PDIV - Postdivider divider ratio (P-divider) */ -#define SCG_APLLPDIV_PDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLPDIV_PDIV_SHIFT)) & SCG_APLLPDIV_PDIV_MASK) - -#define SCG_APLLPDIV_PREQ_MASK (0x80000000U) -#define SCG_APLLPDIV_PREQ_SHIFT (31U) -/*! PREQ - Postdivider ratio change request - * 0b0..Postdivider ratio change is not requested - * 0b1..Postdivider ratio change is requested - */ -#define SCG_APLLPDIV_PREQ(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLPDIV_PREQ_SHIFT)) & SCG_APLLPDIV_PREQ_MASK) -/*! @} */ - -/*! @name APLLLOCK_CNFG - APLL LOCK Configuration Register */ -/*! @{ */ - -#define SCG_APLLLOCK_CNFG_LOCK_TIME_MASK (0x1FFFFU) -#define SCG_APLLLOCK_CNFG_LOCK_TIME_SHIFT (0U) -/*! LOCK_TIME - Configures the number of reference clocks to count before APLL is considered locked. */ -#define SCG_APLLLOCK_CNFG_LOCK_TIME(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLLOCK_CNFG_LOCK_TIME_SHIFT)) & SCG_APLLLOCK_CNFG_LOCK_TIME_MASK) -/*! @} */ - -/*! @name APLLSSCGSTAT - APLL SSCG Status Register */ -/*! @{ */ - -#define SCG_APLLSSCGSTAT_SS_MDIV_ACK_MASK (0x1U) -#define SCG_APLLSSCGSTAT_SS_MDIV_ACK_SHIFT (0U) -/*! SS_MDIV_ACK - SS_MDIV change acknowledge - * 0b0..The SS_MDIV, MF, MR, and MC ratio change is not accepted by the analog PLL - * 0b1..The SS_MDIV, MF, MR, and MC ratio change is accepted by the analog PLL - */ -#define SCG_APLLSSCGSTAT_SS_MDIV_ACK(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSSCGSTAT_SS_MDIV_ACK_SHIFT)) & SCG_APLLSSCGSTAT_SS_MDIV_ACK_MASK) -/*! @} */ - -/*! @name APLLSSCG0 - APLL Spread Spectrum Control 0 Register */ -/*! @{ */ - -#define SCG_APLLSSCG0_SS_MDIV_LSB_MASK (0xFFFFFFFFU) -#define SCG_APLLSSCG0_SS_MDIV_LSB_SHIFT (0U) -/*! SS_MDIV_LSB - SS_MDIV */ -#define SCG_APLLSSCG0_SS_MDIV_LSB(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSSCG0_SS_MDIV_LSB_SHIFT)) & SCG_APLLSSCG0_SS_MDIV_LSB_MASK) -/*! @} */ - -/*! @name APLLSSCG1 - APLL Spread Spectrum Control 1 Register */ -/*! @{ */ - -#define SCG_APLLSSCG1_SS_MDIV_MSB_MASK (0x1U) -#define SCG_APLLSSCG1_SS_MDIV_MSB_SHIFT (0U) -/*! SS_MDIV_MSB - SS_MDIV[32] */ -#define SCG_APLLSSCG1_SS_MDIV_MSB(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSSCG1_SS_MDIV_MSB_SHIFT)) & SCG_APLLSSCG1_SS_MDIV_MSB_MASK) - -#define SCG_APLLSSCG1_SS_MDIV_REQ_MASK (0x2U) -#define SCG_APLLSSCG1_SS_MDIV_REQ_SHIFT (1U) -/*! SS_MDIV_REQ - SS_MDIV[32:0] change request. - * 0b0..SS_MDIV change is not requested - * 0b1..SS_MDIV change is requested - */ -#define SCG_APLLSSCG1_SS_MDIV_REQ(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSSCG1_SS_MDIV_REQ_SHIFT)) & SCG_APLLSSCG1_SS_MDIV_REQ_MASK) - -#define SCG_APLLSSCG1_MF_MASK (0x1CU) -#define SCG_APLLSSCG1_MF_SHIFT (2U) -/*! MF - Modulation Frequency Control */ -#define SCG_APLLSSCG1_MF(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSSCG1_MF_SHIFT)) & SCG_APLLSSCG1_MF_MASK) - -#define SCG_APLLSSCG1_MR_MASK (0xE0U) -#define SCG_APLLSSCG1_MR_SHIFT (5U) -/*! MR - Modulation Depth Control */ -#define SCG_APLLSSCG1_MR(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSSCG1_MR_SHIFT)) & SCG_APLLSSCG1_MR_MASK) - -#define SCG_APLLSSCG1_MC_MASK (0x300U) -#define SCG_APLLSSCG1_MC_SHIFT (8U) -/*! MC - Modulation Waveform Control - * 0b00..MC[1:0] no compensation - * 0b11..MC[1:0] maximum compensation - */ -#define SCG_APLLSSCG1_MC(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSSCG1_MC_SHIFT)) & SCG_APLLSSCG1_MC_MASK) - -#define SCG_APLLSSCG1_DITHER_MASK (0x400U) -#define SCG_APLLSSCG1_DITHER_SHIFT (10U) -/*! DITHER - Dither Enable - * 0b0..Dither is not enabled - * 0b1..Dither is enabled - */ -#define SCG_APLLSSCG1_DITHER(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSSCG1_DITHER_SHIFT)) & SCG_APLLSSCG1_DITHER_MASK) - -#define SCG_APLLSSCG1_SEL_SS_MDIV_MASK (0x800U) -#define SCG_APLLSSCG1_SEL_SS_MDIV_SHIFT (11U) -/*! SEL_SS_MDIV - SS_MDIV select. - * 0b0..Feedback divider ratio is MDIV[15:0] - * 0b1..Feedback divider ratio is SS_MDIV[32:0] - */ -#define SCG_APLLSSCG1_SEL_SS_MDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSSCG1_SEL_SS_MDIV_SHIFT)) & SCG_APLLSSCG1_SEL_SS_MDIV_MASK) - -#define SCG_APLLSSCG1_SS_PD_MASK (0x80000000U) -#define SCG_APLLSSCG1_SS_PD_SHIFT (31U) -/*! SS_PD - SSCG Power Down - * 0b0..SSCG is powered on - * 0b1..SSCG is powered off - */ -#define SCG_APLLSSCG1_SS_PD(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSSCG1_SS_PD_SHIFT)) & SCG_APLLSSCG1_SS_PD_MASK) -/*! @} */ - -/*! @name APLL_OVRD - APLL Override Register */ -/*! @{ */ - -#define SCG_APLL_OVRD_APLLPWREN_OVRD_MASK (0x1U) -#define SCG_APLL_OVRD_APLLPWREN_OVRD_SHIFT (0U) -/*! APLLPWREN_OVRD - APLL Power Enable Override if APLL_OVRD_EN=1 - * 0b0..APLL clock is powered off - * 0b1..APLL clock is powered on - */ -#define SCG_APLL_OVRD_APLLPWREN_OVRD(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLL_OVRD_APLLPWREN_OVRD_SHIFT)) & SCG_APLL_OVRD_APLLPWREN_OVRD_MASK) - -#define SCG_APLL_OVRD_APLLCLKEN_OVRD_MASK (0x2U) -#define SCG_APLL_OVRD_APLLCLKEN_OVRD_SHIFT (1U) -/*! APLLCLKEN_OVRD - APLL Clock Enable Override if APLL_OVRD_EN=1 - * 0b0..APLL clock is disabled - * 0b1..APLL clock is enabled - */ -#define SCG_APLL_OVRD_APLLCLKEN_OVRD(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLL_OVRD_APLLCLKEN_OVRD_SHIFT)) & SCG_APLL_OVRD_APLLCLKEN_OVRD_MASK) - -#define SCG_APLL_OVRD_APLL_OVRD_EN_MASK (0x80000000U) -#define SCG_APLL_OVRD_APLL_OVRD_EN_SHIFT (31U) -/*! APLL_OVRD_EN - APLL Override Enable - * 0b0..APLL override is disabled - * 0b1..APLL override is enabled - */ -#define SCG_APLL_OVRD_APLL_OVRD_EN(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLL_OVRD_APLL_OVRD_EN_SHIFT)) & SCG_APLL_OVRD_APLL_OVRD_EN_MASK) -/*! @} */ - -/*! @name SPLLCSR - SPLL Control Status Register */ -/*! @{ */ - -#define SCG_SPLLCSR_SPLLPWREN_MASK (0x1U) -#define SCG_SPLLCSR_SPLLPWREN_SHIFT (0U) -/*! SPLLPWREN - SPLL Power Enable - * 0b0..SPLL clock is powered off - * 0b1..SPLL clock is powered on - */ -#define SCG_SPLLCSR_SPLLPWREN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_SPLLPWREN_SHIFT)) & SCG_SPLLCSR_SPLLPWREN_MASK) - -#define SCG_SPLLCSR_SPLLCLKEN_MASK (0x2U) -#define SCG_SPLLCSR_SPLLCLKEN_SHIFT (1U) -/*! SPLLCLKEN - SPLL Clock Enable - * 0b0..SPLL clock is disabled - * 0b1..SPLL clock is enabled - */ -#define SCG_SPLLCSR_SPLLCLKEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_SPLLCLKEN_SHIFT)) & SCG_SPLLCSR_SPLLCLKEN_MASK) - -#define SCG_SPLLCSR_SPLLSTEN_MASK (0x4U) -#define SCG_SPLLCSR_SPLLSTEN_SHIFT (2U) -/*! SPLLSTEN - SPLL Stop Enable - * 0b0..SPLL is disabled in Deep Sleep mode - * 0b1..SPLL is enabled in Deep Sleep mode - */ -#define SCG_SPLLCSR_SPLLSTEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_SPLLSTEN_SHIFT)) & SCG_SPLLCSR_SPLLSTEN_MASK) - -#define SCG_SPLLCSR_SPLLCM_MASK (0x10000U) -#define SCG_SPLLCSR_SPLLCM_SHIFT (16U) -/*! SPLLCM - SPLL Clock Monitor - * 0b0..SPLL Clock Monitor is disabled - * 0b1..SPLL Clock Monitor is enabled - */ -#define SCG_SPLLCSR_SPLLCM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_SPLLCM_SHIFT)) & SCG_SPLLCSR_SPLLCM_MASK) - -#define SCG_SPLLCSR_SPLLCMRE_MASK (0x20000U) -#define SCG_SPLLCSR_SPLLCMRE_SHIFT (17U) -/*! SPLLCMRE - SPLL Clock Monitor Reset Enable - * 0b0..Clock monitor generates an interrupt when an error is detected - * 0b1..Clock monitor generates a reset when an error is detected - */ -#define SCG_SPLLCSR_SPLLCMRE(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_SPLLCMRE_SHIFT)) & SCG_SPLLCSR_SPLLCMRE_MASK) - -#define SCG_SPLLCSR_LK_MASK (0x800000U) -#define SCG_SPLLCSR_LK_SHIFT (23U) -/*! LK - Lock Register - * 0b0..Control Status Register can be written - * 0b1..Control Status Register cannot be written - */ -#define SCG_SPLLCSR_LK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_LK_SHIFT)) & SCG_SPLLCSR_LK_MASK) - -#define SCG_SPLLCSR_SPLL_LOCK_MASK (0x1000000U) -#define SCG_SPLLCSR_SPLL_LOCK_SHIFT (24U) -/*! SPLL_LOCK - SPLL LOCK - * 0b0..SPLL is not powered on or not locked - * 0b1..SPLL is locked - */ -#define SCG_SPLLCSR_SPLL_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_SPLL_LOCK_SHIFT)) & SCG_SPLLCSR_SPLL_LOCK_MASK) - -#define SCG_SPLLCSR_SPLLSEL_MASK (0x2000000U) -#define SCG_SPLLCSR_SPLLSEL_SHIFT (25U) -/*! SPLLSEL - SPLL Selected - * 0b0..SPLL is not the system clock source - * 0b1..SPLL is the system clock source - */ -#define SCG_SPLLCSR_SPLLSEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_SPLLSEL_SHIFT)) & SCG_SPLLCSR_SPLLSEL_MASK) - -#define SCG_SPLLCSR_SPLLERR_MASK (0x4000000U) -#define SCG_SPLLCSR_SPLLERR_SHIFT (26U) -/*! SPLLERR - SPLL Clock Error - * 0b0..SPLL Clock Monitor is disabled or has not detected an error - * 0b1..SPLL Clock Monitor is enabled and detected an error - */ -#define SCG_SPLLCSR_SPLLERR(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_SPLLERR_SHIFT)) & SCG_SPLLCSR_SPLLERR_MASK) - -#define SCG_SPLLCSR_SPLL_LOCK_IE_MASK (0x40000000U) -#define SCG_SPLLCSR_SPLL_LOCK_IE_SHIFT (30U) -/*! SPLL_LOCK_IE - SPLL LOCK Interrupt Enable - * 0b0..SPLL_LOCK interrupt is not enabled - * 0b1..SPLL_LOCK interrupt is enabled - */ -#define SCG_SPLLCSR_SPLL_LOCK_IE(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_SPLL_LOCK_IE_SHIFT)) & SCG_SPLLCSR_SPLL_LOCK_IE_MASK) -/*! @} */ - -/*! @name SPLLCTRL - SPLL Control Register */ -/*! @{ */ - -#define SCG_SPLLCTRL_SELR_MASK (0xFU) -#define SCG_SPLLCTRL_SELR_SHIFT (0U) -/*! SELR - Bandwidth select R (resistor) value. */ -#define SCG_SPLLCTRL_SELR(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCTRL_SELR_SHIFT)) & SCG_SPLLCTRL_SELR_MASK) - -#define SCG_SPLLCTRL_SELI_MASK (0x3F0U) -#define SCG_SPLLCTRL_SELI_SHIFT (4U) -/*! SELI - Bandwidth select I (integration) value. */ -#define SCG_SPLLCTRL_SELI(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCTRL_SELI_SHIFT)) & SCG_SPLLCTRL_SELI_MASK) - -#define SCG_SPLLCTRL_SELP_MASK (0x7C00U) -#define SCG_SPLLCTRL_SELP_SHIFT (10U) -/*! SELP - Bandwidth select P (proportional) value. */ -#define SCG_SPLLCTRL_SELP(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCTRL_SELP_SHIFT)) & SCG_SPLLCTRL_SELP_MASK) - -#define SCG_SPLLCTRL_BYPASSPOSTDIV2_MASK (0x10000U) -#define SCG_SPLLCTRL_BYPASSPOSTDIV2_SHIFT (16U) -/*! BYPASSPOSTDIV2 - Bypass of Divide-by-2 Divider - * 0b0..Use the divide-by-2 divider in the postdivider. - * 0b1..Bypass of the divide-by-2 divider in the postdivider - */ -#define SCG_SPLLCTRL_BYPASSPOSTDIV2(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCTRL_BYPASSPOSTDIV2_SHIFT)) & SCG_SPLLCTRL_BYPASSPOSTDIV2_MASK) - -#define SCG_SPLLCTRL_LIMUPOFF_MASK (0x20000U) -#define SCG_SPLLCTRL_LIMUPOFF_SHIFT (17U) -/*! LIMUPOFF - Up Limiter. - * 0b0..Application set to non-Spectrum and Fractional applications. - * 0b1..Application set to Spectrum and Fractional applications. - */ -#define SCG_SPLLCTRL_LIMUPOFF(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCTRL_LIMUPOFF_SHIFT)) & SCG_SPLLCTRL_LIMUPOFF_MASK) - -#define SCG_SPLLCTRL_BANDDIRECT_MASK (0x40000U) -#define SCG_SPLLCTRL_BANDDIRECT_SHIFT (18U) -/*! BANDDIRECT - Control of the bandwidth of the PLL. - * 0b0..The bandwidth is changed synchronously with the feedback-divider - * 0b1..Modifies the bandwidth of the PLL directly - */ -#define SCG_SPLLCTRL_BANDDIRECT(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCTRL_BANDDIRECT_SHIFT)) & SCG_SPLLCTRL_BANDDIRECT_MASK) - -#define SCG_SPLLCTRL_BYPASSPREDIV_MASK (0x80000U) -#define SCG_SPLLCTRL_BYPASSPREDIV_SHIFT (19U) -/*! BYPASSPREDIV - Bypass of the predivider. - * 0b0..Use the predivider - * 0b1..Bypass of the predivider - */ -#define SCG_SPLLCTRL_BYPASSPREDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCTRL_BYPASSPREDIV_SHIFT)) & SCG_SPLLCTRL_BYPASSPREDIV_MASK) - -#define SCG_SPLLCTRL_BYPASSPOSTDIV_MASK (0x100000U) -#define SCG_SPLLCTRL_BYPASSPOSTDIV_SHIFT (20U) -/*! BYPASSPOSTDIV - Bypass of the postdivider. - * 0b0..Use the postdivider - * 0b1..Bypass of the postdivider - */ -#define SCG_SPLLCTRL_BYPASSPOSTDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCTRL_BYPASSPOSTDIV_SHIFT)) & SCG_SPLLCTRL_BYPASSPOSTDIV_MASK) - -#define SCG_SPLLCTRL_SOURCE_MASK (0x6000000U) -#define SCG_SPLLCTRL_SOURCE_SHIFT (25U) -/*! SOURCE - Clock Source - * 0b00..SOSC - * 0b01..FIRC 48 MHz clock. FIRC_SCLK_PERIPH_EN must be set to use FIRC 48 MHz clock. - * 0b10..Reserved - * 0b11..No clock - */ -#define SCG_SPLLCTRL_SOURCE(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCTRL_SOURCE_SHIFT)) & SCG_SPLLCTRL_SOURCE_MASK) -/*! @} */ - -/*! @name SPLLSTAT - SPLL Status Register */ -/*! @{ */ - -#define SCG_SPLLSTAT_NDIVACK_MASK (0x2U) -#define SCG_SPLLSTAT_NDIVACK_SHIFT (1U) -/*! NDIVACK - Predivider (N) ratio change acknowledge - * 0b0..The predivider (N) ratio change is not accepted by the analog PLL. - * 0b1..The predivider (N) ratio change is accepted by the analog PLL. - */ -#define SCG_SPLLSTAT_NDIVACK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSTAT_NDIVACK_SHIFT)) & SCG_SPLLSTAT_NDIVACK_MASK) - -#define SCG_SPLLSTAT_MDIVACK_MASK (0x4U) -#define SCG_SPLLSTAT_MDIVACK_SHIFT (2U) -/*! MDIVACK - Feedback (M) divider ratio change acknowledge - * 0b0..The feedback (M) ratio change is not accepted by the analog PLL. - * 0b1..The feedback (M) ratio change is accepted by the analog PLL. - */ -#define SCG_SPLLSTAT_MDIVACK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSTAT_MDIVACK_SHIFT)) & SCG_SPLLSTAT_MDIVACK_MASK) - -#define SCG_SPLLSTAT_PDIVACK_MASK (0x8U) -#define SCG_SPLLSTAT_PDIVACK_SHIFT (3U) -/*! PDIVACK - Postdivider (P) ratio change acknowledge - * 0b0..The postdivider (P) ratio change is not accepted by the analog PLL - * 0b1..The postdivider (P) ratio change is accepted by the analog PLL - */ -#define SCG_SPLLSTAT_PDIVACK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSTAT_PDIVACK_SHIFT)) & SCG_SPLLSTAT_PDIVACK_MASK) -/*! @} */ - -/*! @name SPLLNDIV - SPLL N Divider Register */ -/*! @{ */ - -#define SCG_SPLLNDIV_NDIV_MASK (0xFFU) -#define SCG_SPLLNDIV_NDIV_SHIFT (0U) -/*! NDIV - Predivider divider ratio (N-divider). */ -#define SCG_SPLLNDIV_NDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLNDIV_NDIV_SHIFT)) & SCG_SPLLNDIV_NDIV_MASK) - -#define SCG_SPLLNDIV_NREQ_MASK (0x80000000U) -#define SCG_SPLLNDIV_NREQ_SHIFT (31U) -/*! NREQ - Predivider ratio change request. - * 0b0..Predivider ratio change is not requested - * 0b1..Predivider ratio change is requested - */ -#define SCG_SPLLNDIV_NREQ(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLNDIV_NREQ_SHIFT)) & SCG_SPLLNDIV_NREQ_MASK) -/*! @} */ - -/*! @name SPLLMDIV - SPLL M Divider Register */ -/*! @{ */ - -#define SCG_SPLLMDIV_MDIV_MASK (0xFFFFU) -#define SCG_SPLLMDIV_MDIV_SHIFT (0U) -/*! MDIV - Feedback divider divider ratio (M-divider). */ -#define SCG_SPLLMDIV_MDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLMDIV_MDIV_SHIFT)) & SCG_SPLLMDIV_MDIV_MASK) - -#define SCG_SPLLMDIV_MREQ_MASK (0x80000000U) -#define SCG_SPLLMDIV_MREQ_SHIFT (31U) -/*! MREQ - Feedback ratio change request. - * 0b0..Feedback ratio change is not requested - * 0b1..Feedback ratio change is requested - */ -#define SCG_SPLLMDIV_MREQ(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLMDIV_MREQ_SHIFT)) & SCG_SPLLMDIV_MREQ_MASK) -/*! @} */ - -/*! @name SPLLPDIV - SPLL P Divider Register */ -/*! @{ */ - -#define SCG_SPLLPDIV_PDIV_MASK (0x1FU) -#define SCG_SPLLPDIV_PDIV_SHIFT (0U) -/*! PDIV - Postdivider divider ratio (P-divider) */ -#define SCG_SPLLPDIV_PDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLPDIV_PDIV_SHIFT)) & SCG_SPLLPDIV_PDIV_MASK) - -#define SCG_SPLLPDIV_PREQ_MASK (0x80000000U) -#define SCG_SPLLPDIV_PREQ_SHIFT (31U) -/*! PREQ - Postdivider ratio change request - * 0b0..Postdivider ratio change is not requested - * 0b1..Postdivider ratio change is requested - */ -#define SCG_SPLLPDIV_PREQ(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLPDIV_PREQ_SHIFT)) & SCG_SPLLPDIV_PREQ_MASK) -/*! @} */ - -/*! @name SPLLLOCK_CNFG - SPLL LOCK Configuration Register */ -/*! @{ */ - -#define SCG_SPLLLOCK_CNFG_LOCK_TIME_MASK (0x1FFFFU) -#define SCG_SPLLLOCK_CNFG_LOCK_TIME_SHIFT (0U) -/*! LOCK_TIME - Configures the number of reference clocks to count before SPLL is considered locked. */ -#define SCG_SPLLLOCK_CNFG_LOCK_TIME(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLLOCK_CNFG_LOCK_TIME_SHIFT)) & SCG_SPLLLOCK_CNFG_LOCK_TIME_MASK) -/*! @} */ - -/*! @name SPLLSSCGSTAT - SPLL SSCG Status Register */ -/*! @{ */ - -#define SCG_SPLLSSCGSTAT_SS_MDIV_ACK_MASK (0x1U) -#define SCG_SPLLSSCGSTAT_SS_MDIV_ACK_SHIFT (0U) -/*! SS_MDIV_ACK - SS_MDIV change acknowledge - * 0b0..The SS_MDIV, MF, MR, and MC ratio change is not accepted by the analog PLL - * 0b1..The SS_MDIV, MF, MR, and MC ratio change is accepted by the analog PLL - */ -#define SCG_SPLLSSCGSTAT_SS_MDIV_ACK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSSCGSTAT_SS_MDIV_ACK_SHIFT)) & SCG_SPLLSSCGSTAT_SS_MDIV_ACK_MASK) -/*! @} */ - -/*! @name SPLLSSCG0 - SPLL Spread Spectrum Control 0 Register */ -/*! @{ */ - -#define SCG_SPLLSSCG0_SS_MDIV_LSB_MASK (0xFFFFFFFFU) -#define SCG_SPLLSSCG0_SS_MDIV_LSB_SHIFT (0U) -/*! SS_MDIV_LSB - SS_MDIV[31:0] */ -#define SCG_SPLLSSCG0_SS_MDIV_LSB(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSSCG0_SS_MDIV_LSB_SHIFT)) & SCG_SPLLSSCG0_SS_MDIV_LSB_MASK) -/*! @} */ - -/*! @name SPLLSSCG1 - SPLL Spread Spectrum Control 1 Register */ -/*! @{ */ - -#define SCG_SPLLSSCG1_SS_MDIV_MSB_MASK (0x1U) -#define SCG_SPLLSSCG1_SS_MDIV_MSB_SHIFT (0U) -/*! SS_MDIV_MSB - SS_MDIV[32] */ -#define SCG_SPLLSSCG1_SS_MDIV_MSB(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSSCG1_SS_MDIV_MSB_SHIFT)) & SCG_SPLLSSCG1_SS_MDIV_MSB_MASK) - -#define SCG_SPLLSSCG1_SS_MDIV_REQ_MASK (0x2U) -#define SCG_SPLLSSCG1_SS_MDIV_REQ_SHIFT (1U) -/*! SS_MDIV_REQ - SS_MDIV[32:0] change request. - * 0b0..SS_MDIV change is not requested - * 0b1..SS_MDIV change is requested - */ -#define SCG_SPLLSSCG1_SS_MDIV_REQ(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSSCG1_SS_MDIV_REQ_SHIFT)) & SCG_SPLLSSCG1_SS_MDIV_REQ_MASK) - -#define SCG_SPLLSSCG1_MF_MASK (0x1CU) -#define SCG_SPLLSSCG1_MF_SHIFT (2U) -/*! MF - Modulation Frequency Control */ -#define SCG_SPLLSSCG1_MF(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSSCG1_MF_SHIFT)) & SCG_SPLLSSCG1_MF_MASK) - -#define SCG_SPLLSSCG1_MR_MASK (0xE0U) -#define SCG_SPLLSSCG1_MR_SHIFT (5U) -/*! MR - Modulation Depth Control */ -#define SCG_SPLLSSCG1_MR(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSSCG1_MR_SHIFT)) & SCG_SPLLSSCG1_MR_MASK) - -#define SCG_SPLLSSCG1_MC_MASK (0x300U) -#define SCG_SPLLSSCG1_MC_SHIFT (8U) -/*! MC - Modulation Waveform Control - * 0b00..MC[1:0] no compensation - * 0b11..MC[1:0] maximum compensation - */ -#define SCG_SPLLSSCG1_MC(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSSCG1_MC_SHIFT)) & SCG_SPLLSSCG1_MC_MASK) - -#define SCG_SPLLSSCG1_DITHER_MASK (0x400U) -#define SCG_SPLLSSCG1_DITHER_SHIFT (10U) -/*! DITHER - Dither Enable - * 0b0..Dither is not enabled - * 0b1..Dither is enabled - */ -#define SCG_SPLLSSCG1_DITHER(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSSCG1_DITHER_SHIFT)) & SCG_SPLLSSCG1_DITHER_MASK) - -#define SCG_SPLLSSCG1_SEL_SS_MDIV_MASK (0x800U) -#define SCG_SPLLSSCG1_SEL_SS_MDIV_SHIFT (11U) -/*! SEL_SS_MDIV - SS_MDIV select. - * 0b0..Feedback divider ratio is MDIV[15:0] - * 0b1..Feedback divider ratio is SS_MDIV[32:0] - */ -#define SCG_SPLLSSCG1_SEL_SS_MDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSSCG1_SEL_SS_MDIV_SHIFT)) & SCG_SPLLSSCG1_SEL_SS_MDIV_MASK) - -#define SCG_SPLLSSCG1_SS_PD_MASK (0x80000000U) -#define SCG_SPLLSSCG1_SS_PD_SHIFT (31U) -/*! SS_PD - SSCG Power Down - * 0b0..SSCG is powered on - * 0b1..SSCG is powered off - */ -#define SCG_SPLLSSCG1_SS_PD(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSSCG1_SS_PD_SHIFT)) & SCG_SPLLSSCG1_SS_PD_MASK) -/*! @} */ - -/*! @name SPLL_OVRD - SPLL Override Register */ -/*! @{ */ - -#define SCG_SPLL_OVRD_SPLLPWREN_OVRD_MASK (0x1U) -#define SCG_SPLL_OVRD_SPLLPWREN_OVRD_SHIFT (0U) -/*! SPLLPWREN_OVRD - SPLL Power Enable Override if SPLL_OVRD_EN=1 - * 0b0..SPLL clock is powered off - * 0b1..SPLL clock is powered on - */ -#define SCG_SPLL_OVRD_SPLLPWREN_OVRD(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLL_OVRD_SPLLPWREN_OVRD_SHIFT)) & SCG_SPLL_OVRD_SPLLPWREN_OVRD_MASK) - -#define SCG_SPLL_OVRD_SPLLCLKEN_OVRD_MASK (0x2U) -#define SCG_SPLL_OVRD_SPLLCLKEN_OVRD_SHIFT (1U) -/*! SPLLCLKEN_OVRD - SPLL Clock Enable Override if SPLL_OVRD_EN=1 - * 0b0..SPLL clock is disabled - * 0b1..SPLL clock is enabled - */ -#define SCG_SPLL_OVRD_SPLLCLKEN_OVRD(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLL_OVRD_SPLLCLKEN_OVRD_SHIFT)) & SCG_SPLL_OVRD_SPLLCLKEN_OVRD_MASK) - -#define SCG_SPLL_OVRD_SPLL_OVRD_EN_MASK (0x80000000U) -#define SCG_SPLL_OVRD_SPLL_OVRD_EN_SHIFT (31U) -/*! SPLL_OVRD_EN - SPLL Override Enable - * 0b0..SPLL override is disabled - * 0b1..SPLL override is enabled - */ -#define SCG_SPLL_OVRD_SPLL_OVRD_EN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLL_OVRD_SPLL_OVRD_EN_SHIFT)) & SCG_SPLL_OVRD_SPLL_OVRD_EN_MASK) -/*! @} */ - -/*! @name UPLLCSR - UPLL Control Status Register */ -/*! @{ */ - -#define SCG_UPLLCSR_UPLLCM_MASK (0x10000U) -#define SCG_UPLLCSR_UPLLCM_SHIFT (16U) -/*! UPLLCM - UPLL Clock Monitor - * 0b0..UPLL Clock Monitor is disabled - * 0b1..UPLL Clock Monitor is enabled - */ -#define SCG_UPLLCSR_UPLLCM(x) (((uint32_t)(((uint32_t)(x)) << SCG_UPLLCSR_UPLLCM_SHIFT)) & SCG_UPLLCSR_UPLLCM_MASK) - -#define SCG_UPLLCSR_UPLLCMRE_MASK (0x20000U) -#define SCG_UPLLCSR_UPLLCMRE_SHIFT (17U) -/*! UPLLCMRE - UPLL Clock Monitor Reset Enable - * 0b0..Clock monitor generates an interrupt when an error is detected - * 0b1..Clock monitor generates a reset when an error is detected - */ -#define SCG_UPLLCSR_UPLLCMRE(x) (((uint32_t)(((uint32_t)(x)) << SCG_UPLLCSR_UPLLCMRE_SHIFT)) & SCG_UPLLCSR_UPLLCMRE_MASK) - -#define SCG_UPLLCSR_LK_MASK (0x800000U) -#define SCG_UPLLCSR_LK_SHIFT (23U) -/*! LK - Lock Register - * 0b0..Control Status Register can be written - * 0b1..Control Status Register cannot be written - */ -#define SCG_UPLLCSR_LK(x) (((uint32_t)(((uint32_t)(x)) << SCG_UPLLCSR_LK_SHIFT)) & SCG_UPLLCSR_LK_MASK) - -#define SCG_UPLLCSR_UPLLVLD_MASK (0x1000000U) -#define SCG_UPLLCSR_UPLLVLD_SHIFT (24U) -/*! UPLLVLD - UPLL Valid - * 0b0..UPLL is not enabled or clock is not valid - * 0b1..UPLL is enabled and output clock is valid - */ -#define SCG_UPLLCSR_UPLLVLD(x) (((uint32_t)(((uint32_t)(x)) << SCG_UPLLCSR_UPLLVLD_SHIFT)) & SCG_UPLLCSR_UPLLVLD_MASK) - -#define SCG_UPLLCSR_UPLLSEL_MASK (0x2000000U) -#define SCG_UPLLCSR_UPLLSEL_SHIFT (25U) -/*! UPLLSEL - UPLL Selected - * 0b0..UPLL is not the system clock source - * 0b1..UPLL is the system clock source - */ -#define SCG_UPLLCSR_UPLLSEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_UPLLCSR_UPLLSEL_SHIFT)) & SCG_UPLLCSR_UPLLSEL_MASK) - -#define SCG_UPLLCSR_UPLLERR_MASK (0x4000000U) -#define SCG_UPLLCSR_UPLLERR_SHIFT (26U) -/*! UPLLERR - UPLL Clock Error - * 0b0..UPLL Clock Monitor is disabled or has not detected an error - * 0b1..UPLL Clock Monitor is enabled and detected an error - */ -#define SCG_UPLLCSR_UPLLERR(x) (((uint32_t)(((uint32_t)(x)) << SCG_UPLLCSR_UPLLERR_SHIFT)) & SCG_UPLLCSR_UPLLERR_MASK) -/*! @} */ - -/*! @name LDOCSR - LDO Control and Status Register */ -/*! @{ */ - -#define SCG_LDOCSR_LDOEN_MASK (0x1U) -#define SCG_LDOCSR_LDOEN_SHIFT (0U) -/*! LDOEN - LDO Enable - * 0b0..LDO is disabled - * 0b1..LDO is enabled - */ -#define SCG_LDOCSR_LDOEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_LDOCSR_LDOEN_SHIFT)) & SCG_LDOCSR_LDOEN_MASK) - -#define SCG_LDOCSR_VOUT_SEL_MASK (0xEU) -#define SCG_LDOCSR_VOUT_SEL_SHIFT (1U) -/*! VOUT_SEL - LDO output voltage select - * 0b000..VOUT = 1V - * 0b001..VOUT = 1V - * 0b010..VOUT = 1V - * 0b011..VOUT = 1.05V - * 0b100..VOUT = 1.1V - * 0b101..VOUT = 1.15V - * 0b110..VOUT = 1.2V - * 0b111..VOUT = 1.25V - */ -#define SCG_LDOCSR_VOUT_SEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_LDOCSR_VOUT_SEL_SHIFT)) & SCG_LDOCSR_VOUT_SEL_MASK) - -#define SCG_LDOCSR_LDOBYPASS_MASK (0x10U) -#define SCG_LDOCSR_LDOBYPASS_SHIFT (4U) -/*! LDOBYPASS - LDO Bypass - * 0b0..LDO is not bypassed - * 0b1..LDO is bypassed - */ -#define SCG_LDOCSR_LDOBYPASS(x) (((uint32_t)(((uint32_t)(x)) << SCG_LDOCSR_LDOBYPASS_SHIFT)) & SCG_LDOCSR_LDOBYPASS_MASK) - -#define SCG_LDOCSR_VOUT_OK_MASK (0x80000000U) -#define SCG_LDOCSR_VOUT_OK_SHIFT (31U) -/*! VOUT_OK - LDO VOUT OK Inform. - * 0b0..LDO output VOUT is not OK - * 0b1..LDO output VOUT is OK - */ -#define SCG_LDOCSR_VOUT_OK(x) (((uint32_t)(((uint32_t)(x)) << SCG_LDOCSR_VOUT_OK_SHIFT)) & SCG_LDOCSR_VOUT_OK_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group SCG_Register_Masks */ - - -/* SCG - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral SCG0 base address */ - #define SCG0_BASE (0x50044000u) - /** Peripheral SCG0 base address */ - #define SCG0_BASE_NS (0x40044000u) - /** Peripheral SCG0 base pointer */ - #define SCG0 ((SCG_Type *)SCG0_BASE) - /** Peripheral SCG0 base pointer */ - #define SCG0_NS ((SCG_Type *)SCG0_BASE_NS) - /** Array initializer of SCG peripheral base addresses */ - #define SCG_BASE_ADDRS { SCG0_BASE } - /** Array initializer of SCG peripheral base pointers */ - #define SCG_BASE_PTRS { SCG0 } - /** Array initializer of SCG peripheral base addresses */ - #define SCG_BASE_ADDRS_NS { SCG0_BASE_NS } - /** Array initializer of SCG peripheral base pointers */ - #define SCG_BASE_PTRS_NS { SCG0_NS } -#else - /** Peripheral SCG0 base address */ - #define SCG0_BASE (0x40044000u) - /** Peripheral SCG0 base pointer */ - #define SCG0 ((SCG_Type *)SCG0_BASE) - /** Array initializer of SCG peripheral base addresses */ - #define SCG_BASE_ADDRS { SCG0_BASE } - /** Array initializer of SCG peripheral base pointers */ - #define SCG_BASE_PTRS { SCG0 } -#endif - -/*! - * @} - */ /* end of group SCG_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- SCT Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SCT_Peripheral_Access_Layer SCT Peripheral Access Layer - * @{ - */ - -/** SCT - Register Layout Typedef */ -typedef struct { - __IO uint32_t CONFIG; /**< SCT Configuration, offset: 0x0 */ - union { /* offset: 0x4 */ - struct { /* offset: 0x4 */ - __IO uint16_t CTRLL; /**< SCT_CTRLL register, offset: 0x4 */ - __IO uint16_t CTRLH; /**< SCT_CTRLH register, offset: 0x6 */ - } CTRL_ACCESS16BIT; - __IO uint32_t CTRL; /**< SCT Control, offset: 0x4 */ - }; - union { /* offset: 0x8 */ - struct { /* offset: 0x8 */ - __IO uint16_t LIMITL; /**< SCT_LIMITL register, offset: 0x8 */ - __IO uint16_t LIMITH; /**< SCT_LIMITH register, offset: 0xA */ - } LIMIT_ACCESS16BIT; - __IO uint32_t LIMIT; /**< SCT Limit Event Select, offset: 0x8 */ - }; - union { /* offset: 0xC */ - struct { /* offset: 0xC */ - __IO uint16_t HALTL; /**< SCT_HALTL register, offset: 0xC */ - __IO uint16_t HALTH; /**< SCT_HALTH register, offset: 0xE */ - } HALT_ACCESS16BIT; - __IO uint32_t HALT; /**< Halt Event Select, offset: 0xC */ - }; - union { /* offset: 0x10 */ - struct { /* offset: 0x10 */ - __IO uint16_t STOPL; /**< SCT_STOPL register, offset: 0x10 */ - __IO uint16_t STOPH; /**< SCT_STOPH register, offset: 0x12 */ - } STOP_ACCESS16BIT; - __IO uint32_t STOP; /**< Stop Event Select, offset: 0x10 */ - }; - union { /* offset: 0x14 */ - struct { /* offset: 0x14 */ - __IO uint16_t STARTL; /**< SCT_STARTL register, offset: 0x14 */ - __IO uint16_t STARTH; /**< SCT_STARTH register, offset: 0x16 */ - } START_ACCESS16BIT; - __IO uint32_t START; /**< Start Event Select, offset: 0x14 */ - }; - __IO uint32_t DITHER; /**< Dither Condition, offset: 0x18 */ - uint8_t RESERVED_0[36]; - union { /* offset: 0x40 */ - struct { /* offset: 0x40 */ - __IO uint16_t COUNTL; /**< SCT_COUNTL register, offset: 0x40 */ - __IO uint16_t COUNTH; /**< SCT_COUNTH register, offset: 0x42 */ - } COUNT_ACCESS16BIT; - __IO uint32_t COUNT; /**< Counter Value, offset: 0x40 */ - }; - union { /* offset: 0x44 */ - struct { /* offset: 0x44 */ - __IO uint16_t STATEL; /**< SCT_STATEL register, offset: 0x44 */ - __IO uint16_t STATEH; /**< SCT_STATEH register, offset: 0x46 */ - } STATE_ACCESS16BIT; - __IO uint32_t STATE; /**< State Variable, offset: 0x44 */ - }; - __I uint32_t INPUT; /**< Input State, offset: 0x48 */ - union { /* offset: 0x4C */ - struct { /* offset: 0x4C */ - __IO uint16_t REGMODEL; /**< SCT_REGMODEL register, offset: 0x4C */ - __IO uint16_t REGMODEH; /**< SCT_REGMODEH register, offset: 0x4E */ - } REGMODE_ACCESS16BIT; - __IO uint32_t REGMODE; /**< Match and Capture Register Mode, offset: 0x4C */ - }; - __IO uint32_t OUTPUT; /**< Output State, offset: 0x50 */ - __IO uint32_t OUTPUTDIRCTRL; /**< Output Counter Direction Control, offset: 0x54 */ - __IO uint32_t RES; /**< Output Conflict Resolution, offset: 0x58 */ - __IO uint32_t DMAREQ0; /**< DMA Request 0, offset: 0x5C */ - __IO uint32_t DMAREQ1; /**< DMA Request 1, offset: 0x60 */ - uint8_t RESERVED_1[140]; - __IO uint32_t EVEN; /**< Event Interrupt Enable, offset: 0xF0 */ - __IO uint32_t EVFLAG; /**< Event Flag, offset: 0xF4 */ - __IO uint32_t CONEN; /**< Conflict Interrupt Enable, offset: 0xF8 */ - __IO uint32_t CONFLAG; /**< Conflict Flag, offset: 0xFC */ - union { /* offset: 0x100 */ - union { /* offset: 0x100, array step: 0x4 */ - struct { /* offset: 0x100, array step: 0x4 */ - __IO uint16_t CAPL; /**< SCT_CAPL register, array offset: 0x100, array step: 0x4 */ - __IO uint16_t CAPH; /**< SCT_CAPH register, array offset: 0x102, array step: 0x4 */ - } CAP_ACCESS16BIT[16]; - __IO uint32_t CAP[16]; /**< Capture Value, array offset: 0x100, array step: 0x4 */ - }; - union { /* offset: 0x100, array step: 0x4 */ - struct { /* offset: 0x100, array step: 0x4 */ - __IO uint16_t MATCHL; /**< SCT_MATCHL register, array offset: 0x100, array step: 0x4 */ - __IO uint16_t MATCHH; /**< SCT_MATCHH register, array offset: 0x102, array step: 0x4 */ - } MATCH_ACCESS16BIT[16]; - __IO uint32_t MATCH[16]; /**< Match Value, array offset: 0x100, array step: 0x4 */ - }; - }; - __IO uint32_t FRACMAT[6]; /**< Fractional Match, array offset: 0x140, array step: 0x4 */ - uint8_t RESERVED_2[168]; - union { /* offset: 0x200 */ - union { /* offset: 0x200, array step: 0x4 */ - struct { /* offset: 0x200, array step: 0x4 */ - __IO uint16_t CAPCTRLL; /**< SCT_CAPCTRLL register, array offset: 0x200, array step: 0x4 */ - __IO uint16_t CAPCTRLH; /**< SCT_CAPCTRLH register, array offset: 0x202, array step: 0x4 */ - } CAPCTRL_ACCESS16BIT[16]; - __IO uint32_t CAPCTRL[16]; /**< Capture Control, array offset: 0x200, array step: 0x4 */ - }; - union { /* offset: 0x200, array step: 0x4 */ - struct { /* offset: 0x200, array step: 0x4 */ - __IO uint16_t MATCHRELL; /**< SCT_MATCHRELL register, array offset: 0x200, array step: 0x4 */ - __IO uint16_t MATCHRELH; /**< SCT_MATCHRELH register, array offset: 0x202, array step: 0x4 */ - } MATCHREL_ACCESS16BIT[16]; - __IO uint32_t MATCHREL[16]; /**< Match Reload Value, array offset: 0x200, array step: 0x4 */ - }; - }; - __IO uint32_t FRACMATREL[6]; /**< Fractional Match Reload, array offset: 0x240, array step: 0x4 */ - uint8_t RESERVED_3[168]; - struct { /* offset: 0x300, array step: 0x8 */ - __IO uint32_t STATE; /**< Event n State, array offset: 0x300, array step: 0x8 */ - __IO uint32_t CTRL; /**< Event n Control, array offset: 0x304, array step: 0x8 */ - } EV[16]; - uint8_t RESERVED_4[384]; - struct { /* offset: 0x500, array step: 0x8 */ - __IO uint32_t SET; /**< Output n Set, array offset: 0x500, array step: 0x8 */ - __IO uint32_t CLR; /**< Output n Clear, array offset: 0x504, array step: 0x8 */ - } OUT[10]; -} SCT_Type; - -/* ---------------------------------------------------------------------------- - -- SCT Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SCT_Register_Masks SCT Register Masks - * @{ - */ - -/*! @name CONFIG - SCT Configuration */ -/*! @{ */ - -#define SCT_CONFIG_UNIFY_MASK (0x1U) -#define SCT_CONFIG_UNIFY_SHIFT (0U) -/*! UNIFY - SCT Operation - * 0b0..Dual counters, COUNTER_L and COUNTER_H - * 0b1..Unified counter - */ -#define SCT_CONFIG_UNIFY(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFIG_UNIFY_SHIFT)) & SCT_CONFIG_UNIFY_MASK) - -#define SCT_CONFIG_CLKMODE_MASK (0x6U) -#define SCT_CONFIG_CLKMODE_SHIFT (1U) -/*! CLKMODE - SCT Clock Mode - * 0b00..System Clock mode - * 0b01..Sampled System Clock mode - * 0b10..SCT Input Clock mode - * 0b11..Asynchronous mode - */ -#define SCT_CONFIG_CLKMODE(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFIG_CLKMODE_SHIFT)) & SCT_CONFIG_CLKMODE_MASK) - -#define SCT_CONFIG_CKSEL_MASK (0x78U) -#define SCT_CONFIG_CKSEL_SHIFT (3U) -/*! CKSEL - SCT Clock Select - * 0b0000..Rising edges on input 0 - * 0b0001..Falling edges on input 0 - * 0b0010..Rising edges on input 1 - * 0b0011..Falling edges on input 1 - * 0b0100..Rising edges on input 2 - * 0b0101..Falling edges on input 2 - * 0b0110..Rising edges on input 3 - * 0b0111..Falling edges on input 3 - * 0b1000..Rising edges on input 4 - * 0b1001..Falling edges on input 4 - * 0b1010..Rising edges on input 5 - * 0b1011..Falling edges on input 5 - * 0b1100..Rising edges on input 6 - * 0b1101..Falling edges on input 6 - * 0b1110..Rising edges on input 7 - * 0b1111..Falling edges on input 7 - */ -#define SCT_CONFIG_CKSEL(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFIG_CKSEL_SHIFT)) & SCT_CONFIG_CKSEL_MASK) - -#define SCT_CONFIG_NORELOAD_L_MASK (0x80U) -#define SCT_CONFIG_NORELOAD_L_SHIFT (7U) -/*! NORELOAD_L - No Reload Lower Match - * 0b0..Reloaded - * 0b1..Not reloaded - */ -#define SCT_CONFIG_NORELOAD_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFIG_NORELOAD_L_SHIFT)) & SCT_CONFIG_NORELOAD_L_MASK) - -#define SCT_CONFIG_NORELOAD_H_MASK (0x100U) -#define SCT_CONFIG_NORELOAD_H_SHIFT (8U) -/*! NORELOAD_H - No Reload Higher Match - * 0b0..Reloaded - * 0b1..Not reloaded - */ -#define SCT_CONFIG_NORELOAD_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFIG_NORELOAD_H_SHIFT)) & SCT_CONFIG_NORELOAD_H_MASK) - -#define SCT_CONFIG_INSYNC_MASK (0x1FE00U) -#define SCT_CONFIG_INSYNC_SHIFT (9U) -/*! INSYNC - Input Synchronization */ -#define SCT_CONFIG_INSYNC(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFIG_INSYNC_SHIFT)) & SCT_CONFIG_INSYNC_MASK) - -#define SCT_CONFIG_AUTOLIMIT_L_MASK (0x20000U) -#define SCT_CONFIG_AUTOLIMIT_L_SHIFT (17U) -/*! AUTOLIMIT_L - Auto Limit Lower - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_CONFIG_AUTOLIMIT_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFIG_AUTOLIMIT_L_SHIFT)) & SCT_CONFIG_AUTOLIMIT_L_MASK) - -#define SCT_CONFIG_AUTOLIMIT_H_MASK (0x40000U) -#define SCT_CONFIG_AUTOLIMIT_H_SHIFT (18U) -/*! AUTOLIMIT_H - Auto Limit Higher - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_CONFIG_AUTOLIMIT_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFIG_AUTOLIMIT_H_SHIFT)) & SCT_CONFIG_AUTOLIMIT_H_MASK) -/*! @} */ - -/*! @name CTRLL - SCT_CTRLL register */ -/*! @{ */ - -#define SCT_CTRLL_DOWN_L_MASK (0x1U) -#define SCT_CTRLL_DOWN_L_SHIFT (0U) -/*! DOWN_L - Down Counter Low - * 0b0..Up - * 0b1..Down - */ -#define SCT_CTRLL_DOWN_L(x) (((uint16_t)(((uint16_t)(x)) << SCT_CTRLL_DOWN_L_SHIFT)) & SCT_CTRLL_DOWN_L_MASK) - -#define SCT_CTRLL_STOP_L_MASK (0x2U) -#define SCT_CTRLL_STOP_L_SHIFT (1U) -/*! STOP_L - Stop Counter Low - * 0b0..Disabled - * 0b1..Enabled - */ -#define SCT_CTRLL_STOP_L(x) (((uint16_t)(((uint16_t)(x)) << SCT_CTRLL_STOP_L_SHIFT)) & SCT_CTRLL_STOP_L_MASK) - -#define SCT_CTRLL_HALT_L_MASK (0x4U) -#define SCT_CTRLL_HALT_L_SHIFT (2U) -/*! HALT_L - Halt Counter Low - * 0b0..Disabled - * 0b1..Enabled - */ -#define SCT_CTRLL_HALT_L(x) (((uint16_t)(((uint16_t)(x)) << SCT_CTRLL_HALT_L_SHIFT)) & SCT_CTRLL_HALT_L_MASK) - -#define SCT_CTRLL_CLRCTR_L_MASK (0x8U) -#define SCT_CTRLL_CLRCTR_L_SHIFT (3U) -/*! CLRCTR_L - Clear Counter Low */ -#define SCT_CTRLL_CLRCTR_L(x) (((uint16_t)(((uint16_t)(x)) << SCT_CTRLL_CLRCTR_L_SHIFT)) & SCT_CTRLL_CLRCTR_L_MASK) - -#define SCT_CTRLL_BIDIR_L_MASK (0x10U) -#define SCT_CTRLL_BIDIR_L_SHIFT (4U) -/*! BIDIR_L - Bidirectional Select Low - * 0b0..Up - * 0b1..Up-down - */ -#define SCT_CTRLL_BIDIR_L(x) (((uint16_t)(((uint16_t)(x)) << SCT_CTRLL_BIDIR_L_SHIFT)) & SCT_CTRLL_BIDIR_L_MASK) - -#define SCT_CTRLL_PRE_L_MASK (0x1FE0U) -#define SCT_CTRLL_PRE_L_SHIFT (5U) -/*! PRE_L - Prescaler for Low Counter */ -#define SCT_CTRLL_PRE_L(x) (((uint16_t)(((uint16_t)(x)) << SCT_CTRLL_PRE_L_SHIFT)) & SCT_CTRLL_PRE_L_MASK) -/*! @} */ - -/*! @name CTRLH - SCT_CTRLH register */ -/*! @{ */ - -#define SCT_CTRLH_DOWN_H_MASK (0x1U) -#define SCT_CTRLH_DOWN_H_SHIFT (0U) -/*! DOWN_H - Down Counter High - * 0b0..Up - * 0b1..Down - */ -#define SCT_CTRLH_DOWN_H(x) (((uint16_t)(((uint16_t)(x)) << SCT_CTRLH_DOWN_H_SHIFT)) & SCT_CTRLH_DOWN_H_MASK) - -#define SCT_CTRLH_STOP_H_MASK (0x2U) -#define SCT_CTRLH_STOP_H_SHIFT (1U) -/*! STOP_H - Stop Counter High - * 0b0..Disabled - * 0b1..Enabled - */ -#define SCT_CTRLH_STOP_H(x) (((uint16_t)(((uint16_t)(x)) << SCT_CTRLH_STOP_H_SHIFT)) & SCT_CTRLH_STOP_H_MASK) - -#define SCT_CTRLH_HALT_H_MASK (0x4U) -#define SCT_CTRLH_HALT_H_SHIFT (2U) -/*! HALT_H - Halt Counter High - * 0b0..Disable - * 0b1..Enable - */ -#define SCT_CTRLH_HALT_H(x) (((uint16_t)(((uint16_t)(x)) << SCT_CTRLH_HALT_H_SHIFT)) & SCT_CTRLH_HALT_H_MASK) - -#define SCT_CTRLH_CLRCTR_H_MASK (0x8U) -#define SCT_CTRLH_CLRCTR_H_SHIFT (3U) -/*! CLRCTR_H - Clear Counter High */ -#define SCT_CTRLH_CLRCTR_H(x) (((uint16_t)(((uint16_t)(x)) << SCT_CTRLH_CLRCTR_H_SHIFT)) & SCT_CTRLH_CLRCTR_H_MASK) - -#define SCT_CTRLH_BIDIR_H_MASK (0x10U) -#define SCT_CTRLH_BIDIR_H_SHIFT (4U) -/*! BIDIR_H - Bidirectional Select High - * 0b0..Up - * 0b1..Up-down - */ -#define SCT_CTRLH_BIDIR_H(x) (((uint16_t)(((uint16_t)(x)) << SCT_CTRLH_BIDIR_H_SHIFT)) & SCT_CTRLH_BIDIR_H_MASK) - -#define SCT_CTRLH_PRE_H_MASK (0x1FE0U) -#define SCT_CTRLH_PRE_H_SHIFT (5U) -/*! PRE_H - Prescaler for High Counter */ -#define SCT_CTRLH_PRE_H(x) (((uint16_t)(((uint16_t)(x)) << SCT_CTRLH_PRE_H_SHIFT)) & SCT_CTRLH_PRE_H_MASK) -/*! @} */ - -/*! @name CTRL - SCT Control */ -/*! @{ */ - -#define SCT_CTRL_DOWN_L_MASK (0x1U) -#define SCT_CTRL_DOWN_L_SHIFT (0U) -/*! DOWN_L - Down Counter Low - * 0b0..Up - * 0b1..Down - */ -#define SCT_CTRL_DOWN_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_CTRL_DOWN_L_SHIFT)) & SCT_CTRL_DOWN_L_MASK) - -#define SCT_CTRL_STOP_L_MASK (0x2U) -#define SCT_CTRL_STOP_L_SHIFT (1U) -/*! STOP_L - Stop Counter Low - * 0b0..Disabled - * 0b1..Enabled - */ -#define SCT_CTRL_STOP_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_CTRL_STOP_L_SHIFT)) & SCT_CTRL_STOP_L_MASK) - -#define SCT_CTRL_HALT_L_MASK (0x4U) -#define SCT_CTRL_HALT_L_SHIFT (2U) -/*! HALT_L - Halt Counter Low - * 0b0..Disabled - * 0b1..Enabled - */ -#define SCT_CTRL_HALT_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_CTRL_HALT_L_SHIFT)) & SCT_CTRL_HALT_L_MASK) - -#define SCT_CTRL_CLRCTR_L_MASK (0x8U) -#define SCT_CTRL_CLRCTR_L_SHIFT (3U) -/*! CLRCTR_L - Clear Counter Low */ -#define SCT_CTRL_CLRCTR_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_CTRL_CLRCTR_L_SHIFT)) & SCT_CTRL_CLRCTR_L_MASK) - -#define SCT_CTRL_BIDIR_L_MASK (0x10U) -#define SCT_CTRL_BIDIR_L_SHIFT (4U) -/*! BIDIR_L - Bidirectional Select Low - * 0b0..Up - * 0b1..Up-down - */ -#define SCT_CTRL_BIDIR_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_CTRL_BIDIR_L_SHIFT)) & SCT_CTRL_BIDIR_L_MASK) - -#define SCT_CTRL_PRE_L_MASK (0x1FE0U) -#define SCT_CTRL_PRE_L_SHIFT (5U) -/*! PRE_L - Prescaler for Low Counter */ -#define SCT_CTRL_PRE_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_CTRL_PRE_L_SHIFT)) & SCT_CTRL_PRE_L_MASK) - -#define SCT_CTRL_DOWN_H_MASK (0x10000U) -#define SCT_CTRL_DOWN_H_SHIFT (16U) -/*! DOWN_H - Down Counter High - * 0b0..Up - * 0b1..Down - */ -#define SCT_CTRL_DOWN_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_CTRL_DOWN_H_SHIFT)) & SCT_CTRL_DOWN_H_MASK) - -#define SCT_CTRL_STOP_H_MASK (0x20000U) -#define SCT_CTRL_STOP_H_SHIFT (17U) -/*! STOP_H - Stop Counter High - * 0b0..Disabled - * 0b1..Enabled - */ -#define SCT_CTRL_STOP_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_CTRL_STOP_H_SHIFT)) & SCT_CTRL_STOP_H_MASK) - -#define SCT_CTRL_HALT_H_MASK (0x40000U) -#define SCT_CTRL_HALT_H_SHIFT (18U) -/*! HALT_H - Halt Counter High - * 0b0..Disable - * 0b1..Enable - */ -#define SCT_CTRL_HALT_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_CTRL_HALT_H_SHIFT)) & SCT_CTRL_HALT_H_MASK) - -#define SCT_CTRL_CLRCTR_H_MASK (0x80000U) -#define SCT_CTRL_CLRCTR_H_SHIFT (19U) -/*! CLRCTR_H - Clear Counter High */ -#define SCT_CTRL_CLRCTR_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_CTRL_CLRCTR_H_SHIFT)) & SCT_CTRL_CLRCTR_H_MASK) - -#define SCT_CTRL_BIDIR_H_MASK (0x100000U) -#define SCT_CTRL_BIDIR_H_SHIFT (20U) -/*! BIDIR_H - Bidirectional Select High - * 0b0..Up - * 0b1..Up-down - */ -#define SCT_CTRL_BIDIR_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_CTRL_BIDIR_H_SHIFT)) & SCT_CTRL_BIDIR_H_MASK) - -#define SCT_CTRL_PRE_H_MASK (0x1FE00000U) -#define SCT_CTRL_PRE_H_SHIFT (21U) -/*! PRE_H - Prescaler for High Counter */ -#define SCT_CTRL_PRE_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_CTRL_PRE_H_SHIFT)) & SCT_CTRL_PRE_H_MASK) -/*! @} */ - -/*! @name LIMITL - SCT_LIMITL register */ -/*! @{ */ - -#define SCT_LIMITL_LIMITL_MASK (0xFFFFU) -#define SCT_LIMITL_LIMITL_SHIFT (0U) -#define SCT_LIMITL_LIMITL(x) (((uint16_t)(((uint16_t)(x)) << SCT_LIMITL_LIMITL_SHIFT)) & SCT_LIMITL_LIMITL_MASK) -/*! @} */ - -/*! @name LIMITH - SCT_LIMITH register */ -/*! @{ */ - -#define SCT_LIMITH_LIMITH_MASK (0xFFFFU) -#define SCT_LIMITH_LIMITH_SHIFT (0U) -#define SCT_LIMITH_LIMITH(x) (((uint16_t)(((uint16_t)(x)) << SCT_LIMITH_LIMITH_SHIFT)) & SCT_LIMITH_LIMITH_MASK) -/*! @} */ - -/*! @name LIMIT - SCT Limit Event Select */ -/*! @{ */ - -#define SCT_LIMIT_LIMMSK_L_MASK (0xFFFFU) -#define SCT_LIMIT_LIMMSK_L_SHIFT (0U) -/*! LIMMSK_L - Limit Event Counter Low */ -#define SCT_LIMIT_LIMMSK_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_LIMIT_LIMMSK_L_SHIFT)) & SCT_LIMIT_LIMMSK_L_MASK) - -#define SCT_LIMIT_LIMMSK_H_MASK (0xFFFF0000U) -#define SCT_LIMIT_LIMMSK_H_SHIFT (16U) -/*! LIMMSK_H - Limit Event Counter High */ -#define SCT_LIMIT_LIMMSK_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_LIMIT_LIMMSK_H_SHIFT)) & SCT_LIMIT_LIMMSK_H_MASK) -/*! @} */ - -/*! @name HALTL - SCT_HALTL register */ -/*! @{ */ - -#define SCT_HALTL_HALTL_MASK (0xFFFFU) -#define SCT_HALTL_HALTL_SHIFT (0U) -#define SCT_HALTL_HALTL(x) (((uint16_t)(((uint16_t)(x)) << SCT_HALTL_HALTL_SHIFT)) & SCT_HALTL_HALTL_MASK) -/*! @} */ - -/*! @name HALTH - SCT_HALTH register */ -/*! @{ */ - -#define SCT_HALTH_HALTH_MASK (0xFFFFU) -#define SCT_HALTH_HALTH_SHIFT (0U) -#define SCT_HALTH_HALTH(x) (((uint16_t)(((uint16_t)(x)) << SCT_HALTH_HALTH_SHIFT)) & SCT_HALTH_HALTH_MASK) -/*! @} */ - -/*! @name HALT - Halt Event Select */ -/*! @{ */ - -#define SCT_HALT_HALTMSK_L_MASK (0xFFFFU) -#define SCT_HALT_HALTMSK_L_SHIFT (0U) -/*! HALTMSK_L - Halt Event Low */ -#define SCT_HALT_HALTMSK_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_HALT_HALTMSK_L_SHIFT)) & SCT_HALT_HALTMSK_L_MASK) - -#define SCT_HALT_HALTMSK_H_MASK (0xFFFF0000U) -#define SCT_HALT_HALTMSK_H_SHIFT (16U) -/*! HALTMSK_H - Halt Event High */ -#define SCT_HALT_HALTMSK_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_HALT_HALTMSK_H_SHIFT)) & SCT_HALT_HALTMSK_H_MASK) -/*! @} */ - -/*! @name STOPL - SCT_STOPL register */ -/*! @{ */ - -#define SCT_STOPL_STOPL_MASK (0xFFFFU) -#define SCT_STOPL_STOPL_SHIFT (0U) -#define SCT_STOPL_STOPL(x) (((uint16_t)(((uint16_t)(x)) << SCT_STOPL_STOPL_SHIFT)) & SCT_STOPL_STOPL_MASK) -/*! @} */ - -/*! @name STOPH - SCT_STOPH register */ -/*! @{ */ - -#define SCT_STOPH_STOPH_MASK (0xFFFFU) -#define SCT_STOPH_STOPH_SHIFT (0U) -#define SCT_STOPH_STOPH(x) (((uint16_t)(((uint16_t)(x)) << SCT_STOPH_STOPH_SHIFT)) & SCT_STOPH_STOPH_MASK) -/*! @} */ - -/*! @name STOP - Stop Event Select */ -/*! @{ */ - -#define SCT_STOP_STOPMSK_L_MASK (0xFFFFU) -#define SCT_STOP_STOPMSK_L_SHIFT (0U) -/*! STOPMSK_L - Stop Event Low */ -#define SCT_STOP_STOPMSK_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_STOP_STOPMSK_L_SHIFT)) & SCT_STOP_STOPMSK_L_MASK) - -#define SCT_STOP_STOPMSK_H_MASK (0xFFFF0000U) -#define SCT_STOP_STOPMSK_H_SHIFT (16U) -/*! STOPMSK_H - Stop Event High */ -#define SCT_STOP_STOPMSK_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_STOP_STOPMSK_H_SHIFT)) & SCT_STOP_STOPMSK_H_MASK) -/*! @} */ - -/*! @name STARTL - SCT_STARTL register */ -/*! @{ */ - -#define SCT_STARTL_STARTL_MASK (0xFFFFU) -#define SCT_STARTL_STARTL_SHIFT (0U) -#define SCT_STARTL_STARTL(x) (((uint16_t)(((uint16_t)(x)) << SCT_STARTL_STARTL_SHIFT)) & SCT_STARTL_STARTL_MASK) -/*! @} */ - -/*! @name STARTH - SCT_STARTH register */ -/*! @{ */ - -#define SCT_STARTH_STARTH_MASK (0xFFFFU) -#define SCT_STARTH_STARTH_SHIFT (0U) -#define SCT_STARTH_STARTH(x) (((uint16_t)(((uint16_t)(x)) << SCT_STARTH_STARTH_SHIFT)) & SCT_STARTH_STARTH_MASK) -/*! @} */ - -/*! @name START - Start Event Select */ -/*! @{ */ - -#define SCT_START_STARTMSK_L_MASK (0xFFFFU) -#define SCT_START_STARTMSK_L_SHIFT (0U) -/*! STARTMSK_L - Start Event Low */ -#define SCT_START_STARTMSK_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_START_STARTMSK_L_SHIFT)) & SCT_START_STARTMSK_L_MASK) - -#define SCT_START_STARTMSK_H_MASK (0xFFFF0000U) -#define SCT_START_STARTMSK_H_SHIFT (16U) -/*! STARTMSK_H - Start Event High */ -#define SCT_START_STARTMSK_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_START_STARTMSK_H_SHIFT)) & SCT_START_STARTMSK_H_MASK) -/*! @} */ - -/*! @name DITHER - Dither Condition */ -/*! @{ */ - -#define SCT_DITHER_DITHER_L_MASK (0xFFFFU) -#define SCT_DITHER_DITHER_L_SHIFT (0U) -/*! DITHER_L - Dither Low */ -#define SCT_DITHER_DITHER_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_DITHER_DITHER_L_SHIFT)) & SCT_DITHER_DITHER_L_MASK) - -#define SCT_DITHER_DITHER_H_MASK (0xFFFF0000U) -#define SCT_DITHER_DITHER_H_SHIFT (16U) -/*! DITHER_H - Dither High */ -#define SCT_DITHER_DITHER_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_DITHER_DITHER_H_SHIFT)) & SCT_DITHER_DITHER_H_MASK) -/*! @} */ - -/*! @name COUNTL - SCT_COUNTL register */ -/*! @{ */ - -#define SCT_COUNTL_COUNTL_MASK (0xFFFFU) -#define SCT_COUNTL_COUNTL_SHIFT (0U) -#define SCT_COUNTL_COUNTL(x) (((uint16_t)(((uint16_t)(x)) << SCT_COUNTL_COUNTL_SHIFT)) & SCT_COUNTL_COUNTL_MASK) -/*! @} */ - -/*! @name COUNTH - SCT_COUNTH register */ -/*! @{ */ - -#define SCT_COUNTH_COUNTH_MASK (0xFFFFU) -#define SCT_COUNTH_COUNTH_SHIFT (0U) -#define SCT_COUNTH_COUNTH(x) (((uint16_t)(((uint16_t)(x)) << SCT_COUNTH_COUNTH_SHIFT)) & SCT_COUNTH_COUNTH_MASK) -/*! @} */ - -/*! @name COUNT - Counter Value */ -/*! @{ */ - -#define SCT_COUNT_CTR_L_MASK (0xFFFFU) -#define SCT_COUNT_CTR_L_SHIFT (0U) -/*! CTR_L - Counter Low */ -#define SCT_COUNT_CTR_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_COUNT_CTR_L_SHIFT)) & SCT_COUNT_CTR_L_MASK) - -#define SCT_COUNT_CTR_H_MASK (0xFFFF0000U) -#define SCT_COUNT_CTR_H_SHIFT (16U) -/*! CTR_H - Counter High */ -#define SCT_COUNT_CTR_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_COUNT_CTR_H_SHIFT)) & SCT_COUNT_CTR_H_MASK) -/*! @} */ - -/*! @name STATEL - SCT_STATEL register */ -/*! @{ */ - -#define SCT_STATEL_STATEL_MASK (0xFFFFU) -#define SCT_STATEL_STATEL_SHIFT (0U) -#define SCT_STATEL_STATEL(x) (((uint16_t)(((uint16_t)(x)) << SCT_STATEL_STATEL_SHIFT)) & SCT_STATEL_STATEL_MASK) -/*! @} */ - -/*! @name STATEH - SCT_STATEH register */ -/*! @{ */ - -#define SCT_STATEH_STATEH_MASK (0xFFFFU) -#define SCT_STATEH_STATEH_SHIFT (0U) -#define SCT_STATEH_STATEH(x) (((uint16_t)(((uint16_t)(x)) << SCT_STATEH_STATEH_SHIFT)) & SCT_STATEH_STATEH_MASK) -/*! @} */ - -/*! @name STATE - State Variable */ -/*! @{ */ - -#define SCT_STATE_STATE_L_MASK (0x1FU) -#define SCT_STATE_STATE_L_SHIFT (0U) -/*! STATE_L - State Variable Low */ -#define SCT_STATE_STATE_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_STATE_STATE_L_SHIFT)) & SCT_STATE_STATE_L_MASK) - -#define SCT_STATE_STATE_H_MASK (0x1F0000U) -#define SCT_STATE_STATE_H_SHIFT (16U) -/*! STATE_H - State Variable High */ -#define SCT_STATE_STATE_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_STATE_STATE_H_SHIFT)) & SCT_STATE_STATE_H_MASK) -/*! @} */ - -/*! @name INPUT - Input State */ -/*! @{ */ - -#define SCT_INPUT_AIN0_MASK (0x1U) -#define SCT_INPUT_AIN0_SHIFT (0U) -/*! AIN0 - Input 0 state */ -#define SCT_INPUT_AIN0(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN0_SHIFT)) & SCT_INPUT_AIN0_MASK) - -#define SCT_INPUT_AIN1_MASK (0x2U) -#define SCT_INPUT_AIN1_SHIFT (1U) -/*! AIN1 - Input 1 state */ -#define SCT_INPUT_AIN1(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN1_SHIFT)) & SCT_INPUT_AIN1_MASK) - -#define SCT_INPUT_AIN2_MASK (0x4U) -#define SCT_INPUT_AIN2_SHIFT (2U) -/*! AIN2 - Input 2 state */ -#define SCT_INPUT_AIN2(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN2_SHIFT)) & SCT_INPUT_AIN2_MASK) - -#define SCT_INPUT_AIN3_MASK (0x8U) -#define SCT_INPUT_AIN3_SHIFT (3U) -/*! AIN3 - Input 3 state */ -#define SCT_INPUT_AIN3(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN3_SHIFT)) & SCT_INPUT_AIN3_MASK) - -#define SCT_INPUT_AIN4_MASK (0x10U) -#define SCT_INPUT_AIN4_SHIFT (4U) -/*! AIN4 - Input 4 state */ -#define SCT_INPUT_AIN4(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN4_SHIFT)) & SCT_INPUT_AIN4_MASK) - -#define SCT_INPUT_AIN5_MASK (0x20U) -#define SCT_INPUT_AIN5_SHIFT (5U) -/*! AIN5 - Input 5 state */ -#define SCT_INPUT_AIN5(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN5_SHIFT)) & SCT_INPUT_AIN5_MASK) - -#define SCT_INPUT_AIN6_MASK (0x40U) -#define SCT_INPUT_AIN6_SHIFT (6U) -/*! AIN6 - Input 6 state */ -#define SCT_INPUT_AIN6(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN6_SHIFT)) & SCT_INPUT_AIN6_MASK) - -#define SCT_INPUT_AIN7_MASK (0x80U) -#define SCT_INPUT_AIN7_SHIFT (7U) -/*! AIN7 - Input 7 state */ -#define SCT_INPUT_AIN7(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN7_SHIFT)) & SCT_INPUT_AIN7_MASK) - -#define SCT_INPUT_AIN8_MASK (0x100U) -#define SCT_INPUT_AIN8_SHIFT (8U) -/*! AIN8 - Input 8 state */ -#define SCT_INPUT_AIN8(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN8_SHIFT)) & SCT_INPUT_AIN8_MASK) - -#define SCT_INPUT_AIN9_MASK (0x200U) -#define SCT_INPUT_AIN9_SHIFT (9U) -/*! AIN9 - Input 9 state */ -#define SCT_INPUT_AIN9(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN9_SHIFT)) & SCT_INPUT_AIN9_MASK) - -#define SCT_INPUT_AIN10_MASK (0x400U) -#define SCT_INPUT_AIN10_SHIFT (10U) -/*! AIN10 - Input 10 state */ -#define SCT_INPUT_AIN10(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN10_SHIFT)) & SCT_INPUT_AIN10_MASK) - -#define SCT_INPUT_AIN11_MASK (0x800U) -#define SCT_INPUT_AIN11_SHIFT (11U) -/*! AIN11 - Input 11 state */ -#define SCT_INPUT_AIN11(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN11_SHIFT)) & SCT_INPUT_AIN11_MASK) - -#define SCT_INPUT_AIN12_MASK (0x1000U) -#define SCT_INPUT_AIN12_SHIFT (12U) -/*! AIN12 - Input 12 state */ -#define SCT_INPUT_AIN12(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN12_SHIFT)) & SCT_INPUT_AIN12_MASK) - -#define SCT_INPUT_AIN13_MASK (0x2000U) -#define SCT_INPUT_AIN13_SHIFT (13U) -/*! AIN13 - Input 13 state */ -#define SCT_INPUT_AIN13(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN13_SHIFT)) & SCT_INPUT_AIN13_MASK) - -#define SCT_INPUT_AIN14_MASK (0x4000U) -#define SCT_INPUT_AIN14_SHIFT (14U) -/*! AIN14 - Input 14 state */ -#define SCT_INPUT_AIN14(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN14_SHIFT)) & SCT_INPUT_AIN14_MASK) - -#define SCT_INPUT_AIN15_MASK (0x8000U) -#define SCT_INPUT_AIN15_SHIFT (15U) -/*! AIN15 - Input 15 state */ -#define SCT_INPUT_AIN15(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN15_SHIFT)) & SCT_INPUT_AIN15_MASK) - -#define SCT_INPUT_SIN0_MASK (0x10000U) -#define SCT_INPUT_SIN0_SHIFT (16U) -/*! SIN0 - Input 0 state */ -#define SCT_INPUT_SIN0(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN0_SHIFT)) & SCT_INPUT_SIN0_MASK) - -#define SCT_INPUT_SIN1_MASK (0x20000U) -#define SCT_INPUT_SIN1_SHIFT (17U) -/*! SIN1 - Input 1 state */ -#define SCT_INPUT_SIN1(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN1_SHIFT)) & SCT_INPUT_SIN1_MASK) - -#define SCT_INPUT_SIN2_MASK (0x40000U) -#define SCT_INPUT_SIN2_SHIFT (18U) -/*! SIN2 - Input 2 state */ -#define SCT_INPUT_SIN2(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN2_SHIFT)) & SCT_INPUT_SIN2_MASK) - -#define SCT_INPUT_SIN3_MASK (0x80000U) -#define SCT_INPUT_SIN3_SHIFT (19U) -/*! SIN3 - Input 3 state */ -#define SCT_INPUT_SIN3(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN3_SHIFT)) & SCT_INPUT_SIN3_MASK) - -#define SCT_INPUT_SIN4_MASK (0x100000U) -#define SCT_INPUT_SIN4_SHIFT (20U) -/*! SIN4 - Input 4 state */ -#define SCT_INPUT_SIN4(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN4_SHIFT)) & SCT_INPUT_SIN4_MASK) - -#define SCT_INPUT_SIN5_MASK (0x200000U) -#define SCT_INPUT_SIN5_SHIFT (21U) -/*! SIN5 - Input 5 state */ -#define SCT_INPUT_SIN5(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN5_SHIFT)) & SCT_INPUT_SIN5_MASK) - -#define SCT_INPUT_SIN6_MASK (0x400000U) -#define SCT_INPUT_SIN6_SHIFT (22U) -/*! SIN6 - Input 6 state */ -#define SCT_INPUT_SIN6(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN6_SHIFT)) & SCT_INPUT_SIN6_MASK) - -#define SCT_INPUT_SIN7_MASK (0x800000U) -#define SCT_INPUT_SIN7_SHIFT (23U) -/*! SIN7 - Input 7 state */ -#define SCT_INPUT_SIN7(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN7_SHIFT)) & SCT_INPUT_SIN7_MASK) - -#define SCT_INPUT_SIN8_MASK (0x1000000U) -#define SCT_INPUT_SIN8_SHIFT (24U) -/*! SIN8 - Input 8 state */ -#define SCT_INPUT_SIN8(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN8_SHIFT)) & SCT_INPUT_SIN8_MASK) - -#define SCT_INPUT_SIN9_MASK (0x2000000U) -#define SCT_INPUT_SIN9_SHIFT (25U) -/*! SIN9 - Input 9 state */ -#define SCT_INPUT_SIN9(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN9_SHIFT)) & SCT_INPUT_SIN9_MASK) - -#define SCT_INPUT_SIN10_MASK (0x4000000U) -#define SCT_INPUT_SIN10_SHIFT (26U) -/*! SIN10 - Input 10 state */ -#define SCT_INPUT_SIN10(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN10_SHIFT)) & SCT_INPUT_SIN10_MASK) - -#define SCT_INPUT_SIN11_MASK (0x8000000U) -#define SCT_INPUT_SIN11_SHIFT (27U) -/*! SIN11 - Input 11 state */ -#define SCT_INPUT_SIN11(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN11_SHIFT)) & SCT_INPUT_SIN11_MASK) - -#define SCT_INPUT_SIN12_MASK (0x10000000U) -#define SCT_INPUT_SIN12_SHIFT (28U) -/*! SIN12 - Input 12 state */ -#define SCT_INPUT_SIN12(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN12_SHIFT)) & SCT_INPUT_SIN12_MASK) - -#define SCT_INPUT_SIN13_MASK (0x20000000U) -#define SCT_INPUT_SIN13_SHIFT (29U) -/*! SIN13 - Input 13 state */ -#define SCT_INPUT_SIN13(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN13_SHIFT)) & SCT_INPUT_SIN13_MASK) - -#define SCT_INPUT_SIN14_MASK (0x40000000U) -#define SCT_INPUT_SIN14_SHIFT (30U) -/*! SIN14 - Input 14 state */ -#define SCT_INPUT_SIN14(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN14_SHIFT)) & SCT_INPUT_SIN14_MASK) - -#define SCT_INPUT_SIN15_MASK (0x80000000U) -#define SCT_INPUT_SIN15_SHIFT (31U) -/*! SIN15 - Input 15 state */ -#define SCT_INPUT_SIN15(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN15_SHIFT)) & SCT_INPUT_SIN15_MASK) -/*! @} */ - -/*! @name REGMODEL - SCT_REGMODEL register */ -/*! @{ */ - -#define SCT_REGMODEL_REGMODEL_MASK (0xFFFFU) -#define SCT_REGMODEL_REGMODEL_SHIFT (0U) -/*! REGMODEL - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODEL_REGMODEL(x) (((uint16_t)(((uint16_t)(x)) << SCT_REGMODEL_REGMODEL_SHIFT)) & SCT_REGMODEL_REGMODEL_MASK) - -#define SCT_REGMODEL_REGMOD_L_MASK (0xFFFFU) -#define SCT_REGMODEL_REGMOD_L_SHIFT (0U) -#define SCT_REGMODEL_REGMOD_L(x) (((uint16_t)(((uint16_t)(x)) << SCT_REGMODEL_REGMOD_L_SHIFT)) & SCT_REGMODEL_REGMOD_L_MASK) - -#define SCT_REGMODEL_REGMOD_H_MASK (0xFFFF0000U) -#define SCT_REGMODEL_REGMOD_H_SHIFT (16U) -#define SCT_REGMODEL_REGMOD_H(x) (((uint16_t)(((uint16_t)(x)) << SCT_REGMODEL_REGMOD_H_SHIFT)) & SCT_REGMODEL_REGMOD_H_MASK) -/*! @} */ - -/*! @name REGMODEH - SCT_REGMODEH register */ -/*! @{ */ - -#define SCT_REGMODEH_REGMODEH_MASK (0xFFFFU) -#define SCT_REGMODEH_REGMODEH_SHIFT (0U) -/*! REGMODEH - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODEH_REGMODEH(x) (((uint16_t)(((uint16_t)(x)) << SCT_REGMODEH_REGMODEH_SHIFT)) & SCT_REGMODEH_REGMODEH_MASK) - -#define SCT_REGMODEH_REGMOD_L_MASK (0xFFFFU) -#define SCT_REGMODEH_REGMOD_L_SHIFT (0U) -#define SCT_REGMODEH_REGMOD_L(x) (((uint16_t)(((uint16_t)(x)) << SCT_REGMODEH_REGMOD_L_SHIFT)) & SCT_REGMODEH_REGMOD_L_MASK) - -#define SCT_REGMODEH_REGMOD_H_MASK (0xFFFF0000U) -#define SCT_REGMODEH_REGMOD_H_SHIFT (16U) -#define SCT_REGMODEH_REGMOD_H(x) (((uint16_t)(((uint16_t)(x)) << SCT_REGMODEH_REGMOD_H_SHIFT)) & SCT_REGMODEH_REGMOD_H_MASK) -/*! @} */ - -/*! @name REGMODE - Match and Capture Register Mode */ -/*! @{ */ - -#define SCT_REGMODE_REGMOD_L_MASK (0xFFFFU) -#define SCT_REGMODE_REGMOD_L_SHIFT (0U) -#define SCT_REGMODE_REGMOD_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L_SHIFT)) & SCT_REGMODE_REGMOD_L_MASK) - -#define SCT_REGMODE_REGMOD_L0_MASK (0x1U) -#define SCT_REGMODE_REGMOD_L0_SHIFT (0U) -/*! REGMOD_L0 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L0(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L0_SHIFT)) & SCT_REGMODE_REGMOD_L0_MASK) - -#define SCT_REGMODE_REGMOD_L1_MASK (0x2U) -#define SCT_REGMODE_REGMOD_L1_SHIFT (1U) -/*! REGMOD_L1 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L1(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L1_SHIFT)) & SCT_REGMODE_REGMOD_L1_MASK) - -#define SCT_REGMODE_REGMOD_L2_MASK (0x4U) -#define SCT_REGMODE_REGMOD_L2_SHIFT (2U) -/*! REGMOD_L2 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L2(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L2_SHIFT)) & SCT_REGMODE_REGMOD_L2_MASK) - -#define SCT_REGMODE_REGMOD_L3_MASK (0x8U) -#define SCT_REGMODE_REGMOD_L3_SHIFT (3U) -/*! REGMOD_L3 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L3(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L3_SHIFT)) & SCT_REGMODE_REGMOD_L3_MASK) - -#define SCT_REGMODE_REGMOD_L4_MASK (0x10U) -#define SCT_REGMODE_REGMOD_L4_SHIFT (4U) -/*! REGMOD_L4 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L4(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L4_SHIFT)) & SCT_REGMODE_REGMOD_L4_MASK) - -#define SCT_REGMODE_REGMOD_L5_MASK (0x20U) -#define SCT_REGMODE_REGMOD_L5_SHIFT (5U) -/*! REGMOD_L5 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L5(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L5_SHIFT)) & SCT_REGMODE_REGMOD_L5_MASK) - -#define SCT_REGMODE_REGMOD_L6_MASK (0x40U) -#define SCT_REGMODE_REGMOD_L6_SHIFT (6U) -/*! REGMOD_L6 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L6(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L6_SHIFT)) & SCT_REGMODE_REGMOD_L6_MASK) - -#define SCT_REGMODE_REGMOD_L7_MASK (0x80U) -#define SCT_REGMODE_REGMOD_L7_SHIFT (7U) -/*! REGMOD_L7 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L7(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L7_SHIFT)) & SCT_REGMODE_REGMOD_L7_MASK) - -#define SCT_REGMODE_REGMOD_L8_MASK (0x100U) -#define SCT_REGMODE_REGMOD_L8_SHIFT (8U) -/*! REGMOD_L8 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L8(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L8_SHIFT)) & SCT_REGMODE_REGMOD_L8_MASK) - -#define SCT_REGMODE_REGMOD_L9_MASK (0x200U) -#define SCT_REGMODE_REGMOD_L9_SHIFT (9U) -/*! REGMOD_L9 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L9(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L9_SHIFT)) & SCT_REGMODE_REGMOD_L9_MASK) - -#define SCT_REGMODE_REGMOD_L10_MASK (0x400U) -#define SCT_REGMODE_REGMOD_L10_SHIFT (10U) -/*! REGMOD_L10 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L10(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L10_SHIFT)) & SCT_REGMODE_REGMOD_L10_MASK) - -#define SCT_REGMODE_REGMOD_L11_MASK (0x800U) -#define SCT_REGMODE_REGMOD_L11_SHIFT (11U) -/*! REGMOD_L11 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L11(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L11_SHIFT)) & SCT_REGMODE_REGMOD_L11_MASK) - -#define SCT_REGMODE_REGMOD_L12_MASK (0x1000U) -#define SCT_REGMODE_REGMOD_L12_SHIFT (12U) -/*! REGMOD_L12 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L12(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L12_SHIFT)) & SCT_REGMODE_REGMOD_L12_MASK) - -#define SCT_REGMODE_REGMOD_L13_MASK (0x2000U) -#define SCT_REGMODE_REGMOD_L13_SHIFT (13U) -/*! REGMOD_L13 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L13(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L13_SHIFT)) & SCT_REGMODE_REGMOD_L13_MASK) - -#define SCT_REGMODE_REGMOD_L14_MASK (0x4000U) -#define SCT_REGMODE_REGMOD_L14_SHIFT (14U) -/*! REGMOD_L14 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L14(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L14_SHIFT)) & SCT_REGMODE_REGMOD_L14_MASK) - -#define SCT_REGMODE_REGMOD_L15_MASK (0x8000U) -#define SCT_REGMODE_REGMOD_L15_SHIFT (15U) -/*! REGMOD_L15 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L15(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L15_SHIFT)) & SCT_REGMODE_REGMOD_L15_MASK) - -#define SCT_REGMODE_REGMOD_H_MASK (0xFFFF0000U) -#define SCT_REGMODE_REGMOD_H_SHIFT (16U) -#define SCT_REGMODE_REGMOD_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H_SHIFT)) & SCT_REGMODE_REGMOD_H_MASK) - -#define SCT_REGMODE_REGMOD_H0_MASK (0x10000U) -#define SCT_REGMODE_REGMOD_H0_SHIFT (16U) -/*! REGMOD_H0 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H0(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H0_SHIFT)) & SCT_REGMODE_REGMOD_H0_MASK) - -#define SCT_REGMODE_REGMOD_H1_MASK (0x20000U) -#define SCT_REGMODE_REGMOD_H1_SHIFT (17U) -/*! REGMOD_H1 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H1(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H1_SHIFT)) & SCT_REGMODE_REGMOD_H1_MASK) - -#define SCT_REGMODE_REGMOD_H2_MASK (0x40000U) -#define SCT_REGMODE_REGMOD_H2_SHIFT (18U) -/*! REGMOD_H2 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H2(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H2_SHIFT)) & SCT_REGMODE_REGMOD_H2_MASK) - -#define SCT_REGMODE_REGMOD_H3_MASK (0x80000U) -#define SCT_REGMODE_REGMOD_H3_SHIFT (19U) -/*! REGMOD_H3 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H3(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H3_SHIFT)) & SCT_REGMODE_REGMOD_H3_MASK) - -#define SCT_REGMODE_REGMOD_H4_MASK (0x100000U) -#define SCT_REGMODE_REGMOD_H4_SHIFT (20U) -/*! REGMOD_H4 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H4(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H4_SHIFT)) & SCT_REGMODE_REGMOD_H4_MASK) - -#define SCT_REGMODE_REGMOD_H5_MASK (0x200000U) -#define SCT_REGMODE_REGMOD_H5_SHIFT (21U) -/*! REGMOD_H5 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H5(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H5_SHIFT)) & SCT_REGMODE_REGMOD_H5_MASK) - -#define SCT_REGMODE_REGMOD_H6_MASK (0x400000U) -#define SCT_REGMODE_REGMOD_H6_SHIFT (22U) -/*! REGMOD_H6 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H6(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H6_SHIFT)) & SCT_REGMODE_REGMOD_H6_MASK) - -#define SCT_REGMODE_REGMOD_H7_MASK (0x800000U) -#define SCT_REGMODE_REGMOD_H7_SHIFT (23U) -/*! REGMOD_H7 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H7(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H7_SHIFT)) & SCT_REGMODE_REGMOD_H7_MASK) - -#define SCT_REGMODE_REGMOD_H8_MASK (0x1000000U) -#define SCT_REGMODE_REGMOD_H8_SHIFT (24U) -/*! REGMOD_H8 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H8(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H8_SHIFT)) & SCT_REGMODE_REGMOD_H8_MASK) - -#define SCT_REGMODE_REGMOD_H9_MASK (0x2000000U) -#define SCT_REGMODE_REGMOD_H9_SHIFT (25U) -/*! REGMOD_H9 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H9(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H9_SHIFT)) & SCT_REGMODE_REGMOD_H9_MASK) - -#define SCT_REGMODE_REGMOD_H10_MASK (0x4000000U) -#define SCT_REGMODE_REGMOD_H10_SHIFT (26U) -/*! REGMOD_H10 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H10(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H10_SHIFT)) & SCT_REGMODE_REGMOD_H10_MASK) - -#define SCT_REGMODE_REGMOD_H11_MASK (0x8000000U) -#define SCT_REGMODE_REGMOD_H11_SHIFT (27U) -/*! REGMOD_H11 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H11(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H11_SHIFT)) & SCT_REGMODE_REGMOD_H11_MASK) - -#define SCT_REGMODE_REGMOD_H12_MASK (0x10000000U) -#define SCT_REGMODE_REGMOD_H12_SHIFT (28U) -/*! REGMOD_H12 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H12(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H12_SHIFT)) & SCT_REGMODE_REGMOD_H12_MASK) - -#define SCT_REGMODE_REGMOD_H13_MASK (0x20000000U) -#define SCT_REGMODE_REGMOD_H13_SHIFT (29U) -/*! REGMOD_H13 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H13(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H13_SHIFT)) & SCT_REGMODE_REGMOD_H13_MASK) - -#define SCT_REGMODE_REGMOD_H14_MASK (0x40000000U) -#define SCT_REGMODE_REGMOD_H14_SHIFT (30U) -/*! REGMOD_H14 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H14(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H14_SHIFT)) & SCT_REGMODE_REGMOD_H14_MASK) - -#define SCT_REGMODE_REGMOD_H15_MASK (0x80000000U) -#define SCT_REGMODE_REGMOD_H15_SHIFT (31U) -/*! REGMOD_H15 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H15(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H15_SHIFT)) & SCT_REGMODE_REGMOD_H15_MASK) -/*! @} */ - -/*! @name OUTPUT - Output State */ -/*! @{ */ - -#define SCT_OUTPUT_OUT0_MASK (0x1U) -#define SCT_OUTPUT_OUT0_SHIFT (0U) -/*! OUT0 - Output Low and High - * 0b0..Forces the corresponding output low - * 0b1..Forces the corresponding output high - */ -#define SCT_OUTPUT_OUT0(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUT_OUT0_SHIFT)) & SCT_OUTPUT_OUT0_MASK) - -#define SCT_OUTPUT_OUT1_MASK (0x2U) -#define SCT_OUTPUT_OUT1_SHIFT (1U) -/*! OUT1 - Output Low and High - * 0b0..Forces the corresponding output low - * 0b1..Forces the corresponding output high - */ -#define SCT_OUTPUT_OUT1(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUT_OUT1_SHIFT)) & SCT_OUTPUT_OUT1_MASK) - -#define SCT_OUTPUT_OUT2_MASK (0x4U) -#define SCT_OUTPUT_OUT2_SHIFT (2U) -/*! OUT2 - Output Low and High - * 0b0..Forces the corresponding output low - * 0b1..Forces the corresponding output high - */ -#define SCT_OUTPUT_OUT2(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUT_OUT2_SHIFT)) & SCT_OUTPUT_OUT2_MASK) - -#define SCT_OUTPUT_OUT3_MASK (0x8U) -#define SCT_OUTPUT_OUT3_SHIFT (3U) -/*! OUT3 - Output Low and High - * 0b0..Forces the corresponding output low - * 0b1..Forces the corresponding output high - */ -#define SCT_OUTPUT_OUT3(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUT_OUT3_SHIFT)) & SCT_OUTPUT_OUT3_MASK) - -#define SCT_OUTPUT_OUT4_MASK (0x10U) -#define SCT_OUTPUT_OUT4_SHIFT (4U) -/*! OUT4 - Output Low and High - * 0b0..Forces the corresponding output low - * 0b1..Forces the corresponding output high - */ -#define SCT_OUTPUT_OUT4(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUT_OUT4_SHIFT)) & SCT_OUTPUT_OUT4_MASK) - -#define SCT_OUTPUT_OUT5_MASK (0x20U) -#define SCT_OUTPUT_OUT5_SHIFT (5U) -/*! OUT5 - Output Low and High - * 0b0..Forces the corresponding output low - * 0b1..Forces the corresponding output high - */ -#define SCT_OUTPUT_OUT5(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUT_OUT5_SHIFT)) & SCT_OUTPUT_OUT5_MASK) - -#define SCT_OUTPUT_OUT6_MASK (0x40U) -#define SCT_OUTPUT_OUT6_SHIFT (6U) -/*! OUT6 - Output Low and High - * 0b0..Forces the corresponding output low - * 0b1..Forces the corresponding output high - */ -#define SCT_OUTPUT_OUT6(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUT_OUT6_SHIFT)) & SCT_OUTPUT_OUT6_MASK) - -#define SCT_OUTPUT_OUT7_MASK (0x80U) -#define SCT_OUTPUT_OUT7_SHIFT (7U) -/*! OUT7 - Output Low and High - * 0b0..Forces the corresponding output low - * 0b1..Forces the corresponding output high - */ -#define SCT_OUTPUT_OUT7(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUT_OUT7_SHIFT)) & SCT_OUTPUT_OUT7_MASK) - -#define SCT_OUTPUT_OUT8_MASK (0x100U) -#define SCT_OUTPUT_OUT8_SHIFT (8U) -/*! OUT8 - Output Low and High - * 0b0..Forces the corresponding output low - * 0b1..Forces the corresponding output high - */ -#define SCT_OUTPUT_OUT8(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUT_OUT8_SHIFT)) & SCT_OUTPUT_OUT8_MASK) - -#define SCT_OUTPUT_OUT9_MASK (0x200U) -#define SCT_OUTPUT_OUT9_SHIFT (9U) -/*! OUT9 - Output Low and High - * 0b0..Forces the corresponding output low - * 0b1..Forces the corresponding output high - */ -#define SCT_OUTPUT_OUT9(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUT_OUT9_SHIFT)) & SCT_OUTPUT_OUT9_MASK) -/*! @} */ - -/*! @name OUTPUTDIRCTRL - Output Counter Direction Control */ -/*! @{ */ - -#define SCT_OUTPUTDIRCTRL_SETCLR0_MASK (0x3U) -#define SCT_OUTPUTDIRCTRL_SETCLR0_SHIFT (0U) -/*! SETCLR0 - Set and Clear Operation on Output - * 0b00..Not dependent on the direction of any counter - * 0b01..Reversed when counter L or the unified counter is counting down - * 0b10..Reversed when counter H is counting down (do not use this value when CONFIG[UNIFY] = 1) - * 0b11..Reserved (do not program this value) - */ -#define SCT_OUTPUTDIRCTRL_SETCLR0(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUTDIRCTRL_SETCLR0_SHIFT)) & SCT_OUTPUTDIRCTRL_SETCLR0_MASK) - -#define SCT_OUTPUTDIRCTRL_SETCLR1_MASK (0xCU) -#define SCT_OUTPUTDIRCTRL_SETCLR1_SHIFT (2U) -/*! SETCLR1 - Set and Clear Operation on Output - * 0b00..Not dependent on the direction of any counter - * 0b01..Reversed when counter L or the unified counter is counting down - * 0b10..Reversed when counter H is counting down (do not use this value when CONFIG[UNIFY] = 1) - * 0b11..Reserved (do not program this value) - */ -#define SCT_OUTPUTDIRCTRL_SETCLR1(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUTDIRCTRL_SETCLR1_SHIFT)) & SCT_OUTPUTDIRCTRL_SETCLR1_MASK) - -#define SCT_OUTPUTDIRCTRL_SETCLR2_MASK (0x30U) -#define SCT_OUTPUTDIRCTRL_SETCLR2_SHIFT (4U) -/*! SETCLR2 - Set and Clear Operation on Output - * 0b00..Not dependent on the direction of any counter - * 0b01..Reversed when counter L or the unified counter is counting down - * 0b10..Reversed when counter H is counting down (do not use this value when CONFIG[UNIFY] = 1) - * 0b11..Reserved (do not program this value) - */ -#define SCT_OUTPUTDIRCTRL_SETCLR2(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUTDIRCTRL_SETCLR2_SHIFT)) & SCT_OUTPUTDIRCTRL_SETCLR2_MASK) - -#define SCT_OUTPUTDIRCTRL_SETCLR3_MASK (0xC0U) -#define SCT_OUTPUTDIRCTRL_SETCLR3_SHIFT (6U) -/*! SETCLR3 - Set and Clear Operation on Output - * 0b00..Not dependent on the direction of any counter - * 0b01..Reversed when counter L or the unified counter is counting down - * 0b10..Reversed when counter H is counting down (do not use this value when CONFIG[UNIFY] = 1) - * 0b11..Reserved (do not program this value) - */ -#define SCT_OUTPUTDIRCTRL_SETCLR3(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUTDIRCTRL_SETCLR3_SHIFT)) & SCT_OUTPUTDIRCTRL_SETCLR3_MASK) - -#define SCT_OUTPUTDIRCTRL_SETCLR4_MASK (0x300U) -#define SCT_OUTPUTDIRCTRL_SETCLR4_SHIFT (8U) -/*! SETCLR4 - Set and Clear Operation on Output - * 0b00..Not dependent on the direction of any counter - * 0b01..Reversed when counter L or the unified counter is counting down - * 0b10..Reversed when counter H is counting down (do not use this value when CONFIG[UNIFY] = 1) - * 0b11..Reserved (do not program this value) - */ -#define SCT_OUTPUTDIRCTRL_SETCLR4(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUTDIRCTRL_SETCLR4_SHIFT)) & SCT_OUTPUTDIRCTRL_SETCLR4_MASK) - -#define SCT_OUTPUTDIRCTRL_SETCLR5_MASK (0xC00U) -#define SCT_OUTPUTDIRCTRL_SETCLR5_SHIFT (10U) -/*! SETCLR5 - Set and Clear Operation on Output - * 0b00..Not dependent on the direction of any counter - * 0b01..Reversed when counter L or the unified counter is counting down - * 0b10..Reversed when counter H is counting down (do not use this value when CONFIG[UNIFY] = 1) - * 0b11..Reserved (do not program this value) - */ -#define SCT_OUTPUTDIRCTRL_SETCLR5(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUTDIRCTRL_SETCLR5_SHIFT)) & SCT_OUTPUTDIRCTRL_SETCLR5_MASK) - -#define SCT_OUTPUTDIRCTRL_SETCLR6_MASK (0x3000U) -#define SCT_OUTPUTDIRCTRL_SETCLR6_SHIFT (12U) -/*! SETCLR6 - Set and Clear Operation on Output - * 0b00..Not dependent on the direction of any counter - * 0b01..Reversed when counter L or the unified counter is counting down - * 0b10..Reversed when counter H is counting down (do not use this value when CONFIG[UNIFY] = 1) - * 0b11..Reserved (do not program this value) - */ -#define SCT_OUTPUTDIRCTRL_SETCLR6(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUTDIRCTRL_SETCLR6_SHIFT)) & SCT_OUTPUTDIRCTRL_SETCLR6_MASK) - -#define SCT_OUTPUTDIRCTRL_SETCLR7_MASK (0xC000U) -#define SCT_OUTPUTDIRCTRL_SETCLR7_SHIFT (14U) -/*! SETCLR7 - Set and Clear Operation on Output - * 0b00..Not dependent on the direction of any counter - * 0b01..Reversed when counter L or the unified counter is counting down - * 0b10..Reversed when counter H is counting down (do not use this value when CONFIG[UNIFY] = 1) - * 0b11..Reserved (do not program this value) - */ -#define SCT_OUTPUTDIRCTRL_SETCLR7(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUTDIRCTRL_SETCLR7_SHIFT)) & SCT_OUTPUTDIRCTRL_SETCLR7_MASK) - -#define SCT_OUTPUTDIRCTRL_SETCLR8_MASK (0x30000U) -#define SCT_OUTPUTDIRCTRL_SETCLR8_SHIFT (16U) -/*! SETCLR8 - Set and Clear Operation on Output - * 0b00..Not dependent on the direction of any counter - * 0b01..Reversed when counter L or the unified counter is counting down - * 0b10..Reversed when counter H is counting down (do not use this value when CONFIG[UNIFY] = 1) - * 0b11..Reserved (do not program this value) - */ -#define SCT_OUTPUTDIRCTRL_SETCLR8(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUTDIRCTRL_SETCLR8_SHIFT)) & SCT_OUTPUTDIRCTRL_SETCLR8_MASK) - -#define SCT_OUTPUTDIRCTRL_SETCLR9_MASK (0xC0000U) -#define SCT_OUTPUTDIRCTRL_SETCLR9_SHIFT (18U) -/*! SETCLR9 - Set and Clear Operation on Output - * 0b00..Not dependent on the direction of any counter - * 0b01..Reversed when counter L or the unified counter is counting down - * 0b10..Reversed when counter H is counting down (do not use this value when CONFIG[UNIFY] = 1) - * 0b11..Reserved (do not program this value) - */ -#define SCT_OUTPUTDIRCTRL_SETCLR9(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUTDIRCTRL_SETCLR9_SHIFT)) & SCT_OUTPUTDIRCTRL_SETCLR9_MASK) -/*! @} */ - -/*! @name RES - Output Conflict Resolution */ -/*! @{ */ - -#define SCT_RES_O0RES_MASK (0x3U) -#define SCT_RES_O0RES_SHIFT (0U) -/*! O0RES - Output Resolution - * 0b00..No change - * 0b01..Set output (or clear, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b10..Clear output (or set, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b11..Toggle output - */ -#define SCT_RES_O0RES(x) (((uint32_t)(((uint32_t)(x)) << SCT_RES_O0RES_SHIFT)) & SCT_RES_O0RES_MASK) - -#define SCT_RES_O1RES_MASK (0xCU) -#define SCT_RES_O1RES_SHIFT (2U) -/*! O1RES - Output Resolution - * 0b00..No change - * 0b01..Set output (or clear, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b10..Clear output (or set, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b11..Toggle output - */ -#define SCT_RES_O1RES(x) (((uint32_t)(((uint32_t)(x)) << SCT_RES_O1RES_SHIFT)) & SCT_RES_O1RES_MASK) - -#define SCT_RES_O2RES_MASK (0x30U) -#define SCT_RES_O2RES_SHIFT (4U) -/*! O2RES - Output Resolution - * 0b00..No change - * 0b01..Set output (or clear, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b10..Clear output (or set, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b11..Toggle output - */ -#define SCT_RES_O2RES(x) (((uint32_t)(((uint32_t)(x)) << SCT_RES_O2RES_SHIFT)) & SCT_RES_O2RES_MASK) - -#define SCT_RES_O3RES_MASK (0xC0U) -#define SCT_RES_O3RES_SHIFT (6U) -/*! O3RES - Output Resolution - * 0b00..No change - * 0b01..Set output (or clear, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b10..Clear output (or set, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b11..Toggle output - */ -#define SCT_RES_O3RES(x) (((uint32_t)(((uint32_t)(x)) << SCT_RES_O3RES_SHIFT)) & SCT_RES_O3RES_MASK) - -#define SCT_RES_O4RES_MASK (0x300U) -#define SCT_RES_O4RES_SHIFT (8U) -/*! O4RES - Output Resolution - * 0b00..No change - * 0b01..Set output (or clear, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b10..Clear output (or set, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b11..Toggle output - */ -#define SCT_RES_O4RES(x) (((uint32_t)(((uint32_t)(x)) << SCT_RES_O4RES_SHIFT)) & SCT_RES_O4RES_MASK) - -#define SCT_RES_O5RES_MASK (0xC00U) -#define SCT_RES_O5RES_SHIFT (10U) -/*! O5RES - Output Resolution - * 0b00..No change - * 0b01..Set output (or clear, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b10..Clear output (or set, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b11..Toggle output - */ -#define SCT_RES_O5RES(x) (((uint32_t)(((uint32_t)(x)) << SCT_RES_O5RES_SHIFT)) & SCT_RES_O5RES_MASK) - -#define SCT_RES_O6RES_MASK (0x3000U) -#define SCT_RES_O6RES_SHIFT (12U) -/*! O6RES - Output Resolution - * 0b00..No change - * 0b01..Set output (or clear, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b10..Clear output (or set, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b11..Toggle output - */ -#define SCT_RES_O6RES(x) (((uint32_t)(((uint32_t)(x)) << SCT_RES_O6RES_SHIFT)) & SCT_RES_O6RES_MASK) - -#define SCT_RES_O7RES_MASK (0xC000U) -#define SCT_RES_O7RES_SHIFT (14U) -/*! O7RES - Output Resolution - * 0b00..No change - * 0b01..Set output (or clear, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b10..Clear output (or set, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b11..Toggle output - */ -#define SCT_RES_O7RES(x) (((uint32_t)(((uint32_t)(x)) << SCT_RES_O7RES_SHIFT)) & SCT_RES_O7RES_MASK) - -#define SCT_RES_O8RES_MASK (0x30000U) -#define SCT_RES_O8RES_SHIFT (16U) -/*! O8RES - Output Resolution - * 0b00..No change - * 0b01..Set output (or clear, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b10..Clear output (or set, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b11..Toggle output - */ -#define SCT_RES_O8RES(x) (((uint32_t)(((uint32_t)(x)) << SCT_RES_O8RES_SHIFT)) & SCT_RES_O8RES_MASK) - -#define SCT_RES_O9RES_MASK (0xC0000U) -#define SCT_RES_O9RES_SHIFT (18U) -/*! O9RES - Output Resolution - * 0b00..No change - * 0b01..Set output (or clear, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b10..Clear output (or set, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b11..Toggle output - */ -#define SCT_RES_O9RES(x) (((uint32_t)(((uint32_t)(x)) << SCT_RES_O9RES_SHIFT)) & SCT_RES_O9RES_MASK) -/*! @} */ - -/*! @name DMAREQ0 - DMA Request 0 */ -/*! @{ */ - -#define SCT_DMAREQ0_DEV_0_MASK (0x1U) -#define SCT_DMAREQ0_DEV_0_SHIFT (0U) -/*! DEV_0 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_0(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_0_SHIFT)) & SCT_DMAREQ0_DEV_0_MASK) - -#define SCT_DMAREQ0_DEV_1_MASK (0x2U) -#define SCT_DMAREQ0_DEV_1_SHIFT (1U) -/*! DEV_1 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_1(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_1_SHIFT)) & SCT_DMAREQ0_DEV_1_MASK) - -#define SCT_DMAREQ0_DEV_2_MASK (0x4U) -#define SCT_DMAREQ0_DEV_2_SHIFT (2U) -/*! DEV_2 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_2(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_2_SHIFT)) & SCT_DMAREQ0_DEV_2_MASK) - -#define SCT_DMAREQ0_DEV_3_MASK (0x8U) -#define SCT_DMAREQ0_DEV_3_SHIFT (3U) -/*! DEV_3 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_3(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_3_SHIFT)) & SCT_DMAREQ0_DEV_3_MASK) - -#define SCT_DMAREQ0_DEV_4_MASK (0x10U) -#define SCT_DMAREQ0_DEV_4_SHIFT (4U) -/*! DEV_4 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_4(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_4_SHIFT)) & SCT_DMAREQ0_DEV_4_MASK) - -#define SCT_DMAREQ0_DEV_5_MASK (0x20U) -#define SCT_DMAREQ0_DEV_5_SHIFT (5U) -/*! DEV_5 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_5(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_5_SHIFT)) & SCT_DMAREQ0_DEV_5_MASK) - -#define SCT_DMAREQ0_DEV_6_MASK (0x40U) -#define SCT_DMAREQ0_DEV_6_SHIFT (6U) -/*! DEV_6 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_6(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_6_SHIFT)) & SCT_DMAREQ0_DEV_6_MASK) - -#define SCT_DMAREQ0_DEV_7_MASK (0x80U) -#define SCT_DMAREQ0_DEV_7_SHIFT (7U) -/*! DEV_7 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_7(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_7_SHIFT)) & SCT_DMAREQ0_DEV_7_MASK) - -#define SCT_DMAREQ0_DEV_8_MASK (0x100U) -#define SCT_DMAREQ0_DEV_8_SHIFT (8U) -/*! DEV_8 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_8(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_8_SHIFT)) & SCT_DMAREQ0_DEV_8_MASK) - -#define SCT_DMAREQ0_DEV_9_MASK (0x200U) -#define SCT_DMAREQ0_DEV_9_SHIFT (9U) -/*! DEV_9 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_9(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_9_SHIFT)) & SCT_DMAREQ0_DEV_9_MASK) - -#define SCT_DMAREQ0_DEV_10_MASK (0x400U) -#define SCT_DMAREQ0_DEV_10_SHIFT (10U) -/*! DEV_10 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_10(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_10_SHIFT)) & SCT_DMAREQ0_DEV_10_MASK) - -#define SCT_DMAREQ0_DEV_11_MASK (0x800U) -#define SCT_DMAREQ0_DEV_11_SHIFT (11U) -/*! DEV_11 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_11(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_11_SHIFT)) & SCT_DMAREQ0_DEV_11_MASK) - -#define SCT_DMAREQ0_DEV_12_MASK (0x1000U) -#define SCT_DMAREQ0_DEV_12_SHIFT (12U) -/*! DEV_12 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_12(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_12_SHIFT)) & SCT_DMAREQ0_DEV_12_MASK) - -#define SCT_DMAREQ0_DEV_13_MASK (0x2000U) -#define SCT_DMAREQ0_DEV_13_SHIFT (13U) -/*! DEV_13 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_13(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_13_SHIFT)) & SCT_DMAREQ0_DEV_13_MASK) - -#define SCT_DMAREQ0_DEV_14_MASK (0x4000U) -#define SCT_DMAREQ0_DEV_14_SHIFT (14U) -/*! DEV_14 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_14(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_14_SHIFT)) & SCT_DMAREQ0_DEV_14_MASK) - -#define SCT_DMAREQ0_DEV_15_MASK (0x8000U) -#define SCT_DMAREQ0_DEV_15_SHIFT (15U) -/*! DEV_15 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_15(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_15_SHIFT)) & SCT_DMAREQ0_DEV_15_MASK) - -#define SCT_DMAREQ0_DRL0_MASK (0x40000000U) -#define SCT_DMAREQ0_DRL0_SHIFT (30U) -/*! DRL0 - DMA Request Low 0 */ -#define SCT_DMAREQ0_DRL0(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DRL0_SHIFT)) & SCT_DMAREQ0_DRL0_MASK) - -#define SCT_DMAREQ0_DRQ0_MASK (0x80000000U) -#define SCT_DMAREQ0_DRQ0_SHIFT (31U) -/*! DRQ0 - DMA Request 0 State */ -#define SCT_DMAREQ0_DRQ0(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DRQ0_SHIFT)) & SCT_DMAREQ0_DRQ0_MASK) -/*! @} */ - -/*! @name DMAREQ1 - DMA Request 1 */ -/*! @{ */ - -#define SCT_DMAREQ1_DEV_0_MASK (0x1U) -#define SCT_DMAREQ1_DEV_0_SHIFT (0U) -/*! DEV_0 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_0(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_0_SHIFT)) & SCT_DMAREQ1_DEV_0_MASK) - -#define SCT_DMAREQ1_DEV_1_MASK (0x2U) -#define SCT_DMAREQ1_DEV_1_SHIFT (1U) -/*! DEV_1 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_1(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_1_SHIFT)) & SCT_DMAREQ1_DEV_1_MASK) - -#define SCT_DMAREQ1_DEV_2_MASK (0x4U) -#define SCT_DMAREQ1_DEV_2_SHIFT (2U) -/*! DEV_2 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_2(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_2_SHIFT)) & SCT_DMAREQ1_DEV_2_MASK) - -#define SCT_DMAREQ1_DEV_3_MASK (0x8U) -#define SCT_DMAREQ1_DEV_3_SHIFT (3U) -/*! DEV_3 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_3(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_3_SHIFT)) & SCT_DMAREQ1_DEV_3_MASK) - -#define SCT_DMAREQ1_DEV_4_MASK (0x10U) -#define SCT_DMAREQ1_DEV_4_SHIFT (4U) -/*! DEV_4 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_4(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_4_SHIFT)) & SCT_DMAREQ1_DEV_4_MASK) - -#define SCT_DMAREQ1_DEV_5_MASK (0x20U) -#define SCT_DMAREQ1_DEV_5_SHIFT (5U) -/*! DEV_5 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_5(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_5_SHIFT)) & SCT_DMAREQ1_DEV_5_MASK) - -#define SCT_DMAREQ1_DEV_6_MASK (0x40U) -#define SCT_DMAREQ1_DEV_6_SHIFT (6U) -/*! DEV_6 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_6(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_6_SHIFT)) & SCT_DMAREQ1_DEV_6_MASK) - -#define SCT_DMAREQ1_DEV_7_MASK (0x80U) -#define SCT_DMAREQ1_DEV_7_SHIFT (7U) -/*! DEV_7 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_7(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_7_SHIFT)) & SCT_DMAREQ1_DEV_7_MASK) - -#define SCT_DMAREQ1_DEV_8_MASK (0x100U) -#define SCT_DMAREQ1_DEV_8_SHIFT (8U) -/*! DEV_8 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_8(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_8_SHIFT)) & SCT_DMAREQ1_DEV_8_MASK) - -#define SCT_DMAREQ1_DEV_9_MASK (0x200U) -#define SCT_DMAREQ1_DEV_9_SHIFT (9U) -/*! DEV_9 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_9(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_9_SHIFT)) & SCT_DMAREQ1_DEV_9_MASK) - -#define SCT_DMAREQ1_DEV_10_MASK (0x400U) -#define SCT_DMAREQ1_DEV_10_SHIFT (10U) -/*! DEV_10 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_10(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_10_SHIFT)) & SCT_DMAREQ1_DEV_10_MASK) - -#define SCT_DMAREQ1_DEV_11_MASK (0x800U) -#define SCT_DMAREQ1_DEV_11_SHIFT (11U) -/*! DEV_11 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_11(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_11_SHIFT)) & SCT_DMAREQ1_DEV_11_MASK) - -#define SCT_DMAREQ1_DEV_12_MASK (0x1000U) -#define SCT_DMAREQ1_DEV_12_SHIFT (12U) -/*! DEV_12 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_12(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_12_SHIFT)) & SCT_DMAREQ1_DEV_12_MASK) - -#define SCT_DMAREQ1_DEV_13_MASK (0x2000U) -#define SCT_DMAREQ1_DEV_13_SHIFT (13U) -/*! DEV_13 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_13(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_13_SHIFT)) & SCT_DMAREQ1_DEV_13_MASK) - -#define SCT_DMAREQ1_DEV_14_MASK (0x4000U) -#define SCT_DMAREQ1_DEV_14_SHIFT (14U) -/*! DEV_14 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_14(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_14_SHIFT)) & SCT_DMAREQ1_DEV_14_MASK) - -#define SCT_DMAREQ1_DEV_15_MASK (0x8000U) -#define SCT_DMAREQ1_DEV_15_SHIFT (15U) -/*! DEV_15 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_15(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_15_SHIFT)) & SCT_DMAREQ1_DEV_15_MASK) - -#define SCT_DMAREQ1_DRL1_MASK (0x40000000U) -#define SCT_DMAREQ1_DRL1_SHIFT (30U) -/*! DRL1 - DMA Request Low 1 */ -#define SCT_DMAREQ1_DRL1(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DRL1_SHIFT)) & SCT_DMAREQ1_DRL1_MASK) - -#define SCT_DMAREQ1_DRQ1_MASK (0x80000000U) -#define SCT_DMAREQ1_DRQ1_SHIFT (31U) -/*! DRQ1 - DMA Request 1 State */ -#define SCT_DMAREQ1_DRQ1(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DRQ1_SHIFT)) & SCT_DMAREQ1_DRQ1_MASK) -/*! @} */ - -/*! @name EVEN - Event Interrupt Enable */ -/*! @{ */ - -#define SCT_EVEN_IEN0_MASK (0x1U) -#define SCT_EVEN_IEN0_SHIFT (0U) -/*! IEN0 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN0(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN0_SHIFT)) & SCT_EVEN_IEN0_MASK) - -#define SCT_EVEN_IEN1_MASK (0x2U) -#define SCT_EVEN_IEN1_SHIFT (1U) -/*! IEN1 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN1(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN1_SHIFT)) & SCT_EVEN_IEN1_MASK) - -#define SCT_EVEN_IEN2_MASK (0x4U) -#define SCT_EVEN_IEN2_SHIFT (2U) -/*! IEN2 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN2(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN2_SHIFT)) & SCT_EVEN_IEN2_MASK) - -#define SCT_EVEN_IEN3_MASK (0x8U) -#define SCT_EVEN_IEN3_SHIFT (3U) -/*! IEN3 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN3(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN3_SHIFT)) & SCT_EVEN_IEN3_MASK) - -#define SCT_EVEN_IEN4_MASK (0x10U) -#define SCT_EVEN_IEN4_SHIFT (4U) -/*! IEN4 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN4(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN4_SHIFT)) & SCT_EVEN_IEN4_MASK) - -#define SCT_EVEN_IEN5_MASK (0x20U) -#define SCT_EVEN_IEN5_SHIFT (5U) -/*! IEN5 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN5(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN5_SHIFT)) & SCT_EVEN_IEN5_MASK) - -#define SCT_EVEN_IEN6_MASK (0x40U) -#define SCT_EVEN_IEN6_SHIFT (6U) -/*! IEN6 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN6(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN6_SHIFT)) & SCT_EVEN_IEN6_MASK) - -#define SCT_EVEN_IEN7_MASK (0x80U) -#define SCT_EVEN_IEN7_SHIFT (7U) -/*! IEN7 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN7(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN7_SHIFT)) & SCT_EVEN_IEN7_MASK) - -#define SCT_EVEN_IEN8_MASK (0x100U) -#define SCT_EVEN_IEN8_SHIFT (8U) -/*! IEN8 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN8(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN8_SHIFT)) & SCT_EVEN_IEN8_MASK) - -#define SCT_EVEN_IEN9_MASK (0x200U) -#define SCT_EVEN_IEN9_SHIFT (9U) -/*! IEN9 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN9(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN9_SHIFT)) & SCT_EVEN_IEN9_MASK) - -#define SCT_EVEN_IEN10_MASK (0x400U) -#define SCT_EVEN_IEN10_SHIFT (10U) -/*! IEN10 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN10(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN10_SHIFT)) & SCT_EVEN_IEN10_MASK) - -#define SCT_EVEN_IEN11_MASK (0x800U) -#define SCT_EVEN_IEN11_SHIFT (11U) -/*! IEN11 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN11(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN11_SHIFT)) & SCT_EVEN_IEN11_MASK) - -#define SCT_EVEN_IEN12_MASK (0x1000U) -#define SCT_EVEN_IEN12_SHIFT (12U) -/*! IEN12 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN12(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN12_SHIFT)) & SCT_EVEN_IEN12_MASK) - -#define SCT_EVEN_IEN13_MASK (0x2000U) -#define SCT_EVEN_IEN13_SHIFT (13U) -/*! IEN13 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN13(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN13_SHIFT)) & SCT_EVEN_IEN13_MASK) - -#define SCT_EVEN_IEN14_MASK (0x4000U) -#define SCT_EVEN_IEN14_SHIFT (14U) -/*! IEN14 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN14(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN14_SHIFT)) & SCT_EVEN_IEN14_MASK) - -#define SCT_EVEN_IEN15_MASK (0x8000U) -#define SCT_EVEN_IEN15_SHIFT (15U) -/*! IEN15 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN15(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN15_SHIFT)) & SCT_EVEN_IEN15_MASK) -/*! @} */ - -/*! @name EVFLAG - Event Flag */ -/*! @{ */ - -#define SCT_EVFLAG_FLAG0_MASK (0x1U) -#define SCT_EVFLAG_FLAG0_SHIFT (0U) -/*! FLAG0 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG0(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG0_SHIFT)) & SCT_EVFLAG_FLAG0_MASK) - -#define SCT_EVFLAG_FLAG1_MASK (0x2U) -#define SCT_EVFLAG_FLAG1_SHIFT (1U) -/*! FLAG1 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG1(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG1_SHIFT)) & SCT_EVFLAG_FLAG1_MASK) - -#define SCT_EVFLAG_FLAG2_MASK (0x4U) -#define SCT_EVFLAG_FLAG2_SHIFT (2U) -/*! FLAG2 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG2(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG2_SHIFT)) & SCT_EVFLAG_FLAG2_MASK) - -#define SCT_EVFLAG_FLAG3_MASK (0x8U) -#define SCT_EVFLAG_FLAG3_SHIFT (3U) -/*! FLAG3 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG3(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG3_SHIFT)) & SCT_EVFLAG_FLAG3_MASK) - -#define SCT_EVFLAG_FLAG4_MASK (0x10U) -#define SCT_EVFLAG_FLAG4_SHIFT (4U) -/*! FLAG4 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG4(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG4_SHIFT)) & SCT_EVFLAG_FLAG4_MASK) - -#define SCT_EVFLAG_FLAG5_MASK (0x20U) -#define SCT_EVFLAG_FLAG5_SHIFT (5U) -/*! FLAG5 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG5(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG5_SHIFT)) & SCT_EVFLAG_FLAG5_MASK) - -#define SCT_EVFLAG_FLAG6_MASK (0x40U) -#define SCT_EVFLAG_FLAG6_SHIFT (6U) -/*! FLAG6 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG6(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG6_SHIFT)) & SCT_EVFLAG_FLAG6_MASK) - -#define SCT_EVFLAG_FLAG7_MASK (0x80U) -#define SCT_EVFLAG_FLAG7_SHIFT (7U) -/*! FLAG7 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG7(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG7_SHIFT)) & SCT_EVFLAG_FLAG7_MASK) - -#define SCT_EVFLAG_FLAG8_MASK (0x100U) -#define SCT_EVFLAG_FLAG8_SHIFT (8U) -/*! FLAG8 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG8(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG8_SHIFT)) & SCT_EVFLAG_FLAG8_MASK) - -#define SCT_EVFLAG_FLAG9_MASK (0x200U) -#define SCT_EVFLAG_FLAG9_SHIFT (9U) -/*! FLAG9 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG9(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG9_SHIFT)) & SCT_EVFLAG_FLAG9_MASK) - -#define SCT_EVFLAG_FLAG10_MASK (0x400U) -#define SCT_EVFLAG_FLAG10_SHIFT (10U) -/*! FLAG10 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG10(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG10_SHIFT)) & SCT_EVFLAG_FLAG10_MASK) - -#define SCT_EVFLAG_FLAG11_MASK (0x800U) -#define SCT_EVFLAG_FLAG11_SHIFT (11U) -/*! FLAG11 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG11(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG11_SHIFT)) & SCT_EVFLAG_FLAG11_MASK) - -#define SCT_EVFLAG_FLAG12_MASK (0x1000U) -#define SCT_EVFLAG_FLAG12_SHIFT (12U) -/*! FLAG12 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG12(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG12_SHIFT)) & SCT_EVFLAG_FLAG12_MASK) - -#define SCT_EVFLAG_FLAG13_MASK (0x2000U) -#define SCT_EVFLAG_FLAG13_SHIFT (13U) -/*! FLAG13 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG13(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG13_SHIFT)) & SCT_EVFLAG_FLAG13_MASK) - -#define SCT_EVFLAG_FLAG14_MASK (0x4000U) -#define SCT_EVFLAG_FLAG14_SHIFT (14U) -/*! FLAG14 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG14(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG14_SHIFT)) & SCT_EVFLAG_FLAG14_MASK) - -#define SCT_EVFLAG_FLAG15_MASK (0x8000U) -#define SCT_EVFLAG_FLAG15_SHIFT (15U) -/*! FLAG15 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG15(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG15_SHIFT)) & SCT_EVFLAG_FLAG15_MASK) -/*! @} */ - -/*! @name CONEN - Conflict Interrupt Enable */ -/*! @{ */ - -#define SCT_CONEN_NCEN0_MASK (0x1U) -#define SCT_CONEN_NCEN0_SHIFT (0U) -/*! NCEN0 - No Change Conflict Event and Interrupt Enable - * 0b0..No interrupt - * 0b1..Interrupt - */ -#define SCT_CONEN_NCEN0(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONEN_NCEN0_SHIFT)) & SCT_CONEN_NCEN0_MASK) - -#define SCT_CONEN_NCEN1_MASK (0x2U) -#define SCT_CONEN_NCEN1_SHIFT (1U) -/*! NCEN1 - No Change Conflict Event and Interrupt Enable - * 0b0..No interrupt - * 0b1..Interrupt - */ -#define SCT_CONEN_NCEN1(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONEN_NCEN1_SHIFT)) & SCT_CONEN_NCEN1_MASK) - -#define SCT_CONEN_NCEN2_MASK (0x4U) -#define SCT_CONEN_NCEN2_SHIFT (2U) -/*! NCEN2 - No Change Conflict Event and Interrupt Enable - * 0b0..No interrupt - * 0b1..Interrupt - */ -#define SCT_CONEN_NCEN2(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONEN_NCEN2_SHIFT)) & SCT_CONEN_NCEN2_MASK) - -#define SCT_CONEN_NCEN3_MASK (0x8U) -#define SCT_CONEN_NCEN3_SHIFT (3U) -/*! NCEN3 - No Change Conflict Event and Interrupt Enable - * 0b0..No interrupt - * 0b1..Interrupt - */ -#define SCT_CONEN_NCEN3(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONEN_NCEN3_SHIFT)) & SCT_CONEN_NCEN3_MASK) - -#define SCT_CONEN_NCEN4_MASK (0x10U) -#define SCT_CONEN_NCEN4_SHIFT (4U) -/*! NCEN4 - No Change Conflict Event and Interrupt Enable - * 0b0..No interrupt - * 0b1..Interrupt - */ -#define SCT_CONEN_NCEN4(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONEN_NCEN4_SHIFT)) & SCT_CONEN_NCEN4_MASK) - -#define SCT_CONEN_NCEN5_MASK (0x20U) -#define SCT_CONEN_NCEN5_SHIFT (5U) -/*! NCEN5 - No Change Conflict Event and Interrupt Enable - * 0b0..No interrupt - * 0b1..Interrupt - */ -#define SCT_CONEN_NCEN5(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONEN_NCEN5_SHIFT)) & SCT_CONEN_NCEN5_MASK) - -#define SCT_CONEN_NCEN6_MASK (0x40U) -#define SCT_CONEN_NCEN6_SHIFT (6U) -/*! NCEN6 - No Change Conflict Event and Interrupt Enable - * 0b0..No interrupt - * 0b1..Interrupt - */ -#define SCT_CONEN_NCEN6(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONEN_NCEN6_SHIFT)) & SCT_CONEN_NCEN6_MASK) - -#define SCT_CONEN_NCEN7_MASK (0x80U) -#define SCT_CONEN_NCEN7_SHIFT (7U) -/*! NCEN7 - No Change Conflict Event and Interrupt Enable - * 0b0..No interrupt - * 0b1..Interrupt - */ -#define SCT_CONEN_NCEN7(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONEN_NCEN7_SHIFT)) & SCT_CONEN_NCEN7_MASK) - -#define SCT_CONEN_NCEN8_MASK (0x100U) -#define SCT_CONEN_NCEN8_SHIFT (8U) -/*! NCEN8 - No Change Conflict Event and Interrupt Enable - * 0b0..No interrupt - * 0b1..Interrupt - */ -#define SCT_CONEN_NCEN8(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONEN_NCEN8_SHIFT)) & SCT_CONEN_NCEN8_MASK) - -#define SCT_CONEN_NCEN9_MASK (0x200U) -#define SCT_CONEN_NCEN9_SHIFT (9U) -/*! NCEN9 - No Change Conflict Event and Interrupt Enable - * 0b0..No interrupt - * 0b1..Interrupt - */ -#define SCT_CONEN_NCEN9(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONEN_NCEN9_SHIFT)) & SCT_CONEN_NCEN9_MASK) -/*! @} */ - -/*! @name CONFLAG - Conflict Flag */ -/*! @{ */ - -#define SCT_CONFLAG_NCFLAG0_MASK (0x1U) -#define SCT_CONFLAG_NCFLAG0_SHIFT (0U) -/*! NCFLAG0 - No Change Conflict Event Flag - * 0b0..Did not occur - * 0b1..Occurred - */ -#define SCT_CONFLAG_NCFLAG0(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFLAG_NCFLAG0_SHIFT)) & SCT_CONFLAG_NCFLAG0_MASK) - -#define SCT_CONFLAG_NCFLAG1_MASK (0x2U) -#define SCT_CONFLAG_NCFLAG1_SHIFT (1U) -/*! NCFLAG1 - No Change Conflict Event Flag - * 0b0..Did not occur - * 0b1..Occurred - */ -#define SCT_CONFLAG_NCFLAG1(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFLAG_NCFLAG1_SHIFT)) & SCT_CONFLAG_NCFLAG1_MASK) - -#define SCT_CONFLAG_NCFLAG2_MASK (0x4U) -#define SCT_CONFLAG_NCFLAG2_SHIFT (2U) -/*! NCFLAG2 - No Change Conflict Event Flag - * 0b0..Did not occur - * 0b1..Occurred - */ -#define SCT_CONFLAG_NCFLAG2(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFLAG_NCFLAG2_SHIFT)) & SCT_CONFLAG_NCFLAG2_MASK) - -#define SCT_CONFLAG_NCFLAG3_MASK (0x8U) -#define SCT_CONFLAG_NCFLAG3_SHIFT (3U) -/*! NCFLAG3 - No Change Conflict Event Flag - * 0b0..Did not occur - * 0b1..Occurred - */ -#define SCT_CONFLAG_NCFLAG3(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFLAG_NCFLAG3_SHIFT)) & SCT_CONFLAG_NCFLAG3_MASK) - -#define SCT_CONFLAG_NCFLAG4_MASK (0x10U) -#define SCT_CONFLAG_NCFLAG4_SHIFT (4U) -/*! NCFLAG4 - No Change Conflict Event Flag - * 0b0..Did not occur - * 0b1..Occurred - */ -#define SCT_CONFLAG_NCFLAG4(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFLAG_NCFLAG4_SHIFT)) & SCT_CONFLAG_NCFLAG4_MASK) - -#define SCT_CONFLAG_NCFLAG5_MASK (0x20U) -#define SCT_CONFLAG_NCFLAG5_SHIFT (5U) -/*! NCFLAG5 - No Change Conflict Event Flag - * 0b0..Did not occur - * 0b1..Occurred - */ -#define SCT_CONFLAG_NCFLAG5(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFLAG_NCFLAG5_SHIFT)) & SCT_CONFLAG_NCFLAG5_MASK) - -#define SCT_CONFLAG_NCFLAG6_MASK (0x40U) -#define SCT_CONFLAG_NCFLAG6_SHIFT (6U) -/*! NCFLAG6 - No Change Conflict Event Flag - * 0b0..Did not occur - * 0b1..Occurred - */ -#define SCT_CONFLAG_NCFLAG6(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFLAG_NCFLAG6_SHIFT)) & SCT_CONFLAG_NCFLAG6_MASK) - -#define SCT_CONFLAG_NCFLAG7_MASK (0x80U) -#define SCT_CONFLAG_NCFLAG7_SHIFT (7U) -/*! NCFLAG7 - No Change Conflict Event Flag - * 0b0..Did not occur - * 0b1..Occurred - */ -#define SCT_CONFLAG_NCFLAG7(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFLAG_NCFLAG7_SHIFT)) & SCT_CONFLAG_NCFLAG7_MASK) - -#define SCT_CONFLAG_NCFLAG8_MASK (0x100U) -#define SCT_CONFLAG_NCFLAG8_SHIFT (8U) -/*! NCFLAG8 - No Change Conflict Event Flag - * 0b0..Did not occur - * 0b1..Occurred - */ -#define SCT_CONFLAG_NCFLAG8(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFLAG_NCFLAG8_SHIFT)) & SCT_CONFLAG_NCFLAG8_MASK) - -#define SCT_CONFLAG_NCFLAG9_MASK (0x200U) -#define SCT_CONFLAG_NCFLAG9_SHIFT (9U) -/*! NCFLAG9 - No Change Conflict Event Flag - * 0b0..Did not occur - * 0b1..Occurred - */ -#define SCT_CONFLAG_NCFLAG9(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFLAG_NCFLAG9_SHIFT)) & SCT_CONFLAG_NCFLAG9_MASK) - -#define SCT_CONFLAG_BUSERRL_MASK (0x40000000U) -#define SCT_CONFLAG_BUSERRL_SHIFT (30U) -/*! BUSERRL - Bus Error Low or Unified */ -#define SCT_CONFLAG_BUSERRL(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFLAG_BUSERRL_SHIFT)) & SCT_CONFLAG_BUSERRL_MASK) - -#define SCT_CONFLAG_BUSERRH_MASK (0x80000000U) -#define SCT_CONFLAG_BUSERRH_SHIFT (31U) -/*! BUSERRH - Bus Error High */ -#define SCT_CONFLAG_BUSERRH(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFLAG_BUSERRH_SHIFT)) & SCT_CONFLAG_BUSERRH_MASK) -/*! @} */ - -/*! @name CAPL - SCT_CAPL register */ -/*! @{ */ - -#define SCT_CAPL_CAPL_MASK (0xFFFFU) -#define SCT_CAPL_CAPL_SHIFT (0U) -#define SCT_CAPL_CAPL(x) (((uint16_t)(((uint16_t)(x)) << SCT_CAPL_CAPL_SHIFT)) & SCT_CAPL_CAPL_MASK) -/*! @} */ - -/* The count of SCT_CAPL */ -#define SCT_CAPL_COUNT (16U) - -/*! @name CAPH - SCT_CAPH register */ -/*! @{ */ - -#define SCT_CAPH_CAPH_MASK (0xFFFFU) -#define SCT_CAPH_CAPH_SHIFT (0U) -#define SCT_CAPH_CAPH(x) (((uint16_t)(((uint16_t)(x)) << SCT_CAPH_CAPH_SHIFT)) & SCT_CAPH_CAPH_MASK) -/*! @} */ - -/* The count of SCT_CAPH */ -#define SCT_CAPH_COUNT (16U) - -/*! @name CAP - Capture Value */ -/*! @{ */ - -#define SCT_CAP_CAPn_L_MASK (0xFFFFU) -#define SCT_CAP_CAPn_L_SHIFT (0U) -/*! CAPn_L - Capture Low */ -#define SCT_CAP_CAPn_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_CAP_CAPn_L_SHIFT)) & SCT_CAP_CAPn_L_MASK) - -#define SCT_CAP_CAPn_H_MASK (0xFFFF0000U) -#define SCT_CAP_CAPn_H_SHIFT (16U) -/*! CAPn_H - Capture High */ -#define SCT_CAP_CAPn_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_CAP_CAPn_H_SHIFT)) & SCT_CAP_CAPn_H_MASK) -/*! @} */ - -/* The count of SCT_CAP */ -#define SCT_CAP_COUNT (16U) - -/*! @name MATCHL - SCT_MATCHL register */ -/*! @{ */ - -#define SCT_MATCHL_MATCHL_MASK (0xFFFFU) -#define SCT_MATCHL_MATCHL_SHIFT (0U) -#define SCT_MATCHL_MATCHL(x) (((uint16_t)(((uint16_t)(x)) << SCT_MATCHL_MATCHL_SHIFT)) & SCT_MATCHL_MATCHL_MASK) -/*! @} */ - -/* The count of SCT_MATCHL */ -#define SCT_MATCHL_COUNT (16U) - -/*! @name MATCHH - SCT_MATCHH register */ -/*! @{ */ - -#define SCT_MATCHH_MATCHH_MASK (0xFFFFU) -#define SCT_MATCHH_MATCHH_SHIFT (0U) -#define SCT_MATCHH_MATCHH(x) (((uint16_t)(((uint16_t)(x)) << SCT_MATCHH_MATCHH_SHIFT)) & SCT_MATCHH_MATCHH_MASK) -/*! @} */ - -/* The count of SCT_MATCHH */ -#define SCT_MATCHH_COUNT (16U) - -/*! @name MATCH - Match Value */ -/*! @{ */ - -#define SCT_MATCH_MATCHn_L_MASK (0xFFFFU) -#define SCT_MATCH_MATCHn_L_SHIFT (0U) -/*! MATCHn_L - Match Low */ -#define SCT_MATCH_MATCHn_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_MATCH_MATCHn_L_SHIFT)) & SCT_MATCH_MATCHn_L_MASK) - -#define SCT_MATCH_MATCHn_H_MASK (0xFFFF0000U) -#define SCT_MATCH_MATCHn_H_SHIFT (16U) -/*! MATCHn_H - Match High */ -#define SCT_MATCH_MATCHn_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_MATCH_MATCHn_H_SHIFT)) & SCT_MATCH_MATCHn_H_MASK) -/*! @} */ - -/* The count of SCT_MATCH */ -#define SCT_MATCH_COUNT (16U) - -/*! @name FRACMAT - Fractional Match */ -/*! @{ */ - -#define SCT_FRACMAT_FRACMAT_L_MASK (0xFU) -#define SCT_FRACMAT_FRACMAT_L_SHIFT (0U) -/*! FRACMAT_L - Fractional Match Low */ -#define SCT_FRACMAT_FRACMAT_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_FRACMAT_FRACMAT_L_SHIFT)) & SCT_FRACMAT_FRACMAT_L_MASK) - -#define SCT_FRACMAT_FRACMAT_H_MASK (0xF0000U) -#define SCT_FRACMAT_FRACMAT_H_SHIFT (16U) -/*! FRACMAT_H - Fractional Match High */ -#define SCT_FRACMAT_FRACMAT_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_FRACMAT_FRACMAT_H_SHIFT)) & SCT_FRACMAT_FRACMAT_H_MASK) -/*! @} */ - -/* The count of SCT_FRACMAT */ -#define SCT_FRACMAT_COUNT (6U) - -/*! @name CAPCTRLL - SCT_CAPCTRLL register */ -/*! @{ */ - -#define SCT_CAPCTRLL_CAPCTRLL_MASK (0xFFFFU) -#define SCT_CAPCTRLL_CAPCTRLL_SHIFT (0U) -#define SCT_CAPCTRLL_CAPCTRLL(x) (((uint16_t)(((uint16_t)(x)) << SCT_CAPCTRLL_CAPCTRLL_SHIFT)) & SCT_CAPCTRLL_CAPCTRLL_MASK) -/*! @} */ - -/* The count of SCT_CAPCTRLL */ -#define SCT_CAPCTRLL_COUNT (16U) - -/*! @name CAPCTRLH - SCT_CAPCTRLH register */ -/*! @{ */ - -#define SCT_CAPCTRLH_CAPCTRLH_MASK (0xFFFFU) -#define SCT_CAPCTRLH_CAPCTRLH_SHIFT (0U) -#define SCT_CAPCTRLH_CAPCTRLH(x) (((uint16_t)(((uint16_t)(x)) << SCT_CAPCTRLH_CAPCTRLH_SHIFT)) & SCT_CAPCTRLH_CAPCTRLH_MASK) -/*! @} */ - -/* The count of SCT_CAPCTRLH */ -#define SCT_CAPCTRLH_COUNT (16U) - -/*! @name SCTCAPCTRL_CAPCTRL - Capture Control */ -/*! @{ */ - -#define SCT_SCTCAPCTRL_CAPCTRL_CAPCONn_L_MASK (0xFFFFU) -#define SCT_SCTCAPCTRL_CAPCTRL_CAPCONn_L_SHIFT (0U) -/*! CAPCONn_L - Capture Control Low */ -#define SCT_SCTCAPCTRL_CAPCTRL_CAPCONn_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_SCTCAPCTRL_CAPCTRL_CAPCONn_L_SHIFT)) & SCT_SCTCAPCTRL_CAPCTRL_CAPCONn_L_MASK) - -#define SCT_SCTCAPCTRL_CAPCTRL_CAPCONn_H_MASK (0xFFFF0000U) -#define SCT_SCTCAPCTRL_CAPCTRL_CAPCONn_H_SHIFT (16U) -/*! CAPCONn_H - Capture Control High */ -#define SCT_SCTCAPCTRL_CAPCTRL_CAPCONn_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_SCTCAPCTRL_CAPCTRL_CAPCONn_H_SHIFT)) & SCT_SCTCAPCTRL_CAPCTRL_CAPCONn_H_MASK) -/*! @} */ - -/* The count of SCT_SCTCAPCTRL_CAPCTRL */ -#define SCT_SCTCAPCTRL_CAPCTRL_COUNT (16U) - -/*! @name MATCHRELL - SCT_MATCHRELL register */ -/*! @{ */ - -#define SCT_MATCHRELL_MATCHRELL_MASK (0xFFFFU) -#define SCT_MATCHRELL_MATCHRELL_SHIFT (0U) -#define SCT_MATCHRELL_MATCHRELL(x) (((uint16_t)(((uint16_t)(x)) << SCT_MATCHRELL_MATCHRELL_SHIFT)) & SCT_MATCHRELL_MATCHRELL_MASK) -/*! @} */ - -/* The count of SCT_MATCHRELL */ -#define SCT_MATCHRELL_COUNT (16U) - -/*! @name MATCHRELH - SCT_MATCHRELH register */ -/*! @{ */ - -#define SCT_MATCHRELH_MATCHRELH_MASK (0xFFFFU) -#define SCT_MATCHRELH_MATCHRELH_SHIFT (0U) -#define SCT_MATCHRELH_MATCHRELH(x) (((uint16_t)(((uint16_t)(x)) << SCT_MATCHRELH_MATCHRELH_SHIFT)) & SCT_MATCHRELH_MATCHRELH_MASK) -/*! @} */ - -/* The count of SCT_MATCHRELH */ -#define SCT_MATCHRELH_COUNT (16U) - -/*! @name MATCHREL - Match Reload Value */ -/*! @{ */ - -#define SCT_MATCHREL_RELOADn_L_MASK (0xFFFFU) -#define SCT_MATCHREL_RELOADn_L_SHIFT (0U) -/*! RELOADn_L - Reload Low */ -#define SCT_MATCHREL_RELOADn_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_MATCHREL_RELOADn_L_SHIFT)) & SCT_MATCHREL_RELOADn_L_MASK) - -#define SCT_MATCHREL_RELOADn_H_MASK (0xFFFF0000U) -#define SCT_MATCHREL_RELOADn_H_SHIFT (16U) -/*! RELOADn_H - Reload High */ -#define SCT_MATCHREL_RELOADn_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_MATCHREL_RELOADn_H_SHIFT)) & SCT_MATCHREL_RELOADn_H_MASK) -/*! @} */ - -/* The count of SCT_MATCHREL */ -#define SCT_MATCHREL_COUNT (16U) - -/*! @name FRACMATREL - Fractional Match Reload */ -/*! @{ */ - -#define SCT_FRACMATREL_RELFRAC_L_MASK (0xFU) -#define SCT_FRACMATREL_RELFRAC_L_SHIFT (0U) -/*! RELFRAC_L - Reload Fractional Match Low */ -#define SCT_FRACMATREL_RELFRAC_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_FRACMATREL_RELFRAC_L_SHIFT)) & SCT_FRACMATREL_RELFRAC_L_MASK) - -#define SCT_FRACMATREL_RELFRAC_H_MASK (0xF0000U) -#define SCT_FRACMATREL_RELFRAC_H_SHIFT (16U) -/*! RELFRAC_H - Reload Fractional Match High */ -#define SCT_FRACMATREL_RELFRAC_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_FRACMATREL_RELFRAC_H_SHIFT)) & SCT_FRACMATREL_RELFRAC_H_MASK) -/*! @} */ - -/* The count of SCT_FRACMATREL */ -#define SCT_FRACMATREL_COUNT (6U) - -/*! @name EV_STATE - Event n State */ -/*! @{ */ - -#define SCT_EV_STATE_STATEMSKn_MASK (0xFFFFFFFFU) -#define SCT_EV_STATE_STATEMSKn_SHIFT (0U) -/*! STATEMSKn - Event State Mask */ -#define SCT_EV_STATE_STATEMSKn(x) (((uint32_t)(((uint32_t)(x)) << SCT_EV_STATE_STATEMSKn_SHIFT)) & SCT_EV_STATE_STATEMSKn_MASK) -/*! @} */ - -/* The count of SCT_EV_STATE */ -#define SCT_EV_STATE_COUNT (16U) - -/*! @name EV_CTRL - Event n Control */ -/*! @{ */ - -#define SCT_EV_CTRL_MATCHSEL_MASK (0xFU) -#define SCT_EV_CTRL_MATCHSEL_SHIFT (0U) -/*! MATCHSEL - Match Select */ -#define SCT_EV_CTRL_MATCHSEL(x) (((uint32_t)(((uint32_t)(x)) << SCT_EV_CTRL_MATCHSEL_SHIFT)) & SCT_EV_CTRL_MATCHSEL_MASK) - -#define SCT_EV_CTRL_HEVENT_MASK (0x10U) -#define SCT_EV_CTRL_HEVENT_SHIFT (4U) -/*! HEVENT - High Event - * 0b0..Low counter (selects the L state and the L match register that the MATCHSEL field specifies) - * 0b1..High counter (selects the H state and the H match register that the MATCHSEL field specifies) - */ -#define SCT_EV_CTRL_HEVENT(x) (((uint32_t)(((uint32_t)(x)) << SCT_EV_CTRL_HEVENT_SHIFT)) & SCT_EV_CTRL_HEVENT_MASK) - -#define SCT_EV_CTRL_OUTSEL_MASK (0x20U) -#define SCT_EV_CTRL_OUTSEL_SHIFT (5U) -/*! OUTSEL - Input and Output Select - * 0b0..Inputs - * 0b1..Outputs - */ -#define SCT_EV_CTRL_OUTSEL(x) (((uint32_t)(((uint32_t)(x)) << SCT_EV_CTRL_OUTSEL_SHIFT)) & SCT_EV_CTRL_OUTSEL_MASK) - -#define SCT_EV_CTRL_IOSEL_MASK (0x3C0U) -#define SCT_EV_CTRL_IOSEL_SHIFT (6U) -/*! IOSEL - Input or Output Signal Select */ -#define SCT_EV_CTRL_IOSEL(x) (((uint32_t)(((uint32_t)(x)) << SCT_EV_CTRL_IOSEL_SHIFT)) & SCT_EV_CTRL_IOSEL_MASK) - -#define SCT_EV_CTRL_IOCOND_MASK (0xC00U) -#define SCT_EV_CTRL_IOCOND_SHIFT (10U) -/*! IOCOND - Input or Output Condition - * 0b00..Low - * 0b01..Rise - * 0b10..Fall - * 0b11..High - */ -#define SCT_EV_CTRL_IOCOND(x) (((uint32_t)(((uint32_t)(x)) << SCT_EV_CTRL_IOCOND_SHIFT)) & SCT_EV_CTRL_IOCOND_MASK) - -#define SCT_EV_CTRL_COMBMODE_MASK (0x3000U) -#define SCT_EV_CTRL_COMBMODE_SHIFT (12U) -/*! COMBMODE - Combination Mode - * 0b00..OR (the event occurs when either the specified match or I/O condition occurs) - * 0b01..MATCH (uses the specified match only) - * 0b10..IO (uses the specified I/O condition only) - * 0b11..AND (the event occurs when the specified match and I/O condition occur simultaneously) - */ -#define SCT_EV_CTRL_COMBMODE(x) (((uint32_t)(((uint32_t)(x)) << SCT_EV_CTRL_COMBMODE_SHIFT)) & SCT_EV_CTRL_COMBMODE_MASK) - -#define SCT_EV_CTRL_STATELD_MASK (0x4000U) -#define SCT_EV_CTRL_STATELD_SHIFT (14U) -/*! STATELD - State Load - * 0b0..Value of STATEV added to that of STATE (the carry out is ignored) - * 0b1..Value of STATEV loaded into that of STATE - */ -#define SCT_EV_CTRL_STATELD(x) (((uint32_t)(((uint32_t)(x)) << SCT_EV_CTRL_STATELD_SHIFT)) & SCT_EV_CTRL_STATELD_MASK) - -#define SCT_EV_CTRL_STATEV_MASK (0xF8000U) -#define SCT_EV_CTRL_STATEV_SHIFT (15U) -/*! STATEV - State Value */ -#define SCT_EV_CTRL_STATEV(x) (((uint32_t)(((uint32_t)(x)) << SCT_EV_CTRL_STATEV_SHIFT)) & SCT_EV_CTRL_STATEV_MASK) - -#define SCT_EV_CTRL_MATCHMEM_MASK (0x100000U) -#define SCT_EV_CTRL_MATCHMEM_SHIFT (20U) -/*! MATCHMEM - Match Mem */ -#define SCT_EV_CTRL_MATCHMEM(x) (((uint32_t)(((uint32_t)(x)) << SCT_EV_CTRL_MATCHMEM_SHIFT)) & SCT_EV_CTRL_MATCHMEM_MASK) - -#define SCT_EV_CTRL_DIRECTION_MASK (0x600000U) -#define SCT_EV_CTRL_DIRECTION_SHIFT (21U) -/*! DIRECTION - Direction - * 0b00..Direction independent (event triggered regardless of the count direction) - * 0b01..Counting up (event triggered only during up-counting when CTRL[BIDIR] = 1) - * 0b10..Counting down (event triggered only during down-counting when CTRL[BIDIR] = 1) - * 0b11..Reserved - */ -#define SCT_EV_CTRL_DIRECTION(x) (((uint32_t)(((uint32_t)(x)) << SCT_EV_CTRL_DIRECTION_SHIFT)) & SCT_EV_CTRL_DIRECTION_MASK) -/*! @} */ - -/* The count of SCT_EV_CTRL */ -#define SCT_EV_CTRL_COUNT (16U) - -/*! @name OUT_SET - Output n Set */ -/*! @{ */ - -#define SCT_OUT_SET_SET_MASK (0xFFFFU) -#define SCT_OUT_SET_SET_SHIFT (0U) -/*! SET - Set Output */ -#define SCT_OUT_SET_SET(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUT_SET_SET_SHIFT)) & SCT_OUT_SET_SET_MASK) -/*! @} */ - -/* The count of SCT_OUT_SET */ -#define SCT_OUT_SET_COUNT (10U) - -/*! @name OUT_CLR - Output n Clear */ -/*! @{ */ - -#define SCT_OUT_CLR_CLR_MASK (0xFFFFU) -#define SCT_OUT_CLR_CLR_SHIFT (0U) -/*! CLR - Clear Output */ -#define SCT_OUT_CLR_CLR(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUT_CLR_CLR_SHIFT)) & SCT_OUT_CLR_CLR_MASK) -/*! @} */ - -/* The count of SCT_OUT_CLR */ -#define SCT_OUT_CLR_COUNT (10U) - - -/*! - * @} - */ /* end of group SCT_Register_Masks */ - - -/* SCT - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral SCT0 base address */ - #define SCT0_BASE (0x50091000u) - /** Peripheral SCT0 base address */ - #define SCT0_BASE_NS (0x40091000u) - /** Peripheral SCT0 base pointer */ - #define SCT0 ((SCT_Type *)SCT0_BASE) - /** Peripheral SCT0 base pointer */ - #define SCT0_NS ((SCT_Type *)SCT0_BASE_NS) - /** Array initializer of SCT peripheral base addresses */ - #define SCT_BASE_ADDRS { SCT0_BASE } - /** Array initializer of SCT peripheral base pointers */ - #define SCT_BASE_PTRS { SCT0 } - /** Array initializer of SCT peripheral base addresses */ - #define SCT_BASE_ADDRS_NS { SCT0_BASE_NS } - /** Array initializer of SCT peripheral base pointers */ - #define SCT_BASE_PTRS_NS { SCT0_NS } -#else - /** Peripheral SCT0 base address */ - #define SCT0_BASE (0x40091000u) - /** Peripheral SCT0 base pointer */ - #define SCT0 ((SCT_Type *)SCT0_BASE) - /** Array initializer of SCT peripheral base addresses */ - #define SCT_BASE_ADDRS { SCT0_BASE } - /** Array initializer of SCT peripheral base pointers */ - #define SCT_BASE_PTRS { SCT0 } -#endif -/** Interrupt vectors for the SCT peripheral type */ -#define SCT_IRQS { SCT0_IRQn } - -/*! - * @} - */ /* end of group SCT_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- SEMA42 Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SEMA42_Peripheral_Access_Layer SEMA42 Peripheral Access Layer - * @{ - */ - -/** SEMA42 - Register Layout Typedef */ -typedef struct { - __IO uint8_t GATE3; /**< Gate, offset: 0x0 */ - __IO uint8_t GATE2; /**< Gate, offset: 0x1 */ - __IO uint8_t GATE1; /**< Gate, offset: 0x2 */ - __IO uint8_t GATE0; /**< Gate, offset: 0x3 */ - __IO uint8_t GATE7; /**< Gate, offset: 0x4 */ - __IO uint8_t GATE6; /**< Gate, offset: 0x5 */ - __IO uint8_t GATE5; /**< Gate, offset: 0x6 */ - __IO uint8_t GATE4; /**< Gate, offset: 0x7 */ - __IO uint8_t GATE11; /**< Gate, offset: 0x8 */ - __IO uint8_t GATE10; /**< Gate, offset: 0x9 */ - __IO uint8_t GATE9; /**< Gate, offset: 0xA */ - __IO uint8_t GATE8; /**< Gate, offset: 0xB */ - __IO uint8_t GATE15; /**< Gate, offset: 0xC */ - __IO uint8_t GATE14; /**< Gate, offset: 0xD */ - __IO uint8_t GATE13; /**< Gate, offset: 0xE */ - __IO uint8_t GATE12; /**< Gate, offset: 0xF */ - uint8_t RESERVED_0[50]; - union { /* offset: 0x42 */ - __I uint16_t RSTGT_R; /**< Reset Gate Read, offset: 0x42 */ - __O uint16_t RSTGT_W; /**< Reset Gate Write, offset: 0x42 */ - }; -} SEMA42_Type; - -/* ---------------------------------------------------------------------------- - -- SEMA42 Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SEMA42_Register_Masks SEMA42 Register Masks - * @{ - */ - -/*! @name GATE3 - Gate */ -/*! @{ */ - -#define SEMA42_GATE3_GTFSM_MASK (0xFU) -#define SEMA42_GATE3_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE3_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE3_GTFSM_SHIFT)) & SEMA42_GATE3_GTFSM_MASK) -/*! @} */ - -/*! @name GATE2 - Gate */ -/*! @{ */ - -#define SEMA42_GATE2_GTFSM_MASK (0xFU) -#define SEMA42_GATE2_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE2_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE2_GTFSM_SHIFT)) & SEMA42_GATE2_GTFSM_MASK) -/*! @} */ - -/*! @name GATE1 - Gate */ -/*! @{ */ - -#define SEMA42_GATE1_GTFSM_MASK (0xFU) -#define SEMA42_GATE1_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE1_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE1_GTFSM_SHIFT)) & SEMA42_GATE1_GTFSM_MASK) -/*! @} */ - -/*! @name GATE0 - Gate */ -/*! @{ */ - -#define SEMA42_GATE0_GTFSM_MASK (0xFU) -#define SEMA42_GATE0_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE0_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE0_GTFSM_SHIFT)) & SEMA42_GATE0_GTFSM_MASK) -/*! @} */ - -/*! @name GATE7 - Gate */ -/*! @{ */ - -#define SEMA42_GATE7_GTFSM_MASK (0xFU) -#define SEMA42_GATE7_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE7_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE7_GTFSM_SHIFT)) & SEMA42_GATE7_GTFSM_MASK) -/*! @} */ - -/*! @name GATE6 - Gate */ -/*! @{ */ - -#define SEMA42_GATE6_GTFSM_MASK (0xFU) -#define SEMA42_GATE6_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE6_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE6_GTFSM_SHIFT)) & SEMA42_GATE6_GTFSM_MASK) -/*! @} */ - -/*! @name GATE5 - Gate */ -/*! @{ */ - -#define SEMA42_GATE5_GTFSM_MASK (0xFU) -#define SEMA42_GATE5_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE5_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE5_GTFSM_SHIFT)) & SEMA42_GATE5_GTFSM_MASK) -/*! @} */ - -/*! @name GATE4 - Gate */ -/*! @{ */ - -#define SEMA42_GATE4_GTFSM_MASK (0xFU) -#define SEMA42_GATE4_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE4_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE4_GTFSM_SHIFT)) & SEMA42_GATE4_GTFSM_MASK) -/*! @} */ - -/*! @name GATE11 - Gate */ -/*! @{ */ - -#define SEMA42_GATE11_GTFSM_MASK (0xFU) -#define SEMA42_GATE11_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE11_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE11_GTFSM_SHIFT)) & SEMA42_GATE11_GTFSM_MASK) -/*! @} */ - -/*! @name GATE10 - Gate */ -/*! @{ */ - -#define SEMA42_GATE10_GTFSM_MASK (0xFU) -#define SEMA42_GATE10_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE10_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE10_GTFSM_SHIFT)) & SEMA42_GATE10_GTFSM_MASK) -/*! @} */ - -/*! @name GATE9 - Gate */ -/*! @{ */ - -#define SEMA42_GATE9_GTFSM_MASK (0xFU) -#define SEMA42_GATE9_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE9_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE9_GTFSM_SHIFT)) & SEMA42_GATE9_GTFSM_MASK) -/*! @} */ - -/*! @name GATE8 - Gate */ -/*! @{ */ - -#define SEMA42_GATE8_GTFSM_MASK (0xFU) -#define SEMA42_GATE8_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE8_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE8_GTFSM_SHIFT)) & SEMA42_GATE8_GTFSM_MASK) -/*! @} */ - -/*! @name GATE15 - Gate */ -/*! @{ */ - -#define SEMA42_GATE15_GTFSM_MASK (0xFU) -#define SEMA42_GATE15_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE15_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE15_GTFSM_SHIFT)) & SEMA42_GATE15_GTFSM_MASK) -/*! @} */ - -/*! @name GATE14 - Gate */ -/*! @{ */ - -#define SEMA42_GATE14_GTFSM_MASK (0xFU) -#define SEMA42_GATE14_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE14_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE14_GTFSM_SHIFT)) & SEMA42_GATE14_GTFSM_MASK) -/*! @} */ - -/*! @name GATE13 - Gate */ -/*! @{ */ - -#define SEMA42_GATE13_GTFSM_MASK (0xFU) -#define SEMA42_GATE13_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE13_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE13_GTFSM_SHIFT)) & SEMA42_GATE13_GTFSM_MASK) -/*! @} */ - -/*! @name GATE12 - Gate */ -/*! @{ */ - -#define SEMA42_GATE12_GTFSM_MASK (0xFU) -#define SEMA42_GATE12_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE12_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE12_GTFSM_SHIFT)) & SEMA42_GATE12_GTFSM_MASK) -/*! @} */ - -/*! @name RSTGT_R - Reset Gate Read */ -/*! @{ */ - -#define SEMA42_RSTGT_R_RSTGTN_MASK (0xFFU) -#define SEMA42_RSTGT_R_RSTGTN_SHIFT (0U) -/*! RSTGTN - Reset Gate Number */ -#define SEMA42_RSTGT_R_RSTGTN(x) (((uint16_t)(((uint16_t)(x)) << SEMA42_RSTGT_R_RSTGTN_SHIFT)) & SEMA42_RSTGT_R_RSTGTN_MASK) - -#define SEMA42_RSTGT_R_RSTGMS_MASK (0xF00U) -#define SEMA42_RSTGT_R_RSTGMS_SHIFT (8U) -/*! RSTGMS - Reset Gate Domain */ -#define SEMA42_RSTGT_R_RSTGMS(x) (((uint16_t)(((uint16_t)(x)) << SEMA42_RSTGT_R_RSTGMS_SHIFT)) & SEMA42_RSTGT_R_RSTGMS_MASK) - -#define SEMA42_RSTGT_R_RSTGSM_MASK (0x3000U) -#define SEMA42_RSTGT_R_RSTGSM_SHIFT (12U) -/*! RSTGSM - Reset Gate Finite State Machine - * 0b00..Idle, waiting for the first data pattern write. - * 0b01..Waiting for the second data pattern write - * 0b10..The 2-write sequence has completed. Generate the specified gate reset(s). After the reset is performed, - * this machine returns to the idle (waiting for first data pattern write) state. - * 0b11..This state encoding is never used and therefore reserved. - */ -#define SEMA42_RSTGT_R_RSTGSM(x) (((uint16_t)(((uint16_t)(x)) << SEMA42_RSTGT_R_RSTGSM_SHIFT)) & SEMA42_RSTGT_R_RSTGSM_MASK) -/*! @} */ - -/*! @name RSTGT_W - Reset Gate Write */ -/*! @{ */ - -#define SEMA42_RSTGT_W_RSTGTN_MASK (0xFFU) -#define SEMA42_RSTGT_W_RSTGTN_SHIFT (0U) -/*! RSTGTN - Reset Gate Number */ -#define SEMA42_RSTGT_W_RSTGTN(x) (((uint16_t)(((uint16_t)(x)) << SEMA42_RSTGT_W_RSTGTN_SHIFT)) & SEMA42_RSTGT_W_RSTGTN_MASK) - -#define SEMA42_RSTGT_W_RSTGDP_MASK (0xFF00U) -#define SEMA42_RSTGT_W_RSTGDP_SHIFT (8U) -/*! RSTGDP - Reset Gate Data Pattern */ -#define SEMA42_RSTGT_W_RSTGDP(x) (((uint16_t)(((uint16_t)(x)) << SEMA42_RSTGT_W_RSTGDP_SHIFT)) & SEMA42_RSTGT_W_RSTGDP_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group SEMA42_Register_Masks */ - - -/* SEMA42 - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral SEMA42_0 base address */ - #define SEMA42_0_BASE (0x500B1000u) - /** Peripheral SEMA42_0 base address */ - #define SEMA42_0_BASE_NS (0x400B1000u) - /** Peripheral SEMA42_0 base pointer */ - #define SEMA42_0 ((SEMA42_Type *)SEMA42_0_BASE) - /** Peripheral SEMA42_0 base pointer */ - #define SEMA42_0_NS ((SEMA42_Type *)SEMA42_0_BASE_NS) - /** Array initializer of SEMA42 peripheral base addresses */ - #define SEMA42_BASE_ADDRS { SEMA42_0_BASE } - /** Array initializer of SEMA42 peripheral base pointers */ - #define SEMA42_BASE_PTRS { SEMA42_0 } - /** Array initializer of SEMA42 peripheral base addresses */ - #define SEMA42_BASE_ADDRS_NS { SEMA42_0_BASE_NS } - /** Array initializer of SEMA42 peripheral base pointers */ - #define SEMA42_BASE_PTRS_NS { SEMA42_0_NS } -#else - /** Peripheral SEMA42_0 base address */ - #define SEMA42_0_BASE (0x400B1000u) - /** Peripheral SEMA42_0 base pointer */ - #define SEMA42_0 ((SEMA42_Type *)SEMA42_0_BASE) - /** Array initializer of SEMA42 peripheral base addresses */ - #define SEMA42_BASE_ADDRS { SEMA42_0_BASE } - /** Array initializer of SEMA42 peripheral base pointers */ - #define SEMA42_BASE_PTRS { SEMA42_0 } -#endif - -/*! - * @} - */ /* end of group SEMA42_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- SINC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SINC_Peripheral_Access_Layer SINC Peripheral Access Layer - * @{ - */ - -/** SINC - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAMETER; /**< Parameters, offset: 0x4 */ - __IO uint32_t MCR; /**< Main Control, offset: 0x8 */ - __IO uint32_t NIE; /**< Normal Interrupt Enable, offset: 0xC */ - __IO uint32_t EIE; /**< Error Interrupt Enable, offset: 0x10 */ - __IO uint32_t FIFOIE; /**< FIFO And CAD Error Interrupt Enable, offset: 0x14 */ - __IO uint32_t NIS; /**< Normal Interrupt Status, offset: 0x18 */ - __IO uint32_t EIS; /**< Error Interrupt Status, offset: 0x1C */ - __IO uint32_t FIFOIS; /**< FIFO And CAD Error Interrupt Status, offset: 0x20 */ - __I uint32_t SR; /**< Status, offset: 0x24 */ - uint8_t RESERVED_0[16]; - struct { /* offset: 0x38, array step: 0x30 */ - __IO uint32_t CCR; /**< Channel 0 Control..Channel 4 Control, array offset: 0x38, array step: 0x30 */ - __IO uint32_t CDR; /**< Channel 0 Data Rate..Channel 4 Data Rate, array offset: 0x3C, array step: 0x30 */ - __IO uint32_t CCFR; /**< Channel 0 Configuration..Channel 4 Configuration, array offset: 0x40, array step: 0x30 */ - __IO uint32_t CPROT; /**< Channel 0 Protection..Channel 4 Protection, array offset: 0x44, array step: 0x30 */ - __IO uint32_t CBIAS; /**< Channel 0 Bias..Channel 4 Bias, array offset: 0x48, array step: 0x30 */ - __IO uint32_t CLOLMT; /**< Channel 0 Low Limit..Channel 4 Low Limit, array offset: 0x4C, array step: 0x30 */ - __IO uint32_t CHILMT; /**< Channel 0 High Limit..Channel 4 High Limit, array offset: 0x50, array step: 0x30 */ - __I uint32_t CRDATA; /**< Channel 0 Result Data..Channel 4 Result Data, array offset: 0x54, array step: 0x30 */ - __IO uint32_t CMPDATA; /**< Channel 0 Multipurpose Data..Channel 4 Multipurpose Data, array offset: 0x58, array step: 0x30 */ - __IO uint32_t CACFR; /**< Channel 0 Advanced Configuration..Channel 4 Advanced Configuration, array offset: 0x5C, array step: 0x30 */ - __IO uint32_t CSR; /**< Channel 0 Status..Channel 4 Status, array offset: 0x60, array step: 0x30 */ - __I uint32_t CDBGR; /**< Channel 0 Debug..Channel 4 Debug, array offset: 0x64, array step: 0x30 */ - } CHANNEL[5]; -} SINC_Type; - -/* ---------------------------------------------------------------------------- - -- SINC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SINC_Register_Masks SINC Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define SINC_VERID_FEATURE_MASK (0xFFFFU) -#define SINC_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Code */ -#define SINC_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << SINC_VERID_FEATURE_SHIFT)) & SINC_VERID_FEATURE_MASK) - -#define SINC_VERID_MINOR_MASK (0xFF0000U) -#define SINC_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number - * 0b00000000..x.0 - * *.. - */ -#define SINC_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << SINC_VERID_MINOR_SHIFT)) & SINC_VERID_MINOR_MASK) - -#define SINC_VERID_MAJOR_MASK (0xFF000000U) -#define SINC_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number - * 0b00000001..1.x - * 0b00000010..2.x - * *.. - */ -#define SINC_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << SINC_VERID_MAJOR_SHIFT)) & SINC_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAMETER - Parameters */ -/*! @{ */ - -#define SINC_PARAMETER_FIFO_DEPTH_MASK (0x1FU) -#define SINC_PARAMETER_FIFO_DEPTH_SHIFT (0U) -/*! FIFO_DEPTH - FIFO Depth */ -#define SINC_PARAMETER_FIFO_DEPTH(x) (((uint32_t)(((uint32_t)(x)) << SINC_PARAMETER_FIFO_DEPTH_SHIFT)) & SINC_PARAMETER_FIFO_DEPTH_MASK) - -#define SINC_PARAMETER_FLT_NUM_MASK (0xF00U) -#define SINC_PARAMETER_FLT_NUM_SHIFT (8U) -/*! FLT_NUM - Filter Channel Number */ -#define SINC_PARAMETER_FLT_NUM(x) (((uint32_t)(((uint32_t)(x)) << SINC_PARAMETER_FLT_NUM_SHIFT)) & SINC_PARAMETER_FLT_NUM_MASK) - -#define SINC_PARAMETER_PF_ORD_SEL_MASK (0x180000U) -#define SINC_PARAMETER_PF_ORD_SEL_SHIFT (19U) -/*! PF_ORD_SEL - PF Order Select - * 0b10..3 - * 0b11..2 - * *.. - */ -#define SINC_PARAMETER_PF_ORD_SEL(x) (((uint32_t)(((uint32_t)(x)) << SINC_PARAMETER_PF_ORD_SEL_SHIFT)) & SINC_PARAMETER_PF_ORD_SEL_MASK) -/*! @} */ - -/*! @name MCR - Main Control */ -/*! @{ */ - -#define SINC_MCR_STRIG0_MASK (0x1U) -#define SINC_MCR_STRIG0_SHIFT (0U) -/*! STRIG0 - Software Trigger For Channel 0 - * 0b0..No effect - * 0b1..Trigger - */ -#define SINC_MCR_STRIG0(x) (((uint32_t)(((uint32_t)(x)) << SINC_MCR_STRIG0_SHIFT)) & SINC_MCR_STRIG0_MASK) - -#define SINC_MCR_STRIG1_MASK (0x2U) -#define SINC_MCR_STRIG1_SHIFT (1U) -/*! STRIG1 - Software Trigger For Channel 1 - * 0b0..No effect - * 0b1..Trigger - */ -#define SINC_MCR_STRIG1(x) (((uint32_t)(((uint32_t)(x)) << SINC_MCR_STRIG1_SHIFT)) & SINC_MCR_STRIG1_MASK) - -#define SINC_MCR_STRIG2_MASK (0x4U) -#define SINC_MCR_STRIG2_SHIFT (2U) -/*! STRIG2 - Software Trigger For Channel 2 - * 0b0..No effect - * 0b1..Trigger - */ -#define SINC_MCR_STRIG2(x) (((uint32_t)(((uint32_t)(x)) << SINC_MCR_STRIG2_SHIFT)) & SINC_MCR_STRIG2_MASK) - -#define SINC_MCR_STRIG3_MASK (0x8U) -#define SINC_MCR_STRIG3_SHIFT (3U) -/*! STRIG3 - Software Trigger For Channel 3 - * 0b0..No effect - * 0b1..Trigger - */ -#define SINC_MCR_STRIG3(x) (((uint32_t)(((uint32_t)(x)) << SINC_MCR_STRIG3_SHIFT)) & SINC_MCR_STRIG3_MASK) - -#define SINC_MCR_STRIG4_MASK (0x10U) -#define SINC_MCR_STRIG4_SHIFT (4U) -/*! STRIG4 - Software Trigger For Channel 4 - * 0b0..No effect - * 0b1..Trigger - */ -#define SINC_MCR_STRIG4(x) (((uint32_t)(((uint32_t)(x)) << SINC_MCR_STRIG4_SHIFT)) & SINC_MCR_STRIG4_MASK) - -#define SINC_MCR_DOZEN_MASK (0x400U) -#define SINC_MCR_DOZEN_SHIFT (10U) -/*! DOZEN - Doze Or Stop Enable - * 0b0..Enables - * 0b1..Disables - */ -#define SINC_MCR_DOZEN(x) (((uint32_t)(((uint32_t)(x)) << SINC_MCR_DOZEN_SHIFT)) & SINC_MCR_DOZEN_MASK) - -#define SINC_MCR_RST_MASK (0x2000U) -#define SINC_MCR_RST_SHIFT (13U) -/*! RST - Software Reset - * 0b0..Do not reset - * 0b1..Reset - */ -#define SINC_MCR_RST(x) (((uint32_t)(((uint32_t)(x)) << SINC_MCR_RST_SHIFT)) & SINC_MCR_RST_MASK) - -#define SINC_MCR_MEN_MASK (0x8000U) -#define SINC_MCR_MEN_SHIFT (15U) -/*! MEN - Master Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_MCR_MEN(x) (((uint32_t)(((uint32_t)(x)) << SINC_MCR_MEN_SHIFT)) & SINC_MCR_MEN_MASK) - -#define SINC_MCR_MCLKDIV_MASK (0xFF0000U) -#define SINC_MCR_MCLKDIV_SHIFT (16U) -/*! MCLKDIV - Modulator Clock Divider - * 0b00000000..Prohibited - * *..Added to 1 to specify the clock divider - */ -#define SINC_MCR_MCLKDIV(x) (((uint32_t)(((uint32_t)(x)) << SINC_MCR_MCLKDIV_SHIFT)) & SINC_MCR_MCLKDIV_MASK) - -#define SINC_MCR_PRESCALE_MASK (0x6000000U) -#define SINC_MCR_PRESCALE_SHIFT (25U) -/*! PRESCALE - Prescale Before Clock Divider - * 0b00..No prescale - * 0b01..2 - * 0b10..4 - * 0b11..8 - */ -#define SINC_MCR_PRESCALE(x) (((uint32_t)(((uint32_t)(x)) << SINC_MCR_PRESCALE_SHIFT)) & SINC_MCR_PRESCALE_MASK) - -#define SINC_MCR_MCLK0DIS_MASK (0x8000000U) -#define SINC_MCR_MCLK0DIS_SHIFT (27U) -/*! MCLK0DIS - Disable Modulator Clock 0 Output - * 0b0..Enabled when MEN = 1 - * 0b1..Disabled regardless of MEN value - */ -#define SINC_MCR_MCLK0DIS(x) (((uint32_t)(((uint32_t)(x)) << SINC_MCR_MCLK0DIS_SHIFT)) & SINC_MCR_MCLK0DIS_MASK) - -#define SINC_MCR_MCLK1DIS_MASK (0x10000000U) -#define SINC_MCR_MCLK1DIS_SHIFT (28U) -/*! MCLK1DIS - Disable Modulator Clock 1 Output - * 0b0..Enabled when MEN = 1 - * 0b1..Disabled regardless of MEN value - */ -#define SINC_MCR_MCLK1DIS(x) (((uint32_t)(((uint32_t)(x)) << SINC_MCR_MCLK1DIS_SHIFT)) & SINC_MCR_MCLK1DIS_MASK) - -#define SINC_MCR_MCLK2DIS_MASK (0x20000000U) -#define SINC_MCR_MCLK2DIS_SHIFT (29U) -/*! MCLK2DIS - Disable Modulator Clock 2 Output - * 0b0..Enabled when MEN = 1 - * 0b1..Disabled regardless of MEN value - */ -#define SINC_MCR_MCLK2DIS(x) (((uint32_t)(((uint32_t)(x)) << SINC_MCR_MCLK2DIS_SHIFT)) & SINC_MCR_MCLK2DIS_MASK) -/*! @} */ - -/*! @name NIE - Normal Interrupt Enable */ -/*! @{ */ - -#define SINC_NIE_COCIE0_MASK (0x1U) -#define SINC_NIE_COCIE0_SHIFT (0U) -/*! COCIE0 - Conversion Complete Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_NIE_COCIE0(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIE_COCIE0_SHIFT)) & SINC_NIE_COCIE0_MASK) - -#define SINC_NIE_COCIE1_MASK (0x2U) -#define SINC_NIE_COCIE1_SHIFT (1U) -/*! COCIE1 - Conversion Complete Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_NIE_COCIE1(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIE_COCIE1_SHIFT)) & SINC_NIE_COCIE1_MASK) - -#define SINC_NIE_COCIE2_MASK (0x4U) -#define SINC_NIE_COCIE2_SHIFT (2U) -/*! COCIE2 - Conversion Complete Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_NIE_COCIE2(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIE_COCIE2_SHIFT)) & SINC_NIE_COCIE2_MASK) - -#define SINC_NIE_COCIE3_MASK (0x8U) -#define SINC_NIE_COCIE3_SHIFT (3U) -/*! COCIE3 - Conversion Complete Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_NIE_COCIE3(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIE_COCIE3_SHIFT)) & SINC_NIE_COCIE3_MASK) - -#define SINC_NIE_COCIE4_MASK (0x10U) -#define SINC_NIE_COCIE4_SHIFT (4U) -/*! COCIE4 - Conversion Complete Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_NIE_COCIE4(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIE_COCIE4_SHIFT)) & SINC_NIE_COCIE4_MASK) - -#define SINC_NIE_CHFIE0_MASK (0x100U) -#define SINC_NIE_CHFIE0_SHIFT (8U) -/*! CHFIE0 - Data Output Ready Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_NIE_CHFIE0(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIE_CHFIE0_SHIFT)) & SINC_NIE_CHFIE0_MASK) - -#define SINC_NIE_CHFIE1_MASK (0x200U) -#define SINC_NIE_CHFIE1_SHIFT (9U) -/*! CHFIE1 - Data Output Ready Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_NIE_CHFIE1(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIE_CHFIE1_SHIFT)) & SINC_NIE_CHFIE1_MASK) - -#define SINC_NIE_CHFIE2_MASK (0x400U) -#define SINC_NIE_CHFIE2_SHIFT (10U) -/*! CHFIE2 - Data Output Ready Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_NIE_CHFIE2(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIE_CHFIE2_SHIFT)) & SINC_NIE_CHFIE2_MASK) - -#define SINC_NIE_CHFIE3_MASK (0x800U) -#define SINC_NIE_CHFIE3_SHIFT (11U) -/*! CHFIE3 - Data Output Ready Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_NIE_CHFIE3(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIE_CHFIE3_SHIFT)) & SINC_NIE_CHFIE3_MASK) - -#define SINC_NIE_CHFIE4_MASK (0x1000U) -#define SINC_NIE_CHFIE4_SHIFT (12U) -/*! CHFIE4 - Data Output Ready Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_NIE_CHFIE4(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIE_CHFIE4_SHIFT)) & SINC_NIE_CHFIE4_MASK) - -#define SINC_NIE_ZCDIE0_MASK (0x10000U) -#define SINC_NIE_ZCDIE0_SHIFT (16U) -/*! ZCDIE0 - Zero Cross Detected Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_NIE_ZCDIE0(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIE_ZCDIE0_SHIFT)) & SINC_NIE_ZCDIE0_MASK) - -#define SINC_NIE_ZCDIE1_MASK (0x20000U) -#define SINC_NIE_ZCDIE1_SHIFT (17U) -/*! ZCDIE1 - Zero Cross Detected Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_NIE_ZCDIE1(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIE_ZCDIE1_SHIFT)) & SINC_NIE_ZCDIE1_MASK) - -#define SINC_NIE_ZCDIE2_MASK (0x40000U) -#define SINC_NIE_ZCDIE2_SHIFT (18U) -/*! ZCDIE2 - Zero Cross Detected Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_NIE_ZCDIE2(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIE_ZCDIE2_SHIFT)) & SINC_NIE_ZCDIE2_MASK) - -#define SINC_NIE_ZCDIE3_MASK (0x80000U) -#define SINC_NIE_ZCDIE3_SHIFT (19U) -/*! ZCDIE3 - Zero Cross Detected Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_NIE_ZCDIE3(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIE_ZCDIE3_SHIFT)) & SINC_NIE_ZCDIE3_MASK) - -#define SINC_NIE_ZCDIE4_MASK (0x100000U) -#define SINC_NIE_ZCDIE4_SHIFT (20U) -/*! ZCDIE4 - Zero Cross Detected Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_NIE_ZCDIE4(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIE_ZCDIE4_SHIFT)) & SINC_NIE_ZCDIE4_MASK) -/*! @} */ - -/*! @name EIE - Error Interrupt Enable */ -/*! @{ */ - -#define SINC_EIE_SCDIE0_MASK (0x1U) -#define SINC_EIE_SCDIE0_SHIFT (0U) -/*! SCDIE0 - Short Circuit Detected Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_SCDIE0(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_SCDIE0_SHIFT)) & SINC_EIE_SCDIE0_MASK) - -#define SINC_EIE_SCDIE1_MASK (0x2U) -#define SINC_EIE_SCDIE1_SHIFT (1U) -/*! SCDIE1 - Short Circuit Detected Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_SCDIE1(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_SCDIE1_SHIFT)) & SINC_EIE_SCDIE1_MASK) - -#define SINC_EIE_SCDIE2_MASK (0x4U) -#define SINC_EIE_SCDIE2_SHIFT (2U) -/*! SCDIE2 - Short Circuit Detected Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_SCDIE2(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_SCDIE2_SHIFT)) & SINC_EIE_SCDIE2_MASK) - -#define SINC_EIE_SCDIE3_MASK (0x8U) -#define SINC_EIE_SCDIE3_SHIFT (3U) -/*! SCDIE3 - Short Circuit Detected Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_SCDIE3(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_SCDIE3_SHIFT)) & SINC_EIE_SCDIE3_MASK) - -#define SINC_EIE_SCDIE4_MASK (0x10U) -#define SINC_EIE_SCDIE4_SHIFT (4U) -/*! SCDIE4 - Short Circuit Detected Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_SCDIE4(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_SCDIE4_SHIFT)) & SINC_EIE_SCDIE4_MASK) - -#define SINC_EIE_WLMTIE0_MASK (0x100U) -#define SINC_EIE_WLMTIE0_SHIFT (8U) -/*! WLMTIE0 - Window Limit Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_WLMTIE0(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_WLMTIE0_SHIFT)) & SINC_EIE_WLMTIE0_MASK) - -#define SINC_EIE_WLMTIE1_MASK (0x200U) -#define SINC_EIE_WLMTIE1_SHIFT (9U) -/*! WLMTIE1 - Window Limit Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_WLMTIE1(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_WLMTIE1_SHIFT)) & SINC_EIE_WLMTIE1_MASK) - -#define SINC_EIE_WLMTIE2_MASK (0x400U) -#define SINC_EIE_WLMTIE2_SHIFT (10U) -/*! WLMTIE2 - Window Limit Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_WLMTIE2(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_WLMTIE2_SHIFT)) & SINC_EIE_WLMTIE2_MASK) - -#define SINC_EIE_WLMTIE3_MASK (0x800U) -#define SINC_EIE_WLMTIE3_SHIFT (11U) -/*! WLMTIE3 - Window Limit Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_WLMTIE3(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_WLMTIE3_SHIFT)) & SINC_EIE_WLMTIE3_MASK) - -#define SINC_EIE_WLMTIE4_MASK (0x1000U) -#define SINC_EIE_WLMTIE4_SHIFT (12U) -/*! WLMTIE4 - Window Limit Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_WLMTIE4(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_WLMTIE4_SHIFT)) & SINC_EIE_WLMTIE4_MASK) - -#define SINC_EIE_LLMTIE0_MASK (0x10000U) -#define SINC_EIE_LLMTIE0_SHIFT (16U) -/*! LLMTIE0 - Low Limit Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_LLMTIE0(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_LLMTIE0_SHIFT)) & SINC_EIE_LLMTIE0_MASK) - -#define SINC_EIE_LLMTIE1_MASK (0x20000U) -#define SINC_EIE_LLMTIE1_SHIFT (17U) -/*! LLMTIE1 - Low Limit Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_LLMTIE1(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_LLMTIE1_SHIFT)) & SINC_EIE_LLMTIE1_MASK) - -#define SINC_EIE_LLMTIE2_MASK (0x40000U) -#define SINC_EIE_LLMTIE2_SHIFT (18U) -/*! LLMTIE2 - Low Limit Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_LLMTIE2(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_LLMTIE2_SHIFT)) & SINC_EIE_LLMTIE2_MASK) - -#define SINC_EIE_LLMTIE3_MASK (0x80000U) -#define SINC_EIE_LLMTIE3_SHIFT (19U) -/*! LLMTIE3 - Low Limit Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_LLMTIE3(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_LLMTIE3_SHIFT)) & SINC_EIE_LLMTIE3_MASK) - -#define SINC_EIE_LLMTIE4_MASK (0x100000U) -#define SINC_EIE_LLMTIE4_SHIFT (20U) -/*! LLMTIE4 - Low Limit Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_LLMTIE4(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_LLMTIE4_SHIFT)) & SINC_EIE_LLMTIE4_MASK) - -#define SINC_EIE_HLMTIE0_MASK (0x1000000U) -#define SINC_EIE_HLMTIE0_SHIFT (24U) -/*! HLMTIE0 - High Limit Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_HLMTIE0(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_HLMTIE0_SHIFT)) & SINC_EIE_HLMTIE0_MASK) - -#define SINC_EIE_HLMTIE1_MASK (0x2000000U) -#define SINC_EIE_HLMTIE1_SHIFT (25U) -/*! HLMTIE1 - High Limit Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_HLMTIE1(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_HLMTIE1_SHIFT)) & SINC_EIE_HLMTIE1_MASK) - -#define SINC_EIE_HLMTIE2_MASK (0x4000000U) -#define SINC_EIE_HLMTIE2_SHIFT (26U) -/*! HLMTIE2 - High Limit Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_HLMTIE2(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_HLMTIE2_SHIFT)) & SINC_EIE_HLMTIE2_MASK) - -#define SINC_EIE_HLMTIE3_MASK (0x8000000U) -#define SINC_EIE_HLMTIE3_SHIFT (27U) -/*! HLMTIE3 - High Limit Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_HLMTIE3(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_HLMTIE3_SHIFT)) & SINC_EIE_HLMTIE3_MASK) - -#define SINC_EIE_HLMTIE4_MASK (0x10000000U) -#define SINC_EIE_HLMTIE4_SHIFT (28U) -/*! HLMTIE4 - High Limit Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_HLMTIE4(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_HLMTIE4_SHIFT)) & SINC_EIE_HLMTIE4_MASK) -/*! @} */ - -/*! @name FIFOIE - FIFO And CAD Error Interrupt Enable */ -/*! @{ */ - -#define SINC_FIFOIE_FUNFIE0_MASK (0x1U) -#define SINC_FIFOIE_FUNFIE0_SHIFT (0U) -/*! FUNFIE0 - FIFO Underflow Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_FUNFIE0(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_FUNFIE0_SHIFT)) & SINC_FIFOIE_FUNFIE0_MASK) - -#define SINC_FIFOIE_FUNFIE1_MASK (0x2U) -#define SINC_FIFOIE_FUNFIE1_SHIFT (1U) -/*! FUNFIE1 - FIFO Underflow Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_FUNFIE1(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_FUNFIE1_SHIFT)) & SINC_FIFOIE_FUNFIE1_MASK) - -#define SINC_FIFOIE_FUNFIE2_MASK (0x4U) -#define SINC_FIFOIE_FUNFIE2_SHIFT (2U) -/*! FUNFIE2 - FIFO Underflow Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_FUNFIE2(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_FUNFIE2_SHIFT)) & SINC_FIFOIE_FUNFIE2_MASK) - -#define SINC_FIFOIE_FUNFIE3_MASK (0x8U) -#define SINC_FIFOIE_FUNFIE3_SHIFT (3U) -/*! FUNFIE3 - FIFO Underflow Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_FUNFIE3(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_FUNFIE3_SHIFT)) & SINC_FIFOIE_FUNFIE3_MASK) - -#define SINC_FIFOIE_FUNFIE4_MASK (0x10U) -#define SINC_FIFOIE_FUNFIE4_SHIFT (4U) -/*! FUNFIE4 - FIFO Underflow Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_FUNFIE4(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_FUNFIE4_SHIFT)) & SINC_FIFOIE_FUNFIE4_MASK) - -#define SINC_FIFOIE_FOVFIE0_MASK (0x100U) -#define SINC_FIFOIE_FOVFIE0_SHIFT (8U) -/*! FOVFIE0 - FIFO Overflow Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_FOVFIE0(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_FOVFIE0_SHIFT)) & SINC_FIFOIE_FOVFIE0_MASK) - -#define SINC_FIFOIE_FOVFIE1_MASK (0x200U) -#define SINC_FIFOIE_FOVFIE1_SHIFT (9U) -/*! FOVFIE1 - FIFO Overflow Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_FOVFIE1(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_FOVFIE1_SHIFT)) & SINC_FIFOIE_FOVFIE1_MASK) - -#define SINC_FIFOIE_FOVFIE2_MASK (0x400U) -#define SINC_FIFOIE_FOVFIE2_SHIFT (10U) -/*! FOVFIE2 - FIFO Overflow Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_FOVFIE2(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_FOVFIE2_SHIFT)) & SINC_FIFOIE_FOVFIE2_MASK) - -#define SINC_FIFOIE_FOVFIE3_MASK (0x800U) -#define SINC_FIFOIE_FOVFIE3_SHIFT (11U) -/*! FOVFIE3 - FIFO Overflow Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_FOVFIE3(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_FOVFIE3_SHIFT)) & SINC_FIFOIE_FOVFIE3_MASK) - -#define SINC_FIFOIE_FOVFIE4_MASK (0x1000U) -#define SINC_FIFOIE_FOVFIE4_SHIFT (12U) -/*! FOVFIE4 - FIFO Overflow Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_FOVFIE4(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_FOVFIE4_SHIFT)) & SINC_FIFOIE_FOVFIE4_MASK) - -#define SINC_FIFOIE_CADIE0_MASK (0x10000U) -#define SINC_FIFOIE_CADIE0_SHIFT (16U) -/*! CADIE0 - Clock Absence Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_CADIE0(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_CADIE0_SHIFT)) & SINC_FIFOIE_CADIE0_MASK) - -#define SINC_FIFOIE_CADIE1_MASK (0x20000U) -#define SINC_FIFOIE_CADIE1_SHIFT (17U) -/*! CADIE1 - Clock Absence Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_CADIE1(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_CADIE1_SHIFT)) & SINC_FIFOIE_CADIE1_MASK) - -#define SINC_FIFOIE_CADIE2_MASK (0x40000U) -#define SINC_FIFOIE_CADIE2_SHIFT (18U) -/*! CADIE2 - Clock Absence Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_CADIE2(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_CADIE2_SHIFT)) & SINC_FIFOIE_CADIE2_MASK) - -#define SINC_FIFOIE_CADIE3_MASK (0x80000U) -#define SINC_FIFOIE_CADIE3_SHIFT (19U) -/*! CADIE3 - Clock Absence Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_CADIE3(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_CADIE3_SHIFT)) & SINC_FIFOIE_CADIE3_MASK) - -#define SINC_FIFOIE_CADIE4_MASK (0x100000U) -#define SINC_FIFOIE_CADIE4_SHIFT (20U) -/*! CADIE4 - Clock Absence Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_CADIE4(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_CADIE4_SHIFT)) & SINC_FIFOIE_CADIE4_MASK) - -#define SINC_FIFOIE_SATIE0_MASK (0x1000000U) -#define SINC_FIFOIE_SATIE0_SHIFT (24U) -/*! SATIE0 - Saturation Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_SATIE0(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_SATIE0_SHIFT)) & SINC_FIFOIE_SATIE0_MASK) - -#define SINC_FIFOIE_SATIE1_MASK (0x2000000U) -#define SINC_FIFOIE_SATIE1_SHIFT (25U) -/*! SATIE1 - Saturation Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_SATIE1(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_SATIE1_SHIFT)) & SINC_FIFOIE_SATIE1_MASK) - -#define SINC_FIFOIE_SATIE2_MASK (0x4000000U) -#define SINC_FIFOIE_SATIE2_SHIFT (26U) -/*! SATIE2 - Saturation Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_SATIE2(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_SATIE2_SHIFT)) & SINC_FIFOIE_SATIE2_MASK) - -#define SINC_FIFOIE_SATIE3_MASK (0x8000000U) -#define SINC_FIFOIE_SATIE3_SHIFT (27U) -/*! SATIE3 - Saturation Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_SATIE3(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_SATIE3_SHIFT)) & SINC_FIFOIE_SATIE3_MASK) - -#define SINC_FIFOIE_SATIE4_MASK (0x10000000U) -#define SINC_FIFOIE_SATIE4_SHIFT (28U) -/*! SATIE4 - Saturation Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_SATIE4(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_SATIE4_SHIFT)) & SINC_FIFOIE_SATIE4_MASK) -/*! @} */ - -/*! @name NIS - Normal Interrupt Status */ -/*! @{ */ - -#define SINC_NIS_COC0_MASK (0x1U) -#define SINC_NIS_COC0_SHIFT (0U) -/*! COC0 - Conversion Complete Flag - * 0b0..Not finished; data not available - * 0b1..Finished; data available - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_NIS_COC0(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIS_COC0_SHIFT)) & SINC_NIS_COC0_MASK) - -#define SINC_NIS_COC1_MASK (0x2U) -#define SINC_NIS_COC1_SHIFT (1U) -/*! COC1 - Conversion Complete Flag - * 0b0..Not finished; data not available - * 0b1..Finished; data available - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_NIS_COC1(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIS_COC1_SHIFT)) & SINC_NIS_COC1_MASK) - -#define SINC_NIS_COC2_MASK (0x4U) -#define SINC_NIS_COC2_SHIFT (2U) -/*! COC2 - Conversion Complete Flag - * 0b0..Not finished; data not available - * 0b1..Finished; data available - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_NIS_COC2(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIS_COC2_SHIFT)) & SINC_NIS_COC2_MASK) - -#define SINC_NIS_COC3_MASK (0x8U) -#define SINC_NIS_COC3_SHIFT (3U) -/*! COC3 - Conversion Complete Flag - * 0b0..Not finished; data not available - * 0b1..Finished; data available - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_NIS_COC3(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIS_COC3_SHIFT)) & SINC_NIS_COC3_MASK) - -#define SINC_NIS_COC4_MASK (0x10U) -#define SINC_NIS_COC4_SHIFT (4U) -/*! COC4 - Conversion Complete Flag - * 0b0..Not finished; data not available - * 0b1..Finished; data available - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_NIS_COC4(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIS_COC4_SHIFT)) & SINC_NIS_COC4_MASK) - -#define SINC_NIS_CHF0_MASK (0x100U) -#define SINC_NIS_CHF0_SHIFT (8U) -/*! CHF0 - Data Output Ready Flag - * 0b0..No overflow; data not available - * 0b1..Overflow; data available - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_NIS_CHF0(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIS_CHF0_SHIFT)) & SINC_NIS_CHF0_MASK) - -#define SINC_NIS_CHF1_MASK (0x200U) -#define SINC_NIS_CHF1_SHIFT (9U) -/*! CHF1 - Data Output Ready Flag - * 0b0..No overflow; data not available - * 0b1..Overflow; data available - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_NIS_CHF1(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIS_CHF1_SHIFT)) & SINC_NIS_CHF1_MASK) - -#define SINC_NIS_CHF2_MASK (0x400U) -#define SINC_NIS_CHF2_SHIFT (10U) -/*! CHF2 - Data Output Ready Flag - * 0b0..No overflow; data not available - * 0b1..Overflow; data available - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_NIS_CHF2(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIS_CHF2_SHIFT)) & SINC_NIS_CHF2_MASK) - -#define SINC_NIS_CHF3_MASK (0x800U) -#define SINC_NIS_CHF3_SHIFT (11U) -/*! CHF3 - Data Output Ready Flag - * 0b0..No overflow; data not available - * 0b1..Overflow; data available - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_NIS_CHF3(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIS_CHF3_SHIFT)) & SINC_NIS_CHF3_MASK) - -#define SINC_NIS_CHF4_MASK (0x1000U) -#define SINC_NIS_CHF4_SHIFT (12U) -/*! CHF4 - Data Output Ready Flag - * 0b0..No overflow; data not available - * 0b1..Overflow; data available - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_NIS_CHF4(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIS_CHF4_SHIFT)) & SINC_NIS_CHF4_MASK) - -#define SINC_NIS_ZCD0_MASK (0x10000U) -#define SINC_NIS_ZCD0_SHIFT (16U) -/*! ZCD0 - Zero Cross Detected Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_NIS_ZCD0(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIS_ZCD0_SHIFT)) & SINC_NIS_ZCD0_MASK) - -#define SINC_NIS_ZCD1_MASK (0x20000U) -#define SINC_NIS_ZCD1_SHIFT (17U) -/*! ZCD1 - Zero Cross Detected Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_NIS_ZCD1(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIS_ZCD1_SHIFT)) & SINC_NIS_ZCD1_MASK) - -#define SINC_NIS_ZCD2_MASK (0x40000U) -#define SINC_NIS_ZCD2_SHIFT (18U) -/*! ZCD2 - Zero Cross Detected Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_NIS_ZCD2(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIS_ZCD2_SHIFT)) & SINC_NIS_ZCD2_MASK) - -#define SINC_NIS_ZCD3_MASK (0x80000U) -#define SINC_NIS_ZCD3_SHIFT (19U) -/*! ZCD3 - Zero Cross Detected Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_NIS_ZCD3(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIS_ZCD3_SHIFT)) & SINC_NIS_ZCD3_MASK) - -#define SINC_NIS_ZCD4_MASK (0x100000U) -#define SINC_NIS_ZCD4_SHIFT (20U) -/*! ZCD4 - Zero Cross Detected Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_NIS_ZCD4(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIS_ZCD4_SHIFT)) & SINC_NIS_ZCD4_MASK) -/*! @} */ - -/*! @name EIS - Error Interrupt Status */ -/*! @{ */ - -#define SINC_EIS_SCD0_MASK (0x1U) -#define SINC_EIS_SCD0_SHIFT (0U) -/*! SCD0 - Short Circuit Detected Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_SCD0(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_SCD0_SHIFT)) & SINC_EIS_SCD0_MASK) - -#define SINC_EIS_SCD1_MASK (0x2U) -#define SINC_EIS_SCD1_SHIFT (1U) -/*! SCD1 - Short Circuit Detected Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_SCD1(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_SCD1_SHIFT)) & SINC_EIS_SCD1_MASK) - -#define SINC_EIS_SCD2_MASK (0x4U) -#define SINC_EIS_SCD2_SHIFT (2U) -/*! SCD2 - Short Circuit Detected Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_SCD2(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_SCD2_SHIFT)) & SINC_EIS_SCD2_MASK) - -#define SINC_EIS_SCD3_MASK (0x8U) -#define SINC_EIS_SCD3_SHIFT (3U) -/*! SCD3 - Short Circuit Detected Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_SCD3(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_SCD3_SHIFT)) & SINC_EIS_SCD3_MASK) - -#define SINC_EIS_SCD4_MASK (0x10U) -#define SINC_EIS_SCD4_SHIFT (4U) -/*! SCD4 - Short Circuit Detected Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_SCD4(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_SCD4_SHIFT)) & SINC_EIS_SCD4_MASK) - -#define SINC_EIS_WLMT0_MASK (0x100U) -#define SINC_EIS_WLMT0_SHIFT (8U) -/*! WLMT0 - Window Limit Flag - * 0b0..Not exceeded - * 0b1..Exceeded - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_WLMT0(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_WLMT0_SHIFT)) & SINC_EIS_WLMT0_MASK) - -#define SINC_EIS_WLMT1_MASK (0x200U) -#define SINC_EIS_WLMT1_SHIFT (9U) -/*! WLMT1 - Window Limit Flag - * 0b0..Not exceeded - * 0b1..Exceeded - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_WLMT1(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_WLMT1_SHIFT)) & SINC_EIS_WLMT1_MASK) - -#define SINC_EIS_WLMT2_MASK (0x400U) -#define SINC_EIS_WLMT2_SHIFT (10U) -/*! WLMT2 - Window Limit Flag - * 0b0..Not exceeded - * 0b1..Exceeded - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_WLMT2(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_WLMT2_SHIFT)) & SINC_EIS_WLMT2_MASK) - -#define SINC_EIS_WLMT3_MASK (0x800U) -#define SINC_EIS_WLMT3_SHIFT (11U) -/*! WLMT3 - Window Limit Flag - * 0b0..Not exceeded - * 0b1..Exceeded - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_WLMT3(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_WLMT3_SHIFT)) & SINC_EIS_WLMT3_MASK) - -#define SINC_EIS_WLMT4_MASK (0x1000U) -#define SINC_EIS_WLMT4_SHIFT (12U) -/*! WLMT4 - Window Limit Flag - * 0b0..Not exceeded - * 0b1..Exceeded - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_WLMT4(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_WLMT4_SHIFT)) & SINC_EIS_WLMT4_MASK) - -#define SINC_EIS_LLMT0_MASK (0x10000U) -#define SINC_EIS_LLMT0_SHIFT (16U) -/*! LLMT0 - Low Limit Flag - * 0b0..Not exceeded - * 0b1..Exceeded - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_LLMT0(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_LLMT0_SHIFT)) & SINC_EIS_LLMT0_MASK) - -#define SINC_EIS_LLMT1_MASK (0x20000U) -#define SINC_EIS_LLMT1_SHIFT (17U) -/*! LLMT1 - Low Limit Flag - * 0b0..Not exceeded - * 0b1..Exceeded - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_LLMT1(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_LLMT1_SHIFT)) & SINC_EIS_LLMT1_MASK) - -#define SINC_EIS_LLMT2_MASK (0x40000U) -#define SINC_EIS_LLMT2_SHIFT (18U) -/*! LLMT2 - Low Limit Flag - * 0b0..Not exceeded - * 0b1..Exceeded - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_LLMT2(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_LLMT2_SHIFT)) & SINC_EIS_LLMT2_MASK) - -#define SINC_EIS_LLMT3_MASK (0x80000U) -#define SINC_EIS_LLMT3_SHIFT (19U) -/*! LLMT3 - Low Limit Flag - * 0b0..Not exceeded - * 0b1..Exceeded - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_LLMT3(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_LLMT3_SHIFT)) & SINC_EIS_LLMT3_MASK) - -#define SINC_EIS_LLMT4_MASK (0x100000U) -#define SINC_EIS_LLMT4_SHIFT (20U) -/*! LLMT4 - Low Limit Flag - * 0b0..Not exceeded - * 0b1..Exceeded - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_LLMT4(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_LLMT4_SHIFT)) & SINC_EIS_LLMT4_MASK) - -#define SINC_EIS_HLMT0_MASK (0x1000000U) -#define SINC_EIS_HLMT0_SHIFT (24U) -/*! HLMT0 - High Limit Flag - * 0b0..Not exceeded - * 0b1..Exceeded - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_HLMT0(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_HLMT0_SHIFT)) & SINC_EIS_HLMT0_MASK) - -#define SINC_EIS_HLMT1_MASK (0x2000000U) -#define SINC_EIS_HLMT1_SHIFT (25U) -/*! HLMT1 - High Limit Flag - * 0b0..Not exceeded - * 0b1..Exceeded - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_HLMT1(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_HLMT1_SHIFT)) & SINC_EIS_HLMT1_MASK) - -#define SINC_EIS_HLMT2_MASK (0x4000000U) -#define SINC_EIS_HLMT2_SHIFT (26U) -/*! HLMT2 - High Limit Flag - * 0b0..Not exceeded - * 0b1..Exceeded - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_HLMT2(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_HLMT2_SHIFT)) & SINC_EIS_HLMT2_MASK) - -#define SINC_EIS_HLMT3_MASK (0x8000000U) -#define SINC_EIS_HLMT3_SHIFT (27U) -/*! HLMT3 - High Limit Flag - * 0b0..Not exceeded - * 0b1..Exceeded - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_HLMT3(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_HLMT3_SHIFT)) & SINC_EIS_HLMT3_MASK) - -#define SINC_EIS_HLMT4_MASK (0x10000000U) -#define SINC_EIS_HLMT4_SHIFT (28U) -/*! HLMT4 - High Limit Flag - * 0b0..Not exceeded - * 0b1..Exceeded - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_HLMT4(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_HLMT4_SHIFT)) & SINC_EIS_HLMT4_MASK) -/*! @} */ - -/*! @name FIFOIS - FIFO And CAD Error Interrupt Status */ -/*! @{ */ - -#define SINC_FIFOIS_FUNF0_MASK (0x1U) -#define SINC_FIFOIS_FUNF0_SHIFT (0U) -/*! FUNF0 - FIFO Underflow Flag - * 0b0..Did not occur - * 0b1..Occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_FUNF0(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_FUNF0_SHIFT)) & SINC_FIFOIS_FUNF0_MASK) - -#define SINC_FIFOIS_FUNF1_MASK (0x2U) -#define SINC_FIFOIS_FUNF1_SHIFT (1U) -/*! FUNF1 - FIFO Underflow Flag - * 0b0..Did not occur - * 0b1..Occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_FUNF1(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_FUNF1_SHIFT)) & SINC_FIFOIS_FUNF1_MASK) - -#define SINC_FIFOIS_FUNF2_MASK (0x4U) -#define SINC_FIFOIS_FUNF2_SHIFT (2U) -/*! FUNF2 - FIFO Underflow Flag - * 0b0..Did not occur - * 0b1..Occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_FUNF2(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_FUNF2_SHIFT)) & SINC_FIFOIS_FUNF2_MASK) - -#define SINC_FIFOIS_FUNF3_MASK (0x8U) -#define SINC_FIFOIS_FUNF3_SHIFT (3U) -/*! FUNF3 - FIFO Underflow Flag - * 0b0..Did not occur - * 0b1..Occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_FUNF3(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_FUNF3_SHIFT)) & SINC_FIFOIS_FUNF3_MASK) - -#define SINC_FIFOIS_FUNF4_MASK (0x10U) -#define SINC_FIFOIS_FUNF4_SHIFT (4U) -/*! FUNF4 - FIFO Underflow Flag - * 0b0..Did not occur - * 0b1..Occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_FUNF4(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_FUNF4_SHIFT)) & SINC_FIFOIS_FUNF4_MASK) - -#define SINC_FIFOIS_FOVF0_MASK (0x100U) -#define SINC_FIFOIS_FOVF0_SHIFT (8U) -/*! FOVF0 - FIFO Overflow Flag - * 0b0..Did not occur - * 0b1..Occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_FOVF0(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_FOVF0_SHIFT)) & SINC_FIFOIS_FOVF0_MASK) - -#define SINC_FIFOIS_FOVF1_MASK (0x200U) -#define SINC_FIFOIS_FOVF1_SHIFT (9U) -/*! FOVF1 - FIFO Overflow Flag - * 0b0..Did not occur - * 0b1..Occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_FOVF1(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_FOVF1_SHIFT)) & SINC_FIFOIS_FOVF1_MASK) - -#define SINC_FIFOIS_FOVF2_MASK (0x400U) -#define SINC_FIFOIS_FOVF2_SHIFT (10U) -/*! FOVF2 - FIFO Overflow Flag - * 0b0..Did not occur - * 0b1..Occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_FOVF2(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_FOVF2_SHIFT)) & SINC_FIFOIS_FOVF2_MASK) - -#define SINC_FIFOIS_FOVF3_MASK (0x800U) -#define SINC_FIFOIS_FOVF3_SHIFT (11U) -/*! FOVF3 - FIFO Overflow Flag - * 0b0..Did not occur - * 0b1..Occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_FOVF3(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_FOVF3_SHIFT)) & SINC_FIFOIS_FOVF3_MASK) - -#define SINC_FIFOIS_FOVF4_MASK (0x1000U) -#define SINC_FIFOIS_FOVF4_SHIFT (12U) -/*! FOVF4 - FIFO Overflow Flag - * 0b0..Did not occur - * 0b1..Occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_FOVF4(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_FOVF4_SHIFT)) & SINC_FIFOIS_FOVF4_MASK) - -#define SINC_FIFOIS_CAD0_MASK (0x10000U) -#define SINC_FIFOIS_CAD0_SHIFT (16U) -/*! CAD0 - Clock Absence Flag - * 0b0..Clock present - * 0b1..Clock absent - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_CAD0(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_CAD0_SHIFT)) & SINC_FIFOIS_CAD0_MASK) - -#define SINC_FIFOIS_CAD1_MASK (0x20000U) -#define SINC_FIFOIS_CAD1_SHIFT (17U) -/*! CAD1 - Clock Absence Flag - * 0b0..Clock present - * 0b1..Clock absent - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_CAD1(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_CAD1_SHIFT)) & SINC_FIFOIS_CAD1_MASK) - -#define SINC_FIFOIS_CAD2_MASK (0x40000U) -#define SINC_FIFOIS_CAD2_SHIFT (18U) -/*! CAD2 - Clock Absence Flag - * 0b0..Clock present - * 0b1..Clock absent - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_CAD2(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_CAD2_SHIFT)) & SINC_FIFOIS_CAD2_MASK) - -#define SINC_FIFOIS_CAD3_MASK (0x80000U) -#define SINC_FIFOIS_CAD3_SHIFT (19U) -/*! CAD3 - Clock Absence Flag - * 0b0..Clock present - * 0b1..Clock absent - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_CAD3(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_CAD3_SHIFT)) & SINC_FIFOIS_CAD3_MASK) - -#define SINC_FIFOIS_CAD4_MASK (0x100000U) -#define SINC_FIFOIS_CAD4_SHIFT (20U) -/*! CAD4 - Clock Absence Flag - * 0b0..Clock present - * 0b1..Clock absent - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_CAD4(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_CAD4_SHIFT)) & SINC_FIFOIS_CAD4_MASK) - -#define SINC_FIFOIS_SAT0_MASK (0x1000000U) -#define SINC_FIFOIS_SAT0_SHIFT (24U) -/*! SAT0 - Saturation Flag - * 0b0..Not saturated - * 0b1..Saturated - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_SAT0(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_SAT0_SHIFT)) & SINC_FIFOIS_SAT0_MASK) - -#define SINC_FIFOIS_SAT1_MASK (0x2000000U) -#define SINC_FIFOIS_SAT1_SHIFT (25U) -/*! SAT1 - Saturation Flag - * 0b0..Not saturated - * 0b1..Saturated - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_SAT1(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_SAT1_SHIFT)) & SINC_FIFOIS_SAT1_MASK) - -#define SINC_FIFOIS_SAT2_MASK (0x4000000U) -#define SINC_FIFOIS_SAT2_SHIFT (26U) -/*! SAT2 - Saturation Flag - * 0b0..Not saturated - * 0b1..Saturated - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_SAT2(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_SAT2_SHIFT)) & SINC_FIFOIS_SAT2_MASK) - -#define SINC_FIFOIS_SAT3_MASK (0x8000000U) -#define SINC_FIFOIS_SAT3_SHIFT (27U) -/*! SAT3 - Saturation Flag - * 0b0..Not saturated - * 0b1..Saturated - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_SAT3(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_SAT3_SHIFT)) & SINC_FIFOIS_SAT3_MASK) - -#define SINC_FIFOIS_SAT4_MASK (0x10000000U) -#define SINC_FIFOIS_SAT4_SHIFT (28U) -/*! SAT4 - Saturation Flag - * 0b0..Not saturated - * 0b1..Saturated - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_SAT4(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_SAT4_SHIFT)) & SINC_FIFOIS_SAT4_MASK) -/*! @} */ - -/*! @name SR - Status */ -/*! @{ */ - -#define SINC_SR_CIP0_MASK (0x1U) -#define SINC_SR_CIP0_SHIFT (0U) -/*! CIP0 - Conversion In Progress - * 0b0..Not in progress - * 0b1..In progress - */ -#define SINC_SR_CIP0(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_CIP0_SHIFT)) & SINC_SR_CIP0_MASK) - -#define SINC_SR_CIP1_MASK (0x2U) -#define SINC_SR_CIP1_SHIFT (1U) -/*! CIP1 - Conversion In Progress - * 0b0..Not in progress - * 0b1..In progress - */ -#define SINC_SR_CIP1(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_CIP1_SHIFT)) & SINC_SR_CIP1_MASK) - -#define SINC_SR_CIP2_MASK (0x4U) -#define SINC_SR_CIP2_SHIFT (2U) -/*! CIP2 - Conversion In Progress - * 0b0..Not in progress - * 0b1..In progress - */ -#define SINC_SR_CIP2(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_CIP2_SHIFT)) & SINC_SR_CIP2_MASK) - -#define SINC_SR_CIP3_MASK (0x8U) -#define SINC_SR_CIP3_SHIFT (3U) -/*! CIP3 - Conversion In Progress - * 0b0..Not in progress - * 0b1..In progress - */ -#define SINC_SR_CIP3(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_CIP3_SHIFT)) & SINC_SR_CIP3_MASK) - -#define SINC_SR_CIP4_MASK (0x10U) -#define SINC_SR_CIP4_SHIFT (4U) -/*! CIP4 - Conversion In Progress - * 0b0..Not in progress - * 0b1..In progress - */ -#define SINC_SR_CIP4(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_CIP4_SHIFT)) & SINC_SR_CIP4_MASK) - -#define SINC_SR_CHRDY0_MASK (0x100U) -#define SINC_SR_CHRDY0_SHIFT (8U) -/*! CHRDY0 - Channel Ready For Conversion - * 0b0..Not ready - * 0b1..Ready - */ -#define SINC_SR_CHRDY0(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_CHRDY0_SHIFT)) & SINC_SR_CHRDY0_MASK) - -#define SINC_SR_CHRDY1_MASK (0x200U) -#define SINC_SR_CHRDY1_SHIFT (9U) -/*! CHRDY1 - Channel Ready For Conversion - * 0b0..Not ready - * 0b1..Ready - */ -#define SINC_SR_CHRDY1(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_CHRDY1_SHIFT)) & SINC_SR_CHRDY1_MASK) - -#define SINC_SR_CHRDY2_MASK (0x400U) -#define SINC_SR_CHRDY2_SHIFT (10U) -/*! CHRDY2 - Channel Ready For Conversion - * 0b0..Not ready - * 0b1..Ready - */ -#define SINC_SR_CHRDY2(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_CHRDY2_SHIFT)) & SINC_SR_CHRDY2_MASK) - -#define SINC_SR_CHRDY3_MASK (0x800U) -#define SINC_SR_CHRDY3_SHIFT (11U) -/*! CHRDY3 - Channel Ready For Conversion - * 0b0..Not ready - * 0b1..Ready - */ -#define SINC_SR_CHRDY3(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_CHRDY3_SHIFT)) & SINC_SR_CHRDY3_MASK) - -#define SINC_SR_CHRDY4_MASK (0x1000U) -#define SINC_SR_CHRDY4_SHIFT (12U) -/*! CHRDY4 - Channel Ready For Conversion - * 0b0..Not ready - * 0b1..Ready - */ -#define SINC_SR_CHRDY4(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_CHRDY4_SHIFT)) & SINC_SR_CHRDY4_MASK) - -#define SINC_SR_FIFOEMPTY0_MASK (0x10000U) -#define SINC_SR_FIFOEMPTY0_SHIFT (16U) -/*! FIFOEMPTY0 - FIFO Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define SINC_SR_FIFOEMPTY0(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_FIFOEMPTY0_SHIFT)) & SINC_SR_FIFOEMPTY0_MASK) - -#define SINC_SR_FIFOEMPTY1_MASK (0x20000U) -#define SINC_SR_FIFOEMPTY1_SHIFT (17U) -/*! FIFOEMPTY1 - FIFO Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define SINC_SR_FIFOEMPTY1(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_FIFOEMPTY1_SHIFT)) & SINC_SR_FIFOEMPTY1_MASK) - -#define SINC_SR_FIFOEMPTY2_MASK (0x40000U) -#define SINC_SR_FIFOEMPTY2_SHIFT (18U) -/*! FIFOEMPTY2 - FIFO Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define SINC_SR_FIFOEMPTY2(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_FIFOEMPTY2_SHIFT)) & SINC_SR_FIFOEMPTY2_MASK) - -#define SINC_SR_FIFOEMPTY3_MASK (0x80000U) -#define SINC_SR_FIFOEMPTY3_SHIFT (19U) -/*! FIFOEMPTY3 - FIFO Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define SINC_SR_FIFOEMPTY3(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_FIFOEMPTY3_SHIFT)) & SINC_SR_FIFOEMPTY3_MASK) - -#define SINC_SR_FIFOEMPTY4_MASK (0x100000U) -#define SINC_SR_FIFOEMPTY4_SHIFT (20U) -/*! FIFOEMPTY4 - FIFO Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define SINC_SR_FIFOEMPTY4(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_FIFOEMPTY4_SHIFT)) & SINC_SR_FIFOEMPTY4_MASK) - -#define SINC_SR_MCLKRDY0_MASK (0x1000000U) -#define SINC_SR_MCLKRDY0_SHIFT (24U) -/*! MCLKRDY0 - Modulator Clock 0 Ready - * 0b0..Not ready - * 0b1..Ready - */ -#define SINC_SR_MCLKRDY0(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_MCLKRDY0_SHIFT)) & SINC_SR_MCLKRDY0_MASK) - -#define SINC_SR_MCLKRDY1_MASK (0x2000000U) -#define SINC_SR_MCLKRDY1_SHIFT (25U) -/*! MCLKRDY1 - Modulator Clock 1 Ready - * 0b0..Not ready - * 0b1..Ready - */ -#define SINC_SR_MCLKRDY1(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_MCLKRDY1_SHIFT)) & SINC_SR_MCLKRDY1_MASK) - -#define SINC_SR_MCLKRDY2_MASK (0x4000000U) -#define SINC_SR_MCLKRDY2_SHIFT (26U) -/*! MCLKRDY2 - Modulator Clock 2 Ready - * 0b0..Not ready - * 0b1..Ready - */ -#define SINC_SR_MCLKRDY2(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_MCLKRDY2_SHIFT)) & SINC_SR_MCLKRDY2_MASK) -/*! @} */ - -/*! @name CCR - Channel 0 Control..Channel 4 Control */ -/*! @{ */ - -#define SINC_CCR_CHEN_MASK (0x1U) -#define SINC_CCR_CHEN_SHIFT (0U) -/*! CHEN - Channel Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_CCR_CHEN(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCR_CHEN_SHIFT)) & SINC_CCR_CHEN_MASK) - -#define SINC_CCR_PFEN_MASK (0x2U) -#define SINC_CCR_PFEN_SHIFT (1U) -/*! PFEN - PF Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_CCR_PFEN(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCR_PFEN_SHIFT)) & SINC_CCR_PFEN_MASK) - -#define SINC_CCR_DMAEN_MASK (0x8U) -#define SINC_CCR_DMAEN_SHIFT (3U) -/*! DMAEN - DMA Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_CCR_DMAEN(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCR_DMAEN_SHIFT)) & SINC_CCR_DMAEN_MASK) - -#define SINC_CCR_SCDEN_MASK (0x100U) -#define SINC_CCR_SCDEN_SHIFT (8U) -/*! SCDEN - Short Circuit Detect Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_CCR_SCDEN(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCR_SCDEN_SHIFT)) & SINC_CCR_SCDEN_MASK) - -#define SINC_CCR_CADEN_MASK (0x200U) -#define SINC_CCR_CADEN_SHIFT (9U) -/*! CADEN - Clock Absence Detect Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_CCR_CADEN(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCR_CADEN_SHIFT)) & SINC_CCR_CADEN_MASK) - -#define SINC_CCR_ZCDEN_MASK (0x1000U) -#define SINC_CCR_ZCDEN_SHIFT (12U) -/*! ZCDEN - Zero Cross Detect Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_CCR_ZCDEN(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCR_ZCDEN_SHIFT)) & SINC_CCR_ZCDEN_MASK) - -#define SINC_CCR_LMTEN_MASK (0x2000U) -#define SINC_CCR_LMTEN_SHIFT (13U) -/*! LMTEN - Limit Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_CCR_LMTEN(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCR_LMTEN_SHIFT)) & SINC_CCR_LMTEN_MASK) - -#define SINC_CCR_FIFOEN_MASK (0x4000U) -#define SINC_CCR_FIFOEN_SHIFT (14U) -/*! FIFOEN - FIFO Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_CCR_FIFOEN(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCR_FIFOEN_SHIFT)) & SINC_CCR_FIFOEN_MASK) - -#define SINC_CCR_DBGSEL_MASK (0xF00000U) -#define SINC_CCR_DBGSEL_SHIFT (20U) -/*! DBGSEL - Debug Output Selection - * 0b0000..Final data from the PF (24 bits) - * 0b0001..Offset data (24 bits) - * 0b0010..Shifted data from the PF (24 bits) - * 0b0011..DC remover (HPF) data (32 bits) - * 0b0100..Raw data from the PF's CIC filter - * 0b0110..Historical data from SCD - * 0b0111..Data from the Manchester decoder - * 0b1000..Data from CAD - * 0b1001..Number of available entries in the FIFO - * 0b1010..Status of the parallel or serial data converter - * *.. - */ -#define SINC_CCR_DBGSEL(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCR_DBGSEL_SHIFT)) & SINC_CCR_DBGSEL_MASK) -/*! @} */ - -/* The count of SINC_CCR */ -#define SINC_CCR_COUNT (5U) - -/*! @name CDR - Channel 0 Data Rate..Channel 4 Data Rate */ -/*! @{ */ - -#define SINC_CDR_PFOSR_MASK (0x7FFU) -#define SINC_CDR_PFOSR_SHIFT (0U) -/*! PFOSR - PF OSR */ -#define SINC_CDR_PFOSR(x) (((uint32_t)(((uint32_t)(x)) << SINC_CDR_PFOSR_SHIFT)) & SINC_CDR_PFOSR_MASK) - -#define SINC_CDR_PFORD_MASK (0x1800U) -#define SINC_CDR_PFORD_SHIFT (11U) -/*! PFORD - PF Order - * 0b00..FastSinc - * 0b01..First order - * 0b10..Second order - * 0b11..Third order - */ -#define SINC_CDR_PFORD(x) (((uint32_t)(((uint32_t)(x)) << SINC_CDR_PFORD_SHIFT)) & SINC_CDR_PFORD_MASK) - -#define SINC_CDR_PFCM_MASK (0xC000U) -#define SINC_CDR_PFCM_SHIFT (14U) -/*! PFCM - PF Conversion Mode - * 0b00..Single - * 0b01..Continuous - * 0b10..Always - * 0b11..Fixed number - */ -#define SINC_CDR_PFCM(x) (((uint32_t)(((uint32_t)(x)) << SINC_CDR_PFCM_SHIFT)) & SINC_CDR_PFCM_MASK) -/*! @} */ - -/* The count of SINC_CDR */ -#define SINC_CDR_COUNT (5U) - -/*! @name CCFR - Channel 0 Configuration..Channel 4 Configuration */ -/*! @{ */ - -#define SINC_CCFR_PFSFT_MASK (0x1FU) -#define SINC_CCFR_PFSFT_SHIFT (0U) -/*! PFSFT - PF Shift */ -#define SINC_CCFR_PFSFT(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCFR_PFSFT_SHIFT)) & SINC_CCFR_PFSFT_MASK) - -#define SINC_CCFR_RDFMT_MASK (0x40U) -#define SINC_CCFR_RDFMT_SHIFT (6U) -/*! RDFMT - Result Data Format - * 0b0..Left justified, signed - * 0b1..Left justified, unsigned - */ -#define SINC_CCFR_RDFMT(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCFR_RDFMT_SHIFT)) & SINC_CCFR_RDFMT_MASK) - -#define SINC_CCFR_FIFOWMK_MASK (0x1C00U) -#define SINC_CCFR_FIFOWMK_SHIFT (10U) -/*! FIFOWMK - FIFO Watermark */ -#define SINC_CCFR_FIFOWMK(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCFR_FIFOWMK_SHIFT)) & SINC_CCFR_FIFOWMK_MASK) - -#define SINC_CCFR_IBFMT_MASK (0x30000U) -#define SINC_CCFR_IBFMT_SHIFT (16U) -/*! IBFMT - Input Bit Format - * 0b00..External bitstream from the MBIT[n] signal - * 0b01..External Manchester code; ICESEL selects the rise or fall decoder - * 0b10..Internal 16-bit parallel data from MPDATA - * 0b11..Internal 32-bit serial data from MPDATA - */ -#define SINC_CCFR_IBFMT(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCFR_IBFMT_SHIFT)) & SINC_CCFR_IBFMT_MASK) - -#define SINC_CCFR_ICSEL_MASK (0x1C0000U) -#define SINC_CCFR_ICSEL_SHIFT (18U) -/*! ICSEL - Input Clock Select - * 0b000..MCLK_OUT0 with internal routeback - * 0b001..MCLK_OUT1 with internal routeback - * 0b010..MCLK_OUT2 with internal routeback - * 0b011..External modulator clock dedicated to this channel - * 0b111..Grouped clock shared with an adjacent channel; the adjacent channel's ICSEL field determines the input clock - * *.. - */ -#define SINC_CCFR_ICSEL(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCFR_ICSEL_SHIFT)) & SINC_CCFR_ICSEL_MASK) - -#define SINC_CCFR_ICESEL_MASK (0xE00000U) -#define SINC_CCFR_ICESEL_SHIFT (21U) -/*! ICESEL - Input Clock Edge Select - * 0b001..Positive edge - * 0b010..Negative edge - * 0b011..Both edges - * 0b100..Every other odd positive edge - * 0b101..Every other even positive edge - * 0b110..Every other odd negative edge - * 0b111..Every other even negative edge - * *.. - */ -#define SINC_CCFR_ICESEL(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCFR_ICESEL_SHIFT)) & SINC_CCFR_ICESEL_MASK) - -#define SINC_CCFR_ITSEL_MASK (0x3000000U) -#define SINC_CCFR_ITSEL_SHIFT (24U) -/*! ITSEL - Input Trigger Select - * 0b00..Software - * 0b01..Hardware trigger dedicated to the channel - * 0b11..Grouped trigger shared with an adjacent channel; the adjacent channel's ITSEL field determines the trigger - * *.. - */ -#define SINC_CCFR_ITSEL(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCFR_ITSEL_SHIFT)) & SINC_CCFR_ITSEL_MASK) - -#define SINC_CCFR_IBSEL_MASK (0xC000000U) -#define SINC_CCFR_IBSEL_SHIFT (26U) -/*! IBSEL - Input Bit Select - * 0b00..External bitstream from the MBIT[n] signal - * 0b01..Alternate internal bitstream from the INP[n] signal - * 0b11..Grouped bitstream shared with an adjacent channel; the adjacent channel's IBSEL field determines the input - * *.. - */ -#define SINC_CCFR_IBSEL(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCFR_IBSEL_SHIFT)) & SINC_CCFR_IBSEL_MASK) - -#define SINC_CCFR_ITLVL_MASK (0x10000000U) -#define SINC_CCFR_ITLVL_SHIFT (28U) -/*! ITLVL - Input Trigger Level Type - * 0b0..Edge - * 0b1..Level - */ -#define SINC_CCFR_ITLVL(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCFR_ITLVL_SHIFT)) & SINC_CCFR_ITLVL_MASK) - -#define SINC_CCFR_ZCOP_MASK (0xC0000000U) -#define SINC_CCFR_ZCOP_SHIFT (30U) -/*! ZCOP - Zero Cross Option - * 0b00..Both rise and fall - * 0b10..Rise - * 0b01..Fall - * *.. - */ -#define SINC_CCFR_ZCOP(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCFR_ZCOP_SHIFT)) & SINC_CCFR_ZCOP_MASK) -/*! @} */ - -/* The count of SINC_CCFR */ -#define SINC_CCFR_COUNT (5U) - -/*! @name CPROT - Channel 0 Protection..Channel 4 Protection */ -/*! @{ */ - -#define SINC_CPROT_SCDLMT_MASK (0xFFU) -#define SINC_CPROT_SCDLMT_SHIFT (0U) -/*! SCDLMT - SCD Limit Threshold - * 0b00000000-0b00000001..Disables SCD - * *..Threshold value - */ -#define SINC_CPROT_SCDLMT(x) (((uint32_t)(((uint32_t)(x)) << SINC_CPROT_SCDLMT_SHIFT)) & SINC_CPROT_SCDLMT_MASK) - -#define SINC_CPROT_SCDCM_MASK (0x800U) -#define SINC_CPROT_SCDCM_SHIFT (11U) -/*! SCDCM - SCD Conversion Mode - * 0b0..Constantly when CnCR[CHEN] = MCR[MEN] = 1 - * 0b1..Only when the PF is performing a conversion - */ -#define SINC_CPROT_SCDCM(x) (((uint32_t)(((uint32_t)(x)) << SINC_CPROT_SCDCM_SHIFT)) & SINC_CPROT_SCDCM_MASK) - -#define SINC_CPROT_SCDOP_MASK (0x3000U) -#define SINC_CPROT_SCDOP_SHIFT (12U) -/*! SCDOP - SCD Option - * 0b00..Both 0 and 1 - * 0b01..Only 1 - * 0b10..Only 0 - * 0b11.. - */ -#define SINC_CPROT_SCDOP(x) (((uint32_t)(((uint32_t)(x)) << SINC_CPROT_SCDOP_SHIFT)) & SINC_CPROT_SCDOP_MASK) - -#define SINC_CPROT_LMTOP_MASK (0xC000U) -#define SINC_CPROT_LMTOP_SHIFT (14U) -/*! LMTOP - Limit Detection Option - * 0b00..Both high and low limits - * 0b01..High limit - * 0b10..Low limit - * 0b11..Windowed value - */ -#define SINC_CPROT_LMTOP(x) (((uint32_t)(((uint32_t)(x)) << SINC_CPROT_LMTOP_SHIFT)) & SINC_CPROT_LMTOP_MASK) - -#define SINC_CPROT_CADLMT_MASK (0xF0000U) -#define SINC_CPROT_CADLMT_SHIFT (16U) -/*! CADLMT - CAD Limit Threshold - * 0b0000..Disables CAD - * *..Threshold value - */ -#define SINC_CPROT_CADLMT(x) (((uint32_t)(((uint32_t)(x)) << SINC_CPROT_CADLMT_SHIFT)) & SINC_CPROT_CADLMT_MASK) - -#define SINC_CPROT_CADBK_MASK (0x4000000U) -#define SINC_CPROT_CADBK_SHIFT (26U) -/*! CADBK - CAD Break Signal - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_CPROT_CADBK(x) (((uint32_t)(((uint32_t)(x)) << SINC_CPROT_CADBK_SHIFT)) & SINC_CPROT_CADBK_MASK) - -#define SINC_CPROT_SCDBK_MASK (0x8000000U) -#define SINC_CPROT_SCDBK_SHIFT (27U) -/*! SCDBK - SCD Break Signal - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_CPROT_SCDBK(x) (((uint32_t)(((uint32_t)(x)) << SINC_CPROT_SCDBK_SHIFT)) & SINC_CPROT_SCDBK_MASK) - -#define SINC_CPROT_LLMTBK_MASK (0x20000000U) -#define SINC_CPROT_LLMTBK_SHIFT (29U) -/*! LLMTBK - Low Limit Break Signal - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_CPROT_LLMTBK(x) (((uint32_t)(((uint32_t)(x)) << SINC_CPROT_LLMTBK_SHIFT)) & SINC_CPROT_LLMTBK_MASK) - -#define SINC_CPROT_WLMTBK_MASK (0x40000000U) -#define SINC_CPROT_WLMTBK_SHIFT (30U) -/*! WLMTBK - Window Limit Break Signal - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_CPROT_WLMTBK(x) (((uint32_t)(((uint32_t)(x)) << SINC_CPROT_WLMTBK_SHIFT)) & SINC_CPROT_WLMTBK_MASK) - -#define SINC_CPROT_HLMTBK_MASK (0x80000000U) -#define SINC_CPROT_HLMTBK_SHIFT (31U) -/*! HLMTBK - High Limit Break Signal - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_CPROT_HLMTBK(x) (((uint32_t)(((uint32_t)(x)) << SINC_CPROT_HLMTBK_SHIFT)) & SINC_CPROT_HLMTBK_MASK) -/*! @} */ - -/* The count of SINC_CPROT */ -#define SINC_CPROT_COUNT (5U) - -/*! @name CBIAS - Channel 0 Bias..Channel 4 Bias */ -/*! @{ */ - -#define SINC_CBIAS_BIAS_MASK (0xFFFFFF00U) -#define SINC_CBIAS_BIAS_SHIFT (8U) -/*! BIAS - Bias Value */ -#define SINC_CBIAS_BIAS(x) (((uint32_t)(((uint32_t)(x)) << SINC_CBIAS_BIAS_SHIFT)) & SINC_CBIAS_BIAS_MASK) -/*! @} */ - -/* The count of SINC_CBIAS */ -#define SINC_CBIAS_COUNT (5U) - -/*! @name CLOLMT - Channel 0 Low Limit..Channel 4 Low Limit */ -/*! @{ */ - -#define SINC_CLOLMT_LOLMT_MASK (0xFFFFFF00U) -#define SINC_CLOLMT_LOLMT_SHIFT (8U) -/*! LOLMT - Low Limit Threshold */ -#define SINC_CLOLMT_LOLMT(x) (((uint32_t)(((uint32_t)(x)) << SINC_CLOLMT_LOLMT_SHIFT)) & SINC_CLOLMT_LOLMT_MASK) -/*! @} */ - -/* The count of SINC_CLOLMT */ -#define SINC_CLOLMT_COUNT (5U) - -/*! @name CHILMT - Channel 0 High Limit..Channel 4 High Limit */ -/*! @{ */ - -#define SINC_CHILMT_HILMT_MASK (0xFFFFFF00U) -#define SINC_CHILMT_HILMT_SHIFT (8U) -/*! HILMT - High Limit Threshold */ -#define SINC_CHILMT_HILMT(x) (((uint32_t)(((uint32_t)(x)) << SINC_CHILMT_HILMT_SHIFT)) & SINC_CHILMT_HILMT_MASK) -/*! @} */ - -/* The count of SINC_CHILMT */ -#define SINC_CHILMT_COUNT (5U) - -/*! @name CRDATA - Channel 0 Result Data..Channel 4 Result Data */ -/*! @{ */ - -#define SINC_CRDATA_RDATA_MASK (0xFFFFFF00U) -#define SINC_CRDATA_RDATA_SHIFT (8U) -/*! RDATA - Result Data */ -#define SINC_CRDATA_RDATA(x) (((uint32_t)(((uint32_t)(x)) << SINC_CRDATA_RDATA_SHIFT)) & SINC_CRDATA_RDATA_MASK) -/*! @} */ - -/* The count of SINC_CRDATA */ -#define SINC_CRDATA_COUNT (5U) - -/*! @name CMPDATA - Channel 0 Multipurpose Data..Channel 4 Multipurpose Data */ -/*! @{ */ - -#define SINC_CMPDATA_MPDATA_MASK (0xFFFFFFFFU) -#define SINC_CMPDATA_MPDATA_SHIFT (0U) -/*! MPDATA - Multipurpose Data */ -#define SINC_CMPDATA_MPDATA(x) (((uint32_t)(((uint32_t)(x)) << SINC_CMPDATA_MPDATA_SHIFT)) & SINC_CMPDATA_MPDATA_MASK) -/*! @} */ - -/* The count of SINC_CMPDATA */ -#define SINC_CMPDATA_COUNT (5U) - -/*! @name CACFR - Channel 0 Advanced Configuration..Channel 4 Advanced Configuration */ -/*! @{ */ - -#define SINC_CACFR_ADMASEL_MASK (0xF000U) -#define SINC_CACFR_ADMASEL_SHIFT (12U) -/*! ADMASEL - Alternate DMA Source Selection - * 0b0000..Alternate DMA disabled - * 0b0001..PF conversion complete - * 0b0010..PF data output ready - * 0b0011..Zero crossing detected - * 0b0100..Short circuit detected - * 0b0101..Window limit detected - * 0b0110..Low limit detected - * 0b0111..High limit - * 0b1000..FIFO underflow - * 0b1001..FIFO overflow - * 0b1010..Clock absence - * 0b1011..Saturation - */ -#define SINC_CACFR_ADMASEL(x) (((uint32_t)(((uint32_t)(x)) << SINC_CACFR_ADMASEL_SHIFT)) & SINC_CACFR_ADMASEL_MASK) - -#define SINC_CACFR_HPFA_MASK (0xF0000U) -#define SINC_CACFR_HPFA_SHIFT (16U) -/*! HPFA - HPF DC Remover Alpha Coefficient */ -#define SINC_CACFR_HPFA(x) (((uint32_t)(((uint32_t)(x)) << SINC_CACFR_HPFA_SHIFT)) & SINC_CACFR_HPFA_MASK) - -#define SINC_CACFR_IBDLY_MASK (0xF00000U) -#define SINC_CACFR_IBDLY_SHIFT (20U) -/*! IBDLY - Input Modulator Bitstream Delay - * 0b0000..Disabled - * *..Delay in clock cycles - */ -#define SINC_CACFR_IBDLY(x) (((uint32_t)(((uint32_t)(x)) << SINC_CACFR_IBDLY_SHIFT)) & SINC_CACFR_IBDLY_MASK) -/*! @} */ - -/* The count of SINC_CACFR */ -#define SINC_CACFR_COUNT (5U) - -/*! @name CSR - Channel 0 Status..Channel 4 Status */ -/*! @{ */ - -#define SINC_CSR_FIFOAVIL_MASK (0x1FU) -#define SINC_CSR_FIFOAVIL_SHIFT (0U) -/*! FIFOAVIL - FIFO Available Data */ -#define SINC_CSR_FIFOAVIL(x) (((uint32_t)(((uint32_t)(x)) << SINC_CSR_FIFOAVIL_SHIFT)) & SINC_CSR_FIFOAVIL_MASK) - -#define SINC_CSR_PSRDY_MASK (0x80U) -#define SINC_CSR_PSRDY_SHIFT (7U) -/*! PSRDY - Parallel or Serial Data Ready - * 0b0..Not ready - * 0b1..Ready - */ -#define SINC_CSR_PSRDY(x) (((uint32_t)(((uint32_t)(x)) << SINC_CSR_PSRDY_SHIFT)) & SINC_CSR_PSRDY_MASK) - -#define SINC_CSR_PFSAT_MASK (0x100U) -#define SINC_CSR_PFSAT_SHIFT (8U) -/*! PFSAT - Primary CIC Saturation Flag - * 0b0..Did not occur - * 0b1..Occurred - */ -#define SINC_CSR_PFSAT(x) (((uint32_t)(((uint32_t)(x)) << SINC_CSR_PFSAT_SHIFT)) & SINC_CSR_PFSAT_MASK) - -#define SINC_CSR_HPFSAT_MASK (0x200U) -#define SINC_CSR_HPFSAT_SHIFT (9U) -/*! HPFSAT - HPF Saturation Flag - * 0b0..Did not occur - * 0b1..Occurred - */ -#define SINC_CSR_HPFSAT(x) (((uint32_t)(((uint32_t)(x)) << SINC_CSR_HPFSAT_SHIFT)) & SINC_CSR_HPFSAT_MASK) - -#define SINC_CSR_SFTSAT_MASK (0x400U) -#define SINC_CSR_SFTSAT_SHIFT (10U) -/*! SFTSAT - Shift Saturation Flag - * 0b0..Did not occur - * 0b1..Occurred - */ -#define SINC_CSR_SFTSAT(x) (((uint32_t)(((uint32_t)(x)) << SINC_CSR_SFTSAT_SHIFT)) & SINC_CSR_SFTSAT_MASK) - -#define SINC_CSR_BIASSAT_MASK (0x800U) -#define SINC_CSR_BIASSAT_SHIFT (11U) -/*! BIASSAT - Bias Saturation Flag - * 0b0..Did not occur - * 0b1..Occurred - */ -#define SINC_CSR_BIASSAT(x) (((uint32_t)(((uint32_t)(x)) << SINC_CSR_BIASSAT_SHIFT)) & SINC_CSR_BIASSAT_MASK) - -#define SINC_CSR_RDRS_MASK (0x1000U) -#define SINC_CSR_RDRS_SHIFT (12U) -/*! RDRS - Result Data Direct Read Status - * 0b0..Valid - * 0b1..Invalid - */ -#define SINC_CSR_RDRS(x) (((uint32_t)(((uint32_t)(x)) << SINC_CSR_RDRS_SHIFT)) & SINC_CSR_RDRS_MASK) - -#define SINC_CSR_SRDS_MASK (0x2000U) -#define SINC_CSR_SRDS_SHIFT (13U) -/*! SRDS - Start Read Debug Data Sync - * 0b0..Data valid - * 0b1..Procedure in progress - * 0b0..No effect - * 0b1..Starts the procedure - */ -#define SINC_CSR_SRDS(x) (((uint32_t)(((uint32_t)(x)) << SINC_CSR_SRDS_SHIFT)) & SINC_CSR_SRDS_MASK) - -#define SINC_CSR_DBGRS_MASK (0xC000U) -#define SINC_CSR_DBGRS_SHIFT (14U) -/*! DBGRS - Debug Data Read Status - * 0b00..Valid - * 0b01-0b11..Invalid - */ -#define SINC_CSR_DBGRS(x) (((uint32_t)(((uint32_t)(x)) << SINC_CSR_DBGRS_SHIFT)) & SINC_CSR_DBGRS_MASK) - -#define SINC_CSR_CNUM_MASK (0x7F0000U) -#define SINC_CSR_CNUM_SHIFT (16U) -/*! CNUM - Number Of Conversions */ -#define SINC_CSR_CNUM(x) (((uint32_t)(((uint32_t)(x)) << SINC_CSR_CNUM_SHIFT)) & SINC_CSR_CNUM_MASK) - -#define SINC_CSR_CNUM_OV_MASK (0x800000U) -#define SINC_CSR_CNUM_OV_SHIFT (23U) -/*! CNUM_OV - Overflow In Number Of Conversions - * 0b0..No overflow - * 0b1..Overflow - */ -#define SINC_CSR_CNUM_OV(x) (((uint32_t)(((uint32_t)(x)) << SINC_CSR_CNUM_OV_SHIFT)) & SINC_CSR_CNUM_OV_MASK) -/*! @} */ - -/* The count of SINC_CSR */ -#define SINC_CSR_COUNT (5U) - -/*! @name CDBGR - Channel 0 Debug..Channel 4 Debug */ -/*! @{ */ - -#define SINC_CDBGR_DBGDATA_MASK (0xFFFFFFFFU) -#define SINC_CDBGR_DBGDATA_SHIFT (0U) -/*! DBGDATA - Debug Data */ -#define SINC_CDBGR_DBGDATA(x) (((uint32_t)(((uint32_t)(x)) << SINC_CDBGR_DBGDATA_SHIFT)) & SINC_CDBGR_DBGDATA_MASK) -/*! @} */ - -/* The count of SINC_CDBGR */ -#define SINC_CDBGR_COUNT (5U) - - -/*! - * @} - */ /* end of group SINC_Register_Masks */ - - -/* SINC - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral SINC0 base address */ - #define SINC0_BASE (0x50108000u) - /** Peripheral SINC0 base address */ - #define SINC0_BASE_NS (0x40108000u) - /** Peripheral SINC0 base pointer */ - #define SINC0 ((SINC_Type *)SINC0_BASE) - /** Peripheral SINC0 base pointer */ - #define SINC0_NS ((SINC_Type *)SINC0_BASE_NS) - /** Array initializer of SINC peripheral base addresses */ - #define SINC_BASE_ADDRS { SINC0_BASE } - /** Array initializer of SINC peripheral base pointers */ - #define SINC_BASE_PTRS { SINC0 } - /** Array initializer of SINC peripheral base addresses */ - #define SINC_BASE_ADDRS_NS { SINC0_BASE_NS } - /** Array initializer of SINC peripheral base pointers */ - #define SINC_BASE_PTRS_NS { SINC0_NS } -#else - /** Peripheral SINC0 base address */ - #define SINC0_BASE (0x40108000u) - /** Peripheral SINC0 base pointer */ - #define SINC0 ((SINC_Type *)SINC0_BASE) - /** Array initializer of SINC peripheral base addresses */ - #define SINC_BASE_ADDRS { SINC0_BASE } - /** Array initializer of SINC peripheral base pointers */ - #define SINC_BASE_PTRS { SINC0 } -#endif - -/*! - * @} - */ /* end of group SINC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- SMARTDMA Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SMARTDMA_Peripheral_Access_Layer SMARTDMA Peripheral Access Layer - * @{ - */ - -/** SMARTDMA - Register Layout Typedef */ -typedef struct { - uint8_t RESERVED_0[32]; - __IO uint32_t BOOTADR; /**< Boot Address, offset: 0x20 */ - __IO uint32_t CTRL; /**< Control, offset: 0x24 */ - __I uint32_t PC; /**< Program Counter, offset: 0x28 */ - __I uint32_t SP; /**< Stack Pointer, offset: 0x2C */ - __IO uint32_t BREAK_ADDR; /**< Breakpoint Address, offset: 0x30 */ - __IO uint32_t BREAK_VECT; /**< Breakpoint Vector, offset: 0x34 */ - __IO uint32_t EMER_VECT; /**< Emergency Vector, offset: 0x38 */ - __IO uint32_t EMER_SEL; /**< Emergency Select, offset: 0x3C */ - __IO uint32_t ARM2EZH; /**< ARM to EZH Interrupt Control, offset: 0x40 */ - __IO uint32_t EZH2ARM; /**< EZH to ARM Trigger, offset: 0x44 */ - __IO uint32_t PENDTRAP; /**< Pending Trap Control, offset: 0x48 */ -} SMARTDMA_Type; - -/* ---------------------------------------------------------------------------- - -- SMARTDMA Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SMARTDMA_Register_Masks SMARTDMA Register Masks - * @{ - */ - -/*! @name BOOTADR - Boot Address */ -/*! @{ */ - -#define SMARTDMA_BOOTADR_ADDR_MASK (0xFFFFFFFCU) -#define SMARTDMA_BOOTADR_ADDR_SHIFT (2U) -/*! ADDR - 32-bit boot address, the boot address should be 4-byte aligned. */ -#define SMARTDMA_BOOTADR_ADDR(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_BOOTADR_ADDR_SHIFT)) & SMARTDMA_BOOTADR_ADDR_MASK) -/*! @} */ - -/*! @name CTRL - Control */ -/*! @{ */ - -#define SMARTDMA_CTRL_START_MASK (0x1U) -#define SMARTDMA_CTRL_START_SHIFT (0U) -/*! START - Start Bit Ignition */ -#define SMARTDMA_CTRL_START(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_CTRL_START_SHIFT)) & SMARTDMA_CTRL_START_MASK) - -#define SMARTDMA_CTRL_EXF_MASK (0x2U) -#define SMARTDMA_CTRL_EXF_SHIFT (1U) -/*! EXF - External Flag */ -#define SMARTDMA_CTRL_EXF(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_CTRL_EXF_SHIFT)) & SMARTDMA_CTRL_EXF_MASK) - -#define SMARTDMA_CTRL_ERRDIS_MASK (0x4U) -#define SMARTDMA_CTRL_ERRDIS_SHIFT (2U) -/*! ERRDIS - Error Disable */ -#define SMARTDMA_CTRL_ERRDIS(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_CTRL_ERRDIS_SHIFT)) & SMARTDMA_CTRL_ERRDIS_MASK) - -#define SMARTDMA_CTRL_BUFEN_MASK (0x8U) -#define SMARTDMA_CTRL_BUFEN_SHIFT (3U) -/*! BUFEN - Buffer Enable */ -#define SMARTDMA_CTRL_BUFEN(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_CTRL_BUFEN_SHIFT)) & SMARTDMA_CTRL_BUFEN_MASK) - -#define SMARTDMA_CTRL_SYNCEN_MASK (0x10U) -#define SMARTDMA_CTRL_SYNCEN_SHIFT (4U) -/*! SYNCEN - Sync Enable */ -#define SMARTDMA_CTRL_SYNCEN(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_CTRL_SYNCEN_SHIFT)) & SMARTDMA_CTRL_SYNCEN_MASK) - -#define SMARTDMA_CTRL_WKEY_MASK (0xFFFF0000U) -#define SMARTDMA_CTRL_WKEY_SHIFT (16U) -/*! WKEY - Write Key */ -#define SMARTDMA_CTRL_WKEY(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_CTRL_WKEY_SHIFT)) & SMARTDMA_CTRL_WKEY_MASK) -/*! @} */ - -/*! @name PC - Program Counter */ -/*! @{ */ - -#define SMARTDMA_PC_PC_MASK (0xFFFFFFFFU) -#define SMARTDMA_PC_PC_SHIFT (0U) -/*! PC - Program Counter */ -#define SMARTDMA_PC_PC(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_PC_PC_SHIFT)) & SMARTDMA_PC_PC_MASK) -/*! @} */ - -/*! @name SP - Stack Pointer */ -/*! @{ */ - -#define SMARTDMA_SP_SP_MASK (0xFFFFFFFFU) -#define SMARTDMA_SP_SP_SHIFT (0U) -/*! SP - Stack Pointer */ -#define SMARTDMA_SP_SP(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_SP_SP_SHIFT)) & SMARTDMA_SP_SP_MASK) -/*! @} */ - -/*! @name BREAK_ADDR - Breakpoint Address */ -/*! @{ */ - -#define SMARTDMA_BREAK_ADDR_ADDR_MASK (0xFFFFFFFCU) -#define SMARTDMA_BREAK_ADDR_ADDR_SHIFT (2U) -/*! ADDR - 32-bit address to swap to EZHB_BREAK_VECT location */ -#define SMARTDMA_BREAK_ADDR_ADDR(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_BREAK_ADDR_ADDR_SHIFT)) & SMARTDMA_BREAK_ADDR_ADDR_MASK) -/*! @} */ - -/*! @name BREAK_VECT - Breakpoint Vector */ -/*! @{ */ - -#define SMARTDMA_BREAK_VECT_VEC_MASK (0xFFFFFFFCU) -#define SMARTDMA_BREAK_VECT_VEC_SHIFT (2U) -/*! VEC - Vector address of user debug routine. */ -#define SMARTDMA_BREAK_VECT_VEC(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_BREAK_VECT_VEC_SHIFT)) & SMARTDMA_BREAK_VECT_VEC_MASK) -/*! @} */ - -/*! @name EMER_VECT - Emergency Vector */ -/*! @{ */ - -#define SMARTDMA_EMER_VECT_VEC_MASK (0xFFFFFFFCU) -#define SMARTDMA_EMER_VECT_VEC_SHIFT (2U) -/*! VEC - Vector address of emergency code routine */ -#define SMARTDMA_EMER_VECT_VEC(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_EMER_VECT_VEC_SHIFT)) & SMARTDMA_EMER_VECT_VEC_MASK) -/*! @} */ - -/*! @name EMER_SEL - Emergency Select */ -/*! @{ */ - -#define SMARTDMA_EMER_SEL_EN_MASK (0x100U) -#define SMARTDMA_EMER_SEL_EN_SHIFT (8U) -/*! EN - Emergency code routine */ -#define SMARTDMA_EMER_SEL_EN(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_EMER_SEL_EN_SHIFT)) & SMARTDMA_EMER_SEL_EN_MASK) - -#define SMARTDMA_EMER_SEL_RQ_MASK (0x200U) -#define SMARTDMA_EMER_SEL_RQ_SHIFT (9U) -/*! RQ - Software emergency request */ -#define SMARTDMA_EMER_SEL_RQ(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_EMER_SEL_RQ_SHIFT)) & SMARTDMA_EMER_SEL_RQ_MASK) -/*! @} */ - -/*! @name ARM2EZH - ARM to EZH Interrupt Control */ -/*! @{ */ - -#define SMARTDMA_ARM2EZH_IE_MASK (0x3U) -#define SMARTDMA_ARM2EZH_IE_SHIFT (0U) -/*! IE - Interrupt Enable */ -#define SMARTDMA_ARM2EZH_IE(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_ARM2EZH_IE_SHIFT)) & SMARTDMA_ARM2EZH_IE_MASK) - -#define SMARTDMA_ARM2EZH_GP_MASK (0xFFFFFFFCU) -#define SMARTDMA_ARM2EZH_GP_SHIFT (2U) -/*! GP - General purpose register bits */ -#define SMARTDMA_ARM2EZH_GP(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_ARM2EZH_GP_SHIFT)) & SMARTDMA_ARM2EZH_GP_MASK) -/*! @} */ - -/*! @name EZH2ARM - EZH to ARM Trigger */ -/*! @{ */ - -#define SMARTDMA_EZH2ARM_GP_MASK (0xFFFFFFFFU) -#define SMARTDMA_EZH2ARM_GP_SHIFT (0U) -/*! GP - General purpose register bits Writing to EZH2ARM triggers the ARM interrupt when ARM2EZH [1:0] == 2h */ -#define SMARTDMA_EZH2ARM_GP(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_EZH2ARM_GP_SHIFT)) & SMARTDMA_EZH2ARM_GP_MASK) -/*! @} */ - -/*! @name PENDTRAP - Pending Trap Control */ -/*! @{ */ - -#define SMARTDMA_PENDTRAP_STATUS_MASK (0xFFU) -#define SMARTDMA_PENDTRAP_STATUS_SHIFT (0U) -/*! STATUS - Status Flag or Pending Trap Request */ -#define SMARTDMA_PENDTRAP_STATUS(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_PENDTRAP_STATUS_SHIFT)) & SMARTDMA_PENDTRAP_STATUS_MASK) - -#define SMARTDMA_PENDTRAP_POL_MASK (0xFF00U) -#define SMARTDMA_PENDTRAP_POL_SHIFT (8U) -/*! POL - Polarity */ -#define SMARTDMA_PENDTRAP_POL(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_PENDTRAP_POL_SHIFT)) & SMARTDMA_PENDTRAP_POL_MASK) - -#define SMARTDMA_PENDTRAP_EN_MASK (0xFF0000U) -#define SMARTDMA_PENDTRAP_EN_SHIFT (16U) -/*! EN - Enable Pending Trap */ -#define SMARTDMA_PENDTRAP_EN(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_PENDTRAP_EN_SHIFT)) & SMARTDMA_PENDTRAP_EN_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group SMARTDMA_Register_Masks */ - - -/* SMARTDMA - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral SMARTDMA0 base address */ - #define SMARTDMA0_BASE (0x50033000u) - /** Peripheral SMARTDMA0 base address */ - #define SMARTDMA0_BASE_NS (0x40033000u) - /** Peripheral SMARTDMA0 base pointer */ - #define SMARTDMA0 ((SMARTDMA_Type *)SMARTDMA0_BASE) - /** Peripheral SMARTDMA0 base pointer */ - #define SMARTDMA0_NS ((SMARTDMA_Type *)SMARTDMA0_BASE_NS) - /** Array initializer of SMARTDMA peripheral base addresses */ - #define SMARTDMA_BASE_ADDRS { SMARTDMA0_BASE } - /** Array initializer of SMARTDMA peripheral base pointers */ - #define SMARTDMA_BASE_PTRS { SMARTDMA0 } - /** Array initializer of SMARTDMA peripheral base addresses */ - #define SMARTDMA_BASE_ADDRS_NS { SMARTDMA0_BASE_NS } - /** Array initializer of SMARTDMA peripheral base pointers */ - #define SMARTDMA_BASE_PTRS_NS { SMARTDMA0_NS } -#else - /** Peripheral SMARTDMA0 base address */ - #define SMARTDMA0_BASE (0x40033000u) - /** Peripheral SMARTDMA0 base pointer */ - #define SMARTDMA0 ((SMARTDMA_Type *)SMARTDMA0_BASE) - /** Array initializer of SMARTDMA peripheral base addresses */ - #define SMARTDMA_BASE_ADDRS { SMARTDMA0_BASE } - /** Array initializer of SMARTDMA peripheral base pointers */ - #define SMARTDMA_BASE_PTRS { SMARTDMA0 } -#endif - -/*! - * @} - */ /* end of group SMARTDMA_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- SPC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SPC_Peripheral_Access_Layer SPC Peripheral Access Layer - * @{ - */ - -/** SPC - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - uint8_t RESERVED_0[12]; - __IO uint32_t SC; /**< Status Control, offset: 0x10 */ - __IO uint32_t CNTRL; /**< SPC Regulator Control, offset: 0x14 */ - uint8_t RESERVED_1[4]; - __IO uint32_t LPREQ_CFG; /**< Low-Power Request Configuration, offset: 0x1C */ - uint8_t RESERVED_2[16]; - __IO uint32_t PD_STATUS[2]; /**< SPC Power Domain Mode Status, array offset: 0x30, array step: 0x4 */ - uint8_t RESERVED_3[8]; - __IO uint32_t SRAMCTL; /**< SRAM Control, offset: 0x40 */ - uint8_t RESERVED_4[188]; - __IO uint32_t ACTIVE_CFG; /**< Active Power Mode Configuration, offset: 0x100 */ - __IO uint32_t ACTIVE_CFG1; /**< Active Power Mode Configuration 1, offset: 0x104 */ - __IO uint32_t LP_CFG; /**< Low-Power Mode Configuration, offset: 0x108 */ - __IO uint32_t LP_CFG1; /**< Low Power Mode Configuration 1, offset: 0x10C */ - uint8_t RESERVED_5[16]; - __IO uint32_t LPWKUP_DELAY; /**< Low Power Wake-Up Delay, offset: 0x120 */ - __IO uint32_t ACTIVE_VDELAY; /**< Active Voltage Trim Delay, offset: 0x124 */ - uint8_t RESERVED_6[8]; - __IO uint32_t VD_STAT; /**< Voltage Detect Status, offset: 0x130 */ - __IO uint32_t VD_CORE_CFG; /**< Core Voltage Detect Configuration, offset: 0x134 */ - __IO uint32_t VD_SYS_CFG; /**< System Voltage Detect Configuration, offset: 0x138 */ - __IO uint32_t VD_IO_CFG; /**< IO Voltage Detect Configuration, offset: 0x13C */ - __IO uint32_t EVD_CFG; /**< External Voltage Domain Configuration, offset: 0x140 */ - __IO uint32_t GLITCH_DETECT_SC; /**< Glitch Detect Status Control, offset: 0x144 */ - uint8_t RESERVED_7[440]; - __IO uint32_t CORELDO_CFG; /**< LDO_CORE Configuration, offset: 0x300 */ - uint8_t RESERVED_8[252]; - __IO uint32_t SYSLDO_CFG; /**< LDO_SYS Configuration, offset: 0x400 */ - uint8_t RESERVED_9[252]; - __IO uint32_t DCDC_CFG; /**< DCDC Configuration, offset: 0x500 */ - __IO uint32_t DCDC_BURST_CFG; /**< DCDC Burst Configuration, offset: 0x504 */ -} SPC_Type; - -/* ---------------------------------------------------------------------------- - -- SPC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SPC_Register_Masks SPC Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define SPC_VERID_FEATURE_MASK (0xFFFFU) -#define SPC_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Standard features - * *.. - */ -#define SPC_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VERID_FEATURE_SHIFT)) & SPC_VERID_FEATURE_MASK) - -#define SPC_VERID_MINOR_MASK (0xFF0000U) -#define SPC_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define SPC_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << SPC_VERID_MINOR_SHIFT)) & SPC_VERID_MINOR_MASK) - -#define SPC_VERID_MAJOR_MASK (0xFF000000U) -#define SPC_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define SPC_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << SPC_VERID_MAJOR_SHIFT)) & SPC_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name SC - Status Control */ -/*! @{ */ - -#define SPC_SC_BUSY_MASK (0x1U) -#define SPC_SC_BUSY_SHIFT (0U) -/*! BUSY - SPC Busy Status Flag - * 0b0..Not busy - * 0b1..Busy - */ -#define SPC_SC_BUSY(x) (((uint32_t)(((uint32_t)(x)) << SPC_SC_BUSY_SHIFT)) & SPC_SC_BUSY_MASK) - -#define SPC_SC_SPC_LP_REQ_MASK (0x2U) -#define SPC_SC_SPC_LP_REQ_SHIFT (1U) -/*! SPC_LP_REQ - SPC Power Mode Configuration Status Flag - * 0b0..SPC is in Active or Sleep mode; the ACTIVE_CFG register has control - * 0b1..All power domains requested low-power mode; SPC entered a low-power state; power-mode configuration based on the LP_CFG register - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_SC_SPC_LP_REQ(x) (((uint32_t)(((uint32_t)(x)) << SPC_SC_SPC_LP_REQ_SHIFT)) & SPC_SC_SPC_LP_REQ_MASK) - -#define SPC_SC_SPC_LP_MODE_MASK (0xF0U) -#define SPC_SC_SPC_LP_MODE_SHIFT (4U) -/*! SPC_LP_MODE - Power Domain Low-Power Mode Request - * 0b0000..Sleep mode with system clock running - * 0b0001..DSLEEP with system clock off - * 0b0010..PDOWN with system clock off - * 0b0100.. - * 0b1000..DPDOWN with system clock off - */ -#define SPC_SC_SPC_LP_MODE(x) (((uint32_t)(((uint32_t)(x)) << SPC_SC_SPC_LP_MODE_SHIFT)) & SPC_SC_SPC_LP_MODE_MASK) - -#define SPC_SC_ISO_CLR_MASK (0x30000U) -#define SPC_SC_ISO_CLR_SHIFT (16U) -/*! ISO_CLR - Isolation Clear Flags */ -#define SPC_SC_ISO_CLR(x) (((uint32_t)(((uint32_t)(x)) << SPC_SC_ISO_CLR_SHIFT)) & SPC_SC_ISO_CLR_MASK) -/*! @} */ - -/*! @name CNTRL - SPC Regulator Control */ -/*! @{ */ - -#define SPC_CNTRL_CORELDO_EN_MASK (0x1U) -#define SPC_CNTRL_CORELDO_EN_SHIFT (0U) -/*! CORELDO_EN - LDO_CORE Regulator Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_CNTRL_CORELDO_EN(x) (((uint32_t)(((uint32_t)(x)) << SPC_CNTRL_CORELDO_EN_SHIFT)) & SPC_CNTRL_CORELDO_EN_MASK) - -#define SPC_CNTRL_SYSLDO_EN_MASK (0x2U) -#define SPC_CNTRL_SYSLDO_EN_SHIFT (1U) -/*! SYSLDO_EN - LDO_SYS Regulator Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_CNTRL_SYSLDO_EN(x) (((uint32_t)(((uint32_t)(x)) << SPC_CNTRL_SYSLDO_EN_SHIFT)) & SPC_CNTRL_SYSLDO_EN_MASK) - -#define SPC_CNTRL_DCDC_EN_MASK (0x4U) -#define SPC_CNTRL_DCDC_EN_SHIFT (2U) -/*! DCDC_EN - DCDC_CORE Regulator Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_CNTRL_DCDC_EN(x) (((uint32_t)(((uint32_t)(x)) << SPC_CNTRL_DCDC_EN_SHIFT)) & SPC_CNTRL_DCDC_EN_MASK) -/*! @} */ - -/*! @name LPREQ_CFG - Low-Power Request Configuration */ -/*! @{ */ - -#define SPC_LPREQ_CFG_LPREQOE_MASK (0x1U) -#define SPC_LPREQ_CFG_LPREQOE_SHIFT (0U) -/*! LPREQOE - Low-Power Request Output Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LPREQ_CFG_LPREQOE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LPREQ_CFG_LPREQOE_SHIFT)) & SPC_LPREQ_CFG_LPREQOE_MASK) - -#define SPC_LPREQ_CFG_LPREQPOL_MASK (0x2U) -#define SPC_LPREQ_CFG_LPREQPOL_SHIFT (1U) -/*! LPREQPOL - Low-Power Request Output Pin Polarity Control - * 0b0..High - * 0b1..Low - */ -#define SPC_LPREQ_CFG_LPREQPOL(x) (((uint32_t)(((uint32_t)(x)) << SPC_LPREQ_CFG_LPREQPOL_SHIFT)) & SPC_LPREQ_CFG_LPREQPOL_MASK) - -#define SPC_LPREQ_CFG_LPREQOV_MASK (0xCU) -#define SPC_LPREQ_CFG_LPREQOV_SHIFT (2U) -/*! LPREQOV - Low-Power Request Output Override - * 0b00..Not forced - * 0b01.. - * 0b10..Forced low (ignore LPREQPOL settings) - * 0b11..Forced high (ignore LPREQPOL settings) - */ -#define SPC_LPREQ_CFG_LPREQOV(x) (((uint32_t)(((uint32_t)(x)) << SPC_LPREQ_CFG_LPREQOV_SHIFT)) & SPC_LPREQ_CFG_LPREQOV_MASK) -/*! @} */ - -/*! @name PD_STATUS - SPC Power Domain Mode Status */ -/*! @{ */ - -#define SPC_PD_STATUS_PWR_REQ_STATUS_MASK (0x1U) -#define SPC_PD_STATUS_PWR_REQ_STATUS_SHIFT (0U) -/*! PWR_REQ_STATUS - Power Request Status Flag - * 0b0..Did not request - * 0b1..Requested - */ -#define SPC_PD_STATUS_PWR_REQ_STATUS(x) (((uint32_t)(((uint32_t)(x)) << SPC_PD_STATUS_PWR_REQ_STATUS_SHIFT)) & SPC_PD_STATUS_PWR_REQ_STATUS_MASK) - -#define SPC_PD_STATUS_PD_LP_REQ_MASK (0x10U) -#define SPC_PD_STATUS_PD_LP_REQ_SHIFT (4U) -/*! PD_LP_REQ - Power Domain Low Power Request Flag - * 0b0..Did not request - * 0b1..Requested - */ -#define SPC_PD_STATUS_PD_LP_REQ(x) (((uint32_t)(((uint32_t)(x)) << SPC_PD_STATUS_PD_LP_REQ_SHIFT)) & SPC_PD_STATUS_PD_LP_REQ_MASK) - -#define SPC_PD_STATUS_LP_MODE_MASK (0xF00U) -#define SPC_PD_STATUS_LP_MODE_SHIFT (8U) -/*! LP_MODE - Power Domain Low Power Mode Request - * 0b0000..SLEEP with system clock running - * 0b0001..DSLEEP with system clock off - * 0b0010..PDOWN with system clock off - * 0b0100.. - * 0b1000..DPDOWN with system clock off - */ -#define SPC_PD_STATUS_LP_MODE(x) (((uint32_t)(((uint32_t)(x)) << SPC_PD_STATUS_LP_MODE_SHIFT)) & SPC_PD_STATUS_LP_MODE_MASK) -/*! @} */ - -/* The count of SPC_PD_STATUS */ -#define SPC_PD_STATUS_COUNT (2U) - -/*! @name SRAMCTL - SRAM Control */ -/*! @{ */ - -#define SPC_SRAMCTL_VSM_MASK (0x3U) -#define SPC_SRAMCTL_VSM_SHIFT (0U) -/*! VSM - Voltage Select Margin - * 0b00.. - * 0b01..1.0 V - * 0b10..1.1 V - * 0b11.. - */ -#define SPC_SRAMCTL_VSM(x) (((uint32_t)(((uint32_t)(x)) << SPC_SRAMCTL_VSM_SHIFT)) & SPC_SRAMCTL_VSM_MASK) - -#define SPC_SRAMCTL_REQ_MASK (0x40000000U) -#define SPC_SRAMCTL_REQ_SHIFT (30U) -/*! REQ - SRAM Voltage Update Request - * 0b0..Do not request - * 0b1..Request - */ -#define SPC_SRAMCTL_REQ(x) (((uint32_t)(((uint32_t)(x)) << SPC_SRAMCTL_REQ_SHIFT)) & SPC_SRAMCTL_REQ_MASK) - -#define SPC_SRAMCTL_ACK_MASK (0x80000000U) -#define SPC_SRAMCTL_ACK_SHIFT (31U) -/*! ACK - SRAM Voltage Update Request Acknowledge - * 0b0..Not acknowledged - * 0b1..Acknowledged - */ -#define SPC_SRAMCTL_ACK(x) (((uint32_t)(((uint32_t)(x)) << SPC_SRAMCTL_ACK_SHIFT)) & SPC_SRAMCTL_ACK_MASK) -/*! @} */ - -/*! @name ACTIVE_CFG - Active Power Mode Configuration */ -/*! @{ */ - -#define SPC_ACTIVE_CFG_CORELDO_VDD_DS_MASK (0x1U) -#define SPC_ACTIVE_CFG_CORELDO_VDD_DS_SHIFT (0U) -/*! CORELDO_VDD_DS - LDO_CORE VDD Drive Strength - * 0b0..Low - * 0b1..Normal - */ -#define SPC_ACTIVE_CFG_CORELDO_VDD_DS(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_CORELDO_VDD_DS_SHIFT)) & SPC_ACTIVE_CFG_CORELDO_VDD_DS_MASK) - -#define SPC_ACTIVE_CFG_CORELDO_VDD_LVL_MASK (0xCU) -#define SPC_ACTIVE_CFG_CORELDO_VDD_LVL_SHIFT (2U) -/*! CORELDO_VDD_LVL - LDO_CORE VDD Regulator Voltage Level - * 0b00.. - * 0b01..Regulate to mid voltage (1.0 V) - * 0b10..Regulate to normal voltage (1.1 V) - * 0b11..Regulate to overdrive voltage (1.2 V) - */ -#define SPC_ACTIVE_CFG_CORELDO_VDD_LVL(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_CORELDO_VDD_LVL_SHIFT)) & SPC_ACTIVE_CFG_CORELDO_VDD_LVL_MASK) - -#define SPC_ACTIVE_CFG_SYSLDO_VDD_DS_MASK (0x10U) -#define SPC_ACTIVE_CFG_SYSLDO_VDD_DS_SHIFT (4U) -/*! SYSLDO_VDD_DS - LDO_SYS VDD Drive Strength - * 0b0..Low - * 0b1..Normal - */ -#define SPC_ACTIVE_CFG_SYSLDO_VDD_DS(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_SYSLDO_VDD_DS_SHIFT)) & SPC_ACTIVE_CFG_SYSLDO_VDD_DS_MASK) - -#define SPC_ACTIVE_CFG_SYSLDO_VDD_LVL_MASK (0x40U) -#define SPC_ACTIVE_CFG_SYSLDO_VDD_LVL_SHIFT (6U) -/*! SYSLDO_VDD_LVL - LDO_SYS VDD Regulator Voltage Level - * 0b0..Normal voltage (1.8 V) - * 0b1..Overdrive voltage (2.5 V) - */ -#define SPC_ACTIVE_CFG_SYSLDO_VDD_LVL(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_SYSLDO_VDD_LVL_SHIFT)) & SPC_ACTIVE_CFG_SYSLDO_VDD_LVL_MASK) - -#define SPC_ACTIVE_CFG_DCDC_VDD_DS_MASK (0x300U) -#define SPC_ACTIVE_CFG_DCDC_VDD_DS_SHIFT (8U) -/*! DCDC_VDD_DS - DCDC VDD Drive Strength - * 0b01..Low - * 0b10..Normal - * *.. - */ -#define SPC_ACTIVE_CFG_DCDC_VDD_DS(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_DCDC_VDD_DS_SHIFT)) & SPC_ACTIVE_CFG_DCDC_VDD_DS_MASK) - -#define SPC_ACTIVE_CFG_DCDC_VDD_LVL_MASK (0xC00U) -#define SPC_ACTIVE_CFG_DCDC_VDD_LVL_SHIFT (10U) -/*! DCDC_VDD_LVL - DCDC VDD Regulator Voltage Level - * 0b00..Reserved - * 0b01..Midvoltage (1.0 V) - * 0b10..Normal voltage (1.1 V) - * 0b11..Overdrive voltage (1.2 V) - */ -#define SPC_ACTIVE_CFG_DCDC_VDD_LVL(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_DCDC_VDD_LVL_SHIFT)) & SPC_ACTIVE_CFG_DCDC_VDD_LVL_MASK) - -#define SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE_MASK (0x1000U) -#define SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE_SHIFT (12U) -/*! GLITCH_DETECT_DISABLE - Glitch Detect Disable - * 0b0..Low Voltage Glitch Detect enabled - * 0b1..Low Voltage Glitch Detect disabled - */ -#define SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE_SHIFT)) & SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE_MASK) - -#define SPC_ACTIVE_CFG_LPBUFF_EN_MASK (0x40000U) -#define SPC_ACTIVE_CFG_LPBUFF_EN_SHIFT (18U) -/*! LPBUFF_EN - CMP Bandgap Buffer Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_ACTIVE_CFG_LPBUFF_EN(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_LPBUFF_EN_SHIFT)) & SPC_ACTIVE_CFG_LPBUFF_EN_MASK) - -#define SPC_ACTIVE_CFG_BGMODE_MASK (0x300000U) -#define SPC_ACTIVE_CFG_BGMODE_SHIFT (20U) -/*! BGMODE - Bandgap Mode - * 0b00..Bandgap disabled - * 0b01..Bandgap enabled, buffer disabled - * 0b10..Bandgap enabled, buffer enabled - * 0b11.. - */ -#define SPC_ACTIVE_CFG_BGMODE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_BGMODE_SHIFT)) & SPC_ACTIVE_CFG_BGMODE_MASK) - -#define SPC_ACTIVE_CFG_VDD_VD_DISABLE_MASK (0x800000U) -#define SPC_ACTIVE_CFG_VDD_VD_DISABLE_SHIFT (23U) -/*! VDD_VD_DISABLE - VDD Voltage Detect Disable - * 0b0..Enable - * 0b1..Disable - */ -#define SPC_ACTIVE_CFG_VDD_VD_DISABLE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_VDD_VD_DISABLE_SHIFT)) & SPC_ACTIVE_CFG_VDD_VD_DISABLE_MASK) - -#define SPC_ACTIVE_CFG_CORE_LVDE_MASK (0x1000000U) -#define SPC_ACTIVE_CFG_CORE_LVDE_SHIFT (24U) -/*! CORE_LVDE - Core Low-Voltage Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_ACTIVE_CFG_CORE_LVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_CORE_LVDE_SHIFT)) & SPC_ACTIVE_CFG_CORE_LVDE_MASK) - -#define SPC_ACTIVE_CFG_SYS_LVDE_MASK (0x2000000U) -#define SPC_ACTIVE_CFG_SYS_LVDE_SHIFT (25U) -/*! SYS_LVDE - System Low-Voltage Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_ACTIVE_CFG_SYS_LVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_SYS_LVDE_SHIFT)) & SPC_ACTIVE_CFG_SYS_LVDE_MASK) - -#define SPC_ACTIVE_CFG_IO_LVDE_MASK (0x4000000U) -#define SPC_ACTIVE_CFG_IO_LVDE_SHIFT (26U) -/*! IO_LVDE - IO Low-Voltage Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_ACTIVE_CFG_IO_LVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_IO_LVDE_SHIFT)) & SPC_ACTIVE_CFG_IO_LVDE_MASK) - -#define SPC_ACTIVE_CFG_CORE_HVDE_MASK (0x8000000U) -#define SPC_ACTIVE_CFG_CORE_HVDE_SHIFT (27U) -/*! CORE_HVDE - Core High-Voltage Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_ACTIVE_CFG_CORE_HVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_CORE_HVDE_SHIFT)) & SPC_ACTIVE_CFG_CORE_HVDE_MASK) - -#define SPC_ACTIVE_CFG_SYS_HVDE_MASK (0x10000000U) -#define SPC_ACTIVE_CFG_SYS_HVDE_SHIFT (28U) -/*! SYS_HVDE - System High-Voltage Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_ACTIVE_CFG_SYS_HVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_SYS_HVDE_SHIFT)) & SPC_ACTIVE_CFG_SYS_HVDE_MASK) - -#define SPC_ACTIVE_CFG_IO_HVDE_MASK (0x20000000U) -#define SPC_ACTIVE_CFG_IO_HVDE_SHIFT (29U) -/*! IO_HVDE - IO High-Voltage Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_ACTIVE_CFG_IO_HVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_IO_HVDE_SHIFT)) & SPC_ACTIVE_CFG_IO_HVDE_MASK) -/*! @} */ - -/*! @name ACTIVE_CFG1 - Active Power Mode Configuration 1 */ -/*! @{ */ - -#define SPC_ACTIVE_CFG1_SOC_CNTRL_MASK (0xFFFFFFFFU) -#define SPC_ACTIVE_CFG1_SOC_CNTRL_SHIFT (0U) -/*! SOC_CNTRL - Active Config Chip Control */ -#define SPC_ACTIVE_CFG1_SOC_CNTRL(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG1_SOC_CNTRL_SHIFT)) & SPC_ACTIVE_CFG1_SOC_CNTRL_MASK) -/*! @} */ - -/*! @name LP_CFG - Low-Power Mode Configuration */ -/*! @{ */ - -#define SPC_LP_CFG_CORELDO_VDD_DS_MASK (0x1U) -#define SPC_LP_CFG_CORELDO_VDD_DS_SHIFT (0U) -/*! CORELDO_VDD_DS - LDO_CORE VDD Drive Strength - * 0b0..Low - * 0b1..Normal - */ -#define SPC_LP_CFG_CORELDO_VDD_DS(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_CORELDO_VDD_DS_SHIFT)) & SPC_LP_CFG_CORELDO_VDD_DS_MASK) - -#define SPC_LP_CFG_CORELDO_VDD_LVL_MASK (0xCU) -#define SPC_LP_CFG_CORELDO_VDD_LVL_SHIFT (2U) -/*! CORELDO_VDD_LVL - LDO_CORE VDD Regulator Voltage Level - * 0b00..Retention voltage - * 0b01..Mid voltage (1.0 V) - * 0b10..Normal voltage (1.1 V) - * 0b11..Overdrive voltage (1.2 V) - */ -#define SPC_LP_CFG_CORELDO_VDD_LVL(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_CORELDO_VDD_LVL_SHIFT)) & SPC_LP_CFG_CORELDO_VDD_LVL_MASK) - -#define SPC_LP_CFG_SYSLDO_VDD_DS_MASK (0x10U) -#define SPC_LP_CFG_SYSLDO_VDD_DS_SHIFT (4U) -/*! SYSLDO_VDD_DS - LDO_SYS VDD Drive Strength - * 0b0..Low - * 0b1..Normal - */ -#define SPC_LP_CFG_SYSLDO_VDD_DS(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_SYSLDO_VDD_DS_SHIFT)) & SPC_LP_CFG_SYSLDO_VDD_DS_MASK) - -#define SPC_LP_CFG_DCDC_VDD_DS_MASK (0x300U) -#define SPC_LP_CFG_DCDC_VDD_DS_SHIFT (8U) -/*! DCDC_VDD_DS - DCDC VDD Drive Strength - * 0b00..Pulse refresh - * 0b01..Low - * 0b10..Normal - * 0b11.. - */ -#define SPC_LP_CFG_DCDC_VDD_DS(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_DCDC_VDD_DS_SHIFT)) & SPC_LP_CFG_DCDC_VDD_DS_MASK) - -#define SPC_LP_CFG_DCDC_VDD_LVL_MASK (0xC00U) -#define SPC_LP_CFG_DCDC_VDD_LVL_SHIFT (10U) -/*! DCDC_VDD_LVL - DCDC VDD Regulator Voltage Level - * 0b00..Retention voltage (0.7 V) - * 0b01..Mid voltage (1.0 V) - * 0b10..Normal voltage (1.1 V) - * 0b11..Overdrive voltage (1.2 V) - */ -#define SPC_LP_CFG_DCDC_VDD_LVL(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_DCDC_VDD_LVL_SHIFT)) & SPC_LP_CFG_DCDC_VDD_LVL_MASK) - -#define SPC_LP_CFG_GLITCH_DETECT_DISABLE_MASK (0x1000U) -#define SPC_LP_CFG_GLITCH_DETECT_DISABLE_SHIFT (12U) -/*! GLITCH_DETECT_DISABLE - Glitch Detect Disable - * 0b0..Enable - * 0b1..Disable - */ -#define SPC_LP_CFG_GLITCH_DETECT_DISABLE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_GLITCH_DETECT_DISABLE_SHIFT)) & SPC_LP_CFG_GLITCH_DETECT_DISABLE_MASK) - -#define SPC_LP_CFG_COREVDD_IVS_EN_MASK (0x20000U) -#define SPC_LP_CFG_COREVDD_IVS_EN_SHIFT (17U) -/*! COREVDD_IVS_EN - CORE VDD Internal Voltage Scaling (IVS) Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LP_CFG_COREVDD_IVS_EN(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_COREVDD_IVS_EN_SHIFT)) & SPC_LP_CFG_COREVDD_IVS_EN_MASK) - -#define SPC_LP_CFG_LPBUFF_EN_MASK (0x40000U) -#define SPC_LP_CFG_LPBUFF_EN_SHIFT (18U) -/*! LPBUFF_EN - CMP Bandgap Buffer Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LP_CFG_LPBUFF_EN(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_LPBUFF_EN_SHIFT)) & SPC_LP_CFG_LPBUFF_EN_MASK) - -#define SPC_LP_CFG_BGMODE_MASK (0x300000U) -#define SPC_LP_CFG_BGMODE_SHIFT (20U) -/*! BGMODE - Bandgap Mode - * 0b00..Bandgap disabled - * 0b01..Bandgap enabled, buffer disabled - * 0b10..Bandgap enabled, buffer enabled - * 0b11.. - */ -#define SPC_LP_CFG_BGMODE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_BGMODE_SHIFT)) & SPC_LP_CFG_BGMODE_MASK) - -#define SPC_LP_CFG_LP_IREFEN_MASK (0x800000U) -#define SPC_LP_CFG_LP_IREFEN_SHIFT (23U) -/*! LP_IREFEN - Low-Power IREF Enable - * 0b0..Disable for power saving in Deep Power Down mode - * 0b1..Enable - */ -#define SPC_LP_CFG_LP_IREFEN(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_LP_IREFEN_SHIFT)) & SPC_LP_CFG_LP_IREFEN_MASK) - -#define SPC_LP_CFG_CORE_LVDE_MASK (0x1000000U) -#define SPC_LP_CFG_CORE_LVDE_SHIFT (24U) -/*! CORE_LVDE - Core Low Voltage Detect Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LP_CFG_CORE_LVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_CORE_LVDE_SHIFT)) & SPC_LP_CFG_CORE_LVDE_MASK) - -#define SPC_LP_CFG_SYS_LVDE_MASK (0x2000000U) -#define SPC_LP_CFG_SYS_LVDE_SHIFT (25U) -/*! SYS_LVDE - System Low Voltage Detect Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LP_CFG_SYS_LVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_SYS_LVDE_SHIFT)) & SPC_LP_CFG_SYS_LVDE_MASK) - -#define SPC_LP_CFG_IO_LVDE_MASK (0x4000000U) -#define SPC_LP_CFG_IO_LVDE_SHIFT (26U) -/*! IO_LVDE - IO Low Voltage Detect Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LP_CFG_IO_LVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_IO_LVDE_SHIFT)) & SPC_LP_CFG_IO_LVDE_MASK) - -#define SPC_LP_CFG_CORE_HVDE_MASK (0x8000000U) -#define SPC_LP_CFG_CORE_HVDE_SHIFT (27U) -/*! CORE_HVDE - Core High Voltage Detect Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LP_CFG_CORE_HVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_CORE_HVDE_SHIFT)) & SPC_LP_CFG_CORE_HVDE_MASK) - -#define SPC_LP_CFG_SYS_HVDE_MASK (0x10000000U) -#define SPC_LP_CFG_SYS_HVDE_SHIFT (28U) -/*! SYS_HVDE - System High Voltage Detect Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LP_CFG_SYS_HVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_SYS_HVDE_SHIFT)) & SPC_LP_CFG_SYS_HVDE_MASK) - -#define SPC_LP_CFG_IO_HVDE_MASK (0x20000000U) -#define SPC_LP_CFG_IO_HVDE_SHIFT (29U) -/*! IO_HVDE - IO High Voltage Detect Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LP_CFG_IO_HVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_IO_HVDE_SHIFT)) & SPC_LP_CFG_IO_HVDE_MASK) -/*! @} */ - -/*! @name LP_CFG1 - Low Power Mode Configuration 1 */ -/*! @{ */ - -#define SPC_LP_CFG1_SOC_CNTRL_MASK (0xFFFFFFFFU) -#define SPC_LP_CFG1_SOC_CNTRL_SHIFT (0U) -/*! SOC_CNTRL - Low-Power Configuration Chip Control */ -#define SPC_LP_CFG1_SOC_CNTRL(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG1_SOC_CNTRL_SHIFT)) & SPC_LP_CFG1_SOC_CNTRL_MASK) -/*! @} */ - -/*! @name LPWKUP_DELAY - Low Power Wake-Up Delay */ -/*! @{ */ - -#define SPC_LPWKUP_DELAY_LPWKUP_DELAY_MASK (0xFFFFU) -#define SPC_LPWKUP_DELAY_LPWKUP_DELAY_SHIFT (0U) -/*! LPWKUP_DELAY - Low-Power Wake-Up Delay */ -#define SPC_LPWKUP_DELAY_LPWKUP_DELAY(x) (((uint32_t)(((uint32_t)(x)) << SPC_LPWKUP_DELAY_LPWKUP_DELAY_SHIFT)) & SPC_LPWKUP_DELAY_LPWKUP_DELAY_MASK) -/*! @} */ - -/*! @name ACTIVE_VDELAY - Active Voltage Trim Delay */ -/*! @{ */ - -#define SPC_ACTIVE_VDELAY_ACTIVE_VDELAY_MASK (0xFFFFU) -#define SPC_ACTIVE_VDELAY_ACTIVE_VDELAY_SHIFT (0U) -/*! ACTIVE_VDELAY - Active Voltage Delay */ -#define SPC_ACTIVE_VDELAY_ACTIVE_VDELAY(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_VDELAY_ACTIVE_VDELAY_SHIFT)) & SPC_ACTIVE_VDELAY_ACTIVE_VDELAY_MASK) -/*! @} */ - -/*! @name VD_STAT - Voltage Detect Status */ -/*! @{ */ - -#define SPC_VD_STAT_COREVDD_LVDF_MASK (0x1U) -#define SPC_VD_STAT_COREVDD_LVDF_SHIFT (0U) -/*! COREVDD_LVDF - Core Low-Voltage Detect Flag - * 0b0..Event not detected - * 0b1..Event detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_VD_STAT_COREVDD_LVDF(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_STAT_COREVDD_LVDF_SHIFT)) & SPC_VD_STAT_COREVDD_LVDF_MASK) - -#define SPC_VD_STAT_SYSVDD_LVDF_MASK (0x2U) -#define SPC_VD_STAT_SYSVDD_LVDF_SHIFT (1U) -/*! SYSVDD_LVDF - System Low-Voltage Detect Flag - * 0b0..Event not detected - * 0b1..Event detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_VD_STAT_SYSVDD_LVDF(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_STAT_SYSVDD_LVDF_SHIFT)) & SPC_VD_STAT_SYSVDD_LVDF_MASK) - -#define SPC_VD_STAT_IOVDD_LVDF_MASK (0x4U) -#define SPC_VD_STAT_IOVDD_LVDF_SHIFT (2U) -/*! IOVDD_LVDF - IO VDD LVD Flag - * 0b0..Event not detected - * 0b1..Event detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_VD_STAT_IOVDD_LVDF(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_STAT_IOVDD_LVDF_SHIFT)) & SPC_VD_STAT_IOVDD_LVDF_MASK) - -#define SPC_VD_STAT_COREVDD_HVDF_MASK (0x10U) -#define SPC_VD_STAT_COREVDD_HVDF_SHIFT (4U) -/*! COREVDD_HVDF - Core VDD HVD Flag - * 0b0..Event not detected - * 0b1..Event detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_VD_STAT_COREVDD_HVDF(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_STAT_COREVDD_HVDF_SHIFT)) & SPC_VD_STAT_COREVDD_HVDF_MASK) - -#define SPC_VD_STAT_SYSVDD_HVDF_MASK (0x20U) -#define SPC_VD_STAT_SYSVDD_HVDF_SHIFT (5U) -/*! SYSVDD_HVDF - System HVD Flag - * 0b0..Event not detected - * 0b1..Event detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_VD_STAT_SYSVDD_HVDF(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_STAT_SYSVDD_HVDF_SHIFT)) & SPC_VD_STAT_SYSVDD_HVDF_MASK) - -#define SPC_VD_STAT_IOVDD_HVDF_MASK (0x40U) -#define SPC_VD_STAT_IOVDD_HVDF_SHIFT (6U) -/*! IOVDD_HVDF - IO VDD HVD Flag - * 0b0..Event not detected - * 0b1..Event detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_VD_STAT_IOVDD_HVDF(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_STAT_IOVDD_HVDF_SHIFT)) & SPC_VD_STAT_IOVDD_HVDF_MASK) -/*! @} */ - -/*! @name VD_CORE_CFG - Core Voltage Detect Configuration */ -/*! @{ */ - -#define SPC_VD_CORE_CFG_LVDRE_MASK (0x1U) -#define SPC_VD_CORE_CFG_LVDRE_SHIFT (0U) -/*! LVDRE - Core LVD Reset Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_CORE_CFG_LVDRE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_CORE_CFG_LVDRE_SHIFT)) & SPC_VD_CORE_CFG_LVDRE_MASK) - -#define SPC_VD_CORE_CFG_LVDIE_MASK (0x2U) -#define SPC_VD_CORE_CFG_LVDIE_SHIFT (1U) -/*! LVDIE - Core LVD Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_CORE_CFG_LVDIE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_CORE_CFG_LVDIE_SHIFT)) & SPC_VD_CORE_CFG_LVDIE_MASK) - -#define SPC_VD_CORE_CFG_HVDRE_MASK (0x4U) -#define SPC_VD_CORE_CFG_HVDRE_SHIFT (2U) -/*! HVDRE - Core VDD HVD Reset Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_CORE_CFG_HVDRE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_CORE_CFG_HVDRE_SHIFT)) & SPC_VD_CORE_CFG_HVDRE_MASK) - -#define SPC_VD_CORE_CFG_HVDIE_MASK (0x8U) -#define SPC_VD_CORE_CFG_HVDIE_SHIFT (3U) -/*! HVDIE - Core VDD HVD Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_CORE_CFG_HVDIE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_CORE_CFG_HVDIE_SHIFT)) & SPC_VD_CORE_CFG_HVDIE_MASK) - -#define SPC_VD_CORE_CFG_LOCK_MASK (0x10000U) -#define SPC_VD_CORE_CFG_LOCK_SHIFT (16U) -/*! LOCK - Core Voltage Detect Reset Enable Lock - * 0b0..Allow - * 0b1..Deny - */ -#define SPC_VD_CORE_CFG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_CORE_CFG_LOCK_SHIFT)) & SPC_VD_CORE_CFG_LOCK_MASK) -/*! @} */ - -/*! @name VD_SYS_CFG - System Voltage Detect Configuration */ -/*! @{ */ - -#define SPC_VD_SYS_CFG_LVDRE_MASK (0x1U) -#define SPC_VD_SYS_CFG_LVDRE_SHIFT (0U) -/*! LVDRE - System LVD Reset Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_SYS_CFG_LVDRE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_SYS_CFG_LVDRE_SHIFT)) & SPC_VD_SYS_CFG_LVDRE_MASK) - -#define SPC_VD_SYS_CFG_LVDIE_MASK (0x2U) -#define SPC_VD_SYS_CFG_LVDIE_SHIFT (1U) -/*! LVDIE - System LVD Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_SYS_CFG_LVDIE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_SYS_CFG_LVDIE_SHIFT)) & SPC_VD_SYS_CFG_LVDIE_MASK) - -#define SPC_VD_SYS_CFG_HVDRE_MASK (0x4U) -#define SPC_VD_SYS_CFG_HVDRE_SHIFT (2U) -/*! HVDRE - System HVD Reset Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_SYS_CFG_HVDRE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_SYS_CFG_HVDRE_SHIFT)) & SPC_VD_SYS_CFG_HVDRE_MASK) - -#define SPC_VD_SYS_CFG_HVDIE_MASK (0x8U) -#define SPC_VD_SYS_CFG_HVDIE_SHIFT (3U) -/*! HVDIE - System HVD Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_SYS_CFG_HVDIE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_SYS_CFG_HVDIE_SHIFT)) & SPC_VD_SYS_CFG_HVDIE_MASK) - -#define SPC_VD_SYS_CFG_LOCK_MASK (0x10000U) -#define SPC_VD_SYS_CFG_LOCK_SHIFT (16U) -/*! LOCK - System Voltage Detect Reset Enable Lock - * 0b0..Allow - * 0b1..Deny - */ -#define SPC_VD_SYS_CFG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_SYS_CFG_LOCK_SHIFT)) & SPC_VD_SYS_CFG_LOCK_MASK) -/*! @} */ - -/*! @name VD_IO_CFG - IO Voltage Detect Configuration */ -/*! @{ */ - -#define SPC_VD_IO_CFG_LVDRE_MASK (0x1U) -#define SPC_VD_IO_CFG_LVDRE_SHIFT (0U) -/*! LVDRE - IO VDD LVD Reset Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_IO_CFG_LVDRE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_IO_CFG_LVDRE_SHIFT)) & SPC_VD_IO_CFG_LVDRE_MASK) - -#define SPC_VD_IO_CFG_LVDIE_MASK (0x2U) -#define SPC_VD_IO_CFG_LVDIE_SHIFT (1U) -/*! LVDIE - IO VDD LVD Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_IO_CFG_LVDIE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_IO_CFG_LVDIE_SHIFT)) & SPC_VD_IO_CFG_LVDIE_MASK) - -#define SPC_VD_IO_CFG_HVDRE_MASK (0x4U) -#define SPC_VD_IO_CFG_HVDRE_SHIFT (2U) -/*! HVDRE - IO VDD HVD Reset Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_IO_CFG_HVDRE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_IO_CFG_HVDRE_SHIFT)) & SPC_VD_IO_CFG_HVDRE_MASK) - -#define SPC_VD_IO_CFG_HVDIE_MASK (0x8U) -#define SPC_VD_IO_CFG_HVDIE_SHIFT (3U) -/*! HVDIE - IO VDD HVD Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_IO_CFG_HVDIE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_IO_CFG_HVDIE_SHIFT)) & SPC_VD_IO_CFG_HVDIE_MASK) - -#define SPC_VD_IO_CFG_LVSEL_MASK (0x100U) -#define SPC_VD_IO_CFG_LVSEL_SHIFT (8U) -/*! LVSEL - IO VDD Low-Voltage Level Select - * 0b0..High range - * 0b1..Low range - */ -#define SPC_VD_IO_CFG_LVSEL(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_IO_CFG_LVSEL_SHIFT)) & SPC_VD_IO_CFG_LVSEL_MASK) - -#define SPC_VD_IO_CFG_LOCK_MASK (0x10000U) -#define SPC_VD_IO_CFG_LOCK_SHIFT (16U) -/*! LOCK - IO Voltage Detect Reset Enable Lock - * 0b0..Allow - * 0b1..Deny - */ -#define SPC_VD_IO_CFG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_IO_CFG_LOCK_SHIFT)) & SPC_VD_IO_CFG_LOCK_MASK) -/*! @} */ - -/*! @name EVD_CFG - External Voltage Domain Configuration */ -/*! @{ */ - -#define SPC_EVD_CFG_EVDISO_MASK (0x3FU) -#define SPC_EVD_CFG_EVDISO_SHIFT (0U) -/*! EVDISO - External Voltage Domain Isolation */ -#define SPC_EVD_CFG_EVDISO(x) (((uint32_t)(((uint32_t)(x)) << SPC_EVD_CFG_EVDISO_SHIFT)) & SPC_EVD_CFG_EVDISO_MASK) - -#define SPC_EVD_CFG_EVDLPISO_MASK (0x3F00U) -#define SPC_EVD_CFG_EVDLPISO_SHIFT (8U) -/*! EVDLPISO - External Voltage Domain Low-Power Isolation */ -#define SPC_EVD_CFG_EVDLPISO(x) (((uint32_t)(((uint32_t)(x)) << SPC_EVD_CFG_EVDLPISO_SHIFT)) & SPC_EVD_CFG_EVDLPISO_MASK) - -#define SPC_EVD_CFG_EVDSTAT_MASK (0x3F0000U) -#define SPC_EVD_CFG_EVDSTAT_SHIFT (16U) -/*! EVDSTAT - External Voltage Domain Status */ -#define SPC_EVD_CFG_EVDSTAT(x) (((uint32_t)(((uint32_t)(x)) << SPC_EVD_CFG_EVDSTAT_SHIFT)) & SPC_EVD_CFG_EVDSTAT_MASK) -/*! @} */ - -/*! @name GLITCH_DETECT_SC - Glitch Detect Status Control */ -/*! @{ */ - -#define SPC_GLITCH_DETECT_SC_CNT_SELECT_MASK (0x3U) -#define SPC_GLITCH_DETECT_SC_CNT_SELECT_SHIFT (0U) -/*! CNT_SELECT - Counter Select - * 0b00..0 - * 0b01..1 - * 0b10..2 - * 0b11..3 - */ -#define SPC_GLITCH_DETECT_SC_CNT_SELECT(x) (((uint32_t)(((uint32_t)(x)) << SPC_GLITCH_DETECT_SC_CNT_SELECT_SHIFT)) & SPC_GLITCH_DETECT_SC_CNT_SELECT_MASK) - -#define SPC_GLITCH_DETECT_SC_TIMEOUT_MASK (0x3CU) -#define SPC_GLITCH_DETECT_SC_TIMEOUT_SHIFT (2U) -/*! TIMEOUT - Timeout */ -#define SPC_GLITCH_DETECT_SC_TIMEOUT(x) (((uint32_t)(((uint32_t)(x)) << SPC_GLITCH_DETECT_SC_TIMEOUT_SHIFT)) & SPC_GLITCH_DETECT_SC_TIMEOUT_MASK) - -#define SPC_GLITCH_DETECT_SC_RE_MASK (0x40U) -#define SPC_GLITCH_DETECT_SC_RE_SHIFT (6U) -/*! RE - Glitch Detect Reset Enable - * 0b0..GLITCH_DETECT_FLAG[CNT_SELECT] does not generate POR/LVD reset - * 0b1..GLITCH_DETECT_FLAG[CNT_SELECT] does generate POR/LVD reset - */ -#define SPC_GLITCH_DETECT_SC_RE(x) (((uint32_t)(((uint32_t)(x)) << SPC_GLITCH_DETECT_SC_RE_SHIFT)) & SPC_GLITCH_DETECT_SC_RE_MASK) - -#define SPC_GLITCH_DETECT_SC_IE_MASK (0x80U) -#define SPC_GLITCH_DETECT_SC_IE_SHIFT (7U) -/*! IE - Glitch Detect Interrupt Enable - * 0b0..GLITCH_DETECT_FLAG[CNT_SELECT] does not generate hardware interrupt (user polling) - * 0b1..GLITCH_DETECT_FLAG[CNT_SELECT] does generate hardware interrupt - */ -#define SPC_GLITCH_DETECT_SC_IE(x) (((uint32_t)(((uint32_t)(x)) << SPC_GLITCH_DETECT_SC_IE_SHIFT)) & SPC_GLITCH_DETECT_SC_IE_MASK) - -#define SPC_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG_MASK (0xF00U) -#define SPC_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG_SHIFT (8U) -/*! GLITCH_DETECT_FLAG - GLITCH_DETECT_FLAG */ -#define SPC_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG(x) (((uint32_t)(((uint32_t)(x)) << SPC_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG_SHIFT)) & SPC_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG_MASK) - -#define SPC_GLITCH_DETECT_SC_LOCK_MASK (0x10000U) -#define SPC_GLITCH_DETECT_SC_LOCK_SHIFT (16U) -/*! LOCK - Glitch Detect Reset Enable Lock Bit - * 0b0..Writes to RE are allowed. - * 0b1..Writes to RE are ignored. - */ -#define SPC_GLITCH_DETECT_SC_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SPC_GLITCH_DETECT_SC_LOCK_SHIFT)) & SPC_GLITCH_DETECT_SC_LOCK_MASK) -/*! @} */ - -/*! @name CORELDO_CFG - LDO_CORE Configuration */ -/*! @{ */ - -#define SPC_CORELDO_CFG_DPDOWN_PULLDOWN_DISABLE_MASK (0x10000U) -#define SPC_CORELDO_CFG_DPDOWN_PULLDOWN_DISABLE_SHIFT (16U) -/*! DPDOWN_PULLDOWN_DISABLE - LDO_CORE Deep Power Down Pulldown Disable - * 0b0..LDO_CORE pulldown in Deep Power Down not disabled - * 0b1..LDO_CORE pulldown in Deep Power Down disabled - */ -#define SPC_CORELDO_CFG_DPDOWN_PULLDOWN_DISABLE(x) (((uint32_t)(((uint32_t)(x)) << SPC_CORELDO_CFG_DPDOWN_PULLDOWN_DISABLE_SHIFT)) & SPC_CORELDO_CFG_DPDOWN_PULLDOWN_DISABLE_MASK) -/*! @} */ - -/*! @name SYSLDO_CFG - LDO_SYS Configuration */ -/*! @{ */ - -#define SPC_SYSLDO_CFG_ISINKEN_MASK (0x1U) -#define SPC_SYSLDO_CFG_ISINKEN_SHIFT (0U) -/*! ISINKEN - Current Sink Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_SYSLDO_CFG_ISINKEN(x) (((uint32_t)(((uint32_t)(x)) << SPC_SYSLDO_CFG_ISINKEN_SHIFT)) & SPC_SYSLDO_CFG_ISINKEN_MASK) -/*! @} */ - -/*! @name DCDC_CFG - DCDC Configuration */ -/*! @{ */ - -#define SPC_DCDC_CFG_FREQ_CNTRL_ON_MASK (0x1U) -#define SPC_DCDC_CFG_FREQ_CNTRL_ON_SHIFT (0U) -/*! FREQ_CNTRL_ON - DCDC Burst Frequency Control Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_DCDC_CFG_FREQ_CNTRL_ON(x) (((uint32_t)(((uint32_t)(x)) << SPC_DCDC_CFG_FREQ_CNTRL_ON_SHIFT)) & SPC_DCDC_CFG_FREQ_CNTRL_ON_MASK) - -#define SPC_DCDC_CFG_FREQ_CNTRL_MASK (0x3F00U) -#define SPC_DCDC_CFG_FREQ_CNTRL_SHIFT (8U) -/*! FREQ_CNTRL - DCDC Burst Frequency Control */ -#define SPC_DCDC_CFG_FREQ_CNTRL(x) (((uint32_t)(((uint32_t)(x)) << SPC_DCDC_CFG_FREQ_CNTRL_SHIFT)) & SPC_DCDC_CFG_FREQ_CNTRL_MASK) - -#define SPC_DCDC_CFG_BLEED_EN_MASK (0x80000U) -#define SPC_DCDC_CFG_BLEED_EN_SHIFT (19U) -/*! BLEED_EN - DCDC Bleed Enable - * 0b0..Do not add - * 0b1..Add - */ -#define SPC_DCDC_CFG_BLEED_EN(x) (((uint32_t)(((uint32_t)(x)) << SPC_DCDC_CFG_BLEED_EN_SHIFT)) & SPC_DCDC_CFG_BLEED_EN_MASK) -/*! @} */ - -/*! @name DCDC_BURST_CFG - DCDC Burst Configuration */ -/*! @{ */ - -#define SPC_DCDC_BURST_CFG_BURST_REQ_MASK (0x1U) -#define SPC_DCDC_BURST_CFG_BURST_REQ_SHIFT (0U) -/*! BURST_REQ - Software Burst Request - * 0b0..Do not generate - * 0b1..Generate - */ -#define SPC_DCDC_BURST_CFG_BURST_REQ(x) (((uint32_t)(((uint32_t)(x)) << SPC_DCDC_BURST_CFG_BURST_REQ_SHIFT)) & SPC_DCDC_BURST_CFG_BURST_REQ_MASK) - -#define SPC_DCDC_BURST_CFG_EXT_BURST_EN_MASK (0x2U) -#define SPC_DCDC_BURST_CFG_EXT_BURST_EN_SHIFT (1U) -/*! EXT_BURST_EN - External Burst Request Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_DCDC_BURST_CFG_EXT_BURST_EN(x) (((uint32_t)(((uint32_t)(x)) << SPC_DCDC_BURST_CFG_EXT_BURST_EN_SHIFT)) & SPC_DCDC_BURST_CFG_EXT_BURST_EN_MASK) - -#define SPC_DCDC_BURST_CFG_BURST_ACK_MASK (0x8U) -#define SPC_DCDC_BURST_CFG_BURST_ACK_SHIFT (3U) -/*! BURST_ACK - Burst Acknowledge Flag - * 0b0..Did not complete - * 0b1..Completed - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_DCDC_BURST_CFG_BURST_ACK(x) (((uint32_t)(((uint32_t)(x)) << SPC_DCDC_BURST_CFG_BURST_ACK_SHIFT)) & SPC_DCDC_BURST_CFG_BURST_ACK_MASK) - -#define SPC_DCDC_BURST_CFG_PULSE_REFRESH_CNT_MASK (0xFFFF0000U) -#define SPC_DCDC_BURST_CFG_PULSE_REFRESH_CNT_SHIFT (16U) -/*! PULSE_REFRESH_CNT - Refresh Count Value */ -#define SPC_DCDC_BURST_CFG_PULSE_REFRESH_CNT(x) (((uint32_t)(((uint32_t)(x)) << SPC_DCDC_BURST_CFG_PULSE_REFRESH_CNT_SHIFT)) & SPC_DCDC_BURST_CFG_PULSE_REFRESH_CNT_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group SPC_Register_Masks */ - - -/* SPC - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral SPC0 base address */ - #define SPC0_BASE (0x50045000u) - /** Peripheral SPC0 base address */ - #define SPC0_BASE_NS (0x40045000u) - /** Peripheral SPC0 base pointer */ - #define SPC0 ((SPC_Type *)SPC0_BASE) - /** Peripheral SPC0 base pointer */ - #define SPC0_NS ((SPC_Type *)SPC0_BASE_NS) - /** Array initializer of SPC peripheral base addresses */ - #define SPC_BASE_ADDRS { SPC0_BASE } - /** Array initializer of SPC peripheral base pointers */ - #define SPC_BASE_PTRS { SPC0 } - /** Array initializer of SPC peripheral base addresses */ - #define SPC_BASE_ADDRS_NS { SPC0_BASE_NS } - /** Array initializer of SPC peripheral base pointers */ - #define SPC_BASE_PTRS_NS { SPC0_NS } -#else - /** Peripheral SPC0 base address */ - #define SPC0_BASE (0x40045000u) - /** Peripheral SPC0 base pointer */ - #define SPC0 ((SPC_Type *)SPC0_BASE) - /** Array initializer of SPC peripheral base addresses */ - #define SPC_BASE_ADDRS { SPC0_BASE } - /** Array initializer of SPC peripheral base pointers */ - #define SPC_BASE_PTRS { SPC0 } -#endif - -/*! - * @} - */ /* end of group SPC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- SYSCON Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SYSCON_Peripheral_Access_Layer SYSCON Peripheral Access Layer - * @{ - */ - -/** SYSCON - Register Layout Typedef */ -typedef struct { - uint8_t RESERVED_0[16]; - __IO uint32_t AHBMATPRIO; /**< AHB Matrix Priority Control, offset: 0x10 */ - uint8_t RESERVED_1[36]; - __IO uint32_t CPU0STCKCAL; /**< Secure CPU0 System Tick Calibration, offset: 0x38 */ - __IO uint32_t CPU0NSTCKCAL; /**< Non-Secure CPU0 System Tick Calibration, offset: 0x3C */ - __IO uint32_t CPU1STCKCAL; /**< System tick calibration for CPU1, offset: 0x40 */ - uint8_t RESERVED_2[4]; - __IO uint32_t NMISRC; /**< NMI Source Select, offset: 0x48 */ - uint8_t RESERVED_3[180]; - __IO uint32_t PRESETCTRL0; /**< Peripheral Reset Control 0, offset: 0x100 */ - __IO uint32_t PRESETCTRL1; /**< Peripheral Reset Control 1, offset: 0x104 */ - __IO uint32_t PRESETCTRL2; /**< Peripheral Reset Control 2, offset: 0x108 */ - __IO uint32_t PRESETCTRL3; /**< Peripheral Reset Control 3, offset: 0x10C */ - uint8_t RESERVED_4[16]; - __O uint32_t PRESETCTRLSET[4]; /**< Peripheral Reset Control Set, array offset: 0x120, array step: 0x4 */ - uint8_t RESERVED_5[16]; - __O uint32_t PRESETCTRLCLR[4]; /**< Peripheral Reset Control Clear, array offset: 0x140, array step: 0x4 */ - uint8_t RESERVED_6[176]; - __IO uint32_t AHBCLKCTRL0; /**< AHB Clock Control 0, offset: 0x200 */ - __IO uint32_t AHBCLKCTRL1; /**< AHB Clock Control 1, offset: 0x204 */ - __IO uint32_t AHBCLKCTRL2; /**< AHB Clock Control 2, offset: 0x208 */ - __IO uint32_t AHBCLKCTRL3; /**< AHB Clock Control 3, offset: 0x20C */ - uint8_t RESERVED_7[16]; - __O uint32_t AHBCLKCTRLSET[4]; /**< AHB Clock Control Set, array offset: 0x220, array step: 0x4 */ - uint8_t RESERVED_8[16]; - __O uint32_t AHBCLKCTRLCLR[4]; /**< AHB Clock Control Clear, array offset: 0x240, array step: 0x4 */ - uint8_t RESERVED_9[16]; - __IO uint32_t SYSTICKCLKSEL0; /**< CPU0 System Tick Timer Source Select, offset: 0x260 */ - __IO uint32_t SYSTICKCLKSEL1; /**< CPU1 System Tick Timer Source Select, offset: 0x264 */ - __IO uint32_t TRACECLKSEL; /**< Trace Clock Source Select, offset: 0x268 */ - __IO uint32_t CTIMERCLKSEL[5]; /**< CTIMER Clock Source Select, array offset: 0x26C, array step: 0x4 */ - uint8_t RESERVED_10[8]; - __IO uint32_t CLKOUTSEL; /**< CLKOUT Clock Source Select, offset: 0x288 */ - uint8_t RESERVED_11[24]; - __IO uint32_t ADC0CLKSEL; /**< ADC0 Clock Source Select, offset: 0x2A4 */ - __IO uint32_t USB0CLKSEL; /**< USB-FS Clock Source Select, offset: 0x2A8 */ - uint8_t RESERVED_12[4]; - __IO uint32_t FCCLKSEL[10]; /**< LP_FLEXCOMM Clock Source Select for Fractional Rate Divider, array offset: 0x2B0, array step: 0x4 */ - uint8_t RESERVED_13[24]; - __IO uint32_t SCTCLKSEL; /**< SCTimer/PWM Clock Source Select, offset: 0x2F0 */ - uint8_t RESERVED_14[12]; - __IO uint32_t SYSTICKCLKDIV[2]; /**< CPU0 System Tick Timer Divider..CPU1 System Tick Timer Divider, array offset: 0x300, array step: 0x4 */ - __IO uint32_t TRACECLKDIV; /**< TRACE Clock Divider, offset: 0x308 */ - uint8_t RESERVED_15[68]; - __IO uint32_t TSICLKSEL; /**< TSI Function Clock Source Select, offset: 0x350 */ - uint8_t RESERVED_16[12]; - __IO uint32_t SINCFILTCLKSEL; /**< SINC FILTER Function Clock Source Select, offset: 0x360 */ - uint8_t RESERVED_17[20]; - __IO uint32_t SLOWCLKDIV; /**< SLOW_CLK Clock Divider, offset: 0x378 */ - __IO uint32_t TSICLKDIV; /**< TSI Function Clock Divider, offset: 0x37C */ - __IO uint32_t AHBCLKDIV; /**< System Clock Divider, offset: 0x380 */ - __IO uint32_t CLKOUTDIV; /**< CLKOUT Clock Divider, offset: 0x384 */ - __IO uint32_t FROHFDIV; /**< FRO_HF_DIV Clock Divider, offset: 0x388 */ - __IO uint32_t WDT0CLKDIV; /**< WDT0 Clock Divider, offset: 0x38C */ - uint8_t RESERVED_18[4]; - __IO uint32_t ADC0CLKDIV; /**< ADC0 Clock Divider, offset: 0x394 */ - __IO uint32_t USB0CLKDIV; /**< USB-FS Clock Divider, offset: 0x398 */ - uint8_t RESERVED_19[24]; - __IO uint32_t SCTCLKDIV; /**< SCT/PWM Clock Divider, offset: 0x3B4 */ - uint8_t RESERVED_20[12]; - __IO uint32_t PLLCLKDIV; /**< PLL Clock Divider, offset: 0x3C4 */ - uint8_t RESERVED_21[8]; - __IO uint32_t CTIMERCLKDIV[5]; /**< CTimer Clock Divider, array offset: 0x3D0, array step: 0x4 */ - __IO uint32_t PLL1CLK0DIV; /**< PLL1 Clock 0 Divider, offset: 0x3E4 */ - __IO uint32_t PLL1CLK1DIV; /**< PLL1 Clock 1 Divider, offset: 0x3E8 */ - uint8_t RESERVED_22[4]; - __IO uint32_t UTICKCLKDIV; /**< UTICK Clock Divider, offset: 0x3F0 */ - __IO uint32_t CLKOUT_FRGCTRL; /**< CLKOUT FRG Control, offset: 0x3F4 */ - uint8_t RESERVED_23[4]; - __IO uint32_t CLKUNLOCK; /**< Clock Configuration Unlock, offset: 0x3FC */ - __IO uint32_t NVM_CTRL; /**< NVM Control, offset: 0x400 */ - __IO uint32_t ROMCR; /**< ROM Wait State, offset: 0x404 */ - uint8_t RESERVED_24[12]; - __IO uint32_t SMARTDMAINT; /**< SmartDMA Interrupt Hijack, offset: 0x414 */ - uint8_t RESERVED_25[76]; - __IO uint32_t ADC1CLKSEL; /**< ADC1 Clock Source Select, offset: 0x464 */ - __IO uint32_t ADC1CLKDIV; /**< ADC1 Clock Divider, offset: 0x468 */ - uint8_t RESERVED_26[4]; - __IO uint32_t RAM_INTERLEAVE; /**< Control PKC RAM Interleave Access, offset: 0x470 */ - uint8_t RESERVED_27[28]; - struct { /* offset: 0x490, array step: 0x8 */ - __IO uint32_t CLKSEL; /**< DAC0 Functional Clock Selection..DAC2 Functional Clock Selection, array offset: 0x490, array step: 0x8 */ - __IO uint32_t CLKDIV; /**< DAC0 functional clock divider..DAC2 functional clock divider, array offset: 0x494, array step: 0x8 */ - } DAC[3]; - __IO uint32_t FLEXSPICLKSEL; /**< FlexSPI Clock Selection, offset: 0x4A8 */ - __IO uint32_t FLEXSPICLKDIV; /**< FlexSPI Clock Divider, offset: 0x4AC */ - uint8_t RESERVED_28[124]; - __IO uint32_t PLLCLKDIVSEL; /**< PLL Clock Divider Clock Selection, offset: 0x52C */ - __IO uint32_t I3C0FCLKSEL; /**< I3C0 Functional Clock Selection, offset: 0x530 */ - __IO uint32_t I3C0FCLKSTCSEL; /**< I3C0 FCLK_STC Clock Selection, offset: 0x534 */ - __IO uint32_t I3C0FCLKSTCDIV; /**< I3C0 FCLK_STC Clock Divider, offset: 0x538 */ - __IO uint32_t I3C0FCLKSDIV; /**< I3C0 FCLK Slow Clock Divider, offset: 0x53C */ - __IO uint32_t I3C0FCLKDIV; /**< I3C0 Functional Clock FCLK Divider, offset: 0x540 */ - __IO uint32_t I3C0FCLKSSEL; /**< I3C0 FCLK Slow Selection, offset: 0x544 */ - __IO uint32_t MICFILFCLKSEL; /**< MICFIL Clock Selection, offset: 0x548 */ - __IO uint32_t MICFILFCLKDIV; /**< MICFIL Clock Division, offset: 0x54C */ - uint8_t RESERVED_29[8]; - __IO uint32_t USDHCCLKSEL; /**< uSDHC Clock Selection, offset: 0x558 */ - __IO uint32_t USDHCCLKDIV; /**< uSDHC Function Clock Divider, offset: 0x55C */ - __IO uint32_t FLEXIOCLKSEL; /**< FLEXIO Clock Selection, offset: 0x560 */ - __IO uint32_t FLEXIOCLKDIV; /**< FLEXIO Function Clock Divider, offset: 0x564 */ - uint8_t RESERVED_30[56]; - __IO uint32_t FLEXCAN0CLKSEL; /**< FLEXCAN0 Clock Selection, offset: 0x5A0 */ - __IO uint32_t FLEXCAN0CLKDIV; /**< FLEXCAN0 Function Clock Divider, offset: 0x5A4 */ - __IO uint32_t FLEXCAN1CLKSEL; /**< FLEXCAN1 Clock Selection, offset: 0x5A8 */ - __IO uint32_t FLEXCAN1CLKDIV; /**< FLEXCAN1 Function Clock Divider, offset: 0x5AC */ - __IO uint32_t ENETRMIICLKSEL; /**< Ethernet RMII Clock Selection, offset: 0x5B0 */ - __IO uint32_t ENETRMIICLKDIV; /**< Ethernet RMII Function Clock Divider, offset: 0x5B4 */ - __IO uint32_t ENETPTPREFCLKSEL; /**< Ethernet PTP REF Clock Selection, offset: 0x5B8 */ - __IO uint32_t ENETPTPREFCLKDIV; /**< Ethernet PTP REF Function Clock Divider, offset: 0x5BC */ - __IO uint32_t ENET_PHY_INTF_SEL; /**< Ethernet PHY Interface Select, offset: 0x5C0 */ - __IO uint32_t ENET_SBD_FLOW_CTRL; /**< Sideband Flow Control, offset: 0x5C4 */ - uint8_t RESERVED_31[12]; - __IO uint32_t EWM0CLKSEL; /**< EWM0 Clock Selection, offset: 0x5D4 */ - __IO uint32_t WDT1CLKSEL; /**< WDT1 Clock Selection, offset: 0x5D8 */ - __IO uint32_t WDT1CLKDIV; /**< WDT1 Function Clock Divider, offset: 0x5DC */ - __IO uint32_t OSTIMERCLKSEL; /**< OSTIMER Clock Selection, offset: 0x5E0 */ - uint8_t RESERVED_32[12]; - __IO uint32_t CMP0FCLKSEL; /**< CMP0 Function Clock Selection, offset: 0x5F0 */ - __IO uint32_t CMP0FCLKDIV; /**< CMP0 Function Clock Divider, offset: 0x5F4 */ - __IO uint32_t CMP0RRCLKSEL; /**< CMP0 Round Robin Clock Selection, offset: 0x5F8 */ - __IO uint32_t CMP0RRCLKDIV; /**< CMP0 Round Robin Clock Divider, offset: 0x5FC */ - __IO uint32_t CMP1FCLKSEL; /**< CMP1 Function Clock Selection, offset: 0x600 */ - __IO uint32_t CMP1FCLKDIV; /**< CMP1 Function Clock Divider, offset: 0x604 */ - __IO uint32_t CMP1RRCLKSEL; /**< CMP1 Round Robin Clock Source Select, offset: 0x608 */ - __IO uint32_t CMP1RRCLKDIV; /**< CMP1 Round Robin Clock Division, offset: 0x60C */ - __IO uint32_t CMP2FCLKSEL; /**< CMP2 Function Clock Source Select, offset: 0x610 */ - __IO uint32_t CMP2FCLKDIV; /**< CMP2 Function Clock Division, offset: 0x614 */ - __IO uint32_t CMP2RRCLKSEL; /**< CMP2 Round Robin Clock Source Select, offset: 0x618 */ - __IO uint32_t CMP2RRCLKDIV; /**< CMP2 Round Robin Clock Division, offset: 0x61C */ - uint8_t RESERVED_33[480]; - __IO uint32_t CPUCTRL; /**< CPU Control for Multiple Processors, offset: 0x800 */ - __IO uint32_t CPBOOT; /**< Coprocessor Boot Address, offset: 0x804 */ - uint8_t RESERVED_34[4]; - __I uint32_t CPUSTAT; /**< CPU Status, offset: 0x80C */ - uint8_t RESERVED_35[20]; - __IO uint32_t LPCAC_CTRL; /**< LPCAC Control, offset: 0x824 */ - uint8_t RESERVED_36[40]; - __IO uint32_t FLEXCOMMCLKDIV[10]; /**< LP_FLEXCOMM Clock Divider, array offset: 0x850, array step: 0x4 */ - __IO uint32_t UTICKCLKSEL; /**< UTICK Function Clock Source Select, offset: 0x878 */ - uint8_t RESERVED_37[4]; - __IO uint32_t SAI0CLKSEL; /**< SAI0 Function Clock Source Select, offset: 0x880 */ - __IO uint32_t SAI1CLKSEL; /**< SAI1 Function Clock Source Select, offset: 0x884 */ - __IO uint32_t SAI0CLKDIV; /**< SAI0 Function Clock Division, offset: 0x888 */ - __IO uint32_t SAI1CLKDIV; /**< SAI1 Function Clock Division, offset: 0x88C */ - __IO uint32_t EMVSIM0CLKSEL; /**< EMVSIM0 Clock Source Select, offset: 0x890 */ - __IO uint32_t EMVSIM1CLKSEL; /**< EMVSIM1 Clock Source Select, offset: 0x894 */ - __IO uint32_t EMVSIM0CLKDIV; /**< EMVSIM0 Function Clock Division, offset: 0x898 */ - __IO uint32_t EMVSIM1CLKDIV; /**< EMVSIM1 Function Clock Division, offset: 0x89C */ - uint8_t RESERVED_38[176]; - __IO uint32_t KEY_RETAIN_CTRL; /**< Key Retain Control, offset: 0x950 */ - uint8_t RESERVED_39[12]; - __IO uint32_t REF_CLK_CTRL; /**< FRO 48MHz Reference Clock Control, offset: 0x960 */ - __O uint32_t REF_CLK_CTRL_SET; /**< FRO 48MHz Reference Clock Control Set, offset: 0x964 */ - __O uint32_t REF_CLK_CTRL_CLR; /**< FRO 48MHz Reference Clock Control Clear, offset: 0x968 */ - __IO uint32_t GDET_CTRL[2]; /**< GDET Control Register, array offset: 0x96C, array step: 0x4 */ - __IO uint32_t ELS_ASSET_PROT; /**< ELS Asset Protection Register, offset: 0x974 */ - __IO uint32_t ELS_LOCK_CTRL; /**< ELS Lock Control, offset: 0x978 */ - __IO uint32_t ELS_LOCK_CTRL_DP; /**< ELS Lock Control DP, offset: 0x97C */ - __I uint32_t ELS_OTP_LC_STATE; /**< Life Cycle State Register, offset: 0x980 */ - __I uint32_t ELS_OTP_LC_STATE_DP; /**< Life Cycle State Register (Duplicate), offset: 0x984 */ - __IO uint32_t ELS_TEMPORAL_STATE; /**< ELS Temporal State, offset: 0x988 */ - __IO uint32_t ELS_KDF_MASK; /**< Key Derivation Function Mask, offset: 0x98C */ - uint8_t RESERVED_40[64]; - __I uint32_t ELS_AS_CFG0; /**< ELS AS Configuration, offset: 0x9D0 */ - __I uint32_t ELS_AS_CFG1; /**< ELS AS Configuration1, offset: 0x9D4 */ - __I uint32_t ELS_AS_CFG2; /**< ELS AS Configuration2, offset: 0x9D8 */ - __I uint32_t ELS_AS_CFG3; /**< ELS AS Configuration3, offset: 0x9DC */ - __I uint32_t ELS_AS_ST0; /**< ELS AS State Register, offset: 0x9E0 */ - __I uint32_t ELS_AS_ST1; /**< ELS AS State1, offset: 0x9E4 */ - __I uint32_t ELS_AS_BOOT_LOG0; /**< Boot state captured during boot: Main ROM log, offset: 0x9E8 */ - __I uint32_t ELS_AS_BOOT_LOG1; /**< Boot state captured during boot: Library log, offset: 0x9EC */ - __I uint32_t ELS_AS_BOOT_LOG2; /**< Boot state captured during boot: Hardware status signals log, offset: 0x9F0 */ - __I uint32_t ELS_AS_BOOT_LOG3; /**< Boot state captured during boot: Security log, offset: 0x9F4 */ - __I uint32_t ELS_AS_FLAG0; /**< ELS AS Flag0, offset: 0x9F8 */ - __I uint32_t ELS_AS_FLAG1; /**< ELS AS Flag1, offset: 0x9FC */ - uint8_t RESERVED_41[24]; - __IO uint32_t CLOCK_CTRL; /**< Clock Control, offset: 0xA18 */ - uint8_t RESERVED_42[276]; - __IO uint32_t I3C1FCLKSEL; /**< I3C1 Functional Clock Selection, offset: 0xB30 */ - __IO uint32_t I3C1FCLKSTCSEL; /**< Selects the I3C1 Time Control clock, offset: 0xB34 */ - __IO uint32_t I3C1FCLKSTCDIV; /**< I3C1 FCLK_STC Clock Divider, offset: 0xB38 */ - __IO uint32_t I3C1FCLKSDIV; /**< I3C1 FCLK Slow clock Divider, offset: 0xB3C */ - __IO uint32_t I3C1FCLKDIV; /**< I3C1 Functional Clock FCLK Divider, offset: 0xB40 */ - __IO uint32_t I3C1FCLKSSEL; /**< I3C1 FCLK Slow Selection, offset: 0xB44 */ - uint8_t RESERVED_43[8]; - __IO uint32_t ETB_STATUS; /**< ETB Counter Status Register, offset: 0xB50 */ - __IO uint32_t ETB_COUNTER_CTRL; /**< ETB Counter Control Register, offset: 0xB54 */ - __IO uint32_t ETB_COUNTER_RELOAD; /**< ETB Counter Reload Register, offset: 0xB58 */ - __I uint32_t ETB_COUNTER_VALUE; /**< ETB Counter Value Register, offset: 0xB5C */ - __IO uint32_t GRAY_CODE_LSB; /**< Gray to Binary Converter Gray code_gray[31:0], offset: 0xB60 */ - __IO uint32_t GRAY_CODE_MSB; /**< Gray to Binary Converter Gray code_gray[41:32], offset: 0xB64 */ - __I uint32_t BINARY_CODE_LSB; /**< Gray to Binary Converter Binary Code [31:0], offset: 0xB68 */ - __I uint32_t BINARY_CODE_MSB; /**< Gray to Binary Converter Binary Code [41:32], offset: 0xB6C */ - uint8_t RESERVED_44[660]; - __IO uint32_t AUTOCLKGATEOVERRIDE; /**< Control Automatic Clock Gating, offset: 0xE04 */ - uint8_t RESERVED_45[36]; - __IO uint32_t AUTOCLKGATEOVERRIDEC; /**< Control Automatic Clock Gating C, offset: 0xE2C */ - uint8_t RESERVED_46[8]; - __IO uint32_t PWM0SUBCTL; /**< PWM0 Submodule Control, offset: 0xE38 */ - __IO uint32_t PWM1SUBCTL; /**< PWM1 Submodule Control, offset: 0xE3C */ - __IO uint32_t CTIMERGLOBALSTARTEN; /**< CTIMER Global Start Enable, offset: 0xE40 */ - __IO uint32_t ECC_ENABLE_CTRL; /**< RAM ECC Enable Control, offset: 0xE44 */ - uint8_t RESERVED_47[344]; - __IO uint32_t DEBUG_LOCK_EN; /**< Control Write Access to Security, offset: 0xFA0 */ - __IO uint32_t DEBUG_FEATURES; /**< Cortex Debug Features Control, offset: 0xFA4 */ - __IO uint32_t DEBUG_FEATURES_DP; /**< Cortex Debug Features Control (Duplicate), offset: 0xFA8 */ - uint8_t RESERVED_48[8]; - __IO uint32_t SWD_ACCESS_CPU[2]; /**< CPU0 Software Debug Access..CPU1 Software Debug Access, array offset: 0xFB4, array step: 0x4 */ - uint8_t RESERVED_49[4]; - __IO uint32_t DEBUG_AUTH_BEACON; /**< Debug Authentication BEACON, offset: 0xFC0 */ - __IO uint32_t SWD_ACCESS_DSP; /**< DSP Software Debug Access, offset: 0xFC4 */ - uint8_t RESERVED_50[40]; - __I uint32_t JTAG_ID; /**< JTAG Chip ID, offset: 0xFF0 */ - __I uint32_t DEVICE_TYPE; /**< Device Type, offset: 0xFF4 */ - __I uint32_t DEVICE_ID0; /**< Device ID, offset: 0xFF8 */ - __I uint32_t DIEID; /**< Chip Revision ID and Number, offset: 0xFFC */ -} SYSCON_Type; - -/* ---------------------------------------------------------------------------- - -- SYSCON Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SYSCON_Register_Masks SYSCON Register Masks - * @{ - */ - -/*! @name AHBMATPRIO - AHB Matrix Priority Control */ -/*! @{ */ - -#define SYSCON_AHBMATPRIO_PRI_CPU0_CBUS_MASK (0x3U) -#define SYSCON_AHBMATPRIO_PRI_CPU0_CBUS_SHIFT (0U) -/*! PRI_CPU0_CBUS - CPU0 C-AHB bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_PRI_CPU0_CBUS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_PRI_CPU0_CBUS_SHIFT)) & SYSCON_AHBMATPRIO_PRI_CPU0_CBUS_MASK) - -#define SYSCON_AHBMATPRIO_PRI_CPU0_SBUS_MASK (0xCU) -#define SYSCON_AHBMATPRIO_PRI_CPU0_SBUS_SHIFT (2U) -/*! PRI_CPU0_SBUS - CPU0 S-AHB bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_PRI_CPU0_SBUS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_PRI_CPU0_SBUS_SHIFT)) & SYSCON_AHBMATPRIO_PRI_CPU0_SBUS_MASK) - -#define SYSCON_AHBMATPRIO_PRI_CPU1_SBUS_SmartDMA_D_MASK (0x30U) -#define SYSCON_AHBMATPRIO_PRI_CPU1_SBUS_SmartDMA_D_SHIFT (4U) -/*! PRI_CPU1_SBUS_SmartDMA_D - CPU1 S-AHB/SmartDMA-D bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_PRI_CPU1_SBUS_SmartDMA_D(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_PRI_CPU1_SBUS_SmartDMA_D_SHIFT)) & SYSCON_AHBMATPRIO_PRI_CPU1_SBUS_SmartDMA_D_MASK) - -#define SYSCON_AHBMATPRIO_PRI_CPU1_CBUS_SmartDMA_I_MASK (0xC0U) -#define SYSCON_AHBMATPRIO_PRI_CPU1_CBUS_SmartDMA_I_SHIFT (6U) -/*! PRI_CPU1_CBUS_SmartDMA_I - CPU1 C-AHB/SmartDMA-I bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_PRI_CPU1_CBUS_SmartDMA_I(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_PRI_CPU1_CBUS_SmartDMA_I_SHIFT)) & SYSCON_AHBMATPRIO_PRI_CPU1_CBUS_SmartDMA_I_MASK) - -#define SYSCON_AHBMATPRIO_DMA0_MASK (0x300U) -#define SYSCON_AHBMATPRIO_DMA0_SHIFT (8U) -/*! DMA0 - DMA0 controller bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_DMA0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_DMA0_SHIFT)) & SYSCON_AHBMATPRIO_DMA0_MASK) - -#define SYSCON_AHBMATPRIO_DMA1_MASK (0xC00U) -#define SYSCON_AHBMATPRIO_DMA1_SHIFT (10U) -/*! DMA1 - DMA1 controller bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_DMA1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_DMA1_SHIFT)) & SYSCON_AHBMATPRIO_DMA1_MASK) - -#define SYSCON_AHBMATPRIO_PRI_PKC_ELS_MASK (0x3000U) -#define SYSCON_AHBMATPRIO_PRI_PKC_ELS_SHIFT (12U) -/*! PRI_PKC_ELS - PKC and ELS bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_PRI_PKC_ELS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_PRI_PKC_ELS_SHIFT)) & SYSCON_AHBMATPRIO_PRI_PKC_ELS_MASK) - -#define SYSCON_AHBMATPRIO_PRI_NPU_PQ_MASK (0xC000U) -#define SYSCON_AHBMATPRIO_PRI_NPU_PQ_SHIFT (14U) -/*! PRI_NPU_PQ - NPU O bus and Powerquad bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_PRI_NPU_PQ(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_PRI_NPU_PQ_SHIFT)) & SYSCON_AHBMATPRIO_PRI_NPU_PQ_MASK) - -#define SYSCON_AHBMATPRIO_PRI_COOLFLUX_I_MASK (0x30000U) -#define SYSCON_AHBMATPRIO_PRI_COOLFLUX_I_SHIFT (16U) -/*! PRI_COOLFLUX_I - CoolFlux I bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_PRI_COOLFLUX_I(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_PRI_COOLFLUX_I_SHIFT)) & SYSCON_AHBMATPRIO_PRI_COOLFLUX_I_MASK) - -#define SYSCON_AHBMATPRIO_PRI_COOLFLUX_X_MASK (0xC0000U) -#define SYSCON_AHBMATPRIO_PRI_COOLFLUX_X_SHIFT (18U) -/*! PRI_COOLFLUX_X - CoolFlux X bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_PRI_COOLFLUX_X(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_PRI_COOLFLUX_X_SHIFT)) & SYSCON_AHBMATPRIO_PRI_COOLFLUX_X_MASK) - -#define SYSCON_AHBMATPRIO_PRI_COOLFLUX_Y_ESPI_MASK (0x300000U) -#define SYSCON_AHBMATPRIO_PRI_COOLFLUX_Y_ESPI_SHIFT (20U) -/*! PRI_COOLFLUX_Y_ESPI - CoolFlux Y bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_PRI_COOLFLUX_Y_ESPI(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_PRI_COOLFLUX_Y_ESPI_SHIFT)) & SYSCON_AHBMATPRIO_PRI_COOLFLUX_Y_ESPI_MASK) - -#define SYSCON_AHBMATPRIO_PRI_NPU_D_MASK (0xC00000U) -#define SYSCON_AHBMATPRIO_PRI_NPU_D_SHIFT (22U) -/*! PRI_NPU_D - NPU D bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_PRI_NPU_D(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_PRI_NPU_D_SHIFT)) & SYSCON_AHBMATPRIO_PRI_NPU_D_MASK) - -#define SYSCON_AHBMATPRIO_PRI_USB_FS_ENET_MASK (0x3000000U) -#define SYSCON_AHBMATPRIO_PRI_USB_FS_ENET_SHIFT (24U) -/*! PRI_USB_FS_ENET - USB-FS and ENET bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_PRI_USB_FS_ENET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_PRI_USB_FS_ENET_SHIFT)) & SYSCON_AHBMATPRIO_PRI_USB_FS_ENET_MASK) - -#define SYSCON_AHBMATPRIO_PRI_USB_HS_MASK (0xC000000U) -#define SYSCON_AHBMATPRIO_PRI_USB_HS_SHIFT (26U) -/*! PRI_USB_HS - USB-HS bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_PRI_USB_HS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_PRI_USB_HS_SHIFT)) & SYSCON_AHBMATPRIO_PRI_USB_HS_MASK) - -#define SYSCON_AHBMATPRIO_PRI_USDHC_MASK (0x30000000U) -#define SYSCON_AHBMATPRIO_PRI_USDHC_SHIFT (28U) -/*! PRI_USDHC - USDHC bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_PRI_USDHC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_PRI_USDHC_SHIFT)) & SYSCON_AHBMATPRIO_PRI_USDHC_MASK) -/*! @} */ - -/*! @name CPU0STCKCAL - Secure CPU0 System Tick Calibration */ -/*! @{ */ - -#define SYSCON_CPU0STCKCAL_TENMS_MASK (0xFFFFFFU) -#define SYSCON_CPU0STCKCAL_TENMS_SHIFT (0U) -/*! TENMS - Reload value for 10 ms (100 Hz) timing, subject to system clock skew errors. If the - * value reads as zero, the calibration value is not known. - */ -#define SYSCON_CPU0STCKCAL_TENMS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPU0STCKCAL_TENMS_SHIFT)) & SYSCON_CPU0STCKCAL_TENMS_MASK) - -#define SYSCON_CPU0STCKCAL_SKEW_MASK (0x1000000U) -#define SYSCON_CPU0STCKCAL_SKEW_SHIFT (24U) -/*! SKEW - Whether the TENMS value is exact. - * 0b0..TENMS value is exact - * 0b1..TENMS value is not exact or not given - */ -#define SYSCON_CPU0STCKCAL_SKEW(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPU0STCKCAL_SKEW_SHIFT)) & SYSCON_CPU0STCKCAL_SKEW_MASK) - -#define SYSCON_CPU0STCKCAL_NOREF_MASK (0x2000000U) -#define SYSCON_CPU0STCKCAL_NOREF_SHIFT (25U) -/*! NOREF - Whether the device provides a reference clock to the processor. - * 0b0..Reference clock is provided - * 0b1..No reference clock is provided - */ -#define SYSCON_CPU0STCKCAL_NOREF(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPU0STCKCAL_NOREF_SHIFT)) & SYSCON_CPU0STCKCAL_NOREF_MASK) -/*! @} */ - -/*! @name CPU0NSTCKCAL - Non-Secure CPU0 System Tick Calibration */ -/*! @{ */ - -#define SYSCON_CPU0NSTCKCAL_TENMS_MASK (0xFFFFFFU) -#define SYSCON_CPU0NSTCKCAL_TENMS_SHIFT (0U) -/*! TENMS - Reload value for 10 ms (100 Hz) timing, subject to system clock skew errors. If the - * value reads as zero, the calibration value is not known. - */ -#define SYSCON_CPU0NSTCKCAL_TENMS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPU0NSTCKCAL_TENMS_SHIFT)) & SYSCON_CPU0NSTCKCAL_TENMS_MASK) - -#define SYSCON_CPU0NSTCKCAL_SKEW_MASK (0x1000000U) -#define SYSCON_CPU0NSTCKCAL_SKEW_SHIFT (24U) -/*! SKEW - Indicates whether the TENMS value is exact. - * 0b0..TENMS value is exact - * 0b1..TENMS value is not exact or not given - */ -#define SYSCON_CPU0NSTCKCAL_SKEW(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPU0NSTCKCAL_SKEW_SHIFT)) & SYSCON_CPU0NSTCKCAL_SKEW_MASK) - -#define SYSCON_CPU0NSTCKCAL_NOREF_MASK (0x2000000U) -#define SYSCON_CPU0NSTCKCAL_NOREF_SHIFT (25U) -/*! NOREF - Indicates whether the device provides a reference clock to the processor. - * 0b0..Reference clock is provided - * 0b1..No reference clock is provided - */ -#define SYSCON_CPU0NSTCKCAL_NOREF(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPU0NSTCKCAL_NOREF_SHIFT)) & SYSCON_CPU0NSTCKCAL_NOREF_MASK) -/*! @} */ - -/*! @name CPU1STCKCAL - System tick calibration for CPU1 */ -/*! @{ */ - -#define SYSCON_CPU1STCKCAL_TENMS_MASK (0xFFFFFFU) -#define SYSCON_CPU1STCKCAL_TENMS_SHIFT (0U) -/*! TENMS - Reload value for 10 ms (100 Hz) timing, subject to system clock skew errors. If the - * value reads as zero, the calibration value is not known. - */ -#define SYSCON_CPU1STCKCAL_TENMS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPU1STCKCAL_TENMS_SHIFT)) & SYSCON_CPU1STCKCAL_TENMS_MASK) - -#define SYSCON_CPU1STCKCAL_SKEW_MASK (0x1000000U) -#define SYSCON_CPU1STCKCAL_SKEW_SHIFT (24U) -/*! SKEW - Indicates whether the TENMS value is exact. - * 0b0..TENMS value is exact - * 0b1..TENMS value is not exact or not given - */ -#define SYSCON_CPU1STCKCAL_SKEW(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPU1STCKCAL_SKEW_SHIFT)) & SYSCON_CPU1STCKCAL_SKEW_MASK) - -#define SYSCON_CPU1STCKCAL_NOREF_MASK (0x2000000U) -#define SYSCON_CPU1STCKCAL_NOREF_SHIFT (25U) -/*! NOREF - Indicates whether the device provides a reference clock to the processor. - * 0b0..Reference clock is provided - * 0b1..No reference clock is provided - */ -#define SYSCON_CPU1STCKCAL_NOREF(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPU1STCKCAL_NOREF_SHIFT)) & SYSCON_CPU1STCKCAL_NOREF_MASK) -/*! @} */ - -/*! @name NMISRC - NMI Source Select */ -/*! @{ */ - -#define SYSCON_NMISRC_IRQCPU0_MASK (0xFFU) -#define SYSCON_NMISRC_IRQCPU0_SHIFT (0U) -/*! IRQCPU0 - The IRQ number of the interrupt that acts as the Non-Maskable Interrupt (NMI) for CPU0, if enabled by NMIENCPU0. */ -#define SYSCON_NMISRC_IRQCPU0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NMISRC_IRQCPU0_SHIFT)) & SYSCON_NMISRC_IRQCPU0_MASK) - -#define SYSCON_NMISRC_IRQCPU1_MASK (0xFF00U) -#define SYSCON_NMISRC_IRQCPU1_SHIFT (8U) -/*! IRQCPU1 - The IRQ number of the interrupt that acts as the Non-Maskable Interrupt (NMI) for CPU1, if enabled by NMIENCPU1. */ -#define SYSCON_NMISRC_IRQCPU1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NMISRC_IRQCPU1_SHIFT)) & SYSCON_NMISRC_IRQCPU1_MASK) - -#define SYSCON_NMISRC_NMIENCPU1_MASK (0x40000000U) -#define SYSCON_NMISRC_NMIENCPU1_SHIFT (30U) -/*! NMIENCPU1 - Enables the Non-Maskable Interrupt (NMI) source selected by IRQCPU1. - * 0b1..Enable. - * 0b0..Disable. - */ -#define SYSCON_NMISRC_NMIENCPU1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NMISRC_NMIENCPU1_SHIFT)) & SYSCON_NMISRC_NMIENCPU1_MASK) - -#define SYSCON_NMISRC_NMIENCPU0_MASK (0x80000000U) -#define SYSCON_NMISRC_NMIENCPU0_SHIFT (31U) -/*! NMIENCPU0 - Enables the Non-Maskable Interrupt (NMI) source selected by IRQCPU0. - * 0b1..Enable. - * 0b0..Disable. - */ -#define SYSCON_NMISRC_NMIENCPU0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NMISRC_NMIENCPU0_SHIFT)) & SYSCON_NMISRC_NMIENCPU0_MASK) -/*! @} */ - -/*! @name PRESETCTRL0 - Peripheral Reset Control 0 */ -/*! @{ */ - -#define SYSCON_PRESETCTRL0_FMU_RST_MASK (0x200U) -#define SYSCON_PRESETCTRL0_FMU_RST_SHIFT (9U) -/*! FMU_RST - Flash management unit reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_FMU_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_FMU_RST_SHIFT)) & SYSCON_PRESETCTRL0_FMU_RST_MASK) - -#define SYSCON_PRESETCTRL0_FLEXSPI_RST_MASK (0x800U) -#define SYSCON_PRESETCTRL0_FLEXSPI_RST_SHIFT (11U) -/*! FLEXSPI_RST - FlexSPI reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_FLEXSPI_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_FLEXSPI_RST_SHIFT)) & SYSCON_PRESETCTRL0_FLEXSPI_RST_MASK) - -#define SYSCON_PRESETCTRL0_MUX_RST_MASK (0x1000U) -#define SYSCON_PRESETCTRL0_MUX_RST_SHIFT (12U) -/*! MUX_RST - INPUTMUX reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_MUX_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_MUX_RST_SHIFT)) & SYSCON_PRESETCTRL0_MUX_RST_MASK) - -#define SYSCON_PRESETCTRL0_PORT0_RST_MASK (0x2000U) -#define SYSCON_PRESETCTRL0_PORT0_RST_SHIFT (13U) -/*! PORT0_RST - PORT0 controller reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_PORT0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_PORT0_RST_SHIFT)) & SYSCON_PRESETCTRL0_PORT0_RST_MASK) - -#define SYSCON_PRESETCTRL0_PORT1_RST_MASK (0x4000U) -#define SYSCON_PRESETCTRL0_PORT1_RST_SHIFT (14U) -/*! PORT1_RST - PORT1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_PORT1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_PORT1_RST_SHIFT)) & SYSCON_PRESETCTRL0_PORT1_RST_MASK) - -#define SYSCON_PRESETCTRL0_PORT2_RST_MASK (0x8000U) -#define SYSCON_PRESETCTRL0_PORT2_RST_SHIFT (15U) -/*! PORT2_RST - PORT2 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_PORT2_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_PORT2_RST_SHIFT)) & SYSCON_PRESETCTRL0_PORT2_RST_MASK) - -#define SYSCON_PRESETCTRL0_PORT3_RST_MASK (0x10000U) -#define SYSCON_PRESETCTRL0_PORT3_RST_SHIFT (16U) -/*! PORT3_RST - PORT3 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_PORT3_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_PORT3_RST_SHIFT)) & SYSCON_PRESETCTRL0_PORT3_RST_MASK) - -#define SYSCON_PRESETCTRL0_PORT4_RST_MASK (0x20000U) -#define SYSCON_PRESETCTRL0_PORT4_RST_SHIFT (17U) -/*! PORT4_RST - PORT4 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_PORT4_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_PORT4_RST_SHIFT)) & SYSCON_PRESETCTRL0_PORT4_RST_MASK) - -#define SYSCON_PRESETCTRL0_GPIO0_RST_MASK (0x80000U) -#define SYSCON_PRESETCTRL0_GPIO0_RST_SHIFT (19U) -/*! GPIO0_RST - GPIO0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_GPIO0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_GPIO0_RST_SHIFT)) & SYSCON_PRESETCTRL0_GPIO0_RST_MASK) - -#define SYSCON_PRESETCTRL0_GPIO1_RST_MASK (0x100000U) -#define SYSCON_PRESETCTRL0_GPIO1_RST_SHIFT (20U) -/*! GPIO1_RST - GPIO1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_GPIO1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_GPIO1_RST_SHIFT)) & SYSCON_PRESETCTRL0_GPIO1_RST_MASK) - -#define SYSCON_PRESETCTRL0_GPIO2_RST_MASK (0x200000U) -#define SYSCON_PRESETCTRL0_GPIO2_RST_SHIFT (21U) -/*! GPIO2_RST - GPIO2 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_GPIO2_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_GPIO2_RST_SHIFT)) & SYSCON_PRESETCTRL0_GPIO2_RST_MASK) - -#define SYSCON_PRESETCTRL0_GPIO3_RST_MASK (0x400000U) -#define SYSCON_PRESETCTRL0_GPIO3_RST_SHIFT (22U) -/*! GPIO3_RST - GPIO3 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_GPIO3_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_GPIO3_RST_SHIFT)) & SYSCON_PRESETCTRL0_GPIO3_RST_MASK) - -#define SYSCON_PRESETCTRL0_GPIO4_RST_MASK (0x800000U) -#define SYSCON_PRESETCTRL0_GPIO4_RST_SHIFT (23U) -/*! GPIO4_RST - GPIO4 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_GPIO4_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_GPIO4_RST_SHIFT)) & SYSCON_PRESETCTRL0_GPIO4_RST_MASK) - -#define SYSCON_PRESETCTRL0_PINT_RST_MASK (0x2000000U) -#define SYSCON_PRESETCTRL0_PINT_RST_SHIFT (25U) -/*! PINT_RST - PINT reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_PINT_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_PINT_RST_SHIFT)) & SYSCON_PRESETCTRL0_PINT_RST_MASK) - -#define SYSCON_PRESETCTRL0_DMA0_RST_MASK (0x4000000U) -#define SYSCON_PRESETCTRL0_DMA0_RST_SHIFT (26U) -/*! DMA0_RST - DMA0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_DMA0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_DMA0_RST_SHIFT)) & SYSCON_PRESETCTRL0_DMA0_RST_MASK) - -#define SYSCON_PRESETCTRL0_CRC_RST_MASK (0x8000000U) -#define SYSCON_PRESETCTRL0_CRC_RST_SHIFT (27U) -/*! CRC_RST - CRC reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_CRC_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_CRC_RST_SHIFT)) & SYSCON_PRESETCTRL0_CRC_RST_MASK) - -#define SYSCON_PRESETCTRL0_MAILBOX_RST_MASK (0x80000000U) -#define SYSCON_PRESETCTRL0_MAILBOX_RST_SHIFT (31U) -/*! MAILBOX_RST - Inter-CPU communication Mailbox reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_MAILBOX_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_MAILBOX_RST_SHIFT)) & SYSCON_PRESETCTRL0_MAILBOX_RST_MASK) -/*! @} */ - -/*! @name PRESETCTRL1 - Peripheral Reset Control 1 */ -/*! @{ */ - -#define SYSCON_PRESETCTRL1_MRT_RST_MASK (0x1U) -#define SYSCON_PRESETCTRL1_MRT_RST_SHIFT (0U) -/*! MRT_RST - MRT reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_MRT_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_MRT_RST_SHIFT)) & SYSCON_PRESETCTRL1_MRT_RST_MASK) - -#define SYSCON_PRESETCTRL1_OSTIMER_RST_MASK (0x2U) -#define SYSCON_PRESETCTRL1_OSTIMER_RST_SHIFT (1U) -/*! OSTIMER_RST - OS Event Timer reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_OSTIMER_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_OSTIMER_RST_SHIFT)) & SYSCON_PRESETCTRL1_OSTIMER_RST_MASK) - -#define SYSCON_PRESETCTRL1_SCT_RST_MASK (0x4U) -#define SYSCON_PRESETCTRL1_SCT_RST_SHIFT (2U) -/*! SCT_RST - SCT reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_SCT_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_SCT_RST_SHIFT)) & SYSCON_PRESETCTRL1_SCT_RST_MASK) - -#define SYSCON_PRESETCTRL1_ADC0_RST_MASK (0x8U) -#define SYSCON_PRESETCTRL1_ADC0_RST_SHIFT (3U) -/*! ADC0_RST - ADC0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_ADC0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_ADC0_RST_SHIFT)) & SYSCON_PRESETCTRL1_ADC0_RST_MASK) - -#define SYSCON_PRESETCTRL1_ADC1_RST_MASK (0x10U) -#define SYSCON_PRESETCTRL1_ADC1_RST_SHIFT (4U) -/*! ADC1_RST - ADC1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_ADC1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_ADC1_RST_SHIFT)) & SYSCON_PRESETCTRL1_ADC1_RST_MASK) - -#define SYSCON_PRESETCTRL1_DAC0_RST_MASK (0x20U) -#define SYSCON_PRESETCTRL1_DAC0_RST_SHIFT (5U) -/*! DAC0_RST - DAC0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_DAC0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_DAC0_RST_SHIFT)) & SYSCON_PRESETCTRL1_DAC0_RST_MASK) - -#define SYSCON_PRESETCTRL1_RTC_RST_MASK (0x40U) -#define SYSCON_PRESETCTRL1_RTC_RST_SHIFT (6U) -/*! RTC_RST - RTC reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_RTC_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_RTC_RST_SHIFT)) & SYSCON_PRESETCTRL1_RTC_RST_MASK) - -#define SYSCON_PRESETCTRL1_EVSIM0_RST_MASK (0x100U) -#define SYSCON_PRESETCTRL1_EVSIM0_RST_SHIFT (8U) -/*! EVSIM0_RST - EVSIM0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_EVSIM0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_EVSIM0_RST_SHIFT)) & SYSCON_PRESETCTRL1_EVSIM0_RST_MASK) - -#define SYSCON_PRESETCTRL1_EVSIM1_RST_MASK (0x200U) -#define SYSCON_PRESETCTRL1_EVSIM1_RST_SHIFT (9U) -/*! EVSIM1_RST - EVSIM1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_EVSIM1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_EVSIM1_RST_SHIFT)) & SYSCON_PRESETCTRL1_EVSIM1_RST_MASK) - -#define SYSCON_PRESETCTRL1_UTICK_RST_MASK (0x400U) -#define SYSCON_PRESETCTRL1_UTICK_RST_SHIFT (10U) -/*! UTICK_RST - UTICK reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_UTICK_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_UTICK_RST_SHIFT)) & SYSCON_PRESETCTRL1_UTICK_RST_MASK) - -#define SYSCON_PRESETCTRL1_FC0_RST_MASK (0x800U) -#define SYSCON_PRESETCTRL1_FC0_RST_SHIFT (11U) -/*! FC0_RST - LP_FLEXCOMM0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_FC0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_FC0_RST_SHIFT)) & SYSCON_PRESETCTRL1_FC0_RST_MASK) - -#define SYSCON_PRESETCTRL1_FC1_RST_MASK (0x1000U) -#define SYSCON_PRESETCTRL1_FC1_RST_SHIFT (12U) -/*! FC1_RST - LP_FLEXCOMM1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_FC1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_FC1_RST_SHIFT)) & SYSCON_PRESETCTRL1_FC1_RST_MASK) - -#define SYSCON_PRESETCTRL1_FC2_RST_MASK (0x2000U) -#define SYSCON_PRESETCTRL1_FC2_RST_SHIFT (13U) -/*! FC2_RST - LP_FLEXCOMM2 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_FC2_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_FC2_RST_SHIFT)) & SYSCON_PRESETCTRL1_FC2_RST_MASK) - -#define SYSCON_PRESETCTRL1_FC3_RST_MASK (0x4000U) -#define SYSCON_PRESETCTRL1_FC3_RST_SHIFT (14U) -/*! FC3_RST - LP_FLEXCOMM3 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_FC3_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_FC3_RST_SHIFT)) & SYSCON_PRESETCTRL1_FC3_RST_MASK) - -#define SYSCON_PRESETCTRL1_FC4_RST_MASK (0x8000U) -#define SYSCON_PRESETCTRL1_FC4_RST_SHIFT (15U) -/*! FC4_RST - LP_FLEXCOMM4 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_FC4_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_FC4_RST_SHIFT)) & SYSCON_PRESETCTRL1_FC4_RST_MASK) - -#define SYSCON_PRESETCTRL1_FC5_RST_MASK (0x10000U) -#define SYSCON_PRESETCTRL1_FC5_RST_SHIFT (16U) -/*! FC5_RST - LP_FLEXCOMM5 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_FC5_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_FC5_RST_SHIFT)) & SYSCON_PRESETCTRL1_FC5_RST_MASK) - -#define SYSCON_PRESETCTRL1_FC6_RST_MASK (0x20000U) -#define SYSCON_PRESETCTRL1_FC6_RST_SHIFT (17U) -/*! FC6_RST - LP_FLEXCOMM6 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_FC6_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_FC6_RST_SHIFT)) & SYSCON_PRESETCTRL1_FC6_RST_MASK) - -#define SYSCON_PRESETCTRL1_FC7_RST_MASK (0x40000U) -#define SYSCON_PRESETCTRL1_FC7_RST_SHIFT (18U) -/*! FC7_RST - LP_FLEXCOMM7 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_FC7_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_FC7_RST_SHIFT)) & SYSCON_PRESETCTRL1_FC7_RST_MASK) - -#define SYSCON_PRESETCTRL1_FC8_RST_MASK (0x80000U) -#define SYSCON_PRESETCTRL1_FC8_RST_SHIFT (19U) -/*! FC8_RST - LP_FLEXCOMM8 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_FC8_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_FC8_RST_SHIFT)) & SYSCON_PRESETCTRL1_FC8_RST_MASK) - -#define SYSCON_PRESETCTRL1_FC9_RST_MASK (0x100000U) -#define SYSCON_PRESETCTRL1_FC9_RST_SHIFT (20U) -/*! FC9_RST - LP_FLEXCOMM9 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_FC9_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_FC9_RST_SHIFT)) & SYSCON_PRESETCTRL1_FC9_RST_MASK) - -#define SYSCON_PRESETCTRL1_MICFIL_RST_MASK (0x200000U) -#define SYSCON_PRESETCTRL1_MICFIL_RST_SHIFT (21U) -/*! MICFIL_RST - MICFIL reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_MICFIL_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_MICFIL_RST_SHIFT)) & SYSCON_PRESETCTRL1_MICFIL_RST_MASK) - -#define SYSCON_PRESETCTRL1_TIMER2_RST_MASK (0x400000U) -#define SYSCON_PRESETCTRL1_TIMER2_RST_SHIFT (22U) -/*! TIMER2_RST - CTIMER2 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_TIMER2_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_TIMER2_RST_SHIFT)) & SYSCON_PRESETCTRL1_TIMER2_RST_MASK) - -#define SYSCON_PRESETCTRL1_USB0_FS_DCD_RST_MASK (0x1000000U) -#define SYSCON_PRESETCTRL1_USB0_FS_DCD_RST_SHIFT (24U) -/*! USB0_FS_DCD_RST - USB FS DCD reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_USB0_FS_DCD_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_USB0_FS_DCD_RST_SHIFT)) & SYSCON_PRESETCTRL1_USB0_FS_DCD_RST_MASK) - -#define SYSCON_PRESETCTRL1_USB0_FS_RST_MASK (0x2000000U) -#define SYSCON_PRESETCTRL1_USB0_FS_RST_SHIFT (25U) -/*! USB0_FS_RST - USB FS reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_USB0_FS_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_USB0_FS_RST_SHIFT)) & SYSCON_PRESETCTRL1_USB0_FS_RST_MASK) - -#define SYSCON_PRESETCTRL1_TIMER0_RST_MASK (0x4000000U) -#define SYSCON_PRESETCTRL1_TIMER0_RST_SHIFT (26U) -/*! TIMER0_RST - CTIMER0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_TIMER0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_TIMER0_RST_SHIFT)) & SYSCON_PRESETCTRL1_TIMER0_RST_MASK) - -#define SYSCON_PRESETCTRL1_TIMER1_RST_MASK (0x8000000U) -#define SYSCON_PRESETCTRL1_TIMER1_RST_SHIFT (27U) -/*! TIMER1_RST - CTIMER1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_TIMER1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_TIMER1_RST_SHIFT)) & SYSCON_PRESETCTRL1_TIMER1_RST_MASK) - -#define SYSCON_PRESETCTRL1_SmartDMA_RST_MASK (0x80000000U) -#define SYSCON_PRESETCTRL1_SmartDMA_RST_SHIFT (31U) -/*! SmartDMA_RST - SmartDMA reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_SmartDMA_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_SmartDMA_RST_SHIFT)) & SYSCON_PRESETCTRL1_SmartDMA_RST_MASK) -/*! @} */ - -/*! @name PRESETCTRL2 - Peripheral Reset Control 2 */ -/*! @{ */ - -#define SYSCON_PRESETCTRL2_DMA1_RST_MASK (0x2U) -#define SYSCON_PRESETCTRL2_DMA1_RST_SHIFT (1U) -/*! DMA1_RST - DMA1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_DMA1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_DMA1_RST_SHIFT)) & SYSCON_PRESETCTRL2_DMA1_RST_MASK) - -#define SYSCON_PRESETCTRL2_ENET_RST_MASK (0x4U) -#define SYSCON_PRESETCTRL2_ENET_RST_SHIFT (2U) -/*! ENET_RST - Ethernet reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_ENET_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_ENET_RST_SHIFT)) & SYSCON_PRESETCTRL2_ENET_RST_MASK) - -#define SYSCON_PRESETCTRL2_USDHC_RST_MASK (0x8U) -#define SYSCON_PRESETCTRL2_USDHC_RST_SHIFT (3U) -/*! USDHC_RST - uSDHC reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_USDHC_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_USDHC_RST_SHIFT)) & SYSCON_PRESETCTRL2_USDHC_RST_MASK) - -#define SYSCON_PRESETCTRL2_FLEXIO_RST_MASK (0x10U) -#define SYSCON_PRESETCTRL2_FLEXIO_RST_SHIFT (4U) -/*! FLEXIO_RST - FLEXIO reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_FLEXIO_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_FLEXIO_RST_SHIFT)) & SYSCON_PRESETCTRL2_FLEXIO_RST_MASK) - -#define SYSCON_PRESETCTRL2_SAI0_RST_MASK (0x20U) -#define SYSCON_PRESETCTRL2_SAI0_RST_SHIFT (5U) -/*! SAI0_RST - SAI0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_SAI0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_SAI0_RST_SHIFT)) & SYSCON_PRESETCTRL2_SAI0_RST_MASK) - -#define SYSCON_PRESETCTRL2_SAI1_RST_MASK (0x40U) -#define SYSCON_PRESETCTRL2_SAI1_RST_SHIFT (6U) -/*! SAI1_RST - SAI1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_SAI1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_SAI1_RST_SHIFT)) & SYSCON_PRESETCTRL2_SAI1_RST_MASK) - -#define SYSCON_PRESETCTRL2_TRO_RST_MASK (0x80U) -#define SYSCON_PRESETCTRL2_TRO_RST_SHIFT (7U) -/*! TRO_RST - TRO reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_TRO_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_TRO_RST_SHIFT)) & SYSCON_PRESETCTRL2_TRO_RST_MASK) - -#define SYSCON_PRESETCTRL2_FREQME_RST_MASK (0x100U) -#define SYSCON_PRESETCTRL2_FREQME_RST_SHIFT (8U) -/*! FREQME_RST - FREQME reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_FREQME_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_FREQME_RST_SHIFT)) & SYSCON_PRESETCTRL2_FREQME_RST_MASK) - -#define SYSCON_PRESETCTRL2_TRNG_RST_MASK (0x2000U) -#define SYSCON_PRESETCTRL2_TRNG_RST_SHIFT (13U) -/*! TRNG_RST - TRNG reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_TRNG_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_TRNG_RST_SHIFT)) & SYSCON_PRESETCTRL2_TRNG_RST_MASK) - -#define SYSCON_PRESETCTRL2_FLEXCAN0_RST_MASK (0x4000U) -#define SYSCON_PRESETCTRL2_FLEXCAN0_RST_SHIFT (14U) -/*! FLEXCAN0_RST - CAN0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_FLEXCAN0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_FLEXCAN0_RST_SHIFT)) & SYSCON_PRESETCTRL2_FLEXCAN0_RST_MASK) - -#define SYSCON_PRESETCTRL2_FLEXCAN1_RST_MASK (0x8000U) -#define SYSCON_PRESETCTRL2_FLEXCAN1_RST_SHIFT (15U) -/*! FLEXCAN1_RST - CAN1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_FLEXCAN1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_FLEXCAN1_RST_SHIFT)) & SYSCON_PRESETCTRL2_FLEXCAN1_RST_MASK) - -#define SYSCON_PRESETCTRL2_USB_HS_RST_MASK (0x10000U) -#define SYSCON_PRESETCTRL2_USB_HS_RST_SHIFT (16U) -/*! USB_HS_RST - USB HS reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_USB_HS_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_USB_HS_RST_SHIFT)) & SYSCON_PRESETCTRL2_USB_HS_RST_MASK) - -#define SYSCON_PRESETCTRL2_USB_HS_PHY_RST_MASK (0x20000U) -#define SYSCON_PRESETCTRL2_USB_HS_PHY_RST_SHIFT (17U) -/*! USB_HS_PHY_RST - USB HS PHY reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_USB_HS_PHY_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_USB_HS_PHY_RST_SHIFT)) & SYSCON_PRESETCTRL2_USB_HS_PHY_RST_MASK) - -#define SYSCON_PRESETCTRL2_PQ_RST_MASK (0x80000U) -#define SYSCON_PRESETCTRL2_PQ_RST_SHIFT (19U) -/*! PQ_RST - PowerQuad reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_PQ_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_PQ_RST_SHIFT)) & SYSCON_PRESETCTRL2_PQ_RST_MASK) - -#define SYSCON_PRESETCTRL2_PLU_RST_MASK (0x100000U) -#define SYSCON_PRESETCTRL2_PLU_RST_SHIFT (20U) -/*! PLU_RST - PLU reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_PLU_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_PLU_RST_SHIFT)) & SYSCON_PRESETCTRL2_PLU_RST_MASK) - -#define SYSCON_PRESETCTRL2_TIMER3_RST_MASK (0x200000U) -#define SYSCON_PRESETCTRL2_TIMER3_RST_SHIFT (21U) -/*! TIMER3_RST - CTIMER3 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_TIMER3_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_TIMER3_RST_SHIFT)) & SYSCON_PRESETCTRL2_TIMER3_RST_MASK) - -#define SYSCON_PRESETCTRL2_TIMER4_RST_MASK (0x400000U) -#define SYSCON_PRESETCTRL2_TIMER4_RST_SHIFT (22U) -/*! TIMER4_RST - CTIMER4 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_TIMER4_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_TIMER4_RST_SHIFT)) & SYSCON_PRESETCTRL2_TIMER4_RST_MASK) - -#define SYSCON_PRESETCTRL2_PUF_RST_MASK (0x800000U) -#define SYSCON_PRESETCTRL2_PUF_RST_SHIFT (23U) -/*! PUF_RST - PUF reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_PUF_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_PUF_RST_SHIFT)) & SYSCON_PRESETCTRL2_PUF_RST_MASK) - -#define SYSCON_PRESETCTRL2_PKC_RST_MASK (0x1000000U) -#define SYSCON_PRESETCTRL2_PKC_RST_SHIFT (24U) -/*! PKC_RST - PKC reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_PKC_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_PKC_RST_SHIFT)) & SYSCON_PRESETCTRL2_PKC_RST_MASK) - -#define SYSCON_PRESETCTRL2_SM3_RST_MASK (0x40000000U) -#define SYSCON_PRESETCTRL2_SM3_RST_SHIFT (30U) -/*! SM3_RST - SM3 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_SM3_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_SM3_RST_SHIFT)) & SYSCON_PRESETCTRL2_SM3_RST_MASK) -/*! @} */ - -/*! @name PRESETCTRL3 - Peripheral Reset Control 3 */ -/*! @{ */ - -#define SYSCON_PRESETCTRL3_I3C0_RST_MASK (0x1U) -#define SYSCON_PRESETCTRL3_I3C0_RST_SHIFT (0U) -/*! I3C0_RST - I3C0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_I3C0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_I3C0_RST_SHIFT)) & SYSCON_PRESETCTRL3_I3C0_RST_MASK) - -#define SYSCON_PRESETCTRL3_I3C1_RST_MASK (0x2U) -#define SYSCON_PRESETCTRL3_I3C1_RST_SHIFT (1U) -/*! I3C1_RST - I3C1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_I3C1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_I3C1_RST_SHIFT)) & SYSCON_PRESETCTRL3_I3C1_RST_MASK) - -#define SYSCON_PRESETCTRL3_SINC_RST_MASK (0x4U) -#define SYSCON_PRESETCTRL3_SINC_RST_SHIFT (2U) -/*! SINC_RST - SINC reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_SINC_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_SINC_RST_SHIFT)) & SYSCON_PRESETCTRL3_SINC_RST_MASK) - -#define SYSCON_PRESETCTRL3_COOLFLUX_RST_MASK (0x8U) -#define SYSCON_PRESETCTRL3_COOLFLUX_RST_SHIFT (3U) -/*! COOLFLUX_RST - CoolFlux reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_COOLFLUX_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_COOLFLUX_RST_SHIFT)) & SYSCON_PRESETCTRL3_COOLFLUX_RST_MASK) - -#define SYSCON_PRESETCTRL3_QDC0_RST_MASK (0x10U) -#define SYSCON_PRESETCTRL3_QDC0_RST_SHIFT (4U) -/*! QDC0_RST - QDC0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_QDC0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_QDC0_RST_SHIFT)) & SYSCON_PRESETCTRL3_QDC0_RST_MASK) - -#define SYSCON_PRESETCTRL3_QDC1_RST_MASK (0x20U) -#define SYSCON_PRESETCTRL3_QDC1_RST_SHIFT (5U) -/*! QDC1_RST - QDC1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_QDC1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_QDC1_RST_SHIFT)) & SYSCON_PRESETCTRL3_QDC1_RST_MASK) - -#define SYSCON_PRESETCTRL3_PWM0_RST_MASK (0x40U) -#define SYSCON_PRESETCTRL3_PWM0_RST_SHIFT (6U) -/*! PWM0_RST - PWM0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_PWM0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_PWM0_RST_SHIFT)) & SYSCON_PRESETCTRL3_PWM0_RST_MASK) - -#define SYSCON_PRESETCTRL3_PWM1_RST_MASK (0x80U) -#define SYSCON_PRESETCTRL3_PWM1_RST_SHIFT (7U) -/*! PWM1_RST - PWM1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_PWM1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_PWM1_RST_SHIFT)) & SYSCON_PRESETCTRL3_PWM1_RST_MASK) - -#define SYSCON_PRESETCTRL3_AOI0_RST_MASK (0x100U) -#define SYSCON_PRESETCTRL3_AOI0_RST_SHIFT (8U) -/*! AOI0_RST - AOI0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_AOI0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_AOI0_RST_SHIFT)) & SYSCON_PRESETCTRL3_AOI0_RST_MASK) - -#define SYSCON_PRESETCTRL3_DAC1_RST_MASK (0x800U) -#define SYSCON_PRESETCTRL3_DAC1_RST_SHIFT (11U) -/*! DAC1_RST - DAC1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_DAC1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_DAC1_RST_SHIFT)) & SYSCON_PRESETCTRL3_DAC1_RST_MASK) - -#define SYSCON_PRESETCTRL3_DAC2_RST_MASK (0x1000U) -#define SYSCON_PRESETCTRL3_DAC2_RST_SHIFT (12U) -/*! DAC2_RST - DAC2 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_DAC2_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_DAC2_RST_SHIFT)) & SYSCON_PRESETCTRL3_DAC2_RST_MASK) - -#define SYSCON_PRESETCTRL3_OPAMP0_RST_MASK (0x2000U) -#define SYSCON_PRESETCTRL3_OPAMP0_RST_SHIFT (13U) -/*! OPAMP0_RST - OPAMP0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_OPAMP0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_OPAMP0_RST_SHIFT)) & SYSCON_PRESETCTRL3_OPAMP0_RST_MASK) - -#define SYSCON_PRESETCTRL3_OPAMP1_RST_MASK (0x4000U) -#define SYSCON_PRESETCTRL3_OPAMP1_RST_SHIFT (14U) -/*! OPAMP1_RST - OPAMP1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_OPAMP1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_OPAMP1_RST_SHIFT)) & SYSCON_PRESETCTRL3_OPAMP1_RST_MASK) - -#define SYSCON_PRESETCTRL3_OPAMP2_RST_MASK (0x8000U) -#define SYSCON_PRESETCTRL3_OPAMP2_RST_SHIFT (15U) -/*! OPAMP2_RST - OPAMP2 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_OPAMP2_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_OPAMP2_RST_SHIFT)) & SYSCON_PRESETCTRL3_OPAMP2_RST_MASK) - -#define SYSCON_PRESETCTRL3_CMP2_RST_MASK (0x40000U) -#define SYSCON_PRESETCTRL3_CMP2_RST_SHIFT (18U) -/*! CMP2_RST - CMP2 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_CMP2_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_CMP2_RST_SHIFT)) & SYSCON_PRESETCTRL3_CMP2_RST_MASK) - -#define SYSCON_PRESETCTRL3_VREF_RST_MASK (0x80000U) -#define SYSCON_PRESETCTRL3_VREF_RST_SHIFT (19U) -/*! VREF_RST - VREF reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_VREF_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_VREF_RST_SHIFT)) & SYSCON_PRESETCTRL3_VREF_RST_MASK) - -#define SYSCON_PRESETCTRL3_COOLFLUX_APB_RST_MASK (0x100000U) -#define SYSCON_PRESETCTRL3_COOLFLUX_APB_RST_SHIFT (20U) -/*! COOLFLUX_APB_RST - CoolFlux APB reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_COOLFLUX_APB_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_COOLFLUX_APB_RST_SHIFT)) & SYSCON_PRESETCTRL3_COOLFLUX_APB_RST_MASK) - -#define SYSCON_PRESETCTRL3_NPU_RST_MASK (0x200000U) -#define SYSCON_PRESETCTRL3_NPU_RST_SHIFT (21U) -/*! NPU_RST - NPU reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_NPU_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_NPU_RST_SHIFT)) & SYSCON_PRESETCTRL3_NPU_RST_MASK) - -#define SYSCON_PRESETCTRL3_TSI_RST_MASK (0x400000U) -#define SYSCON_PRESETCTRL3_TSI_RST_SHIFT (22U) -/*! TSI_RST - TSI reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_TSI_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_TSI_RST_SHIFT)) & SYSCON_PRESETCTRL3_TSI_RST_MASK) - -#define SYSCON_PRESETCTRL3_EWM_RST_MASK (0x800000U) -#define SYSCON_PRESETCTRL3_EWM_RST_SHIFT (23U) -/*! EWM_RST - EWM reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_EWM_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_EWM_RST_SHIFT)) & SYSCON_PRESETCTRL3_EWM_RST_MASK) - -#define SYSCON_PRESETCTRL3_EIM_RST_MASK (0x1000000U) -#define SYSCON_PRESETCTRL3_EIM_RST_SHIFT (24U) -/*! EIM_RST - EIM reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_EIM_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_EIM_RST_SHIFT)) & SYSCON_PRESETCTRL3_EIM_RST_MASK) - -#define SYSCON_PRESETCTRL3_SEMA42_RST_MASK (0x8000000U) -#define SYSCON_PRESETCTRL3_SEMA42_RST_SHIFT (27U) -/*! SEMA42_RST - Semaphore reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_SEMA42_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_SEMA42_RST_SHIFT)) & SYSCON_PRESETCTRL3_SEMA42_RST_MASK) -/*! @} */ - -/*! @name PRESETCTRLSET - Peripheral Reset Control Set */ -/*! @{ */ - -#define SYSCON_PRESETCTRLSET_DATA_MASK (0xFFFFFFFFU) -#define SYSCON_PRESETCTRLSET_DATA_SHIFT (0U) -/*! DATA - Data array value, refer to corresponding position in PRESETCTRLn. */ -#define SYSCON_PRESETCTRLSET_DATA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRLSET_DATA_SHIFT)) & SYSCON_PRESETCTRLSET_DATA_MASK) -/*! @} */ - -/* The count of SYSCON_PRESETCTRLSET */ -#define SYSCON_PRESETCTRLSET_COUNT (4U) - -/*! @name PRESETCTRLCLR - Peripheral Reset Control Clear */ -/*! @{ */ - -#define SYSCON_PRESETCTRLCLR_DATA_MASK (0xFFFFFFFFU) -#define SYSCON_PRESETCTRLCLR_DATA_SHIFT (0U) -/*! DATA - Data array value, refer to corresponding position in PRESETCTRLn. */ -#define SYSCON_PRESETCTRLCLR_DATA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRLCLR_DATA_SHIFT)) & SYSCON_PRESETCTRLCLR_DATA_MASK) -/*! @} */ - -/* The count of SYSCON_PRESETCTRLCLR */ -#define SYSCON_PRESETCTRLCLR_COUNT (4U) - -/*! @name AHBCLKCTRL0 - AHB Clock Control 0 */ -/*! @{ */ - -#define SYSCON_AHBCLKCTRL0_ROM_MASK (0x2U) -#define SYSCON_AHBCLKCTRL0_ROM_SHIFT (1U) -/*! ROM - Enables the clock for the ROM - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_ROM(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_ROM_SHIFT)) & SYSCON_AHBCLKCTRL0_ROM_MASK) - -#define SYSCON_AHBCLKCTRL0_RAMB_CTRL_MASK (0x4U) -#define SYSCON_AHBCLKCTRL0_RAMB_CTRL_SHIFT (2U) -/*! RAMB_CTRL - Enables the clock for the RAMB Controller - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_RAMB_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_RAMB_CTRL_SHIFT)) & SYSCON_AHBCLKCTRL0_RAMB_CTRL_MASK) - -#define SYSCON_AHBCLKCTRL0_RAMC_CTRL_MASK (0x8U) -#define SYSCON_AHBCLKCTRL0_RAMC_CTRL_SHIFT (3U) -/*! RAMC_CTRL - Enables the clock for the RAMC Controller - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_RAMC_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_RAMC_CTRL_SHIFT)) & SYSCON_AHBCLKCTRL0_RAMC_CTRL_MASK) - -#define SYSCON_AHBCLKCTRL0_RAMD_CTRL_MASK (0x10U) -#define SYSCON_AHBCLKCTRL0_RAMD_CTRL_SHIFT (4U) -/*! RAMD_CTRL - Enables the clock for the RAMD Controller - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_RAMD_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_RAMD_CTRL_SHIFT)) & SYSCON_AHBCLKCTRL0_RAMD_CTRL_MASK) - -#define SYSCON_AHBCLKCTRL0_RAME_CTRL_MASK (0x20U) -#define SYSCON_AHBCLKCTRL0_RAME_CTRL_SHIFT (5U) -/*! RAME_CTRL - Enables the clock for the RAME Controller - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_RAME_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_RAME_CTRL_SHIFT)) & SYSCON_AHBCLKCTRL0_RAME_CTRL_MASK) - -#define SYSCON_AHBCLKCTRL0_RAMF_CTRL_MASK (0x40U) -#define SYSCON_AHBCLKCTRL0_RAMF_CTRL_SHIFT (6U) -/*! RAMF_CTRL - Enables the clock for the RAMF Controller - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_RAMF_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_RAMF_CTRL_SHIFT)) & SYSCON_AHBCLKCTRL0_RAMF_CTRL_MASK) - -#define SYSCON_AHBCLKCTRL0_RAMG_CTRL_MASK (0x80U) -#define SYSCON_AHBCLKCTRL0_RAMG_CTRL_SHIFT (7U) -/*! RAMG_CTRL - Enables the clock for the RAMG Controller - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_RAMG_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_RAMG_CTRL_SHIFT)) & SYSCON_AHBCLKCTRL0_RAMG_CTRL_MASK) - -#define SYSCON_AHBCLKCTRL0_RAMH_CTRL_MASK (0x100U) -#define SYSCON_AHBCLKCTRL0_RAMH_CTRL_SHIFT (8U) -/*! RAMH_CTRL - Enables the clock for the RAMH Controller - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_RAMH_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_RAMH_CTRL_SHIFT)) & SYSCON_AHBCLKCTRL0_RAMH_CTRL_MASK) - -#define SYSCON_AHBCLKCTRL0_FMU_MASK (0x200U) -#define SYSCON_AHBCLKCTRL0_FMU_SHIFT (9U) -/*! FMU - Enables the clock for the Flash Management Unit - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_FMU(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_FMU_SHIFT)) & SYSCON_AHBCLKCTRL0_FMU_MASK) - -#define SYSCON_AHBCLKCTRL0_FMC_MASK (0x400U) -#define SYSCON_AHBCLKCTRL0_FMC_SHIFT (10U) -/*! FMC - Enables the clock for the Flash Memory Controller - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_FMC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_FMC_SHIFT)) & SYSCON_AHBCLKCTRL0_FMC_MASK) - -#define SYSCON_AHBCLKCTRL0_FLEXSPI_MASK (0x800U) -#define SYSCON_AHBCLKCTRL0_FLEXSPI_SHIFT (11U) -/*! FLEXSPI - Enables the clock for FlexSPI - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_FLEXSPI(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_FLEXSPI_SHIFT)) & SYSCON_AHBCLKCTRL0_FLEXSPI_MASK) - -#define SYSCON_AHBCLKCTRL0_MUX_MASK (0x1000U) -#define SYSCON_AHBCLKCTRL0_MUX_SHIFT (12U) -/*! MUX - Enables the clock for INPUTMUX - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_MUX(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_MUX_SHIFT)) & SYSCON_AHBCLKCTRL0_MUX_MASK) - -#define SYSCON_AHBCLKCTRL0_PORT0_MASK (0x2000U) -#define SYSCON_AHBCLKCTRL0_PORT0_SHIFT (13U) -/*! PORT0 - Enables the clock for PORT0 controller - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_PORT0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_PORT0_SHIFT)) & SYSCON_AHBCLKCTRL0_PORT0_MASK) - -#define SYSCON_AHBCLKCTRL0_PORT1_MASK (0x4000U) -#define SYSCON_AHBCLKCTRL0_PORT1_SHIFT (14U) -/*! PORT1 - Enables the clock for PORT1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_PORT1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_PORT1_SHIFT)) & SYSCON_AHBCLKCTRL0_PORT1_MASK) - -#define SYSCON_AHBCLKCTRL0_PORT2_MASK (0x8000U) -#define SYSCON_AHBCLKCTRL0_PORT2_SHIFT (15U) -/*! PORT2 - Enables the clock for PORT2 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_PORT2(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_PORT2_SHIFT)) & SYSCON_AHBCLKCTRL0_PORT2_MASK) - -#define SYSCON_AHBCLKCTRL0_PORT3_MASK (0x10000U) -#define SYSCON_AHBCLKCTRL0_PORT3_SHIFT (16U) -/*! PORT3 - Enables the clock for PORT3 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_PORT3(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_PORT3_SHIFT)) & SYSCON_AHBCLKCTRL0_PORT3_MASK) - -#define SYSCON_AHBCLKCTRL0_PORT4_MASK (0x20000U) -#define SYSCON_AHBCLKCTRL0_PORT4_SHIFT (17U) -/*! PORT4 - Enables the clock for PORT4 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_PORT4(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_PORT4_SHIFT)) & SYSCON_AHBCLKCTRL0_PORT4_MASK) - -#define SYSCON_AHBCLKCTRL0_GPIO0_MASK (0x80000U) -#define SYSCON_AHBCLKCTRL0_GPIO0_SHIFT (19U) -/*! GPIO0 - Enables the clock for GPIO0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_GPIO0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_GPIO0_SHIFT)) & SYSCON_AHBCLKCTRL0_GPIO0_MASK) - -#define SYSCON_AHBCLKCTRL0_GPIO1_MASK (0x100000U) -#define SYSCON_AHBCLKCTRL0_GPIO1_SHIFT (20U) -/*! GPIO1 - Enables the clock for GPIO1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_GPIO1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_GPIO1_SHIFT)) & SYSCON_AHBCLKCTRL0_GPIO1_MASK) - -#define SYSCON_AHBCLKCTRL0_GPIO2_MASK (0x200000U) -#define SYSCON_AHBCLKCTRL0_GPIO2_SHIFT (21U) -/*! GPIO2 - Enables the clock for GPIO2 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_GPIO2(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_GPIO2_SHIFT)) & SYSCON_AHBCLKCTRL0_GPIO2_MASK) - -#define SYSCON_AHBCLKCTRL0_GPIO3_MASK (0x400000U) -#define SYSCON_AHBCLKCTRL0_GPIO3_SHIFT (22U) -/*! GPIO3 - Enables the clock for GPIO3 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_GPIO3(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_GPIO3_SHIFT)) & SYSCON_AHBCLKCTRL0_GPIO3_MASK) - -#define SYSCON_AHBCLKCTRL0_GPIO4_MASK (0x800000U) -#define SYSCON_AHBCLKCTRL0_GPIO4_SHIFT (23U) -/*! GPIO4 - Enables the clock for GPIO4 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_GPIO4(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_GPIO4_SHIFT)) & SYSCON_AHBCLKCTRL0_GPIO4_MASK) - -#define SYSCON_AHBCLKCTRL0_PINT_MASK (0x2000000U) -#define SYSCON_AHBCLKCTRL0_PINT_SHIFT (25U) -/*! PINT - Enables the clock for PINT - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_PINT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_PINT_SHIFT)) & SYSCON_AHBCLKCTRL0_PINT_MASK) - -#define SYSCON_AHBCLKCTRL0_DMA0_MASK (0x4000000U) -#define SYSCON_AHBCLKCTRL0_DMA0_SHIFT (26U) -/*! DMA0 - Enables the clock for DMA0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_DMA0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_DMA0_SHIFT)) & SYSCON_AHBCLKCTRL0_DMA0_MASK) - -#define SYSCON_AHBCLKCTRL0_CRC_MASK (0x8000000U) -#define SYSCON_AHBCLKCTRL0_CRC_SHIFT (27U) -/*! CRC - Enables the clock for CRC - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_CRC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_CRC_SHIFT)) & SYSCON_AHBCLKCTRL0_CRC_MASK) - -#define SYSCON_AHBCLKCTRL0_WWDT0_MASK (0x10000000U) -#define SYSCON_AHBCLKCTRL0_WWDT0_SHIFT (28U) -/*! WWDT0 - Enables the clock for WWDT0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_WWDT0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_WWDT0_SHIFT)) & SYSCON_AHBCLKCTRL0_WWDT0_MASK) - -#define SYSCON_AHBCLKCTRL0_WWDT1_MASK (0x20000000U) -#define SYSCON_AHBCLKCTRL0_WWDT1_SHIFT (29U) -/*! WWDT1 - Enables the clock for WWDT1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_WWDT1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_WWDT1_SHIFT)) & SYSCON_AHBCLKCTRL0_WWDT1_MASK) - -#define SYSCON_AHBCLKCTRL0_MAILBOX_MASK (0x80000000U) -#define SYSCON_AHBCLKCTRL0_MAILBOX_SHIFT (31U) -/*! MAILBOX - Enables the clock for the Inter CPU communication Mailbox. - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_MAILBOX(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_MAILBOX_SHIFT)) & SYSCON_AHBCLKCTRL0_MAILBOX_MASK) -/*! @} */ - -/*! @name AHBCLKCTRL1 - AHB Clock Control 1 */ -/*! @{ */ - -#define SYSCON_AHBCLKCTRL1_MRT_MASK (0x1U) -#define SYSCON_AHBCLKCTRL1_MRT_SHIFT (0U) -/*! MRT - Enables the clock for MRT - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_MRT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_MRT_SHIFT)) & SYSCON_AHBCLKCTRL1_MRT_MASK) - -#define SYSCON_AHBCLKCTRL1_OSTIMER_MASK (0x2U) -#define SYSCON_AHBCLKCTRL1_OSTIMER_SHIFT (1U) -/*! OSTIMER - Enables the clock for the OS Event Timer - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_OSTIMER(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_OSTIMER_SHIFT)) & SYSCON_AHBCLKCTRL1_OSTIMER_MASK) - -#define SYSCON_AHBCLKCTRL1_SCT_MASK (0x4U) -#define SYSCON_AHBCLKCTRL1_SCT_SHIFT (2U) -/*! SCT - Enables the clock for SCT - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_SCT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_SCT_SHIFT)) & SYSCON_AHBCLKCTRL1_SCT_MASK) - -#define SYSCON_AHBCLKCTRL1_ADC0_MASK (0x8U) -#define SYSCON_AHBCLKCTRL1_ADC0_SHIFT (3U) -/*! ADC0 - Enables the clock for ADC0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_ADC0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_ADC0_SHIFT)) & SYSCON_AHBCLKCTRL1_ADC0_MASK) - -#define SYSCON_AHBCLKCTRL1_ADC1_MASK (0x10U) -#define SYSCON_AHBCLKCTRL1_ADC1_SHIFT (4U) -/*! ADC1 - Enables the clock for ADC1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_ADC1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_ADC1_SHIFT)) & SYSCON_AHBCLKCTRL1_ADC1_MASK) - -#define SYSCON_AHBCLKCTRL1_DAC0_MASK (0x20U) -#define SYSCON_AHBCLKCTRL1_DAC0_SHIFT (5U) -/*! DAC0 - Enables the clock for DAC0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_DAC0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_DAC0_SHIFT)) & SYSCON_AHBCLKCTRL1_DAC0_MASK) - -#define SYSCON_AHBCLKCTRL1_RTC_MASK (0x40U) -#define SYSCON_AHBCLKCTRL1_RTC_SHIFT (6U) -/*! RTC - Enables the clock for RTC - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_RTC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_RTC_SHIFT)) & SYSCON_AHBCLKCTRL1_RTC_MASK) - -#define SYSCON_AHBCLKCTRL1_EVSIM0_MASK (0x100U) -#define SYSCON_AHBCLKCTRL1_EVSIM0_SHIFT (8U) -/*! EVSIM0 - Enables the clock for EVSIM0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_EVSIM0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_EVSIM0_SHIFT)) & SYSCON_AHBCLKCTRL1_EVSIM0_MASK) - -#define SYSCON_AHBCLKCTRL1_EVSIM1_MASK (0x200U) -#define SYSCON_AHBCLKCTRL1_EVSIM1_SHIFT (9U) -/*! EVSIM1 - Enables the clock for EVSIM1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_EVSIM1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_EVSIM1_SHIFT)) & SYSCON_AHBCLKCTRL1_EVSIM1_MASK) - -#define SYSCON_AHBCLKCTRL1_UTICK_MASK (0x400U) -#define SYSCON_AHBCLKCTRL1_UTICK_SHIFT (10U) -/*! UTICK - Enables the clock for UTICK - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_UTICK(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_UTICK_SHIFT)) & SYSCON_AHBCLKCTRL1_UTICK_MASK) - -#define SYSCON_AHBCLKCTRL1_FC0_MASK (0x800U) -#define SYSCON_AHBCLKCTRL1_FC0_SHIFT (11U) -/*! FC0 - Enables the clock for LP_FLEXCOMM0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_FC0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_FC0_SHIFT)) & SYSCON_AHBCLKCTRL1_FC0_MASK) - -#define SYSCON_AHBCLKCTRL1_FC1_MASK (0x1000U) -#define SYSCON_AHBCLKCTRL1_FC1_SHIFT (12U) -/*! FC1 - Enables the clock for LP_FLEXCOMM1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_FC1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_FC1_SHIFT)) & SYSCON_AHBCLKCTRL1_FC1_MASK) - -#define SYSCON_AHBCLKCTRL1_FC2_MASK (0x2000U) -#define SYSCON_AHBCLKCTRL1_FC2_SHIFT (13U) -/*! FC2 - Enables the clock for LP_FLEXCOMM2 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_FC2(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_FC2_SHIFT)) & SYSCON_AHBCLKCTRL1_FC2_MASK) - -#define SYSCON_AHBCLKCTRL1_FC3_MASK (0x4000U) -#define SYSCON_AHBCLKCTRL1_FC3_SHIFT (14U) -/*! FC3 - Enables the clock for LP_FLEXCOMM3 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_FC3(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_FC3_SHIFT)) & SYSCON_AHBCLKCTRL1_FC3_MASK) - -#define SYSCON_AHBCLKCTRL1_FC4_MASK (0x8000U) -#define SYSCON_AHBCLKCTRL1_FC4_SHIFT (15U) -/*! FC4 - Enables the clock for LP_FLEXCOMM4 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_FC4(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_FC4_SHIFT)) & SYSCON_AHBCLKCTRL1_FC4_MASK) - -#define SYSCON_AHBCLKCTRL1_FC5_MASK (0x10000U) -#define SYSCON_AHBCLKCTRL1_FC5_SHIFT (16U) -/*! FC5 - Enables the clock for LP_FLEXCOMM5 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_FC5(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_FC5_SHIFT)) & SYSCON_AHBCLKCTRL1_FC5_MASK) - -#define SYSCON_AHBCLKCTRL1_FC6_MASK (0x20000U) -#define SYSCON_AHBCLKCTRL1_FC6_SHIFT (17U) -/*! FC6 - Enables the clock for LP_FLEXCOMM6 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_FC6(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_FC6_SHIFT)) & SYSCON_AHBCLKCTRL1_FC6_MASK) - -#define SYSCON_AHBCLKCTRL1_FC7_MASK (0x40000U) -#define SYSCON_AHBCLKCTRL1_FC7_SHIFT (18U) -/*! FC7 - Enables the clock for LP_FLEXCOMM7 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_FC7(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_FC7_SHIFT)) & SYSCON_AHBCLKCTRL1_FC7_MASK) - -#define SYSCON_AHBCLKCTRL1_FC8_MASK (0x80000U) -#define SYSCON_AHBCLKCTRL1_FC8_SHIFT (19U) -/*! FC8 - Enables the clock for LP_FLEXCOMM8 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_FC8(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_FC8_SHIFT)) & SYSCON_AHBCLKCTRL1_FC8_MASK) - -#define SYSCON_AHBCLKCTRL1_FC9_MASK (0x100000U) -#define SYSCON_AHBCLKCTRL1_FC9_SHIFT (20U) -/*! FC9 - Enables the clock for LP_FLEXCOMM9 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_FC9(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_FC9_SHIFT)) & SYSCON_AHBCLKCTRL1_FC9_MASK) - -#define SYSCON_AHBCLKCTRL1_MICFIL_MASK (0x200000U) -#define SYSCON_AHBCLKCTRL1_MICFIL_SHIFT (21U) -/*! MICFIL - Enables the clock for MICFIL - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_MICFIL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_MICFIL_SHIFT)) & SYSCON_AHBCLKCTRL1_MICFIL_MASK) - -#define SYSCON_AHBCLKCTRL1_TIMER2_MASK (0x400000U) -#define SYSCON_AHBCLKCTRL1_TIMER2_SHIFT (22U) -/*! TIMER2 - Enables the clock for CTIMER2 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_TIMER2(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_TIMER2_SHIFT)) & SYSCON_AHBCLKCTRL1_TIMER2_MASK) - -#define SYSCON_AHBCLKCTRL1_USB0_FS_DCD_MASK (0x1000000U) -#define SYSCON_AHBCLKCTRL1_USB0_FS_DCD_SHIFT (24U) -/*! USB0_FS_DCD - Enables the clock for USB-FS DCD - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_USB0_FS_DCD(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_USB0_FS_DCD_SHIFT)) & SYSCON_AHBCLKCTRL1_USB0_FS_DCD_MASK) - -#define SYSCON_AHBCLKCTRL1_USB0_FS_MASK (0x2000000U) -#define SYSCON_AHBCLKCTRL1_USB0_FS_SHIFT (25U) -/*! USB0_FS - Enables the clock for USB-FS - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_USB0_FS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_USB0_FS_SHIFT)) & SYSCON_AHBCLKCTRL1_USB0_FS_MASK) - -#define SYSCON_AHBCLKCTRL1_TIMER0_MASK (0x4000000U) -#define SYSCON_AHBCLKCTRL1_TIMER0_SHIFT (26U) -/*! TIMER0 - Enables the clock for CTIMER0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_TIMER0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_TIMER0_SHIFT)) & SYSCON_AHBCLKCTRL1_TIMER0_MASK) - -#define SYSCON_AHBCLKCTRL1_TIMER1_MASK (0x8000000U) -#define SYSCON_AHBCLKCTRL1_TIMER1_SHIFT (27U) -/*! TIMER1 - Enables the clock for CTIMER1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_TIMER1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_TIMER1_SHIFT)) & SYSCON_AHBCLKCTRL1_TIMER1_MASK) - -#define SYSCON_AHBCLKCTRL1_PKC_RAM_MASK (0x20000000U) -#define SYSCON_AHBCLKCTRL1_PKC_RAM_SHIFT (29U) -/*! PKC_RAM - Enables the clock for PKC RAM - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_PKC_RAM(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_PKC_RAM_SHIFT)) & SYSCON_AHBCLKCTRL1_PKC_RAM_MASK) - -#define SYSCON_AHBCLKCTRL1_SmartDMA_MASK (0x80000000U) -#define SYSCON_AHBCLKCTRL1_SmartDMA_SHIFT (31U) -/*! SmartDMA - Enables the clock for SmartDMA - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_SmartDMA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_SmartDMA_SHIFT)) & SYSCON_AHBCLKCTRL1_SmartDMA_MASK) -/*! @} */ - -/*! @name AHBCLKCTRL2 - AHB Clock Control 2 */ -/*! @{ */ - -#define SYSCON_AHBCLKCTRL2_DMA1_MASK (0x2U) -#define SYSCON_AHBCLKCTRL2_DMA1_SHIFT (1U) -/*! DMA1 - Enables the clock for DMA1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_DMA1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_DMA1_SHIFT)) & SYSCON_AHBCLKCTRL2_DMA1_MASK) - -#define SYSCON_AHBCLKCTRL2_ENET_MASK (0x4U) -#define SYSCON_AHBCLKCTRL2_ENET_SHIFT (2U) -/*! ENET - Enables the clock for Ethernet - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_ENET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_ENET_SHIFT)) & SYSCON_AHBCLKCTRL2_ENET_MASK) - -#define SYSCON_AHBCLKCTRL2_uSDHC_MASK (0x8U) -#define SYSCON_AHBCLKCTRL2_uSDHC_SHIFT (3U) -/*! uSDHC - Enables the clock for uSDHC - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_uSDHC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_uSDHC_SHIFT)) & SYSCON_AHBCLKCTRL2_uSDHC_MASK) - -#define SYSCON_AHBCLKCTRL2_FLEXIO_MASK (0x10U) -#define SYSCON_AHBCLKCTRL2_FLEXIO_SHIFT (4U) -/*! FLEXIO - Enables the clock for Flexio - * 0b1..Enable clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_FLEXIO(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_FLEXIO_SHIFT)) & SYSCON_AHBCLKCTRL2_FLEXIO_MASK) - -#define SYSCON_AHBCLKCTRL2_SAI0_MASK (0x20U) -#define SYSCON_AHBCLKCTRL2_SAI0_SHIFT (5U) -/*! SAI0 - Enables the clock for SAI0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_SAI0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_SAI0_SHIFT)) & SYSCON_AHBCLKCTRL2_SAI0_MASK) - -#define SYSCON_AHBCLKCTRL2_SAI1_MASK (0x40U) -#define SYSCON_AHBCLKCTRL2_SAI1_SHIFT (6U) -/*! SAI1 - Enables the clock for SAI1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_SAI1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_SAI1_SHIFT)) & SYSCON_AHBCLKCTRL2_SAI1_MASK) - -#define SYSCON_AHBCLKCTRL2_TRO_MASK (0x80U) -#define SYSCON_AHBCLKCTRL2_TRO_SHIFT (7U) -/*! TRO - Enables the clock for TRO - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_TRO(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_TRO_SHIFT)) & SYSCON_AHBCLKCTRL2_TRO_MASK) - -#define SYSCON_AHBCLKCTRL2_FREQME_MASK (0x100U) -#define SYSCON_AHBCLKCTRL2_FREQME_SHIFT (8U) -/*! FREQME - Enables the clock for the Frequency meter - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_FREQME(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_FREQME_SHIFT)) & SYSCON_AHBCLKCTRL2_FREQME_MASK) - -#define SYSCON_AHBCLKCTRL2_TRNG_MASK (0x2000U) -#define SYSCON_AHBCLKCTRL2_TRNG_SHIFT (13U) -/*! TRNG - Enables the clock for TRNG - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_TRNG(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_TRNG_SHIFT)) & SYSCON_AHBCLKCTRL2_TRNG_MASK) - -#define SYSCON_AHBCLKCTRL2_FLEXCAN0_MASK (0x4000U) -#define SYSCON_AHBCLKCTRL2_FLEXCAN0_SHIFT (14U) -/*! FLEXCAN0 - Enables the clock for FLEXCAN0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_FLEXCAN0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_FLEXCAN0_SHIFT)) & SYSCON_AHBCLKCTRL2_FLEXCAN0_MASK) - -#define SYSCON_AHBCLKCTRL2_FLEXCAN1_MASK (0x8000U) -#define SYSCON_AHBCLKCTRL2_FLEXCAN1_SHIFT (15U) -/*! FLEXCAN1 - Enables the clock for FLEXCAN1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_FLEXCAN1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_FLEXCAN1_SHIFT)) & SYSCON_AHBCLKCTRL2_FLEXCAN1_MASK) - -#define SYSCON_AHBCLKCTRL2_USB_HS_MASK (0x10000U) -#define SYSCON_AHBCLKCTRL2_USB_HS_SHIFT (16U) -/*! USB_HS - Enables the clock for USB HS - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_USB_HS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_USB_HS_SHIFT)) & SYSCON_AHBCLKCTRL2_USB_HS_MASK) - -#define SYSCON_AHBCLKCTRL2_USB_HS_PHY_MASK (0x20000U) -#define SYSCON_AHBCLKCTRL2_USB_HS_PHY_SHIFT (17U) -/*! USB_HS_PHY - Enables the clock for USB HS PHY - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_USB_HS_PHY(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_USB_HS_PHY_SHIFT)) & SYSCON_AHBCLKCTRL2_USB_HS_PHY_MASK) - -#define SYSCON_AHBCLKCTRL2_ELS_MASK (0x40000U) -#define SYSCON_AHBCLKCTRL2_ELS_SHIFT (18U) -/*! ELS - Enables the clock for ELS - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_ELS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_ELS_SHIFT)) & SYSCON_AHBCLKCTRL2_ELS_MASK) - -#define SYSCON_AHBCLKCTRL2_PQ_MASK (0x80000U) -#define SYSCON_AHBCLKCTRL2_PQ_SHIFT (19U) -/*! PQ - Enables the clock for Powerquad - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_PQ(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_PQ_SHIFT)) & SYSCON_AHBCLKCTRL2_PQ_MASK) - -#define SYSCON_AHBCLKCTRL2_PLU_LUT_MASK (0x100000U) -#define SYSCON_AHBCLKCTRL2_PLU_LUT_SHIFT (20U) -/*! PLU_LUT - Enables the clock for PLU_LUT - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_PLU_LUT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_PLU_LUT_SHIFT)) & SYSCON_AHBCLKCTRL2_PLU_LUT_MASK) - -#define SYSCON_AHBCLKCTRL2_TIMER3_MASK (0x200000U) -#define SYSCON_AHBCLKCTRL2_TIMER3_SHIFT (21U) -/*! TIMER3 - Enables the clock for CTIMER3 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_TIMER3(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_TIMER3_SHIFT)) & SYSCON_AHBCLKCTRL2_TIMER3_MASK) - -#define SYSCON_AHBCLKCTRL2_TIMER4_MASK (0x400000U) -#define SYSCON_AHBCLKCTRL2_TIMER4_SHIFT (22U) -/*! TIMER4 - Enables the clock for CTIMER4 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_TIMER4(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_TIMER4_SHIFT)) & SYSCON_AHBCLKCTRL2_TIMER4_MASK) - -#define SYSCON_AHBCLKCTRL2_PUF_MASK (0x800000U) -#define SYSCON_AHBCLKCTRL2_PUF_SHIFT (23U) -/*! PUF - Enables the clock for PUF - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_PUF(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_PUF_SHIFT)) & SYSCON_AHBCLKCTRL2_PUF_MASK) - -#define SYSCON_AHBCLKCTRL2_PKC_MASK (0x1000000U) -#define SYSCON_AHBCLKCTRL2_PKC_SHIFT (24U) -/*! PKC - Enables the clock for PKC - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_PKC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_PKC_SHIFT)) & SYSCON_AHBCLKCTRL2_PKC_MASK) - -#define SYSCON_AHBCLKCTRL2_SCG_MASK (0x4000000U) -#define SYSCON_AHBCLKCTRL2_SCG_SHIFT (26U) -/*! SCG - Enables the clock for SCG - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_SCG(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_SCG_SHIFT)) & SYSCON_AHBCLKCTRL2_SCG_MASK) - -#define SYSCON_AHBCLKCTRL2_GDET_MASK (0x20000000U) -#define SYSCON_AHBCLKCTRL2_GDET_SHIFT (29U) -/*! GDET - Enables the clock for GDET0 and GDET1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_GDET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_GDET_SHIFT)) & SYSCON_AHBCLKCTRL2_GDET_MASK) - -#define SYSCON_AHBCLKCTRL2_SM3_MASK (0x40000000U) -#define SYSCON_AHBCLKCTRL2_SM3_SHIFT (30U) -/*! SM3 - Enables the clock for SM3 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_SM3(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_SM3_SHIFT)) & SYSCON_AHBCLKCTRL2_SM3_MASK) -/*! @} */ - -/*! @name AHBCLKCTRL3 - AHB Clock Control 3 */ -/*! @{ */ - -#define SYSCON_AHBCLKCTRL3_I3C0_MASK (0x1U) -#define SYSCON_AHBCLKCTRL3_I3C0_SHIFT (0U) -/*! I3C0 - Enables the clock for I3C0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_I3C0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_I3C0_SHIFT)) & SYSCON_AHBCLKCTRL3_I3C0_MASK) - -#define SYSCON_AHBCLKCTRL3_I3C1_MASK (0x2U) -#define SYSCON_AHBCLKCTRL3_I3C1_SHIFT (1U) -/*! I3C1 - Enables the clock for I3C1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_I3C1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_I3C1_SHIFT)) & SYSCON_AHBCLKCTRL3_I3C1_MASK) - -#define SYSCON_AHBCLKCTRL3_SINC_MASK (0x4U) -#define SYSCON_AHBCLKCTRL3_SINC_SHIFT (2U) -/*! SINC - Enables the clock for SINC - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_SINC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_SINC_SHIFT)) & SYSCON_AHBCLKCTRL3_SINC_MASK) - -#define SYSCON_AHBCLKCTRL3_COOLFLUX_MASK (0x8U) -#define SYSCON_AHBCLKCTRL3_COOLFLUX_SHIFT (3U) -/*! COOLFLUX - Enables the clock for CoolFlux - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_COOLFLUX(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_COOLFLUX_SHIFT)) & SYSCON_AHBCLKCTRL3_COOLFLUX_MASK) - -#define SYSCON_AHBCLKCTRL3_QDC0_MASK (0x10U) -#define SYSCON_AHBCLKCTRL3_QDC0_SHIFT (4U) -/*! QDC0 - Enables the clock for QDC0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_QDC0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_QDC0_SHIFT)) & SYSCON_AHBCLKCTRL3_QDC0_MASK) - -#define SYSCON_AHBCLKCTRL3_QDC1_MASK (0x20U) -#define SYSCON_AHBCLKCTRL3_QDC1_SHIFT (5U) -/*! QDC1 - Enables the clock for QDC1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_QDC1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_QDC1_SHIFT)) & SYSCON_AHBCLKCTRL3_QDC1_MASK) - -#define SYSCON_AHBCLKCTRL3_PWM0_MASK (0x40U) -#define SYSCON_AHBCLKCTRL3_PWM0_SHIFT (6U) -/*! PWM0 - Enables the clock for PWM0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_PWM0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_PWM0_SHIFT)) & SYSCON_AHBCLKCTRL3_PWM0_MASK) - -#define SYSCON_AHBCLKCTRL3_PWM1_MASK (0x80U) -#define SYSCON_AHBCLKCTRL3_PWM1_SHIFT (7U) -/*! PWM1 - Enables the clock for PWM1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_PWM1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_PWM1_SHIFT)) & SYSCON_AHBCLKCTRL3_PWM1_MASK) - -#define SYSCON_AHBCLKCTRL3_EVTG_MASK (0x100U) -#define SYSCON_AHBCLKCTRL3_EVTG_SHIFT (8U) -/*! EVTG - Enables the clock for EVTG - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_EVTG(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_EVTG_SHIFT)) & SYSCON_AHBCLKCTRL3_EVTG_MASK) - -#define SYSCON_AHBCLKCTRL3_DAC1_MASK (0x800U) -#define SYSCON_AHBCLKCTRL3_DAC1_SHIFT (11U) -/*! DAC1 - Enables the clock for DAC1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_DAC1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_DAC1_SHIFT)) & SYSCON_AHBCLKCTRL3_DAC1_MASK) - -#define SYSCON_AHBCLKCTRL3_DAC2_MASK (0x1000U) -#define SYSCON_AHBCLKCTRL3_DAC2_SHIFT (12U) -/*! DAC2 - Enables the clock for DAC2 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_DAC2(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_DAC2_SHIFT)) & SYSCON_AHBCLKCTRL3_DAC2_MASK) - -#define SYSCON_AHBCLKCTRL3_OPAMP0_MASK (0x2000U) -#define SYSCON_AHBCLKCTRL3_OPAMP0_SHIFT (13U) -/*! OPAMP0 - Enables the clock for OPAMP0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_OPAMP0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_OPAMP0_SHIFT)) & SYSCON_AHBCLKCTRL3_OPAMP0_MASK) - -#define SYSCON_AHBCLKCTRL3_OPAMP1_MASK (0x4000U) -#define SYSCON_AHBCLKCTRL3_OPAMP1_SHIFT (14U) -/*! OPAMP1 - Enables the clock for OPAMP1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_OPAMP1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_OPAMP1_SHIFT)) & SYSCON_AHBCLKCTRL3_OPAMP1_MASK) - -#define SYSCON_AHBCLKCTRL3_OPAMP2_MASK (0x8000U) -#define SYSCON_AHBCLKCTRL3_OPAMP2_SHIFT (15U) -/*! OPAMP2 - Enables the clock for OPAMP2 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_OPAMP2(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_OPAMP2_SHIFT)) & SYSCON_AHBCLKCTRL3_OPAMP2_MASK) - -#define SYSCON_AHBCLKCTRL3_CMP2_MASK (0x40000U) -#define SYSCON_AHBCLKCTRL3_CMP2_SHIFT (18U) -/*! CMP2 - Enables the clock for CMP2 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_CMP2(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_CMP2_SHIFT)) & SYSCON_AHBCLKCTRL3_CMP2_MASK) - -#define SYSCON_AHBCLKCTRL3_VREF_MASK (0x80000U) -#define SYSCON_AHBCLKCTRL3_VREF_SHIFT (19U) -/*! VREF - Enables the clock for VREF - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_VREF(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_VREF_SHIFT)) & SYSCON_AHBCLKCTRL3_VREF_MASK) - -#define SYSCON_AHBCLKCTRL3_COOLFLUX_APB_MASK (0x100000U) -#define SYSCON_AHBCLKCTRL3_COOLFLUX_APB_SHIFT (20U) -/*! COOLFLUX_APB - Enables the clock for CoolFlux APB - * 0b1..Enables clock (CoolFlux needs to be properly programmed before the clock enabled.) - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_COOLFLUX_APB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_COOLFLUX_APB_SHIFT)) & SYSCON_AHBCLKCTRL3_COOLFLUX_APB_MASK) - -#define SYSCON_AHBCLKCTRL3_NPU_MASK (0x200000U) -#define SYSCON_AHBCLKCTRL3_NPU_SHIFT (21U) -/*! NPU - Enables the clock for NPU - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_NPU(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_NPU_SHIFT)) & SYSCON_AHBCLKCTRL3_NPU_MASK) - -#define SYSCON_AHBCLKCTRL3_TSI_MASK (0x400000U) -#define SYSCON_AHBCLKCTRL3_TSI_SHIFT (22U) -/*! TSI - Enables the clock for TSI - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_TSI(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_TSI_SHIFT)) & SYSCON_AHBCLKCTRL3_TSI_MASK) - -#define SYSCON_AHBCLKCTRL3_EWM_MASK (0x800000U) -#define SYSCON_AHBCLKCTRL3_EWM_SHIFT (23U) -/*! EWM - Enables the clock for EWM - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_EWM(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_EWM_SHIFT)) & SYSCON_AHBCLKCTRL3_EWM_MASK) - -#define SYSCON_AHBCLKCTRL3_EIM_MASK (0x1000000U) -#define SYSCON_AHBCLKCTRL3_EIM_SHIFT (24U) -/*! EIM - Enables the clock for EIM - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_EIM(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_EIM_SHIFT)) & SYSCON_AHBCLKCTRL3_EIM_MASK) - -#define SYSCON_AHBCLKCTRL3_ERM_MASK (0x2000000U) -#define SYSCON_AHBCLKCTRL3_ERM_SHIFT (25U) -/*! ERM - Enables the clock for ERM - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_ERM(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_ERM_SHIFT)) & SYSCON_AHBCLKCTRL3_ERM_MASK) - -#define SYSCON_AHBCLKCTRL3_INTM_MASK (0x4000000U) -#define SYSCON_AHBCLKCTRL3_INTM_SHIFT (26U) -/*! INTM - Enables the clock for INTM - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_INTM(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_INTM_SHIFT)) & SYSCON_AHBCLKCTRL3_INTM_MASK) - -#define SYSCON_AHBCLKCTRL3_SEMA42_MASK (0x8000000U) -#define SYSCON_AHBCLKCTRL3_SEMA42_SHIFT (27U) -/*! SEMA42 - Enables the clock for Semaphore - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_SEMA42(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_SEMA42_SHIFT)) & SYSCON_AHBCLKCTRL3_SEMA42_MASK) -/*! @} */ - -/*! @name AHBCLKCTRLSET - AHB Clock Control Set */ -/*! @{ */ - -#define SYSCON_AHBCLKCTRLSET_DATA_MASK (0xFFFFFFFFU) -#define SYSCON_AHBCLKCTRLSET_DATA_SHIFT (0U) -/*! DATA - Data array value */ -#define SYSCON_AHBCLKCTRLSET_DATA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRLSET_DATA_SHIFT)) & SYSCON_AHBCLKCTRLSET_DATA_MASK) -/*! @} */ - -/* The count of SYSCON_AHBCLKCTRLSET */ -#define SYSCON_AHBCLKCTRLSET_COUNT (4U) - -/*! @name AHBCLKCTRLCLR - AHB Clock Control Clear */ -/*! @{ */ - -#define SYSCON_AHBCLKCTRLCLR_DATA_MASK (0xFFFFFFFFU) -#define SYSCON_AHBCLKCTRLCLR_DATA_SHIFT (0U) -/*! DATA - Data array value */ -#define SYSCON_AHBCLKCTRLCLR_DATA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRLCLR_DATA_SHIFT)) & SYSCON_AHBCLKCTRLCLR_DATA_MASK) -/*! @} */ - -/* The count of SYSCON_AHBCLKCTRLCLR */ -#define SYSCON_AHBCLKCTRLCLR_COUNT (4U) - -/*! @name SYSTICKCLKSEL0 - CPU0 System Tick Timer Source Select */ -/*! @{ */ - -#define SYSCON_SYSTICKCLKSEL0_SEL_MASK (0x7U) -#define SYSCON_SYSTICKCLKSEL0_SEL_SHIFT (0U) -/*! SEL - Selects the System Tick Timer for CPU0 source - * 0b000..SYSTICKCLKDIV0 output - * 0b001..Clk 1 MHz clock - * 0b010..LP Oscillator clock - * 0b011..No clock - * 0b100..No clock - * 0b101..No clock - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_SYSTICKCLKSEL0_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SYSTICKCLKSEL0_SEL_SHIFT)) & SYSCON_SYSTICKCLKSEL0_SEL_MASK) -/*! @} */ - -/*! @name SYSTICKCLKSEL1 - CPU1 System Tick Timer Source Select */ -/*! @{ */ - -#define SYSCON_SYSTICKCLKSEL1_SEL_MASK (0x7U) -#define SYSCON_SYSTICKCLKSEL1_SEL_SHIFT (0U) -/*! SEL - Selects the System Tick Timer for CPU1 source. - * 0b000..SYSTICKCLKDIV1 output - * 0b001..Clk 1 MHz clock - * 0b010..LP Oscillator clock - * 0b011..No clock - * 0b100..No clock - * 0b101..No clock - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_SYSTICKCLKSEL1_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SYSTICKCLKSEL1_SEL_SHIFT)) & SYSCON_SYSTICKCLKSEL1_SEL_MASK) -/*! @} */ - -/*! @name TRACECLKSEL - Trace Clock Source Select */ -/*! @{ */ - -#define SYSCON_TRACECLKSEL_SEL_MASK (0x7U) -#define SYSCON_TRACECLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the trace clock source. - * 0b000..TRACECLKDIV output - * 0b001..Clk 1 MHz clock - * 0b010..LP Oscillator clock - * 0b011..No clock - * 0b100..No clock - * 0b101..No clock - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_TRACECLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_TRACECLKSEL_SEL_SHIFT)) & SYSCON_TRACECLKSEL_SEL_MASK) -/*! @} */ - -/*! @name CTIMERCLKSEL - CTIMER Clock Source Select */ -/*! @{ */ - -#define SYSCON_CTIMERCLKSEL_SEL_MASK (0xFU) -#define SYSCON_CTIMERCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the CTIMER clock source. - * 0b0000..FRO_1M clock - * 0b0001..PLL0 clock - * 0b0010..PLL1_clk0 clock - * 0b0011..FRO_HF clock - * 0b0100..FRO 12MHz clock - * 0b0101..SAI0 MCLK IN clock - * 0b0110..LP Oscillator clock - * 0b0111..No clock - * 0b1000..SAI1 MCLK IN clock - * 0b1001..SAI0 TX_BCLK clock - * 0b1010..SAI0 RX_BCLK clock - * 0b1011..SAI1 TX_BCLK clock - * 0b1100..SAI1 RX_BCLK clock - * 0b1101..No clock - * 0b1110..No clock - * 0b1111..No clock - */ -#define SYSCON_CTIMERCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERCLKSEL_SEL_SHIFT)) & SYSCON_CTIMERCLKSEL_SEL_MASK) -/*! @} */ - -/* The count of SYSCON_CTIMERCLKSEL */ -#define SYSCON_CTIMERCLKSEL_COUNT (5U) - -/*! @name CLKOUTSEL - CLKOUT Clock Source Select */ -/*! @{ */ - -#define SYSCON_CLKOUTSEL_SEL_MASK (0xFU) -#define SYSCON_CLKOUTSEL_SEL_SHIFT (0U) -/*! SEL - Selects the CLKOUT clock source. - * 0b0000..Main clock (main_clk) - * 0b0001..PLL0 clock (pll0_clk) - * 0b0010..CLKIN clock (clk_in) - * 0b0011..FRO_HF clock (fro_hf) - * 0b0100..FRO 12 MHz clock (fro_12m) - * 0b0101..PLL1_clk0 clock (pll1_clk) - * 0b0110..LP Oscillator clock (lp_osc) - * 0b0111..USB PLL clock (usb_pll_clk) - * 0b1000..No clock - * 0b1001..No clock - * 0b1010..No clock - * 0b1011..No clock - * 0b1100..No clock - * 0b1101..No clock - * 0b1110..No clock - * 0b1111..No clock - */ -#define SYSCON_CLKOUTSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLKOUTSEL_SEL_SHIFT)) & SYSCON_CLKOUTSEL_SEL_MASK) -/*! @} */ - -/*! @name ADC0CLKSEL - ADC0 Clock Source Select */ -/*! @{ */ - -#define SYSCON_ADC0CLKSEL_SEL_MASK (0x7U) -#define SYSCON_ADC0CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the ADC0 clock source. - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..FRO_HF clock - * 0b011..FRO 12 MHz clock - * 0b100..Clk_in - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_ADC0CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ADC0CLKSEL_SEL_SHIFT)) & SYSCON_ADC0CLKSEL_SEL_MASK) -/*! @} */ - -/*! @name USB0CLKSEL - USB-FS Clock Source Select */ -/*! @{ */ - -#define SYSCON_USB0CLKSEL_SEL_MASK (0x7U) -#define SYSCON_USB0CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the USB-FS clock source. - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..No clock - * 0b011..Clk 48 MHz clock - * 0b100..Clk_in - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_USB0CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_USB0CLKSEL_SEL_SHIFT)) & SYSCON_USB0CLKSEL_SEL_MASK) -/*! @} */ - -/*! @name FCCLKSEL - LP_FLEXCOMM Clock Source Select for Fractional Rate Divider */ -/*! @{ */ - -#define SYSCON_FCCLKSEL_SEL_MASK (0x7U) -#define SYSCON_FCCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the LP_FLEXCOMM clock source for Fractional Rate Divider. - * 0b000..No clock - * 0b001..PLL divided clock - * 0b010..FRO 12 MHz clock - * 0b011..fro_hf_div clock - * 0b100..clk_1m clock - * 0b101..USB PLL clock - * 0b110..LP Oscillator clock - * 0b111..No clock - */ -#define SYSCON_FCCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FCCLKSEL_SEL_SHIFT)) & SYSCON_FCCLKSEL_SEL_MASK) -/*! @} */ - -/* The count of SYSCON_FCCLKSEL */ -#define SYSCON_FCCLKSEL_COUNT (10U) - -/*! @name SCTCLKSEL - SCTimer/PWM Clock Source Select */ -/*! @{ */ - -#define SYSCON_SCTCLKSEL_SEL_MASK (0xFU) -#define SYSCON_SCTCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the SCTimer/PWM clock source. - * 0b0000..No clock - * 0b0001..PLL0 clock - * 0b0010..CLKIN clock - * 0b0011..FRO_HF clock - * 0b0100..PLL1_clk0 clock - * 0b0101..SAI0 MCLK_IN clock - * 0b0110..USB PLL clock - * 0b0111..No clock - * 0b1000..SAI1 MCLK_IN clock - * 0b1001..No clock - * 0b1010..No clock - * 0b1011..No clock - * 0b1100..No clock - * 0b1101..No clock - * 0b1110..No clock - * 0b1111..No clock - */ -#define SYSCON_SCTCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SCTCLKSEL_SEL_SHIFT)) & SYSCON_SCTCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name SYSTICKCLKDIV - CPU0 System Tick Timer Divider..CPU1 System Tick Timer Divider */ -/*! @{ */ - -#define SYSCON_SYSTICKCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_SYSTICKCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_SYSTICKCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SYSTICKCLKDIV_DIV_SHIFT)) & SYSCON_SYSTICKCLKDIV_DIV_MASK) - -#define SYSCON_SYSTICKCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_SYSTICKCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset. - * 0b0..Divider is not reset - */ -#define SYSCON_SYSTICKCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SYSTICKCLKDIV_RESET_SHIFT)) & SYSCON_SYSTICKCLKDIV_RESET_MASK) - -#define SYSCON_SYSTICKCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_SYSTICKCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_SYSTICKCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SYSTICKCLKDIV_HALT_SHIFT)) & SYSCON_SYSTICKCLKDIV_HALT_MASK) - -#define SYSCON_SYSTICKCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_SYSTICKCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_SYSTICKCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SYSTICKCLKDIV_UNSTAB_SHIFT)) & SYSCON_SYSTICKCLKDIV_UNSTAB_MASK) -/*! @} */ - -/* The count of SYSCON_SYSTICKCLKDIV */ -#define SYSCON_SYSTICKCLKDIV_COUNT (2U) - -/*! @name TRACECLKDIV - TRACE Clock Divider */ -/*! @{ */ - -#define SYSCON_TRACECLKDIV_DIV_MASK (0xFFU) -#define SYSCON_TRACECLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_TRACECLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_TRACECLKDIV_DIV_SHIFT)) & SYSCON_TRACECLKDIV_DIV_MASK) - -#define SYSCON_TRACECLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_TRACECLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_TRACECLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_TRACECLKDIV_RESET_SHIFT)) & SYSCON_TRACECLKDIV_RESET_MASK) - -#define SYSCON_TRACECLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_TRACECLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_TRACECLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_TRACECLKDIV_HALT_SHIFT)) & SYSCON_TRACECLKDIV_HALT_MASK) - -#define SYSCON_TRACECLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_TRACECLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_TRACECLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_TRACECLKDIV_UNSTAB_SHIFT)) & SYSCON_TRACECLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name TSICLKSEL - TSI Function Clock Source Select */ -/*! @{ */ - -#define SYSCON_TSICLKSEL_SEL_MASK (0x7U) -#define SYSCON_TSICLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the TSI function clock source. - * 0b000..No clock - * 0b001..No clock - * 0b010..clk_in - * 0b011..No clock - * 0b100..FRO_12Mhz clock - * 0b101..No clock - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_TSICLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_TSICLKSEL_SEL_SHIFT)) & SYSCON_TSICLKSEL_SEL_MASK) -/*! @} */ - -/*! @name SINCFILTCLKSEL - SINC FILTER Function Clock Source Select */ -/*! @{ */ - -#define SYSCON_SINCFILTCLKSEL_SEL_MASK (0x7U) -#define SYSCON_SINCFILTCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the SINC FILTER function clock source. - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..clk_in - * 0b011..FRO_HF clock - * 0b100..FRO_12Mhz clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_SINCFILTCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SINCFILTCLKSEL_SEL_SHIFT)) & SYSCON_SINCFILTCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name SLOWCLKDIV - SLOW_CLK Clock Divider */ -/*! @{ */ - -#define SYSCON_SLOWCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_SLOWCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_SLOWCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SLOWCLKDIV_RESET_SHIFT)) & SYSCON_SLOWCLKDIV_RESET_MASK) - -#define SYSCON_SLOWCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_SLOWCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_SLOWCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SLOWCLKDIV_HALT_SHIFT)) & SYSCON_SLOWCLKDIV_HALT_MASK) - -#define SYSCON_SLOWCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_SLOWCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_SLOWCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SLOWCLKDIV_UNSTAB_SHIFT)) & SYSCON_SLOWCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name TSICLKDIV - TSI Function Clock Divider */ -/*! @{ */ - -#define SYSCON_TSICLKDIV_DIV_MASK (0xFFU) -#define SYSCON_TSICLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value: */ -#define SYSCON_TSICLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_TSICLKDIV_DIV_SHIFT)) & SYSCON_TSICLKDIV_DIV_MASK) - -#define SYSCON_TSICLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_TSICLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_TSICLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_TSICLKDIV_RESET_SHIFT)) & SYSCON_TSICLKDIV_RESET_MASK) - -#define SYSCON_TSICLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_TSICLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_TSICLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_TSICLKDIV_HALT_SHIFT)) & SYSCON_TSICLKDIV_HALT_MASK) - -#define SYSCON_TSICLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_TSICLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_TSICLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_TSICLKDIV_UNSTAB_SHIFT)) & SYSCON_TSICLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name AHBCLKDIV - System Clock Divider */ -/*! @{ */ - -#define SYSCON_AHBCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_AHBCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_AHBCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKDIV_DIV_SHIFT)) & SYSCON_AHBCLKDIV_DIV_MASK) - -#define SYSCON_AHBCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_AHBCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_AHBCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKDIV_UNSTAB_SHIFT)) & SYSCON_AHBCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name CLKOUTDIV - CLKOUT Clock Divider */ -/*! @{ */ - -#define SYSCON_CLKOUTDIV_DIV_MASK (0xFFU) -#define SYSCON_CLKOUTDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_CLKOUTDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLKOUTDIV_DIV_SHIFT)) & SYSCON_CLKOUTDIV_DIV_MASK) - -#define SYSCON_CLKOUTDIV_RESET_MASK (0x20000000U) -#define SYSCON_CLKOUTDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_CLKOUTDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLKOUTDIV_RESET_SHIFT)) & SYSCON_CLKOUTDIV_RESET_MASK) - -#define SYSCON_CLKOUTDIV_HALT_MASK (0x40000000U) -#define SYSCON_CLKOUTDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_CLKOUTDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLKOUTDIV_HALT_SHIFT)) & SYSCON_CLKOUTDIV_HALT_MASK) - -#define SYSCON_CLKOUTDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_CLKOUTDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_CLKOUTDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLKOUTDIV_UNSTAB_SHIFT)) & SYSCON_CLKOUTDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name FROHFDIV - FRO_HF_DIV Clock Divider */ -/*! @{ */ - -#define SYSCON_FROHFDIV_DIV_MASK (0xFFU) -#define SYSCON_FROHFDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_FROHFDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FROHFDIV_DIV_SHIFT)) & SYSCON_FROHFDIV_DIV_MASK) - -#define SYSCON_FROHFDIV_HALT_MASK (0x40000000U) -#define SYSCON_FROHFDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running, this bit is set to 0 when the register is written. - */ -#define SYSCON_FROHFDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FROHFDIV_HALT_SHIFT)) & SYSCON_FROHFDIV_HALT_MASK) - -#define SYSCON_FROHFDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_FROHFDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_FROHFDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FROHFDIV_UNSTAB_SHIFT)) & SYSCON_FROHFDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name WDT0CLKDIV - WDT0 Clock Divider */ -/*! @{ */ - -#define SYSCON_WDT0CLKDIV_DIV_MASK (0x3FU) -#define SYSCON_WDT0CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_WDT0CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_WDT0CLKDIV_DIV_SHIFT)) & SYSCON_WDT0CLKDIV_DIV_MASK) - -#define SYSCON_WDT0CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_WDT0CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_WDT0CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_WDT0CLKDIV_RESET_SHIFT)) & SYSCON_WDT0CLKDIV_RESET_MASK) - -#define SYSCON_WDT0CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_WDT0CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_WDT0CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_WDT0CLKDIV_HALT_SHIFT)) & SYSCON_WDT0CLKDIV_HALT_MASK) - -#define SYSCON_WDT0CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_WDT0CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_WDT0CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_WDT0CLKDIV_UNSTAB_SHIFT)) & SYSCON_WDT0CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name ADC0CLKDIV - ADC0 Clock Divider */ -/*! @{ */ - -#define SYSCON_ADC0CLKDIV_DIV_MASK (0x7U) -#define SYSCON_ADC0CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_ADC0CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ADC0CLKDIV_DIV_SHIFT)) & SYSCON_ADC0CLKDIV_DIV_MASK) - -#define SYSCON_ADC0CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_ADC0CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_ADC0CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ADC0CLKDIV_RESET_SHIFT)) & SYSCON_ADC0CLKDIV_RESET_MASK) - -#define SYSCON_ADC0CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_ADC0CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_ADC0CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ADC0CLKDIV_HALT_SHIFT)) & SYSCON_ADC0CLKDIV_HALT_MASK) - -#define SYSCON_ADC0CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_ADC0CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_ADC0CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ADC0CLKDIV_UNSTAB_SHIFT)) & SYSCON_ADC0CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name USB0CLKDIV - USB-FS Clock Divider */ -/*! @{ */ - -#define SYSCON_USB0CLKDIV_DIV_MASK (0xFFU) -#define SYSCON_USB0CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_USB0CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_USB0CLKDIV_DIV_SHIFT)) & SYSCON_USB0CLKDIV_DIV_MASK) - -#define SYSCON_USB0CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_USB0CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_USB0CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_USB0CLKDIV_RESET_SHIFT)) & SYSCON_USB0CLKDIV_RESET_MASK) - -#define SYSCON_USB0CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_USB0CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_USB0CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_USB0CLKDIV_HALT_SHIFT)) & SYSCON_USB0CLKDIV_HALT_MASK) - -#define SYSCON_USB0CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_USB0CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_USB0CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_USB0CLKDIV_UNSTAB_SHIFT)) & SYSCON_USB0CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name SCTCLKDIV - SCT/PWM Clock Divider */ -/*! @{ */ - -#define SYSCON_SCTCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_SCTCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_SCTCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SCTCLKDIV_DIV_SHIFT)) & SYSCON_SCTCLKDIV_DIV_MASK) - -#define SYSCON_SCTCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_SCTCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_SCTCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SCTCLKDIV_RESET_SHIFT)) & SYSCON_SCTCLKDIV_RESET_MASK) - -#define SYSCON_SCTCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_SCTCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_SCTCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SCTCLKDIV_HALT_SHIFT)) & SYSCON_SCTCLKDIV_HALT_MASK) - -#define SYSCON_SCTCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_SCTCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_SCTCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SCTCLKDIV_UNSTAB_SHIFT)) & SYSCON_SCTCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name PLLCLKDIV - PLL Clock Divider */ -/*! @{ */ - -#define SYSCON_PLLCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_PLLCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_PLLCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLLCLKDIV_DIV_SHIFT)) & SYSCON_PLLCLKDIV_DIV_MASK) - -#define SYSCON_PLLCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_PLLCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_PLLCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLLCLKDIV_RESET_SHIFT)) & SYSCON_PLLCLKDIV_RESET_MASK) - -#define SYSCON_PLLCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_PLLCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_PLLCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLLCLKDIV_HALT_SHIFT)) & SYSCON_PLLCLKDIV_HALT_MASK) - -#define SYSCON_PLLCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_PLLCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_PLLCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLLCLKDIV_UNSTAB_SHIFT)) & SYSCON_PLLCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name CTIMERXCLKDIV_CTIMERCLKDIV - CTimer Clock Divider */ -/*! @{ */ - -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_DIV_SHIFT)) & SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_DIV_MASK) - -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b0..Divider is not reset - * 0b1..Divider is reset - */ -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_RESET_SHIFT)) & SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_RESET_MASK) - -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock has stopped - */ -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_HALT_SHIFT)) & SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_HALT_MASK) - -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Stable divider clock - * 0b1..Unstable clock frequency - */ -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_UNSTAB_SHIFT)) & SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_UNSTAB_MASK) -/*! @} */ - -/* The count of SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV */ -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_COUNT (5U) - -/*! @name PLL1CLK0DIV - PLL1 Clock 0 Divider */ -/*! @{ */ - -#define SYSCON_PLL1CLK0DIV_DIV_MASK (0xFFU) -#define SYSCON_PLL1CLK0DIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_PLL1CLK0DIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLL1CLK0DIV_DIV_SHIFT)) & SYSCON_PLL1CLK0DIV_DIV_MASK) - -#define SYSCON_PLL1CLK0DIV_RESET_MASK (0x20000000U) -#define SYSCON_PLL1CLK0DIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_PLL1CLK0DIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLL1CLK0DIV_RESET_SHIFT)) & SYSCON_PLL1CLK0DIV_RESET_MASK) - -#define SYSCON_PLL1CLK0DIV_HALT_MASK (0x40000000U) -#define SYSCON_PLL1CLK0DIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_PLL1CLK0DIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLL1CLK0DIV_HALT_SHIFT)) & SYSCON_PLL1CLK0DIV_HALT_MASK) - -#define SYSCON_PLL1CLK0DIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_PLL1CLK0DIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_PLL1CLK0DIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLL1CLK0DIV_UNSTAB_SHIFT)) & SYSCON_PLL1CLK0DIV_UNSTAB_MASK) -/*! @} */ - -/*! @name PLL1CLK1DIV - PLL1 Clock 1 Divider */ -/*! @{ */ - -#define SYSCON_PLL1CLK1DIV_DIV_MASK (0xFFU) -#define SYSCON_PLL1CLK1DIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_PLL1CLK1DIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLL1CLK1DIV_DIV_SHIFT)) & SYSCON_PLL1CLK1DIV_DIV_MASK) - -#define SYSCON_PLL1CLK1DIV_RESET_MASK (0x20000000U) -#define SYSCON_PLL1CLK1DIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_PLL1CLK1DIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLL1CLK1DIV_RESET_SHIFT)) & SYSCON_PLL1CLK1DIV_RESET_MASK) - -#define SYSCON_PLL1CLK1DIV_HALT_MASK (0x40000000U) -#define SYSCON_PLL1CLK1DIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_PLL1CLK1DIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLL1CLK1DIV_HALT_SHIFT)) & SYSCON_PLL1CLK1DIV_HALT_MASK) - -#define SYSCON_PLL1CLK1DIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_PLL1CLK1DIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_PLL1CLK1DIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLL1CLK1DIV_UNSTAB_SHIFT)) & SYSCON_PLL1CLK1DIV_UNSTAB_MASK) -/*! @} */ - -/*! @name UTICKCLKDIV - UTICK Clock Divider */ -/*! @{ */ - -#define SYSCON_UTICKCLKDIV_DIV_MASK (0x3FU) -#define SYSCON_UTICKCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_UTICKCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_UTICKCLKDIV_DIV_SHIFT)) & SYSCON_UTICKCLKDIV_DIV_MASK) - -#define SYSCON_UTICKCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_UTICKCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_UTICKCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_UTICKCLKDIV_RESET_SHIFT)) & SYSCON_UTICKCLKDIV_RESET_MASK) - -#define SYSCON_UTICKCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_UTICKCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_UTICKCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_UTICKCLKDIV_HALT_SHIFT)) & SYSCON_UTICKCLKDIV_HALT_MASK) - -#define SYSCON_UTICKCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_UTICKCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_UTICKCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_UTICKCLKDIV_UNSTAB_SHIFT)) & SYSCON_UTICKCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name CLKOUT_FRGCTRL - CLKOUT FRG Control */ -/*! @{ */ - -#define SYSCON_CLKOUT_FRGCTRL_DIV_MASK (0xFFU) -#define SYSCON_CLKOUT_FRGCTRL_DIV_SHIFT (0U) -/*! DIV - Divider value */ -#define SYSCON_CLKOUT_FRGCTRL_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLKOUT_FRGCTRL_DIV_SHIFT)) & SYSCON_CLKOUT_FRGCTRL_DIV_MASK) - -#define SYSCON_CLKOUT_FRGCTRL_MULT_MASK (0xFF00U) -#define SYSCON_CLKOUT_FRGCTRL_MULT_SHIFT (8U) -/*! MULT - Numerator value */ -#define SYSCON_CLKOUT_FRGCTRL_MULT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLKOUT_FRGCTRL_MULT_SHIFT)) & SYSCON_CLKOUT_FRGCTRL_MULT_MASK) -/*! @} */ - -/*! @name CLKUNLOCK - Clock Configuration Unlock */ -/*! @{ */ - -#define SYSCON_CLKUNLOCK_UNLOCK_MASK (0x1U) -#define SYSCON_CLKUNLOCK_UNLOCK_SHIFT (0U) -/*! UNLOCK - Controls clock configuration registers access (for example, xxxDIV, xxxSEL) - * 0b1..Freezes all clock configuration registers update - * 0b0..Updates are allowed to all clock configuration registers - */ -#define SYSCON_CLKUNLOCK_UNLOCK(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLKUNLOCK_UNLOCK_SHIFT)) & SYSCON_CLKUNLOCK_UNLOCK_MASK) -/*! @} */ - -/*! @name NVM_CTRL - NVM Control */ -/*! @{ */ - -#define SYSCON_NVM_CTRL_DIS_FLASH_SPEC_MASK (0x1U) -#define SYSCON_NVM_CTRL_DIS_FLASH_SPEC_SHIFT (0U) -/*! DIS_FLASH_SPEC - Flash speculation control - * 0b0..Enables flash speculation - * 0b1..Disables flash speculation - */ -#define SYSCON_NVM_CTRL_DIS_FLASH_SPEC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_DIS_FLASH_SPEC_SHIFT)) & SYSCON_NVM_CTRL_DIS_FLASH_SPEC_MASK) - -#define SYSCON_NVM_CTRL_DIS_DATA_SPEC_MASK (0x2U) -#define SYSCON_NVM_CTRL_DIS_DATA_SPEC_SHIFT (1U) -/*! DIS_DATA_SPEC - Flash data speculation control - * 0b0..Enables data speculation - * 0b1..Disables data speculation - */ -#define SYSCON_NVM_CTRL_DIS_DATA_SPEC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_DIS_DATA_SPEC_SHIFT)) & SYSCON_NVM_CTRL_DIS_DATA_SPEC_MASK) - -#define SYSCON_NVM_CTRL_DIS_FLASH_CACHE_MASK (0x4U) -#define SYSCON_NVM_CTRL_DIS_FLASH_CACHE_SHIFT (2U) -/*! DIS_FLASH_CACHE - Flash cache control - * 0b0..Enables flash cache - * 0b1..Disables flash cache - */ -#define SYSCON_NVM_CTRL_DIS_FLASH_CACHE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_DIS_FLASH_CACHE_SHIFT)) & SYSCON_NVM_CTRL_DIS_FLASH_CACHE_MASK) - -#define SYSCON_NVM_CTRL_DIS_FLASH_INST_MASK (0x8U) -#define SYSCON_NVM_CTRL_DIS_FLASH_INST_SHIFT (3U) -/*! DIS_FLASH_INST - Flash instruction cache control - * 0b0..Enables flash instruction cache when DIS_FLASH_CACHE=0 - * 0b1..Disables flash instruction cache - */ -#define SYSCON_NVM_CTRL_DIS_FLASH_INST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_DIS_FLASH_INST_SHIFT)) & SYSCON_NVM_CTRL_DIS_FLASH_INST_MASK) - -#define SYSCON_NVM_CTRL_DIS_FLASH_DATA_MASK (0x10U) -#define SYSCON_NVM_CTRL_DIS_FLASH_DATA_SHIFT (4U) -/*! DIS_FLASH_DATA - Flash data cache control - * 0b0..Enables flash data cache when DIS_FLASH_CACHE=0 - * 0b1..Disables flash data cache - */ -#define SYSCON_NVM_CTRL_DIS_FLASH_DATA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_DIS_FLASH_DATA_SHIFT)) & SYSCON_NVM_CTRL_DIS_FLASH_DATA_MASK) - -#define SYSCON_NVM_CTRL_CLR_FLASH_CACHE_MASK (0x20U) -#define SYSCON_NVM_CTRL_CLR_FLASH_CACHE_SHIFT (5U) -/*! CLR_FLASH_CACHE - Clear flash cache control - * 0b0..No clear flash cache - * 0b1..Clears flash cache - */ -#define SYSCON_NVM_CTRL_CLR_FLASH_CACHE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_CLR_FLASH_CACHE_SHIFT)) & SYSCON_NVM_CTRL_CLR_FLASH_CACHE_MASK) - -#define SYSCON_NVM_CTRL_FLASH_STALL_EN_MASK (0x400U) -#define SYSCON_NVM_CTRL_FLASH_STALL_EN_SHIFT (10U) -/*! FLASH_STALL_EN - FLASH stall on busy control - * 0b0..No stall on FLASH busy - * 0b1..Stall on FLASH busy - */ -#define SYSCON_NVM_CTRL_FLASH_STALL_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_FLASH_STALL_EN_SHIFT)) & SYSCON_NVM_CTRL_FLASH_STALL_EN_MASK) - -#define SYSCON_NVM_CTRL_DIS_MBECC_ERR_INST_MASK (0x10000U) -#define SYSCON_NVM_CTRL_DIS_MBECC_ERR_INST_SHIFT (16U) -/*! DIS_MBECC_ERR_INST - * 0b0..Enables bus error on multi-bit ECC error for instruction - * 0b1..Disables bus error on multi-bit ECC error for instruction - */ -#define SYSCON_NVM_CTRL_DIS_MBECC_ERR_INST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_DIS_MBECC_ERR_INST_SHIFT)) & SYSCON_NVM_CTRL_DIS_MBECC_ERR_INST_MASK) - -#define SYSCON_NVM_CTRL_DIS_MBECC_ERR_DATA_MASK (0x20000U) -#define SYSCON_NVM_CTRL_DIS_MBECC_ERR_DATA_SHIFT (17U) -/*! DIS_MBECC_ERR_DATA - * 0b0..Enables bus error on multi-bit ECC error for data - * 0b1..Disables bus error on multi-bit ECC error for data - */ -#define SYSCON_NVM_CTRL_DIS_MBECC_ERR_DATA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_DIS_MBECC_ERR_DATA_SHIFT)) & SYSCON_NVM_CTRL_DIS_MBECC_ERR_DATA_MASK) -/*! @} */ - -/*! @name ROMCR - ROM Wait State */ -/*! @{ */ - -#define SYSCON_ROMCR_ROM_WAIT_MASK (0x1U) -#define SYSCON_ROMCR_ROM_WAIT_SHIFT (0U) -/*! ROM_WAIT - ROM waiting Arm core and other masters for one cycle - * 0b0..Disabled - * 0b1..Enabled - */ -#define SYSCON_ROMCR_ROM_WAIT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ROMCR_ROM_WAIT_SHIFT)) & SYSCON_ROMCR_ROM_WAIT_MASK) -/*! @} */ - -/*! @name SMARTDMAINT - SmartDMA Interrupt Hijack */ -/*! @{ */ - -#define SYSCON_SMARTDMAINT_INT0_MASK (0x1U) -#define SYSCON_SMARTDMAINT_INT0_SHIFT (0U) -/*! INT0 - SmartDMA hijack NVIC IRQ1 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT0_SHIFT)) & SYSCON_SMARTDMAINT_INT0_MASK) - -#define SYSCON_SMARTDMAINT_INT1_MASK (0x2U) -#define SYSCON_SMARTDMAINT_INT1_SHIFT (1U) -/*! INT1 - SmartDMA hijack NVIC IRQ17 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT1_SHIFT)) & SYSCON_SMARTDMAINT_INT1_MASK) - -#define SYSCON_SMARTDMAINT_INT2_MASK (0x4U) -#define SYSCON_SMARTDMAINT_INT2_SHIFT (2U) -/*! INT2 - SmartDMA hijack NVIC IRQ18 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT2(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT2_SHIFT)) & SYSCON_SMARTDMAINT_INT2_MASK) - -#define SYSCON_SMARTDMAINT_INT3_MASK (0x8U) -#define SYSCON_SMARTDMAINT_INT3_SHIFT (3U) -/*! INT3 - SmartDMA hijack NVIC IRQ29 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT3(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT3_SHIFT)) & SYSCON_SMARTDMAINT_INT3_MASK) - -#define SYSCON_SMARTDMAINT_INT4_MASK (0x10U) -#define SYSCON_SMARTDMAINT_INT4_SHIFT (4U) -/*! INT4 - SmartDMA hijack NVIC IRQ30 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT4(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT4_SHIFT)) & SYSCON_SMARTDMAINT_INT4_MASK) - -#define SYSCON_SMARTDMAINT_INT5_MASK (0x20U) -#define SYSCON_SMARTDMAINT_INT5_SHIFT (5U) -/*! INT5 - SmartDMA hijack NVIC IRQ31 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT5(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT5_SHIFT)) & SYSCON_SMARTDMAINT_INT5_MASK) - -#define SYSCON_SMARTDMAINT_INT6_MASK (0x40U) -#define SYSCON_SMARTDMAINT_INT6_SHIFT (6U) -/*! INT6 - SmartDMA hijack NVIC IRQ32 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT6(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT6_SHIFT)) & SYSCON_SMARTDMAINT_INT6_MASK) - -#define SYSCON_SMARTDMAINT_INT7_MASK (0x80U) -#define SYSCON_SMARTDMAINT_INT7_SHIFT (7U) -/*! INT7 - SmartDMA hijack NVIC IRQ33 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT7(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT7_SHIFT)) & SYSCON_SMARTDMAINT_INT7_MASK) - -#define SYSCON_SMARTDMAINT_INT8_MASK (0x100U) -#define SYSCON_SMARTDMAINT_INT8_SHIFT (8U) -/*! INT8 - SmartDMA hijack NVIC IRQ34 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT8(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT8_SHIFT)) & SYSCON_SMARTDMAINT_INT8_MASK) - -#define SYSCON_SMARTDMAINT_INT9_MASK (0x200U) -#define SYSCON_SMARTDMAINT_INT9_SHIFT (9U) -/*! INT9 - SmartDMA hijack NVIC IRQ35 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT9(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT9_SHIFT)) & SYSCON_SMARTDMAINT_INT9_MASK) - -#define SYSCON_SMARTDMAINT_INT10_MASK (0x400U) -#define SYSCON_SMARTDMAINT_INT10_SHIFT (10U) -/*! INT10 - SmartDMA hijack NVIC IRQ36 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT10(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT10_SHIFT)) & SYSCON_SMARTDMAINT_INT10_MASK) - -#define SYSCON_SMARTDMAINT_INT11_MASK (0x800U) -#define SYSCON_SMARTDMAINT_INT11_SHIFT (11U) -/*! INT11 - SmartDMA hijack NVIC IRQ37 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT11(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT11_SHIFT)) & SYSCON_SMARTDMAINT_INT11_MASK) - -#define SYSCON_SMARTDMAINT_INT12_MASK (0x1000U) -#define SYSCON_SMARTDMAINT_INT12_SHIFT (12U) -/*! INT12 - SmartDMA hijack NVIC IRQ38 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT12(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT12_SHIFT)) & SYSCON_SMARTDMAINT_INT12_MASK) - -#define SYSCON_SMARTDMAINT_INT13_MASK (0x2000U) -#define SYSCON_SMARTDMAINT_INT13_SHIFT (13U) -/*! INT13 - SmartDMA hijack NVIC IRQ39 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT13(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT13_SHIFT)) & SYSCON_SMARTDMAINT_INT13_MASK) - -#define SYSCON_SMARTDMAINT_INT14_MASK (0x4000U) -#define SYSCON_SMARTDMAINT_INT14_SHIFT (14U) -/*! INT14 - SmartDMA hijack NVIC IRQ40 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT14(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT14_SHIFT)) & SYSCON_SMARTDMAINT_INT14_MASK) - -#define SYSCON_SMARTDMAINT_INT15_MASK (0x8000U) -#define SYSCON_SMARTDMAINT_INT15_SHIFT (15U) -/*! INT15 - SmartDMA hijack NVIC IRQ41 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT15(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT15_SHIFT)) & SYSCON_SMARTDMAINT_INT15_MASK) - -#define SYSCON_SMARTDMAINT_INT16_MASK (0x10000U) -#define SYSCON_SMARTDMAINT_INT16_SHIFT (16U) -/*! INT16 - SmartDMA hijack NVIC IRQ42 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT16(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT16_SHIFT)) & SYSCON_SMARTDMAINT_INT16_MASK) - -#define SYSCON_SMARTDMAINT_INT17_MASK (0x20000U) -#define SYSCON_SMARTDMAINT_INT17_SHIFT (17U) -/*! INT17 - SmartDMA hijack NVIC IRQ45 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT17(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT17_SHIFT)) & SYSCON_SMARTDMAINT_INT17_MASK) - -#define SYSCON_SMARTDMAINT_INT18_MASK (0x40000U) -#define SYSCON_SMARTDMAINT_INT18_SHIFT (18U) -/*! INT18 - SmartDMA hijack NVIC IRQ47 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT18(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT18_SHIFT)) & SYSCON_SMARTDMAINT_INT18_MASK) - -#define SYSCON_SMARTDMAINT_INT19_MASK (0x80000U) -#define SYSCON_SMARTDMAINT_INT19_SHIFT (19U) -/*! INT19 - SmartDMA hijack NVIC IRQ50 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT19(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT19_SHIFT)) & SYSCON_SMARTDMAINT_INT19_MASK) - -#define SYSCON_SMARTDMAINT_INT20_MASK (0x100000U) -#define SYSCON_SMARTDMAINT_INT20_SHIFT (20U) -/*! INT20 - SmartDMA hijack NVIC IRQ51 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT20(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT20_SHIFT)) & SYSCON_SMARTDMAINT_INT20_MASK) - -#define SYSCON_SMARTDMAINT_INT21_MASK (0x200000U) -#define SYSCON_SMARTDMAINT_INT21_SHIFT (21U) -/*! INT21 - SmartDMA hijack NVIC IRQ66 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT21(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT21_SHIFT)) & SYSCON_SMARTDMAINT_INT21_MASK) - -#define SYSCON_SMARTDMAINT_INT22_MASK (0x400000U) -#define SYSCON_SMARTDMAINT_INT22_SHIFT (22U) -/*! INT22 - SmartDMA hijack NVIC IRQ67 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT22(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT22_SHIFT)) & SYSCON_SMARTDMAINT_INT22_MASK) - -#define SYSCON_SMARTDMAINT_INT23_MASK (0x800000U) -#define SYSCON_SMARTDMAINT_INT23_SHIFT (23U) -/*! INT23 - SmartDMA hijack NVIC IRQ77 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT23(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT23_SHIFT)) & SYSCON_SMARTDMAINT_INT23_MASK) -/*! @} */ - -/*! @name ADC1CLKSEL - ADC1 Clock Source Select */ -/*! @{ */ - -#define SYSCON_ADC1CLKSEL_SEL_MASK (0x7U) -#define SYSCON_ADC1CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the ADC1 clock source - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..FRO_HF clock - * 0b011..FRO 12 MHz clock - * 0b100..Clk_in clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_ADC1CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ADC1CLKSEL_SEL_SHIFT)) & SYSCON_ADC1CLKSEL_SEL_MASK) -/*! @} */ - -/*! @name ADC1CLKDIV - ADC1 Clock Divider */ -/*! @{ */ - -#define SYSCON_ADC1CLKDIV_DIV_MASK (0x7U) -#define SYSCON_ADC1CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_ADC1CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ADC1CLKDIV_DIV_SHIFT)) & SYSCON_ADC1CLKDIV_DIV_MASK) - -#define SYSCON_ADC1CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_ADC1CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_ADC1CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ADC1CLKDIV_RESET_SHIFT)) & SYSCON_ADC1CLKDIV_RESET_MASK) - -#define SYSCON_ADC1CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_ADC1CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_ADC1CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ADC1CLKDIV_HALT_SHIFT)) & SYSCON_ADC1CLKDIV_HALT_MASK) - -#define SYSCON_ADC1CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_ADC1CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_ADC1CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ADC1CLKDIV_UNSTAB_SHIFT)) & SYSCON_ADC1CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name RAM_INTERLEAVE - Control PKC RAM Interleave Access */ -/*! @{ */ - -#define SYSCON_RAM_INTERLEAVE_INTERLEAVE_MASK (0x1U) -#define SYSCON_RAM_INTERLEAVE_INTERLEAVE_SHIFT (0U) -/*! INTERLEAVE - Controls PKC RAM access for PKC RAM 0 and PKC RAM 1 - * 0b1..RAM access to PKC RAM 0 and PKC RAM 1 is interleaved. This setting is need for PKC L0 memory access. - * 0b0..RAM access to PKC RAM 0 and PKC RAM 1 is consecutive. - */ -#define SYSCON_RAM_INTERLEAVE_INTERLEAVE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_RAM_INTERLEAVE_INTERLEAVE_SHIFT)) & SYSCON_RAM_INTERLEAVE_INTERLEAVE_MASK) -/*! @} */ - -/*! @name DAC_CLKSEL - DAC0 Functional Clock Selection..DAC2 Functional Clock Selection */ -/*! @{ */ - -#define SYSCON_DAC_CLKSEL_SEL_MASK (0x7U) -#define SYSCON_DAC_CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the DAC clock source - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..Clk_in - * 0b011..FRO_HF - * 0b100..FRO_12M - * 0b101..PLL1_clk0 clock - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_DAC_CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DAC_CLKSEL_SEL_SHIFT)) & SYSCON_DAC_CLKSEL_SEL_MASK) -/*! @} */ - -/* The count of SYSCON_DAC_CLKSEL */ -#define SYSCON_DAC_CLKSEL_COUNT (3U) - -/*! @name DAC_CLKDIV - DAC0 functional clock divider..DAC2 functional clock divider */ -/*! @{ */ - -#define SYSCON_DAC_CLKDIV_DIV_MASK (0x7U) -#define SYSCON_DAC_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_DAC_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DAC_CLKDIV_DIV_SHIFT)) & SYSCON_DAC_CLKDIV_DIV_MASK) - -#define SYSCON_DAC_CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_DAC_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_DAC_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DAC_CLKDIV_RESET_SHIFT)) & SYSCON_DAC_CLKDIV_RESET_MASK) - -#define SYSCON_DAC_CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_DAC_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_DAC_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DAC_CLKDIV_HALT_SHIFT)) & SYSCON_DAC_CLKDIV_HALT_MASK) - -#define SYSCON_DAC_CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_DAC_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_DAC_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DAC_CLKDIV_UNSTAB_SHIFT)) & SYSCON_DAC_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/* The count of SYSCON_DAC_CLKDIV */ -#define SYSCON_DAC_CLKDIV_COUNT (3U) - -/*! @name FLEXSPICLKSEL - FlexSPI Clock Selection */ -/*! @{ */ - -#define SYSCON_FLEXSPICLKSEL_SEL_MASK (0xFU) -#define SYSCON_FLEXSPICLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the FlexSPI clock - * 0b0000..No clock - * 0b0001..PLL0 clock - * 0b0010..No clock - * 0b0011..FRO_HF - * 0b0100..No clock - * 0b0101..pll1_clock - * 0b0110..USB PLL clock - * 0b0111..No clock - * 0b1000..No clock - * 0b1001..No clock - * 0b1010..No clock - * 0b1011..No clock - * 0b1100..No clock - * 0b1101..No clock - * 0b1110..No clock - * 0b1111..No clock - */ -#define SYSCON_FLEXSPICLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXSPICLKSEL_SEL_SHIFT)) & SYSCON_FLEXSPICLKSEL_SEL_MASK) -/*! @} */ - -/*! @name FLEXSPICLKDIV - FlexSPI Clock Divider */ -/*! @{ */ - -#define SYSCON_FLEXSPICLKDIV_DIV_MASK (0x7U) -#define SYSCON_FLEXSPICLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_FLEXSPICLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXSPICLKDIV_DIV_SHIFT)) & SYSCON_FLEXSPICLKDIV_DIV_MASK) - -#define SYSCON_FLEXSPICLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_FLEXSPICLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_FLEXSPICLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXSPICLKDIV_RESET_SHIFT)) & SYSCON_FLEXSPICLKDIV_RESET_MASK) - -#define SYSCON_FLEXSPICLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_FLEXSPICLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_FLEXSPICLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXSPICLKDIV_HALT_SHIFT)) & SYSCON_FLEXSPICLKDIV_HALT_MASK) - -#define SYSCON_FLEXSPICLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_FLEXSPICLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_FLEXSPICLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXSPICLKDIV_UNSTAB_SHIFT)) & SYSCON_FLEXSPICLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name PLLCLKDIVSEL - PLL Clock Divider Clock Selection */ -/*! @{ */ - -#define SYSCON_PLLCLKDIVSEL_SEL_MASK (0x7U) -#define SYSCON_PLLCLKDIVSEL_SEL_SHIFT (0U) -/*! SEL - Selects the PLL Clock Divider source clock - * 0b000..PLL0 clock - * 0b001..pll1_clk0 - * 0b010..No clock - * 0b011..No clock - * 0b100..No clock - * 0b101..No clock - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_PLLCLKDIVSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLLCLKDIVSEL_SEL_SHIFT)) & SYSCON_PLLCLKDIVSEL_SEL_MASK) -/*! @} */ - -/*! @name I3C0FCLKSEL - I3C0 Functional Clock Selection */ -/*! @{ */ - -#define SYSCON_I3C0FCLKSEL_SEL_MASK (0x7U) -#define SYSCON_I3C0FCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the I3C0 clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..FRO_HF clock - * 0b100..No clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_I3C0FCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKSEL_SEL_SHIFT)) & SYSCON_I3C0FCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name I3C0FCLKSTCSEL - I3C0 FCLK_STC Clock Selection */ -/*! @{ */ - -#define SYSCON_I3C0FCLKSTCSEL_SEL_MASK (0x7U) -#define SYSCON_I3C0FCLKSTCSEL_SEL_SHIFT (0U) -/*! SEL - Selects the I3C0 Time Control clock - * 0b000..I3C0 functional clock I3C0FCLK - * 0b001..FRO_1M clock - * 0b010..No clock - * 0b011..No clock - * 0b100..No clock - * 0b101..No clock - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_I3C0FCLKSTCSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKSTCSEL_SEL_SHIFT)) & SYSCON_I3C0FCLKSTCSEL_SEL_MASK) -/*! @} */ - -/*! @name I3C0FCLKSTCDIV - I3C0 FCLK_STC Clock Divider */ -/*! @{ */ - -#define SYSCON_I3C0FCLKSTCDIV_DIV_MASK (0xFFU) -#define SYSCON_I3C0FCLKSTCDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_I3C0FCLKSTCDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKSTCDIV_DIV_SHIFT)) & SYSCON_I3C0FCLKSTCDIV_DIV_MASK) - -#define SYSCON_I3C0FCLKSTCDIV_RESET_MASK (0x20000000U) -#define SYSCON_I3C0FCLKSTCDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_I3C0FCLKSTCDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKSTCDIV_RESET_SHIFT)) & SYSCON_I3C0FCLKSTCDIV_RESET_MASK) - -#define SYSCON_I3C0FCLKSTCDIV_HALT_MASK (0x40000000U) -#define SYSCON_I3C0FCLKSTCDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_I3C0FCLKSTCDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKSTCDIV_HALT_SHIFT)) & SYSCON_I3C0FCLKSTCDIV_HALT_MASK) - -#define SYSCON_I3C0FCLKSTCDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_I3C0FCLKSTCDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_I3C0FCLKSTCDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKSTCDIV_UNSTAB_SHIFT)) & SYSCON_I3C0FCLKSTCDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name I3C0FCLKSDIV - I3C0 FCLK Slow Clock Divider */ -/*! @{ */ - -#define SYSCON_I3C0FCLKSDIV_DIV_MASK (0xFFU) -#define SYSCON_I3C0FCLKSDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_I3C0FCLKSDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKSDIV_DIV_SHIFT)) & SYSCON_I3C0FCLKSDIV_DIV_MASK) - -#define SYSCON_I3C0FCLKSDIV_RESET_MASK (0x20000000U) -#define SYSCON_I3C0FCLKSDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_I3C0FCLKSDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKSDIV_RESET_SHIFT)) & SYSCON_I3C0FCLKSDIV_RESET_MASK) - -#define SYSCON_I3C0FCLKSDIV_HALT_MASK (0x40000000U) -#define SYSCON_I3C0FCLKSDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_I3C0FCLKSDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKSDIV_HALT_SHIFT)) & SYSCON_I3C0FCLKSDIV_HALT_MASK) - -#define SYSCON_I3C0FCLKSDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_I3C0FCLKSDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_I3C0FCLKSDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKSDIV_UNSTAB_SHIFT)) & SYSCON_I3C0FCLKSDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name I3C0FCLKDIV - I3C0 Functional Clock FCLK Divider */ -/*! @{ */ - -#define SYSCON_I3C0FCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_I3C0FCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_I3C0FCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKDIV_DIV_SHIFT)) & SYSCON_I3C0FCLKDIV_DIV_MASK) - -#define SYSCON_I3C0FCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_I3C0FCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_I3C0FCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKDIV_RESET_SHIFT)) & SYSCON_I3C0FCLKDIV_RESET_MASK) - -#define SYSCON_I3C0FCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_I3C0FCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_I3C0FCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKDIV_HALT_SHIFT)) & SYSCON_I3C0FCLKDIV_HALT_MASK) - -#define SYSCON_I3C0FCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_I3C0FCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_I3C0FCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKDIV_UNSTAB_SHIFT)) & SYSCON_I3C0FCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name I3C0FCLKSSEL - I3C0 FCLK Slow Selection */ -/*! @{ */ - -#define SYSCON_I3C0FCLKSSEL_SEL_MASK (0x7U) -#define SYSCON_I3C0FCLKSSEL_SEL_SHIFT (0U) -/*! SEL - Selects the I3C FCLK Slow clock - * 0b000..FRO_1M clock - * 0b001..No clock - * 0b010..No clock - * 0b011..No clock - * 0b100..No clock - * 0b101..No clock - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_I3C0FCLKSSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKSSEL_SEL_SHIFT)) & SYSCON_I3C0FCLKSSEL_SEL_MASK) -/*! @} */ - -/*! @name MICFILFCLKSEL - MICFIL Clock Selection */ -/*! @{ */ - -#define SYSCON_MICFILFCLKSEL_SEL_MASK (0xFU) -#define SYSCON_MICFILFCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the MICFIL clock - * 0b0000..FRO_12M clock - * 0b0001..PLL0 clock - * 0b0010..CLKIN clock - * 0b0011..FRO_HF clock - * 0b0100..PLL1_clk0 clock - * 0b0101..SAI0_MCLK clock - * 0b0110..USB PLL clock - * 0b0111..No clock - * 0b1000..SAI1_MCLK clock - * 0b1001..No clock - * 0b1010..No clock - * 0b1011..No clock - * 0b1100..No clock - * 0b1101..No clock - * 0b1110..No clock - * 0b1111..No clock - */ -#define SYSCON_MICFILFCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_MICFILFCLKSEL_SEL_SHIFT)) & SYSCON_MICFILFCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name MICFILFCLKDIV - MICFIL Clock Division */ -/*! @{ */ - -#define SYSCON_MICFILFCLKDIV_DIV_MASK (0x7U) -#define SYSCON_MICFILFCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_MICFILFCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_MICFILFCLKDIV_DIV_SHIFT)) & SYSCON_MICFILFCLKDIV_DIV_MASK) - -#define SYSCON_MICFILFCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_MICFILFCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_MICFILFCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_MICFILFCLKDIV_RESET_SHIFT)) & SYSCON_MICFILFCLKDIV_RESET_MASK) - -#define SYSCON_MICFILFCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_MICFILFCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_MICFILFCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_MICFILFCLKDIV_HALT_SHIFT)) & SYSCON_MICFILFCLKDIV_HALT_MASK) - -#define SYSCON_MICFILFCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_MICFILFCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_MICFILFCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_MICFILFCLKDIV_UNSTAB_SHIFT)) & SYSCON_MICFILFCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name USDHCCLKSEL - uSDHC Clock Selection */ -/*! @{ */ - -#define SYSCON_USDHCCLKSEL_SEL_MASK (0x7U) -#define SYSCON_USDHCCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the uSDHC clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..FRO_HF clock - * 0b100..FRO_12M clock - * 0b101..pll1_clk1 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_USDHCCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_USDHCCLKSEL_SEL_SHIFT)) & SYSCON_USDHCCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name USDHCCLKDIV - uSDHC Function Clock Divider */ -/*! @{ */ - -#define SYSCON_USDHCCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_USDHCCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_USDHCCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_USDHCCLKDIV_DIV_SHIFT)) & SYSCON_USDHCCLKDIV_DIV_MASK) - -#define SYSCON_USDHCCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_USDHCCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_USDHCCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_USDHCCLKDIV_RESET_SHIFT)) & SYSCON_USDHCCLKDIV_RESET_MASK) - -#define SYSCON_USDHCCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_USDHCCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_USDHCCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_USDHCCLKDIV_HALT_SHIFT)) & SYSCON_USDHCCLKDIV_HALT_MASK) - -#define SYSCON_USDHCCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_USDHCCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_USDHCCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_USDHCCLKDIV_UNSTAB_SHIFT)) & SYSCON_USDHCCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name FLEXIOCLKSEL - FLEXIO Clock Selection */ -/*! @{ */ - -#define SYSCON_FLEXIOCLKSEL_SEL_MASK (0x7U) -#define SYSCON_FLEXIOCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the FLEXIO clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..FRO_HF clock - * 0b100..FRO_12M clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_FLEXIOCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXIOCLKSEL_SEL_SHIFT)) & SYSCON_FLEXIOCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name FLEXIOCLKDIV - FLEXIO Function Clock Divider */ -/*! @{ */ - -#define SYSCON_FLEXIOCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_FLEXIOCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_FLEXIOCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXIOCLKDIV_DIV_SHIFT)) & SYSCON_FLEXIOCLKDIV_DIV_MASK) - -#define SYSCON_FLEXIOCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_FLEXIOCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_FLEXIOCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXIOCLKDIV_RESET_SHIFT)) & SYSCON_FLEXIOCLKDIV_RESET_MASK) - -#define SYSCON_FLEXIOCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_FLEXIOCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_FLEXIOCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXIOCLKDIV_HALT_SHIFT)) & SYSCON_FLEXIOCLKDIV_HALT_MASK) - -#define SYSCON_FLEXIOCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_FLEXIOCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_FLEXIOCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXIOCLKDIV_UNSTAB_SHIFT)) & SYSCON_FLEXIOCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name FLEXCAN0CLKSEL - FLEXCAN0 Clock Selection */ -/*! @{ */ - -#define SYSCON_FLEXCAN0CLKSEL_SEL_MASK (0x7U) -#define SYSCON_FLEXCAN0CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the FLEXCAN0 clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..FRO_HF clock - * 0b100..No clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_FLEXCAN0CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCAN0CLKSEL_SEL_SHIFT)) & SYSCON_FLEXCAN0CLKSEL_SEL_MASK) -/*! @} */ - -/*! @name FLEXCAN0CLKDIV - FLEXCAN0 Function Clock Divider */ -/*! @{ */ - -#define SYSCON_FLEXCAN0CLKDIV_DIV_MASK (0xFFU) -#define SYSCON_FLEXCAN0CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_FLEXCAN0CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCAN0CLKDIV_DIV_SHIFT)) & SYSCON_FLEXCAN0CLKDIV_DIV_MASK) - -#define SYSCON_FLEXCAN0CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_FLEXCAN0CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_FLEXCAN0CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCAN0CLKDIV_RESET_SHIFT)) & SYSCON_FLEXCAN0CLKDIV_RESET_MASK) - -#define SYSCON_FLEXCAN0CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_FLEXCAN0CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_FLEXCAN0CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCAN0CLKDIV_HALT_SHIFT)) & SYSCON_FLEXCAN0CLKDIV_HALT_MASK) - -#define SYSCON_FLEXCAN0CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_FLEXCAN0CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_FLEXCAN0CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCAN0CLKDIV_UNSTAB_SHIFT)) & SYSCON_FLEXCAN0CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name FLEXCAN1CLKSEL - FLEXCAN1 Clock Selection */ -/*! @{ */ - -#define SYSCON_FLEXCAN1CLKSEL_SEL_MASK (0x7U) -#define SYSCON_FLEXCAN1CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the FLEXCAN1 clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..FRO_HF clock - * 0b100..No clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_FLEXCAN1CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCAN1CLKSEL_SEL_SHIFT)) & SYSCON_FLEXCAN1CLKSEL_SEL_MASK) -/*! @} */ - -/*! @name FLEXCAN1CLKDIV - FLEXCAN1 Function Clock Divider */ -/*! @{ */ - -#define SYSCON_FLEXCAN1CLKDIV_DIV_MASK (0xFFU) -#define SYSCON_FLEXCAN1CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_FLEXCAN1CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCAN1CLKDIV_DIV_SHIFT)) & SYSCON_FLEXCAN1CLKDIV_DIV_MASK) - -#define SYSCON_FLEXCAN1CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_FLEXCAN1CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_FLEXCAN1CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCAN1CLKDIV_RESET_SHIFT)) & SYSCON_FLEXCAN1CLKDIV_RESET_MASK) - -#define SYSCON_FLEXCAN1CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_FLEXCAN1CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_FLEXCAN1CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCAN1CLKDIV_HALT_SHIFT)) & SYSCON_FLEXCAN1CLKDIV_HALT_MASK) - -#define SYSCON_FLEXCAN1CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_FLEXCAN1CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_FLEXCAN1CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCAN1CLKDIV_UNSTAB_SHIFT)) & SYSCON_FLEXCAN1CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name ENETRMIICLKSEL - Ethernet RMII Clock Selection */ -/*! @{ */ - -#define SYSCON_ENETRMIICLKSEL_SEL_MASK (0x7U) -#define SYSCON_ENETRMIICLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the Ethernet RMII clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..No clock - * 0b100..No clock - * 0b101..PLL1_clk0 clock - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_ENETRMIICLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ENETRMIICLKSEL_SEL_SHIFT)) & SYSCON_ENETRMIICLKSEL_SEL_MASK) -/*! @} */ - -/*! @name ENETRMIICLKDIV - Ethernet RMII Function Clock Divider */ -/*! @{ */ - -#define SYSCON_ENETRMIICLKDIV_DIV_MASK (0xFFU) -#define SYSCON_ENETRMIICLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_ENETRMIICLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ENETRMIICLKDIV_DIV_SHIFT)) & SYSCON_ENETRMIICLKDIV_DIV_MASK) - -#define SYSCON_ENETRMIICLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_ENETRMIICLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_ENETRMIICLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ENETRMIICLKDIV_RESET_SHIFT)) & SYSCON_ENETRMIICLKDIV_RESET_MASK) - -#define SYSCON_ENETRMIICLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_ENETRMIICLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_ENETRMIICLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ENETRMIICLKDIV_HALT_SHIFT)) & SYSCON_ENETRMIICLKDIV_HALT_MASK) - -#define SYSCON_ENETRMIICLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_ENETRMIICLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_ENETRMIICLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ENETRMIICLKDIV_UNSTAB_SHIFT)) & SYSCON_ENETRMIICLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name ENETPTPREFCLKSEL - Ethernet PTP REF Clock Selection */ -/*! @{ */ - -#define SYSCON_ENETPTPREFCLKSEL_SEL_MASK (0x7U) -#define SYSCON_ENETPTPREFCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the Ethernet PTP REF clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..No clock - * 0b100..enet0_tx_clk clock - * 0b101..pll1_clk1 clock - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_ENETPTPREFCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ENETPTPREFCLKSEL_SEL_SHIFT)) & SYSCON_ENETPTPREFCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name ENETPTPREFCLKDIV - Ethernet PTP REF Function Clock Divider */ -/*! @{ */ - -#define SYSCON_ENETPTPREFCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_ENETPTPREFCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_ENETPTPREFCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ENETPTPREFCLKDIV_DIV_SHIFT)) & SYSCON_ENETPTPREFCLKDIV_DIV_MASK) - -#define SYSCON_ENETPTPREFCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_ENETPTPREFCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_ENETPTPREFCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ENETPTPREFCLKDIV_RESET_SHIFT)) & SYSCON_ENETPTPREFCLKDIV_RESET_MASK) - -#define SYSCON_ENETPTPREFCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_ENETPTPREFCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_ENETPTPREFCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ENETPTPREFCLKDIV_HALT_SHIFT)) & SYSCON_ENETPTPREFCLKDIV_HALT_MASK) - -#define SYSCON_ENETPTPREFCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_ENETPTPREFCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_ENETPTPREFCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ENETPTPREFCLKDIV_UNSTAB_SHIFT)) & SYSCON_ENETPTPREFCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name ENET_PHY_INTF_SEL - Ethernet PHY Interface Select */ -/*! @{ */ - -#define SYSCON_ENET_PHY_INTF_SEL_PHY_SEL_MASK (0x4U) -#define SYSCON_ENET_PHY_INTF_SEL_PHY_SEL_SHIFT (2U) -/*! PHY_SEL - Selects the PHY interface - * 0b1..Selects RMII PHY Interface - * 0b0..Selects MII PHY Interface - */ -#define SYSCON_ENET_PHY_INTF_SEL_PHY_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ENET_PHY_INTF_SEL_PHY_SEL_SHIFT)) & SYSCON_ENET_PHY_INTF_SEL_PHY_SEL_MASK) -/*! @} */ - -/*! @name ENET_SBD_FLOW_CTRL - Sideband Flow Control */ -/*! @{ */ - -#define SYSCON_ENET_SBD_FLOW_CTRL_SEL_ch0_MASK (0x1U) -#define SYSCON_ENET_SBD_FLOW_CTRL_SEL_ch0_SHIFT (0U) -/*! SEL_ch0 - Sideband Flow Control for channel0 - * 0b1..Trigger flow control - * 0b0..No trigger flow control - */ -#define SYSCON_ENET_SBD_FLOW_CTRL_SEL_ch0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ENET_SBD_FLOW_CTRL_SEL_ch0_SHIFT)) & SYSCON_ENET_SBD_FLOW_CTRL_SEL_ch0_MASK) - -#define SYSCON_ENET_SBD_FLOW_CTRL_SEL_ch1_MASK (0x2U) -#define SYSCON_ENET_SBD_FLOW_CTRL_SEL_ch1_SHIFT (1U) -/*! SEL_ch1 - Sideband Flow Control for channel1 - * 0b1..Trigger flow control - * 0b0..No trigger flow control - */ -#define SYSCON_ENET_SBD_FLOW_CTRL_SEL_ch1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ENET_SBD_FLOW_CTRL_SEL_ch1_SHIFT)) & SYSCON_ENET_SBD_FLOW_CTRL_SEL_ch1_MASK) -/*! @} */ - -/*! @name EWM0CLKSEL - EWM0 Clock Selection */ -/*! @{ */ - -#define SYSCON_EWM0CLKSEL_SEL_MASK (0x1U) -#define SYSCON_EWM0CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the EWM0 clock - * 0b0..clk_16k[2] - * 0b1..xtal32k[2] - */ -#define SYSCON_EWM0CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_EWM0CLKSEL_SEL_SHIFT)) & SYSCON_EWM0CLKSEL_SEL_MASK) -/*! @} */ - -/*! @name WDT1CLKSEL - WDT1 Clock Selection */ -/*! @{ */ - -#define SYSCON_WDT1CLKSEL_SEL_MASK (0x3U) -#define SYSCON_WDT1CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the WDT1 clock - * 0b00..FRO16K clock 2 - * 0b01..fro_hf_div clock - * 0b10..clk_1m clock - * 0b11..clk_1m clock - */ -#define SYSCON_WDT1CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_WDT1CLKSEL_SEL_SHIFT)) & SYSCON_WDT1CLKSEL_SEL_MASK) -/*! @} */ - -/*! @name WDT1CLKDIV - WDT1 Function Clock Divider */ -/*! @{ */ - -#define SYSCON_WDT1CLKDIV_DIV_MASK (0x3FU) -#define SYSCON_WDT1CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_WDT1CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_WDT1CLKDIV_DIV_SHIFT)) & SYSCON_WDT1CLKDIV_DIV_MASK) - -#define SYSCON_WDT1CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_WDT1CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_WDT1CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_WDT1CLKDIV_RESET_SHIFT)) & SYSCON_WDT1CLKDIV_RESET_MASK) - -#define SYSCON_WDT1CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_WDT1CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_WDT1CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_WDT1CLKDIV_HALT_SHIFT)) & SYSCON_WDT1CLKDIV_HALT_MASK) - -#define SYSCON_WDT1CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_WDT1CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_WDT1CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_WDT1CLKDIV_UNSTAB_SHIFT)) & SYSCON_WDT1CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name OSTIMERCLKSEL - OSTIMER Clock Selection */ -/*! @{ */ - -#define SYSCON_OSTIMERCLKSEL_SEL_MASK (0x3U) -#define SYSCON_OSTIMERCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the OS Event Timer clock - * 0b00..clk_16k[2] - * 0b01..xtal32k[2] - * 0b10..clk_1m clock - * 0b11..No clock - */ -#define SYSCON_OSTIMERCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_OSTIMERCLKSEL_SEL_SHIFT)) & SYSCON_OSTIMERCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name CMP0FCLKSEL - CMP0 Function Clock Selection */ -/*! @{ */ - -#define SYSCON_CMP0FCLKSEL_SEL_MASK (0x7U) -#define SYSCON_CMP0FCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the CMP0 function clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..FRO_HF clock - * 0b011..FRO_12M clock - * 0b100..CLKIN clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_CMP0FCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP0FCLKSEL_SEL_SHIFT)) & SYSCON_CMP0FCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name CMP0FCLKDIV - CMP0 Function Clock Divider */ -/*! @{ */ - -#define SYSCON_CMP0FCLKDIV_DIV_MASK (0xFU) -#define SYSCON_CMP0FCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_CMP0FCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP0FCLKDIV_DIV_SHIFT)) & SYSCON_CMP0FCLKDIV_DIV_MASK) - -#define SYSCON_CMP0FCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_CMP0FCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_CMP0FCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP0FCLKDIV_RESET_SHIFT)) & SYSCON_CMP0FCLKDIV_RESET_MASK) - -#define SYSCON_CMP0FCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_CMP0FCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_CMP0FCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP0FCLKDIV_HALT_SHIFT)) & SYSCON_CMP0FCLKDIV_HALT_MASK) - -#define SYSCON_CMP0FCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_CMP0FCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_CMP0FCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP0FCLKDIV_UNSTAB_SHIFT)) & SYSCON_CMP0FCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name CMP0RRCLKSEL - CMP0 Round Robin Clock Selection */ -/*! @{ */ - -#define SYSCON_CMP0RRCLKSEL_SEL_MASK (0x7U) -#define SYSCON_CMP0RRCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the CMP0 round robin clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..FRO_HF clock - * 0b011..FRO_12M clock - * 0b100..CLKIN clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_CMP0RRCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP0RRCLKSEL_SEL_SHIFT)) & SYSCON_CMP0RRCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name CMP0RRCLKDIV - CMP0 Round Robin Clock Divider */ -/*! @{ */ - -#define SYSCON_CMP0RRCLKDIV_DIV_MASK (0xFU) -#define SYSCON_CMP0RRCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_CMP0RRCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP0RRCLKDIV_DIV_SHIFT)) & SYSCON_CMP0RRCLKDIV_DIV_MASK) - -#define SYSCON_CMP0RRCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_CMP0RRCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_CMP0RRCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP0RRCLKDIV_RESET_SHIFT)) & SYSCON_CMP0RRCLKDIV_RESET_MASK) - -#define SYSCON_CMP0RRCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_CMP0RRCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_CMP0RRCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP0RRCLKDIV_HALT_SHIFT)) & SYSCON_CMP0RRCLKDIV_HALT_MASK) - -#define SYSCON_CMP0RRCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_CMP0RRCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_CMP0RRCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP0RRCLKDIV_UNSTAB_SHIFT)) & SYSCON_CMP0RRCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name CMP1FCLKSEL - CMP1 Function Clock Selection */ -/*! @{ */ - -#define SYSCON_CMP1FCLKSEL_SEL_MASK (0x7U) -#define SYSCON_CMP1FCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the CMP1 function clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..FRO_HF clock - * 0b011..FRO_12M clock - * 0b100..CLKIN clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_CMP1FCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP1FCLKSEL_SEL_SHIFT)) & SYSCON_CMP1FCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name CMP1FCLKDIV - CMP1 Function Clock Divider */ -/*! @{ */ - -#define SYSCON_CMP1FCLKDIV_DIV_MASK (0xFU) -#define SYSCON_CMP1FCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_CMP1FCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP1FCLKDIV_DIV_SHIFT)) & SYSCON_CMP1FCLKDIV_DIV_MASK) - -#define SYSCON_CMP1FCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_CMP1FCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_CMP1FCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP1FCLKDIV_RESET_SHIFT)) & SYSCON_CMP1FCLKDIV_RESET_MASK) - -#define SYSCON_CMP1FCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_CMP1FCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_CMP1FCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP1FCLKDIV_HALT_SHIFT)) & SYSCON_CMP1FCLKDIV_HALT_MASK) - -#define SYSCON_CMP1FCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_CMP1FCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_CMP1FCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP1FCLKDIV_UNSTAB_SHIFT)) & SYSCON_CMP1FCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name CMP1RRCLKSEL - CMP1 Round Robin Clock Source Select */ -/*! @{ */ - -#define SYSCON_CMP1RRCLKSEL_SEL_MASK (0x7U) -#define SYSCON_CMP1RRCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the CMP1 round robin clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..FRO_HF clock - * 0b011..FRO_12M clock - * 0b100..CLKIN clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_CMP1RRCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP1RRCLKSEL_SEL_SHIFT)) & SYSCON_CMP1RRCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name CMP1RRCLKDIV - CMP1 Round Robin Clock Division */ -/*! @{ */ - -#define SYSCON_CMP1RRCLKDIV_DIV_MASK (0xFU) -#define SYSCON_CMP1RRCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_CMP1RRCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP1RRCLKDIV_DIV_SHIFT)) & SYSCON_CMP1RRCLKDIV_DIV_MASK) - -#define SYSCON_CMP1RRCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_CMP1RRCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_CMP1RRCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP1RRCLKDIV_RESET_SHIFT)) & SYSCON_CMP1RRCLKDIV_RESET_MASK) - -#define SYSCON_CMP1RRCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_CMP1RRCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_CMP1RRCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP1RRCLKDIV_HALT_SHIFT)) & SYSCON_CMP1RRCLKDIV_HALT_MASK) - -#define SYSCON_CMP1RRCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_CMP1RRCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_CMP1RRCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP1RRCLKDIV_UNSTAB_SHIFT)) & SYSCON_CMP1RRCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name CMP2FCLKSEL - CMP2 Function Clock Source Select */ -/*! @{ */ - -#define SYSCON_CMP2FCLKSEL_SEL_MASK (0x7U) -#define SYSCON_CMP2FCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the CMP2 function clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..FRO_HF clock - * 0b011..FRO_12M clock - * 0b100..CLKIN clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_CMP2FCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP2FCLKSEL_SEL_SHIFT)) & SYSCON_CMP2FCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name CMP2FCLKDIV - CMP2 Function Clock Division */ -/*! @{ */ - -#define SYSCON_CMP2FCLKDIV_DIV_MASK (0xFU) -#define SYSCON_CMP2FCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_CMP2FCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP2FCLKDIV_DIV_SHIFT)) & SYSCON_CMP2FCLKDIV_DIV_MASK) - -#define SYSCON_CMP2FCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_CMP2FCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_CMP2FCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP2FCLKDIV_RESET_SHIFT)) & SYSCON_CMP2FCLKDIV_RESET_MASK) - -#define SYSCON_CMP2FCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_CMP2FCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_CMP2FCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP2FCLKDIV_HALT_SHIFT)) & SYSCON_CMP2FCLKDIV_HALT_MASK) - -#define SYSCON_CMP2FCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_CMP2FCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_CMP2FCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP2FCLKDIV_UNSTAB_SHIFT)) & SYSCON_CMP2FCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name CMP2RRCLKSEL - CMP2 Round Robin Clock Source Select */ -/*! @{ */ - -#define SYSCON_CMP2RRCLKSEL_SEL_MASK (0x7U) -#define SYSCON_CMP2RRCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the CMP2 round robin clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..FRO_HF clock - * 0b011..FRO_12M clock - * 0b100..CLKIN clock - * 0b101..PLL1_clk0 clock0 - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_CMP2RRCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP2RRCLKSEL_SEL_SHIFT)) & SYSCON_CMP2RRCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name CMP2RRCLKDIV - CMP2 Round Robin Clock Division */ -/*! @{ */ - -#define SYSCON_CMP2RRCLKDIV_DIV_MASK (0xFU) -#define SYSCON_CMP2RRCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_CMP2RRCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP2RRCLKDIV_DIV_SHIFT)) & SYSCON_CMP2RRCLKDIV_DIV_MASK) - -#define SYSCON_CMP2RRCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_CMP2RRCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_CMP2RRCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP2RRCLKDIV_RESET_SHIFT)) & SYSCON_CMP2RRCLKDIV_RESET_MASK) - -#define SYSCON_CMP2RRCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_CMP2RRCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_CMP2RRCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP2RRCLKDIV_HALT_SHIFT)) & SYSCON_CMP2RRCLKDIV_HALT_MASK) - -#define SYSCON_CMP2RRCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_CMP2RRCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_CMP2RRCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP2RRCLKDIV_UNSTAB_SHIFT)) & SYSCON_CMP2RRCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name CPUCTRL - CPU Control for Multiple Processors */ -/*! @{ */ - -#define SYSCON_CPUCTRL_CPU1CLKEN_MASK (0x8U) -#define SYSCON_CPUCTRL_CPU1CLKEN_SHIFT (3U) -/*! CPU1CLKEN - Enables the CPU1 clock - * 0b1..The CPU1 clock is enabled - * 0b0..The CPU1 clock is not enabled - */ -#define SYSCON_CPUCTRL_CPU1CLKEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPUCTRL_CPU1CLKEN_SHIFT)) & SYSCON_CPUCTRL_CPU1CLKEN_MASK) - -#define SYSCON_CPUCTRL_CPU1RSTEN_MASK (0x20U) -#define SYSCON_CPUCTRL_CPU1RSTEN_SHIFT (5U) -/*! CPU1RSTEN - CPU1 reset - * 0b1..The CPU1 is reset. - * 0b0..The CPU1 is not reset. - */ -#define SYSCON_CPUCTRL_CPU1RSTEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPUCTRL_CPU1RSTEN_SHIFT)) & SYSCON_CPUCTRL_CPU1RSTEN_MASK) - -#define SYSCON_CPUCTRL_PROT_MASK (0xFFFF0000U) -#define SYSCON_CPUCTRL_PROT_SHIFT (16U) -/*! PROT - Write Protect - * 0b1100000011000100..For write operation to have an effect. - */ -#define SYSCON_CPUCTRL_PROT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPUCTRL_PROT_SHIFT)) & SYSCON_CPUCTRL_PROT_MASK) -/*! @} */ - -/*! @name CPBOOT - Coprocessor Boot Address */ -/*! @{ */ - -#define SYSCON_CPBOOT_CPBOOT_MASK (0xFFFFFF80U) -#define SYSCON_CPBOOT_CPBOOT_SHIFT (7U) -/*! CPBOOT - Coprocessor Boot VTOR Address [31:7] for CPU1 */ -#define SYSCON_CPBOOT_CPBOOT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPBOOT_CPBOOT_SHIFT)) & SYSCON_CPBOOT_CPBOOT_MASK) -/*! @} */ - -/*! @name CPUSTAT - CPU Status */ -/*! @{ */ - -#define SYSCON_CPUSTAT_CPU0SLEEPING_MASK (0x1U) -#define SYSCON_CPUSTAT_CPU0SLEEPING_SHIFT (0U) -/*! CPU0SLEEPING - CPU0 sleeping state - * 0b1..CPU is sleeping - * 0b0..CPU is not sleeping - */ -#define SYSCON_CPUSTAT_CPU0SLEEPING(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPUSTAT_CPU0SLEEPING_SHIFT)) & SYSCON_CPUSTAT_CPU0SLEEPING_MASK) - -#define SYSCON_CPUSTAT_CPU1SLEEPING_MASK (0x2U) -#define SYSCON_CPUSTAT_CPU1SLEEPING_SHIFT (1U) -/*! CPU1SLEEPING - CPU1 sleeping state - * 0b1..CPU is sleeping - * 0b0..CPU is not sleeping - */ -#define SYSCON_CPUSTAT_CPU1SLEEPING(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPUSTAT_CPU1SLEEPING_SHIFT)) & SYSCON_CPUSTAT_CPU1SLEEPING_MASK) - -#define SYSCON_CPUSTAT_CPU0LOCKUP_MASK (0x4U) -#define SYSCON_CPUSTAT_CPU0LOCKUP_SHIFT (2U) -/*! CPU0LOCKUP - CPU0 lockup state - * 0b1..CPU is in lockup - * 0b0..CPU is not in lockup - */ -#define SYSCON_CPUSTAT_CPU0LOCKUP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPUSTAT_CPU0LOCKUP_SHIFT)) & SYSCON_CPUSTAT_CPU0LOCKUP_MASK) - -#define SYSCON_CPUSTAT_CPU1LOCKUP_MASK (0x8U) -#define SYSCON_CPUSTAT_CPU1LOCKUP_SHIFT (3U) -/*! CPU1LOCKUP - CPU1 lockup state - * 0b1..CPU is in lockup - * 0b0..CPU is not in lockup - */ -#define SYSCON_CPUSTAT_CPU1LOCKUP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPUSTAT_CPU1LOCKUP_SHIFT)) & SYSCON_CPUSTAT_CPU1LOCKUP_MASK) -/*! @} */ - -/*! @name LPCAC_CTRL - LPCAC Control */ -/*! @{ */ - -#define SYSCON_LPCAC_CTRL_DIS_LPCAC_MASK (0x1U) -#define SYSCON_LPCAC_CTRL_DIS_LPCAC_SHIFT (0U) -/*! DIS_LPCAC - Disables/enables the cache function. - * 0b0..Enabled - * 0b1..Disabled - */ -#define SYSCON_LPCAC_CTRL_DIS_LPCAC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_DIS_LPCAC_SHIFT)) & SYSCON_LPCAC_CTRL_DIS_LPCAC_MASK) - -#define SYSCON_LPCAC_CTRL_CLR_LPCAC_MASK (0x2U) -#define SYSCON_LPCAC_CTRL_CLR_LPCAC_SHIFT (1U) -/*! CLR_LPCAC - Clears the cache function. - * 0b0..Unclears the cache - * 0b1..Clears the cache - */ -#define SYSCON_LPCAC_CTRL_CLR_LPCAC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_CLR_LPCAC_SHIFT)) & SYSCON_LPCAC_CTRL_CLR_LPCAC_MASK) - -#define SYSCON_LPCAC_CTRL_FRC_NO_ALLOC_MASK (0x4U) -#define SYSCON_LPCAC_CTRL_FRC_NO_ALLOC_SHIFT (2U) -/*! FRC_NO_ALLOC - Forces no allocation. - * 0b0..Forces allocation - * 0b1..Forces no allocation - */ -#define SYSCON_LPCAC_CTRL_FRC_NO_ALLOC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_FRC_NO_ALLOC_SHIFT)) & SYSCON_LPCAC_CTRL_FRC_NO_ALLOC_MASK) - -#define SYSCON_LPCAC_CTRL_PARITY_MISS_EN_MASK (0x8U) -#define SYSCON_LPCAC_CTRL_PARITY_MISS_EN_SHIFT (3U) -/*! PARITY_MISS_EN - Enables parity miss. - * 0b0..Disabled - * 0b1..Enables parity, miss on parity error - */ -#define SYSCON_LPCAC_CTRL_PARITY_MISS_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_PARITY_MISS_EN_SHIFT)) & SYSCON_LPCAC_CTRL_PARITY_MISS_EN_MASK) - -#define SYSCON_LPCAC_CTRL_DIS_LPCAC_WTBF_MASK (0x10U) -#define SYSCON_LPCAC_CTRL_DIS_LPCAC_WTBF_SHIFT (4U) -/*! DIS_LPCAC_WTBF - Disable LPCAC Write Through Buffer. - * 0b1..Disables write through buffer - * 0b0..Enables write through buffer - */ -#define SYSCON_LPCAC_CTRL_DIS_LPCAC_WTBF(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_DIS_LPCAC_WTBF_SHIFT)) & SYSCON_LPCAC_CTRL_DIS_LPCAC_WTBF_MASK) - -#define SYSCON_LPCAC_CTRL_LIM_LPCAC_WTBF_MASK (0x20U) -#define SYSCON_LPCAC_CTRL_LIM_LPCAC_WTBF_SHIFT (5U) -/*! LIM_LPCAC_WTBF - Limit LPCAC Write Through Buffer. - * 0b1..Write buffer enabled when transaction is cacheable and bufferable - * 0b0..Write buffer enabled when transaction is bufferable. - */ -#define SYSCON_LPCAC_CTRL_LIM_LPCAC_WTBF(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_LIM_LPCAC_WTBF_SHIFT)) & SYSCON_LPCAC_CTRL_LIM_LPCAC_WTBF_MASK) - -#define SYSCON_LPCAC_CTRL_PARITY_FAULT_EN_MASK (0x40U) -#define SYSCON_LPCAC_CTRL_PARITY_FAULT_EN_SHIFT (6U) -/*! PARITY_FAULT_EN - Enable parity error report. - * 0b1..Enables parity error report - * 0b0..Disables parity error report - */ -#define SYSCON_LPCAC_CTRL_PARITY_FAULT_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_PARITY_FAULT_EN_SHIFT)) & SYSCON_LPCAC_CTRL_PARITY_FAULT_EN_MASK) - -#define SYSCON_LPCAC_CTRL_LPCAC_XOM_MASK (0x80U) -#define SYSCON_LPCAC_CTRL_LPCAC_XOM_SHIFT (7U) -/*! LPCAC_XOM - LPCAC XOM(eXecute-Only-Memory) attribute control - * 0b1..Enabled. - * 0b0..Disabled. - */ -#define SYSCON_LPCAC_CTRL_LPCAC_XOM(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_LPCAC_XOM_SHIFT)) & SYSCON_LPCAC_CTRL_LPCAC_XOM_MASK) -/*! @} */ - -/*! @name FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV - LP_FLEXCOMM Clock Divider */ -/*! @{ */ - -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_DIV_SHIFT)) & SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_DIV_MASK) - -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_RESET_SHIFT)) & SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_RESET_MASK) - -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_HALT_SHIFT)) & SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_HALT_MASK) - -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_UNSTAB_SHIFT)) & SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_UNSTAB_MASK) -/*! @} */ - -/* The count of SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV */ -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_COUNT (10U) - -/*! @name UTICKCLKSEL - UTICK Function Clock Source Select */ -/*! @{ */ - -#define SYSCON_UTICKCLKSEL_SEL_MASK (0x3U) -#define SYSCON_UTICKCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the clock source - * 0b00..clk_in - * 0b01..xtal32k[2] - * 0b10..clk_1m clock - * 0b11..No clock - */ -#define SYSCON_UTICKCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_UTICKCLKSEL_SEL_SHIFT)) & SYSCON_UTICKCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name SAI0CLKSEL - SAI0 Function Clock Source Select */ -/*! @{ */ - -#define SYSCON_SAI0CLKSEL_SEL_MASK (0x7U) -#define SYSCON_SAI0CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the clock source - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..FRO_HF clock - * 0b100..PLL1_CLK0 clock - * 0b101..No clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_SAI0CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SAI0CLKSEL_SEL_SHIFT)) & SYSCON_SAI0CLKSEL_SEL_MASK) -/*! @} */ - -/*! @name SAI1CLKSEL - SAI1 Function Clock Source Select */ -/*! @{ */ - -#define SYSCON_SAI1CLKSEL_SEL_MASK (0x7U) -#define SYSCON_SAI1CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the clock source - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..FRO_HF clock - * 0b100..PLL1_CLK0 clock - * 0b101..No clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_SAI1CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SAI1CLKSEL_SEL_SHIFT)) & SYSCON_SAI1CLKSEL_SEL_MASK) -/*! @} */ - -/*! @name SAI0CLKDIV - SAI0 Function Clock Division */ -/*! @{ */ - -#define SYSCON_SAI0CLKDIV_DIV_MASK (0x7U) -#define SYSCON_SAI0CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_SAI0CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SAI0CLKDIV_DIV_SHIFT)) & SYSCON_SAI0CLKDIV_DIV_MASK) - -#define SYSCON_SAI0CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_SAI0CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_SAI0CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SAI0CLKDIV_RESET_SHIFT)) & SYSCON_SAI0CLKDIV_RESET_MASK) - -#define SYSCON_SAI0CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_SAI0CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_SAI0CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SAI0CLKDIV_HALT_SHIFT)) & SYSCON_SAI0CLKDIV_HALT_MASK) - -#define SYSCON_SAI0CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_SAI0CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_SAI0CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SAI0CLKDIV_UNSTAB_SHIFT)) & SYSCON_SAI0CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name SAI1CLKDIV - SAI1 Function Clock Division */ -/*! @{ */ - -#define SYSCON_SAI1CLKDIV_DIV_MASK (0x7U) -#define SYSCON_SAI1CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_SAI1CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SAI1CLKDIV_DIV_SHIFT)) & SYSCON_SAI1CLKDIV_DIV_MASK) - -#define SYSCON_SAI1CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_SAI1CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_SAI1CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SAI1CLKDIV_RESET_SHIFT)) & SYSCON_SAI1CLKDIV_RESET_MASK) - -#define SYSCON_SAI1CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_SAI1CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_SAI1CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SAI1CLKDIV_HALT_SHIFT)) & SYSCON_SAI1CLKDIV_HALT_MASK) - -#define SYSCON_SAI1CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_SAI1CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_SAI1CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SAI1CLKDIV_UNSTAB_SHIFT)) & SYSCON_SAI1CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name EMVSIM0CLKSEL - EMVSIM0 Clock Source Select */ -/*! @{ */ - -#define SYSCON_EMVSIM0CLKSEL_SEL_MASK (0x7U) -#define SYSCON_EMVSIM0CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the EMVSIM0 function clock source - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..FRO_HF clock - * 0b100..FRO_12M clock - * 0b101..PLL1_clk0 clock0 - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_EMVSIM0CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_EMVSIM0CLKSEL_SEL_SHIFT)) & SYSCON_EMVSIM0CLKSEL_SEL_MASK) -/*! @} */ - -/*! @name EMVSIM1CLKSEL - EMVSIM1 Clock Source Select */ -/*! @{ */ - -#define SYSCON_EMVSIM1CLKSEL_SEL_MASK (0x7U) -#define SYSCON_EMVSIM1CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the EMVSIM1 function clock source - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..FRO_HF clock - * 0b100..FRO_12M clock - * 0b101..PLL1_clk0 clock0 - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_EMVSIM1CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_EMVSIM1CLKSEL_SEL_SHIFT)) & SYSCON_EMVSIM1CLKSEL_SEL_MASK) -/*! @} */ - -/*! @name EMVSIM0CLKDIV - EMVSIM0 Function Clock Division */ -/*! @{ */ - -#define SYSCON_EMVSIM0CLKDIV_DIV_MASK (0x7U) -#define SYSCON_EMVSIM0CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_EMVSIM0CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_EMVSIM0CLKDIV_DIV_SHIFT)) & SYSCON_EMVSIM0CLKDIV_DIV_MASK) - -#define SYSCON_EMVSIM0CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_EMVSIM0CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_EMVSIM0CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_EMVSIM0CLKDIV_RESET_SHIFT)) & SYSCON_EMVSIM0CLKDIV_RESET_MASK) - -#define SYSCON_EMVSIM0CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_EMVSIM0CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_EMVSIM0CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_EMVSIM0CLKDIV_HALT_SHIFT)) & SYSCON_EMVSIM0CLKDIV_HALT_MASK) - -#define SYSCON_EMVSIM0CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_EMVSIM0CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_EMVSIM0CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_EMVSIM0CLKDIV_UNSTAB_SHIFT)) & SYSCON_EMVSIM0CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name EMVSIM1CLKDIV - EMVSIM1 Function Clock Division */ -/*! @{ */ - -#define SYSCON_EMVSIM1CLKDIV_DIV_MASK (0x7U) -#define SYSCON_EMVSIM1CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_EMVSIM1CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_EMVSIM1CLKDIV_DIV_SHIFT)) & SYSCON_EMVSIM1CLKDIV_DIV_MASK) - -#define SYSCON_EMVSIM1CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_EMVSIM1CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_EMVSIM1CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_EMVSIM1CLKDIV_RESET_SHIFT)) & SYSCON_EMVSIM1CLKDIV_RESET_MASK) - -#define SYSCON_EMVSIM1CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_EMVSIM1CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_EMVSIM1CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_EMVSIM1CLKDIV_HALT_SHIFT)) & SYSCON_EMVSIM1CLKDIV_HALT_MASK) - -#define SYSCON_EMVSIM1CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_EMVSIM1CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_EMVSIM1CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_EMVSIM1CLKDIV_UNSTAB_SHIFT)) & SYSCON_EMVSIM1CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name KEY_RETAIN_CTRL - Key Retain Control */ -/*! @{ */ - -#define SYSCON_KEY_RETAIN_CTRL_KEY_RETAIN_VALID_MASK (0x1U) -#define SYSCON_KEY_RETAIN_CTRL_KEY_RETAIN_VALID_SHIFT (0U) -/*! KEY_RETAIN_VALID - Indicates if the PUF key has been retained in the VBAT domain and has not - * been reset or otherwise invalidated by software. - * 0b0..PUF key is not retained in VBAT domain. - * 0b1..PUF key is retained in VBAT domain. - */ -#define SYSCON_KEY_RETAIN_CTRL_KEY_RETAIN_VALID(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_KEY_RETAIN_CTRL_KEY_RETAIN_VALID_SHIFT)) & SYSCON_KEY_RETAIN_CTRL_KEY_RETAIN_VALID_MASK) - -#define SYSCON_KEY_RETAIN_CTRL_KEY_RETAIN_DONE_MASK (0x2U) -#define SYSCON_KEY_RETAIN_CTRL_KEY_RETAIN_DONE_SHIFT (1U) -/*! KEY_RETAIN_DONE - Indicates the successful completion of the key_save or key_load routine. Once - * set, to clear the key_retain_done flag, both key_save and key_load should be cleared by - * software. - * 0b0..Key save / load sequence has not completed. - * 0b1..Key save / load sequence has completed. - */ -#define SYSCON_KEY_RETAIN_CTRL_KEY_RETAIN_DONE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_KEY_RETAIN_CTRL_KEY_RETAIN_DONE_SHIFT)) & SYSCON_KEY_RETAIN_CTRL_KEY_RETAIN_DONE_MASK) - -#define SYSCON_KEY_RETAIN_CTRL_KEY_SAVE_MASK (0x10000U) -#define SYSCON_KEY_RETAIN_CTRL_KEY_SAVE_SHIFT (16U) -/*! KEY_SAVE - * 0b0..Key save sequence is disabled. - * 0b1..Key save sequence is enabled. - */ -#define SYSCON_KEY_RETAIN_CTRL_KEY_SAVE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_KEY_RETAIN_CTRL_KEY_SAVE_SHIFT)) & SYSCON_KEY_RETAIN_CTRL_KEY_SAVE_MASK) - -#define SYSCON_KEY_RETAIN_CTRL_KEY_LOAD_MASK (0x20000U) -#define SYSCON_KEY_RETAIN_CTRL_KEY_LOAD_SHIFT (17U) -/*! KEY_LOAD - * 0b0..Key load sequence is disabled. - * 0b1..Key load sequence is enabled. - */ -#define SYSCON_KEY_RETAIN_CTRL_KEY_LOAD(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_KEY_RETAIN_CTRL_KEY_LOAD_SHIFT)) & SYSCON_KEY_RETAIN_CTRL_KEY_LOAD_MASK) -/*! @} */ - -/*! @name REF_CLK_CTRL - FRO 48MHz Reference Clock Control */ -/*! @{ */ - -#define SYSCON_REF_CLK_CTRL_GDET_REFCLK_EN_MASK (0x1U) -#define SYSCON_REF_CLK_CTRL_GDET_REFCLK_EN_SHIFT (0U) -/*! GDET_REFCLK_EN - GDET reference clock enable bit - * 0b1..Enabled - * 0b0..Disabled. - */ -#define SYSCON_REF_CLK_CTRL_GDET_REFCLK_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_REF_CLK_CTRL_GDET_REFCLK_EN_SHIFT)) & SYSCON_REF_CLK_CTRL_GDET_REFCLK_EN_MASK) - -#define SYSCON_REF_CLK_CTRL_TRNG_REFCLK_EN_MASK (0x2U) -#define SYSCON_REF_CLK_CTRL_TRNG_REFCLK_EN_SHIFT (1U) -/*! TRNG_REFCLK_EN - ELS TRNG reference clock enable bit - * 0b1..Enabled - * 0b0..Disabled. - */ -#define SYSCON_REF_CLK_CTRL_TRNG_REFCLK_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_REF_CLK_CTRL_TRNG_REFCLK_EN_SHIFT)) & SYSCON_REF_CLK_CTRL_TRNG_REFCLK_EN_MASK) -/*! @} */ - -/*! @name REF_CLK_CTRL_SET - FRO 48MHz Reference Clock Control Set */ -/*! @{ */ - -#define SYSCON_REF_CLK_CTRL_SET_GDET_REFCLK_EN_SET_MASK (0x1U) -#define SYSCON_REF_CLK_CTRL_SET_GDET_REFCLK_EN_SET_SHIFT (0U) -/*! GDET_REFCLK_EN_SET - GDET reference clock enable set bit - * 0b1..Set to 1 - * 0b0..No effect. - */ -#define SYSCON_REF_CLK_CTRL_SET_GDET_REFCLK_EN_SET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_REF_CLK_CTRL_SET_GDET_REFCLK_EN_SET_SHIFT)) & SYSCON_REF_CLK_CTRL_SET_GDET_REFCLK_EN_SET_MASK) - -#define SYSCON_REF_CLK_CTRL_SET_TRNG_REFCLK_EN_SET_MASK (0x2U) -#define SYSCON_REF_CLK_CTRL_SET_TRNG_REFCLK_EN_SET_SHIFT (1U) -/*! TRNG_REFCLK_EN_SET - ELS TRNG reference clock enable set bit - * 0b1..Set to 1 - * 0b0..No effect. - */ -#define SYSCON_REF_CLK_CTRL_SET_TRNG_REFCLK_EN_SET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_REF_CLK_CTRL_SET_TRNG_REFCLK_EN_SET_SHIFT)) & SYSCON_REF_CLK_CTRL_SET_TRNG_REFCLK_EN_SET_MASK) -/*! @} */ - -/*! @name REF_CLK_CTRL_CLR - FRO 48MHz Reference Clock Control Clear */ -/*! @{ */ - -#define SYSCON_REF_CLK_CTRL_CLR_GDET_REFCLK_EN_CLR_MASK (0x1U) -#define SYSCON_REF_CLK_CTRL_CLR_GDET_REFCLK_EN_CLR_SHIFT (0U) -/*! GDET_REFCLK_EN_CLR - GDET reference clock enable clear bit - * 0b1..Set to 0 - * 0b0..No effect. - */ -#define SYSCON_REF_CLK_CTRL_CLR_GDET_REFCLK_EN_CLR(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_REF_CLK_CTRL_CLR_GDET_REFCLK_EN_CLR_SHIFT)) & SYSCON_REF_CLK_CTRL_CLR_GDET_REFCLK_EN_CLR_MASK) - -#define SYSCON_REF_CLK_CTRL_CLR_TRNG_REFCLK_EN_CLR_MASK (0x2U) -#define SYSCON_REF_CLK_CTRL_CLR_TRNG_REFCLK_EN_CLR_SHIFT (1U) -/*! TRNG_REFCLK_EN_CLR - ELS TRNG reference clock enable clear bit - * 0b1..Set to 0 - * 0b0..No effect. - */ -#define SYSCON_REF_CLK_CTRL_CLR_TRNG_REFCLK_EN_CLR(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_REF_CLK_CTRL_CLR_TRNG_REFCLK_EN_CLR_SHIFT)) & SYSCON_REF_CLK_CTRL_CLR_TRNG_REFCLK_EN_CLR_MASK) -/*! @} */ - -/*! @name GDETX_CTRL_GDET_CTRL - GDET Control Register */ -/*! @{ */ - -#define SYSCON_GDETX_CTRL_GDET_CTRL_GDET_EVTCNT_CLR_MASK (0x1U) -#define SYSCON_GDETX_CTRL_GDET_CTRL_GDET_EVTCNT_CLR_SHIFT (0U) -/*! GDET_EVTCNT_CLR - Controls the GDET clean event counter - * 0b1..Clears event counter - * 0b0..Event counter not cleared - */ -#define SYSCON_GDETX_CTRL_GDET_CTRL_GDET_EVTCNT_CLR(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GDETX_CTRL_GDET_CTRL_GDET_EVTCNT_CLR_SHIFT)) & SYSCON_GDETX_CTRL_GDET_CTRL_GDET_EVTCNT_CLR_MASK) - -#define SYSCON_GDETX_CTRL_GDET_CTRL_GDET_ERR_CLR_MASK (0x2U) -#define SYSCON_GDETX_CTRL_GDET_CTRL_GDET_ERR_CLR_SHIFT (1U) -/*! GDET_ERR_CLR - Clears GDET error status - * 0b1..Clears error status - * 0b0..Error status not cleared - */ -#define SYSCON_GDETX_CTRL_GDET_CTRL_GDET_ERR_CLR(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GDETX_CTRL_GDET_CTRL_GDET_ERR_CLR_SHIFT)) & SYSCON_GDETX_CTRL_GDET_CTRL_GDET_ERR_CLR_MASK) - -#define SYSCON_GDETX_CTRL_GDET_CTRL_GDET_ISO_SW_MASK (0xCU) -#define SYSCON_GDETX_CTRL_GDET_CTRL_GDET_ISO_SW_SHIFT (2U) -/*! GDET_ISO_SW - GDET isolation control - * 0b10..Isolation is enabled. When both GDET0_CTRL/GDET1_CTRL GDET_ISO_SW are "10", isolation_on is asserted. - * 0b00..Isolation is disabled - * 0b01..Isolation is disabled - * 0b11..Isolation is disabled - */ -#define SYSCON_GDETX_CTRL_GDET_CTRL_GDET_ISO_SW(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GDETX_CTRL_GDET_CTRL_GDET_ISO_SW_SHIFT)) & SYSCON_GDETX_CTRL_GDET_CTRL_GDET_ISO_SW_MASK) - -#define SYSCON_GDETX_CTRL_GDET_CTRL_EVENT_CNT_MASK (0xFF00U) -#define SYSCON_GDETX_CTRL_GDET_CTRL_EVENT_CNT_SHIFT (8U) -/*! EVENT_CNT - Event count value */ -#define SYSCON_GDETX_CTRL_GDET_CTRL_EVENT_CNT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GDETX_CTRL_GDET_CTRL_EVENT_CNT_SHIFT)) & SYSCON_GDETX_CTRL_GDET_CTRL_EVENT_CNT_MASK) - -#define SYSCON_GDETX_CTRL_GDET_CTRL_POS_SYNC_MASK (0x10000U) -#define SYSCON_GDETX_CTRL_GDET_CTRL_POS_SYNC_SHIFT (16U) -/*! POS_SYNC - Positive glitch detected - * 0b1..Positive glitch detected - * 0b0..Positive glitch not detected - */ -#define SYSCON_GDETX_CTRL_GDET_CTRL_POS_SYNC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GDETX_CTRL_GDET_CTRL_POS_SYNC_SHIFT)) & SYSCON_GDETX_CTRL_GDET_CTRL_POS_SYNC_MASK) - -#define SYSCON_GDETX_CTRL_GDET_CTRL_NEG_SYNC_MASK (0x20000U) -#define SYSCON_GDETX_CTRL_GDET_CTRL_NEG_SYNC_SHIFT (17U) -/*! NEG_SYNC - Negative glitch detected - * 0b1..Negative glitch detected - * 0b0..Negative glitch not detected - */ -#define SYSCON_GDETX_CTRL_GDET_CTRL_NEG_SYNC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GDETX_CTRL_GDET_CTRL_NEG_SYNC_SHIFT)) & SYSCON_GDETX_CTRL_GDET_CTRL_NEG_SYNC_MASK) - -#define SYSCON_GDETX_CTRL_GDET_CTRL_EVENT_CLR_FLAG_MASK (0x40000U) -#define SYSCON_GDETX_CTRL_GDET_CTRL_EVENT_CLR_FLAG_SHIFT (18U) -/*! EVENT_CLR_FLAG - Event counter cleared - * 0b1..Event counter cleared - * 0b0..Event counter not cleared - */ -#define SYSCON_GDETX_CTRL_GDET_CTRL_EVENT_CLR_FLAG(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GDETX_CTRL_GDET_CTRL_EVENT_CLR_FLAG_SHIFT)) & SYSCON_GDETX_CTRL_GDET_CTRL_EVENT_CLR_FLAG_MASK) -/*! @} */ - -/* The count of SYSCON_GDETX_CTRL_GDET_CTRL */ -#define SYSCON_GDETX_CTRL_GDET_CTRL_COUNT (2U) - -/*! @name ELS_ASSET_PROT - ELS Asset Protection Register */ -/*! @{ */ - -#define SYSCON_ELS_ASSET_PROT_ASSET_PROTECTION_MASK (0x3U) -#define SYSCON_ELS_ASSET_PROT_ASSET_PROTECTION_SHIFT (0U) -/*! ASSET_PROTECTION - ELS asset protection. This field controls the asset protection port to the - * ELS module. Refer to the ELS chapter in the SRM for more details. - * 0b00..ELS asset is protected - * 0b10..ELS asset is protected - * 0b11..ELS asset is protected - * 0b01..ELS asset is not protected - */ -#define SYSCON_ELS_ASSET_PROT_ASSET_PROTECTION(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_ASSET_PROT_ASSET_PROTECTION_SHIFT)) & SYSCON_ELS_ASSET_PROT_ASSET_PROTECTION_MASK) -/*! @} */ - -/*! @name ELS_LOCK_CTRL - ELS Lock Control */ -/*! @{ */ - -#define SYSCON_ELS_LOCK_CTRL_LOCK_CTRL_MASK (0x3U) -#define SYSCON_ELS_LOCK_CTRL_LOCK_CTRL_SHIFT (0U) -/*! LOCK_CTRL - ELS Lock Control */ -#define SYSCON_ELS_LOCK_CTRL_LOCK_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_LOCK_CTRL_LOCK_CTRL_SHIFT)) & SYSCON_ELS_LOCK_CTRL_LOCK_CTRL_MASK) -/*! @} */ - -/*! @name ELS_LOCK_CTRL_DP - ELS Lock Control DP */ -/*! @{ */ - -#define SYSCON_ELS_LOCK_CTRL_DP_LOCK_CTRL_DP_MASK (0x3U) -#define SYSCON_ELS_LOCK_CTRL_DP_LOCK_CTRL_DP_SHIFT (0U) -/*! LOCK_CTRL_DP - Refer to ELS_LOCK_CTRL[1:0] */ -#define SYSCON_ELS_LOCK_CTRL_DP_LOCK_CTRL_DP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_LOCK_CTRL_DP_LOCK_CTRL_DP_SHIFT)) & SYSCON_ELS_LOCK_CTRL_DP_LOCK_CTRL_DP_MASK) -/*! @} */ - -/*! @name ELS_OTP_LC_STATE - Life Cycle State Register */ -/*! @{ */ - -#define SYSCON_ELS_OTP_LC_STATE_OTP_LC_STATE_MASK (0xFFU) -#define SYSCON_ELS_OTP_LC_STATE_OTP_LC_STATE_SHIFT (0U) -/*! OTP_LC_STATE - OTP life cycle state */ -#define SYSCON_ELS_OTP_LC_STATE_OTP_LC_STATE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_OTP_LC_STATE_OTP_LC_STATE_SHIFT)) & SYSCON_ELS_OTP_LC_STATE_OTP_LC_STATE_MASK) -/*! @} */ - -/*! @name ELS_OTP_LC_STATE_DP - Life Cycle State Register (Duplicate) */ -/*! @{ */ - -#define SYSCON_ELS_OTP_LC_STATE_DP_OTP_LC_STATE_DP_MASK (0xFFU) -#define SYSCON_ELS_OTP_LC_STATE_DP_OTP_LC_STATE_DP_SHIFT (0U) -/*! OTP_LC_STATE_DP - OTP life cycle state */ -#define SYSCON_ELS_OTP_LC_STATE_DP_OTP_LC_STATE_DP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_OTP_LC_STATE_DP_OTP_LC_STATE_DP_SHIFT)) & SYSCON_ELS_OTP_LC_STATE_DP_OTP_LC_STATE_DP_MASK) -/*! @} */ - -/*! @name ELS_TEMPORAL_STATE - ELS Temporal State */ -/*! @{ */ - -#define SYSCON_ELS_TEMPORAL_STATE_TEMPORAL_STATE_MASK (0xFU) -#define SYSCON_ELS_TEMPORAL_STATE_TEMPORAL_STATE_SHIFT (0U) -/*! TEMPORAL_STATE - Temporal state */ -#define SYSCON_ELS_TEMPORAL_STATE_TEMPORAL_STATE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_TEMPORAL_STATE_TEMPORAL_STATE_SHIFT)) & SYSCON_ELS_TEMPORAL_STATE_TEMPORAL_STATE_MASK) -/*! @} */ - -/*! @name ELS_KDF_MASK - Key Derivation Function Mask */ -/*! @{ */ - -#define SYSCON_ELS_KDF_MASK_KDF_MASK_MASK (0xFFFFFFFFU) -#define SYSCON_ELS_KDF_MASK_KDF_MASK_SHIFT (0U) -/*! KDF_MASK - Key derivation function mask */ -#define SYSCON_ELS_KDF_MASK_KDF_MASK(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_KDF_MASK_KDF_MASK_SHIFT)) & SYSCON_ELS_KDF_MASK_KDF_MASK_MASK) -/*! @} */ - -/*! @name ELS_AS_CFG0 - ELS AS Configuration */ -/*! @{ */ - -#define SYSCON_ELS_AS_CFG0_CFG_LC_STATE_MASK (0xFFU) -#define SYSCON_ELS_AS_CFG0_CFG_LC_STATE_SHIFT (0U) -/*! CFG_LC_STATE - LC state configuration bit */ -#define SYSCON_ELS_AS_CFG0_CFG_LC_STATE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_LC_STATE_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_LC_STATE_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_LVD_CORE_RESET_ENABLED_MASK (0x200U) -#define SYSCON_ELS_AS_CFG0_CFG_LVD_CORE_RESET_ENABLED_SHIFT (9U) -/*! CFG_LVD_CORE_RESET_ENABLED - When SPC CORE LVD analog detector are turned on, and CORE LVD reset are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_LVD_CORE_RESET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_LVD_CORE_RESET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_LVD_CORE_RESET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_LVD_CORE_IRQ_ENABLED_MASK (0x800U) -#define SYSCON_ELS_AS_CFG0_CFG_LVD_CORE_IRQ_ENABLED_SHIFT (11U) -/*! CFG_LVD_CORE_IRQ_ENABLED - When SPC CORE LVD analog detector are turned on, and CORE LVD IRQ are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_LVD_CORE_IRQ_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_LVD_CORE_IRQ_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_LVD_CORE_IRQ_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_WDT0_ENABLED_MASK (0x1000U) -#define SYSCON_ELS_AS_CFG0_CFG_WDT0_ENABLED_SHIFT (12U) -/*! CFG_WDT0_ENABLED - When WatchDog Timer 0 is activated, this bit indicates state 1 */ -#define SYSCON_ELS_AS_CFG0_CFG_WDT0_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_WDT0_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_WDT0_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_CWDT0_ENABLED_MASK (0x2000U) -#define SYSCON_ELS_AS_CFG0_CFG_CWDT0_ENABLED_SHIFT (13U) -/*! CFG_CWDT0_ENABLED - When Code WatchDog Timer 0 is activated, this bit indicates state 1 */ -#define SYSCON_ELS_AS_CFG0_CFG_CWDT0_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_CWDT0_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_CWDT0_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_ELS_GDET_ENABLED_MASK (0x4000U) -#define SYSCON_ELS_AS_CFG0_CFG_ELS_GDET_ENABLED_SHIFT (14U) -/*! CFG_ELS_GDET_ENABLED - When either GDET is enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_ELS_GDET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_ELS_GDET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_ELS_GDET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_ANA_GDET_RESET_ENABLED_MASK (0x8000U) -#define SYSCON_ELS_AS_CFG0_CFG_ANA_GDET_RESET_ENABLED_SHIFT (15U) -/*! CFG_ANA_GDET_RESET_ENABLED - When SPC analog glitch detect reset is enabled, this bit indicates state 1 */ -#define SYSCON_ELS_AS_CFG0_CFG_ANA_GDET_RESET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_ANA_GDET_RESET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_ANA_GDET_RESET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_ANA_GDET_IRQ_ENABLED_MASK (0x10000U) -#define SYSCON_ELS_AS_CFG0_CFG_ANA_GDET_IRQ_ENABLED_SHIFT (16U) -/*! CFG_ANA_GDET_IRQ_ENABLED - When SPC analog glitch detect IRQ is enabled, this bit indicates state 1 */ -#define SYSCON_ELS_AS_CFG0_CFG_ANA_GDET_IRQ_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_ANA_GDET_IRQ_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_ANA_GDET_IRQ_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_TAMPER_DET_ENABLED_MASK (0x20000U) -#define SYSCON_ELS_AS_CFG0_CFG_TAMPER_DET_ENABLED_SHIFT (17U) -/*! CFG_TAMPER_DET_ENABLED - When tamper detector is enabled in TDET, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_TAMPER_DET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_TAMPER_DET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_TAMPER_DET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VSYS_RESET_ENABLED_MASK (0x40000U) -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VSYS_RESET_ENABLED_SHIFT (18U) -/*! CFG_LVD_VSYS_RESET_ENABLED - When SPC VSYS LVD analog detector are turned on and VSYS LVD reset are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VSYS_RESET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_LVD_VSYS_RESET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_LVD_VSYS_RESET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VDDIO_RESET_ENABLED_MASK (0x80000U) -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VDDIO_RESET_ENABLED_SHIFT (19U) -/*! CFG_LVD_VDDIO_RESET_ENABLED - When SPC VDDIO LVD analog detector are turned on and VDDIO LVD reset are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VDDIO_RESET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_LVD_VDDIO_RESET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_LVD_VDDIO_RESET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VSYS_IRQ_ENABLED_MASK (0x100000U) -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VSYS_IRQ_ENABLED_SHIFT (20U) -/*! CFG_LVD_VSYS_IRQ_ENABLED - When SPC VSYS LVD analog detector are turned on and VSYS LVD irq are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VSYS_IRQ_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_LVD_VSYS_IRQ_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_LVD_VSYS_IRQ_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VDDIO_IRQ_ENABLED_MASK (0x200000U) -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VDDIO_IRQ_ENABLED_SHIFT (21U) -/*! CFG_LVD_VDDIO_IRQ_ENABLED - When SPC VDDIO LVD analog detector are turned on and VDDIO LVD irq are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VDDIO_IRQ_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_LVD_VDDIO_IRQ_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_LVD_VDDIO_IRQ_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_WDT1_ENABLED_MASK (0x400000U) -#define SYSCON_ELS_AS_CFG0_CFG_WDT1_ENABLED_SHIFT (22U) -/*! CFG_WDT1_ENABLED - When WatchDog Timer 1 is activated, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_WDT1_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_WDT1_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_WDT1_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_CWDT1_ENABLED_MASK (0x800000U) -#define SYSCON_ELS_AS_CFG0_CFG_CWDT1_ENABLED_SHIFT (23U) -/*! CFG_CWDT1_ENABLED - When Code WatchDog Timer 1 is activated, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_CWDT1_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_CWDT1_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_CWDT1_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_TEMPTAMPER_DET_ENABLED_MASK (0x1000000U) -#define SYSCON_ELS_AS_CFG0_CFG_TEMPTAMPER_DET_ENABLED_SHIFT (24U) -/*! CFG_TEMPTAMPER_DET_ENABLED - When temperature tamper detector is enabled in VBAT, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_TEMPTAMPER_DET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_TEMPTAMPER_DET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_TEMPTAMPER_DET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_VOLTAMPER_DET_ENABLED_MASK (0x2000000U) -#define SYSCON_ELS_AS_CFG0_CFG_VOLTAMPER_DET_ENABLED_SHIFT (25U) -/*! CFG_VOLTAMPER_DET_ENABLED - When voltage tamper detector is enabled in VBAT, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_VOLTAMPER_DET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_VOLTAMPER_DET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_VOLTAMPER_DET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_LHTTAMPER_DET_ENABLED_MASK (0x4000000U) -#define SYSCON_ELS_AS_CFG0_CFG_LHTTAMPER_DET_ENABLED_SHIFT (26U) -/*! CFG_LHTTAMPER_DET_ENABLED - When light tamper detector is enabled in VBAT, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_LHTTAMPER_DET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_LHTTAMPER_DET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_LHTTAMPER_DET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_CLKTAMPER_DET_ENABLED_MASK (0x8000000U) -#define SYSCON_ELS_AS_CFG0_CFG_CLKTAMPER_DET_ENABLED_SHIFT (27U) -/*! CFG_CLKTAMPER_DET_ENABLED - When clk tamper detector is enabled in VBAT, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_CLKTAMPER_DET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_CLKTAMPER_DET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_CLKTAMPER_DET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_QK_DISABLE_ENROLL_MASK (0x10000000U) -#define SYSCON_ELS_AS_CFG0_CFG_QK_DISABLE_ENROLL_SHIFT (28U) -/*! CFG_QK_DISABLE_ENROLL - When QK PUF "qk_disable_enroll" input is driven 1, this bit indicates state 1 */ -#define SYSCON_ELS_AS_CFG0_CFG_QK_DISABLE_ENROLL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_QK_DISABLE_ENROLL_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_QK_DISABLE_ENROLL_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_QK_DISABLE_WRAP_MASK (0x20000000U) -#define SYSCON_ELS_AS_CFG0_CFG_QK_DISABLE_WRAP_SHIFT (29U) -/*! CFG_QK_DISABLE_WRAP - When QK PUF "qk_disable_wrap" input is driven 1, this bit indicates state 1 */ -#define SYSCON_ELS_AS_CFG0_CFG_QK_DISABLE_WRAP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_QK_DISABLE_WRAP_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_QK_DISABLE_WRAP_MASK) -/*! @} */ - -/*! @name ELS_AS_CFG1 - ELS AS Configuration1 */ -/*! @{ */ - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_DIS_STRICT_MODE_MASK (0x2U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_DIS_STRICT_MODE_SHIFT (1U) -/*! CFG_SEC_DIS_STRICT_MODE - When CFG_SEC_ENA_SEC_CHK indicates state 0 or when DISABLE_STRICT_MODE - * bits in MISC_CTRL_REG and MISC_CTRL_DP_REG on the AHB secure controller are equal to 01, this - * bit indicates state 1 - */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_DIS_STRICT_MODE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_DIS_STRICT_MODE_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_DIS_STRICT_MODE_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_DIS_VIOL_ABORT_MASK (0x4U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_DIS_VIOL_ABORT_SHIFT (2U) -/*! CFG_SEC_DIS_VIOL_ABORT - When the DISABLE_VIOLATION_ABORT bits in MISC_CTRL_REG and - * MISC_CTRL_DP_REG on the AHB secure controller are not equal to 10, this bit indicates state 1 - */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_DIS_VIOL_ABORT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_DIS_VIOL_ABORT_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_DIS_VIOL_ABORT_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_NS_PRIV_CHK_MASK (0x8U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_NS_PRIV_CHK_SHIFT (3U) -/*! CFG_SEC_ENA_NS_PRIV_CHK - When the ENABLE_NS_PRIV_CHECK bits in MISC_CTRL_REG and - * MISC_CTRL_DP_REG on the AHB secure controller are not equal to 10, this bit indicates state 1 - */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_NS_PRIV_CHK(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_NS_PRIV_CHK_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_NS_PRIV_CHK_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_S_PRIV_CHK_MASK (0x10U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_S_PRIV_CHK_SHIFT (4U) -/*! CFG_SEC_ENA_S_PRIV_CHK - When the ENABLE_S_PRIV_CHECK bits in MISC_CTRL_REG and MISC_CTRL_DP_REG - * on the AHB secure controller are not equal to 10, this bit indicates state 1 - */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_S_PRIV_CHK(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_S_PRIV_CHK_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_S_PRIV_CHK_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_SEC_CHK_MASK (0x20U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_SEC_CHK_SHIFT (5U) -/*! CFG_SEC_ENA_SEC_CHK - When the ENABLE_SECURE_CHECKING bits in MISC_CTRL_REG and MISC_CTRL_DP_REG - * on the AHB secure controller are not equal to 10, this bit indicates state 1 - */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_SEC_CHK(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_SEC_CHK_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_SEC_CHK_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_IDAU_ALLNS_MASK (0x40U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_IDAU_ALLNS_SHIFT (6U) -/*! CFG_SEC_IDAU_ALLNS - When the IDAU_ALL_NS bits in MISC_CTRL_REG and MISC_CTRL_DP_REG on the AHB - * secure controller are equal to 01, this bit indicates state 1 - */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_IDAU_ALLNS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_IDAU_ALLNS_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_IDAU_ALLNS_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_NS_MPU_MASK (0x100U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_NS_MPU_SHIFT (8U) -/*! CFG_SEC_LOCK_NS_MPU - When the LOCK_NS_MPU bits in CPU0_LOCK_REG on the AHB secure controller are not equal to 10, this bit indicates state 1 */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_NS_MPU(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_NS_MPU_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_NS_MPU_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_NS_VTOR_MASK (0x200U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_NS_VTOR_SHIFT (9U) -/*! CFG_SEC_LOCK_NS_VTOR - When the LOCK_NS_VTOR bits in CPU0_LOCK_REG on the AHB secure controller are not equal to 10, this bit indicates state 1 */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_NS_VTOR(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_NS_VTOR_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_NS_VTOR_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_S_MPU_MASK (0x400U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_S_MPU_SHIFT (10U) -/*! CFG_SEC_LOCK_S_MPU - When the LOCK_S_MPU bits in CPU0_LOCK_REG on the AHB secure controller are not equal to 10, this bit indicates state 1 */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_S_MPU(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_S_MPU_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_S_MPU_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_S_VTAIRCR_MASK (0x800U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_S_VTAIRCR_SHIFT (11U) -/*! CFG_SEC_LOCK_S_VTAIRCR - When the LOCK_S_VTAIRCR bits in CPU0_LOCK_REG on the AHB secure - * controller are not equal to 10, this bit indicates state 1 - */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_S_VTAIRCR(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_S_VTAIRCR_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_S_VTAIRCR_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_SAU_MASK (0x1000U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_SAU_SHIFT (12U) -/*! CFG_SEC_LOCK_SAU - When the LOCK_SAU bits in CPU0_LOCK_REG on the AHB secure controller are not equal to 10, this bit indicates state 1 */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_SAU(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_SAU_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_SAU_MASK) - -#define SYSCON_ELS_AS_CFG1_METAL_VERSION_MASK (0x1FE000U) -#define SYSCON_ELS_AS_CFG1_METAL_VERSION_SHIFT (13U) -/*! METAL_VERSION - metal version */ -#define SYSCON_ELS_AS_CFG1_METAL_VERSION(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_METAL_VERSION_SHIFT)) & SYSCON_ELS_AS_CFG1_METAL_VERSION_MASK) - -#define SYSCON_ELS_AS_CFG1_ROM_PATCH_VERSION_MASK (0x1E00000U) -#define SYSCON_ELS_AS_CFG1_ROM_PATCH_VERSION_SHIFT (21U) -/*! ROM_PATCH_VERSION - ROM patch version */ -#define SYSCON_ELS_AS_CFG1_ROM_PATCH_VERSION(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_ROM_PATCH_VERSION_SHIFT)) & SYSCON_ELS_AS_CFG1_ROM_PATCH_VERSION_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_HVD_CORE_RESET_ENABLED_MASK (0x4000000U) -#define SYSCON_ELS_AS_CFG1_CFG_HVD_CORE_RESET_ENABLED_SHIFT (26U) -/*! CFG_HVD_CORE_RESET_ENABLED - When SPC CORE HVD analog detector are turned on, and CORE HVD reset are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG1_CFG_HVD_CORE_RESET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_HVD_CORE_RESET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_HVD_CORE_RESET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_HVD_CORE_IRQ_ENABLED_MASK (0x8000000U) -#define SYSCON_ELS_AS_CFG1_CFG_HVD_CORE_IRQ_ENABLED_SHIFT (27U) -/*! CFG_HVD_CORE_IRQ_ENABLED - When SPC CORE HVD analog detector are turned on, and CORE HVD IRQ are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG1_CFG_HVD_CORE_IRQ_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_HVD_CORE_IRQ_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_HVD_CORE_IRQ_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VSYS_RESET_ENABLED_MASK (0x10000000U) -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VSYS_RESET_ENABLED_SHIFT (28U) -/*! CFG_HVD_VSYS_RESET_ENABLED - When SPC VSYS HVD analog detector are turned on and VSYS HVD reset are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VSYS_RESET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_HVD_VSYS_RESET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_HVD_VSYS_RESET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VDDIO_RESET_ENABLED_MASK (0x20000000U) -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VDDIO_RESET_ENABLED_SHIFT (29U) -/*! CFG_HVD_VDDIO_RESET_ENABLED - When SPC VDDIO HVD analog detector are turned on and VDDIO HVD reset are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VDDIO_RESET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_HVD_VDDIO_RESET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_HVD_VDDIO_RESET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VSYS_IRQ_ENABLED_MASK (0x40000000U) -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VSYS_IRQ_ENABLED_SHIFT (30U) -/*! CFG_HVD_VSYS_IRQ_ENABLED - When SPC VSYS HVD analog detector are turned on and VSYS HVD irq are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VSYS_IRQ_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_HVD_VSYS_IRQ_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_HVD_VSYS_IRQ_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VDDIO_IRQ_ENABLED_MASK (0x80000000U) -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VDDIO_IRQ_ENABLED_SHIFT (31U) -/*! CFG_HVD_VDDIO_IRQ_ENABLED - When SPC VDDIO HVD analog detector are turned on and VDDIO HVD irq are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VDDIO_IRQ_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_HVD_VDDIO_IRQ_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_HVD_VDDIO_IRQ_ENABLED_MASK) -/*! @} */ - -/*! @name ELS_AS_CFG2 - ELS AS Configuration2 */ -/*! @{ */ - -#define SYSCON_ELS_AS_CFG2_CFG_ELS_CMD_EN_MASK (0xFFFFFFFFU) -#define SYSCON_ELS_AS_CFG2_CFG_ELS_CMD_EN_SHIFT (0U) -/*! CFG_ELS_CMD_EN - ELS configuration command enable bit */ -#define SYSCON_ELS_AS_CFG2_CFG_ELS_CMD_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG2_CFG_ELS_CMD_EN_SHIFT)) & SYSCON_ELS_AS_CFG2_CFG_ELS_CMD_EN_MASK) -/*! @} */ - -/*! @name ELS_AS_CFG3 - ELS AS Configuration3 */ -/*! @{ */ - -#define SYSCON_ELS_AS_CFG3_DEVICE_TYPE_MASK (0xFFFFFFFFU) -#define SYSCON_ELS_AS_CFG3_DEVICE_TYPE_SHIFT (0U) -/*! DEVICE_TYPE - Device type identification data */ -#define SYSCON_ELS_AS_CFG3_DEVICE_TYPE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG3_DEVICE_TYPE_SHIFT)) & SYSCON_ELS_AS_CFG3_DEVICE_TYPE_MASK) -/*! @} */ - -/*! @name ELS_AS_ST0 - ELS AS State Register */ -/*! @{ */ - -#define SYSCON_ELS_AS_ST0_ST_TEMPORAL_STATE_MASK (0xFU) -#define SYSCON_ELS_AS_ST0_ST_TEMPORAL_STATE_SHIFT (0U) -/*! ST_TEMPORAL_STATE - TEMPORAL_STATE[3:0] in the ELS_TEMPORAL_STATE register reflects this register */ -#define SYSCON_ELS_AS_ST0_ST_TEMPORAL_STATE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_TEMPORAL_STATE_SHIFT)) & SYSCON_ELS_AS_ST0_ST_TEMPORAL_STATE_MASK) - -#define SYSCON_ELS_AS_ST0_ST_CPU0_DBGEN_MASK (0x10U) -#define SYSCON_ELS_AS_ST0_ST_CPU0_DBGEN_SHIFT (4U) -/*! ST_CPU0_DBGEN - When CPU0 (CM33) "deben" input is state 1, this bit indicates state 1 */ -#define SYSCON_ELS_AS_ST0_ST_CPU0_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_CPU0_DBGEN_SHIFT)) & SYSCON_ELS_AS_ST0_ST_CPU0_DBGEN_MASK) - -#define SYSCON_ELS_AS_ST0_ST_CPU0_NIDEN_MASK (0x20U) -#define SYSCON_ELS_AS_ST0_ST_CPU0_NIDEN_SHIFT (5U) -/*! ST_CPU0_NIDEN - When CPU0 (CM33) "niden" input is state 1, this bit indicates state 1 */ -#define SYSCON_ELS_AS_ST0_ST_CPU0_NIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_CPU0_NIDEN_SHIFT)) & SYSCON_ELS_AS_ST0_ST_CPU0_NIDEN_MASK) - -#define SYSCON_ELS_AS_ST0_ST_CPU0_SPIDEN_MASK (0x40U) -#define SYSCON_ELS_AS_ST0_ST_CPU0_SPIDEN_SHIFT (6U) -/*! ST_CPU0_SPIDEN - When CPU0 (CM33) "spiden" input is state 1, this bit indicates state 1 */ -#define SYSCON_ELS_AS_ST0_ST_CPU0_SPIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_CPU0_SPIDEN_SHIFT)) & SYSCON_ELS_AS_ST0_ST_CPU0_SPIDEN_MASK) - -#define SYSCON_ELS_AS_ST0_ST_CPU0_SPNIDEN_MASK (0x80U) -#define SYSCON_ELS_AS_ST0_ST_CPU0_SPNIDEN_SHIFT (7U) -/*! ST_CPU0_SPNIDEN - When CPU0 (CM33) "spniden" input is state 1, this bit indicates state 1 */ -#define SYSCON_ELS_AS_ST0_ST_CPU0_SPNIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_CPU0_SPNIDEN_SHIFT)) & SYSCON_ELS_AS_ST0_ST_CPU0_SPNIDEN_MASK) - -#define SYSCON_ELS_AS_ST0_ST_CPU1_DBGEN_MASK (0x100U) -#define SYSCON_ELS_AS_ST0_ST_CPU1_DBGEN_SHIFT (8U) -/*! ST_CPU1_DBGEN - When CPU1 (CM33) "deben" input is state 1, this bit indicates state 1. */ -#define SYSCON_ELS_AS_ST0_ST_CPU1_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_CPU1_DBGEN_SHIFT)) & SYSCON_ELS_AS_ST0_ST_CPU1_DBGEN_MASK) - -#define SYSCON_ELS_AS_ST0_ST_CPU1_NIDEN_MASK (0x200U) -#define SYSCON_ELS_AS_ST0_ST_CPU1_NIDEN_SHIFT (9U) -/*! ST_CPU1_NIDEN - When CPU1 (CM33) "niden" input is state 1, this bit indicates state 1. */ -#define SYSCON_ELS_AS_ST0_ST_CPU1_NIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_CPU1_NIDEN_SHIFT)) & SYSCON_ELS_AS_ST0_ST_CPU1_NIDEN_MASK) - -#define SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_CPU0_MASK (0x400U) -#define SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_CPU0_SHIFT (10U) -/*! ST_DAP_ENABLE_CPU0 - When DAP to AP0 for CPU0 (CM33) debug access is allowed, this bit indicates state 1 */ -#define SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_CPU0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_CPU0_SHIFT)) & SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_CPU0_MASK) - -#define SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_CPU1_MASK (0x800U) -#define SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_CPU1_SHIFT (11U) -/*! ST_DAP_ENABLE_CPU1 - When DAP to AP1 for CPU1 (CM33) debug access is allowed, this bit indicates state 1. */ -#define SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_CPU1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_CPU1_SHIFT)) & SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_CPU1_MASK) - -#define SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_DSP_MASK (0x1000U) -#define SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_DSP_SHIFT (12U) -/*! ST_DAP_ENABLE_DSP - When DAP to AP3 for DSP (CoolFlux) debug access is allowed, this bit indicates state 1 */ -#define SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_DSP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_DSP_SHIFT)) & SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_DSP_MASK) - -#define SYSCON_ELS_AS_ST0_ST_ALLOW_TEST_ACCESS_MASK (0x4000U) -#define SYSCON_ELS_AS_ST0_ST_ALLOW_TEST_ACCESS_SHIFT (14U) -/*! ST_ALLOW_TEST_ACCESS - When JTAG TAP access is allowed, this bit indicates state 1. */ -#define SYSCON_ELS_AS_ST0_ST_ALLOW_TEST_ACCESS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_ALLOW_TEST_ACCESS_SHIFT)) & SYSCON_ELS_AS_ST0_ST_ALLOW_TEST_ACCESS_MASK) - -#define SYSCON_ELS_AS_ST0_ST_XO32K_FAILED_MASK (0x8000U) -#define SYSCON_ELS_AS_ST0_ST_XO32K_FAILED_SHIFT (15U) -/*! ST_XO32K_FAILED - When XO32K oscillation fail flag is state 1, this bit indicates state 1 */ -#define SYSCON_ELS_AS_ST0_ST_XO32K_FAILED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_XO32K_FAILED_SHIFT)) & SYSCON_ELS_AS_ST0_ST_XO32K_FAILED_MASK) - -#define SYSCON_ELS_AS_ST0_ST_XO40M_FAILED_MASK (0x10000U) -#define SYSCON_ELS_AS_ST0_ST_XO40M_FAILED_SHIFT (16U) -/*! ST_XO40M_FAILED - When XO40M oscillation fail flag is state 1, this bit indicates state 1 */ -#define SYSCON_ELS_AS_ST0_ST_XO40M_FAILED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_XO40M_FAILED_SHIFT)) & SYSCON_ELS_AS_ST0_ST_XO40M_FAILED_MASK) - -#define SYSCON_ELS_AS_ST0_ST_IFR_LOAD_FAILED_MASK (0x20000U) -#define SYSCON_ELS_AS_ST0_ST_IFR_LOAD_FAILED_SHIFT (17U) -/*! ST_IFR_LOAD_FAILED - When IFR load fail flag is state 1, this bit indicates state 1 */ -#define SYSCON_ELS_AS_ST0_ST_IFR_LOAD_FAILED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_IFR_LOAD_FAILED_SHIFT)) & SYSCON_ELS_AS_ST0_ST_IFR_LOAD_FAILED_MASK) - -#define SYSCON_ELS_AS_ST0_ST_GLITCH_DETECT_FLAG_MASK (0x3C0000U) -#define SYSCON_ELS_AS_ST0_ST_GLITCH_DETECT_FLAG_SHIFT (18U) -/*! ST_GLITCH_DETECT_FLAG - GLITCH_DETECT_FLAG is state of 4-bit Glitch Ripple Counter output. */ -#define SYSCON_ELS_AS_ST0_ST_GLITCH_DETECT_FLAG(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_GLITCH_DETECT_FLAG_SHIFT)) & SYSCON_ELS_AS_ST0_ST_GLITCH_DETECT_FLAG_MASK) -/*! @} */ - -/*! @name ELS_AS_ST1 - ELS AS State1 */ -/*! @{ */ - -#define SYSCON_ELS_AS_ST1_ST_QK_PUF_SCORE_MASK (0xFU) -#define SYSCON_ELS_AS_ST1_ST_QK_PUF_SCORE_SHIFT (0U) -/*! ST_QK_PUF_SCORE - These register bits indicate the state of "qk_puf_score[3:0]" outputs from QK PUF block */ -#define SYSCON_ELS_AS_ST1_ST_QK_PUF_SCORE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST1_ST_QK_PUF_SCORE_SHIFT)) & SYSCON_ELS_AS_ST1_ST_QK_PUF_SCORE_MASK) - -#define SYSCON_ELS_AS_ST1_ST_QK_ZEROIZED_MASK (0x10U) -#define SYSCON_ELS_AS_ST1_ST_QK_ZEROIZED_SHIFT (4U) -/*! ST_QK_ZEROIZED - This register bit indicates the state of "qk_zeroized" output from QK PUF block */ -#define SYSCON_ELS_AS_ST1_ST_QK_ZEROIZED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST1_ST_QK_ZEROIZED_SHIFT)) & SYSCON_ELS_AS_ST1_ST_QK_ZEROIZED_MASK) - -#define SYSCON_ELS_AS_ST1_ST_MAIN_CLK_IS_EXT_MASK (0x20U) -#define SYSCON_ELS_AS_ST1_ST_MAIN_CLK_IS_EXT_SHIFT (5U) -/*! ST_MAIN_CLK_IS_EXT - When MAIN_CLK is running from external clock source either XO32M, XO32K or GPIO CLKIN, this bit indicates state 1 */ -#define SYSCON_ELS_AS_ST1_ST_MAIN_CLK_IS_EXT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST1_ST_MAIN_CLK_IS_EXT_SHIFT)) & SYSCON_ELS_AS_ST1_ST_MAIN_CLK_IS_EXT_MASK) - -#define SYSCON_ELS_AS_ST1_ST_DCDC_VOUT_MASK (0xC0U) -#define SYSCON_ELS_AS_ST1_ST_DCDC_VOUT_SHIFT (6U) -/*! ST_DCDC_VOUT - VOUT[1:0] setting on DCDC0 register in SPC block will reflect to this register. Default is 1.0V */ -#define SYSCON_ELS_AS_ST1_ST_DCDC_VOUT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST1_ST_DCDC_VOUT_SHIFT)) & SYSCON_ELS_AS_ST1_ST_DCDC_VOUT_MASK) - -#define SYSCON_ELS_AS_ST1_ST_DCDC_DS_MASK (0x300U) -#define SYSCON_ELS_AS_ST1_ST_DCDC_DS_SHIFT (8U) -/*! ST_DCDC_DS - DCDC drive strength setting. Default is normal drive. */ -#define SYSCON_ELS_AS_ST1_ST_DCDC_DS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST1_ST_DCDC_DS_SHIFT)) & SYSCON_ELS_AS_ST1_ST_DCDC_DS_MASK) - -#define SYSCON_ELS_AS_ST1_ST_BOOT_MODE_MASK (0xC00U) -#define SYSCON_ELS_AS_ST1_ST_BOOT_MODE_SHIFT (10U) -/*! ST_BOOT_MODE - ISP pin status during boot. By default ISP pin is pulled up. If want to enter ISP - * mode during boot, ISP pin should be pull down when out of reset. - */ -#define SYSCON_ELS_AS_ST1_ST_BOOT_MODE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST1_ST_BOOT_MODE_SHIFT)) & SYSCON_ELS_AS_ST1_ST_BOOT_MODE_MASK) - -#define SYSCON_ELS_AS_ST1_ST_BOOT_RETRY_CNT_MASK (0xF000U) -#define SYSCON_ELS_AS_ST1_ST_BOOT_RETRY_CNT_SHIFT (12U) -/*! ST_BOOT_RETRY_CNT - BOOT_RETRY_CNT[3:0] in the ELS_BOOT_RETRY_CNT register reflects this register */ -#define SYSCON_ELS_AS_ST1_ST_BOOT_RETRY_CNT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST1_ST_BOOT_RETRY_CNT_SHIFT)) & SYSCON_ELS_AS_ST1_ST_BOOT_RETRY_CNT_MASK) - -#define SYSCON_ELS_AS_ST1_ST_LDO_CORE_VOUT_MASK (0x30000U) -#define SYSCON_ELS_AS_ST1_ST_LDO_CORE_VOUT_SHIFT (16U) -/*! ST_LDO_CORE_VOUT - VOUT[1:0] setting on LDO Core register in SPC block will reflect to this register. Default is 1.0V */ -#define SYSCON_ELS_AS_ST1_ST_LDO_CORE_VOUT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST1_ST_LDO_CORE_VOUT_SHIFT)) & SYSCON_ELS_AS_ST1_ST_LDO_CORE_VOUT_MASK) - -#define SYSCON_ELS_AS_ST1_ST_LDO_CORE_DS_MASK (0xC0000U) -#define SYSCON_ELS_AS_ST1_ST_LDO_CORE_DS_SHIFT (18U) -/*! ST_LDO_CORE_DS - LDO_CORE drive strength setting. Default is normal drive. */ -#define SYSCON_ELS_AS_ST1_ST_LDO_CORE_DS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST1_ST_LDO_CORE_DS_SHIFT)) & SYSCON_ELS_AS_ST1_ST_LDO_CORE_DS_MASK) -/*! @} */ - -/*! @name ELS_AS_BOOT_LOG0 - Boot state captured during boot: Main ROM log */ -/*! @{ */ - -#define SYSCON_ELS_AS_BOOT_LOG0_BOOT_IMAGE_MASK (0xFU) -#define SYSCON_ELS_AS_BOOT_LOG0_BOOT_IMAGE_SHIFT (0U) -/*! BOOT_IMAGE - Boot image source used during this boot. - * 0b0000..Internal flash image 0 - * 0b0001..Internal flash image 1 - * 0b0010..FlexSPI flash image 0 - * 0b0011..FlexSPI flash image 1 - * 0b0100..Recovery SPI flash image - * 0b0101..Serial boot image (write-memory and execute ISP command used) - * 0b0110..Receive SB3 containing SB_JUMP command is used. - * 0b0111..Customer SBL/recovery image (Bank1 IFR0). - * 0b1000..NXP MAD recovery image (Bank1 IFR0). - * 0b1001..NXP ROM extension (NMPA - Bank0 IFR0). - * 0b1010..Reserved. - * 0b1011..Reserved. - * 0b1100..Reserved. - * 0b1101..Reserved. - * 0b1110..Reserved. - * 0b1111..Reserved. - */ -#define SYSCON_ELS_AS_BOOT_LOG0_BOOT_IMAGE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_BOOT_IMAGE_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_BOOT_IMAGE_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_CMAC_MASK (0x10U) -#define SYSCON_ELS_AS_BOOT_LOG0_CMAC_SHIFT (4U) -/*! CMAC - CMAC verify is used instead of ECDSA verify on this boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_CMAC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_CMAC_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_CMAC_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_ECDSA_MASK (0x40U) -#define SYSCON_ELS_AS_BOOT_LOG0_ECDSA_SHIFT (6U) -/*! ECDSA - ECDSA P-384 verification is done on this boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_ECDSA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_ECDSA_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_ECDSA_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_OFF_CHIP_MASK (0x80U) -#define SYSCON_ELS_AS_BOOT_LOG0_OFF_CHIP_SHIFT (7U) -/*! OFF_CHIP - Off-chip Prince is enabled during boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_OFF_CHIP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_OFF_CHIP_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_OFF_CHIP_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_ON_CHIP_MASK (0x100U) -#define SYSCON_ELS_AS_BOOT_LOG0_ON_CHIP_SHIFT (8U) -/*! ON_CHIP - On-chip Prince is enabled during boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_ON_CHIP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_ON_CHIP_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_ON_CHIP_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_CDI_CSR_MASK (0x200U) -#define SYSCON_ELS_AS_BOOT_LOG0_CDI_CSR_SHIFT (9U) -/*! CDI_CSR - CDI based device keys are derived for CSR harvesting on this boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_CDI_CSR(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_CDI_CSR_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_CDI_CSR_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_CDI_DICE_MASK (0x400U) -#define SYSCON_ELS_AS_BOOT_LOG0_CDI_DICE_SHIFT (10U) -/*! CDI_DICE - CDI per DICE specification is computed on this boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_CDI_DICE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_CDI_DICE_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_CDI_DICE_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_TRUSTZONE_MASK (0x800U) -#define SYSCON_ELS_AS_BOOT_LOG0_TRUSTZONE_SHIFT (11U) -/*! TRUSTZONE - TrustZone preset data is loaded during this boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_TRUSTZONE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_TRUSTZONE_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_TRUSTZONE_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_DEBUG_AUTH_MASK (0x1000U) -#define SYSCON_ELS_AS_BOOT_LOG0_DEBUG_AUTH_SHIFT (12U) -/*! DEBUG_AUTH - Debug authentication done in this session prior to boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_DEBUG_AUTH(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_DEBUG_AUTH_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_DEBUG_AUTH_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_ITRC_MASK (0x2000U) -#define SYSCON_ELS_AS_BOOT_LOG0_ITRC_SHIFT (13U) -/*! ITRC - ITRC zeroize event is handled in this session of boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_ITRC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_ITRC_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_ITRC_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_DIG_GDET_MASK (0x4000U) -#define SYSCON_ELS_AS_BOOT_LOG0_DIG_GDET_SHIFT (14U) -/*! DIG_GDET - Digital glitch detector is enabled during boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_DIG_GDET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_DIG_GDET_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_DIG_GDET_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_ANA_GDET_MASK (0x8000U) -#define SYSCON_ELS_AS_BOOT_LOG0_ANA_GDET_SHIFT (15U) -/*! ANA_GDET - Analog glitch detector is enabled during boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_ANA_GDET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_ANA_GDET_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_ANA_GDET_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_DEEP_PD_MASK (0x10000U) -#define SYSCON_ELS_AS_BOOT_LOG0_DEEP_PD_SHIFT (16U) -/*! DEEP_PD - Boot from deep-power down state. */ -#define SYSCON_ELS_AS_BOOT_LOG0_DEEP_PD(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_DEEP_PD_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_DEEP_PD_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_LOW_POWER_MASK (0xF000000U) -#define SYSCON_ELS_AS_BOOT_LOG0_LOW_POWER_SHIFT (24U) -/*! LOW_POWER - Last low-power mode value. ROM copies SPC_LP_MODE field from SPC->SC[7:4]. */ -#define SYSCON_ELS_AS_BOOT_LOG0_LOW_POWER(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_LOW_POWER_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_LOW_POWER_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_ISP_MASK (0x80000000U) -#define SYSCON_ELS_AS_BOOT_LOG0_ISP_SHIFT (31U) -/*! ISP - ISP pin state at boot time. ROM copies CMC->MR0[0]. */ -#define SYSCON_ELS_AS_BOOT_LOG0_ISP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_ISP_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_ISP_MASK) -/*! @} */ - -/*! @name ELS_AS_BOOT_LOG1 - Boot state captured during boot: Library log */ -/*! @{ */ - -#define SYSCON_ELS_AS_BOOT_LOG1_RoTK_MASK (0x3U) -#define SYSCON_ELS_AS_BOOT_LOG1_RoTK_SHIFT (0U) -/*! RoTK - RoTK index used for this boot. */ -#define SYSCON_ELS_AS_BOOT_LOG1_RoTK(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG1_RoTK_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG1_RoTK_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG1_FIPS_MASK (0x3FCU) -#define SYSCON_ELS_AS_BOOT_LOG1_FIPS_SHIFT (2U) -/*! FIPS - FIPS self-test is executed and PASS during this boot. When a bit is set, means self-test - * is executed and it FAILS. When a bit is clear, means corresponding self-test is executed and - * PASS or it is not executed. - */ -#define SYSCON_ELS_AS_BOOT_LOG1_FIPS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG1_FIPS_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG1_FIPS_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG1_SB3_MASK (0xC00U) -#define SYSCON_ELS_AS_BOOT_LOG1_SB3_SHIFT (10U) -/*! SB3 - SB3 type (valid after nboot_sb3_load_manifest()). - * 0b00..customer fw load/update file. - * 0b01..NXP Provisioning FW. - * 0b10..ELS signed OEM Provisioning FW. - */ -#define SYSCON_ELS_AS_BOOT_LOG1_SB3(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG1_SB3_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG1_SB3_MASK) -/*! @} */ - -/*! @name ELS_AS_BOOT_LOG2 - Boot state captured during boot: Hardware status signals log */ -/*! @{ */ - -#define SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS0_MASK (0x3FU) -#define SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS0_SHIFT (0U) -/*! CMC_SRS0 - CMC->SRS[5:0] */ -#define SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS0_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS0_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG2_VBAT_STATUS0_MASK (0xC0U) -#define SYSCON_ELS_AS_BOOT_LOG2_VBAT_STATUS0_SHIFT (6U) -/*! VBAT_STATUS0 - VBAT->STATUSA[1:0] | ~VBAT->STATUSB[1:0] */ -#define SYSCON_ELS_AS_BOOT_LOG2_VBAT_STATUS0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG2_VBAT_STATUS0_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG2_VBAT_STATUS0_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS1_MASK (0x1FF00U) -#define SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS1_SHIFT (8U) -/*! CMC_SRS1 - CMC->SRS[16:8] */ -#define SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS1_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS1_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG2_VBAT_STATUS1_MASK (0xFC0000U) -#define SYSCON_ELS_AS_BOOT_LOG2_VBAT_STATUS1_SHIFT (18U) -/*! VBAT_STATUS1 - VBAT->STATUSA[11:6] | ~VBAT->STATUSB[11:6] */ -#define SYSCON_ELS_AS_BOOT_LOG2_VBAT_STATUS1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG2_VBAT_STATUS1_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG2_VBAT_STATUS1_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS2_MASK (0xFF000000U) -#define SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS2_SHIFT (24U) -/*! CMC_SRS2 - CMC->SRS[31:24] */ -#define SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS2(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS2_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS2_MASK) -/*! @} */ - -/*! @name ELS_AS_BOOT_LOG3 - Boot state captured during boot: Security log */ -/*! @{ */ - -#define SYSCON_ELS_AS_BOOT_LOG3_ERR_AUTH_FAIL_COUNT_MASK (0xFFU) -#define SYSCON_ELS_AS_BOOT_LOG3_ERR_AUTH_FAIL_COUNT_SHIFT (0U) -/*! ERR_AUTH_FAIL_COUNT - CFPA->ERR_AUTH_FAIL_COUNT[7:0] */ -#define SYSCON_ELS_AS_BOOT_LOG3_ERR_AUTH_FAIL_COUNT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG3_ERR_AUTH_FAIL_COUNT_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG3_ERR_AUTH_FAIL_COUNT_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG3_ERR_ITRC_COUNT_MASK (0xFF00U) -#define SYSCON_ELS_AS_BOOT_LOG3_ERR_ITRC_COUNT_SHIFT (8U) -/*! ERR_ITRC_COUNT - CFPA->ERR_ITRC_COUNT[7:0] */ -#define SYSCON_ELS_AS_BOOT_LOG3_ERR_ITRC_COUNT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG3_ERR_ITRC_COUNT_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG3_ERR_ITRC_COUNT_MASK) -/*! @} */ - -/*! @name ELS_AS_FLAG0 - ELS AS Flag0 */ -/*! @{ */ - -#define SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_CPU0_MASK (0x1U) -#define SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_CPU0_SHIFT (0U) -/*! FLAG_AP_ENABLE_CPU0 - This flag bit is set as 1 when DAP enables AP0 for CPU0 (CM33) debug - * access. The register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_CPU0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_CPU0_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_CPU0_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_CPU1_MASK (0x2U) -#define SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_CPU1_SHIFT (1U) -/*! FLAG_AP_ENABLE_CPU1 - This flag bit is set as 1 when DAP enables AP1 for CPU1 (CM33) debug - * access. The register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_CPU1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_CPU1_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_CPU1_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_DSP_MASK (0x4U) -#define SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_DSP_SHIFT (2U) -/*! FLAG_AP_ENABLE_DSP - This flag bit is set as 1 when DAP enables AP3 for DSP (CoolFlux) debug - * access. The register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_DSP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_DSP_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_DSP_MASK) - -#define SYSCON_ELS_AS_FLAG0_EFUSE_ATTACK_DETECT_MASK (0x8U) -#define SYSCON_ELS_AS_FLAG0_EFUSE_ATTACK_DETECT_SHIFT (3U) -/*! EFUSE_ATTACK_DETECT - OTPC can output attack_detect signal when it detects attack when load - * shadow registers. The output will be cleared by reset. ELS_AS_FLAG is reset by PoR, so the status - * can be recorded. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_EFUSE_ATTACK_DETECT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_EFUSE_ATTACK_DETECT_SHIFT)) & SYSCON_ELS_AS_FLAG0_EFUSE_ATTACK_DETECT_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_LVD_CORE_OCCURED_MASK (0x20U) -#define SYSCON_ELS_AS_FLAG0_FLAG_LVD_CORE_OCCURED_SHIFT (5U) -/*! FLAG_LVD_CORE_OCCURED - This flag register is set 1 when VDD_CORE LVD event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_LVD_CORE_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_LVD_CORE_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_LVD_CORE_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT0_RESET_OCCURED_MASK (0x100U) -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT0_RESET_OCCURED_SHIFT (8U) -/*! FLAG_WDT0_RESET_OCCURED - This flag bit is set as 1 when WatchDog Timer 0 reset is enabled and - * reset event is triggered. This register is cleared 0 by AO domain POR. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT0_RESET_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_WDT0_RESET_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_WDT0_RESET_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT0_RESET_OCCURED_MASK (0x200U) -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT0_RESET_OCCURED_SHIFT (9U) -/*! FLAG_CWDT0_RESET_OCCURED - This flag bit is set as 1 when Code WatchDog Timer 0 reset is enabled - * and reset event is triggered. This register is cleared 0 by AO domain POR. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT0_RESET_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_CWDT0_RESET_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_CWDT0_RESET_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT0_IRQ_OCCURED_MASK (0x400U) -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT0_IRQ_OCCURED_SHIFT (10U) -/*! FLAG_WDT0_IRQ_OCCURED - This flag bit is set as 1 when WatchDog Timer 0 IRQ is enabled and IRQ - * event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT0_IRQ_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_WDT0_IRQ_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_WDT0_IRQ_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT0_IRQ_OCCURED_MASK (0x800U) -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT0_IRQ_OCCURED_SHIFT (11U) -/*! FLAG_CWDT0_IRQ_OCCURED - This flag bit is set as 1 when Code WatchDog Timer 0 IRQ is enabled and - * IRQ event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT0_IRQ_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_CWDT0_IRQ_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_CWDT0_IRQ_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_QK_ERROR_MASK (0x1000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_QK_ERROR_SHIFT (12U) -/*! FLAG_QK_ERROR - This flag bit is set as 1 when QK_ERROR is flagged from QK PUF block. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_QK_ERROR(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_QK_ERROR_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_QK_ERROR_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_ELS_GLITCH_DETECTED_MASK (0x2000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_ELS_GLITCH_DETECTED_SHIFT (13U) -/*! FLAG_ELS_GLITCH_DETECTED - This flag bit is set as 1 when GDET error is flagged. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_ELS_GLITCH_DETECTED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_ELS_GLITCH_DETECTED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_ELS_GLITCH_DETECTED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_ANA_GLITCH_DETECTED_MASK (0x4000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_ANA_GLITCH_DETECTED_SHIFT (14U) -/*! FLAG_ANA_GLITCH_DETECTED - This flag bit is set as 1 when ANALOG GDET error is flagged in SYSCON - * block. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_ANA_GLITCH_DETECTED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_ANA_GLITCH_DETECTED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_ANA_GLITCH_DETECTED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_TAMPER_EVENT_DETECTED_MASK (0x8000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_TAMPER_EVENT_DETECTED_SHIFT (15U) -/*! FLAG_TAMPER_EVENT_DETECTED - This flag bit is set as 1 when tamper event is flagged from TDET. - * This register is cleared 0 by AO domain POR or by PMC reset event, if tamper detection event is - * cleared by software. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_TAMPER_EVENT_DETECTED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_TAMPER_EVENT_DETECTED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_TAMPER_EVENT_DETECTED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_FLASH_ECC_INVALID_MASK (0x10000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_FLASH_ECC_INVALID_SHIFT (16U) -/*! FLAG_FLASH_ECC_INVALID - This flag bit is set as 1 when FLASH controller indicates ECC error. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_FLASH_ECC_INVALID(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_FLASH_ECC_INVALID_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_FLASH_ECC_INVALID_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_SEC_VIOL_IRQ_OCURRED_MASK (0x20000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_SEC_VIOL_IRQ_OCURRED_SHIFT (17U) -/*! FLAG_SEC_VIOL_IRQ_OCURRED - This flag bit is set as 1 when security violation is indicated from FLASH sub-system or AHB bus matrix. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_SEC_VIOL_IRQ_OCURRED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_SEC_VIOL_IRQ_OCURRED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_SEC_VIOL_IRQ_OCURRED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_CPU0_NS_C_ACC_OCCURED_MASK (0x40000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_CPU0_NS_C_ACC_OCCURED_SHIFT (18U) -/*! FLAG_CPU0_NS_C_ACC_OCCURED - This flag bit is set as 1 when CPU0 (CM33) makes non-secure code - * transactions. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_CPU0_NS_C_ACC_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_CPU0_NS_C_ACC_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_CPU0_NS_C_ACC_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_CPU0_NS_D_ACC_OCCURED_MASK (0x80000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_CPU0_NS_D_ACC_OCCURED_SHIFT (19U) -/*! FLAG_CPU0_NS_D_ACC_OCCURED - This flag bit is set as 1 when CPU0 (CM33) makes non-secure data - * transactions. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_CPU0_NS_D_ACC_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_CPU0_NS_D_ACC_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_CPU0_NS_D_ACC_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_LVD_VSYS_OCCURED_MASK (0x100000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_LVD_VSYS_OCCURED_SHIFT (20U) -/*! FLAG_LVD_VSYS_OCCURED - This flag register is set 1 when VDD_SYS LVD event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_LVD_VSYS_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_LVD_VSYS_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_LVD_VSYS_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_LVD_VDDIO_OCCURED_MASK (0x200000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_LVD_VDDIO_OCCURED_SHIFT (21U) -/*! FLAG_LVD_VDDIO_OCCURED - This flag register is set 1 when VDD LVD event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_LVD_VDDIO_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_LVD_VDDIO_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_LVD_VDDIO_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT1_RESET_OCCURED_MASK (0x400000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT1_RESET_OCCURED_SHIFT (22U) -/*! FLAG_WDT1_RESET_OCCURED - This flag bit is set as 1 when WatchDog Timer 1 reset is enabled and - * reset event is triggered. This register is cleared 0 by AO domain POR. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT1_RESET_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_WDT1_RESET_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_WDT1_RESET_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT1_RESET_OCCURED_MASK (0x800000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT1_RESET_OCCURED_SHIFT (23U) -/*! FLAG_CWDT1_RESET_OCCURED - This flag bit is set as 1 when Code WatchDog Timer 1 reset is enabled - * and reset event is triggered. This register is cleared 0 by AO domain POR. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT1_RESET_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_CWDT1_RESET_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_CWDT1_RESET_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT1_IRQ_OCCURED_MASK (0x1000000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT1_IRQ_OCCURED_SHIFT (24U) -/*! FLAG_WDT1_IRQ_OCCURED - This flag bit is set as 1 when WatchDog Timer 1 IRQ is enabled and IRQ - * event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT1_IRQ_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_WDT1_IRQ_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_WDT1_IRQ_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT1_IRQ_OCCURED_MASK (0x2000000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT1_IRQ_OCCURED_SHIFT (25U) -/*! FLAG_CWDT1_IRQ_OCCURED - This flag bit is set as 1 when Code WatchDog Timer 1 IRQ is enabled and - * IRQ event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT1_IRQ_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_CWDT1_IRQ_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_CWDT1_IRQ_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_TEMPTAMPER_DET_IRQ_OCCURED_MASK (0x4000000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_TEMPTAMPER_DET_IRQ_OCCURED_SHIFT (26U) -/*! FLAG_TEMPTAMPER_DET_IRQ_OCCURED - This flag bit is set as 1 when temperature temper IRQ is - * enabled and IRQ event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_TEMPTAMPER_DET_IRQ_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_TEMPTAMPER_DET_IRQ_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_TEMPTAMPER_DET_IRQ_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_VOLTAMPER_DET_IRQ_OCCURED_MASK (0x8000000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_VOLTAMPER_DET_IRQ_OCCURED_SHIFT (27U) -/*! FLAG_VOLTAMPER_DET_IRQ_OCCURED - This flag bit is set as 1 when voltage temper IRQ is enabled - * and IRQ event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_VOLTAMPER_DET_IRQ_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_VOLTAMPER_DET_IRQ_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_VOLTAMPER_DET_IRQ_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_LHTTAMPER_DET_IRQ_OCCURED_MASK (0x10000000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_LHTTAMPER_DET_IRQ_OCCURED_SHIFT (28U) -/*! FLAG_LHTTAMPER_DET_IRQ_OCCURED - This flag bit is set as 1 when light temper IRQ is enabled and - * IRQ event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_LHTTAMPER_DET_IRQ_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_LHTTAMPER_DET_IRQ_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_LHTTAMPER_DET_IRQ_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_CLKTAMPER_DET_IRQ_OCCURED_MASK (0x20000000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_CLKTAMPER_DET_IRQ_OCCURED_SHIFT (29U) -/*! FLAG_CLKTAMPER_DET_IRQ_OCCURED - This flag bit is set as 1 when clock temper IRQ is enabled and - * IRQ event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_CLKTAMPER_DET_IRQ_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_CLKTAMPER_DET_IRQ_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_CLKTAMPER_DET_IRQ_OCCURED_MASK) -/*! @} */ - -/*! @name ELS_AS_FLAG1 - ELS AS Flag1 */ -/*! @{ */ - -#define SYSCON_ELS_AS_FLAG1_FLAG_HVD_CORE_OCCURED_MASK (0x20000000U) -#define SYSCON_ELS_AS_FLAG1_FLAG_HVD_CORE_OCCURED_SHIFT (29U) -/*! FLAG_HVD_CORE_OCCURED - This flag bit is set as 1 when HVD from VDD_CORE power domain is triggered. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG1_FLAG_HVD_CORE_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG1_FLAG_HVD_CORE_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG1_FLAG_HVD_CORE_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG1_FLAG_HVD_VSYS_OCCURED_MASK (0x40000000U) -#define SYSCON_ELS_AS_FLAG1_FLAG_HVD_VSYS_OCCURED_SHIFT (30U) -/*! FLAG_HVD_VSYS_OCCURED - This flag bit is set as 1 when HVD from VDD_SYS power domain is triggered - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG1_FLAG_HVD_VSYS_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG1_FLAG_HVD_VSYS_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG1_FLAG_HVD_VSYS_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG1_FLAG_HVD_VDDIO_OCCURED_MASK (0x80000000U) -#define SYSCON_ELS_AS_FLAG1_FLAG_HVD_VDDIO_OCCURED_SHIFT (31U) -/*! FLAG_HVD_VDDIO_OCCURED - This flag bit is set as 1 when HVD from VDD power domain is triggered - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG1_FLAG_HVD_VDDIO_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG1_FLAG_HVD_VDDIO_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG1_FLAG_HVD_VDDIO_OCCURED_MASK) -/*! @} */ - -/*! @name CLOCK_CTRL - Clock Control */ -/*! @{ */ - -#define SYSCON_CLOCK_CTRL_CLKIN_ENA_FM_USBH_LPT_MASK (0x2U) -#define SYSCON_CLOCK_CTRL_CLKIN_ENA_FM_USBH_LPT_SHIFT (1U) -/*! CLKIN_ENA_FM_USBH_LPT - Enables the clk_in clock for the Frequency Measurement, USB HS and LPTMR0/1 modules. - * 0b1..Clock is enabled - * 0b0..Clock is not enabled - */ -#define SYSCON_CLOCK_CTRL_CLKIN_ENA_FM_USBH_LPT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLOCK_CTRL_CLKIN_ENA_FM_USBH_LPT_SHIFT)) & SYSCON_CLOCK_CTRL_CLKIN_ENA_FM_USBH_LPT_MASK) - -#define SYSCON_CLOCK_CTRL_FRO1MHZ_ENA_MASK (0x4U) -#define SYSCON_CLOCK_CTRL_FRO1MHZ_ENA_SHIFT (2U) -/*! FRO1MHZ_ENA - Enables the FRO_1MHz clock for RTC module and for UTICK - * 0b1..Clock is enabled - * 0b0..Clock is not enabled - */ -#define SYSCON_CLOCK_CTRL_FRO1MHZ_ENA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLOCK_CTRL_FRO1MHZ_ENA_SHIFT)) & SYSCON_CLOCK_CTRL_FRO1MHZ_ENA_MASK) - -#define SYSCON_CLOCK_CTRL_FRO12MHZ_ENA_MASK (0x8U) -#define SYSCON_CLOCK_CTRL_FRO12MHZ_ENA_SHIFT (3U) -/*! FRO12MHZ_ENA - Enables the FRO_12MHz clock for the Flash, LPTMR0/1, and Frequency Measurement modules - * 0b1..Clock is enabled - * 0b0..Clock is not enabled - */ -#define SYSCON_CLOCK_CTRL_FRO12MHZ_ENA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLOCK_CTRL_FRO12MHZ_ENA_SHIFT)) & SYSCON_CLOCK_CTRL_FRO12MHZ_ENA_MASK) - -#define SYSCON_CLOCK_CTRL_FRO_HF_ENA_MASK (0x10U) -#define SYSCON_CLOCK_CTRL_FRO_HF_ENA_SHIFT (4U) -/*! FRO_HF_ENA - Enables FRO HF clock for the Frequency Measure module - * 0b1..Clock is enabled - * 0b0..Clock is not enabled - */ -#define SYSCON_CLOCK_CTRL_FRO_HF_ENA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLOCK_CTRL_FRO_HF_ENA_SHIFT)) & SYSCON_CLOCK_CTRL_FRO_HF_ENA_MASK) - -#define SYSCON_CLOCK_CTRL_CLKIN_ENA_MASK (0x20U) -#define SYSCON_CLOCK_CTRL_CLKIN_ENA_SHIFT (5U) -/*! CLKIN_ENA - Enables clk_in clock for MICFIL, CAN0/1, I3C0/1, SAI0/1, clkout. - * 0b1..Clock is enabled - * 0b0..Clock is not enabled - */ -#define SYSCON_CLOCK_CTRL_CLKIN_ENA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLOCK_CTRL_CLKIN_ENA_SHIFT)) & SYSCON_CLOCK_CTRL_CLKIN_ENA_MASK) - -#define SYSCON_CLOCK_CTRL_FRO1MHZ_CLK_ENA_MASK (0x40U) -#define SYSCON_CLOCK_CTRL_FRO1MHZ_CLK_ENA_SHIFT (6U) -/*! FRO1MHZ_CLK_ENA - Enables FRO_1MHz clock for clock muxing in clock gen - * 0b1..Clock is enabled - * 0b0..Clock is not enabled - */ -#define SYSCON_CLOCK_CTRL_FRO1MHZ_CLK_ENA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLOCK_CTRL_FRO1MHZ_CLK_ENA_SHIFT)) & SYSCON_CLOCK_CTRL_FRO1MHZ_CLK_ENA_MASK) - -#define SYSCON_CLOCK_CTRL_PLU_DEGLITCH_CLK_ENA_MASK (0x200U) -#define SYSCON_CLOCK_CTRL_PLU_DEGLITCH_CLK_ENA_SHIFT (9U) -/*! PLU_DEGLITCH_CLK_ENA - Enables clocks FRO_1MHz and FRO_12MHz for PLU deglitching. - * 0b1..Clock is enabled - * 0b0..Clock is not enabled - */ -#define SYSCON_CLOCK_CTRL_PLU_DEGLITCH_CLK_ENA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLOCK_CTRL_PLU_DEGLITCH_CLK_ENA_SHIFT)) & SYSCON_CLOCK_CTRL_PLU_DEGLITCH_CLK_ENA_MASK) -/*! @} */ - -/*! @name I3C1FCLKSEL - I3C1 Functional Clock Selection */ -/*! @{ */ - -#define SYSCON_I3C1FCLKSEL_SEL_MASK (0x7U) -#define SYSCON_I3C1FCLKSEL_SEL_SHIFT (0U) -/*! SEL - I3C1 clock select - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..FRO_HF clock - * 0b100..No clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_I3C1FCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKSEL_SEL_SHIFT)) & SYSCON_I3C1FCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name I3C1FCLKSTCSEL - Selects the I3C1 Time Control clock */ -/*! @{ */ - -#define SYSCON_I3C1FCLKSTCSEL_SEL_MASK (0x7U) -#define SYSCON_I3C1FCLKSTCSEL_SEL_SHIFT (0U) -/*! SEL - I3C1 FCLK_STC clock select - * 0b000..I3C1 functional clock I3C1FCLK - * 0b001..FRO_1M clock - * 0b010..No clock - * 0b011..No clock - * 0b100..No clock - * 0b101..No clock - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_I3C1FCLKSTCSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKSTCSEL_SEL_SHIFT)) & SYSCON_I3C1FCLKSTCSEL_SEL_MASK) -/*! @} */ - -/*! @name I3C1FCLKSTCDIV - I3C1 FCLK_STC Clock Divider */ -/*! @{ */ - -#define SYSCON_I3C1FCLKSTCDIV_DIV_MASK (0xFFU) -#define SYSCON_I3C1FCLKSTCDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_I3C1FCLKSTCDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKSTCDIV_DIV_SHIFT)) & SYSCON_I3C1FCLKSTCDIV_DIV_MASK) - -#define SYSCON_I3C1FCLKSTCDIV_RESET_MASK (0x20000000U) -#define SYSCON_I3C1FCLKSTCDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_I3C1FCLKSTCDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKSTCDIV_RESET_SHIFT)) & SYSCON_I3C1FCLKSTCDIV_RESET_MASK) - -#define SYSCON_I3C1FCLKSTCDIV_HALT_MASK (0x40000000U) -#define SYSCON_I3C1FCLKSTCDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_I3C1FCLKSTCDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKSTCDIV_HALT_SHIFT)) & SYSCON_I3C1FCLKSTCDIV_HALT_MASK) - -#define SYSCON_I3C1FCLKSTCDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_I3C1FCLKSTCDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_I3C1FCLKSTCDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKSTCDIV_UNSTAB_SHIFT)) & SYSCON_I3C1FCLKSTCDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name I3C1FCLKSDIV - I3C1 FCLK Slow clock Divider */ -/*! @{ */ - -#define SYSCON_I3C1FCLKSDIV_DIV_MASK (0xFFU) -#define SYSCON_I3C1FCLKSDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_I3C1FCLKSDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKSDIV_DIV_SHIFT)) & SYSCON_I3C1FCLKSDIV_DIV_MASK) - -#define SYSCON_I3C1FCLKSDIV_RESET_MASK (0x20000000U) -#define SYSCON_I3C1FCLKSDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_I3C1FCLKSDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKSDIV_RESET_SHIFT)) & SYSCON_I3C1FCLKSDIV_RESET_MASK) - -#define SYSCON_I3C1FCLKSDIV_HALT_MASK (0x40000000U) -#define SYSCON_I3C1FCLKSDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_I3C1FCLKSDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKSDIV_HALT_SHIFT)) & SYSCON_I3C1FCLKSDIV_HALT_MASK) - -#define SYSCON_I3C1FCLKSDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_I3C1FCLKSDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_I3C1FCLKSDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKSDIV_UNSTAB_SHIFT)) & SYSCON_I3C1FCLKSDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name I3C1FCLKDIV - I3C1 Functional Clock FCLK Divider */ -/*! @{ */ - -#define SYSCON_I3C1FCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_I3C1FCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_I3C1FCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKDIV_DIV_SHIFT)) & SYSCON_I3C1FCLKDIV_DIV_MASK) - -#define SYSCON_I3C1FCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_I3C1FCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_I3C1FCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKDIV_RESET_SHIFT)) & SYSCON_I3C1FCLKDIV_RESET_MASK) - -#define SYSCON_I3C1FCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_I3C1FCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_I3C1FCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKDIV_HALT_SHIFT)) & SYSCON_I3C1FCLKDIV_HALT_MASK) - -#define SYSCON_I3C1FCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_I3C1FCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_I3C1FCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKDIV_UNSTAB_SHIFT)) & SYSCON_I3C1FCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name I3C1FCLKSSEL - I3C1 FCLK Slow Selection */ -/*! @{ */ - -#define SYSCON_I3C1FCLKSSEL_SEL_MASK (0x7U) -#define SYSCON_I3C1FCLKSSEL_SEL_SHIFT (0U) -/*! SEL - I3C1 FCLK Slow Clock Select - * 0b000..FRO_1M clock - * 0b001..No clock - * 0b010..No clock - * 0b011..No clock - * 0b100..No clock - * 0b101..No clock - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_I3C1FCLKSSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKSSEL_SEL_SHIFT)) & SYSCON_I3C1FCLKSSEL_SEL_MASK) -/*! @} */ - -/*! @name ETB_STATUS - ETB Counter Status Register */ -/*! @{ */ - -#define SYSCON_ETB_STATUS_IRQ_MASK (0x2U) -#define SYSCON_ETB_STATUS_IRQ_SHIFT (1U) -/*! IRQ - ETB Interrupt - * 0b1..ETB interrupt is asserted when ETB count expires. Write 1 to clear it. - * 0b0..ETB interrupt is not asserted - */ -#define SYSCON_ETB_STATUS_IRQ(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ETB_STATUS_IRQ_SHIFT)) & SYSCON_ETB_STATUS_IRQ_MASK) - -#define SYSCON_ETB_STATUS_NMI_MASK (0x4U) -#define SYSCON_ETB_STATUS_NMI_SHIFT (2U) -/*! NMI - ETB NMI - * 0b1..ETB NMI is asserted. Write 1 to clear it. - * 0b0..ETB NMI is not asserted - */ -#define SYSCON_ETB_STATUS_NMI(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ETB_STATUS_NMI_SHIFT)) & SYSCON_ETB_STATUS_NMI_MASK) - -#define SYSCON_ETB_STATUS_DBG_HALT_REQ_MASK (0x8U) -#define SYSCON_ETB_STATUS_DBG_HALT_REQ_SHIFT (3U) -/*! DBG_HALT_REQ - Debug halt request - * 0b1..The debug halt request signal is asserted when the ETB count expires - * 0b0..The debug halt request signal is not asserted - */ -#define SYSCON_ETB_STATUS_DBG_HALT_REQ(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ETB_STATUS_DBG_HALT_REQ_SHIFT)) & SYSCON_ETB_STATUS_DBG_HALT_REQ_MASK) -/*! @} */ - -/*! @name ETB_COUNTER_CTRL - ETB Counter Control Register */ -/*! @{ */ - -#define SYSCON_ETB_COUNTER_CTRL_CNTEN_MASK (0x1U) -#define SYSCON_ETB_COUNTER_CTRL_CNTEN_SHIFT (0U) -/*! CNTEN - Enables the ETB counter - * 0b1..ETB counter is enabled - * 0b0..ETB counter is disabled - */ -#define SYSCON_ETB_COUNTER_CTRL_CNTEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ETB_COUNTER_CTRL_CNTEN_SHIFT)) & SYSCON_ETB_COUNTER_CTRL_CNTEN_MASK) - -#define SYSCON_ETB_COUNTER_CTRL_RSPT_MASK (0x6U) -#define SYSCON_ETB_COUNTER_CTRL_RSPT_SHIFT (1U) -/*! RSPT - Response Type - * 0b11..Generates a debug halt when the ETB count expires via CPU0 CTICHIN[2] - * 0b10..Generates an NMI interrupt when the ETB count expires - * 0b01..Generates a normal interrupt when the ETB count expires - * 0b00..No response when the ETB count expires - */ -#define SYSCON_ETB_COUNTER_CTRL_RSPT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ETB_COUNTER_CTRL_RSPT_SHIFT)) & SYSCON_ETB_COUNTER_CTRL_RSPT_MASK) - -#define SYSCON_ETB_COUNTER_CTRL_RLRQ_MASK (0x8U) -#define SYSCON_ETB_COUNTER_CTRL_RLRQ_SHIFT (3U) -/*! RLRQ - Reload request - * 0b1..Clears pending debug halt, NMI, or IRQ interrupt requests - * 0b0..No effect - */ -#define SYSCON_ETB_COUNTER_CTRL_RLRQ(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ETB_COUNTER_CTRL_RLRQ_SHIFT)) & SYSCON_ETB_COUNTER_CTRL_RLRQ_MASK) -/*! @} */ - -/*! @name ETB_COUNTER_RELOAD - ETB Counter Reload Register */ -/*! @{ */ - -#define SYSCON_ETB_COUNTER_RELOAD_RELOAD_MASK (0x7FFU) -#define SYSCON_ETB_COUNTER_RELOAD_RELOAD_SHIFT (0U) -/*! RELOAD - Byte count reload value */ -#define SYSCON_ETB_COUNTER_RELOAD_RELOAD(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ETB_COUNTER_RELOAD_RELOAD_SHIFT)) & SYSCON_ETB_COUNTER_RELOAD_RELOAD_MASK) -/*! @} */ - -/*! @name ETB_COUNTER_VALUE - ETB Counter Value Register */ -/*! @{ */ - -#define SYSCON_ETB_COUNTER_VALUE_COUNTER_VALUE_MASK (0x7FFU) -#define SYSCON_ETB_COUNTER_VALUE_COUNTER_VALUE_SHIFT (0U) -/*! COUNTER_VALUE - Byte count counter value */ -#define SYSCON_ETB_COUNTER_VALUE_COUNTER_VALUE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ETB_COUNTER_VALUE_COUNTER_VALUE_SHIFT)) & SYSCON_ETB_COUNTER_VALUE_COUNTER_VALUE_MASK) -/*! @} */ - -/*! @name GRAY_CODE_LSB - Gray to Binary Converter Gray code_gray[31:0] */ -/*! @{ */ - -#define SYSCON_GRAY_CODE_LSB_code_gray_31_0_MASK (0xFFFFFFFFU) -#define SYSCON_GRAY_CODE_LSB_code_gray_31_0_SHIFT (0U) -/*! code_gray_31_0 - Gray code [31:0] */ -#define SYSCON_GRAY_CODE_LSB_code_gray_31_0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GRAY_CODE_LSB_code_gray_31_0_SHIFT)) & SYSCON_GRAY_CODE_LSB_code_gray_31_0_MASK) -/*! @} */ - -/*! @name GRAY_CODE_MSB - Gray to Binary Converter Gray code_gray[41:32] */ -/*! @{ */ - -#define SYSCON_GRAY_CODE_MSB_code_gray_41_32_MASK (0x3FFU) -#define SYSCON_GRAY_CODE_MSB_code_gray_41_32_SHIFT (0U) -/*! code_gray_41_32 - Gray code [41:32] */ -#define SYSCON_GRAY_CODE_MSB_code_gray_41_32(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GRAY_CODE_MSB_code_gray_41_32_SHIFT)) & SYSCON_GRAY_CODE_MSB_code_gray_41_32_MASK) -/*! @} */ - -/*! @name BINARY_CODE_LSB - Gray to Binary Converter Binary Code [31:0] */ -/*! @{ */ - -#define SYSCON_BINARY_CODE_LSB_code_bin_31_0_MASK (0xFFFFFFFFU) -#define SYSCON_BINARY_CODE_LSB_code_bin_31_0_SHIFT (0U) -/*! code_bin_31_0 - Binary code [31:0] */ -#define SYSCON_BINARY_CODE_LSB_code_bin_31_0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_BINARY_CODE_LSB_code_bin_31_0_SHIFT)) & SYSCON_BINARY_CODE_LSB_code_bin_31_0_MASK) -/*! @} */ - -/*! @name BINARY_CODE_MSB - Gray to Binary Converter Binary Code [41:32] */ -/*! @{ */ - -#define SYSCON_BINARY_CODE_MSB_code_bin_41_32_MASK (0x3FFU) -#define SYSCON_BINARY_CODE_MSB_code_bin_41_32_SHIFT (0U) -/*! code_bin_41_32 - Binary code [41:32] */ -#define SYSCON_BINARY_CODE_MSB_code_bin_41_32(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_BINARY_CODE_MSB_code_bin_41_32_SHIFT)) & SYSCON_BINARY_CODE_MSB_code_bin_41_32_MASK) -/*! @} */ - -/*! @name AUTOCLKGATEOVERRIDE - Control Automatic Clock Gating */ -/*! @{ */ - -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMB_CTRL_MASK (0x4U) -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMB_CTRL_SHIFT (2U) -/*! RAMB_CTRL - Controls automatic clock gating for the RAMB Controller - * 0b1..Automatic clock gating is overridden (Automatic clock gating is disabled). - * 0b0..Automatic clock gating is not overridden - */ -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMB_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AUTOCLKGATEOVERRIDE_RAMB_CTRL_SHIFT)) & SYSCON_AUTOCLKGATEOVERRIDE_RAMB_CTRL_MASK) - -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMC_CTRL_MASK (0x8U) -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMC_CTRL_SHIFT (3U) -/*! RAMC_CTRL - Controls automatic clock gating for the RAMC Controller - * 0b1..Automatic clock gating is overridden (Automatic clock gating is disabled). - * 0b0..Automatic clock gating is not overridden - */ -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMC_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AUTOCLKGATEOVERRIDE_RAMC_CTRL_SHIFT)) & SYSCON_AUTOCLKGATEOVERRIDE_RAMC_CTRL_MASK) - -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMD_CTRL_MASK (0x10U) -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMD_CTRL_SHIFT (4U) -/*! RAMD_CTRL - Controls automatic clock gating for the RAMD Controller - * 0b1..Automatic clock gating is overridden (Automatic clock gating is disabled). - * 0b0..Automatic clock gating is not overridden - */ -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMD_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AUTOCLKGATEOVERRIDE_RAMD_CTRL_SHIFT)) & SYSCON_AUTOCLKGATEOVERRIDE_RAMD_CTRL_MASK) - -#define SYSCON_AUTOCLKGATEOVERRIDE_RAME_CTRL_MASK (0x20U) -#define SYSCON_AUTOCLKGATEOVERRIDE_RAME_CTRL_SHIFT (5U) -/*! RAME_CTRL - Controls automatic clock gating for the RAMD Controller. - * 0b1..Automatic clock gating is overridden (Automatic clock gating is disabled). - * 0b0..Automatic clock gating is not overridden - */ -#define SYSCON_AUTOCLKGATEOVERRIDE_RAME_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AUTOCLKGATEOVERRIDE_RAME_CTRL_SHIFT)) & SYSCON_AUTOCLKGATEOVERRIDE_RAME_CTRL_MASK) - -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMF_CTRL_MASK (0x40U) -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMF_CTRL_SHIFT (6U) -/*! RAMF_CTRL - Controls automatic clock gating for the RAMF Controller - * 0b1..Automatic clock gating is overridden (Automatic clock gating is disabled). - * 0b0..Automatic clock gating is not overridden - */ -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMF_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AUTOCLKGATEOVERRIDE_RAMF_CTRL_SHIFT)) & SYSCON_AUTOCLKGATEOVERRIDE_RAMF_CTRL_MASK) - -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMG_CTRL_MASK (0x80U) -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMG_CTRL_SHIFT (7U) -/*! RAMG_CTRL - Controls automatic clock gating for the RAMG Controller - * 0b1..Automatic clock gating is overridden (Automatic clock gating is disabled). - * 0b0..Automatic clock gating is not overridden - */ -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMG_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AUTOCLKGATEOVERRIDE_RAMG_CTRL_SHIFT)) & SYSCON_AUTOCLKGATEOVERRIDE_RAMG_CTRL_MASK) - -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMH_CTRL_MASK (0x100U) -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMH_CTRL_SHIFT (8U) -/*! RAMH_CTRL - Controls automatic clock gating for the RAMG Controller - * 0b1..Automatic clock gating is overridden (Automatic clock gating is disabled). - * 0b0..Automatic clock gating is not overridden - */ -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMH_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AUTOCLKGATEOVERRIDE_RAMH_CTRL_SHIFT)) & SYSCON_AUTOCLKGATEOVERRIDE_RAMH_CTRL_MASK) -/*! @} */ - -/*! @name AUTOCLKGATEOVERRIDEC - Control Automatic Clock Gating C */ -/*! @{ */ - -#define SYSCON_AUTOCLKGATEOVERRIDEC_RAMX_MASK (0x40000000U) -#define SYSCON_AUTOCLKGATEOVERRIDEC_RAMX_SHIFT (30U) -/*! RAMX - Controls automatic clock gating of the RAMX controller - * 0b1..Automatic clock gating is overridden (Automatic clock gating is disabled). - * 0b0..Automatic clock gating is not overridden - */ -#define SYSCON_AUTOCLKGATEOVERRIDEC_RAMX(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AUTOCLKGATEOVERRIDEC_RAMX_SHIFT)) & SYSCON_AUTOCLKGATEOVERRIDEC_RAMX_MASK) - -#define SYSCON_AUTOCLKGATEOVERRIDEC_RAMA_MASK (0x80000000U) -#define SYSCON_AUTOCLKGATEOVERRIDEC_RAMA_SHIFT (31U) -/*! RAMA - Controls automatic clock gating of the RAMA controller - * 0b1..Automatic clock gating is overridden (Automatic clock gating is disabled). - * 0b0..Automatic clock gating is not overridden - */ -#define SYSCON_AUTOCLKGATEOVERRIDEC_RAMA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AUTOCLKGATEOVERRIDEC_RAMA_SHIFT)) & SYSCON_AUTOCLKGATEOVERRIDEC_RAMA_MASK) -/*! @} */ - -/*! @name PWM0SUBCTL - PWM0 Submodule Control */ -/*! @{ */ - -#define SYSCON_PWM0SUBCTL_CLK0_EN_MASK (0x1U) -#define SYSCON_PWM0SUBCTL_CLK0_EN_SHIFT (0U) -/*! CLK0_EN - Enables PWM0 SUB Clock0 */ -#define SYSCON_PWM0SUBCTL_CLK0_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_CLK0_EN_SHIFT)) & SYSCON_PWM0SUBCTL_CLK0_EN_MASK) - -#define SYSCON_PWM0SUBCTL_CLK1_EN_MASK (0x2U) -#define SYSCON_PWM0SUBCTL_CLK1_EN_SHIFT (1U) -/*! CLK1_EN - Enables PWM0 SUB Clock1 */ -#define SYSCON_PWM0SUBCTL_CLK1_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_CLK1_EN_SHIFT)) & SYSCON_PWM0SUBCTL_CLK1_EN_MASK) - -#define SYSCON_PWM0SUBCTL_CLK2_EN_MASK (0x4U) -#define SYSCON_PWM0SUBCTL_CLK2_EN_SHIFT (2U) -/*! CLK2_EN - Enables PWM0 SUB Clock2 */ -#define SYSCON_PWM0SUBCTL_CLK2_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_CLK2_EN_SHIFT)) & SYSCON_PWM0SUBCTL_CLK2_EN_MASK) - -#define SYSCON_PWM0SUBCTL_CLK3_EN_MASK (0x8U) -#define SYSCON_PWM0SUBCTL_CLK3_EN_SHIFT (3U) -/*! CLK3_EN - Enables PWM0 SUB Clock3 */ -#define SYSCON_PWM0SUBCTL_CLK3_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_CLK3_EN_SHIFT)) & SYSCON_PWM0SUBCTL_CLK3_EN_MASK) - -#define SYSCON_PWM0SUBCTL_DMAVALM0_MASK (0x1000U) -#define SYSCON_PWM0SUBCTL_DMAVALM0_SHIFT (12U) -/*! DMAVALM0 - PWM0 submodule 0 DMA compare value done mask */ -#define SYSCON_PWM0SUBCTL_DMAVALM0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_DMAVALM0_SHIFT)) & SYSCON_PWM0SUBCTL_DMAVALM0_MASK) - -#define SYSCON_PWM0SUBCTL_DMAVALM1_MASK (0x2000U) -#define SYSCON_PWM0SUBCTL_DMAVALM1_SHIFT (13U) -/*! DMAVALM1 - PWM0 submodule 1 DMA compare value done mask */ -#define SYSCON_PWM0SUBCTL_DMAVALM1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_DMAVALM1_SHIFT)) & SYSCON_PWM0SUBCTL_DMAVALM1_MASK) - -#define SYSCON_PWM0SUBCTL_DMAVALM2_MASK (0x4000U) -#define SYSCON_PWM0SUBCTL_DMAVALM2_SHIFT (14U) -/*! DMAVALM2 - PWM0 submodule 2 DMA compare value done mask */ -#define SYSCON_PWM0SUBCTL_DMAVALM2(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_DMAVALM2_SHIFT)) & SYSCON_PWM0SUBCTL_DMAVALM2_MASK) - -#define SYSCON_PWM0SUBCTL_DMAVALM3_MASK (0x8000U) -#define SYSCON_PWM0SUBCTL_DMAVALM3_SHIFT (15U) -/*! DMAVALM3 - PWM0 submodule 3 DMA compare value done mask */ -#define SYSCON_PWM0SUBCTL_DMAVALM3(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_DMAVALM3_SHIFT)) & SYSCON_PWM0SUBCTL_DMAVALM3_MASK) -/*! @} */ - -/*! @name PWM1SUBCTL - PWM1 Submodule Control */ -/*! @{ */ - -#define SYSCON_PWM1SUBCTL_CLK0_EN_MASK (0x1U) -#define SYSCON_PWM1SUBCTL_CLK0_EN_SHIFT (0U) -/*! CLK0_EN - Enables PWM1 SUB Clock0 */ -#define SYSCON_PWM1SUBCTL_CLK0_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM1SUBCTL_CLK0_EN_SHIFT)) & SYSCON_PWM1SUBCTL_CLK0_EN_MASK) - -#define SYSCON_PWM1SUBCTL_CLK1_EN_MASK (0x2U) -#define SYSCON_PWM1SUBCTL_CLK1_EN_SHIFT (1U) -/*! CLK1_EN - Enables PWM1 SUB Clock1 */ -#define SYSCON_PWM1SUBCTL_CLK1_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM1SUBCTL_CLK1_EN_SHIFT)) & SYSCON_PWM1SUBCTL_CLK1_EN_MASK) - -#define SYSCON_PWM1SUBCTL_CLK2_EN_MASK (0x4U) -#define SYSCON_PWM1SUBCTL_CLK2_EN_SHIFT (2U) -/*! CLK2_EN - Enables PWM1 SUB Clock2 */ -#define SYSCON_PWM1SUBCTL_CLK2_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM1SUBCTL_CLK2_EN_SHIFT)) & SYSCON_PWM1SUBCTL_CLK2_EN_MASK) - -#define SYSCON_PWM1SUBCTL_CLK3_EN_MASK (0x8U) -#define SYSCON_PWM1SUBCTL_CLK3_EN_SHIFT (3U) -/*! CLK3_EN - Enables PWM1 SUB Clock3 */ -#define SYSCON_PWM1SUBCTL_CLK3_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM1SUBCTL_CLK3_EN_SHIFT)) & SYSCON_PWM1SUBCTL_CLK3_EN_MASK) - -#define SYSCON_PWM1SUBCTL_DMAVALM0_MASK (0x1000U) -#define SYSCON_PWM1SUBCTL_DMAVALM0_SHIFT (12U) -/*! DMAVALM0 - PWM1 submodule 0 DMA compare value done mask */ -#define SYSCON_PWM1SUBCTL_DMAVALM0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM1SUBCTL_DMAVALM0_SHIFT)) & SYSCON_PWM1SUBCTL_DMAVALM0_MASK) - -#define SYSCON_PWM1SUBCTL_DMAVALM1_MASK (0x2000U) -#define SYSCON_PWM1SUBCTL_DMAVALM1_SHIFT (13U) -/*! DMAVALM1 - PWM1 submodule 1 DMA compare value done mask */ -#define SYSCON_PWM1SUBCTL_DMAVALM1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM1SUBCTL_DMAVALM1_SHIFT)) & SYSCON_PWM1SUBCTL_DMAVALM1_MASK) - -#define SYSCON_PWM1SUBCTL_DMAVALM2_MASK (0x4000U) -#define SYSCON_PWM1SUBCTL_DMAVALM2_SHIFT (14U) -/*! DMAVALM2 - PWM1 submodule 2 DMA compare value done mask */ -#define SYSCON_PWM1SUBCTL_DMAVALM2(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM1SUBCTL_DMAVALM2_SHIFT)) & SYSCON_PWM1SUBCTL_DMAVALM2_MASK) - -#define SYSCON_PWM1SUBCTL_DMAVALM3_MASK (0x8000U) -#define SYSCON_PWM1SUBCTL_DMAVALM3_SHIFT (15U) -/*! DMAVALM3 - PWM1 submodule 3 DMA compare value done mask */ -#define SYSCON_PWM1SUBCTL_DMAVALM3(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM1SUBCTL_DMAVALM3_SHIFT)) & SYSCON_PWM1SUBCTL_DMAVALM3_MASK) -/*! @} */ - -/*! @name CTIMERGLOBALSTARTEN - CTIMER Global Start Enable */ -/*! @{ */ - -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER0_CLK_EN_MASK (0x1U) -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER0_CLK_EN_SHIFT (0U) -/*! CTIMER0_CLK_EN - Enables the CTIMER0 function clock - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER0_CLK_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERGLOBALSTARTEN_CTIMER0_CLK_EN_SHIFT)) & SYSCON_CTIMERGLOBALSTARTEN_CTIMER0_CLK_EN_MASK) - -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER1_CLK_EN_MASK (0x2U) -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER1_CLK_EN_SHIFT (1U) -/*! CTIMER1_CLK_EN - Enables the CTIMER1 function clock - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER1_CLK_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERGLOBALSTARTEN_CTIMER1_CLK_EN_SHIFT)) & SYSCON_CTIMERGLOBALSTARTEN_CTIMER1_CLK_EN_MASK) - -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER2_CLK_EN_MASK (0x4U) -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER2_CLK_EN_SHIFT (2U) -/*! CTIMER2_CLK_EN - Enables the CTIMER2 function clock - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER2_CLK_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERGLOBALSTARTEN_CTIMER2_CLK_EN_SHIFT)) & SYSCON_CTIMERGLOBALSTARTEN_CTIMER2_CLK_EN_MASK) - -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER3_CLK_EN_MASK (0x8U) -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER3_CLK_EN_SHIFT (3U) -/*! CTIMER3_CLK_EN - Enables the CTIMER3 function clock - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER3_CLK_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERGLOBALSTARTEN_CTIMER3_CLK_EN_SHIFT)) & SYSCON_CTIMERGLOBALSTARTEN_CTIMER3_CLK_EN_MASK) - -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER4_CLK_EN_MASK (0x10U) -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER4_CLK_EN_SHIFT (4U) -/*! CTIMER4_CLK_EN - Enables the CTIMER4 function clock - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER4_CLK_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERGLOBALSTARTEN_CTIMER4_CLK_EN_SHIFT)) & SYSCON_CTIMERGLOBALSTARTEN_CTIMER4_CLK_EN_MASK) -/*! @} */ - -/*! @name ECC_ENABLE_CTRL - RAM ECC Enable Control */ -/*! @{ */ - -#define SYSCON_ECC_ENABLE_CTRL_RAMA_ECC_ENABLE_MASK (0x1U) -#define SYSCON_ECC_ENABLE_CTRL_RAMA_ECC_ENABLE_SHIFT (0U) -/*! RAMA_ECC_ENABLE - RAMA ECC enable - * 0b1..ECC is enabled - * 0b0..ECC is disabled - */ -#define SYSCON_ECC_ENABLE_CTRL_RAMA_ECC_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ECC_ENABLE_CTRL_RAMA_ECC_ENABLE_SHIFT)) & SYSCON_ECC_ENABLE_CTRL_RAMA_ECC_ENABLE_MASK) - -#define SYSCON_ECC_ENABLE_CTRL_RAMB_RAMX_ECC_ENABLE_MASK (0x2U) -#define SYSCON_ECC_ENABLE_CTRL_RAMB_RAMX_ECC_ENABLE_SHIFT (1U) -/*! RAMB_RAMX_ECC_ENABLE - RAMB and RAMX ECC enable - * 0b1..ECC is enabled - * 0b0..ECC is disabled - */ -#define SYSCON_ECC_ENABLE_CTRL_RAMB_RAMX_ECC_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ECC_ENABLE_CTRL_RAMB_RAMX_ECC_ENABLE_SHIFT)) & SYSCON_ECC_ENABLE_CTRL_RAMB_RAMX_ECC_ENABLE_MASK) - -#define SYSCON_ECC_ENABLE_CTRL_RAMD_RAMC_ECC_ENABLE_MASK (0x4U) -#define SYSCON_ECC_ENABLE_CTRL_RAMD_RAMC_ECC_ENABLE_SHIFT (2U) -/*! RAMD_RAMC_ECC_ENABLE - RAMD and RAMC ECC enable - * 0b1..ECC is enabled - * 0b0..ECC is disabled - */ -#define SYSCON_ECC_ENABLE_CTRL_RAMD_RAMC_ECC_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ECC_ENABLE_CTRL_RAMD_RAMC_ECC_ENABLE_SHIFT)) & SYSCON_ECC_ENABLE_CTRL_RAMD_RAMC_ECC_ENABLE_MASK) - -#define SYSCON_ECC_ENABLE_CTRL_RAMF_RAME_ECC_ENABLE_MASK (0x8U) -#define SYSCON_ECC_ENABLE_CTRL_RAMF_RAME_ECC_ENABLE_SHIFT (3U) -/*! RAMF_RAME_ECC_ENABLE - RAMF and RAME ECC enable - * 0b1..ECC is enabled - * 0b0..ECC is disabled - */ -#define SYSCON_ECC_ENABLE_CTRL_RAMF_RAME_ECC_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ECC_ENABLE_CTRL_RAMF_RAME_ECC_ENABLE_SHIFT)) & SYSCON_ECC_ENABLE_CTRL_RAMF_RAME_ECC_ENABLE_MASK) -/*! @} */ - -/*! @name DEBUG_LOCK_EN - Control Write Access to Security */ -/*! @{ */ - -#define SYSCON_DEBUG_LOCK_EN_LOCK_ALL_MASK (0xFU) -#define SYSCON_DEBUG_LOCK_EN_LOCK_ALL_SHIFT (0U) -/*! LOCK_ALL - Controls write access to the security registers - * 0b1010..Enables write access to all registers - * 0b0000..Any other value than b1010: disables write access to all registers - */ -#define SYSCON_DEBUG_LOCK_EN_LOCK_ALL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_LOCK_EN_LOCK_ALL_SHIFT)) & SYSCON_DEBUG_LOCK_EN_LOCK_ALL_MASK) -/*! @} */ - -/*! @name DEBUG_FEATURES - Cortex Debug Features Control */ -/*! @{ */ - -#define SYSCON_DEBUG_FEATURES_CPU0_DBGEN_MASK (0x3U) -#define SYSCON_DEBUG_FEATURES_CPU0_DBGEN_SHIFT (0U) -/*! CPU0_DBGEN - CPU0 invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_CPU0_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_CPU0_DBGEN_SHIFT)) & SYSCON_DEBUG_FEATURES_CPU0_DBGEN_MASK) - -#define SYSCON_DEBUG_FEATURES_CPU0_NIDEN_MASK (0xCU) -#define SYSCON_DEBUG_FEATURES_CPU0_NIDEN_SHIFT (2U) -/*! CPU0_NIDEN - CPU0 non-invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_CPU0_NIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_CPU0_NIDEN_SHIFT)) & SYSCON_DEBUG_FEATURES_CPU0_NIDEN_MASK) - -#define SYSCON_DEBUG_FEATURES_CPU0_SPIDEN_MASK (0x30U) -#define SYSCON_DEBUG_FEATURES_CPU0_SPIDEN_SHIFT (4U) -/*! CPU0_SPIDEN - CPU0 secure privileged invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_CPU0_SPIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_CPU0_SPIDEN_SHIFT)) & SYSCON_DEBUG_FEATURES_CPU0_SPIDEN_MASK) - -#define SYSCON_DEBUG_FEATURES_CPU0_SPNIDEN_MASK (0xC0U) -#define SYSCON_DEBUG_FEATURES_CPU0_SPNIDEN_SHIFT (6U) -/*! CPU0_SPNIDEN - CPU0 secure privileged non-invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_CPU0_SPNIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_CPU0_SPNIDEN_SHIFT)) & SYSCON_DEBUG_FEATURES_CPU0_SPNIDEN_MASK) - -#define SYSCON_DEBUG_FEATURES_CPU1_DBGEN_MASK (0x300U) -#define SYSCON_DEBUG_FEATURES_CPU1_DBGEN_SHIFT (8U) -/*! CPU1_DBGEN - CPU1 invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_CPU1_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_CPU1_DBGEN_SHIFT)) & SYSCON_DEBUG_FEATURES_CPU1_DBGEN_MASK) - -#define SYSCON_DEBUG_FEATURES_CPU1_NIDEN_MASK (0xC00U) -#define SYSCON_DEBUG_FEATURES_CPU1_NIDEN_SHIFT (10U) -/*! CPU1_NIDEN - CPU1 non-invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_CPU1_NIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_CPU1_NIDEN_SHIFT)) & SYSCON_DEBUG_FEATURES_CPU1_NIDEN_MASK) - -#define SYSCON_DEBUG_FEATURES_DSP_DBGDEN_MASK (0x3000U) -#define SYSCON_DEBUG_FEATURES_DSP_DBGDEN_SHIFT (12U) -/*! DSP_DBGDEN - DSP invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_DSP_DBGDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_DSP_DBGDEN_SHIFT)) & SYSCON_DEBUG_FEATURES_DSP_DBGDEN_MASK) -/*! @} */ - -/*! @name DEBUG_FEATURES_DP - Cortex Debug Features Control (Duplicate) */ -/*! @{ */ - -#define SYSCON_DEBUG_FEATURES_DP_CPU0_DBGEN_MASK (0x3U) -#define SYSCON_DEBUG_FEATURES_DP_CPU0_DBGEN_SHIFT (0U) -/*! CPU0_DBGEN - CPU0 invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_DP_CPU0_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_DP_CPU0_DBGEN_SHIFT)) & SYSCON_DEBUG_FEATURES_DP_CPU0_DBGEN_MASK) - -#define SYSCON_DEBUG_FEATURES_DP_CPU0_NIDEN_MASK (0xCU) -#define SYSCON_DEBUG_FEATURES_DP_CPU0_NIDEN_SHIFT (2U) -/*! CPU0_NIDEN - CPU0 non-invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_DP_CPU0_NIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_DP_CPU0_NIDEN_SHIFT)) & SYSCON_DEBUG_FEATURES_DP_CPU0_NIDEN_MASK) - -#define SYSCON_DEBUG_FEATURES_DP_CPU0_SPIDEN_MASK (0x30U) -#define SYSCON_DEBUG_FEATURES_DP_CPU0_SPIDEN_SHIFT (4U) -/*! CPU0_SPIDEN - CPU0 secure privileged invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_DP_CPU0_SPIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_DP_CPU0_SPIDEN_SHIFT)) & SYSCON_DEBUG_FEATURES_DP_CPU0_SPIDEN_MASK) - -#define SYSCON_DEBUG_FEATURES_DP_CPU0_SPNIDEN_MASK (0xC0U) -#define SYSCON_DEBUG_FEATURES_DP_CPU0_SPNIDEN_SHIFT (6U) -/*! CPU0_SPNIDEN - CPU0 secure privileged non-invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_DP_CPU0_SPNIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_DP_CPU0_SPNIDEN_SHIFT)) & SYSCON_DEBUG_FEATURES_DP_CPU0_SPNIDEN_MASK) - -#define SYSCON_DEBUG_FEATURES_DP_CPU1_DBGEN_MASK (0x300U) -#define SYSCON_DEBUG_FEATURES_DP_CPU1_DBGEN_SHIFT (8U) -/*! CPU1_DBGEN - CPU1 invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_DP_CPU1_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_DP_CPU1_DBGEN_SHIFT)) & SYSCON_DEBUG_FEATURES_DP_CPU1_DBGEN_MASK) - -#define SYSCON_DEBUG_FEATURES_DP_CPU1_NIDEN_MASK (0xC00U) -#define SYSCON_DEBUG_FEATURES_DP_CPU1_NIDEN_SHIFT (10U) -/*! CPU1_NIDEN - CPU1 non-invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_DP_CPU1_NIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_DP_CPU1_NIDEN_SHIFT)) & SYSCON_DEBUG_FEATURES_DP_CPU1_NIDEN_MASK) - -#define SYSCON_DEBUG_FEATURES_DP_DSP_DBGEN_MASK (0x3000U) -#define SYSCON_DEBUG_FEATURES_DP_DSP_DBGEN_SHIFT (12U) -/*! DSP_DBGEN - DSP invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_DP_DSP_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_DP_DSP_DBGEN_SHIFT)) & SYSCON_DEBUG_FEATURES_DP_DSP_DBGEN_MASK) -/*! @} */ - -/*! @name SWD_ACCESS_CPU - CPU0 Software Debug Access..CPU1 Software Debug Access */ -/*! @{ */ - -#define SYSCON_SWD_ACCESS_CPU_SEC_CODE_MASK (0xFFFFFFFFU) -#define SYSCON_SWD_ACCESS_CPU_SEC_CODE_SHIFT (0U) -/*! SEC_CODE - Security code to allow CPU1 DAP: 0x12345678 - * 0b00010010001101000101011001111000..Value to write to enable CPU0 SWD access. Reading back register is read as 0xA. - * 0b00000000000000000000000000000000..CPU0 DAP is not allowed. Reading back register is read as 0x5. - */ -#define SYSCON_SWD_ACCESS_CPU_SEC_CODE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SWD_ACCESS_CPU_SEC_CODE_SHIFT)) & SYSCON_SWD_ACCESS_CPU_SEC_CODE_MASK) -/*! @} */ - -/* The count of SYSCON_SWD_ACCESS_CPU */ -#define SYSCON_SWD_ACCESS_CPU_COUNT (2U) - -/*! @name DEBUG_AUTH_BEACON - Debug Authentication BEACON */ -/*! @{ */ - -#define SYSCON_DEBUG_AUTH_BEACON_BEACON_MASK (0xFFFFFFFFU) -#define SYSCON_DEBUG_AUTH_BEACON_BEACON_SHIFT (0U) -/*! BEACON - Sets by the debug authentication code in ROM to pass the debug beacons (Credential - * Beacon and Authentication Beacon) to the application code. - */ -#define SYSCON_DEBUG_AUTH_BEACON_BEACON(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_AUTH_BEACON_BEACON_SHIFT)) & SYSCON_DEBUG_AUTH_BEACON_BEACON_MASK) -/*! @} */ - -/*! @name SWD_ACCESS_DSP - DSP Software Debug Access */ -/*! @{ */ - -#define SYSCON_SWD_ACCESS_DSP_SEC_CODE_MASK (0xFFFFFFFFU) -#define SYSCON_SWD_ACCESS_DSP_SEC_CODE_SHIFT (0U) -/*! SEC_CODE - DSP SWD-AP: 0x12345678 - * 0b00010010001101000101011001111000..Value to write to enable DSP SWD access. Reading back register is read as 0xA. - * 0b00000000000000000000000000000000..DSP DAP is not allowed. Reading back register is read as 0x5. - */ -#define SYSCON_SWD_ACCESS_DSP_SEC_CODE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SWD_ACCESS_DSP_SEC_CODE_SHIFT)) & SYSCON_SWD_ACCESS_DSP_SEC_CODE_MASK) -/*! @} */ - -/*! @name JTAG_ID - JTAG Chip ID */ -/*! @{ */ - -#define SYSCON_JTAG_ID_JTAG_ID_MASK (0xFFFFFFFFU) -#define SYSCON_JTAG_ID_JTAG_ID_SHIFT (0U) -/*! JTAG_ID - Indicates the device ID */ -#define SYSCON_JTAG_ID_JTAG_ID(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_JTAG_ID_JTAG_ID_SHIFT)) & SYSCON_JTAG_ID_JTAG_ID_MASK) -/*! @} */ - -/*! @name DEVICE_TYPE - Device Type */ -/*! @{ */ - -#define SYSCON_DEVICE_TYPE_DEVICE_TYPE_MASK (0xFFFFFFFFU) -#define SYSCON_DEVICE_TYPE_DEVICE_TYPE_SHIFT (0U) -/*! DEVICE_TYPE - Indicates DEVICE TYPE. */ -#define SYSCON_DEVICE_TYPE_DEVICE_TYPE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEVICE_TYPE_DEVICE_TYPE_SHIFT)) & SYSCON_DEVICE_TYPE_DEVICE_TYPE_MASK) -/*! @} */ - -/*! @name DEVICE_ID0 - Device ID */ -/*! @{ */ - -#define SYSCON_DEVICE_ID0_ROM_REV_MINOR_MASK (0xF00000U) -#define SYSCON_DEVICE_ID0_ROM_REV_MINOR_SHIFT (20U) -/*! ROM_REV_MINOR - ROM revision. */ -#define SYSCON_DEVICE_ID0_ROM_REV_MINOR(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEVICE_ID0_ROM_REV_MINOR_SHIFT)) & SYSCON_DEVICE_ID0_ROM_REV_MINOR_MASK) -/*! @} */ - -/*! @name DIEID - Chip Revision ID and Number */ -/*! @{ */ - -#define SYSCON_DIEID_MINOR_REVISION_MASK (0xFU) -#define SYSCON_DIEID_MINOR_REVISION_SHIFT (0U) -/*! MINOR_REVISION - Chip minor revision */ -#define SYSCON_DIEID_MINOR_REVISION(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DIEID_MINOR_REVISION_SHIFT)) & SYSCON_DIEID_MINOR_REVISION_MASK) - -#define SYSCON_DIEID_MAJOR_REVISION_MASK (0xF0U) -#define SYSCON_DIEID_MAJOR_REVISION_SHIFT (4U) -/*! MAJOR_REVISION - Chip major revision */ -#define SYSCON_DIEID_MAJOR_REVISION(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DIEID_MAJOR_REVISION_SHIFT)) & SYSCON_DIEID_MAJOR_REVISION_MASK) - -#define SYSCON_DIEID_MCO_NUM_IN_DIE_ID_MASK (0xFFFFF00U) -#define SYSCON_DIEID_MCO_NUM_IN_DIE_ID_SHIFT (8U) -/*! MCO_NUM_IN_DIE_ID - Chip number */ -#define SYSCON_DIEID_MCO_NUM_IN_DIE_ID(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DIEID_MCO_NUM_IN_DIE_ID_SHIFT)) & SYSCON_DIEID_MCO_NUM_IN_DIE_ID_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group SYSCON_Register_Masks */ - - -/* SYSCON - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral SYSCON0 base address */ - #define SYSCON0_BASE (0x50000000u) - /** Peripheral SYSCON0 base address */ - #define SYSCON0_BASE_NS (0x40000000u) - /** Peripheral SYSCON0 base pointer */ - #define SYSCON0 ((SYSCON_Type *)SYSCON0_BASE) - /** Peripheral SYSCON0 base pointer */ - #define SYSCON0_NS ((SYSCON_Type *)SYSCON0_BASE_NS) - /** Array initializer of SYSCON peripheral base addresses */ - #define SYSCON_BASE_ADDRS { SYSCON0_BASE } - /** Array initializer of SYSCON peripheral base pointers */ - #define SYSCON_BASE_PTRS { SYSCON0 } - /** Array initializer of SYSCON peripheral base addresses */ - #define SYSCON_BASE_ADDRS_NS { SYSCON0_BASE_NS } - /** Array initializer of SYSCON peripheral base pointers */ - #define SYSCON_BASE_PTRS_NS { SYSCON0_NS } -#else - /** Peripheral SYSCON0 base address */ - #define SYSCON0_BASE (0x40000000u) - /** Peripheral SYSCON0 base pointer */ - #define SYSCON0 ((SYSCON_Type *)SYSCON0_BASE) - /** Array initializer of SYSCON peripheral base addresses */ - #define SYSCON_BASE_ADDRS { SYSCON0_BASE } - /** Array initializer of SYSCON peripheral base pointers */ - #define SYSCON_BASE_PTRS { SYSCON0 } -#endif -/* Backward compatibility */ -#define SYSCON SYSCON0 - - -/*! - * @} - */ /* end of group SYSCON_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- SYSPM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SYSPM_Peripheral_Access_Layer SYSPM Peripheral Access Layer - * @{ - */ - -/** SYSPM - Register Layout Typedef */ -typedef struct { - struct { /* offset: 0x0, array step: 0x30 */ - __IO uint32_t PMCR; /**< Performance Monitor Control, array offset: 0x0, array step: 0x30 */ - uint8_t RESERVED_0[20]; - struct { /* offset: 0x18, array step: index*0x30, index2*0x8 */ - __I uint8_t HI; /**< Performance Monitor Event Counter, array offset: 0x18, array step: index*0x30, index2*0x8 */ - uint8_t RESERVED_0[3]; - __I uint32_t LO; /**< Performance Monitor Event Counter, array offset: 0x1C, array step: index*0x30, index2*0x8 */ - } PMECTR[3]; - } PMCR[1]; -} SYSPM_Type; - -/* ---------------------------------------------------------------------------- - -- SYSPM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SYSPM_Register_Masks SYSPM Register Masks - * @{ - */ - -/*! @name PMCR - Performance Monitor Control */ -/*! @{ */ - -#define SYSPM_PMCR_MENB_MASK (0x1U) -#define SYSPM_PMCR_MENB_SHIFT (0U) -/*! MENB - Module Is Enabled - * 0b0..Disabled - * 0b1..Enabled - */ -#define SYSPM_PMCR_MENB(x) (((uint32_t)(((uint32_t)(x)) << SYSPM_PMCR_MENB_SHIFT)) & SYSPM_PMCR_MENB_MASK) - -#define SYSPM_PMCR_SSC_MASK (0xEU) -#define SYSPM_PMCR_SSC_SHIFT (1U) -/*! SSC - Start and Stop Control - * 0b000..Idle or no-op - * 0b001..Local stop - * 0b010, 0b011..Local start - * 0b100.. - * 0b101.. - * 0b110, 0b111.. - */ -#define SYSPM_PMCR_SSC(x) (((uint32_t)(((uint32_t)(x)) << SYSPM_PMCR_SSC_SHIFT)) & SYSPM_PMCR_SSC_MASK) - -#define SYSPM_PMCR_CMODE_MASK (0x30U) -#define SYSPM_PMCR_CMODE_SHIFT (4U) -/*! CMODE - Count Mode - * 0b00..Counted in both User and Privileged modes - * 0b01.. - * 0b10..Counted only in User mode - * 0b11..Counted only in Privileged mode - */ -#define SYSPM_PMCR_CMODE(x) (((uint32_t)(((uint32_t)(x)) << SYSPM_PMCR_CMODE_SHIFT)) & SYSPM_PMCR_CMODE_MASK) - -#define SYSPM_PMCR_RECTR1_MASK (0x100U) -#define SYSPM_PMCR_RECTR1_SHIFT (8U) -/*! RECTR1 - Reset Event Counter 1 - * 0b0..Run normally - * 0b1..Reset - */ -#define SYSPM_PMCR_RECTR1(x) (((uint32_t)(((uint32_t)(x)) << SYSPM_PMCR_RECTR1_SHIFT)) & SYSPM_PMCR_RECTR1_MASK) - -#define SYSPM_PMCR_RECTR2_MASK (0x200U) -#define SYSPM_PMCR_RECTR2_SHIFT (9U) -/*! RECTR2 - Reset Event Counter 2 - * 0b0..Run normally - * 0b1..Reset - */ -#define SYSPM_PMCR_RECTR2(x) (((uint32_t)(((uint32_t)(x)) << SYSPM_PMCR_RECTR2_SHIFT)) & SYSPM_PMCR_RECTR2_MASK) - -#define SYSPM_PMCR_RECTR3_MASK (0x400U) -#define SYSPM_PMCR_RECTR3_SHIFT (10U) -/*! RECTR3 - Reset Event Counter 3 - * 0b0..Run normally - * 0b1..Reset - */ -#define SYSPM_PMCR_RECTR3(x) (((uint32_t)(((uint32_t)(x)) << SYSPM_PMCR_RECTR3_SHIFT)) & SYSPM_PMCR_RECTR3_MASK) - -#define SYSPM_PMCR_SELEVT1_MASK (0x3F800U) -#define SYSPM_PMCR_SELEVT1_SHIFT (11U) -/*! SELEVT1 - Select Event 1 */ -#define SYSPM_PMCR_SELEVT1(x) (((uint32_t)(((uint32_t)(x)) << SYSPM_PMCR_SELEVT1_SHIFT)) & SYSPM_PMCR_SELEVT1_MASK) - -#define SYSPM_PMCR_SELEVT2_MASK (0x1FC0000U) -#define SYSPM_PMCR_SELEVT2_SHIFT (18U) -/*! SELEVT2 - Select Event 2 */ -#define SYSPM_PMCR_SELEVT2(x) (((uint32_t)(((uint32_t)(x)) << SYSPM_PMCR_SELEVT2_SHIFT)) & SYSPM_PMCR_SELEVT2_MASK) - -#define SYSPM_PMCR_SELEVT3_MASK (0xFE000000U) -#define SYSPM_PMCR_SELEVT3_SHIFT (25U) -/*! SELEVT3 - Select Event 3 */ -#define SYSPM_PMCR_SELEVT3(x) (((uint32_t)(((uint32_t)(x)) << SYSPM_PMCR_SELEVT3_SHIFT)) & SYSPM_PMCR_SELEVT3_MASK) -/*! @} */ - -/* The count of SYSPM_PMCR */ -#define SYSPM_PMCR_COUNT (1U) - -/*! @name PMCR_PMECTR_HI - Performance Monitor Event Counter */ -/*! @{ */ - -#define SYSPM_PMCR_PMECTR_HI_ECTR_MASK (0xFFU) -#define SYSPM_PMCR_PMECTR_HI_ECTR_SHIFT (0U) -/*! ECTR - Event Counter */ -#define SYSPM_PMCR_PMECTR_HI_ECTR(x) (((uint8_t)(((uint8_t)(x)) << SYSPM_PMCR_PMECTR_HI_ECTR_SHIFT)) & SYSPM_PMCR_PMECTR_HI_ECTR_MASK) -/*! @} */ - -/* The count of SYSPM_PMCR_PMECTR_HI */ -#define SYSPM_PMCR_PMECTR_HI_COUNT (1U) - -/* The count of SYSPM_PMCR_PMECTR_HI */ -#define SYSPM_PMCR_PMECTR_HI_COUNT2 (3U) - -/*! @name PMCR_PMECTR_LO - Performance Monitor Event Counter */ -/*! @{ */ - -#define SYSPM_PMCR_PMECTR_LO_ECTR_MASK (0xFFFFFFFFU) -#define SYSPM_PMCR_PMECTR_LO_ECTR_SHIFT (0U) -/*! ECTR - Event Counter */ -#define SYSPM_PMCR_PMECTR_LO_ECTR(x) (((uint32_t)(((uint32_t)(x)) << SYSPM_PMCR_PMECTR_LO_ECTR_SHIFT)) & SYSPM_PMCR_PMECTR_LO_ECTR_MASK) -/*! @} */ - -/* The count of SYSPM_PMCR_PMECTR_LO */ -#define SYSPM_PMCR_PMECTR_LO_COUNT (1U) - -/* The count of SYSPM_PMCR_PMECTR_LO */ -#define SYSPM_PMCR_PMECTR_LO_COUNT2 (3U) - - -/*! - * @} - */ /* end of group SYSPM_Register_Masks */ - - -/* SYSPM - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral CMX_PERFMON0 base address */ - #define CMX_PERFMON0_BASE (0x500C1000u) - /** Peripheral CMX_PERFMON0 base address */ - #define CMX_PERFMON0_BASE_NS (0x400C1000u) - /** Peripheral CMX_PERFMON0 base pointer */ - #define CMX_PERFMON0 ((SYSPM_Type *)CMX_PERFMON0_BASE) - /** Peripheral CMX_PERFMON0 base pointer */ - #define CMX_PERFMON0_NS ((SYSPM_Type *)CMX_PERFMON0_BASE_NS) - /** Peripheral CMX_PERFMON1 base address */ - #define CMX_PERFMON1_BASE (0x500C2000u) - /** Peripheral CMX_PERFMON1 base address */ - #define CMX_PERFMON1_BASE_NS (0x400C2000u) - /** Peripheral CMX_PERFMON1 base pointer */ - #define CMX_PERFMON1 ((SYSPM_Type *)CMX_PERFMON1_BASE) - /** Peripheral CMX_PERFMON1 base pointer */ - #define CMX_PERFMON1_NS ((SYSPM_Type *)CMX_PERFMON1_BASE_NS) - /** Array initializer of SYSPM peripheral base addresses */ - #define SYSPM_BASE_ADDRS { CMX_PERFMON0_BASE, CMX_PERFMON1_BASE } - /** Array initializer of SYSPM peripheral base pointers */ - #define SYSPM_BASE_PTRS { CMX_PERFMON0, CMX_PERFMON1 } - /** Array initializer of SYSPM peripheral base addresses */ - #define SYSPM_BASE_ADDRS_NS { CMX_PERFMON0_BASE_NS, CMX_PERFMON1_BASE_NS } - /** Array initializer of SYSPM peripheral base pointers */ - #define SYSPM_BASE_PTRS_NS { CMX_PERFMON0_NS, CMX_PERFMON1_NS } -#else - /** Peripheral CMX_PERFMON0 base address */ - #define CMX_PERFMON0_BASE (0x400C1000u) - /** Peripheral CMX_PERFMON0 base pointer */ - #define CMX_PERFMON0 ((SYSPM_Type *)CMX_PERFMON0_BASE) - /** Peripheral CMX_PERFMON1 base address */ - #define CMX_PERFMON1_BASE (0x400C2000u) - /** Peripheral CMX_PERFMON1 base pointer */ - #define CMX_PERFMON1 ((SYSPM_Type *)CMX_PERFMON1_BASE) - /** Array initializer of SYSPM peripheral base addresses */ - #define SYSPM_BASE_ADDRS { CMX_PERFMON0_BASE, CMX_PERFMON1_BASE } - /** Array initializer of SYSPM peripheral base pointers */ - #define SYSPM_BASE_PTRS { CMX_PERFMON0, CMX_PERFMON1 } -#endif - -/*! - * @} - */ /* end of group SYSPM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- TRDC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup TRDC_Peripheral_Access_Layer TRDC Peripheral Access Layer - * @{ - */ - -/** TRDC - Register Layout Typedef */ -typedef struct { - struct { /* offset: 0x0, array step: 0x1CC */ - __IO uint32_t MBC_MEM_GLBCFG[4]; /**< MBC Global Configuration Register, array offset: 0x0, array step: index*0x1CC, index2*0x4 */ - __IO uint32_t MBC_NSE_BLK_INDEX; /**< MBC NonSecure Enable Block Index, array offset: 0x10, array step: 0x1CC */ - __O uint32_t MBC_NSE_BLK_SET; /**< MBC NonSecure Enable Block Set, array offset: 0x14, array step: 0x1CC */ - __O uint32_t MBC_NSE_BLK_CLR; /**< MBC NonSecure Enable Block Clear, array offset: 0x18, array step: 0x1CC */ - __O uint32_t MBC_NSE_BLK_CLR_ALL; /**< MBC NonSecure Enable Block Clear All, array offset: 0x1C, array step: 0x1CC */ - __IO uint32_t MBC_MEMN_GLBAC[8]; /**< MBC Global Access Control, array offset: 0x20, array step: index*0x1CC, index2*0x4 */ - __IO uint32_t MBC_DOM0_MEM0_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x40, array step: index*0x1CC, index2*0x4 */ - uint8_t RESERVED_0[224]; - __IO uint32_t MBC_DOM0_MEM0_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x140, array step: index*0x1CC, index2*0x4 */ - uint8_t RESERVED_1[56]; - __IO uint32_t MBC_DOM0_MEM1_BLK_CFG_W[1]; /**< MBC Memory Block Configuration Word, array offset: 0x180, array step: index*0x1CC, index2*0x4 */ - uint8_t RESERVED_2[28]; - __IO uint32_t MBC_DOM0_MEM1_BLK_NSE_W[1]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x1A0, array step: index*0x1CC, index2*0x4 */ - uint8_t RESERVED_3[4]; - __IO uint32_t MBC_DOM0_MEM2_BLK_CFG_W[1]; /**< MBC Memory Block Configuration Word, array offset: 0x1A8, array step: index*0x1CC, index2*0x4 */ - uint8_t RESERVED_4[28]; - __IO uint32_t MBC_DOM0_MEM2_BLK_NSE_W[1]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x1C8, array step: index*0x1CC, index2*0x4 */ - } MBC_INDEX[1]; -} TRDC_Type; - -/* ---------------------------------------------------------------------------- - -- TRDC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup TRDC_Register_Masks TRDC Register Masks - * @{ - */ - -/*! @name MBC_INDEX_MBC_MEM_GLBCFG - MBC Global Configuration Register */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_NBLKS_MASK (0x3FFU) -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_NBLKS_SHIFT (0U) -/*! NBLKS - Number of blocks in this memory */ -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_NBLKS(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEM_GLBCFG_NBLKS_SHIFT)) & TRDC_MBC_INDEX_MBC_MEM_GLBCFG_NBLKS_MASK) - -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_SIZE_LOG2_MASK (0x1F0000U) -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_SIZE_LOG2_SHIFT (16U) -/*! SIZE_LOG2 - Log2 size per block */ -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_SIZE_LOG2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEM_GLBCFG_SIZE_LOG2_SHIFT)) & TRDC_MBC_INDEX_MBC_MEM_GLBCFG_SIZE_LOG2_MASK) - -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_CLRE_MASK (0xC0000000U) -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_CLRE_SHIFT (30U) -/*! CLRE - Clear Error */ -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_CLRE(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEM_GLBCFG_CLRE_SHIFT)) & TRDC_MBC_INDEX_MBC_MEM_GLBCFG_CLRE_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_MEM_GLBCFG */ -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_MEM_GLBCFG */ -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_COUNT2 (4U) - -/*! @name MBC_INDEX_MBC_NSE_BLK_INDEX - MBC NonSecure Enable Block Index */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_WNDX_MASK (0x3CU) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_WNDX_SHIFT (2U) -/*! WNDX - Word index into the block NSE bitmap. It selects the BLK_NSE_Wn register, where WNDX determines the value of n. */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_WNDX(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_WNDX_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_WNDX_MASK) - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_MEM_SEL_MASK (0xF00U) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_MEM_SEL_SHIFT (8U) -/*! MEM_SEL - Memory Select */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_MEM_SEL(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_MEM_SEL_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_MEM_SEL_MASK) - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_DID_SEL0_MASK (0x10000U) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_DID_SEL0_SHIFT (16U) -/*! DID_SEL0 - DID Select - * 0b0..No effect. - * 0b1..Selects NSE bits for this domain. - */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_DID_SEL0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_DID_SEL0_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_DID_SEL0_MASK) - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_AI_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_AI_SHIFT (31U) -/*! AI - Auto Increment - * 0b0..No effect. - * 0b1..Add 1 to the WNDX field after the register write. - */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_AI(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_AI_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_AI_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_COUNT (1U) - -/*! @name MBC_INDEX_MBC_NSE_BLK_SET - MBC NonSecure Enable Block Set */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_SET_W1SET_MASK (0xFFFFFFFFU) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_SET_W1SET_SHIFT (0U) -/*! W1SET - Write-1 Set */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_SET_W1SET(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_SET_W1SET_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_SET_W1SET_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_NSE_BLK_SET */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_SET_COUNT (1U) - -/*! @name MBC_INDEX_MBC_NSE_BLK_CLR - MBC NonSecure Enable Block Clear */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_W1CLR_MASK (0xFFFFFFFFU) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_W1CLR_SHIFT (0U) -/*! W1CLR - Write-1 Clear */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_W1CLR(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_W1CLR_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_W1CLR_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_NSE_BLK_CLR */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_COUNT (1U) - -/*! @name MBC_INDEX_MBC_NSE_BLK_CLR_ALL - MBC NonSecure Enable Block Clear All */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_MEMSEL_MASK (0xF00U) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_MEMSEL_SHIFT (8U) -/*! MEMSEL - Memory Select */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_MEMSEL(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_MEMSEL_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_MEMSEL_MASK) - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_DID_SEL0_MASK (0x10000U) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_DID_SEL0_SHIFT (16U) -/*! DID_SEL0 - DID Select - * 0b0..No effect. - * 0b1..Clear all NSE bits for this domain. - */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_DID_SEL0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_DID_SEL0_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_DID_SEL0_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_COUNT (1U) - -/*! @name MBC_INDEX_MBC_MEMN_GLBAC - MBC Global Access Control */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUX_MASK (0x1U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUX_SHIFT (0U) -/*! NUX - NonsecureUser Execute - * 0b0..Execute access is not allowed in Nonsecure User mode. - * 0b1..Execute access is allowed in Nonsecure User mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUX(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUX_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUX_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUW_MASK (0x2U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUW_SHIFT (1U) -/*! NUW - NonsecureUser Write - * 0b0..Write access is not allowed in Nonsecure User mode. - * 0b1..Write access is allowed in Nonsecure User mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUW(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUW_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUW_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUR_MASK (0x4U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUR_SHIFT (2U) -/*! NUR - NonsecureUser Read - * 0b0..Read access is not allowed in Nonsecure User mode. - * 0b1..Read access is allowed in Nonsecure User mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUR(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUR_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUR_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPX_MASK (0x10U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPX_SHIFT (4U) -/*! NPX - NonsecurePriv Execute - * 0b0..Execute access is not allowed in Nonsecure Privilege mode. - * 0b1..Execute access is allowed in Nonsecure Privilege mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPX(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPX_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPX_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPW_MASK (0x20U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPW_SHIFT (5U) -/*! NPW - NonsecurePriv Write - * 0b0..Write access is not allowed in Nonsecure Privilege mode. - * 0b1..Write access is allowed in Nonsecure Privilege mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPW(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPW_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPW_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPR_MASK (0x40U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPR_SHIFT (6U) -/*! NPR - NonsecurePriv Read - * 0b0..Read access is not allowed in Nonsecure Privilege mode. - * 0b1..Read access is allowed in Nonsecure Privilege mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPR(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPR_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPR_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUX_MASK (0x100U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUX_SHIFT (8U) -/*! SUX - SecureUser Execute - * 0b0..Execute access is not allowed in Secure User mode. - * 0b1..Execute access is allowed in Secure User mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUX(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUX_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUX_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUW_MASK (0x200U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUW_SHIFT (9U) -/*! SUW - SecureUser Write - * 0b0..Write access is not allowed in Secure User mode. - * 0b1..Write access is allowed in Secure User mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUW(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUW_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUW_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUR_MASK (0x400U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUR_SHIFT (10U) -/*! SUR - SecureUser Read - * 0b0..Read access is not allowed in Secure User mode. - * 0b1..Read access is allowed in Secure User mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUR(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUR_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUR_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPX_MASK (0x1000U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPX_SHIFT (12U) -/*! SPX - SecurePriv Execute - * 0b0..Execute access is not allowed in Secure Privilege mode. - * 0b1..Execute access is allowed in Secure Privilege mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPX(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPX_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPX_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPW_MASK (0x2000U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPW_SHIFT (13U) -/*! SPW - SecurePriv Write - * 0b0..Write access is not allowed in Secure Privilege mode. - * 0b1..Write access is allowed in Secure Privilege mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPW(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPW_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPW_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPR_MASK (0x4000U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPR_SHIFT (14U) -/*! SPR - SecurePriv Read - * 0b0..Read access is not allowed in Secure Privilege mode. - * 0b1..Read access is allowed in Secure Privilege mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPR(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPR_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPR_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_LK_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_LK_SHIFT (31U) -/*! LK - LOCK - * 0b0..This register is not locked and can be altered. - * 0b1..This register is locked and cannot be altered. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_LK(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_LK_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_LK_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_MEMN_GLBAC */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_MEMN_GLBAC */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_COUNT2 (8U) - -/*! @name MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W - MBC Memory Block Configuration Word */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL0_MASK (0x7U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL0_SHIFT (0U) -/*! MBACSEL0 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE0_MASK (0x8U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE0_SHIFT (3U) -/*! NSE0 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL1_MASK (0x70U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL1_SHIFT (4U) -/*! MBACSEL1 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE1_MASK (0x80U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE1_SHIFT (7U) -/*! NSE1 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL2_MASK (0x700U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL2_SHIFT (8U) -/*! MBACSEL2 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE2_MASK (0x800U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE2_SHIFT (11U) -/*! NSE2 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL3_MASK (0x7000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL3_SHIFT (12U) -/*! MBACSEL3 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE3_MASK (0x8000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE3_SHIFT (15U) -/*! NSE3 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL4_MASK (0x70000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL4_SHIFT (16U) -/*! MBACSEL4 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE4_MASK (0x80000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE4_SHIFT (19U) -/*! NSE4 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL5_MASK (0x700000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL5_SHIFT (20U) -/*! MBACSEL5 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE5_MASK (0x800000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE5_SHIFT (23U) -/*! NSE5 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL6_MASK (0x7000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL6_SHIFT (24U) -/*! MBACSEL6 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE6_MASK (0x8000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE6_SHIFT (27U) -/*! NSE6 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL7_MASK (0x70000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL7_SHIFT (28U) -/*! MBACSEL7 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL7_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE7_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE7_SHIFT (31U) -/*! NSE7 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE7_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_COUNT2 (8U) - -/*! @name MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W - MBC Memory Block NonSecure Enable Word */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT0_MASK (0x1U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT0_SHIFT (0U) -/*! BIT0 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT1_MASK (0x2U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT1_SHIFT (1U) -/*! BIT1 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT2_MASK (0x4U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT2_SHIFT (2U) -/*! BIT2 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT3_MASK (0x8U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT3_SHIFT (3U) -/*! BIT3 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT4_MASK (0x10U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT4_SHIFT (4U) -/*! BIT4 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT5_MASK (0x20U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT5_SHIFT (5U) -/*! BIT5 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT6_MASK (0x40U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT6_SHIFT (6U) -/*! BIT6 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT7_MASK (0x80U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT7_SHIFT (7U) -/*! BIT7 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT7_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT8_MASK (0x100U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT8_SHIFT (8U) -/*! BIT8 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT8(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT8_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT8_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT9_MASK (0x200U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT9_SHIFT (9U) -/*! BIT9 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT9(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT9_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT9_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT10_MASK (0x400U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT10_SHIFT (10U) -/*! BIT10 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT10(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT10_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT10_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT11_MASK (0x800U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT11_SHIFT (11U) -/*! BIT11 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT11(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT11_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT11_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT12_MASK (0x1000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT12_SHIFT (12U) -/*! BIT12 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT12(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT12_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT12_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT13_MASK (0x2000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT13_SHIFT (13U) -/*! BIT13 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT13(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT13_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT13_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT14_MASK (0x4000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT14_SHIFT (14U) -/*! BIT14 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT14(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT14_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT14_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT15_MASK (0x8000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT15_SHIFT (15U) -/*! BIT15 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT15(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT15_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT15_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT16_MASK (0x10000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT16_SHIFT (16U) -/*! BIT16 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT16(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT16_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT16_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT17_MASK (0x20000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT17_SHIFT (17U) -/*! BIT17 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT17(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT17_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT17_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT18_MASK (0x40000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT18_SHIFT (18U) -/*! BIT18 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT18(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT18_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT18_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT19_MASK (0x80000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT19_SHIFT (19U) -/*! BIT19 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT19(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT19_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT19_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT20_MASK (0x100000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT20_SHIFT (20U) -/*! BIT20 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT20(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT20_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT20_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT21_MASK (0x200000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT21_SHIFT (21U) -/*! BIT21 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT21(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT21_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT21_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT22_MASK (0x400000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT22_SHIFT (22U) -/*! BIT22 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT22(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT22_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT22_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT23_MASK (0x800000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT23_SHIFT (23U) -/*! BIT23 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT23(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT23_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT23_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT24_MASK (0x1000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT24_SHIFT (24U) -/*! BIT24 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT24(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT24_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT24_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT25_MASK (0x2000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT25_SHIFT (25U) -/*! BIT25 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT25(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT25_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT25_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT26_MASK (0x4000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT26_SHIFT (26U) -/*! BIT26 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT26(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT26_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT26_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT27_MASK (0x8000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT27_SHIFT (27U) -/*! BIT27 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT27(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT27_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT27_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT28_MASK (0x10000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT28_SHIFT (28U) -/*! BIT28 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT28(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT28_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT28_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT29_MASK (0x20000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT29_SHIFT (29U) -/*! BIT29 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT29(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT29_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT29_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT30_MASK (0x40000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT30_SHIFT (30U) -/*! BIT30 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT30(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT30_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT30_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT31_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT31_SHIFT (31U) -/*! BIT31 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT31(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT31_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT31_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_COUNT2 (2U) - -/*! @name MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W - MBC Memory Block Configuration Word */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL0_MASK (0x7U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL0_SHIFT (0U) -/*! MBACSEL0 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE0_MASK (0x8U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE0_SHIFT (3U) -/*! NSE0 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL1_MASK (0x70U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL1_SHIFT (4U) -/*! MBACSEL1 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE1_MASK (0x80U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE1_SHIFT (7U) -/*! NSE1 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL2_MASK (0x700U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL2_SHIFT (8U) -/*! MBACSEL2 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE2_MASK (0x800U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE2_SHIFT (11U) -/*! NSE2 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL3_MASK (0x7000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL3_SHIFT (12U) -/*! MBACSEL3 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE3_MASK (0x8000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE3_SHIFT (15U) -/*! NSE3 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL4_MASK (0x70000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL4_SHIFT (16U) -/*! MBACSEL4 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE4_MASK (0x80000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE4_SHIFT (19U) -/*! NSE4 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL5_MASK (0x700000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL5_SHIFT (20U) -/*! MBACSEL5 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE5_MASK (0x800000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE5_SHIFT (23U) -/*! NSE5 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL6_MASK (0x7000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL6_SHIFT (24U) -/*! MBACSEL6 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE6_MASK (0x8000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE6_SHIFT (27U) -/*! NSE6 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL7_MASK (0x70000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL7_SHIFT (28U) -/*! MBACSEL7 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL7_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE7_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE7_SHIFT (31U) -/*! NSE7 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE7_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_COUNT2 (1U) - -/*! @name MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W - MBC Memory Block NonSecure Enable Word */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT0_MASK (0x1U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT0_SHIFT (0U) -/*! BIT0 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT1_MASK (0x2U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT1_SHIFT (1U) -/*! BIT1 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT2_MASK (0x4U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT2_SHIFT (2U) -/*! BIT2 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT3_MASK (0x8U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT3_SHIFT (3U) -/*! BIT3 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT4_MASK (0x10U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT4_SHIFT (4U) -/*! BIT4 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT5_MASK (0x20U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT5_SHIFT (5U) -/*! BIT5 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT6_MASK (0x40U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT6_SHIFT (6U) -/*! BIT6 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT7_MASK (0x80U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT7_SHIFT (7U) -/*! BIT7 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT7_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT8_MASK (0x100U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT8_SHIFT (8U) -/*! BIT8 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT8(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT8_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT8_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT9_MASK (0x200U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT9_SHIFT (9U) -/*! BIT9 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT9(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT9_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT9_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT10_MASK (0x400U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT10_SHIFT (10U) -/*! BIT10 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT10(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT10_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT10_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT11_MASK (0x800U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT11_SHIFT (11U) -/*! BIT11 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT11(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT11_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT11_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT12_MASK (0x1000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT12_SHIFT (12U) -/*! BIT12 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT12(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT12_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT12_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT13_MASK (0x2000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT13_SHIFT (13U) -/*! BIT13 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT13(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT13_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT13_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT14_MASK (0x4000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT14_SHIFT (14U) -/*! BIT14 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT14(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT14_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT14_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT15_MASK (0x8000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT15_SHIFT (15U) -/*! BIT15 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT15(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT15_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT15_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT16_MASK (0x10000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT16_SHIFT (16U) -/*! BIT16 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT16(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT16_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT16_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT17_MASK (0x20000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT17_SHIFT (17U) -/*! BIT17 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT17(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT17_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT17_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT18_MASK (0x40000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT18_SHIFT (18U) -/*! BIT18 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT18(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT18_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT18_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT19_MASK (0x80000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT19_SHIFT (19U) -/*! BIT19 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT19(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT19_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT19_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT20_MASK (0x100000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT20_SHIFT (20U) -/*! BIT20 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT20(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT20_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT20_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT21_MASK (0x200000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT21_SHIFT (21U) -/*! BIT21 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT21(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT21_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT21_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT22_MASK (0x400000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT22_SHIFT (22U) -/*! BIT22 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT22(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT22_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT22_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT23_MASK (0x800000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT23_SHIFT (23U) -/*! BIT23 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT23(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT23_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT23_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT24_MASK (0x1000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT24_SHIFT (24U) -/*! BIT24 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT24(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT24_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT24_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT25_MASK (0x2000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT25_SHIFT (25U) -/*! BIT25 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT25(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT25_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT25_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT26_MASK (0x4000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT26_SHIFT (26U) -/*! BIT26 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT26(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT26_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT26_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT27_MASK (0x8000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT27_SHIFT (27U) -/*! BIT27 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT27(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT27_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT27_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT28_MASK (0x10000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT28_SHIFT (28U) -/*! BIT28 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT28(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT28_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT28_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT29_MASK (0x20000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT29_SHIFT (29U) -/*! BIT29 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT29(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT29_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT29_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT30_MASK (0x40000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT30_SHIFT (30U) -/*! BIT30 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT30(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT30_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT30_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT31_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT31_SHIFT (31U) -/*! BIT31 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT31(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT31_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT31_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_COUNT2 (1U) - -/*! @name MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W - MBC Memory Block Configuration Word */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL0_MASK (0x7U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL0_SHIFT (0U) -/*! MBACSEL0 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE0_MASK (0x8U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE0_SHIFT (3U) -/*! NSE0 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL1_MASK (0x70U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL1_SHIFT (4U) -/*! MBACSEL1 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE1_MASK (0x80U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE1_SHIFT (7U) -/*! NSE1 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL2_MASK (0x700U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL2_SHIFT (8U) -/*! MBACSEL2 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE2_MASK (0x800U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE2_SHIFT (11U) -/*! NSE2 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL3_MASK (0x7000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL3_SHIFT (12U) -/*! MBACSEL3 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE3_MASK (0x8000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE3_SHIFT (15U) -/*! NSE3 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL4_MASK (0x70000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL4_SHIFT (16U) -/*! MBACSEL4 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE4_MASK (0x80000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE4_SHIFT (19U) -/*! NSE4 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL5_MASK (0x700000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL5_SHIFT (20U) -/*! MBACSEL5 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE5_MASK (0x800000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE5_SHIFT (23U) -/*! NSE5 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL6_MASK (0x7000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL6_SHIFT (24U) -/*! MBACSEL6 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE6_MASK (0x8000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE6_SHIFT (27U) -/*! NSE6 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL7_MASK (0x70000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL7_SHIFT (28U) -/*! MBACSEL7 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL7_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE7_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE7_SHIFT (31U) -/*! NSE7 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE7_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_COUNT2 (1U) - -/*! @name MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W - MBC Memory Block NonSecure Enable Word */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT0_MASK (0x1U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT0_SHIFT (0U) -/*! BIT0 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT1_MASK (0x2U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT1_SHIFT (1U) -/*! BIT1 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT2_MASK (0x4U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT2_SHIFT (2U) -/*! BIT2 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT3_MASK (0x8U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT3_SHIFT (3U) -/*! BIT3 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT4_MASK (0x10U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT4_SHIFT (4U) -/*! BIT4 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT5_MASK (0x20U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT5_SHIFT (5U) -/*! BIT5 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT6_MASK (0x40U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT6_SHIFT (6U) -/*! BIT6 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT7_MASK (0x80U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT7_SHIFT (7U) -/*! BIT7 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT7_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT8_MASK (0x100U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT8_SHIFT (8U) -/*! BIT8 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT8(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT8_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT8_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT9_MASK (0x200U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT9_SHIFT (9U) -/*! BIT9 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT9(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT9_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT9_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT10_MASK (0x400U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT10_SHIFT (10U) -/*! BIT10 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT10(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT10_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT10_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT11_MASK (0x800U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT11_SHIFT (11U) -/*! BIT11 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT11(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT11_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT11_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT12_MASK (0x1000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT12_SHIFT (12U) -/*! BIT12 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT12(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT12_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT12_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT13_MASK (0x2000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT13_SHIFT (13U) -/*! BIT13 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT13(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT13_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT13_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT14_MASK (0x4000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT14_SHIFT (14U) -/*! BIT14 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT14(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT14_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT14_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT15_MASK (0x8000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT15_SHIFT (15U) -/*! BIT15 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT15(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT15_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT15_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT16_MASK (0x10000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT16_SHIFT (16U) -/*! BIT16 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT16(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT16_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT16_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT17_MASK (0x20000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT17_SHIFT (17U) -/*! BIT17 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT17(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT17_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT17_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT18_MASK (0x40000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT18_SHIFT (18U) -/*! BIT18 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT18(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT18_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT18_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT19_MASK (0x80000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT19_SHIFT (19U) -/*! BIT19 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT19(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT19_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT19_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT20_MASK (0x100000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT20_SHIFT (20U) -/*! BIT20 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT20(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT20_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT20_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT21_MASK (0x200000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT21_SHIFT (21U) -/*! BIT21 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT21(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT21_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT21_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT22_MASK (0x400000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT22_SHIFT (22U) -/*! BIT22 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT22(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT22_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT22_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT23_MASK (0x800000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT23_SHIFT (23U) -/*! BIT23 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT23(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT23_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT23_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT24_MASK (0x1000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT24_SHIFT (24U) -/*! BIT24 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT24(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT24_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT24_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT25_MASK (0x2000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT25_SHIFT (25U) -/*! BIT25 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT25(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT25_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT25_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT26_MASK (0x4000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT26_SHIFT (26U) -/*! BIT26 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT26(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT26_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT26_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT27_MASK (0x8000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT27_SHIFT (27U) -/*! BIT27 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT27(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT27_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT27_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT28_MASK (0x10000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT28_SHIFT (28U) -/*! BIT28 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT28(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT28_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT28_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT29_MASK (0x20000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT29_SHIFT (29U) -/*! BIT29 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT29(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT29_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT29_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT30_MASK (0x40000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT30_SHIFT (30U) -/*! BIT30 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT30(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT30_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT30_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT31_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT31_SHIFT (31U) -/*! BIT31 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT31(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT31_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT31_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_COUNT2 (1U) - - -/*! - * @} - */ /* end of group TRDC_Register_Masks */ - - -/* TRDC - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral TRDC base address */ - #define TRDC_BASE (0x500C7000u) - /** Peripheral TRDC base address */ - #define TRDC_BASE_NS (0x400C7000u) - /** Peripheral TRDC base pointer */ - #define TRDC ((TRDC_Type *)TRDC_BASE) - /** Peripheral TRDC base pointer */ - #define TRDC_NS ((TRDC_Type *)TRDC_BASE_NS) - /** Array initializer of TRDC peripheral base addresses */ - #define TRDC_BASE_ADDRS { TRDC_BASE } - /** Array initializer of TRDC peripheral base pointers */ - #define TRDC_BASE_PTRS { TRDC } - /** Array initializer of TRDC peripheral base addresses */ - #define TRDC_BASE_ADDRS_NS { TRDC_BASE_NS } - /** Array initializer of TRDC peripheral base pointers */ - #define TRDC_BASE_PTRS_NS { TRDC_NS } -#else - /** Peripheral TRDC base address */ - #define TRDC_BASE (0x400C7000u) - /** Peripheral TRDC base pointer */ - #define TRDC ((TRDC_Type *)TRDC_BASE) - /** Array initializer of TRDC peripheral base addresses */ - #define TRDC_BASE_ADDRS { TRDC_BASE } - /** Array initializer of TRDC peripheral base pointers */ - #define TRDC_BASE_PTRS { TRDC } -#endif -#define MBC0_MEMORY_CFG_WORD_COUNT {1,2,4,1} -#define MBC1_MEMORY_CFG_WORD_COUNT {1,1,1,1} -#define MBC2_MEMORY_CFG_WORD_COUNT {9,6,1,1} -#define MBC3_MEMORY_CFG_WORD_COUNT {3,0,0,0} -#define MBC_MEMORY_CFG_WORD_COUNT {MBC0_MEMORY_CFG_WORD_COUNT , MBC1_MEMORY_CFG_WORD_COUNT, MBC2_MEMORY_CFG_WORD_COUNT, MBC3_MEMORY_CFG_WORD_COUNT} -#define MBC0_MEMORY_NSE_WORD_COUNT {1,1,1,1} -#define MBC1_MEMORY_NSE_WORD_COUNT {1,1,1,1} -#define MBC2_MEMORY_NSE_WORD_COUNT {3,2,1,1} -#define MBC3_MEMORY_NSE_WORD_COUNT {1,0,0,0} -#define MBC_MEMORY_NSE_WORD_COUNT {MBC0_MEMORY_NSE_WORD_COUNT , MBC1_MEMORY_NSE_WORD_COUNT, MBC2_MEMORY_NSE_WORD_COUNT, MBC3_MEMORY_NSE_WORD_COUNT} - - -/*! - * @} - */ /* end of group TRDC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- TSI Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup TSI_Peripheral_Access_Layer TSI Peripheral Access Layer - * @{ - */ - -/** TSI - Register Layout Typedef */ -typedef struct { - union { /* offset: 0x0 */ - __IO uint32_t CONFIG_MUTUAL; /**< TSI CONFIG (TSI_CONFIG) for Mutual-Capacitor, offset: 0x0 */ - __IO uint32_t CONFIG; /**< TSI CONFIG (TSI_CONFIG) for Self-Capacitor, offset: 0x0 */ - }; - __IO uint32_t TSHD; /**< TSI Threshold, offset: 0x4 */ - __IO uint32_t GENCS; /**< TSI General Control and Status, offset: 0x8 */ - __IO uint32_t MUL; /**< TSI Mutual-Capacitance, offset: 0xC */ - __IO uint32_t SINC; /**< TSI SINC Filter, offset: 0x10 */ - __IO uint32_t SSC0; /**< TSI SSC 0, offset: 0x14 */ - __IO uint32_t SSC1; /**< TSI SSC 1, offset: 0x18 */ - __IO uint32_t SSC2; /**< TSI SSC 2, offset: 0x1C */ - __IO uint32_t BASELINE; /**< TSI Baseline, offset: 0x20 */ - __IO uint32_t CHMERGE; /**< TSI Channel Merge, offset: 0x24 */ - __IO uint32_t SHIELD; /**< TSI Shield, offset: 0x28 */ - uint8_t RESERVED_0[212]; - __IO uint32_t DATA; /**< TSI Data and Status, offset: 0x100 */ - uint8_t RESERVED_1[4]; - __IO uint32_t MISC; /**< TSI Miscellaneous, offset: 0x108 */ - __IO uint32_t TRIG; /**< TSI AUTO TRIG, offset: 0x10C */ -} TSI_Type; - -/* ---------------------------------------------------------------------------- - -- TSI Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup TSI_Register_Masks TSI Register Masks - * @{ - */ - -/*! @name CONFIG_MUTUAL - TSI CONFIG (TSI_CONFIG) for Mutual-Capacitor */ -/*! @{ */ - -#define TSI_CONFIG_MUTUAL_MODE_MASK (0x1U) -#define TSI_CONFIG_MUTUAL_MODE_SHIFT (0U) -/*! MODE - Mode - * 0b0..Self capacitance - * 0b1..Mutual capacitance - */ -#define TSI_CONFIG_MUTUAL_MODE(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_MUTUAL_MODE_SHIFT)) & TSI_CONFIG_MUTUAL_MODE_MASK) - -#define TSI_CONFIG_MUTUAL_M_NMIRROR_MASK (0x6U) -#define TSI_CONFIG_MUTUAL_M_NMIRROR_SHIFT (1U) -/*! M_NMIRROR - NMOS Current Mirror - * 0b00..m = 1 - * 0b01..m = 2 - * 0b10..m = 3 - * 0b11..m = 4 - */ -#define TSI_CONFIG_MUTUAL_M_NMIRROR(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_MUTUAL_M_NMIRROR_SHIFT)) & TSI_CONFIG_MUTUAL_M_NMIRROR_MASK) - -#define TSI_CONFIG_MUTUAL_M_PMIRRORR_MASK (0x18U) -#define TSI_CONFIG_MUTUAL_M_PMIRRORR_SHIFT (3U) -/*! M_PMIRRORR - PMOS Current Mirror on Right Side - * 0b00..m = 1 - * 0b01..m = 2 - * 0b10..m = 3 - * 0b11..m = 4 - */ -#define TSI_CONFIG_MUTUAL_M_PMIRRORR(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_MUTUAL_M_PMIRRORR_SHIFT)) & TSI_CONFIG_MUTUAL_M_PMIRRORR_MASK) - -#define TSI_CONFIG_MUTUAL_M_PMIRRORL_MASK (0xE0U) -#define TSI_CONFIG_MUTUAL_M_PMIRRORL_SHIFT (5U) -/*! M_PMIRRORL - PMOS Current Mirror on Left Side - * 0b000..m = 4 - * 0b001..m = 8 - * 0b010..m = 12 - * 0b011..m = 16 - * 0b100..m = 20 - * 0b101..m = 24 - * 0b110..m = 28 - * 0b111..m = 32 - */ -#define TSI_CONFIG_MUTUAL_M_PMIRRORL(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_MUTUAL_M_PMIRRORL_SHIFT)) & TSI_CONFIG_MUTUAL_M_PMIRRORL_MASK) - -#define TSI_CONFIG_MUTUAL_M_SEL_RX_MASK (0x1F00U) -#define TSI_CONFIG_MUTUAL_M_SEL_RX_SHIFT (8U) -/*! M_SEL_RX - Mutual-Capacitance RX Channel Selection - * 0b00000..TSI[8] - * 0b00001..TSI[9] - * 0b00010..TSI[10] - * 0b00011..TSI[11] - * 0b00100..TSI[12] - * 0b00101..TSI[13] - * 0b00110..TSI[14] - * 0b00111..TSI[15] - * 0b01000..TSI[16] - * 0b01001..TSI[17] - * 0b01010..TSI[18] - * 0b01011..TSI[19] - * 0b01100..TSI[20] - * 0b01101..TSI[21] - * 0b01110..TSI[22] - * 0b01111..TSI[23] - * 0b10000..TSI[24] - */ -#define TSI_CONFIG_MUTUAL_M_SEL_RX(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_MUTUAL_M_SEL_RX_SHIFT)) & TSI_CONFIG_MUTUAL_M_SEL_RX_MASK) - -#define TSI_CONFIG_MUTUAL_M_SEL_TX_MASK (0xE000U) -#define TSI_CONFIG_MUTUAL_M_SEL_TX_SHIFT (13U) -/*! M_SEL_TX - Mutual-Capacitance TX Channel Selection - * 0b000..TSI[0] - * 0b001..TSI[1] - * 0b010..TSI[2] - * 0b011..TSI[3] - * 0b100..TSI[4] - * 0b101..TSI[5] - * 0b110..TSI[6] - * 0b111..TSI[7] - */ -#define TSI_CONFIG_MUTUAL_M_SEL_TX(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_MUTUAL_M_SEL_TX_SHIFT)) & TSI_CONFIG_MUTUAL_M_SEL_TX_MASK) - -#define TSI_CONFIG_MUTUAL_M_CNT_EN_MASK (0x10000U) -#define TSI_CONFIG_MUTUAL_M_CNT_EN_SHIFT (16U) -/*! M_CNT_EN - Mutual-Capacitance Counter Enable - * 0b0..Disables - * 0b1..Enables - */ -#define TSI_CONFIG_MUTUAL_M_CNT_EN(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_MUTUAL_M_CNT_EN_SHIFT)) & TSI_CONFIG_MUTUAL_M_CNT_EN_MASK) - -#define TSI_CONFIG_MUTUAL_M_TX_PD_EN_MASK (0x20000U) -#define TSI_CONFIG_MUTUAL_M_TX_PD_EN_SHIFT (17U) -/*! M_TX_PD_EN - Mutual-Capacitance TX Pulldown Enable - * 0b0..Disables - * 0b1..Enables - */ -#define TSI_CONFIG_MUTUAL_M_TX_PD_EN(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_MUTUAL_M_TX_PD_EN_SHIFT)) & TSI_CONFIG_MUTUAL_M_TX_PD_EN_MASK) - -#define TSI_CONFIG_MUTUAL_M_SEN_BOOST_MASK (0x7C0000U) -#define TSI_CONFIG_MUTUAL_M_SEN_BOOST_SHIFT (18U) -/*! M_SEN_BOOST - Mutual-Capacitance Sensitivity Boost - * 0b00000..0 uA - * 0b00001..2 uA - * 0b00010..4 uA - * 0b00011..6 uA - * 0b00100..8 uA - * 0b00101..10 uA - * 0b00110..12 uA - * 0b00111..14 uA - * 0b1xxxx..2 * n uA - * 0b11111..62 uA - */ -#define TSI_CONFIG_MUTUAL_M_SEN_BOOST(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_MUTUAL_M_SEN_BOOST_SHIFT)) & TSI_CONFIG_MUTUAL_M_SEN_BOOST_MASK) - -#define TSI_CONFIG_MUTUAL_M_PRE_RES_MASK (0x1C000000U) -#define TSI_CONFIG_MUTUAL_M_PRE_RES_SHIFT (26U) -/*! M_PRE_RES - Mutual-Capacitance Precharge Resistor - * 0b000..1 kΩ - * 0b001..2 kΩ - * 0b010..3 kΩ - * 0b011..4 kΩ - * 0b100..5 kΩ - * 0b101..6 kΩ - * 0b110..7 kΩ - * 0b111..8 kΩ - */ -#define TSI_CONFIG_MUTUAL_M_PRE_RES(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_MUTUAL_M_PRE_RES_SHIFT)) & TSI_CONFIG_MUTUAL_M_PRE_RES_MASK) - -#define TSI_CONFIG_MUTUAL_M_PRE_CURRENT_MASK (0xE0000000U) -#define TSI_CONFIG_MUTUAL_M_PRE_CURRENT_SHIFT (29U) -/*! M_PRE_CURRENT - Mutual-Capacitance Precharge Current - * 0b000..1 uA - * 0b001..2 uA - * 0b010..3 uA - * 0b011..4 uA - * 0b100..5 uA - * 0b101..6 uA - * 0b110..7 uA - * 0b111..8 uA - */ -#define TSI_CONFIG_MUTUAL_M_PRE_CURRENT(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_MUTUAL_M_PRE_CURRENT_SHIFT)) & TSI_CONFIG_MUTUAL_M_PRE_CURRENT_MASK) -/*! @} */ - -/*! @name CONFIG - TSI CONFIG (TSI_CONFIG) for Self-Capacitor */ -/*! @{ */ - -#define TSI_CONFIG_MODE_MASK (0x1U) -#define TSI_CONFIG_MODE_SHIFT (0U) -/*! MODE - Mode - * 0b0..Self capacitance - * 0b1..Mutual capacitance - */ -#define TSI_CONFIG_MODE(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_MODE_SHIFT)) & TSI_CONFIG_MODE_MASK) - -#define TSI_CONFIG_TSICH_MASK (0x3EU) -#define TSI_CONFIG_TSICH_SHIFT (1U) -/*! TSICH - TSI Channel - * 0b00000..Channel 0 - * 0b00001..Channel 1 - * 0b00010..Channel 2 - * 0b00011..Channel 3 - * 0b00100..Channel 4 - * 0b00101..Channel 5 - * 0b00110..Channel 6 - * 0b00111..Channel 7 - * 0b01000..Channel 8 - * 0b01001..Channel 9 - * 0b01010..Channel 10 - * 0b01011..Channel 11 - * 0b01100..Channel 12 - * 0b01101..Channel 13 - * 0b01110..Channel 14 - * 0b01111..Channel 15 - * 0b10000..Channel 16 - * 0b10001..Channel 17 - * 0b10010..Channel 18 - * 0b10011..Channel 19 - * 0b10100..Channel 20 - * 0b10101..Channel 21 - * 0b10110..Channel 22 - * 0b10111..Channel 23 - * 0b11000..Channel 24 - */ -#define TSI_CONFIG_TSICH(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_TSICH_SHIFT)) & TSI_CONFIG_TSICH_MASK) - -#define TSI_CONFIG_S_NOISE_MASK (0x80000U) -#define TSI_CONFIG_S_NOISE_SHIFT (19U) -/*! S_NOISE - Self-Capacitance Noise Cancelation - * 0b0..Disables - * 0b1..Enables - */ -#define TSI_CONFIG_S_NOISE(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_S_NOISE_SHIFT)) & TSI_CONFIG_S_NOISE_MASK) - -#define TSI_CONFIG_S_XCH_MASK (0x700000U) -#define TSI_CONFIG_S_XCH_SHIFT (20U) -/*! S_XCH - Self-Capacitance Charge Current Multiple - * 0b000..1 / 16 - * 0b001..1 / 8 - * 0b010..1 / 4 - * 0b011..1 / 2 - */ -#define TSI_CONFIG_S_XCH(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_S_XCH_SHIFT)) & TSI_CONFIG_S_XCH_MASK) - -#define TSI_CONFIG_S_XIN_MASK (0x800000U) -#define TSI_CONFIG_S_XIN_SHIFT (23U) -/*! S_XIN - Self-Capacitance Input Current Multiple - * 0b0..1 / 8 - * 0b1..1 / 4 - */ -#define TSI_CONFIG_S_XIN(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_S_XIN_SHIFT)) & TSI_CONFIG_S_XIN_MASK) - -#define TSI_CONFIG_S_CTRIM_MASK (0x7000000U) -#define TSI_CONFIG_S_CTRIM_SHIFT (24U) -/*! S_CTRIM - Capacitor Trim Setting - * 0b000..2.5 pF - * 0b001..5.0 pF - * 0b010..7.5 pF - * 0b011..10 pF - * 0b100..12.5 pF - * 0b101..15.0 pF - * 0b110..17.5 pF - * 0b111..20 pF - */ -#define TSI_CONFIG_S_CTRIM(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_S_CTRIM_SHIFT)) & TSI_CONFIG_S_CTRIM_MASK) - -#define TSI_CONFIG_S_SEN_MASK (0x8000000U) -#define TSI_CONFIG_S_SEN_SHIFT (27U) -/*! S_SEN - Self-Capacitance Sensitivity Boost - * 0b0..Disables - * 0b1..Enables - */ -#define TSI_CONFIG_S_SEN(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_S_SEN_SHIFT)) & TSI_CONFIG_S_SEN_MASK) - -#define TSI_CONFIG_S_XDN_MASK (0x70000000U) -#define TSI_CONFIG_S_XDN_SHIFT (28U) -/*! S_XDN - Self-Capacitance Discharge Current Multiple - * 0b000..1 / 16 - * 0b001..1 / 8 - * 0b010..1 / 4 - * 0b011..1 / 2 - */ -#define TSI_CONFIG_S_XDN(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_S_XDN_SHIFT)) & TSI_CONFIG_S_XDN_MASK) - -#define TSI_CONFIG_S_XIN_ADD_MASK (0x80000000U) -#define TSI_CONFIG_S_XIN_ADD_SHIFT (31U) -/*! S_XIN_ADD - S_XIN Adjust Ratio - * 0b0..Disables; S_XIN = 0 for 1 / 4, S_XIN = 1 for 1 / 8 - * 0b1..Enables; S_XIN = 0 for 1 / 8, S_XIN = 1 for 1 / 16 - */ -#define TSI_CONFIG_S_XIN_ADD(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_S_XIN_ADD_SHIFT)) & TSI_CONFIG_S_XIN_ADD_MASK) -/*! @} */ - -/*! @name TSHD - TSI Threshold */ -/*! @{ */ - -#define TSI_TSHD_THRESL_MASK (0xFFFFU) -#define TSI_TSHD_THRESL_SHIFT (0U) -/*! THRESL - TSI Wakeup Channel Low Threshold */ -#define TSI_TSHD_THRESL(x) (((uint32_t)(((uint32_t)(x)) << TSI_TSHD_THRESL_SHIFT)) & TSI_TSHD_THRESL_MASK) - -#define TSI_TSHD_THRESH_MASK (0xFFFF0000U) -#define TSI_TSHD_THRESH_SHIFT (16U) -/*! THRESH - TSI Wakeup Channel High Threshold */ -#define TSI_TSHD_THRESH(x) (((uint32_t)(((uint32_t)(x)) << TSI_TSHD_THRESH_SHIFT)) & TSI_TSHD_THRESH_MASK) -/*! @} */ - -/*! @name GENCS - TSI General Control and Status */ -/*! @{ */ - -#define TSI_GENCS_DMAEN_EOS_MASK (0x1U) -#define TSI_GENCS_DMAEN_EOS_SHIFT (0U) -/*! DMAEN_EOS - In-Progress DMA Transfer Request Enable - * 0b0..Disables - * 0b1..Enables - */ -#define TSI_GENCS_DMAEN_EOS(x) (((uint32_t)(((uint32_t)(x)) << TSI_GENCS_DMAEN_EOS_SHIFT)) & TSI_GENCS_DMAEN_EOS_MASK) - -#define TSI_GENCS_DMAEN_OUTRG_MASK (0x4U) -#define TSI_GENCS_DMAEN_OUTRG_SHIFT (2U) -/*! DMAEN_OUTRG - Out-of-Range DMA Transfer Request Enable - * 0b0..Disables - * 0b1..Enables - */ -#define TSI_GENCS_DMAEN_OUTRG(x) (((uint32_t)(((uint32_t)(x)) << TSI_GENCS_DMAEN_OUTRG_SHIFT)) & TSI_GENCS_DMAEN_OUTRG_MASK) - -#define TSI_GENCS_STM_MASK (0x8U) -#define TSI_GENCS_STM_SHIFT (3U) -/*! STM - Scan Trigger Mode - * 0b0..Software trigger scan - * 0b1..Hardware trigger scan - */ -#define TSI_GENCS_STM(x) (((uint32_t)(((uint32_t)(x)) << TSI_GENCS_STM_SHIFT)) & TSI_GENCS_STM_MASK) - -#define TSI_GENCS_STPE_MASK (0x10U) -#define TSI_GENCS_STPE_SHIFT (4U) -/*! STPE - TSI Stop Enable - * 0b0..Disables - * 0b1..Enables - */ -#define TSI_GENCS_STPE(x) (((uint32_t)(((uint32_t)(x)) << TSI_GENCS_STPE_SHIFT)) & TSI_GENCS_STPE_MASK) - -#define TSI_GENCS_TSIEN_MASK (0x20U) -#define TSI_GENCS_TSIEN_SHIFT (5U) -/*! TSIEN - TSI Enable - * 0b0..Disables - * 0b1..Enables - */ -#define TSI_GENCS_TSIEN(x) (((uint32_t)(((uint32_t)(x)) << TSI_GENCS_TSIEN_SHIFT)) & TSI_GENCS_TSIEN_MASK) - -#define TSI_GENCS_SWTS_MASK (0x80U) -#define TSI_GENCS_SWTS_SHIFT (7U) -/*! SWTS - Software Trigger Start - * 0b0..No effect - * 0b1..Takes effect - */ -#define TSI_GENCS_SWTS(x) (((uint32_t)(((uint32_t)(x)) << TSI_GENCS_SWTS_SHIFT)) & TSI_GENCS_SWTS_MASK) - -#define TSI_GENCS_CTRIM_FINE_MASK (0xE00U) -#define TSI_GENCS_CTRIM_FINE_SHIFT (9U) -/*! CTRIM_FINE - Capacitor Fine Trim - * 0b000..0.3125 pF - * 0b001..0.625 pF - * 0b010..0.3125 * 3 pF - * 0b011..0.3125 * 4 pF - * 0b100..0.3125 * 5 pF - * 0b101..0.3125 * 6 pF - * 0b110..2.1875 pF - * 0b111..2.5 pF - */ -#define TSI_GENCS_CTRIM_FINE(x) (((uint32_t)(((uint32_t)(x)) << TSI_GENCS_CTRIM_FINE_SHIFT)) & TSI_GENCS_CTRIM_FINE_MASK) - -#define TSI_GENCS_DVOLT_MASK (0x7000U) -#define TSI_GENCS_DVOLT_SHIFT (12U) -/*! DVOLT - Delta Voltage - * 0b000..Vm = 0.6 V, Vp = 1.7 V - * 0b001..Vm = 0.6 V, Vp = 1.9 V - * 0b010..Vm = 0.6 V, Vp = 2.1 V - * 0b011..Vm = 0.6 V, Vp = 2.3 V - * 0b100..Vm = 0.6 V, Vp = 2.5 V - * 0b101..Vm = 0.6 V, Vp = 2.7 V - */ -#define TSI_GENCS_DVOLT(x) (((uint32_t)(((uint32_t)(x)) << TSI_GENCS_DVOLT_SHIFT)) & TSI_GENCS_DVOLT_MASK) - -#define TSI_GENCS_DEBOUNCE_MASK (0x1F0000U) -#define TSI_GENCS_DEBOUNCE_SHIFT (16U) -/*! DEBOUNCE - Debounce - * 0b00000..1 - * 0b00001..2 - * 0b1xxxx..n - * 0b11111..31 - */ -#define TSI_GENCS_DEBOUNCE(x) (((uint32_t)(((uint32_t)(x)) << TSI_GENCS_DEBOUNCE_SHIFT)) & TSI_GENCS_DEBOUNCE_MASK) - -#define TSI_GENCS_S_PROX_EN_MASK (0x400000U) -#define TSI_GENCS_S_PROX_EN_SHIFT (22U) -/*! S_PROX_EN - Proximity Enable Signal - * 0b0..Disables - * 0b1..Enables - */ -#define TSI_GENCS_S_PROX_EN(x) (((uint32_t)(((uint32_t)(x)) << TSI_GENCS_S_PROX_EN_SHIFT)) & TSI_GENCS_S_PROX_EN_MASK) - -#define TSI_GENCS_SETCLK_MASK (0x7000000U) -#define TSI_GENCS_SETCLK_SHIFT (24U) -/*! SETCLK - Set Clock - * 0b000..27.37 MHz - * 0b001..22.23 MHz - * 0b010..18.73 MHz - * 0b011..16.65 MHz - * 0b100..14.27 MHz - * 0b101..12.73 MHz - * 0b110..11.49 MHz - * 0b111..10.46 MHz - */ -#define TSI_GENCS_SETCLK(x) (((uint32_t)(((uint32_t)(x)) << TSI_GENCS_SETCLK_SHIFT)) & TSI_GENCS_SETCLK_MASK) - -#define TSI_GENCS_ESOR_MASK (0x8000000U) -#define TSI_GENCS_ESOR_SHIFT (27U) -/*! ESOR - End-of-Scan Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define TSI_GENCS_ESOR(x) (((uint32_t)(((uint32_t)(x)) << TSI_GENCS_ESOR_SHIFT)) & TSI_GENCS_ESOR_MASK) - -#define TSI_GENCS_OUTRG_EN_MASK (0x40000000U) -#define TSI_GENCS_OUTRG_EN_SHIFT (30U) -/*! OUTRG_EN - Out-of-Range Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define TSI_GENCS_OUTRG_EN(x) (((uint32_t)(((uint32_t)(x)) << TSI_GENCS_OUTRG_EN_SHIFT)) & TSI_GENCS_OUTRG_EN_MASK) -/*! @} */ - -/*! @name MUL - TSI Mutual-Capacitance */ -/*! @{ */ - -#define TSI_MUL_M_VPRE_CHOOSE_MASK (0x2U) -#define TSI_MUL_M_VPRE_CHOOSE_SHIFT (1U) -/*! M_VPRE_CHOOSE - Mutual-Capacitance Prevoltage - * 0b0..Internal 1.2 V - * 0b1..External 1.2 V from PMC - */ -#define TSI_MUL_M_VPRE_CHOOSE(x) (((uint32_t)(((uint32_t)(x)) << TSI_MUL_M_VPRE_CHOOSE_SHIFT)) & TSI_MUL_M_VPRE_CHOOSE_MASK) - -#define TSI_MUL_M_MODE_MASK (0x4U) -#define TSI_MUL_M_MODE_SHIFT (2U) -/*! M_MODE - Mutual-Capacitance Mode - * 0b0..- 5 V ~ + 5 V - * 0b1..0 V ~ + 5 V - */ -#define TSI_MUL_M_MODE(x) (((uint32_t)(((uint32_t)(x)) << TSI_MUL_M_MODE_SHIFT)) & TSI_MUL_M_MODE_MASK) - -#define TSI_MUL_M_TRIM_CAP_MASK (0x18U) -#define TSI_MUL_M_TRIM_CAP_SHIFT (3U) -/*! M_TRIM_CAP - Mutual-Capacitance Trim Cap - * 0b00..0 pF - * 0b01..10 pF - * 0b10..10 pF - * 0b11..20 pF - */ -#define TSI_MUL_M_TRIM_CAP(x) (((uint32_t)(((uint32_t)(x)) << TSI_MUL_M_TRIM_CAP_SHIFT)) & TSI_MUL_M_TRIM_CAP_MASK) - -#define TSI_MUL_M_TX_USED_MASK (0x1FE0U) -#define TSI_MUL_M_TX_USED_SHIFT (5U) -/*! M_TX_USED - Mutual-Capacitance TX Used - * 0b00000000..GPIO - * 0b00000001..Mutual capacitance - */ -#define TSI_MUL_M_TX_USED(x) (((uint32_t)(((uint32_t)(x)) << TSI_MUL_M_TX_USED_SHIFT)) & TSI_MUL_M_TX_USED_MASK) - -#define TSI_MUL_M_TRIM_MASK (0xFFFF0000U) -#define TSI_MUL_M_TRIM_SHIFT (16U) -/*! M_TRIM - Mutual-Capacitance Trim */ -#define TSI_MUL_M_TRIM(x) (((uint32_t)(((uint32_t)(x)) << TSI_MUL_M_TRIM_SHIFT)) & TSI_MUL_M_TRIM_MASK) -/*! @} */ - -/*! @name SINC - TSI SINC Filter */ -/*! @{ */ - -#define TSI_SINC_SSC_CONTROL_OUT_MASK (0x1U) -#define TSI_SINC_SSC_CONTROL_OUT_SHIFT (0U) -/*! SSC_CONTROL_OUT - SSC Output Control - * 0b0..0 - * 0b1..1 - */ -#define TSI_SINC_SSC_CONTROL_OUT(x) (((uint32_t)(((uint32_t)(x)) << TSI_SINC_SSC_CONTROL_OUT_SHIFT)) & TSI_SINC_SSC_CONTROL_OUT_MASK) - -#define TSI_SINC_SINC_VALID_MASK (0x2U) -#define TSI_SINC_SINC_VALID_SHIFT (1U) -/*! SINC_VALID - SINC Valid - * 0b0..Disabled - * 0b1..Enabled - */ -#define TSI_SINC_SINC_VALID(x) (((uint32_t)(((uint32_t)(x)) << TSI_SINC_SINC_VALID_SHIFT)) & TSI_SINC_SINC_VALID_MASK) - -#define TSI_SINC_SINC_OVERFLOW_FLAG_MASK (0x4U) -#define TSI_SINC_SINC_OVERFLOW_FLAG_SHIFT (2U) -/*! SINC_OVERFLOW_FLAG - SINC Overflow Flag - * 0b0..No overflow - * 0b1..Overflow - */ -#define TSI_SINC_SINC_OVERFLOW_FLAG(x) (((uint32_t)(((uint32_t)(x)) << TSI_SINC_SINC_OVERFLOW_FLAG_SHIFT)) & TSI_SINC_SINC_OVERFLOW_FLAG_MASK) - -#define TSI_SINC_SWITCH_ENABLE_MASK (0x8U) -#define TSI_SINC_SWITCH_ENABLE_SHIFT (3U) -/*! SWITCH_ENABLE - Switch Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define TSI_SINC_SWITCH_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << TSI_SINC_SWITCH_ENABLE_SHIFT)) & TSI_SINC_SWITCH_ENABLE_MASK) - -#define TSI_SINC_DECIMATION_MASK (0x1F0000U) -#define TSI_SINC_DECIMATION_SHIFT (16U) -/*! DECIMATION - Decimation - * 0b00000..1 - * 0b00001..2 - * 0b00010..3 - * 0b00011..4 - * 0b00100..5 - * 0b00101..6 - * 0b00110..7 - * 0b00111..8 - * 0b01000..9 - * 0b01001..10 - * 0b01010..11 - * 0b01011..12 - * 0b01100..13 - * 0b01101..14 - * 0b01110..15 - * 0b01111..16 - * 0b10000..17 - * 0b10001..18 - * 0b10010..19 - * 0b10011..20 - * 0b10100..21 - * 0b10101..22 - * 0b10110..23 - * 0b10111..24 - * 0b11000..25 - * 0b11001..26 - * 0b11010..27 - * 0b11011..28 - * 0b11100..29 - * 0b11101..30 - * 0b11110..31 - * 0b11111..32 - */ -#define TSI_SINC_DECIMATION(x) (((uint32_t)(((uint32_t)(x)) << TSI_SINC_DECIMATION_SHIFT)) & TSI_SINC_DECIMATION_MASK) - -#define TSI_SINC_ORDER_MASK (0x200000U) -#define TSI_SINC_ORDER_SHIFT (21U) -/*! ORDER - Order - * 0b0..Order 1 - * 0b1..Order 2 - */ -#define TSI_SINC_ORDER(x) (((uint32_t)(((uint32_t)(x)) << TSI_SINC_ORDER_SHIFT)) & TSI_SINC_ORDER_MASK) - -#define TSI_SINC_CUTOFF_MASK (0xF000000U) -#define TSI_SINC_CUTOFF_SHIFT (24U) -/*! CUTOFF - Cutoff - * 0b0000..div = 1 - * 0b0001..div = 2 - * 0b0010..div = 4 - * 0b0011..div = 8 - * 0b0100..div = 16 - * 0b0101..div = 32 - * 0b0110..div = 64 - * 0b0111..div = 128 - * 0b1000..Do not use - * 0b1001..Do not use - * 0b1010..Do not use - * 0b1011..Do not use - * 0b1100..Do not use - * 0b1101..Do not use - * 0b1110..Do not use - * 0b1111..Do not use - */ -#define TSI_SINC_CUTOFF(x) (((uint32_t)(((uint32_t)(x)) << TSI_SINC_CUTOFF_SHIFT)) & TSI_SINC_CUTOFF_MASK) -/*! @} */ - -/*! @name SSC0 - TSI SSC 0 */ -/*! @{ */ - -#define TSI_SSC0_SSC_PRESCALE_NUM_MASK (0xFFU) -#define TSI_SSC0_SSC_PRESCALE_NUM_SHIFT (0U) -/*! SSC_PRESCALE_NUM - SSC Prescale Number - * 0b00000000..div = 1 - * 0b00000001..div = 2 - * 0b00000011..div = 4 - * 0b00000111..div = 8 - * 0b00001111..div = 16 - * 0b00011111..div = 32 - * 0b00111111..div = 64 - * 0b01111111..div = 128 - * 0b11111111..div = 256 - */ -#define TSI_SSC0_SSC_PRESCALE_NUM(x) (((uint32_t)(((uint32_t)(x)) << TSI_SSC0_SSC_PRESCALE_NUM_SHIFT)) & TSI_SSC0_SSC_PRESCALE_NUM_MASK) - -#define TSI_SSC0_BASE_NOCHARGE_NUM_MASK (0xF0000U) -#define TSI_SSC0_BASE_NOCHARGE_NUM_SHIFT (16U) -/*! BASE_NOCHARGE_NUM - Base Nocharge Number - * 0b0000..1 - * 0b0001..2 - * 0b0010..3 - * 0b0011..4 - * 0b0100..5 - * 0b0101..6 - * 0b0110..7 - * 0b0111..8 - * 0b1000..9 - * 0b1001..10 - * 0b1010..11 - * 0b1011..12 - * 0b1100..13 - * 0b1101..14 - * 0b1110..15 - * 0b1111..16 - */ -#define TSI_SSC0_BASE_NOCHARGE_NUM(x) (((uint32_t)(((uint32_t)(x)) << TSI_SSC0_BASE_NOCHARGE_NUM_SHIFT)) & TSI_SSC0_BASE_NOCHARGE_NUM_MASK) - -#define TSI_SSC0_CHARGE_NUM_MASK (0xF00000U) -#define TSI_SSC0_CHARGE_NUM_SHIFT (20U) -/*! CHARGE_NUM - Charge Number - * 0b0000..1 - * 0b0001..2 - * 0b0010..3 - * 0b0011..4 - * 0b0100..5 - * 0b0101..6 - * 0b0110..7 - * 0b0111..8 - * 0b1000..9 - * 0b1001..10 - * 0b1010..11 - * 0b1011..12 - * 0b1100..13 - * 0b1101..14 - * 0b1110..15 - * 0b1111..16 - */ -#define TSI_SSC0_CHARGE_NUM(x) (((uint32_t)(((uint32_t)(x)) << TSI_SSC0_CHARGE_NUM_SHIFT)) & TSI_SSC0_CHARGE_NUM_MASK) - -#define TSI_SSC0_SSC_CONTROL_REVERSE_MASK (0x1000000U) -#define TSI_SSC0_SSC_CONTROL_REVERSE_SHIFT (24U) -/*! SSC_CONTROL_REVERSE - SSC Control Reverse - * 0b0..Polarity retained - * 0b1..Polarity reversed - */ -#define TSI_SSC0_SSC_CONTROL_REVERSE(x) (((uint32_t)(((uint32_t)(x)) << TSI_SSC0_SSC_CONTROL_REVERSE_SHIFT)) & TSI_SSC0_SSC_CONTROL_REVERSE_MASK) - -#define TSI_SSC0_SSC_MODE_MASK (0x6000000U) -#define TSI_SSC0_SSC_MODE_SHIFT (25U) -/*! SSC_MODE - SSC Mode - * 0b00..PRBS mode - * 0b01..Up-Down Counter mode - * 0b10..Disables SSC function - * 0b11..Do not use - */ -#define TSI_SSC0_SSC_MODE(x) (((uint32_t)(((uint32_t)(x)) << TSI_SSC0_SSC_MODE_SHIFT)) & TSI_SSC0_SSC_MODE_MASK) - -#define TSI_SSC0_PRBS_OUTSEL_MASK (0xF0000000U) -#define TSI_SSC0_PRBS_OUTSEL_SHIFT (28U) -/*! PRBS_OUTSEL - PRBS Output Selection - * 0b0000..Do not use - * 0b0001..Do not use - * 0b0010..2 - * 0b0011..3 - * 0b0100..4 - * 0b0101..5 - * 0b0110..6 - * 0b0111..7 - * 0b1000..8 - * 0b1001..9 - * 0b1010..10 - * 0b1011..11 - * 0b1100..12 - * 0b1101..13 - * 0b1110..14 - * 0b1111..15 - */ -#define TSI_SSC0_PRBS_OUTSEL(x) (((uint32_t)(((uint32_t)(x)) << TSI_SSC0_PRBS_OUTSEL_SHIFT)) & TSI_SSC0_PRBS_OUTSEL_MASK) -/*! @} */ - -/*! @name SSC1 - TSI SSC 1 */ -/*! @{ */ - -#define TSI_SSC1_PRBS_SEED_LO_MASK (0xFFU) -#define TSI_SSC1_PRBS_SEED_LO_SHIFT (0U) -/*! PRBS_SEED_LO - PRBS Low Seed */ -#define TSI_SSC1_PRBS_SEED_LO(x) (((uint32_t)(((uint32_t)(x)) << TSI_SSC1_PRBS_SEED_LO_SHIFT)) & TSI_SSC1_PRBS_SEED_LO_MASK) - -#define TSI_SSC1_PRBS_SEED_HI_MASK (0xFF00U) -#define TSI_SSC1_PRBS_SEED_HI_SHIFT (8U) -/*! PRBS_SEED_HI - PRBS High Seed */ -#define TSI_SSC1_PRBS_SEED_HI(x) (((uint32_t)(((uint32_t)(x)) << TSI_SSC1_PRBS_SEED_HI_SHIFT)) & TSI_SSC1_PRBS_SEED_HI_MASK) - -#define TSI_SSC1_PRBS_WEIGHT_LO_MASK (0xFF0000U) -#define TSI_SSC1_PRBS_WEIGHT_LO_SHIFT (16U) -/*! PRBS_WEIGHT_LO - PRBS Low Weight */ -#define TSI_SSC1_PRBS_WEIGHT_LO(x) (((uint32_t)(((uint32_t)(x)) << TSI_SSC1_PRBS_WEIGHT_LO_SHIFT)) & TSI_SSC1_PRBS_WEIGHT_LO_MASK) - -#define TSI_SSC1_PRBS_WEIGHT_HI_MASK (0xFF000000U) -#define TSI_SSC1_PRBS_WEIGHT_HI_SHIFT (24U) -/*! PRBS_WEIGHT_HI - PRBS High Weight */ -#define TSI_SSC1_PRBS_WEIGHT_HI(x) (((uint32_t)(((uint32_t)(x)) << TSI_SSC1_PRBS_WEIGHT_HI_SHIFT)) & TSI_SSC1_PRBS_WEIGHT_HI_MASK) -/*! @} */ - -/*! @name SSC2 - TSI SSC 2 */ -/*! @{ */ - -#define TSI_SSC2_MOVE_REPEAT_NUM_MASK (0x1FU) -#define TSI_SSC2_MOVE_REPEAT_NUM_SHIFT (0U) -/*! MOVE_REPEAT_NUM - Move Repeat Number - * 0b00000..1 - * 0b00001..2 - * 0b00010..3 - * 0b00011..4 - * 0b00100..5 - * 0b00101..6 - * 0b00110..7 - */ -#define TSI_SSC2_MOVE_REPEAT_NUM(x) (((uint32_t)(((uint32_t)(x)) << TSI_SSC2_MOVE_REPEAT_NUM_SHIFT)) & TSI_SSC2_MOVE_REPEAT_NUM_MASK) - -#define TSI_SSC2_MOVE_STEPS_NUM_MASK (0x700U) -#define TSI_SSC2_MOVE_STEPS_NUM_SHIFT (8U) -/*! MOVE_STEPS_NUM - Move Steps Number - * 0b000..0 - * 0b001..1 - * 0b010..2 - * 0b011..3 - * 0b100..4 - * 0b101..5 - * 0b110..6 - * 0b111..7 - */ -#define TSI_SSC2_MOVE_STEPS_NUM(x) (((uint32_t)(((uint32_t)(x)) << TSI_SSC2_MOVE_STEPS_NUM_SHIFT)) & TSI_SSC2_MOVE_STEPS_NUM_MASK) - -#define TSI_SSC2_MOVE_NOCHARGE_MAX_MASK (0x3F0000U) -#define TSI_SSC2_MOVE_NOCHARGE_MAX_SHIFT (16U) -/*! MOVE_NOCHARGE_MAX - Move Nocharge Maximum */ -#define TSI_SSC2_MOVE_NOCHARGE_MAX(x) (((uint32_t)(((uint32_t)(x)) << TSI_SSC2_MOVE_NOCHARGE_MAX_SHIFT)) & TSI_SSC2_MOVE_NOCHARGE_MAX_MASK) - -#define TSI_SSC2_MOVE_NOCHARGE_MIN_MASK (0xF0000000U) -#define TSI_SSC2_MOVE_NOCHARGE_MIN_SHIFT (28U) -/*! MOVE_NOCHARGE_MIN - Move Nocharge Minimum - * 0b0000..(1 + SSC0[BASE_NOCHARGE_NUM]) - * 0b0001..(2 + SSC0[BASE_NOCHARGE_NUM]) - * 0b0010..(3 + SSC0[BASE_NOCHARGE_NUM]) - * 0b0011..(4 + SSC0[BASE_NOCHARGE_NUM]) - * 0b0100..(5 + SSC0[BASE_NOCHARGE_NUM]) - * 0b0101..(6 + SSC0[BASE_NOCHARGE_NUM]) - * 0b0110..(7 + SSC0[BASE_NOCHARGE_NUM]) - * 0b0111..(8 + SSC0[BASE_NOCHARGE_NUM]) - * 0b1000..(9 + SSC0[BASE_NOCHARGE_NUM]) - * 0b1001..(10 + SSC0[BASE_NOCHARGE_NUM]) - * 0b1010..(11 + SSC0[BASE_NOCHARGE_NUM]) - * 0b1011..(12 + SSC0[BASE_NOCHARGE_NUM]) - * 0b1100..(13 + SSC0[BASE_NOCHARGE_NUM]) - * 0b1101..(14 + SSC0[BASE_NOCHARGE_NUM]) - * 0b1110..(15 + SSC0[BASE_NOCHARGE_NUM]) - * 0b1111..(16 + SSC0[BASE_NOCHARGE_NUM]) - */ -#define TSI_SSC2_MOVE_NOCHARGE_MIN(x) (((uint32_t)(((uint32_t)(x)) << TSI_SSC2_MOVE_NOCHARGE_MIN_SHIFT)) & TSI_SSC2_MOVE_NOCHARGE_MIN_MASK) -/*! @} */ - -/*! @name BASELINE - TSI Baseline */ -/*! @{ */ - -#define TSI_BASELINE_BASELINE_MASK (0xFFFFU) -#define TSI_BASELINE_BASELINE_SHIFT (0U) -/*! BASELINE - Baseline */ -#define TSI_BASELINE_BASELINE(x) (((uint32_t)(((uint32_t)(x)) << TSI_BASELINE_BASELINE_SHIFT)) & TSI_BASELINE_BASELINE_MASK) - -#define TSI_BASELINE_BASE_TRACE_DEBOUNCE_MASK (0xF0000U) -#define TSI_BASELINE_BASE_TRACE_DEBOUNCE_SHIFT (16U) -/*! BASE_TRACE_DEBOUNCE - Base Trace Debounce - * 0b0000..0 - * 0b0001..1 / 16 - * 0b0010..2 / 16 - * 0b0011..3 / 16 - * 0b1xxx..n / 16 - * 0b1111..15 / 16 - */ -#define TSI_BASELINE_BASE_TRACE_DEBOUNCE(x) (((uint32_t)(((uint32_t)(x)) << TSI_BASELINE_BASE_TRACE_DEBOUNCE_SHIFT)) & TSI_BASELINE_BASE_TRACE_DEBOUNCE_MASK) - -#define TSI_BASELINE_BASE_TRACE_EN_MASK (0x100000U) -#define TSI_BASELINE_BASE_TRACE_EN_SHIFT (20U) -/*! BASE_TRACE_EN - Baseline Trace Enable */ -#define TSI_BASELINE_BASE_TRACE_EN(x) (((uint32_t)(((uint32_t)(x)) << TSI_BASELINE_BASE_TRACE_EN_SHIFT)) & TSI_BASELINE_BASE_TRACE_EN_MASK) - -#define TSI_BASELINE_THESHOLD_RATIO_MASK (0x70000000U) -#define TSI_BASELINE_THESHOLD_RATIO_SHIFT (28U) -/*! THESHOLD_RATIO - Threshold Ratio - * 0b000..thresholdh = (baseline + counter) / 2 and thresholdl = (baseline - counter) / 2 - * 0b001..thresholdh = (baseline + counter) / 4 and thresholdl = (baseline - counter) / 4 - * 0b010..thresholdh = (baseline + counter) / 8 and thresholdl = (baseline - counter) / 8 - * 0b011..thresholdh = (baseline + counter) / 16 and thresholdl = (baseline - counter) / 16 - * 0b100..thresholdh = (baseline + counter) / 32 and thresholdl = (baseline - counter) / 32 - * 0b101..thresholdh = (baseline + counter) / 64 and thresholdl = (baseline - counter) / 64 - * 0b110..thresholdh = (baseline + counter) / 128 and thresholdl = (baseline - counter) / 128 - * 0b111..thresholdh = (baseline + counter) / 256 and thresholdl = (baseline - counter) / 256 - */ -#define TSI_BASELINE_THESHOLD_RATIO(x) (((uint32_t)(((uint32_t)(x)) << TSI_BASELINE_THESHOLD_RATIO_SHIFT)) & TSI_BASELINE_THESHOLD_RATIO_MASK) - -#define TSI_BASELINE_THRESHOLD_TRACE_EN_MASK (0x80000000U) -#define TSI_BASELINE_THRESHOLD_TRACE_EN_SHIFT (31U) -/*! THRESHOLD_TRACE_EN - Threshold Trace Enable - * 0b0..Disables - * 0b1..Enables - */ -#define TSI_BASELINE_THRESHOLD_TRACE_EN(x) (((uint32_t)(((uint32_t)(x)) << TSI_BASELINE_THRESHOLD_TRACE_EN_SHIFT)) & TSI_BASELINE_THRESHOLD_TRACE_EN_MASK) -/*! @} */ - -/*! @name CHMERGE - TSI Channel Merge */ -/*! @{ */ - -#define TSI_CHMERGE_CHANNEL_ENABLE_MASK (0x1FFFFFFU) -#define TSI_CHMERGE_CHANNEL_ENABLE_SHIFT (0U) -/*! CHANNEL_ENABLE - Channel Enable - * 0b0000000000000000000000000..Channel not chosen for proximity pad - * 0b0000000000000000000000001..Channel chosen for proximity pad - */ -#define TSI_CHMERGE_CHANNEL_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << TSI_CHMERGE_CHANNEL_ENABLE_SHIFT)) & TSI_CHMERGE_CHANNEL_ENABLE_MASK) -/*! @} */ - -/*! @name SHIELD - TSI Shield */ -/*! @{ */ - -#define TSI_SHIELD_SHIELD_ENABLE_MASK (0xFU) -#define TSI_SHIELD_SHIELD_ENABLE_SHIFT (0U) -/*! SHIELD_ENABLE - Shield Enable - * 0b0000..Disables - * 0b0001..Enables - */ -#define TSI_SHIELD_SHIELD_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << TSI_SHIELD_SHIELD_ENABLE_SHIFT)) & TSI_SHIELD_SHIELD_ENABLE_MASK) - -#define TSI_SHIELD_M_SEN_RES_MASK (0x7E000000U) -#define TSI_SHIELD_M_SEN_RES_SHIFT (25U) -/*! M_SEN_RES - Mutual-Capacitance Sensitivity Resistor - * 0b000000..10 kΩ - * 0b000001..10 kΩ + (2.5 / 3) kΩ (just for auto-calibration) - * 0b000010..12.5 kΩ (default) - * 0b001110..25 kΩ - */ -#define TSI_SHIELD_M_SEN_RES(x) (((uint32_t)(((uint32_t)(x)) << TSI_SHIELD_M_SEN_RES_SHIFT)) & TSI_SHIELD_M_SEN_RES_MASK) -/*! @} */ - -/*! @name DATA - TSI Data and Status */ -/*! @{ */ - -#define TSI_DATA_TSICNT_MASK (0xFFFFU) -#define TSI_DATA_TSICNT_SHIFT (0U) -/*! TSICNT - TSI Conversion Counter Value */ -#define TSI_DATA_TSICNT(x) (((uint32_t)(((uint32_t)(x)) << TSI_DATA_TSICNT_SHIFT)) & TSI_DATA_TSICNT_MASK) - -#define TSI_DATA_EOSF_MASK (0x8000000U) -#define TSI_DATA_EOSF_SHIFT (27U) -/*! EOSF - End-of-Scan Flag */ -#define TSI_DATA_EOSF(x) (((uint32_t)(((uint32_t)(x)) << TSI_DATA_EOSF_SHIFT)) & TSI_DATA_EOSF_MASK) - -#define TSI_DATA_OVERRUNF_MASK (0x20000000U) -#define TSI_DATA_OVERRUNF_SHIFT (29U) -/*! OVERRUNF - Overrun Flag - * 0b0..No - * 0b1..Yes - */ -#define TSI_DATA_OVERRUNF(x) (((uint32_t)(((uint32_t)(x)) << TSI_DATA_OVERRUNF_SHIFT)) & TSI_DATA_OVERRUNF_MASK) - -#define TSI_DATA_OUTRGF_MASK (0x40000000U) -#define TSI_DATA_OUTRGF_SHIFT (30U) -/*! OUTRGF - Out-of-Range Flag */ -#define TSI_DATA_OUTRGF(x) (((uint32_t)(((uint32_t)(x)) << TSI_DATA_OUTRGF_SHIFT)) & TSI_DATA_OUTRGF_MASK) -/*! @} */ - -/*! @name MISC - TSI Miscellaneous */ -/*! @{ */ - -#define TSI_MISC_OSC_CLK_SEL_MASK (0x80000U) -#define TSI_MISC_OSC_CLK_SEL_SHIFT (19U) -/*! OSC_CLK_SEL - Oscillator Clock Select - * 0b0..Analog oscillator - * 0b1..Chip - */ -#define TSI_MISC_OSC_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << TSI_MISC_OSC_CLK_SEL_SHIFT)) & TSI_MISC_OSC_CLK_SEL_MASK) - -#define TSI_MISC_TEST_FINGER_MASK (0x700000U) -#define TSI_MISC_TEST_FINGER_SHIFT (20U) -/*! TEST_FINGER - Test Finger - * 0b000..Finger capacitor is 148 pF - * 0b001..Finger capacitor is 296 pF - * 0b010..Finger capacitor is 444 pF - * 0b011..Finger capacitor is 592 pF - * 0b100..Finger capacitor is 740 pF - * 0b101..Finger capacitor is 888 pF - * 0b110..Finger capacitor is 1036 pF - * 0b111..Finger capacitor is 1184 pF - */ -#define TSI_MISC_TEST_FINGER(x) (((uint32_t)(((uint32_t)(x)) << TSI_MISC_TEST_FINGER_SHIFT)) & TSI_MISC_TEST_FINGER_MASK) - -#define TSI_MISC_TEST_FINGER_EN_MASK (0x800000U) -#define TSI_MISC_TEST_FINGER_EN_SHIFT (23U) -/*! TEST_FINGER_EN - Test Finger Function Enable Signals - * 0b0..Disables - * 0b1..Enables - */ -#define TSI_MISC_TEST_FINGER_EN(x) (((uint32_t)(((uint32_t)(x)) << TSI_MISC_TEST_FINGER_EN_SHIFT)) & TSI_MISC_TEST_FINGER_EN_MASK) - -#define TSI_MISC_CLKDIVIDER_MASK (0x1F000000U) -#define TSI_MISC_CLKDIVIDER_SHIFT (24U) -/*! CLKDIVIDER - TSI Clock Divider */ -#define TSI_MISC_CLKDIVIDER(x) (((uint32_t)(((uint32_t)(x)) << TSI_MISC_CLKDIVIDER_SHIFT)) & TSI_MISC_CLKDIVIDER_MASK) -/*! @} */ - -/*! @name TRIG - TSI AUTO TRIG */ -/*! @{ */ - -#define TSI_TRIG_TRIG_PERIOD_COUNTER_MASK (0xFFFFFU) -#define TSI_TRIG_TRIG_PERIOD_COUNTER_SHIFT (0U) -/*! TRIG_PERIOD_COUNTER - Trigger Period Counter */ -#define TSI_TRIG_TRIG_PERIOD_COUNTER(x) (((uint32_t)(((uint32_t)(x)) << TSI_TRIG_TRIG_PERIOD_COUNTER_SHIFT)) & TSI_TRIG_TRIG_PERIOD_COUNTER_MASK) - -#define TSI_TRIG_TRIG_CLK_DIVIDER_MASK (0x1F000000U) -#define TSI_TRIG_TRIG_CLK_DIVIDER_SHIFT (24U) -/*! TRIG_CLK_DIVIDER - Trigger Clock Divider - * 0b00000..No divider - * 0b00001..Divided by 2 - * 0b00010..Divided by 3 - * 0b00011..Divided by 4 - * 0b1xxxx..Divided by n - */ -#define TSI_TRIG_TRIG_CLK_DIVIDER(x) (((uint32_t)(((uint32_t)(x)) << TSI_TRIG_TRIG_CLK_DIVIDER_SHIFT)) & TSI_TRIG_TRIG_CLK_DIVIDER_MASK) - -#define TSI_TRIG_TRIG_EN_MASK (0x40000000U) -#define TSI_TRIG_TRIG_EN_SHIFT (30U) -/*! TRIG_EN - Trigger Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define TSI_TRIG_TRIG_EN(x) (((uint32_t)(((uint32_t)(x)) << TSI_TRIG_TRIG_EN_SHIFT)) & TSI_TRIG_TRIG_EN_MASK) - -#define TSI_TRIG_TRIG_CLK_SEL_MASK (0x80000000U) -#define TSI_TRIG_TRIG_CLK_SEL_SHIFT (31U) -/*! TRIG_CLK_SEL - Trigger Clock Select - * 0b0..32 k clock - * 0b1..clksoc - */ -#define TSI_TRIG_TRIG_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << TSI_TRIG_TRIG_CLK_SEL_SHIFT)) & TSI_TRIG_TRIG_CLK_SEL_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group TSI_Register_Masks */ - - -/* TSI - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral TSI0 base address */ - #define TSI0_BASE (0x50050000u) - /** Peripheral TSI0 base address */ - #define TSI0_BASE_NS (0x40050000u) - /** Peripheral TSI0 base pointer */ - #define TSI0 ((TSI_Type *)TSI0_BASE) - /** Peripheral TSI0 base pointer */ - #define TSI0_NS ((TSI_Type *)TSI0_BASE_NS) - /** Array initializer of TSI peripheral base addresses */ - #define TSI_BASE_ADDRS { TSI0_BASE } - /** Array initializer of TSI peripheral base pointers */ - #define TSI_BASE_PTRS { TSI0 } - /** Array initializer of TSI peripheral base addresses */ - #define TSI_BASE_ADDRS_NS { TSI0_BASE_NS } - /** Array initializer of TSI peripheral base pointers */ - #define TSI_BASE_PTRS_NS { TSI0_NS } -#else - /** Peripheral TSI0 base address */ - #define TSI0_BASE (0x40050000u) - /** Peripheral TSI0 base pointer */ - #define TSI0 ((TSI_Type *)TSI0_BASE) - /** Array initializer of TSI peripheral base addresses */ - #define TSI_BASE_ADDRS { TSI0_BASE } - /** Array initializer of TSI peripheral base pointers */ - #define TSI_BASE_PTRS { TSI0 } -#endif - -/*! - * @} - */ /* end of group TSI_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- USB Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USB_Peripheral_Access_Layer USB Peripheral Access Layer - * @{ - */ - -/** USB - Register Layout Typedef */ -typedef struct { - __I uint8_t PERID; /**< Peripheral ID, offset: 0x0 */ - uint8_t RESERVED_0[3]; - __I uint8_t IDCOMP; /**< Peripheral ID Complement, offset: 0x4 */ - uint8_t RESERVED_1[3]; - __I uint8_t REV; /**< Peripheral Revision, offset: 0x8 */ - uint8_t RESERVED_2[3]; - __I uint8_t ADDINFO; /**< Peripheral Additional Information, offset: 0xC */ - uint8_t RESERVED_3[3]; - __IO uint8_t OTGISTAT; /**< OTG Interrupt Status, offset: 0x10 */ - uint8_t RESERVED_4[3]; - __IO uint8_t OTGICR; /**< OTG Interrupt Control, offset: 0x14 */ - uint8_t RESERVED_5[3]; - __I uint8_t OTGSTAT; /**< OTG Status, offset: 0x18 */ - uint8_t RESERVED_6[3]; - __IO uint8_t OTGCTL; /**< OTG Control, offset: 0x1C */ - uint8_t RESERVED_7[99]; - __IO uint8_t ISTAT; /**< Interrupt Status, offset: 0x80 */ - uint8_t RESERVED_8[3]; - __IO uint8_t INTEN; /**< Interrupt Enable, offset: 0x84 */ - uint8_t RESERVED_9[3]; - __IO uint8_t ERRSTAT; /**< Error Interrupt Status, offset: 0x88 */ - uint8_t RESERVED_10[3]; - __IO uint8_t ERREN; /**< Error Interrupt Enable, offset: 0x8C */ - uint8_t RESERVED_11[3]; - __I uint8_t STAT; /**< Status, offset: 0x90 */ - uint8_t RESERVED_12[3]; - __IO uint8_t CTL; /**< Control, offset: 0x94 */ - uint8_t RESERVED_13[3]; - __IO uint8_t ADDR; /**< Address, offset: 0x98 */ - uint8_t RESERVED_14[3]; - __IO uint8_t BDTPAGE1; /**< BDT Page 1, offset: 0x9C */ - uint8_t RESERVED_15[3]; - __I uint8_t FRMNUML; /**< Frame Number Register Low, offset: 0xA0 */ - uint8_t RESERVED_16[3]; - __I uint8_t FRMNUMH; /**< Frame Number Register High, offset: 0xA4 */ - uint8_t RESERVED_17[3]; - __IO uint8_t TOKEN; /**< Token, offset: 0xA8 */ - uint8_t RESERVED_18[3]; - __IO uint8_t SOFTHLD; /**< SOF Threshold, offset: 0xAC */ - uint8_t RESERVED_19[3]; - __IO uint8_t BDTPAGE2; /**< BDT Page 2, offset: 0xB0 */ - uint8_t RESERVED_20[3]; - __IO uint8_t BDTPAGE3; /**< BDT Page 3, offset: 0xB4 */ - uint8_t RESERVED_21[11]; - struct { /* offset: 0xC0, array step: 0x4 */ - __IO uint8_t ENDPT; /**< Endpoint Control, array offset: 0xC0, array step: 0x4 */ - uint8_t RESERVED_0[3]; - } ENDPOINT[16]; - __IO uint8_t USBCTRL; /**< USB Control, offset: 0x100 */ - uint8_t RESERVED_22[3]; - __I uint8_t OBSERVE; /**< USB OTG Observe, offset: 0x104 */ - uint8_t RESERVED_23[3]; - __IO uint8_t CONTROL; /**< USB OTG Control, offset: 0x108 */ - uint8_t RESERVED_24[3]; - __IO uint8_t USBTRC0; /**< USB Transceiver Control 0, offset: 0x10C */ - uint8_t RESERVED_25[7]; - __IO uint8_t USBFRMADJUST; /**< Frame Adjust, offset: 0x114 */ - uint8_t RESERVED_26[15]; - __IO uint8_t KEEP_ALIVE_CTRL; /**< Keep Alive Mode Control, offset: 0x124 */ - uint8_t RESERVED_27[3]; - __IO uint8_t KEEP_ALIVE_WKCTRL; /**< Keep Alive Mode Wakeup Control, offset: 0x128 */ - uint8_t RESERVED_28[3]; - __IO uint8_t MISCCTRL; /**< Miscellaneous Control, offset: 0x12C */ - uint8_t RESERVED_29[3]; - __IO uint8_t STALL_IL_DIS; /**< Peripheral Mode Stall Disable for Endpoints 7 to 0 in IN Direction, offset: 0x130 */ - uint8_t RESERVED_30[3]; - __IO uint8_t STALL_IH_DIS; /**< Peripheral Mode Stall Disable for Endpoints 15 to 8 in IN Direction, offset: 0x134 */ - uint8_t RESERVED_31[3]; - __IO uint8_t STALL_OL_DIS; /**< Peripheral Mode Stall Disable for Endpoints 7 to 0 in OUT Direction, offset: 0x138 */ - uint8_t RESERVED_32[3]; - __IO uint8_t STALL_OH_DIS; /**< Peripheral Mode Stall Disable for Endpoints 15 to 8 in OUT Direction, offset: 0x13C */ - uint8_t RESERVED_33[3]; - __IO uint8_t CLK_RECOVER_CTRL; /**< USB Clock Recovery Control, offset: 0x140 */ - uint8_t RESERVED_34[3]; - __IO uint8_t CLK_RECOVER_IRC_EN; /**< FIRC Oscillator Enable, offset: 0x144 */ - uint8_t RESERVED_35[15]; - __IO uint8_t CLK_RECOVER_INT_EN; /**< Clock Recovery Combined Interrupt Enable, offset: 0x154 */ - uint8_t RESERVED_36[7]; - __IO uint8_t CLK_RECOVER_INT_STATUS; /**< Clock Recovery Separated Interrupt Status, offset: 0x15C */ -} USB_Type; - -/* ---------------------------------------------------------------------------- - -- USB Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USB_Register_Masks USB Register Masks - * @{ - */ - -/*! @name PERID - Peripheral ID */ -/*! @{ */ - -#define USB_PERID_ID_MASK (0x3FU) -#define USB_PERID_ID_SHIFT (0U) -/*! ID - Peripheral Identification */ -#define USB_PERID_ID(x) (((uint8_t)(((uint8_t)(x)) << USB_PERID_ID_SHIFT)) & USB_PERID_ID_MASK) -/*! @} */ - -/*! @name IDCOMP - Peripheral ID Complement */ -/*! @{ */ - -#define USB_IDCOMP_NID_MASK (0x3FU) -#define USB_IDCOMP_NID_SHIFT (0U) -/*! NID - Negative Peripheral ID */ -#define USB_IDCOMP_NID(x) (((uint8_t)(((uint8_t)(x)) << USB_IDCOMP_NID_SHIFT)) & USB_IDCOMP_NID_MASK) -/*! @} */ - -/*! @name REV - Peripheral Revision */ -/*! @{ */ - -#define USB_REV_REV_MASK (0xFFU) -#define USB_REV_REV_SHIFT (0U) -/*! REV - Revision */ -#define USB_REV_REV(x) (((uint8_t)(((uint8_t)(x)) << USB_REV_REV_SHIFT)) & USB_REV_REV_MASK) -/*! @} */ - -/*! @name ADDINFO - Peripheral Additional Information */ -/*! @{ */ - -#define USB_ADDINFO_IEHOST_MASK (0x1U) -#define USB_ADDINFO_IEHOST_SHIFT (0U) -/*! IEHOST - Host Mode Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define USB_ADDINFO_IEHOST(x) (((uint8_t)(((uint8_t)(x)) << USB_ADDINFO_IEHOST_SHIFT)) & USB_ADDINFO_IEHOST_MASK) -/*! @} */ - -/*! @name OTGISTAT - OTG Interrupt Status */ -/*! @{ */ - -#define USB_OTGISTAT_LINE_STATE_CHG_MASK (0x20U) -#define USB_OTGISTAT_LINE_STATE_CHG_SHIFT (5U) -/*! LINE_STATE_CHG - Line State Change Interrupt Flag - * 0b0..Interrupt did not occur - * 0b1..Interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_OTGISTAT_LINE_STATE_CHG(x) (((uint8_t)(((uint8_t)(x)) << USB_OTGISTAT_LINE_STATE_CHG_SHIFT)) & USB_OTGISTAT_LINE_STATE_CHG_MASK) - -#define USB_OTGISTAT_ONEMSEC_MASK (0x40U) -#define USB_OTGISTAT_ONEMSEC_SHIFT (6U) -/*! ONEMSEC - One Millisecond Timer Timeout Flag - * 0b0..Not timed out - * 0b1..Timed out - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_OTGISTAT_ONEMSEC(x) (((uint8_t)(((uint8_t)(x)) << USB_OTGISTAT_ONEMSEC_SHIFT)) & USB_OTGISTAT_ONEMSEC_MASK) -/*! @} */ - -/*! @name OTGICR - OTG Interrupt Control */ -/*! @{ */ - -#define USB_OTGICR_LINESTATEEN_MASK (0x20U) -#define USB_OTGICR_LINESTATEEN_SHIFT (5U) -/*! LINESTATEEN - Line State Change Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_OTGICR_LINESTATEEN(x) (((uint8_t)(((uint8_t)(x)) << USB_OTGICR_LINESTATEEN_SHIFT)) & USB_OTGICR_LINESTATEEN_MASK) - -#define USB_OTGICR_ONEMSECEN_MASK (0x40U) -#define USB_OTGICR_ONEMSECEN_SHIFT (6U) -/*! ONEMSECEN - 1-Millisecond Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_OTGICR_ONEMSECEN(x) (((uint8_t)(((uint8_t)(x)) << USB_OTGICR_ONEMSECEN_SHIFT)) & USB_OTGICR_ONEMSECEN_MASK) -/*! @} */ - -/*! @name OTGSTAT - OTG Status */ -/*! @{ */ - -#define USB_OTGSTAT_LINESTATESTABLE_MASK (0x20U) -#define USB_OTGSTAT_LINESTATESTABLE_SHIFT (5U) -/*! LINESTATESTABLE - Line State Stable - * 0b0..Unstable - * 0b1..Stable - */ -#define USB_OTGSTAT_LINESTATESTABLE(x) (((uint8_t)(((uint8_t)(x)) << USB_OTGSTAT_LINESTATESTABLE_SHIFT)) & USB_OTGSTAT_LINESTATESTABLE_MASK) - -#define USB_OTGSTAT_ONEMSEC_MASK (0x40U) -#define USB_OTGSTAT_ONEMSEC_SHIFT (6U) -/*! ONEMSEC - Reserved for 1 ms count */ -#define USB_OTGSTAT_ONEMSEC(x) (((uint8_t)(((uint8_t)(x)) << USB_OTGSTAT_ONEMSEC_SHIFT)) & USB_OTGSTAT_ONEMSEC_MASK) -/*! @} */ - -/*! @name OTGCTL - OTG Control */ -/*! @{ */ - -#define USB_OTGCTL_OTGEN_MASK (0x4U) -#define USB_OTGCTL_OTGEN_SHIFT (2U) -/*! OTGEN - On-The-Go Pullup and Pulldown Resistor Enable - * 0b0..If USBENSOFEN is 1 and HOSTMODEEN is 0 in the Control Register (CTL), then the D+ Data line pullup - * resistors are enabled. If HOSTMODEEN is 1, then the D+ and D- Data line pulldown resistors are engaged. - * 0b1..Uses the pullup and pulldown controls in this register. - */ -#define USB_OTGCTL_OTGEN(x) (((uint8_t)(((uint8_t)(x)) << USB_OTGCTL_OTGEN_SHIFT)) & USB_OTGCTL_OTGEN_MASK) - -#define USB_OTGCTL_DMLOW_MASK (0x10U) -#define USB_OTGCTL_DMLOW_SHIFT (4U) -/*! DMLOW - D- Data Line Pulldown Resistor Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_OTGCTL_DMLOW(x) (((uint8_t)(((uint8_t)(x)) << USB_OTGCTL_DMLOW_SHIFT)) & USB_OTGCTL_DMLOW_MASK) - -#define USB_OTGCTL_DPLOW_MASK (0x20U) -#define USB_OTGCTL_DPLOW_SHIFT (5U) -/*! DPLOW - D+ Data Line pulldown Resistor Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_OTGCTL_DPLOW(x) (((uint8_t)(((uint8_t)(x)) << USB_OTGCTL_DPLOW_SHIFT)) & USB_OTGCTL_DPLOW_MASK) - -#define USB_OTGCTL_DPHIGH_MASK (0x80U) -#define USB_OTGCTL_DPHIGH_SHIFT (7U) -/*! DPHIGH - D+ Data Line Pullup Resistor Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_OTGCTL_DPHIGH(x) (((uint8_t)(((uint8_t)(x)) << USB_OTGCTL_DPHIGH_SHIFT)) & USB_OTGCTL_DPHIGH_MASK) -/*! @} */ - -/*! @name ISTAT - Interrupt Status */ -/*! @{ */ - -#define USB_ISTAT_USBRST_MASK (0x1U) -#define USB_ISTAT_USBRST_SHIFT (0U) -/*! USBRST - USB Reset Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ISTAT_USBRST(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_USBRST_SHIFT)) & USB_ISTAT_USBRST_MASK) - -#define USB_ISTAT_ERROR_MASK (0x2U) -#define USB_ISTAT_ERROR_SHIFT (1U) -/*! ERROR - Error Flag - * 0b0..Error did not occur - * 0b1..Error occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ISTAT_ERROR(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_ERROR_SHIFT)) & USB_ISTAT_ERROR_MASK) - -#define USB_ISTAT_SOFTOK_MASK (0x4U) -#define USB_ISTAT_SOFTOK_SHIFT (2U) -/*! SOFTOK - Start Of Frame (SOF) Token Flag - * 0b0..Did not receive - * 0b1..Received - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ISTAT_SOFTOK(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_SOFTOK_SHIFT)) & USB_ISTAT_SOFTOK_MASK) - -#define USB_ISTAT_TOKDNE_MASK (0x8U) -#define USB_ISTAT_TOKDNE_SHIFT (3U) -/*! TOKDNE - Current Token Processing Flag - * 0b0..Not processed - * 0b1..Processed - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ISTAT_TOKDNE(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_TOKDNE_SHIFT)) & USB_ISTAT_TOKDNE_MASK) - -#define USB_ISTAT_SLEEP_MASK (0x10U) -#define USB_ISTAT_SLEEP_SHIFT (4U) -/*! SLEEP - Sleep Flag - * 0b0..Interrupt did not occur - * 0b1..Interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ISTAT_SLEEP(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_SLEEP_SHIFT)) & USB_ISTAT_SLEEP_MASK) - -#define USB_ISTAT_RESUME_MASK (0x20U) -#define USB_ISTAT_RESUME_SHIFT (5U) -/*! RESUME - Resume Flag - * 0b0..Interrupt did not occur - * 0b1..Interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ISTAT_RESUME(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_RESUME_SHIFT)) & USB_ISTAT_RESUME_MASK) - -#define USB_ISTAT_ATTACH_MASK (0x40U) -#define USB_ISTAT_ATTACH_SHIFT (6U) -/*! ATTACH - Attach Interrupt Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ISTAT_ATTACH(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_ATTACH_SHIFT)) & USB_ISTAT_ATTACH_MASK) - -#define USB_ISTAT_STALL_MASK (0x80U) -#define USB_ISTAT_STALL_SHIFT (7U) -/*! STALL - Stall Interrupt Flag - * 0b0..Interrupt did not occur - * 0b1..Interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ISTAT_STALL(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_STALL_SHIFT)) & USB_ISTAT_STALL_MASK) -/*! @} */ - -/*! @name INTEN - Interrupt Enable */ -/*! @{ */ - -#define USB_INTEN_USBRSTEN_MASK (0x1U) -#define USB_INTEN_USBRSTEN_SHIFT (0U) -/*! USBRSTEN - USBRST Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_INTEN_USBRSTEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_USBRSTEN_SHIFT)) & USB_INTEN_USBRSTEN_MASK) - -#define USB_INTEN_ERROREN_MASK (0x2U) -#define USB_INTEN_ERROREN_SHIFT (1U) -/*! ERROREN - ERROR Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_INTEN_ERROREN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_ERROREN_SHIFT)) & USB_INTEN_ERROREN_MASK) - -#define USB_INTEN_SOFTOKEN_MASK (0x4U) -#define USB_INTEN_SOFTOKEN_SHIFT (2U) -/*! SOFTOKEN - SOFTOK Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_INTEN_SOFTOKEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_SOFTOKEN_SHIFT)) & USB_INTEN_SOFTOKEN_MASK) - -#define USB_INTEN_TOKDNEEN_MASK (0x8U) -#define USB_INTEN_TOKDNEEN_SHIFT (3U) -/*! TOKDNEEN - TOKDNE Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_INTEN_TOKDNEEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_TOKDNEEN_SHIFT)) & USB_INTEN_TOKDNEEN_MASK) - -#define USB_INTEN_SLEEPEN_MASK (0x10U) -#define USB_INTEN_SLEEPEN_SHIFT (4U) -/*! SLEEPEN - SLEEP Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_INTEN_SLEEPEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_SLEEPEN_SHIFT)) & USB_INTEN_SLEEPEN_MASK) - -#define USB_INTEN_RESUMEEN_MASK (0x20U) -#define USB_INTEN_RESUMEEN_SHIFT (5U) -/*! RESUMEEN - RESUME Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_INTEN_RESUMEEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_RESUMEEN_SHIFT)) & USB_INTEN_RESUMEEN_MASK) - -#define USB_INTEN_ATTACHEN_MASK (0x40U) -#define USB_INTEN_ATTACHEN_SHIFT (6U) -/*! ATTACHEN - ATTACH Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_INTEN_ATTACHEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_ATTACHEN_SHIFT)) & USB_INTEN_ATTACHEN_MASK) - -#define USB_INTEN_STALLEN_MASK (0x80U) -#define USB_INTEN_STALLEN_SHIFT (7U) -/*! STALLEN - STALL Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_INTEN_STALLEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_STALLEN_SHIFT)) & USB_INTEN_STALLEN_MASK) -/*! @} */ - -/*! @name ERRSTAT - Error Interrupt Status */ -/*! @{ */ - -#define USB_ERRSTAT_PIDERR_MASK (0x1U) -#define USB_ERRSTAT_PIDERR_SHIFT (0U) -/*! PIDERR - PID Error Flag - * 0b0..Did not fail - * 0b1..Failed - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_PIDERR(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_PIDERR_SHIFT)) & USB_ERRSTAT_PIDERR_MASK) - -#define USB_ERRSTAT_CRC5EOF_MASK (0x2U) -#define USB_ERRSTAT_CRC5EOF_SHIFT (1U) -/*! CRC5EOF - CRC5 Error or End of Frame Error Flag - * 0b0..Interrupt did not occur - * 0b1..Interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_CRC5EOF(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_CRC5EOF_SHIFT)) & USB_ERRSTAT_CRC5EOF_MASK) - -#define USB_ERRSTAT_CRC16_MASK (0x4U) -#define USB_ERRSTAT_CRC16_SHIFT (2U) -/*! CRC16 - CRC16 Error Flag - * 0b0..Not rejected - * 0b1..Rejected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_CRC16(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_CRC16_SHIFT)) & USB_ERRSTAT_CRC16_MASK) - -#define USB_ERRSTAT_DFN8_MASK (0x8U) -#define USB_ERRSTAT_DFN8_SHIFT (3U) -/*! DFN8 - Data Field Not 8 Bits Flag - * 0b0..Integer number of bytes - * 0b1..Not an integer number of bytes - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_DFN8(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_DFN8_SHIFT)) & USB_ERRSTAT_DFN8_MASK) - -#define USB_ERRSTAT_BTOERR_MASK (0x10U) -#define USB_ERRSTAT_BTOERR_SHIFT (4U) -/*! BTOERR - Bus Turnaround Timeout Error Flag - * 0b0..Not timed out - * 0b1..Timed out - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_BTOERR(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_BTOERR_SHIFT)) & USB_ERRSTAT_BTOERR_MASK) - -#define USB_ERRSTAT_DMAERR_MASK (0x20U) -#define USB_ERRSTAT_DMAERR_SHIFT (5U) -/*! DMAERR - DMA Access Error Flag - * 0b0..Interrupt did not occur - * 0b1..Interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_DMAERR(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_DMAERR_SHIFT)) & USB_ERRSTAT_DMAERR_MASK) - -#define USB_ERRSTAT_OWNERR_MASK (0x40U) -#define USB_ERRSTAT_OWNERR_SHIFT (6U) -/*! OWNERR - BD Unavailable Error Flag - * 0b0..Interrupt did not occur - * 0b1..Interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_OWNERR(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_OWNERR_SHIFT)) & USB_ERRSTAT_OWNERR_MASK) - -#define USB_ERRSTAT_BTSERR_MASK (0x80U) -#define USB_ERRSTAT_BTSERR_SHIFT (7U) -/*! BTSERR - Bit Stuff Error Flag - * 0b0..Packet not rejected due to the error - * 0b1..Packet rejected due to the error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_BTSERR(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_BTSERR_SHIFT)) & USB_ERRSTAT_BTSERR_MASK) -/*! @} */ - -/*! @name ERREN - Error Interrupt Enable */ -/*! @{ */ - -#define USB_ERREN_PIDERREN_MASK (0x1U) -#define USB_ERREN_PIDERREN_SHIFT (0U) -/*! PIDERREN - PIDERR Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_PIDERREN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_PIDERREN_SHIFT)) & USB_ERREN_PIDERREN_MASK) - -#define USB_ERREN_CRC5EOFEN_MASK (0x2U) -#define USB_ERREN_CRC5EOFEN_SHIFT (1U) -/*! CRC5EOFEN - CRC5/EOF Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_CRC5EOFEN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_CRC5EOFEN_SHIFT)) & USB_ERREN_CRC5EOFEN_MASK) - -#define USB_ERREN_CRC16EN_MASK (0x4U) -#define USB_ERREN_CRC16EN_SHIFT (2U) -/*! CRC16EN - CRC16 Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_CRC16EN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_CRC16EN_SHIFT)) & USB_ERREN_CRC16EN_MASK) - -#define USB_ERREN_DFN8EN_MASK (0x8U) -#define USB_ERREN_DFN8EN_SHIFT (3U) -/*! DFN8EN - DFN8 (Data Field Not Integer Number of Bytes) Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_DFN8EN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_DFN8EN_SHIFT)) & USB_ERREN_DFN8EN_MASK) - -#define USB_ERREN_BTOERREN_MASK (0x10U) -#define USB_ERREN_BTOERREN_SHIFT (4U) -/*! BTOERREN - BTOERR (Bus Timeout Error) Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_BTOERREN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_BTOERREN_SHIFT)) & USB_ERREN_BTOERREN_MASK) - -#define USB_ERREN_DMAERREN_MASK (0x20U) -#define USB_ERREN_DMAERREN_SHIFT (5U) -/*! DMAERREN - DMAERR Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_DMAERREN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_DMAERREN_SHIFT)) & USB_ERREN_DMAERREN_MASK) - -#define USB_ERREN_OWNERREN_MASK (0x40U) -#define USB_ERREN_OWNERREN_SHIFT (6U) -/*! OWNERREN - OWNERR Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_OWNERREN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_OWNERREN_SHIFT)) & USB_ERREN_OWNERREN_MASK) - -#define USB_ERREN_BTSERREN_MASK (0x80U) -#define USB_ERREN_BTSERREN_SHIFT (7U) -/*! BTSERREN - BTSERR (Bit Stuff Error) Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_BTSERREN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_BTSERREN_SHIFT)) & USB_ERREN_BTSERREN_MASK) -/*! @} */ - -/*! @name STAT - Status */ -/*! @{ */ - -#define USB_STAT_ODD_MASK (0x4U) -#define USB_STAT_ODD_SHIFT (2U) -/*! ODD - Odd Bank - * 0b0..Not in the odd bank - * 0b1..In the odd bank - */ -#define USB_STAT_ODD(x) (((uint8_t)(((uint8_t)(x)) << USB_STAT_ODD_SHIFT)) & USB_STAT_ODD_MASK) - -#define USB_STAT_TX_MASK (0x8U) -#define USB_STAT_TX_SHIFT (3U) -/*! TX - Transmit Indicator - * 0b0..Receive - * 0b1..Transmit - */ -#define USB_STAT_TX(x) (((uint8_t)(((uint8_t)(x)) << USB_STAT_TX_SHIFT)) & USB_STAT_TX_MASK) - -#define USB_STAT_ENDP_MASK (0xF0U) -#define USB_STAT_ENDP_SHIFT (4U) -/*! ENDP - Endpoint address */ -#define USB_STAT_ENDP(x) (((uint8_t)(((uint8_t)(x)) << USB_STAT_ENDP_SHIFT)) & USB_STAT_ENDP_MASK) -/*! @} */ - -/*! @name CTL - Control */ -/*! @{ */ - -#define USB_CTL_USBENSOFEN_MASK (0x1U) -#define USB_CTL_USBENSOFEN_SHIFT (0U) -/*! USBENSOFEN - USB Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_CTL_USBENSOFEN(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_USBENSOFEN_SHIFT)) & USB_CTL_USBENSOFEN_MASK) - -#define USB_CTL_ODDRST_MASK (0x2U) -#define USB_CTL_ODDRST_SHIFT (1U) -/*! ODDRST - Odd Reset */ -#define USB_CTL_ODDRST(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_ODDRST_SHIFT)) & USB_CTL_ODDRST_MASK) - -#define USB_CTL_RESUME_MASK (0x4U) -#define USB_CTL_RESUME_SHIFT (2U) -/*! RESUME - Resume */ -#define USB_CTL_RESUME(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_RESUME_SHIFT)) & USB_CTL_RESUME_MASK) - -#define USB_CTL_HOSTMODEEN_MASK (0x8U) -#define USB_CTL_HOSTMODEEN_SHIFT (3U) -/*! HOSTMODEEN - Host Mode Enable - * 0b0..USBFS operates in Device mode. - * 0b1..USBFS operates in Host mode. In Host mode, USBFS performs USB transactions under the programmed control of the host processor. - */ -#define USB_CTL_HOSTMODEEN(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_HOSTMODEEN_SHIFT)) & USB_CTL_HOSTMODEEN_MASK) - -#define USB_CTL_RESET_MASK (0x10U) -#define USB_CTL_RESET_SHIFT (4U) -/*! RESET - Reset Signaling Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_CTL_RESET(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_RESET_SHIFT)) & USB_CTL_RESET_MASK) - -#define USB_CTL_TXSUSPENDTOKENBUSY_MASK (0x20U) -#define USB_CTL_TXSUSPENDTOKENBUSY_SHIFT (5U) -/*! TXSUSPENDTOKENBUSY - TXD Suspend And Token Busy */ -#define USB_CTL_TXSUSPENDTOKENBUSY(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_TXSUSPENDTOKENBUSY_SHIFT)) & USB_CTL_TXSUSPENDTOKENBUSY_MASK) - -#define USB_CTL_SE0_MASK (0x40U) -#define USB_CTL_SE0_SHIFT (6U) -/*! SE0 - Live USB Single-Ended Zero signal */ -#define USB_CTL_SE0(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_SE0_SHIFT)) & USB_CTL_SE0_MASK) - -#define USB_CTL_JSTATE_MASK (0x80U) -#define USB_CTL_JSTATE_SHIFT (7U) -/*! JSTATE - Live USB Differential Receiver JSTATE Signal */ -#define USB_CTL_JSTATE(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_JSTATE_SHIFT)) & USB_CTL_JSTATE_MASK) -/*! @} */ - -/*! @name ADDR - Address */ -/*! @{ */ - -#define USB_ADDR_ADDR_MASK (0x7FU) -#define USB_ADDR_ADDR_SHIFT (0U) -/*! ADDR - USB Address */ -#define USB_ADDR_ADDR(x) (((uint8_t)(((uint8_t)(x)) << USB_ADDR_ADDR_SHIFT)) & USB_ADDR_ADDR_MASK) - -#define USB_ADDR_LSEN_MASK (0x80U) -#define USB_ADDR_LSEN_SHIFT (7U) -/*! LSEN - Low Speed Enable */ -#define USB_ADDR_LSEN(x) (((uint8_t)(((uint8_t)(x)) << USB_ADDR_LSEN_SHIFT)) & USB_ADDR_LSEN_MASK) -/*! @} */ - -/*! @name BDTPAGE1 - BDT Page 1 */ -/*! @{ */ - -#define USB_BDTPAGE1_BDTBA_MASK (0xFEU) -#define USB_BDTPAGE1_BDTBA_SHIFT (1U) -/*! BDTBA - BDT Base Address */ -#define USB_BDTPAGE1_BDTBA(x) (((uint8_t)(((uint8_t)(x)) << USB_BDTPAGE1_BDTBA_SHIFT)) & USB_BDTPAGE1_BDTBA_MASK) -/*! @} */ - -/*! @name FRMNUML - Frame Number Register Low */ -/*! @{ */ - -#define USB_FRMNUML_FRM_MASK (0xFFU) -#define USB_FRMNUML_FRM_SHIFT (0U) -/*! FRM - Frame Number, Bits 0-7 */ -#define USB_FRMNUML_FRM(x) (((uint8_t)(((uint8_t)(x)) << USB_FRMNUML_FRM_SHIFT)) & USB_FRMNUML_FRM_MASK) -/*! @} */ - -/*! @name FRMNUMH - Frame Number Register High */ -/*! @{ */ - -#define USB_FRMNUMH_FRM_MASK (0x7U) -#define USB_FRMNUMH_FRM_SHIFT (0U) -/*! FRM - Frame Number, Bits 8-10 */ -#define USB_FRMNUMH_FRM(x) (((uint8_t)(((uint8_t)(x)) << USB_FRMNUMH_FRM_SHIFT)) & USB_FRMNUMH_FRM_MASK) -/*! @} */ - -/*! @name TOKEN - Token */ -/*! @{ */ - -#define USB_TOKEN_TOKENENDPT_MASK (0xFU) -#define USB_TOKEN_TOKENENDPT_SHIFT (0U) -/*! TOKENENDPT - Token Endpoint Address */ -#define USB_TOKEN_TOKENENDPT(x) (((uint8_t)(((uint8_t)(x)) << USB_TOKEN_TOKENENDPT_SHIFT)) & USB_TOKEN_TOKENENDPT_MASK) - -#define USB_TOKEN_TOKENPID_MASK (0xF0U) -#define USB_TOKEN_TOKENPID_SHIFT (4U) -/*! TOKENPID - Token Type - * 0b0001..OUT token. USBFS performs an OUT (TX) transaction. - * 0b1001..IN token. USBFS performs an IN (RX) transaction. - * 0b1101..SETUP token. USBFS performs a SETUP (TX) transaction - */ -#define USB_TOKEN_TOKENPID(x) (((uint8_t)(((uint8_t)(x)) << USB_TOKEN_TOKENPID_SHIFT)) & USB_TOKEN_TOKENPID_MASK) -/*! @} */ - -/*! @name SOFTHLD - SOF Threshold */ -/*! @{ */ - -#define USB_SOFTHLD_CNT_MASK (0xFFU) -#define USB_SOFTHLD_CNT_SHIFT (0U) -/*! CNT - SOF Count Threshold */ -#define USB_SOFTHLD_CNT(x) (((uint8_t)(((uint8_t)(x)) << USB_SOFTHLD_CNT_SHIFT)) & USB_SOFTHLD_CNT_MASK) -/*! @} */ - -/*! @name BDTPAGE2 - BDT Page 2 */ -/*! @{ */ - -#define USB_BDTPAGE2_BDTBA_MASK (0xFFU) -#define USB_BDTPAGE2_BDTBA_SHIFT (0U) -/*! BDTBA - BDT Base Address */ -#define USB_BDTPAGE2_BDTBA(x) (((uint8_t)(((uint8_t)(x)) << USB_BDTPAGE2_BDTBA_SHIFT)) & USB_BDTPAGE2_BDTBA_MASK) -/*! @} */ - -/*! @name BDTPAGE3 - BDT Page 3 */ -/*! @{ */ - -#define USB_BDTPAGE3_BDTBA_MASK (0xFFU) -#define USB_BDTPAGE3_BDTBA_SHIFT (0U) -/*! BDTBA - BDT Base Address */ -#define USB_BDTPAGE3_BDTBA(x) (((uint8_t)(((uint8_t)(x)) << USB_BDTPAGE3_BDTBA_SHIFT)) & USB_BDTPAGE3_BDTBA_MASK) -/*! @} */ - -/*! @name ENDPT - Endpoint Control */ -/*! @{ */ - -#define USB_ENDPT_EPHSHK_MASK (0x1U) -#define USB_ENDPT_EPHSHK_SHIFT (0U) -/*! EPHSHK - Endpoint Handshaking Enable */ -#define USB_ENDPT_EPHSHK(x) (((uint8_t)(((uint8_t)(x)) << USB_ENDPT_EPHSHK_SHIFT)) & USB_ENDPT_EPHSHK_MASK) - -#define USB_ENDPT_EPSTALL_MASK (0x2U) -#define USB_ENDPT_EPSTALL_SHIFT (1U) -/*! EPSTALL - Endpoint Stalled */ -#define USB_ENDPT_EPSTALL(x) (((uint8_t)(((uint8_t)(x)) << USB_ENDPT_EPSTALL_SHIFT)) & USB_ENDPT_EPSTALL_MASK) - -#define USB_ENDPT_EPTXEN_MASK (0x4U) -#define USB_ENDPT_EPTXEN_SHIFT (2U) -/*! EPTXEN - Endpoint for TX transfers enable */ -#define USB_ENDPT_EPTXEN(x) (((uint8_t)(((uint8_t)(x)) << USB_ENDPT_EPTXEN_SHIFT)) & USB_ENDPT_EPTXEN_MASK) - -#define USB_ENDPT_EPRXEN_MASK (0x8U) -#define USB_ENDPT_EPRXEN_SHIFT (3U) -/*! EPRXEN - Endpoint for RX transfers enable */ -#define USB_ENDPT_EPRXEN(x) (((uint8_t)(((uint8_t)(x)) << USB_ENDPT_EPRXEN_SHIFT)) & USB_ENDPT_EPRXEN_MASK) - -#define USB_ENDPT_EPCTLDIS_MASK (0x10U) -#define USB_ENDPT_EPCTLDIS_SHIFT (4U) -/*! EPCTLDIS - Control Transfer Disable - * 0b0..Enable - * 0b1..Disable - */ -#define USB_ENDPT_EPCTLDIS(x) (((uint8_t)(((uint8_t)(x)) << USB_ENDPT_EPCTLDIS_SHIFT)) & USB_ENDPT_EPCTLDIS_MASK) - -#define USB_ENDPT_RETRYDIS_MASK (0x40U) -#define USB_ENDPT_RETRYDIS_SHIFT (6U) -/*! RETRYDIS - Retry Disable - * 0b0..Retried NAK'ed transactions in hardware. - * 0b1..Do not retry NAK'ed transactions. When a transaction is NAK'ed, the BDT PID field is updated with the NAK - * PID, and the TOKEN_DNE interrupt becomes 1. - */ -#define USB_ENDPT_RETRYDIS(x) (((uint8_t)(((uint8_t)(x)) << USB_ENDPT_RETRYDIS_SHIFT)) & USB_ENDPT_RETRYDIS_MASK) - -#define USB_ENDPT_HOSTWOHUB_MASK (0x80U) -#define USB_ENDPT_HOSTWOHUB_SHIFT (7U) -/*! HOSTWOHUB - Host Without A Hub - * 0b0..Connected using a hub (USBFS generates PRE_PID as required) - * 0b1..Connected directly to host without a hub, or was used to attach - */ -#define USB_ENDPT_HOSTWOHUB(x) (((uint8_t)(((uint8_t)(x)) << USB_ENDPT_HOSTWOHUB_SHIFT)) & USB_ENDPT_HOSTWOHUB_MASK) -/*! @} */ - -/* The count of USB_ENDPT */ -#define USB_ENDPT_COUNT (16U) - -/*! @name USBCTRL - USB Control */ -/*! @{ */ - -#define USB_USBCTRL_DPDM_LANE_REVERSE_MASK (0x4U) -#define USB_USBCTRL_DPDM_LANE_REVERSE_SHIFT (2U) -/*! DPDM_LANE_REVERSE - DP and DM Lane Reversal Control - * 0b0..Standard USB DP and DM package pin assignment - * 0b1..Reverse roles of USB DP and DM package pins - */ -#define USB_USBCTRL_DPDM_LANE_REVERSE(x) (((uint8_t)(((uint8_t)(x)) << USB_USBCTRL_DPDM_LANE_REVERSE_SHIFT)) & USB_USBCTRL_DPDM_LANE_REVERSE_MASK) - -#define USB_USBCTRL_HOST_LS_EOP_MASK (0x8U) -#define USB_USBCTRL_HOST_LS_EOP_SHIFT (3U) -/*! HOST_LS_EOP - Host-Mode-Only Low-Speed Device EOP Signaling - * 0b0..Full-speed device or a low-speed device through a hub - * 0b1..Directly-connected low-speed device - */ -#define USB_USBCTRL_HOST_LS_EOP(x) (((uint8_t)(((uint8_t)(x)) << USB_USBCTRL_HOST_LS_EOP_SHIFT)) & USB_USBCTRL_HOST_LS_EOP_MASK) - -#define USB_USBCTRL_UARTSEL_MASK (0x10U) -#define USB_USBCTRL_UARTSEL_SHIFT (4U) -/*! UARTSEL - UART Select - * 0b0..USB DP and DM external package pins are used for USB signaling. - * 0b1..USB DP and DM external package pins are used for UART signaling. - */ -#define USB_USBCTRL_UARTSEL(x) (((uint8_t)(((uint8_t)(x)) << USB_USBCTRL_UARTSEL_SHIFT)) & USB_USBCTRL_UARTSEL_MASK) - -#define USB_USBCTRL_UARTCHLS_MASK (0x20U) -#define USB_USBCTRL_UARTCHLS_SHIFT (5U) -/*! UARTCHLS - UART Signal Channel Select - * 0b0..USB DP and DM signals are used as UART TX/RX. - * 0b1..USB DP and DM signals are used as UART RX/TX. - */ -#define USB_USBCTRL_UARTCHLS(x) (((uint8_t)(((uint8_t)(x)) << USB_USBCTRL_UARTCHLS_SHIFT)) & USB_USBCTRL_UARTCHLS_MASK) - -#define USB_USBCTRL_PDE_MASK (0x40U) -#define USB_USBCTRL_PDE_SHIFT (6U) -/*! PDE - Pulldown Enable - * 0b0..Disable on D+ and D- - * 0b1..Enable on D+ and D- - */ -#define USB_USBCTRL_PDE(x) (((uint8_t)(((uint8_t)(x)) << USB_USBCTRL_PDE_SHIFT)) & USB_USBCTRL_PDE_MASK) - -#define USB_USBCTRL_SUSP_MASK (0x80U) -#define USB_USBCTRL_SUSP_SHIFT (7U) -/*! SUSP - Suspend - * 0b0..Not in Suspend state - * 0b1..In Suspend state - */ -#define USB_USBCTRL_SUSP(x) (((uint8_t)(((uint8_t)(x)) << USB_USBCTRL_SUSP_SHIFT)) & USB_USBCTRL_SUSP_MASK) -/*! @} */ - -/*! @name OBSERVE - USB OTG Observe */ -/*! @{ */ - -#define USB_OBSERVE_DMPD_MASK (0x10U) -#define USB_OBSERVE_DMPD_SHIFT (4U) -/*! DMPD - D- Pulldown - * 0b0..Disabled - * 0b1..Enabled - */ -#define USB_OBSERVE_DMPD(x) (((uint8_t)(((uint8_t)(x)) << USB_OBSERVE_DMPD_SHIFT)) & USB_OBSERVE_DMPD_MASK) - -#define USB_OBSERVE_DPPD_MASK (0x40U) -#define USB_OBSERVE_DPPD_SHIFT (6U) -/*! DPPD - D+ Pulldown - * 0b0..Disabled - * 0b1..Enabled - */ -#define USB_OBSERVE_DPPD(x) (((uint8_t)(((uint8_t)(x)) << USB_OBSERVE_DPPD_SHIFT)) & USB_OBSERVE_DPPD_MASK) - -#define USB_OBSERVE_DPPU_MASK (0x80U) -#define USB_OBSERVE_DPPU_SHIFT (7U) -/*! DPPU - D+ Pullup - * 0b0..Disabled - * 0b1..Enabled - */ -#define USB_OBSERVE_DPPU(x) (((uint8_t)(((uint8_t)(x)) << USB_OBSERVE_DPPU_SHIFT)) & USB_OBSERVE_DPPU_MASK) -/*! @} */ - -/*! @name CONTROL - USB OTG Control */ -/*! @{ */ - -#define USB_CONTROL_VBUS_SOURCE_SEL_MASK (0x1U) -#define USB_CONTROL_VBUS_SOURCE_SEL_SHIFT (0U) -/*! VBUS_SOURCE_SEL - VBUS Monitoring Source Select - * 0b0..Reserved - * 0b1..Resistive divider attached to a GPIO pin - */ -#define USB_CONTROL_VBUS_SOURCE_SEL(x) (((uint8_t)(((uint8_t)(x)) << USB_CONTROL_VBUS_SOURCE_SEL_SHIFT)) & USB_CONTROL_VBUS_SOURCE_SEL_MASK) - -#define USB_CONTROL_SESS_VLD_MASK (0x2U) -#define USB_CONTROL_SESS_VLD_SHIFT (1U) -/*! SESS_VLD - VBUS Session Valid status - * 0b1..Above - * 0b0..Below - */ -#define USB_CONTROL_SESS_VLD(x) (((uint8_t)(((uint8_t)(x)) << USB_CONTROL_SESS_VLD_SHIFT)) & USB_CONTROL_SESS_VLD_MASK) - -#define USB_CONTROL_DPPULLUPNONOTG_MASK (0x10U) -#define USB_CONTROL_DPPULLUPNONOTG_SHIFT (4U) -/*! DPPULLUPNONOTG - DP Pullup in Non-OTG Device Mode - * 0b0..Disable - * 0b1..Enabled - */ -#define USB_CONTROL_DPPULLUPNONOTG(x) (((uint8_t)(((uint8_t)(x)) << USB_CONTROL_DPPULLUPNONOTG_SHIFT)) & USB_CONTROL_DPPULLUPNONOTG_MASK) -/*! @} */ - -/*! @name USBTRC0 - USB Transceiver Control 0 */ -/*! @{ */ - -#define USB_USBTRC0_USB_RESUME_INT_MASK (0x1U) -#define USB_USBTRC0_USB_RESUME_INT_SHIFT (0U) -/*! USB_RESUME_INT - USB Asynchronous Interrupt - * 0b0..Not generated - * 0b1..Generated because of the USB asynchronous interrupt - */ -#define USB_USBTRC0_USB_RESUME_INT(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_USB_RESUME_INT_SHIFT)) & USB_USBTRC0_USB_RESUME_INT_MASK) - -#define USB_USBTRC0_SYNC_DET_MASK (0x2U) -#define USB_USBTRC0_SYNC_DET_SHIFT (1U) -/*! SYNC_DET - Synchronous USB Interrupt Detect - * 0b0..Not detected - * 0b1..Detected - */ -#define USB_USBTRC0_SYNC_DET(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_SYNC_DET_SHIFT)) & USB_USBTRC0_SYNC_DET_MASK) - -#define USB_USBTRC0_USB_CLK_RECOVERY_INT_MASK (0x4U) -#define USB_USBTRC0_USB_CLK_RECOVERY_INT_SHIFT (2U) -/*! USB_CLK_RECOVERY_INT - Combined USB Clock Recovery interrupt status */ -#define USB_USBTRC0_USB_CLK_RECOVERY_INT(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_USB_CLK_RECOVERY_INT_SHIFT)) & USB_USBTRC0_USB_CLK_RECOVERY_INT_MASK) - -#define USB_USBTRC0_VREDG_DET_MASK (0x8U) -#define USB_USBTRC0_VREDG_DET_SHIFT (3U) -/*! VREDG_DET - VREGIN Rising Edge Interrupt Detect - * 0b0..Not detected - * 0b1..Detected - */ -#define USB_USBTRC0_VREDG_DET(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_VREDG_DET_SHIFT)) & USB_USBTRC0_VREDG_DET_MASK) - -#define USB_USBTRC0_VFEDG_DET_MASK (0x10U) -#define USB_USBTRC0_VFEDG_DET_SHIFT (4U) -/*! VFEDG_DET - VREGIN Falling Edge Interrupt Detect - * 0b0..Not detected - * 0b1..Detected - */ -#define USB_USBTRC0_VFEDG_DET(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_VFEDG_DET_SHIFT)) & USB_USBTRC0_VFEDG_DET_MASK) - -#define USB_USBTRC0_USBRESMEN_MASK (0x20U) -#define USB_USBTRC0_USBRESMEN_SHIFT (5U) -/*! USBRESMEN - Asynchronous Resume Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_USBTRC0_USBRESMEN(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_USBRESMEN_SHIFT)) & USB_USBTRC0_USBRESMEN_MASK) - -#define USB_USBTRC0_VREGIN_STS_MASK (0x40U) -#define USB_USBTRC0_VREGIN_STS_SHIFT (6U) -/*! VREGIN_STS - VREGIN Status */ -#define USB_USBTRC0_VREGIN_STS(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_VREGIN_STS_SHIFT)) & USB_USBTRC0_VREGIN_STS_MASK) - -#define USB_USBTRC0_USBRESET_MASK (0x80U) -#define USB_USBTRC0_USBRESET_SHIFT (7U) -/*! USBRESET - USB Reset - * 0b0..Normal USBFS operation - * 0b1..Returns USBFS to its reset state - */ -#define USB_USBTRC0_USBRESET(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_USBRESET_SHIFT)) & USB_USBTRC0_USBRESET_MASK) -/*! @} */ - -/*! @name USBFRMADJUST - Frame Adjust */ -/*! @{ */ - -#define USB_USBFRMADJUST_ADJ_MASK (0xFFU) -#define USB_USBFRMADJUST_ADJ_SHIFT (0U) -/*! ADJ - Frame Adjustment */ -#define USB_USBFRMADJUST_ADJ(x) (((uint8_t)(((uint8_t)(x)) << USB_USBFRMADJUST_ADJ_SHIFT)) & USB_USBFRMADJUST_ADJ_MASK) -/*! @} */ - -/*! @name KEEP_ALIVE_CTRL - Keep Alive Mode Control */ -/*! @{ */ - -#define USB_KEEP_ALIVE_CTRL_KEEP_ALIVE_EN_MASK (0x1U) -#define USB_KEEP_ALIVE_CTRL_KEEP_ALIVE_EN_SHIFT (0U) -/*! KEEP_ALIVE_EN - Keep Alive Mode Enable - * 0b0..Everything remains same as before. - * 0b1..USB shall enter USB_KEEP_ALIVE mode after asserting ipg_stop. - */ -#define USB_KEEP_ALIVE_CTRL_KEEP_ALIVE_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_KEEP_ALIVE_CTRL_KEEP_ALIVE_EN_SHIFT)) & USB_KEEP_ALIVE_CTRL_KEEP_ALIVE_EN_MASK) - -#define USB_KEEP_ALIVE_CTRL_OWN_OVERRD_EN_MASK (0x2U) -#define USB_KEEP_ALIVE_CTRL_OWN_OVERRD_EN_SHIFT (1U) -/*! OWN_OVERRD_EN - OWN Bit Override Enable */ -#define USB_KEEP_ALIVE_CTRL_OWN_OVERRD_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_KEEP_ALIVE_CTRL_OWN_OVERRD_EN_SHIFT)) & USB_KEEP_ALIVE_CTRL_OWN_OVERRD_EN_MASK) - -#define USB_KEEP_ALIVE_CTRL_STOP_ACK_DLY_EN_MASK (0x4U) -#define USB_KEEP_ALIVE_CTRL_STOP_ACK_DLY_EN_SHIFT (2U) -/*! STOP_ACK_DLY_EN - Stop Acknowledge Delay Enable - * 0b0..Enter KEEP_ALIVE mode immediately when there is no USB AHB transfer. - * 0b1..Enter KEEP_ALIVE mode until the USB core is idle and there is no USB AHB transfer. - */ -#define USB_KEEP_ALIVE_CTRL_STOP_ACK_DLY_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_KEEP_ALIVE_CTRL_STOP_ACK_DLY_EN_SHIFT)) & USB_KEEP_ALIVE_CTRL_STOP_ACK_DLY_EN_MASK) - -#define USB_KEEP_ALIVE_CTRL_WAKE_REQ_EN_MASK (0x8U) -#define USB_KEEP_ALIVE_CTRL_WAKE_REQ_EN_SHIFT (3U) -/*! WAKE_REQ_EN - Wakeup Request Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_KEEP_ALIVE_CTRL_WAKE_REQ_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_KEEP_ALIVE_CTRL_WAKE_REQ_EN_SHIFT)) & USB_KEEP_ALIVE_CTRL_WAKE_REQ_EN_MASK) - -#define USB_KEEP_ALIVE_CTRL_WAKE_INT_EN_MASK (0x10U) -#define USB_KEEP_ALIVE_CTRL_WAKE_INT_EN_SHIFT (4U) -/*! WAKE_INT_EN - Wakeup Interrupt Enable */ -#define USB_KEEP_ALIVE_CTRL_WAKE_INT_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_KEEP_ALIVE_CTRL_WAKE_INT_EN_SHIFT)) & USB_KEEP_ALIVE_CTRL_WAKE_INT_EN_MASK) - -#define USB_KEEP_ALIVE_CTRL_KEEP_ALIVE_STS_MASK (0x40U) -#define USB_KEEP_ALIVE_CTRL_KEEP_ALIVE_STS_SHIFT (6U) -/*! KEEP_ALIVE_STS - Keep Alive Status - * 0b0..Not in Keep Alive mode - * 0b1..In Keep Alive mode - */ -#define USB_KEEP_ALIVE_CTRL_KEEP_ALIVE_STS(x) (((uint8_t)(((uint8_t)(x)) << USB_KEEP_ALIVE_CTRL_KEEP_ALIVE_STS_SHIFT)) & USB_KEEP_ALIVE_CTRL_KEEP_ALIVE_STS_MASK) - -#define USB_KEEP_ALIVE_CTRL_WAKE_INT_STS_MASK (0x80U) -#define USB_KEEP_ALIVE_CTRL_WAKE_INT_STS_SHIFT (7U) -/*! WAKE_INT_STS - Wakeup Interrupt Status Flag - * 0b0..Interrupt did not occur - * 0b1..Interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_KEEP_ALIVE_CTRL_WAKE_INT_STS(x) (((uint8_t)(((uint8_t)(x)) << USB_KEEP_ALIVE_CTRL_WAKE_INT_STS_SHIFT)) & USB_KEEP_ALIVE_CTRL_WAKE_INT_STS_MASK) -/*! @} */ - -/*! @name KEEP_ALIVE_WKCTRL - Keep Alive Mode Wakeup Control */ -/*! @{ */ - -#define USB_KEEP_ALIVE_WKCTRL_WAKE_ON_THIS_MASK (0xFU) -#define USB_KEEP_ALIVE_WKCTRL_WAKE_ON_THIS_SHIFT (0U) -/*! WAKE_ON_THIS - Token PID for the wakeup request - * 0b0001..Wake up after receiving OUT or SETUP token packet. - * 0b1101..Wake up after receiving SETUP token packet. All other values are reserved. - */ -#define USB_KEEP_ALIVE_WKCTRL_WAKE_ON_THIS(x) (((uint8_t)(((uint8_t)(x)) << USB_KEEP_ALIVE_WKCTRL_WAKE_ON_THIS_SHIFT)) & USB_KEEP_ALIVE_WKCTRL_WAKE_ON_THIS_MASK) - -#define USB_KEEP_ALIVE_WKCTRL_WAKE_ENDPT_MASK (0xF0U) -#define USB_KEEP_ALIVE_WKCTRL_WAKE_ENDPT_SHIFT (4U) -/*! WAKE_ENDPT - Endpoint address for the wakeup request */ -#define USB_KEEP_ALIVE_WKCTRL_WAKE_ENDPT(x) (((uint8_t)(((uint8_t)(x)) << USB_KEEP_ALIVE_WKCTRL_WAKE_ENDPT_SHIFT)) & USB_KEEP_ALIVE_WKCTRL_WAKE_ENDPT_MASK) -/*! @} */ - -/*! @name MISCCTRL - Miscellaneous Control */ -/*! @{ */ - -#define USB_MISCCTRL_SOFDYNTHLD_MASK (0x1U) -#define USB_MISCCTRL_SOFDYNTHLD_SHIFT (0U) -/*! SOFDYNTHLD - Dynamic SOF Threshold Compare mode - * 0b0..When the byte-times SOF threshold is reached - * 0b1..When 8 byte-times SOF threshold is reached or overstepped - */ -#define USB_MISCCTRL_SOFDYNTHLD(x) (((uint8_t)(((uint8_t)(x)) << USB_MISCCTRL_SOFDYNTHLD_SHIFT)) & USB_MISCCTRL_SOFDYNTHLD_MASK) - -#define USB_MISCCTRL_SOFBUSSET_MASK (0x2U) -#define USB_MISCCTRL_SOFBUSSET_SHIFT (1U) -/*! SOFBUSSET - SOF_TOK Interrupt Generation Mode Select - * 0b0..According to the SOF threshold value - * 0b1..When the SOF counter reaches 0 - */ -#define USB_MISCCTRL_SOFBUSSET(x) (((uint8_t)(((uint8_t)(x)) << USB_MISCCTRL_SOFBUSSET_SHIFT)) & USB_MISCCTRL_SOFBUSSET_MASK) - -#define USB_MISCCTRL_OWNERRISODIS_MASK (0x4U) -#define USB_MISCCTRL_OWNERRISODIS_SHIFT (2U) -/*! OWNERRISODIS - OWN Error Detect for ISO IN and ISO OUT Disable - * 0b0..Enable - * 0b1..Disable - */ -#define USB_MISCCTRL_OWNERRISODIS(x) (((uint8_t)(((uint8_t)(x)) << USB_MISCCTRL_OWNERRISODIS_SHIFT)) & USB_MISCCTRL_OWNERRISODIS_MASK) - -#define USB_MISCCTRL_VREDG_EN_MASK (0x8U) -#define USB_MISCCTRL_VREDG_EN_SHIFT (3U) -/*! VREDG_EN - VREGIN Rising Edge Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_MISCCTRL_VREDG_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_MISCCTRL_VREDG_EN_SHIFT)) & USB_MISCCTRL_VREDG_EN_MASK) - -#define USB_MISCCTRL_VFEDG_EN_MASK (0x10U) -#define USB_MISCCTRL_VFEDG_EN_SHIFT (4U) -/*! VFEDG_EN - VREGIN Falling Edge Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_MISCCTRL_VFEDG_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_MISCCTRL_VFEDG_EN_SHIFT)) & USB_MISCCTRL_VFEDG_EN_MASK) - -#define USB_MISCCTRL_STL_ADJ_EN_MASK (0x80U) -#define USB_MISCCTRL_STL_ADJ_EN_SHIFT (7U) -/*! STL_ADJ_EN - USB Peripheral Mode Stall Adjust Enable - * 0b0..If ENDPTn[END_STALL] = 1, both IN and OUT directions for the associated endpoint stalls. - * 0b1..If ENDPTn[END_STALL] = 1, the STALL_xx_DIS registers control which directions for the associated endpoint stalls. - */ -#define USB_MISCCTRL_STL_ADJ_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_MISCCTRL_STL_ADJ_EN_SHIFT)) & USB_MISCCTRL_STL_ADJ_EN_MASK) -/*! @} */ - -/*! @name STALL_IL_DIS - Peripheral Mode Stall Disable for Endpoints 7 to 0 in IN Direction */ -/*! @{ */ - -#define USB_STALL_IL_DIS_STALL_I_DIS0_MASK (0x1U) -#define USB_STALL_IL_DIS_STALL_I_DIS0_SHIFT (0U) -/*! STALL_I_DIS0 - Disable Endpoint 0 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS0(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS0_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS0_MASK) - -#define USB_STALL_IL_DIS_STALL_I_DIS1_MASK (0x2U) -#define USB_STALL_IL_DIS_STALL_I_DIS1_SHIFT (1U) -/*! STALL_I_DIS1 - Disable Endpoint 1 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS1(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS1_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS1_MASK) - -#define USB_STALL_IL_DIS_STALL_I_DIS2_MASK (0x4U) -#define USB_STALL_IL_DIS_STALL_I_DIS2_SHIFT (2U) -/*! STALL_I_DIS2 - Disable Endpoint 2 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS2(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS2_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS2_MASK) - -#define USB_STALL_IL_DIS_STALL_I_DIS3_MASK (0x8U) -#define USB_STALL_IL_DIS_STALL_I_DIS3_SHIFT (3U) -/*! STALL_I_DIS3 - Disable Endpoint 3 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS3(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS3_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS3_MASK) - -#define USB_STALL_IL_DIS_STALL_I_DIS4_MASK (0x10U) -#define USB_STALL_IL_DIS_STALL_I_DIS4_SHIFT (4U) -/*! STALL_I_DIS4 - Disable Endpoint 4 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS4(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS4_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS4_MASK) - -#define USB_STALL_IL_DIS_STALL_I_DIS5_MASK (0x20U) -#define USB_STALL_IL_DIS_STALL_I_DIS5_SHIFT (5U) -/*! STALL_I_DIS5 - Disable Endpoint 5 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS5(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS5_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS5_MASK) - -#define USB_STALL_IL_DIS_STALL_I_DIS6_MASK (0x40U) -#define USB_STALL_IL_DIS_STALL_I_DIS6_SHIFT (6U) -/*! STALL_I_DIS6 - Disable Endpoint 6 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS6(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS6_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS6_MASK) - -#define USB_STALL_IL_DIS_STALL_I_DIS7_MASK (0x80U) -#define USB_STALL_IL_DIS_STALL_I_DIS7_SHIFT (7U) -/*! STALL_I_DIS7 - Disable Endpoint 7 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS7(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS7_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS7_MASK) -/*! @} */ - -/*! @name STALL_IH_DIS - Peripheral Mode Stall Disable for Endpoints 15 to 8 in IN Direction */ -/*! @{ */ - -#define USB_STALL_IH_DIS_STALL_I_DIS8_MASK (0x1U) -#define USB_STALL_IH_DIS_STALL_I_DIS8_SHIFT (0U) -/*! STALL_I_DIS8 - Disable Endpoint 8 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS8(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS8_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS8_MASK) - -#define USB_STALL_IH_DIS_STALL_I_DIS9_MASK (0x2U) -#define USB_STALL_IH_DIS_STALL_I_DIS9_SHIFT (1U) -/*! STALL_I_DIS9 - Disable Endpoint 9 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS9(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS9_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS9_MASK) - -#define USB_STALL_IH_DIS_STALL_I_DIS10_MASK (0x4U) -#define USB_STALL_IH_DIS_STALL_I_DIS10_SHIFT (2U) -/*! STALL_I_DIS10 - Disable Endpoint 10 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS10(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS10_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS10_MASK) - -#define USB_STALL_IH_DIS_STALL_I_DIS11_MASK (0x8U) -#define USB_STALL_IH_DIS_STALL_I_DIS11_SHIFT (3U) -/*! STALL_I_DIS11 - Disable Endpoint 11 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS11(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS11_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS11_MASK) - -#define USB_STALL_IH_DIS_STALL_I_DIS12_MASK (0x10U) -#define USB_STALL_IH_DIS_STALL_I_DIS12_SHIFT (4U) -/*! STALL_I_DIS12 - Disable Endpoint 12 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS12(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS12_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS12_MASK) - -#define USB_STALL_IH_DIS_STALL_I_DIS13_MASK (0x20U) -#define USB_STALL_IH_DIS_STALL_I_DIS13_SHIFT (5U) -/*! STALL_I_DIS13 - Disable Endpoint 13 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS13(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS13_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS13_MASK) - -#define USB_STALL_IH_DIS_STALL_I_DIS14_MASK (0x40U) -#define USB_STALL_IH_DIS_STALL_I_DIS14_SHIFT (6U) -/*! STALL_I_DIS14 - Disable Endpoint 14 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS14(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS14_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS14_MASK) - -#define USB_STALL_IH_DIS_STALL_I_DIS15_MASK (0x80U) -#define USB_STALL_IH_DIS_STALL_I_DIS15_SHIFT (7U) -/*! STALL_I_DIS15 - Disable Endpoint 15 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS15(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS15_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS15_MASK) -/*! @} */ - -/*! @name STALL_OL_DIS - Peripheral Mode Stall Disable for Endpoints 7 to 0 in OUT Direction */ -/*! @{ */ - -#define USB_STALL_OL_DIS_STALL_O_DIS0_MASK (0x1U) -#define USB_STALL_OL_DIS_STALL_O_DIS0_SHIFT (0U) -/*! STALL_O_DIS0 - Disable Endpoint 0 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS0(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS0_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS0_MASK) - -#define USB_STALL_OL_DIS_STALL_O_DIS1_MASK (0x2U) -#define USB_STALL_OL_DIS_STALL_O_DIS1_SHIFT (1U) -/*! STALL_O_DIS1 - Disable Endpoint 1 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS1(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS1_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS1_MASK) - -#define USB_STALL_OL_DIS_STALL_O_DIS2_MASK (0x4U) -#define USB_STALL_OL_DIS_STALL_O_DIS2_SHIFT (2U) -/*! STALL_O_DIS2 - Disable Endpoint 2 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS2(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS2_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS2_MASK) - -#define USB_STALL_OL_DIS_STALL_O_DIS3_MASK (0x8U) -#define USB_STALL_OL_DIS_STALL_O_DIS3_SHIFT (3U) -/*! STALL_O_DIS3 - Disable Endpoint 3 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS3(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS3_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS3_MASK) - -#define USB_STALL_OL_DIS_STALL_O_DIS4_MASK (0x10U) -#define USB_STALL_OL_DIS_STALL_O_DIS4_SHIFT (4U) -/*! STALL_O_DIS4 - Disable Endpoint 4 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS4(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS4_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS4_MASK) - -#define USB_STALL_OL_DIS_STALL_O_DIS5_MASK (0x20U) -#define USB_STALL_OL_DIS_STALL_O_DIS5_SHIFT (5U) -/*! STALL_O_DIS5 - Disable Endpoint 5 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS5(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS5_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS5_MASK) - -#define USB_STALL_OL_DIS_STALL_O_DIS6_MASK (0x40U) -#define USB_STALL_OL_DIS_STALL_O_DIS6_SHIFT (6U) -/*! STALL_O_DIS6 - Disable Endpoint 6 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS6(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS6_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS6_MASK) - -#define USB_STALL_OL_DIS_STALL_O_DIS7_MASK (0x80U) -#define USB_STALL_OL_DIS_STALL_O_DIS7_SHIFT (7U) -/*! STALL_O_DIS7 - Disable Endpoint 7 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS7(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS7_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS7_MASK) -/*! @} */ - -/*! @name STALL_OH_DIS - Peripheral Mode Stall Disable for Endpoints 15 to 8 in OUT Direction */ -/*! @{ */ - -#define USB_STALL_OH_DIS_STALL_O_DIS8_MASK (0x1U) -#define USB_STALL_OH_DIS_STALL_O_DIS8_SHIFT (0U) -/*! STALL_O_DIS8 - Disable Endpoint 8 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS8(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS8_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS8_MASK) - -#define USB_STALL_OH_DIS_STALL_O_DIS9_MASK (0x2U) -#define USB_STALL_OH_DIS_STALL_O_DIS9_SHIFT (1U) -/*! STALL_O_DIS9 - Disable Endpoint 9 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS9(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS9_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS9_MASK) - -#define USB_STALL_OH_DIS_STALL_O_DIS10_MASK (0x4U) -#define USB_STALL_OH_DIS_STALL_O_DIS10_SHIFT (2U) -/*! STALL_O_DIS10 - Disable Endpoint 10 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS10(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS10_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS10_MASK) - -#define USB_STALL_OH_DIS_STALL_O_DIS11_MASK (0x8U) -#define USB_STALL_OH_DIS_STALL_O_DIS11_SHIFT (3U) -/*! STALL_O_DIS11 - Disable Endpoint 11 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS11(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS11_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS11_MASK) - -#define USB_STALL_OH_DIS_STALL_O_DIS12_MASK (0x10U) -#define USB_STALL_OH_DIS_STALL_O_DIS12_SHIFT (4U) -/*! STALL_O_DIS12 - Disable endpoint 12 OUT direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS12(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS12_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS12_MASK) - -#define USB_STALL_OH_DIS_STALL_O_DIS13_MASK (0x20U) -#define USB_STALL_OH_DIS_STALL_O_DIS13_SHIFT (5U) -/*! STALL_O_DIS13 - Disable Endpoint 13 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS13(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS13_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS13_MASK) - -#define USB_STALL_OH_DIS_STALL_O_DIS14_MASK (0x40U) -#define USB_STALL_OH_DIS_STALL_O_DIS14_SHIFT (6U) -/*! STALL_O_DIS14 - Disable Endpoint 14 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS14(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS14_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS14_MASK) - -#define USB_STALL_OH_DIS_STALL_O_DIS15_MASK (0x80U) -#define USB_STALL_OH_DIS_STALL_O_DIS15_SHIFT (7U) -/*! STALL_O_DIS15 - Disable Endpoint 15 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS15(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS15_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS15_MASK) -/*! @} */ - -/*! @name CLK_RECOVER_CTRL - USB Clock Recovery Control */ -/*! @{ */ - -#define USB_CLK_RECOVER_CTRL_TRIM_INIT_VAL_SEL_MASK (0x8U) -#define USB_CLK_RECOVER_CTRL_TRIM_INIT_VAL_SEL_SHIFT (3U) -/*! TRIM_INIT_VAL_SEL - Selects the source for the initial FIRC trim fine value used after a reset. - * 0b0..Mid-scale - * 0b1..IFR - */ -#define USB_CLK_RECOVER_CTRL_TRIM_INIT_VAL_SEL(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_CTRL_TRIM_INIT_VAL_SEL_SHIFT)) & USB_CLK_RECOVER_CTRL_TRIM_INIT_VAL_SEL_MASK) - -#define USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN_MASK (0x20U) -#define USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN_SHIFT (5U) -/*! RESTART_IFRTRIM_EN - Restart from IFR Trim Value - * 0b0..Trim fine adjustment always works based on the previous updated trim fine value. - * 0b1..Trim fine restarts from the IFR trim value whenever you detect bus_reset or bus_resume or deassert module enable. - */ -#define USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN_SHIFT)) & USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN_MASK) - -#define USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN_MASK (0x40U) -#define USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN_SHIFT (6U) -/*! RESET_RESUME_ROUGH_EN - Reset or Resume to Rough Phase Enable - * 0b0..Always works in tracking phase after the first time rough phase, to track transition. - * 0b1..Go back to rough stage whenever a bus reset or bus resume occurs. - */ -#define USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN_SHIFT)) & USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN_MASK) - -#define USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN_MASK (0x80U) -#define USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN_SHIFT (7U) -/*! CLOCK_RECOVER_EN - Crystal-Less USB Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN_SHIFT)) & USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN_MASK) -/*! @} */ - -/*! @name CLK_RECOVER_IRC_EN - FIRC Oscillator Enable */ -/*! @{ */ - -#define USB_CLK_RECOVER_IRC_EN_IRC_EN_MASK (0x2U) -#define USB_CLK_RECOVER_IRC_EN_IRC_EN_SHIFT (1U) -/*! IRC_EN - Fast IRC enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_CLK_RECOVER_IRC_EN_IRC_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_IRC_EN_IRC_EN_SHIFT)) & USB_CLK_RECOVER_IRC_EN_IRC_EN_MASK) -/*! @} */ - -/*! @name CLK_RECOVER_INT_EN - Clock Recovery Combined Interrupt Enable */ -/*! @{ */ - -#define USB_CLK_RECOVER_INT_EN_OVF_ERROR_EN_MASK (0x10U) -#define USB_CLK_RECOVER_INT_EN_OVF_ERROR_EN_SHIFT (4U) -/*! OVF_ERROR_EN - Overflow error interrupt enable - * 0b0..The interrupt is masked - * 0b1..The interrupt is enabled - */ -#define USB_CLK_RECOVER_INT_EN_OVF_ERROR_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_INT_EN_OVF_ERROR_EN_SHIFT)) & USB_CLK_RECOVER_INT_EN_OVF_ERROR_EN_MASK) -/*! @} */ - -/*! @name CLK_RECOVER_INT_STATUS - Clock Recovery Separated Interrupt Status */ -/*! @{ */ - -#define USB_CLK_RECOVER_INT_STATUS_OVF_ERROR_MASK (0x10U) -#define USB_CLK_RECOVER_INT_STATUS_OVF_ERROR_SHIFT (4U) -/*! OVF_ERROR - Overflow Error Interrupt Status Flag - * 0b0..Interrupt did not occur - * 0b1..Unmasked interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_CLK_RECOVER_INT_STATUS_OVF_ERROR(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_INT_STATUS_OVF_ERROR_SHIFT)) & USB_CLK_RECOVER_INT_STATUS_OVF_ERROR_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group USB_Register_Masks */ - - -/* USB - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral USBFS0 base address */ - #define USBFS0_BASE (0x500DD000u) - /** Peripheral USBFS0 base address */ - #define USBFS0_BASE_NS (0x400DD000u) - /** Peripheral USBFS0 base pointer */ - #define USBFS0 ((USB_Type *)USBFS0_BASE) - /** Peripheral USBFS0 base pointer */ - #define USBFS0_NS ((USB_Type *)USBFS0_BASE_NS) - /** Array initializer of USB peripheral base addresses */ - #define USB_BASE_ADDRS { USBFS0_BASE } - /** Array initializer of USB peripheral base pointers */ - #define USB_BASE_PTRS { USBFS0 } - /** Array initializer of USB peripheral base addresses */ - #define USB_BASE_ADDRS_NS { USBFS0_BASE_NS } - /** Array initializer of USB peripheral base pointers */ - #define USB_BASE_PTRS_NS { USBFS0_NS } -#else - /** Peripheral USBFS0 base address */ - #define USBFS0_BASE (0x400DD000u) - /** Peripheral USBFS0 base pointer */ - #define USBFS0 ((USB_Type *)USBFS0_BASE) - /** Array initializer of USB peripheral base addresses */ - #define USB_BASE_ADDRS { USBFS0_BASE } - /** Array initializer of USB peripheral base pointers */ - #define USB_BASE_PTRS { USBFS0 } -#endif -/** Interrupt vectors for the USB peripheral type */ -#define USB_IRQS { USB0_FS_IRQn } -/* Backward compatibility */ -#define USBFS_IRQS USB_IRQS -#define USBFS_IRQHandler USB0_FS_IRQHandler - - -/*! - * @} - */ /* end of group USB_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- USBDCD Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USBDCD_Peripheral_Access_Layer USBDCD Peripheral Access Layer - * @{ - */ - -/** USBDCD - Register Layout Typedef */ -typedef struct { - __IO uint32_t CONTROL; /**< Control, offset: 0x0 */ - __IO uint32_t CLOCK; /**< Clock, offset: 0x4 */ - __I uint32_t STATUS; /**< Status, offset: 0x8 */ - __IO uint32_t SIGNAL_OVERRIDE; /**< Signal Override, offset: 0xC */ - __IO uint32_t TIMER0; /**< TIMER0, offset: 0x10 */ - __IO uint32_t TIMER1; /**< TIMER1, offset: 0x14 */ - union { /* offset: 0x18 */ - __IO uint32_t TIMER2_BC11; /**< TIMER2_BC11, offset: 0x18 */ - __IO uint32_t TIMER2_BC12; /**< TIMER2_BC12, offset: 0x18 */ - }; -} USBDCD_Type; - -/* ---------------------------------------------------------------------------- - -- USBDCD Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USBDCD_Register_Masks USBDCD Register Masks - * @{ - */ - -/*! @name CONTROL - Control */ -/*! @{ */ - -#define USBDCD_CONTROL_IACK_MASK (0x1U) -#define USBDCD_CONTROL_IACK_SHIFT (0U) -/*! IACK - Interrupt Acknowledge - * 0b0..Do not clear the interrupt. - * 0b1..Clear the IF field (interrupt flag). - */ -#define USBDCD_CONTROL_IACK(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_CONTROL_IACK_SHIFT)) & USBDCD_CONTROL_IACK_MASK) - -#define USBDCD_CONTROL_IF_MASK (0x100U) -#define USBDCD_CONTROL_IF_SHIFT (8U) -/*! IF - Interrupt Flag - * 0b0..No interrupt is pending. - * 0b1..An interrupt is pending. - */ -#define USBDCD_CONTROL_IF(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_CONTROL_IF_SHIFT)) & USBDCD_CONTROL_IF_MASK) - -#define USBDCD_CONTROL_IE_MASK (0x10000U) -#define USBDCD_CONTROL_IE_SHIFT (16U) -/*! IE - Interrupt Enable - * 0b0..Disable interrupts to the system. - * 0b1..Enable interrupts to the system. - */ -#define USBDCD_CONTROL_IE(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_CONTROL_IE_SHIFT)) & USBDCD_CONTROL_IE_MASK) - -#define USBDCD_CONTROL_BC12_MASK (0x20000U) -#define USBDCD_CONTROL_BC12_SHIFT (17U) -/*! BC12 - Battery Charging Revision 1.2 Compatibility - * 0b0..Compatible with BC1.1 - * 0b1..Compatible with BC1.2 (default) - */ -#define USBDCD_CONTROL_BC12(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_CONTROL_BC12_SHIFT)) & USBDCD_CONTROL_BC12_MASK) - -#define USBDCD_CONTROL_START_MASK (0x1000000U) -#define USBDCD_CONTROL_START_SHIFT (24U) -/*! START - Start Change Detection Sequence - * 0b0..Do not start the sequence. Writes of this value have no effect. - * 0b1..Initiate the charger detection sequence. If the sequence is already running, writes of this value have no effect. - */ -#define USBDCD_CONTROL_START(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_CONTROL_START_SHIFT)) & USBDCD_CONTROL_START_MASK) - -#define USBDCD_CONTROL_SR_MASK (0x2000000U) -#define USBDCD_CONTROL_SR_SHIFT (25U) -/*! SR - Software Reset - * 0b0..Do not perform a software reset. - * 0b1..Perform a software reset. - */ -#define USBDCD_CONTROL_SR(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_CONTROL_SR_SHIFT)) & USBDCD_CONTROL_SR_MASK) -/*! @} */ - -/*! @name CLOCK - Clock */ -/*! @{ */ - -#define USBDCD_CLOCK_CLOCK_UNIT_MASK (0x1U) -#define USBDCD_CLOCK_CLOCK_UNIT_SHIFT (0U) -/*! CLOCK_UNIT - Unit of Measurement Encoding for Clock Speed - * 0b0..kHz Speed (between 4 kHz and 1023 kHz) - * 0b1..MHz Speed (between 1 MHz and 1023 MHz) - */ -#define USBDCD_CLOCK_CLOCK_UNIT(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_CLOCK_CLOCK_UNIT_SHIFT)) & USBDCD_CLOCK_CLOCK_UNIT_MASK) - -#define USBDCD_CLOCK_CLOCK_SPEED_MASK (0xFFCU) -#define USBDCD_CLOCK_CLOCK_SPEED_SHIFT (2U) -/*! CLOCK_SPEED - Numerical Value of Clock Speed in Binary */ -#define USBDCD_CLOCK_CLOCK_SPEED(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_CLOCK_CLOCK_SPEED_SHIFT)) & USBDCD_CLOCK_CLOCK_SPEED_MASK) -/*! @} */ - -/*! @name STATUS - Status */ -/*! @{ */ - -#define USBDCD_STATUS_SEQ_RES_MASK (0x30000U) -#define USBDCD_STATUS_SEQ_RES_SHIFT (16U) -/*! SEQ_RES - Charger Detection Sequence Results - * 0b00..No results to report. - * 0b01..Attached to an SDP. Must comply with USB 2.0 by drawing only 2.5 mA (max) until connected. - * 0b10..Attached to a charging port. The exact meaning depends on the STATUS[SEQ_STAT] field (value 0: Attached - * to either a CDP or a DCP. The charger type detection has not completed. value 1: Attached to a CDP. The - * charger type detection has completed.) - * 0b11..Attached to a DCP. - */ -#define USBDCD_STATUS_SEQ_RES(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_STATUS_SEQ_RES_SHIFT)) & USBDCD_STATUS_SEQ_RES_MASK) - -#define USBDCD_STATUS_SEQ_STAT_MASK (0xC0000U) -#define USBDCD_STATUS_SEQ_STAT_SHIFT (18U) -/*! SEQ_STAT - Charger Detection Sequence Status - * 0b00..The module is either not enabled, or the module is enabled but the data pins have not yet been detected. - * 0b01..Data pin contact detection is complete. - * 0b10..Charging port detection is complete. - * 0b11..Charger type detection is complete. - */ -#define USBDCD_STATUS_SEQ_STAT(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_STATUS_SEQ_STAT_SHIFT)) & USBDCD_STATUS_SEQ_STAT_MASK) - -#define USBDCD_STATUS_ERR_MASK (0x100000U) -#define USBDCD_STATUS_ERR_SHIFT (20U) -/*! ERR - Error Flag - * 0b0..No sequence errors. - * 0b1..Error in the detection sequence. - */ -#define USBDCD_STATUS_ERR(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_STATUS_ERR_SHIFT)) & USBDCD_STATUS_ERR_MASK) - -#define USBDCD_STATUS_TO_MASK (0x200000U) -#define USBDCD_STATUS_TO_SHIFT (21U) -/*! TO - Timeout Flag - * 0b0..The detection sequence is not running for over 1 s. - * 0b1..It is over 1 s since the data pin contact was detected and debounced. - */ -#define USBDCD_STATUS_TO(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_STATUS_TO_SHIFT)) & USBDCD_STATUS_TO_MASK) - -#define USBDCD_STATUS_ACTIVE_MASK (0x400000U) -#define USBDCD_STATUS_ACTIVE_SHIFT (22U) -/*! ACTIVE - Active Status Indicator - * 0b0..The sequence is not running. - * 0b1..The sequence is running. - */ -#define USBDCD_STATUS_ACTIVE(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_STATUS_ACTIVE_SHIFT)) & USBDCD_STATUS_ACTIVE_MASK) -/*! @} */ - -/*! @name SIGNAL_OVERRIDE - Signal Override */ -/*! @{ */ - -#define USBDCD_SIGNAL_OVERRIDE_PS_MASK (0x7U) -#define USBDCD_SIGNAL_OVERRIDE_PS_SHIFT (0U) -/*! PS - Phase Selection - * 0b000..No overrides. Field must remain at this value during normal USB data communication to prevent - * unexpected conditions on USB_DP and USB_DM pins. (Default) - * 0b001..Reserved, not for customer use. - * 0b010..Enables VDP_SRC voltage source for the USB_DP pin and IDM_SINK current source for the USB_DM pin. - * 0b011..Reserved, not for customer use. - * 0b100..Enables VDM_SRC voltage source only. - * 0b101..Reserved, not for customer use. - * 0b110..Reserved, not for customer use. - * 0b111..Reserved, not for customer use. - */ -#define USBDCD_SIGNAL_OVERRIDE_PS(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_SIGNAL_OVERRIDE_PS_SHIFT)) & USBDCD_SIGNAL_OVERRIDE_PS_MASK) -/*! @} */ - -/*! @name TIMER0 - TIMER0 */ -/*! @{ */ - -#define USBDCD_TIMER0_TUNITCON_MASK (0xFFFU) -#define USBDCD_TIMER0_TUNITCON_SHIFT (0U) -/*! TUNITCON - Unit Connection Timer Elapse (in ms) */ -#define USBDCD_TIMER0_TUNITCON(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_TIMER0_TUNITCON_SHIFT)) & USBDCD_TIMER0_TUNITCON_MASK) - -#define USBDCD_TIMER0_TSEQ_INIT_MASK (0x3FF0000U) -#define USBDCD_TIMER0_TSEQ_INIT_SHIFT (16U) -/*! TSEQ_INIT - Sequence Initiation Time - * 0b0000000000-0b1111111111..0 ms - 1023 ms - */ -#define USBDCD_TIMER0_TSEQ_INIT(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_TIMER0_TSEQ_INIT_SHIFT)) & USBDCD_TIMER0_TSEQ_INIT_MASK) -/*! @} */ - -/*! @name TIMER1 - TIMER1 */ -/*! @{ */ - -#define USBDCD_TIMER1_TVDPSRC_ON_MASK (0x3FFU) -#define USBDCD_TIMER1_TVDPSRC_ON_SHIFT (0U) -/*! TVDPSRC_ON - Time Period Comparator Enabled - * 0b0000000001-0b1111111111..1 ms - 1023 ms - */ -#define USBDCD_TIMER1_TVDPSRC_ON(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_TIMER1_TVDPSRC_ON_SHIFT)) & USBDCD_TIMER1_TVDPSRC_ON_MASK) - -#define USBDCD_TIMER1_TDCD_DBNC_MASK (0x3FF0000U) -#define USBDCD_TIMER1_TDCD_DBNC_SHIFT (16U) -/*! TDCD_DBNC - Time Period to Debounce D+ Signal - * 0b0000000001-0b1111111111..1 ms - 1023 ms - */ -#define USBDCD_TIMER1_TDCD_DBNC(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_TIMER1_TDCD_DBNC_SHIFT)) & USBDCD_TIMER1_TDCD_DBNC_MASK) -/*! @} */ - -/*! @name TIMER2_BC11 - TIMER2_BC11 */ -/*! @{ */ - -#define USBDCD_TIMER2_BC11_CHECK_DM_MASK (0xFU) -#define USBDCD_TIMER2_BC11_CHECK_DM_SHIFT (0U) -/*! CHECK_DM - Time Before Check of D- Line - * 0b0001-0b1111..1 ms - 15 ms - */ -#define USBDCD_TIMER2_BC11_CHECK_DM(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_TIMER2_BC11_CHECK_DM_SHIFT)) & USBDCD_TIMER2_BC11_CHECK_DM_MASK) - -#define USBDCD_TIMER2_BC11_TVDPSRC_CON_MASK (0x3FF0000U) -#define USBDCD_TIMER2_BC11_TVDPSRC_CON_SHIFT (16U) -/*! TVDPSRC_CON - Time Period Before Enabling D+ Pullup - * 0b0000000001-0b1111111111..1 ms - 1023 ms - */ -#define USBDCD_TIMER2_BC11_TVDPSRC_CON(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_TIMER2_BC11_TVDPSRC_CON_SHIFT)) & USBDCD_TIMER2_BC11_TVDPSRC_CON_MASK) -/*! @} */ - -/*! @name TIMER2_BC12 - TIMER2_BC12 */ -/*! @{ */ - -#define USBDCD_TIMER2_BC12_TVDMSRC_ON_MASK (0x3FFU) -#define USBDCD_TIMER2_BC12_TVDMSRC_ON_SHIFT (0U) -/*! TVDMSRC_ON - TVDMSRC_ON - * 0b0000000000-0b0000101000..0 ms - 40 ms - */ -#define USBDCD_TIMER2_BC12_TVDMSRC_ON(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_TIMER2_BC12_TVDMSRC_ON_SHIFT)) & USBDCD_TIMER2_BC12_TVDMSRC_ON_MASK) - -#define USBDCD_TIMER2_BC12_TWAIT_AFTER_PRD_MASK (0x3FF0000U) -#define USBDCD_TIMER2_BC12_TWAIT_AFTER_PRD_SHIFT (16U) -/*! TWAIT_AFTER_PRD - TWAIT_AFTER_PRD - * 0b0000000001-0b1111111111..1 ms - 1023 ms - */ -#define USBDCD_TIMER2_BC12_TWAIT_AFTER_PRD(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_TIMER2_BC12_TWAIT_AFTER_PRD_SHIFT)) & USBDCD_TIMER2_BC12_TWAIT_AFTER_PRD_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group USBDCD_Register_Masks */ - - -/* USBDCD - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral USBDCD0 base address */ - #define USBDCD0_BASE (0x500DC000u) - /** Peripheral USBDCD0 base address */ - #define USBDCD0_BASE_NS (0x400DC000u) - /** Peripheral USBDCD0 base pointer */ - #define USBDCD0 ((USBDCD_Type *)USBDCD0_BASE) - /** Peripheral USBDCD0 base pointer */ - #define USBDCD0_NS ((USBDCD_Type *)USBDCD0_BASE_NS) - /** Array initializer of USBDCD peripheral base addresses */ - #define USBDCD_BASE_ADDRS { USBDCD0_BASE } - /** Array initializer of USBDCD peripheral base pointers */ - #define USBDCD_BASE_PTRS { USBDCD0 } - /** Array initializer of USBDCD peripheral base addresses */ - #define USBDCD_BASE_ADDRS_NS { USBDCD0_BASE_NS } - /** Array initializer of USBDCD peripheral base pointers */ - #define USBDCD_BASE_PTRS_NS { USBDCD0_NS } -#else - /** Peripheral USBDCD0 base address */ - #define USBDCD0_BASE (0x400DC000u) - /** Peripheral USBDCD0 base pointer */ - #define USBDCD0 ((USBDCD_Type *)USBDCD0_BASE) - /** Array initializer of USBDCD peripheral base addresses */ - #define USBDCD_BASE_ADDRS { USBDCD0_BASE } - /** Array initializer of USBDCD peripheral base pointers */ - #define USBDCD_BASE_PTRS { USBDCD0 } -#endif -/** Interrupt vectors for the USBDCD peripheral type */ -#define USBDCD_IRQS { USB0_DCD_IRQn } - -/*! - * @} - */ /* end of group USBDCD_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- USBHS Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USBHS_Peripheral_Access_Layer USBHS Peripheral Access Layer - * @{ - */ - -/** USBHS - Register Layout Typedef */ -typedef struct { - __I uint32_t ID; /**< Identification, offset: 0x0 */ - __I uint32_t HWGENERAL; /**< Hardware General, offset: 0x4 */ - __I uint32_t HWHOST; /**< Host Hardware Parameters, offset: 0x8 */ - __I uint32_t HWDEVICE; /**< Device Hardware Parameters, offset: 0xC */ - __I uint32_t HWTXBUF; /**< TX Buffer Hardware Parameters, offset: 0x10 */ - __I uint32_t HWRXBUF; /**< RX Buffer Hardware Parameters, offset: 0x14 */ - uint8_t RESERVED_0[104]; - __IO uint32_t GPTIMER0LD; /**< General Purpose Timer #0 Load, offset: 0x80 */ - __IO uint32_t GPTIMER0CTRL; /**< General Purpose Timer #0 Controller, offset: 0x84 */ - __IO uint32_t GPTIMER1LD; /**< General Purpose Timer #1 Load, offset: 0x88 */ - __IO uint32_t GPTIMER1CTRL; /**< General Purpose Timer #1 Controller, offset: 0x8C */ - __IO uint32_t SBUSCFG; /**< System Bus Config, offset: 0x90 */ - uint8_t RESERVED_1[108]; - __I uint8_t CAPLENGTH; /**< Capability Registers Length, offset: 0x100 */ - uint8_t RESERVED_2[1]; - __I uint16_t HCIVERSION; /**< Host Controller Interface Version, offset: 0x102 */ - __I uint32_t HCSPARAMS; /**< Host Controller Structural Parameters, offset: 0x104 */ - __I uint32_t HCCPARAMS; /**< Host Controller Capability Parameters, offset: 0x108 */ - uint8_t RESERVED_3[20]; - __I uint16_t DCIVERSION; /**< Device Controller Interface Version, offset: 0x120 */ - uint8_t RESERVED_4[2]; - __I uint32_t DCCPARAMS; /**< Device Controller Capability Parameters, offset: 0x124 */ - uint8_t RESERVED_5[24]; - __IO uint32_t USBCMD; /**< USB Command, offset: 0x140 */ - __IO uint32_t USBSTS; /**< USB Status, offset: 0x144 */ - __IO uint32_t USBINTR; /**< Interrupt Enable, offset: 0x148 */ - __IO uint32_t FRINDEX; /**< USB Frame Index, offset: 0x14C */ - uint8_t RESERVED_6[4]; - union { /* offset: 0x154 */ - __IO uint32_t DEVICEADDR; /**< Device Address, offset: 0x154 */ - __IO uint32_t PERIODICLISTBASE; /**< Frame List Base Address, offset: 0x154 */ - }; - union { /* offset: 0x158 */ - __IO uint32_t ASYNCLISTADDR; /**< Next Asynch. Address, offset: 0x158 */ - __IO uint32_t ENDPTLISTADDR; /**< Endpoint List Address, offset: 0x158 */ - }; - uint8_t RESERVED_7[4]; - __IO uint32_t BURSTSIZE; /**< Programmable Burst Size, offset: 0x160 */ - __IO uint32_t TXFILLTUNING; /**< TX FIFO Fill Tuning, offset: 0x164 */ - uint8_t RESERVED_8[16]; - __IO uint32_t ENDPTNAK; /**< Endpoint NAK, offset: 0x178 */ - __IO uint32_t ENDPTNAKEN; /**< Endpoint NAK Enable, offset: 0x17C */ - __I uint32_t CONFIGFLAG; /**< Configure Flag, offset: 0x180 */ - __IO uint32_t PORTSC1; /**< Port Status & Control, offset: 0x184 */ - uint8_t RESERVED_9[28]; - __IO uint32_t OTGSC; /**< On-The-Go Status & Control, offset: 0x1A4 */ - __IO uint32_t USBMODE; /**< USB Device Mode, offset: 0x1A8 */ - __IO uint32_t ENDPTSETUPSTAT; /**< Endpoint Setup Status, offset: 0x1AC */ - __IO uint32_t ENDPTPRIME; /**< Endpoint Prime, offset: 0x1B0 */ - __IO uint32_t ENDPTFLUSH; /**< Endpoint Flush, offset: 0x1B4 */ - __I uint32_t ENDPTSTAT; /**< Endpoint Status, offset: 0x1B8 */ - __IO uint32_t ENDPTCOMPLETE; /**< Endpoint Complete, offset: 0x1BC */ - __IO uint32_t ENDPTCTRL0; /**< Endpoint Control 0, offset: 0x1C0 */ - __IO uint32_t ENDPTCTRL[7]; /**< Endpoint Control 1..Endpoint Control 7, array offset: 0x1C4, array step: 0x4 */ -} USBHS_Type; - -/* ---------------------------------------------------------------------------- - -- USBHS Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USBHS_Register_Masks USBHS Register Masks - * @{ - */ - -/*! @name ID - Identification */ -/*! @{ */ - -#define USBHS_ID_ID_MASK (0x3FU) -#define USBHS_ID_ID_SHIFT (0U) -/*! ID - Configuration Number */ -#define USBHS_ID_ID(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ID_ID_SHIFT)) & USBHS_ID_ID_MASK) - -#define USBHS_ID_NID_MASK (0x3F00U) -#define USBHS_ID_NID_SHIFT (8U) -/*! NID - Complement Version of ID */ -#define USBHS_ID_NID(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ID_NID_SHIFT)) & USBHS_ID_NID_MASK) - -#define USBHS_ID_REVISION_MASK (0xFF0000U) -#define USBHS_ID_REVISION_SHIFT (16U) -/*! REVISION - Revision Number of the Controller Core */ -#define USBHS_ID_REVISION(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ID_REVISION_SHIFT)) & USBHS_ID_REVISION_MASK) -/*! @} */ - -/*! @name HWGENERAL - Hardware General */ -/*! @{ */ - -#define USBHS_HWGENERAL_PHYW_MASK (0x30U) -#define USBHS_HWGENERAL_PHYW_SHIFT (4U) -/*! PHYW - Data width of the transceiver connected to the controller core - * 0b00..8 bit wide data bus (Software non-programmable) - * 0b01..16 bit wide data bus (Software non-programmable) - * 0b10..Reset to 8 bit wide data bus (Software programmable) - * 0b11..Reset to 16 bit wide data bus (Software programmable) - */ -#define USBHS_HWGENERAL_PHYW(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWGENERAL_PHYW_SHIFT)) & USBHS_HWGENERAL_PHYW_MASK) - -#define USBHS_HWGENERAL_PHYM_MASK (0x1C0U) -#define USBHS_HWGENERAL_PHYM_SHIFT (6U) -/*! PHYM - Transceiver Type - * 0b000..UTMI/UMTI+ - * 0b001..ULPI DDR - * 0b010..ULPI - * 0b011..Serial Only - * 0b100..Software programmable - reset to UTMI/UTMI+ - * 0b101..Software programmable - reset to ULPI DDR - * 0b110..Software programmable - reset to ULPI - * 0b111..Software programmable - reset to Serial - */ -#define USBHS_HWGENERAL_PHYM(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWGENERAL_PHYM_SHIFT)) & USBHS_HWGENERAL_PHYM_MASK) - -#define USBHS_HWGENERAL_SM_MASK (0x600U) -#define USBHS_HWGENERAL_SM_SHIFT (9U) -/*! SM - Serial interface mode capability - * 0b00..No Serial Engine, always use parallel signalling - * 0b01..Serial Engine present, always use serial signalling for FS/LS - * 0b10..Software programmable - Reset to use parallel signalling for FS/LS - * 0b11..Software programmable - Reset to use serial signalling for FS/LS - */ -#define USBHS_HWGENERAL_SM(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWGENERAL_SM_SHIFT)) & USBHS_HWGENERAL_SM_MASK) -/*! @} */ - -/*! @name HWHOST - Host Hardware Parameters */ -/*! @{ */ - -#define USBHS_HWHOST_HC_MASK (0x1U) -#define USBHS_HWHOST_HC_SHIFT (0U) -/*! HC - Host Capable - * 0b1..Supported - * 0b0..Not supported - */ -#define USBHS_HWHOST_HC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWHOST_HC_SHIFT)) & USBHS_HWHOST_HC_MASK) - -#define USBHS_HWHOST_NPORT_MASK (0xEU) -#define USBHS_HWHOST_NPORT_SHIFT (1U) -/*! NPORT - The Number of downstream ports supported by the host controller is (NPORT+1) */ -#define USBHS_HWHOST_NPORT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWHOST_NPORT_SHIFT)) & USBHS_HWHOST_NPORT_MASK) -/*! @} */ - -/*! @name HWDEVICE - Device Hardware Parameters */ -/*! @{ */ - -#define USBHS_HWDEVICE_DC_MASK (0x1U) -#define USBHS_HWDEVICE_DC_SHIFT (0U) -/*! DC - Device Capable - * 0b1..Supported - * 0b0..Not supported - */ -#define USBHS_HWDEVICE_DC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWDEVICE_DC_SHIFT)) & USBHS_HWDEVICE_DC_MASK) - -#define USBHS_HWDEVICE_DEVEP_MASK (0x3EU) -#define USBHS_HWDEVICE_DEVEP_SHIFT (1U) -/*! DEVEP - Device Endpoint Number */ -#define USBHS_HWDEVICE_DEVEP(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWDEVICE_DEVEP_SHIFT)) & USBHS_HWDEVICE_DEVEP_MASK) -/*! @} */ - -/*! @name HWTXBUF - TX Buffer Hardware Parameters */ -/*! @{ */ - -#define USBHS_HWTXBUF_TXBURST_MASK (0xFFU) -#define USBHS_HWTXBUF_TXBURST_SHIFT (0U) -/*! TXBURST - Default burst size for memory to TX buffer transfer */ -#define USBHS_HWTXBUF_TXBURST(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWTXBUF_TXBURST_SHIFT)) & USBHS_HWTXBUF_TXBURST_MASK) - -#define USBHS_HWTXBUF_TXCHANADD_MASK (0xFF0000U) -#define USBHS_HWTXBUF_TXCHANADD_SHIFT (16U) -/*! TXCHANADD - TX FIFO Buffer size is: (2^TXCHANADD) * 4 Bytes */ -#define USBHS_HWTXBUF_TXCHANADD(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWTXBUF_TXCHANADD_SHIFT)) & USBHS_HWTXBUF_TXCHANADD_MASK) -/*! @} */ - -/*! @name HWRXBUF - RX Buffer Hardware Parameters */ -/*! @{ */ - -#define USBHS_HWRXBUF_RXBURST_MASK (0xFFU) -#define USBHS_HWRXBUF_RXBURST_SHIFT (0U) -/*! RXBURST - Default burst size for memory to RX buffer transfer */ -#define USBHS_HWRXBUF_RXBURST(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWRXBUF_RXBURST_SHIFT)) & USBHS_HWRXBUF_RXBURST_MASK) - -#define USBHS_HWRXBUF_RXADD_MASK (0xFF00U) -#define USBHS_HWRXBUF_RXADD_SHIFT (8U) -/*! RXADD - Buffer total size for all receive endpoints is (2^RXADD) */ -#define USBHS_HWRXBUF_RXADD(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWRXBUF_RXADD_SHIFT)) & USBHS_HWRXBUF_RXADD_MASK) -/*! @} */ - -/*! @name GPTIMER0LD - General Purpose Timer #0 Load */ -/*! @{ */ - -#define USBHS_GPTIMER0LD_GPTLD_MASK (0xFFFFFFU) -#define USBHS_GPTIMER0LD_GPTLD_SHIFT (0U) -/*! GPTLD - General Purpose Timer Load Value */ -#define USBHS_GPTIMER0LD_GPTLD(x) (((uint32_t)(((uint32_t)(x)) << USBHS_GPTIMER0LD_GPTLD_SHIFT)) & USBHS_GPTIMER0LD_GPTLD_MASK) -/*! @} */ - -/*! @name GPTIMER0CTRL - General Purpose Timer #0 Controller */ -/*! @{ */ - -#define USBHS_GPTIMER0CTRL_GPTCNT_MASK (0xFFFFFFU) -#define USBHS_GPTIMER0CTRL_GPTCNT_SHIFT (0U) -/*! GPTCNT - General Purpose Timer Counter */ -#define USBHS_GPTIMER0CTRL_GPTCNT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_GPTIMER0CTRL_GPTCNT_SHIFT)) & USBHS_GPTIMER0CTRL_GPTCNT_MASK) - -#define USBHS_GPTIMER0CTRL_GPTMODE_MASK (0x1000000U) -#define USBHS_GPTIMER0CTRL_GPTMODE_SHIFT (24U) -/*! GPTMODE - General Purpose Timer Mode - * 0b0..One Shot Mode - * 0b1..Repeat Mode - */ -#define USBHS_GPTIMER0CTRL_GPTMODE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_GPTIMER0CTRL_GPTMODE_SHIFT)) & USBHS_GPTIMER0CTRL_GPTMODE_MASK) - -#define USBHS_GPTIMER0CTRL_GPTRST_MASK (0x40000000U) -#define USBHS_GPTIMER0CTRL_GPTRST_SHIFT (30U) -/*! GPTRST - General Purpose Timer Reset - * 0b0..No action - * 0b1..Load counter value from GPTLD bits in n_GPTIMER0LD - */ -#define USBHS_GPTIMER0CTRL_GPTRST(x) (((uint32_t)(((uint32_t)(x)) << USBHS_GPTIMER0CTRL_GPTRST_SHIFT)) & USBHS_GPTIMER0CTRL_GPTRST_MASK) - -#define USBHS_GPTIMER0CTRL_GPTRUN_MASK (0x80000000U) -#define USBHS_GPTIMER0CTRL_GPTRUN_SHIFT (31U) -/*! GPTRUN - General Purpose Timer Run - * 0b0..Stop counting - * 0b1..Run - */ -#define USBHS_GPTIMER0CTRL_GPTRUN(x) (((uint32_t)(((uint32_t)(x)) << USBHS_GPTIMER0CTRL_GPTRUN_SHIFT)) & USBHS_GPTIMER0CTRL_GPTRUN_MASK) -/*! @} */ - -/*! @name GPTIMER1LD - General Purpose Timer #1 Load */ -/*! @{ */ - -#define USBHS_GPTIMER1LD_GPTLD_MASK (0xFFFFFFU) -#define USBHS_GPTIMER1LD_GPTLD_SHIFT (0U) -/*! GPTLD - General Purpose Timer Load Value */ -#define USBHS_GPTIMER1LD_GPTLD(x) (((uint32_t)(((uint32_t)(x)) << USBHS_GPTIMER1LD_GPTLD_SHIFT)) & USBHS_GPTIMER1LD_GPTLD_MASK) -/*! @} */ - -/*! @name GPTIMER1CTRL - General Purpose Timer #1 Controller */ -/*! @{ */ - -#define USBHS_GPTIMER1CTRL_GPTCNT_MASK (0xFFFFFFU) -#define USBHS_GPTIMER1CTRL_GPTCNT_SHIFT (0U) -/*! GPTCNT - General Purpose Timer Counter */ -#define USBHS_GPTIMER1CTRL_GPTCNT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_GPTIMER1CTRL_GPTCNT_SHIFT)) & USBHS_GPTIMER1CTRL_GPTCNT_MASK) - -#define USBHS_GPTIMER1CTRL_GPTMODE_MASK (0x1000000U) -#define USBHS_GPTIMER1CTRL_GPTMODE_SHIFT (24U) -/*! GPTMODE - General Purpose Timer Mode - * 0b0..One Shot Mode - * 0b1..Repeat Mode - */ -#define USBHS_GPTIMER1CTRL_GPTMODE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_GPTIMER1CTRL_GPTMODE_SHIFT)) & USBHS_GPTIMER1CTRL_GPTMODE_MASK) - -#define USBHS_GPTIMER1CTRL_GPTRST_MASK (0x40000000U) -#define USBHS_GPTIMER1CTRL_GPTRST_SHIFT (30U) -/*! GPTRST - General Purpose Timer Reset - * 0b0..No action - * 0b1..Load counter value from GPTLD bits in USB_n_GPTIMER0LD - */ -#define USBHS_GPTIMER1CTRL_GPTRST(x) (((uint32_t)(((uint32_t)(x)) << USBHS_GPTIMER1CTRL_GPTRST_SHIFT)) & USBHS_GPTIMER1CTRL_GPTRST_MASK) - -#define USBHS_GPTIMER1CTRL_GPTRUN_MASK (0x80000000U) -#define USBHS_GPTIMER1CTRL_GPTRUN_SHIFT (31U) -/*! GPTRUN - General Purpose Timer Run - * 0b0..Stop counting - * 0b1..Run - */ -#define USBHS_GPTIMER1CTRL_GPTRUN(x) (((uint32_t)(((uint32_t)(x)) << USBHS_GPTIMER1CTRL_GPTRUN_SHIFT)) & USBHS_GPTIMER1CTRL_GPTRUN_MASK) -/*! @} */ - -/*! @name SBUSCFG - System Bus Config */ -/*! @{ */ - -#define USBHS_SBUSCFG_AHBBRST_MASK (0x7U) -#define USBHS_SBUSCFG_AHBBRST_SHIFT (0U) -/*! AHBBRST - AHB master interface Burst configuration - * 0b000..Incremental burst of unspecified length only - * 0b001..INCR4 burst, then single transfer - * 0b010..INCR8 burst, INCR4 burst, then single transfer - * 0b011..INCR16 burst, INCR8 burst, INCR4 burst, then single transfer - * 0b100..Reserved, don't use - * 0b101..INCR4 burst, then incremental burst of unspecified length - * 0b110..INCR8 burst, INCR4 burst, then incremental burst of unspecified length - * 0b111..INCR16 burst, INCR8 burst, INCR4 burst, then incremental burst of unspecified length - */ -#define USBHS_SBUSCFG_AHBBRST(x) (((uint32_t)(((uint32_t)(x)) << USBHS_SBUSCFG_AHBBRST_SHIFT)) & USBHS_SBUSCFG_AHBBRST_MASK) -/*! @} */ - -/*! @name CAPLENGTH - Capability Registers Length */ -/*! @{ */ - -#define USBHS_CAPLENGTH_CAPLENGTH_MASK (0xFFU) -#define USBHS_CAPLENGTH_CAPLENGTH_SHIFT (0U) -/*! CAPLENGTH - These bits are used as an offset to add to register base to find the beginning of - * the Operational Register. Default value is '40h'. - */ -#define USBHS_CAPLENGTH_CAPLENGTH(x) (((uint8_t)(((uint8_t)(x)) << USBHS_CAPLENGTH_CAPLENGTH_SHIFT)) & USBHS_CAPLENGTH_CAPLENGTH_MASK) -/*! @} */ - -/*! @name HCIVERSION - Host Controller Interface Version */ -/*! @{ */ - -#define USBHS_HCIVERSION_HCIVERSION_MASK (0xFFFFU) -#define USBHS_HCIVERSION_HCIVERSION_SHIFT (0U) -/*! HCIVERSION - Host Controller Interface Version Number */ -#define USBHS_HCIVERSION_HCIVERSION(x) (((uint16_t)(((uint16_t)(x)) << USBHS_HCIVERSION_HCIVERSION_SHIFT)) & USBHS_HCIVERSION_HCIVERSION_MASK) -/*! @} */ - -/*! @name HCSPARAMS - Host Controller Structural Parameters */ -/*! @{ */ - -#define USBHS_HCSPARAMS_N_PORTS_MASK (0xFU) -#define USBHS_HCSPARAMS_N_PORTS_SHIFT (0U) -/*! N_PORTS - Number of Downstream Ports */ -#define USBHS_HCSPARAMS_N_PORTS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCSPARAMS_N_PORTS_SHIFT)) & USBHS_HCSPARAMS_N_PORTS_MASK) - -#define USBHS_HCSPARAMS_PPC_MASK (0x10U) -#define USBHS_HCSPARAMS_PPC_SHIFT (4U) -/*! PPC - Port Power Control */ -#define USBHS_HCSPARAMS_PPC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCSPARAMS_PPC_SHIFT)) & USBHS_HCSPARAMS_PPC_MASK) - -#define USBHS_HCSPARAMS_N_PCC_MASK (0xF00U) -#define USBHS_HCSPARAMS_N_PCC_SHIFT (8U) -/*! N_PCC - Number of Ports per Companion Controller */ -#define USBHS_HCSPARAMS_N_PCC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCSPARAMS_N_PCC_SHIFT)) & USBHS_HCSPARAMS_N_PCC_MASK) - -#define USBHS_HCSPARAMS_N_CC_MASK (0xF000U) -#define USBHS_HCSPARAMS_N_CC_SHIFT (12U) -/*! N_CC - Number of Companion Controller - * 0b0000..There is no internal Companion Controller and port-ownership hand-off is not supported - * 0b0001..There are internal companion controller(s) and port-ownership hand-offs is supported - */ -#define USBHS_HCSPARAMS_N_CC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCSPARAMS_N_CC_SHIFT)) & USBHS_HCSPARAMS_N_CC_MASK) - -#define USBHS_HCSPARAMS_PI_MASK (0x10000U) -#define USBHS_HCSPARAMS_PI_SHIFT (16U) -/*! PI - Port Indicators (P INDICATOR) */ -#define USBHS_HCSPARAMS_PI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCSPARAMS_PI_SHIFT)) & USBHS_HCSPARAMS_PI_MASK) - -#define USBHS_HCSPARAMS_N_PTT_MASK (0xF00000U) -#define USBHS_HCSPARAMS_N_PTT_SHIFT (20U) -/*! N_PTT - Number of Ports per Transaction Translator */ -#define USBHS_HCSPARAMS_N_PTT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCSPARAMS_N_PTT_SHIFT)) & USBHS_HCSPARAMS_N_PTT_MASK) - -#define USBHS_HCSPARAMS_N_TT_MASK (0xF000000U) -#define USBHS_HCSPARAMS_N_TT_SHIFT (24U) -/*! N_TT - Number of Transaction Translators */ -#define USBHS_HCSPARAMS_N_TT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCSPARAMS_N_TT_SHIFT)) & USBHS_HCSPARAMS_N_TT_MASK) -/*! @} */ - -/*! @name HCCPARAMS - Host Controller Capability Parameters */ -/*! @{ */ - -#define USBHS_HCCPARAMS_ADC_MASK (0x1U) -#define USBHS_HCCPARAMS_ADC_SHIFT (0U) -/*! ADC - 64-bit Addressing Capability */ -#define USBHS_HCCPARAMS_ADC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCCPARAMS_ADC_SHIFT)) & USBHS_HCCPARAMS_ADC_MASK) - -#define USBHS_HCCPARAMS_PFL_MASK (0x2U) -#define USBHS_HCCPARAMS_PFL_SHIFT (1U) -/*! PFL - Programmable Frame List Flag */ -#define USBHS_HCCPARAMS_PFL(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCCPARAMS_PFL_SHIFT)) & USBHS_HCCPARAMS_PFL_MASK) - -#define USBHS_HCCPARAMS_ASP_MASK (0x4U) -#define USBHS_HCCPARAMS_ASP_SHIFT (2U) -/*! ASP - Asynchronous Schedule Park Capability */ -#define USBHS_HCCPARAMS_ASP(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCCPARAMS_ASP_SHIFT)) & USBHS_HCCPARAMS_ASP_MASK) - -#define USBHS_HCCPARAMS_IST_MASK (0xF0U) -#define USBHS_HCCPARAMS_IST_SHIFT (4U) -/*! IST - Isochronous Scheduling Threshold */ -#define USBHS_HCCPARAMS_IST(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCCPARAMS_IST_SHIFT)) & USBHS_HCCPARAMS_IST_MASK) - -#define USBHS_HCCPARAMS_EECP_MASK (0xFF00U) -#define USBHS_HCCPARAMS_EECP_SHIFT (8U) -/*! EECP - EHCI Extended Capabilities Pointer */ -#define USBHS_HCCPARAMS_EECP(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCCPARAMS_EECP_SHIFT)) & USBHS_HCCPARAMS_EECP_MASK) -/*! @} */ - -/*! @name DCIVERSION - Device Controller Interface Version */ -/*! @{ */ - -#define USBHS_DCIVERSION_DCIVERSION_MASK (0xFFFFU) -#define USBHS_DCIVERSION_DCIVERSION_SHIFT (0U) -/*! DCIVERSION - Device Controller Interface Version Number */ -#define USBHS_DCIVERSION_DCIVERSION(x) (((uint16_t)(((uint16_t)(x)) << USBHS_DCIVERSION_DCIVERSION_SHIFT)) & USBHS_DCIVERSION_DCIVERSION_MASK) -/*! @} */ - -/*! @name DCCPARAMS - Device Controller Capability Parameters */ -/*! @{ */ - -#define USBHS_DCCPARAMS_DEN_MASK (0x1FU) -#define USBHS_DCCPARAMS_DEN_SHIFT (0U) -/*! DEN - Device Endpoint Number */ -#define USBHS_DCCPARAMS_DEN(x) (((uint32_t)(((uint32_t)(x)) << USBHS_DCCPARAMS_DEN_SHIFT)) & USBHS_DCCPARAMS_DEN_MASK) - -#define USBHS_DCCPARAMS_DC_MASK (0x80U) -#define USBHS_DCCPARAMS_DC_SHIFT (7U) -/*! DC - Device Capable */ -#define USBHS_DCCPARAMS_DC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_DCCPARAMS_DC_SHIFT)) & USBHS_DCCPARAMS_DC_MASK) - -#define USBHS_DCCPARAMS_HC_MASK (0x100U) -#define USBHS_DCCPARAMS_HC_SHIFT (8U) -/*! HC - Host Capable */ -#define USBHS_DCCPARAMS_HC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_DCCPARAMS_HC_SHIFT)) & USBHS_DCCPARAMS_HC_MASK) -/*! @} */ - -/*! @name USBCMD - USB Command */ -/*! @{ */ - -#define USBHS_USBCMD_RS_MASK (0x1U) -#define USBHS_USBCMD_RS_SHIFT (0U) -/*! RS - Run/Stop - * 0b0..Stop - * 0b1..Run - */ -#define USBHS_USBCMD_RS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_RS_SHIFT)) & USBHS_USBCMD_RS_MASK) - -#define USBHS_USBCMD_RST_MASK (0x2U) -#define USBHS_USBCMD_RST_SHIFT (1U) -/*! RST - Controller Reset */ -#define USBHS_USBCMD_RST(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_RST_SHIFT)) & USBHS_USBCMD_RST_MASK) - -#define USBHS_USBCMD_FS_1_MASK (0xCU) -#define USBHS_USBCMD_FS_1_SHIFT (2U) -/*! FS_1 - Frame List Size */ -#define USBHS_USBCMD_FS_1(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_FS_1_SHIFT)) & USBHS_USBCMD_FS_1_MASK) - -#define USBHS_USBCMD_PSE_MASK (0x10U) -#define USBHS_USBCMD_PSE_SHIFT (4U) -/*! PSE - Periodic Schedule Enable - * 0b0..Do not process the Periodic Schedule - * 0b1..Use the PERIODICLISTBASE register to access the Periodic Schedule - */ -#define USBHS_USBCMD_PSE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_PSE_SHIFT)) & USBHS_USBCMD_PSE_MASK) - -#define USBHS_USBCMD_ASE_MASK (0x20U) -#define USBHS_USBCMD_ASE_SHIFT (5U) -/*! ASE - Asynchronous Schedule Enable - * 0b0..Do not process the Asynchronous Schedule - * 0b1..Use the ASYNCLISTADDR register to access the Asynchronous Schedule - */ -#define USBHS_USBCMD_ASE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_ASE_SHIFT)) & USBHS_USBCMD_ASE_MASK) - -#define USBHS_USBCMD_IAA_MASK (0x40U) -#define USBHS_USBCMD_IAA_SHIFT (6U) -/*! IAA - Interrupt on Async Advance Doorbell */ -#define USBHS_USBCMD_IAA(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_IAA_SHIFT)) & USBHS_USBCMD_IAA_MASK) - -#define USBHS_USBCMD_ASP_MASK (0x300U) -#define USBHS_USBCMD_ASP_SHIFT (8U) -/*! ASP - Asynchronous Schedule Park Mode Count */ -#define USBHS_USBCMD_ASP(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_ASP_SHIFT)) & USBHS_USBCMD_ASP_MASK) - -#define USBHS_USBCMD_ASPE_MASK (0x800U) -#define USBHS_USBCMD_ASPE_SHIFT (11U) -/*! ASPE - Asynchronous Schedule Park Mode Enable */ -#define USBHS_USBCMD_ASPE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_ASPE_SHIFT)) & USBHS_USBCMD_ASPE_MASK) - -#define USBHS_USBCMD_SUTW_MASK (0x2000U) -#define USBHS_USBCMD_SUTW_SHIFT (13U) -/*! SUTW - Setup TripWire [device mode only] */ -#define USBHS_USBCMD_SUTW(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_SUTW_SHIFT)) & USBHS_USBCMD_SUTW_MASK) - -#define USBHS_USBCMD_ATDTW_MASK (0x4000U) -#define USBHS_USBCMD_ATDTW_SHIFT (14U) -/*! ATDTW - Add dTD TripWire[device mode only] */ -#define USBHS_USBCMD_ATDTW(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_ATDTW_SHIFT)) & USBHS_USBCMD_ATDTW_MASK) - -#define USBHS_USBCMD_FS_2_MASK (0x8000U) -#define USBHS_USBCMD_FS_2_SHIFT (15U) -/*! FS_2 - Frame List Size [host mode only] */ -#define USBHS_USBCMD_FS_2(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_FS_2_SHIFT)) & USBHS_USBCMD_FS_2_MASK) - -#define USBHS_USBCMD_ITC_MASK (0xFF0000U) -#define USBHS_USBCMD_ITC_SHIFT (16U) -/*! ITC - Interrupt Threshold Control - * 0b00000000..Immediate (no threshold) - * 0b00000001..1 micro-frame - * 0b00000010..2 micro-frames - * 0b00000100..4 micro-frames - * 0b00001000..8 micro-frames - * 0b00010000..16 micro-frames - * 0b00100000..32 micro-frames - * 0b01000000..64 micro-frames - */ -#define USBHS_USBCMD_ITC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_ITC_SHIFT)) & USBHS_USBCMD_ITC_MASK) -/*! @} */ - -/*! @name USBSTS - USB Status */ -/*! @{ */ - -#define USBHS_USBSTS_UI_MASK (0x1U) -#define USBHS_USBSTS_UI_SHIFT (0U) -/*! UI - USB Interrupt (USBINT) */ -#define USBHS_USBSTS_UI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_UI_SHIFT)) & USBHS_USBSTS_UI_MASK) - -#define USBHS_USBSTS_UEI_MASK (0x2U) -#define USBHS_USBSTS_UEI_SHIFT (1U) -/*! UEI - USB Error Interrupt (USBERRINT) */ -#define USBHS_USBSTS_UEI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_UEI_SHIFT)) & USBHS_USBSTS_UEI_MASK) - -#define USBHS_USBSTS_PCI_MASK (0x4U) -#define USBHS_USBSTS_PCI_SHIFT (2U) -/*! PCI - Port Change Detect */ -#define USBHS_USBSTS_PCI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_PCI_SHIFT)) & USBHS_USBSTS_PCI_MASK) - -#define USBHS_USBSTS_FRI_MASK (0x8U) -#define USBHS_USBSTS_FRI_SHIFT (3U) -/*! FRI - Frame List Rollover */ -#define USBHS_USBSTS_FRI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_FRI_SHIFT)) & USBHS_USBSTS_FRI_MASK) - -#define USBHS_USBSTS_SEI_MASK (0x10U) -#define USBHS_USBSTS_SEI_SHIFT (4U) -/*! SEI - System Error */ -#define USBHS_USBSTS_SEI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_SEI_SHIFT)) & USBHS_USBSTS_SEI_MASK) - -#define USBHS_USBSTS_AAI_MASK (0x20U) -#define USBHS_USBSTS_AAI_SHIFT (5U) -/*! AAI - Interrupt on Async Advance */ -#define USBHS_USBSTS_AAI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_AAI_SHIFT)) & USBHS_USBSTS_AAI_MASK) - -#define USBHS_USBSTS_URI_MASK (0x40U) -#define USBHS_USBSTS_URI_SHIFT (6U) -/*! URI - USB Reset Received */ -#define USBHS_USBSTS_URI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_URI_SHIFT)) & USBHS_USBSTS_URI_MASK) - -#define USBHS_USBSTS_SRI_MASK (0x80U) -#define USBHS_USBSTS_SRI_SHIFT (7U) -/*! SRI - SOF Received */ -#define USBHS_USBSTS_SRI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_SRI_SHIFT)) & USBHS_USBSTS_SRI_MASK) - -#define USBHS_USBSTS_SLI_MASK (0x100U) -#define USBHS_USBSTS_SLI_SHIFT (8U) -/*! SLI - DCSuspend */ -#define USBHS_USBSTS_SLI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_SLI_SHIFT)) & USBHS_USBSTS_SLI_MASK) - -#define USBHS_USBSTS_ULPII_MASK (0x400U) -#define USBHS_USBSTS_ULPII_SHIFT (10U) -/*! ULPII - ULPI Interrupt */ -#define USBHS_USBSTS_ULPII(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_ULPII_SHIFT)) & USBHS_USBSTS_ULPII_MASK) - -#define USBHS_USBSTS_HCH_MASK (0x1000U) -#define USBHS_USBSTS_HCH_SHIFT (12U) -/*! HCH - HCHaIted */ -#define USBHS_USBSTS_HCH(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_HCH_SHIFT)) & USBHS_USBSTS_HCH_MASK) - -#define USBHS_USBSTS_RCL_MASK (0x2000U) -#define USBHS_USBSTS_RCL_SHIFT (13U) -/*! RCL - Reclamation */ -#define USBHS_USBSTS_RCL(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_RCL_SHIFT)) & USBHS_USBSTS_RCL_MASK) - -#define USBHS_USBSTS_PS_MASK (0x4000U) -#define USBHS_USBSTS_PS_SHIFT (14U) -/*! PS - Periodic Schedule Status */ -#define USBHS_USBSTS_PS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_PS_SHIFT)) & USBHS_USBSTS_PS_MASK) - -#define USBHS_USBSTS_AS_MASK (0x8000U) -#define USBHS_USBSTS_AS_SHIFT (15U) -/*! AS - Asynchronous Schedule Status */ -#define USBHS_USBSTS_AS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_AS_SHIFT)) & USBHS_USBSTS_AS_MASK) - -#define USBHS_USBSTS_NAKI_MASK (0x10000U) -#define USBHS_USBSTS_NAKI_SHIFT (16U) -/*! NAKI - NAK Interrupt Bit */ -#define USBHS_USBSTS_NAKI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_NAKI_SHIFT)) & USBHS_USBSTS_NAKI_MASK) - -#define USBHS_USBSTS_TI0_MASK (0x1000000U) -#define USBHS_USBSTS_TI0_SHIFT (24U) -/*! TI0 - General Purpose Timer Interrupt 0 (GPTINT0) */ -#define USBHS_USBSTS_TI0(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_TI0_SHIFT)) & USBHS_USBSTS_TI0_MASK) - -#define USBHS_USBSTS_TI1_MASK (0x2000000U) -#define USBHS_USBSTS_TI1_SHIFT (25U) -/*! TI1 - General Purpose Timer Interrupt 1 (GPTINT1) */ -#define USBHS_USBSTS_TI1(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_TI1_SHIFT)) & USBHS_USBSTS_TI1_MASK) -/*! @} */ - -/*! @name USBINTR - Interrupt Enable */ -/*! @{ */ - -#define USBHS_USBINTR_UE_MASK (0x1U) -#define USBHS_USBINTR_UE_SHIFT (0U) -/*! UE - USB Interrupt Enable */ -#define USBHS_USBINTR_UE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_UE_SHIFT)) & USBHS_USBINTR_UE_MASK) - -#define USBHS_USBINTR_UEE_MASK (0x2U) -#define USBHS_USBINTR_UEE_SHIFT (1U) -/*! UEE - USB Error Interrupt Enable */ -#define USBHS_USBINTR_UEE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_UEE_SHIFT)) & USBHS_USBINTR_UEE_MASK) - -#define USBHS_USBINTR_PCE_MASK (0x4U) -#define USBHS_USBINTR_PCE_SHIFT (2U) -/*! PCE - Port Change Detect Interrupt Enable */ -#define USBHS_USBINTR_PCE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_PCE_SHIFT)) & USBHS_USBINTR_PCE_MASK) - -#define USBHS_USBINTR_FRE_MASK (0x8U) -#define USBHS_USBINTR_FRE_SHIFT (3U) -/*! FRE - Frame List Rollover Interrupt Enable */ -#define USBHS_USBINTR_FRE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_FRE_SHIFT)) & USBHS_USBINTR_FRE_MASK) - -#define USBHS_USBINTR_SEE_MASK (0x10U) -#define USBHS_USBINTR_SEE_SHIFT (4U) -/*! SEE - System Error Interrupt Enable */ -#define USBHS_USBINTR_SEE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_SEE_SHIFT)) & USBHS_USBINTR_SEE_MASK) - -#define USBHS_USBINTR_AAE_MASK (0x20U) -#define USBHS_USBINTR_AAE_SHIFT (5U) -/*! AAE - Async Advance Interrupt Enable */ -#define USBHS_USBINTR_AAE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_AAE_SHIFT)) & USBHS_USBINTR_AAE_MASK) - -#define USBHS_USBINTR_URE_MASK (0x40U) -#define USBHS_USBINTR_URE_SHIFT (6U) -/*! URE - USB Reset Interrupt Enable */ -#define USBHS_USBINTR_URE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_URE_SHIFT)) & USBHS_USBINTR_URE_MASK) - -#define USBHS_USBINTR_SRE_MASK (0x80U) -#define USBHS_USBINTR_SRE_SHIFT (7U) -/*! SRE - SOF Received Interrupt Enable */ -#define USBHS_USBINTR_SRE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_SRE_SHIFT)) & USBHS_USBINTR_SRE_MASK) - -#define USBHS_USBINTR_SLE_MASK (0x100U) -#define USBHS_USBINTR_SLE_SHIFT (8U) -/*! SLE - Sleep Interrupt Enable */ -#define USBHS_USBINTR_SLE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_SLE_SHIFT)) & USBHS_USBINTR_SLE_MASK) - -#define USBHS_USBINTR_NAKE_MASK (0x10000U) -#define USBHS_USBINTR_NAKE_SHIFT (16U) -/*! NAKE - NAK Interrupt Enable */ -#define USBHS_USBINTR_NAKE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_NAKE_SHIFT)) & USBHS_USBINTR_NAKE_MASK) - -#define USBHS_USBINTR_UAIE_MASK (0x40000U) -#define USBHS_USBINTR_UAIE_SHIFT (18U) -/*! UAIE - USB Host Asynchronous Interrupt Enable */ -#define USBHS_USBINTR_UAIE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_UAIE_SHIFT)) & USBHS_USBINTR_UAIE_MASK) - -#define USBHS_USBINTR_UPIE_MASK (0x80000U) -#define USBHS_USBINTR_UPIE_SHIFT (19U) -/*! UPIE - USB Host Periodic Interrupt Enable */ -#define USBHS_USBINTR_UPIE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_UPIE_SHIFT)) & USBHS_USBINTR_UPIE_MASK) - -#define USBHS_USBINTR_TIE0_MASK (0x1000000U) -#define USBHS_USBINTR_TIE0_SHIFT (24U) -/*! TIE0 - General Purpose Timer #0 Interrupt Enable */ -#define USBHS_USBINTR_TIE0(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_TIE0_SHIFT)) & USBHS_USBINTR_TIE0_MASK) - -#define USBHS_USBINTR_TIE1_MASK (0x2000000U) -#define USBHS_USBINTR_TIE1_SHIFT (25U) -/*! TIE1 - General Purpose Timer #1 Interrupt Enable */ -#define USBHS_USBINTR_TIE1(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_TIE1_SHIFT)) & USBHS_USBINTR_TIE1_MASK) -/*! @} */ - -/*! @name FRINDEX - USB Frame Index */ -/*! @{ */ - -#define USBHS_FRINDEX_FRINDEX_MASK (0x3FFFU) -#define USBHS_FRINDEX_FRINDEX_SHIFT (0U) -/*! FRINDEX - Frame Index - * 0b00000000000000..(1024) 12 - * 0b00000000000001..(512) 11 - * 0b00000000000010..(256) 10 - * 0b00000000000011..(128) 9 - * 0b00000000000100..(64) 8 - * 0b00000000000101..(32) 7 - * 0b00000000000110..(16) 6 - * 0b00000000000111..(8) 5 - */ -#define USBHS_FRINDEX_FRINDEX(x) (((uint32_t)(((uint32_t)(x)) << USBHS_FRINDEX_FRINDEX_SHIFT)) & USBHS_FRINDEX_FRINDEX_MASK) -/*! @} */ - -/*! @name DEVICEADDR - Device Address */ -/*! @{ */ - -#define USBHS_DEVICEADDR_USBADRA_MASK (0x1000000U) -#define USBHS_DEVICEADDR_USBADRA_SHIFT (24U) -/*! USBADRA - Device Address Advance */ -#define USBHS_DEVICEADDR_USBADRA(x) (((uint32_t)(((uint32_t)(x)) << USBHS_DEVICEADDR_USBADRA_SHIFT)) & USBHS_DEVICEADDR_USBADRA_MASK) - -#define USBHS_DEVICEADDR_USBADR_MASK (0xFE000000U) -#define USBHS_DEVICEADDR_USBADR_SHIFT (25U) -/*! USBADR - Device Address */ -#define USBHS_DEVICEADDR_USBADR(x) (((uint32_t)(((uint32_t)(x)) << USBHS_DEVICEADDR_USBADR_SHIFT)) & USBHS_DEVICEADDR_USBADR_MASK) -/*! @} */ - -/*! @name PERIODICLISTBASE - Frame List Base Address */ -/*! @{ */ - -#define USBHS_PERIODICLISTBASE_BASEADR_MASK (0xFFFFF000U) -#define USBHS_PERIODICLISTBASE_BASEADR_SHIFT (12U) -/*! BASEADR - Base Address (Low) */ -#define USBHS_PERIODICLISTBASE_BASEADR(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PERIODICLISTBASE_BASEADR_SHIFT)) & USBHS_PERIODICLISTBASE_BASEADR_MASK) -/*! @} */ - -/*! @name ASYNCLISTADDR - Next Asynch. Address */ -/*! @{ */ - -#define USBHS_ASYNCLISTADDR_ASYBASE_MASK (0xFFFFFFE0U) -#define USBHS_ASYNCLISTADDR_ASYBASE_SHIFT (5U) -/*! ASYBASE - Link Pointer Low (LPL) */ -#define USBHS_ASYNCLISTADDR_ASYBASE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ASYNCLISTADDR_ASYBASE_SHIFT)) & USBHS_ASYNCLISTADDR_ASYBASE_MASK) -/*! @} */ - -/*! @name ENDPTLISTADDR - Endpoint List Address */ -/*! @{ */ - -#define USBHS_ENDPTLISTADDR_EPBASE_MASK (0xFFFFF800U) -#define USBHS_ENDPTLISTADDR_EPBASE_SHIFT (11U) -/*! EPBASE - Endpoint List Pointer (Low) */ -#define USBHS_ENDPTLISTADDR_EPBASE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTLISTADDR_EPBASE_SHIFT)) & USBHS_ENDPTLISTADDR_EPBASE_MASK) -/*! @} */ - -/*! @name BURSTSIZE - Programmable Burst Size */ -/*! @{ */ - -#define USBHS_BURSTSIZE_RXPBURST_MASK (0xFFU) -#define USBHS_BURSTSIZE_RXPBURST_SHIFT (0U) -/*! RXPBURST - Programmable RX Burst Size */ -#define USBHS_BURSTSIZE_RXPBURST(x) (((uint32_t)(((uint32_t)(x)) << USBHS_BURSTSIZE_RXPBURST_SHIFT)) & USBHS_BURSTSIZE_RXPBURST_MASK) - -#define USBHS_BURSTSIZE_TXPBURST_MASK (0xFF00U) -#define USBHS_BURSTSIZE_TXPBURST_SHIFT (8U) -/*! TXPBURST - Programmable TX Burst Size */ -#define USBHS_BURSTSIZE_TXPBURST(x) (((uint32_t)(((uint32_t)(x)) << USBHS_BURSTSIZE_TXPBURST_SHIFT)) & USBHS_BURSTSIZE_TXPBURST_MASK) -/*! @} */ - -/*! @name TXFILLTUNING - TX FIFO Fill Tuning */ -/*! @{ */ - -#define USBHS_TXFILLTUNING_TXSCHOH_MASK (0x7FU) -#define USBHS_TXFILLTUNING_TXSCHOH_SHIFT (0U) -/*! TXSCHOH - Scheduler Overhead */ -#define USBHS_TXFILLTUNING_TXSCHOH(x) (((uint32_t)(((uint32_t)(x)) << USBHS_TXFILLTUNING_TXSCHOH_SHIFT)) & USBHS_TXFILLTUNING_TXSCHOH_MASK) - -#define USBHS_TXFILLTUNING_TXSCHHEALTH_MASK (0x1F00U) -#define USBHS_TXFILLTUNING_TXSCHHEALTH_SHIFT (8U) -/*! TXSCHHEALTH - Scheduler Health Counter */ -#define USBHS_TXFILLTUNING_TXSCHHEALTH(x) (((uint32_t)(((uint32_t)(x)) << USBHS_TXFILLTUNING_TXSCHHEALTH_SHIFT)) & USBHS_TXFILLTUNING_TXSCHHEALTH_MASK) - -#define USBHS_TXFILLTUNING_TXFIFOTHRES_MASK (0x3F0000U) -#define USBHS_TXFILLTUNING_TXFIFOTHRES_SHIFT (16U) -/*! TXFIFOTHRES - FIFO Burst Threshold */ -#define USBHS_TXFILLTUNING_TXFIFOTHRES(x) (((uint32_t)(((uint32_t)(x)) << USBHS_TXFILLTUNING_TXFIFOTHRES_SHIFT)) & USBHS_TXFILLTUNING_TXFIFOTHRES_MASK) -/*! @} */ - -/*! @name ENDPTNAK - Endpoint NAK */ -/*! @{ */ - -#define USBHS_ENDPTNAK_EPRN_MASK (0xFFU) -#define USBHS_ENDPTNAK_EPRN_SHIFT (0U) -/*! EPRN - RX Endpoint NAK */ -#define USBHS_ENDPTNAK_EPRN(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTNAK_EPRN_SHIFT)) & USBHS_ENDPTNAK_EPRN_MASK) - -#define USBHS_ENDPTNAK_EPTN_MASK (0xFF0000U) -#define USBHS_ENDPTNAK_EPTN_SHIFT (16U) -/*! EPTN - TX Endpoint NAK */ -#define USBHS_ENDPTNAK_EPTN(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTNAK_EPTN_SHIFT)) & USBHS_ENDPTNAK_EPTN_MASK) -/*! @} */ - -/*! @name ENDPTNAKEN - Endpoint NAK Enable */ -/*! @{ */ - -#define USBHS_ENDPTNAKEN_EPRNE_MASK (0xFFU) -#define USBHS_ENDPTNAKEN_EPRNE_SHIFT (0U) -/*! EPRNE - RX Endpoint NAK Enable */ -#define USBHS_ENDPTNAKEN_EPRNE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTNAKEN_EPRNE_SHIFT)) & USBHS_ENDPTNAKEN_EPRNE_MASK) - -#define USBHS_ENDPTNAKEN_EPTNE_MASK (0xFF0000U) -#define USBHS_ENDPTNAKEN_EPTNE_SHIFT (16U) -/*! EPTNE - TX Endpoint NAK Enable */ -#define USBHS_ENDPTNAKEN_EPTNE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTNAKEN_EPTNE_SHIFT)) & USBHS_ENDPTNAKEN_EPTNE_MASK) -/*! @} */ - -/*! @name CONFIGFLAG - Configure Flag */ -/*! @{ */ - -#define USBHS_CONFIGFLAG_CF_MASK (0x1U) -#define USBHS_CONFIGFLAG_CF_SHIFT (0U) -/*! CF - Configure Flag - * 0b0..Port routing control logic default-routes each port to an implementation dependent classic host controller - * 0b1..Port routing control logic default-routes all ports to this host controller - */ -#define USBHS_CONFIGFLAG_CF(x) (((uint32_t)(((uint32_t)(x)) << USBHS_CONFIGFLAG_CF_SHIFT)) & USBHS_CONFIGFLAG_CF_MASK) -/*! @} */ - -/*! @name PORTSC1 - Port Status & Control */ -/*! @{ */ - -#define USBHS_PORTSC1_CCS_MASK (0x1U) -#define USBHS_PORTSC1_CCS_SHIFT (0U) -/*! CCS - Current Connect Status - * 0b0..In Host mode: No device is present. In Device mode: Not attached - * 0b1..In Host mode: Device is present on port. In Device mode: Attached - */ -#define USBHS_PORTSC1_CCS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_CCS_SHIFT)) & USBHS_PORTSC1_CCS_MASK) - -#define USBHS_PORTSC1_CSC_MASK (0x2U) -#define USBHS_PORTSC1_CSC_SHIFT (1U) -/*! CSC - Connect Status Change - * 0b0..No change - * 0b1..Change in current connect status - */ -#define USBHS_PORTSC1_CSC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_CSC_SHIFT)) & USBHS_PORTSC1_CSC_MASK) - -#define USBHS_PORTSC1_PE_MASK (0x4U) -#define USBHS_PORTSC1_PE_SHIFT (2U) -/*! PE - Port Enabled/Disabled - * 0b0..Disable - * 0b1..Enable - */ -#define USBHS_PORTSC1_PE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PE_SHIFT)) & USBHS_PORTSC1_PE_MASK) - -#define USBHS_PORTSC1_PEC_MASK (0x8U) -#define USBHS_PORTSC1_PEC_SHIFT (3U) -/*! PEC - Port Enable/Disable Change - * 0b0..No change - * 0b1..Port enabled/disabled status has changed - */ -#define USBHS_PORTSC1_PEC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PEC_SHIFT)) & USBHS_PORTSC1_PEC_MASK) - -#define USBHS_PORTSC1_OCA_MASK (0x10U) -#define USBHS_PORTSC1_OCA_SHIFT (4U) -/*! OCA - Over-Current Active - * 0b1..This port currently has an over-current condition - * 0b0..This port does not have an over-current condition - */ -#define USBHS_PORTSC1_OCA(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_OCA_SHIFT)) & USBHS_PORTSC1_OCA_MASK) - -#define USBHS_PORTSC1_OCC_MASK (0x20U) -#define USBHS_PORTSC1_OCC_SHIFT (5U) -/*! OCC - Over-current Change */ -#define USBHS_PORTSC1_OCC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_OCC_SHIFT)) & USBHS_PORTSC1_OCC_MASK) - -#define USBHS_PORTSC1_FPR_MASK (0x40U) -#define USBHS_PORTSC1_FPR_SHIFT (6U) -/*! FPR - Force Port Resume - * 0b0..No resume (K-state) detected/driven on port - * 0b1..Resume detected/driven on port - */ -#define USBHS_PORTSC1_FPR(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_FPR_SHIFT)) & USBHS_PORTSC1_FPR_MASK) - -#define USBHS_PORTSC1_SUSP_MASK (0x80U) -#define USBHS_PORTSC1_SUSP_SHIFT (7U) -/*! SUSP - Suspend - * 0b0..Port not in suspend state - * 0b1..Port in suspend state - */ -#define USBHS_PORTSC1_SUSP(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_SUSP_SHIFT)) & USBHS_PORTSC1_SUSP_MASK) - -#define USBHS_PORTSC1_PR_MASK (0x100U) -#define USBHS_PORTSC1_PR_SHIFT (8U) -/*! PR - Port Reset - * 0b0..Port is not in reset - * 0b1..Port is in reset - */ -#define USBHS_PORTSC1_PR(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PR_SHIFT)) & USBHS_PORTSC1_PR_MASK) - -#define USBHS_PORTSC1_HSP_MASK (0x200U) -#define USBHS_PORTSC1_HSP_SHIFT (9U) -/*! HSP - High-Speed Port */ -#define USBHS_PORTSC1_HSP(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_HSP_SHIFT)) & USBHS_PORTSC1_HSP_MASK) - -#define USBHS_PORTSC1_LS_MASK (0xC00U) -#define USBHS_PORTSC1_LS_SHIFT (10U) -/*! LS - Line Status - * 0b00..SE0 - * 0b10..J-state - * 0b01..K-state - * 0b11..Undefined - */ -#define USBHS_PORTSC1_LS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_LS_SHIFT)) & USBHS_PORTSC1_LS_MASK) - -#define USBHS_PORTSC1_PP_MASK (0x1000U) -#define USBHS_PORTSC1_PP_SHIFT (12U) -/*! PP - Port Power */ -#define USBHS_PORTSC1_PP(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PP_SHIFT)) & USBHS_PORTSC1_PP_MASK) - -#define USBHS_PORTSC1_PO_MASK (0x2000U) -#define USBHS_PORTSC1_PO_SHIFT (13U) -/*! PO - Port Owner */ -#define USBHS_PORTSC1_PO(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PO_SHIFT)) & USBHS_PORTSC1_PO_MASK) - -#define USBHS_PORTSC1_PIC_MASK (0xC000U) -#define USBHS_PORTSC1_PIC_SHIFT (14U) -/*! PIC - Port Indicator Control - * 0b00..Port indicators are off - * 0b01..Amber - * 0b10..Green - * 0b11..Undefined - */ -#define USBHS_PORTSC1_PIC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PIC_SHIFT)) & USBHS_PORTSC1_PIC_MASK) - -#define USBHS_PORTSC1_PTC_MASK (0xF0000U) -#define USBHS_PORTSC1_PTC_SHIFT (16U) -/*! PTC - Port Test Control - * 0b0000..TEST_MODE_DISABLE - * 0b0001..J_STATE - * 0b0010..K_STATE - * 0b0011..SE0 (host) / NAK (device) - * 0b0100..Packet - * 0b0101..FORCE_ENABLE_HS - * 0b0110..FORCE_ENABLE_FS - * 0b0111..FORCE_ENABLE_LS - * 0b1000-0b1111..Reserved - */ -#define USBHS_PORTSC1_PTC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PTC_SHIFT)) & USBHS_PORTSC1_PTC_MASK) - -#define USBHS_PORTSC1_WKCN_MASK (0x100000U) -#define USBHS_PORTSC1_WKCN_SHIFT (20U) -/*! WKCN - Wake on Connect Enable (WKCNNT_E) */ -#define USBHS_PORTSC1_WKCN(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_WKCN_SHIFT)) & USBHS_PORTSC1_WKCN_MASK) - -#define USBHS_PORTSC1_WKDC_MASK (0x200000U) -#define USBHS_PORTSC1_WKDC_SHIFT (21U) -/*! WKDC - Wake on Disconnect Enable (WKDSCNNT_E) */ -#define USBHS_PORTSC1_WKDC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_WKDC_SHIFT)) & USBHS_PORTSC1_WKDC_MASK) - -#define USBHS_PORTSC1_WKOC_MASK (0x400000U) -#define USBHS_PORTSC1_WKOC_SHIFT (22U) -/*! WKOC - Wake on Over-current Enable (WKOC_E) */ -#define USBHS_PORTSC1_WKOC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_WKOC_SHIFT)) & USBHS_PORTSC1_WKOC_MASK) - -#define USBHS_PORTSC1_PHCD_MASK (0x800000U) -#define USBHS_PORTSC1_PHCD_SHIFT (23U) -/*! PHCD - PHY Low Power Suspend - Clock Disable (PLPSCD) - * 0b1..Disable PHY clock - * 0b0..Enable PHY clock - */ -#define USBHS_PORTSC1_PHCD(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PHCD_SHIFT)) & USBHS_PORTSC1_PHCD_MASK) - -#define USBHS_PORTSC1_PFSC_MASK (0x1000000U) -#define USBHS_PORTSC1_PFSC_SHIFT (24U) -/*! PFSC - Port Force Full Speed Connect - * 0b1..Forced to full speed - * 0b0..Normal operation - */ -#define USBHS_PORTSC1_PFSC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PFSC_SHIFT)) & USBHS_PORTSC1_PFSC_MASK) - -#define USBHS_PORTSC1_PTS_2_MASK (0x2000000U) -#define USBHS_PORTSC1_PTS_2_SHIFT (25U) -/*! PTS_2 - Parallel Transceiver Select */ -#define USBHS_PORTSC1_PTS_2(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PTS_2_SHIFT)) & USBHS_PORTSC1_PTS_2_MASK) - -#define USBHS_PORTSC1_PSPD_MASK (0xC000000U) -#define USBHS_PORTSC1_PSPD_SHIFT (26U) -/*! PSPD - Port Speed - * 0b00..Full Speed - * 0b01..Low Speed - * 0b10..High Speed - * 0b11..Undefined - */ -#define USBHS_PORTSC1_PSPD(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PSPD_SHIFT)) & USBHS_PORTSC1_PSPD_MASK) - -#define USBHS_PORTSC1_PTW_MASK (0x10000000U) -#define USBHS_PORTSC1_PTW_SHIFT (28U) -/*! PTW - Parallel Transceiver Width - Read/Write - * 0b0..Select the 8-bit UTMI interface [60 MHz] - * 0b1..Select the 16-bit UTMI interface [30 MHz] - */ -#define USBHS_PORTSC1_PTW(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PTW_SHIFT)) & USBHS_PORTSC1_PTW_MASK) - -#define USBHS_PORTSC1_STS_MASK (0x20000000U) -#define USBHS_PORTSC1_STS_SHIFT (29U) -/*! STS - Serial Transceiver Select - * 0b0..Parallel Interface signals is selected - * 0b1..Serial Interface Engine is selected - */ -#define USBHS_PORTSC1_STS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_STS_SHIFT)) & USBHS_PORTSC1_STS_MASK) - -#define USBHS_PORTSC1_PTS_1_MASK (0xC0000000U) -#define USBHS_PORTSC1_PTS_1_SHIFT (30U) -/*! PTS_1 - Parallel Transceiver Select */ -#define USBHS_PORTSC1_PTS_1(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PTS_1_SHIFT)) & USBHS_PORTSC1_PTS_1_MASK) -/*! @} */ - -/*! @name OTGSC - On-The-Go Status & Control */ -/*! @{ */ - -#define USBHS_OTGSC_VD_MASK (0x1U) -#define USBHS_OTGSC_VD_SHIFT (0U) -/*! VD - VBUS Discharge */ -#define USBHS_OTGSC_VD(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_VD_SHIFT)) & USBHS_OTGSC_VD_MASK) - -#define USBHS_OTGSC_VC_MASK (0x2U) -#define USBHS_OTGSC_VC_SHIFT (1U) -/*! VC - VBUS Charge */ -#define USBHS_OTGSC_VC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_VC_SHIFT)) & USBHS_OTGSC_VC_MASK) - -#define USBHS_OTGSC_OT_MASK (0x8U) -#define USBHS_OTGSC_OT_SHIFT (3U) -/*! OT - OTG Termination */ -#define USBHS_OTGSC_OT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_OT_SHIFT)) & USBHS_OTGSC_OT_MASK) - -#define USBHS_OTGSC_DP_MASK (0x10U) -#define USBHS_OTGSC_DP_SHIFT (4U) -/*! DP - Data Pulsing */ -#define USBHS_OTGSC_DP(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_DP_SHIFT)) & USBHS_OTGSC_DP_MASK) - -#define USBHS_OTGSC_IDPU_MASK (0x20U) -#define USBHS_OTGSC_IDPU_SHIFT (5U) -/*! IDPU - ID Pullup - * 0b0..Off - * 0b1..On - */ -#define USBHS_OTGSC_IDPU(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_IDPU_SHIFT)) & USBHS_OTGSC_IDPU_MASK) - -#define USBHS_OTGSC_ID_MASK (0x100U) -#define USBHS_OTGSC_ID_SHIFT (8U) -/*! ID - USB ID - * 0b0..A device - * 0b1..B device - */ -#define USBHS_OTGSC_ID(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_ID_SHIFT)) & USBHS_OTGSC_ID_MASK) - -#define USBHS_OTGSC_AVV_MASK (0x200U) -#define USBHS_OTGSC_AVV_SHIFT (9U) -/*! AVV - A VBus Valid */ -#define USBHS_OTGSC_AVV(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_AVV_SHIFT)) & USBHS_OTGSC_AVV_MASK) - -#define USBHS_OTGSC_ASV_MASK (0x400U) -#define USBHS_OTGSC_ASV_SHIFT (10U) -/*! ASV - A Session Valid */ -#define USBHS_OTGSC_ASV(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_ASV_SHIFT)) & USBHS_OTGSC_ASV_MASK) - -#define USBHS_OTGSC_BSV_MASK (0x800U) -#define USBHS_OTGSC_BSV_SHIFT (11U) -/*! BSV - B Session Valid */ -#define USBHS_OTGSC_BSV(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_BSV_SHIFT)) & USBHS_OTGSC_BSV_MASK) - -#define USBHS_OTGSC_BSE_MASK (0x1000U) -#define USBHS_OTGSC_BSE_SHIFT (12U) -/*! BSE - B Session End */ -#define USBHS_OTGSC_BSE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_BSE_SHIFT)) & USBHS_OTGSC_BSE_MASK) - -#define USBHS_OTGSC_TOG_1MS_MASK (0x2000U) -#define USBHS_OTGSC_TOG_1MS_SHIFT (13U) -/*! TOG_1MS - 1 Millisecond Timer Toggle */ -#define USBHS_OTGSC_TOG_1MS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_TOG_1MS_SHIFT)) & USBHS_OTGSC_TOG_1MS_MASK) - -#define USBHS_OTGSC_DPS_MASK (0x4000U) -#define USBHS_OTGSC_DPS_SHIFT (14U) -/*! DPS - Data Bus Pulsing Status */ -#define USBHS_OTGSC_DPS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_DPS_SHIFT)) & USBHS_OTGSC_DPS_MASK) - -#define USBHS_OTGSC_IDIS_MASK (0x10000U) -#define USBHS_OTGSC_IDIS_SHIFT (16U) -/*! IDIS - USB ID Interrupt Status */ -#define USBHS_OTGSC_IDIS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_IDIS_SHIFT)) & USBHS_OTGSC_IDIS_MASK) - -#define USBHS_OTGSC_AVVIS_MASK (0x20000U) -#define USBHS_OTGSC_AVVIS_SHIFT (17U) -/*! AVVIS - A VBus Valid Interrupt Status */ -#define USBHS_OTGSC_AVVIS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_AVVIS_SHIFT)) & USBHS_OTGSC_AVVIS_MASK) - -#define USBHS_OTGSC_ASVIS_MASK (0x40000U) -#define USBHS_OTGSC_ASVIS_SHIFT (18U) -/*! ASVIS - A Session Valid Interrupt Status */ -#define USBHS_OTGSC_ASVIS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_ASVIS_SHIFT)) & USBHS_OTGSC_ASVIS_MASK) - -#define USBHS_OTGSC_BSVIS_MASK (0x80000U) -#define USBHS_OTGSC_BSVIS_SHIFT (19U) -/*! BSVIS - B Session Valid Interrupt Status */ -#define USBHS_OTGSC_BSVIS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_BSVIS_SHIFT)) & USBHS_OTGSC_BSVIS_MASK) - -#define USBHS_OTGSC_BSEIS_MASK (0x100000U) -#define USBHS_OTGSC_BSEIS_SHIFT (20U) -/*! BSEIS - B Session End Interrupt Status */ -#define USBHS_OTGSC_BSEIS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_BSEIS_SHIFT)) & USBHS_OTGSC_BSEIS_MASK) - -#define USBHS_OTGSC_STATUS_1MS_MASK (0x200000U) -#define USBHS_OTGSC_STATUS_1MS_SHIFT (21U) -/*! STATUS_1MS - 1 Millisecond Timer Interrupt Status */ -#define USBHS_OTGSC_STATUS_1MS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_STATUS_1MS_SHIFT)) & USBHS_OTGSC_STATUS_1MS_MASK) - -#define USBHS_OTGSC_DPIS_MASK (0x400000U) -#define USBHS_OTGSC_DPIS_SHIFT (22U) -/*! DPIS - Data Pulse Interrupt Status */ -#define USBHS_OTGSC_DPIS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_DPIS_SHIFT)) & USBHS_OTGSC_DPIS_MASK) - -#define USBHS_OTGSC_IDIE_MASK (0x1000000U) -#define USBHS_OTGSC_IDIE_SHIFT (24U) -/*! IDIE - USB ID Interrupt Enable */ -#define USBHS_OTGSC_IDIE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_IDIE_SHIFT)) & USBHS_OTGSC_IDIE_MASK) - -#define USBHS_OTGSC_AVVIE_MASK (0x2000000U) -#define USBHS_OTGSC_AVVIE_SHIFT (25U) -/*! AVVIE - A VBus Valid Interrupt Enable */ -#define USBHS_OTGSC_AVVIE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_AVVIE_SHIFT)) & USBHS_OTGSC_AVVIE_MASK) - -#define USBHS_OTGSC_ASVIE_MASK (0x4000000U) -#define USBHS_OTGSC_ASVIE_SHIFT (26U) -/*! ASVIE - A Session Valid Interrupt Enable */ -#define USBHS_OTGSC_ASVIE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_ASVIE_SHIFT)) & USBHS_OTGSC_ASVIE_MASK) - -#define USBHS_OTGSC_BSVIE_MASK (0x8000000U) -#define USBHS_OTGSC_BSVIE_SHIFT (27U) -/*! BSVIE - B Session Valid Interrupt Enable */ -#define USBHS_OTGSC_BSVIE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_BSVIE_SHIFT)) & USBHS_OTGSC_BSVIE_MASK) - -#define USBHS_OTGSC_BSEIE_MASK (0x10000000U) -#define USBHS_OTGSC_BSEIE_SHIFT (28U) -/*! BSEIE - B Session End Interrupt Enable */ -#define USBHS_OTGSC_BSEIE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_BSEIE_SHIFT)) & USBHS_OTGSC_BSEIE_MASK) - -#define USBHS_OTGSC_EN_1MS_MASK (0x20000000U) -#define USBHS_OTGSC_EN_1MS_SHIFT (29U) -/*! EN_1MS - 1 Millisecond Timer Interrupt Enable */ -#define USBHS_OTGSC_EN_1MS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_EN_1MS_SHIFT)) & USBHS_OTGSC_EN_1MS_MASK) - -#define USBHS_OTGSC_DPIE_MASK (0x40000000U) -#define USBHS_OTGSC_DPIE_SHIFT (30U) -/*! DPIE - Data Pulse Interrupt Enable */ -#define USBHS_OTGSC_DPIE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_DPIE_SHIFT)) & USBHS_OTGSC_DPIE_MASK) -/*! @} */ - -/*! @name USBMODE - USB Device Mode */ -/*! @{ */ - -#define USBHS_USBMODE_CM_MASK (0x3U) -#define USBHS_USBMODE_CM_SHIFT (0U) -/*! CM - Controller Mode - * 0b00..Idle [Default for combination host/device] - * 0b01..Reserved - * 0b10..Device Controller [Default for device only controller] - * 0b11..Host Controller [Default for host only controller] - */ -#define USBHS_USBMODE_CM(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBMODE_CM_SHIFT)) & USBHS_USBMODE_CM_MASK) - -#define USBHS_USBMODE_ES_MASK (0x4U) -#define USBHS_USBMODE_ES_SHIFT (2U) -/*! ES - Endian Select - * 0b0..Little Endian - * 0b1..Big Endian - */ -#define USBHS_USBMODE_ES(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBMODE_ES_SHIFT)) & USBHS_USBMODE_ES_MASK) - -#define USBHS_USBMODE_SLOM_MASK (0x8U) -#define USBHS_USBMODE_SLOM_SHIFT (3U) -/*! SLOM - Setup Lockout Mode - * 0b0..Setup Lockouts On (default); - * 0b1..Setup Lockouts Off - */ -#define USBHS_USBMODE_SLOM(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBMODE_SLOM_SHIFT)) & USBHS_USBMODE_SLOM_MASK) - -#define USBHS_USBMODE_SDIS_MASK (0x10U) -#define USBHS_USBMODE_SDIS_SHIFT (4U) -/*! SDIS - Stream Disable Mode - * 0b0..Inactive - * 0b1..Active - */ -#define USBHS_USBMODE_SDIS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBMODE_SDIS_SHIFT)) & USBHS_USBMODE_SDIS_MASK) -/*! @} */ - -/*! @name ENDPTSETUPSTAT - Endpoint Setup Status */ -/*! @{ */ - -#define USBHS_ENDPTSETUPSTAT_ENDPTSETUPSTAT_MASK (0xFFFFU) -#define USBHS_ENDPTSETUPSTAT_ENDPTSETUPSTAT_SHIFT (0U) -/*! ENDPTSETUPSTAT - Setup Endpoint Status */ -#define USBHS_ENDPTSETUPSTAT_ENDPTSETUPSTAT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTSETUPSTAT_ENDPTSETUPSTAT_SHIFT)) & USBHS_ENDPTSETUPSTAT_ENDPTSETUPSTAT_MASK) -/*! @} */ - -/*! @name ENDPTPRIME - Endpoint Prime */ -/*! @{ */ - -#define USBHS_ENDPTPRIME_PERB_MASK (0xFFU) -#define USBHS_ENDPTPRIME_PERB_SHIFT (0U) -/*! PERB - Prime Endpoint Receive Buffer */ -#define USBHS_ENDPTPRIME_PERB(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTPRIME_PERB_SHIFT)) & USBHS_ENDPTPRIME_PERB_MASK) - -#define USBHS_ENDPTPRIME_PETB_MASK (0xFF0000U) -#define USBHS_ENDPTPRIME_PETB_SHIFT (16U) -/*! PETB - Prime Endpoint Transmit Buffer */ -#define USBHS_ENDPTPRIME_PETB(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTPRIME_PETB_SHIFT)) & USBHS_ENDPTPRIME_PETB_MASK) -/*! @} */ - -/*! @name ENDPTFLUSH - Endpoint Flush */ -/*! @{ */ - -#define USBHS_ENDPTFLUSH_FERB_MASK (0xFFU) -#define USBHS_ENDPTFLUSH_FERB_SHIFT (0U) -/*! FERB - Flush Endpoint Receive Buffer */ -#define USBHS_ENDPTFLUSH_FERB(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTFLUSH_FERB_SHIFT)) & USBHS_ENDPTFLUSH_FERB_MASK) - -#define USBHS_ENDPTFLUSH_FETB_MASK (0xFF0000U) -#define USBHS_ENDPTFLUSH_FETB_SHIFT (16U) -/*! FETB - Flush Endpoint Transmit Buffer */ -#define USBHS_ENDPTFLUSH_FETB(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTFLUSH_FETB_SHIFT)) & USBHS_ENDPTFLUSH_FETB_MASK) -/*! @} */ - -/*! @name ENDPTSTAT - Endpoint Status */ -/*! @{ */ - -#define USBHS_ENDPTSTAT_ERBR_MASK (0xFFU) -#define USBHS_ENDPTSTAT_ERBR_SHIFT (0U) -/*! ERBR - Endpoint Receive Buffer Ready */ -#define USBHS_ENDPTSTAT_ERBR(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTSTAT_ERBR_SHIFT)) & USBHS_ENDPTSTAT_ERBR_MASK) - -#define USBHS_ENDPTSTAT_ETBR_MASK (0xFF0000U) -#define USBHS_ENDPTSTAT_ETBR_SHIFT (16U) -/*! ETBR - Endpoint Transmit Buffer Ready */ -#define USBHS_ENDPTSTAT_ETBR(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTSTAT_ETBR_SHIFT)) & USBHS_ENDPTSTAT_ETBR_MASK) -/*! @} */ - -/*! @name ENDPTCOMPLETE - Endpoint Complete */ -/*! @{ */ - -#define USBHS_ENDPTCOMPLETE_ERCE_MASK (0xFFU) -#define USBHS_ENDPTCOMPLETE_ERCE_SHIFT (0U) -/*! ERCE - Endpoint Receive Complete Event */ -#define USBHS_ENDPTCOMPLETE_ERCE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCOMPLETE_ERCE_SHIFT)) & USBHS_ENDPTCOMPLETE_ERCE_MASK) - -#define USBHS_ENDPTCOMPLETE_ETCE_MASK (0xFF0000U) -#define USBHS_ENDPTCOMPLETE_ETCE_SHIFT (16U) -/*! ETCE - Endpoint Transmit Complete Event */ -#define USBHS_ENDPTCOMPLETE_ETCE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCOMPLETE_ETCE_SHIFT)) & USBHS_ENDPTCOMPLETE_ETCE_MASK) -/*! @} */ - -/*! @name ENDPTCTRL0 - Endpoint Control 0 */ -/*! @{ */ - -#define USBHS_ENDPTCTRL0_RXS_MASK (0x1U) -#define USBHS_ENDPTCTRL0_RXS_SHIFT (0U) -/*! RXS - RX Endpoint Stall - * 0b0..Endpoint OK - * 0b1..Endpoint stalled - */ -#define USBHS_ENDPTCTRL0_RXS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL0_RXS_SHIFT)) & USBHS_ENDPTCTRL0_RXS_MASK) - -#define USBHS_ENDPTCTRL0_RXT_MASK (0xCU) -#define USBHS_ENDPTCTRL0_RXT_SHIFT (2U) -/*! RXT - RX Endpoint Type - * 0b00..Control - */ -#define USBHS_ENDPTCTRL0_RXT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL0_RXT_SHIFT)) & USBHS_ENDPTCTRL0_RXT_MASK) - -#define USBHS_ENDPTCTRL0_RXE_MASK (0x80U) -#define USBHS_ENDPTCTRL0_RXE_SHIFT (7U) -/*! RXE - RX Endpoint Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define USBHS_ENDPTCTRL0_RXE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL0_RXE_SHIFT)) & USBHS_ENDPTCTRL0_RXE_MASK) - -#define USBHS_ENDPTCTRL0_TXS_MASK (0x10000U) -#define USBHS_ENDPTCTRL0_TXS_SHIFT (16U) -/*! TXS - TX Endpoint Stall - * 0b0..Endpoint OK - * 0b1..Endpoint stalled - */ -#define USBHS_ENDPTCTRL0_TXS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL0_TXS_SHIFT)) & USBHS_ENDPTCTRL0_TXS_MASK) - -#define USBHS_ENDPTCTRL0_TXT_MASK (0xC0000U) -#define USBHS_ENDPTCTRL0_TXT_SHIFT (18U) -/*! TXT - TX Endpoint Type - * 0b00..Control - */ -#define USBHS_ENDPTCTRL0_TXT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL0_TXT_SHIFT)) & USBHS_ENDPTCTRL0_TXT_MASK) - -#define USBHS_ENDPTCTRL0_TXE_MASK (0x800000U) -#define USBHS_ENDPTCTRL0_TXE_SHIFT (23U) -/*! TXE - TX Endpoint Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define USBHS_ENDPTCTRL0_TXE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL0_TXE_SHIFT)) & USBHS_ENDPTCTRL0_TXE_MASK) -/*! @} */ - -/*! @name ENDPTCTRL - Endpoint Control 1..Endpoint Control 7 */ -/*! @{ */ - -#define USBHS_ENDPTCTRL_RXS_MASK (0x1U) -#define USBHS_ENDPTCTRL_RXS_SHIFT (0U) -/*! RXS - RX Endpoint Stall - * 0b0..Endpoint OK - * 0b1..Endpoint stalled - */ -#define USBHS_ENDPTCTRL_RXS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_RXS_SHIFT)) & USBHS_ENDPTCTRL_RXS_MASK) - -#define USBHS_ENDPTCTRL_RXD_MASK (0x2U) -#define USBHS_ENDPTCTRL_RXD_SHIFT (1U) -/*! RXD - RX Endpoint Data Sink - * 0b0..Dual Port Memory Buffer/DMA Engine - */ -#define USBHS_ENDPTCTRL_RXD(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_RXD_SHIFT)) & USBHS_ENDPTCTRL_RXD_MASK) - -#define USBHS_ENDPTCTRL_RXT_MASK (0xCU) -#define USBHS_ENDPTCTRL_RXT_SHIFT (2U) -/*! RXT - RX Endpoint Type - * 0b00..Control - * 0b01..Isochronous - * 0b10..Bulk - * 0b11..Interrupt - */ -#define USBHS_ENDPTCTRL_RXT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_RXT_SHIFT)) & USBHS_ENDPTCTRL_RXT_MASK) - -#define USBHS_ENDPTCTRL_RXI_MASK (0x20U) -#define USBHS_ENDPTCTRL_RXI_SHIFT (5U) -/*! RXI - RX Data Toggle Inhibit - * 0b0..Disabled - * 0b1..Enabled - */ -#define USBHS_ENDPTCTRL_RXI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_RXI_SHIFT)) & USBHS_ENDPTCTRL_RXI_MASK) - -#define USBHS_ENDPTCTRL_RXR_MASK (0x40U) -#define USBHS_ENDPTCTRL_RXR_SHIFT (6U) -/*! RXR - RX Data Toggle Reset (WS) - * 0b1..Reset PID sequence - */ -#define USBHS_ENDPTCTRL_RXR(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_RXR_SHIFT)) & USBHS_ENDPTCTRL_RXR_MASK) - -#define USBHS_ENDPTCTRL_RXE_MASK (0x80U) -#define USBHS_ENDPTCTRL_RXE_SHIFT (7U) -/*! RXE - RX Endpoint Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define USBHS_ENDPTCTRL_RXE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_RXE_SHIFT)) & USBHS_ENDPTCTRL_RXE_MASK) - -#define USBHS_ENDPTCTRL_TXS_MASK (0x10000U) -#define USBHS_ENDPTCTRL_TXS_SHIFT (16U) -/*! TXS - TX Endpoint Stall - * 0b0..Endpoint OK - * 0b1..Endpoint stalled - */ -#define USBHS_ENDPTCTRL_TXS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_TXS_SHIFT)) & USBHS_ENDPTCTRL_TXS_MASK) - -#define USBHS_ENDPTCTRL_TXD_MASK (0x20000U) -#define USBHS_ENDPTCTRL_TXD_SHIFT (17U) -/*! TXD - TX Endpoint Data Source - * 0b0..Dual Port Memory Buffer/DMA Engine - */ -#define USBHS_ENDPTCTRL_TXD(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_TXD_SHIFT)) & USBHS_ENDPTCTRL_TXD_MASK) - -#define USBHS_ENDPTCTRL_TXT_MASK (0xC0000U) -#define USBHS_ENDPTCTRL_TXT_SHIFT (18U) -/*! TXT - TX Endpoint Type - * 0b00..Control - * 0b01..Isochronous - * 0b10..Bulk - * 0b11..Interrupt - */ -#define USBHS_ENDPTCTRL_TXT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_TXT_SHIFT)) & USBHS_ENDPTCTRL_TXT_MASK) - -#define USBHS_ENDPTCTRL_TXI_MASK (0x200000U) -#define USBHS_ENDPTCTRL_TXI_SHIFT (21U) -/*! TXI - TX Data Toggle Inhibit - * 0b0..PID sequencing enabled - * 0b1..PID sequencing disabled - */ -#define USBHS_ENDPTCTRL_TXI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_TXI_SHIFT)) & USBHS_ENDPTCTRL_TXI_MASK) - -#define USBHS_ENDPTCTRL_TXR_MASK (0x400000U) -#define USBHS_ENDPTCTRL_TXR_SHIFT (22U) -/*! TXR - TX Data Toggle Reset (WS) - * 0b1..Reset PID sequence - */ -#define USBHS_ENDPTCTRL_TXR(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_TXR_SHIFT)) & USBHS_ENDPTCTRL_TXR_MASK) - -#define USBHS_ENDPTCTRL_TXE_MASK (0x800000U) -#define USBHS_ENDPTCTRL_TXE_SHIFT (23U) -/*! TXE - TX Endpoint Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define USBHS_ENDPTCTRL_TXE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_TXE_SHIFT)) & USBHS_ENDPTCTRL_TXE_MASK) -/*! @} */ - -/* The count of USBHS_ENDPTCTRL */ -#define USBHS_ENDPTCTRL_COUNT (7U) - - -/*! - * @} - */ /* end of group USBHS_Register_Masks */ - - -/* USBHS - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral USBHS1__USBC base address */ - #define USBHS1__USBC_BASE (0x5010B000u) - /** Peripheral USBHS1__USBC base address */ - #define USBHS1__USBC_BASE_NS (0x4010B000u) - /** Peripheral USBHS1__USBC base pointer */ - #define USBHS1__USBC ((USBHS_Type *)USBHS1__USBC_BASE) - /** Peripheral USBHS1__USBC base pointer */ - #define USBHS1__USBC_NS ((USBHS_Type *)USBHS1__USBC_BASE_NS) - /** Array initializer of USBHS peripheral base addresses */ - #define USBHS_BASE_ADDRS { USBHS1__USBC_BASE } - /** Array initializer of USBHS peripheral base pointers */ - #define USBHS_BASE_PTRS { USBHS1__USBC } - /** Array initializer of USBHS peripheral base addresses */ - #define USBHS_BASE_ADDRS_NS { USBHS1__USBC_BASE_NS } - /** Array initializer of USBHS peripheral base pointers */ - #define USBHS_BASE_PTRS_NS { USBHS1__USBC_NS } -#else - /** Peripheral USBHS1__USBC base address */ - #define USBHS1__USBC_BASE (0x4010B000u) - /** Peripheral USBHS1__USBC base pointer */ - #define USBHS1__USBC ((USBHS_Type *)USBHS1__USBC_BASE) - /** Array initializer of USBHS peripheral base addresses */ - #define USBHS_BASE_ADDRS { USBHS1__USBC_BASE } - /** Array initializer of USBHS peripheral base pointers */ - #define USBHS_BASE_PTRS { USBHS1__USBC } -#endif -/** Interrupt vectors for the USBHS peripheral type */ -#define USBHS_IRQS { USB1_HS_IRQn } -/* Backward compatibility */ -#define GPTIMER0CTL GPTIMER0CTRL -#define GPTIMER1CTL GPTIMER1CTRL -#define USB_SBUSCFG SBUSCFG -#define EPLISTADDR ENDPTLISTADDR -#define EPSETUPSR ENDPTSETUPSTAT -#define EPPRIME ENDPTPRIME -#define EPFLUSH ENDPTFLUSH -#define EPSR ENDPTSTAT -#define EPCOMPLETE ENDPTCOMPLETE -#define EPCR ENDPTCTRL -#define EPCR0 ENDPTCTRL0 -#define USBHS_GPTIMER0CTL_GPTCNT_MASK USBHS_GPTIMER0CTRL_GPTCNT_MASK -#define USBHS_GPTIMER0CTL_GPTCNT_SHIFT USBHS_GPTIMER0CTRL_GPTCNT_SHIFT -#define USBHS_GPTIMER0CTL_GPTCNT(x) USBHS_GPTIMER0CTRL_GPTCNT(x) -#define USBHS_GPTIMER0CTL_MODE_MASK USBHS_GPTIMER0CTRL_GPTMODE_MASK -#define USBHS_GPTIMER0CTL_MODE_SHIFT USBHS_GPTIMER0CTRL_GPTMODE_SHIFT -#define USBHS_GPTIMER0CTL_MODE(x) USBHS_GPTIMER0CTRL_GPTMODE(x) -#define USBHS_GPTIMER0CTL_RST_MASK USBHS_GPTIMER0CTRL_GPTRST_MASK -#define USBHS_GPTIMER0CTL_RST_SHIFT USBHS_GPTIMER0CTRL_GPTRST_SHIFT -#define USBHS_GPTIMER0CTL_RST(x) USBHS_GPTIMER0CTRL_GPTRST(x) -#define USBHS_GPTIMER0CTL_RUN_MASK USBHS_GPTIMER0CTRL_GPTRUN_MASK -#define USBHS_GPTIMER0CTL_RUN_SHIFT USBHS_GPTIMER0CTRL_GPTRUN_SHIFT -#define USBHS_GPTIMER0CTL_RUN(x) USBHS_GPTIMER0CTRL_GPTRUN(x) -#define USBHS_GPTIMER1CTL_GPTCNT_MASK USBHS_GPTIMER1CTRL_GPTCNT_MASK -#define USBHS_GPTIMER1CTL_GPTCNT_SHIFT USBHS_GPTIMER1CTRL_GPTCNT_SHIFT -#define USBHS_GPTIMER1CTL_GPTCNT(x) USBHS_GPTIMER1CTRL_GPTCNT(x) -#define USBHS_GPTIMER1CTL_MODE_MASK USBHS_GPTIMER1CTRL_GPTMODE_MASK -#define USBHS_GPTIMER1CTL_MODE_SHIFT USBHS_GPTIMER1CTRL_GPTMODE_SHIFT -#define USBHS_GPTIMER1CTL_MODE(x) USBHS_GPTIMER1CTRL_GPTMODE(x) -#define USBHS_GPTIMER1CTL_RST_MASK USBHS_GPTIMER1CTRL_GPTRST_MASK -#define USBHS_GPTIMER1CTL_RST_SHIFT USBHS_GPTIMER1CTRL_GPTRST_SHIFT -#define USBHS_GPTIMER1CTL_RST(x) USBHS_GPTIMER1CTRL_GPTRST(x) -#define USBHS_GPTIMER1CTL_RUN_MASK USBHS_GPTIMER1CTRL_GPTRUN_MASK -#define USBHS_GPTIMER1CTL_RUN_SHIFT USBHS_GPTIMER1CTRL_GPTRUN_SHIFT -#define USBHS_GPTIMER1CTL_RUN(x) USBHS_GPTIMER1CTRL_GPTRUN(x) -#define USBHS_USB_SBUSCFG_BURSTMODE_MASK USBHS_SBUSCFG_AHBBRST_MASK -#define USBHS_USB_SBUSCFG_BURSTMODE_SHIFT USBHS_SBUSCFG_AHBBRST_SHIFT -#define USBHS_USB_SBUSCFG_BURSTMODE(x) USBHS_SBUSCFG_AHBBRST(x) -#define USBHS_USBCMD_FS_MASK USBHS_USBCMD_FS_1_MASK -#define USBHS_USBCMD_FS_SHIFT USBHS_USBCMD_FS_1_SHIFT -#define USBHS_USBCMD_FS(x) USBHS_USBCMD_FS_1(x) -#define USBHS_EPLISTADDR_EPBASE_MASK USBHS_ENDPTLISTADDR_EPBASE_MASK -#define USBHS_EPLISTADDR_EPBASE_SHIFT USBHS_ENDPTLISTADDR_EPBASE_SHIFT -#define USBHS_EPLISTADDR_EPBASE(x) USBHS_ENDPTLISTADDR_EPBASE(x) -#define USBHS_EPSETUPSR_EPSETUPSTAT_MASK USBHS_ENDPTSETUPSTAT_ENDPTSETUPSTAT_MASK -#define USBHS_EPSETUPSR_EPSETUPSTAT_SHIFT USBHS_ENDPTSETUPSTAT_ENDPTSETUPSTAT_SHIFT -#define USBHS_EPSETUPSR_EPSETUPSTAT(x) USBHS_ENDPTSETUPSTAT_ENDPTSETUPSTAT(x) -#define USBHS_EPPRIME_PERB_MASK USBHS_ENDPTPRIME_PERB_MASK -#define USBHS_EPPRIME_PERB_SHIFT USBHS_ENDPTPRIME_PERB_SHIFT -#define USBHS_EPPRIME_PERB(x) USBHS_ENDPTPRIME_PERB(x) -#define USBHS_EPPRIME_PETB_MASK USBHS_ENDPTPRIME_PETB_MASK -#define USBHS_EPPRIME_PETB_SHIFT USBHS_ENDPTPRIME_PETB_SHIFT -#define USBHS_EPPRIME_PETB(x) USBHS_ENDPTPRIME_PETB(x) -#define USBHS_EPFLUSH_FERB_MASK USBHS_ENDPTFLUSH_FERB_MASK -#define USBHS_EPFLUSH_FERB_SHIFT USBHS_ENDPTFLUSH_FERB_SHIFT -#define USBHS_EPFLUSH_FERB(x) USBHS_ENDPTFLUSH_FERB(x) -#define USBHS_EPFLUSH_FETB_MASK USBHS_ENDPTFLUSH_FETB_MASK -#define USBHS_EPFLUSH_FETB_SHIFT USBHS_ENDPTFLUSH_FETB_SHIFT -#define USBHS_EPFLUSH_FETB(x) USBHS_ENDPTFLUSH_FETB(x) -#define USBHS_EPSR_ERBR_MASK USBHS_ENDPTSTAT_ERBR_MASK -#define USBHS_EPSR_ERBR_SHIFT USBHS_ENDPTSTAT_ERBR_SHIFT -#define USBHS_EPSR_ERBR(x) USBHS_ENDPTSTAT_ERBR(x) -#define USBHS_EPSR_ETBR_MASK USBHS_ENDPTSTAT_ETBR_MASK -#define USBHS_EPSR_ETBR_SHIFT USBHS_ENDPTSTAT_ETBR_SHIFT -#define USBHS_EPSR_ETBR(x) USBHS_ENDPTSTAT_ETBR(x) -#define USBHS_EPCOMPLETE_ERCE_MASK USBHS_ENDPTCOMPLETE_ERCE_MASK -#define USBHS_EPCOMPLETE_ERCE_SHIFT USBHS_ENDPTCOMPLETE_ERCE_SHIFT -#define USBHS_EPCOMPLETE_ERCE(x) USBHS_ENDPTCOMPLETE_ERCE(x) -#define USBHS_EPCOMPLETE_ETCE_MASK USBHS_ENDPTCOMPLETE_ETCE_MASK -#define USBHS_EPCOMPLETE_ETCE_SHIFT USBHS_ENDPTCOMPLETE_ETCE_SHIFT -#define USBHS_EPCOMPLETE_ETCE(x) USBHS_ENDPTCOMPLETE_ETCE(x) -#define USBHS_EPCR0_RXS_MASK USBHS_ENDPTCTRL0_RXS_MASK -#define USBHS_EPCR0_RXS_SHIFT USBHS_ENDPTCTRL0_RXS_SHIFT -#define USBHS_EPCR0_RXS(x) USBHS_ENDPTCTRL0_RXS(x) -#define USBHS_EPCR0_RXT_MASK USBHS_ENDPTCTRL0_RXT_MASK -#define USBHS_EPCR0_RXT_SHIFT USBHS_ENDPTCTRL0_RXT_SHIFT -#define USBHS_EPCR0_RXT(x) USBHS_ENDPTCTRL0_RXT(x) -#define USBHS_EPCR0_RXE_MASK USBHS_ENDPTCTRL0_RXE_MASK -#define USBHS_EPCR0_RXE_SHIFT USBHS_ENDPTCTRL0_RXE_SHIFT -#define USBHS_EPCR0_RXE(x) USBHS_ENDPTCTRL0_RXE(x) -#define USBHS_EPCR0_TXS_MASK USBHS_ENDPTCTRL0_TXS_MASK -#define USBHS_EPCR0_TXS_SHIFT USBHS_ENDPTCTRL0_TXS_SHIFT -#define USBHS_EPCR0_TXS(x) USBHS_ENDPTCTRL0_TXS(x) -#define USBHS_EPCR0_TXT_MASK USBHS_ENDPTCTRL0_TXT_MASK -#define USBHS_EPCR0_TXT_SHIFT USBHS_ENDPTCTRL0_TXT_SHIFT -#define USBHS_EPCR0_TXT(x) USBHS_ENDPTCTRL0_TXT(x) -#define USBHS_EPCR0_TXE_MASK USBHS_ENDPTCTRL0_TXE_MASK -#define USBHS_EPCR0_TXE_SHIFT USBHS_ENDPTCTRL0_TXE_SHIFT -#define USBHS_EPCR0_TXE(x) USBHS_ENDPTCTRL0_TXE(x) -#define USBHS_EPCR_RXS_MASK USBHS_ENDPTCTRL_RXS_MASK -#define USBHS_EPCR_RXS_SHIFT USBHS_ENDPTCTRL_RXS_SHIFT -#define USBHS_EPCR_RXS(x) USBHS_ENDPTCTRL_RXS(x) -#define USBHS_EPCR_RXD_MASK USBHS_ENDPTCTRL_RXD_MASK -#define USBHS_EPCR_RXD_SHIFT USBHS_ENDPTCTRL_RXD_SHIFT -#define USBHS_EPCR_RXD(x) USBHS_ENDPTCTRL_RXD(x) -#define USBHS_EPCR_RXT_MASK USBHS_ENDPTCTRL_RXT_MASK -#define USBHS_EPCR_RXT_SHIFT USBHS_ENDPTCTRL_RXT_SHIFT -#define USBHS_EPCR_RXT(x) USBHS_ENDPTCTRL_RXT(x) -#define USBHS_EPCR_RXI_MASK USBHS_ENDPTCTRL_RXI_MASK -#define USBHS_EPCR_RXI_SHIFT USBHS_ENDPTCTRL_RXI_SHIFT -#define USBHS_EPCR_RXI(x) USBHS_ENDPTCTRL_RXI(x) -#define USBHS_EPCR_RXR_MASK USBHS_ENDPTCTRL_RXR_MASK -#define USBHS_EPCR_RXR_SHIFT USBHS_ENDPTCTRL_RXR_SHIFT -#define USBHS_EPCR_RXR(x) USBHS_ENDPTCTRL_RXR(x) -#define USBHS_EPCR_RXE_MASK USBHS_ENDPTCTRL_RXE_MASK -#define USBHS_EPCR_RXE_SHIFT USBHS_ENDPTCTRL_RXE_SHIFT -#define USBHS_EPCR_RXE(x) USBHS_ENDPTCTRL_RXE(x) -#define USBHS_EPCR_TXS_MASK USBHS_ENDPTCTRL_TXS_MASK -#define USBHS_EPCR_TXS_SHIFT USBHS_ENDPTCTRL_TXS_SHIFT -#define USBHS_EPCR_TXS(x) USBHS_ENDPTCTRL_TXS(x) -#define USBHS_EPCR_TXD_MASK USBHS_ENDPTCTRL_TXD_MASK -#define USBHS_EPCR_TXD_SHIFT USBHS_ENDPTCTRL_TXD_SHIFT -#define USBHS_EPCR_TXD(x) USBHS_ENDPTCTRL_TXD(x) -#define USBHS_EPCR_TXT_MASK USBHS_ENDPTCTRL_TXT_MASK -#define USBHS_EPCR_TXT_SHIFT USBHS_ENDPTCTRL_TXT_SHIFT -#define USBHS_EPCR_TXT(x) USBHS_ENDPTCTRL_TXT(x) -#define USBHS_EPCR_TXI_MASK USBHS_ENDPTCTRL_TXI_MASK -#define USBHS_EPCR_TXI_SHIFT USBHS_ENDPTCTRL_TXI_SHIFT -#define USBHS_EPCR_TXI(x) USBHS_ENDPTCTRL_TXI(x) -#define USBHS_EPCR_TXR_MASK USBHS_ENDPTCTRL_TXR_MASK -#define USBHS_EPCR_TXR_SHIFT USBHS_ENDPTCTRL_TXR_SHIFT -#define USBHS_EPCR_TXR(x) USBHS_ENDPTCTRL_TXR(x) -#define USBHS_EPCR_TXE_MASK USBHS_ENDPTCTRL_TXE_MASK -#define USBHS_EPCR_TXE_SHIFT USBHS_ENDPTCTRL_TXE_SHIFT -#define USBHS_EPCR_TXE(x) USBHS_ENDPTCTRL_TXE(x) -#define USBHS_EPCR_COUNT USBHS_ENDPTCTRL_COUNT -#define USBHS_PORTSC1_WKDS_MASK USBHS_PORTSC1_WKDC_MASK -#define USBHS_PORTSC1_WKDS_SHIFT USBHS_PORTSC1_WKDC_SHIFT -#define USBHS_PORTSC1_WKDS(x) USBHS_PORTSC1_WKDC(x) -#define USBHS_IRQHandler USB1_HS_IRQHandler - - -/*! - * @} - */ /* end of group USBHS_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- USBHSDCD Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USBHSDCD_Peripheral_Access_Layer USBHSDCD Peripheral Access Layer - * @{ - */ - -/** USBHSDCD - Register Layout Typedef */ -typedef struct { - __IO uint32_t CONTROL; /**< Control, offset: 0x0 */ - __IO uint32_t CLOCK; /**< Clock, offset: 0x4 */ - __I uint32_t STATUS; /**< Status, offset: 0x8 */ - __IO uint32_t SIGNAL_OVERRIDE; /**< Signal Override, offset: 0xC */ - __IO uint32_t TIMER0; /**< TIMER0, offset: 0x10 */ - __IO uint32_t TIMER1; /**< TIMER1, offset: 0x14 */ - union { /* offset: 0x18 */ - __IO uint32_t TIMER2_BC11; /**< TIMER2_BC11, offset: 0x18 */ - __IO uint32_t TIMER2_BC12; /**< TIMER2_BC12, offset: 0x18 */ - }; -} USBHSDCD_Type; - -/* ---------------------------------------------------------------------------- - -- USBHSDCD Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USBHSDCD_Register_Masks USBHSDCD Register Masks - * @{ - */ - -/*! @name CONTROL - Control */ -/*! @{ */ - -#define USBHSDCD_CONTROL_IACK_MASK (0x1U) -#define USBHSDCD_CONTROL_IACK_SHIFT (0U) -/*! IACK - Interrupt Acknowledge - * 0b0..Do not clear the interrupt. - * 0b1..Clear the IF field (interrupt flag). - */ -#define USBHSDCD_CONTROL_IACK(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_CONTROL_IACK_SHIFT)) & USBHSDCD_CONTROL_IACK_MASK) - -#define USBHSDCD_CONTROL_IF_MASK (0x100U) -#define USBHSDCD_CONTROL_IF_SHIFT (8U) -/*! IF - Interrupt Flag - * 0b0..No interrupt is pending. - * 0b1..An interrupt is pending. - */ -#define USBHSDCD_CONTROL_IF(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_CONTROL_IF_SHIFT)) & USBHSDCD_CONTROL_IF_MASK) - -#define USBHSDCD_CONTROL_IE_MASK (0x10000U) -#define USBHSDCD_CONTROL_IE_SHIFT (16U) -/*! IE - Interrupt Enable - * 0b0..Disable interrupts to the system. - * 0b1..Enable interrupts to the system. - */ -#define USBHSDCD_CONTROL_IE(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_CONTROL_IE_SHIFT)) & USBHSDCD_CONTROL_IE_MASK) - -#define USBHSDCD_CONTROL_BC12_MASK (0x20000U) -#define USBHSDCD_CONTROL_BC12_SHIFT (17U) -/*! BC12 - Battery Charging Revision 1.2 Compatibility - * 0b0..Compatible with BC1.1 - * 0b1..Compatible with BC1.2 (default) - */ -#define USBHSDCD_CONTROL_BC12(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_CONTROL_BC12_SHIFT)) & USBHSDCD_CONTROL_BC12_MASK) - -#define USBHSDCD_CONTROL_START_MASK (0x1000000U) -#define USBHSDCD_CONTROL_START_SHIFT (24U) -/*! START - Start Change Detection Sequence - * 0b0..Do not start the sequence. Writes of this value have no effect. - * 0b1..Initiate the charger detection sequence. If the sequence is already running, writes of this value have no effect. - */ -#define USBHSDCD_CONTROL_START(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_CONTROL_START_SHIFT)) & USBHSDCD_CONTROL_START_MASK) - -#define USBHSDCD_CONTROL_SR_MASK (0x2000000U) -#define USBHSDCD_CONTROL_SR_SHIFT (25U) -/*! SR - Software Reset - * 0b0..Do not perform a software reset. - * 0b1..Perform a software reset. - */ -#define USBHSDCD_CONTROL_SR(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_CONTROL_SR_SHIFT)) & USBHSDCD_CONTROL_SR_MASK) -/*! @} */ - -/*! @name CLOCK - Clock */ -/*! @{ */ - -#define USBHSDCD_CLOCK_CLOCK_UNIT_MASK (0x1U) -#define USBHSDCD_CLOCK_CLOCK_UNIT_SHIFT (0U) -/*! CLOCK_UNIT - Unit of Measurement Encoding for Clock Speed - * 0b0..kHz Speed (between 4 kHz and 1023 kHz) - * 0b1..MHz Speed (between 1 MHz and 1023 MHz) - */ -#define USBHSDCD_CLOCK_CLOCK_UNIT(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_CLOCK_CLOCK_UNIT_SHIFT)) & USBHSDCD_CLOCK_CLOCK_UNIT_MASK) - -#define USBHSDCD_CLOCK_CLOCK_SPEED_MASK (0xFFCU) -#define USBHSDCD_CLOCK_CLOCK_SPEED_SHIFT (2U) -/*! CLOCK_SPEED - Numerical Value of Clock Speed in Binary */ -#define USBHSDCD_CLOCK_CLOCK_SPEED(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_CLOCK_CLOCK_SPEED_SHIFT)) & USBHSDCD_CLOCK_CLOCK_SPEED_MASK) -/*! @} */ - -/*! @name STATUS - Status */ -/*! @{ */ - -#define USBHSDCD_STATUS_SEQ_RES_MASK (0x30000U) -#define USBHSDCD_STATUS_SEQ_RES_SHIFT (16U) -/*! SEQ_RES - Charger Detection Sequence Results - * 0b00..No results to report. - * 0b01..Attached to an SDP. Must comply with USB 2.0 by drawing only 2.5 mA (max) until connected. - * 0b10..Attached to a charging port. The exact meaning depends on the STATUS[SEQ_STAT] field (value 0: Attached - * to either a CDP or a DCP. The charger type detection has not completed. value 1: Attached to a CDP. The - * charger type detection has completed.) - * 0b11..Attached to a DCP. - */ -#define USBHSDCD_STATUS_SEQ_RES(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_STATUS_SEQ_RES_SHIFT)) & USBHSDCD_STATUS_SEQ_RES_MASK) - -#define USBHSDCD_STATUS_SEQ_STAT_MASK (0xC0000U) -#define USBHSDCD_STATUS_SEQ_STAT_SHIFT (18U) -/*! SEQ_STAT - Charger Detection Sequence Status - * 0b00..The module is either not enabled, or the module is enabled but the data pins have not yet been detected. - * 0b01..Data pin contact detection is complete. - * 0b10..Charging port detection is complete. - * 0b11..Charger type detection is complete. - */ -#define USBHSDCD_STATUS_SEQ_STAT(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_STATUS_SEQ_STAT_SHIFT)) & USBHSDCD_STATUS_SEQ_STAT_MASK) - -#define USBHSDCD_STATUS_ERR_MASK (0x100000U) -#define USBHSDCD_STATUS_ERR_SHIFT (20U) -/*! ERR - Error Flag - * 0b0..No sequence errors. - * 0b1..Error in the detection sequence. - */ -#define USBHSDCD_STATUS_ERR(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_STATUS_ERR_SHIFT)) & USBHSDCD_STATUS_ERR_MASK) - -#define USBHSDCD_STATUS_TO_MASK (0x200000U) -#define USBHSDCD_STATUS_TO_SHIFT (21U) -/*! TO - Timeout Flag - * 0b0..The detection sequence is not running for over 1 s. - * 0b1..It is over 1 s since the data pin contact was detected and debounced. - */ -#define USBHSDCD_STATUS_TO(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_STATUS_TO_SHIFT)) & USBHSDCD_STATUS_TO_MASK) - -#define USBHSDCD_STATUS_ACTIVE_MASK (0x400000U) -#define USBHSDCD_STATUS_ACTIVE_SHIFT (22U) -/*! ACTIVE - Active Status Indicator - * 0b0..The sequence is not running. - * 0b1..The sequence is running. - */ -#define USBHSDCD_STATUS_ACTIVE(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_STATUS_ACTIVE_SHIFT)) & USBHSDCD_STATUS_ACTIVE_MASK) -/*! @} */ - -/*! @name SIGNAL_OVERRIDE - Signal Override */ -/*! @{ */ - -#define USBHSDCD_SIGNAL_OVERRIDE_PS_MASK (0x7U) -#define USBHSDCD_SIGNAL_OVERRIDE_PS_SHIFT (0U) -/*! PS - Phase Selection - * 0b000..No overrides. Field must remain at this value during normal USB data communication to prevent - * unexpected conditions on USB_DP and USB_DM pins. (Default) - * 0b001..Reserved, not for customer use. - * 0b010..Enables VDP_SRC voltage source for the USB_DP pin and IDM_SINK current source for the USB_DM pin. - * 0b011..Reserved, not for customer use. - * 0b100..Enables VDM_SRC voltage source only. - * 0b101..Reserved, not for customer use. - * 0b110..Reserved, not for customer use. - * 0b111..Reserved, not for customer use. - */ -#define USBHSDCD_SIGNAL_OVERRIDE_PS(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_SIGNAL_OVERRIDE_PS_SHIFT)) & USBHSDCD_SIGNAL_OVERRIDE_PS_MASK) -/*! @} */ - -/*! @name TIMER0 - TIMER0 */ -/*! @{ */ - -#define USBHSDCD_TIMER0_TUNITCON_MASK (0xFFFU) -#define USBHSDCD_TIMER0_TUNITCON_SHIFT (0U) -/*! TUNITCON - Unit Connection Timer Elapse (in ms) */ -#define USBHSDCD_TIMER0_TUNITCON(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_TIMER0_TUNITCON_SHIFT)) & USBHSDCD_TIMER0_TUNITCON_MASK) - -#define USBHSDCD_TIMER0_TSEQ_INIT_MASK (0x3FF0000U) -#define USBHSDCD_TIMER0_TSEQ_INIT_SHIFT (16U) -/*! TSEQ_INIT - Sequence Initiation Time - * 0b0000000000-0b1111111111..0 ms - 1023 ms - */ -#define USBHSDCD_TIMER0_TSEQ_INIT(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_TIMER0_TSEQ_INIT_SHIFT)) & USBHSDCD_TIMER0_TSEQ_INIT_MASK) -/*! @} */ - -/*! @name TIMER1 - TIMER1 */ -/*! @{ */ - -#define USBHSDCD_TIMER1_TVDPSRC_ON_MASK (0x3FFU) -#define USBHSDCD_TIMER1_TVDPSRC_ON_SHIFT (0U) -/*! TVDPSRC_ON - Time Period Comparator Enabled - * 0b0000000001-0b1111111111..1 ms - 1023 ms - */ -#define USBHSDCD_TIMER1_TVDPSRC_ON(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_TIMER1_TVDPSRC_ON_SHIFT)) & USBHSDCD_TIMER1_TVDPSRC_ON_MASK) - -#define USBHSDCD_TIMER1_TDCD_DBNC_MASK (0x3FF0000U) -#define USBHSDCD_TIMER1_TDCD_DBNC_SHIFT (16U) -/*! TDCD_DBNC - Time Period to Debounce D+ Signal - * 0b0000000001-0b1111111111..1 ms - 1023 ms - */ -#define USBHSDCD_TIMER1_TDCD_DBNC(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_TIMER1_TDCD_DBNC_SHIFT)) & USBHSDCD_TIMER1_TDCD_DBNC_MASK) -/*! @} */ - -/*! @name TIMER2_BC11 - TIMER2_BC11 */ -/*! @{ */ - -#define USBHSDCD_TIMER2_BC11_CHECK_DM_MASK (0xFU) -#define USBHSDCD_TIMER2_BC11_CHECK_DM_SHIFT (0U) -/*! CHECK_DM - Time Before Check of D- Line - * 0b0001-0b1111..1 ms - 15 ms - */ -#define USBHSDCD_TIMER2_BC11_CHECK_DM(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_TIMER2_BC11_CHECK_DM_SHIFT)) & USBHSDCD_TIMER2_BC11_CHECK_DM_MASK) - -#define USBHSDCD_TIMER2_BC11_TVDPSRC_CON_MASK (0x3FF0000U) -#define USBHSDCD_TIMER2_BC11_TVDPSRC_CON_SHIFT (16U) -/*! TVDPSRC_CON - Time Period Before Enabling D+ Pullup - * 0b0000000001-0b1111111111..1 ms - 1023 ms - */ -#define USBHSDCD_TIMER2_BC11_TVDPSRC_CON(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_TIMER2_BC11_TVDPSRC_CON_SHIFT)) & USBHSDCD_TIMER2_BC11_TVDPSRC_CON_MASK) -/*! @} */ - -/*! @name TIMER2_BC12 - TIMER2_BC12 */ -/*! @{ */ - -#define USBHSDCD_TIMER2_BC12_TVDMSRC_ON_MASK (0x3FFU) -#define USBHSDCD_TIMER2_BC12_TVDMSRC_ON_SHIFT (0U) -/*! TVDMSRC_ON - TVDMSRC_ON - * 0b0000000000-0b0000101000..0 ms - 40 ms - */ -#define USBHSDCD_TIMER2_BC12_TVDMSRC_ON(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_TIMER2_BC12_TVDMSRC_ON_SHIFT)) & USBHSDCD_TIMER2_BC12_TVDMSRC_ON_MASK) - -#define USBHSDCD_TIMER2_BC12_TWAIT_AFTER_PRD_MASK (0x3FF0000U) -#define USBHSDCD_TIMER2_BC12_TWAIT_AFTER_PRD_SHIFT (16U) -/*! TWAIT_AFTER_PRD - TWAIT_AFTER_PRD - * 0b0000000001-0b1111111111..1 ms - 1023 ms - */ -#define USBHSDCD_TIMER2_BC12_TWAIT_AFTER_PRD(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_TIMER2_BC12_TWAIT_AFTER_PRD_SHIFT)) & USBHSDCD_TIMER2_BC12_TWAIT_AFTER_PRD_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group USBHSDCD_Register_Masks */ - - -/* USBHSDCD - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral USBHS1_PHY_DCD base address */ - #define USBHS1_PHY_DCD_BASE (0x5010A800u) - /** Peripheral USBHS1_PHY_DCD base address */ - #define USBHS1_PHY_DCD_BASE_NS (0x4010A800u) - /** Peripheral USBHS1_PHY_DCD base pointer */ - #define USBHS1_PHY_DCD ((USBHSDCD_Type *)USBHS1_PHY_DCD_BASE) - /** Peripheral USBHS1_PHY_DCD base pointer */ - #define USBHS1_PHY_DCD_NS ((USBHSDCD_Type *)USBHS1_PHY_DCD_BASE_NS) - /** Array initializer of USBHSDCD peripheral base addresses */ - #define USBHSDCD_BASE_ADDRS { USBHS1_PHY_DCD_BASE } - /** Array initializer of USBHSDCD peripheral base pointers */ - #define USBHSDCD_BASE_PTRS { USBHS1_PHY_DCD } - /** Array initializer of USBHSDCD peripheral base addresses */ - #define USBHSDCD_BASE_ADDRS_NS { USBHS1_PHY_DCD_BASE_NS } - /** Array initializer of USBHSDCD peripheral base pointers */ - #define USBHSDCD_BASE_PTRS_NS { USBHS1_PHY_DCD_NS } -#else - /** Peripheral USBHS1_PHY_DCD base address */ - #define USBHS1_PHY_DCD_BASE (0x4010A800u) - /** Peripheral USBHS1_PHY_DCD base pointer */ - #define USBHS1_PHY_DCD ((USBHSDCD_Type *)USBHS1_PHY_DCD_BASE) - /** Array initializer of USBHSDCD peripheral base addresses */ - #define USBHSDCD_BASE_ADDRS { USBHS1_PHY_DCD_BASE } - /** Array initializer of USBHSDCD peripheral base pointers */ - #define USBHSDCD_BASE_PTRS { USBHS1_PHY_DCD } -#endif -/* Backward compatibility */ -#define USBHSDCD_IRQS { USB1_HS_PHY_IRQn } -#define USB1_HS_PHY_IRQS USBPHY_IRQS - - -/*! - * @} - */ /* end of group USBHSDCD_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- USBNC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USBNC_Peripheral_Access_Layer USBNC Peripheral Access Layer - * @{ - */ - -/** USBNC - Register Layout Typedef */ -typedef struct { - __IO uint32_t CTRL1; /**< USB OTG Control 1, offset: 0x0 */ - __IO uint32_t CTRL2; /**< USB OTG Control 2, offset: 0x4 */ - uint8_t RESERVED_0[8]; - __IO uint32_t HSIC_CTRL; /**< USB Host HSIC Control, offset: 0x10 */ -} USBNC_Type; - -/* ---------------------------------------------------------------------------- - -- USBNC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USBNC_Register_Masks USBNC Register Masks - * @{ - */ - -/*! @name CTRL1 - USB OTG Control 1 */ -/*! @{ */ - -#define USBNC_CTRL1_OVER_CUR_DIS_MASK (0x80U) -#define USBNC_CTRL1_OVER_CUR_DIS_SHIFT (7U) -/*! OVER_CUR_DIS - Disable Overcurrent Detection - * 0b1..Disables - * 0b0..Enables - */ -#define USBNC_CTRL1_OVER_CUR_DIS(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL1_OVER_CUR_DIS_SHIFT)) & USBNC_CTRL1_OVER_CUR_DIS_MASK) - -#define USBNC_CTRL1_OVER_CUR_POL_MASK (0x100U) -#define USBNC_CTRL1_OVER_CUR_POL_SHIFT (8U) -/*! OVER_CUR_POL - Polarity of Overcurrent - * 0b1..Low active (low on this signal represents an overcurrent condition) - * 0b0..High active (high on this signal represents an overcurrent condition) - */ -#define USBNC_CTRL1_OVER_CUR_POL(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL1_OVER_CUR_POL_SHIFT)) & USBNC_CTRL1_OVER_CUR_POL_MASK) - -#define USBNC_CTRL1_PWR_POL_MASK (0x200U) -#define USBNC_CTRL1_PWR_POL_SHIFT (9U) -/*! PWR_POL - Power Polarity - * 0b1..PMIC Power Pin is High active. - * 0b0..PMIC Power Pin is Low active. - */ -#define USBNC_CTRL1_PWR_POL(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL1_PWR_POL_SHIFT)) & USBNC_CTRL1_PWR_POL_MASK) - -#define USBNC_CTRL1_WIE_MASK (0x400U) -#define USBNC_CTRL1_WIE_SHIFT (10U) -/*! WIE - Wake-up Interrupt Enable - * 0b1..Interrupt Enabled - * 0b0..Interrupt Disabled - */ -#define USBNC_CTRL1_WIE(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL1_WIE_SHIFT)) & USBNC_CTRL1_WIE_MASK) - -#define USBNC_CTRL1_WKUP_SW_EN_MASK (0x4000U) -#define USBNC_CTRL1_WKUP_SW_EN_SHIFT (14U) -/*! WKUP_SW_EN - Software Wake-up Enable - * 0b1..Enables - * 0b0..Disables - */ -#define USBNC_CTRL1_WKUP_SW_EN(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL1_WKUP_SW_EN_SHIFT)) & USBNC_CTRL1_WKUP_SW_EN_MASK) - -#define USBNC_CTRL1_WKUP_SW_MASK (0x8000U) -#define USBNC_CTRL1_WKUP_SW_SHIFT (15U) -/*! WKUP_SW - Software Wake-up - * 0b1..Force wake-up - * 0b0..Inactive - */ -#define USBNC_CTRL1_WKUP_SW(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL1_WKUP_SW_SHIFT)) & USBNC_CTRL1_WKUP_SW_MASK) - -#define USBNC_CTRL1_WKUP_ID_EN_MASK (0x10000U) -#define USBNC_CTRL1_WKUP_ID_EN_SHIFT (16U) -/*! WKUP_ID_EN - Wake-up on ID Change Enable - * 0b1..Enables - * 0b0..Disables - */ -#define USBNC_CTRL1_WKUP_ID_EN(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL1_WKUP_ID_EN_SHIFT)) & USBNC_CTRL1_WKUP_ID_EN_MASK) - -#define USBNC_CTRL1_WKUP_VBUS_EN_MASK (0x20000U) -#define USBNC_CTRL1_WKUP_VBUS_EN_SHIFT (17U) -/*! WKUP_VBUS_EN - Wake-up on VBUS Change Enable - * 0b1..Enables - * 0b0..Disables - */ -#define USBNC_CTRL1_WKUP_VBUS_EN(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL1_WKUP_VBUS_EN_SHIFT)) & USBNC_CTRL1_WKUP_VBUS_EN_MASK) - -#define USBNC_CTRL1_WKUP_DPDM_EN_MASK (0x20000000U) -#define USBNC_CTRL1_WKUP_DPDM_EN_SHIFT (29U) -/*! WKUP_DPDM_EN - Wake-up on DPDM Change Enable - * 0b1..DPDM changes wake-up to be enabled, it is for device only - * 0b0..DPDM changes wake-up to be disabled only when VBUS is 0 - */ -#define USBNC_CTRL1_WKUP_DPDM_EN(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL1_WKUP_DPDM_EN_SHIFT)) & USBNC_CTRL1_WKUP_DPDM_EN_MASK) - -#define USBNC_CTRL1_WIR_MASK (0x80000000U) -#define USBNC_CTRL1_WIR_SHIFT (31U) -/*! WIR - Wake-up Interrupt Request - * 0b1..Request received - * 0b0..No request received - */ -#define USBNC_CTRL1_WIR(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL1_WIR_SHIFT)) & USBNC_CTRL1_WIR_MASK) -/*! @} */ - -/*! @name CTRL2 - USB OTG Control 2 */ -/*! @{ */ - -#define USBNC_CTRL2_VBUS_SOURCE_SEL_MASK (0x3U) -#define USBNC_CTRL2_VBUS_SOURCE_SEL_SHIFT (0U) -/*! VBUS_SOURCE_SEL - VBUS Source Select - * 0b00..vbus_valid - * 0b01..sess_valid - * 0b10..sess_valid - * 0b11..sess_valid - */ -#define USBNC_CTRL2_VBUS_SOURCE_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL2_VBUS_SOURCE_SEL_SHIFT)) & USBNC_CTRL2_VBUS_SOURCE_SEL_MASK) - -#define USBNC_CTRL2_AUTURESUME_EN_MASK (0x4U) -#define USBNC_CTRL2_AUTURESUME_EN_SHIFT (2U) -/*! AUTURESUME_EN - Auto Resume Enable - * 0b0..Default - */ -#define USBNC_CTRL2_AUTURESUME_EN(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL2_AUTURESUME_EN_SHIFT)) & USBNC_CTRL2_AUTURESUME_EN_MASK) - -#define USBNC_CTRL2_LOWSPEED_EN_MASK (0x8U) -#define USBNC_CTRL2_LOWSPEED_EN_SHIFT (3U) -/*! LOWSPEED_EN - Low Speed Enable - * 0b0..Default - */ -#define USBNC_CTRL2_LOWSPEED_EN(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL2_LOWSPEED_EN_SHIFT)) & USBNC_CTRL2_LOWSPEED_EN_MASK) - -#define USBNC_CTRL2_UTMI_CLK_VLD_MASK (0x80000000U) -#define USBNC_CTRL2_UTMI_CLK_VLD_SHIFT (31U) -/*! UTMI_CLK_VLD - UTMI Clock Valid - * 0b0..Default - */ -#define USBNC_CTRL2_UTMI_CLK_VLD(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL2_UTMI_CLK_VLD_SHIFT)) & USBNC_CTRL2_UTMI_CLK_VLD_MASK) -/*! @} */ - -/*! @name HSIC_CTRL - USB Host HSIC Control */ -/*! @{ */ - -#define USBNC_HSIC_CTRL_HSIC_CLK_ON_MASK (0x800U) -#define USBNC_HSIC_CTRL_HSIC_CLK_ON_SHIFT (11U) -/*! HSIC_CLK_ON - HSIC Clock ON - * 0b1..Active - * 0b0..Inactive - */ -#define USBNC_HSIC_CTRL_HSIC_CLK_ON(x) (((uint32_t)(((uint32_t)(x)) << USBNC_HSIC_CTRL_HSIC_CLK_ON_SHIFT)) & USBNC_HSIC_CTRL_HSIC_CLK_ON_MASK) - -#define USBNC_HSIC_CTRL_HSIC_EN_MASK (0x1000U) -#define USBNC_HSIC_CTRL_HSIC_EN_SHIFT (12U) -/*! HSIC_EN - Host HSIC Enable - * 0b1..Enabled - * 0b0..Disabled - */ -#define USBNC_HSIC_CTRL_HSIC_EN(x) (((uint32_t)(((uint32_t)(x)) << USBNC_HSIC_CTRL_HSIC_EN_SHIFT)) & USBNC_HSIC_CTRL_HSIC_EN_MASK) - -#define USBNC_HSIC_CTRL_CLK_VLD_MASK (0x80000000U) -#define USBNC_HSIC_CTRL_CLK_VLD_SHIFT (31U) -/*! CLK_VLD - Clock Valid - * 0b1..Valid - * 0b0..Invalid - */ -#define USBNC_HSIC_CTRL_CLK_VLD(x) (((uint32_t)(((uint32_t)(x)) << USBNC_HSIC_CTRL_CLK_VLD_SHIFT)) & USBNC_HSIC_CTRL_CLK_VLD_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group USBNC_Register_Masks */ - - -/* USBNC - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral USBHS1__USBNC base address */ - #define USBHS1__USBNC_BASE (0x5010B200u) - /** Peripheral USBHS1__USBNC base address */ - #define USBHS1__USBNC_BASE_NS (0x4010B200u) - /** Peripheral USBHS1__USBNC base pointer */ - #define USBHS1__USBNC ((USBNC_Type *)USBHS1__USBNC_BASE) - /** Peripheral USBHS1__USBNC base pointer */ - #define USBHS1__USBNC_NS ((USBNC_Type *)USBHS1__USBNC_BASE_NS) - /** Array initializer of USBNC peripheral base addresses */ - #define USBNC_BASE_ADDRS { USBHS1__USBNC_BASE } - /** Array initializer of USBNC peripheral base pointers */ - #define USBNC_BASE_PTRS { USBHS1__USBNC } - /** Array initializer of USBNC peripheral base addresses */ - #define USBNC_BASE_ADDRS_NS { USBHS1__USBNC_BASE_NS } - /** Array initializer of USBNC peripheral base pointers */ - #define USBNC_BASE_PTRS_NS { USBHS1__USBNC_NS } -#else - /** Peripheral USBHS1__USBNC base address */ - #define USBHS1__USBNC_BASE (0x4010B200u) - /** Peripheral USBHS1__USBNC base pointer */ - #define USBHS1__USBNC ((USBNC_Type *)USBHS1__USBNC_BASE) - /** Array initializer of USBNC peripheral base addresses */ - #define USBNC_BASE_ADDRS { USBHS1__USBNC_BASE } - /** Array initializer of USBNC peripheral base pointers */ - #define USBNC_BASE_PTRS { USBHS1__USBNC } -#endif -/* Backward compatibility */ -#define USB_OTGn_CTRL CTRL1 -#define USBNC_USB_OTGn_CTRL_OVER_CUR_DIS_MASK USBNC_CTRL1_OVER_CUR_DIS_MASK -#define USBNC_USB_OTGn_CTRL_OVER_CUR_DIS_SHIFT USBNC_CTRL1_OVER_CUR_DIS_SHIFT -#define USBNC_USB_OTGn_CTRL_OVER_CUR_DIS(x) USBNC_CTRL1_OVER_CUR_DIS(x) -#define USBNC_USB_OTGn_CTRL_OVER_CUR_POL_MASK USBNC_CTRL1_OVER_CUR_POL_MASK -#define USBNC_USB_OTGn_CTRL_OVER_CUR_POL_SHIFT USBNC_CTRL1_OVER_CUR_POL_SHIFT -#define USBNC_USB_OTGn_CTRL_OVER_CUR_POL(x) USBNC_CTRL1_OVER_CUR_POL(x) -#define USBNC_USB_OTGn_CTRL_PWR_POL_MASK USBNC_CTRL1_PWR_POL_MASK -#define USBNC_USB_OTGn_CTRL_PWR_POL_SHIFT USBNC_CTRL1_PWR_POL_SHIFT -#define USBNC_USB_OTGn_CTRL_PWR_POL(x) USBNC_CTRL1_PWR_POL(x) -#define USBNC_USB_OTGn_CTRL_WIE_MASK USBNC_CTRL1_WIE_MASK -#define USBNC_USB_OTGn_CTRL_WIE_SHIFT USBNC_CTRL1_WIE_SHIFT -#define USBNC_USB_OTGn_CTRL_WIE(x) USBNC_CTRL1_WIE(x) -#define USBNC_USB_OTGn_CTRL_WKUP_SW_EN_MASK USBNC_CTRL1_WKUP_SW_EN_MASK -#define USBNC_USB_OTGn_CTRL_WKUP_SW_EN_SHIFT USBNC_CTRL1_WKUP_SW_EN_SHIFT -#define USBNC_USB_OTGn_CTRL_WKUP_SW_EN(x) USBNC_CTRL1_WKUP_SW_EN(x) -#define USBNC_USB_OTGn_CTRL_WKUP_SW_MASK USBNC_CTRL1_WKUP_SW_MASK -#define USBNC_USB_OTGn_CTRL_WKUP_SW_SHIFT USBNC_CTRL1_WKUP_SW_SHIFT -#define USBNC_USB_OTGn_CTRL_WKUP_SW(x) USBNC_CTRL1_WKUP_SW(x) -#define USBNC_USB_OTGn_CTRL_WKUP_ID_EN_MASK USBNC_CTRL1_WKUP_ID_EN_MASK -#define USBNC_USB_OTGn_CTRL_WKUP_ID_EN_SHIFT USBNC_CTRL1_WKUP_ID_EN_SHIFT -#define USBNC_USB_OTGn_CTRL_WKUP_ID_EN(x) USBNC_CTRL1_WKUP_ID_EN(x) -#define USBNC_USB_OTGn_CTRL_WKUP_VBUS_EN_MASK USBNC_CTRL1_WKUP_VBUS_EN_MASK -#define USBNC_USB_OTGn_CTRL_WKUP_VBUS_EN_SHIFT USBNC_CTRL1_WKUP_VBUS_EN_SHIFT -#define USBNC_USB_OTGn_CTRL_WKUP_VBUS_EN(x) USBNC_CTRL1_WKUP_VBUS_EN(x) -#define USBNC_USB_OTGn_CTRL_WKUP_DPDM_EN_MASK USBNC_CTRL1_WKUP_DPDM_EN_MASK -#define USBNC_USB_OTGn_CTRL_WKUP_DPDM_EN_SHIFT USBNC_CTRL1_WKUP_DPDM_EN_SHIFT -#define USBNC_USB_OTGn_CTRL_WKUP_DPDM_EN(x) USBNC_CTRL1_WKUP_DPDM_EN(x) -#define USBNC_USB_OTGn_CTRL_WIR_MASK USBNC_CTRL1_WIR_MASK -#define USBNC_USB_OTGn_CTRL_WIR_SHIFT USBNC_CTRL1_WIR_SHIFT -#define USBNC_USB_OTGn_CTRL_WIR(x) USBNC_CTRL1_WIR(x) - - -/*! - * @} - */ /* end of group USBNC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- USBPHY Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USBPHY_Peripheral_Access_Layer USBPHY Peripheral Access Layer - * @{ - */ - -/** USBPHY - Register Layout Typedef */ -typedef struct { - __IO uint32_t PWD; /**< Power Down, offset: 0x0 */ - __IO uint32_t PWD_SET; /**< Power Down, offset: 0x4 */ - __IO uint32_t PWD_CLR; /**< Power Down, offset: 0x8 */ - __IO uint32_t PWD_TOG; /**< Power Down, offset: 0xC */ - __IO uint32_t TX; /**< TX Control, offset: 0x10 */ - __IO uint32_t TX_SET; /**< TX Control, offset: 0x14 */ - __IO uint32_t TX_CLR; /**< TX Control, offset: 0x18 */ - __IO uint32_t TX_TOG; /**< TX Control, offset: 0x1C */ - __IO uint32_t RX; /**< RX Control, offset: 0x20 */ - __IO uint32_t RX_SET; /**< RX Control, offset: 0x24 */ - __IO uint32_t RX_CLR; /**< RX Control, offset: 0x28 */ - __IO uint32_t RX_TOG; /**< RX Control, offset: 0x2C */ - __IO uint32_t CTRL; /**< General Purpose Control, offset: 0x30 */ - __IO uint32_t CTRL_SET; /**< General Purpose Control, offset: 0x34 */ - __IO uint32_t CTRL_CLR; /**< General Purpose Control, offset: 0x38 */ - __IO uint32_t CTRL_TOG; /**< General Purpose Control, offset: 0x3C */ - __IO uint32_t STATUS; /**< Status, offset: 0x40 */ - uint8_t RESERVED_0[12]; - __IO uint32_t DEBUG0; /**< Debug 0, offset: 0x50 */ - __IO uint32_t DEBUG0_SET; /**< Debug 0, offset: 0x54 */ - __IO uint32_t DEBUG0_CLR; /**< Debug 0, offset: 0x58 */ - __IO uint32_t DEBUG0_TOG; /**< Debug 0, offset: 0x5C */ - uint8_t RESERVED_1[32]; - __I uint32_t VERSION; /**< Version, offset: 0x80 */ - uint8_t RESERVED_2[12]; - __IO uint32_t IP; /**< IP Block, offset: 0x90 */ - __IO uint32_t IP_SET; /**< IP Block, offset: 0x94 */ - __IO uint32_t IP_CLR; /**< IP Block, offset: 0x98 */ - __IO uint32_t IP_TOG; /**< IP Block, offset: 0x9C */ - __IO uint32_t PLL_SIC; /**< PLL SIC, offset: 0xA0 */ - __IO uint32_t PLL_SIC_SET; /**< PLL SIC, offset: 0xA4 */ - __IO uint32_t PLL_SIC_CLR; /**< PLL SIC, offset: 0xA8 */ - __IO uint32_t PLL_SIC_TOG; /**< PLL SIC, offset: 0xAC */ - uint8_t RESERVED_3[16]; - __IO uint32_t USB1_VBUS_DETECT; /**< VBUS Detect, offset: 0xC0 */ - __IO uint32_t USB1_VBUS_DETECT_SET; /**< VBUS Detect, offset: 0xC4 */ - __IO uint32_t USB1_VBUS_DETECT_CLR; /**< VBUS Detect, offset: 0xC8 */ - __IO uint32_t USB1_VBUS_DETECT_TOG; /**< VBUS Detect, offset: 0xCC */ - __I uint32_t USB1_VBUS_DET_STAT; /**< VBUS Detect Status, offset: 0xD0 */ - __I uint32_t USB1_VBUS_DET_STAT_SET; /**< VBUS Detect Status, offset: 0xD4 */ - __I uint32_t USB1_VBUS_DET_STAT_CLR; /**< VBUS Detect Status, offset: 0xD8 */ - __I uint32_t USB1_VBUS_DET_STAT_TOG; /**< VBUS Detect Status, offset: 0xDC */ - __IO uint32_t USB1_CHRG_DETECT; /**< Charger Detect, offset: 0xE0 */ - __IO uint32_t USB1_CHRG_DETECT_SET; /**< Charger Detect, offset: 0xE4 */ - __IO uint32_t USB1_CHRG_DETECT_CLR; /**< Charger Detect, offset: 0xE8 */ - __IO uint32_t USB1_CHRG_DETECT_TOG; /**< Charger Detect, offset: 0xEC */ - __I uint32_t USB1_CHRG_DET_STAT; /**< Charger Detect Status, offset: 0xF0 */ - __I uint32_t USB1_CHRG_DET_STAT_SET; /**< Charger Detect Status, offset: 0xF4 */ - __I uint32_t USB1_CHRG_DET_STAT_CLR; /**< Charger Detect Status, offset: 0xF8 */ - __I uint32_t USB1_CHRG_DET_STAT_TOG; /**< Charger Detect Status, offset: 0xFC */ - __IO uint32_t ANACTRL; /**< Analog Control, offset: 0x100 */ - __IO uint32_t ANACTRL_SET; /**< Analog Control, offset: 0x104 */ - __IO uint32_t ANACTRL_CLR; /**< Analog Control, offset: 0x108 */ - __IO uint32_t ANACTRL_TOG; /**< Analog Control, offset: 0x10C */ - uint8_t RESERVED_4[32]; - __IO uint32_t TRIM_OVERRIDE_EN; /**< Trim, offset: 0x130 */ - __IO uint32_t TRIM_OVERRIDE_EN_SET; /**< Trim, offset: 0x134 */ - __IO uint32_t TRIM_OVERRIDE_EN_CLR; /**< Trim, offset: 0x138 */ - __IO uint32_t TRIM_OVERRIDE_EN_TOG; /**< Trim, offset: 0x13C */ - __IO uint32_t PFDA; /**< PFD A, offset: 0x140 */ - __IO uint32_t PFDA_SET; /**< PFD A, offset: 0x144 */ - __IO uint32_t PFDA_CLR; /**< PFD A, offset: 0x148 */ - __IO uint32_t PFDA_TOG; /**< PFD A, offset: 0x14C */ -} USBPHY_Type; - -/* ---------------------------------------------------------------------------- - -- USBPHY Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USBPHY_Register_Masks USBPHY Register Masks - * @{ - */ - -/*! @name PWD - Power Down */ -/*! @{ */ - -#define USBPHY_PWD_TXPWDFS_MASK (0x400U) -#define USBPHY_PWD_TXPWDFS_SHIFT (10U) -/*! TXPWDFS - Power Down USB FS TX Drivers - * 0b0..Provide bias to enable - * 0b1..Disable or power down - */ -#define USBPHY_PWD_TXPWDFS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_TXPWDFS_SHIFT)) & USBPHY_PWD_TXPWDFS_MASK) - -#define USBPHY_PWD_TXPWDIBIAS_MASK (0x800U) -#define USBPHY_PWD_TXPWDIBIAS_SHIFT (11U) -/*! TXPWDIBIAS - Power Down USBPHY TX Current Bias Block - * 0b0..Enable - * 0b1..Disable or power down - */ -#define USBPHY_PWD_TXPWDIBIAS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_TXPWDIBIAS_SHIFT)) & USBPHY_PWD_TXPWDIBIAS_MASK) - -#define USBPHY_PWD_TXPWDV2I_MASK (0x1000U) -#define USBPHY_PWD_TXPWDV2I_SHIFT (12U) -/*! TXPWDV2I - Power Down USBPHY TX V-I Converter and Current Mirror - * 0b0..Enable - * 0b1..Disable or power down - */ -#define USBPHY_PWD_TXPWDV2I(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_TXPWDV2I_SHIFT)) & USBPHY_PWD_TXPWDV2I_MASK) - -#define USBPHY_PWD_RXPWDENV_MASK (0x20000U) -#define USBPHY_PWD_RXPWDENV_SHIFT (17U) -/*! RXPWDENV - Power Down USB HS RX Envelope Detector - * 0b0..Enable - * 0b1..Disable or power down - */ -#define USBPHY_PWD_RXPWDENV(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_RXPWDENV_SHIFT)) & USBPHY_PWD_RXPWDENV_MASK) - -#define USBPHY_PWD_RXPWD1PT1_MASK (0x40000U) -#define USBPHY_PWD_RXPWD1PT1_SHIFT (18U) -/*! RXPWD1PT1 - Power Down USB FS Differential Receiver - * 0b0..Enable - * 0b1..Disable or power down - */ -#define USBPHY_PWD_RXPWD1PT1(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_RXPWD1PT1_SHIFT)) & USBPHY_PWD_RXPWD1PT1_MASK) - -#define USBPHY_PWD_RXPWDDIFF_MASK (0x80000U) -#define USBPHY_PWD_RXPWDDIFF_SHIFT (19U) -/*! RXPWDDIFF - Power Down USB HS Differential Receiver - * 0b0..Enable - * 0b1..Disable or power down - */ -#define USBPHY_PWD_RXPWDDIFF(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_RXPWDDIFF_SHIFT)) & USBPHY_PWD_RXPWDDIFF_MASK) - -#define USBPHY_PWD_RXPWDRX_MASK (0x100000U) -#define USBPHY_PWD_RXPWDRX_SHIFT (20U) -/*! RXPWDRX - Power Down USBPHY Receiver Circuits - * 0b0..Enable - * 0b1..Disable or power down - */ -#define USBPHY_PWD_RXPWDRX(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_RXPWDRX_SHIFT)) & USBPHY_PWD_RXPWDRX_MASK) -/*! @} */ - -/*! @name PWD_SET - Power Down */ -/*! @{ */ - -#define USBPHY_PWD_SET_TXPWDFS_MASK (0x400U) -#define USBPHY_PWD_SET_TXPWDFS_SHIFT (10U) -/*! TXPWDFS - Power Down USB FS TX Drivers */ -#define USBPHY_PWD_SET_TXPWDFS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_SET_TXPWDFS_SHIFT)) & USBPHY_PWD_SET_TXPWDFS_MASK) - -#define USBPHY_PWD_SET_TXPWDIBIAS_MASK (0x800U) -#define USBPHY_PWD_SET_TXPWDIBIAS_SHIFT (11U) -/*! TXPWDIBIAS - Power Down USBPHY TX Current Bias Block */ -#define USBPHY_PWD_SET_TXPWDIBIAS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_SET_TXPWDIBIAS_SHIFT)) & USBPHY_PWD_SET_TXPWDIBIAS_MASK) - -#define USBPHY_PWD_SET_TXPWDV2I_MASK (0x1000U) -#define USBPHY_PWD_SET_TXPWDV2I_SHIFT (12U) -/*! TXPWDV2I - Power Down USBPHY TX V-I Converter and Current Mirror */ -#define USBPHY_PWD_SET_TXPWDV2I(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_SET_TXPWDV2I_SHIFT)) & USBPHY_PWD_SET_TXPWDV2I_MASK) - -#define USBPHY_PWD_SET_RXPWDENV_MASK (0x20000U) -#define USBPHY_PWD_SET_RXPWDENV_SHIFT (17U) -/*! RXPWDENV - Power Down USB HS RX Envelope Detector */ -#define USBPHY_PWD_SET_RXPWDENV(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_SET_RXPWDENV_SHIFT)) & USBPHY_PWD_SET_RXPWDENV_MASK) - -#define USBPHY_PWD_SET_RXPWD1PT1_MASK (0x40000U) -#define USBPHY_PWD_SET_RXPWD1PT1_SHIFT (18U) -/*! RXPWD1PT1 - Power Down USB FS Differential Receiver */ -#define USBPHY_PWD_SET_RXPWD1PT1(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_SET_RXPWD1PT1_SHIFT)) & USBPHY_PWD_SET_RXPWD1PT1_MASK) - -#define USBPHY_PWD_SET_RXPWDDIFF_MASK (0x80000U) -#define USBPHY_PWD_SET_RXPWDDIFF_SHIFT (19U) -/*! RXPWDDIFF - Power Down USB HS Differential Receiver */ -#define USBPHY_PWD_SET_RXPWDDIFF(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_SET_RXPWDDIFF_SHIFT)) & USBPHY_PWD_SET_RXPWDDIFF_MASK) - -#define USBPHY_PWD_SET_RXPWDRX_MASK (0x100000U) -#define USBPHY_PWD_SET_RXPWDRX_SHIFT (20U) -/*! RXPWDRX - Power Down USBPHY Receiver Circuits */ -#define USBPHY_PWD_SET_RXPWDRX(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_SET_RXPWDRX_SHIFT)) & USBPHY_PWD_SET_RXPWDRX_MASK) -/*! @} */ - -/*! @name PWD_CLR - Power Down */ -/*! @{ */ - -#define USBPHY_PWD_CLR_TXPWDFS_MASK (0x400U) -#define USBPHY_PWD_CLR_TXPWDFS_SHIFT (10U) -/*! TXPWDFS - Power Down USB FS TX Drivers */ -#define USBPHY_PWD_CLR_TXPWDFS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_CLR_TXPWDFS_SHIFT)) & USBPHY_PWD_CLR_TXPWDFS_MASK) - -#define USBPHY_PWD_CLR_TXPWDIBIAS_MASK (0x800U) -#define USBPHY_PWD_CLR_TXPWDIBIAS_SHIFT (11U) -/*! TXPWDIBIAS - Power Down USBPHY TX Current Bias Block */ -#define USBPHY_PWD_CLR_TXPWDIBIAS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_CLR_TXPWDIBIAS_SHIFT)) & USBPHY_PWD_CLR_TXPWDIBIAS_MASK) - -#define USBPHY_PWD_CLR_TXPWDV2I_MASK (0x1000U) -#define USBPHY_PWD_CLR_TXPWDV2I_SHIFT (12U) -/*! TXPWDV2I - Power Down USBPHY TX V-I Converter and Current Mirror */ -#define USBPHY_PWD_CLR_TXPWDV2I(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_CLR_TXPWDV2I_SHIFT)) & USBPHY_PWD_CLR_TXPWDV2I_MASK) - -#define USBPHY_PWD_CLR_RXPWDENV_MASK (0x20000U) -#define USBPHY_PWD_CLR_RXPWDENV_SHIFT (17U) -/*! RXPWDENV - Power Down USB HS RX Envelope Detector */ -#define USBPHY_PWD_CLR_RXPWDENV(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_CLR_RXPWDENV_SHIFT)) & USBPHY_PWD_CLR_RXPWDENV_MASK) - -#define USBPHY_PWD_CLR_RXPWD1PT1_MASK (0x40000U) -#define USBPHY_PWD_CLR_RXPWD1PT1_SHIFT (18U) -/*! RXPWD1PT1 - Power Down USB FS Differential Receiver */ -#define USBPHY_PWD_CLR_RXPWD1PT1(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_CLR_RXPWD1PT1_SHIFT)) & USBPHY_PWD_CLR_RXPWD1PT1_MASK) - -#define USBPHY_PWD_CLR_RXPWDDIFF_MASK (0x80000U) -#define USBPHY_PWD_CLR_RXPWDDIFF_SHIFT (19U) -/*! RXPWDDIFF - Power Down USB HS Differential Receiver */ -#define USBPHY_PWD_CLR_RXPWDDIFF(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_CLR_RXPWDDIFF_SHIFT)) & USBPHY_PWD_CLR_RXPWDDIFF_MASK) - -#define USBPHY_PWD_CLR_RXPWDRX_MASK (0x100000U) -#define USBPHY_PWD_CLR_RXPWDRX_SHIFT (20U) -/*! RXPWDRX - Power Down USBPHY Receiver Circuits */ -#define USBPHY_PWD_CLR_RXPWDRX(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_CLR_RXPWDRX_SHIFT)) & USBPHY_PWD_CLR_RXPWDRX_MASK) -/*! @} */ - -/*! @name PWD_TOG - Power Down */ -/*! @{ */ - -#define USBPHY_PWD_TOG_TXPWDFS_MASK (0x400U) -#define USBPHY_PWD_TOG_TXPWDFS_SHIFT (10U) -/*! TXPWDFS - Power Down USB FS TX Drivers */ -#define USBPHY_PWD_TOG_TXPWDFS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_TOG_TXPWDFS_SHIFT)) & USBPHY_PWD_TOG_TXPWDFS_MASK) - -#define USBPHY_PWD_TOG_TXPWDIBIAS_MASK (0x800U) -#define USBPHY_PWD_TOG_TXPWDIBIAS_SHIFT (11U) -/*! TXPWDIBIAS - Power Down USBPHY TX Current Bias Block */ -#define USBPHY_PWD_TOG_TXPWDIBIAS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_TOG_TXPWDIBIAS_SHIFT)) & USBPHY_PWD_TOG_TXPWDIBIAS_MASK) - -#define USBPHY_PWD_TOG_TXPWDV2I_MASK (0x1000U) -#define USBPHY_PWD_TOG_TXPWDV2I_SHIFT (12U) -/*! TXPWDV2I - Power Down USBPHY TX V-I Converter and Current Mirror */ -#define USBPHY_PWD_TOG_TXPWDV2I(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_TOG_TXPWDV2I_SHIFT)) & USBPHY_PWD_TOG_TXPWDV2I_MASK) - -#define USBPHY_PWD_TOG_RXPWDENV_MASK (0x20000U) -#define USBPHY_PWD_TOG_RXPWDENV_SHIFT (17U) -/*! RXPWDENV - Power Down USB HS RX Envelope Detector */ -#define USBPHY_PWD_TOG_RXPWDENV(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_TOG_RXPWDENV_SHIFT)) & USBPHY_PWD_TOG_RXPWDENV_MASK) - -#define USBPHY_PWD_TOG_RXPWD1PT1_MASK (0x40000U) -#define USBPHY_PWD_TOG_RXPWD1PT1_SHIFT (18U) -/*! RXPWD1PT1 - Power Down USB FS Differential Receiver */ -#define USBPHY_PWD_TOG_RXPWD1PT1(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_TOG_RXPWD1PT1_SHIFT)) & USBPHY_PWD_TOG_RXPWD1PT1_MASK) - -#define USBPHY_PWD_TOG_RXPWDDIFF_MASK (0x80000U) -#define USBPHY_PWD_TOG_RXPWDDIFF_SHIFT (19U) -/*! RXPWDDIFF - Power Down USB HS Differential Receiver */ -#define USBPHY_PWD_TOG_RXPWDDIFF(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_TOG_RXPWDDIFF_SHIFT)) & USBPHY_PWD_TOG_RXPWDDIFF_MASK) - -#define USBPHY_PWD_TOG_RXPWDRX_MASK (0x100000U) -#define USBPHY_PWD_TOG_RXPWDRX_SHIFT (20U) -/*! RXPWDRX - Power Down USBPHY Receiver Circuits */ -#define USBPHY_PWD_TOG_RXPWDRX(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_TOG_RXPWDRX_SHIFT)) & USBPHY_PWD_TOG_RXPWDRX_MASK) -/*! @} */ - -/*! @name TX - TX Control */ -/*! @{ */ - -#define USBPHY_TX_D_CAL_MASK (0xFU) -#define USBPHY_TX_D_CAL_SHIFT (0U) -/*! D_CAL - HS TX Output Current Trim - * 0b0000..Maximum current, approximately 19% above nominal - * 0b0111..Nominal - * 0b1111..Minimum current, approximately 19% below nominal - */ -#define USBPHY_TX_D_CAL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_D_CAL_SHIFT)) & USBPHY_TX_D_CAL_MASK) - -#define USBPHY_TX_TXCAL45DN_MASK (0xF00U) -#define USBPHY_TX_TXCAL45DN_SHIFT (8U) -/*! TXCAL45DN - DM Series Termination Resistance Trim */ -#define USBPHY_TX_TXCAL45DN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_TXCAL45DN_SHIFT)) & USBPHY_TX_TXCAL45DN_MASK) - -#define USBPHY_TX_TXCAL45DP_MASK (0xF0000U) -#define USBPHY_TX_TXCAL45DP_SHIFT (16U) -/*! TXCAL45DP - DP Series Termination Resistance Trim */ -#define USBPHY_TX_TXCAL45DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_TXCAL45DP_SHIFT)) & USBPHY_TX_TXCAL45DP_MASK) -/*! @} */ - -/*! @name TX_SET - TX Control */ -/*! @{ */ - -#define USBPHY_TX_SET_D_CAL_MASK (0xFU) -#define USBPHY_TX_SET_D_CAL_SHIFT (0U) -/*! D_CAL - HS TX Output Current Trim */ -#define USBPHY_TX_SET_D_CAL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_SET_D_CAL_SHIFT)) & USBPHY_TX_SET_D_CAL_MASK) - -#define USBPHY_TX_SET_TXCAL45DN_MASK (0xF00U) -#define USBPHY_TX_SET_TXCAL45DN_SHIFT (8U) -/*! TXCAL45DN - DM Series Termination Resistance Trim */ -#define USBPHY_TX_SET_TXCAL45DN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_SET_TXCAL45DN_SHIFT)) & USBPHY_TX_SET_TXCAL45DN_MASK) - -#define USBPHY_TX_SET_TXCAL45DP_MASK (0xF0000U) -#define USBPHY_TX_SET_TXCAL45DP_SHIFT (16U) -/*! TXCAL45DP - DP Series Termination Resistance Trim */ -#define USBPHY_TX_SET_TXCAL45DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_SET_TXCAL45DP_SHIFT)) & USBPHY_TX_SET_TXCAL45DP_MASK) -/*! @} */ - -/*! @name TX_CLR - TX Control */ -/*! @{ */ - -#define USBPHY_TX_CLR_D_CAL_MASK (0xFU) -#define USBPHY_TX_CLR_D_CAL_SHIFT (0U) -/*! D_CAL - HS TX Output Current Trim */ -#define USBPHY_TX_CLR_D_CAL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_CLR_D_CAL_SHIFT)) & USBPHY_TX_CLR_D_CAL_MASK) - -#define USBPHY_TX_CLR_TXCAL45DN_MASK (0xF00U) -#define USBPHY_TX_CLR_TXCAL45DN_SHIFT (8U) -/*! TXCAL45DN - DM Series Termination Resistance Trim */ -#define USBPHY_TX_CLR_TXCAL45DN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_CLR_TXCAL45DN_SHIFT)) & USBPHY_TX_CLR_TXCAL45DN_MASK) - -#define USBPHY_TX_CLR_TXCAL45DP_MASK (0xF0000U) -#define USBPHY_TX_CLR_TXCAL45DP_SHIFT (16U) -/*! TXCAL45DP - DP Series Termination Resistance Trim */ -#define USBPHY_TX_CLR_TXCAL45DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_CLR_TXCAL45DP_SHIFT)) & USBPHY_TX_CLR_TXCAL45DP_MASK) -/*! @} */ - -/*! @name TX_TOG - TX Control */ -/*! @{ */ - -#define USBPHY_TX_TOG_D_CAL_MASK (0xFU) -#define USBPHY_TX_TOG_D_CAL_SHIFT (0U) -/*! D_CAL - HS TX Output Current Trim */ -#define USBPHY_TX_TOG_D_CAL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_TOG_D_CAL_SHIFT)) & USBPHY_TX_TOG_D_CAL_MASK) - -#define USBPHY_TX_TOG_TXCAL45DN_MASK (0xF00U) -#define USBPHY_TX_TOG_TXCAL45DN_SHIFT (8U) -/*! TXCAL45DN - DM Series Termination Resistance Trim */ -#define USBPHY_TX_TOG_TXCAL45DN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_TOG_TXCAL45DN_SHIFT)) & USBPHY_TX_TOG_TXCAL45DN_MASK) - -#define USBPHY_TX_TOG_TXCAL45DP_MASK (0xF0000U) -#define USBPHY_TX_TOG_TXCAL45DP_SHIFT (16U) -/*! TXCAL45DP - DP Series Termination Resistance Trim */ -#define USBPHY_TX_TOG_TXCAL45DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_TOG_TXCAL45DP_SHIFT)) & USBPHY_TX_TOG_TXCAL45DP_MASK) -/*! @} */ - -/*! @name RX - RX Control */ -/*! @{ */ - -#define USBPHY_RX_ENVADJ_MASK (0x7U) -#define USBPHY_RX_ENVADJ_SHIFT (0U) -/*! ENVADJ - Envelope Detector Trip Point - * 0b000..0.1000 V - * 0b001..0.1125 V - * 0b010..0.1250 V - * 0b011..0.0875 V - * 0b1xx.. - */ -#define USBPHY_RX_ENVADJ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_RX_ENVADJ_SHIFT)) & USBPHY_RX_ENVADJ_MASK) - -#define USBPHY_RX_DISCONADJ_MASK (0x70U) -#define USBPHY_RX_DISCONADJ_SHIFT (4U) -/*! DISCONADJ - Disconnect Detector Trip Point - * 0b000..0.56875 V - * 0b001..0.55000 V - * 0b010..0.58125 V - * 0b011..0.60000 V - * 0b1xx.. - */ -#define USBPHY_RX_DISCONADJ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_RX_DISCONADJ_SHIFT)) & USBPHY_RX_DISCONADJ_MASK) -/*! @} */ - -/*! @name RX_SET - RX Control */ -/*! @{ */ - -#define USBPHY_RX_SET_ENVADJ_MASK (0x7U) -#define USBPHY_RX_SET_ENVADJ_SHIFT (0U) -/*! ENVADJ - Envelope Detector Trip Point */ -#define USBPHY_RX_SET_ENVADJ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_RX_SET_ENVADJ_SHIFT)) & USBPHY_RX_SET_ENVADJ_MASK) - -#define USBPHY_RX_SET_DISCONADJ_MASK (0x70U) -#define USBPHY_RX_SET_DISCONADJ_SHIFT (4U) -/*! DISCONADJ - Disconnect Detector Trip Point */ -#define USBPHY_RX_SET_DISCONADJ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_RX_SET_DISCONADJ_SHIFT)) & USBPHY_RX_SET_DISCONADJ_MASK) -/*! @} */ - -/*! @name RX_CLR - RX Control */ -/*! @{ */ - -#define USBPHY_RX_CLR_ENVADJ_MASK (0x7U) -#define USBPHY_RX_CLR_ENVADJ_SHIFT (0U) -/*! ENVADJ - Envelope Detector Trip Point */ -#define USBPHY_RX_CLR_ENVADJ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_RX_CLR_ENVADJ_SHIFT)) & USBPHY_RX_CLR_ENVADJ_MASK) - -#define USBPHY_RX_CLR_DISCONADJ_MASK (0x70U) -#define USBPHY_RX_CLR_DISCONADJ_SHIFT (4U) -/*! DISCONADJ - Disconnect Detector Trip Point */ -#define USBPHY_RX_CLR_DISCONADJ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_RX_CLR_DISCONADJ_SHIFT)) & USBPHY_RX_CLR_DISCONADJ_MASK) -/*! @} */ - -/*! @name RX_TOG - RX Control */ -/*! @{ */ - -#define USBPHY_RX_TOG_ENVADJ_MASK (0x7U) -#define USBPHY_RX_TOG_ENVADJ_SHIFT (0U) -/*! ENVADJ - Envelope Detector Trip Point */ -#define USBPHY_RX_TOG_ENVADJ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_RX_TOG_ENVADJ_SHIFT)) & USBPHY_RX_TOG_ENVADJ_MASK) - -#define USBPHY_RX_TOG_DISCONADJ_MASK (0x70U) -#define USBPHY_RX_TOG_DISCONADJ_SHIFT (4U) -/*! DISCONADJ - Disconnect Detector Trip Point */ -#define USBPHY_RX_TOG_DISCONADJ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_RX_TOG_DISCONADJ_SHIFT)) & USBPHY_RX_TOG_DISCONADJ_MASK) -/*! @} */ - -/*! @name CTRL - General Purpose Control */ -/*! @{ */ - -#define USBPHY_CTRL_ENOTG_ID_CHG_IRQ_MASK (0x1U) -#define USBPHY_CTRL_ENOTG_ID_CHG_IRQ_SHIFT (0U) -/*! ENOTG_ID_CHG_IRQ - OTG ID Change Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENOTG_ID_CHG_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENOTG_ID_CHG_IRQ_SHIFT)) & USBPHY_CTRL_ENOTG_ID_CHG_IRQ_MASK) - -#define USBPHY_CTRL_ENHOSTDISCONDETECT_MASK (0x2U) -#define USBPHY_CTRL_ENHOSTDISCONDETECT_SHIFT (1U) -/*! ENHOSTDISCONDETECT - Host Disconnect Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENHOSTDISCONDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENHOSTDISCONDETECT_SHIFT)) & USBPHY_CTRL_ENHOSTDISCONDETECT_MASK) - -#define USBPHY_CTRL_ENIRQHOSTDISCON_MASK (0x4U) -#define USBPHY_CTRL_ENIRQHOSTDISCON_SHIFT (2U) -/*! ENIRQHOSTDISCON - Enable Interrupt for Host Disconnect - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENIRQHOSTDISCON(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENIRQHOSTDISCON_SHIFT)) & USBPHY_CTRL_ENIRQHOSTDISCON_MASK) - -#define USBPHY_CTRL_HOSTDISCONDETECT_IRQ_MASK (0x8U) -#define USBPHY_CTRL_HOSTDISCONDETECT_IRQ_SHIFT (3U) -/*! HOSTDISCONDETECT_IRQ - Host Disconnect Detection Interrupt - * 0b0..Connected - * 0b1..Disconnected - */ -#define USBPHY_CTRL_HOSTDISCONDETECT_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_HOSTDISCONDETECT_IRQ_SHIFT)) & USBPHY_CTRL_HOSTDISCONDETECT_IRQ_MASK) - -#define USBPHY_CTRL_ENDEVPLUGINDETECT_MASK (0x10U) -#define USBPHY_CTRL_ENDEVPLUGINDETECT_SHIFT (4U) -/*! ENDEVPLUGINDETECT - Enable Nonstandard Resistive Plugged-In Detection - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENDEVPLUGINDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENDEVPLUGINDETECT_SHIFT)) & USBPHY_CTRL_ENDEVPLUGINDETECT_MASK) - -#define USBPHY_CTRL_DEVPLUGIN_POLARITY_MASK (0x20U) -#define USBPHY_CTRL_DEVPLUGIN_POLARITY_SHIFT (5U) -/*! DEVPLUGIN_POLARITY - Device Plug-In Polarity - * 0b0..Plugged in - * 0b1..Unplugged - */ -#define USBPHY_CTRL_DEVPLUGIN_POLARITY(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_DEVPLUGIN_POLARITY_SHIFT)) & USBPHY_CTRL_DEVPLUGIN_POLARITY_MASK) - -#define USBPHY_CTRL_OTG_ID_CHG_IRQ_MASK (0x40U) -#define USBPHY_CTRL_OTG_ID_CHG_IRQ_SHIFT (6U) -/*! OTG_ID_CHG_IRQ - OTG ID Change Interrupt - * 0b0..No ID change interrupt - * 0b1..ID change interrupt - */ -#define USBPHY_CTRL_OTG_ID_CHG_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_OTG_ID_CHG_IRQ_SHIFT)) & USBPHY_CTRL_OTG_ID_CHG_IRQ_MASK) - -#define USBPHY_CTRL_ENOTGIDDETECT_MASK (0x80U) -#define USBPHY_CTRL_ENOTGIDDETECT_SHIFT (7U) -/*! ENOTGIDDETECT - Enable Internal OTG ID Detector - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENOTGIDDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENOTGIDDETECT_SHIFT)) & USBPHY_CTRL_ENOTGIDDETECT_MASK) - -#define USBPHY_CTRL_RESUMEIRQSTICKY_MASK (0x100U) -#define USBPHY_CTRL_RESUMEIRQSTICKY_SHIFT (8U) -/*! RESUMEIRQSTICKY - Resume Interrupt Sticky - * 0b0..During the resume or reset state signaling period - * 0b1..Until you write 0 to it - */ -#define USBPHY_CTRL_RESUMEIRQSTICKY(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_RESUMEIRQSTICKY_SHIFT)) & USBPHY_CTRL_RESUMEIRQSTICKY_MASK) - -#define USBPHY_CTRL_ENIRQRESUMEDETECT_MASK (0x200U) -#define USBPHY_CTRL_ENIRQRESUMEDETECT_SHIFT (9U) -/*! ENIRQRESUMEDETECT - Resume Detection Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENIRQRESUMEDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENIRQRESUMEDETECT_SHIFT)) & USBPHY_CTRL_ENIRQRESUMEDETECT_MASK) - -#define USBPHY_CTRL_RESUME_IRQ_MASK (0x400U) -#define USBPHY_CTRL_RESUME_IRQ_SHIFT (10U) -/*! RESUME_IRQ - Resume Interrupt - * 0b0..No resume interrupt - * 0b1..Resume interrupt - */ -#define USBPHY_CTRL_RESUME_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_RESUME_IRQ_SHIFT)) & USBPHY_CTRL_RESUME_IRQ_MASK) - -#define USBPHY_CTRL_ENIRQDEVPLUGIN_MASK (0x800U) -#define USBPHY_CTRL_ENIRQDEVPLUGIN_SHIFT (11U) -/*! ENIRQDEVPLUGIN - Enable Interrupt for Nonstandard Resistive Plugged-In Detection - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENIRQDEVPLUGIN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENIRQDEVPLUGIN_SHIFT)) & USBPHY_CTRL_ENIRQDEVPLUGIN_MASK) - -#define USBPHY_CTRL_DEVPLUGIN_IRQ_MASK (0x1000U) -#define USBPHY_CTRL_DEVPLUGIN_IRQ_SHIFT (12U) -/*! DEVPLUGIN_IRQ - Device Plug-In Interrupt */ -#define USBPHY_CTRL_DEVPLUGIN_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_DEVPLUGIN_IRQ_SHIFT)) & USBPHY_CTRL_DEVPLUGIN_IRQ_MASK) - -#define USBPHY_CTRL_DATA_ON_LRADC_MASK (0x2000U) -#define USBPHY_CTRL_DATA_ON_LRADC_SHIFT (13U) -/*! DATA_ON_LRADC - APB Clock Switch Option */ -#define USBPHY_CTRL_DATA_ON_LRADC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_DATA_ON_LRADC_SHIFT)) & USBPHY_CTRL_DATA_ON_LRADC_MASK) - -#define USBPHY_CTRL_ENUTMILEVEL2_MASK (0x4000U) -#define USBPHY_CTRL_ENUTMILEVEL2_SHIFT (14U) -/*! ENUTMILEVEL2 - UTMI Level 2 Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENUTMILEVEL2(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENUTMILEVEL2_SHIFT)) & USBPHY_CTRL_ENUTMILEVEL2_MASK) - -#define USBPHY_CTRL_ENUTMILEVEL3_MASK (0x8000U) -#define USBPHY_CTRL_ENUTMILEVEL3_SHIFT (15U) -/*! ENUTMILEVEL3 - UTMI Level 3 Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENUTMILEVEL3(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENUTMILEVEL3_SHIFT)) & USBPHY_CTRL_ENUTMILEVEL3_MASK) - -#define USBPHY_CTRL_ENIRQWAKEUP_MASK (0x10000U) -#define USBPHY_CTRL_ENIRQWAKEUP_SHIFT (16U) -/*! ENIRQWAKEUP - Wake-Up Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENIRQWAKEUP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENIRQWAKEUP_SHIFT)) & USBPHY_CTRL_ENIRQWAKEUP_MASK) - -#define USBPHY_CTRL_WAKEUP_IRQ_MASK (0x20000U) -#define USBPHY_CTRL_WAKEUP_IRQ_SHIFT (17U) -/*! WAKEUP_IRQ - Wake-Up Interrupt */ -#define USBPHY_CTRL_WAKEUP_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_WAKEUP_IRQ_SHIFT)) & USBPHY_CTRL_WAKEUP_IRQ_MASK) - -#define USBPHY_CTRL_AUTORESUME_EN_MASK (0x40000U) -#define USBPHY_CTRL_AUTORESUME_EN_SHIFT (18U) -/*! AUTORESUME_EN - Autoresume Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_AUTORESUME_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_AUTORESUME_EN_SHIFT)) & USBPHY_CTRL_AUTORESUME_EN_MASK) - -#define USBPHY_CTRL_ENAUTOCLR_CLKGATE_MASK (0x80000U) -#define USBPHY_CTRL_ENAUTOCLR_CLKGATE_SHIFT (19U) -/*! ENAUTOCLR_CLKGATE - Autoclear Clock Gate Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENAUTOCLR_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENAUTOCLR_CLKGATE_SHIFT)) & USBPHY_CTRL_ENAUTOCLR_CLKGATE_MASK) - -#define USBPHY_CTRL_ENAUTOCLR_PHY_PWD_MASK (0x100000U) -#define USBPHY_CTRL_ENAUTOCLR_PHY_PWD_SHIFT (20U) -/*! ENAUTOCLR_PHY_PWD - PHY PWD Autoclear Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENAUTOCLR_PHY_PWD(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENAUTOCLR_PHY_PWD_SHIFT)) & USBPHY_CTRL_ENAUTOCLR_PHY_PWD_MASK) - -#define USBPHY_CTRL_OTG_ID_VALUE_MASK (0x8000000U) -#define USBPHY_CTRL_OTG_ID_VALUE_SHIFT (27U) -/*! OTG_ID_VALUE - OTG ID Value - * 0b0..Host - * 0b1..Device - */ -#define USBPHY_CTRL_OTG_ID_VALUE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_OTG_ID_VALUE_SHIFT)) & USBPHY_CTRL_OTG_ID_VALUE_MASK) - -#define USBPHY_CTRL_UTMI_SUSPENDM_MASK (0x20000000U) -#define USBPHY_CTRL_UTMI_SUSPENDM_SHIFT (29U) -/*! UTMI_SUSPENDM - UTMI Suspend - * 0b0..Not suspended - * 0b1..Suspended - */ -#define USBPHY_CTRL_UTMI_SUSPENDM(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_UTMI_SUSPENDM_SHIFT)) & USBPHY_CTRL_UTMI_SUSPENDM_MASK) - -#define USBPHY_CTRL_CLKGATE_MASK (0x40000000U) -#define USBPHY_CTRL_CLKGATE_SHIFT (30U) -/*! CLKGATE - UTMI Clock Gate - * 0b0..Run clocks - * 0b1..Gate clocks - */ -#define USBPHY_CTRL_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLKGATE_SHIFT)) & USBPHY_CTRL_CLKGATE_MASK) - -#define USBPHY_CTRL_SFTRST_MASK (0x80000000U) -#define USBPHY_CTRL_SFTRST_SHIFT (31U) -/*! SFTRST - Software Reset - * 0b0..Release from reset - * 0b1..Soft-reset - */ -#define USBPHY_CTRL_SFTRST(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SFTRST_SHIFT)) & USBPHY_CTRL_SFTRST_MASK) -/*! @} */ - -/*! @name CTRL_SET - General Purpose Control */ -/*! @{ */ - -#define USBPHY_CTRL_SET_ENOTG_ID_CHG_IRQ_MASK (0x1U) -#define USBPHY_CTRL_SET_ENOTG_ID_CHG_IRQ_SHIFT (0U) -/*! ENOTG_ID_CHG_IRQ - OTG ID Change Interrupt Enable */ -#define USBPHY_CTRL_SET_ENOTG_ID_CHG_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENOTG_ID_CHG_IRQ_SHIFT)) & USBPHY_CTRL_SET_ENOTG_ID_CHG_IRQ_MASK) - -#define USBPHY_CTRL_SET_ENHOSTDISCONDETECT_MASK (0x2U) -#define USBPHY_CTRL_SET_ENHOSTDISCONDETECT_SHIFT (1U) -/*! ENHOSTDISCONDETECT - Host Disconnect Detection Enable */ -#define USBPHY_CTRL_SET_ENHOSTDISCONDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENHOSTDISCONDETECT_SHIFT)) & USBPHY_CTRL_SET_ENHOSTDISCONDETECT_MASK) - -#define USBPHY_CTRL_SET_ENIRQHOSTDISCON_MASK (0x4U) -#define USBPHY_CTRL_SET_ENIRQHOSTDISCON_SHIFT (2U) -/*! ENIRQHOSTDISCON - Enable Interrupt for Host Disconnect */ -#define USBPHY_CTRL_SET_ENIRQHOSTDISCON(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENIRQHOSTDISCON_SHIFT)) & USBPHY_CTRL_SET_ENIRQHOSTDISCON_MASK) - -#define USBPHY_CTRL_SET_HOSTDISCONDETECT_IRQ_MASK (0x8U) -#define USBPHY_CTRL_SET_HOSTDISCONDETECT_IRQ_SHIFT (3U) -/*! HOSTDISCONDETECT_IRQ - Host Disconnect Detection Interrupt */ -#define USBPHY_CTRL_SET_HOSTDISCONDETECT_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_HOSTDISCONDETECT_IRQ_SHIFT)) & USBPHY_CTRL_SET_HOSTDISCONDETECT_IRQ_MASK) - -#define USBPHY_CTRL_SET_ENDEVPLUGINDETECT_MASK (0x10U) -#define USBPHY_CTRL_SET_ENDEVPLUGINDETECT_SHIFT (4U) -/*! ENDEVPLUGINDETECT - Enable Nonstandard Resistive Plugged-In Detection */ -#define USBPHY_CTRL_SET_ENDEVPLUGINDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENDEVPLUGINDETECT_SHIFT)) & USBPHY_CTRL_SET_ENDEVPLUGINDETECT_MASK) - -#define USBPHY_CTRL_SET_DEVPLUGIN_POLARITY_MASK (0x20U) -#define USBPHY_CTRL_SET_DEVPLUGIN_POLARITY_SHIFT (5U) -/*! DEVPLUGIN_POLARITY - Device Plug-In Polarity */ -#define USBPHY_CTRL_SET_DEVPLUGIN_POLARITY(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_DEVPLUGIN_POLARITY_SHIFT)) & USBPHY_CTRL_SET_DEVPLUGIN_POLARITY_MASK) - -#define USBPHY_CTRL_SET_OTG_ID_CHG_IRQ_MASK (0x40U) -#define USBPHY_CTRL_SET_OTG_ID_CHG_IRQ_SHIFT (6U) -/*! OTG_ID_CHG_IRQ - OTG ID Change Interrupt */ -#define USBPHY_CTRL_SET_OTG_ID_CHG_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_OTG_ID_CHG_IRQ_SHIFT)) & USBPHY_CTRL_SET_OTG_ID_CHG_IRQ_MASK) - -#define USBPHY_CTRL_SET_ENOTGIDDETECT_MASK (0x80U) -#define USBPHY_CTRL_SET_ENOTGIDDETECT_SHIFT (7U) -/*! ENOTGIDDETECT - Enable Internal OTG ID Detector */ -#define USBPHY_CTRL_SET_ENOTGIDDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENOTGIDDETECT_SHIFT)) & USBPHY_CTRL_SET_ENOTGIDDETECT_MASK) - -#define USBPHY_CTRL_SET_RESUMEIRQSTICKY_MASK (0x100U) -#define USBPHY_CTRL_SET_RESUMEIRQSTICKY_SHIFT (8U) -/*! RESUMEIRQSTICKY - Resume Interrupt Sticky */ -#define USBPHY_CTRL_SET_RESUMEIRQSTICKY(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_RESUMEIRQSTICKY_SHIFT)) & USBPHY_CTRL_SET_RESUMEIRQSTICKY_MASK) - -#define USBPHY_CTRL_SET_ENIRQRESUMEDETECT_MASK (0x200U) -#define USBPHY_CTRL_SET_ENIRQRESUMEDETECT_SHIFT (9U) -/*! ENIRQRESUMEDETECT - Resume Detection Interrupt Enable */ -#define USBPHY_CTRL_SET_ENIRQRESUMEDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENIRQRESUMEDETECT_SHIFT)) & USBPHY_CTRL_SET_ENIRQRESUMEDETECT_MASK) - -#define USBPHY_CTRL_SET_RESUME_IRQ_MASK (0x400U) -#define USBPHY_CTRL_SET_RESUME_IRQ_SHIFT (10U) -/*! RESUME_IRQ - Resume Interrupt */ -#define USBPHY_CTRL_SET_RESUME_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_RESUME_IRQ_SHIFT)) & USBPHY_CTRL_SET_RESUME_IRQ_MASK) - -#define USBPHY_CTRL_SET_ENIRQDEVPLUGIN_MASK (0x800U) -#define USBPHY_CTRL_SET_ENIRQDEVPLUGIN_SHIFT (11U) -/*! ENIRQDEVPLUGIN - Enable Interrupt for Nonstandard Resistive Plugged-In Detection */ -#define USBPHY_CTRL_SET_ENIRQDEVPLUGIN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENIRQDEVPLUGIN_SHIFT)) & USBPHY_CTRL_SET_ENIRQDEVPLUGIN_MASK) - -#define USBPHY_CTRL_SET_DEVPLUGIN_IRQ_MASK (0x1000U) -#define USBPHY_CTRL_SET_DEVPLUGIN_IRQ_SHIFT (12U) -/*! DEVPLUGIN_IRQ - Device Plug-In Interrupt */ -#define USBPHY_CTRL_SET_DEVPLUGIN_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_DEVPLUGIN_IRQ_SHIFT)) & USBPHY_CTRL_SET_DEVPLUGIN_IRQ_MASK) - -#define USBPHY_CTRL_SET_DATA_ON_LRADC_MASK (0x2000U) -#define USBPHY_CTRL_SET_DATA_ON_LRADC_SHIFT (13U) -/*! DATA_ON_LRADC - APB Clock Switch Option */ -#define USBPHY_CTRL_SET_DATA_ON_LRADC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_DATA_ON_LRADC_SHIFT)) & USBPHY_CTRL_SET_DATA_ON_LRADC_MASK) - -#define USBPHY_CTRL_SET_ENUTMILEVEL2_MASK (0x4000U) -#define USBPHY_CTRL_SET_ENUTMILEVEL2_SHIFT (14U) -/*! ENUTMILEVEL2 - UTMI Level 2 Enable */ -#define USBPHY_CTRL_SET_ENUTMILEVEL2(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENUTMILEVEL2_SHIFT)) & USBPHY_CTRL_SET_ENUTMILEVEL2_MASK) - -#define USBPHY_CTRL_SET_ENUTMILEVEL3_MASK (0x8000U) -#define USBPHY_CTRL_SET_ENUTMILEVEL3_SHIFT (15U) -/*! ENUTMILEVEL3 - UTMI Level 3 Enable */ -#define USBPHY_CTRL_SET_ENUTMILEVEL3(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENUTMILEVEL3_SHIFT)) & USBPHY_CTRL_SET_ENUTMILEVEL3_MASK) - -#define USBPHY_CTRL_SET_ENIRQWAKEUP_MASK (0x10000U) -#define USBPHY_CTRL_SET_ENIRQWAKEUP_SHIFT (16U) -/*! ENIRQWAKEUP - Wake-Up Interrupt Enable */ -#define USBPHY_CTRL_SET_ENIRQWAKEUP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENIRQWAKEUP_SHIFT)) & USBPHY_CTRL_SET_ENIRQWAKEUP_MASK) - -#define USBPHY_CTRL_SET_WAKEUP_IRQ_MASK (0x20000U) -#define USBPHY_CTRL_SET_WAKEUP_IRQ_SHIFT (17U) -/*! WAKEUP_IRQ - Wake-Up Interrupt */ -#define USBPHY_CTRL_SET_WAKEUP_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_WAKEUP_IRQ_SHIFT)) & USBPHY_CTRL_SET_WAKEUP_IRQ_MASK) - -#define USBPHY_CTRL_SET_AUTORESUME_EN_MASK (0x40000U) -#define USBPHY_CTRL_SET_AUTORESUME_EN_SHIFT (18U) -/*! AUTORESUME_EN - Autoresume Enable */ -#define USBPHY_CTRL_SET_AUTORESUME_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_AUTORESUME_EN_SHIFT)) & USBPHY_CTRL_SET_AUTORESUME_EN_MASK) - -#define USBPHY_CTRL_SET_ENAUTOCLR_CLKGATE_MASK (0x80000U) -#define USBPHY_CTRL_SET_ENAUTOCLR_CLKGATE_SHIFT (19U) -/*! ENAUTOCLR_CLKGATE - Autoclear Clock Gate Enable */ -#define USBPHY_CTRL_SET_ENAUTOCLR_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENAUTOCLR_CLKGATE_SHIFT)) & USBPHY_CTRL_SET_ENAUTOCLR_CLKGATE_MASK) - -#define USBPHY_CTRL_SET_ENAUTOCLR_PHY_PWD_MASK (0x100000U) -#define USBPHY_CTRL_SET_ENAUTOCLR_PHY_PWD_SHIFT (20U) -/*! ENAUTOCLR_PHY_PWD - PHY PWD Autoclear Enable */ -#define USBPHY_CTRL_SET_ENAUTOCLR_PHY_PWD(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENAUTOCLR_PHY_PWD_SHIFT)) & USBPHY_CTRL_SET_ENAUTOCLR_PHY_PWD_MASK) - -#define USBPHY_CTRL_SET_OTG_ID_VALUE_MASK (0x8000000U) -#define USBPHY_CTRL_SET_OTG_ID_VALUE_SHIFT (27U) -/*! OTG_ID_VALUE - OTG ID Value */ -#define USBPHY_CTRL_SET_OTG_ID_VALUE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_OTG_ID_VALUE_SHIFT)) & USBPHY_CTRL_SET_OTG_ID_VALUE_MASK) - -#define USBPHY_CTRL_SET_UTMI_SUSPENDM_MASK (0x20000000U) -#define USBPHY_CTRL_SET_UTMI_SUSPENDM_SHIFT (29U) -/*! UTMI_SUSPENDM - UTMI Suspend */ -#define USBPHY_CTRL_SET_UTMI_SUSPENDM(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_UTMI_SUSPENDM_SHIFT)) & USBPHY_CTRL_SET_UTMI_SUSPENDM_MASK) - -#define USBPHY_CTRL_SET_CLKGATE_MASK (0x40000000U) -#define USBPHY_CTRL_SET_CLKGATE_SHIFT (30U) -/*! CLKGATE - UTMI Clock Gate */ -#define USBPHY_CTRL_SET_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_CLKGATE_SHIFT)) & USBPHY_CTRL_SET_CLKGATE_MASK) - -#define USBPHY_CTRL_SET_SFTRST_MASK (0x80000000U) -#define USBPHY_CTRL_SET_SFTRST_SHIFT (31U) -/*! SFTRST - Software Reset */ -#define USBPHY_CTRL_SET_SFTRST(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_SFTRST_SHIFT)) & USBPHY_CTRL_SET_SFTRST_MASK) -/*! @} */ - -/*! @name CTRL_CLR - General Purpose Control */ -/*! @{ */ - -#define USBPHY_CTRL_CLR_ENOTG_ID_CHG_IRQ_MASK (0x1U) -#define USBPHY_CTRL_CLR_ENOTG_ID_CHG_IRQ_SHIFT (0U) -/*! ENOTG_ID_CHG_IRQ - OTG ID Change Interrupt Enable */ -#define USBPHY_CTRL_CLR_ENOTG_ID_CHG_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENOTG_ID_CHG_IRQ_SHIFT)) & USBPHY_CTRL_CLR_ENOTG_ID_CHG_IRQ_MASK) - -#define USBPHY_CTRL_CLR_ENHOSTDISCONDETECT_MASK (0x2U) -#define USBPHY_CTRL_CLR_ENHOSTDISCONDETECT_SHIFT (1U) -/*! ENHOSTDISCONDETECT - Host Disconnect Detection Enable */ -#define USBPHY_CTRL_CLR_ENHOSTDISCONDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENHOSTDISCONDETECT_SHIFT)) & USBPHY_CTRL_CLR_ENHOSTDISCONDETECT_MASK) - -#define USBPHY_CTRL_CLR_ENIRQHOSTDISCON_MASK (0x4U) -#define USBPHY_CTRL_CLR_ENIRQHOSTDISCON_SHIFT (2U) -/*! ENIRQHOSTDISCON - Enable Interrupt for Host Disconnect */ -#define USBPHY_CTRL_CLR_ENIRQHOSTDISCON(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENIRQHOSTDISCON_SHIFT)) & USBPHY_CTRL_CLR_ENIRQHOSTDISCON_MASK) - -#define USBPHY_CTRL_CLR_HOSTDISCONDETECT_IRQ_MASK (0x8U) -#define USBPHY_CTRL_CLR_HOSTDISCONDETECT_IRQ_SHIFT (3U) -/*! HOSTDISCONDETECT_IRQ - Host Disconnect Detection Interrupt */ -#define USBPHY_CTRL_CLR_HOSTDISCONDETECT_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_HOSTDISCONDETECT_IRQ_SHIFT)) & USBPHY_CTRL_CLR_HOSTDISCONDETECT_IRQ_MASK) - -#define USBPHY_CTRL_CLR_ENDEVPLUGINDETECT_MASK (0x10U) -#define USBPHY_CTRL_CLR_ENDEVPLUGINDETECT_SHIFT (4U) -/*! ENDEVPLUGINDETECT - Enable Nonstandard Resistive Plugged-In Detection */ -#define USBPHY_CTRL_CLR_ENDEVPLUGINDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENDEVPLUGINDETECT_SHIFT)) & USBPHY_CTRL_CLR_ENDEVPLUGINDETECT_MASK) - -#define USBPHY_CTRL_CLR_DEVPLUGIN_POLARITY_MASK (0x20U) -#define USBPHY_CTRL_CLR_DEVPLUGIN_POLARITY_SHIFT (5U) -/*! DEVPLUGIN_POLARITY - Device Plug-In Polarity */ -#define USBPHY_CTRL_CLR_DEVPLUGIN_POLARITY(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_DEVPLUGIN_POLARITY_SHIFT)) & USBPHY_CTRL_CLR_DEVPLUGIN_POLARITY_MASK) - -#define USBPHY_CTRL_CLR_OTG_ID_CHG_IRQ_MASK (0x40U) -#define USBPHY_CTRL_CLR_OTG_ID_CHG_IRQ_SHIFT (6U) -/*! OTG_ID_CHG_IRQ - OTG ID Change Interrupt */ -#define USBPHY_CTRL_CLR_OTG_ID_CHG_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_OTG_ID_CHG_IRQ_SHIFT)) & USBPHY_CTRL_CLR_OTG_ID_CHG_IRQ_MASK) - -#define USBPHY_CTRL_CLR_ENOTGIDDETECT_MASK (0x80U) -#define USBPHY_CTRL_CLR_ENOTGIDDETECT_SHIFT (7U) -/*! ENOTGIDDETECT - Enable Internal OTG ID Detector */ -#define USBPHY_CTRL_CLR_ENOTGIDDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENOTGIDDETECT_SHIFT)) & USBPHY_CTRL_CLR_ENOTGIDDETECT_MASK) - -#define USBPHY_CTRL_CLR_RESUMEIRQSTICKY_MASK (0x100U) -#define USBPHY_CTRL_CLR_RESUMEIRQSTICKY_SHIFT (8U) -/*! RESUMEIRQSTICKY - Resume Interrupt Sticky */ -#define USBPHY_CTRL_CLR_RESUMEIRQSTICKY(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_RESUMEIRQSTICKY_SHIFT)) & USBPHY_CTRL_CLR_RESUMEIRQSTICKY_MASK) - -#define USBPHY_CTRL_CLR_ENIRQRESUMEDETECT_MASK (0x200U) -#define USBPHY_CTRL_CLR_ENIRQRESUMEDETECT_SHIFT (9U) -/*! ENIRQRESUMEDETECT - Resume Detection Interrupt Enable */ -#define USBPHY_CTRL_CLR_ENIRQRESUMEDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENIRQRESUMEDETECT_SHIFT)) & USBPHY_CTRL_CLR_ENIRQRESUMEDETECT_MASK) - -#define USBPHY_CTRL_CLR_RESUME_IRQ_MASK (0x400U) -#define USBPHY_CTRL_CLR_RESUME_IRQ_SHIFT (10U) -/*! RESUME_IRQ - Resume Interrupt */ -#define USBPHY_CTRL_CLR_RESUME_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_RESUME_IRQ_SHIFT)) & USBPHY_CTRL_CLR_RESUME_IRQ_MASK) - -#define USBPHY_CTRL_CLR_ENIRQDEVPLUGIN_MASK (0x800U) -#define USBPHY_CTRL_CLR_ENIRQDEVPLUGIN_SHIFT (11U) -/*! ENIRQDEVPLUGIN - Enable Interrupt for Nonstandard Resistive Plugged-In Detection */ -#define USBPHY_CTRL_CLR_ENIRQDEVPLUGIN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENIRQDEVPLUGIN_SHIFT)) & USBPHY_CTRL_CLR_ENIRQDEVPLUGIN_MASK) - -#define USBPHY_CTRL_CLR_DEVPLUGIN_IRQ_MASK (0x1000U) -#define USBPHY_CTRL_CLR_DEVPLUGIN_IRQ_SHIFT (12U) -/*! DEVPLUGIN_IRQ - Device Plug-In Interrupt */ -#define USBPHY_CTRL_CLR_DEVPLUGIN_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_DEVPLUGIN_IRQ_SHIFT)) & USBPHY_CTRL_CLR_DEVPLUGIN_IRQ_MASK) - -#define USBPHY_CTRL_CLR_DATA_ON_LRADC_MASK (0x2000U) -#define USBPHY_CTRL_CLR_DATA_ON_LRADC_SHIFT (13U) -/*! DATA_ON_LRADC - APB Clock Switch Option */ -#define USBPHY_CTRL_CLR_DATA_ON_LRADC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_DATA_ON_LRADC_SHIFT)) & USBPHY_CTRL_CLR_DATA_ON_LRADC_MASK) - -#define USBPHY_CTRL_CLR_ENUTMILEVEL2_MASK (0x4000U) -#define USBPHY_CTRL_CLR_ENUTMILEVEL2_SHIFT (14U) -/*! ENUTMILEVEL2 - UTMI Level 2 Enable */ -#define USBPHY_CTRL_CLR_ENUTMILEVEL2(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENUTMILEVEL2_SHIFT)) & USBPHY_CTRL_CLR_ENUTMILEVEL2_MASK) - -#define USBPHY_CTRL_CLR_ENUTMILEVEL3_MASK (0x8000U) -#define USBPHY_CTRL_CLR_ENUTMILEVEL3_SHIFT (15U) -/*! ENUTMILEVEL3 - UTMI Level 3 Enable */ -#define USBPHY_CTRL_CLR_ENUTMILEVEL3(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENUTMILEVEL3_SHIFT)) & USBPHY_CTRL_CLR_ENUTMILEVEL3_MASK) - -#define USBPHY_CTRL_CLR_ENIRQWAKEUP_MASK (0x10000U) -#define USBPHY_CTRL_CLR_ENIRQWAKEUP_SHIFT (16U) -/*! ENIRQWAKEUP - Wake-Up Interrupt Enable */ -#define USBPHY_CTRL_CLR_ENIRQWAKEUP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENIRQWAKEUP_SHIFT)) & USBPHY_CTRL_CLR_ENIRQWAKEUP_MASK) - -#define USBPHY_CTRL_CLR_WAKEUP_IRQ_MASK (0x20000U) -#define USBPHY_CTRL_CLR_WAKEUP_IRQ_SHIFT (17U) -/*! WAKEUP_IRQ - Wake-Up Interrupt */ -#define USBPHY_CTRL_CLR_WAKEUP_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_WAKEUP_IRQ_SHIFT)) & USBPHY_CTRL_CLR_WAKEUP_IRQ_MASK) - -#define USBPHY_CTRL_CLR_AUTORESUME_EN_MASK (0x40000U) -#define USBPHY_CTRL_CLR_AUTORESUME_EN_SHIFT (18U) -/*! AUTORESUME_EN - Autoresume Enable */ -#define USBPHY_CTRL_CLR_AUTORESUME_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_AUTORESUME_EN_SHIFT)) & USBPHY_CTRL_CLR_AUTORESUME_EN_MASK) - -#define USBPHY_CTRL_CLR_ENAUTOCLR_CLKGATE_MASK (0x80000U) -#define USBPHY_CTRL_CLR_ENAUTOCLR_CLKGATE_SHIFT (19U) -/*! ENAUTOCLR_CLKGATE - Autoclear Clock Gate Enable */ -#define USBPHY_CTRL_CLR_ENAUTOCLR_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENAUTOCLR_CLKGATE_SHIFT)) & USBPHY_CTRL_CLR_ENAUTOCLR_CLKGATE_MASK) - -#define USBPHY_CTRL_CLR_ENAUTOCLR_PHY_PWD_MASK (0x100000U) -#define USBPHY_CTRL_CLR_ENAUTOCLR_PHY_PWD_SHIFT (20U) -/*! ENAUTOCLR_PHY_PWD - PHY PWD Autoclear Enable */ -#define USBPHY_CTRL_CLR_ENAUTOCLR_PHY_PWD(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENAUTOCLR_PHY_PWD_SHIFT)) & USBPHY_CTRL_CLR_ENAUTOCLR_PHY_PWD_MASK) - -#define USBPHY_CTRL_CLR_OTG_ID_VALUE_MASK (0x8000000U) -#define USBPHY_CTRL_CLR_OTG_ID_VALUE_SHIFT (27U) -/*! OTG_ID_VALUE - OTG ID Value */ -#define USBPHY_CTRL_CLR_OTG_ID_VALUE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_OTG_ID_VALUE_SHIFT)) & USBPHY_CTRL_CLR_OTG_ID_VALUE_MASK) - -#define USBPHY_CTRL_CLR_UTMI_SUSPENDM_MASK (0x20000000U) -#define USBPHY_CTRL_CLR_UTMI_SUSPENDM_SHIFT (29U) -/*! UTMI_SUSPENDM - UTMI Suspend */ -#define USBPHY_CTRL_CLR_UTMI_SUSPENDM(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_UTMI_SUSPENDM_SHIFT)) & USBPHY_CTRL_CLR_UTMI_SUSPENDM_MASK) - -#define USBPHY_CTRL_CLR_CLKGATE_MASK (0x40000000U) -#define USBPHY_CTRL_CLR_CLKGATE_SHIFT (30U) -/*! CLKGATE - UTMI Clock Gate */ -#define USBPHY_CTRL_CLR_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_CLKGATE_SHIFT)) & USBPHY_CTRL_CLR_CLKGATE_MASK) - -#define USBPHY_CTRL_CLR_SFTRST_MASK (0x80000000U) -#define USBPHY_CTRL_CLR_SFTRST_SHIFT (31U) -/*! SFTRST - Software Reset */ -#define USBPHY_CTRL_CLR_SFTRST(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_SFTRST_SHIFT)) & USBPHY_CTRL_CLR_SFTRST_MASK) -/*! @} */ - -/*! @name CTRL_TOG - General Purpose Control */ -/*! @{ */ - -#define USBPHY_CTRL_TOG_ENOTG_ID_CHG_IRQ_MASK (0x1U) -#define USBPHY_CTRL_TOG_ENOTG_ID_CHG_IRQ_SHIFT (0U) -/*! ENOTG_ID_CHG_IRQ - OTG ID Change Interrupt Enable */ -#define USBPHY_CTRL_TOG_ENOTG_ID_CHG_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENOTG_ID_CHG_IRQ_SHIFT)) & USBPHY_CTRL_TOG_ENOTG_ID_CHG_IRQ_MASK) - -#define USBPHY_CTRL_TOG_ENHOSTDISCONDETECT_MASK (0x2U) -#define USBPHY_CTRL_TOG_ENHOSTDISCONDETECT_SHIFT (1U) -/*! ENHOSTDISCONDETECT - Host Disconnect Detection Enable */ -#define USBPHY_CTRL_TOG_ENHOSTDISCONDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENHOSTDISCONDETECT_SHIFT)) & USBPHY_CTRL_TOG_ENHOSTDISCONDETECT_MASK) - -#define USBPHY_CTRL_TOG_ENIRQHOSTDISCON_MASK (0x4U) -#define USBPHY_CTRL_TOG_ENIRQHOSTDISCON_SHIFT (2U) -/*! ENIRQHOSTDISCON - Enable Interrupt for Host Disconnect */ -#define USBPHY_CTRL_TOG_ENIRQHOSTDISCON(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENIRQHOSTDISCON_SHIFT)) & USBPHY_CTRL_TOG_ENIRQHOSTDISCON_MASK) - -#define USBPHY_CTRL_TOG_HOSTDISCONDETECT_IRQ_MASK (0x8U) -#define USBPHY_CTRL_TOG_HOSTDISCONDETECT_IRQ_SHIFT (3U) -/*! HOSTDISCONDETECT_IRQ - Host Disconnect Detection Interrupt */ -#define USBPHY_CTRL_TOG_HOSTDISCONDETECT_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_HOSTDISCONDETECT_IRQ_SHIFT)) & USBPHY_CTRL_TOG_HOSTDISCONDETECT_IRQ_MASK) - -#define USBPHY_CTRL_TOG_ENDEVPLUGINDETECT_MASK (0x10U) -#define USBPHY_CTRL_TOG_ENDEVPLUGINDETECT_SHIFT (4U) -/*! ENDEVPLUGINDETECT - Enable Nonstandard Resistive Plugged-In Detection */ -#define USBPHY_CTRL_TOG_ENDEVPLUGINDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENDEVPLUGINDETECT_SHIFT)) & USBPHY_CTRL_TOG_ENDEVPLUGINDETECT_MASK) - -#define USBPHY_CTRL_TOG_DEVPLUGIN_POLARITY_MASK (0x20U) -#define USBPHY_CTRL_TOG_DEVPLUGIN_POLARITY_SHIFT (5U) -/*! DEVPLUGIN_POLARITY - Device Plug-In Polarity */ -#define USBPHY_CTRL_TOG_DEVPLUGIN_POLARITY(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_DEVPLUGIN_POLARITY_SHIFT)) & USBPHY_CTRL_TOG_DEVPLUGIN_POLARITY_MASK) - -#define USBPHY_CTRL_TOG_OTG_ID_CHG_IRQ_MASK (0x40U) -#define USBPHY_CTRL_TOG_OTG_ID_CHG_IRQ_SHIFT (6U) -/*! OTG_ID_CHG_IRQ - OTG ID Change Interrupt */ -#define USBPHY_CTRL_TOG_OTG_ID_CHG_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_OTG_ID_CHG_IRQ_SHIFT)) & USBPHY_CTRL_TOG_OTG_ID_CHG_IRQ_MASK) - -#define USBPHY_CTRL_TOG_ENOTGIDDETECT_MASK (0x80U) -#define USBPHY_CTRL_TOG_ENOTGIDDETECT_SHIFT (7U) -/*! ENOTGIDDETECT - Enable Internal OTG ID Detector */ -#define USBPHY_CTRL_TOG_ENOTGIDDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENOTGIDDETECT_SHIFT)) & USBPHY_CTRL_TOG_ENOTGIDDETECT_MASK) - -#define USBPHY_CTRL_TOG_RESUMEIRQSTICKY_MASK (0x100U) -#define USBPHY_CTRL_TOG_RESUMEIRQSTICKY_SHIFT (8U) -/*! RESUMEIRQSTICKY - Resume Interrupt Sticky */ -#define USBPHY_CTRL_TOG_RESUMEIRQSTICKY(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_RESUMEIRQSTICKY_SHIFT)) & USBPHY_CTRL_TOG_RESUMEIRQSTICKY_MASK) - -#define USBPHY_CTRL_TOG_ENIRQRESUMEDETECT_MASK (0x200U) -#define USBPHY_CTRL_TOG_ENIRQRESUMEDETECT_SHIFT (9U) -/*! ENIRQRESUMEDETECT - Resume Detection Interrupt Enable */ -#define USBPHY_CTRL_TOG_ENIRQRESUMEDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENIRQRESUMEDETECT_SHIFT)) & USBPHY_CTRL_TOG_ENIRQRESUMEDETECT_MASK) - -#define USBPHY_CTRL_TOG_RESUME_IRQ_MASK (0x400U) -#define USBPHY_CTRL_TOG_RESUME_IRQ_SHIFT (10U) -/*! RESUME_IRQ - Resume Interrupt */ -#define USBPHY_CTRL_TOG_RESUME_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_RESUME_IRQ_SHIFT)) & USBPHY_CTRL_TOG_RESUME_IRQ_MASK) - -#define USBPHY_CTRL_TOG_ENIRQDEVPLUGIN_MASK (0x800U) -#define USBPHY_CTRL_TOG_ENIRQDEVPLUGIN_SHIFT (11U) -/*! ENIRQDEVPLUGIN - Enable Interrupt for Nonstandard Resistive Plugged-In Detection */ -#define USBPHY_CTRL_TOG_ENIRQDEVPLUGIN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENIRQDEVPLUGIN_SHIFT)) & USBPHY_CTRL_TOG_ENIRQDEVPLUGIN_MASK) - -#define USBPHY_CTRL_TOG_DEVPLUGIN_IRQ_MASK (0x1000U) -#define USBPHY_CTRL_TOG_DEVPLUGIN_IRQ_SHIFT (12U) -/*! DEVPLUGIN_IRQ - Device Plug-In Interrupt */ -#define USBPHY_CTRL_TOG_DEVPLUGIN_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_DEVPLUGIN_IRQ_SHIFT)) & USBPHY_CTRL_TOG_DEVPLUGIN_IRQ_MASK) - -#define USBPHY_CTRL_TOG_DATA_ON_LRADC_MASK (0x2000U) -#define USBPHY_CTRL_TOG_DATA_ON_LRADC_SHIFT (13U) -/*! DATA_ON_LRADC - APB Clock Switch Option */ -#define USBPHY_CTRL_TOG_DATA_ON_LRADC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_DATA_ON_LRADC_SHIFT)) & USBPHY_CTRL_TOG_DATA_ON_LRADC_MASK) - -#define USBPHY_CTRL_TOG_ENUTMILEVEL2_MASK (0x4000U) -#define USBPHY_CTRL_TOG_ENUTMILEVEL2_SHIFT (14U) -/*! ENUTMILEVEL2 - UTMI Level 2 Enable */ -#define USBPHY_CTRL_TOG_ENUTMILEVEL2(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENUTMILEVEL2_SHIFT)) & USBPHY_CTRL_TOG_ENUTMILEVEL2_MASK) - -#define USBPHY_CTRL_TOG_ENUTMILEVEL3_MASK (0x8000U) -#define USBPHY_CTRL_TOG_ENUTMILEVEL3_SHIFT (15U) -/*! ENUTMILEVEL3 - UTMI Level 3 Enable */ -#define USBPHY_CTRL_TOG_ENUTMILEVEL3(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENUTMILEVEL3_SHIFT)) & USBPHY_CTRL_TOG_ENUTMILEVEL3_MASK) - -#define USBPHY_CTRL_TOG_ENIRQWAKEUP_MASK (0x10000U) -#define USBPHY_CTRL_TOG_ENIRQWAKEUP_SHIFT (16U) -/*! ENIRQWAKEUP - Wake-Up Interrupt Enable */ -#define USBPHY_CTRL_TOG_ENIRQWAKEUP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENIRQWAKEUP_SHIFT)) & USBPHY_CTRL_TOG_ENIRQWAKEUP_MASK) - -#define USBPHY_CTRL_TOG_WAKEUP_IRQ_MASK (0x20000U) -#define USBPHY_CTRL_TOG_WAKEUP_IRQ_SHIFT (17U) -/*! WAKEUP_IRQ - Wake-Up Interrupt */ -#define USBPHY_CTRL_TOG_WAKEUP_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_WAKEUP_IRQ_SHIFT)) & USBPHY_CTRL_TOG_WAKEUP_IRQ_MASK) - -#define USBPHY_CTRL_TOG_AUTORESUME_EN_MASK (0x40000U) -#define USBPHY_CTRL_TOG_AUTORESUME_EN_SHIFT (18U) -/*! AUTORESUME_EN - Autoresume Enable */ -#define USBPHY_CTRL_TOG_AUTORESUME_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_AUTORESUME_EN_SHIFT)) & USBPHY_CTRL_TOG_AUTORESUME_EN_MASK) - -#define USBPHY_CTRL_TOG_ENAUTOCLR_CLKGATE_MASK (0x80000U) -#define USBPHY_CTRL_TOG_ENAUTOCLR_CLKGATE_SHIFT (19U) -/*! ENAUTOCLR_CLKGATE - Autoclear Clock Gate Enable */ -#define USBPHY_CTRL_TOG_ENAUTOCLR_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENAUTOCLR_CLKGATE_SHIFT)) & USBPHY_CTRL_TOG_ENAUTOCLR_CLKGATE_MASK) - -#define USBPHY_CTRL_TOG_ENAUTOCLR_PHY_PWD_MASK (0x100000U) -#define USBPHY_CTRL_TOG_ENAUTOCLR_PHY_PWD_SHIFT (20U) -/*! ENAUTOCLR_PHY_PWD - PHY PWD Autoclear Enable */ -#define USBPHY_CTRL_TOG_ENAUTOCLR_PHY_PWD(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENAUTOCLR_PHY_PWD_SHIFT)) & USBPHY_CTRL_TOG_ENAUTOCLR_PHY_PWD_MASK) - -#define USBPHY_CTRL_TOG_OTG_ID_VALUE_MASK (0x8000000U) -#define USBPHY_CTRL_TOG_OTG_ID_VALUE_SHIFT (27U) -/*! OTG_ID_VALUE - OTG ID Value */ -#define USBPHY_CTRL_TOG_OTG_ID_VALUE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_OTG_ID_VALUE_SHIFT)) & USBPHY_CTRL_TOG_OTG_ID_VALUE_MASK) - -#define USBPHY_CTRL_TOG_UTMI_SUSPENDM_MASK (0x20000000U) -#define USBPHY_CTRL_TOG_UTMI_SUSPENDM_SHIFT (29U) -/*! UTMI_SUSPENDM - UTMI Suspend */ -#define USBPHY_CTRL_TOG_UTMI_SUSPENDM(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_UTMI_SUSPENDM_SHIFT)) & USBPHY_CTRL_TOG_UTMI_SUSPENDM_MASK) - -#define USBPHY_CTRL_TOG_CLKGATE_MASK (0x40000000U) -#define USBPHY_CTRL_TOG_CLKGATE_SHIFT (30U) -/*! CLKGATE - UTMI Clock Gate */ -#define USBPHY_CTRL_TOG_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_CLKGATE_SHIFT)) & USBPHY_CTRL_TOG_CLKGATE_MASK) - -#define USBPHY_CTRL_TOG_SFTRST_MASK (0x80000000U) -#define USBPHY_CTRL_TOG_SFTRST_SHIFT (31U) -/*! SFTRST - Software Reset */ -#define USBPHY_CTRL_TOG_SFTRST(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_SFTRST_SHIFT)) & USBPHY_CTRL_TOG_SFTRST_MASK) -/*! @} */ - -/*! @name STATUS - Status */ -/*! @{ */ - -#define USBPHY_STATUS_OK_STATUS_3V_MASK (0x1U) -#define USBPHY_STATUS_OK_STATUS_3V_SHIFT (0U) -/*! OK_STATUS_3V - USB 3.3 V and 1.8 V Supply Status - * 0b0..Not powered - * 0b1..Powered - */ -#define USBPHY_STATUS_OK_STATUS_3V(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_STATUS_OK_STATUS_3V_SHIFT)) & USBPHY_STATUS_OK_STATUS_3V_MASK) - -#define USBPHY_STATUS_HOSTDISCONDETECT_STATUS_MASK (0x8U) -#define USBPHY_STATUS_HOSTDISCONDETECT_STATUS_SHIFT (3U) -/*! HOSTDISCONDETECT_STATUS - Host Disconnect Status - * 0b0..Not detected - * 0b1..Detected - */ -#define USBPHY_STATUS_HOSTDISCONDETECT_STATUS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_STATUS_HOSTDISCONDETECT_STATUS_SHIFT)) & USBPHY_STATUS_HOSTDISCONDETECT_STATUS_MASK) - -#define USBPHY_STATUS_DEVPLUGIN_STATUS_MASK (0x40U) -#define USBPHY_STATUS_DEVPLUGIN_STATUS_SHIFT (6U) -/*! DEVPLUGIN_STATUS - Status Indicator for Nonstandard Resistive Plugged-In Detection - * 0b0..No attachment detected - * 0b1..Cable attachment detected - */ -#define USBPHY_STATUS_DEVPLUGIN_STATUS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_STATUS_DEVPLUGIN_STATUS_SHIFT)) & USBPHY_STATUS_DEVPLUGIN_STATUS_MASK) - -#define USBPHY_STATUS_OTGID_STATUS_MASK (0x100U) -#define USBPHY_STATUS_OTGID_STATUS_SHIFT (8U) -/*! OTGID_STATUS - OTG ID Status - * 0b0..Host - * 0b1..Device - */ -#define USBPHY_STATUS_OTGID_STATUS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_STATUS_OTGID_STATUS_SHIFT)) & USBPHY_STATUS_OTGID_STATUS_MASK) - -#define USBPHY_STATUS_RESUME_STATUS_MASK (0x400U) -#define USBPHY_STATUS_RESUME_STATUS_SHIFT (10U) -/*! RESUME_STATUS - Resume Status */ -#define USBPHY_STATUS_RESUME_STATUS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_STATUS_RESUME_STATUS_SHIFT)) & USBPHY_STATUS_RESUME_STATUS_MASK) -/*! @} */ - -/*! @name DEBUG0 - Debug 0 */ -/*! @{ */ - -#define USBPHY_DEBUG0_OTGIDPIOLOCK_MASK (0x1U) -#define USBPHY_DEBUG0_OTGIDPIOLOCK_SHIFT (0U) -/*! OTGIDPIOLOCK - Hold OTG_ID */ -#define USBPHY_DEBUG0_OTGIDPIOLOCK(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_OTGIDPIOLOCK_SHIFT)) & USBPHY_DEBUG0_OTGIDPIOLOCK_MASK) - -#define USBPHY_DEBUG0_HSTPULLDOWN_MASK (0xCU) -#define USBPHY_DEBUG0_HSTPULLDOWN_SHIFT (2U) -/*! HSTPULLDOWN - Host Pulldown Overdrive Mode - * 0b00..Disconnect - * 0b01..Connect - */ -#define USBPHY_DEBUG0_HSTPULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_HSTPULLDOWN_SHIFT)) & USBPHY_DEBUG0_HSTPULLDOWN_MASK) - -#define USBPHY_DEBUG0_ENHSTPULLDOWN_MASK (0x30U) -#define USBPHY_DEBUG0_ENHSTPULLDOWN_SHIFT (4U) -/*! ENHSTPULLDOWN - Enable Host Pulldown Overdrive Mode - * 0b00..Disable - * 0b01..Enable - */ -#define USBPHY_DEBUG0_ENHSTPULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_ENHSTPULLDOWN_SHIFT)) & USBPHY_DEBUG0_ENHSTPULLDOWN_MASK) -/*! @} */ - -/*! @name DEBUG0_SET - Debug 0 */ -/*! @{ */ - -#define USBPHY_DEBUG0_SET_OTGIDPIOLOCK_MASK (0x1U) -#define USBPHY_DEBUG0_SET_OTGIDPIOLOCK_SHIFT (0U) -/*! OTGIDPIOLOCK - Hold OTG_ID */ -#define USBPHY_DEBUG0_SET_OTGIDPIOLOCK(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_SET_OTGIDPIOLOCK_SHIFT)) & USBPHY_DEBUG0_SET_OTGIDPIOLOCK_MASK) - -#define USBPHY_DEBUG0_SET_HSTPULLDOWN_MASK (0xCU) -#define USBPHY_DEBUG0_SET_HSTPULLDOWN_SHIFT (2U) -/*! HSTPULLDOWN - Host Pulldown Overdrive Mode */ -#define USBPHY_DEBUG0_SET_HSTPULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_SET_HSTPULLDOWN_SHIFT)) & USBPHY_DEBUG0_SET_HSTPULLDOWN_MASK) - -#define USBPHY_DEBUG0_SET_ENHSTPULLDOWN_MASK (0x30U) -#define USBPHY_DEBUG0_SET_ENHSTPULLDOWN_SHIFT (4U) -/*! ENHSTPULLDOWN - Enable Host Pulldown Overdrive Mode */ -#define USBPHY_DEBUG0_SET_ENHSTPULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_SET_ENHSTPULLDOWN_SHIFT)) & USBPHY_DEBUG0_SET_ENHSTPULLDOWN_MASK) -/*! @} */ - -/*! @name DEBUG0_CLR - Debug 0 */ -/*! @{ */ - -#define USBPHY_DEBUG0_CLR_OTGIDPIOLOCK_MASK (0x1U) -#define USBPHY_DEBUG0_CLR_OTGIDPIOLOCK_SHIFT (0U) -/*! OTGIDPIOLOCK - Hold OTG_ID */ -#define USBPHY_DEBUG0_CLR_OTGIDPIOLOCK(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_CLR_OTGIDPIOLOCK_SHIFT)) & USBPHY_DEBUG0_CLR_OTGIDPIOLOCK_MASK) - -#define USBPHY_DEBUG0_CLR_HSTPULLDOWN_MASK (0xCU) -#define USBPHY_DEBUG0_CLR_HSTPULLDOWN_SHIFT (2U) -/*! HSTPULLDOWN - Host Pulldown Overdrive Mode */ -#define USBPHY_DEBUG0_CLR_HSTPULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_CLR_HSTPULLDOWN_SHIFT)) & USBPHY_DEBUG0_CLR_HSTPULLDOWN_MASK) - -#define USBPHY_DEBUG0_CLR_ENHSTPULLDOWN_MASK (0x30U) -#define USBPHY_DEBUG0_CLR_ENHSTPULLDOWN_SHIFT (4U) -/*! ENHSTPULLDOWN - Enable Host Pulldown Overdrive Mode */ -#define USBPHY_DEBUG0_CLR_ENHSTPULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_CLR_ENHSTPULLDOWN_SHIFT)) & USBPHY_DEBUG0_CLR_ENHSTPULLDOWN_MASK) -/*! @} */ - -/*! @name DEBUG0_TOG - Debug 0 */ -/*! @{ */ - -#define USBPHY_DEBUG0_TOG_OTGIDPIOLOCK_MASK (0x1U) -#define USBPHY_DEBUG0_TOG_OTGIDPIOLOCK_SHIFT (0U) -/*! OTGIDPIOLOCK - Hold OTG_ID */ -#define USBPHY_DEBUG0_TOG_OTGIDPIOLOCK(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_TOG_OTGIDPIOLOCK_SHIFT)) & USBPHY_DEBUG0_TOG_OTGIDPIOLOCK_MASK) - -#define USBPHY_DEBUG0_TOG_HSTPULLDOWN_MASK (0xCU) -#define USBPHY_DEBUG0_TOG_HSTPULLDOWN_SHIFT (2U) -/*! HSTPULLDOWN - Host Pulldown Overdrive Mode */ -#define USBPHY_DEBUG0_TOG_HSTPULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_TOG_HSTPULLDOWN_SHIFT)) & USBPHY_DEBUG0_TOG_HSTPULLDOWN_MASK) - -#define USBPHY_DEBUG0_TOG_ENHSTPULLDOWN_MASK (0x30U) -#define USBPHY_DEBUG0_TOG_ENHSTPULLDOWN_SHIFT (4U) -/*! ENHSTPULLDOWN - Enable Host Pulldown Overdrive Mode */ -#define USBPHY_DEBUG0_TOG_ENHSTPULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_TOG_ENHSTPULLDOWN_SHIFT)) & USBPHY_DEBUG0_TOG_ENHSTPULLDOWN_MASK) -/*! @} */ - -/*! @name VERSION - Version */ -/*! @{ */ - -#define USBPHY_VERSION_STEP_MASK (0xFFFFU) -#define USBPHY_VERSION_STEP_SHIFT (0U) -/*! STEP - Step */ -#define USBPHY_VERSION_STEP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_VERSION_STEP_SHIFT)) & USBPHY_VERSION_STEP_MASK) - -#define USBPHY_VERSION_MINOR_MASK (0xFF0000U) -#define USBPHY_VERSION_MINOR_SHIFT (16U) -/*! MINOR - Minor */ -#define USBPHY_VERSION_MINOR(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_VERSION_MINOR_SHIFT)) & USBPHY_VERSION_MINOR_MASK) - -#define USBPHY_VERSION_MAJOR_MASK (0xFF000000U) -#define USBPHY_VERSION_MAJOR_SHIFT (24U) -/*! MAJOR - Major */ -#define USBPHY_VERSION_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_VERSION_MAJOR_SHIFT)) & USBPHY_VERSION_MAJOR_MASK) -/*! @} */ - -/*! @name IP - IP Block */ -/*! @{ */ - -#define USBPHY_IP_POWER_CONTROL_SUSPEND_OPTION_MASK (0x1U) -#define USBPHY_IP_POWER_CONTROL_SUSPEND_OPTION_SHIFT (0U) -/*! POWER_CONTROL_SUSPEND_OPTION - Power Control Suspend Option */ -#define USBPHY_IP_POWER_CONTROL_SUSPEND_OPTION(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_IP_POWER_CONTROL_SUSPEND_OPTION_SHIFT)) & USBPHY_IP_POWER_CONTROL_SUSPEND_OPTION_MASK) -/*! @} */ - -/*! @name IP_SET - IP Block */ -/*! @{ */ - -#define USBPHY_IP_SET_POWER_CONTROL_SUSPEND_OPTION_MASK (0x1U) -#define USBPHY_IP_SET_POWER_CONTROL_SUSPEND_OPTION_SHIFT (0U) -/*! POWER_CONTROL_SUSPEND_OPTION - Power Control Suspend Option */ -#define USBPHY_IP_SET_POWER_CONTROL_SUSPEND_OPTION(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_IP_SET_POWER_CONTROL_SUSPEND_OPTION_SHIFT)) & USBPHY_IP_SET_POWER_CONTROL_SUSPEND_OPTION_MASK) -/*! @} */ - -/*! @name IP_CLR - IP Block */ -/*! @{ */ - -#define USBPHY_IP_CLR_POWER_CONTROL_SUSPEND_OPTION_MASK (0x1U) -#define USBPHY_IP_CLR_POWER_CONTROL_SUSPEND_OPTION_SHIFT (0U) -/*! POWER_CONTROL_SUSPEND_OPTION - Power Control Suspend Option */ -#define USBPHY_IP_CLR_POWER_CONTROL_SUSPEND_OPTION(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_IP_CLR_POWER_CONTROL_SUSPEND_OPTION_SHIFT)) & USBPHY_IP_CLR_POWER_CONTROL_SUSPEND_OPTION_MASK) -/*! @} */ - -/*! @name IP_TOG - IP Block */ -/*! @{ */ - -#define USBPHY_IP_TOG_POWER_CONTROL_SUSPEND_OPTION_MASK (0x1U) -#define USBPHY_IP_TOG_POWER_CONTROL_SUSPEND_OPTION_SHIFT (0U) -/*! POWER_CONTROL_SUSPEND_OPTION - Power Control Suspend Option */ -#define USBPHY_IP_TOG_POWER_CONTROL_SUSPEND_OPTION(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_IP_TOG_POWER_CONTROL_SUSPEND_OPTION_SHIFT)) & USBPHY_IP_TOG_POWER_CONTROL_SUSPEND_OPTION_MASK) -/*! @} */ - -/*! @name PLL_SIC - PLL SIC */ -/*! @{ */ - -#define USBPHY_PLL_SIC_MISC2_CONTROL0_MASK (0x20U) -#define USBPHY_PLL_SIC_MISC2_CONTROL0_SHIFT (5U) -/*! MISC2_CONTROL0 - Miscellaneous Control - * 0b0..Power up PLL - * 0b1..Power down PLL - */ -#define USBPHY_PLL_SIC_MISC2_CONTROL0(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_MISC2_CONTROL0_SHIFT)) & USBPHY_PLL_SIC_MISC2_CONTROL0_MASK) - -#define USBPHY_PLL_SIC_PLL_EN_USB_CLKS_MASK (0x40U) -#define USBPHY_PLL_SIC_PLL_EN_USB_CLKS_SHIFT (6U) -/*! PLL_EN_USB_CLKS - PLL Multi-Phase Clock Outputs Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_PLL_SIC_PLL_EN_USB_CLKS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_PLL_EN_USB_CLKS_SHIFT)) & USBPHY_PLL_SIC_PLL_EN_USB_CLKS_MASK) - -#define USBPHY_PLL_SIC_PLL_POWER_MASK (0x1000U) -#define USBPHY_PLL_SIC_PLL_POWER_SHIFT (12U) -/*! PLL_POWER - USB PLL Powerup Control - * 0b0..Power down - * 0b1..Allow powerup - */ -#define USBPHY_PLL_SIC_PLL_POWER(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_PLL_POWER_SHIFT)) & USBPHY_PLL_SIC_PLL_POWER_MASK) - -#define USBPHY_PLL_SIC_PLL_ENABLE_MASK (0x2000U) -#define USBPHY_PLL_SIC_PLL_ENABLE_SHIFT (13U) -/*! PLL_ENABLE - PLL Output Clock Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_PLL_SIC_PLL_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_PLL_ENABLE_SHIFT)) & USBPHY_PLL_SIC_PLL_ENABLE_MASK) - -#define USBPHY_PLL_SIC_PLL_BYPASS_MASK (0x10000U) -#define USBPHY_PLL_SIC_PLL_BYPASS_SHIFT (16U) -/*! PLL_BYPASS - Bypass USB PLL - * 0b0..480 MHz output clock - * 0b1..Input reference clock - */ -#define USBPHY_PLL_SIC_PLL_BYPASS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_PLL_BYPASS_SHIFT)) & USBPHY_PLL_SIC_PLL_BYPASS_MASK) - -#define USBPHY_PLL_SIC_REFBIAS_PWD_SEL_MASK (0x80000U) -#define USBPHY_PLL_SIC_REFBIAS_PWD_SEL_SHIFT (19U) -/*! REFBIAS_PWD_SEL - Reference Bias Power Control - * 0b0..PLL_POWER internal state signal - * 0b1..REFBIAS_PWD - */ -#define USBPHY_PLL_SIC_REFBIAS_PWD_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_REFBIAS_PWD_SEL_SHIFT)) & USBPHY_PLL_SIC_REFBIAS_PWD_SEL_MASK) - -#define USBPHY_PLL_SIC_REFBIAS_PWD_MASK (0x100000U) -#define USBPHY_PLL_SIC_REFBIAS_PWD_SHIFT (20U) -/*! REFBIAS_PWD - Power Down Reference Bias - * 0b0..Enable - * 0b1..Disable or power down - */ -#define USBPHY_PLL_SIC_REFBIAS_PWD(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_REFBIAS_PWD_SHIFT)) & USBPHY_PLL_SIC_REFBIAS_PWD_MASK) - -#define USBPHY_PLL_SIC_PLL_REG_ENABLE_MASK (0x200000U) -#define USBPHY_PLL_SIC_PLL_REG_ENABLE_SHIFT (21U) -/*! PLL_REG_ENABLE - Enable PLL Regulator - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_PLL_SIC_PLL_REG_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_PLL_REG_ENABLE_SHIFT)) & USBPHY_PLL_SIC_PLL_REG_ENABLE_MASK) - -#define USBPHY_PLL_SIC_PLL_DIV_SEL_MASK (0x1C00000U) -#define USBPHY_PLL_SIC_PLL_DIV_SEL_SHIFT (22U) -/*! PLL_DIV_SEL - PLL Divider Value Configuration - * 0b000..Configure for a 32 MHz input clock (divide by 15) - * 0b001..Configure for a 30 MHz input clock (divide by 16) - * 0b010..Configure for a 24 MHz input clock (divide by 20) - * 0b011..Reserved, not usable for USB operation (divide by 22) - * 0b100..Configure for a 20 MHz input clock (divide by 24) - * 0b101..Configure for a 19.2 MHz input clock (divide by 25) - * 0b110..Configure for a 16 MHz input clock (divide by 30) - * 0b111..Configure for a 12 MHz input clock (divide by 40) - */ -#define USBPHY_PLL_SIC_PLL_DIV_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_PLL_DIV_SEL_SHIFT)) & USBPHY_PLL_SIC_PLL_DIV_SEL_MASK) - -#define USBPHY_PLL_SIC_PLL_LOCK_MASK (0x80000000U) -#define USBPHY_PLL_SIC_PLL_LOCK_SHIFT (31U) -/*! PLL_LOCK - USB PLL Lock Status Indicator - * 0b0..Not locked - * 0b1..Locked - */ -#define USBPHY_PLL_SIC_PLL_LOCK(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_PLL_LOCK_SHIFT)) & USBPHY_PLL_SIC_PLL_LOCK_MASK) -/*! @} */ - -/*! @name PLL_SIC_SET - PLL SIC */ -/*! @{ */ - -#define USBPHY_PLL_SIC_SET_MISC2_CONTROL0_MASK (0x20U) -#define USBPHY_PLL_SIC_SET_MISC2_CONTROL0_SHIFT (5U) -/*! MISC2_CONTROL0 - Miscellaneous Control */ -#define USBPHY_PLL_SIC_SET_MISC2_CONTROL0(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_SET_MISC2_CONTROL0_SHIFT)) & USBPHY_PLL_SIC_SET_MISC2_CONTROL0_MASK) - -#define USBPHY_PLL_SIC_SET_PLL_EN_USB_CLKS_MASK (0x40U) -#define USBPHY_PLL_SIC_SET_PLL_EN_USB_CLKS_SHIFT (6U) -/*! PLL_EN_USB_CLKS - PLL Multi-Phase Clock Outputs Enable */ -#define USBPHY_PLL_SIC_SET_PLL_EN_USB_CLKS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_SET_PLL_EN_USB_CLKS_SHIFT)) & USBPHY_PLL_SIC_SET_PLL_EN_USB_CLKS_MASK) - -#define USBPHY_PLL_SIC_SET_PLL_POWER_MASK (0x1000U) -#define USBPHY_PLL_SIC_SET_PLL_POWER_SHIFT (12U) -/*! PLL_POWER - USB PLL Powerup Control */ -#define USBPHY_PLL_SIC_SET_PLL_POWER(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_SET_PLL_POWER_SHIFT)) & USBPHY_PLL_SIC_SET_PLL_POWER_MASK) - -#define USBPHY_PLL_SIC_SET_PLL_ENABLE_MASK (0x2000U) -#define USBPHY_PLL_SIC_SET_PLL_ENABLE_SHIFT (13U) -/*! PLL_ENABLE - PLL Output Clock Enable */ -#define USBPHY_PLL_SIC_SET_PLL_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_SET_PLL_ENABLE_SHIFT)) & USBPHY_PLL_SIC_SET_PLL_ENABLE_MASK) - -#define USBPHY_PLL_SIC_SET_PLL_BYPASS_MASK (0x10000U) -#define USBPHY_PLL_SIC_SET_PLL_BYPASS_SHIFT (16U) -/*! PLL_BYPASS - Bypass USB PLL */ -#define USBPHY_PLL_SIC_SET_PLL_BYPASS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_SET_PLL_BYPASS_SHIFT)) & USBPHY_PLL_SIC_SET_PLL_BYPASS_MASK) - -#define USBPHY_PLL_SIC_SET_REFBIAS_PWD_SEL_MASK (0x80000U) -#define USBPHY_PLL_SIC_SET_REFBIAS_PWD_SEL_SHIFT (19U) -/*! REFBIAS_PWD_SEL - Reference Bias Power Control */ -#define USBPHY_PLL_SIC_SET_REFBIAS_PWD_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_SET_REFBIAS_PWD_SEL_SHIFT)) & USBPHY_PLL_SIC_SET_REFBIAS_PWD_SEL_MASK) - -#define USBPHY_PLL_SIC_SET_REFBIAS_PWD_MASK (0x100000U) -#define USBPHY_PLL_SIC_SET_REFBIAS_PWD_SHIFT (20U) -/*! REFBIAS_PWD - Power Down Reference Bias */ -#define USBPHY_PLL_SIC_SET_REFBIAS_PWD(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_SET_REFBIAS_PWD_SHIFT)) & USBPHY_PLL_SIC_SET_REFBIAS_PWD_MASK) - -#define USBPHY_PLL_SIC_SET_PLL_REG_ENABLE_MASK (0x200000U) -#define USBPHY_PLL_SIC_SET_PLL_REG_ENABLE_SHIFT (21U) -/*! PLL_REG_ENABLE - Enable PLL Regulator */ -#define USBPHY_PLL_SIC_SET_PLL_REG_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_SET_PLL_REG_ENABLE_SHIFT)) & USBPHY_PLL_SIC_SET_PLL_REG_ENABLE_MASK) - -#define USBPHY_PLL_SIC_SET_PLL_DIV_SEL_MASK (0x1C00000U) -#define USBPHY_PLL_SIC_SET_PLL_DIV_SEL_SHIFT (22U) -/*! PLL_DIV_SEL - PLL Divider Value Configuration */ -#define USBPHY_PLL_SIC_SET_PLL_DIV_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_SET_PLL_DIV_SEL_SHIFT)) & USBPHY_PLL_SIC_SET_PLL_DIV_SEL_MASK) - -#define USBPHY_PLL_SIC_SET_PLL_LOCK_MASK (0x80000000U) -#define USBPHY_PLL_SIC_SET_PLL_LOCK_SHIFT (31U) -/*! PLL_LOCK - USB PLL Lock Status Indicator */ -#define USBPHY_PLL_SIC_SET_PLL_LOCK(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_SET_PLL_LOCK_SHIFT)) & USBPHY_PLL_SIC_SET_PLL_LOCK_MASK) -/*! @} */ - -/*! @name PLL_SIC_CLR - PLL SIC */ -/*! @{ */ - -#define USBPHY_PLL_SIC_CLR_MISC2_CONTROL0_MASK (0x20U) -#define USBPHY_PLL_SIC_CLR_MISC2_CONTROL0_SHIFT (5U) -/*! MISC2_CONTROL0 - Miscellaneous Control */ -#define USBPHY_PLL_SIC_CLR_MISC2_CONTROL0(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_CLR_MISC2_CONTROL0_SHIFT)) & USBPHY_PLL_SIC_CLR_MISC2_CONTROL0_MASK) - -#define USBPHY_PLL_SIC_CLR_PLL_EN_USB_CLKS_MASK (0x40U) -#define USBPHY_PLL_SIC_CLR_PLL_EN_USB_CLKS_SHIFT (6U) -/*! PLL_EN_USB_CLKS - PLL Multi-Phase Clock Outputs Enable */ -#define USBPHY_PLL_SIC_CLR_PLL_EN_USB_CLKS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_CLR_PLL_EN_USB_CLKS_SHIFT)) & USBPHY_PLL_SIC_CLR_PLL_EN_USB_CLKS_MASK) - -#define USBPHY_PLL_SIC_CLR_PLL_POWER_MASK (0x1000U) -#define USBPHY_PLL_SIC_CLR_PLL_POWER_SHIFT (12U) -/*! PLL_POWER - USB PLL Powerup Control */ -#define USBPHY_PLL_SIC_CLR_PLL_POWER(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_CLR_PLL_POWER_SHIFT)) & USBPHY_PLL_SIC_CLR_PLL_POWER_MASK) - -#define USBPHY_PLL_SIC_CLR_PLL_ENABLE_MASK (0x2000U) -#define USBPHY_PLL_SIC_CLR_PLL_ENABLE_SHIFT (13U) -/*! PLL_ENABLE - PLL Output Clock Enable */ -#define USBPHY_PLL_SIC_CLR_PLL_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_CLR_PLL_ENABLE_SHIFT)) & USBPHY_PLL_SIC_CLR_PLL_ENABLE_MASK) - -#define USBPHY_PLL_SIC_CLR_PLL_BYPASS_MASK (0x10000U) -#define USBPHY_PLL_SIC_CLR_PLL_BYPASS_SHIFT (16U) -/*! PLL_BYPASS - Bypass USB PLL */ -#define USBPHY_PLL_SIC_CLR_PLL_BYPASS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_CLR_PLL_BYPASS_SHIFT)) & USBPHY_PLL_SIC_CLR_PLL_BYPASS_MASK) - -#define USBPHY_PLL_SIC_CLR_REFBIAS_PWD_SEL_MASK (0x80000U) -#define USBPHY_PLL_SIC_CLR_REFBIAS_PWD_SEL_SHIFT (19U) -/*! REFBIAS_PWD_SEL - Reference Bias Power Control */ -#define USBPHY_PLL_SIC_CLR_REFBIAS_PWD_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_CLR_REFBIAS_PWD_SEL_SHIFT)) & USBPHY_PLL_SIC_CLR_REFBIAS_PWD_SEL_MASK) - -#define USBPHY_PLL_SIC_CLR_REFBIAS_PWD_MASK (0x100000U) -#define USBPHY_PLL_SIC_CLR_REFBIAS_PWD_SHIFT (20U) -/*! REFBIAS_PWD - Power Down Reference Bias */ -#define USBPHY_PLL_SIC_CLR_REFBIAS_PWD(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_CLR_REFBIAS_PWD_SHIFT)) & USBPHY_PLL_SIC_CLR_REFBIAS_PWD_MASK) - -#define USBPHY_PLL_SIC_CLR_PLL_REG_ENABLE_MASK (0x200000U) -#define USBPHY_PLL_SIC_CLR_PLL_REG_ENABLE_SHIFT (21U) -/*! PLL_REG_ENABLE - Enable PLL Regulator */ -#define USBPHY_PLL_SIC_CLR_PLL_REG_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_CLR_PLL_REG_ENABLE_SHIFT)) & USBPHY_PLL_SIC_CLR_PLL_REG_ENABLE_MASK) - -#define USBPHY_PLL_SIC_CLR_PLL_DIV_SEL_MASK (0x1C00000U) -#define USBPHY_PLL_SIC_CLR_PLL_DIV_SEL_SHIFT (22U) -/*! PLL_DIV_SEL - PLL Divider Value Configuration */ -#define USBPHY_PLL_SIC_CLR_PLL_DIV_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_CLR_PLL_DIV_SEL_SHIFT)) & USBPHY_PLL_SIC_CLR_PLL_DIV_SEL_MASK) - -#define USBPHY_PLL_SIC_CLR_PLL_LOCK_MASK (0x80000000U) -#define USBPHY_PLL_SIC_CLR_PLL_LOCK_SHIFT (31U) -/*! PLL_LOCK - USB PLL Lock Status Indicator */ -#define USBPHY_PLL_SIC_CLR_PLL_LOCK(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_CLR_PLL_LOCK_SHIFT)) & USBPHY_PLL_SIC_CLR_PLL_LOCK_MASK) -/*! @} */ - -/*! @name PLL_SIC_TOG - PLL SIC */ -/*! @{ */ - -#define USBPHY_PLL_SIC_TOG_MISC2_CONTROL0_MASK (0x20U) -#define USBPHY_PLL_SIC_TOG_MISC2_CONTROL0_SHIFT (5U) -/*! MISC2_CONTROL0 - Miscellaneous Control */ -#define USBPHY_PLL_SIC_TOG_MISC2_CONTROL0(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_TOG_MISC2_CONTROL0_SHIFT)) & USBPHY_PLL_SIC_TOG_MISC2_CONTROL0_MASK) - -#define USBPHY_PLL_SIC_TOG_PLL_EN_USB_CLKS_MASK (0x40U) -#define USBPHY_PLL_SIC_TOG_PLL_EN_USB_CLKS_SHIFT (6U) -/*! PLL_EN_USB_CLKS - PLL Multi-Phase Clock Outputs Enable */ -#define USBPHY_PLL_SIC_TOG_PLL_EN_USB_CLKS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_TOG_PLL_EN_USB_CLKS_SHIFT)) & USBPHY_PLL_SIC_TOG_PLL_EN_USB_CLKS_MASK) - -#define USBPHY_PLL_SIC_TOG_PLL_POWER_MASK (0x1000U) -#define USBPHY_PLL_SIC_TOG_PLL_POWER_SHIFT (12U) -/*! PLL_POWER - USB PLL Powerup Control */ -#define USBPHY_PLL_SIC_TOG_PLL_POWER(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_TOG_PLL_POWER_SHIFT)) & USBPHY_PLL_SIC_TOG_PLL_POWER_MASK) - -#define USBPHY_PLL_SIC_TOG_PLL_ENABLE_MASK (0x2000U) -#define USBPHY_PLL_SIC_TOG_PLL_ENABLE_SHIFT (13U) -/*! PLL_ENABLE - PLL Output Clock Enable */ -#define USBPHY_PLL_SIC_TOG_PLL_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_TOG_PLL_ENABLE_SHIFT)) & USBPHY_PLL_SIC_TOG_PLL_ENABLE_MASK) - -#define USBPHY_PLL_SIC_TOG_PLL_BYPASS_MASK (0x10000U) -#define USBPHY_PLL_SIC_TOG_PLL_BYPASS_SHIFT (16U) -/*! PLL_BYPASS - Bypass USB PLL */ -#define USBPHY_PLL_SIC_TOG_PLL_BYPASS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_TOG_PLL_BYPASS_SHIFT)) & USBPHY_PLL_SIC_TOG_PLL_BYPASS_MASK) - -#define USBPHY_PLL_SIC_TOG_REFBIAS_PWD_SEL_MASK (0x80000U) -#define USBPHY_PLL_SIC_TOG_REFBIAS_PWD_SEL_SHIFT (19U) -/*! REFBIAS_PWD_SEL - Reference Bias Power Control */ -#define USBPHY_PLL_SIC_TOG_REFBIAS_PWD_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_TOG_REFBIAS_PWD_SEL_SHIFT)) & USBPHY_PLL_SIC_TOG_REFBIAS_PWD_SEL_MASK) - -#define USBPHY_PLL_SIC_TOG_REFBIAS_PWD_MASK (0x100000U) -#define USBPHY_PLL_SIC_TOG_REFBIAS_PWD_SHIFT (20U) -/*! REFBIAS_PWD - Power Down Reference Bias */ -#define USBPHY_PLL_SIC_TOG_REFBIAS_PWD(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_TOG_REFBIAS_PWD_SHIFT)) & USBPHY_PLL_SIC_TOG_REFBIAS_PWD_MASK) - -#define USBPHY_PLL_SIC_TOG_PLL_REG_ENABLE_MASK (0x200000U) -#define USBPHY_PLL_SIC_TOG_PLL_REG_ENABLE_SHIFT (21U) -/*! PLL_REG_ENABLE - Enable PLL Regulator */ -#define USBPHY_PLL_SIC_TOG_PLL_REG_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_TOG_PLL_REG_ENABLE_SHIFT)) & USBPHY_PLL_SIC_TOG_PLL_REG_ENABLE_MASK) - -#define USBPHY_PLL_SIC_TOG_PLL_DIV_SEL_MASK (0x1C00000U) -#define USBPHY_PLL_SIC_TOG_PLL_DIV_SEL_SHIFT (22U) -/*! PLL_DIV_SEL - PLL Divider Value Configuration */ -#define USBPHY_PLL_SIC_TOG_PLL_DIV_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_TOG_PLL_DIV_SEL_SHIFT)) & USBPHY_PLL_SIC_TOG_PLL_DIV_SEL_MASK) - -#define USBPHY_PLL_SIC_TOG_PLL_LOCK_MASK (0x80000000U) -#define USBPHY_PLL_SIC_TOG_PLL_LOCK_SHIFT (31U) -/*! PLL_LOCK - USB PLL Lock Status Indicator */ -#define USBPHY_PLL_SIC_TOG_PLL_LOCK(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_TOG_PLL_LOCK_SHIFT)) & USBPHY_PLL_SIC_TOG_PLL_LOCK_MASK) -/*! @} */ - -/*! @name USB1_VBUS_DETECT - VBUS Detect */ -/*! @{ */ - -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_THRESH_MASK (0x7U) -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_THRESH_SHIFT (0U) -/*! VBUSVALID_THRESH - VBUS Comparator Threshold - * 0b000..4.0 V - * 0b001..4.1 V - * 0b010..4.2 V - * 0b011..4.3 V - * 0b100..4.4 V - * 0b101..4.5 V - * 0b110..4.6 V - * 0b111..4.7 V - */ -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_THRESH(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_VBUSVALID_THRESH_SHIFT)) & USBPHY_USB1_VBUS_DETECT_VBUSVALID_THRESH_MASK) - -#define USBPHY_USB1_VBUS_DETECT_VBUS_OVERRIDE_EN_MASK (0x8U) -#define USBPHY_USB1_VBUS_DETECT_VBUS_OVERRIDE_EN_SHIFT (3U) -/*! VBUS_OVERRIDE_EN - VBUS Detect Signal Local Override Enable - * 0b0..Results of VBUS_VALID and session valid comparators for VBUS_VALID, AVALID, BVALID, and SESSEND - * 0b1..Override values for VBUS_VALID, AVALID, BVALID, and SESSEND - */ -#define USBPHY_USB1_VBUS_DETECT_VBUS_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_VBUS_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_VBUS_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SESSEND_OVERRIDE_MASK (0x10U) -#define USBPHY_USB1_VBUS_DETECT_SESSEND_OVERRIDE_SHIFT (4U) -/*! SESSEND_OVERRIDE - Override Value for SESSEND */ -#define USBPHY_USB1_VBUS_DETECT_SESSEND_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SESSEND_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SESSEND_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_BVALID_OVERRIDE_MASK (0x20U) -#define USBPHY_USB1_VBUS_DETECT_BVALID_OVERRIDE_SHIFT (5U) -/*! BVALID_OVERRIDE - Override Value for B-Device Session Valid */ -#define USBPHY_USB1_VBUS_DETECT_BVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_BVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_BVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_AVALID_OVERRIDE_MASK (0x40U) -#define USBPHY_USB1_VBUS_DETECT_AVALID_OVERRIDE_SHIFT (6U) -/*! AVALID_OVERRIDE - Override Value for A-Device Session Valid */ -#define USBPHY_USB1_VBUS_DETECT_AVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_AVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_AVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_OVERRIDE_MASK (0x80U) -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_OVERRIDE_SHIFT (7U) -/*! VBUSVALID_OVERRIDE - Override Value for the VBUS_VALID Signal */ -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_VBUSVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_VBUSVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_SEL_MASK (0x100U) -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_SEL_SHIFT (8U) -/*! VBUSVALID_SEL - VBUS_VALID Selection - * 0b0..VBUS_VALID comparator result - * 0b1..VBUS_VALID_3V comparator result - */ -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_VBUSVALID_SEL_SHIFT)) & USBPHY_USB1_VBUS_DETECT_VBUSVALID_SEL_MASK) - -#define USBPHY_USB1_VBUS_DETECT_VBUS_SOURCE_SEL_MASK (0x600U) -#define USBPHY_USB1_VBUS_DETECT_VBUS_SOURCE_SEL_SHIFT (9U) -/*! VBUS_SOURCE_SEL - VBUS_VALID Source Selection - * 0b00..VBUS_VALID comparator result - * 0b01..Session valid comparator result - * 0b10..Session valid comparator result - * 0b11.. - */ -#define USBPHY_USB1_VBUS_DETECT_VBUS_SOURCE_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_VBUS_SOURCE_SEL_SHIFT)) & USBPHY_USB1_VBUS_DETECT_VBUS_SOURCE_SEL_MASK) - -#define USBPHY_USB1_VBUS_DETECT_ID_OVERRIDE_EN_MASK (0x800U) -#define USBPHY_USB1_VBUS_DETECT_ID_OVERRIDE_EN_SHIFT (11U) -/*! ID_OVERRIDE_EN - Enable Local ID Pin Status Override - * 0b0..Use ID pin detector or external override - * 0b1..Allow local override of ID pin detection status - */ -#define USBPHY_USB1_VBUS_DETECT_ID_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_ID_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_ID_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_ID_OVERRIDE_MASK (0x1000U) -#define USBPHY_USB1_VBUS_DETECT_ID_OVERRIDE_SHIFT (12U) -/*! ID_OVERRIDE - ID Pin Status Local Override */ -#define USBPHY_USB1_VBUS_DETECT_ID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_ID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_ID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_EXT_ID_OVERRIDE_EN_MASK (0x2000U) -#define USBPHY_USB1_VBUS_DETECT_EXT_ID_OVERRIDE_EN_SHIFT (13U) -/*! EXT_ID_OVERRIDE_EN - External ID Override Enable - * 0b0..Internal detector or local override - * 0b1..External ID signal value - */ -#define USBPHY_USB1_VBUS_DETECT_EXT_ID_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_EXT_ID_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_EXT_ID_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_EXT_VBUS_OVERRIDE_EN_MASK (0x4000U) -#define USBPHY_USB1_VBUS_DETECT_EXT_VBUS_OVERRIDE_EN_SHIFT (14U) -/*! EXT_VBUS_OVERRIDE_EN - External VBUS Override Enable - * 0b0..Internal detector or local override - * 0b1..External VBUS_VALID value - */ -#define USBPHY_USB1_VBUS_DETECT_EXT_VBUS_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_EXT_VBUS_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_EXT_VBUS_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_TO_B_MASK (0x40000U) -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_TO_B_SHIFT (18U) -/*! VBUSVALID_TO_B - VBUS_VALID Comparator Selection - * 0b0..VBUS_VALID comparator - * 0b1..Session valid detector - */ -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_TO_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_VBUSVALID_TO_B_SHIFT)) & USBPHY_USB1_VBUS_DETECT_VBUSVALID_TO_B_MASK) - -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_PWRUP_CMPS_MASK (0x700000U) -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_PWRUP_CMPS_SHIFT (20U) -/*! VBUSVALID_PWRUP_CMPS - VBUS_VALID Comparator Enable - * 0bxx0..Disable or power down the VBUS_VALID comparator - * 0bxx1..Enable the VBUS_VALID comparator - * 0bx0x..Disable or power down the session valid detector - * 0bx1x..Enable the session valid detector - * 0b0xx..Disable or power down the VBUS_VALID_3V detector - * 0b1xx..Enable the VBUS_VALID_3V detector - */ -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_PWRUP_CMPS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_VBUSVALID_PWRUP_CMPS_SHIFT)) & USBPHY_USB1_VBUS_DETECT_VBUSVALID_PWRUP_CMPS_MASK) - -#define USBPHY_USB1_VBUS_DETECT_DISCHARGE_VBUS_MASK (0x4000000U) -#define USBPHY_USB1_VBUS_DETECT_DISCHARGE_VBUS_SHIFT (26U) -/*! DISCHARGE_VBUS - VBUS Discharge Resistor - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_USB1_VBUS_DETECT_DISCHARGE_VBUS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_DISCHARGE_VBUS_SHIFT)) & USBPHY_USB1_VBUS_DETECT_DISCHARGE_VBUS_MASK) -/*! @} */ - -/*! @name USB1_VBUS_DETECT_SET - VBUS Detect */ -/*! @{ */ - -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_THRESH_MASK (0x7U) -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_THRESH_SHIFT (0U) -/*! VBUSVALID_THRESH - VBUS Comparator Threshold */ -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_THRESH(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_THRESH_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_THRESH_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_VBUS_OVERRIDE_EN_MASK (0x8U) -#define USBPHY_USB1_VBUS_DETECT_SET_VBUS_OVERRIDE_EN_SHIFT (3U) -/*! VBUS_OVERRIDE_EN - VBUS Detect Signal Local Override Enable */ -#define USBPHY_USB1_VBUS_DETECT_SET_VBUS_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_VBUS_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_VBUS_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_SESSEND_OVERRIDE_MASK (0x10U) -#define USBPHY_USB1_VBUS_DETECT_SET_SESSEND_OVERRIDE_SHIFT (4U) -/*! SESSEND_OVERRIDE - Override Value for SESSEND */ -#define USBPHY_USB1_VBUS_DETECT_SET_SESSEND_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_SESSEND_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_SESSEND_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_BVALID_OVERRIDE_MASK (0x20U) -#define USBPHY_USB1_VBUS_DETECT_SET_BVALID_OVERRIDE_SHIFT (5U) -/*! BVALID_OVERRIDE - Override Value for B-Device Session Valid */ -#define USBPHY_USB1_VBUS_DETECT_SET_BVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_BVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_BVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_AVALID_OVERRIDE_MASK (0x40U) -#define USBPHY_USB1_VBUS_DETECT_SET_AVALID_OVERRIDE_SHIFT (6U) -/*! AVALID_OVERRIDE - Override Value for A-Device Session Valid */ -#define USBPHY_USB1_VBUS_DETECT_SET_AVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_AVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_AVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_OVERRIDE_MASK (0x80U) -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_OVERRIDE_SHIFT (7U) -/*! VBUSVALID_OVERRIDE - Override Value for the VBUS_VALID Signal */ -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_SEL_MASK (0x100U) -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_SEL_SHIFT (8U) -/*! VBUSVALID_SEL - VBUS_VALID Selection */ -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_SEL_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_SEL_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_VBUS_SOURCE_SEL_MASK (0x600U) -#define USBPHY_USB1_VBUS_DETECT_SET_VBUS_SOURCE_SEL_SHIFT (9U) -/*! VBUS_SOURCE_SEL - VBUS_VALID Source Selection */ -#define USBPHY_USB1_VBUS_DETECT_SET_VBUS_SOURCE_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_VBUS_SOURCE_SEL_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_VBUS_SOURCE_SEL_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_ID_OVERRIDE_EN_MASK (0x800U) -#define USBPHY_USB1_VBUS_DETECT_SET_ID_OVERRIDE_EN_SHIFT (11U) -/*! ID_OVERRIDE_EN - Enable Local ID Pin Status Override */ -#define USBPHY_USB1_VBUS_DETECT_SET_ID_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_ID_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_ID_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_ID_OVERRIDE_MASK (0x1000U) -#define USBPHY_USB1_VBUS_DETECT_SET_ID_OVERRIDE_SHIFT (12U) -/*! ID_OVERRIDE - ID Pin Status Local Override */ -#define USBPHY_USB1_VBUS_DETECT_SET_ID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_ID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_ID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_EXT_ID_OVERRIDE_EN_MASK (0x2000U) -#define USBPHY_USB1_VBUS_DETECT_SET_EXT_ID_OVERRIDE_EN_SHIFT (13U) -/*! EXT_ID_OVERRIDE_EN - External ID Override Enable */ -#define USBPHY_USB1_VBUS_DETECT_SET_EXT_ID_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_EXT_ID_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_EXT_ID_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_EXT_VBUS_OVERRIDE_EN_MASK (0x4000U) -#define USBPHY_USB1_VBUS_DETECT_SET_EXT_VBUS_OVERRIDE_EN_SHIFT (14U) -/*! EXT_VBUS_OVERRIDE_EN - External VBUS Override Enable */ -#define USBPHY_USB1_VBUS_DETECT_SET_EXT_VBUS_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_EXT_VBUS_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_EXT_VBUS_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_TO_B_MASK (0x40000U) -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_TO_B_SHIFT (18U) -/*! VBUSVALID_TO_B - VBUS_VALID Comparator Selection */ -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_TO_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_TO_B_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_TO_B_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_PWRUP_CMPS_MASK (0x700000U) -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_PWRUP_CMPS_SHIFT (20U) -/*! VBUSVALID_PWRUP_CMPS - VBUS_VALID Comparator Enable */ -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_PWRUP_CMPS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_PWRUP_CMPS_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_PWRUP_CMPS_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_DISCHARGE_VBUS_MASK (0x4000000U) -#define USBPHY_USB1_VBUS_DETECT_SET_DISCHARGE_VBUS_SHIFT (26U) -/*! DISCHARGE_VBUS - VBUS Discharge Resistor */ -#define USBPHY_USB1_VBUS_DETECT_SET_DISCHARGE_VBUS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_DISCHARGE_VBUS_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_DISCHARGE_VBUS_MASK) -/*! @} */ - -/*! @name USB1_VBUS_DETECT_CLR - VBUS Detect */ -/*! @{ */ - -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_THRESH_MASK (0x7U) -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_THRESH_SHIFT (0U) -/*! VBUSVALID_THRESH - VBUS Comparator Threshold */ -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_THRESH(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_THRESH_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_THRESH_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUS_OVERRIDE_EN_MASK (0x8U) -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUS_OVERRIDE_EN_SHIFT (3U) -/*! VBUS_OVERRIDE_EN - VBUS Detect Signal Local Override Enable */ -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUS_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_VBUS_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_VBUS_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_SESSEND_OVERRIDE_MASK (0x10U) -#define USBPHY_USB1_VBUS_DETECT_CLR_SESSEND_OVERRIDE_SHIFT (4U) -/*! SESSEND_OVERRIDE - Override Value for SESSEND */ -#define USBPHY_USB1_VBUS_DETECT_CLR_SESSEND_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_SESSEND_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_SESSEND_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_BVALID_OVERRIDE_MASK (0x20U) -#define USBPHY_USB1_VBUS_DETECT_CLR_BVALID_OVERRIDE_SHIFT (5U) -/*! BVALID_OVERRIDE - Override Value for B-Device Session Valid */ -#define USBPHY_USB1_VBUS_DETECT_CLR_BVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_BVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_BVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_AVALID_OVERRIDE_MASK (0x40U) -#define USBPHY_USB1_VBUS_DETECT_CLR_AVALID_OVERRIDE_SHIFT (6U) -/*! AVALID_OVERRIDE - Override Value for A-Device Session Valid */ -#define USBPHY_USB1_VBUS_DETECT_CLR_AVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_AVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_AVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_OVERRIDE_MASK (0x80U) -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_OVERRIDE_SHIFT (7U) -/*! VBUSVALID_OVERRIDE - Override Value for the VBUS_VALID Signal */ -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_SEL_MASK (0x100U) -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_SEL_SHIFT (8U) -/*! VBUSVALID_SEL - VBUS_VALID Selection */ -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_SEL_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_SEL_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUS_SOURCE_SEL_MASK (0x600U) -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUS_SOURCE_SEL_SHIFT (9U) -/*! VBUS_SOURCE_SEL - VBUS_VALID Source Selection */ -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUS_SOURCE_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_VBUS_SOURCE_SEL_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_VBUS_SOURCE_SEL_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_ID_OVERRIDE_EN_MASK (0x800U) -#define USBPHY_USB1_VBUS_DETECT_CLR_ID_OVERRIDE_EN_SHIFT (11U) -/*! ID_OVERRIDE_EN - Enable Local ID Pin Status Override */ -#define USBPHY_USB1_VBUS_DETECT_CLR_ID_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_ID_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_ID_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_ID_OVERRIDE_MASK (0x1000U) -#define USBPHY_USB1_VBUS_DETECT_CLR_ID_OVERRIDE_SHIFT (12U) -/*! ID_OVERRIDE - ID Pin Status Local Override */ -#define USBPHY_USB1_VBUS_DETECT_CLR_ID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_ID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_ID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_EXT_ID_OVERRIDE_EN_MASK (0x2000U) -#define USBPHY_USB1_VBUS_DETECT_CLR_EXT_ID_OVERRIDE_EN_SHIFT (13U) -/*! EXT_ID_OVERRIDE_EN - External ID Override Enable */ -#define USBPHY_USB1_VBUS_DETECT_CLR_EXT_ID_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_EXT_ID_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_EXT_ID_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_EXT_VBUS_OVERRIDE_EN_MASK (0x4000U) -#define USBPHY_USB1_VBUS_DETECT_CLR_EXT_VBUS_OVERRIDE_EN_SHIFT (14U) -/*! EXT_VBUS_OVERRIDE_EN - External VBUS Override Enable */ -#define USBPHY_USB1_VBUS_DETECT_CLR_EXT_VBUS_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_EXT_VBUS_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_EXT_VBUS_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_TO_B_MASK (0x40000U) -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_TO_B_SHIFT (18U) -/*! VBUSVALID_TO_B - VBUS_VALID Comparator Selection */ -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_TO_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_TO_B_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_TO_B_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_PWRUP_CMPS_MASK (0x700000U) -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_PWRUP_CMPS_SHIFT (20U) -/*! VBUSVALID_PWRUP_CMPS - VBUS_VALID Comparator Enable */ -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_PWRUP_CMPS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_PWRUP_CMPS_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_PWRUP_CMPS_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_DISCHARGE_VBUS_MASK (0x4000000U) -#define USBPHY_USB1_VBUS_DETECT_CLR_DISCHARGE_VBUS_SHIFT (26U) -/*! DISCHARGE_VBUS - VBUS Discharge Resistor */ -#define USBPHY_USB1_VBUS_DETECT_CLR_DISCHARGE_VBUS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_DISCHARGE_VBUS_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_DISCHARGE_VBUS_MASK) -/*! @} */ - -/*! @name USB1_VBUS_DETECT_TOG - VBUS Detect */ -/*! @{ */ - -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_THRESH_MASK (0x7U) -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_THRESH_SHIFT (0U) -/*! VBUSVALID_THRESH - VBUS Comparator Threshold */ -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_THRESH(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_THRESH_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_THRESH_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUS_OVERRIDE_EN_MASK (0x8U) -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUS_OVERRIDE_EN_SHIFT (3U) -/*! VBUS_OVERRIDE_EN - VBUS Detect Signal Local Override Enable */ -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUS_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_VBUS_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_VBUS_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_SESSEND_OVERRIDE_MASK (0x10U) -#define USBPHY_USB1_VBUS_DETECT_TOG_SESSEND_OVERRIDE_SHIFT (4U) -/*! SESSEND_OVERRIDE - Override Value for SESSEND */ -#define USBPHY_USB1_VBUS_DETECT_TOG_SESSEND_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_SESSEND_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_SESSEND_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_BVALID_OVERRIDE_MASK (0x20U) -#define USBPHY_USB1_VBUS_DETECT_TOG_BVALID_OVERRIDE_SHIFT (5U) -/*! BVALID_OVERRIDE - Override Value for B-Device Session Valid */ -#define USBPHY_USB1_VBUS_DETECT_TOG_BVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_BVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_BVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_AVALID_OVERRIDE_MASK (0x40U) -#define USBPHY_USB1_VBUS_DETECT_TOG_AVALID_OVERRIDE_SHIFT (6U) -/*! AVALID_OVERRIDE - Override Value for A-Device Session Valid */ -#define USBPHY_USB1_VBUS_DETECT_TOG_AVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_AVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_AVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_OVERRIDE_MASK (0x80U) -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_OVERRIDE_SHIFT (7U) -/*! VBUSVALID_OVERRIDE - Override Value for the VBUS_VALID Signal */ -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_SEL_MASK (0x100U) -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_SEL_SHIFT (8U) -/*! VBUSVALID_SEL - VBUS_VALID Selection */ -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_SEL_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_SEL_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUS_SOURCE_SEL_MASK (0x600U) -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUS_SOURCE_SEL_SHIFT (9U) -/*! VBUS_SOURCE_SEL - VBUS_VALID Source Selection */ -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUS_SOURCE_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_VBUS_SOURCE_SEL_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_VBUS_SOURCE_SEL_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_ID_OVERRIDE_EN_MASK (0x800U) -#define USBPHY_USB1_VBUS_DETECT_TOG_ID_OVERRIDE_EN_SHIFT (11U) -/*! ID_OVERRIDE_EN - Enable Local ID Pin Status Override */ -#define USBPHY_USB1_VBUS_DETECT_TOG_ID_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_ID_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_ID_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_ID_OVERRIDE_MASK (0x1000U) -#define USBPHY_USB1_VBUS_DETECT_TOG_ID_OVERRIDE_SHIFT (12U) -/*! ID_OVERRIDE - ID Pin Status Local Override */ -#define USBPHY_USB1_VBUS_DETECT_TOG_ID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_ID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_ID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_EXT_ID_OVERRIDE_EN_MASK (0x2000U) -#define USBPHY_USB1_VBUS_DETECT_TOG_EXT_ID_OVERRIDE_EN_SHIFT (13U) -/*! EXT_ID_OVERRIDE_EN - External ID Override Enable */ -#define USBPHY_USB1_VBUS_DETECT_TOG_EXT_ID_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_EXT_ID_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_EXT_ID_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_EXT_VBUS_OVERRIDE_EN_MASK (0x4000U) -#define USBPHY_USB1_VBUS_DETECT_TOG_EXT_VBUS_OVERRIDE_EN_SHIFT (14U) -/*! EXT_VBUS_OVERRIDE_EN - External VBUS Override Enable */ -#define USBPHY_USB1_VBUS_DETECT_TOG_EXT_VBUS_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_EXT_VBUS_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_EXT_VBUS_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_TO_B_MASK (0x40000U) -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_TO_B_SHIFT (18U) -/*! VBUSVALID_TO_B - VBUS_VALID Comparator Selection */ -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_TO_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_TO_B_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_TO_B_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_PWRUP_CMPS_MASK (0x700000U) -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_PWRUP_CMPS_SHIFT (20U) -/*! VBUSVALID_PWRUP_CMPS - VBUS_VALID Comparator Enable */ -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_PWRUP_CMPS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_PWRUP_CMPS_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_PWRUP_CMPS_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_DISCHARGE_VBUS_MASK (0x4000000U) -#define USBPHY_USB1_VBUS_DETECT_TOG_DISCHARGE_VBUS_SHIFT (26U) -/*! DISCHARGE_VBUS - VBUS Discharge Resistor */ -#define USBPHY_USB1_VBUS_DETECT_TOG_DISCHARGE_VBUS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_DISCHARGE_VBUS_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_DISCHARGE_VBUS_MASK) -/*! @} */ - -/*! @name USB1_VBUS_DET_STAT - VBUS Detect Status */ -/*! @{ */ - -#define USBPHY_USB1_VBUS_DET_STAT_SESSEND_MASK (0x1U) -#define USBPHY_USB1_VBUS_DET_STAT_SESSEND_SHIFT (0U) -/*! SESSEND - Session End Indicator - * 0b0..Above threshold - * 0b1..Below threshold - */ -#define USBPHY_USB1_VBUS_DET_STAT_SESSEND(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_SESSEND_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_SESSEND_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_BVALID_MASK (0x2U) -#define USBPHY_USB1_VBUS_DET_STAT_BVALID_SHIFT (1U) -/*! BVALID - B-Device Session Valid Status - * 0b0..Below threshold - * 0b1..Above threshold - */ -#define USBPHY_USB1_VBUS_DET_STAT_BVALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_BVALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_BVALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_AVALID_MASK (0x4U) -#define USBPHY_USB1_VBUS_DET_STAT_AVALID_SHIFT (2U) -/*! AVALID - A-Device Session Valid Status - * 0b0..Below threshold - * 0b1..Above threshold - */ -#define USBPHY_USB1_VBUS_DET_STAT_AVALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_AVALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_AVALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID_MASK (0x8U) -#define USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID_SHIFT (3U) -/*! VBUS_VALID - VBUS Voltage Status - * 0b0..Below threshold - * 0b1..Above threshold - */ -#define USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID_3V_MASK (0x10U) -#define USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID_3V_SHIFT (4U) -/*! VBUS_VALID_3V - VBUS_VALID_3V Detector Status - * 0b0..Below threshold - * 0b1..Above threshold - */ -#define USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID_3V(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID_3V_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID_3V_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_EXT_ID_MASK (0x20U) -#define USBPHY_USB1_VBUS_DET_STAT_EXT_ID_SHIFT (5U) -/*! EXT_ID - OTG ID External Override Status */ -#define USBPHY_USB1_VBUS_DET_STAT_EXT_ID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_EXT_ID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_EXT_ID_MASK) -/*! @} */ - -/*! @name USB1_VBUS_DET_STAT_SET - VBUS Detect Status */ -/*! @{ */ - -#define USBPHY_USB1_VBUS_DET_STAT_SET_SESSEND_MASK (0x1U) -#define USBPHY_USB1_VBUS_DET_STAT_SET_SESSEND_SHIFT (0U) -/*! SESSEND - Session End Indicator */ -#define USBPHY_USB1_VBUS_DET_STAT_SET_SESSEND(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_SET_SESSEND_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_SET_SESSEND_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_SET_BVALID_MASK (0x2U) -#define USBPHY_USB1_VBUS_DET_STAT_SET_BVALID_SHIFT (1U) -/*! BVALID - B-Device Session Valid Status */ -#define USBPHY_USB1_VBUS_DET_STAT_SET_BVALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_SET_BVALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_SET_BVALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_SET_AVALID_MASK (0x4U) -#define USBPHY_USB1_VBUS_DET_STAT_SET_AVALID_SHIFT (2U) -/*! AVALID - A-Device Session Valid Status */ -#define USBPHY_USB1_VBUS_DET_STAT_SET_AVALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_SET_AVALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_SET_AVALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_SET_VBUS_VALID_MASK (0x8U) -#define USBPHY_USB1_VBUS_DET_STAT_SET_VBUS_VALID_SHIFT (3U) -/*! VBUS_VALID - VBUS Voltage Status */ -#define USBPHY_USB1_VBUS_DET_STAT_SET_VBUS_VALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_SET_VBUS_VALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_SET_VBUS_VALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_SET_VBUS_VALID_3V_MASK (0x10U) -#define USBPHY_USB1_VBUS_DET_STAT_SET_VBUS_VALID_3V_SHIFT (4U) -/*! VBUS_VALID_3V - VBUS_VALID_3V Detector Status */ -#define USBPHY_USB1_VBUS_DET_STAT_SET_VBUS_VALID_3V(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_SET_VBUS_VALID_3V_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_SET_VBUS_VALID_3V_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_SET_EXT_ID_MASK (0x20U) -#define USBPHY_USB1_VBUS_DET_STAT_SET_EXT_ID_SHIFT (5U) -/*! EXT_ID - OTG ID External Override Status */ -#define USBPHY_USB1_VBUS_DET_STAT_SET_EXT_ID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_SET_EXT_ID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_SET_EXT_ID_MASK) -/*! @} */ - -/*! @name USB1_VBUS_DET_STAT_CLR - VBUS Detect Status */ -/*! @{ */ - -#define USBPHY_USB1_VBUS_DET_STAT_CLR_SESSEND_MASK (0x1U) -#define USBPHY_USB1_VBUS_DET_STAT_CLR_SESSEND_SHIFT (0U) -/*! SESSEND - Session End Indicator */ -#define USBPHY_USB1_VBUS_DET_STAT_CLR_SESSEND(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_CLR_SESSEND_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_CLR_SESSEND_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_CLR_BVALID_MASK (0x2U) -#define USBPHY_USB1_VBUS_DET_STAT_CLR_BVALID_SHIFT (1U) -/*! BVALID - B-Device Session Valid Status */ -#define USBPHY_USB1_VBUS_DET_STAT_CLR_BVALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_CLR_BVALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_CLR_BVALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_CLR_AVALID_MASK (0x4U) -#define USBPHY_USB1_VBUS_DET_STAT_CLR_AVALID_SHIFT (2U) -/*! AVALID - A-Device Session Valid Status */ -#define USBPHY_USB1_VBUS_DET_STAT_CLR_AVALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_CLR_AVALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_CLR_AVALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_CLR_VBUS_VALID_MASK (0x8U) -#define USBPHY_USB1_VBUS_DET_STAT_CLR_VBUS_VALID_SHIFT (3U) -/*! VBUS_VALID - VBUS Voltage Status */ -#define USBPHY_USB1_VBUS_DET_STAT_CLR_VBUS_VALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_CLR_VBUS_VALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_CLR_VBUS_VALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_CLR_VBUS_VALID_3V_MASK (0x10U) -#define USBPHY_USB1_VBUS_DET_STAT_CLR_VBUS_VALID_3V_SHIFT (4U) -/*! VBUS_VALID_3V - VBUS_VALID_3V Detector Status */ -#define USBPHY_USB1_VBUS_DET_STAT_CLR_VBUS_VALID_3V(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_CLR_VBUS_VALID_3V_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_CLR_VBUS_VALID_3V_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_CLR_EXT_ID_MASK (0x20U) -#define USBPHY_USB1_VBUS_DET_STAT_CLR_EXT_ID_SHIFT (5U) -/*! EXT_ID - OTG ID External Override Status */ -#define USBPHY_USB1_VBUS_DET_STAT_CLR_EXT_ID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_CLR_EXT_ID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_CLR_EXT_ID_MASK) -/*! @} */ - -/*! @name USB1_VBUS_DET_STAT_TOG - VBUS Detect Status */ -/*! @{ */ - -#define USBPHY_USB1_VBUS_DET_STAT_TOG_SESSEND_MASK (0x1U) -#define USBPHY_USB1_VBUS_DET_STAT_TOG_SESSEND_SHIFT (0U) -/*! SESSEND - Session End Indicator */ -#define USBPHY_USB1_VBUS_DET_STAT_TOG_SESSEND(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_TOG_SESSEND_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_TOG_SESSEND_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_TOG_BVALID_MASK (0x2U) -#define USBPHY_USB1_VBUS_DET_STAT_TOG_BVALID_SHIFT (1U) -/*! BVALID - B-Device Session Valid Status */ -#define USBPHY_USB1_VBUS_DET_STAT_TOG_BVALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_TOG_BVALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_TOG_BVALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_TOG_AVALID_MASK (0x4U) -#define USBPHY_USB1_VBUS_DET_STAT_TOG_AVALID_SHIFT (2U) -/*! AVALID - A-Device Session Valid Status */ -#define USBPHY_USB1_VBUS_DET_STAT_TOG_AVALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_TOG_AVALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_TOG_AVALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_TOG_VBUS_VALID_MASK (0x8U) -#define USBPHY_USB1_VBUS_DET_STAT_TOG_VBUS_VALID_SHIFT (3U) -/*! VBUS_VALID - VBUS Voltage Status */ -#define USBPHY_USB1_VBUS_DET_STAT_TOG_VBUS_VALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_TOG_VBUS_VALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_TOG_VBUS_VALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_TOG_VBUS_VALID_3V_MASK (0x10U) -#define USBPHY_USB1_VBUS_DET_STAT_TOG_VBUS_VALID_3V_SHIFT (4U) -/*! VBUS_VALID_3V - VBUS_VALID_3V Detector Status */ -#define USBPHY_USB1_VBUS_DET_STAT_TOG_VBUS_VALID_3V(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_TOG_VBUS_VALID_3V_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_TOG_VBUS_VALID_3V_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_TOG_EXT_ID_MASK (0x20U) -#define USBPHY_USB1_VBUS_DET_STAT_TOG_EXT_ID_SHIFT (5U) -/*! EXT_ID - OTG ID External Override Status */ -#define USBPHY_USB1_VBUS_DET_STAT_TOG_EXT_ID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_TOG_EXT_ID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_TOG_EXT_ID_MASK) -/*! @} */ - -/*! @name USB1_CHRG_DETECT - Charger Detect */ -/*! @{ */ - -#define USBPHY_USB1_CHRG_DETECT_DETECT_SEC_MASK (0x2U) -#define USBPHY_USB1_CHRG_DETECT_DETECT_SEC_SHIFT (1U) -/*! DETECT_SEC - Secondary Detection Function Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_USB1_CHRG_DETECT_DETECT_SEC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_DETECT_SEC_SHIFT)) & USBPHY_USB1_CHRG_DETECT_DETECT_SEC_MASK) - -#define USBPHY_USB1_CHRG_DETECT_PULLUP_DP_MASK (0x4U) -#define USBPHY_USB1_CHRG_DETECT_PULLUP_DP_SHIFT (2U) -/*! PULLUP_DP - DP Pullup Resistor Enable Override Control - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_USB1_CHRG_DETECT_PULLUP_DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_PULLUP_DP_SHIFT)) & USBPHY_USB1_CHRG_DETECT_PULLUP_DP_MASK) - -#define USBPHY_USB1_CHRG_DETECT_VDM_SRC_ENABLE_MASK (0x10U) -#define USBPHY_USB1_CHRG_DETECT_VDM_SRC_ENABLE_SHIFT (4U) -/*! VDM_SRC_ENABLE - VDM_SRC Function Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_USB1_CHRG_DETECT_VDM_SRC_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_VDM_SRC_ENABLE_SHIFT)) & USBPHY_USB1_CHRG_DETECT_VDM_SRC_ENABLE_MASK) - -#define USBPHY_USB1_CHRG_DETECT_CHK_CONTACT_MASK (0x40000U) -#define USBPHY_USB1_CHRG_DETECT_CHK_CONTACT_SHIFT (18U) -/*! CHK_CONTACT - BC Data Contact Detect Function Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_USB1_CHRG_DETECT_CHK_CONTACT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_CHK_CONTACT_SHIFT)) & USBPHY_USB1_CHRG_DETECT_CHK_CONTACT_MASK) - -#define USBPHY_USB1_CHRG_DETECT_CHK_CHRG_B_MASK (0x80000U) -#define USBPHY_USB1_CHRG_DETECT_CHK_CHRG_B_SHIFT (19U) -/*! CHK_CHRG_B - BC Charger Detection Function Enable - * 0b0..Enable - * 0b1..Disable - */ -#define USBPHY_USB1_CHRG_DETECT_CHK_CHRG_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_CHK_CHRG_B_SHIFT)) & USBPHY_USB1_CHRG_DETECT_CHK_CHRG_B_MASK) - -#define USBPHY_USB1_CHRG_DETECT_EN_B_MASK (0x100000U) -#define USBPHY_USB1_CHRG_DETECT_EN_B_SHIFT (20U) -/*! EN_B - Selection of BC v1.2 Function Enable - * 0b0..Enable - * 0b1..Disable - */ -#define USBPHY_USB1_CHRG_DETECT_EN_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_EN_B_SHIFT)) & USBPHY_USB1_CHRG_DETECT_EN_B_MASK) - -#define USBPHY_USB1_CHRG_DETECT_DCDSEL_MASK (0x80000000U) -#define USBPHY_USB1_CHRG_DETECT_DCDSEL_SHIFT (31U) -/*! DCDSEL - DCD Selection - * 0b0..Fields in USB1_CHRG_DETECT - * 0b1..Fields and state machines in the USBHSDCD module - */ -#define USBPHY_USB1_CHRG_DETECT_DCDSEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_DCDSEL_SHIFT)) & USBPHY_USB1_CHRG_DETECT_DCDSEL_MASK) -/*! @} */ - -/*! @name USB1_CHRG_DETECT_SET - Charger Detect */ -/*! @{ */ - -#define USBPHY_USB1_CHRG_DETECT_SET_DETECT_SEC_MASK (0x2U) -#define USBPHY_USB1_CHRG_DETECT_SET_DETECT_SEC_SHIFT (1U) -/*! DETECT_SEC - Secondary Detection Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_SET_DETECT_SEC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_SET_DETECT_SEC_SHIFT)) & USBPHY_USB1_CHRG_DETECT_SET_DETECT_SEC_MASK) - -#define USBPHY_USB1_CHRG_DETECT_SET_PULLUP_DP_MASK (0x4U) -#define USBPHY_USB1_CHRG_DETECT_SET_PULLUP_DP_SHIFT (2U) -/*! PULLUP_DP - DP Pullup Resistor Enable Override Control */ -#define USBPHY_USB1_CHRG_DETECT_SET_PULLUP_DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_SET_PULLUP_DP_SHIFT)) & USBPHY_USB1_CHRG_DETECT_SET_PULLUP_DP_MASK) - -#define USBPHY_USB1_CHRG_DETECT_SET_VDM_SRC_ENABLE_MASK (0x10U) -#define USBPHY_USB1_CHRG_DETECT_SET_VDM_SRC_ENABLE_SHIFT (4U) -/*! VDM_SRC_ENABLE - VDM_SRC Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_SET_VDM_SRC_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_SET_VDM_SRC_ENABLE_SHIFT)) & USBPHY_USB1_CHRG_DETECT_SET_VDM_SRC_ENABLE_MASK) - -#define USBPHY_USB1_CHRG_DETECT_SET_CHK_CONTACT_MASK (0x40000U) -#define USBPHY_USB1_CHRG_DETECT_SET_CHK_CONTACT_SHIFT (18U) -/*! CHK_CONTACT - BC Data Contact Detect Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_SET_CHK_CONTACT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_SET_CHK_CONTACT_SHIFT)) & USBPHY_USB1_CHRG_DETECT_SET_CHK_CONTACT_MASK) - -#define USBPHY_USB1_CHRG_DETECT_SET_CHK_CHRG_B_MASK (0x80000U) -#define USBPHY_USB1_CHRG_DETECT_SET_CHK_CHRG_B_SHIFT (19U) -/*! CHK_CHRG_B - BC Charger Detection Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_SET_CHK_CHRG_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_SET_CHK_CHRG_B_SHIFT)) & USBPHY_USB1_CHRG_DETECT_SET_CHK_CHRG_B_MASK) - -#define USBPHY_USB1_CHRG_DETECT_SET_EN_B_MASK (0x100000U) -#define USBPHY_USB1_CHRG_DETECT_SET_EN_B_SHIFT (20U) -/*! EN_B - Selection of BC v1.2 Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_SET_EN_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_SET_EN_B_SHIFT)) & USBPHY_USB1_CHRG_DETECT_SET_EN_B_MASK) - -#define USBPHY_USB1_CHRG_DETECT_SET_DCDSEL_MASK (0x80000000U) -#define USBPHY_USB1_CHRG_DETECT_SET_DCDSEL_SHIFT (31U) -/*! DCDSEL - DCD Selection */ -#define USBPHY_USB1_CHRG_DETECT_SET_DCDSEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_SET_DCDSEL_SHIFT)) & USBPHY_USB1_CHRG_DETECT_SET_DCDSEL_MASK) -/*! @} */ - -/*! @name USB1_CHRG_DETECT_CLR - Charger Detect */ -/*! @{ */ - -#define USBPHY_USB1_CHRG_DETECT_CLR_DETECT_SEC_MASK (0x2U) -#define USBPHY_USB1_CHRG_DETECT_CLR_DETECT_SEC_SHIFT (1U) -/*! DETECT_SEC - Secondary Detection Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_CLR_DETECT_SEC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_CLR_DETECT_SEC_SHIFT)) & USBPHY_USB1_CHRG_DETECT_CLR_DETECT_SEC_MASK) - -#define USBPHY_USB1_CHRG_DETECT_CLR_PULLUP_DP_MASK (0x4U) -#define USBPHY_USB1_CHRG_DETECT_CLR_PULLUP_DP_SHIFT (2U) -/*! PULLUP_DP - DP Pullup Resistor Enable Override Control */ -#define USBPHY_USB1_CHRG_DETECT_CLR_PULLUP_DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_CLR_PULLUP_DP_SHIFT)) & USBPHY_USB1_CHRG_DETECT_CLR_PULLUP_DP_MASK) - -#define USBPHY_USB1_CHRG_DETECT_CLR_VDM_SRC_ENABLE_MASK (0x10U) -#define USBPHY_USB1_CHRG_DETECT_CLR_VDM_SRC_ENABLE_SHIFT (4U) -/*! VDM_SRC_ENABLE - VDM_SRC Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_CLR_VDM_SRC_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_CLR_VDM_SRC_ENABLE_SHIFT)) & USBPHY_USB1_CHRG_DETECT_CLR_VDM_SRC_ENABLE_MASK) - -#define USBPHY_USB1_CHRG_DETECT_CLR_CHK_CONTACT_MASK (0x40000U) -#define USBPHY_USB1_CHRG_DETECT_CLR_CHK_CONTACT_SHIFT (18U) -/*! CHK_CONTACT - BC Data Contact Detect Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_CLR_CHK_CONTACT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_CLR_CHK_CONTACT_SHIFT)) & USBPHY_USB1_CHRG_DETECT_CLR_CHK_CONTACT_MASK) - -#define USBPHY_USB1_CHRG_DETECT_CLR_CHK_CHRG_B_MASK (0x80000U) -#define USBPHY_USB1_CHRG_DETECT_CLR_CHK_CHRG_B_SHIFT (19U) -/*! CHK_CHRG_B - BC Charger Detection Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_CLR_CHK_CHRG_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_CLR_CHK_CHRG_B_SHIFT)) & USBPHY_USB1_CHRG_DETECT_CLR_CHK_CHRG_B_MASK) - -#define USBPHY_USB1_CHRG_DETECT_CLR_EN_B_MASK (0x100000U) -#define USBPHY_USB1_CHRG_DETECT_CLR_EN_B_SHIFT (20U) -/*! EN_B - Selection of BC v1.2 Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_CLR_EN_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_CLR_EN_B_SHIFT)) & USBPHY_USB1_CHRG_DETECT_CLR_EN_B_MASK) - -#define USBPHY_USB1_CHRG_DETECT_CLR_DCDSEL_MASK (0x80000000U) -#define USBPHY_USB1_CHRG_DETECT_CLR_DCDSEL_SHIFT (31U) -/*! DCDSEL - DCD Selection */ -#define USBPHY_USB1_CHRG_DETECT_CLR_DCDSEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_CLR_DCDSEL_SHIFT)) & USBPHY_USB1_CHRG_DETECT_CLR_DCDSEL_MASK) -/*! @} */ - -/*! @name USB1_CHRG_DETECT_TOG - Charger Detect */ -/*! @{ */ - -#define USBPHY_USB1_CHRG_DETECT_TOG_DETECT_SEC_MASK (0x2U) -#define USBPHY_USB1_CHRG_DETECT_TOG_DETECT_SEC_SHIFT (1U) -/*! DETECT_SEC - Secondary Detection Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_TOG_DETECT_SEC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_TOG_DETECT_SEC_SHIFT)) & USBPHY_USB1_CHRG_DETECT_TOG_DETECT_SEC_MASK) - -#define USBPHY_USB1_CHRG_DETECT_TOG_PULLUP_DP_MASK (0x4U) -#define USBPHY_USB1_CHRG_DETECT_TOG_PULLUP_DP_SHIFT (2U) -/*! PULLUP_DP - DP Pullup Resistor Enable Override Control */ -#define USBPHY_USB1_CHRG_DETECT_TOG_PULLUP_DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_TOG_PULLUP_DP_SHIFT)) & USBPHY_USB1_CHRG_DETECT_TOG_PULLUP_DP_MASK) - -#define USBPHY_USB1_CHRG_DETECT_TOG_VDM_SRC_ENABLE_MASK (0x10U) -#define USBPHY_USB1_CHRG_DETECT_TOG_VDM_SRC_ENABLE_SHIFT (4U) -/*! VDM_SRC_ENABLE - VDM_SRC Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_TOG_VDM_SRC_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_TOG_VDM_SRC_ENABLE_SHIFT)) & USBPHY_USB1_CHRG_DETECT_TOG_VDM_SRC_ENABLE_MASK) - -#define USBPHY_USB1_CHRG_DETECT_TOG_CHK_CONTACT_MASK (0x40000U) -#define USBPHY_USB1_CHRG_DETECT_TOG_CHK_CONTACT_SHIFT (18U) -/*! CHK_CONTACT - BC Data Contact Detect Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_TOG_CHK_CONTACT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_TOG_CHK_CONTACT_SHIFT)) & USBPHY_USB1_CHRG_DETECT_TOG_CHK_CONTACT_MASK) - -#define USBPHY_USB1_CHRG_DETECT_TOG_CHK_CHRG_B_MASK (0x80000U) -#define USBPHY_USB1_CHRG_DETECT_TOG_CHK_CHRG_B_SHIFT (19U) -/*! CHK_CHRG_B - BC Charger Detection Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_TOG_CHK_CHRG_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_TOG_CHK_CHRG_B_SHIFT)) & USBPHY_USB1_CHRG_DETECT_TOG_CHK_CHRG_B_MASK) - -#define USBPHY_USB1_CHRG_DETECT_TOG_EN_B_MASK (0x100000U) -#define USBPHY_USB1_CHRG_DETECT_TOG_EN_B_SHIFT (20U) -/*! EN_B - Selection of BC v1.2 Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_TOG_EN_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_TOG_EN_B_SHIFT)) & USBPHY_USB1_CHRG_DETECT_TOG_EN_B_MASK) - -#define USBPHY_USB1_CHRG_DETECT_TOG_DCDSEL_MASK (0x80000000U) -#define USBPHY_USB1_CHRG_DETECT_TOG_DCDSEL_SHIFT (31U) -/*! DCDSEL - DCD Selection */ -#define USBPHY_USB1_CHRG_DETECT_TOG_DCDSEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_TOG_DCDSEL_SHIFT)) & USBPHY_USB1_CHRG_DETECT_TOG_DCDSEL_MASK) -/*! @} */ - -/*! @name USB1_CHRG_DET_STAT - Charger Detect Status */ -/*! @{ */ - -#define USBPHY_USB1_CHRG_DET_STAT_PLUG_CONTACT_MASK (0x1U) -#define USBPHY_USB1_CHRG_DET_STAT_PLUG_CONTACT_SHIFT (0U) -/*! PLUG_CONTACT - Battery Charging Data Contact Detection Phase Output - * 0b0..Not detected - * 0b1..Detected - */ -#define USBPHY_USB1_CHRG_DET_STAT_PLUG_CONTACT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_PLUG_CONTACT_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_PLUG_CONTACT_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_CHRG_DETECTED_MASK (0x2U) -#define USBPHY_USB1_CHRG_DET_STAT_CHRG_DETECTED_SHIFT (1U) -/*! CHRG_DETECTED - Battery Charging Primary Detection Phase Output - * 0b0..SDP detected - * 0b1..Charging port detected - */ -#define USBPHY_USB1_CHRG_DET_STAT_CHRG_DETECTED(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_CHRG_DETECTED_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_CHRG_DETECTED_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_DM_STATE_MASK (0x4U) -#define USBPHY_USB1_CHRG_DET_STAT_DM_STATE_SHIFT (2U) -/*! DM_STATE - DM Voltage - * 0b0..USB_DM pin voltage is <= 0.8 V - * 0b1..USB_DM pin voltage is >= 2.0 V - */ -#define USBPHY_USB1_CHRG_DET_STAT_DM_STATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_DM_STATE_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_DM_STATE_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_DP_STATE_MASK (0x8U) -#define USBPHY_USB1_CHRG_DET_STAT_DP_STATE_SHIFT (3U) -/*! DP_STATE - DP Voltage - * 0b0..USB_DP pin voltage is <= 0.8 V - * 0b1..USB_DP pin voltage is >= 2.0 V - */ -#define USBPHY_USB1_CHRG_DET_STAT_DP_STATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_DP_STATE_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_DP_STATE_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_SECDET_DCP_MASK (0x10U) -#define USBPHY_USB1_CHRG_DET_STAT_SECDET_DCP_SHIFT (4U) -/*! SECDET_DCP - Battery Charging Secondary Detection Phase Output - * 0b0..CDP detected - * 0b1..DCP detected - */ -#define USBPHY_USB1_CHRG_DET_STAT_SECDET_DCP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_SECDET_DCP_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_SECDET_DCP_MASK) -/*! @} */ - -/*! @name USB1_CHRG_DET_STAT_SET - Charger Detect Status */ -/*! @{ */ - -#define USBPHY_USB1_CHRG_DET_STAT_SET_PLUG_CONTACT_MASK (0x1U) -#define USBPHY_USB1_CHRG_DET_STAT_SET_PLUG_CONTACT_SHIFT (0U) -/*! PLUG_CONTACT - Battery Charging Data Contact Detection Phase Output */ -#define USBPHY_USB1_CHRG_DET_STAT_SET_PLUG_CONTACT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_SET_PLUG_CONTACT_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_SET_PLUG_CONTACT_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_SET_CHRG_DETECTED_MASK (0x2U) -#define USBPHY_USB1_CHRG_DET_STAT_SET_CHRG_DETECTED_SHIFT (1U) -/*! CHRG_DETECTED - Battery Charging Primary Detection Phase Output */ -#define USBPHY_USB1_CHRG_DET_STAT_SET_CHRG_DETECTED(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_SET_CHRG_DETECTED_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_SET_CHRG_DETECTED_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_SET_DM_STATE_MASK (0x4U) -#define USBPHY_USB1_CHRG_DET_STAT_SET_DM_STATE_SHIFT (2U) -/*! DM_STATE - DM Voltage */ -#define USBPHY_USB1_CHRG_DET_STAT_SET_DM_STATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_SET_DM_STATE_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_SET_DM_STATE_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_SET_DP_STATE_MASK (0x8U) -#define USBPHY_USB1_CHRG_DET_STAT_SET_DP_STATE_SHIFT (3U) -/*! DP_STATE - DP Voltage */ -#define USBPHY_USB1_CHRG_DET_STAT_SET_DP_STATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_SET_DP_STATE_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_SET_DP_STATE_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_SET_SECDET_DCP_MASK (0x10U) -#define USBPHY_USB1_CHRG_DET_STAT_SET_SECDET_DCP_SHIFT (4U) -/*! SECDET_DCP - Battery Charging Secondary Detection Phase Output */ -#define USBPHY_USB1_CHRG_DET_STAT_SET_SECDET_DCP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_SET_SECDET_DCP_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_SET_SECDET_DCP_MASK) -/*! @} */ - -/*! @name USB1_CHRG_DET_STAT_CLR - Charger Detect Status */ -/*! @{ */ - -#define USBPHY_USB1_CHRG_DET_STAT_CLR_PLUG_CONTACT_MASK (0x1U) -#define USBPHY_USB1_CHRG_DET_STAT_CLR_PLUG_CONTACT_SHIFT (0U) -/*! PLUG_CONTACT - Battery Charging Data Contact Detection Phase Output */ -#define USBPHY_USB1_CHRG_DET_STAT_CLR_PLUG_CONTACT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_CLR_PLUG_CONTACT_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_CLR_PLUG_CONTACT_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_CLR_CHRG_DETECTED_MASK (0x2U) -#define USBPHY_USB1_CHRG_DET_STAT_CLR_CHRG_DETECTED_SHIFT (1U) -/*! CHRG_DETECTED - Battery Charging Primary Detection Phase Output */ -#define USBPHY_USB1_CHRG_DET_STAT_CLR_CHRG_DETECTED(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_CLR_CHRG_DETECTED_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_CLR_CHRG_DETECTED_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_CLR_DM_STATE_MASK (0x4U) -#define USBPHY_USB1_CHRG_DET_STAT_CLR_DM_STATE_SHIFT (2U) -/*! DM_STATE - DM Voltage */ -#define USBPHY_USB1_CHRG_DET_STAT_CLR_DM_STATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_CLR_DM_STATE_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_CLR_DM_STATE_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_CLR_DP_STATE_MASK (0x8U) -#define USBPHY_USB1_CHRG_DET_STAT_CLR_DP_STATE_SHIFT (3U) -/*! DP_STATE - DP Voltage */ -#define USBPHY_USB1_CHRG_DET_STAT_CLR_DP_STATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_CLR_DP_STATE_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_CLR_DP_STATE_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_CLR_SECDET_DCP_MASK (0x10U) -#define USBPHY_USB1_CHRG_DET_STAT_CLR_SECDET_DCP_SHIFT (4U) -/*! SECDET_DCP - Battery Charging Secondary Detection Phase Output */ -#define USBPHY_USB1_CHRG_DET_STAT_CLR_SECDET_DCP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_CLR_SECDET_DCP_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_CLR_SECDET_DCP_MASK) -/*! @} */ - -/*! @name USB1_CHRG_DET_STAT_TOG - Charger Detect Status */ -/*! @{ */ - -#define USBPHY_USB1_CHRG_DET_STAT_TOG_PLUG_CONTACT_MASK (0x1U) -#define USBPHY_USB1_CHRG_DET_STAT_TOG_PLUG_CONTACT_SHIFT (0U) -/*! PLUG_CONTACT - Battery Charging Data Contact Detection Phase Output */ -#define USBPHY_USB1_CHRG_DET_STAT_TOG_PLUG_CONTACT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_TOG_PLUG_CONTACT_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_TOG_PLUG_CONTACT_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_TOG_CHRG_DETECTED_MASK (0x2U) -#define USBPHY_USB1_CHRG_DET_STAT_TOG_CHRG_DETECTED_SHIFT (1U) -/*! CHRG_DETECTED - Battery Charging Primary Detection Phase Output */ -#define USBPHY_USB1_CHRG_DET_STAT_TOG_CHRG_DETECTED(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_TOG_CHRG_DETECTED_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_TOG_CHRG_DETECTED_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_TOG_DM_STATE_MASK (0x4U) -#define USBPHY_USB1_CHRG_DET_STAT_TOG_DM_STATE_SHIFT (2U) -/*! DM_STATE - DM Voltage */ -#define USBPHY_USB1_CHRG_DET_STAT_TOG_DM_STATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_TOG_DM_STATE_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_TOG_DM_STATE_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_TOG_DP_STATE_MASK (0x8U) -#define USBPHY_USB1_CHRG_DET_STAT_TOG_DP_STATE_SHIFT (3U) -/*! DP_STATE - DP Voltage */ -#define USBPHY_USB1_CHRG_DET_STAT_TOG_DP_STATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_TOG_DP_STATE_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_TOG_DP_STATE_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_TOG_SECDET_DCP_MASK (0x10U) -#define USBPHY_USB1_CHRG_DET_STAT_TOG_SECDET_DCP_SHIFT (4U) -/*! SECDET_DCP - Battery Charging Secondary Detection Phase Output */ -#define USBPHY_USB1_CHRG_DET_STAT_TOG_SECDET_DCP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_TOG_SECDET_DCP_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_TOG_SECDET_DCP_MASK) -/*! @} */ - -/*! @name ANACTRL - Analog Control */ -/*! @{ */ - -#define USBPHY_ANACTRL_LVI_EN_MASK (0x2U) -#define USBPHY_ANACTRL_LVI_EN_SHIFT (1U) -/*! LVI_EN - Internal Low Voltage Detector Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_ANACTRL_LVI_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_LVI_EN_SHIFT)) & USBPHY_ANACTRL_LVI_EN_MASK) - -#define USBPHY_ANACTRL_PFD_CLK_SEL_MASK (0xCU) -#define USBPHY_ANACTRL_PFD_CLK_SEL_SHIFT (2U) -/*! PFD_CLK_SEL - PFD Clock Selection - * 0b00..USB1PFDCLK = USB PLL reference clock - * 0b01..USB1PFDCLK = pfd_clk / 4 - * 0b10..USB1PFDCLK frequency = pfd_clk / 2 - * 0b11..USB1PFDCLK = pfd_clk - */ -#define USBPHY_ANACTRL_PFD_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_PFD_CLK_SEL_SHIFT)) & USBPHY_ANACTRL_PFD_CLK_SEL_MASK) - -#define USBPHY_ANACTRL_DEV_PULLDOWN_MASK (0x400U) -#define USBPHY_ANACTRL_DEV_PULLDOWN_SHIFT (10U) -/*! DEV_PULLDOWN - Device Pulldown Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_ANACTRL_DEV_PULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_DEV_PULLDOWN_SHIFT)) & USBPHY_ANACTRL_DEV_PULLDOWN_MASK) -/*! @} */ - -/*! @name ANACTRL_SET - Analog Control */ -/*! @{ */ - -#define USBPHY_ANACTRL_SET_LVI_EN_MASK (0x2U) -#define USBPHY_ANACTRL_SET_LVI_EN_SHIFT (1U) -/*! LVI_EN - Internal Low Voltage Detector Enable */ -#define USBPHY_ANACTRL_SET_LVI_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_SET_LVI_EN_SHIFT)) & USBPHY_ANACTRL_SET_LVI_EN_MASK) - -#define USBPHY_ANACTRL_SET_PFD_CLK_SEL_MASK (0xCU) -#define USBPHY_ANACTRL_SET_PFD_CLK_SEL_SHIFT (2U) -/*! PFD_CLK_SEL - PFD Clock Selection */ -#define USBPHY_ANACTRL_SET_PFD_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_SET_PFD_CLK_SEL_SHIFT)) & USBPHY_ANACTRL_SET_PFD_CLK_SEL_MASK) - -#define USBPHY_ANACTRL_SET_DEV_PULLDOWN_MASK (0x400U) -#define USBPHY_ANACTRL_SET_DEV_PULLDOWN_SHIFT (10U) -/*! DEV_PULLDOWN - Device Pulldown Enable */ -#define USBPHY_ANACTRL_SET_DEV_PULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_SET_DEV_PULLDOWN_SHIFT)) & USBPHY_ANACTRL_SET_DEV_PULLDOWN_MASK) -/*! @} */ - -/*! @name ANACTRL_CLR - Analog Control */ -/*! @{ */ - -#define USBPHY_ANACTRL_CLR_LVI_EN_MASK (0x2U) -#define USBPHY_ANACTRL_CLR_LVI_EN_SHIFT (1U) -/*! LVI_EN - Internal Low Voltage Detector Enable */ -#define USBPHY_ANACTRL_CLR_LVI_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_CLR_LVI_EN_SHIFT)) & USBPHY_ANACTRL_CLR_LVI_EN_MASK) - -#define USBPHY_ANACTRL_CLR_PFD_CLK_SEL_MASK (0xCU) -#define USBPHY_ANACTRL_CLR_PFD_CLK_SEL_SHIFT (2U) -/*! PFD_CLK_SEL - PFD Clock Selection */ -#define USBPHY_ANACTRL_CLR_PFD_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_CLR_PFD_CLK_SEL_SHIFT)) & USBPHY_ANACTRL_CLR_PFD_CLK_SEL_MASK) - -#define USBPHY_ANACTRL_CLR_DEV_PULLDOWN_MASK (0x400U) -#define USBPHY_ANACTRL_CLR_DEV_PULLDOWN_SHIFT (10U) -/*! DEV_PULLDOWN - Device Pulldown Enable */ -#define USBPHY_ANACTRL_CLR_DEV_PULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_CLR_DEV_PULLDOWN_SHIFT)) & USBPHY_ANACTRL_CLR_DEV_PULLDOWN_MASK) -/*! @} */ - -/*! @name ANACTRL_TOG - Analog Control */ -/*! @{ */ - -#define USBPHY_ANACTRL_TOG_LVI_EN_MASK (0x2U) -#define USBPHY_ANACTRL_TOG_LVI_EN_SHIFT (1U) -/*! LVI_EN - Internal Low Voltage Detector Enable */ -#define USBPHY_ANACTRL_TOG_LVI_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_TOG_LVI_EN_SHIFT)) & USBPHY_ANACTRL_TOG_LVI_EN_MASK) - -#define USBPHY_ANACTRL_TOG_PFD_CLK_SEL_MASK (0xCU) -#define USBPHY_ANACTRL_TOG_PFD_CLK_SEL_SHIFT (2U) -/*! PFD_CLK_SEL - PFD Clock Selection */ -#define USBPHY_ANACTRL_TOG_PFD_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_TOG_PFD_CLK_SEL_SHIFT)) & USBPHY_ANACTRL_TOG_PFD_CLK_SEL_MASK) - -#define USBPHY_ANACTRL_TOG_DEV_PULLDOWN_MASK (0x400U) -#define USBPHY_ANACTRL_TOG_DEV_PULLDOWN_SHIFT (10U) -/*! DEV_PULLDOWN - Device Pulldown Enable */ -#define USBPHY_ANACTRL_TOG_DEV_PULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_TOG_DEV_PULLDOWN_SHIFT)) & USBPHY_ANACTRL_TOG_DEV_PULLDOWN_MASK) -/*! @} */ - -/*! @name TRIM_OVERRIDE_EN - Trim */ -/*! @{ */ - -#define USBPHY_TRIM_OVERRIDE_EN_DIV_SEL_OVERRIDE_MASK (0x1U) -#define USBPHY_TRIM_OVERRIDE_EN_DIV_SEL_OVERRIDE_SHIFT (0U) -/*! DIV_SEL_OVERRIDE - Override Enable for PLL Divider Value - * 0b0..TRIM_OVERRIDE_EN - * 0b1..PLL_SIC - */ -#define USBPHY_TRIM_OVERRIDE_EN_DIV_SEL_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_DIV_SEL_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_DIV_SEL_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_TX_D_CAL_OVERRIDE_MASK (0x4U) -#define USBPHY_TRIM_OVERRIDE_EN_TX_D_CAL_OVERRIDE_SHIFT (2U) -/*! TX_D_CAL_OVERRIDE - Override Enable for HS TX Output Current Trim - * 0b0..TRIM_OVERRIDE_EN - * 0b1..TX - */ -#define USBPHY_TRIM_OVERRIDE_EN_TX_D_CAL_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TX_D_CAL_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TX_D_CAL_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_TX_CAL45DP_OVERRIDE_MASK (0x8U) -#define USBPHY_TRIM_OVERRIDE_EN_TX_CAL45DP_OVERRIDE_SHIFT (3U) -/*! TX_CAL45DP_OVERRIDE - Override Enable for USB_DP Series Termination Trim - * 0b0..TRIM_OVERRIDE_EN - * 0b1..TX - */ -#define USBPHY_TRIM_OVERRIDE_EN_TX_CAL45DP_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TX_CAL45DP_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TX_CAL45DP_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_TX_CAL45DM_OVERRIDE_MASK (0x10U) -#define USBPHY_TRIM_OVERRIDE_EN_TX_CAL45DM_OVERRIDE_SHIFT (4U) -/*! TX_CAL45DM_OVERRIDE - Override Enable for USB_DM Series Termination Trim - * 0b0..TRIM_OVERRIDE_EN - * 0b1..TX - */ -#define USBPHY_TRIM_OVERRIDE_EN_TX_CAL45DM_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TX_CAL45DM_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TX_CAL45DM_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_PLL_CTRL0_DIV_SEL_MASK (0x38000U) -#define USBPHY_TRIM_OVERRIDE_EN_PLL_CTRL0_DIV_SEL_SHIFT (15U) -/*! PLL_CTRL0_DIV_SEL - PLL Divider Value Configuration Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_PLL_CTRL0_DIV_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_PLL_CTRL0_DIV_SEL_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_PLL_CTRL0_DIV_SEL_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_D_CAL_MASK (0xF00000U) -#define USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_D_CAL_SHIFT (20U) -/*! USBPHY_TX_D_CAL - HS TX Output Current Trim Bits from Outside USBPHY - * 0b0000..Maximum current, approximately 19% above nominal - * 0b0111..Nominal - * 0b1111..Minimum current, approximately 19% below nominal - */ -#define USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_D_CAL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_D_CAL_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_D_CAL_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_CAL45DP_MASK (0xF000000U) -#define USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_CAL45DP_SHIFT (24U) -/*! USBPHY_TX_CAL45DP - DP Series Termination Resistance Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_CAL45DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_CAL45DP_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_CAL45DP_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_CAL45DN_MASK (0xF0000000U) -#define USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_CAL45DN_SHIFT (28U) -/*! USBPHY_TX_CAL45DN - DM Series Termination Resistance Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_CAL45DN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_CAL45DN_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_CAL45DN_MASK) -/*! @} */ - -/*! @name TRIM_OVERRIDE_EN_SET - Trim */ -/*! @{ */ - -#define USBPHY_TRIM_OVERRIDE_EN_SET_DIV_SEL_OVERRIDE_MASK (0x1U) -#define USBPHY_TRIM_OVERRIDE_EN_SET_DIV_SEL_OVERRIDE_SHIFT (0U) -/*! DIV_SEL_OVERRIDE - Override Enable for PLL Divider Value */ -#define USBPHY_TRIM_OVERRIDE_EN_SET_DIV_SEL_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_SET_DIV_SEL_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_SET_DIV_SEL_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_SET_TX_D_CAL_OVERRIDE_MASK (0x4U) -#define USBPHY_TRIM_OVERRIDE_EN_SET_TX_D_CAL_OVERRIDE_SHIFT (2U) -/*! TX_D_CAL_OVERRIDE - Override Enable for HS TX Output Current Trim */ -#define USBPHY_TRIM_OVERRIDE_EN_SET_TX_D_CAL_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_SET_TX_D_CAL_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_SET_TX_D_CAL_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_SET_TX_CAL45DP_OVERRIDE_MASK (0x8U) -#define USBPHY_TRIM_OVERRIDE_EN_SET_TX_CAL45DP_OVERRIDE_SHIFT (3U) -/*! TX_CAL45DP_OVERRIDE - Override Enable for USB_DP Series Termination Trim */ -#define USBPHY_TRIM_OVERRIDE_EN_SET_TX_CAL45DP_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_SET_TX_CAL45DP_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_SET_TX_CAL45DP_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_SET_TX_CAL45DM_OVERRIDE_MASK (0x10U) -#define USBPHY_TRIM_OVERRIDE_EN_SET_TX_CAL45DM_OVERRIDE_SHIFT (4U) -/*! TX_CAL45DM_OVERRIDE - Override Enable for USB_DM Series Termination Trim */ -#define USBPHY_TRIM_OVERRIDE_EN_SET_TX_CAL45DM_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_SET_TX_CAL45DM_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_SET_TX_CAL45DM_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_SET_PLL_CTRL0_DIV_SEL_MASK (0x38000U) -#define USBPHY_TRIM_OVERRIDE_EN_SET_PLL_CTRL0_DIV_SEL_SHIFT (15U) -/*! PLL_CTRL0_DIV_SEL - PLL Divider Value Configuration Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_SET_PLL_CTRL0_DIV_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_SET_PLL_CTRL0_DIV_SEL_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_SET_PLL_CTRL0_DIV_SEL_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_D_CAL_MASK (0xF00000U) -#define USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_D_CAL_SHIFT (20U) -/*! USBPHY_TX_D_CAL - HS TX Output Current Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_D_CAL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_D_CAL_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_D_CAL_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_CAL45DP_MASK (0xF000000U) -#define USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_CAL45DP_SHIFT (24U) -/*! USBPHY_TX_CAL45DP - DP Series Termination Resistance Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_CAL45DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_CAL45DP_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_CAL45DP_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_CAL45DN_MASK (0xF0000000U) -#define USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_CAL45DN_SHIFT (28U) -/*! USBPHY_TX_CAL45DN - DM Series Termination Resistance Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_CAL45DN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_CAL45DN_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_CAL45DN_MASK) -/*! @} */ - -/*! @name TRIM_OVERRIDE_EN_CLR - Trim */ -/*! @{ */ - -#define USBPHY_TRIM_OVERRIDE_EN_CLR_DIV_SEL_OVERRIDE_MASK (0x1U) -#define USBPHY_TRIM_OVERRIDE_EN_CLR_DIV_SEL_OVERRIDE_SHIFT (0U) -/*! DIV_SEL_OVERRIDE - Override Enable for PLL Divider Value */ -#define USBPHY_TRIM_OVERRIDE_EN_CLR_DIV_SEL_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_CLR_DIV_SEL_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_CLR_DIV_SEL_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_CLR_TX_D_CAL_OVERRIDE_MASK (0x4U) -#define USBPHY_TRIM_OVERRIDE_EN_CLR_TX_D_CAL_OVERRIDE_SHIFT (2U) -/*! TX_D_CAL_OVERRIDE - Override Enable for HS TX Output Current Trim */ -#define USBPHY_TRIM_OVERRIDE_EN_CLR_TX_D_CAL_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_CLR_TX_D_CAL_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_CLR_TX_D_CAL_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_CLR_TX_CAL45DP_OVERRIDE_MASK (0x8U) -#define USBPHY_TRIM_OVERRIDE_EN_CLR_TX_CAL45DP_OVERRIDE_SHIFT (3U) -/*! TX_CAL45DP_OVERRIDE - Override Enable for USB_DP Series Termination Trim */ -#define USBPHY_TRIM_OVERRIDE_EN_CLR_TX_CAL45DP_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_CLR_TX_CAL45DP_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_CLR_TX_CAL45DP_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_CLR_TX_CAL45DM_OVERRIDE_MASK (0x10U) -#define USBPHY_TRIM_OVERRIDE_EN_CLR_TX_CAL45DM_OVERRIDE_SHIFT (4U) -/*! TX_CAL45DM_OVERRIDE - Override Enable for USB_DM Series Termination Trim */ -#define USBPHY_TRIM_OVERRIDE_EN_CLR_TX_CAL45DM_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_CLR_TX_CAL45DM_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_CLR_TX_CAL45DM_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_CLR_PLL_CTRL0_DIV_SEL_MASK (0x38000U) -#define USBPHY_TRIM_OVERRIDE_EN_CLR_PLL_CTRL0_DIV_SEL_SHIFT (15U) -/*! PLL_CTRL0_DIV_SEL - PLL Divider Value Configuration Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_CLR_PLL_CTRL0_DIV_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_CLR_PLL_CTRL0_DIV_SEL_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_CLR_PLL_CTRL0_DIV_SEL_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_D_CAL_MASK (0xF00000U) -#define USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_D_CAL_SHIFT (20U) -/*! USBPHY_TX_D_CAL - HS TX Output Current Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_D_CAL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_D_CAL_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_D_CAL_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_CAL45DP_MASK (0xF000000U) -#define USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_CAL45DP_SHIFT (24U) -/*! USBPHY_TX_CAL45DP - DP Series Termination Resistance Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_CAL45DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_CAL45DP_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_CAL45DP_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_CAL45DN_MASK (0xF0000000U) -#define USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_CAL45DN_SHIFT (28U) -/*! USBPHY_TX_CAL45DN - DM Series Termination Resistance Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_CAL45DN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_CAL45DN_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_CAL45DN_MASK) -/*! @} */ - -/*! @name TRIM_OVERRIDE_EN_TOG - Trim */ -/*! @{ */ - -#define USBPHY_TRIM_OVERRIDE_EN_TOG_DIV_SEL_OVERRIDE_MASK (0x1U) -#define USBPHY_TRIM_OVERRIDE_EN_TOG_DIV_SEL_OVERRIDE_SHIFT (0U) -/*! DIV_SEL_OVERRIDE - Override Enable for PLL Divider Value */ -#define USBPHY_TRIM_OVERRIDE_EN_TOG_DIV_SEL_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TOG_DIV_SEL_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TOG_DIV_SEL_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_TOG_TX_D_CAL_OVERRIDE_MASK (0x4U) -#define USBPHY_TRIM_OVERRIDE_EN_TOG_TX_D_CAL_OVERRIDE_SHIFT (2U) -/*! TX_D_CAL_OVERRIDE - Override Enable for HS TX Output Current Trim */ -#define USBPHY_TRIM_OVERRIDE_EN_TOG_TX_D_CAL_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TOG_TX_D_CAL_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TOG_TX_D_CAL_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_TOG_TX_CAL45DP_OVERRIDE_MASK (0x8U) -#define USBPHY_TRIM_OVERRIDE_EN_TOG_TX_CAL45DP_OVERRIDE_SHIFT (3U) -/*! TX_CAL45DP_OVERRIDE - Override Enable for USB_DP Series Termination Trim */ -#define USBPHY_TRIM_OVERRIDE_EN_TOG_TX_CAL45DP_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TOG_TX_CAL45DP_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TOG_TX_CAL45DP_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_TOG_TX_CAL45DM_OVERRIDE_MASK (0x10U) -#define USBPHY_TRIM_OVERRIDE_EN_TOG_TX_CAL45DM_OVERRIDE_SHIFT (4U) -/*! TX_CAL45DM_OVERRIDE - Override Enable for USB_DM Series Termination Trim */ -#define USBPHY_TRIM_OVERRIDE_EN_TOG_TX_CAL45DM_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TOG_TX_CAL45DM_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TOG_TX_CAL45DM_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_TOG_PLL_CTRL0_DIV_SEL_MASK (0x38000U) -#define USBPHY_TRIM_OVERRIDE_EN_TOG_PLL_CTRL0_DIV_SEL_SHIFT (15U) -/*! PLL_CTRL0_DIV_SEL - PLL Divider Value Configuration Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_TOG_PLL_CTRL0_DIV_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TOG_PLL_CTRL0_DIV_SEL_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TOG_PLL_CTRL0_DIV_SEL_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_D_CAL_MASK (0xF00000U) -#define USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_D_CAL_SHIFT (20U) -/*! USBPHY_TX_D_CAL - HS TX Output Current Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_D_CAL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_D_CAL_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_D_CAL_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_CAL45DP_MASK (0xF000000U) -#define USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_CAL45DP_SHIFT (24U) -/*! USBPHY_TX_CAL45DP - DP Series Termination Resistance Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_CAL45DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_CAL45DP_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_CAL45DP_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_CAL45DN_MASK (0xF0000000U) -#define USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_CAL45DN_SHIFT (28U) -/*! USBPHY_TX_CAL45DN - DM Series Termination Resistance Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_CAL45DN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_CAL45DN_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_CAL45DN_MASK) -/*! @} */ - -/*! @name PFDA - PFD A */ -/*! @{ */ - -#define USBPHY_PFDA_PFD0_CLKGATE_MASK (0x1U) -#define USBPHY_PFDA_PFD0_CLKGATE_SHIFT (0U) -/*! PFD0_CLKGATE - PFD0 Clock Gate - * 0b0..Enable - * 0b1..Disable - */ -#define USBPHY_PFDA_PFD0_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_PFD0_CLKGATE_SHIFT)) & USBPHY_PFDA_PFD0_CLKGATE_MASK) - -#define USBPHY_PFDA_PFD0_FRAC_MASK (0x7EU) -#define USBPHY_PFDA_PFD0_FRAC_SHIFT (1U) -/*! PFD0_FRAC - PFD0 Fractional Divider */ -#define USBPHY_PFDA_PFD0_FRAC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_PFD0_FRAC_SHIFT)) & USBPHY_PFDA_PFD0_FRAC_MASK) - -#define USBPHY_PFDA_PFD0_STABLE_MASK (0x80U) -#define USBPHY_PFDA_PFD0_STABLE_SHIFT (7U) -/*! PFD0_STABLE - PFD0 Stable Signal - * 0b0..Not stable - * 0b1..Stable - */ -#define USBPHY_PFDA_PFD0_STABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_PFD0_STABLE_SHIFT)) & USBPHY_PFDA_PFD0_STABLE_MASK) -/*! @} */ - -/*! @name PFDA_SET - PFD A */ -/*! @{ */ - -#define USBPHY_PFDA_SET_PFD0_CLKGATE_MASK (0x1U) -#define USBPHY_PFDA_SET_PFD0_CLKGATE_SHIFT (0U) -/*! PFD0_CLKGATE - PFD0 Clock Gate */ -#define USBPHY_PFDA_SET_PFD0_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_SET_PFD0_CLKGATE_SHIFT)) & USBPHY_PFDA_SET_PFD0_CLKGATE_MASK) - -#define USBPHY_PFDA_SET_PFD0_FRAC_MASK (0x7EU) -#define USBPHY_PFDA_SET_PFD0_FRAC_SHIFT (1U) -/*! PFD0_FRAC - PFD0 Fractional Divider */ -#define USBPHY_PFDA_SET_PFD0_FRAC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_SET_PFD0_FRAC_SHIFT)) & USBPHY_PFDA_SET_PFD0_FRAC_MASK) - -#define USBPHY_PFDA_SET_PFD0_STABLE_MASK (0x80U) -#define USBPHY_PFDA_SET_PFD0_STABLE_SHIFT (7U) -/*! PFD0_STABLE - PFD0 Stable Signal */ -#define USBPHY_PFDA_SET_PFD0_STABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_SET_PFD0_STABLE_SHIFT)) & USBPHY_PFDA_SET_PFD0_STABLE_MASK) -/*! @} */ - -/*! @name PFDA_CLR - PFD A */ -/*! @{ */ - -#define USBPHY_PFDA_CLR_PFD0_CLKGATE_MASK (0x1U) -#define USBPHY_PFDA_CLR_PFD0_CLKGATE_SHIFT (0U) -/*! PFD0_CLKGATE - PFD0 Clock Gate */ -#define USBPHY_PFDA_CLR_PFD0_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_CLR_PFD0_CLKGATE_SHIFT)) & USBPHY_PFDA_CLR_PFD0_CLKGATE_MASK) - -#define USBPHY_PFDA_CLR_PFD0_FRAC_MASK (0x7EU) -#define USBPHY_PFDA_CLR_PFD0_FRAC_SHIFT (1U) -/*! PFD0_FRAC - PFD0 Fractional Divider */ -#define USBPHY_PFDA_CLR_PFD0_FRAC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_CLR_PFD0_FRAC_SHIFT)) & USBPHY_PFDA_CLR_PFD0_FRAC_MASK) - -#define USBPHY_PFDA_CLR_PFD0_STABLE_MASK (0x80U) -#define USBPHY_PFDA_CLR_PFD0_STABLE_SHIFT (7U) -/*! PFD0_STABLE - PFD0 Stable Signal */ -#define USBPHY_PFDA_CLR_PFD0_STABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_CLR_PFD0_STABLE_SHIFT)) & USBPHY_PFDA_CLR_PFD0_STABLE_MASK) -/*! @} */ - -/*! @name PFDA_TOG - PFD A */ -/*! @{ */ - -#define USBPHY_PFDA_TOG_PFD0_CLKGATE_MASK (0x1U) -#define USBPHY_PFDA_TOG_PFD0_CLKGATE_SHIFT (0U) -/*! PFD0_CLKGATE - PFD0 Clock Gate */ -#define USBPHY_PFDA_TOG_PFD0_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_TOG_PFD0_CLKGATE_SHIFT)) & USBPHY_PFDA_TOG_PFD0_CLKGATE_MASK) - -#define USBPHY_PFDA_TOG_PFD0_FRAC_MASK (0x7EU) -#define USBPHY_PFDA_TOG_PFD0_FRAC_SHIFT (1U) -/*! PFD0_FRAC - PFD0 Fractional Divider */ -#define USBPHY_PFDA_TOG_PFD0_FRAC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_TOG_PFD0_FRAC_SHIFT)) & USBPHY_PFDA_TOG_PFD0_FRAC_MASK) - -#define USBPHY_PFDA_TOG_PFD0_STABLE_MASK (0x80U) -#define USBPHY_PFDA_TOG_PFD0_STABLE_SHIFT (7U) -/*! PFD0_STABLE - PFD0 Stable Signal */ -#define USBPHY_PFDA_TOG_PFD0_STABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_TOG_PFD0_STABLE_SHIFT)) & USBPHY_PFDA_TOG_PFD0_STABLE_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group USBPHY_Register_Masks */ - - -/* USBPHY - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral USBPHY base address */ - #define USBPHY_BASE (0x5010A000u) - /** Peripheral USBPHY base address */ - #define USBPHY_BASE_NS (0x4010A000u) - /** Peripheral USBPHY base pointer */ - #define USBPHY ((USBPHY_Type *)USBPHY_BASE) - /** Peripheral USBPHY base pointer */ - #define USBPHY_NS ((USBPHY_Type *)USBPHY_BASE_NS) - /** Array initializer of USBPHY peripheral base addresses */ - #define USBPHY_BASE_ADDRS { USBPHY_BASE } - /** Array initializer of USBPHY peripheral base pointers */ - #define USBPHY_BASE_PTRS { USBPHY } - /** Array initializer of USBPHY peripheral base addresses */ - #define USBPHY_BASE_ADDRS_NS { USBPHY_BASE_NS } - /** Array initializer of USBPHY peripheral base pointers */ - #define USBPHY_BASE_PTRS_NS { USBPHY_NS } -#else - /** Peripheral USBPHY base address */ - #define USBPHY_BASE (0x4010A000u) - /** Peripheral USBPHY base pointer */ - #define USBPHY ((USBPHY_Type *)USBPHY_BASE) - /** Array initializer of USBPHY peripheral base addresses */ - #define USBPHY_BASE_ADDRS { USBPHY_BASE } - /** Array initializer of USBPHY peripheral base pointers */ - #define USBPHY_BASE_PTRS { USBPHY } -#endif -/** Interrupt vectors for the USBPHY peripheral type */ -#define USBPHY_IRQS { USB1_HS_PHY_IRQn } -/* Backward compatibility */ -#define USBPHY_CTRL_ENDEVPLUGINDET_MASK USBPHY_CTRL_ENDEVPLUGINDETECT_MASK -#define USBPHY_CTRL_ENDEVPLUGINDET_SHIFT USBPHY_CTRL_ENDEVPLUGINDETECT_SHIFT -#define USBPHY_CTRL_ENDEVPLUGINDET(x) USBPHY_CTRL_ENDEVPLUGINDETECT(x) -#define USBPHY_TX_TXCAL45DM_MASK USBPHY_TX_TXCAL45DN_MASK -#define USBPHY_TX_TXCAL45DM_SHIFT USBPHY_TX_TXCAL45DN_SHIFT -#define USBPHY_TX_TXCAL45DM(x) USBPHY_TX_TXCAL45DN(x) - - -/*! - * @} - */ /* end of group USBPHY_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- USDHC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USDHC_Peripheral_Access_Layer USDHC Peripheral Access Layer - * @{ - */ - -/** USDHC - Register Layout Typedef */ -typedef struct { - __IO uint32_t DS_ADDR; /**< DMA System Address, offset: 0x0 */ - __IO uint32_t BLK_ATT; /**< Block Attributes, offset: 0x4 */ - __IO uint32_t CMD_ARG; /**< Command Argument, offset: 0x8 */ - __IO uint32_t CMD_XFR_TYP; /**< Command Transfer Type, offset: 0xC */ - __I uint32_t CMD_RSP0; /**< Command Response0, offset: 0x10 */ - __I uint32_t CMD_RSP1; /**< Command Response1, offset: 0x14 */ - __I uint32_t CMD_RSP2; /**< Command Response2, offset: 0x18 */ - __I uint32_t CMD_RSP3; /**< Command Response3, offset: 0x1C */ - __IO uint32_t DATA_BUFF_ACC_PORT; /**< Data Buffer Access Port, offset: 0x20 */ - __I uint32_t PRES_STATE; /**< Present State, offset: 0x24 */ - __IO uint32_t PROT_CTRL; /**< Protocol Control, offset: 0x28 */ - __IO uint32_t SYS_CTRL; /**< System Control, offset: 0x2C */ - __IO uint32_t INT_STATUS; /**< Interrupt Status, offset: 0x30 */ - __IO uint32_t INT_STATUS_EN; /**< Interrupt Status Enable, offset: 0x34 */ - __IO uint32_t INT_SIGNAL_EN; /**< Interrupt Signal Enable, offset: 0x38 */ - __IO uint32_t AUTOCMD12_ERR_STATUS; /**< Auto CMD12 Error Status, offset: 0x3C */ - __IO uint32_t HOST_CTRL_CAP; /**< Host Controller Capabilities, offset: 0x40 */ - __IO uint32_t WTMK_LVL; /**< Watermark Level, offset: 0x44 */ - __IO uint32_t MIX_CTRL; /**< Mixer Control, offset: 0x48 */ - uint8_t RESERVED_0[4]; - __O uint32_t FORCE_EVENT; /**< Force Event, offset: 0x50 */ - __I uint32_t ADMA_ERR_STATUS; /**< ADMA Error Status, offset: 0x54 */ - __IO uint32_t ADMA_SYS_ADDR; /**< ADMA System Address, offset: 0x58 */ - uint8_t RESERVED_1[4]; - __IO uint32_t DLL_CTRL; /**< DLL (Delay Line) Control, offset: 0x60 */ - __I uint32_t DLL_STATUS; /**< DLL Status, offset: 0x64 */ - __IO uint32_t CLK_TUNE_CTRL_STATUS; /**< CLK Tuning Control and Status, offset: 0x68 */ - uint8_t RESERVED_2[84]; - __IO uint32_t VEND_SPEC; /**< Vendor Specific Register, offset: 0xC0 */ - __IO uint32_t MMC_BOOT; /**< eMMC Boot, offset: 0xC4 */ - __IO uint32_t VEND_SPEC2; /**< Vendor Specific 2 Register, offset: 0xC8 */ - __IO uint32_t TUNING_CTRL; /**< Tuning Control, offset: 0xCC */ -} USDHC_Type; - -/* ---------------------------------------------------------------------------- - -- USDHC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USDHC_Register_Masks USDHC Register Masks - * @{ - */ - -/*! @name DS_ADDR - DMA System Address */ -/*! @{ */ - -#define USDHC_DS_ADDR_DS_ADDR_MASK (0xFFFFFFFFU) -#define USDHC_DS_ADDR_DS_ADDR_SHIFT (0U) -/*! DS_ADDR - System address */ -#define USDHC_DS_ADDR_DS_ADDR(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DS_ADDR_DS_ADDR_SHIFT)) & USDHC_DS_ADDR_DS_ADDR_MASK) -/*! @} */ - -/*! @name BLK_ATT - Block Attributes */ -/*! @{ */ - -#define USDHC_BLK_ATT_BLKSIZE_MASK (0x1FFFU) -#define USDHC_BLK_ATT_BLKSIZE_SHIFT (0U) -/*! BLKSIZE - Transfer block size - * 0b1000000000000..4096 bytes - * 0b0100000000000..2048 bytes - * 0b0001000000000..512 bytes - * 0b0000111111111..511 bytes - * 0b0000000000100..4 bytes - * 0b0000000000011..3 bytes - * 0b0000000000010..2 bytes - * 0b0000000000001..1 byte - * 0b0000000000000..No data transfer - */ -#define USDHC_BLK_ATT_BLKSIZE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_BLK_ATT_BLKSIZE_SHIFT)) & USDHC_BLK_ATT_BLKSIZE_MASK) - -#define USDHC_BLK_ATT_BLKCNT_MASK (0xFFFF0000U) -#define USDHC_BLK_ATT_BLKCNT_SHIFT (16U) -/*! BLKCNT - Blocks count for current transfer - * 0b1111111111111111..65535 blocks - * 0b0000000000000010..2 blocks - * 0b0000000000000001..1 block - * 0b0000000000000000..Stop count - */ -#define USDHC_BLK_ATT_BLKCNT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_BLK_ATT_BLKCNT_SHIFT)) & USDHC_BLK_ATT_BLKCNT_MASK) -/*! @} */ - -/*! @name CMD_ARG - Command Argument */ -/*! @{ */ - -#define USDHC_CMD_ARG_CMDARG_MASK (0xFFFFFFFFU) -#define USDHC_CMD_ARG_CMDARG_SHIFT (0U) -/*! CMDARG - Command argument */ -#define USDHC_CMD_ARG_CMDARG(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_ARG_CMDARG_SHIFT)) & USDHC_CMD_ARG_CMDARG_MASK) -/*! @} */ - -/*! @name CMD_XFR_TYP - Command Transfer Type */ -/*! @{ */ - -#define USDHC_CMD_XFR_TYP_DMAEN_MASK (0x1U) -#define USDHC_CMD_XFR_TYP_DMAEN_SHIFT (0U) -/*! DMAEN - DMAEN - * 0b0..Disable - * 0b1..Enable - */ -#define USDHC_CMD_XFR_TYP_DMAEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_XFR_TYP_DMAEN_SHIFT)) & USDHC_CMD_XFR_TYP_DMAEN_MASK) - -#define USDHC_CMD_XFR_TYP_BCEN_MASK (0x2U) -#define USDHC_CMD_XFR_TYP_BCEN_SHIFT (1U) -/*! BCEN - BCEN - * 0b0..Disable - * 0b1..Enable - */ -#define USDHC_CMD_XFR_TYP_BCEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_XFR_TYP_BCEN_SHIFT)) & USDHC_CMD_XFR_TYP_BCEN_MASK) - -#define USDHC_CMD_XFR_TYP_AC12EN_MASK (0x4U) -#define USDHC_CMD_XFR_TYP_AC12EN_SHIFT (2U) -/*! AC12EN - AC12EN - * 0b0..Disable - * 0b1..Enable - */ -#define USDHC_CMD_XFR_TYP_AC12EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_XFR_TYP_AC12EN_SHIFT)) & USDHC_CMD_XFR_TYP_AC12EN_MASK) - -#define USDHC_CMD_XFR_TYP_DDR_EN_MASK (0x8U) -#define USDHC_CMD_XFR_TYP_DDR_EN_SHIFT (3U) -/*! DDR_EN - DDR_EN - * 0b0..Disable - * 0b1..Enable - */ -#define USDHC_CMD_XFR_TYP_DDR_EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_XFR_TYP_DDR_EN_SHIFT)) & USDHC_CMD_XFR_TYP_DDR_EN_MASK) - -#define USDHC_CMD_XFR_TYP_DTDSEL_MASK (0x10U) -#define USDHC_CMD_XFR_TYP_DTDSEL_SHIFT (4U) -/*! DTDSEL - DTDSEL - * 0b0..Disable - * 0b1..Enable - */ -#define USDHC_CMD_XFR_TYP_DTDSEL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_XFR_TYP_DTDSEL_SHIFT)) & USDHC_CMD_XFR_TYP_DTDSEL_MASK) - -#define USDHC_CMD_XFR_TYP_MSBSEL_MASK (0x20U) -#define USDHC_CMD_XFR_TYP_MSBSEL_SHIFT (5U) -/*! MSBSEL - MSBSEL - * 0b0..Disable - * 0b1..Enable - */ -#define USDHC_CMD_XFR_TYP_MSBSEL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_XFR_TYP_MSBSEL_SHIFT)) & USDHC_CMD_XFR_TYP_MSBSEL_MASK) - -#define USDHC_CMD_XFR_TYP_NIBBLE_POS_MASK (0x40U) -#define USDHC_CMD_XFR_TYP_NIBBLE_POS_SHIFT (6U) -/*! NIBBLE_POS - NIBBLE_POS - * 0b0..Disable - * 0b1..Enable - */ -#define USDHC_CMD_XFR_TYP_NIBBLE_POS(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_XFR_TYP_NIBBLE_POS_SHIFT)) & USDHC_CMD_XFR_TYP_NIBBLE_POS_MASK) - -#define USDHC_CMD_XFR_TYP_AC23EN_MASK (0x80U) -#define USDHC_CMD_XFR_TYP_AC23EN_SHIFT (7U) -/*! AC23EN - AC23EN - * 0b0..Disable - * 0b1..Enable - */ -#define USDHC_CMD_XFR_TYP_AC23EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_XFR_TYP_AC23EN_SHIFT)) & USDHC_CMD_XFR_TYP_AC23EN_MASK) - -#define USDHC_CMD_XFR_TYP_RSPTYP_MASK (0x30000U) -#define USDHC_CMD_XFR_TYP_RSPTYP_SHIFT (16U) -/*! RSPTYP - Response type select - * 0b00..No response - * 0b01..Response length 136 - * 0b10..Response length 48 - * 0b11..Response length 48, check busy after response - */ -#define USDHC_CMD_XFR_TYP_RSPTYP(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_XFR_TYP_RSPTYP_SHIFT)) & USDHC_CMD_XFR_TYP_RSPTYP_MASK) - -#define USDHC_CMD_XFR_TYP_CCCEN_MASK (0x80000U) -#define USDHC_CMD_XFR_TYP_CCCEN_SHIFT (19U) -/*! CCCEN - Command CRC check enable - * 0b1..Enables command CRC check - * 0b0..Disables command CRC check - */ -#define USDHC_CMD_XFR_TYP_CCCEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_XFR_TYP_CCCEN_SHIFT)) & USDHC_CMD_XFR_TYP_CCCEN_MASK) - -#define USDHC_CMD_XFR_TYP_CICEN_MASK (0x100000U) -#define USDHC_CMD_XFR_TYP_CICEN_SHIFT (20U) -/*! CICEN - Command index check enable - * 0b1..Enables command index check - * 0b0..Disable command index check - */ -#define USDHC_CMD_XFR_TYP_CICEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_XFR_TYP_CICEN_SHIFT)) & USDHC_CMD_XFR_TYP_CICEN_MASK) - -#define USDHC_CMD_XFR_TYP_DPSEL_MASK (0x200000U) -#define USDHC_CMD_XFR_TYP_DPSEL_SHIFT (21U) -/*! DPSEL - Data present select - * 0b1..Data present - * 0b0..No data present - */ -#define USDHC_CMD_XFR_TYP_DPSEL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_XFR_TYP_DPSEL_SHIFT)) & USDHC_CMD_XFR_TYP_DPSEL_MASK) - -#define USDHC_CMD_XFR_TYP_CMDTYP_MASK (0xC00000U) -#define USDHC_CMD_XFR_TYP_CMDTYP_SHIFT (22U) -/*! CMDTYP - Command type - * 0b11..Abort CMD12, CMD52 for writing I/O Abort in CCCR - * 0b10..Resume CMD52 for writing function select in CCCR - * 0b01..Suspend CMD52 for writing bus suspend in CCCR - * 0b00..Normal other commands - */ -#define USDHC_CMD_XFR_TYP_CMDTYP(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_XFR_TYP_CMDTYP_SHIFT)) & USDHC_CMD_XFR_TYP_CMDTYP_MASK) - -#define USDHC_CMD_XFR_TYP_CMDINX_MASK (0x3F000000U) -#define USDHC_CMD_XFR_TYP_CMDINX_SHIFT (24U) -/*! CMDINX - Command index */ -#define USDHC_CMD_XFR_TYP_CMDINX(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_XFR_TYP_CMDINX_SHIFT)) & USDHC_CMD_XFR_TYP_CMDINX_MASK) -/*! @} */ - -/*! @name CMD_RSP0 - Command Response0 */ -/*! @{ */ - -#define USDHC_CMD_RSP0_CMDRSP0_MASK (0xFFFFFFFFU) -#define USDHC_CMD_RSP0_CMDRSP0_SHIFT (0U) -/*! CMDRSP0 - Command response 0 */ -#define USDHC_CMD_RSP0_CMDRSP0(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_RSP0_CMDRSP0_SHIFT)) & USDHC_CMD_RSP0_CMDRSP0_MASK) -/*! @} */ - -/*! @name CMD_RSP1 - Command Response1 */ -/*! @{ */ - -#define USDHC_CMD_RSP1_CMDRSP1_MASK (0xFFFFFFFFU) -#define USDHC_CMD_RSP1_CMDRSP1_SHIFT (0U) -/*! CMDRSP1 - Command response 1 */ -#define USDHC_CMD_RSP1_CMDRSP1(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_RSP1_CMDRSP1_SHIFT)) & USDHC_CMD_RSP1_CMDRSP1_MASK) -/*! @} */ - -/*! @name CMD_RSP2 - Command Response2 */ -/*! @{ */ - -#define USDHC_CMD_RSP2_CMDRSP2_MASK (0xFFFFFFFFU) -#define USDHC_CMD_RSP2_CMDRSP2_SHIFT (0U) -/*! CMDRSP2 - Command response 2 */ -#define USDHC_CMD_RSP2_CMDRSP2(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_RSP2_CMDRSP2_SHIFT)) & USDHC_CMD_RSP2_CMDRSP2_MASK) -/*! @} */ - -/*! @name CMD_RSP3 - Command Response3 */ -/*! @{ */ - -#define USDHC_CMD_RSP3_CMDRSP3_MASK (0xFFFFFFFFU) -#define USDHC_CMD_RSP3_CMDRSP3_SHIFT (0U) -/*! CMDRSP3 - Command response 3 */ -#define USDHC_CMD_RSP3_CMDRSP3(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_RSP3_CMDRSP3_SHIFT)) & USDHC_CMD_RSP3_CMDRSP3_MASK) -/*! @} */ - -/*! @name DATA_BUFF_ACC_PORT - Data Buffer Access Port */ -/*! @{ */ - -#define USDHC_DATA_BUFF_ACC_PORT_DATCONT_MASK (0xFFFFFFFFU) -#define USDHC_DATA_BUFF_ACC_PORT_DATCONT_SHIFT (0U) -/*! DATCONT - Data content */ -#define USDHC_DATA_BUFF_ACC_PORT_DATCONT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DATA_BUFF_ACC_PORT_DATCONT_SHIFT)) & USDHC_DATA_BUFF_ACC_PORT_DATCONT_MASK) -/*! @} */ - -/*! @name PRES_STATE - Present State */ -/*! @{ */ - -#define USDHC_PRES_STATE_CIHB_MASK (0x1U) -#define USDHC_PRES_STATE_CIHB_SHIFT (0U) -/*! CIHB - Command inhibit (CMD) - * 0b1..Cannot issue command - * 0b0..Can issue command using only CMD line - */ -#define USDHC_PRES_STATE_CIHB(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PRES_STATE_CIHB_SHIFT)) & USDHC_PRES_STATE_CIHB_MASK) - -#define USDHC_PRES_STATE_CDIHB_MASK (0x2U) -#define USDHC_PRES_STATE_CDIHB_SHIFT (1U) -/*! CDIHB - Command Inhibit Data (DATA) - * 0b1..Cannot issue command that uses the DATA line - * 0b0..Can issue command that uses the DATA line - */ -#define USDHC_PRES_STATE_CDIHB(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PRES_STATE_CDIHB_SHIFT)) & USDHC_PRES_STATE_CDIHB_MASK) - -#define USDHC_PRES_STATE_DLA_MASK (0x4U) -#define USDHC_PRES_STATE_DLA_SHIFT (2U) -/*! DLA - Data line active - * 0b1..DATA line active - * 0b0..DATA line inactive - */ -#define USDHC_PRES_STATE_DLA(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PRES_STATE_DLA_SHIFT)) & USDHC_PRES_STATE_DLA_MASK) - -#define USDHC_PRES_STATE_SDSTB_MASK (0x8U) -#define USDHC_PRES_STATE_SDSTB_SHIFT (3U) -/*! SDSTB - SD clock stable - * 0b1..Clock is stable. - * 0b0..Clock is changing frequency and not stable. - */ -#define USDHC_PRES_STATE_SDSTB(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PRES_STATE_SDSTB_SHIFT)) & USDHC_PRES_STATE_SDSTB_MASK) - -#define USDHC_PRES_STATE_WTA_MASK (0x100U) -#define USDHC_PRES_STATE_WTA_SHIFT (8U) -/*! WTA - Write transfer active - * 0b1..Transferring data - * 0b0..No valid data - */ -#define USDHC_PRES_STATE_WTA(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PRES_STATE_WTA_SHIFT)) & USDHC_PRES_STATE_WTA_MASK) - -#define USDHC_PRES_STATE_RTA_MASK (0x200U) -#define USDHC_PRES_STATE_RTA_SHIFT (9U) -/*! RTA - Read transfer active - * 0b1..Transferring data - * 0b0..No valid data - */ -#define USDHC_PRES_STATE_RTA(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PRES_STATE_RTA_SHIFT)) & USDHC_PRES_STATE_RTA_MASK) - -#define USDHC_PRES_STATE_BWEN_MASK (0x400U) -#define USDHC_PRES_STATE_BWEN_SHIFT (10U) -/*! BWEN - Buffer write enable - * 0b1..Write enable - * 0b0..Write disable - */ -#define USDHC_PRES_STATE_BWEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PRES_STATE_BWEN_SHIFT)) & USDHC_PRES_STATE_BWEN_MASK) - -#define USDHC_PRES_STATE_BREN_MASK (0x800U) -#define USDHC_PRES_STATE_BREN_SHIFT (11U) -/*! BREN - Buffer read enable - * 0b1..Read enable - * 0b0..Read disable - */ -#define USDHC_PRES_STATE_BREN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PRES_STATE_BREN_SHIFT)) & USDHC_PRES_STATE_BREN_MASK) - -#define USDHC_PRES_STATE_RTR_MASK (0x1000U) -#define USDHC_PRES_STATE_RTR_SHIFT (12U) -/*! RTR - Re-Tuning Request (only for SD3.0 SDR104 mode) - * 0b1..Sampling clock needs re-tuning - * 0b0..Fixed or well tuned sampling clock - */ -#define USDHC_PRES_STATE_RTR(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PRES_STATE_RTR_SHIFT)) & USDHC_PRES_STATE_RTR_MASK) - -#define USDHC_PRES_STATE_TSCD_MASK (0x8000U) -#define USDHC_PRES_STATE_TSCD_SHIFT (15U) -/*! TSCD - Tap select change done - * 0b1..Delay cell select change is finished. - * 0b0..Delay cell select change is not finished. - */ -#define USDHC_PRES_STATE_TSCD(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PRES_STATE_TSCD_SHIFT)) & USDHC_PRES_STATE_TSCD_MASK) - -#define USDHC_PRES_STATE_CINST_MASK (0x10000U) -#define USDHC_PRES_STATE_CINST_SHIFT (16U) -/*! CINST - Card inserted - * 0b1..Card inserted - * 0b0..Power on reset or no card - */ -#define USDHC_PRES_STATE_CINST(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PRES_STATE_CINST_SHIFT)) & USDHC_PRES_STATE_CINST_MASK) - -#define USDHC_PRES_STATE_CLSL_MASK (0x800000U) -#define USDHC_PRES_STATE_CLSL_SHIFT (23U) -/*! CLSL - CMD line signal level */ -#define USDHC_PRES_STATE_CLSL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PRES_STATE_CLSL_SHIFT)) & USDHC_PRES_STATE_CLSL_MASK) - -#define USDHC_PRES_STATE_DLSL_MASK (0xFF000000U) -#define USDHC_PRES_STATE_DLSL_SHIFT (24U) -/*! DLSL - DATA[7:0] line signal level - * 0b10000000..Data 7 line signal level - * 0b01000000..Data 6 line signal level - * 0b00100000..Data 5 line signal level - * 0b00010000..Data 4 line signal level - * 0b00001000..Data 3 line signal level - * 0b00000100..Data 2 line signal level - * 0b00000010..Data 1 line signal level - * 0b00000001..Data 0 line signal level - */ -#define USDHC_PRES_STATE_DLSL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PRES_STATE_DLSL_SHIFT)) & USDHC_PRES_STATE_DLSL_MASK) -/*! @} */ - -/*! @name PROT_CTRL - Protocol Control */ -/*! @{ */ - -#define USDHC_PROT_CTRL_DTW_MASK (0x6U) -#define USDHC_PROT_CTRL_DTW_SHIFT (1U) -/*! DTW - Data transfer width - * 0b10..8-bit mode - * 0b01..4-bit mode - * 0b00..1-bit mode - * 0b11..Reserved - */ -#define USDHC_PROT_CTRL_DTW(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PROT_CTRL_DTW_SHIFT)) & USDHC_PROT_CTRL_DTW_MASK) - -#define USDHC_PROT_CTRL_D3CD_MASK (0x8U) -#define USDHC_PROT_CTRL_D3CD_SHIFT (3U) -/*! D3CD - DATA3 as card detection pin - * 0b1..DATA3 as card detection pin - * 0b0..DATA3 does not monitor card insertion - */ -#define USDHC_PROT_CTRL_D3CD(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PROT_CTRL_D3CD_SHIFT)) & USDHC_PROT_CTRL_D3CD_MASK) - -#define USDHC_PROT_CTRL_EMODE_MASK (0x30U) -#define USDHC_PROT_CTRL_EMODE_SHIFT (4U) -/*! EMODE - Endian mode - * 0b00..Big endian mode - * 0b01..Half word big endian mode - * 0b10..Little endian mode - * 0b11..Reserved - */ -#define USDHC_PROT_CTRL_EMODE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PROT_CTRL_EMODE_SHIFT)) & USDHC_PROT_CTRL_EMODE_MASK) - -#define USDHC_PROT_CTRL_DMASEL_MASK (0x300U) -#define USDHC_PROT_CTRL_DMASEL_SHIFT (8U) -/*! DMASEL - DMA select - * 0b00..No DMA or simple DMA is selected. - * 0b01..ADMA1 is selected. - * 0b10..ADMA2 is selected. - * 0b11..Reserved - */ -#define USDHC_PROT_CTRL_DMASEL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PROT_CTRL_DMASEL_SHIFT)) & USDHC_PROT_CTRL_DMASEL_MASK) - -#define USDHC_PROT_CTRL_SABGREQ_MASK (0x10000U) -#define USDHC_PROT_CTRL_SABGREQ_SHIFT (16U) -/*! SABGREQ - Stop at block gap request - * 0b1..Stop - * 0b0..Transfer - */ -#define USDHC_PROT_CTRL_SABGREQ(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PROT_CTRL_SABGREQ_SHIFT)) & USDHC_PROT_CTRL_SABGREQ_MASK) - -#define USDHC_PROT_CTRL_CREQ_MASK (0x20000U) -#define USDHC_PROT_CTRL_CREQ_SHIFT (17U) -/*! CREQ - Continue request - * 0b1..Restart - * 0b0..No effect - */ -#define USDHC_PROT_CTRL_CREQ(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PROT_CTRL_CREQ_SHIFT)) & USDHC_PROT_CTRL_CREQ_MASK) - -#define USDHC_PROT_CTRL_RWCTL_MASK (0x40000U) -#define USDHC_PROT_CTRL_RWCTL_SHIFT (18U) -/*! RWCTL - Read wait control - * 0b1..Enables read wait control and assert read wait without stopping SD clock at block gap when SABGREQ field is set - * 0b0..Disables read wait control and stop SD clock at block gap when SABGREQ field is set - */ -#define USDHC_PROT_CTRL_RWCTL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PROT_CTRL_RWCTL_SHIFT)) & USDHC_PROT_CTRL_RWCTL_MASK) - -#define USDHC_PROT_CTRL_IABG_MASK (0x80000U) -#define USDHC_PROT_CTRL_IABG_SHIFT (19U) -/*! IABG - Interrupt at block gap - * 0b1..Enables interrupt at block gap - * 0b0..Disables interrupt at block gap - */ -#define USDHC_PROT_CTRL_IABG(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PROT_CTRL_IABG_SHIFT)) & USDHC_PROT_CTRL_IABG_MASK) - -#define USDHC_PROT_CTRL_RD_DONE_NO_8CLK_MASK (0x100000U) -#define USDHC_PROT_CTRL_RD_DONE_NO_8CLK_SHIFT (20U) -/*! RD_DONE_NO_8CLK - Read performed number 8 clock */ -#define USDHC_PROT_CTRL_RD_DONE_NO_8CLK(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PROT_CTRL_RD_DONE_NO_8CLK_SHIFT)) & USDHC_PROT_CTRL_RD_DONE_NO_8CLK_MASK) - -#define USDHC_PROT_CTRL_WECINT_MASK (0x1000000U) -#define USDHC_PROT_CTRL_WECINT_SHIFT (24U) -/*! WECINT - Wakeup event enable on card interrupt - * 0b1..Enables wakeup event enable on card interrupt - * 0b0..Disables wakeup event enable on card interrupt - */ -#define USDHC_PROT_CTRL_WECINT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PROT_CTRL_WECINT_SHIFT)) & USDHC_PROT_CTRL_WECINT_MASK) - -#define USDHC_PROT_CTRL_WECINS_MASK (0x2000000U) -#define USDHC_PROT_CTRL_WECINS_SHIFT (25U) -/*! WECINS - Wakeup event enable on SD card insertion - * 0b1..Enable wakeup event enable on SD card insertion - * 0b0..Disable wakeup event enable on SD card insertion - */ -#define USDHC_PROT_CTRL_WECINS(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PROT_CTRL_WECINS_SHIFT)) & USDHC_PROT_CTRL_WECINS_MASK) - -#define USDHC_PROT_CTRL_WECRM_MASK (0x4000000U) -#define USDHC_PROT_CTRL_WECRM_SHIFT (26U) -/*! WECRM - Wakeup event enable on SD card removal - * 0b1..Enables wakeup event enable on SD card removal - * 0b0..Disables wakeup event enable on SD card removal - */ -#define USDHC_PROT_CTRL_WECRM(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PROT_CTRL_WECRM_SHIFT)) & USDHC_PROT_CTRL_WECRM_MASK) - -#define USDHC_PROT_CTRL_BURST_LEN_EN_MASK (0x38000000U) -#define USDHC_PROT_CTRL_BURST_LEN_EN_SHIFT (27U) -/*! BURST_LEN_EN - BURST length enable for INCR, INCR4 / INCR8 / INCR16, INCR4-WRAP / INCR8-WRAP / INCR16-WRAP - * 0bxx1..Burst length is enabled for INCR. - * 0bx1x..Burst length is enabled for INCR4 / INCR8 / INCR16. - * 0b1xx..Burst length is enabled for INCR4-WRAP / INCR8-WRAP / INCR16-WRAP. - */ -#define USDHC_PROT_CTRL_BURST_LEN_EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PROT_CTRL_BURST_LEN_EN_SHIFT)) & USDHC_PROT_CTRL_BURST_LEN_EN_MASK) - -#define USDHC_PROT_CTRL_NON_EXACT_BLK_RD_MASK (0x40000000U) -#define USDHC_PROT_CTRL_NON_EXACT_BLK_RD_SHIFT (30U) -/*! NON_EXACT_BLK_RD - Non-exact block read - * 0b1..The block read is non-exact block read. Host driver needs to issue abort command to terminate this multi-block read. - * 0b0..The block read is exact block read. Host driver does not need to issue abort command to terminate this multi-block read. - */ -#define USDHC_PROT_CTRL_NON_EXACT_BLK_RD(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PROT_CTRL_NON_EXACT_BLK_RD_SHIFT)) & USDHC_PROT_CTRL_NON_EXACT_BLK_RD_MASK) -/*! @} */ - -/*! @name SYS_CTRL - System Control */ -/*! @{ */ - -#define USDHC_SYS_CTRL_DVS_MASK (0xF0U) -#define USDHC_SYS_CTRL_DVS_SHIFT (4U) -/*! DVS - Divisor - * 0b0000..Divide-by-1 - * 0b0001..Divide-by-2 - * 0b1110..Divide-by-15 - * 0b1111..Divide-by-16 - */ -#define USDHC_SYS_CTRL_DVS(x) (((uint32_t)(((uint32_t)(x)) << USDHC_SYS_CTRL_DVS_SHIFT)) & USDHC_SYS_CTRL_DVS_MASK) - -#define USDHC_SYS_CTRL_SDCLKFS_MASK (0xFF00U) -#define USDHC_SYS_CTRL_SDCLKFS_SHIFT (8U) -/*! SDCLKFS - SDCLK frequency select */ -#define USDHC_SYS_CTRL_SDCLKFS(x) (((uint32_t)(((uint32_t)(x)) << USDHC_SYS_CTRL_SDCLKFS_SHIFT)) & USDHC_SYS_CTRL_SDCLKFS_MASK) - -#define USDHC_SYS_CTRL_DTOCV_MASK (0xF0000U) -#define USDHC_SYS_CTRL_DTOCV_SHIFT (16U) -/*! DTOCV - Data timeout counter value - * 0b1110..SDCLK x 2 30, recommend to use for SDR104 mode - * 0b1101..SDCLK x 2 29, recommend to use for supported speed modes except SDR104 mode - * 0b0011..SDCLK x 2 19 - * 0b0010..SDCLK x 2 18 - * 0b0001..SDCLK x 2 33 - * 0b0000..SDCLK x 2 32 - */ -#define USDHC_SYS_CTRL_DTOCV(x) (((uint32_t)(((uint32_t)(x)) << USDHC_SYS_CTRL_DTOCV_SHIFT)) & USDHC_SYS_CTRL_DTOCV_MASK) - -#define USDHC_SYS_CTRL_RST_FIFO_MASK (0x400000U) -#define USDHC_SYS_CTRL_RST_FIFO_SHIFT (22U) -/*! RST_FIFO - Reset the async FIFO */ -#define USDHC_SYS_CTRL_RST_FIFO(x) (((uint32_t)(((uint32_t)(x)) << USDHC_SYS_CTRL_RST_FIFO_SHIFT)) & USDHC_SYS_CTRL_RST_FIFO_MASK) - -#define USDHC_SYS_CTRL_IPP_RST_N_MASK (0x800000U) -#define USDHC_SYS_CTRL_IPP_RST_N_SHIFT (23U) -/*! IPP_RST_N - Hardware reset */ -#define USDHC_SYS_CTRL_IPP_RST_N(x) (((uint32_t)(((uint32_t)(x)) << USDHC_SYS_CTRL_IPP_RST_N_SHIFT)) & USDHC_SYS_CTRL_IPP_RST_N_MASK) - -#define USDHC_SYS_CTRL_RSTA_MASK (0x1000000U) -#define USDHC_SYS_CTRL_RSTA_SHIFT (24U) -/*! RSTA - Software reset for all - * 0b1..Reset - * 0b0..No reset - */ -#define USDHC_SYS_CTRL_RSTA(x) (((uint32_t)(((uint32_t)(x)) << USDHC_SYS_CTRL_RSTA_SHIFT)) & USDHC_SYS_CTRL_RSTA_MASK) - -#define USDHC_SYS_CTRL_RSTC_MASK (0x2000000U) -#define USDHC_SYS_CTRL_RSTC_SHIFT (25U) -/*! RSTC - Software reset for CMD line - * 0b1..Reset - * 0b0..No reset - */ -#define USDHC_SYS_CTRL_RSTC(x) (((uint32_t)(((uint32_t)(x)) << USDHC_SYS_CTRL_RSTC_SHIFT)) & USDHC_SYS_CTRL_RSTC_MASK) - -#define USDHC_SYS_CTRL_RSTD_MASK (0x4000000U) -#define USDHC_SYS_CTRL_RSTD_SHIFT (26U) -/*! RSTD - Software reset for data line - * 0b1..Reset - * 0b0..No reset - */ -#define USDHC_SYS_CTRL_RSTD(x) (((uint32_t)(((uint32_t)(x)) << USDHC_SYS_CTRL_RSTD_SHIFT)) & USDHC_SYS_CTRL_RSTD_MASK) - -#define USDHC_SYS_CTRL_INITA_MASK (0x8000000U) -#define USDHC_SYS_CTRL_INITA_SHIFT (27U) -/*! INITA - Initialization active */ -#define USDHC_SYS_CTRL_INITA(x) (((uint32_t)(((uint32_t)(x)) << USDHC_SYS_CTRL_INITA_SHIFT)) & USDHC_SYS_CTRL_INITA_MASK) - -#define USDHC_SYS_CTRL_RSTT_MASK (0x10000000U) -#define USDHC_SYS_CTRL_RSTT_SHIFT (28U) -/*! RSTT - Reset tuning */ -#define USDHC_SYS_CTRL_RSTT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_SYS_CTRL_RSTT_SHIFT)) & USDHC_SYS_CTRL_RSTT_MASK) -/*! @} */ - -/*! @name INT_STATUS - Interrupt Status */ -/*! @{ */ - -#define USDHC_INT_STATUS_CC_MASK (0x1U) -#define USDHC_INT_STATUS_CC_SHIFT (0U) -/*! CC - Command complete - * 0b1..Command complete - * 0b0..Command not complete - */ -#define USDHC_INT_STATUS_CC(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_CC_SHIFT)) & USDHC_INT_STATUS_CC_MASK) - -#define USDHC_INT_STATUS_TC_MASK (0x2U) -#define USDHC_INT_STATUS_TC_SHIFT (1U) -/*! TC - Transfer complete - * 0b1..Transfer complete - * 0b0..Transfer does not complete - */ -#define USDHC_INT_STATUS_TC(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_TC_SHIFT)) & USDHC_INT_STATUS_TC_MASK) - -#define USDHC_INT_STATUS_BGE_MASK (0x4U) -#define USDHC_INT_STATUS_BGE_SHIFT (2U) -/*! BGE - Block gap event - * 0b1..Transaction stopped at block gap - * 0b0..No block gap event - */ -#define USDHC_INT_STATUS_BGE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_BGE_SHIFT)) & USDHC_INT_STATUS_BGE_MASK) - -#define USDHC_INT_STATUS_DINT_MASK (0x8U) -#define USDHC_INT_STATUS_DINT_SHIFT (3U) -/*! DINT - DMA interrupt - * 0b1..DMA interrupt is generated. - * 0b0..No DMA interrupt - */ -#define USDHC_INT_STATUS_DINT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_DINT_SHIFT)) & USDHC_INT_STATUS_DINT_MASK) - -#define USDHC_INT_STATUS_BWR_MASK (0x10U) -#define USDHC_INT_STATUS_BWR_SHIFT (4U) -/*! BWR - Buffer write ready - * 0b1..Ready to write buffer - * 0b0..Not ready to write buffer - */ -#define USDHC_INT_STATUS_BWR(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_BWR_SHIFT)) & USDHC_INT_STATUS_BWR_MASK) - -#define USDHC_INT_STATUS_BRR_MASK (0x20U) -#define USDHC_INT_STATUS_BRR_SHIFT (5U) -/*! BRR - Buffer read ready - * 0b1..Ready to read buffer - * 0b0..Not ready to read buffer - */ -#define USDHC_INT_STATUS_BRR(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_BRR_SHIFT)) & USDHC_INT_STATUS_BRR_MASK) - -#define USDHC_INT_STATUS_CINS_MASK (0x40U) -#define USDHC_INT_STATUS_CINS_SHIFT (6U) -/*! CINS - Card insertion - * 0b1..Card inserted - * 0b0..Card state unstable or removed - */ -#define USDHC_INT_STATUS_CINS(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_CINS_SHIFT)) & USDHC_INT_STATUS_CINS_MASK) - -#define USDHC_INT_STATUS_CRM_MASK (0x80U) -#define USDHC_INT_STATUS_CRM_SHIFT (7U) -/*! CRM - Card removal - * 0b1..Card removed - * 0b0..Card state unstable or inserted - */ -#define USDHC_INT_STATUS_CRM(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_CRM_SHIFT)) & USDHC_INT_STATUS_CRM_MASK) - -#define USDHC_INT_STATUS_CINT_MASK (0x100U) -#define USDHC_INT_STATUS_CINT_SHIFT (8U) -/*! CINT - Card interrupt - * 0b1..Generate card interrupt - * 0b0..No card interrupt - */ -#define USDHC_INT_STATUS_CINT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_CINT_SHIFT)) & USDHC_INT_STATUS_CINT_MASK) - -#define USDHC_INT_STATUS_RTE_MASK (0x1000U) -#define USDHC_INT_STATUS_RTE_SHIFT (12U) -/*! RTE - Re-tuning event: (only for SD3.0 SDR104 mode) - * 0b1..Re-tuning should be performed. - * 0b0..Re-tuning is not required. - */ -#define USDHC_INT_STATUS_RTE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_RTE_SHIFT)) & USDHC_INT_STATUS_RTE_MASK) - -#define USDHC_INT_STATUS_TP_MASK (0x4000U) -#define USDHC_INT_STATUS_TP_SHIFT (14U) -/*! TP - Tuning pass:(only for SD3.0 SDR104 mode) */ -#define USDHC_INT_STATUS_TP(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_TP_SHIFT)) & USDHC_INT_STATUS_TP_MASK) - -#define USDHC_INT_STATUS_ERR_INT_STATUS_MASK (0x8000U) -#define USDHC_INT_STATUS_ERR_INT_STATUS_SHIFT (15U) -/*! ERR_INT_STATUS - Error Interrupt Status */ -#define USDHC_INT_STATUS_ERR_INT_STATUS(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_ERR_INT_STATUS_SHIFT)) & USDHC_INT_STATUS_ERR_INT_STATUS_MASK) - -#define USDHC_INT_STATUS_CTOE_MASK (0x10000U) -#define USDHC_INT_STATUS_CTOE_SHIFT (16U) -/*! CTOE - Command timeout error - * 0b1..Time out - * 0b0..No error - */ -#define USDHC_INT_STATUS_CTOE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_CTOE_SHIFT)) & USDHC_INT_STATUS_CTOE_MASK) - -#define USDHC_INT_STATUS_CCE_MASK (0x20000U) -#define USDHC_INT_STATUS_CCE_SHIFT (17U) -/*! CCE - Command CRC error - * 0b1..CRC error generated - * 0b0..No error - */ -#define USDHC_INT_STATUS_CCE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_CCE_SHIFT)) & USDHC_INT_STATUS_CCE_MASK) - -#define USDHC_INT_STATUS_CEBE_MASK (0x40000U) -#define USDHC_INT_STATUS_CEBE_SHIFT (18U) -/*! CEBE - Command end bit error - * 0b1..End bit error generated - * 0b0..No error - */ -#define USDHC_INT_STATUS_CEBE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_CEBE_SHIFT)) & USDHC_INT_STATUS_CEBE_MASK) - -#define USDHC_INT_STATUS_CIE_MASK (0x80000U) -#define USDHC_INT_STATUS_CIE_SHIFT (19U) -/*! CIE - Command index error - * 0b1..Error - * 0b0..No error - */ -#define USDHC_INT_STATUS_CIE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_CIE_SHIFT)) & USDHC_INT_STATUS_CIE_MASK) - -#define USDHC_INT_STATUS_DTOE_MASK (0x100000U) -#define USDHC_INT_STATUS_DTOE_SHIFT (20U) -/*! DTOE - Data timeout error - * 0b1..Time out - * 0b0..No error - */ -#define USDHC_INT_STATUS_DTOE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_DTOE_SHIFT)) & USDHC_INT_STATUS_DTOE_MASK) - -#define USDHC_INT_STATUS_DCE_MASK (0x200000U) -#define USDHC_INT_STATUS_DCE_SHIFT (21U) -/*! DCE - Data CRC error - * 0b1..Error - * 0b0..No error - */ -#define USDHC_INT_STATUS_DCE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_DCE_SHIFT)) & USDHC_INT_STATUS_DCE_MASK) - -#define USDHC_INT_STATUS_DEBE_MASK (0x400000U) -#define USDHC_INT_STATUS_DEBE_SHIFT (22U) -/*! DEBE - Data end bit error - * 0b1..Error - * 0b0..No error - */ -#define USDHC_INT_STATUS_DEBE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_DEBE_SHIFT)) & USDHC_INT_STATUS_DEBE_MASK) - -#define USDHC_INT_STATUS_AC12E_MASK (0x1000000U) -#define USDHC_INT_STATUS_AC12E_SHIFT (24U) -/*! AC12E - Auto CMD12 error - * 0b1..Error - * 0b0..No error - */ -#define USDHC_INT_STATUS_AC12E(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_AC12E_SHIFT)) & USDHC_INT_STATUS_AC12E_MASK) - -#define USDHC_INT_STATUS_TNE_MASK (0x4000000U) -#define USDHC_INT_STATUS_TNE_SHIFT (26U) -/*! TNE - Tuning error: (only for SD3.0 SDR104 mode) */ -#define USDHC_INT_STATUS_TNE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_TNE_SHIFT)) & USDHC_INT_STATUS_TNE_MASK) - -#define USDHC_INT_STATUS_DMAE_MASK (0x10000000U) -#define USDHC_INT_STATUS_DMAE_SHIFT (28U) -/*! DMAE - DMA error - * 0b1..Error - * 0b0..No error - */ -#define USDHC_INT_STATUS_DMAE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_DMAE_SHIFT)) & USDHC_INT_STATUS_DMAE_MASK) -/*! @} */ - -/*! @name INT_STATUS_EN - Interrupt Status Enable */ -/*! @{ */ - -#define USDHC_INT_STATUS_EN_CCSEN_MASK (0x1U) -#define USDHC_INT_STATUS_EN_CCSEN_SHIFT (0U) -/*! CCSEN - Command complete status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_CCSEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_CCSEN_SHIFT)) & USDHC_INT_STATUS_EN_CCSEN_MASK) - -#define USDHC_INT_STATUS_EN_TCSEN_MASK (0x2U) -#define USDHC_INT_STATUS_EN_TCSEN_SHIFT (1U) -/*! TCSEN - Transfer complete status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_TCSEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_TCSEN_SHIFT)) & USDHC_INT_STATUS_EN_TCSEN_MASK) - -#define USDHC_INT_STATUS_EN_BGESEN_MASK (0x4U) -#define USDHC_INT_STATUS_EN_BGESEN_SHIFT (2U) -/*! BGESEN - Block gap event status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_BGESEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_BGESEN_SHIFT)) & USDHC_INT_STATUS_EN_BGESEN_MASK) - -#define USDHC_INT_STATUS_EN_DINTSEN_MASK (0x8U) -#define USDHC_INT_STATUS_EN_DINTSEN_SHIFT (3U) -/*! DINTSEN - DMA interrupt status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_DINTSEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_DINTSEN_SHIFT)) & USDHC_INT_STATUS_EN_DINTSEN_MASK) - -#define USDHC_INT_STATUS_EN_BWRSEN_MASK (0x10U) -#define USDHC_INT_STATUS_EN_BWRSEN_SHIFT (4U) -/*! BWRSEN - Buffer write ready status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_BWRSEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_BWRSEN_SHIFT)) & USDHC_INT_STATUS_EN_BWRSEN_MASK) - -#define USDHC_INT_STATUS_EN_BRRSEN_MASK (0x20U) -#define USDHC_INT_STATUS_EN_BRRSEN_SHIFT (5U) -/*! BRRSEN - Buffer read ready status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_BRRSEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_BRRSEN_SHIFT)) & USDHC_INT_STATUS_EN_BRRSEN_MASK) - -#define USDHC_INT_STATUS_EN_CINSSEN_MASK (0x40U) -#define USDHC_INT_STATUS_EN_CINSSEN_SHIFT (6U) -/*! CINSSEN - Card insertion status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_CINSSEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_CINSSEN_SHIFT)) & USDHC_INT_STATUS_EN_CINSSEN_MASK) - -#define USDHC_INT_STATUS_EN_CRMSEN_MASK (0x80U) -#define USDHC_INT_STATUS_EN_CRMSEN_SHIFT (7U) -/*! CRMSEN - Card removal status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_CRMSEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_CRMSEN_SHIFT)) & USDHC_INT_STATUS_EN_CRMSEN_MASK) - -#define USDHC_INT_STATUS_EN_CINTSEN_MASK (0x100U) -#define USDHC_INT_STATUS_EN_CINTSEN_SHIFT (8U) -/*! CINTSEN - Card interrupt status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_CINTSEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_CINTSEN_SHIFT)) & USDHC_INT_STATUS_EN_CINTSEN_MASK) - -#define USDHC_INT_STATUS_EN_RTESEN_MASK (0x1000U) -#define USDHC_INT_STATUS_EN_RTESEN_SHIFT (12U) -/*! RTESEN - Re-tuning event status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_RTESEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_RTESEN_SHIFT)) & USDHC_INT_STATUS_EN_RTESEN_MASK) - -#define USDHC_INT_STATUS_EN_TPSEN_MASK (0x4000U) -#define USDHC_INT_STATUS_EN_TPSEN_SHIFT (14U) -/*! TPSEN - Tuning pass status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_TPSEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_TPSEN_SHIFT)) & USDHC_INT_STATUS_EN_TPSEN_MASK) - -#define USDHC_INT_STATUS_EN_CTOESEN_MASK (0x10000U) -#define USDHC_INT_STATUS_EN_CTOESEN_SHIFT (16U) -/*! CTOESEN - Command timeout error status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_CTOESEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_CTOESEN_SHIFT)) & USDHC_INT_STATUS_EN_CTOESEN_MASK) - -#define USDHC_INT_STATUS_EN_CCESEN_MASK (0x20000U) -#define USDHC_INT_STATUS_EN_CCESEN_SHIFT (17U) -/*! CCESEN - Command CRC error status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_CCESEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_CCESEN_SHIFT)) & USDHC_INT_STATUS_EN_CCESEN_MASK) - -#define USDHC_INT_STATUS_EN_CEBESEN_MASK (0x40000U) -#define USDHC_INT_STATUS_EN_CEBESEN_SHIFT (18U) -/*! CEBESEN - Command end bit error status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_CEBESEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_CEBESEN_SHIFT)) & USDHC_INT_STATUS_EN_CEBESEN_MASK) - -#define USDHC_INT_STATUS_EN_CIESEN_MASK (0x80000U) -#define USDHC_INT_STATUS_EN_CIESEN_SHIFT (19U) -/*! CIESEN - Command index error status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_CIESEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_CIESEN_SHIFT)) & USDHC_INT_STATUS_EN_CIESEN_MASK) - -#define USDHC_INT_STATUS_EN_DTOESEN_MASK (0x100000U) -#define USDHC_INT_STATUS_EN_DTOESEN_SHIFT (20U) -/*! DTOESEN - Data timeout error status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_DTOESEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_DTOESEN_SHIFT)) & USDHC_INT_STATUS_EN_DTOESEN_MASK) - -#define USDHC_INT_STATUS_EN_DCESEN_MASK (0x200000U) -#define USDHC_INT_STATUS_EN_DCESEN_SHIFT (21U) -/*! DCESEN - Data CRC error status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_DCESEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_DCESEN_SHIFT)) & USDHC_INT_STATUS_EN_DCESEN_MASK) - -#define USDHC_INT_STATUS_EN_DEBESEN_MASK (0x400000U) -#define USDHC_INT_STATUS_EN_DEBESEN_SHIFT (22U) -/*! DEBESEN - Data end bit error status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_DEBESEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_DEBESEN_SHIFT)) & USDHC_INT_STATUS_EN_DEBESEN_MASK) - -#define USDHC_INT_STATUS_EN_AC12ESEN_MASK (0x1000000U) -#define USDHC_INT_STATUS_EN_AC12ESEN_SHIFT (24U) -/*! AC12ESEN - Auto CMD12 error status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_AC12ESEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_AC12ESEN_SHIFT)) & USDHC_INT_STATUS_EN_AC12ESEN_MASK) - -#define USDHC_INT_STATUS_EN_TNESEN_MASK (0x4000000U) -#define USDHC_INT_STATUS_EN_TNESEN_SHIFT (26U) -/*! TNESEN - Tuning error status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_TNESEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_TNESEN_SHIFT)) & USDHC_INT_STATUS_EN_TNESEN_MASK) - -#define USDHC_INT_STATUS_EN_DMAESEN_MASK (0x10000000U) -#define USDHC_INT_STATUS_EN_DMAESEN_SHIFT (28U) -/*! DMAESEN - DMA error status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_DMAESEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_DMAESEN_SHIFT)) & USDHC_INT_STATUS_EN_DMAESEN_MASK) -/*! @} */ - -/*! @name INT_SIGNAL_EN - Interrupt Signal Enable */ -/*! @{ */ - -#define USDHC_INT_SIGNAL_EN_CCIEN_MASK (0x1U) -#define USDHC_INT_SIGNAL_EN_CCIEN_SHIFT (0U) -/*! CCIEN - Command complete interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_CCIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_CCIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_CCIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_TCIEN_MASK (0x2U) -#define USDHC_INT_SIGNAL_EN_TCIEN_SHIFT (1U) -/*! TCIEN - Transfer complete interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_TCIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_TCIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_TCIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_BGEIEN_MASK (0x4U) -#define USDHC_INT_SIGNAL_EN_BGEIEN_SHIFT (2U) -/*! BGEIEN - Block gap event interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_BGEIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_BGEIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_BGEIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_DINTIEN_MASK (0x8U) -#define USDHC_INT_SIGNAL_EN_DINTIEN_SHIFT (3U) -/*! DINTIEN - DMA interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_DINTIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_DINTIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_DINTIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_BWRIEN_MASK (0x10U) -#define USDHC_INT_SIGNAL_EN_BWRIEN_SHIFT (4U) -/*! BWRIEN - Buffer write ready interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_BWRIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_BWRIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_BWRIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_BRRIEN_MASK (0x20U) -#define USDHC_INT_SIGNAL_EN_BRRIEN_SHIFT (5U) -/*! BRRIEN - Buffer read ready interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_BRRIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_BRRIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_BRRIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_CINSIEN_MASK (0x40U) -#define USDHC_INT_SIGNAL_EN_CINSIEN_SHIFT (6U) -/*! CINSIEN - Card insertion interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_CINSIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_CINSIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_CINSIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_CRMIEN_MASK (0x80U) -#define USDHC_INT_SIGNAL_EN_CRMIEN_SHIFT (7U) -/*! CRMIEN - Card removal interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_CRMIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_CRMIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_CRMIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_CINTIEN_MASK (0x100U) -#define USDHC_INT_SIGNAL_EN_CINTIEN_SHIFT (8U) -/*! CINTIEN - Card interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_CINTIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_CINTIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_CINTIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_RTEIEN_MASK (0x1000U) -#define USDHC_INT_SIGNAL_EN_RTEIEN_SHIFT (12U) -/*! RTEIEN - Re-tuning event interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_RTEIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_RTEIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_RTEIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_TPIEN_MASK (0x4000U) -#define USDHC_INT_SIGNAL_EN_TPIEN_SHIFT (14U) -/*! TPIEN - Tuning Pass interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_TPIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_TPIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_TPIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_CTOEIEN_MASK (0x10000U) -#define USDHC_INT_SIGNAL_EN_CTOEIEN_SHIFT (16U) -/*! CTOEIEN - Command timeout error interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_CTOEIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_CTOEIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_CTOEIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_CCEIEN_MASK (0x20000U) -#define USDHC_INT_SIGNAL_EN_CCEIEN_SHIFT (17U) -/*! CCEIEN - Command CRC error interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_CCEIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_CCEIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_CCEIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_CEBEIEN_MASK (0x40000U) -#define USDHC_INT_SIGNAL_EN_CEBEIEN_SHIFT (18U) -/*! CEBEIEN - Command end bit error interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_CEBEIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_CEBEIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_CEBEIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_CIEIEN_MASK (0x80000U) -#define USDHC_INT_SIGNAL_EN_CIEIEN_SHIFT (19U) -/*! CIEIEN - Command index error interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_CIEIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_CIEIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_CIEIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_DTOEIEN_MASK (0x100000U) -#define USDHC_INT_SIGNAL_EN_DTOEIEN_SHIFT (20U) -/*! DTOEIEN - Data timeout error interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_DTOEIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_DTOEIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_DTOEIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_DCEIEN_MASK (0x200000U) -#define USDHC_INT_SIGNAL_EN_DCEIEN_SHIFT (21U) -/*! DCEIEN - Data CRC error interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_DCEIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_DCEIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_DCEIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_DEBEIEN_MASK (0x400000U) -#define USDHC_INT_SIGNAL_EN_DEBEIEN_SHIFT (22U) -/*! DEBEIEN - Data end bit error interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_DEBEIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_DEBEIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_DEBEIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_AC12EIEN_MASK (0x1000000U) -#define USDHC_INT_SIGNAL_EN_AC12EIEN_SHIFT (24U) -/*! AC12EIEN - Auto CMD12 error interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_AC12EIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_AC12EIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_AC12EIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_TNEIEN_MASK (0x4000000U) -#define USDHC_INT_SIGNAL_EN_TNEIEN_SHIFT (26U) -/*! TNEIEN - Tuning error interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_TNEIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_TNEIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_TNEIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_DMAEIEN_MASK (0x10000000U) -#define USDHC_INT_SIGNAL_EN_DMAEIEN_SHIFT (28U) -/*! DMAEIEN - DMA error interrupt enable - * 0b1..Enable - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_DMAEIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_DMAEIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_DMAEIEN_MASK) -/*! @} */ - -/*! @name AUTOCMD12_ERR_STATUS - Auto CMD12 Error Status */ -/*! @{ */ - -#define USDHC_AUTOCMD12_ERR_STATUS_AC12NE_MASK (0x1U) -#define USDHC_AUTOCMD12_ERR_STATUS_AC12NE_SHIFT (0U) -/*! AC12NE - Auto CMD12 not executed - * 0b1..Not executed - * 0b0..Executed - */ -#define USDHC_AUTOCMD12_ERR_STATUS_AC12NE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_AUTOCMD12_ERR_STATUS_AC12NE_SHIFT)) & USDHC_AUTOCMD12_ERR_STATUS_AC12NE_MASK) - -#define USDHC_AUTOCMD12_ERR_STATUS_AC12TOE_MASK (0x2U) -#define USDHC_AUTOCMD12_ERR_STATUS_AC12TOE_SHIFT (1U) -/*! AC12TOE - Auto CMD12 / 23 timeout error - * 0b1..Time out - * 0b0..No error - */ -#define USDHC_AUTOCMD12_ERR_STATUS_AC12TOE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_AUTOCMD12_ERR_STATUS_AC12TOE_SHIFT)) & USDHC_AUTOCMD12_ERR_STATUS_AC12TOE_MASK) - -#define USDHC_AUTOCMD12_ERR_STATUS_AC12CE_MASK (0x4U) -#define USDHC_AUTOCMD12_ERR_STATUS_AC12CE_SHIFT (2U) -/*! AC12CE - Auto CMD12 / 23 CRC error - * 0b1..CRC error met in Auto CMD12/23 response - * 0b0..No CRC error - */ -#define USDHC_AUTOCMD12_ERR_STATUS_AC12CE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_AUTOCMD12_ERR_STATUS_AC12CE_SHIFT)) & USDHC_AUTOCMD12_ERR_STATUS_AC12CE_MASK) - -#define USDHC_AUTOCMD12_ERR_STATUS_AC12EBE_MASK (0x8U) -#define USDHC_AUTOCMD12_ERR_STATUS_AC12EBE_SHIFT (3U) -/*! AC12EBE - Auto CMD12 / 23 end bit error - * 0b1..End bit error generated - * 0b0..No error - */ -#define USDHC_AUTOCMD12_ERR_STATUS_AC12EBE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_AUTOCMD12_ERR_STATUS_AC12EBE_SHIFT)) & USDHC_AUTOCMD12_ERR_STATUS_AC12EBE_MASK) - -#define USDHC_AUTOCMD12_ERR_STATUS_AC12IE_MASK (0x10U) -#define USDHC_AUTOCMD12_ERR_STATUS_AC12IE_SHIFT (4U) -/*! AC12IE - Auto CMD12 / 23 index error - * 0b1..Error, the CMD index in response is not CMD12/23 - * 0b0..No error - */ -#define USDHC_AUTOCMD12_ERR_STATUS_AC12IE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_AUTOCMD12_ERR_STATUS_AC12IE_SHIFT)) & USDHC_AUTOCMD12_ERR_STATUS_AC12IE_MASK) - -#define USDHC_AUTOCMD12_ERR_STATUS_CNIBAC12E_MASK (0x80U) -#define USDHC_AUTOCMD12_ERR_STATUS_CNIBAC12E_SHIFT (7U) -/*! CNIBAC12E - Command not issued by Auto CMD12 error - * 0b1..Not issued - * 0b0..No error - */ -#define USDHC_AUTOCMD12_ERR_STATUS_CNIBAC12E(x) (((uint32_t)(((uint32_t)(x)) << USDHC_AUTOCMD12_ERR_STATUS_CNIBAC12E_SHIFT)) & USDHC_AUTOCMD12_ERR_STATUS_CNIBAC12E_MASK) - -#define USDHC_AUTOCMD12_ERR_STATUS_EXECUTE_TUNING_MASK (0x400000U) -#define USDHC_AUTOCMD12_ERR_STATUS_EXECUTE_TUNING_SHIFT (22U) -/*! EXECUTE_TUNING - Execute tuning - * 0b1..Start tuning procedure - * 0b0..Tuning procedure is aborted - */ -#define USDHC_AUTOCMD12_ERR_STATUS_EXECUTE_TUNING(x) (((uint32_t)(((uint32_t)(x)) << USDHC_AUTOCMD12_ERR_STATUS_EXECUTE_TUNING_SHIFT)) & USDHC_AUTOCMD12_ERR_STATUS_EXECUTE_TUNING_MASK) - -#define USDHC_AUTOCMD12_ERR_STATUS_SMP_CLK_SEL_MASK (0x800000U) -#define USDHC_AUTOCMD12_ERR_STATUS_SMP_CLK_SEL_SHIFT (23U) -/*! SMP_CLK_SEL - Sample clock select - * 0b1..Tuned clock is used to sample data - * 0b0..Fixed clock is used to sample data - */ -#define USDHC_AUTOCMD12_ERR_STATUS_SMP_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_AUTOCMD12_ERR_STATUS_SMP_CLK_SEL_SHIFT)) & USDHC_AUTOCMD12_ERR_STATUS_SMP_CLK_SEL_MASK) -/*! @} */ - -/*! @name HOST_CTRL_CAP - Host Controller Capabilities */ -/*! @{ */ - -#define USDHC_HOST_CTRL_CAP_SDR50_SUPPORT_MASK (0x1U) -#define USDHC_HOST_CTRL_CAP_SDR50_SUPPORT_SHIFT (0U) -/*! SDR50_SUPPORT - SDR50 support */ -#define USDHC_HOST_CTRL_CAP_SDR50_SUPPORT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_HOST_CTRL_CAP_SDR50_SUPPORT_SHIFT)) & USDHC_HOST_CTRL_CAP_SDR50_SUPPORT_MASK) - -#define USDHC_HOST_CTRL_CAP_SDR104_SUPPORT_MASK (0x2U) -#define USDHC_HOST_CTRL_CAP_SDR104_SUPPORT_SHIFT (1U) -/*! SDR104_SUPPORT - SDR104 support */ -#define USDHC_HOST_CTRL_CAP_SDR104_SUPPORT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_HOST_CTRL_CAP_SDR104_SUPPORT_SHIFT)) & USDHC_HOST_CTRL_CAP_SDR104_SUPPORT_MASK) - -#define USDHC_HOST_CTRL_CAP_DDR50_SUPPORT_MASK (0x4U) -#define USDHC_HOST_CTRL_CAP_DDR50_SUPPORT_SHIFT (2U) -/*! DDR50_SUPPORT - DDR50 support */ -#define USDHC_HOST_CTRL_CAP_DDR50_SUPPORT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_HOST_CTRL_CAP_DDR50_SUPPORT_SHIFT)) & USDHC_HOST_CTRL_CAP_DDR50_SUPPORT_MASK) - -#define USDHC_HOST_CTRL_CAP_USE_TUNING_SDR50_MASK (0x2000U) -#define USDHC_HOST_CTRL_CAP_USE_TUNING_SDR50_SHIFT (13U) -/*! USE_TUNING_SDR50 - Use Tuning for SDR50 - * 0b1..SDR50 supports tuning - * 0b0..SDR50 does not support tuning - */ -#define USDHC_HOST_CTRL_CAP_USE_TUNING_SDR50(x) (((uint32_t)(((uint32_t)(x)) << USDHC_HOST_CTRL_CAP_USE_TUNING_SDR50_SHIFT)) & USDHC_HOST_CTRL_CAP_USE_TUNING_SDR50_MASK) - -#define USDHC_HOST_CTRL_CAP_MBL_MASK (0x70000U) -#define USDHC_HOST_CTRL_CAP_MBL_SHIFT (16U) -/*! MBL - Max block length - * 0b000..512 bytes - * 0b001..1024 bytes - * 0b010..2048 bytes - * 0b011..4096 bytes - */ -#define USDHC_HOST_CTRL_CAP_MBL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_HOST_CTRL_CAP_MBL_SHIFT)) & USDHC_HOST_CTRL_CAP_MBL_MASK) - -#define USDHC_HOST_CTRL_CAP_ADMAS_MASK (0x100000U) -#define USDHC_HOST_CTRL_CAP_ADMAS_SHIFT (20U) -/*! ADMAS - ADMA support - * 0b1..Advanced DMA supported - * 0b0..Advanced DMA not supported - */ -#define USDHC_HOST_CTRL_CAP_ADMAS(x) (((uint32_t)(((uint32_t)(x)) << USDHC_HOST_CTRL_CAP_ADMAS_SHIFT)) & USDHC_HOST_CTRL_CAP_ADMAS_MASK) - -#define USDHC_HOST_CTRL_CAP_HSS_MASK (0x200000U) -#define USDHC_HOST_CTRL_CAP_HSS_SHIFT (21U) -/*! HSS - High speed support - * 0b1..High speed supported - * 0b0..High speed not supported - */ -#define USDHC_HOST_CTRL_CAP_HSS(x) (((uint32_t)(((uint32_t)(x)) << USDHC_HOST_CTRL_CAP_HSS_SHIFT)) & USDHC_HOST_CTRL_CAP_HSS_MASK) - -#define USDHC_HOST_CTRL_CAP_DMAS_MASK (0x400000U) -#define USDHC_HOST_CTRL_CAP_DMAS_SHIFT (22U) -/*! DMAS - DMA support - * 0b1..DMA supported - * 0b0..DMA not supported - */ -#define USDHC_HOST_CTRL_CAP_DMAS(x) (((uint32_t)(((uint32_t)(x)) << USDHC_HOST_CTRL_CAP_DMAS_SHIFT)) & USDHC_HOST_CTRL_CAP_DMAS_MASK) - -#define USDHC_HOST_CTRL_CAP_SRS_MASK (0x800000U) -#define USDHC_HOST_CTRL_CAP_SRS_SHIFT (23U) -/*! SRS - Suspend / resume support - * 0b1..Supported - * 0b0..Not supported - */ -#define USDHC_HOST_CTRL_CAP_SRS(x) (((uint32_t)(((uint32_t)(x)) << USDHC_HOST_CTRL_CAP_SRS_SHIFT)) & USDHC_HOST_CTRL_CAP_SRS_MASK) - -#define USDHC_HOST_CTRL_CAP_VS33_MASK (0x1000000U) -#define USDHC_HOST_CTRL_CAP_VS33_SHIFT (24U) -/*! VS33 - Voltage support 3.3 V - * 0b1..3.3 V supported - * 0b0..3.3 V not supported - */ -#define USDHC_HOST_CTRL_CAP_VS33(x) (((uint32_t)(((uint32_t)(x)) << USDHC_HOST_CTRL_CAP_VS33_SHIFT)) & USDHC_HOST_CTRL_CAP_VS33_MASK) - -#define USDHC_HOST_CTRL_CAP_VS30_MASK (0x2000000U) -#define USDHC_HOST_CTRL_CAP_VS30_SHIFT (25U) -/*! VS30 - Voltage support 3.0 V - * 0b1..3.0 V supported - * 0b0..3.0 V not supported - */ -#define USDHC_HOST_CTRL_CAP_VS30(x) (((uint32_t)(((uint32_t)(x)) << USDHC_HOST_CTRL_CAP_VS30_SHIFT)) & USDHC_HOST_CTRL_CAP_VS30_MASK) - -#define USDHC_HOST_CTRL_CAP_VS18_MASK (0x4000000U) -#define USDHC_HOST_CTRL_CAP_VS18_SHIFT (26U) -/*! VS18 - Voltage support 1.8 V - * 0b1..1.8 V supported - * 0b0..1.8 V not supported - */ -#define USDHC_HOST_CTRL_CAP_VS18(x) (((uint32_t)(((uint32_t)(x)) << USDHC_HOST_CTRL_CAP_VS18_SHIFT)) & USDHC_HOST_CTRL_CAP_VS18_MASK) -/*! @} */ - -/*! @name WTMK_LVL - Watermark Level */ -/*! @{ */ - -#define USDHC_WTMK_LVL_RD_WML_MASK (0xFFU) -#define USDHC_WTMK_LVL_RD_WML_SHIFT (0U) -/*! RD_WML - Read watermark level */ -#define USDHC_WTMK_LVL_RD_WML(x) (((uint32_t)(((uint32_t)(x)) << USDHC_WTMK_LVL_RD_WML_SHIFT)) & USDHC_WTMK_LVL_RD_WML_MASK) - -#define USDHC_WTMK_LVL_RD_BRST_LEN_MASK (0x1F00U) -#define USDHC_WTMK_LVL_RD_BRST_LEN_SHIFT (8U) -/*! RD_BRST_LEN - Read burst length due to system restriction, the actual burst length might not exceed 16 */ -#define USDHC_WTMK_LVL_RD_BRST_LEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_WTMK_LVL_RD_BRST_LEN_SHIFT)) & USDHC_WTMK_LVL_RD_BRST_LEN_MASK) - -#define USDHC_WTMK_LVL_WR_WML_MASK (0xFF0000U) -#define USDHC_WTMK_LVL_WR_WML_SHIFT (16U) -/*! WR_WML - Write watermark level */ -#define USDHC_WTMK_LVL_WR_WML(x) (((uint32_t)(((uint32_t)(x)) << USDHC_WTMK_LVL_WR_WML_SHIFT)) & USDHC_WTMK_LVL_WR_WML_MASK) - -#define USDHC_WTMK_LVL_WR_BRST_LEN_MASK (0x1F000000U) -#define USDHC_WTMK_LVL_WR_BRST_LEN_SHIFT (24U) -/*! WR_BRST_LEN - Write burst length due to system restriction, the actual burst length might not exceed 16 */ -#define USDHC_WTMK_LVL_WR_BRST_LEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_WTMK_LVL_WR_BRST_LEN_SHIFT)) & USDHC_WTMK_LVL_WR_BRST_LEN_MASK) -/*! @} */ - -/*! @name MIX_CTRL - Mixer Control */ -/*! @{ */ - -#define USDHC_MIX_CTRL_DMAEN_MASK (0x1U) -#define USDHC_MIX_CTRL_DMAEN_SHIFT (0U) -/*! DMAEN - DMA enable - * 0b1..Enable - * 0b0..Disable - */ -#define USDHC_MIX_CTRL_DMAEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MIX_CTRL_DMAEN_SHIFT)) & USDHC_MIX_CTRL_DMAEN_MASK) - -#define USDHC_MIX_CTRL_BCEN_MASK (0x2U) -#define USDHC_MIX_CTRL_BCEN_SHIFT (1U) -/*! BCEN - Block count enable - * 0b1..Enable - * 0b0..Disable - */ -#define USDHC_MIX_CTRL_BCEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MIX_CTRL_BCEN_SHIFT)) & USDHC_MIX_CTRL_BCEN_MASK) - -#define USDHC_MIX_CTRL_AC12EN_MASK (0x4U) -#define USDHC_MIX_CTRL_AC12EN_SHIFT (2U) -/*! AC12EN - Auto CMD12 enable - * 0b1..Enable - * 0b0..Disable - */ -#define USDHC_MIX_CTRL_AC12EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MIX_CTRL_AC12EN_SHIFT)) & USDHC_MIX_CTRL_AC12EN_MASK) - -#define USDHC_MIX_CTRL_DDR_EN_MASK (0x8U) -#define USDHC_MIX_CTRL_DDR_EN_SHIFT (3U) -/*! DDR_EN - Dual data rate mode selection */ -#define USDHC_MIX_CTRL_DDR_EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MIX_CTRL_DDR_EN_SHIFT)) & USDHC_MIX_CTRL_DDR_EN_MASK) - -#define USDHC_MIX_CTRL_DTDSEL_MASK (0x10U) -#define USDHC_MIX_CTRL_DTDSEL_SHIFT (4U) -/*! DTDSEL - Data transfer direction select - * 0b1..Read (Card to host) - * 0b0..Write (Host to card) - */ -#define USDHC_MIX_CTRL_DTDSEL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MIX_CTRL_DTDSEL_SHIFT)) & USDHC_MIX_CTRL_DTDSEL_MASK) - -#define USDHC_MIX_CTRL_MSBSEL_MASK (0x20U) -#define USDHC_MIX_CTRL_MSBSEL_SHIFT (5U) -/*! MSBSEL - Multi / Single block select - * 0b1..Multiple blocks - * 0b0..Single block - */ -#define USDHC_MIX_CTRL_MSBSEL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MIX_CTRL_MSBSEL_SHIFT)) & USDHC_MIX_CTRL_MSBSEL_MASK) - -#define USDHC_MIX_CTRL_NIBBLE_POS_MASK (0x40U) -#define USDHC_MIX_CTRL_NIBBLE_POS_SHIFT (6U) -/*! NIBBLE_POS - Nibble position indication */ -#define USDHC_MIX_CTRL_NIBBLE_POS(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MIX_CTRL_NIBBLE_POS_SHIFT)) & USDHC_MIX_CTRL_NIBBLE_POS_MASK) - -#define USDHC_MIX_CTRL_AC23EN_MASK (0x80U) -#define USDHC_MIX_CTRL_AC23EN_SHIFT (7U) -/*! AC23EN - Auto CMD23 enable */ -#define USDHC_MIX_CTRL_AC23EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MIX_CTRL_AC23EN_SHIFT)) & USDHC_MIX_CTRL_AC23EN_MASK) - -#define USDHC_MIX_CTRL_EXE_TUNE_MASK (0x400000U) -#define USDHC_MIX_CTRL_EXE_TUNE_SHIFT (22U) -/*! EXE_TUNE - Execute tuning: (Only used for SD3.0, SDR104 mode) - * 0b1..Execute tuning - * 0b0..Not tuned or tuning completed - */ -#define USDHC_MIX_CTRL_EXE_TUNE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MIX_CTRL_EXE_TUNE_SHIFT)) & USDHC_MIX_CTRL_EXE_TUNE_MASK) - -#define USDHC_MIX_CTRL_SMP_CLK_SEL_MASK (0x800000U) -#define USDHC_MIX_CTRL_SMP_CLK_SEL_SHIFT (23U) -/*! SMP_CLK_SEL - Clock selection - * 0b1..Tuned clock is used to sample data / cmd - * 0b0..Fixed clock is used to sample data / cmd - */ -#define USDHC_MIX_CTRL_SMP_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MIX_CTRL_SMP_CLK_SEL_SHIFT)) & USDHC_MIX_CTRL_SMP_CLK_SEL_MASK) - -#define USDHC_MIX_CTRL_AUTO_TUNE_EN_MASK (0x1000000U) -#define USDHC_MIX_CTRL_AUTO_TUNE_EN_SHIFT (24U) -/*! AUTO_TUNE_EN - Auto tuning enable (Only used for SD3.0, SDR104 mode) - * 0b1..Enable auto tuning - * 0b0..Disable auto tuning - */ -#define USDHC_MIX_CTRL_AUTO_TUNE_EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MIX_CTRL_AUTO_TUNE_EN_SHIFT)) & USDHC_MIX_CTRL_AUTO_TUNE_EN_MASK) - -#define USDHC_MIX_CTRL_FBCLK_SEL_MASK (0x2000000U) -#define USDHC_MIX_CTRL_FBCLK_SEL_SHIFT (25U) -/*! FBCLK_SEL - Feedback clock source selection (Only used for SD3.0, SDR104 mode) - * 0b1..Feedback clock comes from the ipp_card_clk_out - * 0b0..Feedback clock comes from the loopback CLK - */ -#define USDHC_MIX_CTRL_FBCLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MIX_CTRL_FBCLK_SEL_SHIFT)) & USDHC_MIX_CTRL_FBCLK_SEL_MASK) -/*! @} */ - -/*! @name FORCE_EVENT - Force Event */ -/*! @{ */ - -#define USDHC_FORCE_EVENT_FEVTAC12NE_MASK (0x1U) -#define USDHC_FORCE_EVENT_FEVTAC12NE_SHIFT (0U) -/*! FEVTAC12NE - Force event auto command 12 not executed */ -#define USDHC_FORCE_EVENT_FEVTAC12NE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTAC12NE_SHIFT)) & USDHC_FORCE_EVENT_FEVTAC12NE_MASK) - -#define USDHC_FORCE_EVENT_FEVTAC12TOE_MASK (0x2U) -#define USDHC_FORCE_EVENT_FEVTAC12TOE_SHIFT (1U) -/*! FEVTAC12TOE - Force event auto command 12 time out error */ -#define USDHC_FORCE_EVENT_FEVTAC12TOE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTAC12TOE_SHIFT)) & USDHC_FORCE_EVENT_FEVTAC12TOE_MASK) - -#define USDHC_FORCE_EVENT_FEVTAC12CE_MASK (0x4U) -#define USDHC_FORCE_EVENT_FEVTAC12CE_SHIFT (2U) -/*! FEVTAC12CE - Force event auto command 12 CRC error */ -#define USDHC_FORCE_EVENT_FEVTAC12CE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTAC12CE_SHIFT)) & USDHC_FORCE_EVENT_FEVTAC12CE_MASK) - -#define USDHC_FORCE_EVENT_FEVTAC12EBE_MASK (0x8U) -#define USDHC_FORCE_EVENT_FEVTAC12EBE_SHIFT (3U) -/*! FEVTAC12EBE - Force event Auto Command 12 end bit error */ -#define USDHC_FORCE_EVENT_FEVTAC12EBE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTAC12EBE_SHIFT)) & USDHC_FORCE_EVENT_FEVTAC12EBE_MASK) - -#define USDHC_FORCE_EVENT_FEVTAC12IE_MASK (0x10U) -#define USDHC_FORCE_EVENT_FEVTAC12IE_SHIFT (4U) -/*! FEVTAC12IE - Force event Auto Command 12 index error */ -#define USDHC_FORCE_EVENT_FEVTAC12IE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTAC12IE_SHIFT)) & USDHC_FORCE_EVENT_FEVTAC12IE_MASK) - -#define USDHC_FORCE_EVENT_FEVTCNIBAC12E_MASK (0x80U) -#define USDHC_FORCE_EVENT_FEVTCNIBAC12E_SHIFT (7U) -/*! FEVTCNIBAC12E - Force event command not executed by Auto Command 12 error */ -#define USDHC_FORCE_EVENT_FEVTCNIBAC12E(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTCNIBAC12E_SHIFT)) & USDHC_FORCE_EVENT_FEVTCNIBAC12E_MASK) - -#define USDHC_FORCE_EVENT_FEVTCTOE_MASK (0x10000U) -#define USDHC_FORCE_EVENT_FEVTCTOE_SHIFT (16U) -/*! FEVTCTOE - Force event command time out error */ -#define USDHC_FORCE_EVENT_FEVTCTOE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTCTOE_SHIFT)) & USDHC_FORCE_EVENT_FEVTCTOE_MASK) - -#define USDHC_FORCE_EVENT_FEVTCCE_MASK (0x20000U) -#define USDHC_FORCE_EVENT_FEVTCCE_SHIFT (17U) -/*! FEVTCCE - Force event command CRC error */ -#define USDHC_FORCE_EVENT_FEVTCCE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTCCE_SHIFT)) & USDHC_FORCE_EVENT_FEVTCCE_MASK) - -#define USDHC_FORCE_EVENT_FEVTCEBE_MASK (0x40000U) -#define USDHC_FORCE_EVENT_FEVTCEBE_SHIFT (18U) -/*! FEVTCEBE - Force event command end bit error */ -#define USDHC_FORCE_EVENT_FEVTCEBE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTCEBE_SHIFT)) & USDHC_FORCE_EVENT_FEVTCEBE_MASK) - -#define USDHC_FORCE_EVENT_FEVTCIE_MASK (0x80000U) -#define USDHC_FORCE_EVENT_FEVTCIE_SHIFT (19U) -/*! FEVTCIE - Force event command index error */ -#define USDHC_FORCE_EVENT_FEVTCIE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTCIE_SHIFT)) & USDHC_FORCE_EVENT_FEVTCIE_MASK) - -#define USDHC_FORCE_EVENT_FEVTDTOE_MASK (0x100000U) -#define USDHC_FORCE_EVENT_FEVTDTOE_SHIFT (20U) -/*! FEVTDTOE - Force event data time out error */ -#define USDHC_FORCE_EVENT_FEVTDTOE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTDTOE_SHIFT)) & USDHC_FORCE_EVENT_FEVTDTOE_MASK) - -#define USDHC_FORCE_EVENT_FEVTDCE_MASK (0x200000U) -#define USDHC_FORCE_EVENT_FEVTDCE_SHIFT (21U) -/*! FEVTDCE - Force event data CRC error */ -#define USDHC_FORCE_EVENT_FEVTDCE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTDCE_SHIFT)) & USDHC_FORCE_EVENT_FEVTDCE_MASK) - -#define USDHC_FORCE_EVENT_FEVTDEBE_MASK (0x400000U) -#define USDHC_FORCE_EVENT_FEVTDEBE_SHIFT (22U) -/*! FEVTDEBE - Force event data end bit error */ -#define USDHC_FORCE_EVENT_FEVTDEBE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTDEBE_SHIFT)) & USDHC_FORCE_EVENT_FEVTDEBE_MASK) - -#define USDHC_FORCE_EVENT_FEVTAC12E_MASK (0x1000000U) -#define USDHC_FORCE_EVENT_FEVTAC12E_SHIFT (24U) -/*! FEVTAC12E - Force event Auto Command 12 error */ -#define USDHC_FORCE_EVENT_FEVTAC12E(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTAC12E_SHIFT)) & USDHC_FORCE_EVENT_FEVTAC12E_MASK) - -#define USDHC_FORCE_EVENT_FEVTTNE_MASK (0x4000000U) -#define USDHC_FORCE_EVENT_FEVTTNE_SHIFT (26U) -/*! FEVTTNE - Force tuning error */ -#define USDHC_FORCE_EVENT_FEVTTNE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTTNE_SHIFT)) & USDHC_FORCE_EVENT_FEVTTNE_MASK) - -#define USDHC_FORCE_EVENT_FEVTDMAE_MASK (0x10000000U) -#define USDHC_FORCE_EVENT_FEVTDMAE_SHIFT (28U) -/*! FEVTDMAE - Force event DMA error */ -#define USDHC_FORCE_EVENT_FEVTDMAE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTDMAE_SHIFT)) & USDHC_FORCE_EVENT_FEVTDMAE_MASK) - -#define USDHC_FORCE_EVENT_FEVTCINT_MASK (0x80000000U) -#define USDHC_FORCE_EVENT_FEVTCINT_SHIFT (31U) -/*! FEVTCINT - Force event card interrupt */ -#define USDHC_FORCE_EVENT_FEVTCINT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTCINT_SHIFT)) & USDHC_FORCE_EVENT_FEVTCINT_MASK) -/*! @} */ - -/*! @name ADMA_ERR_STATUS - ADMA Error Status */ -/*! @{ */ - -#define USDHC_ADMA_ERR_STATUS_ADMAES_MASK (0x3U) -#define USDHC_ADMA_ERR_STATUS_ADMAES_SHIFT (0U) -/*! ADMAES - ADMA error state (when ADMA error is occurred) */ -#define USDHC_ADMA_ERR_STATUS_ADMAES(x) (((uint32_t)(((uint32_t)(x)) << USDHC_ADMA_ERR_STATUS_ADMAES_SHIFT)) & USDHC_ADMA_ERR_STATUS_ADMAES_MASK) - -#define USDHC_ADMA_ERR_STATUS_ADMALME_MASK (0x4U) -#define USDHC_ADMA_ERR_STATUS_ADMALME_SHIFT (2U) -/*! ADMALME - ADMA length mismatch error - * 0b1..Error - * 0b0..No error - */ -#define USDHC_ADMA_ERR_STATUS_ADMALME(x) (((uint32_t)(((uint32_t)(x)) << USDHC_ADMA_ERR_STATUS_ADMALME_SHIFT)) & USDHC_ADMA_ERR_STATUS_ADMALME_MASK) - -#define USDHC_ADMA_ERR_STATUS_ADMADCE_MASK (0x8U) -#define USDHC_ADMA_ERR_STATUS_ADMADCE_SHIFT (3U) -/*! ADMADCE - ADMA descriptor error - * 0b1..Error - * 0b0..No error - */ -#define USDHC_ADMA_ERR_STATUS_ADMADCE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_ADMA_ERR_STATUS_ADMADCE_SHIFT)) & USDHC_ADMA_ERR_STATUS_ADMADCE_MASK) -/*! @} */ - -/*! @name ADMA_SYS_ADDR - ADMA System Address */ -/*! @{ */ - -#define USDHC_ADMA_SYS_ADDR_ADS_ADDR_MASK (0xFFFFFFFCU) -#define USDHC_ADMA_SYS_ADDR_ADS_ADDR_SHIFT (2U) -/*! ADS_ADDR - ADMA system address */ -#define USDHC_ADMA_SYS_ADDR_ADS_ADDR(x) (((uint32_t)(((uint32_t)(x)) << USDHC_ADMA_SYS_ADDR_ADS_ADDR_SHIFT)) & USDHC_ADMA_SYS_ADDR_ADS_ADDR_MASK) -/*! @} */ - -/*! @name DLL_CTRL - DLL (Delay Line) Control */ -/*! @{ */ - -#define USDHC_DLL_CTRL_DLL_CTRL_ENABLE_MASK (0x1U) -#define USDHC_DLL_CTRL_DLL_CTRL_ENABLE_SHIFT (0U) -/*! DLL_CTRL_ENABLE - DLL and delay chain */ -#define USDHC_DLL_CTRL_DLL_CTRL_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DLL_CTRL_DLL_CTRL_ENABLE_SHIFT)) & USDHC_DLL_CTRL_DLL_CTRL_ENABLE_MASK) - -#define USDHC_DLL_CTRL_DLL_CTRL_RESET_MASK (0x2U) -#define USDHC_DLL_CTRL_DLL_CTRL_RESET_SHIFT (1U) -/*! DLL_CTRL_RESET - DLL reset */ -#define USDHC_DLL_CTRL_DLL_CTRL_RESET(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DLL_CTRL_DLL_CTRL_RESET_SHIFT)) & USDHC_DLL_CTRL_DLL_CTRL_RESET_MASK) - -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_FORCE_UPD_MASK (0x4U) -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_FORCE_UPD_SHIFT (2U) -/*! DLL_CTRL_SLV_FORCE_UPD - DLL slave delay line */ -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_FORCE_UPD(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DLL_CTRL_DLL_CTRL_SLV_FORCE_UPD_SHIFT)) & USDHC_DLL_CTRL_DLL_CTRL_SLV_FORCE_UPD_MASK) - -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET0_MASK (0x78U) -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET0_SHIFT (3U) -/*! DLL_CTRL_SLV_DLY_TARGET0 - DLL slave delay target0 */ -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET0(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET0_SHIFT)) & USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET0_MASK) - -#define USDHC_DLL_CTRL_DLL_CTRL_GATE_UPDATE_MASK (0x80U) -#define USDHC_DLL_CTRL_DLL_CTRL_GATE_UPDATE_SHIFT (7U) -/*! DLL_CTRL_GATE_UPDATE - DLL gate update */ -#define USDHC_DLL_CTRL_DLL_CTRL_GATE_UPDATE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DLL_CTRL_DLL_CTRL_GATE_UPDATE_SHIFT)) & USDHC_DLL_CTRL_DLL_CTRL_GATE_UPDATE_MASK) - -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_MASK (0x100U) -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_SHIFT (8U) -/*! DLL_CTRL_SLV_OVERRIDE - DLL slave override */ -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_SHIFT)) & USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_MASK) - -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_VAL_MASK (0xFE00U) -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_VAL_SHIFT (9U) -/*! DLL_CTRL_SLV_OVERRIDE_VAL - DLL slave override val */ -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_VAL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_VAL_SHIFT)) & USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_VAL_MASK) - -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET1_MASK (0x70000U) -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET1_SHIFT (16U) -/*! DLL_CTRL_SLV_DLY_TARGET1 - DLL slave delay target1 */ -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET1(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET1_SHIFT)) & USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET1_MASK) - -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_UPDATE_INT_MASK (0xFF00000U) -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_UPDATE_INT_SHIFT (20U) -/*! DLL_CTRL_SLV_UPDATE_INT - Slave delay line update interval */ -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_UPDATE_INT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DLL_CTRL_DLL_CTRL_SLV_UPDATE_INT_SHIFT)) & USDHC_DLL_CTRL_DLL_CTRL_SLV_UPDATE_INT_MASK) - -#define USDHC_DLL_CTRL_DLL_CTRL_REF_UPDATE_INT_MASK (0xF0000000U) -#define USDHC_DLL_CTRL_DLL_CTRL_REF_UPDATE_INT_SHIFT (28U) -/*! DLL_CTRL_REF_UPDATE_INT - DLL control loop update interval */ -#define USDHC_DLL_CTRL_DLL_CTRL_REF_UPDATE_INT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DLL_CTRL_DLL_CTRL_REF_UPDATE_INT_SHIFT)) & USDHC_DLL_CTRL_DLL_CTRL_REF_UPDATE_INT_MASK) -/*! @} */ - -/*! @name DLL_STATUS - DLL Status */ -/*! @{ */ - -#define USDHC_DLL_STATUS_DLL_STS_SLV_LOCK_MASK (0x1U) -#define USDHC_DLL_STATUS_DLL_STS_SLV_LOCK_SHIFT (0U) -/*! DLL_STS_SLV_LOCK - Slave delay-line lock status */ -#define USDHC_DLL_STATUS_DLL_STS_SLV_LOCK(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DLL_STATUS_DLL_STS_SLV_LOCK_SHIFT)) & USDHC_DLL_STATUS_DLL_STS_SLV_LOCK_MASK) - -#define USDHC_DLL_STATUS_DLL_STS_REF_LOCK_MASK (0x2U) -#define USDHC_DLL_STATUS_DLL_STS_REF_LOCK_SHIFT (1U) -/*! DLL_STS_REF_LOCK - Reference DLL lock status */ -#define USDHC_DLL_STATUS_DLL_STS_REF_LOCK(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DLL_STATUS_DLL_STS_REF_LOCK_SHIFT)) & USDHC_DLL_STATUS_DLL_STS_REF_LOCK_MASK) - -#define USDHC_DLL_STATUS_DLL_STS_SLV_SEL_MASK (0x1FCU) -#define USDHC_DLL_STATUS_DLL_STS_SLV_SEL_SHIFT (2U) -/*! DLL_STS_SLV_SEL - Slave delay line select status */ -#define USDHC_DLL_STATUS_DLL_STS_SLV_SEL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DLL_STATUS_DLL_STS_SLV_SEL_SHIFT)) & USDHC_DLL_STATUS_DLL_STS_SLV_SEL_MASK) - -#define USDHC_DLL_STATUS_DLL_STS_REF_SEL_MASK (0xFE00U) -#define USDHC_DLL_STATUS_DLL_STS_REF_SEL_SHIFT (9U) -/*! DLL_STS_REF_SEL - Reference delay line select taps */ -#define USDHC_DLL_STATUS_DLL_STS_REF_SEL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DLL_STATUS_DLL_STS_REF_SEL_SHIFT)) & USDHC_DLL_STATUS_DLL_STS_REF_SEL_MASK) -/*! @} */ - -/*! @name CLK_TUNE_CTRL_STATUS - CLK Tuning Control and Status */ -/*! @{ */ - -#define USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_POST_MASK (0xFU) -#define USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_POST_SHIFT (0U) -/*! DLY_CELL_SET_POST - Delay cells on the feedback clock between CLK_OUT and CLK_POST */ -#define USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_POST(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_POST_SHIFT)) & USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_POST_MASK) - -#define USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_OUT_MASK (0xF0U) -#define USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_OUT_SHIFT (4U) -/*! DLY_CELL_SET_OUT - Delay cells on the feedback clock between CLK_PRE and CLK_OUT */ -#define USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_OUT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_OUT_SHIFT)) & USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_OUT_MASK) - -#define USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE_MASK (0x7F00U) -#define USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE_SHIFT (8U) -/*! DLY_CELL_SET_PRE - delay cells on the feedback clock between the feedback clock and CLK_PRE */ -#define USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE_SHIFT)) & USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE_MASK) - -#define USDHC_CLK_TUNE_CTRL_STATUS_NXT_ERR_MASK (0x8000U) -#define USDHC_CLK_TUNE_CTRL_STATUS_NXT_ERR_SHIFT (15U) -/*! NXT_ERR - NXT error */ -#define USDHC_CLK_TUNE_CTRL_STATUS_NXT_ERR(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CLK_TUNE_CTRL_STATUS_NXT_ERR_SHIFT)) & USDHC_CLK_TUNE_CTRL_STATUS_NXT_ERR_MASK) - -#define USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_POST_MASK (0xF0000U) -#define USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_POST_SHIFT (16U) -/*! TAP_SEL_POST - Delay cells added on the feedback clock between CLK_OUT and CLK_POST */ -#define USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_POST(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_POST_SHIFT)) & USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_POST_MASK) - -#define USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_OUT_MASK (0xF00000U) -#define USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_OUT_SHIFT (20U) -/*! TAP_SEL_OUT - Delay cells added on the feedback clock between CLK_PRE and CLK_OUT */ -#define USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_OUT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_OUT_SHIFT)) & USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_OUT_MASK) - -#define USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_PRE_MASK (0x7F000000U) -#define USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_PRE_SHIFT (24U) -/*! TAP_SEL_PRE - TAP_SEL_PRE */ -#define USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_PRE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_PRE_SHIFT)) & USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_PRE_MASK) - -#define USDHC_CLK_TUNE_CTRL_STATUS_PRE_ERR_MASK (0x80000000U) -#define USDHC_CLK_TUNE_CTRL_STATUS_PRE_ERR_SHIFT (31U) -/*! PRE_ERR - PRE error */ -#define USDHC_CLK_TUNE_CTRL_STATUS_PRE_ERR(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CLK_TUNE_CTRL_STATUS_PRE_ERR_SHIFT)) & USDHC_CLK_TUNE_CTRL_STATUS_PRE_ERR_MASK) -/*! @} */ - -/*! @name VEND_SPEC - Vendor Specific Register */ -/*! @{ */ - -#define USDHC_VEND_SPEC_AC12_WR_CHKBUSY_EN_MASK (0x8U) -#define USDHC_VEND_SPEC_AC12_WR_CHKBUSY_EN_SHIFT (3U) -/*! AC12_WR_CHKBUSY_EN - Check busy enable - * 0b0..Do not check busy after auto CMD12 for write data packet - * 0b1..Check busy after auto CMD12 for write data packet - */ -#define USDHC_VEND_SPEC_AC12_WR_CHKBUSY_EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_VEND_SPEC_AC12_WR_CHKBUSY_EN_SHIFT)) & USDHC_VEND_SPEC_AC12_WR_CHKBUSY_EN_MASK) - -#define USDHC_VEND_SPEC_FRC_SDCLK_ON_MASK (0x100U) -#define USDHC_VEND_SPEC_FRC_SDCLK_ON_SHIFT (8U) -/*! FRC_SDCLK_ON - Force CLK - * 0b0..CLK active or inactive is fully controlled by the hardware. - * 0b1..Force CLK active - */ -#define USDHC_VEND_SPEC_FRC_SDCLK_ON(x) (((uint32_t)(((uint32_t)(x)) << USDHC_VEND_SPEC_FRC_SDCLK_ON_SHIFT)) & USDHC_VEND_SPEC_FRC_SDCLK_ON_MASK) - -#define USDHC_VEND_SPEC_CRC_CHK_DIS_MASK (0x8000U) -#define USDHC_VEND_SPEC_CRC_CHK_DIS_SHIFT (15U) -/*! CRC_CHK_DIS - CRC Check Disable - * 0b0..Check CRC16 for every read data packet and check CRC fields for every write data packet - * 0b1..Ignore CRC16 check for every read data packet and ignore CRC fields check for every write data packet - */ -#define USDHC_VEND_SPEC_CRC_CHK_DIS(x) (((uint32_t)(((uint32_t)(x)) << USDHC_VEND_SPEC_CRC_CHK_DIS_SHIFT)) & USDHC_VEND_SPEC_CRC_CHK_DIS_MASK) - -#define USDHC_VEND_SPEC_CMD_BYTE_EN_MASK (0x80000000U) -#define USDHC_VEND_SPEC_CMD_BYTE_EN_SHIFT (31U) -/*! CMD_BYTE_EN - Register byte access for CMD_XFR_TYP - * 0b0..Disable. MIX_CTRL[7:0] is read/write and CMD_XFR_TYP[7:0] is read-only. - * 0b1..Enable. MIX_CTRL[7:0] is read-only and CMD_XFR_TYP[7:0] is read/write. - */ -#define USDHC_VEND_SPEC_CMD_BYTE_EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_VEND_SPEC_CMD_BYTE_EN_SHIFT)) & USDHC_VEND_SPEC_CMD_BYTE_EN_MASK) -/*! @} */ - -/*! @name MMC_BOOT - eMMC Boot */ -/*! @{ */ - -#define USDHC_MMC_BOOT_DTOCV_ACK_MASK (0xFU) -#define USDHC_MMC_BOOT_DTOCV_ACK_SHIFT (0U) -/*! DTOCV_ACK - Boot ACK time out - * 0b0000..SDCLK x 2^14 - * 0b0001..SDCLK x 2^15 - * 0b0010..SDCLK x 2^16 - * 0b0011..SDCLK x 2^17 - * 0b0100..SDCLK x 2^18 - * 0b0101..SDCLK x 2^19 - * 0b0110..SDCLK x 2^20 - * 0b0111..SDCLK x 2^21 - * 0b1110..SDCLK x 2^28 - * 0b1111..SDCLK x 2^29 - */ -#define USDHC_MMC_BOOT_DTOCV_ACK(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MMC_BOOT_DTOCV_ACK_SHIFT)) & USDHC_MMC_BOOT_DTOCV_ACK_MASK) - -#define USDHC_MMC_BOOT_BOOT_ACK_MASK (0x10U) -#define USDHC_MMC_BOOT_BOOT_ACK_SHIFT (4U) -/*! BOOT_ACK - BOOT ACK - * 0b0..No ack - * 0b1..Ack - */ -#define USDHC_MMC_BOOT_BOOT_ACK(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MMC_BOOT_BOOT_ACK_SHIFT)) & USDHC_MMC_BOOT_BOOT_ACK_MASK) - -#define USDHC_MMC_BOOT_BOOT_MODE_MASK (0x20U) -#define USDHC_MMC_BOOT_BOOT_MODE_SHIFT (5U) -/*! BOOT_MODE - Boot mode - * 0b0..Normal boot - * 0b1..Alternative boot - */ -#define USDHC_MMC_BOOT_BOOT_MODE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MMC_BOOT_BOOT_MODE_SHIFT)) & USDHC_MMC_BOOT_BOOT_MODE_MASK) - -#define USDHC_MMC_BOOT_BOOT_EN_MASK (0x40U) -#define USDHC_MMC_BOOT_BOOT_EN_SHIFT (6U) -/*! BOOT_EN - Boot enable - * 0b0..Fast boot disable - * 0b1..Fast boot enable - */ -#define USDHC_MMC_BOOT_BOOT_EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MMC_BOOT_BOOT_EN_SHIFT)) & USDHC_MMC_BOOT_BOOT_EN_MASK) - -#define USDHC_MMC_BOOT_AUTO_SABG_EN_MASK (0x80U) -#define USDHC_MMC_BOOT_AUTO_SABG_EN_SHIFT (7U) -/*! AUTO_SABG_EN - Auto stop at block gap */ -#define USDHC_MMC_BOOT_AUTO_SABG_EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MMC_BOOT_AUTO_SABG_EN_SHIFT)) & USDHC_MMC_BOOT_AUTO_SABG_EN_MASK) - -#define USDHC_MMC_BOOT_DISABLE_TIME_OUT_MASK (0x100U) -#define USDHC_MMC_BOOT_DISABLE_TIME_OUT_SHIFT (8U) -/*! DISABLE_TIME_OUT - Time out - * 0b0..Enable time out - * 0b1..Disable time out - */ -#define USDHC_MMC_BOOT_DISABLE_TIME_OUT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MMC_BOOT_DISABLE_TIME_OUT_SHIFT)) & USDHC_MMC_BOOT_DISABLE_TIME_OUT_MASK) - -#define USDHC_MMC_BOOT_BOOT_BLK_CNT_MASK (0xFFFF0000U) -#define USDHC_MMC_BOOT_BOOT_BLK_CNT_SHIFT (16U) -/*! BOOT_BLK_CNT - Stop At Block Gap value of automatic mode */ -#define USDHC_MMC_BOOT_BOOT_BLK_CNT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MMC_BOOT_BOOT_BLK_CNT_SHIFT)) & USDHC_MMC_BOOT_BOOT_BLK_CNT_MASK) -/*! @} */ - -/*! @name VEND_SPEC2 - Vendor Specific 2 Register */ -/*! @{ */ - -#define USDHC_VEND_SPEC2_CARD_INT_D3_TEST_MASK (0x8U) -#define USDHC_VEND_SPEC2_CARD_INT_D3_TEST_SHIFT (3U) -/*! CARD_INT_D3_TEST - Card interrupt detection test - * 0b0..Check the card interrupt only when DATA3 is high. - * 0b1..Check the card interrupt by ignoring the status of DATA3. - */ -#define USDHC_VEND_SPEC2_CARD_INT_D3_TEST(x) (((uint32_t)(((uint32_t)(x)) << USDHC_VEND_SPEC2_CARD_INT_D3_TEST_SHIFT)) & USDHC_VEND_SPEC2_CARD_INT_D3_TEST_MASK) - -#define USDHC_VEND_SPEC2_TUNING_BIT_EN_MASK (0x30U) -#define USDHC_VEND_SPEC2_TUNING_BIT_EN_SHIFT (4U) -/*! TUNING_BIT_EN - Tuning bit enable - * 0b00..Enable Tuning circuit for DATA[3:0] - * 0b01..Enable Tuning circuit for DATA[7:0] - * 0b10..Enable Tuning circuit for DATA[0] - * 0b11..Invalid - */ -#define USDHC_VEND_SPEC2_TUNING_BIT_EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_VEND_SPEC2_TUNING_BIT_EN_SHIFT)) & USDHC_VEND_SPEC2_TUNING_BIT_EN_MASK) - -#define USDHC_VEND_SPEC2_TUNING_CMD_EN_MASK (0x40U) -#define USDHC_VEND_SPEC2_TUNING_CMD_EN_SHIFT (6U) -/*! TUNING_CMD_EN - Tuning command enable - * 0b0..Auto tuning circuit does not check the CMD line. - * 0b1..Auto tuning circuit checks the CMD line. - */ -#define USDHC_VEND_SPEC2_TUNING_CMD_EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_VEND_SPEC2_TUNING_CMD_EN_SHIFT)) & USDHC_VEND_SPEC2_TUNING_CMD_EN_MASK) - -#define USDHC_VEND_SPEC2_ACMD23_ARGU2_EN_MASK (0x1000U) -#define USDHC_VEND_SPEC2_ACMD23_ARGU2_EN_SHIFT (12U) -/*! ACMD23_ARGU2_EN - Argument2 register enable for ACMD23 - * 0b1..Argument2 register enable for ACMD23 sharing with SDMA system address register. Default is enabled. - * 0b0..Disable - */ -#define USDHC_VEND_SPEC2_ACMD23_ARGU2_EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_VEND_SPEC2_ACMD23_ARGU2_EN_SHIFT)) & USDHC_VEND_SPEC2_ACMD23_ARGU2_EN_MASK) - -#define USDHC_VEND_SPEC2_EN_32K_CLK_MASK (0x8000U) -#define USDHC_VEND_SPEC2_EN_32K_CLK_SHIFT (15U) -/*! EN_32K_CLK - Select the clock source for host card detection. - * 0b0..Use the peripheral clock (ipg_clk) for card detection. - * 0b1..Use the low power clock (ipg_clk_lp) for card detection. - */ -#define USDHC_VEND_SPEC2_EN_32K_CLK(x) (((uint32_t)(((uint32_t)(x)) << USDHC_VEND_SPEC2_EN_32K_CLK_SHIFT)) & USDHC_VEND_SPEC2_EN_32K_CLK_MASK) -/*! @} */ - -/*! @name TUNING_CTRL - Tuning Control */ -/*! @{ */ - -#define USDHC_TUNING_CTRL_TUNING_START_TAP_MASK (0x7FU) -#define USDHC_TUNING_CTRL_TUNING_START_TAP_SHIFT (0U) -/*! TUNING_START_TAP - Tuning start */ -#define USDHC_TUNING_CTRL_TUNING_START_TAP(x) (((uint32_t)(((uint32_t)(x)) << USDHC_TUNING_CTRL_TUNING_START_TAP_SHIFT)) & USDHC_TUNING_CTRL_TUNING_START_TAP_MASK) - -#define USDHC_TUNING_CTRL_DIS_CMD_CHK_FOR_STD_TUNING_MASK (0x80U) -#define USDHC_TUNING_CTRL_DIS_CMD_CHK_FOR_STD_TUNING_SHIFT (7U) -/*! DIS_CMD_CHK_FOR_STD_TUNING - Disable command check for standard tuning */ -#define USDHC_TUNING_CTRL_DIS_CMD_CHK_FOR_STD_TUNING(x) (((uint32_t)(((uint32_t)(x)) << USDHC_TUNING_CTRL_DIS_CMD_CHK_FOR_STD_TUNING_SHIFT)) & USDHC_TUNING_CTRL_DIS_CMD_CHK_FOR_STD_TUNING_MASK) - -#define USDHC_TUNING_CTRL_TUNING_COUNTER_MASK (0xFF00U) -#define USDHC_TUNING_CTRL_TUNING_COUNTER_SHIFT (8U) -/*! TUNING_COUNTER - Tuning counter */ -#define USDHC_TUNING_CTRL_TUNING_COUNTER(x) (((uint32_t)(((uint32_t)(x)) << USDHC_TUNING_CTRL_TUNING_COUNTER_SHIFT)) & USDHC_TUNING_CTRL_TUNING_COUNTER_MASK) - -#define USDHC_TUNING_CTRL_TUNING_STEP_MASK (0x70000U) -#define USDHC_TUNING_CTRL_TUNING_STEP_SHIFT (16U) -/*! TUNING_STEP - TUNING_STEP */ -#define USDHC_TUNING_CTRL_TUNING_STEP(x) (((uint32_t)(((uint32_t)(x)) << USDHC_TUNING_CTRL_TUNING_STEP_SHIFT)) & USDHC_TUNING_CTRL_TUNING_STEP_MASK) - -#define USDHC_TUNING_CTRL_TUNING_WINDOW_MASK (0x700000U) -#define USDHC_TUNING_CTRL_TUNING_WINDOW_SHIFT (20U) -/*! TUNING_WINDOW - Data window */ -#define USDHC_TUNING_CTRL_TUNING_WINDOW(x) (((uint32_t)(((uint32_t)(x)) << USDHC_TUNING_CTRL_TUNING_WINDOW_SHIFT)) & USDHC_TUNING_CTRL_TUNING_WINDOW_MASK) - -#define USDHC_TUNING_CTRL_STD_TUNING_EN_MASK (0x1000000U) -#define USDHC_TUNING_CTRL_STD_TUNING_EN_SHIFT (24U) -/*! STD_TUNING_EN - Standard tuning circuit and procedure enable */ -#define USDHC_TUNING_CTRL_STD_TUNING_EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_TUNING_CTRL_STD_TUNING_EN_SHIFT)) & USDHC_TUNING_CTRL_STD_TUNING_EN_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group USDHC_Register_Masks */ - - -/* USDHC - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral USDHC0 base address */ - #define USDHC0_BASE (0x50109000u) - /** Peripheral USDHC0 base address */ - #define USDHC0_BASE_NS (0x40109000u) - /** Peripheral USDHC0 base pointer */ - #define USDHC0 ((USDHC_Type *)USDHC0_BASE) - /** Peripheral USDHC0 base pointer */ - #define USDHC0_NS ((USDHC_Type *)USDHC0_BASE_NS) - /** Array initializer of USDHC peripheral base addresses */ - #define USDHC_BASE_ADDRS { USDHC0_BASE } - /** Array initializer of USDHC peripheral base pointers */ - #define USDHC_BASE_PTRS { USDHC0 } - /** Array initializer of USDHC peripheral base addresses */ - #define USDHC_BASE_ADDRS_NS { USDHC0_BASE_NS } - /** Array initializer of USDHC peripheral base pointers */ - #define USDHC_BASE_PTRS_NS { USDHC0_NS } -#else - /** Peripheral USDHC0 base address */ - #define USDHC0_BASE (0x40109000u) - /** Peripheral USDHC0 base pointer */ - #define USDHC0 ((USDHC_Type *)USDHC0_BASE) - /** Array initializer of USDHC peripheral base addresses */ - #define USDHC_BASE_ADDRS { USDHC0_BASE } - /** Array initializer of USDHC peripheral base pointers */ - #define USDHC_BASE_PTRS { USDHC0 } -#endif -/** Interrupt vectors for the USDHC peripheral type */ -#define USDHC_IRQS { USDHC0_IRQn } - -/*! - * @} - */ /* end of group USDHC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- UTICK Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup UTICK_Peripheral_Access_Layer UTICK Peripheral Access Layer - * @{ - */ - -/** UTICK - Register Layout Typedef */ -typedef struct { - __IO uint32_t CTRL; /**< Control, offset: 0x0 */ - __IO uint32_t STAT; /**< Status, offset: 0x4 */ - __IO uint32_t CFG; /**< Capture Configuration, offset: 0x8 */ - __O uint32_t CAPCLR; /**< Capture Clear, offset: 0xC */ - __I uint32_t CAP[4]; /**< Capture, array offset: 0x10, array step: 0x4 */ -} UTICK_Type; - -/* ---------------------------------------------------------------------------- - -- UTICK Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup UTICK_Register_Masks UTICK Register Masks - * @{ - */ - -/*! @name CTRL - Control */ -/*! @{ */ - -#define UTICK_CTRL_DELAYVAL_MASK (0x7FFFFFFFU) -#define UTICK_CTRL_DELAYVAL_SHIFT (0U) -/*! DELAYVAL - Tick Interval - * 0b0000000000000000000000000000000.. - * *..Clock cycles as defined in the description - */ -#define UTICK_CTRL_DELAYVAL(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CTRL_DELAYVAL_SHIFT)) & UTICK_CTRL_DELAYVAL_MASK) - -#define UTICK_CTRL_REPEAT_MASK (0x80000000U) -#define UTICK_CTRL_REPEAT_SHIFT (31U) -/*! REPEAT - Repeat Delay - * 0b0..One-time delay - * 0b1..Delay repeats continuously - */ -#define UTICK_CTRL_REPEAT(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CTRL_REPEAT_SHIFT)) & UTICK_CTRL_REPEAT_MASK) -/*! @} */ - -/*! @name STAT - Status */ -/*! @{ */ - -#define UTICK_STAT_INTR_MASK (0x1U) -#define UTICK_STAT_INTR_SHIFT (0U) -/*! INTR - Interrupt Flag - * 0b0..Not pending - * 0b1..Pending - */ -#define UTICK_STAT_INTR(x) (((uint32_t)(((uint32_t)(x)) << UTICK_STAT_INTR_SHIFT)) & UTICK_STAT_INTR_MASK) - -#define UTICK_STAT_ACTIVE_MASK (0x2U) -#define UTICK_STAT_ACTIVE_SHIFT (1U) -/*! ACTIVE - Timer Active Flag - * 0b0..Inactive (stopped) - * 0b1..Active - */ -#define UTICK_STAT_ACTIVE(x) (((uint32_t)(((uint32_t)(x)) << UTICK_STAT_ACTIVE_SHIFT)) & UTICK_STAT_ACTIVE_MASK) -/*! @} */ - -/*! @name CFG - Capture Configuration */ -/*! @{ */ - -#define UTICK_CFG_CAPEN0_MASK (0x1U) -#define UTICK_CFG_CAPEN0_SHIFT (0U) -/*! CAPEN0 - Enable Capture 0 - * 0b0..Disable - * 0b1..Enable - */ -#define UTICK_CFG_CAPEN0(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPEN0_SHIFT)) & UTICK_CFG_CAPEN0_MASK) - -#define UTICK_CFG_CAPEN1_MASK (0x2U) -#define UTICK_CFG_CAPEN1_SHIFT (1U) -/*! CAPEN1 - Enable Capture 1 - * 0b0..Disable - * 0b1..Enable - */ -#define UTICK_CFG_CAPEN1(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPEN1_SHIFT)) & UTICK_CFG_CAPEN1_MASK) - -#define UTICK_CFG_CAPEN2_MASK (0x4U) -#define UTICK_CFG_CAPEN2_SHIFT (2U) -/*! CAPEN2 - Enable Capture 2 - * 0b0..Disable - * 0b1..Enable - */ -#define UTICK_CFG_CAPEN2(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPEN2_SHIFT)) & UTICK_CFG_CAPEN2_MASK) - -#define UTICK_CFG_CAPEN3_MASK (0x8U) -#define UTICK_CFG_CAPEN3_SHIFT (3U) -/*! CAPEN3 - Enable Capture 3 - * 0b0..Disable - * 0b1..Enable - */ -#define UTICK_CFG_CAPEN3(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPEN3_SHIFT)) & UTICK_CFG_CAPEN3_MASK) - -#define UTICK_CFG_CAPPOL0_MASK (0x100U) -#define UTICK_CFG_CAPPOL0_SHIFT (8U) -/*! CAPPOL0 - Capture Polarity 0 - * 0b0..Positive - * 0b1..Negative - */ -#define UTICK_CFG_CAPPOL0(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPPOL0_SHIFT)) & UTICK_CFG_CAPPOL0_MASK) - -#define UTICK_CFG_CAPPOL1_MASK (0x200U) -#define UTICK_CFG_CAPPOL1_SHIFT (9U) -/*! CAPPOL1 - Capture-Polarity 1 - * 0b0..Positive - * 0b1..Negative - */ -#define UTICK_CFG_CAPPOL1(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPPOL1_SHIFT)) & UTICK_CFG_CAPPOL1_MASK) - -#define UTICK_CFG_CAPPOL2_MASK (0x400U) -#define UTICK_CFG_CAPPOL2_SHIFT (10U) -/*! CAPPOL2 - Capture Polarity 2 - * 0b0..Positive - * 0b1..Negative - */ -#define UTICK_CFG_CAPPOL2(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPPOL2_SHIFT)) & UTICK_CFG_CAPPOL2_MASK) - -#define UTICK_CFG_CAPPOL3_MASK (0x800U) -#define UTICK_CFG_CAPPOL3_SHIFT (11U) -/*! CAPPOL3 - Capture Polarity 3 - * 0b0..Positive - * 0b1..Negative - */ -#define UTICK_CFG_CAPPOL3(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPPOL3_SHIFT)) & UTICK_CFG_CAPPOL3_MASK) -/*! @} */ - -/*! @name CAPCLR - Capture Clear */ -/*! @{ */ - -#define UTICK_CAPCLR_CAPCLR0_MASK (0x1U) -#define UTICK_CAPCLR_CAPCLR0_SHIFT (0U) -/*! CAPCLR0 - Clear Capture 0 - * 0b0..Does nothing - * 0b1..Clears the CAP0 register value - */ -#define UTICK_CAPCLR_CAPCLR0(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CAPCLR_CAPCLR0_SHIFT)) & UTICK_CAPCLR_CAPCLR0_MASK) - -#define UTICK_CAPCLR_CAPCLR1_MASK (0x2U) -#define UTICK_CAPCLR_CAPCLR1_SHIFT (1U) -/*! CAPCLR1 - Clear Capture 1 - * 0b0..Does nothing - * 0b1..Clears the CAP1 register value - */ -#define UTICK_CAPCLR_CAPCLR1(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CAPCLR_CAPCLR1_SHIFT)) & UTICK_CAPCLR_CAPCLR1_MASK) - -#define UTICK_CAPCLR_CAPCLR2_MASK (0x4U) -#define UTICK_CAPCLR_CAPCLR2_SHIFT (2U) -/*! CAPCLR2 - Clear Capture 2 - * 0b0..Does nothing - * 0b1..Clears the CAP2 register value - */ -#define UTICK_CAPCLR_CAPCLR2(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CAPCLR_CAPCLR2_SHIFT)) & UTICK_CAPCLR_CAPCLR2_MASK) - -#define UTICK_CAPCLR_CAPCLR3_MASK (0x8U) -#define UTICK_CAPCLR_CAPCLR3_SHIFT (3U) -/*! CAPCLR3 - Clear Capture 3 - * 0b0..Does nothing - * 0b1..Clears the CAP3 register value - */ -#define UTICK_CAPCLR_CAPCLR3(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CAPCLR_CAPCLR3_SHIFT)) & UTICK_CAPCLR_CAPCLR3_MASK) -/*! @} */ - -/*! @name CAP - Capture */ -/*! @{ */ - -#define UTICK_CAP_CAP_VALUE_MASK (0x7FFFFFFFU) -#define UTICK_CAP_CAP_VALUE_SHIFT (0U) -/*! CAP_VALUE - Captured Value for the Related Capture Event */ -#define UTICK_CAP_CAP_VALUE(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CAP_CAP_VALUE_SHIFT)) & UTICK_CAP_CAP_VALUE_MASK) - -#define UTICK_CAP_VALID_MASK (0x80000000U) -#define UTICK_CAP_VALID_SHIFT (31U) -/*! VALID - Captured Value Valid Flag - * 0b0..Valid value not captured - * 0b1..Valid value captured - */ -#define UTICK_CAP_VALID(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CAP_VALID_SHIFT)) & UTICK_CAP_VALID_MASK) -/*! @} */ - -/* The count of UTICK_CAP */ -#define UTICK_CAP_COUNT (4U) - - -/*! - * @} - */ /* end of group UTICK_Register_Masks */ - - -/* UTICK - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral UTICK0 base address */ - #define UTICK0_BASE (0x50012000u) - /** Peripheral UTICK0 base address */ - #define UTICK0_BASE_NS (0x40012000u) - /** Peripheral UTICK0 base pointer */ - #define UTICK0 ((UTICK_Type *)UTICK0_BASE) - /** Peripheral UTICK0 base pointer */ - #define UTICK0_NS ((UTICK_Type *)UTICK0_BASE_NS) - /** Array initializer of UTICK peripheral base addresses */ - #define UTICK_BASE_ADDRS { UTICK0_BASE } - /** Array initializer of UTICK peripheral base pointers */ - #define UTICK_BASE_PTRS { UTICK0 } - /** Array initializer of UTICK peripheral base addresses */ - #define UTICK_BASE_ADDRS_NS { UTICK0_BASE_NS } - /** Array initializer of UTICK peripheral base pointers */ - #define UTICK_BASE_PTRS_NS { UTICK0_NS } -#else - /** Peripheral UTICK0 base address */ - #define UTICK0_BASE (0x40012000u) - /** Peripheral UTICK0 base pointer */ - #define UTICK0 ((UTICK_Type *)UTICK0_BASE) - /** Array initializer of UTICK peripheral base addresses */ - #define UTICK_BASE_ADDRS { UTICK0_BASE } - /** Array initializer of UTICK peripheral base pointers */ - #define UTICK_BASE_PTRS { UTICK0 } -#endif -/** Interrupt vectors for the UTICK peripheral type */ -#define UTICK_IRQS { UTICK0_IRQn } - -/*! - * @} - */ /* end of group UTICK_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- VBAT Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup VBAT_Peripheral_Access_Layer VBAT Peripheral Access Layer - * @{ - */ - -/** VBAT - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - uint8_t RESERVED_0[12]; - __IO uint32_t STATUSA; /**< Status A, offset: 0x10 */ - __IO uint32_t STATUSB; /**< Status B, offset: 0x14 */ - __IO uint32_t IRQENA; /**< Interrupt Enable A, offset: 0x18 */ - __IO uint32_t IRQENB; /**< Interrupt Enable B, offset: 0x1C */ - __IO uint32_t WAKENA; /**< Wake-up Enable A, offset: 0x20 */ - __IO uint32_t WAKENB; /**< Wake-up Enable B, offset: 0x24 */ - __IO uint32_t TAMPERA; /**< Tamper Enable A, offset: 0x28 */ - __IO uint32_t TAMPERB; /**< Tamper Enable B, offset: 0x2C */ - __IO uint32_t LOCKA; /**< Lock A, offset: 0x30 */ - __IO uint32_t LOCKB; /**< Lock B, offset: 0x34 */ - __IO uint32_t WAKECFG; /**< Wake-up Configuration, offset: 0x38 */ - uint8_t RESERVED_1[196]; - __IO uint32_t OSCCTLA; /**< Oscillator Control A, offset: 0x100 */ - __IO uint32_t OSCCTLB; /**< Oscillator Control B, offset: 0x104 */ - __IO uint32_t OSCCFGA; /**< Oscillator Configuration A, offset: 0x108 */ - __IO uint32_t OSCCFGB; /**< Oscillator Configuration B, offset: 0x10C */ - uint8_t RESERVED_2[8]; - __IO uint32_t OSCLCKA; /**< Oscillator Lock A, offset: 0x118 */ - __IO uint32_t OSCLCKB; /**< Oscillator Lock B, offset: 0x11C */ - __IO uint32_t OSCCLKE; /**< Oscillator Clock Enable, offset: 0x120 */ - uint8_t RESERVED_3[220]; - __IO uint32_t FROCTLA; /**< FRO16K Control A, offset: 0x200 */ - __IO uint32_t FROCTLB; /**< FRO16K Control B, offset: 0x204 */ - uint8_t RESERVED_4[16]; - __IO uint32_t FROLCKA; /**< FRO16K Lock A, offset: 0x218 */ - __IO uint32_t FROLCKB; /**< FRO16K Lock B, offset: 0x21C */ - __IO uint32_t FROCLKE; /**< FRO16K Clock Enable, offset: 0x220 */ - uint8_t RESERVED_5[220]; - __IO uint32_t LDOCTLA; /**< LDO_RAM Control A, offset: 0x300 */ - __IO uint32_t LDOCTLB; /**< LDO_RAM Control B, offset: 0x304 */ - uint8_t RESERVED_6[16]; - __IO uint32_t LDOLCKA; /**< LDO_RAM Lock A, offset: 0x318 */ - __IO uint32_t LDOLCKB; /**< LDO_RAM Lock B, offset: 0x31C */ - __IO uint32_t LDORAMC; /**< RAM Control, offset: 0x320 */ - uint8_t RESERVED_7[12]; - __IO uint32_t LDOTIMER0; /**< Bandgap Timer 0, offset: 0x330 */ - uint8_t RESERVED_8[4]; - __IO uint32_t LDOTIMER1; /**< Bandgap Timer 1, offset: 0x338 */ - uint8_t RESERVED_9[196]; - __IO uint32_t MONCTLA; /**< CLKMON Control A, offset: 0x400 */ - __IO uint32_t MONCTLB; /**< CLKMON Control B, offset: 0x404 */ - __IO uint32_t MONCFGA; /**< CLKMON Configuration A, offset: 0x408 */ - __IO uint32_t MONCFGB; /**< CLKMON Configuration B, offset: 0x40C */ - uint8_t RESERVED_10[8]; - __IO uint32_t MONLCKA; /**< CLKMON Lock A, offset: 0x418 */ - __IO uint32_t MONLCKB; /**< CLKMON Lock B, offset: 0x41C */ - uint8_t RESERVED_11[224]; - __IO uint32_t TAMCTLA; /**< TAMPER Control A, offset: 0x500 */ - __IO uint32_t TAMCTLB; /**< TAMPER Control B, offset: 0x504 */ - uint8_t RESERVED_12[16]; - __IO uint32_t TAMLCKA; /**< TAMPER Lock A, offset: 0x518 */ - __IO uint32_t TAMLCKB; /**< TAMPER Lock B, offset: 0x51C */ - uint8_t RESERVED_13[224]; - __IO uint32_t SWICTLA; /**< Switch Control A, offset: 0x600 */ - __IO uint32_t SWICTLB; /**< Switch Control B, offset: 0x604 */ - uint8_t RESERVED_14[16]; - __IO uint32_t SWILCKA; /**< Switch Lock A, offset: 0x618 */ - __IO uint32_t SWILCKB; /**< Switch Lock B, offset: 0x61C */ - uint8_t RESERVED_15[224]; - struct { /* offset: 0x700, array step: 0x8 */ - __IO uint32_t WAKEUPA; /**< Wakeup 0 Register A, array offset: 0x700, array step: 0x8 */ - __IO uint32_t WAKEUPB; /**< Wakeup 0 Register B, array offset: 0x704, array step: 0x8 */ - } WAKEUP[2]; - uint8_t RESERVED_16[232]; - __IO uint32_t WAKLCKA; /**< Wakeup Lock A, offset: 0x7F8 */ - __IO uint32_t WAKLCKB; /**< Wakeup Lock B, offset: 0x7FC */ -} VBAT_Type; - -/* ---------------------------------------------------------------------------- - -- VBAT Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup VBAT_Register_Masks VBAT Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define VBAT_VERID_FEATURE_MASK (0xFFFFU) -#define VBAT_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number */ -#define VBAT_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_VERID_FEATURE_SHIFT)) & VBAT_VERID_FEATURE_MASK) - -#define VBAT_VERID_MINOR_MASK (0xFF0000U) -#define VBAT_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define VBAT_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << VBAT_VERID_MINOR_SHIFT)) & VBAT_VERID_MINOR_MASK) - -#define VBAT_VERID_MAJOR_MASK (0xFF000000U) -#define VBAT_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define VBAT_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << VBAT_VERID_MAJOR_SHIFT)) & VBAT_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name STATUSA - Status A */ -/*! @{ */ - -#define VBAT_STATUSA_POR_DET_MASK (0x1U) -#define VBAT_STATUSA_POR_DET_SHIFT (0U) -/*! POR_DET - POR Detect Flag - * 0b0..Not reset - * 0b1..Reset - * 0b0..No effect - * 0b1..Clear the flag - */ -#define VBAT_STATUSA_POR_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_POR_DET_SHIFT)) & VBAT_STATUSA_POR_DET_MASK) - -#define VBAT_STATUSA_WAKEUP_FLAG_MASK (0x2U) -#define VBAT_STATUSA_WAKEUP_FLAG_SHIFT (1U) -/*! WAKEUP_FLAG - Wakeup Pin Flag - * 0b0..Not asserted - * 0b1..Asserted - * 0b0..No effect - * 0b1..Clear the flag - */ -#define VBAT_STATUSA_WAKEUP_FLAG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_WAKEUP_FLAG_SHIFT)) & VBAT_STATUSA_WAKEUP_FLAG_MASK) - -#define VBAT_STATUSA_TIMER0_FLAG_MASK (0x4U) -#define VBAT_STATUSA_TIMER0_FLAG_SHIFT (2U) -/*! TIMER0_FLAG - Bandgap Timer 0 Flag - * 0b0..Not reached - * 0b1..Reached - * 0b0..No effect - * 0b1..Clear the flag - */ -#define VBAT_STATUSA_TIMER0_FLAG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_TIMER0_FLAG_SHIFT)) & VBAT_STATUSA_TIMER0_FLAG_MASK) - -#define VBAT_STATUSA_TIMER1_FLAG_MASK (0x8U) -#define VBAT_STATUSA_TIMER1_FLAG_SHIFT (3U) -/*! TIMER1_FLAG - Bandgap Timer 1 Flag - * 0b0..Not reached - * 0b1..Reached - * 0b0..No effect - * 0b1..Clear the flag - */ -#define VBAT_STATUSA_TIMER1_FLAG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_TIMER1_FLAG_SHIFT)) & VBAT_STATUSA_TIMER1_FLAG_MASK) - -#define VBAT_STATUSA_LDO_RDY_MASK (0x10U) -#define VBAT_STATUSA_LDO_RDY_SHIFT (4U) -/*! LDO_RDY - LDO Ready - * 0b0..Disabled (not ready) - * 0b1..Enabled (ready) - */ -#define VBAT_STATUSA_LDO_RDY(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_LDO_RDY_SHIFT)) & VBAT_STATUSA_LDO_RDY_MASK) - -#define VBAT_STATUSA_OSC_RDY_MASK (0x20U) -#define VBAT_STATUSA_OSC_RDY_SHIFT (5U) -/*! OSC_RDY - OSC32k Ready - * 0b0..Disabled (clock not ready) - * 0b1..Enabled (clock ready) - */ -#define VBAT_STATUSA_OSC_RDY(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_OSC_RDY_SHIFT)) & VBAT_STATUSA_OSC_RDY_MASK) - -#define VBAT_STATUSA_CLOCK_DET_MASK (0x40U) -#define VBAT_STATUSA_CLOCK_DET_SHIFT (6U) -/*! CLOCK_DET - Clock Detect - * 0b0..Clock error not detected - * 0b1..Clock error detected - */ -#define VBAT_STATUSA_CLOCK_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_CLOCK_DET_SHIFT)) & VBAT_STATUSA_CLOCK_DET_MASK) - -#define VBAT_STATUSA_CONFIG_DET_MASK (0x80U) -#define VBAT_STATUSA_CONFIG_DET_SHIFT (7U) -/*! CONFIG_DET - Configuration Detect Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define VBAT_STATUSA_CONFIG_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_CONFIG_DET_SHIFT)) & VBAT_STATUSA_CONFIG_DET_MASK) - -#define VBAT_STATUSA_VOLT_DET_MASK (0x100U) -#define VBAT_STATUSA_VOLT_DET_SHIFT (8U) -/*! VOLT_DET - Voltage Detect - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define VBAT_STATUSA_VOLT_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_VOLT_DET_SHIFT)) & VBAT_STATUSA_VOLT_DET_MASK) - -#define VBAT_STATUSA_TEMP_DET_MASK (0x200U) -#define VBAT_STATUSA_TEMP_DET_SHIFT (9U) -/*! TEMP_DET - Temperature Detect - * 0b0..Temperature error not detected - * 0b1..Temperature error detected - */ -#define VBAT_STATUSA_TEMP_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_TEMP_DET_SHIFT)) & VBAT_STATUSA_TEMP_DET_MASK) - -#define VBAT_STATUSA_LIGHT_DET_MASK (0x400U) -#define VBAT_STATUSA_LIGHT_DET_SHIFT (10U) -/*! LIGHT_DET - Light Detect - * 0b0..Light error not detected - * 0b1..Light error detected - */ -#define VBAT_STATUSA_LIGHT_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_LIGHT_DET_SHIFT)) & VBAT_STATUSA_LIGHT_DET_MASK) - -#define VBAT_STATUSA_SEC0_DET_MASK (0x1000U) -#define VBAT_STATUSA_SEC0_DET_SHIFT (12U) -/*! SEC0_DET - Input 0 Detect - * 0b0..Security input 0 not detected - * 0b1..Security input 0 detected - */ -#define VBAT_STATUSA_SEC0_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_SEC0_DET_SHIFT)) & VBAT_STATUSA_SEC0_DET_MASK) - -#define VBAT_STATUSA_IRQ0_DET_MASK (0x10000U) -#define VBAT_STATUSA_IRQ0_DET_SHIFT (16U) -/*! IRQ0_DET - Interrupt 0 Detect - * 0b0..Not asserted - * 0b1..Asserted - */ -#define VBAT_STATUSA_IRQ0_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_IRQ0_DET_SHIFT)) & VBAT_STATUSA_IRQ0_DET_MASK) - -#define VBAT_STATUSA_IRQ1_DET_MASK (0x20000U) -#define VBAT_STATUSA_IRQ1_DET_SHIFT (17U) -/*! IRQ1_DET - Interrupt 1 Detect - * 0b0..Not asserted - * 0b1..Asserted - */ -#define VBAT_STATUSA_IRQ1_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_IRQ1_DET_SHIFT)) & VBAT_STATUSA_IRQ1_DET_MASK) - -#define VBAT_STATUSA_IRQ2_DET_MASK (0x40000U) -#define VBAT_STATUSA_IRQ2_DET_SHIFT (18U) -/*! IRQ2_DET - Interrupt 2 Detect - * 0b0..Not asserted - * 0b1..Asserted - */ -#define VBAT_STATUSA_IRQ2_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_IRQ2_DET_SHIFT)) & VBAT_STATUSA_IRQ2_DET_MASK) - -#define VBAT_STATUSA_IRQ3_DET_MASK (0x80000U) -#define VBAT_STATUSA_IRQ3_DET_SHIFT (19U) -/*! IRQ3_DET - Interrupt 3 Detect - * 0b0..Not asserted - * 0b1..Asserted - */ -#define VBAT_STATUSA_IRQ3_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_IRQ3_DET_SHIFT)) & VBAT_STATUSA_IRQ3_DET_MASK) -/*! @} */ - -/*! @name STATUSB - Status B */ -/*! @{ */ - -#define VBAT_STATUSB_INVERSE_MASK (0xFFFFFU) -#define VBAT_STATUSB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse value */ -#define VBAT_STATUSB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSB_INVERSE_SHIFT)) & VBAT_STATUSB_INVERSE_MASK) -/*! @} */ - -/*! @name IRQENA - Interrupt Enable A */ -/*! @{ */ - -#define VBAT_IRQENA_POR_DET_MASK (0x1U) -#define VBAT_IRQENA_POR_DET_SHIFT (0U) -/*! POR_DET - POR Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_POR_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_POR_DET_SHIFT)) & VBAT_IRQENA_POR_DET_MASK) - -#define VBAT_IRQENA_WAKEUP_FLAG_MASK (0x2U) -#define VBAT_IRQENA_WAKEUP_FLAG_SHIFT (1U) -/*! WAKEUP_FLAG - Wakeup Pin Flag - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_WAKEUP_FLAG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_WAKEUP_FLAG_SHIFT)) & VBAT_IRQENA_WAKEUP_FLAG_MASK) - -#define VBAT_IRQENA_TIMER0_FLAG_MASK (0x4U) -#define VBAT_IRQENA_TIMER0_FLAG_SHIFT (2U) -/*! TIMER0_FLAG - Bandgap Timer 0 - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_TIMER0_FLAG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_TIMER0_FLAG_SHIFT)) & VBAT_IRQENA_TIMER0_FLAG_MASK) - -#define VBAT_IRQENA_TIMER1_FLAG_MASK (0x8U) -#define VBAT_IRQENA_TIMER1_FLAG_SHIFT (3U) -/*! TIMER1_FLAG - Bandgap Timer 2 - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_TIMER1_FLAG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_TIMER1_FLAG_SHIFT)) & VBAT_IRQENA_TIMER1_FLAG_MASK) - -#define VBAT_IRQENA_LDO_RDY_MASK (0x10U) -#define VBAT_IRQENA_LDO_RDY_SHIFT (4U) -/*! LDO_RDY - LDO Ready - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_LDO_RDY(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_LDO_RDY_SHIFT)) & VBAT_IRQENA_LDO_RDY_MASK) - -#define VBAT_IRQENA_OSC_RDY_MASK (0x20U) -#define VBAT_IRQENA_OSC_RDY_SHIFT (5U) -/*! OSC_RDY - OSC32k Ready - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_OSC_RDY(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_OSC_RDY_SHIFT)) & VBAT_IRQENA_OSC_RDY_MASK) - -#define VBAT_IRQENA_CLOCK_DET_MASK (0x40U) -#define VBAT_IRQENA_CLOCK_DET_SHIFT (6U) -/*! CLOCK_DET - Clock Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_CLOCK_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_CLOCK_DET_SHIFT)) & VBAT_IRQENA_CLOCK_DET_MASK) - -#define VBAT_IRQENA_CONFIG_DET_MASK (0x80U) -#define VBAT_IRQENA_CONFIG_DET_SHIFT (7U) -/*! CONFIG_DET - Configuration Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_CONFIG_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_CONFIG_DET_SHIFT)) & VBAT_IRQENA_CONFIG_DET_MASK) - -#define VBAT_IRQENA_VOLT_DET_MASK (0x100U) -#define VBAT_IRQENA_VOLT_DET_SHIFT (8U) -/*! VOLT_DET - Voltage Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_VOLT_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_VOLT_DET_SHIFT)) & VBAT_IRQENA_VOLT_DET_MASK) - -#define VBAT_IRQENA_TEMP_DET_MASK (0x200U) -#define VBAT_IRQENA_TEMP_DET_SHIFT (9U) -/*! TEMP_DET - Temperature Detect - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define VBAT_IRQENA_TEMP_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_TEMP_DET_SHIFT)) & VBAT_IRQENA_TEMP_DET_MASK) - -#define VBAT_IRQENA_LIGHT_DET_MASK (0x400U) -#define VBAT_IRQENA_LIGHT_DET_SHIFT (10U) -/*! LIGHT_DET - Light Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_LIGHT_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_LIGHT_DET_SHIFT)) & VBAT_IRQENA_LIGHT_DET_MASK) - -#define VBAT_IRQENA_SEC0_DET_MASK (0x1000U) -#define VBAT_IRQENA_SEC0_DET_SHIFT (12U) -/*! SEC0_DET - Input 0 Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_SEC0_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_SEC0_DET_SHIFT)) & VBAT_IRQENA_SEC0_DET_MASK) - -#define VBAT_IRQENA_IRQ0_DET_MASK (0x10000U) -#define VBAT_IRQENA_IRQ0_DET_SHIFT (16U) -/*! IRQ0_DET - Interrupt 0 Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_IRQ0_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_IRQ0_DET_SHIFT)) & VBAT_IRQENA_IRQ0_DET_MASK) - -#define VBAT_IRQENA_IRQ1_DET_MASK (0x20000U) -#define VBAT_IRQENA_IRQ1_DET_SHIFT (17U) -/*! IRQ1_DET - Interrupt 1 Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_IRQ1_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_IRQ1_DET_SHIFT)) & VBAT_IRQENA_IRQ1_DET_MASK) - -#define VBAT_IRQENA_IRQ2_DET_MASK (0x40000U) -#define VBAT_IRQENA_IRQ2_DET_SHIFT (18U) -/*! IRQ2_DET - Interrupt 2 Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_IRQ2_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_IRQ2_DET_SHIFT)) & VBAT_IRQENA_IRQ2_DET_MASK) - -#define VBAT_IRQENA_IRQ3_DET_MASK (0x80000U) -#define VBAT_IRQENA_IRQ3_DET_SHIFT (19U) -/*! IRQ3_DET - Interrupt 3 Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_IRQ3_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_IRQ3_DET_SHIFT)) & VBAT_IRQENA_IRQ3_DET_MASK) -/*! @} */ - -/*! @name IRQENB - Interrupt Enable B */ -/*! @{ */ - -#define VBAT_IRQENB_INVERSE_MASK (0xFFFFFU) -#define VBAT_IRQENB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse Value */ -#define VBAT_IRQENB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENB_INVERSE_SHIFT)) & VBAT_IRQENB_INVERSE_MASK) -/*! @} */ - -/*! @name WAKENA - Wake-up Enable A */ -/*! @{ */ - -#define VBAT_WAKENA_POR_DET_MASK (0x1U) -#define VBAT_WAKENA_POR_DET_SHIFT (0U) -/*! POR_DET - POR Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_POR_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_POR_DET_SHIFT)) & VBAT_WAKENA_POR_DET_MASK) - -#define VBAT_WAKENA_WAKEUP_FLAG_MASK (0x2U) -#define VBAT_WAKENA_WAKEUP_FLAG_SHIFT (1U) -/*! WAKEUP_FLAG - Wake-up Pin Flag - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_WAKEUP_FLAG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_WAKEUP_FLAG_SHIFT)) & VBAT_WAKENA_WAKEUP_FLAG_MASK) - -#define VBAT_WAKENA_TIMER0_FLAG_MASK (0x4U) -#define VBAT_WAKENA_TIMER0_FLAG_SHIFT (2U) -/*! TIMER0_FLAG - Bandgap Timer 0 - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_TIMER0_FLAG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_TIMER0_FLAG_SHIFT)) & VBAT_WAKENA_TIMER0_FLAG_MASK) - -#define VBAT_WAKENA_TIMER1_FLAG_MASK (0x8U) -#define VBAT_WAKENA_TIMER1_FLAG_SHIFT (3U) -/*! TIMER1_FLAG - Bandgap Timer 2 - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_TIMER1_FLAG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_TIMER1_FLAG_SHIFT)) & VBAT_WAKENA_TIMER1_FLAG_MASK) - -#define VBAT_WAKENA_LDO_RDY_MASK (0x10U) -#define VBAT_WAKENA_LDO_RDY_SHIFT (4U) -/*! LDO_RDY - LDO Ready - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_LDO_RDY(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_LDO_RDY_SHIFT)) & VBAT_WAKENA_LDO_RDY_MASK) - -#define VBAT_WAKENA_OSC_RDY_MASK (0x20U) -#define VBAT_WAKENA_OSC_RDY_SHIFT (5U) -/*! OSC_RDY - OSC32K Ready - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_OSC_RDY(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_OSC_RDY_SHIFT)) & VBAT_WAKENA_OSC_RDY_MASK) - -#define VBAT_WAKENA_CLOCK_DET_MASK (0x40U) -#define VBAT_WAKENA_CLOCK_DET_SHIFT (6U) -/*! CLOCK_DET - Clock Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_CLOCK_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_CLOCK_DET_SHIFT)) & VBAT_WAKENA_CLOCK_DET_MASK) - -#define VBAT_WAKENA_CONFIG_DET_MASK (0x80U) -#define VBAT_WAKENA_CONFIG_DET_SHIFT (7U) -/*! CONFIG_DET - Configuration Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_CONFIG_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_CONFIG_DET_SHIFT)) & VBAT_WAKENA_CONFIG_DET_MASK) - -#define VBAT_WAKENA_VOLT_DET_MASK (0x100U) -#define VBAT_WAKENA_VOLT_DET_SHIFT (8U) -/*! VOLT_DET - Voltage Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_VOLT_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_VOLT_DET_SHIFT)) & VBAT_WAKENA_VOLT_DET_MASK) - -#define VBAT_WAKENA_TEMP_DET_MASK (0x200U) -#define VBAT_WAKENA_TEMP_DET_SHIFT (9U) -/*! TEMP_DET - Temperature Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_TEMP_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_TEMP_DET_SHIFT)) & VBAT_WAKENA_TEMP_DET_MASK) - -#define VBAT_WAKENA_LIGHT_DET_MASK (0x400U) -#define VBAT_WAKENA_LIGHT_DET_SHIFT (10U) -/*! LIGHT_DET - Light Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_LIGHT_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_LIGHT_DET_SHIFT)) & VBAT_WAKENA_LIGHT_DET_MASK) - -#define VBAT_WAKENA_SEC0_DET_MASK (0x1000U) -#define VBAT_WAKENA_SEC0_DET_SHIFT (12U) -/*! SEC0_DET - Input 0 Detect - * 0b0..Disabled - * 0b1..Enabled - */ -#define VBAT_WAKENA_SEC0_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_SEC0_DET_SHIFT)) & VBAT_WAKENA_SEC0_DET_MASK) - -#define VBAT_WAKENA_IRQ0_DET_MASK (0x10000U) -#define VBAT_WAKENA_IRQ0_DET_SHIFT (16U) -/*! IRQ0_DET - Interrupt 0 Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_IRQ0_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_IRQ0_DET_SHIFT)) & VBAT_WAKENA_IRQ0_DET_MASK) - -#define VBAT_WAKENA_IRQ1_DET_MASK (0x20000U) -#define VBAT_WAKENA_IRQ1_DET_SHIFT (17U) -/*! IRQ1_DET - Interrupt 1 Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_IRQ1_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_IRQ1_DET_SHIFT)) & VBAT_WAKENA_IRQ1_DET_MASK) - -#define VBAT_WAKENA_IRQ2_DET_MASK (0x40000U) -#define VBAT_WAKENA_IRQ2_DET_SHIFT (18U) -/*! IRQ2_DET - Interrupt 2 Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_IRQ2_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_IRQ2_DET_SHIFT)) & VBAT_WAKENA_IRQ2_DET_MASK) - -#define VBAT_WAKENA_IRQ3_DET_MASK (0x80000U) -#define VBAT_WAKENA_IRQ3_DET_SHIFT (19U) -/*! IRQ3_DET - Interrupt 3 Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_IRQ3_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_IRQ3_DET_SHIFT)) & VBAT_WAKENA_IRQ3_DET_MASK) -/*! @} */ - -/*! @name WAKENB - Wake-up Enable B */ -/*! @{ */ - -#define VBAT_WAKENB_INVERSE_MASK (0xFFFFFU) -#define VBAT_WAKENB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse Value */ -#define VBAT_WAKENB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENB_INVERSE_SHIFT)) & VBAT_WAKENB_INVERSE_MASK) -/*! @} */ - -/*! @name TAMPERA - Tamper Enable A */ -/*! @{ */ - -#define VBAT_TAMPERA_POR_DET_MASK (0x1U) -#define VBAT_TAMPERA_POR_DET_SHIFT (0U) -/*! POR_DET - POR Detect - * 0b0..Tamper disabled - * 0b1..Tamper enabled - */ -#define VBAT_TAMPERA_POR_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMPERA_POR_DET_SHIFT)) & VBAT_TAMPERA_POR_DET_MASK) - -#define VBAT_TAMPERA_CLOCK_DET_MASK (0x40U) -#define VBAT_TAMPERA_CLOCK_DET_SHIFT (6U) -/*! CLOCK_DET - Clock Detect - * 0b0..Tamper disabled - * 0b1..Tamper enabled - */ -#define VBAT_TAMPERA_CLOCK_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMPERA_CLOCK_DET_SHIFT)) & VBAT_TAMPERA_CLOCK_DET_MASK) - -#define VBAT_TAMPERA_CONFIG_DET_MASK (0x80U) -#define VBAT_TAMPERA_CONFIG_DET_SHIFT (7U) -/*! CONFIG_DET - Configuration Detect - * 0b0..Tamper disabled - * 0b1..Tamper enabled - */ -#define VBAT_TAMPERA_CONFIG_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMPERA_CONFIG_DET_SHIFT)) & VBAT_TAMPERA_CONFIG_DET_MASK) - -#define VBAT_TAMPERA_VOLT_DET_MASK (0x100U) -#define VBAT_TAMPERA_VOLT_DET_SHIFT (8U) -/*! VOLT_DET - Voltage Detect - * 0b0..Tamper disabled - * 0b1..Tamper enabled - */ -#define VBAT_TAMPERA_VOLT_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMPERA_VOLT_DET_SHIFT)) & VBAT_TAMPERA_VOLT_DET_MASK) - -#define VBAT_TAMPERA_TEMP_DET_MASK (0x200U) -#define VBAT_TAMPERA_TEMP_DET_SHIFT (9U) -/*! TEMP_DET - Temperature Detect - * 0b0..Tamper disabled - * 0b1..Tamper enabled - */ -#define VBAT_TAMPERA_TEMP_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMPERA_TEMP_DET_SHIFT)) & VBAT_TAMPERA_TEMP_DET_MASK) - -#define VBAT_TAMPERA_LIGHT_DET_MASK (0x400U) -#define VBAT_TAMPERA_LIGHT_DET_SHIFT (10U) -/*! LIGHT_DET - Light Detect - * 0b0..Tamper disabled - * 0b1..Tamper enabled - */ -#define VBAT_TAMPERA_LIGHT_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMPERA_LIGHT_DET_SHIFT)) & VBAT_TAMPERA_LIGHT_DET_MASK) - -#define VBAT_TAMPERA_SEC0_DET_MASK (0x1000U) -#define VBAT_TAMPERA_SEC0_DET_SHIFT (12U) -/*! SEC0_DET - Input 0 Detect - * 0b0..Tamper disabled - * 0b1..Tamper enabled - */ -#define VBAT_TAMPERA_SEC0_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMPERA_SEC0_DET_SHIFT)) & VBAT_TAMPERA_SEC0_DET_MASK) -/*! @} */ - -/*! @name TAMPERB - Tamper Enable B */ -/*! @{ */ - -#define VBAT_TAMPERB_INVERSE_MASK (0xFFFFU) -#define VBAT_TAMPERB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse value */ -#define VBAT_TAMPERB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMPERB_INVERSE_SHIFT)) & VBAT_TAMPERB_INVERSE_MASK) -/*! @} */ - -/*! @name LOCKA - Lock A */ -/*! @{ */ - -#define VBAT_LOCKA_LOCK_MASK (0x1U) -#define VBAT_LOCKA_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b0..Disables lock - * 0b1..Enables lock. Cleared by VBAT POR. - */ -#define VBAT_LOCKA_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LOCKA_LOCK_SHIFT)) & VBAT_LOCKA_LOCK_MASK) -/*! @} */ - -/*! @name LOCKB - Lock B */ -/*! @{ */ - -#define VBAT_LOCKB_LOCK_MASK (0x1U) -#define VBAT_LOCKB_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b1..Disables lock - * 0b0..Enables lock - */ -#define VBAT_LOCKB_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LOCKB_LOCK_SHIFT)) & VBAT_LOCKB_LOCK_MASK) -/*! @} */ - -/*! @name WAKECFG - Wake-up Configuration */ -/*! @{ */ - -#define VBAT_WAKECFG_OUT_MASK (0x1U) -#define VBAT_WAKECFG_OUT_SHIFT (0U) -/*! OUT - Output - * 0b0..Logic zero (asserted) - * 0b1..Logic one - */ -#define VBAT_WAKECFG_OUT(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKECFG_OUT_SHIFT)) & VBAT_WAKECFG_OUT_MASK) -/*! @} */ - -/*! @name OSCCTLA - Oscillator Control A */ -/*! @{ */ - -#define VBAT_OSCCTLA_OSC_EN_MASK (0x1U) -#define VBAT_OSCCTLA_OSC_EN_SHIFT (0U) -/*! OSC_EN - Crystal Oscillator Enable - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_OSCCTLA_OSC_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCTLA_OSC_EN_SHIFT)) & VBAT_OSCCTLA_OSC_EN_MASK) - -#define VBAT_OSCCTLA_OSC_BYP_EN_MASK (0x2U) -#define VBAT_OSCCTLA_OSC_BYP_EN_SHIFT (1U) -/*! OSC_BYP_EN - Crystal Oscillator Bypass Enable - * 0b0..Does not bypass - * 0b1..Bypass - */ -#define VBAT_OSCCTLA_OSC_BYP_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCTLA_OSC_BYP_EN_SHIFT)) & VBAT_OSCCTLA_OSC_BYP_EN_MASK) - -#define VBAT_OSCCTLA_COARSE_AMP_GAIN_MASK (0xCU) -#define VBAT_OSCCTLA_COARSE_AMP_GAIN_SHIFT (2U) -/*! COARSE_AMP_GAIN - Amplifier gain adjustment bits to allow the use of a wide range of external - * crystal ESR values See the device datasheet for the ranges supported by this device - * 0b00..ESR Range 0 - * 0b01..ESR Range 1 - * 0b10..ESR Range 2 - * 0b11..ESR Range 3 - */ -#define VBAT_OSCCTLA_COARSE_AMP_GAIN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCTLA_COARSE_AMP_GAIN_SHIFT)) & VBAT_OSCCTLA_COARSE_AMP_GAIN_MASK) - -#define VBAT_OSCCTLA_CAP_SEL_EN_MASK (0x80U) -#define VBAT_OSCCTLA_CAP_SEL_EN_SHIFT (7U) -/*! CAP_SEL_EN - Crystal Load Capacitance Selection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_OSCCTLA_CAP_SEL_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCTLA_CAP_SEL_EN_SHIFT)) & VBAT_OSCCTLA_CAP_SEL_EN_MASK) - -#define VBAT_OSCCTLA_EXTAL_CAP_SEL_MASK (0xF00U) -#define VBAT_OSCCTLA_EXTAL_CAP_SEL_SHIFT (8U) -/*! EXTAL_CAP_SEL - Crystal Load Capacitance Selection - * 0b0000..0 pF - * 0b0001..2 pF - * 0b0010..4 pF - * 0b0011..6 pF - * 0b0100..8 pF - * 0b0101..10 pF - * 0b0110..12 pF - * 0b0111..14 pF - * 0b1000..16 pF - * 0b1001..18 pF - * 0b1010..20 pF - * 0b1011..22 pF - * 0b1100..24 pF - * 0b1101..26 pF - * 0b1110..28 pF - * 0b1111..30 pF - */ -#define VBAT_OSCCTLA_EXTAL_CAP_SEL(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCTLA_EXTAL_CAP_SEL_SHIFT)) & VBAT_OSCCTLA_EXTAL_CAP_SEL_MASK) - -#define VBAT_OSCCTLA_XTAL_CAP_SEL_MASK (0xF000U) -#define VBAT_OSCCTLA_XTAL_CAP_SEL_SHIFT (12U) -/*! XTAL_CAP_SEL - Crystal Load Capacitance Selection - * 0b0000..0 pF - * 0b0001..2 pF - * 0b0010..4 pF - * 0b0011..6 pF - * 0b0100..8 pF - * 0b0101..10 pF - * 0b0110..12 pF - * 0b0111..14 pF - * 0b1000..16 pF - * 0b1001..18 pF - * 0b1010..20 pF - * 0b1011..22 pF - * 0b1100..24 pF - * 0b1101..26 pF - * 0b1110..28 pF - * 0b1111..30 pF - */ -#define VBAT_OSCCTLA_XTAL_CAP_SEL(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCTLA_XTAL_CAP_SEL_SHIFT)) & VBAT_OSCCTLA_XTAL_CAP_SEL_MASK) - -#define VBAT_OSCCTLA_MODE_EN_MASK (0x30000U) -#define VBAT_OSCCTLA_MODE_EN_SHIFT (16U) -/*! MODE_EN - Mode Enable - * 0b00..Normal mode - * 0b01..Startup mode - * 0b11..Low power mode - */ -#define VBAT_OSCCTLA_MODE_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCTLA_MODE_EN_SHIFT)) & VBAT_OSCCTLA_MODE_EN_MASK) - -#define VBAT_OSCCTLA_SUPPLY_DET_MASK (0xC0000U) -#define VBAT_OSCCTLA_SUPPLY_DET_SHIFT (18U) -/*! SUPPLY_DET - Supply Detector Trim - * 0b00..VBAT supply is less than 3V - * 0b01..VBAT supply is greater than 3V - */ -#define VBAT_OSCCTLA_SUPPLY_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCTLA_SUPPLY_DET_SHIFT)) & VBAT_OSCCTLA_SUPPLY_DET_MASK) -/*! @} */ - -/*! @name OSCCTLB - Oscillator Control B */ -/*! @{ */ - -#define VBAT_OSCCTLB_INVERSE_MASK (0xFFFFFU) -#define VBAT_OSCCTLB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse Value */ -#define VBAT_OSCCTLB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCTLB_INVERSE_SHIFT)) & VBAT_OSCCTLB_INVERSE_MASK) -/*! @} */ - -/*! @name OSCCFGA - Oscillator Configuration A */ -/*! @{ */ - -#define VBAT_OSCCFGA_CMP_TRIM_MASK (0x3U) -#define VBAT_OSCCFGA_CMP_TRIM_SHIFT (0U) -/*! CMP_TRIM - Comparator Trim - * 0b00..760 mV - * 0b01..770 mV - * 0b11..740 mV - */ -#define VBAT_OSCCFGA_CMP_TRIM(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCFGA_CMP_TRIM_SHIFT)) & VBAT_OSCCFGA_CMP_TRIM_MASK) - -#define VBAT_OSCCFGA_CAP2_TRIM_MASK (0x4U) -#define VBAT_OSCCFGA_CAP2_TRIM_SHIFT (2U) -/*! CAP2_TRIM - CAP2_TRIM */ -#define VBAT_OSCCFGA_CAP2_TRIM(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCFGA_CAP2_TRIM_SHIFT)) & VBAT_OSCCFGA_CAP2_TRIM_MASK) - -#define VBAT_OSCCFGA_DLY_TRIM_MASK (0x78U) -#define VBAT_OSCCFGA_DLY_TRIM_SHIFT (3U) -/*! DLY_TRIM - Delay Trim - * 0b0000..P current 9(nA) and N Current 6(nA) - * 0b0001..P current 13(nA) and N Current 6(nA) - * 0b0011..P current 4(nA) and N Current 6(nA) - * 0b0100..P current 9(nA) and N Current 4(nA) - * 0b0101..P current 13(nA) and N Current 4(nA) - * 0b0111..P current 4(nA) and N Current 4(nA) - * 0b1000..P current 9(nA) and N Current 2(nA) - * 0b1001..P current 13(nA) and N Current 2(nA) - * 0b1011..P current 4(nA) and N Current 2(nA) - */ -#define VBAT_OSCCFGA_DLY_TRIM(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCFGA_DLY_TRIM_SHIFT)) & VBAT_OSCCFGA_DLY_TRIM_MASK) - -#define VBAT_OSCCFGA_CAP_TRIM_MASK (0x180U) -#define VBAT_OSCCFGA_CAP_TRIM_SHIFT (7U) -/*! CAP_TRIM - Capacitor Trim - * 0b00..Default (when CAP2_TRIM = 0 and CAP_TRIM[1:0] = 00 ) - * 0b01..-1us (when CAP2_TRIM = 0 and CAP_TRIM[1:0] = 01) - * 0b10..-2us (when CAP2_TRIM = 0 and CAP_TRIM[1:0] = 10) or or +3.5us (when CAP2_TRIM = 1 and CAP_TRIM[1:0] = 10) - * 0b11..-2.5us (when CAP2_TRIM = 0 and CAP_TRIM[1:0] = 11) or +1us (when CAP2_TRIM = 1 and CAP_TRIM[1:0] = 11) - */ -#define VBAT_OSCCFGA_CAP_TRIM(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCFGA_CAP_TRIM_SHIFT)) & VBAT_OSCCFGA_CAP_TRIM_MASK) - -#define VBAT_OSCCFGA_INIT_TRIM_MASK (0xE00U) -#define VBAT_OSCCFGA_INIT_TRIM_SHIFT (9U) -/*! INIT_TRIM - Initialization Trim - * 0b000..8 s - * 0b001..4 s - * 0b010..2 s - * 0b011..1 s - * 0b100..0.5 s - * 0b101..0.25 s - * 0b110..0.125 s - * 0b111..0.5 ms - */ -#define VBAT_OSCCFGA_INIT_TRIM(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCFGA_INIT_TRIM_SHIFT)) & VBAT_OSCCFGA_INIT_TRIM_MASK) -/*! @} */ - -/*! @name OSCCFGB - Oscillator Configuration B */ -/*! @{ */ - -#define VBAT_OSCCFGB_INVERSE_MASK (0xFFFU) -#define VBAT_OSCCFGB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse Value */ -#define VBAT_OSCCFGB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCFGB_INVERSE_SHIFT)) & VBAT_OSCCFGB_INVERSE_MASK) -/*! @} */ - -/*! @name OSCLCKA - Oscillator Lock A */ -/*! @{ */ - -#define VBAT_OSCLCKA_LOCK_MASK (0x1U) -#define VBAT_OSCLCKA_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b0..Do not block - * 0b1..Block - */ -#define VBAT_OSCLCKA_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCLCKA_LOCK_SHIFT)) & VBAT_OSCLCKA_LOCK_MASK) -/*! @} */ - -/*! @name OSCLCKB - Oscillator Lock B */ -/*! @{ */ - -#define VBAT_OSCLCKB_LOCK_MASK (0x1U) -#define VBAT_OSCLCKB_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b1..Do not block - * 0b0..Block - */ -#define VBAT_OSCLCKB_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCLCKB_LOCK_SHIFT)) & VBAT_OSCLCKB_LOCK_MASK) -/*! @} */ - -/*! @name OSCCLKE - Oscillator Clock Enable */ -/*! @{ */ - -#define VBAT_OSCCLKE_CLKE_MASK (0xFU) -#define VBAT_OSCCLKE_CLKE_SHIFT (0U) -/*! CLKE - Clock Enable */ -#define VBAT_OSCCLKE_CLKE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCLKE_CLKE_SHIFT)) & VBAT_OSCCLKE_CLKE_MASK) -/*! @} */ - -/*! @name FROCTLA - FRO16K Control A */ -/*! @{ */ - -#define VBAT_FROCTLA_FRO_EN_MASK (0x1U) -#define VBAT_FROCTLA_FRO_EN_SHIFT (0U) -/*! FRO_EN - FRO16K Enable - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_FROCTLA_FRO_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_FROCTLA_FRO_EN_SHIFT)) & VBAT_FROCTLA_FRO_EN_MASK) -/*! @} */ - -/*! @name FROCTLB - FRO16K Control B */ -/*! @{ */ - -#define VBAT_FROCTLB_INVERSE_MASK (0x1U) -#define VBAT_FROCTLB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse Value */ -#define VBAT_FROCTLB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_FROCTLB_INVERSE_SHIFT)) & VBAT_FROCTLB_INVERSE_MASK) -/*! @} */ - -/*! @name FROLCKA - FRO16K Lock A */ -/*! @{ */ - -#define VBAT_FROLCKA_LOCK_MASK (0x1U) -#define VBAT_FROLCKA_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b0..Do not block - * 0b1..Block - */ -#define VBAT_FROLCKA_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_FROLCKA_LOCK_SHIFT)) & VBAT_FROLCKA_LOCK_MASK) -/*! @} */ - -/*! @name FROLCKB - FRO16K Lock B */ -/*! @{ */ - -#define VBAT_FROLCKB_LOCK_MASK (0x1U) -#define VBAT_FROLCKB_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b1..Do not block - * 0b0..Block - */ -#define VBAT_FROLCKB_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_FROLCKB_LOCK_SHIFT)) & VBAT_FROLCKB_LOCK_MASK) -/*! @} */ - -/*! @name FROCLKE - FRO16K Clock Enable */ -/*! @{ */ - -#define VBAT_FROCLKE_CLKE_MASK (0xFU) -#define VBAT_FROCLKE_CLKE_SHIFT (0U) -/*! CLKE - Clock Enable */ -#define VBAT_FROCLKE_CLKE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_FROCLKE_CLKE_SHIFT)) & VBAT_FROCLKE_CLKE_MASK) -/*! @} */ - -/*! @name LDOCTLA - LDO_RAM Control A */ -/*! @{ */ - -#define VBAT_LDOCTLA_BG_EN_MASK (0x1U) -#define VBAT_LDOCTLA_BG_EN_SHIFT (0U) -/*! BG_EN - Bandgap Enable - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_LDOCTLA_BG_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDOCTLA_BG_EN_SHIFT)) & VBAT_LDOCTLA_BG_EN_MASK) - -#define VBAT_LDOCTLA_LDO_EN_MASK (0x2U) -#define VBAT_LDOCTLA_LDO_EN_SHIFT (1U) -/*! LDO_EN - LDO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_LDOCTLA_LDO_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDOCTLA_LDO_EN_SHIFT)) & VBAT_LDOCTLA_LDO_EN_MASK) - -#define VBAT_LDOCTLA_REFRESH_EN_MASK (0x4U) -#define VBAT_LDOCTLA_REFRESH_EN_SHIFT (2U) -/*! REFRESH_EN - Refresh Enable - * 0b0..Refresh mode is disabled - * 0b1..Refresh mode is enabled for low power operation - */ -#define VBAT_LDOCTLA_REFRESH_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDOCTLA_REFRESH_EN_SHIFT)) & VBAT_LDOCTLA_REFRESH_EN_MASK) -/*! @} */ - -/*! @name LDOCTLB - LDO_RAM Control B */ -/*! @{ */ - -#define VBAT_LDOCTLB_INVERSE_MASK (0x7U) -#define VBAT_LDOCTLB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse Value */ -#define VBAT_LDOCTLB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDOCTLB_INVERSE_SHIFT)) & VBAT_LDOCTLB_INVERSE_MASK) -/*! @} */ - -/*! @name LDOLCKA - LDO_RAM Lock A */ -/*! @{ */ - -#define VBAT_LDOLCKA_LOCK_MASK (0x1U) -#define VBAT_LDOLCKA_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b0..Do not block - * 0b1..Block - */ -#define VBAT_LDOLCKA_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDOLCKA_LOCK_SHIFT)) & VBAT_LDOLCKA_LOCK_MASK) -/*! @} */ - -/*! @name LDOLCKB - LDO_RAM Lock B */ -/*! @{ */ - -#define VBAT_LDOLCKB_LOCK_MASK (0x1U) -#define VBAT_LDOLCKB_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b1..Do not block - * 0b0..Block - */ -#define VBAT_LDOLCKB_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDOLCKB_LOCK_SHIFT)) & VBAT_LDOLCKB_LOCK_MASK) -/*! @} */ - -/*! @name LDORAMC - RAM Control */ -/*! @{ */ - -#define VBAT_LDORAMC_ISO_MASK (0x1U) -#define VBAT_LDORAMC_ISO_SHIFT (0U) -/*! ISO - Isolate SRAM - * 0b0..State follows the chip power modes - * 0b1..Isolates SRAM and places it in Low-Power Retention mode - */ -#define VBAT_LDORAMC_ISO(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDORAMC_ISO_SHIFT)) & VBAT_LDORAMC_ISO_MASK) - -#define VBAT_LDORAMC_SWI_MASK (0x2U) -#define VBAT_LDORAMC_SWI_SHIFT (1U) -/*! SWI - Switch SRAM - * 0b0..Supply follows the chip power modes - * 0b1..LDO_RAM powers the array - */ -#define VBAT_LDORAMC_SWI(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDORAMC_SWI_SHIFT)) & VBAT_LDORAMC_SWI_MASK) - -#define VBAT_LDORAMC_RET0_MASK (0x100U) -#define VBAT_LDORAMC_RET0_SHIFT (8U) -/*! RET0 - Retention - * 0b0..Corresponding SRAM array is retained in low-power modes - * 0b1..Corresponding SRAM array is not retained in low-power modes - */ -#define VBAT_LDORAMC_RET0(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDORAMC_RET0_SHIFT)) & VBAT_LDORAMC_RET0_MASK) - -#define VBAT_LDORAMC_RET1_MASK (0x200U) -#define VBAT_LDORAMC_RET1_SHIFT (9U) -/*! RET1 - Retention - * 0b0..Corresponding SRAM array is retained in low-power modes - * 0b1..Corresponding SRAM array is not retained in low-power modes - */ -#define VBAT_LDORAMC_RET1(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDORAMC_RET1_SHIFT)) & VBAT_LDORAMC_RET1_MASK) - -#define VBAT_LDORAMC_RET2_MASK (0x400U) -#define VBAT_LDORAMC_RET2_SHIFT (10U) -/*! RET2 - Retention - * 0b0..Corresponding SRAM array is retained in low-power modes - * 0b1..Corresponding SRAM array is not retained in low-power modes - */ -#define VBAT_LDORAMC_RET2(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDORAMC_RET2_SHIFT)) & VBAT_LDORAMC_RET2_MASK) - -#define VBAT_LDORAMC_RET3_MASK (0x800U) -#define VBAT_LDORAMC_RET3_SHIFT (11U) -/*! RET3 - Retention - * 0b0..Corresponding SRAM array is retained in low-power modes - * 0b1..Corresponding SRAM array is not retained in low-power modes - */ -#define VBAT_LDORAMC_RET3(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDORAMC_RET3_SHIFT)) & VBAT_LDORAMC_RET3_MASK) -/*! @} */ - -/*! @name LDOTIMER0 - Bandgap Timer 0 */ -/*! @{ */ - -#define VBAT_LDOTIMER0_TIMCFG_MASK (0x7U) -#define VBAT_LDOTIMER0_TIMCFG_SHIFT (0U) -/*! TIMCFG - Timeout Configuration - * 0b111..7.8125 ms - * 0b110..15.625 ms - * 0b101..31.25 ms - * 0b100..62.5 ms - * 0b011..125 ms - * 0b010..250 ms - * 0b001..500 ms - * 0b000..1 s - */ -#define VBAT_LDOTIMER0_TIMCFG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDOTIMER0_TIMCFG_SHIFT)) & VBAT_LDOTIMER0_TIMCFG_MASK) - -#define VBAT_LDOTIMER0_TIMEN_MASK (0x80000000U) -#define VBAT_LDOTIMER0_TIMEN_SHIFT (31U) -/*! TIMEN - Bandgap Timeout Period Enable - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_LDOTIMER0_TIMEN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDOTIMER0_TIMEN_SHIFT)) & VBAT_LDOTIMER0_TIMEN_MASK) -/*! @} */ - -/*! @name LDOTIMER1 - Bandgap Timer 1 */ -/*! @{ */ - -#define VBAT_LDOTIMER1_TIMCFG_MASK (0xFFFFFFU) -#define VBAT_LDOTIMER1_TIMCFG_SHIFT (0U) -/*! TIMCFG - Timeout Configuration */ -#define VBAT_LDOTIMER1_TIMCFG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDOTIMER1_TIMCFG_SHIFT)) & VBAT_LDOTIMER1_TIMCFG_MASK) - -#define VBAT_LDOTIMER1_TIMEN_MASK (0x80000000U) -#define VBAT_LDOTIMER1_TIMEN_SHIFT (31U) -/*! TIMEN - Bandgap Timeout Period Enable - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_LDOTIMER1_TIMEN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDOTIMER1_TIMEN_SHIFT)) & VBAT_LDOTIMER1_TIMEN_MASK) -/*! @} */ - -/*! @name MONCTLA - CLKMON Control A */ -/*! @{ */ - -#define VBAT_MONCTLA_MON_EN_MASK (0x1U) -#define VBAT_MONCTLA_MON_EN_SHIFT (0U) -/*! MON_EN - CLKMON Enable - * 0b0..CLKMON is disabled - * 0b1..CLKMON is enabled - */ -#define VBAT_MONCTLA_MON_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_MONCTLA_MON_EN_SHIFT)) & VBAT_MONCTLA_MON_EN_MASK) -/*! @} */ - -/*! @name MONCTLB - CLKMON Control B */ -/*! @{ */ - -#define VBAT_MONCTLB_INVERSE_MASK (0x1U) -#define VBAT_MONCTLB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse value */ -#define VBAT_MONCTLB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_MONCTLB_INVERSE_SHIFT)) & VBAT_MONCTLB_INVERSE_MASK) -/*! @} */ - -/*! @name MONCFGA - CLKMON Configuration A */ -/*! @{ */ - -#define VBAT_MONCFGA_FREQ_TRIM_MASK (0x3U) -#define VBAT_MONCFGA_FREQ_TRIM_SHIFT (0U) -/*! FREQ_TRIM - Frequency Trim - * 0b00..Clock monitor asserts 2 cycle after expected edge - * 0b01..Clock monitor asserts 4 cycles after expected edge - * 0b10..Clock monitor asserts 6 cycles after expected edge - * 0b11..Clock monitor asserts 8 cycles after expected edge - */ -#define VBAT_MONCFGA_FREQ_TRIM(x) (((uint32_t)(((uint32_t)(x)) << VBAT_MONCFGA_FREQ_TRIM_SHIFT)) & VBAT_MONCFGA_FREQ_TRIM_MASK) - -#define VBAT_MONCFGA_DIVIDE_TRIM_MASK (0x4U) -#define VBAT_MONCFGA_DIVIDE_TRIM_SHIFT (2U) -/*! DIVIDE_TRIM - Divide Trim - * 0b0..Clock monitor operates at 1 kHz - * 0b1..Clock monitor operates at 64 Hz - */ -#define VBAT_MONCFGA_DIVIDE_TRIM(x) (((uint32_t)(((uint32_t)(x)) << VBAT_MONCFGA_DIVIDE_TRIM_SHIFT)) & VBAT_MONCFGA_DIVIDE_TRIM_MASK) - -#define VBAT_MONCFGA_RSVD_TRIM_MASK (0xF8U) -#define VBAT_MONCFGA_RSVD_TRIM_SHIFT (3U) -/*! RSVD_TRIM - Reserved Trim */ -#define VBAT_MONCFGA_RSVD_TRIM(x) (((uint32_t)(((uint32_t)(x)) << VBAT_MONCFGA_RSVD_TRIM_SHIFT)) & VBAT_MONCFGA_RSVD_TRIM_MASK) -/*! @} */ - -/*! @name MONCFGB - CLKMON Configuration B */ -/*! @{ */ - -#define VBAT_MONCFGB_INVERSE_MASK (0xFFU) -#define VBAT_MONCFGB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse value */ -#define VBAT_MONCFGB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_MONCFGB_INVERSE_SHIFT)) & VBAT_MONCFGB_INVERSE_MASK) -/*! @} */ - -/*! @name MONLCKA - CLKMON Lock A */ -/*! @{ */ - -#define VBAT_MONLCKA_LOCK_MASK (0x1U) -#define VBAT_MONLCKA_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b0..Lock is disabled - * 0b1..Lock is enabled - */ -#define VBAT_MONLCKA_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_MONLCKA_LOCK_SHIFT)) & VBAT_MONLCKA_LOCK_MASK) -/*! @} */ - -/*! @name MONLCKB - CLKMON Lock B */ -/*! @{ */ - -#define VBAT_MONLCKB_LOCK_MASK (0x1U) -#define VBAT_MONLCKB_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b1..Lock is disabled - * 0b0..Lock is enabled - */ -#define VBAT_MONLCKB_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_MONLCKB_LOCK_SHIFT)) & VBAT_MONLCKB_LOCK_MASK) -/*! @} */ - -/*! @name TAMCTLA - TAMPER Control A */ -/*! @{ */ - -#define VBAT_TAMCTLA_VOLT_EN_MASK (0x1U) -#define VBAT_TAMCTLA_VOLT_EN_SHIFT (0U) -/*! VOLT_EN - Voltage Detect Enable - * 0b0..Voltage detect is disabled - * 0b1..Voltage detect is enabled - */ -#define VBAT_TAMCTLA_VOLT_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMCTLA_VOLT_EN_SHIFT)) & VBAT_TAMCTLA_VOLT_EN_MASK) - -#define VBAT_TAMCTLA_TEMP_EN_MASK (0x2U) -#define VBAT_TAMCTLA_TEMP_EN_SHIFT (1U) -/*! TEMP_EN - Temperature Detect Enable - * 0b0..Temperature detect is disabled - * 0b1..Temperature detect is enabled - */ -#define VBAT_TAMCTLA_TEMP_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMCTLA_TEMP_EN_SHIFT)) & VBAT_TAMCTLA_TEMP_EN_MASK) - -#define VBAT_TAMCTLA_LIGHT_EN_MASK (0x4U) -#define VBAT_TAMCTLA_LIGHT_EN_SHIFT (2U) -/*! LIGHT_EN - Light Detect Enable - * 0b0..Light detect is disabled - * 0b1..Light detect is enabled - */ -#define VBAT_TAMCTLA_LIGHT_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMCTLA_LIGHT_EN_SHIFT)) & VBAT_TAMCTLA_LIGHT_EN_MASK) -/*! @} */ - -/*! @name TAMCTLB - TAMPER Control B */ -/*! @{ */ - -#define VBAT_TAMCTLB_INVERSE_MASK (0xFU) -#define VBAT_TAMCTLB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse value */ -#define VBAT_TAMCTLB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMCTLB_INVERSE_SHIFT)) & VBAT_TAMCTLB_INVERSE_MASK) -/*! @} */ - -/*! @name TAMLCKA - TAMPER Lock A */ -/*! @{ */ - -#define VBAT_TAMLCKA_LOCK_MASK (0x1U) -#define VBAT_TAMLCKA_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b0..Lock is disabled - * 0b1..Lock is enabled - */ -#define VBAT_TAMLCKA_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMLCKA_LOCK_SHIFT)) & VBAT_TAMLCKA_LOCK_MASK) -/*! @} */ - -/*! @name TAMLCKB - TAMPER Lock B */ -/*! @{ */ - -#define VBAT_TAMLCKB_LOCK_MASK (0x1U) -#define VBAT_TAMLCKB_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b1..Lock is disabled - * 0b0..Lock is enabled - */ -#define VBAT_TAMLCKB_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMLCKB_LOCK_SHIFT)) & VBAT_TAMLCKB_LOCK_MASK) -/*! @} */ - -/*! @name SWICTLA - Switch Control A */ -/*! @{ */ - -#define VBAT_SWICTLA_SWI_EN_MASK (0x1U) -#define VBAT_SWICTLA_SWI_EN_SHIFT (0U) -/*! SWI_EN - Switch Enable - * 0b0..VDD_BAT - * 0b1..VDD_SYS - */ -#define VBAT_SWICTLA_SWI_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_SWICTLA_SWI_EN_SHIFT)) & VBAT_SWICTLA_SWI_EN_MASK) - -#define VBAT_SWICTLA_LP_EN_MASK (0x2U) -#define VBAT_SWICTLA_LP_EN_SHIFT (1U) -/*! LP_EN - Low Power Enable - * 0b0..VDD_BAT always supplies VBAT modules in low-power modes - * 0b1..VDD_SYS always supplies VBAT modules if SWI_EN is also 1 - */ -#define VBAT_SWICTLA_LP_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_SWICTLA_LP_EN_SHIFT)) & VBAT_SWICTLA_LP_EN_MASK) -/*! @} */ - -/*! @name SWICTLB - Switch Control B */ -/*! @{ */ - -#define VBAT_SWICTLB_INVERSE_MASK (0x3U) -#define VBAT_SWICTLB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse Value */ -#define VBAT_SWICTLB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_SWICTLB_INVERSE_SHIFT)) & VBAT_SWICTLB_INVERSE_MASK) -/*! @} */ - -/*! @name SWILCKA - Switch Lock A */ -/*! @{ */ - -#define VBAT_SWILCKA_LOCK_MASK (0x1U) -#define VBAT_SWILCKA_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b0..Do not block - * 0b1..Block - */ -#define VBAT_SWILCKA_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_SWILCKA_LOCK_SHIFT)) & VBAT_SWILCKA_LOCK_MASK) -/*! @} */ - -/*! @name SWILCKB - Switch Lock B */ -/*! @{ */ - -#define VBAT_SWILCKB_LOCK_MASK (0x1U) -#define VBAT_SWILCKB_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b1..Do not block - * 0b0..Block - */ -#define VBAT_SWILCKB_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_SWILCKB_LOCK_SHIFT)) & VBAT_SWILCKB_LOCK_MASK) -/*! @} */ - -/*! @name WAKEUP_WAKEUPA - Wakeup 0 Register A */ -/*! @{ */ - -#define VBAT_WAKEUP_WAKEUPA_REG_MASK (0xFFFFFFFFU) -#define VBAT_WAKEUP_WAKEUPA_REG_SHIFT (0U) -/*! REG - Register */ -#define VBAT_WAKEUP_WAKEUPA_REG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKEUP_WAKEUPA_REG_SHIFT)) & VBAT_WAKEUP_WAKEUPA_REG_MASK) -/*! @} */ - -/* The count of VBAT_WAKEUP_WAKEUPA */ -#define VBAT_WAKEUP_WAKEUPA_COUNT (2U) - -/*! @name WAKEUP_WAKEUPB - Wakeup 0 Register B */ -/*! @{ */ - -#define VBAT_WAKEUP_WAKEUPB_INVERSE_MASK (0xFFFFFFFFU) -#define VBAT_WAKEUP_WAKEUPB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse value */ -#define VBAT_WAKEUP_WAKEUPB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKEUP_WAKEUPB_INVERSE_SHIFT)) & VBAT_WAKEUP_WAKEUPB_INVERSE_MASK) -/*! @} */ - -/* The count of VBAT_WAKEUP_WAKEUPB */ -#define VBAT_WAKEUP_WAKEUPB_COUNT (2U) - -/*! @name WAKLCKA - Wakeup Lock A */ -/*! @{ */ - -#define VBAT_WAKLCKA_LOCK_MASK (0x1U) -#define VBAT_WAKLCKA_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b0..Lock is disabled - * 0b1..Lock is enabled - */ -#define VBAT_WAKLCKA_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKLCKA_LOCK_SHIFT)) & VBAT_WAKLCKA_LOCK_MASK) -/*! @} */ - -/*! @name WAKLCKB - Wakeup Lock B */ -/*! @{ */ - -#define VBAT_WAKLCKB_LOCK_MASK (0x1U) -#define VBAT_WAKLCKB_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b1..Lock is disabled - * 0b0..Lock is enabled - */ -#define VBAT_WAKLCKB_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKLCKB_LOCK_SHIFT)) & VBAT_WAKLCKB_LOCK_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group VBAT_Register_Masks */ - - -/* VBAT - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral VBAT0 base address */ - #define VBAT0_BASE (0x50059000u) - /** Peripheral VBAT0 base address */ - #define VBAT0_BASE_NS (0x40059000u) - /** Peripheral VBAT0 base pointer */ - #define VBAT0 ((VBAT_Type *)VBAT0_BASE) - /** Peripheral VBAT0 base pointer */ - #define VBAT0_NS ((VBAT_Type *)VBAT0_BASE_NS) - /** Array initializer of VBAT peripheral base addresses */ - #define VBAT_BASE_ADDRS { VBAT0_BASE } - /** Array initializer of VBAT peripheral base pointers */ - #define VBAT_BASE_PTRS { VBAT0 } - /** Array initializer of VBAT peripheral base addresses */ - #define VBAT_BASE_ADDRS_NS { VBAT0_BASE_NS } - /** Array initializer of VBAT peripheral base pointers */ - #define VBAT_BASE_PTRS_NS { VBAT0_NS } -#else - /** Peripheral VBAT0 base address */ - #define VBAT0_BASE (0x40059000u) - /** Peripheral VBAT0 base pointer */ - #define VBAT0 ((VBAT_Type *)VBAT0_BASE) - /** Array initializer of VBAT peripheral base addresses */ - #define VBAT_BASE_ADDRS { VBAT0_BASE } - /** Array initializer of VBAT peripheral base pointers */ - #define VBAT_BASE_PTRS { VBAT0 } -#endif - -/*! - * @} - */ /* end of group VBAT_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- VREF Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup VREF_Peripheral_Access_Layer VREF Peripheral Access Layer - * @{ - */ - -/** VREF - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - uint8_t RESERVED_0[4]; - __IO uint32_t CSR; /**< Control and Status, offset: 0x8 */ - uint8_t RESERVED_1[4]; - __IO uint32_t UTRIM; /**< User Trim, offset: 0x10 */ -} VREF_Type; - -/* ---------------------------------------------------------------------------- - -- VREF Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup VREF_Register_Masks VREF Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define VREF_VERID_FEATURE_MASK (0xFFFFU) -#define VREF_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number */ -#define VREF_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << VREF_VERID_FEATURE_SHIFT)) & VREF_VERID_FEATURE_MASK) - -#define VREF_VERID_MINOR_MASK (0xFF0000U) -#define VREF_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define VREF_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << VREF_VERID_MINOR_SHIFT)) & VREF_VERID_MINOR_MASK) - -#define VREF_VERID_MAJOR_MASK (0xFF000000U) -#define VREF_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define VREF_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << VREF_VERID_MAJOR_SHIFT)) & VREF_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name CSR - Control and Status */ -/*! @{ */ - -#define VREF_CSR_HCBGEN_MASK (0x1U) -#define VREF_CSR_HCBGEN_SHIFT (0U) -/*! HCBGEN - HC Bandgap Enabled - * 0b0..Disables - * 0b1..Enables - */ -#define VREF_CSR_HCBGEN(x) (((uint32_t)(((uint32_t)(x)) << VREF_CSR_HCBGEN_SHIFT)) & VREF_CSR_HCBGEN_MASK) - -#define VREF_CSR_LPBGEN_MASK (0x2U) -#define VREF_CSR_LPBGEN_SHIFT (1U) -/*! LPBGEN - Low-Power Bandgap Enable - * 0b0..Disables - * 0b1..Enables - */ -#define VREF_CSR_LPBGEN(x) (((uint32_t)(((uint32_t)(x)) << VREF_CSR_LPBGEN_SHIFT)) & VREF_CSR_LPBGEN_MASK) - -#define VREF_CSR_LPBG_BUF_EN_MASK (0x4U) -#define VREF_CSR_LPBG_BUF_EN_SHIFT (2U) -/*! LPBG_BUF_EN - Low-Power Bandgap Buffer Enable - * 0b0..Disables - * 0b1..Enables - */ -#define VREF_CSR_LPBG_BUF_EN(x) (((uint32_t)(((uint32_t)(x)) << VREF_CSR_LPBG_BUF_EN_SHIFT)) & VREF_CSR_LPBG_BUF_EN_MASK) - -#define VREF_CSR_CHOPEN_MASK (0x8U) -#define VREF_CSR_CHOPEN_SHIFT (3U) -/*! CHOPEN - Chop Oscillator Enable - * 0b0..Disables - * 0b1..Enables - */ -#define VREF_CSR_CHOPEN(x) (((uint32_t)(((uint32_t)(x)) << VREF_CSR_CHOPEN_SHIFT)) & VREF_CSR_CHOPEN_MASK) - -#define VREF_CSR_ICOMPEN_MASK (0x10U) -#define VREF_CSR_ICOMPEN_SHIFT (4U) -/*! ICOMPEN - Current Compensation Enable - * 0b0..Disables - * 0b1..Enables - */ -#define VREF_CSR_ICOMPEN(x) (((uint32_t)(((uint32_t)(x)) << VREF_CSR_ICOMPEN_SHIFT)) & VREF_CSR_ICOMPEN_MASK) - -#define VREF_CSR_REGEN_MASK (0x20U) -#define VREF_CSR_REGEN_SHIFT (5U) -/*! REGEN - Regulator Enable - * 0b0..Disables - * 0b1..Enables - */ -#define VREF_CSR_REGEN(x) (((uint32_t)(((uint32_t)(x)) << VREF_CSR_REGEN_SHIFT)) & VREF_CSR_REGEN_MASK) - -#define VREF_CSR_HI_PWR_LV_MASK (0x800U) -#define VREF_CSR_HI_PWR_LV_SHIFT (11U) -/*! HI_PWR_LV - High-Power Level - * 0b0..Low-power - * 0b1..High-power - */ -#define VREF_CSR_HI_PWR_LV(x) (((uint32_t)(((uint32_t)(x)) << VREF_CSR_HI_PWR_LV_SHIFT)) & VREF_CSR_HI_PWR_LV_MASK) - -#define VREF_CSR_BUF21EN_MASK (0x10000U) -#define VREF_CSR_BUF21EN_SHIFT (16U) -/*! BUF21EN - Internal Buffer21 Enable - * 0b0..Disables - * 0b1..Enables - */ -#define VREF_CSR_BUF21EN(x) (((uint32_t)(((uint32_t)(x)) << VREF_CSR_BUF21EN_SHIFT)) & VREF_CSR_BUF21EN_MASK) - -#define VREF_CSR_VREFST_MASK (0x80000000U) -#define VREF_CSR_VREFST_SHIFT (31U) -/*! VREFST - Internal HC Voltage Reference Stable - * 0b0..Disabled and unstable - * 0b1..Stable - */ -#define VREF_CSR_VREFST(x) (((uint32_t)(((uint32_t)(x)) << VREF_CSR_VREFST_SHIFT)) & VREF_CSR_VREFST_MASK) -/*! @} */ - -/*! @name UTRIM - User Trim */ -/*! @{ */ - -#define VREF_UTRIM_TRIM2V1_MASK (0xFU) -#define VREF_UTRIM_TRIM2V1_SHIFT (0U) -/*! TRIM2V1 - VREF 2.1 V Trim */ -#define VREF_UTRIM_TRIM2V1(x) (((uint32_t)(((uint32_t)(x)) << VREF_UTRIM_TRIM2V1_SHIFT)) & VREF_UTRIM_TRIM2V1_MASK) - -#define VREF_UTRIM_VREFTRIM_MASK (0x3F00U) -#define VREF_UTRIM_VREFTRIM_SHIFT (8U) -/*! VREFTRIM - VREF Trim */ -#define VREF_UTRIM_VREFTRIM(x) (((uint32_t)(((uint32_t)(x)) << VREF_UTRIM_VREFTRIM_SHIFT)) & VREF_UTRIM_VREFTRIM_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group VREF_Register_Masks */ - - -/* VREF - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral VREF0 base address */ - #define VREF0_BASE (0x50111000u) - /** Peripheral VREF0 base address */ - #define VREF0_BASE_NS (0x40111000u) - /** Peripheral VREF0 base pointer */ - #define VREF0 ((VREF_Type *)VREF0_BASE) - /** Peripheral VREF0 base pointer */ - #define VREF0_NS ((VREF_Type *)VREF0_BASE_NS) - /** Array initializer of VREF peripheral base addresses */ - #define VREF_BASE_ADDRS { VREF0_BASE } - /** Array initializer of VREF peripheral base pointers */ - #define VREF_BASE_PTRS { VREF0 } - /** Array initializer of VREF peripheral base addresses */ - #define VREF_BASE_ADDRS_NS { VREF0_BASE_NS } - /** Array initializer of VREF peripheral base pointers */ - #define VREF_BASE_PTRS_NS { VREF0_NS } -#else - /** Peripheral VREF0 base address */ - #define VREF0_BASE (0x40111000u) - /** Peripheral VREF0 base pointer */ - #define VREF0 ((VREF_Type *)VREF0_BASE) - /** Array initializer of VREF peripheral base addresses */ - #define VREF_BASE_ADDRS { VREF0_BASE } - /** Array initializer of VREF peripheral base pointers */ - #define VREF_BASE_PTRS { VREF0 } -#endif - -/*! - * @} - */ /* end of group VREF_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- WUU Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup WUU_Peripheral_Access_Layer WUU Peripheral Access Layer - * @{ - */ - -/** WUU - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - __IO uint32_t PE1; /**< Pin Enable 1, offset: 0x8 */ - __IO uint32_t PE2; /**< Pin Enable 2, offset: 0xC */ - uint8_t RESERVED_0[8]; - __IO uint32_t ME; /**< Module Interrupt Enable, offset: 0x18 */ - __IO uint32_t DE; /**< Module DMA/Trigger Enable, offset: 0x1C */ - __IO uint32_t PF; /**< Pin Flag, offset: 0x20 */ - uint8_t RESERVED_1[12]; - __IO uint32_t FILT; /**< Pin Filter, offset: 0x30 */ - uint8_t RESERVED_2[4]; - __IO uint32_t PDC1; /**< Pin DMA/Trigger Configuration 1, offset: 0x38 */ - __IO uint32_t PDC2; /**< Pin DMA/Trigger Configuration 2, offset: 0x3C */ - uint8_t RESERVED_3[8]; - __IO uint32_t FDC; /**< Pin Filter DMA/Trigger Configuration, offset: 0x48 */ - uint8_t RESERVED_4[4]; - __IO uint32_t PMC; /**< Pin Mode Configuration, offset: 0x50 */ - uint8_t RESERVED_5[4]; - __IO uint32_t FMC; /**< Pin Filter Mode Configuration, offset: 0x58 */ -} WUU_Type; - -/* ---------------------------------------------------------------------------- - -- WUU Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup WUU_Register_Masks WUU Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define WUU_VERID_FEATURE_MASK (0xFFFFU) -#define WUU_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Standard features implemented - * 0b0000000000000001..Support for DMA/Trigger generation from wake-up pins and filters enabled. Support for - * external pin/filter detection during all power modes enabled. - * *.. - */ -#define WUU_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << WUU_VERID_FEATURE_SHIFT)) & WUU_VERID_FEATURE_MASK) - -#define WUU_VERID_MINOR_MASK (0xFF0000U) -#define WUU_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define WUU_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << WUU_VERID_MINOR_SHIFT)) & WUU_VERID_MINOR_MASK) - -#define WUU_VERID_MAJOR_MASK (0xFF000000U) -#define WUU_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define WUU_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << WUU_VERID_MAJOR_SHIFT)) & WUU_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define WUU_PARAM_FILTERS_MASK (0xFFU) -#define WUU_PARAM_FILTERS_SHIFT (0U) -/*! FILTERS - Filter Number */ -#define WUU_PARAM_FILTERS(x) (((uint32_t)(((uint32_t)(x)) << WUU_PARAM_FILTERS_SHIFT)) & WUU_PARAM_FILTERS_MASK) - -#define WUU_PARAM_DMAS_MASK (0xFF00U) -#define WUU_PARAM_DMAS_SHIFT (8U) -/*! DMAS - DMA Number */ -#define WUU_PARAM_DMAS(x) (((uint32_t)(((uint32_t)(x)) << WUU_PARAM_DMAS_SHIFT)) & WUU_PARAM_DMAS_MASK) - -#define WUU_PARAM_MODULES_MASK (0xFF0000U) -#define WUU_PARAM_MODULES_SHIFT (16U) -/*! MODULES - Module Number */ -#define WUU_PARAM_MODULES(x) (((uint32_t)(((uint32_t)(x)) << WUU_PARAM_MODULES_SHIFT)) & WUU_PARAM_MODULES_MASK) - -#define WUU_PARAM_PINS_MASK (0xFF000000U) -#define WUU_PARAM_PINS_SHIFT (24U) -/*! PINS - Pin Number */ -#define WUU_PARAM_PINS(x) (((uint32_t)(((uint32_t)(x)) << WUU_PARAM_PINS_SHIFT)) & WUU_PARAM_PINS_MASK) -/*! @} */ - -/*! @name PE1 - Pin Enable 1 */ -/*! @{ */ - -#define WUU_PE1_WUPE0_MASK (0x3U) -#define WUU_PE1_WUPE0_SHIFT (0U) -/*! WUPE0 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE0(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE0_SHIFT)) & WUU_PE1_WUPE0_MASK) - -#define WUU_PE1_WUPE1_MASK (0xCU) -#define WUU_PE1_WUPE1_SHIFT (2U) -/*! WUPE1 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE1(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE1_SHIFT)) & WUU_PE1_WUPE1_MASK) - -#define WUU_PE1_WUPE2_MASK (0x30U) -#define WUU_PE1_WUPE2_SHIFT (4U) -/*! WUPE2 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE2(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE2_SHIFT)) & WUU_PE1_WUPE2_MASK) - -#define WUU_PE1_WUPE3_MASK (0xC0U) -#define WUU_PE1_WUPE3_SHIFT (6U) -/*! WUPE3 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE3(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE3_SHIFT)) & WUU_PE1_WUPE3_MASK) - -#define WUU_PE1_WUPE4_MASK (0x300U) -#define WUU_PE1_WUPE4_SHIFT (8U) -/*! WUPE4 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE4(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE4_SHIFT)) & WUU_PE1_WUPE4_MASK) - -#define WUU_PE1_WUPE5_MASK (0xC00U) -#define WUU_PE1_WUPE5_SHIFT (10U) -/*! WUPE5 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE5(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE5_SHIFT)) & WUU_PE1_WUPE5_MASK) - -#define WUU_PE1_WUPE6_MASK (0x3000U) -#define WUU_PE1_WUPE6_SHIFT (12U) -/*! WUPE6 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE6(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE6_SHIFT)) & WUU_PE1_WUPE6_MASK) - -#define WUU_PE1_WUPE7_MASK (0xC000U) -#define WUU_PE1_WUPE7_SHIFT (14U) -/*! WUPE7 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE7(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE7_SHIFT)) & WUU_PE1_WUPE7_MASK) - -#define WUU_PE1_WUPE8_MASK (0x30000U) -#define WUU_PE1_WUPE8_SHIFT (16U) -/*! WUPE8 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE8(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE8_SHIFT)) & WUU_PE1_WUPE8_MASK) - -#define WUU_PE1_WUPE9_MASK (0xC0000U) -#define WUU_PE1_WUPE9_SHIFT (18U) -/*! WUPE9 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE9(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE9_SHIFT)) & WUU_PE1_WUPE9_MASK) - -#define WUU_PE1_WUPE10_MASK (0x300000U) -#define WUU_PE1_WUPE10_SHIFT (20U) -/*! WUPE10 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE10(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE10_SHIFT)) & WUU_PE1_WUPE10_MASK) - -#define WUU_PE1_WUPE11_MASK (0xC00000U) -#define WUU_PE1_WUPE11_SHIFT (22U) -/*! WUPE11 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE11(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE11_SHIFT)) & WUU_PE1_WUPE11_MASK) - -#define WUU_PE1_WUPE12_MASK (0x3000000U) -#define WUU_PE1_WUPE12_SHIFT (24U) -/*! WUPE12 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE12(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE12_SHIFT)) & WUU_PE1_WUPE12_MASK) - -#define WUU_PE1_WUPE13_MASK (0xC000000U) -#define WUU_PE1_WUPE13_SHIFT (26U) -/*! WUPE13 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE13(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE13_SHIFT)) & WUU_PE1_WUPE13_MASK) - -#define WUU_PE1_WUPE14_MASK (0x30000000U) -#define WUU_PE1_WUPE14_SHIFT (28U) -/*! WUPE14 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE14(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE14_SHIFT)) & WUU_PE1_WUPE14_MASK) - -#define WUU_PE1_WUPE15_MASK (0xC0000000U) -#define WUU_PE1_WUPE15_SHIFT (30U) -/*! WUPE15 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE15(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE15_SHIFT)) & WUU_PE1_WUPE15_MASK) -/*! @} */ - -/*! @name PE2 - Pin Enable 2 */ -/*! @{ */ - -#define WUU_PE2_WUPE16_MASK (0x3U) -#define WUU_PE2_WUPE16_SHIFT (0U) -/*! WUPE16 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE16(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE16_SHIFT)) & WUU_PE2_WUPE16_MASK) - -#define WUU_PE2_WUPE17_MASK (0xCU) -#define WUU_PE2_WUPE17_SHIFT (2U) -/*! WUPE17 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE17(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE17_SHIFT)) & WUU_PE2_WUPE17_MASK) - -#define WUU_PE2_WUPE18_MASK (0x30U) -#define WUU_PE2_WUPE18_SHIFT (4U) -/*! WUPE18 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE18(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE18_SHIFT)) & WUU_PE2_WUPE18_MASK) - -#define WUU_PE2_WUPE19_MASK (0xC0U) -#define WUU_PE2_WUPE19_SHIFT (6U) -/*! WUPE19 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE19(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE19_SHIFT)) & WUU_PE2_WUPE19_MASK) - -#define WUU_PE2_WUPE20_MASK (0x300U) -#define WUU_PE2_WUPE20_SHIFT (8U) -/*! WUPE20 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE20(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE20_SHIFT)) & WUU_PE2_WUPE20_MASK) - -#define WUU_PE2_WUPE21_MASK (0xC00U) -#define WUU_PE2_WUPE21_SHIFT (10U) -/*! WUPE21 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE21(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE21_SHIFT)) & WUU_PE2_WUPE21_MASK) - -#define WUU_PE2_WUPE22_MASK (0x3000U) -#define WUU_PE2_WUPE22_SHIFT (12U) -/*! WUPE22 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE22(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE22_SHIFT)) & WUU_PE2_WUPE22_MASK) - -#define WUU_PE2_WUPE23_MASK (0xC000U) -#define WUU_PE2_WUPE23_SHIFT (14U) -/*! WUPE23 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE23(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE23_SHIFT)) & WUU_PE2_WUPE23_MASK) - -#define WUU_PE2_WUPE24_MASK (0x30000U) -#define WUU_PE2_WUPE24_SHIFT (16U) -/*! WUPE24 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE24(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE24_SHIFT)) & WUU_PE2_WUPE24_MASK) - -#define WUU_PE2_WUPE25_MASK (0xC0000U) -#define WUU_PE2_WUPE25_SHIFT (18U) -/*! WUPE25 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE25(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE25_SHIFT)) & WUU_PE2_WUPE25_MASK) - -#define WUU_PE2_WUPE26_MASK (0x300000U) -#define WUU_PE2_WUPE26_SHIFT (20U) -/*! WUPE26 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE26(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE26_SHIFT)) & WUU_PE2_WUPE26_MASK) - -#define WUU_PE2_WUPE27_MASK (0xC00000U) -#define WUU_PE2_WUPE27_SHIFT (22U) -/*! WUPE27 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE27(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE27_SHIFT)) & WUU_PE2_WUPE27_MASK) - -#define WUU_PE2_WUPE28_MASK (0x3000000U) -#define WUU_PE2_WUPE28_SHIFT (24U) -/*! WUPE28 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE28(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE28_SHIFT)) & WUU_PE2_WUPE28_MASK) - -#define WUU_PE2_WUPE29_MASK (0xC000000U) -#define WUU_PE2_WUPE29_SHIFT (26U) -/*! WUPE29 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE29(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE29_SHIFT)) & WUU_PE2_WUPE29_MASK) - -#define WUU_PE2_WUPE30_MASK (0x30000000U) -#define WUU_PE2_WUPE30_SHIFT (28U) -/*! WUPE30 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE30(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE30_SHIFT)) & WUU_PE2_WUPE30_MASK) - -#define WUU_PE2_WUPE31_MASK (0xC0000000U) -#define WUU_PE2_WUPE31_SHIFT (30U) -/*! WUPE31 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE31(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE31_SHIFT)) & WUU_PE2_WUPE31_MASK) -/*! @} */ - -/*! @name ME - Module Interrupt Enable */ -/*! @{ */ - -#define WUU_ME_WUME0_MASK (0x1U) -#define WUU_ME_WUME0_SHIFT (0U) -/*! WUME0 - Module Interrupt Wake-up Enable for Module 0 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME0(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME0_SHIFT)) & WUU_ME_WUME0_MASK) - -#define WUU_ME_WUME1_MASK (0x2U) -#define WUU_ME_WUME1_SHIFT (1U) -/*! WUME1 - Module Interrupt Wake-up Enable for Module 1 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME1(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME1_SHIFT)) & WUU_ME_WUME1_MASK) - -#define WUU_ME_WUME2_MASK (0x4U) -#define WUU_ME_WUME2_SHIFT (2U) -/*! WUME2 - Module Interrupt Wake-up Enable for Module 2 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME2(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME2_SHIFT)) & WUU_ME_WUME2_MASK) - -#define WUU_ME_WUME3_MASK (0x8U) -#define WUU_ME_WUME3_SHIFT (3U) -/*! WUME3 - Module Interrupt Wake-up Enable for Module 3 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME3(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME3_SHIFT)) & WUU_ME_WUME3_MASK) - -#define WUU_ME_WUME4_MASK (0x10U) -#define WUU_ME_WUME4_SHIFT (4U) -/*! WUME4 - Module Interrupt Wake-up Enable for Module 4 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME4(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME4_SHIFT)) & WUU_ME_WUME4_MASK) - -#define WUU_ME_WUME5_MASK (0x20U) -#define WUU_ME_WUME5_SHIFT (5U) -/*! WUME5 - Module Interrupt Wake-up Enable for Module 5 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME5(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME5_SHIFT)) & WUU_ME_WUME5_MASK) - -#define WUU_ME_WUME6_MASK (0x40U) -#define WUU_ME_WUME6_SHIFT (6U) -/*! WUME6 - Module Interrupt Wake-up Enable for Module 6 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME6(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME6_SHIFT)) & WUU_ME_WUME6_MASK) - -#define WUU_ME_WUME7_MASK (0x80U) -#define WUU_ME_WUME7_SHIFT (7U) -/*! WUME7 - Module Interrupt Wake-up Enable for Module 7 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME7(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME7_SHIFT)) & WUU_ME_WUME7_MASK) - -#define WUU_ME_WUME8_MASK (0x100U) -#define WUU_ME_WUME8_SHIFT (8U) -/*! WUME8 - Module Interrupt Wake-up Enable for Module 8 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME8(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME8_SHIFT)) & WUU_ME_WUME8_MASK) - -#define WUU_ME_WUME9_MASK (0x200U) -#define WUU_ME_WUME9_SHIFT (9U) -/*! WUME9 - Module Interrupt Wake-up Enable for Module 9 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME9(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME9_SHIFT)) & WUU_ME_WUME9_MASK) -/*! @} */ - -/*! @name DE - Module DMA/Trigger Enable */ -/*! @{ */ - -#define WUU_DE_WUDE0_MASK (0x1U) -#define WUU_DE_WUDE0_SHIFT (0U) -/*! WUDE0 - DMA/Trigger Wake-up Enable for Module 0 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE0(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE0_SHIFT)) & WUU_DE_WUDE0_MASK) - -#define WUU_DE_WUDE1_MASK (0x2U) -#define WUU_DE_WUDE1_SHIFT (1U) -/*! WUDE1 - DMA/Trigger Wake-up Enable for Module 1 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE1(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE1_SHIFT)) & WUU_DE_WUDE1_MASK) - -#define WUU_DE_WUDE2_MASK (0x4U) -#define WUU_DE_WUDE2_SHIFT (2U) -/*! WUDE2 - DMA/Trigger Wake-up Enable for Module 2 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE2(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE2_SHIFT)) & WUU_DE_WUDE2_MASK) - -#define WUU_DE_WUDE3_MASK (0x8U) -#define WUU_DE_WUDE3_SHIFT (3U) -/*! WUDE3 - DMA/Trigger Wake-up Enable for Module 3 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE3(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE3_SHIFT)) & WUU_DE_WUDE3_MASK) - -#define WUU_DE_WUDE4_MASK (0x10U) -#define WUU_DE_WUDE4_SHIFT (4U) -/*! WUDE4 - DMA/Trigger Wake-up Enable for Module 4 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE4(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE4_SHIFT)) & WUU_DE_WUDE4_MASK) - -#define WUU_DE_WUDE5_MASK (0x20U) -#define WUU_DE_WUDE5_SHIFT (5U) -/*! WUDE5 - DMA/Trigger Wake-up Enable for Module 5 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE5(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE5_SHIFT)) & WUU_DE_WUDE5_MASK) - -#define WUU_DE_WUDE6_MASK (0x40U) -#define WUU_DE_WUDE6_SHIFT (6U) -/*! WUDE6 - DMA/Trigger Wake-up Enable for Module 6 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE6(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE6_SHIFT)) & WUU_DE_WUDE6_MASK) - -#define WUU_DE_WUDE7_MASK (0x80U) -#define WUU_DE_WUDE7_SHIFT (7U) -/*! WUDE7 - DMA/Trigger Wake-up Enable for Module 7 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE7(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE7_SHIFT)) & WUU_DE_WUDE7_MASK) - -#define WUU_DE_WUDE8_MASK (0x100U) -#define WUU_DE_WUDE8_SHIFT (8U) -/*! WUDE8 - DMA/Trigger Wake-up Enable for Module 8 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE8(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE8_SHIFT)) & WUU_DE_WUDE8_MASK) - -#define WUU_DE_WUDE9_MASK (0x200U) -#define WUU_DE_WUDE9_SHIFT (9U) -/*! WUDE9 - DMA/Trigger Wake-up Enable for Module 9 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE9(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE9_SHIFT)) & WUU_DE_WUDE9_MASK) -/*! @} */ - -/*! @name PF - Pin Flag */ -/*! @{ */ - -#define WUU_PF_WUF0_MASK (0x1U) -#define WUU_PF_WUF0_SHIFT (0U) -/*! WUF0 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF0(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF0_SHIFT)) & WUU_PF_WUF0_MASK) - -#define WUU_PF_WUF1_MASK (0x2U) -#define WUU_PF_WUF1_SHIFT (1U) -/*! WUF1 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF1(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF1_SHIFT)) & WUU_PF_WUF1_MASK) - -#define WUU_PF_WUF2_MASK (0x4U) -#define WUU_PF_WUF2_SHIFT (2U) -/*! WUF2 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF2(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF2_SHIFT)) & WUU_PF_WUF2_MASK) - -#define WUU_PF_WUF3_MASK (0x8U) -#define WUU_PF_WUF3_SHIFT (3U) -/*! WUF3 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF3(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF3_SHIFT)) & WUU_PF_WUF3_MASK) - -#define WUU_PF_WUF4_MASK (0x10U) -#define WUU_PF_WUF4_SHIFT (4U) -/*! WUF4 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF4(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF4_SHIFT)) & WUU_PF_WUF4_MASK) - -#define WUU_PF_WUF5_MASK (0x20U) -#define WUU_PF_WUF5_SHIFT (5U) -/*! WUF5 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF5(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF5_SHIFT)) & WUU_PF_WUF5_MASK) - -#define WUU_PF_WUF6_MASK (0x40U) -#define WUU_PF_WUF6_SHIFT (6U) -/*! WUF6 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF6(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF6_SHIFT)) & WUU_PF_WUF6_MASK) - -#define WUU_PF_WUF7_MASK (0x80U) -#define WUU_PF_WUF7_SHIFT (7U) -/*! WUF7 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF7(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF7_SHIFT)) & WUU_PF_WUF7_MASK) - -#define WUU_PF_WUF8_MASK (0x100U) -#define WUU_PF_WUF8_SHIFT (8U) -/*! WUF8 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF8(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF8_SHIFT)) & WUU_PF_WUF8_MASK) - -#define WUU_PF_WUF9_MASK (0x200U) -#define WUU_PF_WUF9_SHIFT (9U) -/*! WUF9 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF9(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF9_SHIFT)) & WUU_PF_WUF9_MASK) - -#define WUU_PF_WUF10_MASK (0x400U) -#define WUU_PF_WUF10_SHIFT (10U) -/*! WUF10 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF10(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF10_SHIFT)) & WUU_PF_WUF10_MASK) - -#define WUU_PF_WUF11_MASK (0x800U) -#define WUU_PF_WUF11_SHIFT (11U) -/*! WUF11 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF11(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF11_SHIFT)) & WUU_PF_WUF11_MASK) - -#define WUU_PF_WUF12_MASK (0x1000U) -#define WUU_PF_WUF12_SHIFT (12U) -/*! WUF12 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF12(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF12_SHIFT)) & WUU_PF_WUF12_MASK) - -#define WUU_PF_WUF13_MASK (0x2000U) -#define WUU_PF_WUF13_SHIFT (13U) -/*! WUF13 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF13(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF13_SHIFT)) & WUU_PF_WUF13_MASK) - -#define WUU_PF_WUF14_MASK (0x4000U) -#define WUU_PF_WUF14_SHIFT (14U) -/*! WUF14 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF14(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF14_SHIFT)) & WUU_PF_WUF14_MASK) - -#define WUU_PF_WUF15_MASK (0x8000U) -#define WUU_PF_WUF15_SHIFT (15U) -/*! WUF15 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF15(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF15_SHIFT)) & WUU_PF_WUF15_MASK) - -#define WUU_PF_WUF16_MASK (0x10000U) -#define WUU_PF_WUF16_SHIFT (16U) -/*! WUF16 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF16(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF16_SHIFT)) & WUU_PF_WUF16_MASK) - -#define WUU_PF_WUF17_MASK (0x20000U) -#define WUU_PF_WUF17_SHIFT (17U) -/*! WUF17 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF17(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF17_SHIFT)) & WUU_PF_WUF17_MASK) - -#define WUU_PF_WUF18_MASK (0x40000U) -#define WUU_PF_WUF18_SHIFT (18U) -/*! WUF18 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF18(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF18_SHIFT)) & WUU_PF_WUF18_MASK) - -#define WUU_PF_WUF19_MASK (0x80000U) -#define WUU_PF_WUF19_SHIFT (19U) -/*! WUF19 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF19(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF19_SHIFT)) & WUU_PF_WUF19_MASK) - -#define WUU_PF_WUF20_MASK (0x100000U) -#define WUU_PF_WUF20_SHIFT (20U) -/*! WUF20 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF20(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF20_SHIFT)) & WUU_PF_WUF20_MASK) - -#define WUU_PF_WUF21_MASK (0x200000U) -#define WUU_PF_WUF21_SHIFT (21U) -/*! WUF21 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF21(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF21_SHIFT)) & WUU_PF_WUF21_MASK) - -#define WUU_PF_WUF22_MASK (0x400000U) -#define WUU_PF_WUF22_SHIFT (22U) -/*! WUF22 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF22(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF22_SHIFT)) & WUU_PF_WUF22_MASK) - -#define WUU_PF_WUF23_MASK (0x800000U) -#define WUU_PF_WUF23_SHIFT (23U) -/*! WUF23 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF23(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF23_SHIFT)) & WUU_PF_WUF23_MASK) - -#define WUU_PF_WUF24_MASK (0x1000000U) -#define WUU_PF_WUF24_SHIFT (24U) -/*! WUF24 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF24(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF24_SHIFT)) & WUU_PF_WUF24_MASK) - -#define WUU_PF_WUF25_MASK (0x2000000U) -#define WUU_PF_WUF25_SHIFT (25U) -/*! WUF25 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF25(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF25_SHIFT)) & WUU_PF_WUF25_MASK) - -#define WUU_PF_WUF26_MASK (0x4000000U) -#define WUU_PF_WUF26_SHIFT (26U) -/*! WUF26 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF26(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF26_SHIFT)) & WUU_PF_WUF26_MASK) - -#define WUU_PF_WUF27_MASK (0x8000000U) -#define WUU_PF_WUF27_SHIFT (27U) -/*! WUF27 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF27(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF27_SHIFT)) & WUU_PF_WUF27_MASK) - -#define WUU_PF_WUF28_MASK (0x10000000U) -#define WUU_PF_WUF28_SHIFT (28U) -/*! WUF28 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF28(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF28_SHIFT)) & WUU_PF_WUF28_MASK) - -#define WUU_PF_WUF29_MASK (0x20000000U) -#define WUU_PF_WUF29_SHIFT (29U) -/*! WUF29 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF29(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF29_SHIFT)) & WUU_PF_WUF29_MASK) - -#define WUU_PF_WUF30_MASK (0x40000000U) -#define WUU_PF_WUF30_SHIFT (30U) -/*! WUF30 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF30(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF30_SHIFT)) & WUU_PF_WUF30_MASK) - -#define WUU_PF_WUF31_MASK (0x80000000U) -#define WUU_PF_WUF31_SHIFT (31U) -/*! WUF31 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF31(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF31_SHIFT)) & WUU_PF_WUF31_MASK) -/*! @} */ - -/*! @name FILT - Pin Filter */ -/*! @{ */ - -#define WUU_FILT_FILTSEL1_MASK (0x1FU) -#define WUU_FILT_FILTSEL1_SHIFT (0U) -/*! FILTSEL1 - Filter 1 Pin Select */ -#define WUU_FILT_FILTSEL1(x) (((uint32_t)(((uint32_t)(x)) << WUU_FILT_FILTSEL1_SHIFT)) & WUU_FILT_FILTSEL1_MASK) - -#define WUU_FILT_FILTE1_MASK (0x60U) -#define WUU_FILT_FILTE1_SHIFT (5U) -/*! FILTE1 - Filter 1 Enable - * 0b00..Disable - * 0b01..Enable (Detect on rising edge or high level) - * 0b10..Enable (Detect on falling edge or low level) - * 0b11..Enable (Detect on any edge) - */ -#define WUU_FILT_FILTE1(x) (((uint32_t)(((uint32_t)(x)) << WUU_FILT_FILTE1_SHIFT)) & WUU_FILT_FILTE1_MASK) - -#define WUU_FILT_FILTF1_MASK (0x80U) -#define WUU_FILT_FILTF1_SHIFT (7U) -/*! FILTF1 - Filter 1 Flag - * 0b0..No - * 0b1..Yes - */ -#define WUU_FILT_FILTF1(x) (((uint32_t)(((uint32_t)(x)) << WUU_FILT_FILTF1_SHIFT)) & WUU_FILT_FILTF1_MASK) - -#define WUU_FILT_FILTSEL2_MASK (0x1F00U) -#define WUU_FILT_FILTSEL2_SHIFT (8U) -/*! FILTSEL2 - Filter 2 Pin Select */ -#define WUU_FILT_FILTSEL2(x) (((uint32_t)(((uint32_t)(x)) << WUU_FILT_FILTSEL2_SHIFT)) & WUU_FILT_FILTSEL2_MASK) - -#define WUU_FILT_FILTE2_MASK (0x6000U) -#define WUU_FILT_FILTE2_SHIFT (13U) -/*! FILTE2 - Filter 2 Enable - * 0b00..Disable - * 0b01..Enable (Detect on rising edge or high level) - * 0b10..Enable (Detect on falling edge or low level) - * 0b11..Enable (Detect on any edge) - */ -#define WUU_FILT_FILTE2(x) (((uint32_t)(((uint32_t)(x)) << WUU_FILT_FILTE2_SHIFT)) & WUU_FILT_FILTE2_MASK) - -#define WUU_FILT_FILTF2_MASK (0x8000U) -#define WUU_FILT_FILTF2_SHIFT (15U) -/*! FILTF2 - Filter 2 Flag - * 0b0..No - * 0b1..Yes - */ -#define WUU_FILT_FILTF2(x) (((uint32_t)(((uint32_t)(x)) << WUU_FILT_FILTF2_SHIFT)) & WUU_FILT_FILTF2_MASK) -/*! @} */ - -/*! @name PDC1 - Pin DMA/Trigger Configuration 1 */ -/*! @{ */ - -#define WUU_PDC1_WUPDC0_MASK (0x3U) -#define WUU_PDC1_WUPDC0_SHIFT (0U) -/*! WUPDC0 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC0(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC0_SHIFT)) & WUU_PDC1_WUPDC0_MASK) - -#define WUU_PDC1_WUPDC1_MASK (0xCU) -#define WUU_PDC1_WUPDC1_SHIFT (2U) -/*! WUPDC1 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC1(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC1_SHIFT)) & WUU_PDC1_WUPDC1_MASK) - -#define WUU_PDC1_WUPDC2_MASK (0x30U) -#define WUU_PDC1_WUPDC2_SHIFT (4U) -/*! WUPDC2 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC2(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC2_SHIFT)) & WUU_PDC1_WUPDC2_MASK) - -#define WUU_PDC1_WUPDC3_MASK (0xC0U) -#define WUU_PDC1_WUPDC3_SHIFT (6U) -/*! WUPDC3 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC3(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC3_SHIFT)) & WUU_PDC1_WUPDC3_MASK) - -#define WUU_PDC1_WUPDC4_MASK (0x300U) -#define WUU_PDC1_WUPDC4_SHIFT (8U) -/*! WUPDC4 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC4(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC4_SHIFT)) & WUU_PDC1_WUPDC4_MASK) - -#define WUU_PDC1_WUPDC5_MASK (0xC00U) -#define WUU_PDC1_WUPDC5_SHIFT (10U) -/*! WUPDC5 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC5(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC5_SHIFT)) & WUU_PDC1_WUPDC5_MASK) - -#define WUU_PDC1_WUPDC6_MASK (0x3000U) -#define WUU_PDC1_WUPDC6_SHIFT (12U) -/*! WUPDC6 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC6(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC6_SHIFT)) & WUU_PDC1_WUPDC6_MASK) - -#define WUU_PDC1_WUPDC7_MASK (0xC000U) -#define WUU_PDC1_WUPDC7_SHIFT (14U) -/*! WUPDC7 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC7(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC7_SHIFT)) & WUU_PDC1_WUPDC7_MASK) - -#define WUU_PDC1_WUPDC8_MASK (0x30000U) -#define WUU_PDC1_WUPDC8_SHIFT (16U) -/*! WUPDC8 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC8(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC8_SHIFT)) & WUU_PDC1_WUPDC8_MASK) - -#define WUU_PDC1_WUPDC9_MASK (0xC0000U) -#define WUU_PDC1_WUPDC9_SHIFT (18U) -/*! WUPDC9 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC9(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC9_SHIFT)) & WUU_PDC1_WUPDC9_MASK) - -#define WUU_PDC1_WUPDC10_MASK (0x300000U) -#define WUU_PDC1_WUPDC10_SHIFT (20U) -/*! WUPDC10 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC10(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC10_SHIFT)) & WUU_PDC1_WUPDC10_MASK) - -#define WUU_PDC1_WUPDC11_MASK (0xC00000U) -#define WUU_PDC1_WUPDC11_SHIFT (22U) -/*! WUPDC11 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC11(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC11_SHIFT)) & WUU_PDC1_WUPDC11_MASK) - -#define WUU_PDC1_WUPDC12_MASK (0x3000000U) -#define WUU_PDC1_WUPDC12_SHIFT (24U) -/*! WUPDC12 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC12(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC12_SHIFT)) & WUU_PDC1_WUPDC12_MASK) - -#define WUU_PDC1_WUPDC13_MASK (0xC000000U) -#define WUU_PDC1_WUPDC13_SHIFT (26U) -/*! WUPDC13 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC13(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC13_SHIFT)) & WUU_PDC1_WUPDC13_MASK) - -#define WUU_PDC1_WUPDC14_MASK (0x30000000U) -#define WUU_PDC1_WUPDC14_SHIFT (28U) -/*! WUPDC14 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC14(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC14_SHIFT)) & WUU_PDC1_WUPDC14_MASK) - -#define WUU_PDC1_WUPDC15_MASK (0xC0000000U) -#define WUU_PDC1_WUPDC15_SHIFT (30U) -/*! WUPDC15 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC15(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC15_SHIFT)) & WUU_PDC1_WUPDC15_MASK) -/*! @} */ - -/*! @name PDC2 - Pin DMA/Trigger Configuration 2 */ -/*! @{ */ - -#define WUU_PDC2_WUPDC16_MASK (0x3U) -#define WUU_PDC2_WUPDC16_SHIFT (0U) -/*! WUPDC16 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC16(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC16_SHIFT)) & WUU_PDC2_WUPDC16_MASK) - -#define WUU_PDC2_WUPDC17_MASK (0xCU) -#define WUU_PDC2_WUPDC17_SHIFT (2U) -/*! WUPDC17 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC17(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC17_SHIFT)) & WUU_PDC2_WUPDC17_MASK) - -#define WUU_PDC2_WUPDC18_MASK (0x30U) -#define WUU_PDC2_WUPDC18_SHIFT (4U) -/*! WUPDC18 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC18(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC18_SHIFT)) & WUU_PDC2_WUPDC18_MASK) - -#define WUU_PDC2_WUPDC19_MASK (0xC0U) -#define WUU_PDC2_WUPDC19_SHIFT (6U) -/*! WUPDC19 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC19(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC19_SHIFT)) & WUU_PDC2_WUPDC19_MASK) - -#define WUU_PDC2_WUPDC20_MASK (0x300U) -#define WUU_PDC2_WUPDC20_SHIFT (8U) -/*! WUPDC20 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC20(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC20_SHIFT)) & WUU_PDC2_WUPDC20_MASK) - -#define WUU_PDC2_WUPDC21_MASK (0xC00U) -#define WUU_PDC2_WUPDC21_SHIFT (10U) -/*! WUPDC21 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC21(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC21_SHIFT)) & WUU_PDC2_WUPDC21_MASK) - -#define WUU_PDC2_WUPDC22_MASK (0x3000U) -#define WUU_PDC2_WUPDC22_SHIFT (12U) -/*! WUPDC22 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC22(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC22_SHIFT)) & WUU_PDC2_WUPDC22_MASK) - -#define WUU_PDC2_WUPDC23_MASK (0xC000U) -#define WUU_PDC2_WUPDC23_SHIFT (14U) -/*! WUPDC23 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC23(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC23_SHIFT)) & WUU_PDC2_WUPDC23_MASK) - -#define WUU_PDC2_WUPDC24_MASK (0x30000U) -#define WUU_PDC2_WUPDC24_SHIFT (16U) -/*! WUPDC24 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC24(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC24_SHIFT)) & WUU_PDC2_WUPDC24_MASK) - -#define WUU_PDC2_WUPDC25_MASK (0xC0000U) -#define WUU_PDC2_WUPDC25_SHIFT (18U) -/*! WUPDC25 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC25(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC25_SHIFT)) & WUU_PDC2_WUPDC25_MASK) - -#define WUU_PDC2_WUPDC26_MASK (0x300000U) -#define WUU_PDC2_WUPDC26_SHIFT (20U) -/*! WUPDC26 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC26(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC26_SHIFT)) & WUU_PDC2_WUPDC26_MASK) - -#define WUU_PDC2_WUPDC27_MASK (0xC00000U) -#define WUU_PDC2_WUPDC27_SHIFT (22U) -/*! WUPDC27 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC27(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC27_SHIFT)) & WUU_PDC2_WUPDC27_MASK) - -#define WUU_PDC2_WUPDC28_MASK (0x3000000U) -#define WUU_PDC2_WUPDC28_SHIFT (24U) -/*! WUPDC28 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC28(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC28_SHIFT)) & WUU_PDC2_WUPDC28_MASK) - -#define WUU_PDC2_WUPDC29_MASK (0xC000000U) -#define WUU_PDC2_WUPDC29_SHIFT (26U) -/*! WUPDC29 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC29(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC29_SHIFT)) & WUU_PDC2_WUPDC29_MASK) - -#define WUU_PDC2_WUPDC30_MASK (0x30000000U) -#define WUU_PDC2_WUPDC30_SHIFT (28U) -/*! WUPDC30 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC30(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC30_SHIFT)) & WUU_PDC2_WUPDC30_MASK) - -#define WUU_PDC2_WUPDC31_MASK (0xC0000000U) -#define WUU_PDC2_WUPDC31_SHIFT (30U) -/*! WUPDC31 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC31(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC31_SHIFT)) & WUU_PDC2_WUPDC31_MASK) -/*! @} */ - -/*! @name FDC - Pin Filter DMA/Trigger Configuration */ -/*! @{ */ - -#define WUU_FDC_FILTC1_MASK (0x3U) -#define WUU_FDC_FILTC1_SHIFT (0U) -/*! FILTC1 - Filter Configuration for FILTn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_FDC_FILTC1(x) (((uint32_t)(((uint32_t)(x)) << WUU_FDC_FILTC1_SHIFT)) & WUU_FDC_FILTC1_MASK) - -#define WUU_FDC_FILTC2_MASK (0xCU) -#define WUU_FDC_FILTC2_SHIFT (2U) -/*! FILTC2 - Filter Configuration for FILTn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_FDC_FILTC2(x) (((uint32_t)(((uint32_t)(x)) << WUU_FDC_FILTC2_SHIFT)) & WUU_FDC_FILTC2_MASK) -/*! @} */ - -/*! @name PMC - Pin Mode Configuration */ -/*! @{ */ - -#define WUU_PMC_WUPMC0_MASK (0x1U) -#define WUU_PMC_WUPMC0_SHIFT (0U) -/*! WUPMC0 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC0(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC0_SHIFT)) & WUU_PMC_WUPMC0_MASK) - -#define WUU_PMC_WUPMC1_MASK (0x2U) -#define WUU_PMC_WUPMC1_SHIFT (1U) -/*! WUPMC1 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC1(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC1_SHIFT)) & WUU_PMC_WUPMC1_MASK) - -#define WUU_PMC_WUPMC2_MASK (0x4U) -#define WUU_PMC_WUPMC2_SHIFT (2U) -/*! WUPMC2 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC2(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC2_SHIFT)) & WUU_PMC_WUPMC2_MASK) - -#define WUU_PMC_WUPMC3_MASK (0x8U) -#define WUU_PMC_WUPMC3_SHIFT (3U) -/*! WUPMC3 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC3(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC3_SHIFT)) & WUU_PMC_WUPMC3_MASK) - -#define WUU_PMC_WUPMC4_MASK (0x10U) -#define WUU_PMC_WUPMC4_SHIFT (4U) -/*! WUPMC4 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC4(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC4_SHIFT)) & WUU_PMC_WUPMC4_MASK) - -#define WUU_PMC_WUPMC5_MASK (0x20U) -#define WUU_PMC_WUPMC5_SHIFT (5U) -/*! WUPMC5 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC5(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC5_SHIFT)) & WUU_PMC_WUPMC5_MASK) - -#define WUU_PMC_WUPMC6_MASK (0x40U) -#define WUU_PMC_WUPMC6_SHIFT (6U) -/*! WUPMC6 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC6(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC6_SHIFT)) & WUU_PMC_WUPMC6_MASK) - -#define WUU_PMC_WUPMC7_MASK (0x80U) -#define WUU_PMC_WUPMC7_SHIFT (7U) -/*! WUPMC7 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC7(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC7_SHIFT)) & WUU_PMC_WUPMC7_MASK) - -#define WUU_PMC_WUPMC8_MASK (0x100U) -#define WUU_PMC_WUPMC8_SHIFT (8U) -/*! WUPMC8 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC8(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC8_SHIFT)) & WUU_PMC_WUPMC8_MASK) - -#define WUU_PMC_WUPMC9_MASK (0x200U) -#define WUU_PMC_WUPMC9_SHIFT (9U) -/*! WUPMC9 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC9(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC9_SHIFT)) & WUU_PMC_WUPMC9_MASK) - -#define WUU_PMC_WUPMC10_MASK (0x400U) -#define WUU_PMC_WUPMC10_SHIFT (10U) -/*! WUPMC10 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC10(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC10_SHIFT)) & WUU_PMC_WUPMC10_MASK) - -#define WUU_PMC_WUPMC11_MASK (0x800U) -#define WUU_PMC_WUPMC11_SHIFT (11U) -/*! WUPMC11 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC11(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC11_SHIFT)) & WUU_PMC_WUPMC11_MASK) - -#define WUU_PMC_WUPMC12_MASK (0x1000U) -#define WUU_PMC_WUPMC12_SHIFT (12U) -/*! WUPMC12 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC12(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC12_SHIFT)) & WUU_PMC_WUPMC12_MASK) - -#define WUU_PMC_WUPMC13_MASK (0x2000U) -#define WUU_PMC_WUPMC13_SHIFT (13U) -/*! WUPMC13 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC13(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC13_SHIFT)) & WUU_PMC_WUPMC13_MASK) - -#define WUU_PMC_WUPMC14_MASK (0x4000U) -#define WUU_PMC_WUPMC14_SHIFT (14U) -/*! WUPMC14 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC14(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC14_SHIFT)) & WUU_PMC_WUPMC14_MASK) - -#define WUU_PMC_WUPMC15_MASK (0x8000U) -#define WUU_PMC_WUPMC15_SHIFT (15U) -/*! WUPMC15 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC15(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC15_SHIFT)) & WUU_PMC_WUPMC15_MASK) - -#define WUU_PMC_WUPMC16_MASK (0x10000U) -#define WUU_PMC_WUPMC16_SHIFT (16U) -/*! WUPMC16 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC16(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC16_SHIFT)) & WUU_PMC_WUPMC16_MASK) - -#define WUU_PMC_WUPMC17_MASK (0x20000U) -#define WUU_PMC_WUPMC17_SHIFT (17U) -/*! WUPMC17 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC17(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC17_SHIFT)) & WUU_PMC_WUPMC17_MASK) - -#define WUU_PMC_WUPMC18_MASK (0x40000U) -#define WUU_PMC_WUPMC18_SHIFT (18U) -/*! WUPMC18 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC18(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC18_SHIFT)) & WUU_PMC_WUPMC18_MASK) - -#define WUU_PMC_WUPMC19_MASK (0x80000U) -#define WUU_PMC_WUPMC19_SHIFT (19U) -/*! WUPMC19 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC19(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC19_SHIFT)) & WUU_PMC_WUPMC19_MASK) - -#define WUU_PMC_WUPMC20_MASK (0x100000U) -#define WUU_PMC_WUPMC20_SHIFT (20U) -/*! WUPMC20 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC20(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC20_SHIFT)) & WUU_PMC_WUPMC20_MASK) - -#define WUU_PMC_WUPMC21_MASK (0x200000U) -#define WUU_PMC_WUPMC21_SHIFT (21U) -/*! WUPMC21 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC21(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC21_SHIFT)) & WUU_PMC_WUPMC21_MASK) - -#define WUU_PMC_WUPMC22_MASK (0x400000U) -#define WUU_PMC_WUPMC22_SHIFT (22U) -/*! WUPMC22 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC22(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC22_SHIFT)) & WUU_PMC_WUPMC22_MASK) - -#define WUU_PMC_WUPMC23_MASK (0x800000U) -#define WUU_PMC_WUPMC23_SHIFT (23U) -/*! WUPMC23 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC23(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC23_SHIFT)) & WUU_PMC_WUPMC23_MASK) - -#define WUU_PMC_WUPMC24_MASK (0x1000000U) -#define WUU_PMC_WUPMC24_SHIFT (24U) -/*! WUPMC24 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC24(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC24_SHIFT)) & WUU_PMC_WUPMC24_MASK) - -#define WUU_PMC_WUPMC25_MASK (0x2000000U) -#define WUU_PMC_WUPMC25_SHIFT (25U) -/*! WUPMC25 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC25(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC25_SHIFT)) & WUU_PMC_WUPMC25_MASK) - -#define WUU_PMC_WUPMC26_MASK (0x4000000U) -#define WUU_PMC_WUPMC26_SHIFT (26U) -/*! WUPMC26 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC26(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC26_SHIFT)) & WUU_PMC_WUPMC26_MASK) - -#define WUU_PMC_WUPMC27_MASK (0x8000000U) -#define WUU_PMC_WUPMC27_SHIFT (27U) -/*! WUPMC27 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC27(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC27_SHIFT)) & WUU_PMC_WUPMC27_MASK) - -#define WUU_PMC_WUPMC28_MASK (0x10000000U) -#define WUU_PMC_WUPMC28_SHIFT (28U) -/*! WUPMC28 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC28(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC28_SHIFT)) & WUU_PMC_WUPMC28_MASK) - -#define WUU_PMC_WUPMC29_MASK (0x20000000U) -#define WUU_PMC_WUPMC29_SHIFT (29U) -/*! WUPMC29 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC29(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC29_SHIFT)) & WUU_PMC_WUPMC29_MASK) - -#define WUU_PMC_WUPMC30_MASK (0x40000000U) -#define WUU_PMC_WUPMC30_SHIFT (30U) -/*! WUPMC30 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC30(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC30_SHIFT)) & WUU_PMC_WUPMC30_MASK) - -#define WUU_PMC_WUPMC31_MASK (0x80000000U) -#define WUU_PMC_WUPMC31_SHIFT (31U) -/*! WUPMC31 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC31(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC31_SHIFT)) & WUU_PMC_WUPMC31_MASK) -/*! @} */ - -/*! @name FMC - Pin Filter Mode Configuration */ -/*! @{ */ - -#define WUU_FMC_FILTM1_MASK (0x1U) -#define WUU_FMC_FILTM1_SHIFT (0U) -/*! FILTM1 - Filter Mode for FILTn - * 0b0..Active only during Power Down/Deep Power Down mode - * 0b1..Active during all power modes - */ -#define WUU_FMC_FILTM1(x) (((uint32_t)(((uint32_t)(x)) << WUU_FMC_FILTM1_SHIFT)) & WUU_FMC_FILTM1_MASK) - -#define WUU_FMC_FILTM2_MASK (0x2U) -#define WUU_FMC_FILTM2_SHIFT (1U) -/*! FILTM2 - Filter Mode for FILTn - * 0b0..Active only during Power Down/Deep Power Down mode - * 0b1..Active during all power modes - */ -#define WUU_FMC_FILTM2(x) (((uint32_t)(((uint32_t)(x)) << WUU_FMC_FILTM2_SHIFT)) & WUU_FMC_FILTM2_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group WUU_Register_Masks */ - - -/* WUU - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral WUU0 base address */ - #define WUU0_BASE (0x50046000u) - /** Peripheral WUU0 base address */ - #define WUU0_BASE_NS (0x40046000u) - /** Peripheral WUU0 base pointer */ - #define WUU0 ((WUU_Type *)WUU0_BASE) - /** Peripheral WUU0 base pointer */ - #define WUU0_NS ((WUU_Type *)WUU0_BASE_NS) - /** Array initializer of WUU peripheral base addresses */ - #define WUU_BASE_ADDRS { WUU0_BASE } - /** Array initializer of WUU peripheral base pointers */ - #define WUU_BASE_PTRS { WUU0 } - /** Array initializer of WUU peripheral base addresses */ - #define WUU_BASE_ADDRS_NS { WUU0_BASE_NS } - /** Array initializer of WUU peripheral base pointers */ - #define WUU_BASE_PTRS_NS { WUU0_NS } -#else - /** Peripheral WUU0 base address */ - #define WUU0_BASE (0x40046000u) - /** Peripheral WUU0 base pointer */ - #define WUU0 ((WUU_Type *)WUU0_BASE) - /** Array initializer of WUU peripheral base addresses */ - #define WUU_BASE_ADDRS { WUU0_BASE } - /** Array initializer of WUU peripheral base pointers */ - #define WUU_BASE_PTRS { WUU0 } -#endif - -/*! - * @} - */ /* end of group WUU_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- WWDT Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup WWDT_Peripheral_Access_Layer WWDT Peripheral Access Layer - * @{ - */ - -/** WWDT - Register Layout Typedef */ -typedef struct { - __IO uint32_t MOD; /**< Mode, offset: 0x0 */ - __IO uint32_t TC; /**< Timer Constant, offset: 0x4 */ - __O uint32_t FEED; /**< Feed Sequence, offset: 0x8 */ - __I uint32_t TV; /**< Timer Value, offset: 0xC */ - uint8_t RESERVED_0[4]; - __IO uint32_t WARNINT; /**< Warning Interrupt Compare Value, offset: 0x14 */ - __IO uint32_t WINDOW; /**< Window Compare Value, offset: 0x18 */ -} WWDT_Type; - -/* ---------------------------------------------------------------------------- - -- WWDT Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup WWDT_Register_Masks WWDT Register Masks - * @{ - */ - -/*! @name MOD - Mode */ -/*! @{ */ - -#define WWDT_MOD_WDEN_MASK (0x1U) -#define WWDT_MOD_WDEN_SHIFT (0U) -/*! WDEN - Watchdog Enable - * 0b0..Timer stopped - * 0b1..Timer running - */ -#define WWDT_MOD_WDEN(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_WDEN_SHIFT)) & WWDT_MOD_WDEN_MASK) - -#define WWDT_MOD_WDRESET_MASK (0x2U) -#define WWDT_MOD_WDRESET_SHIFT (1U) -/*! WDRESET - Watchdog Reset Enable - * 0b0..Interrupt - * 0b1..Reset - */ -#define WWDT_MOD_WDRESET(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_WDRESET_SHIFT)) & WWDT_MOD_WDRESET_MASK) - -#define WWDT_MOD_WDTOF_MASK (0x4U) -#define WWDT_MOD_WDTOF_SHIFT (2U) -/*! WDTOF - Watchdog Timeout Flag - * 0b0..Watchdog event has not occurred. - * 0b1..Watchdog event has occurred (causes a chip reset if WDRESET = 1). - */ -#define WWDT_MOD_WDTOF(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_WDTOF_SHIFT)) & WWDT_MOD_WDTOF_MASK) - -#define WWDT_MOD_WDINT_MASK (0x8U) -#define WWDT_MOD_WDINT_SHIFT (3U) -/*! WDINT - Warning Interrupt Flag - * 0b0..No flag - * 0b1..Flag - */ -#define WWDT_MOD_WDINT(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_WDINT_SHIFT)) & WWDT_MOD_WDINT_MASK) - -#define WWDT_MOD_WDPROTECT_MASK (0x10U) -#define WWDT_MOD_WDPROTECT_SHIFT (4U) -/*! WDPROTECT - Watchdog Update Mode - * 0b0..Flexible - * 0b1..Threshold - */ -#define WWDT_MOD_WDPROTECT(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_WDPROTECT_SHIFT)) & WWDT_MOD_WDPROTECT_MASK) - -#define WWDT_MOD_LOCK_MASK (0x20U) -#define WWDT_MOD_LOCK_SHIFT (5U) -/*! LOCK - Lock - * 0b0..No Lock - * 0b1..Lock - */ -#define WWDT_MOD_LOCK(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_LOCK_SHIFT)) & WWDT_MOD_LOCK_MASK) - -#define WWDT_MOD_DEBUG_EN_MASK (0x40U) -#define WWDT_MOD_DEBUG_EN_SHIFT (6U) -/*! DEBUG_EN - Debug Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define WWDT_MOD_DEBUG_EN(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_DEBUG_EN_SHIFT)) & WWDT_MOD_DEBUG_EN_MASK) -/*! @} */ - -/*! @name TC - Timer Constant */ -/*! @{ */ - -#define WWDT_TC_COUNT_MASK (0xFFFFFFU) -#define WWDT_TC_COUNT_SHIFT (0U) -/*! COUNT - Watchdog Timeout Value */ -#define WWDT_TC_COUNT(x) (((uint32_t)(((uint32_t)(x)) << WWDT_TC_COUNT_SHIFT)) & WWDT_TC_COUNT_MASK) -/*! @} */ - -/*! @name FEED - Feed Sequence */ -/*! @{ */ - -#define WWDT_FEED_FEED_MASK (0xFFU) -#define WWDT_FEED_FEED_SHIFT (0U) -/*! FEED - Feed Value */ -#define WWDT_FEED_FEED(x) (((uint32_t)(((uint32_t)(x)) << WWDT_FEED_FEED_SHIFT)) & WWDT_FEED_FEED_MASK) -/*! @} */ - -/*! @name TV - Timer Value */ -/*! @{ */ - -#define WWDT_TV_COUNT_MASK (0xFFFFFFU) -#define WWDT_TV_COUNT_SHIFT (0U) -/*! COUNT - Counter Timer Value */ -#define WWDT_TV_COUNT(x) (((uint32_t)(((uint32_t)(x)) << WWDT_TV_COUNT_SHIFT)) & WWDT_TV_COUNT_MASK) -/*! @} */ - -/*! @name WARNINT - Warning Interrupt Compare Value */ -/*! @{ */ - -#define WWDT_WARNINT_WARNINT_MASK (0x3FFU) -#define WWDT_WARNINT_WARNINT_SHIFT (0U) -/*! WARNINT - Watchdog Warning Interrupt Compare Value */ -#define WWDT_WARNINT_WARNINT(x) (((uint32_t)(((uint32_t)(x)) << WWDT_WARNINT_WARNINT_SHIFT)) & WWDT_WARNINT_WARNINT_MASK) -/*! @} */ - -/*! @name WINDOW - Window Compare Value */ -/*! @{ */ - -#define WWDT_WINDOW_WINDOW_MASK (0xFFFFFFU) -#define WWDT_WINDOW_WINDOW_SHIFT (0U) -/*! WINDOW - Watchdog Window Value */ -#define WWDT_WINDOW_WINDOW(x) (((uint32_t)(((uint32_t)(x)) << WWDT_WINDOW_WINDOW_SHIFT)) & WWDT_WINDOW_WINDOW_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group WWDT_Register_Masks */ - - -/* WWDT - Peripheral instance base addresses */ -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) - /** Peripheral WWDT0 base address */ - #define WWDT0_BASE (0x50016000u) - /** Peripheral WWDT0 base address */ - #define WWDT0_BASE_NS (0x40016000u) - /** Peripheral WWDT0 base pointer */ - #define WWDT0 ((WWDT_Type *)WWDT0_BASE) - /** Peripheral WWDT0 base pointer */ - #define WWDT0_NS ((WWDT_Type *)WWDT0_BASE_NS) - /** Peripheral WWDT1 base address */ - #define WWDT1_BASE (0x50017000u) - /** Peripheral WWDT1 base address */ - #define WWDT1_BASE_NS (0x40017000u) - /** Peripheral WWDT1 base pointer */ - #define WWDT1 ((WWDT_Type *)WWDT1_BASE) - /** Peripheral WWDT1 base pointer */ - #define WWDT1_NS ((WWDT_Type *)WWDT1_BASE_NS) - /** Array initializer of WWDT peripheral base addresses */ - #define WWDT_BASE_ADDRS { WWDT0_BASE, WWDT1_BASE } - /** Array initializer of WWDT peripheral base pointers */ - #define WWDT_BASE_PTRS { WWDT0, WWDT1 } - /** Array initializer of WWDT peripheral base addresses */ - #define WWDT_BASE_ADDRS_NS { WWDT0_BASE_NS, WWDT1_BASE_NS } - /** Array initializer of WWDT peripheral base pointers */ - #define WWDT_BASE_PTRS_NS { WWDT0_NS, WWDT1_NS } -#else - /** Peripheral WWDT0 base address */ - #define WWDT0_BASE (0x40016000u) - /** Peripheral WWDT0 base pointer */ - #define WWDT0 ((WWDT_Type *)WWDT0_BASE) - /** Peripheral WWDT1 base address */ - #define WWDT1_BASE (0x40017000u) - /** Peripheral WWDT1 base pointer */ - #define WWDT1 ((WWDT_Type *)WWDT1_BASE) - /** Array initializer of WWDT peripheral base addresses */ - #define WWDT_BASE_ADDRS { WWDT0_BASE, WWDT1_BASE } - /** Array initializer of WWDT peripheral base pointers */ - #define WWDT_BASE_PTRS { WWDT0, WWDT1 } -#endif -/** Interrupt vectors for the WWDT peripheral type */ -#define WWDT_IRQS { WWDT0_IRQn, WWDT1_IRQn } - -/*! - * @} - */ /* end of group WWDT_Peripheral_Access_Layer */ - - -/* -** End of section using anonymous unions -*/ - -#if defined(__ARMCC_VERSION) - #if (__ARMCC_VERSION >= 6010050) - #pragma clang diagnostic pop - #else - #pragma pop - #endif -#elif defined(__GNUC__) - /* leave anonymous unions enabled */ -#elif defined(__IAR_SYSTEMS_ICC__) - #pragma language=default -#else - #error Not supported compiler type -#endif - -/*! - * @} - */ /* end of group Peripheral_access_layer */ - - -/* ---------------------------------------------------------------------------- - -- Macros for use with bit field definitions (xxx_SHIFT, xxx_MASK). - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup Bit_Field_Generic_Macros Macros for use with bit field definitions (xxx_SHIFT, xxx_MASK). - * @{ - */ - -#if defined(__ARMCC_VERSION) - #if (__ARMCC_VERSION >= 6010050) - #pragma clang system_header - #endif -#elif defined(__IAR_SYSTEMS_ICC__) - #pragma system_include -#endif - -/** - * @brief Mask and left-shift a bit field value for use in a register bit range. - * @param field Name of the register bit field. - * @param value Value of the bit field. - * @return Masked and shifted value. - */ -#define NXP_VAL2FLD(field, value) (((value) << (field ## _SHIFT)) & (field ## _MASK)) -/** - * @brief Mask and right-shift a register value to extract a bit field value. - * @param field Name of the register bit field. - * @param value Value of the register. - * @return Masked and shifted bit field value. - */ -#define NXP_FLD2VAL(field, value) (((value) & (field ## _MASK)) >> (field ## _SHIFT)) - -/*! - * @} - */ /* end of group Bit_Field_Generic_Macros */ - - -/* ---------------------------------------------------------------------------- - -- SDK Compatibility - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SDK_Compatibility_Symbols SDK Compatibility - * @{ - */ - -/*! - * @brief Get the chip value. - * - * @return chip version, 0x0: A0 version chip, 0x1: A1 version chip, 0xFF: invalid version. - */ -static inline uint32_t Chip_GetVersion(void) -{ - uint32_t deviceRevision; - - deviceRevision = SYSCON->DIEID & SYSCON_DIEID_MINOR_REVISION_MASK; - - if(0UL == deviceRevision) /* A0 device revision is 0 */ - { - return 0x0; - } - else if(1UL == deviceRevision) /* A1 device revision is 1 */ - { - return 0x1; - } - else - { - return 0xFF; - } -} - - -/*! - * @} - */ /* end of group SDK_Compatibility_Symbols */ - - -#endif /* MCXN947_CM33_CORE0_H_ */ - diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/MCXN947_cm33_core0_features.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/MCXN947_cm33_core0_features.h deleted file mode 100644 index 246b92bc9d9..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/MCXN947_cm33_core0_features.h +++ /dev/null @@ -1,1087 +0,0 @@ -/* -** ################################################################### -** Version: rev. 1.0, 2021-08-03 -** Build: b240410 -** -** Abstract: -** Chip specific module features. -** -** Copyright 2016 Freescale Semiconductor, Inc. -** Copyright 2016-2024 NXP -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** Revisions: -** - rev. 1.0 (2021-08-03) -** Initial version based on SPEC1.6 -** -** ################################################################### -*/ - -#ifndef _MCXN947_cm33_core0_FEATURES_H_ -#define _MCXN947_cm33_core0_FEATURES_H_ - -/* SOC module features */ - -/* @brief CACHE64_CTRL availability on the SoC. */ -#define FSL_FEATURE_SOC_CACHE64_CTRL_COUNT (1) -/* @brief CACHE64_POLSEL availability on the SoC. */ -#define FSL_FEATURE_SOC_CACHE64_POLSEL_COUNT (1) -/* @brief CDOG availability on the SoC. */ -#define FSL_FEATURE_SOC_CDOG_COUNT (2) -/* @brief CMC availability on the SoC. */ -#define FSL_FEATURE_SOC_CMC_COUNT (1) -/* @brief CRC availability on the SoC. */ -#define FSL_FEATURE_SOC_CRC_COUNT (1) -/* @brief CTIMER availability on the SoC. */ -#define FSL_FEATURE_SOC_CTIMER_COUNT (5) -/* @brief EDMA availability on the SoC. */ -#define FSL_FEATURE_SOC_EDMA_COUNT (2) -/* @brief EIM availability on the SoC. */ -#define FSL_FEATURE_SOC_EIM_COUNT (1) -/* @brief EMVSIM availability on the SoC. */ -#define FSL_FEATURE_SOC_EMVSIM_COUNT (2) -/* @brief EVTG availability on the SoC. */ -#define FSL_FEATURE_SOC_EVTG_COUNT (1) -/* @brief EWM availability on the SoC. */ -#define FSL_FEATURE_SOC_EWM_COUNT (1) -/* @brief FLEXCAN availability on the SoC. */ -#define FSL_FEATURE_SOC_FLEXCAN_COUNT (2) -/* @brief FLEXIO availability on the SoC. */ -#define FSL_FEATURE_SOC_FLEXIO_COUNT (1) -/* @brief FLEXSPI availability on the SoC. */ -#define FSL_FEATURE_SOC_FLEXSPI_COUNT (1) -/* @brief FMC availability on the SoC. */ -#define FSL_FEATURE_SOC_FMC_COUNT (1) -/* @brief FREQME availability on the SoC. */ -#define FSL_FEATURE_SOC_FREQME_COUNT (1) -/* @brief GPIO availability on the SoC. */ -#define FSL_FEATURE_SOC_GPIO_COUNT (12) -/* @brief SPC availability on the SoC. */ -#define FSL_FEATURE_SOC_SPC_COUNT (1) -/* @brief HPDAC availability on the SoC. */ -#define FSL_FEATURE_SOC_HPDAC_COUNT (1) -/* @brief I3C availability on the SoC. */ -#define FSL_FEATURE_SOC_I3C_COUNT (2) -/* @brief I2S availability on the SoC. */ -#define FSL_FEATURE_SOC_I2S_COUNT (2) -/* @brief INPUTMUX availability on the SoC. */ -#define FSL_FEATURE_SOC_INPUTMUX_COUNT (1) -/* @brief ITRC availability on the SoC. */ -#define FSL_FEATURE_SOC_ITRC_COUNT (1) -/* @brief LPADC availability on the SoC. */ -#define FSL_FEATURE_SOC_LPADC_COUNT (2) -/* @brief LPCMP availability on the SoC. */ -#define FSL_FEATURE_SOC_LPCMP_COUNT (3) -/* @brief LPDAC availability on the SoC. */ -#define FSL_FEATURE_SOC_LPDAC_COUNT (2) -/* @brief LPI2C availability on the SoC. */ -#define FSL_FEATURE_SOC_LPI2C_COUNT (10) -/* @brief LPSPI availability on the SoC. */ -#define FSL_FEATURE_SOC_LPSPI_COUNT (10) -/* @brief LPTMR availability on the SoC. */ -#define FSL_FEATURE_SOC_LPTMR_COUNT (2) -/* @brief LPUART availability on the SoC. */ -#define FSL_FEATURE_SOC_LPUART_COUNT (10) -/* @brief MAILBOX availability on the SoC. */ -#define FSL_FEATURE_SOC_MAILBOX_COUNT (1) -/* @brief MCX_ENET availability on the SoC. */ -#define FSL_FEATURE_SOC_MCX_ENET_COUNT (1) -/* @brief MPU availability on the SoC. */ -#define FSL_FEATURE_SOC_MPU_COUNT (1) -/* @brief MRT availability on the SoC. */ -#define FSL_FEATURE_SOC_MRT_COUNT (1) -/* @brief OPAMP availability on the SoC. */ -#define FSL_FEATURE_SOC_OPAMP_COUNT (3) -/* @brief OSTIMER availability on the SoC. */ -#define FSL_FEATURE_SOC_OSTIMER_COUNT (1) -/* @brief PDM availability on the SoC. */ -#define FSL_FEATURE_SOC_PDM_COUNT (1) -/* @brief PINT availability on the SoC. */ -#define FSL_FEATURE_SOC_PINT_COUNT (1) -/* @brief PKC availability on the SoC. */ -#define FSL_FEATURE_SOC_PKC_COUNT (1) -/* @brief POWERQUAD availability on the SoC. */ -#define FSL_FEATURE_SOC_POWERQUAD_COUNT (1) -/* @brief PORT availability on the SoC. */ -#define FSL_FEATURE_SOC_PORT_COUNT (6) -/* @brief PWM availability on the SoC. */ -#define FSL_FEATURE_SOC_PWM_COUNT (2) -/* @brief PUF availability on the SoC. */ -#define FSL_FEATURE_SOC_PUF_COUNT (4) -/* @brief QDC availability on the SoC. */ -#define FSL_FEATURE_SOC_QDC_COUNT (2) -/* @brief RTC availability on the SoC. */ -#define FSL_FEATURE_SOC_RTC_COUNT (1) -/* @brief SCG availability on the SoC. */ -#define FSL_FEATURE_SOC_SCG_COUNT (1) -/* @brief SCT availability on the SoC. */ -#define FSL_FEATURE_SOC_SCT_COUNT (1) -/* @brief SEMA42 availability on the SoC. */ -#define FSL_FEATURE_SOC_SEMA42_COUNT (1) -/* @brief SINC availability on the SoC. */ -#define FSL_FEATURE_SOC_SINC_COUNT (1) -/* @brief SMARTDMA availability on the SoC. */ -#define FSL_FEATURE_SOC_SMARTDMA_COUNT (1) -/* @brief SYSCON availability on the SoC. */ -#define FSL_FEATURE_SOC_SYSCON_COUNT (1) -/* @brief SYSPM availability on the SoC. */ -#define FSL_FEATURE_SOC_SYSPM_COUNT (2) -/* @brief TSI availability on the SoC. */ -#define FSL_FEATURE_SOC_TSI_COUNT (1) -/* @brief USB availability on the SoC. */ -#define FSL_FEATURE_SOC_USB_COUNT (1) -/* @brief USBC availability on the SoC. */ -#define FSL_FEATURE_SOC_USBC_COUNT (1) -/* @brief USBHSDCD availability on the SoC. */ -#define FSL_FEATURE_SOC_USBHSDCD_COUNT (2) -/* @brief USBNC availability on the SoC. */ -#define FSL_FEATURE_SOC_USBNC_COUNT (1) -/* @brief USBPHY availability on the SoC. */ -#define FSL_FEATURE_SOC_USBPHY_COUNT (1) -/* @brief USDHC availability on the SoC. */ -#define FSL_FEATURE_SOC_USDHC_COUNT (1) -/* @brief UTICK availability on the SoC. */ -#define FSL_FEATURE_SOC_UTICK_COUNT (1) -/* @brief VREF availability on the SoC. */ -#define FSL_FEATURE_SOC_VREF_COUNT (1) -/* @brief WWDT availability on the SoC. */ -#define FSL_FEATURE_SOC_WWDT_COUNT (2) -/* @brief WUU availability on the SoC. */ -#define FSL_FEATURE_SOC_WUU_COUNT (1) - -/* LPADC module features */ - -/* @brief FIFO availability on the SoC. */ -#define FSL_FEATURE_LPADC_FIFO_COUNT (2) -/* @brief Has subsequent trigger priority (bitfield CFG[TPRICTRL]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_SUBSEQUENT_PRIORITY (1) -/* @brief Has differential mode (bitfield CMDLn[DIFF]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_DIFF (0) -/* @brief Has channel scale (bitfield CMDLn[CSCALE]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_CSCALE (0) -/* @brief Has conversion type select (bitfield CMDLn[CTYPE]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_CTYPE (1) -/* @brief Has conversion resolution select (bitfield CMDLn[MODE]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_MODE (1) -/* @brief Has compare function enable (bitfield CMDHn[CMPEN]). */ -#define FSL_FEATURE_LPADC_HAS_CMDH_CMPEN (1) -/* @brief Has Wait for trigger assertion before execution (bitfield CMDHn[WAIT_TRIG]). */ -#define FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG (1) -/* @brief Has offset calibration (bitfield CTRL[CALOFS]). */ -#define FSL_FEATURE_LPADC_HAS_CTRL_CALOFS (1) -/* @brief Has gain calibration (bitfield CTRL[CAL_REQ]). */ -#define FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ (1) -/* @brief Has calibration average (bitfield CTRL[CAL_AVGS]). */ -#define FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS (1) -/* @brief Has internal clock (bitfield CFG[ADCKEN]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_ADCKEN (0) -/* @brief Enable support for low voltage reference on option 1 reference (bitfield CFG[VREF1RNG]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG (0) -/* @brief Has calibration (bitfield CFG[CALOFS]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_CALOFS (0) -/* @brief Has offset trim (register OFSTRIM). */ -#define FSL_FEATURE_LPADC_HAS_OFSTRIM (1) -/* @brief OFSTRIM availability on the SoC. */ -#define FSL_FEATURE_LPADC_OFSTRIM_COUNT (2) -/* @brief Has Trigger status register. */ -#define FSL_FEATURE_LPADC_HAS_TSTAT (1) -/* @brief Has power select (bitfield CFG[PWRSEL]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_PWRSEL (1) -/* @brief Has alternate channel B scale (bitfield CMDLn[ALTB_CSCALE]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE (0) -/* @brief Has alternate channel B select enable (bitfield CMDLn[ALTBEN]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN (1) -/* @brief Has alternate channel input (bitfield CMDLn[ALTB_ADCH]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_ALTB_ADCH (1) -/* @brief Has offset calibration mode (bitfield CTRL[CALOFSMODE]). */ -#define FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE (0) -/* @brief Conversion averaged bitfiled width. */ -#define FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH (4) -/* @brief Has B side channels. */ -#define FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS (1) -/* @brief Indicate whether the LPADC STAT register has trigger exception interrupt function (bitfield STAT[TEXC_INT]). */ -#define FSL_FEATURE_LPADC_HAS_STAT_TEXC_INT (1) -/* @brief Indicate whether the LPADC STAT register has trigger completion interrupt function (bitfield STAT[TCOMP_INT]). */ -#define FSL_FEATURE_LPADC_HAS_STAT_TCOMP_INT (1) -/* @brief Indicate whether the LPADC STAT register has calibration ready function (bitfield STAT[CAL_RDY]). */ -#define FSL_FEATURE_LPADC_HAS_STAT_CAL_RDY (1) -/* @brief Indicate whether the LPADC STAT register has ADC active function (bitfield STAT[ADC_ACTIVE]). */ -#define FSL_FEATURE_LPADC_HAS_STAT_ADC_ACTIVE (1) -/* @brief Indicate whether the LPADC IE register has trigger exception interrupt enable function (bitfield IE[TEXC_IE]). */ -#define FSL_FEATURE_LPADC_HAS_IE_TEXC_IE (1) -/* @brief Indicate whether the LPADC IE register has trigger completion interrupt enable function (bitfield IE[TCOMP_IE]). */ -#define FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE (1) -/* @brief Indicate whether the LPADC CFG register has trigger resume/restart enable function (bitfield CFG[TRES]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_TRES (1) -/* @brief Indicate whether the LPADC CFG register has trigger command resume/restart enable function (bitfield CFG[TCMDRES]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_TCMDRES (1) -/* @brief Indicate whether the LPADC CFG register has high priority trigger exception disable function (bitfield CFG[HPT_EXDI]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI (1) -/* @brief Indicate LPADC CFG register TPRICTRL bitfield width. */ -#define FSL_FEATURE_LPADC_CFG_TPRICTRL_BITFIELD_WIDTH (2) -/* @brief Temperature sensor parameter A (slope). */ -#define FSL_FEATURE_LPADC_TEMP_PARAMETER_A (783U) -/* @brief Temperature sensor parameter B (offset). */ -#define FSL_FEATURE_LPADC_TEMP_PARAMETER_B (297U) -/* @brief Temperature sensor parameter Alpha. */ -#define FSL_FEATURE_LPADC_TEMP_PARAMETER_ALPHA (9.63f) -/* @brief The buffer size of temperature sensor. */ -#define FSL_FEATURE_LPADC_TEMP_SENS_BUFFER_SIZE (2U) - -/* CACHE64_CTRL module features */ - -/* @brief Cache Line size in byte. */ -#define FSL_FEATURE_CACHE64_CTRL_LINESIZE_BYTE (32) - -/* CACHE64_POLSEL module features */ - -/* No feature definitions */ - -/* FLEXCAN module features */ - -/* @brief Has more than 64 MBs. */ -#define FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB (0) -/* @brief Message buffer size */ -#define FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(x) (32) -/* @brief Has doze mode support (register bit field MCR[DOZE]). */ -#define FSL_FEATURE_FLEXCAN_HAS_DOZE_MODE_SUPPORT (0) -/* @brief Insatnce has doze mode support (register bit field MCR[DOZE]). */ -#define FSL_FEATURE_FLEXCAN_INSTANCE_HAS_DOZE_MODE_SUPPORTn(x) (0) -/* @brief Has a glitch filter on the receive pin (register bit field MCR[WAKSRC]). */ -#define FSL_FEATURE_FLEXCAN_HAS_GLITCH_FILTER (1) -/* @brief Has extended interrupt mask and flag register (register IMASK2, IFLAG2). */ -#define FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER (0) -/* @brief Instance has extended bit timing register (register CBT). */ -#define FSL_FEATURE_FLEXCAN_INSTANCE_HAS_EXTENDED_TIMING_REGISTERn(x) (1) -/* @brief Has a receive FIFO DMA feature (register bit field MCR[DMA]). */ -#define FSL_FEATURE_FLEXCAN_HAS_RX_FIFO_DMA (1) -/* @brief Instance has a receive FIFO DMA feature (register bit field MCR[DMA]). */ -#define FSL_FEATURE_FLEXCAN_INSTANCE_HAS_RX_FIFO_DMAn(x) (1) -/* @brief Remove CAN Engine Clock Source Selection from unsupported part. */ -#define FSL_FEATURE_FLEXCAN_SUPPORT_ENGINE_CLK_SEL_REMOVE (1) -/* @brief Instance remove CAN Engine Clock Source Selection from unsupported part. */ -#define FSL_FEATURE_FLEXCAN_INSTANCE_SUPPORT_ENGINE_CLK_SEL_REMOVEn(x) (1) -/* @brief Is affected by errata with ID 5641 (Module does not transmit a message that is enabled to be transmitted at a specific moment during the arbitration process). */ -#define FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641 (0) -/* @brief Is affected by errata with ID 5829 (FlexCAN: FlexCAN does not transmit a message that is enabled to be transmitted in a specific moment during the arbitration process). */ -#define FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829 (0) -/* @brief Is affected by errata with ID 6032 (FlexCAN: A frame with wrong ID or payload is transmitted into the CAN bus when the Message Buffer under transmission is either aborted or deactivated while the CAN bus is in the Bus Idle state). */ -#define FSL_FEATURE_FLEXCAN_HAS_ERRATA_6032 (0) -/* @brief Is affected by errata with ID 9595 (FlexCAN: Corrupt frame possible if the Freeze Mode or the Low-Power Mode are entered during a Bus-Off state). */ -#define FSL_FEATURE_FLEXCAN_HAS_ERRATA_9595 (0) -/* @brief Has CAN with Flexible Data rate (CAN FD) protocol. */ -#define FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE (1) -/* @brief CAN instance support Flexible Data rate (CAN FD) protocol. */ -#define FSL_FEATURE_FLEXCAN_INSTANCE_HAS_FLEXIBLE_DATA_RATEn(x) (1) -/* @brief Has memory error control (register MECR). */ -#define FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL (0) -/* @brief Has enhanced bit timing register (register EPRS, ENCBT, EDCBT and ETDC). */ -#define FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG (1) -/* @brief Has Pretended Networking mode support. */ -#define FSL_FEATURE_FLEXCAN_HAS_PN_MODE (1) -/* @brief Has Enhanced Rx FIFO. */ -#define FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO (1) -/* @brief Enhanced Rx FIFO size (Indicates how many CAN FD messages can be stored). */ -#define FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO_SIZE (12) -/* @brief The number of enhanced Rx FIFO filter element registers. */ -#define FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO_FILTER_MAX_NUMBER (32) -/* @brief Does not support Supervisor Mode (bitfield MCR[SUPV]. */ -#define FSL_FEATURE_FLEXCAN_HAS_NO_SUPV_SUPPORT (1) -/* @brief FlexCAN maximum data rate. */ -#define FSL_FEATURE_FLEXCAN_MAX_CANFD_BITRATE (10000000) - -/* CDOG module features */ - -/* @brief CDOG Has No Reset */ -#define FSL_FEATURE_CDOG_HAS_NO_RESET (1) - -/* CMC module features */ - -/* @brief Has SRAM_DIS register */ -#define FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG (1) -/* @brief Has BSR register */ -#define FSL_FEATURE_MCX_CMC_HAS_BSR_REG (1) -/* @brief Has RSTCNT register */ -#define FSL_FEATURE_MCX_CMC_HAS_RSTCNT_REG (1) -/* @brief Has BLR register */ -#define FSL_FEATURE_MCX_CMC_HAS_BLR_REG (1) -/* @brief Has no bitfield FLASHWAKE in FLASHCR register */ -#define FSL_FEATURE_MCX_CMC_HAS_NO_FLASHCR_WAKE (1) - -/* LPCMP module features */ - -/* @brief Has CCR1 FUNC_CLK_SEL bitfield. */ -#define FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL (1) -/* @brief Has IER RRF_IE bitfield. */ -#define FSL_FEATURE_LPCMP_HAS_IER_RRF_IE (1) -/* @brief Has CSR RRF bitfield. */ -#define FSL_FEATURE_LPCMP_HAS_CSR_RRF (1) -/* @brief Has Round Robin mode (related to existence of registers RRCR0). */ -#define FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE (1) -/* @brief Has window mode (related to existence of CCR1.WINDOW_CLS). */ -#define FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL (1) -/* @brief Has no CCR0 CMP_STOP_EN bitfield. */ -#define FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN (1) - -/* SYSPM module features */ - -/* @brief Temperature sensor parameter A (slope). */ -#define FSL_FEATURE_SYSPM_HAS_PMCR_DCIFSH (0) -/* @brief Temperature sensor parameter B (offset). */ -#define FSL_FEATURE_SYSPM_HAS_PMCR_RICTR (0) -/* @brief Number of PMCR registers signals number of performance monitors available in single SYSPM instance. */ -#define FSL_FEATURE_SYSPM_PMCR_COUNT (1) - -/* CTIMER module features */ - -/* @brief CTIMER has no capture channel. */ -#define FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE (0) -/* @brief CTIMER has no capture 2 interrupt. */ -#define FSL_FEATURE_CTIMER_HAS_NO_IR_CR2INT (0) -/* @brief CTIMER capture 3 interrupt. */ -#define FSL_FEATURE_CTIMER_HAS_IR_CR3INT (1) -/* @brief Has CTIMER CCR_CAP2 (register bits CCR[CAP2RE][CAP2FE][CAP2I]. */ -#define FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2 (0) -/* @brief Has CTIMER CCR_CAP3 (register bits CCR[CAP3RE][CAP3FE][CAP3I]). */ -#define FSL_FEATURE_CTIMER_HAS_CCR_CAP3 (1) -/* @brief CTIMER Has register MSR */ -#define FSL_FEATURE_CTIMER_HAS_MSR (1) - -/* LPDAC module features */ - -/* @brief FIFO size. */ -#define FSL_FEATURE_LPDAC_FIFO_SIZE (16) -/* @brief Has OPAMP as buffer, speed control signal (bitfield GCR[BUF_SPD_CTRL]). */ -#define FSL_FEATURE_LPDAC_HAS_GCR_BUF_SPD_CTRL (1) -/* @brief Buffer Enable(bitfield GCR[BUF_EN]). */ -#define FSL_FEATURE_LPDAC_HAS_GCR_BUF_EN (1) -/* @brief RCLK cycles before data latch(bitfield GCR[LATCH_CYC]). */ -#define FSL_FEATURE_LPDAC_HAS_GCR_LATCH_CYC (1) -/* @brief VREF source number. */ -#define FSL_FEATURE_ANALOG_NUM_OF_VREF_SRC (3) -/* @brief Has internal reference current options. */ -#define FSL_FEATURE_LPDAC_HAS_INTERNAL_REFERENCE_CURRENT (1) -/* @brief Support Period trigger mode DAC (bitfield IER[PTGCOCO_IE]). */ -#define FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE (1) - -/* EDMA module features */ - -/* @brief Number of DMA channels (related to number of registers TCD, DCHPRI, bit fields ERQ[ERQn], EEI[EEIn], INT[INTn], ERR[ERRn], HRS[HRSn] and bit field widths ES[ERRCHN], CEEI[CEEI], SEEI[SEEI], CERQ[CERQ], SERQ[SERQ], CDNE[CDNE], SSRT[SSRT], CERR[CERR], CINT[CINT], TCDn_CITER_ELINKYES[LINKCH], TCDn_CSR[MAJORLINKCH], TCDn_BITER_ELINKYES[LINKCH]). (Valid only for eDMA modules.) */ -#define FSL_FEATURE_EDMA_MODULE_CHANNEL (16) -/* @brief If 8 bytes transfer supported. */ -#define FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER (1) -/* @brief Number of DMA channel groups (register bit fields CR[ERGA], CR[GRPnPRI], ES[GPE], DCHPRIn[GRPPRI]). (Valid only for eDMA modules.) */ -#define FSL_FEATURE_EDMA_CHANNEL_GROUP_COUNT (1) -/* @brief If 16 bytes transfer supported. */ -#define FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER (1) -/* @brief Has DMA_Error interrupt vector. */ -#define FSL_FEATURE_EDMA_HAS_ERROR_IRQ (1) -/* @brief If 64 bytes transfer supported. */ -#define FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER (0) -/* @brief whether has prot register */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_PROT_REGISTERn(x) (0) -/* @brief If 128 bytes transfer supported. */ -#define FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER (0) -/* @brief whether has MP channel mux */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_MP_CHANNEL_MUXn(x) (0) -/* @brief If 128 bytes transfer supported. */ -#define FSL_FEATURE_EDMA_INSTANCE_SUPPORT_128_BYTES_TRANSFERn(x) (0) -/* @brief If channel clock controlled independently */ -#define FSL_FEATURE_EDMA_CHANNEL_HAS_OWN_CLOCK_GATE (1) -/* @brief Has register CH_CSR. */ -#define FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG (1) -/* @brief Number of channel for each EDMA instance, (only defined for soc with different channel numbers for difference instance) */ -#define FSL_FEATURE_EDMA_INSTANCE_CHANNELn(x) (16) -/* @brief Has channel mux */ -#define FSL_FEATURE_EDMA_HAS_CHANNEL_MUX (1) -/* @brief Has no register bit fields MP_CSR[EBW]. */ -#define FSL_FEATURE_EDMA_HAS_NO_MP_CSR_EBW (1) -/* @brief Instance has channel mux */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_MUXn(x) (1) -/* @brief If dma has common clock gate */ -#define FSL_FEATURE_EDMA_HAS_COMMON_CLOCK_GATE (0) -/* @brief Has register CH_SBR. */ -#define FSL_FEATURE_EDMA_HAS_SBR (1) -/* @brief If dma channel IRQ support parameter */ -#define FSL_FEATURE_EDMA_MODULE_CHANNEL_IRQ_ENTRY_SUPPORT_PARAMETER (0) -/* @brief Has no register bit fields CH_SBR[ATTR]. */ -#define FSL_FEATURE_EDMA_HAS_NO_CH_SBR_ATTR (1) -/* @brief NBYTES must be multiple of 8 when using scatter gather. */ -#define FSL_FEATURE_EDMA_HAS_ERRATA_51327 (0) -/* @brief Has register bit field CH_CSR[SWAP]. */ -#define FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE (0) -/* @brief NBYTES must be multiple of 8 when using scatter gather. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_ERRATA_51327n(x) (0) -/* @brief Instance has register bit field CH_CSR[SWAP]. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_SWAP_SIZEn(x) (0) -/* @brief Has register bit fields MP_CSR[GMRC]. */ -#define FSL_FEATURE_EDMA_HAS_GLOBAL_MASTER_ID_REPLICATION (1) -/* @brief Has register bit field CH_SBR[INSTR]. */ -#define FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE (0) -/* @brief Instance has register bit field CH_SBR[INSTR]. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_ACCESS_TYPEn(x) (0) -/* @brief Has register bit fields CH_MATTR[WCACHE], CH_MATTR[RCACHE]. */ -#define FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE (0) -/* @brief Instance has register CH_MATTR. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_MEMORY_ATTRIBUTEn(x) (0) -/* @brief Has register bit field CH_CSR[SIGNEXT]. */ -#define FSL_FEATURE_EDMA_HAS_CHANNEL_SIGN_EXTENSION (0) -/* @brief Instance Has register bit field CH_CSR[SIGNEXT]. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_SIGN_EXTENSIONn(x) (0) -/* @brief Has register bit field TCD_CSR[BWC]. */ -#define FSL_FEATURE_EDMA_HAS_BANDWIDTH (1) -/* @brief Instance has register bit field TCD_CSR[BWC]. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_BANDWIDTHn(x) (1) -/* @brief Has register bit fields TCD_CSR[TMC]. */ -#define FSL_FEATURE_EDMA_HAS_TRANSFER_MODE (0) -/* @brief Instance has register bit fields TCD_CSR[TMC]. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_TRANSFER_MODEn(x) (0) -/* @brief Has no register bit fields CH_SBR[SEC]. */ -#define FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC (0) -/* @brief edma5 has different tcd type. */ -#define FSL_FEATURE_EDMA_TCD_TYPEn(x) (0) -/* @brief Number of DMA channels with asynchronous request capability. (Valid only for eDMA modules.) */ -#define FSL_FEATURE_EDMA_ASYNCHRO_REQUEST_CHANNEL_COUNT (16) - -/* EVTG module features */ - -/* @brief OPAMP support force bypass */ -#define FSL_FEATURE_EVTG_HAS_FORCE_BYPASS_FLIPFLOP (1) - -/* FLEXIO module features */ - -/* @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) */ -#define FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_HALF_WORD_SWAP (1) -/* @brief Has Shifter Buffer N Nibble Swapped Register (FLEXIO_SHIFTBUFNISn) */ -#define FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_SWAP (1) -/* @brief Supports Shifter State Mode (FLEXIO_SHIFTCTLn[SMOD]) */ -#define FSL_FEATURE_FLEXIO_HAS_STATE_MODE (1) -/* @brief Supports Shifter Logic Mode (FLEXIO_SHIFTCTLn[SMOD]) */ -#define FSL_FEATURE_FLEXIO_HAS_LOGIC_MODE (1) -/* @brief Supports paralle width (FLEXIO_SHIFTCFGn[PWIDTH]) */ -#define FSL_FEATURE_FLEXIO_HAS_PARALLEL_WIDTH (1) -/* @brief Reset value of the FLEXIO_VERID register */ -#define FSL_FEATURE_FLEXIO_VERID_RESET_VALUE (0x2010003) -/* @brief Reset value of the FLEXIO_PARAM register */ -#define FSL_FEATURE_FLEXIO_PARAM_RESET_VALUE (0x8200808) -/* @brief Represent the bit width of the TIMDCE field (FLEXIO_TIMCFGLn[TIMDEC]) */ -#define FSL_FEATURE_FLEXIO_TIMCFG_TIMDCE_FIELD_WIDTH (3) - -/* FLEXSPI module features */ - -/* @brief FlexSPI AHB buffer count */ -#define FSL_FEATURE_FLEXSPI_AHB_BUFFER_COUNTn(x) (8) -/* @brief FlexSPI0 and FlexSPI1 have shared IRQ */ -#define FSL_FEATURE_FLEXSPI_HAS_SHARED_IRQ0_IRQ1 (0) -/* @brief FlexSPI has no MCR0 ARDFEN bit */ -#define FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_ARDFEN (0) -/* @brief FlexSPI has no MCR0 ATDFEN bit */ -#define FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_ATDFEN (0) -/* @brief FlexSPI DMA needs multiple DES to transfer */ -#define FSL_FEATURE_FLEXSPI_DMA_MULTIPLE_DES (1) -/* @brief FlexSPI AHB RX buffer size (byte) */ -#define FSL_FEATURE_FLEXSPI_AHB_RX_BUFFER_SIZEn(x) (2048) - -/* GPIO module features */ - -/* @brief Has GPIO attribute checker register (GACR). */ -#define FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER (0) -/* @brief Has GPIO version ID register (VERID). */ -#define FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER (1) -/* @brief Has secure/non-secure access protection registers (LOCK, PCNS, PCNP, ICNS, ICNP). */ -#define FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL (1) -/* @brief Has GPIO port input disable register (PIDR). */ -#define FSL_FEATURE_GPIO_HAS_PORT_INPUT_CONTROL (1) -/* @brief Has GPIO interrupt/DMA request/trigger output selection. */ -#define FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT (1) - -/* I3C module features */ - -/* @brief Has TERM bitfile in MERRWARN register. */ -#define FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM (1) -/* @brief SOC has no reset driver. */ -#define FSL_FEATURE_I3C_HAS_NO_RESET (0) -/* @brief Use fixed BAMATCH count, do not provide editable BAMATCH. */ -#define FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH (0) -/* @brief Register SCONFIG do not have IDRAND bitfield. */ -#define FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND (0) - -/* INPUTMUX module features */ - -/* @brief Inputmux has DMA Request Enable */ -#define FSL_FEATURE_INPUTMUX_HAS_SIGNAL_ENA (1) -/* @brief Inputmux has channel mux control */ -#define FSL_FEATURE_INPUTMUX_HAS_CHANNEL_MUX (0) - -/* INTM module features */ - -/* @brief Up to 4 programmable interrupt monitors */ -#define FSL_FEATURE_INTM_MONITOR_COUNT (4) - -/* LPI2C module features */ - -/* @brief Has separate DMA RX and TX requests. */ -#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) - -/* LPSPI module features */ - -/* @brief Capacity (number of entries) of the transmit/receive FIFO (or zero if no FIFO is available). */ -#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 */ -#define FSL_FEATURE_LPSPI_HAS_NO_PCSCFG (0) -/* @brief Has no WIDTH bits in TCR register */ -#define FSL_FEATURE_LPSPI_HAS_NO_MULTI_WIDTH (0) - -/* LPTMR module features */ - -/* @brief Has shared interrupt handler with another LPTMR module. */ -#define FSL_FEATURE_LPTMR_HAS_SHARED_IRQ_HANDLER (0) -/* @brief Whether LPTMR counter is 32 bits width. */ -#define FSL_FEATURE_LPTMR_CNR_WIDTH_IS_32B (1) -/* @brief Has timer DMA request enable (register bit CSR[TDRE]). */ -#define FSL_FEATURE_LPTMR_HAS_CSR_TDRE (1) -/* @brief Do not has prescaler clock source 0. */ -#define FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_0_SUPPORT (0) -/* @brief Do not has prescaler clock source 1. */ -#define FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT (0) -/* @brief Do not has prescaler clock source 2. */ -#define FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_2_SUPPORT (0) -/* @brief Do not has prescaler clock source 3. */ -#define FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_3_SUPPORT (0) - -/* LPUART module features */ - -/* @brief Has receive FIFO overflow detection (bit field CFIFO[RXOFE]). */ -#define FSL_FEATURE_LPUART_HAS_IRQ_EXTENDED_FUNCTIONS (0) -/* @brief Has low power features (can be enabled in wait mode via register bit C1[DOZEEN] or CTRL[DOZEEN] if the registers are 32-bit wide). */ -#define FSL_FEATURE_LPUART_HAS_LOW_POWER_UART_SUPPORT (1) -/* @brief Has extended data register ED (or extra flags in the DATA register if the registers are 32-bit wide). */ -#define FSL_FEATURE_LPUART_HAS_EXTENDED_DATA_REGISTER_FLAGS (1) -/* @brief Capacity (number of entries) of the transmit/receive FIFO (or zero if no FIFO is available). */ -#define FSL_FEATURE_LPUART_HAS_FIFO (1) -/* @brief Has 32-bit register MODIR */ -#define FSL_FEATURE_LPUART_HAS_MODIR (1) -/* @brief Hardware flow control (RTS, CTS) is supported. */ -#define FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT (1) -/* @brief Infrared (modulation) is supported. */ -#define FSL_FEATURE_LPUART_HAS_IR_SUPPORT (1) -/* @brief 2 bits long stop bit is available. */ -#define FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT (1) -/* @brief If 10-bit mode is supported. */ -#define FSL_FEATURE_LPUART_HAS_10BIT_DATA_SUPPORT (1) -/* @brief If 7-bit mode is supported. */ -#define FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT (1) -/* @brief Baud rate fine adjustment is available. */ -#define FSL_FEATURE_LPUART_HAS_BAUD_RATE_FINE_ADJUST_SUPPORT (0) -/* @brief Baud rate oversampling is available (has bit fields C4[OSR], C5[BOTHEDGE], C5[RESYNCDIS] or BAUD[OSR], BAUD[BOTHEDGE], BAUD[RESYNCDIS] if the registers are 32-bit wide). */ -#define FSL_FEATURE_LPUART_HAS_BAUD_RATE_OVER_SAMPLING_SUPPORT (1) -/* @brief Baud rate oversampling is available. */ -#define FSL_FEATURE_LPUART_HAS_RX_RESYNC_SUPPORT (1) -/* @brief Baud rate oversampling is available. */ -#define FSL_FEATURE_LPUART_HAS_BOTH_EDGE_SAMPLING_SUPPORT (1) -/* @brief Peripheral type. */ -#define FSL_FEATURE_LPUART_IS_SCI (1) -/* @brief Capacity (number of entries) of the transmit/receive FIFO (or zero if no FIFO is available). */ -#define FSL_FEATURE_LPUART_FIFO_SIZEn(x) (8) -/* @brief Supports two match addresses to filter incoming frames. */ -#define FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING (1) -/* @brief Has transmitter/receiver DMA enable bits C5[TDMAE]/C5[RDMAE] (or BAUD[TDMAE]/BAUD[RDMAE] if the registers are 32-bit wide). */ -#define FSL_FEATURE_LPUART_HAS_DMA_ENABLE (1) -/* @brief Has transmitter/receiver DMA select bits C4[TDMAS]/C4[RDMAS], resp. C5[TDMAS]/C5[RDMAS] if IS_SCI = 0. */ -#define FSL_FEATURE_LPUART_HAS_DMA_SELECT (0) -/* @brief Data character bit order selection is supported (bit field S2[MSBF] or STAT[MSBF] if the registers are 32-bit wide). */ -#define FSL_FEATURE_LPUART_HAS_BIT_ORDER_SELECT (1) -/* @brief Has smart card (ISO7816 protocol) support and no improved smart card support. */ -#define FSL_FEATURE_LPUART_HAS_SMART_CARD_SUPPORT (0) -/* @brief Has improved smart card (ISO7816 protocol) support. */ -#define FSL_FEATURE_LPUART_HAS_IMPROVED_SMART_CARD_SUPPORT (0) -/* @brief Has local operation network (CEA709.1-B protocol) support. */ -#define FSL_FEATURE_LPUART_HAS_LOCAL_OPERATION_NETWORK_SUPPORT (0) -/* @brief Has 32-bit registers (BAUD, STAT, CTRL, DATA, MATCH, MODIR) instead of 8-bit (BDH, BDL, C1, S1, D, etc.). */ -#define FSL_FEATURE_LPUART_HAS_32BIT_REGISTERS (1) -/* @brief Lin break detect available (has bit BAUD[LBKDIE]). */ -#define FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT (1) -/* @brief UART stops in Wait mode available (has bit C1[UARTSWAI]). */ -#define FSL_FEATURE_LPUART_HAS_WAIT_MODE_OPERATION (0) -/* @brief Has separate DMA RX and TX requests. */ -#define FSL_FEATURE_LPUART_HAS_SEPARATE_DMA_RX_TX_REQn(x) (1) -/* @brief Has separate RX and TX interrupts. */ -#define FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ (0) -/* @brief Has LPAURT_PARAM. */ -#define FSL_FEATURE_LPUART_HAS_PARAM (1) -/* @brief Has LPUART_VERID. */ -#define FSL_FEATURE_LPUART_HAS_VERID (1) -/* @brief Has LPUART_GLOBAL. */ -#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 (1) -/* @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) - -/* LP_FLEXCOMM module features */ - -/* No feature definitions */ - -/* MAILBOX module features */ - -/* @brief Mailbox side for current core */ -#define FSL_FEATURE_MAILBOX_SIDE_A (1) - -/* MRT module features */ - -/* @brief number of channels. */ -#define FSL_FEATURE_MRT_NUMBER_OF_CHANNELS (4) - -/* OPAMP module features */ - -/* @brief Opamp has OPAMP_CTR OUTSW bit */ -#define FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_OUTSW (1) -/* @brief Opamp has OPAMP_CTR ADCSW1 bit */ -#define FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW1 (1) -/* @brief Opamp has OPAMP_CTR ADCSW2 bit */ -#define FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW2 (1) -/* @brief Opamp has OPAMP_CTR BUFEN bit */ -#define FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_BUFEN (1) -/* @brief Opamp has OPAMP_CTR INPSEL bit */ -#define FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_INPSEL (1) -/* @brief Opamp has OPAMP_CTR TRIGMD bit */ -#define FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_TRIGMD (1) -/* @brief OPAMP support reference buffer */ -#define FSL_FEATURE_OPAMP_HAS_SUPPORT_REFERENCE_BUFFER (1) - -/* PDM module features */ - -/* @brief PDM FIFO offset */ -#define FSL_FEATURE_PDM_FIFO_OFFSET (4) -/* @brief PDM Channel Number */ -#define FSL_FEATURE_PDM_CHANNEL_NUM (4) -/* @brief PDM FIFO WIDTH Size */ -#define FSL_FEATURE_PDM_FIFO_WIDTH (4) -/* @brief PDM FIFO DEPTH Size */ -#define FSL_FEATURE_PDM_FIFO_DEPTH (16) -/* @brief PDM has RANGE_CTRL register */ -#define FSL_FEATURE_PDM_HAS_RANGE_CTRL (1) -/* @brief PDM Has Low Frequency */ -#define FSL_FEATURE_PDM_HAS_STATUS_LOW_FREQ (0) -/* @brief PDM Has No VADEF Bitfield In PDM VAD0_STAT Register */ -#define FSL_FEATURE_PDM_HAS_NO_VADEF (1) -/* @brief PDM Has no minimum clkdiv */ -#define FSL_FEATURE_PDM_HAS_NO_MINIMUM_CLKDIV (1) -/* @brief PDM Has no FIR_RDY Bitfield In PDM STAT Register */ -#define FSL_FEATURE_PDM_HAS_NO_FIR_RDY (1) -/* @brief PDM Has no DOZEN Bitfield In PDM CTRL_1 Register */ -#define FSL_FEATURE_PDM_HAS_NO_DOZEN (0) -/* @brief PDM Has DEC_BYPASS Bitfield In PDM CTRL_2 Register */ -#define FSL_FEATURE_PDM_HAS_DECIMATION_FILTER_BYPASS (0) -/* @brief PDM Has DC_OUT_CTRL */ -#define FSL_FEATURE_PDM_HAS_DC_OUT_CTRL (1) -/* @brief PDM Has Fixed DC CTRL VALUE. */ -#define FSL_FEATURE_PDM_DC_CTRL_VALUE_FIXED (1) -/* @brief PDM Has no independent error IRQ */ -#define FSL_FEATURE_PDM_HAS_NO_INDEPENDENT_ERROR_IRQ (1) -/* @brief PDM has no hardware Voice Activity Detector */ -#define FSL_FEATURE_PDM_HAS_NO_HWVAD (1) - -/* PINT module features */ - -/* @brief Number of connected outputs */ -#define FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS (8) -/* @brief PINT Interrupt Combine */ -#define FSL_FEATURE_PINT_INTERRUPT_COMBINE (1) - -/* PLU module features */ - -/* @brief Has WAKEINT_CTRL register. */ -#define FSL_FEATURE_PLU_HAS_WAKEINT_CTRL_REG (1) - -/* PORT module features */ - -/* @brief Has control lock (register bit PCR[LK]). */ -#define FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK (1) -/* @brief Has open drain control (register bit PCR[ODE]). */ -#define FSL_FEATURE_PORT_HAS_OPEN_DRAIN (1) -/* @brief Has digital filter (registers DFER, DFCR and DFWR). */ -#define FSL_FEATURE_PORT_HAS_DIGITAL_FILTER (0) -/* @brief Has DMA request (register bit field PCR[IRQC] or ICR[IRQC] values). */ -#define FSL_FEATURE_PORT_HAS_DMA_REQUEST (0) -/* @brief Has pull resistor selection available. */ -#define FSL_FEATURE_PORT_HAS_PULL_SELECTION (1) -/* @brief Has pull resistor enable (register bit PCR[PE]). */ -#define FSL_FEATURE_PORT_HAS_PULL_ENABLE (1) -/* @brief Has slew rate control (register bit PCR[SRE]). */ -#define FSL_FEATURE_PORT_HAS_SLEW_RATE (1) -/* @brief Has passive filter (register bit field PCR[PFE]). */ -#define FSL_FEATURE_PORT_HAS_PASSIVE_FILTER (1) -/* @brief Do not has interrupt control (register ISFR). */ -#define FSL_FEATURE_PORT_HAS_NO_INTERRUPT (1) -/* @brief Has pull value (register bit field PCR[PV]). */ -#define FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE (1) -/* @brief Has drive strength1 control (register bit PCR[DSE1]). */ -#define FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1 (0) -/* @brief Has version ID register (register VERID). */ -#define FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER (1) -/* @brief Has voltage range control (register bit CONFIG[RANGE]). */ -#define FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE (1) -/* @brief Has EFT detect (registers EDFR, EDIER and EDCR). */ -#define FSL_FEATURE_PORT_SUPPORT_EFT (1) -/* @brief Function 0 is GPIO. */ -#define FSL_FEATURE_PORT_PCR_MUX_GPIO (0) -/* @brief Has drive strength control (register bit PCR[DSE]). */ -#define FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH (1) -/* @brief Defines width of PCR[MUX] field. */ -#define FSL_FEATURE_PORT_PCR_MUX_WIDTH (4) -/* @brief Has dedicated interrupt vector. */ -#define FSL_FEATURE_PORT_HAS_INTERRUPT_VECTOR (1) -/* @brief Has independent interrupt control(register ICR). */ -#define FSL_FEATURE_PORT_HAS_INDEPENDENT_INTERRUPT_CONTROL (0) -/* @brief Has multiple pin IRQ configuration (register GICLR and GICHR). */ -#define FSL_FEATURE_PORT_HAS_MULTIPLE_IRQ_CONFIG (0) -/* @brief Has Input Buffer Enable (register bit field PCR[IBE]). */ -#define FSL_FEATURE_PORT_HAS_INPUT_BUFFER (1) -/* @brief Has Invert Input (register bit field PCR[IBE]). */ -#define FSL_FEATURE_PORT_HAS_INVERT_INPUT (1) -/* @brief Defines whether PCR[IRQC] bit-field has flag states. */ -#define FSL_FEATURE_PORT_HAS_IRQC_FLAG (0) -/* @brief Defines whether PCR[IRQC] bit-field has trigger states. */ -#define FSL_FEATURE_PORT_HAS_IRQC_TRIGGER (0) - -/* PUF module features */ - -/* @brief Puf Activation Code Address. */ -#define FSL_FEATURE_PUF_ACTIVATION_CODE_ADDRESS (17826304) -/* @brief Puf Activation Code Size. */ -#define FSL_FEATURE_PUF_ACTIVATION_CODE_SIZE (1000) - -/* PWM module features */ - -/* @brief If (e)FlexPWM has module A channels (outputs). */ -#define FSL_FEATURE_PWM_HAS_CHANNELA (1) -/* @brief If (e)FlexPWM has module B channels (outputs). */ -#define FSL_FEATURE_PWM_HAS_CHANNELB (1) -/* @brief If (e)FlexPWM has module X channels (outputs). */ -#define FSL_FEATURE_PWM_HAS_CHANNELX (1) -/* @brief If (e)FlexPWM has fractional feature. */ -#define FSL_FEATURE_PWM_HAS_FRACTIONAL (1) -/* @brief If (e)FlexPWM has mux trigger source select bit field. */ -#define FSL_FEATURE_PWM_HAS_MUX_TRIGGER_SOURCE_SEL (1) -/* @brief Number of submodules in each (e)FlexPWM module. */ -#define FSL_FEATURE_PWM_SUBMODULE_COUNT (4) -/* @brief Number of fault channel in each (e)FlexPWM module. */ -#define FSL_FEATURE_PWM_FAULT_CH_COUNT (1) -/* @brief (e)FlexPWM has no WAITEN Bitfield In CTRL2 Register. */ -#define FSL_FEATURE_PWM_HAS_NO_WAITEN (1) -/* @brief If (e)FlexPWM has phase delay feature. */ -#define FSL_FEATURE_PWM_HAS_PHASE_DELAY (1) -/* @brief If (e)FlexPWM has input filter capture feature. */ -#define FSL_FEATURE_PWM_HAS_INPUT_FILTER_CAPTURE (1) -/* @brief If (e)FlexPWM has module capture functionality on A channels (inputs). */ -#define FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA (1) -/* @brief If (e)FlexPWM has module capture functionality on B channels (inputs). */ -#define FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB (1) -/* @brief If (e)FlexPWM has module capture functionality on X channels (inputs). */ -#define FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX (1) - -/* QDC module features */ - -/* @brief Has no simultaneous PHASEA and PHASEB change interrupt (register bit field CTRL2[SABIE] and CTRL2[SABIRQ]). */ -#define FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT (0) -/* @brief Has register CTRL3. */ -#define FSL_FEATURE_QDC_HAS_CTRL3 (1) -/* @brief Has register LASTEDGE or LASTEDGEH. */ -#define FSL_FEATURE_QDC_HAS_LASTEDGE (1) -/* @brief Has register POSDPERBFR, POSDPERH, or POSDPER. */ -#define FSL_FEATURE_QDC_HAS_POSDPER (1) -/* @brief Has bitfiled FILT[FILT_PRSC]. */ -#define FSL_FEATURE_QDC_HAS_FILT_PRSC (1) - -/* RTC module features */ - -/* @brief Has Tamper Direction Register support. */ -#define FSL_FEATURE_RTC_HAS_TAMPER_DIRECTION (0) -/* @brief Has Tamper Queue Status and Control Register support. */ -#define FSL_FEATURE_RTC_HAS_TAMPER_QUEUE (0) -/* @brief Has RTC subsystem. */ -#define FSL_FEATURE_RTC_HAS_SUBSYSTEM (1) -/* @brief Has RTC Tamper 23 Filter Configuration Register support. */ -#define FSL_FEATURE_RTC_HAS_FILTER23_CFG (0) -/* @brief Has WAKEUP_MODE bitfile in CTRL2 register. */ -#define FSL_FEATURE_RTC_HAS_NO_CTRL2_WAKEUP_MODE (1) -/* @brief Has CLK_SEL bitfile in CTRL register. */ -#define FSL_FEATURE_RTC_HAS_CLOCK_SELECT (1) -/* @brief Has CLKO_DIS bitfile in CTRL register. */ -#define FSL_FEATURE_RTC_HAS_CLOCK_OUTPUT_DISABLE (1) -/* @brief Has No Tamper in RTC. */ -#define FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE (1) -/* @brief Has CPU_LOW_VOLT bitfile in STATUS register. */ -#define FSL_FEATURE_RTC_HAS_NO_CPU_LOW_VOLT_FLAG (1) -/* @brief Has RST_SRC bitfile in STATUS register. */ -#define FSL_FEATURE_RTC_HAS_NO_RST_SRC_FLAG (1) -/* @brief Has GP_DATA_REG register. */ -#define FSL_FEATURE_RTC_HAS_NO_GP_DATA_REG (1) -/* @brief Has TIMER_STB_MASK bitfile in CTRL register. */ -#define FSL_FEATURE_RTC_HAS_NO_TIMER_STB_MASK (1) - -/* SAI module features */ - -/* @brief SAI has FIFO in this soc (register bit fields TCR1[TFW]. */ -#define FSL_FEATURE_SAI_HAS_FIFO (1) -/* @brief Receive/transmit FIFO size in item count (register bit fields TCSR[FRDE], TCSR[FRIE], TCSR[FRF], TCR1[TFW], RCSR[FRDE], RCSR[FRIE], RCSR[FRF], RCR1[RFW], registers TFRn, RFRn). */ -#define FSL_FEATURE_SAI_FIFO_COUNTn(x) (8) -/* @brief Receive/transmit channel number (register bit fields TCR3[TCE], RCR3[RCE], registers TDRn and RDRn). */ -#define FSL_FEATURE_SAI_CHANNEL_COUNTn(x) (2) -/* @brief Maximum words per frame (register bit fields TCR3[WDFL], TCR4[FRSZ], TMR[TWM], RCR3[WDFL], RCR4[FRSZ], RMR[RWM]). */ -#define FSL_FEATURE_SAI_MAX_WORDS_PER_FRAME (32) -/* @brief Has support of combining multiple data channel FIFOs into single channel FIFO (register bit fields TCR3[CFR], TCR4[FCOMB], TFR0[WCP], TFR1[WCP], RCR3[CFR], RCR4[FCOMB], RFR0[RCP], RFR1[RCP]). */ -#define FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE (1) -/* @brief Has packing of 8-bit and 16-bit data into each 32-bit FIFO word (register bit fields TCR4[FPACK], RCR4[FPACK]). */ -#define FSL_FEATURE_SAI_HAS_FIFO_PACKING (1) -/* @brief Configures when the SAI will continue transmitting after a FIFO error has been detected (register bit fields TCR4[FCONT], RCR4[FCONT]). */ -#define FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR (1) -/* @brief Configures if the frame sync is generated internally, a frame sync is only generated when the FIFO warning flag is clear or continuously (register bit fields TCR4[ONDEM], RCR4[ONDEM]). */ -#define FSL_FEATURE_SAI_HAS_ON_DEMAND_MODE (1) -/* @brief Simplified bit clock source and asynchronous/synchronous mode selection (register bit fields TCR2[CLKMODE], RCR2[CLKMODE]), in comparison with the exclusively implemented TCR2[SYNC,BCS,BCI,MSEL], RCR2[SYNC,BCS,BCI,MSEL]. */ -#define FSL_FEATURE_SAI_HAS_CLOCKING_MODE (0) -/* @brief Has register for configuration of the MCLK divide ratio (register bit fields MDR[FRACT], MDR[DIVIDE]). */ -#define FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER (0) -/* @brief Interrupt source number */ -#define FSL_FEATURE_SAI_INT_SOURCE_NUM (1) -/* @brief Has register of MCR. */ -#define FSL_FEATURE_SAI_HAS_MCR (1) -/* @brief Has bit field MICS of the MCR register. */ -#define FSL_FEATURE_SAI_HAS_NO_MCR_MICS (1) -/* @brief Has register of MDR */ -#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]. */ -#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 (1) - -/* SCT module features */ - -/* @brief Number of events */ -#define FSL_FEATURE_SCT_NUMBER_OF_EVENTS (16) -/* @brief Number of states */ -#define FSL_FEATURE_SCT_NUMBER_OF_STATES (16) -/* @brief Number of match capture */ -#define FSL_FEATURE_SCT_NUMBER_OF_MATCH_CAPTURE (16) -/* @brief Number of outputs */ -#define FSL_FEATURE_SCT_NUMBER_OF_OUTPUTS (10) - -/* SEMA42 module features */ - -/* @brief Gate counts */ -#define FSL_FEATURE_SEMA42_GATE_COUNT (16) - -/* SINC module features */ - -/* @brief SINC channel count. */ -#define FSL_FEATURE_SINC_CHANNEL_COUNT (5) -/* @brief SINC CACFR register has bitfield ADMASEL. */ -#define FSL_FEATURE_SINC_CACFR_HAS_ADMASEL (1) -/* @brief SINC CACFR register has no bitfield PTMUX. */ -#define FSL_FEATURE_SINC_CACFR_HAS_NO_PTMUX (1) - -/* SPC module features */ - -/* @brief Has DCDC */ -#define FSL_FEATURE_MCX_SPC_HAS_DCDC (1) -/* @brief Has SYS LDO */ -#define FSL_FEATURE_MCX_SPC_HAS_SYS_LDO (1) -/* @brief Has IOVDD_LVDF */ -#define FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD (1) -/* @brief Has COREVDD_HVDF */ -#define FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD (1) -/* @brief Has CORELDO_VDD_DS */ -#define FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS (1) -/* @brief Has LPBUFF_EN */ -#define FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT (1) -/* @brief Has COREVDD_IVS_EN */ -#define FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT (1) -/* @brief Has SWITCH_STATE */ -#define FSL_FEATURE_MCX_SPC_HAS_SWITCH_STATE_BIT (0) -/* @brief Has SRAMRETLDO */ -#define FSL_FEATURE_MCX_SPC_HAS_SRAMRETLDO_REG (0) -/* @brief Has CFG register */ -#define FSL_FEATURE_MCX_SPC_HAS_CFG_REG (0) -/* @brief Has SRAMLDO_DPD_ON */ -#define FSL_FEATURE_MCX_SPC_HAS_SRAMLDO_DPD_ON_BIT (0) -/* @brief Has CNTRL register */ -#define FSL_FEATURE_MCX_SPC_HAS_CNTRL_REG (1) -/* @brief Has DPDOWN_PULLDOWN_DISABLE */ -#define FSL_FEATURE_MCX_SPC_HAS_DPDOWN_PULLDOWN_DISABLE_BIT (1) -/* @brief Has BLEED_EN */ -#define FSL_FEATURE_MCX_SPC_HAS_DCDC_CFG_BLEED_EN (1) - -/* SYSCON module features */ - -/* @brief Flash page size in bytes */ -#define FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES (128) -/* @brief Flash sector size in bytes */ -#define FSL_FEATURE_SYSCON_FLASH_SECTOR_SIZE_BYTES (8192) -/* @brief Flash size in bytes */ -#define FSL_FEATURE_SYSCON_FLASH_SIZE_BYTES (2097152) -/* @brief Starter register discontinuous. */ -#define FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS (1) -/* @brief Support ROMAPI. */ -#define FSL_FEATURE_SYSCON_ROMAPI (1) -/* @brief Powerlib API is different with other series devices.. */ -#define FSL_FEATURE_POWERLIB_EXTEND (1) - -/* TRDC module features */ - -/* @brief Process master count. */ -#define FSL_FEATURE_TRDC_PROCESSOR_MASTER_COUNT (2) -/* @brief TRDC instance has PID configuration or not. */ -#define FSL_FEATURE_TRDC_INSTANCE_HAS_PID_CONFIGURATIONn(x) (0) -/* @brief TRDC instance has MBC. */ -#define FSL_FEATURE_TRDC_HAS_MBC (1) -/* @brief TRDC instance has MRC. */ -#define FSL_FEATURE_TRDC_HAS_MRC (0) -/* @brief TRDC instance has TRDC_CR. */ -#define FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG (0) -/* @brief TRDC instance has MDA_Wx_y_DFMT. */ -#define FSL_FEATURE_TRDC_HAS_DOMAIN_ASSIGNMENT (0) -/* @brief TRDC instance has TRDC_FDID. */ -#define FSL_FEATURE_TRDC_HAS_DOMAIN_ERROR (0) -/* @brief TRDC instance has TRDC_FLW_CTL. */ -#define FSL_FEATURE_TRDC_HAS_FLW (0) - -/* TSI module features */ - -/* @brief TSI Version */ -#define FSL_FEATURE_TSI_VERSION (6U) -/* @brief TSI Channel Count */ -#define FSL_FEATURE_TSI_CHANNEL_COUNT (25U) - -/* USBHSDCD module features */ - -/* @brief Size of the USB dedicated RAM */ -#define FSL_FEATURE_USB_USB_RAM (2048) -/* @brief Base address of the USB dedicated RAM */ -#define FSL_FEATURE_USB_USB_RAM_BASE_ADDRESS (1074503680) - -/* USB module features */ - -/* @brief KHCI module instance count */ -#define FSL_FEATURE_USB_KHCI_COUNT (1) -/* @brief HOST mode enabled */ -#define FSL_FEATURE_USB_KHCI_HOST_ENABLED (1) -/* @brief OTG mode enabled */ -#define FSL_FEATURE_USB_KHCI_OTG_ENABLED (1) -/* @brief Size of the USB dedicated RAM */ -#define FSL_FEATURE_USB_KHCI_USB_RAM (2048) -/* @brief Base address of the USB dedicated RAM */ -#define FSL_FEATURE_USB_KHCI_USB_RAM_BASE_ADDRESS (1074503680) -/* @brief Has KEEP_ALIVE_CTRL register */ -#define FSL_FEATURE_USB_KHCI_KEEP_ALIVE_ENABLED (1) -/* @brief Mode control of the USB Keep Alive */ -#define FSL_FEATURE_USB_KHCI_KEEP_ALIVE_MODE_CONTROL (USB_KEEP_ALIVE_CTRL_WAKE_REQ_EN_MASK) -/* @brief Has the Dynamic SOF threshold compare support */ -#define FSL_FEATURE_USB_KHCI_DYNAMIC_SOF_THRESHOLD_COMPARE_ENABLED (1) -/* @brief Has the VBUS detect support */ -#define FSL_FEATURE_USB_KHCI_VBUS_DETECT_ENABLED (1) -/* @brief Has the IRC48M module clock support */ -#define FSL_FEATURE_USB_KHCI_IRC48M_MODULE_CLOCK_ENABLED (1) -/* @brief Number of endpoints supported */ -#define FSL_FEATURE_USB_ENDPT_COUNT (16) -/* @brief Has STALL_IL/OL_DIS registers */ -#define FSL_FEATURE_USB_KHCI_HAS_STALL_LOW (1) -/* @brief Has STALL_IH/OH_DIS registers */ -#define FSL_FEATURE_USB_KHCI_HAS_STALL_HIGH (1) - -/* USBPHY module features */ - -/* @brief USBPHY contain DCD analog module */ -#define FSL_FEATURE_USBPHY_HAS_DCD_ANALOG (0) -/* @brief USBPHY has register TRIM_OVERRIDE_EN */ -#define FSL_FEATURE_USBPHY_HAS_TRIM_OVERRIDE_EN (1) -/* @brief USBPHY is 28FDSOI */ -#define FSL_FEATURE_USBPHY_28FDSOI (0) - -/* USDHC module features */ - -/* @brief Has external DMA support (VEND_SPEC[EXT_DMA_EN]) */ -#define FSL_FEATURE_USDHC_HAS_EXT_DMA (0) -/* @brief Has HS400 mode (MIX_CTRL[HS400_MODE]) */ -#define FSL_FEATURE_USDHC_HAS_HS400_MODE (0) -/* @brief Has SDR50 support (HOST_CTRL_CAP[SDR50_SUPPORT]) */ -#define FSL_FEATURE_USDHC_HAS_SDR50_MODE (1) -/* @brief Has SDR104 support (HOST_CTRL_CAP[SDR104_SUPPORT]) */ -#define FSL_FEATURE_USDHC_HAS_SDR104_MODE (1) -/* @brief USDHC has reset control */ -#define FSL_FEATURE_USDHC_HAS_RESET (0) -/* @brief USDHC has no bitfield WTMK_LVL[WR_BRST_LEN] and WTMK_LVL[RD_BRST_LEN] */ -#define FSL_FEATURE_USDHC_HAS_NO_RW_BURST_LEN (0) -/* @brief If USDHC instance support 8 bit width */ -#define FSL_FEATURE_USDHC_INSTANCE_SUPPORT_8_BIT_WIDTHn(x) (1) -/* @brief If USDHC instance support HS400 mode */ -#define FSL_FEATURE_USDHC_INSTANCE_SUPPORT_HS400_MODEn(x) (0) -/* @brief If USDHC instance support 1v8 signal */ -#define FSL_FEATURE_USDHC_INSTANCE_SUPPORT_1V8_SIGNALn(x) (1) -/* @brief Has no retuning time counter (HOST_CTRL_CAP[TIME_COUNT_RETURNING]) */ -#define FSL_FEATURE_USDHC_REGISTER_HOST_CTRL_CAP_HAS_NO_RETUNING_TIME_COUNTER (1) -/* @brief Has no VSELECT bit in VEND_SPEC register */ -#define FSL_FEATURE_USDHC_HAS_NO_VOLTAGE_SELECT (1) -/* @brief Has no VS18 bit in HOST_CTRL_CAP register */ -#define FSL_FEATURE_USDHC_HAS_NO_VS18 (0) - -/* UTICK module features */ - -/* @brief UTICK does not support PD configure. */ -#define FSL_FEATURE_UTICK_HAS_NO_PDCFG (1) - -/* VBAT module features */ - -/* @brief Has STATUS register */ -#define FSL_FEATURE_MCX_VBAT_HAS_STATUS_REG (1) -/* @brief Has TAMPER register */ -#define FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG (1) -/* @brief Has BANDGAP register */ -#define FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER (1) -/* @brief Has LDOCTL register */ -#define FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG (1) -/* @brief Has OSCCTL register */ -#define FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG (1) -/* @brief Has SWICTL register */ -#define FSL_FEATURE_MCX_VBAT_HAS_SWICTL_REG (1) -/* @brief Has CLKMON register */ -#define FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG (0) -/* @brief Has FINE_AMP_GAIN bitfield in register OSCCTLA */ -#define FSL_FEATURE_MCX_VBAT_HAS_OSCCTLA_FINE_AMP_GAIN_BIT (0) - -/* WWDT module features */ - -/* @brief Has no RESET register. */ -#define FSL_FEATURE_WWDT_HAS_NO_RESET (1) -/* @brief WWDT does not support power down configure */ -#define FSL_FEATURE_WWDT_HAS_NO_PDCFG (1) - -#endif /* _MCXN947_cm33_core0_FEATURES_H_ */ - diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/MCXN947_cm33_core1.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/MCXN947_cm33_core1.h deleted file mode 100644 index b1702ec3066..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/MCXN947_cm33_core1.h +++ /dev/null @@ -1,93743 +0,0 @@ -/* -** ################################################################### -** Processors: MCXN947VDF_cm33_core1 -** MCXN947VNL_cm33_core1 -** -** Compilers: GNU C Compiler -** IAR ANSI C/C++ Compiler for ARM -** Keil ARM C/C++ Compiler -** MCUXpresso Compiler -** -** Reference manual: MCXNx4x Reference Manual -** Version: rev. 2.0, 2023-02-01 -** Build: b240510 -** -** Abstract: -** CMSIS Peripheral Access Layer for MCXN947_cm33_core1 -** -** Copyright 1997-2016 Freescale Semiconductor, Inc. -** Copyright 2016-2024 NXP -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** Revisions: -** - rev. 1.0 (2022-10-01) -** Initial version -** - rev. 2.0 (2023-02-01) -** Initial version based on Rev. 2 Draft B -** -** ################################################################### -*/ - -/*! - * @file MCXN947_cm33_core1.h - * @version 2.0 - * @date 2023-02-01 - * @brief CMSIS Peripheral Access Layer for MCXN947_cm33_core1 - * - * CMSIS Peripheral Access Layer for MCXN947_cm33_core1 - */ - -#if !defined(MCXN947_CM33_CORE1_H_) -#define MCXN947_CM33_CORE1_H_ /**< Symbol preventing repeated inclusion */ - -/** Memory map major version (memory maps with equal major version number are - * compatible) */ -#define MCU_MEM_MAP_VERSION 0x0200U -/** Memory map minor version */ -#define MCU_MEM_MAP_VERSION_MINOR 0x0000U - - -/* ---------------------------------------------------------------------------- - -- Interrupt vector numbers - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup Interrupt_vector_numbers Interrupt vector numbers - * @{ - */ - -/** Interrupt Number Definitions */ -#define NUMBER_OF_INT_VECTORS 172 /**< Number of interrupts in the Vector table */ - -typedef enum IRQn { - /* Auxiliary constants */ - NotAvail_IRQn = -128, /**< Not available device specific interrupt */ - - /* Core interrupts */ - NonMaskableInt_IRQn = -14, /**< Non Maskable Interrupt */ - HardFault_IRQn = -13, /**< Cortex-M33 SV Hard Fault Interrupt */ - MemoryManagement_IRQn = -12, /**< Cortex-M33 Memory Management Interrupt */ - BusFault_IRQn = -11, /**< Cortex-M33 Bus Fault Interrupt */ - UsageFault_IRQn = -10, /**< Cortex-M33 Usage Fault Interrupt */ - SecureFault_IRQn = -9, /**< Cortex-M33 Secure Fault Interrupt */ - SVCall_IRQn = -5, /**< Cortex-M33 SV Call Interrupt */ - DebugMonitor_IRQn = -4, /**< Cortex-M33 Debug Monitor Interrupt */ - PendSV_IRQn = -2, /**< Cortex-M33 Pend SV Interrupt */ - SysTick_IRQn = -1, /**< Cortex-M33 System Tick Interrupt */ - - /* Device specific interrupts */ - OR_IRQn = 0, /**< OR IRQ */ - EDMA_0_CH0_IRQn = 1, /**< eDMA_0_CH0 error or transfer complete */ - EDMA_0_CH1_IRQn = 2, /**< eDMA_0_CH1 error or transfer complete */ - EDMA_0_CH2_IRQn = 3, /**< eDMA_0_CH2 error or transfer complete */ - EDMA_0_CH3_IRQn = 4, /**< eDMA_0_CH3 error or transfer complete */ - EDMA_0_CH4_IRQn = 5, /**< eDMA_0_CH4 error or transfer complete */ - EDMA_0_CH5_IRQn = 6, /**< eDMA_0_CH5 error or transfer complete */ - EDMA_0_CH6_IRQn = 7, /**< eDMA_0_CH6 error or transfer complete */ - EDMA_0_CH7_IRQn = 8, /**< eDMA_0_CH7 error or transfer complete */ - EDMA_0_CH8_IRQn = 9, /**< eDMA_0_CH8 error or transfer complete */ - EDMA_0_CH9_IRQn = 10, /**< eDMA_0_CH9 error or transfer complete */ - EDMA_0_CH10_IRQn = 11, /**< eDMA_0_CH10 error or transfer complete */ - EDMA_0_CH11_IRQn = 12, /**< eDMA_0_CH11 error or transfer complete */ - EDMA_0_CH12_IRQn = 13, /**< eDMA_0_CH12 error or transfer complete */ - EDMA_0_CH13_IRQn = 14, /**< eDMA_0_CH13 error or transfer complete */ - EDMA_0_CH14_IRQn = 15, /**< eDMA_0_CH14 error or transfer complete */ - EDMA_0_CH15_IRQn = 16, /**< eDMA_0_CH15 error or transfer complete */ - GPIO00_IRQn = 17, /**< GPIO0 interrupt 0 */ - GPIO01_IRQn = 18, /**< GPIO0 interrupt 1 */ - GPIO10_IRQn = 19, /**< GPIO1 interrupt 0 */ - GPIO11_IRQn = 20, /**< GPIO1 interrupt 1 */ - GPIO20_IRQn = 21, /**< GPIO2 interrupt 0 */ - GPIO21_IRQn = 22, /**< GPIO2 interrupt 1 */ - GPIO30_IRQn = 23, /**< GPIO3 interrupt 0 */ - GPIO31_IRQn = 24, /**< GPIO3 interrupt 1 */ - GPIO40_IRQn = 25, /**< GPIO4 interrupt 0 */ - GPIO41_IRQn = 26, /**< GPIO4 interrupt 1 */ - GPIO50_IRQn = 27, /**< GPIO5 interrupt 0 */ - GPIO51_IRQn = 28, /**< GPIO5 interrupt 1 */ - UTICK0_IRQn = 29, /**< Micro-Tick Timer interrupt */ - MRT0_IRQn = 30, /**< Multi-Rate Timer interrupt */ - CTIMER0_IRQn = 31, /**< Standard counter/timer 0 interrupt */ - CTIMER1_IRQn = 32, /**< Standard counter/timer 1 interrupt */ - SCT0_IRQn = 33, /**< SCTimer/PWM interrupt */ - CTIMER2_IRQn = 34, /**< Standard counter/timer 2 interrupt */ - LP_FLEXCOMM0_IRQn = 35, /**< LP_FLEXCOMM0 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) */ - LP_FLEXCOMM1_IRQn = 36, /**< LP_FLEXCOMM1 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) */ - LP_FLEXCOMM2_IRQn = 37, /**< LP_FLEXCOMM2 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) */ - LP_FLEXCOMM3_IRQn = 38, /**< LP_FLEXCOMM3 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) */ - LP_FLEXCOMM4_IRQn = 39, /**< LP_FLEXCOMM4 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) */ - LP_FLEXCOMM5_IRQn = 40, /**< LP_FLEXCOMM5 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) */ - LP_FLEXCOMM6_IRQn = 41, /**< LP_FLEXCOMM6 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) */ - LP_FLEXCOMM7_IRQn = 42, /**< LP_FLEXCOMM7 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) */ - LP_FLEXCOMM8_IRQn = 43, /**< LP_FLEXCOMM8 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) */ - LP_FLEXCOMM9_IRQn = 44, /**< LP_FLEXCOMM9 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) */ - ADC0_IRQn = 45, /**< Analog-to-Digital Converter 0 - General Purpose interrupt */ - ADC1_IRQn = 46, /**< Analog-to-Digital Converter 1 - General Purpose interrupt */ - PINT0_IRQn = 47, /**< Pin Interrupt Pattern Match Interrupt */ - PDM_EVENT_IRQn = 48, /**< Microphone Interface interrupt */ - Reserved65_IRQn = 49, /**< Reserved interrupt */ - USB0_FS_IRQn = 50, /**< Universal Serial Bus - Full Speed interrupt */ - USB0_DCD_IRQn = 51, /**< Universal Serial Bus - Device Charge Detect interrupt */ - RTC_IRQn = 52, /**< RTC Subsystem interrupt (RTC interrupt or Wake timer interrupt) */ - SMARTDMA_IRQn = 53, /**< SmartDMA_IRQ */ - MAILBOX_IRQn = 54, /**< Inter-CPU Mailbox interrupt0 for CPU0 Inter-CPU Mailbox interrupt1 for CPU1 */ - CTIMER3_IRQn = 55, /**< Standard counter/timer 3 interrupt */ - CTIMER4_IRQn = 56, /**< Standard counter/timer 4 interrupt */ - OS_EVENT_IRQn = 57, /**< OS event timer interrupt */ - FLEXSPI0_IRQn = 58, /**< Flexible Serial Peripheral Interface interrupt */ - SAI0_IRQn = 59, /**< Serial Audio Interface 0 interrupt */ - SAI1_IRQn = 60, /**< Serial Audio Interface 1 interrupt */ - USDHC0_IRQn = 61, /**< Ultra Secured Digital Host Controller interrupt */ - CAN0_IRQn = 62, /**< Controller Area Network 0 interrupt */ - CAN1_IRQn = 63, /**< Controller Area Network 1 interrupt */ - Reserved80_IRQn = 64, /**< Reserved interrupt */ - Reserved81_IRQn = 65, /**< Reserved interrupt */ - USB1_HS_PHY_IRQn = 66, /**< USBHS DCD or USBHS Phy interrupt */ - USB1_HS_IRQn = 67, /**< USB High Speed OTG Controller interrupt */ - SEC_HYPERVISOR_CALL_IRQn = 68, /**< AHB Secure Controller hypervisor call interrupt */ - Reserved85_IRQn = 69, /**< Reserved interrupt */ - PLU_IRQn = 70, /**< Programmable Logic Unit interrupt */ - Freqme_IRQn = 71, /**< Frequency Measurement interrupt */ - SEC_VIO_IRQn = 72, /**< Secure violation interrupt (Memory Block Checker interrupt or secure AHB matrix violation interrupt) */ - ELS_IRQn = 73, /**< ELS interrupt */ - PKC_IRQn = 74, /**< PKC interrupt */ - PUF_IRQn = 75, /**< Physical Unclonable Function interrupt */ - PQ_IRQn = 76, /**< Power Quad interrupt */ - EDMA_1_CH0_IRQn = 77, /**< eDMA_1_CH0 error or transfer complete */ - EDMA_1_CH1_IRQn = 78, /**< eDMA_1_CH1 error or transfer complete */ - EDMA_1_CH2_IRQn = 79, /**< eDMA_1_CH2 error or transfer complete */ - EDMA_1_CH3_IRQn = 80, /**< eDMA_1_CH3 error or transfer complete */ - EDMA_1_CH4_IRQn = 81, /**< eDMA_1_CH4 error or transfer complete */ - EDMA_1_CH5_IRQn = 82, /**< eDMA_1_CH5 error or transfer complete */ - EDMA_1_CH6_IRQn = 83, /**< eDMA_1_CH6 error or transfer complete */ - EDMA_1_CH7_IRQn = 84, /**< eDMA_1_CH7 error or transfer complete */ - EDMA_1_CH8_IRQn = 85, /**< eDMA_1_CH8 error or transfer complete */ - EDMA_1_CH9_IRQn = 86, /**< eDMA_1_CH9 error or transfer complete */ - EDMA_1_CH10_IRQn = 87, /**< eDMA_1_CH10 error or transfer complete */ - EDMA_1_CH11_IRQn = 88, /**< eDMA_1_CH11 error or transfer complete */ - EDMA_1_CH12_IRQn = 89, /**< eDMA_1_CH12 error or transfer complete */ - EDMA_1_CH13_IRQn = 90, /**< eDMA_1_CH13 error or transfer complete */ - EDMA_1_CH14_IRQn = 91, /**< eDMA_1_CH14 error or transfer complete */ - EDMA_1_CH15_IRQn = 92, /**< eDMA_1_CH15 error or transfer complete */ - CDOG0_IRQn = 93, /**< Code Watchdog Timer 0 interrupt */ - CDOG1_IRQn = 94, /**< Code Watchdog Timer 1 interrupt */ - I3C0_IRQn = 95, /**< Improved Inter Integrated Circuit interrupt 0 */ - I3C1_IRQn = 96, /**< Improved Inter Integrated Circuit interrupt 1 */ - NPU_IRQn = 97, /**< NPU interrupt */ - GDET_IRQn = 98, /**< Digital Glitch Detect 0 interrupt or Digital Glitch Detect 1 interrupt */ - VBAT0_IRQn = 99, /**< VBAT interrupt( VBAT interrupt or digital tamper interrupt) */ - EWM0_IRQn = 100, /**< External Watchdog Monitor interrupt */ - TSI_END_OF_SCAN_IRQn = 101, /**< TSI End of Scan interrupt */ - TSI_OUT_OF_SCAN_IRQn = 102, /**< TSI Out of Scan interrupt */ - EMVSIM0_IRQn = 103, /**< EMVSIM0 interrupt */ - EMVSIM1_IRQn = 104, /**< EMVSIM1 interrupt */ - FLEXIO_IRQn = 105, /**< Flexible Input/Output interrupt */ - DAC0_IRQn = 106, /**< Digital-to-Analog Converter 0 - General Purpose interrupt */ - DAC1_IRQn = 107, /**< Digital-to-Analog Converter 1 - General Purpose interrupt */ - DAC2_IRQn = 108, /**< 14-bit Digital-to-Analog Converter interrupt */ - HSCMP0_IRQn = 109, /**< High-Speed comparator0 interrupt */ - HSCMP1_IRQn = 110, /**< High-Speed comparator1 interrupt */ - HSCMP2_IRQn = 111, /**< High-Speed comparator2 interrupt */ - FLEXPWM0_RELOAD_ERROR_IRQn = 112, /**< FlexPWM0_reload_error interrupt */ - FLEXPWM0_FAULT_IRQn = 113, /**< FlexPWM0_fault interrupt */ - FLEXPWM0_SUBMODULE0_IRQn = 114, /**< FlexPWM0 Submodule 0 capture/compare/reload interrupt */ - FLEXPWM0_SUBMODULE1_IRQn = 115, /**< FlexPWM0 Submodule 1 capture/compare/reload interrupt */ - FLEXPWM0_SUBMODULE2_IRQn = 116, /**< FlexPWM0 Submodule 2 capture/compare/reload interrupt */ - FLEXPWM0_SUBMODULE3_IRQn = 117, /**< FlexPWM0 Submodule 3 capture/compare/reload interrupt */ - FLEXPWM1_RELOAD_ERROR_IRQn = 118, /**< FlexPWM1_reload_error interrupt */ - FLEXPWM1_FAULT_IRQn = 119, /**< FlexPWM1_fault interrupt */ - FLEXPWM1_SUBMODULE0_IRQn = 120, /**< FlexPWM1 Submodule 0 capture/compare/reload interrupt */ - FLEXPWM1_SUBMODULE1_IRQn = 121, /**< FlexPWM1 Submodule 1 capture/compare/reload interrupt */ - FLEXPWM1_SUBMODULE2_IRQn = 122, /**< FlexPWM1 Submodule 2 capture/compare/reload interrupt */ - FLEXPWM1_SUBMODULE3_IRQn = 123, /**< FlexPWM1 Submodule 3 capture/compare/reload interrupt */ - QDC0_COMPARE_IRQn = 124, /**< QDC0_Compare interrupt */ - QDC0_HOME_IRQn = 125, /**< QDC0_Home interrupt */ - QDC0_WDG_SAB_IRQn = 126, /**< QDC0_WDG_IRQ/SAB interrupt */ - QDC0_IDX_IRQn = 127, /**< QDC0_IDX interrupt */ - QDC1_COMPARE_IRQn = 128, /**< QDC1_Compare interrupt */ - QDC1_HOME_IRQn = 129, /**< QDC1_Home interrupt */ - QDC1_WDG_SAB_IRQn = 130, /**< QDC1_WDG_IRQ/SAB interrupt */ - QDC1_IDX_IRQn = 131, /**< QDC1_IDX interrupt */ - ITRC0_IRQn = 132, /**< Intrusion and Tamper Response Controller interrupt */ - BSP32_IRQn = 133, /**< CoolFlux BSP32 interrupt */ - ELS_ERR_IRQn = 134, /**< ELS error interrupt */ - PKC_ERR_IRQn = 135, /**< PKC error interrupt */ - ERM_SINGLE_BIT_ERROR_IRQn = 136, /**< ERM Single Bit error interrupt */ - ERM_MULTI_BIT_ERROR_IRQn = 137, /**< ERM Multi Bit error interrupt */ - FMU0_IRQn = 138, /**< Flash Management Unit interrupt */ - ETHERNET_IRQn = 139, /**< Ethernet QoS interrupt */ - ETHERNET_PMT_IRQn = 140, /**< Ethernet QoS power management interrupt */ - ETHERNET_MACLP_IRQn = 141, /**< Ethernet QoS MAC interrupt */ - SINC_FILTER_IRQn = 142, /**< SINC Filter interrupt */ - LPTMR0_IRQn = 143, /**< Low Power Timer 0 interrupt */ - LPTMR1_IRQn = 144, /**< Low Power Timer 1 interrupt */ - SCG_IRQn = 145, /**< System Clock Generator interrupt */ - SPC_IRQn = 146, /**< System Power Controller interrupt */ - WUU_IRQn = 147, /**< Wake Up Unit interrupt */ - PORT_EFT_IRQn = 148, /**< PORT0~5 EFT interrupt */ - ETB0_IRQn = 149, /**< ETB counter expires interrupt */ - Reserved166_IRQn = 150, /**< Reserved interrupt */ - Reserved167_IRQn = 151, /**< Reserved interrupt */ - WWDT0_IRQn = 152, /**< Windowed Watchdog Timer 0 interrupt */ - WWDT1_IRQn = 153, /**< Windowed Watchdog Timer 1 interrupt */ - CMC0_IRQn = 154, /**< Core Mode Controller interrupt */ - CTI0_IRQn = 155 /**< Cross Trigger Interface interrupt */ -} IRQn_Type; - -/*! - * @} - */ /* end of group Interrupt_vector_numbers */ - - -/* ---------------------------------------------------------------------------- - -- Cortex M33 Core Configuration - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup Cortex_Core_Configuration Cortex M33 Core Configuration - * @{ - */ - -#define __MPU_PRESENT 0 /**< Defines if an MPU is present or not */ -#define __NVIC_PRIO_BITS 3 /**< Number of priority bits implemented in the NVIC */ -#define __Vendor_SysTickConfig 0 /**< Vendor specific implementation of SysTickConfig is defined */ -#define __FPU_PRESENT 0 /**< Defines if an FPU is present or not */ -#define __DSP_PRESENT 0 /**< Defines if Armv8-M Mainline core supports DSP instructions */ -#define __SAUREGION_PRESENT 0 /**< Defines if an SAU is present or not */ - -#include "core_cm33.h" /* Core Peripheral Access Layer */ -#include "system_MCXN947_cm33_core1.h" /* Device specific configuration file */ - -/*! - * @} - */ /* end of group Cortex_Core_Configuration */ - - -/* ---------------------------------------------------------------------------- - -- Mapping Information - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup Mapping_Information Mapping Information - * @{ - */ - -/** Mapping Information */ -/*! - * @addtogroup dma_request - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @brief Structure for the DMA hardware request - * - * Defines the structure for the DMA hardware request collections. The user can configure the - * hardware request to trigger the DMA transfer accordingly. The index - * of the hardware request varies according to the to SoC. - */ -typedef enum _dma_request_source -{ - kDma0RequestMuxFlexSpi0Rx = 1U, /**< FlexSPI0 Receive event */ - kDma1RequestMuxFlexSpi0Rx = 1U, /**< FlexSPI0 Receive event */ - kDma0RequestMuxFlexSpi0Tx = 2U, /**< FlexSPI0 Transmit event */ - kDma1RequestMuxFlexSpi0Tx = 2U, /**< FlexSPI0 Transmit event */ - kDma0RequestMuxPinInt0 = 3U, /**< PINT0 INT0 */ - kDma1RequestMuxPinInt0 = 3U, /**< PINT0 INT0 */ - kDma0RequestMuxPinInt1 = 4U, /**< PINT0 INT1 */ - kDma1RequestMuxPinInt1 = 4U, /**< PINT0 INT1 */ - kDma0RequestMuxPinInt2 = 5U, /**< PINT0 INT2 */ - kDma1RequestMuxPinInt2 = 5U, /**< PINT0 INT2 */ - kDma0RequestMuxPinInt3 = 6U, /**< PINT0 INT3 */ - kDma1RequestMuxPinInt3 = 6U, /**< PINT0 INT3 */ - kDma0RequestMuxCtimer0M0 = 7U, /**< CTIMER0 Match channel 0 request */ - kDma1RequestMuxCtimer0M0 = 7U, /**< CTIMER0 Match channel 0 request */ - kDma0RequestMuxCtimer0M1 = 8U, /**< CTIMER0 Match channel 1 request */ - kDma1RequestMuxCtimer0M1 = 8U, /**< CTIMER0 Match channel 1 request */ - kDma0RequestMuxCtimer1M0 = 9U, /**< CTIMER1 Match channel 0 request */ - kDma1RequestMuxCtimer1M0 = 9U, /**< CTIMER1 Match channel 0 request */ - kDma0RequestMuxCtimer1M1 = 10U, /**< CTIMER1 Match channel 1 request */ - kDma1RequestMuxCtimer1M1 = 10U, /**< CTIMER1 Match channel 1 request */ - kDma0RequestMuxCtimer2M0 = 11U, /**< CTIMER2 Match channel 0 request */ - kDma1RequestMuxCtimer2M0 = 11U, /**< CTIMER2 Match channel 0 request */ - kDma0RequestMuxCtimer2M1 = 12U, /**< CTIMER2 Match channel 1 request */ - kDma1RequestMuxCtimer2M1 = 12U, /**< CTIMER2 Match channel 1 request */ - kDma0RequestMuxCtimer3M0 = 13U, /**< CTIMER3 Match channel 0 request */ - kDma1RequestMuxCtimer3M0 = 13U, /**< CTIMER3 Match channel 0 request */ - kDma0RequestMuxCtimer3M1 = 14U, /**< CTIMER3 Match channel 1 request */ - kDma1RequestMuxCtimer3M1 = 14U, /**< CTIMER3 Match channel 1 request */ - kDma0RequestMuxCtimer4M0 = 15U, /**< CTIMER4 Match channel 0 request */ - kDma1RequestMuxCtimer4M0 = 15U, /**< CTIMER4 Match channel 0 request */ - kDma0RequestMuxCtimer4M1 = 16U, /**< CTIMER4 Match channel 1 request */ - kDma1RequestMuxCtimer4M1 = 16U, /**< CTIMER4 Match channel 1 request */ - kDma0RequestMuxWuu0 = 17U, /**< WUU0 Wake up event */ - kDma1RequestMuxWuu0 = 17U, /**< WUU0 Wake up event */ - kDma0RequestMuxMicfil0FifoRequest = 18U, /**< MICFIL0 FIFO_request */ - kDma1RequestMuxMicfil0FifoRequest = 18U, /**< MICFIL0 FIFO_request */ - kDma0RequestMuxSct0Dma0 = 19U, /**< SCT0 DMA0 */ - kDma1RequestMuxSct0Dma0 = 19U, /**< SCT0 DMA0 */ - kDma0RequestMuxSct0Dma1 = 20U, /**< SCT0 DMA1 */ - kDma1RequestMuxSct0Dma1 = 20U, /**< SCT0 DMA1 */ - kDma0RequestMuxAdc0FifoARequest = 21U, /**< ADC0 FIFO A request */ - kDma1RequestMuxAdc0FifoARequest = 21U, /**< ADC0 FIFO A request */ - kDma0RequestMuxAdc0FifoBRequest = 22U, /**< ADC0 FIFO B request */ - kDma1RequestMuxAdc0FifoBRequest = 22U, /**< ADC0 FIFO B request */ - kDma0RequestMuxAdc1FifoARequest = 23U, /**< ADC1 FIFO A request */ - kDma1RequestMuxAdc1FifoARequest = 23U, /**< ADC1 FIFO A request */ - kDma0RequestMuxAdc1FifoBRequest = 24U, /**< ADC1 FIFO B request */ - kDma1RequestMuxAdc1FifoBRequest = 24U, /**< ADC1 FIFO B request */ - kDma0RequestMuxDac0FifoRequest = 25U, /**< DAC0 FIFO_request */ - kDma1RequestMuxDac0FifoRequest = 25U, /**< DAC0 FIFO_request */ - kDma0RequestMuxDac1FifoRequest = 26U, /**< DAC1 FIFO_request */ - kDma1RequestMuxDac1FifoRequest = 26U, /**< DAC1 FIFO_request */ - kDma0RequestMuxDac2FifoRequest = 27U, /**< DAC2 FIFO_request */ - kDma1RequestMuxDac2FifoRequest = 27U, /**< DAC2 FIFO_request */ - kDma0RequestMuxHsCmp0DmaRequest = 28U, /**< CMP0 DMA_request */ - kDma1RequestMuxHsCmp0DmaRequest = 28U, /**< CMP0 DMA_request */ - kDma0RequestMuxHsCmp1DmaRequest = 29U, /**< CMP1 DMA_request */ - kDma1RequestMuxHsCmp1DmaRequest = 29U, /**< CMP1 DMA_request */ - kDma0RequestMuxHsCmp2DmaRequest = 30U, /**< CMP2 DMA_request */ - kDma1RequestMuxHsCmp2DmaRequest = 30U, /**< CMP2 DMA_request */ - kDma0RequestMuxEvtg0Out0A = 31U, /**< EVTG0 OUT0A */ - kDma1RequestMuxEvtg0Out0A = 31U, /**< EVTG0 OUT0A */ - kDma0RequestMuxEvtg0Out0B = 32U, /**< EVTG0 OUT0B */ - kDma1RequestMuxEvtg0Out0B = 32U, /**< EVTG0 OUT0B */ - kDma0RequestMuxEvtg0Out1A = 33U, /**< EVTG0 OUT1A */ - kDma1RequestMuxEvtg0Out1A = 33U, /**< EVTG0 OUT1A */ - kDma0RequestMuxEvtg0Out1B = 34U, /**< EVTG0 OUT1B */ - kDma1RequestMuxEvtg0Out1B = 34U, /**< EVTG0 OUT1B */ - kDma0RequestMuxEvtg0Out2A = 35U, /**< EVTG0 OUT2A */ - kDma1RequestMuxEvtg0Out2A = 35U, /**< EVTG0 OUT2A */ - kDma0RequestMuxEvtg0Out2B = 36U, /**< EVTG0 OUT2B */ - kDma1RequestMuxEvtg0Out2B = 36U, /**< EVTG0 OUT2B */ - kDma0RequestMuxEvtg0Out3A = 37U, /**< EVTG0 OUT3A */ - kDma1RequestMuxEvtg0Out3A = 37U, /**< EVTG0 OUT3A */ - kDma0RequestMuxEvtg0Out3B = 38U, /**< EVTG0 OUT3B */ - kDma1RequestMuxEvtg0Out3B = 38U, /**< EVTG0 OUT3B */ - kDma0RequestMuxFlexPwm0ReqCapt0 = 39U, /**< PWM0 capture0 request */ - kDma1RequestMuxFlexPwm0ReqCapt0 = 39U, /**< PWM0 capture0 request */ - kDma0RequestMuxFlexPwm0ReqCapt1 = 40U, /**< PWM0 capture1 request */ - kDma1RequestMuxFlexPwm0ReqCapt1 = 40U, /**< PWM0 capture1 request */ - kDma0RequestMuxFlexPwm0ReqCapt2 = 41U, /**< PWM0 capture2 request */ - kDma1RequestMuxFlexPwm0ReqCapt2 = 41U, /**< PWM0 capture2 request */ - kDma0RequestMuxFlexPwm0ReqCapt3 = 42U, /**< PWM0 capture3 request */ - kDma1RequestMuxFlexPwm0ReqCapt3 = 42U, /**< PWM0 capture3 request */ - kDma0RequestMuxFlexPwm0ReqVal0 = 43U, /**< PWM0 value0 request */ - kDma1RequestMuxFlexPwm0ReqVal0 = 43U, /**< PWM0 value0 request */ - kDma0RequestMuxFlexPwm0ReqVal1 = 44U, /**< PWM0 value1 request */ - kDma1RequestMuxFlexPwm0ReqVal1 = 44U, /**< PWM0 value1 request */ - kDma0RequestMuxFlexPwm0ReqVal2 = 45U, /**< PWM0 value2 request */ - kDma1RequestMuxFlexPwm0ReqVal2 = 45U, /**< PWM0 value2 request */ - kDma0RequestMuxFlexPwm0ReqVal3 = 46U, /**< PWM0 value3 request */ - kDma1RequestMuxFlexPwm0ReqVal3 = 46U, /**< PWM0 value3 request */ - kDma0RequestMuxFlexPwm1ReqCapt0 = 47U, /**< PWM1 capture0 request */ - kDma1RequestMuxFlexPwm1ReqCapt0 = 47U, /**< PWM1 capture0 request */ - kDma0RequestMuxFlexPwm1ReqCapt1 = 48U, /**< PWM1 capture1 request */ - kDma1RequestMuxFlexPwm1ReqCapt1 = 48U, /**< PWM1 capture1 request */ - kDma0RequestMuxFlexPwm1ReqCapt2 = 49U, /**< PWM1 capture2 request */ - kDma1RequestMuxFlexPwm1ReqCapt2 = 49U, /**< PWM1 capture2 request */ - kDma0RequestMuxFlexPwm1ReqCapt3 = 50U, /**< PWM1 capture3 request */ - kDma1RequestMuxFlexPwm1ReqCapt3 = 50U, /**< PWM1 capture3 request */ - kDma0RequestMuxFlexPwm1ReqVal0 = 51U, /**< PWM1 value0 request */ - kDma1RequestMuxFlexPwm1ReqVal0 = 51U, /**< PWM1 value0 request */ - kDma0RequestMuxFlexPwm1ReqVal1 = 52U, /**< PWM1 value1 request */ - kDma1RequestMuxFlexPwm1ReqVal1 = 52U, /**< PWM1 value1 request */ - kDma0RequestMuxFlexPwm1ReqVal2 = 53U, /**< PWM1 value2 request */ - kDma1RequestMuxFlexPwm1ReqVal2 = 53U, /**< PWM1 value2 request */ - kDma0RequestMuxFlexPwm1ReqVal3 = 54U, /**< PWM0 value3 request */ - kDma1RequestMuxFlexPwm1ReqVal3 = 54U, /**< PWM0 value3 request */ - kDma0RequestMuxLptmr0 = 57U, /**< LPTMR0 Counter match event */ - kDma1RequestMuxLptmr0 = 57U, /**< LPTMR0 Counter match event */ - kDma0RequestMuxLptmr1 = 58U, /**< LPTMR1 Counter match event */ - kDma1RequestMuxLptmr1 = 58U, /**< LPTMR1 Counter match event */ - kDma0RequestMuxFlexCan0DmaRequest = 59U, /**< CAN0 DMA request */ - kDma1RequestMuxFlexCan0DmaRequest = 59U, /**< CAN0 DMA request */ - kDma0RequestMuxFlexCan1DmaRequest = 60U, /**< CAN1 DMA request */ - kDma1RequestMuxFlexCan1DmaRequest = 60U, /**< CAN1 DMA request */ - kDma0RequestMuxFlexIO0ShiftRegister0Request = 61U, /**< FlexIO0 Shifter0 Status DMA request OR Timer0 Status DMA request */ - kDma1RequestMuxFlexIO0ShiftRegister0Request = 61U, /**< FlexIO0 Shifter0 Status DMA request OR Timer0 Status DMA request */ - kDma0RequestMuxFlexIO0ShiftRegister1Request = 62U, /**< FlexIO0 Shifter1 Status DMA request OR Timer1 Status DMA request */ - kDma1RequestMuxFlexIO0ShiftRegister1Request = 62U, /**< FlexIO0 Shifter1 Status DMA request OR Timer1 Status DMA request */ - kDma0RequestMuxFlexIO0ShiftRegister2Request = 63U, /**< FlexIO0 Shifter2 Status DMA request OR Timer2 Status DMA request */ - kDma1RequestMuxFlexIO0ShiftRegister2Request = 63U, /**< FlexIO0 Shifter2 Status DMA request OR Timer2 Status DMA request */ - kDma0RequestMuxFlexIO0ShiftRegister3Request = 64U, /**< FlexIO0 Shifter3 Status DMA request OR Timer3 Status DMA request */ - kDma1RequestMuxFlexIO0ShiftRegister3Request = 64U, /**< FlexIO0 Shifter3 Status DMA request OR Timer3 Status DMA request */ - kDma0RequestMuxFlexIO0ShiftRegister4Request = 65U, /**< FlexIO0 Shifter4 Status DMA request OR Timer4 Status DMA request */ - kDma1RequestMuxFlexIO0ShiftRegister4Request = 65U, /**< FlexIO0 Shifter4 Status DMA request OR Timer4 Status DMA request */ - kDma0RequestMuxFlexIO0ShiftRegister5Request = 66U, /**< FlexIO0 Shifter5 Status DMA request OR Timer5 Status DMA request */ - kDma1RequestMuxFlexIO0ShiftRegister5Request = 66U, /**< FlexIO0 Shifter5 Status DMA request OR Timer5 Status DMA request */ - kDma0RequestMuxFlexIO0ShiftRegister6Request = 67U, /**< FlexIO0 Shifter6 Status DMA request OR Timer6 Status DMA request */ - kDma1RequestMuxFlexIO0ShiftRegister6Request = 67U, /**< FlexIO0 Shifter6 Status DMA request OR Timer6 Status DMA request */ - kDma0RequestMuxFlexIO0ShiftRegister7Request = 68U, /**< FlexIO0 Shifter7 Status DMA request OR Timer7 Status DMA request */ - kDma1RequestMuxFlexIO0ShiftRegister7Request = 68U, /**< FlexIO0 Shifter7 Status DMA request OR Timer7 Status DMA request */ - kDma0RequestMuxLpFlexcomm0Rx = 69U, /**< LP_FLEXCOMM0 Receive request */ - kDma1RequestMuxLpFlexcomm0Rx = 69U, /**< LP_FLEXCOMM0 Receive request */ - kDma0RequestMuxLpFlexcomm0Tx = 70U, /**< LP_FLEXCOMM0 Transmit request */ - kDma1RequestMuxLpFlexcomm0Tx = 70U, /**< LP_FLEXCOMM0 Transmit request */ - kDma0RequestMuxLpFlexcomm1Rx = 71U, /**< LP_FLEXCOMM1 Receive request */ - kDma1RequestMuxLpFlexcomm1Rx = 71U, /**< LP_FLEXCOMM1 Receive request */ - kDma0RequestMuxLpFlexcomm1Tx = 72U, /**< LP_FLEXCOMM1 Transmit request */ - kDma1RequestMuxLpFlexcomm1Tx = 72U, /**< LP_FLEXCOMM1 Transmit request */ - kDma0RequestMuxLpFlexcomm2Rx = 73U, /**< LP_FLEXCOMM2 Receive request */ - kDma1RequestMuxLpFlexcomm2Rx = 73U, /**< LP_FLEXCOMM2 Receive request */ - kDma0RequestMuxLpFlexcomm2Tx = 74U, /**< LP_FLEXCOMM2 Transmit request */ - kDma1RequestMuxLpFlexcomm2Tx = 74U, /**< LP_FLEXCOMM2 Transmit request */ - kDma0RequestMuxLpFlexcomm3Rx = 75U, /**< LP_FLEXCOMM3 Receive request */ - kDma1RequestMuxLpFlexcomm3Rx = 75U, /**< LP_FLEXCOMM3 Receive request */ - kDma0RequestMuxLpFlexcomm3Tx = 76U, /**< LP_FLEXCOMM3 Transmit request */ - kDma1RequestMuxLpFlexcomm3Tx = 76U, /**< LP_FLEXCOMM3 Transmit request */ - kDma0RequestMuxLpFlexcomm4Rx = 77U, /**< LP_FLEXCOMM4 Receive request */ - kDma1RequestMuxLpFlexcomm4Rx = 77U, /**< LP_FLEXCOMM4 Receive request */ - kDma0RequestMuxLpFlexcomm4Tx = 78U, /**< LP_FLEXCOMM4 Transmit request */ - kDma1RequestMuxLpFlexcomm4Tx = 78U, /**< LP_FLEXCOMM4 Transmit request */ - kDma0RequestMuxLpFlexcomm5Rx = 79U, /**< LP_FLEXCOMM5 Receive request */ - kDma1RequestMuxLpFlexcomm5Rx = 79U, /**< LP_FLEXCOMM5 Receive request */ - kDma0RequestMuxLpFlexcomm5Tx = 80U, /**< LP_FLEXCOMM5 Transmit request */ - kDma1RequestMuxLpFlexcomm5Tx = 80U, /**< LP_FLEXCOMM5 Transmit request */ - kDma0RequestMuxLpFlexcomm6Rx = 81U, /**< LP_FLEXCOMM6 Receive request */ - kDma1RequestMuxLpFlexcomm6Rx = 81U, /**< LP_FLEXCOMM6 Receive request */ - kDma0RequestMuxLpFlexcomm6Tx = 82U, /**< LP_FLEXCOMM6 Transmit request */ - kDma1RequestMuxLpFlexcomm6Tx = 82U, /**< LP_FLEXCOMM6 Transmit request */ - kDma0RequestMuxLpFlexcomm7Rx = 83U, /**< LP_FLEXCOMM7 Receive request */ - kDma1RequestMuxLpFlexcomm7Rx = 83U, /**< LP_FLEXCOMM7 Receive request */ - kDma0RequestMuxLpFlexcomm7Tx = 84U, /**< LP_FLEXCOMM7 Transmit request */ - kDma1RequestMuxLpFlexcomm7Tx = 84U, /**< LP_FLEXCOMM7 Transmit request */ - kDma0RequestMuxLpFlexcomm8Rx = 85U, /**< LP_FLEXCOMM8 Receive request */ - kDma1RequestMuxLpFlexcomm8Rx = 85U, /**< LP_FLEXCOMM8 Receive request */ - kDma0RequestMuxLpFlexcomm8Tx = 86U, /**< LP_FLEXCOMM8 Transmit request */ - kDma1RequestMuxLpFlexcomm8Tx = 86U, /**< LP_FLEXCOMM8 Transmit request */ - kDma0RequestMuxLpFlexcomm9Rx = 87U, /**< LP_FLEXCOMM9 Receive request */ - kDma1RequestMuxLpFlexcomm9Rx = 87U, /**< LP_FLEXCOMM9 Receive request */ - kDma0RequestMuxLpFlexcomm9Tx = 88U, /**< LP_FLEXCOMM9 Transmit request */ - kDma1RequestMuxLpFlexcomm9Tx = 88U, /**< LP_FLEXCOMM9 Transmit request */ - kDma0RequestMuxEmvSim0Rx = 91U, /**< EMVSIM0 Receive request */ - kDma1RequestMuxEmvSim0Rx = 91U, /**< EMVSIM0 Receive request */ - kDma0RequestMuxEmvSim0Tx = 92U, /**< EMVSIM0 Transmit request */ - kDma1RequestMuxEmvSim0Tx = 92U, /**< EMVSIM0 Transmit request */ - kDma0RequestMuxEmvSim1Rx = 93U, /**< EMVSIM1 Receive request */ - kDma1RequestMuxEmvSim1Rx = 93U, /**< EMVSIM1 Receive request */ - kDma0RequestMuxEmvSim1Tx = 94U, /**< EMVSIM1 Transmit request */ - kDma1RequestMuxEmvSim1Tx = 94U, /**< EMVSIM1 Transmit request */ - kDma0RequestMuxI3c0Rx = 95U, /**< I3C0 Receive request */ - kDma1RequestMuxI3c0Rx = 95U, /**< I3C0 Receive request */ - kDma0RequestMuxI3c0Tx = 96U, /**< I3C0 Transmit request */ - kDma1RequestMuxI3c0Tx = 96U, /**< I3C0 Transmit request */ - kDma0RequestMuxI3c1Rx = 97U, /**< I3C1 Receive request */ - kDma1RequestMuxI3c1Rx = 97U, /**< I3C1 Receive request */ - kDma0RequestMuxI3c1Tx = 98U, /**< I3C1 Transmit request */ - kDma1RequestMuxI3c1Tx = 98U, /**< I3C1 Transmit request */ - kDma0RequestMuxSai0Rx = 99U, /**< SAI0 Receive request */ - kDma1RequestMuxSai0Rx = 99U, /**< SAI0 Receive request */ - kDma0RequestMuxSai0Tx = 100U, /**< SAI0 Transmit request */ - kDma1RequestMuxSai0Tx = 100U, /**< SAI0 Transmit request */ - kDma0RequestMuxSai1Rx = 101U, /**< SAI1 Receive request */ - kDma1RequestMuxSai1Rx = 101U, /**< SAI1 Receive request */ - kDma0RequestMuxSai1Tx = 102U, /**< SAI1 Transmit request */ - kDma1RequestMuxSai1Tx = 102U, /**< SAI1 Transmit request */ - kDma0RequestMuxSinc0IpdReqSincAlt0 = 103U, /**< SINC0 ipd_req_sinc[0] or ipd_req_alt [0] */ - kDma1RequestMuxSinc0IpdReqSincAlt0 = 103U, /**< SINC0 ipd_req_sinc[0] or ipd_req_alt [0] */ - kDma0RequestMuxSinc1IpdReqSincAlt1 = 104U, /**< SINC0 ipd_req_sinc[1] or ipd_req_alt [1] */ - kDma1RequestMuxSinc1IpdReqSincAlt1 = 104U, /**< SINC0 ipd_req_sinc[1] or ipd_req_alt [1] */ - kDma0RequestMuxSinc2IpdReqSincAlt2 = 105U, /**< SINC0 ipd_req_sinc[2] or ipd_req_alt [2] */ - kDma1RequestMuxSinc2IpdReqSincAlt2 = 105U, /**< SINC0 ipd_req_sinc[2] or ipd_req_alt [2] */ - kDma0RequestMuxSinc3IpdReqSincAlt3 = 106U, /**< SINC0 ipd_req_sinc[3] or ipd_req_alt [3] */ - kDma1RequestMuxSinc3IpdReqSincAlt3 = 106U, /**< SINC0 ipd_req_sinc[3] or ipd_req_alt [3] */ - kDma0RequestMuxSinc4IpdReqSincAlt4 = 107U, /**< SINC0 ipd_req_sinc[4] or ipd_req_alt [4] */ - kDma1RequestMuxSinc4IpdReqSincAlt4 = 107U, /**< SINC0 ipd_req_sinc[4] or ipd_req_alt [4] */ - kDma0RequestMuxGpio0PinEventRequest0 = 108U, /**< GPIO0 Pin event request 0 */ - kDma1RequestMuxGpio0PinEventRequest0 = 108U, /**< GPIO0 Pin event request 0 */ - kDma0RequestMuxGpio0PinEventRequest1 = 109U, /**< GPIO0 Pin event request 1 */ - kDma1RequestMuxGpio0PinEventRequest1 = 109U, /**< GPIO0 Pin event request 1 */ - kDma0RequestMuxGpio1PinEventRequest0 = 110U, /**< GPIO1 Pin event request 0 */ - kDma1RequestMuxGpio1PinEventRequest0 = 110U, /**< GPIO1 Pin event request 0 */ - kDma0RequestMuxGpio1PinEventRequest1 = 111U, /**< GPIO1 Pin event request 1 */ - kDma1RequestMuxGpio1PinEventRequest1 = 111U, /**< GPIO1 Pin event request 1 */ - kDma0RequestMuxGpio2PinEventRequest0 = 112U, /**< GPIO2 Pin event request 0 */ - kDma1RequestMuxGpio2PinEventRequest0 = 112U, /**< GPIO2 Pin event request 0 */ - kDma0RequestMuxGpio2PinEventRequest1 = 113U, /**< GPIO2 Pin event request 1 */ - kDma1RequestMuxGpio2PinEventRequest1 = 113U, /**< GPIO2 Pin event request 1 */ - kDma0RequestMuxGpio3PinEventRequest0 = 114U, /**< GPIO3 Pin event request 0 */ - kDma1RequestMuxGpio3PinEventRequest0 = 114U, /**< GPIO3 Pin event request 0 */ - kDma0RequestMuxGpio3PinEventRequest1 = 115U, /**< GPIO3 Pin event request 1 */ - kDma1RequestMuxGpio3PinEventRequest1 = 115U, /**< GPIO3 Pin event request 1 */ - kDma0RequestMuxGpio4PinEventRequest0 = 116U, /**< GPIO4 Pin event request 0 */ - kDma1RequestMuxGpio4PinEventRequest0 = 116U, /**< GPIO4 Pin event request 0 */ - kDma0RequestMuxGpio4PinEventRequest1 = 117U, /**< GPIO4 Pin event request 1 */ - kDma1RequestMuxGpio4PinEventRequest1 = 117U, /**< GPIO4 Pin event request 1 */ - kDma0RequestMuxGpio5PinEventRequest0 = 118U, /**< GPIO5 Pin event request 0 */ - kDma1RequestMuxGpio5PinEventRequest0 = 118U, /**< GPIO5 Pin event request 0 */ - kDma0RequestMuxGpio5PinEventRequest1 = 119U, /**< GPIO5 Pin event request 1 */ - kDma1RequestMuxGpio5PinEventRequest1 = 119U, /**< GPIO5 Pin event request 1 */ - kDma0RequestMuxTsi0EndOfScan = 120U, /**< TSI0 End of Scan */ - kDma1RequestMuxTsi0EndOfScan = 120U, /**< TSI0 End of Scan */ - kDma0RequestMuxTsi0OutOfRange = 121U, /**< TSI0 Out of Range */ - kDma1RequestMuxTsi0OutOfRange = 121U, /**< TSI0 Out of Range */ -} dma_request_source_t; - -/* @} */ - -/*! - * @addtogroup eim_memory_channel - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @brief Structure for the eim_memory_channel - * - * Defines the structure for the EIM resource collections. - */ - -typedef enum _eim_memory_channel -{ - kEIM_MemoryChannelRAMX = 0U, /**< Memory RAMX */ - kEIM_MemoryChannelRAMA = 1U, /**< Memory RAMA */ - kEIM_MemoryChannelRAMB = 2U, /**< Memory RAMB */ - kEIM_MemoryChannelRAMC = 3U, /**< Memory RAMC */ - kEIM_MemoryChannelRAMD = 4U, /**< Memory RAMD */ - kEIM_MemoryChannelRAME = 5U, /**< Memory RAME */ - kEIM_MemoryChannelRAMF = 6U, /**< Memory RAMF */ - kEIM_MemoryChannelLPCACRAM = 7U, /**< Memory LPCACRAM */ - kEIM_MemoryChannelPKCRAM = 8U, /**< Memory PKCRAM */ -} eim_memory_channel_t; - -/* @} */ - -/*! - * @addtogroup eim_error_injection_channel_enable - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @brief Structure for the eim_error_injection_channel_enable - * - * Defines the structure for the EIM error injection resource collections. - */ - -typedef enum _eim_error_injection_channel_enable -{ - kEIM_MemoryChannelRAMXEnable = 0x80000000U, /**< Memory channel 0(RAMX) error injection enable */ - kEIM_MemoryChannelRAMAEnable = 0x40000000U, /**< Memory channel 1(RAMA) error injection enable */ - kEIM_MemoryChannelRAMBEnable = 0x20000000U, /**< Memory channel 2(RAMB) error injection enable */ - kEIM_MemoryChannelRAMCEnable = 0x10000000U, /**< Memory channel 3(RAMC) error injection enable */ - kEIM_MemoryChannelRAMDEnable = 0x8000000U, /**< Memory channel 4(RAMD) error injection enable */ - kEIM_MemoryChannelRAMEEnable = 0x4000000U, /**< Memory channel 5(RAME) error injection enable */ - kEIM_MemoryChannelRAMFEnable = 0x2000000U, /**< Memory channel 6(RAMF) error injection enable */ - kEIM_MemoryChannelLPCACRAMEnable = 0x1000000U, /**< Memory channel 7(LPCACRAM) error injection enable */ - kEIM_MemoryChannelPKCRAMEnable = 0x800000U, /**< Memory channel 8(PKCRAM) error injection enable */ -} eim_error_injection_channel_enable_t; - -/* @} */ - -/*! - * @addtogroup erm_memory_channel - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @brief Structure for the erm_memory_channel - * - * Defines the structure for the ERM resource collections. - */ - -typedef enum _erm_memory_channel -{ - kERM_MemoryChannelRAMX = 0U, /**< Memory RAMX */ - kERM_MemoryChannelRAMA = 1U, /**< Memory RAMA */ - kERM_MemoryChannelRAMB = 2U, /**< Memory RAMB */ - kERM_MemoryChannelRAMC = 3U, /**< Memory RAMC */ - kERM_MemoryChannelRAMD = 4U, /**< Memory RAMD */ - kERM_MemoryChannelRAME = 5U, /**< Memory RAME */ - kERM_MemoryChannelRAMF = 6U, /**< Memory RAMF */ - kERM_MemoryChannelLPCACRAM = 7U, /**< Memory LPCACRAM */ - kERM_MemoryChannelPKCRAM = 8U, /**< Memory PKCRAM */ - kERM_MemoryChannelFLASH = 9U, /**< Memory FLASH */ -} erm_memory_channel_t; - -/* @} */ - - -/*! - * @} - */ /* end of group Mapping_Information */ - - -/* ---------------------------------------------------------------------------- - -- Device Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup Peripheral_access_layer Device Peripheral Access Layer - * @{ - */ - - -/* -** Start of section using anonymous unions -*/ - -#if defined(__ARMCC_VERSION) - #if (__ARMCC_VERSION >= 6010050) - #pragma clang diagnostic push - #else - #pragma push - #pragma anon_unions - #endif -#elif defined(__GNUC__) - /* anonymous unions are enabled by default */ -#elif defined(__IAR_SYSTEMS_ICC__) - #pragma language=extended -#else - #error Not supported compiler type -#endif - -/* ---------------------------------------------------------------------------- - -- ADC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ADC_Peripheral_Access_Layer ADC Peripheral Access Layer - * @{ - */ - -/** ADC - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID Register, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter Register, offset: 0x4 */ - uint8_t RESERVED_0[8]; - __IO uint32_t CTRL; /**< Control Register, offset: 0x10 */ - __IO uint32_t STAT; /**< Status Register, offset: 0x14 */ - __IO uint32_t IE; /**< Interrupt Enable Register, offset: 0x18 */ - __IO uint32_t DE; /**< DMA Enable Register, offset: 0x1C */ - __IO uint32_t CFG; /**< Configuration Register, offset: 0x20 */ - __IO uint32_t PAUSE; /**< Pause Register, offset: 0x24 */ - uint8_t RESERVED_1[12]; - __O uint32_t SWTRIG; /**< Software Trigger Register, offset: 0x34 */ - __IO uint32_t TSTAT; /**< Trigger Status Register, offset: 0x38 */ - uint8_t RESERVED_2[4]; - __IO uint32_t OFSTRIM; /**< Offset Trim Register, offset: 0x40 */ - uint8_t RESERVED_3[92]; - __IO uint32_t TCTRL[4]; /**< Trigger Control Register, array offset: 0xA0, array step: 0x4 */ - uint8_t RESERVED_4[48]; - __IO uint32_t FCTRL[2]; /**< FIFO Control Register, array offset: 0xE0, array step: 0x4 */ - uint8_t RESERVED_5[8]; - __I uint32_t GCC[2]; /**< Gain Calibration Control, array offset: 0xF0, array step: 0x4 */ - __IO uint32_t GCR[2]; /**< Gain Calculation Result, array offset: 0xF8, array step: 0x4 */ - struct { /* offset: 0x100, array step: 0x8 */ - __IO uint32_t CMDL; /**< Command Low Buffer Register, array offset: 0x100, array step: 0x8 */ - __IO uint32_t CMDH; /**< Command High Buffer Register, array offset: 0x104, array step: 0x8 */ - } CMD[15]; - uint8_t RESERVED_6[136]; - __IO uint32_t CV[15]; /**< Compare Value Register, array offset: 0x200, array step: 0x4 */ - uint8_t RESERVED_7[196]; - __I uint32_t RESFIFO[2]; /**< Data Result FIFO Register, array offset: 0x300, array step: 0x4 */ - uint8_t RESERVED_8[248]; - __IO uint32_t CAL_GAR[33]; /**< Calibration General A-Side Registers, array offset: 0x400, array step: 0x4 */ - uint8_t RESERVED_9[124]; - __IO uint32_t CAL_GBR[33]; /**< Calibration General B-Side Registers, array offset: 0x500, array step: 0x4 */ -} ADC_Type; - -/* ---------------------------------------------------------------------------- - -- ADC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ADC_Register_Masks ADC Register Masks - * @{ - */ - -/*! @name VERID - Version ID Register */ -/*! @{ */ - -#define ADC_VERID_RES_MASK (0x1U) -#define ADC_VERID_RES_SHIFT (0U) -/*! RES - Resolution - * 0b0..Up to 13-bit differential or 12-bit single-ended resolution supported. - * 0b1..Up to 16-bit differential or 16-bit single-ended resolution supported. CMDLn[MODE] available for - * selecting the resolution of conversions for the associated command. - */ -#define ADC_VERID_RES(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_RES_SHIFT)) & ADC_VERID_RES_MASK) - -#define ADC_VERID_DIFFEN_MASK (0x2U) -#define ADC_VERID_DIFFEN_SHIFT (1U) -/*! DIFFEN - Differential Supported - * 0b0..Not supported - * 0b1..Supported. CMDLn[CTYPE] controls fields implemented. - */ -#define ADC_VERID_DIFFEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_DIFFEN_SHIFT)) & ADC_VERID_DIFFEN_MASK) - -#define ADC_VERID_MVI_MASK (0x8U) -#define ADC_VERID_MVI_SHIFT (3U) -/*! MVI - Multiple Vref Implemented - * 0b0..Single VREFH input supported. - * 0b1..Multiple VREFH inputs supported. - */ -#define ADC_VERID_MVI(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_MVI_SHIFT)) & ADC_VERID_MVI_MASK) - -#define ADC_VERID_CSW_MASK (0x70U) -#define ADC_VERID_CSW_SHIFT (4U) -/*! CSW - Channel Scale Width - * 0b000..Not supported. - * 0b001..Supported with one-bit CSCALE control field. - * 0b110..Supported with six-bit CSCALE control field. - */ -#define ADC_VERID_CSW(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_CSW_SHIFT)) & ADC_VERID_CSW_MASK) - -#define ADC_VERID_VR1RNGI_MASK (0x100U) -#define ADC_VERID_VR1RNGI_SHIFT (8U) -/*! VR1RNGI - Voltage Reference 1 Range Control Bit Implemented - * 0b0..Range control not required. - * 0b1..Range control required. - */ -#define ADC_VERID_VR1RNGI(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_VR1RNGI_SHIFT)) & ADC_VERID_VR1RNGI_MASK) - -#define ADC_VERID_IADCKI_MASK (0x200U) -#define ADC_VERID_IADCKI_SHIFT (9U) -/*! IADCKI - Internal ADC Clock Implemented - * 0b0..Not implemented - * 0b1..Implemented - */ -#define ADC_VERID_IADCKI(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_IADCKI_SHIFT)) & ADC_VERID_IADCKI_MASK) - -#define ADC_VERID_CALOFSI_MASK (0x400U) -#define ADC_VERID_CALOFSI_SHIFT (10U) -/*! CALOFSI - Calibration Function Implemented - * 0b0..Not implemented - * 0b1..Implemented - */ -#define ADC_VERID_CALOFSI(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_CALOFSI_SHIFT)) & ADC_VERID_CALOFSI_MASK) - -#define ADC_VERID_NUM_SEC_MASK (0x800U) -#define ADC_VERID_NUM_SEC_SHIFT (11U) -/*! NUM_SEC - Number of Single-Ended Outputs Supported - * 0b0..One - * 0b1..Two - */ -#define ADC_VERID_NUM_SEC(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_NUM_SEC_SHIFT)) & ADC_VERID_NUM_SEC_MASK) - -#define ADC_VERID_NUM_FIFO_MASK (0x7000U) -#define ADC_VERID_NUM_FIFO_SHIFT (12U) -/*! NUM_FIFO - Number of FIFOs - * 0b000..N/A - * 0b001..One - * 0b010..Two - * 0b011..Three - * 0b100..Four - */ -#define ADC_VERID_NUM_FIFO(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_NUM_FIFO_SHIFT)) & ADC_VERID_NUM_FIFO_MASK) - -#define ADC_VERID_MINOR_MASK (0xFF0000U) -#define ADC_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define ADC_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_MINOR_SHIFT)) & ADC_VERID_MINOR_MASK) - -#define ADC_VERID_MAJOR_MASK (0xFF000000U) -#define ADC_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define ADC_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << ADC_VERID_MAJOR_SHIFT)) & ADC_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter Register */ -/*! @{ */ - -#define ADC_PARAM_TRIG_NUM_MASK (0xFFU) -#define ADC_PARAM_TRIG_NUM_SHIFT (0U) -/*! TRIG_NUM - Trigger Number */ -#define ADC_PARAM_TRIG_NUM(x) (((uint32_t)(((uint32_t)(x)) << ADC_PARAM_TRIG_NUM_SHIFT)) & ADC_PARAM_TRIG_NUM_MASK) - -#define ADC_PARAM_FIFOSIZE_MASK (0xFF00U) -#define ADC_PARAM_FIFOSIZE_SHIFT (8U) -/*! FIFOSIZE - Result FIFO Depth - * 0b00000001..2 - * 0b00000100..4 - * 0b00001000..8 - * 0b00010000..16 - * 0b00100000..32 - * 0b01000000..64 - */ -#define ADC_PARAM_FIFOSIZE(x) (((uint32_t)(((uint32_t)(x)) << ADC_PARAM_FIFOSIZE_SHIFT)) & ADC_PARAM_FIFOSIZE_MASK) - -#define ADC_PARAM_CV_NUM_MASK (0xFF0000U) -#define ADC_PARAM_CV_NUM_SHIFT (16U) -/*! CV_NUM - Compare Value Number */ -#define ADC_PARAM_CV_NUM(x) (((uint32_t)(((uint32_t)(x)) << ADC_PARAM_CV_NUM_SHIFT)) & ADC_PARAM_CV_NUM_MASK) - -#define ADC_PARAM_CMD_NUM_MASK (0xFF000000U) -#define ADC_PARAM_CMD_NUM_SHIFT (24U) -/*! CMD_NUM - Command Buffer Number */ -#define ADC_PARAM_CMD_NUM(x) (((uint32_t)(((uint32_t)(x)) << ADC_PARAM_CMD_NUM_SHIFT)) & ADC_PARAM_CMD_NUM_MASK) -/*! @} */ - -/*! @name CTRL - Control Register */ -/*! @{ */ - -#define ADC_CTRL_ADCEN_MASK (0x1U) -#define ADC_CTRL_ADCEN_SHIFT (0U) -/*! ADCEN - ADC Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_CTRL_ADCEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_ADCEN_SHIFT)) & ADC_CTRL_ADCEN_MASK) - -#define ADC_CTRL_RST_MASK (0x2U) -#define ADC_CTRL_RST_SHIFT (1U) -/*! RST - Software Reset - * 0b0..ADC logic is not reset. - * 0b1..ADC logic is reset. - */ -#define ADC_CTRL_RST(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_RST_SHIFT)) & ADC_CTRL_RST_MASK) - -#define ADC_CTRL_DOZEN_MASK (0x4U) -#define ADC_CTRL_DOZEN_SHIFT (2U) -/*! DOZEN - Doze Enable - * 0b0..ADC is enabled in low-power mode. - * 0b1..ADC is disabled in low-power mode. - */ -#define ADC_CTRL_DOZEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_DOZEN_SHIFT)) & ADC_CTRL_DOZEN_MASK) - -#define ADC_CTRL_CAL_REQ_MASK (0x8U) -#define ADC_CTRL_CAL_REQ_SHIFT (3U) -/*! CAL_REQ - Auto-Calibration Request - * 0b0..No request made. - * 0b1..Request has been made. - */ -#define ADC_CTRL_CAL_REQ(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_CAL_REQ_SHIFT)) & ADC_CTRL_CAL_REQ_MASK) - -#define ADC_CTRL_CALOFS_MASK (0x10U) -#define ADC_CTRL_CALOFS_SHIFT (4U) -/*! CALOFS - Offset Calibration Request - * 0b0..Calibration function disabled - * 0b1..Request for offset calibration function - */ -#define ADC_CTRL_CALOFS(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_CALOFS_SHIFT)) & ADC_CTRL_CALOFS_MASK) - -#define ADC_CTRL_RSTFIFO0_MASK (0x100U) -#define ADC_CTRL_RSTFIFO0_SHIFT (8U) -/*! RSTFIFO0 - Reset FIFO 0 - * 0b0..No effect. - * 0b1..FIFO 0 is reset. - */ -#define ADC_CTRL_RSTFIFO0(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_RSTFIFO0_SHIFT)) & ADC_CTRL_RSTFIFO0_MASK) - -#define ADC_CTRL_RSTFIFO1_MASK (0x200U) -#define ADC_CTRL_RSTFIFO1_SHIFT (9U) -/*! RSTFIFO1 - Reset FIFO 1 - * 0b0..No effect. - * 0b1..FIFO 1 is reset. - */ -#define ADC_CTRL_RSTFIFO1(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_RSTFIFO1_SHIFT)) & ADC_CTRL_RSTFIFO1_MASK) - -#define ADC_CTRL_CAL_AVGS_MASK (0xF0000U) -#define ADC_CTRL_CAL_AVGS_SHIFT (16U) -/*! CAL_AVGS - Auto-Calibration Averages - * 0b0000..Single conversion. - * 0b0001..2 conversions averaged. - * 0b0010..4 conversions averaged. - * 0b0011..8 conversions averaged. - * 0b0100..16 conversions averaged. - * 0b0101..32 conversions averaged. - * 0b0110..64 conversions averaged. - * 0b0111..128 conversions averaged. - * 0b1000..256 conversions averaged. - * 0b1001..512 conversions averaged. - * 0b1010..1024 conversions averaged. - */ -#define ADC_CTRL_CAL_AVGS(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_CAL_AVGS_SHIFT)) & ADC_CTRL_CAL_AVGS_MASK) -/*! @} */ - -/*! @name STAT - Status Register */ -/*! @{ */ - -#define ADC_STAT_RDY0_MASK (0x1U) -#define ADC_STAT_RDY0_SHIFT (0U) -/*! RDY0 - Result FIFO 0 Ready Flag - * 0b0..Not above watermark - * 0b1..Above watermark - */ -#define ADC_STAT_RDY0(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_RDY0_SHIFT)) & ADC_STAT_RDY0_MASK) - -#define ADC_STAT_FOF0_MASK (0x2U) -#define ADC_STAT_FOF0_SHIFT (1U) -/*! FOF0 - Result FIFO 0 Overflow Flag - * 0b0..No result FIFO 0 overflow has occurred since the last time that the flag was cleared. - * 0b1..At least one result FIFO 0 overflow has occurred since the last time that the flag was cleared. - */ -#define ADC_STAT_FOF0(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_FOF0_SHIFT)) & ADC_STAT_FOF0_MASK) - -#define ADC_STAT_RDY1_MASK (0x4U) -#define ADC_STAT_RDY1_SHIFT (2U) -/*! RDY1 - Result FIFO1 Ready Flag - * 0b0..Not above watermark - * 0b1..Above watermark - */ -#define ADC_STAT_RDY1(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_RDY1_SHIFT)) & ADC_STAT_RDY1_MASK) - -#define ADC_STAT_FOF1_MASK (0x8U) -#define ADC_STAT_FOF1_SHIFT (3U) -/*! FOF1 - Result FIFO1 Overflow Flag - * 0b0..No result FIFO1 overflow has occurred since the last time that the flag was cleared. - * 0b1..At least one result FIFO1 overflow has occurred since the last time that the flag was cleared. - */ -#define ADC_STAT_FOF1(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_FOF1_SHIFT)) & ADC_STAT_FOF1_MASK) - -#define ADC_STAT_TEXC_INT_MASK (0x100U) -#define ADC_STAT_TEXC_INT_SHIFT (8U) -/*! TEXC_INT - Interrupt Flag For High-Priority Trigger Exception - * 0b0..No trigger exceptions have occurred. - * 0b1..A trigger exception has occurred and is pending acknowledgment. - */ -#define ADC_STAT_TEXC_INT(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_TEXC_INT_SHIFT)) & ADC_STAT_TEXC_INT_MASK) - -#define ADC_STAT_TCOMP_INT_MASK (0x200U) -#define ADC_STAT_TCOMP_INT_SHIFT (9U) -/*! TCOMP_INT - Interrupt Flag For Trigger Completion - * 0b0..Either IE[TCOMP_IE] = 0, or no trigger sequences have run to completion. - * 0b1..Trigger sequence has been completed and all data is stored in the associated FIFO. - */ -#define ADC_STAT_TCOMP_INT(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_TCOMP_INT_SHIFT)) & ADC_STAT_TCOMP_INT_MASK) - -#define ADC_STAT_CAL_RDY_MASK (0x400U) -#define ADC_STAT_CAL_RDY_SHIFT (10U) -/*! CAL_RDY - Calibration Ready - * 0b0..Calibration is incomplete or has not been run. - * 0b1..ADC is calibrated. - */ -#define ADC_STAT_CAL_RDY(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_CAL_RDY_SHIFT)) & ADC_STAT_CAL_RDY_MASK) - -#define ADC_STAT_ADC_ACTIVE_MASK (0x800U) -#define ADC_STAT_ADC_ACTIVE_SHIFT (11U) -/*! ADC_ACTIVE - ADC Active - * 0b0..ADC is idle. There are no pending triggers to service and no active commands are being processed. - * 0b1..ADC is processing a conversion, running through the power-up delay, or servicing a trigger. - */ -#define ADC_STAT_ADC_ACTIVE(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_ADC_ACTIVE_SHIFT)) & ADC_STAT_ADC_ACTIVE_MASK) - -#define ADC_STAT_TRGACT_MASK (0x30000U) -#define ADC_STAT_TRGACT_SHIFT (16U) -/*! TRGACT - Trigger Active - * 0b00..Command (sequence) associated with Trigger 0 currently being executed. - * 0b01..Command (sequence) associated with Trigger 1 currently being executed. - * 0b10..Command (sequence) associated with Trigger 2 currently being executed. - * 0b11..Command (sequence) associated with Trigger 3 currently being executed. - */ -#define ADC_STAT_TRGACT(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_TRGACT_SHIFT)) & ADC_STAT_TRGACT_MASK) - -#define ADC_STAT_CMDACT_MASK (0xF000000U) -#define ADC_STAT_CMDACT_SHIFT (24U) -/*! CMDACT - Command Active - * 0b0000..No command currently in progress. - * 0b0001..Command 1 currently being executed. - * 0b0010..Command 2 currently being executed. - * 0b0011-0b1111..Associated command number currently being executed. - */ -#define ADC_STAT_CMDACT(x) (((uint32_t)(((uint32_t)(x)) << ADC_STAT_CMDACT_SHIFT)) & ADC_STAT_CMDACT_MASK) -/*! @} */ - -/*! @name IE - Interrupt Enable Register */ -/*! @{ */ - -#define ADC_IE_FWMIE0_MASK (0x1U) -#define ADC_IE_FWMIE0_SHIFT (0U) -/*! FWMIE0 - FIFO 0 Watermark Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_IE_FWMIE0(x) (((uint32_t)(((uint32_t)(x)) << ADC_IE_FWMIE0_SHIFT)) & ADC_IE_FWMIE0_MASK) - -#define ADC_IE_FOFIE0_MASK (0x2U) -#define ADC_IE_FOFIE0_SHIFT (1U) -/*! FOFIE0 - Result FIFO 0 Overflow Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_IE_FOFIE0(x) (((uint32_t)(((uint32_t)(x)) << ADC_IE_FOFIE0_SHIFT)) & ADC_IE_FOFIE0_MASK) - -#define ADC_IE_FWMIE1_MASK (0x4U) -#define ADC_IE_FWMIE1_SHIFT (2U) -/*! FWMIE1 - FIFO1 Watermark Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_IE_FWMIE1(x) (((uint32_t)(((uint32_t)(x)) << ADC_IE_FWMIE1_SHIFT)) & ADC_IE_FWMIE1_MASK) - -#define ADC_IE_FOFIE1_MASK (0x8U) -#define ADC_IE_FOFIE1_SHIFT (3U) -/*! FOFIE1 - Result FIFO1 Overflow Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_IE_FOFIE1(x) (((uint32_t)(((uint32_t)(x)) << ADC_IE_FOFIE1_SHIFT)) & ADC_IE_FOFIE1_MASK) - -#define ADC_IE_TEXC_IE_MASK (0x100U) -#define ADC_IE_TEXC_IE_SHIFT (8U) -/*! TEXC_IE - Trigger Exception Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_IE_TEXC_IE(x) (((uint32_t)(((uint32_t)(x)) << ADC_IE_TEXC_IE_SHIFT)) & ADC_IE_TEXC_IE_MASK) - -#define ADC_IE_TCOMP_IE_MASK (0xF0000U) -#define ADC_IE_TCOMP_IE_SHIFT (16U) -/*! TCOMP_IE - Trigger Completion Interrupt Enable - * 0b0000..All disabled - * 0b0001..Trigger completion interrupts are enabled for trigger source 0 only. - * 0b0010..Trigger completion interrupts are enabled for trigger source 1 only. - * 0b0011-0b1110..Associated trigger completion interrupts are enabled. - * 0b1111..All enabled - */ -#define ADC_IE_TCOMP_IE(x) (((uint32_t)(((uint32_t)(x)) << ADC_IE_TCOMP_IE_SHIFT)) & ADC_IE_TCOMP_IE_MASK) -/*! @} */ - -/*! @name DE - DMA Enable Register */ -/*! @{ */ - -#define ADC_DE_FWMDE0_MASK (0x1U) -#define ADC_DE_FWMDE0_SHIFT (0U) -/*! FWMDE0 - FIFO 0 Watermark DMA Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_DE_FWMDE0(x) (((uint32_t)(((uint32_t)(x)) << ADC_DE_FWMDE0_SHIFT)) & ADC_DE_FWMDE0_MASK) - -#define ADC_DE_FWMDE1_MASK (0x2U) -#define ADC_DE_FWMDE1_SHIFT (1U) -/*! FWMDE1 - FIFO1 Watermark DMA Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_DE_FWMDE1(x) (((uint32_t)(((uint32_t)(x)) << ADC_DE_FWMDE1_SHIFT)) & ADC_DE_FWMDE1_MASK) -/*! @} */ - -/*! @name CFG - Configuration Register */ -/*! @{ */ - -#define ADC_CFG_TPRICTRL_MASK (0x3U) -#define ADC_CFG_TPRICTRL_SHIFT (0U) -/*! TPRICTRL - ADC Trigger Priority Control - * 0b00..Current conversion is aborted and the new command specified by the trigger is started. - * 0b01..Current command is stopped after completing the current conversion. If averaging is enabled, the - * averaging loop is completed. CMDHn[LOOP] is ignored and the higher-priority trigger is serviced. - * 0b10..Current command is completed (averaging, looping, compare) before servicing the higher-priority trigger. - * 0b11.. - */ -#define ADC_CFG_TPRICTRL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_TPRICTRL_SHIFT)) & ADC_CFG_TPRICTRL_MASK) - -#define ADC_CFG_PWRSEL_MASK (0x30U) -#define ADC_CFG_PWRSEL_SHIFT (4U) -/*! PWRSEL - Power Configuration Select - * 0b0x..Low power - * 0b1x..High power - */ -#define ADC_CFG_PWRSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_PWRSEL_SHIFT)) & ADC_CFG_PWRSEL_MASK) - -#define ADC_CFG_REFSEL_MASK (0xC0U) -#define ADC_CFG_REFSEL_SHIFT (6U) -/*! REFSEL - Voltage Reference Selection - * 0b00..Option 1 - * 0b01..Option 2 - * 0b10..Option 3 - * 0b11.. - */ -#define ADC_CFG_REFSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_REFSEL_SHIFT)) & ADC_CFG_REFSEL_MASK) - -#define ADC_CFG_TRES_MASK (0x100U) -#define ADC_CFG_TRES_SHIFT (8U) -/*! TRES - Trigger Resume Enable - * 0b0..Not automatically resumed or restarted - * 0b1..Automatically resumed or restarted - */ -#define ADC_CFG_TRES(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_TRES_SHIFT)) & ADC_CFG_TRES_MASK) - -#define ADC_CFG_TCMDRES_MASK (0x200U) -#define ADC_CFG_TCMDRES_SHIFT (9U) -/*! TCMDRES - Trigger Command Resume - * 0b0..Trigger sequence automatically restarted. - * 0b1..Trigger sequence resumed from the command that was executed prior to the exception. - */ -#define ADC_CFG_TCMDRES(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_TCMDRES_SHIFT)) & ADC_CFG_TCMDRES_MASK) - -#define ADC_CFG_HPT_EXDI_MASK (0x400U) -#define ADC_CFG_HPT_EXDI_SHIFT (10U) -/*! HPT_EXDI - High-Priority Trigger Exception Disable - * 0b0..Enabled - * 0b1..Disabled - */ -#define ADC_CFG_HPT_EXDI(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_HPT_EXDI_SHIFT)) & ADC_CFG_HPT_EXDI_MASK) - -#define ADC_CFG_PUDLY_MASK (0xFF0000U) -#define ADC_CFG_PUDLY_SHIFT (16U) -/*! PUDLY - Power-up Delay */ -#define ADC_CFG_PUDLY(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_PUDLY_SHIFT)) & ADC_CFG_PUDLY_MASK) - -#define ADC_CFG_PWREN_MASK (0x10000000U) -#define ADC_CFG_PWREN_SHIFT (28U) -/*! PWREN - ADC Analog Pre-Enable - * 0b0..ADC analog circuits are only enabled while conversions are active. Analog startup delays affect performance. - * 0b1..ADC analog circuits are pre-enabled and ready to execute conversions without startup delays, at the cost - * of higher DC current consumption. A single power-up delay (CFG[PUDLY]) is executed immediately once PWREN - * is set. No detected triggers begin ADC operation until the power-up delay time has passed. After this - * initial delay expires, the analog circuits remain pre-enabled, and no additional delays are executed. - */ -#define ADC_CFG_PWREN(x) (((uint32_t)(((uint32_t)(x)) << ADC_CFG_PWREN_SHIFT)) & ADC_CFG_PWREN_MASK) -/*! @} */ - -/*! @name PAUSE - Pause Register */ -/*! @{ */ - -#define ADC_PAUSE_PAUSEDLY_MASK (0x1FFU) -#define ADC_PAUSE_PAUSEDLY_SHIFT (0U) -/*! PAUSEDLY - Pause Delay */ -#define ADC_PAUSE_PAUSEDLY(x) (((uint32_t)(((uint32_t)(x)) << ADC_PAUSE_PAUSEDLY_SHIFT)) & ADC_PAUSE_PAUSEDLY_MASK) - -#define ADC_PAUSE_PAUSEEN_MASK (0x80000000U) -#define ADC_PAUSE_PAUSEEN_SHIFT (31U) -/*! PAUSEEN - Pause Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_PAUSE_PAUSEEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_PAUSE_PAUSEEN_SHIFT)) & ADC_PAUSE_PAUSEEN_MASK) -/*! @} */ - -/*! @name SWTRIG - Software Trigger Register */ -/*! @{ */ - -#define ADC_SWTRIG_SWT0_MASK (0x1U) -#define ADC_SWTRIG_SWT0_SHIFT (0U) -/*! SWT0 - Software Trigger 0 - * 0b0..No trigger 0 event generated. - * 0b1..Trigger 0 event generated. - */ -#define ADC_SWTRIG_SWT0(x) (((uint32_t)(((uint32_t)(x)) << ADC_SWTRIG_SWT0_SHIFT)) & ADC_SWTRIG_SWT0_MASK) - -#define ADC_SWTRIG_SWT1_MASK (0x2U) -#define ADC_SWTRIG_SWT1_SHIFT (1U) -/*! SWT1 - Software Trigger 1 - * 0b0..No trigger 1 event generated. - * 0b1..Trigger 1 event generated. - */ -#define ADC_SWTRIG_SWT1(x) (((uint32_t)(((uint32_t)(x)) << ADC_SWTRIG_SWT1_SHIFT)) & ADC_SWTRIG_SWT1_MASK) - -#define ADC_SWTRIG_SWT2_MASK (0x4U) -#define ADC_SWTRIG_SWT2_SHIFT (2U) -/*! SWT2 - Software Trigger 2 - * 0b0..No trigger 2 event generated. - * 0b1..Trigger 2 event generated. - */ -#define ADC_SWTRIG_SWT2(x) (((uint32_t)(((uint32_t)(x)) << ADC_SWTRIG_SWT2_SHIFT)) & ADC_SWTRIG_SWT2_MASK) - -#define ADC_SWTRIG_SWT3_MASK (0x8U) -#define ADC_SWTRIG_SWT3_SHIFT (3U) -/*! SWT3 - Software Trigger 3 - * 0b0..No trigger 3 event generated. - * 0b1..Trigger 3 event generated. - */ -#define ADC_SWTRIG_SWT3(x) (((uint32_t)(((uint32_t)(x)) << ADC_SWTRIG_SWT3_SHIFT)) & ADC_SWTRIG_SWT3_MASK) -/*! @} */ - -/*! @name TSTAT - Trigger Status Register */ -/*! @{ */ - -#define ADC_TSTAT_TEXC_NUM_MASK (0xFU) -#define ADC_TSTAT_TEXC_NUM_SHIFT (0U) -/*! TEXC_NUM - Trigger Exception Number - * 0b0000..No triggers have been interrupted by a high-priority exception. - * 0b0001..Trigger 0 has been interrupted by a high-priority exception. - * 0b0010..Trigger 1 has been interrupted by a high-priority exception. - * 0b0011-0b1110..Associated trigger sequence has interrupted by a high-priority exception. - * 0b1111..Every trigger sequence has been interrupted by a high-priority exception. - */ -#define ADC_TSTAT_TEXC_NUM(x) (((uint32_t)(((uint32_t)(x)) << ADC_TSTAT_TEXC_NUM_SHIFT)) & ADC_TSTAT_TEXC_NUM_MASK) - -#define ADC_TSTAT_TCOMP_FLAG_MASK (0xF0000U) -#define ADC_TSTAT_TCOMP_FLAG_SHIFT (16U) -/*! TCOMP_FLAG - Trigger Completion Flag - * 0b0000..No triggers have been completed. Trigger completion interrupts are disabled. - * 0b0001..Trigger 0 has been completed and trigger 0 has enabled completion interrupts. - * 0b0010..Trigger 1 has been completed and trigger 1 has enabled completion interrupts. - * 0b0011-0b1110..Associated trigger sequence has completed and has enabled completion interrupts. - * 0b1111..Every trigger sequence has been completed and every trigger has enabled completion interrupts. - */ -#define ADC_TSTAT_TCOMP_FLAG(x) (((uint32_t)(((uint32_t)(x)) << ADC_TSTAT_TCOMP_FLAG_SHIFT)) & ADC_TSTAT_TCOMP_FLAG_MASK) -/*! @} */ - -/*! @name OFSTRIM - Offset Trim Register */ -/*! @{ */ - -#define ADC_OFSTRIM_OFSTRIM_A_MASK (0x1FU) -#define ADC_OFSTRIM_OFSTRIM_A_SHIFT (0U) -/*! OFSTRIM_A - Trim for Offset */ -#define ADC_OFSTRIM_OFSTRIM_A(x) (((uint32_t)(((uint32_t)(x)) << ADC_OFSTRIM_OFSTRIM_A_SHIFT)) & ADC_OFSTRIM_OFSTRIM_A_MASK) - -#define ADC_OFSTRIM_OFSTRIM_B_MASK (0x1F0000U) -#define ADC_OFSTRIM_OFSTRIM_B_SHIFT (16U) -/*! OFSTRIM_B - Trim for Offset */ -#define ADC_OFSTRIM_OFSTRIM_B(x) (((uint32_t)(((uint32_t)(x)) << ADC_OFSTRIM_OFSTRIM_B_SHIFT)) & ADC_OFSTRIM_OFSTRIM_B_MASK) -/*! @} */ - -/*! @name TCTRL - Trigger Control Register */ -/*! @{ */ - -#define ADC_TCTRL_HTEN_MASK (0x1U) -#define ADC_TCTRL_HTEN_SHIFT (0U) -/*! HTEN - Trigger Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_TCTRL_HTEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_HTEN_SHIFT)) & ADC_TCTRL_HTEN_MASK) - -#define ADC_TCTRL_FIFO_SEL_A_MASK (0x2U) -#define ADC_TCTRL_FIFO_SEL_A_SHIFT (1U) -/*! FIFO_SEL_A - SAR Result Destination for Channel A - * 0b0..FIFO 0 - * 0b1..FIFO 1 - */ -#define ADC_TCTRL_FIFO_SEL_A(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_FIFO_SEL_A_SHIFT)) & ADC_TCTRL_FIFO_SEL_A_MASK) - -#define ADC_TCTRL_FIFO_SEL_B_MASK (0x4U) -#define ADC_TCTRL_FIFO_SEL_B_SHIFT (2U) -/*! FIFO_SEL_B - SAR Result Destination for Channel B - * 0b0..FIFO 0 - * 0b1..FIFO 1 - */ -#define ADC_TCTRL_FIFO_SEL_B(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_FIFO_SEL_B_SHIFT)) & ADC_TCTRL_FIFO_SEL_B_MASK) - -#define ADC_TCTRL_TPRI_MASK (0x300U) -#define ADC_TCTRL_TPRI_SHIFT (8U) -/*! TPRI - Trigger Priority Setting - * 0b00..Highest priority, Level 1 - * 0b01-0b10..Set to corresponding priority level. - * 0b11..Lowest priority, Level 4 - */ -#define ADC_TCTRL_TPRI(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_TPRI_SHIFT)) & ADC_TCTRL_TPRI_MASK) - -#define ADC_TCTRL_RSYNC_MASK (0x8000U) -#define ADC_TCTRL_RSYNC_SHIFT (15U) -/*! RSYNC - Trigger Resync - * 0b0..Disable - * 0b1..Enable - */ -#define ADC_TCTRL_RSYNC(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_RSYNC_SHIFT)) & ADC_TCTRL_RSYNC_MASK) - -#define ADC_TCTRL_TDLY_MASK (0xF0000U) -#define ADC_TCTRL_TDLY_SHIFT (16U) -/*! TDLY - Trigger Delay Select */ -#define ADC_TCTRL_TDLY(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_TDLY_SHIFT)) & ADC_TCTRL_TDLY_MASK) - -#define ADC_TCTRL_TCMD_MASK (0xF000000U) -#define ADC_TCTRL_TCMD_SHIFT (24U) -/*! TCMD - Trigger Command Select - * 0b0000..Not a valid selection from the command buffer. Trigger event is ignored. - * 0b0001..CMD1 - * 0b0010-0b1110..Corresponding CMD is executed - * 0b1111..CMD15 - */ -#define ADC_TCTRL_TCMD(x) (((uint32_t)(((uint32_t)(x)) << ADC_TCTRL_TCMD_SHIFT)) & ADC_TCTRL_TCMD_MASK) -/*! @} */ - -/* The count of ADC_TCTRL */ -#define ADC_TCTRL_COUNT (4U) - -/*! @name FCTRL - FIFO Control Register */ -/*! @{ */ - -#define ADC_FCTRL_FCOUNT_MASK (0x1FU) -#define ADC_FCTRL_FCOUNT_SHIFT (0U) -/*! FCOUNT - Result FIFO Counter */ -#define ADC_FCTRL_FCOUNT(x) (((uint32_t)(((uint32_t)(x)) << ADC_FCTRL_FCOUNT_SHIFT)) & ADC_FCTRL_FCOUNT_MASK) - -#define ADC_FCTRL_FWMARK_MASK (0xF0000U) -#define ADC_FCTRL_FWMARK_SHIFT (16U) -/*! FWMARK - Watermark Level Selection */ -#define ADC_FCTRL_FWMARK(x) (((uint32_t)(((uint32_t)(x)) << ADC_FCTRL_FWMARK_SHIFT)) & ADC_FCTRL_FWMARK_MASK) -/*! @} */ - -/* The count of ADC_FCTRL */ -#define ADC_FCTRL_COUNT (2U) - -/*! @name GCC - Gain Calibration Control */ -/*! @{ */ - -#define ADC_GCC_GAIN_CAL_MASK (0xFFFFU) -#define ADC_GCC_GAIN_CAL_SHIFT (0U) -/*! GAIN_CAL - Gain Calibration Value */ -#define ADC_GCC_GAIN_CAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_GCC_GAIN_CAL_SHIFT)) & ADC_GCC_GAIN_CAL_MASK) - -#define ADC_GCC_RDY_MASK (0x1000000U) -#define ADC_GCC_RDY_SHIFT (24U) -/*! RDY - Gain Calibration Value Valid - * 0b0..Invalid - * 0b1..Valid - */ -#define ADC_GCC_RDY(x) (((uint32_t)(((uint32_t)(x)) << ADC_GCC_RDY_SHIFT)) & ADC_GCC_RDY_MASK) -/*! @} */ - -/* The count of ADC_GCC */ -#define ADC_GCC_COUNT (2U) - -/*! @name GCR - Gain Calculation Result */ -/*! @{ */ - -#define ADC_GCR_GCALR_MASK (0xFFFFU) -#define ADC_GCR_GCALR_SHIFT (0U) -/*! GCALR - Gain Calculation Result */ -#define ADC_GCR_GCALR(x) (((uint32_t)(((uint32_t)(x)) << ADC_GCR_GCALR_SHIFT)) & ADC_GCR_GCALR_MASK) - -#define ADC_GCR_RDY_MASK (0x1000000U) -#define ADC_GCR_RDY_SHIFT (24U) -/*! RDY - Gain Calculation Ready - * 0b0..Invalid - * 0b1..Valid - */ -#define ADC_GCR_RDY(x) (((uint32_t)(((uint32_t)(x)) << ADC_GCR_RDY_SHIFT)) & ADC_GCR_RDY_MASK) -/*! @} */ - -/* The count of ADC_GCR */ -#define ADC_GCR_COUNT (2U) - -/*! @name CMDL - Command Low Buffer Register */ -/*! @{ */ - -#define ADC_CMDL_ADCH_MASK (0x1FU) -#define ADC_CMDL_ADCH_SHIFT (0U) -/*! ADCH - Input Channel Select - * 0b00000..CH0A or CH0B or CH0A/CH0B pair. - * 0b00001..CH1A or CH1B or CH1A/CH1B pair. - * 0b00010..CH2A or CH2B or CH2A/CH2B pair. - * 0b00011..CH3A or CH3B or CH3A/CH3B pair. - * 0b00100-0b11101..Select corresponding channel CHnA or CHnB or CHnA/CHnB pair. - * 0b11110..CH30A or CH30B or CH30A/CH30B pair. - * 0b11111..CH31A or CH31B or CH31A/CH31B pair. - */ -#define ADC_CMDL_ADCH(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDL_ADCH_SHIFT)) & ADC_CMDL_ADCH_MASK) - -#define ADC_CMDL_CTYPE_MASK (0x60U) -#define ADC_CMDL_CTYPE_SHIFT (5U) -/*! CTYPE - Conversion Type - * 0b00..Single-Ended mode. Only A-side channel is converted. - * 0b01..Single-Ended mode. Only B-side channel is converted. - * 0b10..Differential mode. A-B. - * 0b11..Dual-Single-Ended mode. Both A-side and B-side channels are converted independently. - */ -#define ADC_CMDL_CTYPE(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDL_CTYPE_SHIFT)) & ADC_CMDL_CTYPE_MASK) - -#define ADC_CMDL_MODE_MASK (0x80U) -#define ADC_CMDL_MODE_SHIFT (7U) -/*! MODE - Select Resolution of Conversions - * 0b0..Standard resolution. Single-ended 12-bit conversion; differential 13-bit conversion with 2's complement output. - * 0b1..High resolution. Single-ended 16-bit conversion; differential 16-bit conversion with 2's complement output. - */ -#define ADC_CMDL_MODE(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDL_MODE_SHIFT)) & ADC_CMDL_MODE_MASK) - -#define ADC_CMDL_ALTB_ADCH_MASK (0x1F0000U) -#define ADC_CMDL_ALTB_ADCH_SHIFT (16U) -/*! ALTB_ADCH - Alternate Channel B Input Channel Select - * 0b00000..Select CH0B - * 0b00001..Select CH1B - * 0b00010..Select CH2B - * 0b00011..Select CH3B - * 0b00100-0b11101..Select corresponding channel CHnB - * 0b11110..Select CH30B - * 0b11111..Select CH31B - */ -#define ADC_CMDL_ALTB_ADCH(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDL_ALTB_ADCH_SHIFT)) & ADC_CMDL_ALTB_ADCH_MASK) - -#define ADC_CMDL_ALTBEN_MASK (0x200000U) -#define ADC_CMDL_ALTBEN_SHIFT (21U) -/*! ALTBEN - Alternate Channel B Select Enable - * 0b0..ALTBEN_ADCH disabled. Channel-A and Channel-B inputs are selected based on ADCH settings. - * 0b1..ALTBEN_ADCH enabled. Channel-A inputs are selected by ADCH setting and Channel-B inputs are selected by ALTB_ADCH setting. - */ -#define ADC_CMDL_ALTBEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDL_ALTBEN_SHIFT)) & ADC_CMDL_ALTBEN_MASK) -/*! @} */ - -/* The count of ADC_CMDL */ -#define ADC_CMDL_COUNT (15U) - -/*! @name CMDH - Command High Buffer Register */ -/*! @{ */ - -#define ADC_CMDH_CMPEN_MASK (0x3U) -#define ADC_CMDH_CMPEN_SHIFT (0U) -/*! CMPEN - Compare Function Enable - * 0b00..Disabled - * 0b01.. - * 0b10..Enabled. Store on true. - * 0b11..Enabled. Repeat channel acquisition (sample, convert, and compare) until true. - */ -#define ADC_CMDH_CMPEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_CMPEN_SHIFT)) & ADC_CMDH_CMPEN_MASK) - -#define ADC_CMDH_WAIT_TRIG_MASK (0x4U) -#define ADC_CMDH_WAIT_TRIG_SHIFT (2U) -/*! WAIT_TRIG - Wait for Trigger Assertion Before Execution - * 0b0..Command executes automatically. - * 0b1..Active trigger must be asserted again before executing this command. - */ -#define ADC_CMDH_WAIT_TRIG(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_WAIT_TRIG_SHIFT)) & ADC_CMDH_WAIT_TRIG_MASK) - -#define ADC_CMDH_LWI_MASK (0x80U) -#define ADC_CMDH_LWI_SHIFT (7U) -/*! LWI - Loop with Increment - * 0b0..Disabled - * 0b1..Enabled - */ -#define ADC_CMDH_LWI(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_LWI_SHIFT)) & ADC_CMDH_LWI_MASK) - -#define ADC_CMDH_STS_MASK (0x700U) -#define ADC_CMDH_STS_SHIFT (8U) -/*! STS - Sample Time Select - * 0b000..Minimum sample time of 3.5 ADCK cycles. - * 0b001..5.5 ADCK cycles - * 0b010..7.5 ADCK cycles - * 0b011..11.5 ADCK cycles - * 0b100..19.5 ADCK cycles - * 0b101..35.5 ADCK cycles - * 0b110..67.5 ADCK cycles - * 0b111..131.5 ADCK cycles - */ -#define ADC_CMDH_STS(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_STS_SHIFT)) & ADC_CMDH_STS_MASK) - -#define ADC_CMDH_AVGS_MASK (0xF000U) -#define ADC_CMDH_AVGS_SHIFT (12U) -/*! AVGS - Hardware Average Select - * 0b0000..Single conversion - * 0b0001..2 - * 0b0010..4 - * 0b0011..8 - * 0b0100..16 - * 0b0101..32 - * 0b0110..64 - * 0b0111..128 - * 0b1000..256 - * 0b1001..512 - * 0b1010..1024 - */ -#define ADC_CMDH_AVGS(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_AVGS_SHIFT)) & ADC_CMDH_AVGS_MASK) - -#define ADC_CMDH_LOOP_MASK (0xF0000U) -#define ADC_CMDH_LOOP_SHIFT (16U) -/*! LOOP - Loop Count Select - * 0b0000..Looping not enabled. Command executes one time. - * 0b0001..Loop one time. Command executes two times. - * 0b0010..Loop two times. Command executes three times. - * 0b0011-0b1110..Loop corresponding number of times. Command executes LOOP + 1 times. - * 0b1111..Loop 15 times. Command executes 16 times. - */ -#define ADC_CMDH_LOOP(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_LOOP_SHIFT)) & ADC_CMDH_LOOP_MASK) - -#define ADC_CMDH_NEXT_MASK (0xF000000U) -#define ADC_CMDH_NEXT_SHIFT (24U) -/*! NEXT - Next Command Select - * 0b0000..No next command defined. Terminate conversions at completion of current command. If lower priority - * trigger pending, begin command associated with lower priority trigger. - * 0b0001..CMD1 - * 0b0010-0b1110..Select corresponding CMD command buffer register as next command - * 0b1111..CMD15 - */ -#define ADC_CMDH_NEXT(x) (((uint32_t)(((uint32_t)(x)) << ADC_CMDH_NEXT_SHIFT)) & ADC_CMDH_NEXT_MASK) -/*! @} */ - -/* The count of ADC_CMDH */ -#define ADC_CMDH_COUNT (15U) - -/*! @name CV - Compare Value Register */ -/*! @{ */ - -#define ADC_CV_CVL_MASK (0xFFFFU) -#define ADC_CV_CVL_SHIFT (0U) -/*! CVL - Compare Value Low */ -#define ADC_CV_CVL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CV_CVL_SHIFT)) & ADC_CV_CVL_MASK) - -#define ADC_CV_CVH_MASK (0xFFFF0000U) -#define ADC_CV_CVH_SHIFT (16U) -/*! CVH - Compare Value High */ -#define ADC_CV_CVH(x) (((uint32_t)(((uint32_t)(x)) << ADC_CV_CVH_SHIFT)) & ADC_CV_CVH_MASK) -/*! @} */ - -/* The count of ADC_CV */ -#define ADC_CV_COUNT (15U) - -/*! @name RESFIFO - Data Result FIFO Register */ -/*! @{ */ - -#define ADC_RESFIFO_D_MASK (0xFFFFU) -#define ADC_RESFIFO_D_SHIFT (0U) -/*! D - Data Result */ -#define ADC_RESFIFO_D(x) (((uint32_t)(((uint32_t)(x)) << ADC_RESFIFO_D_SHIFT)) & ADC_RESFIFO_D_MASK) - -#define ADC_RESFIFO_TSRC_MASK (0x30000U) -#define ADC_RESFIFO_TSRC_SHIFT (16U) -/*! TSRC - Trigger Source - * 0b00..Trigger source 0 - * 0b01..Trigger source 1 - * 0b10..Trigger source 2 - * 0b11..Trigger source 3 - */ -#define ADC_RESFIFO_TSRC(x) (((uint32_t)(((uint32_t)(x)) << ADC_RESFIFO_TSRC_SHIFT)) & ADC_RESFIFO_TSRC_MASK) - -#define ADC_RESFIFO_LOOPCNT_MASK (0xF00000U) -#define ADC_RESFIFO_LOOPCNT_SHIFT (20U) -/*! LOOPCNT - Loop Count Value - * 0b0000..Result is from initial conversion in command. - * 0b0001..Result is from second conversion in command. - * 0b0010-0b1110..Result is from (LOOPCNT + 1) conversion in command. - * 0b1111..Result is from 16th conversion in command. - */ -#define ADC_RESFIFO_LOOPCNT(x) (((uint32_t)(((uint32_t)(x)) << ADC_RESFIFO_LOOPCNT_SHIFT)) & ADC_RESFIFO_LOOPCNT_MASK) - -#define ADC_RESFIFO_CMDSRC_MASK (0xF000000U) -#define ADC_RESFIFO_CMDSRC_SHIFT (24U) -/*! CMDSRC - Command Buffer Source - * 0b0000..Not a valid value CMDSRC value for a data word in RESFIFO. 0h is only found in the initial FIFO state, - * prior to the storage of an ADC conversion result into a RESFIFO buffer. - * 0b0001..CMD1 - * 0b0010-0b1110..Corresponding command buffer used as control settings for this conversion. - * 0b1111..CMD15 - */ -#define ADC_RESFIFO_CMDSRC(x) (((uint32_t)(((uint32_t)(x)) << ADC_RESFIFO_CMDSRC_SHIFT)) & ADC_RESFIFO_CMDSRC_MASK) - -#define ADC_RESFIFO_VALID_MASK (0x80000000U) -#define ADC_RESFIFO_VALID_SHIFT (31U) -/*! VALID - FIFO Entry is Valid - * 0b0..FIFO is empty. Discard any read from RESFIFO. - * 0b1..FIFO contains data. FIFO record read from RESFIFO is valid. - */ -#define ADC_RESFIFO_VALID(x) (((uint32_t)(((uint32_t)(x)) << ADC_RESFIFO_VALID_SHIFT)) & ADC_RESFIFO_VALID_MASK) -/*! @} */ - -/* The count of ADC_RESFIFO */ -#define ADC_RESFIFO_COUNT (2U) - -/*! @name CAL_GAR - Calibration General A-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GAR_CAL_GAR_VAL_MASK (0xFFFFU) /* Merged from fields with different position or width, of widths (11, 12, 13, 14, 15, 16), largest definition used */ -#define ADC_CAL_GAR_CAL_GAR_VAL_SHIFT (0U) -/*! CAL_GAR_VAL - Calibration General A Side Register Element */ -#define ADC_CAL_GAR_CAL_GAR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GAR_CAL_GAR_VAL_SHIFT)) & ADC_CAL_GAR_CAL_GAR_VAL_MASK) /* Merged from fields with different position or width, of widths (11, 12, 13, 14, 15, 16), largest definition used */ -/*! @} */ - -/* The count of ADC_CAL_GAR */ -#define ADC_CAL_GAR_COUNT (33U) - -/*! @name CAL_GBR - Calibration General B-Side Registers */ -/*! @{ */ - -#define ADC_CAL_GBR_CAL_GBR_VAL_MASK (0xFFFFU) /* Merged from fields with different position or width, of widths (11, 12, 13, 14, 15, 16), largest definition used */ -#define ADC_CAL_GBR_CAL_GBR_VAL_SHIFT (0U) -/*! CAL_GBR_VAL - Calibration General B Side Register Element */ -#define ADC_CAL_GBR_CAL_GBR_VAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CAL_GBR_CAL_GBR_VAL_SHIFT)) & ADC_CAL_GBR_CAL_GBR_VAL_MASK) /* Merged from fields with different position or width, of widths (11, 12, 13, 14, 15, 16), largest definition used */ -/*! @} */ - -/* The count of ADC_CAL_GBR */ -#define ADC_CAL_GBR_COUNT (33U) - - -/*! - * @} - */ /* end of group ADC_Register_Masks */ - - -/* ADC - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral ADC0 base address */ - #define ADC0_BASE (0x5010D000u) - /** Peripheral ADC0 base address */ - #define ADC0_BASE_NS (0x4010D000u) - /** Peripheral ADC0 base pointer */ - #define ADC0 ((ADC_Type *)ADC0_BASE) - /** Peripheral ADC0 base pointer */ - #define ADC0_NS ((ADC_Type *)ADC0_BASE_NS) - /** Peripheral ADC1 base address */ - #define ADC1_BASE (0x5010E000u) - /** Peripheral ADC1 base address */ - #define ADC1_BASE_NS (0x4010E000u) - /** Peripheral ADC1 base pointer */ - #define ADC1 ((ADC_Type *)ADC1_BASE) - /** Peripheral ADC1 base pointer */ - #define ADC1_NS ((ADC_Type *)ADC1_BASE_NS) - /** Array initializer of ADC peripheral base addresses */ - #define ADC_BASE_ADDRS { ADC0_BASE, ADC1_BASE } - /** Array initializer of ADC peripheral base pointers */ - #define ADC_BASE_PTRS { ADC0, ADC1 } - /** Array initializer of ADC peripheral base addresses */ - #define ADC_BASE_ADDRS_NS { ADC0_BASE_NS, ADC1_BASE_NS } - /** Array initializer of ADC peripheral base pointers */ - #define ADC_BASE_PTRS_NS { ADC0_NS, ADC1_NS } -#else - /** Peripheral ADC0 base address */ - #define ADC0_BASE (0x4010D000u) - /** Peripheral ADC0 base pointer */ - #define ADC0 ((ADC_Type *)ADC0_BASE) - /** Peripheral ADC1 base address */ - #define ADC1_BASE (0x4010E000u) - /** Peripheral ADC1 base pointer */ - #define ADC1 ((ADC_Type *)ADC1_BASE) - /** Array initializer of ADC peripheral base addresses */ - #define ADC_BASE_ADDRS { ADC0_BASE, ADC1_BASE } - /** Array initializer of ADC peripheral base pointers */ - #define ADC_BASE_PTRS { ADC0, ADC1 } -#endif -/** Interrupt vectors for the ADC peripheral type */ -#define ADC_IRQS { ADC0_IRQn, ADC1_IRQn } - -/*! - * @} - */ /* end of group ADC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- AHBSC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup AHBSC_Peripheral_Access_Layer AHBSC Peripheral Access Layer - * @{ - */ - -/** AHBSC - Register Layout Typedef */ -typedef struct { - uint8_t RESERVED_0[16]; - __IO uint32_t FLASH00_MEM_RULE[4]; /**< Flash Memory Rule, array offset: 0x10, array step: 0x4 */ - __IO uint32_t FLASH01_MEM_RULE[4]; /**< Flash Memory Rule, array offset: 0x20, array step: 0x4 */ - __IO uint32_t FLASH02_MEM_RULE; /**< Flash Memory Rule, offset: 0x30 */ - uint8_t RESERVED_1[12]; - __IO uint32_t FLASH03_MEM_RULE; /**< Flash Memory Rule, offset: 0x40 */ - uint8_t RESERVED_2[28]; - __IO uint32_t ROM_MEM_RULE[4]; /**< ROM Memory Rule, array offset: 0x60, array step: 0x4 */ - uint8_t RESERVED_3[16]; - __IO uint32_t RAMX_MEM_RULE[3]; /**< RAMX Memory Rule, array offset: 0x80, array step: 0x4 */ - uint8_t RESERVED_4[20]; - __IO uint32_t RAMA_MEM_RULE; /**< RAMA Memory Rule 0, offset: 0xA0 */ - uint8_t RESERVED_5[28]; - __IO uint32_t RAMB_MEM_RULE; /**< RAMB Memory Rule, offset: 0xC0 */ - uint8_t RESERVED_6[28]; - __IO uint32_t RAMC_MEM_RULE[2]; /**< RAMC Memory Rule, array offset: 0xE0, array step: 0x4 */ - uint8_t RESERVED_7[24]; - __IO uint32_t RAMD_MEM_RULE[2]; /**< RAMD Memory Rule, array offset: 0x100, array step: 0x4 */ - uint8_t RESERVED_8[24]; - __IO uint32_t RAME_MEM_RULE[2]; /**< RAME Memory Rule, array offset: 0x120, array step: 0x4 */ - uint8_t RESERVED_9[24]; - __IO uint32_t RAMF_MEM_RULE[2]; /**< RAMF Memory Rule, array offset: 0x140, array step: 0x4 */ - uint8_t RESERVED_10[24]; - __IO uint32_t RAMG_MEM_RULE[2]; /**< RAMG Memory Rule, array offset: 0x160, array step: 0x4 */ - uint8_t RESERVED_11[24]; - __IO uint32_t RAMH_MEM_RULE; /**< RAMH Memory Rule, offset: 0x180 */ - uint8_t RESERVED_12[28]; - __IO uint32_t APB_PERIPHERAL_GROUP0_MEM_RULE0; /**< APB Bridge Group 0 Memory Rule 0, offset: 0x1A0 */ - __IO uint32_t APB_PERIPHERAL_GROUP0_MEM_RULE1; /**< APB Bridge Group 0 Memory Rule 1, offset: 0x1A4 */ - __IO uint32_t APB_PERIPHERAL_GROUP0_MEM_RULE2; /**< APB Bridge Group 0 Rule 2, offset: 0x1A8 */ - __IO uint32_t APB_PERIPHERAL_GROUP0_MEM_RULE3; /**< APB Bridge Group 0 Memory Rule 3, offset: 0x1AC */ - __IO uint32_t APB_PERIPHERAL_GROUP1_MEM_RULE0; /**< APB Bridge Group 1 Memory Rule 0, offset: 0x1B0 */ - __IO uint32_t APB_PERIPHERAL_GROUP1_MEM_RULE1; /**< APB Bridge Group 1 Memory Rule 1, offset: 0x1B4 */ - uint8_t RESERVED_13[4]; - __IO uint32_t APB_PERIPHERAL_GROUP1_MEM_RULE2; /**< APB Bridge Group 1 Memory Rule 2, offset: 0x1BC */ - __IO uint32_t AIPS_BRIDGE_GROUP0_MEM_RULE0; /**< AIPS Bridge Group 0 Memory Rule 0, offset: 0x1C0 */ - __IO uint32_t AIPS_BRIDGE_GROUP0_MEM_RULE1; /**< AIPS Bridge Group 0 Memory Rule 1, offset: 0x1C4 */ - __IO uint32_t AIPS_BRIDGE_GROUP0_MEM_RULE2; /**< AIPS Bridge Group 0 Memory Rule 2, offset: 0x1C8 */ - __IO uint32_t AIPS_BRIDGE_GROUP0_MEM_RULE3; /**< AIPS Bridge Group 0 Memory Rule 3, offset: 0x1CC */ - __IO uint32_t AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0; /**< AHB Peripheral 0 Slave Port 12 Slave Rule 0, offset: 0x1D0 */ - __IO uint32_t AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1; /**< AHB Peripheral 0 Slave Port 12 Slave Rule 1, offset: 0x1D4 */ - __IO uint32_t AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE2; /**< AHB Peripheral 0 Slave Port 12 Slave Rule 2, offset: 0x1D8 */ - uint8_t RESERVED_14[4]; - __IO uint32_t AIPS_BRIDGE_GROUP1_MEM_RULE0; /**< AIPS Bridge Group 1 Rule 0, offset: 0x1E0 */ - __IO uint32_t AIPS_BRIDGE_GROUP1_MEM_RULE1; /**< AIPS Bridge Group 1 Rule 1, offset: 0x1E4 */ - uint8_t RESERVED_15[8]; - __IO uint32_t AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0; /**< AHB Peripheral 1 Slave Port 13 Slave Rule 0, offset: 0x1F0 */ - __IO uint32_t AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1; /**< AHB Peripheral 1 Slave Port 13 Slave Rule 1, offset: 0x1F4 */ - __IO uint32_t AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE2; /**< AHB Peripheral 1 Slave Port 13 Slave Rule 2, offset: 0x1F8 */ - uint8_t RESERVED_16[4]; - __IO uint32_t AIPS_BRIDGE_GROUP2_MEM_RULE0; /**< AIPS Bridge Group 2 Rule 0, offset: 0x200 */ - __IO uint32_t AIPS_BRIDGE_GROUP2_MEM_RULE1; /**< AIPS Bridge Group 2 Memory Rule 1, offset: 0x204 */ - uint8_t RESERVED_17[24]; - __IO uint32_t AIPS_BRIDGE_GROUP3_MEM_RULE0; /**< AIPS Bridge Group 3 Rule 0, offset: 0x220 */ - __IO uint32_t AIPS_BRIDGE_GROUP3_MEM_RULE1; /**< AIPS Bridge Group 3 Memory Rule 1, offset: 0x224 */ - __IO uint32_t AIPS_BRIDGE_GROUP3_MEM_RULE2; /**< AIPS Bridge Group 3 Rule 2, offset: 0x228 */ - __IO uint32_t AIPS_BRIDGE_GROUP3_MEM_RULE3; /**< AIPS Bridge Group 3 Rule 3, offset: 0x22C */ - uint8_t RESERVED_18[16]; - __IO uint32_t AIPS_BRIDGE_GROUP4_MEM_RULE0; /**< AIPS Bridge Group 4 Rule 0, offset: 0x240 */ - __IO uint32_t AIPS_BRIDGE_GROUP4_MEM_RULE1; /**< AIPS Bridge Group 4 Rule 1, offset: 0x244 */ - __IO uint32_t AIPS_BRIDGE_GROUP4_MEM_RULE2; /**< AIPS Bridge Group 4 Rule 2, offset: 0x248 */ - __IO uint32_t AIPS_BRIDGE_GROUP4_MEM_RULE3; /**< AIPS Bridge Group 4 Rule 3, offset: 0x24C */ - __IO uint32_t AHB_SECURE_CTRL_PERIPHERAL_RULE0; /**< AHB Secure Control Peripheral Rule 0, offset: 0x250 */ - uint8_t RESERVED_19[28]; - __IO uint32_t FLEXSPI0_REGION0_MEM_RULE[4]; /**< FLEXSPI0 Region 0 Memory Rule, array offset: 0x270, array step: 0x4 */ - struct { /* offset: 0x280, array step: 0x10 */ - __IO uint32_t FLEXSPI0_REGION_MEM_RULE0; /**< FLEXSPI0 Region 1 Memory Rule 0..FLEXSPI0 Region 6 Memory Rule 0, array offset: 0x280, array step: 0x10 */ - uint8_t RESERVED_0[12]; - } FLEXSPI0_REGION1_6_MEM_RULE[6]; - __IO uint32_t FLEXSPI0_REGION7_MEM_RULE[4]; /**< FLEXSPI0 Region 7 Memory Rule, array offset: 0x2E0, array step: 0x4 */ - struct { /* offset: 0x2F0, array step: 0x10 */ - __IO uint32_t FLEXSPI0_REGION_MEM_RULE0; /**< FLEXSPI0 Region 8 Memory Rule 0..FLEXSPI0 Region 13 Memory Rule 0, array offset: 0x2F0, array step: 0x10 */ - uint8_t RESERVED_0[12]; - } FLEXSPI0_REGION8_13_MEM_RULE[6]; - uint8_t RESERVED_20[2736]; - __I uint32_t SEC_VIO_ADDR[32]; /**< Security Violation Address, array offset: 0xE00, array step: 0x4 */ - __I uint32_t SEC_VIO_MISC_INFO[32]; /**< Security Violation Miscellaneous Information at Address, array offset: 0xE80, array step: 0x4 */ - __IO uint32_t SEC_VIO_INFO_VALID; /**< Security Violation Info Validity for Address, offset: 0xF00 */ - uint8_t RESERVED_21[124]; - __IO uint32_t SEC_GPIO_MASK[2]; /**< GPIO Mask for Port 0..GPIO Mask for Port 1, array offset: 0xF80, array step: 0x4 */ - uint8_t RESERVED_22[16]; - __IO uint32_t SEC_CPU1_INT_MASK0; /**< Secure Interrupt Mask 0 for CPU1, offset: 0xF98 */ - __IO uint32_t SEC_CPU1_INT_MASK1; /**< Secure Interrupt Mask 1 for CPU1, offset: 0xF9C */ - __IO uint32_t SEC_CPU1_INT_MASK2; /**< Secure Interrupt Mask 2 for CPU1, offset: 0xFA0 */ - __IO uint32_t SEC_CPU1_INT_MASK3; /**< Secure Interrupt Mask 3 for CPU1, offset: 0xFA4 */ - __IO uint32_t SEC_CPU1_INT_MASK4; /**< Secure Interrupt Mask 4 for CPU1, offset: 0xFA8 */ - uint8_t RESERVED_23[16]; - __IO uint32_t SEC_GP_REG_LOCK; /**< Secure Mask Lock, offset: 0xFBC */ - uint8_t RESERVED_24[16]; - __IO uint32_t MASTER_SEC_LEVEL; /**< Master Secure Level, offset: 0xFD0 */ - __IO uint32_t MASTER_SEC_ANTI_POL_REG; /**< Master Secure Level, offset: 0xFD4 */ - uint8_t RESERVED_25[20]; - __IO uint32_t CPU0_LOCK_REG; /**< Miscellaneous CPU0 Control Signals, offset: 0xFEC */ - __IO uint32_t CPU1_LOCK_REG; /**< Miscellaneous CPU1 Control Signals, offset: 0xFF0 */ - uint8_t RESERVED_26[4]; - __IO uint32_t MISC_CTRL_DP_REG; /**< Secure Control Duplicate, offset: 0xFF8 */ - __IO uint32_t MISC_CTRL_REG; /**< Secure Control, offset: 0xFFC */ -} AHBSC_Type; - -/* ---------------------------------------------------------------------------- - -- AHBSC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup AHBSC_Register_Masks AHBSC Register Masks - * @{ - */ - -/*! @name FLASH00_MEM_RULE - Flash Memory Rule */ -/*! @{ */ - -#define AHBSC_FLASH00_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_FLASH00_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH00_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH00_MEM_RULE_RULE0_SHIFT)) & AHBSC_FLASH00_MEM_RULE_RULE0_MASK) - -#define AHBSC_FLASH00_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_FLASH00_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH00_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH00_MEM_RULE_RULE1_SHIFT)) & AHBSC_FLASH00_MEM_RULE_RULE1_MASK) - -#define AHBSC_FLASH00_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_FLASH00_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH00_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH00_MEM_RULE_RULE2_SHIFT)) & AHBSC_FLASH00_MEM_RULE_RULE2_MASK) - -#define AHBSC_FLASH00_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_FLASH00_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH00_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH00_MEM_RULE_RULE3_SHIFT)) & AHBSC_FLASH00_MEM_RULE_RULE3_MASK) - -#define AHBSC_FLASH00_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_FLASH00_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH00_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH00_MEM_RULE_RULE4_SHIFT)) & AHBSC_FLASH00_MEM_RULE_RULE4_MASK) - -#define AHBSC_FLASH00_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_FLASH00_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH00_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH00_MEM_RULE_RULE5_SHIFT)) & AHBSC_FLASH00_MEM_RULE_RULE5_MASK) - -#define AHBSC_FLASH00_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_FLASH00_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH00_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH00_MEM_RULE_RULE6_SHIFT)) & AHBSC_FLASH00_MEM_RULE_RULE6_MASK) - -#define AHBSC_FLASH00_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_FLASH00_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH00_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH00_MEM_RULE_RULE7_SHIFT)) & AHBSC_FLASH00_MEM_RULE_RULE7_MASK) -/*! @} */ - -/* The count of AHBSC_FLASH00_MEM_RULE */ -#define AHBSC_FLASH00_MEM_RULE_COUNT (4U) - -/*! @name FLASH01_MEM_RULE - Flash Memory Rule */ -/*! @{ */ - -#define AHBSC_FLASH01_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_FLASH01_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH01_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH01_MEM_RULE_RULE0_SHIFT)) & AHBSC_FLASH01_MEM_RULE_RULE0_MASK) - -#define AHBSC_FLASH01_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_FLASH01_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH01_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH01_MEM_RULE_RULE1_SHIFT)) & AHBSC_FLASH01_MEM_RULE_RULE1_MASK) - -#define AHBSC_FLASH01_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_FLASH01_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH01_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH01_MEM_RULE_RULE2_SHIFT)) & AHBSC_FLASH01_MEM_RULE_RULE2_MASK) - -#define AHBSC_FLASH01_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_FLASH01_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH01_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH01_MEM_RULE_RULE3_SHIFT)) & AHBSC_FLASH01_MEM_RULE_RULE3_MASK) - -#define AHBSC_FLASH01_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_FLASH01_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH01_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH01_MEM_RULE_RULE4_SHIFT)) & AHBSC_FLASH01_MEM_RULE_RULE4_MASK) - -#define AHBSC_FLASH01_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_FLASH01_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH01_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH01_MEM_RULE_RULE5_SHIFT)) & AHBSC_FLASH01_MEM_RULE_RULE5_MASK) - -#define AHBSC_FLASH01_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_FLASH01_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH01_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH01_MEM_RULE_RULE6_SHIFT)) & AHBSC_FLASH01_MEM_RULE_RULE6_MASK) - -#define AHBSC_FLASH01_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_FLASH01_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH01_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH01_MEM_RULE_RULE7_SHIFT)) & AHBSC_FLASH01_MEM_RULE_RULE7_MASK) -/*! @} */ - -/* The count of AHBSC_FLASH01_MEM_RULE */ -#define AHBSC_FLASH01_MEM_RULE_COUNT (4U) - -/*! @name FLASH02_MEM_RULE - Flash Memory Rule */ -/*! @{ */ - -#define AHBSC_FLASH02_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_FLASH02_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH02_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH02_MEM_RULE_RULE0_SHIFT)) & AHBSC_FLASH02_MEM_RULE_RULE0_MASK) - -#define AHBSC_FLASH02_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_FLASH02_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH02_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH02_MEM_RULE_RULE1_SHIFT)) & AHBSC_FLASH02_MEM_RULE_RULE1_MASK) - -#define AHBSC_FLASH02_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_FLASH02_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH02_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH02_MEM_RULE_RULE2_SHIFT)) & AHBSC_FLASH02_MEM_RULE_RULE2_MASK) - -#define AHBSC_FLASH02_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_FLASH02_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH02_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH02_MEM_RULE_RULE3_SHIFT)) & AHBSC_FLASH02_MEM_RULE_RULE3_MASK) -/*! @} */ - -/*! @name FLASH03_MEM_RULE - Flash Memory Rule */ -/*! @{ */ - -#define AHBSC_FLASH03_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_FLASH03_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH03_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH03_MEM_RULE_RULE0_SHIFT)) & AHBSC_FLASH03_MEM_RULE_RULE0_MASK) - -#define AHBSC_FLASH03_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_FLASH03_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH03_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH03_MEM_RULE_RULE1_SHIFT)) & AHBSC_FLASH03_MEM_RULE_RULE1_MASK) - -#define AHBSC_FLASH03_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_FLASH03_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH03_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH03_MEM_RULE_RULE2_SHIFT)) & AHBSC_FLASH03_MEM_RULE_RULE2_MASK) - -#define AHBSC_FLASH03_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_FLASH03_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH03_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH03_MEM_RULE_RULE3_SHIFT)) & AHBSC_FLASH03_MEM_RULE_RULE3_MASK) - -#define AHBSC_FLASH03_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_FLASH03_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH03_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH03_MEM_RULE_RULE4_SHIFT)) & AHBSC_FLASH03_MEM_RULE_RULE4_MASK) - -#define AHBSC_FLASH03_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_FLASH03_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH03_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH03_MEM_RULE_RULE5_SHIFT)) & AHBSC_FLASH03_MEM_RULE_RULE5_MASK) - -#define AHBSC_FLASH03_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_FLASH03_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH03_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH03_MEM_RULE_RULE6_SHIFT)) & AHBSC_FLASH03_MEM_RULE_RULE6_MASK) - -#define AHBSC_FLASH03_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_FLASH03_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLASH03_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLASH03_MEM_RULE_RULE7_SHIFT)) & AHBSC_FLASH03_MEM_RULE_RULE7_MASK) -/*! @} */ - -/*! @name ROM_MEM_RULE - ROM Memory Rule */ -/*! @{ */ - -#define AHBSC_ROM_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_ROM_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_ROM_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_ROM_MEM_RULE_RULE0_SHIFT)) & AHBSC_ROM_MEM_RULE_RULE0_MASK) - -#define AHBSC_ROM_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_ROM_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_ROM_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_ROM_MEM_RULE_RULE1_SHIFT)) & AHBSC_ROM_MEM_RULE_RULE1_MASK) - -#define AHBSC_ROM_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_ROM_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_ROM_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_ROM_MEM_RULE_RULE2_SHIFT)) & AHBSC_ROM_MEM_RULE_RULE2_MASK) - -#define AHBSC_ROM_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_ROM_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_ROM_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_ROM_MEM_RULE_RULE3_SHIFT)) & AHBSC_ROM_MEM_RULE_RULE3_MASK) - -#define AHBSC_ROM_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_ROM_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_ROM_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_ROM_MEM_RULE_RULE4_SHIFT)) & AHBSC_ROM_MEM_RULE_RULE4_MASK) - -#define AHBSC_ROM_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_ROM_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_ROM_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_ROM_MEM_RULE_RULE5_SHIFT)) & AHBSC_ROM_MEM_RULE_RULE5_MASK) - -#define AHBSC_ROM_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_ROM_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_ROM_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_ROM_MEM_RULE_RULE6_SHIFT)) & AHBSC_ROM_MEM_RULE_RULE6_MASK) - -#define AHBSC_ROM_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_ROM_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_ROM_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_ROM_MEM_RULE_RULE7_SHIFT)) & AHBSC_ROM_MEM_RULE_RULE7_MASK) -/*! @} */ - -/* The count of AHBSC_ROM_MEM_RULE */ -#define AHBSC_ROM_MEM_RULE_COUNT (4U) - -/*! @name RAMX_MEM_RULE0_RAMX_MEM_RULE - RAMX Memory Rule */ -/*! @{ */ - -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE0_SHIFT)) & AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE0_MASK) - -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE1_SHIFT)) & AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE1_MASK) - -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE2_SHIFT)) & AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE2_MASK) - -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE3_SHIFT)) & AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE3_MASK) - -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE4_SHIFT)) & AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE4_MASK) - -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE5_SHIFT)) & AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE5_MASK) - -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE6_SHIFT)) & AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE6_MASK) - -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE7_SHIFT)) & AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_RULE7_MASK) -/*! @} */ - -/* The count of AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE */ -#define AHBSC_RAMX_MEM_RULE0_RAMX_MEM_RULE_COUNT (3U) - -/*! @name RAMA_MEM_RULE - RAMA Memory Rule 0 */ -/*! @{ */ - -#define AHBSC_RAMA_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_RAMA_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMA_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMA_MEM_RULE_RULE0_SHIFT)) & AHBSC_RAMA_MEM_RULE_RULE0_MASK) - -#define AHBSC_RAMA_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_RAMA_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMA_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMA_MEM_RULE_RULE1_SHIFT)) & AHBSC_RAMA_MEM_RULE_RULE1_MASK) - -#define AHBSC_RAMA_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_RAMA_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMA_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMA_MEM_RULE_RULE2_SHIFT)) & AHBSC_RAMA_MEM_RULE_RULE2_MASK) - -#define AHBSC_RAMA_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_RAMA_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMA_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMA_MEM_RULE_RULE3_SHIFT)) & AHBSC_RAMA_MEM_RULE_RULE3_MASK) - -#define AHBSC_RAMA_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_RAMA_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMA_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMA_MEM_RULE_RULE4_SHIFT)) & AHBSC_RAMA_MEM_RULE_RULE4_MASK) - -#define AHBSC_RAMA_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_RAMA_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMA_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMA_MEM_RULE_RULE5_SHIFT)) & AHBSC_RAMA_MEM_RULE_RULE5_MASK) - -#define AHBSC_RAMA_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_RAMA_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMA_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMA_MEM_RULE_RULE6_SHIFT)) & AHBSC_RAMA_MEM_RULE_RULE6_MASK) - -#define AHBSC_RAMA_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_RAMA_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMA_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMA_MEM_RULE_RULE7_SHIFT)) & AHBSC_RAMA_MEM_RULE_RULE7_MASK) -/*! @} */ - -/*! @name RAMB_MEM_RULE - RAMB Memory Rule */ -/*! @{ */ - -#define AHBSC_RAMB_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_RAMB_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMB_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMB_MEM_RULE_RULE0_SHIFT)) & AHBSC_RAMB_MEM_RULE_RULE0_MASK) - -#define AHBSC_RAMB_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_RAMB_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMB_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMB_MEM_RULE_RULE1_SHIFT)) & AHBSC_RAMB_MEM_RULE_RULE1_MASK) - -#define AHBSC_RAMB_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_RAMB_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMB_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMB_MEM_RULE_RULE2_SHIFT)) & AHBSC_RAMB_MEM_RULE_RULE2_MASK) - -#define AHBSC_RAMB_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_RAMB_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMB_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMB_MEM_RULE_RULE3_SHIFT)) & AHBSC_RAMB_MEM_RULE_RULE3_MASK) - -#define AHBSC_RAMB_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_RAMB_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMB_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMB_MEM_RULE_RULE4_SHIFT)) & AHBSC_RAMB_MEM_RULE_RULE4_MASK) - -#define AHBSC_RAMB_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_RAMB_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMB_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMB_MEM_RULE_RULE5_SHIFT)) & AHBSC_RAMB_MEM_RULE_RULE5_MASK) - -#define AHBSC_RAMB_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_RAMB_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMB_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMB_MEM_RULE_RULE6_SHIFT)) & AHBSC_RAMB_MEM_RULE_RULE6_MASK) - -#define AHBSC_RAMB_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_RAMB_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMB_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMB_MEM_RULE_RULE7_SHIFT)) & AHBSC_RAMB_MEM_RULE_RULE7_MASK) -/*! @} */ - -/*! @name RAMC_MEM_RULE - RAMC Memory Rule */ -/*! @{ */ - -#define AHBSC_RAMC_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_RAMC_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMC_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMC_MEM_RULE_RULE0_SHIFT)) & AHBSC_RAMC_MEM_RULE_RULE0_MASK) - -#define AHBSC_RAMC_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_RAMC_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMC_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMC_MEM_RULE_RULE1_SHIFT)) & AHBSC_RAMC_MEM_RULE_RULE1_MASK) - -#define AHBSC_RAMC_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_RAMC_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMC_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMC_MEM_RULE_RULE2_SHIFT)) & AHBSC_RAMC_MEM_RULE_RULE2_MASK) - -#define AHBSC_RAMC_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_RAMC_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMC_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMC_MEM_RULE_RULE3_SHIFT)) & AHBSC_RAMC_MEM_RULE_RULE3_MASK) - -#define AHBSC_RAMC_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_RAMC_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMC_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMC_MEM_RULE_RULE4_SHIFT)) & AHBSC_RAMC_MEM_RULE_RULE4_MASK) - -#define AHBSC_RAMC_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_RAMC_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMC_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMC_MEM_RULE_RULE5_SHIFT)) & AHBSC_RAMC_MEM_RULE_RULE5_MASK) - -#define AHBSC_RAMC_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_RAMC_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMC_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMC_MEM_RULE_RULE6_SHIFT)) & AHBSC_RAMC_MEM_RULE_RULE6_MASK) - -#define AHBSC_RAMC_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_RAMC_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMC_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMC_MEM_RULE_RULE7_SHIFT)) & AHBSC_RAMC_MEM_RULE_RULE7_MASK) -/*! @} */ - -/* The count of AHBSC_RAMC_MEM_RULE */ -#define AHBSC_RAMC_MEM_RULE_COUNT (2U) - -/*! @name RAMD_MEM_RULE - RAMD Memory Rule */ -/*! @{ */ - -#define AHBSC_RAMD_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_RAMD_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMD_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMD_MEM_RULE_RULE0_SHIFT)) & AHBSC_RAMD_MEM_RULE_RULE0_MASK) - -#define AHBSC_RAMD_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_RAMD_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMD_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMD_MEM_RULE_RULE1_SHIFT)) & AHBSC_RAMD_MEM_RULE_RULE1_MASK) - -#define AHBSC_RAMD_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_RAMD_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMD_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMD_MEM_RULE_RULE2_SHIFT)) & AHBSC_RAMD_MEM_RULE_RULE2_MASK) - -#define AHBSC_RAMD_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_RAMD_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMD_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMD_MEM_RULE_RULE3_SHIFT)) & AHBSC_RAMD_MEM_RULE_RULE3_MASK) - -#define AHBSC_RAMD_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_RAMD_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMD_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMD_MEM_RULE_RULE4_SHIFT)) & AHBSC_RAMD_MEM_RULE_RULE4_MASK) - -#define AHBSC_RAMD_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_RAMD_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMD_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMD_MEM_RULE_RULE5_SHIFT)) & AHBSC_RAMD_MEM_RULE_RULE5_MASK) - -#define AHBSC_RAMD_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_RAMD_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMD_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMD_MEM_RULE_RULE6_SHIFT)) & AHBSC_RAMD_MEM_RULE_RULE6_MASK) - -#define AHBSC_RAMD_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_RAMD_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMD_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMD_MEM_RULE_RULE7_SHIFT)) & AHBSC_RAMD_MEM_RULE_RULE7_MASK) -/*! @} */ - -/* The count of AHBSC_RAMD_MEM_RULE */ -#define AHBSC_RAMD_MEM_RULE_COUNT (2U) - -/*! @name RAME_MEM_RULE - RAME Memory Rule */ -/*! @{ */ - -#define AHBSC_RAME_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_RAME_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAME_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAME_MEM_RULE_RULE0_SHIFT)) & AHBSC_RAME_MEM_RULE_RULE0_MASK) - -#define AHBSC_RAME_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_RAME_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAME_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAME_MEM_RULE_RULE1_SHIFT)) & AHBSC_RAME_MEM_RULE_RULE1_MASK) - -#define AHBSC_RAME_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_RAME_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAME_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAME_MEM_RULE_RULE2_SHIFT)) & AHBSC_RAME_MEM_RULE_RULE2_MASK) - -#define AHBSC_RAME_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_RAME_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAME_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAME_MEM_RULE_RULE3_SHIFT)) & AHBSC_RAME_MEM_RULE_RULE3_MASK) - -#define AHBSC_RAME_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_RAME_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAME_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAME_MEM_RULE_RULE4_SHIFT)) & AHBSC_RAME_MEM_RULE_RULE4_MASK) - -#define AHBSC_RAME_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_RAME_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAME_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAME_MEM_RULE_RULE5_SHIFT)) & AHBSC_RAME_MEM_RULE_RULE5_MASK) - -#define AHBSC_RAME_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_RAME_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAME_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAME_MEM_RULE_RULE6_SHIFT)) & AHBSC_RAME_MEM_RULE_RULE6_MASK) - -#define AHBSC_RAME_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_RAME_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAME_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAME_MEM_RULE_RULE7_SHIFT)) & AHBSC_RAME_MEM_RULE_RULE7_MASK) -/*! @} */ - -/* The count of AHBSC_RAME_MEM_RULE */ -#define AHBSC_RAME_MEM_RULE_COUNT (2U) - -/*! @name RAMF_MEM_RULE - RAMF Memory Rule */ -/*! @{ */ - -#define AHBSC_RAMF_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_RAMF_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMF_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMF_MEM_RULE_RULE0_SHIFT)) & AHBSC_RAMF_MEM_RULE_RULE0_MASK) - -#define AHBSC_RAMF_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_RAMF_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMF_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMF_MEM_RULE_RULE1_SHIFT)) & AHBSC_RAMF_MEM_RULE_RULE1_MASK) - -#define AHBSC_RAMF_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_RAMF_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMF_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMF_MEM_RULE_RULE2_SHIFT)) & AHBSC_RAMF_MEM_RULE_RULE2_MASK) - -#define AHBSC_RAMF_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_RAMF_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMF_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMF_MEM_RULE_RULE3_SHIFT)) & AHBSC_RAMF_MEM_RULE_RULE3_MASK) - -#define AHBSC_RAMF_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_RAMF_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMF_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMF_MEM_RULE_RULE4_SHIFT)) & AHBSC_RAMF_MEM_RULE_RULE4_MASK) - -#define AHBSC_RAMF_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_RAMF_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMF_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMF_MEM_RULE_RULE5_SHIFT)) & AHBSC_RAMF_MEM_RULE_RULE5_MASK) - -#define AHBSC_RAMF_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_RAMF_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMF_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMF_MEM_RULE_RULE6_SHIFT)) & AHBSC_RAMF_MEM_RULE_RULE6_MASK) - -#define AHBSC_RAMF_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_RAMF_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMF_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMF_MEM_RULE_RULE7_SHIFT)) & AHBSC_RAMF_MEM_RULE_RULE7_MASK) -/*! @} */ - -/* The count of AHBSC_RAMF_MEM_RULE */ -#define AHBSC_RAMF_MEM_RULE_COUNT (2U) - -/*! @name RAMG_MEM_RULE - RAMG Memory Rule */ -/*! @{ */ - -#define AHBSC_RAMG_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_RAMG_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMG_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMG_MEM_RULE_RULE0_SHIFT)) & AHBSC_RAMG_MEM_RULE_RULE0_MASK) - -#define AHBSC_RAMG_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_RAMG_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMG_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMG_MEM_RULE_RULE1_SHIFT)) & AHBSC_RAMG_MEM_RULE_RULE1_MASK) - -#define AHBSC_RAMG_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_RAMG_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMG_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMG_MEM_RULE_RULE2_SHIFT)) & AHBSC_RAMG_MEM_RULE_RULE2_MASK) - -#define AHBSC_RAMG_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_RAMG_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMG_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMG_MEM_RULE_RULE3_SHIFT)) & AHBSC_RAMG_MEM_RULE_RULE3_MASK) - -#define AHBSC_RAMG_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_RAMG_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMG_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMG_MEM_RULE_RULE4_SHIFT)) & AHBSC_RAMG_MEM_RULE_RULE4_MASK) - -#define AHBSC_RAMG_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_RAMG_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMG_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMG_MEM_RULE_RULE5_SHIFT)) & AHBSC_RAMG_MEM_RULE_RULE5_MASK) - -#define AHBSC_RAMG_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_RAMG_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMG_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMG_MEM_RULE_RULE6_SHIFT)) & AHBSC_RAMG_MEM_RULE_RULE6_MASK) - -#define AHBSC_RAMG_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_RAMG_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMG_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMG_MEM_RULE_RULE7_SHIFT)) & AHBSC_RAMG_MEM_RULE_RULE7_MASK) -/*! @} */ - -/* The count of AHBSC_RAMG_MEM_RULE */ -#define AHBSC_RAMG_MEM_RULE_COUNT (2U) - -/*! @name RAMH_MEM_RULE - RAMH Memory Rule */ -/*! @{ */ - -#define AHBSC_RAMH_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_RAMH_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMH_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMH_MEM_RULE_RULE0_SHIFT)) & AHBSC_RAMH_MEM_RULE_RULE0_MASK) - -#define AHBSC_RAMH_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_RAMH_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMH_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMH_MEM_RULE_RULE1_SHIFT)) & AHBSC_RAMH_MEM_RULE_RULE1_MASK) - -#define AHBSC_RAMH_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_RAMH_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMH_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMH_MEM_RULE_RULE2_SHIFT)) & AHBSC_RAMH_MEM_RULE_RULE2_MASK) - -#define AHBSC_RAMH_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_RAMH_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMH_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMH_MEM_RULE_RULE3_SHIFT)) & AHBSC_RAMH_MEM_RULE_RULE3_MASK) - -#define AHBSC_RAMH_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_RAMH_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMH_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMH_MEM_RULE_RULE4_SHIFT)) & AHBSC_RAMH_MEM_RULE_RULE4_MASK) - -#define AHBSC_RAMH_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_RAMH_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMH_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMH_MEM_RULE_RULE5_SHIFT)) & AHBSC_RAMH_MEM_RULE_RULE5_MASK) - -#define AHBSC_RAMH_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_RAMH_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMH_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMH_MEM_RULE_RULE6_SHIFT)) & AHBSC_RAMH_MEM_RULE_RULE6_MASK) - -#define AHBSC_RAMH_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_RAMH_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_RAMH_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_RAMH_MEM_RULE_RULE7_SHIFT)) & AHBSC_RAMH_MEM_RULE_RULE7_MASK) -/*! @} */ - -/*! @name APB_PERIPHERAL_GROUP0_MEM_RULE0 - APB Bridge Group 0 Memory Rule 0 */ -/*! @{ */ - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_SYSCON_MASK (0x3U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_SYSCON_SHIFT (0U) -/*! SYSCON - SYSCON - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_SYSCON(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_SYSCON_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_SYSCON_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_PINT0_MASK (0x30000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_PINT0_SHIFT (16U) -/*! PINT0 - PINT0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_PINT0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_PINT0_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_PINT0_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_INPUTMUX_MASK (0x3000000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_INPUTMUX_SHIFT (24U) -/*! INPUTMUX - INPUTMUX - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_INPUTMUX(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_INPUTMUX_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE0_INPUTMUX_MASK) -/*! @} */ - -/*! @name APB_PERIPHERAL_GROUP0_MEM_RULE1 - APB Bridge Group 0 Memory Rule 1 */ -/*! @{ */ - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER0_MASK (0x30000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER0_SHIFT (16U) -/*! CTIMER0 - CTIMER0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER0_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER0_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER1_MASK (0x300000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER1_SHIFT (20U) -/*! CTIMER1 - CTIMER1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER1_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER1_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER2_MASK (0x3000000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER2_SHIFT (24U) -/*! CTIMER2 - CTIMER2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER2_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER2_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER3_MASK (0x30000000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER3_SHIFT (28U) -/*! CTIMER3 - CTIMER3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER3_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE1_CTIMER3_MASK) -/*! @} */ - -/*! @name APB_PERIPHERAL_GROUP0_MEM_RULE2 - APB Bridge Group 0 Rule 2 */ -/*! @{ */ - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_CTIMER4_MASK (0x3U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_CTIMER4_SHIFT (0U) -/*! CTIMER4 - CTIMER4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_CTIMER4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_CTIMER4_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_CTIMER4_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_FREQME0_MASK (0x30U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_FREQME0_SHIFT (4U) -/*! FREQME0 - FREQME0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_FREQME0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_FREQME0_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_FREQME0_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_UTCIK0_MASK (0x300U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_UTCIK0_SHIFT (8U) -/*! UTCIK0 - UTCIK0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_UTCIK0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_UTCIK0_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_UTCIK0_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_MRT0_MASK (0x3000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_MRT0_SHIFT (12U) -/*! MRT0 - MRT0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_MRT0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_MRT0_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_MRT0_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_OSTIMER0_MASK (0x30000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_OSTIMER0_SHIFT (16U) -/*! OSTIMER0 - OSTIMER0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_OSTIMER0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_OSTIMER0_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_OSTIMER0_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_WWDT0_MASK (0x3000000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_WWDT0_SHIFT (24U) -/*! WWDT0 - WWDT0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_WWDT0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_WWDT0_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_WWDT0_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_WWDT1_MASK (0x30000000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_WWDT1_SHIFT (28U) -/*! WWDT1 - WWDT1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_WWDT1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_WWDT1_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE2_WWDT1_MASK) -/*! @} */ - -/*! @name APB_PERIPHERAL_GROUP0_MEM_RULE3 - APB Bridge Group 0 Memory Rule 3 */ -/*! @{ */ - -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE3_CACHE64_POLSEL0_MASK (0x3000U) -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE3_CACHE64_POLSEL0_SHIFT (12U) -/*! CACHE64_POLSEL0 - CACHE64_POLSEL0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE3_CACHE64_POLSEL0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE3_CACHE64_POLSEL0_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP0_MEM_RULE3_CACHE64_POLSEL0_MASK) -/*! @} */ - -/*! @name APB_PERIPHERAL_GROUP1_MEM_RULE0 - APB Bridge Group 1 Memory Rule 0 */ -/*! @{ */ - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_I3C0_MASK (0x30U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_I3C0_SHIFT (4U) -/*! I3C0 - I3C0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_I3C0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_I3C0_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_I3C0_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_I3C1_MASK (0x300U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_I3C1_SHIFT (8U) -/*! I3C1 - I3C1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_I3C1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_I3C1_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_I3C1_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_GDET_MASK (0x300000U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_GDET_SHIFT (20U) -/*! GDET - GDET - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_GDET(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_GDET_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_GDET_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_ITRC_MASK (0x3000000U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_ITRC_SHIFT (24U) -/*! ITRC - ITRC - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_ITRC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_ITRC_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE0_ITRC_MASK) -/*! @} */ - -/*! @name APB_PERIPHERAL_GROUP1_MEM_RULE1 - APB Bridge Group 1 Memory Rule 1 */ -/*! @{ */ - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PKC_MASK (0x3000U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PKC_SHIFT (12U) -/*! PKC - PKC - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PKC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PKC_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PKC_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS0_MASK (0x30000U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS0_SHIFT (16U) -/*! PUF_ALIAS0 - PUF_ALIAS0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS0_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS0_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS1_MASK (0x300000U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS1_SHIFT (20U) -/*! PUF_ALIAS1 - PUF_ALIAS1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS1_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS1_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS2_MASK (0x3000000U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS2_SHIFT (24U) -/*! PUF_ALIAS2 - PUF_ALIAS2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS2_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS2_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS3_MASK (0x30000000U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS3_SHIFT (28U) -/*! PUF_ALIAS3 - PUF_ALIAS3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS3_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE1_PUF_ALIAS3_MASK) -/*! @} */ - -/*! @name APB_PERIPHERAL_GROUP1_MEM_RULE2 - APB Bridge Group 1 Memory Rule 2 */ -/*! @{ */ - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_SM3_MASK (0x30U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_SM3_SHIFT (4U) -/*! SM3 - SM3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_SM3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_SM3_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_SM3_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_COOLFLUX_MASK (0x300U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_COOLFLUX_SHIFT (8U) -/*! COOLFLUX - COOLFLUX - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_COOLFLUX(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_COOLFLUX_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_COOLFLUX_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_SMARTDMA_MASK (0x3000U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_SMARTDMA_SHIFT (12U) -/*! SMARTDMA - SmartDMA - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_SMARTDMA(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_SMARTDMA_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_SMARTDMA_MASK) - -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_PLU_MASK (0x30000U) -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_PLU_SHIFT (16U) -/*! PLU - PLU - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_PLU(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_PLU_SHIFT)) & AHBSC_APB_PERIPHERAL_GROUP1_MEM_RULE2_PLU_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP0_MEM_RULE0 - AIPS Bridge Group 0 Memory Rule 0 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_GPIO5_ALIAS0_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_GPIO5_ALIAS0_SHIFT (0U) -/*! GPIO5_ALIAS0 - GPIO5_ALIAS0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_GPIO5_ALIAS0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_GPIO5_ALIAS0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_GPIO5_ALIAS0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_GPIO5_ALIAS1_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_GPIO5_ALIAS1_SHIFT (4U) -/*! GPIO5_ALIAS1 - GPIO5_ALIAS2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_GPIO5_ALIAS1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_GPIO5_ALIAS1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_GPIO5_ALIAS1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_PORT5_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_PORT5_SHIFT (8U) -/*! PORT5 - PORT5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_PORT5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_PORT5_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_PORT5_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_FMU0_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_FMU0_SHIFT (12U) -/*! FMU0 - FMU0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_FMU0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_FMU0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_FMU0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_SCG0_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_SCG0_SHIFT (16U) -/*! SCG0 - SCG0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_SCG0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_SCG0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_SCG0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_SPC0_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_SPC0_SHIFT (20U) -/*! SPC0 - SPC0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_SPC0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_SPC0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_SPC0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_WUU0_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_WUU0_SHIFT (24U) -/*! WUU0 - WUU0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_WUU0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_WUU0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_WUU0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_TRO0_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_TRO0_SHIFT (28U) -/*! TRO0 - TRO0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_TRO0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_TRO0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE0_TRO0_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP0_MEM_RULE1 - AIPS Bridge Group 0 Memory Rule 1 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_LPTMR0_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_LPTMR0_SHIFT (8U) -/*! LPTMR0 - LPTMR0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_LPTMR0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_LPTMR0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_LPTMR0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_LPTMR1_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_LPTMR1_SHIFT (12U) -/*! LPTMR1 - LPTMR1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_LPTMR1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_LPTMR1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_LPTMR1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_RTC_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_RTC_SHIFT (16U) -/*! RTC - RTC - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_RTC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_RTC_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_RTC_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_FMU_TEST_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_FMU_TEST_SHIFT (24U) -/*! FMU_TEST - FMU_TEST - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_FMU_TEST(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_FMU_TEST_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE1_FMU_TEST_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP0_MEM_RULE2 - AIPS Bridge Group 0 Memory Rule 2 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_TSI_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_TSI_SHIFT (0U) -/*! TSI - TSI - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_TSI(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_TSI_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_TSI_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP0_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP0_SHIFT (4U) -/*! CMP0 - CMP0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP1_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP1_SHIFT (8U) -/*! CMP1 - CMP1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP2_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP2_SHIFT (12U) -/*! CMP2 - CMP2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP2_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_CMP2_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_SHIFT (16U) -/*! ELS - ELS - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS1_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS1_SHIFT (20U) -/*! ELS_ALIAS1 - ELS_ALIAS1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS2_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS2_SHIFT (24U) -/*! ELS_ALIAS2 - ELS_ALIAS2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS2_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS2_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS3_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS3_SHIFT (28U) -/*! ELS_ALIAS3 - ELS_ALIAS3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS3_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE2_ELS_ALIAS3_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP0_MEM_RULE3 - AIPS Bridge Group 0 Memory Rule 3 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_DIGTMP_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_DIGTMP_SHIFT (0U) -/*! DIGTMP - DIGTMP - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_DIGTMP(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_DIGTMP_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_DIGTMP_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_VBAT_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_VBAT_SHIFT (4U) -/*! VBAT - VBAT - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_VBAT(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_VBAT_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_VBAT_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_TRNG_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_TRNG_SHIFT (8U) -/*! TRNG - TRNG - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_TRNG(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_TRNG_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_TRNG_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_EIM0_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_EIM0_SHIFT (12U) -/*! EIM0 - EIM0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_EIM0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_EIM0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_EIM0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_ERM0_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_ERM0_SHIFT (16U) -/*! ERM0 - ERM0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_ERM0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_ERM0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_ERM0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_INTM0_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_INTM0_SHIFT (20U) -/*! INTM0 - INTM0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_INTM0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_INTM0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP0_MEM_RULE3_INTM0_MASK) -/*! @} */ - -/*! @name AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0 - AHB Peripheral 0 Slave Port 12 Slave Rule 0 */ -/*! @{ */ - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_EDMA0_CH15_MASK (0x30U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_EDMA0_CH15_SHIFT (4U) -/*! eDMA0_CH15 - eDMA0_CH15 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_EDMA0_CH15(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_EDMA0_CH15_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_EDMA0_CH15_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_SCT0_MASK (0x300U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_SCT0_SHIFT (8U) -/*! SCT0 - SCT0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_SCT0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_SCT0_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_SCT0_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM0_MASK (0x3000U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM0_SHIFT (12U) -/*! LP_FLEXCOMM0 - LP_FLEXCOMM0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM0_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM0_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM1_MASK (0x30000U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM1_SHIFT (16U) -/*! LP_FLEXCOMM1 - LP_FLEXCOMM1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM1_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM1_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM2_MASK (0x300000U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM2_SHIFT (20U) -/*! LP_FLEXCOMM2 - LP_FLEXCOMM2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM2_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM2_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM3_MASK (0x3000000U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM3_SHIFT (24U) -/*! LP_FLEXCOMM3 - LP_FLEXCOMM3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM3_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_LP_FLEXCOMM3_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_GPIO0_ALIAS0_MASK (0x30000000U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_GPIO0_ALIAS0_SHIFT (28U) -/*! GPIO0_ALIAS0 - GPIO0_ALIAS0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_GPIO0_ALIAS0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_GPIO0_ALIAS0_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE0_GPIO0_ALIAS0_MASK) -/*! @} */ - -/*! @name AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1 - AHB Peripheral 0 Slave Port 12 Slave Rule 1 */ -/*! @{ */ - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO0_ALIAS1_MASK (0x3U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO0_ALIAS1_SHIFT (0U) -/*! GPIO0_ALIAS1 - GPIO0_ALIAS1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO0_ALIAS1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO0_ALIAS1_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO0_ALIAS1_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO1_ALIAS0_MASK (0x30U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO1_ALIAS0_SHIFT (4U) -/*! GPIO1_ALIAS0 - GPIO1_ALIAS0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO1_ALIAS0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO1_ALIAS0_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO1_ALIAS0_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO1_ALIAS1_MASK (0x300U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO1_ALIAS1_SHIFT (8U) -/*! GPIO1_ALIAS1 - GPIO1_ALIAS1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO1_ALIAS1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO1_ALIAS1_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO1_ALIAS1_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO2_ALIAS0_MASK (0x3000U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO2_ALIAS0_SHIFT (12U) -/*! GPIO2_ALIAS0 - GPIO2_ALIAS0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO2_ALIAS0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO2_ALIAS0_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO2_ALIAS0_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO2_ALIAS1_MASK (0x30000U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO2_ALIAS1_SHIFT (16U) -/*! GPIO2_ALIAS1 - GPIO2_ALIAS1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO2_ALIAS1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO2_ALIAS1_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO2_ALIAS1_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO3_ALIAS0_MASK (0x300000U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO3_ALIAS0_SHIFT (20U) -/*! GPIO3_ALIAS0 - GPIO3_ALIAS0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO3_ALIAS0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO3_ALIAS0_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO3_ALIAS0_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO3_ALIAS1_MASK (0x3000000U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO3_ALIAS1_SHIFT (24U) -/*! GPIO3_ALIAS1 - GPIO3_ALIAS1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO3_ALIAS1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO3_ALIAS1_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO3_ALIAS1_MASK) - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO4_ALIAS0_MASK (0x30000000U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO4_ALIAS0_SHIFT (28U) -/*! GPIO4_ALIAS0 - GPIO4_ALIAS0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO4_ALIAS0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO4_ALIAS0_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE1_GPIO4_ALIAS0_MASK) -/*! @} */ - -/*! @name AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE2 - AHB Peripheral 0 Slave Port 12 Slave Rule 2 */ -/*! @{ */ - -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE2_GPIO4_ALIAS1_MASK (0x3U) -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE2_GPIO4_ALIAS1_SHIFT (0U) -/*! GPIO4_ALIAS1 - GPIO4_ALIAS1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE2_GPIO4_ALIAS1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE2_GPIO4_ALIAS1_SHIFT)) & AHBSC_AHB_PERIPHERAL0_SLAVE_PORT_P12_SLAVE_RULE2_GPIO4_ALIAS1_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP1_MEM_RULE0 - AIPS Bridge Group 1 Rule 0 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_MP_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_MP_SHIFT (0U) -/*! eDMA0_MP - eDMA0_MP - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_MP(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_MP_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_MP_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH0_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH0_SHIFT (4U) -/*! eDMA0_CH0 - eDMA0_CH0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH1_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH1_SHIFT (8U) -/*! eDMA0_CH1 - eDMA0_CH1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH2_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH2_SHIFT (12U) -/*! eDMA0_CH2 - eDMA0_CH2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH2_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH2_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH3_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH3_SHIFT (16U) -/*! eDMA0_CH3 - FLEXSPI0 Registers - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH3_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH3_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH4_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH4_SHIFT (20U) -/*! eDMA0_CH4 - eDMA0_CH4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH4_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH4_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH5_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH5_SHIFT (24U) -/*! eDMA0_CH5 - eDMA0_CH5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH5_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH5_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH6_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH6_SHIFT (28U) -/*! eDMA0_CH6 - eDMA0_CH6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH6_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE0_EDMA0_CH6_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP1_MEM_RULE1 - AIPS Bridge Group 1 Rule 1 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH7_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH7_SHIFT (0U) -/*! eDMA0_CH7 - eDMA0_CH7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH7_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH7_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH8_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH8_SHIFT (4U) -/*! eDMA0_CH8 - eDMA0_CH8 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH8(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH8_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH8_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH9_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH9_SHIFT (8U) -/*! eDMA0_CH9 - eDMA0_CH9 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH9(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH9_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH9_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH10_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH10_SHIFT (12U) -/*! eDMA0_CH10 - eDMA0_CH10 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH10(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH10_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH10_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH11_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH11_SHIFT (16U) -/*! eDMA0_CH11 - FLEXSPI0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH11(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH11_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH11_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH12_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH12_SHIFT (20U) -/*! eDMA0_CH12 - eDMA0_CH12 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH12(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH12_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH12_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH13_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH13_SHIFT (24U) -/*! eDMA0_CH13 - eDMA0_CH13 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH13(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH13_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH13_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH14_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH14_SHIFT (28U) -/*! eDMA0_CH14 - eDMA0_CH14 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH14(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH14_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP1_MEM_RULE1_EDMA0_CH14_MASK) -/*! @} */ - -/*! @name AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0 - AHB Peripheral 1 Slave Port 13 Slave Rule 0 */ -/*! @{ */ - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_EDMA1_CH15_MASK (0x30U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_EDMA1_CH15_SHIFT (4U) -/*! eDMA1_CH15 - eDMA1_CH15 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_EDMA1_CH15(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_EDMA1_CH15_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_EDMA1_CH15_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_SEMA42_MASK (0x300U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_SEMA42_SHIFT (8U) -/*! SEMA42 - SEMA42 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_SEMA42(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_SEMA42_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_SEMA42_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_MAILBOX_MASK (0x3000U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_MAILBOX_SHIFT (12U) -/*! MAILBOX - MAILBOX - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_MAILBOX(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_MAILBOX_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_MAILBOX_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_PKC_RAM_MASK (0x30000U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_PKC_RAM_SHIFT (16U) -/*! PKC_RAM - PKC_RAM - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_PKC_RAM(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_PKC_RAM_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_PKC_RAM_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM4_MASK (0x300000U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM4_SHIFT (20U) -/*! FLEXCOMM4 - FLEXCOMM4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM4_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM4_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM5_MASK (0x3000000U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM5_SHIFT (24U) -/*! FLEXCOMM5 - FLEXCOMM5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM5_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM5_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM6_MASK (0x30000000U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM6_SHIFT (28U) -/*! FLEXCOMM6 - FLEXCOMM6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM6_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE0_FLEXCOMM6_MASK) -/*! @} */ - -/*! @name AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1 - AHB Peripheral 1 Slave Port 13 Slave Rule 1 */ -/*! @{ */ - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM7_MASK (0x3U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM7_SHIFT (0U) -/*! FLEXCOMM7 - FLEXCOMM7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM7_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM7_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM8_MASK (0x30U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM8_SHIFT (4U) -/*! FLEXCOMM8 - FLEXCOMM8 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM8(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM8_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM8_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM9_MASK (0x300U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM9_SHIFT (8U) -/*! FLEXCOMM9 - FLEXCOMM9 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM9(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM9_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_FLEXCOMM9_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_USB_FS_OTG_RAM_MASK (0x3000U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_USB_FS_OTG_RAM_SHIFT (12U) -/*! USB_FS_OTG_RAM - USB FS OTG RAM - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_USB_FS_OTG_RAM(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_USB_FS_OTG_RAM_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_USB_FS_OTG_RAM_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_CDOG0_MASK (0x30000U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_CDOG0_SHIFT (16U) -/*! CDOG0 - CDOG0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_CDOG0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_CDOG0_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_CDOG0_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_CDOG1_MASK (0x300000U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_CDOG1_SHIFT (20U) -/*! CDOG1 - CDOG1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_CDOG1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_CDOG1_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_CDOG1_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_DEBUG_MAILBOX_MASK (0x3000000U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_DEBUG_MAILBOX_SHIFT (24U) -/*! DEBUG_MAILBOX - DEBUG_MAILBOX - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_DEBUG_MAILBOX(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_DEBUG_MAILBOX_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_DEBUG_MAILBOX_MASK) - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_NPU_MASK (0x30000000U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_NPU_SHIFT (28U) -/*! NPU - NPU - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_NPU(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_NPU_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE1_NPU_MASK) -/*! @} */ - -/*! @name AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE2 - AHB Peripheral 1 Slave Port 13 Slave Rule 2 */ -/*! @{ */ - -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE2_POWERQUAD_MASK (0x3U) -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE2_POWERQUAD_SHIFT (0U) -/*! POWERQUAD - POWERQUAD - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE2_POWERQUAD(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE2_POWERQUAD_SHIFT)) & AHBSC_AHB_PERIPHERAL1_SLAVE_PORT_P13_SLAVE_RULE2_POWERQUAD_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP2_MEM_RULE0 - AIPS Bridge Group 2 Rule 0 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_MP_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_MP_SHIFT (0U) -/*! eDMA1_MP - eDMA1_MP - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_MP(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_MP_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_MP_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH0_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH0_SHIFT (4U) -/*! eDMA1_CH0 - eDMA1_CH0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH1_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH1_SHIFT (8U) -/*! eDMA1_CH1 - eDMA1_CH1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH2_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH2_SHIFT (12U) -/*! eDMA1_CH2 - eDMA1_CH2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH2_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH2_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH3_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH3_SHIFT (16U) -/*! eDMA1_CH3 - eDMA1_CH3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH3_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH3_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH4_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH4_SHIFT (20U) -/*! eDMA1_CH4 - eDMA1_CH4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH4_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH4_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH5_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH5_SHIFT (24U) -/*! eDMA1_CH5 - eDMA1_CH5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH5_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH5_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH6_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH6_SHIFT (28U) -/*! eDMA1_CH6 - eDMA1_CH6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH6_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE0_EDMA1_CH6_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP2_MEM_RULE1 - AIPS Bridge Group 2 Memory Rule 1 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH7_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH7_SHIFT (0U) -/*! eDMA1_CH7 - eDMA1_CH7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH7_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH7_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH8_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH8_SHIFT (4U) -/*! eDMA1_CH8 - eDMA1_CH8 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH8(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH8_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH8_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH9_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH9_SHIFT (8U) -/*! eDMA1_CH9 - eDMA1_CH9 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH9(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH9_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH9_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH10_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH10_SHIFT (12U) -/*! eDMA1_CH10 - eDMA1_CH10 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH10(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH10_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH10_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH11_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH11_SHIFT (16U) -/*! eDMA1_CH11 - eDMA1_CH11 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH11(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH11_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH11_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH12_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH12_SHIFT (20U) -/*! eDMA1_CH12 - eDMA1_CH12 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH12(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH12_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH12_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH13_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH13_SHIFT (24U) -/*! eDMA1_CH13 - eDMA1_CH13 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH13(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH13_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH13_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH14_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH14_SHIFT (28U) -/*! eDMA1_CH14 - eDMA1_CH14 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH14(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH14_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP2_MEM_RULE1_EDMA1_CH14_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP3_MEM_RULE0 - AIPS Bridge Group 3 Rule 0 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_EWM0_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_EWM0_SHIFT (0U) -/*! EWM0 - EWM0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_EWM0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_EWM0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_EWM0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_LPCAC_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_LPCAC_SHIFT (4U) -/*! LPCAC - LPCAC - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_LPCAC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_LPCAC_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_LPCAC_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_FLEXSPI_CMX_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_FLEXSPI_CMX_SHIFT (8U) -/*! FLEXSPI_CMX - FLEXSPI_CMX - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_FLEXSPI_CMX(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_FLEXSPI_CMX_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_FLEXSPI_CMX_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_SFA_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_SFA_SHIFT (20U) -/*! SFA - SFA - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_SFA(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_SFA_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_SFA_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_MBC_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_MBC_SHIFT (28U) -/*! MBC - MBC - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_MBC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_MBC_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE0_MBC_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP3_MEM_RULE1 - AIPS Bridge Group 3 Memory Rule 1 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_FLEXSPI_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_FLEXSPI_SHIFT (0U) -/*! FLEXSPI - FLEXSPI - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_FLEXSPI(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_FLEXSPI_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_FLEXSPI_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_OTPC_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_OTPC_SHIFT (4U) -/*! OTPC - OTPC - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_OTPC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_OTPC_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_OTPC_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_CRC_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_CRC_SHIFT (12U) -/*! CRC - CRC - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_CRC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_CRC_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_CRC_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_NPX_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_NPX_SHIFT (16U) -/*! NPX - NPX - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_NPX(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_NPX_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_NPX_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_PWM_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_PWM_SHIFT (24U) -/*! PWM - PWM - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_PWM(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_PWM_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_PWM_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_ENC_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_ENC_SHIFT (28U) -/*! ENC - ENC - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_ENC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_ENC_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE1_ENC_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP3_MEM_RULE2 - AIPS Bridge Group 3 Rule 2 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_PWM1_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_PWM1_SHIFT (0U) -/*! PWM1 - PWM1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_PWM1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_PWM1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_PWM1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_ENC1_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_ENC1_SHIFT (4U) -/*! ENC1 - ENC1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_ENC1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_ENC1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_ENC1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_EVTG_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_EVTG_SHIFT (8U) -/*! EVTG - EVTG - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_EVTG(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_EVTG_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_EVTG_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE0_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE0_SHIFT (16U) -/*! CAN0_RULE0 - CAN0 RULE0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE1_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE1_SHIFT (20U) -/*! CAN0_RULE1 - CAN0 RULE1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE2_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE2_SHIFT (24U) -/*! CAN0_RULE2 - CAN0 RULE2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE2_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE2_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE3_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE3_SHIFT (28U) -/*! CAN0_RULE3 - CAN0 RULE3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE3_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE2_CAN0_RULE3_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP3_MEM_RULE3 - AIPS Bridge Group 3 Rule 3 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE0_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE0_SHIFT (0U) -/*! CAN1_RULE0 - CAN1 RULE0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE1_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE1_SHIFT (4U) -/*! CAN1_RULE1 - CAN1 RULE1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE2_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE2_SHIFT (8U) -/*! CAN1_RULE2 - CAN1 RULE2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE2_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE2_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE3_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE3_SHIFT (12U) -/*! CAN1_RULE3 - CAN1 RULE3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE3_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_CAN1_RULE3_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_USBDCD_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_USBDCD_SHIFT (16U) -/*! USBDCD - USBDCD - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_USBDCD(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_USBDCD_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_USBDCD_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_USBFS_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_USBFS_SHIFT (20U) -/*! USBFS - USBFS - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_USBFS(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_USBFS_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP3_MEM_RULE3_USBFS_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP4_MEM_RULE0 - AIPS Bridge Group 4 Rule 0 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_ENET_MASK (0xFU) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_ENET_SHIFT (0U) -/*! ENET - ENET - * 0b0000..Non-secure and non-privilege user access allowed - * 0b0001..Non-secure and privilege access allowed - * 0b0010..Secure and non-privilege user access allowed - * 0b0011..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_ENET(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_ENET_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_ENET_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_EMVSIM0_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_EMVSIM0_SHIFT (12U) -/*! EMVSIM0 - EMVSIM0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_EMVSIM0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_EMVSIM0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_EMVSIM0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_EMVSIM1_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_EMVSIM1_SHIFT (16U) -/*! EMVSIM1 - EMVSIM1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_EMVSIM1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_EMVSIM1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_EMVSIM1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_FLEXIO_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_FLEXIO_SHIFT (20U) -/*! FLEXIO - FLEXIO - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_FLEXIO(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_FLEXIO_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_FLEXIO_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_SAI0_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_SAI0_SHIFT (24U) -/*! SAI0 - SAI0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_SAI0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_SAI0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_SAI0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_SAI1_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_SAI1_SHIFT (28U) -/*! SAI1 - SAI1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_SAI1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_SAI1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE0_SAI1_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP4_MEM_RULE1 - AIPS Bridge Group 4 Rule 1 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_SINC0_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_SINC0_SHIFT (0U) -/*! SINC0 - SINC0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_SINC0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_SINC0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_SINC0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USDHC0_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USDHC0_SHIFT (4U) -/*! uSDHC0 - uSDHC0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USDHC0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USDHC0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USDHC0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USBHSPHY_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USBHSPHY_SHIFT (8U) -/*! USBHSPHY - USBHSPHY - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USBHSPHY(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USBHSPHY_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USBHSPHY_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USBHS_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USBHS_SHIFT (12U) -/*! USBHS - USBHS - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USBHS(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USBHS_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_USBHS_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_MICD_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_MICD_SHIFT (16U) -/*! MICD - MICD - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_MICD(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_MICD_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_MICD_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_ADC0_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_ADC0_SHIFT (20U) -/*! ADC0 - ADC0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_ADC0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_ADC0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_ADC0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_ADC1_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_ADC1_SHIFT (24U) -/*! ADC1 - ADC1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_ADC1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_ADC1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_ADC1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_DAC0_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_DAC0_SHIFT (28U) -/*! DAC0 - DAC0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_DAC0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_DAC0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE1_DAC0_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP4_MEM_RULE2 - AIPS Bridge Group 4 Rule 2 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP0_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP0_SHIFT (0U) -/*! OPAMP0 - OPAMP0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_VREF_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_VREF_SHIFT (4U) -/*! VREF - VREF - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_VREF(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_VREF_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_VREF_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_DAC_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_DAC_SHIFT (8U) -/*! DAC - DAC - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_DAC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_DAC_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_DAC_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP1_MASK (0x3000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP1_SHIFT (12U) -/*! OPAMP1 - OPAMP1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP1_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_HPDAC0_MASK (0x30000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_HPDAC0_SHIFT (16U) -/*! HPDAC0 - HPDAC0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_HPDAC0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_HPDAC0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_HPDAC0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP2_MASK (0x300000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP2_SHIFT (20U) -/*! OPAMP2 - OPAMP2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP2_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_OPAMP2_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_PORT0_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_PORT0_SHIFT (24U) -/*! PORT0 - PORT0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_PORT0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_PORT0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_PORT0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_PORT1_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_PORT1_SHIFT (28U) -/*! PORT1 - PORT1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_PORT1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_PORT1_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE2_PORT1_MASK) -/*! @} */ - -/*! @name AIPS_BRIDGE_GROUP4_MEM_RULE3 - AIPS Bridge Group 4 Rule 3 */ -/*! @{ */ - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT2_MASK (0x3U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT2_SHIFT (0U) -/*! PORT2 - PORT2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT2_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT2_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT3_MASK (0x30U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT3_SHIFT (4U) -/*! PORT3 - PORT3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT3_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT3_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT4_MASK (0x300U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT4_SHIFT (8U) -/*! PORT4 - PORT4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT4_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_PORT4_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_MTR0_MASK (0x3000000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_MTR0_SHIFT (24U) -/*! MTR0 - MTR0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_MTR0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_MTR0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_MTR0_MASK) - -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_ATX0_MASK (0x30000000U) -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_ATX0_SHIFT (28U) -/*! ATX0 - ATX0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_ATX0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_ATX0_SHIFT)) & AHBSC_AIPS_BRIDGE_GROUP4_MEM_RULE3_ATX0_MASK) -/*! @} */ - -/*! @name AHB_SECURE_CTRL_PERIPHERAL_RULE0 - AHB Secure Control Peripheral Rule 0 */ -/*! @{ */ - -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE0_MASK (0x3U) -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE0_SHIFT)) & AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE0_MASK) - -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE1_MASK (0x30U) -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE1_SHIFT)) & AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE1_MASK) - -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE2_MASK (0x300U) -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE2_SHIFT)) & AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE2_MASK) - -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE3_MASK (0x3000U) -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE3_SHIFT)) & AHBSC_AHB_SECURE_CTRL_PERIPHERAL_RULE0_RULE3_MASK) -/*! @} */ - -/*! @name FLEXSPI0_REGION0_MEM_RULE - FLEXSPI0 Region 0 Memory Rule */ -/*! @{ */ - -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE0_SHIFT)) & AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE0_MASK) - -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE1_SHIFT)) & AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE1_MASK) - -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE2_SHIFT)) & AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE2_MASK) - -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE3_SHIFT)) & AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE3_MASK) - -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE4_SHIFT)) & AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE4_MASK) - -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE5_SHIFT)) & AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE5_MASK) - -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE6_SHIFT)) & AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE6_MASK) - -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE7_SHIFT)) & AHBSC_FLEXSPI0_REGION0_MEM_RULE_RULE7_MASK) -/*! @} */ - -/* The count of AHBSC_FLEXSPI0_REGION0_MEM_RULE */ -#define AHBSC_FLEXSPI0_REGION0_MEM_RULE_COUNT (4U) - -/*! @name FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0 - FLEXSPI0 Region 1 Memory Rule 0..FLEXSPI0 Region 6 Memory Rule 0 */ -/*! @{ */ - -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE0_MASK (0x3U) -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE0_SHIFT)) & AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE0_MASK) - -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE1_MASK (0x30U) -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE1_SHIFT)) & AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE1_MASK) - -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE2_MASK (0x300U) -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE2_SHIFT)) & AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE2_MASK) - -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE3_MASK (0x3000U) -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE3_SHIFT)) & AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE3_MASK) - -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE4_MASK (0x30000U) -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE4_SHIFT)) & AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE4_MASK) - -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE5_MASK (0x300000U) -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE5_SHIFT)) & AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE5_MASK) -/*! @} */ - -/* The count of AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0 */ -#define AHBSC_FLEXSPI0_REGION1_6_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_COUNT (6U) - -/*! @name FLEXSPI0_REGION7_MEM_RULE - FLEXSPI0 Region 7 Memory Rule */ -/*! @{ */ - -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE0_MASK (0x3U) -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE0_SHIFT)) & AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE0_MASK) - -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE1_MASK (0x30U) -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE1_SHIFT)) & AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE1_MASK) - -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE2_MASK (0x300U) -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE2_SHIFT)) & AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE2_MASK) - -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE3_MASK (0x3000U) -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE3_SHIFT)) & AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE3_MASK) - -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE4_MASK (0x30000U) -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE4_SHIFT)) & AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE4_MASK) - -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE5_MASK (0x300000U) -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE5_SHIFT)) & AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE5_MASK) - -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE6_MASK (0x3000000U) -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE6_SHIFT (24U) -/*! RULE6 - Rule 6 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE6_SHIFT)) & AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE6_MASK) - -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE7_MASK (0x30000000U) -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE7_SHIFT (28U) -/*! RULE7 - Rule 7 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE7_SHIFT)) & AHBSC_FLEXSPI0_REGION7_MEM_RULE_RULE7_MASK) -/*! @} */ - -/* The count of AHBSC_FLEXSPI0_REGION7_MEM_RULE */ -#define AHBSC_FLEXSPI0_REGION7_MEM_RULE_COUNT (4U) - -/*! @name FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0 - FLEXSPI0 Region 8 Memory Rule 0..FLEXSPI0 Region 13 Memory Rule 0 */ -/*! @{ */ - -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE0_MASK (0x3U) -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE0_SHIFT (0U) -/*! RULE0 - Rule 0 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE0_SHIFT)) & AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE0_MASK) - -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE1_MASK (0x30U) -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE1_SHIFT (4U) -/*! RULE1 - Rule 1 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE1_SHIFT)) & AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE1_MASK) - -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE2_MASK (0x300U) -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE2_SHIFT (8U) -/*! RULE2 - Rule 2 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE2_SHIFT)) & AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE2_MASK) - -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE3_MASK (0x3000U) -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE3_SHIFT (12U) -/*! RULE3 - Rule 3 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE3_SHIFT)) & AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE3_MASK) - -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE4_MASK (0x30000U) -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE4_SHIFT (16U) -/*! RULE4 - Rule 4 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE4_SHIFT)) & AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE4_MASK) - -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE5_MASK (0x300000U) -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE5_SHIFT (20U) -/*! RULE5 - Rule 5 - * 0b00..Non-secure and non-privilege user access allowed - * 0b01..Non-secure and privilege access allowed - * 0b10..Secure and non-privilege user access allowed - * 0b11..Secure and privilege user access allowed - */ -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE5_SHIFT)) & AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_RULE5_MASK) -/*! @} */ - -/* The count of AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0 */ -#define AHBSC_FLEXSPI0_REGION8_13_MEM_RULE_FLEXSPI0_REGION_MEM_RULE0_COUNT (6U) - -/*! @name SEC_VIO_ADDRN_SEC_VIO_ADDR - Security Violation Address */ -/*! @{ */ - -#define AHBSC_SEC_VIO_ADDRN_SEC_VIO_ADDR_SEC_VIO_ADDR_MASK (0xFFFFFFFFU) -#define AHBSC_SEC_VIO_ADDRN_SEC_VIO_ADDR_SEC_VIO_ADDR_SHIFT (0U) -/*! SEC_VIO_ADDR - Security violation address for AHB layer a reset value 0 */ -#define AHBSC_SEC_VIO_ADDRN_SEC_VIO_ADDR_SEC_VIO_ADDR(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_ADDRN_SEC_VIO_ADDR_SEC_VIO_ADDR_SHIFT)) & AHBSC_SEC_VIO_ADDRN_SEC_VIO_ADDR_SEC_VIO_ADDR_MASK) -/*! @} */ - -/* The count of AHBSC_SEC_VIO_ADDRN_SEC_VIO_ADDR */ -#define AHBSC_SEC_VIO_ADDRN_SEC_VIO_ADDR_COUNT (32U) - -/*! @name SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO - Security Violation Miscellaneous Information at Address */ -/*! @{ */ - -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_WRITE_MASK (0x1U) -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_WRITE_SHIFT (0U) -/*! SEC_VIO_INFO_WRITE - Security violation access read/write indicator - * 0b0..Read access - * 0b1..Write access - */ -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_WRITE(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_WRITE_SHIFT)) & AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_WRITE_MASK) - -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_DATA_ACCESS_MASK (0x2U) -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_DATA_ACCESS_SHIFT (1U) -/*! SEC_VIO_INFO_DATA_ACCESS - Security Violation Info Data Access - * 0b0..Code - * 0b1..Data - */ -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_DATA_ACCESS(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_DATA_ACCESS_SHIFT)) & AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_DATA_ACCESS_MASK) - -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_MASTER_SEC_LEVEL_MASK (0xF0U) -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_MASTER_SEC_LEVEL_SHIFT (4U) -/*! SEC_VIO_INFO_MASTER_SEC_LEVEL - Security Violation Info Master Security Level */ -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_MASTER_SEC_LEVEL(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_MASTER_SEC_LEVEL_SHIFT)) & AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_MASTER_SEC_LEVEL_MASK) - -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_MASTER_MASK (0x1F00U) -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_MASTER_SHIFT (8U) -/*! SEC_VIO_INFO_MASTER - Security violation master number - * 0b00000..M33 Code - * 0b00001..M33 System - * 0b00010..CPU1 (Mirco-CM33) Code - * 0b00011..SMARTDMA Instruction - * 0b00100..CPU1 (Mirco-CM33) system - * 0b00101..SMARTDMA Data - * 0b00110..eDMA0 - * 0b00111..eDMA1 - * 0b01000..PKC - * 0b01001..ELS S50 - * 0b01010..PKC M0 - * 0b01011..NPU Operands - * 0b01100..DSP Instruction - * 0b01101..DSPX - * 0b01110..DSPY - * 0b10000..NPU Data - * 0b10001..USB FS - * 0b10010..Ethernet - * 0b10011..USB HS - * 0b10100..uSDHC - */ -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_MASTER(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_MASTER_SHIFT)) & AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_SEC_VIO_INFO_MASTER_MASK) -/*! @} */ - -/* The count of AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO */ -#define AHBSC_SEC_VIO_MISC_INFON_SEC_VIO_MISC_INFO_COUNT (32U) - -/*! @name SEC_VIO_INFO_VALID - Security Violation Info Validity for Address */ -/*! @{ */ - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID0_MASK (0x1U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID0_SHIFT (0U) -/*! VIO_INFO_VALID0 - Violation information valid flag for AHB port 0 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID0_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID0_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID1_MASK (0x2U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID1_SHIFT (1U) -/*! VIO_INFO_VALID1 - Violation information valid flag for AHB port 1 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID1_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID1_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID2_MASK (0x4U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID2_SHIFT (2U) -/*! VIO_INFO_VALID2 - Violation information valid flag for AHB port 2 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID2(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID2_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID2_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID3_MASK (0x8U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID3_SHIFT (3U) -/*! VIO_INFO_VALID3 - Violation information valid flag for AHB port 3 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID3(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID3_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID3_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID4_MASK (0x10U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID4_SHIFT (4U) -/*! VIO_INFO_VALID4 - Violation information valid flag for AHB port 4 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID4(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID4_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID4_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID5_MASK (0x20U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID5_SHIFT (5U) -/*! VIO_INFO_VALID5 - Violation information valid flag for AHB port 5 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID5(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID5_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID5_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID6_MASK (0x40U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID6_SHIFT (6U) -/*! VIO_INFO_VALID6 - Violation information valid flag for AHB port 6 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID6(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID6_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID6_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID7_MASK (0x80U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID7_SHIFT (7U) -/*! VIO_INFO_VALID7 - Violation information valid flag for AHB port 7 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID7(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID7_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID7_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID8_MASK (0x100U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID8_SHIFT (8U) -/*! VIO_INFO_VALID8 - Violation information valid flag for AHB port 8 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID8(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID8_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID8_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID9_MASK (0x200U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID9_SHIFT (9U) -/*! VIO_INFO_VALID9 - Violation information valid flag for AHB port 9 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID9(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID9_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID9_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID10_MASK (0x400U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID10_SHIFT (10U) -/*! VIO_INFO_VALID10 - Violation information valid flag for AHB port 10 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID10(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID10_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID10_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID11_MASK (0x800U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID11_SHIFT (11U) -/*! VIO_INFO_VALID11 - Violation information valid flag for AHB port 11 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID11(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID11_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID11_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID12_MASK (0x1000U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID12_SHIFT (12U) -/*! VIO_INFO_VALID12 - Violation information valid flag for AHB port 12 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID12(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID12_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID12_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID13_MASK (0x2000U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID13_SHIFT (13U) -/*! VIO_INFO_VALID13 - Violation information valid flag for AHB port 13 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID13(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID13_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID13_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID14_MASK (0x4000U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID14_SHIFT (14U) -/*! VIO_INFO_VALID14 - Violation information valid flag for AHB port 14 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID14(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID14_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID14_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID15_MASK (0x8000U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID15_SHIFT (15U) -/*! VIO_INFO_VALID15 - Violation information valid flag for AHB port 15 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID15(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID15_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID15_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID16_MASK (0x10000U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID16_SHIFT (16U) -/*! VIO_INFO_VALID16 - Violation information valid flag for AHB port 16 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID16(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID16_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID16_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID17_MASK (0x20000U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID17_SHIFT (17U) -/*! VIO_INFO_VALID17 - Violation information valid flag for AHB port 17 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID17(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID17_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID17_MASK) - -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID18_MASK (0x40000U) -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID18_SHIFT (18U) -/*! VIO_INFO_VALID18 - Violation information valid flag for AHB port 18 - * 0b0..Not valid - * 0b1..Valid - */ -#define AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID18(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID18_SHIFT)) & AHBSC_SEC_VIO_INFO_VALID_VIO_INFO_VALID18_MASK) -/*! @} */ - -/*! @name SEC_GPIO_MASKN_SEC_GPIO_MASK - GPIO Mask for Port 0..GPIO Mask for Port 1 */ -/*! @{ */ - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN0_SEC_MASK_MASK (0x1U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN0_SEC_MASK_SHIFT (0U) -/*! PIO0_PIN0_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN0_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN0_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN0_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN0_SEC_MASK_MASK (0x1U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN0_SEC_MASK_SHIFT (0U) -/*! PIO1_PIN0_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN0_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN0_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN0_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN1_SEC_MASK_MASK (0x2U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN1_SEC_MASK_SHIFT (1U) -/*! PIO0_PIN1_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN1_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN1_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN1_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN1_SEC_MASK_MASK (0x2U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN1_SEC_MASK_SHIFT (1U) -/*! PIO1_PIN1_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN1_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN1_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN1_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN2_SEC_MASK_MASK (0x4U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN2_SEC_MASK_SHIFT (2U) -/*! PIO0_PIN2_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN2_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN2_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN2_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN2_SEC_MASK_MASK (0x4U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN2_SEC_MASK_SHIFT (2U) -/*! PIO1_PIN2_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN2_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN2_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN2_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN3_SEC_MASK_MASK (0x8U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN3_SEC_MASK_SHIFT (3U) -/*! PIO0_PIN3_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN3_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN3_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN3_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN3_SEC_MASK_MASK (0x8U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN3_SEC_MASK_SHIFT (3U) -/*! PIO1_PIN3_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN3_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN3_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN3_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN4_SEC_MASK_MASK (0x10U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN4_SEC_MASK_SHIFT (4U) -/*! PIO0_PIN4_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN4_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN4_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN4_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN4_SEC_MASK_MASK (0x10U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN4_SEC_MASK_SHIFT (4U) -/*! PIO1_PIN4_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN4_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN4_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN4_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN5_SEC_MASK_MASK (0x20U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN5_SEC_MASK_SHIFT (5U) -/*! PIO0_PIN5_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN5_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN5_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN5_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN5_SEC_MASK_MASK (0x20U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN5_SEC_MASK_SHIFT (5U) -/*! PIO1_PIN5_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN5_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN5_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN5_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN6_SEC_MASK_MASK (0x40U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN6_SEC_MASK_SHIFT (6U) -/*! PIO0_PIN6_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN6_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN6_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN6_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN6_SEC_MASK_MASK (0x40U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN6_SEC_MASK_SHIFT (6U) -/*! PIO1_PIN6_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN6_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN6_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN6_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN7_SEC_MASK_MASK (0x80U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN7_SEC_MASK_SHIFT (7U) -/*! PIO0_PIN7_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN7_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN7_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN7_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN7_SEC_MASK_MASK (0x80U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN7_SEC_MASK_SHIFT (7U) -/*! PIO1_PIN7_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN7_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN7_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN7_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN8_SEC_MASK_MASK (0x100U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN8_SEC_MASK_SHIFT (8U) -/*! PIO0_PIN8_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN8_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN8_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN8_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN8_SEC_MASK_MASK (0x100U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN8_SEC_MASK_SHIFT (8U) -/*! PIO1_PIN8_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN8_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN8_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN8_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN9_SEC_MASK_MASK (0x200U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN9_SEC_MASK_SHIFT (9U) -/*! PIO0_PIN9_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN9_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN9_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN9_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN9_SEC_MASK_MASK (0x200U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN9_SEC_MASK_SHIFT (9U) -/*! PIO1_PIN9_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN9_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN9_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN9_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN10_SEC_MASK_MASK (0x400U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN10_SEC_MASK_SHIFT (10U) -/*! PIO0_PIN10_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN10_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN10_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN10_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN10_SEC_MASK_MASK (0x400U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN10_SEC_MASK_SHIFT (10U) -/*! PIO1_PIN10_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN10_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN10_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN10_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN11_SEC_MASK_MASK (0x800U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN11_SEC_MASK_SHIFT (11U) -/*! PIO0_PIN11_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN11_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN11_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN11_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN11_SEC_MASK_MASK (0x800U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN11_SEC_MASK_SHIFT (11U) -/*! PIO1_PIN11_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN11_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN11_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN11_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN12_SEC_MASK_MASK (0x1000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN12_SEC_MASK_SHIFT (12U) -/*! PIO0_PIN12_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN12_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN12_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN12_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN12_SEC_MASK_MASK (0x1000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN12_SEC_MASK_SHIFT (12U) -/*! PIO1_PIN12_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN12_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN12_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN12_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN13_SEC_MASK_MASK (0x2000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN13_SEC_MASK_SHIFT (13U) -/*! PIO0_PIN13_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN13_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN13_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN13_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN13_SEC_MASK_MASK (0x2000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN13_SEC_MASK_SHIFT (13U) -/*! PIO1_PIN13_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN13_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN13_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN13_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN14_SEC_MASK_MASK (0x4000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN14_SEC_MASK_SHIFT (14U) -/*! PIO0_PIN14_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN14_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN14_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN14_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN14_SEC_MASK_MASK (0x4000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN14_SEC_MASK_SHIFT (14U) -/*! PIO1_PIN14_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN14_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN14_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN14_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN15_SEC_MASK_MASK (0x8000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN15_SEC_MASK_SHIFT (15U) -/*! PIO0_PIN15_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN15_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN15_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN15_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN15_SEC_MASK_MASK (0x8000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN15_SEC_MASK_SHIFT (15U) -/*! PIO1_PIN15_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN15_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN15_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN15_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN16_SEC_MASK_MASK (0x10000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN16_SEC_MASK_SHIFT (16U) -/*! PIO0_PIN16_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN16_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN16_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN16_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN16_SEC_MASK_MASK (0x10000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN16_SEC_MASK_SHIFT (16U) -/*! PIO1_PIN16_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN16_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN16_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN16_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN17_SEC_MASK_MASK (0x20000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN17_SEC_MASK_SHIFT (17U) -/*! PIO0_PIN17_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN17_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN17_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN17_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN17_SEC_MASK_MASK (0x20000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN17_SEC_MASK_SHIFT (17U) -/*! PIO1_PIN17_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN17_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN17_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN17_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN18_SEC_MASK_MASK (0x40000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN18_SEC_MASK_SHIFT (18U) -/*! PIO0_PIN18_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN18_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN18_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN18_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN18_SEC_MASK_MASK (0x40000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN18_SEC_MASK_SHIFT (18U) -/*! PIO1_PIN18_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN18_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN18_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN18_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN19_SEC_MASK_MASK (0x80000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN19_SEC_MASK_SHIFT (19U) -/*! PIO0_PIN19_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN19_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN19_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN19_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN19_SEC_MASK_MASK (0x80000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN19_SEC_MASK_SHIFT (19U) -/*! PIO1_PIN19_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN19_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN19_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN19_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN20_SEC_MASK_MASK (0x100000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN20_SEC_MASK_SHIFT (20U) -/*! PIO0_PIN20_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN20_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN20_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN20_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN20_SEC_MASK_MASK (0x100000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN20_SEC_MASK_SHIFT (20U) -/*! PIO1_PIN20_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN20_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN20_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN20_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN21_SEC_MASK_MASK (0x200000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN21_SEC_MASK_SHIFT (21U) -/*! PIO0_PIN21_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN21_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN21_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN21_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN21_SEC_MASK_MASK (0x200000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN21_SEC_MASK_SHIFT (21U) -/*! PIO1_PIN21_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN21_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN21_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN21_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN22_SEC_MASK_MASK (0x400000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN22_SEC_MASK_SHIFT (22U) -/*! PIO0_PIN22_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN22_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN22_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN22_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN22_SEC_MASK_MASK (0x400000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN22_SEC_MASK_SHIFT (22U) -/*! PIO1_PIN22_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN22_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN22_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN22_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN23_SEC_MASK_MASK (0x800000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN23_SEC_MASK_SHIFT (23U) -/*! PIO0_PIN23_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN23_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN23_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN23_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN23_SEC_MASK_MASK (0x800000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN23_SEC_MASK_SHIFT (23U) -/*! PIO1_PIN23_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN23_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN23_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN23_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN24_SEC_MASK_MASK (0x1000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN24_SEC_MASK_SHIFT (24U) -/*! PIO0_PIN24_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN24_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN24_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN24_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN24_SEC_MASK_MASK (0x1000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN24_SEC_MASK_SHIFT (24U) -/*! PIO1_PIN24_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN24_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN24_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN24_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN25_SEC_MASK_MASK (0x2000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN25_SEC_MASK_SHIFT (25U) -/*! PIO0_PIN25_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN25_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN25_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN25_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN25_SEC_MASK_MASK (0x2000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN25_SEC_MASK_SHIFT (25U) -/*! PIO1_PIN25_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN25_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN25_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN25_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN26_SEC_MASK_MASK (0x4000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN26_SEC_MASK_SHIFT (26U) -/*! PIO0_PIN26_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN26_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN26_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN26_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN26_SEC_MASK_MASK (0x4000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN26_SEC_MASK_SHIFT (26U) -/*! PIO1_PIN26_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN26_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN26_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN26_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN27_SEC_MASK_MASK (0x8000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN27_SEC_MASK_SHIFT (27U) -/*! PIO0_PIN27_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN27_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN27_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN27_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN27_SEC_MASK_MASK (0x8000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN27_SEC_MASK_SHIFT (27U) -/*! PIO1_PIN27_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN27_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN27_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN27_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN28_SEC_MASK_MASK (0x10000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN28_SEC_MASK_SHIFT (28U) -/*! PIO0_PIN28_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN28_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN28_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN28_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN28_SEC_MASK_MASK (0x10000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN28_SEC_MASK_SHIFT (28U) -/*! PIO1_PIN28_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN28_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN28_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN28_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN29_SEC_MASK_MASK (0x20000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN29_SEC_MASK_SHIFT (29U) -/*! PIO0_PIN29_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN29_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN29_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN29_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN29_SEC_MASK_MASK (0x20000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN29_SEC_MASK_SHIFT (29U) -/*! PIO1_PIN29_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN29_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN29_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN29_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN30_SEC_MASK_MASK (0x40000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN30_SEC_MASK_SHIFT (30U) -/*! PIO0_PIN30_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN30_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN30_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN30_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN30_SEC_MASK_MASK (0x40000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN30_SEC_MASK_SHIFT (30U) -/*! PIO1_PIN30_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN30_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN30_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN30_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN31_SEC_MASK_MASK (0x80000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN31_SEC_MASK_SHIFT (31U) -/*! PIO0_PIN31_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN31_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN31_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO0_PIN31_SEC_MASK_MASK) - -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN31_SEC_MASK_MASK (0x80000000U) -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN31_SEC_MASK_SHIFT (31U) -/*! PIO1_PIN31_SEC_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN31_SEC_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN31_SEC_MASK_SHIFT)) & AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_PIO1_PIN31_SEC_MASK_MASK) -/*! @} */ - -/* The count of AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK */ -#define AHBSC_SEC_GPIO_MASKN_SEC_GPIO_MASK_COUNT (2U) - -/*! @name SEC_CPU1_INT_MASK0 - Secure Interrupt Mask 0 for CPU1 */ -/*! @{ */ - -#define AHBSC_SEC_CPU1_INT_MASK0_INT0_MASK_MASK (0x1U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT0_MASK_SHIFT (0U) -/*! INT0_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT0_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT0_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT0_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT1_MASK_MASK (0x2U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT1_MASK_SHIFT (1U) -/*! INT1_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT1_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT1_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT1_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT2_MASK_MASK (0x4U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT2_MASK_SHIFT (2U) -/*! INT2_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT2_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT2_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT2_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT3_MASK_MASK (0x8U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT3_MASK_SHIFT (3U) -/*! INT3_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT3_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT3_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT3_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT4_MASK_MASK (0x10U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT4_MASK_SHIFT (4U) -/*! INT4_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT4_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT4_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT4_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT5_MASK_MASK (0x20U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT5_MASK_SHIFT (5U) -/*! INT5_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT5_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT5_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT5_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT6_MASK_MASK (0x40U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT6_MASK_SHIFT (6U) -/*! INT6_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT6_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT6_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT6_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT7_MASK_MASK (0x80U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT7_MASK_SHIFT (7U) -/*! INT7_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT7_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT7_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT7_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT8_MASK_MASK (0x100U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT8_MASK_SHIFT (8U) -/*! INT8_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT8_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT8_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT8_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT9_MASK_MASK (0x200U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT9_MASK_SHIFT (9U) -/*! INT9_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT9_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT9_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT9_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT10_MASK_MASK (0x400U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT10_MASK_SHIFT (10U) -/*! INT10_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT10_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT10_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT10_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT11_MASK_MASK (0x800U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT11_MASK_SHIFT (11U) -/*! INT11_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT11_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT11_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT11_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT12_MASK_MASK (0x1000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT12_MASK_SHIFT (12U) -/*! INT12_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT12_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT12_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT12_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT13_MASK_MASK (0x2000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT13_MASK_SHIFT (13U) -/*! INT13_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT13_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT13_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT13_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT14_MASK_MASK (0x4000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT14_MASK_SHIFT (14U) -/*! INT14_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT14_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT14_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT14_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT15_MASK_MASK (0x8000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT15_MASK_SHIFT (15U) -/*! INT15_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT15_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT15_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT15_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT16_MASK_MASK (0x10000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT16_MASK_SHIFT (16U) -/*! INT16_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT16_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT16_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT16_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT17_MASK_MASK (0x20000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT17_MASK_SHIFT (17U) -/*! INT17_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT17_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT17_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT17_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT18_MASK_MASK (0x40000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT18_MASK_SHIFT (18U) -/*! INT18_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT18_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT18_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT18_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT19_MASK_MASK (0x80000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT19_MASK_SHIFT (19U) -/*! INT19_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT19_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT19_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT19_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT20_MASK_MASK (0x100000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT20_MASK_SHIFT (20U) -/*! INT20_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT20_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT20_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT20_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT21_MASK_MASK (0x200000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT21_MASK_SHIFT (21U) -/*! INT21_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT21_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT21_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT21_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT22_MASK_MASK (0x400000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT22_MASK_SHIFT (22U) -/*! INT22_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT22_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT22_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT22_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT23_MASK_MASK (0x800000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT23_MASK_SHIFT (23U) -/*! INT23_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT23_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT23_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT23_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT24_MASK_MASK (0x1000000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT24_MASK_SHIFT (24U) -/*! INT24_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT24_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT24_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT24_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT25_MASK_MASK (0x2000000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT25_MASK_SHIFT (25U) -/*! INT25_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT25_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT25_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT25_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT26_MASK_MASK (0x4000000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT26_MASK_SHIFT (26U) -/*! INT26_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT26_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT26_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT26_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT27_MASK_MASK (0x8000000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT27_MASK_SHIFT (27U) -/*! INT27_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT27_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT27_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT27_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT28_MASK_MASK (0x10000000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT28_MASK_SHIFT (28U) -/*! INT28_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT28_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT28_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT28_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT29_MASK_MASK (0x20000000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT29_MASK_SHIFT (29U) -/*! INT29_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT29_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT29_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT29_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT30_MASK_MASK (0x40000000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT30_MASK_SHIFT (30U) -/*! INT30_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT30_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT30_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT30_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK0_INT31_MASK_MASK (0x80000000U) -#define AHBSC_SEC_CPU1_INT_MASK0_INT31_MASK_SHIFT (31U) -/*! INT31_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK0_INT31_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK0_INT31_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK0_INT31_MASK_MASK) -/*! @} */ - -/*! @name SEC_CPU1_INT_MASK1 - Secure Interrupt Mask 1 for CPU1 */ -/*! @{ */ - -#define AHBSC_SEC_CPU1_INT_MASK1_INT32_MASK_MASK (0x1U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT32_MASK_SHIFT (0U) -/*! INT32_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT32_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT32_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT32_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT33_MASK_MASK (0x2U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT33_MASK_SHIFT (1U) -/*! INT33_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT33_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT33_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT33_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT34_MASK_MASK (0x4U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT34_MASK_SHIFT (2U) -/*! INT34_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT34_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT34_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT34_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT35_MASK_MASK (0x8U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT35_MASK_SHIFT (3U) -/*! INT35_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT35_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT35_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT35_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT36_MASK_MASK (0x10U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT36_MASK_SHIFT (4U) -/*! INT36_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT36_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT36_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT36_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT37_MASK_MASK (0x20U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT37_MASK_SHIFT (5U) -/*! INT37_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT37_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT37_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT37_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT38_MASK_MASK (0x40U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT38_MASK_SHIFT (6U) -/*! INT38_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT38_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT38_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT38_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT39_MASK_MASK (0x80U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT39_MASK_SHIFT (7U) -/*! INT39_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT39_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT39_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT39_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT40_MASK_MASK (0x100U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT40_MASK_SHIFT (8U) -/*! INT40_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT40_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT40_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT40_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT41_MASK_MASK (0x200U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT41_MASK_SHIFT (9U) -/*! INT41_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT41_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT41_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT41_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT42_MASK_MASK (0x400U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT42_MASK_SHIFT (10U) -/*! INT42_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT42_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT42_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT42_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT43_MASK_MASK (0x800U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT43_MASK_SHIFT (11U) -/*! INT43_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT43_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT43_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT43_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT44_MASK_MASK (0x1000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT44_MASK_SHIFT (12U) -/*! INT44_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT44_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT44_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT44_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT45_MASK_MASK (0x2000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT45_MASK_SHIFT (13U) -/*! INT45_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT45_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT45_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT45_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT46_MASK_MASK (0x4000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT46_MASK_SHIFT (14U) -/*! INT46_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT46_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT46_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT46_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT47_MASK_MASK (0x8000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT47_MASK_SHIFT (15U) -/*! INT47_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT47_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT47_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT47_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT48_MASK_MASK (0x10000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT48_MASK_SHIFT (16U) -/*! INT48_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT48_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT48_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT48_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT49_MASK_MASK (0x20000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT49_MASK_SHIFT (17U) -/*! INT49_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT49_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT49_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT49_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT50_MASK_MASK (0x40000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT50_MASK_SHIFT (18U) -/*! INT50_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT50_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT50_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT50_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT51_MASK_MASK (0x80000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT51_MASK_SHIFT (19U) -/*! INT51_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT51_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT51_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT51_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT52_MASK_MASK (0x100000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT52_MASK_SHIFT (20U) -/*! INT52_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT52_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT52_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT52_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT53_MASK_MASK (0x200000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT53_MASK_SHIFT (21U) -/*! INT53_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT53_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT53_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT53_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT54_MASK_MASK (0x400000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT54_MASK_SHIFT (22U) -/*! INT54_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT54_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT54_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT54_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT55_MASK_MASK (0x800000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT55_MASK_SHIFT (23U) -/*! INT55_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT55_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT55_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT55_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT56_MASK_MASK (0x1000000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT56_MASK_SHIFT (24U) -/*! INT56_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT56_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT56_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT56_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT57_MASK_MASK (0x2000000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT57_MASK_SHIFT (25U) -/*! INT57_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT57_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT57_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT57_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT58_MASK_MASK (0x4000000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT58_MASK_SHIFT (26U) -/*! INT58_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT58_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT58_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT58_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT59_MASK_MASK (0x8000000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT59_MASK_SHIFT (27U) -/*! INT59_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT59_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT59_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT59_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT60_MASK_MASK (0x10000000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT60_MASK_SHIFT (28U) -/*! INT60_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT60_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT60_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT60_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT61_MASK_MASK (0x20000000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT61_MASK_SHIFT (29U) -/*! INT61_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT61_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT61_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT61_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT62_MASK_MASK (0x40000000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT62_MASK_SHIFT (30U) -/*! INT62_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT62_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT62_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT62_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK1_INT63_MASK_MASK (0x80000000U) -#define AHBSC_SEC_CPU1_INT_MASK1_INT63_MASK_SHIFT (31U) -/*! INT63_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK1_INT63_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK1_INT63_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK1_INT63_MASK_MASK) -/*! @} */ - -/*! @name SEC_CPU1_INT_MASK2 - Secure Interrupt Mask 2 for CPU1 */ -/*! @{ */ - -#define AHBSC_SEC_CPU1_INT_MASK2_INT64_MASK_MASK (0x1U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT64_MASK_SHIFT (0U) -/*! INT64_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT64_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT64_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT64_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT65_MASK_MASK (0x2U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT65_MASK_SHIFT (1U) -/*! INT65_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT65_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT65_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT65_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT66_MASK_MASK (0x4U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT66_MASK_SHIFT (2U) -/*! INT66_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT66_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT66_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT66_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT67_MASK_MASK (0x8U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT67_MASK_SHIFT (3U) -/*! INT67_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT67_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT67_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT67_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT68_MASK_MASK (0x10U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT68_MASK_SHIFT (4U) -/*! INT68_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT68_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT68_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT68_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT69_MASK_MASK (0x20U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT69_MASK_SHIFT (5U) -/*! INT69_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT69_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT69_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT69_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT70_MASK_MASK (0x40U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT70_MASK_SHIFT (6U) -/*! INT70_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT70_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT70_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT70_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT71_MASK_MASK (0x80U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT71_MASK_SHIFT (7U) -/*! INT71_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT71_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT71_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT71_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT72_MASK_MASK (0x100U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT72_MASK_SHIFT (8U) -/*! INT72_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT72_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT72_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT72_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT73_MASK_MASK (0x200U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT73_MASK_SHIFT (9U) -/*! INT73_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT73_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT73_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT73_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT74_MASK_MASK (0x400U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT74_MASK_SHIFT (10U) -/*! INT74_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT74_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT74_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT74_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT75_MASK_MASK (0x800U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT75_MASK_SHIFT (11U) -/*! INT75_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT75_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT75_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT75_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT76_MASK_MASK (0x1000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT76_MASK_SHIFT (12U) -/*! INT76_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT76_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT76_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT76_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT77_MASK_MASK (0x2000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT77_MASK_SHIFT (13U) -/*! INT77_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT77_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT77_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT77_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT78_MASK_MASK (0x4000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT78_MASK_SHIFT (14U) -/*! INT78_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT78_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT78_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT78_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT79_MASK_MASK (0x8000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT79_MASK_SHIFT (15U) -/*! INT79_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT79_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT79_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT79_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT80_MASK_MASK (0x10000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT80_MASK_SHIFT (16U) -/*! INT80_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT80_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT80_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT80_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT81_MASK_MASK (0x20000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT81_MASK_SHIFT (17U) -/*! INT81_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT81_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT81_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT81_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT82_MASK_MASK (0x40000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT82_MASK_SHIFT (18U) -/*! INT82_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT82_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT82_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT82_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT83_MASK_MASK (0x80000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT83_MASK_SHIFT (19U) -/*! INT83_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT83_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT83_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT83_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT84_MASK_MASK (0x100000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT84_MASK_SHIFT (20U) -/*! INT84_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT84_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT84_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT84_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT85_MASK_MASK (0x200000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT85_MASK_SHIFT (21U) -/*! INT85_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT85_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT85_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT85_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT86_MASK_MASK (0x400000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT86_MASK_SHIFT (22U) -/*! INT86_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT86_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT86_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT86_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT87_MASK_MASK (0x800000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT87_MASK_SHIFT (23U) -/*! INT87_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT87_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT87_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT87_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT88_MASK_MASK (0x1000000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT88_MASK_SHIFT (24U) -/*! INT88_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT88_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT88_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT88_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT89_MASK_MASK (0x2000000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT89_MASK_SHIFT (25U) -/*! INT89_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT89_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT89_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT89_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT90_MASK_MASK (0x4000000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT90_MASK_SHIFT (26U) -/*! INT90_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT90_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT90_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT90_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT91_MASK_MASK (0x8000000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT91_MASK_SHIFT (27U) -/*! INT91_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT91_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT91_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT91_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT92_MASK_MASK (0x10000000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT92_MASK_SHIFT (28U) -/*! INT92_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT92_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT92_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT92_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT93_MASK_MASK (0x20000000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT93_MASK_SHIFT (29U) -/*! INT93_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT93_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT93_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT93_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT94_MASK_MASK (0x40000000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT94_MASK_SHIFT (30U) -/*! INT94_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT94_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT94_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT94_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK2_INT95_MASK_MASK (0x80000000U) -#define AHBSC_SEC_CPU1_INT_MASK2_INT95_MASK_SHIFT (31U) -/*! INT95_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK2_INT95_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK2_INT95_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK2_INT95_MASK_MASK) -/*! @} */ - -/*! @name SEC_CPU1_INT_MASK3 - Secure Interrupt Mask 3 for CPU1 */ -/*! @{ */ - -#define AHBSC_SEC_CPU1_INT_MASK3_INT96_MASK_MASK (0x1U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT96_MASK_SHIFT (0U) -/*! INT96_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT96_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT96_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT96_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT97_MASK_MASK (0x2U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT97_MASK_SHIFT (1U) -/*! INT97_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT97_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT97_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT97_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT98_MASK_MASK (0x4U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT98_MASK_SHIFT (2U) -/*! INT98_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT98_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT98_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT98_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT99_MASK_MASK (0x8U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT99_MASK_SHIFT (3U) -/*! INT99_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT99_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT99_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT99_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT100_MASK_MASK (0x10U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT100_MASK_SHIFT (4U) -/*! INT100_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT100_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT100_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT100_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT101_MASK_MASK (0x20U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT101_MASK_SHIFT (5U) -/*! INT101_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT101_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT101_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT101_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT102_MASK_MASK (0x40U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT102_MASK_SHIFT (6U) -/*! INT102_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT102_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT102_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT102_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT103_MASK_MASK (0x80U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT103_MASK_SHIFT (7U) -/*! INT103_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT103_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT103_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT103_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT104_MASK_MASK (0x100U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT104_MASK_SHIFT (8U) -/*! INT104_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT104_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT104_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT104_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT105_MASK_MASK (0x200U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT105_MASK_SHIFT (9U) -/*! INT105_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT105_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT105_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT105_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT106_MASK_MASK (0x400U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT106_MASK_SHIFT (10U) -/*! INT106_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT106_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT106_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT106_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT107_MASK_MASK (0x800U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT107_MASK_SHIFT (11U) -/*! INT107_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT107_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT107_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT107_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT108_MASK_MASK (0x1000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT108_MASK_SHIFT (12U) -/*! INT108_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT108_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT108_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT108_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT109_MASK_MASK (0x2000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT109_MASK_SHIFT (13U) -/*! INT109_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT109_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT109_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT109_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT110_MASK_MASK (0x4000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT110_MASK_SHIFT (14U) -/*! INT110_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT110_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT110_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT110_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT111_MASK_MASK (0x8000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT111_MASK_SHIFT (15U) -/*! INT111_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT111_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT111_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT111_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT112_MASK_MASK (0x10000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT112_MASK_SHIFT (16U) -/*! INT112_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT112_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT112_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT112_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT113_MASK_MASK (0x20000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT113_MASK_SHIFT (17U) -/*! INT113_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT113_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT113_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT113_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT114_MASK_MASK (0x40000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT114_MASK_SHIFT (18U) -/*! INT114_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT114_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT114_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT114_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT115_MASK_MASK (0x80000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT115_MASK_SHIFT (19U) -/*! INT115_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT115_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT115_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT115_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT116_MASK_MASK (0x100000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT116_MASK_SHIFT (20U) -/*! INT116_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT116_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT116_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT116_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT117_MASK_MASK (0x200000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT117_MASK_SHIFT (21U) -/*! INT117_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT117_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT117_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT117_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT118_MASK_MASK (0x400000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT118_MASK_SHIFT (22U) -/*! INT118_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT118_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT118_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT118_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT119_MASK_MASK (0x800000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT119_MASK_SHIFT (23U) -/*! INT119_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT119_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT119_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT119_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT120_MASK_MASK (0x1000000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT120_MASK_SHIFT (24U) -/*! INT120_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT120_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT120_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT120_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT121_MASK_MASK (0x2000000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT121_MASK_SHIFT (25U) -/*! INT121_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT121_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT121_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT121_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT122_MASK_MASK (0x4000000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT122_MASK_SHIFT (26U) -/*! INT122_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT122_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT122_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT122_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT123_MASK_MASK (0x8000000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT123_MASK_SHIFT (27U) -/*! INT123_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT123_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT123_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT123_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT124_MASK_MASK (0x10000000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT124_MASK_SHIFT (28U) -/*! INT124_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT124_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT124_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT124_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT125_MASK_MASK (0x20000000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT125_MASK_SHIFT (29U) -/*! INT125_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT125_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT125_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT125_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT126_MASK_MASK (0x40000000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT126_MASK_SHIFT (30U) -/*! INT126_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT126_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT126_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT126_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK3_INT127_MASK_MASK (0x80000000U) -#define AHBSC_SEC_CPU1_INT_MASK3_INT127_MASK_SHIFT (31U) -/*! INT127_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK3_INT127_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK3_INT127_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK3_INT127_MASK_MASK) -/*! @} */ - -/*! @name SEC_CPU1_INT_MASK4 - Secure Interrupt Mask 4 for CPU1 */ -/*! @{ */ - -#define AHBSC_SEC_CPU1_INT_MASK4_INT128_MASK_MASK (0x1U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT128_MASK_SHIFT (0U) -/*! INT128_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT128_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT128_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT128_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT129_MASK_MASK (0x2U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT129_MASK_SHIFT (1U) -/*! INT129_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT129_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT129_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT129_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT130_MASK_MASK (0x4U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT130_MASK_SHIFT (2U) -/*! INT130_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT130_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT130_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT130_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT131_MASK_MASK (0x8U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT131_MASK_SHIFT (3U) -/*! INT131_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT131_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT131_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT131_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT132_MASK_MASK (0x10U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT132_MASK_SHIFT (4U) -/*! INT132_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT132_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT132_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT132_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT133_MASK_MASK (0x20U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT133_MASK_SHIFT (5U) -/*! INT133_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT133_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT133_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT133_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT134_MASK_MASK (0x40U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT134_MASK_SHIFT (6U) -/*! INT134_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT134_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT134_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT134_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT135_MASK_MASK (0x80U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT135_MASK_SHIFT (7U) -/*! INT135_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT135_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT135_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT135_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT136_MASK_MASK (0x100U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT136_MASK_SHIFT (8U) -/*! INT136_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT136_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT136_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT136_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT137_MASK_MASK (0x200U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT137_MASK_SHIFT (9U) -/*! INT137_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT137_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT137_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT137_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT138_MASK_MASK (0x400U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT138_MASK_SHIFT (10U) -/*! INT138_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT138_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT138_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT138_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT139_MASK_MASK (0x800U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT139_MASK_SHIFT (11U) -/*! INT139_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT139_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT139_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT139_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT140_MASK_MASK (0x1000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT140_MASK_SHIFT (12U) -/*! INT140_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT140_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT140_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT140_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT141_MASK_MASK (0x2000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT141_MASK_SHIFT (13U) -/*! INT141_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT141_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT141_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT141_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT142_MASK_MASK (0x4000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT142_MASK_SHIFT (14U) -/*! INT142_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT142_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT142_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT142_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT143_MASK_MASK (0x8000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT143_MASK_SHIFT (15U) -/*! INT143_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT143_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT143_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT143_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT144_MASK_MASK (0x10000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT144_MASK_SHIFT (16U) -/*! INT144_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT144_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT144_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT144_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT145_MASK_MASK (0x20000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT145_MASK_SHIFT (17U) -/*! INT145_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT145_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT145_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT145_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT146_MASK_MASK (0x40000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT146_MASK_SHIFT (18U) -/*! INT146_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT146_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT146_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT146_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT147_MASK_MASK (0x80000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT147_MASK_SHIFT (19U) -/*! INT147_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT147_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT147_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT147_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT148_MASK_MASK (0x100000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT148_MASK_SHIFT (20U) -/*! INT148_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT148_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT148_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT148_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT149_MASK_MASK (0x200000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT149_MASK_SHIFT (21U) -/*! INT149_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT149_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT149_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT149_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT150_MASK_MASK (0x400000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT150_MASK_SHIFT (22U) -/*! INT150_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT150_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT150_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT150_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT151_MASK_MASK (0x800000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT151_MASK_SHIFT (23U) -/*! INT151_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT151_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT151_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT151_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT152_MASK_MASK (0x1000000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT152_MASK_SHIFT (24U) -/*! INT152_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT152_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT152_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT152_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT153_MASK_MASK (0x2000000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT153_MASK_SHIFT (25U) -/*! INT153_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT153_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT153_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT153_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT154_MASK_MASK (0x4000000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT154_MASK_SHIFT (26U) -/*! INT154_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT154_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT154_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT154_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT155_MASK_MASK (0x8000000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT155_MASK_SHIFT (27U) -/*! INT155_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT155_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT155_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT155_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT156_MASK_MASK (0x10000000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT156_MASK_SHIFT (28U) -/*! INT156_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT156_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT156_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT156_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT157_MASK_MASK (0x20000000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT157_MASK_SHIFT (29U) -/*! INT157_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT157_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT157_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT157_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT158_MASK_MASK (0x40000000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT158_MASK_SHIFT (30U) -/*! INT158_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT158_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT158_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT158_MASK_MASK) - -#define AHBSC_SEC_CPU1_INT_MASK4_INT159_MASK_MASK (0x80000000U) -#define AHBSC_SEC_CPU1_INT_MASK4_INT159_MASK_SHIFT (31U) -/*! INT159_MASK - Mask bit - * 0b0..Masked - * 0b1..Not masked - */ -#define AHBSC_SEC_CPU1_INT_MASK4_INT159_MASK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_CPU1_INT_MASK4_INT159_MASK_SHIFT)) & AHBSC_SEC_CPU1_INT_MASK4_INT159_MASK_MASK) -/*! @} */ - -/*! @name SEC_GP_REG_LOCK - Secure Mask Lock */ -/*! @{ */ - -#define AHBSC_SEC_GP_REG_LOCK_SEC_GPIO_MASK0_LOCK_MASK (0x3U) -#define AHBSC_SEC_GP_REG_LOCK_SEC_GPIO_MASK0_LOCK_SHIFT (0U) -/*! SEC_GPIO_MASK0_LOCK - Secure GPIO _MASK0 Lock - * 0b00..Reserved - * 0b01..SEC_GPIO_MASK0 cannot be written - * 0b10..SEC_GPIO_MASK0 can be written - * 0b11..Reserved - */ -#define AHBSC_SEC_GP_REG_LOCK_SEC_GPIO_MASK0_LOCK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GP_REG_LOCK_SEC_GPIO_MASK0_LOCK_SHIFT)) & AHBSC_SEC_GP_REG_LOCK_SEC_GPIO_MASK0_LOCK_MASK) - -#define AHBSC_SEC_GP_REG_LOCK_SEC_GPIO_MASK1_LOCK_MASK (0xCU) -#define AHBSC_SEC_GP_REG_LOCK_SEC_GPIO_MASK1_LOCK_SHIFT (2U) -/*! SEC_GPIO_MASK1_LOCK - Secure GPIO _MASK1 Lock - * 0b00..Reserved - * 0b01..SEC_GPIO_MASK1 cannot be written - * 0b10..SEC_GPIO_MASK1 can be written - * 0b11..Reserved - */ -#define AHBSC_SEC_GP_REG_LOCK_SEC_GPIO_MASK1_LOCK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GP_REG_LOCK_SEC_GPIO_MASK1_LOCK_SHIFT)) & AHBSC_SEC_GP_REG_LOCK_SEC_GPIO_MASK1_LOCK_MASK) - -#define AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK0_LOCK_MASK (0x3000U) -#define AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK0_LOCK_SHIFT (12U) -/*! SEC_CPU1_INT_MASK0_LOCK - SEC_CPU1_INT_MASK0 Lock - * 0b00..Reserved - * 0b01..SEC_GPIO_MASK0 cannot be written - * 0b10..SEC_GPIO_MASK0 can be written - * 0b11..Reserved - */ -#define AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK0_LOCK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK0_LOCK_SHIFT)) & AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK0_LOCK_MASK) - -#define AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK1_LOCK_MASK (0xC000U) -#define AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK1_LOCK_SHIFT (14U) -/*! SEC_CPU1_INT_MASK1_LOCK - SEC_CPU1_INT_MASK1 Lock - * 0b00..Reserved - * 0b01..SEC_GPIO_MASK1 cannot be written - * 0b10..SEC_GPIO_MASK1 can be written - * 0b11..Reserved - */ -#define AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK1_LOCK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK1_LOCK_SHIFT)) & AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK1_LOCK_MASK) - -#define AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK2_LOCK_MASK (0x30000U) -#define AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK2_LOCK_SHIFT (16U) -/*! SEC_CPU1_INT_MASK2_LOCK - SEC_CPU1_INT_MASK2 Lock - * 0b00..Reserved - * 0b01..SEC_CPU1_INT_MASK2 cannot be written - * 0b10..SEC_CPU1_INT_MASK2 can be written - * 0b11..Reserved - */ -#define AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK2_LOCK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK2_LOCK_SHIFT)) & AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK2_LOCK_MASK) - -#define AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK3_LOCK_MASK (0xC0000U) -#define AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK3_LOCK_SHIFT (18U) -/*! SEC_CPU1_INT_MASK3_LOCK - SEC_CPU1_INT_MASK3 Lock - * 0b00..Reserved - * 0b01..SEC_CPU1_INT_MASK3 cannot be written - * 0b10..SEC_CPU1_INT_MASK3 can be written - * 0b11..Reserved - */ -#define AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK3_LOCK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK3_LOCK_SHIFT)) & AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK3_LOCK_MASK) - -#define AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK4_LOCK_MASK (0x300000U) -#define AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK4_LOCK_SHIFT (20U) -/*! SEC_CPU1_INT_MASK4_LOCK - SEC_CPU1_INT_MASK4 Lock - * 0b00..Reserved - * 0b01..SEC_CPU1_INT_MASK4 cannot be written - * 0b10..SEC_CPU1_INT_MASK4 can be written - * 0b11..Reserved - */ -#define AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK4_LOCK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK4_LOCK_SHIFT)) & AHBSC_SEC_GP_REG_LOCK_SEC_CPU1_INT_MASK4_LOCK_MASK) -/*! @} */ - -/*! @name MASTER_SEC_LEVEL - Master Secure Level */ -/*! @{ */ - -#define AHBSC_MASTER_SEC_LEVEL_CPU1_MASK (0xCU) -#define AHBSC_MASTER_SEC_LEVEL_CPU1_SHIFT (2U) -/*! CPU1 - CPU1 - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define AHBSC_MASTER_SEC_LEVEL_CPU1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_CPU1_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_CPU1_MASK) - -#define AHBSC_MASTER_SEC_LEVEL_SMARTDMA_MASK (0x30U) -#define AHBSC_MASTER_SEC_LEVEL_SMARTDMA_SHIFT (4U) -/*! SMARTDMA - SMARTDMA Data - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define AHBSC_MASTER_SEC_LEVEL_SMARTDMA(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_SMARTDMA_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_SMARTDMA_MASK) - -#define AHBSC_MASTER_SEC_LEVEL_EDMA0_MASK (0xC0U) -#define AHBSC_MASTER_SEC_LEVEL_EDMA0_SHIFT (6U) -/*! eDMA0 - eDMA0 - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define AHBSC_MASTER_SEC_LEVEL_EDMA0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_EDMA0_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_EDMA0_MASK) - -#define AHBSC_MASTER_SEC_LEVEL_EDMA1_MASK (0x300U) -#define AHBSC_MASTER_SEC_LEVEL_EDMA1_SHIFT (8U) -/*! eDMA1 - eDMA1 - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define AHBSC_MASTER_SEC_LEVEL_EDMA1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_EDMA1_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_EDMA1_MASK) - -#define AHBSC_MASTER_SEC_LEVEL_PKC_MASK (0xC00U) -#define AHBSC_MASTER_SEC_LEVEL_PKC_SHIFT (10U) -/*! PKC - PKC - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define AHBSC_MASTER_SEC_LEVEL_PKC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_PKC_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_PKC_MASK) - -#define AHBSC_MASTER_SEC_LEVEL_PQ_MASK (0xC000U) -#define AHBSC_MASTER_SEC_LEVEL_PQ_SHIFT (14U) -/*! PQ - PowerQuad - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define AHBSC_MASTER_SEC_LEVEL_PQ(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_PQ_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_PQ_MASK) - -#define AHBSC_MASTER_SEC_LEVEL_NPUO_MASK (0x30000U) -#define AHBSC_MASTER_SEC_LEVEL_NPUO_SHIFT (16U) -/*! NPUO - NPU Operands - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define AHBSC_MASTER_SEC_LEVEL_NPUO(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_NPUO_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_NPUO_MASK) - -#define AHBSC_MASTER_SEC_LEVEL_COOLFLUXI_MASK (0xC0000U) -#define AHBSC_MASTER_SEC_LEVEL_COOLFLUXI_SHIFT (18U) -/*! COOLFLUXI - Coolflux Instruction - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define AHBSC_MASTER_SEC_LEVEL_COOLFLUXI(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_COOLFLUXI_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_COOLFLUXI_MASK) - -#define AHBSC_MASTER_SEC_LEVEL_USB_FS_MASK (0xC00000U) -#define AHBSC_MASTER_SEC_LEVEL_USB_FS_SHIFT (22U) -/*! USB_FS - USB_FS - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define AHBSC_MASTER_SEC_LEVEL_USB_FS(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_USB_FS_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_USB_FS_MASK) - -#define AHBSC_MASTER_SEC_LEVEL_ETHERNET_MASK (0x3000000U) -#define AHBSC_MASTER_SEC_LEVEL_ETHERNET_SHIFT (24U) -/*! ETHERNET - Ethernet - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define AHBSC_MASTER_SEC_LEVEL_ETHERNET(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_ETHERNET_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_ETHERNET_MASK) - -#define AHBSC_MASTER_SEC_LEVEL_USB_HS_MASK (0xC000000U) -#define AHBSC_MASTER_SEC_LEVEL_USB_HS_SHIFT (26U) -/*! USB_HS - USB HS - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define AHBSC_MASTER_SEC_LEVEL_USB_HS(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_USB_HS_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_USB_HS_MASK) - -#define AHBSC_MASTER_SEC_LEVEL_USDHC_MASK (0x30000000U) -#define AHBSC_MASTER_SEC_LEVEL_USDHC_SHIFT (28U) -/*! USDHC - uSDHC - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define AHBSC_MASTER_SEC_LEVEL_USDHC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_USDHC_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_USDHC_MASK) - -#define AHBSC_MASTER_SEC_LEVEL_MASTER_SEC_LEVEL_LOCK_MASK (0xC0000000U) -#define AHBSC_MASTER_SEC_LEVEL_MASTER_SEC_LEVEL_LOCK_SHIFT (30U) -/*! MASTER_SEC_LEVEL_LOCK - Master SEC Level Lock - * 0b00..Reserved - * 0b01..MASTER_SEC_LEVEL_LOCK cannot be written - * 0b10..MASTER_SEC_LEVEL_LOCK can be written - * 0b11..Reserved - */ -#define AHBSC_MASTER_SEC_LEVEL_MASTER_SEC_LEVEL_LOCK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_LEVEL_MASTER_SEC_LEVEL_LOCK_SHIFT)) & AHBSC_MASTER_SEC_LEVEL_MASTER_SEC_LEVEL_LOCK_MASK) -/*! @} */ - -/*! @name MASTER_SEC_ANTI_POL_REG - Master Secure Level */ -/*! @{ */ - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_CPU1_MASK (0xCU) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_CPU1_SHIFT (2U) -/*! CPU1 - CPU1 - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_CPU1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_CPU1_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_CPU1_MASK) - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_SMARTDMA_MASK (0x30U) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_SMARTDMA_SHIFT (4U) -/*! SMARTDMA - SMARTDMA Data - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_SMARTDMA(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_SMARTDMA_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_SMARTDMA_MASK) - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_EDMA0_MASK (0xC0U) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_EDMA0_SHIFT (6U) -/*! eDMA0 - eDMA0 - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_EDMA0(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_EDMA0_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_EDMA0_MASK) - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_EDMA1_MASK (0x300U) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_EDMA1_SHIFT (8U) -/*! eDMA1 - eDMA1 - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_EDMA1(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_EDMA1_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_EDMA1_MASK) - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_PKC_MASK (0xC00U) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_PKC_SHIFT (10U) -/*! PKC - PKC - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_PKC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_PKC_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_PKC_MASK) - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_PQ_MASK (0xC000U) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_PQ_SHIFT (14U) -/*! PQ - PowerQuad - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_PQ(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_PQ_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_PQ_MASK) - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_NPUO_MASK (0x30000U) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_NPUO_SHIFT (16U) -/*! NPUO - NPU Operands - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_NPUO(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_NPUO_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_NPUO_MASK) - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_COOLFLUXI_MASK (0xC0000U) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_COOLFLUXI_SHIFT (18U) -/*! COOLFLUXI - Coolflux Instruction - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_COOLFLUXI(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_COOLFLUXI_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_COOLFLUXI_MASK) - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_USB_FS_MASK (0xC00000U) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_USB_FS_SHIFT (22U) -/*! USB_FS - USB_FS - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_USB_FS(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_USB_FS_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_USB_FS_MASK) - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_ETHERNET_MASK (0x3000000U) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_ETHERNET_SHIFT (24U) -/*! ETHERNET - Ethernet - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_ETHERNET(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_ETHERNET_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_ETHERNET_MASK) - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_USB_HS_MASK (0xC000000U) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_USB_HS_SHIFT (26U) -/*! USB_HS - USB HS - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_USB_HS(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_USB_HS_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_USB_HS_MASK) - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_USDHC_MASK (0x30000000U) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_USDHC_SHIFT (28U) -/*! USDHC - uSDHC - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_USDHC(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_USDHC_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_USDHC_MASK) - -#define AHBSC_MASTER_SEC_ANTI_POL_REG_MASTER_SEC_LEVEL_ANTIPOL_LOCK_MASK (0xC0000000U) -#define AHBSC_MASTER_SEC_ANTI_POL_REG_MASTER_SEC_LEVEL_ANTIPOL_LOCK_SHIFT (30U) -/*! MASTER_SEC_LEVEL_ANTIPOL_LOCK - Master SEC Level Antipol Lock - * 0b00..Reserved - * 0b01..MASTER_SEC_LEVEL_LOCK cannot be written - * 0b10..MASTER_SEC_LEVEL_LOCK can be written - * 0b11..Reserved - */ -#define AHBSC_MASTER_SEC_ANTI_POL_REG_MASTER_SEC_LEVEL_ANTIPOL_LOCK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MASTER_SEC_ANTI_POL_REG_MASTER_SEC_LEVEL_ANTIPOL_LOCK_SHIFT)) & AHBSC_MASTER_SEC_ANTI_POL_REG_MASTER_SEC_LEVEL_ANTIPOL_LOCK_MASK) -/*! @} */ - -/*! @name CPU0_LOCK_REG - Miscellaneous CPU0 Control Signals */ -/*! @{ */ - -#define AHBSC_CPU0_LOCK_REG_LOCK_NS_VTOR_MASK (0x3U) -#define AHBSC_CPU0_LOCK_REG_LOCK_NS_VTOR_SHIFT (0U) -/*! LOCK_NS_VTOR - LOCK_NS_VTOR - * 0b00..Reserved - * 0b01..CM33 (CPU0) LOCKNSVTOR is 1 - * 0b10..CM33 (CPU0) LOCKNSVTOR is 0 - * 0b11..Reserved - */ -#define AHBSC_CPU0_LOCK_REG_LOCK_NS_VTOR(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_CPU0_LOCK_REG_LOCK_NS_VTOR_SHIFT)) & AHBSC_CPU0_LOCK_REG_LOCK_NS_VTOR_MASK) - -#define AHBSC_CPU0_LOCK_REG_LOCK_NS_MPU_MASK (0xCU) -#define AHBSC_CPU0_LOCK_REG_LOCK_NS_MPU_SHIFT (2U) -/*! LOCK_NS_MPU - LOCK_NS_MPU - * 0b00..Reserved - * 0b01..CM33 (CPU0) LOCK_NS_MPU is 1 - * 0b10..CM33 (CPU0) LOCK_NS_MPU is 0 - * 0b11..Reserved - */ -#define AHBSC_CPU0_LOCK_REG_LOCK_NS_MPU(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_CPU0_LOCK_REG_LOCK_NS_MPU_SHIFT)) & AHBSC_CPU0_LOCK_REG_LOCK_NS_MPU_MASK) - -#define AHBSC_CPU0_LOCK_REG_LOCK_S_VTAIRCR_MASK (0x30U) -#define AHBSC_CPU0_LOCK_REG_LOCK_S_VTAIRCR_SHIFT (4U) -/*! LOCK_S_VTAIRCR - LOCK_S_VTAIRCR - * 0b00..Reserved - * 0b01..CM33 (CPU0) LOCK_S_VTAIRCR is 1 - * 0b10..CM33 (CPU0) LOCK_S_VTAIRCR is 0 - * 0b11..Reserved - */ -#define AHBSC_CPU0_LOCK_REG_LOCK_S_VTAIRCR(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_CPU0_LOCK_REG_LOCK_S_VTAIRCR_SHIFT)) & AHBSC_CPU0_LOCK_REG_LOCK_S_VTAIRCR_MASK) - -#define AHBSC_CPU0_LOCK_REG_LOCK_S_MPU_MASK (0xC0U) -#define AHBSC_CPU0_LOCK_REG_LOCK_S_MPU_SHIFT (6U) -/*! LOCK_S_MPU - LOCK_S_MPU - * 0b00..Reserved - * 0b01..CM33 (CPU0) LOCK_S_MPU is 1 - * 0b10..CM33 (CPU0) LOCK_S_MPU is 0 - * 0b11..Reserved - */ -#define AHBSC_CPU0_LOCK_REG_LOCK_S_MPU(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_CPU0_LOCK_REG_LOCK_S_MPU_SHIFT)) & AHBSC_CPU0_LOCK_REG_LOCK_S_MPU_MASK) - -#define AHBSC_CPU0_LOCK_REG_LOCK_SAU_MASK (0x300U) -#define AHBSC_CPU0_LOCK_REG_LOCK_SAU_SHIFT (8U) -/*! LOCK_SAU - LOCK_SAU - * 0b00..Reserved - * 0b01..CM33 (CPU0) LOCK_SAU is 1 - * 0b10..CM33 (CPU0) LOCK_SAU is 0 - * 0b11..Reserved - */ -#define AHBSC_CPU0_LOCK_REG_LOCK_SAU(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_CPU0_LOCK_REG_LOCK_SAU_SHIFT)) & AHBSC_CPU0_LOCK_REG_LOCK_SAU_MASK) - -#define AHBSC_CPU0_LOCK_REG_CM33_LOCK_REG_LOCK_MASK (0xC0000000U) -#define AHBSC_CPU0_LOCK_REG_CM33_LOCK_REG_LOCK_SHIFT (30U) -/*! CM33_LOCK_REG_LOCK - CM33_LOCK_REG_LOCK - * 0b00..Reserved - * 0b01..CM33_LOCK_REG_LOCK is 1 - * 0b10..CM33_LOCK_REG_LOCK is 0 - * 0b11..Reserved - */ -#define AHBSC_CPU0_LOCK_REG_CM33_LOCK_REG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_CPU0_LOCK_REG_CM33_LOCK_REG_LOCK_SHIFT)) & AHBSC_CPU0_LOCK_REG_CM33_LOCK_REG_LOCK_MASK) -/*! @} */ - -/*! @name CPU1_LOCK_REG - Miscellaneous CPU1 Control Signals */ -/*! @{ */ - -#define AHBSC_CPU1_LOCK_REG_LOCK_NS_VTOR_MASK (0x3U) -#define AHBSC_CPU1_LOCK_REG_LOCK_NS_VTOR_SHIFT (0U) -/*! LOCK_NS_VTOR - LOCK_NS_VTOR - * 0b00..Reserved - * 0b01..CM33 (CPU0) LOCKNSVTOR is 1 - * 0b10..CM33 (CPU0) LOCKNSVTOR is 0 - * 0b11..Reserved - */ -#define AHBSC_CPU1_LOCK_REG_LOCK_NS_VTOR(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_CPU1_LOCK_REG_LOCK_NS_VTOR_SHIFT)) & AHBSC_CPU1_LOCK_REG_LOCK_NS_VTOR_MASK) - -#define AHBSC_CPU1_LOCK_REG_LOCK_NS_MPU_MASK (0xCU) -#define AHBSC_CPU1_LOCK_REG_LOCK_NS_MPU_SHIFT (2U) -/*! LOCK_NS_MPU - LOCK_NS_MPU - * 0b00..Reserved - * 0b01..CM33 (CPU0) LOCK_NS_MPU is 1 - * 0b10..CM33 (CPU0) LOCK_NS_MPU is 0 - * 0b11..Reserved - */ -#define AHBSC_CPU1_LOCK_REG_LOCK_NS_MPU(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_CPU1_LOCK_REG_LOCK_NS_MPU_SHIFT)) & AHBSC_CPU1_LOCK_REG_LOCK_NS_MPU_MASK) -/*! @} */ - -/*! @name MISC_CTRL_DP_REG - Secure Control Duplicate */ -/*! @{ */ - -#define AHBSC_MISC_CTRL_DP_REG_WRITE_LOCK_MASK (0x3U) -#define AHBSC_MISC_CTRL_DP_REG_WRITE_LOCK_SHIFT (0U) -/*! WRITE_LOCK - Write Lock - * 0b00..Reserved - * 0b01..Writes to this register and to the Memory and Peripheral RULE registers are not allowed - * 0b10..Writes to this register and to the Memory and Peripheral RULE registers are allowed - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_DP_REG_WRITE_LOCK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_DP_REG_WRITE_LOCK_SHIFT)) & AHBSC_MISC_CTRL_DP_REG_WRITE_LOCK_MASK) - -#define AHBSC_MISC_CTRL_DP_REG_ENABLE_SECURE_CHECKING_MASK (0xCU) -#define AHBSC_MISC_CTRL_DP_REG_ENABLE_SECURE_CHECKING_SHIFT (2U) -/*! ENABLE_SECURE_CHECKING - Enable Secure Checking - * 0b00..Reserved - * 0b01..Enables secure checking. Violation can be detected when the security level of a transaction does not - * meet the security rule of the slave or memory to be accessed. - * 0b10..Disables secure checking. Even if the security level of a transaction does not conform to the security - * rule of the slave or memory, it will not be detected as a violation. - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_DP_REG_ENABLE_SECURE_CHECKING(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_DP_REG_ENABLE_SECURE_CHECKING_SHIFT)) & AHBSC_MISC_CTRL_DP_REG_ENABLE_SECURE_CHECKING_MASK) - -#define AHBSC_MISC_CTRL_DP_REG_ENABLE_S_PRIV_CHECK_MASK (0x30U) -#define AHBSC_MISC_CTRL_DP_REG_ENABLE_S_PRIV_CHECK_SHIFT (4U) -/*! ENABLE_S_PRIV_CHECK - Enable Secure Privilege Checking - * 0b00..Reserved - * 0b01..Enables the privilege checking of secure mode access. - * 0b10..Disables the privilege checking of secure mode access. - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_DP_REG_ENABLE_S_PRIV_CHECK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_DP_REG_ENABLE_S_PRIV_CHECK_SHIFT)) & AHBSC_MISC_CTRL_DP_REG_ENABLE_S_PRIV_CHECK_MASK) - -#define AHBSC_MISC_CTRL_DP_REG_ENABLE_NS_PRIV_CHECK_MASK (0xC0U) -#define AHBSC_MISC_CTRL_DP_REG_ENABLE_NS_PRIV_CHECK_SHIFT (6U) -/*! ENABLE_NS_PRIV_CHECK - Enable Non-Secure Privilege Checking - * 0b00..Reserved - * 0b01..Enables the privilege checking of non-secure mode access. - * 0b10..Disables the privilege checking of non-secure mode access. - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_DP_REG_ENABLE_NS_PRIV_CHECK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_DP_REG_ENABLE_NS_PRIV_CHECK_SHIFT)) & AHBSC_MISC_CTRL_DP_REG_ENABLE_NS_PRIV_CHECK_MASK) - -#define AHBSC_MISC_CTRL_DP_REG_DISABLE_VIOLATION_ABORT_MASK (0x300U) -#define AHBSC_MISC_CTRL_DP_REG_DISABLE_VIOLATION_ABORT_SHIFT (8U) -/*! DISABLE_VIOLATION_ABORT - Disable Violation Abort - * 0b00..Reserved - * 0b01..The violation detected by the secure checker will not cause an abort, but a secure_violation_irq - * (interrupt request) will still be asserted and serviced by ISR. - * 0b10..The violation detected by the secure checker will cause an abort. - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_DP_REG_DISABLE_VIOLATION_ABORT(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_DP_REG_DISABLE_VIOLATION_ABORT_SHIFT)) & AHBSC_MISC_CTRL_DP_REG_DISABLE_VIOLATION_ABORT_MASK) - -#define AHBSC_MISC_CTRL_DP_REG_DISABLE_STRICT_MODE_MASK (0xC00U) -#define AHBSC_MISC_CTRL_DP_REG_DISABLE_STRICT_MODE_SHIFT (10U) -/*! DISABLE_STRICT_MODE - Disable Strict Mode - * 0b00..Reserved - * 0b01..Master can access memories and peripherals at the same level or below that level. - * 0b10..Master can access memories and peripherals at same level only - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_DP_REG_DISABLE_STRICT_MODE(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_DP_REG_DISABLE_STRICT_MODE_SHIFT)) & AHBSC_MISC_CTRL_DP_REG_DISABLE_STRICT_MODE_MASK) - -#define AHBSC_MISC_CTRL_DP_REG_IDAU_ALL_NS_MASK (0xC000U) -#define AHBSC_MISC_CTRL_DP_REG_IDAU_ALL_NS_SHIFT (14U) -/*! IDAU_ALL_NS - IDAU All Non-Secure - * 0b00..Reserved - * 0b01..IDAU is disabled, which means that all memories are attributed as non-secure memory. - * 0b10..IDAU is enabled (restrictive mode) - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_DP_REG_IDAU_ALL_NS(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_DP_REG_IDAU_ALL_NS_SHIFT)) & AHBSC_MISC_CTRL_DP_REG_IDAU_ALL_NS_MASK) -/*! @} */ - -/*! @name MISC_CTRL_REG - Secure Control */ -/*! @{ */ - -#define AHBSC_MISC_CTRL_REG_WRITE_LOCK_MASK (0x3U) -#define AHBSC_MISC_CTRL_REG_WRITE_LOCK_SHIFT (0U) -/*! WRITE_LOCK - Write Lock - * 0b00..Reserved - * 0b01..Writes to this register and to the Memory and Peripheral RULE registers are not allowed - * 0b10..Writes to this register and to the Memory and Peripheral RULE registers are allowed - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_REG_WRITE_LOCK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_REG_WRITE_LOCK_SHIFT)) & AHBSC_MISC_CTRL_REG_WRITE_LOCK_MASK) - -#define AHBSC_MISC_CTRL_REG_ENABLE_SECURE_CHECKING_MASK (0xCU) -#define AHBSC_MISC_CTRL_REG_ENABLE_SECURE_CHECKING_SHIFT (2U) -/*! ENABLE_SECURE_CHECKING - Enable Secure Checking - * 0b00..Reserved - * 0b01..Enables secure checking. Violation can be detected when the security level of a transaction does not - * meet the security rule of the slave or memory to be accessed. - * 0b10..Disables secure checking. Even if the security level of a transaction does not conform to the security - * rule of the slave or memory, it will not be detected as a violation. - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_REG_ENABLE_SECURE_CHECKING(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_REG_ENABLE_SECURE_CHECKING_SHIFT)) & AHBSC_MISC_CTRL_REG_ENABLE_SECURE_CHECKING_MASK) - -#define AHBSC_MISC_CTRL_REG_ENABLE_S_PRIV_CHECK_MASK (0x30U) -#define AHBSC_MISC_CTRL_REG_ENABLE_S_PRIV_CHECK_SHIFT (4U) -/*! ENABLE_S_PRIV_CHECK - Enable Secure Privilege Checking - * 0b00..Reserved - * 0b01..Enables privilege checking of secure mode access. - * 0b10..Disables privilege checking of secure mode access. - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_REG_ENABLE_S_PRIV_CHECK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_REG_ENABLE_S_PRIV_CHECK_SHIFT)) & AHBSC_MISC_CTRL_REG_ENABLE_S_PRIV_CHECK_MASK) - -#define AHBSC_MISC_CTRL_REG_ENABLE_NS_PRIV_CHECK_MASK (0xC0U) -#define AHBSC_MISC_CTRL_REG_ENABLE_NS_PRIV_CHECK_SHIFT (6U) -/*! ENABLE_NS_PRIV_CHECK - Enable Non-Secure Privilege Checking - * 0b00..Reserved - * 0b01..Enables privilege checking of non-secure mode access. - * 0b10..Disables privilege checking of non-secure mode access is disabled. - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_REG_ENABLE_NS_PRIV_CHECK(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_REG_ENABLE_NS_PRIV_CHECK_SHIFT)) & AHBSC_MISC_CTRL_REG_ENABLE_NS_PRIV_CHECK_MASK) - -#define AHBSC_MISC_CTRL_REG_DISABLE_VIOLATION_ABORT_MASK (0x300U) -#define AHBSC_MISC_CTRL_REG_DISABLE_VIOLATION_ABORT_SHIFT (8U) -/*! DISABLE_VIOLATION_ABORT - Disable Violation Abort - * 0b00..Reserved - * 0b01..The violation detected by the secure checker will not cause an abort, but a secure_violation_irq - * (interrupt request) will still be asserted and serviced by ISR. - * 0b10..The violation detected by the secure checker will cause an abort. - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_REG_DISABLE_VIOLATION_ABORT(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_REG_DISABLE_VIOLATION_ABORT_SHIFT)) & AHBSC_MISC_CTRL_REG_DISABLE_VIOLATION_ABORT_MASK) - -#define AHBSC_MISC_CTRL_REG_DISABLE_STRICT_MODE_MASK (0xC00U) -#define AHBSC_MISC_CTRL_REG_DISABLE_STRICT_MODE_SHIFT (10U) -/*! DISABLE_STRICT_MODE - Disable Strict Mode - * 0b00..Reserved - * 0b01..Master strict mode is on and can access memories and peripherals at the same level or below that level - * 0b10..Master strict mode is disabled and can access memories and peripherals at same level only - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_REG_DISABLE_STRICT_MODE(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_REG_DISABLE_STRICT_MODE_SHIFT)) & AHBSC_MISC_CTRL_REG_DISABLE_STRICT_MODE_MASK) - -#define AHBSC_MISC_CTRL_REG_IDAU_ALL_NS_MASK (0xC000U) -#define AHBSC_MISC_CTRL_REG_IDAU_ALL_NS_SHIFT (14U) -/*! IDAU_ALL_NS - IDAU All Non-Secure - * 0b00..Reserved - * 0b01..IDAU is disabled, which means that all memories are attributed as non-secure memory. - * 0b10..IDAU is enabled (restrictive mode) - * 0b11..Reserved - */ -#define AHBSC_MISC_CTRL_REG_IDAU_ALL_NS(x) (((uint32_t)(((uint32_t)(x)) << AHBSC_MISC_CTRL_REG_IDAU_ALL_NS_SHIFT)) & AHBSC_MISC_CTRL_REG_IDAU_ALL_NS_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group AHBSC_Register_Masks */ - - -/* AHBSC - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral AHBSC base address */ - #define AHBSC_BASE (0x50120000u) - /** Peripheral AHBSC base address */ - #define AHBSC_BASE_NS (0x40120000u) - /** Peripheral AHBSC base pointer */ - #define AHBSC ((AHBSC_Type *)AHBSC_BASE) - /** Peripheral AHBSC base pointer */ - #define AHBSC_NS ((AHBSC_Type *)AHBSC_BASE_NS) - /** Peripheral AHBSC_ALIAS1 base address */ - #define AHBSC_ALIAS1_BASE (0x50121000u) - /** Peripheral AHBSC_ALIAS1 base address */ - #define AHBSC_ALIAS1_BASE_NS (0x40121000u) - /** Peripheral AHBSC_ALIAS1 base pointer */ - #define AHBSC_ALIAS1 ((AHBSC_Type *)AHBSC_ALIAS1_BASE) - /** Peripheral AHBSC_ALIAS1 base pointer */ - #define AHBSC_ALIAS1_NS ((AHBSC_Type *)AHBSC_ALIAS1_BASE_NS) - /** Peripheral AHBSC_ALIAS2 base address */ - #define AHBSC_ALIAS2_BASE (0x50122000u) - /** Peripheral AHBSC_ALIAS2 base address */ - #define AHBSC_ALIAS2_BASE_NS (0x40122000u) - /** Peripheral AHBSC_ALIAS2 base pointer */ - #define AHBSC_ALIAS2 ((AHBSC_Type *)AHBSC_ALIAS2_BASE) - /** Peripheral AHBSC_ALIAS2 base pointer */ - #define AHBSC_ALIAS2_NS ((AHBSC_Type *)AHBSC_ALIAS2_BASE_NS) - /** Peripheral AHBSC_ALIAS3 base address */ - #define AHBSC_ALIAS3_BASE (0x50123000u) - /** Peripheral AHBSC_ALIAS3 base address */ - #define AHBSC_ALIAS3_BASE_NS (0x40123000u) - /** Peripheral AHBSC_ALIAS3 base pointer */ - #define AHBSC_ALIAS3 ((AHBSC_Type *)AHBSC_ALIAS3_BASE) - /** Peripheral AHBSC_ALIAS3 base pointer */ - #define AHBSC_ALIAS3_NS ((AHBSC_Type *)AHBSC_ALIAS3_BASE_NS) - /** Array initializer of AHBSC peripheral base addresses */ - #define AHBSC_BASE_ADDRS { AHBSC_BASE, AHBSC_ALIAS1_BASE, AHBSC_ALIAS2_BASE, AHBSC_ALIAS3_BASE } - /** Array initializer of AHBSC peripheral base pointers */ - #define AHBSC_BASE_PTRS { AHBSC, AHBSC_ALIAS1, AHBSC_ALIAS2, AHBSC_ALIAS3 } - /** Array initializer of AHBSC peripheral base addresses */ - #define AHBSC_BASE_ADDRS_NS { AHBSC_BASE_NS, AHBSC_ALIAS1_BASE_NS, AHBSC_ALIAS2_BASE_NS, AHBSC_ALIAS3_BASE_NS } - /** Array initializer of AHBSC peripheral base pointers */ - #define AHBSC_BASE_PTRS_NS { AHBSC_NS, AHBSC_ALIAS1_NS, AHBSC_ALIAS2_NS, AHBSC_ALIAS3_NS } -#else - /** Peripheral AHBSC base address */ - #define AHBSC_BASE (0x40120000u) - /** Peripheral AHBSC base pointer */ - #define AHBSC ((AHBSC_Type *)AHBSC_BASE) - /** Peripheral AHBSC_ALIAS1 base address */ - #define AHBSC_ALIAS1_BASE (0x40121000u) - /** Peripheral AHBSC_ALIAS1 base pointer */ - #define AHBSC_ALIAS1 ((AHBSC_Type *)AHBSC_ALIAS1_BASE) - /** Peripheral AHBSC_ALIAS2 base address */ - #define AHBSC_ALIAS2_BASE (0x40122000u) - /** Peripheral AHBSC_ALIAS2 base pointer */ - #define AHBSC_ALIAS2 ((AHBSC_Type *)AHBSC_ALIAS2_BASE) - /** Peripheral AHBSC_ALIAS3 base address */ - #define AHBSC_ALIAS3_BASE (0x40123000u) - /** Peripheral AHBSC_ALIAS3 base pointer */ - #define AHBSC_ALIAS3 ((AHBSC_Type *)AHBSC_ALIAS3_BASE) - /** Array initializer of AHBSC peripheral base addresses */ - #define AHBSC_BASE_ADDRS { AHBSC_BASE, AHBSC_ALIAS1_BASE, AHBSC_ALIAS2_BASE, AHBSC_ALIAS3_BASE } - /** Array initializer of AHBSC peripheral base pointers */ - #define AHBSC_BASE_PTRS { AHBSC, AHBSC_ALIAS1, AHBSC_ALIAS2, AHBSC_ALIAS3 } -#endif - -/*! - * @} - */ /* end of group AHBSC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- BSP32 Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup BSP32_Peripheral_Access_Layer BSP32 Peripheral Access Layer - * @{ - */ - -/** BSP32 - Register Layout Typedef */ -typedef struct { - __IO uint32_t OFFSET_PMEM; /**< Offset address register for program memory, offset: 0x0 */ - __IO uint32_t OFFSET_XMEM; /**< Offset address register for X-data memory, offset: 0x4 */ - __IO uint32_t OFFSET_YMEM; /**< Offset address register for Y-data memory, offset: 0x8 */ - __IO uint32_t OFFSET_MAILBOX; /**< Offset address register for mailbox peripheral, offset: 0xC */ - __O uint32_t INTERRUPTS_EXTERNAL; /**< External interrupt register, offset: 0x10 */ - __IO uint32_t INTERRUPTS_STATUS; /**< Interrupt status register, offset: 0x14 */ - __IO uint32_t CF_GATING_OVERRIDE; /**< CoolFlux BSP32 gating override, offset: 0x18 */ - __IO uint32_t IVT_OFFSET; /**< CoolFlux BSP32 IVT offset register, offset: 0x1C */ - __I uint32_t SLEEP_MODE; /**< CoolFlux BSP32 sleep mode register, offset: 0x20 */ - __IO uint32_t IVT0; /**< CoolFlux BSP32 IVT register 0 content, offset: 0x24 */ - __IO uint32_t IVT1; /**< CoolFlux BSP32 IVT register 1 content, offset: 0x28 */ - __IO uint32_t IVT2; /**< CoolFlux BSP32 IVT register 2 content, offset: 0x2C */ - __IO uint32_t IVT3; /**< CoolFlux BSP32 IVT register 3 content, offset: 0x30 */ - __IO uint32_t IVT_DISABLE; /**< CoolFlux BSP32 IVT disable register, offset: 0x34 */ -} BSP32_Type; - -/* ---------------------------------------------------------------------------- - -- BSP32 Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup BSP32_Register_Masks BSP32 Register Masks - * @{ - */ - -/*! @name OFFSET_PMEM - Offset address register for program memory */ -/*! @{ */ - -#define BSP32_OFFSET_PMEM_VAL_MASK (0x3FU) -#define BSP32_OFFSET_PMEM_VAL_SHIFT (0U) -/*! val - Offset address register for program memory */ -#define BSP32_OFFSET_PMEM_VAL(x) (((uint32_t)(((uint32_t)(x)) << BSP32_OFFSET_PMEM_VAL_SHIFT)) & BSP32_OFFSET_PMEM_VAL_MASK) -/*! @} */ - -/*! @name OFFSET_XMEM - Offset address register for X-data memory */ -/*! @{ */ - -#define BSP32_OFFSET_XMEM_VAL_MASK (0xFFU) -#define BSP32_OFFSET_XMEM_VAL_SHIFT (0U) -/*! val - Offset address register for X-data memory */ -#define BSP32_OFFSET_XMEM_VAL(x) (((uint32_t)(((uint32_t)(x)) << BSP32_OFFSET_XMEM_VAL_SHIFT)) & BSP32_OFFSET_XMEM_VAL_MASK) -/*! @} */ - -/*! @name OFFSET_YMEM - Offset address register for Y-data memory */ -/*! @{ */ - -#define BSP32_OFFSET_YMEM_VAL_MASK (0xFFU) -#define BSP32_OFFSET_YMEM_VAL_SHIFT (0U) -/*! val - Offset address register for Y-data memory */ -#define BSP32_OFFSET_YMEM_VAL(x) (((uint32_t)(((uint32_t)(x)) << BSP32_OFFSET_YMEM_VAL_SHIFT)) & BSP32_OFFSET_YMEM_VAL_MASK) -/*! @} */ - -/*! @name OFFSET_MAILBOX - Offset address register for mailbox peripheral */ -/*! @{ */ - -#define BSP32_OFFSET_MAILBOX_VAL_MASK (0xFFFFFFU) -#define BSP32_OFFSET_MAILBOX_VAL_SHIFT (0U) -/*! val - Offset address register for mailbox peripheral */ -#define BSP32_OFFSET_MAILBOX_VAL(x) (((uint32_t)(((uint32_t)(x)) << BSP32_OFFSET_MAILBOX_VAL_SHIFT)) & BSP32_OFFSET_MAILBOX_VAL_MASK) -/*! @} */ - -/*! @name INTERRUPTS_EXTERNAL - External interrupt register */ -/*! @{ */ - -#define BSP32_INTERRUPTS_EXTERNAL_VAL_MASK (0xFFFFFFFFU) -#define BSP32_INTERRUPTS_EXTERNAL_VAL_SHIFT (0U) -/*! val - External interrupt register */ -#define BSP32_INTERRUPTS_EXTERNAL_VAL(x) (((uint32_t)(((uint32_t)(x)) << BSP32_INTERRUPTS_EXTERNAL_VAL_SHIFT)) & BSP32_INTERRUPTS_EXTERNAL_VAL_MASK) -/*! @} */ - -/*! @name INTERRUPTS_STATUS - Interrupt status register */ -/*! @{ */ - -#define BSP32_INTERRUPTS_STATUS_VAL_MASK (0x1U) -#define BSP32_INTERRUPTS_STATUS_VAL_SHIFT (0U) -/*! val - Interrupt status register */ -#define BSP32_INTERRUPTS_STATUS_VAL(x) (((uint32_t)(((uint32_t)(x)) << BSP32_INTERRUPTS_STATUS_VAL_SHIFT)) & BSP32_INTERRUPTS_STATUS_VAL_MASK) -/*! @} */ - -/*! @name CF_GATING_OVERRIDE - CoolFlux BSP32 gating override */ -/*! @{ */ - -#define BSP32_CF_GATING_OVERRIDE_VAL_MASK (0x1U) -#define BSP32_CF_GATING_OVERRIDE_VAL_SHIFT (0U) -/*! val - CoolFlux BSP32 gating override */ -#define BSP32_CF_GATING_OVERRIDE_VAL(x) (((uint32_t)(((uint32_t)(x)) << BSP32_CF_GATING_OVERRIDE_VAL_SHIFT)) & BSP32_CF_GATING_OVERRIDE_VAL_MASK) -/*! @} */ - -/*! @name IVT_OFFSET - CoolFlux BSP32 IVT offset register */ -/*! @{ */ - -#define BSP32_IVT_OFFSET_VAL_MASK (0xFFFFFFU) -#define BSP32_IVT_OFFSET_VAL_SHIFT (0U) -/*! val - CoolFlux BSP32 IVT offset register */ -#define BSP32_IVT_OFFSET_VAL(x) (((uint32_t)(((uint32_t)(x)) << BSP32_IVT_OFFSET_VAL_SHIFT)) & BSP32_IVT_OFFSET_VAL_MASK) -/*! @} */ - -/*! @name SLEEP_MODE - CoolFlux BSP32 sleep mode register */ -/*! @{ */ - -#define BSP32_SLEEP_MODE_VAL_MASK (0x1U) -#define BSP32_SLEEP_MODE_VAL_SHIFT (0U) -/*! val - CoolFlux BSP32 sleep mode register */ -#define BSP32_SLEEP_MODE_VAL(x) (((uint32_t)(((uint32_t)(x)) << BSP32_SLEEP_MODE_VAL_SHIFT)) & BSP32_SLEEP_MODE_VAL_MASK) -/*! @} */ - -/*! @name IVT0 - CoolFlux BSP32 IVT register 0 content */ -/*! @{ */ - -#define BSP32_IVT0_VAL_MASK (0xFFFFFFU) -#define BSP32_IVT0_VAL_SHIFT (0U) -/*! val - CoolFlux BSP32 IVT register 0 content */ -#define BSP32_IVT0_VAL(x) (((uint32_t)(((uint32_t)(x)) << BSP32_IVT0_VAL_SHIFT)) & BSP32_IVT0_VAL_MASK) -/*! @} */ - -/*! @name IVT1 - CoolFlux BSP32 IVT register 1 content */ -/*! @{ */ - -#define BSP32_IVT1_VAL_MASK (0xFFFFFFU) -#define BSP32_IVT1_VAL_SHIFT (0U) -/*! val - CoolFlux BSP32 IVT register 1 content */ -#define BSP32_IVT1_VAL(x) (((uint32_t)(((uint32_t)(x)) << BSP32_IVT1_VAL_SHIFT)) & BSP32_IVT1_VAL_MASK) -/*! @} */ - -/*! @name IVT2 - CoolFlux BSP32 IVT register 2 content */ -/*! @{ */ - -#define BSP32_IVT2_VAL_MASK (0xFFFFFFU) -#define BSP32_IVT2_VAL_SHIFT (0U) -/*! val - CoolFlux BSP32 IVT register 2 content */ -#define BSP32_IVT2_VAL(x) (((uint32_t)(((uint32_t)(x)) << BSP32_IVT2_VAL_SHIFT)) & BSP32_IVT2_VAL_MASK) -/*! @} */ - -/*! @name IVT3 - CoolFlux BSP32 IVT register 3 content */ -/*! @{ */ - -#define BSP32_IVT3_VAL_MASK (0xFFFFFFU) -#define BSP32_IVT3_VAL_SHIFT (0U) -/*! val - CoolFlux BSP32 IVT register 3 content */ -#define BSP32_IVT3_VAL(x) (((uint32_t)(((uint32_t)(x)) << BSP32_IVT3_VAL_SHIFT)) & BSP32_IVT3_VAL_MASK) -/*! @} */ - -/*! @name IVT_DISABLE - CoolFlux BSP32 IVT disable register */ -/*! @{ */ - -#define BSP32_IVT_DISABLE_VAL_MASK (0x1U) -#define BSP32_IVT_DISABLE_VAL_SHIFT (0U) -/*! val - CoolFlux BSP32 IVT disable register */ -#define BSP32_IVT_DISABLE_VAL(x) (((uint32_t)(((uint32_t)(x)) << BSP32_IVT_DISABLE_VAL_SHIFT)) & BSP32_IVT_DISABLE_VAL_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group BSP32_Register_Masks */ - - -/* BSP32 - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral BSP32_0 base address */ - #define BSP32_0_BASE (0x50032000u) - /** Peripheral BSP32_0 base address */ - #define BSP32_0_BASE_NS (0x40032000u) - /** Peripheral BSP32_0 base pointer */ - #define BSP32_0 ((BSP32_Type *)BSP32_0_BASE) - /** Peripheral BSP32_0 base pointer */ - #define BSP32_0_NS ((BSP32_Type *)BSP32_0_BASE_NS) - /** Array initializer of BSP32 peripheral base addresses */ - #define BSP32_BASE_ADDRS { BSP32_0_BASE } - /** Array initializer of BSP32 peripheral base pointers */ - #define BSP32_BASE_PTRS { BSP32_0 } - /** Array initializer of BSP32 peripheral base addresses */ - #define BSP32_BASE_ADDRS_NS { BSP32_0_BASE_NS } - /** Array initializer of BSP32 peripheral base pointers */ - #define BSP32_BASE_PTRS_NS { BSP32_0_NS } -#else - /** Peripheral BSP32_0 base address */ - #define BSP32_0_BASE (0x40032000u) - /** Peripheral BSP32_0 base pointer */ - #define BSP32_0 ((BSP32_Type *)BSP32_0_BASE) - /** Array initializer of BSP32 peripheral base addresses */ - #define BSP32_BASE_ADDRS { BSP32_0_BASE } - /** Array initializer of BSP32 peripheral base pointers */ - #define BSP32_BASE_PTRS { BSP32_0 } -#endif - -/*! - * @} - */ /* end of group BSP32_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- CACHE64_CTRL Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CACHE64_CTRL_Peripheral_Access_Layer CACHE64_CTRL Peripheral Access Layer - * @{ - */ - -/** CACHE64_CTRL - Register Layout Typedef */ -typedef struct { - uint8_t RESERVED_0[2048]; - __IO uint32_t CCR; /**< Cache Control, offset: 0x800 */ - __IO uint32_t CLCR; /**< Cache Line Control, offset: 0x804 */ - __IO uint32_t CSAR; /**< Cache Search Address, offset: 0x808 */ - __IO uint32_t CCVR; /**< Cache Read/Write Value, offset: 0x80C */ -} CACHE64_CTRL_Type; - -/* ---------------------------------------------------------------------------- - -- CACHE64_CTRL Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CACHE64_CTRL_Register_Masks CACHE64_CTRL Register Masks - * @{ - */ - -/*! @name CCR - Cache Control */ -/*! @{ */ - -#define CACHE64_CTRL_CCR_ENCACHE_MASK (0x1U) -#define CACHE64_CTRL_CCR_ENCACHE_SHIFT (0U) -/*! ENCACHE - Cache Enable - * 0b0..Disables - * 0b1..Enables - */ -#define CACHE64_CTRL_CCR_ENCACHE(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CCR_ENCACHE_SHIFT)) & CACHE64_CTRL_CCR_ENCACHE_MASK) - -#define CACHE64_CTRL_CCR_ENWRBUF_MASK (0x2U) -#define CACHE64_CTRL_CCR_ENWRBUF_SHIFT (1U) -/*! ENWRBUF - Enable Write Buffer - * 0b0..Disables - * 0b1..Enables - */ -#define CACHE64_CTRL_CCR_ENWRBUF(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CCR_ENWRBUF_SHIFT)) & CACHE64_CTRL_CCR_ENWRBUF_MASK) - -#define CACHE64_CTRL_CCR_FRCWT_MASK (0x4U) -#define CACHE64_CTRL_CCR_FRCWT_SHIFT (2U) -/*! FRCWT - Force Write Through Mode - * 0b0..Does not force - * 0b1..Force - */ -#define CACHE64_CTRL_CCR_FRCWT(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CCR_FRCWT_SHIFT)) & CACHE64_CTRL_CCR_FRCWT_MASK) - -#define CACHE64_CTRL_CCR_FRCNOALLC_MASK (0x8U) -#define CACHE64_CTRL_CCR_FRCNOALLC_SHIFT (3U) -/*! FRCNOALLC - Forces No Allocation On Cache Misses - * 0b0..Allocation on cache misses - * 0b1..Forces no allocation on cache misses (FRCWT must be asserted) - */ -#define CACHE64_CTRL_CCR_FRCNOALLC(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CCR_FRCNOALLC_SHIFT)) & CACHE64_CTRL_CCR_FRCNOALLC_MASK) - -#define CACHE64_CTRL_CCR_INVW0_MASK (0x1000000U) -#define CACHE64_CTRL_CCR_INVW0_SHIFT (24U) -/*! INVW0 - Invalidate Way 0 - * 0b0..No operation - * 0b1..Invalidates all lines in way 0 - */ -#define CACHE64_CTRL_CCR_INVW0(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CCR_INVW0_SHIFT)) & CACHE64_CTRL_CCR_INVW0_MASK) - -#define CACHE64_CTRL_CCR_PUSHW0_MASK (0x2000000U) -#define CACHE64_CTRL_CCR_PUSHW0_SHIFT (25U) -/*! PUSHW0 - Push Way 0 - * 0b0..No operation - * 0b1..Push all modified lines in way 0 - */ -#define CACHE64_CTRL_CCR_PUSHW0(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CCR_PUSHW0_SHIFT)) & CACHE64_CTRL_CCR_PUSHW0_MASK) - -#define CACHE64_CTRL_CCR_INVW1_MASK (0x4000000U) -#define CACHE64_CTRL_CCR_INVW1_SHIFT (26U) -/*! INVW1 - Invalidate Way 1 - * 0b0..No operation - * 0b1..Invalidates all lines in way 1 - */ -#define CACHE64_CTRL_CCR_INVW1(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CCR_INVW1_SHIFT)) & CACHE64_CTRL_CCR_INVW1_MASK) - -#define CACHE64_CTRL_CCR_PUSHW1_MASK (0x8000000U) -#define CACHE64_CTRL_CCR_PUSHW1_SHIFT (27U) -/*! PUSHW1 - Push Way 1 - * 0b0..No operation - * 0b1..Push all modified lines in way 1 - */ -#define CACHE64_CTRL_CCR_PUSHW1(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CCR_PUSHW1_SHIFT)) & CACHE64_CTRL_CCR_PUSHW1_MASK) - -#define CACHE64_CTRL_CCR_GO_MASK (0x80000000U) -#define CACHE64_CTRL_CCR_GO_SHIFT (31U) -/*! GO - Initiate Cache Command - * 0b0..Write: no effect; Read: no cache command active - * 0b1..Write: initiates cache command; Read: cache command active - */ -#define CACHE64_CTRL_CCR_GO(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CCR_GO_SHIFT)) & CACHE64_CTRL_CCR_GO_MASK) -/*! @} */ - -/*! @name CLCR - Cache Line Control */ -/*! @{ */ - -#define CACHE64_CTRL_CLCR_LGO_MASK (0x1U) -#define CACHE64_CTRL_CLCR_LGO_SHIFT (0U) -/*! LGO - Initiate Cache Line Command - * 0b0..Write: no effect; Read: no line command active - * 0b1..Write: initiate line command; Read: line command active - */ -#define CACHE64_CTRL_CLCR_LGO(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CLCR_LGO_SHIFT)) & CACHE64_CTRL_CLCR_LGO_MASK) - -#define CACHE64_CTRL_CLCR_CACHEADDR_MASK (0x1FFCU) -#define CACHE64_CTRL_CLCR_CACHEADDR_SHIFT (2U) -/*! CACHEADDR - Cache Address */ -#define CACHE64_CTRL_CLCR_CACHEADDR(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CLCR_CACHEADDR_SHIFT)) & CACHE64_CTRL_CLCR_CACHEADDR_MASK) - -#define CACHE64_CTRL_CLCR_WSEL_MASK (0x4000U) -#define CACHE64_CTRL_CLCR_WSEL_SHIFT (14U) -/*! WSEL - Way Select - * 0b0..Way 0 - * 0b1..Way 1 - */ -#define CACHE64_CTRL_CLCR_WSEL(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CLCR_WSEL_SHIFT)) & CACHE64_CTRL_CLCR_WSEL_MASK) - -#define CACHE64_CTRL_CLCR_TDSEL_MASK (0x10000U) -#define CACHE64_CTRL_CLCR_TDSEL_SHIFT (16U) -/*! TDSEL - Tag Or Data Select - * 0b0..Data - * 0b1..Tag - */ -#define CACHE64_CTRL_CLCR_TDSEL(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CLCR_TDSEL_SHIFT)) & CACHE64_CTRL_CLCR_TDSEL_MASK) - -#define CACHE64_CTRL_CLCR_LCIVB_MASK (0x100000U) -#define CACHE64_CTRL_CLCR_LCIVB_SHIFT (20U) -/*! LCIVB - Line Command Initial Valid Bit - * 0b0..Initial state 0 - * 0b1..Initial state 1 - */ -#define CACHE64_CTRL_CLCR_LCIVB(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CLCR_LCIVB_SHIFT)) & CACHE64_CTRL_CLCR_LCIVB_MASK) - -#define CACHE64_CTRL_CLCR_LCIMB_MASK (0x200000U) -#define CACHE64_CTRL_CLCR_LCIMB_SHIFT (21U) -/*! LCIMB - Line Command Initial Modified Bit - * 0b0..Initial state 0 - * 0b1..Initial state 1 - */ -#define CACHE64_CTRL_CLCR_LCIMB(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CLCR_LCIMB_SHIFT)) & CACHE64_CTRL_CLCR_LCIMB_MASK) - -#define CACHE64_CTRL_CLCR_LCWAY_MASK (0x400000U) -#define CACHE64_CTRL_CLCR_LCWAY_SHIFT (22U) -/*! LCWAY - Line Command Way - * 0b0..Way 0 - * 0b1..Way 1 - */ -#define CACHE64_CTRL_CLCR_LCWAY(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CLCR_LCWAY_SHIFT)) & CACHE64_CTRL_CLCR_LCWAY_MASK) - -#define CACHE64_CTRL_CLCR_LCMD_MASK (0x3000000U) -#define CACHE64_CTRL_CLCR_LCMD_SHIFT (24U) -/*! LCMD - Line Command - * 0b00..Search and read or write - * 0b01..Invalidate - * 0b10..Push - * 0b11..Clear - */ -#define CACHE64_CTRL_CLCR_LCMD(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CLCR_LCMD_SHIFT)) & CACHE64_CTRL_CLCR_LCMD_MASK) - -#define CACHE64_CTRL_CLCR_LADSEL_MASK (0x4000000U) -#define CACHE64_CTRL_CLCR_LADSEL_SHIFT (26U) -/*! LADSEL - Line Address Select - * 0b0..Cache - * 0b1..Physical - */ -#define CACHE64_CTRL_CLCR_LADSEL(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CLCR_LADSEL_SHIFT)) & CACHE64_CTRL_CLCR_LADSEL_MASK) - -#define CACHE64_CTRL_CLCR_LACC_MASK (0x8000000U) -#define CACHE64_CTRL_CLCR_LACC_SHIFT (27U) -/*! LACC - Line Access Type - * 0b0..Read - * 0b1..Write - */ -#define CACHE64_CTRL_CLCR_LACC(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CLCR_LACC_SHIFT)) & CACHE64_CTRL_CLCR_LACC_MASK) -/*! @} */ - -/*! @name CSAR - Cache Search Address */ -/*! @{ */ - -#define CACHE64_CTRL_CSAR_LGO_MASK (0x1U) -#define CACHE64_CTRL_CSAR_LGO_SHIFT (0U) -/*! LGO - Initiate Cache Line Command - * 0b0..Write: no effect; Read: no line command active - * 0b1..Write: initiate line command; Read: line command active - */ -#define CACHE64_CTRL_CSAR_LGO(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CSAR_LGO_SHIFT)) & CACHE64_CTRL_CSAR_LGO_MASK) - -#define CACHE64_CTRL_CSAR_PHYADDR_MASK (0xFFFFFFFEU) -#define CACHE64_CTRL_CSAR_PHYADDR_SHIFT (1U) -/*! PHYADDR - Physical Address */ -#define CACHE64_CTRL_CSAR_PHYADDR(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CSAR_PHYADDR_SHIFT)) & CACHE64_CTRL_CSAR_PHYADDR_MASK) -/*! @} */ - -/*! @name CCVR - Cache Read/Write Value */ -/*! @{ */ - -#define CACHE64_CTRL_CCVR_DATA_MASK (0xFFFFFFFFU) -#define CACHE64_CTRL_CCVR_DATA_SHIFT (0U) -/*! DATA - Cache Read/Write Data */ -#define CACHE64_CTRL_CCVR_DATA(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_CTRL_CCVR_DATA_SHIFT)) & CACHE64_CTRL_CCVR_DATA_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group CACHE64_CTRL_Register_Masks */ - - -/* CACHE64_CTRL - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral CACHE64_CTRL0 base address */ - #define CACHE64_CTRL0_BASE (0x5001B000u) - /** Peripheral CACHE64_CTRL0 base address */ - #define CACHE64_CTRL0_BASE_NS (0x4001B000u) - /** Peripheral CACHE64_CTRL0 base pointer */ - #define CACHE64_CTRL0 ((CACHE64_CTRL_Type *)CACHE64_CTRL0_BASE) - /** Peripheral CACHE64_CTRL0 base pointer */ - #define CACHE64_CTRL0_NS ((CACHE64_CTRL_Type *)CACHE64_CTRL0_BASE_NS) - /** Array initializer of CACHE64_CTRL peripheral base addresses */ - #define CACHE64_CTRL_BASE_ADDRS { CACHE64_CTRL0_BASE } - /** Array initializer of CACHE64_CTRL peripheral base pointers */ - #define CACHE64_CTRL_BASE_PTRS { CACHE64_CTRL0 } - /** Array initializer of CACHE64_CTRL peripheral base addresses */ - #define CACHE64_CTRL_BASE_ADDRS_NS { CACHE64_CTRL0_BASE_NS } - /** Array initializer of CACHE64_CTRL peripheral base pointers */ - #define CACHE64_CTRL_BASE_PTRS_NS { CACHE64_CTRL0_NS } -#else - /** Peripheral CACHE64_CTRL0 base address */ - #define CACHE64_CTRL0_BASE (0x4001B000u) - /** Peripheral CACHE64_CTRL0 base pointer */ - #define CACHE64_CTRL0 ((CACHE64_CTRL_Type *)CACHE64_CTRL0_BASE) - /** Array initializer of CACHE64_CTRL peripheral base addresses */ - #define CACHE64_CTRL_BASE_ADDRS { CACHE64_CTRL0_BASE } - /** Array initializer of CACHE64_CTRL peripheral base pointers */ - #define CACHE64_CTRL_BASE_PTRS { CACHE64_CTRL0 } -#endif -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) -/** CACHE64_CTRL physical memory base address */ - #define CACHE64_CTRL_PHYMEM_BASES { 0x18000000u, 0x90000000u, 0xB0000000u} -/** CACHE64_CTRL physical memory size */ - #define CACHE64_CTRL_PHYMEM_SIZES { 0x08000000u, 0x10000000u, 0x10000000u} -/** CACHE64_CTRL physical memory base address */ - #define CACHE64_CTRL_PHYMEM_BASES_NS { 0x08000000u, 0x80000000u, 0xA0000000u} -/** CACHE64_CTRL physical memory size */ - #define CACHE64_CTRL_PHYMEM_SIZES_NS { 0x08000000u, 0x10000000u, 0x10000000u} -#else -/** CACHE64_CTRL physical memory base address */ - #define CACHE64_CTRL_PHYMEM_BASES { 0x08000000u, 0x80000000u, 0xA0000000u} -/** CACHE64_CTRL physical memory size */ - #define CACHE64_CTRL_PHYMEM_SIZES { 0x08000000u, 0x10000000u, 0x10000000u} -#endif -/* Backward compatibility */ - - -/*! - * @} - */ /* end of group CACHE64_CTRL_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- CACHE64_POLSEL Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CACHE64_POLSEL_Peripheral_Access_Layer CACHE64_POLSEL Peripheral Access Layer - * @{ - */ - -/** CACHE64_POLSEL - Register Layout Typedef */ -typedef struct { - uint8_t RESERVED_0[20]; - __IO uint32_t REG0_TOP; /**< Region 0 Top Boundary, offset: 0x14 */ - __IO uint32_t REG1_TOP; /**< Region 1 Top Boundary, offset: 0x18 */ - __IO uint32_t POLSEL; /**< Policy Select, offset: 0x1C */ -} CACHE64_POLSEL_Type; - -/* ---------------------------------------------------------------------------- - -- CACHE64_POLSEL Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CACHE64_POLSEL_Register_Masks CACHE64_POLSEL Register Masks - * @{ - */ - -/*! @name REG0_TOP - Region 0 Top Boundary */ -/*! @{ */ - -#define CACHE64_POLSEL_REG0_TOP_REG0_TOP_MASK (0x1FFFFC00U) -#define CACHE64_POLSEL_REG0_TOP_REG0_TOP_SHIFT (10U) -/*! REG0_TOP - Upper Limit Of Region 0 */ -#define CACHE64_POLSEL_REG0_TOP_REG0_TOP(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_POLSEL_REG0_TOP_REG0_TOP_SHIFT)) & CACHE64_POLSEL_REG0_TOP_REG0_TOP_MASK) -/*! @} */ - -/*! @name REG1_TOP - Region 1 Top Boundary */ -/*! @{ */ - -#define CACHE64_POLSEL_REG1_TOP_REG1_TOP_MASK (0x1FFFFC00U) -#define CACHE64_POLSEL_REG1_TOP_REG1_TOP_SHIFT (10U) -/*! REG1_TOP - Upper Limit Of Region 1 */ -#define CACHE64_POLSEL_REG1_TOP_REG1_TOP(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_POLSEL_REG1_TOP_REG1_TOP_SHIFT)) & CACHE64_POLSEL_REG1_TOP_REG1_TOP_MASK) -/*! @} */ - -/*! @name POLSEL - Policy Select */ -/*! @{ */ - -#define CACHE64_POLSEL_POLSEL_REG0_POLICY_MASK (0x3U) -#define CACHE64_POLSEL_POLSEL_REG0_POLICY_SHIFT (0U) -/*! REG0_POLICY - Policy Select For Region 0 - * 0b00..Noncacheable - * 0b01..Write-through - * 0b10..Write-back - * 0b11..Invalid - */ -#define CACHE64_POLSEL_POLSEL_REG0_POLICY(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_POLSEL_POLSEL_REG0_POLICY_SHIFT)) & CACHE64_POLSEL_POLSEL_REG0_POLICY_MASK) - -#define CACHE64_POLSEL_POLSEL_REG1_POLICY_MASK (0xCU) -#define CACHE64_POLSEL_POLSEL_REG1_POLICY_SHIFT (2U) -/*! REG1_POLICY - Policy Select For Region 1 - * 0b00..Noncacheable - * 0b01..Write-through - * 0b10..Write-back - * 0b11..Invalid - */ -#define CACHE64_POLSEL_POLSEL_REG1_POLICY(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_POLSEL_POLSEL_REG1_POLICY_SHIFT)) & CACHE64_POLSEL_POLSEL_REG1_POLICY_MASK) - -#define CACHE64_POLSEL_POLSEL_REG2_POLICY_MASK (0x30U) -#define CACHE64_POLSEL_POLSEL_REG2_POLICY_SHIFT (4U) -/*! REG2_POLICY - Policy Select For Region 2 - * 0b00..Noncacheable - * 0b01..Write-through - * 0b10..Write-back - * 0b11..Invalid - */ -#define CACHE64_POLSEL_POLSEL_REG2_POLICY(x) (((uint32_t)(((uint32_t)(x)) << CACHE64_POLSEL_POLSEL_REG2_POLICY_SHIFT)) & CACHE64_POLSEL_POLSEL_REG2_POLICY_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group CACHE64_POLSEL_Register_Masks */ - - -/* CACHE64_POLSEL - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral CACHE64_POLSEL0 base address */ - #define CACHE64_POLSEL0_BASE (0x5001B000u) - /** Peripheral CACHE64_POLSEL0 base address */ - #define CACHE64_POLSEL0_BASE_NS (0x4001B000u) - /** Peripheral CACHE64_POLSEL0 base pointer */ - #define CACHE64_POLSEL0 ((CACHE64_POLSEL_Type *)CACHE64_POLSEL0_BASE) - /** Peripheral CACHE64_POLSEL0 base pointer */ - #define CACHE64_POLSEL0_NS ((CACHE64_POLSEL_Type *)CACHE64_POLSEL0_BASE_NS) - /** Array initializer of CACHE64_POLSEL peripheral base addresses */ - #define CACHE64_POLSEL_BASE_ADDRS { CACHE64_POLSEL0_BASE } - /** Array initializer of CACHE64_POLSEL peripheral base pointers */ - #define CACHE64_POLSEL_BASE_PTRS { CACHE64_POLSEL0 } - /** Array initializer of CACHE64_POLSEL peripheral base addresses */ - #define CACHE64_POLSEL_BASE_ADDRS_NS { CACHE64_POLSEL0_BASE_NS } - /** Array initializer of CACHE64_POLSEL peripheral base pointers */ - #define CACHE64_POLSEL_BASE_PTRS_NS { CACHE64_POLSEL0_NS } -#else - /** Peripheral CACHE64_POLSEL0 base address */ - #define CACHE64_POLSEL0_BASE (0x4001B000u) - /** Peripheral CACHE64_POLSEL0 base pointer */ - #define CACHE64_POLSEL0 ((CACHE64_POLSEL_Type *)CACHE64_POLSEL0_BASE) - /** Array initializer of CACHE64_POLSEL peripheral base addresses */ - #define CACHE64_POLSEL_BASE_ADDRS { CACHE64_POLSEL0_BASE } - /** Array initializer of CACHE64_POLSEL peripheral base pointers */ - #define CACHE64_POLSEL_BASE_PTRS { CACHE64_POLSEL0 } -#endif - -/*! - * @} - */ /* end of group CACHE64_POLSEL_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- CAN Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CAN_Peripheral_Access_Layer CAN Peripheral Access Layer - * @{ - */ - -/** CAN - Register Layout Typedef */ -typedef struct { - __IO uint32_t MCR; /**< Module Configuration, offset: 0x0 */ - __IO uint32_t CTRL1; /**< Control 1, offset: 0x4 */ - __IO uint32_t TIMER; /**< Free-Running Timer, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __IO uint32_t RXMGMASK; /**< RX Message Buffers Global Mask, offset: 0x10 */ - __IO uint32_t RX14MASK; /**< Receive 14 Mask, offset: 0x14 */ - __IO uint32_t RX15MASK; /**< Receive 15 Mask, offset: 0x18 */ - __IO uint32_t ECR; /**< Error Counter, offset: 0x1C */ - __IO uint32_t ESR1; /**< Error and Status 1, offset: 0x20 */ - uint8_t RESERVED_1[4]; - __IO uint32_t IMASK1; /**< Interrupt Masks 1, offset: 0x28 */ - uint8_t RESERVED_2[4]; - __IO uint32_t IFLAG1; /**< Interrupt Flags 1, offset: 0x30 */ - __IO uint32_t CTRL2; /**< Control 2, offset: 0x34 */ - __I uint32_t ESR2; /**< Error and Status 2, offset: 0x38 */ - uint8_t RESERVED_3[8]; - __I uint32_t CRCR; /**< Cyclic Redundancy Check, offset: 0x44 */ - __IO uint32_t RXFGMASK; /**< Legacy RX FIFO Global Mask, offset: 0x48 */ - __I uint32_t RXFIR; /**< Legacy RX FIFO Information, offset: 0x4C */ - __IO uint32_t CBT; /**< CAN Bit Timing, offset: 0x50 */ - uint8_t RESERVED_4[44]; - union { /* offset: 0x80 */ - struct { /* offset: 0x80, array step: 0x10 */ - __IO uint32_t CS; /**< Message Buffer 0 CS Register..Message Buffer 31 CS Register, array offset: 0x80, array step: 0x10 */ - __IO uint32_t ID; /**< Message Buffer 0 ID Register..Message Buffer 31 ID Register, array offset: 0x84, array step: 0x10 */ - __IO uint32_t WORD[2]; /**< Message Buffer 0 WORD_8B Register..Message Buffer 31 WORD_8B Register, array offset: 0x88, array step: index*0x10, index2*0x4 */ - } MB_8B[32]; - struct { /* offset: 0x80, array step: 0x18 */ - __IO uint32_t CS; /**< Message Buffer 0 CS Register..Message Buffer 20 CS Register, array offset: 0x80, array step: 0x18 */ - __IO uint32_t ID; /**< Message Buffer 0 ID Register..Message Buffer 20 ID Register, array offset: 0x84, array step: 0x18 */ - __IO uint32_t WORD[4]; /**< Message Buffer 0 WORD_16B Register..Message Buffer 20 WORD_16B Register, array offset: 0x88, array step: index*0x18, index2*0x4 */ - } MB_16B[21]; - struct { /* offset: 0x80, array step: 0x28 */ - __IO uint32_t CS; /**< Message Buffer 0 CS Register..Message Buffer 11 CS Register, array offset: 0x80, array step: 0x28 */ - __IO uint32_t ID; /**< Message Buffer 0 ID Register..Message Buffer 11 ID Register, array offset: 0x84, array step: 0x28 */ - __IO uint32_t WORD[8]; /**< Message Buffer 0 WORD_32B Register..Message Buffer 11 WORD_32B Register, array offset: 0x88, array step: index*0x28, index2*0x4 */ - } MB_32B[12]; - struct { /* offset: 0x80, array step: 0x48 */ - __IO uint32_t CS; /**< Message Buffer 0 CS Register..Message Buffer 6 CS Register, array offset: 0x80, array step: 0x48 */ - __IO uint32_t ID; /**< Message Buffer 0 ID Register..Message Buffer 6 ID Register, array offset: 0x84, array step: 0x48 */ - __IO uint32_t WORD[16]; /**< Message Buffer 0 WORD_64B Register..Message Buffer 6 WORD_64B Register, array offset: 0x88, array step: index*0x48, index2*0x4 */ - } MB_64B[7]; - struct { /* offset: 0x80, array step: 0x10 */ - __IO uint32_t CS; /**< Message Buffer 0 CS Register..Message Buffer 31 CS Register, array offset: 0x80, array step: 0x10 */ - __IO uint32_t ID; /**< Message Buffer 0 ID Register..Message Buffer 31 ID Register, array offset: 0x84, array step: 0x10 */ - __IO uint32_t WORD0; /**< Message Buffer 0 WORD0 Register..Message Buffer 31 WORD0 Register, array offset: 0x88, array step: 0x10 */ - __IO uint32_t WORD1; /**< Message Buffer 0 WORD1 Register..Message Buffer 31 WORD1 Register, array offset: 0x8C, array step: 0x10 */ - } MB[32]; - }; - uint8_t RESERVED_5[1536]; - __IO uint32_t RXIMR[32]; /**< Receive Individual Mask, array offset: 0x880, array step: 0x4 */ - uint8_t RESERVED_6[512]; - __IO uint32_t CTRL1_PN; /**< Pretended Networking Control 1, offset: 0xB00 */ - __IO uint32_t CTRL2_PN; /**< Pretended Networking Control 2, offset: 0xB04 */ - __IO uint32_t WU_MTC; /**< Pretended Networking Wake-Up Match, offset: 0xB08 */ - __IO uint32_t FLT_ID1; /**< Pretended Networking ID Filter 1, offset: 0xB0C */ - __IO uint32_t FLT_DLC; /**< Pretended Networking Data Length Code (DLC) Filter, offset: 0xB10 */ - __IO uint32_t PL1_LO; /**< Pretended Networking Payload Low Filter 1, offset: 0xB14 */ - __IO uint32_t PL1_HI; /**< Pretended Networking Payload High Filter 1, offset: 0xB18 */ - __IO uint32_t FLT_ID2_IDMASK; /**< Pretended Networking ID Filter 2 or ID Mask, offset: 0xB1C */ - __IO uint32_t PL2_PLMASK_LO; /**< Pretended Networking Payload Low Filter 2 and Payload Low Mask, offset: 0xB20 */ - __IO uint32_t PL2_PLMASK_HI; /**< Pretended Networking Payload High Filter 2 and Payload High Mask, offset: 0xB24 */ - uint8_t RESERVED_7[24]; - struct { /* offset: 0xB40, array step: 0x10 */ - __I uint32_t CS; /**< Wake-Up Message Buffer, array offset: 0xB40, array step: 0x10 */ - __I uint32_t ID; /**< Wake-Up Message Buffer for ID, array offset: 0xB44, array step: 0x10 */ - __I uint32_t D03; /**< Wake-Up Message Buffer for Data 0-3, array offset: 0xB48, array step: 0x10 */ - __I uint32_t D47; /**< Wake-Up Message Buffer Register Data 4-7, array offset: 0xB4C, array step: 0x10 */ - } WMB[4]; - uint8_t RESERVED_8[112]; - __IO uint32_t EPRS; /**< Enhanced CAN Bit Timing Prescalers, offset: 0xBF0 */ - __IO uint32_t ENCBT; /**< Enhanced Nominal CAN Bit Timing, offset: 0xBF4 */ - __IO uint32_t EDCBT; /**< Enhanced Data Phase CAN Bit Timing, offset: 0xBF8 */ - __IO uint32_t ETDC; /**< Enhanced Transceiver Delay Compensation, offset: 0xBFC */ - __IO uint32_t FDCTRL; /**< CAN FD Control, offset: 0xC00 */ - __IO uint32_t FDCBT; /**< CAN FD Bit Timing, offset: 0xC04 */ - __I uint32_t FDCRC; /**< CAN FD CRC, offset: 0xC08 */ - __IO uint32_t ERFCR; /**< Enhanced RX FIFO Control, offset: 0xC0C */ - __IO uint32_t ERFIER; /**< Enhanced RX FIFO Interrupt Enable, offset: 0xC10 */ - __IO uint32_t ERFSR; /**< Enhanced RX FIFO Status, offset: 0xC14 */ - uint8_t RESERVED_9[9192]; - __IO uint32_t ERFFEL[32]; /**< Enhanced RX FIFO Filter Element, array offset: 0x3000, array step: 0x4 */ -} CAN_Type; - -/* ---------------------------------------------------------------------------- - -- CAN Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CAN_Register_Masks CAN Register Masks - * @{ - */ - -/*! @name MCR - Module Configuration */ -/*! @{ */ - -#define CAN_MCR_MAXMB_MASK (0x7FU) -#define CAN_MCR_MAXMB_SHIFT (0U) -/*! MAXMB - Number of the Last Message Buffer */ -#define CAN_MCR_MAXMB(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_MAXMB_SHIFT)) & CAN_MCR_MAXMB_MASK) - -#define CAN_MCR_IDAM_MASK (0x300U) -#define CAN_MCR_IDAM_SHIFT (8U) -/*! IDAM - ID Acceptance Mode - * 0b00..Format A: One full ID (standard and extended) per ID filter table element. - * 0b01..Format B: Two full standard IDs or two partial 14-bit (standard and extended) IDs per ID filter table element. - * 0b10..Format C: Four partial 8-bit standard IDs per ID filter table element. - * 0b11..Format D: All frames rejected. - */ -#define CAN_MCR_IDAM(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_IDAM_SHIFT)) & CAN_MCR_IDAM_MASK) - -#define CAN_MCR_FDEN_MASK (0x800U) -#define CAN_MCR_FDEN_SHIFT (11U) -/*! FDEN - CAN FD Operation Enable - * 0b1..Enable - * 0b0..Disable - */ -#define CAN_MCR_FDEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_FDEN_SHIFT)) & CAN_MCR_FDEN_MASK) - -#define CAN_MCR_AEN_MASK (0x1000U) -#define CAN_MCR_AEN_SHIFT (12U) -/*! AEN - Abort Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define CAN_MCR_AEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_AEN_SHIFT)) & CAN_MCR_AEN_MASK) - -#define CAN_MCR_LPRIOEN_MASK (0x2000U) -#define CAN_MCR_LPRIOEN_SHIFT (13U) -/*! LPRIOEN - Local Priority Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_LPRIOEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_LPRIOEN_SHIFT)) & CAN_MCR_LPRIOEN_MASK) - -#define CAN_MCR_PNET_EN_MASK (0x4000U) -#define CAN_MCR_PNET_EN_SHIFT (14U) -/*! PNET_EN - Pretended Networking Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_PNET_EN(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_PNET_EN_SHIFT)) & CAN_MCR_PNET_EN_MASK) - -#define CAN_MCR_DMA_MASK (0x8000U) -#define CAN_MCR_DMA_SHIFT (15U) -/*! DMA - DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_DMA(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_DMA_SHIFT)) & CAN_MCR_DMA_MASK) - -#define CAN_MCR_IRMQ_MASK (0x10000U) -#define CAN_MCR_IRMQ_SHIFT (16U) -/*! IRMQ - Individual RX Masking and Queue Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_IRMQ(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_IRMQ_SHIFT)) & CAN_MCR_IRMQ_MASK) - -#define CAN_MCR_SRXDIS_MASK (0x20000U) -#define CAN_MCR_SRXDIS_SHIFT (17U) -/*! SRXDIS - Self-Reception Disable - * 0b0..Enable - * 0b1..Disable - */ -#define CAN_MCR_SRXDIS(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_SRXDIS_SHIFT)) & CAN_MCR_SRXDIS_MASK) - -#define CAN_MCR_WAKSRC_MASK (0x80000U) -#define CAN_MCR_WAKSRC_SHIFT (19U) -/*! WAKSRC - Wake-Up Source - * 0b0..No filter applied - * 0b1..Filter applied - */ -#define CAN_MCR_WAKSRC(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_WAKSRC_SHIFT)) & CAN_MCR_WAKSRC_MASK) - -#define CAN_MCR_LPMACK_MASK (0x100000U) -#define CAN_MCR_LPMACK_SHIFT (20U) -/*! LPMACK - Low-Power Mode Acknowledge - * 0b0..Not in a low-power mode - * 0b1..In a low-power mode - */ -#define CAN_MCR_LPMACK(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_LPMACK_SHIFT)) & CAN_MCR_LPMACK_MASK) - -#define CAN_MCR_WRNEN_MASK (0x200000U) -#define CAN_MCR_WRNEN_SHIFT (21U) -/*! WRNEN - Warning Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_WRNEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_WRNEN_SHIFT)) & CAN_MCR_WRNEN_MASK) - -#define CAN_MCR_SLFWAK_MASK (0x400000U) -#define CAN_MCR_SLFWAK_SHIFT (22U) -/*! SLFWAK - Self Wake-up - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_SLFWAK(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_SLFWAK_SHIFT)) & CAN_MCR_SLFWAK_MASK) - -#define CAN_MCR_FRZACK_MASK (0x1000000U) -#define CAN_MCR_FRZACK_SHIFT (24U) -/*! FRZACK - Freeze Mode Acknowledge - * 0b0..Not in Freeze mode, prescaler running. - * 0b1..In Freeze mode, prescaler stopped. - */ -#define CAN_MCR_FRZACK(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_FRZACK_SHIFT)) & CAN_MCR_FRZACK_MASK) - -#define CAN_MCR_SOFTRST_MASK (0x2000000U) -#define CAN_MCR_SOFTRST_SHIFT (25U) -/*! SOFTRST - Soft Reset - * 0b0..No reset - * 0b1..Soft reset affects reset registers - */ -#define CAN_MCR_SOFTRST(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_SOFTRST_SHIFT)) & CAN_MCR_SOFTRST_MASK) - -#define CAN_MCR_WAKMSK_MASK (0x4000000U) -#define CAN_MCR_WAKMSK_SHIFT (26U) -/*! WAKMSK - Wake-up Interrupt Mask - * 0b0..Disabled - * 0b1..Enabled - */ -#define CAN_MCR_WAKMSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_WAKMSK_SHIFT)) & CAN_MCR_WAKMSK_MASK) - -#define CAN_MCR_NOTRDY_MASK (0x8000000U) -#define CAN_MCR_NOTRDY_SHIFT (27U) -/*! NOTRDY - FlexCAN Not Ready - * 0b0..FlexCAN is in Normal mode, Listen-Only mode, or Loopback mode. - * 0b1..FlexCAN is in Disable mode, Stop mode, or Freeze mode. - */ -#define CAN_MCR_NOTRDY(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_NOTRDY_SHIFT)) & CAN_MCR_NOTRDY_MASK) - -#define CAN_MCR_HALT_MASK (0x10000000U) -#define CAN_MCR_HALT_SHIFT (28U) -/*! HALT - Halt FlexCAN - * 0b0..No request - * 0b1..Enter Freeze mode, if MCR[FRZ] = 1. - */ -#define CAN_MCR_HALT(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_HALT_SHIFT)) & CAN_MCR_HALT_MASK) - -#define CAN_MCR_RFEN_MASK (0x20000000U) -#define CAN_MCR_RFEN_SHIFT (29U) -/*! RFEN - Legacy RX FIFO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_RFEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_RFEN_SHIFT)) & CAN_MCR_RFEN_MASK) - -#define CAN_MCR_FRZ_MASK (0x40000000U) -#define CAN_MCR_FRZ_SHIFT (30U) -/*! FRZ - Freeze Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_MCR_FRZ(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_FRZ_SHIFT)) & CAN_MCR_FRZ_MASK) - -#define CAN_MCR_MDIS_MASK (0x80000000U) -#define CAN_MCR_MDIS_SHIFT (31U) -/*! MDIS - Module Disable - * 0b0..Enable - * 0b1..Disable - */ -#define CAN_MCR_MDIS(x) (((uint32_t)(((uint32_t)(x)) << CAN_MCR_MDIS_SHIFT)) & CAN_MCR_MDIS_MASK) -/*! @} */ - -/*! @name CTRL1 - Control 1 */ -/*! @{ */ - -#define CAN_CTRL1_PROPSEG_MASK (0x7U) -#define CAN_CTRL1_PROPSEG_SHIFT (0U) -/*! PROPSEG - Propagation Segment */ -#define CAN_CTRL1_PROPSEG(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PROPSEG_SHIFT)) & CAN_CTRL1_PROPSEG_MASK) - -#define CAN_CTRL1_LOM_MASK (0x8U) -#define CAN_CTRL1_LOM_SHIFT (3U) -/*! LOM - Listen-Only Mode - * 0b0..Listen-Only mode is deactivated. - * 0b1..FlexCAN module operates in Listen-Only mode. - */ -#define CAN_CTRL1_LOM(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_LOM_SHIFT)) & CAN_CTRL1_LOM_MASK) - -#define CAN_CTRL1_LBUF_MASK (0x10U) -#define CAN_CTRL1_LBUF_SHIFT (4U) -/*! LBUF - Lowest Buffer Transmitted First - * 0b0..Buffer with highest priority is transmitted first. - * 0b1..Lowest number buffer is transmitted first. - */ -#define CAN_CTRL1_LBUF(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_LBUF_SHIFT)) & CAN_CTRL1_LBUF_MASK) - -#define CAN_CTRL1_TSYN_MASK (0x20U) -#define CAN_CTRL1_TSYN_SHIFT (5U) -/*! TSYN - Timer Sync - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL1_TSYN(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_TSYN_SHIFT)) & CAN_CTRL1_TSYN_MASK) - -#define CAN_CTRL1_BOFFREC_MASK (0x40U) -#define CAN_CTRL1_BOFFREC_SHIFT (6U) -/*! BOFFREC - Bus Off Recovery - * 0b0..Enabled - * 0b1..Disabled - */ -#define CAN_CTRL1_BOFFREC(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_BOFFREC_SHIFT)) & CAN_CTRL1_BOFFREC_MASK) - -#define CAN_CTRL1_SMP_MASK (0x80U) -#define CAN_CTRL1_SMP_SHIFT (7U) -/*! SMP - CAN Bit Sampling - * 0b0..One sample is used to determine the bit value. - * 0b1..Three samples are used to determine the value of the received bit: the regular one (sample point) and two - * preceding samples. A majority rule is used. - */ -#define CAN_CTRL1_SMP(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_SMP_SHIFT)) & CAN_CTRL1_SMP_MASK) - -#define CAN_CTRL1_RWRNMSK_MASK (0x400U) -#define CAN_CTRL1_RWRNMSK_SHIFT (10U) -/*! RWRNMSK - RX Warning Interrupt Mask - * 0b0..Disabled - * 0b1..Enabled - */ -#define CAN_CTRL1_RWRNMSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_RWRNMSK_SHIFT)) & CAN_CTRL1_RWRNMSK_MASK) - -#define CAN_CTRL1_TWRNMSK_MASK (0x800U) -#define CAN_CTRL1_TWRNMSK_SHIFT (11U) -/*! TWRNMSK - TX Warning Interrupt Mask - * 0b0..Disabled - * 0b1..Enabled - */ -#define CAN_CTRL1_TWRNMSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_TWRNMSK_SHIFT)) & CAN_CTRL1_TWRNMSK_MASK) - -#define CAN_CTRL1_LPB_MASK (0x1000U) -#define CAN_CTRL1_LPB_SHIFT (12U) -/*! LPB - Loopback Mode - * 0b0..Disabled - * 0b1..Enabled - */ -#define CAN_CTRL1_LPB(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_LPB_SHIFT)) & CAN_CTRL1_LPB_MASK) - -#define CAN_CTRL1_ERRMSK_MASK (0x4000U) -#define CAN_CTRL1_ERRMSK_SHIFT (14U) -/*! ERRMSK - Error Interrupt Mask - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CAN_CTRL1_ERRMSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_ERRMSK_SHIFT)) & CAN_CTRL1_ERRMSK_MASK) - -#define CAN_CTRL1_BOFFMSK_MASK (0x8000U) -#define CAN_CTRL1_BOFFMSK_SHIFT (15U) -/*! BOFFMSK - Bus Off Interrupt Mask - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CAN_CTRL1_BOFFMSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_BOFFMSK_SHIFT)) & CAN_CTRL1_BOFFMSK_MASK) - -#define CAN_CTRL1_PSEG2_MASK (0x70000U) -#define CAN_CTRL1_PSEG2_SHIFT (16U) -/*! PSEG2 - Phase Segment 2 */ -#define CAN_CTRL1_PSEG2(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PSEG2_SHIFT)) & CAN_CTRL1_PSEG2_MASK) - -#define CAN_CTRL1_PSEG1_MASK (0x380000U) -#define CAN_CTRL1_PSEG1_SHIFT (19U) -/*! PSEG1 - Phase Segment 1 */ -#define CAN_CTRL1_PSEG1(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PSEG1_SHIFT)) & CAN_CTRL1_PSEG1_MASK) - -#define CAN_CTRL1_RJW_MASK (0xC00000U) -#define CAN_CTRL1_RJW_SHIFT (22U) -/*! RJW - Resync Jump Width */ -#define CAN_CTRL1_RJW(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_RJW_SHIFT)) & CAN_CTRL1_RJW_MASK) - -#define CAN_CTRL1_PRESDIV_MASK (0xFF000000U) -#define CAN_CTRL1_PRESDIV_SHIFT (24U) -/*! PRESDIV - Prescaler Division Factor */ -#define CAN_CTRL1_PRESDIV(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PRESDIV_SHIFT)) & CAN_CTRL1_PRESDIV_MASK) -/*! @} */ - -/*! @name TIMER - Free-Running Timer */ -/*! @{ */ - -#define CAN_TIMER_TIMER_MASK (0xFFFFU) -#define CAN_TIMER_TIMER_SHIFT (0U) -/*! TIMER - Timer Value */ -#define CAN_TIMER_TIMER(x) (((uint32_t)(((uint32_t)(x)) << CAN_TIMER_TIMER_SHIFT)) & CAN_TIMER_TIMER_MASK) -/*! @} */ - -/*! @name RXMGMASK - RX Message Buffers Global Mask */ -/*! @{ */ - -#define CAN_RXMGMASK_MG_MASK (0xFFFFFFFFU) -#define CAN_RXMGMASK_MG_SHIFT (0U) -/*! MG - Global Mask for RX Message Buffers */ -#define CAN_RXMGMASK_MG(x) (((uint32_t)(((uint32_t)(x)) << CAN_RXMGMASK_MG_SHIFT)) & CAN_RXMGMASK_MG_MASK) -/*! @} */ - -/*! @name RX14MASK - Receive 14 Mask */ -/*! @{ */ - -#define CAN_RX14MASK_RX14M_MASK (0xFFFFFFFFU) -#define CAN_RX14MASK_RX14M_SHIFT (0U) -/*! RX14M - RX Buffer 14 Mask Bits */ -#define CAN_RX14MASK_RX14M(x) (((uint32_t)(((uint32_t)(x)) << CAN_RX14MASK_RX14M_SHIFT)) & CAN_RX14MASK_RX14M_MASK) -/*! @} */ - -/*! @name RX15MASK - Receive 15 Mask */ -/*! @{ */ - -#define CAN_RX15MASK_RX15M_MASK (0xFFFFFFFFU) -#define CAN_RX15MASK_RX15M_SHIFT (0U) -/*! RX15M - RX Buffer 15 Mask Bits */ -#define CAN_RX15MASK_RX15M(x) (((uint32_t)(((uint32_t)(x)) << CAN_RX15MASK_RX15M_SHIFT)) & CAN_RX15MASK_RX15M_MASK) -/*! @} */ - -/*! @name ECR - Error Counter */ -/*! @{ */ - -#define CAN_ECR_TXERRCNT_MASK (0xFFU) -#define CAN_ECR_TXERRCNT_SHIFT (0U) -/*! TXERRCNT - Transmit Error Counter */ -#define CAN_ECR_TXERRCNT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ECR_TXERRCNT_SHIFT)) & CAN_ECR_TXERRCNT_MASK) - -#define CAN_ECR_RXERRCNT_MASK (0xFF00U) -#define CAN_ECR_RXERRCNT_SHIFT (8U) -/*! RXERRCNT - Receive Error Counter */ -#define CAN_ECR_RXERRCNT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ECR_RXERRCNT_SHIFT)) & CAN_ECR_RXERRCNT_MASK) - -#define CAN_ECR_TXERRCNT_FAST_MASK (0xFF0000U) -#define CAN_ECR_TXERRCNT_FAST_SHIFT (16U) -/*! TXERRCNT_FAST - Transmit Error Counter for Fast Bits */ -#define CAN_ECR_TXERRCNT_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ECR_TXERRCNT_FAST_SHIFT)) & CAN_ECR_TXERRCNT_FAST_MASK) - -#define CAN_ECR_RXERRCNT_FAST_MASK (0xFF000000U) -#define CAN_ECR_RXERRCNT_FAST_SHIFT (24U) -/*! RXERRCNT_FAST - Receive Error Counter for Fast Bits */ -#define CAN_ECR_RXERRCNT_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ECR_RXERRCNT_FAST_SHIFT)) & CAN_ECR_RXERRCNT_FAST_MASK) -/*! @} */ - -/*! @name ESR1 - Error and Status 1 */ -/*! @{ */ - -#define CAN_ESR1_WAKINT_MASK (0x1U) -#define CAN_ESR1_WAKINT_SHIFT (0U) -/*! WAKINT - Wake-up Interrupt Flag - * 0b0..No such occurrence. - * 0b1..Indicates that a recessive-to-dominant transition was received on the CAN bus. - */ -#define CAN_ESR1_WAKINT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_WAKINT_SHIFT)) & CAN_ESR1_WAKINT_MASK) - -#define CAN_ESR1_ERRINT_MASK (0x2U) -#define CAN_ESR1_ERRINT_SHIFT (1U) -/*! ERRINT - Error Interrupt Flag - * 0b0..No such occurrence. - * 0b1..Indicates setting of any error flag in the Error and Status register. - */ -#define CAN_ESR1_ERRINT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_ERRINT_SHIFT)) & CAN_ESR1_ERRINT_MASK) - -#define CAN_ESR1_BOFFINT_MASK (0x4U) -#define CAN_ESR1_BOFFINT_SHIFT (2U) -/*! BOFFINT - Bus Off Interrupt Flag - * 0b0..No such occurrence. - * 0b1..FlexCAN module entered Bus Off state. - */ -#define CAN_ESR1_BOFFINT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_BOFFINT_SHIFT)) & CAN_ESR1_BOFFINT_MASK) - -#define CAN_ESR1_RX_MASK (0x8U) -#define CAN_ESR1_RX_SHIFT (3U) -/*! RX - FlexCAN in Reception Flag - * 0b0..Not receiving - * 0b1..Receiving - */ -#define CAN_ESR1_RX(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_RX_SHIFT)) & CAN_ESR1_RX_MASK) - -#define CAN_ESR1_FLTCONF_MASK (0x30U) -#define CAN_ESR1_FLTCONF_SHIFT (4U) -/*! FLTCONF - Fault Confinement State - * 0b00..Error Active - * 0b01..Error Passive - * 0b1x..Bus Off - */ -#define CAN_ESR1_FLTCONF(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_FLTCONF_SHIFT)) & CAN_ESR1_FLTCONF_MASK) - -#define CAN_ESR1_TX_MASK (0x40U) -#define CAN_ESR1_TX_SHIFT (6U) -/*! TX - FlexCAN In Transmission - * 0b0..Not transmitting - * 0b1..Transmitting - */ -#define CAN_ESR1_TX(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_TX_SHIFT)) & CAN_ESR1_TX_MASK) - -#define CAN_ESR1_IDLE_MASK (0x80U) -#define CAN_ESR1_IDLE_SHIFT (7U) -/*! IDLE - Idle - * 0b0..Not IDLE - * 0b1..IDLE - */ -#define CAN_ESR1_IDLE(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_IDLE_SHIFT)) & CAN_ESR1_IDLE_MASK) - -#define CAN_ESR1_RXWRN_MASK (0x100U) -#define CAN_ESR1_RXWRN_SHIFT (8U) -/*! RXWRN - RX Error Warning Flag - * 0b0..No such occurrence. - * 0b1..RXERRCNT is greater than or equal to 96. - */ -#define CAN_ESR1_RXWRN(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_RXWRN_SHIFT)) & CAN_ESR1_RXWRN_MASK) - -#define CAN_ESR1_TXWRN_MASK (0x200U) -#define CAN_ESR1_TXWRN_SHIFT (9U) -/*! TXWRN - TX Error Warning Flag - * 0b0..No such occurrence. - * 0b1..TXERRCNT is 96 or greater. - */ -#define CAN_ESR1_TXWRN(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_TXWRN_SHIFT)) & CAN_ESR1_TXWRN_MASK) - -#define CAN_ESR1_STFERR_MASK (0x400U) -#define CAN_ESR1_STFERR_SHIFT (10U) -/*! STFERR - Stuffing Error Flag - * 0b0..No error - * 0b1..Error occurred since last read of this register. - */ -#define CAN_ESR1_STFERR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_STFERR_SHIFT)) & CAN_ESR1_STFERR_MASK) - -#define CAN_ESR1_FRMERR_MASK (0x800U) -#define CAN_ESR1_FRMERR_SHIFT (11U) -/*! FRMERR - Form Error Flag - * 0b0..No error - * 0b1..Error occurred since last read of this register. - */ -#define CAN_ESR1_FRMERR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_FRMERR_SHIFT)) & CAN_ESR1_FRMERR_MASK) - -#define CAN_ESR1_CRCERR_MASK (0x1000U) -#define CAN_ESR1_CRCERR_SHIFT (12U) -/*! CRCERR - Cyclic Redundancy Check Error Flag - * 0b0..No error - * 0b1..Error occurred since last read of this register. - */ -#define CAN_ESR1_CRCERR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_CRCERR_SHIFT)) & CAN_ESR1_CRCERR_MASK) - -#define CAN_ESR1_ACKERR_MASK (0x2000U) -#define CAN_ESR1_ACKERR_SHIFT (13U) -/*! ACKERR - Acknowledge Error Flag - * 0b0..No error - * 0b1..Error occurred since last read of this register. - */ -#define CAN_ESR1_ACKERR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_ACKERR_SHIFT)) & CAN_ESR1_ACKERR_MASK) - -#define CAN_ESR1_BIT0ERR_MASK (0x4000U) -#define CAN_ESR1_BIT0ERR_SHIFT (14U) -/*! BIT0ERR - Bit0 Error Flag - * 0b0..No such occurrence. - * 0b1..At least one bit sent as dominant is received as recessive. - */ -#define CAN_ESR1_BIT0ERR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_BIT0ERR_SHIFT)) & CAN_ESR1_BIT0ERR_MASK) - -#define CAN_ESR1_BIT1ERR_MASK (0x8000U) -#define CAN_ESR1_BIT1ERR_SHIFT (15U) -/*! BIT1ERR - Bit1 Error Flag - * 0b0..No such occurrence. - * 0b1..At least one bit sent as recessive is received as dominant. - */ -#define CAN_ESR1_BIT1ERR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_BIT1ERR_SHIFT)) & CAN_ESR1_BIT1ERR_MASK) - -#define CAN_ESR1_RWRNINT_MASK (0x10000U) -#define CAN_ESR1_RWRNINT_SHIFT (16U) -/*! RWRNINT - RX Warning Interrupt Flag - * 0b0..No such occurrence - * 0b1..RX error counter changed from less than 96 to greater than or equal to 96. - */ -#define CAN_ESR1_RWRNINT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_RWRNINT_SHIFT)) & CAN_ESR1_RWRNINT_MASK) - -#define CAN_ESR1_TWRNINT_MASK (0x20000U) -#define CAN_ESR1_TWRNINT_SHIFT (17U) -/*! TWRNINT - TX Warning Interrupt Flag - * 0b0..No such occurrence - * 0b1..TX error counter changed from less than 96 to greater than or equal to 96. - */ -#define CAN_ESR1_TWRNINT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_TWRNINT_SHIFT)) & CAN_ESR1_TWRNINT_MASK) - -#define CAN_ESR1_SYNCH_MASK (0x40000U) -#define CAN_ESR1_SYNCH_SHIFT (18U) -/*! SYNCH - CAN Synchronization Status Flag - * 0b0..Not synchronized - * 0b1..Synchronized - */ -#define CAN_ESR1_SYNCH(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_SYNCH_SHIFT)) & CAN_ESR1_SYNCH_MASK) - -#define CAN_ESR1_BOFFDONEINT_MASK (0x80000U) -#define CAN_ESR1_BOFFDONEINT_SHIFT (19U) -/*! BOFFDONEINT - Bus Off Done Interrupt Flag - * 0b0..No such occurrence - * 0b1..FlexCAN module has completed Bus Off process. - */ -#define CAN_ESR1_BOFFDONEINT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_BOFFDONEINT_SHIFT)) & CAN_ESR1_BOFFDONEINT_MASK) - -#define CAN_ESR1_ERRINT_FAST_MASK (0x100000U) -#define CAN_ESR1_ERRINT_FAST_SHIFT (20U) -/*! ERRINT_FAST - Fast Error Interrupt Flag - * 0b0..No such occurrence. - * 0b1..Error flag set in the data phase of CAN FD frames that have BRS = 1. - */ -#define CAN_ESR1_ERRINT_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_ERRINT_FAST_SHIFT)) & CAN_ESR1_ERRINT_FAST_MASK) - -#define CAN_ESR1_ERROVR_MASK (0x200000U) -#define CAN_ESR1_ERROVR_SHIFT (21U) -/*! ERROVR - Error Overrun Flag - * 0b0..No overrun - * 0b1..Overrun - */ -#define CAN_ESR1_ERROVR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_ERROVR_SHIFT)) & CAN_ESR1_ERROVR_MASK) - -#define CAN_ESR1_STFERR_FAST_MASK (0x4000000U) -#define CAN_ESR1_STFERR_FAST_SHIFT (26U) -/*! STFERR_FAST - Fast Stuffing Error Flag - * 0b0..No such occurrence. - * 0b1..A stuffing error occurred since last read of this register. - */ -#define CAN_ESR1_STFERR_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_STFERR_FAST_SHIFT)) & CAN_ESR1_STFERR_FAST_MASK) - -#define CAN_ESR1_FRMERR_FAST_MASK (0x8000000U) -#define CAN_ESR1_FRMERR_FAST_SHIFT (27U) -/*! FRMERR_FAST - Fast Form Error Flag - * 0b0..No such occurrence. - * 0b1..A form error occurred since last read of this register. - */ -#define CAN_ESR1_FRMERR_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_FRMERR_FAST_SHIFT)) & CAN_ESR1_FRMERR_FAST_MASK) - -#define CAN_ESR1_CRCERR_FAST_MASK (0x10000000U) -#define CAN_ESR1_CRCERR_FAST_SHIFT (28U) -/*! CRCERR_FAST - Fast Cyclic Redundancy Check Error Flag - * 0b0..No such occurrence. - * 0b1..A CRC error occurred since last read of this register. - */ -#define CAN_ESR1_CRCERR_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_CRCERR_FAST_SHIFT)) & CAN_ESR1_CRCERR_FAST_MASK) - -#define CAN_ESR1_BIT0ERR_FAST_MASK (0x40000000U) -#define CAN_ESR1_BIT0ERR_FAST_SHIFT (30U) -/*! BIT0ERR_FAST - Fast Bit0 Error Flag - * 0b0..No such occurrence. - * 0b1..At least one bit transmitted as dominant is received as recessive. - */ -#define CAN_ESR1_BIT0ERR_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_BIT0ERR_FAST_SHIFT)) & CAN_ESR1_BIT0ERR_FAST_MASK) - -#define CAN_ESR1_BIT1ERR_FAST_MASK (0x80000000U) -#define CAN_ESR1_BIT1ERR_FAST_SHIFT (31U) -/*! BIT1ERR_FAST - Fast Bit1 Error Flag - * 0b0..No such occurrence. - * 0b1..At least one bit transmitted as recessive is received as dominant. - */ -#define CAN_ESR1_BIT1ERR_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR1_BIT1ERR_FAST_SHIFT)) & CAN_ESR1_BIT1ERR_FAST_MASK) -/*! @} */ - -/*! @name IMASK1 - Interrupt Masks 1 */ -/*! @{ */ - -#define CAN_IMASK1_BUF31TO0M_MASK (0xFFFFFFFFU) -#define CAN_IMASK1_BUF31TO0M_SHIFT (0U) -/*! BUF31TO0M - Buffer MBi Mask */ -#define CAN_IMASK1_BUF31TO0M(x) (((uint32_t)(((uint32_t)(x)) << CAN_IMASK1_BUF31TO0M_SHIFT)) & CAN_IMASK1_BUF31TO0M_MASK) -/*! @} */ - -/*! @name IFLAG1 - Interrupt Flags 1 */ -/*! @{ */ - -#define CAN_IFLAG1_BUF0I_MASK (0x1U) -#define CAN_IFLAG1_BUF0I_SHIFT (0U) -/*! BUF0I - Buffer MB0 Interrupt or Clear Legacy FIFO bit - * 0b0..MB0 has no occurrence of successfully completed transmission or reception. - * 0b1..MB0 has successfully completed transmission or reception. - */ -#define CAN_IFLAG1_BUF0I(x) (((uint32_t)(((uint32_t)(x)) << CAN_IFLAG1_BUF0I_SHIFT)) & CAN_IFLAG1_BUF0I_MASK) - -#define CAN_IFLAG1_BUF4TO1I_MASK (0x1EU) -#define CAN_IFLAG1_BUF4TO1I_SHIFT (1U) -/*! BUF4TO1I - Buffer MBi Interrupt or Reserved */ -#define CAN_IFLAG1_BUF4TO1I(x) (((uint32_t)(((uint32_t)(x)) << CAN_IFLAG1_BUF4TO1I_SHIFT)) & CAN_IFLAG1_BUF4TO1I_MASK) - -#define CAN_IFLAG1_BUF5I_MASK (0x20U) -#define CAN_IFLAG1_BUF5I_SHIFT (5U) -/*! BUF5I - Buffer MB5 Interrupt or Frames available in Legacy RX FIFO - * 0b0..No occurrence of completed transmission or reception, or no frames available - * 0b1..MB5 completed transmission or reception, or frames available - */ -#define CAN_IFLAG1_BUF5I(x) (((uint32_t)(((uint32_t)(x)) << CAN_IFLAG1_BUF5I_SHIFT)) & CAN_IFLAG1_BUF5I_MASK) - -#define CAN_IFLAG1_BUF6I_MASK (0x40U) -#define CAN_IFLAG1_BUF6I_SHIFT (6U) -/*! BUF6I - Buffer MB6 Interrupt or Legacy RX FIFO Warning - * 0b0..No occurrence of MB6 completing transmission or reception, or FIFO not almost full. - * 0b1..MB6 completed transmission or reception, or FIFO almost full. - */ -#define CAN_IFLAG1_BUF6I(x) (((uint32_t)(((uint32_t)(x)) << CAN_IFLAG1_BUF6I_SHIFT)) & CAN_IFLAG1_BUF6I_MASK) - -#define CAN_IFLAG1_BUF7I_MASK (0x80U) -#define CAN_IFLAG1_BUF7I_SHIFT (7U) -/*! BUF7I - Buffer MB7 Interrupt or Legacy RX FIFO Overflow - * 0b0..No occurrence of MB7 completing transmission or reception, or no FIFO overflow. - * 0b1..MB7 completed transmission or reception, or FIFO overflow. - */ -#define CAN_IFLAG1_BUF7I(x) (((uint32_t)(((uint32_t)(x)) << CAN_IFLAG1_BUF7I_SHIFT)) & CAN_IFLAG1_BUF7I_MASK) - -#define CAN_IFLAG1_BUF31TO8I_MASK (0xFFFFFF00U) -#define CAN_IFLAG1_BUF31TO8I_SHIFT (8U) -/*! BUF31TO8I - Buffer MBi Interrupt */ -#define CAN_IFLAG1_BUF31TO8I(x) (((uint32_t)(((uint32_t)(x)) << CAN_IFLAG1_BUF31TO8I_SHIFT)) & CAN_IFLAG1_BUF31TO8I_MASK) -/*! @} */ - -/*! @name CTRL2 - Control 2 */ -/*! @{ */ - -#define CAN_CTRL2_EDFLTDIS_MASK (0x800U) -#define CAN_CTRL2_EDFLTDIS_SHIFT (11U) -/*! EDFLTDIS - Edge Filter Disable - * 0b0..Enabled - * 0b1..Disabled - */ -#define CAN_CTRL2_EDFLTDIS(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_EDFLTDIS_SHIFT)) & CAN_CTRL2_EDFLTDIS_MASK) - -#define CAN_CTRL2_ISOCANFDEN_MASK (0x1000U) -#define CAN_CTRL2_ISOCANFDEN_SHIFT (12U) -/*! ISOCANFDEN - ISO CAN FD Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL2_ISOCANFDEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_ISOCANFDEN_SHIFT)) & CAN_CTRL2_ISOCANFDEN_MASK) - -#define CAN_CTRL2_BTE_MASK (0x2000U) -#define CAN_CTRL2_BTE_SHIFT (13U) -/*! BTE - Bit Timing Expansion Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL2_BTE(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_BTE_SHIFT)) & CAN_CTRL2_BTE_MASK) - -#define CAN_CTRL2_PREXCEN_MASK (0x4000U) -#define CAN_CTRL2_PREXCEN_SHIFT (14U) -/*! PREXCEN - Protocol Exception Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define CAN_CTRL2_PREXCEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_PREXCEN_SHIFT)) & CAN_CTRL2_PREXCEN_MASK) - -#define CAN_CTRL2_EACEN_MASK (0x10000U) -#define CAN_CTRL2_EACEN_SHIFT (16U) -/*! EACEN - Entire Frame Arbitration Field Comparison Enable for RX Message Buffers - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL2_EACEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_EACEN_SHIFT)) & CAN_CTRL2_EACEN_MASK) - -#define CAN_CTRL2_RRS_MASK (0x20000U) -#define CAN_CTRL2_RRS_SHIFT (17U) -/*! RRS - Remote Request Storing - * 0b0..Generated - * 0b1..Stored - */ -#define CAN_CTRL2_RRS(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_RRS_SHIFT)) & CAN_CTRL2_RRS_MASK) - -#define CAN_CTRL2_MRP_MASK (0x40000U) -#define CAN_CTRL2_MRP_SHIFT (18U) -/*! MRP - Message Buffers Reception Priority - * 0b0..Matching starts from Legacy RX FIFO or Enhanced RX FIFO and continues on message buffers. - * 0b1..Matching starts from message buffers and continues on Legacy RX FIFO or Enhanced RX FIFO. - */ -#define CAN_CTRL2_MRP(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_MRP_SHIFT)) & CAN_CTRL2_MRP_MASK) - -#define CAN_CTRL2_TASD_MASK (0xF80000U) -#define CAN_CTRL2_TASD_SHIFT (19U) -/*! TASD - Transmission Arbitration Start Delay */ -#define CAN_CTRL2_TASD(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_TASD_SHIFT)) & CAN_CTRL2_TASD_MASK) - -#define CAN_CTRL2_RFFN_MASK (0xF000000U) -#define CAN_CTRL2_RFFN_SHIFT (24U) -/*! RFFN - Number of Legacy Receive FIFO Filters */ -#define CAN_CTRL2_RFFN(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_RFFN_SHIFT)) & CAN_CTRL2_RFFN_MASK) - -#define CAN_CTRL2_BOFFDONEMSK_MASK (0x40000000U) -#define CAN_CTRL2_BOFFDONEMSK_SHIFT (30U) -/*! BOFFDONEMSK - Bus Off Done Interrupt Mask - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL2_BOFFDONEMSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_BOFFDONEMSK_SHIFT)) & CAN_CTRL2_BOFFDONEMSK_MASK) - -#define CAN_CTRL2_ERRMSK_FAST_MASK (0x80000000U) -#define CAN_CTRL2_ERRMSK_FAST_SHIFT (31U) -/*! ERRMSK_FAST - Error Interrupt Mask for Errors Detected in the Data Phase of Fast CAN FD Frames - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL2_ERRMSK_FAST(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_ERRMSK_FAST_SHIFT)) & CAN_CTRL2_ERRMSK_FAST_MASK) -/*! @} */ - -/*! @name ESR2 - Error and Status 2 */ -/*! @{ */ - -#define CAN_ESR2_IMB_MASK (0x2000U) -#define CAN_ESR2_IMB_SHIFT (13U) -/*! IMB - Inactive Message Buffer - * 0b0..Message buffer indicated by ESR2[LPTM] is not inactive. - * 0b1..At least one message buffer is inactive. - */ -#define CAN_ESR2_IMB(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR2_IMB_SHIFT)) & CAN_ESR2_IMB_MASK) - -#define CAN_ESR2_VPS_MASK (0x4000U) -#define CAN_ESR2_VPS_SHIFT (14U) -/*! VPS - Valid Priority Status - * 0b0..Invalid - * 0b1..Valid - */ -#define CAN_ESR2_VPS(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR2_VPS_SHIFT)) & CAN_ESR2_VPS_MASK) - -#define CAN_ESR2_LPTM_MASK (0x7F0000U) -#define CAN_ESR2_LPTM_SHIFT (16U) -/*! LPTM - Lowest Priority TX Message Buffer */ -#define CAN_ESR2_LPTM(x) (((uint32_t)(((uint32_t)(x)) << CAN_ESR2_LPTM_SHIFT)) & CAN_ESR2_LPTM_MASK) -/*! @} */ - -/*! @name CRCR - Cyclic Redundancy Check */ -/*! @{ */ - -#define CAN_CRCR_TXCRC_MASK (0x7FFFU) -#define CAN_CRCR_TXCRC_SHIFT (0U) -/*! TXCRC - Transmitted CRC value */ -#define CAN_CRCR_TXCRC(x) (((uint32_t)(((uint32_t)(x)) << CAN_CRCR_TXCRC_SHIFT)) & CAN_CRCR_TXCRC_MASK) - -#define CAN_CRCR_MBCRC_MASK (0x7F0000U) -#define CAN_CRCR_MBCRC_SHIFT (16U) -/*! MBCRC - CRC Message Buffer */ -#define CAN_CRCR_MBCRC(x) (((uint32_t)(((uint32_t)(x)) << CAN_CRCR_MBCRC_SHIFT)) & CAN_CRCR_MBCRC_MASK) -/*! @} */ - -/*! @name RXFGMASK - Legacy RX FIFO Global Mask */ -/*! @{ */ - -#define CAN_RXFGMASK_FGM_MASK (0xFFFFFFFFU) -#define CAN_RXFGMASK_FGM_SHIFT (0U) -/*! FGM - Legacy RX FIFO Global Mask Bits */ -#define CAN_RXFGMASK_FGM(x) (((uint32_t)(((uint32_t)(x)) << CAN_RXFGMASK_FGM_SHIFT)) & CAN_RXFGMASK_FGM_MASK) -/*! @} */ - -/*! @name RXFIR - Legacy RX FIFO Information */ -/*! @{ */ - -#define CAN_RXFIR_IDHIT_MASK (0x1FFU) -#define CAN_RXFIR_IDHIT_SHIFT (0U) -/*! IDHIT - Identifier Acceptance Filter Hit Indicator */ -#define CAN_RXFIR_IDHIT(x) (((uint32_t)(((uint32_t)(x)) << CAN_RXFIR_IDHIT_SHIFT)) & CAN_RXFIR_IDHIT_MASK) -/*! @} */ - -/*! @name CBT - CAN Bit Timing */ -/*! @{ */ - -#define CAN_CBT_EPSEG2_MASK (0x1FU) -#define CAN_CBT_EPSEG2_SHIFT (0U) -/*! EPSEG2 - Extended Phase Segment 2 */ -#define CAN_CBT_EPSEG2(x) (((uint32_t)(((uint32_t)(x)) << CAN_CBT_EPSEG2_SHIFT)) & CAN_CBT_EPSEG2_MASK) - -#define CAN_CBT_EPSEG1_MASK (0x3E0U) -#define CAN_CBT_EPSEG1_SHIFT (5U) -/*! EPSEG1 - Extended Phase Segment 1 */ -#define CAN_CBT_EPSEG1(x) (((uint32_t)(((uint32_t)(x)) << CAN_CBT_EPSEG1_SHIFT)) & CAN_CBT_EPSEG1_MASK) - -#define CAN_CBT_EPROPSEG_MASK (0xFC00U) -#define CAN_CBT_EPROPSEG_SHIFT (10U) -/*! EPROPSEG - Extended Propagation Segment */ -#define CAN_CBT_EPROPSEG(x) (((uint32_t)(((uint32_t)(x)) << CAN_CBT_EPROPSEG_SHIFT)) & CAN_CBT_EPROPSEG_MASK) - -#define CAN_CBT_ERJW_MASK (0x1F0000U) -#define CAN_CBT_ERJW_SHIFT (16U) -/*! ERJW - Extended Resync Jump Width */ -#define CAN_CBT_ERJW(x) (((uint32_t)(((uint32_t)(x)) << CAN_CBT_ERJW_SHIFT)) & CAN_CBT_ERJW_MASK) - -#define CAN_CBT_EPRESDIV_MASK (0x7FE00000U) -#define CAN_CBT_EPRESDIV_SHIFT (21U) -/*! EPRESDIV - Extended Prescaler Division Factor */ -#define CAN_CBT_EPRESDIV(x) (((uint32_t)(((uint32_t)(x)) << CAN_CBT_EPRESDIV_SHIFT)) & CAN_CBT_EPRESDIV_MASK) - -#define CAN_CBT_BTF_MASK (0x80000000U) -#define CAN_CBT_BTF_SHIFT (31U) -/*! BTF - Bit Timing Format Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CBT_BTF(x) (((uint32_t)(((uint32_t)(x)) << CAN_CBT_BTF_SHIFT)) & CAN_CBT_BTF_MASK) -/*! @} */ - -/* The count of CAN_CS */ -#define CAN_CS_COUNT_MB8B (32U) - -/* The count of CAN_ID */ -#define CAN_ID_COUNT_MB8B (32U) - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB8B (32U) - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB8B2 (2U) - -/* The count of CAN_CS */ -#define CAN_CS_COUNT_MB16B (21U) - -/* The count of CAN_ID */ -#define CAN_ID_COUNT_MB16B (21U) - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB16B (21U) - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB16B2 (4U) - -/* The count of CAN_CS */ -#define CAN_CS_COUNT_MB32B (12U) - -/* The count of CAN_ID */ -#define CAN_ID_COUNT_MB32B (12U) - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB32B (12U) - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB32B2 (8U) - -/*! @name CS - Message Buffer 0 CS Register..Message Buffer 6 CS Register */ -/*! @{ */ - -#define CAN_CS_TIME_STAMP_MASK (0xFFFFU) -#define CAN_CS_TIME_STAMP_SHIFT (0U) -/*! TIME_STAMP - Free-Running Counter Time stamp. This 16-bit field is a copy of the Free-Running - * Timer, captured for Tx and Rx frames at the time when the beginning of the Identifier field - * appears on the CAN bus. - */ -#define CAN_CS_TIME_STAMP(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_TIME_STAMP_SHIFT)) & CAN_CS_TIME_STAMP_MASK) - -#define CAN_CS_DLC_MASK (0xF0000U) -#define CAN_CS_DLC_SHIFT (16U) -/*! DLC - Length of the data to be stored/transmitted. */ -#define CAN_CS_DLC(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_DLC_SHIFT)) & CAN_CS_DLC_MASK) - -#define CAN_CS_RTR_MASK (0x100000U) -#define CAN_CS_RTR_SHIFT (20U) -/*! RTR - Remote Transmission Request. One/zero for remote/data frame. */ -#define CAN_CS_RTR(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_RTR_SHIFT)) & CAN_CS_RTR_MASK) - -#define CAN_CS_IDE_MASK (0x200000U) -#define CAN_CS_IDE_SHIFT (21U) -/*! IDE - ID Extended. One/zero for extended/standard format frame. */ -#define CAN_CS_IDE(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_IDE_SHIFT)) & CAN_CS_IDE_MASK) - -#define CAN_CS_SRR_MASK (0x400000U) -#define CAN_CS_SRR_SHIFT (22U) -/*! SRR - Substitute Remote Request. Contains a fixed recessive bit. */ -#define CAN_CS_SRR(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_SRR_SHIFT)) & CAN_CS_SRR_MASK) - -#define CAN_CS_CODE_MASK (0xF000000U) -#define CAN_CS_CODE_SHIFT (24U) -/*! CODE - Message Buffer Code. This 4-bit field can be accessed (read or write) by the CPU and by - * the FlexCAN module itself, as part of the message buffer matching and arbitration process. - */ -#define CAN_CS_CODE(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_CODE_SHIFT)) & CAN_CS_CODE_MASK) - -#define CAN_CS_ESI_MASK (0x20000000U) -#define CAN_CS_ESI_SHIFT (29U) -/*! ESI - Error State Indicator. This bit indicates if the transmitting node is error active or error passive. */ -#define CAN_CS_ESI(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_ESI_SHIFT)) & CAN_CS_ESI_MASK) - -#define CAN_CS_BRS_MASK (0x40000000U) -#define CAN_CS_BRS_SHIFT (30U) -/*! BRS - Bit Rate Switch. This bit defines whether the bit rate is switched inside a CAN FD format frame. */ -#define CAN_CS_BRS(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_BRS_SHIFT)) & CAN_CS_BRS_MASK) - -#define CAN_CS_EDL_MASK (0x80000000U) -#define CAN_CS_EDL_SHIFT (31U) -/*! EDL - Extended Data Length. This bit distinguishes between CAN format and CAN FD format frames. - * The EDL bit must not be set for Message Buffers configured to RANSWER with code field 0b1010. - */ -#define CAN_CS_EDL(x) (((uint32_t)(((uint32_t)(x)) << CAN_CS_EDL_SHIFT)) & CAN_CS_EDL_MASK) -/*! @} */ - -/* The count of CAN_CS */ -#define CAN_CS_COUNT_MB64B (7U) - -/*! @name ID - Message Buffer 0 ID Register..Message Buffer 6 ID Register */ -/*! @{ */ - -#define CAN_ID_EXT_MASK (0x3FFFFU) -#define CAN_ID_EXT_SHIFT (0U) -/*! EXT - Contains extended (LOW word) identifier of message buffer. */ -#define CAN_ID_EXT(x) (((uint32_t)(((uint32_t)(x)) << CAN_ID_EXT_SHIFT)) & CAN_ID_EXT_MASK) - -#define CAN_ID_STD_MASK (0x1FFC0000U) -#define CAN_ID_STD_SHIFT (18U) -/*! STD - Contains standard/extended (HIGH word) identifier of message buffer. */ -#define CAN_ID_STD(x) (((uint32_t)(((uint32_t)(x)) << CAN_ID_STD_SHIFT)) & CAN_ID_STD_MASK) - -#define CAN_ID_PRIO_MASK (0xE0000000U) -#define CAN_ID_PRIO_SHIFT (29U) -/*! PRIO - Local priority. This 3-bit fieldis only used when LPRIO_EN bit is set in MCR and it only - * makes sense for Tx buffers. These bits are not transmitted. They are appended to the regular - * ID to define the transmission priority. - */ -#define CAN_ID_PRIO(x) (((uint32_t)(((uint32_t)(x)) << CAN_ID_PRIO_SHIFT)) & CAN_ID_PRIO_MASK) -/*! @} */ - -/* The count of CAN_ID */ -#define CAN_ID_COUNT_MB64B (7U) - -/*! @name WORD - Message Buffer 0 WORD_64B Register..Message Buffer 6 WORD_64B Register */ -/*! @{ */ - -#define CAN_WORD_DATA_BYTE_3_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_3_SHIFT (0U) -/*! DATA_BYTE_3 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_3(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_3_SHIFT)) & CAN_WORD_DATA_BYTE_3_MASK) - -#define CAN_WORD_DATA_BYTE_7_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_7_SHIFT (0U) -/*! DATA_BYTE_7 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_7(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_7_SHIFT)) & CAN_WORD_DATA_BYTE_7_MASK) - -#define CAN_WORD_DATA_BYTE_11_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_11_SHIFT (0U) -/*! DATA_BYTE_11 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_11(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_11_SHIFT)) & CAN_WORD_DATA_BYTE_11_MASK) - -#define CAN_WORD_DATA_BYTE_15_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_15_SHIFT (0U) -/*! DATA_BYTE_15 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_15(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_15_SHIFT)) & CAN_WORD_DATA_BYTE_15_MASK) - -#define CAN_WORD_DATA_BYTE_19_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_19_SHIFT (0U) -/*! DATA_BYTE_19 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_19(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_19_SHIFT)) & CAN_WORD_DATA_BYTE_19_MASK) - -#define CAN_WORD_DATA_BYTE_23_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_23_SHIFT (0U) -/*! DATA_BYTE_23 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_23(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_23_SHIFT)) & CAN_WORD_DATA_BYTE_23_MASK) - -#define CAN_WORD_DATA_BYTE_27_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_27_SHIFT (0U) -/*! DATA_BYTE_27 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_27(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_27_SHIFT)) & CAN_WORD_DATA_BYTE_27_MASK) - -#define CAN_WORD_DATA_BYTE_31_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_31_SHIFT (0U) -/*! DATA_BYTE_31 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_31(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_31_SHIFT)) & CAN_WORD_DATA_BYTE_31_MASK) - -#define CAN_WORD_DATA_BYTE_35_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_35_SHIFT (0U) -/*! DATA_BYTE_35 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_35(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_35_SHIFT)) & CAN_WORD_DATA_BYTE_35_MASK) - -#define CAN_WORD_DATA_BYTE_39_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_39_SHIFT (0U) -/*! DATA_BYTE_39 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_39(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_39_SHIFT)) & CAN_WORD_DATA_BYTE_39_MASK) - -#define CAN_WORD_DATA_BYTE_43_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_43_SHIFT (0U) -/*! DATA_BYTE_43 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_43(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_43_SHIFT)) & CAN_WORD_DATA_BYTE_43_MASK) - -#define CAN_WORD_DATA_BYTE_47_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_47_SHIFT (0U) -/*! DATA_BYTE_47 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_47(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_47_SHIFT)) & CAN_WORD_DATA_BYTE_47_MASK) - -#define CAN_WORD_DATA_BYTE_51_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_51_SHIFT (0U) -/*! DATA_BYTE_51 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_51(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_51_SHIFT)) & CAN_WORD_DATA_BYTE_51_MASK) - -#define CAN_WORD_DATA_BYTE_55_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_55_SHIFT (0U) -/*! DATA_BYTE_55 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_55(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_55_SHIFT)) & CAN_WORD_DATA_BYTE_55_MASK) - -#define CAN_WORD_DATA_BYTE_59_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_59_SHIFT (0U) -/*! DATA_BYTE_59 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_59(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_59_SHIFT)) & CAN_WORD_DATA_BYTE_59_MASK) - -#define CAN_WORD_DATA_BYTE_63_MASK (0xFFU) -#define CAN_WORD_DATA_BYTE_63_SHIFT (0U) -/*! DATA_BYTE_63 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_63(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_63_SHIFT)) & CAN_WORD_DATA_BYTE_63_MASK) - -#define CAN_WORD_DATA_BYTE_2_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_2_SHIFT (8U) -/*! DATA_BYTE_2 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_2(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_2_SHIFT)) & CAN_WORD_DATA_BYTE_2_MASK) - -#define CAN_WORD_DATA_BYTE_6_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_6_SHIFT (8U) -/*! DATA_BYTE_6 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_6(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_6_SHIFT)) & CAN_WORD_DATA_BYTE_6_MASK) - -#define CAN_WORD_DATA_BYTE_10_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_10_SHIFT (8U) -/*! DATA_BYTE_10 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_10(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_10_SHIFT)) & CAN_WORD_DATA_BYTE_10_MASK) - -#define CAN_WORD_DATA_BYTE_14_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_14_SHIFT (8U) -/*! DATA_BYTE_14 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_14(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_14_SHIFT)) & CAN_WORD_DATA_BYTE_14_MASK) - -#define CAN_WORD_DATA_BYTE_18_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_18_SHIFT (8U) -/*! DATA_BYTE_18 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_18(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_18_SHIFT)) & CAN_WORD_DATA_BYTE_18_MASK) - -#define CAN_WORD_DATA_BYTE_22_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_22_SHIFT (8U) -/*! DATA_BYTE_22 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_22(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_22_SHIFT)) & CAN_WORD_DATA_BYTE_22_MASK) - -#define CAN_WORD_DATA_BYTE_26_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_26_SHIFT (8U) -/*! DATA_BYTE_26 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_26(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_26_SHIFT)) & CAN_WORD_DATA_BYTE_26_MASK) - -#define CAN_WORD_DATA_BYTE_30_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_30_SHIFT (8U) -/*! DATA_BYTE_30 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_30(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_30_SHIFT)) & CAN_WORD_DATA_BYTE_30_MASK) - -#define CAN_WORD_DATA_BYTE_34_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_34_SHIFT (8U) -/*! DATA_BYTE_34 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_34(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_34_SHIFT)) & CAN_WORD_DATA_BYTE_34_MASK) - -#define CAN_WORD_DATA_BYTE_38_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_38_SHIFT (8U) -/*! DATA_BYTE_38 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_38(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_38_SHIFT)) & CAN_WORD_DATA_BYTE_38_MASK) - -#define CAN_WORD_DATA_BYTE_42_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_42_SHIFT (8U) -/*! DATA_BYTE_42 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_42(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_42_SHIFT)) & CAN_WORD_DATA_BYTE_42_MASK) - -#define CAN_WORD_DATA_BYTE_46_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_46_SHIFT (8U) -/*! DATA_BYTE_46 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_46(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_46_SHIFT)) & CAN_WORD_DATA_BYTE_46_MASK) - -#define CAN_WORD_DATA_BYTE_50_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_50_SHIFT (8U) -/*! DATA_BYTE_50 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_50(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_50_SHIFT)) & CAN_WORD_DATA_BYTE_50_MASK) - -#define CAN_WORD_DATA_BYTE_54_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_54_SHIFT (8U) -/*! DATA_BYTE_54 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_54(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_54_SHIFT)) & CAN_WORD_DATA_BYTE_54_MASK) - -#define CAN_WORD_DATA_BYTE_58_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_58_SHIFT (8U) -/*! DATA_BYTE_58 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_58(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_58_SHIFT)) & CAN_WORD_DATA_BYTE_58_MASK) - -#define CAN_WORD_DATA_BYTE_62_MASK (0xFF00U) -#define CAN_WORD_DATA_BYTE_62_SHIFT (8U) -/*! DATA_BYTE_62 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_62(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_62_SHIFT)) & CAN_WORD_DATA_BYTE_62_MASK) - -#define CAN_WORD_DATA_BYTE_1_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_1_SHIFT (16U) -/*! DATA_BYTE_1 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_1(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_1_SHIFT)) & CAN_WORD_DATA_BYTE_1_MASK) - -#define CAN_WORD_DATA_BYTE_5_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_5_SHIFT (16U) -/*! DATA_BYTE_5 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_5(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_5_SHIFT)) & CAN_WORD_DATA_BYTE_5_MASK) - -#define CAN_WORD_DATA_BYTE_9_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_9_SHIFT (16U) -/*! DATA_BYTE_9 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_9(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_9_SHIFT)) & CAN_WORD_DATA_BYTE_9_MASK) - -#define CAN_WORD_DATA_BYTE_13_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_13_SHIFT (16U) -/*! DATA_BYTE_13 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_13(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_13_SHIFT)) & CAN_WORD_DATA_BYTE_13_MASK) - -#define CAN_WORD_DATA_BYTE_17_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_17_SHIFT (16U) -/*! DATA_BYTE_17 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_17(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_17_SHIFT)) & CAN_WORD_DATA_BYTE_17_MASK) - -#define CAN_WORD_DATA_BYTE_21_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_21_SHIFT (16U) -/*! DATA_BYTE_21 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_21(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_21_SHIFT)) & CAN_WORD_DATA_BYTE_21_MASK) - -#define CAN_WORD_DATA_BYTE_25_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_25_SHIFT (16U) -/*! DATA_BYTE_25 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_25(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_25_SHIFT)) & CAN_WORD_DATA_BYTE_25_MASK) - -#define CAN_WORD_DATA_BYTE_29_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_29_SHIFT (16U) -/*! DATA_BYTE_29 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_29(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_29_SHIFT)) & CAN_WORD_DATA_BYTE_29_MASK) - -#define CAN_WORD_DATA_BYTE_33_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_33_SHIFT (16U) -/*! DATA_BYTE_33 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_33(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_33_SHIFT)) & CAN_WORD_DATA_BYTE_33_MASK) - -#define CAN_WORD_DATA_BYTE_37_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_37_SHIFT (16U) -/*! DATA_BYTE_37 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_37(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_37_SHIFT)) & CAN_WORD_DATA_BYTE_37_MASK) - -#define CAN_WORD_DATA_BYTE_41_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_41_SHIFT (16U) -/*! DATA_BYTE_41 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_41(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_41_SHIFT)) & CAN_WORD_DATA_BYTE_41_MASK) - -#define CAN_WORD_DATA_BYTE_45_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_45_SHIFT (16U) -/*! DATA_BYTE_45 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_45(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_45_SHIFT)) & CAN_WORD_DATA_BYTE_45_MASK) - -#define CAN_WORD_DATA_BYTE_49_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_49_SHIFT (16U) -/*! DATA_BYTE_49 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_49(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_49_SHIFT)) & CAN_WORD_DATA_BYTE_49_MASK) - -#define CAN_WORD_DATA_BYTE_53_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_53_SHIFT (16U) -/*! DATA_BYTE_53 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_53(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_53_SHIFT)) & CAN_WORD_DATA_BYTE_53_MASK) - -#define CAN_WORD_DATA_BYTE_57_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_57_SHIFT (16U) -/*! DATA_BYTE_57 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_57(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_57_SHIFT)) & CAN_WORD_DATA_BYTE_57_MASK) - -#define CAN_WORD_DATA_BYTE_61_MASK (0xFF0000U) -#define CAN_WORD_DATA_BYTE_61_SHIFT (16U) -/*! DATA_BYTE_61 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_61(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_61_SHIFT)) & CAN_WORD_DATA_BYTE_61_MASK) - -#define CAN_WORD_DATA_BYTE_0_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_0_SHIFT (24U) -/*! DATA_BYTE_0 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_0(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_0_SHIFT)) & CAN_WORD_DATA_BYTE_0_MASK) - -#define CAN_WORD_DATA_BYTE_4_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_4_SHIFT (24U) -/*! DATA_BYTE_4 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_4(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_4_SHIFT)) & CAN_WORD_DATA_BYTE_4_MASK) - -#define CAN_WORD_DATA_BYTE_8_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_8_SHIFT (24U) -/*! DATA_BYTE_8 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_8(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_8_SHIFT)) & CAN_WORD_DATA_BYTE_8_MASK) - -#define CAN_WORD_DATA_BYTE_12_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_12_SHIFT (24U) -/*! DATA_BYTE_12 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_12(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_12_SHIFT)) & CAN_WORD_DATA_BYTE_12_MASK) - -#define CAN_WORD_DATA_BYTE_16_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_16_SHIFT (24U) -/*! DATA_BYTE_16 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_16(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_16_SHIFT)) & CAN_WORD_DATA_BYTE_16_MASK) - -#define CAN_WORD_DATA_BYTE_20_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_20_SHIFT (24U) -/*! DATA_BYTE_20 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_20(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_20_SHIFT)) & CAN_WORD_DATA_BYTE_20_MASK) - -#define CAN_WORD_DATA_BYTE_24_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_24_SHIFT (24U) -/*! DATA_BYTE_24 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_24(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_24_SHIFT)) & CAN_WORD_DATA_BYTE_24_MASK) - -#define CAN_WORD_DATA_BYTE_28_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_28_SHIFT (24U) -/*! DATA_BYTE_28 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_28(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_28_SHIFT)) & CAN_WORD_DATA_BYTE_28_MASK) - -#define CAN_WORD_DATA_BYTE_32_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_32_SHIFT (24U) -/*! DATA_BYTE_32 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_32(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_32_SHIFT)) & CAN_WORD_DATA_BYTE_32_MASK) - -#define CAN_WORD_DATA_BYTE_36_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_36_SHIFT (24U) -/*! DATA_BYTE_36 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_36(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_36_SHIFT)) & CAN_WORD_DATA_BYTE_36_MASK) - -#define CAN_WORD_DATA_BYTE_40_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_40_SHIFT (24U) -/*! DATA_BYTE_40 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_40(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_40_SHIFT)) & CAN_WORD_DATA_BYTE_40_MASK) - -#define CAN_WORD_DATA_BYTE_44_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_44_SHIFT (24U) -/*! DATA_BYTE_44 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_44(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_44_SHIFT)) & CAN_WORD_DATA_BYTE_44_MASK) - -#define CAN_WORD_DATA_BYTE_48_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_48_SHIFT (24U) -/*! DATA_BYTE_48 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_48(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_48_SHIFT)) & CAN_WORD_DATA_BYTE_48_MASK) - -#define CAN_WORD_DATA_BYTE_52_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_52_SHIFT (24U) -/*! DATA_BYTE_52 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_52(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_52_SHIFT)) & CAN_WORD_DATA_BYTE_52_MASK) - -#define CAN_WORD_DATA_BYTE_56_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_56_SHIFT (24U) -/*! DATA_BYTE_56 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_56(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_56_SHIFT)) & CAN_WORD_DATA_BYTE_56_MASK) - -#define CAN_WORD_DATA_BYTE_60_MASK (0xFF000000U) -#define CAN_WORD_DATA_BYTE_60_SHIFT (24U) -/*! DATA_BYTE_60 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD_DATA_BYTE_60(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD_DATA_BYTE_60_SHIFT)) & CAN_WORD_DATA_BYTE_60_MASK) -/*! @} */ - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB64B (7U) - -/* The count of CAN_WORD */ -#define CAN_WORD_COUNT_MB64B2 (16U) - -/* The count of CAN_CS */ -#define CAN_CS_COUNT (32U) - -/* The count of CAN_ID */ -#define CAN_ID_COUNT (32U) - -/*! @name WORD0 - Message Buffer 0 WORD0 Register..Message Buffer 31 WORD0 Register */ -/*! @{ */ - -#define CAN_WORD0_DATA_BYTE_3_MASK (0xFFU) -#define CAN_WORD0_DATA_BYTE_3_SHIFT (0U) -/*! DATA_BYTE_3 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD0_DATA_BYTE_3(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD0_DATA_BYTE_3_SHIFT)) & CAN_WORD0_DATA_BYTE_3_MASK) - -#define CAN_WORD0_DATA_BYTE_2_MASK (0xFF00U) -#define CAN_WORD0_DATA_BYTE_2_SHIFT (8U) -/*! DATA_BYTE_2 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD0_DATA_BYTE_2(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD0_DATA_BYTE_2_SHIFT)) & CAN_WORD0_DATA_BYTE_2_MASK) - -#define CAN_WORD0_DATA_BYTE_1_MASK (0xFF0000U) -#define CAN_WORD0_DATA_BYTE_1_SHIFT (16U) -/*! DATA_BYTE_1 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD0_DATA_BYTE_1(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD0_DATA_BYTE_1_SHIFT)) & CAN_WORD0_DATA_BYTE_1_MASK) - -#define CAN_WORD0_DATA_BYTE_0_MASK (0xFF000000U) -#define CAN_WORD0_DATA_BYTE_0_SHIFT (24U) -/*! DATA_BYTE_0 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD0_DATA_BYTE_0(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD0_DATA_BYTE_0_SHIFT)) & CAN_WORD0_DATA_BYTE_0_MASK) -/*! @} */ - -/* The count of CAN_WORD0 */ -#define CAN_WORD0_COUNT (32U) - -/*! @name WORD1 - Message Buffer 0 WORD1 Register..Message Buffer 31 WORD1 Register */ -/*! @{ */ - -#define CAN_WORD1_DATA_BYTE_7_MASK (0xFFU) -#define CAN_WORD1_DATA_BYTE_7_SHIFT (0U) -/*! DATA_BYTE_7 - Data byte 0 of Rx/Tx frame. */ -#define CAN_WORD1_DATA_BYTE_7(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD1_DATA_BYTE_7_SHIFT)) & CAN_WORD1_DATA_BYTE_7_MASK) - -#define CAN_WORD1_DATA_BYTE_6_MASK (0xFF00U) -#define CAN_WORD1_DATA_BYTE_6_SHIFT (8U) -/*! DATA_BYTE_6 - Data byte 1 of Rx/Tx frame. */ -#define CAN_WORD1_DATA_BYTE_6(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD1_DATA_BYTE_6_SHIFT)) & CAN_WORD1_DATA_BYTE_6_MASK) - -#define CAN_WORD1_DATA_BYTE_5_MASK (0xFF0000U) -#define CAN_WORD1_DATA_BYTE_5_SHIFT (16U) -/*! DATA_BYTE_5 - Data byte 2 of Rx/Tx frame. */ -#define CAN_WORD1_DATA_BYTE_5(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD1_DATA_BYTE_5_SHIFT)) & CAN_WORD1_DATA_BYTE_5_MASK) - -#define CAN_WORD1_DATA_BYTE_4_MASK (0xFF000000U) -#define CAN_WORD1_DATA_BYTE_4_SHIFT (24U) -/*! DATA_BYTE_4 - Data byte 3 of Rx/Tx frame. */ -#define CAN_WORD1_DATA_BYTE_4(x) (((uint32_t)(((uint32_t)(x)) << CAN_WORD1_DATA_BYTE_4_SHIFT)) & CAN_WORD1_DATA_BYTE_4_MASK) -/*! @} */ - -/* The count of CAN_WORD1 */ -#define CAN_WORD1_COUNT (32U) - -/*! @name RXIMR - Receive Individual Mask */ -/*! @{ */ - -#define CAN_RXIMR_MI_MASK (0xFFFFFFFFU) -#define CAN_RXIMR_MI_SHIFT (0U) -/*! MI - Individual Mask Bits */ -#define CAN_RXIMR_MI(x) (((uint32_t)(((uint32_t)(x)) << CAN_RXIMR_MI_SHIFT)) & CAN_RXIMR_MI_MASK) -/*! @} */ - -/* The count of CAN_RXIMR */ -#define CAN_RXIMR_COUNT (32U) - -/*! @name CTRL1_PN - Pretended Networking Control 1 */ -/*! @{ */ - -#define CAN_CTRL1_PN_FCS_MASK (0x3U) -#define CAN_CTRL1_PN_FCS_SHIFT (0U) -/*! FCS - Filtering Combination Selection - * 0b00..Message ID filtering only - * 0b01..Message ID filtering and payload filtering - * 0b10..Message ID filtering occurring a specified number of times - * 0b11..Message ID filtering and payload filtering a specified number of times - */ -#define CAN_CTRL1_PN_FCS(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PN_FCS_SHIFT)) & CAN_CTRL1_PN_FCS_MASK) - -#define CAN_CTRL1_PN_IDFS_MASK (0xCU) -#define CAN_CTRL1_PN_IDFS_SHIFT (2U) -/*! IDFS - ID Filtering Selection - * 0b00..Match ID contents to an exact target value - * 0b01..Match an ID value greater than or equal to a specified target value - * 0b10..Match an ID value smaller than or equal to a specified target value - * 0b11..Match an ID value within a range of values, inclusive - */ -#define CAN_CTRL1_PN_IDFS(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PN_IDFS_SHIFT)) & CAN_CTRL1_PN_IDFS_MASK) - -#define CAN_CTRL1_PN_PLFS_MASK (0x30U) -#define CAN_CTRL1_PN_PLFS_SHIFT (4U) -/*! PLFS - Payload Filtering Selection - * 0b00..Match payload contents to an exact target value - * 0b01..Match a payload value greater than or equal to a specified target value - * 0b10..Match a payload value smaller than or equal to a specified target value - * 0b11..Match upon a payload value within a range of values, inclusive - */ -#define CAN_CTRL1_PN_PLFS(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PN_PLFS_SHIFT)) & CAN_CTRL1_PN_PLFS_MASK) - -#define CAN_CTRL1_PN_NMATCH_MASK (0xFF00U) -#define CAN_CTRL1_PN_NMATCH_SHIFT (8U) -/*! NMATCH - Number of Messages Matching the Same Filtering Criteria - * 0b00000001..Once - * 0b00000010..Twice - * 0b11111111..255 times - */ -#define CAN_CTRL1_PN_NMATCH(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PN_NMATCH_SHIFT)) & CAN_CTRL1_PN_NMATCH_MASK) - -#define CAN_CTRL1_PN_WUMF_MSK_MASK (0x10000U) -#define CAN_CTRL1_PN_WUMF_MSK_SHIFT (16U) -/*! WUMF_MSK - Wake-up by Matching Flag Mask - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL1_PN_WUMF_MSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PN_WUMF_MSK_SHIFT)) & CAN_CTRL1_PN_WUMF_MSK_MASK) - -#define CAN_CTRL1_PN_WTOF_MSK_MASK (0x20000U) -#define CAN_CTRL1_PN_WTOF_MSK_SHIFT (17U) -/*! WTOF_MSK - Wake-up by Timeout Flag Mask - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_CTRL1_PN_WTOF_MSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL1_PN_WTOF_MSK_SHIFT)) & CAN_CTRL1_PN_WTOF_MSK_MASK) -/*! @} */ - -/*! @name CTRL2_PN - Pretended Networking Control 2 */ -/*! @{ */ - -#define CAN_CTRL2_PN_MATCHTO_MASK (0xFFFFU) -#define CAN_CTRL2_PN_MATCHTO_SHIFT (0U) -/*! MATCHTO - Timeout for No Message Matching the Filtering Criteria */ -#define CAN_CTRL2_PN_MATCHTO(x) (((uint32_t)(((uint32_t)(x)) << CAN_CTRL2_PN_MATCHTO_SHIFT)) & CAN_CTRL2_PN_MATCHTO_MASK) -/*! @} */ - -/*! @name WU_MTC - Pretended Networking Wake-Up Match */ -/*! @{ */ - -#define CAN_WU_MTC_MCOUNTER_MASK (0xFF00U) -#define CAN_WU_MTC_MCOUNTER_SHIFT (8U) -/*! MCOUNTER - Number of Matches in Pretended Networking */ -#define CAN_WU_MTC_MCOUNTER(x) (((uint32_t)(((uint32_t)(x)) << CAN_WU_MTC_MCOUNTER_SHIFT)) & CAN_WU_MTC_MCOUNTER_MASK) - -#define CAN_WU_MTC_WUMF_MASK (0x10000U) -#define CAN_WU_MTC_WUMF_SHIFT (16U) -/*! WUMF - Wake-up by Match Flag - * 0b0..No event detected - * 0b1..Event detected - */ -#define CAN_WU_MTC_WUMF(x) (((uint32_t)(((uint32_t)(x)) << CAN_WU_MTC_WUMF_SHIFT)) & CAN_WU_MTC_WUMF_MASK) - -#define CAN_WU_MTC_WTOF_MASK (0x20000U) -#define CAN_WU_MTC_WTOF_SHIFT (17U) -/*! WTOF - Wake-up by Timeout Flag Bit - * 0b0..No event detected - * 0b1..Event detected - */ -#define CAN_WU_MTC_WTOF(x) (((uint32_t)(((uint32_t)(x)) << CAN_WU_MTC_WTOF_SHIFT)) & CAN_WU_MTC_WTOF_MASK) -/*! @} */ - -/*! @name FLT_ID1 - Pretended Networking ID Filter 1 */ -/*! @{ */ - -#define CAN_FLT_ID1_FLT_ID1_MASK (0x1FFFFFFFU) -#define CAN_FLT_ID1_FLT_ID1_SHIFT (0U) -/*! FLT_ID1 - ID Filter 1 for Pretended Networking filtering */ -#define CAN_FLT_ID1_FLT_ID1(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_ID1_FLT_ID1_SHIFT)) & CAN_FLT_ID1_FLT_ID1_MASK) - -#define CAN_FLT_ID1_FLT_RTR_MASK (0x20000000U) -#define CAN_FLT_ID1_FLT_RTR_SHIFT (29U) -/*! FLT_RTR - Remote Transmission Request Filter - * 0b0..Reject remote frame (accept data frame) - * 0b1..Accept remote frame - */ -#define CAN_FLT_ID1_FLT_RTR(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_ID1_FLT_RTR_SHIFT)) & CAN_FLT_ID1_FLT_RTR_MASK) - -#define CAN_FLT_ID1_FLT_IDE_MASK (0x40000000U) -#define CAN_FLT_ID1_FLT_IDE_SHIFT (30U) -/*! FLT_IDE - ID Extended Filter - * 0b0..Standard - * 0b1..Extended - */ -#define CAN_FLT_ID1_FLT_IDE(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_ID1_FLT_IDE_SHIFT)) & CAN_FLT_ID1_FLT_IDE_MASK) -/*! @} */ - -/*! @name FLT_DLC - Pretended Networking Data Length Code (DLC) Filter */ -/*! @{ */ - -#define CAN_FLT_DLC_FLT_DLC_HI_MASK (0xFU) -#define CAN_FLT_DLC_FLT_DLC_HI_SHIFT (0U) -/*! FLT_DLC_HI - Upper Limit for Length of Data Bytes Filter */ -#define CAN_FLT_DLC_FLT_DLC_HI(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_DLC_FLT_DLC_HI_SHIFT)) & CAN_FLT_DLC_FLT_DLC_HI_MASK) - -#define CAN_FLT_DLC_FLT_DLC_LO_MASK (0xF0000U) -#define CAN_FLT_DLC_FLT_DLC_LO_SHIFT (16U) -/*! FLT_DLC_LO - Lower Limit for Length of Data Bytes Filter */ -#define CAN_FLT_DLC_FLT_DLC_LO(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_DLC_FLT_DLC_LO_SHIFT)) & CAN_FLT_DLC_FLT_DLC_LO_MASK) -/*! @} */ - -/*! @name PL1_LO - Pretended Networking Payload Low Filter 1 */ -/*! @{ */ - -#define CAN_PL1_LO_Data_byte_3_MASK (0xFFU) -#define CAN_PL1_LO_Data_byte_3_SHIFT (0U) -/*! Data_byte_3 - Data byte 3 */ -#define CAN_PL1_LO_Data_byte_3(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_LO_Data_byte_3_SHIFT)) & CAN_PL1_LO_Data_byte_3_MASK) - -#define CAN_PL1_LO_Data_byte_2_MASK (0xFF00U) -#define CAN_PL1_LO_Data_byte_2_SHIFT (8U) -/*! Data_byte_2 - Data byte 2 */ -#define CAN_PL1_LO_Data_byte_2(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_LO_Data_byte_2_SHIFT)) & CAN_PL1_LO_Data_byte_2_MASK) - -#define CAN_PL1_LO_Data_byte_1_MASK (0xFF0000U) -#define CAN_PL1_LO_Data_byte_1_SHIFT (16U) -/*! Data_byte_1 - Data byte 1 */ -#define CAN_PL1_LO_Data_byte_1(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_LO_Data_byte_1_SHIFT)) & CAN_PL1_LO_Data_byte_1_MASK) - -#define CAN_PL1_LO_Data_byte_0_MASK (0xFF000000U) -#define CAN_PL1_LO_Data_byte_0_SHIFT (24U) -/*! Data_byte_0 - Data byte 0 */ -#define CAN_PL1_LO_Data_byte_0(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_LO_Data_byte_0_SHIFT)) & CAN_PL1_LO_Data_byte_0_MASK) -/*! @} */ - -/*! @name PL1_HI - Pretended Networking Payload High Filter 1 */ -/*! @{ */ - -#define CAN_PL1_HI_Data_byte_7_MASK (0xFFU) -#define CAN_PL1_HI_Data_byte_7_SHIFT (0U) -/*! Data_byte_7 - Data byte 7 */ -#define CAN_PL1_HI_Data_byte_7(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_HI_Data_byte_7_SHIFT)) & CAN_PL1_HI_Data_byte_7_MASK) - -#define CAN_PL1_HI_Data_byte_6_MASK (0xFF00U) -#define CAN_PL1_HI_Data_byte_6_SHIFT (8U) -/*! Data_byte_6 - Data byte 6 */ -#define CAN_PL1_HI_Data_byte_6(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_HI_Data_byte_6_SHIFT)) & CAN_PL1_HI_Data_byte_6_MASK) - -#define CAN_PL1_HI_Data_byte_5_MASK (0xFF0000U) -#define CAN_PL1_HI_Data_byte_5_SHIFT (16U) -/*! Data_byte_5 - Data byte 5 */ -#define CAN_PL1_HI_Data_byte_5(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_HI_Data_byte_5_SHIFT)) & CAN_PL1_HI_Data_byte_5_MASK) - -#define CAN_PL1_HI_Data_byte_4_MASK (0xFF000000U) -#define CAN_PL1_HI_Data_byte_4_SHIFT (24U) -/*! Data_byte_4 - Data byte 4 */ -#define CAN_PL1_HI_Data_byte_4(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL1_HI_Data_byte_4_SHIFT)) & CAN_PL1_HI_Data_byte_4_MASK) -/*! @} */ - -/*! @name FLT_ID2_IDMASK - Pretended Networking ID Filter 2 or ID Mask */ -/*! @{ */ - -#define CAN_FLT_ID2_IDMASK_FLT_ID2_IDMASK_MASK (0x1FFFFFFFU) -#define CAN_FLT_ID2_IDMASK_FLT_ID2_IDMASK_SHIFT (0U) -/*! FLT_ID2_IDMASK - ID Filter 2 for Pretended Networking Filtering or ID Mask Bits for Pretended Networking ID Filtering */ -#define CAN_FLT_ID2_IDMASK_FLT_ID2_IDMASK(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_ID2_IDMASK_FLT_ID2_IDMASK_SHIFT)) & CAN_FLT_ID2_IDMASK_FLT_ID2_IDMASK_MASK) - -#define CAN_FLT_ID2_IDMASK_RTR_MSK_MASK (0x20000000U) -#define CAN_FLT_ID2_IDMASK_RTR_MSK_SHIFT (29U) -/*! RTR_MSK - Remote Transmission Request Mask - * 0b0..The corresponding bit in the filter is "don't care." - * 0b1..The corresponding bit in the filter is checked. - */ -#define CAN_FLT_ID2_IDMASK_RTR_MSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_ID2_IDMASK_RTR_MSK_SHIFT)) & CAN_FLT_ID2_IDMASK_RTR_MSK_MASK) - -#define CAN_FLT_ID2_IDMASK_IDE_MSK_MASK (0x40000000U) -#define CAN_FLT_ID2_IDMASK_IDE_MSK_SHIFT (30U) -/*! IDE_MSK - ID Extended Mask - * 0b0..The corresponding bit in the filter is "don't care." - * 0b1..The corresponding bit in the filter is checked. - */ -#define CAN_FLT_ID2_IDMASK_IDE_MSK(x) (((uint32_t)(((uint32_t)(x)) << CAN_FLT_ID2_IDMASK_IDE_MSK_SHIFT)) & CAN_FLT_ID2_IDMASK_IDE_MSK_MASK) -/*! @} */ - -/*! @name PL2_PLMASK_LO - Pretended Networking Payload Low Filter 2 and Payload Low Mask */ -/*! @{ */ - -#define CAN_PL2_PLMASK_LO_Data_byte_3_MASK (0xFFU) -#define CAN_PL2_PLMASK_LO_Data_byte_3_SHIFT (0U) -/*! Data_byte_3 - Data Byte 3 */ -#define CAN_PL2_PLMASK_LO_Data_byte_3(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_LO_Data_byte_3_SHIFT)) & CAN_PL2_PLMASK_LO_Data_byte_3_MASK) - -#define CAN_PL2_PLMASK_LO_Data_byte_2_MASK (0xFF00U) -#define CAN_PL2_PLMASK_LO_Data_byte_2_SHIFT (8U) -/*! Data_byte_2 - Data Byte 2 */ -#define CAN_PL2_PLMASK_LO_Data_byte_2(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_LO_Data_byte_2_SHIFT)) & CAN_PL2_PLMASK_LO_Data_byte_2_MASK) - -#define CAN_PL2_PLMASK_LO_Data_byte_1_MASK (0xFF0000U) -#define CAN_PL2_PLMASK_LO_Data_byte_1_SHIFT (16U) -/*! Data_byte_1 - Data Byte 1 */ -#define CAN_PL2_PLMASK_LO_Data_byte_1(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_LO_Data_byte_1_SHIFT)) & CAN_PL2_PLMASK_LO_Data_byte_1_MASK) - -#define CAN_PL2_PLMASK_LO_Data_byte_0_MASK (0xFF000000U) -#define CAN_PL2_PLMASK_LO_Data_byte_0_SHIFT (24U) -/*! Data_byte_0 - Data Byte 0 */ -#define CAN_PL2_PLMASK_LO_Data_byte_0(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_LO_Data_byte_0_SHIFT)) & CAN_PL2_PLMASK_LO_Data_byte_0_MASK) -/*! @} */ - -/*! @name PL2_PLMASK_HI - Pretended Networking Payload High Filter 2 and Payload High Mask */ -/*! @{ */ - -#define CAN_PL2_PLMASK_HI_Data_byte_7_MASK (0xFFU) -#define CAN_PL2_PLMASK_HI_Data_byte_7_SHIFT (0U) -/*! Data_byte_7 - Data Byte 7 */ -#define CAN_PL2_PLMASK_HI_Data_byte_7(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_HI_Data_byte_7_SHIFT)) & CAN_PL2_PLMASK_HI_Data_byte_7_MASK) - -#define CAN_PL2_PLMASK_HI_Data_byte_6_MASK (0xFF00U) -#define CAN_PL2_PLMASK_HI_Data_byte_6_SHIFT (8U) -/*! Data_byte_6 - Data Byte 6 */ -#define CAN_PL2_PLMASK_HI_Data_byte_6(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_HI_Data_byte_6_SHIFT)) & CAN_PL2_PLMASK_HI_Data_byte_6_MASK) - -#define CAN_PL2_PLMASK_HI_Data_byte_5_MASK (0xFF0000U) -#define CAN_PL2_PLMASK_HI_Data_byte_5_SHIFT (16U) -/*! Data_byte_5 - Data Byte 5 */ -#define CAN_PL2_PLMASK_HI_Data_byte_5(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_HI_Data_byte_5_SHIFT)) & CAN_PL2_PLMASK_HI_Data_byte_5_MASK) - -#define CAN_PL2_PLMASK_HI_Data_byte_4_MASK (0xFF000000U) -#define CAN_PL2_PLMASK_HI_Data_byte_4_SHIFT (24U) -/*! Data_byte_4 - Data Byte 4 */ -#define CAN_PL2_PLMASK_HI_Data_byte_4(x) (((uint32_t)(((uint32_t)(x)) << CAN_PL2_PLMASK_HI_Data_byte_4_SHIFT)) & CAN_PL2_PLMASK_HI_Data_byte_4_MASK) -/*! @} */ - -/*! @name WMB_CS - Wake-Up Message Buffer */ -/*! @{ */ - -#define CAN_WMB_CS_DLC_MASK (0xF0000U) -#define CAN_WMB_CS_DLC_SHIFT (16U) -/*! DLC - Length of Data in Bytes */ -#define CAN_WMB_CS_DLC(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_CS_DLC_SHIFT)) & CAN_WMB_CS_DLC_MASK) - -#define CAN_WMB_CS_RTR_MASK (0x100000U) -#define CAN_WMB_CS_RTR_SHIFT (20U) -/*! RTR - Remote Transmission Request - * 0b0..Data - * 0b1..Remote - */ -#define CAN_WMB_CS_RTR(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_CS_RTR_SHIFT)) & CAN_WMB_CS_RTR_MASK) - -#define CAN_WMB_CS_IDE_MASK (0x200000U) -#define CAN_WMB_CS_IDE_SHIFT (21U) -/*! IDE - ID Extended Bit - * 0b0..Standard - * 0b1..Extended - */ -#define CAN_WMB_CS_IDE(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_CS_IDE_SHIFT)) & CAN_WMB_CS_IDE_MASK) - -#define CAN_WMB_CS_SRR_MASK (0x400000U) -#define CAN_WMB_CS_SRR_SHIFT (22U) -/*! SRR - Substitute Remote Request - * 0b0..Dominant - * 0b1..Recessive - */ -#define CAN_WMB_CS_SRR(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_CS_SRR_SHIFT)) & CAN_WMB_CS_SRR_MASK) -/*! @} */ - -/* The count of CAN_WMB_CS */ -#define CAN_WMB_CS_COUNT (4U) - -/*! @name WMB_ID - Wake-Up Message Buffer for ID */ -/*! @{ */ - -#define CAN_WMB_ID_ID_MASK (0x1FFFFFFFU) -#define CAN_WMB_ID_ID_SHIFT (0U) -/*! ID - Received ID in Pretended Networking Mode */ -#define CAN_WMB_ID_ID(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_ID_ID_SHIFT)) & CAN_WMB_ID_ID_MASK) -/*! @} */ - -/* The count of CAN_WMB_ID */ -#define CAN_WMB_ID_COUNT (4U) - -/*! @name WMB_D03 - Wake-Up Message Buffer for Data 0-3 */ -/*! @{ */ - -#define CAN_WMB_D03_Data_byte_3_MASK (0xFFU) -#define CAN_WMB_D03_Data_byte_3_SHIFT (0U) -/*! Data_byte_3 - Data Byte 3 */ -#define CAN_WMB_D03_Data_byte_3(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D03_Data_byte_3_SHIFT)) & CAN_WMB_D03_Data_byte_3_MASK) - -#define CAN_WMB_D03_Data_byte_2_MASK (0xFF00U) -#define CAN_WMB_D03_Data_byte_2_SHIFT (8U) -/*! Data_byte_2 - Data Byte 2 */ -#define CAN_WMB_D03_Data_byte_2(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D03_Data_byte_2_SHIFT)) & CAN_WMB_D03_Data_byte_2_MASK) - -#define CAN_WMB_D03_Data_byte_1_MASK (0xFF0000U) -#define CAN_WMB_D03_Data_byte_1_SHIFT (16U) -/*! Data_byte_1 - Data Byte 1 */ -#define CAN_WMB_D03_Data_byte_1(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D03_Data_byte_1_SHIFT)) & CAN_WMB_D03_Data_byte_1_MASK) - -#define CAN_WMB_D03_Data_byte_0_MASK (0xFF000000U) -#define CAN_WMB_D03_Data_byte_0_SHIFT (24U) -/*! Data_byte_0 - Data Byte 0 */ -#define CAN_WMB_D03_Data_byte_0(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D03_Data_byte_0_SHIFT)) & CAN_WMB_D03_Data_byte_0_MASK) -/*! @} */ - -/* The count of CAN_WMB_D03 */ -#define CAN_WMB_D03_COUNT (4U) - -/*! @name WMB_D47 - Wake-Up Message Buffer Register Data 4-7 */ -/*! @{ */ - -#define CAN_WMB_D47_Data_byte_7_MASK (0xFFU) -#define CAN_WMB_D47_Data_byte_7_SHIFT (0U) -/*! Data_byte_7 - Data Byte 7 */ -#define CAN_WMB_D47_Data_byte_7(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D47_Data_byte_7_SHIFT)) & CAN_WMB_D47_Data_byte_7_MASK) - -#define CAN_WMB_D47_Data_byte_6_MASK (0xFF00U) -#define CAN_WMB_D47_Data_byte_6_SHIFT (8U) -/*! Data_byte_6 - Data Byte 6 */ -#define CAN_WMB_D47_Data_byte_6(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D47_Data_byte_6_SHIFT)) & CAN_WMB_D47_Data_byte_6_MASK) - -#define CAN_WMB_D47_Data_byte_5_MASK (0xFF0000U) -#define CAN_WMB_D47_Data_byte_5_SHIFT (16U) -/*! Data_byte_5 - Data Byte 5 */ -#define CAN_WMB_D47_Data_byte_5(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D47_Data_byte_5_SHIFT)) & CAN_WMB_D47_Data_byte_5_MASK) - -#define CAN_WMB_D47_Data_byte_4_MASK (0xFF000000U) -#define CAN_WMB_D47_Data_byte_4_SHIFT (24U) -/*! Data_byte_4 - Data Byte 4 */ -#define CAN_WMB_D47_Data_byte_4(x) (((uint32_t)(((uint32_t)(x)) << CAN_WMB_D47_Data_byte_4_SHIFT)) & CAN_WMB_D47_Data_byte_4_MASK) -/*! @} */ - -/* The count of CAN_WMB_D47 */ -#define CAN_WMB_D47_COUNT (4U) - -/*! @name EPRS - Enhanced CAN Bit Timing Prescalers */ -/*! @{ */ - -#define CAN_EPRS_ENPRESDIV_MASK (0x3FFU) -#define CAN_EPRS_ENPRESDIV_SHIFT (0U) -/*! ENPRESDIV - Extended Nominal Prescaler Division Factor */ -#define CAN_EPRS_ENPRESDIV(x) (((uint32_t)(((uint32_t)(x)) << CAN_EPRS_ENPRESDIV_SHIFT)) & CAN_EPRS_ENPRESDIV_MASK) - -#define CAN_EPRS_EDPRESDIV_MASK (0x3FF0000U) -#define CAN_EPRS_EDPRESDIV_SHIFT (16U) -/*! EDPRESDIV - Extended Data Phase Prescaler Division Factor */ -#define CAN_EPRS_EDPRESDIV(x) (((uint32_t)(((uint32_t)(x)) << CAN_EPRS_EDPRESDIV_SHIFT)) & CAN_EPRS_EDPRESDIV_MASK) -/*! @} */ - -/*! @name ENCBT - Enhanced Nominal CAN Bit Timing */ -/*! @{ */ - -#define CAN_ENCBT_NTSEG1_MASK (0xFFU) -#define CAN_ENCBT_NTSEG1_SHIFT (0U) -/*! NTSEG1 - Nominal Time Segment 1 */ -#define CAN_ENCBT_NTSEG1(x) (((uint32_t)(((uint32_t)(x)) << CAN_ENCBT_NTSEG1_SHIFT)) & CAN_ENCBT_NTSEG1_MASK) - -#define CAN_ENCBT_NTSEG2_MASK (0x7F000U) -#define CAN_ENCBT_NTSEG2_SHIFT (12U) -/*! NTSEG2 - Nominal Time Segment 2 */ -#define CAN_ENCBT_NTSEG2(x) (((uint32_t)(((uint32_t)(x)) << CAN_ENCBT_NTSEG2_SHIFT)) & CAN_ENCBT_NTSEG2_MASK) - -#define CAN_ENCBT_NRJW_MASK (0x1FC00000U) -#define CAN_ENCBT_NRJW_SHIFT (22U) -/*! NRJW - Nominal Resynchronization Jump Width */ -#define CAN_ENCBT_NRJW(x) (((uint32_t)(((uint32_t)(x)) << CAN_ENCBT_NRJW_SHIFT)) & CAN_ENCBT_NRJW_MASK) -/*! @} */ - -/*! @name EDCBT - Enhanced Data Phase CAN Bit Timing */ -/*! @{ */ - -#define CAN_EDCBT_DTSEG1_MASK (0x1FU) -#define CAN_EDCBT_DTSEG1_SHIFT (0U) -/*! DTSEG1 - Data Phase Segment 1 */ -#define CAN_EDCBT_DTSEG1(x) (((uint32_t)(((uint32_t)(x)) << CAN_EDCBT_DTSEG1_SHIFT)) & CAN_EDCBT_DTSEG1_MASK) - -#define CAN_EDCBT_DTSEG2_MASK (0xF000U) -#define CAN_EDCBT_DTSEG2_SHIFT (12U) -/*! DTSEG2 - Data Phase Time Segment 2 */ -#define CAN_EDCBT_DTSEG2(x) (((uint32_t)(((uint32_t)(x)) << CAN_EDCBT_DTSEG2_SHIFT)) & CAN_EDCBT_DTSEG2_MASK) - -#define CAN_EDCBT_DRJW_MASK (0x3C00000U) -#define CAN_EDCBT_DRJW_SHIFT (22U) -/*! DRJW - Data Phase Resynchronization Jump Width */ -#define CAN_EDCBT_DRJW(x) (((uint32_t)(((uint32_t)(x)) << CAN_EDCBT_DRJW_SHIFT)) & CAN_EDCBT_DRJW_MASK) -/*! @} */ - -/*! @name ETDC - Enhanced Transceiver Delay Compensation */ -/*! @{ */ - -#define CAN_ETDC_ETDCVAL_MASK (0xFFU) -#define CAN_ETDC_ETDCVAL_SHIFT (0U) -/*! ETDCVAL - Enhanced Transceiver Delay Compensation Value */ -#define CAN_ETDC_ETDCVAL(x) (((uint32_t)(((uint32_t)(x)) << CAN_ETDC_ETDCVAL_SHIFT)) & CAN_ETDC_ETDCVAL_MASK) - -#define CAN_ETDC_ETDCFAIL_MASK (0x8000U) -#define CAN_ETDC_ETDCFAIL_SHIFT (15U) -/*! ETDCFAIL - Transceiver Delay Compensation Fail - * 0b0..In range - * 0b1..Out of range - */ -#define CAN_ETDC_ETDCFAIL(x) (((uint32_t)(((uint32_t)(x)) << CAN_ETDC_ETDCFAIL_SHIFT)) & CAN_ETDC_ETDCFAIL_MASK) - -#define CAN_ETDC_ETDCOFF_MASK (0x7F0000U) -#define CAN_ETDC_ETDCOFF_SHIFT (16U) -/*! ETDCOFF - Enhanced Transceiver Delay Compensation Offset */ -#define CAN_ETDC_ETDCOFF(x) (((uint32_t)(((uint32_t)(x)) << CAN_ETDC_ETDCOFF_SHIFT)) & CAN_ETDC_ETDCOFF_MASK) - -#define CAN_ETDC_TDMDIS_MASK (0x40000000U) -#define CAN_ETDC_TDMDIS_SHIFT (30U) -/*! TDMDIS - Transceiver Delay Measurement Disable - * 0b0..Enable - * 0b1..Disable - */ -#define CAN_ETDC_TDMDIS(x) (((uint32_t)(((uint32_t)(x)) << CAN_ETDC_TDMDIS_SHIFT)) & CAN_ETDC_TDMDIS_MASK) - -#define CAN_ETDC_ETDCEN_MASK (0x80000000U) -#define CAN_ETDC_ETDCEN_SHIFT (31U) -/*! ETDCEN - Transceiver Delay Compensation Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_ETDC_ETDCEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_ETDC_ETDCEN_SHIFT)) & CAN_ETDC_ETDCEN_MASK) -/*! @} */ - -/*! @name FDCTRL - CAN FD Control */ -/*! @{ */ - -#define CAN_FDCTRL_TDCVAL_MASK (0x3FU) -#define CAN_FDCTRL_TDCVAL_SHIFT (0U) -/*! TDCVAL - Transceiver Delay Compensation Value */ -#define CAN_FDCTRL_TDCVAL(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCTRL_TDCVAL_SHIFT)) & CAN_FDCTRL_TDCVAL_MASK) - -#define CAN_FDCTRL_TDCOFF_MASK (0x1F00U) -#define CAN_FDCTRL_TDCOFF_SHIFT (8U) -/*! TDCOFF - Transceiver Delay Compensation Offset */ -#define CAN_FDCTRL_TDCOFF(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCTRL_TDCOFF_SHIFT)) & CAN_FDCTRL_TDCOFF_MASK) - -#define CAN_FDCTRL_TDCFAIL_MASK (0x4000U) -#define CAN_FDCTRL_TDCFAIL_SHIFT (14U) -/*! TDCFAIL - Transceiver Delay Compensation Fail - * 0b0..In range - * 0b1..Out of range - */ -#define CAN_FDCTRL_TDCFAIL(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCTRL_TDCFAIL_SHIFT)) & CAN_FDCTRL_TDCFAIL_MASK) - -#define CAN_FDCTRL_TDCEN_MASK (0x8000U) -#define CAN_FDCTRL_TDCEN_SHIFT (15U) -/*! TDCEN - Transceiver Delay Compensation Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_FDCTRL_TDCEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCTRL_TDCEN_SHIFT)) & CAN_FDCTRL_TDCEN_MASK) - -#define CAN_FDCTRL_MBDSR0_MASK (0x30000U) -#define CAN_FDCTRL_MBDSR0_SHIFT (16U) -/*! MBDSR0 - Message Buffer Data Size for Region 0 - * 0b00..8 bytes - * 0b01..16 bytes - * 0b10..32 bytes - * 0b11..64 bytes - */ -#define CAN_FDCTRL_MBDSR0(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCTRL_MBDSR0_SHIFT)) & CAN_FDCTRL_MBDSR0_MASK) - -#define CAN_FDCTRL_FDRATE_MASK (0x80000000U) -#define CAN_FDCTRL_FDRATE_SHIFT (31U) -/*! FDRATE - Bit Rate Switch Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_FDCTRL_FDRATE(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCTRL_FDRATE_SHIFT)) & CAN_FDCTRL_FDRATE_MASK) -/*! @} */ - -/*! @name FDCBT - CAN FD Bit Timing */ -/*! @{ */ - -#define CAN_FDCBT_FPSEG2_MASK (0x7U) -#define CAN_FDCBT_FPSEG2_SHIFT (0U) -/*! FPSEG2 - Fast Phase Segment 2 */ -#define CAN_FDCBT_FPSEG2(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCBT_FPSEG2_SHIFT)) & CAN_FDCBT_FPSEG2_MASK) - -#define CAN_FDCBT_FPSEG1_MASK (0xE0U) -#define CAN_FDCBT_FPSEG1_SHIFT (5U) -/*! FPSEG1 - Fast Phase Segment 1 */ -#define CAN_FDCBT_FPSEG1(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCBT_FPSEG1_SHIFT)) & CAN_FDCBT_FPSEG1_MASK) - -#define CAN_FDCBT_FPROPSEG_MASK (0x7C00U) -#define CAN_FDCBT_FPROPSEG_SHIFT (10U) -/*! FPROPSEG - Fast Propagation Segment */ -#define CAN_FDCBT_FPROPSEG(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCBT_FPROPSEG_SHIFT)) & CAN_FDCBT_FPROPSEG_MASK) - -#define CAN_FDCBT_FRJW_MASK (0x70000U) -#define CAN_FDCBT_FRJW_SHIFT (16U) -/*! FRJW - Fast Resync Jump Width */ -#define CAN_FDCBT_FRJW(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCBT_FRJW_SHIFT)) & CAN_FDCBT_FRJW_MASK) - -#define CAN_FDCBT_FPRESDIV_MASK (0x3FF00000U) -#define CAN_FDCBT_FPRESDIV_SHIFT (20U) -/*! FPRESDIV - Fast Prescaler Division Factor */ -#define CAN_FDCBT_FPRESDIV(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCBT_FPRESDIV_SHIFT)) & CAN_FDCBT_FPRESDIV_MASK) -/*! @} */ - -/*! @name FDCRC - CAN FD CRC */ -/*! @{ */ - -#define CAN_FDCRC_FD_TXCRC_MASK (0x1FFFFFU) -#define CAN_FDCRC_FD_TXCRC_SHIFT (0U) -/*! FD_TXCRC - Extended Transmitted CRC value */ -#define CAN_FDCRC_FD_TXCRC(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCRC_FD_TXCRC_SHIFT)) & CAN_FDCRC_FD_TXCRC_MASK) - -#define CAN_FDCRC_FD_MBCRC_MASK (0x7F000000U) -#define CAN_FDCRC_FD_MBCRC_SHIFT (24U) -/*! FD_MBCRC - CRC Message Buffer Number for FD_TXCRC */ -#define CAN_FDCRC_FD_MBCRC(x) (((uint32_t)(((uint32_t)(x)) << CAN_FDCRC_FD_MBCRC_SHIFT)) & CAN_FDCRC_FD_MBCRC_MASK) -/*! @} */ - -/*! @name ERFCR - Enhanced RX FIFO Control */ -/*! @{ */ - -#define CAN_ERFCR_ERFWM_MASK (0x1FU) -#define CAN_ERFCR_ERFWM_SHIFT (0U) -/*! ERFWM - Enhanced RX FIFO Watermark */ -#define CAN_ERFCR_ERFWM(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFCR_ERFWM_SHIFT)) & CAN_ERFCR_ERFWM_MASK) - -#define CAN_ERFCR_NFE_MASK (0x3F00U) -#define CAN_ERFCR_NFE_SHIFT (8U) -/*! NFE - Number of Enhanced RX FIFO Filter Elements */ -#define CAN_ERFCR_NFE(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFCR_NFE_SHIFT)) & CAN_ERFCR_NFE_MASK) - -#define CAN_ERFCR_NEXIF_MASK (0x7F0000U) -#define CAN_ERFCR_NEXIF_SHIFT (16U) -/*! NEXIF - Number of Extended ID Filter Elements */ -#define CAN_ERFCR_NEXIF(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFCR_NEXIF_SHIFT)) & CAN_ERFCR_NEXIF_MASK) - -#define CAN_ERFCR_DMALW_MASK (0x7C000000U) -#define CAN_ERFCR_DMALW_SHIFT (26U) -/*! DMALW - DMA Last Word */ -#define CAN_ERFCR_DMALW(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFCR_DMALW_SHIFT)) & CAN_ERFCR_DMALW_MASK) - -#define CAN_ERFCR_ERFEN_MASK (0x80000000U) -#define CAN_ERFCR_ERFEN_SHIFT (31U) -/*! ERFEN - Enhanced RX FIFO enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_ERFCR_ERFEN(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFCR_ERFEN_SHIFT)) & CAN_ERFCR_ERFEN_MASK) -/*! @} */ - -/*! @name ERFIER - Enhanced RX FIFO Interrupt Enable */ -/*! @{ */ - -#define CAN_ERFIER_ERFDAIE_MASK (0x10000000U) -#define CAN_ERFIER_ERFDAIE_SHIFT (28U) -/*! ERFDAIE - Enhanced RX FIFO Data Available Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_ERFIER_ERFDAIE(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFIER_ERFDAIE_SHIFT)) & CAN_ERFIER_ERFDAIE_MASK) - -#define CAN_ERFIER_ERFWMIIE_MASK (0x20000000U) -#define CAN_ERFIER_ERFWMIIE_SHIFT (29U) -/*! ERFWMIIE - Enhanced RX FIFO Watermark Indication Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_ERFIER_ERFWMIIE(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFIER_ERFWMIIE_SHIFT)) & CAN_ERFIER_ERFWMIIE_MASK) - -#define CAN_ERFIER_ERFOVFIE_MASK (0x40000000U) -#define CAN_ERFIER_ERFOVFIE_SHIFT (30U) -/*! ERFOVFIE - Enhanced RX FIFO Overflow Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_ERFIER_ERFOVFIE(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFIER_ERFOVFIE_SHIFT)) & CAN_ERFIER_ERFOVFIE_MASK) - -#define CAN_ERFIER_ERFUFWIE_MASK (0x80000000U) -#define CAN_ERFIER_ERFUFWIE_SHIFT (31U) -/*! ERFUFWIE - Enhanced RX FIFO Underflow Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CAN_ERFIER_ERFUFWIE(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFIER_ERFUFWIE_SHIFT)) & CAN_ERFIER_ERFUFWIE_MASK) -/*! @} */ - -/*! @name ERFSR - Enhanced RX FIFO Status */ -/*! @{ */ - -#define CAN_ERFSR_ERFEL_MASK (0x3FU) -#define CAN_ERFSR_ERFEL_SHIFT (0U) -/*! ERFEL - Enhanced RX FIFO Elements */ -#define CAN_ERFSR_ERFEL(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFEL_SHIFT)) & CAN_ERFSR_ERFEL_MASK) - -#define CAN_ERFSR_ERFF_MASK (0x10000U) -#define CAN_ERFSR_ERFF_SHIFT (16U) -/*! ERFF - Enhanced RX FIFO Full Flag - * 0b0..Not full - * 0b1..Full - */ -#define CAN_ERFSR_ERFF(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFF_SHIFT)) & CAN_ERFSR_ERFF_MASK) - -#define CAN_ERFSR_ERFE_MASK (0x20000U) -#define CAN_ERFSR_ERFE_SHIFT (17U) -/*! ERFE - Enhanced RX FIFO Empty Flag - * 0b0..Not empty - * 0b1..Empty - */ -#define CAN_ERFSR_ERFE(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFE_SHIFT)) & CAN_ERFSR_ERFE_MASK) - -#define CAN_ERFSR_ERFCLR_MASK (0x8000000U) -#define CAN_ERFSR_ERFCLR_SHIFT (27U) -/*! ERFCLR - Enhanced RX FIFO Clear - * 0b0..No effect - * 0b1..Clear enhanced RX FIFO content - */ -#define CAN_ERFSR_ERFCLR(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFCLR_SHIFT)) & CAN_ERFSR_ERFCLR_MASK) - -#define CAN_ERFSR_ERFDA_MASK (0x10000000U) -#define CAN_ERFSR_ERFDA_SHIFT (28U) -/*! ERFDA - Enhanced RX FIFO Data Available Flag - * 0b0..No such occurrence - * 0b1..At least one message stored in Enhanced RX FIFO - */ -#define CAN_ERFSR_ERFDA(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFDA_SHIFT)) & CAN_ERFSR_ERFDA_MASK) - -#define CAN_ERFSR_ERFWMI_MASK (0x20000000U) -#define CAN_ERFSR_ERFWMI_SHIFT (29U) -/*! ERFWMI - Enhanced RX FIFO Watermark Indication Flag - * 0b0..No such occurrence - * 0b1..Number of messages in FIFO is greater than the watermark - */ -#define CAN_ERFSR_ERFWMI(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFWMI_SHIFT)) & CAN_ERFSR_ERFWMI_MASK) - -#define CAN_ERFSR_ERFOVF_MASK (0x40000000U) -#define CAN_ERFSR_ERFOVF_SHIFT (30U) -/*! ERFOVF - Enhanced RX FIFO Overflow Flag - * 0b0..No such occurrence - * 0b1..Overflow - */ -#define CAN_ERFSR_ERFOVF(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFOVF_SHIFT)) & CAN_ERFSR_ERFOVF_MASK) - -#define CAN_ERFSR_ERFUFW_MASK (0x80000000U) -#define CAN_ERFSR_ERFUFW_SHIFT (31U) -/*! ERFUFW - Enhanced RX FIFO Underflow Flag - * 0b0..No such occurrence - * 0b1..Underflow - */ -#define CAN_ERFSR_ERFUFW(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFSR_ERFUFW_SHIFT)) & CAN_ERFSR_ERFUFW_MASK) -/*! @} */ - -/*! @name ERFFEL - Enhanced RX FIFO Filter Element */ -/*! @{ */ - -#define CAN_ERFFEL_FEL_MASK (0xFFFFFFFFU) -#define CAN_ERFFEL_FEL_SHIFT (0U) -/*! FEL - Filter Element Bits */ -#define CAN_ERFFEL_FEL(x) (((uint32_t)(((uint32_t)(x)) << CAN_ERFFEL_FEL_SHIFT)) & CAN_ERFFEL_FEL_MASK) -/*! @} */ - -/* The count of CAN_ERFFEL */ -#define CAN_ERFFEL_COUNT (32U) - - -/*! - * @} - */ /* end of group CAN_Register_Masks */ - - -/* CAN - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral CAN0 base address */ - #define CAN0_BASE (0x500D4000u) - /** Peripheral CAN0 base address */ - #define CAN0_BASE_NS (0x400D4000u) - /** Peripheral CAN0 base pointer */ - #define CAN0 ((CAN_Type *)CAN0_BASE) - /** Peripheral CAN0 base pointer */ - #define CAN0_NS ((CAN_Type *)CAN0_BASE_NS) - /** Peripheral CAN1 base address */ - #define CAN1_BASE (0x500D8000u) - /** Peripheral CAN1 base address */ - #define CAN1_BASE_NS (0x400D8000u) - /** Peripheral CAN1 base pointer */ - #define CAN1 ((CAN_Type *)CAN1_BASE) - /** Peripheral CAN1 base pointer */ - #define CAN1_NS ((CAN_Type *)CAN1_BASE_NS) - /** Array initializer of CAN peripheral base addresses */ - #define CAN_BASE_ADDRS { CAN0_BASE, CAN1_BASE } - /** Array initializer of CAN peripheral base pointers */ - #define CAN_BASE_PTRS { CAN0, CAN1 } - /** Array initializer of CAN peripheral base addresses */ - #define CAN_BASE_ADDRS_NS { CAN0_BASE_NS, CAN1_BASE_NS } - /** Array initializer of CAN peripheral base pointers */ - #define CAN_BASE_PTRS_NS { CAN0_NS, CAN1_NS } -#else - /** Peripheral CAN0 base address */ - #define CAN0_BASE (0x400D4000u) - /** Peripheral CAN0 base pointer */ - #define CAN0 ((CAN_Type *)CAN0_BASE) - /** Peripheral CAN1 base address */ - #define CAN1_BASE (0x400D8000u) - /** Peripheral CAN1 base pointer */ - #define CAN1 ((CAN_Type *)CAN1_BASE) - /** Array initializer of CAN peripheral base addresses */ - #define CAN_BASE_ADDRS { CAN0_BASE, CAN1_BASE } - /** Array initializer of CAN peripheral base pointers */ - #define CAN_BASE_PTRS { CAN0, CAN1 } -#endif -/** Interrupt vectors for the CAN peripheral type */ -#define CAN_Rx_Warning_IRQS { CAN0_IRQn, CAN1_IRQn } -#define CAN_Tx_Warning_IRQS { CAN0_IRQn, CAN1_IRQn } -#define CAN_Wake_Up_IRQS { CAN0_IRQn, CAN1_IRQn } -#define CAN_Error_IRQS { CAN0_IRQn, CAN1_IRQn } -#define CAN_Bus_Off_IRQS { CAN0_IRQn, CAN1_IRQn } -#define CAN_ORed_Message_buffer_IRQS { CAN0_IRQn, CAN1_IRQn } - -/*! - * @} - */ /* end of group CAN_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- CDOG Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CDOG_Peripheral_Access_Layer CDOG Peripheral Access Layer - * @{ - */ - -/** CDOG - Register Layout Typedef */ -typedef struct { - __IO uint32_t CONTROL; /**< Control Register, offset: 0x0 */ - __IO uint32_t RELOAD; /**< Instruction Timer Reload Register, offset: 0x4 */ - __I uint32_t INSTRUCTION_TIMER; /**< Instruction Timer Register, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __I uint32_t STATUS; /**< Status 1 Register, offset: 0x10 */ - __I uint32_t STATUS2; /**< Status 2 Register, offset: 0x14 */ - __IO uint32_t FLAGS; /**< Flags Register, offset: 0x18 */ - __IO uint32_t PERSISTENT; /**< Persistent Data Storage Register, offset: 0x1C */ - __O uint32_t START; /**< START Command Register, offset: 0x20 */ - __O uint32_t STOP; /**< STOP Command Register, offset: 0x24 */ - __O uint32_t RESTART; /**< RESTART Command Register, offset: 0x28 */ - __O uint32_t ADD; /**< ADD Command Register, offset: 0x2C */ - __O uint32_t ADD1; /**< ADD1 Command Register, offset: 0x30 */ - __O uint32_t ADD16; /**< ADD16 Command Register, offset: 0x34 */ - __O uint32_t ADD256; /**< ADD256 Command Register, offset: 0x38 */ - __O uint32_t SUB; /**< SUB Command Register, offset: 0x3C */ - __O uint32_t SUB1; /**< SUB1 Command Register, offset: 0x40 */ - __O uint32_t SUB16; /**< SUB16 Command Register, offset: 0x44 */ - __O uint32_t SUB256; /**< SUB256 Command Register, offset: 0x48 */ - __O uint32_t ASSERT16; /**< ASSERT16 Command Register, offset: 0x4C */ -} CDOG_Type; - -/* ---------------------------------------------------------------------------- - -- CDOG Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CDOG_Register_Masks CDOG Register Masks - * @{ - */ - -/*! @name CONTROL - Control Register */ -/*! @{ */ - -#define CDOG_CONTROL_LOCK_CTRL_MASK (0x3U) -#define CDOG_CONTROL_LOCK_CTRL_SHIFT (0U) -/*! LOCK_CTRL - Lock control - * 0b01..Locked - * 0b10..Unlocked - */ -#define CDOG_CONTROL_LOCK_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_LOCK_CTRL_SHIFT)) & CDOG_CONTROL_LOCK_CTRL_MASK) - -#define CDOG_CONTROL_TIMEOUT_CTRL_MASK (0x1CU) -#define CDOG_CONTROL_TIMEOUT_CTRL_SHIFT (2U) -/*! TIMEOUT_CTRL - TIMEOUT fault control - * 0b100..Disable both reset and interrupt - * 0b001..Enable reset - * 0b010..Enable interrupt - */ -#define CDOG_CONTROL_TIMEOUT_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_TIMEOUT_CTRL_SHIFT)) & CDOG_CONTROL_TIMEOUT_CTRL_MASK) - -#define CDOG_CONTROL_MISCOMPARE_CTRL_MASK (0xE0U) -#define CDOG_CONTROL_MISCOMPARE_CTRL_SHIFT (5U) -/*! MISCOMPARE_CTRL - MISCOMPARE fault control - * 0b100..Disable both reset and interrupt - * 0b001..Enable reset - * 0b010..Enable interrupt - */ -#define CDOG_CONTROL_MISCOMPARE_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_MISCOMPARE_CTRL_SHIFT)) & CDOG_CONTROL_MISCOMPARE_CTRL_MASK) - -#define CDOG_CONTROL_SEQUENCE_CTRL_MASK (0x700U) -#define CDOG_CONTROL_SEQUENCE_CTRL_SHIFT (8U) -/*! SEQUENCE_CTRL - SEQUENCE fault control - * 0b001..Enable reset - * 0b010..Enable interrupt - * 0b100..Disable both reset and interrupt - */ -#define CDOG_CONTROL_SEQUENCE_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_SEQUENCE_CTRL_SHIFT)) & CDOG_CONTROL_SEQUENCE_CTRL_MASK) - -#define CDOG_CONTROL_STATE_CTRL_MASK (0x1C000U) -#define CDOG_CONTROL_STATE_CTRL_SHIFT (14U) -/*! STATE_CTRL - STATE fault control - * 0b001..Enable reset - * 0b010..Enable interrupt - * 0b100..Disable both reset and interrupt - */ -#define CDOG_CONTROL_STATE_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_STATE_CTRL_SHIFT)) & CDOG_CONTROL_STATE_CTRL_MASK) - -#define CDOG_CONTROL_ADDRESS_CTRL_MASK (0xE0000U) -#define CDOG_CONTROL_ADDRESS_CTRL_SHIFT (17U) -/*! ADDRESS_CTRL - ADDRESS fault control - * 0b001..Enable reset - * 0b010..Enable interrupt - * 0b100..Disable both reset and interrupt - */ -#define CDOG_CONTROL_ADDRESS_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_ADDRESS_CTRL_SHIFT)) & CDOG_CONTROL_ADDRESS_CTRL_MASK) - -#define CDOG_CONTROL_IRQ_PAUSE_MASK (0x30000000U) -#define CDOG_CONTROL_IRQ_PAUSE_SHIFT (28U) -/*! IRQ_PAUSE - IRQ pause control - * 0b01..Keep the timer running - * 0b10..Stop the timer - */ -#define CDOG_CONTROL_IRQ_PAUSE(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_IRQ_PAUSE_SHIFT)) & CDOG_CONTROL_IRQ_PAUSE_MASK) - -#define CDOG_CONTROL_DEBUG_HALT_CTRL_MASK (0xC0000000U) -#define CDOG_CONTROL_DEBUG_HALT_CTRL_SHIFT (30U) -/*! DEBUG_HALT_CTRL - DEBUG_HALT control - * 0b01..Keep the timer running - * 0b10..Stop the timer - */ -#define CDOG_CONTROL_DEBUG_HALT_CTRL(x) (((uint32_t)(((uint32_t)(x)) << CDOG_CONTROL_DEBUG_HALT_CTRL_SHIFT)) & CDOG_CONTROL_DEBUG_HALT_CTRL_MASK) -/*! @} */ - -/*! @name RELOAD - Instruction Timer Reload Register */ -/*! @{ */ - -#define CDOG_RELOAD_RLOAD_MASK (0xFFFFFFFFU) -#define CDOG_RELOAD_RLOAD_SHIFT (0U) -/*! RLOAD - Instruction Timer reload value */ -#define CDOG_RELOAD_RLOAD(x) (((uint32_t)(((uint32_t)(x)) << CDOG_RELOAD_RLOAD_SHIFT)) & CDOG_RELOAD_RLOAD_MASK) -/*! @} */ - -/*! @name INSTRUCTION_TIMER - Instruction Timer Register */ -/*! @{ */ - -#define CDOG_INSTRUCTION_TIMER_INSTIM_MASK (0xFFFFFFFFU) -#define CDOG_INSTRUCTION_TIMER_INSTIM_SHIFT (0U) -/*! INSTIM - Current value of the Instruction Timer */ -#define CDOG_INSTRUCTION_TIMER_INSTIM(x) (((uint32_t)(((uint32_t)(x)) << CDOG_INSTRUCTION_TIMER_INSTIM_SHIFT)) & CDOG_INSTRUCTION_TIMER_INSTIM_MASK) -/*! @} */ - -/*! @name STATUS - Status 1 Register */ -/*! @{ */ - -#define CDOG_STATUS_NUMTOF_MASK (0xFFU) -#define CDOG_STATUS_NUMTOF_SHIFT (0U) -/*! NUMTOF - Number of TIMEOUT faults since the last POR */ -#define CDOG_STATUS_NUMTOF(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS_NUMTOF_SHIFT)) & CDOG_STATUS_NUMTOF_MASK) - -#define CDOG_STATUS_NUMMISCOMPF_MASK (0xFF00U) -#define CDOG_STATUS_NUMMISCOMPF_SHIFT (8U) -/*! NUMMISCOMPF - Number of MISCOMPARE faults since the last POR */ -#define CDOG_STATUS_NUMMISCOMPF(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS_NUMMISCOMPF_SHIFT)) & CDOG_STATUS_NUMMISCOMPF_MASK) - -#define CDOG_STATUS_NUMILSEQF_MASK (0xFF0000U) -#define CDOG_STATUS_NUMILSEQF_SHIFT (16U) -/*! NUMILSEQF - Number of SEQUENCE faults since the last POR */ -#define CDOG_STATUS_NUMILSEQF(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS_NUMILSEQF_SHIFT)) & CDOG_STATUS_NUMILSEQF_MASK) - -#define CDOG_STATUS_CURST_MASK (0xF0000000U) -#define CDOG_STATUS_CURST_SHIFT (28U) -/*! CURST - Current State */ -#define CDOG_STATUS_CURST(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS_CURST_SHIFT)) & CDOG_STATUS_CURST_MASK) -/*! @} */ - -/*! @name STATUS2 - Status 2 Register */ -/*! @{ */ - -#define CDOG_STATUS2_NUMCNTF_MASK (0xFFU) -#define CDOG_STATUS2_NUMCNTF_SHIFT (0U) -/*! NUMCNTF - Number of CONTROL faults since the last POR */ -#define CDOG_STATUS2_NUMCNTF(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS2_NUMCNTF_SHIFT)) & CDOG_STATUS2_NUMCNTF_MASK) - -#define CDOG_STATUS2_NUMILLSTF_MASK (0xFF00U) -#define CDOG_STATUS2_NUMILLSTF_SHIFT (8U) -/*! NUMILLSTF - Number of STATE faults since the last POR */ -#define CDOG_STATUS2_NUMILLSTF(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS2_NUMILLSTF_SHIFT)) & CDOG_STATUS2_NUMILLSTF_MASK) - -#define CDOG_STATUS2_NUMILLA_MASK (0xFF0000U) -#define CDOG_STATUS2_NUMILLA_SHIFT (16U) -/*! NUMILLA - Number of ADDRESS faults since the last POR */ -#define CDOG_STATUS2_NUMILLA(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STATUS2_NUMILLA_SHIFT)) & CDOG_STATUS2_NUMILLA_MASK) -/*! @} */ - -/*! @name FLAGS - Flags Register */ -/*! @{ */ - -#define CDOG_FLAGS_TO_FLAG_MASK (0x1U) -#define CDOG_FLAGS_TO_FLAG_SHIFT (0U) -/*! TO_FLAG - TIMEOUT fault flag - * 0b0..A TIMEOUT fault has not occurred - * 0b1..A TIMEOUT fault has occurred - */ -#define CDOG_FLAGS_TO_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_TO_FLAG_SHIFT)) & CDOG_FLAGS_TO_FLAG_MASK) - -#define CDOG_FLAGS_MISCOM_FLAG_MASK (0x2U) -#define CDOG_FLAGS_MISCOM_FLAG_SHIFT (1U) -/*! MISCOM_FLAG - MISCOMPARE fault flag - * 0b0..A MISCOMPARE fault has not occurred - * 0b1..A MISCOMPARE fault has occurred - */ -#define CDOG_FLAGS_MISCOM_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_MISCOM_FLAG_SHIFT)) & CDOG_FLAGS_MISCOM_FLAG_MASK) - -#define CDOG_FLAGS_SEQ_FLAG_MASK (0x4U) -#define CDOG_FLAGS_SEQ_FLAG_SHIFT (2U) -/*! SEQ_FLAG - SEQUENCE fault flag - * 0b0..A SEQUENCE fault has not occurred - * 0b1..A SEQUENCE fault has occurred - */ -#define CDOG_FLAGS_SEQ_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_SEQ_FLAG_SHIFT)) & CDOG_FLAGS_SEQ_FLAG_MASK) - -#define CDOG_FLAGS_CNT_FLAG_MASK (0x8U) -#define CDOG_FLAGS_CNT_FLAG_SHIFT (3U) -/*! CNT_FLAG - CONTROL fault flag - * 0b0..A CONTROL fault has not occurred - * 0b1..A CONTROL fault has occurred - */ -#define CDOG_FLAGS_CNT_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_CNT_FLAG_SHIFT)) & CDOG_FLAGS_CNT_FLAG_MASK) - -#define CDOG_FLAGS_STATE_FLAG_MASK (0x10U) -#define CDOG_FLAGS_STATE_FLAG_SHIFT (4U) -/*! STATE_FLAG - STATE fault flag - * 0b0..A STATE fault has not occurred - * 0b1..A STATE fault has occurred - */ -#define CDOG_FLAGS_STATE_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_STATE_FLAG_SHIFT)) & CDOG_FLAGS_STATE_FLAG_MASK) - -#define CDOG_FLAGS_ADDR_FLAG_MASK (0x20U) -#define CDOG_FLAGS_ADDR_FLAG_SHIFT (5U) -/*! ADDR_FLAG - ADDRESS fault flag - * 0b0..An ADDRESS fault has not occurred - * 0b1..An ADDRESS fault has occurred - */ -#define CDOG_FLAGS_ADDR_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_ADDR_FLAG_SHIFT)) & CDOG_FLAGS_ADDR_FLAG_MASK) - -#define CDOG_FLAGS_POR_FLAG_MASK (0x10000U) -#define CDOG_FLAGS_POR_FLAG_SHIFT (16U) -/*! POR_FLAG - Power-on reset flag - * 0b0..A Power-on reset event has not occurred - * 0b1..A Power-on reset event has occurred - */ -#define CDOG_FLAGS_POR_FLAG(x) (((uint32_t)(((uint32_t)(x)) << CDOG_FLAGS_POR_FLAG_SHIFT)) & CDOG_FLAGS_POR_FLAG_MASK) -/*! @} */ - -/*! @name PERSISTENT - Persistent Data Storage Register */ -/*! @{ */ - -#define CDOG_PERSISTENT_PERSIS_MASK (0xFFFFFFFFU) -#define CDOG_PERSISTENT_PERSIS_SHIFT (0U) -/*! PERSIS - Persistent Storage */ -#define CDOG_PERSISTENT_PERSIS(x) (((uint32_t)(((uint32_t)(x)) << CDOG_PERSISTENT_PERSIS_SHIFT)) & CDOG_PERSISTENT_PERSIS_MASK) -/*! @} */ - -/*! @name START - START Command Register */ -/*! @{ */ - -#define CDOG_START_STRT_MASK (0xFFFFFFFFU) -#define CDOG_START_STRT_SHIFT (0U) -/*! STRT - Start command */ -#define CDOG_START_STRT(x) (((uint32_t)(((uint32_t)(x)) << CDOG_START_STRT_SHIFT)) & CDOG_START_STRT_MASK) -/*! @} */ - -/*! @name STOP - STOP Command Register */ -/*! @{ */ - -#define CDOG_STOP_STP_MASK (0xFFFFFFFFU) -#define CDOG_STOP_STP_SHIFT (0U) -/*! STP - Stop command */ -#define CDOG_STOP_STP(x) (((uint32_t)(((uint32_t)(x)) << CDOG_STOP_STP_SHIFT)) & CDOG_STOP_STP_MASK) -/*! @} */ - -/*! @name RESTART - RESTART Command Register */ -/*! @{ */ - -#define CDOG_RESTART_RSTRT_MASK (0xFFFFFFFFU) -#define CDOG_RESTART_RSTRT_SHIFT (0U) -/*! RSTRT - Restart command */ -#define CDOG_RESTART_RSTRT(x) (((uint32_t)(((uint32_t)(x)) << CDOG_RESTART_RSTRT_SHIFT)) & CDOG_RESTART_RSTRT_MASK) -/*! @} */ - -/*! @name ADD - ADD Command Register */ -/*! @{ */ - -#define CDOG_ADD_AD_MASK (0xFFFFFFFFU) -#define CDOG_ADD_AD_SHIFT (0U) -/*! AD - ADD Write Value */ -#define CDOG_ADD_AD(x) (((uint32_t)(((uint32_t)(x)) << CDOG_ADD_AD_SHIFT)) & CDOG_ADD_AD_MASK) -/*! @} */ - -/*! @name ADD1 - ADD1 Command Register */ -/*! @{ */ - -#define CDOG_ADD1_AD1_MASK (0xFFFFFFFFU) -#define CDOG_ADD1_AD1_SHIFT (0U) -/*! AD1 - ADD 1 */ -#define CDOG_ADD1_AD1(x) (((uint32_t)(((uint32_t)(x)) << CDOG_ADD1_AD1_SHIFT)) & CDOG_ADD1_AD1_MASK) -/*! @} */ - -/*! @name ADD16 - ADD16 Command Register */ -/*! @{ */ - -#define CDOG_ADD16_AD16_MASK (0xFFFFFFFFU) -#define CDOG_ADD16_AD16_SHIFT (0U) -/*! AD16 - ADD 16 */ -#define CDOG_ADD16_AD16(x) (((uint32_t)(((uint32_t)(x)) << CDOG_ADD16_AD16_SHIFT)) & CDOG_ADD16_AD16_MASK) -/*! @} */ - -/*! @name ADD256 - ADD256 Command Register */ -/*! @{ */ - -#define CDOG_ADD256_AD256_MASK (0xFFFFFFFFU) -#define CDOG_ADD256_AD256_SHIFT (0U) -/*! AD256 - ADD 256 */ -#define CDOG_ADD256_AD256(x) (((uint32_t)(((uint32_t)(x)) << CDOG_ADD256_AD256_SHIFT)) & CDOG_ADD256_AD256_MASK) -/*! @} */ - -/*! @name SUB - SUB Command Register */ -/*! @{ */ - -#define CDOG_SUB_SB_MASK (0xFFFFFFFFU) -#define CDOG_SUB_SB_SHIFT (0U) -/*! SB - Subtract Write Value */ -#define CDOG_SUB_SB(x) (((uint32_t)(((uint32_t)(x)) << CDOG_SUB_SB_SHIFT)) & CDOG_SUB_SB_MASK) -/*! @} */ - -/*! @name SUB1 - SUB1 Command Register */ -/*! @{ */ - -#define CDOG_SUB1_SB1_MASK (0xFFFFFFFFU) -#define CDOG_SUB1_SB1_SHIFT (0U) -/*! SB1 - Subtract 1 */ -#define CDOG_SUB1_SB1(x) (((uint32_t)(((uint32_t)(x)) << CDOG_SUB1_SB1_SHIFT)) & CDOG_SUB1_SB1_MASK) -/*! @} */ - -/*! @name SUB16 - SUB16 Command Register */ -/*! @{ */ - -#define CDOG_SUB16_SB16_MASK (0xFFFFFFFFU) -#define CDOG_SUB16_SB16_SHIFT (0U) -/*! SB16 - Subtract 16 */ -#define CDOG_SUB16_SB16(x) (((uint32_t)(((uint32_t)(x)) << CDOG_SUB16_SB16_SHIFT)) & CDOG_SUB16_SB16_MASK) -/*! @} */ - -/*! @name SUB256 - SUB256 Command Register */ -/*! @{ */ - -#define CDOG_SUB256_SB256_MASK (0xFFFFFFFFU) -#define CDOG_SUB256_SB256_SHIFT (0U) -/*! SB256 - Subtract 256 */ -#define CDOG_SUB256_SB256(x) (((uint32_t)(((uint32_t)(x)) << CDOG_SUB256_SB256_SHIFT)) & CDOG_SUB256_SB256_MASK) -/*! @} */ - -/*! @name ASSERT16 - ASSERT16 Command Register */ -/*! @{ */ - -#define CDOG_ASSERT16_AST16_MASK (0xFFFFFFFFU) -#define CDOG_ASSERT16_AST16_SHIFT (0U) -/*! AST16 - ASSERT16 Command */ -#define CDOG_ASSERT16_AST16(x) (((uint32_t)(((uint32_t)(x)) << CDOG_ASSERT16_AST16_SHIFT)) & CDOG_ASSERT16_AST16_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group CDOG_Register_Masks */ - - -/* CDOG - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral CDOG0 base address */ - #define CDOG0_BASE (0x500BB000u) - /** Peripheral CDOG0 base address */ - #define CDOG0_BASE_NS (0x400BB000u) - /** Peripheral CDOG0 base pointer */ - #define CDOG0 ((CDOG_Type *)CDOG0_BASE) - /** Peripheral CDOG0 base pointer */ - #define CDOG0_NS ((CDOG_Type *)CDOG0_BASE_NS) - /** Peripheral CDOG1 base address */ - #define CDOG1_BASE (0x500BC000u) - /** Peripheral CDOG1 base address */ - #define CDOG1_BASE_NS (0x400BC000u) - /** Peripheral CDOG1 base pointer */ - #define CDOG1 ((CDOG_Type *)CDOG1_BASE) - /** Peripheral CDOG1 base pointer */ - #define CDOG1_NS ((CDOG_Type *)CDOG1_BASE_NS) - /** Array initializer of CDOG peripheral base addresses */ - #define CDOG_BASE_ADDRS { CDOG0_BASE, CDOG1_BASE } - /** Array initializer of CDOG peripheral base pointers */ - #define CDOG_BASE_PTRS { CDOG0, CDOG1 } - /** Array initializer of CDOG peripheral base addresses */ - #define CDOG_BASE_ADDRS_NS { CDOG0_BASE_NS, CDOG1_BASE_NS } - /** Array initializer of CDOG peripheral base pointers */ - #define CDOG_BASE_PTRS_NS { CDOG0_NS, CDOG1_NS } -#else - /** Peripheral CDOG0 base address */ - #define CDOG0_BASE (0x400BB000u) - /** Peripheral CDOG0 base pointer */ - #define CDOG0 ((CDOG_Type *)CDOG0_BASE) - /** Peripheral CDOG1 base address */ - #define CDOG1_BASE (0x400BC000u) - /** Peripheral CDOG1 base pointer */ - #define CDOG1 ((CDOG_Type *)CDOG1_BASE) - /** Array initializer of CDOG peripheral base addresses */ - #define CDOG_BASE_ADDRS { CDOG0_BASE, CDOG1_BASE } - /** Array initializer of CDOG peripheral base pointers */ - #define CDOG_BASE_PTRS { CDOG0, CDOG1 } -#endif -/** Interrupt vectors for the CDOG peripheral type */ -#define CDOG_IRQS { CDOG0_IRQn, CDOG1_IRQn } - -/*! - * @} - */ /* end of group CDOG_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- CMC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CMC_Peripheral_Access_Layer CMC Peripheral Access Layer - * @{ - */ - -/** CMC - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - uint8_t RESERVED_0[12]; - __IO uint32_t CKCTRL; /**< Clock Control, offset: 0x10 */ - __IO uint32_t CKSTAT; /**< Clock Status, offset: 0x14 */ - __IO uint32_t PMPROT; /**< Power Mode Protection, offset: 0x18 */ - __O uint32_t GPMCTRL; /**< Global Power Mode Control, offset: 0x1C */ - __IO uint32_t PMCTRL[2]; /**< Power Mode Control, array offset: 0x20, array step: 0x4 */ - uint8_t RESERVED_1[88]; - __I uint32_t SRS; /**< System Reset Status, offset: 0x80 */ - __IO uint32_t RPC; /**< Reset Pin Control, offset: 0x84 */ - __IO uint32_t SSRS; /**< Sticky System Reset Status, offset: 0x88 */ - __IO uint32_t SRIE; /**< System Reset Interrupt Enable, offset: 0x8C */ - __IO uint32_t SRIF; /**< System Reset Interrupt Flag, offset: 0x90 */ - uint8_t RESERVED_2[8]; - __I uint32_t RSTCNT; /**< Reset Count Register, offset: 0x9C */ - __IO uint32_t MR[1]; /**< Mode, array offset: 0xA0, array step: 0x4 */ - uint8_t RESERVED_3[12]; - __IO uint32_t FM[1]; /**< Force Mode, array offset: 0xB0, array step: 0x4 */ - uint8_t RESERVED_4[12]; - __IO uint32_t SRAMDIS[1]; /**< SRAM Disable, array offset: 0xC0, array step: 0x4 */ - uint8_t RESERVED_5[12]; - __IO uint32_t SRAMRET[1]; /**< SRAM Retention, array offset: 0xD0, array step: 0x4 */ - uint8_t RESERVED_6[12]; - __IO uint32_t FLASHCR; /**< Flash Control, offset: 0xE0 */ - uint8_t RESERVED_7[28]; - __IO uint32_t BSR; /**< BootROM Status Register, offset: 0x100 */ - uint8_t RESERVED_8[8]; - __IO uint32_t BLR; /**< BootROM Lock Register, offset: 0x10C */ - __IO uint32_t CORECTL; /**< Core Control, offset: 0x110 */ - uint8_t RESERVED_9[12]; - __IO uint32_t DBGCTL; /**< Debug Control, offset: 0x120 */ -} CMC_Type; - -/* ---------------------------------------------------------------------------- - -- CMC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CMC_Register_Masks CMC Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define CMC_VERID_FEATURE_MASK (0xFFFFU) -#define CMC_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number */ -#define CMC_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << CMC_VERID_FEATURE_SHIFT)) & CMC_VERID_FEATURE_MASK) - -#define CMC_VERID_MINOR_MASK (0xFF0000U) -#define CMC_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define CMC_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << CMC_VERID_MINOR_SHIFT)) & CMC_VERID_MINOR_MASK) - -#define CMC_VERID_MAJOR_MASK (0xFF000000U) -#define CMC_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define CMC_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << CMC_VERID_MAJOR_SHIFT)) & CMC_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name CKCTRL - Clock Control */ -/*! @{ */ - -#define CMC_CKCTRL_CKMODE_MASK (0xFU) -#define CMC_CKCTRL_CKMODE_SHIFT (0U) -/*! CKMODE - Clocking Mode - * 0b0000..No clock gating - * 0b0001..Core clock is gated - * 0b1111..Core, platform, and peripheral clocks are gated, and core enters Low-Power mode. - */ -#define CMC_CKCTRL_CKMODE(x) (((uint32_t)(((uint32_t)(x)) << CMC_CKCTRL_CKMODE_SHIFT)) & CMC_CKCTRL_CKMODE_MASK) - -#define CMC_CKCTRL_LOCK_MASK (0x80000000U) -#define CMC_CKCTRL_LOCK_SHIFT (31U) -/*! LOCK - Lock - * 0b0..Allowed - * 0b1..Blocked - */ -#define CMC_CKCTRL_LOCK(x) (((uint32_t)(((uint32_t)(x)) << CMC_CKCTRL_LOCK_SHIFT)) & CMC_CKCTRL_LOCK_MASK) -/*! @} */ - -/*! @name CKSTAT - Clock Status */ -/*! @{ */ - -#define CMC_CKSTAT_CKMODE_MASK (0xFU) -#define CMC_CKSTAT_CKMODE_SHIFT (0U) -/*! CKMODE - Low Power Status - * 0b0000..Core clock not gated - * 0b0001..Core clock was gated - * 0b1111..Core, platform, and peripheral clocks were gated, and power domain entered Low-Power mode - * *.. - */ -#define CMC_CKSTAT_CKMODE(x) (((uint32_t)(((uint32_t)(x)) << CMC_CKSTAT_CKMODE_SHIFT)) & CMC_CKSTAT_CKMODE_MASK) - -#define CMC_CKSTAT_WAKEUP_MASK (0xFF00U) -#define CMC_CKSTAT_WAKEUP_SHIFT (8U) -/*! WAKEUP - Wake-up Source */ -#define CMC_CKSTAT_WAKEUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_CKSTAT_WAKEUP_SHIFT)) & CMC_CKSTAT_WAKEUP_MASK) - -#define CMC_CKSTAT_VALID_MASK (0x80000000U) -#define CMC_CKSTAT_VALID_SHIFT (31U) -/*! VALID - Clock Status Valid - * 0b0..Core clock not gated - * 0b1..Core clock was gated due to Low-Power mode entry - */ -#define CMC_CKSTAT_VALID(x) (((uint32_t)(((uint32_t)(x)) << CMC_CKSTAT_VALID_SHIFT)) & CMC_CKSTAT_VALID_MASK) -/*! @} */ - -/*! @name PMPROT - Power Mode Protection */ -/*! @{ */ - -#define CMC_PMPROT_LPMODE_MASK (0xFU) -#define CMC_PMPROT_LPMODE_SHIFT (0U) -/*! LPMODE - Low-Power Mode - * 0b0000..Not allowed - * 0b0001..Allowed - * 0b0010..Allowed - * 0b0011..Allowed - * 0b0100..Allowed - * 0b0101..Allowed - * 0b0110..Allowed - * 0b0111..Allowed - * 0b1000..Allowed - * 0b1001..Allowed - * 0b1010..Allowed - * 0b1011..Allowed - * 0b1100..Allowed - * 0b1101..Allowed - * 0b1110..Allowed - * 0b1111..Allowed - */ -#define CMC_PMPROT_LPMODE(x) (((uint32_t)(((uint32_t)(x)) << CMC_PMPROT_LPMODE_SHIFT)) & CMC_PMPROT_LPMODE_MASK) - -#define CMC_PMPROT_LOCK_MASK (0x80000000U) -#define CMC_PMPROT_LOCK_SHIFT (31U) -/*! LOCK - Lock Register - * 0b0..Allowed - * 0b1..Blocked - */ -#define CMC_PMPROT_LOCK(x) (((uint32_t)(((uint32_t)(x)) << CMC_PMPROT_LOCK_SHIFT)) & CMC_PMPROT_LOCK_MASK) -/*! @} */ - -/*! @name GPMCTRL - Global Power Mode Control */ -/*! @{ */ - -#define CMC_GPMCTRL_LPMODE_MASK (0xFU) -#define CMC_GPMCTRL_LPMODE_SHIFT (0U) -/*! LPMODE - Low-Power Mode */ -#define CMC_GPMCTRL_LPMODE(x) (((uint32_t)(((uint32_t)(x)) << CMC_GPMCTRL_LPMODE_SHIFT)) & CMC_GPMCTRL_LPMODE_MASK) -/*! @} */ - -/*! @name PMCTRL - Power Mode Control */ -/*! @{ */ - -#define CMC_PMCTRL_LPMODE_MASK (0xFU) -#define CMC_PMCTRL_LPMODE_SHIFT (0U) -/*! LPMODE - Low-Power Mode - * 0b0000..Active/Sleep - * 0b0001..Deep Sleep - * 0b0011..Power Down - * 0b0111..Reserved - * 0b1111..Deep-Power Down - */ -#define CMC_PMCTRL_LPMODE(x) (((uint32_t)(((uint32_t)(x)) << CMC_PMCTRL_LPMODE_SHIFT)) & CMC_PMCTRL_LPMODE_MASK) -/*! @} */ - -/* The count of CMC_PMCTRL */ -#define CMC_PMCTRL_COUNT (2U) - -/*! @name SRS - System Reset Status */ -/*! @{ */ - -#define CMC_SRS_WAKEUP_MASK (0x1U) -#define CMC_SRS_WAKEUP_SHIFT (0U) -/*! WAKEUP - Wake-up Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_WAKEUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_WAKEUP_SHIFT)) & CMC_SRS_WAKEUP_MASK) - -#define CMC_SRS_POR_MASK (0x2U) -#define CMC_SRS_POR_SHIFT (1U) -/*! POR - Power-on Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_POR(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_POR_SHIFT)) & CMC_SRS_POR_MASK) - -#define CMC_SRS_VD_MASK (0x4U) -#define CMC_SRS_VD_SHIFT (2U) -/*! VD - Voltage Detect Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_VD(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_VD_SHIFT)) & CMC_SRS_VD_MASK) - -#define CMC_SRS_WARM_MASK (0x10U) -#define CMC_SRS_WARM_SHIFT (4U) -/*! WARM - Warm Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_WARM(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_WARM_SHIFT)) & CMC_SRS_WARM_MASK) - -#define CMC_SRS_FATAL_MASK (0x20U) -#define CMC_SRS_FATAL_SHIFT (5U) -/*! FATAL - Fatal Reset - * 0b0..Reset was not generated - * 0b1..Reset was generated - */ -#define CMC_SRS_FATAL(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_FATAL_SHIFT)) & CMC_SRS_FATAL_MASK) - -#define CMC_SRS_PIN_MASK (0x100U) -#define CMC_SRS_PIN_SHIFT (8U) -/*! PIN - Pin Reset - * 0b0..Reset was not generated - * 0b1..Reset was generated - */ -#define CMC_SRS_PIN(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_PIN_SHIFT)) & CMC_SRS_PIN_MASK) - -#define CMC_SRS_DAP_MASK (0x200U) -#define CMC_SRS_DAP_SHIFT (9U) -/*! DAP - Debug Access Port Reset - * 0b0..Reset was not generated - * 0b1..Reset was generated - */ -#define CMC_SRS_DAP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_DAP_SHIFT)) & CMC_SRS_DAP_MASK) - -#define CMC_SRS_RSTACK_MASK (0x400U) -#define CMC_SRS_RSTACK_SHIFT (10U) -/*! RSTACK - Reset Timeout - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_RSTACK(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_RSTACK_SHIFT)) & CMC_SRS_RSTACK_MASK) - -#define CMC_SRS_LPACK_MASK (0x800U) -#define CMC_SRS_LPACK_SHIFT (11U) -/*! LPACK - Low Power Acknowledge Timeout Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_LPACK(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_LPACK_SHIFT)) & CMC_SRS_LPACK_MASK) - -#define CMC_SRS_SCG_MASK (0x1000U) -#define CMC_SRS_SCG_SHIFT (12U) -/*! SCG - System Clock Generation Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SRS_SCG(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_SCG_SHIFT)) & CMC_SRS_SCG_MASK) - -#define CMC_SRS_WWDT0_MASK (0x2000U) -#define CMC_SRS_WWDT0_SHIFT (13U) -/*! WWDT0 - Windowed Watchdog 0 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SRS_WWDT0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_WWDT0_SHIFT)) & CMC_SRS_WWDT0_MASK) - -#define CMC_SRS_SW_MASK (0x4000U) -#define CMC_SRS_SW_SHIFT (14U) -/*! SW - Software Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_SW(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_SW_SHIFT)) & CMC_SRS_SW_MASK) - -#define CMC_SRS_LOCKUP_MASK (0x8000U) -#define CMC_SRS_LOCKUP_SHIFT (15U) -/*! LOCKUP - Lockup Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_LOCKUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_LOCKUP_SHIFT)) & CMC_SRS_LOCKUP_MASK) - -#define CMC_SRS_CPU1_MASK (0x10000U) -#define CMC_SRS_CPU1_SHIFT (16U) -/*! CPU1 - CPU1 System Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_CPU1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_CPU1_SHIFT)) & CMC_SRS_CPU1_MASK) - -#define CMC_SRS_VBAT_MASK (0x1000000U) -#define CMC_SRS_VBAT_SHIFT (24U) -/*! VBAT - VBAT System Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_VBAT(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_VBAT_SHIFT)) & CMC_SRS_VBAT_MASK) - -#define CMC_SRS_WWDT1_MASK (0x2000000U) -#define CMC_SRS_WWDT1_SHIFT (25U) -/*! WWDT1 - Windowed Watchdog 1 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SRS_WWDT1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_WWDT1_SHIFT)) & CMC_SRS_WWDT1_MASK) - -#define CMC_SRS_CDOG0_MASK (0x4000000U) -#define CMC_SRS_CDOG0_SHIFT (26U) -/*! CDOG0 - Code Watchdog 0 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SRS_CDOG0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_CDOG0_SHIFT)) & CMC_SRS_CDOG0_MASK) - -#define CMC_SRS_CDOG1_MASK (0x8000000U) -#define CMC_SRS_CDOG1_SHIFT (27U) -/*! CDOG1 - Code Watchdog 1 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SRS_CDOG1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_CDOG1_SHIFT)) & CMC_SRS_CDOG1_MASK) - -#define CMC_SRS_JTAG_MASK (0x10000000U) -#define CMC_SRS_JTAG_SHIFT (28U) -/*! JTAG - JTAG System Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_JTAG(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_JTAG_SHIFT)) & CMC_SRS_JTAG_MASK) - -#define CMC_SRS_SECVIO_MASK (0x40000000U) -#define CMC_SRS_SECVIO_SHIFT (30U) -/*! SECVIO - Security Violation Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_SECVIO(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_SECVIO_SHIFT)) & CMC_SRS_SECVIO_MASK) - -#define CMC_SRS_TAMPER_MASK (0x80000000U) -#define CMC_SRS_TAMPER_SHIFT (31U) -/*! TAMPER - Tamper Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SRS_TAMPER(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRS_TAMPER_SHIFT)) & CMC_SRS_TAMPER_MASK) -/*! @} */ - -/*! @name RPC - Reset Pin Control */ -/*! @{ */ - -#define CMC_RPC_FILTCFG_MASK (0x1FU) -#define CMC_RPC_FILTCFG_SHIFT (0U) -/*! FILTCFG - Reset Filter Configuration */ -#define CMC_RPC_FILTCFG(x) (((uint32_t)(((uint32_t)(x)) << CMC_RPC_FILTCFG_SHIFT)) & CMC_RPC_FILTCFG_MASK) - -#define CMC_RPC_FILTEN_MASK (0x100U) -#define CMC_RPC_FILTEN_SHIFT (8U) -/*! FILTEN - Filter Enable - * 0b0..Disables - * 0b1..Enables - */ -#define CMC_RPC_FILTEN(x) (((uint32_t)(((uint32_t)(x)) << CMC_RPC_FILTEN_SHIFT)) & CMC_RPC_FILTEN_MASK) - -#define CMC_RPC_LPFEN_MASK (0x200U) -#define CMC_RPC_LPFEN_SHIFT (9U) -/*! LPFEN - Low-Power Filter Enable - * 0b0..Disables - * 0b1..Enables - */ -#define CMC_RPC_LPFEN(x) (((uint32_t)(((uint32_t)(x)) << CMC_RPC_LPFEN_SHIFT)) & CMC_RPC_LPFEN_MASK) -/*! @} */ - -/*! @name SSRS - Sticky System Reset Status */ -/*! @{ */ - -#define CMC_SSRS_WAKEUP_MASK (0x1U) -#define CMC_SSRS_WAKEUP_SHIFT (0U) -/*! WAKEUP - Wake-up Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_WAKEUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_WAKEUP_SHIFT)) & CMC_SSRS_WAKEUP_MASK) - -#define CMC_SSRS_POR_MASK (0x2U) -#define CMC_SSRS_POR_SHIFT (1U) -/*! POR - Power-on Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_POR(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_POR_SHIFT)) & CMC_SSRS_POR_MASK) - -#define CMC_SSRS_VD_MASK (0x4U) -#define CMC_SSRS_VD_SHIFT (2U) -/*! VD - Voltage Detect Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_VD(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_VD_SHIFT)) & CMC_SSRS_VD_MASK) - -#define CMC_SSRS_WARM_MASK (0x10U) -#define CMC_SSRS_WARM_SHIFT (4U) -/*! WARM - Warm Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_WARM(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_WARM_SHIFT)) & CMC_SSRS_WARM_MASK) - -#define CMC_SSRS_FATAL_MASK (0x20U) -#define CMC_SSRS_FATAL_SHIFT (5U) -/*! FATAL - Fatal Reset - * 0b0..Reset was not generated - * 0b1..Reset was generated - */ -#define CMC_SSRS_FATAL(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_FATAL_SHIFT)) & CMC_SSRS_FATAL_MASK) - -#define CMC_SSRS_PIN_MASK (0x100U) -#define CMC_SSRS_PIN_SHIFT (8U) -/*! PIN - Pin Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_PIN(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_PIN_SHIFT)) & CMC_SSRS_PIN_MASK) - -#define CMC_SSRS_DAP_MASK (0x200U) -#define CMC_SSRS_DAP_SHIFT (9U) -/*! DAP - DAP Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_DAP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_DAP_SHIFT)) & CMC_SSRS_DAP_MASK) - -#define CMC_SSRS_RSTACK_MASK (0x400U) -#define CMC_SSRS_RSTACK_SHIFT (10U) -/*! RSTACK - Reset Timeout - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_RSTACK(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_RSTACK_SHIFT)) & CMC_SSRS_RSTACK_MASK) - -#define CMC_SSRS_LPACK_MASK (0x800U) -#define CMC_SSRS_LPACK_SHIFT (11U) -/*! LPACK - Low Power Acknowledge Timeout Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_LPACK(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_LPACK_SHIFT)) & CMC_SSRS_LPACK_MASK) - -#define CMC_SSRS_SCG_MASK (0x1000U) -#define CMC_SSRS_SCG_SHIFT (12U) -/*! SCG - System Clock Generation Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SSRS_SCG(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_SCG_SHIFT)) & CMC_SSRS_SCG_MASK) - -#define CMC_SSRS_WWDT0_MASK (0x2000U) -#define CMC_SSRS_WWDT0_SHIFT (13U) -/*! WWDT0 - Windowed Watchdog 0 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SSRS_WWDT0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_WWDT0_SHIFT)) & CMC_SSRS_WWDT0_MASK) - -#define CMC_SSRS_SW_MASK (0x4000U) -#define CMC_SSRS_SW_SHIFT (14U) -/*! SW - Software Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_SW(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_SW_SHIFT)) & CMC_SSRS_SW_MASK) - -#define CMC_SSRS_LOCKUP_MASK (0x8000U) -#define CMC_SSRS_LOCKUP_SHIFT (15U) -/*! LOCKUP - Lockup Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_LOCKUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_LOCKUP_SHIFT)) & CMC_SSRS_LOCKUP_MASK) - -#define CMC_SSRS_CPU1_MASK (0x10000U) -#define CMC_SSRS_CPU1_SHIFT (16U) -/*! CPU1 - CPU1 Reset - * 0b0..Reset not generated from CPU1 reset source. - * 0b1..Reset generated from CPU1 reset source. - */ -#define CMC_SSRS_CPU1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_CPU1_SHIFT)) & CMC_SSRS_CPU1_MASK) - -#define CMC_SSRS_VBAT_MASK (0x1000000U) -#define CMC_SSRS_VBAT_SHIFT (24U) -/*! VBAT - VBAT System Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_VBAT(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_VBAT_SHIFT)) & CMC_SSRS_VBAT_MASK) - -#define CMC_SSRS_WWDT1_MASK (0x2000000U) -#define CMC_SSRS_WWDT1_SHIFT (25U) -/*! WWDT1 - Windowed Watchdog 1 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SSRS_WWDT1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_WWDT1_SHIFT)) & CMC_SSRS_WWDT1_MASK) - -#define CMC_SSRS_CDOG0_MASK (0x4000000U) -#define CMC_SSRS_CDOG0_SHIFT (26U) -/*! CDOG0 - Code Watchdog 0 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SSRS_CDOG0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_CDOG0_SHIFT)) & CMC_SSRS_CDOG0_MASK) - -#define CMC_SSRS_CDOG1_MASK (0x8000000U) -#define CMC_SSRS_CDOG1_SHIFT (27U) -/*! CDOG1 - Code Watchdog 1 Reset - * 0b0..Reset is not generated - * 0b1..Reset is generated - */ -#define CMC_SSRS_CDOG1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_CDOG1_SHIFT)) & CMC_SSRS_CDOG1_MASK) - -#define CMC_SSRS_JTAG_MASK (0x10000000U) -#define CMC_SSRS_JTAG_SHIFT (28U) -/*! JTAG - JTAG System Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_JTAG(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_JTAG_SHIFT)) & CMC_SSRS_JTAG_MASK) - -#define CMC_SSRS_SECVIO_MASK (0x40000000U) -#define CMC_SSRS_SECVIO_SHIFT (30U) -/*! SECVIO - Security Violation Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_SECVIO(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_SECVIO_SHIFT)) & CMC_SSRS_SECVIO_MASK) - -#define CMC_SSRS_TAMPER_MASK (0x80000000U) -#define CMC_SSRS_TAMPER_SHIFT (31U) -/*! TAMPER - Tamper Reset - * 0b0..Reset not generated - * 0b1..Reset generated - */ -#define CMC_SSRS_TAMPER(x) (((uint32_t)(((uint32_t)(x)) << CMC_SSRS_TAMPER_SHIFT)) & CMC_SSRS_TAMPER_MASK) -/*! @} */ - -/*! @name SRIE - System Reset Interrupt Enable */ -/*! @{ */ - -#define CMC_SRIE_PIN_MASK (0x100U) -#define CMC_SRIE_PIN_SHIFT (8U) -/*! PIN - Pin Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_PIN(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_PIN_SHIFT)) & CMC_SRIE_PIN_MASK) - -#define CMC_SRIE_DAP_MASK (0x200U) -#define CMC_SRIE_DAP_SHIFT (9U) -/*! DAP - DAP Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_DAP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_DAP_SHIFT)) & CMC_SRIE_DAP_MASK) - -#define CMC_SRIE_LPACK_MASK (0x800U) -#define CMC_SRIE_LPACK_SHIFT (11U) -/*! LPACK - Low Power Acknowledge Timeout Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_LPACK(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_LPACK_SHIFT)) & CMC_SRIE_LPACK_MASK) - -#define CMC_SRIE_SCG_MASK (0x1000U) -#define CMC_SRIE_SCG_SHIFT (12U) -/*! SCG - System Clock Generation Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_SCG(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_SCG_SHIFT)) & CMC_SRIE_SCG_MASK) - -#define CMC_SRIE_WWDT0_MASK (0x2000U) -#define CMC_SRIE_WWDT0_SHIFT (13U) -/*! WWDT0 - Windowed Watchdog 0 Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_WWDT0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_WWDT0_SHIFT)) & CMC_SRIE_WWDT0_MASK) - -#define CMC_SRIE_SW_MASK (0x4000U) -#define CMC_SRIE_SW_SHIFT (14U) -/*! SW - Software Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_SW(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_SW_SHIFT)) & CMC_SRIE_SW_MASK) - -#define CMC_SRIE_LOCKUP_MASK (0x8000U) -#define CMC_SRIE_LOCKUP_SHIFT (15U) -/*! LOCKUP - Lockup Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_LOCKUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_LOCKUP_SHIFT)) & CMC_SRIE_LOCKUP_MASK) - -#define CMC_SRIE_CPU1_MASK (0x10000U) -#define CMC_SRIE_CPU1_SHIFT (16U) -/*! CPU1 - CPU1 Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_CPU1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_CPU1_SHIFT)) & CMC_SRIE_CPU1_MASK) - -#define CMC_SRIE_VBAT_MASK (0x1000000U) -#define CMC_SRIE_VBAT_SHIFT (24U) -/*! VBAT - VBAT System Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_VBAT(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_VBAT_SHIFT)) & CMC_SRIE_VBAT_MASK) - -#define CMC_SRIE_WWDT1_MASK (0x2000000U) -#define CMC_SRIE_WWDT1_SHIFT (25U) -/*! WWDT1 - Windowed Watchdog 1 Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_WWDT1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_WWDT1_SHIFT)) & CMC_SRIE_WWDT1_MASK) - -#define CMC_SRIE_CDOG0_MASK (0x4000000U) -#define CMC_SRIE_CDOG0_SHIFT (26U) -/*! CDOG0 - Code Watchdog 0 Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_CDOG0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_CDOG0_SHIFT)) & CMC_SRIE_CDOG0_MASK) - -#define CMC_SRIE_CDOG1_MASK (0x8000000U) -#define CMC_SRIE_CDOG1_SHIFT (27U) -/*! CDOG1 - Code Watchdog 1 Reset - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define CMC_SRIE_CDOG1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIE_CDOG1_SHIFT)) & CMC_SRIE_CDOG1_MASK) -/*! @} */ - -/*! @name SRIF - System Reset Interrupt Flag */ -/*! @{ */ - -#define CMC_SRIF_PIN_MASK (0x100U) -#define CMC_SRIF_PIN_SHIFT (8U) -/*! PIN - Pin Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_PIN(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_PIN_SHIFT)) & CMC_SRIF_PIN_MASK) - -#define CMC_SRIF_DAP_MASK (0x200U) -#define CMC_SRIF_DAP_SHIFT (9U) -/*! DAP - DAP Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_DAP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_DAP_SHIFT)) & CMC_SRIF_DAP_MASK) - -#define CMC_SRIF_LPACK_MASK (0x800U) -#define CMC_SRIF_LPACK_SHIFT (11U) -/*! LPACK - Low Power Acknowledge Timeout Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_LPACK(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_LPACK_SHIFT)) & CMC_SRIF_LPACK_MASK) - -#define CMC_SRIF_WWDT0_MASK (0x2000U) -#define CMC_SRIF_WWDT0_SHIFT (13U) -/*! WWDT0 - Windowed Watchdog 0 Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_WWDT0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_WWDT0_SHIFT)) & CMC_SRIF_WWDT0_MASK) - -#define CMC_SRIF_SW_MASK (0x4000U) -#define CMC_SRIF_SW_SHIFT (14U) -/*! SW - Software Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_SW(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_SW_SHIFT)) & CMC_SRIF_SW_MASK) - -#define CMC_SRIF_LOCKUP_MASK (0x8000U) -#define CMC_SRIF_LOCKUP_SHIFT (15U) -/*! LOCKUP - Lockup Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_LOCKUP(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_LOCKUP_SHIFT)) & CMC_SRIF_LOCKUP_MASK) - -#define CMC_SRIF_CPU1_MASK (0x10000U) -#define CMC_SRIF_CPU1_SHIFT (16U) -/*! CPU1 - CPU1 Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_CPU1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_CPU1_SHIFT)) & CMC_SRIF_CPU1_MASK) - -#define CMC_SRIF_VBAT_MASK (0x1000000U) -#define CMC_SRIF_VBAT_SHIFT (24U) -/*! VBAT - VBAT System Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_VBAT(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_VBAT_SHIFT)) & CMC_SRIF_VBAT_MASK) - -#define CMC_SRIF_WWDT1_MASK (0x2000000U) -#define CMC_SRIF_WWDT1_SHIFT (25U) -/*! WWDT1 - Windowed Watchdog 1 Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_WWDT1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_WWDT1_SHIFT)) & CMC_SRIF_WWDT1_MASK) - -#define CMC_SRIF_CDOG0_MASK (0x4000000U) -#define CMC_SRIF_CDOG0_SHIFT (26U) -/*! CDOG0 - Code Watchdog 0 Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_CDOG0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_CDOG0_SHIFT)) & CMC_SRIF_CDOG0_MASK) - -#define CMC_SRIF_CDOG1_MASK (0x8000000U) -#define CMC_SRIF_CDOG1_SHIFT (27U) -/*! CDOG1 - Code Watchdog 1 Reset - * 0b0..Reset source not pending - * 0b1..Reset source pending - */ -#define CMC_SRIF_CDOG1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRIF_CDOG1_SHIFT)) & CMC_SRIF_CDOG1_MASK) -/*! @} */ - -/*! @name RSTCNT - Reset Count Register */ -/*! @{ */ - -#define CMC_RSTCNT_COUNT_MASK (0xFFU) -#define CMC_RSTCNT_COUNT_SHIFT (0U) -/*! COUNT - Count */ -#define CMC_RSTCNT_COUNT(x) (((uint32_t)(((uint32_t)(x)) << CMC_RSTCNT_COUNT_SHIFT)) & CMC_RSTCNT_COUNT_MASK) -/*! @} */ - -/*! @name MR - Mode */ -/*! @{ */ - -#define CMC_MR_ISPMODE_n_MASK (0x1U) -#define CMC_MR_ISPMODE_n_SHIFT (0U) -/*! ISPMODE_n - In System Programming Mode */ -#define CMC_MR_ISPMODE_n(x) (((uint32_t)(((uint32_t)(x)) << CMC_MR_ISPMODE_n_SHIFT)) & CMC_MR_ISPMODE_n_MASK) -/*! @} */ - -/* The count of CMC_MR */ -#define CMC_MR_COUNT (1U) - -/*! @name FM - Force Mode */ -/*! @{ */ - -#define CMC_FM_FORCECFG_MASK (0x1U) -#define CMC_FM_FORCECFG_SHIFT (0U) -/*! FORCECFG - Boot Configuration - * 0b0..No effect - * 0b1..Asserts - */ -#define CMC_FM_FORCECFG(x) (((uint32_t)(((uint32_t)(x)) << CMC_FM_FORCECFG_SHIFT)) & CMC_FM_FORCECFG_MASK) -/*! @} */ - -/* The count of CMC_FM */ -#define CMC_FM_COUNT (1U) - -/*! @name SRAMDIS - SRAM Disable */ -/*! @{ */ - -#define CMC_SRAMDIS_DIS0_MASK (0x1U) -#define CMC_SRAMDIS_DIS0_SHIFT (0U) -/*! DIS0 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS0_SHIFT)) & CMC_SRAMDIS_DIS0_MASK) - -#define CMC_SRAMDIS_DIS1_MASK (0x2U) -#define CMC_SRAMDIS_DIS1_SHIFT (1U) -/*! DIS1 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS1_SHIFT)) & CMC_SRAMDIS_DIS1_MASK) - -#define CMC_SRAMDIS_DIS2_MASK (0x4U) -#define CMC_SRAMDIS_DIS2_SHIFT (2U) -/*! DIS2 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS2(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS2_SHIFT)) & CMC_SRAMDIS_DIS2_MASK) - -#define CMC_SRAMDIS_DIS3_MASK (0x8U) -#define CMC_SRAMDIS_DIS3_SHIFT (3U) -/*! DIS3 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS3(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS3_SHIFT)) & CMC_SRAMDIS_DIS3_MASK) - -#define CMC_SRAMDIS_DIS4_MASK (0x10U) -#define CMC_SRAMDIS_DIS4_SHIFT (4U) -/*! DIS4 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS4(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS4_SHIFT)) & CMC_SRAMDIS_DIS4_MASK) - -#define CMC_SRAMDIS_DIS5_MASK (0x20U) -#define CMC_SRAMDIS_DIS5_SHIFT (5U) -/*! DIS5 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS5(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS5_SHIFT)) & CMC_SRAMDIS_DIS5_MASK) - -#define CMC_SRAMDIS_DIS6_MASK (0x40U) -#define CMC_SRAMDIS_DIS6_SHIFT (6U) -/*! DIS6 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS6(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS6_SHIFT)) & CMC_SRAMDIS_DIS6_MASK) - -#define CMC_SRAMDIS_DIS7_MASK (0x80U) -#define CMC_SRAMDIS_DIS7_SHIFT (7U) -/*! DIS7 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS7(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS7_SHIFT)) & CMC_SRAMDIS_DIS7_MASK) - -#define CMC_SRAMDIS_DIS8_MASK (0x100U) -#define CMC_SRAMDIS_DIS8_SHIFT (8U) -/*! DIS8 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS8(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS8_SHIFT)) & CMC_SRAMDIS_DIS8_MASK) - -#define CMC_SRAMDIS_DIS9_MASK (0x200U) -#define CMC_SRAMDIS_DIS9_SHIFT (9U) -/*! DIS9 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS9(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS9_SHIFT)) & CMC_SRAMDIS_DIS9_MASK) - -#define CMC_SRAMDIS_DIS10_MASK (0x400U) -#define CMC_SRAMDIS_DIS10_SHIFT (10U) -/*! DIS10 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS10(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS10_SHIFT)) & CMC_SRAMDIS_DIS10_MASK) - -#define CMC_SRAMDIS_DIS11_MASK (0x800U) -#define CMC_SRAMDIS_DIS11_SHIFT (11U) -/*! DIS11 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS11(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS11_SHIFT)) & CMC_SRAMDIS_DIS11_MASK) - -#define CMC_SRAMDIS_DIS12_MASK (0x1000U) -#define CMC_SRAMDIS_DIS12_SHIFT (12U) -/*! DIS12 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS12(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS12_SHIFT)) & CMC_SRAMDIS_DIS12_MASK) - -#define CMC_SRAMDIS_DIS13_MASK (0x2000U) -#define CMC_SRAMDIS_DIS13_SHIFT (13U) -/*! DIS13 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS13(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS13_SHIFT)) & CMC_SRAMDIS_DIS13_MASK) - -#define CMC_SRAMDIS_DIS14_MASK (0x4000U) -#define CMC_SRAMDIS_DIS14_SHIFT (14U) -/*! DIS14 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS14(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS14_SHIFT)) & CMC_SRAMDIS_DIS14_MASK) - -#define CMC_SRAMDIS_DIS15_MASK (0x8000U) -#define CMC_SRAMDIS_DIS15_SHIFT (15U) -/*! DIS15 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS15(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS15_SHIFT)) & CMC_SRAMDIS_DIS15_MASK) - -#define CMC_SRAMDIS_DIS16_MASK (0x10000U) -#define CMC_SRAMDIS_DIS16_SHIFT (16U) -/*! DIS16 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS16(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS16_SHIFT)) & CMC_SRAMDIS_DIS16_MASK) - -#define CMC_SRAMDIS_DIS17_MASK (0x20000U) -#define CMC_SRAMDIS_DIS17_SHIFT (17U) -/*! DIS17 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS17(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS17_SHIFT)) & CMC_SRAMDIS_DIS17_MASK) - -#define CMC_SRAMDIS_DIS18_MASK (0x40000U) -#define CMC_SRAMDIS_DIS18_SHIFT (18U) -/*! DIS18 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS18(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS18_SHIFT)) & CMC_SRAMDIS_DIS18_MASK) - -#define CMC_SRAMDIS_DIS19_MASK (0x80000U) -#define CMC_SRAMDIS_DIS19_SHIFT (19U) -/*! DIS19 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS19(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS19_SHIFT)) & CMC_SRAMDIS_DIS19_MASK) - -#define CMC_SRAMDIS_DIS20_MASK (0x100000U) -#define CMC_SRAMDIS_DIS20_SHIFT (20U) -/*! DIS20 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS20(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS20_SHIFT)) & CMC_SRAMDIS_DIS20_MASK) - -#define CMC_SRAMDIS_DIS21_MASK (0x200000U) -#define CMC_SRAMDIS_DIS21_SHIFT (21U) -/*! DIS21 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS21(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS21_SHIFT)) & CMC_SRAMDIS_DIS21_MASK) - -#define CMC_SRAMDIS_DIS22_MASK (0x400000U) -#define CMC_SRAMDIS_DIS22_SHIFT (22U) -/*! DIS22 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS22(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS22_SHIFT)) & CMC_SRAMDIS_DIS22_MASK) - -#define CMC_SRAMDIS_DIS23_MASK (0x800000U) -#define CMC_SRAMDIS_DIS23_SHIFT (23U) -/*! DIS23 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS23(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS23_SHIFT)) & CMC_SRAMDIS_DIS23_MASK) - -#define CMC_SRAMDIS_DIS24_MASK (0x1000000U) -#define CMC_SRAMDIS_DIS24_SHIFT (24U) -/*! DIS24 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS24(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS24_SHIFT)) & CMC_SRAMDIS_DIS24_MASK) - -#define CMC_SRAMDIS_DIS25_MASK (0x2000000U) -#define CMC_SRAMDIS_DIS25_SHIFT (25U) -/*! DIS25 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS25(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS25_SHIFT)) & CMC_SRAMDIS_DIS25_MASK) - -#define CMC_SRAMDIS_DIS26_MASK (0x4000000U) -#define CMC_SRAMDIS_DIS26_SHIFT (26U) -/*! DIS26 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS26(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS26_SHIFT)) & CMC_SRAMDIS_DIS26_MASK) - -#define CMC_SRAMDIS_DIS27_MASK (0x8000000U) -#define CMC_SRAMDIS_DIS27_SHIFT (27U) -/*! DIS27 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS27(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS27_SHIFT)) & CMC_SRAMDIS_DIS27_MASK) - -#define CMC_SRAMDIS_DIS28_MASK (0x10000000U) -#define CMC_SRAMDIS_DIS28_SHIFT (28U) -/*! DIS28 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS28(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS28_SHIFT)) & CMC_SRAMDIS_DIS28_MASK) - -#define CMC_SRAMDIS_DIS29_MASK (0x20000000U) -#define CMC_SRAMDIS_DIS29_SHIFT (29U) -/*! DIS29 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS29(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS29_SHIFT)) & CMC_SRAMDIS_DIS29_MASK) - -#define CMC_SRAMDIS_DIS30_MASK (0x40000000U) -#define CMC_SRAMDIS_DIS30_SHIFT (30U) -/*! DIS30 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS30(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS30_SHIFT)) & CMC_SRAMDIS_DIS30_MASK) - -#define CMC_SRAMDIS_DIS31_MASK (0x80000000U) -#define CMC_SRAMDIS_DIS31_SHIFT (31U) -/*! DIS31 - SRAM Disable - * 0b0..Enables - * 0b1..Disables - */ -#define CMC_SRAMDIS_DIS31(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS31_SHIFT)) & CMC_SRAMDIS_DIS31_MASK) -/*! @} */ - -/* The count of CMC_SRAMDIS */ -#define CMC_SRAMDIS_COUNT (1U) - -/*! @name SRAMRET - SRAM Retention */ -/*! @{ */ - -#define CMC_SRAMRET_RET0_MASK (0x1U) -#define CMC_SRAMRET_RET0_SHIFT (0U) -/*! RET0 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET0(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET0_SHIFT)) & CMC_SRAMRET_RET0_MASK) - -#define CMC_SRAMRET_RET1_MASK (0x2U) -#define CMC_SRAMRET_RET1_SHIFT (1U) -/*! RET1 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET1(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET1_SHIFT)) & CMC_SRAMRET_RET1_MASK) - -#define CMC_SRAMRET_RET2_MASK (0x4U) -#define CMC_SRAMRET_RET2_SHIFT (2U) -/*! RET2 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET2(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET2_SHIFT)) & CMC_SRAMRET_RET2_MASK) - -#define CMC_SRAMRET_RET3_MASK (0x8U) -#define CMC_SRAMRET_RET3_SHIFT (3U) -/*! RET3 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET3(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET3_SHIFT)) & CMC_SRAMRET_RET3_MASK) - -#define CMC_SRAMRET_RET4_MASK (0x10U) -#define CMC_SRAMRET_RET4_SHIFT (4U) -/*! RET4 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET4(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET4_SHIFT)) & CMC_SRAMRET_RET4_MASK) - -#define CMC_SRAMRET_RET5_MASK (0x20U) -#define CMC_SRAMRET_RET5_SHIFT (5U) -/*! RET5 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET5(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET5_SHIFT)) & CMC_SRAMRET_RET5_MASK) - -#define CMC_SRAMRET_RET6_MASK (0x40U) -#define CMC_SRAMRET_RET6_SHIFT (6U) -/*! RET6 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET6(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET6_SHIFT)) & CMC_SRAMRET_RET6_MASK) - -#define CMC_SRAMRET_RET7_MASK (0x80U) -#define CMC_SRAMRET_RET7_SHIFT (7U) -/*! RET7 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET7(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET7_SHIFT)) & CMC_SRAMRET_RET7_MASK) - -#define CMC_SRAMRET_RET8_MASK (0x100U) -#define CMC_SRAMRET_RET8_SHIFT (8U) -/*! RET8 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET8(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET8_SHIFT)) & CMC_SRAMRET_RET8_MASK) - -#define CMC_SRAMRET_RET9_MASK (0x200U) -#define CMC_SRAMRET_RET9_SHIFT (9U) -/*! RET9 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET9(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET9_SHIFT)) & CMC_SRAMRET_RET9_MASK) - -#define CMC_SRAMRET_RET10_MASK (0x400U) -#define CMC_SRAMRET_RET10_SHIFT (10U) -/*! RET10 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET10(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET10_SHIFT)) & CMC_SRAMRET_RET10_MASK) - -#define CMC_SRAMRET_RET11_MASK (0x800U) -#define CMC_SRAMRET_RET11_SHIFT (11U) -/*! RET11 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET11(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET11_SHIFT)) & CMC_SRAMRET_RET11_MASK) - -#define CMC_SRAMRET_RET12_MASK (0x1000U) -#define CMC_SRAMRET_RET12_SHIFT (12U) -/*! RET12 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET12(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET12_SHIFT)) & CMC_SRAMRET_RET12_MASK) - -#define CMC_SRAMRET_RET13_MASK (0x2000U) -#define CMC_SRAMRET_RET13_SHIFT (13U) -/*! RET13 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET13(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET13_SHIFT)) & CMC_SRAMRET_RET13_MASK) - -#define CMC_SRAMRET_RET14_MASK (0x4000U) -#define CMC_SRAMRET_RET14_SHIFT (14U) -/*! RET14 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET14(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET14_SHIFT)) & CMC_SRAMRET_RET14_MASK) - -#define CMC_SRAMRET_RET15_MASK (0x8000U) -#define CMC_SRAMRET_RET15_SHIFT (15U) -/*! RET15 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET15(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET15_SHIFT)) & CMC_SRAMRET_RET15_MASK) - -#define CMC_SRAMRET_RET16_MASK (0x10000U) -#define CMC_SRAMRET_RET16_SHIFT (16U) -/*! RET16 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET16(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET16_SHIFT)) & CMC_SRAMRET_RET16_MASK) - -#define CMC_SRAMRET_RET17_MASK (0x20000U) -#define CMC_SRAMRET_RET17_SHIFT (17U) -/*! RET17 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET17(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET17_SHIFT)) & CMC_SRAMRET_RET17_MASK) - -#define CMC_SRAMRET_RET18_MASK (0x40000U) -#define CMC_SRAMRET_RET18_SHIFT (18U) -/*! RET18 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET18(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET18_SHIFT)) & CMC_SRAMRET_RET18_MASK) - -#define CMC_SRAMRET_RET19_MASK (0x80000U) -#define CMC_SRAMRET_RET19_SHIFT (19U) -/*! RET19 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET19(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET19_SHIFT)) & CMC_SRAMRET_RET19_MASK) - -#define CMC_SRAMRET_RET20_MASK (0x100000U) -#define CMC_SRAMRET_RET20_SHIFT (20U) -/*! RET20 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET20(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET20_SHIFT)) & CMC_SRAMRET_RET20_MASK) - -#define CMC_SRAMRET_RET21_MASK (0x200000U) -#define CMC_SRAMRET_RET21_SHIFT (21U) -/*! RET21 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET21(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET21_SHIFT)) & CMC_SRAMRET_RET21_MASK) - -#define CMC_SRAMRET_RET22_MASK (0x400000U) -#define CMC_SRAMRET_RET22_SHIFT (22U) -/*! RET22 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET22(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET22_SHIFT)) & CMC_SRAMRET_RET22_MASK) - -#define CMC_SRAMRET_RET23_MASK (0x800000U) -#define CMC_SRAMRET_RET23_SHIFT (23U) -/*! RET23 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET23(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET23_SHIFT)) & CMC_SRAMRET_RET23_MASK) - -#define CMC_SRAMRET_RET24_MASK (0x1000000U) -#define CMC_SRAMRET_RET24_SHIFT (24U) -/*! RET24 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET24(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET24_SHIFT)) & CMC_SRAMRET_RET24_MASK) - -#define CMC_SRAMRET_RET25_MASK (0x2000000U) -#define CMC_SRAMRET_RET25_SHIFT (25U) -/*! RET25 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET25(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET25_SHIFT)) & CMC_SRAMRET_RET25_MASK) - -#define CMC_SRAMRET_RET26_MASK (0x4000000U) -#define CMC_SRAMRET_RET26_SHIFT (26U) -/*! RET26 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET26(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET26_SHIFT)) & CMC_SRAMRET_RET26_MASK) - -#define CMC_SRAMRET_RET27_MASK (0x8000000U) -#define CMC_SRAMRET_RET27_SHIFT (27U) -/*! RET27 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET27(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET27_SHIFT)) & CMC_SRAMRET_RET27_MASK) - -#define CMC_SRAMRET_RET28_MASK (0x10000000U) -#define CMC_SRAMRET_RET28_SHIFT (28U) -/*! RET28 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET28(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET28_SHIFT)) & CMC_SRAMRET_RET28_MASK) - -#define CMC_SRAMRET_RET29_MASK (0x20000000U) -#define CMC_SRAMRET_RET29_SHIFT (29U) -/*! RET29 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET29(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET29_SHIFT)) & CMC_SRAMRET_RET29_MASK) - -#define CMC_SRAMRET_RET30_MASK (0x40000000U) -#define CMC_SRAMRET_RET30_SHIFT (30U) -/*! RET30 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET30(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET30_SHIFT)) & CMC_SRAMRET_RET30_MASK) - -#define CMC_SRAMRET_RET31_MASK (0x80000000U) -#define CMC_SRAMRET_RET31_SHIFT (31U) -/*! RET31 - SRAM Retention - * 0b0..Retains - * 0b1..Powers off - */ -#define CMC_SRAMRET_RET31(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET31_SHIFT)) & CMC_SRAMRET_RET31_MASK) -/*! @} */ - -/* The count of CMC_SRAMRET */ -#define CMC_SRAMRET_COUNT (1U) - -/*! @name FLASHCR - Flash Control */ -/*! @{ */ - -#define CMC_FLASHCR_FLASHDIS_MASK (0x1U) -#define CMC_FLASHCR_FLASHDIS_SHIFT (0U) -/*! FLASHDIS - Flash Disable - * 0b0..No effect - * 0b1..Flash memory is disabled - */ -#define CMC_FLASHCR_FLASHDIS(x) (((uint32_t)(((uint32_t)(x)) << CMC_FLASHCR_FLASHDIS_SHIFT)) & CMC_FLASHCR_FLASHDIS_MASK) - -#define CMC_FLASHCR_FLASHDOZE_MASK (0x2U) -#define CMC_FLASHCR_FLASHDOZE_SHIFT (1U) -/*! FLASHDOZE - Flash Doze - * 0b0..No effect - * 0b1..Flash memory is disabled when core is sleeping (CKMODE > 0) - */ -#define CMC_FLASHCR_FLASHDOZE(x) (((uint32_t)(((uint32_t)(x)) << CMC_FLASHCR_FLASHDOZE_SHIFT)) & CMC_FLASHCR_FLASHDOZE_MASK) -/*! @} */ - -/*! @name BSR - BootROM Status Register */ -/*! @{ */ - -#define CMC_BSR_STAT_MASK (0xFFFFFFFFU) -#define CMC_BSR_STAT_SHIFT (0U) -/*! STAT - Provides status information written by the BootROM. */ -#define CMC_BSR_STAT(x) (((uint32_t)(((uint32_t)(x)) << CMC_BSR_STAT_SHIFT)) & CMC_BSR_STAT_MASK) -/*! @} */ - -/*! @name BLR - BootROM Lock Register */ -/*! @{ */ - -#define CMC_BLR_LOCK_MASK (0x7U) -#define CMC_BLR_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b010..BootROM Status and Lock Registers can be written - * 0b101..BootROM Status and Lock Registers cannot be written - */ -#define CMC_BLR_LOCK(x) (((uint32_t)(((uint32_t)(x)) << CMC_BLR_LOCK_SHIFT)) & CMC_BLR_LOCK_MASK) -/*! @} */ - -/*! @name CORECTL - Core Control */ -/*! @{ */ - -#define CMC_CORECTL_NPIE_MASK (0x1U) -#define CMC_CORECTL_NPIE_SHIFT (0U) -/*! NPIE - Non-maskable Pin Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define CMC_CORECTL_NPIE(x) (((uint32_t)(((uint32_t)(x)) << CMC_CORECTL_NPIE_SHIFT)) & CMC_CORECTL_NPIE_MASK) -/*! @} */ - -/*! @name DBGCTL - Debug Control */ -/*! @{ */ - -#define CMC_DBGCTL_SOD_MASK (0x1U) -#define CMC_DBGCTL_SOD_SHIFT (0U) -/*! SOD - Sleep Or Debug - * 0b0..Remains enabled - * 0b1..Disabled - */ -#define CMC_DBGCTL_SOD(x) (((uint32_t)(((uint32_t)(x)) << CMC_DBGCTL_SOD_SHIFT)) & CMC_DBGCTL_SOD_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group CMC_Register_Masks */ - - -/* CMC - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral CMC0 base address */ - #define CMC0_BASE (0x50048000u) - /** Peripheral CMC0 base address */ - #define CMC0_BASE_NS (0x40048000u) - /** Peripheral CMC0 base pointer */ - #define CMC0 ((CMC_Type *)CMC0_BASE) - /** Peripheral CMC0 base pointer */ - #define CMC0_NS ((CMC_Type *)CMC0_BASE_NS) - /** Array initializer of CMC peripheral base addresses */ - #define CMC_BASE_ADDRS { CMC0_BASE } - /** Array initializer of CMC peripheral base pointers */ - #define CMC_BASE_PTRS { CMC0 } - /** Array initializer of CMC peripheral base addresses */ - #define CMC_BASE_ADDRS_NS { CMC0_BASE_NS } - /** Array initializer of CMC peripheral base pointers */ - #define CMC_BASE_PTRS_NS { CMC0_NS } -#else - /** Peripheral CMC0 base address */ - #define CMC0_BASE (0x40048000u) - /** Peripheral CMC0 base pointer */ - #define CMC0 ((CMC_Type *)CMC0_BASE) - /** Array initializer of CMC peripheral base addresses */ - #define CMC_BASE_ADDRS { CMC0_BASE } - /** Array initializer of CMC peripheral base pointers */ - #define CMC_BASE_PTRS { CMC0 } -#endif -/* Backward compatibility for CMC */ -#define CMC_SRAMDIS_DIS_MASK (0xFFFFFFFFU) -#define CMC_SRAMDIS_DIS_SHIFT (0U) -/*! DIS - SRAM Disable */ -#define CMC_SRAMDIS_DIS(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMDIS_DIS_SHIFT)) & CMC_SRAMDIS_DIS_MASK) - -#define CMC_SRAMRET_RET_MASK (0xFFFFFFFFU) -#define CMC_SRAMRET_RET_SHIFT (0U) -/*! RET - SRAM Retention */ -#define CMC_SRAMRET_RET(x) (((uint32_t)(((uint32_t)(x)) << CMC_SRAMRET_RET_SHIFT)) & CMC_SRAMRET_RET_MASK) - - -/*! - * @} - */ /* end of group CMC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- CRC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CRC_Peripheral_Access_Layer CRC Peripheral Access Layer - * @{ - */ - -/** CRC - Register Layout Typedef */ -typedef struct { - union { /* offset: 0x0 */ - struct { /* offset: 0x0 */ - __IO uint8_t DATALL; /**< CRC_DATALL register, offset: 0x0 */ - __IO uint8_t DATALU; /**< CRC_DATALU register, offset: 0x1 */ - __IO uint8_t DATAHL; /**< CRC_DATAHL register, offset: 0x2 */ - __IO uint8_t DATAHU; /**< CRC_DATAHU register, offset: 0x3 */ - } ACCESS8BIT; - struct { /* offset: 0x0 */ - __IO uint16_t DATAL; /**< CRC_DATAL register, offset: 0x0 */ - __IO uint16_t DATAH; /**< CRC_DATAH register, offset: 0x2 */ - } ACCESS16BIT; - __IO uint32_t DATA; /**< Data, offset: 0x0 */ - }; - union { /* offset: 0x4 */ - struct { /* offset: 0x4 */ - __IO uint8_t GPOLYLL; /**< CRC_GPOLYLL register, offset: 0x4 */ - __IO uint8_t GPOLYLU; /**< CRC_GPOLYLU register, offset: 0x5 */ - __IO uint8_t GPOLYHL; /**< CRC_GPOLYHL register, offset: 0x6 */ - __IO uint8_t GPOLYHU; /**< CRC_GPOLYHU register, offset: 0x7 */ - } GPOLY_ACCESS8BIT; - struct { /* offset: 0x4 */ - __IO uint16_t GPOLYL; /**< CRC_GPOLYL register, offset: 0x4 */ - __IO uint16_t GPOLYH; /**< CRC_GPOLYH register, offset: 0x6 */ - } GPOLY_ACCESS16BIT; - __IO uint32_t GPOLY; /**< Polynomial, offset: 0x4 */ - }; - union { /* offset: 0x8 */ - struct { /* offset: 0x8 */ - uint8_t RESERVED_0[3]; - __IO uint8_t CTRLHU; /**< CRC_CTRLHU register, offset: 0xB */ - } CTRL_ACCESS8BIT; - __IO uint32_t CTRL; /**< Control, offset: 0x8 */ - }; -} CRC_Type; - -/* ---------------------------------------------------------------------------- - -- CRC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CRC_Register_Masks CRC Register Masks - * @{ - */ - -/*! @name DATALL - CRC_DATALL register */ -/*! @{ */ - -#define CRC_DATALL_DATALL_MASK (0xFFU) -#define CRC_DATALL_DATALL_SHIFT (0U) -#define CRC_DATALL_DATALL(x) (((uint8_t)(((uint8_t)(x)) << CRC_DATALL_DATALL_SHIFT)) & CRC_DATALL_DATALL_MASK) -/*! @} */ - -/*! @name DATALU - CRC_DATALU register */ -/*! @{ */ - -#define CRC_DATALU_DATALU_MASK (0xFFU) -#define CRC_DATALU_DATALU_SHIFT (0U) -#define CRC_DATALU_DATALU(x) (((uint8_t)(((uint8_t)(x)) << CRC_DATALU_DATALU_SHIFT)) & CRC_DATALU_DATALU_MASK) -/*! @} */ - -/*! @name DATAHL - CRC_DATAHL register */ -/*! @{ */ - -#define CRC_DATAHL_DATAHL_MASK (0xFFU) -#define CRC_DATAHL_DATAHL_SHIFT (0U) -#define CRC_DATAHL_DATAHL(x) (((uint8_t)(((uint8_t)(x)) << CRC_DATAHL_DATAHL_SHIFT)) & CRC_DATAHL_DATAHL_MASK) -/*! @} */ - -/*! @name DATAHU - CRC_DATAHU register */ -/*! @{ */ - -#define CRC_DATAHU_DATAHU_MASK (0xFFU) -#define CRC_DATAHU_DATAHU_SHIFT (0U) -#define CRC_DATAHU_DATAHU(x) (((uint8_t)(((uint8_t)(x)) << CRC_DATAHU_DATAHU_SHIFT)) & CRC_DATAHU_DATAHU_MASK) -/*! @} */ - -/*! @name DATAL - CRC_DATAL register */ -/*! @{ */ - -#define CRC_DATAL_DATAL_MASK (0xFFFFU) -#define CRC_DATAL_DATAL_SHIFT (0U) -#define CRC_DATAL_DATAL(x) (((uint16_t)(((uint16_t)(x)) << CRC_DATAL_DATAL_SHIFT)) & CRC_DATAL_DATAL_MASK) -/*! @} */ - -/*! @name DATAH - CRC_DATAH register */ -/*! @{ */ - -#define CRC_DATAH_DATAH_MASK (0xFFFFU) -#define CRC_DATAH_DATAH_SHIFT (0U) -#define CRC_DATAH_DATAH(x) (((uint16_t)(((uint16_t)(x)) << CRC_DATAH_DATAH_SHIFT)) & CRC_DATAH_DATAH_MASK) -/*! @} */ - -/*! @name DATA - Data */ -/*! @{ */ - -#define CRC_DATA_LL_MASK (0xFFU) -#define CRC_DATA_LL_SHIFT (0U) -/*! LL - Lower Part of Low Byte */ -#define CRC_DATA_LL(x) (((uint32_t)(((uint32_t)(x)) << CRC_DATA_LL_SHIFT)) & CRC_DATA_LL_MASK) - -#define CRC_DATA_LU_MASK (0xFF00U) -#define CRC_DATA_LU_SHIFT (8U) -/*! LU - Upper Part of Low Byte */ -#define CRC_DATA_LU(x) (((uint32_t)(((uint32_t)(x)) << CRC_DATA_LU_SHIFT)) & CRC_DATA_LU_MASK) - -#define CRC_DATA_HL_MASK (0xFF0000U) -#define CRC_DATA_HL_SHIFT (16U) -/*! HL - Lower Part of High Byte */ -#define CRC_DATA_HL(x) (((uint32_t)(((uint32_t)(x)) << CRC_DATA_HL_SHIFT)) & CRC_DATA_HL_MASK) - -#define CRC_DATA_HU_MASK (0xFF000000U) -#define CRC_DATA_HU_SHIFT (24U) -/*! HU - Upper Part of High Byte */ -#define CRC_DATA_HU(x) (((uint32_t)(((uint32_t)(x)) << CRC_DATA_HU_SHIFT)) & CRC_DATA_HU_MASK) -/*! @} */ - -/*! @name GPOLYLL - CRC_GPOLYLL register */ -/*! @{ */ - -#define CRC_GPOLYLL_GPOLYLL_MASK (0xFFU) -#define CRC_GPOLYLL_GPOLYLL_SHIFT (0U) -#define CRC_GPOLYLL_GPOLYLL(x) (((uint8_t)(((uint8_t)(x)) << CRC_GPOLYLL_GPOLYLL_SHIFT)) & CRC_GPOLYLL_GPOLYLL_MASK) -/*! @} */ - -/*! @name GPOLYLU - CRC_GPOLYLU register */ -/*! @{ */ - -#define CRC_GPOLYLU_GPOLYLU_MASK (0xFFU) -#define CRC_GPOLYLU_GPOLYLU_SHIFT (0U) -#define CRC_GPOLYLU_GPOLYLU(x) (((uint8_t)(((uint8_t)(x)) << CRC_GPOLYLU_GPOLYLU_SHIFT)) & CRC_GPOLYLU_GPOLYLU_MASK) -/*! @} */ - -/*! @name GPOLYHL - CRC_GPOLYHL register */ -/*! @{ */ - -#define CRC_GPOLYHL_GPOLYHL_MASK (0xFFU) -#define CRC_GPOLYHL_GPOLYHL_SHIFT (0U) -#define CRC_GPOLYHL_GPOLYHL(x) (((uint8_t)(((uint8_t)(x)) << CRC_GPOLYHL_GPOLYHL_SHIFT)) & CRC_GPOLYHL_GPOLYHL_MASK) -/*! @} */ - -/*! @name GPOLYHU - CRC_GPOLYHU register */ -/*! @{ */ - -#define CRC_GPOLYHU_GPOLYHU_MASK (0xFFU) -#define CRC_GPOLYHU_GPOLYHU_SHIFT (0U) -#define CRC_GPOLYHU_GPOLYHU(x) (((uint8_t)(((uint8_t)(x)) << CRC_GPOLYHU_GPOLYHU_SHIFT)) & CRC_GPOLYHU_GPOLYHU_MASK) -/*! @} */ - -/*! @name GPOLYL - CRC_GPOLYL register */ -/*! @{ */ - -#define CRC_GPOLYL_GPOLYL_MASK (0xFFFFU) -#define CRC_GPOLYL_GPOLYL_SHIFT (0U) -#define CRC_GPOLYL_GPOLYL(x) (((uint16_t)(((uint16_t)(x)) << CRC_GPOLYL_GPOLYL_SHIFT)) & CRC_GPOLYL_GPOLYL_MASK) -/*! @} */ - -/*! @name GPOLYH - CRC_GPOLYH register */ -/*! @{ */ - -#define CRC_GPOLYH_GPOLYH_MASK (0xFFFFU) -#define CRC_GPOLYH_GPOLYH_SHIFT (0U) -#define CRC_GPOLYH_GPOLYH(x) (((uint16_t)(((uint16_t)(x)) << CRC_GPOLYH_GPOLYH_SHIFT)) & CRC_GPOLYH_GPOLYH_MASK) -/*! @} */ - -/*! @name GPOLY - Polynomial */ -/*! @{ */ - -#define CRC_GPOLY_LOW_MASK (0xFFFFU) -#define CRC_GPOLY_LOW_SHIFT (0U) -/*! LOW - Low Half-Word */ -#define CRC_GPOLY_LOW(x) (((uint32_t)(((uint32_t)(x)) << CRC_GPOLY_LOW_SHIFT)) & CRC_GPOLY_LOW_MASK) - -#define CRC_GPOLY_HIGH_MASK (0xFFFF0000U) -#define CRC_GPOLY_HIGH_SHIFT (16U) -/*! HIGH - High Half-Word */ -#define CRC_GPOLY_HIGH(x) (((uint32_t)(((uint32_t)(x)) << CRC_GPOLY_HIGH_SHIFT)) & CRC_GPOLY_HIGH_MASK) -/*! @} */ - -/*! @name CTRLHU - CRC_CTRLHU register */ -/*! @{ */ - -#define CRC_CTRLHU_TCRC_MASK (0x1U) -#define CRC_CTRLHU_TCRC_SHIFT (0U) -/*! TCRC - TCRC - * 0b0..16 bits - * 0b1..32 bits - */ -#define CRC_CTRLHU_TCRC(x) (((uint8_t)(((uint8_t)(x)) << CRC_CTRLHU_TCRC_SHIFT)) & CRC_CTRLHU_TCRC_MASK) - -#define CRC_CTRLHU_WAS_MASK (0x2U) -#define CRC_CTRLHU_WAS_SHIFT (1U) -/*! WAS - Write as Seed - * 0b0..Data values - * 0b1..Seed values - */ -#define CRC_CTRLHU_WAS(x) (((uint8_t)(((uint8_t)(x)) << CRC_CTRLHU_WAS_SHIFT)) & CRC_CTRLHU_WAS_MASK) - -#define CRC_CTRLHU_FXOR_MASK (0x4U) -#define CRC_CTRLHU_FXOR_SHIFT (2U) -/*! FXOR - Complement Read of CRC Data Register - * 0b0..Disables XOR on reading data. - * 0b1..Inverts or complements the read value of the CRC Data. - */ -#define CRC_CTRLHU_FXOR(x) (((uint8_t)(((uint8_t)(x)) << CRC_CTRLHU_FXOR_SHIFT)) & CRC_CTRLHU_FXOR_MASK) - -#define CRC_CTRLHU_TOTR_MASK (0x30U) -#define CRC_CTRLHU_TOTR_SHIFT (4U) -/*! TOTR - Transpose Type for Read - * 0b00..No transposition - * 0b01..Bits in bytes are transposed, but bytes are not transposed. - * 0b10..Both bits in bytes and bytes are transposed. - * 0b11..Only bytes are transposed, no bits in a byte are transposed. - */ -#define CRC_CTRLHU_TOTR(x) (((uint8_t)(((uint8_t)(x)) << CRC_CTRLHU_TOTR_SHIFT)) & CRC_CTRLHU_TOTR_MASK) - -#define CRC_CTRLHU_TOT_MASK (0xC0U) -#define CRC_CTRLHU_TOT_SHIFT (6U) -/*! TOT - Transpose Type for Write - * 0b00..No transposition - * 0b01..Bits in bytes are transposed, but bytes are not transposed. - * 0b10..Both bits in bytes and bytes are transposed. - * 0b11..Only bytes are transposed, no bits in a byte are transposed. - */ -#define CRC_CTRLHU_TOT(x) (((uint8_t)(((uint8_t)(x)) << CRC_CTRLHU_TOT_SHIFT)) & CRC_CTRLHU_TOT_MASK) -/*! @} */ - -/*! @name CTRL - Control */ -/*! @{ */ - -#define CRC_CTRL_TCRC_MASK (0x1000000U) -#define CRC_CTRL_TCRC_SHIFT (24U) -/*! TCRC - TCRC - * 0b0..16 bits - * 0b1..32 bits - */ -#define CRC_CTRL_TCRC(x) (((uint32_t)(((uint32_t)(x)) << CRC_CTRL_TCRC_SHIFT)) & CRC_CTRL_TCRC_MASK) - -#define CRC_CTRL_WAS_MASK (0x2000000U) -#define CRC_CTRL_WAS_SHIFT (25U) -/*! WAS - Write as Seed - * 0b0..Data values - * 0b1..Seed values - */ -#define CRC_CTRL_WAS(x) (((uint32_t)(((uint32_t)(x)) << CRC_CTRL_WAS_SHIFT)) & CRC_CTRL_WAS_MASK) - -#define CRC_CTRL_FXOR_MASK (0x4000000U) -#define CRC_CTRL_FXOR_SHIFT (26U) -/*! FXOR - Complement Read of CRC Data Register - * 0b0..Disables XOR on reading data. - * 0b1..Inverts or complements the read value of the CRC Data. - */ -#define CRC_CTRL_FXOR(x) (((uint32_t)(((uint32_t)(x)) << CRC_CTRL_FXOR_SHIFT)) & CRC_CTRL_FXOR_MASK) - -#define CRC_CTRL_TOTR_MASK (0x30000000U) -#define CRC_CTRL_TOTR_SHIFT (28U) -/*! TOTR - Transpose Type for Read - * 0b00..No transposition - * 0b01..Bits in bytes are transposed, but bytes are not transposed. - * 0b10..Both bits in bytes and bytes are transposed. - * 0b11..Only bytes are transposed, no bits in a byte are transposed. - */ -#define CRC_CTRL_TOTR(x) (((uint32_t)(((uint32_t)(x)) << CRC_CTRL_TOTR_SHIFT)) & CRC_CTRL_TOTR_MASK) - -#define CRC_CTRL_TOT_MASK (0xC0000000U) -#define CRC_CTRL_TOT_SHIFT (30U) -/*! TOT - Transpose Type for Write - * 0b00..No transposition - * 0b01..Bits in bytes are transposed, but bytes are not transposed. - * 0b10..Both bits in bytes and bytes are transposed. - * 0b11..Only bytes are transposed, no bits in a byte are transposed. - */ -#define CRC_CTRL_TOT(x) (((uint32_t)(((uint32_t)(x)) << CRC_CTRL_TOT_SHIFT)) & CRC_CTRL_TOT_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group CRC_Register_Masks */ - - -/* CRC - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral CRC0 base address */ - #define CRC0_BASE (0x500CB000u) - /** Peripheral CRC0 base address */ - #define CRC0_BASE_NS (0x400CB000u) - /** Peripheral CRC0 base pointer */ - #define CRC0 ((CRC_Type *)CRC0_BASE) - /** Peripheral CRC0 base pointer */ - #define CRC0_NS ((CRC_Type *)CRC0_BASE_NS) - /** Array initializer of CRC peripheral base addresses */ - #define CRC_BASE_ADDRS { CRC0_BASE } - /** Array initializer of CRC peripheral base pointers */ - #define CRC_BASE_PTRS { CRC0 } - /** Array initializer of CRC peripheral base addresses */ - #define CRC_BASE_ADDRS_NS { CRC0_BASE_NS } - /** Array initializer of CRC peripheral base pointers */ - #define CRC_BASE_PTRS_NS { CRC0_NS } -#else - /** Peripheral CRC0 base address */ - #define CRC0_BASE (0x400CB000u) - /** Peripheral CRC0 base pointer */ - #define CRC0 ((CRC_Type *)CRC0_BASE) - /** Array initializer of CRC peripheral base addresses */ - #define CRC_BASE_ADDRS { CRC0_BASE } - /** Array initializer of CRC peripheral base pointers */ - #define CRC_BASE_PTRS { CRC0 } -#endif - -/*! - * @} - */ /* end of group CRC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- CTIMER Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CTIMER_Peripheral_Access_Layer CTIMER Peripheral Access Layer - * @{ - */ - -/** CTIMER - Register Layout Typedef */ -typedef struct { - __IO uint32_t IR; /**< Interrupt, offset: 0x0 */ - __IO uint32_t TCR; /**< Timer Control, offset: 0x4 */ - __IO uint32_t TC; /**< Timer Counter, offset: 0x8 */ - __IO uint32_t PR; /**< Prescale, offset: 0xC */ - __IO uint32_t PC; /**< Prescale Counter, offset: 0x10 */ - __IO uint32_t MCR; /**< Match Control, offset: 0x14 */ - __IO uint32_t MR[4]; /**< Match, array offset: 0x18, array step: 0x4 */ - __IO uint32_t CCR; /**< Capture Control, offset: 0x28 */ - __I uint32_t CR[4]; /**< Capture, array offset: 0x2C, array step: 0x4 */ - __IO uint32_t EMR; /**< External Match, offset: 0x3C */ - uint8_t RESERVED_0[48]; - __IO uint32_t CTCR; /**< Count Control, offset: 0x70 */ - __IO uint32_t PWMC; /**< PWM Control, offset: 0x74 */ - __IO uint32_t MSR[4]; /**< Match Shadow, array offset: 0x78, array step: 0x4 */ -} CTIMER_Type; - -/* ---------------------------------------------------------------------------- - -- CTIMER Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup CTIMER_Register_Masks CTIMER Register Masks - * @{ - */ - -/*! @name IR - Interrupt */ -/*! @{ */ - -#define CTIMER_IR_MR0INT_MASK (0x1U) -#define CTIMER_IR_MR0INT_SHIFT (0U) -/*! MR0INT - Interrupt Flag for Match Channel 0 Event */ -#define CTIMER_IR_MR0INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_MR0INT_SHIFT)) & CTIMER_IR_MR0INT_MASK) - -#define CTIMER_IR_MR1INT_MASK (0x2U) -#define CTIMER_IR_MR1INT_SHIFT (1U) -/*! MR1INT - Interrupt Flag for Match Channel 1 Event */ -#define CTIMER_IR_MR1INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_MR1INT_SHIFT)) & CTIMER_IR_MR1INT_MASK) - -#define CTIMER_IR_MR2INT_MASK (0x4U) -#define CTIMER_IR_MR2INT_SHIFT (2U) -/*! MR2INT - Interrupt Flag for Match Channel 2 Event */ -#define CTIMER_IR_MR2INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_MR2INT_SHIFT)) & CTIMER_IR_MR2INT_MASK) - -#define CTIMER_IR_MR3INT_MASK (0x8U) -#define CTIMER_IR_MR3INT_SHIFT (3U) -/*! MR3INT - Interrupt Flag for Match Channel 3 Event */ -#define CTIMER_IR_MR3INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_MR3INT_SHIFT)) & CTIMER_IR_MR3INT_MASK) - -#define CTIMER_IR_CR0INT_MASK (0x10U) -#define CTIMER_IR_CR0INT_SHIFT (4U) -/*! CR0INT - Interrupt Flag for Capture Channel 0 Event */ -#define CTIMER_IR_CR0INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_CR0INT_SHIFT)) & CTIMER_IR_CR0INT_MASK) - -#define CTIMER_IR_CR1INT_MASK (0x20U) -#define CTIMER_IR_CR1INT_SHIFT (5U) -/*! CR1INT - Interrupt Flag for Capture Channel 1 Event */ -#define CTIMER_IR_CR1INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_CR1INT_SHIFT)) & CTIMER_IR_CR1INT_MASK) - -#define CTIMER_IR_CR2INT_MASK (0x40U) -#define CTIMER_IR_CR2INT_SHIFT (6U) -/*! CR2INT - Interrupt Flag for Capture Channel 2 Event */ -#define CTIMER_IR_CR2INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_CR2INT_SHIFT)) & CTIMER_IR_CR2INT_MASK) - -#define CTIMER_IR_CR3INT_MASK (0x80U) -#define CTIMER_IR_CR3INT_SHIFT (7U) -/*! CR3INT - Interrupt Flag for Capture Channel 3 Event */ -#define CTIMER_IR_CR3INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_CR3INT_SHIFT)) & CTIMER_IR_CR3INT_MASK) -/*! @} */ - -/*! @name TCR - Timer Control */ -/*! @{ */ - -#define CTIMER_TCR_CEN_MASK (0x1U) -#define CTIMER_TCR_CEN_SHIFT (0U) -/*! CEN - Counter Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_TCR_CEN(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TCR_CEN_SHIFT)) & CTIMER_TCR_CEN_MASK) - -#define CTIMER_TCR_CRST_MASK (0x2U) -#define CTIMER_TCR_CRST_SHIFT (1U) -/*! CRST - Counter Reset Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_TCR_CRST(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TCR_CRST_SHIFT)) & CTIMER_TCR_CRST_MASK) - -#define CTIMER_TCR_AGCEN_MASK (0x10U) -#define CTIMER_TCR_AGCEN_SHIFT (4U) -/*! AGCEN - Allow Global Count Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_TCR_AGCEN(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TCR_AGCEN_SHIFT)) & CTIMER_TCR_AGCEN_MASK) - -#define CTIMER_TCR_ATCEN_MASK (0x20U) -#define CTIMER_TCR_ATCEN_SHIFT (5U) -/*! ATCEN - Allow Trigger Count Enable - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_TCR_ATCEN(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TCR_ATCEN_SHIFT)) & CTIMER_TCR_ATCEN_MASK) -/*! @} */ - -/*! @name TC - Timer Counter */ -/*! @{ */ - -#define CTIMER_TC_TCVAL_MASK (0xFFFFFFFFU) -#define CTIMER_TC_TCVAL_SHIFT (0U) -/*! TCVAL - Timer Counter Value */ -#define CTIMER_TC_TCVAL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TC_TCVAL_SHIFT)) & CTIMER_TC_TCVAL_MASK) -/*! @} */ - -/*! @name PR - Prescale */ -/*! @{ */ - -#define CTIMER_PR_PRVAL_MASK (0xFFFFFFFFU) -#define CTIMER_PR_PRVAL_SHIFT (0U) -/*! PRVAL - Prescale Reload Value */ -#define CTIMER_PR_PRVAL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PR_PRVAL_SHIFT)) & CTIMER_PR_PRVAL_MASK) -/*! @} */ - -/*! @name PC - Prescale Counter */ -/*! @{ */ - -#define CTIMER_PC_PCVAL_MASK (0xFFFFFFFFU) -#define CTIMER_PC_PCVAL_SHIFT (0U) -/*! PCVAL - Prescale Counter Value */ -#define CTIMER_PC_PCVAL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PC_PCVAL_SHIFT)) & CTIMER_PC_PCVAL_MASK) -/*! @} */ - -/*! @name MCR - Match Control */ -/*! @{ */ - -#define CTIMER_MCR_MR0I_MASK (0x1U) -#define CTIMER_MCR_MR0I_SHIFT (0U) -/*! MR0I - Interrupt on MR0 - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_MCR_MR0I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR0I_SHIFT)) & CTIMER_MCR_MR0I_MASK) - -#define CTIMER_MCR_MR0R_MASK (0x2U) -#define CTIMER_MCR_MR0R_SHIFT (1U) -/*! MR0R - Reset on MR0 - * 0b0..Does not reset - * 0b1..Resets - */ -#define CTIMER_MCR_MR0R(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR0R_SHIFT)) & CTIMER_MCR_MR0R_MASK) - -#define CTIMER_MCR_MR0S_MASK (0x4U) -#define CTIMER_MCR_MR0S_SHIFT (2U) -/*! MR0S - Stop on MR0 - * 0b0..Does not stop - * 0b1..Stops - */ -#define CTIMER_MCR_MR0S(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR0S_SHIFT)) & CTIMER_MCR_MR0S_MASK) - -#define CTIMER_MCR_MR1I_MASK (0x8U) -#define CTIMER_MCR_MR1I_SHIFT (3U) -/*! MR1I - Interrupt on MR1 - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_MCR_MR1I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR1I_SHIFT)) & CTIMER_MCR_MR1I_MASK) - -#define CTIMER_MCR_MR1R_MASK (0x10U) -#define CTIMER_MCR_MR1R_SHIFT (4U) -/*! MR1R - Reset on MR1 - * 0b0..Does not reset - * 0b1..Resets - */ -#define CTIMER_MCR_MR1R(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR1R_SHIFT)) & CTIMER_MCR_MR1R_MASK) - -#define CTIMER_MCR_MR1S_MASK (0x20U) -#define CTIMER_MCR_MR1S_SHIFT (5U) -/*! MR1S - Stop on MR1 - * 0b0..Does not stop - * 0b1..Stops - */ -#define CTIMER_MCR_MR1S(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR1S_SHIFT)) & CTIMER_MCR_MR1S_MASK) - -#define CTIMER_MCR_MR2I_MASK (0x40U) -#define CTIMER_MCR_MR2I_SHIFT (6U) -/*! MR2I - Interrupt on MR2 - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_MCR_MR2I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR2I_SHIFT)) & CTIMER_MCR_MR2I_MASK) - -#define CTIMER_MCR_MR2R_MASK (0x80U) -#define CTIMER_MCR_MR2R_SHIFT (7U) -/*! MR2R - Reset on MR2 - * 0b0..Does not reset - * 0b1..Resets - */ -#define CTIMER_MCR_MR2R(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR2R_SHIFT)) & CTIMER_MCR_MR2R_MASK) - -#define CTIMER_MCR_MR2S_MASK (0x100U) -#define CTIMER_MCR_MR2S_SHIFT (8U) -/*! MR2S - Stop on MR2 - * 0b0..Does not stop - * 0b1..Stops - */ -#define CTIMER_MCR_MR2S(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR2S_SHIFT)) & CTIMER_MCR_MR2S_MASK) - -#define CTIMER_MCR_MR3I_MASK (0x200U) -#define CTIMER_MCR_MR3I_SHIFT (9U) -/*! MR3I - Interrupt on MR3 - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_MCR_MR3I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR3I_SHIFT)) & CTIMER_MCR_MR3I_MASK) - -#define CTIMER_MCR_MR3R_MASK (0x400U) -#define CTIMER_MCR_MR3R_SHIFT (10U) -/*! MR3R - Reset on MR3 - * 0b0..Does not reset - * 0b1..Resets - */ -#define CTIMER_MCR_MR3R(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR3R_SHIFT)) & CTIMER_MCR_MR3R_MASK) - -#define CTIMER_MCR_MR3S_MASK (0x800U) -#define CTIMER_MCR_MR3S_SHIFT (11U) -/*! MR3S - Stop on MR3 - * 0b0..Does not stop - * 0b1..Stops - */ -#define CTIMER_MCR_MR3S(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR3S_SHIFT)) & CTIMER_MCR_MR3S_MASK) - -#define CTIMER_MCR_MR0RL_MASK (0x1000000U) -#define CTIMER_MCR_MR0RL_SHIFT (24U) -/*! MR0RL - Reload MR - * 0b0..Does not reload - * 0b1..Reloads - */ -#define CTIMER_MCR_MR0RL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR0RL_SHIFT)) & CTIMER_MCR_MR0RL_MASK) - -#define CTIMER_MCR_MR1RL_MASK (0x2000000U) -#define CTIMER_MCR_MR1RL_SHIFT (25U) -/*! MR1RL - Reload MR - * 0b0..Does not reload - * 0b1..Reloads - */ -#define CTIMER_MCR_MR1RL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR1RL_SHIFT)) & CTIMER_MCR_MR1RL_MASK) - -#define CTIMER_MCR_MR2RL_MASK (0x4000000U) -#define CTIMER_MCR_MR2RL_SHIFT (26U) -/*! MR2RL - Reload MR - * 0b0..Does not reload - * 0b1..Reloads - */ -#define CTIMER_MCR_MR2RL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR2RL_SHIFT)) & CTIMER_MCR_MR2RL_MASK) - -#define CTIMER_MCR_MR3RL_MASK (0x8000000U) -#define CTIMER_MCR_MR3RL_SHIFT (27U) -/*! MR3RL - Reload MR - * 0b0..Does not reload - * 0b1..Reloads - */ -#define CTIMER_MCR_MR3RL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR3RL_SHIFT)) & CTIMER_MCR_MR3RL_MASK) -/*! @} */ - -/*! @name MR - Match */ -/*! @{ */ - -#define CTIMER_MR_MATCH_MASK (0xFFFFFFFFU) -#define CTIMER_MR_MATCH_SHIFT (0U) -/*! MATCH - Timer Counter Match Value */ -#define CTIMER_MR_MATCH(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MR_MATCH_SHIFT)) & CTIMER_MR_MATCH_MASK) -/*! @} */ - -/* The count of CTIMER_MR */ -#define CTIMER_MR_COUNT (4U) - -/*! @name CCR - Capture Control */ -/*! @{ */ - -#define CTIMER_CCR_CAP0RE_MASK (0x1U) -#define CTIMER_CCR_CAP0RE_SHIFT (0U) -/*! CAP0RE - Rising Edge of Capture Channel 0 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP0RE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP0RE_SHIFT)) & CTIMER_CCR_CAP0RE_MASK) - -#define CTIMER_CCR_CAP0FE_MASK (0x2U) -#define CTIMER_CCR_CAP0FE_SHIFT (1U) -/*! CAP0FE - Falling Edge of Capture Channel 0 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP0FE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP0FE_SHIFT)) & CTIMER_CCR_CAP0FE_MASK) - -#define CTIMER_CCR_CAP0I_MASK (0x4U) -#define CTIMER_CCR_CAP0I_SHIFT (2U) -/*! CAP0I - Generate Interrupt on Channel 0 Capture Event - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_CCR_CAP0I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP0I_SHIFT)) & CTIMER_CCR_CAP0I_MASK) - -#define CTIMER_CCR_CAP1RE_MASK (0x8U) -#define CTIMER_CCR_CAP1RE_SHIFT (3U) -/*! CAP1RE - Rising Edge of Capture Channel 1 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP1RE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP1RE_SHIFT)) & CTIMER_CCR_CAP1RE_MASK) - -#define CTIMER_CCR_CAP1FE_MASK (0x10U) -#define CTIMER_CCR_CAP1FE_SHIFT (4U) -/*! CAP1FE - Falling Edge of Capture Channel 1 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP1FE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP1FE_SHIFT)) & CTIMER_CCR_CAP1FE_MASK) - -#define CTIMER_CCR_CAP1I_MASK (0x20U) -#define CTIMER_CCR_CAP1I_SHIFT (5U) -/*! CAP1I - Generate Interrupt on Channel 1 Capture Event - * 0b0..Does not generates - * 0b1..Generates - */ -#define CTIMER_CCR_CAP1I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP1I_SHIFT)) & CTIMER_CCR_CAP1I_MASK) - -#define CTIMER_CCR_CAP2RE_MASK (0x40U) -#define CTIMER_CCR_CAP2RE_SHIFT (6U) -/*! CAP2RE - Rising Edge of Capture Channel 2 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP2RE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP2RE_SHIFT)) & CTIMER_CCR_CAP2RE_MASK) - -#define CTIMER_CCR_CAP2FE_MASK (0x80U) -#define CTIMER_CCR_CAP2FE_SHIFT (7U) -/*! CAP2FE - Falling Edge of Capture Channel 2 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP2FE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP2FE_SHIFT)) & CTIMER_CCR_CAP2FE_MASK) - -#define CTIMER_CCR_CAP2I_MASK (0x100U) -#define CTIMER_CCR_CAP2I_SHIFT (8U) -/*! CAP2I - Generate Interrupt on Channel 2 Capture Event - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_CCR_CAP2I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP2I_SHIFT)) & CTIMER_CCR_CAP2I_MASK) - -#define CTIMER_CCR_CAP3RE_MASK (0x200U) -#define CTIMER_CCR_CAP3RE_SHIFT (9U) -/*! CAP3RE - Rising Edge of Capture Channel 3 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP3RE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP3RE_SHIFT)) & CTIMER_CCR_CAP3RE_MASK) - -#define CTIMER_CCR_CAP3FE_MASK (0x400U) -#define CTIMER_CCR_CAP3FE_SHIFT (10U) -/*! CAP3FE - Falling Edge of Capture Channel 3 - * 0b0..Does not load - * 0b1..Loads - */ -#define CTIMER_CCR_CAP3FE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP3FE_SHIFT)) & CTIMER_CCR_CAP3FE_MASK) - -#define CTIMER_CCR_CAP3I_MASK (0x800U) -#define CTIMER_CCR_CAP3I_SHIFT (11U) -/*! CAP3I - Generate Interrupt on Channel 3 Capture Event - * 0b0..Does not generate - * 0b1..Generates - */ -#define CTIMER_CCR_CAP3I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP3I_SHIFT)) & CTIMER_CCR_CAP3I_MASK) -/*! @} */ - -/*! @name CR - Capture */ -/*! @{ */ - -#define CTIMER_CR_CAP_MASK (0xFFFFFFFFU) -#define CTIMER_CR_CAP_SHIFT (0U) -/*! CAP - Timer Counter Capture Value */ -#define CTIMER_CR_CAP(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CR_CAP_SHIFT)) & CTIMER_CR_CAP_MASK) -/*! @} */ - -/* The count of CTIMER_CR */ -#define CTIMER_CR_COUNT (4U) - -/*! @name EMR - External Match */ -/*! @{ */ - -#define CTIMER_EMR_EM0_MASK (0x1U) -#define CTIMER_EMR_EM0_SHIFT (0U) -/*! EM0 - External Match 0 - * 0b0..Low - * 0b1..High - */ -#define CTIMER_EMR_EM0(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EM0_SHIFT)) & CTIMER_EMR_EM0_MASK) - -#define CTIMER_EMR_EM1_MASK (0x2U) -#define CTIMER_EMR_EM1_SHIFT (1U) -/*! EM1 - External Match 1 - * 0b0..Low - * 0b1..High - */ -#define CTIMER_EMR_EM1(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EM1_SHIFT)) & CTIMER_EMR_EM1_MASK) - -#define CTIMER_EMR_EM2_MASK (0x4U) -#define CTIMER_EMR_EM2_SHIFT (2U) -/*! EM2 - External Match 2 - * 0b0..Low - * 0b1..High - */ -#define CTIMER_EMR_EM2(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EM2_SHIFT)) & CTIMER_EMR_EM2_MASK) - -#define CTIMER_EMR_EM3_MASK (0x8U) -#define CTIMER_EMR_EM3_SHIFT (3U) -/*! EM3 - External Match 3 - * 0b0..Low - * 0b1..High - */ -#define CTIMER_EMR_EM3(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EM3_SHIFT)) & CTIMER_EMR_EM3_MASK) - -#define CTIMER_EMR_EMC0_MASK (0x30U) -#define CTIMER_EMR_EMC0_SHIFT (4U) -/*! EMC0 - External Match Control 0 - * 0b00..Does nothing - * 0b01..Goes low - * 0b10..Goes high - * 0b11..Toggles - */ -#define CTIMER_EMR_EMC0(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EMC0_SHIFT)) & CTIMER_EMR_EMC0_MASK) - -#define CTIMER_EMR_EMC1_MASK (0xC0U) -#define CTIMER_EMR_EMC1_SHIFT (6U) -/*! EMC1 - External Match Control 1 - * 0b00..Does nothing - * 0b01..Goes low - * 0b10..Goes high - * 0b11..Toggles - */ -#define CTIMER_EMR_EMC1(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EMC1_SHIFT)) & CTIMER_EMR_EMC1_MASK) - -#define CTIMER_EMR_EMC2_MASK (0x300U) -#define CTIMER_EMR_EMC2_SHIFT (8U) -/*! EMC2 - External Match Control 2 - * 0b00..Does nothing - * 0b01..Goes low - * 0b10..Goes high - * 0b11..Toggles - */ -#define CTIMER_EMR_EMC2(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EMC2_SHIFT)) & CTIMER_EMR_EMC2_MASK) - -#define CTIMER_EMR_EMC3_MASK (0xC00U) -#define CTIMER_EMR_EMC3_SHIFT (10U) -/*! EMC3 - External Match Control 3 - * 0b00..Does nothing - * 0b01..Goes low - * 0b10..Goes high - * 0b11..Toggles - */ -#define CTIMER_EMR_EMC3(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EMC3_SHIFT)) & CTIMER_EMR_EMC3_MASK) -/*! @} */ - -/*! @name CTCR - Count Control */ -/*! @{ */ - -#define CTIMER_CTCR_CTMODE_MASK (0x3U) -#define CTIMER_CTCR_CTMODE_SHIFT (0U) -/*! CTMODE - Counter Timer Mode - * 0b00..Timer mode - * 0b01..Counter mode rising edge - * 0b10..Counter mode falling edge - * 0b11..Counter mode dual edge - */ -#define CTIMER_CTCR_CTMODE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CTCR_CTMODE_SHIFT)) & CTIMER_CTCR_CTMODE_MASK) - -#define CTIMER_CTCR_CINSEL_MASK (0xCU) -#define CTIMER_CTCR_CINSEL_SHIFT (2U) -/*! CINSEL - Count Input Select - * 0b00..Channel 0, CAPn[0] for CTIMERn - * 0b01..Channel 1, CAPn[1] for CTIMERn - * 0b10..Channel 2, CAPn[2] for CTIMERn - * 0b11..Channel 3, CAPn[3] for CTIMERn - */ -#define CTIMER_CTCR_CINSEL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CTCR_CINSEL_SHIFT)) & CTIMER_CTCR_CINSEL_MASK) - -#define CTIMER_CTCR_ENCC_MASK (0x10U) -#define CTIMER_CTCR_ENCC_SHIFT (4U) -/*! ENCC - Capture Channel Enable */ -#define CTIMER_CTCR_ENCC(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CTCR_ENCC_SHIFT)) & CTIMER_CTCR_ENCC_MASK) - -#define CTIMER_CTCR_SELCC_MASK (0xE0U) -#define CTIMER_CTCR_SELCC_SHIFT (5U) -/*! SELCC - Edge Select - * 0b000..Capture channel 0 rising edge - * 0b001..Capture channel 0 falling edge - * 0b010..Capture channel 1 rising edge - * 0b011..Capture channel 1 falling edge - * 0b100..Capture channel 2 rising edge - * 0b101..Capture channel 2 falling edge - */ -#define CTIMER_CTCR_SELCC(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CTCR_SELCC_SHIFT)) & CTIMER_CTCR_SELCC_MASK) -/*! @} */ - -/*! @name PWMC - PWM Control */ -/*! @{ */ - -#define CTIMER_PWMC_PWMEN0_MASK (0x1U) -#define CTIMER_PWMC_PWMEN0_SHIFT (0U) -/*! PWMEN0 - PWM Mode Enable for Channel 0 - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_PWMC_PWMEN0(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PWMC_PWMEN0_SHIFT)) & CTIMER_PWMC_PWMEN0_MASK) - -#define CTIMER_PWMC_PWMEN1_MASK (0x2U) -#define CTIMER_PWMC_PWMEN1_SHIFT (1U) -/*! PWMEN1 - PWM Mode Enable for Channel 1 - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_PWMC_PWMEN1(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PWMC_PWMEN1_SHIFT)) & CTIMER_PWMC_PWMEN1_MASK) - -#define CTIMER_PWMC_PWMEN2_MASK (0x4U) -#define CTIMER_PWMC_PWMEN2_SHIFT (2U) -/*! PWMEN2 - PWM Mode Enable for Channel 2 - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_PWMC_PWMEN2(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PWMC_PWMEN2_SHIFT)) & CTIMER_PWMC_PWMEN2_MASK) - -#define CTIMER_PWMC_PWMEN3_MASK (0x8U) -#define CTIMER_PWMC_PWMEN3_SHIFT (3U) -/*! PWMEN3 - PWM Mode Enable for Channel 3 - * 0b0..Disable - * 0b1..Enable - */ -#define CTIMER_PWMC_PWMEN3(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PWMC_PWMEN3_SHIFT)) & CTIMER_PWMC_PWMEN3_MASK) -/*! @} */ - -/*! @name MSR - Match Shadow */ -/*! @{ */ - -#define CTIMER_MSR_MATCH_SHADOW_MASK (0xFFFFFFFFU) -#define CTIMER_MSR_MATCH_SHADOW_SHIFT (0U) -/*! MATCH_SHADOW - Timer Counter Match Shadow Value */ -#define CTIMER_MSR_MATCH_SHADOW(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MSR_MATCH_SHADOW_SHIFT)) & CTIMER_MSR_MATCH_SHADOW_MASK) -/*! @} */ - -/* The count of CTIMER_MSR */ -#define CTIMER_MSR_COUNT (4U) - - -/*! - * @} - */ /* end of group CTIMER_Register_Masks */ - - -/* CTIMER - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral CTIMER0 base address */ - #define CTIMER0_BASE (0x5000C000u) - /** Peripheral CTIMER0 base address */ - #define CTIMER0_BASE_NS (0x4000C000u) - /** Peripheral CTIMER0 base pointer */ - #define CTIMER0 ((CTIMER_Type *)CTIMER0_BASE) - /** Peripheral CTIMER0 base pointer */ - #define CTIMER0_NS ((CTIMER_Type *)CTIMER0_BASE_NS) - /** Peripheral CTIMER1 base address */ - #define CTIMER1_BASE (0x5000D000u) - /** Peripheral CTIMER1 base address */ - #define CTIMER1_BASE_NS (0x4000D000u) - /** Peripheral CTIMER1 base pointer */ - #define CTIMER1 ((CTIMER_Type *)CTIMER1_BASE) - /** Peripheral CTIMER1 base pointer */ - #define CTIMER1_NS ((CTIMER_Type *)CTIMER1_BASE_NS) - /** Peripheral CTIMER2 base address */ - #define CTIMER2_BASE (0x5000E000u) - /** Peripheral CTIMER2 base address */ - #define CTIMER2_BASE_NS (0x4000E000u) - /** Peripheral CTIMER2 base pointer */ - #define CTIMER2 ((CTIMER_Type *)CTIMER2_BASE) - /** Peripheral CTIMER2 base pointer */ - #define CTIMER2_NS ((CTIMER_Type *)CTIMER2_BASE_NS) - /** Peripheral CTIMER3 base address */ - #define CTIMER3_BASE (0x5000F000u) - /** Peripheral CTIMER3 base address */ - #define CTIMER3_BASE_NS (0x4000F000u) - /** Peripheral CTIMER3 base pointer */ - #define CTIMER3 ((CTIMER_Type *)CTIMER3_BASE) - /** Peripheral CTIMER3 base pointer */ - #define CTIMER3_NS ((CTIMER_Type *)CTIMER3_BASE_NS) - /** Peripheral CTIMER4 base address */ - #define CTIMER4_BASE (0x50010000u) - /** Peripheral CTIMER4 base address */ - #define CTIMER4_BASE_NS (0x40010000u) - /** Peripheral CTIMER4 base pointer */ - #define CTIMER4 ((CTIMER_Type *)CTIMER4_BASE) - /** Peripheral CTIMER4 base pointer */ - #define CTIMER4_NS ((CTIMER_Type *)CTIMER4_BASE_NS) - /** Array initializer of CTIMER peripheral base addresses */ - #define CTIMER_BASE_ADDRS { CTIMER0_BASE, CTIMER1_BASE, CTIMER2_BASE, CTIMER3_BASE, CTIMER4_BASE } - /** Array initializer of CTIMER peripheral base pointers */ - #define CTIMER_BASE_PTRS { CTIMER0, CTIMER1, CTIMER2, CTIMER3, CTIMER4 } - /** Array initializer of CTIMER peripheral base addresses */ - #define CTIMER_BASE_ADDRS_NS { CTIMER0_BASE_NS, CTIMER1_BASE_NS, CTIMER2_BASE_NS, CTIMER3_BASE_NS, CTIMER4_BASE_NS } - /** Array initializer of CTIMER peripheral base pointers */ - #define CTIMER_BASE_PTRS_NS { CTIMER0_NS, CTIMER1_NS, CTIMER2_NS, CTIMER3_NS, CTIMER4_NS } -#else - /** Peripheral CTIMER0 base address */ - #define CTIMER0_BASE (0x4000C000u) - /** Peripheral CTIMER0 base pointer */ - #define CTIMER0 ((CTIMER_Type *)CTIMER0_BASE) - /** Peripheral CTIMER1 base address */ - #define CTIMER1_BASE (0x4000D000u) - /** Peripheral CTIMER1 base pointer */ - #define CTIMER1 ((CTIMER_Type *)CTIMER1_BASE) - /** Peripheral CTIMER2 base address */ - #define CTIMER2_BASE (0x4000E000u) - /** Peripheral CTIMER2 base pointer */ - #define CTIMER2 ((CTIMER_Type *)CTIMER2_BASE) - /** Peripheral CTIMER3 base address */ - #define CTIMER3_BASE (0x4000F000u) - /** Peripheral CTIMER3 base pointer */ - #define CTIMER3 ((CTIMER_Type *)CTIMER3_BASE) - /** Peripheral CTIMER4 base address */ - #define CTIMER4_BASE (0x40010000u) - /** Peripheral CTIMER4 base pointer */ - #define CTIMER4 ((CTIMER_Type *)CTIMER4_BASE) - /** Array initializer of CTIMER peripheral base addresses */ - #define CTIMER_BASE_ADDRS { CTIMER0_BASE, CTIMER1_BASE, CTIMER2_BASE, CTIMER3_BASE, CTIMER4_BASE } - /** Array initializer of CTIMER peripheral base pointers */ - #define CTIMER_BASE_PTRS { CTIMER0, CTIMER1, CTIMER2, CTIMER3, CTIMER4 } -#endif -/** Interrupt vectors for the CTIMER peripheral type */ -#define CTIMER_IRQS { CTIMER0_IRQn, CTIMER1_IRQn, CTIMER2_IRQn, CTIMER3_IRQn, CTIMER4_IRQn } - -/*! - * @} - */ /* end of group CTIMER_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- DIGTMP Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DIGTMP_Peripheral_Access_Layer DIGTMP Peripheral Access Layer - * @{ - */ - -/** DIGTMP - Register Layout Typedef */ -typedef struct { - uint8_t RESERVED_0[16]; - __IO uint32_t CR; /**< Control, offset: 0x10 */ - __IO uint32_t SR; /**< Status, offset: 0x14 */ - __IO uint32_t LR; /**< Lock, offset: 0x18 */ - __IO uint32_t IER; /**< Interrupt Enable, offset: 0x1C */ - __IO uint32_t TSR; /**< Tamper Seconds, offset: 0x20 */ - __IO uint32_t TER; /**< Tamper Enable, offset: 0x24 */ - __IO uint32_t PDR; /**< Pin Direction, offset: 0x28 */ - __IO uint32_t PPR; /**< Pin Polarity, offset: 0x2C */ - __IO uint32_t ATR[2]; /**< Active Tamper, array offset: 0x30, array step: 0x4 */ - uint8_t RESERVED_1[8]; - __IO uint32_t PGFR[8]; /**< Pin Glitch Filter, array offset: 0x40, array step: 0x4 */ -} DIGTMP_Type; - -/* ---------------------------------------------------------------------------- - -- DIGTMP Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DIGTMP_Register_Masks DIGTMP Register Masks - * @{ - */ - -/*! @name CR - Control */ -/*! @{ */ - -#define DIGTMP_CR_SWR_MASK (0x1U) -#define DIGTMP_CR_SWR_SHIFT (0U) -/*! SWR - Software Reset - * 0b0..No effect - * 0b1..Perform a software reset - */ -#define DIGTMP_CR_SWR(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_CR_SWR_SHIFT)) & DIGTMP_CR_SWR_MASK) - -#define DIGTMP_CR_DEN_MASK (0x2U) -#define DIGTMP_CR_DEN_SHIFT (1U) -/*! DEN - Digital Tamper Enable - * 0b0..Disables TDET clock and prescaler - * 0b1..Enables TDET clock and prescaler - */ -#define DIGTMP_CR_DEN(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_CR_DEN_SHIFT)) & DIGTMP_CR_DEN_MASK) - -#define DIGTMP_CR_TFSR_MASK (0x4U) -#define DIGTMP_CR_TFSR_SHIFT (2U) -/*! TFSR - Tamper Force System Reset - * 0b0..Do not force chip reset - * 0b1..Force chip reset - */ -#define DIGTMP_CR_TFSR(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_CR_TFSR_SHIFT)) & DIGTMP_CR_TFSR_MASK) - -#define DIGTMP_CR_UM_MASK (0x8U) -#define DIGTMP_CR_UM_SHIFT (3U) -/*! UM - Update Mode - * 0b0..No effect - * 0b1..Allows the clearing of interrupts - */ -#define DIGTMP_CR_UM(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_CR_UM_SHIFT)) & DIGTMP_CR_UM_MASK) - -#define DIGTMP_CR_ATCS0_MASK (0x10U) -#define DIGTMP_CR_ATCS0_SHIFT (4U) -/*! ATCS0 - Active Tamper Clock Source - * 0b0..1 Hz prescaler clock - * 0b1..64 Hz prescaler clock - */ -#define DIGTMP_CR_ATCS0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_CR_ATCS0_SHIFT)) & DIGTMP_CR_ATCS0_MASK) - -#define DIGTMP_CR_ATCS1_MASK (0x20U) -#define DIGTMP_CR_ATCS1_SHIFT (5U) -/*! ATCS1 - Active Tamper Clock Source - * 0b0..1 Hz prescaler clock - * 0b1..64 Hz prescaler clock - */ -#define DIGTMP_CR_ATCS1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_CR_ATCS1_SHIFT)) & DIGTMP_CR_ATCS1_MASK) - -#define DIGTMP_CR_DISTAM_MASK (0x100U) -#define DIGTMP_CR_DISTAM_SHIFT (8U) -/*! DISTAM - Disable Prescaler On Tamper - * 0b0..No effect - * 0b1..Automatically disables the prescaler after tamper detection - */ -#define DIGTMP_CR_DISTAM(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_CR_DISTAM_SHIFT)) & DIGTMP_CR_DISTAM_MASK) - -#define DIGTMP_CR_DPR_MASK (0xFFFE0000U) -#define DIGTMP_CR_DPR_SHIFT (17U) -/*! DPR - Digital Tamper Prescaler */ -#define DIGTMP_CR_DPR(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_CR_DPR_SHIFT)) & DIGTMP_CR_DPR_MASK) -/*! @} */ - -/*! @name SR - Status */ -/*! @{ */ - -#define DIGTMP_SR_DTF_MASK (0x1U) -#define DIGTMP_SR_DTF_SHIFT (0U) -/*! DTF - Digital Tamper Flag - * 0b0..TDET tampering not detected - * 0b1..TDET tampering detected - */ -#define DIGTMP_SR_DTF(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_DTF_SHIFT)) & DIGTMP_SR_DTF_MASK) - -#define DIGTMP_SR_TAF_MASK (0x2U) -#define DIGTMP_SR_TAF_SHIFT (1U) -/*! TAF - Tamper Acknowledge Flag - * 0b0..Digital Tamper Flag (SR[DTF]) is clear or chip reset has not occurred after Digital Tamper Flag (SR[DTF]) was set. - * 0b1..Chip reset has occurred after Digital Tamper Flag (SR[DTF]) was set. - */ -#define DIGTMP_SR_TAF(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TAF_SHIFT)) & DIGTMP_SR_TAF_MASK) - -#define DIGTMP_SR_TIF0_MASK (0x4U) -#define DIGTMP_SR_TIF0_SHIFT (2U) -/*! TIF0 - Tamper Input n Flag - * 0b0..On-chip tamper not detected - * 0b1..On-chip tamper detected - */ -#define DIGTMP_SR_TIF0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TIF0_SHIFT)) & DIGTMP_SR_TIF0_MASK) - -#define DIGTMP_SR_TIF1_MASK (0x8U) -#define DIGTMP_SR_TIF1_SHIFT (3U) -/*! TIF1 - Tamper Input n Flag - * 0b0..On-chip tamper not detected - * 0b1..On-chip tamper detected - */ -#define DIGTMP_SR_TIF1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TIF1_SHIFT)) & DIGTMP_SR_TIF1_MASK) - -#define DIGTMP_SR_TIF2_MASK (0x10U) -#define DIGTMP_SR_TIF2_SHIFT (4U) -/*! TIF2 - Tamper Input n Flag - * 0b0..On-chip tamper not detected - * 0b1..On-chip tamper detected - */ -#define DIGTMP_SR_TIF2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TIF2_SHIFT)) & DIGTMP_SR_TIF2_MASK) - -#define DIGTMP_SR_TIF3_MASK (0x20U) -#define DIGTMP_SR_TIF3_SHIFT (5U) -/*! TIF3 - Tamper Input n Flag - * 0b0..On-chip tamper not detected - * 0b1..On-chip tamper detected - */ -#define DIGTMP_SR_TIF3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TIF3_SHIFT)) & DIGTMP_SR_TIF3_MASK) - -#define DIGTMP_SR_TIF4_MASK (0x40U) -#define DIGTMP_SR_TIF4_SHIFT (6U) -/*! TIF4 - Tamper Input n Flag - * 0b0..On-chip tamper not detected - * 0b1..On-chip tamper detected - */ -#define DIGTMP_SR_TIF4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TIF4_SHIFT)) & DIGTMP_SR_TIF4_MASK) - -#define DIGTMP_SR_TIF5_MASK (0x80U) -#define DIGTMP_SR_TIF5_SHIFT (7U) -/*! TIF5 - Tamper Input n Flag - * 0b0..On-chip tamper not detected - * 0b1..On-chip tamper detected - */ -#define DIGTMP_SR_TIF5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TIF5_SHIFT)) & DIGTMP_SR_TIF5_MASK) - -#define DIGTMP_SR_TIF6_MASK (0x100U) -#define DIGTMP_SR_TIF6_SHIFT (8U) -/*! TIF6 - Tamper Input n Flag - * 0b0..On-chip tamper not detected - * 0b1..On-chip tamper detected - */ -#define DIGTMP_SR_TIF6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TIF6_SHIFT)) & DIGTMP_SR_TIF6_MASK) - -#define DIGTMP_SR_TIF7_MASK (0x200U) -#define DIGTMP_SR_TIF7_SHIFT (9U) -/*! TIF7 - Tamper Input n Flag - * 0b0..On-chip tamper not detected - * 0b1..On-chip tamper detected - */ -#define DIGTMP_SR_TIF7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TIF7_SHIFT)) & DIGTMP_SR_TIF7_MASK) - -#define DIGTMP_SR_TIF8_MASK (0x400U) -#define DIGTMP_SR_TIF8_SHIFT (10U) -/*! TIF8 - Tamper Input n Flag - * 0b0..On-chip tamper not detected - * 0b1..On-chip tamper detected - */ -#define DIGTMP_SR_TIF8(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TIF8_SHIFT)) & DIGTMP_SR_TIF8_MASK) - -#define DIGTMP_SR_TIF9_MASK (0x800U) -#define DIGTMP_SR_TIF9_SHIFT (11U) -/*! TIF9 - Tamper Input n Flag - * 0b0..On-chip tamper not detected - * 0b1..On-chip tamper detected - */ -#define DIGTMP_SR_TIF9(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TIF9_SHIFT)) & DIGTMP_SR_TIF9_MASK) - -#define DIGTMP_SR_TPF0_MASK (0x10000U) -#define DIGTMP_SR_TPF0_SHIFT (16U) -/*! TPF0 - Tamper Pin n Flag - * 0b0..Pin tamper not detected - * 0b1..Pin tamper detected - */ -#define DIGTMP_SR_TPF0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TPF0_SHIFT)) & DIGTMP_SR_TPF0_MASK) - -#define DIGTMP_SR_TPF1_MASK (0x20000U) -#define DIGTMP_SR_TPF1_SHIFT (17U) -/*! TPF1 - Tamper Pin n Flag - * 0b0..Pin tamper not detected - * 0b1..Pin tamper detected - */ -#define DIGTMP_SR_TPF1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TPF1_SHIFT)) & DIGTMP_SR_TPF1_MASK) - -#define DIGTMP_SR_TPF2_MASK (0x40000U) -#define DIGTMP_SR_TPF2_SHIFT (18U) -/*! TPF2 - Tamper Pin n Flag - * 0b0..Pin tamper not detected - * 0b1..Pin tamper detected - */ -#define DIGTMP_SR_TPF2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TPF2_SHIFT)) & DIGTMP_SR_TPF2_MASK) - -#define DIGTMP_SR_TPF3_MASK (0x80000U) -#define DIGTMP_SR_TPF3_SHIFT (19U) -/*! TPF3 - Tamper Pin n Flag - * 0b0..Pin tamper not detected - * 0b1..Pin tamper detected - */ -#define DIGTMP_SR_TPF3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TPF3_SHIFT)) & DIGTMP_SR_TPF3_MASK) - -#define DIGTMP_SR_TPF4_MASK (0x100000U) -#define DIGTMP_SR_TPF4_SHIFT (20U) -/*! TPF4 - Tamper Pin n Flag - * 0b0..Pin tamper not detected - * 0b1..Pin tamper detected - */ -#define DIGTMP_SR_TPF4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TPF4_SHIFT)) & DIGTMP_SR_TPF4_MASK) - -#define DIGTMP_SR_TPF5_MASK (0x200000U) -#define DIGTMP_SR_TPF5_SHIFT (21U) -/*! TPF5 - Tamper Pin n Flag - * 0b0..Pin tamper not detected - * 0b1..Pin tamper detected - */ -#define DIGTMP_SR_TPF5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TPF5_SHIFT)) & DIGTMP_SR_TPF5_MASK) - -#define DIGTMP_SR_TPF6_MASK (0x400000U) -#define DIGTMP_SR_TPF6_SHIFT (22U) -/*! TPF6 - Tamper Pin n Flag - * 0b0..Pin tamper not detected - * 0b1..Pin tamper detected - */ -#define DIGTMP_SR_TPF6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TPF6_SHIFT)) & DIGTMP_SR_TPF6_MASK) - -#define DIGTMP_SR_TPF7_MASK (0x800000U) -#define DIGTMP_SR_TPF7_SHIFT (23U) -/*! TPF7 - Tamper Pin n Flag - * 0b0..Pin tamper not detected - * 0b1..Pin tamper detected - */ -#define DIGTMP_SR_TPF7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_SR_TPF7_SHIFT)) & DIGTMP_SR_TPF7_MASK) -/*! @} */ - -/*! @name LR - Lock */ -/*! @{ */ - -#define DIGTMP_LR_CRL_MASK (0x10U) -#define DIGTMP_LR_CRL_SHIFT (4U) -/*! CRL - Control Register Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_CRL(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_CRL_SHIFT)) & DIGTMP_LR_CRL_MASK) - -#define DIGTMP_LR_SRL_MASK (0x20U) -#define DIGTMP_LR_SRL_SHIFT (5U) -/*! SRL - Status Register Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_SRL(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_SRL_SHIFT)) & DIGTMP_LR_SRL_MASK) - -#define DIGTMP_LR_LRL_MASK (0x40U) -#define DIGTMP_LR_LRL_SHIFT (6U) -/*! LRL - Lock Register Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_LRL(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_LRL_SHIFT)) & DIGTMP_LR_LRL_MASK) - -#define DIGTMP_LR_IEL_MASK (0x80U) -#define DIGTMP_LR_IEL_SHIFT (7U) -/*! IEL - Interrupt Enable Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_IEL(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_IEL_SHIFT)) & DIGTMP_LR_IEL_MASK) - -#define DIGTMP_LR_TSL_MASK (0x100U) -#define DIGTMP_LR_TSL_SHIFT (8U) -/*! TSL - Tamper Seconds Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_TSL(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_TSL_SHIFT)) & DIGTMP_LR_TSL_MASK) - -#define DIGTMP_LR_TEL_MASK (0x200U) -#define DIGTMP_LR_TEL_SHIFT (9U) -/*! TEL - Tamper Enable Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_TEL(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_TEL_SHIFT)) & DIGTMP_LR_TEL_MASK) - -#define DIGTMP_LR_PDL_MASK (0x400U) -#define DIGTMP_LR_PDL_SHIFT (10U) -/*! PDL - Pin Direction Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_PDL(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_PDL_SHIFT)) & DIGTMP_LR_PDL_MASK) - -#define DIGTMP_LR_PPL_MASK (0x800U) -#define DIGTMP_LR_PPL_SHIFT (11U) -/*! PPL - Pin Polarity Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_PPL(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_PPL_SHIFT)) & DIGTMP_LR_PPL_MASK) - -#define DIGTMP_LR_ATL0_MASK (0x1000U) -#define DIGTMP_LR_ATL0_SHIFT (12U) -/*! ATL0 - Active Tamper Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_ATL0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_ATL0_SHIFT)) & DIGTMP_LR_ATL0_MASK) - -#define DIGTMP_LR_ATL1_MASK (0x2000U) -#define DIGTMP_LR_ATL1_SHIFT (13U) -/*! ATL1 - Active Tamper Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_ATL1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_ATL1_SHIFT)) & DIGTMP_LR_ATL1_MASK) - -#define DIGTMP_LR_GFL0_MASK (0x10000U) -#define DIGTMP_LR_GFL0_SHIFT (16U) -/*! GFL0 - Glitch Filter Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_GFL0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_GFL0_SHIFT)) & DIGTMP_LR_GFL0_MASK) - -#define DIGTMP_LR_GFL1_MASK (0x20000U) -#define DIGTMP_LR_GFL1_SHIFT (17U) -/*! GFL1 - Glitch Filter Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_GFL1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_GFL1_SHIFT)) & DIGTMP_LR_GFL1_MASK) - -#define DIGTMP_LR_GFL2_MASK (0x40000U) -#define DIGTMP_LR_GFL2_SHIFT (18U) -/*! GFL2 - Glitch Filter Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_GFL2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_GFL2_SHIFT)) & DIGTMP_LR_GFL2_MASK) - -#define DIGTMP_LR_GFL3_MASK (0x80000U) -#define DIGTMP_LR_GFL3_SHIFT (19U) -/*! GFL3 - Glitch Filter Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_GFL3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_GFL3_SHIFT)) & DIGTMP_LR_GFL3_MASK) - -#define DIGTMP_LR_GFL4_MASK (0x100000U) -#define DIGTMP_LR_GFL4_SHIFT (20U) -/*! GFL4 - Glitch Filter Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_GFL4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_GFL4_SHIFT)) & DIGTMP_LR_GFL4_MASK) - -#define DIGTMP_LR_GFL5_MASK (0x200000U) -#define DIGTMP_LR_GFL5_SHIFT (21U) -/*! GFL5 - Glitch Filter Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_GFL5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_GFL5_SHIFT)) & DIGTMP_LR_GFL5_MASK) - -#define DIGTMP_LR_GFL6_MASK (0x400000U) -#define DIGTMP_LR_GFL6_SHIFT (22U) -/*! GFL6 - Glitch Filter Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_GFL6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_GFL6_SHIFT)) & DIGTMP_LR_GFL6_MASK) - -#define DIGTMP_LR_GFL7_MASK (0x800000U) -#define DIGTMP_LR_GFL7_SHIFT (23U) -/*! GFL7 - Glitch Filter Lock - * 0b0..Locked and writes are ignored - * 0b1..Not locked and writes complete as normal - */ -#define DIGTMP_LR_GFL7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_LR_GFL7_SHIFT)) & DIGTMP_LR_GFL7_MASK) -/*! @} */ - -/*! @name IER - Interrupt Enable */ -/*! @{ */ - -#define DIGTMP_IER_DTIE_MASK (0x1U) -#define DIGTMP_IER_DTIE_SHIFT (0U) -/*! DTIE - Digital Tamper Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_DTIE(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_DTIE_SHIFT)) & DIGTMP_IER_DTIE_MASK) - -#define DIGTMP_IER_TIIE0_MASK (0x4U) -#define DIGTMP_IER_TIIE0_SHIFT (2U) -/*! TIIE0 - Tamper Input n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TIIE0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TIIE0_SHIFT)) & DIGTMP_IER_TIIE0_MASK) - -#define DIGTMP_IER_TIIE1_MASK (0x8U) -#define DIGTMP_IER_TIIE1_SHIFT (3U) -/*! TIIE1 - Tamper Input n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TIIE1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TIIE1_SHIFT)) & DIGTMP_IER_TIIE1_MASK) - -#define DIGTMP_IER_TIIE2_MASK (0x10U) -#define DIGTMP_IER_TIIE2_SHIFT (4U) -/*! TIIE2 - Tamper Input n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TIIE2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TIIE2_SHIFT)) & DIGTMP_IER_TIIE2_MASK) - -#define DIGTMP_IER_TIIE3_MASK (0x20U) -#define DIGTMP_IER_TIIE3_SHIFT (5U) -/*! TIIE3 - Tamper Input n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TIIE3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TIIE3_SHIFT)) & DIGTMP_IER_TIIE3_MASK) - -#define DIGTMP_IER_TIIE4_MASK (0x40U) -#define DIGTMP_IER_TIIE4_SHIFT (6U) -/*! TIIE4 - Tamper Input n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TIIE4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TIIE4_SHIFT)) & DIGTMP_IER_TIIE4_MASK) - -#define DIGTMP_IER_TIIE5_MASK (0x80U) -#define DIGTMP_IER_TIIE5_SHIFT (7U) -/*! TIIE5 - Tamper Input n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TIIE5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TIIE5_SHIFT)) & DIGTMP_IER_TIIE5_MASK) - -#define DIGTMP_IER_TIIE6_MASK (0x100U) -#define DIGTMP_IER_TIIE6_SHIFT (8U) -/*! TIIE6 - Tamper Input n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TIIE6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TIIE6_SHIFT)) & DIGTMP_IER_TIIE6_MASK) - -#define DIGTMP_IER_TIIE7_MASK (0x200U) -#define DIGTMP_IER_TIIE7_SHIFT (9U) -/*! TIIE7 - Tamper Input n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TIIE7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TIIE7_SHIFT)) & DIGTMP_IER_TIIE7_MASK) - -#define DIGTMP_IER_TIIE8_MASK (0x400U) -#define DIGTMP_IER_TIIE8_SHIFT (10U) -/*! TIIE8 - Tamper Input n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TIIE8(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TIIE8_SHIFT)) & DIGTMP_IER_TIIE8_MASK) - -#define DIGTMP_IER_TIIE9_MASK (0x800U) -#define DIGTMP_IER_TIIE9_SHIFT (11U) -/*! TIIE9 - Tamper Input n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TIIE9(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TIIE9_SHIFT)) & DIGTMP_IER_TIIE9_MASK) - -#define DIGTMP_IER_TPIE0_MASK (0x10000U) -#define DIGTMP_IER_TPIE0_SHIFT (16U) -/*! TPIE0 - Tamper Pin n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TPIE0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TPIE0_SHIFT)) & DIGTMP_IER_TPIE0_MASK) - -#define DIGTMP_IER_TPIE1_MASK (0x20000U) -#define DIGTMP_IER_TPIE1_SHIFT (17U) -/*! TPIE1 - Tamper Pin n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TPIE1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TPIE1_SHIFT)) & DIGTMP_IER_TPIE1_MASK) - -#define DIGTMP_IER_TPIE2_MASK (0x40000U) -#define DIGTMP_IER_TPIE2_SHIFT (18U) -/*! TPIE2 - Tamper Pin n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TPIE2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TPIE2_SHIFT)) & DIGTMP_IER_TPIE2_MASK) - -#define DIGTMP_IER_TPIE3_MASK (0x80000U) -#define DIGTMP_IER_TPIE3_SHIFT (19U) -/*! TPIE3 - Tamper Pin n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TPIE3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TPIE3_SHIFT)) & DIGTMP_IER_TPIE3_MASK) - -#define DIGTMP_IER_TPIE4_MASK (0x100000U) -#define DIGTMP_IER_TPIE4_SHIFT (20U) -/*! TPIE4 - Tamper Pin n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TPIE4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TPIE4_SHIFT)) & DIGTMP_IER_TPIE4_MASK) - -#define DIGTMP_IER_TPIE5_MASK (0x200000U) -#define DIGTMP_IER_TPIE5_SHIFT (21U) -/*! TPIE5 - Tamper Pin n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TPIE5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TPIE5_SHIFT)) & DIGTMP_IER_TPIE5_MASK) - -#define DIGTMP_IER_TPIE6_MASK (0x400000U) -#define DIGTMP_IER_TPIE6_SHIFT (22U) -/*! TPIE6 - Tamper Pin n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TPIE6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TPIE6_SHIFT)) & DIGTMP_IER_TPIE6_MASK) - -#define DIGTMP_IER_TPIE7_MASK (0x800000U) -#define DIGTMP_IER_TPIE7_SHIFT (23U) -/*! TPIE7 - Tamper Pin n Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_IER_TPIE7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_IER_TPIE7_SHIFT)) & DIGTMP_IER_TPIE7_MASK) -/*! @} */ - -/*! @name TSR - Tamper Seconds */ -/*! @{ */ - -#define DIGTMP_TSR_TTS_MASK (0xFFFFFFFFU) -#define DIGTMP_TSR_TTS_SHIFT (0U) -/*! TTS - Tamper Time Seconds */ -#define DIGTMP_TSR_TTS(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TSR_TTS_SHIFT)) & DIGTMP_TSR_TTS_MASK) -/*! @} */ - -/*! @name TER - Tamper Enable */ -/*! @{ */ - -#define DIGTMP_TER_TIE0_MASK (0x4U) -#define DIGTMP_TER_TIE0_SHIFT (2U) -/*! TIE0 - Tamper Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TIE0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TIE0_SHIFT)) & DIGTMP_TER_TIE0_MASK) - -#define DIGTMP_TER_TIE1_MASK (0x8U) -#define DIGTMP_TER_TIE1_SHIFT (3U) -/*! TIE1 - Tamper Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TIE1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TIE1_SHIFT)) & DIGTMP_TER_TIE1_MASK) - -#define DIGTMP_TER_TIE2_MASK (0x10U) -#define DIGTMP_TER_TIE2_SHIFT (4U) -/*! TIE2 - Tamper Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TIE2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TIE2_SHIFT)) & DIGTMP_TER_TIE2_MASK) - -#define DIGTMP_TER_TIE3_MASK (0x20U) -#define DIGTMP_TER_TIE3_SHIFT (5U) -/*! TIE3 - Tamper Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TIE3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TIE3_SHIFT)) & DIGTMP_TER_TIE3_MASK) - -#define DIGTMP_TER_TIE4_MASK (0x40U) -#define DIGTMP_TER_TIE4_SHIFT (6U) -/*! TIE4 - Tamper Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TIE4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TIE4_SHIFT)) & DIGTMP_TER_TIE4_MASK) - -#define DIGTMP_TER_TIE5_MASK (0x80U) -#define DIGTMP_TER_TIE5_SHIFT (7U) -/*! TIE5 - Tamper Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TIE5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TIE5_SHIFT)) & DIGTMP_TER_TIE5_MASK) - -#define DIGTMP_TER_TIE6_MASK (0x100U) -#define DIGTMP_TER_TIE6_SHIFT (8U) -/*! TIE6 - Tamper Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TIE6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TIE6_SHIFT)) & DIGTMP_TER_TIE6_MASK) - -#define DIGTMP_TER_TIE7_MASK (0x200U) -#define DIGTMP_TER_TIE7_SHIFT (9U) -/*! TIE7 - Tamper Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TIE7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TIE7_SHIFT)) & DIGTMP_TER_TIE7_MASK) - -#define DIGTMP_TER_TIE8_MASK (0x400U) -#define DIGTMP_TER_TIE8_SHIFT (10U) -/*! TIE8 - Tamper Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TIE8(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TIE8_SHIFT)) & DIGTMP_TER_TIE8_MASK) - -#define DIGTMP_TER_TIE9_MASK (0x800U) -#define DIGTMP_TER_TIE9_SHIFT (11U) -/*! TIE9 - Tamper Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TIE9(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TIE9_SHIFT)) & DIGTMP_TER_TIE9_MASK) - -#define DIGTMP_TER_TPE0_MASK (0x10000U) -#define DIGTMP_TER_TPE0_SHIFT (16U) -/*! TPE0 - Tamper Pin Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TPE0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TPE0_SHIFT)) & DIGTMP_TER_TPE0_MASK) - -#define DIGTMP_TER_TPE1_MASK (0x20000U) -#define DIGTMP_TER_TPE1_SHIFT (17U) -/*! TPE1 - Tamper Pin Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TPE1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TPE1_SHIFT)) & DIGTMP_TER_TPE1_MASK) - -#define DIGTMP_TER_TPE2_MASK (0x40000U) -#define DIGTMP_TER_TPE2_SHIFT (18U) -/*! TPE2 - Tamper Pin Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TPE2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TPE2_SHIFT)) & DIGTMP_TER_TPE2_MASK) - -#define DIGTMP_TER_TPE3_MASK (0x80000U) -#define DIGTMP_TER_TPE3_SHIFT (19U) -/*! TPE3 - Tamper Pin Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TPE3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TPE3_SHIFT)) & DIGTMP_TER_TPE3_MASK) - -#define DIGTMP_TER_TPE4_MASK (0x100000U) -#define DIGTMP_TER_TPE4_SHIFT (20U) -/*! TPE4 - Tamper Pin Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TPE4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TPE4_SHIFT)) & DIGTMP_TER_TPE4_MASK) - -#define DIGTMP_TER_TPE5_MASK (0x200000U) -#define DIGTMP_TER_TPE5_SHIFT (21U) -/*! TPE5 - Tamper Pin Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TPE5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TPE5_SHIFT)) & DIGTMP_TER_TPE5_MASK) - -#define DIGTMP_TER_TPE6_MASK (0x400000U) -#define DIGTMP_TER_TPE6_SHIFT (22U) -/*! TPE6 - Tamper Pin Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TPE6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TPE6_SHIFT)) & DIGTMP_TER_TPE6_MASK) - -#define DIGTMP_TER_TPE7_MASK (0x800000U) -#define DIGTMP_TER_TPE7_SHIFT (23U) -/*! TPE7 - Tamper Pin Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_TER_TPE7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_TER_TPE7_SHIFT)) & DIGTMP_TER_TPE7_MASK) -/*! @} */ - -/*! @name PDR - Pin Direction */ -/*! @{ */ - -#define DIGTMP_PDR_TPD0_MASK (0x1U) -#define DIGTMP_PDR_TPD0_SHIFT (0U) -/*! TPD0 - Tamper Pin Direction - * 0b0..Input - * 0b1..Output and drives the inverse of the expected value (tamper pin is asserted) - */ -#define DIGTMP_PDR_TPD0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPD0_SHIFT)) & DIGTMP_PDR_TPD0_MASK) - -#define DIGTMP_PDR_TPD1_MASK (0x2U) -#define DIGTMP_PDR_TPD1_SHIFT (1U) -/*! TPD1 - Tamper Pin Direction - * 0b0..Input - * 0b1..Output and drives the inverse of the expected value (tamper pin is asserted) - */ -#define DIGTMP_PDR_TPD1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPD1_SHIFT)) & DIGTMP_PDR_TPD1_MASK) - -#define DIGTMP_PDR_TPD2_MASK (0x4U) -#define DIGTMP_PDR_TPD2_SHIFT (2U) -/*! TPD2 - Tamper Pin Direction - * 0b0..Input - * 0b1..Output and drives the inverse of the expected value (tamper pin is asserted) - */ -#define DIGTMP_PDR_TPD2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPD2_SHIFT)) & DIGTMP_PDR_TPD2_MASK) - -#define DIGTMP_PDR_TPD3_MASK (0x8U) -#define DIGTMP_PDR_TPD3_SHIFT (3U) -/*! TPD3 - Tamper Pin Direction - * 0b0..Input - * 0b1..Output and drives the inverse of the expected value (tamper pin is asserted) - */ -#define DIGTMP_PDR_TPD3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPD3_SHIFT)) & DIGTMP_PDR_TPD3_MASK) - -#define DIGTMP_PDR_TPD4_MASK (0x10U) -#define DIGTMP_PDR_TPD4_SHIFT (4U) -/*! TPD4 - Tamper Pin Direction - * 0b0..Input - * 0b1..Output and drives the inverse of the expected value (tamper pin is asserted) - */ -#define DIGTMP_PDR_TPD4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPD4_SHIFT)) & DIGTMP_PDR_TPD4_MASK) - -#define DIGTMP_PDR_TPD5_MASK (0x20U) -#define DIGTMP_PDR_TPD5_SHIFT (5U) -/*! TPD5 - Tamper Pin Direction - * 0b0..Input - * 0b1..Output and drives the inverse of the expected value (tamper pin is asserted) - */ -#define DIGTMP_PDR_TPD5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPD5_SHIFT)) & DIGTMP_PDR_TPD5_MASK) - -#define DIGTMP_PDR_TPD6_MASK (0x40U) -#define DIGTMP_PDR_TPD6_SHIFT (6U) -/*! TPD6 - Tamper Pin Direction - * 0b0..Input - * 0b1..Output and drives the inverse of the expected value (tamper pin is asserted) - */ -#define DIGTMP_PDR_TPD6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPD6_SHIFT)) & DIGTMP_PDR_TPD6_MASK) - -#define DIGTMP_PDR_TPD7_MASK (0x80U) -#define DIGTMP_PDR_TPD7_SHIFT (7U) -/*! TPD7 - Tamper Pin Direction - * 0b0..Input - * 0b1..Output and drives the inverse of the expected value (tamper pin is asserted) - */ -#define DIGTMP_PDR_TPD7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPD7_SHIFT)) & DIGTMP_PDR_TPD7_MASK) - -#define DIGTMP_PDR_TPOD0_MASK (0x10000U) -#define DIGTMP_PDR_TPOD0_SHIFT (16U) -/*! TPOD0 - Tamper Pin Output Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PDR_TPOD0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPOD0_SHIFT)) & DIGTMP_PDR_TPOD0_MASK) - -#define DIGTMP_PDR_TPOD1_MASK (0x20000U) -#define DIGTMP_PDR_TPOD1_SHIFT (17U) -/*! TPOD1 - Tamper Pin Output Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PDR_TPOD1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPOD1_SHIFT)) & DIGTMP_PDR_TPOD1_MASK) - -#define DIGTMP_PDR_TPOD2_MASK (0x40000U) -#define DIGTMP_PDR_TPOD2_SHIFT (18U) -/*! TPOD2 - Tamper Pin Output Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PDR_TPOD2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPOD2_SHIFT)) & DIGTMP_PDR_TPOD2_MASK) - -#define DIGTMP_PDR_TPOD3_MASK (0x80000U) -#define DIGTMP_PDR_TPOD3_SHIFT (19U) -/*! TPOD3 - Tamper Pin Output Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PDR_TPOD3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPOD3_SHIFT)) & DIGTMP_PDR_TPOD3_MASK) - -#define DIGTMP_PDR_TPOD4_MASK (0x100000U) -#define DIGTMP_PDR_TPOD4_SHIFT (20U) -/*! TPOD4 - Tamper Pin Output Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PDR_TPOD4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPOD4_SHIFT)) & DIGTMP_PDR_TPOD4_MASK) - -#define DIGTMP_PDR_TPOD5_MASK (0x200000U) -#define DIGTMP_PDR_TPOD5_SHIFT (21U) -/*! TPOD5 - Tamper Pin Output Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PDR_TPOD5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPOD5_SHIFT)) & DIGTMP_PDR_TPOD5_MASK) - -#define DIGTMP_PDR_TPOD6_MASK (0x400000U) -#define DIGTMP_PDR_TPOD6_SHIFT (22U) -/*! TPOD6 - Tamper Pin Output Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PDR_TPOD6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPOD6_SHIFT)) & DIGTMP_PDR_TPOD6_MASK) - -#define DIGTMP_PDR_TPOD7_MASK (0x800000U) -#define DIGTMP_PDR_TPOD7_SHIFT (23U) -/*! TPOD7 - Tamper Pin Output Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PDR_TPOD7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PDR_TPOD7_SHIFT)) & DIGTMP_PDR_TPOD7_MASK) -/*! @} */ - -/*! @name PPR - Pin Polarity */ -/*! @{ */ - -#define DIGTMP_PPR_TPP0_MASK (0x1U) -#define DIGTMP_PPR_TPP0_SHIFT (0U) -/*! TPP0 - Tamper Pin n Polarity - * 0b0..Not inverted - * 0b1..Inverted - */ -#define DIGTMP_PPR_TPP0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPP0_SHIFT)) & DIGTMP_PPR_TPP0_MASK) - -#define DIGTMP_PPR_TPP1_MASK (0x2U) -#define DIGTMP_PPR_TPP1_SHIFT (1U) -/*! TPP1 - Tamper Pin n Polarity - * 0b0..Not inverted - * 0b1..Inverted - */ -#define DIGTMP_PPR_TPP1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPP1_SHIFT)) & DIGTMP_PPR_TPP1_MASK) - -#define DIGTMP_PPR_TPP2_MASK (0x4U) -#define DIGTMP_PPR_TPP2_SHIFT (2U) -/*! TPP2 - Tamper Pin n Polarity - * 0b0..Not inverted - * 0b1..Inverted - */ -#define DIGTMP_PPR_TPP2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPP2_SHIFT)) & DIGTMP_PPR_TPP2_MASK) - -#define DIGTMP_PPR_TPP3_MASK (0x8U) -#define DIGTMP_PPR_TPP3_SHIFT (3U) -/*! TPP3 - Tamper Pin n Polarity - * 0b0..Not inverted - * 0b1..Inverted - */ -#define DIGTMP_PPR_TPP3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPP3_SHIFT)) & DIGTMP_PPR_TPP3_MASK) - -#define DIGTMP_PPR_TPP4_MASK (0x10U) -#define DIGTMP_PPR_TPP4_SHIFT (4U) -/*! TPP4 - Tamper Pin n Polarity - * 0b0..Not inverted - * 0b1..Inverted - */ -#define DIGTMP_PPR_TPP4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPP4_SHIFT)) & DIGTMP_PPR_TPP4_MASK) - -#define DIGTMP_PPR_TPP5_MASK (0x20U) -#define DIGTMP_PPR_TPP5_SHIFT (5U) -/*! TPP5 - Tamper Pin n Polarity - * 0b0..Not inverted - * 0b1..Inverted - */ -#define DIGTMP_PPR_TPP5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPP5_SHIFT)) & DIGTMP_PPR_TPP5_MASK) - -#define DIGTMP_PPR_TPP6_MASK (0x40U) -#define DIGTMP_PPR_TPP6_SHIFT (6U) -/*! TPP6 - Tamper Pin n Polarity - * 0b0..Not inverted - * 0b1..Inverted - */ -#define DIGTMP_PPR_TPP6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPP6_SHIFT)) & DIGTMP_PPR_TPP6_MASK) - -#define DIGTMP_PPR_TPP7_MASK (0x80U) -#define DIGTMP_PPR_TPP7_SHIFT (7U) -/*! TPP7 - Tamper Pin n Polarity - * 0b0..Not inverted - * 0b1..Inverted - */ -#define DIGTMP_PPR_TPP7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPP7_SHIFT)) & DIGTMP_PPR_TPP7_MASK) - -#define DIGTMP_PPR_TPID0_MASK (0x10000U) -#define DIGTMP_PPR_TPID0_SHIFT (16U) -/*! TPID0 - Tamper Pin n Input Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PPR_TPID0(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPID0_SHIFT)) & DIGTMP_PPR_TPID0_MASK) - -#define DIGTMP_PPR_TPID1_MASK (0x20000U) -#define DIGTMP_PPR_TPID1_SHIFT (17U) -/*! TPID1 - Tamper Pin n Input Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PPR_TPID1(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPID1_SHIFT)) & DIGTMP_PPR_TPID1_MASK) - -#define DIGTMP_PPR_TPID2_MASK (0x40000U) -#define DIGTMP_PPR_TPID2_SHIFT (18U) -/*! TPID2 - Tamper Pin n Input Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PPR_TPID2(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPID2_SHIFT)) & DIGTMP_PPR_TPID2_MASK) - -#define DIGTMP_PPR_TPID3_MASK (0x80000U) -#define DIGTMP_PPR_TPID3_SHIFT (19U) -/*! TPID3 - Tamper Pin n Input Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PPR_TPID3(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPID3_SHIFT)) & DIGTMP_PPR_TPID3_MASK) - -#define DIGTMP_PPR_TPID4_MASK (0x100000U) -#define DIGTMP_PPR_TPID4_SHIFT (20U) -/*! TPID4 - Tamper Pin n Input Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PPR_TPID4(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPID4_SHIFT)) & DIGTMP_PPR_TPID4_MASK) - -#define DIGTMP_PPR_TPID5_MASK (0x200000U) -#define DIGTMP_PPR_TPID5_SHIFT (21U) -/*! TPID5 - Tamper Pin n Input Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PPR_TPID5(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPID5_SHIFT)) & DIGTMP_PPR_TPID5_MASK) - -#define DIGTMP_PPR_TPID6_MASK (0x400000U) -#define DIGTMP_PPR_TPID6_SHIFT (22U) -/*! TPID6 - Tamper Pin n Input Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PPR_TPID6(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPID6_SHIFT)) & DIGTMP_PPR_TPID6_MASK) - -#define DIGTMP_PPR_TPID7_MASK (0x800000U) -#define DIGTMP_PPR_TPID7_SHIFT (23U) -/*! TPID7 - Tamper Pin n Input Data - * 0b0..Zero - * 0b1..One - */ -#define DIGTMP_PPR_TPID7(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PPR_TPID7_SHIFT)) & DIGTMP_PPR_TPID7_MASK) -/*! @} */ - -/*! @name ATR - Active Tamper */ -/*! @{ */ - -#define DIGTMP_ATR_ATSR_MASK (0xFFFFU) -#define DIGTMP_ATR_ATSR_SHIFT (0U) -/*! ATSR - Active Tamper Shift Register */ -#define DIGTMP_ATR_ATSR(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_ATR_ATSR_SHIFT)) & DIGTMP_ATR_ATSR_MASK) - -#define DIGTMP_ATR_ATP_MASK (0xFFFF0000U) -#define DIGTMP_ATR_ATP_SHIFT (16U) -/*! ATP - Active Tamper Polynomial */ -#define DIGTMP_ATR_ATP(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_ATR_ATP_SHIFT)) & DIGTMP_ATR_ATP_MASK) -/*! @} */ - -/* The count of DIGTMP_ATR */ -#define DIGTMP_ATR_COUNT (2U) - -/*! @name PGFR - Pin Glitch Filter */ -/*! @{ */ - -#define DIGTMP_PGFR_GFW_MASK (0x3FU) -#define DIGTMP_PGFR_GFW_SHIFT (0U) -/*! GFW - Glitch Filter Width */ -#define DIGTMP_PGFR_GFW(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PGFR_GFW_SHIFT)) & DIGTMP_PGFR_GFW_MASK) - -#define DIGTMP_PGFR_GFP_MASK (0x40U) -#define DIGTMP_PGFR_GFP_SHIFT (6U) -/*! GFP - Glitch Filter Prescaler - * 0b0..512 Hz prescaler clock - * 0b1..32.768 kHz clock - */ -#define DIGTMP_PGFR_GFP(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PGFR_GFP_SHIFT)) & DIGTMP_PGFR_GFP_MASK) - -#define DIGTMP_PGFR_GFE_MASK (0x80U) -#define DIGTMP_PGFR_GFE_SHIFT (7U) -/*! GFE - Glitch Filter Enable - * 0b0..Bypasses - * 0b1..Enables - */ -#define DIGTMP_PGFR_GFE(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PGFR_GFE_SHIFT)) & DIGTMP_PGFR_GFE_MASK) - -#define DIGTMP_PGFR_TPSW_MASK (0x300U) -#define DIGTMP_PGFR_TPSW_SHIFT (8U) -/*! TPSW - Tamper Pin Sample Width - * 0b00..Continuous monitoring, pin sampling disabled - * 0b01..2 cycles for pull enable and 1 cycle for input buffer enable - * 0b10..4 cycles for pull enable and 2 cycles for input buffer enable - * 0b11..8 cycles for pull enable and 4 cycles for input buffer enable - */ -#define DIGTMP_PGFR_TPSW(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PGFR_TPSW_SHIFT)) & DIGTMP_PGFR_TPSW_MASK) - -#define DIGTMP_PGFR_TPSF_MASK (0xC00U) -#define DIGTMP_PGFR_TPSF_SHIFT (10U) -/*! TPSF - Tamper Pin Sample Frequency - * 0b00..Every 8 cycles - * 0b01..Every 32 cycles - * 0b10..Every 128 cycles - * 0b11..Every 512 cycles - */ -#define DIGTMP_PGFR_TPSF(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PGFR_TPSF_SHIFT)) & DIGTMP_PGFR_TPSF_MASK) - -#define DIGTMP_PGFR_TPEX_MASK (0x30000U) -#define DIGTMP_PGFR_TPEX_SHIFT (16U) -/*! TPEX - Tamper Pin Expected - * 0b00..Zero/passive tamper - * 0b01..Active Tamper 0 output - * 0b10..Active Tamper 1 output - * 0b11..Active Tamper 0 output XORed with Active Tamper 1 output - */ -#define DIGTMP_PGFR_TPEX(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PGFR_TPEX_SHIFT)) & DIGTMP_PGFR_TPEX_MASK) - -#define DIGTMP_PGFR_TPE_MASK (0x1000000U) -#define DIGTMP_PGFR_TPE_SHIFT (24U) -/*! TPE - Tamper Pull Enable - * 0b0..Disables - * 0b1..Enables - */ -#define DIGTMP_PGFR_TPE(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PGFR_TPE_SHIFT)) & DIGTMP_PGFR_TPE_MASK) - -#define DIGTMP_PGFR_TPS_MASK (0x2000000U) -#define DIGTMP_PGFR_TPS_SHIFT (25U) -/*! TPS - Tamper Pull Select - * 0b0..Asserts - * 0b1..Negates - */ -#define DIGTMP_PGFR_TPS(x) (((uint32_t)(((uint32_t)(x)) << DIGTMP_PGFR_TPS_SHIFT)) & DIGTMP_PGFR_TPS_MASK) -/*! @} */ - -/* The count of DIGTMP_PGFR */ -#define DIGTMP_PGFR_COUNT (8U) - - -/*! - * @} - */ /* end of group DIGTMP_Register_Masks */ - - -/* DIGTMP - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral TDET0 base address */ - #define TDET0_BASE (0x50058000u) - /** Peripheral TDET0 base address */ - #define TDET0_BASE_NS (0x40058000u) - /** Peripheral TDET0 base pointer */ - #define TDET0 ((DIGTMP_Type *)TDET0_BASE) - /** Peripheral TDET0 base pointer */ - #define TDET0_NS ((DIGTMP_Type *)TDET0_BASE_NS) - /** Array initializer of DIGTMP peripheral base addresses */ - #define DIGTMP_BASE_ADDRS { TDET0_BASE } - /** Array initializer of DIGTMP peripheral base pointers */ - #define DIGTMP_BASE_PTRS { TDET0 } - /** Array initializer of DIGTMP peripheral base addresses */ - #define DIGTMP_BASE_ADDRS_NS { TDET0_BASE_NS } - /** Array initializer of DIGTMP peripheral base pointers */ - #define DIGTMP_BASE_PTRS_NS { TDET0_NS } -#else - /** Peripheral TDET0 base address */ - #define TDET0_BASE (0x40058000u) - /** Peripheral TDET0 base pointer */ - #define TDET0 ((DIGTMP_Type *)TDET0_BASE) - /** Array initializer of DIGTMP peripheral base addresses */ - #define DIGTMP_BASE_ADDRS { TDET0_BASE } - /** Array initializer of DIGTMP peripheral base pointers */ - #define DIGTMP_BASE_PTRS { TDET0 } -#endif - -/*! - * @} - */ /* end of group DIGTMP_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- DM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DM_Peripheral_Access_Layer DM Peripheral Access Layer - * @{ - */ - -/** DM - Register Layout Typedef */ -typedef struct { - __IO uint32_t CSW; /**< Command and Status Word, offset: 0x0 */ - __IO uint32_t REQUEST; /**< Request Value, offset: 0x4 */ - __IO uint32_t RETURN; /**< Return Value, offset: 0x8 */ - uint8_t RESERVED_0[240]; - __I uint32_t ID; /**< Identification, offset: 0xFC */ -} DM_Type; - -/* ---------------------------------------------------------------------------- - -- DM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DM_Register_Masks DM Register Masks - * @{ - */ - -/*! @name CSW - Command and Status Word */ -/*! @{ */ - -#define DM_CSW_RESYNCH_REQ_MASK (0x1U) -#define DM_CSW_RESYNCH_REQ_SHIFT (0U) -/*! RESYNCH_REQ - Resynchronization Request - * 0b0..No request - * 0b1..Request for resynchronization - */ -#define DM_CSW_RESYNCH_REQ(x) (((uint32_t)(((uint32_t)(x)) << DM_CSW_RESYNCH_REQ_SHIFT)) & DM_CSW_RESYNCH_REQ_MASK) - -#define DM_CSW_REQ_PENDING_MASK (0x2U) -#define DM_CSW_REQ_PENDING_SHIFT (1U) -/*! REQ_PENDING - Request Pending - * 0b0..No request pending - * 0b1..Request for resynchronization pending - */ -#define DM_CSW_REQ_PENDING(x) (((uint32_t)(((uint32_t)(x)) << DM_CSW_REQ_PENDING_SHIFT)) & DM_CSW_REQ_PENDING_MASK) - -#define DM_CSW_DBG_OR_ERR_MASK (0x4U) -#define DM_CSW_DBG_OR_ERR_SHIFT (2U) -/*! DBG_OR_ERR - DBGMB Overrun Error - * 0b0..No DBGMB Overrun error - * 0b1..DBGMB overrun error. A DBGMB overrun occurred. - */ -#define DM_CSW_DBG_OR_ERR(x) (((uint32_t)(((uint32_t)(x)) << DM_CSW_DBG_OR_ERR_SHIFT)) & DM_CSW_DBG_OR_ERR_MASK) - -#define DM_CSW_AHB_OR_ERR_MASK (0x8U) -#define DM_CSW_AHB_OR_ERR_SHIFT (3U) -/*! AHB_OR_ERR - AHB Overrun Error - * 0b0..No AHB Overrun Error - * 0b1..AHB Overrun Error. An AHB overrun occurred. - */ -#define DM_CSW_AHB_OR_ERR(x) (((uint32_t)(((uint32_t)(x)) << DM_CSW_AHB_OR_ERR_SHIFT)) & DM_CSW_AHB_OR_ERR_MASK) - -#define DM_CSW_SOFT_RESET_MASK (0x10U) -#define DM_CSW_SOFT_RESET_SHIFT (4U) -/*! SOFT_RESET - Soft Reset */ -#define DM_CSW_SOFT_RESET(x) (((uint32_t)(((uint32_t)(x)) << DM_CSW_SOFT_RESET_SHIFT)) & DM_CSW_SOFT_RESET_MASK) - -#define DM_CSW_CHIP_RESET_REQ_MASK (0x20U) -#define DM_CSW_CHIP_RESET_REQ_SHIFT (5U) -/*! CHIP_RESET_REQ - Chip Reset Request */ -#define DM_CSW_CHIP_RESET_REQ(x) (((uint32_t)(((uint32_t)(x)) << DM_CSW_CHIP_RESET_REQ_SHIFT)) & DM_CSW_CHIP_RESET_REQ_MASK) -/*! @} */ - -/*! @name REQUEST - Request Value */ -/*! @{ */ - -#define DM_REQUEST_REQUEST_MASK (0xFFFFFFFFU) -#define DM_REQUEST_REQUEST_SHIFT (0U) -/*! REQUEST - Request Value */ -#define DM_REQUEST_REQUEST(x) (((uint32_t)(((uint32_t)(x)) << DM_REQUEST_REQUEST_SHIFT)) & DM_REQUEST_REQUEST_MASK) -/*! @} */ - -/*! @name RETURN - Return Value */ -/*! @{ */ - -#define DM_RETURN_RET_MASK (0xFFFFFFFFU) -#define DM_RETURN_RET_SHIFT (0U) -/*! RET - Return Value */ -#define DM_RETURN_RET(x) (((uint32_t)(((uint32_t)(x)) << DM_RETURN_RET_SHIFT)) & DM_RETURN_RET_MASK) -/*! @} */ - -/*! @name ID - Identification */ -/*! @{ */ - -#define DM_ID_ID_MASK (0xFFFFFFFFU) -#define DM_ID_ID_SHIFT (0U) -/*! ID - Identification Value */ -#define DM_ID_ID(x) (((uint32_t)(((uint32_t)(x)) << DM_ID_ID_SHIFT)) & DM_ID_ID_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group DM_Register_Masks */ - - -/* DM - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral DM0 base address */ - #define DM0_BASE (0x500BD000u) - /** Peripheral DM0 base address */ - #define DM0_BASE_NS (0x400BD000u) - /** Peripheral DM0 base pointer */ - #define DM0 ((DM_Type *)DM0_BASE) - /** Peripheral DM0 base pointer */ - #define DM0_NS ((DM_Type *)DM0_BASE_NS) - /** Array initializer of DM peripheral base addresses */ - #define DM_BASE_ADDRS { DM0_BASE } - /** Array initializer of DM peripheral base pointers */ - #define DM_BASE_PTRS { DM0 } - /** Array initializer of DM peripheral base addresses */ - #define DM_BASE_ADDRS_NS { DM0_BASE_NS } - /** Array initializer of DM peripheral base pointers */ - #define DM_BASE_PTRS_NS { DM0_NS } -#else - /** Peripheral DM0 base address */ - #define DM0_BASE (0x400BD000u) - /** Peripheral DM0 base pointer */ - #define DM0 ((DM_Type *)DM0_BASE) - /** Array initializer of DM peripheral base addresses */ - #define DM_BASE_ADDRS { DM0_BASE } - /** Array initializer of DM peripheral base pointers */ - #define DM_BASE_PTRS { DM0 } -#endif - -/*! - * @} - */ /* end of group DM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- DMA Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DMA_Peripheral_Access_Layer DMA Peripheral Access Layer - * @{ - */ - -/** DMA - Register Layout Typedef */ -typedef struct { - __IO uint32_t MP_CSR; /**< Management Page Control, offset: 0x0 */ - __I uint32_t MP_ES; /**< Management Page Error Status, offset: 0x4 */ - __I uint32_t MP_INT; /**< Management Page Interrupt Request Status, offset: 0x8 */ - __I uint32_t MP_HRS; /**< Management Page Hardware Request Status, offset: 0xC */ - uint8_t RESERVED_0[240]; - __IO uint32_t CH_GRPRI[16]; /**< Channel Arbitration Group, array offset: 0x100, array step: 0x4 */ - uint8_t RESERVED_1[3776]; - struct { /* offset: 0x1000, array step: 0x1000 */ - __IO uint32_t CH_CSR; /**< Channel Control and Status, array offset: 0x1000, array step: 0x1000 */ - __IO uint32_t CH_ES; /**< Channel Error Status, array offset: 0x1004, array step: 0x1000 */ - __IO uint32_t CH_INT; /**< Channel Interrupt Status, array offset: 0x1008, array step: 0x1000 */ - __IO uint32_t CH_SBR; /**< Channel System Bus, array offset: 0x100C, array step: 0x1000 */ - __IO uint32_t CH_PRI; /**< Channel Priority, array offset: 0x1010, array step: 0x1000 */ - __IO uint32_t CH_MUX; /**< Channel Multiplexor Configuration, array offset: 0x1014, array step: 0x1000 */ - uint8_t RESERVED_0[8]; - __IO uint32_t TCD_SADDR; /**< TCD Source Address, array offset: 0x1020, array step: 0x1000 */ - __IO uint16_t TCD_SOFF; /**< TCD Signed Source Address Offset, array offset: 0x1024, array step: 0x1000 */ - __IO uint16_t TCD_ATTR; /**< TCD Transfer Attributes, array offset: 0x1026, array step: 0x1000 */ - union { /* offset: 0x1028, array step: 0x1000 */ - __IO uint32_t TCD_NBYTES_MLOFFNO; /**< TCD Transfer Size Without Minor Loop Offsets, array offset: 0x1028, array step: 0x1000 */ - __IO uint32_t TCD_NBYTES_MLOFFYES; /**< TCD Transfer Size with Minor Loop Offsets, array offset: 0x1028, array step: 0x1000 */ - }; - __IO uint32_t TCD_SLAST_SDA; /**< TCD Last Source Address Adjustment / Store DADDR Address, array offset: 0x102C, array step: 0x1000 */ - __IO uint32_t TCD_DADDR; /**< TCD Destination Address, array offset: 0x1030, array step: 0x1000 */ - __IO uint16_t TCD_DOFF; /**< TCD Signed Destination Address Offset, array offset: 0x1034, array step: 0x1000 */ - union { /* offset: 0x1036, array step: 0x1000 */ - __IO uint16_t TCD_CITER_ELINKNO; /**< TCD Current Major Loop Count (Minor Loop Channel Linking Disabled), array offset: 0x1036, array step: 0x1000 */ - __IO uint16_t TCD_CITER_ELINKYES; /**< TCD Current Major Loop Count (Minor Loop Channel Linking Enabled), array offset: 0x1036, array step: 0x1000 */ - }; - __IO uint32_t TCD_DLAST_SGA; /**< TCD Last Destination Address Adjustment / Scatter Gather Address, array offset: 0x1038, array step: 0x1000 */ - __IO uint16_t TCD_CSR; /**< TCD Control and Status, array offset: 0x103C, array step: 0x1000 */ - union { /* offset: 0x103E, array step: 0x1000 */ - __IO uint16_t TCD_BITER_ELINKNO; /**< TCD Beginning Major Loop Count (Minor Loop Channel Linking Disabled), array offset: 0x103E, array step: 0x1000 */ - __IO uint16_t TCD_BITER_ELINKYES; /**< TCD Beginning Major Loop Count (Minor Loop Channel Linking Enabled), array offset: 0x103E, array step: 0x1000 */ - }; - uint8_t RESERVED_1[4032]; - } CH[16]; -} DMA_Type; - -/* ---------------------------------------------------------------------------- - -- DMA Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup DMA_Register_Masks DMA Register Masks - * @{ - */ - -/*! @name MP_CSR - Management Page Control */ -/*! @{ */ - -#define DMA_MP_CSR_EDBG_MASK (0x2U) -#define DMA_MP_CSR_EDBG_SHIFT (1U) -/*! EDBG - Enable Debug - * 0b0..Debug mode disabled - * 0b1..Debug mode is enabled. - */ -#define DMA_MP_CSR_EDBG(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_EDBG_SHIFT)) & DMA_MP_CSR_EDBG_MASK) - -#define DMA_MP_CSR_ERCA_MASK (0x4U) -#define DMA_MP_CSR_ERCA_SHIFT (2U) -/*! ERCA - Enable Round Robin Channel Arbitration - * 0b0..Round-robin channel arbitration disabled - * 0b1..Round-robin channel arbitration enabled - */ -#define DMA_MP_CSR_ERCA(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_ERCA_SHIFT)) & DMA_MP_CSR_ERCA_MASK) - -#define DMA_MP_CSR_HAE_MASK (0x10U) -#define DMA_MP_CSR_HAE_SHIFT (4U) -/*! HAE - Halt After Error - * 0b0..Normal operation - * 0b1..Any error causes the HALT field to be set to 1 - */ -#define DMA_MP_CSR_HAE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_HAE_SHIFT)) & DMA_MP_CSR_HAE_MASK) - -#define DMA_MP_CSR_HALT_MASK (0x20U) -#define DMA_MP_CSR_HALT_SHIFT (5U) -/*! HALT - Halt DMA Operations - * 0b0..Normal operation - * 0b1..Stall the start of any new channels - */ -#define DMA_MP_CSR_HALT(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_HALT_SHIFT)) & DMA_MP_CSR_HALT_MASK) - -#define DMA_MP_CSR_GCLC_MASK (0x40U) -#define DMA_MP_CSR_GCLC_SHIFT (6U) -/*! GCLC - Global Channel Linking Control - * 0b0..Channel linking disabled for all channels - * 0b1..Channel linking available and controlled by each channel's link settings - */ -#define DMA_MP_CSR_GCLC(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_GCLC_SHIFT)) & DMA_MP_CSR_GCLC_MASK) - -#define DMA_MP_CSR_GMRC_MASK (0x80U) -#define DMA_MP_CSR_GMRC_SHIFT (7U) -/*! GMRC - Global Master ID Replication Control - * 0b0..Master ID replication disabled for all channels - * 0b1..Master ID replication available and controlled by each channel's CHn_SBR[EMI] setting - */ -#define DMA_MP_CSR_GMRC(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_GMRC_SHIFT)) & DMA_MP_CSR_GMRC_MASK) - -#define DMA_MP_CSR_ECX_MASK (0x100U) -#define DMA_MP_CSR_ECX_SHIFT (8U) -/*! ECX - Cancel Transfer With Error - * 0b0..Normal operation - * 0b1..Cancel the remaining data transfer - */ -#define DMA_MP_CSR_ECX(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_ECX_SHIFT)) & DMA_MP_CSR_ECX_MASK) - -#define DMA_MP_CSR_CX_MASK (0x200U) -#define DMA_MP_CSR_CX_SHIFT (9U) -/*! CX - Cancel Transfer - * 0b0..Normal operation - * 0b1..Cancel the remaining data transfer - */ -#define DMA_MP_CSR_CX(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_CX_SHIFT)) & DMA_MP_CSR_CX_MASK) - -#define DMA_MP_CSR_ACTIVE_ID_MASK (0xF000000U) -#define DMA_MP_CSR_ACTIVE_ID_SHIFT (24U) -/*! ACTIVE_ID - Active Channel ID */ -#define DMA_MP_CSR_ACTIVE_ID(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_ACTIVE_ID_SHIFT)) & DMA_MP_CSR_ACTIVE_ID_MASK) - -#define DMA_MP_CSR_ACTIVE_MASK (0x80000000U) -#define DMA_MP_CSR_ACTIVE_SHIFT (31U) -/*! ACTIVE - DMA Active Status - * 0b0..eDMA is idle - * 0b1..eDMA is executing a channel - */ -#define DMA_MP_CSR_ACTIVE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_CSR_ACTIVE_SHIFT)) & DMA_MP_CSR_ACTIVE_MASK) -/*! @} */ - -/*! @name MP_ES - Management Page Error Status */ -/*! @{ */ - -#define DMA_MP_ES_DBE_MASK (0x1U) -#define DMA_MP_ES_DBE_SHIFT (0U) -/*! DBE - Destination Bus Error - * 0b0..No destination bus error - * 0b1..Last recorded error was a bus error on a destination write - */ -#define DMA_MP_ES_DBE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_DBE_SHIFT)) & DMA_MP_ES_DBE_MASK) - -#define DMA_MP_ES_SBE_MASK (0x2U) -#define DMA_MP_ES_SBE_SHIFT (1U) -/*! SBE - Source Bus Error - * 0b0..No source bus error - * 0b1..Last recorded error was a bus error on a source read - */ -#define DMA_MP_ES_SBE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_SBE_SHIFT)) & DMA_MP_ES_SBE_MASK) - -#define DMA_MP_ES_SGE_MASK (0x4U) -#define DMA_MP_ES_SGE_SHIFT (2U) -/*! SGE - Scatter/Gather Configuration Error - * 0b0..No scatter/gather configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_DLAST_SGA field - */ -#define DMA_MP_ES_SGE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_SGE_SHIFT)) & DMA_MP_ES_SGE_MASK) - -#define DMA_MP_ES_NCE_MASK (0x8U) -#define DMA_MP_ES_NCE_SHIFT (3U) -/*! NCE - NBYTES/CITER Configuration Error - * 0b0..No NBYTES/CITER configuration error - * 0b1..The last recorded error was NBYTES equal to zero or a CITER not equal to BITER error - */ -#define DMA_MP_ES_NCE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_NCE_SHIFT)) & DMA_MP_ES_NCE_MASK) - -#define DMA_MP_ES_DOE_MASK (0x10U) -#define DMA_MP_ES_DOE_SHIFT (4U) -/*! DOE - Destination Offset Error - * 0b0..No destination offset configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_DOFF field - */ -#define DMA_MP_ES_DOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_DOE_SHIFT)) & DMA_MP_ES_DOE_MASK) - -#define DMA_MP_ES_DAE_MASK (0x20U) -#define DMA_MP_ES_DAE_SHIFT (5U) -/*! DAE - Destination Address Error - * 0b0..No destination address configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_DADDR field - */ -#define DMA_MP_ES_DAE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_DAE_SHIFT)) & DMA_MP_ES_DAE_MASK) - -#define DMA_MP_ES_SOE_MASK (0x40U) -#define DMA_MP_ES_SOE_SHIFT (6U) -/*! SOE - Source Offset Error - * 0b0..No source offset configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_SOFF field - */ -#define DMA_MP_ES_SOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_SOE_SHIFT)) & DMA_MP_ES_SOE_MASK) - -#define DMA_MP_ES_SAE_MASK (0x80U) -#define DMA_MP_ES_SAE_SHIFT (7U) -/*! SAE - Source Address Error - * 0b0..No source address configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_SADDR field - */ -#define DMA_MP_ES_SAE(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_SAE_SHIFT)) & DMA_MP_ES_SAE_MASK) - -#define DMA_MP_ES_ECX_MASK (0x100U) -#define DMA_MP_ES_ECX_SHIFT (8U) -/*! ECX - Transfer Canceled - * 0b0..No canceled transfers - * 0b1..Last recorded entry was a canceled transfer by the error cancel transfer input - */ -#define DMA_MP_ES_ECX(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_ECX_SHIFT)) & DMA_MP_ES_ECX_MASK) - -#define DMA_MP_ES_ERRCHN_MASK (0xF000000U) -#define DMA_MP_ES_ERRCHN_SHIFT (24U) -/*! ERRCHN - Error Channel Number or Canceled Channel Number */ -#define DMA_MP_ES_ERRCHN(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_ERRCHN_SHIFT)) & DMA_MP_ES_ERRCHN_MASK) - -#define DMA_MP_ES_VLD_MASK (0x80000000U) -#define DMA_MP_ES_VLD_SHIFT (31U) -/*! VLD - Valid - * 0b0..No CHn_ES[ERR] fields are set to 1 - * 0b1..At least one CHn_ES[ERR] field is set to 1, indicating a valid error exists that software has not cleared - */ -#define DMA_MP_ES_VLD(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_ES_VLD_SHIFT)) & DMA_MP_ES_VLD_MASK) -/*! @} */ - -/*! @name MP_INT - Management Page Interrupt Request Status */ -/*! @{ */ - -#define DMA_MP_INT_INT_MASK (0xFFFFU) -#define DMA_MP_INT_INT_SHIFT (0U) -/*! INT - Interrupt Request Status */ -#define DMA_MP_INT_INT(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_INT_INT_SHIFT)) & DMA_MP_INT_INT_MASK) -/*! @} */ - -/*! @name MP_HRS - Management Page Hardware Request Status */ -/*! @{ */ - -#define DMA_MP_HRS_HRS_MASK (0xFFFFFFFFU) -#define DMA_MP_HRS_HRS_SHIFT (0U) -/*! HRS - Hardware Request Status */ -#define DMA_MP_HRS_HRS(x) (((uint32_t)(((uint32_t)(x)) << DMA_MP_HRS_HRS_SHIFT)) & DMA_MP_HRS_HRS_MASK) -/*! @} */ - -/*! @name CH_GRPRI - Channel Arbitration Group */ -/*! @{ */ - -#define DMA_CH_GRPRI_GRPRI_MASK (0x1FU) -#define DMA_CH_GRPRI_GRPRI_SHIFT (0U) -/*! GRPRI - Arbitration Group For Channel n */ -#define DMA_CH_GRPRI_GRPRI(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_GRPRI_GRPRI_SHIFT)) & DMA_CH_GRPRI_GRPRI_MASK) -/*! @} */ - -/* The count of DMA_CH_GRPRI */ -#define DMA_CH_GRPRI_COUNT (16U) - -/*! @name CH_CSR - Channel Control and Status */ -/*! @{ */ - -#define DMA_CH_CSR_ERQ_MASK (0x1U) -#define DMA_CH_CSR_ERQ_SHIFT (0U) -/*! ERQ - Enable DMA Request - * 0b0..DMA hardware request signal for corresponding channel disabled - * 0b1..DMA hardware request signal for corresponding channel enabled - */ -#define DMA_CH_CSR_ERQ(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_CSR_ERQ_SHIFT)) & DMA_CH_CSR_ERQ_MASK) - -#define DMA_CH_CSR_EARQ_MASK (0x2U) -#define DMA_CH_CSR_EARQ_SHIFT (1U) -/*! EARQ - Enable Asynchronous DMA Request - * 0b0..Disable asynchronous DMA request for the channel - * 0b1..Enable asynchronous DMA request for the channel - */ -#define DMA_CH_CSR_EARQ(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_CSR_EARQ_SHIFT)) & DMA_CH_CSR_EARQ_MASK) - -#define DMA_CH_CSR_EEI_MASK (0x4U) -#define DMA_CH_CSR_EEI_SHIFT (2U) -/*! EEI - Enable Error Interrupt - * 0b0..Error signal for corresponding channel does not generate error interrupt - * 0b1..Assertion of error signal for corresponding channel generates error interrupt request - */ -#define DMA_CH_CSR_EEI(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_CSR_EEI_SHIFT)) & DMA_CH_CSR_EEI_MASK) - -#define DMA_CH_CSR_EBW_MASK (0x8U) -#define DMA_CH_CSR_EBW_SHIFT (3U) -/*! EBW - Enable Buffered Writes - * 0b0..Buffered writes on system bus disabled - * 0b1..Buffered writes on system bus enabled - */ -#define DMA_CH_CSR_EBW(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_CSR_EBW_SHIFT)) & DMA_CH_CSR_EBW_MASK) - -#define DMA_CH_CSR_DONE_MASK (0x40000000U) -#define DMA_CH_CSR_DONE_SHIFT (30U) -/*! DONE - Channel Done */ -#define DMA_CH_CSR_DONE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_CSR_DONE_SHIFT)) & DMA_CH_CSR_DONE_MASK) - -#define DMA_CH_CSR_ACTIVE_MASK (0x80000000U) -#define DMA_CH_CSR_ACTIVE_SHIFT (31U) -/*! ACTIVE - Channel Active */ -#define DMA_CH_CSR_ACTIVE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_CSR_ACTIVE_SHIFT)) & DMA_CH_CSR_ACTIVE_MASK) -/*! @} */ - -/* The count of DMA_CH_CSR */ -#define DMA_CH_CSR_COUNT (16U) - -/*! @name CH_ES - Channel Error Status */ -/*! @{ */ - -#define DMA_CH_ES_DBE_MASK (0x1U) -#define DMA_CH_ES_DBE_SHIFT (0U) -/*! DBE - Destination Bus Error - * 0b0..No destination bus error - * 0b1..Last recorded error was bus error on destination write - */ -#define DMA_CH_ES_DBE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_DBE_SHIFT)) & DMA_CH_ES_DBE_MASK) - -#define DMA_CH_ES_SBE_MASK (0x2U) -#define DMA_CH_ES_SBE_SHIFT (1U) -/*! SBE - Source Bus Error - * 0b0..No source bus error - * 0b1..Last recorded error was bus error on source read - */ -#define DMA_CH_ES_SBE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_SBE_SHIFT)) & DMA_CH_ES_SBE_MASK) - -#define DMA_CH_ES_SGE_MASK (0x4U) -#define DMA_CH_ES_SGE_SHIFT (2U) -/*! SGE - Scatter/Gather Configuration Error - * 0b0..No scatter/gather configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_DLAST_SGA field - */ -#define DMA_CH_ES_SGE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_SGE_SHIFT)) & DMA_CH_ES_SGE_MASK) - -#define DMA_CH_ES_NCE_MASK (0x8U) -#define DMA_CH_ES_NCE_SHIFT (3U) -/*! NCE - NBYTES/CITER Configuration Error - * 0b0..No NBYTES/CITER configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_NBYTES or TCDn_CITER fields - */ -#define DMA_CH_ES_NCE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_NCE_SHIFT)) & DMA_CH_ES_NCE_MASK) - -#define DMA_CH_ES_DOE_MASK (0x10U) -#define DMA_CH_ES_DOE_SHIFT (4U) -/*! DOE - Destination Offset Error - * 0b0..No destination offset configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_DOFF field - */ -#define DMA_CH_ES_DOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_DOE_SHIFT)) & DMA_CH_ES_DOE_MASK) - -#define DMA_CH_ES_DAE_MASK (0x20U) -#define DMA_CH_ES_DAE_SHIFT (5U) -/*! DAE - Destination Address Error - * 0b0..No destination address configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_DADDR field - */ -#define DMA_CH_ES_DAE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_DAE_SHIFT)) & DMA_CH_ES_DAE_MASK) - -#define DMA_CH_ES_SOE_MASK (0x40U) -#define DMA_CH_ES_SOE_SHIFT (6U) -/*! SOE - Source Offset Error - * 0b0..No source offset configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_SOFF field - */ -#define DMA_CH_ES_SOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_SOE_SHIFT)) & DMA_CH_ES_SOE_MASK) - -#define DMA_CH_ES_SAE_MASK (0x80U) -#define DMA_CH_ES_SAE_SHIFT (7U) -/*! SAE - Source Address Error - * 0b0..No source address configuration error - * 0b1..Last recorded error was a configuration error detected in the TCDn_SADDR field - */ -#define DMA_CH_ES_SAE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_SAE_SHIFT)) & DMA_CH_ES_SAE_MASK) - -#define DMA_CH_ES_ERR_MASK (0x80000000U) -#define DMA_CH_ES_ERR_SHIFT (31U) -/*! ERR - Error In Channel - * 0b0..An error in this channel has not occurred - * 0b1..An error in this channel has occurred - */ -#define DMA_CH_ES_ERR(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_ES_ERR_SHIFT)) & DMA_CH_ES_ERR_MASK) -/*! @} */ - -/* The count of DMA_CH_ES */ -#define DMA_CH_ES_COUNT (16U) - -/*! @name CH_INT - Channel Interrupt Status */ -/*! @{ */ - -#define DMA_CH_INT_INT_MASK (0x1U) -#define DMA_CH_INT_INT_SHIFT (0U) -/*! INT - Interrupt Request - * 0b0..Interrupt request for corresponding channel cleared - * 0b1..Interrupt request for corresponding channel active - */ -#define DMA_CH_INT_INT(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_INT_INT_SHIFT)) & DMA_CH_INT_INT_MASK) -/*! @} */ - -/* The count of DMA_CH_INT */ -#define DMA_CH_INT_COUNT (16U) - -/*! @name CH_SBR - Channel System Bus */ -/*! @{ */ - -#define DMA_CH_SBR_MID_MASK (0x1FU) -#define DMA_CH_SBR_MID_SHIFT (0U) -/*! MID - Master ID */ -#define DMA_CH_SBR_MID(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_SBR_MID_SHIFT)) & DMA_CH_SBR_MID_MASK) - -#define DMA_CH_SBR_SEC_MASK (0x4000U) -#define DMA_CH_SBR_SEC_SHIFT (14U) -/*! SEC - Security Level - * 0b0..Nonsecure protection level for DMA transfers - * 0b1..Secure protection level for DMA transfers - */ -#define DMA_CH_SBR_SEC(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_SBR_SEC_SHIFT)) & DMA_CH_SBR_SEC_MASK) - -#define DMA_CH_SBR_PAL_MASK (0x8000U) -#define DMA_CH_SBR_PAL_SHIFT (15U) -/*! PAL - Privileged Access Level - * 0b0..User protection level for DMA transfers - * 0b1..Privileged protection level for DMA transfers - */ -#define DMA_CH_SBR_PAL(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_SBR_PAL_SHIFT)) & DMA_CH_SBR_PAL_MASK) - -#define DMA_CH_SBR_EMI_MASK (0x10000U) -#define DMA_CH_SBR_EMI_SHIFT (16U) -/*! EMI - Enable Master ID Replication - * 0b0..Master ID replication is disabled - * 0b1..Master ID replication is enabled - */ -#define DMA_CH_SBR_EMI(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_SBR_EMI_SHIFT)) & DMA_CH_SBR_EMI_MASK) -/*! @} */ - -/* The count of DMA_CH_SBR */ -#define DMA_CH_SBR_COUNT (16U) - -/*! @name CH_PRI - Channel Priority */ -/*! @{ */ - -#define DMA_CH_PRI_APL_MASK (0x7U) -#define DMA_CH_PRI_APL_SHIFT (0U) -/*! APL - Arbitration Priority Level */ -#define DMA_CH_PRI_APL(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_PRI_APL_SHIFT)) & DMA_CH_PRI_APL_MASK) - -#define DMA_CH_PRI_DPA_MASK (0x40000000U) -#define DMA_CH_PRI_DPA_SHIFT (30U) -/*! DPA - Disable Preempt Ability - * 0b0..Channel can suspend a lower-priority channel - * 0b1..Channel cannot suspend any other channel, regardless of channel priority - */ -#define DMA_CH_PRI_DPA(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_PRI_DPA_SHIFT)) & DMA_CH_PRI_DPA_MASK) - -#define DMA_CH_PRI_ECP_MASK (0x80000000U) -#define DMA_CH_PRI_ECP_SHIFT (31U) -/*! ECP - Enable Channel Preemption - * 0b0..Channel cannot be suspended by a higher-priority channel's service request - * 0b1..Channel can be temporarily suspended by a higher-priority channel's service request - */ -#define DMA_CH_PRI_ECP(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_PRI_ECP_SHIFT)) & DMA_CH_PRI_ECP_MASK) -/*! @} */ - -/* The count of DMA_CH_PRI */ -#define DMA_CH_PRI_COUNT (16U) - -/*! @name CH_MUX - Channel Multiplexor Configuration */ -/*! @{ */ - -#define DMA_CH_MUX_SRC_MASK (0x7FU) -#define DMA_CH_MUX_SRC_SHIFT (0U) -/*! SRC - Service Request Source */ -#define DMA_CH_MUX_SRC(x) (((uint32_t)(((uint32_t)(x)) << DMA_CH_MUX_SRC_SHIFT)) & DMA_CH_MUX_SRC_MASK) -/*! @} */ - -/* The count of DMA_CH_MUX */ -#define DMA_CH_MUX_COUNT (16U) - -/*! @name TCD_SADDR - TCD Source Address */ -/*! @{ */ - -#define DMA_TCD_SADDR_SADDR_MASK (0xFFFFFFFFU) -#define DMA_TCD_SADDR_SADDR_SHIFT (0U) -/*! SADDR - Source Address */ -#define DMA_TCD_SADDR_SADDR(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_SADDR_SADDR_SHIFT)) & DMA_TCD_SADDR_SADDR_MASK) -/*! @} */ - -/* The count of DMA_TCD_SADDR */ -#define DMA_TCD_SADDR_COUNT (16U) - -/*! @name TCD_SOFF - TCD Signed Source Address Offset */ -/*! @{ */ - -#define DMA_TCD_SOFF_SOFF_MASK (0xFFFFU) -#define DMA_TCD_SOFF_SOFF_SHIFT (0U) -/*! SOFF - Source Address Signed Offset */ -#define DMA_TCD_SOFF_SOFF(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_SOFF_SOFF_SHIFT)) & DMA_TCD_SOFF_SOFF_MASK) -/*! @} */ - -/* The count of DMA_TCD_SOFF */ -#define DMA_TCD_SOFF_COUNT (16U) - -/*! @name TCD_ATTR - TCD Transfer Attributes */ -/*! @{ */ - -#define DMA_TCD_ATTR_DSIZE_MASK (0x7U) -#define DMA_TCD_ATTR_DSIZE_SHIFT (0U) -/*! DSIZE - Destination Data Transfer Size */ -#define DMA_TCD_ATTR_DSIZE(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_ATTR_DSIZE_SHIFT)) & DMA_TCD_ATTR_DSIZE_MASK) - -#define DMA_TCD_ATTR_DMOD_MASK (0xF8U) -#define DMA_TCD_ATTR_DMOD_SHIFT (3U) -/*! DMOD - Destination Address Modulo */ -#define DMA_TCD_ATTR_DMOD(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_ATTR_DMOD_SHIFT)) & DMA_TCD_ATTR_DMOD_MASK) - -#define DMA_TCD_ATTR_SSIZE_MASK (0x700U) -#define DMA_TCD_ATTR_SSIZE_SHIFT (8U) -/*! SSIZE - Source Data Transfer Size - * 0b000..8-bit - * 0b001..16-bit - * 0b010..32-bit - * 0b011..64-bit - * 0b100..16-byte - * 0b101..32-byte - * 0b110.. - * 0b111.. - */ -#define DMA_TCD_ATTR_SSIZE(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_ATTR_SSIZE_SHIFT)) & DMA_TCD_ATTR_SSIZE_MASK) - -#define DMA_TCD_ATTR_SMOD_MASK (0xF800U) -#define DMA_TCD_ATTR_SMOD_SHIFT (11U) -/*! SMOD - Source Address Modulo - * 0b00000..Source address modulo feature disabled - * 0b00001..Source address modulo feature enabled for any non-zero value [1-31] - */ -#define DMA_TCD_ATTR_SMOD(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_ATTR_SMOD_SHIFT)) & DMA_TCD_ATTR_SMOD_MASK) -/*! @} */ - -/* The count of DMA_TCD_ATTR */ -#define DMA_TCD_ATTR_COUNT (16U) - -/*! @name TCD_NBYTES_MLOFFNO - TCD Transfer Size Without Minor Loop Offsets */ -/*! @{ */ - -#define DMA_TCD_NBYTES_MLOFFNO_NBYTES_MASK (0x3FFFFFFFU) -#define DMA_TCD_NBYTES_MLOFFNO_NBYTES_SHIFT (0U) -/*! NBYTES - Number of Bytes To Transfer Per Service Request */ -#define DMA_TCD_NBYTES_MLOFFNO_NBYTES(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFNO_NBYTES_SHIFT)) & DMA_TCD_NBYTES_MLOFFNO_NBYTES_MASK) - -#define DMA_TCD_NBYTES_MLOFFNO_DMLOE_MASK (0x40000000U) -#define DMA_TCD_NBYTES_MLOFFNO_DMLOE_SHIFT (30U) -/*! DMLOE - Destination Minor Loop Offset Enable - * 0b0..Minor loop offset not applied to DADDR - * 0b1..Minor loop offset applied to DADDR - */ -#define DMA_TCD_NBYTES_MLOFFNO_DMLOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFNO_DMLOE_SHIFT)) & DMA_TCD_NBYTES_MLOFFNO_DMLOE_MASK) - -#define DMA_TCD_NBYTES_MLOFFNO_SMLOE_MASK (0x80000000U) -#define DMA_TCD_NBYTES_MLOFFNO_SMLOE_SHIFT (31U) -/*! SMLOE - Source Minor Loop Offset Enable - * 0b0..Minor loop offset not applied to SADDR - * 0b1..Minor loop offset applied to SADDR - */ -#define DMA_TCD_NBYTES_MLOFFNO_SMLOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFNO_SMLOE_SHIFT)) & DMA_TCD_NBYTES_MLOFFNO_SMLOE_MASK) -/*! @} */ - -/* The count of DMA_TCD_NBYTES_MLOFFNO */ -#define DMA_TCD_NBYTES_MLOFFNO_COUNT (16U) - -/*! @name TCD_NBYTES_MLOFFYES - TCD Transfer Size with Minor Loop Offsets */ -/*! @{ */ - -#define DMA_TCD_NBYTES_MLOFFYES_NBYTES_MASK (0x3FFU) -#define DMA_TCD_NBYTES_MLOFFYES_NBYTES_SHIFT (0U) -/*! NBYTES - Number of Bytes To Transfer Per Service Request */ -#define DMA_TCD_NBYTES_MLOFFYES_NBYTES(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFYES_NBYTES_SHIFT)) & DMA_TCD_NBYTES_MLOFFYES_NBYTES_MASK) - -#define DMA_TCD_NBYTES_MLOFFYES_MLOFF_MASK (0x3FFFFC00U) -#define DMA_TCD_NBYTES_MLOFFYES_MLOFF_SHIFT (10U) -/*! MLOFF - Minor Loop Offset */ -#define DMA_TCD_NBYTES_MLOFFYES_MLOFF(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFYES_MLOFF_SHIFT)) & DMA_TCD_NBYTES_MLOFFYES_MLOFF_MASK) - -#define DMA_TCD_NBYTES_MLOFFYES_DMLOE_MASK (0x40000000U) -#define DMA_TCD_NBYTES_MLOFFYES_DMLOE_SHIFT (30U) -/*! DMLOE - Destination Minor Loop Offset Enable - * 0b0..Minor loop offset not applied to DADDR - * 0b1..Minor loop offset applied to DADDR - */ -#define DMA_TCD_NBYTES_MLOFFYES_DMLOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFYES_DMLOE_SHIFT)) & DMA_TCD_NBYTES_MLOFFYES_DMLOE_MASK) - -#define DMA_TCD_NBYTES_MLOFFYES_SMLOE_MASK (0x80000000U) -#define DMA_TCD_NBYTES_MLOFFYES_SMLOE_SHIFT (31U) -/*! SMLOE - Source Minor Loop Offset Enable - * 0b0..Minor loop offset not applied to SADDR - * 0b1..Minor loop offset applied to SADDR - */ -#define DMA_TCD_NBYTES_MLOFFYES_SMLOE(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_NBYTES_MLOFFYES_SMLOE_SHIFT)) & DMA_TCD_NBYTES_MLOFFYES_SMLOE_MASK) -/*! @} */ - -/* The count of DMA_TCD_NBYTES_MLOFFYES */ -#define DMA_TCD_NBYTES_MLOFFYES_COUNT (16U) - -/*! @name TCD_SLAST_SDA - TCD Last Source Address Adjustment / Store DADDR Address */ -/*! @{ */ - -#define DMA_TCD_SLAST_SDA_SLAST_SDA_MASK (0xFFFFFFFFU) -#define DMA_TCD_SLAST_SDA_SLAST_SDA_SHIFT (0U) -/*! SLAST_SDA - Last Source Address Adjustment / Store DADDR Address */ -#define DMA_TCD_SLAST_SDA_SLAST_SDA(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_SLAST_SDA_SLAST_SDA_SHIFT)) & DMA_TCD_SLAST_SDA_SLAST_SDA_MASK) -/*! @} */ - -/* The count of DMA_TCD_SLAST_SDA */ -#define DMA_TCD_SLAST_SDA_COUNT (16U) - -/*! @name TCD_DADDR - TCD Destination Address */ -/*! @{ */ - -#define DMA_TCD_DADDR_DADDR_MASK (0xFFFFFFFFU) -#define DMA_TCD_DADDR_DADDR_SHIFT (0U) -/*! DADDR - Destination Address */ -#define DMA_TCD_DADDR_DADDR(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_DADDR_DADDR_SHIFT)) & DMA_TCD_DADDR_DADDR_MASK) -/*! @} */ - -/* The count of DMA_TCD_DADDR */ -#define DMA_TCD_DADDR_COUNT (16U) - -/*! @name TCD_DOFF - TCD Signed Destination Address Offset */ -/*! @{ */ - -#define DMA_TCD_DOFF_DOFF_MASK (0xFFFFU) -#define DMA_TCD_DOFF_DOFF_SHIFT (0U) -/*! DOFF - Destination Address Signed Offset */ -#define DMA_TCD_DOFF_DOFF(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_DOFF_DOFF_SHIFT)) & DMA_TCD_DOFF_DOFF_MASK) -/*! @} */ - -/* The count of DMA_TCD_DOFF */ -#define DMA_TCD_DOFF_COUNT (16U) - -/*! @name TCD_CITER_ELINKNO - TCD Current Major Loop Count (Minor Loop Channel Linking Disabled) */ -/*! @{ */ - -#define DMA_TCD_CITER_ELINKNO_CITER_MASK (0x7FFFU) -#define DMA_TCD_CITER_ELINKNO_CITER_SHIFT (0U) -/*! CITER - Current Major Iteration Count */ -#define DMA_TCD_CITER_ELINKNO_CITER(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CITER_ELINKNO_CITER_SHIFT)) & DMA_TCD_CITER_ELINKNO_CITER_MASK) - -#define DMA_TCD_CITER_ELINKNO_ELINK_MASK (0x8000U) -#define DMA_TCD_CITER_ELINKNO_ELINK_SHIFT (15U) -/*! ELINK - Enable Link - * 0b0..Channel-to-channel linking disabled - * 0b1..Channel-to-channel linking enabled - */ -#define DMA_TCD_CITER_ELINKNO_ELINK(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CITER_ELINKNO_ELINK_SHIFT)) & DMA_TCD_CITER_ELINKNO_ELINK_MASK) -/*! @} */ - -/* The count of DMA_TCD_CITER_ELINKNO */ -#define DMA_TCD_CITER_ELINKNO_COUNT (16U) - -/*! @name TCD_CITER_ELINKYES - TCD Current Major Loop Count (Minor Loop Channel Linking Enabled) */ -/*! @{ */ - -#define DMA_TCD_CITER_ELINKYES_CITER_MASK (0x1FFU) -#define DMA_TCD_CITER_ELINKYES_CITER_SHIFT (0U) -/*! CITER - Current Major Iteration Count */ -#define DMA_TCD_CITER_ELINKYES_CITER(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CITER_ELINKYES_CITER_SHIFT)) & DMA_TCD_CITER_ELINKYES_CITER_MASK) - -#define DMA_TCD_CITER_ELINKYES_LINKCH_MASK (0x1E00U) -#define DMA_TCD_CITER_ELINKYES_LINKCH_SHIFT (9U) -/*! LINKCH - Minor Loop Link Channel Number */ -#define DMA_TCD_CITER_ELINKYES_LINKCH(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CITER_ELINKYES_LINKCH_SHIFT)) & DMA_TCD_CITER_ELINKYES_LINKCH_MASK) - -#define DMA_TCD_CITER_ELINKYES_ELINK_MASK (0x8000U) -#define DMA_TCD_CITER_ELINKYES_ELINK_SHIFT (15U) -/*! ELINK - Enable Link - * 0b0..Channel-to-channel linking disabled - * 0b1..Channel-to-channel linking enabled - */ -#define DMA_TCD_CITER_ELINKYES_ELINK(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CITER_ELINKYES_ELINK_SHIFT)) & DMA_TCD_CITER_ELINKYES_ELINK_MASK) -/*! @} */ - -/* The count of DMA_TCD_CITER_ELINKYES */ -#define DMA_TCD_CITER_ELINKYES_COUNT (16U) - -/*! @name TCD_DLAST_SGA - TCD Last Destination Address Adjustment / Scatter Gather Address */ -/*! @{ */ - -#define DMA_TCD_DLAST_SGA_DLAST_SGA_MASK (0xFFFFFFFFU) -#define DMA_TCD_DLAST_SGA_DLAST_SGA_SHIFT (0U) -/*! DLAST_SGA - Last Destination Address Adjustment / Scatter Gather Address */ -#define DMA_TCD_DLAST_SGA_DLAST_SGA(x) (((uint32_t)(((uint32_t)(x)) << DMA_TCD_DLAST_SGA_DLAST_SGA_SHIFT)) & DMA_TCD_DLAST_SGA_DLAST_SGA_MASK) -/*! @} */ - -/* The count of DMA_TCD_DLAST_SGA */ -#define DMA_TCD_DLAST_SGA_COUNT (16U) - -/*! @name TCD_CSR - TCD Control and Status */ -/*! @{ */ - -#define DMA_TCD_CSR_START_MASK (0x1U) -#define DMA_TCD_CSR_START_SHIFT (0U) -/*! START - Channel Start - * 0b0..Channel not explicitly started - * 0b1..Channel explicitly started via a software-initiated service request - */ -#define DMA_TCD_CSR_START(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_START_SHIFT)) & DMA_TCD_CSR_START_MASK) - -#define DMA_TCD_CSR_INTMAJOR_MASK (0x2U) -#define DMA_TCD_CSR_INTMAJOR_SHIFT (1U) -/*! INTMAJOR - Enable Interrupt If Major count complete - * 0b0..End-of-major loop interrupt disabled - * 0b1..End-of-major loop interrupt enabled - */ -#define DMA_TCD_CSR_INTMAJOR(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_INTMAJOR_SHIFT)) & DMA_TCD_CSR_INTMAJOR_MASK) - -#define DMA_TCD_CSR_INTHALF_MASK (0x4U) -#define DMA_TCD_CSR_INTHALF_SHIFT (2U) -/*! INTHALF - Enable Interrupt If Major Counter Half-complete - * 0b0..Halfway point interrupt disabled - * 0b1..Halfway point interrupt enabled - */ -#define DMA_TCD_CSR_INTHALF(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_INTHALF_SHIFT)) & DMA_TCD_CSR_INTHALF_MASK) - -#define DMA_TCD_CSR_DREQ_MASK (0x8U) -#define DMA_TCD_CSR_DREQ_SHIFT (3U) -/*! DREQ - Disable Request - * 0b0..No operation - * 0b1..Clear the ERQ field to 0 upon major loop completion, thus disabling hardware service requests - */ -#define DMA_TCD_CSR_DREQ(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_DREQ_SHIFT)) & DMA_TCD_CSR_DREQ_MASK) - -#define DMA_TCD_CSR_ESG_MASK (0x10U) -#define DMA_TCD_CSR_ESG_SHIFT (4U) -/*! ESG - Enable Scatter/Gather Processing - * 0b0..Current channel's TCD is normal format - * 0b1..Current channel's TCD specifies scatter/gather format. - */ -#define DMA_TCD_CSR_ESG(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_ESG_SHIFT)) & DMA_TCD_CSR_ESG_MASK) - -#define DMA_TCD_CSR_MAJORELINK_MASK (0x20U) -#define DMA_TCD_CSR_MAJORELINK_SHIFT (5U) -/*! MAJORELINK - Enable Link When Major Loop Complete - * 0b0..Channel-to-channel linking disabled - * 0b1..Channel-to-channel linking enabled - */ -#define DMA_TCD_CSR_MAJORELINK(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_MAJORELINK_SHIFT)) & DMA_TCD_CSR_MAJORELINK_MASK) - -#define DMA_TCD_CSR_EEOP_MASK (0x40U) -#define DMA_TCD_CSR_EEOP_SHIFT (6U) -/*! EEOP - Enable End-Of-Packet Processing - * 0b0..End-of-packet operation disabled - * 0b1..End-of-packet hardware input signal enabled - */ -#define DMA_TCD_CSR_EEOP(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_EEOP_SHIFT)) & DMA_TCD_CSR_EEOP_MASK) - -#define DMA_TCD_CSR_ESDA_MASK (0x80U) -#define DMA_TCD_CSR_ESDA_SHIFT (7U) -/*! ESDA - Enable Store Destination Address - * 0b0..Ability to store destination address to system memory disabled - * 0b1..Ability to store destination address to system memory enabled - */ -#define DMA_TCD_CSR_ESDA(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_ESDA_SHIFT)) & DMA_TCD_CSR_ESDA_MASK) - -#define DMA_TCD_CSR_MAJORLINKCH_MASK (0xF00U) -#define DMA_TCD_CSR_MAJORLINKCH_SHIFT (8U) -/*! MAJORLINKCH - Major Loop Link Channel Number */ -#define DMA_TCD_CSR_MAJORLINKCH(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_MAJORLINKCH_SHIFT)) & DMA_TCD_CSR_MAJORLINKCH_MASK) - -#define DMA_TCD_CSR_BWC_MASK (0xC000U) -#define DMA_TCD_CSR_BWC_SHIFT (14U) -/*! BWC - Bandwidth Control - * 0b00..No eDMA engine stalls - * 0b01.. - * 0b10..eDMA engine stalls for 4 cycles after each R/W - * 0b11..eDMA engine stalls for 8 cycles after each R/W - */ -#define DMA_TCD_CSR_BWC(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_CSR_BWC_SHIFT)) & DMA_TCD_CSR_BWC_MASK) -/*! @} */ - -/* The count of DMA_TCD_CSR */ -#define DMA_TCD_CSR_COUNT (16U) - -/*! @name TCD_BITER_ELINKNO - TCD Beginning Major Loop Count (Minor Loop Channel Linking Disabled) */ -/*! @{ */ - -#define DMA_TCD_BITER_ELINKNO_BITER_MASK (0x7FFFU) -#define DMA_TCD_BITER_ELINKNO_BITER_SHIFT (0U) -/*! BITER - Starting Major Iteration Count */ -#define DMA_TCD_BITER_ELINKNO_BITER(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_BITER_ELINKNO_BITER_SHIFT)) & DMA_TCD_BITER_ELINKNO_BITER_MASK) - -#define DMA_TCD_BITER_ELINKNO_ELINK_MASK (0x8000U) -#define DMA_TCD_BITER_ELINKNO_ELINK_SHIFT (15U) -/*! ELINK - Enables Link - * 0b0..Channel-to-channel linking disabled - * 0b1..Channel-to-channel linking enabled - */ -#define DMA_TCD_BITER_ELINKNO_ELINK(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_BITER_ELINKNO_ELINK_SHIFT)) & DMA_TCD_BITER_ELINKNO_ELINK_MASK) -/*! @} */ - -/* The count of DMA_TCD_BITER_ELINKNO */ -#define DMA_TCD_BITER_ELINKNO_COUNT (16U) - -/*! @name TCD_BITER_ELINKYES - TCD Beginning Major Loop Count (Minor Loop Channel Linking Enabled) */ -/*! @{ */ - -#define DMA_TCD_BITER_ELINKYES_BITER_MASK (0x1FFU) -#define DMA_TCD_BITER_ELINKYES_BITER_SHIFT (0U) -/*! BITER - Starting Major Iteration Count */ -#define DMA_TCD_BITER_ELINKYES_BITER(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_BITER_ELINKYES_BITER_SHIFT)) & DMA_TCD_BITER_ELINKYES_BITER_MASK) - -#define DMA_TCD_BITER_ELINKYES_LINKCH_MASK (0x1E00U) -#define DMA_TCD_BITER_ELINKYES_LINKCH_SHIFT (9U) -/*! LINKCH - Link Channel Number */ -#define DMA_TCD_BITER_ELINKYES_LINKCH(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_BITER_ELINKYES_LINKCH_SHIFT)) & DMA_TCD_BITER_ELINKYES_LINKCH_MASK) - -#define DMA_TCD_BITER_ELINKYES_ELINK_MASK (0x8000U) -#define DMA_TCD_BITER_ELINKYES_ELINK_SHIFT (15U) -/*! ELINK - Enable Link - * 0b0..Channel-to-channel linking disabled - * 0b1..Channel-to-channel linking enabled - */ -#define DMA_TCD_BITER_ELINKYES_ELINK(x) (((uint16_t)(((uint16_t)(x)) << DMA_TCD_BITER_ELINKYES_ELINK_SHIFT)) & DMA_TCD_BITER_ELINKYES_ELINK_MASK) -/*! @} */ - -/* The count of DMA_TCD_BITER_ELINKYES */ -#define DMA_TCD_BITER_ELINKYES_COUNT (16U) - - -/*! - * @} - */ /* end of group DMA_Register_Masks */ - - -/* DMA - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral DMA0 base address */ - #define DMA0_BASE (0x50080000u) - /** Peripheral DMA0 base address */ - #define DMA0_BASE_NS (0x40080000u) - /** Peripheral DMA0 base pointer */ - #define DMA0 ((DMA_Type *)DMA0_BASE) - /** Peripheral DMA0 base pointer */ - #define DMA0_NS ((DMA_Type *)DMA0_BASE_NS) - /** Peripheral DMA1 base address */ - #define DMA1_BASE (0x500A0000u) - /** Peripheral DMA1 base address */ - #define DMA1_BASE_NS (0x400A0000u) - /** Peripheral DMA1 base pointer */ - #define DMA1 ((DMA_Type *)DMA1_BASE) - /** Peripheral DMA1 base pointer */ - #define DMA1_NS ((DMA_Type *)DMA1_BASE_NS) - /** Array initializer of DMA peripheral base addresses */ - #define DMA_BASE_ADDRS { DMA0_BASE, DMA1_BASE } - /** Array initializer of DMA peripheral base pointers */ - #define DMA_BASE_PTRS { DMA0, DMA1 } - /** Array initializer of DMA peripheral base addresses */ - #define DMA_BASE_ADDRS_NS { DMA0_BASE_NS, DMA1_BASE_NS } - /** Array initializer of DMA peripheral base pointers */ - #define DMA_BASE_PTRS_NS { DMA0_NS, DMA1_NS } -#else - /** Peripheral DMA0 base address */ - #define DMA0_BASE (0x40080000u) - /** Peripheral DMA0 base pointer */ - #define DMA0 ((DMA_Type *)DMA0_BASE) - /** Peripheral DMA1 base address */ - #define DMA1_BASE (0x400A0000u) - /** Peripheral DMA1 base pointer */ - #define DMA1 ((DMA_Type *)DMA1_BASE) - /** Array initializer of DMA peripheral base addresses */ - #define DMA_BASE_ADDRS { DMA0_BASE, DMA1_BASE } - /** Array initializer of DMA peripheral base pointers */ - #define DMA_BASE_PTRS { DMA0, DMA1 } -#endif -/** Interrupt vectors for the DMA peripheral type */ -#define DMA_IRQS { { EDMA_0_CH0_IRQn, EDMA_0_CH1_IRQn, EDMA_0_CH2_IRQn, EDMA_0_CH3_IRQn, EDMA_0_CH4_IRQn, EDMA_0_CH5_IRQn, EDMA_0_CH6_IRQn, EDMA_0_CH7_IRQn, EDMA_0_CH8_IRQn, EDMA_0_CH9_IRQn, EDMA_0_CH10_IRQn, EDMA_0_CH11_IRQn, EDMA_0_CH12_IRQn, EDMA_0_CH13_IRQn, EDMA_0_CH14_IRQn, EDMA_0_CH15_IRQn }, \ - { EDMA_1_CH0_IRQn, EDMA_1_CH1_IRQn, EDMA_1_CH2_IRQn, EDMA_1_CH3_IRQn, EDMA_1_CH4_IRQn, EDMA_1_CH5_IRQn, EDMA_1_CH6_IRQn, EDMA_1_CH7_IRQn, EDMA_1_CH8_IRQn, EDMA_1_CH9_IRQn, EDMA_1_CH10_IRQn, EDMA_1_CH11_IRQn, EDMA_1_CH12_IRQn, EDMA_1_CH13_IRQn, EDMA_1_CH14_IRQn, EDMA_1_CH15_IRQn } } - -/*! - * @} - */ /* end of group DMA_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- EIM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup EIM_Peripheral_Access_Layer EIM Peripheral Access Layer - * @{ - */ - -/** EIM - Register Layout Typedef */ -typedef struct { - __IO uint32_t EIMCR; /**< Error Injection Module Configuration Register, offset: 0x0 */ - __IO uint32_t EICHEN; /**< Error Injection Channel Enable register, offset: 0x4 */ - uint8_t RESERVED_0[248]; - __IO uint32_t EICHD0_WORD0; /**< Error Injection Channel Descriptor 0, Word0, offset: 0x100 */ - __IO uint32_t EICHD0_WORD1; /**< Error Injection Channel Descriptor 0, Word1, offset: 0x104 */ - uint8_t RESERVED_1[56]; - __IO uint32_t EICHD1_WORD0; /**< Error Injection Channel Descriptor 1, Word0, offset: 0x140 */ - __IO uint32_t EICHD1_WORD1; /**< Error Injection Channel Descriptor 1, Word1, offset: 0x144 */ - uint8_t RESERVED_2[56]; - __IO uint32_t EICHD2_WORD0; /**< Error Injection Channel Descriptor 2, Word0, offset: 0x180 */ - __IO uint32_t EICHD2_WORD1; /**< Error Injection Channel Descriptor 2, Word1, offset: 0x184 */ - uint8_t RESERVED_3[56]; - __IO uint32_t EICHD3_WORD0; /**< Error Injection Channel Descriptor 3, Word0, offset: 0x1C0 */ - __IO uint32_t EICHD3_WORD1; /**< Error Injection Channel Descriptor 3, Word1, offset: 0x1C4 */ - uint8_t RESERVED_4[56]; - __IO uint32_t EICHD4_WORD0; /**< Error Injection Channel Descriptor 4, Word0, offset: 0x200 */ - __IO uint32_t EICHD4_WORD1; /**< Error Injection Channel Descriptor 4, Word1, offset: 0x204 */ - uint8_t RESERVED_5[56]; - __IO uint32_t EICHD5_WORD0; /**< Error Injection Channel Descriptor 5, Word0, offset: 0x240 */ - __IO uint32_t EICHD5_WORD1; /**< Error Injection Channel Descriptor 5, Word1, offset: 0x244 */ - uint8_t RESERVED_6[56]; - __IO uint32_t EICHD6_WORD0; /**< Error Injection Channel Descriptor 6, Word0, offset: 0x280 */ - __IO uint32_t EICHD6_WORD1; /**< Error Injection Channel Descriptor 6, Word1, offset: 0x284 */ - uint8_t RESERVED_7[56]; - __IO uint32_t EICHD7_WORD0; /**< Error Injection Channel Descriptor 7, Word0, offset: 0x2C0 */ - __IO uint32_t EICHD7_WORD1; /**< Error Injection Channel Descriptor 7, Word1, offset: 0x2C4 */ - uint8_t RESERVED_8[56]; - __IO uint32_t EICHD8_WORD0; /**< Error Injection Channel Descriptor 8, Word0, offset: 0x300 */ - __IO uint32_t EICHD8_WORD1; /**< Error Injection Channel Descriptor 8, Word1, offset: 0x304 */ -} EIM_Type; - -/* ---------------------------------------------------------------------------- - -- EIM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup EIM_Register_Masks EIM Register Masks - * @{ - */ - -/*! @name EIMCR - Error Injection Module Configuration Register */ -/*! @{ */ - -#define EIM_EIMCR_GEIEN_MASK (0x1U) -#define EIM_EIMCR_GEIEN_SHIFT (0U) -/*! GEIEN - Global Error Injection Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define EIM_EIMCR_GEIEN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EIMCR_GEIEN_SHIFT)) & EIM_EIMCR_GEIEN_MASK) -/*! @} */ - -/*! @name EICHEN - Error Injection Channel Enable register */ -/*! @{ */ - -#define EIM_EICHEN_EICH8EN_MASK (0x800000U) -#define EIM_EICHEN_EICH8EN_SHIFT (23U) -/*! EICH8EN - Error Injection Channel 8 Enable - * 0b0..Error injection is disabled on Error Injection Channel 8 - * 0b1..Error injection is enabled on Error Injection Channel 8 - */ -#define EIM_EICHEN_EICH8EN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHEN_EICH8EN_SHIFT)) & EIM_EICHEN_EICH8EN_MASK) - -#define EIM_EICHEN_EICH7EN_MASK (0x1000000U) -#define EIM_EICHEN_EICH7EN_SHIFT (24U) -/*! EICH7EN - Error Injection Channel 7 Enable - * 0b0..Error injection is disabled on Error Injection Channel 7 - * 0b1..Error injection is enabled on Error Injection Channel 7 - */ -#define EIM_EICHEN_EICH7EN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHEN_EICH7EN_SHIFT)) & EIM_EICHEN_EICH7EN_MASK) - -#define EIM_EICHEN_EICH6EN_MASK (0x2000000U) -#define EIM_EICHEN_EICH6EN_SHIFT (25U) -/*! EICH6EN - Error Injection Channel 6 Enable - * 0b0..Error injection is disabled on Error Injection Channel 6 - * 0b1..Error injection is enabled on Error Injection Channel 6 - */ -#define EIM_EICHEN_EICH6EN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHEN_EICH6EN_SHIFT)) & EIM_EICHEN_EICH6EN_MASK) - -#define EIM_EICHEN_EICH5EN_MASK (0x4000000U) -#define EIM_EICHEN_EICH5EN_SHIFT (26U) -/*! EICH5EN - Error Injection Channel 5 Enable - * 0b0..Error injection is disabled on Error Injection Channel 5 - * 0b1..Error injection is enabled on Error Injection Channel 5 - */ -#define EIM_EICHEN_EICH5EN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHEN_EICH5EN_SHIFT)) & EIM_EICHEN_EICH5EN_MASK) - -#define EIM_EICHEN_EICH4EN_MASK (0x8000000U) -#define EIM_EICHEN_EICH4EN_SHIFT (27U) -/*! EICH4EN - Error Injection Channel 4 Enable - * 0b0..Error injection is disabled on Error Injection Channel 4 - * 0b1..Error injection is enabled on Error Injection Channel 4 - */ -#define EIM_EICHEN_EICH4EN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHEN_EICH4EN_SHIFT)) & EIM_EICHEN_EICH4EN_MASK) - -#define EIM_EICHEN_EICH3EN_MASK (0x10000000U) -#define EIM_EICHEN_EICH3EN_SHIFT (28U) -/*! EICH3EN - Error Injection Channel 3 Enable - * 0b0..Error injection is disabled on Error Injection Channel 3 - * 0b1..Error injection is enabled on Error Injection Channel 3 - */ -#define EIM_EICHEN_EICH3EN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHEN_EICH3EN_SHIFT)) & EIM_EICHEN_EICH3EN_MASK) - -#define EIM_EICHEN_EICH2EN_MASK (0x20000000U) -#define EIM_EICHEN_EICH2EN_SHIFT (29U) -/*! EICH2EN - Error Injection Channel 2 Enable - * 0b0..Error injection is disabled on Error Injection Channel 2 - * 0b1..Error injection is enabled on Error Injection Channel 2 - */ -#define EIM_EICHEN_EICH2EN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHEN_EICH2EN_SHIFT)) & EIM_EICHEN_EICH2EN_MASK) - -#define EIM_EICHEN_EICH1EN_MASK (0x40000000U) -#define EIM_EICHEN_EICH1EN_SHIFT (30U) -/*! EICH1EN - Error Injection Channel 1 Enable - * 0b0..Error injection is disabled on Error Injection Channel 1 - * 0b1..Error injection is enabled on Error Injection Channel 1 - */ -#define EIM_EICHEN_EICH1EN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHEN_EICH1EN_SHIFT)) & EIM_EICHEN_EICH1EN_MASK) - -#define EIM_EICHEN_EICH0EN_MASK (0x80000000U) -#define EIM_EICHEN_EICH0EN_SHIFT (31U) -/*! EICH0EN - Error Injection Channel 0 Enable - * 0b0..Error injection is disabled on Error Injection Channel 0 - * 0b1..Error injection is enabled on Error Injection Channel 0 - */ -#define EIM_EICHEN_EICH0EN(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHEN_EICH0EN_SHIFT)) & EIM_EICHEN_EICH0EN_MASK) -/*! @} */ - -/*! @name EICHD0_WORD0 - Error Injection Channel Descriptor 0, Word0 */ -/*! @{ */ - -#define EIM_EICHD0_WORD0_CHKBIT_MASK_MASK (0xFE000000U) -#define EIM_EICHD0_WORD0_CHKBIT_MASK_SHIFT (25U) -/*! CHKBIT_MASK - Checkbit Mask */ -#define EIM_EICHD0_WORD0_CHKBIT_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD0_WORD0_CHKBIT_MASK_SHIFT)) & EIM_EICHD0_WORD0_CHKBIT_MASK_MASK) -/*! @} */ - -/*! @name EICHD0_WORD1 - Error Injection Channel Descriptor 0, Word1 */ -/*! @{ */ - -#define EIM_EICHD0_WORD1_B0_3DATA_MASK_MASK (0xFFFFFFFFU) -#define EIM_EICHD0_WORD1_B0_3DATA_MASK_SHIFT (0U) -/*! B0_3DATA_MASK - Data Mask Bytes 0-3 */ -#define EIM_EICHD0_WORD1_B0_3DATA_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD0_WORD1_B0_3DATA_MASK_SHIFT)) & EIM_EICHD0_WORD1_B0_3DATA_MASK_MASK) -/*! @} */ - -/*! @name EICHD1_WORD0 - Error Injection Channel Descriptor 1, Word0 */ -/*! @{ */ - -#define EIM_EICHD1_WORD0_CHKBIT_MASK_MASK (0xFE000000U) -#define EIM_EICHD1_WORD0_CHKBIT_MASK_SHIFT (25U) -/*! CHKBIT_MASK - Checkbit Mask */ -#define EIM_EICHD1_WORD0_CHKBIT_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD1_WORD0_CHKBIT_MASK_SHIFT)) & EIM_EICHD1_WORD0_CHKBIT_MASK_MASK) -/*! @} */ - -/*! @name EICHD1_WORD1 - Error Injection Channel Descriptor 1, Word1 */ -/*! @{ */ - -#define EIM_EICHD1_WORD1_B0_3DATA_MASK_MASK (0xFFFFFFFFU) -#define EIM_EICHD1_WORD1_B0_3DATA_MASK_SHIFT (0U) -/*! B0_3DATA_MASK - Data Mask Bytes 0-3 */ -#define EIM_EICHD1_WORD1_B0_3DATA_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD1_WORD1_B0_3DATA_MASK_SHIFT)) & EIM_EICHD1_WORD1_B0_3DATA_MASK_MASK) -/*! @} */ - -/*! @name EICHD2_WORD0 - Error Injection Channel Descriptor 2, Word0 */ -/*! @{ */ - -#define EIM_EICHD2_WORD0_CHKBIT_MASK_MASK (0xFE000000U) -#define EIM_EICHD2_WORD0_CHKBIT_MASK_SHIFT (25U) -/*! CHKBIT_MASK - Checkbit Mask */ -#define EIM_EICHD2_WORD0_CHKBIT_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD2_WORD0_CHKBIT_MASK_SHIFT)) & EIM_EICHD2_WORD0_CHKBIT_MASK_MASK) -/*! @} */ - -/*! @name EICHD2_WORD1 - Error Injection Channel Descriptor 2, Word1 */ -/*! @{ */ - -#define EIM_EICHD2_WORD1_B0_3DATA_MASK_MASK (0xFFFFFFFFU) -#define EIM_EICHD2_WORD1_B0_3DATA_MASK_SHIFT (0U) -/*! B0_3DATA_MASK - Data Mask Bytes 0-3 */ -#define EIM_EICHD2_WORD1_B0_3DATA_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD2_WORD1_B0_3DATA_MASK_SHIFT)) & EIM_EICHD2_WORD1_B0_3DATA_MASK_MASK) -/*! @} */ - -/*! @name EICHD3_WORD0 - Error Injection Channel Descriptor 3, Word0 */ -/*! @{ */ - -#define EIM_EICHD3_WORD0_CHKBIT_MASK_MASK (0xFE000000U) -#define EIM_EICHD3_WORD0_CHKBIT_MASK_SHIFT (25U) -/*! CHKBIT_MASK - Checkbit Mask */ -#define EIM_EICHD3_WORD0_CHKBIT_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD3_WORD0_CHKBIT_MASK_SHIFT)) & EIM_EICHD3_WORD0_CHKBIT_MASK_MASK) -/*! @} */ - -/*! @name EICHD3_WORD1 - Error Injection Channel Descriptor 3, Word1 */ -/*! @{ */ - -#define EIM_EICHD3_WORD1_B0_3DATA_MASK_MASK (0xFFFFFFFFU) -#define EIM_EICHD3_WORD1_B0_3DATA_MASK_SHIFT (0U) -/*! B0_3DATA_MASK - Data Mask Bytes 0-3 */ -#define EIM_EICHD3_WORD1_B0_3DATA_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD3_WORD1_B0_3DATA_MASK_SHIFT)) & EIM_EICHD3_WORD1_B0_3DATA_MASK_MASK) -/*! @} */ - -/*! @name EICHD4_WORD0 - Error Injection Channel Descriptor 4, Word0 */ -/*! @{ */ - -#define EIM_EICHD4_WORD0_CHKBIT_MASK_MASK (0xFE000000U) -#define EIM_EICHD4_WORD0_CHKBIT_MASK_SHIFT (25U) -/*! CHKBIT_MASK - Checkbit Mask */ -#define EIM_EICHD4_WORD0_CHKBIT_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD4_WORD0_CHKBIT_MASK_SHIFT)) & EIM_EICHD4_WORD0_CHKBIT_MASK_MASK) -/*! @} */ - -/*! @name EICHD4_WORD1 - Error Injection Channel Descriptor 4, Word1 */ -/*! @{ */ - -#define EIM_EICHD4_WORD1_B0_3DATA_MASK_MASK (0xFFFFFFFFU) -#define EIM_EICHD4_WORD1_B0_3DATA_MASK_SHIFT (0U) -/*! B0_3DATA_MASK - Data Mask Bytes 0-3 */ -#define EIM_EICHD4_WORD1_B0_3DATA_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD4_WORD1_B0_3DATA_MASK_SHIFT)) & EIM_EICHD4_WORD1_B0_3DATA_MASK_MASK) -/*! @} */ - -/*! @name EICHD5_WORD0 - Error Injection Channel Descriptor 5, Word0 */ -/*! @{ */ - -#define EIM_EICHD5_WORD0_CHKBIT_MASK_MASK (0xFE000000U) -#define EIM_EICHD5_WORD0_CHKBIT_MASK_SHIFT (25U) -/*! CHKBIT_MASK - Checkbit Mask */ -#define EIM_EICHD5_WORD0_CHKBIT_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD5_WORD0_CHKBIT_MASK_SHIFT)) & EIM_EICHD5_WORD0_CHKBIT_MASK_MASK) -/*! @} */ - -/*! @name EICHD5_WORD1 - Error Injection Channel Descriptor 5, Word1 */ -/*! @{ */ - -#define EIM_EICHD5_WORD1_B0_3DATA_MASK_MASK (0xFFFFFFFFU) -#define EIM_EICHD5_WORD1_B0_3DATA_MASK_SHIFT (0U) -/*! B0_3DATA_MASK - Data Mask Bytes 0-3 */ -#define EIM_EICHD5_WORD1_B0_3DATA_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD5_WORD1_B0_3DATA_MASK_SHIFT)) & EIM_EICHD5_WORD1_B0_3DATA_MASK_MASK) -/*! @} */ - -/*! @name EICHD6_WORD0 - Error Injection Channel Descriptor 6, Word0 */ -/*! @{ */ - -#define EIM_EICHD6_WORD0_CHKBIT_MASK_MASK (0xFE000000U) -#define EIM_EICHD6_WORD0_CHKBIT_MASK_SHIFT (25U) -/*! CHKBIT_MASK - Checkbit Mask */ -#define EIM_EICHD6_WORD0_CHKBIT_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD6_WORD0_CHKBIT_MASK_SHIFT)) & EIM_EICHD6_WORD0_CHKBIT_MASK_MASK) -/*! @} */ - -/*! @name EICHD6_WORD1 - Error Injection Channel Descriptor 6, Word1 */ -/*! @{ */ - -#define EIM_EICHD6_WORD1_B0_3DATA_MASK_MASK (0xFFFFFFFFU) -#define EIM_EICHD6_WORD1_B0_3DATA_MASK_SHIFT (0U) -/*! B0_3DATA_MASK - Data Mask Bytes 0-3 */ -#define EIM_EICHD6_WORD1_B0_3DATA_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD6_WORD1_B0_3DATA_MASK_SHIFT)) & EIM_EICHD6_WORD1_B0_3DATA_MASK_MASK) -/*! @} */ - -/*! @name EICHD7_WORD0 - Error Injection Channel Descriptor 7, Word0 */ -/*! @{ */ - -#define EIM_EICHD7_WORD0_CHKBIT_MASK_MASK (0x80000000U) -#define EIM_EICHD7_WORD0_CHKBIT_MASK_SHIFT (31U) -/*! CHKBIT_MASK - Checkbit Mask */ -#define EIM_EICHD7_WORD0_CHKBIT_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD7_WORD0_CHKBIT_MASK_SHIFT)) & EIM_EICHD7_WORD0_CHKBIT_MASK_MASK) -/*! @} */ - -/*! @name EICHD7_WORD1 - Error Injection Channel Descriptor 7, Word1 */ -/*! @{ */ - -#define EIM_EICHD7_WORD1_B0_3DATA_MASK_MASK (0xFFFFFFFFU) -#define EIM_EICHD7_WORD1_B0_3DATA_MASK_SHIFT (0U) -/*! B0_3DATA_MASK - Data Mask Bytes 0-3 */ -#define EIM_EICHD7_WORD1_B0_3DATA_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD7_WORD1_B0_3DATA_MASK_SHIFT)) & EIM_EICHD7_WORD1_B0_3DATA_MASK_MASK) -/*! @} */ - -/*! @name EICHD8_WORD0 - Error Injection Channel Descriptor 8, Word0 */ -/*! @{ */ - -#define EIM_EICHD8_WORD0_CHKBIT_MASK_MASK (0xF0000000U) -#define EIM_EICHD8_WORD0_CHKBIT_MASK_SHIFT (28U) -/*! CHKBIT_MASK - Checkbit Mask */ -#define EIM_EICHD8_WORD0_CHKBIT_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD8_WORD0_CHKBIT_MASK_SHIFT)) & EIM_EICHD8_WORD0_CHKBIT_MASK_MASK) -/*! @} */ - -/*! @name EICHD8_WORD1 - Error Injection Channel Descriptor 8, Word1 */ -/*! @{ */ - -#define EIM_EICHD8_WORD1_B0_3DATA_MASK_MASK (0xFFFFFFFFU) -#define EIM_EICHD8_WORD1_B0_3DATA_MASK_SHIFT (0U) -/*! B0_3DATA_MASK - Data Mask Bytes 0-3 */ -#define EIM_EICHD8_WORD1_B0_3DATA_MASK(x) (((uint32_t)(((uint32_t)(x)) << EIM_EICHD8_WORD1_B0_3DATA_MASK_SHIFT)) & EIM_EICHD8_WORD1_B0_3DATA_MASK_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group EIM_Register_Masks */ - - -/* EIM - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral EIM0 base address */ - #define EIM0_BASE (0x5005B000u) - /** Peripheral EIM0 base address */ - #define EIM0_BASE_NS (0x4005B000u) - /** Peripheral EIM0 base pointer */ - #define EIM0 ((EIM_Type *)EIM0_BASE) - /** Peripheral EIM0 base pointer */ - #define EIM0_NS ((EIM_Type *)EIM0_BASE_NS) - /** Array initializer of EIM peripheral base addresses */ - #define EIM_BASE_ADDRS { EIM0_BASE } - /** Array initializer of EIM peripheral base pointers */ - #define EIM_BASE_PTRS { EIM0 } - /** Array initializer of EIM peripheral base addresses */ - #define EIM_BASE_ADDRS_NS { EIM0_BASE_NS } - /** Array initializer of EIM peripheral base pointers */ - #define EIM_BASE_PTRS_NS { EIM0_NS } -#else - /** Peripheral EIM0 base address */ - #define EIM0_BASE (0x4005B000u) - /** Peripheral EIM0 base pointer */ - #define EIM0 ((EIM_Type *)EIM0_BASE) - /** Array initializer of EIM peripheral base addresses */ - #define EIM_BASE_ADDRS { EIM0_BASE } - /** Array initializer of EIM peripheral base pointers */ - #define EIM_BASE_PTRS { EIM0 } -#endif - -/*! - * @} - */ /* end of group EIM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- EMVSIM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup EMVSIM_Peripheral_Access_Layer EMVSIM Peripheral Access Layer - * @{ - */ - -/** EMVSIM - Register Layout Typedef */ -typedef struct { - __I uint32_t VER_ID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameters, offset: 0x4 */ - __IO uint32_t CLKCFG; /**< Clock Configuration, offset: 0x8 */ - __IO uint32_t DIVISOR; /**< Baud Rate Divisor, offset: 0xC */ - __IO uint32_t CTRL; /**< Control, offset: 0x10 */ - __IO uint32_t INT_MASK; /**< Interrupt Mask, offset: 0x14 */ - __IO uint32_t RX_THD; /**< Receiver Threshold, offset: 0x18 */ - __IO uint32_t TX_THD; /**< Transmitter Threshold, offset: 0x1C */ - __IO uint32_t RX_STATUS; /**< Receive Status, offset: 0x20 */ - __IO uint32_t TX_STATUS; /**< Transmitter Status, offset: 0x24 */ - __IO uint32_t PCSR; /**< Port Control and Status, offset: 0x28 */ - __I uint32_t RX_BUF; /**< Receive Data Read Buffer, offset: 0x2C */ - __O uint32_t TX_BUF; /**< Transmit Data Buffer, offset: 0x30 */ - __IO uint32_t TX_GETU; /**< Transmitter Guard ETU Value, offset: 0x34 */ - __IO uint32_t CWT_VAL; /**< Character Wait Time Value, offset: 0x38 */ - __IO uint32_t BWT_VAL; /**< Block Wait Time Value, offset: 0x3C */ - __IO uint32_t BGT_VAL; /**< Block Guard Time Value, offset: 0x40 */ - __IO uint32_t GPCNT0_VAL; /**< General Purpose Counter 0 Timeout Value, offset: 0x44 */ - __IO uint32_t GPCNT1_VAL; /**< General Purpose Counter 1 Timeout Value, offset: 0x48 */ -} EMVSIM_Type; - -/* ---------------------------------------------------------------------------- - -- EMVSIM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup EMVSIM_Register_Masks EMVSIM Register Masks - * @{ - */ - -/*! @name VER_ID - Version ID */ -/*! @{ */ - -#define EMVSIM_VER_ID_VER_MASK (0xFFFFFFFFU) -#define EMVSIM_VER_ID_VER_SHIFT (0U) -/*! VER - Version ID */ -#define EMVSIM_VER_ID_VER(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_VER_ID_VER_SHIFT)) & EMVSIM_VER_ID_VER_MASK) -/*! @} */ - -/*! @name PARAM - Parameters */ -/*! @{ */ - -#define EMVSIM_PARAM_RX_FIFO_DEPTH_MASK (0xFFU) -#define EMVSIM_PARAM_RX_FIFO_DEPTH_SHIFT (0U) -/*! RX_FIFO_DEPTH - Receive FIFO Depth */ -#define EMVSIM_PARAM_RX_FIFO_DEPTH(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_PARAM_RX_FIFO_DEPTH_SHIFT)) & EMVSIM_PARAM_RX_FIFO_DEPTH_MASK) - -#define EMVSIM_PARAM_TX_FIFO_DEPTH_MASK (0xFF00U) -#define EMVSIM_PARAM_TX_FIFO_DEPTH_SHIFT (8U) -/*! TX_FIFO_DEPTH - Transmit FIFO Depth */ -#define EMVSIM_PARAM_TX_FIFO_DEPTH(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_PARAM_TX_FIFO_DEPTH_SHIFT)) & EMVSIM_PARAM_TX_FIFO_DEPTH_MASK) -/*! @} */ - -/*! @name CLKCFG - Clock Configuration */ -/*! @{ */ - -#define EMVSIM_CLKCFG_CLK_PRSC_MASK (0xFFU) -#define EMVSIM_CLKCFG_CLK_PRSC_SHIFT (0U) -/*! CLK_PRSC - Clock Prescaler Value */ -#define EMVSIM_CLKCFG_CLK_PRSC(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CLKCFG_CLK_PRSC_SHIFT)) & EMVSIM_CLKCFG_CLK_PRSC_MASK) - -#define EMVSIM_CLKCFG_GPCNT1_CLK_SEL_MASK (0x300U) -#define EMVSIM_CLKCFG_GPCNT1_CLK_SEL_SHIFT (8U) -/*! GPCNT1_CLK_SEL - General Purpose Counter 1 Clock Select - * 0b00..Disable/reset - * 0b01..Card clock - * 0b10..Receive clock - * 0b11..ETU clock (transmit clock) - */ -#define EMVSIM_CLKCFG_GPCNT1_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CLKCFG_GPCNT1_CLK_SEL_SHIFT)) & EMVSIM_CLKCFG_GPCNT1_CLK_SEL_MASK) - -#define EMVSIM_CLKCFG_GPCNT0_CLK_SEL_MASK (0xC00U) -#define EMVSIM_CLKCFG_GPCNT0_CLK_SEL_SHIFT (10U) -/*! GPCNT0_CLK_SEL - General Purpose Counter 0 Clock Select - * 0b00..Disable/reset - * 0b01..Card clock - * 0b10..Receive clock - * 0b11..ETU clock (transmit clock) - */ -#define EMVSIM_CLKCFG_GPCNT0_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CLKCFG_GPCNT0_CLK_SEL_SHIFT)) & EMVSIM_CLKCFG_GPCNT0_CLK_SEL_MASK) -/*! @} */ - -/*! @name DIVISOR - Baud Rate Divisor */ -/*! @{ */ - -#define EMVSIM_DIVISOR_DIVISOR_VALUE_MASK (0x1FFU) -#define EMVSIM_DIVISOR_DIVISOR_VALUE_SHIFT (0U) -/*! DIVISOR_VALUE - Divisor (F/D) Value - * 0b000000000-0b000000100..Invalid. As per ISO 7816 specification, the minimum value of F/D is 5. - * 0b000000101-0b011111111..Divisor value F/D - */ -#define EMVSIM_DIVISOR_DIVISOR_VALUE(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_DIVISOR_DIVISOR_VALUE_SHIFT)) & EMVSIM_DIVISOR_DIVISOR_VALUE_MASK) -/*! @} */ - -/*! @name CTRL - Control */ -/*! @{ */ - -#define EMVSIM_CTRL_IC_MASK (0x1U) -#define EMVSIM_CTRL_IC_SHIFT (0U) -/*! IC - Inverse Convention - * 0b0..Direct - * 0b1..Inverse - */ -#define EMVSIM_CTRL_IC(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_IC_SHIFT)) & EMVSIM_CTRL_IC_MASK) - -#define EMVSIM_CTRL_ICM_MASK (0x2U) -#define EMVSIM_CTRL_ICM_SHIFT (1U) -/*! ICM - Initial Character Mode - * 0b0..Disable - * 0b1..Enable - */ -#define EMVSIM_CTRL_ICM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_ICM_SHIFT)) & EMVSIM_CTRL_ICM_MASK) - -#define EMVSIM_CTRL_ANACK_MASK (0x4U) -#define EMVSIM_CTRL_ANACK_SHIFT (2U) -/*! ANACK - Auto NACK Enable - * 0b0..Disable - * 0b1..Enable - */ -#define EMVSIM_CTRL_ANACK(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_ANACK_SHIFT)) & EMVSIM_CTRL_ANACK_MASK) - -#define EMVSIM_CTRL_ONACK_MASK (0x8U) -#define EMVSIM_CTRL_ONACK_SHIFT (3U) -/*! ONACK - Overrun NACK Enable - * 0b0..Disable - * 0b1..Enable - */ -#define EMVSIM_CTRL_ONACK(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_ONACK_SHIFT)) & EMVSIM_CTRL_ONACK_MASK) - -#define EMVSIM_CTRL_FLSH_RX_MASK (0x100U) -#define EMVSIM_CTRL_FLSH_RX_SHIFT (8U) -/*! FLSH_RX - Flush Receiver - * 0b0..Normal - * 0b1..Reset - */ -#define EMVSIM_CTRL_FLSH_RX(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_FLSH_RX_SHIFT)) & EMVSIM_CTRL_FLSH_RX_MASK) - -#define EMVSIM_CTRL_FLSH_TX_MASK (0x200U) -#define EMVSIM_CTRL_FLSH_TX_SHIFT (9U) -/*! FLSH_TX - Flush Transmitter - * 0b0..Normal - * 0b1..Reset - */ -#define EMVSIM_CTRL_FLSH_TX(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_FLSH_TX_SHIFT)) & EMVSIM_CTRL_FLSH_TX_MASK) - -#define EMVSIM_CTRL_SW_RST_MASK (0x400U) -#define EMVSIM_CTRL_SW_RST_SHIFT (10U) -/*! SW_RST - Software Reset - * 0b0..Normal - * 0b1..Reset - */ -#define EMVSIM_CTRL_SW_RST(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_SW_RST_SHIFT)) & EMVSIM_CTRL_SW_RST_MASK) - -#define EMVSIM_CTRL_KILL_CLOCKS_MASK (0x800U) -#define EMVSIM_CTRL_KILL_CLOCKS_SHIFT (11U) -/*! KILL_CLOCKS - Kill Internal Clocks - * 0b0..Enable - * 0b1..Disable - */ -#define EMVSIM_CTRL_KILL_CLOCKS(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_KILL_CLOCKS_SHIFT)) & EMVSIM_CTRL_KILL_CLOCKS_MASK) - -#define EMVSIM_CTRL_DOZE_EN_MASK (0x1000U) -#define EMVSIM_CTRL_DOZE_EN_SHIFT (12U) -/*! DOZE_EN - Doze Enable - * 0b0..Disable - * 0b1..Enable - */ -#define EMVSIM_CTRL_DOZE_EN(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_DOZE_EN_SHIFT)) & EMVSIM_CTRL_DOZE_EN_MASK) - -#define EMVSIM_CTRL_STOP_EN_MASK (0x2000U) -#define EMVSIM_CTRL_STOP_EN_SHIFT (13U) -/*! STOP_EN - STOP Enable - * 0b0..Disable - * 0b1..Enable - */ -#define EMVSIM_CTRL_STOP_EN(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_STOP_EN_SHIFT)) & EMVSIM_CTRL_STOP_EN_MASK) - -#define EMVSIM_CTRL_RCV_EN_MASK (0x10000U) -#define EMVSIM_CTRL_RCV_EN_SHIFT (16U) -/*! RCV_EN - Receiver Enable - * 0b0..Disable - * 0b1..Enable - */ -#define EMVSIM_CTRL_RCV_EN(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_RCV_EN_SHIFT)) & EMVSIM_CTRL_RCV_EN_MASK) - -#define EMVSIM_CTRL_XMT_EN_MASK (0x20000U) -#define EMVSIM_CTRL_XMT_EN_SHIFT (17U) -/*! XMT_EN - Transmitter Enable - * 0b0..Disable - * 0b1..Enable - */ -#define EMVSIM_CTRL_XMT_EN(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_XMT_EN_SHIFT)) & EMVSIM_CTRL_XMT_EN_MASK) - -#define EMVSIM_CTRL_RCVR_11_MASK (0x40000U) -#define EMVSIM_CTRL_RCVR_11_SHIFT (18U) -/*! RCVR_11 - Receiver 11 ETU Mode Enable - * 0b0..12 ETU operation - * 0b1..11 ETU operation - */ -#define EMVSIM_CTRL_RCVR_11(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_RCVR_11_SHIFT)) & EMVSIM_CTRL_RCVR_11_MASK) - -#define EMVSIM_CTRL_RX_DMA_EN_MASK (0x80000U) -#define EMVSIM_CTRL_RX_DMA_EN_SHIFT (19U) -/*! RX_DMA_EN - Receive DMA Enable - * 0b0..Not asserted - * 0b1..Asserted - */ -#define EMVSIM_CTRL_RX_DMA_EN(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_RX_DMA_EN_SHIFT)) & EMVSIM_CTRL_RX_DMA_EN_MASK) - -#define EMVSIM_CTRL_TX_DMA_EN_MASK (0x100000U) -#define EMVSIM_CTRL_TX_DMA_EN_SHIFT (20U) -/*! TX_DMA_EN - Transmit DMA Enable - * 0b0..Not asserted - * 0b1..Asserted - */ -#define EMVSIM_CTRL_TX_DMA_EN(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_TX_DMA_EN_SHIFT)) & EMVSIM_CTRL_TX_DMA_EN_MASK) - -#define EMVSIM_CTRL_INV_CRC_VAL_MASK (0x1000000U) -#define EMVSIM_CTRL_INV_CRC_VAL_SHIFT (24U) -/*! INV_CRC_VAL - Invert CRC Output Value Bits - * 0b0..Not inverted - * 0b1..Inverted - */ -#define EMVSIM_CTRL_INV_CRC_VAL(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_INV_CRC_VAL_SHIFT)) & EMVSIM_CTRL_INV_CRC_VAL_MASK) - -#define EMVSIM_CTRL_CRC_OUT_FLIP_MASK (0x2000000U) -#define EMVSIM_CTRL_CRC_OUT_FLIP_SHIFT (25U) -/*! CRC_OUT_FLIP - CRC Output Value Bit Reversal Or Flip Control - * 0b0..Not reversed - * 0b1..Reversed - */ -#define EMVSIM_CTRL_CRC_OUT_FLIP(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_CRC_OUT_FLIP_SHIFT)) & EMVSIM_CTRL_CRC_OUT_FLIP_MASK) - -#define EMVSIM_CTRL_CRC_IN_FLIP_MASK (0x4000000U) -#define EMVSIM_CTRL_CRC_IN_FLIP_SHIFT (26U) -/*! CRC_IN_FLIP - CRC Input Byte's Bit Reversal Or Flip Control - * 0b0..Not reversed - * 0b1..Reversed - */ -#define EMVSIM_CTRL_CRC_IN_FLIP(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_CRC_IN_FLIP_SHIFT)) & EMVSIM_CTRL_CRC_IN_FLIP_MASK) - -#define EMVSIM_CTRL_CWT_EN_MASK (0x8000000U) -#define EMVSIM_CTRL_CWT_EN_SHIFT (27U) -/*! CWT_EN - CWT Counter Enable - * 0b0..Disable - * 0b1..Enable - */ -#define EMVSIM_CTRL_CWT_EN(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_CWT_EN_SHIFT)) & EMVSIM_CTRL_CWT_EN_MASK) - -#define EMVSIM_CTRL_LRC_EN_MASK (0x10000000U) -#define EMVSIM_CTRL_LRC_EN_SHIFT (28U) -/*! LRC_EN - LRC Enable - * 0b0..Disable - * 0b1..Enable - */ -#define EMVSIM_CTRL_LRC_EN(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_LRC_EN_SHIFT)) & EMVSIM_CTRL_LRC_EN_MASK) - -#define EMVSIM_CTRL_CRC_EN_MASK (0x20000000U) -#define EMVSIM_CTRL_CRC_EN_SHIFT (29U) -/*! CRC_EN - CRC Enable - * 0b0..Disable - * 0b1..Enable - */ -#define EMVSIM_CTRL_CRC_EN(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_CRC_EN_SHIFT)) & EMVSIM_CTRL_CRC_EN_MASK) - -#define EMVSIM_CTRL_XMT_CRC_LRC_MASK (0x40000000U) -#define EMVSIM_CTRL_XMT_CRC_LRC_SHIFT (30U) -/*! XMT_CRC_LRC - Transmit CRC or LRC Enable - * 0b0..Do not transmit - * 0b1..Transmit - */ -#define EMVSIM_CTRL_XMT_CRC_LRC(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_XMT_CRC_LRC_SHIFT)) & EMVSIM_CTRL_XMT_CRC_LRC_MASK) - -#define EMVSIM_CTRL_BWT_EN_MASK (0x80000000U) -#define EMVSIM_CTRL_BWT_EN_SHIFT (31U) -/*! BWT_EN - Block Wait Time Counter Enable - * 0b0..Disable - * 0b1..Enable - */ -#define EMVSIM_CTRL_BWT_EN(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CTRL_BWT_EN_SHIFT)) & EMVSIM_CTRL_BWT_EN_MASK) -/*! @} */ - -/*! @name INT_MASK - Interrupt Mask */ -/*! @{ */ - -#define EMVSIM_INT_MASK_RDT_IM_MASK (0x1U) -#define EMVSIM_INT_MASK_RDT_IM_SHIFT (0U) -/*! RDT_IM - Receive Data Threshold Interrupt Mask - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_RDT_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_RDT_IM_SHIFT)) & EMVSIM_INT_MASK_RDT_IM_MASK) - -#define EMVSIM_INT_MASK_TC_IM_MASK (0x2U) -#define EMVSIM_INT_MASK_TC_IM_SHIFT (1U) -/*! TC_IM - Transmit Complete Interrupt Mask - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_TC_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_TC_IM_SHIFT)) & EMVSIM_INT_MASK_TC_IM_MASK) - -#define EMVSIM_INT_MASK_RFO_IM_MASK (0x4U) -#define EMVSIM_INT_MASK_RFO_IM_SHIFT (2U) -/*! RFO_IM - Receive FIFO Overflow Interrupt Mask - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_RFO_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_RFO_IM_SHIFT)) & EMVSIM_INT_MASK_RFO_IM_MASK) - -#define EMVSIM_INT_MASK_ETC_IM_MASK (0x8U) -#define EMVSIM_INT_MASK_ETC_IM_SHIFT (3U) -/*! ETC_IM - Early Transmit Complete Interrupt Mask - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_ETC_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_ETC_IM_SHIFT)) & EMVSIM_INT_MASK_ETC_IM_MASK) - -#define EMVSIM_INT_MASK_TFE_IM_MASK (0x10U) -#define EMVSIM_INT_MASK_TFE_IM_SHIFT (4U) -/*! TFE_IM - Transmit FIFO Empty Interrupt Mask - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_TFE_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_TFE_IM_SHIFT)) & EMVSIM_INT_MASK_TFE_IM_MASK) - -#define EMVSIM_INT_MASK_TNACK_IM_MASK (0x20U) -#define EMVSIM_INT_MASK_TNACK_IM_SHIFT (5U) -/*! TNACK_IM - Transmit NACK Threshold Interrupt Mask - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_TNACK_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_TNACK_IM_SHIFT)) & EMVSIM_INT_MASK_TNACK_IM_MASK) - -#define EMVSIM_INT_MASK_TFF_IM_MASK (0x40U) -#define EMVSIM_INT_MASK_TFF_IM_SHIFT (6U) -/*! TFF_IM - Transmit FIFO Full Interrupt Mask - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_TFF_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_TFF_IM_SHIFT)) & EMVSIM_INT_MASK_TFF_IM_MASK) - -#define EMVSIM_INT_MASK_TDT_IM_MASK (0x80U) -#define EMVSIM_INT_MASK_TDT_IM_SHIFT (7U) -/*! TDT_IM - Transmit Data Threshold Interrupt Mask - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_TDT_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_TDT_IM_SHIFT)) & EMVSIM_INT_MASK_TDT_IM_MASK) - -#define EMVSIM_INT_MASK_GPCNT0_IM_MASK (0x100U) -#define EMVSIM_INT_MASK_GPCNT0_IM_SHIFT (8U) -/*! GPCNT0_IM - General Purpose Timer 0 Timeout Interrupt Mask - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_GPCNT0_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_GPCNT0_IM_SHIFT)) & EMVSIM_INT_MASK_GPCNT0_IM_MASK) - -#define EMVSIM_INT_MASK_CWT_ERR_IM_MASK (0x200U) -#define EMVSIM_INT_MASK_CWT_ERR_IM_SHIFT (9U) -/*! CWT_ERR_IM - Character Wait Time Error Interrupt Mask - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_CWT_ERR_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_CWT_ERR_IM_SHIFT)) & EMVSIM_INT_MASK_CWT_ERR_IM_MASK) - -#define EMVSIM_INT_MASK_RNACK_IM_MASK (0x400U) -#define EMVSIM_INT_MASK_RNACK_IM_SHIFT (10U) -/*! RNACK_IM - Receiver NACK Threshold Interrupt Mask - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_RNACK_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_RNACK_IM_SHIFT)) & EMVSIM_INT_MASK_RNACK_IM_MASK) - -#define EMVSIM_INT_MASK_BWT_ERR_IM_MASK (0x800U) -#define EMVSIM_INT_MASK_BWT_ERR_IM_SHIFT (11U) -/*! BWT_ERR_IM - Block Wait Time Error Interrupt Mask - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_BWT_ERR_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_BWT_ERR_IM_SHIFT)) & EMVSIM_INT_MASK_BWT_ERR_IM_MASK) - -#define EMVSIM_INT_MASK_BGT_ERR_IM_MASK (0x1000U) -#define EMVSIM_INT_MASK_BGT_ERR_IM_SHIFT (12U) -/*! BGT_ERR_IM - Block Guard Time Error Interrupt - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_BGT_ERR_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_BGT_ERR_IM_SHIFT)) & EMVSIM_INT_MASK_BGT_ERR_IM_MASK) - -#define EMVSIM_INT_MASK_GPCNT1_IM_MASK (0x2000U) -#define EMVSIM_INT_MASK_GPCNT1_IM_SHIFT (13U) -/*! GPCNT1_IM - General Purpose Counter 1 Timeout Interrupt Mask - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_GPCNT1_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_GPCNT1_IM_SHIFT)) & EMVSIM_INT_MASK_GPCNT1_IM_MASK) - -#define EMVSIM_INT_MASK_RX_DATA_IM_MASK (0x4000U) -#define EMVSIM_INT_MASK_RX_DATA_IM_SHIFT (14U) -/*! RX_DATA_IM - Receive Data Interrupt Mask - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_RX_DATA_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_RX_DATA_IM_SHIFT)) & EMVSIM_INT_MASK_RX_DATA_IM_MASK) - -#define EMVSIM_INT_MASK_PEF_IM_MASK (0x8000U) -#define EMVSIM_INT_MASK_PEF_IM_SHIFT (15U) -/*! PEF_IM - Parity Error Interrupt Mask - * 0b0..Enable - * 0b1..Masked - */ -#define EMVSIM_INT_MASK_PEF_IM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_INT_MASK_PEF_IM_SHIFT)) & EMVSIM_INT_MASK_PEF_IM_MASK) -/*! @} */ - -/*! @name RX_THD - Receiver Threshold */ -/*! @{ */ - -#define EMVSIM_RX_THD_RDT_MASK (0xFU) -#define EMVSIM_RX_THD_RDT_SHIFT (0U) -/*! RDT - Receiver Data Threshold Value */ -#define EMVSIM_RX_THD_RDT(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_THD_RDT_SHIFT)) & EMVSIM_RX_THD_RDT_MASK) - -#define EMVSIM_RX_THD_RNCK_THD_MASK (0xF00U) -#define EMVSIM_RX_THD_RNCK_THD_SHIFT (8U) -/*! RNCK_THD - Receiver NACK Threshold Value */ -#define EMVSIM_RX_THD_RNCK_THD(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_THD_RNCK_THD_SHIFT)) & EMVSIM_RX_THD_RNCK_THD_MASK) -/*! @} */ - -/*! @name TX_THD - Transmitter Threshold */ -/*! @{ */ - -#define EMVSIM_TX_THD_TDT_MASK (0xFU) -#define EMVSIM_TX_THD_TDT_SHIFT (0U) -/*! TDT - Transmitter Data Threshold Value */ -#define EMVSIM_TX_THD_TDT(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_TX_THD_TDT_SHIFT)) & EMVSIM_TX_THD_TDT_MASK) - -#define EMVSIM_TX_THD_TNCK_THD_MASK (0xF00U) -#define EMVSIM_TX_THD_TNCK_THD_SHIFT (8U) -/*! TNCK_THD - Transmitter NACK Threshold Value */ -#define EMVSIM_TX_THD_TNCK_THD(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_TX_THD_TNCK_THD_SHIFT)) & EMVSIM_TX_THD_TNCK_THD_MASK) -/*! @} */ - -/*! @name RX_STATUS - Receive Status */ -/*! @{ */ - -#define EMVSIM_RX_STATUS_RFO_MASK (0x1U) -#define EMVSIM_RX_STATUS_RFO_SHIFT (0U) -/*! RFO - Receive FIFO Overflow Flag - * 0b0..No overrun error - * 0b1..Overrun error - */ -#define EMVSIM_RX_STATUS_RFO(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_STATUS_RFO_SHIFT)) & EMVSIM_RX_STATUS_RFO_MASK) - -#define EMVSIM_RX_STATUS_RX_DATA_MASK (0x10U) -#define EMVSIM_RX_STATUS_RX_DATA_SHIFT (4U) -/*! RX_DATA - Receive Data Interrupt Flag - * 0b0..No new byte - * 0b1..New byte - */ -#define EMVSIM_RX_STATUS_RX_DATA(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_STATUS_RX_DATA_SHIFT)) & EMVSIM_RX_STATUS_RX_DATA_MASK) - -#define EMVSIM_RX_STATUS_RDTF_MASK (0x20U) -#define EMVSIM_RX_STATUS_RDTF_SHIFT (5U) -/*! RDTF - Receive Data Threshold Interrupt Flag - * 0b0..Less than threshold - * 0b1..Greater than or equal to threshold - */ -#define EMVSIM_RX_STATUS_RDTF(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_STATUS_RDTF_SHIFT)) & EMVSIM_RX_STATUS_RDTF_MASK) - -#define EMVSIM_RX_STATUS_LRC_OK_MASK (0x40U) -#define EMVSIM_RX_STATUS_LRC_OK_SHIFT (6U) -/*! LRC_OK - LRC Check OK Flag - * 0b0..No match - * 0b1..Match - */ -#define EMVSIM_RX_STATUS_LRC_OK(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_STATUS_LRC_OK_SHIFT)) & EMVSIM_RX_STATUS_LRC_OK_MASK) - -#define EMVSIM_RX_STATUS_CRC_OK_MASK (0x80U) -#define EMVSIM_RX_STATUS_CRC_OK_SHIFT (7U) -/*! CRC_OK - CRC Check OK Flag - * 0b0..Current CRC value does not match remainder. - * 0b1..Current calculated CRC value matches the expected result. - */ -#define EMVSIM_RX_STATUS_CRC_OK(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_STATUS_CRC_OK_SHIFT)) & EMVSIM_RX_STATUS_CRC_OK_MASK) - -#define EMVSIM_RX_STATUS_CWT_ERR_MASK (0x100U) -#define EMVSIM_RX_STATUS_CWT_ERR_SHIFT (8U) -/*! CWT_ERR - Character Wait Time Error Flag - * 0b0..No CWT violation - * 0b1..CWT violation - */ -#define EMVSIM_RX_STATUS_CWT_ERR(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_STATUS_CWT_ERR_SHIFT)) & EMVSIM_RX_STATUS_CWT_ERR_MASK) - -#define EMVSIM_RX_STATUS_RTE_MASK (0x200U) -#define EMVSIM_RX_STATUS_RTE_SHIFT (9U) -/*! RTE - Received NACK Threshold Error Flag - * 0b0..Less than - * 0b1..Equal to - */ -#define EMVSIM_RX_STATUS_RTE(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_STATUS_RTE_SHIFT)) & EMVSIM_RX_STATUS_RTE_MASK) - -#define EMVSIM_RX_STATUS_BWT_ERR_MASK (0x400U) -#define EMVSIM_RX_STATUS_BWT_ERR_SHIFT (10U) -/*! BWT_ERR - Block Wait Time Error Flag - * 0b0..Not exceeded - * 0b1..Exceeded - */ -#define EMVSIM_RX_STATUS_BWT_ERR(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_STATUS_BWT_ERR_SHIFT)) & EMVSIM_RX_STATUS_BWT_ERR_MASK) - -#define EMVSIM_RX_STATUS_BGT_ERR_MASK (0x800U) -#define EMVSIM_RX_STATUS_BGT_ERR_SHIFT (11U) -/*! BGT_ERR - Block Guard Time Error Flag - * 0b0..Sufficient - * 0b1..Too small - */ -#define EMVSIM_RX_STATUS_BGT_ERR(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_STATUS_BGT_ERR_SHIFT)) & EMVSIM_RX_STATUS_BGT_ERR_MASK) - -#define EMVSIM_RX_STATUS_PEF_MASK (0x1000U) -#define EMVSIM_RX_STATUS_PEF_SHIFT (12U) -/*! PEF - Parity Error Flag - * 0b0..No error - * 0b1..Error - */ -#define EMVSIM_RX_STATUS_PEF(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_STATUS_PEF_SHIFT)) & EMVSIM_RX_STATUS_PEF_MASK) - -#define EMVSIM_RX_STATUS_FEF_MASK (0x2000U) -#define EMVSIM_RX_STATUS_FEF_SHIFT (13U) -/*! FEF - Frame Error Flag - * 0b0..No error - * 0b1..Error - */ -#define EMVSIM_RX_STATUS_FEF(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_STATUS_FEF_SHIFT)) & EMVSIM_RX_STATUS_FEF_MASK) - -#define EMVSIM_RX_STATUS_RX_WPTR_MASK (0xF0000U) -#define EMVSIM_RX_STATUS_RX_WPTR_SHIFT (16U) -/*! RX_WPTR - Receive FIFO Write Pointer Value */ -#define EMVSIM_RX_STATUS_RX_WPTR(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_STATUS_RX_WPTR_SHIFT)) & EMVSIM_RX_STATUS_RX_WPTR_MASK) - -#define EMVSIM_RX_STATUS_RX_CNT_MASK (0xF000000U) -#define EMVSIM_RX_STATUS_RX_CNT_SHIFT (24U) -/*! RX_CNT - Receive FIFO Byte Count - * 0b0000..FIFO empty - */ -#define EMVSIM_RX_STATUS_RX_CNT(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_STATUS_RX_CNT_SHIFT)) & EMVSIM_RX_STATUS_RX_CNT_MASK) -/*! @} */ - -/*! @name TX_STATUS - Transmitter Status */ -/*! @{ */ - -#define EMVSIM_TX_STATUS_TNTE_MASK (0x1U) -#define EMVSIM_TX_STATUS_TNTE_SHIFT (0U) -/*! TNTE - Transmit NACK Threshold Error Flag - * 0b0..Threshold not reached - * 0b1..Threshold reached - */ -#define EMVSIM_TX_STATUS_TNTE(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_TX_STATUS_TNTE_SHIFT)) & EMVSIM_TX_STATUS_TNTE_MASK) - -#define EMVSIM_TX_STATUS_TFE_MASK (0x8U) -#define EMVSIM_TX_STATUS_TFE_SHIFT (3U) -/*! TFE - Transmit FIFO Empty Flag - * 0b0..Not empty - * 0b1..Empty - */ -#define EMVSIM_TX_STATUS_TFE(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_TX_STATUS_TFE_SHIFT)) & EMVSIM_TX_STATUS_TFE_MASK) - -#define EMVSIM_TX_STATUS_ETCF_MASK (0x10U) -#define EMVSIM_TX_STATUS_ETCF_SHIFT (4U) -/*! ETCF - Early Transmit Complete Flag - * 0b0..Pending or incomplete - * 0b1..Complete - */ -#define EMVSIM_TX_STATUS_ETCF(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_TX_STATUS_ETCF_SHIFT)) & EMVSIM_TX_STATUS_ETCF_MASK) - -#define EMVSIM_TX_STATUS_TCF_MASK (0x20U) -#define EMVSIM_TX_STATUS_TCF_SHIFT (5U) -/*! TCF - Transmit Complete Flag - * 0b0..Pending or incomplete - * 0b1..Complete - */ -#define EMVSIM_TX_STATUS_TCF(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_TX_STATUS_TCF_SHIFT)) & EMVSIM_TX_STATUS_TCF_MASK) - -#define EMVSIM_TX_STATUS_TFF_MASK (0x40U) -#define EMVSIM_TX_STATUS_TFF_SHIFT (6U) -/*! TFF - Transmit FIFO Full Flag - * 0b0..Not full - * 0b1..Full - */ -#define EMVSIM_TX_STATUS_TFF(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_TX_STATUS_TFF_SHIFT)) & EMVSIM_TX_STATUS_TFF_MASK) - -#define EMVSIM_TX_STATUS_TDTF_MASK (0x80U) -#define EMVSIM_TX_STATUS_TDTF_SHIFT (7U) -/*! TDTF - Transmit Data Threshold Flag - * 0b0..Threshold exceeded or this field written to 0 - * 0b1..Threshold not exceeded - */ -#define EMVSIM_TX_STATUS_TDTF(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_TX_STATUS_TDTF_SHIFT)) & EMVSIM_TX_STATUS_TDTF_MASK) - -#define EMVSIM_TX_STATUS_GPCNT0_TO_MASK (0x100U) -#define EMVSIM_TX_STATUS_GPCNT0_TO_SHIFT (8U) -/*! GPCNT0_TO - General Purpose Counter 0 Timeout Flag - * 0b0..GPCNT0 not reached, or flag cleared - * 0b1..GPCNT0 reached - */ -#define EMVSIM_TX_STATUS_GPCNT0_TO(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_TX_STATUS_GPCNT0_TO_SHIFT)) & EMVSIM_TX_STATUS_GPCNT0_TO_MASK) - -#define EMVSIM_TX_STATUS_GPCNT1_TO_MASK (0x200U) -#define EMVSIM_TX_STATUS_GPCNT1_TO_SHIFT (9U) -/*! GPCNT1_TO - General Purpose Counter 1 Timeout Flag - * 0b0..GPCNT1 not reached, or flag cleared - * 0b1..GPCNT1 reached - */ -#define EMVSIM_TX_STATUS_GPCNT1_TO(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_TX_STATUS_GPCNT1_TO_SHIFT)) & EMVSIM_TX_STATUS_GPCNT1_TO_MASK) - -#define EMVSIM_TX_STATUS_TX_RPTR_MASK (0xF0000U) -#define EMVSIM_TX_STATUS_TX_RPTR_SHIFT (16U) -/*! TX_RPTR - Transmit FIFO Read Pointer */ -#define EMVSIM_TX_STATUS_TX_RPTR(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_TX_STATUS_TX_RPTR_SHIFT)) & EMVSIM_TX_STATUS_TX_RPTR_MASK) - -#define EMVSIM_TX_STATUS_TX_CNT_MASK (0xF000000U) -#define EMVSIM_TX_STATUS_TX_CNT_SHIFT (24U) -/*! TX_CNT - Transmit FIFO Byte Count - * 0b0000..FIFO empty - */ -#define EMVSIM_TX_STATUS_TX_CNT(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_TX_STATUS_TX_CNT_SHIFT)) & EMVSIM_TX_STATUS_TX_CNT_MASK) -/*! @} */ - -/*! @name PCSR - Port Control and Status */ -/*! @{ */ - -#define EMVSIM_PCSR_SAPD_MASK (0x1U) -#define EMVSIM_PCSR_SAPD_SHIFT (0U) -/*! SAPD - Auto Power Down Enable - * 0b0..Disable - * 0b1..Enable - */ -#define EMVSIM_PCSR_SAPD(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_PCSR_SAPD_SHIFT)) & EMVSIM_PCSR_SAPD_MASK) - -#define EMVSIM_PCSR_SVCC_EN_MASK (0x2U) -#define EMVSIM_PCSR_SVCC_EN_SHIFT (1U) -/*! SVCC_EN - Vcc Enable for Smart Card - * 0b0..Disable - * 0b1..Enable - */ -#define EMVSIM_PCSR_SVCC_EN(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_PCSR_SVCC_EN_SHIFT)) & EMVSIM_PCSR_SVCC_EN_MASK) - -#define EMVSIM_PCSR_VCCENP_MASK (0x4U) -#define EMVSIM_PCSR_VCCENP_SHIFT (2U) -/*! VCCENP - VCC Enable Polarity Control - * 0b0..Active high - * 0b1..Active low - */ -#define EMVSIM_PCSR_VCCENP(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_PCSR_VCCENP_SHIFT)) & EMVSIM_PCSR_VCCENP_MASK) - -#define EMVSIM_PCSR_SRST_MASK (0x8U) -#define EMVSIM_PCSR_SRST_SHIFT (3U) -/*! SRST - Reset Smart Card - * 0b0..Assert - * 0b1..Deassert - */ -#define EMVSIM_PCSR_SRST(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_PCSR_SRST_SHIFT)) & EMVSIM_PCSR_SRST_MASK) - -#define EMVSIM_PCSR_SCEN_MASK (0x10U) -#define EMVSIM_PCSR_SCEN_SHIFT (4U) -/*! SCEN - Clock Enable for Smart Card - * 0b0..Disable - * 0b1..Enable - */ -#define EMVSIM_PCSR_SCEN(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_PCSR_SCEN_SHIFT)) & EMVSIM_PCSR_SCEN_MASK) - -#define EMVSIM_PCSR_SCSP_MASK (0x20U) -#define EMVSIM_PCSR_SCSP_SHIFT (5U) -/*! SCSP - Smart Card Clock Stop Polarity - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define EMVSIM_PCSR_SCSP(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_PCSR_SCSP_SHIFT)) & EMVSIM_PCSR_SCSP_MASK) - -#define EMVSIM_PCSR_SPD_MASK (0x80U) -#define EMVSIM_PCSR_SPD_SHIFT (7U) -/*! SPD - Auto Power-Down Control - * 0b0..No - * 0b1..Yes - */ -#define EMVSIM_PCSR_SPD(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_PCSR_SPD_SHIFT)) & EMVSIM_PCSR_SPD_MASK) - -#define EMVSIM_PCSR_SPDIM_MASK (0x1000000U) -#define EMVSIM_PCSR_SPDIM_SHIFT (24U) -/*! SPDIM - Smart Card Presence Detect Interrupt Mask - * 0b0..Enable - * 0b1..Mask - */ -#define EMVSIM_PCSR_SPDIM(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_PCSR_SPDIM_SHIFT)) & EMVSIM_PCSR_SPDIM_MASK) - -#define EMVSIM_PCSR_SPDIF_MASK (0x2000000U) -#define EMVSIM_PCSR_SPDIF_SHIFT (25U) -/*! SPDIF - Smart Card Presence Detect Interrupt Flag - * 0b0..No insertion or removal - * 0b1..Insertion or removal - */ -#define EMVSIM_PCSR_SPDIF(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_PCSR_SPDIF_SHIFT)) & EMVSIM_PCSR_SPDIF_MASK) - -#define EMVSIM_PCSR_SPDP_MASK (0x4000000U) -#define EMVSIM_PCSR_SPDP_SHIFT (26U) -/*! SPDP - Smart Card Presence Detect Pin Status - * 0b0..Logic low - * 0b1..Logic high - */ -#define EMVSIM_PCSR_SPDP(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_PCSR_SPDP_SHIFT)) & EMVSIM_PCSR_SPDP_MASK) - -#define EMVSIM_PCSR_SPDES_MASK (0x8000000U) -#define EMVSIM_PCSR_SPDES_SHIFT (27U) -/*! SPDES - SIM Presence Detect Edge Select - * 0b0..Falling edge - * 0b1..Rising edge - */ -#define EMVSIM_PCSR_SPDES(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_PCSR_SPDES_SHIFT)) & EMVSIM_PCSR_SPDES_MASK) -/*! @} */ - -/*! @name RX_BUF - Receive Data Read Buffer */ -/*! @{ */ - -#define EMVSIM_RX_BUF_RX_BYTE_MASK (0xFFU) -#define EMVSIM_RX_BUF_RX_BYTE_SHIFT (0U) -/*! RX_BYTE - Receive Data Byte Read */ -#define EMVSIM_RX_BUF_RX_BYTE(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_RX_BUF_RX_BYTE_SHIFT)) & EMVSIM_RX_BUF_RX_BYTE_MASK) -/*! @} */ - -/*! @name TX_BUF - Transmit Data Buffer */ -/*! @{ */ - -#define EMVSIM_TX_BUF_TX_BYTE_MASK (0xFFU) -#define EMVSIM_TX_BUF_TX_BYTE_SHIFT (0U) -/*! TX_BYTE - Transmit Data Byte */ -#define EMVSIM_TX_BUF_TX_BYTE(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_TX_BUF_TX_BYTE_SHIFT)) & EMVSIM_TX_BUF_TX_BYTE_MASK) -/*! @} */ - -/*! @name TX_GETU - Transmitter Guard ETU Value */ -/*! @{ */ - -#define EMVSIM_TX_GETU_GETU_MASK (0xFFU) -#define EMVSIM_TX_GETU_GETU_SHIFT (0U) -/*! GETU - Transmitter Guard Time Value in ETU */ -#define EMVSIM_TX_GETU_GETU(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_TX_GETU_GETU_SHIFT)) & EMVSIM_TX_GETU_GETU_MASK) -/*! @} */ - -/*! @name CWT_VAL - Character Wait Time Value */ -/*! @{ */ - -#define EMVSIM_CWT_VAL_CWT_MASK (0xFFFFU) -#define EMVSIM_CWT_VAL_CWT_SHIFT (0U) -/*! CWT - Character Wait Time Value */ -#define EMVSIM_CWT_VAL_CWT(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_CWT_VAL_CWT_SHIFT)) & EMVSIM_CWT_VAL_CWT_MASK) -/*! @} */ - -/*! @name BWT_VAL - Block Wait Time Value */ -/*! @{ */ - -#define EMVSIM_BWT_VAL_BWT_MASK (0xFFFFFFFFU) -#define EMVSIM_BWT_VAL_BWT_SHIFT (0U) -/*! BWT - Block Wait Time Value */ -#define EMVSIM_BWT_VAL_BWT(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_BWT_VAL_BWT_SHIFT)) & EMVSIM_BWT_VAL_BWT_MASK) -/*! @} */ - -/*! @name BGT_VAL - Block Guard Time Value */ -/*! @{ */ - -#define EMVSIM_BGT_VAL_BGT_MASK (0xFFFFU) -#define EMVSIM_BGT_VAL_BGT_SHIFT (0U) -/*! BGT - Block Guard Time Value */ -#define EMVSIM_BGT_VAL_BGT(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_BGT_VAL_BGT_SHIFT)) & EMVSIM_BGT_VAL_BGT_MASK) -/*! @} */ - -/*! @name GPCNT0_VAL - General Purpose Counter 0 Timeout Value */ -/*! @{ */ - -#define EMVSIM_GPCNT0_VAL_GPCNT0_MASK (0xFFFFU) -#define EMVSIM_GPCNT0_VAL_GPCNT0_SHIFT (0U) -/*! GPCNT0 - General Purpose Counter 0 Timeout Value */ -#define EMVSIM_GPCNT0_VAL_GPCNT0(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_GPCNT0_VAL_GPCNT0_SHIFT)) & EMVSIM_GPCNT0_VAL_GPCNT0_MASK) -/*! @} */ - -/*! @name GPCNT1_VAL - General Purpose Counter 1 Timeout Value */ -/*! @{ */ - -#define EMVSIM_GPCNT1_VAL_GPCNT1_MASK (0xFFFFU) -#define EMVSIM_GPCNT1_VAL_GPCNT1_SHIFT (0U) -/*! GPCNT1 - General Purpose Counter 1 Timeout Value */ -#define EMVSIM_GPCNT1_VAL_GPCNT1(x) (((uint32_t)(((uint32_t)(x)) << EMVSIM_GPCNT1_VAL_GPCNT1_SHIFT)) & EMVSIM_GPCNT1_VAL_GPCNT1_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group EMVSIM_Register_Masks */ - - -/* EMVSIM - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral EMVSIM0 base address */ - #define EMVSIM0_BASE (0x50103000u) - /** Peripheral EMVSIM0 base address */ - #define EMVSIM0_BASE_NS (0x40103000u) - /** Peripheral EMVSIM0 base pointer */ - #define EMVSIM0 ((EMVSIM_Type *)EMVSIM0_BASE) - /** Peripheral EMVSIM0 base pointer */ - #define EMVSIM0_NS ((EMVSIM_Type *)EMVSIM0_BASE_NS) - /** Peripheral EMVSIM1 base address */ - #define EMVSIM1_BASE (0x50104000u) - /** Peripheral EMVSIM1 base address */ - #define EMVSIM1_BASE_NS (0x40104000u) - /** Peripheral EMVSIM1 base pointer */ - #define EMVSIM1 ((EMVSIM_Type *)EMVSIM1_BASE) - /** Peripheral EMVSIM1 base pointer */ - #define EMVSIM1_NS ((EMVSIM_Type *)EMVSIM1_BASE_NS) - /** Array initializer of EMVSIM peripheral base addresses */ - #define EMVSIM_BASE_ADDRS { EMVSIM0_BASE, EMVSIM1_BASE } - /** Array initializer of EMVSIM peripheral base pointers */ - #define EMVSIM_BASE_PTRS { EMVSIM0, EMVSIM1 } - /** Array initializer of EMVSIM peripheral base addresses */ - #define EMVSIM_BASE_ADDRS_NS { EMVSIM0_BASE_NS, EMVSIM1_BASE_NS } - /** Array initializer of EMVSIM peripheral base pointers */ - #define EMVSIM_BASE_PTRS_NS { EMVSIM0_NS, EMVSIM1_NS } -#else - /** Peripheral EMVSIM0 base address */ - #define EMVSIM0_BASE (0x40103000u) - /** Peripheral EMVSIM0 base pointer */ - #define EMVSIM0 ((EMVSIM_Type *)EMVSIM0_BASE) - /** Peripheral EMVSIM1 base address */ - #define EMVSIM1_BASE (0x40104000u) - /** Peripheral EMVSIM1 base pointer */ - #define EMVSIM1 ((EMVSIM_Type *)EMVSIM1_BASE) - /** Array initializer of EMVSIM peripheral base addresses */ - #define EMVSIM_BASE_ADDRS { EMVSIM0_BASE, EMVSIM1_BASE } - /** Array initializer of EMVSIM peripheral base pointers */ - #define EMVSIM_BASE_PTRS { EMVSIM0, EMVSIM1 } -#endif -/** Interrupt vectors for the EMVSIM peripheral type */ -#define EMVSIM_IRQS { EMVSIM0_IRQn, EMVSIM1_IRQn } - -/*! - * @} - */ /* end of group EMVSIM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- ENET Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ENET_Peripheral_Access_Layer ENET Peripheral Access Layer - * @{ - */ - -/** ENET - Register Layout Typedef */ -typedef struct { - __IO uint32_t MAC_CONFIGURATION; /**< MAC Configuration, offset: 0x0 */ - __IO uint32_t MAC_EXT_CONFIGURATION; /**< MAC Extended Configuration Register, offset: 0x4 */ - __IO uint32_t MAC_PACKET_FILTER; /**< MAC Packet Filter, offset: 0x8 */ - __IO uint32_t MAC_WATCHDOG_TIMEOUT; /**< Watchdog Timeout, offset: 0xC */ - uint8_t RESERVED_0[64]; - __IO uint32_t MAC_VLAN_TAG_CTRL; /**< MAC VLAN Tag Control, offset: 0x50 */ - uint8_t RESERVED_1[12]; - __IO uint32_t MAC_VLAN_INCL; /**< VLAN Tag Inclusion or Replacement, offset: 0x60 */ - __IO uint32_t MAC_INNER_VLAN_INCL; /**< MAC Inner VLAN Tag Inclusion or Replacement, offset: 0x64 */ - uint8_t RESERVED_2[8]; - __IO uint32_t MAC_TX_FLOW_CTRL_Q[1]; /**< MAC Q0 Tx Flow Control, array offset: 0x70, array step: 0x4 */ - uint8_t RESERVED_3[28]; - __IO uint32_t MAC_RX_FLOW_CTRL; /**< MAC Rx Flow Control, offset: 0x90 */ - __IO uint32_t MAC_RXQ_CTRL4; /**< Receive Queue Control 4, offset: 0x94 */ - uint8_t RESERVED_4[8]; - __IO uint32_t MAC_RXQ_CTRL[3]; /**< Receive Queue Control 0..Receive Queue Control 2, array offset: 0xA0, array step: 0x4 */ - uint8_t RESERVED_5[4]; - __I uint32_t MAC_INTERRUPT_STATUS; /**< Interrupt Status, offset: 0xB0 */ - __IO uint32_t MAC_INTERRUPT_ENABLE; /**< Interrupt Enable, offset: 0xB4 */ - __I uint32_t MAC_RX_TX_STATUS; /**< Receive Transmit Status, offset: 0xB8 */ - uint8_t RESERVED_6[4]; - __IO uint32_t MAC_PMT_CONTROL_STATUS; /**< PMT Control and Status, offset: 0xC0 */ - __IO uint32_t MAC_RWK_PACKET_FILTER; /**< Remote Wakeup Filter, offset: 0xC4 */ - uint8_t RESERVED_7[8]; - __IO uint32_t MAC_LPI_CONTROL_STATUS; /**< LPI Control and Status, offset: 0xD0 */ - __IO uint32_t MAC_LPI_TIMERS_CONTROL; /**< LPI Timers Control, offset: 0xD4 */ - __IO uint32_t MAC_LPI_ENTRY_TIMER; /**< Tx LPI Entry Timer Control, offset: 0xD8 */ - __IO uint32_t MAC_ONEUS_TIC_COUNTER; /**< One-microsecond Reference Timer, offset: 0xDC */ - uint8_t RESERVED_8[48]; - __I uint32_t MAC_VERSION; /**< MAC Version, offset: 0x110 */ - __I uint32_t MAC_DEBUG; /**< MAC Debug, offset: 0x114 */ - uint8_t RESERVED_9[4]; - __I uint32_t MAC_HW_FEAT[4]; /**< Hardware Features 0..Hardware Features 3, array offset: 0x11C, array step: 0x4 */ - uint8_t RESERVED_10[212]; - __IO uint32_t MAC_MDIO_ADDRESS; /**< MDIO Address, offset: 0x200 */ - __IO uint32_t MAC_MDIO_DATA; /**< MAC MDIO Data, offset: 0x204 */ - uint8_t RESERVED_11[40]; - __IO uint32_t MAC_CSR_SW_CTRL; /**< CSR Software Control, offset: 0x230 */ - uint8_t RESERVED_12[204]; - __IO uint32_t MAC_ADDRESS0_HIGH; /**< MAC Address0 High, offset: 0x300 */ - __IO uint32_t MAC_ADDRESS0_LOW; /**< MAC Address0 Low, offset: 0x304 */ - uint8_t RESERVED_13[1896]; - __IO uint32_t INDIR_ACCESS_CTRL; /**< Indirect Access Control, offset: 0xA70 */ - __IO uint32_t INDIR_ACCESS_DATA; /**< Indirect Access Data, offset: 0xA74 */ - uint8_t RESERVED_14[136]; - __IO uint32_t MAC_TIMESTAMP_CONTROL; /**< Timestamp Control, offset: 0xB00 */ - __IO uint32_t MAC_SUB_SECOND_INCREMENT; /**< Subsecond Increment, offset: 0xB04 */ - __I uint32_t MAC_SYSTEM_TIME_SECONDS; /**< System Time Seconds, offset: 0xB08 */ - __I uint32_t MAC_SYSTEM_TIME_NANOSECONDS; /**< System Time Nanoseconds, offset: 0xB0C */ - __IO uint32_t MAC_SYSTEM_TIME_SECONDS_UPDATE; /**< System Time Seconds Update, offset: 0xB10 */ - __IO uint32_t MAC_SYSTEM_TIME_NANOSECONDS_UPDATE; /**< System Time Nanoseconds Update, offset: 0xB14 */ - __IO uint32_t MAC_TIMESTAMP_ADDEND; /**< Timestamp Addend, offset: 0xB18 */ - uint8_t RESERVED_15[4]; - __I uint32_t MAC_TIMESTAMP_STATUS; /**< Timestamp Status, offset: 0xB20 */ - uint8_t RESERVED_16[12]; - __I uint32_t MAC_TX_TIMESTAMP_STATUS_NANOSECONDS; /**< Transmit Timestamp Status Nanoseconds, offset: 0xB30 */ - __I uint32_t MAC_TX_TIMESTAMP_STATUS_SECONDS; /**< Transmit Timestamp Status Seconds, offset: 0xB34 */ - uint8_t RESERVED_17[32]; - __IO uint32_t MAC_TIMESTAMP_INGRESS_CORR_NANOSECOND; /**< Timestamp Ingress Correction Nanosecond, offset: 0xB58 */ - __IO uint32_t MAC_TIMESTAMP_EGRESS_CORR_NANOSECOND; /**< Timestamp Egress Correction Nanosecond, offset: 0xB5C */ - uint8_t RESERVED_18[8]; - __I uint32_t MAC_TIMESTAMP_INGRESS_LATENCY; /**< Timestamp Ingress Latency, offset: 0xB68 */ - __I uint32_t MAC_TIMESTAMP_EGRESS_LATENCY; /**< Timestamp Egress Latency, offset: 0xB6C */ - __IO uint32_t MAC_PPS_CONTROL; /**< PPS Control, offset: 0xB70 */ - uint8_t RESERVED_19[12]; - __IO uint32_t PPS0_TARGET_TIME_SECONDS; /**< PPS0 Target Time Seconds, offset: 0xB80 */ - __IO uint32_t PPS0_TARGET_TIME_NANOSECONDS; /**< PPS0 Target Time Nanoseconds, offset: 0xB84 */ - uint8_t RESERVED_20[120]; - __IO uint32_t MTL_OPERATION_MODE; /**< MTL Operation Mode, offset: 0xC00 */ - uint8_t RESERVED_21[28]; - __I uint32_t MTL_INTERRUPT_STATUS; /**< MTL Interrupt Status, offset: 0xC20 */ - uint8_t RESERVED_22[12]; - __IO uint32_t MTL_RXQ_DMA_MAP0; /**< Receive Queue and DMA Channel Mapping 0, offset: 0xC30 */ - uint8_t RESERVED_23[204]; - struct { /* offset: 0xD00, array step: 0x40 */ - __IO uint32_t MTL_TXQX_OP_MODE; /**< Queue 0 Transmit Operation Mode..Queue 1 Transmit Operation Mode, array offset: 0xD00, array step: 0x40 */ - __I uint32_t MTL_TXQX_UNDRFLW; /**< Queue 0 Underflow Counter..Queue 1 Underflow Counter, array offset: 0xD04, array step: 0x40 */ - __I uint32_t MTL_TXQX_DBG; /**< Queue 0 Transmit Debug..Queue 1 Transmit Debug, array offset: 0xD08, array step: 0x40 */ - uint8_t RESERVED_0[4]; - __IO uint32_t MTL_TXQX_ETS_CTRL; /**< Queue 1 ETS Control, array offset: 0xD10, array step: 0x40, valid indices: [1] */ - __I uint32_t MTL_TXQX_ETS_STAT; /**< Queue 0 ETS Status..Queue 1 ETS Status, array offset: 0xD14, array step: 0x40 */ - __IO uint32_t MTL_TXQX_QNTM_WGHT; /**< Queue 0 Quantum or Weights..Queue 1 idleSlopeCredit, Quantum or Weights, array offset: 0xD18, array step: 0x40 */ - __IO uint32_t MTL_TXQX_SNDSLP_CRDT; /**< Queue 1 sendSlopeCredit, array offset: 0xD1C, array step: 0x40, valid indices: [1] */ - __IO uint32_t MTL_TXQX_HI_CRDT; /**< Queue 1 hiCredit, array offset: 0xD20, array step: 0x40, valid indices: [1] */ - __IO uint32_t MTL_TXQX_LO_CRDT; /**< Queue 1 loCredit, array offset: 0xD24, array step: 0x40, valid indices: [1] */ - uint8_t RESERVED_1[4]; - __IO uint32_t MTL_QX_INTCTRL_STAT; /**< Queue 0 Interrupt Control Status..Queue 1 Interrupt Control Status, array offset: 0xD2C, array step: 0x40 */ - __IO uint32_t MTL_RXQX_OP_MODE; /**< Queue 0 Receive Operation Mode..Queue 1 Receive Operation Mode, array offset: 0xD30, array step: 0x40 */ - __I uint32_t MTL_RXQX_MISSPKT_OVRFLW_CNT; /**< Queue 0 Missed Packet and Overflow Counter..Queue 1 Missed Packet and Overflow Counter, array offset: 0xD34, array step: 0x40 */ - __I uint32_t MTL_RXQX_DBG; /**< Queue 0 Receive Debug..Queue 1 Receive Debug, array offset: 0xD38, array step: 0x40 */ - __IO uint32_t MTL_RXQX_CTRL; /**< Queue 0 Receive Control..Queue 1 Receive Control, array offset: 0xD3C, array step: 0x40 */ - } MTL_QUEUE[2]; - uint8_t RESERVED_24[640]; - __IO uint32_t DMA_MODE; /**< DMA Bus Mode, offset: 0x1000 */ - __IO uint32_t DMA_SYSBUS_MODE; /**< DMA System Bus Mode, offset: 0x1004 */ - __I uint32_t DMA_INTERRUPT_STATUS; /**< DMA Interrupt Status, offset: 0x1008 */ - __I uint32_t DMA_DEBUG_STATUS0; /**< DMA Debug Status 0, offset: 0x100C */ - uint8_t RESERVED_25[240]; - struct { /* offset: 0x1100, array step: 0x80 */ - __IO uint32_t DMA_CHX_CTRL; /**< DMA Channel 0 Control..DMA Channel 1 Control, array offset: 0x1100, array step: 0x80 */ - __IO uint32_t DMA_CHX_TX_CTRL; /**< DMA Channel 0 Transmit Control..DMA Channel 1 Transmit Control, array offset: 0x1104, array step: 0x80 */ - __IO uint32_t DMA_CHX_RX_CTRL; /**< DMA Channel 0 Receive Control..DMA Channel 1 Receive Control, array offset: 0x1108, array step: 0x80 */ - uint8_t RESERVED_0[8]; - __IO uint32_t DMA_CHX_TXDESC_LIST_ADDR; /**< Channel 0 Tx Descriptor List Address register..Channel 1 Tx Descriptor List Address, array offset: 0x1114, array step: 0x80 */ - uint8_t RESERVED_1[4]; - __IO uint32_t DMA_CHX_RXDESC_LIST_ADDR; /**< Channel 0 Rx Descriptor List Address register..Channel 1 Rx Descriptor List Address, array offset: 0x111C, array step: 0x80 */ - __IO uint32_t DMA_CHX_TXDESC_TAIL_PTR; /**< Channel 0 Tx Descriptor Tail Pointer..Channel 1 Tx Descriptor Tail Pointer, array offset: 0x1120, array step: 0x80 */ - uint8_t RESERVED_2[4]; - __IO uint32_t DMA_CHX_RXDESC_TAIL_PTR; /**< Channel 0 Rx Descriptor Tail Pointer..Channel 1 Rx Descriptor Tail Pointer, array offset: 0x1128, array step: 0x80 */ - __IO uint32_t DMA_CHX_TXDESC_RING_LENGTH; /**< Channel 0 Tx Descriptor Ring Length..Channel 1 Tx Descriptor Ring Length, array offset: 0x112C, array step: 0x80 */ - __IO uint32_t DMA_CHX_RX_CONTROL2; /**< Channeli Receive Control..DMA Channel 1 Receive Control, array offset: 0x1130, array step: 0x80 */ - __IO uint32_t DMA_CHX_INT_EN; /**< Channeli Interrupt Enable..Channel 1 Interrupt Enable, array offset: 0x1134, array step: 0x80 */ - __IO uint32_t DMA_CHX_RX_INT_WDTIMER; /**< Channel 0 Receive Interrupt Watchdog Timer..Channel 1 Receive Interrupt Watchdog Timer, array offset: 0x1138, array step: 0x80 */ - __IO uint32_t DMA_CHX_SLOT_FUNC_CTRL_STAT; /**< Channel 0 Slot Function Control and Status..Channel 1 Slot Function Control and Status, array offset: 0x113C, array step: 0x80 */ - uint8_t RESERVED_3[4]; - __I uint32_t DMA_CHX_CUR_HST_TXDESC; /**< Channel 0 Current Application Transmit Descriptor..Channel 1 Current Application Transmit Descriptor, array offset: 0x1144, array step: 0x80 */ - uint8_t RESERVED_4[4]; - __I uint32_t DMA_CHX_CUR_HST_RXDESC; /**< Channel 0 Current Application Receive Descriptor..Channel 1 Current Application Receive Descriptor, array offset: 0x114C, array step: 0x80 */ - uint8_t RESERVED_5[4]; - __I uint32_t DMA_CHX_CUR_HST_TXBUF; /**< Channel 0 Current Application Transmit Buffer Address..Channel 1 Current Application Transmit Buffer Address, array offset: 0x1154, array step: 0x80 */ - uint8_t RESERVED_6[4]; - __I uint32_t DMA_CHX_CUR_HST_RXBUF; /**< Channel 0 Current Application Receive Buffer Address..Channel 1 Current Application Receive Buffer Address, array offset: 0x115C, array step: 0x80 */ - __IO uint32_t DMA_CHX_STAT; /**< DMA Channel 0 Status..DMA Channel 1 Status, array offset: 0x1160, array step: 0x80 */ - __I uint32_t DMA_CHX_MISS_FRAME_CNT; /**< Channel 0 Missed Frame Counter..Channel 1 Missed Frame Counter, array offset: 0x1164, array step: 0x80 */ - uint8_t RESERVED_7[4]; - __I uint32_t DMA_CHX_RX_ERI_CNT; /**< Channel 0 Receive ERI Counter..Channel 1 Receive ERI Counter, array offset: 0x116C, array step: 0x80 */ - uint8_t RESERVED_8[16]; - } DMA_CH[2]; -} ENET_Type; - -/* ---------------------------------------------------------------------------- - -- ENET Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ENET_Register_Masks ENET Register Masks - * @{ - */ - -/*! @name MAC_CONFIGURATION - MAC Configuration */ -/*! @{ */ - -#define ENET_MAC_CONFIGURATION_RE_MASK (0x1U) -#define ENET_MAC_CONFIGURATION_RE_SHIFT (0U) -/*! RE - Receiver Enable - * 0b0..Receiver is disabled - * 0b1..Receiver is enabled - */ -#define ENET_MAC_CONFIGURATION_RE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_RE_SHIFT)) & ENET_MAC_CONFIGURATION_RE_MASK) - -#define ENET_MAC_CONFIGURATION_TE_MASK (0x2U) -#define ENET_MAC_CONFIGURATION_TE_SHIFT (1U) -/*! TE - Transmitter Enable - * 0b0..Transmitter is disabled - * 0b1..Transmitter is enabled - */ -#define ENET_MAC_CONFIGURATION_TE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_TE_SHIFT)) & ENET_MAC_CONFIGURATION_TE_MASK) - -#define ENET_MAC_CONFIGURATION_PRELEN_MASK (0xCU) -#define ENET_MAC_CONFIGURATION_PRELEN_SHIFT (2U) -/*! PRELEN - Preamble Length for Transmit packets - * 0b10..3 bytes of preamble - * 0b01..5 bytes of preamble - * 0b00..7 bytes of preamble - * 0b11..Reserved - */ -#define ENET_MAC_CONFIGURATION_PRELEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_PRELEN_SHIFT)) & ENET_MAC_CONFIGURATION_PRELEN_MASK) - -#define ENET_MAC_CONFIGURATION_DC_MASK (0x10U) -#define ENET_MAC_CONFIGURATION_DC_SHIFT (4U) -/*! DC - Deferral Check - * 0b0..Deferral check function is disabled - * 0b1..Deferral check function is enabled - */ -#define ENET_MAC_CONFIGURATION_DC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_DC_SHIFT)) & ENET_MAC_CONFIGURATION_DC_MASK) - -#define ENET_MAC_CONFIGURATION_BL_MASK (0x60U) -#define ENET_MAC_CONFIGURATION_BL_SHIFT (5U) -/*! BL - Back-Off Limit - * 0b11..k = min(n,1) - * 0b00..k = min(n,10) - * 0b10..k = min(n,4) - * 0b01..k = min(n,8) - */ -#define ENET_MAC_CONFIGURATION_BL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_BL_SHIFT)) & ENET_MAC_CONFIGURATION_BL_MASK) - -#define ENET_MAC_CONFIGURATION_DR_MASK (0x100U) -#define ENET_MAC_CONFIGURATION_DR_SHIFT (8U) -/*! DR - Disable Retry - * 0b1..Disable Retry - * 0b0..Enable Retry - */ -#define ENET_MAC_CONFIGURATION_DR(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_DR_SHIFT)) & ENET_MAC_CONFIGURATION_DR_MASK) - -#define ENET_MAC_CONFIGURATION_DCRS_MASK (0x200U) -#define ENET_MAC_CONFIGURATION_DCRS_SHIFT (9U) -/*! DCRS - Disable Carrier Sense During Transmission - * 0b1..Disable Carrier Sense During Transmission - * 0b0..Enable Carrier Sense During Transmission - */ -#define ENET_MAC_CONFIGURATION_DCRS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_DCRS_SHIFT)) & ENET_MAC_CONFIGURATION_DCRS_MASK) - -#define ENET_MAC_CONFIGURATION_DO_MASK (0x400U) -#define ENET_MAC_CONFIGURATION_DO_SHIFT (10U) -/*! DO - Disable Receive Own - * 0b1..Disable Receive Own - * 0b0..Enable Receive Own - */ -#define ENET_MAC_CONFIGURATION_DO(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_DO_SHIFT)) & ENET_MAC_CONFIGURATION_DO_MASK) - -#define ENET_MAC_CONFIGURATION_ECRSFD_MASK (0x800U) -#define ENET_MAC_CONFIGURATION_ECRSFD_SHIFT (11U) -/*! ECRSFD - Enable Carrier Sense Before Transmission in Full-Duplex Mode - * 0b0..ECRSFD is disabled - * 0b1..ECRSFD is enabled - */ -#define ENET_MAC_CONFIGURATION_ECRSFD(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_ECRSFD_SHIFT)) & ENET_MAC_CONFIGURATION_ECRSFD_MASK) - -#define ENET_MAC_CONFIGURATION_LM_MASK (0x1000U) -#define ENET_MAC_CONFIGURATION_LM_SHIFT (12U) -/*! LM - Loopback Mode - * 0b0..Loopback is disabled - * 0b1..Loopback is enabled - */ -#define ENET_MAC_CONFIGURATION_LM(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_LM_SHIFT)) & ENET_MAC_CONFIGURATION_LM_MASK) - -#define ENET_MAC_CONFIGURATION_DM_MASK (0x2000U) -#define ENET_MAC_CONFIGURATION_DM_SHIFT (13U) -/*! DM - Duplex Mode - * 0b1..Full-duplex mode - * 0b0..Half-duplex mode - */ -#define ENET_MAC_CONFIGURATION_DM(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_DM_SHIFT)) & ENET_MAC_CONFIGURATION_DM_MASK) - -#define ENET_MAC_CONFIGURATION_FES_MASK (0x4000U) -#define ENET_MAC_CONFIGURATION_FES_SHIFT (14U) -/*! FES - Speed - * 0b1..100 Mbps when PS bit is 1 and 2.5 Gbps when PS bit is 0 - * 0b0..10 Mbps when PS bit is 1 and 1 Gbps when PS bit is 0 - */ -#define ENET_MAC_CONFIGURATION_FES(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_FES_SHIFT)) & ENET_MAC_CONFIGURATION_FES_MASK) - -#define ENET_MAC_CONFIGURATION_PS_MASK (0x8000U) -#define ENET_MAC_CONFIGURATION_PS_SHIFT (15U) -/*! PS - Port Select - * 0b0..For 1000 or 2500 Mbps operations - * 0b1..For 10 or 100 Mbps operations - */ -#define ENET_MAC_CONFIGURATION_PS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_PS_SHIFT)) & ENET_MAC_CONFIGURATION_PS_MASK) - -#define ENET_MAC_CONFIGURATION_JE_MASK (0x10000U) -#define ENET_MAC_CONFIGURATION_JE_SHIFT (16U) -/*! JE - Jumbo Packet Enable - * 0b0..Jumbo packet is disabled - * 0b1..Jumbo packet is enabled - */ -#define ENET_MAC_CONFIGURATION_JE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_JE_SHIFT)) & ENET_MAC_CONFIGURATION_JE_MASK) - -#define ENET_MAC_CONFIGURATION_JD_MASK (0x20000U) -#define ENET_MAC_CONFIGURATION_JD_SHIFT (17U) -/*! JD - Jabber Disable - * 0b1..Jabber is disabled - * 0b0..Jabber is enabled - */ -#define ENET_MAC_CONFIGURATION_JD(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_JD_SHIFT)) & ENET_MAC_CONFIGURATION_JD_MASK) - -#define ENET_MAC_CONFIGURATION_WD_MASK (0x80000U) -#define ENET_MAC_CONFIGURATION_WD_SHIFT (19U) -/*! WD - Watchdog Disable - * 0b1..Watchdog is disabled - * 0b0..Watchdog is enabled - */ -#define ENET_MAC_CONFIGURATION_WD(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_WD_SHIFT)) & ENET_MAC_CONFIGURATION_WD_MASK) - -#define ENET_MAC_CONFIGURATION_ACS_MASK (0x100000U) -#define ENET_MAC_CONFIGURATION_ACS_SHIFT (20U) -/*! ACS - Automatic Pad or CRC Stripping - * 0b0..Automatic Pad or CRC Stripping is disabled - * 0b1..Automatic Pad or CRC Stripping is enabled - */ -#define ENET_MAC_CONFIGURATION_ACS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_ACS_SHIFT)) & ENET_MAC_CONFIGURATION_ACS_MASK) - -#define ENET_MAC_CONFIGURATION_CST_MASK (0x200000U) -#define ENET_MAC_CONFIGURATION_CST_SHIFT (21U) -/*! CST - CRC stripping for Type packets - * 0b0..CRC stripping for Type packets is disabled - * 0b1..CRC stripping for Type packets is enabled - */ -#define ENET_MAC_CONFIGURATION_CST(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_CST_SHIFT)) & ENET_MAC_CONFIGURATION_CST_MASK) - -#define ENET_MAC_CONFIGURATION_S2KP_MASK (0x400000U) -#define ENET_MAC_CONFIGURATION_S2KP_SHIFT (22U) -/*! S2KP - IEEE 802.3as Support for 2K Packets - * 0b0..Support upto 2K packet is disabled - * 0b1..Support upto 2K packet is Enabled - */ -#define ENET_MAC_CONFIGURATION_S2KP(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_S2KP_SHIFT)) & ENET_MAC_CONFIGURATION_S2KP_MASK) - -#define ENET_MAC_CONFIGURATION_GPSLCE_MASK (0x800000U) -#define ENET_MAC_CONFIGURATION_GPSLCE_SHIFT (23U) -/*! GPSLCE - Giant Packet Size Limit Control Enable - * 0b0..Giant Packet Size Limit Control is disabled - * 0b1..Giant Packet Size Limit Control is enabled - */ -#define ENET_MAC_CONFIGURATION_GPSLCE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_GPSLCE_SHIFT)) & ENET_MAC_CONFIGURATION_GPSLCE_MASK) - -#define ENET_MAC_CONFIGURATION_IPG_MASK (0x7000000U) -#define ENET_MAC_CONFIGURATION_IPG_SHIFT (24U) -/*! IPG - Inter-Packet Gap - * 0b111..40 bit times IPG - * 0b110..48 bit times IPG - * 0b101..56 bit times IPG - * 0b100..64 bit times IPG - * 0b011..72 bit times IPG - * 0b010..80 bit times IPG - * 0b001..88 bit times IPG - * 0b000..96 bit times IPG - */ -#define ENET_MAC_CONFIGURATION_IPG(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_IPG_SHIFT)) & ENET_MAC_CONFIGURATION_IPG_MASK) - -#define ENET_MAC_CONFIGURATION_IPC_MASK (0x8000000U) -#define ENET_MAC_CONFIGURATION_IPC_SHIFT (27U) -/*! IPC - Checksum Offload - * 0b0..IP header/payload checksum checking is disabled - * 0b1..IP header/payload checksum checking is enabled - */ -#define ENET_MAC_CONFIGURATION_IPC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_IPC_SHIFT)) & ENET_MAC_CONFIGURATION_IPC_MASK) - -#define ENET_MAC_CONFIGURATION_SARC_MASK (0x70000000U) -#define ENET_MAC_CONFIGURATION_SARC_SHIFT (28U) -/*! SARC - Source Address Insertion or Replacement Control - * 0b010..Contents of MAC Addr-0 inserted in SA field - * 0b011..Contents of MAC Addr-0 replaces SA field - * 0b110..Contents of MAC Addr-1 inserted in SA field - * 0b111..Contents of MAC Addr-1 replaces SA field - * 0b000..mti_sa_ctrl_i and ati_sa_ctrl_i input signals control the SA field generation - */ -#define ENET_MAC_CONFIGURATION_SARC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CONFIGURATION_SARC_SHIFT)) & ENET_MAC_CONFIGURATION_SARC_MASK) -/*! @} */ - -/*! @name MAC_EXT_CONFIGURATION - MAC Extended Configuration Register */ -/*! @{ */ - -#define ENET_MAC_EXT_CONFIGURATION_GPSL_MASK (0x3FFFU) -#define ENET_MAC_EXT_CONFIGURATION_GPSL_SHIFT (0U) -/*! GPSL - Giant Packet Size Limit */ -#define ENET_MAC_EXT_CONFIGURATION_GPSL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_EXT_CONFIGURATION_GPSL_SHIFT)) & ENET_MAC_EXT_CONFIGURATION_GPSL_MASK) - -#define ENET_MAC_EXT_CONFIGURATION_DCRCC_MASK (0x10000U) -#define ENET_MAC_EXT_CONFIGURATION_DCRCC_SHIFT (16U) -/*! DCRCC - Disable CRC Checking for Received Packets - * 0b1..CRC Checking is disabled - * 0b0..CRC Checking is enabled - */ -#define ENET_MAC_EXT_CONFIGURATION_DCRCC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_EXT_CONFIGURATION_DCRCC_SHIFT)) & ENET_MAC_EXT_CONFIGURATION_DCRCC_MASK) - -#define ENET_MAC_EXT_CONFIGURATION_SPEN_MASK (0x20000U) -#define ENET_MAC_EXT_CONFIGURATION_SPEN_SHIFT (17U) -/*! SPEN - Slow Protocol Detection Enable - * 0b0..Slow Protocol Detection is disabled - * 0b1..Slow Protocol Detection is enabled - */ -#define ENET_MAC_EXT_CONFIGURATION_SPEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_EXT_CONFIGURATION_SPEN_SHIFT)) & ENET_MAC_EXT_CONFIGURATION_SPEN_MASK) - -#define ENET_MAC_EXT_CONFIGURATION_USP_MASK (0x40000U) -#define ENET_MAC_EXT_CONFIGURATION_USP_SHIFT (18U) -/*! USP - Unicast Slow Protocol Packet Detect - * 0b0..Unicast Slow Protocol Packet Detection is disabled - * 0b1..Unicast Slow Protocol Packet Detection is enabled - */ -#define ENET_MAC_EXT_CONFIGURATION_USP(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_EXT_CONFIGURATION_USP_SHIFT)) & ENET_MAC_EXT_CONFIGURATION_USP_MASK) - -#define ENET_MAC_EXT_CONFIGURATION_PDC_MASK (0x80000U) -#define ENET_MAC_EXT_CONFIGURATION_PDC_SHIFT (19U) -/*! PDC - Packet Duplication Control - * 0b0..Packet Duplication Control is disabled - * 0b1..Packet Duplication Control is enabled - */ -#define ENET_MAC_EXT_CONFIGURATION_PDC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_EXT_CONFIGURATION_PDC_SHIFT)) & ENET_MAC_EXT_CONFIGURATION_PDC_MASK) - -#define ENET_MAC_EXT_CONFIGURATION_EIPGEN_MASK (0x1000000U) -#define ENET_MAC_EXT_CONFIGURATION_EIPGEN_SHIFT (24U) -/*! EIPGEN - Extended Inter-Packet Gap Enable - * 0b0..Extended Inter-Packet Gap is disabled - * 0b1..Extended Inter-Packet Gap is enabled - */ -#define ENET_MAC_EXT_CONFIGURATION_EIPGEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_EXT_CONFIGURATION_EIPGEN_SHIFT)) & ENET_MAC_EXT_CONFIGURATION_EIPGEN_MASK) - -#define ENET_MAC_EXT_CONFIGURATION_EIPG_MASK (0x3E000000U) -#define ENET_MAC_EXT_CONFIGURATION_EIPG_SHIFT (25U) -/*! EIPG - Extended Inter-Packet Gap */ -#define ENET_MAC_EXT_CONFIGURATION_EIPG(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_EXT_CONFIGURATION_EIPG_SHIFT)) & ENET_MAC_EXT_CONFIGURATION_EIPG_MASK) -/*! @} */ - -/*! @name MAC_PACKET_FILTER - MAC Packet Filter */ -/*! @{ */ - -#define ENET_MAC_PACKET_FILTER_PR_MASK (0x1U) -#define ENET_MAC_PACKET_FILTER_PR_SHIFT (0U) -/*! PR - Promiscuous Mode - * 0b0..Promiscuous Mode is disabled - * 0b1..Promiscuous Mode is enabled - */ -#define ENET_MAC_PACKET_FILTER_PR(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PACKET_FILTER_PR_SHIFT)) & ENET_MAC_PACKET_FILTER_PR_MASK) - -#define ENET_MAC_PACKET_FILTER_DAIF_MASK (0x8U) -#define ENET_MAC_PACKET_FILTER_DAIF_SHIFT (3U) -/*! DAIF - DA Inverse Filtering - * 0b0..DA Inverse Filtering is disabled - * 0b1..DA Inverse Filtering is enabled - */ -#define ENET_MAC_PACKET_FILTER_DAIF(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PACKET_FILTER_DAIF_SHIFT)) & ENET_MAC_PACKET_FILTER_DAIF_MASK) - -#define ENET_MAC_PACKET_FILTER_PM_MASK (0x10U) -#define ENET_MAC_PACKET_FILTER_PM_SHIFT (4U) -/*! PM - Pass All Multicast - * 0b0..Pass All Multicast is disabled - * 0b1..Pass All Multicast is enabled - */ -#define ENET_MAC_PACKET_FILTER_PM(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PACKET_FILTER_PM_SHIFT)) & ENET_MAC_PACKET_FILTER_PM_MASK) - -#define ENET_MAC_PACKET_FILTER_DBF_MASK (0x20U) -#define ENET_MAC_PACKET_FILTER_DBF_SHIFT (5U) -/*! DBF - Disable Broadcast Packets - * 0b1..Disable Broadcast Packets - * 0b0..Enable Broadcast Packets - */ -#define ENET_MAC_PACKET_FILTER_DBF(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PACKET_FILTER_DBF_SHIFT)) & ENET_MAC_PACKET_FILTER_DBF_MASK) - -#define ENET_MAC_PACKET_FILTER_PCF_MASK (0xC0U) -#define ENET_MAC_PACKET_FILTER_PCF_SHIFT (6U) -/*! PCF - Pass Control Packets - * 0b00..MAC filters all control packets from reaching the application - * 0b10..MAC forwards all control packets to the application even if they fail the address filter - * 0b11..MAC forwards the control packets that pass the Address filter - * 0b01..MAC forwards all control packets except Pause packets to the application even if they fail the address filter - */ -#define ENET_MAC_PACKET_FILTER_PCF(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PACKET_FILTER_PCF_SHIFT)) & ENET_MAC_PACKET_FILTER_PCF_MASK) - -#define ENET_MAC_PACKET_FILTER_VTFE_MASK (0x10000U) -#define ENET_MAC_PACKET_FILTER_VTFE_SHIFT (16U) -/*! VTFE - VLAN Tag Filter Enable - * 0b0..VLAN Tag Filter is disabled - * 0b1..VLAN Tag Filter is enabled - */ -#define ENET_MAC_PACKET_FILTER_VTFE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PACKET_FILTER_VTFE_SHIFT)) & ENET_MAC_PACKET_FILTER_VTFE_MASK) - -#define ENET_MAC_PACKET_FILTER_RA_MASK (0x80000000U) -#define ENET_MAC_PACKET_FILTER_RA_SHIFT (31U) -/*! RA - Receive All - * 0b0..Receive All is disabled - * 0b1..Receive All is enabled - */ -#define ENET_MAC_PACKET_FILTER_RA(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PACKET_FILTER_RA_SHIFT)) & ENET_MAC_PACKET_FILTER_RA_MASK) -/*! @} */ - -/*! @name MAC_WATCHDOG_TIMEOUT - Watchdog Timeout */ -/*! @{ */ - -#define ENET_MAC_WATCHDOG_TIMEOUT_WTO_MASK (0xFU) -#define ENET_MAC_WATCHDOG_TIMEOUT_WTO_SHIFT (0U) -/*! WTO - Watchdog Timeout - * 0b1000..10 KB - * 0b1001..11 KB - * 0b1010..12 KB - * 0b1011..13 KB - * 0b1100..14 KB - * 0b1101..15 KB - * 0b1110..16383 Bytes - * 0b0000..2 KB - * 0b0001..3 KB - * 0b0010..4 KB - * 0b0011..5 KB - * 0b0100..6 KB - * 0b0101..7 KB - * 0b0110..8 KB - * 0b0111..9 KB - * 0b1111..Reserved - */ -#define ENET_MAC_WATCHDOG_TIMEOUT_WTO(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_WATCHDOG_TIMEOUT_WTO_SHIFT)) & ENET_MAC_WATCHDOG_TIMEOUT_WTO_MASK) - -#define ENET_MAC_WATCHDOG_TIMEOUT_PWE_MASK (0x100U) -#define ENET_MAC_WATCHDOG_TIMEOUT_PWE_SHIFT (8U) -/*! PWE - Programmable Watchdog Enable - * 0b0..Programmable Watchdog is disabled - * 0b1..Programmable Watchdog is enabled - */ -#define ENET_MAC_WATCHDOG_TIMEOUT_PWE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_WATCHDOG_TIMEOUT_PWE_SHIFT)) & ENET_MAC_WATCHDOG_TIMEOUT_PWE_MASK) -/*! @} */ - -/*! @name MAC_VLAN_TAG_CTRL - MAC VLAN Tag Control */ -/*! @{ */ - -#define ENET_MAC_VLAN_TAG_CTRL_VL_MASK (0xFFFFU) -#define ENET_MAC_VLAN_TAG_CTRL_VL_SHIFT (0U) -/*! VL - VLAN Tag Identifier for Receive Packets */ -#define ENET_MAC_VLAN_TAG_CTRL_VL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_TAG_CTRL_VL_SHIFT)) & ENET_MAC_VLAN_TAG_CTRL_VL_MASK) - -#define ENET_MAC_VLAN_TAG_CTRL_ETV_MASK (0x10000U) -#define ENET_MAC_VLAN_TAG_CTRL_ETV_SHIFT (16U) -/*! ETV - Enable 12-Bit VLAN Tag Comparison - * 0b0..12-bit VLAN Tag Comparison is disabled - * 0b1..12-bit VLAN Tag Comparison is enabled - */ -#define ENET_MAC_VLAN_TAG_CTRL_ETV(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_TAG_CTRL_ETV_SHIFT)) & ENET_MAC_VLAN_TAG_CTRL_ETV_MASK) - -#define ENET_MAC_VLAN_TAG_CTRL_VTIM_MASK (0x20000U) -#define ENET_MAC_VLAN_TAG_CTRL_VTIM_SHIFT (17U) -/*! VTIM - VLAN Tag Inverse Match Enable - * 0b0..VLAN Tag Inverse Match is disabled - * 0b1..VLAN Tag Inverse Match is enabled - */ -#define ENET_MAC_VLAN_TAG_CTRL_VTIM(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_TAG_CTRL_VTIM_SHIFT)) & ENET_MAC_VLAN_TAG_CTRL_VTIM_MASK) - -#define ENET_MAC_VLAN_TAG_CTRL_ESVL_MASK (0x40000U) -#define ENET_MAC_VLAN_TAG_CTRL_ESVL_SHIFT (18U) -/*! ESVL - Enable S-VLAN - * 0b0..S-VLAN is disabled - * 0b1..S-VLAN is enabled - */ -#define ENET_MAC_VLAN_TAG_CTRL_ESVL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_TAG_CTRL_ESVL_SHIFT)) & ENET_MAC_VLAN_TAG_CTRL_ESVL_MASK) - -#define ENET_MAC_VLAN_TAG_CTRL_ERSVLM_MASK (0x80000U) -#define ENET_MAC_VLAN_TAG_CTRL_ERSVLM_SHIFT (19U) -/*! ERSVLM - Enable Receive S-VLAN Match - * 0b0..Receive S-VLAN Match is disabled - * 0b1..Receive S-VLAN Match is enabled - */ -#define ENET_MAC_VLAN_TAG_CTRL_ERSVLM(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_TAG_CTRL_ERSVLM_SHIFT)) & ENET_MAC_VLAN_TAG_CTRL_ERSVLM_MASK) - -#define ENET_MAC_VLAN_TAG_CTRL_DOVLTC_MASK (0x100000U) -#define ENET_MAC_VLAN_TAG_CTRL_DOVLTC_SHIFT (20U) -/*! DOVLTC - Disable VLAN Type Check - * 0b1..VLAN Type Check is disabled - * 0b0..VLAN Type Check is enabled - */ -#define ENET_MAC_VLAN_TAG_CTRL_DOVLTC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_TAG_CTRL_DOVLTC_SHIFT)) & ENET_MAC_VLAN_TAG_CTRL_DOVLTC_MASK) - -#define ENET_MAC_VLAN_TAG_CTRL_EVLS_MASK (0x600000U) -#define ENET_MAC_VLAN_TAG_CTRL_EVLS_SHIFT (21U) -/*! EVLS - Enable VLAN Tag Stripping on Receive - * 0b11..Always strip - * 0b00..Do not strip - * 0b10..Strip if VLAN filter fails - * 0b01..Strip if VLAN filter passes - */ -#define ENET_MAC_VLAN_TAG_CTRL_EVLS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_TAG_CTRL_EVLS_SHIFT)) & ENET_MAC_VLAN_TAG_CTRL_EVLS_MASK) - -#define ENET_MAC_VLAN_TAG_CTRL_EVLRXS_MASK (0x1000000U) -#define ENET_MAC_VLAN_TAG_CTRL_EVLRXS_SHIFT (24U) -/*! EVLRXS - Enable VLAN Tag in Rx status - * 0b0..VLAN Tag in Rx status is disabled - * 0b1..VLAN Tag in Rx status is enabled - */ -#define ENET_MAC_VLAN_TAG_CTRL_EVLRXS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_TAG_CTRL_EVLRXS_SHIFT)) & ENET_MAC_VLAN_TAG_CTRL_EVLRXS_MASK) - -#define ENET_MAC_VLAN_TAG_CTRL_EDVLP_MASK (0x4000000U) -#define ENET_MAC_VLAN_TAG_CTRL_EDVLP_SHIFT (26U) -/*! EDVLP - Enable Double VLAN Processing - * 0b0..Double VLAN Processing is disabled - * 0b1..Double VLAN Processing is enabled - */ -#define ENET_MAC_VLAN_TAG_CTRL_EDVLP(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_TAG_CTRL_EDVLP_SHIFT)) & ENET_MAC_VLAN_TAG_CTRL_EDVLP_MASK) - -#define ENET_MAC_VLAN_TAG_CTRL_ERIVLT_MASK (0x8000000U) -#define ENET_MAC_VLAN_TAG_CTRL_ERIVLT_SHIFT (27U) -/*! ERIVLT - Enable Inner VLAN Tag - * 0b0..Inner VLAN tag is disabled - * 0b1..Inner VLAN tag is enabled - */ -#define ENET_MAC_VLAN_TAG_CTRL_ERIVLT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_TAG_CTRL_ERIVLT_SHIFT)) & ENET_MAC_VLAN_TAG_CTRL_ERIVLT_MASK) - -#define ENET_MAC_VLAN_TAG_CTRL_EIVLS_MASK (0x30000000U) -#define ENET_MAC_VLAN_TAG_CTRL_EIVLS_SHIFT (28U) -/*! EIVLS - Enable Inner VLAN Tag Stripping on Receive - * 0b11..Always strip - * 0b00..Do not strip - * 0b10..Strip if VLAN filter fails - * 0b01..Strip if VLAN filter passes - */ -#define ENET_MAC_VLAN_TAG_CTRL_EIVLS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_TAG_CTRL_EIVLS_SHIFT)) & ENET_MAC_VLAN_TAG_CTRL_EIVLS_MASK) - -#define ENET_MAC_VLAN_TAG_CTRL_EIVLRXS_MASK (0x80000000U) -#define ENET_MAC_VLAN_TAG_CTRL_EIVLRXS_SHIFT (31U) -/*! EIVLRXS - Enable Inner VLAN Tag in Rx Status - * 0b0..Inner VLAN Tag in Rx status is disabled - * 0b1..Inner VLAN Tag in Rx status is enabled - */ -#define ENET_MAC_VLAN_TAG_CTRL_EIVLRXS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_TAG_CTRL_EIVLRXS_SHIFT)) & ENET_MAC_VLAN_TAG_CTRL_EIVLRXS_MASK) -/*! @} */ - -/*! @name MAC_VLAN_INCL - VLAN Tag Inclusion or Replacement */ -/*! @{ */ - -#define ENET_MAC_VLAN_INCL_VLT_MASK (0xFFFFU) -#define ENET_MAC_VLAN_INCL_VLT_SHIFT (0U) -/*! VLT - VLAN Tag for Transmit Packets */ -#define ENET_MAC_VLAN_INCL_VLT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_INCL_VLT_SHIFT)) & ENET_MAC_VLAN_INCL_VLT_MASK) - -#define ENET_MAC_VLAN_INCL_VLC_MASK (0x30000U) -#define ENET_MAC_VLAN_INCL_VLC_SHIFT (16U) -/*! VLC - VLAN Tag Control in Transmit Packets - * 0b01..VLAN tag deletion - * 0b10..VLAN tag insertion - * 0b00..No VLAN tag deletion, insertion, or replacement - * 0b11..VLAN tag replacement - */ -#define ENET_MAC_VLAN_INCL_VLC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_INCL_VLC_SHIFT)) & ENET_MAC_VLAN_INCL_VLC_MASK) - -#define ENET_MAC_VLAN_INCL_VLP_MASK (0x40000U) -#define ENET_MAC_VLAN_INCL_VLP_SHIFT (18U) -/*! VLP - VLAN Priority Control - * 0b0..VLAN Priority Control is disabled - * 0b1..VLAN Priority Control is enabled - */ -#define ENET_MAC_VLAN_INCL_VLP(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_INCL_VLP_SHIFT)) & ENET_MAC_VLAN_INCL_VLP_MASK) - -#define ENET_MAC_VLAN_INCL_CSVL_MASK (0x80000U) -#define ENET_MAC_VLAN_INCL_CSVL_SHIFT (19U) -/*! CSVL - C-VLAN or S-VLAN - * 0b0..C-VLAN type (0x8100) is inserted or replaced - * 0b1..S-VLAN type (0x88A8) is inserted or replaced - */ -#define ENET_MAC_VLAN_INCL_CSVL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_INCL_CSVL_SHIFT)) & ENET_MAC_VLAN_INCL_CSVL_MASK) - -#define ENET_MAC_VLAN_INCL_VLTI_MASK (0x100000U) -#define ENET_MAC_VLAN_INCL_VLTI_SHIFT (20U) -/*! VLTI - VLAN Tag Input - * 0b0..VLAN Tag Input is disabled - * 0b1..VLAN Tag Input is enabled - */ -#define ENET_MAC_VLAN_INCL_VLTI(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_INCL_VLTI_SHIFT)) & ENET_MAC_VLAN_INCL_VLTI_MASK) - -#define ENET_MAC_VLAN_INCL_CBTI_MASK (0x200000U) -#define ENET_MAC_VLAN_INCL_CBTI_SHIFT (21U) -/*! CBTI - Channel based tag insertion - * 0b0..Channel based tag insertion is disabled - * 0b1..Channel based tag insertion is enabled - */ -#define ENET_MAC_VLAN_INCL_CBTI(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_INCL_CBTI_SHIFT)) & ENET_MAC_VLAN_INCL_CBTI_MASK) - -#define ENET_MAC_VLAN_INCL_ADDR_MASK (0x1000000U) -#define ENET_MAC_VLAN_INCL_ADDR_SHIFT (24U) -/*! ADDR - Address */ -#define ENET_MAC_VLAN_INCL_ADDR(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_INCL_ADDR_SHIFT)) & ENET_MAC_VLAN_INCL_ADDR_MASK) - -#define ENET_MAC_VLAN_INCL_RDWR_MASK (0x40000000U) -#define ENET_MAC_VLAN_INCL_RDWR_SHIFT (30U) -/*! RDWR - Read write control - * 0b0..Read operation of indirect access - * 0b1..Write operation of indirect access - */ -#define ENET_MAC_VLAN_INCL_RDWR(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_INCL_RDWR_SHIFT)) & ENET_MAC_VLAN_INCL_RDWR_MASK) - -#define ENET_MAC_VLAN_INCL_BUSY_MASK (0x80000000U) -#define ENET_MAC_VLAN_INCL_BUSY_SHIFT (31U) -/*! BUSY - Busy - * 0b1..Busy status detected - * 0b0..Busy status not detected - */ -#define ENET_MAC_VLAN_INCL_BUSY(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VLAN_INCL_BUSY_SHIFT)) & ENET_MAC_VLAN_INCL_BUSY_MASK) -/*! @} */ - -/*! @name MAC_INNER_VLAN_INCL - MAC Inner VLAN Tag Inclusion or Replacement */ -/*! @{ */ - -#define ENET_MAC_INNER_VLAN_INCL_VLT_MASK (0xFFFFU) -#define ENET_MAC_INNER_VLAN_INCL_VLT_SHIFT (0U) -/*! VLT - VLAN Tag for Transmit Packets */ -#define ENET_MAC_INNER_VLAN_INCL_VLT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INNER_VLAN_INCL_VLT_SHIFT)) & ENET_MAC_INNER_VLAN_INCL_VLT_MASK) - -#define ENET_MAC_INNER_VLAN_INCL_VLC_MASK (0x30000U) -#define ENET_MAC_INNER_VLAN_INCL_VLC_SHIFT (16U) -/*! VLC - VLAN Tag Control in Transmit Packets - * 0b01..VLAN tag deletion - * 0b10..VLAN tag insertion - * 0b00..No VLAN tag deletion, insertion, or replacement - * 0b11..VLAN tag replacement - */ -#define ENET_MAC_INNER_VLAN_INCL_VLC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INNER_VLAN_INCL_VLC_SHIFT)) & ENET_MAC_INNER_VLAN_INCL_VLC_MASK) - -#define ENET_MAC_INNER_VLAN_INCL_VLP_MASK (0x40000U) -#define ENET_MAC_INNER_VLAN_INCL_VLP_SHIFT (18U) -/*! VLP - VLAN Priority Control - * 0b0..VLAN Priority Control is disabled - * 0b1..VLAN Priority Control is enabled - */ -#define ENET_MAC_INNER_VLAN_INCL_VLP(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INNER_VLAN_INCL_VLP_SHIFT)) & ENET_MAC_INNER_VLAN_INCL_VLP_MASK) - -#define ENET_MAC_INNER_VLAN_INCL_CSVL_MASK (0x80000U) -#define ENET_MAC_INNER_VLAN_INCL_CSVL_SHIFT (19U) -/*! CSVL - C-VLAN or S-VLAN - * 0b0..C-VLAN type (0x8100) is inserted - * 0b1..S-VLAN type (0x88A8) is inserted - */ -#define ENET_MAC_INNER_VLAN_INCL_CSVL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INNER_VLAN_INCL_CSVL_SHIFT)) & ENET_MAC_INNER_VLAN_INCL_CSVL_MASK) - -#define ENET_MAC_INNER_VLAN_INCL_VLTI_MASK (0x100000U) -#define ENET_MAC_INNER_VLAN_INCL_VLTI_SHIFT (20U) -/*! VLTI - VLAN Tag Input - * 0b0..VLAN Tag Input is disabled - * 0b1..VLAN Tag Input is enabled - */ -#define ENET_MAC_INNER_VLAN_INCL_VLTI(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INNER_VLAN_INCL_VLTI_SHIFT)) & ENET_MAC_INNER_VLAN_INCL_VLTI_MASK) -/*! @} */ - -/*! @name MAC_TX_FLOW_CTRL_Q - MAC Q0 Tx Flow Control */ -/*! @{ */ - -#define ENET_MAC_TX_FLOW_CTRL_Q_FCB_BPA_MASK (0x1U) -#define ENET_MAC_TX_FLOW_CTRL_Q_FCB_BPA_SHIFT (0U) -/*! FCB_BPA - Flow Control Busy or Backpressure Activate - * 0b0..Flow Control Busy or Backpressure Activate is disabled - * 0b1..Flow Control Busy or Backpressure Activate is enabled - */ -#define ENET_MAC_TX_FLOW_CTRL_Q_FCB_BPA(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TX_FLOW_CTRL_Q_FCB_BPA_SHIFT)) & ENET_MAC_TX_FLOW_CTRL_Q_FCB_BPA_MASK) - -#define ENET_MAC_TX_FLOW_CTRL_Q_TFE_MASK (0x2U) -#define ENET_MAC_TX_FLOW_CTRL_Q_TFE_SHIFT (1U) -/*! TFE - Transmit Flow Control Enable - * 0b0..Transmit Flow Control is disabled - * 0b1..Transmit Flow Control is enabled - */ -#define ENET_MAC_TX_FLOW_CTRL_Q_TFE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TX_FLOW_CTRL_Q_TFE_SHIFT)) & ENET_MAC_TX_FLOW_CTRL_Q_TFE_MASK) - -#define ENET_MAC_TX_FLOW_CTRL_Q_PLT_MASK (0x70U) -#define ENET_MAC_TX_FLOW_CTRL_Q_PLT_SHIFT (4U) -/*! PLT - Pause Low Threshold - * 0b011..Pause Time minus 144 Slot Times (PT -144 slot times) - * 0b100..Pause Time minus 256 Slot Times (PT -256 slot times) - * 0b001..Pause Time minus 28 Slot Times (PT -28 slot times) - * 0b010..Pause Time minus 36 Slot Times (PT -36 slot times) - * 0b000..Pause Time minus 4 Slot Times (PT -4 slot times) - * 0b101..Pause Time minus 512 Slot Times (PT -512 slot times) - * 0b110..Reserved - */ -#define ENET_MAC_TX_FLOW_CTRL_Q_PLT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TX_FLOW_CTRL_Q_PLT_SHIFT)) & ENET_MAC_TX_FLOW_CTRL_Q_PLT_MASK) - -#define ENET_MAC_TX_FLOW_CTRL_Q_DZPQ_MASK (0x80U) -#define ENET_MAC_TX_FLOW_CTRL_Q_DZPQ_SHIFT (7U) -/*! DZPQ - Disable Zero-Quanta Pause - * 0b1..Zero-Quanta Pause packet generation is disabled - * 0b0..Zero-Quanta Pause packet generation is enabled - */ -#define ENET_MAC_TX_FLOW_CTRL_Q_DZPQ(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TX_FLOW_CTRL_Q_DZPQ_SHIFT)) & ENET_MAC_TX_FLOW_CTRL_Q_DZPQ_MASK) - -#define ENET_MAC_TX_FLOW_CTRL_Q_PT_MASK (0xFFFF0000U) -#define ENET_MAC_TX_FLOW_CTRL_Q_PT_SHIFT (16U) -/*! PT - Pause Time */ -#define ENET_MAC_TX_FLOW_CTRL_Q_PT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TX_FLOW_CTRL_Q_PT_SHIFT)) & ENET_MAC_TX_FLOW_CTRL_Q_PT_MASK) -/*! @} */ - -/* The count of ENET_MAC_TX_FLOW_CTRL_Q */ -#define ENET_MAC_TX_FLOW_CTRL_Q_COUNT (1U) - -/*! @name MAC_RX_FLOW_CTRL - MAC Rx Flow Control */ -/*! @{ */ - -#define ENET_MAC_RX_FLOW_CTRL_RFE_MASK (0x1U) -#define ENET_MAC_RX_FLOW_CTRL_RFE_SHIFT (0U) -/*! RFE - Receive Flow Control Enable - * 0b0..Receive Flow Control is disabled - * 0b1..Receive Flow Control is enabled - */ -#define ENET_MAC_RX_FLOW_CTRL_RFE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RX_FLOW_CTRL_RFE_SHIFT)) & ENET_MAC_RX_FLOW_CTRL_RFE_MASK) - -#define ENET_MAC_RX_FLOW_CTRL_UP_MASK (0x2U) -#define ENET_MAC_RX_FLOW_CTRL_UP_SHIFT (1U) -/*! UP - Unicast Pause Packet Detect - * 0b0..Unicast Pause Packet Detect disabled - * 0b1..Unicast Pause Packet Detect enabled - */ -#define ENET_MAC_RX_FLOW_CTRL_UP(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RX_FLOW_CTRL_UP_SHIFT)) & ENET_MAC_RX_FLOW_CTRL_UP_MASK) -/*! @} */ - -/*! @name MAC_RXQ_CTRL4 - Receive Queue Control 4 */ -/*! @{ */ - -#define ENET_MAC_RXQ_CTRL4_UFFQE_MASK (0x1U) -#define ENET_MAC_RXQ_CTRL4_UFFQE_SHIFT (0U) -/*! UFFQE - Unicast Address Filter Fail Packets Queuing Enable. - * 0b0..Unicast Address Filter Fail Packets Queuing is disabled - * 0b1..Unicast Address Filter Fail Packets Queuing is enabled - */ -#define ENET_MAC_RXQ_CTRL4_UFFQE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL4_UFFQE_SHIFT)) & ENET_MAC_RXQ_CTRL4_UFFQE_MASK) - -#define ENET_MAC_RXQ_CTRL4_UFFQ_MASK (0x2U) -#define ENET_MAC_RXQ_CTRL4_UFFQ_SHIFT (1U) -/*! UFFQ - Unicast Address Filter Fail Packets Queue. */ -#define ENET_MAC_RXQ_CTRL4_UFFQ(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL4_UFFQ_SHIFT)) & ENET_MAC_RXQ_CTRL4_UFFQ_MASK) - -#define ENET_MAC_RXQ_CTRL4_MFFQE_MASK (0x100U) -#define ENET_MAC_RXQ_CTRL4_MFFQE_SHIFT (8U) -/*! MFFQE - Multicast Address Filter Fail Packets Queuing Enable. - * 0b0..Multicast Address Filter Fail Packets Queuing is disabled - * 0b1..Multicast Address Filter Fail Packets Queuing is enabled - */ -#define ENET_MAC_RXQ_CTRL4_MFFQE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL4_MFFQE_SHIFT)) & ENET_MAC_RXQ_CTRL4_MFFQE_MASK) - -#define ENET_MAC_RXQ_CTRL4_MFFQ_MASK (0x200U) -#define ENET_MAC_RXQ_CTRL4_MFFQ_SHIFT (9U) -/*! MFFQ - Multicast Address Filter Fail Packets Queue. */ -#define ENET_MAC_RXQ_CTRL4_MFFQ(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL4_MFFQ_SHIFT)) & ENET_MAC_RXQ_CTRL4_MFFQ_MASK) - -#define ENET_MAC_RXQ_CTRL4_VFFQE_MASK (0x10000U) -#define ENET_MAC_RXQ_CTRL4_VFFQE_SHIFT (16U) -/*! VFFQE - VLAN Tag Filter Fail Packets Queuing Enable - * 0b0..VLAN tag Filter Fail Packets Queuing is disabled - * 0b1..VLAN tag Filter Fail Packets Queuing is enabled - */ -#define ENET_MAC_RXQ_CTRL4_VFFQE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL4_VFFQE_SHIFT)) & ENET_MAC_RXQ_CTRL4_VFFQE_MASK) - -#define ENET_MAC_RXQ_CTRL4_VFFQ_MASK (0x20000U) -#define ENET_MAC_RXQ_CTRL4_VFFQ_SHIFT (17U) -/*! VFFQ - VLAN Tag Filter Fail Packets Queue */ -#define ENET_MAC_RXQ_CTRL4_VFFQ(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL4_VFFQ_SHIFT)) & ENET_MAC_RXQ_CTRL4_VFFQ_MASK) -/*! @} */ - -/*! @name MAC_RXQ_CTRL - Receive Queue Control 0..Receive Queue Control 2 */ -/*! @{ */ - -#define ENET_MAC_RXQ_CTRL_AVCPQ_MASK (0x7U) -#define ENET_MAC_RXQ_CTRL_AVCPQ_SHIFT (0U) -/*! AVCPQ - AV Untagged Control Packets Queue - * 0b000..Receive Queue 0 - * 0b001..Receive Queue 1 - */ -#define ENET_MAC_RXQ_CTRL_AVCPQ(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL_AVCPQ_SHIFT)) & ENET_MAC_RXQ_CTRL_AVCPQ_MASK) - -#define ENET_MAC_RXQ_CTRL_PSRQ0_MASK (0xFFU) -#define ENET_MAC_RXQ_CTRL_PSRQ0_SHIFT (0U) -/*! PSRQ0 - Priorities Selected in the Receive Queue 0 */ -#define ENET_MAC_RXQ_CTRL_PSRQ0(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL_PSRQ0_SHIFT)) & ENET_MAC_RXQ_CTRL_PSRQ0_MASK) - -#define ENET_MAC_RXQ_CTRL_RXQ0EN_MASK (0x3U) -#define ENET_MAC_RXQ_CTRL_RXQ0EN_SHIFT (0U) -/*! RXQ0EN - Receive Queue 0 Enable - * 0b00..Queue not enabled - * 0b01..Queue enabled for AV - * 0b10..Queue enabled for DCB/Generic - * 0b11..Reserved - */ -#define ENET_MAC_RXQ_CTRL_RXQ0EN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL_RXQ0EN_SHIFT)) & ENET_MAC_RXQ_CTRL_RXQ0EN_MASK) - -#define ENET_MAC_RXQ_CTRL_RXQ1EN_MASK (0xCU) -#define ENET_MAC_RXQ_CTRL_RXQ1EN_SHIFT (2U) -/*! RXQ1EN - Receive Queue 1 Enable - * 0b00..Queue not enabled - * 0b01..Queue enabled for AV - * 0b10..Queue enabled for DCB/Generic - * 0b11..Reserved - */ -#define ENET_MAC_RXQ_CTRL_RXQ1EN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL_RXQ1EN_SHIFT)) & ENET_MAC_RXQ_CTRL_RXQ1EN_MASK) - -#define ENET_MAC_RXQ_CTRL_PTPQ_MASK (0x70U) -#define ENET_MAC_RXQ_CTRL_PTPQ_SHIFT (4U) -/*! PTPQ - PTP Packets Queue - * 0b000..Receive Queue 0 - * 0b001..Receive Queue 1 - */ -#define ENET_MAC_RXQ_CTRL_PTPQ(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL_PTPQ_SHIFT)) & ENET_MAC_RXQ_CTRL_PTPQ_MASK) - -#define ENET_MAC_RXQ_CTRL_PSRQ1_MASK (0xFF00U) -#define ENET_MAC_RXQ_CTRL_PSRQ1_SHIFT (8U) -/*! PSRQ1 - Priorities Selected in the Receive Queue 1 */ -#define ENET_MAC_RXQ_CTRL_PSRQ1(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL_PSRQ1_SHIFT)) & ENET_MAC_RXQ_CTRL_PSRQ1_MASK) - -#define ENET_MAC_RXQ_CTRL_UPQ_MASK (0x7000U) -#define ENET_MAC_RXQ_CTRL_UPQ_SHIFT (12U) -/*! UPQ - Untagged Packet Queue - * 0b000..Receive Queue 0 - * 0b001..Receive Queue 1 - */ -#define ENET_MAC_RXQ_CTRL_UPQ(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL_UPQ_SHIFT)) & ENET_MAC_RXQ_CTRL_UPQ_MASK) - -#define ENET_MAC_RXQ_CTRL_MCBCQ_MASK (0x70000U) -#define ENET_MAC_RXQ_CTRL_MCBCQ_SHIFT (16U) -/*! MCBCQ - Multicast and Broadcast Queue - * 0b000..Receive Queue 0 - * 0b001..Receive Queue 1 - */ -#define ENET_MAC_RXQ_CTRL_MCBCQ(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL_MCBCQ_SHIFT)) & ENET_MAC_RXQ_CTRL_MCBCQ_MASK) - -#define ENET_MAC_RXQ_CTRL_MCBCQEN_MASK (0x100000U) -#define ENET_MAC_RXQ_CTRL_MCBCQEN_SHIFT (20U) -/*! MCBCQEN - Multicast and Broadcast Queue Enable - * 0b0..Multicast and Broadcast Queue is disabled - * 0b1..Multicast and Broadcast Queue is enabled - */ -#define ENET_MAC_RXQ_CTRL_MCBCQEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL_MCBCQEN_SHIFT)) & ENET_MAC_RXQ_CTRL_MCBCQEN_MASK) - -#define ENET_MAC_RXQ_CTRL_TACPQE_MASK (0x200000U) -#define ENET_MAC_RXQ_CTRL_TACPQE_SHIFT (21U) -/*! TACPQE - Tagged AV Control Packets Queuing Enable. - * 0b0..Tagged AV Control Packets Queuing is disabled - * 0b1..Tagged AV Control Packets Queuing is enabled - */ -#define ENET_MAC_RXQ_CTRL_TACPQE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL_TACPQE_SHIFT)) & ENET_MAC_RXQ_CTRL_TACPQE_MASK) - -#define ENET_MAC_RXQ_CTRL_TPQC_MASK (0xC00000U) -#define ENET_MAC_RXQ_CTRL_TPQC_SHIFT (22U) -/*! TPQC - Tagged PTP over Ethernet Packets Queuing Control. */ -#define ENET_MAC_RXQ_CTRL_TPQC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL_TPQC_SHIFT)) & ENET_MAC_RXQ_CTRL_TPQC_MASK) - -#define ENET_MAC_RXQ_CTRL_OMCBCQ_MASK (0x10000000U) -#define ENET_MAC_RXQ_CTRL_OMCBCQ_SHIFT (28U) -/*! OMCBCQ - OMCBCQ - * 0b0..overriding MCBCQ priority disabled - * 0b1..overriding MCBCQ priority enabled - */ -#define ENET_MAC_RXQ_CTRL_OMCBCQ(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL_OMCBCQ_SHIFT)) & ENET_MAC_RXQ_CTRL_OMCBCQ_MASK) - -#define ENET_MAC_RXQ_CTRL_TBRQE_MASK (0x20000000U) -#define ENET_MAC_RXQ_CTRL_TBRQE_SHIFT (29U) -/*! TBRQE - Type Field Based Rx Queuing Enable */ -#define ENET_MAC_RXQ_CTRL_TBRQE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RXQ_CTRL_TBRQE_SHIFT)) & ENET_MAC_RXQ_CTRL_TBRQE_MASK) -/*! @} */ - -/* The count of ENET_MAC_RXQ_CTRL */ -#define ENET_MAC_RXQ_CTRL_COUNT (3U) - -/*! @name MAC_INTERRUPT_STATUS - Interrupt Status */ -/*! @{ */ - -#define ENET_MAC_INTERRUPT_STATUS_PHYIS_MASK (0x8U) -#define ENET_MAC_INTERRUPT_STATUS_PHYIS_SHIFT (3U) -/*! PHYIS - PHY Interrupt - * 0b1..PHY Interrupt detected - * 0b0..PHY Interrupt not detected - */ -#define ENET_MAC_INTERRUPT_STATUS_PHYIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INTERRUPT_STATUS_PHYIS_SHIFT)) & ENET_MAC_INTERRUPT_STATUS_PHYIS_MASK) - -#define ENET_MAC_INTERRUPT_STATUS_PMTIS_MASK (0x10U) -#define ENET_MAC_INTERRUPT_STATUS_PMTIS_SHIFT (4U) -/*! PMTIS - PMTIS - * 0b1..PMT Interrupt status active - * 0b0..PMT Interrupt status not active - */ -#define ENET_MAC_INTERRUPT_STATUS_PMTIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INTERRUPT_STATUS_PMTIS_SHIFT)) & ENET_MAC_INTERRUPT_STATUS_PMTIS_MASK) - -#define ENET_MAC_INTERRUPT_STATUS_LPIIS_MASK (0x20U) -#define ENET_MAC_INTERRUPT_STATUS_LPIIS_SHIFT (5U) -/*! LPIIS - LPIIS - * 0b1..LPI Interrupt status active - * 0b0..LPI Interrupt status not active - */ -#define ENET_MAC_INTERRUPT_STATUS_LPIIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INTERRUPT_STATUS_LPIIS_SHIFT)) & ENET_MAC_INTERRUPT_STATUS_LPIIS_MASK) - -#define ENET_MAC_INTERRUPT_STATUS_TSIS_MASK (0x1000U) -#define ENET_MAC_INTERRUPT_STATUS_TSIS_SHIFT (12U) -/*! TSIS - TSIS - * 0b1..Timestamp Interrupt status active - * 0b0..Timestamp Interrupt status not active - */ -#define ENET_MAC_INTERRUPT_STATUS_TSIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INTERRUPT_STATUS_TSIS_SHIFT)) & ENET_MAC_INTERRUPT_STATUS_TSIS_MASK) - -#define ENET_MAC_INTERRUPT_STATUS_TXSTSIS_MASK (0x2000U) -#define ENET_MAC_INTERRUPT_STATUS_TXSTSIS_SHIFT (13U) -/*! TXSTSIS - Transmit Status Interrupt - * 0b1..Transmit Interrupt status active - * 0b0..Transmit Interrupt status not active - */ -#define ENET_MAC_INTERRUPT_STATUS_TXSTSIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INTERRUPT_STATUS_TXSTSIS_SHIFT)) & ENET_MAC_INTERRUPT_STATUS_TXSTSIS_MASK) - -#define ENET_MAC_INTERRUPT_STATUS_RXSTSIS_MASK (0x4000U) -#define ENET_MAC_INTERRUPT_STATUS_RXSTSIS_SHIFT (14U) -/*! RXSTSIS - Receive Status Interrupt - * 0b1..Receive Interrupt status active - * 0b0..Receive Interrupt status not active - */ -#define ENET_MAC_INTERRUPT_STATUS_RXSTSIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INTERRUPT_STATUS_RXSTSIS_SHIFT)) & ENET_MAC_INTERRUPT_STATUS_RXSTSIS_MASK) - -#define ENET_MAC_INTERRUPT_STATUS_MDIOIS_MASK (0x40000U) -#define ENET_MAC_INTERRUPT_STATUS_MDIOIS_SHIFT (18U) -/*! MDIOIS - MDIO Interrupt Status - * 0b1..MDIO Interrupt status active - * 0b0..MDIO Interrupt status not active - */ -#define ENET_MAC_INTERRUPT_STATUS_MDIOIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INTERRUPT_STATUS_MDIOIS_SHIFT)) & ENET_MAC_INTERRUPT_STATUS_MDIOIS_MASK) -/*! @} */ - -/*! @name MAC_INTERRUPT_ENABLE - Interrupt Enable */ -/*! @{ */ - -#define ENET_MAC_INTERRUPT_ENABLE_PHYIE_MASK (0x8U) -#define ENET_MAC_INTERRUPT_ENABLE_PHYIE_SHIFT (3U) -/*! PHYIE - PHY Interrupt Enable - * 0b0..PHY Interrupt is disabled - * 0b1..PHY Interrupt is enabled - */ -#define ENET_MAC_INTERRUPT_ENABLE_PHYIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INTERRUPT_ENABLE_PHYIE_SHIFT)) & ENET_MAC_INTERRUPT_ENABLE_PHYIE_MASK) - -#define ENET_MAC_INTERRUPT_ENABLE_PMTIE_MASK (0x10U) -#define ENET_MAC_INTERRUPT_ENABLE_PMTIE_SHIFT (4U) -/*! PMTIE - PMT Interrupt Enable - * 0b0..PMT Interrupt is disabled - * 0b1..PMT Interrupt is enabled - */ -#define ENET_MAC_INTERRUPT_ENABLE_PMTIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INTERRUPT_ENABLE_PMTIE_SHIFT)) & ENET_MAC_INTERRUPT_ENABLE_PMTIE_MASK) - -#define ENET_MAC_INTERRUPT_ENABLE_LPIIE_MASK (0x20U) -#define ENET_MAC_INTERRUPT_ENABLE_LPIIE_SHIFT (5U) -/*! LPIIE - LPI Interrupt Enable - * 0b0..LPI Interrupt is disabled - * 0b1..LPI Interrupt is enabled - */ -#define ENET_MAC_INTERRUPT_ENABLE_LPIIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INTERRUPT_ENABLE_LPIIE_SHIFT)) & ENET_MAC_INTERRUPT_ENABLE_LPIIE_MASK) - -#define ENET_MAC_INTERRUPT_ENABLE_TSIE_MASK (0x1000U) -#define ENET_MAC_INTERRUPT_ENABLE_TSIE_SHIFT (12U) -/*! TSIE - Timestamp Interrupt Enable - * 0b0..Timestamp Interrupt is disabled - * 0b1..Timestamp Interrupt is enabled - */ -#define ENET_MAC_INTERRUPT_ENABLE_TSIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INTERRUPT_ENABLE_TSIE_SHIFT)) & ENET_MAC_INTERRUPT_ENABLE_TSIE_MASK) - -#define ENET_MAC_INTERRUPT_ENABLE_TXSTSIE_MASK (0x2000U) -#define ENET_MAC_INTERRUPT_ENABLE_TXSTSIE_SHIFT (13U) -/*! TXSTSIE - Transmit Status Interrupt Enable - * 0b0..Timestamp Status Interrupt is disabled - * 0b1..Timestamp Status Interrupt is enabled - */ -#define ENET_MAC_INTERRUPT_ENABLE_TXSTSIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INTERRUPT_ENABLE_TXSTSIE_SHIFT)) & ENET_MAC_INTERRUPT_ENABLE_TXSTSIE_MASK) - -#define ENET_MAC_INTERRUPT_ENABLE_RXSTSIE_MASK (0x4000U) -#define ENET_MAC_INTERRUPT_ENABLE_RXSTSIE_SHIFT (14U) -/*! RXSTSIE - Receive Status Interrupt Enable - * 0b0..Receive Status Interrupt is disabled - * 0b1..Receive Status Interrupt is enabled - */ -#define ENET_MAC_INTERRUPT_ENABLE_RXSTSIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INTERRUPT_ENABLE_RXSTSIE_SHIFT)) & ENET_MAC_INTERRUPT_ENABLE_RXSTSIE_MASK) - -#define ENET_MAC_INTERRUPT_ENABLE_MDIOIE_MASK (0x40000U) -#define ENET_MAC_INTERRUPT_ENABLE_MDIOIE_SHIFT (18U) -/*! MDIOIE - MDIO Interrupt Enable - * 0b0..MDIO Interrupt is disabled - * 0b1..MDIO Interrupt is enabled - */ -#define ENET_MAC_INTERRUPT_ENABLE_MDIOIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_INTERRUPT_ENABLE_MDIOIE_SHIFT)) & ENET_MAC_INTERRUPT_ENABLE_MDIOIE_MASK) -/*! @} */ - -/*! @name MAC_RX_TX_STATUS - Receive Transmit Status */ -/*! @{ */ - -#define ENET_MAC_RX_TX_STATUS_TJT_MASK (0x1U) -#define ENET_MAC_RX_TX_STATUS_TJT_SHIFT (0U) -/*! TJT - Transmit Jabber Timeout - * 0b1..Transmit Jabber Timeout occurred - * 0b0..No Transmit Jabber Timeout - */ -#define ENET_MAC_RX_TX_STATUS_TJT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RX_TX_STATUS_TJT_SHIFT)) & ENET_MAC_RX_TX_STATUS_TJT_MASK) - -#define ENET_MAC_RX_TX_STATUS_NCARR_MASK (0x2U) -#define ENET_MAC_RX_TX_STATUS_NCARR_SHIFT (1U) -/*! NCARR - No Carrier - * 0b1..No carrier - * 0b0..Carrier is present - */ -#define ENET_MAC_RX_TX_STATUS_NCARR(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RX_TX_STATUS_NCARR_SHIFT)) & ENET_MAC_RX_TX_STATUS_NCARR_MASK) - -#define ENET_MAC_RX_TX_STATUS_LCARR_MASK (0x4U) -#define ENET_MAC_RX_TX_STATUS_LCARR_SHIFT (2U) -/*! LCARR - Loss of Carrier - * 0b1..Loss of carrier - * 0b0..Carrier is present - */ -#define ENET_MAC_RX_TX_STATUS_LCARR(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RX_TX_STATUS_LCARR_SHIFT)) & ENET_MAC_RX_TX_STATUS_LCARR_MASK) - -#define ENET_MAC_RX_TX_STATUS_EXDEF_MASK (0x8U) -#define ENET_MAC_RX_TX_STATUS_EXDEF_SHIFT (3U) -/*! EXDEF - Excessive Deferral - * 0b1..Excessive deferral - * 0b0..No Excessive deferral - */ -#define ENET_MAC_RX_TX_STATUS_EXDEF(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RX_TX_STATUS_EXDEF_SHIFT)) & ENET_MAC_RX_TX_STATUS_EXDEF_MASK) - -#define ENET_MAC_RX_TX_STATUS_LCOL_MASK (0x10U) -#define ENET_MAC_RX_TX_STATUS_LCOL_SHIFT (4U) -/*! LCOL - Late Collision - * 0b1..Late collision is sensed - * 0b0..No collision - */ -#define ENET_MAC_RX_TX_STATUS_LCOL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RX_TX_STATUS_LCOL_SHIFT)) & ENET_MAC_RX_TX_STATUS_LCOL_MASK) - -#define ENET_MAC_RX_TX_STATUS_EXCOL_MASK (0x20U) -#define ENET_MAC_RX_TX_STATUS_EXCOL_SHIFT (5U) -/*! EXCOL - Excessive Collisions - * 0b1..Excessive collision is sensed - * 0b0..No collision - */ -#define ENET_MAC_RX_TX_STATUS_EXCOL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RX_TX_STATUS_EXCOL_SHIFT)) & ENET_MAC_RX_TX_STATUS_EXCOL_MASK) - -#define ENET_MAC_RX_TX_STATUS_RWT_MASK (0x100U) -#define ENET_MAC_RX_TX_STATUS_RWT_SHIFT (8U) -/*! RWT - Receive Watchdog Timeout - * 0b1..Receive watchdog timed out - * 0b0..No receive watchdog timeout - */ -#define ENET_MAC_RX_TX_STATUS_RWT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RX_TX_STATUS_RWT_SHIFT)) & ENET_MAC_RX_TX_STATUS_RWT_MASK) -/*! @} */ - -/*! @name MAC_PMT_CONTROL_STATUS - PMT Control and Status */ -/*! @{ */ - -#define ENET_MAC_PMT_CONTROL_STATUS_PWRDWN_MASK (0x1U) -#define ENET_MAC_PMT_CONTROL_STATUS_PWRDWN_SHIFT (0U) -/*! PWRDWN - Power Down - * 0b0..Power down is disabled - * 0b1..Power down is enabled - */ -#define ENET_MAC_PMT_CONTROL_STATUS_PWRDWN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PMT_CONTROL_STATUS_PWRDWN_SHIFT)) & ENET_MAC_PMT_CONTROL_STATUS_PWRDWN_MASK) - -#define ENET_MAC_PMT_CONTROL_STATUS_MGKPKTEN_MASK (0x2U) -#define ENET_MAC_PMT_CONTROL_STATUS_MGKPKTEN_SHIFT (1U) -/*! MGKPKTEN - Magic Packet Enable - * 0b0..Magic Packet is disabled - * 0b1..Magic Packet is enabled - */ -#define ENET_MAC_PMT_CONTROL_STATUS_MGKPKTEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PMT_CONTROL_STATUS_MGKPKTEN_SHIFT)) & ENET_MAC_PMT_CONTROL_STATUS_MGKPKTEN_MASK) - -#define ENET_MAC_PMT_CONTROL_STATUS_RWKPKTEN_MASK (0x4U) -#define ENET_MAC_PMT_CONTROL_STATUS_RWKPKTEN_SHIFT (2U) -/*! RWKPKTEN - Remote Wake-Up Packet Enable - * 0b0..Remote wake-up packet is disabled - * 0b1..Remote wake-up packet is enabled - */ -#define ENET_MAC_PMT_CONTROL_STATUS_RWKPKTEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PMT_CONTROL_STATUS_RWKPKTEN_SHIFT)) & ENET_MAC_PMT_CONTROL_STATUS_RWKPKTEN_MASK) - -#define ENET_MAC_PMT_CONTROL_STATUS_MGKPRCVD_MASK (0x20U) -#define ENET_MAC_PMT_CONTROL_STATUS_MGKPRCVD_SHIFT (5U) -/*! MGKPRCVD - Magic Packet Received - * 0b1..Magic packet is received - * 0b0..No Magic packet is received - */ -#define ENET_MAC_PMT_CONTROL_STATUS_MGKPRCVD(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PMT_CONTROL_STATUS_MGKPRCVD_SHIFT)) & ENET_MAC_PMT_CONTROL_STATUS_MGKPRCVD_MASK) - -#define ENET_MAC_PMT_CONTROL_STATUS_RWKPRCVD_MASK (0x40U) -#define ENET_MAC_PMT_CONTROL_STATUS_RWKPRCVD_SHIFT (6U) -/*! RWKPRCVD - Remote Wake-Up Packet Received - * 0b1..Remote wake-up packet is received - * 0b0..Remote wake-up packet is received - */ -#define ENET_MAC_PMT_CONTROL_STATUS_RWKPRCVD(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PMT_CONTROL_STATUS_RWKPRCVD_SHIFT)) & ENET_MAC_PMT_CONTROL_STATUS_RWKPRCVD_MASK) - -#define ENET_MAC_PMT_CONTROL_STATUS_GLBLUCAST_MASK (0x200U) -#define ENET_MAC_PMT_CONTROL_STATUS_GLBLUCAST_SHIFT (9U) -/*! GLBLUCAST - Global Unicast - * 0b0..Global unicast is disabled - * 0b1..Global unicast is enabled - */ -#define ENET_MAC_PMT_CONTROL_STATUS_GLBLUCAST(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PMT_CONTROL_STATUS_GLBLUCAST_SHIFT)) & ENET_MAC_PMT_CONTROL_STATUS_GLBLUCAST_MASK) - -#define ENET_MAC_PMT_CONTROL_STATUS_RWKPFE_MASK (0x400U) -#define ENET_MAC_PMT_CONTROL_STATUS_RWKPFE_SHIFT (10U) -/*! RWKPFE - Remote Wake-up Packet Forwarding Enable - * 0b0..Remote Wake-up Packet Forwarding is disabled - * 0b1..Remote Wake-up Packet Forwarding is enabled - */ -#define ENET_MAC_PMT_CONTROL_STATUS_RWKPFE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PMT_CONTROL_STATUS_RWKPFE_SHIFT)) & ENET_MAC_PMT_CONTROL_STATUS_RWKPFE_MASK) - -#define ENET_MAC_PMT_CONTROL_STATUS_RWKPTR_MASK (0x1F000000U) -#define ENET_MAC_PMT_CONTROL_STATUS_RWKPTR_SHIFT (24U) -/*! RWKPTR - Remote Wake-up FIFO Pointer */ -#define ENET_MAC_PMT_CONTROL_STATUS_RWKPTR(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PMT_CONTROL_STATUS_RWKPTR_SHIFT)) & ENET_MAC_PMT_CONTROL_STATUS_RWKPTR_MASK) - -#define ENET_MAC_PMT_CONTROL_STATUS_RWKFILTRST_MASK (0x80000000U) -#define ENET_MAC_PMT_CONTROL_STATUS_RWKFILTRST_SHIFT (31U) -/*! RWKFILTRST - Remote Wake-Up Packet Filter Register Pointer Reset - * 0b0..Remote Wake-Up Packet Filter Register Pointer is not Reset - * 0b1..Remote Wake-Up Packet Filter Register Pointer is Reset - */ -#define ENET_MAC_PMT_CONTROL_STATUS_RWKFILTRST(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PMT_CONTROL_STATUS_RWKFILTRST_SHIFT)) & ENET_MAC_PMT_CONTROL_STATUS_RWKFILTRST_MASK) -/*! @} */ - -/*! @name MAC_RWK_PACKET_FILTER - Remote Wakeup Filter */ -/*! @{ */ - -#define ENET_MAC_RWK_PACKET_FILTER_WKUPFRMFTR_MASK (0xFFFFFFFFU) -#define ENET_MAC_RWK_PACKET_FILTER_WKUPFRMFTR_SHIFT (0U) -/*! WKUPFRMFTR - RWK Packet Filter */ -#define ENET_MAC_RWK_PACKET_FILTER_WKUPFRMFTR(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_RWK_PACKET_FILTER_WKUPFRMFTR_SHIFT)) & ENET_MAC_RWK_PACKET_FILTER_WKUPFRMFTR_MASK) -/*! @} */ - -/*! @name MAC_LPI_CONTROL_STATUS - LPI Control and Status */ -/*! @{ */ - -#define ENET_MAC_LPI_CONTROL_STATUS_TLPIEN_MASK (0x1U) -#define ENET_MAC_LPI_CONTROL_STATUS_TLPIEN_SHIFT (0U) -/*! TLPIEN - Transmit LPI Entry - * 0b1..Transmit LPI entry detected - * 0b0..Transmit LPI entry not detected - */ -#define ENET_MAC_LPI_CONTROL_STATUS_TLPIEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_LPI_CONTROL_STATUS_TLPIEN_SHIFT)) & ENET_MAC_LPI_CONTROL_STATUS_TLPIEN_MASK) - -#define ENET_MAC_LPI_CONTROL_STATUS_TLPIEX_MASK (0x2U) -#define ENET_MAC_LPI_CONTROL_STATUS_TLPIEX_SHIFT (1U) -/*! TLPIEX - Transmit LPI Exit - * 0b1..Transmit LPI exit detected - * 0b0..Transmit LPI exit not detected - */ -#define ENET_MAC_LPI_CONTROL_STATUS_TLPIEX(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_LPI_CONTROL_STATUS_TLPIEX_SHIFT)) & ENET_MAC_LPI_CONTROL_STATUS_TLPIEX_MASK) - -#define ENET_MAC_LPI_CONTROL_STATUS_RLPIEN_MASK (0x4U) -#define ENET_MAC_LPI_CONTROL_STATUS_RLPIEN_SHIFT (2U) -/*! RLPIEN - Receive LPI Entry - * 0b1..Receive LPI entry detected - * 0b0..Receive LPI entry not detected - */ -#define ENET_MAC_LPI_CONTROL_STATUS_RLPIEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_LPI_CONTROL_STATUS_RLPIEN_SHIFT)) & ENET_MAC_LPI_CONTROL_STATUS_RLPIEN_MASK) - -#define ENET_MAC_LPI_CONTROL_STATUS_RLPIEX_MASK (0x8U) -#define ENET_MAC_LPI_CONTROL_STATUS_RLPIEX_SHIFT (3U) -/*! RLPIEX - Receive LPI Exit - * 0b1..Receive LPI exit detected - * 0b0..Receive LPI exit not detected - */ -#define ENET_MAC_LPI_CONTROL_STATUS_RLPIEX(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_LPI_CONTROL_STATUS_RLPIEX_SHIFT)) & ENET_MAC_LPI_CONTROL_STATUS_RLPIEX_MASK) - -#define ENET_MAC_LPI_CONTROL_STATUS_TLPIST_MASK (0x100U) -#define ENET_MAC_LPI_CONTROL_STATUS_TLPIST_SHIFT (8U) -/*! TLPIST - Transmit LPI State - * 0b1..Transmit LPI state detected - * 0b0..Transmit LPI state not detected - */ -#define ENET_MAC_LPI_CONTROL_STATUS_TLPIST(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_LPI_CONTROL_STATUS_TLPIST_SHIFT)) & ENET_MAC_LPI_CONTROL_STATUS_TLPIST_MASK) - -#define ENET_MAC_LPI_CONTROL_STATUS_RLPIST_MASK (0x200U) -#define ENET_MAC_LPI_CONTROL_STATUS_RLPIST_SHIFT (9U) -/*! RLPIST - Receive LPI State - * 0b1..Receive LPI state detected - * 0b0..Receive LPI state not detected - */ -#define ENET_MAC_LPI_CONTROL_STATUS_RLPIST(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_LPI_CONTROL_STATUS_RLPIST_SHIFT)) & ENET_MAC_LPI_CONTROL_STATUS_RLPIST_MASK) - -#define ENET_MAC_LPI_CONTROL_STATUS_LPIEN_MASK (0x10000U) -#define ENET_MAC_LPI_CONTROL_STATUS_LPIEN_SHIFT (16U) -/*! LPIEN - LPI Enable - * 0b0..LPI state is disabled - * 0b1..LPI state is enabled - */ -#define ENET_MAC_LPI_CONTROL_STATUS_LPIEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_LPI_CONTROL_STATUS_LPIEN_SHIFT)) & ENET_MAC_LPI_CONTROL_STATUS_LPIEN_MASK) - -#define ENET_MAC_LPI_CONTROL_STATUS_PLS_MASK (0x20000U) -#define ENET_MAC_LPI_CONTROL_STATUS_PLS_SHIFT (17U) -/*! PLS - PHY Link Status - * 0b0..link is down - * 0b1..link is okay (UP) - */ -#define ENET_MAC_LPI_CONTROL_STATUS_PLS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_LPI_CONTROL_STATUS_PLS_SHIFT)) & ENET_MAC_LPI_CONTROL_STATUS_PLS_MASK) - -#define ENET_MAC_LPI_CONTROL_STATUS_LPITXA_MASK (0x80000U) -#define ENET_MAC_LPI_CONTROL_STATUS_LPITXA_SHIFT (19U) -/*! LPITXA - LPI Tx Automate - * 0b0..LPI Tx Automate is disabled - * 0b1..LPI Tx Automate is enabled - */ -#define ENET_MAC_LPI_CONTROL_STATUS_LPITXA(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_LPI_CONTROL_STATUS_LPITXA_SHIFT)) & ENET_MAC_LPI_CONTROL_STATUS_LPITXA_MASK) - -#define ENET_MAC_LPI_CONTROL_STATUS_LPIATE_MASK (0x100000U) -#define ENET_MAC_LPI_CONTROL_STATUS_LPIATE_SHIFT (20U) -/*! LPIATE - LPI Timer Enable - * 0b0..LPI Timer is disabled - * 0b1..LPI Timer is enabled - */ -#define ENET_MAC_LPI_CONTROL_STATUS_LPIATE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_LPI_CONTROL_STATUS_LPIATE_SHIFT)) & ENET_MAC_LPI_CONTROL_STATUS_LPIATE_MASK) - -#define ENET_MAC_LPI_CONTROL_STATUS_LPITCSE_MASK (0x200000U) -#define ENET_MAC_LPI_CONTROL_STATUS_LPITCSE_SHIFT (21U) -/*! LPITCSE - LPI Tx Clock Stop Enable - * 0b0..LPI Tx Clock Stop is disabled - * 0b1..LPI Tx Clock Stop is enabled - */ -#define ENET_MAC_LPI_CONTROL_STATUS_LPITCSE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_LPI_CONTROL_STATUS_LPITCSE_SHIFT)) & ENET_MAC_LPI_CONTROL_STATUS_LPITCSE_MASK) -/*! @} */ - -/*! @name MAC_LPI_TIMERS_CONTROL - LPI Timers Control */ -/*! @{ */ - -#define ENET_MAC_LPI_TIMERS_CONTROL_TWT_MASK (0xFFFFU) -#define ENET_MAC_LPI_TIMERS_CONTROL_TWT_SHIFT (0U) -/*! TWT - LPI TW Timer */ -#define ENET_MAC_LPI_TIMERS_CONTROL_TWT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_LPI_TIMERS_CONTROL_TWT_SHIFT)) & ENET_MAC_LPI_TIMERS_CONTROL_TWT_MASK) - -#define ENET_MAC_LPI_TIMERS_CONTROL_LST_MASK (0x3FF0000U) -#define ENET_MAC_LPI_TIMERS_CONTROL_LST_SHIFT (16U) -/*! LST - LPI LS Timer */ -#define ENET_MAC_LPI_TIMERS_CONTROL_LST(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_LPI_TIMERS_CONTROL_LST_SHIFT)) & ENET_MAC_LPI_TIMERS_CONTROL_LST_MASK) -/*! @} */ - -/*! @name MAC_LPI_ENTRY_TIMER - Tx LPI Entry Timer Control */ -/*! @{ */ - -#define ENET_MAC_LPI_ENTRY_TIMER_LPIET_MASK (0xFFFF8U) -#define ENET_MAC_LPI_ENTRY_TIMER_LPIET_SHIFT (3U) -/*! LPIET - LPI Entry Timer */ -#define ENET_MAC_LPI_ENTRY_TIMER_LPIET(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_LPI_ENTRY_TIMER_LPIET_SHIFT)) & ENET_MAC_LPI_ENTRY_TIMER_LPIET_MASK) -/*! @} */ - -/*! @name MAC_ONEUS_TIC_COUNTER - One-microsecond Reference Timer */ -/*! @{ */ - -#define ENET_MAC_ONEUS_TIC_COUNTER_TIC_1US_CNTR_MASK (0xFFFU) -#define ENET_MAC_ONEUS_TIC_COUNTER_TIC_1US_CNTR_SHIFT (0U) -/*! TIC_1US_CNTR - 1US TIC Counter */ -#define ENET_MAC_ONEUS_TIC_COUNTER_TIC_1US_CNTR(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_ONEUS_TIC_COUNTER_TIC_1US_CNTR_SHIFT)) & ENET_MAC_ONEUS_TIC_COUNTER_TIC_1US_CNTR_MASK) -/*! @} */ - -/*! @name MAC_VERSION - MAC Version */ -/*! @{ */ - -#define ENET_MAC_VERSION_SNPSVER_MASK (0xFFU) -#define ENET_MAC_VERSION_SNPSVER_SHIFT (0U) -/*! SNPSVER - Synopsys-defined Version */ -#define ENET_MAC_VERSION_SNPSVER(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VERSION_SNPSVER_SHIFT)) & ENET_MAC_VERSION_SNPSVER_MASK) - -#define ENET_MAC_VERSION_USERVER_MASK (0xFF00U) -#define ENET_MAC_VERSION_USERVER_SHIFT (8U) -/*! USERVER - User-defined Version */ -#define ENET_MAC_VERSION_USERVER(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_VERSION_USERVER_SHIFT)) & ENET_MAC_VERSION_USERVER_MASK) -/*! @} */ - -/*! @name MAC_DEBUG - MAC Debug */ -/*! @{ */ - -#define ENET_MAC_DEBUG_RPESTS_MASK (0x1U) -#define ENET_MAC_DEBUG_RPESTS_SHIFT (0U) -/*! RPESTS - MAC GMII or MII Receive Protocol Engine Status - * 0b1..MAC GMII or MII Receive Protocol Engine Status detected - * 0b0..MAC GMII or MII Receive Protocol Engine Status not detected - */ -#define ENET_MAC_DEBUG_RPESTS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_DEBUG_RPESTS_SHIFT)) & ENET_MAC_DEBUG_RPESTS_MASK) - -#define ENET_MAC_DEBUG_RFCFCSTS_MASK (0x6U) -#define ENET_MAC_DEBUG_RFCFCSTS_SHIFT (1U) -/*! RFCFCSTS - MAC Receive Packet Controller FIFO Status */ -#define ENET_MAC_DEBUG_RFCFCSTS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_DEBUG_RFCFCSTS_SHIFT)) & ENET_MAC_DEBUG_RFCFCSTS_MASK) - -#define ENET_MAC_DEBUG_TPESTS_MASK (0x10000U) -#define ENET_MAC_DEBUG_TPESTS_SHIFT (16U) -/*! TPESTS - MAC GMII or MII Transmit Protocol Engine Status - * 0b1..MAC GMII or MII Transmit Protocol Engine Status detected - * 0b0..MAC GMII or MII Transmit Protocol Engine Status not detected - */ -#define ENET_MAC_DEBUG_TPESTS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_DEBUG_TPESTS_SHIFT)) & ENET_MAC_DEBUG_TPESTS_MASK) - -#define ENET_MAC_DEBUG_TFCSTS_MASK (0x60000U) -#define ENET_MAC_DEBUG_TFCSTS_SHIFT (17U) -/*! TFCSTS - MAC Transmit Packet Controller Status - * 0b10..Generating and transmitting a Pause control packet (in full-duplex mode) - * 0b00..Idle state - * 0b11..Transferring input packet for transmission - * 0b01..Waiting for one of the following: Status of the previous packet OR IPG or back off period to be over - */ -#define ENET_MAC_DEBUG_TFCSTS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_DEBUG_TFCSTS_SHIFT)) & ENET_MAC_DEBUG_TFCSTS_MASK) -/*! @} */ - -/*! @name MAC_HW_FEAT - Hardware Features 0..Hardware Features 3 */ -/*! @{ */ - -#define ENET_MAC_HW_FEAT_MIISEL_MASK (0x1U) -#define ENET_MAC_HW_FEAT_MIISEL_SHIFT (0U) -/*! MIISEL - 10 or 100 Mbps Support - * 0b1..10 or 100 Mbps support - * 0b0..No 10 or 100 Mbps support - */ -#define ENET_MAC_HW_FEAT_MIISEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_MIISEL_SHIFT)) & ENET_MAC_HW_FEAT_MIISEL_MASK) - -#define ENET_MAC_HW_FEAT_NRVF_MASK (0x7U) -#define ENET_MAC_HW_FEAT_NRVF_SHIFT (0U) -/*! NRVF - Number of Extended VLAN Tag Filters Enabled - * 0b011..16 Extended Rx VLAN Filters - * 0b100..24 Extended Rx VLAN Filters - * 0b101..32 Extended Rx VLAN Filters - * 0b001..4 Extended Rx VLAN Filters - * 0b010..8 Extended Rx VLAN Filters - * 0b000..No Extended Rx VLAN Filters - * 0b110..Reserved - */ -#define ENET_MAC_HW_FEAT_NRVF(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_NRVF_SHIFT)) & ENET_MAC_HW_FEAT_NRVF_MASK) - -#define ENET_MAC_HW_FEAT_RXFIFOSIZE_MASK (0x1FU) -#define ENET_MAC_HW_FEAT_RXFIFOSIZE_SHIFT (0U) -/*! RXFIFOSIZE - MTL Receive FIFO Size - * 0b00011..1024 bytes - * 0b00000..128 bytes - * 0b01010..128 KB - * 0b00111..16384 bytes - * 0b00100..2048 bytes - * 0b00001..256 bytes - * 0b01011..256 KB - * 0b01000..32 KB - * 0b00101..4096 bytes - * 0b00010..512 bytes - * 0b01001..64 KB - * 0b00110..8192 bytes - * 0b01100..Reserved - */ -#define ENET_MAC_HW_FEAT_RXFIFOSIZE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_RXFIFOSIZE_SHIFT)) & ENET_MAC_HW_FEAT_RXFIFOSIZE_MASK) - -#define ENET_MAC_HW_FEAT_RXQCNT_MASK (0xFU) -#define ENET_MAC_HW_FEAT_RXQCNT_SHIFT (0U) -/*! RXQCNT - Number of MTL Receive Queues - * 0b0000..1 MTL Rx Queue - * 0b0001..2 MTL Rx Queues - * 0b0010..3 MTL Rx Queues - * 0b0011..4 MTL Rx Queues - * 0b0100..5 MTL Rx Queues - * 0b0101..6 MTL Rx Queues - * 0b0110..7 MTL Rx Queues - * 0b0111..8 MTL Rx Queues - */ -#define ENET_MAC_HW_FEAT_RXQCNT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_RXQCNT_SHIFT)) & ENET_MAC_HW_FEAT_RXQCNT_MASK) - -#define ENET_MAC_HW_FEAT_GMIISEL_MASK (0x2U) -#define ENET_MAC_HW_FEAT_GMIISEL_SHIFT (1U) -/*! GMIISEL - 1000 Mbps Support - * 0b1..1000 Mbps support - * 0b0..No 1000 Mbps support - */ -#define ENET_MAC_HW_FEAT_GMIISEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_GMIISEL_SHIFT)) & ENET_MAC_HW_FEAT_GMIISEL_MASK) - -#define ENET_MAC_HW_FEAT_HDSEL_MASK (0x4U) -#define ENET_MAC_HW_FEAT_HDSEL_SHIFT (2U) -/*! HDSEL - Half-duplex Support - * 0b1..Half-duplex support - * 0b0..No Half-duplex support - */ -#define ENET_MAC_HW_FEAT_HDSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_HDSEL_SHIFT)) & ENET_MAC_HW_FEAT_HDSEL_MASK) - -#define ENET_MAC_HW_FEAT_PCSSEL_MASK (0x8U) -#define ENET_MAC_HW_FEAT_PCSSEL_SHIFT (3U) -/*! PCSSEL - PCS Registers (TBI, SGMII, or RTBI PHY interface) - * 0b1..PCS Registers (TBI, SGMII, or RTBI PHY interface) - * 0b0..No PCS Registers (TBI, SGMII, or RTBI PHY interface) - */ -#define ENET_MAC_HW_FEAT_PCSSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_PCSSEL_SHIFT)) & ENET_MAC_HW_FEAT_PCSSEL_MASK) - -#define ENET_MAC_HW_FEAT_CBTISEL_MASK (0x10U) -#define ENET_MAC_HW_FEAT_CBTISEL_SHIFT (4U) -/*! CBTISEL - Queue/Channel based VLAN tag insertion on Tx Enable - * 0b1..Enable Queue/Channel based VLAN tag insertion on Tx feature is selected - * 0b0..Enable Queue/Channel based VLAN tag insertion on Tx feature is not selected - */ -#define ENET_MAC_HW_FEAT_CBTISEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_CBTISEL_SHIFT)) & ENET_MAC_HW_FEAT_CBTISEL_MASK) - -#define ENET_MAC_HW_FEAT_VLHASH_MASK (0x10U) -#define ENET_MAC_HW_FEAT_VLHASH_SHIFT (4U) -/*! VLHASH - VLAN Hash Filter Selected - * 0b1..VLAN Hash Filter selected - * 0b0..VLAN Hash Filter not selected - */ -#define ENET_MAC_HW_FEAT_VLHASH(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_VLHASH_SHIFT)) & ENET_MAC_HW_FEAT_VLHASH_MASK) - -#define ENET_MAC_HW_FEAT_DVLAN_MASK (0x20U) -#define ENET_MAC_HW_FEAT_DVLAN_SHIFT (5U) -/*! DVLAN - Double VLAN Tag Processing Selected - * 0b1..Double VLAN option is selected - * 0b0..Double VLAN option is not selected - */ -#define ENET_MAC_HW_FEAT_DVLAN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_DVLAN_SHIFT)) & ENET_MAC_HW_FEAT_DVLAN_MASK) - -#define ENET_MAC_HW_FEAT_SMASEL_MASK (0x20U) -#define ENET_MAC_HW_FEAT_SMASEL_SHIFT (5U) -/*! SMASEL - SMA (MDIO) Interface - * 0b1..SMA (MDIO) Interface selected - * 0b0..SMA (MDIO) Interface not selected - */ -#define ENET_MAC_HW_FEAT_SMASEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_SMASEL_SHIFT)) & ENET_MAC_HW_FEAT_SMASEL_MASK) - -#define ENET_MAC_HW_FEAT_SPRAM_MASK (0x20U) -#define ENET_MAC_HW_FEAT_SPRAM_SHIFT (5U) -/*! SPRAM - Single Port RAM Enable - * 0b1..Single Port RAM feature is selected - * 0b0..Single Port RAM feature is not selected - */ -#define ENET_MAC_HW_FEAT_SPRAM(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_SPRAM_SHIFT)) & ENET_MAC_HW_FEAT_SPRAM_MASK) - -#define ENET_MAC_HW_FEAT_RWKSEL_MASK (0x40U) -#define ENET_MAC_HW_FEAT_RWKSEL_SHIFT (6U) -/*! RWKSEL - PMT Remote Wake-up Packet Enable - * 0b1..PMT Remote Wake-up Packet Enable option is selected - * 0b0..PMT Remote Wake-up Packet Enable option is not selected - */ -#define ENET_MAC_HW_FEAT_RWKSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_RWKSEL_SHIFT)) & ENET_MAC_HW_FEAT_RWKSEL_MASK) - -#define ENET_MAC_HW_FEAT_TXFIFOSIZE_MASK (0x7C0U) -#define ENET_MAC_HW_FEAT_TXFIFOSIZE_SHIFT (6U) -/*! TXFIFOSIZE - MTL Transmit FIFO Size - * 0b00011..1024 bytes - * 0b00000..128 bytes - * 0b01010..128 KB - * 0b00111..16384 bytes - * 0b00100..2048 bytes - * 0b00001..256 bytes - * 0b01000..32 KB - * 0b00101..4096 bytes - * 0b00010..512 bytes - * 0b01001..64 KB - * 0b00110..8192 bytes - * 0b01011..Reserved - */ -#define ENET_MAC_HW_FEAT_TXFIFOSIZE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_TXFIFOSIZE_SHIFT)) & ENET_MAC_HW_FEAT_TXFIFOSIZE_MASK) - -#define ENET_MAC_HW_FEAT_TXQCNT_MASK (0x3C0U) -#define ENET_MAC_HW_FEAT_TXQCNT_SHIFT (6U) -/*! TXQCNT - Number of MTL Transmit Queues - * 0b0000..1 MTL Tx Queue - * 0b0001..2 MTL Tx Queues - * 0b0010..3 MTL Tx Queues - * 0b0011..4 MTL Tx Queues - * 0b0100..5 MTL Tx Queues - * 0b0101..6 MTL Tx Queues - * 0b0110..7 MTL Tx Queues - * 0b0111..8 MTL Tx Queues - */ -#define ENET_MAC_HW_FEAT_TXQCNT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_TXQCNT_SHIFT)) & ENET_MAC_HW_FEAT_TXQCNT_MASK) - -#define ENET_MAC_HW_FEAT_MGKSEL_MASK (0x80U) -#define ENET_MAC_HW_FEAT_MGKSEL_SHIFT (7U) -/*! MGKSEL - PMT Magic Packet Enable - * 0b1..PMT Magic Packet Enable option is selected - * 0b0..PMT Magic Packet Enable option is not selected - */ -#define ENET_MAC_HW_FEAT_MGKSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_MGKSEL_SHIFT)) & ENET_MAC_HW_FEAT_MGKSEL_MASK) - -#define ENET_MAC_HW_FEAT_MMCSEL_MASK (0x100U) -#define ENET_MAC_HW_FEAT_MMCSEL_SHIFT (8U) -/*! MMCSEL - RMON Module Enable - * 0b1..RMON Module Enable option is selected - * 0b0..RMON Module Enable option is not selected - */ -#define ENET_MAC_HW_FEAT_MMCSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_MMCSEL_SHIFT)) & ENET_MAC_HW_FEAT_MMCSEL_MASK) - -#define ENET_MAC_HW_FEAT_ARPOFFSEL_MASK (0x200U) -#define ENET_MAC_HW_FEAT_ARPOFFSEL_SHIFT (9U) -/*! ARPOFFSEL - ARP Offload Enabled - * 0b1..ARP Offload Enable option is selected - * 0b0..ARP Offload Enable option is not selected - */ -#define ENET_MAC_HW_FEAT_ARPOFFSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_ARPOFFSEL_SHIFT)) & ENET_MAC_HW_FEAT_ARPOFFSEL_MASK) - -#define ENET_MAC_HW_FEAT_PDUPSEL_MASK (0x200U) -#define ENET_MAC_HW_FEAT_PDUPSEL_SHIFT (9U) -/*! PDUPSEL - Broadcast/Multicast Packet Duplication - * 0b1..Broadcast/Multicast Packet Duplication feature is selected - * 0b0..Broadcast/Multicast Packet Duplication feature is not selected - */ -#define ENET_MAC_HW_FEAT_PDUPSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_PDUPSEL_SHIFT)) & ENET_MAC_HW_FEAT_PDUPSEL_MASK) - -#define ENET_MAC_HW_FEAT_FRPSEL_MASK (0x400U) -#define ENET_MAC_HW_FEAT_FRPSEL_SHIFT (10U) -/*! FRPSEL - Flexible Receive Parser Selected - * 0b1..Flexible Receive Parser feature is selected - * 0b0..Flexible Receive Parser feature is not selected - */ -#define ENET_MAC_HW_FEAT_FRPSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_FRPSEL_SHIFT)) & ENET_MAC_HW_FEAT_FRPSEL_MASK) - -#define ENET_MAC_HW_FEAT_FRPBS_MASK (0x1800U) -#define ENET_MAC_HW_FEAT_FRPBS_SHIFT (11U) -/*! FRPBS - Flexible Receive Parser Buffer size - * 0b01..128 Bytes - * 0b10..256 Bytes - * 0b00..64 Bytes - * 0b11..Reserved - */ -#define ENET_MAC_HW_FEAT_FRPBS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_FRPBS_SHIFT)) & ENET_MAC_HW_FEAT_FRPBS_MASK) - -#define ENET_MAC_HW_FEAT_OSTEN_MASK (0x800U) -#define ENET_MAC_HW_FEAT_OSTEN_SHIFT (11U) -/*! OSTEN - One-Step Timestamping Enable - * 0b1..One-Step Timestamping feature is selected - * 0b0..One-Step Timestamping feature is not selected - */ -#define ENET_MAC_HW_FEAT_OSTEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_OSTEN_SHIFT)) & ENET_MAC_HW_FEAT_OSTEN_MASK) - -#define ENET_MAC_HW_FEAT_PTOEN_MASK (0x1000U) -#define ENET_MAC_HW_FEAT_PTOEN_SHIFT (12U) -/*! PTOEN - PTP Offload Enable - * 0b1..PTP Offload feature is selected - * 0b0..PTP Offload feature is not selected - */ -#define ENET_MAC_HW_FEAT_PTOEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_PTOEN_SHIFT)) & ENET_MAC_HW_FEAT_PTOEN_MASK) - -#define ENET_MAC_HW_FEAT_RXCHCNT_MASK (0xF000U) -#define ENET_MAC_HW_FEAT_RXCHCNT_SHIFT (12U) -/*! RXCHCNT - Number of DMA Receive Channels - * 0b0000..1 MTL Rx Channel - * 0b0001..2 MTL Rx Channels - * 0b0010..3 MTL Rx Channels - * 0b0011..4 MTL Rx Channels - * 0b0100..5 MTL Rx Channels - * 0b0101..6 MTL Rx Channels - * 0b0110..7 MTL Rx Channels - * 0b0111..8 MTL Rx Channels - */ -#define ENET_MAC_HW_FEAT_RXCHCNT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_RXCHCNT_SHIFT)) & ENET_MAC_HW_FEAT_RXCHCNT_MASK) - -#define ENET_MAC_HW_FEAT_TSSEL_MASK (0x1000U) -#define ENET_MAC_HW_FEAT_TSSEL_SHIFT (12U) -/*! TSSEL - IEEE 1588-2008 Timestamp Enabled - * 0b1..IEEE 1588-2008 Timestamp Enable option is selected - * 0b0..IEEE 1588-2008 Timestamp Enable option is not selected - */ -#define ENET_MAC_HW_FEAT_TSSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_TSSEL_SHIFT)) & ENET_MAC_HW_FEAT_TSSEL_MASK) - -#define ENET_MAC_HW_FEAT_ADVTHWORD_MASK (0x2000U) -#define ENET_MAC_HW_FEAT_ADVTHWORD_SHIFT (13U) -/*! ADVTHWORD - IEEE 1588 High Word Register Enable - * 0b1..IEEE 1588 High Word Register option is selected - * 0b0..IEEE 1588 High Word Register option is not selected - */ -#define ENET_MAC_HW_FEAT_ADVTHWORD(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_ADVTHWORD_SHIFT)) & ENET_MAC_HW_FEAT_ADVTHWORD_MASK) - -#define ENET_MAC_HW_FEAT_EEESEL_MASK (0x2000U) -#define ENET_MAC_HW_FEAT_EEESEL_SHIFT (13U) -/*! EEESEL - Energy Efficient Ethernet Enabled - * 0b1..Energy Efficient Ethernet Enable option is selected - * 0b0..Energy Efficient Ethernet Enable option is not selected - */ -#define ENET_MAC_HW_FEAT_EEESEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_EEESEL_SHIFT)) & ENET_MAC_HW_FEAT_EEESEL_MASK) - -#define ENET_MAC_HW_FEAT_FRPES_MASK (0x6000U) -#define ENET_MAC_HW_FEAT_FRPES_SHIFT (13U) -/*! FRPES - Flexible Receive Parser Table Entries size - * 0b01..128 Entries - * 0b10..256 Entries - * 0b00..64 Entries - * 0b11..Reserved - */ -#define ENET_MAC_HW_FEAT_FRPES(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_FRPES_SHIFT)) & ENET_MAC_HW_FEAT_FRPES_MASK) - -#define ENET_MAC_HW_FEAT_ADDR64_MASK (0xC000U) -#define ENET_MAC_HW_FEAT_ADDR64_SHIFT (14U) -/*! ADDR64 - Address Width. - * 0b00..32 - * 0b01..40 - * 0b10..48 - * 0b11..Reserved - */ -#define ENET_MAC_HW_FEAT_ADDR64(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_ADDR64_SHIFT)) & ENET_MAC_HW_FEAT_ADDR64_MASK) - -#define ENET_MAC_HW_FEAT_TXCOESEL_MASK (0x4000U) -#define ENET_MAC_HW_FEAT_TXCOESEL_SHIFT (14U) -/*! TXCOESEL - Transmit Checksum Offload Enabled - * 0b1..Transmit Checksum Offload Enable option is selected - * 0b0..Transmit Checksum Offload Enable option is not selected - */ -#define ENET_MAC_HW_FEAT_TXCOESEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_TXCOESEL_SHIFT)) & ENET_MAC_HW_FEAT_TXCOESEL_MASK) - -#define ENET_MAC_HW_FEAT_DCBEN_MASK (0x10000U) -#define ENET_MAC_HW_FEAT_DCBEN_SHIFT (16U) -/*! DCBEN - DCB Feature Enable - * 0b1..DCB Feature is selected - * 0b0..DCB Feature is not selected - */ -#define ENET_MAC_HW_FEAT_DCBEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_DCBEN_SHIFT)) & ENET_MAC_HW_FEAT_DCBEN_MASK) - -#define ENET_MAC_HW_FEAT_ESTSEL_MASK (0x10000U) -#define ENET_MAC_HW_FEAT_ESTSEL_SHIFT (16U) -/*! ESTSEL - Enhancements to Scheduled Traffic Enable - * 0b1..Enable Enhancements to Scheduling Traffic feature is selected - * 0b0..Enable Enhancements to Scheduling Traffic feature is not selected - */ -#define ENET_MAC_HW_FEAT_ESTSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_ESTSEL_SHIFT)) & ENET_MAC_HW_FEAT_ESTSEL_MASK) - -#define ENET_MAC_HW_FEAT_RDCSZ_MASK (0x30000U) -#define ENET_MAC_HW_FEAT_RDCSZ_SHIFT (16U) -/*! RDCSZ - Rx DMA Descriptor Cache Size in terms of 16 bytes descriptors: */ -#define ENET_MAC_HW_FEAT_RDCSZ(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_RDCSZ_SHIFT)) & ENET_MAC_HW_FEAT_RDCSZ_MASK) - -#define ENET_MAC_HW_FEAT_RXCOESEL_MASK (0x10000U) -#define ENET_MAC_HW_FEAT_RXCOESEL_SHIFT (16U) -/*! RXCOESEL - Receive Checksum Offload Enabled - * 0b1..Receive Checksum Offload Enable option is selected - * 0b0..Receive Checksum Offload Enable option is not selected - */ -#define ENET_MAC_HW_FEAT_RXCOESEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_RXCOESEL_SHIFT)) & ENET_MAC_HW_FEAT_RXCOESEL_MASK) - -#define ENET_MAC_HW_FEAT_ESTDEP_MASK (0xE0000U) -#define ENET_MAC_HW_FEAT_ESTDEP_SHIFT (17U) -/*! ESTDEP - Depth of the Gate Control List - * 0b101..1024 - * 0b010..128 - * 0b011..256 - * 0b100..512 - * 0b001..64 - * 0b000..No Depth configured - * 0b110..Reserved - */ -#define ENET_MAC_HW_FEAT_ESTDEP(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_ESTDEP_SHIFT)) & ENET_MAC_HW_FEAT_ESTDEP_MASK) - -#define ENET_MAC_HW_FEAT_SPHEN_MASK (0x20000U) -#define ENET_MAC_HW_FEAT_SPHEN_SHIFT (17U) -/*! SPHEN - Split Header Feature Enable - * 0b1..Split Header Feature is selected - * 0b0..Split Header Feature is not selected - */ -#define ENET_MAC_HW_FEAT_SPHEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_SPHEN_SHIFT)) & ENET_MAC_HW_FEAT_SPHEN_MASK) - -#define ENET_MAC_HW_FEAT_ADDMACADRSEL_MASK (0x7C0000U) -#define ENET_MAC_HW_FEAT_ADDMACADRSEL_SHIFT (18U) -/*! ADDMACADRSEL - MAC Addresses 1-31 Selected */ -#define ENET_MAC_HW_FEAT_ADDMACADRSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_ADDMACADRSEL_SHIFT)) & ENET_MAC_HW_FEAT_ADDMACADRSEL_MASK) - -#define ENET_MAC_HW_FEAT_TSOEN_MASK (0x40000U) -#define ENET_MAC_HW_FEAT_TSOEN_SHIFT (18U) -/*! TSOEN - TCP Segmentation Offload Enable - * 0b1..TCP Segmentation Offload Feature is selected - * 0b0..TCP Segmentation Offload Feature is not selected - */ -#define ENET_MAC_HW_FEAT_TSOEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_TSOEN_SHIFT)) & ENET_MAC_HW_FEAT_TSOEN_MASK) - -#define ENET_MAC_HW_FEAT_TXCHCNT_MASK (0x3C0000U) -#define ENET_MAC_HW_FEAT_TXCHCNT_SHIFT (18U) -/*! TXCHCNT - Number of DMA Transmit Channels - * 0b0000..1 MTL Tx Channel - * 0b0001..2 MTL Tx Channels - * 0b0010..3 MTL Tx Channels - * 0b0011..4 MTL Tx Channels - * 0b0100..5 MTL Tx Channels - * 0b0101..6 MTL Tx Channels - * 0b0110..7 MTL Tx Channels - * 0b0111..8 MTL Tx Channels - */ -#define ENET_MAC_HW_FEAT_TXCHCNT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_TXCHCNT_SHIFT)) & ENET_MAC_HW_FEAT_TXCHCNT_MASK) - -#define ENET_MAC_HW_FEAT_DBGMEMA_MASK (0x80000U) -#define ENET_MAC_HW_FEAT_DBGMEMA_SHIFT (19U) -/*! DBGMEMA - DMA Debug Registers Enable - * 0b1..DMA Debug Registers option is selected - * 0b0..DMA Debug Registers option is not selected - */ -#define ENET_MAC_HW_FEAT_DBGMEMA(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_DBGMEMA_SHIFT)) & ENET_MAC_HW_FEAT_DBGMEMA_MASK) - -#define ENET_MAC_HW_FEAT_AVSEL_MASK (0x100000U) -#define ENET_MAC_HW_FEAT_AVSEL_SHIFT (20U) -/*! AVSEL - AV Feature Enable - * 0b1..AV Feature is selected - * 0b0..AV Feature is not selected - */ -#define ENET_MAC_HW_FEAT_AVSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_AVSEL_SHIFT)) & ENET_MAC_HW_FEAT_AVSEL_MASK) - -#define ENET_MAC_HW_FEAT_ESTWID_MASK (0x300000U) -#define ENET_MAC_HW_FEAT_ESTWID_SHIFT (20U) -/*! ESTWID - Width of the Time Interval field in the Gate Control List - * 0b00..Width not configured - * 0b01..16 - * 0b10..20 - * 0b11..24 - */ -#define ENET_MAC_HW_FEAT_ESTWID(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_ESTWID_SHIFT)) & ENET_MAC_HW_FEAT_ESTWID_MASK) - -#define ENET_MAC_HW_FEAT_RAVSEL_MASK (0x200000U) -#define ENET_MAC_HW_FEAT_RAVSEL_SHIFT (21U) -/*! RAVSEL - Rx Side Only AV Feature Enable - * 0b1..Rx Side Only AV Feature is selected - * 0b0..Rx Side Only AV Feature is not selected - */ -#define ENET_MAC_HW_FEAT_RAVSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_RAVSEL_SHIFT)) & ENET_MAC_HW_FEAT_RAVSEL_MASK) - -#define ENET_MAC_HW_FEAT_TDCSZ_MASK (0xC00000U) -#define ENET_MAC_HW_FEAT_TDCSZ_SHIFT (22U) -/*! TDCSZ - Tx DMA Descriptor Cache Size in terms of 16 bytes descriptors: */ -#define ENET_MAC_HW_FEAT_TDCSZ(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_TDCSZ_SHIFT)) & ENET_MAC_HW_FEAT_TDCSZ_MASK) - -#define ENET_MAC_HW_FEAT_MACADR32SEL_MASK (0x800000U) -#define ENET_MAC_HW_FEAT_MACADR32SEL_SHIFT (23U) -/*! MACADR32SEL - MAC Addresses 32-63 Selected - * 0b1..MAC Addresses 32-63 Select option is selected - * 0b0..MAC Addresses 32-63 Select option is not selected - */ -#define ENET_MAC_HW_FEAT_MACADR32SEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_MACADR32SEL_SHIFT)) & ENET_MAC_HW_FEAT_MACADR32SEL_MASK) - -#define ENET_MAC_HW_FEAT_POUOST_MASK (0x800000U) -#define ENET_MAC_HW_FEAT_POUOST_SHIFT (23U) -/*! POUOST - One Step for PTP over UDP/IP Feature Enable - * 0b1..One Step for PTP over UDP/IP Feature is selected - * 0b0..One Step for PTP over UDP/IP Feature is not selected - */ -#define ENET_MAC_HW_FEAT_POUOST(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_POUOST_SHIFT)) & ENET_MAC_HW_FEAT_POUOST_MASK) - -#define ENET_MAC_HW_FEAT_HASHTBLSZ_MASK (0x3000000U) -#define ENET_MAC_HW_FEAT_HASHTBLSZ_SHIFT (24U) -/*! HASHTBLSZ - Hash Table Size - * 0b10..128 - * 0b11..256 - * 0b01..64 - * 0b00..No hash table - */ -#define ENET_MAC_HW_FEAT_HASHTBLSZ(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_HASHTBLSZ_SHIFT)) & ENET_MAC_HW_FEAT_HASHTBLSZ_MASK) - -#define ENET_MAC_HW_FEAT_MACADR64SEL_MASK (0x1000000U) -#define ENET_MAC_HW_FEAT_MACADR64SEL_SHIFT (24U) -/*! MACADR64SEL - MAC Addresses 64-127 Selected - * 0b1..MAC Addresses 64-127 Select option is selected - * 0b0..MAC Addresses 64-127 Select option is not selected - */ -#define ENET_MAC_HW_FEAT_MACADR64SEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_MACADR64SEL_SHIFT)) & ENET_MAC_HW_FEAT_MACADR64SEL_MASK) - -#define ENET_MAC_HW_FEAT_PPSOUTNUM_MASK (0x7000000U) -#define ENET_MAC_HW_FEAT_PPSOUTNUM_SHIFT (24U) -/*! PPSOUTNUM - Number of PPS Outputs - * 0b001..1 PPS output - * 0b010..2 PPS output - * 0b011..3 PPS output - * 0b100..4 PPS output - * 0b000..No PPS output - * 0b101..Reserved - */ -#define ENET_MAC_HW_FEAT_PPSOUTNUM(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_PPSOUTNUM_SHIFT)) & ENET_MAC_HW_FEAT_PPSOUTNUM_MASK) - -#define ENET_MAC_HW_FEAT_TSSTSSEL_MASK (0x6000000U) -#define ENET_MAC_HW_FEAT_TSSTSSEL_SHIFT (25U) -/*! TSSTSSEL - Timestamp System Time Source - * 0b10..Both - * 0b01..External - * 0b00..Internal - * 0b11..Reserved - */ -#define ENET_MAC_HW_FEAT_TSSTSSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_TSSTSSEL_SHIFT)) & ENET_MAC_HW_FEAT_TSSTSSEL_MASK) - -#define ENET_MAC_HW_FEAT_FPESEL_MASK (0x4000000U) -#define ENET_MAC_HW_FEAT_FPESEL_SHIFT (26U) -/*! FPESEL - Frame Preemption Enable - * 0b1..Frame Preemption Enable feature is selected - * 0b0..Frame Preemption Enable feature is not selected - */ -#define ENET_MAC_HW_FEAT_FPESEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_FPESEL_SHIFT)) & ENET_MAC_HW_FEAT_FPESEL_MASK) - -#define ENET_MAC_HW_FEAT_L3L4FNUM_MASK (0x78000000U) -#define ENET_MAC_HW_FEAT_L3L4FNUM_SHIFT (27U) -/*! L3L4FNUM - Total number of L3 or L4 Filters - * 0b0001..1 L3 or L4 Filter - * 0b0010..2 L3 or L4 Filters - * 0b0011..3 L3 or L4 Filters - * 0b0100..4 L3 or L4 Filters - * 0b0101..5 L3 or L4 Filters - * 0b0110..6 L3 or L4 Filters - * 0b0111..7 L3 or L4 Filters - * 0b1000..8 L3 or L4 Filters - * 0b0000..No L3 or L4 Filter - */ -#define ENET_MAC_HW_FEAT_L3L4FNUM(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_L3L4FNUM_SHIFT)) & ENET_MAC_HW_FEAT_L3L4FNUM_MASK) - -#define ENET_MAC_HW_FEAT_SAVLANINS_MASK (0x8000000U) -#define ENET_MAC_HW_FEAT_SAVLANINS_SHIFT (27U) -/*! SAVLANINS - Source Address or VLAN Insertion Enable - * 0b1..Source Address or VLAN Insertion Enable option is selected - * 0b0..Source Address or VLAN Insertion Enable option is not selected - */ -#define ENET_MAC_HW_FEAT_SAVLANINS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_SAVLANINS_SHIFT)) & ENET_MAC_HW_FEAT_SAVLANINS_MASK) - -#define ENET_MAC_HW_FEAT_TBSSEL_MASK (0x8000000U) -#define ENET_MAC_HW_FEAT_TBSSEL_SHIFT (27U) -/*! TBSSEL - Time Based Scheduling Enable - * 0b1..Time Based Scheduling Enable feature is selected - * 0b0..Time Based Scheduling Enable feature is not selected - */ -#define ENET_MAC_HW_FEAT_TBSSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_TBSSEL_SHIFT)) & ENET_MAC_HW_FEAT_TBSSEL_MASK) - -#define ENET_MAC_HW_FEAT_ACTPHYSEL_MASK (0x70000000U) -#define ENET_MAC_HW_FEAT_ACTPHYSEL_SHIFT (28U) -/*! ACTPHYSEL - Active PHY Selected - * 0b000..GMII or MII - * 0b111..RevMII - * 0b001..RGMII - * 0b100..RMII - * 0b101..RTBI - * 0b010..SGMII - * 0b110..SMII - * 0b011..TBI - */ -#define ENET_MAC_HW_FEAT_ACTPHYSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_ACTPHYSEL_SHIFT)) & ENET_MAC_HW_FEAT_ACTPHYSEL_MASK) - -#define ENET_MAC_HW_FEAT_ASP_MASK (0x30000000U) -#define ENET_MAC_HW_FEAT_ASP_SHIFT (28U) -/*! ASP - Automotive Safety Package - * 0b10..All the Automotive Safety features are selected without the "Parity Port Enable for external interface" feature - * 0b11..All the Automotive Safety features are selected with the "Parity Port Enable for external interface" feature - * 0b01..Only "ECC protection for external memory" feature is selected - * 0b00..No Safety features selected - */ -#define ENET_MAC_HW_FEAT_ASP(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_ASP_SHIFT)) & ENET_MAC_HW_FEAT_ASP_MASK) - -#define ENET_MAC_HW_FEAT_AUXSNAPNUM_MASK (0x70000000U) -#define ENET_MAC_HW_FEAT_AUXSNAPNUM_SHIFT (28U) -/*! AUXSNAPNUM - Number of Auxiliary Snapshot Inputs - * 0b001..1 auxiliary input - * 0b010..2 auxiliary input - * 0b011..3 auxiliary input - * 0b100..4 auxiliary input - * 0b000..No auxiliary input - * 0b101..Reserved - */ -#define ENET_MAC_HW_FEAT_AUXSNAPNUM(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_HW_FEAT_AUXSNAPNUM_SHIFT)) & ENET_MAC_HW_FEAT_AUXSNAPNUM_MASK) -/*! @} */ - -/* The count of ENET_MAC_HW_FEAT */ -#define ENET_MAC_HW_FEAT_COUNT (4U) - -/*! @name MAC_MDIO_ADDRESS - MDIO Address */ -/*! @{ */ - -#define ENET_MAC_MDIO_ADDRESS_GB_MASK (0x1U) -#define ENET_MAC_MDIO_ADDRESS_GB_SHIFT (0U) -/*! GB - GMII Busy - * 0b0..GMII Busy is disabled - * 0b1..GMII Busy is enabled - */ -#define ENET_MAC_MDIO_ADDRESS_GB(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_MDIO_ADDRESS_GB_SHIFT)) & ENET_MAC_MDIO_ADDRESS_GB_MASK) - -#define ENET_MAC_MDIO_ADDRESS_C45E_MASK (0x2U) -#define ENET_MAC_MDIO_ADDRESS_C45E_SHIFT (1U) -/*! C45E - Clause 45 PHY Enable - * 0b0..Clause 45 PHY is disabled - * 0b1..Clause 45 PHY is enabled - */ -#define ENET_MAC_MDIO_ADDRESS_C45E(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_MDIO_ADDRESS_C45E_SHIFT)) & ENET_MAC_MDIO_ADDRESS_C45E_MASK) - -#define ENET_MAC_MDIO_ADDRESS_GOC_0_MASK (0x4U) -#define ENET_MAC_MDIO_ADDRESS_GOC_0_SHIFT (2U) -/*! GOC_0 - GMII Operation Command 0 - * 0b0..GMII Operation Command 0 is disabled - * 0b1..GMII Operation Command 0 is enabled - */ -#define ENET_MAC_MDIO_ADDRESS_GOC_0(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_MDIO_ADDRESS_GOC_0_SHIFT)) & ENET_MAC_MDIO_ADDRESS_GOC_0_MASK) - -#define ENET_MAC_MDIO_ADDRESS_GOC_1_MASK (0x8U) -#define ENET_MAC_MDIO_ADDRESS_GOC_1_SHIFT (3U) -/*! GOC_1 - GMII Operation Command 1 - * 0b0..GMII Operation Command 1 is disabled - * 0b1..GMII Operation Command 1 is enabled - */ -#define ENET_MAC_MDIO_ADDRESS_GOC_1(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_MDIO_ADDRESS_GOC_1_SHIFT)) & ENET_MAC_MDIO_ADDRESS_GOC_1_MASK) - -#define ENET_MAC_MDIO_ADDRESS_SKAP_MASK (0x10U) -#define ENET_MAC_MDIO_ADDRESS_SKAP_SHIFT (4U) -/*! SKAP - Skip Address Packet - * 0b0..Skip Address Packet is disabled - * 0b1..Skip Address Packet is enabled - */ -#define ENET_MAC_MDIO_ADDRESS_SKAP(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_MDIO_ADDRESS_SKAP_SHIFT)) & ENET_MAC_MDIO_ADDRESS_SKAP_MASK) - -#define ENET_MAC_MDIO_ADDRESS_CR_MASK (0xF00U) -#define ENET_MAC_MDIO_ADDRESS_CR_SHIFT (8U) -/*! CR - CR */ -#define ENET_MAC_MDIO_ADDRESS_CR(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_MDIO_ADDRESS_CR_SHIFT)) & ENET_MAC_MDIO_ADDRESS_CR_MASK) - -#define ENET_MAC_MDIO_ADDRESS_NTC_MASK (0x7000U) -#define ENET_MAC_MDIO_ADDRESS_NTC_SHIFT (12U) -/*! NTC - NTC */ -#define ENET_MAC_MDIO_ADDRESS_NTC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_MDIO_ADDRESS_NTC_SHIFT)) & ENET_MAC_MDIO_ADDRESS_NTC_MASK) - -#define ENET_MAC_MDIO_ADDRESS_RDA_MASK (0x1F0000U) -#define ENET_MAC_MDIO_ADDRESS_RDA_SHIFT (16U) -/*! RDA - Register/Device Address */ -#define ENET_MAC_MDIO_ADDRESS_RDA(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_MDIO_ADDRESS_RDA_SHIFT)) & ENET_MAC_MDIO_ADDRESS_RDA_MASK) - -#define ENET_MAC_MDIO_ADDRESS_PA_MASK (0x3E00000U) -#define ENET_MAC_MDIO_ADDRESS_PA_SHIFT (21U) -/*! PA - Physical Layer Address */ -#define ENET_MAC_MDIO_ADDRESS_PA(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_MDIO_ADDRESS_PA_SHIFT)) & ENET_MAC_MDIO_ADDRESS_PA_MASK) - -#define ENET_MAC_MDIO_ADDRESS_BTB_MASK (0x4000000U) -#define ENET_MAC_MDIO_ADDRESS_BTB_SHIFT (26U) -/*! BTB - Back to Back transactions - * 0b0..Back to Back transactions disabled - * 0b1..Back to Back transactions enabled - */ -#define ENET_MAC_MDIO_ADDRESS_BTB(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_MDIO_ADDRESS_BTB_SHIFT)) & ENET_MAC_MDIO_ADDRESS_BTB_MASK) - -#define ENET_MAC_MDIO_ADDRESS_PSE_MASK (0x8000000U) -#define ENET_MAC_MDIO_ADDRESS_PSE_SHIFT (27U) -/*! PSE - Preamble Suppression Enable - * 0b0..Preamble Suppression disabled - * 0b1..Preamble Suppression enabled - */ -#define ENET_MAC_MDIO_ADDRESS_PSE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_MDIO_ADDRESS_PSE_SHIFT)) & ENET_MAC_MDIO_ADDRESS_PSE_MASK) -/*! @} */ - -/*! @name MAC_MDIO_DATA - MAC MDIO Data */ -/*! @{ */ - -#define ENET_MAC_MDIO_DATA_GD_MASK (0xFFFFU) -#define ENET_MAC_MDIO_DATA_GD_SHIFT (0U) -/*! GD - GMII Data */ -#define ENET_MAC_MDIO_DATA_GD(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_MDIO_DATA_GD_SHIFT)) & ENET_MAC_MDIO_DATA_GD_MASK) - -#define ENET_MAC_MDIO_DATA_RA_MASK (0xFFFF0000U) -#define ENET_MAC_MDIO_DATA_RA_SHIFT (16U) -/*! RA - Register Address */ -#define ENET_MAC_MDIO_DATA_RA(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_MDIO_DATA_RA_SHIFT)) & ENET_MAC_MDIO_DATA_RA_MASK) -/*! @} */ - -/*! @name MAC_CSR_SW_CTRL - CSR Software Control */ -/*! @{ */ - -#define ENET_MAC_CSR_SW_CTRL_RCWE_MASK (0x1U) -#define ENET_MAC_CSR_SW_CTRL_RCWE_SHIFT (0U) -/*! RCWE - Register Clear on Write 1 Enable - * 0b0..Register Clear on Write 1 is disabled - * 0b1..Register Clear on Write 1 is enabled - */ -#define ENET_MAC_CSR_SW_CTRL_RCWE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_CSR_SW_CTRL_RCWE_SHIFT)) & ENET_MAC_CSR_SW_CTRL_RCWE_MASK) -/*! @} */ - -/*! @name MAC_ADDRESS0_HIGH - MAC Address0 High */ -/*! @{ */ - -#define ENET_MAC_ADDRESS0_HIGH_ADDRHI_MASK (0xFFFFU) -#define ENET_MAC_ADDRESS0_HIGH_ADDRHI_SHIFT (0U) -/*! ADDRHI - MAC Address0[47:32] */ -#define ENET_MAC_ADDRESS0_HIGH_ADDRHI(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_ADDRESS0_HIGH_ADDRHI_SHIFT)) & ENET_MAC_ADDRESS0_HIGH_ADDRHI_MASK) - -#define ENET_MAC_ADDRESS0_HIGH_DCS_MASK (0x30000U) -#define ENET_MAC_ADDRESS0_HIGH_DCS_SHIFT (16U) -/*! DCS - DMA Channel Select */ -#define ENET_MAC_ADDRESS0_HIGH_DCS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_ADDRESS0_HIGH_DCS_SHIFT)) & ENET_MAC_ADDRESS0_HIGH_DCS_MASK) - -#define ENET_MAC_ADDRESS0_HIGH_AE_MASK (0x80000000U) -#define ENET_MAC_ADDRESS0_HIGH_AE_SHIFT (31U) -/*! AE - Address Enable - * 0b0..INVALID : This bit must be always set to 1 - * 0b1..This bit is always set to 1 - */ -#define ENET_MAC_ADDRESS0_HIGH_AE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_ADDRESS0_HIGH_AE_SHIFT)) & ENET_MAC_ADDRESS0_HIGH_AE_MASK) -/*! @} */ - -/*! @name MAC_ADDRESS0_LOW - MAC Address0 Low */ -/*! @{ */ - -#define ENET_MAC_ADDRESS0_LOW_ADDRLO_MASK (0xFFFFFFFFU) -#define ENET_MAC_ADDRESS0_LOW_ADDRLO_SHIFT (0U) -/*! ADDRLO - MAC Address0[31:0] */ -#define ENET_MAC_ADDRESS0_LOW_ADDRLO(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_ADDRESS0_LOW_ADDRLO_SHIFT)) & ENET_MAC_ADDRESS0_LOW_ADDRLO_MASK) -/*! @} */ - -/*! @name INDIR_ACCESS_CTRL - Indirect Access Control */ -/*! @{ */ - -#define ENET_INDIR_ACCESS_CTRL_OB_MASK (0x1U) -#define ENET_INDIR_ACCESS_CTRL_OB_SHIFT (0U) -/*! OB - Operation Busy. */ -#define ENET_INDIR_ACCESS_CTRL_OB(x) (((uint32_t)(((uint32_t)(x)) << ENET_INDIR_ACCESS_CTRL_OB_SHIFT)) & ENET_INDIR_ACCESS_CTRL_OB_MASK) - -#define ENET_INDIR_ACCESS_CTRL_COM_MASK (0x2U) -#define ENET_INDIR_ACCESS_CTRL_COM_SHIFT (1U) -/*! COM - Command type - * 0b1..Read operation - * 0b0..Write operation - */ -#define ENET_INDIR_ACCESS_CTRL_COM(x) (((uint32_t)(((uint32_t)(x)) << ENET_INDIR_ACCESS_CTRL_COM_SHIFT)) & ENET_INDIR_ACCESS_CTRL_COM_MASK) - -#define ENET_INDIR_ACCESS_CTRL_AUTO_MASK (0x20U) -#define ENET_INDIR_ACCESS_CTRL_AUTO_SHIFT (5U) -/*! AUTO - Auto increment */ -#define ENET_INDIR_ACCESS_CTRL_AUTO(x) (((uint32_t)(((uint32_t)(x)) << ENET_INDIR_ACCESS_CTRL_AUTO_SHIFT)) & ENET_INDIR_ACCESS_CTRL_AUTO_MASK) - -#define ENET_INDIR_ACCESS_CTRL_AOFF_MASK (0xFF00U) -#define ENET_INDIR_ACCESS_CTRL_AOFF_SHIFT (8U) -/*! AOFF - Address Offset */ -#define ENET_INDIR_ACCESS_CTRL_AOFF(x) (((uint32_t)(((uint32_t)(x)) << ENET_INDIR_ACCESS_CTRL_AOFF_SHIFT)) & ENET_INDIR_ACCESS_CTRL_AOFF_MASK) - -#define ENET_INDIR_ACCESS_CTRL_MSEL_MASK (0xF0000U) -#define ENET_INDIR_ACCESS_CTRL_MSEL_SHIFT (16U) -/*! MSEL - Mode Select */ -#define ENET_INDIR_ACCESS_CTRL_MSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_INDIR_ACCESS_CTRL_MSEL_SHIFT)) & ENET_INDIR_ACCESS_CTRL_MSEL_MASK) -/*! @} */ - -/*! @name INDIR_ACCESS_DATA - Indirect Access Data */ -/*! @{ */ - -#define ENET_INDIR_ACCESS_DATA_DATA_MASK (0xFFFFFFFFU) -#define ENET_INDIR_ACCESS_DATA_DATA_SHIFT (0U) -/*! DATA - This field contains data to read/write for Indirect address access associated with MAC_Indir_Access_Ctrl */ -#define ENET_INDIR_ACCESS_DATA_DATA(x) (((uint32_t)(((uint32_t)(x)) << ENET_INDIR_ACCESS_DATA_DATA_SHIFT)) & ENET_INDIR_ACCESS_DATA_DATA_MASK) -/*! @} */ - -/*! @name MAC_TIMESTAMP_CONTROL - Timestamp Control */ -/*! @{ */ - -#define ENET_MAC_TIMESTAMP_CONTROL_TSENA_MASK (0x1U) -#define ENET_MAC_TIMESTAMP_CONTROL_TSENA_SHIFT (0U) -/*! TSENA - Enable Timestamp - * 0b0..Timestamp is disabled - * 0b1..Timestamp is enabled - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TSENA(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TSENA_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TSENA_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_TSCFUPDT_MASK (0x2U) -#define ENET_MAC_TIMESTAMP_CONTROL_TSCFUPDT_SHIFT (1U) -/*! TSCFUPDT - Fine or Coarse Timestamp Update - * 0b0..Coarse method is used to update system timestamp - * 0b1..Fine method is used to update system timestamp - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TSCFUPDT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TSCFUPDT_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TSCFUPDT_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_TSINIT_MASK (0x4U) -#define ENET_MAC_TIMESTAMP_CONTROL_TSINIT_SHIFT (2U) -/*! TSINIT - Initialize Timestamp - * 0b0..Timestamp is not initialized - * 0b1..Timestamp is initialized - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TSINIT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TSINIT_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TSINIT_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_TSUPDT_MASK (0x8U) -#define ENET_MAC_TIMESTAMP_CONTROL_TSUPDT_SHIFT (3U) -/*! TSUPDT - Update Timestamp - * 0b0..Timestamp is not updated - * 0b1..Timestamp is updated - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TSUPDT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TSUPDT_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TSUPDT_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_TSTRIG_MASK (0x10U) -#define ENET_MAC_TIMESTAMP_CONTROL_TSTRIG_SHIFT (4U) -/*! TSTRIG - Enable Timestamp Interrupt Trigger - * 0b0..Timestamp Interrupt Trigger is not enabled - * 0b1..Timestamp Interrupt Trigger is enabled - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TSTRIG(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TSTRIG_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TSTRIG_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_TSADDREG_MASK (0x20U) -#define ENET_MAC_TIMESTAMP_CONTROL_TSADDREG_SHIFT (5U) -/*! TSADDREG - Update Addend Register - * 0b0..Addend Register is not updated - * 0b1..Addend Register is updated - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TSADDREG(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TSADDREG_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TSADDREG_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_TSENALL_MASK (0x100U) -#define ENET_MAC_TIMESTAMP_CONTROL_TSENALL_SHIFT (8U) -/*! TSENALL - Enable Timestamp for All Packets - * 0b0..Timestamp for All Packets disabled - * 0b1..Timestamp for All Packets enabled - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TSENALL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TSENALL_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TSENALL_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_TSCTRLSSR_MASK (0x200U) -#define ENET_MAC_TIMESTAMP_CONTROL_TSCTRLSSR_SHIFT (9U) -/*! TSCTRLSSR - Timestamp Digital or Binary Rollover Control - * 0b0..Timestamp Digital Rollover Control is disabled and Binary Rollover Control is enabled - * 0b1..Timestamp Digital Rollover Control is enabled and Binary Rollover Control is disabled - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TSCTRLSSR(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TSCTRLSSR_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TSCTRLSSR_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_TSVER2ENA_MASK (0x400U) -#define ENET_MAC_TIMESTAMP_CONTROL_TSVER2ENA_SHIFT (10U) -/*! TSVER2ENA - Enable PTP Packet Processing for Version 2 Format - * 0b0..PTP Packet Processing for Version 2 Format is disabled - * 0b1..PTP Packet Processing for Version 2 Format is enabled - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TSVER2ENA(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TSVER2ENA_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TSVER2ENA_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_TSIPENA_MASK (0x800U) -#define ENET_MAC_TIMESTAMP_CONTROL_TSIPENA_SHIFT (11U) -/*! TSIPENA - Enable Processing of PTP over Ethernet Packets - * 0b0..Processing of PTP over Ethernet Packets is disabled - * 0b1..Processing of PTP over Ethernet Packets is enabled - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TSIPENA(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TSIPENA_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TSIPENA_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_TSIPV6ENA_MASK (0x1000U) -#define ENET_MAC_TIMESTAMP_CONTROL_TSIPV6ENA_SHIFT (12U) -/*! TSIPV6ENA - Enable Processing of PTP Packets Sent over IPv6-UDP - * 0b0..Processing of PTP Packets Sent over IPv6-UDP is disabled - * 0b1..Processing of PTP Packets Sent over IPv6-UDP is enabled - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TSIPV6ENA(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TSIPV6ENA_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TSIPV6ENA_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_TSIPV4ENA_MASK (0x2000U) -#define ENET_MAC_TIMESTAMP_CONTROL_TSIPV4ENA_SHIFT (13U) -/*! TSIPV4ENA - Enable Processing of PTP Packets Sent over IPv4-UDP - * 0b0..Processing of PTP Packets Sent over IPv4-UDP is disabled - * 0b1..Processing of PTP Packets Sent over IPv4-UDP is enabled - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TSIPV4ENA(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TSIPV4ENA_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TSIPV4ENA_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_TSEVNTENA_MASK (0x4000U) -#define ENET_MAC_TIMESTAMP_CONTROL_TSEVNTENA_SHIFT (14U) -/*! TSEVNTENA - Enable Timestamp Snapshot for Event Messages - * 0b0..Timestamp Snapshot for Event Messages is disabled - * 0b1..Timestamp Snapshot for Event Messages is enabled - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TSEVNTENA(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TSEVNTENA_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TSEVNTENA_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_TSMSTRENA_MASK (0x8000U) -#define ENET_MAC_TIMESTAMP_CONTROL_TSMSTRENA_SHIFT (15U) -/*! TSMSTRENA - Enable Snapshot for Messages Relevant to Master - * 0b0..Snapshot for Messages Relevant to Master is disabled - * 0b1..Snapshot for Messages Relevant to Master is enabled - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TSMSTRENA(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TSMSTRENA_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TSMSTRENA_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_SNAPTYPSEL_MASK (0x30000U) -#define ENET_MAC_TIMESTAMP_CONTROL_SNAPTYPSEL_SHIFT (16U) -/*! SNAPTYPSEL - Select PTP packets for Taking Snapshots */ -#define ENET_MAC_TIMESTAMP_CONTROL_SNAPTYPSEL(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_SNAPTYPSEL_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_SNAPTYPSEL_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_TSENMACADDR_MASK (0x40000U) -#define ENET_MAC_TIMESTAMP_CONTROL_TSENMACADDR_SHIFT (18U) -/*! TSENMACADDR - Enable MAC Address for PTP Packet Filtering - * 0b0..MAC Address for PTP Packet Filtering is disabled - * 0b1..MAC Address for PTP Packet Filtering is enabled - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TSENMACADDR(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TSENMACADDR_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TSENMACADDR_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_ESTI_MASK (0x100000U) -#define ENET_MAC_TIMESTAMP_CONTROL_ESTI_SHIFT (20U) -/*! ESTI - External System Time Input - * 0b0..External System Time Input is disabled - * 0b1..External System Time Input is enabled - */ -#define ENET_MAC_TIMESTAMP_CONTROL_ESTI(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_ESTI_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_ESTI_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_TXTSSTSM_MASK (0x1000000U) -#define ENET_MAC_TIMESTAMP_CONTROL_TXTSSTSM_SHIFT (24U) -/*! TXTSSTSM - Transmit Timestamp Status Mode - * 0b0..Transmit Timestamp Status Mode is disabled - * 0b1..Transmit Timestamp Status Mode is enabled - */ -#define ENET_MAC_TIMESTAMP_CONTROL_TXTSSTSM(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_TXTSSTSM_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_TXTSSTSM_MASK) - -#define ENET_MAC_TIMESTAMP_CONTROL_AV8021ASMEN_MASK (0x10000000U) -#define ENET_MAC_TIMESTAMP_CONTROL_AV8021ASMEN_SHIFT (28U) -/*! AV8021ASMEN - AV 802. - * 0b0..AV 802.1AS Mode is disabled - * 0b1..AV 802.1AS Mode is enabled - */ -#define ENET_MAC_TIMESTAMP_CONTROL_AV8021ASMEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_CONTROL_AV8021ASMEN_SHIFT)) & ENET_MAC_TIMESTAMP_CONTROL_AV8021ASMEN_MASK) -/*! @} */ - -/*! @name MAC_SUB_SECOND_INCREMENT - Subsecond Increment */ -/*! @{ */ - -#define ENET_MAC_SUB_SECOND_INCREMENT_SNSINC_MASK (0xFF0000U) -#define ENET_MAC_SUB_SECOND_INCREMENT_SNSINC_SHIFT (16U) -/*! SNSINC - Sub-nanosecond Increment Value */ -#define ENET_MAC_SUB_SECOND_INCREMENT_SNSINC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_SUB_SECOND_INCREMENT_SNSINC_SHIFT)) & ENET_MAC_SUB_SECOND_INCREMENT_SNSINC_MASK) -/*! @} */ - -/*! @name MAC_SYSTEM_TIME_SECONDS - System Time Seconds */ -/*! @{ */ - -#define ENET_MAC_SYSTEM_TIME_SECONDS_TSS_MASK (0xFFFFFFFFU) -#define ENET_MAC_SYSTEM_TIME_SECONDS_TSS_SHIFT (0U) -/*! TSS - Timestamp Second */ -#define ENET_MAC_SYSTEM_TIME_SECONDS_TSS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_SYSTEM_TIME_SECONDS_TSS_SHIFT)) & ENET_MAC_SYSTEM_TIME_SECONDS_TSS_MASK) -/*! @} */ - -/*! @name MAC_SYSTEM_TIME_NANOSECONDS - System Time Nanoseconds */ -/*! @{ */ - -#define ENET_MAC_SYSTEM_TIME_NANOSECONDS_TSSS_MASK (0x7FFFFFFFU) -#define ENET_MAC_SYSTEM_TIME_NANOSECONDS_TSSS_SHIFT (0U) -/*! TSSS - Timestamp Sub Seconds */ -#define ENET_MAC_SYSTEM_TIME_NANOSECONDS_TSSS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_SYSTEM_TIME_NANOSECONDS_TSSS_SHIFT)) & ENET_MAC_SYSTEM_TIME_NANOSECONDS_TSSS_MASK) -/*! @} */ - -/*! @name MAC_SYSTEM_TIME_SECONDS_UPDATE - System Time Seconds Update */ -/*! @{ */ - -#define ENET_MAC_SYSTEM_TIME_SECONDS_UPDATE_TSS_MASK (0xFFFFFFFFU) -#define ENET_MAC_SYSTEM_TIME_SECONDS_UPDATE_TSS_SHIFT (0U) -/*! TSS - Timestamp Seconds */ -#define ENET_MAC_SYSTEM_TIME_SECONDS_UPDATE_TSS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_SYSTEM_TIME_SECONDS_UPDATE_TSS_SHIFT)) & ENET_MAC_SYSTEM_TIME_SECONDS_UPDATE_TSS_MASK) -/*! @} */ - -/*! @name MAC_SYSTEM_TIME_NANOSECONDS_UPDATE - System Time Nanoseconds Update */ -/*! @{ */ - -#define ENET_MAC_SYSTEM_TIME_NANOSECONDS_UPDATE_TSSS_MASK (0x7FFFFFFFU) -#define ENET_MAC_SYSTEM_TIME_NANOSECONDS_UPDATE_TSSS_SHIFT (0U) -/*! TSSS - Timestamp Sub Seconds */ -#define ENET_MAC_SYSTEM_TIME_NANOSECONDS_UPDATE_TSSS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_SYSTEM_TIME_NANOSECONDS_UPDATE_TSSS_SHIFT)) & ENET_MAC_SYSTEM_TIME_NANOSECONDS_UPDATE_TSSS_MASK) - -#define ENET_MAC_SYSTEM_TIME_NANOSECONDS_UPDATE_ADDSUB_MASK (0x80000000U) -#define ENET_MAC_SYSTEM_TIME_NANOSECONDS_UPDATE_ADDSUB_SHIFT (31U) -/*! ADDSUB - Add or Subtract Time - * 0b0..Add time - * 0b1..Subtract time - */ -#define ENET_MAC_SYSTEM_TIME_NANOSECONDS_UPDATE_ADDSUB(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_SYSTEM_TIME_NANOSECONDS_UPDATE_ADDSUB_SHIFT)) & ENET_MAC_SYSTEM_TIME_NANOSECONDS_UPDATE_ADDSUB_MASK) -/*! @} */ - -/*! @name MAC_TIMESTAMP_ADDEND - Timestamp Addend */ -/*! @{ */ - -#define ENET_MAC_TIMESTAMP_ADDEND_TSAR_MASK (0xFFFFFFFFU) -#define ENET_MAC_TIMESTAMP_ADDEND_TSAR_SHIFT (0U) -/*! TSAR - Timestamp Addend Register */ -#define ENET_MAC_TIMESTAMP_ADDEND_TSAR(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_ADDEND_TSAR_SHIFT)) & ENET_MAC_TIMESTAMP_ADDEND_TSAR_MASK) -/*! @} */ - -/*! @name MAC_TIMESTAMP_STATUS - Timestamp Status */ -/*! @{ */ - -#define ENET_MAC_TIMESTAMP_STATUS_TSSOVF_MASK (0x1U) -#define ENET_MAC_TIMESTAMP_STATUS_TSSOVF_SHIFT (0U) -/*! TSSOVF - Timestamp Seconds Overflow - * 0b1..Timestamp Seconds Overflow status detected - * 0b0..Timestamp Seconds Overflow status not detected - */ -#define ENET_MAC_TIMESTAMP_STATUS_TSSOVF(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_STATUS_TSSOVF_SHIFT)) & ENET_MAC_TIMESTAMP_STATUS_TSSOVF_MASK) - -#define ENET_MAC_TIMESTAMP_STATUS_TSTARGT0_MASK (0x2U) -#define ENET_MAC_TIMESTAMP_STATUS_TSTARGT0_SHIFT (1U) -/*! TSTARGT0 - Timestamp Target Time Reached - * 0b1..Timestamp Target Time Reached status detected - * 0b0..Timestamp Target Time Reached status not detected - */ -#define ENET_MAC_TIMESTAMP_STATUS_TSTARGT0(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_STATUS_TSTARGT0_SHIFT)) & ENET_MAC_TIMESTAMP_STATUS_TSTARGT0_MASK) - -#define ENET_MAC_TIMESTAMP_STATUS_TSTRGTERR0_MASK (0x8U) -#define ENET_MAC_TIMESTAMP_STATUS_TSTRGTERR0_SHIFT (3U) -/*! TSTRGTERR0 - Timestamp Target Time Error - * 0b1..Timestamp Target Time Error status detected - * 0b0..Timestamp Target Time Error status not detected - */ -#define ENET_MAC_TIMESTAMP_STATUS_TSTRGTERR0(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_STATUS_TSTRGTERR0_SHIFT)) & ENET_MAC_TIMESTAMP_STATUS_TSTRGTERR0_MASK) - -#define ENET_MAC_TIMESTAMP_STATUS_TXTSSIS_MASK (0x8000U) -#define ENET_MAC_TIMESTAMP_STATUS_TXTSSIS_SHIFT (15U) -/*! TXTSSIS - Tx Timestamp Status Interrupt Status - * 0b1..Tx Timestamp Status Interrupt status detected - * 0b0..Tx Timestamp Status Interrupt status not detected - */ -#define ENET_MAC_TIMESTAMP_STATUS_TXTSSIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_STATUS_TXTSSIS_SHIFT)) & ENET_MAC_TIMESTAMP_STATUS_TXTSSIS_MASK) -/*! @} */ - -/*! @name MAC_TX_TIMESTAMP_STATUS_NANOSECONDS - Transmit Timestamp Status Nanoseconds */ -/*! @{ */ - -#define ENET_MAC_TX_TIMESTAMP_STATUS_NANOSECONDS_TXTSSLO_MASK (0x7FFFFFFFU) -#define ENET_MAC_TX_TIMESTAMP_STATUS_NANOSECONDS_TXTSSLO_SHIFT (0U) -/*! TXTSSLO - Transmit Timestamp Status Low */ -#define ENET_MAC_TX_TIMESTAMP_STATUS_NANOSECONDS_TXTSSLO(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TX_TIMESTAMP_STATUS_NANOSECONDS_TXTSSLO_SHIFT)) & ENET_MAC_TX_TIMESTAMP_STATUS_NANOSECONDS_TXTSSLO_MASK) - -#define ENET_MAC_TX_TIMESTAMP_STATUS_NANOSECONDS_TXTSSMIS_MASK (0x80000000U) -#define ENET_MAC_TX_TIMESTAMP_STATUS_NANOSECONDS_TXTSSMIS_SHIFT (31U) -/*! TXTSSMIS - TXTSSMIS - * 0b1..Transmit Timestamp Status Missed status detected - * 0b0..Transmit Timestamp Status Missed status not detected - */ -#define ENET_MAC_TX_TIMESTAMP_STATUS_NANOSECONDS_TXTSSMIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TX_TIMESTAMP_STATUS_NANOSECONDS_TXTSSMIS_SHIFT)) & ENET_MAC_TX_TIMESTAMP_STATUS_NANOSECONDS_TXTSSMIS_MASK) -/*! @} */ - -/*! @name MAC_TX_TIMESTAMP_STATUS_SECONDS - Transmit Timestamp Status Seconds */ -/*! @{ */ - -#define ENET_MAC_TX_TIMESTAMP_STATUS_SECONDS_TXTSSHI_MASK (0xFFFFFFFFU) -#define ENET_MAC_TX_TIMESTAMP_STATUS_SECONDS_TXTSSHI_SHIFT (0U) -/*! TXTSSHI - Transmit Timestamp Status High */ -#define ENET_MAC_TX_TIMESTAMP_STATUS_SECONDS_TXTSSHI(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TX_TIMESTAMP_STATUS_SECONDS_TXTSSHI_SHIFT)) & ENET_MAC_TX_TIMESTAMP_STATUS_SECONDS_TXTSSHI_MASK) -/*! @} */ - -/*! @name MAC_TIMESTAMP_INGRESS_CORR_NANOSECOND - Timestamp Ingress Correction Nanosecond */ -/*! @{ */ - -#define ENET_MAC_TIMESTAMP_INGRESS_CORR_NANOSECOND_TSIC_MASK (0xFFFFFFFFU) -#define ENET_MAC_TIMESTAMP_INGRESS_CORR_NANOSECOND_TSIC_SHIFT (0U) -/*! TSIC - Timestamp Ingress Correction */ -#define ENET_MAC_TIMESTAMP_INGRESS_CORR_NANOSECOND_TSIC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_INGRESS_CORR_NANOSECOND_TSIC_SHIFT)) & ENET_MAC_TIMESTAMP_INGRESS_CORR_NANOSECOND_TSIC_MASK) -/*! @} */ - -/*! @name MAC_TIMESTAMP_EGRESS_CORR_NANOSECOND - Timestamp Egress Correction Nanosecond */ -/*! @{ */ - -#define ENET_MAC_TIMESTAMP_EGRESS_CORR_NANOSECOND_TSEC_MASK (0xFFFFFFFFU) -#define ENET_MAC_TIMESTAMP_EGRESS_CORR_NANOSECOND_TSEC_SHIFT (0U) -/*! TSEC - Timestamp Egress Correction */ -#define ENET_MAC_TIMESTAMP_EGRESS_CORR_NANOSECOND_TSEC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_EGRESS_CORR_NANOSECOND_TSEC_SHIFT)) & ENET_MAC_TIMESTAMP_EGRESS_CORR_NANOSECOND_TSEC_MASK) -/*! @} */ - -/*! @name MAC_TIMESTAMP_INGRESS_LATENCY - Timestamp Ingress Latency */ -/*! @{ */ - -#define ENET_MAC_TIMESTAMP_INGRESS_LATENCY_ITLSNS_MASK (0xFF00U) -#define ENET_MAC_TIMESTAMP_INGRESS_LATENCY_ITLSNS_SHIFT (8U) -/*! ITLSNS - ITLSNS */ -#define ENET_MAC_TIMESTAMP_INGRESS_LATENCY_ITLSNS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_INGRESS_LATENCY_ITLSNS_SHIFT)) & ENET_MAC_TIMESTAMP_INGRESS_LATENCY_ITLSNS_MASK) - -#define ENET_MAC_TIMESTAMP_INGRESS_LATENCY_ITLNS_MASK (0xFFF0000U) -#define ENET_MAC_TIMESTAMP_INGRESS_LATENCY_ITLNS_SHIFT (16U) -/*! ITLNS - ITLNS */ -#define ENET_MAC_TIMESTAMP_INGRESS_LATENCY_ITLNS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_INGRESS_LATENCY_ITLNS_SHIFT)) & ENET_MAC_TIMESTAMP_INGRESS_LATENCY_ITLNS_MASK) -/*! @} */ - -/*! @name MAC_TIMESTAMP_EGRESS_LATENCY - Timestamp Egress Latency */ -/*! @{ */ - -#define ENET_MAC_TIMESTAMP_EGRESS_LATENCY_ETLSNS_MASK (0xFF00U) -#define ENET_MAC_TIMESTAMP_EGRESS_LATENCY_ETLSNS_SHIFT (8U) -/*! ETLSNS - Egress Timestamp Latency, in sub-nanoseconds */ -#define ENET_MAC_TIMESTAMP_EGRESS_LATENCY_ETLSNS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_EGRESS_LATENCY_ETLSNS_SHIFT)) & ENET_MAC_TIMESTAMP_EGRESS_LATENCY_ETLSNS_MASK) - -#define ENET_MAC_TIMESTAMP_EGRESS_LATENCY_ETLNS_MASK (0xFFF0000U) -#define ENET_MAC_TIMESTAMP_EGRESS_LATENCY_ETLNS_SHIFT (16U) -/*! ETLNS - Egress Timestamp Latency, in nanoseconds */ -#define ENET_MAC_TIMESTAMP_EGRESS_LATENCY_ETLNS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_TIMESTAMP_EGRESS_LATENCY_ETLNS_SHIFT)) & ENET_MAC_TIMESTAMP_EGRESS_LATENCY_ETLNS_MASK) -/*! @} */ - -/*! @name MAC_PPS_CONTROL - PPS Control */ -/*! @{ */ - -#define ENET_MAC_PPS_CONTROL_PPSCTRL_PPSCMD_MASK (0xFU) -#define ENET_MAC_PPS_CONTROL_PPSCTRL_PPSCMD_SHIFT (0U) -/*! PPSCTRL_PPSCMD - PPS Output Frequency Control */ -#define ENET_MAC_PPS_CONTROL_PPSCTRL_PPSCMD(x) (((uint32_t)(((uint32_t)(x)) << ENET_MAC_PPS_CONTROL_PPSCTRL_PPSCMD_SHIFT)) & ENET_MAC_PPS_CONTROL_PPSCTRL_PPSCMD_MASK) -/*! @} */ - -/*! @name PPS0_TARGET_TIME_SECONDS - PPS0 Target Time Seconds */ -/*! @{ */ - -#define ENET_PPS0_TARGET_TIME_SECONDS_TSTRH0_MASK (0xFFFFFFFFU) -#define ENET_PPS0_TARGET_TIME_SECONDS_TSTRH0_SHIFT (0U) -/*! TSTRH0 - PPS Target Time Seconds Register */ -#define ENET_PPS0_TARGET_TIME_SECONDS_TSTRH0(x) (((uint32_t)(((uint32_t)(x)) << ENET_PPS0_TARGET_TIME_SECONDS_TSTRH0_SHIFT)) & ENET_PPS0_TARGET_TIME_SECONDS_TSTRH0_MASK) -/*! @} */ - -/*! @name PPS0_TARGET_TIME_NANOSECONDS - PPS0 Target Time Nanoseconds */ -/*! @{ */ - -#define ENET_PPS0_TARGET_TIME_NANOSECONDS_TTSL0_MASK (0x7FFFFFFFU) -#define ENET_PPS0_TARGET_TIME_NANOSECONDS_TTSL0_SHIFT (0U) -/*! TTSL0 - Target Time Low for PPS Register */ -#define ENET_PPS0_TARGET_TIME_NANOSECONDS_TTSL0(x) (((uint32_t)(((uint32_t)(x)) << ENET_PPS0_TARGET_TIME_NANOSECONDS_TTSL0_SHIFT)) & ENET_PPS0_TARGET_TIME_NANOSECONDS_TTSL0_MASK) -/*! @} */ - -/*! @name MTL_OPERATION_MODE - MTL Operation Mode */ -/*! @{ */ - -#define ENET_MTL_OPERATION_MODE_DTXSTS_MASK (0x2U) -#define ENET_MTL_OPERATION_MODE_DTXSTS_SHIFT (1U) -/*! DTXSTS - Drop Transmit Status - * 0b0..Drop Transmit Status is disabled - * 0b1..Drop Transmit Status is enabled - */ -#define ENET_MTL_OPERATION_MODE_DTXSTS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_OPERATION_MODE_DTXSTS_SHIFT)) & ENET_MTL_OPERATION_MODE_DTXSTS_MASK) - -#define ENET_MTL_OPERATION_MODE_RAA_MASK (0x4U) -#define ENET_MTL_OPERATION_MODE_RAA_SHIFT (2U) -/*! RAA - Receive Arbitration Algorithm - * 0b0..Strict priority (SP) - * 0b1..Weighted Strict Priority (WSP) - */ -#define ENET_MTL_OPERATION_MODE_RAA(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_OPERATION_MODE_RAA_SHIFT)) & ENET_MTL_OPERATION_MODE_RAA_MASK) - -#define ENET_MTL_OPERATION_MODE_SCHALG_MASK (0x60U) -#define ENET_MTL_OPERATION_MODE_SCHALG_SHIFT (5U) -/*! SCHALG - Tx Scheduling Algorithm - * 0b10..DWRR algorithm when DCB feature is selected.Otherwise, Reserved - * 0b11..Strict priority algorithm - * 0b01..WFQ algorithm when DCB feature is selected.Otherwise, Reserved - * 0b00..WRR algorithm - */ -#define ENET_MTL_OPERATION_MODE_SCHALG(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_OPERATION_MODE_SCHALG_SHIFT)) & ENET_MTL_OPERATION_MODE_SCHALG_MASK) - -#define ENET_MTL_OPERATION_MODE_CNTPRST_MASK (0x100U) -#define ENET_MTL_OPERATION_MODE_CNTPRST_SHIFT (8U) -/*! CNTPRST - Counters Preset - * 0b0..Counters Preset is disabled - * 0b1..Counters Preset is enabled - */ -#define ENET_MTL_OPERATION_MODE_CNTPRST(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_OPERATION_MODE_CNTPRST_SHIFT)) & ENET_MTL_OPERATION_MODE_CNTPRST_MASK) - -#define ENET_MTL_OPERATION_MODE_CNTCLR_MASK (0x200U) -#define ENET_MTL_OPERATION_MODE_CNTCLR_SHIFT (9U) -/*! CNTCLR - Counters Reset - * 0b0..Counters are not reset - * 0b1..All counters are reset - */ -#define ENET_MTL_OPERATION_MODE_CNTCLR(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_OPERATION_MODE_CNTCLR_SHIFT)) & ENET_MTL_OPERATION_MODE_CNTCLR_MASK) -/*! @} */ - -/*! @name MTL_INTERRUPT_STATUS - MTL Interrupt Status */ -/*! @{ */ - -#define ENET_MTL_INTERRUPT_STATUS_Q0IS_MASK (0x1U) -#define ENET_MTL_INTERRUPT_STATUS_Q0IS_SHIFT (0U) -/*! Q0IS - Queue 0 Interrupt status - * 0b1..Queue 0 Interrupt status detected - * 0b0..Queue 0 Interrupt status not detected - */ -#define ENET_MTL_INTERRUPT_STATUS_Q0IS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_INTERRUPT_STATUS_Q0IS_SHIFT)) & ENET_MTL_INTERRUPT_STATUS_Q0IS_MASK) - -#define ENET_MTL_INTERRUPT_STATUS_Q1IS_MASK (0x2U) -#define ENET_MTL_INTERRUPT_STATUS_Q1IS_SHIFT (1U) -/*! Q1IS - Queue 1 Interrupt status - * 0b1..Queue 1 Interrupt status detected - * 0b0..Queue 1 Interrupt status not detected - */ -#define ENET_MTL_INTERRUPT_STATUS_Q1IS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_INTERRUPT_STATUS_Q1IS_SHIFT)) & ENET_MTL_INTERRUPT_STATUS_Q1IS_MASK) -/*! @} */ - -/*! @name MTL_RXQ_DMA_MAP0 - Receive Queue and DMA Channel Mapping 0 */ -/*! @{ */ - -#define ENET_MTL_RXQ_DMA_MAP0_Q0MDMACH_MASK (0x1U) -#define ENET_MTL_RXQ_DMA_MAP0_Q0MDMACH_SHIFT (0U) -/*! Q0MDMACH - Queue 0 Mapped to DMA Channel */ -#define ENET_MTL_RXQ_DMA_MAP0_Q0MDMACH(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_RXQ_DMA_MAP0_Q0MDMACH_SHIFT)) & ENET_MTL_RXQ_DMA_MAP0_Q0MDMACH_MASK) - -#define ENET_MTL_RXQ_DMA_MAP0_Q0DDMACH_MASK (0x10U) -#define ENET_MTL_RXQ_DMA_MAP0_Q0DDMACH_SHIFT (4U) -/*! Q0DDMACH - Queue 0 Enabled for DA-based DMA Channel Selection - * 0b0..Queue 0 disabled for DA-based DMA Channel Selection - * 0b1..Queue 0 enabled for DA-based DMA Channel Selection - */ -#define ENET_MTL_RXQ_DMA_MAP0_Q0DDMACH(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_RXQ_DMA_MAP0_Q0DDMACH_SHIFT)) & ENET_MTL_RXQ_DMA_MAP0_Q0DDMACH_MASK) - -#define ENET_MTL_RXQ_DMA_MAP0_Q1MDMACH_MASK (0x100U) -#define ENET_MTL_RXQ_DMA_MAP0_Q1MDMACH_SHIFT (8U) -/*! Q1MDMACH - Queue 1 Mapped to DMA Channel */ -#define ENET_MTL_RXQ_DMA_MAP0_Q1MDMACH(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_RXQ_DMA_MAP0_Q1MDMACH_SHIFT)) & ENET_MTL_RXQ_DMA_MAP0_Q1MDMACH_MASK) - -#define ENET_MTL_RXQ_DMA_MAP0_Q1DDMACH_MASK (0x1000U) -#define ENET_MTL_RXQ_DMA_MAP0_Q1DDMACH_SHIFT (12U) -/*! Q1DDMACH - Queue 1 Enabled for DA-based DMA Channel Selection - * 0b0..Queue 1 disabled for DA-based DMA Channel Selection - * 0b1..Queue 1 enabled for DA-based DMA Channel Selection - */ -#define ENET_MTL_RXQ_DMA_MAP0_Q1DDMACH(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_RXQ_DMA_MAP0_Q1DDMACH_SHIFT)) & ENET_MTL_RXQ_DMA_MAP0_Q1DDMACH_MASK) -/*! @} */ - -/*! @name MTL_QUEUE_MTL_TXQX_OP_MODE - Queue 0 Transmit Operation Mode..Queue 1 Transmit Operation Mode */ -/*! @{ */ - -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_FTQ_MASK (0x1U) -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_FTQ_SHIFT (0U) -/*! FTQ - Flush Transmit Queue - * 0b0..Flush Transmit Queue is disabled - * 0b1..Flush Transmit Queue is enabled - */ -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_FTQ(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_FTQ_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_FTQ_MASK) - -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TSF_MASK (0x2U) -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TSF_SHIFT (1U) -/*! TSF - Transmit Store and Forward - * 0b0..Transmit Store and Forward is disabled - * 0b1..Transmit Store and Forward is enabled - */ -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TSF(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TSF_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TSF_MASK) - -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TXQEN_MASK (0xCU) -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TXQEN_SHIFT (2U) -/*! TXQEN - Transmit Queue Enable - * 0b00..Not enabled - * 0b10..Enabled - * 0b01..Enable in AV mode (Reserved in non-AV) - * 0b11..Reserved - */ -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TXQEN(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TXQEN_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TXQEN_MASK) - -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TTC_MASK (0x70U) -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TTC_SHIFT (4U) -/*! TTC - Transmit Threshold Control - * 0b011..128 - * 0b100..192 - * 0b101..256 - * 0b000..32 - * 0b110..384 - * 0b111..512 - * 0b001..64 - * 0b010..96 - */ -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TTC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TTC_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TTC_MASK) - -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TQS_MASK (0x70000U) -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TQS_SHIFT (16U) -/*! TQS - Transmit Queue Size */ -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TQS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TQS_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TQS_MASK) -/*! @} */ - -/* The count of ENET_MTL_QUEUE_MTL_TXQX_OP_MODE */ -#define ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_COUNT (2U) - -/*! @name MTL_QUEUE_MTL_TXQX_UNDRFLW - Queue 0 Underflow Counter..Queue 1 Underflow Counter */ -/*! @{ */ - -#define ENET_MTL_QUEUE_MTL_TXQX_UNDRFLW_UFFRMCNT_MASK (0x7FFU) -#define ENET_MTL_QUEUE_MTL_TXQX_UNDRFLW_UFFRMCNT_SHIFT (0U) -/*! UFFRMCNT - Underflow Packet Counter */ -#define ENET_MTL_QUEUE_MTL_TXQX_UNDRFLW_UFFRMCNT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_UNDRFLW_UFFRMCNT_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_UNDRFLW_UFFRMCNT_MASK) - -#define ENET_MTL_QUEUE_MTL_TXQX_UNDRFLW_UFCNTOVF_MASK (0x800U) -#define ENET_MTL_QUEUE_MTL_TXQX_UNDRFLW_UFCNTOVF_SHIFT (11U) -/*! UFCNTOVF - Overflow Bit for Underflow Packet Counter - * 0b1..Overflow detected for Underflow Packet Counter - * 0b0..Overflow not detected for Underflow Packet Counter - */ -#define ENET_MTL_QUEUE_MTL_TXQX_UNDRFLW_UFCNTOVF(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_UNDRFLW_UFCNTOVF_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_UNDRFLW_UFCNTOVF_MASK) -/*! @} */ - -/* The count of ENET_MTL_QUEUE_MTL_TXQX_UNDRFLW */ -#define ENET_MTL_QUEUE_MTL_TXQX_UNDRFLW_COUNT (2U) - -/*! @name MTL_QUEUE_MTL_TXQX_DBG - Queue 0 Transmit Debug..Queue 1 Transmit Debug */ -/*! @{ */ - -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_TXQPAUSED_MASK (0x1U) -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_TXQPAUSED_SHIFT (0U) -/*! TXQPAUSED - Transmit Queue in Pause - * 0b1..Transmit Queue in Pause status is detected - * 0b0..Transmit Queue in Pause status is not detected - */ -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_TXQPAUSED(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_DBG_TXQPAUSED_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_DBG_TXQPAUSED_MASK) - -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_TRCSTS_MASK (0x6U) -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_TRCSTS_SHIFT (1U) -/*! TRCSTS - MTL Tx Queue Read Controller Status - * 0b11..Flushing the Tx queue because of the Packet Abort request from the MAC - * 0b00..Idle state - * 0b01..Read state (transferring data to the MAC transmitter) - * 0b10..Waiting for pending Tx Status from the MAC transmitter - */ -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_TRCSTS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_DBG_TRCSTS_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_DBG_TRCSTS_MASK) - -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_TWCSTS_MASK (0x8U) -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_TWCSTS_SHIFT (3U) -/*! TWCSTS - MTL Tx Queue Write Controller Status - * 0b1..MTL Tx Queue Write Controller status is detected - * 0b0..MTL Tx Queue Write Controller status is not detected - */ -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_TWCSTS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_DBG_TWCSTS_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_DBG_TWCSTS_MASK) - -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_TXQSTS_MASK (0x10U) -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_TXQSTS_SHIFT (4U) -/*! TXQSTS - MTL Tx Queue Not Empty Status - * 0b1..MTL Tx Queue Not Empty status is detected - * 0b0..MTL Tx Queue Not Empty status is not detected - */ -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_TXQSTS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_DBG_TXQSTS_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_DBG_TXQSTS_MASK) - -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_TXSTSFSTS_MASK (0x20U) -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_TXSTSFSTS_SHIFT (5U) -/*! TXSTSFSTS - MTL Tx Status FIFO Full Status - * 0b1..MTL Tx Status FIFO Full status is detected - * 0b0..MTL Tx Status FIFO Full status is not detected - */ -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_TXSTSFSTS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_DBG_TXSTSFSTS_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_DBG_TXSTSFSTS_MASK) - -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_PTXQ_MASK (0x70000U) -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_PTXQ_SHIFT (16U) -/*! PTXQ - Number of Packets in the Transmit Queue */ -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_PTXQ(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_DBG_PTXQ_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_DBG_PTXQ_MASK) - -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_STXSTSF_MASK (0x700000U) -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_STXSTSF_SHIFT (20U) -/*! STXSTSF - Number of Status Words in Tx Status FIFO of Queue */ -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_STXSTSF(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_DBG_STXSTSF_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_DBG_STXSTSF_MASK) -/*! @} */ - -/* The count of ENET_MTL_QUEUE_MTL_TXQX_DBG */ -#define ENET_MTL_QUEUE_MTL_TXQX_DBG_COUNT (2U) - -/*! @name MTL_QUEUE_MTL_TXQX_ETS_CTRL - Queue 1 ETS Control */ -/*! @{ */ - -#define ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_AVALG_MASK (0x4U) -#define ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_AVALG_SHIFT (2U) -/*! AVALG - AV Algorithm - * 0b0..CBS Algorithm is disabled - * 0b1..CBS Algorithm is enabled - */ -#define ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_AVALG(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_AVALG_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_AVALG_MASK) - -#define ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_CC_MASK (0x8U) -#define ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_CC_SHIFT (3U) -/*! CC - Credit Control - * 0b0..Credit Control is disabled - * 0b1..Credit Control is enabled - */ -#define ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_CC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_CC_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_CC_MASK) - -#define ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_SLC_MASK (0x70U) -#define ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_SLC_SHIFT (4U) -/*! SLC - Slot Count - * 0b100..16 slots - * 0b000..1 slot - * 0b001..2 slots - * 0b010..4 slots - * 0b011..8 slots - * 0b101..Reserved - */ -#define ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_SLC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_SLC_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_SLC_MASK) -/*! @} */ - -/* The count of ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL */ -#define ENET_MTL_QUEUE_MTL_TXQX_ETS_CTRL_COUNT (2U) - -/*! @name MTL_QUEUE_MTL_TXQX_ETS_STAT - Queue 0 ETS Status..Queue 1 ETS Status */ -/*! @{ */ - -#define ENET_MTL_QUEUE_MTL_TXQX_ETS_STAT_ABS_MASK (0xFFFFFFU) -#define ENET_MTL_QUEUE_MTL_TXQX_ETS_STAT_ABS_SHIFT (0U) -/*! ABS - Average Bits per Slot */ -#define ENET_MTL_QUEUE_MTL_TXQX_ETS_STAT_ABS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_ETS_STAT_ABS_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_ETS_STAT_ABS_MASK) -/*! @} */ - -/* The count of ENET_MTL_QUEUE_MTL_TXQX_ETS_STAT */ -#define ENET_MTL_QUEUE_MTL_TXQX_ETS_STAT_COUNT (2U) - -/*! @name MTL_QUEUE_MTL_TXQX_QNTM_WGHT - Queue 0 Quantum or Weights..Queue 1 idleSlopeCredit, Quantum or Weights */ -/*! @{ */ - -#define ENET_MTL_QUEUE_MTL_TXQX_QNTM_WGHT_ISCQW_MASK (0x1FFFFFU) -#define ENET_MTL_QUEUE_MTL_TXQX_QNTM_WGHT_ISCQW_SHIFT (0U) -/*! ISCQW - idleSlopeCredit, Quantum or Weights */ -#define ENET_MTL_QUEUE_MTL_TXQX_QNTM_WGHT_ISCQW(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_QNTM_WGHT_ISCQW_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_QNTM_WGHT_ISCQW_MASK) -/*! @} */ - -/* The count of ENET_MTL_QUEUE_MTL_TXQX_QNTM_WGHT */ -#define ENET_MTL_QUEUE_MTL_TXQX_QNTM_WGHT_COUNT (2U) - -/*! @name MTL_QUEUE_MTL_TXQX_SNDSLP_CRDT - Queue 1 sendSlopeCredit */ -/*! @{ */ - -#define ENET_MTL_QUEUE_MTL_TXQX_SNDSLP_CRDT_SSC_MASK (0x3FFFU) -#define ENET_MTL_QUEUE_MTL_TXQX_SNDSLP_CRDT_SSC_SHIFT (0U) -/*! SSC - sendSlopeCredit Value */ -#define ENET_MTL_QUEUE_MTL_TXQX_SNDSLP_CRDT_SSC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_SNDSLP_CRDT_SSC_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_SNDSLP_CRDT_SSC_MASK) -/*! @} */ - -/* The count of ENET_MTL_QUEUE_MTL_TXQX_SNDSLP_CRDT */ -#define ENET_MTL_QUEUE_MTL_TXQX_SNDSLP_CRDT_COUNT (2U) - -/*! @name MTL_QUEUE_MTL_TXQX_HI_CRDT - Queue 1 hiCredit */ -/*! @{ */ - -#define ENET_MTL_QUEUE_MTL_TXQX_HI_CRDT_HC_MASK (0x1FFFFFFFU) -#define ENET_MTL_QUEUE_MTL_TXQX_HI_CRDT_HC_SHIFT (0U) -/*! HC - hiCredit Value */ -#define ENET_MTL_QUEUE_MTL_TXQX_HI_CRDT_HC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_HI_CRDT_HC_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_HI_CRDT_HC_MASK) -/*! @} */ - -/* The count of ENET_MTL_QUEUE_MTL_TXQX_HI_CRDT */ -#define ENET_MTL_QUEUE_MTL_TXQX_HI_CRDT_COUNT (2U) - -/*! @name MTL_QUEUE_MTL_TXQX_LO_CRDT - Queue 1 loCredit */ -/*! @{ */ - -#define ENET_MTL_QUEUE_MTL_TXQX_LO_CRDT_LC_MASK (0x1FFFFFFFU) -#define ENET_MTL_QUEUE_MTL_TXQX_LO_CRDT_LC_SHIFT (0U) -/*! LC - loCredit Value */ -#define ENET_MTL_QUEUE_MTL_TXQX_LO_CRDT_LC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_TXQX_LO_CRDT_LC_SHIFT)) & ENET_MTL_QUEUE_MTL_TXQX_LO_CRDT_LC_MASK) -/*! @} */ - -/* The count of ENET_MTL_QUEUE_MTL_TXQX_LO_CRDT */ -#define ENET_MTL_QUEUE_MTL_TXQX_LO_CRDT_COUNT (2U) - -/*! @name MTL_QUEUE_MTL_QX_INTCTRL_STAT - Queue 0 Interrupt Control Status..Queue 1 Interrupt Control Status */ -/*! @{ */ - -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_TXUNFIS_MASK (0x1U) -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_TXUNFIS_SHIFT (0U) -/*! TXUNFIS - Transmit Queue Underflow Interrupt Status - * 0b1..Transmit Queue Underflow Interrupt Status detected - * 0b0..Transmit Queue Underflow Interrupt Status not detected - */ -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_TXUNFIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_TXUNFIS_SHIFT)) & ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_TXUNFIS_MASK) - -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_ABPSIS_MASK (0x2U) -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_ABPSIS_SHIFT (1U) -/*! ABPSIS - Average Bits Per Slot Interrupt Status - * 0b1..Average Bits Per Slot Interrupt Status detected - * 0b0..Average Bits Per Slot Interrupt Status not detected - */ -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_ABPSIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_ABPSIS_SHIFT)) & ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_ABPSIS_MASK) - -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_TXUIE_MASK (0x100U) -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_TXUIE_SHIFT (8U) -/*! TXUIE - Transmit Queue Underflow Interrupt Enable - * 0b0..Transmit Queue Underflow Interrupt Status is disabled - * 0b1..Transmit Queue Underflow Interrupt Status is enabled - */ -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_TXUIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_TXUIE_SHIFT)) & ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_TXUIE_MASK) - -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_ABPSIE_MASK (0x200U) -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_ABPSIE_SHIFT (9U) -/*! ABPSIE - Average Bits Per Slot Interrupt Enable - * 0b0..Average Bits Per Slot Interrupt is disabled - * 0b1..Average Bits Per Slot Interrupt is enabled - */ -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_ABPSIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_ABPSIE_SHIFT)) & ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_ABPSIE_MASK) - -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_RXOVFIS_MASK (0x10000U) -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_RXOVFIS_SHIFT (16U) -/*! RXOVFIS - Receive Queue Overflow Interrupt Status - * 0b1..Receive Queue Overflow Interrupt Status detected - * 0b0..Receive Queue Overflow Interrupt Status not detected - */ -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_RXOVFIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_RXOVFIS_SHIFT)) & ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_RXOVFIS_MASK) - -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_RXOIE_MASK (0x1000000U) -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_RXOIE_SHIFT (24U) -/*! RXOIE - Receive Queue Overflow Interrupt Enable - * 0b0..Receive Queue Overflow Interrupt is disabled - * 0b1..Receive Queue Overflow Interrupt is enabled - */ -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_RXOIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_RXOIE_SHIFT)) & ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_RXOIE_MASK) -/*! @} */ - -/* The count of ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT */ -#define ENET_MTL_QUEUE_MTL_QX_INTCTRL_STAT_COUNT (2U) - -/*! @name MTL_QUEUE_MTL_RXQX_OP_MODE - Queue 0 Receive Operation Mode..Queue 1 Receive Operation Mode */ -/*! @{ */ - -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RTC_MASK (0x3U) -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RTC_SHIFT (0U) -/*! RTC - Receive Queue Threshold Control - * 0b11..128 - * 0b01..32 - * 0b00..64 - * 0b10..96 - */ -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RTC(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RTC_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RTC_MASK) - -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_FUP_MASK (0x8U) -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_FUP_SHIFT (3U) -/*! FUP - Forward Undersized Good Packets - * 0b0..Forward Undersized Good Packets is disabled - * 0b1..Forward Undersized Good Packets is enabled - */ -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_FUP(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_FUP_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_FUP_MASK) - -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_FEP_MASK (0x10U) -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_FEP_SHIFT (4U) -/*! FEP - Forward Error Packets - * 0b0..Forward Error Packets is disabled - * 0b1..Forward Error Packets is enabled - */ -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_FEP(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_FEP_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_FEP_MASK) - -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RSF_MASK (0x20U) -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RSF_SHIFT (5U) -/*! RSF - Receive Queue Store and Forward - * 0b0..Receive Queue Store and Forward is disabled - * 0b1..Receive Queue Store and Forward is enabled - */ -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RSF(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RSF_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RSF_MASK) - -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_DIS_TCP_EF_MASK (0x40U) -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_DIS_TCP_EF_SHIFT (6U) -/*! DIS_TCP_EF - Disable Dropping of TCP/IP Checksum Error Packets - * 0b1..Dropping of TCP/IP Checksum Error Packets is disabled - * 0b0..Dropping of TCP/IP Checksum Error Packets is enabled - */ -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_DIS_TCP_EF(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_DIS_TCP_EF_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_DIS_TCP_EF_MASK) - -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RQS_MASK (0x700000U) -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RQS_SHIFT (20U) -/*! RQS - Receive Queue Size */ -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RQS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RQS_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RQS_MASK) -/*! @} */ - -/* The count of ENET_MTL_QUEUE_MTL_RXQX_OP_MODE */ -#define ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_COUNT (2U) - -/*! @name MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT - Queue 0 Missed Packet and Overflow Counter..Queue 1 Missed Packet and Overflow Counter */ -/*! @{ */ - -#define ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_OVFPKTCNT_MASK (0x7FFU) -#define ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_OVFPKTCNT_SHIFT (0U) -/*! OVFPKTCNT - Overflow Packet Counter */ -#define ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_OVFPKTCNT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_OVFPKTCNT_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_OVFPKTCNT_MASK) - -#define ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_OVFCNTOVF_MASK (0x800U) -#define ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_OVFCNTOVF_SHIFT (11U) -/*! OVFCNTOVF - Overflow Counter Overflow Bit - * 0b1..Overflow Counter overflow detected - * 0b0..Overflow Counter overflow not detected - */ -#define ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_OVFCNTOVF(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_OVFCNTOVF_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_OVFCNTOVF_MASK) - -#define ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_MISPKTCNT_MASK (0x7FF0000U) -#define ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_MISPKTCNT_SHIFT (16U) -/*! MISPKTCNT - Missed Packet Counter */ -#define ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_MISPKTCNT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_MISPKTCNT_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_MISPKTCNT_MASK) - -#define ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_MISCNTOVF_MASK (0x8000000U) -#define ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_MISCNTOVF_SHIFT (27U) -/*! MISCNTOVF - Missed Packet Counter Overflow Bit - * 0b1..Missed Packet Counter overflow detected - * 0b0..Missed Packet Counter overflow not detected - */ -#define ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_MISCNTOVF(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_MISCNTOVF_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_MISCNTOVF_MASK) -/*! @} */ - -/* The count of ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT */ -#define ENET_MTL_QUEUE_MTL_RXQX_MISSPKT_OVRFLW_CNT_COUNT (2U) - -/*! @name MTL_QUEUE_MTL_RXQX_DBG - Queue 0 Receive Debug..Queue 1 Receive Debug */ -/*! @{ */ - -#define ENET_MTL_QUEUE_MTL_RXQX_DBG_RWCSTS_MASK (0x1U) -#define ENET_MTL_QUEUE_MTL_RXQX_DBG_RWCSTS_SHIFT (0U) -/*! RWCSTS - MTL Rx Queue Write Controller Active Status - * 0b1..MTL Rx Queue Write Controller Active Status detected - * 0b0..MTL Rx Queue Write Controller Active Status not detected - */ -#define ENET_MTL_QUEUE_MTL_RXQX_DBG_RWCSTS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_DBG_RWCSTS_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_DBG_RWCSTS_MASK) - -#define ENET_MTL_QUEUE_MTL_RXQX_DBG_RRCSTS_MASK (0x6U) -#define ENET_MTL_QUEUE_MTL_RXQX_DBG_RRCSTS_SHIFT (1U) -/*! RRCSTS - MTL Rx Queue Read Controller State - * 0b11..Flushing the packet data and status - * 0b00..Idle state - * 0b01..Reading packet data - * 0b10..Reading packet status (or timestamp) - */ -#define ENET_MTL_QUEUE_MTL_RXQX_DBG_RRCSTS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_DBG_RRCSTS_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_DBG_RRCSTS_MASK) - -#define ENET_MTL_QUEUE_MTL_RXQX_DBG_RXQSTS_MASK (0x30U) -#define ENET_MTL_QUEUE_MTL_RXQX_DBG_RXQSTS_SHIFT (4U) -/*! RXQSTS - MTL Rx Queue Fill-Level Status - * 0b10..Rx Queue fill-level above flow-control activate threshold - * 0b01..Rx Queue fill-level below flow-control deactivate threshold - * 0b00..Rx Queue empty - * 0b11..Rx Queue full - */ -#define ENET_MTL_QUEUE_MTL_RXQX_DBG_RXQSTS(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_DBG_RXQSTS_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_DBG_RXQSTS_MASK) - -#define ENET_MTL_QUEUE_MTL_RXQX_DBG_PRXQ_MASK (0x3FFF0000U) -#define ENET_MTL_QUEUE_MTL_RXQX_DBG_PRXQ_SHIFT (16U) -/*! PRXQ - Number of Packets in Receive Queue */ -#define ENET_MTL_QUEUE_MTL_RXQX_DBG_PRXQ(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_DBG_PRXQ_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_DBG_PRXQ_MASK) -/*! @} */ - -/* The count of ENET_MTL_QUEUE_MTL_RXQX_DBG */ -#define ENET_MTL_QUEUE_MTL_RXQX_DBG_COUNT (2U) - -/*! @name MTL_QUEUE_MTL_RXQX_CTRL - Queue 0 Receive Control..Queue 1 Receive Control */ -/*! @{ */ - -#define ENET_MTL_QUEUE_MTL_RXQX_CTRL_RXQ_WEGT_MASK (0x7U) -#define ENET_MTL_QUEUE_MTL_RXQX_CTRL_RXQ_WEGT_SHIFT (0U) -/*! RXQ_WEGT - Receive Queue Weight */ -#define ENET_MTL_QUEUE_MTL_RXQX_CTRL_RXQ_WEGT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_CTRL_RXQ_WEGT_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_CTRL_RXQ_WEGT_MASK) - -#define ENET_MTL_QUEUE_MTL_RXQX_CTRL_RXQ_FRM_ARBIT_MASK (0x8U) -#define ENET_MTL_QUEUE_MTL_RXQX_CTRL_RXQ_FRM_ARBIT_SHIFT (3U) -/*! RXQ_FRM_ARBIT - Receive Queue Packet Arbitration - * 0b0..Receive Queue Packet Arbitration is disabled - * 0b1..Receive Queue Packet Arbitration is enabled - */ -#define ENET_MTL_QUEUE_MTL_RXQX_CTRL_RXQ_FRM_ARBIT(x) (((uint32_t)(((uint32_t)(x)) << ENET_MTL_QUEUE_MTL_RXQX_CTRL_RXQ_FRM_ARBIT_SHIFT)) & ENET_MTL_QUEUE_MTL_RXQX_CTRL_RXQ_FRM_ARBIT_MASK) -/*! @} */ - -/* The count of ENET_MTL_QUEUE_MTL_RXQX_CTRL */ -#define ENET_MTL_QUEUE_MTL_RXQX_CTRL_COUNT (2U) - -/*! @name DMA_MODE - DMA Bus Mode */ -/*! @{ */ - -#define ENET_DMA_MODE_SWR_MASK (0x1U) -#define ENET_DMA_MODE_SWR_SHIFT (0U) -/*! SWR - Software Reset - * 0b0..Software Reset is disabled - * 0b1..Software Reset is enabled - */ -#define ENET_DMA_MODE_SWR(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_MODE_SWR_SHIFT)) & ENET_DMA_MODE_SWR_MASK) - -#define ENET_DMA_MODE_DA_MASK (0x2U) -#define ENET_DMA_MODE_DA_SHIFT (1U) -/*! DA - DMA Tx or Rx Arbitration Scheme - * 0b1..Fixed Priority - * 0b0..Weighted Round-Robin with Rx:Tx or Tx:Rx - */ -#define ENET_DMA_MODE_DA(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_MODE_DA_SHIFT)) & ENET_DMA_MODE_DA_MASK) - -#define ENET_DMA_MODE_TAA_MASK (0x1CU) -#define ENET_DMA_MODE_TAA_SHIFT (2U) -/*! TAA - Transmit Arbitration Algorithm - * 0b000..Fixed priority - * 0b011..Reserved (for 3'b011 to 3'b111) - * 0b010..Weighted Round-Robin (WRR) - * 0b001..Weighted Strict Priority (WSP) - */ -#define ENET_DMA_MODE_TAA(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_MODE_TAA_SHIFT)) & ENET_DMA_MODE_TAA_MASK) - -#define ENET_DMA_MODE_TXPR_MASK (0x800U) -#define ENET_DMA_MODE_TXPR_SHIFT (11U) -/*! TXPR - Transmit Priority - * 0b0..Transmit Priority is disabled - * 0b1..Transmit Priority is enabled - */ -#define ENET_DMA_MODE_TXPR(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_MODE_TXPR_SHIFT)) & ENET_DMA_MODE_TXPR_MASK) - -#define ENET_DMA_MODE_PR_MASK (0x7000U) -#define ENET_DMA_MODE_PR_SHIFT (12U) -/*! PR - Priority Ratio - * 0b000..The priority ratio is 1:1 - * 0b001..The priority ratio is 2:1 - * 0b010..The priority ratio is 3:1 - * 0b011..The priority ratio is 4:1 - * 0b100..The priority ratio is 5:1 - * 0b101..The priority ratio is 6:1 - * 0b110..The priority ratio is 7:1 - * 0b111..The priority ratio is 8:1 - */ -#define ENET_DMA_MODE_PR(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_MODE_PR_SHIFT)) & ENET_DMA_MODE_PR_MASK) -/*! @} */ - -/*! @name DMA_SYSBUS_MODE - DMA System Bus Mode */ -/*! @{ */ - -#define ENET_DMA_SYSBUS_MODE_FB_MASK (0x1U) -#define ENET_DMA_SYSBUS_MODE_FB_SHIFT (0U) -/*! FB - Fixed Burst Length - * 0b0..Fixed Burst Length is disabled - * 0b1..Fixed Burst Length is enabled - */ -#define ENET_DMA_SYSBUS_MODE_FB(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_SYSBUS_MODE_FB_SHIFT)) & ENET_DMA_SYSBUS_MODE_FB_MASK) - -#define ENET_DMA_SYSBUS_MODE_AAL_MASK (0x1000U) -#define ENET_DMA_SYSBUS_MODE_AAL_SHIFT (12U) -/*! AAL - Address-Aligned Beats - * 0b0..Address-Aligned Beats is disabled - * 0b1..Address-Aligned Beats is enabled - */ -#define ENET_DMA_SYSBUS_MODE_AAL(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_SYSBUS_MODE_AAL_SHIFT)) & ENET_DMA_SYSBUS_MODE_AAL_MASK) - -#define ENET_DMA_SYSBUS_MODE_MB_MASK (0x4000U) -#define ENET_DMA_SYSBUS_MODE_MB_SHIFT (14U) -/*! MB - Mixed Burst - * 0b0..Mixed Burst is disabled - * 0b1..Mixed Burst is enabled - */ -#define ENET_DMA_SYSBUS_MODE_MB(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_SYSBUS_MODE_MB_SHIFT)) & ENET_DMA_SYSBUS_MODE_MB_MASK) - -#define ENET_DMA_SYSBUS_MODE_RB_MASK (0x8000U) -#define ENET_DMA_SYSBUS_MODE_RB_SHIFT (15U) -/*! RB - Rebuild INCRx Burst - * 0b0..Rebuild INCRx Burst is disabled - * 0b1..Rebuild INCRx Burst is enabled - */ -#define ENET_DMA_SYSBUS_MODE_RB(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_SYSBUS_MODE_RB_SHIFT)) & ENET_DMA_SYSBUS_MODE_RB_MASK) -/*! @} */ - -/*! @name DMA_INTERRUPT_STATUS - DMA Interrupt Status */ -/*! @{ */ - -#define ENET_DMA_INTERRUPT_STATUS_DC0IS_MASK (0x1U) -#define ENET_DMA_INTERRUPT_STATUS_DC0IS_SHIFT (0U) -/*! DC0IS - DMA Channel 0 Interrupt Status - * 0b1..DMA Channel 0 Interrupt Status detected - * 0b0..DMA Channel 0 Interrupt Status not detected - */ -#define ENET_DMA_INTERRUPT_STATUS_DC0IS(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_INTERRUPT_STATUS_DC0IS_SHIFT)) & ENET_DMA_INTERRUPT_STATUS_DC0IS_MASK) - -#define ENET_DMA_INTERRUPT_STATUS_DC1IS_MASK (0x2U) -#define ENET_DMA_INTERRUPT_STATUS_DC1IS_SHIFT (1U) -/*! DC1IS - DMA Channel 1 Interrupt Status - * 0b1..DMA Channel 1 Interrupt Status detected - * 0b0..DMA Channel 1 Interrupt Status not detected - */ -#define ENET_DMA_INTERRUPT_STATUS_DC1IS(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_INTERRUPT_STATUS_DC1IS_SHIFT)) & ENET_DMA_INTERRUPT_STATUS_DC1IS_MASK) - -#define ENET_DMA_INTERRUPT_STATUS_MTLIS_MASK (0x10000U) -#define ENET_DMA_INTERRUPT_STATUS_MTLIS_SHIFT (16U) -/*! MTLIS - MTL Interrupt Status - * 0b1..MTL Interrupt Status detected - * 0b0..MTL Interrupt Status not detected - */ -#define ENET_DMA_INTERRUPT_STATUS_MTLIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_INTERRUPT_STATUS_MTLIS_SHIFT)) & ENET_DMA_INTERRUPT_STATUS_MTLIS_MASK) - -#define ENET_DMA_INTERRUPT_STATUS_MACIS_MASK (0x20000U) -#define ENET_DMA_INTERRUPT_STATUS_MACIS_SHIFT (17U) -/*! MACIS - MAC Interrupt Status - * 0b1..MAC Interrupt Status detected - * 0b0..MAC Interrupt Status not detected - */ -#define ENET_DMA_INTERRUPT_STATUS_MACIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_INTERRUPT_STATUS_MACIS_SHIFT)) & ENET_DMA_INTERRUPT_STATUS_MACIS_MASK) -/*! @} */ - -/*! @name DMA_DEBUG_STATUS0 - DMA Debug Status 0 */ -/*! @{ */ - -#define ENET_DMA_DEBUG_STATUS0_AXWHSTS_MASK (0x1U) -#define ENET_DMA_DEBUG_STATUS0_AXWHSTS_SHIFT (0U) -/*! AXWHSTS - AHB Master Status - * 0b1..AXI Master Write Channel or AHB Master Status detected - * 0b0..AXI Master Write Channel or AHB Master Status not detected - */ -#define ENET_DMA_DEBUG_STATUS0_AXWHSTS(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_DEBUG_STATUS0_AXWHSTS_SHIFT)) & ENET_DMA_DEBUG_STATUS0_AXWHSTS_MASK) - -#define ENET_DMA_DEBUG_STATUS0_RPS0_MASK (0xF00U) -#define ENET_DMA_DEBUG_STATUS0_RPS0_SHIFT (8U) -/*! RPS0 - DMA Channel 0 Receive Process State - * 0b0010..Reserved for future use - * 0b0101..Running (Closing the Rx Descriptor) - * 0b0001..Running (Fetching Rx Transfer Descriptor) - * 0b0111..Running (Transferring the received packet data from the Rx buffer to the system memory) - * 0b0011..Running (Waiting for Rx packet) - * 0b0000..Stopped (Reset or Stop Receive Command issued) - * 0b0100..Suspended (Rx Descriptor Unavailable) - * 0b0110..Timestamp write state - */ -#define ENET_DMA_DEBUG_STATUS0_RPS0(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_DEBUG_STATUS0_RPS0_SHIFT)) & ENET_DMA_DEBUG_STATUS0_RPS0_MASK) - -#define ENET_DMA_DEBUG_STATUS0_TPS0_MASK (0xF000U) -#define ENET_DMA_DEBUG_STATUS0_TPS0_SHIFT (12U) -/*! TPS0 - DMA Channel 0 Transmit Process State - * 0b0101..Reserved for future use - * 0b0111..Running (Closing Tx Descriptor) - * 0b0001..Running (Fetching Tx Transfer Descriptor) - * 0b0011..Running (Reading Data from system memory buffer and queuing it to the Tx buffer (Tx FIFO)) - * 0b0010..Running (Waiting for status) - * 0b0000..Stopped (Reset or Stop Transmit Command issued) - * 0b0110..Suspended (Tx Descriptor Unavailable or Tx Buffer Underflow) - * 0b0100..Timestamp write state - */ -#define ENET_DMA_DEBUG_STATUS0_TPS0(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_DEBUG_STATUS0_TPS0_SHIFT)) & ENET_DMA_DEBUG_STATUS0_TPS0_MASK) - -#define ENET_DMA_DEBUG_STATUS0_RPS1_MASK (0xF0000U) -#define ENET_DMA_DEBUG_STATUS0_RPS1_SHIFT (16U) -/*! RPS1 - DMA Channel 1 Receive Process State - * 0b0010..Reserved for future use - * 0b0101..Running (Closing the Rx Descriptor) - * 0b0001..Running (Fetching Rx Transfer Descriptor) - * 0b0111..Running (Transferring the received packet data from the Rx buffer to the system memory) - * 0b0011..Running (Waiting for Rx packet) - * 0b0000..Stopped (Reset or Stop Receive Command issued) - * 0b0100..Suspended (Rx Descriptor Unavailable) - * 0b0110..Timestamp write state - */ -#define ENET_DMA_DEBUG_STATUS0_RPS1(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_DEBUG_STATUS0_RPS1_SHIFT)) & ENET_DMA_DEBUG_STATUS0_RPS1_MASK) - -#define ENET_DMA_DEBUG_STATUS0_TPS1_MASK (0xF00000U) -#define ENET_DMA_DEBUG_STATUS0_TPS1_SHIFT (20U) -/*! TPS1 - DMA Channel 1 Transmit Process State - * 0b0101..Reserved for future use - * 0b0111..Running (Closing Tx Descriptor) - * 0b0001..Running (Fetching Tx Transfer Descriptor) - * 0b0011..Running (Reading Data from system memory buffer and queuing it to the Tx buffer (Tx FIFO)) - * 0b0010..Running (Waiting for status) - * 0b0000..Stopped (Reset or Stop Transmit Command issued) - * 0b0110..Suspended (Tx Descriptor Unavailable or Tx Buffer Underflow) - * 0b0100..Timestamp write state - */ -#define ENET_DMA_DEBUG_STATUS0_TPS1(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_DEBUG_STATUS0_TPS1_SHIFT)) & ENET_DMA_DEBUG_STATUS0_TPS1_MASK) -/*! @} */ - -/*! @name DMA_CH_DMA_CHX_CTRL - DMA Channel 0 Control..DMA Channel 1 Control */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_CTRL_PBLx8_MASK (0x10000U) -#define ENET_DMA_CH_DMA_CHX_CTRL_PBLx8_SHIFT (16U) -/*! PBLx8 - 8xPBL mode - * 0b0..8xPBL mode is disabled - * 0b1..8xPBL mode is enabled - */ -#define ENET_DMA_CH_DMA_CHX_CTRL_PBLx8(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_CTRL_PBLx8_SHIFT)) & ENET_DMA_CH_DMA_CHX_CTRL_PBLx8_MASK) - -#define ENET_DMA_CH_DMA_CHX_CTRL_DSL_MASK (0x1C0000U) -#define ENET_DMA_CH_DMA_CHX_CTRL_DSL_SHIFT (18U) -/*! DSL - Descriptor Skip Length */ -#define ENET_DMA_CH_DMA_CHX_CTRL_DSL(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_CTRL_DSL_SHIFT)) & ENET_DMA_CH_DMA_CHX_CTRL_DSL_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_CTRL */ -#define ENET_DMA_CH_DMA_CHX_CTRL_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_TX_CTRL - DMA Channel 0 Transmit Control..DMA Channel 1 Transmit Control */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_ST_MASK (0x1U) -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_ST_SHIFT (0U) -/*! ST - Start or Stop Transmission Command - * 0b1..Start Transmission Command - * 0b0..Stop Transmission Command - */ -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_ST(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_TX_CTRL_ST_SHIFT)) & ENET_DMA_CH_DMA_CHX_TX_CTRL_ST_MASK) - -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_TCW_MASK (0xEU) -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_TCW_SHIFT (1U) -/*! TCW - Transmit Channel Weight */ -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_TCW(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_TX_CTRL_TCW_SHIFT)) & ENET_DMA_CH_DMA_CHX_TX_CTRL_TCW_MASK) - -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_OSF_MASK (0x10U) -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_OSF_SHIFT (4U) -/*! OSF - Operate on Second Packet - * 0b0..Operate on Second Packet disabled - * 0b1..Operate on Second Packet enabled - */ -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_OSF(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_TX_CTRL_OSF_SHIFT)) & ENET_DMA_CH_DMA_CHX_TX_CTRL_OSF_MASK) - -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_TxPBL_MASK (0x3F0000U) -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_TxPBL_SHIFT (16U) -/*! TxPBL - Transmit Programmable Burst Length */ -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_TxPBL(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_TX_CTRL_TxPBL_SHIFT)) & ENET_DMA_CH_DMA_CHX_TX_CTRL_TxPBL_MASK) - -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_ETIC_MASK (0x400000U) -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_ETIC_SHIFT (22U) -/*! ETIC - Early Transmit Interrupt Control - * 0b0..Early Transmit Interrupt is disabled - * 0b1..Early Transmit Interrupt is enabled - */ -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_ETIC(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_TX_CTRL_ETIC_SHIFT)) & ENET_DMA_CH_DMA_CHX_TX_CTRL_ETIC_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_TX_CTRL */ -#define ENET_DMA_CH_DMA_CHX_TX_CTRL_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_RX_CTRL - DMA Channel 0 Receive Control..DMA Channel 1 Receive Control */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_SR_MASK (0x1U) -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_SR_SHIFT (0U) -/*! SR - Start or Stop Receive - * 0b1..Start Receive - * 0b0..Stop Receive - */ -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_SR(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_RX_CTRL_SR_SHIFT)) & ENET_DMA_CH_DMA_CHX_RX_CTRL_SR_MASK) - -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_RBSZ_X_0_MASK (0x6U) -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_RBSZ_X_0_SHIFT (1U) -/*! RBSZ_X_0 - Receive Buffer size Low */ -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_RBSZ_X_0(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_RX_CTRL_RBSZ_X_0_SHIFT)) & ENET_DMA_CH_DMA_CHX_RX_CTRL_RBSZ_X_0_MASK) - -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_RBSZ_13_Y_MASK (0x7FF8U) -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_RBSZ_13_Y_SHIFT (3U) -/*! RBSZ_13_Y - Receive Buffer size High */ -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_RBSZ_13_Y(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_RX_CTRL_RBSZ_13_Y_SHIFT)) & ENET_DMA_CH_DMA_CHX_RX_CTRL_RBSZ_13_Y_MASK) - -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_RxPBL_MASK (0x3F0000U) -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_RxPBL_SHIFT (16U) -/*! RxPBL - Receive Programmable Burst Length */ -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_RxPBL(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_RX_CTRL_RxPBL_SHIFT)) & ENET_DMA_CH_DMA_CHX_RX_CTRL_RxPBL_MASK) - -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_ERIC_MASK (0x400000U) -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_ERIC_SHIFT (22U) -/*! ERIC - Early Receive Interrupt Control - * 0b0..Early Receive Interrupt is disabled - * 0b1..Early Receive Interrupt is enabled - */ -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_ERIC(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_RX_CTRL_ERIC_SHIFT)) & ENET_DMA_CH_DMA_CHX_RX_CTRL_ERIC_MASK) - -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_RPF_MASK (0x80000000U) -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_RPF_SHIFT (31U) -/*! RPF - Rx Packet Flush. - * 0b0..Rx Packet Flush is disabled - * 0b1..Rx Packet Flush is enabled - */ -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_RPF(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_RX_CTRL_RPF_SHIFT)) & ENET_DMA_CH_DMA_CHX_RX_CTRL_RPF_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_RX_CTRL */ -#define ENET_DMA_CH_DMA_CHX_RX_CTRL_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_TXDESC_LIST_ADDR - Channel 0 Tx Descriptor List Address register..Channel 1 Tx Descriptor List Address */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_TXDESC_LIST_ADDR_TDESLA_MASK (0xFFFFFFFCU) -#define ENET_DMA_CH_DMA_CHX_TXDESC_LIST_ADDR_TDESLA_SHIFT (2U) -/*! TDESLA - Start of Transmit List */ -#define ENET_DMA_CH_DMA_CHX_TXDESC_LIST_ADDR_TDESLA(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_TXDESC_LIST_ADDR_TDESLA_SHIFT)) & ENET_DMA_CH_DMA_CHX_TXDESC_LIST_ADDR_TDESLA_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_TXDESC_LIST_ADDR */ -#define ENET_DMA_CH_DMA_CHX_TXDESC_LIST_ADDR_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_RXDESC_LIST_ADDR - Channel 0 Rx Descriptor List Address register..Channel 1 Rx Descriptor List Address */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_RXDESC_LIST_ADDR_RDESLA_MASK (0xFFFFFFFCU) -#define ENET_DMA_CH_DMA_CHX_RXDESC_LIST_ADDR_RDESLA_SHIFT (2U) -/*! RDESLA - Start of Receive List */ -#define ENET_DMA_CH_DMA_CHX_RXDESC_LIST_ADDR_RDESLA(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_RXDESC_LIST_ADDR_RDESLA_SHIFT)) & ENET_DMA_CH_DMA_CHX_RXDESC_LIST_ADDR_RDESLA_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_RXDESC_LIST_ADDR */ -#define ENET_DMA_CH_DMA_CHX_RXDESC_LIST_ADDR_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_TXDESC_TAIL_PTR - Channel 0 Tx Descriptor Tail Pointer..Channel 1 Tx Descriptor Tail Pointer */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_TXDESC_TAIL_PTR_TDTP_MASK (0xFFFFFFFCU) -#define ENET_DMA_CH_DMA_CHX_TXDESC_TAIL_PTR_TDTP_SHIFT (2U) -/*! TDTP - Transmit Descriptor Tail Pointer */ -#define ENET_DMA_CH_DMA_CHX_TXDESC_TAIL_PTR_TDTP(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_TXDESC_TAIL_PTR_TDTP_SHIFT)) & ENET_DMA_CH_DMA_CHX_TXDESC_TAIL_PTR_TDTP_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_TXDESC_TAIL_PTR */ -#define ENET_DMA_CH_DMA_CHX_TXDESC_TAIL_PTR_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_RXDESC_TAIL_PTR - Channel 0 Rx Descriptor Tail Pointer..Channel 1 Rx Descriptor Tail Pointer */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_RXDESC_TAIL_PTR_RDTP_MASK (0xFFFFFFFCU) -#define ENET_DMA_CH_DMA_CHX_RXDESC_TAIL_PTR_RDTP_SHIFT (2U) -/*! RDTP - Receive Descriptor Tail Pointer */ -#define ENET_DMA_CH_DMA_CHX_RXDESC_TAIL_PTR_RDTP(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_RXDESC_TAIL_PTR_RDTP_SHIFT)) & ENET_DMA_CH_DMA_CHX_RXDESC_TAIL_PTR_RDTP_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_RXDESC_TAIL_PTR */ -#define ENET_DMA_CH_DMA_CHX_RXDESC_TAIL_PTR_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_TXDESC_RING_LENGTH - Channel 0 Tx Descriptor Ring Length..Channel 1 Tx Descriptor Ring Length */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_TXDESC_RING_LENGTH_TDRL_MASK (0x3FFU) -#define ENET_DMA_CH_DMA_CHX_TXDESC_RING_LENGTH_TDRL_SHIFT (0U) -/*! TDRL - Transmit Descriptor Ring Length */ -#define ENET_DMA_CH_DMA_CHX_TXDESC_RING_LENGTH_TDRL(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_TXDESC_RING_LENGTH_TDRL_SHIFT)) & ENET_DMA_CH_DMA_CHX_TXDESC_RING_LENGTH_TDRL_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_TXDESC_RING_LENGTH */ -#define ENET_DMA_CH_DMA_CHX_TXDESC_RING_LENGTH_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_RX_CONTROL2 - Channeli Receive Control..DMA Channel 1 Receive Control */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_RX_CONTROL2_RDRL_MASK (0x3FFU) -#define ENET_DMA_CH_DMA_CHX_RX_CONTROL2_RDRL_SHIFT (0U) -/*! RDRL - Receive Descriptor Ring Length */ -#define ENET_DMA_CH_DMA_CHX_RX_CONTROL2_RDRL(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_RX_CONTROL2_RDRL_SHIFT)) & ENET_DMA_CH_DMA_CHX_RX_CONTROL2_RDRL_MASK) - -#define ENET_DMA_CH_DMA_CHX_RX_CONTROL2_ARBS_MASK (0xFF0000U) -#define ENET_DMA_CH_DMA_CHX_RX_CONTROL2_ARBS_SHIFT (16U) -/*! ARBS - Alternate Receive Buffer Size */ -#define ENET_DMA_CH_DMA_CHX_RX_CONTROL2_ARBS(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_RX_CONTROL2_ARBS_SHIFT)) & ENET_DMA_CH_DMA_CHX_RX_CONTROL2_ARBS_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_RX_CONTROL2 */ -#define ENET_DMA_CH_DMA_CHX_RX_CONTROL2_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_INT_EN - Channeli Interrupt Enable..Channel 1 Interrupt Enable */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_INT_EN_TIE_MASK (0x1U) -#define ENET_DMA_CH_DMA_CHX_INT_EN_TIE_SHIFT (0U) -/*! TIE - Transmit Interrupt Enable - * 0b0..Transmit Interrupt is disabled - * 0b1..Transmit Interrupt is enabled - */ -#define ENET_DMA_CH_DMA_CHX_INT_EN_TIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_INT_EN_TIE_SHIFT)) & ENET_DMA_CH_DMA_CHX_INT_EN_TIE_MASK) - -#define ENET_DMA_CH_DMA_CHX_INT_EN_TXSE_MASK (0x2U) -#define ENET_DMA_CH_DMA_CHX_INT_EN_TXSE_SHIFT (1U) -/*! TXSE - Transmit Stopped Enable - * 0b0..Transmit Stopped is disabled - * 0b1..Transmit Stopped is enabled - */ -#define ENET_DMA_CH_DMA_CHX_INT_EN_TXSE(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_INT_EN_TXSE_SHIFT)) & ENET_DMA_CH_DMA_CHX_INT_EN_TXSE_MASK) - -#define ENET_DMA_CH_DMA_CHX_INT_EN_TBUE_MASK (0x4U) -#define ENET_DMA_CH_DMA_CHX_INT_EN_TBUE_SHIFT (2U) -/*! TBUE - Transmit Buffer Unavailable Enable - * 0b0..Transmit Buffer Unavailable is disabled - * 0b1..Transmit Buffer Unavailable is enabled - */ -#define ENET_DMA_CH_DMA_CHX_INT_EN_TBUE(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_INT_EN_TBUE_SHIFT)) & ENET_DMA_CH_DMA_CHX_INT_EN_TBUE_MASK) - -#define ENET_DMA_CH_DMA_CHX_INT_EN_RIE_MASK (0x40U) -#define ENET_DMA_CH_DMA_CHX_INT_EN_RIE_SHIFT (6U) -/*! RIE - Receive Interrupt Enable - * 0b0..Receive Interrupt is disabled - * 0b1..Receive Interrupt is enabled - */ -#define ENET_DMA_CH_DMA_CHX_INT_EN_RIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_INT_EN_RIE_SHIFT)) & ENET_DMA_CH_DMA_CHX_INT_EN_RIE_MASK) - -#define ENET_DMA_CH_DMA_CHX_INT_EN_RBUE_MASK (0x80U) -#define ENET_DMA_CH_DMA_CHX_INT_EN_RBUE_SHIFT (7U) -/*! RBUE - Receive Buffer Unavailable Enable - * 0b0..Receive Buffer Unavailable is disabled - * 0b1..Receive Buffer Unavailable is enabled - */ -#define ENET_DMA_CH_DMA_CHX_INT_EN_RBUE(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_INT_EN_RBUE_SHIFT)) & ENET_DMA_CH_DMA_CHX_INT_EN_RBUE_MASK) - -#define ENET_DMA_CH_DMA_CHX_INT_EN_RSE_MASK (0x100U) -#define ENET_DMA_CH_DMA_CHX_INT_EN_RSE_SHIFT (8U) -/*! RSE - Receive Stopped Enable - * 0b0..Receive Stopped is disabled - * 0b1..Receive Stopped is enabled - */ -#define ENET_DMA_CH_DMA_CHX_INT_EN_RSE(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_INT_EN_RSE_SHIFT)) & ENET_DMA_CH_DMA_CHX_INT_EN_RSE_MASK) - -#define ENET_DMA_CH_DMA_CHX_INT_EN_RWTE_MASK (0x200U) -#define ENET_DMA_CH_DMA_CHX_INT_EN_RWTE_SHIFT (9U) -/*! RWTE - Receive Watchdog Timeout Enable - * 0b0..Receive Watchdog Timeout is disabled - * 0b1..Receive Watchdog Timeout is enabled - */ -#define ENET_DMA_CH_DMA_CHX_INT_EN_RWTE(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_INT_EN_RWTE_SHIFT)) & ENET_DMA_CH_DMA_CHX_INT_EN_RWTE_MASK) - -#define ENET_DMA_CH_DMA_CHX_INT_EN_ETIE_MASK (0x400U) -#define ENET_DMA_CH_DMA_CHX_INT_EN_ETIE_SHIFT (10U) -/*! ETIE - Early Transmit Interrupt Enable - * 0b0..Early Transmit Interrupt is disabled - * 0b1..Early Transmit Interrupt is enabled - */ -#define ENET_DMA_CH_DMA_CHX_INT_EN_ETIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_INT_EN_ETIE_SHIFT)) & ENET_DMA_CH_DMA_CHX_INT_EN_ETIE_MASK) - -#define ENET_DMA_CH_DMA_CHX_INT_EN_ERIE_MASK (0x800U) -#define ENET_DMA_CH_DMA_CHX_INT_EN_ERIE_SHIFT (11U) -/*! ERIE - Early Receive Interrupt Enable - * 0b0..Early Receive Interrupt is disabled - * 0b1..Early Receive Interrupt is enabled - */ -#define ENET_DMA_CH_DMA_CHX_INT_EN_ERIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_INT_EN_ERIE_SHIFT)) & ENET_DMA_CH_DMA_CHX_INT_EN_ERIE_MASK) - -#define ENET_DMA_CH_DMA_CHX_INT_EN_FBEE_MASK (0x1000U) -#define ENET_DMA_CH_DMA_CHX_INT_EN_FBEE_SHIFT (12U) -/*! FBEE - Fatal Bus Error Enable - * 0b0..Fatal Bus Error is disabled - * 0b1..Fatal Bus Error is enabled - */ -#define ENET_DMA_CH_DMA_CHX_INT_EN_FBEE(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_INT_EN_FBEE_SHIFT)) & ENET_DMA_CH_DMA_CHX_INT_EN_FBEE_MASK) - -#define ENET_DMA_CH_DMA_CHX_INT_EN_CDEE_MASK (0x2000U) -#define ENET_DMA_CH_DMA_CHX_INT_EN_CDEE_SHIFT (13U) -/*! CDEE - Context Descriptor Error Enable - * 0b0..Context Descriptor Error is disabled - * 0b1..Context Descriptor Error is enabled - */ -#define ENET_DMA_CH_DMA_CHX_INT_EN_CDEE(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_INT_EN_CDEE_SHIFT)) & ENET_DMA_CH_DMA_CHX_INT_EN_CDEE_MASK) - -#define ENET_DMA_CH_DMA_CHX_INT_EN_AIE_MASK (0x4000U) -#define ENET_DMA_CH_DMA_CHX_INT_EN_AIE_SHIFT (14U) -/*! AIE - Abnormal Interrupt Summary Enable - * 0b0..Abnormal Interrupt Summary is disabled - * 0b1..Abnormal Interrupt Summary is enabled - */ -#define ENET_DMA_CH_DMA_CHX_INT_EN_AIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_INT_EN_AIE_SHIFT)) & ENET_DMA_CH_DMA_CHX_INT_EN_AIE_MASK) - -#define ENET_DMA_CH_DMA_CHX_INT_EN_NIE_MASK (0x8000U) -#define ENET_DMA_CH_DMA_CHX_INT_EN_NIE_SHIFT (15U) -/*! NIE - Normal Interrupt Summary Enable - * 0b0..Normal Interrupt Summary is disabled - * 0b1..Normal Interrupt Summary is enabled - */ -#define ENET_DMA_CH_DMA_CHX_INT_EN_NIE(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_INT_EN_NIE_SHIFT)) & ENET_DMA_CH_DMA_CHX_INT_EN_NIE_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_INT_EN */ -#define ENET_DMA_CH_DMA_CHX_INT_EN_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_RX_INT_WDTIMER - Channel 0 Receive Interrupt Watchdog Timer..Channel 1 Receive Interrupt Watchdog Timer */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_RX_INT_WDTIMER_RWT_MASK (0xFFU) -#define ENET_DMA_CH_DMA_CHX_RX_INT_WDTIMER_RWT_SHIFT (0U) -/*! RWT - Receive Interrupt Watchdog Timer Count */ -#define ENET_DMA_CH_DMA_CHX_RX_INT_WDTIMER_RWT(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_RX_INT_WDTIMER_RWT_SHIFT)) & ENET_DMA_CH_DMA_CHX_RX_INT_WDTIMER_RWT_MASK) - -#define ENET_DMA_CH_DMA_CHX_RX_INT_WDTIMER_RWTU_MASK (0x30000U) -#define ENET_DMA_CH_DMA_CHX_RX_INT_WDTIMER_RWTU_SHIFT (16U) -/*! RWTU - Receive Interrupt Watchdog Timer Count Units */ -#define ENET_DMA_CH_DMA_CHX_RX_INT_WDTIMER_RWTU(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_RX_INT_WDTIMER_RWTU_SHIFT)) & ENET_DMA_CH_DMA_CHX_RX_INT_WDTIMER_RWTU_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_RX_INT_WDTIMER */ -#define ENET_DMA_CH_DMA_CHX_RX_INT_WDTIMER_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT - Channel 0 Slot Function Control and Status..Channel 1 Slot Function Control and Status */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_ESC_MASK (0x1U) -#define ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_ESC_SHIFT (0U) -/*! ESC - Enable Slot Comparison - * 0b0..Slot Comparison is disabled - * 0b1..Slot Comparison is enabled - */ -#define ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_ESC(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_ESC_SHIFT)) & ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_ESC_MASK) - -#define ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_ASC_MASK (0x2U) -#define ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_ASC_SHIFT (1U) -/*! ASC - Advance Slot Check - * 0b0..Advance Slot Check is disabled - * 0b1..Advance Slot Check is enabled - */ -#define ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_ASC(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_ASC_SHIFT)) & ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_ASC_MASK) - -#define ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_SIV_MASK (0xFFF0U) -#define ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_SIV_SHIFT (4U) -/*! SIV - Slot Interval Value */ -#define ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_SIV(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_SIV_SHIFT)) & ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_SIV_MASK) - -#define ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_RSN_MASK (0xF0000U) -#define ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_RSN_SHIFT (16U) -/*! RSN - Reference Slot Number */ -#define ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_RSN(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_RSN_SHIFT)) & ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_RSN_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT */ -#define ENET_DMA_CH_DMA_CHX_SLOT_FUNC_CTRL_STAT_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_CUR_HST_TXDESC - Channel 0 Current Application Transmit Descriptor..Channel 1 Current Application Transmit Descriptor */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_CUR_HST_TXDESC_CURTDESAPTR_MASK (0xFFFFFFFFU) -#define ENET_DMA_CH_DMA_CHX_CUR_HST_TXDESC_CURTDESAPTR_SHIFT (0U) -/*! CURTDESAPTR - Application Transmit Descriptor Address Pointer */ -#define ENET_DMA_CH_DMA_CHX_CUR_HST_TXDESC_CURTDESAPTR(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_CUR_HST_TXDESC_CURTDESAPTR_SHIFT)) & ENET_DMA_CH_DMA_CHX_CUR_HST_TXDESC_CURTDESAPTR_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_CUR_HST_TXDESC */ -#define ENET_DMA_CH_DMA_CHX_CUR_HST_TXDESC_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_CUR_HST_RXDESC - Channel 0 Current Application Receive Descriptor..Channel 1 Current Application Receive Descriptor */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_CUR_HST_RXDESC_CURRDESAPTR_MASK (0xFFFFFFFFU) -#define ENET_DMA_CH_DMA_CHX_CUR_HST_RXDESC_CURRDESAPTR_SHIFT (0U) -/*! CURRDESAPTR - Application Receive Descriptor Address Pointer */ -#define ENET_DMA_CH_DMA_CHX_CUR_HST_RXDESC_CURRDESAPTR(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_CUR_HST_RXDESC_CURRDESAPTR_SHIFT)) & ENET_DMA_CH_DMA_CHX_CUR_HST_RXDESC_CURRDESAPTR_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_CUR_HST_RXDESC */ -#define ENET_DMA_CH_DMA_CHX_CUR_HST_RXDESC_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_CUR_HST_TXBUF - Channel 0 Current Application Transmit Buffer Address..Channel 1 Current Application Transmit Buffer Address */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_CUR_HST_TXBUF_CURTBUFAPTR_MASK (0xFFFFFFFFU) -#define ENET_DMA_CH_DMA_CHX_CUR_HST_TXBUF_CURTBUFAPTR_SHIFT (0U) -/*! CURTBUFAPTR - Application Transmit Buffer Address Pointer */ -#define ENET_DMA_CH_DMA_CHX_CUR_HST_TXBUF_CURTBUFAPTR(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_CUR_HST_TXBUF_CURTBUFAPTR_SHIFT)) & ENET_DMA_CH_DMA_CHX_CUR_HST_TXBUF_CURTBUFAPTR_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_CUR_HST_TXBUF */ -#define ENET_DMA_CH_DMA_CHX_CUR_HST_TXBUF_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_CUR_HST_RXBUF - Channel 0 Current Application Receive Buffer Address..Channel 1 Current Application Receive Buffer Address */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_CUR_HST_RXBUF_CURRBUFAPTR_MASK (0xFFFFFFFFU) -#define ENET_DMA_CH_DMA_CHX_CUR_HST_RXBUF_CURRBUFAPTR_SHIFT (0U) -/*! CURRBUFAPTR - Application Receive Buffer Address Pointer */ -#define ENET_DMA_CH_DMA_CHX_CUR_HST_RXBUF_CURRBUFAPTR(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_CUR_HST_RXBUF_CURRBUFAPTR_SHIFT)) & ENET_DMA_CH_DMA_CHX_CUR_HST_RXBUF_CURRBUFAPTR_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_CUR_HST_RXBUF */ -#define ENET_DMA_CH_DMA_CHX_CUR_HST_RXBUF_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_STAT - DMA Channel 0 Status..DMA Channel 1 Status */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_STAT_TI_MASK (0x1U) -#define ENET_DMA_CH_DMA_CHX_STAT_TI_SHIFT (0U) -/*! TI - Transmit Interrupt - * 0b1..Transmit Interrupt status detected - * 0b0..Transmit Interrupt status not detected - */ -#define ENET_DMA_CH_DMA_CHX_STAT_TI(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_STAT_TI_SHIFT)) & ENET_DMA_CH_DMA_CHX_STAT_TI_MASK) - -#define ENET_DMA_CH_DMA_CHX_STAT_TPS_MASK (0x2U) -#define ENET_DMA_CH_DMA_CHX_STAT_TPS_SHIFT (1U) -/*! TPS - Transmit Process Stopped - * 0b1..Transmit Process Stopped status detected - * 0b0..Transmit Process Stopped status not detected - */ -#define ENET_DMA_CH_DMA_CHX_STAT_TPS(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_STAT_TPS_SHIFT)) & ENET_DMA_CH_DMA_CHX_STAT_TPS_MASK) - -#define ENET_DMA_CH_DMA_CHX_STAT_TBU_MASK (0x4U) -#define ENET_DMA_CH_DMA_CHX_STAT_TBU_SHIFT (2U) -/*! TBU - Transmit Buffer Unavailable - * 0b1..Transmit Buffer Unavailable status detected - * 0b0..Transmit Buffer Unavailable status not detected - */ -#define ENET_DMA_CH_DMA_CHX_STAT_TBU(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_STAT_TBU_SHIFT)) & ENET_DMA_CH_DMA_CHX_STAT_TBU_MASK) - -#define ENET_DMA_CH_DMA_CHX_STAT_RI_MASK (0x40U) -#define ENET_DMA_CH_DMA_CHX_STAT_RI_SHIFT (6U) -/*! RI - Receive Interrupt - * 0b1..Receive Interrupt status detected - * 0b0..Receive Interrupt status not detected - */ -#define ENET_DMA_CH_DMA_CHX_STAT_RI(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_STAT_RI_SHIFT)) & ENET_DMA_CH_DMA_CHX_STAT_RI_MASK) - -#define ENET_DMA_CH_DMA_CHX_STAT_RBU_MASK (0x80U) -#define ENET_DMA_CH_DMA_CHX_STAT_RBU_SHIFT (7U) -/*! RBU - Receive Buffer Unavailable - * 0b1..Receive Buffer Unavailable status detected - * 0b0..Receive Buffer Unavailable status not detected - */ -#define ENET_DMA_CH_DMA_CHX_STAT_RBU(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_STAT_RBU_SHIFT)) & ENET_DMA_CH_DMA_CHX_STAT_RBU_MASK) - -#define ENET_DMA_CH_DMA_CHX_STAT_RPS_MASK (0x100U) -#define ENET_DMA_CH_DMA_CHX_STAT_RPS_SHIFT (8U) -/*! RPS - Receive Process Stopped - * 0b1..Receive Process Stopped status detected - * 0b0..Receive Process Stopped status not detected - */ -#define ENET_DMA_CH_DMA_CHX_STAT_RPS(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_STAT_RPS_SHIFT)) & ENET_DMA_CH_DMA_CHX_STAT_RPS_MASK) - -#define ENET_DMA_CH_DMA_CHX_STAT_RWT_MASK (0x200U) -#define ENET_DMA_CH_DMA_CHX_STAT_RWT_SHIFT (9U) -/*! RWT - Receive Watchdog Timeout - * 0b1..Receive Watchdog Timeout status detected - * 0b0..Receive Watchdog Timeout status not detected - */ -#define ENET_DMA_CH_DMA_CHX_STAT_RWT(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_STAT_RWT_SHIFT)) & ENET_DMA_CH_DMA_CHX_STAT_RWT_MASK) - -#define ENET_DMA_CH_DMA_CHX_STAT_ETI_MASK (0x400U) -#define ENET_DMA_CH_DMA_CHX_STAT_ETI_SHIFT (10U) -/*! ETI - Early Transmit Interrupt - * 0b1..Early Transmit Interrupt status detected - * 0b0..Early Transmit Interrupt status not detected - */ -#define ENET_DMA_CH_DMA_CHX_STAT_ETI(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_STAT_ETI_SHIFT)) & ENET_DMA_CH_DMA_CHX_STAT_ETI_MASK) - -#define ENET_DMA_CH_DMA_CHX_STAT_ERI_MASK (0x800U) -#define ENET_DMA_CH_DMA_CHX_STAT_ERI_SHIFT (11U) -/*! ERI - Early Receive Interrupt - * 0b1..Early Receive Interrupt status detected - * 0b0..Early Receive Interrupt status not detected - */ -#define ENET_DMA_CH_DMA_CHX_STAT_ERI(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_STAT_ERI_SHIFT)) & ENET_DMA_CH_DMA_CHX_STAT_ERI_MASK) - -#define ENET_DMA_CH_DMA_CHX_STAT_FBE_MASK (0x1000U) -#define ENET_DMA_CH_DMA_CHX_STAT_FBE_SHIFT (12U) -/*! FBE - Fatal Bus Error - * 0b1..Fatal Bus Error status detected - * 0b0..Fatal Bus Error status not detected - */ -#define ENET_DMA_CH_DMA_CHX_STAT_FBE(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_STAT_FBE_SHIFT)) & ENET_DMA_CH_DMA_CHX_STAT_FBE_MASK) - -#define ENET_DMA_CH_DMA_CHX_STAT_CDE_MASK (0x2000U) -#define ENET_DMA_CH_DMA_CHX_STAT_CDE_SHIFT (13U) -/*! CDE - Context Descriptor Error - * 0b1..Context Descriptor Error status detected - * 0b0..Context Descriptor Error status not detected - */ -#define ENET_DMA_CH_DMA_CHX_STAT_CDE(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_STAT_CDE_SHIFT)) & ENET_DMA_CH_DMA_CHX_STAT_CDE_MASK) - -#define ENET_DMA_CH_DMA_CHX_STAT_AIS_MASK (0x4000U) -#define ENET_DMA_CH_DMA_CHX_STAT_AIS_SHIFT (14U) -/*! AIS - Abnormal Interrupt Summary - * 0b1..Abnormal Interrupt Summary status detected - * 0b0..Abnormal Interrupt Summary status not detected - */ -#define ENET_DMA_CH_DMA_CHX_STAT_AIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_STAT_AIS_SHIFT)) & ENET_DMA_CH_DMA_CHX_STAT_AIS_MASK) - -#define ENET_DMA_CH_DMA_CHX_STAT_NIS_MASK (0x8000U) -#define ENET_DMA_CH_DMA_CHX_STAT_NIS_SHIFT (15U) -/*! NIS - Normal Interrupt Summary - * 0b1..Normal Interrupt Summary status detected - * 0b0..Normal Interrupt Summary status not detected - */ -#define ENET_DMA_CH_DMA_CHX_STAT_NIS(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_STAT_NIS_SHIFT)) & ENET_DMA_CH_DMA_CHX_STAT_NIS_MASK) - -#define ENET_DMA_CH_DMA_CHX_STAT_TEB_MASK (0x70000U) -#define ENET_DMA_CH_DMA_CHX_STAT_TEB_SHIFT (16U) -/*! TEB - Tx DMA Error Bits */ -#define ENET_DMA_CH_DMA_CHX_STAT_TEB(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_STAT_TEB_SHIFT)) & ENET_DMA_CH_DMA_CHX_STAT_TEB_MASK) - -#define ENET_DMA_CH_DMA_CHX_STAT_REB_MASK (0x380000U) -#define ENET_DMA_CH_DMA_CHX_STAT_REB_SHIFT (19U) -/*! REB - Rx DMA Error Bits */ -#define ENET_DMA_CH_DMA_CHX_STAT_REB(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_STAT_REB_SHIFT)) & ENET_DMA_CH_DMA_CHX_STAT_REB_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_STAT */ -#define ENET_DMA_CH_DMA_CHX_STAT_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_MISS_FRAME_CNT - Channel 0 Missed Frame Counter..Channel 1 Missed Frame Counter */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_MISS_FRAME_CNT_MFC_MASK (0x7FFU) -#define ENET_DMA_CH_DMA_CHX_MISS_FRAME_CNT_MFC_SHIFT (0U) -/*! MFC - Dropped Packet Counters */ -#define ENET_DMA_CH_DMA_CHX_MISS_FRAME_CNT_MFC(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_MISS_FRAME_CNT_MFC_SHIFT)) & ENET_DMA_CH_DMA_CHX_MISS_FRAME_CNT_MFC_MASK) - -#define ENET_DMA_CH_DMA_CHX_MISS_FRAME_CNT_MFCO_MASK (0x8000U) -#define ENET_DMA_CH_DMA_CHX_MISS_FRAME_CNT_MFCO_SHIFT (15U) -/*! MFCO - Overflow status of the MFC Counter - * 0b1..Miss Frame Counter overflow occurred - * 0b0..Miss Frame Counter overflow not occurred - */ -#define ENET_DMA_CH_DMA_CHX_MISS_FRAME_CNT_MFCO(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_MISS_FRAME_CNT_MFCO_SHIFT)) & ENET_DMA_CH_DMA_CHX_MISS_FRAME_CNT_MFCO_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_MISS_FRAME_CNT */ -#define ENET_DMA_CH_DMA_CHX_MISS_FRAME_CNT_COUNT (2U) - -/*! @name DMA_CH_DMA_CHX_RX_ERI_CNT - Channel 0 Receive ERI Counter..Channel 1 Receive ERI Counter */ -/*! @{ */ - -#define ENET_DMA_CH_DMA_CHX_RX_ERI_CNT_ECNT_MASK (0xFFFU) -#define ENET_DMA_CH_DMA_CHX_RX_ERI_CNT_ECNT_SHIFT (0U) -/*! ECNT - ERI Counter */ -#define ENET_DMA_CH_DMA_CHX_RX_ERI_CNT_ECNT(x) (((uint32_t)(((uint32_t)(x)) << ENET_DMA_CH_DMA_CHX_RX_ERI_CNT_ECNT_SHIFT)) & ENET_DMA_CH_DMA_CHX_RX_ERI_CNT_ECNT_MASK) -/*! @} */ - -/* The count of ENET_DMA_CH_DMA_CHX_RX_ERI_CNT */ -#define ENET_DMA_CH_DMA_CHX_RX_ERI_CNT_COUNT (2U) - - -/*! - * @} - */ /* end of group ENET_Register_Masks */ - - -/* ENET - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral ENET0 base address */ - #define ENET0_BASE (0x50100000u) - /** Peripheral ENET0 base address */ - #define ENET0_BASE_NS (0x40100000u) - /** Peripheral ENET0 base pointer */ - #define ENET0 ((ENET_Type *)ENET0_BASE) - /** Peripheral ENET0 base pointer */ - #define ENET0_NS ((ENET_Type *)ENET0_BASE_NS) - /** Array initializer of ENET peripheral base addresses */ - #define ENET_BASE_ADDRS { ENET0_BASE } - /** Array initializer of ENET peripheral base pointers */ - #define ENET_BASE_PTRS { ENET0 } - /** Array initializer of ENET peripheral base addresses */ - #define ENET_BASE_ADDRS_NS { ENET0_BASE_NS } - /** Array initializer of ENET peripheral base pointers */ - #define ENET_BASE_PTRS_NS { ENET0_NS } -#else - /** Peripheral ENET0 base address */ - #define ENET0_BASE (0x40100000u) - /** Peripheral ENET0 base pointer */ - #define ENET0 ((ENET_Type *)ENET0_BASE) - /** Array initializer of ENET peripheral base addresses */ - #define ENET_BASE_ADDRS { ENET0_BASE } - /** Array initializer of ENET peripheral base pointers */ - #define ENET_BASE_PTRS { ENET0 } -#endif -/** Interrupt vectors for the ENET peripheral type */ -#define ENET_IRQS { ETHERNET_IRQn } -#define ENET_PMT_IRQS { ETHERNET_PMT_IRQn } -#define ENET_MACLP_IRQS { ETHERNET_MACLP_IRQn } -/* Backward compatibility */ -#define ENET ENET0 - - -/*! - * @} - */ /* end of group ENET_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- ERM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ERM_Peripheral_Access_Layer ERM Peripheral Access Layer - * @{ - */ - -/** ERM - Register Layout Typedef */ -typedef struct { - __IO uint32_t CR0; /**< ERM Configuration Register 0, offset: 0x0 */ - __IO uint32_t CR1; /**< ERM Configuration Register 1, offset: 0x4 */ - uint8_t RESERVED_0[8]; - __IO uint32_t SR0; /**< ERM Status Register 0, offset: 0x10 */ - __IO uint32_t SR1; /**< ERM Status Register 1, offset: 0x14 */ - uint8_t RESERVED_1[232]; - __I uint32_t EAR0; /**< ERM Memory 0 Error Address Register, offset: 0x100 */ - __I uint32_t SYN0; /**< ERM Memory 0 Syndrome Register, offset: 0x104 */ - __IO uint32_t CORR_ERR_CNT0; /**< ERM Memory 0 Correctable Error Count Register, offset: 0x108 */ - uint8_t RESERVED_2[4]; - __I uint32_t EAR1; /**< ERM Memory 1 Error Address Register, offset: 0x110 */ - __I uint32_t SYN1; /**< ERM Memory 1 Syndrome Register, offset: 0x114 */ - __IO uint32_t CORR_ERR_CNT1; /**< ERM Memory 1 Correctable Error Count Register, offset: 0x118 */ - uint8_t RESERVED_3[4]; - __I uint32_t EAR2; /**< ERM Memory 2 Error Address Register, offset: 0x120 */ - __I uint32_t SYN2; /**< ERM Memory 2 Syndrome Register, offset: 0x124 */ - __IO uint32_t CORR_ERR_CNT2; /**< ERM Memory 2 Correctable Error Count Register, offset: 0x128 */ - uint8_t RESERVED_4[4]; - __I uint32_t EAR3; /**< ERM Memory 3 Error Address Register, offset: 0x130 */ - __I uint32_t SYN3; /**< ERM Memory 3 Syndrome Register, offset: 0x134 */ - __IO uint32_t CORR_ERR_CNT3; /**< ERM Memory 3 Correctable Error Count Register, offset: 0x138 */ - uint8_t RESERVED_5[4]; - __I uint32_t EAR4; /**< ERM Memory 4 Error Address Register, offset: 0x140 */ - __I uint32_t SYN4; /**< ERM Memory 4 Syndrome Register, offset: 0x144 */ - __IO uint32_t CORR_ERR_CNT4; /**< ERM Memory 4 Correctable Error Count Register, offset: 0x148 */ - uint8_t RESERVED_6[4]; - __I uint32_t EAR5; /**< ERM Memory 5 Error Address Register, offset: 0x150 */ - __I uint32_t SYN5; /**< ERM Memory 5 Syndrome Register, offset: 0x154 */ - __IO uint32_t CORR_ERR_CNT5; /**< ERM Memory 5 Correctable Error Count Register, offset: 0x158 */ - uint8_t RESERVED_7[4]; - __I uint32_t EAR6; /**< ERM Memory 6 Error Address Register, offset: 0x160 */ - __I uint32_t SYN6; /**< ERM Memory 6 Syndrome Register, offset: 0x164 */ - __IO uint32_t CORR_ERR_CNT6; /**< ERM Memory 6 Correctable Error Count Register, offset: 0x168 */ - uint8_t RESERVED_8[12]; - __IO uint32_t CORR_ERR_CNT7; /**< ERM Memory 7 Correctable Error Count Register, offset: 0x178 */ - uint8_t RESERVED_9[8]; - __I uint32_t SYN8; /**< ERM Memory 8 Syndrome Register, offset: 0x184 */ - __IO uint32_t CORR_ERR_CNT8; /**< ERM Memory 8 Correctable Error Count Register, offset: 0x188 */ - uint8_t RESERVED_10[12]; - __IO uint32_t CORR_ERR_CNT9; /**< ERM Memory 9 Correctable Error Count Register, offset: 0x198 */ -} ERM_Type; - -/* ---------------------------------------------------------------------------- - -- ERM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ERM_Register_Masks ERM Register Masks - * @{ - */ - -/*! @name CR0 - ERM Configuration Register 0 */ -/*! @{ */ - -#define ERM_CR0_ENCIE7_MASK (0x4U) -#define ERM_CR0_ENCIE7_SHIFT (2U) -/*! ENCIE7 - ENCIE7 - * 0b0..Interrupt notification of Memory 7 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 7 non-correctable error events is enabled. - */ -#define ERM_CR0_ENCIE7(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ENCIE7_SHIFT)) & ERM_CR0_ENCIE7_MASK) - -#define ERM_CR0_ESCIE7_MASK (0x8U) -#define ERM_CR0_ESCIE7_SHIFT (3U) -/*! ESCIE7 - ESCIE7 - * 0b0..Interrupt notification of Memory 7 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 7 single-bit correction events is enabled. - */ -#define ERM_CR0_ESCIE7(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ESCIE7_SHIFT)) & ERM_CR0_ESCIE7_MASK) - -#define ERM_CR0_ENCIE6_MASK (0x40U) -#define ERM_CR0_ENCIE6_SHIFT (6U) -/*! ENCIE6 - ENCIE6 - * 0b0..Interrupt notification of Memory 6 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 6 non-correctable error events is enabled. - */ -#define ERM_CR0_ENCIE6(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ENCIE6_SHIFT)) & ERM_CR0_ENCIE6_MASK) - -#define ERM_CR0_ESCIE6_MASK (0x80U) -#define ERM_CR0_ESCIE6_SHIFT (7U) -/*! ESCIE6 - ESCIE6 - * 0b0..Interrupt notification of Memory 6 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 6 single-bit correction events is enabled. - */ -#define ERM_CR0_ESCIE6(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ESCIE6_SHIFT)) & ERM_CR0_ESCIE6_MASK) - -#define ERM_CR0_ENCIE5_MASK (0x400U) -#define ERM_CR0_ENCIE5_SHIFT (10U) -/*! ENCIE5 - ENCIE5 - * 0b0..Interrupt notification of Memory 5 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 5 non-correctable error events is enabled. - */ -#define ERM_CR0_ENCIE5(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ENCIE5_SHIFT)) & ERM_CR0_ENCIE5_MASK) - -#define ERM_CR0_ESCIE5_MASK (0x800U) -#define ERM_CR0_ESCIE5_SHIFT (11U) -/*! ESCIE5 - ESCIE5 - * 0b0..Interrupt notification of Memory 5 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 5 single-bit correction events is enabled. - */ -#define ERM_CR0_ESCIE5(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ESCIE5_SHIFT)) & ERM_CR0_ESCIE5_MASK) - -#define ERM_CR0_ENCIE4_MASK (0x4000U) -#define ERM_CR0_ENCIE4_SHIFT (14U) -/*! ENCIE4 - ENCIE4 - * 0b0..Interrupt notification of Memory 4 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 4 non-correctable error events is enabled. - */ -#define ERM_CR0_ENCIE4(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ENCIE4_SHIFT)) & ERM_CR0_ENCIE4_MASK) - -#define ERM_CR0_ESCIE4_MASK (0x8000U) -#define ERM_CR0_ESCIE4_SHIFT (15U) -/*! ESCIE4 - ESCIE4 - * 0b0..Interrupt notification of Memory 4 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 4 single-bit correction events is enabled. - */ -#define ERM_CR0_ESCIE4(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ESCIE4_SHIFT)) & ERM_CR0_ESCIE4_MASK) - -#define ERM_CR0_ENCIE3_MASK (0x40000U) -#define ERM_CR0_ENCIE3_SHIFT (18U) -/*! ENCIE3 - ENCIE3 - * 0b0..Interrupt notification of Memory 3 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 3 non-correctable error events is enabled. - */ -#define ERM_CR0_ENCIE3(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ENCIE3_SHIFT)) & ERM_CR0_ENCIE3_MASK) - -#define ERM_CR0_ESCIE3_MASK (0x80000U) -#define ERM_CR0_ESCIE3_SHIFT (19U) -/*! ESCIE3 - ESCIE3 - * 0b0..Interrupt notification of Memory 3 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 3 single-bit correction events is enabled. - */ -#define ERM_CR0_ESCIE3(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ESCIE3_SHIFT)) & ERM_CR0_ESCIE3_MASK) - -#define ERM_CR0_ENCIE2_MASK (0x400000U) -#define ERM_CR0_ENCIE2_SHIFT (22U) -/*! ENCIE2 - ENCIE2 - * 0b0..Interrupt notification of Memory 2 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 2 non-correctable error events is enabled. - */ -#define ERM_CR0_ENCIE2(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ENCIE2_SHIFT)) & ERM_CR0_ENCIE2_MASK) - -#define ERM_CR0_ESCIE2_MASK (0x800000U) -#define ERM_CR0_ESCIE2_SHIFT (23U) -/*! ESCIE2 - ESCIE2 - * 0b0..Interrupt notification of Memory 2 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 2 single-bit correction events is enabled. - */ -#define ERM_CR0_ESCIE2(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ESCIE2_SHIFT)) & ERM_CR0_ESCIE2_MASK) - -#define ERM_CR0_ENCIE1_MASK (0x4000000U) -#define ERM_CR0_ENCIE1_SHIFT (26U) -/*! ENCIE1 - ENCIE1 - * 0b0..Interrupt notification of Memory 1 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 1 non-correctable error events is enabled. - */ -#define ERM_CR0_ENCIE1(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ENCIE1_SHIFT)) & ERM_CR0_ENCIE1_MASK) - -#define ERM_CR0_ESCIE1_MASK (0x8000000U) -#define ERM_CR0_ESCIE1_SHIFT (27U) -/*! ESCIE1 - ESCIE1 - * 0b0..Interrupt notification of Memory 1 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 1 single-bit correction events is enabled. - */ -#define ERM_CR0_ESCIE1(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ESCIE1_SHIFT)) & ERM_CR0_ESCIE1_MASK) - -#define ERM_CR0_ENCIE0_MASK (0x40000000U) -#define ERM_CR0_ENCIE0_SHIFT (30U) -/*! ENCIE0 - ENCIE0 - * 0b0..Interrupt notification of Memory 0 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 0 non-correctable error events is enabled. - */ -#define ERM_CR0_ENCIE0(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ENCIE0_SHIFT)) & ERM_CR0_ENCIE0_MASK) - -#define ERM_CR0_ESCIE0_MASK (0x80000000U) -#define ERM_CR0_ESCIE0_SHIFT (31U) -/*! ESCIE0 - ESCIE0 - * 0b0..Interrupt notification of Memory 0 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 0 single-bit correction events is enabled. - */ -#define ERM_CR0_ESCIE0(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR0_ESCIE0_SHIFT)) & ERM_CR0_ESCIE0_MASK) -/*! @} */ - -/*! @name CR1 - ERM Configuration Register 1 */ -/*! @{ */ - -#define ERM_CR1_ENCIE9_MASK (0x4000000U) -#define ERM_CR1_ENCIE9_SHIFT (26U) -/*! ENCIE9 - ENCIE9 - * 0b0..Interrupt notification of Memory 9 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 9 non-correctable error events is enabled. - */ -#define ERM_CR1_ENCIE9(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR1_ENCIE9_SHIFT)) & ERM_CR1_ENCIE9_MASK) - -#define ERM_CR1_ESCIE9_MASK (0x8000000U) -#define ERM_CR1_ESCIE9_SHIFT (27U) -/*! ESCIE9 - ESCIE9 - * 0b0..Interrupt notification of Memory 9 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 9 single-bit correction events is enabled. - */ -#define ERM_CR1_ESCIE9(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR1_ESCIE9_SHIFT)) & ERM_CR1_ESCIE9_MASK) - -#define ERM_CR1_ENCIE8_MASK (0x40000000U) -#define ERM_CR1_ENCIE8_SHIFT (30U) -/*! ENCIE8 - ENCIE8 - * 0b0..Interrupt notification of Memory 8 non-correctable error events is disabled. - * 0b1..Interrupt notification of Memory 8 non-correctable error events is enabled. - */ -#define ERM_CR1_ENCIE8(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR1_ENCIE8_SHIFT)) & ERM_CR1_ENCIE8_MASK) - -#define ERM_CR1_ESCIE8_MASK (0x80000000U) -#define ERM_CR1_ESCIE8_SHIFT (31U) -/*! ESCIE8 - ESCIE8 - * 0b0..Interrupt notification of Memory 8 single-bit correction events is disabled. - * 0b1..Interrupt notification of Memory 8 single-bit correction events is enabled. - */ -#define ERM_CR1_ESCIE8(x) (((uint32_t)(((uint32_t)(x)) << ERM_CR1_ESCIE8_SHIFT)) & ERM_CR1_ESCIE8_MASK) -/*! @} */ - -/*! @name SR0 - ERM Status Register 0 */ -/*! @{ */ - -#define ERM_SR0_NCE7_MASK (0x4U) -#define ERM_SR0_NCE7_SHIFT (2U) -/*! NCE7 - NCE7 - * 0b0..No non-correctable error event on Memory 7 detected. - * 0b1..Non-correctable error event on Memory 7 detected. - */ -#define ERM_SR0_NCE7(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_NCE7_SHIFT)) & ERM_SR0_NCE7_MASK) - -#define ERM_SR0_SBC7_MASK (0x8U) -#define ERM_SR0_SBC7_SHIFT (3U) -/*! SBC7 - SBC7 - * 0b0..No single-bit correction event on Memory 7 detected. - * 0b1..Single-bit correction event on Memory 7 detected. - */ -#define ERM_SR0_SBC7(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_SBC7_SHIFT)) & ERM_SR0_SBC7_MASK) - -#define ERM_SR0_NCE6_MASK (0x40U) -#define ERM_SR0_NCE6_SHIFT (6U) -/*! NCE6 - NCE6 - * 0b0..No non-correctable error event on Memory 6 detected. - * 0b1..Non-correctable error event on Memory 6 detected. - */ -#define ERM_SR0_NCE6(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_NCE6_SHIFT)) & ERM_SR0_NCE6_MASK) - -#define ERM_SR0_SBC6_MASK (0x80U) -#define ERM_SR0_SBC6_SHIFT (7U) -/*! SBC6 - SBC6 - * 0b0..No single-bit correction event on Memory 6 detected. - * 0b1..Single-bit correction event on Memory 6 detected. - */ -#define ERM_SR0_SBC6(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_SBC6_SHIFT)) & ERM_SR0_SBC6_MASK) - -#define ERM_SR0_NCE5_MASK (0x400U) -#define ERM_SR0_NCE5_SHIFT (10U) -/*! NCE5 - NCE5 - * 0b0..No non-correctable error event on Memory 5 detected. - * 0b1..Non-correctable error event on Memory 5 detected. - */ -#define ERM_SR0_NCE5(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_NCE5_SHIFT)) & ERM_SR0_NCE5_MASK) - -#define ERM_SR0_SBC5_MASK (0x800U) -#define ERM_SR0_SBC5_SHIFT (11U) -/*! SBC5 - SBC5 - * 0b0..No single-bit correction event on Memory 5 detected. - * 0b1..Single-bit correction event on Memory 5 detected. - */ -#define ERM_SR0_SBC5(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_SBC5_SHIFT)) & ERM_SR0_SBC5_MASK) - -#define ERM_SR0_NCE4_MASK (0x4000U) -#define ERM_SR0_NCE4_SHIFT (14U) -/*! NCE4 - NCE4 - * 0b0..No non-correctable error event on Memory 4 detected. - * 0b1..Non-correctable error event on Memory 4 detected. - */ -#define ERM_SR0_NCE4(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_NCE4_SHIFT)) & ERM_SR0_NCE4_MASK) - -#define ERM_SR0_SBC4_MASK (0x8000U) -#define ERM_SR0_SBC4_SHIFT (15U) -/*! SBC4 - SBC4 - * 0b0..No single-bit correction event on Memory 4 detected. - * 0b1..Single-bit correction event on Memory 4 detected. - */ -#define ERM_SR0_SBC4(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_SBC4_SHIFT)) & ERM_SR0_SBC4_MASK) - -#define ERM_SR0_NCE3_MASK (0x40000U) -#define ERM_SR0_NCE3_SHIFT (18U) -/*! NCE3 - NCE3 - * 0b0..No non-correctable error event on Memory 3 detected. - * 0b1..Non-correctable error event on Memory 3 detected. - */ -#define ERM_SR0_NCE3(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_NCE3_SHIFT)) & ERM_SR0_NCE3_MASK) - -#define ERM_SR0_SBC3_MASK (0x80000U) -#define ERM_SR0_SBC3_SHIFT (19U) -/*! SBC3 - SBC3 - * 0b0..No single-bit correction event on Memory 3 detected. - * 0b1..Single-bit correction event on Memory 3 detected. - */ -#define ERM_SR0_SBC3(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_SBC3_SHIFT)) & ERM_SR0_SBC3_MASK) - -#define ERM_SR0_NCE2_MASK (0x400000U) -#define ERM_SR0_NCE2_SHIFT (22U) -/*! NCE2 - NCE2 - * 0b0..No non-correctable error event on Memory 2 detected. - * 0b1..Non-correctable error event on Memory 2 detected. - */ -#define ERM_SR0_NCE2(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_NCE2_SHIFT)) & ERM_SR0_NCE2_MASK) - -#define ERM_SR0_SBC2_MASK (0x800000U) -#define ERM_SR0_SBC2_SHIFT (23U) -/*! SBC2 - SBC2 - * 0b0..No single-bit correction event on Memory 2 detected. - * 0b1..Single-bit correction event on Memory 2 detected. - */ -#define ERM_SR0_SBC2(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_SBC2_SHIFT)) & ERM_SR0_SBC2_MASK) - -#define ERM_SR0_NCE1_MASK (0x4000000U) -#define ERM_SR0_NCE1_SHIFT (26U) -/*! NCE1 - NCE1 - * 0b0..No non-correctable error event on Memory 1 detected. - * 0b1..Non-correctable error event on Memory 1 detected. - */ -#define ERM_SR0_NCE1(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_NCE1_SHIFT)) & ERM_SR0_NCE1_MASK) - -#define ERM_SR0_SBC1_MASK (0x8000000U) -#define ERM_SR0_SBC1_SHIFT (27U) -/*! SBC1 - SBC1 - * 0b0..No single-bit correction event on Memory 1 detected. - * 0b1..Single-bit correction event on Memory 1 detected. - */ -#define ERM_SR0_SBC1(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_SBC1_SHIFT)) & ERM_SR0_SBC1_MASK) - -#define ERM_SR0_NCE0_MASK (0x40000000U) -#define ERM_SR0_NCE0_SHIFT (30U) -/*! NCE0 - NCE0 - * 0b0..No non-correctable error event on Memory 0 detected. - * 0b1..Non-correctable error event on Memory 0 detected. - */ -#define ERM_SR0_NCE0(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_NCE0_SHIFT)) & ERM_SR0_NCE0_MASK) - -#define ERM_SR0_SBC0_MASK (0x80000000U) -#define ERM_SR0_SBC0_SHIFT (31U) -/*! SBC0 - SBC0 - * 0b0..No single-bit correction event on Memory 0 detected. - * 0b1..Single-bit correction event on Memory 0 detected. - */ -#define ERM_SR0_SBC0(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR0_SBC0_SHIFT)) & ERM_SR0_SBC0_MASK) -/*! @} */ - -/*! @name SR1 - ERM Status Register 1 */ -/*! @{ */ - -#define ERM_SR1_NCE9_MASK (0x4000000U) -#define ERM_SR1_NCE9_SHIFT (26U) -/*! NCE9 - NCE9 - * 0b0..No non-correctable error event on Memory 9 detected. - * 0b1..Non-correctable error event on Memory 9 detected. - */ -#define ERM_SR1_NCE9(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR1_NCE9_SHIFT)) & ERM_SR1_NCE9_MASK) - -#define ERM_SR1_SBC9_MASK (0x8000000U) -#define ERM_SR1_SBC9_SHIFT (27U) -/*! SBC9 - SBC9 - * 0b0..No single-bit correction event on Memory 9 detected. - * 0b1..Single-bit correction event on Memory 9 detected. - */ -#define ERM_SR1_SBC9(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR1_SBC9_SHIFT)) & ERM_SR1_SBC9_MASK) - -#define ERM_SR1_NCE8_MASK (0x40000000U) -#define ERM_SR1_NCE8_SHIFT (30U) -/*! NCE8 - NCE8 - * 0b0..No non-correctable error event on Memory 8 detected. - * 0b1..Non-correctable error event on Memory 8 detected. - */ -#define ERM_SR1_NCE8(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR1_NCE8_SHIFT)) & ERM_SR1_NCE8_MASK) - -#define ERM_SR1_SBC8_MASK (0x80000000U) -#define ERM_SR1_SBC8_SHIFT (31U) -/*! SBC8 - SBC8 - * 0b0..No single-bit correction event on Memory 8 detected. - * 0b1..Single-bit correction event on Memory 8 detected. - */ -#define ERM_SR1_SBC8(x) (((uint32_t)(((uint32_t)(x)) << ERM_SR1_SBC8_SHIFT)) & ERM_SR1_SBC8_MASK) -/*! @} */ - -/*! @name EAR0 - ERM Memory 0 Error Address Register */ -/*! @{ */ - -#define ERM_EAR0_EAR_MASK (0xFFFFFFFFU) -#define ERM_EAR0_EAR_SHIFT (0U) -/*! EAR - EAR */ -#define ERM_EAR0_EAR(x) (((uint32_t)(((uint32_t)(x)) << ERM_EAR0_EAR_SHIFT)) & ERM_EAR0_EAR_MASK) -/*! @} */ - -/*! @name SYN0 - ERM Memory 0 Syndrome Register */ -/*! @{ */ - -#define ERM_SYN0_SYNDROME_MASK (0xFF000000U) -#define ERM_SYN0_SYNDROME_SHIFT (24U) -/*! SYNDROME - SYNDROME */ -#define ERM_SYN0_SYNDROME(x) (((uint32_t)(((uint32_t)(x)) << ERM_SYN0_SYNDROME_SHIFT)) & ERM_SYN0_SYNDROME_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT0 - ERM Memory 0 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT0_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT0_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT0_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT0_COUNT_SHIFT)) & ERM_CORR_ERR_CNT0_COUNT_MASK) -/*! @} */ - -/*! @name EAR1 - ERM Memory 1 Error Address Register */ -/*! @{ */ - -#define ERM_EAR1_EAR_MASK (0xFFFFFFFFU) -#define ERM_EAR1_EAR_SHIFT (0U) -/*! EAR - EAR */ -#define ERM_EAR1_EAR(x) (((uint32_t)(((uint32_t)(x)) << ERM_EAR1_EAR_SHIFT)) & ERM_EAR1_EAR_MASK) -/*! @} */ - -/*! @name SYN1 - ERM Memory 1 Syndrome Register */ -/*! @{ */ - -#define ERM_SYN1_SYNDROME_MASK (0xFF000000U) -#define ERM_SYN1_SYNDROME_SHIFT (24U) -/*! SYNDROME - SYNDROME */ -#define ERM_SYN1_SYNDROME(x) (((uint32_t)(((uint32_t)(x)) << ERM_SYN1_SYNDROME_SHIFT)) & ERM_SYN1_SYNDROME_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT1 - ERM Memory 1 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT1_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT1_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT1_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT1_COUNT_SHIFT)) & ERM_CORR_ERR_CNT1_COUNT_MASK) -/*! @} */ - -/*! @name EAR2 - ERM Memory 2 Error Address Register */ -/*! @{ */ - -#define ERM_EAR2_EAR_MASK (0xFFFFFFFFU) -#define ERM_EAR2_EAR_SHIFT (0U) -/*! EAR - EAR */ -#define ERM_EAR2_EAR(x) (((uint32_t)(((uint32_t)(x)) << ERM_EAR2_EAR_SHIFT)) & ERM_EAR2_EAR_MASK) -/*! @} */ - -/*! @name SYN2 - ERM Memory 2 Syndrome Register */ -/*! @{ */ - -#define ERM_SYN2_SYNDROME_MASK (0xFF000000U) -#define ERM_SYN2_SYNDROME_SHIFT (24U) -/*! SYNDROME - SYNDROME */ -#define ERM_SYN2_SYNDROME(x) (((uint32_t)(((uint32_t)(x)) << ERM_SYN2_SYNDROME_SHIFT)) & ERM_SYN2_SYNDROME_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT2 - ERM Memory 2 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT2_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT2_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT2_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT2_COUNT_SHIFT)) & ERM_CORR_ERR_CNT2_COUNT_MASK) -/*! @} */ - -/*! @name EAR3 - ERM Memory 3 Error Address Register */ -/*! @{ */ - -#define ERM_EAR3_EAR_MASK (0xFFFFFFFFU) -#define ERM_EAR3_EAR_SHIFT (0U) -/*! EAR - EAR */ -#define ERM_EAR3_EAR(x) (((uint32_t)(((uint32_t)(x)) << ERM_EAR3_EAR_SHIFT)) & ERM_EAR3_EAR_MASK) -/*! @} */ - -/*! @name SYN3 - ERM Memory 3 Syndrome Register */ -/*! @{ */ - -#define ERM_SYN3_SYNDROME_MASK (0xFF000000U) -#define ERM_SYN3_SYNDROME_SHIFT (24U) -/*! SYNDROME - SYNDROME */ -#define ERM_SYN3_SYNDROME(x) (((uint32_t)(((uint32_t)(x)) << ERM_SYN3_SYNDROME_SHIFT)) & ERM_SYN3_SYNDROME_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT3 - ERM Memory 3 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT3_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT3_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT3_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT3_COUNT_SHIFT)) & ERM_CORR_ERR_CNT3_COUNT_MASK) -/*! @} */ - -/*! @name EAR4 - ERM Memory 4 Error Address Register */ -/*! @{ */ - -#define ERM_EAR4_EAR_MASK (0xFFFFFFFFU) -#define ERM_EAR4_EAR_SHIFT (0U) -/*! EAR - EAR */ -#define ERM_EAR4_EAR(x) (((uint32_t)(((uint32_t)(x)) << ERM_EAR4_EAR_SHIFT)) & ERM_EAR4_EAR_MASK) -/*! @} */ - -/*! @name SYN4 - ERM Memory 4 Syndrome Register */ -/*! @{ */ - -#define ERM_SYN4_SYNDROME_MASK (0xFF000000U) -#define ERM_SYN4_SYNDROME_SHIFT (24U) -/*! SYNDROME - SYNDROME */ -#define ERM_SYN4_SYNDROME(x) (((uint32_t)(((uint32_t)(x)) << ERM_SYN4_SYNDROME_SHIFT)) & ERM_SYN4_SYNDROME_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT4 - ERM Memory 4 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT4_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT4_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT4_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT4_COUNT_SHIFT)) & ERM_CORR_ERR_CNT4_COUNT_MASK) -/*! @} */ - -/*! @name EAR5 - ERM Memory 5 Error Address Register */ -/*! @{ */ - -#define ERM_EAR5_EAR_MASK (0xFFFFFFFFU) -#define ERM_EAR5_EAR_SHIFT (0U) -/*! EAR - EAR */ -#define ERM_EAR5_EAR(x) (((uint32_t)(((uint32_t)(x)) << ERM_EAR5_EAR_SHIFT)) & ERM_EAR5_EAR_MASK) -/*! @} */ - -/*! @name SYN5 - ERM Memory 5 Syndrome Register */ -/*! @{ */ - -#define ERM_SYN5_SYNDROME_MASK (0xFF000000U) -#define ERM_SYN5_SYNDROME_SHIFT (24U) -/*! SYNDROME - SYNDROME */ -#define ERM_SYN5_SYNDROME(x) (((uint32_t)(((uint32_t)(x)) << ERM_SYN5_SYNDROME_SHIFT)) & ERM_SYN5_SYNDROME_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT5 - ERM Memory 5 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT5_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT5_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT5_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT5_COUNT_SHIFT)) & ERM_CORR_ERR_CNT5_COUNT_MASK) -/*! @} */ - -/*! @name EAR6 - ERM Memory 6 Error Address Register */ -/*! @{ */ - -#define ERM_EAR6_EAR_MASK (0xFFFFFFFFU) -#define ERM_EAR6_EAR_SHIFT (0U) -/*! EAR - EAR */ -#define ERM_EAR6_EAR(x) (((uint32_t)(((uint32_t)(x)) << ERM_EAR6_EAR_SHIFT)) & ERM_EAR6_EAR_MASK) -/*! @} */ - -/*! @name SYN6 - ERM Memory 6 Syndrome Register */ -/*! @{ */ - -#define ERM_SYN6_SYNDROME_MASK (0xFF000000U) -#define ERM_SYN6_SYNDROME_SHIFT (24U) -/*! SYNDROME - SYNDROME */ -#define ERM_SYN6_SYNDROME(x) (((uint32_t)(((uint32_t)(x)) << ERM_SYN6_SYNDROME_SHIFT)) & ERM_SYN6_SYNDROME_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT6 - ERM Memory 6 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT6_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT6_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT6_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT6_COUNT_SHIFT)) & ERM_CORR_ERR_CNT6_COUNT_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT7 - ERM Memory 7 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT7_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT7_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT7_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT7_COUNT_SHIFT)) & ERM_CORR_ERR_CNT7_COUNT_MASK) -/*! @} */ - -/*! @name SYN8 - ERM Memory 8 Syndrome Register */ -/*! @{ */ - -#define ERM_SYN8_SYNDROME_MASK (0xFF000000U) -#define ERM_SYN8_SYNDROME_SHIFT (24U) -/*! SYNDROME - SYNDROME */ -#define ERM_SYN8_SYNDROME(x) (((uint32_t)(((uint32_t)(x)) << ERM_SYN8_SYNDROME_SHIFT)) & ERM_SYN8_SYNDROME_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT8 - ERM Memory 8 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT8_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT8_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT8_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT8_COUNT_SHIFT)) & ERM_CORR_ERR_CNT8_COUNT_MASK) -/*! @} */ - -/*! @name CORR_ERR_CNT9 - ERM Memory 9 Correctable Error Count Register */ -/*! @{ */ - -#define ERM_CORR_ERR_CNT9_COUNT_MASK (0xFFU) -#define ERM_CORR_ERR_CNT9_COUNT_SHIFT (0U) -/*! COUNT - Memory n Correctable Error Count */ -#define ERM_CORR_ERR_CNT9_COUNT(x) (((uint32_t)(((uint32_t)(x)) << ERM_CORR_ERR_CNT9_COUNT_SHIFT)) & ERM_CORR_ERR_CNT9_COUNT_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group ERM_Register_Masks */ - - -/* ERM - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral ERM0 base address */ - #define ERM0_BASE (0x5005C000u) - /** Peripheral ERM0 base address */ - #define ERM0_BASE_NS (0x4005C000u) - /** Peripheral ERM0 base pointer */ - #define ERM0 ((ERM_Type *)ERM0_BASE) - /** Peripheral ERM0 base pointer */ - #define ERM0_NS ((ERM_Type *)ERM0_BASE_NS) - /** Array initializer of ERM peripheral base addresses */ - #define ERM_BASE_ADDRS { ERM0_BASE } - /** Array initializer of ERM peripheral base pointers */ - #define ERM_BASE_PTRS { ERM0 } - /** Array initializer of ERM peripheral base addresses */ - #define ERM_BASE_ADDRS_NS { ERM0_BASE_NS } - /** Array initializer of ERM peripheral base pointers */ - #define ERM_BASE_PTRS_NS { ERM0_NS } -#else - /** Peripheral ERM0 base address */ - #define ERM0_BASE (0x4005C000u) - /** Peripheral ERM0 base pointer */ - #define ERM0 ((ERM_Type *)ERM0_BASE) - /** Array initializer of ERM peripheral base addresses */ - #define ERM_BASE_ADDRS { ERM0_BASE } - /** Array initializer of ERM peripheral base pointers */ - #define ERM_BASE_PTRS { ERM0 } -#endif - -/*! - * @} - */ /* end of group ERM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- EVTG Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup EVTG_Peripheral_Access_Layer EVTG Peripheral Access Layer - * @{ - */ - -/** EVTG - Register Layout Typedef */ -typedef struct { - struct { /* offset: 0x0, array step: 0x10 */ - __IO uint16_t EVTG_AOI0_BFT01; /**< AOI0 Boolean Function Term 0 and 1 Configuration, array offset: 0x0, array step: 0x10 */ - __IO uint16_t EVTG_AOI0_BFT23; /**< AOI0 Boolean Function Term 2 and 3 Configuration, array offset: 0x2, array step: 0x10 */ - __IO uint16_t EVTG_AOI1_BFT01; /**< AOI1 Boolean Function Term 0 and 1 Configuration, array offset: 0x4, array step: 0x10 */ - __IO uint16_t EVTG_AOI1_BFT23; /**< AOI1 Boolean Function Term 2 and 3 Configuration, array offset: 0x6, array step: 0x10 */ - uint8_t RESERVED_0[2]; - __IO uint16_t EVTG_CTRL; /**< Control and Status, array offset: 0xA, array step: 0x10 */ - __IO uint16_t EVTG_AOI0_FILT; /**< AOI0 Output Filter, array offset: 0xC, array step: 0x10 */ - __IO uint16_t EVTG_AOI1_FILT; /**< AOI1 Output Filter, array offset: 0xE, array step: 0x10 */ - } EVTG_INST[4]; -} EVTG_Type; - -/* ---------------------------------------------------------------------------- - -- EVTG Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup EVTG_Register_Masks EVTG Register Masks - * @{ - */ - -/*! @name EVTG_INST_EVTG_AOI0_BFT01 - AOI0 Boolean Function Term 0 and 1 Configuration */ -/*! @{ */ - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_DC_MASK (0x3U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_DC_SHIFT (0U) -/*! PT1_DC - Product Term 1, D Input Configuration - * 0b00..Force the D input in this product term to a logical zero - * 0b01..Pass the D input in this product term - * 0b10..Complement the D input in this product term - * 0b11..Force the D input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_DC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_DC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_DC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_CC_MASK (0xCU) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_CC_SHIFT (2U) -/*! PT1_CC - Product Term 1, C Input Configuration - * 0b00..Force the C input in this product term to a logical zero - * 0b01..Pass the C input in this product term - * 0b10..Complement the C input in this product term - * 0b11..Force the C input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_CC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_CC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_CC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_BC_MASK (0x30U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_BC_SHIFT (4U) -/*! PT1_BC - Product Term 1, B Input Configuration - * 0b00..Force the B input in this product term to a logical zero - * 0b01..Pass the B input in this product term - * 0b10..Complement the B input in this product term - * 0b11..Force the B input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_BC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_BC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_BC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_AC_MASK (0xC0U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_AC_SHIFT (6U) -/*! PT1_AC - Product Term 1, A Input Configuration - * 0b00..Force the A input in this product term to a logical zero - * 0b01..Pass the A input in this product term - * 0b10..Complement the A input in this product term - * 0b11..Force the A input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_AC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_AC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_AC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_DC_MASK (0x300U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_DC_SHIFT (8U) -/*! PT0_DC - Product Term 0, D Input Configuration - * 0b00..Force the D input in this product term to a logical zero - * 0b01..Pass the D input in this product term - * 0b10..Complement the D input in this product term - * 0b11..Force the D input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_DC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_DC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_DC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_CC_MASK (0xC00U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_CC_SHIFT (10U) -/*! PT0_CC - Product Term 0, C Input Configuration - * 0b00..Force the C input in this product term to a logical zero - * 0b01..Pass the C input in this product term - * 0b10..Complement the C input in this product term - * 0b11..Force the C input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_CC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_CC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_CC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_BC_MASK (0x3000U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_BC_SHIFT (12U) -/*! PT0_BC - Product Term 0, B Input Configuration - * 0b00..Force the B input in this product term to a logical zero - * 0b01..Pass the B input in this product term - * 0b10..Complement the B input in this product term - * 0b11..Force the B input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_BC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_BC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_BC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_AC_MASK (0xC000U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_AC_SHIFT (14U) -/*! PT0_AC - Product Term 0, A Input Configuration - * 0b00..Force the A input in this product term to a logical zero - * 0b01..Pass the A input in this product term - * 0b10..Complement the A input in this product term - * 0b11..Force the A input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_AC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_AC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_AC_MASK) -/*! @} */ - -/* The count of EVTG_EVTG_INST_EVTG_AOI0_BFT01 */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT01_COUNT (4U) - -/*! @name EVTG_INST_EVTG_AOI0_BFT23 - AOI0 Boolean Function Term 2 and 3 Configuration */ -/*! @{ */ - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_DC_MASK (0x3U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_DC_SHIFT (0U) -/*! PT3_DC - Product Term 3, D Input Configuration - * 0b00..Force the D input in this product term to a logical zero - * 0b01..Pass the D input in this product term - * 0b10..Complement the D input in this product term - * 0b11..Force the D input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_DC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_DC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_DC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_CC_MASK (0xCU) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_CC_SHIFT (2U) -/*! PT3_CC - Product Term 3, C Input Configuration - * 0b00..Force the C input in this product term to a logical zero - * 0b01..Pass the C input in this product term - * 0b10..Complement the C input in this product term - * 0b11..Force the C input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_CC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_CC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_CC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_BC_MASK (0x30U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_BC_SHIFT (4U) -/*! PT3_BC - Product Term 3, B Input Configuration - * 0b00..Force the B input in this product term to a logical zero - * 0b01..Pass the B input in this product term - * 0b10..Complement the B input in this product term - * 0b11..Force the B input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_BC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_BC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_BC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_AC_MASK (0xC0U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_AC_SHIFT (6U) -/*! PT3_AC - Product Term 3, A Input Configuration - * 0b00..Force the A input in this product term to a logical zero - * 0b01..Pass the A input in this product term - * 0b10..Complement the A input in this product term - * 0b11..Force the A input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_AC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_AC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_AC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_DC_MASK (0x300U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_DC_SHIFT (8U) -/*! PT2_DC - Product Term 2, D Input Configuration - * 0b00..Force the D input in this product term to a logical zero - * 0b01..Pass the D input in this product term - * 0b10..Complement the D input in this product term - * 0b11..Force the D input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_DC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_DC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_DC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_CC_MASK (0xC00U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_CC_SHIFT (10U) -/*! PT2_CC - Product Term 2, C Input Configuration - * 0b00..Force the C input in this product term to a logical zero - * 0b01..Pass the C input in this product term - * 0b10..Complement the C input in this product term - * 0b11..Force the C input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_CC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_CC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_CC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_BC_MASK (0x3000U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_BC_SHIFT (12U) -/*! PT2_BC - Product Term 2, B Input Configuration - * 0b00..Force the B input in this product term to a logical zero - * 0b01..Pass the B input in this product term - * 0b10..Complement the B input in this product term - * 0b11..Force the B input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_BC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_BC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_BC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_AC_MASK (0xC000U) -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_AC_SHIFT (14U) -/*! PT2_AC - Product Term 2, A Input Configuration - * 0b00..Force the A input in this product term to a logical zero - * 0b01..Pass the A input in this product term - * 0b10..Complement the A input in this product term - * 0b11..Force the A input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_AC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_AC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_AC_MASK) -/*! @} */ - -/* The count of EVTG_EVTG_INST_EVTG_AOI0_BFT23 */ -#define EVTG_EVTG_INST_EVTG_AOI0_BFT23_COUNT (4U) - -/*! @name EVTG_INST_EVTG_AOI1_BFT01 - AOI1 Boolean Function Term 0 and 1 Configuration */ -/*! @{ */ - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_DC_MASK (0x3U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_DC_SHIFT (0U) -/*! PT1_DC - Product Term 1, D Input Configuration - * 0b00..Force the D input in this product term to a logical zero - * 0b01..Pass the D input in this product term - * 0b10..Complement the D input in this product term - * 0b11..Force the D input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_DC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_DC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_DC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_CC_MASK (0xCU) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_CC_SHIFT (2U) -/*! PT1_CC - Product Term 1, C Input Configuration - * 0b00..Force the C input in this product term to a logical zero - * 0b01..Pass the C input in this product term - * 0b10..Complement the C input in this product term - * 0b11..Force the C input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_CC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_CC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_CC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_BC_MASK (0x30U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_BC_SHIFT (4U) -/*! PT1_BC - Product Term 1, B Input Configuration - * 0b00..Force the B input in this product term to a logical zero - * 0b01..Pass the B input in this product term - * 0b10..Complement the B input in this product term - * 0b11..Force the B input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_BC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_BC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_BC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_AC_MASK (0xC0U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_AC_SHIFT (6U) -/*! PT1_AC - Product Term 1, A Input Configuration - * 0b00..Force the A input in this product term to a logical zero - * 0b01..Pass the A input in this product term - * 0b10..Complement the A input in this product term - * 0b11..Force the A input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_AC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_AC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_AC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_DC_MASK (0x300U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_DC_SHIFT (8U) -/*! PT0_DC - Product Term 0, D Input Configuration - * 0b00..Force the D input in this product term to a logical zero - * 0b01..Pass the D input in this product term - * 0b10..Complement the D input in this product term - * 0b11..Force the D input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_DC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_DC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_DC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_CC_MASK (0xC00U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_CC_SHIFT (10U) -/*! PT0_CC - Product Term 0, C Input Configuration - * 0b00..Force the C input in this product term to a logical zero - * 0b01..Pass the C input in this product term - * 0b10..Complement the C input in this product term - * 0b11..Force the C input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_CC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_CC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_CC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_BC_MASK (0x3000U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_BC_SHIFT (12U) -/*! PT0_BC - Product Term 0, B Input Configuration - * 0b00..Force the B input in this product term to a logical zero - * 0b01..Pass the B input in this product term - * 0b10..Complement the B input in this product term - * 0b11..Force the B input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_BC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_BC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_BC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_AC_MASK (0xC000U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_AC_SHIFT (14U) -/*! PT0_AC - Product Term 0, A Input Configuration - * 0b00..Force the A input in this product term to a logical zero - * 0b01..Pass the A input in this product term - * 0b10..Complement the A input in this product term - * 0b11..Force the A input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_AC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_AC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_AC_MASK) -/*! @} */ - -/* The count of EVTG_EVTG_INST_EVTG_AOI1_BFT01 */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT01_COUNT (4U) - -/*! @name EVTG_INST_EVTG_AOI1_BFT23 - AOI1 Boolean Function Term 2 and 3 Configuration */ -/*! @{ */ - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_DC_MASK (0x3U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_DC_SHIFT (0U) -/*! PT3_DC - Product Term 3, D Input Configuration - * 0b00..Force the D input in this product term to a logical zero - * 0b01..Pass the D input in this product term - * 0b10..Complement the D input in this product term - * 0b11..Force the D input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_DC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_DC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_DC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_CC_MASK (0xCU) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_CC_SHIFT (2U) -/*! PT3_CC - Product Term 3, C Input Configuration - * 0b00..Force the C input in this product term to a logical zero - * 0b01..Pass the C input in this product term - * 0b10..Complement the C input in this product term - * 0b11..Force the C input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_CC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_CC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_CC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_BC_MASK (0x30U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_BC_SHIFT (4U) -/*! PT3_BC - Product Term 3, B Input Configuration - * 0b00..Force the B input in this product term to a logical zero - * 0b01..Pass the B input in this product term - * 0b10..Complement the B input in this product term - * 0b11..Force the B input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_BC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_BC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_BC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_AC_MASK (0xC0U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_AC_SHIFT (6U) -/*! PT3_AC - Product Term 3, A Input Configuration - * 0b00..Force the A input in this product term to a logical zero - * 0b01..Pass the A input in this product term - * 0b10..Complement the A input in this product term - * 0b11..Force the A input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_AC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_AC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_AC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_DC_MASK (0x300U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_DC_SHIFT (8U) -/*! PT2_DC - Product Term 2, D Input Configuration - * 0b00..Force the D input in this product term to a logical zero - * 0b01..Pass the D input in this product term - * 0b10..Complement the D input in this product term - * 0b11..Force the D input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_DC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_DC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_DC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_CC_MASK (0xC00U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_CC_SHIFT (10U) -/*! PT2_CC - Product Term 2, C Input Configuration - * 0b00..Force the C input in this product term to a logical zero - * 0b01..Pass the C input in this product term - * 0b10..Complement the C input in this product term - * 0b11..Force the C input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_CC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_CC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_CC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_BC_MASK (0x3000U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_BC_SHIFT (12U) -/*! PT2_BC - Product Term 2, B Input Configuration - * 0b00..Force the B input in this product term to a logical zero - * 0b01..Pass the B input in this product term - * 0b10..Complement the B input in this product term - * 0b11..Force the B input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_BC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_BC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_BC_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_AC_MASK (0xC000U) -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_AC_SHIFT (14U) -/*! PT2_AC - Product Term 2, A Input Configuration - * 0b00..Force the A input in this product term to a logical zero - * 0b01..Pass the A input in this product term - * 0b10..Complement the A input in this product term - * 0b11..Force the A input in this product term to a logical one - */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_AC(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_AC_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_AC_MASK) -/*! @} */ - -/* The count of EVTG_EVTG_INST_EVTG_AOI1_BFT23 */ -#define EVTG_EVTG_INST_EVTG_AOI1_BFT23_COUNT (4U) - -/*! @name EVTG_INST_EVTG_CTRL - Control and Status */ -/*! @{ */ - -#define EVTG_EVTG_INST_EVTG_CTRL_FF_INIT_MASK (0x1U) -#define EVTG_EVTG_INST_EVTG_CTRL_FF_INIT_SHIFT (0U) -/*! FF_INIT - Flip flop Initial Value Configuration - * 0b0..0 - * 0b1..1 - */ -#define EVTG_EVTG_INST_EVTG_CTRL_FF_INIT(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_CTRL_FF_INIT_SHIFT)) & EVTG_EVTG_INST_EVTG_CTRL_FF_INIT_MASK) - -#define EVTG_EVTG_INST_EVTG_CTRL_INIT_EN_MASK (0x2U) -#define EVTG_EVTG_INST_EVTG_CTRL_INIT_EN_SHIFT (1U) -/*! INIT_EN - Flip-Flop Initial Output Enable Control - * 0b0..Write 0 does not generate enable pulse - * 0b1..Write 1 generates enable pulse - */ -#define EVTG_EVTG_INST_EVTG_CTRL_INIT_EN(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_CTRL_INIT_EN_SHIFT)) & EVTG_EVTG_INST_EVTG_CTRL_INIT_EN_MASK) - -#define EVTG_EVTG_INST_EVTG_CTRL_MODE_SEL_MASK (0x1CU) -#define EVTG_EVTG_INST_EVTG_CTRL_MODE_SEL_SHIFT (2U) -/*! MODE_SEL - Flip-Flop Mode Selection - * 0b000..Bypass mode - * 0b001..RS Trigger mode - * 0b010..T-FF mode - * 0b011..D-FF mode - * 0b100..JK-FF mode - * 0b101..Latch mode - * 0b110..Reserved - * 0b111..Reserved - */ -#define EVTG_EVTG_INST_EVTG_CTRL_MODE_SEL(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_CTRL_MODE_SEL_SHIFT)) & EVTG_EVTG_INST_EVTG_CTRL_MODE_SEL_MASK) - -#define EVTG_EVTG_INST_EVTG_CTRL_FB_OVRD_MASK (0xC0U) -#define EVTG_EVTG_INST_EVTG_CTRL_FB_OVRD_SHIFT (6U) -/*! FB_OVRD - EVTG Output Feedback Override Control - * 0b00..Replace An - * 0b01..Replace Bn - * 0b10..Replace Cn - * 0b11..Replace Dn - */ -#define EVTG_EVTG_INST_EVTG_CTRL_FB_OVRD(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_CTRL_FB_OVRD_SHIFT)) & EVTG_EVTG_INST_EVTG_CTRL_FB_OVRD_MASK) - -#define EVTG_EVTG_INST_EVTG_CTRL_SYNC_CTRL_MASK (0xF00U) -#define EVTG_EVTG_INST_EVTG_CTRL_SYNC_CTRL_SHIFT (8U) -/*! SYNC_CTRL - Synchronize Control - * 0bxxx1..EVTG input "An" will be synced by two bus clk cycles - * 0bxxx0..EVTG input "An" will not be synced - * 0bxx1x..EVTG input "Bn" will be synced by two bus clk cycles - * 0bxx0x..EVTG input "Bn" will not be synced - * 0bx1xx..EVTG input "Cn" will be synced by two bus clk cycles - * 0bx0xx..EVTG input "Cn" will not be synced - * 0b1xxx..EVTG input "Dn" will be synced by two bus clk cycles - * 0b0xxx..EVTG input "Dn" will not be synced - */ -#define EVTG_EVTG_INST_EVTG_CTRL_SYNC_CTRL(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_CTRL_SYNC_CTRL_SHIFT)) & EVTG_EVTG_INST_EVTG_CTRL_SYNC_CTRL_MASK) - -#define EVTG_EVTG_INST_EVTG_CTRL_FORCE_BYPASS_MASK (0x3000U) -#define EVTG_EVTG_INST_EVTG_CTRL_FORCE_BYPASS_SHIFT (12U) -/*! FORCE_BYPASS - Force Bypass Control - * 0bx1..Whatever MODE_SEL is, will force bypass flip-flop and route the AOI_0(Filter_0) value directly to EVTG_OUTA - * 0bx0..Will not force the bypass - * 0b1x..Whatever MODE_SEL is, will force bypass flip-flop and route the AOI_1(Filter_1) value directly to EVTG_OUTB - * 0b0x..Will not force the bypass - */ -#define EVTG_EVTG_INST_EVTG_CTRL_FORCE_BYPASS(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_CTRL_FORCE_BYPASS_SHIFT)) & EVTG_EVTG_INST_EVTG_CTRL_FORCE_BYPASS_MASK) -/*! @} */ - -/* The count of EVTG_EVTG_INST_EVTG_CTRL */ -#define EVTG_EVTG_INST_EVTG_CTRL_COUNT (4U) - -/*! @name EVTG_INST_EVTG_AOI0_FILT - AOI0 Output Filter */ -/*! @{ */ - -#define EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_PER_MASK (0xFFU) -#define EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_PER_SHIFT (0U) -/*! FILT_PER - Output Filter Sample Period */ -#define EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_PER(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_PER_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_PER_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_CNT_MASK (0x700U) -#define EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_CNT_SHIFT (8U) -/*! FILT_CNT - Output Filter Sample Count */ -#define EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_CNT(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_CNT_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_CNT_MASK) -/*! @} */ - -/* The count of EVTG_EVTG_INST_EVTG_AOI0_FILT */ -#define EVTG_EVTG_INST_EVTG_AOI0_FILT_COUNT (4U) - -/*! @name EVTG_INST_EVTG_AOI1_FILT - AOI1 Output Filter */ -/*! @{ */ - -#define EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_PER_MASK (0xFFU) -#define EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_PER_SHIFT (0U) -/*! FILT_PER - Output Filter Sample Period */ -#define EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_PER(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_PER_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_PER_MASK) - -#define EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_CNT_MASK (0x700U) -#define EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_CNT_SHIFT (8U) -/*! FILT_CNT - Output Filter Sample Count */ -#define EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_CNT(x) (((uint16_t)(((uint16_t)(x)) << EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_CNT_SHIFT)) & EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_CNT_MASK) -/*! @} */ - -/* The count of EVTG_EVTG_INST_EVTG_AOI1_FILT */ -#define EVTG_EVTG_INST_EVTG_AOI1_FILT_COUNT (4U) - - -/*! - * @} - */ /* end of group EVTG_Register_Masks */ - - -/* EVTG - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral EVTG0 base address */ - #define EVTG0_BASE (0x500D2000u) - /** Peripheral EVTG0 base address */ - #define EVTG0_BASE_NS (0x400D2000u) - /** Peripheral EVTG0 base pointer */ - #define EVTG0 ((EVTG_Type *)EVTG0_BASE) - /** Peripheral EVTG0 base pointer */ - #define EVTG0_NS ((EVTG_Type *)EVTG0_BASE_NS) - /** Array initializer of EVTG peripheral base addresses */ - #define EVTG_BASE_ADDRS { EVTG0_BASE } - /** Array initializer of EVTG peripheral base pointers */ - #define EVTG_BASE_PTRS { EVTG0 } - /** Array initializer of EVTG peripheral base addresses */ - #define EVTG_BASE_ADDRS_NS { EVTG0_BASE_NS } - /** Array initializer of EVTG peripheral base pointers */ - #define EVTG_BASE_PTRS_NS { EVTG0_NS } -#else - /** Peripheral EVTG0 base address */ - #define EVTG0_BASE (0x400D2000u) - /** Peripheral EVTG0 base pointer */ - #define EVTG0 ((EVTG_Type *)EVTG0_BASE) - /** Array initializer of EVTG peripheral base addresses */ - #define EVTG_BASE_ADDRS { EVTG0_BASE } - /** Array initializer of EVTG peripheral base pointers */ - #define EVTG_BASE_PTRS { EVTG0 } -#endif - -/*! - * @} - */ /* end of group EVTG_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- EWM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup EWM_Peripheral_Access_Layer EWM Peripheral Access Layer - * @{ - */ - -/** EWM - Register Layout Typedef */ -typedef struct { - __IO uint8_t CTRL; /**< Control, offset: 0x0 */ - __O uint8_t SERV; /**< Service, offset: 0x1 */ - __IO uint8_t CMPL; /**< Compare Low, offset: 0x2 */ - __IO uint8_t CMPH; /**< Compare High, offset: 0x3 */ - __IO uint8_t CLKCTRL; /**< Clock Control, offset: 0x4 */ - __IO uint8_t CLKPRESCALER; /**< Clock Prescaler, offset: 0x5 */ -} EWM_Type; - -/* ---------------------------------------------------------------------------- - -- EWM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup EWM_Register_Masks EWM Register Masks - * @{ - */ - -/*! @name CTRL - Control */ -/*! @{ */ - -#define EWM_CTRL_EWMEN_MASK (0x1U) -#define EWM_CTRL_EWMEN_SHIFT (0U) -/*! EWMEN - EWM Enable - * 0b0..Disables - * 0b1..Enables - */ -#define EWM_CTRL_EWMEN(x) (((uint8_t)(((uint8_t)(x)) << EWM_CTRL_EWMEN_SHIFT)) & EWM_CTRL_EWMEN_MASK) - -#define EWM_CTRL_ASSIN_MASK (0x2U) -#define EWM_CTRL_ASSIN_SHIFT (1U) -/*! ASSIN - Assertion State Select - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define EWM_CTRL_ASSIN(x) (((uint8_t)(((uint8_t)(x)) << EWM_CTRL_ASSIN_SHIFT)) & EWM_CTRL_ASSIN_MASK) - -#define EWM_CTRL_INEN_MASK (0x4U) -#define EWM_CTRL_INEN_SHIFT (2U) -/*! INEN - Input Enable - * 0b0..Disables - * 0b1..Enables - */ -#define EWM_CTRL_INEN(x) (((uint8_t)(((uint8_t)(x)) << EWM_CTRL_INEN_SHIFT)) & EWM_CTRL_INEN_MASK) - -#define EWM_CTRL_INTEN_MASK (0x8U) -#define EWM_CTRL_INTEN_SHIFT (3U) -/*! INTEN - Interrupt Enable - * 0b1..Generates interrupt requests - * 0b0..Deasserts interrupt requests - */ -#define EWM_CTRL_INTEN(x) (((uint8_t)(((uint8_t)(x)) << EWM_CTRL_INTEN_SHIFT)) & EWM_CTRL_INTEN_MASK) -/*! @} */ - -/*! @name SERV - Service */ -/*! @{ */ - -#define EWM_SERV_SERVICE_MASK (0xFFU) -#define EWM_SERV_SERVICE_SHIFT (0U) -/*! SERVICE - Service */ -#define EWM_SERV_SERVICE(x) (((uint8_t)(((uint8_t)(x)) << EWM_SERV_SERVICE_SHIFT)) & EWM_SERV_SERVICE_MASK) -/*! @} */ - -/*! @name CMPL - Compare Low */ -/*! @{ */ - -#define EWM_CMPL_COMPAREL_MASK (0xFFU) -#define EWM_CMPL_COMPAREL_SHIFT (0U) -/*! COMPAREL - Compare Low */ -#define EWM_CMPL_COMPAREL(x) (((uint8_t)(((uint8_t)(x)) << EWM_CMPL_COMPAREL_SHIFT)) & EWM_CMPL_COMPAREL_MASK) -/*! @} */ - -/*! @name CMPH - Compare High */ -/*! @{ */ - -#define EWM_CMPH_COMPAREH_MASK (0xFFU) -#define EWM_CMPH_COMPAREH_SHIFT (0U) -/*! COMPAREH - Compare High */ -#define EWM_CMPH_COMPAREH(x) (((uint8_t)(((uint8_t)(x)) << EWM_CMPH_COMPAREH_SHIFT)) & EWM_CMPH_COMPAREH_MASK) -/*! @} */ - -/*! @name CLKCTRL - Clock Control */ -/*! @{ */ - -#define EWM_CLKCTRL_CLKSEL_MASK (0x3U) -#define EWM_CLKCTRL_CLKSEL_SHIFT (0U) -/*! CLKSEL - Clock Select */ -#define EWM_CLKCTRL_CLKSEL(x) (((uint8_t)(((uint8_t)(x)) << EWM_CLKCTRL_CLKSEL_SHIFT)) & EWM_CLKCTRL_CLKSEL_MASK) -/*! @} */ - -/*! @name CLKPRESCALER - Clock Prescaler */ -/*! @{ */ - -#define EWM_CLKPRESCALER_CLK_DIV_MASK (0xFFU) -#define EWM_CLKPRESCALER_CLK_DIV_SHIFT (0U) -/*! CLK_DIV - Clock Divider */ -#define EWM_CLKPRESCALER_CLK_DIV(x) (((uint8_t)(((uint8_t)(x)) << EWM_CLKPRESCALER_CLK_DIV_SHIFT)) & EWM_CLKPRESCALER_CLK_DIV_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group EWM_Register_Masks */ - - -/* EWM - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral EWM0 base address */ - #define EWM0_BASE (0x500C0000u) - /** Peripheral EWM0 base address */ - #define EWM0_BASE_NS (0x400C0000u) - /** Peripheral EWM0 base pointer */ - #define EWM0 ((EWM_Type *)EWM0_BASE) - /** Peripheral EWM0 base pointer */ - #define EWM0_NS ((EWM_Type *)EWM0_BASE_NS) - /** Array initializer of EWM peripheral base addresses */ - #define EWM_BASE_ADDRS { EWM0_BASE } - /** Array initializer of EWM peripheral base pointers */ - #define EWM_BASE_PTRS { EWM0 } - /** Array initializer of EWM peripheral base addresses */ - #define EWM_BASE_ADDRS_NS { EWM0_BASE_NS } - /** Array initializer of EWM peripheral base pointers */ - #define EWM_BASE_PTRS_NS { EWM0_NS } -#else - /** Peripheral EWM0 base address */ - #define EWM0_BASE (0x400C0000u) - /** Peripheral EWM0 base pointer */ - #define EWM0 ((EWM_Type *)EWM0_BASE) - /** Array initializer of EWM peripheral base addresses */ - #define EWM_BASE_ADDRS { EWM0_BASE } - /** Array initializer of EWM peripheral base pointers */ - #define EWM_BASE_PTRS { EWM0 } -#endif - -/*! - * @} - */ /* end of group EWM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- FLEXIO Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FLEXIO_Peripheral_Access_Layer FLEXIO Peripheral Access Layer - * @{ - */ - -/** FLEXIO - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - __IO uint32_t CTRL; /**< FLEXIO Control, offset: 0x8 */ - __I uint32_t PIN; /**< Pin State, offset: 0xC */ - __IO uint32_t SHIFTSTAT; /**< Shifter Status, offset: 0x10 */ - __IO uint32_t SHIFTERR; /**< Shifter Error, offset: 0x14 */ - __IO uint32_t TIMSTAT; /**< Timer Status Flag, offset: 0x18 */ - uint8_t RESERVED_0[4]; - __IO uint32_t SHIFTSIEN; /**< Shifter Status Interrupt Enable, offset: 0x20 */ - __IO uint32_t SHIFTEIEN; /**< Shifter Error Interrupt Enable, offset: 0x24 */ - __IO uint32_t TIMIEN; /**< Timer Interrupt Enable, offset: 0x28 */ - uint8_t RESERVED_1[4]; - __IO uint32_t SHIFTSDEN; /**< Shifter Status DMA Enable, offset: 0x30 */ - uint8_t RESERVED_2[4]; - __IO uint32_t TIMERSDEN; /**< Timer Status DMA Enable, offset: 0x38 */ - uint8_t RESERVED_3[4]; - __IO uint32_t SHIFTSTATE; /**< Shifter State, offset: 0x40 */ - uint8_t RESERVED_4[4]; - __IO uint32_t TRGSTAT; /**< Trigger Status, offset: 0x48 */ - __IO uint32_t TRIGIEN; /**< External Trigger Interrupt Enable, offset: 0x4C */ - __IO uint32_t PINSTAT; /**< Pin Status, offset: 0x50 */ - __IO uint32_t PINIEN; /**< Pin Interrupt Enable, offset: 0x54 */ - __IO uint32_t PINREN; /**< Pin Rising Edge Enable, offset: 0x58 */ - __IO uint32_t PINFEN; /**< Pin Falling Edge Enable, offset: 0x5C */ - __IO uint32_t PINOUTD; /**< Pin Output Data, offset: 0x60 */ - __IO uint32_t PINOUTE; /**< Pin Output Enable, offset: 0x64 */ - __O uint32_t PINOUTDIS; /**< Pin Output Disable, offset: 0x68 */ - __O uint32_t PINOUTCLR; /**< Pin Output Clear, offset: 0x6C */ - __O uint32_t PINOUTSET; /**< Pin Output Set, offset: 0x70 */ - __O uint32_t PINOUTTOG; /**< Pin Output Toggle, offset: 0x74 */ - uint8_t RESERVED_5[8]; - __IO uint32_t SHIFTCTL[8]; /**< Shifter Control, array offset: 0x80, array step: 0x4 */ - uint8_t RESERVED_6[96]; - __IO uint32_t SHIFTCFG[8]; /**< Shifter Configuration, array offset: 0x100, array step: 0x4 */ - uint8_t RESERVED_7[224]; - __IO uint32_t SHIFTBUF[8]; /**< Shifter Buffer, array offset: 0x200, array step: 0x4 */ - uint8_t RESERVED_8[96]; - __IO uint32_t SHIFTBUFBIS[8]; /**< Shifter Buffer Bit Swapped, array offset: 0x280, array step: 0x4 */ - uint8_t RESERVED_9[96]; - __IO uint32_t SHIFTBUFBYS[8]; /**< Shifter Buffer Byte Swapped, array offset: 0x300, array step: 0x4 */ - uint8_t RESERVED_10[96]; - __IO uint32_t SHIFTBUFBBS[8]; /**< Shifter Buffer Bit Byte Swapped, array offset: 0x380, array step: 0x4 */ - uint8_t RESERVED_11[96]; - __IO uint32_t TIMCTL[8]; /**< Timer Control, array offset: 0x400, array step: 0x4 */ - uint8_t RESERVED_12[96]; - __IO uint32_t TIMCFG[8]; /**< Timer Configuration, array offset: 0x480, array step: 0x4 */ - uint8_t RESERVED_13[96]; - __IO uint32_t TIMCMP[8]; /**< Timer Compare, array offset: 0x500, array step: 0x4 */ - uint8_t RESERVED_14[352]; - __IO uint32_t SHIFTBUFNBS[8]; /**< Shifter Buffer Nibble Byte Swapped, array offset: 0x680, array step: 0x4 */ - uint8_t RESERVED_15[96]; - __IO uint32_t SHIFTBUFHWS[8]; /**< Shifter Buffer Halfword Swapped, array offset: 0x700, array step: 0x4 */ - uint8_t RESERVED_16[96]; - __IO uint32_t SHIFTBUFNIS[8]; /**< Shifter Buffer Nibble Swapped, array offset: 0x780, array step: 0x4 */ - uint8_t RESERVED_17[96]; - __IO uint32_t SHIFTBUFOES[8]; /**< Shifter Buffer Odd Even Swapped, array offset: 0x800, array step: 0x4 */ - uint8_t RESERVED_18[96]; - __IO uint32_t SHIFTBUFEOS[8]; /**< Shifter Buffer Even Odd Swapped, array offset: 0x880, array step: 0x4 */ - uint8_t RESERVED_19[96]; - __IO uint32_t SHIFTBUFHBS[8]; /**< Shifter Buffer Halfword Byte Swapped, array offset: 0x900, array step: 0x4 */ -} FLEXIO_Type; - -/* ---------------------------------------------------------------------------- - -- FLEXIO Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FLEXIO_Register_Masks FLEXIO Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define FLEXIO_VERID_FEATURE_MASK (0xFFFFU) -#define FLEXIO_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Standard features implemented - * 0b0000000000000001..State, logic, and parallel modes supported - * 0b0000000000000010..Pin control registers supported - * 0b0000000000000011..State, logic, and parallel modes, plus pin control registers supported - */ -#define FLEXIO_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_VERID_FEATURE_SHIFT)) & FLEXIO_VERID_FEATURE_MASK) - -#define FLEXIO_VERID_MINOR_MASK (0xFF0000U) -#define FLEXIO_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define FLEXIO_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_VERID_MINOR_SHIFT)) & FLEXIO_VERID_MINOR_MASK) - -#define FLEXIO_VERID_MAJOR_MASK (0xFF000000U) -#define FLEXIO_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define FLEXIO_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_VERID_MAJOR_SHIFT)) & FLEXIO_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define FLEXIO_PARAM_SHIFTER_MASK (0xFFU) -#define FLEXIO_PARAM_SHIFTER_SHIFT (0U) -/*! SHIFTER - Shifter Number */ -#define FLEXIO_PARAM_SHIFTER(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PARAM_SHIFTER_SHIFT)) & FLEXIO_PARAM_SHIFTER_MASK) - -#define FLEXIO_PARAM_TIMER_MASK (0xFF00U) -#define FLEXIO_PARAM_TIMER_SHIFT (8U) -/*! TIMER - Timer Number */ -#define FLEXIO_PARAM_TIMER(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PARAM_TIMER_SHIFT)) & FLEXIO_PARAM_TIMER_MASK) - -#define FLEXIO_PARAM_PIN_MASK (0xFF0000U) -#define FLEXIO_PARAM_PIN_SHIFT (16U) -/*! PIN - Pin Number */ -#define FLEXIO_PARAM_PIN(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PARAM_PIN_SHIFT)) & FLEXIO_PARAM_PIN_MASK) - -#define FLEXIO_PARAM_TRIGGER_MASK (0xFF000000U) -#define FLEXIO_PARAM_TRIGGER_SHIFT (24U) -/*! TRIGGER - Trigger Number */ -#define FLEXIO_PARAM_TRIGGER(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PARAM_TRIGGER_SHIFT)) & FLEXIO_PARAM_TRIGGER_MASK) -/*! @} */ - -/*! @name CTRL - FLEXIO Control */ -/*! @{ */ - -#define FLEXIO_CTRL_FLEXEN_MASK (0x1U) -#define FLEXIO_CTRL_FLEXEN_SHIFT (0U) -/*! FLEXEN - FLEXIO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXIO_CTRL_FLEXEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_CTRL_FLEXEN_SHIFT)) & FLEXIO_CTRL_FLEXEN_MASK) - -#define FLEXIO_CTRL_SWRST_MASK (0x2U) -#define FLEXIO_CTRL_SWRST_SHIFT (1U) -/*! SWRST - Software Reset - * 0b0..Disabled - * 0b1..Enabled - */ -#define FLEXIO_CTRL_SWRST(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_CTRL_SWRST_SHIFT)) & FLEXIO_CTRL_SWRST_MASK) - -#define FLEXIO_CTRL_FASTACC_MASK (0x4U) -#define FLEXIO_CTRL_FASTACC_SHIFT (2U) -/*! FASTACC - Fast Access - * 0b0..Normal - * 0b1..Fast - */ -#define FLEXIO_CTRL_FASTACC(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_CTRL_FASTACC_SHIFT)) & FLEXIO_CTRL_FASTACC_MASK) - -#define FLEXIO_CTRL_DBGE_MASK (0x40000000U) -#define FLEXIO_CTRL_DBGE_SHIFT (30U) -/*! DBGE - Debug Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXIO_CTRL_DBGE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_CTRL_DBGE_SHIFT)) & FLEXIO_CTRL_DBGE_MASK) - -#define FLEXIO_CTRL_DOZEN_MASK (0x80000000U) -#define FLEXIO_CTRL_DOZEN_SHIFT (31U) -/*! DOZEN - Doze Enable - * 0b0..Enable - * 0b1..Disable - */ -#define FLEXIO_CTRL_DOZEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_CTRL_DOZEN_SHIFT)) & FLEXIO_CTRL_DOZEN_MASK) -/*! @} */ - -/*! @name PIN - Pin State */ -/*! @{ */ - -#define FLEXIO_PIN_PDI_MASK (0xFFFFFFFFU) -#define FLEXIO_PIN_PDI_SHIFT (0U) -/*! PDI - Pin Data Input */ -#define FLEXIO_PIN_PDI(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PIN_PDI_SHIFT)) & FLEXIO_PIN_PDI_MASK) -/*! @} */ - -/*! @name SHIFTSTAT - Shifter Status */ -/*! @{ */ - -#define FLEXIO_SHIFTSTAT_SSF_MASK (0xFFU) -#define FLEXIO_SHIFTSTAT_SSF_SHIFT (0U) -/*! SSF - Shifter Status Flag - * 0b00000000..Clear - * 0b00000001..Set - * 0b00000000..No effect - * 0b00000001..Clear the flag - */ -#define FLEXIO_SHIFTSTAT_SSF(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTSTAT_SSF_SHIFT)) & FLEXIO_SHIFTSTAT_SSF_MASK) -/*! @} */ - -/*! @name SHIFTERR - Shifter Error */ -/*! @{ */ - -#define FLEXIO_SHIFTERR_SEF_MASK (0xFFU) -#define FLEXIO_SHIFTERR_SEF_SHIFT (0U) -/*! SEF - Shifter Error Flag - * 0b00000000..Clear - * 0b00000001..Set - * 0b00000000..No effect - * 0b00000001..Clear the flag - */ -#define FLEXIO_SHIFTERR_SEF(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTERR_SEF_SHIFT)) & FLEXIO_SHIFTERR_SEF_MASK) -/*! @} */ - -/*! @name TIMSTAT - Timer Status Flag */ -/*! @{ */ - -#define FLEXIO_TIMSTAT_TSF_MASK (0xFFU) -#define FLEXIO_TIMSTAT_TSF_SHIFT (0U) -/*! TSF - Timer Status Flag - * 0b00000000..Clear - * 0b00000001..Set - * 0b00000000..No effect - * 0b00000001..Clear the flag - */ -#define FLEXIO_TIMSTAT_TSF(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMSTAT_TSF_SHIFT)) & FLEXIO_TIMSTAT_TSF_MASK) -/*! @} */ - -/*! @name SHIFTSIEN - Shifter Status Interrupt Enable */ -/*! @{ */ - -#define FLEXIO_SHIFTSIEN_SSIE_MASK (0xFFU) -#define FLEXIO_SHIFTSIEN_SSIE_SHIFT (0U) -/*! SSIE - Shifter Status Interrupt Enable */ -#define FLEXIO_SHIFTSIEN_SSIE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTSIEN_SSIE_SHIFT)) & FLEXIO_SHIFTSIEN_SSIE_MASK) -/*! @} */ - -/*! @name SHIFTEIEN - Shifter Error Interrupt Enable */ -/*! @{ */ - -#define FLEXIO_SHIFTEIEN_SEIE_MASK (0xFFU) -#define FLEXIO_SHIFTEIEN_SEIE_SHIFT (0U) -/*! SEIE - Shifter Error Interrupt Enable */ -#define FLEXIO_SHIFTEIEN_SEIE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTEIEN_SEIE_SHIFT)) & FLEXIO_SHIFTEIEN_SEIE_MASK) -/*! @} */ - -/*! @name TIMIEN - Timer Interrupt Enable */ -/*! @{ */ - -#define FLEXIO_TIMIEN_TEIE_MASK (0xFFU) -#define FLEXIO_TIMIEN_TEIE_SHIFT (0U) -/*! TEIE - Timer Status Interrupt Enable */ -#define FLEXIO_TIMIEN_TEIE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMIEN_TEIE_SHIFT)) & FLEXIO_TIMIEN_TEIE_MASK) -/*! @} */ - -/*! @name SHIFTSDEN - Shifter Status DMA Enable */ -/*! @{ */ - -#define FLEXIO_SHIFTSDEN_SSDE_MASK (0xFFU) -#define FLEXIO_SHIFTSDEN_SSDE_SHIFT (0U) -/*! SSDE - Shifter Status DMA Enable */ -#define FLEXIO_SHIFTSDEN_SSDE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTSDEN_SSDE_SHIFT)) & FLEXIO_SHIFTSDEN_SSDE_MASK) -/*! @} */ - -/*! @name TIMERSDEN - Timer Status DMA Enable */ -/*! @{ */ - -#define FLEXIO_TIMERSDEN_TSDE_MASK (0xFFU) -#define FLEXIO_TIMERSDEN_TSDE_SHIFT (0U) -/*! TSDE - Timer Status DMA Enable */ -#define FLEXIO_TIMERSDEN_TSDE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMERSDEN_TSDE_SHIFT)) & FLEXIO_TIMERSDEN_TSDE_MASK) -/*! @} */ - -/*! @name SHIFTSTATE - Shifter State */ -/*! @{ */ - -#define FLEXIO_SHIFTSTATE_STATE_MASK (0x7U) -#define FLEXIO_SHIFTSTATE_STATE_SHIFT (0U) -/*! STATE - Current State Pointer */ -#define FLEXIO_SHIFTSTATE_STATE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTSTATE_STATE_SHIFT)) & FLEXIO_SHIFTSTATE_STATE_MASK) -/*! @} */ - -/*! @name TRGSTAT - Trigger Status */ -/*! @{ */ - -#define FLEXIO_TRGSTAT_ETSF_MASK (0xFFU) -#define FLEXIO_TRGSTAT_ETSF_SHIFT (0U) -/*! ETSF - External Trigger Status Flag - * 0b00000000..Clear - * 0b00000001..Set - * 0b00000000..No effect - * 0b00000001..Clear the flag - */ -#define FLEXIO_TRGSTAT_ETSF(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TRGSTAT_ETSF_SHIFT)) & FLEXIO_TRGSTAT_ETSF_MASK) -/*! @} */ - -/*! @name TRIGIEN - External Trigger Interrupt Enable */ -/*! @{ */ - -#define FLEXIO_TRIGIEN_TRIE_MASK (0xFFU) -#define FLEXIO_TRIGIEN_TRIE_SHIFT (0U) -/*! TRIE - External Trigger Interrupt Enable */ -#define FLEXIO_TRIGIEN_TRIE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TRIGIEN_TRIE_SHIFT)) & FLEXIO_TRIGIEN_TRIE_MASK) -/*! @} */ - -/*! @name PINSTAT - Pin Status */ -/*! @{ */ - -#define FLEXIO_PINSTAT_PSF_MASK (0xFFFFFFFFU) -#define FLEXIO_PINSTAT_PSF_SHIFT (0U) -/*! PSF - Pin Status Flag - * 0b00000000000000000000000000000000..Clear - * 0b00000000000000000000000000000001..Set - * 0b00000000000000000000000000000000..No effect - * 0b00000000000000000000000000000001..Clear the flag - */ -#define FLEXIO_PINSTAT_PSF(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINSTAT_PSF_SHIFT)) & FLEXIO_PINSTAT_PSF_MASK) -/*! @} */ - -/*! @name PINIEN - Pin Interrupt Enable */ -/*! @{ */ - -#define FLEXIO_PINIEN_PSIE_MASK (0xFFFFFFFFU) -#define FLEXIO_PINIEN_PSIE_SHIFT (0U) -/*! PSIE - Pin Status Interrupt Enable */ -#define FLEXIO_PINIEN_PSIE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINIEN_PSIE_SHIFT)) & FLEXIO_PINIEN_PSIE_MASK) -/*! @} */ - -/*! @name PINREN - Pin Rising Edge Enable */ -/*! @{ */ - -#define FLEXIO_PINREN_PRE_MASK (0xFFFFFFFFU) -#define FLEXIO_PINREN_PRE_SHIFT (0U) -/*! PRE - Pin Rising Edge */ -#define FLEXIO_PINREN_PRE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINREN_PRE_SHIFT)) & FLEXIO_PINREN_PRE_MASK) -/*! @} */ - -/*! @name PINFEN - Pin Falling Edge Enable */ -/*! @{ */ - -#define FLEXIO_PINFEN_PFE_MASK (0xFFFFFFFFU) -#define FLEXIO_PINFEN_PFE_SHIFT (0U) -/*! PFE - Pin Falling Edge */ -#define FLEXIO_PINFEN_PFE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINFEN_PFE_SHIFT)) & FLEXIO_PINFEN_PFE_MASK) -/*! @} */ - -/*! @name PINOUTD - Pin Output Data */ -/*! @{ */ - -#define FLEXIO_PINOUTD_OUTD_MASK (0xFFFFFFFFU) -#define FLEXIO_PINOUTD_OUTD_SHIFT (0U) -/*! OUTD - Output Data */ -#define FLEXIO_PINOUTD_OUTD(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINOUTD_OUTD_SHIFT)) & FLEXIO_PINOUTD_OUTD_MASK) -/*! @} */ - -/*! @name PINOUTE - Pin Output Enable */ -/*! @{ */ - -#define FLEXIO_PINOUTE_OUTE_MASK (0xFFFFFFFFU) -#define FLEXIO_PINOUTE_OUTE_SHIFT (0U) -/*! OUTE - Output Enable */ -#define FLEXIO_PINOUTE_OUTE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINOUTE_OUTE_SHIFT)) & FLEXIO_PINOUTE_OUTE_MASK) -/*! @} */ - -/*! @name PINOUTDIS - Pin Output Disable */ -/*! @{ */ - -#define FLEXIO_PINOUTDIS_OUTDIS_MASK (0xFFFFFFFFU) -#define FLEXIO_PINOUTDIS_OUTDIS_SHIFT (0U) -/*! OUTDIS - Output Disable */ -#define FLEXIO_PINOUTDIS_OUTDIS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINOUTDIS_OUTDIS_SHIFT)) & FLEXIO_PINOUTDIS_OUTDIS_MASK) -/*! @} */ - -/*! @name PINOUTCLR - Pin Output Clear */ -/*! @{ */ - -#define FLEXIO_PINOUTCLR_OUTCLR_MASK (0xFFFFFFFFU) -#define FLEXIO_PINOUTCLR_OUTCLR_SHIFT (0U) -/*! OUTCLR - Output Clear */ -#define FLEXIO_PINOUTCLR_OUTCLR(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINOUTCLR_OUTCLR_SHIFT)) & FLEXIO_PINOUTCLR_OUTCLR_MASK) -/*! @} */ - -/*! @name PINOUTSET - Pin Output Set */ -/*! @{ */ - -#define FLEXIO_PINOUTSET_OUTSET_MASK (0xFFFFFFFFU) -#define FLEXIO_PINOUTSET_OUTSET_SHIFT (0U) -/*! OUTSET - Output Set */ -#define FLEXIO_PINOUTSET_OUTSET(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINOUTSET_OUTSET_SHIFT)) & FLEXIO_PINOUTSET_OUTSET_MASK) -/*! @} */ - -/*! @name PINOUTTOG - Pin Output Toggle */ -/*! @{ */ - -#define FLEXIO_PINOUTTOG_OUTTOG_MASK (0xFFFFFFFFU) -#define FLEXIO_PINOUTTOG_OUTTOG_SHIFT (0U) -/*! OUTTOG - Output Toggle */ -#define FLEXIO_PINOUTTOG_OUTTOG(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_PINOUTTOG_OUTTOG_SHIFT)) & FLEXIO_PINOUTTOG_OUTTOG_MASK) -/*! @} */ - -/*! @name SHIFTCTL - Shifter Control */ -/*! @{ */ - -#define FLEXIO_SHIFTCTL_SMOD_MASK (0x7U) -#define FLEXIO_SHIFTCTL_SMOD_SHIFT (0U) -/*! SMOD - Shifter Mode - * 0b000..Disable - * 0b001..Receive mode; capture the current shifter content into SHIFTBUF on expiration of the timer - * 0b010..Transmit mode; load SHIFTBUF contents into the shifter on expiration of the timer - * 0b011..Reserved - * 0b100..Match Store mode; shifter data is compared to SHIFTBUF content on expiration of the timer - * 0b101..Match Continuous mode; shifter data is continuously compared to SHIFTBUF contents - * 0b110..State mode; SHIFTBUF contents store programmable state attributes - * 0b111..Logic mode; SHIFTBUF contents implement programmable logic lookup table - */ -#define FLEXIO_SHIFTCTL_SMOD(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCTL_SMOD_SHIFT)) & FLEXIO_SHIFTCTL_SMOD_MASK) - -#define FLEXIO_SHIFTCTL_PINPOL_MASK (0x80U) -#define FLEXIO_SHIFTCTL_PINPOL_SHIFT (7U) -/*! PINPOL - Shifter Pin Polarity - * 0b0..Active high - * 0b1..Active low - */ -#define FLEXIO_SHIFTCTL_PINPOL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCTL_PINPOL_SHIFT)) & FLEXIO_SHIFTCTL_PINPOL_MASK) - -#define FLEXIO_SHIFTCTL_PINSEL_MASK (0x1F00U) -#define FLEXIO_SHIFTCTL_PINSEL_SHIFT (8U) -/*! PINSEL - Shifter Pin Select */ -#define FLEXIO_SHIFTCTL_PINSEL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCTL_PINSEL_SHIFT)) & FLEXIO_SHIFTCTL_PINSEL_MASK) - -#define FLEXIO_SHIFTCTL_PINCFG_MASK (0x30000U) -#define FLEXIO_SHIFTCTL_PINCFG_SHIFT (16U) -/*! PINCFG - Shifter Pin Configuration - * 0b00..Shifter pin output disabled - * 0b01..Shifter pin open-drain or bidirectional output enable - * 0b10..Shifter pin bidirectional output data - * 0b11..Shifter pin output - */ -#define FLEXIO_SHIFTCTL_PINCFG(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCTL_PINCFG_SHIFT)) & FLEXIO_SHIFTCTL_PINCFG_MASK) - -#define FLEXIO_SHIFTCTL_TIMPOL_MASK (0x800000U) -#define FLEXIO_SHIFTCTL_TIMPOL_SHIFT (23U) -/*! TIMPOL - Timer Polarity - * 0b0..Positive edge - * 0b1..Negative edge - */ -#define FLEXIO_SHIFTCTL_TIMPOL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCTL_TIMPOL_SHIFT)) & FLEXIO_SHIFTCTL_TIMPOL_MASK) - -#define FLEXIO_SHIFTCTL_TIMSEL_MASK (0x7000000U) -#define FLEXIO_SHIFTCTL_TIMSEL_SHIFT (24U) -/*! TIMSEL - Timer Select */ -#define FLEXIO_SHIFTCTL_TIMSEL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCTL_TIMSEL_SHIFT)) & FLEXIO_SHIFTCTL_TIMSEL_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTCTL */ -#define FLEXIO_SHIFTCTL_COUNT (8U) - -/*! @name SHIFTCFG - Shifter Configuration */ -/*! @{ */ - -#define FLEXIO_SHIFTCFG_SSTART_MASK (0x3U) -#define FLEXIO_SHIFTCFG_SSTART_SHIFT (0U) -/*! SSTART - Shifter Start - * 0b00..Start bit disabled for Transmitter, Receiver, and Match Store modes; Transmitter mode loads data on enable - * 0b01..Start bit disabled for Transmitter, Receiver, and Match Store modes; Transmitter mode loads data on first shift - * 0b10..Transmitter mode outputs start bit value 0 before loading data on first shift; if start bit is not 0, - * Receiver and Match Store modes set error flag - * 0b11..Transmitter mode outputs start bit value 1 before loading data on first shift; if start bit is not 1, - * Receiver and Match Store modes set error flag - */ -#define FLEXIO_SHIFTCFG_SSTART(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCFG_SSTART_SHIFT)) & FLEXIO_SHIFTCFG_SSTART_MASK) - -#define FLEXIO_SHIFTCFG_SSTOP_MASK (0x30U) -#define FLEXIO_SHIFTCFG_SSTOP_SHIFT (4U) -/*! SSTOP - Shifter Stop - * 0b00..Stop bit disabled for Transmitter, Receiver, and Match Store modes - * 0b01..Stop bit disabled for Transmitter, Receiver, and Match Store modes; when timer is in stop condition, - * Receiver and Match Store modes store receive data on the configured shift edge - * 0b10..Transmitter mode outputs stop bit value 0 in Match Store mode; if stop bit is not 0, Receiver and Match - * Store modes set error flag (when timer is in stop condition, these modes also store receive data on the - * configured shift edge) - * 0b11..Transmitter mode outputs stop bit value 1 in Match Store mode; if stop bit is not 1, Receiver and Match - * Store modes set error flag (when timer is in stop condition, these modes also store receive data on the - * configured shift edge) - */ -#define FLEXIO_SHIFTCFG_SSTOP(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCFG_SSTOP_SHIFT)) & FLEXIO_SHIFTCFG_SSTOP_MASK) - -#define FLEXIO_SHIFTCFG_INSRC_MASK (0x100U) -#define FLEXIO_SHIFTCFG_INSRC_SHIFT (8U) -/*! INSRC - Input Source - * 0b0..Pin - * 0b1..Shifter n+1 output - */ -#define FLEXIO_SHIFTCFG_INSRC(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCFG_INSRC_SHIFT)) & FLEXIO_SHIFTCFG_INSRC_MASK) - -#define FLEXIO_SHIFTCFG_LATST_MASK (0x200U) -#define FLEXIO_SHIFTCFG_LATST_SHIFT (9U) -/*! LATST - Late Store - * 0b0..Store the pre-shift register state - * 0b1..Store the post-shift register state - */ -#define FLEXIO_SHIFTCFG_LATST(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCFG_LATST_SHIFT)) & FLEXIO_SHIFTCFG_LATST_MASK) - -#define FLEXIO_SHIFTCFG_SSIZE_MASK (0x1000U) -#define FLEXIO_SHIFTCFG_SSIZE_SHIFT (12U) -/*! SSIZE - Shifter Size - * 0b0..32-bit - * 0b1..24-bit - */ -#define FLEXIO_SHIFTCFG_SSIZE(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCFG_SSIZE_SHIFT)) & FLEXIO_SHIFTCFG_SSIZE_MASK) - -#define FLEXIO_SHIFTCFG_PWIDTH_MASK (0x1F0000U) -#define FLEXIO_SHIFTCFG_PWIDTH_SHIFT (16U) -/*! PWIDTH - Parallel Width */ -#define FLEXIO_SHIFTCFG_PWIDTH(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTCFG_PWIDTH_SHIFT)) & FLEXIO_SHIFTCFG_PWIDTH_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTCFG */ -#define FLEXIO_SHIFTCFG_COUNT (8U) - -/*! @name SHIFTBUF - Shifter Buffer */ -/*! @{ */ - -#define FLEXIO_SHIFTBUF_SHIFTBUF_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUF_SHIFTBUF_SHIFT (0U) -/*! SHIFTBUF - Shift Buffer */ -#define FLEXIO_SHIFTBUF_SHIFTBUF(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUF_SHIFTBUF_SHIFT)) & FLEXIO_SHIFTBUF_SHIFTBUF_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUF */ -#define FLEXIO_SHIFTBUF_COUNT (8U) - -/*! @name SHIFTBUFBIS - Shifter Buffer Bit Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFBIS_SHIFTBUFBIS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFBIS_SHIFTBUFBIS_SHIFT (0U) -/*! SHIFTBUFBIS - Shift Buffer */ -#define FLEXIO_SHIFTBUFBIS_SHIFTBUFBIS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFBIS_SHIFTBUFBIS_SHIFT)) & FLEXIO_SHIFTBUFBIS_SHIFTBUFBIS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFBIS */ -#define FLEXIO_SHIFTBUFBIS_COUNT (8U) - -/*! @name SHIFTBUFBYS - Shifter Buffer Byte Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFBYS_SHIFTBUFBYS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFBYS_SHIFTBUFBYS_SHIFT (0U) -/*! SHIFTBUFBYS - Shift Buffer */ -#define FLEXIO_SHIFTBUFBYS_SHIFTBUFBYS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFBYS_SHIFTBUFBYS_SHIFT)) & FLEXIO_SHIFTBUFBYS_SHIFTBUFBYS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFBYS */ -#define FLEXIO_SHIFTBUFBYS_COUNT (8U) - -/*! @name SHIFTBUFBBS - Shifter Buffer Bit Byte Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFBBS_SHIFTBUFBBS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFBBS_SHIFTBUFBBS_SHIFT (0U) -/*! SHIFTBUFBBS - Shift Buffer */ -#define FLEXIO_SHIFTBUFBBS_SHIFTBUFBBS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFBBS_SHIFTBUFBBS_SHIFT)) & FLEXIO_SHIFTBUFBBS_SHIFTBUFBBS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFBBS */ -#define FLEXIO_SHIFTBUFBBS_COUNT (8U) - -/*! @name TIMCTL - Timer Control */ -/*! @{ */ - -#define FLEXIO_TIMCTL_TIMOD_MASK (0x7U) -#define FLEXIO_TIMCTL_TIMOD_SHIFT (0U) -/*! TIMOD - Timer Mode - * 0b000..Timer disabled - * 0b001..Dual 8-bit counters baud mode - * 0b010..Dual 8-bit counters PWM high mode - * 0b011..Single 16-bit counter mode - * 0b100..Single 16-bit counter disable mode - * 0b101..Dual 8-bit counters word mode - * 0b110..Dual 8-bit counters PWM low mode - * 0b111..Single 16-bit input capture mode - */ -#define FLEXIO_TIMCTL_TIMOD(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_TIMOD_SHIFT)) & FLEXIO_TIMCTL_TIMOD_MASK) - -#define FLEXIO_TIMCTL_ONETIM_MASK (0x20U) -#define FLEXIO_TIMCTL_ONETIM_SHIFT (5U) -/*! ONETIM - Timer One Time Operation - * 0b0..Generate the timer enable event as normal - * 0b1..Block the timer enable event unless the timer status flag is clear - */ -#define FLEXIO_TIMCTL_ONETIM(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_ONETIM_SHIFT)) & FLEXIO_TIMCTL_ONETIM_MASK) - -#define FLEXIO_TIMCTL_PININS_MASK (0x40U) -#define FLEXIO_TIMCTL_PININS_SHIFT (6U) -/*! PININS - Timer Pin Input Select - * 0b0..PINSEL selects timer pin input and output - * 0b1..PINSEL + 1 selects the timer pin input; timer pin output remains selected by PINSEL - */ -#define FLEXIO_TIMCTL_PININS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_PININS_SHIFT)) & FLEXIO_TIMCTL_PININS_MASK) - -#define FLEXIO_TIMCTL_PINPOL_MASK (0x80U) -#define FLEXIO_TIMCTL_PINPOL_SHIFT (7U) -/*! PINPOL - Timer Pin Polarity - * 0b0..Active high - * 0b1..Active low - */ -#define FLEXIO_TIMCTL_PINPOL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_PINPOL_SHIFT)) & FLEXIO_TIMCTL_PINPOL_MASK) - -#define FLEXIO_TIMCTL_PINSEL_MASK (0x1F00U) -#define FLEXIO_TIMCTL_PINSEL_SHIFT (8U) -/*! PINSEL - Timer Pin Select */ -#define FLEXIO_TIMCTL_PINSEL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_PINSEL_SHIFT)) & FLEXIO_TIMCTL_PINSEL_MASK) - -#define FLEXIO_TIMCTL_PINCFG_MASK (0x30000U) -#define FLEXIO_TIMCTL_PINCFG_SHIFT (16U) -/*! PINCFG - Timer Pin Configuration - * 0b00..Timer pin output disabled - * 0b01..Timer pin open-drain or bidirectional output enable - * 0b10..Timer pin bidirectional output data - * 0b11..Timer pin output - */ -#define FLEXIO_TIMCTL_PINCFG(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_PINCFG_SHIFT)) & FLEXIO_TIMCTL_PINCFG_MASK) - -#define FLEXIO_TIMCTL_TRGSRC_MASK (0x400000U) -#define FLEXIO_TIMCTL_TRGSRC_SHIFT (22U) -/*! TRGSRC - Trigger Source - * 0b0..External - * 0b1..Internal - */ -#define FLEXIO_TIMCTL_TRGSRC(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_TRGSRC_SHIFT)) & FLEXIO_TIMCTL_TRGSRC_MASK) - -#define FLEXIO_TIMCTL_TRGPOL_MASK (0x800000U) -#define FLEXIO_TIMCTL_TRGPOL_SHIFT (23U) -/*! TRGPOL - Trigger Polarity - * 0b0..Active high - * 0b1..Active low - */ -#define FLEXIO_TIMCTL_TRGPOL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_TRGPOL_SHIFT)) & FLEXIO_TIMCTL_TRGPOL_MASK) - -#define FLEXIO_TIMCTL_TRGSEL_MASK (0x3F000000U) -#define FLEXIO_TIMCTL_TRGSEL_SHIFT (24U) -/*! TRGSEL - Trigger Select */ -#define FLEXIO_TIMCTL_TRGSEL(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCTL_TRGSEL_SHIFT)) & FLEXIO_TIMCTL_TRGSEL_MASK) -/*! @} */ - -/* The count of FLEXIO_TIMCTL */ -#define FLEXIO_TIMCTL_COUNT (8U) - -/*! @name TIMCFG - Timer Configuration */ -/*! @{ */ - -#define FLEXIO_TIMCFG_TSTART_MASK (0x2U) -#define FLEXIO_TIMCFG_TSTART_SHIFT (1U) -/*! TSTART - Timer Start - * 0b0..Disabled - * 0b1..Enabled - */ -#define FLEXIO_TIMCFG_TSTART(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TSTART_SHIFT)) & FLEXIO_TIMCFG_TSTART_MASK) - -#define FLEXIO_TIMCFG_TSTOP_MASK (0x30U) -#define FLEXIO_TIMCFG_TSTOP_SHIFT (4U) -/*! TSTOP - Timer Stop - * 0b00..Disabled - * 0b01..Enabled on timer compare - * 0b10..Enabled on timer disable - * 0b11..Enabled on timer compare and timer disable - */ -#define FLEXIO_TIMCFG_TSTOP(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TSTOP_SHIFT)) & FLEXIO_TIMCFG_TSTOP_MASK) - -#define FLEXIO_TIMCFG_TIMENA_MASK (0x700U) -#define FLEXIO_TIMCFG_TIMENA_SHIFT (8U) -/*! TIMENA - Timer Enable - * 0b000..Timer always enabled - * 0b001..Timer enabled on timer n-1 enable - * 0b010..Timer enabled on trigger high - * 0b011..Timer enabled on trigger high and pin high - * 0b100..Timer enabled on pin rising edge - * 0b101..Timer enabled on pin rising edge and trigger high - * 0b110..Timer enabled on trigger rising edge - * 0b111..Timer enabled on trigger rising or falling edge - */ -#define FLEXIO_TIMCFG_TIMENA(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TIMENA_SHIFT)) & FLEXIO_TIMCFG_TIMENA_MASK) - -#define FLEXIO_TIMCFG_TIMDIS_MASK (0x7000U) -#define FLEXIO_TIMCFG_TIMDIS_SHIFT (12U) -/*! TIMDIS - Timer Disable - * 0b000..Timer never disabled - * 0b001..Timer disabled on timer n-1 disable - * 0b010..Timer disabled on timer compare (upper 8 bits match and decrement) - * 0b011..Timer disabled on timer compare (upper 8 bits match and decrement) and trigger low - * 0b100..Timer disabled on pin rising or falling edge - * 0b101..Timer disabled on pin rising or falling edge provided trigger is high - * 0b110..Timer disabled on trigger falling edge - * 0b111..Reserved - */ -#define FLEXIO_TIMCFG_TIMDIS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TIMDIS_SHIFT)) & FLEXIO_TIMCFG_TIMDIS_MASK) - -#define FLEXIO_TIMCFG_TIMRST_MASK (0x70000U) -#define FLEXIO_TIMCFG_TIMRST_SHIFT (16U) -/*! TIMRST - Timer Reset - * 0b000..Never reset timer - * 0b001..Timer reset on timer output high. - * 0b010..Timer reset on timer pin equal to timer output - * 0b011..Timer reset on timer trigger equal to timer output - * 0b100..Timer reset on timer pin rising edge - * 0b101..Reserved - * 0b110..Timer reset on trigger rising edge - * 0b111..Timer reset on trigger rising or falling edge - */ -#define FLEXIO_TIMCFG_TIMRST(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TIMRST_SHIFT)) & FLEXIO_TIMCFG_TIMRST_MASK) - -#define FLEXIO_TIMCFG_TIMDEC_MASK (0x700000U) -#define FLEXIO_TIMCFG_TIMDEC_SHIFT (20U) -/*! TIMDEC - Timer Decrement - * 0b000..Decrement counter on FLEXIO clock; shift clock equals timer output - * 0b001..Decrement counter on trigger input (both edges); shift clock equals timer output - * 0b010..Decrement counter on pin input (both edges); shift clock equals pin input - * 0b011..Decrement counter on trigger input (both edges); shift clock equals trigger input - * 0b100..Decrement counter on FLEXIO clock divided by 16; shift clock equals timer output - * 0b101..Decrement counter on FLEXIO clock divided by 256; shift clock equals timer output - * 0b110..Decrement counter on pin input (rising edge); shift clock equals pin input - * 0b111..Decrement counter on trigger input (rising edge); shift clock equals trigger input - */ -#define FLEXIO_TIMCFG_TIMDEC(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TIMDEC_SHIFT)) & FLEXIO_TIMCFG_TIMDEC_MASK) - -#define FLEXIO_TIMCFG_TIMOUT_MASK (0x3000000U) -#define FLEXIO_TIMCFG_TIMOUT_SHIFT (24U) -/*! TIMOUT - Timer Output - * 0b00..Logic one when enabled; not affected by timer reset - * 0b01..Logic zero when enabled; not affected by timer reset - * 0b10..Logic one when enabled and on timer reset - * 0b11..Logic zero when enabled and on timer reset - */ -#define FLEXIO_TIMCFG_TIMOUT(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCFG_TIMOUT_SHIFT)) & FLEXIO_TIMCFG_TIMOUT_MASK) -/*! @} */ - -/* The count of FLEXIO_TIMCFG */ -#define FLEXIO_TIMCFG_COUNT (8U) - -/*! @name TIMCMP - Timer Compare */ -/*! @{ */ - -#define FLEXIO_TIMCMP_CMP_MASK (0xFFFFU) -#define FLEXIO_TIMCMP_CMP_SHIFT (0U) -/*! CMP - Timer Compare Value */ -#define FLEXIO_TIMCMP_CMP(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_TIMCMP_CMP_SHIFT)) & FLEXIO_TIMCMP_CMP_MASK) -/*! @} */ - -/* The count of FLEXIO_TIMCMP */ -#define FLEXIO_TIMCMP_COUNT (8U) - -/*! @name SHIFTBUFNBS - Shifter Buffer Nibble Byte Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFNBS_SHIFTBUFNBS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFNBS_SHIFTBUFNBS_SHIFT (0U) -/*! SHIFTBUFNBS - Shift Buffer */ -#define FLEXIO_SHIFTBUFNBS_SHIFTBUFNBS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFNBS_SHIFTBUFNBS_SHIFT)) & FLEXIO_SHIFTBUFNBS_SHIFTBUFNBS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFNBS */ -#define FLEXIO_SHIFTBUFNBS_COUNT (8U) - -/*! @name SHIFTBUFHWS - Shifter Buffer Halfword Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFHWS_SHIFTBUFHWS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFHWS_SHIFTBUFHWS_SHIFT (0U) -/*! SHIFTBUFHWS - Shift Buffer */ -#define FLEXIO_SHIFTBUFHWS_SHIFTBUFHWS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFHWS_SHIFTBUFHWS_SHIFT)) & FLEXIO_SHIFTBUFHWS_SHIFTBUFHWS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFHWS */ -#define FLEXIO_SHIFTBUFHWS_COUNT (8U) - -/*! @name SHIFTBUFNIS - Shifter Buffer Nibble Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFNIS_SHIFTBUFNIS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFNIS_SHIFTBUFNIS_SHIFT (0U) -/*! SHIFTBUFNIS - Shift Buffer */ -#define FLEXIO_SHIFTBUFNIS_SHIFTBUFNIS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFNIS_SHIFTBUFNIS_SHIFT)) & FLEXIO_SHIFTBUFNIS_SHIFTBUFNIS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFNIS */ -#define FLEXIO_SHIFTBUFNIS_COUNT (8U) - -/*! @name SHIFTBUFOES - Shifter Buffer Odd Even Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFOES_SHIFTBUFOES_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFOES_SHIFTBUFOES_SHIFT (0U) -/*! SHIFTBUFOES - Shift Buffer */ -#define FLEXIO_SHIFTBUFOES_SHIFTBUFOES(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFOES_SHIFTBUFOES_SHIFT)) & FLEXIO_SHIFTBUFOES_SHIFTBUFOES_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFOES */ -#define FLEXIO_SHIFTBUFOES_COUNT (8U) - -/*! @name SHIFTBUFEOS - Shifter Buffer Even Odd Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFEOS_SHIFTBUFEOS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFEOS_SHIFTBUFEOS_SHIFT (0U) -/*! SHIFTBUFEOS - Shift Buffer */ -#define FLEXIO_SHIFTBUFEOS_SHIFTBUFEOS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFEOS_SHIFTBUFEOS_SHIFT)) & FLEXIO_SHIFTBUFEOS_SHIFTBUFEOS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFEOS */ -#define FLEXIO_SHIFTBUFEOS_COUNT (8U) - -/*! @name SHIFTBUFHBS - Shifter Buffer Halfword Byte Swapped */ -/*! @{ */ - -#define FLEXIO_SHIFTBUFHBS_SHIFTBUFHBS_MASK (0xFFFFFFFFU) -#define FLEXIO_SHIFTBUFHBS_SHIFTBUFHBS_SHIFT (0U) -/*! SHIFTBUFHBS - Shift Buffer */ -#define FLEXIO_SHIFTBUFHBS_SHIFTBUFHBS(x) (((uint32_t)(((uint32_t)(x)) << FLEXIO_SHIFTBUFHBS_SHIFTBUFHBS_SHIFT)) & FLEXIO_SHIFTBUFHBS_SHIFTBUFHBS_MASK) -/*! @} */ - -/* The count of FLEXIO_SHIFTBUFHBS */ -#define FLEXIO_SHIFTBUFHBS_COUNT (8U) - - -/*! - * @} - */ /* end of group FLEXIO_Register_Masks */ - - -/* FLEXIO - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral FLEXIO0 base address */ - #define FLEXIO0_BASE (0x50105000u) - /** Peripheral FLEXIO0 base address */ - #define FLEXIO0_BASE_NS (0x40105000u) - /** Peripheral FLEXIO0 base pointer */ - #define FLEXIO0 ((FLEXIO_Type *)FLEXIO0_BASE) - /** Peripheral FLEXIO0 base pointer */ - #define FLEXIO0_NS ((FLEXIO_Type *)FLEXIO0_BASE_NS) - /** Array initializer of FLEXIO peripheral base addresses */ - #define FLEXIO_BASE_ADDRS { FLEXIO0_BASE } - /** Array initializer of FLEXIO peripheral base pointers */ - #define FLEXIO_BASE_PTRS { FLEXIO0 } - /** Array initializer of FLEXIO peripheral base addresses */ - #define FLEXIO_BASE_ADDRS_NS { FLEXIO0_BASE_NS } - /** Array initializer of FLEXIO peripheral base pointers */ - #define FLEXIO_BASE_PTRS_NS { FLEXIO0_NS } -#else - /** Peripheral FLEXIO0 base address */ - #define FLEXIO0_BASE (0x40105000u) - /** Peripheral FLEXIO0 base pointer */ - #define FLEXIO0 ((FLEXIO_Type *)FLEXIO0_BASE) - /** Array initializer of FLEXIO peripheral base addresses */ - #define FLEXIO_BASE_ADDRS { FLEXIO0_BASE } - /** Array initializer of FLEXIO peripheral base pointers */ - #define FLEXIO_BASE_PTRS { FLEXIO0 } -#endif -/** Interrupt vectors for the FLEXIO peripheral type */ -#define FLEXIO_IRQS { FLEXIO_IRQn } - -/*! - * @} - */ /* end of group FLEXIO_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- FLEXSPI Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FLEXSPI_Peripheral_Access_Layer FLEXSPI Peripheral Access Layer - * @{ - */ - -/** FLEXSPI - Register Layout Typedef */ -typedef struct { - __IO uint32_t MCR0; /**< Module Control 0, offset: 0x0 */ - __IO uint32_t MCR1; /**< Module Control 1, offset: 0x4 */ - __IO uint32_t MCR2; /**< Module Control 2, offset: 0x8 */ - __IO uint32_t AHBCR; /**< AHB Bus Control, offset: 0xC */ - __IO uint32_t INTEN; /**< Interrupt Enable, offset: 0x10 */ - __IO uint32_t INTR; /**< Interrupt, offset: 0x14 */ - __IO uint32_t LUTKEY; /**< LUT Key, offset: 0x18 */ - __IO uint32_t LUTCR; /**< LUT Control, offset: 0x1C */ - __IO uint32_t AHBRXBUFCR0[8]; /**< AHB Receive Buffer 0 Control 0..AHB Receive Buffer 7 Control 0, array offset: 0x20, array step: 0x4 */ - uint8_t RESERVED_0[32]; - __IO uint32_t FLSHCR0[4]; /**< Flash Control 0, array offset: 0x60, array step: 0x4 */ - __IO uint32_t FLSHCR1[4]; /**< Flash Control 1, array offset: 0x70, array step: 0x4 */ - __IO uint32_t FLSHCR2[4]; /**< Flash Control 2, array offset: 0x80, array step: 0x4 */ - uint8_t RESERVED_1[4]; - __IO uint32_t FLSHCR4; /**< Flash Control 4, offset: 0x94 */ - uint8_t RESERVED_2[8]; - __IO uint32_t IPCR0; /**< IP Control 0, offset: 0xA0 */ - __IO uint32_t IPCR1; /**< IP Control 1, offset: 0xA4 */ - __IO uint32_t IPCR2; /**< IP Control 2, offset: 0xA8 */ - uint8_t RESERVED_3[4]; - __O uint32_t IPCMD; /**< IP Command, offset: 0xB0 */ - __IO uint32_t DLPR; /**< Data Learning Pattern, offset: 0xB4 */ - __IO uint32_t IPRXFCR; /**< IP Receive FIFO Control, offset: 0xB8 */ - __IO uint32_t IPTXFCR; /**< IP Transmit FIFO Control, offset: 0xBC */ - __IO uint32_t DLLCR[2]; /**< DLL Control 0, array offset: 0xC0, array step: 0x4 */ - uint8_t RESERVED_4[24]; - __I uint32_t STS0; /**< Status 0, offset: 0xE0 */ - __I uint32_t STS1; /**< Status 1, offset: 0xE4 */ - __I uint32_t STS2; /**< Status 2, offset: 0xE8 */ - __I uint32_t AHBSPNDSTS; /**< AHB Suspend Status, offset: 0xEC */ - __I uint32_t IPRXFSTS; /**< IP Receive FIFO Status, offset: 0xF0 */ - __I uint32_t IPTXFSTS; /**< IP Transmit FIFO Status, offset: 0xF4 */ - uint8_t RESERVED_5[8]; - __I uint32_t RFDR[32]; /**< IP Receive FIFO Data 0..IP Receive FIFO Data 31, array offset: 0x100, array step: 0x4 */ - __O uint32_t TFDR[32]; /**< IP TX FIFO Data 0..IP TX FIFO Data 31, array offset: 0x180, array step: 0x4 */ - __IO uint32_t LUT[64]; /**< Lookup Table 0..Lookup Table 63, array offset: 0x200, array step: 0x4 */ - uint8_t RESERVED_6[288]; - __IO uint32_t HADDRSTART; /**< HADDR REMAP Start Address, offset: 0x420 */ - __IO uint32_t HADDREND; /**< HADDR REMAP END ADDR, offset: 0x424 */ - __IO uint32_t HADDROFFSET; /**< HADDR Remap Offset, offset: 0x428 */ - __IO uint32_t IPEDCTRL; /**< IPED Function Control, offset: 0x42C */ - __IO uint32_t IPSNSZSTART0; /**< IPS Nonsecure Region 0 Start Address, offset: 0x430 */ - __IO uint32_t IPSNSZEND0; /**< IPS Nonsecure Region 0 End Address, offset: 0x434 */ - __IO uint32_t IPSNSZSTART1; /**< IPS Nonsecure Region 1 Start Address, offset: 0x438 */ - __IO uint32_t IPSNSZEND1; /**< IPS Nonsecure Region 1 End Address, offset: 0x43C */ - __IO uint32_t AHBBUFREGIONSTART0; /**< Receive Buffer Start Address of Region 0, offset: 0x440 */ - __IO uint32_t AHBBUFREGIONEND0; /**< Receive Buffer Region 0 End Address, offset: 0x444 */ - __IO uint32_t AHBBUFREGIONSTART1; /**< Receive Buffer Start Address of Region 1, offset: 0x448 */ - __IO uint32_t AHBBUFREGIONEND1; /**< Receive Buffer Region 1 End Address, offset: 0x44C */ - __IO uint32_t AHBBUFREGIONSTART2; /**< Receive Buffer Start Address of Region 2, offset: 0x450 */ - __IO uint32_t AHBBUFREGIONEND2; /**< Receive Buffer Region 2 End Address, offset: 0x454 */ - __IO uint32_t AHBBUFREGIONSTART3; /**< Receive Buffer Start Address of Region 3, offset: 0x458 */ - __IO uint32_t AHBBUFREGIONEND3; /**< Receive Buffer Region 3 End Address, offset: 0x45C */ - uint8_t RESERVED_7[160]; - __IO uint32_t IPEDCTXCTRL[2]; /**< IPED context control 0..IPED context control 1, array offset: 0x500, array step: 0x4 */ - uint8_t RESERVED_8[24]; - __IO uint32_t IPEDCTX0IV0; /**< IPED Context0 IV0, offset: 0x520 */ - __IO uint32_t IPEDCTX0IV1; /**< IPED Context0 IV1, offset: 0x524 */ - __IO uint32_t IPEDCTX0START; /**< Start Address of Region, offset: 0x528 */ - __IO uint32_t IPEDCTX0END; /**< End Address of Region, offset: 0x52C */ - __IO uint32_t IPEDCTX0AAD0; /**< IPED Context0 Additional Authenticated Data0, offset: 0x530 */ - __IO uint32_t IPEDCTX0AAD1; /**< IPED Context0 Additional Authenticated Data1, offset: 0x534 */ - uint8_t RESERVED_9[8]; - __IO uint32_t IPEDCTX1IV0; /**< IPED Context1 IV0, offset: 0x540 */ - __IO uint32_t IPEDCTX1IV1; /**< IPED Context1 IV1, offset: 0x544 */ - __IO uint32_t IPEDCTX1START; /**< Start Address of Region, offset: 0x548 */ - __IO uint32_t IPEDCTX1END; /**< End Address of Region, offset: 0x54C */ - __IO uint32_t IPEDCTX1AAD0; /**< IPED Context1 Additional Authenticated Data0, offset: 0x550 */ - __IO uint32_t IPEDCTX1AAD1; /**< IPED Context1 Additional Authenticated Data1, offset: 0x554 */ - uint8_t RESERVED_10[8]; - __IO uint32_t IPEDCTX2IV0; /**< IPED Context2 IV0, offset: 0x560 */ - __IO uint32_t IPEDCTX2IV1; /**< IPED Context2 IV1, offset: 0x564 */ - __IO uint32_t IPEDCTX2START; /**< Start Address of Region, offset: 0x568 */ - __IO uint32_t IPEDCTX2END; /**< End Address of Region, offset: 0x56C */ - __IO uint32_t IPEDCTX2AAD0; /**< IPED Context2 Additional Authenticated Data0, offset: 0x570 */ - __IO uint32_t IPEDCTX2AAD1; /**< IPED Context2 Additional Authenticated Data1, offset: 0x574 */ - uint8_t RESERVED_11[8]; - __IO uint32_t IPEDCTX3IV0; /**< IPED Context3 IV0, offset: 0x580 */ - __IO uint32_t IPEDCTX3IV1; /**< IPED Context3 IV1, offset: 0x584 */ - __IO uint32_t IPEDCTX3START; /**< Start Address of Region, offset: 0x588 */ - __IO uint32_t IPEDCTX3END; /**< End Address of Region, offset: 0x58C */ - __IO uint32_t IPEDCTX3AAD0; /**< IPED Context3 Additional Authenticated Data0, offset: 0x590 */ - __IO uint32_t IPEDCTX3AAD1; /**< IPED Context3 Additional Authenticated Data1, offset: 0x594 */ - uint8_t RESERVED_12[8]; - __IO uint32_t IPEDCTX4IV0; /**< IPED Context4 IV0, offset: 0x5A0 */ - __IO uint32_t IPEDCTX4IV1; /**< IPED Context4 IV1, offset: 0x5A4 */ - __IO uint32_t IPEDCTX4START; /**< Start Address of Region, offset: 0x5A8 */ - __IO uint32_t IPEDCTX4END; /**< End Address of Region, offset: 0x5AC */ - __IO uint32_t IPEDCTX4AAD0; /**< IPED Context4 Additional Authenticated Data0, offset: 0x5B0 */ - __IO uint32_t IPEDCTX4AAD1; /**< IPED Context4 Additional Authenticated Data1, offset: 0x5B4 */ - uint8_t RESERVED_13[8]; - __IO uint32_t IPEDCTX5IV0; /**< IPED Context5 IV0, offset: 0x5C0 */ - __IO uint32_t IPEDCTX5IV1; /**< IPED Context5 IV1, offset: 0x5C4 */ - __IO uint32_t IPEDCTX5START; /**< Start Address of Region, offset: 0x5C8 */ - __IO uint32_t IPEDCTX5END; /**< End Address of Region, offset: 0x5CC */ - __IO uint32_t IPEDCTX5AAD0; /**< IPED Context5 Additional Authenticated Data0, offset: 0x5D0 */ - __IO uint32_t IPEDCTX5AAD1; /**< IPED Context5 Additional Authenticated Data1, offset: 0x5D4 */ - uint8_t RESERVED_14[8]; - __IO uint32_t IPEDCTX6IV0; /**< IPED Context6 IV0, offset: 0x5E0 */ - __IO uint32_t IPEDCTX6IV1; /**< IPED Context6 IV1, offset: 0x5E4 */ - __IO uint32_t IPEDCTX6START; /**< Start Address of Region, offset: 0x5E8 */ - __IO uint32_t IPEDCTX6END; /**< End Address of Region, offset: 0x5EC */ - __IO uint32_t IPEDCTX6AAD0; /**< IPED Context6 Additional Authenticated Data0, offset: 0x5F0 */ - __IO uint32_t IPEDCTX6AAD1; /**< IPED Context6 Additional Authenticated Data1, offset: 0x5F4 */ -} FLEXSPI_Type; - -/* ---------------------------------------------------------------------------- - -- FLEXSPI Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FLEXSPI_Register_Masks FLEXSPI Register Masks - * @{ - */ - -/*! @name MCR0 - Module Control 0 */ -/*! @{ */ - -#define FLEXSPI_MCR0_SWRESET_MASK (0x1U) -#define FLEXSPI_MCR0_SWRESET_SHIFT (0U) -/*! SWRESET - Software Reset - * 0b0..No impact - * 0b1..Software reset - */ -#define FLEXSPI_MCR0_SWRESET(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR0_SWRESET_SHIFT)) & FLEXSPI_MCR0_SWRESET_MASK) - -#define FLEXSPI_MCR0_MDIS_MASK (0x2U) -#define FLEXSPI_MCR0_MDIS_SHIFT (1U) -/*! MDIS - Module Disable - * 0b0..No impact - * 0b1..Module disable - */ -#define FLEXSPI_MCR0_MDIS(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR0_MDIS_SHIFT)) & FLEXSPI_MCR0_MDIS_MASK) - -#define FLEXSPI_MCR0_RXCLKSRC_MASK (0x30U) -#define FLEXSPI_MCR0_RXCLKSRC_SHIFT (4U) -/*! RXCLKSRC - Sample Clock Source for Flash Reading - * 0b00..Dummy Read strobe that FlexSPI generates, looped back internally - * 0b01..Dummy Read strobe that FlexSPI generates, looped back from DQS pad - * 0b10..SCLK output clock and looped back from SCLK pad - * 0b11..Flash-memory-provided read strobe and input from DQS pad - */ -#define FLEXSPI_MCR0_RXCLKSRC(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR0_RXCLKSRC_SHIFT)) & FLEXSPI_MCR0_RXCLKSRC_MASK) - -#define FLEXSPI_MCR0_ARDFEN_MASK (0x40U) -#define FLEXSPI_MCR0_ARDFEN_SHIFT (6U) -/*! ARDFEN - AHB Read Access to IP Receive FIFO Enable - * 0b0..AHB read access disabled. IP bus reads IP receive FIFO. AHB Bus read access to IP receive FIFO memory space produces bus error. - * 0b1..AHB read access enabled. AHB bus reads IP receive FIFO. IP Bus read access to IP receive FIFO memory - * space returns data zero and causes no bus error. - */ -#define FLEXSPI_MCR0_ARDFEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR0_ARDFEN_SHIFT)) & FLEXSPI_MCR0_ARDFEN_MASK) - -#define FLEXSPI_MCR0_ATDFEN_MASK (0x80U) -#define FLEXSPI_MCR0_ATDFEN_SHIFT (7U) -/*! ATDFEN - AHB Write Access to IP Transmit FIFO Enable - * 0b0..AHB write access disabled. IP bus writes to IP transmit FIFO. AHB bus write access to IP transmit FIFO memory space produces bus error. - * 0b1..AHB write access enabled. AHB bus writes to IP transmit FIFO. IP Bus write access to IP transmit FIFO - * memory space is ignored and causes no bus error. - */ -#define FLEXSPI_MCR0_ATDFEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR0_ATDFEN_SHIFT)) & FLEXSPI_MCR0_ATDFEN_MASK) - -#define FLEXSPI_MCR0_SERCLKDIV_MASK (0x700U) -#define FLEXSPI_MCR0_SERCLKDIV_SHIFT (8U) -/*! SERCLKDIV - Serial Root Clock Divider - * 0b000..Divided by 1 - * 0b001..Divided by 2 - * 0b010..Divided by 3 - * 0b011..Divided by 4 - * 0b100..Divided by 5 - * 0b101..Divided by 6 - * 0b110..Divided by 7 - * 0b111..Divided by 8 - */ -#define FLEXSPI_MCR0_SERCLKDIV(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR0_SERCLKDIV_SHIFT)) & FLEXSPI_MCR0_SERCLKDIV_MASK) - -#define FLEXSPI_MCR0_HSEN_MASK (0x800U) -#define FLEXSPI_MCR0_HSEN_SHIFT (11U) -/*! HSEN - Half Speed Serial Flash Memory Access Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_MCR0_HSEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR0_HSEN_SHIFT)) & FLEXSPI_MCR0_HSEN_MASK) - -#define FLEXSPI_MCR0_DOZEEN_MASK (0x1000U) -#define FLEXSPI_MCR0_DOZEEN_SHIFT (12U) -/*! DOZEEN - Doze Mode Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_MCR0_DOZEEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR0_DOZEEN_SHIFT)) & FLEXSPI_MCR0_DOZEEN_MASK) - -#define FLEXSPI_MCR0_COMBINATIONEN_MASK (0x2000U) -#define FLEXSPI_MCR0_COMBINATIONEN_SHIFT (13U) -/*! COMBINATIONEN - Combination Mode Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_MCR0_COMBINATIONEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR0_COMBINATIONEN_SHIFT)) & FLEXSPI_MCR0_COMBINATIONEN_MASK) - -#define FLEXSPI_MCR0_SCKFREERUNEN_MASK (0x4000U) -#define FLEXSPI_MCR0_SCKFREERUNEN_SHIFT (14U) -/*! SCKFREERUNEN - SCLK Free-running Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_MCR0_SCKFREERUNEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR0_SCKFREERUNEN_SHIFT)) & FLEXSPI_MCR0_SCKFREERUNEN_MASK) - -#define FLEXSPI_MCR0_LEARNEN_MASK (0x8000U) -#define FLEXSPI_MCR0_LEARNEN_SHIFT (15U) -/*! LEARNEN - Data Learning Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_MCR0_LEARNEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR0_LEARNEN_SHIFT)) & FLEXSPI_MCR0_LEARNEN_MASK) - -#define FLEXSPI_MCR0_IPGRANTWAIT_MASK (0xFF0000U) -#define FLEXSPI_MCR0_IPGRANTWAIT_SHIFT (16U) -/*! IPGRANTWAIT - Timeout Wait Cycle for IP Command Grant */ -#define FLEXSPI_MCR0_IPGRANTWAIT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR0_IPGRANTWAIT_SHIFT)) & FLEXSPI_MCR0_IPGRANTWAIT_MASK) - -#define FLEXSPI_MCR0_AHBGRANTWAIT_MASK (0xFF000000U) -#define FLEXSPI_MCR0_AHBGRANTWAIT_SHIFT (24U) -/*! AHBGRANTWAIT - Timeouts Wait Cycle for AHB command Grant */ -#define FLEXSPI_MCR0_AHBGRANTWAIT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR0_AHBGRANTWAIT_SHIFT)) & FLEXSPI_MCR0_AHBGRANTWAIT_MASK) -/*! @} */ - -/*! @name MCR1 - Module Control 1 */ -/*! @{ */ - -#define FLEXSPI_MCR1_AHBBUSWAIT_MASK (0xFFFFU) -#define FLEXSPI_MCR1_AHBBUSWAIT_SHIFT (0U) -/*! AHBBUSWAIT - AHB Bus Wait */ -#define FLEXSPI_MCR1_AHBBUSWAIT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR1_AHBBUSWAIT_SHIFT)) & FLEXSPI_MCR1_AHBBUSWAIT_MASK) - -#define FLEXSPI_MCR1_SEQWAIT_MASK (0xFFFF0000U) -#define FLEXSPI_MCR1_SEQWAIT_SHIFT (16U) -/*! SEQWAIT - Command Sequence Wait */ -#define FLEXSPI_MCR1_SEQWAIT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR1_SEQWAIT_SHIFT)) & FLEXSPI_MCR1_SEQWAIT_MASK) -/*! @} */ - -/*! @name MCR2 - Module Control 2 */ -/*! @{ */ - -#define FLEXSPI_MCR2_CLRAHBBUFOPT_MASK (0x800U) -#define FLEXSPI_MCR2_CLRAHBBUFOPT_SHIFT (11U) -/*! CLRAHBBUFOPT - Clear AHB Buffer - * 0b0..Not cleared automatically - * 0b1..Cleared automatically - */ -#define FLEXSPI_MCR2_CLRAHBBUFOPT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR2_CLRAHBBUFOPT_SHIFT)) & FLEXSPI_MCR2_CLRAHBBUFOPT_MASK) - -#define FLEXSPI_MCR2_CLRLEARNPHASE_MASK (0x4000U) -#define FLEXSPI_MCR2_CLRLEARNPHASE_SHIFT (14U) -/*! CLRLEARNPHASE - Clear Learn Phase Selection - * 0b0..No impact - * 0b1..Reset sample clock phase selection to 0 - */ -#define FLEXSPI_MCR2_CLRLEARNPHASE(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR2_CLRLEARNPHASE_SHIFT)) & FLEXSPI_MCR2_CLRLEARNPHASE_MASK) - -#define FLEXSPI_MCR2_SAMEDEVICEEN_MASK (0x8000U) -#define FLEXSPI_MCR2_SAMEDEVICEEN_SHIFT (15U) -/*! SAMEDEVICEEN - Same Device Enable - * 0b0..In Individual mode, FLSHA1CRx and FLSHA2CRx, FLSHB1CRx and FLSHB2CRx settings are applied to Flash A1, - * A2, B1, B2 separately. In Parallel mode, FLSHA1CRx register setting is applied to Flash A1 and B1, FLSHA2CRx - * register setting is applied to Flash A2 and B2. FLSHB1CRx and FLSHB2CRx register settings are ignored. - * 0b1..FLSHA1CR0, FLSHA1CR1, and FLSHA1CR2 register settings are applied to Flash A1, A2, B1, B2. FLSHA2CRx, - * FLSHB1CRx, and FLSHB2CRx settings are ignored. - */ -#define FLEXSPI_MCR2_SAMEDEVICEEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR2_SAMEDEVICEEN_SHIFT)) & FLEXSPI_MCR2_SAMEDEVICEEN_MASK) - -#define FLEXSPI_MCR2_SCKBDIFFOPT_MASK (0x80000U) -#define FLEXSPI_MCR2_SCKBDIFFOPT_SHIFT (19U) -/*! SCKBDIFFOPT - SCLK Port B Differential Output - * 0b1..Use B_SCLK pad as port A SCLK inverted clock output (Differential clock to A_SCLK). Port B flash memory access is not available. - * 0b0..Use B_SCLK pad as port B SCLK clock output. Port B flash memory access is available. - */ -#define FLEXSPI_MCR2_SCKBDIFFOPT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR2_SCKBDIFFOPT_SHIFT)) & FLEXSPI_MCR2_SCKBDIFFOPT_MASK) - -#define FLEXSPI_MCR2_RXCLKSRC_B_MASK (0x600000U) -#define FLEXSPI_MCR2_RXCLKSRC_B_SHIFT (21U) -/*! RXCLKSRC_B - Port B Receiver Clock Source - * 0b00..Dummy read strobe that FlexSPI generates, looped back internally. - * 0b01..Dummy read strobe that FlexSPI generates, looped back from DQS pad. - * 0b10..SCLK output clock and looped back from SCLK pad - * 0b11..Flash-memory-provided read strobe and input from DQS pad - */ -#define FLEXSPI_MCR2_RXCLKSRC_B(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR2_RXCLKSRC_B_SHIFT)) & FLEXSPI_MCR2_RXCLKSRC_B_MASK) - -#define FLEXSPI_MCR2_RX_CLK_SRC_DIFF_MASK (0x800000U) -#define FLEXSPI_MCR2_RX_CLK_SRC_DIFF_SHIFT (23U) -/*! RX_CLK_SRC_DIFF - Sample Clock Source Different - * 0b0..Use MCR0[RXCLKSRC] for Port A and Port B. MCR2[RXCLKSRC_B] is ignored and MCR0[RXCLKSRC] selects the - * Sample Clock source for Flash Reading of both ports A and B. - * 0b1..Use MCR0[RXCLKSRC] for Port A, and MCR2[RXCLKSRC_B] for Port B. MCR0[RXCLKSRC] selects the Sample Clock - * source for Flash Reading of port A (A_SCLK) and MCR2[RXCLKSRC_B] selects the Sample Clock source for Flash - * Reading of port B (B_SCLK). - */ -#define FLEXSPI_MCR2_RX_CLK_SRC_DIFF(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR2_RX_CLK_SRC_DIFF_SHIFT)) & FLEXSPI_MCR2_RX_CLK_SRC_DIFF_MASK) - -#define FLEXSPI_MCR2_RESUMEWAIT_MASK (0xFF000000U) -#define FLEXSPI_MCR2_RESUMEWAIT_SHIFT (24U) -/*! RESUMEWAIT - Resume Wait Duration */ -#define FLEXSPI_MCR2_RESUMEWAIT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_MCR2_RESUMEWAIT_SHIFT)) & FLEXSPI_MCR2_RESUMEWAIT_MASK) -/*! @} */ - -/*! @name AHBCR - AHB Bus Control */ -/*! @{ */ - -#define FLEXSPI_AHBCR_APAREN_MASK (0x1U) -#define FLEXSPI_AHBCR_APAREN_SHIFT (0U) -/*! APAREN - AHB Parallel Mode Enable - * 0b0..Flash is accessed in Individual mode. - * 0b1..Flash is accessed in Parallel mode. - */ -#define FLEXSPI_AHBCR_APAREN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBCR_APAREN_SHIFT)) & FLEXSPI_AHBCR_APAREN_MASK) - -#define FLEXSPI_AHBCR_CLRAHBRXBUF_MASK (0x2U) -#define FLEXSPI_AHBCR_CLRAHBRXBUF_SHIFT (1U) -/*! CLRAHBRXBUF - Clear AHB Receive Buffer - * 0b0..No impact. - * 0b1..Enable clear operation. - */ -#define FLEXSPI_AHBCR_CLRAHBRXBUF(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBCR_CLRAHBRXBUF_SHIFT)) & FLEXSPI_AHBCR_CLRAHBRXBUF_MASK) - -#define FLEXSPI_AHBCR_CLRAHBTXBUF_MASK (0x4U) -#define FLEXSPI_AHBCR_CLRAHBTXBUF_SHIFT (2U) -/*! CLRAHBTXBUF - Clear AHB Transmit Buffer - * 0b0..No impact. - * 0b1..Enable clear operation. - */ -#define FLEXSPI_AHBCR_CLRAHBTXBUF(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBCR_CLRAHBTXBUF_SHIFT)) & FLEXSPI_AHBCR_CLRAHBTXBUF_MASK) - -#define FLEXSPI_AHBCR_CACHABLEEN_MASK (0x8U) -#define FLEXSPI_AHBCR_CACHABLEEN_SHIFT (3U) -/*! CACHABLEEN - Cacheable Read Access Enable - * 0b0..Disabled. When an AHB bus cacheable read access occurs, FlexSPI does not check whether it hit the AHB transmit buffer. - * 0b1..Enabled. When an AHB bus cacheable read access occurs, FlexSPI first checks whether the access hit the AHB transmit buffer. - */ -#define FLEXSPI_AHBCR_CACHABLEEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBCR_CACHABLEEN_SHIFT)) & FLEXSPI_AHBCR_CACHABLEEN_MASK) - -#define FLEXSPI_AHBCR_BUFFERABLEEN_MASK (0x10U) -#define FLEXSPI_AHBCR_BUFFERABLEEN_SHIFT (4U) -/*! BUFFERABLEEN - Bufferable Write Access Enable - * 0b0..Disabled. For all AHB write accesses (bufferable or nonbufferable), FlexSPI returns AHB Bus Ready after - * transmitting all data and finishing command. - * 0b1..Enabled. For AHB bufferable write access, FlexSPI returns AHB Bus Ready when the arbitrator grants the - * AHB command. FlexSPI does not wait for the AHB command to finish. - */ -#define FLEXSPI_AHBCR_BUFFERABLEEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBCR_BUFFERABLEEN_SHIFT)) & FLEXSPI_AHBCR_BUFFERABLEEN_MASK) - -#define FLEXSPI_AHBCR_PREFETCHEN_MASK (0x20U) -#define FLEXSPI_AHBCR_PREFETCHEN_SHIFT (5U) -/*! PREFETCHEN - AHB Read Prefetch Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_AHBCR_PREFETCHEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBCR_PREFETCHEN_SHIFT)) & FLEXSPI_AHBCR_PREFETCHEN_MASK) - -#define FLEXSPI_AHBCR_READADDROPT_MASK (0x40U) -#define FLEXSPI_AHBCR_READADDROPT_SHIFT (6U) -/*! READADDROPT - AHB Read Address Option - * 0b0..AHB read burst start address alignment is limited when flash memory is accessed in parallel mode or flash is word-addressable. - * 0b1..AHB read burst start address alignment is not limited. FlexSPI fetches more data than the AHB burst requires for address alignment. - */ -#define FLEXSPI_AHBCR_READADDROPT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBCR_READADDROPT_SHIFT)) & FLEXSPI_AHBCR_READADDROPT_MASK) - -#define FLEXSPI_AHBCR_RESUMEDISABLE_MASK (0x80U) -#define FLEXSPI_AHBCR_RESUMEDISABLE_SHIFT (7U) -/*! RESUMEDISABLE - AHB Read Resume Disable - * 0b0..Suspended AHB read prefetch resumes when AHB is IDLE. - * 0b1..Suspended AHB read prefetch does not resume once aborted, - */ -#define FLEXSPI_AHBCR_RESUMEDISABLE(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBCR_RESUMEDISABLE_SHIFT)) & FLEXSPI_AHBCR_RESUMEDISABLE_MASK) - -#define FLEXSPI_AHBCR_READSZALIGN_MASK (0x400U) -#define FLEXSPI_AHBCR_READSZALIGN_SHIFT (10U) -/*! READSZALIGN - AHB Read Size Alignment - * 0b0..Register settings such as PREFETCH_EN determine AHB read size. - * 0b1..AHB read size to up size to 8 bytes aligned, no prefetching - */ -#define FLEXSPI_AHBCR_READSZALIGN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBCR_READSZALIGN_SHIFT)) & FLEXSPI_AHBCR_READSZALIGN_MASK) - -#define FLEXSPI_AHBCR_ALIGNMENT_MASK (0x300000U) -#define FLEXSPI_AHBCR_ALIGNMENT_SHIFT (20U) -/*! ALIGNMENT - AHB Boundary Alignment - * 0b00..No limit - * 0b01..1 KB - * 0b10..512 bytes - * 0b11..256 bytes - */ -#define FLEXSPI_AHBCR_ALIGNMENT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBCR_ALIGNMENT_SHIFT)) & FLEXSPI_AHBCR_ALIGNMENT_MASK) - -#define FLEXSPI_AHBCR_AFLASHBASE_MASK (0xE0000000U) -#define FLEXSPI_AHBCR_AFLASHBASE_SHIFT (29U) -/*! AFLASHBASE - AHB Memory-Mapped Flash Base Address */ -#define FLEXSPI_AHBCR_AFLASHBASE(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBCR_AFLASHBASE_SHIFT)) & FLEXSPI_AHBCR_AFLASHBASE_MASK) -/*! @} */ - -/*! @name INTEN - Interrupt Enable */ -/*! @{ */ - -#define FLEXSPI_INTEN_IPCMDDONEEN_MASK (0x1U) -#define FLEXSPI_INTEN_IPCMDDONEEN_SHIFT (0U) -/*! IPCMDDONEEN - IP-Triggered Command Sequences Execution Finished Interrupt Enable - * 0b0..Disable interrupt or no impact - * 0b1..Enable interrupt - */ -#define FLEXSPI_INTEN_IPCMDDONEEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTEN_IPCMDDONEEN_SHIFT)) & FLEXSPI_INTEN_IPCMDDONEEN_MASK) - -#define FLEXSPI_INTEN_IPCMDGEEN_MASK (0x2U) -#define FLEXSPI_INTEN_IPCMDGEEN_SHIFT (1U) -/*! IPCMDGEEN - IP-Triggered Command Sequences Grant Timeout Interrupt Enable - * 0b0..Disable interrupt or no impact - * 0b1..Enable interrupt - */ -#define FLEXSPI_INTEN_IPCMDGEEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTEN_IPCMDGEEN_SHIFT)) & FLEXSPI_INTEN_IPCMDGEEN_MASK) - -#define FLEXSPI_INTEN_AHBCMDGEEN_MASK (0x4U) -#define FLEXSPI_INTEN_AHBCMDGEEN_SHIFT (2U) -/*! AHBCMDGEEN - AHB-Triggered Command Sequences Grant Timeout Interrupt Enable. - * 0b0..Disable interrupt or no impact - * 0b1..Enable interrupt - */ -#define FLEXSPI_INTEN_AHBCMDGEEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTEN_AHBCMDGEEN_SHIFT)) & FLEXSPI_INTEN_AHBCMDGEEN_MASK) - -#define FLEXSPI_INTEN_IPCMDERREN_MASK (0x8U) -#define FLEXSPI_INTEN_IPCMDERREN_SHIFT (3U) -/*! IPCMDERREN - IP-Triggered Command Sequences Error Detected Interrupt Enable - * 0b0..Disable interrupt or no impact - * 0b1..Enable interrupt - */ -#define FLEXSPI_INTEN_IPCMDERREN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTEN_IPCMDERREN_SHIFT)) & FLEXSPI_INTEN_IPCMDERREN_MASK) - -#define FLEXSPI_INTEN_AHBCMDERREN_MASK (0x10U) -#define FLEXSPI_INTEN_AHBCMDERREN_SHIFT (4U) -/*! AHBCMDERREN - AHB-Triggered Command Sequences Error Detected Interrupt Enable - * 0b0..Disable interrupt or no impact - * 0b1..Enable interrupt - */ -#define FLEXSPI_INTEN_AHBCMDERREN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTEN_AHBCMDERREN_SHIFT)) & FLEXSPI_INTEN_AHBCMDERREN_MASK) - -#define FLEXSPI_INTEN_IPRXWAEN_MASK (0x20U) -#define FLEXSPI_INTEN_IPRXWAEN_SHIFT (5U) -/*! IPRXWAEN - IP Receive FIFO Watermark Available Interrupt Enable - * 0b0..Disable interrupt or no impact - * 0b1..Enable interrupt - */ -#define FLEXSPI_INTEN_IPRXWAEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTEN_IPRXWAEN_SHIFT)) & FLEXSPI_INTEN_IPRXWAEN_MASK) - -#define FLEXSPI_INTEN_IPTXWEEN_MASK (0x40U) -#define FLEXSPI_INTEN_IPTXWEEN_SHIFT (6U) -/*! IPTXWEEN - IP Transmit FIFO Watermark Empty Interrupt Enable - * 0b0..Disable interrupt or no impact - * 0b1..Enable interrupt - */ -#define FLEXSPI_INTEN_IPTXWEEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTEN_IPTXWEEN_SHIFT)) & FLEXSPI_INTEN_IPTXWEEN_MASK) - -#define FLEXSPI_INTEN_DATALEARNFAILEN_MASK (0x80U) -#define FLEXSPI_INTEN_DATALEARNFAILEN_SHIFT (7U) -/*! DATALEARNFAILEN - Data Learning Failed Interrupt Enable - * 0b0..Disable interrupt or no impact - * 0b1..Enable interrupt - */ -#define FLEXSPI_INTEN_DATALEARNFAILEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTEN_DATALEARNFAILEN_SHIFT)) & FLEXSPI_INTEN_DATALEARNFAILEN_MASK) - -#define FLEXSPI_INTEN_SCKSTOPBYRDEN_MASK (0x100U) -#define FLEXSPI_INTEN_SCKSTOPBYRDEN_SHIFT (8U) -/*! SCKSTOPBYRDEN - SCLK Stopped By Read Interrupt Enable - * 0b0..Disable interrupt or no impact - * 0b1..Enable interrupt - */ -#define FLEXSPI_INTEN_SCKSTOPBYRDEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTEN_SCKSTOPBYRDEN_SHIFT)) & FLEXSPI_INTEN_SCKSTOPBYRDEN_MASK) - -#define FLEXSPI_INTEN_SCKSTOPBYWREN_MASK (0x200U) -#define FLEXSPI_INTEN_SCKSTOPBYWREN_SHIFT (9U) -/*! SCKSTOPBYWREN - SCLK Stopped By Write Interrupt Enable - * 0b0..Disable interrupt or no impact - * 0b1..Enable interrupt - */ -#define FLEXSPI_INTEN_SCKSTOPBYWREN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTEN_SCKSTOPBYWREN_SHIFT)) & FLEXSPI_INTEN_SCKSTOPBYWREN_MASK) - -#define FLEXSPI_INTEN_AHBBUSTIMEOUTEN_MASK (0x400U) -#define FLEXSPI_INTEN_AHBBUSTIMEOUTEN_SHIFT (10U) -/*! AHBBUSTIMEOUTEN - AHB Bus Timeout Interrupt Enable - * 0b0..Disable interrupt or no impact - * 0b1..Enable interrupt - */ -#define FLEXSPI_INTEN_AHBBUSTIMEOUTEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTEN_AHBBUSTIMEOUTEN_SHIFT)) & FLEXSPI_INTEN_AHBBUSTIMEOUTEN_MASK) - -#define FLEXSPI_INTEN_SEQTIMEOUTEN_MASK (0x800U) -#define FLEXSPI_INTEN_SEQTIMEOUTEN_SHIFT (11U) -/*! SEQTIMEOUTEN - Sequence execution Timeout Interrupt Enable - * 0b0..Disable interrupt or no impact - * 0b1..Enable interrupt - */ -#define FLEXSPI_INTEN_SEQTIMEOUTEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTEN_SEQTIMEOUTEN_SHIFT)) & FLEXSPI_INTEN_SEQTIMEOUTEN_MASK) - -#define FLEXSPI_INTEN_IPCMDSECUREVIOEN_MASK (0x10000U) -#define FLEXSPI_INTEN_IPCMDSECUREVIOEN_SHIFT (16U) -/*! IPCMDSECUREVIOEN - IP Command Security Violation Interrupt Enable - * 0b0..Disable interrupt or no impact - * 0b1..Enable interrupt - */ -#define FLEXSPI_INTEN_IPCMDSECUREVIOEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTEN_IPCMDSECUREVIOEN_SHIFT)) & FLEXSPI_INTEN_IPCMDSECUREVIOEN_MASK) - -#define FLEXSPI_INTEN_AHBGCMERREN_MASK (0x20000U) -#define FLEXSPI_INTEN_AHBGCMERREN_SHIFT (17U) -/*! AHBGCMERREN - AHB Read GCM Error Interrupt Enable - * 0b0..Disable interrupt or no impact - * 0b1..Enable interrupt - */ -#define FLEXSPI_INTEN_AHBGCMERREN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTEN_AHBGCMERREN_SHIFT)) & FLEXSPI_INTEN_AHBGCMERREN_MASK) -/*! @} */ - -/*! @name INTR - Interrupt */ -/*! @{ */ - -#define FLEXSPI_INTR_IPCMDDONE_MASK (0x1U) -#define FLEXSPI_INTR_IPCMDDONE_SHIFT (0U) -/*! IPCMDDONE - IP-Triggered Command Sequences Execution Finished - * 0b0..Interrupt condition has not occurred - * 0b1..Interrupt condition has occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define FLEXSPI_INTR_IPCMDDONE(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTR_IPCMDDONE_SHIFT)) & FLEXSPI_INTR_IPCMDDONE_MASK) - -#define FLEXSPI_INTR_IPCMDGE_MASK (0x2U) -#define FLEXSPI_INTR_IPCMDGE_SHIFT (1U) -/*! IPCMDGE - IP-Triggered Command Sequences Grant Timeout - * 0b0..Interrupt condition has not occurred - * 0b1..Interrupt condition has occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define FLEXSPI_INTR_IPCMDGE(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTR_IPCMDGE_SHIFT)) & FLEXSPI_INTR_IPCMDGE_MASK) - -#define FLEXSPI_INTR_AHBCMDGE_MASK (0x4U) -#define FLEXSPI_INTR_AHBCMDGE_SHIFT (2U) -/*! AHBCMDGE - AHB-Triggered Command Sequences Grant Timeout - * 0b0..Interrupt condition has not occurred - * 0b1..Interrupt condition has occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define FLEXSPI_INTR_AHBCMDGE(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTR_AHBCMDGE_SHIFT)) & FLEXSPI_INTR_AHBCMDGE_MASK) - -#define FLEXSPI_INTR_IPCMDERR_MASK (0x8U) -#define FLEXSPI_INTR_IPCMDERR_SHIFT (3U) -/*! IPCMDERR - IP-Triggered Command Sequences Error - * 0b0..Interrupt condition has not occurred - * 0b1..Interrupt condition has occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define FLEXSPI_INTR_IPCMDERR(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTR_IPCMDERR_SHIFT)) & FLEXSPI_INTR_IPCMDERR_MASK) - -#define FLEXSPI_INTR_AHBCMDERR_MASK (0x10U) -#define FLEXSPI_INTR_AHBCMDERR_SHIFT (4U) -/*! AHBCMDERR - AHB-Triggered Command Sequences Error - * 0b0..Interrupt condition has not occurred - * 0b1..Interrupt condition has occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define FLEXSPI_INTR_AHBCMDERR(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTR_AHBCMDERR_SHIFT)) & FLEXSPI_INTR_AHBCMDERR_MASK) - -#define FLEXSPI_INTR_IPRXWA_MASK (0x20U) -#define FLEXSPI_INTR_IPRXWA_SHIFT (5U) -/*! IPRXWA - IP Receive FIFO Watermark Available - * 0b0..Interrupt condition has not occurred - * 0b1..Interrupt condition has occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define FLEXSPI_INTR_IPRXWA(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTR_IPRXWA_SHIFT)) & FLEXSPI_INTR_IPRXWA_MASK) - -#define FLEXSPI_INTR_IPTXWE_MASK (0x40U) -#define FLEXSPI_INTR_IPTXWE_SHIFT (6U) -/*! IPTXWE - IP Transmit FIFO Watermark Empty - * 0b0..Interrupt condition has not occurred - * 0b1..Interrupt condition has occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define FLEXSPI_INTR_IPTXWE(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTR_IPTXWE_SHIFT)) & FLEXSPI_INTR_IPTXWE_MASK) - -#define FLEXSPI_INTR_DATALEARNFAIL_MASK (0x80U) -#define FLEXSPI_INTR_DATALEARNFAIL_SHIFT (7U) -/*! DATALEARNFAIL - Data Learning Failed - * 0b0..Interrupt condition has not occurred - * 0b1..Interrupt condition has occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define FLEXSPI_INTR_DATALEARNFAIL(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTR_DATALEARNFAIL_SHIFT)) & FLEXSPI_INTR_DATALEARNFAIL_MASK) - -#define FLEXSPI_INTR_SCKSTOPBYRD_MASK (0x100U) -#define FLEXSPI_INTR_SCKSTOPBYRD_SHIFT (8U) -/*! SCKSTOPBYRD - SCLK Stopped Due To Full Receive FIFO - * 0b0..Interrupt condition has not occurred - * 0b1..Interrupt condition has occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define FLEXSPI_INTR_SCKSTOPBYRD(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTR_SCKSTOPBYRD_SHIFT)) & FLEXSPI_INTR_SCKSTOPBYRD_MASK) - -#define FLEXSPI_INTR_SCKSTOPBYWR_MASK (0x200U) -#define FLEXSPI_INTR_SCKSTOPBYWR_SHIFT (9U) -/*! SCKSTOPBYWR - SCLK Stopped Due To Empty Transmit FIFO - * 0b0..Interrupt condition has not occurred - * 0b1..Interrupt condition has occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define FLEXSPI_INTR_SCKSTOPBYWR(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTR_SCKSTOPBYWR_SHIFT)) & FLEXSPI_INTR_SCKSTOPBYWR_MASK) - -#define FLEXSPI_INTR_AHBBUSTIMEOUT_MASK (0x400U) -#define FLEXSPI_INTR_AHBBUSTIMEOUT_SHIFT (10U) -/*! AHBBUSTIMEOUT - AHB Bus Timeout - * 0b0..Interrupt condition has not occurred - * 0b1..Interrupt condition has occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define FLEXSPI_INTR_AHBBUSTIMEOUT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTR_AHBBUSTIMEOUT_SHIFT)) & FLEXSPI_INTR_AHBBUSTIMEOUT_MASK) - -#define FLEXSPI_INTR_SEQTIMEOUT_MASK (0x800U) -#define FLEXSPI_INTR_SEQTIMEOUT_SHIFT (11U) -/*! SEQTIMEOUT - Sequence Execution Timeout - * 0b0..Interrupt condition has not occurred - * 0b1..Interrupt condition has occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define FLEXSPI_INTR_SEQTIMEOUT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTR_SEQTIMEOUT_SHIFT)) & FLEXSPI_INTR_SEQTIMEOUT_MASK) - -#define FLEXSPI_INTR_IPCMDSECUREVIO_MASK (0x10000U) -#define FLEXSPI_INTR_IPCMDSECUREVIO_SHIFT (16U) -/*! IPCMDSECUREVIO - IP Command Security Violation - * 0b0..Interrupt condition has not occurred - * 0b1..Interrupt condition has occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define FLEXSPI_INTR_IPCMDSECUREVIO(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTR_IPCMDSECUREVIO_SHIFT)) & FLEXSPI_INTR_IPCMDSECUREVIO_MASK) - -#define FLEXSPI_INTR_AHBGCMERR_MASK (0x20000U) -#define FLEXSPI_INTR_AHBGCMERR_SHIFT (17U) -/*! AHBGCMERR - AHB Read GCM Error - * 0b0..Interrupt condition has not occurred - * 0b1..Interrupt condition has occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define FLEXSPI_INTR_AHBGCMERR(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_INTR_AHBGCMERR_SHIFT)) & FLEXSPI_INTR_AHBGCMERR_MASK) -/*! @} */ - -/*! @name LUTKEY - LUT Key */ -/*! @{ */ - -#define FLEXSPI_LUTKEY_KEY_MASK (0xFFFFFFFFU) -#define FLEXSPI_LUTKEY_KEY_SHIFT (0U) -/*! KEY - LUT Key */ -#define FLEXSPI_LUTKEY_KEY(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_LUTKEY_KEY_SHIFT)) & FLEXSPI_LUTKEY_KEY_MASK) -/*! @} */ - -/*! @name LUTCR - LUT Control */ -/*! @{ */ - -#define FLEXSPI_LUTCR_LOCK_MASK (0x1U) -#define FLEXSPI_LUTCR_LOCK_SHIFT (0U) -/*! LOCK - Lock LUT - * 0b0..LUT is unlocked (LUTCR[UNLOCK] must be 1) - * 0b1..LUT is locked and cannot be written - */ -#define FLEXSPI_LUTCR_LOCK(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_LUTCR_LOCK_SHIFT)) & FLEXSPI_LUTCR_LOCK_MASK) - -#define FLEXSPI_LUTCR_UNLOCK_MASK (0x2U) -#define FLEXSPI_LUTCR_UNLOCK_SHIFT (1U) -/*! UNLOCK - Unlock LUT - * 0b0..LUT is locked (LUTCR[LOCK] must be 1) - * 0b1..LUT is unlocked and can be written - */ -#define FLEXSPI_LUTCR_UNLOCK(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_LUTCR_UNLOCK_SHIFT)) & FLEXSPI_LUTCR_UNLOCK_MASK) - -#define FLEXSPI_LUTCR_PROTECT_MASK (0x4U) -#define FLEXSPI_LUTCR_PROTECT_SHIFT (2U) -/*! PROTECT - LUT Protection - * 0b0..Not protected. All IPS controllers can access LUTCR and LUT memory. - * 0b1..Protected. Only secure IPS controller can change the value of LUTCR and write to LUT memory. - */ -#define FLEXSPI_LUTCR_PROTECT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_LUTCR_PROTECT_SHIFT)) & FLEXSPI_LUTCR_PROTECT_MASK) -/*! @} */ - -/*! @name AHBRXBUFCR0 - AHB Receive Buffer 0 Control 0..AHB Receive Buffer 7 Control 0 */ -/*! @{ */ - -#define FLEXSPI_AHBRXBUFCR0_BUFSZ_MASK (0xFFU) -#define FLEXSPI_AHBRXBUFCR0_BUFSZ_SHIFT (0U) -/*! BUFSZ - AHB Receive Buffer Size */ -#define FLEXSPI_AHBRXBUFCR0_BUFSZ(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBRXBUFCR0_BUFSZ_SHIFT)) & FLEXSPI_AHBRXBUFCR0_BUFSZ_MASK) - -#define FLEXSPI_AHBRXBUFCR0_MSTRID_MASK (0x1F0000U) -#define FLEXSPI_AHBRXBUFCR0_MSTRID_SHIFT (16U) -/*! MSTRID - AHB Controller ID */ -#define FLEXSPI_AHBRXBUFCR0_MSTRID(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBRXBUFCR0_MSTRID_SHIFT)) & FLEXSPI_AHBRXBUFCR0_MSTRID_MASK) - -#define FLEXSPI_AHBRXBUFCR0_PRIORITY_MASK (0x7000000U) -#define FLEXSPI_AHBRXBUFCR0_PRIORITY_SHIFT (24U) -/*! PRIORITY - AHB Controller Read Priority */ -#define FLEXSPI_AHBRXBUFCR0_PRIORITY(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBRXBUFCR0_PRIORITY_SHIFT)) & FLEXSPI_AHBRXBUFCR0_PRIORITY_MASK) - -#define FLEXSPI_AHBRXBUFCR0_REGIONEN_MASK (0x40000000U) -#define FLEXSPI_AHBRXBUFCR0_REGIONEN_SHIFT (30U) -/*! REGIONEN - AHB Receive Buffer Address Region Enable - * 0b0..Disabled. The buffer hit is based on the value of MSTRID only. - * 0b1..Enabled. The buffer hit is based on the value of MSTRID and the address within AHBBUFREGIONSTARTn and AHBREGIONENDn. - */ -#define FLEXSPI_AHBRXBUFCR0_REGIONEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBRXBUFCR0_REGIONEN_SHIFT)) & FLEXSPI_AHBRXBUFCR0_REGIONEN_MASK) - -#define FLEXSPI_AHBRXBUFCR0_PREFETCHEN_MASK (0x80000000U) -#define FLEXSPI_AHBRXBUFCR0_PREFETCHEN_SHIFT (31U) -/*! PREFETCHEN - AHB Read Prefetch Enable - * 0b0..Disabled - * 0b1..Enabled when is enabled. - */ -#define FLEXSPI_AHBRXBUFCR0_PREFETCHEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBRXBUFCR0_PREFETCHEN_SHIFT)) & FLEXSPI_AHBRXBUFCR0_PREFETCHEN_MASK) -/*! @} */ - -/* The count of FLEXSPI_AHBRXBUFCR0 */ -#define FLEXSPI_AHBRXBUFCR0_COUNT (8U) - -/*! @name FLSHCR0 - Flash Control 0 */ -/*! @{ */ - -#define FLEXSPI_FLSHCR0_FLSHSZ_MASK (0x7FFFFFU) -#define FLEXSPI_FLSHCR0_FLSHSZ_SHIFT (0U) -/*! FLSHSZ - Flash Size in KB */ -#define FLEXSPI_FLSHCR0_FLSHSZ(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR0_FLSHSZ_SHIFT)) & FLEXSPI_FLSHCR0_FLSHSZ_MASK) - -#define FLEXSPI_FLSHCR0_ADDRSHIFT_MASK (0x20000000U) -#define FLEXSPI_FLSHCR0_ADDRSHIFT_SHIFT (29U) -/*! ADDRSHIFT - AHB Address Shift Function control - * 0b0..Disabled - * 0b1..Enabled - */ -#define FLEXSPI_FLSHCR0_ADDRSHIFT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR0_ADDRSHIFT_SHIFT)) & FLEXSPI_FLSHCR0_ADDRSHIFT_MASK) - -#define FLEXSPI_FLSHCR0_SPLITWREN_MASK (0x40000000U) -#define FLEXSPI_FLSHCR0_SPLITWREN_SHIFT (30U) -/*! SPLITWREN - AHB Write Access Split Function Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_FLSHCR0_SPLITWREN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR0_SPLITWREN_SHIFT)) & FLEXSPI_FLSHCR0_SPLITWREN_MASK) - -#define FLEXSPI_FLSHCR0_SPLITRDEN_MASK (0x80000000U) -#define FLEXSPI_FLSHCR0_SPLITRDEN_SHIFT (31U) -/*! SPLITRDEN - AHB Read Access Split Function Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_FLSHCR0_SPLITRDEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR0_SPLITRDEN_SHIFT)) & FLEXSPI_FLSHCR0_SPLITRDEN_MASK) -/*! @} */ - -/* The count of FLEXSPI_FLSHCR0 */ -#define FLEXSPI_FLSHCR0_COUNT (4U) - -/*! @name FLSHCR1 - Flash Control 1 */ -/*! @{ */ - -#define FLEXSPI_FLSHCR1_TCSS_MASK (0x1FU) -#define FLEXSPI_FLSHCR1_TCSS_SHIFT (0U) -/*! TCSS - Serial Flash CS Setup Time */ -#define FLEXSPI_FLSHCR1_TCSS(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR1_TCSS_SHIFT)) & FLEXSPI_FLSHCR1_TCSS_MASK) - -#define FLEXSPI_FLSHCR1_TCSH_MASK (0x3E0U) -#define FLEXSPI_FLSHCR1_TCSH_SHIFT (5U) -/*! TCSH - Serial Flash CS Hold Time */ -#define FLEXSPI_FLSHCR1_TCSH(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR1_TCSH_SHIFT)) & FLEXSPI_FLSHCR1_TCSH_MASK) - -#define FLEXSPI_FLSHCR1_WA_MASK (0x400U) -#define FLEXSPI_FLSHCR1_WA_SHIFT (10U) -/*! WA - Word-Addressable - * 0b0..Byte-addressable - * 0b1..Word-addressable - */ -#define FLEXSPI_FLSHCR1_WA(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR1_WA_SHIFT)) & FLEXSPI_FLSHCR1_WA_MASK) - -#define FLEXSPI_FLSHCR1_CAS_MASK (0x7800U) -#define FLEXSPI_FLSHCR1_CAS_SHIFT (11U) -/*! CAS - Column Address Size */ -#define FLEXSPI_FLSHCR1_CAS(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR1_CAS_SHIFT)) & FLEXSPI_FLSHCR1_CAS_MASK) - -#define FLEXSPI_FLSHCR1_CSINTERVALUNIT_MASK (0x8000U) -#define FLEXSPI_FLSHCR1_CSINTERVALUNIT_SHIFT (15U) -/*! CSINTERVALUNIT - Chip Select Interval Unit - * 0b0..1 serial clock cycle - * 0b1..256 serial clock cycles - */ -#define FLEXSPI_FLSHCR1_CSINTERVALUNIT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR1_CSINTERVALUNIT_SHIFT)) & FLEXSPI_FLSHCR1_CSINTERVALUNIT_MASK) - -#define FLEXSPI_FLSHCR1_CSINTERVAL_MASK (0xFFFF0000U) -#define FLEXSPI_FLSHCR1_CSINTERVAL_SHIFT (16U) -/*! CSINTERVAL - Chip Select Interval */ -#define FLEXSPI_FLSHCR1_CSINTERVAL(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR1_CSINTERVAL_SHIFT)) & FLEXSPI_FLSHCR1_CSINTERVAL_MASK) -/*! @} */ - -/* The count of FLEXSPI_FLSHCR1 */ -#define FLEXSPI_FLSHCR1_COUNT (4U) - -/*! @name FLSHCR2 - Flash Control 2 */ -/*! @{ */ - -#define FLEXSPI_FLSHCR2_ARDSEQID_MASK (0xFU) -#define FLEXSPI_FLSHCR2_ARDSEQID_SHIFT (0U) -/*! ARDSEQID - Sequence Index for AHB Read-Triggered Command in LUT */ -#define FLEXSPI_FLSHCR2_ARDSEQID(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR2_ARDSEQID_SHIFT)) & FLEXSPI_FLSHCR2_ARDSEQID_MASK) - -#define FLEXSPI_FLSHCR2_ARDSEQNUM_MASK (0xE0U) -#define FLEXSPI_FLSHCR2_ARDSEQNUM_SHIFT (5U) -/*! ARDSEQNUM - Sequence Number for AHB Read-Triggered Command */ -#define FLEXSPI_FLSHCR2_ARDSEQNUM(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR2_ARDSEQNUM_SHIFT)) & FLEXSPI_FLSHCR2_ARDSEQNUM_MASK) - -#define FLEXSPI_FLSHCR2_AWRSEQID_MASK (0xF00U) -#define FLEXSPI_FLSHCR2_AWRSEQID_SHIFT (8U) -/*! AWRSEQID - Sequence Index for AHB Write-Triggered Command */ -#define FLEXSPI_FLSHCR2_AWRSEQID(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR2_AWRSEQID_SHIFT)) & FLEXSPI_FLSHCR2_AWRSEQID_MASK) - -#define FLEXSPI_FLSHCR2_AWRSEQNUM_MASK (0xE000U) -#define FLEXSPI_FLSHCR2_AWRSEQNUM_SHIFT (13U) -/*! AWRSEQNUM - Sequence Number for AHB Write-Triggered Command */ -#define FLEXSPI_FLSHCR2_AWRSEQNUM(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR2_AWRSEQNUM_SHIFT)) & FLEXSPI_FLSHCR2_AWRSEQNUM_MASK) - -#define FLEXSPI_FLSHCR2_AWRWAIT_MASK (0xFFF0000U) -#define FLEXSPI_FLSHCR2_AWRWAIT_SHIFT (16U) -/*! AWRWAIT - AHB Write Wait */ -#define FLEXSPI_FLSHCR2_AWRWAIT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR2_AWRWAIT_SHIFT)) & FLEXSPI_FLSHCR2_AWRWAIT_MASK) - -#define FLEXSPI_FLSHCR2_AWRWAITUNIT_MASK (0x70000000U) -#define FLEXSPI_FLSHCR2_AWRWAITUNIT_SHIFT (28U) -/*! AWRWAITUNIT - AWRWAIT Unit - * 0b000..2 - * 0b001..8 - * 0b010..32 - * 0b011..128 - * 0b100..512 - * 0b101..2048 - * 0b110..8192 - * 0b111..32768 - */ -#define FLEXSPI_FLSHCR2_AWRWAITUNIT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR2_AWRWAITUNIT_SHIFT)) & FLEXSPI_FLSHCR2_AWRWAITUNIT_MASK) - -#define FLEXSPI_FLSHCR2_CLRINSTRPTR_MASK (0x80000000U) -#define FLEXSPI_FLSHCR2_CLRINSTRPTR_SHIFT (31U) -/*! CLRINSTRPTR - Clear Instruction Pointer */ -#define FLEXSPI_FLSHCR2_CLRINSTRPTR(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR2_CLRINSTRPTR_SHIFT)) & FLEXSPI_FLSHCR2_CLRINSTRPTR_MASK) -/*! @} */ - -/* The count of FLEXSPI_FLSHCR2 */ -#define FLEXSPI_FLSHCR2_COUNT (4U) - -/*! @name FLSHCR4 - Flash Control 4 */ -/*! @{ */ - -#define FLEXSPI_FLSHCR4_WMOPT1_MASK (0x1U) -#define FLEXSPI_FLSHCR4_WMOPT1_SHIFT (0U) -/*! WMOPT1 - Write Mask Option 1 - * 0b0..When writing to an external device, DQS pin is used as write mask. When flash memory is accessed in - * individual mode, AHB or IP write burst start address alignment is not limited. - * 0b1..When writing to an external device, DQS pin is not used as write mask. When flash memory is accessed in - * individual mode, AHB or IP write burst start address alignment is limited. - */ -#define FLEXSPI_FLSHCR4_WMOPT1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR4_WMOPT1_SHIFT)) & FLEXSPI_FLSHCR4_WMOPT1_MASK) - -#define FLEXSPI_FLSHCR4_WMENA_MASK (0x4U) -#define FLEXSPI_FLSHCR4_WMENA_SHIFT (2U) -/*! WMENA - Write Mask Enable for Port A - * 0b0..Disabled. When writing to external device, DQS(RWDS) pin is not driven. - * 0b1..Enabled. When writing to external device, FlexSPI drives DQS(RWDS) pin as write mask output. - */ -#define FLEXSPI_FLSHCR4_WMENA(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR4_WMENA_SHIFT)) & FLEXSPI_FLSHCR4_WMENA_MASK) - -#define FLEXSPI_FLSHCR4_WMENB_MASK (0x8U) -#define FLEXSPI_FLSHCR4_WMENB_SHIFT (3U) -/*! WMENB - Write Mask Enable for Port B - * 0b0..Disabled. When writing to external device, DQS(RWDS) pin is not driven. - * 0b1..Enabled. When writing to external device, FlexSPI drives DQS(RWDS) pin as write mask output. - */ -#define FLEXSPI_FLSHCR4_WMENB(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_FLSHCR4_WMENB_SHIFT)) & FLEXSPI_FLSHCR4_WMENB_MASK) -/*! @} */ - -/*! @name IPCR0 - IP Control 0 */ -/*! @{ */ - -#define FLEXSPI_IPCR0_SFAR_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPCR0_SFAR_SHIFT (0U) -/*! SFAR - Serial Flash Address */ -#define FLEXSPI_IPCR0_SFAR(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPCR0_SFAR_SHIFT)) & FLEXSPI_IPCR0_SFAR_MASK) -/*! @} */ - -/*! @name IPCR1 - IP Control 1 */ -/*! @{ */ - -#define FLEXSPI_IPCR1_IDATSZ_MASK (0xFFFFU) -#define FLEXSPI_IPCR1_IDATSZ_SHIFT (0U) -/*! IDATSZ - Flash Read/Program Data Size (in bytes) for IP command. */ -#define FLEXSPI_IPCR1_IDATSZ(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPCR1_IDATSZ_SHIFT)) & FLEXSPI_IPCR1_IDATSZ_MASK) - -#define FLEXSPI_IPCR1_ISEQID_MASK (0xF0000U) -#define FLEXSPI_IPCR1_ISEQID_SHIFT (16U) -/*! ISEQID - Sequence Index in LUT for IP command. */ -#define FLEXSPI_IPCR1_ISEQID(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPCR1_ISEQID_SHIFT)) & FLEXSPI_IPCR1_ISEQID_MASK) - -#define FLEXSPI_IPCR1_ISEQNUM_MASK (0x7000000U) -#define FLEXSPI_IPCR1_ISEQNUM_SHIFT (24U) -/*! ISEQNUM - Sequence Number for IP command: ISEQNUM+1. */ -#define FLEXSPI_IPCR1_ISEQNUM(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPCR1_ISEQNUM_SHIFT)) & FLEXSPI_IPCR1_ISEQNUM_MASK) - -#define FLEXSPI_IPCR1_IPAREN_MASK (0x80000000U) -#define FLEXSPI_IPCR1_IPAREN_SHIFT (31U) -/*! IPAREN - Parallel Mode Enable for IP Commands - * 0b0..Disabled. Flash memory is accessed in Individual mode. - * 0b1..Enabled. Flash memory is accessed in Parallel mode. - */ -#define FLEXSPI_IPCR1_IPAREN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPCR1_IPAREN_SHIFT)) & FLEXSPI_IPCR1_IPAREN_MASK) -/*! @} */ - -/*! @name IPCR2 - IP Control 2 */ -/*! @{ */ - -#define FLEXSPI_IPCR2_IPBLKAHBREQ_MASK (0x1U) -#define FLEXSPI_IPCR2_IPBLKAHBREQ_SHIFT (0U) -/*! IPBLKAHBREQ - IP Command Blocking AHB Command Request Enable - * 0b0..IP commands do not block AHB command requests. - * 0b1..IP commands block AHB command requests. - */ -#define FLEXSPI_IPCR2_IPBLKAHBREQ(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPCR2_IPBLKAHBREQ_SHIFT)) & FLEXSPI_IPCR2_IPBLKAHBREQ_MASK) - -#define FLEXSPI_IPCR2_IPBLKAHBACK_MASK (0x2U) -#define FLEXSPI_IPCR2_IPBLKAHBACK_SHIFT (1U) -/*! IPBLKAHBACK - IP Command Blocking AHB Command Acknowledgment Enable - * 0b0..IP commands do not block AHB command acknowledgment. - * 0b1..IP commands block AHB command acknowledgment. - */ -#define FLEXSPI_IPCR2_IPBLKAHBACK(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPCR2_IPBLKAHBACK_SHIFT)) & FLEXSPI_IPCR2_IPBLKAHBACK_MASK) - -#define FLEXSPI_IPCR2_IPBLKALLAHB_MASK (0x4U) -#define FLEXSPI_IPCR2_IPBLKALLAHB_SHIFT (2U) -/*! IPBLKALLAHB - IP Command Blocking All AHB Command Enable - * 0b0..IP commands only block AHB commands that affect the IPED region. - * 0b1..IP commands block all AHB commands. - */ -#define FLEXSPI_IPCR2_IPBLKALLAHB(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPCR2_IPBLKALLAHB_SHIFT)) & FLEXSPI_IPCR2_IPBLKALLAHB_MASK) -/*! @} */ - -/*! @name IPCMD - IP Command */ -/*! @{ */ - -#define FLEXSPI_IPCMD_TRG_MASK (0x1U) -#define FLEXSPI_IPCMD_TRG_SHIFT (0U) -/*! TRG - Command Trigger - * 0b0..No action - * 0b1..Start the IP command that the IPCR0 and IPCR1 registers define. - */ -#define FLEXSPI_IPCMD_TRG(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPCMD_TRG_SHIFT)) & FLEXSPI_IPCMD_TRG_MASK) -/*! @} */ - -/*! @name DLPR - Data Learning Pattern */ -/*! @{ */ - -#define FLEXSPI_DLPR_DLP_MASK (0xFFFFFFFFU) -#define FLEXSPI_DLPR_DLP_SHIFT (0U) -/*! DLP - Data Learning Pattern */ -#define FLEXSPI_DLPR_DLP(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_DLPR_DLP_SHIFT)) & FLEXSPI_DLPR_DLP_MASK) -/*! @} */ - -/*! @name IPRXFCR - IP Receive FIFO Control */ -/*! @{ */ - -#define FLEXSPI_IPRXFCR_CLRIPRXF_MASK (0x1U) -#define FLEXSPI_IPRXFCR_CLRIPRXF_SHIFT (0U) -/*! CLRIPRXF - Clear IP Receive FIFO - * 0b0..No function - * 0b1..A clock cycle pulse clears all valid data entries in IP receive FIFO. - */ -#define FLEXSPI_IPRXFCR_CLRIPRXF(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPRXFCR_CLRIPRXF_SHIFT)) & FLEXSPI_IPRXFCR_CLRIPRXF_MASK) - -#define FLEXSPI_IPRXFCR_RXDMAEN_MASK (0x2U) -#define FLEXSPI_IPRXFCR_RXDMAEN_SHIFT (1U) -/*! RXDMAEN - IP Receive FIFO Reading by DMA Enable - * 0b0..Disabled. The processor reads the FIFO. - * 0b1..Enabled. DMA reads the FIFO. - */ -#define FLEXSPI_IPRXFCR_RXDMAEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPRXFCR_RXDMAEN_SHIFT)) & FLEXSPI_IPRXFCR_RXDMAEN_MASK) - -#define FLEXSPI_IPRXFCR_RXWMRK_MASK (0x1FCU) -#define FLEXSPI_IPRXFCR_RXWMRK_SHIFT (2U) -/*! RXWMRK - IP Receive FIFO Watermark Level */ -#define FLEXSPI_IPRXFCR_RXWMRK(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPRXFCR_RXWMRK_SHIFT)) & FLEXSPI_IPRXFCR_RXWMRK_MASK) -/*! @} */ - -/*! @name IPTXFCR - IP Transmit FIFO Control */ -/*! @{ */ - -#define FLEXSPI_IPTXFCR_CLRIPTXF_MASK (0x1U) -#define FLEXSPI_IPTXFCR_CLRIPTXF_SHIFT (0U) -/*! CLRIPTXF - Clear IP Transmit FIFO - * 0b0..No function - * 0b1..A clock cycle pulse clears all valid data entries in the IP transmit FIFO. - */ -#define FLEXSPI_IPTXFCR_CLRIPTXF(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPTXFCR_CLRIPTXF_SHIFT)) & FLEXSPI_IPTXFCR_CLRIPTXF_MASK) - -#define FLEXSPI_IPTXFCR_TXDMAEN_MASK (0x2U) -#define FLEXSPI_IPTXFCR_TXDMAEN_SHIFT (1U) -/*! TXDMAEN - Transmit FIFO DMA Enable - * 0b0..Processor - * 0b1..DMA - */ -#define FLEXSPI_IPTXFCR_TXDMAEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPTXFCR_TXDMAEN_SHIFT)) & FLEXSPI_IPTXFCR_TXDMAEN_MASK) - -#define FLEXSPI_IPTXFCR_TXWMRK_MASK (0x1FCU) -#define FLEXSPI_IPTXFCR_TXWMRK_SHIFT (2U) -/*! TXWMRK - Transmit Watermark Level */ -#define FLEXSPI_IPTXFCR_TXWMRK(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPTXFCR_TXWMRK_SHIFT)) & FLEXSPI_IPTXFCR_TXWMRK_MASK) -/*! @} */ - -/*! @name DLLCR - DLL Control 0 */ -/*! @{ */ - -#define FLEXSPI_DLLCR_DLLEN_MASK (0x1U) -#define FLEXSPI_DLLCR_DLLEN_SHIFT (0U) -/*! DLLEN - DLL Calibration Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_DLLCR_DLLEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_DLLCR_DLLEN_SHIFT)) & FLEXSPI_DLLCR_DLLEN_MASK) - -#define FLEXSPI_DLLCR_DLLRESET_MASK (0x2U) -#define FLEXSPI_DLLCR_DLLRESET_SHIFT (1U) -/*! DLLRESET - DLL reset - * 0b0..No function - * 0b1..Force DLL reset. - */ -#define FLEXSPI_DLLCR_DLLRESET(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_DLLCR_DLLRESET_SHIFT)) & FLEXSPI_DLLCR_DLLRESET_MASK) - -#define FLEXSPI_DLLCR_SLVDLYTARGET_MASK (0x78U) -#define FLEXSPI_DLLCR_SLVDLYTARGET_SHIFT (3U) -/*! SLVDLYTARGET - Target Delay Line */ -#define FLEXSPI_DLLCR_SLVDLYTARGET(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_DLLCR_SLVDLYTARGET_SHIFT)) & FLEXSPI_DLLCR_SLVDLYTARGET_MASK) - -#define FLEXSPI_DLLCR_OVRDEN_MASK (0x100U) -#define FLEXSPI_DLLCR_OVRDEN_SHIFT (8U) -/*! OVRDEN - Target Clock Delay Line Override Value Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_DLLCR_OVRDEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_DLLCR_OVRDEN_SHIFT)) & FLEXSPI_DLLCR_OVRDEN_MASK) - -#define FLEXSPI_DLLCR_OVRDVAL_MASK (0x7E00U) -#define FLEXSPI_DLLCR_OVRDVAL_SHIFT (9U) -/*! OVRDVAL - Target Clock Delay Line Override Value */ -#define FLEXSPI_DLLCR_OVRDVAL(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_DLLCR_OVRDVAL_SHIFT)) & FLEXSPI_DLLCR_OVRDVAL_MASK) - -#define FLEXSPI_DLLCR_REFPHASEGAP_MASK (0x18000U) -#define FLEXSPI_DLLCR_REFPHASEGAP_SHIFT (15U) -/*! REFPHASEGAP - Reference Clock Delay Line Phase Adjust Gap. REFPHASEGAP setting of 2h is recommended if DLLEN is set. */ -#define FLEXSPI_DLLCR_REFPHASEGAP(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_DLLCR_REFPHASEGAP_SHIFT)) & FLEXSPI_DLLCR_REFPHASEGAP_MASK) -/*! @} */ - -/* The count of FLEXSPI_DLLCR */ -#define FLEXSPI_DLLCR_COUNT (2U) - -/*! @name STS0 - Status 0 */ -/*! @{ */ - -#define FLEXSPI_STS0_SEQIDLE_MASK (0x1U) -#define FLEXSPI_STS0_SEQIDLE_SHIFT (0U) -/*! SEQIDLE - SEQ_CTL State Machine Idle - * 0b0..Not idle - * 0b1..Idle - */ -#define FLEXSPI_STS0_SEQIDLE(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS0_SEQIDLE_SHIFT)) & FLEXSPI_STS0_SEQIDLE_MASK) - -#define FLEXSPI_STS0_ARBIDLE_MASK (0x2U) -#define FLEXSPI_STS0_ARBIDLE_SHIFT (1U) -/*! ARBIDLE - ARB_CTL State Machine Idle - * 0b0..Not idle - * 0b1..Idle - */ -#define FLEXSPI_STS0_ARBIDLE(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS0_ARBIDLE_SHIFT)) & FLEXSPI_STS0_ARBIDLE_MASK) - -#define FLEXSPI_STS0_ARBCMDSRC_MASK (0xCU) -#define FLEXSPI_STS0_ARBCMDSRC_SHIFT (2U) -/*! ARBCMDSRC - ARB Command Source - * 0b00..Trigger source is AHB read command. - * 0b01..Trigger source is AHB write command. - * 0b10..Trigger source is IP command (by writing 1 to IPCMD[TRG]). - * 0b11..Trigger source is a suspended command that has resumed. - */ -#define FLEXSPI_STS0_ARBCMDSRC(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS0_ARBCMDSRC_SHIFT)) & FLEXSPI_STS0_ARBCMDSRC_MASK) - -#define FLEXSPI_STS0_DATALEARNPHASEA_MASK (0xF0U) -#define FLEXSPI_STS0_DATALEARNPHASEA_SHIFT (4U) -/*! DATALEARNPHASEA - Data Learning Phase Selection on Port A */ -#define FLEXSPI_STS0_DATALEARNPHASEA(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS0_DATALEARNPHASEA_SHIFT)) & FLEXSPI_STS0_DATALEARNPHASEA_MASK) - -#define FLEXSPI_STS0_DATALEARNPHASEB_MASK (0xF00U) -#define FLEXSPI_STS0_DATALEARNPHASEB_SHIFT (8U) -/*! DATALEARNPHASEB - Data Learning Phase Selection on Port B */ -#define FLEXSPI_STS0_DATALEARNPHASEB(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS0_DATALEARNPHASEB_SHIFT)) & FLEXSPI_STS0_DATALEARNPHASEB_MASK) -/*! @} */ - -/*! @name STS1 - Status 1 */ -/*! @{ */ - -#define FLEXSPI_STS1_AHBCMDERRID_MASK (0xFU) -#define FLEXSPI_STS1_AHBCMDERRID_SHIFT (0U) -/*! AHBCMDERRID - AHB Command Error ID */ -#define FLEXSPI_STS1_AHBCMDERRID(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS1_AHBCMDERRID_SHIFT)) & FLEXSPI_STS1_AHBCMDERRID_MASK) - -#define FLEXSPI_STS1_AHBCMDERRCODE_MASK (0xF00U) -#define FLEXSPI_STS1_AHBCMDERRCODE_SHIFT (8U) -/*! AHBCMDERRCODE - AHB Command Error Code - * 0b0000..No error - * 0b0010..AHB Write command with JMP_ON_CS instruction used in the sequence - * 0b0011..Unknown instruction opcode in the sequence - * 0b0100..DUMMY_SDR or DUMMY_RWDS_SDR instruction used in DDR sequence - * 0b0101..DUMMY_DDR or DUMMY_RWDS_DDR instruction used in SDR sequence - * 0b1110..Sequence execution timeout - */ -#define FLEXSPI_STS1_AHBCMDERRCODE(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS1_AHBCMDERRCODE_SHIFT)) & FLEXSPI_STS1_AHBCMDERRCODE_MASK) - -#define FLEXSPI_STS1_IPCMDERRID_MASK (0xF0000U) -#define FLEXSPI_STS1_IPCMDERRID_SHIFT (16U) -/*! IPCMDERRID - IP Command Error ID */ -#define FLEXSPI_STS1_IPCMDERRID(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS1_IPCMDERRID_SHIFT)) & FLEXSPI_STS1_IPCMDERRID_MASK) - -#define FLEXSPI_STS1_IPCMDERRCODE_MASK (0xF000000U) -#define FLEXSPI_STS1_IPCMDERRCODE_SHIFT (24U) -/*! IPCMDERRCODE - IP Command Error Code - * 0b0000..No error - * 0b0010..IP command with JMP_ON_CS instruction used in the sequence - * 0b0011..Unknown instruction opcode in the sequence - * 0b0100..DUMMY_SDR or DUMMY_RWDS_SDR instruction used in DDR sequence - * 0b0101..DUMMY_DDR or DUMMY_RWDS_DDR instruction used in SDR sequence - * 0b0110..Flash memory access start address exceeds entire flash address range (A1, A2, B1, and B2) - * 0b1110..Sequence execution timeout - * 0b1111..Flash boundary crossed - */ -#define FLEXSPI_STS1_IPCMDERRCODE(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS1_IPCMDERRCODE_SHIFT)) & FLEXSPI_STS1_IPCMDERRCODE_MASK) -/*! @} */ - -/*! @name STS2 - Status 2 */ -/*! @{ */ - -#define FLEXSPI_STS2_ASLVLOCK_MASK (0x1U) -#define FLEXSPI_STS2_ASLVLOCK_SHIFT (0U) -/*! ASLVLOCK - Flash A Sample Target Delay Line Locked - * 0b0..Not locked - * 0b1..Locked - */ -#define FLEXSPI_STS2_ASLVLOCK(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS2_ASLVLOCK_SHIFT)) & FLEXSPI_STS2_ASLVLOCK_MASK) - -#define FLEXSPI_STS2_AREFLOCK_MASK (0x2U) -#define FLEXSPI_STS2_AREFLOCK_SHIFT (1U) -/*! AREFLOCK - Flash A Sample Clock Reference Delay Line Locked - * 0b0..Not locked - * 0b1..Locked - */ -#define FLEXSPI_STS2_AREFLOCK(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS2_AREFLOCK_SHIFT)) & FLEXSPI_STS2_AREFLOCK_MASK) - -#define FLEXSPI_STS2_ASLVSEL_MASK (0xFCU) -#define FLEXSPI_STS2_ASLVSEL_SHIFT (2U) -/*! ASLVSEL - Flash A Sample Clock Target Delay Line Delay Cell Number */ -#define FLEXSPI_STS2_ASLVSEL(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS2_ASLVSEL_SHIFT)) & FLEXSPI_STS2_ASLVSEL_MASK) - -#define FLEXSPI_STS2_AREFSEL_MASK (0x3F00U) -#define FLEXSPI_STS2_AREFSEL_SHIFT (8U) -/*! AREFSEL - Flash A Sample Clock Reference Delay Line Delay Cell Number */ -#define FLEXSPI_STS2_AREFSEL(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS2_AREFSEL_SHIFT)) & FLEXSPI_STS2_AREFSEL_MASK) - -#define FLEXSPI_STS2_BSLVLOCK_MASK (0x10000U) -#define FLEXSPI_STS2_BSLVLOCK_SHIFT (16U) -/*! BSLVLOCK - Flash B Sample Target Reference Delay Line Locked - * 0b0..Not locked - * 0b1..Locked - */ -#define FLEXSPI_STS2_BSLVLOCK(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS2_BSLVLOCK_SHIFT)) & FLEXSPI_STS2_BSLVLOCK_MASK) - -#define FLEXSPI_STS2_BREFLOCK_MASK (0x20000U) -#define FLEXSPI_STS2_BREFLOCK_SHIFT (17U) -/*! BREFLOCK - Flash B Sample Clock Reference Delay Line Locked - * 0b0..Not locked - * 0b1..Locked - */ -#define FLEXSPI_STS2_BREFLOCK(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS2_BREFLOCK_SHIFT)) & FLEXSPI_STS2_BREFLOCK_MASK) - -#define FLEXSPI_STS2_BSLVSEL_MASK (0xFC0000U) -#define FLEXSPI_STS2_BSLVSEL_SHIFT (18U) -/*! BSLVSEL - Flash B Sample Clock Target Delay Line Delay Cell Number */ -#define FLEXSPI_STS2_BSLVSEL(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS2_BSLVSEL_SHIFT)) & FLEXSPI_STS2_BSLVSEL_MASK) - -#define FLEXSPI_STS2_BREFSEL_MASK (0x3F000000U) -#define FLEXSPI_STS2_BREFSEL_SHIFT (24U) -/*! BREFSEL - Flash B Sample Clock Reference Delay Line Delay Cell Number */ -#define FLEXSPI_STS2_BREFSEL(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_STS2_BREFSEL_SHIFT)) & FLEXSPI_STS2_BREFSEL_MASK) -/*! @} */ - -/*! @name AHBSPNDSTS - AHB Suspend Status */ -/*! @{ */ - -#define FLEXSPI_AHBSPNDSTS_ACTIVE_MASK (0x1U) -#define FLEXSPI_AHBSPNDSTS_ACTIVE_SHIFT (0U) -/*! ACTIVE - Active AHB Read Prefetch Suspended - * 0b0..No suspended AHB read prefetch command. - * 0b1..An AHB read prefetch command sequence has been suspended. - */ -#define FLEXSPI_AHBSPNDSTS_ACTIVE(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBSPNDSTS_ACTIVE_SHIFT)) & FLEXSPI_AHBSPNDSTS_ACTIVE_MASK) - -#define FLEXSPI_AHBSPNDSTS_BUFID_MASK (0xEU) -#define FLEXSPI_AHBSPNDSTS_BUFID_SHIFT (1U) -/*! BUFID - AHB Receive Buffer ID for Suspended Command Sequence */ -#define FLEXSPI_AHBSPNDSTS_BUFID(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBSPNDSTS_BUFID_SHIFT)) & FLEXSPI_AHBSPNDSTS_BUFID_MASK) - -#define FLEXSPI_AHBSPNDSTS_DATLFT_MASK (0xFFFF0000U) -#define FLEXSPI_AHBSPNDSTS_DATLFT_SHIFT (16U) -/*! DATLFT - Data Left */ -#define FLEXSPI_AHBSPNDSTS_DATLFT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBSPNDSTS_DATLFT_SHIFT)) & FLEXSPI_AHBSPNDSTS_DATLFT_MASK) -/*! @} */ - -/*! @name IPRXFSTS - IP Receive FIFO Status */ -/*! @{ */ - -#define FLEXSPI_IPRXFSTS_FILL_MASK (0xFFU) -#define FLEXSPI_IPRXFSTS_FILL_SHIFT (0U) -/*! FILL - Fill Level of IP Receive FIFO */ -#define FLEXSPI_IPRXFSTS_FILL(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPRXFSTS_FILL_SHIFT)) & FLEXSPI_IPRXFSTS_FILL_MASK) - -#define FLEXSPI_IPRXFSTS_RDCNTR_MASK (0xFFFF0000U) -#define FLEXSPI_IPRXFSTS_RDCNTR_SHIFT (16U) -/*! RDCNTR - Read Data Counter */ -#define FLEXSPI_IPRXFSTS_RDCNTR(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPRXFSTS_RDCNTR_SHIFT)) & FLEXSPI_IPRXFSTS_RDCNTR_MASK) -/*! @} */ - -/*! @name IPTXFSTS - IP Transmit FIFO Status */ -/*! @{ */ - -#define FLEXSPI_IPTXFSTS_FILL_MASK (0xFFU) -#define FLEXSPI_IPTXFSTS_FILL_SHIFT (0U) -/*! FILL - Fill Level of IP Transmit FIFO */ -#define FLEXSPI_IPTXFSTS_FILL(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPTXFSTS_FILL_SHIFT)) & FLEXSPI_IPTXFSTS_FILL_MASK) - -#define FLEXSPI_IPTXFSTS_WRCNTR_MASK (0xFFFF0000U) -#define FLEXSPI_IPTXFSTS_WRCNTR_SHIFT (16U) -/*! WRCNTR - Write Data Counter */ -#define FLEXSPI_IPTXFSTS_WRCNTR(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPTXFSTS_WRCNTR_SHIFT)) & FLEXSPI_IPTXFSTS_WRCNTR_MASK) -/*! @} */ - -/*! @name RFDR - IP Receive FIFO Data 0..IP Receive FIFO Data 31 */ -/*! @{ */ - -#define FLEXSPI_RFDR_RXDATA_MASK (0xFFFFFFFFU) -#define FLEXSPI_RFDR_RXDATA_SHIFT (0U) -/*! RXDATA - Receive Data */ -#define FLEXSPI_RFDR_RXDATA(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_RFDR_RXDATA_SHIFT)) & FLEXSPI_RFDR_RXDATA_MASK) -/*! @} */ - -/* The count of FLEXSPI_RFDR */ -#define FLEXSPI_RFDR_COUNT (32U) - -/*! @name TFDR - IP TX FIFO Data 0..IP TX FIFO Data 31 */ -/*! @{ */ - -#define FLEXSPI_TFDR_TXDATA_MASK (0xFFFFFFFFU) -#define FLEXSPI_TFDR_TXDATA_SHIFT (0U) -/*! TXDATA - Transmit Data */ -#define FLEXSPI_TFDR_TXDATA(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_TFDR_TXDATA_SHIFT)) & FLEXSPI_TFDR_TXDATA_MASK) -/*! @} */ - -/* The count of FLEXSPI_TFDR */ -#define FLEXSPI_TFDR_COUNT (32U) - -/*! @name LUT - Lookup Table 0..Lookup Table 63 */ -/*! @{ */ - -#define FLEXSPI_LUT_OPERAND0_MASK (0xFFU) -#define FLEXSPI_LUT_OPERAND0_SHIFT (0U) -/*! OPERAND0 - OPERAND0 */ -#define FLEXSPI_LUT_OPERAND0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_LUT_OPERAND0_SHIFT)) & FLEXSPI_LUT_OPERAND0_MASK) - -#define FLEXSPI_LUT_NUM_PADS0_MASK (0x300U) -#define FLEXSPI_LUT_NUM_PADS0_SHIFT (8U) -/*! NUM_PADS0 - NUM_PADS0 */ -#define FLEXSPI_LUT_NUM_PADS0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_LUT_NUM_PADS0_SHIFT)) & FLEXSPI_LUT_NUM_PADS0_MASK) - -#define FLEXSPI_LUT_OPCODE0_MASK (0xFC00U) -#define FLEXSPI_LUT_OPCODE0_SHIFT (10U) -/*! OPCODE0 - OPCODE */ -#define FLEXSPI_LUT_OPCODE0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_LUT_OPCODE0_SHIFT)) & FLEXSPI_LUT_OPCODE0_MASK) - -#define FLEXSPI_LUT_OPERAND1_MASK (0xFF0000U) -#define FLEXSPI_LUT_OPERAND1_SHIFT (16U) -/*! OPERAND1 - OPERAND1 */ -#define FLEXSPI_LUT_OPERAND1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_LUT_OPERAND1_SHIFT)) & FLEXSPI_LUT_OPERAND1_MASK) - -#define FLEXSPI_LUT_NUM_PADS1_MASK (0x3000000U) -#define FLEXSPI_LUT_NUM_PADS1_SHIFT (24U) -/*! NUM_PADS1 - NUM_PADS1 */ -#define FLEXSPI_LUT_NUM_PADS1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_LUT_NUM_PADS1_SHIFT)) & FLEXSPI_LUT_NUM_PADS1_MASK) - -#define FLEXSPI_LUT_OPCODE1_MASK (0xFC000000U) -#define FLEXSPI_LUT_OPCODE1_SHIFT (26U) -/*! OPCODE1 - OPCODE1 */ -#define FLEXSPI_LUT_OPCODE1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_LUT_OPCODE1_SHIFT)) & FLEXSPI_LUT_OPCODE1_MASK) -/*! @} */ - -/* The count of FLEXSPI_LUT */ -#define FLEXSPI_LUT_COUNT (64U) - -/*! @name HADDRSTART - HADDR REMAP Start Address */ -/*! @{ */ - -#define FLEXSPI_HADDRSTART_REMAPEN_MASK (0x1U) -#define FLEXSPI_HADDRSTART_REMAPEN_SHIFT (0U) -/*! REMAPEN - AHB Bus Address Remap Enable - * 0b0..HADDR REMAP Disabled - * 0b1..HADDR REMAP Enabled - */ -#define FLEXSPI_HADDRSTART_REMAPEN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_HADDRSTART_REMAPEN_SHIFT)) & FLEXSPI_HADDRSTART_REMAPEN_MASK) - -#define FLEXSPI_HADDRSTART_ADDRSTART_MASK (0xFFFFF000U) -#define FLEXSPI_HADDRSTART_ADDRSTART_SHIFT (12U) -/*! ADDRSTART - HADDR Start Address */ -#define FLEXSPI_HADDRSTART_ADDRSTART(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_HADDRSTART_ADDRSTART_SHIFT)) & FLEXSPI_HADDRSTART_ADDRSTART_MASK) -/*! @} */ - -/*! @name HADDREND - HADDR REMAP END ADDR */ -/*! @{ */ - -#define FLEXSPI_HADDREND_ENDSTART_MASK (0xFFFFF000U) -#define FLEXSPI_HADDREND_ENDSTART_SHIFT (12U) -/*! ENDSTART - End Address of HADDR Remap Range */ -#define FLEXSPI_HADDREND_ENDSTART(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_HADDREND_ENDSTART_SHIFT)) & FLEXSPI_HADDREND_ENDSTART_MASK) -/*! @} */ - -/*! @name HADDROFFSET - HADDR Remap Offset */ -/*! @{ */ - -#define FLEXSPI_HADDROFFSET_ADDROFFSET_MASK (0xFFFFF000U) -#define FLEXSPI_HADDROFFSET_ADDROFFSET_SHIFT (12U) -/*! ADDROFFSET - HADDR Offset */ -#define FLEXSPI_HADDROFFSET_ADDROFFSET(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_HADDROFFSET_ADDROFFSET_SHIFT)) & FLEXSPI_HADDROFFSET_ADDROFFSET_MASK) -/*! @} */ - -/*! @name IPEDCTRL - IPED Function Control */ -/*! @{ */ - -#define FLEXSPI_IPEDCTRL_CONFIG_MASK (0x1U) -#define FLEXSPI_IPEDCTRL_CONFIG_SHIFT (0U) -/*! CONFIG - IPED Mode Select - * 0b0..Fully pipelined - * 0b1..Not fully pipelined - */ -#define FLEXSPI_IPEDCTRL_CONFIG(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTRL_CONFIG_SHIFT)) & FLEXSPI_IPEDCTRL_CONFIG_MASK) - -#define FLEXSPI_IPEDCTRL_IPED_EN_MASK (0x2U) -#define FLEXSPI_IPEDCTRL_IPED_EN_SHIFT (1U) -/*! IPED_EN - IPED Encryption and Decryption Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_IPEDCTRL_IPED_EN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTRL_IPED_EN_SHIFT)) & FLEXSPI_IPEDCTRL_IPED_EN_MASK) - -#define FLEXSPI_IPEDCTRL_IPWR_EN_MASK (0x4U) -#define FLEXSPI_IPEDCTRL_IPWR_EN_SHIFT (2U) -/*! IPWR_EN - IP Write IPED CTR Mode Encryption Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_IPEDCTRL_IPWR_EN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTRL_IPWR_EN_SHIFT)) & FLEXSPI_IPEDCTRL_IPWR_EN_MASK) - -#define FLEXSPI_IPEDCTRL_AHBWR_EN_MASK (0x8U) -#define FLEXSPI_IPEDCTRL_AHBWR_EN_SHIFT (3U) -/*! AHBWR_EN - AHB Write IPED CTR Mode Encryption Enable. - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_IPEDCTRL_AHBWR_EN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTRL_AHBWR_EN_SHIFT)) & FLEXSPI_IPEDCTRL_AHBWR_EN_MASK) - -#define FLEXSPI_IPEDCTRL_AHBRD_EN_MASK (0x10U) -#define FLEXSPI_IPEDCTRL_AHBRD_EN_SHIFT (4U) -/*! AHBRD_EN - AHB Read IPED CTR Mode Decryption Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_IPEDCTRL_AHBRD_EN(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTRL_AHBRD_EN_SHIFT)) & FLEXSPI_IPEDCTRL_AHBRD_EN_MASK) - -#define FLEXSPI_IPEDCTRL_IPGCMWR_MASK (0x40U) -#define FLEXSPI_IPEDCTRL_IPGCMWR_SHIFT (6U) -/*! IPGCMWR - IP Write GCM Mode Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define FLEXSPI_IPEDCTRL_IPGCMWR(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTRL_IPGCMWR_SHIFT)) & FLEXSPI_IPEDCTRL_IPGCMWR_MASK) - -#define FLEXSPI_IPEDCTRL_AHGCMWR_MASK (0x80U) -#define FLEXSPI_IPEDCTRL_AHGCMWR_SHIFT (7U) -/*! AHGCMWR - AHB Write IPED GCM Mode Encryption Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_IPEDCTRL_AHGCMWR(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTRL_AHGCMWR_SHIFT)) & FLEXSPI_IPEDCTRL_AHGCMWR_MASK) - -#define FLEXSPI_IPEDCTRL_AHBGCMRD_MASK (0x100U) -#define FLEXSPI_IPEDCTRL_AHBGCMRD_SHIFT (8U) -/*! AHBGCMRD - AHB Read IPED GCM Mode Decryption Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FLEXSPI_IPEDCTRL_AHBGCMRD(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTRL_AHBGCMRD_SHIFT)) & FLEXSPI_IPEDCTRL_AHBGCMRD_MASK) - -#define FLEXSPI_IPEDCTRL_IPED_PROTECT_MASK (0x200U) -#define FLEXSPI_IPEDCTRL_IPED_PROTECT_SHIFT (9U) -/*! IPED_PROTECT - IPED Protection - * 0b0..No restrictions - * 0b1..Only privileged controllers can write IPED registers. - */ -#define FLEXSPI_IPEDCTRL_IPED_PROTECT(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTRL_IPED_PROTECT_SHIFT)) & FLEXSPI_IPEDCTRL_IPED_PROTECT_MASK) - -#define FLEXSPI_IPEDCTRL_IPED_SWRESET_MASK (0x400U) -#define FLEXSPI_IPEDCTRL_IPED_SWRESET_SHIFT (10U) -/*! IPED_SWRESET - Abort Current Decryption or Encryption - * 0b0..No function. - * 0b1..Aborts current decryption or encryption and waits for the next start operation. - */ -#define FLEXSPI_IPEDCTRL_IPED_SWRESET(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTRL_IPED_SWRESET_SHIFT)) & FLEXSPI_IPEDCTRL_IPED_SWRESET_MASK) -/*! @} */ - -/*! @name IPSNSZSTART0 - IPS Nonsecure Region 0 Start Address */ -/*! @{ */ - -#define FLEXSPI_IPSNSZSTART0_start_address_MASK (0xFFFFF000U) -#define FLEXSPI_IPSNSZSTART0_start_address_SHIFT (12U) -/*! start_address - Start Address of Nonsecure Region */ -#define FLEXSPI_IPSNSZSTART0_start_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPSNSZSTART0_start_address_SHIFT)) & FLEXSPI_IPSNSZSTART0_start_address_MASK) -/*! @} */ - -/*! @name IPSNSZEND0 - IPS Nonsecure Region 0 End Address */ -/*! @{ */ - -#define FLEXSPI_IPSNSZEND0_end_address_MASK (0xFFFFF000U) -#define FLEXSPI_IPSNSZEND0_end_address_SHIFT (12U) -/*! end_address - End Address of Nonsecure Region */ -#define FLEXSPI_IPSNSZEND0_end_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPSNSZEND0_end_address_SHIFT)) & FLEXSPI_IPSNSZEND0_end_address_MASK) -/*! @} */ - -/*! @name IPSNSZSTART1 - IPS Nonsecure Region 1 Start Address */ -/*! @{ */ - -#define FLEXSPI_IPSNSZSTART1_start_address_MASK (0xFFFFF000U) -#define FLEXSPI_IPSNSZSTART1_start_address_SHIFT (12U) -/*! start_address - Start Address of Nonsecure Region */ -#define FLEXSPI_IPSNSZSTART1_start_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPSNSZSTART1_start_address_SHIFT)) & FLEXSPI_IPSNSZSTART1_start_address_MASK) -/*! @} */ - -/*! @name IPSNSZEND1 - IPS Nonsecure Region 1 End Address */ -/*! @{ */ - -#define FLEXSPI_IPSNSZEND1_end_address_MASK (0xFFFFF000U) -#define FLEXSPI_IPSNSZEND1_end_address_SHIFT (12U) -/*! end_address - End Address of Nonsecure Region */ -#define FLEXSPI_IPSNSZEND1_end_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPSNSZEND1_end_address_SHIFT)) & FLEXSPI_IPSNSZEND1_end_address_MASK) -/*! @} */ - -/*! @name AHBBUFREGIONSTART0 - Receive Buffer Start Address of Region 0 */ -/*! @{ */ - -#define FLEXSPI_AHBBUFREGIONSTART0_START_ADDRESS_MASK (0xFFFFF000U) -#define FLEXSPI_AHBBUFREGIONSTART0_START_ADDRESS_SHIFT (12U) -/*! START_ADDRESS - Start Address of Prefetch Sub-Buffer Region */ -#define FLEXSPI_AHBBUFREGIONSTART0_START_ADDRESS(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBBUFREGIONSTART0_START_ADDRESS_SHIFT)) & FLEXSPI_AHBBUFREGIONSTART0_START_ADDRESS_MASK) -/*! @} */ - -/*! @name AHBBUFREGIONEND0 - Receive Buffer Region 0 End Address */ -/*! @{ */ - -#define FLEXSPI_AHBBUFREGIONEND0_END_ADDRESS_MASK (0xFFFFF000U) -#define FLEXSPI_AHBBUFREGIONEND0_END_ADDRESS_SHIFT (12U) -/*! END_ADDRESS - End Address of Prefetch Sub-Buffer Region */ -#define FLEXSPI_AHBBUFREGIONEND0_END_ADDRESS(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBBUFREGIONEND0_END_ADDRESS_SHIFT)) & FLEXSPI_AHBBUFREGIONEND0_END_ADDRESS_MASK) -/*! @} */ - -/*! @name AHBBUFREGIONSTART1 - Receive Buffer Start Address of Region 1 */ -/*! @{ */ - -#define FLEXSPI_AHBBUFREGIONSTART1_START_ADDRESS_MASK (0xFFFFF000U) -#define FLEXSPI_AHBBUFREGIONSTART1_START_ADDRESS_SHIFT (12U) -/*! START_ADDRESS - Start Address of Prefetch Sub-Buffer Region */ -#define FLEXSPI_AHBBUFREGIONSTART1_START_ADDRESS(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBBUFREGIONSTART1_START_ADDRESS_SHIFT)) & FLEXSPI_AHBBUFREGIONSTART1_START_ADDRESS_MASK) -/*! @} */ - -/*! @name AHBBUFREGIONEND1 - Receive Buffer Region 1 End Address */ -/*! @{ */ - -#define FLEXSPI_AHBBUFREGIONEND1_END_ADDRESS_MASK (0xFFFFF000U) -#define FLEXSPI_AHBBUFREGIONEND1_END_ADDRESS_SHIFT (12U) -/*! END_ADDRESS - End Address of Prefetch Sub-Buffer Region */ -#define FLEXSPI_AHBBUFREGIONEND1_END_ADDRESS(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBBUFREGIONEND1_END_ADDRESS_SHIFT)) & FLEXSPI_AHBBUFREGIONEND1_END_ADDRESS_MASK) -/*! @} */ - -/*! @name AHBBUFREGIONSTART2 - Receive Buffer Start Address of Region 2 */ -/*! @{ */ - -#define FLEXSPI_AHBBUFREGIONSTART2_START_ADDRESS_MASK (0xFFFFF000U) -#define FLEXSPI_AHBBUFREGIONSTART2_START_ADDRESS_SHIFT (12U) -/*! START_ADDRESS - Start Address of Prefetch Sub-Buffer Region */ -#define FLEXSPI_AHBBUFREGIONSTART2_START_ADDRESS(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBBUFREGIONSTART2_START_ADDRESS_SHIFT)) & FLEXSPI_AHBBUFREGIONSTART2_START_ADDRESS_MASK) -/*! @} */ - -/*! @name AHBBUFREGIONEND2 - Receive Buffer Region 2 End Address */ -/*! @{ */ - -#define FLEXSPI_AHBBUFREGIONEND2_END_ADDRESS_MASK (0xFFFFF000U) -#define FLEXSPI_AHBBUFREGIONEND2_END_ADDRESS_SHIFT (12U) -/*! END_ADDRESS - End Address of Prefetch Sub-Buffer Region */ -#define FLEXSPI_AHBBUFREGIONEND2_END_ADDRESS(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBBUFREGIONEND2_END_ADDRESS_SHIFT)) & FLEXSPI_AHBBUFREGIONEND2_END_ADDRESS_MASK) -/*! @} */ - -/*! @name AHBBUFREGIONSTART3 - Receive Buffer Start Address of Region 3 */ -/*! @{ */ - -#define FLEXSPI_AHBBUFREGIONSTART3_START_ADDRESS_MASK (0xFFFFF000U) -#define FLEXSPI_AHBBUFREGIONSTART3_START_ADDRESS_SHIFT (12U) -/*! START_ADDRESS - Start Address of Prefetch Sub-Buffer Region */ -#define FLEXSPI_AHBBUFREGIONSTART3_START_ADDRESS(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBBUFREGIONSTART3_START_ADDRESS_SHIFT)) & FLEXSPI_AHBBUFREGIONSTART3_START_ADDRESS_MASK) -/*! @} */ - -/*! @name AHBBUFREGIONEND3 - Receive Buffer Region 3 End Address */ -/*! @{ */ - -#define FLEXSPI_AHBBUFREGIONEND3_END_ADDRESS_MASK (0xFFFFF000U) -#define FLEXSPI_AHBBUFREGIONEND3_END_ADDRESS_SHIFT (12U) -/*! END_ADDRESS - End Address of Prefetch Sub-Buffer Region */ -#define FLEXSPI_AHBBUFREGIONEND3_END_ADDRESS(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_AHBBUFREGIONEND3_END_ADDRESS_SHIFT)) & FLEXSPI_AHBBUFREGIONEND3_END_ADDRESS_MASK) -/*! @} */ - -/*! @name IPEDCTXCTRLX_IPEDCTXCTRL - IPED context control 0..IPED context control 1 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX0_FREEZE0_MASK (0x3U) -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX0_FREEZE0_SHIFT (0U) -/*! CTX0_FREEZE0 - Context Register Freeze for Region 0 */ -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX0_FREEZE0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX0_FREEZE0_SHIFT)) & FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX0_FREEZE0_MASK) - -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX0_FREEZE1_MASK (0x3U) -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX0_FREEZE1_SHIFT (0U) -/*! CTX0_FREEZE1 - Context Register Freeze for Region 0 */ -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX0_FREEZE1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX0_FREEZE1_SHIFT)) & FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX0_FREEZE1_MASK) - -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX1_FREEZE0_MASK (0xCU) -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX1_FREEZE0_SHIFT (2U) -/*! CTX1_FREEZE0 - Context Register Freeze for Region 1 */ -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX1_FREEZE0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX1_FREEZE0_SHIFT)) & FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX1_FREEZE0_MASK) - -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX1_FREEZE1_MASK (0xCU) -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX1_FREEZE1_SHIFT (2U) -/*! CTX1_FREEZE1 - Context Register Freeze for Region 1 */ -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX1_FREEZE1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX1_FREEZE1_SHIFT)) & FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX1_FREEZE1_MASK) - -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX2_FREEZE0_MASK (0x30U) -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX2_FREEZE0_SHIFT (4U) -/*! CTX2_FREEZE0 - Context Register Freeze for Region 2 */ -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX2_FREEZE0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX2_FREEZE0_SHIFT)) & FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX2_FREEZE0_MASK) - -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX2_FREEZE1_MASK (0x30U) -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX2_FREEZE1_SHIFT (4U) -/*! CTX2_FREEZE1 - Context Register Freeze for Region 2 */ -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX2_FREEZE1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX2_FREEZE1_SHIFT)) & FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX2_FREEZE1_MASK) - -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX3_FREEZE0_MASK (0xC0U) -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX3_FREEZE0_SHIFT (6U) -/*! CTX3_FREEZE0 - Context Register Freeze for Region 3 */ -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX3_FREEZE0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX3_FREEZE0_SHIFT)) & FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX3_FREEZE0_MASK) - -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX3_FREEZE1_MASK (0xC0U) -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX3_FREEZE1_SHIFT (6U) -/*! CTX3_FREEZE1 - Context Register Freeze for Region 3 */ -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX3_FREEZE1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX3_FREEZE1_SHIFT)) & FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX3_FREEZE1_MASK) - -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX4_FREEZE0_MASK (0x300U) -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX4_FREEZE0_SHIFT (8U) -/*! CTX4_FREEZE0 - Context Register Freeze for Region 4 */ -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX4_FREEZE0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX4_FREEZE0_SHIFT)) & FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX4_FREEZE0_MASK) - -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX4_FREEZE1_MASK (0x300U) -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX4_FREEZE1_SHIFT (8U) -/*! CTX4_FREEZE1 - Context Register Freeze for Region 4 */ -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX4_FREEZE1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX4_FREEZE1_SHIFT)) & FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX4_FREEZE1_MASK) - -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX5_FREEZE0_MASK (0xC00U) -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX5_FREEZE0_SHIFT (10U) -/*! CTX5_FREEZE0 - Context Register Freeze for Region 5 */ -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX5_FREEZE0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX5_FREEZE0_SHIFT)) & FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX5_FREEZE0_MASK) - -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX5_FREEZE1_MASK (0xC00U) -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX5_FREEZE1_SHIFT (10U) -/*! CTX5_FREEZE1 - Context Register Freeze for Region 5 */ -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX5_FREEZE1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX5_FREEZE1_SHIFT)) & FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX5_FREEZE1_MASK) - -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX6_FREEZE0_MASK (0x3000U) -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX6_FREEZE0_SHIFT (12U) -/*! CTX6_FREEZE0 - Context Register Freeze for Region 6 */ -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX6_FREEZE0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX6_FREEZE0_SHIFT)) & FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX6_FREEZE0_MASK) - -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX6_FREEZE1_MASK (0x3000U) -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX6_FREEZE1_SHIFT (12U) -/*! CTX6_FREEZE1 - Context Register Freeze for Region 6 */ -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX6_FREEZE1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX6_FREEZE1_SHIFT)) & FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_CTX6_FREEZE1_MASK) -/*! @} */ - -/* The count of FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL */ -#define FLEXSPI_IPEDCTXCTRLX_IPEDCTXCTRL_COUNT (2U) - -/*! @name IPEDCTX0IV0 - IPED Context0 IV0 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX0IV0_CTX0_IV0_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX0IV0_CTX0_IV0_SHIFT (0U) -/*! CTX0_IV0 - Lowest 32 bits of IV for region 0. */ -#define FLEXSPI_IPEDCTX0IV0_CTX0_IV0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX0IV0_CTX0_IV0_SHIFT)) & FLEXSPI_IPEDCTX0IV0_CTX0_IV0_MASK) -/*! @} */ - -/*! @name IPEDCTX0IV1 - IPED Context0 IV1 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX0IV1_CTX0_IV1_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX0IV1_CTX0_IV1_SHIFT (0U) -/*! CTX0_IV1 - Highest 32 bits of IV for region 0. */ -#define FLEXSPI_IPEDCTX0IV1_CTX0_IV1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX0IV1_CTX0_IV1_SHIFT)) & FLEXSPI_IPEDCTX0IV1_CTX0_IV1_MASK) -/*! @} */ - -/*! @name IPEDCTX0START - Start Address of Region */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX0START_GCM_MASK (0x1U) -#define FLEXSPI_IPEDCTX0START_GCM_SHIFT (0U) -/*! GCM - GCM Mode Enable - * 0b0..Disabled. CTR mode is used. - * 0b1..Enabled. GCM mode is used. - */ -#define FLEXSPI_IPEDCTX0START_GCM(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX0START_GCM_SHIFT)) & FLEXSPI_IPEDCTX0START_GCM_MASK) - -#define FLEXSPI_IPEDCTX0START_ahbbuserror_dis_MASK (0x2U) -#define FLEXSPI_IPEDCTX0START_ahbbuserror_dis_SHIFT (1U) -/*! ahbbuserror_dis - AHB Bus Error Disable - * 0b0..AHB bus errors enabled - * 0b1..AHB bus errors disabled - */ -#define FLEXSPI_IPEDCTX0START_ahbbuserror_dis(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX0START_ahbbuserror_dis_SHIFT)) & FLEXSPI_IPEDCTX0START_ahbbuserror_dis_MASK) - -#define FLEXSPI_IPEDCTX0START_start_address_MASK (0xFFFFFF00U) -#define FLEXSPI_IPEDCTX0START_start_address_SHIFT (8U) -/*! start_address - Start Address */ -#define FLEXSPI_IPEDCTX0START_start_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX0START_start_address_SHIFT)) & FLEXSPI_IPEDCTX0START_start_address_MASK) -/*! @} */ - -/*! @name IPEDCTX0END - End Address of Region */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX0END_end_address_MASK (0xFFFFFF00U) -#define FLEXSPI_IPEDCTX0END_end_address_SHIFT (8U) -/*! end_address - End Address of IPED Region */ -#define FLEXSPI_IPEDCTX0END_end_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX0END_end_address_SHIFT)) & FLEXSPI_IPEDCTX0END_end_address_MASK) -/*! @} */ - -/*! @name IPEDCTX0AAD0 - IPED Context0 Additional Authenticated Data0 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX0AAD0_CTX0_AAD0_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX0AAD0_CTX0_AAD0_SHIFT (0U) -/*! CTX0_AAD0 - CTX AAD */ -#define FLEXSPI_IPEDCTX0AAD0_CTX0_AAD0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX0AAD0_CTX0_AAD0_SHIFT)) & FLEXSPI_IPEDCTX0AAD0_CTX0_AAD0_MASK) -/*! @} */ - -/*! @name IPEDCTX0AAD1 - IPED Context0 Additional Authenticated Data1 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX0AAD1_CTX0_AAD1_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX0AAD1_CTX0_AAD1_SHIFT (0U) -/*! CTX0_AAD1 - CTX AAD */ -#define FLEXSPI_IPEDCTX0AAD1_CTX0_AAD1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX0AAD1_CTX0_AAD1_SHIFT)) & FLEXSPI_IPEDCTX0AAD1_CTX0_AAD1_MASK) -/*! @} */ - -/*! @name IPEDCTX1IV0 - IPED Context1 IV0 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX1IV0_CTX1_IV0_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX1IV0_CTX1_IV0_SHIFT (0U) -/*! CTX1_IV0 - Lowest 32 bits of IV for region 1. */ -#define FLEXSPI_IPEDCTX1IV0_CTX1_IV0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX1IV0_CTX1_IV0_SHIFT)) & FLEXSPI_IPEDCTX1IV0_CTX1_IV0_MASK) -/*! @} */ - -/*! @name IPEDCTX1IV1 - IPED Context1 IV1 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX1IV1_CTX1_IV1_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX1IV1_CTX1_IV1_SHIFT (0U) -/*! CTX1_IV1 - Highest 32 bits of IV for region 1. */ -#define FLEXSPI_IPEDCTX1IV1_CTX1_IV1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX1IV1_CTX1_IV1_SHIFT)) & FLEXSPI_IPEDCTX1IV1_CTX1_IV1_MASK) -/*! @} */ - -/*! @name IPEDCTX1START - Start Address of Region */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX1START_GCM_MASK (0x1U) -#define FLEXSPI_IPEDCTX1START_GCM_SHIFT (0U) -/*! GCM - GCM Mode Enable - * 0b0..Disabled. CTR mode is used. - * 0b1..Enabled. GCM mode is used. - */ -#define FLEXSPI_IPEDCTX1START_GCM(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX1START_GCM_SHIFT)) & FLEXSPI_IPEDCTX1START_GCM_MASK) - -#define FLEXSPI_IPEDCTX1START_ahbbuserror_dis_MASK (0x2U) -#define FLEXSPI_IPEDCTX1START_ahbbuserror_dis_SHIFT (1U) -/*! ahbbuserror_dis - AHB Bus Error Disable - * 0b0..AHB bus errors enabled - * 0b1..AHB bus errors disabled - */ -#define FLEXSPI_IPEDCTX1START_ahbbuserror_dis(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX1START_ahbbuserror_dis_SHIFT)) & FLEXSPI_IPEDCTX1START_ahbbuserror_dis_MASK) - -#define FLEXSPI_IPEDCTX1START_start_address_MASK (0xFFFFFF00U) -#define FLEXSPI_IPEDCTX1START_start_address_SHIFT (8U) -/*! start_address - Start Address */ -#define FLEXSPI_IPEDCTX1START_start_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX1START_start_address_SHIFT)) & FLEXSPI_IPEDCTX1START_start_address_MASK) -/*! @} */ - -/*! @name IPEDCTX1END - End Address of Region */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX1END_end_address_MASK (0xFFFFFF00U) -#define FLEXSPI_IPEDCTX1END_end_address_SHIFT (8U) -/*! end_address - End Address of IPED Region */ -#define FLEXSPI_IPEDCTX1END_end_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX1END_end_address_SHIFT)) & FLEXSPI_IPEDCTX1END_end_address_MASK) -/*! @} */ - -/*! @name IPEDCTX1AAD0 - IPED Context1 Additional Authenticated Data0 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX1AAD0_CTX1_AAD0_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX1AAD0_CTX1_AAD0_SHIFT (0U) -/*! CTX1_AAD0 - CTX AAD */ -#define FLEXSPI_IPEDCTX1AAD0_CTX1_AAD0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX1AAD0_CTX1_AAD0_SHIFT)) & FLEXSPI_IPEDCTX1AAD0_CTX1_AAD0_MASK) -/*! @} */ - -/*! @name IPEDCTX1AAD1 - IPED Context1 Additional Authenticated Data1 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX1AAD1_CTX1_AAD1_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX1AAD1_CTX1_AAD1_SHIFT (0U) -/*! CTX1_AAD1 - CTX AAD */ -#define FLEXSPI_IPEDCTX1AAD1_CTX1_AAD1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX1AAD1_CTX1_AAD1_SHIFT)) & FLEXSPI_IPEDCTX1AAD1_CTX1_AAD1_MASK) -/*! @} */ - -/*! @name IPEDCTX2IV0 - IPED Context2 IV0 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX2IV0_CTX2_IV0_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX2IV0_CTX2_IV0_SHIFT (0U) -/*! CTX2_IV0 - Lowest 32 bits of IV for region 2. */ -#define FLEXSPI_IPEDCTX2IV0_CTX2_IV0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX2IV0_CTX2_IV0_SHIFT)) & FLEXSPI_IPEDCTX2IV0_CTX2_IV0_MASK) -/*! @} */ - -/*! @name IPEDCTX2IV1 - IPED Context2 IV1 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX2IV1_CTX2_IV1_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX2IV1_CTX2_IV1_SHIFT (0U) -/*! CTX2_IV1 - Highest 32 bits of IV for region 2. */ -#define FLEXSPI_IPEDCTX2IV1_CTX2_IV1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX2IV1_CTX2_IV1_SHIFT)) & FLEXSPI_IPEDCTX2IV1_CTX2_IV1_MASK) -/*! @} */ - -/*! @name IPEDCTX2START - Start Address of Region */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX2START_GCM_MASK (0x1U) -#define FLEXSPI_IPEDCTX2START_GCM_SHIFT (0U) -/*! GCM - GCM Mode Enable - * 0b0..Disabled. CTR mode is used. - * 0b1..Enabled. GCM mode is used. - */ -#define FLEXSPI_IPEDCTX2START_GCM(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX2START_GCM_SHIFT)) & FLEXSPI_IPEDCTX2START_GCM_MASK) - -#define FLEXSPI_IPEDCTX2START_ahbbuserror_dis_MASK (0x2U) -#define FLEXSPI_IPEDCTX2START_ahbbuserror_dis_SHIFT (1U) -/*! ahbbuserror_dis - AHB Bus Error Disable - * 0b0..AHB bus errors enabled - * 0b1..AHB bus errors disabled - */ -#define FLEXSPI_IPEDCTX2START_ahbbuserror_dis(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX2START_ahbbuserror_dis_SHIFT)) & FLEXSPI_IPEDCTX2START_ahbbuserror_dis_MASK) - -#define FLEXSPI_IPEDCTX2START_start_address_MASK (0xFFFFFF00U) -#define FLEXSPI_IPEDCTX2START_start_address_SHIFT (8U) -/*! start_address - Start Address */ -#define FLEXSPI_IPEDCTX2START_start_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX2START_start_address_SHIFT)) & FLEXSPI_IPEDCTX2START_start_address_MASK) -/*! @} */ - -/*! @name IPEDCTX2END - End Address of Region */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX2END_end_address_MASK (0xFFFFFF00U) -#define FLEXSPI_IPEDCTX2END_end_address_SHIFT (8U) -/*! end_address - End Address of IPED Region */ -#define FLEXSPI_IPEDCTX2END_end_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX2END_end_address_SHIFT)) & FLEXSPI_IPEDCTX2END_end_address_MASK) -/*! @} */ - -/*! @name IPEDCTX2AAD0 - IPED Context2 Additional Authenticated Data0 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX2AAD0_CTX2_AAD0_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX2AAD0_CTX2_AAD0_SHIFT (0U) -/*! CTX2_AAD0 - CTX AAD */ -#define FLEXSPI_IPEDCTX2AAD0_CTX2_AAD0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX2AAD0_CTX2_AAD0_SHIFT)) & FLEXSPI_IPEDCTX2AAD0_CTX2_AAD0_MASK) -/*! @} */ - -/*! @name IPEDCTX2AAD1 - IPED Context2 Additional Authenticated Data1 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX2AAD1_CTX2_AAD1_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX2AAD1_CTX2_AAD1_SHIFT (0U) -/*! CTX2_AAD1 - CTX AAD */ -#define FLEXSPI_IPEDCTX2AAD1_CTX2_AAD1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX2AAD1_CTX2_AAD1_SHIFT)) & FLEXSPI_IPEDCTX2AAD1_CTX2_AAD1_MASK) -/*! @} */ - -/*! @name IPEDCTX3IV0 - IPED Context3 IV0 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX3IV0_CTX3_IV0_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX3IV0_CTX3_IV0_SHIFT (0U) -/*! CTX3_IV0 - Lowest 32 bits of IV for region 3. */ -#define FLEXSPI_IPEDCTX3IV0_CTX3_IV0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX3IV0_CTX3_IV0_SHIFT)) & FLEXSPI_IPEDCTX3IV0_CTX3_IV0_MASK) -/*! @} */ - -/*! @name IPEDCTX3IV1 - IPED Context3 IV1 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX3IV1_CTX3_IV1_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX3IV1_CTX3_IV1_SHIFT (0U) -/*! CTX3_IV1 - Highest 32 bits of IV for region 3. */ -#define FLEXSPI_IPEDCTX3IV1_CTX3_IV1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX3IV1_CTX3_IV1_SHIFT)) & FLEXSPI_IPEDCTX3IV1_CTX3_IV1_MASK) -/*! @} */ - -/*! @name IPEDCTX3START - Start Address of Region */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX3START_GCM_MASK (0x1U) -#define FLEXSPI_IPEDCTX3START_GCM_SHIFT (0U) -/*! GCM - GCM Mode Enable - * 0b0..Disabled. CTR mode is used. - * 0b1..Enabled. GCM mode is used. - */ -#define FLEXSPI_IPEDCTX3START_GCM(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX3START_GCM_SHIFT)) & FLEXSPI_IPEDCTX3START_GCM_MASK) - -#define FLEXSPI_IPEDCTX3START_ahbbuserror_dis_MASK (0x2U) -#define FLEXSPI_IPEDCTX3START_ahbbuserror_dis_SHIFT (1U) -/*! ahbbuserror_dis - AHB Bus Error Disable - * 0b0..AHB bus errors enabled - * 0b1..AHB bus errors disabled - */ -#define FLEXSPI_IPEDCTX3START_ahbbuserror_dis(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX3START_ahbbuserror_dis_SHIFT)) & FLEXSPI_IPEDCTX3START_ahbbuserror_dis_MASK) - -#define FLEXSPI_IPEDCTX3START_start_address_MASK (0xFFFFFF00U) -#define FLEXSPI_IPEDCTX3START_start_address_SHIFT (8U) -/*! start_address - Start Address */ -#define FLEXSPI_IPEDCTX3START_start_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX3START_start_address_SHIFT)) & FLEXSPI_IPEDCTX3START_start_address_MASK) -/*! @} */ - -/*! @name IPEDCTX3END - End Address of Region */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX3END_end_address_MASK (0xFFFFFF00U) -#define FLEXSPI_IPEDCTX3END_end_address_SHIFT (8U) -/*! end_address - End Address of IPED Region */ -#define FLEXSPI_IPEDCTX3END_end_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX3END_end_address_SHIFT)) & FLEXSPI_IPEDCTX3END_end_address_MASK) -/*! @} */ - -/*! @name IPEDCTX3AAD0 - IPED Context3 Additional Authenticated Data0 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX3AAD0_CTX3_AAD0_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX3AAD0_CTX3_AAD0_SHIFT (0U) -/*! CTX3_AAD0 - CTX AAD */ -#define FLEXSPI_IPEDCTX3AAD0_CTX3_AAD0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX3AAD0_CTX3_AAD0_SHIFT)) & FLEXSPI_IPEDCTX3AAD0_CTX3_AAD0_MASK) -/*! @} */ - -/*! @name IPEDCTX3AAD1 - IPED Context3 Additional Authenticated Data1 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX3AAD1_CTX3_AAD1_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX3AAD1_CTX3_AAD1_SHIFT (0U) -/*! CTX3_AAD1 - CTX AAD */ -#define FLEXSPI_IPEDCTX3AAD1_CTX3_AAD1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX3AAD1_CTX3_AAD1_SHIFT)) & FLEXSPI_IPEDCTX3AAD1_CTX3_AAD1_MASK) -/*! @} */ - -/*! @name IPEDCTX4IV0 - IPED Context4 IV0 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX4IV0_CTX4_IV0_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX4IV0_CTX4_IV0_SHIFT (0U) -/*! CTX4_IV0 - Lowest 32 bits of IV for region 4. */ -#define FLEXSPI_IPEDCTX4IV0_CTX4_IV0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX4IV0_CTX4_IV0_SHIFT)) & FLEXSPI_IPEDCTX4IV0_CTX4_IV0_MASK) -/*! @} */ - -/*! @name IPEDCTX4IV1 - IPED Context4 IV1 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX4IV1_CTX4_IV1_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX4IV1_CTX4_IV1_SHIFT (0U) -/*! CTX4_IV1 - Highest 32 bits of IV for region 4. */ -#define FLEXSPI_IPEDCTX4IV1_CTX4_IV1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX4IV1_CTX4_IV1_SHIFT)) & FLEXSPI_IPEDCTX4IV1_CTX4_IV1_MASK) -/*! @} */ - -/*! @name IPEDCTX4START - Start Address of Region */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX4START_GCM_MASK (0x1U) -#define FLEXSPI_IPEDCTX4START_GCM_SHIFT (0U) -/*! GCM - GCM Mode Enable - * 0b0..Disabled. CTR mode is used. - * 0b1..Enabled. GCM mode is used. - */ -#define FLEXSPI_IPEDCTX4START_GCM(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX4START_GCM_SHIFT)) & FLEXSPI_IPEDCTX4START_GCM_MASK) - -#define FLEXSPI_IPEDCTX4START_ahbbuserror_dis_MASK (0x2U) -#define FLEXSPI_IPEDCTX4START_ahbbuserror_dis_SHIFT (1U) -/*! ahbbuserror_dis - AHB Bus Error Disable - * 0b0..AHB bus errors enabled - * 0b1..AHB bus errors disabled - */ -#define FLEXSPI_IPEDCTX4START_ahbbuserror_dis(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX4START_ahbbuserror_dis_SHIFT)) & FLEXSPI_IPEDCTX4START_ahbbuserror_dis_MASK) - -#define FLEXSPI_IPEDCTX4START_start_address_MASK (0xFFFFFF00U) -#define FLEXSPI_IPEDCTX4START_start_address_SHIFT (8U) -/*! start_address - Start Address */ -#define FLEXSPI_IPEDCTX4START_start_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX4START_start_address_SHIFT)) & FLEXSPI_IPEDCTX4START_start_address_MASK) -/*! @} */ - -/*! @name IPEDCTX4END - End Address of Region */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX4END_end_address_MASK (0xFFFFFF00U) -#define FLEXSPI_IPEDCTX4END_end_address_SHIFT (8U) -/*! end_address - End Address of IPED Region */ -#define FLEXSPI_IPEDCTX4END_end_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX4END_end_address_SHIFT)) & FLEXSPI_IPEDCTX4END_end_address_MASK) -/*! @} */ - -/*! @name IPEDCTX4AAD0 - IPED Context4 Additional Authenticated Data0 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX4AAD0_CTX4_AAD0_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX4AAD0_CTX4_AAD0_SHIFT (0U) -/*! CTX4_AAD0 - CTX AAD */ -#define FLEXSPI_IPEDCTX4AAD0_CTX4_AAD0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX4AAD0_CTX4_AAD0_SHIFT)) & FLEXSPI_IPEDCTX4AAD0_CTX4_AAD0_MASK) -/*! @} */ - -/*! @name IPEDCTX4AAD1 - IPED Context4 Additional Authenticated Data1 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX4AAD1_CTX4_AAD1_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX4AAD1_CTX4_AAD1_SHIFT (0U) -/*! CTX4_AAD1 - CTX AAD */ -#define FLEXSPI_IPEDCTX4AAD1_CTX4_AAD1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX4AAD1_CTX4_AAD1_SHIFT)) & FLEXSPI_IPEDCTX4AAD1_CTX4_AAD1_MASK) -/*! @} */ - -/*! @name IPEDCTX5IV0 - IPED Context5 IV0 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX5IV0_CTX5_IV0_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX5IV0_CTX5_IV0_SHIFT (0U) -/*! CTX5_IV0 - Lowest 32 bits of IV for region 5. */ -#define FLEXSPI_IPEDCTX5IV0_CTX5_IV0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX5IV0_CTX5_IV0_SHIFT)) & FLEXSPI_IPEDCTX5IV0_CTX5_IV0_MASK) -/*! @} */ - -/*! @name IPEDCTX5IV1 - IPED Context5 IV1 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX5IV1_CTX5_IV1_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX5IV1_CTX5_IV1_SHIFT (0U) -/*! CTX5_IV1 - Highest 32 bits of IV for region 5. */ -#define FLEXSPI_IPEDCTX5IV1_CTX5_IV1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX5IV1_CTX5_IV1_SHIFT)) & FLEXSPI_IPEDCTX5IV1_CTX5_IV1_MASK) -/*! @} */ - -/*! @name IPEDCTX5START - Start Address of Region */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX5START_GCM_MASK (0x1U) -#define FLEXSPI_IPEDCTX5START_GCM_SHIFT (0U) -/*! GCM - GCM Mode Enable - * 0b0..Disabled. CTR mode is used. - * 0b1..Enabled. GCM mode is used. - */ -#define FLEXSPI_IPEDCTX5START_GCM(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX5START_GCM_SHIFT)) & FLEXSPI_IPEDCTX5START_GCM_MASK) - -#define FLEXSPI_IPEDCTX5START_ahbbuserror_dis_MASK (0x2U) -#define FLEXSPI_IPEDCTX5START_ahbbuserror_dis_SHIFT (1U) -/*! ahbbuserror_dis - AHB Bus Error Disable - * 0b0..AHB bus errors enabled - * 0b1..AHB bus errors disabled - */ -#define FLEXSPI_IPEDCTX5START_ahbbuserror_dis(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX5START_ahbbuserror_dis_SHIFT)) & FLEXSPI_IPEDCTX5START_ahbbuserror_dis_MASK) - -#define FLEXSPI_IPEDCTX5START_start_address_MASK (0xFFFFFF00U) -#define FLEXSPI_IPEDCTX5START_start_address_SHIFT (8U) -/*! start_address - Start Address */ -#define FLEXSPI_IPEDCTX5START_start_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX5START_start_address_SHIFT)) & FLEXSPI_IPEDCTX5START_start_address_MASK) -/*! @} */ - -/*! @name IPEDCTX5END - End Address of Region */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX5END_end_address_MASK (0xFFFFFF00U) -#define FLEXSPI_IPEDCTX5END_end_address_SHIFT (8U) -/*! end_address - End Address of IPED Region */ -#define FLEXSPI_IPEDCTX5END_end_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX5END_end_address_SHIFT)) & FLEXSPI_IPEDCTX5END_end_address_MASK) -/*! @} */ - -/*! @name IPEDCTX5AAD0 - IPED Context5 Additional Authenticated Data0 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX5AAD0_CTX5_AAD0_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX5AAD0_CTX5_AAD0_SHIFT (0U) -/*! CTX5_AAD0 - CTX AAD */ -#define FLEXSPI_IPEDCTX5AAD0_CTX5_AAD0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX5AAD0_CTX5_AAD0_SHIFT)) & FLEXSPI_IPEDCTX5AAD0_CTX5_AAD0_MASK) -/*! @} */ - -/*! @name IPEDCTX5AAD1 - IPED Context5 Additional Authenticated Data1 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX5AAD1_CTX5_AAD1_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX5AAD1_CTX5_AAD1_SHIFT (0U) -/*! CTX5_AAD1 - CTX AAD */ -#define FLEXSPI_IPEDCTX5AAD1_CTX5_AAD1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX5AAD1_CTX5_AAD1_SHIFT)) & FLEXSPI_IPEDCTX5AAD1_CTX5_AAD1_MASK) -/*! @} */ - -/*! @name IPEDCTX6IV0 - IPED Context6 IV0 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX6IV0_CTX6_IV0_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX6IV0_CTX6_IV0_SHIFT (0U) -/*! CTX6_IV0 - Lowest 32 bits of IV for region 6. */ -#define FLEXSPI_IPEDCTX6IV0_CTX6_IV0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX6IV0_CTX6_IV0_SHIFT)) & FLEXSPI_IPEDCTX6IV0_CTX6_IV0_MASK) -/*! @} */ - -/*! @name IPEDCTX6IV1 - IPED Context6 IV1 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX6IV1_CTX6_IV1_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX6IV1_CTX6_IV1_SHIFT (0U) -/*! CTX6_IV1 - Highest 32 bits of IV for region 6. */ -#define FLEXSPI_IPEDCTX6IV1_CTX6_IV1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX6IV1_CTX6_IV1_SHIFT)) & FLEXSPI_IPEDCTX6IV1_CTX6_IV1_MASK) -/*! @} */ - -/*! @name IPEDCTX6START - Start Address of Region */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX6START_GCM_MASK (0x1U) -#define FLEXSPI_IPEDCTX6START_GCM_SHIFT (0U) -/*! GCM - GCM Mode Enable - * 0b0..Disabled. CTR mode is used. - * 0b1..Enabled. GCM mode is used. - */ -#define FLEXSPI_IPEDCTX6START_GCM(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX6START_GCM_SHIFT)) & FLEXSPI_IPEDCTX6START_GCM_MASK) - -#define FLEXSPI_IPEDCTX6START_ahbbuserror_dis_MASK (0x2U) -#define FLEXSPI_IPEDCTX6START_ahbbuserror_dis_SHIFT (1U) -/*! ahbbuserror_dis - AHB Bus Error Disable - * 0b0..AHB bus errors enabled - * 0b1..AHB bus errors disabled - */ -#define FLEXSPI_IPEDCTX6START_ahbbuserror_dis(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX6START_ahbbuserror_dis_SHIFT)) & FLEXSPI_IPEDCTX6START_ahbbuserror_dis_MASK) - -#define FLEXSPI_IPEDCTX6START_start_address_MASK (0xFFFFFF00U) -#define FLEXSPI_IPEDCTX6START_start_address_SHIFT (8U) -/*! start_address - Start Address */ -#define FLEXSPI_IPEDCTX6START_start_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX6START_start_address_SHIFT)) & FLEXSPI_IPEDCTX6START_start_address_MASK) -/*! @} */ - -/*! @name IPEDCTX6END - End Address of Region */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX6END_end_address_MASK (0xFFFFFF00U) -#define FLEXSPI_IPEDCTX6END_end_address_SHIFT (8U) -/*! end_address - End Address of IPED Region */ -#define FLEXSPI_IPEDCTX6END_end_address(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX6END_end_address_SHIFT)) & FLEXSPI_IPEDCTX6END_end_address_MASK) -/*! @} */ - -/*! @name IPEDCTX6AAD0 - IPED Context6 Additional Authenticated Data0 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX6AAD0_CTX6_AAD0_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX6AAD0_CTX6_AAD0_SHIFT (0U) -/*! CTX6_AAD0 - CTX AAD */ -#define FLEXSPI_IPEDCTX6AAD0_CTX6_AAD0(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX6AAD0_CTX6_AAD0_SHIFT)) & FLEXSPI_IPEDCTX6AAD0_CTX6_AAD0_MASK) -/*! @} */ - -/*! @name IPEDCTX6AAD1 - IPED Context6 Additional Authenticated Data1 */ -/*! @{ */ - -#define FLEXSPI_IPEDCTX6AAD1_CTX6_AAD1_MASK (0xFFFFFFFFU) -#define FLEXSPI_IPEDCTX6AAD1_CTX6_AAD1_SHIFT (0U) -/*! CTX6_AAD1 - CTX AAD */ -#define FLEXSPI_IPEDCTX6AAD1_CTX6_AAD1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_IPEDCTX6AAD1_CTX6_AAD1_SHIFT)) & FLEXSPI_IPEDCTX6AAD1_CTX6_AAD1_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group FLEXSPI_Register_Masks */ - - -/* FLEXSPI - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral FLEXSPI0 base address */ - #define FLEXSPI0_BASE (0x500C8000u) - /** Peripheral FLEXSPI0 base address */ - #define FLEXSPI0_BASE_NS (0x400C8000u) - /** Peripheral FLEXSPI0 base pointer */ - #define FLEXSPI0 ((FLEXSPI_Type *)FLEXSPI0_BASE) - /** Peripheral FLEXSPI0 base pointer */ - #define FLEXSPI0_NS ((FLEXSPI_Type *)FLEXSPI0_BASE_NS) - /** Array initializer of FLEXSPI peripheral base addresses */ - #define FLEXSPI_BASE_ADDRS { FLEXSPI0_BASE } - /** Array initializer of FLEXSPI peripheral base pointers */ - #define FLEXSPI_BASE_PTRS { FLEXSPI0 } - /** Array initializer of FLEXSPI peripheral base addresses */ - #define FLEXSPI_BASE_ADDRS_NS { FLEXSPI0_BASE_NS } - /** Array initializer of FLEXSPI peripheral base pointers */ - #define FLEXSPI_BASE_PTRS_NS { FLEXSPI0_NS } -#else - /** Peripheral FLEXSPI0 base address */ - #define FLEXSPI0_BASE (0x400C8000u) - /** Peripheral FLEXSPI0 base pointer */ - #define FLEXSPI0 ((FLEXSPI_Type *)FLEXSPI0_BASE) - /** Array initializer of FLEXSPI peripheral base addresses */ - #define FLEXSPI_BASE_ADDRS { FLEXSPI0_BASE } - /** Array initializer of FLEXSPI peripheral base pointers */ - #define FLEXSPI_BASE_PTRS { FLEXSPI0 } -#endif -/** Interrupt vectors for the FLEXSPI peripheral type */ -#define FLEXSPI_IRQS { FLEXSPI0_IRQn } -#if (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) -/** FlexSPI0 AMBA base address */ -#define FlexSPI0_AMBA_BASE (0x18000000u) -/** FlexSPI0 AMBA end address */ -#define FlexSPI0_AMBA_END (0x1FFFFFFFu) -/** FlexSPI0 AMBA base address */ -#define FlexSPI0_AMBA_BASE_NS (0x08000000U) -/** FlexSPI0 AMBA end address */ -#define FlexSPI0_AMBA_END_NS (0x0FFFFFFFU) -/* FlexSPI0 alias1 base address. */ -#define FlexSPI0_ALIAS1_BASE (0x80000000U) -/* FlexSPI0 alias1 base NS address. */ -#define FlexSPI0_ALIAS1_BASE_NS (0x90000000U) -/* FlexSPI0 alias2 base address. */ -#define FlexSPI0_ALIAS2_BASE (0xA0000000U) -/* FlexSPI0 alias2 base NS address. */ -#define FlexSPI0_ALIAS2_BASE_NS (0xB0000000U) -#else -/** FlexSPI0 AMBA base address */ -#define FlexSPI0_AMBA_BASE (0x08000000U) -/** FlexSPI0 AMBA end address */ -#define FlexSPI0_AMBA_END (0x0FFFFFFFU) -/* FlexSPI0 alias1 base address. */ -#define FlexSPI0_ALIAS1_BASE (0x80000000U) -/* FlexSPI0 alias2 base address. */ -#define FlexSPI0_ALIAS2_BASE (0xA0000000U) -#endif - - -/*! - * @} - */ /* end of group FLEXSPI_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- FMU Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FMU_Peripheral_Access_Layer FMU Peripheral Access Layer - * @{ - */ - -/** FMU - Register Layout Typedef */ -typedef struct { - __IO uint32_t FSTAT; /**< Flash Status Register, offset: 0x0 */ - __IO uint32_t FCNFG; /**< Flash Configuration Register, offset: 0x4 */ - __IO uint32_t FCTRL; /**< Flash Control Register, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __IO uint32_t FCCOB[8]; /**< Flash Common Command Object Registers, array offset: 0x10, array step: 0x4 */ -} FMU_Type; - -/* ---------------------------------------------------------------------------- - -- FMU Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FMU_Register_Masks FMU Register Masks - * @{ - */ - -/*! @name FSTAT - Flash Status Register */ -/*! @{ */ - -#define FMU_FSTAT_FAIL_MASK (0x1U) -#define FMU_FSTAT_FAIL_SHIFT (0U) -/*! FAIL - Command Fail Flag - * 0b0..Error not detected - * 0b1..Error detected - */ -#define FMU_FSTAT_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_FAIL_SHIFT)) & FMU_FSTAT_FAIL_MASK) - -#define FMU_FSTAT_CMDABT_MASK (0x4U) -#define FMU_FSTAT_CMDABT_SHIFT (2U) -/*! CMDABT - Command Abort Flag - * 0b0..No command abort detected - * 0b1..Command abort detected - */ -#define FMU_FSTAT_CMDABT(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_CMDABT_SHIFT)) & FMU_FSTAT_CMDABT_MASK) - -#define FMU_FSTAT_PVIOL_MASK (0x10U) -#define FMU_FSTAT_PVIOL_SHIFT (4U) -/*! PVIOL - Command Protection Violation Flag - * 0b0..No protection violation detected - * 0b1..Protection violation detected - */ -#define FMU_FSTAT_PVIOL(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_PVIOL_SHIFT)) & FMU_FSTAT_PVIOL_MASK) - -#define FMU_FSTAT_ACCERR_MASK (0x20U) -#define FMU_FSTAT_ACCERR_SHIFT (5U) -/*! ACCERR - Command Access Error Flag - * 0b0..No access error detected - * 0b1..Access error detected - */ -#define FMU_FSTAT_ACCERR(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_ACCERR_SHIFT)) & FMU_FSTAT_ACCERR_MASK) - -#define FMU_FSTAT_CWSABT_MASK (0x40U) -#define FMU_FSTAT_CWSABT_SHIFT (6U) -/*! CWSABT - Command Write Sequence Abort Flag - * 0b0..Command write sequence not aborted - * 0b1..Command write sequence aborted - */ -#define FMU_FSTAT_CWSABT(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_CWSABT_SHIFT)) & FMU_FSTAT_CWSABT_MASK) - -#define FMU_FSTAT_CCIF_MASK (0x80U) -#define FMU_FSTAT_CCIF_SHIFT (7U) -/*! CCIF - Command Complete Interrupt Flag - * 0b0..Flash command, initialization, or power mode recovery in progress - * 0b1..Flash command, initialization, or power mode recovery has completed - */ -#define FMU_FSTAT_CCIF(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_CCIF_SHIFT)) & FMU_FSTAT_CCIF_MASK) - -#define FMU_FSTAT_CMDPRT_MASK (0x300U) -#define FMU_FSTAT_CMDPRT_SHIFT (8U) -/*! CMDPRT - Command protection level - * 0b00..Secure, normal access - * 0b01..Secure, privileged access - * 0b10..Nonsecure, normal access - * 0b11..Nonsecure, privileged access - */ -#define FMU_FSTAT_CMDPRT(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_CMDPRT_SHIFT)) & FMU_FSTAT_CMDPRT_MASK) - -#define FMU_FSTAT_CMDP_MASK (0x800U) -#define FMU_FSTAT_CMDP_SHIFT (11U) -/*! CMDP - Command protection status flag - * 0b0..Command protection level and domain ID are stale - * 0b1..Command protection level (CMDPRT) and domain ID (CMDDID) are set - */ -#define FMU_FSTAT_CMDP(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_CMDP_SHIFT)) & FMU_FSTAT_CMDP_MASK) - -#define FMU_FSTAT_CMDDID_MASK (0xF000U) -#define FMU_FSTAT_CMDDID_SHIFT (12U) -/*! CMDDID - Command domain ID */ -#define FMU_FSTAT_CMDDID(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_CMDDID_SHIFT)) & FMU_FSTAT_CMDDID_MASK) - -#define FMU_FSTAT_DFDIF_MASK (0x10000U) -#define FMU_FSTAT_DFDIF_SHIFT (16U) -/*! DFDIF - Double Bit Fault Detect Interrupt Flag - * 0b0..Double bit fault not detected during a valid flash read access - * 0b1..Double bit fault detected (or FCTRL[FDFD] is set) during a valid flash read access - */ -#define FMU_FSTAT_DFDIF(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_DFDIF_SHIFT)) & FMU_FSTAT_DFDIF_MASK) - -#define FMU_FSTAT_SALV_USED_MASK (0x20000U) -#define FMU_FSTAT_SALV_USED_SHIFT (17U) -/*! SALV_USED - Salvage Used for Erase operation - * 0b0..Salvage not used during last operation - * 0b1..Salvage used during the last erase operation - */ -#define FMU_FSTAT_SALV_USED(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_SALV_USED_SHIFT)) & FMU_FSTAT_SALV_USED_MASK) - -#define FMU_FSTAT_PEWEN_MASK (0x3000000U) -#define FMU_FSTAT_PEWEN_SHIFT (24U) -/*! PEWEN - Program-Erase Write Enable Control - * 0b00..Writes are not enabled - * 0b01..Writes are enabled for one flash or IFR phrase (phrase programming, sector erase) - * 0b10..Writes are enabled for one flash or IFR page (page programming) - * 0b11..Reserved - */ -#define FMU_FSTAT_PEWEN(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_PEWEN_SHIFT)) & FMU_FSTAT_PEWEN_MASK) - -#define FMU_FSTAT_PERDY_MASK (0x80000000U) -#define FMU_FSTAT_PERDY_SHIFT (31U) -/*! PERDY - Program-Erase Ready Control/Status Flag - * 0b0..Program or sector erase command operation not stalled - * 0b1..Program or sector erase command operation ready to execute - */ -#define FMU_FSTAT_PERDY(x) (((uint32_t)(((uint32_t)(x)) << FMU_FSTAT_PERDY_SHIFT)) & FMU_FSTAT_PERDY_MASK) -/*! @} */ - -/*! @name FCNFG - Flash Configuration Register */ -/*! @{ */ - -#define FMU_FCNFG_CCIE_MASK (0x80U) -#define FMU_FCNFG_CCIE_SHIFT (7U) -/*! CCIE - Command Complete Interrupt Enable - * 0b0..Command complete interrupt disabled - * 0b1..Command complete interrupt enabled - */ -#define FMU_FCNFG_CCIE(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCNFG_CCIE_SHIFT)) & FMU_FCNFG_CCIE_MASK) - -#define FMU_FCNFG_ERSREQ_MASK (0x100U) -#define FMU_FCNFG_ERSREQ_SHIFT (8U) -/*! ERSREQ - Mass Erase Request - * 0b0..No request or request complete - * 0b1..Request to run the Mass Erase operation - */ -#define FMU_FCNFG_ERSREQ(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCNFG_ERSREQ_SHIFT)) & FMU_FCNFG_ERSREQ_MASK) - -#define FMU_FCNFG_DFDIE_MASK (0x10000U) -#define FMU_FCNFG_DFDIE_SHIFT (16U) -/*! DFDIE - Double Bit Fault Detect Interrupt Enable - * 0b0..Double bit fault detect interrupt disabled - * 0b1..Double bit fault detect interrupt enabled - */ -#define FMU_FCNFG_DFDIE(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCNFG_DFDIE_SHIFT)) & FMU_FCNFG_DFDIE_MASK) - -#define FMU_FCNFG_ERSIEN0_MASK (0xF000000U) -#define FMU_FCNFG_ERSIEN0_SHIFT (24U) -/*! ERSIEN0 - Erase IFR Sector Enable - Block 0 - * 0b0000..Block 0 IFR Sector X is protected from erase by ERSSCR command - * 0b0001..Block 0 IFR Sector X is not protected from erase by ERSSCR command - */ -#define FMU_FCNFG_ERSIEN0(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCNFG_ERSIEN0_SHIFT)) & FMU_FCNFG_ERSIEN0_MASK) - -#define FMU_FCNFG_ERSIEN1_MASK (0xF0000000U) -#define FMU_FCNFG_ERSIEN1_SHIFT (28U) -/*! ERSIEN1 - Erase IFR Sector Enable - Block 1 (for dual block configs) - * 0b0000..Block 1 IFR Sector X is protected from erase by ERSSCR command - * 0b0001..Block 1 IFR Sector X is not protected from erase by ERSSCR command - */ -#define FMU_FCNFG_ERSIEN1(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCNFG_ERSIEN1_SHIFT)) & FMU_FCNFG_ERSIEN1_MASK) -/*! @} */ - -/*! @name FCTRL - Flash Control Register */ -/*! @{ */ - -#define FMU_FCTRL_RWSC_MASK (0xFU) -#define FMU_FCTRL_RWSC_SHIFT (0U) -/*! RWSC - Read Wait-State Control */ -#define FMU_FCTRL_RWSC(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCTRL_RWSC_SHIFT)) & FMU_FCTRL_RWSC_MASK) - -#define FMU_FCTRL_FDFD_MASK (0x10000U) -#define FMU_FCTRL_FDFD_SHIFT (16U) -/*! FDFD - Force Double Bit Fault Detect - * 0b0..FSTAT[DFDIF] sets only if a double bit fault is detected during a valid flash read access from the platform flash controller - * 0b1..FSTAT[DFDIF] sets during any valid flash read access from the platform flash controller. An interrupt - * request is generated if the DFDIE bit is set. - */ -#define FMU_FCTRL_FDFD(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCTRL_FDFD_SHIFT)) & FMU_FCTRL_FDFD_MASK) - -#define FMU_FCTRL_ABTREQ_MASK (0x1000000U) -#define FMU_FCTRL_ABTREQ_SHIFT (24U) -/*! ABTREQ - Abort Request - * 0b0..No request to abort a command write sequence - * 0b1..Request to abort a command write sequence - */ -#define FMU_FCTRL_ABTREQ(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCTRL_ABTREQ_SHIFT)) & FMU_FCTRL_ABTREQ_MASK) -/*! @} */ - -/*! @name FCCOB - Flash Common Command Object Registers */ -/*! @{ */ - -#define FMU_FCCOB_CCOBn_MASK (0xFFFFFFFFU) -#define FMU_FCCOB_CCOBn_SHIFT (0U) -/*! CCOBn - CCOBn */ -#define FMU_FCCOB_CCOBn(x) (((uint32_t)(((uint32_t)(x)) << FMU_FCCOB_CCOBn_SHIFT)) & FMU_FCCOB_CCOBn_MASK) -/*! @} */ - -/* The count of FMU_FCCOB */ -#define FMU_FCCOB_COUNT (8U) - - -/*! - * @} - */ /* end of group FMU_Register_Masks */ - - -/* FMU - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral FMU0 base address */ - #define FMU0_BASE (0x50043000u) - /** Peripheral FMU0 base address */ - #define FMU0_BASE_NS (0x40043000u) - /** Peripheral FMU0 base pointer */ - #define FMU0 ((FMU_Type *)FMU0_BASE) - /** Peripheral FMU0 base pointer */ - #define FMU0_NS ((FMU_Type *)FMU0_BASE_NS) - /** Array initializer of FMU peripheral base addresses */ - #define FMU_BASE_ADDRS { FMU0_BASE } - /** Array initializer of FMU peripheral base pointers */ - #define FMU_BASE_PTRS { FMU0 } - /** Array initializer of FMU peripheral base addresses */ - #define FMU_BASE_ADDRS_NS { FMU0_BASE_NS } - /** Array initializer of FMU peripheral base pointers */ - #define FMU_BASE_PTRS_NS { FMU0_NS } -#else - /** Peripheral FMU0 base address */ - #define FMU0_BASE (0x40043000u) - /** Peripheral FMU0 base pointer */ - #define FMU0 ((FMU_Type *)FMU0_BASE) - /** Array initializer of FMU peripheral base addresses */ - #define FMU_BASE_ADDRS { FMU0_BASE } - /** Array initializer of FMU peripheral base pointers */ - #define FMU_BASE_PTRS { FMU0 } -#endif - -/*! - * @} - */ /* end of group FMU_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- FMUTEST Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FMUTEST_Peripheral_Access_Layer FMUTEST Peripheral Access Layer - * @{ - */ - -/** FMUTEST - Register Layout Typedef */ -typedef struct { - __IO uint32_t FSTAT; /**< Flash Status Register, offset: 0x0 */ - __IO uint32_t FCNFG; /**< Flash Configuration Register, offset: 0x4 */ - __IO uint32_t FCTRL; /**< Flash Control Register, offset: 0x8 */ - __I uint32_t FTEST; /**< Flash Test Register, offset: 0xC */ - __IO uint32_t FCCOB0; /**< Flash Command Control 0 Register, offset: 0x10 */ - __IO uint32_t FCCOB1; /**< Flash Command Control 1 Register, offset: 0x14 */ - __IO uint32_t FCCOB2; /**< Flash Command Control 2 Register, offset: 0x18 */ - __IO uint32_t FCCOB3; /**< Flash Command Control 3 Register, offset: 0x1C */ - __IO uint32_t FCCOB4; /**< Flash Command Control 4 Register, offset: 0x20 */ - __IO uint32_t FCCOB5; /**< Flash Command Control 5 Register, offset: 0x24 */ - __IO uint32_t FCCOB6; /**< Flash Command Control 6 Register, offset: 0x28 */ - __IO uint32_t FCCOB7; /**< Flash Command Control 7 Register, offset: 0x2C */ - uint8_t RESERVED_0[208]; - __IO uint32_t RESET_STATUS; /**< FMU Initialization Tracking Register, offset: 0x100 */ - __IO uint32_t MCTL; /**< FMU Control Register, offset: 0x104 */ - __I uint32_t BSEL_GEN; /**< FMU Block Select Generation Register, offset: 0x108 */ - __IO uint32_t PWR_OPT; /**< Power Mode Options Register, offset: 0x10C */ - __I uint32_t CMD_CHECK; /**< FMU Command Check Register, offset: 0x110 */ - uint8_t RESERVED_1[12]; - __IO uint32_t BSEL; /**< FMU Block Select Register, offset: 0x120 */ - __IO uint32_t MSIZE; /**< FMU Memory Size Register, offset: 0x124 */ - __IO uint32_t FLASH_RD_ADD; /**< Flash Read Address Register, offset: 0x128 */ - uint8_t RESERVED_2[4]; - __IO uint32_t FLASH_STOP_ADD; /**< Flash Stop Address Register, offset: 0x130 */ - __IO uint32_t FLASH_RD_CTRL; /**< Flash Read Control Register, offset: 0x134 */ - __IO uint32_t MM_ADDR; /**< Memory Map Address Register, offset: 0x138 */ - uint8_t RESERVED_3[4]; - __IO uint32_t MM_WDATA; /**< Memory Map Write Data Register, offset: 0x140 */ - __IO uint32_t MM_CTL; /**< Memory Map Control Register, offset: 0x144 */ - __IO uint32_t UINT_CTL; /**< User Interface Control Register, offset: 0x148 */ - __IO uint32_t RD_DATA0; /**< Read Data 0 Register, offset: 0x14C */ - __IO uint32_t RD_DATA1; /**< Read Data 1 Register, offset: 0x150 */ - __IO uint32_t RD_DATA2; /**< Read Data 2 Register, offset: 0x154 */ - __IO uint32_t RD_DATA3; /**< Read Data 3 Register, offset: 0x158 */ - __IO uint32_t PARITY; /**< Parity Register, offset: 0x15C */ - __IO uint32_t RD_PATH_CTRL_STATUS; /**< Read Path Control and Status Register, offset: 0x160 */ - __IO uint32_t SMW_DIN0; /**< SMW DIN 0 Register, offset: 0x164 */ - __IO uint32_t SMW_DIN1; /**< SMW DIN 1 Register, offset: 0x168 */ - __IO uint32_t SMW_DIN2; /**< SMW DIN 2 Register, offset: 0x16C */ - __IO uint32_t SMW_DIN3; /**< SMW DIN 3 Register, offset: 0x170 */ - __IO uint32_t SMW_ADDR; /**< SMW Address Register, offset: 0x174 */ - __IO uint32_t SMW_CMD_WAIT; /**< SMW Command and Wait Register, offset: 0x178 */ - __I uint32_t SMW_STATUS; /**< SMW Status Register, offset: 0x17C */ - __IO uint32_t SOCTRIM0_0; /**< SoC Trim Phrase 0 Word 0 Register, offset: 0x180 */ - __IO uint32_t SOCTRIM0_1; /**< SoC Trim Phrase 0 Word 1 Register, offset: 0x184 */ - __IO uint32_t SOCTRIM0_2; /**< SoC Trim Phrase 0 Word 2 Register, offset: 0x188 */ - __IO uint32_t SOCTRIM0_3; /**< SoC Trim Phrase 0 Word 3 Register, offset: 0x18C */ - __IO uint32_t SOCTRIM1_0; /**< SoC Trim Phrase 1 Word 0 Register, offset: 0x190 */ - __IO uint32_t SOCTRIM1_1; /**< SoC Trim Phrase 1 Word 1 Register, offset: 0x194 */ - __IO uint32_t SOCTRIM1_2; /**< SoC Trim Phrase 1 Word 2 Register, offset: 0x198 */ - __IO uint32_t SOCTRIM1_3; /**< SoC Trim Phrase 1 Word 3 Register, offset: 0x19C */ - __IO uint32_t SOCTRIM2_0; /**< SoC Trim Phrase 2 Word 0 Register, offset: 0x1A0 */ - __IO uint32_t SOCTRIM2_1; /**< SoC Trim Phrase 2 Word 1 Register, offset: 0x1A4 */ - __IO uint32_t SOCTRIM2_2; /**< SoC Trim Phrase 2 Word 2 Register, offset: 0x1A8 */ - __IO uint32_t SOCTRIM2_3; /**< SoC Trim Phrase 2 Word 3 Register, offset: 0x1AC */ - __IO uint32_t SOCTRIM3_0; /**< SoC Trim Phrase 3 Word 0 Register, offset: 0x1B0 */ - __IO uint32_t SOCTRIM3_1; /**< SoC Trim Phrase 3 Word 1 Register, offset: 0x1B4 */ - __IO uint32_t SOCTRIM3_2; /**< SoC Trim Phrase 3 Word 2 Register, offset: 0x1B8 */ - __IO uint32_t SOCTRIM3_3; /**< SoC Trim Phrase 3 Word 3 Register, offset: 0x1BC */ - __IO uint32_t SOCTRIM4_0; /**< SoC Trim Phrase 4 Word 0 Register, offset: 0x1C0 */ - __IO uint32_t SOCTRIM4_1; /**< SoC Trim Phrase 4 Word 1 Register, offset: 0x1C4 */ - __IO uint32_t SOCTRIM4_2; /**< SoC Trim Phrase 4 Word 2 Register, offset: 0x1C8 */ - __IO uint32_t SOCTRIM4_3; /**< SoC Trim Phrase 4 Word 3 Register, offset: 0x1CC */ - __IO uint32_t SOCTRIM5_0; /**< SoC Trim Phrase 5 Word 0 Register, offset: 0x1D0 */ - __IO uint32_t SOCTRIM5_1; /**< SoC Trim Phrase 5 Word 1 Register, offset: 0x1D4 */ - __IO uint32_t SOCTRIM5_2; /**< SoC Trim Phrase 5 Word 2 Register, offset: 0x1D8 */ - __IO uint32_t SOCTRIM5_3; /**< SoC Trim Phrase 5 Word 3 Register, offset: 0x1DC */ - __IO uint32_t SOCTRIM6_0; /**< SoC Trim Phrase 6 Word 0 Register, offset: 0x1E0 */ - __IO uint32_t SOCTRIM6_1; /**< SoC Trim Phrase 6 Word 1 Register, offset: 0x1E4 */ - __IO uint32_t SOCTRIM6_2; /**< SoC Trim Phrase 6 Word 2 Register, offset: 0x1E8 */ - __IO uint32_t SOCTRIM6_3; /**< SoC Trim Phrase 6 Word 3 Register, offset: 0x1EC */ - __IO uint32_t SOCTRIM7_0; /**< SoC Trim Phrase 7 Word 0 Register, offset: 0x1F0 */ - __IO uint32_t SOCTRIM7_1; /**< SoC Trim Phrase 7 Word 1 Register, offset: 0x1F4 */ - __IO uint32_t SOCTRIM7_2; /**< SoC Trim Phrase 7 Word 2 Register, offset: 0x1F8 */ - __IO uint32_t SOCTRIM7_3; /**< SoC Trim Phrase 7 Word 3 Register, offset: 0x1FC */ - uint8_t RESERVED_4[4]; - __IO uint32_t R_IP_CONFIG; /**< BIST Configuration Register, offset: 0x204 */ - __IO uint32_t R_TESTCODE; /**< BIST Test Code Register, offset: 0x208 */ - __IO uint32_t R_DFT_CTRL; /**< BIST DFT Control Register, offset: 0x20C */ - __IO uint32_t R_ADR_CTRL; /**< BIST Address Control Register, offset: 0x210 */ - __IO uint32_t R_DATA_CTRL0; /**< BIST Data Control 0 Register, offset: 0x214 */ - __IO uint32_t R_PIN_CTRL; /**< BIST Pin Control Register, offset: 0x218 */ - __IO uint32_t R_CNT_LOOP_CTRL; /**< BIST Loop Count Control Register, offset: 0x21C */ - __IO uint32_t R_TIMER_CTRL; /**< BIST Timer Control Register, offset: 0x220 */ - __IO uint32_t R_TEST_CTRL; /**< BIST Test Control Register, offset: 0x224 */ - __O uint32_t R_ABORT_LOOP; /**< BIST Abort Loop Register, offset: 0x228 */ - __I uint32_t R_ADR_QUERY; /**< BIST Address Query Register, offset: 0x22C */ - __I uint32_t R_DOUT_QUERY0; /**< BIST DOUT Query 0 Register, offset: 0x230 */ - uint8_t RESERVED_5[8]; - __I uint32_t R_SMW_QUERY; /**< BIST SMW Query Register, offset: 0x23C */ - __IO uint32_t R_SMW_SETTING0; /**< BIST SMW Setting 0 Register, offset: 0x240 */ - __IO uint32_t R_SMW_SETTING1; /**< BIST SMW Setting 1 Register, offset: 0x244 */ - __IO uint32_t R_SMP_WHV0; /**< BIST SMP WHV Setting 0 Register, offset: 0x248 */ - __IO uint32_t R_SMP_WHV1; /**< BIST SMP WHV Setting 1 Register, offset: 0x24C */ - __IO uint32_t R_SME_WHV0; /**< BIST SME WHV Setting 0 Register, offset: 0x250 */ - __IO uint32_t R_SME_WHV1; /**< BIST SME WHV Setting 1 Register, offset: 0x254 */ - __IO uint32_t R_SMW_SETTING2; /**< BIST SMW Setting 2 Register, offset: 0x258 */ - __I uint32_t R_D_MISR0; /**< BIST DIN MISR 0 Register, offset: 0x25C */ - __I uint32_t R_A_MISR0; /**< BIST Address MISR 0 Register, offset: 0x260 */ - __I uint32_t R_C_MISR0; /**< BIST Control MISR 0 Register, offset: 0x264 */ - __IO uint32_t R_SMW_SETTING3; /**< BIST SMW Setting 3 Register, offset: 0x268 */ - __IO uint32_t R_DATA_CTRL1; /**< BIST Data Control 1 Register, offset: 0x26C */ - __IO uint32_t R_DATA_CTRL2; /**< BIST Data Control 2 Register, offset: 0x270 */ - __IO uint32_t R_DATA_CTRL3; /**< BIST Data Control 3 Register, offset: 0x274 */ - uint8_t RESERVED_6[8]; - __I uint32_t R_REPAIR0_0; /**< BIST Repair 0 for Block 0 Register, offset: 0x280 */ - __I uint32_t R_REPAIR0_1; /**< BIST Repair 1 Block 0 Register, offset: 0x284 */ - __I uint32_t R_REPAIR1_0; /**< BIST Repair 0 Block 1 Register, offset: 0x288 */ - __I uint32_t R_REPAIR1_1; /**< BIST Repair 1 Block 1 Register, offset: 0x28C */ - uint8_t RESERVED_7[132]; - __IO uint32_t R_DATA_CTRL0_EX; /**< BIST Data Control 0 Extension Register, offset: 0x314 */ - uint8_t RESERVED_8[8]; - __IO uint32_t R_TIMER_CTRL_EX; /**< BIST Timer Control Extension Register, offset: 0x320 */ - uint8_t RESERVED_9[12]; - __I uint32_t R_DOUT_QUERY1; /**< BIST DOUT Query 1 Register, offset: 0x330 */ - uint8_t RESERVED_10[40]; - __I uint32_t R_D_MISR1; /**< BIST DIN MISR 1 Register, offset: 0x35C */ - __I uint32_t R_A_MISR1; /**< BIST Address MISR 1 Register, offset: 0x360 */ - __I uint32_t R_C_MISR1; /**< BIST Control MISR 1 Register, offset: 0x364 */ - uint8_t RESERVED_11[4]; - __IO uint32_t R_DATA_CTRL1_EX; /**< BIST Data Control 1 Extension Register, offset: 0x36C */ - __IO uint32_t R_DATA_CTRL2_EX; /**< BIST Data Control 2 Extension Register, offset: 0x370 */ - __IO uint32_t R_DATA_CTRL3_EX; /**< BIST Data Control 3 Extension Register, offset: 0x374 */ - uint8_t RESERVED_12[136]; - __IO uint32_t SMW_TIMER_OPTION; /**< SMW Timer Option Register, offset: 0x400 */ - __IO uint32_t SMW_SETTING_OPTION0; /**< SMW Setting Option 0 Register, offset: 0x404 */ - __IO uint32_t SMW_SETTING_OPTION2; /**< SMW Setting Option 2 Register, offset: 0x408 */ - __IO uint32_t SMW_SETTING_OPTION3; /**< SMW Setting Option 3 Register, offset: 0x40C */ - __IO uint32_t SMW_SMP_WHV_OPTION0; /**< SMW SMP WHV Option 0 Register, offset: 0x410 */ - __IO uint32_t SMW_SME_WHV_OPTION0; /**< SMW SME WHV Option 0 Register, offset: 0x414 */ - __IO uint32_t SMW_SETTING_OPTION1; /**< SMW Setting Option 1 Register, offset: 0x418 */ - __IO uint32_t SMW_SMP_WHV_OPTION1; /**< SMW SMP WHV Option 1 Register, offset: 0x41C */ - __IO uint32_t SMW_SME_WHV_OPTION1; /**< SMW SME WHV Option 1 Register, offset: 0x420 */ - uint8_t RESERVED_13[220]; - __IO uint32_t REPAIR0_0; /**< FMU Repair 0 Block 0 Register, offset: 0x500 */ - __IO uint32_t REPAIR0_1; /**< FMU Repair 1 Block 0 Register, offset: 0x504 */ - __IO uint32_t REPAIR1_0; /**< FMU Repair 0 Block 1 Register, offset: 0x508 */ - __IO uint32_t REPAIR1_1; /**< FMU Repair 1 Block 1 Register, offset: 0x50C */ - uint8_t RESERVED_14[240]; - __IO uint32_t SMW_HB_SIGNALS; /**< SMW HB Signals Register, offset: 0x600 */ - __IO uint32_t BIST_DUMP_CTRL; /**< BIST Datadump Control Register, offset: 0x604 */ - uint8_t RESERVED_15[4]; - __IO uint32_t ATX_PIN_CTRL; /**< ATX Pin Control Register, offset: 0x60C */ - __IO uint32_t FAILCNT; /**< Fail Count Register, offset: 0x610 */ - __IO uint32_t PGM_PULSE_CNT0; /**< Block 0 Program Pulse Count Register, offset: 0x614 */ - __IO uint32_t PGM_PULSE_CNT1; /**< Block 1 Program Pulse Count Register, offset: 0x618 */ - __IO uint32_t ERS_PULSE_CNT; /**< Erase Pulse Count Register, offset: 0x61C */ - __IO uint32_t MAX_PULSE_CNT; /**< Maximum Pulse Count Register, offset: 0x620 */ - __IO uint32_t PORT_CTRL; /**< Port Control Register, offset: 0x624 */ -} FMUTEST_Type; - -/* ---------------------------------------------------------------------------- - -- FMUTEST Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FMUTEST_Register_Masks FMUTEST Register Masks - * @{ - */ - -/*! @name FSTAT - Flash Status Register */ -/*! @{ */ - -#define FMUTEST_FSTAT_FAIL_MASK (0x1U) -#define FMUTEST_FSTAT_FAIL_SHIFT (0U) -/*! FAIL - Command Fail Flag - * 0b0..Error not detected - * 0b1..Error detected - */ -#define FMUTEST_FSTAT_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_FAIL_SHIFT)) & FMUTEST_FSTAT_FAIL_MASK) - -#define FMUTEST_FSTAT_CMDABT_MASK (0x4U) -#define FMUTEST_FSTAT_CMDABT_SHIFT (2U) -/*! CMDABT - Command Abort Flag - * 0b0..No command abort detected - * 0b1..Command abort detected - */ -#define FMUTEST_FSTAT_CMDABT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_CMDABT_SHIFT)) & FMUTEST_FSTAT_CMDABT_MASK) - -#define FMUTEST_FSTAT_PVIOL_MASK (0x10U) -#define FMUTEST_FSTAT_PVIOL_SHIFT (4U) -/*! PVIOL - Command Protection Violation Flag - * 0b0..No protection violation detected - * 0b1..Protection violation detected - */ -#define FMUTEST_FSTAT_PVIOL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_PVIOL_SHIFT)) & FMUTEST_FSTAT_PVIOL_MASK) - -#define FMUTEST_FSTAT_ACCERR_MASK (0x20U) -#define FMUTEST_FSTAT_ACCERR_SHIFT (5U) -/*! ACCERR - Command Access Error Flag - * 0b0..No access error detected - * 0b1..Access error detected - */ -#define FMUTEST_FSTAT_ACCERR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_ACCERR_SHIFT)) & FMUTEST_FSTAT_ACCERR_MASK) - -#define FMUTEST_FSTAT_CWSABT_MASK (0x40U) -#define FMUTEST_FSTAT_CWSABT_SHIFT (6U) -/*! CWSABT - Command Write Sequence Abort Flag - * 0b0..Command write sequence not aborted - * 0b1..Command write sequence aborted - */ -#define FMUTEST_FSTAT_CWSABT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_CWSABT_SHIFT)) & FMUTEST_FSTAT_CWSABT_MASK) - -#define FMUTEST_FSTAT_CCIF_MASK (0x80U) -#define FMUTEST_FSTAT_CCIF_SHIFT (7U) -/*! CCIF - Command Complete Interrupt Flag - * 0b0..Flash command or initialization in progress - * 0b1..Flash command or initialization has completed - */ -#define FMUTEST_FSTAT_CCIF(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_CCIF_SHIFT)) & FMUTEST_FSTAT_CCIF_MASK) - -#define FMUTEST_FSTAT_CMDPRT_MASK (0x300U) -#define FMUTEST_FSTAT_CMDPRT_SHIFT (8U) -/*! CMDPRT - Command Protection Level - * 0b00..Secure, normal access - * 0b01..Secure, privileged access - * 0b10..Nonsecure, normal access - * 0b11..Nonsecure, privileged access - */ -#define FMUTEST_FSTAT_CMDPRT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_CMDPRT_SHIFT)) & FMUTEST_FSTAT_CMDPRT_MASK) - -#define FMUTEST_FSTAT_CMDP_MASK (0x800U) -#define FMUTEST_FSTAT_CMDP_SHIFT (11U) -/*! CMDP - Command Protection Status Flag - * 0b0..Command protection level and domain ID are stale - * 0b1..Command protection level (CMDPRT) and domain ID (CMDDID) are set - */ -#define FMUTEST_FSTAT_CMDP(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_CMDP_SHIFT)) & FMUTEST_FSTAT_CMDP_MASK) - -#define FMUTEST_FSTAT_CMDDID_MASK (0xF000U) -#define FMUTEST_FSTAT_CMDDID_SHIFT (12U) -/*! CMDDID - Command Domain ID */ -#define FMUTEST_FSTAT_CMDDID(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_CMDDID_SHIFT)) & FMUTEST_FSTAT_CMDDID_MASK) - -#define FMUTEST_FSTAT_DFDIF_MASK (0x10000U) -#define FMUTEST_FSTAT_DFDIF_SHIFT (16U) -/*! DFDIF - Double Bit Fault Detect Interrupt Flag - * 0b0..Double bit fault not detected during a valid flash read access from the FMC - * 0b1..Double bit fault detected (or FCTRL[FDFD] is set) during a valid flash read access from the FMC - */ -#define FMUTEST_FSTAT_DFDIF(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_DFDIF_SHIFT)) & FMUTEST_FSTAT_DFDIF_MASK) - -#define FMUTEST_FSTAT_SALV_USED_MASK (0x20000U) -#define FMUTEST_FSTAT_SALV_USED_SHIFT (17U) -/*! SALV_USED - Salvage Used for Erase operation - * 0b0..Salvage not used during the last operation - * 0b1..Salvage used during the last erase operation - */ -#define FMUTEST_FSTAT_SALV_USED(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_SALV_USED_SHIFT)) & FMUTEST_FSTAT_SALV_USED_MASK) - -#define FMUTEST_FSTAT_PEWEN_MASK (0x3000000U) -#define FMUTEST_FSTAT_PEWEN_SHIFT (24U) -/*! PEWEN - Program-Erase Write Enable Control - * 0b00..Writes are not enabled - * 0b01..Writes are enabled for one flash or IFR phrase (phrase programming, sector erase) - * 0b10..Writes are enabled for one flash or IFR page (page programming) - * 0b11..Reserved - */ -#define FMUTEST_FSTAT_PEWEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_PEWEN_SHIFT)) & FMUTEST_FSTAT_PEWEN_MASK) - -#define FMUTEST_FSTAT_PERDY_MASK (0x80000000U) -#define FMUTEST_FSTAT_PERDY_SHIFT (31U) -/*! PERDY - Program/Erase Ready Control/Status Flag - * 0b0..Program or sector erase command operation is not stalled - * 0b1..Program or sector erase command operation is stalled - */ -#define FMUTEST_FSTAT_PERDY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FSTAT_PERDY_SHIFT)) & FMUTEST_FSTAT_PERDY_MASK) -/*! @} */ - -/*! @name FCNFG - Flash Configuration Register */ -/*! @{ */ - -#define FMUTEST_FCNFG_CCIE_MASK (0x80U) -#define FMUTEST_FCNFG_CCIE_SHIFT (7U) -/*! CCIE - Command Complete Interrupt Enable - * 0b0..Command complete interrupt disabled - * 0b1..Command complete interrupt enabled. An interrupt request is generated whenever the FSTAT[CCIF] flag is set. - */ -#define FMUTEST_FCNFG_CCIE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCNFG_CCIE_SHIFT)) & FMUTEST_FCNFG_CCIE_MASK) - -#define FMUTEST_FCNFG_ERSREQ_MASK (0x100U) -#define FMUTEST_FCNFG_ERSREQ_SHIFT (8U) -/*! ERSREQ - Mass Erase (Erase All) Request - * 0b0..No request or request complete - * 0b1..Request to run the Mass Erase operation - */ -#define FMUTEST_FCNFG_ERSREQ(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCNFG_ERSREQ_SHIFT)) & FMUTEST_FCNFG_ERSREQ_MASK) - -#define FMUTEST_FCNFG_DFDIE_MASK (0x10000U) -#define FMUTEST_FCNFG_DFDIE_SHIFT (16U) -/*! DFDIE - Double Bit Fault Detect Interrupt Enable - * 0b0..Double bit fault detect interrupt disabled - * 0b1..Double bit fault detect interrupt enabled; an interrupt request is generated whenever the FSTAT[DFDIF] flag is set - */ -#define FMUTEST_FCNFG_DFDIE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCNFG_DFDIE_SHIFT)) & FMUTEST_FCNFG_DFDIE_MASK) - -#define FMUTEST_FCNFG_ERSIEN0_MASK (0xF000000U) -#define FMUTEST_FCNFG_ERSIEN0_SHIFT (24U) -/*! ERSIEN0 - Erase IFR Sector Enable - Block 0 - * 0b0000..Block 0 IFR Sector X is protected from erase by ERSSCR command - * 0b0001..Block 0 IFR Sector X is not protected from erase by ERSSCR command - */ -#define FMUTEST_FCNFG_ERSIEN0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCNFG_ERSIEN0_SHIFT)) & FMUTEST_FCNFG_ERSIEN0_MASK) - -#define FMUTEST_FCNFG_ERSIEN1_MASK (0xF0000000U) -#define FMUTEST_FCNFG_ERSIEN1_SHIFT (28U) -/*! ERSIEN1 - Erase IFR Sector Enable - Block 1 (for dual block configs) - * 0b0000..Block 1 IFR Sector X is protected from erase by ERSSCR command - * 0b0001..Block 1 IFR Sector X is not protected from erase by ERSSCR command - */ -#define FMUTEST_FCNFG_ERSIEN1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCNFG_ERSIEN1_SHIFT)) & FMUTEST_FCNFG_ERSIEN1_MASK) -/*! @} */ - -/*! @name FCTRL - Flash Control Register */ -/*! @{ */ - -#define FMUTEST_FCTRL_RWSC_MASK (0xFU) -#define FMUTEST_FCTRL_RWSC_SHIFT (0U) -/*! RWSC - Read Wait-State Control - * 0b0000..no additional wait-states are added (single cycle access) - * 0b0001..1 additional wait-state is added - * 0b0010..2 additional wait-states are added - * 0b0011..3 additional wait-states are added - * 0b0100..4 additional wait-states are added - * 0b0101..5 additional wait-states are added - * 0b0110..6 additional wait-states are added - * 0b0111..7 additional wait-states are added - * 0b1000..8 additional wait-states are added - * 0b1001..9 additional wait-states are added - * 0b1010..10 additional wait-states are added - * 0b1011..11 additional wait-states are added - * 0b1100..12 additional wait-states are added - * 0b1101..13 additional wait-states are added - * 0b1110..14 additional wait-states are added - * 0b1111..15 additional wait-states are added - */ -#define FMUTEST_FCTRL_RWSC(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCTRL_RWSC_SHIFT)) & FMUTEST_FCTRL_RWSC_MASK) - -#define FMUTEST_FCTRL_LSACTIVE_MASK (0x100U) -#define FMUTEST_FCTRL_LSACTIVE_SHIFT (8U) -/*! LSACTIVE - Low Speed Active Mode - * 0b0..Full speed active mode requested - * 0b1..Low speed active mode requested - */ -#define FMUTEST_FCTRL_LSACTIVE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCTRL_LSACTIVE_SHIFT)) & FMUTEST_FCTRL_LSACTIVE_MASK) - -#define FMUTEST_FCTRL_FDFD_MASK (0x10000U) -#define FMUTEST_FCTRL_FDFD_SHIFT (16U) -/*! FDFD - Force Double Bit Fault Detect - * 0b0..FSTAT[DFDIF] sets only if a double bit fault is detected during a valid flash read access from the FMC - * 0b1..FSTAT[DFDIF] sets during any valid flash read access from the FMC; an interrupt request is generated if the DFDIE bit is set - */ -#define FMUTEST_FCTRL_FDFD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCTRL_FDFD_SHIFT)) & FMUTEST_FCTRL_FDFD_MASK) - -#define FMUTEST_FCTRL_ABTREQ_MASK (0x1000000U) -#define FMUTEST_FCTRL_ABTREQ_SHIFT (24U) -/*! ABTREQ - Abort Request - * 0b0..No request to abort a command write sequence - * 0b1..Request to abort a command write sequence - */ -#define FMUTEST_FCTRL_ABTREQ(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCTRL_ABTREQ_SHIFT)) & FMUTEST_FCTRL_ABTREQ_MASK) -/*! @} */ - -/*! @name FTEST - Flash Test Register */ -/*! @{ */ - -#define FMUTEST_FTEST_TMECTL_MASK (0x1U) -#define FMUTEST_FTEST_TMECTL_SHIFT (0U) -/*! TMECTL - Test Mode Entry Control - * 0b0..FTEST register always reads 0 and writes to FTEST are ignored - * 0b1..FTEST register is readable and can be written to enable writability of TME - */ -#define FMUTEST_FTEST_TMECTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FTEST_TMECTL_SHIFT)) & FMUTEST_FTEST_TMECTL_MASK) - -#define FMUTEST_FTEST_TMEWR_MASK (0x2U) -#define FMUTEST_FTEST_TMEWR_SHIFT (1U) -/*! TMEWR - Test Mode Entry Writable - * 0b0..TME bit is not writable - * 0b1..TME bit is writable - */ -#define FMUTEST_FTEST_TMEWR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FTEST_TMEWR_SHIFT)) & FMUTEST_FTEST_TMEWR_MASK) - -#define FMUTEST_FTEST_TME_MASK (0x4U) -#define FMUTEST_FTEST_TME_SHIFT (2U) -/*! TME - Test Mode Entry - * 0b0..Test mode entry not requested - * 0b1..Test mode entry requested - */ -#define FMUTEST_FTEST_TME(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FTEST_TME_SHIFT)) & FMUTEST_FTEST_TME_MASK) - -#define FMUTEST_FTEST_TMODE_MASK (0x8U) -#define FMUTEST_FTEST_TMODE_SHIFT (3U) -/*! TMODE - Test Mode Status - * 0b0..Test mode not active - * 0b1..Test mode active - */ -#define FMUTEST_FTEST_TMODE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FTEST_TMODE_SHIFT)) & FMUTEST_FTEST_TMODE_MASK) - -#define FMUTEST_FTEST_TMELOCK_MASK (0x10U) -#define FMUTEST_FTEST_TMELOCK_SHIFT (4U) -/*! TMELOCK - Test Mode Entry Lock - * 0b0..FTEST register not locked from accepting writes - * 0b1..FTEST register locked from accepting writes - */ -#define FMUTEST_FTEST_TMELOCK(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FTEST_TMELOCK_SHIFT)) & FMUTEST_FTEST_TMELOCK_MASK) -/*! @} */ - -/*! @name FCCOB0 - Flash Command Control 0 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB0_CMDCODE_MASK (0xFFU) -#define FMUTEST_FCCOB0_CMDCODE_SHIFT (0U) -/*! CMDCODE - Command code */ -#define FMUTEST_FCCOB0_CMDCODE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB0_CMDCODE_SHIFT)) & FMUTEST_FCCOB0_CMDCODE_MASK) -/*! @} */ - -/*! @name FCCOB1 - Flash Command Control 1 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB1_CMDOPT_MASK (0xFFU) -#define FMUTEST_FCCOB1_CMDOPT_SHIFT (0U) -/*! CMDOPT - Command options */ -#define FMUTEST_FCCOB1_CMDOPT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB1_CMDOPT_SHIFT)) & FMUTEST_FCCOB1_CMDOPT_MASK) -/*! @} */ - -/*! @name FCCOB2 - Flash Command Control 2 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB2_CMDADDR_MASK (0xFFFFFFFFU) -#define FMUTEST_FCCOB2_CMDADDR_SHIFT (0U) -/*! CMDADDR - Command starting address */ -#define FMUTEST_FCCOB2_CMDADDR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB2_CMDADDR_SHIFT)) & FMUTEST_FCCOB2_CMDADDR_MASK) -/*! @} */ - -/*! @name FCCOB3 - Flash Command Control 3 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB3_CMDADDRE_MASK (0xFFFFFFFFU) -#define FMUTEST_FCCOB3_CMDADDRE_SHIFT (0U) -/*! CMDADDRE - Command ending address */ -#define FMUTEST_FCCOB3_CMDADDRE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB3_CMDADDRE_SHIFT)) & FMUTEST_FCCOB3_CMDADDRE_MASK) -/*! @} */ - -/*! @name FCCOB4 - Flash Command Control 4 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB4_CMDDATA0_MASK (0xFFFFFFFFU) -#define FMUTEST_FCCOB4_CMDDATA0_SHIFT (0U) -/*! CMDDATA0 - Command data word 0 */ -#define FMUTEST_FCCOB4_CMDDATA0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB4_CMDDATA0_SHIFT)) & FMUTEST_FCCOB4_CMDDATA0_MASK) -/*! @} */ - -/*! @name FCCOB5 - Flash Command Control 5 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB5_CMDDATA1_MASK (0xFFFFFFFFU) -#define FMUTEST_FCCOB5_CMDDATA1_SHIFT (0U) -/*! CMDDATA1 - Command data word 1 */ -#define FMUTEST_FCCOB5_CMDDATA1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB5_CMDDATA1_SHIFT)) & FMUTEST_FCCOB5_CMDDATA1_MASK) -/*! @} */ - -/*! @name FCCOB6 - Flash Command Control 6 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB6_CMDDATA2_MASK (0xFFFFFFFFU) -#define FMUTEST_FCCOB6_CMDDATA2_SHIFT (0U) -/*! CMDDATA2 - Command data word 2 */ -#define FMUTEST_FCCOB6_CMDDATA2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB6_CMDDATA2_SHIFT)) & FMUTEST_FCCOB6_CMDDATA2_MASK) -/*! @} */ - -/*! @name FCCOB7 - Flash Command Control 7 Register */ -/*! @{ */ - -#define FMUTEST_FCCOB7_CMDDATA3_MASK (0xFFFFFFFFU) -#define FMUTEST_FCCOB7_CMDDATA3_SHIFT (0U) -/*! CMDDATA3 - Command data word 3 */ -#define FMUTEST_FCCOB7_CMDDATA3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FCCOB7_CMDDATA3_SHIFT)) & FMUTEST_FCCOB7_CMDDATA3_MASK) -/*! @} */ - -/*! @name RESET_STATUS - FMU Initialization Tracking Register */ -/*! @{ */ - -#define FMUTEST_RESET_STATUS_ARY_TRIM_DONE_MASK (0x1U) -#define FMUTEST_RESET_STATUS_ARY_TRIM_DONE_SHIFT (0U) -/*! ARY_TRIM_DONE - Array Trim Complete - * 0b0..Recall register load operation has not been completed - * 0b1..Recall register load operation has completed - */ -#define FMUTEST_RESET_STATUS_ARY_TRIM_DONE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_ARY_TRIM_DONE_SHIFT)) & FMUTEST_RESET_STATUS_ARY_TRIM_DONE_MASK) - -#define FMUTEST_RESET_STATUS_FMU_PARM_EN_MASK (0x2U) -#define FMUTEST_RESET_STATUS_FMU_PARM_EN_SHIFT (1U) -/*! FMU_PARM_EN - Status of the C0DE_C0DEh check to enable loading of the FMU parameters - * 0b0..C0DE_C0DEh check not attempted - * 0b1..C0DE_C0DEh check completed - */ -#define FMUTEST_RESET_STATUS_FMU_PARM_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_FMU_PARM_EN_SHIFT)) & FMUTEST_RESET_STATUS_FMU_PARM_EN_MASK) - -#define FMUTEST_RESET_STATUS_FMU_PARM_DONE_MASK (0x4U) -#define FMUTEST_RESET_STATUS_FMU_PARM_DONE_SHIFT (2U) -/*! FMU_PARM_DONE - FMU Register Load Complete - * 0b0..FMU registers have not been loaded - * 0b1..FMU registers have been loaded - */ -#define FMUTEST_RESET_STATUS_FMU_PARM_DONE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_FMU_PARM_DONE_SHIFT)) & FMUTEST_RESET_STATUS_FMU_PARM_DONE_MASK) - -#define FMUTEST_RESET_STATUS_SOC_TRIM_EN_MASK (0x8U) -#define FMUTEST_RESET_STATUS_SOC_TRIM_EN_SHIFT (3U) -/*! SOC_TRIM_EN - Status of the C0DE_C0DEh check to enable loading of the SoC trim settings - * 0b0..C0DE_C0DEh check not attempted - * 0b1..C0DE_C0DEh check completed - */ -#define FMUTEST_RESET_STATUS_SOC_TRIM_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_SOC_TRIM_EN_SHIFT)) & FMUTEST_RESET_STATUS_SOC_TRIM_EN_MASK) - -#define FMUTEST_RESET_STATUS_SOC_TRIM_ECC_MASK (0x10U) -#define FMUTEST_RESET_STATUS_SOC_TRIM_ECC_SHIFT (4U) -/*! SOC_TRIM_ECC - Status of the C0DE_C0DEh check for enabling ECC decoder during reads of SoC trim settings - * 0b0..C0DE_C0DEh check failed - * 0b1..C0DE_C0DEh check passed - */ -#define FMUTEST_RESET_STATUS_SOC_TRIM_ECC(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_SOC_TRIM_ECC_SHIFT)) & FMUTEST_RESET_STATUS_SOC_TRIM_ECC_MASK) - -#define FMUTEST_RESET_STATUS_SOC_TRIM_DONE_MASK (0x20U) -#define FMUTEST_RESET_STATUS_SOC_TRIM_DONE_SHIFT (5U) -/*! SOC_TRIM_DONE - SoC Trim Complete - * 0b0..SoC Trim registers have not been updated - * 0b1..All SoC Trim registers have been updated - */ -#define FMUTEST_RESET_STATUS_SOC_TRIM_DONE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_SOC_TRIM_DONE_SHIFT)) & FMUTEST_RESET_STATUS_SOC_TRIM_DONE_MASK) - -#define FMUTEST_RESET_STATUS_RPR_DONE_MASK (0x40U) -#define FMUTEST_RESET_STATUS_RPR_DONE_SHIFT (6U) -/*! RPR_DONE - Array Repair Complete - * 0b0..Repair registers have not been loaded - * 0b1..Repair registers have been loaded - */ -#define FMUTEST_RESET_STATUS_RPR_DONE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_RPR_DONE_SHIFT)) & FMUTEST_RESET_STATUS_RPR_DONE_MASK) - -#define FMUTEST_RESET_STATUS_INIT_DONE_MASK (0x80U) -#define FMUTEST_RESET_STATUS_INIT_DONE_SHIFT (7U) -/*! INIT_DONE - Initialization Done - * 0b0..All initialization steps did not complete - * 0b1..All initialization steps completed - */ -#define FMUTEST_RESET_STATUS_INIT_DONE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_INIT_DONE_SHIFT)) & FMUTEST_RESET_STATUS_INIT_DONE_MASK) - -#define FMUTEST_RESET_STATUS_RST_SF_ERR_MASK (0x100U) -#define FMUTEST_RESET_STATUS_RST_SF_ERR_SHIFT (8U) -/*! RST_SF_ERR - ECC Single Fault during Reset Recovery - * 0b0..No single-bit faults detected during initialization - * 0b1..At least one single ECC fault was detected during initialization - */ -#define FMUTEST_RESET_STATUS_RST_SF_ERR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_RST_SF_ERR_SHIFT)) & FMUTEST_RESET_STATUS_RST_SF_ERR_MASK) - -#define FMUTEST_RESET_STATUS_RST_DF_ERR_MASK (0x200U) -#define FMUTEST_RESET_STATUS_RST_DF_ERR_SHIFT (9U) -/*! RST_DF_ERR - ECC Double Fault during Reset Recovery - * 0b0..No double-bit faults detected during initialization - * 0b1..Double-bit ECC fault was detected during initialization - */ -#define FMUTEST_RESET_STATUS_RST_DF_ERR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_RST_DF_ERR_SHIFT)) & FMUTEST_RESET_STATUS_RST_DF_ERR_MASK) - -#define FMUTEST_RESET_STATUS_SOC_TRIM_DF_ERR_MASK (0x3FC00U) -#define FMUTEST_RESET_STATUS_SOC_TRIM_DF_ERR_SHIFT (10U) -/*! SOC_TRIM_DF_ERR - ECC Double Fault during load of SoC Trim phrases */ -#define FMUTEST_RESET_STATUS_SOC_TRIM_DF_ERR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_SOC_TRIM_DF_ERR_SHIFT)) & FMUTEST_RESET_STATUS_SOC_TRIM_DF_ERR_MASK) - -#define FMUTEST_RESET_STATUS_RST_PATCH_LD_MASK (0x40000U) -#define FMUTEST_RESET_STATUS_RST_PATCH_LD_SHIFT (18U) -/*! RST_PATCH_LD - Reset Patch Required - * 0b0..No patch required to be loaded during reset - * 0b1..Patch loaded during reset - */ -#define FMUTEST_RESET_STATUS_RST_PATCH_LD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_RST_PATCH_LD_SHIFT)) & FMUTEST_RESET_STATUS_RST_PATCH_LD_MASK) - -#define FMUTEST_RESET_STATUS_RECALL_DATA_MISMATCH_MASK (0x80000U) -#define FMUTEST_RESET_STATUS_RECALL_DATA_MISMATCH_SHIFT (19U) -/*! RECALL_DATA_MISMATCH - Recall Data Mismatch - * 0b0..Data read towards end of reset matched data read for Recall - * 0b1..Data read towards end of reset did not match data read for recall - */ -#define FMUTEST_RESET_STATUS_RECALL_DATA_MISMATCH(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RESET_STATUS_RECALL_DATA_MISMATCH_SHIFT)) & FMUTEST_RESET_STATUS_RECALL_DATA_MISMATCH_MASK) -/*! @} */ - -/*! @name MCTL - FMU Control Register */ -/*! @{ */ - -#define FMUTEST_MCTL_COREHLD_MASK (0x1U) -#define FMUTEST_MCTL_COREHLD_SHIFT (0U) -/*! COREHLD - Core Hold - * 0b0..CPU access is allowed - * 0b1..CPU access must be blocked - */ -#define FMUTEST_MCTL_COREHLD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_COREHLD_SHIFT)) & FMUTEST_MCTL_COREHLD_MASK) - -#define FMUTEST_MCTL_LSACT_EN_MASK (0x4U) -#define FMUTEST_MCTL_LSACT_EN_SHIFT (2U) -/*! LSACT_EN - LSACTIVE Feature Enable - * 0b0..LSACTIVE feature disabled completely: FCTRL[LSACTIVE] is forced low and no longer writable, LVE cannot assert at the TSMC array interface. - * 0b1..LSACTIVE feature fully enabled and controllable by SoC and internal UINT SM. - */ -#define FMUTEST_MCTL_LSACT_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_LSACT_EN_SHIFT)) & FMUTEST_MCTL_LSACT_EN_MASK) - -#define FMUTEST_MCTL_LSACTWREN_MASK (0x8U) -#define FMUTEST_MCTL_LSACTWREN_SHIFT (3U) -/*! LSACTWREN - LSACTIVE Write Enable - * 0b0..Unrestricted write access allowed - * 0b1..Write access while CMP set must match CMDDID and CMDPRT - */ -#define FMUTEST_MCTL_LSACTWREN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_LSACTWREN_SHIFT)) & FMUTEST_MCTL_LSACTWREN_MASK) - -#define FMUTEST_MCTL_MASTER_REPAIR_EN_MASK (0x10U) -#define FMUTEST_MCTL_MASTER_REPAIR_EN_SHIFT (4U) -/*! MASTER_REPAIR_EN - Master Repair Enable - * 0b0..Repair disabled - * 0b1..Repair enable determined by bit 0 of each REPAIR register - */ -#define FMUTEST_MCTL_MASTER_REPAIR_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_MASTER_REPAIR_EN_SHIFT)) & FMUTEST_MCTL_MASTER_REPAIR_EN_MASK) - -#define FMUTEST_MCTL_RFCMDEN_MASK (0x20U) -#define FMUTEST_MCTL_RFCMDEN_SHIFT (5U) -/*! RFCMDEN - RF Active Command Enable Control - * 0b0..Flash commands blocked (CCIF not writable) - * 0b1..Flash commands allowed - */ -#define FMUTEST_MCTL_RFCMDEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_RFCMDEN_SHIFT)) & FMUTEST_MCTL_RFCMDEN_MASK) - -#define FMUTEST_MCTL_CWSABTEN_MASK (0x40U) -#define FMUTEST_MCTL_CWSABTEN_SHIFT (6U) -/*! CWSABTEN - Command Write Sequence Abort Enable - * 0b0..CWS abort feature is disabled - * 0b1..CWS abort feature is enabled - */ -#define FMUTEST_MCTL_CWSABTEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_CWSABTEN_SHIFT)) & FMUTEST_MCTL_CWSABTEN_MASK) - -#define FMUTEST_MCTL_MRGRDDIS_MASK (0x80U) -#define FMUTEST_MCTL_MRGRDDIS_SHIFT (7U) -/*! MRGRDDIS - Margin Read Disable - * 0b0..Margin Read Settings are enabled - * 0b1..Margin Read Settings are disabled - */ -#define FMUTEST_MCTL_MRGRDDIS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_MRGRDDIS_SHIFT)) & FMUTEST_MCTL_MRGRDDIS_MASK) - -#define FMUTEST_MCTL_MRGRD0_MASK (0xF00U) -#define FMUTEST_MCTL_MRGRD0_SHIFT (8U) -/*! MRGRD0 - Margin Read Setting for Program */ -#define FMUTEST_MCTL_MRGRD0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_MRGRD0_SHIFT)) & FMUTEST_MCTL_MRGRD0_MASK) - -#define FMUTEST_MCTL_MRGRD1_MASK (0xF000U) -#define FMUTEST_MCTL_MRGRD1_SHIFT (12U) -/*! MRGRD1 - Margin Read Setting for Erase */ -#define FMUTEST_MCTL_MRGRD1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_MRGRD1_SHIFT)) & FMUTEST_MCTL_MRGRD1_MASK) - -#define FMUTEST_MCTL_ERSAACK_MASK (0x10000U) -#define FMUTEST_MCTL_ERSAACK_SHIFT (16U) -/*! ERSAACK - Mass Erase (Erase All) Acknowledge - * 0b0..Mass Erase operation is not active (operation has completed or has not started) - * 0b1..Mass Erase operation is active (controller acknowledges that the soc_ersall_req input is asserted and will continue with the operation) - */ -#define FMUTEST_MCTL_ERSAACK(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_ERSAACK_SHIFT)) & FMUTEST_MCTL_ERSAACK_MASK) - -#define FMUTEST_MCTL_SCAN_OBS_MASK (0x80000U) -#define FMUTEST_MCTL_SCAN_OBS_SHIFT (19U) -/*! SCAN_OBS - Scan Observability Control - * 0b0..Normal functional behavior - * 0b1..Enables observation of signals that may otherwise be ATPG untestable - */ -#define FMUTEST_MCTL_SCAN_OBS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_SCAN_OBS_SHIFT)) & FMUTEST_MCTL_SCAN_OBS_MASK) - -#define FMUTEST_MCTL_BIST_CTL_MASK (0x100000U) -#define FMUTEST_MCTL_BIST_CTL_SHIFT (20U) -/*! BIST_CTL - BIST IP Control - * 0b0..BIST IP disabled - * 0b1..BIST IP enabled - */ -#define FMUTEST_MCTL_BIST_CTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_BIST_CTL_SHIFT)) & FMUTEST_MCTL_BIST_CTL_MASK) - -#define FMUTEST_MCTL_SMWR_CTL_MASK (0x200000U) -#define FMUTEST_MCTL_SMWR_CTL_SHIFT (21U) -/*! SMWR_CTL - SMWR IP Control - * 0b0..SMWR IP disabled - * 0b1..SMWR IP enabled - */ -#define FMUTEST_MCTL_SMWR_CTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_SMWR_CTL_SHIFT)) & FMUTEST_MCTL_SMWR_CTL_MASK) - -#define FMUTEST_MCTL_SALV_DIS_MASK (0x1000000U) -#define FMUTEST_MCTL_SALV_DIS_SHIFT (24U) -/*! SALV_DIS - Salvage Disable - * 0b0..Salvage enabled (ECC used during erase verify) - * 0b1..Salvage disabled (ECC not used during erase verify) - */ -#define FMUTEST_MCTL_SALV_DIS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_SALV_DIS_SHIFT)) & FMUTEST_MCTL_SALV_DIS_MASK) - -#define FMUTEST_MCTL_SOC_ECC_CTL_MASK (0x2000000U) -#define FMUTEST_MCTL_SOC_ECC_CTL_SHIFT (25U) -/*! SOC_ECC_CTL - SOC ECC Control - * 0b0..ECC is enabled for SOC read access - * 0b1..ECC is disabled for SOC read access - */ -#define FMUTEST_MCTL_SOC_ECC_CTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_SOC_ECC_CTL_SHIFT)) & FMUTEST_MCTL_SOC_ECC_CTL_MASK) - -#define FMUTEST_MCTL_FMU_ECC_CTL_MASK (0x4000000U) -#define FMUTEST_MCTL_FMU_ECC_CTL_SHIFT (26U) -/*! FMU_ECC_CTL - FMU ECC Control - * 0b0..ECC is enabled for FMU program operations - * 0b1..ECC is disabled for FMU program operations - */ -#define FMUTEST_MCTL_FMU_ECC_CTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_FMU_ECC_CTL_SHIFT)) & FMUTEST_MCTL_FMU_ECC_CTL_MASK) - -#define FMUTEST_MCTL_BIST_PWR_DIS_MASK (0x20000000U) -#define FMUTEST_MCTL_BIST_PWR_DIS_SHIFT (29U) -/*! BIST_PWR_DIS - BIST Power Mode Disable - * 0b0..BIST DFT logic has full control of SLM and LVE when BIST is enabled (including during commands) - * 0b1..BIST DFT logic has no control of SLM and LVE; power mode RTL is in complete control of SLM and LVE values - */ -#define FMUTEST_MCTL_BIST_PWR_DIS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_BIST_PWR_DIS_SHIFT)) & FMUTEST_MCTL_BIST_PWR_DIS_MASK) - -#define FMUTEST_MCTL_OSC_H_MASK (0x80000000U) -#define FMUTEST_MCTL_OSC_H_SHIFT (31U) -/*! OSC_H - Oscillator control - * 0b0..Use APB clock - * 0b1..Use a known fixed-frequency clock, e.g. 12 MHz - */ -#define FMUTEST_MCTL_OSC_H(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MCTL_OSC_H_SHIFT)) & FMUTEST_MCTL_OSC_H_MASK) -/*! @} */ - -/*! @name BSEL_GEN - FMU Block Select Generation Register */ -/*! @{ */ - -#define FMUTEST_BSEL_GEN_SBSEL_GEN_MASK (0x3U) -#define FMUTEST_BSEL_GEN_SBSEL_GEN_SHIFT (0U) -/*! SBSEL_GEN - Generated SBSEL */ -#define FMUTEST_BSEL_GEN_SBSEL_GEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BSEL_GEN_SBSEL_GEN_SHIFT)) & FMUTEST_BSEL_GEN_SBSEL_GEN_MASK) - -#define FMUTEST_BSEL_GEN_MBSEL_GEN_MASK (0x300U) -#define FMUTEST_BSEL_GEN_MBSEL_GEN_SHIFT (8U) -/*! MBSEL_GEN - Generated MBSEL */ -#define FMUTEST_BSEL_GEN_MBSEL_GEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BSEL_GEN_MBSEL_GEN_SHIFT)) & FMUTEST_BSEL_GEN_MBSEL_GEN_MASK) -/*! @} */ - -/*! @name PWR_OPT - Power Mode Options Register */ -/*! @{ */ - -#define FMUTEST_PWR_OPT_PD_CDIV_MASK (0xFFU) -#define FMUTEST_PWR_OPT_PD_CDIV_SHIFT (0U) -/*! PD_CDIV - Power Down Clock Divider Setting */ -#define FMUTEST_PWR_OPT_PD_CDIV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PWR_OPT_PD_CDIV_SHIFT)) & FMUTEST_PWR_OPT_PD_CDIV_MASK) - -#define FMUTEST_PWR_OPT_SLM_COUNT_MASK (0x3FF0000U) -#define FMUTEST_PWR_OPT_SLM_COUNT_SHIFT (16U) -/*! SLM_COUNT - Sleep Recovery Timer Count */ -#define FMUTEST_PWR_OPT_SLM_COUNT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PWR_OPT_SLM_COUNT_SHIFT)) & FMUTEST_PWR_OPT_SLM_COUNT_MASK) - -#define FMUTEST_PWR_OPT_PD_TIMER_EN_MASK (0x80000000U) -#define FMUTEST_PWR_OPT_PD_TIMER_EN_SHIFT (31U) -/*! PD_TIMER_EN - Power Down BIST Timer Enable - * 0b0..BIST timer is not triggered during Power Down recovery - * 0b1..BIST timer is triggered during Power Down recovery (default behavior) - */ -#define FMUTEST_PWR_OPT_PD_TIMER_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PWR_OPT_PD_TIMER_EN_SHIFT)) & FMUTEST_PWR_OPT_PD_TIMER_EN_MASK) -/*! @} */ - -/*! @name CMD_CHECK - FMU Command Check Register */ -/*! @{ */ - -#define FMUTEST_CMD_CHECK_ALIGNFAIL_PHR_MASK (0x1U) -#define FMUTEST_CMD_CHECK_ALIGNFAIL_PHR_SHIFT (0U) -/*! ALIGNFAIL_PHR - Phrase Alignment Fail - * 0b0..The address is phrase-aligned - * 0b1..The address is not phrase-aligned - */ -#define FMUTEST_CMD_CHECK_ALIGNFAIL_PHR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ALIGNFAIL_PHR_SHIFT)) & FMUTEST_CMD_CHECK_ALIGNFAIL_PHR_MASK) - -#define FMUTEST_CMD_CHECK_ALIGNFAIL_PG_MASK (0x2U) -#define FMUTEST_CMD_CHECK_ALIGNFAIL_PG_SHIFT (1U) -/*! ALIGNFAIL_PG - Page Alignment Fail - * 0b0..The address is page-aligned - * 0b1..The address is not page-aligned - */ -#define FMUTEST_CMD_CHECK_ALIGNFAIL_PG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ALIGNFAIL_PG_SHIFT)) & FMUTEST_CMD_CHECK_ALIGNFAIL_PG_MASK) - -#define FMUTEST_CMD_CHECK_ALIGNFAIL_SCR_MASK (0x4U) -#define FMUTEST_CMD_CHECK_ALIGNFAIL_SCR_SHIFT (2U) -/*! ALIGNFAIL_SCR - Sector Alignment Fail - * 0b0..The address is sector-aligned - * 0b1..The address is not sector-aligned - */ -#define FMUTEST_CMD_CHECK_ALIGNFAIL_SCR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ALIGNFAIL_SCR_SHIFT)) & FMUTEST_CMD_CHECK_ALIGNFAIL_SCR_MASK) - -#define FMUTEST_CMD_CHECK_ALIGNFAIL_BLK_MASK (0x8U) -#define FMUTEST_CMD_CHECK_ALIGNFAIL_BLK_SHIFT (3U) -/*! ALIGNFAIL_BLK - Block Alignment Fail - * 0b0..The address is block-aligned - * 0b1..The address is not block-aligned - */ -#define FMUTEST_CMD_CHECK_ALIGNFAIL_BLK(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ALIGNFAIL_BLK_SHIFT)) & FMUTEST_CMD_CHECK_ALIGNFAIL_BLK_MASK) - -#define FMUTEST_CMD_CHECK_ADDR_FAIL_MASK (0x10U) -#define FMUTEST_CMD_CHECK_ADDR_FAIL_SHIFT (4U) -/*! ADDR_FAIL - Address Fail - * 0b0..The address is within the flash or IFR address space - * 0b1..The address is outside the flash or IFR address space - */ -#define FMUTEST_CMD_CHECK_ADDR_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ADDR_FAIL_SHIFT)) & FMUTEST_CMD_CHECK_ADDR_FAIL_MASK) - -#define FMUTEST_CMD_CHECK_IFR_CMD_MASK (0x20U) -#define FMUTEST_CMD_CHECK_IFR_CMD_SHIFT (5U) -/*! IFR_CMD - IFR Command - * 0b0..The command operates on a main flash address - * 0b1..The command operates on an IFR address - */ -#define FMUTEST_CMD_CHECK_IFR_CMD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_IFR_CMD_SHIFT)) & FMUTEST_CMD_CHECK_IFR_CMD_MASK) - -#define FMUTEST_CMD_CHECK_ALL_CMD_MASK (0x40U) -#define FMUTEST_CMD_CHECK_ALL_CMD_SHIFT (6U) -/*! ALL_CMD - All Blocks Command - * 0b0..The command operates on a single flash block - * 0b1..The command operates on all flash blocks - */ -#define FMUTEST_CMD_CHECK_ALL_CMD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ALL_CMD_SHIFT)) & FMUTEST_CMD_CHECK_ALL_CMD_MASK) - -#define FMUTEST_CMD_CHECK_RANGE_FAIL_MASK (0x80U) -#define FMUTEST_CMD_CHECK_RANGE_FAIL_SHIFT (7U) -/*! RANGE_FAIL - Address Range Fail - * 0b0..The address range is valid - * 0b1..The address range is invalid - */ -#define FMUTEST_CMD_CHECK_RANGE_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_RANGE_FAIL_SHIFT)) & FMUTEST_CMD_CHECK_RANGE_FAIL_MASK) - -#define FMUTEST_CMD_CHECK_SCR_ALIGN_CHK_MASK (0x100U) -#define FMUTEST_CMD_CHECK_SCR_ALIGN_CHK_SHIFT (8U) -/*! SCR_ALIGN_CHK - Sector Alignment Check - * 0b0..No sector alignment check - * 0b1..Sector alignment check - */ -#define FMUTEST_CMD_CHECK_SCR_ALIGN_CHK(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_SCR_ALIGN_CHK_SHIFT)) & FMUTEST_CMD_CHECK_SCR_ALIGN_CHK_MASK) - -#define FMUTEST_CMD_CHECK_OPTION_FAIL_MASK (0x200U) -#define FMUTEST_CMD_CHECK_OPTION_FAIL_SHIFT (9U) -/*! OPTION_FAIL - Option Check Fail - * 0b0..Option check passes for read command or command is not a read command - * 0b1..Option check fails for read command - */ -#define FMUTEST_CMD_CHECK_OPTION_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_OPTION_FAIL_SHIFT)) & FMUTEST_CMD_CHECK_OPTION_FAIL_MASK) - -#define FMUTEST_CMD_CHECK_ILLEGAL_CMD_MASK (0x400U) -#define FMUTEST_CMD_CHECK_ILLEGAL_CMD_SHIFT (10U) -/*! ILLEGAL_CMD - Illegal Command - * 0b0..Command is legal - * 0b1..Command is illegal - */ -#define FMUTEST_CMD_CHECK_ILLEGAL_CMD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_CMD_CHECK_ILLEGAL_CMD_SHIFT)) & FMUTEST_CMD_CHECK_ILLEGAL_CMD_MASK) -/*! @} */ - -/*! @name BSEL - FMU Block Select Register */ -/*! @{ */ - -#define FMUTEST_BSEL_SBSEL_MASK (0x3U) -#define FMUTEST_BSEL_SBSEL_SHIFT (0U) -/*! SBSEL - Slave Block Select */ -#define FMUTEST_BSEL_SBSEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BSEL_SBSEL_SHIFT)) & FMUTEST_BSEL_SBSEL_MASK) - -#define FMUTEST_BSEL_MBSEL_MASK (0x300U) -#define FMUTEST_BSEL_MBSEL_SHIFT (8U) -/*! MBSEL - Master Block Select */ -#define FMUTEST_BSEL_MBSEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BSEL_MBSEL_SHIFT)) & FMUTEST_BSEL_MBSEL_MASK) -/*! @} */ - -/*! @name MSIZE - FMU Memory Size Register */ -/*! @{ */ - -#define FMUTEST_MSIZE_MAXADDR0_MASK (0xFFU) -#define FMUTEST_MSIZE_MAXADDR0_SHIFT (0U) -/*! MAXADDR0 - Size of Flash Block 0 */ -#define FMUTEST_MSIZE_MAXADDR0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MSIZE_MAXADDR0_SHIFT)) & FMUTEST_MSIZE_MAXADDR0_MASK) - -#define FMUTEST_MSIZE_MAXADDR1_MASK (0xFF00U) -#define FMUTEST_MSIZE_MAXADDR1_SHIFT (8U) -/*! MAXADDR1 - Size of Flash Block 1 */ -#define FMUTEST_MSIZE_MAXADDR1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MSIZE_MAXADDR1_SHIFT)) & FMUTEST_MSIZE_MAXADDR1_MASK) -/*! @} */ - -/*! @name FLASH_RD_ADD - Flash Read Address Register */ -/*! @{ */ - -#define FMUTEST_FLASH_RD_ADD_FLASH_RD_ADD_MASK (0xFFFFFFFFU) -#define FMUTEST_FLASH_RD_ADD_FLASH_RD_ADD_SHIFT (0U) -/*! FLASH_RD_ADD - Flash Read Address */ -#define FMUTEST_FLASH_RD_ADD_FLASH_RD_ADD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FLASH_RD_ADD_FLASH_RD_ADD_SHIFT)) & FMUTEST_FLASH_RD_ADD_FLASH_RD_ADD_MASK) -/*! @} */ - -/*! @name FLASH_STOP_ADD - Flash Stop Address Register */ -/*! @{ */ - -#define FMUTEST_FLASH_STOP_ADD_FLASH_STOP_ADD_MASK (0xFFFFFFFFU) -#define FMUTEST_FLASH_STOP_ADD_FLASH_STOP_ADD_SHIFT (0U) -/*! FLASH_STOP_ADD - Flash Stop Address */ -#define FMUTEST_FLASH_STOP_ADD_FLASH_STOP_ADD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FLASH_STOP_ADD_FLASH_STOP_ADD_SHIFT)) & FMUTEST_FLASH_STOP_ADD_FLASH_STOP_ADD_MASK) -/*! @} */ - -/*! @name FLASH_RD_CTRL - Flash Read Control Register */ -/*! @{ */ - -#define FMUTEST_FLASH_RD_CTRL_FLASH_RD_MASK (0x1U) -#define FMUTEST_FLASH_RD_CTRL_FLASH_RD_SHIFT (0U) -/*! FLASH_RD - Flash Read Enable - * 0b0..Manual flash read not enabled.(default) - * 0b1..Manual flash read enabled - */ -#define FMUTEST_FLASH_RD_CTRL_FLASH_RD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FLASH_RD_CTRL_FLASH_RD_SHIFT)) & FMUTEST_FLASH_RD_CTRL_FLASH_RD_MASK) - -#define FMUTEST_FLASH_RD_CTRL_WIDE_LOAD_MASK (0x2U) -#define FMUTEST_FLASH_RD_CTRL_WIDE_LOAD_SHIFT (1U) -/*! WIDE_LOAD - Wide Load Enable - * 0b0..Wide load mode disabled (default) - * 0b1..Wide load mode enabled - */ -#define FMUTEST_FLASH_RD_CTRL_WIDE_LOAD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FLASH_RD_CTRL_WIDE_LOAD_SHIFT)) & FMUTEST_FLASH_RD_CTRL_WIDE_LOAD_MASK) - -#define FMUTEST_FLASH_RD_CTRL_SINGLE_RD_MASK (0x4U) -#define FMUTEST_FLASH_RD_CTRL_SINGLE_RD_SHIFT (2U) -/*! SINGLE_RD - Single Flash Read - * 0b0..Normal UINT operation - * 0b1..UINT configured for single cycle reads - */ -#define FMUTEST_FLASH_RD_CTRL_SINGLE_RD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FLASH_RD_CTRL_SINGLE_RD_SHIFT)) & FMUTEST_FLASH_RD_CTRL_SINGLE_RD_MASK) -/*! @} */ - -/*! @name MM_ADDR - Memory Map Address Register */ -/*! @{ */ - -#define FMUTEST_MM_ADDR_MM_ADDR_MASK (0xFFFFFFFFU) -#define FMUTEST_MM_ADDR_MM_ADDR_SHIFT (0U) -/*! MM_ADDR - Memory Map Address */ -#define FMUTEST_MM_ADDR_MM_ADDR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MM_ADDR_MM_ADDR_SHIFT)) & FMUTEST_MM_ADDR_MM_ADDR_MASK) -/*! @} */ - -/*! @name MM_WDATA - Memory Map Write Data Register */ -/*! @{ */ - -#define FMUTEST_MM_WDATA_MM_WDATA_MASK (0xFFFFFFFFU) -#define FMUTEST_MM_WDATA_MM_WDATA_SHIFT (0U) -/*! MM_WDATA - Memory Map Write Data */ -#define FMUTEST_MM_WDATA_MM_WDATA(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MM_WDATA_MM_WDATA_SHIFT)) & FMUTEST_MM_WDATA_MM_WDATA_MASK) -/*! @} */ - -/*! @name MM_CTL - Memory Map Control Register */ -/*! @{ */ - -#define FMUTEST_MM_CTL_MM_SEL_MASK (0x1U) -#define FMUTEST_MM_CTL_MM_SEL_SHIFT (0U) -/*! MM_SEL - Register Access Enable */ -#define FMUTEST_MM_CTL_MM_SEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MM_CTL_MM_SEL_SHIFT)) & FMUTEST_MM_CTL_MM_SEL_MASK) - -#define FMUTEST_MM_CTL_MM_RD_MASK (0x2U) -#define FMUTEST_MM_CTL_MM_RD_SHIFT (1U) -/*! MM_RD - Register R/W Control - * 0b0..Write to register - * 0b1..Read register - */ -#define FMUTEST_MM_CTL_MM_RD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MM_CTL_MM_RD_SHIFT)) & FMUTEST_MM_CTL_MM_RD_MASK) - -#define FMUTEST_MM_CTL_BIST_ON_MASK (0x4U) -#define FMUTEST_MM_CTL_BIST_ON_SHIFT (2U) -/*! BIST_ON - BIST on - * 0b0..BIST enable not forced by user interface - * 0b1..BIST enable control by user interface - */ -#define FMUTEST_MM_CTL_BIST_ON(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MM_CTL_BIST_ON_SHIFT)) & FMUTEST_MM_CTL_BIST_ON_MASK) - -#define FMUTEST_MM_CTL_FORCE_SW_CLK_MASK (0x8U) -#define FMUTEST_MM_CTL_FORCE_SW_CLK_SHIFT (3U) -/*! FORCE_SW_CLK - Force Switch Clock - * 0b0..Switch clock not forced on (gated normally) - * 0b1..Switch clock forced on - */ -#define FMUTEST_MM_CTL_FORCE_SW_CLK(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MM_CTL_FORCE_SW_CLK_SHIFT)) & FMUTEST_MM_CTL_FORCE_SW_CLK_MASK) -/*! @} */ - -/*! @name UINT_CTL - User Interface Control Register */ -/*! @{ */ - -#define FMUTEST_UINT_CTL_SET_FAIL_MASK (0x1U) -#define FMUTEST_UINT_CTL_SET_FAIL_SHIFT (0U) -/*! SET_FAIL - Set Fail On Exit - * 0b0..FAIL flag should not be set on command exit (no failure detected) - * 0b1..FAIL flag should be set on command exit - */ -#define FMUTEST_UINT_CTL_SET_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_UINT_CTL_SET_FAIL_SHIFT)) & FMUTEST_UINT_CTL_SET_FAIL_MASK) - -#define FMUTEST_UINT_CTL_DBERR_MASK (0x2U) -#define FMUTEST_UINT_CTL_DBERR_SHIFT (1U) -/*! DBERR - Double-Bit ECC Fault Detect - * 0b0..No double-bit fault detected during UINT-driven read sequence - * 0b1..Double-bit fault detected during UINT-driven read sequence - */ -#define FMUTEST_UINT_CTL_DBERR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_UINT_CTL_DBERR_SHIFT)) & FMUTEST_UINT_CTL_DBERR_MASK) -/*! @} */ - -/*! @name RD_DATA0 - Read Data 0 Register */ -/*! @{ */ - -#define FMUTEST_RD_DATA0_RD_DATA0_MASK (0xFFFFFFFFU) -#define FMUTEST_RD_DATA0_RD_DATA0_SHIFT (0U) -/*! RD_DATA0 - Read Data 0 */ -#define FMUTEST_RD_DATA0_RD_DATA0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_DATA0_RD_DATA0_SHIFT)) & FMUTEST_RD_DATA0_RD_DATA0_MASK) -/*! @} */ - -/*! @name RD_DATA1 - Read Data 1 Register */ -/*! @{ */ - -#define FMUTEST_RD_DATA1_RD_DATA1_MASK (0xFFFFFFFFU) -#define FMUTEST_RD_DATA1_RD_DATA1_SHIFT (0U) -/*! RD_DATA1 - Read Data 1 */ -#define FMUTEST_RD_DATA1_RD_DATA1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_DATA1_RD_DATA1_SHIFT)) & FMUTEST_RD_DATA1_RD_DATA1_MASK) -/*! @} */ - -/*! @name RD_DATA2 - Read Data 2 Register */ -/*! @{ */ - -#define FMUTEST_RD_DATA2_RD_DATA2_MASK (0xFFFFFFFFU) -#define FMUTEST_RD_DATA2_RD_DATA2_SHIFT (0U) -/*! RD_DATA2 - Read Data 2 */ -#define FMUTEST_RD_DATA2_RD_DATA2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_DATA2_RD_DATA2_SHIFT)) & FMUTEST_RD_DATA2_RD_DATA2_MASK) -/*! @} */ - -/*! @name RD_DATA3 - Read Data 3 Register */ -/*! @{ */ - -#define FMUTEST_RD_DATA3_RD_DATA3_MASK (0xFFFFFFFFU) -#define FMUTEST_RD_DATA3_RD_DATA3_SHIFT (0U) -/*! RD_DATA3 - Read Data 3 */ -#define FMUTEST_RD_DATA3_RD_DATA3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_DATA3_RD_DATA3_SHIFT)) & FMUTEST_RD_DATA3_RD_DATA3_MASK) -/*! @} */ - -/*! @name PARITY - Parity Register */ -/*! @{ */ - -#define FMUTEST_PARITY_PARITY_MASK (0x1FFU) -#define FMUTEST_PARITY_PARITY_SHIFT (0U) -/*! PARITY - Read data [136:128] */ -#define FMUTEST_PARITY_PARITY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PARITY_PARITY_SHIFT)) & FMUTEST_PARITY_PARITY_MASK) -/*! @} */ - -/*! @name RD_PATH_CTRL_STATUS - Read Path Control and Status Register */ -/*! @{ */ - -#define FMUTEST_RD_PATH_CTRL_STATUS_RD_CAPT_MASK (0xFFU) -#define FMUTEST_RD_PATH_CTRL_STATUS_RD_CAPT_SHIFT (0U) -/*! RD_CAPT - Read Capture Clock Periods */ -#define FMUTEST_RD_PATH_CTRL_STATUS_RD_CAPT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_RD_CAPT_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_RD_CAPT_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_SE_SIZE_MASK (0xFF00U) -#define FMUTEST_RD_PATH_CTRL_STATUS_SE_SIZE_SHIFT (8U) -/*! SE_SIZE - SE Clock Periods */ -#define FMUTEST_RD_PATH_CTRL_STATUS_SE_SIZE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_SE_SIZE_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_SE_SIZE_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_ECC_ENABLEB_MASK (0x10000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_ECC_ENABLEB_SHIFT (16U) -/*! ECC_ENABLEB - ECC Decoder Control - * 0b0..ECC decoder enabled (default) - * 0b1..ECC decoder disabled - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_ECC_ENABLEB(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_ECC_ENABLEB_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_ECC_ENABLEB_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_MISR_EN_MASK (0x20000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_MISR_EN_SHIFT (17U) -/*! MISR_EN - MISR Enable - * 0b0..MISR option disabled (default) - * 0b1..MISR option enabled - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_MISR_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_MISR_EN_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_MISR_EN_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_CPY_PAR_EN_MASK (0x40000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_CPY_PAR_EN_SHIFT (18U) -/*! CPY_PAR_EN - Copy Parity Enable - * 0b0..Copy parity disabled - * 0b1..Copy parity enabled - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_CPY_PAR_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_CPY_PAR_EN_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_CPY_PAR_EN_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_BIST_MUX_TO_SMW_MASK (0x80000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_BIST_MUX_TO_SMW_SHIFT (19U) -/*! BIST_MUX_TO_SMW - BIST Mux to SMW - * 0b0..BIST drives fields - * 0b1..SMW registers drive fields - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_BIST_MUX_TO_SMW(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_BIST_MUX_TO_SMW_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_BIST_MUX_TO_SMW_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_AD_SET_MASK (0xF00000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_AD_SET_SHIFT (20U) -/*! AD_SET - Multi-Cycle Address Setup Time */ -#define FMUTEST_RD_PATH_CTRL_STATUS_AD_SET(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_AD_SET_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_AD_SET_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_EN_MASK (0x1000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_EN_SHIFT (24U) -/*! WR_PATH_EN - Write Path Enable - * 0b0..Writes to BIST setting registers driven by MM_WDATA - * 0b1..Writes to BIST setting registers driven by SMW_DIN - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_EN_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_EN_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_ECC_EN_MASK (0x2000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_ECC_EN_SHIFT (25U) -/*! WR_PATH_ECC_EN - Write Path ECC Enable - * 0b0..ECC encoding disabled - * 0b1..ECC encoding enabled - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_ECC_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_ECC_EN_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_WR_PATH_ECC_EN_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_DBERR_REG_MASK (0x4000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_DBERR_REG_SHIFT (26U) -/*! DBERR_REG - Double-Bit Error - * 0b0..Double-bit fault not detected - * 0b1..Double-bit fault detected on previous UINT flash read - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_DBERR_REG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_DBERR_REG_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_DBERR_REG_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_SBERR_REG_MASK (0x8000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_SBERR_REG_SHIFT (27U) -/*! SBERR_REG - Single-Bit Error - * 0b0..Single-bit fault not detected - * 0b1..Single-bit fault detected on previous UINT flash read - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_SBERR_REG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_SBERR_REG_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_SBERR_REG_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_CPY_PHRASE_EN_MASK (0x10000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_CPY_PHRASE_EN_SHIFT (28U) -/*! CPY_PHRASE_EN - Copy Phrase Enable - * 0b0..Copy Flash read data disabled - * 0b1..Copy Flash read data enabled - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_CPY_PHRASE_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_CPY_PHRASE_EN_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_CPY_PHRASE_EN_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_SMW_ARRAY1_SMW0_SEL_MASK (0x20000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_SMW_ARRAY1_SMW0_SEL_SHIFT (29U) -/*! SMW_ARRAY1_SMW0_SEL - SMW_ARRAY1_SMW0_SEL - * 0b0..Select block 0 - * 0b1..Select block 1 - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_SMW_ARRAY1_SMW0_SEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_SMW_ARRAY1_SMW0_SEL_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_SMW_ARRAY1_SMW0_SEL_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_BIST_ECC_EN_MASK (0x40000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_BIST_ECC_EN_SHIFT (30U) -/*! BIST_ECC_EN - BIST ECC Enable - * 0b0..ECC correction disabled - * 0b1..ECC correction enabled - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_BIST_ECC_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_BIST_ECC_EN_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_BIST_ECC_EN_MASK) - -#define FMUTEST_RD_PATH_CTRL_STATUS_LAST_READ_MASK (0x80000000U) -#define FMUTEST_RD_PATH_CTRL_STATUS_LAST_READ_SHIFT (31U) -/*! LAST_READ - Last Read - * 0b0..Latest read not last in multi-address operation - * 0b1..Latest read last in multi-address operation - */ -#define FMUTEST_RD_PATH_CTRL_STATUS_LAST_READ(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_RD_PATH_CTRL_STATUS_LAST_READ_SHIFT)) & FMUTEST_RD_PATH_CTRL_STATUS_LAST_READ_MASK) -/*! @} */ - -/*! @name SMW_DIN0 - SMW DIN 0 Register */ -/*! @{ */ - -#define FMUTEST_SMW_DIN0_SMW_DIN0_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_DIN0_SMW_DIN0_SHIFT (0U) -/*! SMW_DIN0 - SMW DIN 0 */ -#define FMUTEST_SMW_DIN0_SMW_DIN0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_DIN0_SMW_DIN0_SHIFT)) & FMUTEST_SMW_DIN0_SMW_DIN0_MASK) -/*! @} */ - -/*! @name SMW_DIN1 - SMW DIN 1 Register */ -/*! @{ */ - -#define FMUTEST_SMW_DIN1_SMW_DIN1_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_DIN1_SMW_DIN1_SHIFT (0U) -/*! SMW_DIN1 - SMW DIN 1 */ -#define FMUTEST_SMW_DIN1_SMW_DIN1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_DIN1_SMW_DIN1_SHIFT)) & FMUTEST_SMW_DIN1_SMW_DIN1_MASK) -/*! @} */ - -/*! @name SMW_DIN2 - SMW DIN 2 Register */ -/*! @{ */ - -#define FMUTEST_SMW_DIN2_SMW_DIN2_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_DIN2_SMW_DIN2_SHIFT (0U) -/*! SMW_DIN2 - SMW DIN 2 */ -#define FMUTEST_SMW_DIN2_SMW_DIN2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_DIN2_SMW_DIN2_SHIFT)) & FMUTEST_SMW_DIN2_SMW_DIN2_MASK) -/*! @} */ - -/*! @name SMW_DIN3 - SMW DIN 3 Register */ -/*! @{ */ - -#define FMUTEST_SMW_DIN3_SMW_DIN3_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_DIN3_SMW_DIN3_SHIFT (0U) -/*! SMW_DIN3 - SMW DIN 3 */ -#define FMUTEST_SMW_DIN3_SMW_DIN3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_DIN3_SMW_DIN3_SHIFT)) & FMUTEST_SMW_DIN3_SMW_DIN3_MASK) -/*! @} */ - -/*! @name SMW_ADDR - SMW Address Register */ -/*! @{ */ - -#define FMUTEST_SMW_ADDR_SMW_ADDR_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_ADDR_SMW_ADDR_SHIFT (0U) -/*! SMW_ADDR - SMW Address */ -#define FMUTEST_SMW_ADDR_SMW_ADDR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_ADDR_SMW_ADDR_SHIFT)) & FMUTEST_SMW_ADDR_SMW_ADDR_MASK) -/*! @} */ - -/*! @name SMW_CMD_WAIT - SMW Command and Wait Register */ -/*! @{ */ - -#define FMUTEST_SMW_CMD_WAIT_CMD_MASK (0x7U) -#define FMUTEST_SMW_CMD_WAIT_CMD_SHIFT (0U) -/*! CMD - SMW Command - * 0b000..IDLE - * 0b001..ABORT - * 0b010..SME2 to one-shot mass erase - * 0b011..SME3 to sector erase on selected array - * 0b100..SMP1 to program phrase or page on selected array with shot disabled on previously programmed bit - * 0b101..Reserved for SME4 (multi-sector erase) - * 0b110..SMP2 to program phrase or page on selected array to repair cells of weak program after power loss - * 0b111..Reserved - */ -#define FMUTEST_SMW_CMD_WAIT_CMD(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_CMD_WAIT_CMD_SHIFT)) & FMUTEST_SMW_CMD_WAIT_CMD_MASK) - -#define FMUTEST_SMW_CMD_WAIT_WAIT_EN_MASK (0x8U) -#define FMUTEST_SMW_CMD_WAIT_WAIT_EN_SHIFT (3U) -/*! WAIT_EN - SMW Wait Enable - * 0b0..Wait feature disabled - * 0b1..Wait feature enabled - */ -#define FMUTEST_SMW_CMD_WAIT_WAIT_EN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_CMD_WAIT_WAIT_EN_SHIFT)) & FMUTEST_SMW_CMD_WAIT_WAIT_EN_MASK) - -#define FMUTEST_SMW_CMD_WAIT_WAIT_AUTO_SET_MASK (0x10U) -#define FMUTEST_SMW_CMD_WAIT_WAIT_AUTO_SET_SHIFT (4U) -/*! WAIT_AUTO_SET - SMW Wait Auto Set */ -#define FMUTEST_SMW_CMD_WAIT_WAIT_AUTO_SET(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_CMD_WAIT_WAIT_AUTO_SET_SHIFT)) & FMUTEST_SMW_CMD_WAIT_WAIT_AUTO_SET_MASK) -/*! @} */ - -/*! @name SMW_STATUS - SMW Status Register */ -/*! @{ */ - -#define FMUTEST_SMW_STATUS_SMW_ERR_MASK (0x1U) -#define FMUTEST_SMW_STATUS_SMW_ERR_SHIFT (0U) -/*! SMW_ERR - SMW Error - * 0b0..Error not detected - * 0b1..Error detected - */ -#define FMUTEST_SMW_STATUS_SMW_ERR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_STATUS_SMW_ERR_SHIFT)) & FMUTEST_SMW_STATUS_SMW_ERR_MASK) - -#define FMUTEST_SMW_STATUS_SMW_BUSY_MASK (0x2U) -#define FMUTEST_SMW_STATUS_SMW_BUSY_SHIFT (1U) -/*! SMW_BUSY - SMW Busy - * 0b0..SMW command not active - * 0b1..SMW command is active - */ -#define FMUTEST_SMW_STATUS_SMW_BUSY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_STATUS_SMW_BUSY_SHIFT)) & FMUTEST_SMW_STATUS_SMW_BUSY_MASK) - -#define FMUTEST_SMW_STATUS_BIST_BUSY_MASK (0x4U) -#define FMUTEST_SMW_STATUS_BIST_BUSY_SHIFT (2U) -/*! BIST_BUSY - BIST Busy - * 0b0..BIST Command not active - * 0b1..BIST Command is active - */ -#define FMUTEST_SMW_STATUS_BIST_BUSY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_STATUS_BIST_BUSY_SHIFT)) & FMUTEST_SMW_STATUS_BIST_BUSY_MASK) -/*! @} */ - -/*! @name SOCTRIM0_0 - SoC Trim Phrase 0 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM0_0_TRIM0_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM0_0_TRIM0_0_SHIFT (0U) -/*! TRIM0_0 - TRIM0_0 */ -#define FMUTEST_SOCTRIM0_0_TRIM0_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM0_0_TRIM0_0_SHIFT)) & FMUTEST_SOCTRIM0_0_TRIM0_0_MASK) -/*! @} */ - -/*! @name SOCTRIM0_1 - SoC Trim Phrase 0 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM0_1_TRIM0_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM0_1_TRIM0_1_SHIFT (0U) -/*! TRIM0_1 - TRIM0_1 */ -#define FMUTEST_SOCTRIM0_1_TRIM0_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM0_1_TRIM0_1_SHIFT)) & FMUTEST_SOCTRIM0_1_TRIM0_1_MASK) -/*! @} */ - -/*! @name SOCTRIM0_2 - SoC Trim Phrase 0 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM0_2_TRIM0_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM0_2_TRIM0_2_SHIFT (0U) -/*! TRIM0_2 - TRIM0_2 */ -#define FMUTEST_SOCTRIM0_2_TRIM0_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM0_2_TRIM0_2_SHIFT)) & FMUTEST_SOCTRIM0_2_TRIM0_2_MASK) -/*! @} */ - -/*! @name SOCTRIM0_3 - SoC Trim Phrase 0 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM0_3_TRIM0_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM0_3_TRIM0_3_SHIFT (0U) -/*! TRIM0_3 - TRIM0_3 */ -#define FMUTEST_SOCTRIM0_3_TRIM0_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM0_3_TRIM0_3_SHIFT)) & FMUTEST_SOCTRIM0_3_TRIM0_3_MASK) -/*! @} */ - -/*! @name SOCTRIM1_0 - SoC Trim Phrase 1 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM1_0_TRIM1_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM1_0_TRIM1_0_SHIFT (0U) -/*! TRIM1_0 - TRIM1_0 */ -#define FMUTEST_SOCTRIM1_0_TRIM1_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM1_0_TRIM1_0_SHIFT)) & FMUTEST_SOCTRIM1_0_TRIM1_0_MASK) -/*! @} */ - -/*! @name SOCTRIM1_1 - SoC Trim Phrase 1 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM1_1_TRIM1_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM1_1_TRIM1_1_SHIFT (0U) -/*! TRIM1_1 - TRIM1_1 */ -#define FMUTEST_SOCTRIM1_1_TRIM1_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM1_1_TRIM1_1_SHIFT)) & FMUTEST_SOCTRIM1_1_TRIM1_1_MASK) -/*! @} */ - -/*! @name SOCTRIM1_2 - SoC Trim Phrase 1 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM1_2_TRIM1_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM1_2_TRIM1_2_SHIFT (0U) -/*! TRIM1_2 - TRIM1_2 */ -#define FMUTEST_SOCTRIM1_2_TRIM1_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM1_2_TRIM1_2_SHIFT)) & FMUTEST_SOCTRIM1_2_TRIM1_2_MASK) -/*! @} */ - -/*! @name SOCTRIM1_3 - SoC Trim Phrase 1 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM1_3_TRIM1_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM1_3_TRIM1_3_SHIFT (0U) -/*! TRIM1_3 - TRIM1_3 */ -#define FMUTEST_SOCTRIM1_3_TRIM1_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM1_3_TRIM1_3_SHIFT)) & FMUTEST_SOCTRIM1_3_TRIM1_3_MASK) -/*! @} */ - -/*! @name SOCTRIM2_0 - SoC Trim Phrase 2 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM2_0_TRIM2_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM2_0_TRIM2_0_SHIFT (0U) -/*! TRIM2_0 - TRIM2_0 */ -#define FMUTEST_SOCTRIM2_0_TRIM2_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM2_0_TRIM2_0_SHIFT)) & FMUTEST_SOCTRIM2_0_TRIM2_0_MASK) -/*! @} */ - -/*! @name SOCTRIM2_1 - SoC Trim Phrase 2 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM2_1_TRIM2_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM2_1_TRIM2_1_SHIFT (0U) -/*! TRIM2_1 - TRIM2_1 */ -#define FMUTEST_SOCTRIM2_1_TRIM2_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM2_1_TRIM2_1_SHIFT)) & FMUTEST_SOCTRIM2_1_TRIM2_1_MASK) -/*! @} */ - -/*! @name SOCTRIM2_2 - SoC Trim Phrase 2 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM2_2_TRIM2_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM2_2_TRIM2_2_SHIFT (0U) -/*! TRIM2_2 - TRIM2_2 */ -#define FMUTEST_SOCTRIM2_2_TRIM2_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM2_2_TRIM2_2_SHIFT)) & FMUTEST_SOCTRIM2_2_TRIM2_2_MASK) -/*! @} */ - -/*! @name SOCTRIM2_3 - SoC Trim Phrase 2 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM2_3_TRIM2_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM2_3_TRIM2_3_SHIFT (0U) -/*! TRIM2_3 - TRIM2_3 */ -#define FMUTEST_SOCTRIM2_3_TRIM2_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM2_3_TRIM2_3_SHIFT)) & FMUTEST_SOCTRIM2_3_TRIM2_3_MASK) -/*! @} */ - -/*! @name SOCTRIM3_0 - SoC Trim Phrase 3 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM3_0_TRIM3_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM3_0_TRIM3_0_SHIFT (0U) -/*! TRIM3_0 - TRIM3_0 */ -#define FMUTEST_SOCTRIM3_0_TRIM3_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM3_0_TRIM3_0_SHIFT)) & FMUTEST_SOCTRIM3_0_TRIM3_0_MASK) -/*! @} */ - -/*! @name SOCTRIM3_1 - SoC Trim Phrase 3 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM3_1_TRIM3_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM3_1_TRIM3_1_SHIFT (0U) -/*! TRIM3_1 - TRIM3_1 */ -#define FMUTEST_SOCTRIM3_1_TRIM3_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM3_1_TRIM3_1_SHIFT)) & FMUTEST_SOCTRIM3_1_TRIM3_1_MASK) -/*! @} */ - -/*! @name SOCTRIM3_2 - SoC Trim Phrase 3 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM3_2_TRIM3_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM3_2_TRIM3_2_SHIFT (0U) -/*! TRIM3_2 - TRIM3_2 */ -#define FMUTEST_SOCTRIM3_2_TRIM3_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM3_2_TRIM3_2_SHIFT)) & FMUTEST_SOCTRIM3_2_TRIM3_2_MASK) -/*! @} */ - -/*! @name SOCTRIM3_3 - SoC Trim Phrase 3 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM3_3_TRIM3_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM3_3_TRIM3_3_SHIFT (0U) -/*! TRIM3_3 - TRIM3_3 */ -#define FMUTEST_SOCTRIM3_3_TRIM3_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM3_3_TRIM3_3_SHIFT)) & FMUTEST_SOCTRIM3_3_TRIM3_3_MASK) -/*! @} */ - -/*! @name SOCTRIM4_0 - SoC Trim Phrase 4 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM4_0_TRIM4_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM4_0_TRIM4_0_SHIFT (0U) -/*! TRIM4_0 - TRIM4_0 */ -#define FMUTEST_SOCTRIM4_0_TRIM4_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM4_0_TRIM4_0_SHIFT)) & FMUTEST_SOCTRIM4_0_TRIM4_0_MASK) -/*! @} */ - -/*! @name SOCTRIM4_1 - SoC Trim Phrase 4 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM4_1_TRIM4_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM4_1_TRIM4_1_SHIFT (0U) -/*! TRIM4_1 - TRIM4_1 */ -#define FMUTEST_SOCTRIM4_1_TRIM4_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM4_1_TRIM4_1_SHIFT)) & FMUTEST_SOCTRIM4_1_TRIM4_1_MASK) -/*! @} */ - -/*! @name SOCTRIM4_2 - SoC Trim Phrase 4 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM4_2_TRIM4_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM4_2_TRIM4_2_SHIFT (0U) -/*! TRIM4_2 - TRIM4_2 */ -#define FMUTEST_SOCTRIM4_2_TRIM4_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM4_2_TRIM4_2_SHIFT)) & FMUTEST_SOCTRIM4_2_TRIM4_2_MASK) -/*! @} */ - -/*! @name SOCTRIM4_3 - SoC Trim Phrase 4 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM4_3_TRIM4_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM4_3_TRIM4_3_SHIFT (0U) -/*! TRIM4_3 - TRIM4_3 */ -#define FMUTEST_SOCTRIM4_3_TRIM4_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM4_3_TRIM4_3_SHIFT)) & FMUTEST_SOCTRIM4_3_TRIM4_3_MASK) -/*! @} */ - -/*! @name SOCTRIM5_0 - SoC Trim Phrase 5 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM5_0_TRIM5_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM5_0_TRIM5_0_SHIFT (0U) -/*! TRIM5_0 - TRIM5_0 */ -#define FMUTEST_SOCTRIM5_0_TRIM5_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM5_0_TRIM5_0_SHIFT)) & FMUTEST_SOCTRIM5_0_TRIM5_0_MASK) -/*! @} */ - -/*! @name SOCTRIM5_1 - SoC Trim Phrase 5 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM5_1_TRIM5_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM5_1_TRIM5_1_SHIFT (0U) -/*! TRIM5_1 - TRIM5_1 */ -#define FMUTEST_SOCTRIM5_1_TRIM5_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM5_1_TRIM5_1_SHIFT)) & FMUTEST_SOCTRIM5_1_TRIM5_1_MASK) -/*! @} */ - -/*! @name SOCTRIM5_2 - SoC Trim Phrase 5 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM5_2_TRIM5_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM5_2_TRIM5_2_SHIFT (0U) -/*! TRIM5_2 - TRIM5_2 */ -#define FMUTEST_SOCTRIM5_2_TRIM5_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM5_2_TRIM5_2_SHIFT)) & FMUTEST_SOCTRIM5_2_TRIM5_2_MASK) -/*! @} */ - -/*! @name SOCTRIM5_3 - SoC Trim Phrase 5 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM5_3_TRIM5_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM5_3_TRIM5_3_SHIFT (0U) -/*! TRIM5_3 - TRIM5_3 */ -#define FMUTEST_SOCTRIM5_3_TRIM5_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM5_3_TRIM5_3_SHIFT)) & FMUTEST_SOCTRIM5_3_TRIM5_3_MASK) -/*! @} */ - -/*! @name SOCTRIM6_0 - SoC Trim Phrase 6 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM6_0_TRIM6_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM6_0_TRIM6_0_SHIFT (0U) -/*! TRIM6_0 - TRIM6_0 */ -#define FMUTEST_SOCTRIM6_0_TRIM6_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM6_0_TRIM6_0_SHIFT)) & FMUTEST_SOCTRIM6_0_TRIM6_0_MASK) -/*! @} */ - -/*! @name SOCTRIM6_1 - SoC Trim Phrase 6 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM6_1_TRIM6_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM6_1_TRIM6_1_SHIFT (0U) -/*! TRIM6_1 - TRIM6_1 */ -#define FMUTEST_SOCTRIM6_1_TRIM6_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM6_1_TRIM6_1_SHIFT)) & FMUTEST_SOCTRIM6_1_TRIM6_1_MASK) -/*! @} */ - -/*! @name SOCTRIM6_2 - SoC Trim Phrase 6 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM6_2_TRIM6_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM6_2_TRIM6_2_SHIFT (0U) -/*! TRIM6_2 - TRIM6_2 */ -#define FMUTEST_SOCTRIM6_2_TRIM6_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM6_2_TRIM6_2_SHIFT)) & FMUTEST_SOCTRIM6_2_TRIM6_2_MASK) -/*! @} */ - -/*! @name SOCTRIM6_3 - SoC Trim Phrase 6 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM6_3_TRIM6_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM6_3_TRIM6_3_SHIFT (0U) -/*! TRIM6_3 - TRIM6_3 */ -#define FMUTEST_SOCTRIM6_3_TRIM6_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM6_3_TRIM6_3_SHIFT)) & FMUTEST_SOCTRIM6_3_TRIM6_3_MASK) -/*! @} */ - -/*! @name SOCTRIM7_0 - SoC Trim Phrase 7 Word 0 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM7_0_TRIM7_0_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM7_0_TRIM7_0_SHIFT (0U) -/*! TRIM7_0 - TRIM7_0 */ -#define FMUTEST_SOCTRIM7_0_TRIM7_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM7_0_TRIM7_0_SHIFT)) & FMUTEST_SOCTRIM7_0_TRIM7_0_MASK) -/*! @} */ - -/*! @name SOCTRIM7_1 - SoC Trim Phrase 7 Word 1 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM7_1_TRIM7_1_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM7_1_TRIM7_1_SHIFT (0U) -/*! TRIM7_1 - TRIM7_1 */ -#define FMUTEST_SOCTRIM7_1_TRIM7_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM7_1_TRIM7_1_SHIFT)) & FMUTEST_SOCTRIM7_1_TRIM7_1_MASK) -/*! @} */ - -/*! @name SOCTRIM7_2 - SoC Trim Phrase 7 Word 2 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM7_2_TRIM7_2_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM7_2_TRIM7_2_SHIFT (0U) -/*! TRIM7_2 - TRIM7_2 */ -#define FMUTEST_SOCTRIM7_2_TRIM7_2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM7_2_TRIM7_2_SHIFT)) & FMUTEST_SOCTRIM7_2_TRIM7_2_MASK) -/*! @} */ - -/*! @name SOCTRIM7_3 - SoC Trim Phrase 7 Word 3 Register */ -/*! @{ */ - -#define FMUTEST_SOCTRIM7_3_TRIM7_3_MASK (0xFFFFFFFFU) -#define FMUTEST_SOCTRIM7_3_TRIM7_3_SHIFT (0U) -/*! TRIM7_3 - TRIM7_3 */ -#define FMUTEST_SOCTRIM7_3_TRIM7_3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SOCTRIM7_3_TRIM7_3_SHIFT)) & FMUTEST_SOCTRIM7_3_TRIM7_3_MASK) -/*! @} */ - -/*! @name R_IP_CONFIG - BIST Configuration Register */ -/*! @{ */ - -#define FMUTEST_R_IP_CONFIG_IPSEL0_MASK (0x3U) -#define FMUTEST_R_IP_CONFIG_IPSEL0_SHIFT (0U) -/*! IPSEL0 - Block 0 Select Control - * 0b00..Unselect block 0 - * 0b01..not used, reserved - * 0b10..Enable block 0 test, repair off (default) - * 0b11..Enable block 0 test, repair on - */ -#define FMUTEST_R_IP_CONFIG_IPSEL0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_IPSEL0_SHIFT)) & FMUTEST_R_IP_CONFIG_IPSEL0_MASK) - -#define FMUTEST_R_IP_CONFIG_IPSEL1_MASK (0xCU) -#define FMUTEST_R_IP_CONFIG_IPSEL1_SHIFT (2U) -/*! IPSEL1 - Block 1 Select Control - * 0b00..Unselect block 1 - * 0b01..not used, reserved - * 0b10..Enable block 1 test, repair off (default) - * 0b11..Enable block 1 test, repair on - */ -#define FMUTEST_R_IP_CONFIG_IPSEL1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_IPSEL1_SHIFT)) & FMUTEST_R_IP_CONFIG_IPSEL1_MASK) - -#define FMUTEST_R_IP_CONFIG_BIST_CDIVL_MASK (0xFF0U) -#define FMUTEST_R_IP_CONFIG_BIST_CDIVL_SHIFT (4U) -/*! BIST_CDIVL - Clock Divide Scalar for Long Pulse */ -#define FMUTEST_R_IP_CONFIG_BIST_CDIVL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_BIST_CDIVL_SHIFT)) & FMUTEST_R_IP_CONFIG_BIST_CDIVL_MASK) - -#define FMUTEST_R_IP_CONFIG_CDIVS_MASK (0x7000U) -#define FMUTEST_R_IP_CONFIG_CDIVS_SHIFT (12U) -/*! CDIVS - Number of clock cycles to generate short pulse */ -#define FMUTEST_R_IP_CONFIG_CDIVS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_CDIVS_SHIFT)) & FMUTEST_R_IP_CONFIG_CDIVS_MASK) - -#define FMUTEST_R_IP_CONFIG_BIST_TVFY_MASK (0xF8000U) -#define FMUTEST_R_IP_CONFIG_BIST_TVFY_SHIFT (15U) -/*! BIST_TVFY - Timer adjust for verify */ -#define FMUTEST_R_IP_CONFIG_BIST_TVFY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_BIST_TVFY_SHIFT)) & FMUTEST_R_IP_CONFIG_BIST_TVFY_MASK) - -#define FMUTEST_R_IP_CONFIG_TSTCTL_MASK (0x300000U) -#define FMUTEST_R_IP_CONFIG_TSTCTL_SHIFT (20U) -/*! TSTCTL - BIST self-test control - * 0b00..Default, disable both BIST self-test and MISR - * 0b01..Enable BIST self-test mode DOUT from macro will be forced to '0', and disable MISR. - * 0b10..Enable MISR - * 0b11..Enable both BIST self-test mode and MISR - */ -#define FMUTEST_R_IP_CONFIG_TSTCTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_TSTCTL_SHIFT)) & FMUTEST_R_IP_CONFIG_TSTCTL_MASK) - -#define FMUTEST_R_IP_CONFIG_DBGCTL_MASK (0x400000U) -#define FMUTEST_R_IP_CONFIG_DBGCTL_SHIFT (22U) -/*! DBGCTL - Debug feature control - * 0b0..Default - * 0b1..Enable debug feature to collect failure address and data. - */ -#define FMUTEST_R_IP_CONFIG_DBGCTL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_DBGCTL_SHIFT)) & FMUTEST_R_IP_CONFIG_DBGCTL_MASK) - -#define FMUTEST_R_IP_CONFIG_BIST_CLK_SEL_MASK (0x800000U) -#define FMUTEST_R_IP_CONFIG_BIST_CLK_SEL_SHIFT (23U) -/*! BIST_CLK_SEL - BIST Clock Select */ -#define FMUTEST_R_IP_CONFIG_BIST_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_BIST_CLK_SEL_SHIFT)) & FMUTEST_R_IP_CONFIG_BIST_CLK_SEL_MASK) - -#define FMUTEST_R_IP_CONFIG_SMWTST_MASK (0x3000000U) -#define FMUTEST_R_IP_CONFIG_SMWTST_SHIFT (24U) -/*! SMWTST - SMWR DOUT Function Control - * 0b00..Default - * 0b01..Enable SMWR self-test mode, DOUT from macro will be forced to all 0 - * 0b10..Enable SMWR self-test mode, DOUT from macro will be forced to all 1 - * 0b11..Reserved (unused) - */ -#define FMUTEST_R_IP_CONFIG_SMWTST(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_SMWTST_SHIFT)) & FMUTEST_R_IP_CONFIG_SMWTST_MASK) - -#define FMUTEST_R_IP_CONFIG_ECCEN_MASK (0x4000000U) -#define FMUTEST_R_IP_CONFIG_ECCEN_SHIFT (26U) -/*! ECCEN - BIST ECC Control - * 0b0..Default mode (no ECC encode or decode) - * 0b1..Enable ECC encode/decode - */ -#define FMUTEST_R_IP_CONFIG_ECCEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_IP_CONFIG_ECCEN_SHIFT)) & FMUTEST_R_IP_CONFIG_ECCEN_MASK) -/*! @} */ - -/*! @name R_TESTCODE - BIST Test Code Register */ -/*! @{ */ - -#define FMUTEST_R_TESTCODE_TESTCODE_MASK (0x3FU) -#define FMUTEST_R_TESTCODE_TESTCODE_SHIFT (0U) -/*! TESTCODE - Used to store test code information before running TMR-RST/TMRSET BIST command */ -#define FMUTEST_R_TESTCODE_TESTCODE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TESTCODE_TESTCODE_SHIFT)) & FMUTEST_R_TESTCODE_TESTCODE_MASK) -/*! @} */ - -/*! @name R_DFT_CTRL - BIST DFT Control Register */ -/*! @{ */ - -#define FMUTEST_R_DFT_CTRL_DFT_XADR_MASK (0xFU) -#define FMUTEST_R_DFT_CTRL_DFT_XADR_SHIFT (0U) -/*! DFT_XADR - DFT XADR Pattern - * 0b0000..XADR fixed, no change at all - * 0b0001..XADR increased by 1 after row. For READ operation, XADR increases by 1 after reading the last word of - * row. For PROG operation, XADR increases by 1 after NVSTR falls. - * 0b0010..XADR increased for diagonal. For PROG-DIAGONAL operation, XADR is increased to create diagonal pattern. - * 0b0011..XADR increased by sector. During ERASE operation, XADR increased by number of rows in a sector when NVSTR falls. - * 0b0100..XADR inversed. XADR is inversed after reading one word or after programming one row when NVSTR falls. - * 0b0101..XADR increased by 2 after row. For READ operation, XADR is increased by 2 after reading the last word - * of a row. For PROG operation, XADR is increased by 2 when NVSTR falls. - * 0b0110..XADR[0] inversed. XADR[0] is inversed after reading one word or after programming one row when NVSTR falls. - * 0b0111..XADR increased by 1. For READ operations only, XADR increased by 1 after each read cycle. - * 0b1000..XADR decreased by 1 after row. For READ operations only, XADR is decreased by 1 after YADR decreases to 0. - * 0b1001..XADR decreased by 1. For READ operations only, XADR is decreased by 1 after each read cycle. - */ -#define FMUTEST_R_DFT_CTRL_DFT_XADR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DFT_CTRL_DFT_XADR_SHIFT)) & FMUTEST_R_DFT_CTRL_DFT_XADR_MASK) - -#define FMUTEST_R_DFT_CTRL_DFT_YADR_MASK (0xF0U) -#define FMUTEST_R_DFT_CTRL_DFT_YADR_SHIFT (4U) -/*! DFT_YADR - DFT YADR Pattern - * 0b0000..YADR fixed, no change at all - * 0b0001..YADR for ICKBD. For PROG and READ operations, YADR changed to generate inverse checkerboard pattern. - * 0b0010..YADR for CKBD. For PROG and READ operations, YADR changed to generate checkerboard pattern. - * 0b0011..YADR increased by 1. For READ operations, YADR increased by 1 after each read cycle. For PROG - * operations, YADR increased by 1 after YE falls. - * 0b0100..YADR increased for diagonal. For PROG-DIAGONAL operation, YADR is increased to create diagonal pattern. - * 0b0101..YADR inversed. YADR is inversed after reading one word or after programming one word when YE falls. - * 0b0110..YADR[0] inversed. YADR[0] is inversed after reading one word or after programming one word when YE falls. - * 0b0111..YADR increased by 1 after last row. For READ operations only, YADR is increased by 1 after XADR reaches last row. - * 0b1000..YADR decreased by 1. For READ operations only, YADR is decreased by 1 after each read cycle. - * 0b1001..YADR decreased by 1 after first row. For READ operations only, YADR is decreased by 1 after XADR decreases to 0. - */ -#define FMUTEST_R_DFT_CTRL_DFT_YADR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DFT_CTRL_DFT_YADR_SHIFT)) & FMUTEST_R_DFT_CTRL_DFT_YADR_MASK) - -#define FMUTEST_R_DFT_CTRL_DFT_DATA_MASK (0xF00U) -#define FMUTEST_R_DFT_CTRL_DFT_DATA_SHIFT (8U) -/*! DFT_DATA - DFT Data Pattern - * 0b0000..CKBD pattern. For READ operations only, compare DOUT with checkerboard data pattern for each read cycle. - * 0b0001..ICKBD pattern. For READ operations only, compare DOUT with inverse checkerboard data pattern for each read cycle. - * 0b0010..Diagonal pattern. Used for READ operations only, compare DOUT to diagonal pattern. - * 0b0011..Fixed data pattern. For READ operations, comparison to DOUT for selected groups; refer to - * R_ADR_CTRL[GRPSEL] for modules with multiple groups. - * 0b0100..Random data pattern which will be generated based on the initial seed set in R_DATA; for READ - * operations, used for DOUT comparison of selected groups. For PROG operations, used to control DIN of selected - * groups. - * 0b0101..DOUT based pattern. For READ operations only, DOUT of selected group will be latched in R_DATA. If - * more than one group is selected in R_ADR_CTRL[GRPSEL], the group with the lower index will be latched. - * 0b0110..R_DATA based pattern. For READ operations, expected DOUT value of selected groups equals to R_DATA - * when XADR[0]==YADR[0] or ~R_DATA when XADR[0]!=YADR[0]. For PROG operations, DIN of selected groups equals - * R_DATA when XADR[0]==YADR[0] or ~R_DATA when XADR[0]!=YADR[0]. - * 0b0111..SCAN-IO pattern. For READ operations, control expected DOUT value of selected groups to SCAN-IO data - * pattern. For PROG operations, control DIN of selected groups to SCAN-IO data pattern. - * 0b1000..REPAIR set. For PROG operation to IFR1(7,1) and IFR1(7,2), R_REPAIR0_0 and R_REPAIR0_1 or R_REPAIR1_0 - * and R_REPAIR1_1 will control DIN. For READ operation on IFR1(7,1) and IFR1(7,2), DOUT will be compared - * against R_REPAIR0_0 and R_REPAIR0_1 or R_REPAIR1_0 andR_REPAIR1_1. When this option is selected, only - * one flash block can be selected. - * 0b1001..REPAIR load. For READ operation only, DOUT from IFR1(7,1) and IFR1(7,2) is loaded to R_REPAIR0 and R_REPAIR1. - */ -#define FMUTEST_R_DFT_CTRL_DFT_DATA(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DFT_CTRL_DFT_DATA_SHIFT)) & FMUTEST_R_DFT_CTRL_DFT_DATA_MASK) - -#define FMUTEST_R_DFT_CTRL_CMP_MASK_MASK (0x3000U) -#define FMUTEST_R_DFT_CTRL_CMP_MASK_SHIFT (12U) -/*! CMP_MASK - Data Compare Mask - * 0b00..Expected data is compared to DOUT - * 0b01..Expected data (only 0s are considered) are compared to DOUT - * 0b10..Expected data (only 1s are considered) are compared to DOUT - */ -#define FMUTEST_R_DFT_CTRL_CMP_MASK(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DFT_CTRL_CMP_MASK_SHIFT)) & FMUTEST_R_DFT_CTRL_CMP_MASK_MASK) - -#define FMUTEST_R_DFT_CTRL_DFT_DATA_SRC_MASK (0x4000U) -#define FMUTEST_R_DFT_CTRL_DFT_DATA_SRC_SHIFT (14U) -/*! DFT_DATA_SRC - DFT Data Source - * 0b0..{R_DATA_CTRL0,R_DATA_CTRL_EX[2:0],R_DATA_CTRL0,R_DATA_CTRL_EX[2:0],R_DATA_CTRL0,R_DATA_CTRL_EX[2:0],R_DATA_CTRL0} is used - * 0b1..{R_DATA_CTRL3,R_DATA_CTRL2_EX[2:0],R_DATA_CTRL2,R_DATA_CTRL1_EX[2:0],R_DATA_CTRL1,R_DATA_CTRL_EX[2:0],R_DATA_CTRL0} is used - */ -#define FMUTEST_R_DFT_CTRL_DFT_DATA_SRC(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DFT_CTRL_DFT_DATA_SRC_SHIFT)) & FMUTEST_R_DFT_CTRL_DFT_DATA_SRC_MASK) -/*! @} */ - -/*! @name R_ADR_CTRL - BIST Address Control Register */ -/*! @{ */ - -#define FMUTEST_R_ADR_CTRL_GRPSEL_MASK (0xFU) -#define FMUTEST_R_ADR_CTRL_GRPSEL_SHIFT (0U) -/*! GRPSEL - Data Group Select - * 0b0000..Select no data - * 0b0001..Select data slice [34:0] - * 0b0010..Select data slice [69:35] - * 0b0100..Select data slice [104:70] - * 0b1000..Select data slice [136:105] - * 0b1111..Select data [136:0] - */ -#define FMUTEST_R_ADR_CTRL_GRPSEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ADR_CTRL_GRPSEL_SHIFT)) & FMUTEST_R_ADR_CTRL_GRPSEL_MASK) - -#define FMUTEST_R_ADR_CTRL_XADR_MASK (0xFFF0U) -#define FMUTEST_R_ADR_CTRL_XADR_SHIFT (4U) -/*! XADR - BIST XADR */ -#define FMUTEST_R_ADR_CTRL_XADR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ADR_CTRL_XADR_SHIFT)) & FMUTEST_R_ADR_CTRL_XADR_MASK) - -#define FMUTEST_R_ADR_CTRL_YADR_MASK (0x1F0000U) -#define FMUTEST_R_ADR_CTRL_YADR_SHIFT (16U) -/*! YADR - BIST YADR */ -#define FMUTEST_R_ADR_CTRL_YADR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ADR_CTRL_YADR_SHIFT)) & FMUTEST_R_ADR_CTRL_YADR_MASK) - -#define FMUTEST_R_ADR_CTRL_PROG_ATTR_MASK (0xE00000U) -#define FMUTEST_R_ADR_CTRL_PROG_ATTR_SHIFT (21U) -/*! PROG_ATTR - Program Attribute - * 0b000..One YE pulse will program one data slice group - * 0b001..One YE pulse will program two data slice groups - * 0b010..One YE pulse will program three data slice groups (reserved) - * 0b011..One YE pulse will program four data slice groups - * 0b100..One YE pulse will program five data slice groups (reserved) - * 0b101..One YE pulse will program six data slice groups (reserved) - * 0b110..One YE pulse will program seven data slice groups (reserved) - * 0b111..One YE pulse will program eight data slice groups (reserved) - */ -#define FMUTEST_R_ADR_CTRL_PROG_ATTR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ADR_CTRL_PROG_ATTR_SHIFT)) & FMUTEST_R_ADR_CTRL_PROG_ATTR_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL0 - BIST Data Control 0 Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL0_DATA0_MASK (0xFFFFFFFFU) -#define FMUTEST_R_DATA_CTRL0_DATA0_SHIFT (0U) -/*! DATA0 - BIST Data 0 Low */ -#define FMUTEST_R_DATA_CTRL0_DATA0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL0_DATA0_SHIFT)) & FMUTEST_R_DATA_CTRL0_DATA0_MASK) -/*! @} */ - -/*! @name R_PIN_CTRL - BIST Pin Control Register */ -/*! @{ */ - -#define FMUTEST_R_PIN_CTRL_MAS1_MASK (0x1U) -#define FMUTEST_R_PIN_CTRL_MAS1_SHIFT (0U) -/*! MAS1 - Mass Erase */ -#define FMUTEST_R_PIN_CTRL_MAS1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_MAS1_SHIFT)) & FMUTEST_R_PIN_CTRL_MAS1_MASK) - -#define FMUTEST_R_PIN_CTRL_IFREN_MASK (0x2U) -#define FMUTEST_R_PIN_CTRL_IFREN_SHIFT (1U) -/*! IFREN - IFR Enable */ -#define FMUTEST_R_PIN_CTRL_IFREN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_IFREN_SHIFT)) & FMUTEST_R_PIN_CTRL_IFREN_MASK) - -#define FMUTEST_R_PIN_CTRL_IFREN1_MASK (0x4U) -#define FMUTEST_R_PIN_CTRL_IFREN1_SHIFT (2U) -/*! IFREN1 - IFR1 Enable */ -#define FMUTEST_R_PIN_CTRL_IFREN1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_IFREN1_SHIFT)) & FMUTEST_R_PIN_CTRL_IFREN1_MASK) - -#define FMUTEST_R_PIN_CTRL_REDEN_MASK (0x8U) -#define FMUTEST_R_PIN_CTRL_REDEN_SHIFT (3U) -/*! REDEN - Redundancy Block Enable */ -#define FMUTEST_R_PIN_CTRL_REDEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_REDEN_SHIFT)) & FMUTEST_R_PIN_CTRL_REDEN_MASK) - -#define FMUTEST_R_PIN_CTRL_LVE_MASK (0x10U) -#define FMUTEST_R_PIN_CTRL_LVE_SHIFT (4U) -/*! LVE - Low Voltage Enable */ -#define FMUTEST_R_PIN_CTRL_LVE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_LVE_SHIFT)) & FMUTEST_R_PIN_CTRL_LVE_MASK) - -#define FMUTEST_R_PIN_CTRL_PV_MASK (0x20U) -#define FMUTEST_R_PIN_CTRL_PV_SHIFT (5U) -/*! PV - Program Verify Enable */ -#define FMUTEST_R_PIN_CTRL_PV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_PV_SHIFT)) & FMUTEST_R_PIN_CTRL_PV_MASK) - -#define FMUTEST_R_PIN_CTRL_EV_MASK (0x40U) -#define FMUTEST_R_PIN_CTRL_EV_SHIFT (6U) -/*! EV - Erase Verify Enable */ -#define FMUTEST_R_PIN_CTRL_EV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_EV_SHIFT)) & FMUTEST_R_PIN_CTRL_EV_MASK) - -#define FMUTEST_R_PIN_CTRL_WIPGM_MASK (0x180U) -#define FMUTEST_R_PIN_CTRL_WIPGM_SHIFT (7U) -/*! WIPGM - Program Current */ -#define FMUTEST_R_PIN_CTRL_WIPGM(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_WIPGM_SHIFT)) & FMUTEST_R_PIN_CTRL_WIPGM_MASK) - -#define FMUTEST_R_PIN_CTRL_WHV_MASK (0x1E00U) -#define FMUTEST_R_PIN_CTRL_WHV_SHIFT (9U) -/*! WHV - High Voltage Level */ -#define FMUTEST_R_PIN_CTRL_WHV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_WHV_SHIFT)) & FMUTEST_R_PIN_CTRL_WHV_MASK) - -#define FMUTEST_R_PIN_CTRL_WMV_MASK (0xE000U) -#define FMUTEST_R_PIN_CTRL_WMV_SHIFT (13U) -/*! WMV - Medium Voltage Level */ -#define FMUTEST_R_PIN_CTRL_WMV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_WMV_SHIFT)) & FMUTEST_R_PIN_CTRL_WMV_MASK) - -#define FMUTEST_R_PIN_CTRL_XE_MASK (0x10000U) -#define FMUTEST_R_PIN_CTRL_XE_SHIFT (16U) -/*! XE - X Address Enable */ -#define FMUTEST_R_PIN_CTRL_XE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_XE_SHIFT)) & FMUTEST_R_PIN_CTRL_XE_MASK) - -#define FMUTEST_R_PIN_CTRL_YE_MASK (0x20000U) -#define FMUTEST_R_PIN_CTRL_YE_SHIFT (17U) -/*! YE - Y Address Enable */ -#define FMUTEST_R_PIN_CTRL_YE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_YE_SHIFT)) & FMUTEST_R_PIN_CTRL_YE_MASK) - -#define FMUTEST_R_PIN_CTRL_SE_MASK (0x40000U) -#define FMUTEST_R_PIN_CTRL_SE_SHIFT (18U) -/*! SE - Sense Amp Enable */ -#define FMUTEST_R_PIN_CTRL_SE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_SE_SHIFT)) & FMUTEST_R_PIN_CTRL_SE_MASK) - -#define FMUTEST_R_PIN_CTRL_ERASE_MASK (0x80000U) -#define FMUTEST_R_PIN_CTRL_ERASE_SHIFT (19U) -/*! ERASE - Erase Mode */ -#define FMUTEST_R_PIN_CTRL_ERASE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_ERASE_SHIFT)) & FMUTEST_R_PIN_CTRL_ERASE_MASK) - -#define FMUTEST_R_PIN_CTRL_PROG_MASK (0x100000U) -#define FMUTEST_R_PIN_CTRL_PROG_SHIFT (20U) -/*! PROG - Program Mode */ -#define FMUTEST_R_PIN_CTRL_PROG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_PROG_SHIFT)) & FMUTEST_R_PIN_CTRL_PROG_MASK) - -#define FMUTEST_R_PIN_CTRL_NVSTR_MASK (0x200000U) -#define FMUTEST_R_PIN_CTRL_NVSTR_SHIFT (21U) -/*! NVSTR - NVM Store */ -#define FMUTEST_R_PIN_CTRL_NVSTR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_NVSTR_SHIFT)) & FMUTEST_R_PIN_CTRL_NVSTR_MASK) - -#define FMUTEST_R_PIN_CTRL_SLM_MASK (0x400000U) -#define FMUTEST_R_PIN_CTRL_SLM_SHIFT (22U) -/*! SLM - Sleep Mode Enable */ -#define FMUTEST_R_PIN_CTRL_SLM(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_SLM_SHIFT)) & FMUTEST_R_PIN_CTRL_SLM_MASK) - -#define FMUTEST_R_PIN_CTRL_RECALL_MASK (0x800000U) -#define FMUTEST_R_PIN_CTRL_RECALL_SHIFT (23U) -/*! RECALL - Recall Trim Code */ -#define FMUTEST_R_PIN_CTRL_RECALL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_RECALL_SHIFT)) & FMUTEST_R_PIN_CTRL_RECALL_MASK) - -#define FMUTEST_R_PIN_CTRL_HEM_MASK (0x1000000U) -#define FMUTEST_R_PIN_CTRL_HEM_SHIFT (24U) -/*! HEM - HEM Control */ -#define FMUTEST_R_PIN_CTRL_HEM(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_PIN_CTRL_HEM_SHIFT)) & FMUTEST_R_PIN_CTRL_HEM_MASK) -/*! @} */ - -/*! @name R_CNT_LOOP_CTRL - BIST Loop Count Control Register */ -/*! @{ */ - -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPCNT_MASK (0xFFFU) -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPCNT_SHIFT (0U) -/*! LOOPCNT - Loop Count Control */ -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPCNT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_CNT_LOOP_CTRL_LOOPCNT_SHIFT)) & FMUTEST_R_CNT_LOOP_CTRL_LOOPCNT_MASK) - -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPOPT_MASK (0x7000U) -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPOPT_SHIFT (12U) -/*! LOOPOPT - Loop Option - * 0b000..Loop is disabled; selected BIST operation is run once - * 0b001..Loop is enabled; XADR increments by 1 XADR increments by 1 for each new loop. Stops when total loop count meets LOOPCNT+1. - * 0b010..Loop is enabled; YADR increments by 1 YADR increments by 1 for each new loop. Stops when total loop count meets LOOPCNT+1. - * 0b011..Loop is enabled; XADR increments by 2 XADR increments by 2 for each new loop. Stops when total loop count meets LOOPCNT+1. - * 0b100..Loop is enabled; XADR increments by sector XADR increments by 16 for each new loop. Stops when total loop count meets LOOPCNT+1. - */ -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPOPT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_CNT_LOOP_CTRL_LOOPOPT_SHIFT)) & FMUTEST_R_CNT_LOOP_CTRL_LOOPOPT_MASK) - -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPUNIT_MASK (0x38000U) -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPUNIT_SHIFT (15U) -/*! LOOPUNIT - Loop Time Unit - * 0b000..Clock cycles - * 0b001..0.5 usec - * 0b010..1 usec - * 0b011..10 usec - * 0b100..100 usec - * 0b101..1 msec - * 0b110..10 msec - * 0b111..100 msec - */ -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPUNIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_CNT_LOOP_CTRL_LOOPUNIT_SHIFT)) & FMUTEST_R_CNT_LOOP_CTRL_LOOPUNIT_MASK) - -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPDLY_MASK (0x1FC0000U) -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPDLY_SHIFT (18U) -/*! LOOPDLY - Loop Time Delay Scalar */ -#define FMUTEST_R_CNT_LOOP_CTRL_LOOPDLY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_CNT_LOOP_CTRL_LOOPDLY_SHIFT)) & FMUTEST_R_CNT_LOOP_CTRL_LOOPDLY_MASK) -/*! @} */ - -/*! @name R_TIMER_CTRL - BIST Timer Control Register */ -/*! @{ */ - -#define FMUTEST_R_TIMER_CTRL_TNVSUNIT_MASK (0x7U) -#define FMUTEST_R_TIMER_CTRL_TNVSUNIT_SHIFT (0U) -/*! TNVSUNIT - Tnvs Time Unit - * 0b000..Clock cycles - * 0b001..0.5 usec - * 0b010..1 usec - * 0b011..10 usec - * 0b100..100 usec - * 0b101..1 msec - * 0b110..10 msec - * 0b111..100 msec - */ -#define FMUTEST_R_TIMER_CTRL_TNVSUNIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TNVSUNIT_SHIFT)) & FMUTEST_R_TIMER_CTRL_TNVSUNIT_MASK) - -#define FMUTEST_R_TIMER_CTRL_TNVSDLY_MASK (0x78U) -#define FMUTEST_R_TIMER_CTRL_TNVSDLY_SHIFT (3U) -/*! TNVSDLY - Tnvs Time Delay Scalar */ -#define FMUTEST_R_TIMER_CTRL_TNVSDLY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TNVSDLY_SHIFT)) & FMUTEST_R_TIMER_CTRL_TNVSDLY_MASK) - -#define FMUTEST_R_TIMER_CTRL_TNVHUNIT_MASK (0x380U) -#define FMUTEST_R_TIMER_CTRL_TNVHUNIT_SHIFT (7U) -/*! TNVHUNIT - Tnvh Time Unit - * 0b000..Clock cycles - * 0b001..0.5 usec - * 0b010..1 usec - * 0b011..10 usec - * 0b100..100 usec - * 0b101..1 msec - * 0b110..10 msec - * 0b111..100 msec - */ -#define FMUTEST_R_TIMER_CTRL_TNVHUNIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TNVHUNIT_SHIFT)) & FMUTEST_R_TIMER_CTRL_TNVHUNIT_MASK) - -#define FMUTEST_R_TIMER_CTRL_TNVHDLY_MASK (0x3C00U) -#define FMUTEST_R_TIMER_CTRL_TNVHDLY_SHIFT (10U) -/*! TNVHDLY - Tnvh Time Delay Scalar */ -#define FMUTEST_R_TIMER_CTRL_TNVHDLY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TNVHDLY_SHIFT)) & FMUTEST_R_TIMER_CTRL_TNVHDLY_MASK) - -#define FMUTEST_R_TIMER_CTRL_TPGSUNIT_MASK (0x1C000U) -#define FMUTEST_R_TIMER_CTRL_TPGSUNIT_SHIFT (14U) -/*! TPGSUNIT - Tpgs Time Unit - * 0b000..Clock cycles - * 0b001..0.5 usec - * 0b010..1 usec - * 0b011..10 usec - * 0b100..100 usec - * 0b101..1 msec - * 0b110..10 msec - * 0b111..100 msec - */ -#define FMUTEST_R_TIMER_CTRL_TPGSUNIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TPGSUNIT_SHIFT)) & FMUTEST_R_TIMER_CTRL_TPGSUNIT_MASK) - -#define FMUTEST_R_TIMER_CTRL_TPGSDLY_MASK (0x1E0000U) -#define FMUTEST_R_TIMER_CTRL_TPGSDLY_SHIFT (17U) -/*! TPGSDLY - Tpgs Time Delay Scalar */ -#define FMUTEST_R_TIMER_CTRL_TPGSDLY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TPGSDLY_SHIFT)) & FMUTEST_R_TIMER_CTRL_TPGSDLY_MASK) - -#define FMUTEST_R_TIMER_CTRL_TRCVUNIT_MASK (0xE00000U) -#define FMUTEST_R_TIMER_CTRL_TRCVUNIT_SHIFT (21U) -/*! TRCVUNIT - Trcv Time Unit - * 0b000..Clock cycles - * 0b001..0.5 usec - * 0b010..1 usec - * 0b011..10 usec - * 0b100..100 usec - * 0b101..1 msec - * 0b110..10 msec - * 0b111..100 msec - */ -#define FMUTEST_R_TIMER_CTRL_TRCVUNIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TRCVUNIT_SHIFT)) & FMUTEST_R_TIMER_CTRL_TRCVUNIT_MASK) - -#define FMUTEST_R_TIMER_CTRL_TRCVDLY_MASK (0xF000000U) -#define FMUTEST_R_TIMER_CTRL_TRCVDLY_SHIFT (24U) -/*! TRCVDLY - Trcv Time Delay Scalar */ -#define FMUTEST_R_TIMER_CTRL_TRCVDLY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TRCVDLY_SHIFT)) & FMUTEST_R_TIMER_CTRL_TRCVDLY_MASK) - -#define FMUTEST_R_TIMER_CTRL_TLVSUNIT_MASK (0x70000000U) -#define FMUTEST_R_TIMER_CTRL_TLVSUNIT_SHIFT (28U) -/*! TLVSUNIT - Tlvs Time Unit - * 0b000..Clock cycles - * 0b001..0.5 usec - * 0b010..1 usec - * 0b011..10 usec - * 0b100..100 usec - * 0b101..1 msec - * 0b110..10 msec - * 0b111..100 msec - */ -#define FMUTEST_R_TIMER_CTRL_TLVSUNIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TLVSUNIT_SHIFT)) & FMUTEST_R_TIMER_CTRL_TLVSUNIT_MASK) - -#define FMUTEST_R_TIMER_CTRL_TLVSDLY_L_MASK (0x80000000U) -#define FMUTEST_R_TIMER_CTRL_TLVSDLY_L_SHIFT (31U) -/*! TLVSDLY_L - Tlvs Time Delay Scalar Low */ -#define FMUTEST_R_TIMER_CTRL_TLVSDLY_L(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_TLVSDLY_L_SHIFT)) & FMUTEST_R_TIMER_CTRL_TLVSDLY_L_MASK) -/*! @} */ - -/*! @name R_TEST_CTRL - BIST Test Control Register */ -/*! @{ */ - -#define FMUTEST_R_TEST_CTRL_BUSY_MASK (0x1U) -#define FMUTEST_R_TEST_CTRL_BUSY_SHIFT (0U) -/*! BUSY - BIST Busy Status - * 0b0..BIST is idle - * 0b1..BIST is busy - */ -#define FMUTEST_R_TEST_CTRL_BUSY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_BUSY_SHIFT)) & FMUTEST_R_TEST_CTRL_BUSY_MASK) - -#define FMUTEST_R_TEST_CTRL_DEBUG_MASK (0x2U) -#define FMUTEST_R_TEST_CTRL_DEBUG_SHIFT (1U) -/*! DEBUG - BIST Debug Status */ -#define FMUTEST_R_TEST_CTRL_DEBUG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_DEBUG_SHIFT)) & FMUTEST_R_TEST_CTRL_DEBUG_MASK) - -#define FMUTEST_R_TEST_CTRL_STATUS0_MASK (0x4U) -#define FMUTEST_R_TEST_CTRL_STATUS0_SHIFT (2U) -/*! STATUS0 - BIST Status 0 - * 0b0..BIST test passed on flash block 0 - * 0b1..BIST test failed on flash block 0 - */ -#define FMUTEST_R_TEST_CTRL_STATUS0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_STATUS0_SHIFT)) & FMUTEST_R_TEST_CTRL_STATUS0_MASK) - -#define FMUTEST_R_TEST_CTRL_STATUS1_MASK (0x8U) -#define FMUTEST_R_TEST_CTRL_STATUS1_SHIFT (3U) -/*! STATUS1 - BIST status 1 - * 0b0..BIST test passed on flash block 1 - * 0b1..BIST test failed on flash block 1 - */ -#define FMUTEST_R_TEST_CTRL_STATUS1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_STATUS1_SHIFT)) & FMUTEST_R_TEST_CTRL_STATUS1_MASK) - -#define FMUTEST_R_TEST_CTRL_DEBUGRUN_MASK (0x10U) -#define FMUTEST_R_TEST_CTRL_DEBUGRUN_SHIFT (4U) -/*! DEBUGRUN - BIST Continue Debug Run */ -#define FMUTEST_R_TEST_CTRL_DEBUGRUN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_DEBUGRUN_SHIFT)) & FMUTEST_R_TEST_CTRL_DEBUGRUN_MASK) - -#define FMUTEST_R_TEST_CTRL_STARTRUN_MASK (0x20U) -#define FMUTEST_R_TEST_CTRL_STARTRUN_SHIFT (5U) -/*! STARTRUN - Run New BIST Operation */ -#define FMUTEST_R_TEST_CTRL_STARTRUN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_STARTRUN_SHIFT)) & FMUTEST_R_TEST_CTRL_STARTRUN_MASK) - -#define FMUTEST_R_TEST_CTRL_CMDINDEX_MASK (0xFFC0U) -#define FMUTEST_R_TEST_CTRL_CMDINDEX_SHIFT (6U) -/*! CMDINDEX - BIST Command Index (code) */ -#define FMUTEST_R_TEST_CTRL_CMDINDEX(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_CMDINDEX_SHIFT)) & FMUTEST_R_TEST_CTRL_CMDINDEX_MASK) - -#define FMUTEST_R_TEST_CTRL_DISABLE_IP1_MASK (0x10000U) -#define FMUTEST_R_TEST_CTRL_DISABLE_IP1_SHIFT (16U) -/*! DISABLE_IP1 - BIST Disable IP1 */ -#define FMUTEST_R_TEST_CTRL_DISABLE_IP1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TEST_CTRL_DISABLE_IP1_SHIFT)) & FMUTEST_R_TEST_CTRL_DISABLE_IP1_MASK) -/*! @} */ - -/*! @name R_ABORT_LOOP - BIST Abort Loop Register */ -/*! @{ */ - -#define FMUTEST_R_ABORT_LOOP_ABORT_LOOP_MASK (0x1U) -#define FMUTEST_R_ABORT_LOOP_ABORT_LOOP_SHIFT (0U) -/*! ABORT_LOOP - Abort Loop - * 0b0..No effect - * 0b1..Abort BIST loop commands and force the loop counter to return to 0x0 - */ -#define FMUTEST_R_ABORT_LOOP_ABORT_LOOP(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ABORT_LOOP_ABORT_LOOP_SHIFT)) & FMUTEST_R_ABORT_LOOP_ABORT_LOOP_MASK) -/*! @} */ - -/*! @name R_ADR_QUERY - BIST Address Query Register */ -/*! @{ */ - -#define FMUTEST_R_ADR_QUERY_YADRFAIL_MASK (0x1FU) -#define FMUTEST_R_ADR_QUERY_YADRFAIL_SHIFT (0U) -/*! YADRFAIL - Failing YADR */ -#define FMUTEST_R_ADR_QUERY_YADRFAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ADR_QUERY_YADRFAIL_SHIFT)) & FMUTEST_R_ADR_QUERY_YADRFAIL_MASK) - -#define FMUTEST_R_ADR_QUERY_XADRFAIL_MASK (0x1FFE0U) -#define FMUTEST_R_ADR_QUERY_XADRFAIL_SHIFT (5U) -/*! XADRFAIL - Failing XADR */ -#define FMUTEST_R_ADR_QUERY_XADRFAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_ADR_QUERY_XADRFAIL_SHIFT)) & FMUTEST_R_ADR_QUERY_XADRFAIL_MASK) -/*! @} */ - -/*! @name R_DOUT_QUERY0 - BIST DOUT Query 0 Register */ -/*! @{ */ - -#define FMUTEST_R_DOUT_QUERY0_DOUTFAIL_MASK (0xFFFFFFFFU) -#define FMUTEST_R_DOUT_QUERY0_DOUTFAIL_SHIFT (0U) -/*! DOUTFAIL - Failing DOUT Low */ -#define FMUTEST_R_DOUT_QUERY0_DOUTFAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DOUT_QUERY0_DOUTFAIL_SHIFT)) & FMUTEST_R_DOUT_QUERY0_DOUTFAIL_MASK) -/*! @} */ - -/*! @name R_SMW_QUERY - BIST SMW Query Register */ -/*! @{ */ - -#define FMUTEST_R_SMW_QUERY_SMWLOOP_MASK (0x3FFU) -#define FMUTEST_R_SMW_QUERY_SMWLOOP_SHIFT (0U) -/*! SMWLOOP - SMW Total Loop Count */ -#define FMUTEST_R_SMW_QUERY_SMWLOOP(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMW_QUERY_SMWLOOP_SHIFT)) & FMUTEST_R_SMW_QUERY_SMWLOOP_MASK) - -#define FMUTEST_R_SMW_QUERY_SMWLAST_MASK (0x7FC00U) -#define FMUTEST_R_SMW_QUERY_SMWLAST_SHIFT (10U) -/*! SMWLAST - SMW Last Voltage Setting */ -#define FMUTEST_R_SMW_QUERY_SMWLAST(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMW_QUERY_SMWLAST_SHIFT)) & FMUTEST_R_SMW_QUERY_SMWLAST_MASK) -/*! @} */ - -/*! @name R_SMW_SETTING0 - BIST SMW Setting 0 Register */ -/*! @{ */ - -#define FMUTEST_R_SMW_SETTING0_SMWPARM0_MASK (0x7FFFFFFFU) -#define FMUTEST_R_SMW_SETTING0_SMWPARM0_SHIFT (0U) -/*! SMWPARM0 - SMW Parameter Set 0 */ -#define FMUTEST_R_SMW_SETTING0_SMWPARM0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMW_SETTING0_SMWPARM0_SHIFT)) & FMUTEST_R_SMW_SETTING0_SMWPARM0_MASK) -/*! @} */ - -/*! @name R_SMW_SETTING1 - BIST SMW Setting 1 Register */ -/*! @{ */ - -#define FMUTEST_R_SMW_SETTING1_SMWPARM1_MASK (0xFFFFFFFU) -#define FMUTEST_R_SMW_SETTING1_SMWPARM1_SHIFT (0U) -/*! SMWPARM1 - SMW Parameter Set 1 */ -#define FMUTEST_R_SMW_SETTING1_SMWPARM1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMW_SETTING1_SMWPARM1_SHIFT)) & FMUTEST_R_SMW_SETTING1_SMWPARM1_MASK) -/*! @} */ - -/*! @name R_SMP_WHV0 - BIST SMP WHV Setting 0 Register */ -/*! @{ */ - -#define FMUTEST_R_SMP_WHV0_SMPWHV0_MASK (0xFFFFFFFFU) -#define FMUTEST_R_SMP_WHV0_SMPWHV0_SHIFT (0U) -/*! SMPWHV0 - SMP WHV Parameter Set 0 */ -#define FMUTEST_R_SMP_WHV0_SMPWHV0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMP_WHV0_SMPWHV0_SHIFT)) & FMUTEST_R_SMP_WHV0_SMPWHV0_MASK) -/*! @} */ - -/*! @name R_SMP_WHV1 - BIST SMP WHV Setting 1 Register */ -/*! @{ */ - -#define FMUTEST_R_SMP_WHV1_SMPWHV1_MASK (0xFFFFFFFFU) -#define FMUTEST_R_SMP_WHV1_SMPWHV1_SHIFT (0U) -/*! SMPWHV1 - SMP WHV Parameter Set 1 */ -#define FMUTEST_R_SMP_WHV1_SMPWHV1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMP_WHV1_SMPWHV1_SHIFT)) & FMUTEST_R_SMP_WHV1_SMPWHV1_MASK) -/*! @} */ - -/*! @name R_SME_WHV0 - BIST SME WHV Setting 0 Register */ -/*! @{ */ - -#define FMUTEST_R_SME_WHV0_SMEWHV0_MASK (0xFFFFFFFFU) -#define FMUTEST_R_SME_WHV0_SMEWHV0_SHIFT (0U) -/*! SMEWHV0 - SME WHV Parameter Set 0 */ -#define FMUTEST_R_SME_WHV0_SMEWHV0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SME_WHV0_SMEWHV0_SHIFT)) & FMUTEST_R_SME_WHV0_SMEWHV0_MASK) -/*! @} */ - -/*! @name R_SME_WHV1 - BIST SME WHV Setting 1 Register */ -/*! @{ */ - -#define FMUTEST_R_SME_WHV1_SMEWHV1_MASK (0xFFFFFFFFU) -#define FMUTEST_R_SME_WHV1_SMEWHV1_SHIFT (0U) -/*! SMEWHV1 - SME WHV Parameter Set 1 */ -#define FMUTEST_R_SME_WHV1_SMEWHV1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SME_WHV1_SMEWHV1_SHIFT)) & FMUTEST_R_SME_WHV1_SMEWHV1_MASK) -/*! @} */ - -/*! @name R_SMW_SETTING2 - BIST SMW Setting 2 Register */ -/*! @{ */ - -#define FMUTEST_R_SMW_SETTING2_SMWPARM2_MASK (0x1FFFFFFFU) -#define FMUTEST_R_SMW_SETTING2_SMWPARM2_SHIFT (0U) -/*! SMWPARM2 - SMW Parameter Set 2 */ -#define FMUTEST_R_SMW_SETTING2_SMWPARM2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMW_SETTING2_SMWPARM2_SHIFT)) & FMUTEST_R_SMW_SETTING2_SMWPARM2_MASK) -/*! @} */ - -/*! @name R_D_MISR0 - BIST DIN MISR 0 Register */ -/*! @{ */ - -#define FMUTEST_R_D_MISR0_DATASIG0_MASK (0xFFFFFFFFU) -#define FMUTEST_R_D_MISR0_DATASIG0_SHIFT (0U) -/*! DATASIG0 - Data Signature */ -#define FMUTEST_R_D_MISR0_DATASIG0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_D_MISR0_DATASIG0_SHIFT)) & FMUTEST_R_D_MISR0_DATASIG0_MASK) -/*! @} */ - -/*! @name R_A_MISR0 - BIST Address MISR 0 Register */ -/*! @{ */ - -#define FMUTEST_R_A_MISR0_ADRSIG0_MASK (0xFFFFFFFFU) -#define FMUTEST_R_A_MISR0_ADRSIG0_SHIFT (0U) -/*! ADRSIG0 - Address Signature */ -#define FMUTEST_R_A_MISR0_ADRSIG0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_A_MISR0_ADRSIG0_SHIFT)) & FMUTEST_R_A_MISR0_ADRSIG0_MASK) -/*! @} */ - -/*! @name R_C_MISR0 - BIST Control MISR 0 Register */ -/*! @{ */ - -#define FMUTEST_R_C_MISR0_CTRLSIG0_MASK (0xFFFFFFFFU) -#define FMUTEST_R_C_MISR0_CTRLSIG0_SHIFT (0U) -/*! CTRLSIG0 - Control Signature */ -#define FMUTEST_R_C_MISR0_CTRLSIG0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_C_MISR0_CTRLSIG0_SHIFT)) & FMUTEST_R_C_MISR0_CTRLSIG0_MASK) -/*! @} */ - -/*! @name R_SMW_SETTING3 - BIST SMW Setting 3 Register */ -/*! @{ */ - -#define FMUTEST_R_SMW_SETTING3_SMWPARM3_MASK (0x1FFFFU) -#define FMUTEST_R_SMW_SETTING3_SMWPARM3_SHIFT (0U) -/*! SMWPARM3 - SMW Parameter Set 3 */ -#define FMUTEST_R_SMW_SETTING3_SMWPARM3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_SMW_SETTING3_SMWPARM3_SHIFT)) & FMUTEST_R_SMW_SETTING3_SMWPARM3_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL1 - BIST Data Control 1 Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL1_DATA1_MASK (0xFFFFFFFFU) -#define FMUTEST_R_DATA_CTRL1_DATA1_SHIFT (0U) -/*! DATA1 - BIST Data 1 Low */ -#define FMUTEST_R_DATA_CTRL1_DATA1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL1_DATA1_SHIFT)) & FMUTEST_R_DATA_CTRL1_DATA1_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL2 - BIST Data Control 2 Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL2_DATA2_MASK (0xFFFFFFFFU) -#define FMUTEST_R_DATA_CTRL2_DATA2_SHIFT (0U) -/*! DATA2 - BIST Data 2 Low */ -#define FMUTEST_R_DATA_CTRL2_DATA2(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL2_DATA2_SHIFT)) & FMUTEST_R_DATA_CTRL2_DATA2_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL3 - BIST Data Control 3 Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL3_DATA3_MASK (0xFFFFFFFFU) -#define FMUTEST_R_DATA_CTRL3_DATA3_SHIFT (0U) -/*! DATA3 - BIST Data 3 Low */ -#define FMUTEST_R_DATA_CTRL3_DATA3(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL3_DATA3_SHIFT)) & FMUTEST_R_DATA_CTRL3_DATA3_MASK) -/*! @} */ - -/*! @name R_REPAIR0_0 - BIST Repair 0 for Block 0 Register */ -/*! @{ */ - -#define FMUTEST_R_REPAIR0_0_RDIS0_0_MASK (0x1U) -#define FMUTEST_R_REPAIR0_0_RDIS0_0_SHIFT (0U) -/*! RDIS0_0 - Control Repair 0 in Block 0. - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_R_REPAIR0_0_RDIS0_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR0_0_RDIS0_0_SHIFT)) & FMUTEST_R_REPAIR0_0_RDIS0_0_MASK) - -#define FMUTEST_R_REPAIR0_0_RADR0_0_MASK (0x1FEU) -#define FMUTEST_R_REPAIR0_0_RADR0_0_SHIFT (1U) -/*! RADR0_0 - XADR for Repair 0 in Block 0 */ -#define FMUTEST_R_REPAIR0_0_RADR0_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR0_0_RADR0_0_SHIFT)) & FMUTEST_R_REPAIR0_0_RADR0_0_MASK) -/*! @} */ - -/*! @name R_REPAIR0_1 - BIST Repair 1 Block 0 Register */ -/*! @{ */ - -#define FMUTEST_R_REPAIR0_1_RDIS0_1_MASK (0x1U) -#define FMUTEST_R_REPAIR0_1_RDIS0_1_SHIFT (0U) -/*! RDIS0_1 - Control Repair 1 in Block 0. - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_R_REPAIR0_1_RDIS0_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR0_1_RDIS0_1_SHIFT)) & FMUTEST_R_REPAIR0_1_RDIS0_1_MASK) - -#define FMUTEST_R_REPAIR0_1_RADR0_1_MASK (0x1FEU) -#define FMUTEST_R_REPAIR0_1_RADR0_1_SHIFT (1U) -/*! RADR0_1 - XADR for Repair 1 in Block 0. */ -#define FMUTEST_R_REPAIR0_1_RADR0_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR0_1_RADR0_1_SHIFT)) & FMUTEST_R_REPAIR0_1_RADR0_1_MASK) -/*! @} */ - -/*! @name R_REPAIR1_0 - BIST Repair 0 Block 1 Register */ -/*! @{ */ - -#define FMUTEST_R_REPAIR1_0_RDIS1_0_MASK (0x1U) -#define FMUTEST_R_REPAIR1_0_RDIS1_0_SHIFT (0U) -/*! RDIS1_0 - Control Repair 0 in Block 1. - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_R_REPAIR1_0_RDIS1_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR1_0_RDIS1_0_SHIFT)) & FMUTEST_R_REPAIR1_0_RDIS1_0_MASK) - -#define FMUTEST_R_REPAIR1_0_RADR1_0_MASK (0x1FEU) -#define FMUTEST_R_REPAIR1_0_RADR1_0_SHIFT (1U) -/*! RADR1_0 - XADR for Repair 0 in Block 1. */ -#define FMUTEST_R_REPAIR1_0_RADR1_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR1_0_RADR1_0_SHIFT)) & FMUTEST_R_REPAIR1_0_RADR1_0_MASK) -/*! @} */ - -/*! @name R_REPAIR1_1 - BIST Repair 1 Block 1 Register */ -/*! @{ */ - -#define FMUTEST_R_REPAIR1_1_RDIS1_1_MASK (0x1U) -#define FMUTEST_R_REPAIR1_1_RDIS1_1_SHIFT (0U) -/*! RDIS1_1 - Control Repair 1 in Block 1. - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_R_REPAIR1_1_RDIS1_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR1_1_RDIS1_1_SHIFT)) & FMUTEST_R_REPAIR1_1_RDIS1_1_MASK) - -#define FMUTEST_R_REPAIR1_1_RADR1_1_MASK (0x1FEU) -#define FMUTEST_R_REPAIR1_1_RADR1_1_SHIFT (1U) -/*! RADR1_1 - XADR for Repair 1 in Block 1. */ -#define FMUTEST_R_REPAIR1_1_RADR1_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_REPAIR1_1_RADR1_1_SHIFT)) & FMUTEST_R_REPAIR1_1_RADR1_1_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL0_EX - BIST Data Control 0 Extension Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL0_EX_DATA0X_MASK (0x7U) -#define FMUTEST_R_DATA_CTRL0_EX_DATA0X_SHIFT (0U) -/*! DATA0X - BIST Data 0 High */ -#define FMUTEST_R_DATA_CTRL0_EX_DATA0X(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL0_EX_DATA0X_SHIFT)) & FMUTEST_R_DATA_CTRL0_EX_DATA0X_MASK) -/*! @} */ - -/*! @name R_TIMER_CTRL_EX - BIST Timer Control Extension Register */ -/*! @{ */ - -#define FMUTEST_R_TIMER_CTRL_EX_TLVSDLY_H_MASK (0x7U) -#define FMUTEST_R_TIMER_CTRL_EX_TLVSDLY_H_SHIFT (0U) -/*! TLVSDLY_H - Tlvs Time Delay Scalar High */ -#define FMUTEST_R_TIMER_CTRL_EX_TLVSDLY_H(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_TIMER_CTRL_EX_TLVSDLY_H_SHIFT)) & FMUTEST_R_TIMER_CTRL_EX_TLVSDLY_H_MASK) -/*! @} */ - -/*! @name R_DOUT_QUERY1 - BIST DOUT Query 1 Register */ -/*! @{ */ - -#define FMUTEST_R_DOUT_QUERY1_DOUT_MASK (0x7U) -#define FMUTEST_R_DOUT_QUERY1_DOUT_SHIFT (0U) -/*! DOUT - Failing DOUT High */ -#define FMUTEST_R_DOUT_QUERY1_DOUT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DOUT_QUERY1_DOUT_SHIFT)) & FMUTEST_R_DOUT_QUERY1_DOUT_MASK) -/*! @} */ - -/*! @name R_D_MISR1 - BIST DIN MISR 1 Register */ -/*! @{ */ - -#define FMUTEST_R_D_MISR1_DATASIG1_MASK (0xFFU) -#define FMUTEST_R_D_MISR1_DATASIG1_SHIFT (0U) -/*! DATASIG1 - MISR Data Signature High */ -#define FMUTEST_R_D_MISR1_DATASIG1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_D_MISR1_DATASIG1_SHIFT)) & FMUTEST_R_D_MISR1_DATASIG1_MASK) -/*! @} */ - -/*! @name R_A_MISR1 - BIST Address MISR 1 Register */ -/*! @{ */ - -#define FMUTEST_R_A_MISR1_ADRSIG1_MASK (0xFFU) -#define FMUTEST_R_A_MISR1_ADRSIG1_SHIFT (0U) -/*! ADRSIG1 - MISR Address Signature High */ -#define FMUTEST_R_A_MISR1_ADRSIG1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_A_MISR1_ADRSIG1_SHIFT)) & FMUTEST_R_A_MISR1_ADRSIG1_MASK) -/*! @} */ - -/*! @name R_C_MISR1 - BIST Control MISR 1 Register */ -/*! @{ */ - -#define FMUTEST_R_C_MISR1_CTRLSIG1_MASK (0xFFU) -#define FMUTEST_R_C_MISR1_CTRLSIG1_SHIFT (0U) -/*! CTRLSIG1 - MISR Control Signature High */ -#define FMUTEST_R_C_MISR1_CTRLSIG1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_C_MISR1_CTRLSIG1_SHIFT)) & FMUTEST_R_C_MISR1_CTRLSIG1_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL1_EX - BIST Data Control 1 Extension Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL1_EX_DATA1X_MASK (0x7U) -#define FMUTEST_R_DATA_CTRL1_EX_DATA1X_SHIFT (0U) -/*! DATA1X - BIST Data 1 High */ -#define FMUTEST_R_DATA_CTRL1_EX_DATA1X(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL1_EX_DATA1X_SHIFT)) & FMUTEST_R_DATA_CTRL1_EX_DATA1X_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL2_EX - BIST Data Control 2 Extension Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL2_EX_DATA2X_MASK (0x7U) -#define FMUTEST_R_DATA_CTRL2_EX_DATA2X_SHIFT (0U) -/*! DATA2X - BIST Data 2 High */ -#define FMUTEST_R_DATA_CTRL2_EX_DATA2X(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL2_EX_DATA2X_SHIFT)) & FMUTEST_R_DATA_CTRL2_EX_DATA2X_MASK) -/*! @} */ - -/*! @name R_DATA_CTRL3_EX - BIST Data Control 3 Extension Register */ -/*! @{ */ - -#define FMUTEST_R_DATA_CTRL3_EX_DATA3X_MASK (0x7U) -#define FMUTEST_R_DATA_CTRL3_EX_DATA3X_SHIFT (0U) -/*! DATA3X - BIST Data 3 High */ -#define FMUTEST_R_DATA_CTRL3_EX_DATA3X(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_R_DATA_CTRL3_EX_DATA3X_SHIFT)) & FMUTEST_R_DATA_CTRL3_EX_DATA3X_MASK) -/*! @} */ - -/*! @name SMW_TIMER_OPTION - SMW Timer Option Register */ -/*! @{ */ - -#define FMUTEST_SMW_TIMER_OPTION_SMW_CDIVL_MASK (0xFFU) -#define FMUTEST_SMW_TIMER_OPTION_SMW_CDIVL_SHIFT (0U) -/*! SMW_CDIVL - Clock Divide Scalar for Long Pulse */ -#define FMUTEST_SMW_TIMER_OPTION_SMW_CDIVL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_TIMER_OPTION_SMW_CDIVL_SHIFT)) & FMUTEST_SMW_TIMER_OPTION_SMW_CDIVL_MASK) - -#define FMUTEST_SMW_TIMER_OPTION_SMW_TVFY_MASK (0x1F00U) -#define FMUTEST_SMW_TIMER_OPTION_SMW_TVFY_SHIFT (8U) -/*! SMW_TVFY - Timer Adjust for Verify */ -#define FMUTEST_SMW_TIMER_OPTION_SMW_TVFY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_TIMER_OPTION_SMW_TVFY_SHIFT)) & FMUTEST_SMW_TIMER_OPTION_SMW_TVFY_MASK) -/*! @} */ - -/*! @name SMW_SETTING_OPTION0 - SMW Setting Option 0 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SETTING_OPTION0_MV_INIT_MASK (0x1C000U) -#define FMUTEST_SMW_SETTING_OPTION0_MV_INIT_SHIFT (14U) -/*! MV_INIT - Medium Voltage Level Select Initial */ -#define FMUTEST_SMW_SETTING_OPTION0_MV_INIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION0_MV_INIT_SHIFT)) & FMUTEST_SMW_SETTING_OPTION0_MV_INIT_MASK) - -#define FMUTEST_SMW_SETTING_OPTION0_MV_END_MASK (0xE0000U) -#define FMUTEST_SMW_SETTING_OPTION0_MV_END_SHIFT (17U) -/*! MV_END - Medium Voltage Level Select Final */ -#define FMUTEST_SMW_SETTING_OPTION0_MV_END(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION0_MV_END_SHIFT)) & FMUTEST_SMW_SETTING_OPTION0_MV_END_MASK) - -#define FMUTEST_SMW_SETTING_OPTION0_MV_MISC_MASK (0xF00000U) -#define FMUTEST_SMW_SETTING_OPTION0_MV_MISC_SHIFT (20U) -/*! MV_MISC - Medium Voltage Control Misc */ -#define FMUTEST_SMW_SETTING_OPTION0_MV_MISC(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION0_MV_MISC_SHIFT)) & FMUTEST_SMW_SETTING_OPTION0_MV_MISC_MASK) - -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_INIT_MASK (0x3000000U) -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_INIT_SHIFT (24U) -/*! IPGM_INIT - Program Current Control Initial */ -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_INIT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION0_IPGM_INIT_SHIFT)) & FMUTEST_SMW_SETTING_OPTION0_IPGM_INIT_MASK) - -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_END_MASK (0xC000000U) -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_END_SHIFT (26U) -/*! IPGM_END - Program Current Control Final */ -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_END(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION0_IPGM_END_SHIFT)) & FMUTEST_SMW_SETTING_OPTION0_IPGM_END_MASK) - -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_MISC_MASK (0x70000000U) -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_MISC_SHIFT (28U) -/*! IPGM_MISC - Program Current Control Misc */ -#define FMUTEST_SMW_SETTING_OPTION0_IPGM_MISC(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION0_IPGM_MISC_SHIFT)) & FMUTEST_SMW_SETTING_OPTION0_IPGM_MISC_MASK) -/*! @} */ - -/*! @name SMW_SETTING_OPTION2 - SMW Setting Option 2 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SETTING_OPTION2_THVS_CTRL_MASK (0x7U) -#define FMUTEST_SMW_SETTING_OPTION2_THVS_CTRL_SHIFT (0U) -/*! THVS_CTRL - Thvs control */ -#define FMUTEST_SMW_SETTING_OPTION2_THVS_CTRL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_THVS_CTRL_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_THVS_CTRL_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_TRCV_CTRL_MASK (0x38U) -#define FMUTEST_SMW_SETTING_OPTION2_TRCV_CTRL_SHIFT (3U) -/*! TRCV_CTRL - Trcv Control */ -#define FMUTEST_SMW_SETTING_OPTION2_TRCV_CTRL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_TRCV_CTRL_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_TRCV_CTRL_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_XTRA_ERS_MASK (0xC0U) -#define FMUTEST_SMW_SETTING_OPTION2_XTRA_ERS_SHIFT (6U) -/*! XTRA_ERS - Number of Post Shots for SME */ -#define FMUTEST_SMW_SETTING_OPTION2_XTRA_ERS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_XTRA_ERS_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_XTRA_ERS_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_XTRA_PGM_MASK (0x300U) -#define FMUTEST_SMW_SETTING_OPTION2_XTRA_PGM_SHIFT (8U) -/*! XTRA_PGM - Number of Post Shots for SMP */ -#define FMUTEST_SMW_SETTING_OPTION2_XTRA_PGM(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_XTRA_PGM_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_XTRA_PGM_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_WHV_CNTR_MASK (0x3FC00U) -#define FMUTEST_SMW_SETTING_OPTION2_WHV_CNTR_SHIFT (10U) -/*! WHV_CNTR - WHV Counter */ -#define FMUTEST_SMW_SETTING_OPTION2_WHV_CNTR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_WHV_CNTR_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_WHV_CNTR_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_POST_TERS_MASK (0x1C0000U) -#define FMUTEST_SMW_SETTING_OPTION2_POST_TERS_SHIFT (18U) -/*! POST_TERS - Post Ters Time - * 0b000..50 usec - * 0b001..100 usec - * 0b010..200 usec - * 0b011..300 usec - * 0b100..500 usec - * 0b101..1 msec - * 0b110..1.5 msec - * 0b111..2 msec - */ -#define FMUTEST_SMW_SETTING_OPTION2_POST_TERS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_POST_TERS_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_POST_TERS_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_POST_TPGM_MASK (0x600000U) -#define FMUTEST_SMW_SETTING_OPTION2_POST_TPGM_SHIFT (21U) -/*! POST_TPGM - Post Tpgm Time - * 0b00..1 usec - * 0b01..2 usec - * 0b10..4 usec - * 0b11..8 usec - */ -#define FMUTEST_SMW_SETTING_OPTION2_POST_TPGM(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_POST_TPGM_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_POST_TPGM_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_VFY_OPT_MASK (0x1800000U) -#define FMUTEST_SMW_SETTING_OPTION2_VFY_OPT_SHIFT (23U) -/*! VFY_OPT - Verify Option - * 0b00..Skip verify for post shot only, verify for all other shots - * 0b01..Skip verify for the 1st and post shots - * 0b10..Skip the 1st, 2nd, and post shots - * 0b11..Skip verify for all shots - */ -#define FMUTEST_SMW_SETTING_OPTION2_VFY_OPT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_VFY_OPT_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_VFY_OPT_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_TPGM_OPT_MASK (0x6000000U) -#define FMUTEST_SMW_SETTING_OPTION2_TPGM_OPT_SHIFT (25U) -/*! TPGM_OPT - Tpgm Option - * 0b00..Fixed Tpgm for all shots, except post shot - * 0b01..Increase Tpgm option by 1 for each loop until Tpgm reaches 4 usec - * 0b10..Increase Tpgm option by 1 for each loop until Tpgm reaches 8 usec - * 0b11..Unused - */ -#define FMUTEST_SMW_SETTING_OPTION2_TPGM_OPT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_TPGM_OPT_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_TPGM_OPT_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_MASK0_OPT_MASK (0x8000000U) -#define FMUTEST_SMW_SETTING_OPTION2_MASK0_OPT_SHIFT (27U) -/*! MASK0_OPT - MASK0_OPT - * 0b0..Mask programmed bits passing PV until extra shot - * 0b1..Always program bits even if they pass PV - */ -#define FMUTEST_SMW_SETTING_OPTION2_MASK0_OPT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_MASK0_OPT_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_MASK0_OPT_MASK) - -#define FMUTEST_SMW_SETTING_OPTION2_DIS_PRER_MASK (0x10000000U) -#define FMUTEST_SMW_SETTING_OPTION2_DIS_PRER_SHIFT (28U) -/*! DIS_PRER - Disable pre-PV Read before First Program Shot - * 0b0..Enable pre-PV read before first program shot - * 0b1..Disable pre-PV read before first program shot - */ -#define FMUTEST_SMW_SETTING_OPTION2_DIS_PRER(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION2_DIS_PRER_SHIFT)) & FMUTEST_SMW_SETTING_OPTION2_DIS_PRER_MASK) -/*! @} */ - -/*! @name SMW_SETTING_OPTION3 - SMW Setting Option 3 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SETTING_OPTION3_HEM_WHV_CNTR_MASK (0xFFU) -#define FMUTEST_SMW_SETTING_OPTION3_HEM_WHV_CNTR_SHIFT (0U) -/*! HEM_WHV_CNTR - WHV_COUNTER for HEM-erase Cycle */ -#define FMUTEST_SMW_SETTING_OPTION3_HEM_WHV_CNTR(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION3_HEM_WHV_CNTR_SHIFT)) & FMUTEST_SMW_SETTING_OPTION3_HEM_WHV_CNTR_MASK) - -#define FMUTEST_SMW_SETTING_OPTION3_HEM_MAX_ERS_MASK (0x1FF00U) -#define FMUTEST_SMW_SETTING_OPTION3_HEM_MAX_ERS_SHIFT (8U) -/*! HEM_MAX_ERS - HEM Max Erase Shot Count */ -#define FMUTEST_SMW_SETTING_OPTION3_HEM_MAX_ERS(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION3_HEM_MAX_ERS_SHIFT)) & FMUTEST_SMW_SETTING_OPTION3_HEM_MAX_ERS_MASK) -/*! @} */ - -/*! @name SMW_SMP_WHV_OPTION0 - SMW SMP WHV Option 0 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SMP_WHV_OPTION0_SMP_WHV_OPT0_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_SMP_WHV_OPTION0_SMP_WHV_OPT0_SHIFT (0U) -/*! SMP_WHV_OPT0 - Smart Program WHV Option Low */ -#define FMUTEST_SMW_SMP_WHV_OPTION0_SMP_WHV_OPT0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SMP_WHV_OPTION0_SMP_WHV_OPT0_SHIFT)) & FMUTEST_SMW_SMP_WHV_OPTION0_SMP_WHV_OPT0_MASK) -/*! @} */ - -/*! @name SMW_SME_WHV_OPTION0 - SMW SME WHV Option 0 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SME_WHV_OPTION0_SME_WHV_OPT0_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_SME_WHV_OPTION0_SME_WHV_OPT0_SHIFT (0U) -/*! SME_WHV_OPT0 - Smart Erase WHV Option Low */ -#define FMUTEST_SMW_SME_WHV_OPTION0_SME_WHV_OPT0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SME_WHV_OPTION0_SME_WHV_OPT0_SHIFT)) & FMUTEST_SMW_SME_WHV_OPTION0_SME_WHV_OPT0_MASK) -/*! @} */ - -/*! @name SMW_SETTING_OPTION1 - SMW Setting Option 1 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SETTING_OPTION1_TERS_CTRL0_MASK (0x7U) -#define FMUTEST_SMW_SETTING_OPTION1_TERS_CTRL0_SHIFT (0U) -/*! TERS_CTRL0 - Ters Control - * 0b000..50 usec - * 0b001..100 usec - * 0b010..200 usec - * 0b011..300 usec - * 0b100..500 usec - * 0b101..1 msec - * 0b110..1.5 msec - * 0b111..2 msec - */ -#define FMUTEST_SMW_SETTING_OPTION1_TERS_CTRL0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_TERS_CTRL0_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_TERS_CTRL0_MASK) - -#define FMUTEST_SMW_SETTING_OPTION1_TPGM_CTRL_MASK (0x18U) -#define FMUTEST_SMW_SETTING_OPTION1_TPGM_CTRL_SHIFT (3U) -/*! TPGM_CTRL - Tpgm Control - * 0b00..1 usec - * 0b01..2 usec - * 0b10..4 usec - * 0b11..8 usec - */ -#define FMUTEST_SMW_SETTING_OPTION1_TPGM_CTRL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_TPGM_CTRL_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_TPGM_CTRL_MASK) - -#define FMUTEST_SMW_SETTING_OPTION1_TNVS_CTRL_MASK (0xE0U) -#define FMUTEST_SMW_SETTING_OPTION1_TNVS_CTRL_SHIFT (5U) -/*! TNVS_CTRL - Tnvs Control - * 0b000..5 usec - * 0b001..8 usec - * 0b010..11 usec - * 0b011..14 usec - * 0b100..17 usec - * 0b101..20 usec - * 0b110..23 usec - * 0b111..26 usec - */ -#define FMUTEST_SMW_SETTING_OPTION1_TNVS_CTRL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_TNVS_CTRL_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_TNVS_CTRL_MASK) - -#define FMUTEST_SMW_SETTING_OPTION1_TNVH_CTRL_MASK (0x700U) -#define FMUTEST_SMW_SETTING_OPTION1_TNVH_CTRL_SHIFT (8U) -/*! TNVH_CTRL - Tnvh Control - * 0b000..2 usec - * 0b001..2.5 usec - * 0b010..3 usec - * 0b011..3.5 usec - * 0b100..4 usec - * 0b101..4.5 usec - * 0b110..5 usec - * 0b111..5.5 usec - */ -#define FMUTEST_SMW_SETTING_OPTION1_TNVH_CTRL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_TNVH_CTRL_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_TNVH_CTRL_MASK) - -#define FMUTEST_SMW_SETTING_OPTION1_TPGS_CTRL_MASK (0x3800U) -#define FMUTEST_SMW_SETTING_OPTION1_TPGS_CTRL_SHIFT (11U) -/*! TPGS_CTRL - Tpgs Control - * 0b000..1 usec - * 0b001..2 usec - * 0b010..3 usec - * 0b011..4 usec - * 0b100..5 usec - * 0b101..6 usec - * 0b110..7 usec - * 0b111..8 usec - */ -#define FMUTEST_SMW_SETTING_OPTION1_TPGS_CTRL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_TPGS_CTRL_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_TPGS_CTRL_MASK) - -#define FMUTEST_SMW_SETTING_OPTION1_MAX_ERASE_MASK (0x7FC000U) -#define FMUTEST_SMW_SETTING_OPTION1_MAX_ERASE_SHIFT (14U) -/*! MAX_ERASE - Number of Erase Shots */ -#define FMUTEST_SMW_SETTING_OPTION1_MAX_ERASE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_MAX_ERASE_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_MAX_ERASE_MASK) - -#define FMUTEST_SMW_SETTING_OPTION1_MAX_PROG_MASK (0xF800000U) -#define FMUTEST_SMW_SETTING_OPTION1_MAX_PROG_SHIFT (23U) -/*! MAX_PROG - Number of Program Shots */ -#define FMUTEST_SMW_SETTING_OPTION1_MAX_PROG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SETTING_OPTION1_MAX_PROG_SHIFT)) & FMUTEST_SMW_SETTING_OPTION1_MAX_PROG_MASK) -/*! @} */ - -/*! @name SMW_SMP_WHV_OPTION1 - SMW SMP WHV Option 1 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SMP_WHV_OPTION1_SMP_WHV_OPT1_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_SMP_WHV_OPTION1_SMP_WHV_OPT1_SHIFT (0U) -/*! SMP_WHV_OPT1 - Smart Program WHV Option High */ -#define FMUTEST_SMW_SMP_WHV_OPTION1_SMP_WHV_OPT1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SMP_WHV_OPTION1_SMP_WHV_OPT1_SHIFT)) & FMUTEST_SMW_SMP_WHV_OPTION1_SMP_WHV_OPT1_MASK) -/*! @} */ - -/*! @name SMW_SME_WHV_OPTION1 - SMW SME WHV Option 1 Register */ -/*! @{ */ - -#define FMUTEST_SMW_SME_WHV_OPTION1_SME_WHV_OPT1_MASK (0xFFFFFFFFU) -#define FMUTEST_SMW_SME_WHV_OPTION1_SME_WHV_OPT1_SHIFT (0U) -/*! SME_WHV_OPT1 - Smart Erase WHV Option High */ -#define FMUTEST_SMW_SME_WHV_OPTION1_SME_WHV_OPT1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_SME_WHV_OPTION1_SME_WHV_OPT1_SHIFT)) & FMUTEST_SMW_SME_WHV_OPTION1_SME_WHV_OPT1_MASK) -/*! @} */ - -/*! @name REPAIR0_0 - FMU Repair 0 Block 0 Register */ -/*! @{ */ - -#define FMUTEST_REPAIR0_0_RDIS0_0_MASK (0x1U) -#define FMUTEST_REPAIR0_0_RDIS0_0_SHIFT (0U) -/*! RDIS0_0 - RDIS0_0 - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_REPAIR0_0_RDIS0_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR0_0_RDIS0_0_SHIFT)) & FMUTEST_REPAIR0_0_RDIS0_0_MASK) - -#define FMUTEST_REPAIR0_0_RADR0_0_MASK (0x1FEU) -#define FMUTEST_REPAIR0_0_RADR0_0_SHIFT (1U) -/*! RADR0_0 - RADR0_0 */ -#define FMUTEST_REPAIR0_0_RADR0_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR0_0_RADR0_0_SHIFT)) & FMUTEST_REPAIR0_0_RADR0_0_MASK) -/*! @} */ - -/*! @name REPAIR0_1 - FMU Repair 1 Block 0 Register */ -/*! @{ */ - -#define FMUTEST_REPAIR0_1_RDIS0_1_MASK (0x1U) -#define FMUTEST_REPAIR0_1_RDIS0_1_SHIFT (0U) -/*! RDIS0_1 - RDIS0_1 - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_REPAIR0_1_RDIS0_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR0_1_RDIS0_1_SHIFT)) & FMUTEST_REPAIR0_1_RDIS0_1_MASK) - -#define FMUTEST_REPAIR0_1_RADR0_1_MASK (0x1FEU) -#define FMUTEST_REPAIR0_1_RADR0_1_SHIFT (1U) -/*! RADR0_1 - RADR0_1 */ -#define FMUTEST_REPAIR0_1_RADR0_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR0_1_RADR0_1_SHIFT)) & FMUTEST_REPAIR0_1_RADR0_1_MASK) -/*! @} */ - -/*! @name REPAIR1_0 - FMU Repair 0 Block 1 Register */ -/*! @{ */ - -#define FMUTEST_REPAIR1_0_RDIS1_0_MASK (0x1U) -#define FMUTEST_REPAIR1_0_RDIS1_0_SHIFT (0U) -/*! RDIS1_0 - RDIS1_0 - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_REPAIR1_0_RDIS1_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR1_0_RDIS1_0_SHIFT)) & FMUTEST_REPAIR1_0_RDIS1_0_MASK) - -#define FMUTEST_REPAIR1_0_RADR1_0_MASK (0x1FEU) -#define FMUTEST_REPAIR1_0_RADR1_0_SHIFT (1U) -/*! RADR1_0 - RADR1_0 */ -#define FMUTEST_REPAIR1_0_RADR1_0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR1_0_RADR1_0_SHIFT)) & FMUTEST_REPAIR1_0_RADR1_0_MASK) -/*! @} */ - -/*! @name REPAIR1_1 - FMU Repair 1 Block 1 Register */ -/*! @{ */ - -#define FMUTEST_REPAIR1_1_RDIS1_1_MASK (0x1U) -#define FMUTEST_REPAIR1_1_RDIS1_1_SHIFT (0U) -/*! RDIS1_1 - RDIS1_1 - * 0b0..Repair address is valid - * 0b1..Repair address is not valid - */ -#define FMUTEST_REPAIR1_1_RDIS1_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR1_1_RDIS1_1_SHIFT)) & FMUTEST_REPAIR1_1_RDIS1_1_MASK) - -#define FMUTEST_REPAIR1_1_RADR1_1_MASK (0x1FEU) -#define FMUTEST_REPAIR1_1_RADR1_1_SHIFT (1U) -/*! RADR1_1 - RADR1_1 */ -#define FMUTEST_REPAIR1_1_RADR1_1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_REPAIR1_1_RADR1_1_SHIFT)) & FMUTEST_REPAIR1_1_RADR1_1_MASK) -/*! @} */ - -/*! @name SMW_HB_SIGNALS - SMW HB Signals Register */ -/*! @{ */ - -#define FMUTEST_SMW_HB_SIGNALS_SMW_ARRAY_MASK (0x7U) -#define FMUTEST_SMW_HB_SIGNALS_SMW_ARRAY_SHIFT (0U) -/*! SMW_ARRAY - SMW Region Select - * 0b000..Main array - * 0b001..IFR space only or main (and REDEN space) with IFR space for mass erase - * 0b010..IFR1 space - * 0b100..REDEN space - */ -#define FMUTEST_SMW_HB_SIGNALS_SMW_ARRAY(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_SMW_ARRAY_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_SMW_ARRAY_MASK) - -#define FMUTEST_SMW_HB_SIGNALS_USER_IFREN1_MASK (0x8U) -#define FMUTEST_SMW_HB_SIGNALS_USER_IFREN1_SHIFT (3U) -/*! USER_IFREN1 - IFR1 Enable - * 0b0..IFREN1 input to the flash array is driven LOW - * 0b1..IFREN1 input to the flash array is driven HIGH - */ -#define FMUTEST_SMW_HB_SIGNALS_USER_IFREN1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_USER_IFREN1_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_USER_IFREN1_MASK) - -#define FMUTEST_SMW_HB_SIGNALS_USER_PV_MASK (0x10U) -#define FMUTEST_SMW_HB_SIGNALS_USER_PV_SHIFT (4U) -/*! USER_PV - Program Verify - * 0b0..PV input to the flash array is driven LOW - * 0b1..PV input to the flash array is driven HIGH - */ -#define FMUTEST_SMW_HB_SIGNALS_USER_PV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_USER_PV_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_USER_PV_MASK) - -#define FMUTEST_SMW_HB_SIGNALS_USER_EV_MASK (0x20U) -#define FMUTEST_SMW_HB_SIGNALS_USER_EV_SHIFT (5U) -/*! USER_EV - Erase Verify - * 0b0..EV input to the flash array is driven LOW - * 0b1..EV input to the flash array is driven HIGH - */ -#define FMUTEST_SMW_HB_SIGNALS_USER_EV(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_USER_EV_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_USER_EV_MASK) - -#define FMUTEST_SMW_HB_SIGNALS_USER_IFREN_MASK (0x40U) -#define FMUTEST_SMW_HB_SIGNALS_USER_IFREN_SHIFT (6U) -/*! USER_IFREN - IFR Enable - * 0b0..IFREN input to the flash array is driven LOW - * 0b1..IFREN input to the flash array is driven HIGH - */ -#define FMUTEST_SMW_HB_SIGNALS_USER_IFREN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_USER_IFREN_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_USER_IFREN_MASK) - -#define FMUTEST_SMW_HB_SIGNALS_USER_REDEN_MASK (0x80U) -#define FMUTEST_SMW_HB_SIGNALS_USER_REDEN_SHIFT (7U) -/*! USER_REDEN - Repair Read Enable - * 0b0..REDEN input to the flash array is driven LOW - * 0b1..REDEN input to the flash array is driven HIGH - */ -#define FMUTEST_SMW_HB_SIGNALS_USER_REDEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_USER_REDEN_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_USER_REDEN_MASK) - -#define FMUTEST_SMW_HB_SIGNALS_USER_HEM_MASK (0x100U) -#define FMUTEST_SMW_HB_SIGNALS_USER_HEM_SHIFT (8U) -/*! USER_HEM - High Endurance Enable - * 0b0..HEM input to SMW / BIST PIN_CTRL[24] is driven LOW - * 0b1..HEM input to SMW / BIST PIN_CTRL[24] is driven HIGH - */ -#define FMUTEST_SMW_HB_SIGNALS_USER_HEM(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_SMW_HB_SIGNALS_USER_HEM_SHIFT)) & FMUTEST_SMW_HB_SIGNALS_USER_HEM_MASK) -/*! @} */ - -/*! @name BIST_DUMP_CTRL - BIST Datadump Control Register */ -/*! @{ */ - -#define FMUTEST_BIST_DUMP_CTRL_BIST_DONE_MASK (0x10000U) -#define FMUTEST_BIST_DUMP_CTRL_BIST_DONE_SHIFT (16U) -/*! BIST_DONE - BIST Done - * 0b0..The BIST (or data dump) is running - * 0b1..The BIST (or data dump) has completed - */ -#define FMUTEST_BIST_DUMP_CTRL_BIST_DONE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_BIST_DONE_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_BIST_DONE_MASK) - -#define FMUTEST_BIST_DUMP_CTRL_BIST_FAIL_MASK (0x20000U) -#define FMUTEST_BIST_DUMP_CTRL_BIST_FAIL_SHIFT (17U) -/*! BIST_FAIL - BIST Fail - * 0b0..The last BIST operation completed successfully (or could not fail) - * 0b1..The last BIST operation failed - */ -#define FMUTEST_BIST_DUMP_CTRL_BIST_FAIL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_BIST_FAIL_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_BIST_FAIL_MASK) - -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MASK (0x40000U) -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_SHIFT (18U) -/*! DATADUMP - Data Dump Enable */ -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_DATADUMP_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_DATADUMP_MASK) - -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_TRIG_MASK (0x80000U) -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_TRIG_SHIFT (19U) -/*! DATADUMP_TRIG - Data Dump Trigger */ -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_TRIG(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_DATADUMP_TRIG_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_DATADUMP_TRIG_MASK) - -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_PATT_MASK (0x300000U) -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_PATT_SHIFT (20U) -/*! DATADUMP_PATT - Data Dump Pattern Select - * 0b00..All ones - * 0b01..All zeroes - * 0b10..Checkerboard - * 0b11..Inverse checkerboard - */ -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_PATT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_DATADUMP_PATT_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_DATADUMP_PATT_MASK) - -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGEN_MASK (0x400000U) -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGEN_SHIFT (22U) -/*! DATADUMP_MRGEN - Data Dump Margin Enable - * 0b0..Normal read pulse shape - * 0b1..Margin read pulse shape - */ -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGEN(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGEN_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGEN_MASK) - -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGTYPE_MASK (0x800000U) -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGTYPE_SHIFT (23U) -/*! DATADUMP_MRGTYPE - Data Dump Margin Type - * 0b0..DIN method used - * 0b1..TM method used - */ -#define FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGTYPE(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGTYPE_SHIFT)) & FMUTEST_BIST_DUMP_CTRL_DATADUMP_MRGTYPE_MASK) -/*! @} */ - -/*! @name ATX_PIN_CTRL - ATX Pin Control Register */ -/*! @{ */ - -#define FMUTEST_ATX_PIN_CTRL_TM_TO_ATX_MASK (0xFFU) -#define FMUTEST_ATX_PIN_CTRL_TM_TO_ATX_SHIFT (0U) -/*! TM_TO_ATX - TM to ATX - * 0b00000001..TM[0] to ATX0 - * 0b00000010..TM[1] to ATX0 - * 0b00000100..TM[2] to ATX0 - * 0b00001000..TM[3] to ATX0 - * 0b00010000..TM[0] to ATX1 - * 0b00100000..TM[1] to ATX1 - * 0b01000000..TM[2] to ATX1 - * 0b10000000..TM[3] to ATX1 - */ -#define FMUTEST_ATX_PIN_CTRL_TM_TO_ATX(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_ATX_PIN_CTRL_TM_TO_ATX_SHIFT)) & FMUTEST_ATX_PIN_CTRL_TM_TO_ATX_MASK) -/*! @} */ - -/*! @name FAILCNT - Fail Count Register */ -/*! @{ */ - -#define FMUTEST_FAILCNT_FAILCNT_MASK (0xFFFFFFFFU) -#define FMUTEST_FAILCNT_FAILCNT_SHIFT (0U) -/*! FAILCNT - Fail Count */ -#define FMUTEST_FAILCNT_FAILCNT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_FAILCNT_FAILCNT_SHIFT)) & FMUTEST_FAILCNT_FAILCNT_MASK) -/*! @} */ - -/*! @name PGM_PULSE_CNT0 - Block 0 Program Pulse Count Register */ -/*! @{ */ - -#define FMUTEST_PGM_PULSE_CNT0_PGM_CNT0_MASK (0xFFFFFFFFU) -#define FMUTEST_PGM_PULSE_CNT0_PGM_CNT0_SHIFT (0U) -/*! PGM_CNT0 - Program Pulse Count */ -#define FMUTEST_PGM_PULSE_CNT0_PGM_CNT0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PGM_PULSE_CNT0_PGM_CNT0_SHIFT)) & FMUTEST_PGM_PULSE_CNT0_PGM_CNT0_MASK) -/*! @} */ - -/*! @name PGM_PULSE_CNT1 - Block 1 Program Pulse Count Register */ -/*! @{ */ - -#define FMUTEST_PGM_PULSE_CNT1_PGM_CNT1_MASK (0xFFFFFFFFU) -#define FMUTEST_PGM_PULSE_CNT1_PGM_CNT1_SHIFT (0U) -/*! PGM_CNT1 - Program Pulse Count */ -#define FMUTEST_PGM_PULSE_CNT1_PGM_CNT1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PGM_PULSE_CNT1_PGM_CNT1_SHIFT)) & FMUTEST_PGM_PULSE_CNT1_PGM_CNT1_MASK) -/*! @} */ - -/*! @name ERS_PULSE_CNT - Erase Pulse Count Register */ -/*! @{ */ - -#define FMUTEST_ERS_PULSE_CNT_ERS_CNT0_MASK (0xFFFFU) -#define FMUTEST_ERS_PULSE_CNT_ERS_CNT0_SHIFT (0U) -/*! ERS_CNT0 - Block 0 Erase Pulse Count */ -#define FMUTEST_ERS_PULSE_CNT_ERS_CNT0(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_ERS_PULSE_CNT_ERS_CNT0_SHIFT)) & FMUTEST_ERS_PULSE_CNT_ERS_CNT0_MASK) - -#define FMUTEST_ERS_PULSE_CNT_ERS_CNT1_MASK (0xFFFF0000U) -#define FMUTEST_ERS_PULSE_CNT_ERS_CNT1_SHIFT (16U) -/*! ERS_CNT1 - Block 1 Erase Pulse Count */ -#define FMUTEST_ERS_PULSE_CNT_ERS_CNT1(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_ERS_PULSE_CNT_ERS_CNT1_SHIFT)) & FMUTEST_ERS_PULSE_CNT_ERS_CNT1_MASK) -/*! @} */ - -/*! @name MAX_PULSE_CNT - Maximum Pulse Count Register */ -/*! @{ */ - -#define FMUTEST_MAX_PULSE_CNT_LAST_PCNT_MASK (0x1FFU) -#define FMUTEST_MAX_PULSE_CNT_LAST_PCNT_SHIFT (0U) -/*! LAST_PCNT - Last SMW Operation's Pulse Count */ -#define FMUTEST_MAX_PULSE_CNT_LAST_PCNT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MAX_PULSE_CNT_LAST_PCNT_SHIFT)) & FMUTEST_MAX_PULSE_CNT_LAST_PCNT_MASK) - -#define FMUTEST_MAX_PULSE_CNT_MAX_ERS_CNT_MASK (0x1FF0000U) -#define FMUTEST_MAX_PULSE_CNT_MAX_ERS_CNT_SHIFT (16U) -/*! MAX_ERS_CNT - Maximum Erase Pulse Count */ -#define FMUTEST_MAX_PULSE_CNT_MAX_ERS_CNT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MAX_PULSE_CNT_MAX_ERS_CNT_SHIFT)) & FMUTEST_MAX_PULSE_CNT_MAX_ERS_CNT_MASK) - -#define FMUTEST_MAX_PULSE_CNT_MAX_PGM_CNT_MASK (0xF8000000U) -#define FMUTEST_MAX_PULSE_CNT_MAX_PGM_CNT_SHIFT (27U) -/*! MAX_PGM_CNT - Maximum Program Pulse Count */ -#define FMUTEST_MAX_PULSE_CNT_MAX_PGM_CNT(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_MAX_PULSE_CNT_MAX_PGM_CNT_SHIFT)) & FMUTEST_MAX_PULSE_CNT_MAX_PGM_CNT_MASK) -/*! @} */ - -/*! @name PORT_CTRL - Port Control Register */ -/*! @{ */ - -#define FMUTEST_PORT_CTRL_BDONE_SEL_MASK (0x3U) -#define FMUTEST_PORT_CTRL_BDONE_SEL_SHIFT (0U) -/*! BDONE_SEL - BIST Done Select - * 0b00..Select internal bist_done signal from current module instantiation - * 0b01..Select ipt_bist_fail signal from current module instantiation - * 0b10..Select ipt_bist_done signal from other module instantiation - * 0b11..Select AND of internal bist_done signal from current module instantiation with ipt_bist_done signal from other module instantiation - */ -#define FMUTEST_PORT_CTRL_BDONE_SEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PORT_CTRL_BDONE_SEL_SHIFT)) & FMUTEST_PORT_CTRL_BDONE_SEL_MASK) - -#define FMUTEST_PORT_CTRL_BSDO_SEL_MASK (0xCU) -#define FMUTEST_PORT_CTRL_BSDO_SEL_SHIFT (2U) -/*! BSDO_SEL - BIST Serial Data Output Select - * 0b00..Select internal bist_sdo signal from current module instantiation - * 0b01..Select ipt_bist_done signal from current module instantiation - * 0b10..Select ipt_bist_sdo signal from other module instantiation - * 0b11..Select ipt_bist_done signal from other module instantiation - */ -#define FMUTEST_PORT_CTRL_BSDO_SEL(x) (((uint32_t)(((uint32_t)(x)) << FMUTEST_PORT_CTRL_BSDO_SEL_SHIFT)) & FMUTEST_PORT_CTRL_BSDO_SEL_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group FMUTEST_Register_Masks */ - - -/* FMUTEST - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral FMU0TEST base address */ - #define FMU0TEST_BASE (0x50043000u) - /** Peripheral FMU0TEST base address */ - #define FMU0TEST_BASE_NS (0x40043000u) - /** Peripheral FMU0TEST base pointer */ - #define FMU0TEST ((FMUTEST_Type *)FMU0TEST_BASE) - /** Peripheral FMU0TEST base pointer */ - #define FMU0TEST_NS ((FMUTEST_Type *)FMU0TEST_BASE_NS) - /** Array initializer of FMUTEST peripheral base addresses */ - #define FMUTEST_BASE_ADDRS { FMU0TEST_BASE } - /** Array initializer of FMUTEST peripheral base pointers */ - #define FMUTEST_BASE_PTRS { FMU0TEST } - /** Array initializer of FMUTEST peripheral base addresses */ - #define FMUTEST_BASE_ADDRS_NS { FMU0TEST_BASE_NS } - /** Array initializer of FMUTEST peripheral base pointers */ - #define FMUTEST_BASE_PTRS_NS { FMU0TEST_NS } -#else - /** Peripheral FMU0TEST base address */ - #define FMU0TEST_BASE (0x40043000u) - /** Peripheral FMU0TEST base pointer */ - #define FMU0TEST ((FMUTEST_Type *)FMU0TEST_BASE) - /** Array initializer of FMUTEST peripheral base addresses */ - #define FMUTEST_BASE_ADDRS { FMU0TEST_BASE } - /** Array initializer of FMUTEST peripheral base pointers */ - #define FMUTEST_BASE_PTRS { FMU0TEST } -#endif - -/*! - * @} - */ /* end of group FMUTEST_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- FREQME Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FREQME_Peripheral_Access_Layer FREQME Peripheral Access Layer - * @{ - */ - -/** FREQME - Register Layout Typedef */ -typedef struct { - union { /* offset: 0x0 */ - __I uint32_t CTRL_R; /**< Control (in Read mode), offset: 0x0 */ - __O uint32_t CTRL_W; /**< Control (in Write mode), offset: 0x0 */ - }; - __IO uint32_t CTRLSTAT; /**< Control Status, offset: 0x4 */ - __IO uint32_t MIN; /**< Minimum, offset: 0x8 */ - __IO uint32_t MAX; /**< Maximum, offset: 0xC */ -} FREQME_Type; - -/* ---------------------------------------------------------------------------- - -- FREQME Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup FREQME_Register_Masks FREQME Register Masks - * @{ - */ - -/*! @name CTRL_R - Control (in Read mode) */ -/*! @{ */ - -#define FREQME_CTRL_R_RESULT_MASK (0x7FFFFFFFU) -#define FREQME_CTRL_R_RESULT_SHIFT (0U) -#define FREQME_CTRL_R_RESULT(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_R_RESULT_SHIFT)) & FREQME_CTRL_R_RESULT_MASK) - -#define FREQME_CTRL_R_MEASURE_IN_PROGRESS_MASK (0x80000000U) -#define FREQME_CTRL_R_MEASURE_IN_PROGRESS_SHIFT (31U) -/*! MEASURE_IN_PROGRESS - Measurement In Progress - * 0b0..Complete - * 0b1..In progress - */ -#define FREQME_CTRL_R_MEASURE_IN_PROGRESS(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_R_MEASURE_IN_PROGRESS_SHIFT)) & FREQME_CTRL_R_MEASURE_IN_PROGRESS_MASK) -/*! @} */ - -/*! @name CTRL_W - Control (in Write mode) */ -/*! @{ */ - -#define FREQME_CTRL_W_REF_SCALE_MASK (0x1FU) -#define FREQME_CTRL_W_REF_SCALE_SHIFT (0U) -/*! REF_SCALE - Reference Clock Scaling Factor */ -#define FREQME_CTRL_W_REF_SCALE(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_REF_SCALE_SHIFT)) & FREQME_CTRL_W_REF_SCALE_MASK) - -#define FREQME_CTRL_W_PULSE_MODE_MASK (0x100U) -#define FREQME_CTRL_W_PULSE_MODE_SHIFT (8U) -/*! PULSE_MODE - Pulse Width Measurement Mode Select - * 0b0..Frequency Measurement mode - * 0b1..Pulse Width Measurement mode - */ -#define FREQME_CTRL_W_PULSE_MODE(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_PULSE_MODE_SHIFT)) & FREQME_CTRL_W_PULSE_MODE_MASK) - -#define FREQME_CTRL_W_PULSE_POL_MASK (0x200U) -#define FREQME_CTRL_W_PULSE_POL_SHIFT (9U) -/*! PULSE_POL - Pulse Polarity - * 0b0..High period - * 0b1..Low period - */ -#define FREQME_CTRL_W_PULSE_POL(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_PULSE_POL_SHIFT)) & FREQME_CTRL_W_PULSE_POL_MASK) - -#define FREQME_CTRL_W_LT_MIN_INT_EN_MASK (0x1000U) -#define FREQME_CTRL_W_LT_MIN_INT_EN_SHIFT (12U) -/*! LT_MIN_INT_EN - Less Than Minimum Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FREQME_CTRL_W_LT_MIN_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_LT_MIN_INT_EN_SHIFT)) & FREQME_CTRL_W_LT_MIN_INT_EN_MASK) - -#define FREQME_CTRL_W_GT_MAX_INT_EN_MASK (0x2000U) -#define FREQME_CTRL_W_GT_MAX_INT_EN_SHIFT (13U) -/*! GT_MAX_INT_EN - Greater Than Maximum Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FREQME_CTRL_W_GT_MAX_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_GT_MAX_INT_EN_SHIFT)) & FREQME_CTRL_W_GT_MAX_INT_EN_MASK) - -#define FREQME_CTRL_W_RESULT_READY_INT_EN_MASK (0x4000U) -#define FREQME_CTRL_W_RESULT_READY_INT_EN_SHIFT (14U) -/*! RESULT_READY_INT_EN - Result Ready Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FREQME_CTRL_W_RESULT_READY_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_RESULT_READY_INT_EN_SHIFT)) & FREQME_CTRL_W_RESULT_READY_INT_EN_MASK) - -#define FREQME_CTRL_W_CONTINUOUS_MODE_EN_MASK (0x40000000U) -#define FREQME_CTRL_W_CONTINUOUS_MODE_EN_SHIFT (30U) -/*! CONTINUOUS_MODE_EN - Continuous Mode Enable - * 0b0..Disable - * 0b1..Enable - */ -#define FREQME_CTRL_W_CONTINUOUS_MODE_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_CONTINUOUS_MODE_EN_SHIFT)) & FREQME_CTRL_W_CONTINUOUS_MODE_EN_MASK) - -#define FREQME_CTRL_W_MEASURE_IN_PROGRESS_MASK (0x80000000U) -#define FREQME_CTRL_W_MEASURE_IN_PROGRESS_SHIFT (31U) -/*! MEASURE_IN_PROGRESS - Measurement In Progress - * 0b0..Terminates measurement - * 0b1..Initiates measurement - */ -#define FREQME_CTRL_W_MEASURE_IN_PROGRESS(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRL_W_MEASURE_IN_PROGRESS_SHIFT)) & FREQME_CTRL_W_MEASURE_IN_PROGRESS_MASK) -/*! @} */ - -/*! @name CTRLSTAT - Control Status */ -/*! @{ */ - -#define FREQME_CTRLSTAT_REF_SCALE_MASK (0x1FU) -#define FREQME_CTRLSTAT_REF_SCALE_SHIFT (0U) -/*! REF_SCALE - Reference Scale */ -#define FREQME_CTRLSTAT_REF_SCALE(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_REF_SCALE_SHIFT)) & FREQME_CTRLSTAT_REF_SCALE_MASK) - -#define FREQME_CTRLSTAT_PULSE_MODE_MASK (0x100U) -#define FREQME_CTRLSTAT_PULSE_MODE_SHIFT (8U) -/*! PULSE_MODE - Pulse Mode - * 0b0..Frequency Measurement mode - * 0b1..Pulse Width Measurement mode - */ -#define FREQME_CTRLSTAT_PULSE_MODE(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_PULSE_MODE_SHIFT)) & FREQME_CTRLSTAT_PULSE_MODE_MASK) - -#define FREQME_CTRLSTAT_PULSE_POL_MASK (0x200U) -#define FREQME_CTRLSTAT_PULSE_POL_SHIFT (9U) -/*! PULSE_POL - Pulse Polarity - * 0b0..High period - * 0b1..Low period - */ -#define FREQME_CTRLSTAT_PULSE_POL(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_PULSE_POL_SHIFT)) & FREQME_CTRLSTAT_PULSE_POL_MASK) - -#define FREQME_CTRLSTAT_LT_MIN_INT_EN_MASK (0x1000U) -#define FREQME_CTRLSTAT_LT_MIN_INT_EN_SHIFT (12U) -/*! LT_MIN_INT_EN - Less Than Minimum Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define FREQME_CTRLSTAT_LT_MIN_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_LT_MIN_INT_EN_SHIFT)) & FREQME_CTRLSTAT_LT_MIN_INT_EN_MASK) - -#define FREQME_CTRLSTAT_GT_MAX_INT_EN_MASK (0x2000U) -#define FREQME_CTRLSTAT_GT_MAX_INT_EN_SHIFT (13U) -/*! GT_MAX_INT_EN - Greater Than Maximum Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define FREQME_CTRLSTAT_GT_MAX_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_GT_MAX_INT_EN_SHIFT)) & FREQME_CTRLSTAT_GT_MAX_INT_EN_MASK) - -#define FREQME_CTRLSTAT_RESULT_READY_INT_EN_MASK (0x4000U) -#define FREQME_CTRLSTAT_RESULT_READY_INT_EN_SHIFT (14U) -/*! RESULT_READY_INT_EN - Result Ready Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define FREQME_CTRLSTAT_RESULT_READY_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_RESULT_READY_INT_EN_SHIFT)) & FREQME_CTRLSTAT_RESULT_READY_INT_EN_MASK) - -#define FREQME_CTRLSTAT_LT_MIN_STAT_MASK (0x1000000U) -#define FREQME_CTRLSTAT_LT_MIN_STAT_SHIFT (24U) -/*! LT_MIN_STAT - Less Than Minimum Results Status - * 0b0..Greater than MIN[MIN_VALUE] - * 0b1..Less than MIN[MIN_VALUE] - */ -#define FREQME_CTRLSTAT_LT_MIN_STAT(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_LT_MIN_STAT_SHIFT)) & FREQME_CTRLSTAT_LT_MIN_STAT_MASK) - -#define FREQME_CTRLSTAT_GT_MAX_STAT_MASK (0x2000000U) -#define FREQME_CTRLSTAT_GT_MAX_STAT_SHIFT (25U) -/*! GT_MAX_STAT - Greater Than Maximum Result Status - * 0b0..Less than MAX[MAX_VALUE] - * 0b1..Greater than MAX[MAX_VALUE] - */ -#define FREQME_CTRLSTAT_GT_MAX_STAT(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_GT_MAX_STAT_SHIFT)) & FREQME_CTRLSTAT_GT_MAX_STAT_MASK) - -#define FREQME_CTRLSTAT_RESULT_READY_STAT_MASK (0x4000000U) -#define FREQME_CTRLSTAT_RESULT_READY_STAT_SHIFT (26U) -/*! RESULT_READY_STAT - Result Ready Status - * 0b0..Not complete - * 0b1..Complete - */ -#define FREQME_CTRLSTAT_RESULT_READY_STAT(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_RESULT_READY_STAT_SHIFT)) & FREQME_CTRLSTAT_RESULT_READY_STAT_MASK) - -#define FREQME_CTRLSTAT_CONTINUOUS_MODE_EN_MASK (0x40000000U) -#define FREQME_CTRLSTAT_CONTINUOUS_MODE_EN_SHIFT (30U) -/*! CONTINUOUS_MODE_EN - Continuous Mode Enable Status - * 0b0..Disabled - * 0b1..Enabled - */ -#define FREQME_CTRLSTAT_CONTINUOUS_MODE_EN(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_CONTINUOUS_MODE_EN_SHIFT)) & FREQME_CTRLSTAT_CONTINUOUS_MODE_EN_MASK) - -#define FREQME_CTRLSTAT_MEASURE_IN_PROGRESS_MASK (0x80000000U) -#define FREQME_CTRLSTAT_MEASURE_IN_PROGRESS_SHIFT (31U) -/*! MEASURE_IN_PROGRESS - Measurement in Progress Status - * 0b0..Not in progress - * 0b1..In progress - */ -#define FREQME_CTRLSTAT_MEASURE_IN_PROGRESS(x) (((uint32_t)(((uint32_t)(x)) << FREQME_CTRLSTAT_MEASURE_IN_PROGRESS_SHIFT)) & FREQME_CTRLSTAT_MEASURE_IN_PROGRESS_MASK) -/*! @} */ - -/*! @name MIN - Minimum */ -/*! @{ */ - -#define FREQME_MIN_MIN_VALUE_MASK (0x7FFFFFFFU) -#define FREQME_MIN_MIN_VALUE_SHIFT (0U) -/*! MIN_VALUE - Minimum Value */ -#define FREQME_MIN_MIN_VALUE(x) (((uint32_t)(((uint32_t)(x)) << FREQME_MIN_MIN_VALUE_SHIFT)) & FREQME_MIN_MIN_VALUE_MASK) -/*! @} */ - -/*! @name MAX - Maximum */ -/*! @{ */ - -#define FREQME_MAX_MAX_VALUE_MASK (0x7FFFFFFFU) -#define FREQME_MAX_MAX_VALUE_SHIFT (0U) -/*! MAX_VALUE - Maximum Value */ -#define FREQME_MAX_MAX_VALUE(x) (((uint32_t)(((uint32_t)(x)) << FREQME_MAX_MAX_VALUE_SHIFT)) & FREQME_MAX_MAX_VALUE_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group FREQME_Register_Masks */ - - -/* FREQME - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral FREQME0 base address */ - #define FREQME0_BASE (0x50011000u) - /** Peripheral FREQME0 base address */ - #define FREQME0_BASE_NS (0x40011000u) - /** Peripheral FREQME0 base pointer */ - #define FREQME0 ((FREQME_Type *)FREQME0_BASE) - /** Peripheral FREQME0 base pointer */ - #define FREQME0_NS ((FREQME_Type *)FREQME0_BASE_NS) - /** Array initializer of FREQME peripheral base addresses */ - #define FREQME_BASE_ADDRS { FREQME0_BASE } - /** Array initializer of FREQME peripheral base pointers */ - #define FREQME_BASE_PTRS { FREQME0 } - /** Array initializer of FREQME peripheral base addresses */ - #define FREQME_BASE_ADDRS_NS { FREQME0_BASE_NS } - /** Array initializer of FREQME peripheral base pointers */ - #define FREQME_BASE_PTRS_NS { FREQME0_NS } -#else - /** Peripheral FREQME0 base address */ - #define FREQME0_BASE (0x40011000u) - /** Peripheral FREQME0 base pointer */ - #define FREQME0 ((FREQME_Type *)FREQME0_BASE) - /** Array initializer of FREQME peripheral base addresses */ - #define FREQME_BASE_ADDRS { FREQME0_BASE } - /** Array initializer of FREQME peripheral base pointers */ - #define FREQME_BASE_PTRS { FREQME0 } -#endif -/** Interrupt vectors for the FREQME peripheral type */ -#define FREQME_IRQS { Freqme_IRQn } - -/*! - * @} - */ /* end of group FREQME_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- GDET Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup GDET_Peripheral_Access_Layer GDET Peripheral Access Layer - * @{ - */ - -/** GDET - Register Layout Typedef */ -typedef struct { - __IO uint32_t GDET_CONF_0; /**< GDET Configuration 0 Register, offset: 0x0 */ - __IO uint32_t GDET_CONF_1; /**< GDET Configuration 1 Register, offset: 0x4 */ - __IO uint32_t GDET_ENABLE1; /**< GDET Enable Register, offset: 0x8 */ - __IO uint32_t GDET_CONF_2; /**< GDET Configuration 2 Register, offset: 0xC */ - __IO uint32_t GDET_CONF_3; /**< GDET Configuration 3 Register, offset: 0x10 */ - __IO uint32_t GDET_CONF_4; /**< GDET Configuration 4 Register, offset: 0x14 */ - __IO uint32_t GDET_CONF_5; /**< GDET Configuration 5 Register, offset: 0x18 */ - uint8_t RESERVED_0[4004]; - __IO uint32_t GDET_RESET; /**< GDET Reset Register, offset: 0xFC0 */ - __IO uint32_t GDET_TEST; /**< GDET Test Register, offset: 0xFC4 */ - uint8_t RESERVED_1[4]; - __IO uint32_t GDET_DLY_CTRL; /**< GDET Delay Control Register, offset: 0xFCC */ -} GDET_Type; - -/* ---------------------------------------------------------------------------- - -- GDET Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup GDET_Register_Masks GDET Register Masks - * @{ - */ - -/*! @name GDET_CONF_0 - GDET Configuration 0 Register */ -/*! @{ */ - -#define GDET_GDET_CONF_0_FIELD_3_0_MASK (0xFU) -#define GDET_GDET_CONF_0_FIELD_3_0_SHIFT (0U) -/*! FIELD_3_0 - GDET Configuration 0 Field 3_0 */ -#define GDET_GDET_CONF_0_FIELD_3_0(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_0_FIELD_3_0_SHIFT)) & GDET_GDET_CONF_0_FIELD_3_0_MASK) - -#define GDET_GDET_CONF_0_FIELD_3_0_MASK (0xFU) -#define GDET_GDET_CONF_0_FIELD_3_0_SHIFT (0U) -/*! field_3_0 - GDET configuration 0 Field 3_0 */ -#define GDET_GDET_CONF_0_FIELD_3_0(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_0_FIELD_3_0_SHIFT)) & GDET_GDET_CONF_0_FIELD_3_0_MASK) - -#define GDET_GDET_CONF_0_SBZ_MASK (0x10U) -#define GDET_GDET_CONF_0_SBZ_SHIFT (4U) -/*! SBZ - Should Be Left to Zero */ -#define GDET_GDET_CONF_0_SBZ(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_0_SBZ_SHIFT)) & GDET_GDET_CONF_0_SBZ_MASK) - -#define GDET_GDET_CONF_0_SBZ_MASK (0x10U) -#define GDET_GDET_CONF_0_SBZ_SHIFT (4U) -/*! sbz - Should be left to zero */ -#define GDET_GDET_CONF_0_SBZ(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_0_SBZ_SHIFT)) & GDET_GDET_CONF_0_SBZ_MASK) - -#define GDET_GDET_CONF_0_RFU_MASK (0xFFFFFFE0U) -#define GDET_GDET_CONF_0_RFU_SHIFT (5U) -/*! RFU - Reserved for Future Use */ -#define GDET_GDET_CONF_0_RFU(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_0_RFU_SHIFT)) & GDET_GDET_CONF_0_RFU_MASK) - -#define GDET_GDET_CONF_0_RFU_MASK (0xFFFFFFE0U) -#define GDET_GDET_CONF_0_RFU_SHIFT (5U) -/*! rfu - Reserved for Future Use */ -#define GDET_GDET_CONF_0_RFU(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_0_RFU_SHIFT)) & GDET_GDET_CONF_0_RFU_MASK) -/*! @} */ - -/*! @name GDET_CONF_1 - GDET Configuration 1 Register */ -/*! @{ */ - -#define GDET_GDET_CONF_1_FIELD_1_0_MASK (0x3U) -#define GDET_GDET_CONF_1_FIELD_1_0_SHIFT (0U) -/*! FIELD_1_0 - GDET Configuration 1 Field 1_0 */ -#define GDET_GDET_CONF_1_FIELD_1_0(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_FIELD_1_0_SHIFT)) & GDET_GDET_CONF_1_FIELD_1_0_MASK) - -#define GDET_GDET_CONF_1_FIELD_1_0_MASK (0x3U) -#define GDET_GDET_CONF_1_FIELD_1_0_SHIFT (0U) -/*! field_1_0 - GDET configuration 1 Field 1_0 */ -#define GDET_GDET_CONF_1_FIELD_1_0(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_FIELD_1_0_SHIFT)) & GDET_GDET_CONF_1_FIELD_1_0_MASK) - -#define GDET_GDET_CONF_1_FIELD_3_2_MASK (0xCU) -#define GDET_GDET_CONF_1_FIELD_3_2_SHIFT (2U) -/*! FIELD_3_2 - GDET Configuration 1 Field 3_2 */ -#define GDET_GDET_CONF_1_FIELD_3_2(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_FIELD_3_2_SHIFT)) & GDET_GDET_CONF_1_FIELD_3_2_MASK) - -#define GDET_GDET_CONF_1_FIELD_3_2_MASK (0xCU) -#define GDET_GDET_CONF_1_FIELD_3_2_SHIFT (2U) -/*! field_3_2 - GDET configuration 1 Field 3_2 */ -#define GDET_GDET_CONF_1_FIELD_3_2(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_FIELD_3_2_SHIFT)) & GDET_GDET_CONF_1_FIELD_3_2_MASK) - -#define GDET_GDET_CONF_1_SBZ1_MASK (0x10U) -#define GDET_GDET_CONF_1_SBZ1_SHIFT (4U) -/*! SBZ1 - Should Be Left to Zero */ -#define GDET_GDET_CONF_1_SBZ1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_SBZ1_SHIFT)) & GDET_GDET_CONF_1_SBZ1_MASK) - -#define GDET_GDET_CONF_1_SBZ1_MASK (0x10U) -#define GDET_GDET_CONF_1_SBZ1_SHIFT (4U) -/*! sbz1 - Should be left to zero */ -#define GDET_GDET_CONF_1_SBZ1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_SBZ1_SHIFT)) & GDET_GDET_CONF_1_SBZ1_MASK) - -#define GDET_GDET_CONF_1_SBZ2_MASK (0x20U) -#define GDET_GDET_CONF_1_SBZ2_SHIFT (5U) -/*! SBZ2 - Should Be Left to Zero */ -#define GDET_GDET_CONF_1_SBZ2(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_SBZ2_SHIFT)) & GDET_GDET_CONF_1_SBZ2_MASK) - -#define GDET_GDET_CONF_1_SBZ2_MASK (0x20U) -#define GDET_GDET_CONF_1_SBZ2_SHIFT (5U) -/*! sbz2 - Should be left to zero */ -#define GDET_GDET_CONF_1_SBZ2(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_SBZ2_SHIFT)) & GDET_GDET_CONF_1_SBZ2_MASK) - -#define GDET_GDET_CONF_1_SBZ3_MASK (0x40U) -#define GDET_GDET_CONF_1_SBZ3_SHIFT (6U) -/*! SBZ3 - Should Be Left to Zero */ -#define GDET_GDET_CONF_1_SBZ3(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_SBZ3_SHIFT)) & GDET_GDET_CONF_1_SBZ3_MASK) - -#define GDET_GDET_CONF_1_SBZ3_MASK (0x40U) -#define GDET_GDET_CONF_1_SBZ3_SHIFT (6U) -/*! sbz3 - Should be left to zero */ -#define GDET_GDET_CONF_1_SBZ3(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_SBZ3_SHIFT)) & GDET_GDET_CONF_1_SBZ3_MASK) - -#define GDET_GDET_CONF_1_FIELD_7_MASK (0x80U) -#define GDET_GDET_CONF_1_FIELD_7_SHIFT (7U) -/*! FIELD_7 - GDET Configuration 1 Field 7 */ -#define GDET_GDET_CONF_1_FIELD_7(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_FIELD_7_SHIFT)) & GDET_GDET_CONF_1_FIELD_7_MASK) - -#define GDET_GDET_CONF_1_FIELD_7_MASK (0x80U) -#define GDET_GDET_CONF_1_FIELD_7_SHIFT (7U) -/*! field_7 - GDET configuration 1 Field 7 */ -#define GDET_GDET_CONF_1_FIELD_7(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_FIELD_7_SHIFT)) & GDET_GDET_CONF_1_FIELD_7_MASK) - -#define GDET_GDET_CONF_1_FIELD_8_MASK (0x100U) -#define GDET_GDET_CONF_1_FIELD_8_SHIFT (8U) -/*! FIELD_8 - GDET Configuration 1 Field 8 */ -#define GDET_GDET_CONF_1_FIELD_8(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_FIELD_8_SHIFT)) & GDET_GDET_CONF_1_FIELD_8_MASK) - -#define GDET_GDET_CONF_1_FIELD_8_MASK (0x100U) -#define GDET_GDET_CONF_1_FIELD_8_SHIFT (8U) -/*! field_8 - GDET configuration 1 Field 8 */ -#define GDET_GDET_CONF_1_FIELD_8(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_FIELD_8_SHIFT)) & GDET_GDET_CONF_1_FIELD_8_MASK) - -#define GDET_GDET_CONF_1_SBZ4_MASK (0x200U) -#define GDET_GDET_CONF_1_SBZ4_SHIFT (9U) -/*! SBZ4 - Should Be Left to Zero */ -#define GDET_GDET_CONF_1_SBZ4(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_SBZ4_SHIFT)) & GDET_GDET_CONF_1_SBZ4_MASK) - -#define GDET_GDET_CONF_1_SBZ4_MASK (0x200U) -#define GDET_GDET_CONF_1_SBZ4_SHIFT (9U) -/*! sbz4 - Should be left to zero */ -#define GDET_GDET_CONF_1_SBZ4(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_SBZ4_SHIFT)) & GDET_GDET_CONF_1_SBZ4_MASK) - -#define GDET_GDET_CONF_1_SBZ5_MASK (0x400U) -#define GDET_GDET_CONF_1_SBZ5_SHIFT (10U) -/*! SBZ5 - Should Be Left to Zero */ -#define GDET_GDET_CONF_1_SBZ5(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_SBZ5_SHIFT)) & GDET_GDET_CONF_1_SBZ5_MASK) - -#define GDET_GDET_CONF_1_SBZ5_MASK (0x400U) -#define GDET_GDET_CONF_1_SBZ5_SHIFT (10U) -/*! sbz5 - Should be left to zero */ -#define GDET_GDET_CONF_1_SBZ5(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_SBZ5_SHIFT)) & GDET_GDET_CONF_1_SBZ5_MASK) - -#define GDET_GDET_CONF_1_RFU_MASK (0xFFFFF800U) -#define GDET_GDET_CONF_1_RFU_SHIFT (11U) -/*! RFU - Reserved for Future Use */ -#define GDET_GDET_CONF_1_RFU(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_RFU_SHIFT)) & GDET_GDET_CONF_1_RFU_MASK) - -#define GDET_GDET_CONF_1_RFU_MASK (0xFFFFF800U) -#define GDET_GDET_CONF_1_RFU_SHIFT (11U) -/*! rfu - Reserved for Future Use */ -#define GDET_GDET_CONF_1_RFU(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_1_RFU_SHIFT)) & GDET_GDET_CONF_1_RFU_MASK) -/*! @} */ - -/*! @name GDET_ENABLE1 - GDET Enable Register */ -/*! @{ */ - -#define GDET_GDET_ENABLE1_EN1_MASK (0x1U) -#define GDET_GDET_ENABLE1_EN1_SHIFT (0U) -/*! EN1 - If set, the detector will be clock gated */ -#define GDET_GDET_ENABLE1_EN1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_ENABLE1_EN1_SHIFT)) & GDET_GDET_ENABLE1_EN1_MASK) - -#define GDET_GDET_ENABLE1_EN1_MASK (0x1U) -#define GDET_GDET_ENABLE1_EN1_SHIFT (0U) -/*! en1 - If set, the detector will be clock gated */ -#define GDET_GDET_ENABLE1_EN1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_ENABLE1_EN1_SHIFT)) & GDET_GDET_ENABLE1_EN1_MASK) - -#define GDET_GDET_ENABLE1_RFU_MASK (0xFFFFFFFEU) -#define GDET_GDET_ENABLE1_RFU_SHIFT (1U) -/*! RFU - Reserved for Future Use */ -#define GDET_GDET_ENABLE1_RFU(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_ENABLE1_RFU_SHIFT)) & GDET_GDET_ENABLE1_RFU_MASK) - -#define GDET_GDET_ENABLE1_RFU_MASK (0xFFFFFFFEU) -#define GDET_GDET_ENABLE1_RFU_SHIFT (1U) -/*! rfu - Reserved for Future Use */ -#define GDET_GDET_ENABLE1_RFU(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_ENABLE1_RFU_SHIFT)) & GDET_GDET_ENABLE1_RFU_MASK) -/*! @} */ - -/*! @name GDET_CONF_2 - GDET Configuration 2 Register */ -/*! @{ */ - -#define GDET_GDET_CONF_2_FIELD_6_0_MASK (0x7FU) -#define GDET_GDET_CONF_2_FIELD_6_0_SHIFT (0U) -/*! FIELD_6_0 - GDET Configuration 2 Field 6_0 */ -#define GDET_GDET_CONF_2_FIELD_6_0(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_2_FIELD_6_0_SHIFT)) & GDET_GDET_CONF_2_FIELD_6_0_MASK) - -#define GDET_GDET_CONF_2_FIELD_6_0_MASK (0x7FU) -#define GDET_GDET_CONF_2_FIELD_6_0_SHIFT (0U) -/*! field_6_0 - GDET configuration 2 Field 6_0 */ -#define GDET_GDET_CONF_2_FIELD_6_0(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_2_FIELD_6_0_SHIFT)) & GDET_GDET_CONF_2_FIELD_6_0_MASK) - -#define GDET_GDET_CONF_2_RFU1_MASK (0xFF80U) -#define GDET_GDET_CONF_2_RFU1_SHIFT (7U) -/*! RFU1 - Reserved for Future Use */ -#define GDET_GDET_CONF_2_RFU1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_2_RFU1_SHIFT)) & GDET_GDET_CONF_2_RFU1_MASK) - -#define GDET_GDET_CONF_2_RFU1_MASK (0xFF80U) -#define GDET_GDET_CONF_2_RFU1_SHIFT (7U) -/*! rfu1 - Reserved for Future Use */ -#define GDET_GDET_CONF_2_RFU1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_2_RFU1_SHIFT)) & GDET_GDET_CONF_2_RFU1_MASK) - -#define GDET_GDET_CONF_2_FIELD_21_16_MASK (0x3F0000U) -#define GDET_GDET_CONF_2_FIELD_21_16_SHIFT (16U) -/*! FIELD_21_16 - GDET Configuration 2 Field 21_16 */ -#define GDET_GDET_CONF_2_FIELD_21_16(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_2_FIELD_21_16_SHIFT)) & GDET_GDET_CONF_2_FIELD_21_16_MASK) - -#define GDET_GDET_CONF_2_FIELD_21_16_MASK (0x3F0000U) -#define GDET_GDET_CONF_2_FIELD_21_16_SHIFT (16U) -/*! field_21_16 - GDET configuration 2 Field 21_16 */ -#define GDET_GDET_CONF_2_FIELD_21_16(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_2_FIELD_21_16_SHIFT)) & GDET_GDET_CONF_2_FIELD_21_16_MASK) - -#define GDET_GDET_CONF_2_RFU2_MASK (0xC00000U) -#define GDET_GDET_CONF_2_RFU2_SHIFT (22U) -/*! RFU2 - Reserved for Future Use */ -#define GDET_GDET_CONF_2_RFU2(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_2_RFU2_SHIFT)) & GDET_GDET_CONF_2_RFU2_MASK) - -#define GDET_GDET_CONF_2_RFU2_MASK (0xC00000U) -#define GDET_GDET_CONF_2_RFU2_SHIFT (22U) -/*! rfu2 - Reserved for Future Use */ -#define GDET_GDET_CONF_2_RFU2(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_2_RFU2_SHIFT)) & GDET_GDET_CONF_2_RFU2_MASK) - -#define GDET_GDET_CONF_2_FIELD_29_24_MASK (0x3F000000U) -#define GDET_GDET_CONF_2_FIELD_29_24_SHIFT (24U) -/*! FIELD_29_24 - GDET Configuration 2 Field 29_24 */ -#define GDET_GDET_CONF_2_FIELD_29_24(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_2_FIELD_29_24_SHIFT)) & GDET_GDET_CONF_2_FIELD_29_24_MASK) - -#define GDET_GDET_CONF_2_FIELD_29_24_MASK (0x3F000000U) -#define GDET_GDET_CONF_2_FIELD_29_24_SHIFT (24U) -/*! field_29_24 - GDET configuration 2 Field 29_24 */ -#define GDET_GDET_CONF_2_FIELD_29_24(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_2_FIELD_29_24_SHIFT)) & GDET_GDET_CONF_2_FIELD_29_24_MASK) - -#define GDET_GDET_CONF_2_RFU3_MASK (0xC0000000U) -#define GDET_GDET_CONF_2_RFU3_SHIFT (30U) -/*! RFU3 - Reserved for Future Use */ -#define GDET_GDET_CONF_2_RFU3(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_2_RFU3_SHIFT)) & GDET_GDET_CONF_2_RFU3_MASK) - -#define GDET_GDET_CONF_2_RFU3_MASK (0xC0000000U) -#define GDET_GDET_CONF_2_RFU3_SHIFT (30U) -/*! rfu3 - Reserved for Future Use */ -#define GDET_GDET_CONF_2_RFU3(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_2_RFU3_SHIFT)) & GDET_GDET_CONF_2_RFU3_MASK) -/*! @} */ - -/*! @name GDET_CONF_3 - GDET Configuration 3 Register */ -/*! @{ */ - -#define GDET_GDET_CONF_3_FIELD_6_0_MASK (0x7FU) -#define GDET_GDET_CONF_3_FIELD_6_0_SHIFT (0U) -/*! FIELD_6_0 - GDET Configuration 3 Field 6_0 */ -#define GDET_GDET_CONF_3_FIELD_6_0(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_3_FIELD_6_0_SHIFT)) & GDET_GDET_CONF_3_FIELD_6_0_MASK) - -#define GDET_GDET_CONF_3_FIELD_6_0_MASK (0x7FU) -#define GDET_GDET_CONF_3_FIELD_6_0_SHIFT (0U) -/*! field_6_0 - GDET configuration 3 Field 6_0 */ -#define GDET_GDET_CONF_3_FIELD_6_0(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_3_FIELD_6_0_SHIFT)) & GDET_GDET_CONF_3_FIELD_6_0_MASK) - -#define GDET_GDET_CONF_3_RFU1_MASK (0xFFFFFF80U) -#define GDET_GDET_CONF_3_RFU1_SHIFT (7U) -/*! RFU1 - Reserved for Future Use */ -#define GDET_GDET_CONF_3_RFU1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_3_RFU1_SHIFT)) & GDET_GDET_CONF_3_RFU1_MASK) - -#define GDET_GDET_CONF_3_RFU1_MASK (0xFFFFFF80U) -#define GDET_GDET_CONF_3_RFU1_SHIFT (7U) -/*! rfu1 - Reserved for Future Use */ -#define GDET_GDET_CONF_3_RFU1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_3_RFU1_SHIFT)) & GDET_GDET_CONF_3_RFU1_MASK) -/*! @} */ - -/*! @name GDET_CONF_4 - GDET Configuration 4 Register */ -/*! @{ */ - -#define GDET_GDET_CONF_4_FIELD_6_0_MASK (0x7FU) -#define GDET_GDET_CONF_4_FIELD_6_0_SHIFT (0U) -/*! FIELD_6_0 - GDET Configuration 4 Field 6_0 */ -#define GDET_GDET_CONF_4_FIELD_6_0(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_4_FIELD_6_0_SHIFT)) & GDET_GDET_CONF_4_FIELD_6_0_MASK) - -#define GDET_GDET_CONF_4_FIELD_6_0_MASK (0x7FU) -#define GDET_GDET_CONF_4_FIELD_6_0_SHIFT (0U) -/*! field_6_0 - GDET configuration 4 Field 6_0 */ -#define GDET_GDET_CONF_4_FIELD_6_0(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_4_FIELD_6_0_SHIFT)) & GDET_GDET_CONF_4_FIELD_6_0_MASK) - -#define GDET_GDET_CONF_4_RFU1_MASK (0xFFFFFF80U) -#define GDET_GDET_CONF_4_RFU1_SHIFT (7U) -/*! RFU1 - Reserved for Future Use */ -#define GDET_GDET_CONF_4_RFU1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_4_RFU1_SHIFT)) & GDET_GDET_CONF_4_RFU1_MASK) - -#define GDET_GDET_CONF_4_RFU1_MASK (0xFFFFFF80U) -#define GDET_GDET_CONF_4_RFU1_SHIFT (7U) -/*! rfu1 - Reserved for Future Use */ -#define GDET_GDET_CONF_4_RFU1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_4_RFU1_SHIFT)) & GDET_GDET_CONF_4_RFU1_MASK) -/*! @} */ - -/*! @name GDET_CONF_5 - GDET Configuration 5 Register */ -/*! @{ */ - -#define GDET_GDET_CONF_5_FIELD_5_0_MASK (0x3FU) -#define GDET_GDET_CONF_5_FIELD_5_0_SHIFT (0U) -/*! FIELD_5_0 - GDET Configuration 5 Field 5_0 */ -#define GDET_GDET_CONF_5_FIELD_5_0(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_5_FIELD_5_0_SHIFT)) & GDET_GDET_CONF_5_FIELD_5_0_MASK) - -#define GDET_GDET_CONF_5_FIELD_5_0_MASK (0x3FU) -#define GDET_GDET_CONF_5_FIELD_5_0_SHIFT (0U) -/*! field_5_0 - GDET configuration 5 Field 5_0 */ -#define GDET_GDET_CONF_5_FIELD_5_0(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_5_FIELD_5_0_SHIFT)) & GDET_GDET_CONF_5_FIELD_5_0_MASK) - -#define GDET_GDET_CONF_5_FIELD_11_6_MASK (0xFC0U) -#define GDET_GDET_CONF_5_FIELD_11_6_SHIFT (6U) -/*! FIELD_11_6 - GDET Configuration 5 Field 11_6 */ -#define GDET_GDET_CONF_5_FIELD_11_6(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_5_FIELD_11_6_SHIFT)) & GDET_GDET_CONF_5_FIELD_11_6_MASK) - -#define GDET_GDET_CONF_5_FIELD_11_6_MASK (0xFC0U) -#define GDET_GDET_CONF_5_FIELD_11_6_SHIFT (6U) -/*! field_11_6 - GDET configuration 5 Field 11_6 */ -#define GDET_GDET_CONF_5_FIELD_11_6(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_5_FIELD_11_6_SHIFT)) & GDET_GDET_CONF_5_FIELD_11_6_MASK) - -#define GDET_GDET_CONF_5_RFU1_MASK (0xFFFFF000U) -#define GDET_GDET_CONF_5_RFU1_SHIFT (12U) -/*! RFU1 - Reserved for Future Use */ -#define GDET_GDET_CONF_5_RFU1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_5_RFU1_SHIFT)) & GDET_GDET_CONF_5_RFU1_MASK) - -#define GDET_GDET_CONF_5_RFU1_MASK (0xFFFFF000U) -#define GDET_GDET_CONF_5_RFU1_SHIFT (12U) -/*! rfu1 - Reserved for Future Use */ -#define GDET_GDET_CONF_5_RFU1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_CONF_5_RFU1_SHIFT)) & GDET_GDET_CONF_5_RFU1_MASK) -/*! @} */ - -/*! @name GDET_RESET - GDET Reset Register */ -/*! @{ */ - -#define GDET_GDET_RESET_RFU1_MASK (0x7U) -#define GDET_GDET_RESET_RFU1_SHIFT (0U) -/*! RFU1 - Reserved for Future Use */ -#define GDET_GDET_RESET_RFU1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_RESET_RFU1_SHIFT)) & GDET_GDET_RESET_RFU1_MASK) - -#define GDET_GDET_RESET_RFU1_MASK (0x7U) -#define GDET_GDET_RESET_RFU1_SHIFT (0U) -/*! rfu1 - Reserved for Future Use */ -#define GDET_GDET_RESET_RFU1(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_RESET_RFU1_SHIFT)) & GDET_GDET_RESET_RFU1_MASK) - -#define GDET_GDET_RESET_SFT_RST_MASK (0x8U) -#define GDET_GDET_RESET_SFT_RST_SHIFT (3U) -/*! SFT_RST - Soft Reset for the Core Reset */ -#define GDET_GDET_RESET_SFT_RST(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_RESET_SFT_RST_SHIFT)) & GDET_GDET_RESET_SFT_RST_MASK) - -#define GDET_GDET_RESET_SFT_RST_MASK (0x8U) -#define GDET_GDET_RESET_SFT_RST_SHIFT (3U) -/*! sft_rst - Soft reset for the core reset (SFR configuration will be preseved).This register reads as 0 */ -#define GDET_GDET_RESET_SFT_RST(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_RESET_SFT_RST_SHIFT)) & GDET_GDET_RESET_SFT_RST_MASK) - -#define GDET_GDET_RESET_RFU2_MASK (0xFFFFFFF0U) -#define GDET_GDET_RESET_RFU2_SHIFT (4U) -/*! RFU2 - Reserved for Future Use */ -#define GDET_GDET_RESET_RFU2(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_RESET_RFU2_SHIFT)) & GDET_GDET_RESET_RFU2_MASK) - -#define GDET_GDET_RESET_RFU2_MASK (0xFFFFFFF0U) -#define GDET_GDET_RESET_RFU2_SHIFT (4U) -/*! rfu2 - Reserved for Future Use */ -#define GDET_GDET_RESET_RFU2(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_RESET_RFU2_SHIFT)) & GDET_GDET_RESET_RFU2_MASK) -/*! @} */ - -/*! @name GDET_TEST - GDET Test Register */ -/*! @{ */ - -#define GDET_GDET_TEST_SBZ_MASK (0x1U) -#define GDET_GDET_TEST_SBZ_SHIFT (0U) -/*! SBZ - Should Be Left to Zero */ -#define GDET_GDET_TEST_SBZ(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_TEST_SBZ_SHIFT)) & GDET_GDET_TEST_SBZ_MASK) - -#define GDET_GDET_TEST_SBZ_MASK (0x1U) -#define GDET_GDET_TEST_SBZ_SHIFT (0U) -/*! sbz - Should be left to zero */ -#define GDET_GDET_TEST_SBZ(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_TEST_SBZ_SHIFT)) & GDET_GDET_TEST_SBZ_MASK) - -#define GDET_GDET_TEST_RFU_MASK (0xFFFFFFFEU) -#define GDET_GDET_TEST_RFU_SHIFT (1U) -/*! RFU - Reserved for Future Use */ -#define GDET_GDET_TEST_RFU(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_TEST_RFU_SHIFT)) & GDET_GDET_TEST_RFU_MASK) - -#define GDET_GDET_TEST_RFU_MASK (0xFFFFFFFEU) -#define GDET_GDET_TEST_RFU_SHIFT (1U) -/*! rfu - Reserved for Future Use */ -#define GDET_GDET_TEST_RFU(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_TEST_RFU_SHIFT)) & GDET_GDET_TEST_RFU_MASK) -/*! @} */ - -/*! @name GDET_DLY_CTRL - GDET Delay Control Register */ -/*! @{ */ - -#define GDET_GDET_DLY_CTRL_VOL_SEL_MASK (0x3U) -#define GDET_GDET_DLY_CTRL_VOL_SEL_SHIFT (0U) -/*! VOL_SEL - GDET Delay Control of the Voltage Mode */ -#define GDET_GDET_DLY_CTRL_VOL_SEL(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_DLY_CTRL_VOL_SEL_SHIFT)) & GDET_GDET_DLY_CTRL_VOL_SEL_MASK) - -#define GDET_GDET_DLY_CTRL_VOL_SEL_MASK (0x3U) -#define GDET_GDET_DLY_CTRL_VOL_SEL_SHIFT (0U) -/*! vol_sel - GDET delay control of the voltage mode. Used to select the trim code appropiate to the voltage mode. */ -#define GDET_GDET_DLY_CTRL_VOL_SEL(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_DLY_CTRL_VOL_SEL_SHIFT)) & GDET_GDET_DLY_CTRL_VOL_SEL_MASK) - -#define GDET_GDET_DLY_CTRL_SW_VOL_CTRL_MASK (0x4U) -#define GDET_GDET_DLY_CTRL_SW_VOL_CTRL_SHIFT (2U) -/*! SW_VOL_CTRL - Select the Control of the Trim Code to the Delay Line */ -#define GDET_GDET_DLY_CTRL_SW_VOL_CTRL(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_DLY_CTRL_SW_VOL_CTRL_SHIFT)) & GDET_GDET_DLY_CTRL_SW_VOL_CTRL_MASK) - -#define GDET_GDET_DLY_CTRL_SW_VOL_CTRL_MASK (0x4U) -#define GDET_GDET_DLY_CTRL_SW_VOL_CTRL_SHIFT (2U) -/*! sw_vol_ctrl - Select the control of the trim code to the delay line via HW port (0) or SW SFR (1) */ -#define GDET_GDET_DLY_CTRL_SW_VOL_CTRL(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_DLY_CTRL_SW_VOL_CTRL_SHIFT)) & GDET_GDET_DLY_CTRL_SW_VOL_CTRL_MASK) - -#define GDET_GDET_DLY_CTRL_RFU_MASK (0xFFFFFFF8U) -#define GDET_GDET_DLY_CTRL_RFU_SHIFT (3U) -/*! RFU - Reserved for Future Use */ -#define GDET_GDET_DLY_CTRL_RFU(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_DLY_CTRL_RFU_SHIFT)) & GDET_GDET_DLY_CTRL_RFU_MASK) - -#define GDET_GDET_DLY_CTRL_RFU_MASK (0xFFFFFFF8U) -#define GDET_GDET_DLY_CTRL_RFU_SHIFT (3U) -/*! rfu - Reserved for Future Use */ -#define GDET_GDET_DLY_CTRL_RFU(x) (((uint32_t)(((uint32_t)(x)) << GDET_GDET_DLY_CTRL_RFU_SHIFT)) & GDET_GDET_DLY_CTRL_RFU_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group GDET_Register_Masks */ - - -/* GDET - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral GDET0 base address */ - #define GDET0_BASE (0x50024000u) - /** Peripheral GDET0 base address */ - #define GDET0_BASE_NS (0x40024000u) - /** Peripheral GDET0 base pointer */ - #define GDET0 ((GDET_Type *)GDET0_BASE) - /** Peripheral GDET0 base pointer */ - #define GDET0_NS ((GDET_Type *)GDET0_BASE_NS) - /** Peripheral GDET1 base address */ - #define GDET1_BASE (0x50025000u) - /** Peripheral GDET1 base address */ - #define GDET1_BASE_NS (0x40025000u) - /** Peripheral GDET1 base pointer */ - #define GDET1 ((GDET_Type *)GDET1_BASE) - /** Peripheral GDET1 base pointer */ - #define GDET1_NS ((GDET_Type *)GDET1_BASE_NS) - /** Array initializer of GDET peripheral base addresses */ - #define GDET_BASE_ADDRS { GDET0_BASE, GDET1_BASE } - /** Array initializer of GDET peripheral base pointers */ - #define GDET_BASE_PTRS { GDET0, GDET1 } - /** Array initializer of GDET peripheral base addresses */ - #define GDET_BASE_ADDRS_NS { GDET0_BASE_NS, GDET1_BASE_NS } - /** Array initializer of GDET peripheral base pointers */ - #define GDET_BASE_PTRS_NS { GDET0_NS, GDET1_NS } -#else - /** Peripheral GDET0 base address */ - #define GDET0_BASE (0x40024000u) - /** Peripheral GDET0 base pointer */ - #define GDET0 ((GDET_Type *)GDET0_BASE) - /** Peripheral GDET1 base address */ - #define GDET1_BASE (0x40025000u) - /** Peripheral GDET1 base pointer */ - #define GDET1 ((GDET_Type *)GDET1_BASE) - /** Array initializer of GDET peripheral base addresses */ - #define GDET_BASE_ADDRS { GDET0_BASE, GDET1_BASE } - /** Array initializer of GDET peripheral base pointers */ - #define GDET_BASE_PTRS { GDET0, GDET1 } -#endif - -/*! - * @} - */ /* end of group GDET_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- GPIO Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup GPIO_Peripheral_Access_Layer GPIO Peripheral Access Layer - * @{ - */ - -/** GPIO - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - uint8_t RESERVED_0[4]; - __IO uint32_t LOCK; /**< Lock, offset: 0xC */ - __IO uint32_t PCNS; /**< Pin Control Nonsecure, offset: 0x10 */ - __IO uint32_t ICNS; /**< Interrupt Control Nonsecure, offset: 0x14 */ - __IO uint32_t PCNP; /**< Pin Control Nonprivilege, offset: 0x18 */ - __IO uint32_t ICNP; /**< Interrupt Control Nonprivilege, offset: 0x1C */ - uint8_t RESERVED_1[32]; - __IO uint32_t PDOR; /**< Port Data Output, offset: 0x40 */ - __O uint32_t PSOR; /**< Port Set Output, offset: 0x44 */ - __O uint32_t PCOR; /**< Port Clear Output, offset: 0x48 */ - __O uint32_t PTOR; /**< Port Toggle Output, offset: 0x4C */ - __I uint32_t PDIR; /**< Port Data Input, offset: 0x50 */ - __IO uint32_t PDDR; /**< Port Data Direction, offset: 0x54 */ - __IO uint32_t PIDR; /**< Port Input Disable, offset: 0x58 */ - uint8_t RESERVED_2[4]; - __IO uint8_t PDR[32]; /**< Pin Data, array offset: 0x60, array step: 0x1 */ - __IO uint32_t ICR[32]; /**< Interrupt Control 0..Interrupt Control 31, array offset: 0x80, array step: 0x4 */ - __O uint32_t GICLR; /**< Global Interrupt Control Low, offset: 0x100 */ - __O uint32_t GICHR; /**< Global Interrupt Control High, offset: 0x104 */ - uint8_t RESERVED_3[24]; - __IO uint32_t ISFR[2]; /**< Interrupt Status Flag, array offset: 0x120, array step: 0x4 */ -} GPIO_Type; - -/* ---------------------------------------------------------------------------- - -- GPIO Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup GPIO_Register_Masks GPIO Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define GPIO_VERID_FEATURE_MASK (0xFFFFU) -#define GPIO_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Basic implementation - * 0b0000000000000001..Protection registers implemented - */ -#define GPIO_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << GPIO_VERID_FEATURE_SHIFT)) & GPIO_VERID_FEATURE_MASK) - -#define GPIO_VERID_MINOR_MASK (0xFF0000U) -#define GPIO_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define GPIO_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << GPIO_VERID_MINOR_SHIFT)) & GPIO_VERID_MINOR_MASK) - -#define GPIO_VERID_MAJOR_MASK (0xFF000000U) -#define GPIO_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define GPIO_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << GPIO_VERID_MAJOR_SHIFT)) & GPIO_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define GPIO_PARAM_IRQNUM_MASK (0xFU) -#define GPIO_PARAM_IRQNUM_SHIFT (0U) -/*! IRQNUM - Interrupt Number */ -#define GPIO_PARAM_IRQNUM(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PARAM_IRQNUM_SHIFT)) & GPIO_PARAM_IRQNUM_MASK) -/*! @} */ - -/*! @name LOCK - Lock */ -/*! @{ */ - -#define GPIO_LOCK_PCNS_MASK (0x1U) -#define GPIO_LOCK_PCNS_SHIFT (0U) -/*! PCNS - Lock PCNS - * 0b0..Writable in Secure-Privilege state - * 0b1..Not writable until the next reset - */ -#define GPIO_LOCK_PCNS(x) (((uint32_t)(((uint32_t)(x)) << GPIO_LOCK_PCNS_SHIFT)) & GPIO_LOCK_PCNS_MASK) - -#define GPIO_LOCK_ICNS_MASK (0x2U) -#define GPIO_LOCK_ICNS_SHIFT (1U) -/*! ICNS - Lock ICNS - * 0b0..Writable in Secure-Privilege state - * 0b1..Not writable until the next reset - */ -#define GPIO_LOCK_ICNS(x) (((uint32_t)(((uint32_t)(x)) << GPIO_LOCK_ICNS_SHIFT)) & GPIO_LOCK_ICNS_MASK) - -#define GPIO_LOCK_PCNP_MASK (0x4U) -#define GPIO_LOCK_PCNP_SHIFT (2U) -/*! PCNP - Lock PCNP - * 0b0..Writable in Secure-Privilege state - * 0b1..Not writable until the next reset - */ -#define GPIO_LOCK_PCNP(x) (((uint32_t)(((uint32_t)(x)) << GPIO_LOCK_PCNP_SHIFT)) & GPIO_LOCK_PCNP_MASK) - -#define GPIO_LOCK_ICNP_MASK (0x8U) -#define GPIO_LOCK_ICNP_SHIFT (3U) -/*! ICNP - Lock ICNP - * 0b0..Writable in Secure-Privilege state - * 0b1..Not writable until the next reset - */ -#define GPIO_LOCK_ICNP(x) (((uint32_t)(((uint32_t)(x)) << GPIO_LOCK_ICNP_SHIFT)) & GPIO_LOCK_ICNP_MASK) -/*! @} */ - -/*! @name PCNS - Pin Control Nonsecure */ -/*! @{ */ - -#define GPIO_PCNS_NSE0_MASK (0x1U) -#define GPIO_PCNS_NSE0_SHIFT (0U) -/*! NSE0 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE0_SHIFT)) & GPIO_PCNS_NSE0_MASK) - -#define GPIO_PCNS_NSE1_MASK (0x2U) -#define GPIO_PCNS_NSE1_SHIFT (1U) -/*! NSE1 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE1_SHIFT)) & GPIO_PCNS_NSE1_MASK) - -#define GPIO_PCNS_NSE2_MASK (0x4U) -#define GPIO_PCNS_NSE2_SHIFT (2U) -/*! NSE2 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE2_SHIFT)) & GPIO_PCNS_NSE2_MASK) - -#define GPIO_PCNS_NSE3_MASK (0x8U) -#define GPIO_PCNS_NSE3_SHIFT (3U) -/*! NSE3 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE3_SHIFT)) & GPIO_PCNS_NSE3_MASK) - -#define GPIO_PCNS_NSE4_MASK (0x10U) -#define GPIO_PCNS_NSE4_SHIFT (4U) -/*! NSE4 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE4_SHIFT)) & GPIO_PCNS_NSE4_MASK) - -#define GPIO_PCNS_NSE5_MASK (0x20U) -#define GPIO_PCNS_NSE5_SHIFT (5U) -/*! NSE5 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE5_SHIFT)) & GPIO_PCNS_NSE5_MASK) - -#define GPIO_PCNS_NSE6_MASK (0x40U) -#define GPIO_PCNS_NSE6_SHIFT (6U) -/*! NSE6 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE6_SHIFT)) & GPIO_PCNS_NSE6_MASK) - -#define GPIO_PCNS_NSE7_MASK (0x80U) -#define GPIO_PCNS_NSE7_SHIFT (7U) -/*! NSE7 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE7_SHIFT)) & GPIO_PCNS_NSE7_MASK) - -#define GPIO_PCNS_NSE8_MASK (0x100U) -#define GPIO_PCNS_NSE8_SHIFT (8U) -/*! NSE8 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE8_SHIFT)) & GPIO_PCNS_NSE8_MASK) - -#define GPIO_PCNS_NSE9_MASK (0x200U) -#define GPIO_PCNS_NSE9_SHIFT (9U) -/*! NSE9 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE9_SHIFT)) & GPIO_PCNS_NSE9_MASK) - -#define GPIO_PCNS_NSE10_MASK (0x400U) -#define GPIO_PCNS_NSE10_SHIFT (10U) -/*! NSE10 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE10_SHIFT)) & GPIO_PCNS_NSE10_MASK) - -#define GPIO_PCNS_NSE11_MASK (0x800U) -#define GPIO_PCNS_NSE11_SHIFT (11U) -/*! NSE11 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE11_SHIFT)) & GPIO_PCNS_NSE11_MASK) - -#define GPIO_PCNS_NSE12_MASK (0x1000U) -#define GPIO_PCNS_NSE12_SHIFT (12U) -/*! NSE12 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE12_SHIFT)) & GPIO_PCNS_NSE12_MASK) - -#define GPIO_PCNS_NSE13_MASK (0x2000U) -#define GPIO_PCNS_NSE13_SHIFT (13U) -/*! NSE13 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE13_SHIFT)) & GPIO_PCNS_NSE13_MASK) - -#define GPIO_PCNS_NSE14_MASK (0x4000U) -#define GPIO_PCNS_NSE14_SHIFT (14U) -/*! NSE14 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE14_SHIFT)) & GPIO_PCNS_NSE14_MASK) - -#define GPIO_PCNS_NSE15_MASK (0x8000U) -#define GPIO_PCNS_NSE15_SHIFT (15U) -/*! NSE15 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE15_SHIFT)) & GPIO_PCNS_NSE15_MASK) - -#define GPIO_PCNS_NSE16_MASK (0x10000U) -#define GPIO_PCNS_NSE16_SHIFT (16U) -/*! NSE16 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE16_SHIFT)) & GPIO_PCNS_NSE16_MASK) - -#define GPIO_PCNS_NSE17_MASK (0x20000U) -#define GPIO_PCNS_NSE17_SHIFT (17U) -/*! NSE17 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE17_SHIFT)) & GPIO_PCNS_NSE17_MASK) - -#define GPIO_PCNS_NSE18_MASK (0x40000U) -#define GPIO_PCNS_NSE18_SHIFT (18U) -/*! NSE18 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE18_SHIFT)) & GPIO_PCNS_NSE18_MASK) - -#define GPIO_PCNS_NSE19_MASK (0x80000U) -#define GPIO_PCNS_NSE19_SHIFT (19U) -/*! NSE19 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE19_SHIFT)) & GPIO_PCNS_NSE19_MASK) - -#define GPIO_PCNS_NSE20_MASK (0x100000U) -#define GPIO_PCNS_NSE20_SHIFT (20U) -/*! NSE20 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE20_SHIFT)) & GPIO_PCNS_NSE20_MASK) - -#define GPIO_PCNS_NSE21_MASK (0x200000U) -#define GPIO_PCNS_NSE21_SHIFT (21U) -/*! NSE21 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE21_SHIFT)) & GPIO_PCNS_NSE21_MASK) - -#define GPIO_PCNS_NSE22_MASK (0x400000U) -#define GPIO_PCNS_NSE22_SHIFT (22U) -/*! NSE22 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE22_SHIFT)) & GPIO_PCNS_NSE22_MASK) - -#define GPIO_PCNS_NSE23_MASK (0x800000U) -#define GPIO_PCNS_NSE23_SHIFT (23U) -/*! NSE23 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE23_SHIFT)) & GPIO_PCNS_NSE23_MASK) - -#define GPIO_PCNS_NSE24_MASK (0x1000000U) -#define GPIO_PCNS_NSE24_SHIFT (24U) -/*! NSE24 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE24_SHIFT)) & GPIO_PCNS_NSE24_MASK) - -#define GPIO_PCNS_NSE25_MASK (0x2000000U) -#define GPIO_PCNS_NSE25_SHIFT (25U) -/*! NSE25 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE25_SHIFT)) & GPIO_PCNS_NSE25_MASK) - -#define GPIO_PCNS_NSE26_MASK (0x4000000U) -#define GPIO_PCNS_NSE26_SHIFT (26U) -/*! NSE26 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE26_SHIFT)) & GPIO_PCNS_NSE26_MASK) - -#define GPIO_PCNS_NSE27_MASK (0x8000000U) -#define GPIO_PCNS_NSE27_SHIFT (27U) -/*! NSE27 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE27_SHIFT)) & GPIO_PCNS_NSE27_MASK) - -#define GPIO_PCNS_NSE28_MASK (0x10000000U) -#define GPIO_PCNS_NSE28_SHIFT (28U) -/*! NSE28 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE28_SHIFT)) & GPIO_PCNS_NSE28_MASK) - -#define GPIO_PCNS_NSE29_MASK (0x20000000U) -#define GPIO_PCNS_NSE29_SHIFT (29U) -/*! NSE29 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE29_SHIFT)) & GPIO_PCNS_NSE29_MASK) - -#define GPIO_PCNS_NSE30_MASK (0x40000000U) -#define GPIO_PCNS_NSE30_SHIFT (30U) -/*! NSE30 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE30_SHIFT)) & GPIO_PCNS_NSE30_MASK) - -#define GPIO_PCNS_NSE31_MASK (0x80000000U) -#define GPIO_PCNS_NSE31_SHIFT (31U) -/*! NSE31 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_PCNS_NSE31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNS_NSE31_SHIFT)) & GPIO_PCNS_NSE31_MASK) -/*! @} */ - -/*! @name ICNS - Interrupt Control Nonsecure */ -/*! @{ */ - -#define GPIO_ICNS_NSE0_MASK (0x1U) -#define GPIO_ICNS_NSE0_SHIFT (0U) -/*! NSE0 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_ICNS_NSE0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ICNS_NSE0_SHIFT)) & GPIO_ICNS_NSE0_MASK) - -#define GPIO_ICNS_NSE1_MASK (0x2U) -#define GPIO_ICNS_NSE1_SHIFT (1U) -/*! NSE1 - Nonsecure Enable - * 0b0..Secure access - * 0b1..Nonsecure access - */ -#define GPIO_ICNS_NSE1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ICNS_NSE1_SHIFT)) & GPIO_ICNS_NSE1_MASK) -/*! @} */ - -/*! @name PCNP - Pin Control Nonprivilege */ -/*! @{ */ - -#define GPIO_PCNP_NPE0_MASK (0x1U) -#define GPIO_PCNP_NPE0_SHIFT (0U) -/*! NPE0 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE0_SHIFT)) & GPIO_PCNP_NPE0_MASK) - -#define GPIO_PCNP_NPE1_MASK (0x2U) -#define GPIO_PCNP_NPE1_SHIFT (1U) -/*! NPE1 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE1_SHIFT)) & GPIO_PCNP_NPE1_MASK) - -#define GPIO_PCNP_NPE2_MASK (0x4U) -#define GPIO_PCNP_NPE2_SHIFT (2U) -/*! NPE2 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE2_SHIFT)) & GPIO_PCNP_NPE2_MASK) - -#define GPIO_PCNP_NPE3_MASK (0x8U) -#define GPIO_PCNP_NPE3_SHIFT (3U) -/*! NPE3 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE3_SHIFT)) & GPIO_PCNP_NPE3_MASK) - -#define GPIO_PCNP_NPE4_MASK (0x10U) -#define GPIO_PCNP_NPE4_SHIFT (4U) -/*! NPE4 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE4_SHIFT)) & GPIO_PCNP_NPE4_MASK) - -#define GPIO_PCNP_NPE5_MASK (0x20U) -#define GPIO_PCNP_NPE5_SHIFT (5U) -/*! NPE5 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE5_SHIFT)) & GPIO_PCNP_NPE5_MASK) - -#define GPIO_PCNP_NPE6_MASK (0x40U) -#define GPIO_PCNP_NPE6_SHIFT (6U) -/*! NPE6 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE6_SHIFT)) & GPIO_PCNP_NPE6_MASK) - -#define GPIO_PCNP_NPE7_MASK (0x80U) -#define GPIO_PCNP_NPE7_SHIFT (7U) -/*! NPE7 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE7_SHIFT)) & GPIO_PCNP_NPE7_MASK) - -#define GPIO_PCNP_NPE8_MASK (0x100U) -#define GPIO_PCNP_NPE8_SHIFT (8U) -/*! NPE8 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE8_SHIFT)) & GPIO_PCNP_NPE8_MASK) - -#define GPIO_PCNP_NPE9_MASK (0x200U) -#define GPIO_PCNP_NPE9_SHIFT (9U) -/*! NPE9 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE9_SHIFT)) & GPIO_PCNP_NPE9_MASK) - -#define GPIO_PCNP_NPE10_MASK (0x400U) -#define GPIO_PCNP_NPE10_SHIFT (10U) -/*! NPE10 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE10_SHIFT)) & GPIO_PCNP_NPE10_MASK) - -#define GPIO_PCNP_NPE11_MASK (0x800U) -#define GPIO_PCNP_NPE11_SHIFT (11U) -/*! NPE11 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE11_SHIFT)) & GPIO_PCNP_NPE11_MASK) - -#define GPIO_PCNP_NPE12_MASK (0x1000U) -#define GPIO_PCNP_NPE12_SHIFT (12U) -/*! NPE12 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE12_SHIFT)) & GPIO_PCNP_NPE12_MASK) - -#define GPIO_PCNP_NPE13_MASK (0x2000U) -#define GPIO_PCNP_NPE13_SHIFT (13U) -/*! NPE13 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE13_SHIFT)) & GPIO_PCNP_NPE13_MASK) - -#define GPIO_PCNP_NPE14_MASK (0x4000U) -#define GPIO_PCNP_NPE14_SHIFT (14U) -/*! NPE14 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE14_SHIFT)) & GPIO_PCNP_NPE14_MASK) - -#define GPIO_PCNP_NPE15_MASK (0x8000U) -#define GPIO_PCNP_NPE15_SHIFT (15U) -/*! NPE15 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE15_SHIFT)) & GPIO_PCNP_NPE15_MASK) - -#define GPIO_PCNP_NPE16_MASK (0x10000U) -#define GPIO_PCNP_NPE16_SHIFT (16U) -/*! NPE16 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE16_SHIFT)) & GPIO_PCNP_NPE16_MASK) - -#define GPIO_PCNP_NPE17_MASK (0x20000U) -#define GPIO_PCNP_NPE17_SHIFT (17U) -/*! NPE17 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE17_SHIFT)) & GPIO_PCNP_NPE17_MASK) - -#define GPIO_PCNP_NPE18_MASK (0x40000U) -#define GPIO_PCNP_NPE18_SHIFT (18U) -/*! NPE18 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE18_SHIFT)) & GPIO_PCNP_NPE18_MASK) - -#define GPIO_PCNP_NPE19_MASK (0x80000U) -#define GPIO_PCNP_NPE19_SHIFT (19U) -/*! NPE19 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE19_SHIFT)) & GPIO_PCNP_NPE19_MASK) - -#define GPIO_PCNP_NPE20_MASK (0x100000U) -#define GPIO_PCNP_NPE20_SHIFT (20U) -/*! NPE20 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE20_SHIFT)) & GPIO_PCNP_NPE20_MASK) - -#define GPIO_PCNP_NPE21_MASK (0x200000U) -#define GPIO_PCNP_NPE21_SHIFT (21U) -/*! NPE21 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE21_SHIFT)) & GPIO_PCNP_NPE21_MASK) - -#define GPIO_PCNP_NPE22_MASK (0x400000U) -#define GPIO_PCNP_NPE22_SHIFT (22U) -/*! NPE22 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE22_SHIFT)) & GPIO_PCNP_NPE22_MASK) - -#define GPIO_PCNP_NPE23_MASK (0x800000U) -#define GPIO_PCNP_NPE23_SHIFT (23U) -/*! NPE23 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE23_SHIFT)) & GPIO_PCNP_NPE23_MASK) - -#define GPIO_PCNP_NPE24_MASK (0x1000000U) -#define GPIO_PCNP_NPE24_SHIFT (24U) -/*! NPE24 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE24_SHIFT)) & GPIO_PCNP_NPE24_MASK) - -#define GPIO_PCNP_NPE25_MASK (0x2000000U) -#define GPIO_PCNP_NPE25_SHIFT (25U) -/*! NPE25 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE25_SHIFT)) & GPIO_PCNP_NPE25_MASK) - -#define GPIO_PCNP_NPE26_MASK (0x4000000U) -#define GPIO_PCNP_NPE26_SHIFT (26U) -/*! NPE26 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE26_SHIFT)) & GPIO_PCNP_NPE26_MASK) - -#define GPIO_PCNP_NPE27_MASK (0x8000000U) -#define GPIO_PCNP_NPE27_SHIFT (27U) -/*! NPE27 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE27_SHIFT)) & GPIO_PCNP_NPE27_MASK) - -#define GPIO_PCNP_NPE28_MASK (0x10000000U) -#define GPIO_PCNP_NPE28_SHIFT (28U) -/*! NPE28 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE28_SHIFT)) & GPIO_PCNP_NPE28_MASK) - -#define GPIO_PCNP_NPE29_MASK (0x20000000U) -#define GPIO_PCNP_NPE29_SHIFT (29U) -/*! NPE29 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE29_SHIFT)) & GPIO_PCNP_NPE29_MASK) - -#define GPIO_PCNP_NPE30_MASK (0x40000000U) -#define GPIO_PCNP_NPE30_SHIFT (30U) -/*! NPE30 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE30_SHIFT)) & GPIO_PCNP_NPE30_MASK) - -#define GPIO_PCNP_NPE31_MASK (0x80000000U) -#define GPIO_PCNP_NPE31_SHIFT (31U) -/*! NPE31 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_PCNP_NPE31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCNP_NPE31_SHIFT)) & GPIO_PCNP_NPE31_MASK) -/*! @} */ - -/*! @name ICNP - Interrupt Control Nonprivilege */ -/*! @{ */ - -#define GPIO_ICNP_NPE0_MASK (0x1U) -#define GPIO_ICNP_NPE0_SHIFT (0U) -/*! NPE0 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_ICNP_NPE0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ICNP_NPE0_SHIFT)) & GPIO_ICNP_NPE0_MASK) - -#define GPIO_ICNP_NPE1_MASK (0x2U) -#define GPIO_ICNP_NPE1_SHIFT (1U) -/*! NPE1 - Nonprivilege Enable - * 0b0..Privilege access - * 0b1..Nonprivilege access - */ -#define GPIO_ICNP_NPE1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ICNP_NPE1_SHIFT)) & GPIO_ICNP_NPE1_MASK) -/*! @} */ - -/*! @name PDOR - Port Data Output */ -/*! @{ */ - -#define GPIO_PDOR_PDO0_MASK (0x1U) -#define GPIO_PDOR_PDO0_SHIFT (0U) -/*! PDO0 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO0_SHIFT)) & GPIO_PDOR_PDO0_MASK) - -#define GPIO_PDOR_PDO1_MASK (0x2U) -#define GPIO_PDOR_PDO1_SHIFT (1U) -/*! PDO1 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO1_SHIFT)) & GPIO_PDOR_PDO1_MASK) - -#define GPIO_PDOR_PDO2_MASK (0x4U) -#define GPIO_PDOR_PDO2_SHIFT (2U) -/*! PDO2 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO2_SHIFT)) & GPIO_PDOR_PDO2_MASK) - -#define GPIO_PDOR_PDO3_MASK (0x8U) -#define GPIO_PDOR_PDO3_SHIFT (3U) -/*! PDO3 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO3_SHIFT)) & GPIO_PDOR_PDO3_MASK) - -#define GPIO_PDOR_PDO4_MASK (0x10U) -#define GPIO_PDOR_PDO4_SHIFT (4U) -/*! PDO4 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO4_SHIFT)) & GPIO_PDOR_PDO4_MASK) - -#define GPIO_PDOR_PDO5_MASK (0x20U) -#define GPIO_PDOR_PDO5_SHIFT (5U) -/*! PDO5 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO5_SHIFT)) & GPIO_PDOR_PDO5_MASK) - -#define GPIO_PDOR_PDO6_MASK (0x40U) -#define GPIO_PDOR_PDO6_SHIFT (6U) -/*! PDO6 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO6_SHIFT)) & GPIO_PDOR_PDO6_MASK) - -#define GPIO_PDOR_PDO7_MASK (0x80U) -#define GPIO_PDOR_PDO7_SHIFT (7U) -/*! PDO7 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO7_SHIFT)) & GPIO_PDOR_PDO7_MASK) - -#define GPIO_PDOR_PDO8_MASK (0x100U) -#define GPIO_PDOR_PDO8_SHIFT (8U) -/*! PDO8 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO8_SHIFT)) & GPIO_PDOR_PDO8_MASK) - -#define GPIO_PDOR_PDO9_MASK (0x200U) -#define GPIO_PDOR_PDO9_SHIFT (9U) -/*! PDO9 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO9_SHIFT)) & GPIO_PDOR_PDO9_MASK) - -#define GPIO_PDOR_PDO10_MASK (0x400U) -#define GPIO_PDOR_PDO10_SHIFT (10U) -/*! PDO10 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO10_SHIFT)) & GPIO_PDOR_PDO10_MASK) - -#define GPIO_PDOR_PDO11_MASK (0x800U) -#define GPIO_PDOR_PDO11_SHIFT (11U) -/*! PDO11 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO11_SHIFT)) & GPIO_PDOR_PDO11_MASK) - -#define GPIO_PDOR_PDO12_MASK (0x1000U) -#define GPIO_PDOR_PDO12_SHIFT (12U) -/*! PDO12 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO12_SHIFT)) & GPIO_PDOR_PDO12_MASK) - -#define GPIO_PDOR_PDO13_MASK (0x2000U) -#define GPIO_PDOR_PDO13_SHIFT (13U) -/*! PDO13 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO13_SHIFT)) & GPIO_PDOR_PDO13_MASK) - -#define GPIO_PDOR_PDO14_MASK (0x4000U) -#define GPIO_PDOR_PDO14_SHIFT (14U) -/*! PDO14 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO14_SHIFT)) & GPIO_PDOR_PDO14_MASK) - -#define GPIO_PDOR_PDO15_MASK (0x8000U) -#define GPIO_PDOR_PDO15_SHIFT (15U) -/*! PDO15 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO15_SHIFT)) & GPIO_PDOR_PDO15_MASK) - -#define GPIO_PDOR_PDO16_MASK (0x10000U) -#define GPIO_PDOR_PDO16_SHIFT (16U) -/*! PDO16 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO16_SHIFT)) & GPIO_PDOR_PDO16_MASK) - -#define GPIO_PDOR_PDO17_MASK (0x20000U) -#define GPIO_PDOR_PDO17_SHIFT (17U) -/*! PDO17 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO17_SHIFT)) & GPIO_PDOR_PDO17_MASK) - -#define GPIO_PDOR_PDO18_MASK (0x40000U) -#define GPIO_PDOR_PDO18_SHIFT (18U) -/*! PDO18 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO18_SHIFT)) & GPIO_PDOR_PDO18_MASK) - -#define GPIO_PDOR_PDO19_MASK (0x80000U) -#define GPIO_PDOR_PDO19_SHIFT (19U) -/*! PDO19 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO19_SHIFT)) & GPIO_PDOR_PDO19_MASK) - -#define GPIO_PDOR_PDO20_MASK (0x100000U) -#define GPIO_PDOR_PDO20_SHIFT (20U) -/*! PDO20 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO20_SHIFT)) & GPIO_PDOR_PDO20_MASK) - -#define GPIO_PDOR_PDO21_MASK (0x200000U) -#define GPIO_PDOR_PDO21_SHIFT (21U) -/*! PDO21 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO21_SHIFT)) & GPIO_PDOR_PDO21_MASK) - -#define GPIO_PDOR_PDO22_MASK (0x400000U) -#define GPIO_PDOR_PDO22_SHIFT (22U) -/*! PDO22 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO22_SHIFT)) & GPIO_PDOR_PDO22_MASK) - -#define GPIO_PDOR_PDO23_MASK (0x800000U) -#define GPIO_PDOR_PDO23_SHIFT (23U) -/*! PDO23 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO23_SHIFT)) & GPIO_PDOR_PDO23_MASK) - -#define GPIO_PDOR_PDO24_MASK (0x1000000U) -#define GPIO_PDOR_PDO24_SHIFT (24U) -/*! PDO24 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO24_SHIFT)) & GPIO_PDOR_PDO24_MASK) - -#define GPIO_PDOR_PDO25_MASK (0x2000000U) -#define GPIO_PDOR_PDO25_SHIFT (25U) -/*! PDO25 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO25_SHIFT)) & GPIO_PDOR_PDO25_MASK) - -#define GPIO_PDOR_PDO26_MASK (0x4000000U) -#define GPIO_PDOR_PDO26_SHIFT (26U) -/*! PDO26 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO26_SHIFT)) & GPIO_PDOR_PDO26_MASK) - -#define GPIO_PDOR_PDO27_MASK (0x8000000U) -#define GPIO_PDOR_PDO27_SHIFT (27U) -/*! PDO27 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO27_SHIFT)) & GPIO_PDOR_PDO27_MASK) - -#define GPIO_PDOR_PDO28_MASK (0x10000000U) -#define GPIO_PDOR_PDO28_SHIFT (28U) -/*! PDO28 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO28_SHIFT)) & GPIO_PDOR_PDO28_MASK) - -#define GPIO_PDOR_PDO29_MASK (0x20000000U) -#define GPIO_PDOR_PDO29_SHIFT (29U) -/*! PDO29 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO29_SHIFT)) & GPIO_PDOR_PDO29_MASK) - -#define GPIO_PDOR_PDO30_MASK (0x40000000U) -#define GPIO_PDOR_PDO30_SHIFT (30U) -/*! PDO30 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO30_SHIFT)) & GPIO_PDOR_PDO30_MASK) - -#define GPIO_PDOR_PDO31_MASK (0x80000000U) -#define GPIO_PDOR_PDO31_SHIFT (31U) -/*! PDO31 - Port Data Output - * 0b0..Logic level 0 - * 0b1..Logic level 1 - */ -#define GPIO_PDOR_PDO31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDOR_PDO31_SHIFT)) & GPIO_PDOR_PDO31_MASK) -/*! @} */ - -/*! @name PSOR - Port Set Output */ -/*! @{ */ - -#define GPIO_PSOR_PTSO0_MASK (0x1U) -#define GPIO_PSOR_PTSO0_SHIFT (0U) -/*! PTSO0 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO0_SHIFT)) & GPIO_PSOR_PTSO0_MASK) - -#define GPIO_PSOR_PTSO1_MASK (0x2U) -#define GPIO_PSOR_PTSO1_SHIFT (1U) -/*! PTSO1 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO1_SHIFT)) & GPIO_PSOR_PTSO1_MASK) - -#define GPIO_PSOR_PTSO2_MASK (0x4U) -#define GPIO_PSOR_PTSO2_SHIFT (2U) -/*! PTSO2 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO2_SHIFT)) & GPIO_PSOR_PTSO2_MASK) - -#define GPIO_PSOR_PTSO3_MASK (0x8U) -#define GPIO_PSOR_PTSO3_SHIFT (3U) -/*! PTSO3 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO3_SHIFT)) & GPIO_PSOR_PTSO3_MASK) - -#define GPIO_PSOR_PTSO4_MASK (0x10U) -#define GPIO_PSOR_PTSO4_SHIFT (4U) -/*! PTSO4 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO4_SHIFT)) & GPIO_PSOR_PTSO4_MASK) - -#define GPIO_PSOR_PTSO5_MASK (0x20U) -#define GPIO_PSOR_PTSO5_SHIFT (5U) -/*! PTSO5 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO5_SHIFT)) & GPIO_PSOR_PTSO5_MASK) - -#define GPIO_PSOR_PTSO6_MASK (0x40U) -#define GPIO_PSOR_PTSO6_SHIFT (6U) -/*! PTSO6 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO6_SHIFT)) & GPIO_PSOR_PTSO6_MASK) - -#define GPIO_PSOR_PTSO7_MASK (0x80U) -#define GPIO_PSOR_PTSO7_SHIFT (7U) -/*! PTSO7 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO7_SHIFT)) & GPIO_PSOR_PTSO7_MASK) - -#define GPIO_PSOR_PTSO8_MASK (0x100U) -#define GPIO_PSOR_PTSO8_SHIFT (8U) -/*! PTSO8 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO8_SHIFT)) & GPIO_PSOR_PTSO8_MASK) - -#define GPIO_PSOR_PTSO9_MASK (0x200U) -#define GPIO_PSOR_PTSO9_SHIFT (9U) -/*! PTSO9 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO9_SHIFT)) & GPIO_PSOR_PTSO9_MASK) - -#define GPIO_PSOR_PTSO10_MASK (0x400U) -#define GPIO_PSOR_PTSO10_SHIFT (10U) -/*! PTSO10 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO10_SHIFT)) & GPIO_PSOR_PTSO10_MASK) - -#define GPIO_PSOR_PTSO11_MASK (0x800U) -#define GPIO_PSOR_PTSO11_SHIFT (11U) -/*! PTSO11 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO11_SHIFT)) & GPIO_PSOR_PTSO11_MASK) - -#define GPIO_PSOR_PTSO12_MASK (0x1000U) -#define GPIO_PSOR_PTSO12_SHIFT (12U) -/*! PTSO12 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO12_SHIFT)) & GPIO_PSOR_PTSO12_MASK) - -#define GPIO_PSOR_PTSO13_MASK (0x2000U) -#define GPIO_PSOR_PTSO13_SHIFT (13U) -/*! PTSO13 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO13_SHIFT)) & GPIO_PSOR_PTSO13_MASK) - -#define GPIO_PSOR_PTSO14_MASK (0x4000U) -#define GPIO_PSOR_PTSO14_SHIFT (14U) -/*! PTSO14 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO14_SHIFT)) & GPIO_PSOR_PTSO14_MASK) - -#define GPIO_PSOR_PTSO15_MASK (0x8000U) -#define GPIO_PSOR_PTSO15_SHIFT (15U) -/*! PTSO15 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO15_SHIFT)) & GPIO_PSOR_PTSO15_MASK) - -#define GPIO_PSOR_PTSO16_MASK (0x10000U) -#define GPIO_PSOR_PTSO16_SHIFT (16U) -/*! PTSO16 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO16_SHIFT)) & GPIO_PSOR_PTSO16_MASK) - -#define GPIO_PSOR_PTSO17_MASK (0x20000U) -#define GPIO_PSOR_PTSO17_SHIFT (17U) -/*! PTSO17 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO17_SHIFT)) & GPIO_PSOR_PTSO17_MASK) - -#define GPIO_PSOR_PTSO18_MASK (0x40000U) -#define GPIO_PSOR_PTSO18_SHIFT (18U) -/*! PTSO18 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO18_SHIFT)) & GPIO_PSOR_PTSO18_MASK) - -#define GPIO_PSOR_PTSO19_MASK (0x80000U) -#define GPIO_PSOR_PTSO19_SHIFT (19U) -/*! PTSO19 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO19_SHIFT)) & GPIO_PSOR_PTSO19_MASK) - -#define GPIO_PSOR_PTSO20_MASK (0x100000U) -#define GPIO_PSOR_PTSO20_SHIFT (20U) -/*! PTSO20 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO20_SHIFT)) & GPIO_PSOR_PTSO20_MASK) - -#define GPIO_PSOR_PTSO21_MASK (0x200000U) -#define GPIO_PSOR_PTSO21_SHIFT (21U) -/*! PTSO21 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO21_SHIFT)) & GPIO_PSOR_PTSO21_MASK) - -#define GPIO_PSOR_PTSO22_MASK (0x400000U) -#define GPIO_PSOR_PTSO22_SHIFT (22U) -/*! PTSO22 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO22_SHIFT)) & GPIO_PSOR_PTSO22_MASK) - -#define GPIO_PSOR_PTSO23_MASK (0x800000U) -#define GPIO_PSOR_PTSO23_SHIFT (23U) -/*! PTSO23 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO23_SHIFT)) & GPIO_PSOR_PTSO23_MASK) - -#define GPIO_PSOR_PTSO24_MASK (0x1000000U) -#define GPIO_PSOR_PTSO24_SHIFT (24U) -/*! PTSO24 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO24_SHIFT)) & GPIO_PSOR_PTSO24_MASK) - -#define GPIO_PSOR_PTSO25_MASK (0x2000000U) -#define GPIO_PSOR_PTSO25_SHIFT (25U) -/*! PTSO25 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO25_SHIFT)) & GPIO_PSOR_PTSO25_MASK) - -#define GPIO_PSOR_PTSO26_MASK (0x4000000U) -#define GPIO_PSOR_PTSO26_SHIFT (26U) -/*! PTSO26 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO26_SHIFT)) & GPIO_PSOR_PTSO26_MASK) - -#define GPIO_PSOR_PTSO27_MASK (0x8000000U) -#define GPIO_PSOR_PTSO27_SHIFT (27U) -/*! PTSO27 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO27_SHIFT)) & GPIO_PSOR_PTSO27_MASK) - -#define GPIO_PSOR_PTSO28_MASK (0x10000000U) -#define GPIO_PSOR_PTSO28_SHIFT (28U) -/*! PTSO28 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO28_SHIFT)) & GPIO_PSOR_PTSO28_MASK) - -#define GPIO_PSOR_PTSO29_MASK (0x20000000U) -#define GPIO_PSOR_PTSO29_SHIFT (29U) -/*! PTSO29 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO29_SHIFT)) & GPIO_PSOR_PTSO29_MASK) - -#define GPIO_PSOR_PTSO30_MASK (0x40000000U) -#define GPIO_PSOR_PTSO30_SHIFT (30U) -/*! PTSO30 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO30_SHIFT)) & GPIO_PSOR_PTSO30_MASK) - -#define GPIO_PSOR_PTSO31_MASK (0x80000000U) -#define GPIO_PSOR_PTSO31_SHIFT (31U) -/*! PTSO31 - Port Set Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 1 - */ -#define GPIO_PSOR_PTSO31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PSOR_PTSO31_SHIFT)) & GPIO_PSOR_PTSO31_MASK) -/*! @} */ - -/*! @name PCOR - Port Clear Output */ -/*! @{ */ - -#define GPIO_PCOR_PTCO0_MASK (0x1U) -#define GPIO_PCOR_PTCO0_SHIFT (0U) -/*! PTCO0 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO0_SHIFT)) & GPIO_PCOR_PTCO0_MASK) - -#define GPIO_PCOR_PTCO1_MASK (0x2U) -#define GPIO_PCOR_PTCO1_SHIFT (1U) -/*! PTCO1 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO1_SHIFT)) & GPIO_PCOR_PTCO1_MASK) - -#define GPIO_PCOR_PTCO2_MASK (0x4U) -#define GPIO_PCOR_PTCO2_SHIFT (2U) -/*! PTCO2 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO2_SHIFT)) & GPIO_PCOR_PTCO2_MASK) - -#define GPIO_PCOR_PTCO3_MASK (0x8U) -#define GPIO_PCOR_PTCO3_SHIFT (3U) -/*! PTCO3 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO3_SHIFT)) & GPIO_PCOR_PTCO3_MASK) - -#define GPIO_PCOR_PTCO4_MASK (0x10U) -#define GPIO_PCOR_PTCO4_SHIFT (4U) -/*! PTCO4 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO4_SHIFT)) & GPIO_PCOR_PTCO4_MASK) - -#define GPIO_PCOR_PTCO5_MASK (0x20U) -#define GPIO_PCOR_PTCO5_SHIFT (5U) -/*! PTCO5 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO5_SHIFT)) & GPIO_PCOR_PTCO5_MASK) - -#define GPIO_PCOR_PTCO6_MASK (0x40U) -#define GPIO_PCOR_PTCO6_SHIFT (6U) -/*! PTCO6 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO6_SHIFT)) & GPIO_PCOR_PTCO6_MASK) - -#define GPIO_PCOR_PTCO7_MASK (0x80U) -#define GPIO_PCOR_PTCO7_SHIFT (7U) -/*! PTCO7 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO7_SHIFT)) & GPIO_PCOR_PTCO7_MASK) - -#define GPIO_PCOR_PTCO8_MASK (0x100U) -#define GPIO_PCOR_PTCO8_SHIFT (8U) -/*! PTCO8 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO8_SHIFT)) & GPIO_PCOR_PTCO8_MASK) - -#define GPIO_PCOR_PTCO9_MASK (0x200U) -#define GPIO_PCOR_PTCO9_SHIFT (9U) -/*! PTCO9 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO9_SHIFT)) & GPIO_PCOR_PTCO9_MASK) - -#define GPIO_PCOR_PTCO10_MASK (0x400U) -#define GPIO_PCOR_PTCO10_SHIFT (10U) -/*! PTCO10 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO10_SHIFT)) & GPIO_PCOR_PTCO10_MASK) - -#define GPIO_PCOR_PTCO11_MASK (0x800U) -#define GPIO_PCOR_PTCO11_SHIFT (11U) -/*! PTCO11 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO11_SHIFT)) & GPIO_PCOR_PTCO11_MASK) - -#define GPIO_PCOR_PTCO12_MASK (0x1000U) -#define GPIO_PCOR_PTCO12_SHIFT (12U) -/*! PTCO12 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO12_SHIFT)) & GPIO_PCOR_PTCO12_MASK) - -#define GPIO_PCOR_PTCO13_MASK (0x2000U) -#define GPIO_PCOR_PTCO13_SHIFT (13U) -/*! PTCO13 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO13_SHIFT)) & GPIO_PCOR_PTCO13_MASK) - -#define GPIO_PCOR_PTCO14_MASK (0x4000U) -#define GPIO_PCOR_PTCO14_SHIFT (14U) -/*! PTCO14 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO14_SHIFT)) & GPIO_PCOR_PTCO14_MASK) - -#define GPIO_PCOR_PTCO15_MASK (0x8000U) -#define GPIO_PCOR_PTCO15_SHIFT (15U) -/*! PTCO15 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO15_SHIFT)) & GPIO_PCOR_PTCO15_MASK) - -#define GPIO_PCOR_PTCO16_MASK (0x10000U) -#define GPIO_PCOR_PTCO16_SHIFT (16U) -/*! PTCO16 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO16_SHIFT)) & GPIO_PCOR_PTCO16_MASK) - -#define GPIO_PCOR_PTCO17_MASK (0x20000U) -#define GPIO_PCOR_PTCO17_SHIFT (17U) -/*! PTCO17 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO17_SHIFT)) & GPIO_PCOR_PTCO17_MASK) - -#define GPIO_PCOR_PTCO18_MASK (0x40000U) -#define GPIO_PCOR_PTCO18_SHIFT (18U) -/*! PTCO18 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO18_SHIFT)) & GPIO_PCOR_PTCO18_MASK) - -#define GPIO_PCOR_PTCO19_MASK (0x80000U) -#define GPIO_PCOR_PTCO19_SHIFT (19U) -/*! PTCO19 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO19_SHIFT)) & GPIO_PCOR_PTCO19_MASK) - -#define GPIO_PCOR_PTCO20_MASK (0x100000U) -#define GPIO_PCOR_PTCO20_SHIFT (20U) -/*! PTCO20 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO20_SHIFT)) & GPIO_PCOR_PTCO20_MASK) - -#define GPIO_PCOR_PTCO21_MASK (0x200000U) -#define GPIO_PCOR_PTCO21_SHIFT (21U) -/*! PTCO21 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO21_SHIFT)) & GPIO_PCOR_PTCO21_MASK) - -#define GPIO_PCOR_PTCO22_MASK (0x400000U) -#define GPIO_PCOR_PTCO22_SHIFT (22U) -/*! PTCO22 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO22_SHIFT)) & GPIO_PCOR_PTCO22_MASK) - -#define GPIO_PCOR_PTCO23_MASK (0x800000U) -#define GPIO_PCOR_PTCO23_SHIFT (23U) -/*! PTCO23 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO23_SHIFT)) & GPIO_PCOR_PTCO23_MASK) - -#define GPIO_PCOR_PTCO24_MASK (0x1000000U) -#define GPIO_PCOR_PTCO24_SHIFT (24U) -/*! PTCO24 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO24_SHIFT)) & GPIO_PCOR_PTCO24_MASK) - -#define GPIO_PCOR_PTCO25_MASK (0x2000000U) -#define GPIO_PCOR_PTCO25_SHIFT (25U) -/*! PTCO25 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO25_SHIFT)) & GPIO_PCOR_PTCO25_MASK) - -#define GPIO_PCOR_PTCO26_MASK (0x4000000U) -#define GPIO_PCOR_PTCO26_SHIFT (26U) -/*! PTCO26 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO26_SHIFT)) & GPIO_PCOR_PTCO26_MASK) - -#define GPIO_PCOR_PTCO27_MASK (0x8000000U) -#define GPIO_PCOR_PTCO27_SHIFT (27U) -/*! PTCO27 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO27_SHIFT)) & GPIO_PCOR_PTCO27_MASK) - -#define GPIO_PCOR_PTCO28_MASK (0x10000000U) -#define GPIO_PCOR_PTCO28_SHIFT (28U) -/*! PTCO28 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO28_SHIFT)) & GPIO_PCOR_PTCO28_MASK) - -#define GPIO_PCOR_PTCO29_MASK (0x20000000U) -#define GPIO_PCOR_PTCO29_SHIFT (29U) -/*! PTCO29 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO29_SHIFT)) & GPIO_PCOR_PTCO29_MASK) - -#define GPIO_PCOR_PTCO30_MASK (0x40000000U) -#define GPIO_PCOR_PTCO30_SHIFT (30U) -/*! PTCO30 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO30_SHIFT)) & GPIO_PCOR_PTCO30_MASK) - -#define GPIO_PCOR_PTCO31_MASK (0x80000000U) -#define GPIO_PCOR_PTCO31_SHIFT (31U) -/*! PTCO31 - Port Clear Output - * 0b0..No change - * 0b1..Corresponding field in PDOR becomes 0 - */ -#define GPIO_PCOR_PTCO31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PCOR_PTCO31_SHIFT)) & GPIO_PCOR_PTCO31_MASK) -/*! @} */ - -/*! @name PTOR - Port Toggle Output */ -/*! @{ */ - -#define GPIO_PTOR_PTTO0_MASK (0x1U) -#define GPIO_PTOR_PTTO0_SHIFT (0U) -/*! PTTO0 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO0_SHIFT)) & GPIO_PTOR_PTTO0_MASK) - -#define GPIO_PTOR_PTTO1_MASK (0x2U) -#define GPIO_PTOR_PTTO1_SHIFT (1U) -/*! PTTO1 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO1_SHIFT)) & GPIO_PTOR_PTTO1_MASK) - -#define GPIO_PTOR_PTTO2_MASK (0x4U) -#define GPIO_PTOR_PTTO2_SHIFT (2U) -/*! PTTO2 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO2_SHIFT)) & GPIO_PTOR_PTTO2_MASK) - -#define GPIO_PTOR_PTTO3_MASK (0x8U) -#define GPIO_PTOR_PTTO3_SHIFT (3U) -/*! PTTO3 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO3_SHIFT)) & GPIO_PTOR_PTTO3_MASK) - -#define GPIO_PTOR_PTTO4_MASK (0x10U) -#define GPIO_PTOR_PTTO4_SHIFT (4U) -/*! PTTO4 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO4_SHIFT)) & GPIO_PTOR_PTTO4_MASK) - -#define GPIO_PTOR_PTTO5_MASK (0x20U) -#define GPIO_PTOR_PTTO5_SHIFT (5U) -/*! PTTO5 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO5_SHIFT)) & GPIO_PTOR_PTTO5_MASK) - -#define GPIO_PTOR_PTTO6_MASK (0x40U) -#define GPIO_PTOR_PTTO6_SHIFT (6U) -/*! PTTO6 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO6_SHIFT)) & GPIO_PTOR_PTTO6_MASK) - -#define GPIO_PTOR_PTTO7_MASK (0x80U) -#define GPIO_PTOR_PTTO7_SHIFT (7U) -/*! PTTO7 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO7_SHIFT)) & GPIO_PTOR_PTTO7_MASK) - -#define GPIO_PTOR_PTTO8_MASK (0x100U) -#define GPIO_PTOR_PTTO8_SHIFT (8U) -/*! PTTO8 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO8_SHIFT)) & GPIO_PTOR_PTTO8_MASK) - -#define GPIO_PTOR_PTTO9_MASK (0x200U) -#define GPIO_PTOR_PTTO9_SHIFT (9U) -/*! PTTO9 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO9_SHIFT)) & GPIO_PTOR_PTTO9_MASK) - -#define GPIO_PTOR_PTTO10_MASK (0x400U) -#define GPIO_PTOR_PTTO10_SHIFT (10U) -/*! PTTO10 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO10_SHIFT)) & GPIO_PTOR_PTTO10_MASK) - -#define GPIO_PTOR_PTTO11_MASK (0x800U) -#define GPIO_PTOR_PTTO11_SHIFT (11U) -/*! PTTO11 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO11_SHIFT)) & GPIO_PTOR_PTTO11_MASK) - -#define GPIO_PTOR_PTTO12_MASK (0x1000U) -#define GPIO_PTOR_PTTO12_SHIFT (12U) -/*! PTTO12 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO12_SHIFT)) & GPIO_PTOR_PTTO12_MASK) - -#define GPIO_PTOR_PTTO13_MASK (0x2000U) -#define GPIO_PTOR_PTTO13_SHIFT (13U) -/*! PTTO13 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO13_SHIFT)) & GPIO_PTOR_PTTO13_MASK) - -#define GPIO_PTOR_PTTO14_MASK (0x4000U) -#define GPIO_PTOR_PTTO14_SHIFT (14U) -/*! PTTO14 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO14_SHIFT)) & GPIO_PTOR_PTTO14_MASK) - -#define GPIO_PTOR_PTTO15_MASK (0x8000U) -#define GPIO_PTOR_PTTO15_SHIFT (15U) -/*! PTTO15 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO15_SHIFT)) & GPIO_PTOR_PTTO15_MASK) - -#define GPIO_PTOR_PTTO16_MASK (0x10000U) -#define GPIO_PTOR_PTTO16_SHIFT (16U) -/*! PTTO16 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO16_SHIFT)) & GPIO_PTOR_PTTO16_MASK) - -#define GPIO_PTOR_PTTO17_MASK (0x20000U) -#define GPIO_PTOR_PTTO17_SHIFT (17U) -/*! PTTO17 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO17_SHIFT)) & GPIO_PTOR_PTTO17_MASK) - -#define GPIO_PTOR_PTTO18_MASK (0x40000U) -#define GPIO_PTOR_PTTO18_SHIFT (18U) -/*! PTTO18 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO18_SHIFT)) & GPIO_PTOR_PTTO18_MASK) - -#define GPIO_PTOR_PTTO19_MASK (0x80000U) -#define GPIO_PTOR_PTTO19_SHIFT (19U) -/*! PTTO19 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO19_SHIFT)) & GPIO_PTOR_PTTO19_MASK) - -#define GPIO_PTOR_PTTO20_MASK (0x100000U) -#define GPIO_PTOR_PTTO20_SHIFT (20U) -/*! PTTO20 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO20_SHIFT)) & GPIO_PTOR_PTTO20_MASK) - -#define GPIO_PTOR_PTTO21_MASK (0x200000U) -#define GPIO_PTOR_PTTO21_SHIFT (21U) -/*! PTTO21 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO21_SHIFT)) & GPIO_PTOR_PTTO21_MASK) - -#define GPIO_PTOR_PTTO22_MASK (0x400000U) -#define GPIO_PTOR_PTTO22_SHIFT (22U) -/*! PTTO22 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO22_SHIFT)) & GPIO_PTOR_PTTO22_MASK) - -#define GPIO_PTOR_PTTO23_MASK (0x800000U) -#define GPIO_PTOR_PTTO23_SHIFT (23U) -/*! PTTO23 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO23_SHIFT)) & GPIO_PTOR_PTTO23_MASK) - -#define GPIO_PTOR_PTTO24_MASK (0x1000000U) -#define GPIO_PTOR_PTTO24_SHIFT (24U) -/*! PTTO24 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO24_SHIFT)) & GPIO_PTOR_PTTO24_MASK) - -#define GPIO_PTOR_PTTO25_MASK (0x2000000U) -#define GPIO_PTOR_PTTO25_SHIFT (25U) -/*! PTTO25 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO25_SHIFT)) & GPIO_PTOR_PTTO25_MASK) - -#define GPIO_PTOR_PTTO26_MASK (0x4000000U) -#define GPIO_PTOR_PTTO26_SHIFT (26U) -/*! PTTO26 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO26_SHIFT)) & GPIO_PTOR_PTTO26_MASK) - -#define GPIO_PTOR_PTTO27_MASK (0x8000000U) -#define GPIO_PTOR_PTTO27_SHIFT (27U) -/*! PTTO27 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO27_SHIFT)) & GPIO_PTOR_PTTO27_MASK) - -#define GPIO_PTOR_PTTO28_MASK (0x10000000U) -#define GPIO_PTOR_PTTO28_SHIFT (28U) -/*! PTTO28 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO28_SHIFT)) & GPIO_PTOR_PTTO28_MASK) - -#define GPIO_PTOR_PTTO29_MASK (0x20000000U) -#define GPIO_PTOR_PTTO29_SHIFT (29U) -/*! PTTO29 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO29_SHIFT)) & GPIO_PTOR_PTTO29_MASK) - -#define GPIO_PTOR_PTTO30_MASK (0x40000000U) -#define GPIO_PTOR_PTTO30_SHIFT (30U) -/*! PTTO30 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO30_SHIFT)) & GPIO_PTOR_PTTO30_MASK) - -#define GPIO_PTOR_PTTO31_MASK (0x80000000U) -#define GPIO_PTOR_PTTO31_SHIFT (31U) -/*! PTTO31 - Port Toggle Output - * 0b0..No change - * 0b1..Set to the inverse of its current logic state - */ -#define GPIO_PTOR_PTTO31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PTOR_PTTO31_SHIFT)) & GPIO_PTOR_PTTO31_MASK) -/*! @} */ - -/*! @name PDIR - Port Data Input */ -/*! @{ */ - -#define GPIO_PDIR_PDI0_MASK (0x1U) -#define GPIO_PDIR_PDI0_SHIFT (0U) -/*! PDI0 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI0_SHIFT)) & GPIO_PDIR_PDI0_MASK) - -#define GPIO_PDIR_PDI1_MASK (0x2U) -#define GPIO_PDIR_PDI1_SHIFT (1U) -/*! PDI1 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI1_SHIFT)) & GPIO_PDIR_PDI1_MASK) - -#define GPIO_PDIR_PDI2_MASK (0x4U) -#define GPIO_PDIR_PDI2_SHIFT (2U) -/*! PDI2 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI2_SHIFT)) & GPIO_PDIR_PDI2_MASK) - -#define GPIO_PDIR_PDI3_MASK (0x8U) -#define GPIO_PDIR_PDI3_SHIFT (3U) -/*! PDI3 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI3_SHIFT)) & GPIO_PDIR_PDI3_MASK) - -#define GPIO_PDIR_PDI4_MASK (0x10U) -#define GPIO_PDIR_PDI4_SHIFT (4U) -/*! PDI4 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI4_SHIFT)) & GPIO_PDIR_PDI4_MASK) - -#define GPIO_PDIR_PDI5_MASK (0x20U) -#define GPIO_PDIR_PDI5_SHIFT (5U) -/*! PDI5 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI5_SHIFT)) & GPIO_PDIR_PDI5_MASK) - -#define GPIO_PDIR_PDI6_MASK (0x40U) -#define GPIO_PDIR_PDI6_SHIFT (6U) -/*! PDI6 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI6_SHIFT)) & GPIO_PDIR_PDI6_MASK) - -#define GPIO_PDIR_PDI7_MASK (0x80U) -#define GPIO_PDIR_PDI7_SHIFT (7U) -/*! PDI7 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI7_SHIFT)) & GPIO_PDIR_PDI7_MASK) - -#define GPIO_PDIR_PDI8_MASK (0x100U) -#define GPIO_PDIR_PDI8_SHIFT (8U) -/*! PDI8 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI8_SHIFT)) & GPIO_PDIR_PDI8_MASK) - -#define GPIO_PDIR_PDI9_MASK (0x200U) -#define GPIO_PDIR_PDI9_SHIFT (9U) -/*! PDI9 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI9_SHIFT)) & GPIO_PDIR_PDI9_MASK) - -#define GPIO_PDIR_PDI10_MASK (0x400U) -#define GPIO_PDIR_PDI10_SHIFT (10U) -/*! PDI10 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI10_SHIFT)) & GPIO_PDIR_PDI10_MASK) - -#define GPIO_PDIR_PDI11_MASK (0x800U) -#define GPIO_PDIR_PDI11_SHIFT (11U) -/*! PDI11 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI11_SHIFT)) & GPIO_PDIR_PDI11_MASK) - -#define GPIO_PDIR_PDI12_MASK (0x1000U) -#define GPIO_PDIR_PDI12_SHIFT (12U) -/*! PDI12 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI12_SHIFT)) & GPIO_PDIR_PDI12_MASK) - -#define GPIO_PDIR_PDI13_MASK (0x2000U) -#define GPIO_PDIR_PDI13_SHIFT (13U) -/*! PDI13 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI13_SHIFT)) & GPIO_PDIR_PDI13_MASK) - -#define GPIO_PDIR_PDI14_MASK (0x4000U) -#define GPIO_PDIR_PDI14_SHIFT (14U) -/*! PDI14 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI14_SHIFT)) & GPIO_PDIR_PDI14_MASK) - -#define GPIO_PDIR_PDI15_MASK (0x8000U) -#define GPIO_PDIR_PDI15_SHIFT (15U) -/*! PDI15 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI15_SHIFT)) & GPIO_PDIR_PDI15_MASK) - -#define GPIO_PDIR_PDI16_MASK (0x10000U) -#define GPIO_PDIR_PDI16_SHIFT (16U) -/*! PDI16 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI16_SHIFT)) & GPIO_PDIR_PDI16_MASK) - -#define GPIO_PDIR_PDI17_MASK (0x20000U) -#define GPIO_PDIR_PDI17_SHIFT (17U) -/*! PDI17 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI17_SHIFT)) & GPIO_PDIR_PDI17_MASK) - -#define GPIO_PDIR_PDI18_MASK (0x40000U) -#define GPIO_PDIR_PDI18_SHIFT (18U) -/*! PDI18 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI18_SHIFT)) & GPIO_PDIR_PDI18_MASK) - -#define GPIO_PDIR_PDI19_MASK (0x80000U) -#define GPIO_PDIR_PDI19_SHIFT (19U) -/*! PDI19 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI19_SHIFT)) & GPIO_PDIR_PDI19_MASK) - -#define GPIO_PDIR_PDI20_MASK (0x100000U) -#define GPIO_PDIR_PDI20_SHIFT (20U) -/*! PDI20 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI20_SHIFT)) & GPIO_PDIR_PDI20_MASK) - -#define GPIO_PDIR_PDI21_MASK (0x200000U) -#define GPIO_PDIR_PDI21_SHIFT (21U) -/*! PDI21 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI21_SHIFT)) & GPIO_PDIR_PDI21_MASK) - -#define GPIO_PDIR_PDI22_MASK (0x400000U) -#define GPIO_PDIR_PDI22_SHIFT (22U) -/*! PDI22 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI22_SHIFT)) & GPIO_PDIR_PDI22_MASK) - -#define GPIO_PDIR_PDI23_MASK (0x800000U) -#define GPIO_PDIR_PDI23_SHIFT (23U) -/*! PDI23 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI23_SHIFT)) & GPIO_PDIR_PDI23_MASK) - -#define GPIO_PDIR_PDI24_MASK (0x1000000U) -#define GPIO_PDIR_PDI24_SHIFT (24U) -/*! PDI24 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI24_SHIFT)) & GPIO_PDIR_PDI24_MASK) - -#define GPIO_PDIR_PDI25_MASK (0x2000000U) -#define GPIO_PDIR_PDI25_SHIFT (25U) -/*! PDI25 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI25_SHIFT)) & GPIO_PDIR_PDI25_MASK) - -#define GPIO_PDIR_PDI26_MASK (0x4000000U) -#define GPIO_PDIR_PDI26_SHIFT (26U) -/*! PDI26 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI26_SHIFT)) & GPIO_PDIR_PDI26_MASK) - -#define GPIO_PDIR_PDI27_MASK (0x8000000U) -#define GPIO_PDIR_PDI27_SHIFT (27U) -/*! PDI27 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI27_SHIFT)) & GPIO_PDIR_PDI27_MASK) - -#define GPIO_PDIR_PDI28_MASK (0x10000000U) -#define GPIO_PDIR_PDI28_SHIFT (28U) -/*! PDI28 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI28_SHIFT)) & GPIO_PDIR_PDI28_MASK) - -#define GPIO_PDIR_PDI29_MASK (0x20000000U) -#define GPIO_PDIR_PDI29_SHIFT (29U) -/*! PDI29 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI29_SHIFT)) & GPIO_PDIR_PDI29_MASK) - -#define GPIO_PDIR_PDI30_MASK (0x40000000U) -#define GPIO_PDIR_PDI30_SHIFT (30U) -/*! PDI30 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI30_SHIFT)) & GPIO_PDIR_PDI30_MASK) - -#define GPIO_PDIR_PDI31_MASK (0x80000000U) -#define GPIO_PDIR_PDI31_SHIFT (31U) -/*! PDI31 - Port Data Input - * 0b0..Logic 0 - * 0b1..Logic 1 - */ -#define GPIO_PDIR_PDI31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDIR_PDI31_SHIFT)) & GPIO_PDIR_PDI31_MASK) -/*! @} */ - -/*! @name PDDR - Port Data Direction */ -/*! @{ */ - -#define GPIO_PDDR_PDD0_MASK (0x1U) -#define GPIO_PDDR_PDD0_SHIFT (0U) -/*! PDD0 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD0_SHIFT)) & GPIO_PDDR_PDD0_MASK) - -#define GPIO_PDDR_PDD1_MASK (0x2U) -#define GPIO_PDDR_PDD1_SHIFT (1U) -/*! PDD1 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD1_SHIFT)) & GPIO_PDDR_PDD1_MASK) - -#define GPIO_PDDR_PDD2_MASK (0x4U) -#define GPIO_PDDR_PDD2_SHIFT (2U) -/*! PDD2 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD2_SHIFT)) & GPIO_PDDR_PDD2_MASK) - -#define GPIO_PDDR_PDD3_MASK (0x8U) -#define GPIO_PDDR_PDD3_SHIFT (3U) -/*! PDD3 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD3_SHIFT)) & GPIO_PDDR_PDD3_MASK) - -#define GPIO_PDDR_PDD4_MASK (0x10U) -#define GPIO_PDDR_PDD4_SHIFT (4U) -/*! PDD4 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD4_SHIFT)) & GPIO_PDDR_PDD4_MASK) - -#define GPIO_PDDR_PDD5_MASK (0x20U) -#define GPIO_PDDR_PDD5_SHIFT (5U) -/*! PDD5 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD5_SHIFT)) & GPIO_PDDR_PDD5_MASK) - -#define GPIO_PDDR_PDD6_MASK (0x40U) -#define GPIO_PDDR_PDD6_SHIFT (6U) -/*! PDD6 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD6_SHIFT)) & GPIO_PDDR_PDD6_MASK) - -#define GPIO_PDDR_PDD7_MASK (0x80U) -#define GPIO_PDDR_PDD7_SHIFT (7U) -/*! PDD7 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD7_SHIFT)) & GPIO_PDDR_PDD7_MASK) - -#define GPIO_PDDR_PDD8_MASK (0x100U) -#define GPIO_PDDR_PDD8_SHIFT (8U) -/*! PDD8 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD8_SHIFT)) & GPIO_PDDR_PDD8_MASK) - -#define GPIO_PDDR_PDD9_MASK (0x200U) -#define GPIO_PDDR_PDD9_SHIFT (9U) -/*! PDD9 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD9_SHIFT)) & GPIO_PDDR_PDD9_MASK) - -#define GPIO_PDDR_PDD10_MASK (0x400U) -#define GPIO_PDDR_PDD10_SHIFT (10U) -/*! PDD10 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD10_SHIFT)) & GPIO_PDDR_PDD10_MASK) - -#define GPIO_PDDR_PDD11_MASK (0x800U) -#define GPIO_PDDR_PDD11_SHIFT (11U) -/*! PDD11 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD11_SHIFT)) & GPIO_PDDR_PDD11_MASK) - -#define GPIO_PDDR_PDD12_MASK (0x1000U) -#define GPIO_PDDR_PDD12_SHIFT (12U) -/*! PDD12 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD12_SHIFT)) & GPIO_PDDR_PDD12_MASK) - -#define GPIO_PDDR_PDD13_MASK (0x2000U) -#define GPIO_PDDR_PDD13_SHIFT (13U) -/*! PDD13 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD13_SHIFT)) & GPIO_PDDR_PDD13_MASK) - -#define GPIO_PDDR_PDD14_MASK (0x4000U) -#define GPIO_PDDR_PDD14_SHIFT (14U) -/*! PDD14 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD14_SHIFT)) & GPIO_PDDR_PDD14_MASK) - -#define GPIO_PDDR_PDD15_MASK (0x8000U) -#define GPIO_PDDR_PDD15_SHIFT (15U) -/*! PDD15 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD15_SHIFT)) & GPIO_PDDR_PDD15_MASK) - -#define GPIO_PDDR_PDD16_MASK (0x10000U) -#define GPIO_PDDR_PDD16_SHIFT (16U) -/*! PDD16 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD16_SHIFT)) & GPIO_PDDR_PDD16_MASK) - -#define GPIO_PDDR_PDD17_MASK (0x20000U) -#define GPIO_PDDR_PDD17_SHIFT (17U) -/*! PDD17 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD17_SHIFT)) & GPIO_PDDR_PDD17_MASK) - -#define GPIO_PDDR_PDD18_MASK (0x40000U) -#define GPIO_PDDR_PDD18_SHIFT (18U) -/*! PDD18 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD18_SHIFT)) & GPIO_PDDR_PDD18_MASK) - -#define GPIO_PDDR_PDD19_MASK (0x80000U) -#define GPIO_PDDR_PDD19_SHIFT (19U) -/*! PDD19 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD19_SHIFT)) & GPIO_PDDR_PDD19_MASK) - -#define GPIO_PDDR_PDD20_MASK (0x100000U) -#define GPIO_PDDR_PDD20_SHIFT (20U) -/*! PDD20 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD20_SHIFT)) & GPIO_PDDR_PDD20_MASK) - -#define GPIO_PDDR_PDD21_MASK (0x200000U) -#define GPIO_PDDR_PDD21_SHIFT (21U) -/*! PDD21 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD21_SHIFT)) & GPIO_PDDR_PDD21_MASK) - -#define GPIO_PDDR_PDD22_MASK (0x400000U) -#define GPIO_PDDR_PDD22_SHIFT (22U) -/*! PDD22 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD22_SHIFT)) & GPIO_PDDR_PDD22_MASK) - -#define GPIO_PDDR_PDD23_MASK (0x800000U) -#define GPIO_PDDR_PDD23_SHIFT (23U) -/*! PDD23 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD23_SHIFT)) & GPIO_PDDR_PDD23_MASK) - -#define GPIO_PDDR_PDD24_MASK (0x1000000U) -#define GPIO_PDDR_PDD24_SHIFT (24U) -/*! PDD24 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD24_SHIFT)) & GPIO_PDDR_PDD24_MASK) - -#define GPIO_PDDR_PDD25_MASK (0x2000000U) -#define GPIO_PDDR_PDD25_SHIFT (25U) -/*! PDD25 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD25_SHIFT)) & GPIO_PDDR_PDD25_MASK) - -#define GPIO_PDDR_PDD26_MASK (0x4000000U) -#define GPIO_PDDR_PDD26_SHIFT (26U) -/*! PDD26 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD26_SHIFT)) & GPIO_PDDR_PDD26_MASK) - -#define GPIO_PDDR_PDD27_MASK (0x8000000U) -#define GPIO_PDDR_PDD27_SHIFT (27U) -/*! PDD27 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD27_SHIFT)) & GPIO_PDDR_PDD27_MASK) - -#define GPIO_PDDR_PDD28_MASK (0x10000000U) -#define GPIO_PDDR_PDD28_SHIFT (28U) -/*! PDD28 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD28_SHIFT)) & GPIO_PDDR_PDD28_MASK) - -#define GPIO_PDDR_PDD29_MASK (0x20000000U) -#define GPIO_PDDR_PDD29_SHIFT (29U) -/*! PDD29 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD29_SHIFT)) & GPIO_PDDR_PDD29_MASK) - -#define GPIO_PDDR_PDD30_MASK (0x40000000U) -#define GPIO_PDDR_PDD30_SHIFT (30U) -/*! PDD30 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD30_SHIFT)) & GPIO_PDDR_PDD30_MASK) - -#define GPIO_PDDR_PDD31_MASK (0x80000000U) -#define GPIO_PDDR_PDD31_SHIFT (31U) -/*! PDD31 - Port Data Direction - * 0b0..Input - * 0b1..Output - */ -#define GPIO_PDDR_PDD31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PDDR_PDD31_SHIFT)) & GPIO_PDDR_PDD31_MASK) -/*! @} */ - -/*! @name PIDR - Port Input Disable */ -/*! @{ */ - -#define GPIO_PIDR_PID0_MASK (0x1U) -#define GPIO_PIDR_PID0_SHIFT (0U) -/*! PID0 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID0_SHIFT)) & GPIO_PIDR_PID0_MASK) - -#define GPIO_PIDR_PID1_MASK (0x2U) -#define GPIO_PIDR_PID1_SHIFT (1U) -/*! PID1 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID1_SHIFT)) & GPIO_PIDR_PID1_MASK) - -#define GPIO_PIDR_PID2_MASK (0x4U) -#define GPIO_PIDR_PID2_SHIFT (2U) -/*! PID2 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID2_SHIFT)) & GPIO_PIDR_PID2_MASK) - -#define GPIO_PIDR_PID3_MASK (0x8U) -#define GPIO_PIDR_PID3_SHIFT (3U) -/*! PID3 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID3_SHIFT)) & GPIO_PIDR_PID3_MASK) - -#define GPIO_PIDR_PID4_MASK (0x10U) -#define GPIO_PIDR_PID4_SHIFT (4U) -/*! PID4 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID4_SHIFT)) & GPIO_PIDR_PID4_MASK) - -#define GPIO_PIDR_PID5_MASK (0x20U) -#define GPIO_PIDR_PID5_SHIFT (5U) -/*! PID5 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID5_SHIFT)) & GPIO_PIDR_PID5_MASK) - -#define GPIO_PIDR_PID6_MASK (0x40U) -#define GPIO_PIDR_PID6_SHIFT (6U) -/*! PID6 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID6_SHIFT)) & GPIO_PIDR_PID6_MASK) - -#define GPIO_PIDR_PID7_MASK (0x80U) -#define GPIO_PIDR_PID7_SHIFT (7U) -/*! PID7 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID7_SHIFT)) & GPIO_PIDR_PID7_MASK) - -#define GPIO_PIDR_PID8_MASK (0x100U) -#define GPIO_PIDR_PID8_SHIFT (8U) -/*! PID8 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID8_SHIFT)) & GPIO_PIDR_PID8_MASK) - -#define GPIO_PIDR_PID9_MASK (0x200U) -#define GPIO_PIDR_PID9_SHIFT (9U) -/*! PID9 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID9_SHIFT)) & GPIO_PIDR_PID9_MASK) - -#define GPIO_PIDR_PID10_MASK (0x400U) -#define GPIO_PIDR_PID10_SHIFT (10U) -/*! PID10 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID10_SHIFT)) & GPIO_PIDR_PID10_MASK) - -#define GPIO_PIDR_PID11_MASK (0x800U) -#define GPIO_PIDR_PID11_SHIFT (11U) -/*! PID11 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID11_SHIFT)) & GPIO_PIDR_PID11_MASK) - -#define GPIO_PIDR_PID12_MASK (0x1000U) -#define GPIO_PIDR_PID12_SHIFT (12U) -/*! PID12 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID12_SHIFT)) & GPIO_PIDR_PID12_MASK) - -#define GPIO_PIDR_PID13_MASK (0x2000U) -#define GPIO_PIDR_PID13_SHIFT (13U) -/*! PID13 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID13_SHIFT)) & GPIO_PIDR_PID13_MASK) - -#define GPIO_PIDR_PID14_MASK (0x4000U) -#define GPIO_PIDR_PID14_SHIFT (14U) -/*! PID14 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID14_SHIFT)) & GPIO_PIDR_PID14_MASK) - -#define GPIO_PIDR_PID15_MASK (0x8000U) -#define GPIO_PIDR_PID15_SHIFT (15U) -/*! PID15 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID15_SHIFT)) & GPIO_PIDR_PID15_MASK) - -#define GPIO_PIDR_PID16_MASK (0x10000U) -#define GPIO_PIDR_PID16_SHIFT (16U) -/*! PID16 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID16_SHIFT)) & GPIO_PIDR_PID16_MASK) - -#define GPIO_PIDR_PID17_MASK (0x20000U) -#define GPIO_PIDR_PID17_SHIFT (17U) -/*! PID17 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID17_SHIFT)) & GPIO_PIDR_PID17_MASK) - -#define GPIO_PIDR_PID18_MASK (0x40000U) -#define GPIO_PIDR_PID18_SHIFT (18U) -/*! PID18 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID18_SHIFT)) & GPIO_PIDR_PID18_MASK) - -#define GPIO_PIDR_PID19_MASK (0x80000U) -#define GPIO_PIDR_PID19_SHIFT (19U) -/*! PID19 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID19_SHIFT)) & GPIO_PIDR_PID19_MASK) - -#define GPIO_PIDR_PID20_MASK (0x100000U) -#define GPIO_PIDR_PID20_SHIFT (20U) -/*! PID20 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID20_SHIFT)) & GPIO_PIDR_PID20_MASK) - -#define GPIO_PIDR_PID21_MASK (0x200000U) -#define GPIO_PIDR_PID21_SHIFT (21U) -/*! PID21 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID21_SHIFT)) & GPIO_PIDR_PID21_MASK) - -#define GPIO_PIDR_PID22_MASK (0x400000U) -#define GPIO_PIDR_PID22_SHIFT (22U) -/*! PID22 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID22_SHIFT)) & GPIO_PIDR_PID22_MASK) - -#define GPIO_PIDR_PID23_MASK (0x800000U) -#define GPIO_PIDR_PID23_SHIFT (23U) -/*! PID23 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID23_SHIFT)) & GPIO_PIDR_PID23_MASK) - -#define GPIO_PIDR_PID24_MASK (0x1000000U) -#define GPIO_PIDR_PID24_SHIFT (24U) -/*! PID24 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID24_SHIFT)) & GPIO_PIDR_PID24_MASK) - -#define GPIO_PIDR_PID25_MASK (0x2000000U) -#define GPIO_PIDR_PID25_SHIFT (25U) -/*! PID25 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID25_SHIFT)) & GPIO_PIDR_PID25_MASK) - -#define GPIO_PIDR_PID26_MASK (0x4000000U) -#define GPIO_PIDR_PID26_SHIFT (26U) -/*! PID26 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID26_SHIFT)) & GPIO_PIDR_PID26_MASK) - -#define GPIO_PIDR_PID27_MASK (0x8000000U) -#define GPIO_PIDR_PID27_SHIFT (27U) -/*! PID27 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID27_SHIFT)) & GPIO_PIDR_PID27_MASK) - -#define GPIO_PIDR_PID28_MASK (0x10000000U) -#define GPIO_PIDR_PID28_SHIFT (28U) -/*! PID28 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID28_SHIFT)) & GPIO_PIDR_PID28_MASK) - -#define GPIO_PIDR_PID29_MASK (0x20000000U) -#define GPIO_PIDR_PID29_SHIFT (29U) -/*! PID29 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID29_SHIFT)) & GPIO_PIDR_PID29_MASK) - -#define GPIO_PIDR_PID30_MASK (0x40000000U) -#define GPIO_PIDR_PID30_SHIFT (30U) -/*! PID30 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID30_SHIFT)) & GPIO_PIDR_PID30_MASK) - -#define GPIO_PIDR_PID31_MASK (0x80000000U) -#define GPIO_PIDR_PID31_SHIFT (31U) -/*! PID31 - Port Input Disable - * 0b0..Configured for general-purpose input - * 0b1..Disabled for general-purpose input - */ -#define GPIO_PIDR_PID31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIDR_PID31_SHIFT)) & GPIO_PIDR_PID31_MASK) -/*! @} */ - -/*! @name PDR - Pin Data */ -/*! @{ */ - -#define GPIO_PDR_PD_MASK (0x1U) -#define GPIO_PDR_PD_SHIFT (0U) -/*! PD - Pin Data (I/O) - * 0b0..Logic zero - * 0b1..Logic one - */ -#define GPIO_PDR_PD(x) (((uint8_t)(((uint8_t)(x)) << GPIO_PDR_PD_SHIFT)) & GPIO_PDR_PD_MASK) -/*! @} */ - -/* The count of GPIO_PDR */ -#define GPIO_PDR_COUNT (32U) - -/*! @name ICR - Interrupt Control 0..Interrupt Control 31 */ -/*! @{ */ - -#define GPIO_ICR_IRQC_MASK (0xF0000U) -#define GPIO_ICR_IRQC_SHIFT (16U) -/*! IRQC - Interrupt Configuration - * 0b0000..ISF is disabled - * 0b0001..ISF and DMA request on rising edge - * 0b0010..ISF and DMA request on falling edge - * 0b0011..ISF and DMA request on either edge - * 0b0100..Reserved - * 0b0101..ISF sets on rising edge - * 0b0110..ISF sets on falling edge - * 0b0111..ISF sets on either edge - * 0b1000..ISF and interrupt when logic 0 - * 0b1001..ISF and interrupt on rising edge - * 0b1010..ISF and interrupt on falling edge - * 0b1011..ISF and Interrupt on either edge - * 0b1100..ISF and interrupt when logic 1 - * 0b1101..Enable active-high trigger output; ISF on rising edge (pin state is ORed with other enabled triggers - * to generate the output trigger for use by other peripherals) - * 0b1110..Enable active-low trigger output; ISF on falling edge (pin state is inverted and ORed with other - * enabled triggers to generate the output trigger for use by other peripherals) - * 0b1111..Reserved - */ -#define GPIO_ICR_IRQC(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ICR_IRQC_SHIFT)) & GPIO_ICR_IRQC_MASK) - -#define GPIO_ICR_IRQS_MASK (0x100000U) -#define GPIO_ICR_IRQS_SHIFT (20U) -/*! IRQS - Interrupt Select - * 0b0..Interrupt, trigger output, or DMA request 0 - * 0b1..Interrupt, trigger output, or DMA request 1 - */ -#define GPIO_ICR_IRQS(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ICR_IRQS_SHIFT)) & GPIO_ICR_IRQS_MASK) - -#define GPIO_ICR_LK_MASK (0x800000U) -#define GPIO_ICR_LK_SHIFT (23U) -/*! LK - Lock - * 0b0..Lock - * 0b1..Do not lock - */ -#define GPIO_ICR_LK(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ICR_LK_SHIFT)) & GPIO_ICR_LK_MASK) - -#define GPIO_ICR_ISF_MASK (0x1000000U) -#define GPIO_ICR_ISF_SHIFT (24U) -/*! ISF - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ICR_ISF(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ICR_ISF_SHIFT)) & GPIO_ICR_ISF_MASK) -/*! @} */ - -/* The count of GPIO_ICR */ -#define GPIO_ICR_COUNT (32U) - -/*! @name GICLR - Global Interrupt Control Low */ -/*! @{ */ - -#define GPIO_GICLR_GIWE0_MASK (0x1U) -#define GPIO_GICLR_GIWE0_SHIFT (0U) -/*! GIWE0 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE0_SHIFT)) & GPIO_GICLR_GIWE0_MASK) - -#define GPIO_GICLR_GIWE1_MASK (0x2U) -#define GPIO_GICLR_GIWE1_SHIFT (1U) -/*! GIWE1 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE1_SHIFT)) & GPIO_GICLR_GIWE1_MASK) - -#define GPIO_GICLR_GIWE2_MASK (0x4U) -#define GPIO_GICLR_GIWE2_SHIFT (2U) -/*! GIWE2 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE2_SHIFT)) & GPIO_GICLR_GIWE2_MASK) - -#define GPIO_GICLR_GIWE3_MASK (0x8U) -#define GPIO_GICLR_GIWE3_SHIFT (3U) -/*! GIWE3 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE3_SHIFT)) & GPIO_GICLR_GIWE3_MASK) - -#define GPIO_GICLR_GIWE4_MASK (0x10U) -#define GPIO_GICLR_GIWE4_SHIFT (4U) -/*! GIWE4 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE4_SHIFT)) & GPIO_GICLR_GIWE4_MASK) - -#define GPIO_GICLR_GIWE5_MASK (0x20U) -#define GPIO_GICLR_GIWE5_SHIFT (5U) -/*! GIWE5 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE5_SHIFT)) & GPIO_GICLR_GIWE5_MASK) - -#define GPIO_GICLR_GIWE6_MASK (0x40U) -#define GPIO_GICLR_GIWE6_SHIFT (6U) -/*! GIWE6 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE6_SHIFT)) & GPIO_GICLR_GIWE6_MASK) - -#define GPIO_GICLR_GIWE7_MASK (0x80U) -#define GPIO_GICLR_GIWE7_SHIFT (7U) -/*! GIWE7 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE7_SHIFT)) & GPIO_GICLR_GIWE7_MASK) - -#define GPIO_GICLR_GIWE8_MASK (0x100U) -#define GPIO_GICLR_GIWE8_SHIFT (8U) -/*! GIWE8 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE8_SHIFT)) & GPIO_GICLR_GIWE8_MASK) - -#define GPIO_GICLR_GIWE9_MASK (0x200U) -#define GPIO_GICLR_GIWE9_SHIFT (9U) -/*! GIWE9 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE9_SHIFT)) & GPIO_GICLR_GIWE9_MASK) - -#define GPIO_GICLR_GIWE10_MASK (0x400U) -#define GPIO_GICLR_GIWE10_SHIFT (10U) -/*! GIWE10 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE10_SHIFT)) & GPIO_GICLR_GIWE10_MASK) - -#define GPIO_GICLR_GIWE11_MASK (0x800U) -#define GPIO_GICLR_GIWE11_SHIFT (11U) -/*! GIWE11 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE11_SHIFT)) & GPIO_GICLR_GIWE11_MASK) - -#define GPIO_GICLR_GIWE12_MASK (0x1000U) -#define GPIO_GICLR_GIWE12_SHIFT (12U) -/*! GIWE12 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE12_SHIFT)) & GPIO_GICLR_GIWE12_MASK) - -#define GPIO_GICLR_GIWE13_MASK (0x2000U) -#define GPIO_GICLR_GIWE13_SHIFT (13U) -/*! GIWE13 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE13_SHIFT)) & GPIO_GICLR_GIWE13_MASK) - -#define GPIO_GICLR_GIWE14_MASK (0x4000U) -#define GPIO_GICLR_GIWE14_SHIFT (14U) -/*! GIWE14 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE14_SHIFT)) & GPIO_GICLR_GIWE14_MASK) - -#define GPIO_GICLR_GIWE15_MASK (0x8000U) -#define GPIO_GICLR_GIWE15_SHIFT (15U) -/*! GIWE15 - Global Interrupt Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define GPIO_GICLR_GIWE15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWE15_SHIFT)) & GPIO_GICLR_GIWE15_MASK) - -#define GPIO_GICLR_GIWD_MASK (0xFFFF0000U) -#define GPIO_GICLR_GIWD_SHIFT (16U) -/*! GIWD - Global Interrupt Write Data */ -#define GPIO_GICLR_GIWD(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICLR_GIWD_SHIFT)) & GPIO_GICLR_GIWD_MASK) -/*! @} */ - -/*! @name GICHR - Global Interrupt Control High */ -/*! @{ */ - -#define GPIO_GICHR_GIWE16_MASK (0x1U) -#define GPIO_GICHR_GIWE16_SHIFT (0U) -/*! GIWE16 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE16_SHIFT)) & GPIO_GICHR_GIWE16_MASK) - -#define GPIO_GICHR_GIWE17_MASK (0x2U) -#define GPIO_GICHR_GIWE17_SHIFT (1U) -/*! GIWE17 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE17_SHIFT)) & GPIO_GICHR_GIWE17_MASK) - -#define GPIO_GICHR_GIWE18_MASK (0x4U) -#define GPIO_GICHR_GIWE18_SHIFT (2U) -/*! GIWE18 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE18_SHIFT)) & GPIO_GICHR_GIWE18_MASK) - -#define GPIO_GICHR_GIWE19_MASK (0x8U) -#define GPIO_GICHR_GIWE19_SHIFT (3U) -/*! GIWE19 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE19_SHIFT)) & GPIO_GICHR_GIWE19_MASK) - -#define GPIO_GICHR_GIWE20_MASK (0x10U) -#define GPIO_GICHR_GIWE20_SHIFT (4U) -/*! GIWE20 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE20_SHIFT)) & GPIO_GICHR_GIWE20_MASK) - -#define GPIO_GICHR_GIWE21_MASK (0x20U) -#define GPIO_GICHR_GIWE21_SHIFT (5U) -/*! GIWE21 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE21_SHIFT)) & GPIO_GICHR_GIWE21_MASK) - -#define GPIO_GICHR_GIWE22_MASK (0x40U) -#define GPIO_GICHR_GIWE22_SHIFT (6U) -/*! GIWE22 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE22_SHIFT)) & GPIO_GICHR_GIWE22_MASK) - -#define GPIO_GICHR_GIWE23_MASK (0x80U) -#define GPIO_GICHR_GIWE23_SHIFT (7U) -/*! GIWE23 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE23_SHIFT)) & GPIO_GICHR_GIWE23_MASK) - -#define GPIO_GICHR_GIWE24_MASK (0x100U) -#define GPIO_GICHR_GIWE24_SHIFT (8U) -/*! GIWE24 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE24_SHIFT)) & GPIO_GICHR_GIWE24_MASK) - -#define GPIO_GICHR_GIWE25_MASK (0x200U) -#define GPIO_GICHR_GIWE25_SHIFT (9U) -/*! GIWE25 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE25_SHIFT)) & GPIO_GICHR_GIWE25_MASK) - -#define GPIO_GICHR_GIWE26_MASK (0x400U) -#define GPIO_GICHR_GIWE26_SHIFT (10U) -/*! GIWE26 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE26_SHIFT)) & GPIO_GICHR_GIWE26_MASK) - -#define GPIO_GICHR_GIWE27_MASK (0x800U) -#define GPIO_GICHR_GIWE27_SHIFT (11U) -/*! GIWE27 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE27_SHIFT)) & GPIO_GICHR_GIWE27_MASK) - -#define GPIO_GICHR_GIWE28_MASK (0x1000U) -#define GPIO_GICHR_GIWE28_SHIFT (12U) -/*! GIWE28 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE28_SHIFT)) & GPIO_GICHR_GIWE28_MASK) - -#define GPIO_GICHR_GIWE29_MASK (0x2000U) -#define GPIO_GICHR_GIWE29_SHIFT (13U) -/*! GIWE29 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE29_SHIFT)) & GPIO_GICHR_GIWE29_MASK) - -#define GPIO_GICHR_GIWE30_MASK (0x4000U) -#define GPIO_GICHR_GIWE30_SHIFT (14U) -/*! GIWE30 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE30_SHIFT)) & GPIO_GICHR_GIWE30_MASK) - -#define GPIO_GICHR_GIWE31_MASK (0x8000U) -#define GPIO_GICHR_GIWE31_SHIFT (15U) -/*! GIWE31 - Global Interrupt Write Enable - * 0b0..Not updated. - * 0b1..Updated - */ -#define GPIO_GICHR_GIWE31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWE31_SHIFT)) & GPIO_GICHR_GIWE31_MASK) - -#define GPIO_GICHR_GIWD_MASK (0xFFFF0000U) -#define GPIO_GICHR_GIWD_SHIFT (16U) -/*! GIWD - Global Interrupt Write Data */ -#define GPIO_GICHR_GIWD(x) (((uint32_t)(((uint32_t)(x)) << GPIO_GICHR_GIWD_SHIFT)) & GPIO_GICHR_GIWD_MASK) -/*! @} */ - -/*! @name ISFR - Interrupt Status Flag */ -/*! @{ */ - -#define GPIO_ISFR_ISF0_MASK (0x1U) -#define GPIO_ISFR_ISF0_SHIFT (0U) -/*! ISF0 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF0(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF0_SHIFT)) & GPIO_ISFR_ISF0_MASK) - -#define GPIO_ISFR_ISF1_MASK (0x2U) -#define GPIO_ISFR_ISF1_SHIFT (1U) -/*! ISF1 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF1(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF1_SHIFT)) & GPIO_ISFR_ISF1_MASK) - -#define GPIO_ISFR_ISF2_MASK (0x4U) -#define GPIO_ISFR_ISF2_SHIFT (2U) -/*! ISF2 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF2(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF2_SHIFT)) & GPIO_ISFR_ISF2_MASK) - -#define GPIO_ISFR_ISF3_MASK (0x8U) -#define GPIO_ISFR_ISF3_SHIFT (3U) -/*! ISF3 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF3(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF3_SHIFT)) & GPIO_ISFR_ISF3_MASK) - -#define GPIO_ISFR_ISF4_MASK (0x10U) -#define GPIO_ISFR_ISF4_SHIFT (4U) -/*! ISF4 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF4(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF4_SHIFT)) & GPIO_ISFR_ISF4_MASK) - -#define GPIO_ISFR_ISF5_MASK (0x20U) -#define GPIO_ISFR_ISF5_SHIFT (5U) -/*! ISF5 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF5(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF5_SHIFT)) & GPIO_ISFR_ISF5_MASK) - -#define GPIO_ISFR_ISF6_MASK (0x40U) -#define GPIO_ISFR_ISF6_SHIFT (6U) -/*! ISF6 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF6(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF6_SHIFT)) & GPIO_ISFR_ISF6_MASK) - -#define GPIO_ISFR_ISF7_MASK (0x80U) -#define GPIO_ISFR_ISF7_SHIFT (7U) -/*! ISF7 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF7(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF7_SHIFT)) & GPIO_ISFR_ISF7_MASK) - -#define GPIO_ISFR_ISF8_MASK (0x100U) -#define GPIO_ISFR_ISF8_SHIFT (8U) -/*! ISF8 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF8(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF8_SHIFT)) & GPIO_ISFR_ISF8_MASK) - -#define GPIO_ISFR_ISF9_MASK (0x200U) -#define GPIO_ISFR_ISF9_SHIFT (9U) -/*! ISF9 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF9(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF9_SHIFT)) & GPIO_ISFR_ISF9_MASK) - -#define GPIO_ISFR_ISF10_MASK (0x400U) -#define GPIO_ISFR_ISF10_SHIFT (10U) -/*! ISF10 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF10(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF10_SHIFT)) & GPIO_ISFR_ISF10_MASK) - -#define GPIO_ISFR_ISF11_MASK (0x800U) -#define GPIO_ISFR_ISF11_SHIFT (11U) -/*! ISF11 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF11(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF11_SHIFT)) & GPIO_ISFR_ISF11_MASK) - -#define GPIO_ISFR_ISF12_MASK (0x1000U) -#define GPIO_ISFR_ISF12_SHIFT (12U) -/*! ISF12 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF12(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF12_SHIFT)) & GPIO_ISFR_ISF12_MASK) - -#define GPIO_ISFR_ISF13_MASK (0x2000U) -#define GPIO_ISFR_ISF13_SHIFT (13U) -/*! ISF13 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF13(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF13_SHIFT)) & GPIO_ISFR_ISF13_MASK) - -#define GPIO_ISFR_ISF14_MASK (0x4000U) -#define GPIO_ISFR_ISF14_SHIFT (14U) -/*! ISF14 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF14(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF14_SHIFT)) & GPIO_ISFR_ISF14_MASK) - -#define GPIO_ISFR_ISF15_MASK (0x8000U) -#define GPIO_ISFR_ISF15_SHIFT (15U) -/*! ISF15 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF15(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF15_SHIFT)) & GPIO_ISFR_ISF15_MASK) - -#define GPIO_ISFR_ISF16_MASK (0x10000U) -#define GPIO_ISFR_ISF16_SHIFT (16U) -/*! ISF16 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF16(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF16_SHIFT)) & GPIO_ISFR_ISF16_MASK) - -#define GPIO_ISFR_ISF17_MASK (0x20000U) -#define GPIO_ISFR_ISF17_SHIFT (17U) -/*! ISF17 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF17(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF17_SHIFT)) & GPIO_ISFR_ISF17_MASK) - -#define GPIO_ISFR_ISF18_MASK (0x40000U) -#define GPIO_ISFR_ISF18_SHIFT (18U) -/*! ISF18 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF18(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF18_SHIFT)) & GPIO_ISFR_ISF18_MASK) - -#define GPIO_ISFR_ISF19_MASK (0x80000U) -#define GPIO_ISFR_ISF19_SHIFT (19U) -/*! ISF19 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF19(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF19_SHIFT)) & GPIO_ISFR_ISF19_MASK) - -#define GPIO_ISFR_ISF20_MASK (0x100000U) -#define GPIO_ISFR_ISF20_SHIFT (20U) -/*! ISF20 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF20(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF20_SHIFT)) & GPIO_ISFR_ISF20_MASK) - -#define GPIO_ISFR_ISF21_MASK (0x200000U) -#define GPIO_ISFR_ISF21_SHIFT (21U) -/*! ISF21 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF21(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF21_SHIFT)) & GPIO_ISFR_ISF21_MASK) - -#define GPIO_ISFR_ISF22_MASK (0x400000U) -#define GPIO_ISFR_ISF22_SHIFT (22U) -/*! ISF22 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF22(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF22_SHIFT)) & GPIO_ISFR_ISF22_MASK) - -#define GPIO_ISFR_ISF23_MASK (0x800000U) -#define GPIO_ISFR_ISF23_SHIFT (23U) -/*! ISF23 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF23(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF23_SHIFT)) & GPIO_ISFR_ISF23_MASK) - -#define GPIO_ISFR_ISF24_MASK (0x1000000U) -#define GPIO_ISFR_ISF24_SHIFT (24U) -/*! ISF24 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF24(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF24_SHIFT)) & GPIO_ISFR_ISF24_MASK) - -#define GPIO_ISFR_ISF25_MASK (0x2000000U) -#define GPIO_ISFR_ISF25_SHIFT (25U) -/*! ISF25 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF25(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF25_SHIFT)) & GPIO_ISFR_ISF25_MASK) - -#define GPIO_ISFR_ISF26_MASK (0x4000000U) -#define GPIO_ISFR_ISF26_SHIFT (26U) -/*! ISF26 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF26(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF26_SHIFT)) & GPIO_ISFR_ISF26_MASK) - -#define GPIO_ISFR_ISF27_MASK (0x8000000U) -#define GPIO_ISFR_ISF27_SHIFT (27U) -/*! ISF27 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF27(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF27_SHIFT)) & GPIO_ISFR_ISF27_MASK) - -#define GPIO_ISFR_ISF28_MASK (0x10000000U) -#define GPIO_ISFR_ISF28_SHIFT (28U) -/*! ISF28 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF28(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF28_SHIFT)) & GPIO_ISFR_ISF28_MASK) - -#define GPIO_ISFR_ISF29_MASK (0x20000000U) -#define GPIO_ISFR_ISF29_SHIFT (29U) -/*! ISF29 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF29(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF29_SHIFT)) & GPIO_ISFR_ISF29_MASK) - -#define GPIO_ISFR_ISF30_MASK (0x40000000U) -#define GPIO_ISFR_ISF30_SHIFT (30U) -/*! ISF30 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF30(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF30_SHIFT)) & GPIO_ISFR_ISF30_MASK) - -#define GPIO_ISFR_ISF31_MASK (0x80000000U) -#define GPIO_ISFR_ISF31_SHIFT (31U) -/*! ISF31 - Interrupt Status Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define GPIO_ISFR_ISF31(x) (((uint32_t)(((uint32_t)(x)) << GPIO_ISFR_ISF31_SHIFT)) & GPIO_ISFR_ISF31_MASK) -/*! @} */ - -/* The count of GPIO_ISFR */ -#define GPIO_ISFR_COUNT (2U) - - -/*! - * @} - */ /* end of group GPIO_Register_Masks */ - - -/* GPIO - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral GPIO0 base address */ - #define GPIO0_BASE (0x50096000u) - /** Peripheral GPIO0 base address */ - #define GPIO0_BASE_NS (0x40096000u) - /** Peripheral GPIO0 base pointer */ - #define GPIO0 ((GPIO_Type *)GPIO0_BASE) - /** Peripheral GPIO0 base pointer */ - #define GPIO0_NS ((GPIO_Type *)GPIO0_BASE_NS) - /** Peripheral GPIO0_ALIAS1 base address */ - #define GPIO0_ALIAS1_BASE (0x50097000u) - /** Peripheral GPIO0_ALIAS1 base address */ - #define GPIO0_ALIAS1_BASE_NS (0x40097000u) - /** Peripheral GPIO0_ALIAS1 base pointer */ - #define GPIO0_ALIAS1 ((GPIO_Type *)GPIO0_ALIAS1_BASE) - /** Peripheral GPIO0_ALIAS1 base pointer */ - #define GPIO0_ALIAS1_NS ((GPIO_Type *)GPIO0_ALIAS1_BASE_NS) - /** Peripheral GPIO1 base address */ - #define GPIO1_BASE (0x50098000u) - /** Peripheral GPIO1 base address */ - #define GPIO1_BASE_NS (0x40098000u) - /** Peripheral GPIO1 base pointer */ - #define GPIO1 ((GPIO_Type *)GPIO1_BASE) - /** Peripheral GPIO1 base pointer */ - #define GPIO1_NS ((GPIO_Type *)GPIO1_BASE_NS) - /** Peripheral GPIO1_ALIAS1 base address */ - #define GPIO1_ALIAS1_BASE (0x50099000u) - /** Peripheral GPIO1_ALIAS1 base address */ - #define GPIO1_ALIAS1_BASE_NS (0x40099000u) - /** Peripheral GPIO1_ALIAS1 base pointer */ - #define GPIO1_ALIAS1 ((GPIO_Type *)GPIO1_ALIAS1_BASE) - /** Peripheral GPIO1_ALIAS1 base pointer */ - #define GPIO1_ALIAS1_NS ((GPIO_Type *)GPIO1_ALIAS1_BASE_NS) - /** Peripheral GPIO2 base address */ - #define GPIO2_BASE (0x5009A000u) - /** Peripheral GPIO2 base address */ - #define GPIO2_BASE_NS (0x4009A000u) - /** Peripheral GPIO2 base pointer */ - #define GPIO2 ((GPIO_Type *)GPIO2_BASE) - /** Peripheral GPIO2 base pointer */ - #define GPIO2_NS ((GPIO_Type *)GPIO2_BASE_NS) - /** Peripheral GPIO2_ALIAS1 base address */ - #define GPIO2_ALIAS1_BASE (0x5009B000u) - /** Peripheral GPIO2_ALIAS1 base address */ - #define GPIO2_ALIAS1_BASE_NS (0x4009B000u) - /** Peripheral GPIO2_ALIAS1 base pointer */ - #define GPIO2_ALIAS1 ((GPIO_Type *)GPIO2_ALIAS1_BASE) - /** Peripheral GPIO2_ALIAS1 base pointer */ - #define GPIO2_ALIAS1_NS ((GPIO_Type *)GPIO2_ALIAS1_BASE_NS) - /** Peripheral GPIO3 base address */ - #define GPIO3_BASE (0x5009C000u) - /** Peripheral GPIO3 base address */ - #define GPIO3_BASE_NS (0x4009C000u) - /** Peripheral GPIO3 base pointer */ - #define GPIO3 ((GPIO_Type *)GPIO3_BASE) - /** Peripheral GPIO3 base pointer */ - #define GPIO3_NS ((GPIO_Type *)GPIO3_BASE_NS) - /** Peripheral GPIO3_ALIAS1 base address */ - #define GPIO3_ALIAS1_BASE (0x5009D000u) - /** Peripheral GPIO3_ALIAS1 base address */ - #define GPIO3_ALIAS1_BASE_NS (0x4009D000u) - /** Peripheral GPIO3_ALIAS1 base pointer */ - #define GPIO3_ALIAS1 ((GPIO_Type *)GPIO3_ALIAS1_BASE) - /** Peripheral GPIO3_ALIAS1 base pointer */ - #define GPIO3_ALIAS1_NS ((GPIO_Type *)GPIO3_ALIAS1_BASE_NS) - /** Peripheral GPIO4 base address */ - #define GPIO4_BASE (0x5009E000u) - /** Peripheral GPIO4 base address */ - #define GPIO4_BASE_NS (0x4009E000u) - /** Peripheral GPIO4 base pointer */ - #define GPIO4 ((GPIO_Type *)GPIO4_BASE) - /** Peripheral GPIO4 base pointer */ - #define GPIO4_NS ((GPIO_Type *)GPIO4_BASE_NS) - /** Peripheral GPIO4_ALIAS1 base address */ - #define GPIO4_ALIAS1_BASE (0x5009F000u) - /** Peripheral GPIO4_ALIAS1 base address */ - #define GPIO4_ALIAS1_BASE_NS (0x4009F000u) - /** Peripheral GPIO4_ALIAS1 base pointer */ - #define GPIO4_ALIAS1 ((GPIO_Type *)GPIO4_ALIAS1_BASE) - /** Peripheral GPIO4_ALIAS1 base pointer */ - #define GPIO4_ALIAS1_NS ((GPIO_Type *)GPIO4_ALIAS1_BASE_NS) - /** Peripheral GPIO5 base address */ - #define GPIO5_BASE (0x50040000u) - /** Peripheral GPIO5 base address */ - #define GPIO5_BASE_NS (0x40040000u) - /** Peripheral GPIO5 base pointer */ - #define GPIO5 ((GPIO_Type *)GPIO5_BASE) - /** Peripheral GPIO5 base pointer */ - #define GPIO5_NS ((GPIO_Type *)GPIO5_BASE_NS) - /** Peripheral GPIO5_ALIAS1 base address */ - #define GPIO5_ALIAS1_BASE (0x50041000u) - /** Peripheral GPIO5_ALIAS1 base address */ - #define GPIO5_ALIAS1_BASE_NS (0x40041000u) - /** Peripheral GPIO5_ALIAS1 base pointer */ - #define GPIO5_ALIAS1 ((GPIO_Type *)GPIO5_ALIAS1_BASE) - /** Peripheral GPIO5_ALIAS1 base pointer */ - #define GPIO5_ALIAS1_NS ((GPIO_Type *)GPIO5_ALIAS1_BASE_NS) - /** Array initializer of GPIO peripheral base addresses */ - #define GPIO_BASE_ADDRS { GPIO0_BASE, GPIO1_BASE, GPIO2_BASE, GPIO3_BASE, GPIO4_BASE, GPIO5_BASE } - #define GPIO_ALIAS1_BASE_ADDRS { GPIO0_ALIAS1_BASE, GPIO1_ALIAS1_BASE, GPIO2_ALIAS1_BASE, GPIO3_ALIAS1_BASE, GPIO4_ALIAS1_BASE, GPIO5_ALIAS1_BASE } - /** Array initializer of GPIO peripheral base pointers */ - #define GPIO_BASE_PTRS { GPIO0, GPIO1, GPIO2, GPIO3, GPIO4, GPIO5 } - #define GPIO_ALIAS1_BASE_PTRS { GPIO0_ALIAS1, GPIO1_ALIAS1, GPIO2_ALIAS1, GPIO3_ALIAS1, GPIO4_ALIAS1, GPIO5_ALIAS1 } - /** Array initializer of GPIO peripheral base addresses */ - #define GPIO_BASE_ADDRS_NS { GPIO0_BASE_NS, GPIO1_BASE_NS, GPIO2_BASE_NS, GPIO3_BASE_NS, GPIO4_BASE_NS, GPIO5_BASE_NS } - #define GPIO_ALIAS1_BASE_ADDRS_NS { GPIO0_ALIAS1_BASE_NS, GPIO1_ALIAS1_BASE_NS, GPIO2_ALIAS1_BASE_NS, GPIO3_ALIAS1_BASE_NS, GPIO4_ALIAS1_BASE_NS, GPIO5_ALIAS1_BASE_NS } - /** Array initializer of GPIO peripheral base pointers */ - #define GPIO_BASE_PTRS_NS { GPIO0_NS, GPIO1_NS, GPIO2_NS, GPIO3_NS, GPIO4_NS, GPIO5_NS } - #define GPIO_ALIAS1_BASE_PTRS_NS { GPIO0_ALIAS1_NS, GPIO1_ALIAS1_NS, GPIO2_ALIAS1_NS, GPIO3_ALIAS1_NS, GPIO4_ALIAS1_NS, GPIO5_ALIAS1_NS } -#else - /** Peripheral GPIO0 base address */ - #define GPIO0_BASE (0x40096000u) - /** Peripheral GPIO0 base pointer */ - #define GPIO0 ((GPIO_Type *)GPIO0_BASE) - /** Peripheral GPIO0_ALIAS1 base address */ - #define GPIO0_ALIAS1_BASE (0x40097000u) - /** Peripheral GPIO0_ALIAS1 base pointer */ - #define GPIO0_ALIAS1 ((GPIO_Type *)GPIO0_ALIAS1_BASE) - /** Peripheral GPIO1 base address */ - #define GPIO1_BASE (0x40098000u) - /** Peripheral GPIO1 base pointer */ - #define GPIO1 ((GPIO_Type *)GPIO1_BASE) - /** Peripheral GPIO1_ALIAS1 base address */ - #define GPIO1_ALIAS1_BASE (0x40099000u) - /** Peripheral GPIO1_ALIAS1 base pointer */ - #define GPIO1_ALIAS1 ((GPIO_Type *)GPIO1_ALIAS1_BASE) - /** Peripheral GPIO2 base address */ - #define GPIO2_BASE (0x4009A000u) - /** Peripheral GPIO2 base pointer */ - #define GPIO2 ((GPIO_Type *)GPIO2_BASE) - /** Peripheral GPIO2_ALIAS1 base address */ - #define GPIO2_ALIAS1_BASE (0x4009B000u) - /** Peripheral GPIO2_ALIAS1 base pointer */ - #define GPIO2_ALIAS1 ((GPIO_Type *)GPIO2_ALIAS1_BASE) - /** Peripheral GPIO3 base address */ - #define GPIO3_BASE (0x4009C000u) - /** Peripheral GPIO3 base pointer */ - #define GPIO3 ((GPIO_Type *)GPIO3_BASE) - /** Peripheral GPIO3_ALIAS1 base address */ - #define GPIO3_ALIAS1_BASE (0x4009D000u) - /** Peripheral GPIO3_ALIAS1 base pointer */ - #define GPIO3_ALIAS1 ((GPIO_Type *)GPIO3_ALIAS1_BASE) - /** Peripheral GPIO4 base address */ - #define GPIO4_BASE (0x4009E000u) - /** Peripheral GPIO4 base pointer */ - #define GPIO4 ((GPIO_Type *)GPIO4_BASE) - /** Peripheral GPIO4_ALIAS1 base address */ - #define GPIO4_ALIAS1_BASE (0x4009F000u) - /** Peripheral GPIO4_ALIAS1 base pointer */ - #define GPIO4_ALIAS1 ((GPIO_Type *)GPIO4_ALIAS1_BASE) - /** Peripheral GPIO5 base address */ - #define GPIO5_BASE (0x40040000u) - /** Peripheral GPIO5 base pointer */ - #define GPIO5 ((GPIO_Type *)GPIO5_BASE) - /** Peripheral GPIO5_ALIAS1 base address */ - #define GPIO5_ALIAS1_BASE (0x40041000u) - /** Peripheral GPIO5_ALIAS1 base pointer */ - #define GPIO5_ALIAS1 ((GPIO_Type *)GPIO5_ALIAS1_BASE) - /** Array initializer of GPIO peripheral base addresses */ - #define GPIO_BASE_ADDRS { GPIO0_BASE, GPIO1_BASE, GPIO2_BASE, GPIO3_BASE, GPIO4_BASE, GPIO5_BASE } - #define GPIO_ALIAS1_BASE_ADDRS { GPIO0_ALIAS1_BASE, GPIO1_ALIAS1_BASE, GPIO2_ALIAS1_BASE, GPIO3_ALIAS1_BASE, GPIO4_ALIAS1_BASE, GPIO5_ALIAS1_BASE } - /** Array initializer of GPIO peripheral base pointers */ - #define GPIO_BASE_PTRS { GPIO0, GPIO1, GPIO2, GPIO3, GPIO4, GPIO5 } - #define GPIO_ALIAS1_BASE_PTRS { GPIO0_ALIAS1, GPIO1_ALIAS1, GPIO2_ALIAS1, GPIO3_ALIAS1, GPIO4_ALIAS1, GPIO5_ALIAS1 } -#endif -/* Interrupt vectors for the GPIO peripheral type */ -#define GPIO_IRQS {GPIO00_IRQn, GPIO10_IRQn, GPIO20_IRQn, GPIO30_IRQn,GPIO40_IRQn,GPIO50_IRQn} -#define GPIO_IRQS_1 {GPIO01_IRQn, GPIO11_IRQn, GPIO21_IRQn, GPIO31_IRQn,GPIO41_IRQn,GPIO51_IRQn} - - -/*! - * @} - */ /* end of group GPIO_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- HPDAC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup HPDAC_Peripheral_Access_Layer HPDAC Peripheral Access Layer - * @{ - */ - -/** HPDAC - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version Identifier, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - __O uint32_t DATA; /**< Data, offset: 0x8 */ - __IO uint32_t GCR; /**< Global Control, offset: 0xC */ - __IO uint32_t FCR; /**< DAC FIFO Control, offset: 0x10 */ - __I uint32_t FPR; /**< DAC FIFO Pointer, offset: 0x14 */ - __IO uint32_t FSR; /**< FIFO Status, offset: 0x18 */ - __IO uint32_t IER; /**< Interrupt Enable, offset: 0x1C */ - __IO uint32_t DER; /**< DMA Enable, offset: 0x20 */ - __IO uint32_t RCR; /**< Reset Control, offset: 0x24 */ - __O uint32_t TCR; /**< Trigger Control, offset: 0x28 */ - __IO uint32_t PCR; /**< Periodic Trigger Control, offset: 0x2C */ -} HPDAC_Type; - -/* ---------------------------------------------------------------------------- - -- HPDAC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup HPDAC_Register_Masks HPDAC Register Masks - * @{ - */ - -/*! @name VERID - Version Identifier */ -/*! @{ */ - -#define HPDAC_VERID_FEATURE_MASK (0xFFFFU) -#define HPDAC_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Identification Number */ -#define HPDAC_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_VERID_FEATURE_SHIFT)) & HPDAC_VERID_FEATURE_MASK) - -#define HPDAC_VERID_MINOR_MASK (0xFF0000U) -#define HPDAC_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define HPDAC_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_VERID_MINOR_SHIFT)) & HPDAC_VERID_MINOR_MASK) - -#define HPDAC_VERID_MAJOR_MASK (0xFF000000U) -#define HPDAC_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define HPDAC_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_VERID_MAJOR_SHIFT)) & HPDAC_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define HPDAC_PARAM_FIFOSZ_MASK (0x7U) -#define HPDAC_PARAM_FIFOSZ_SHIFT (0U) -/*! FIFOSZ - FIFO Size - * 0b000..Reserved - * 0b001..FIFO depth is 4 - * 0b010..FIFO depth is 8 - * 0b011..FIFO depth is 16 - * 0b100..FIFO depth is 32 - * 0b101..FIFO depth is 64 - * 0b110..FIFO depth is 128 - * 0b111..FIFO depth is 256 - */ -#define HPDAC_PARAM_FIFOSZ(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_PARAM_FIFOSZ_SHIFT)) & HPDAC_PARAM_FIFOSZ_MASK) -/*! @} */ - -/*! @name DATA - Data */ -/*! @{ */ - -#define HPDAC_DATA_DATA_MASK (0x3FFFU) -#define HPDAC_DATA_DATA_SHIFT (0U) -/*! DATA - FIFO Entry or Buffer Entry */ -#define HPDAC_DATA_DATA(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_DATA_DATA_SHIFT)) & HPDAC_DATA_DATA_MASK) -/*! @} */ - -/*! @name GCR - Global Control */ -/*! @{ */ - -#define HPDAC_GCR_DACEN_MASK (0x1U) -#define HPDAC_GCR_DACEN_SHIFT (0U) -/*! DACEN - DAC Enable - * 0b0..Disables - * 0b1..Enables - */ -#define HPDAC_GCR_DACEN(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_GCR_DACEN_SHIFT)) & HPDAC_GCR_DACEN_MASK) - -#define HPDAC_GCR_FIFOEN_MASK (0x8U) -#define HPDAC_GCR_FIFOEN_SHIFT (3U) -/*! FIFOEN - FIFO Enable - * 0b0..Enables FIFO mode and disables Buffer mode. Any data written to DATA[DATA] goes to buffer then goes to conversion. - * 0b1..Enables FIFO mode. Data will be first read from FIFO to buffer and then goes to conversion. - */ -#define HPDAC_GCR_FIFOEN(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_GCR_FIFOEN_SHIFT)) & HPDAC_GCR_FIFOEN_MASK) - -#define HPDAC_GCR_SWMD_MASK (0x10U) -#define HPDAC_GCR_SWMD_SHIFT (4U) -/*! SWMD - Swing Back Mode - * 0b0..Disables - * 0b1..Enables - */ -#define HPDAC_GCR_SWMD(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_GCR_SWMD_SHIFT)) & HPDAC_GCR_SWMD_MASK) - -#define HPDAC_GCR_TRGSEL_MASK (0x20U) -#define HPDAC_GCR_TRGSEL_SHIFT (5U) -/*! TRGSEL - DAC Trigger Select - * 0b0..Hardware trigger - * 0b1..Software trigger - */ -#define HPDAC_GCR_TRGSEL(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_GCR_TRGSEL_SHIFT)) & HPDAC_GCR_TRGSEL_MASK) - -#define HPDAC_GCR_PTGEN_MASK (0x40U) -#define HPDAC_GCR_PTGEN_SHIFT (6U) -/*! PTGEN - DAC Periodic Trigger Mode Enable - * 0b0..Disables - * 0b1..Enables - */ -#define HPDAC_GCR_PTGEN(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_GCR_PTGEN_SHIFT)) & HPDAC_GCR_PTGEN_MASK) - -#define HPDAC_GCR_BUF_EN_MASK (0x20000U) -#define HPDAC_GCR_BUF_EN_SHIFT (17U) -/*! BUF_EN - Buffer Enable - * 0b0..Not used - * 0b1..Used - */ -#define HPDAC_GCR_BUF_EN(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_GCR_BUF_EN_SHIFT)) & HPDAC_GCR_BUF_EN_MASK) -/*! @} */ - -/*! @name FCR - DAC FIFO Control */ -/*! @{ */ - -#define HPDAC_FCR_WML_MASK (0x1FU) -#define HPDAC_FCR_WML_SHIFT (0U) -/*! WML - Watermark Level */ -#define HPDAC_FCR_WML(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_FCR_WML_SHIFT)) & HPDAC_FCR_WML_MASK) -/*! @} */ - -/*! @name FPR - DAC FIFO Pointer */ -/*! @{ */ - -#define HPDAC_FPR_FIFO_RPT_MASK (0x1FU) -#define HPDAC_FPR_FIFO_RPT_SHIFT (0U) -/*! FIFO_RPT - FIFO Read Pointer */ -#define HPDAC_FPR_FIFO_RPT(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_FPR_FIFO_RPT_SHIFT)) & HPDAC_FPR_FIFO_RPT_MASK) - -#define HPDAC_FPR_FIFO_WPT_MASK (0x1F0000U) -#define HPDAC_FPR_FIFO_WPT_SHIFT (16U) -/*! FIFO_WPT - FIFO Write Pointer */ -#define HPDAC_FPR_FIFO_WPT(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_FPR_FIFO_WPT_SHIFT)) & HPDAC_FPR_FIFO_WPT_MASK) -/*! @} */ - -/*! @name FSR - FIFO Status */ -/*! @{ */ - -#define HPDAC_FSR_FULL_MASK (0x1U) -#define HPDAC_FSR_FULL_SHIFT (0U) -/*! FULL - FIFO Full Flag - * 0b0..Not full - * 0b1..Full - */ -#define HPDAC_FSR_FULL(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_FSR_FULL_SHIFT)) & HPDAC_FSR_FULL_MASK) - -#define HPDAC_FSR_EMPTY_MASK (0x2U) -#define HPDAC_FSR_EMPTY_SHIFT (1U) -/*! EMPTY - FIFO Empty Flag - * 0b0..Not empty - * 0b1..Empty - */ -#define HPDAC_FSR_EMPTY(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_FSR_EMPTY_SHIFT)) & HPDAC_FSR_EMPTY_MASK) - -#define HPDAC_FSR_WM_MASK (0x4U) -#define HPDAC_FSR_WM_SHIFT (2U) -/*! WM - FIFO Watermark Status Flag - * 0b0..Data in FIFO is more than watermark level - * 0b1..Data in FIFO is less than or equal to watermark level - */ -#define HPDAC_FSR_WM(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_FSR_WM_SHIFT)) & HPDAC_FSR_WM_MASK) - -#define HPDAC_FSR_SWBK_MASK (0x8U) -#define HPDAC_FSR_SWBK_SHIFT (3U) -/*! SWBK - Swing Back One Cycle Complete Flag - * 0b0..No swing back cycle has completed since the last time the flag was cleared - * 0b1..At least one swing back cycle has occurred since the last time the flag was cleared - */ -#define HPDAC_FSR_SWBK(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_FSR_SWBK_SHIFT)) & HPDAC_FSR_SWBK_MASK) - -#define HPDAC_FSR_OF_MASK (0x40U) -#define HPDAC_FSR_OF_SHIFT (6U) -/*! OF - FIFO Overflow Flag - * 0b0..No overflow has occurred since the last time the flag was cleared - * 0b1..At least one FIFO overflow has occurred since the last time the flag was cleared - */ -#define HPDAC_FSR_OF(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_FSR_OF_SHIFT)) & HPDAC_FSR_OF_MASK) - -#define HPDAC_FSR_UF_MASK (0x80U) -#define HPDAC_FSR_UF_SHIFT (7U) -/*! UF - FIFO Underflow Flag - * 0b0..No underflow has occurred since the last time the flag was cleared - * 0b1..At least one trigger underflow has occurred since the last time the flag was cleared - */ -#define HPDAC_FSR_UF(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_FSR_UF_SHIFT)) & HPDAC_FSR_UF_MASK) - -#define HPDAC_FSR_PTGCOCO_MASK (0x100U) -#define HPDAC_FSR_PTGCOCO_SHIFT (8U) -/*! PTGCOCO - Period Trigger Mode Conversion Complete Flag - * 0b0..Not completed or not started - * 0b1..Completed - */ -#define HPDAC_FSR_PTGCOCO(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_FSR_PTGCOCO_SHIFT)) & HPDAC_FSR_PTGCOCO_MASK) -/*! @} */ - -/*! @name IER - Interrupt Enable */ -/*! @{ */ - -#define HPDAC_IER_FULL_IE_MASK (0x1U) -#define HPDAC_IER_FULL_IE_SHIFT (0U) -/*! FULL_IE - FIFO Full Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define HPDAC_IER_FULL_IE(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_IER_FULL_IE_SHIFT)) & HPDAC_IER_FULL_IE_MASK) - -#define HPDAC_IER_EMPTY_IE_MASK (0x2U) -#define HPDAC_IER_EMPTY_IE_SHIFT (1U) -/*! EMPTY_IE - FIFO Empty Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define HPDAC_IER_EMPTY_IE(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_IER_EMPTY_IE_SHIFT)) & HPDAC_IER_EMPTY_IE_MASK) - -#define HPDAC_IER_WM_IE_MASK (0x4U) -#define HPDAC_IER_WM_IE_SHIFT (2U) -/*! WM_IE - FIFO Watermark Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define HPDAC_IER_WM_IE(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_IER_WM_IE_SHIFT)) & HPDAC_IER_WM_IE_MASK) - -#define HPDAC_IER_SWBK_IE_MASK (0x8U) -#define HPDAC_IER_SWBK_IE_SHIFT (3U) -/*! SWBK_IE - Swing Back One Cycle Complete Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define HPDAC_IER_SWBK_IE(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_IER_SWBK_IE_SHIFT)) & HPDAC_IER_SWBK_IE_MASK) - -#define HPDAC_IER_OF_IE_MASK (0x40U) -#define HPDAC_IER_OF_IE_SHIFT (6U) -/*! OF_IE - FIFO Overflow Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define HPDAC_IER_OF_IE(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_IER_OF_IE_SHIFT)) & HPDAC_IER_OF_IE_MASK) - -#define HPDAC_IER_UF_IE_MASK (0x80U) -#define HPDAC_IER_UF_IE_SHIFT (7U) -/*! UF_IE - FIFO Underflow Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define HPDAC_IER_UF_IE(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_IER_UF_IE_SHIFT)) & HPDAC_IER_UF_IE_MASK) - -#define HPDAC_IER_PTGCOCO_IE_MASK (0x100U) -#define HPDAC_IER_PTGCOCO_IE_SHIFT (8U) -/*! PTGCOCO_IE - PTG Mode Conversion Complete Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define HPDAC_IER_PTGCOCO_IE(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_IER_PTGCOCO_IE_SHIFT)) & HPDAC_IER_PTGCOCO_IE_MASK) -/*! @} */ - -/*! @name DER - DMA Enable */ -/*! @{ */ - -#define HPDAC_DER_EMPTY_DMAEN_MASK (0x2U) -#define HPDAC_DER_EMPTY_DMAEN_SHIFT (1U) -/*! EMPTY_DMAEN - FIFO Empty DMA Enable - * 0b0..Disables - * 0b1..Enables - */ -#define HPDAC_DER_EMPTY_DMAEN(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_DER_EMPTY_DMAEN_SHIFT)) & HPDAC_DER_EMPTY_DMAEN_MASK) - -#define HPDAC_DER_WM_DMAEN_MASK (0x4U) -#define HPDAC_DER_WM_DMAEN_SHIFT (2U) -/*! WM_DMAEN - FIFO Watermark DMA Enable - * 0b0..Disables - * 0b1..Enables - */ -#define HPDAC_DER_WM_DMAEN(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_DER_WM_DMAEN_SHIFT)) & HPDAC_DER_WM_DMAEN_MASK) -/*! @} */ - -/*! @name RCR - Reset Control */ -/*! @{ */ - -#define HPDAC_RCR_SWRST_MASK (0x1U) -#define HPDAC_RCR_SWRST_SHIFT (0U) -/*! SWRST - Software Reset - * 0b0..No effect - * 0b1..Software reset - */ -#define HPDAC_RCR_SWRST(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_RCR_SWRST_SHIFT)) & HPDAC_RCR_SWRST_MASK) - -#define HPDAC_RCR_FIFORST_MASK (0x2U) -#define HPDAC_RCR_FIFORST_SHIFT (1U) -/*! FIFORST - FIFO Reset - * 0b0..No effect - * 0b1..FIFO reset - */ -#define HPDAC_RCR_FIFORST(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_RCR_FIFORST_SHIFT)) & HPDAC_RCR_FIFORST_MASK) -/*! @} */ - -/*! @name TCR - Trigger Control */ -/*! @{ */ - -#define HPDAC_TCR_SWTRG_MASK (0x1U) -#define HPDAC_TCR_SWTRG_SHIFT (0U) -/*! SWTRG - Software Trigger - * 0b0..Not valid - * 0b1..Valid - */ -#define HPDAC_TCR_SWTRG(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_TCR_SWTRG_SHIFT)) & HPDAC_TCR_SWTRG_MASK) -/*! @} */ - -/*! @name PCR - Periodic Trigger Control */ -/*! @{ */ - -#define HPDAC_PCR_PTG_NUM_MASK (0xFFFFU) -#define HPDAC_PCR_PTG_NUM_SHIFT (0U) -/*! PTG_NUM - Periodic Trigger Number */ -#define HPDAC_PCR_PTG_NUM(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_PCR_PTG_NUM_SHIFT)) & HPDAC_PCR_PTG_NUM_MASK) - -#define HPDAC_PCR_PTG_PERIOD_MASK (0xFFFF0000U) -#define HPDAC_PCR_PTG_PERIOD_SHIFT (16U) -/*! PTG_PERIOD - Periodic Trigger Period Width */ -#define HPDAC_PCR_PTG_PERIOD(x) (((uint32_t)(((uint32_t)(x)) << HPDAC_PCR_PTG_PERIOD_SHIFT)) & HPDAC_PCR_PTG_PERIOD_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group HPDAC_Register_Masks */ - - -/* HPDAC - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral DAC2 base address */ - #define DAC2_BASE (0x50114000u) - /** Peripheral DAC2 base address */ - #define DAC2_BASE_NS (0x40114000u) - /** Peripheral DAC2 base pointer */ - #define DAC2 ((HPDAC_Type *)DAC2_BASE) - /** Peripheral DAC2 base pointer */ - #define DAC2_NS ((HPDAC_Type *)DAC2_BASE_NS) - /** Array initializer of HPDAC peripheral base addresses */ - #define HPDAC_BASE_ADDRS { DAC2_BASE } - /** Array initializer of HPDAC peripheral base pointers */ - #define HPDAC_BASE_PTRS { DAC2 } - /** Array initializer of HPDAC peripheral base addresses */ - #define HPDAC_BASE_ADDRS_NS { DAC2_BASE_NS } - /** Array initializer of HPDAC peripheral base pointers */ - #define HPDAC_BASE_PTRS_NS { DAC2_NS } -#else - /** Peripheral DAC2 base address */ - #define DAC2_BASE (0x40114000u) - /** Peripheral DAC2 base pointer */ - #define DAC2 ((HPDAC_Type *)DAC2_BASE) - /** Array initializer of HPDAC peripheral base addresses */ - #define HPDAC_BASE_ADDRS { DAC2_BASE } - /** Array initializer of HPDAC peripheral base pointers */ - #define HPDAC_BASE_PTRS { DAC2 } -#endif - -/*! - * @} - */ /* end of group HPDAC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- I2S Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup I2S_Peripheral_Access_Layer I2S Peripheral Access Layer - * @{ - */ - -/** I2S - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - __IO uint32_t TCSR; /**< Transmit Control, offset: 0x8 */ - __IO uint32_t TCR1; /**< Transmit Configuration 1, offset: 0xC */ - __IO uint32_t TCR2; /**< Transmit Configuration 2, offset: 0x10 */ - __IO uint32_t TCR3; /**< Transmit Configuration 3, offset: 0x14 */ - __IO uint32_t TCR4; /**< Transmit Configuration 4, offset: 0x18 */ - __IO uint32_t TCR5; /**< Transmit Configuration 5, offset: 0x1C */ - __O uint32_t TDR[2]; /**< Transmit Data, array offset: 0x20, array step: 0x4 */ - uint8_t RESERVED_0[24]; - __I uint32_t TFR[2]; /**< Transmit FIFO, array offset: 0x40, array step: 0x4 */ - uint8_t RESERVED_1[24]; - __IO uint32_t TMR; /**< Transmit Mask, offset: 0x60 */ - uint8_t RESERVED_2[36]; - __IO uint32_t RCSR; /**< Receive Control, offset: 0x88 */ - __IO uint32_t RCR1; /**< Receive Configuration 1, offset: 0x8C */ - __IO uint32_t RCR2; /**< Receive Configuration 2, offset: 0x90 */ - __IO uint32_t RCR3; /**< Receive Configuration 3, offset: 0x94 */ - __IO uint32_t RCR4; /**< Receive Configuration 4, offset: 0x98 */ - __IO uint32_t RCR5; /**< Receive Configuration 5, offset: 0x9C */ - __I uint32_t RDR[2]; /**< Receive Data, array offset: 0xA0, array step: 0x4 */ - uint8_t RESERVED_3[24]; - __I uint32_t RFR[2]; /**< Receive FIFO, array offset: 0xC0, array step: 0x4 */ - uint8_t RESERVED_4[24]; - __IO uint32_t RMR; /**< Receive Mask, offset: 0xE0 */ - uint8_t RESERVED_5[28]; - __IO uint32_t MCR; /**< MCLK Control, offset: 0x100 */ -} I2S_Type; - -/* ---------------------------------------------------------------------------- - -- I2S Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup I2S_Register_Masks I2S Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define I2S_VERID_FEATURE_MASK (0xFFFFU) -#define I2S_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Standard feature set - */ -#define I2S_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << I2S_VERID_FEATURE_SHIFT)) & I2S_VERID_FEATURE_MASK) - -#define I2S_VERID_MINOR_MASK (0xFF0000U) -#define I2S_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define I2S_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << I2S_VERID_MINOR_SHIFT)) & I2S_VERID_MINOR_MASK) - -#define I2S_VERID_MAJOR_MASK (0xFF000000U) -#define I2S_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define I2S_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << I2S_VERID_MAJOR_SHIFT)) & I2S_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define I2S_PARAM_DATALINE_MASK (0xFU) -#define I2S_PARAM_DATALINE_SHIFT (0U) -/*! DATALINE - Number of Data Lines */ -#define I2S_PARAM_DATALINE(x) (((uint32_t)(((uint32_t)(x)) << I2S_PARAM_DATALINE_SHIFT)) & I2S_PARAM_DATALINE_MASK) - -#define I2S_PARAM_FIFO_MASK (0xF00U) -#define I2S_PARAM_FIFO_SHIFT (8U) -/*! FIFO - FIFO Size */ -#define I2S_PARAM_FIFO(x) (((uint32_t)(((uint32_t)(x)) << I2S_PARAM_FIFO_SHIFT)) & I2S_PARAM_FIFO_MASK) - -#define I2S_PARAM_FRAME_MASK (0xF0000U) -#define I2S_PARAM_FRAME_SHIFT (16U) -/*! FRAME - Frame Size */ -#define I2S_PARAM_FRAME(x) (((uint32_t)(((uint32_t)(x)) << I2S_PARAM_FRAME_SHIFT)) & I2S_PARAM_FRAME_MASK) -/*! @} */ - -/*! @name TCSR - Transmit Control */ -/*! @{ */ - -#define I2S_TCSR_FRDE_MASK (0x1U) -#define I2S_TCSR_FRDE_SHIFT (0U) -/*! FRDE - FIFO Request DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCSR_FRDE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FRDE_SHIFT)) & I2S_TCSR_FRDE_MASK) - -#define I2S_TCSR_FWDE_MASK (0x2U) -#define I2S_TCSR_FWDE_SHIFT (1U) -/*! FWDE - FIFO Warning DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCSR_FWDE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FWDE_SHIFT)) & I2S_TCSR_FWDE_MASK) - -#define I2S_TCSR_FRIE_MASK (0x100U) -#define I2S_TCSR_FRIE_SHIFT (8U) -/*! FRIE - FIFO Request Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCSR_FRIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FRIE_SHIFT)) & I2S_TCSR_FRIE_MASK) - -#define I2S_TCSR_FWIE_MASK (0x200U) -#define I2S_TCSR_FWIE_SHIFT (9U) -/*! FWIE - FIFO Warning Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCSR_FWIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FWIE_SHIFT)) & I2S_TCSR_FWIE_MASK) - -#define I2S_TCSR_FEIE_MASK (0x400U) -#define I2S_TCSR_FEIE_SHIFT (10U) -/*! FEIE - FIFO Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCSR_FEIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FEIE_SHIFT)) & I2S_TCSR_FEIE_MASK) - -#define I2S_TCSR_SEIE_MASK (0x800U) -#define I2S_TCSR_SEIE_SHIFT (11U) -/*! SEIE - Sync Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCSR_SEIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_SEIE_SHIFT)) & I2S_TCSR_SEIE_MASK) - -#define I2S_TCSR_WSIE_MASK (0x1000U) -#define I2S_TCSR_WSIE_SHIFT (12U) -/*! WSIE - Word Start Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCSR_WSIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_WSIE_SHIFT)) & I2S_TCSR_WSIE_MASK) - -#define I2S_TCSR_FRF_MASK (0x10000U) -#define I2S_TCSR_FRF_SHIFT (16U) -/*! FRF - FIFO Request Flag - * 0b0..Watermark not reached - * 0b1..Watermark reached - */ -#define I2S_TCSR_FRF(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FRF_SHIFT)) & I2S_TCSR_FRF_MASK) - -#define I2S_TCSR_FWF_MASK (0x20000U) -#define I2S_TCSR_FWF_SHIFT (17U) -/*! FWF - FIFO Warning Flag - * 0b0..Not empty - * 0b1..Empty - */ -#define I2S_TCSR_FWF(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FWF_SHIFT)) & I2S_TCSR_FWF_MASK) - -#define I2S_TCSR_FEF_MASK (0x40000U) -#define I2S_TCSR_FEF_SHIFT (18U) -/*! FEF - FIFO Error Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I2S_TCSR_FEF(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FEF_SHIFT)) & I2S_TCSR_FEF_MASK) - -#define I2S_TCSR_SEF_MASK (0x80000U) -#define I2S_TCSR_SEF_SHIFT (19U) -/*! SEF - Sync Error Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I2S_TCSR_SEF(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_SEF_SHIFT)) & I2S_TCSR_SEF_MASK) - -#define I2S_TCSR_WSF_MASK (0x100000U) -#define I2S_TCSR_WSF_SHIFT (20U) -/*! WSF - Word Start Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I2S_TCSR_WSF(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_WSF_SHIFT)) & I2S_TCSR_WSF_MASK) - -#define I2S_TCSR_SR_MASK (0x1000000U) -#define I2S_TCSR_SR_SHIFT (24U) -/*! SR - Software Reset - * 0b0..No effect - * 0b1..Software reset - */ -#define I2S_TCSR_SR(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_SR_SHIFT)) & I2S_TCSR_SR_MASK) - -#define I2S_TCSR_FR_MASK (0x2000000U) -#define I2S_TCSR_FR_SHIFT (25U) -/*! FR - FIFO Reset - * 0b0..No effect - * 0b1..FIFO reset - */ -#define I2S_TCSR_FR(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_FR_SHIFT)) & I2S_TCSR_FR_MASK) - -#define I2S_TCSR_BCE_MASK (0x10000000U) -#define I2S_TCSR_BCE_SHIFT (28U) -/*! BCE - Bit Clock Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCSR_BCE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_BCE_SHIFT)) & I2S_TCSR_BCE_MASK) - -#define I2S_TCSR_DBGE_MASK (0x20000000U) -#define I2S_TCSR_DBGE_SHIFT (29U) -/*! DBGE - Debug Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCSR_DBGE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_DBGE_SHIFT)) & I2S_TCSR_DBGE_MASK) - -#define I2S_TCSR_STOPE_MASK (0x40000000U) -#define I2S_TCSR_STOPE_SHIFT (30U) -/*! STOPE - Stop Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCSR_STOPE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_STOPE_SHIFT)) & I2S_TCSR_STOPE_MASK) - -#define I2S_TCSR_TE_MASK (0x80000000U) -#define I2S_TCSR_TE_SHIFT (31U) -/*! TE - Transmitter Enable - * 0b0..Disable - * 0b1..Enable (or transmitter has been disabled and has not yet reached the end of the frame) - */ -#define I2S_TCSR_TE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCSR_TE_SHIFT)) & I2S_TCSR_TE_MASK) -/*! @} */ - -/*! @name TCR1 - Transmit Configuration 1 */ -/*! @{ */ - -#define I2S_TCR1_TFW_MASK (0x7U) -#define I2S_TCR1_TFW_SHIFT (0U) -/*! TFW - Transmit FIFO Watermark - * 0b000..1 - * 0b001..2 - * 0b010-0b110..(TFW +1) - * 0b111..8 - */ -#define I2S_TCR1_TFW(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR1_TFW_SHIFT)) & I2S_TCR1_TFW_MASK) -/*! @} */ - -/*! @name TCR2 - Transmit Configuration 2 */ -/*! @{ */ - -#define I2S_TCR2_DIV_MASK (0xFFU) -#define I2S_TCR2_DIV_SHIFT (0U) -/*! DIV - Bit Clock Divide */ -#define I2S_TCR2_DIV(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_DIV_SHIFT)) & I2S_TCR2_DIV_MASK) - -#define I2S_TCR2_BYP_MASK (0x800000U) -#define I2S_TCR2_BYP_SHIFT (23U) -/*! BYP - Bit Clock Bypass - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCR2_BYP(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_BYP_SHIFT)) & I2S_TCR2_BYP_MASK) - -#define I2S_TCR2_BCD_MASK (0x1000000U) -#define I2S_TCR2_BCD_SHIFT (24U) -/*! BCD - Bit Clock Direction - * 0b0..Generate externally in Target mode - * 0b1..Generate internally in Controller mode - */ -#define I2S_TCR2_BCD(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_BCD_SHIFT)) & I2S_TCR2_BCD_MASK) - -#define I2S_TCR2_BCP_MASK (0x2000000U) -#define I2S_TCR2_BCP_SHIFT (25U) -/*! BCP - Bit Clock Polarity - * 0b0..Active high - * 0b1..Active low - */ -#define I2S_TCR2_BCP(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_BCP_SHIFT)) & I2S_TCR2_BCP_MASK) - -#define I2S_TCR2_MSEL_MASK (0xC000000U) -#define I2S_TCR2_MSEL_SHIFT (26U) -/*! MSEL - MCLK Select - * 0b00..Bus clock - * 0b01..Controller clock (MCLK) option 1 - * 0b10..Controller clock (MCLK) option 2 - * 0b11..Controller clock (MCLK) option 3 - */ -#define I2S_TCR2_MSEL(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_MSEL_SHIFT)) & I2S_TCR2_MSEL_MASK) - -#define I2S_TCR2_BCI_MASK (0x10000000U) -#define I2S_TCR2_BCI_SHIFT (28U) -/*! BCI - Bit Clock Input - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_TCR2_BCI(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_BCI_SHIFT)) & I2S_TCR2_BCI_MASK) - -#define I2S_TCR2_BCS_MASK (0x20000000U) -#define I2S_TCR2_BCS_SHIFT (29U) -/*! BCS - Bit Clock Swap - * 0b0..Use the normal bit clock source - * 0b1..Swap the bit clock source - */ -#define I2S_TCR2_BCS(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_BCS_SHIFT)) & I2S_TCR2_BCS_MASK) - -#define I2S_TCR2_SYNC_MASK (0xC0000000U) -#define I2S_TCR2_SYNC_SHIFT (30U) -/*! SYNC - Synchronous Mode - * 0b00..Asynchronous mode - * 0b01..Synchronous with receiver - * 0b10..Synchronous with another SAI transmitter - * 0b11..Synchronous with another SAI receiver - */ -#define I2S_TCR2_SYNC(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR2_SYNC_SHIFT)) & I2S_TCR2_SYNC_MASK) -/*! @} */ - -/*! @name TCR3 - Transmit Configuration 3 */ -/*! @{ */ - -#define I2S_TCR3_WDFL_MASK (0x1FU) -#define I2S_TCR3_WDFL_SHIFT (0U) -/*! WDFL - Word Flag Configuration */ -#define I2S_TCR3_WDFL(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR3_WDFL_SHIFT)) & I2S_TCR3_WDFL_MASK) - -#define I2S_TCR3_TCE_MASK (0x30000U) -#define I2S_TCR3_TCE_SHIFT (16U) -/*! TCE - Transmit Channel Enable */ -#define I2S_TCR3_TCE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR3_TCE_SHIFT)) & I2S_TCR3_TCE_MASK) - -#define I2S_TCR3_CFR_MASK (0x3000000U) -#define I2S_TCR3_CFR_SHIFT (24U) -/*! CFR - Channel FIFO Reset */ -#define I2S_TCR3_CFR(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR3_CFR_SHIFT)) & I2S_TCR3_CFR_MASK) -/*! @} */ - -/*! @name TCR4 - Transmit Configuration 4 */ -/*! @{ */ - -#define I2S_TCR4_FSD_MASK (0x1U) -#define I2S_TCR4_FSD_SHIFT (0U) -/*! FSD - Frame Sync Direction - * 0b0..Generated externally in Target mode - * 0b1..Generated internally in Controller mode - */ -#define I2S_TCR4_FSD(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_FSD_SHIFT)) & I2S_TCR4_FSD_MASK) - -#define I2S_TCR4_FSP_MASK (0x2U) -#define I2S_TCR4_FSP_SHIFT (1U) -/*! FSP - Frame Sync Polarity - * 0b0..Active high - * 0b1..Active low - */ -#define I2S_TCR4_FSP(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_FSP_SHIFT)) & I2S_TCR4_FSP_MASK) - -#define I2S_TCR4_ONDEM_MASK (0x4U) -#define I2S_TCR4_ONDEM_SHIFT (2U) -/*! ONDEM - On-Demand Mode - * 0b0..Generated continuously - * 0b1..Generated after the FIFO warning flag is cleared - */ -#define I2S_TCR4_ONDEM(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_ONDEM_SHIFT)) & I2S_TCR4_ONDEM_MASK) - -#define I2S_TCR4_FSE_MASK (0x8U) -#define I2S_TCR4_FSE_SHIFT (3U) -/*! FSE - Frame Sync Early - * 0b0..First bit of the frame - * 0b1..One bit before the first bit of the frame - */ -#define I2S_TCR4_FSE(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_FSE_SHIFT)) & I2S_TCR4_FSE_MASK) - -#define I2S_TCR4_MF_MASK (0x10U) -#define I2S_TCR4_MF_SHIFT (4U) -/*! MF - MSB First - * 0b0..LSB - * 0b1..MSB - */ -#define I2S_TCR4_MF(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_MF_SHIFT)) & I2S_TCR4_MF_MASK) - -#define I2S_TCR4_CHMOD_MASK (0x20U) -#define I2S_TCR4_CHMOD_SHIFT (5U) -/*! CHMOD - Channel Mode - * 0b0..TDM mode - * 0b1..Output mode - */ -#define I2S_TCR4_CHMOD(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_CHMOD_SHIFT)) & I2S_TCR4_CHMOD_MASK) - -#define I2S_TCR4_SYWD_MASK (0x1F00U) -#define I2S_TCR4_SYWD_SHIFT (8U) -/*! SYWD - Sync Width */ -#define I2S_TCR4_SYWD(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_SYWD_SHIFT)) & I2S_TCR4_SYWD_MASK) - -#define I2S_TCR4_FRSZ_MASK (0x1F0000U) -#define I2S_TCR4_FRSZ_SHIFT (16U) -/*! FRSZ - Frame Size */ -#define I2S_TCR4_FRSZ(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_FRSZ_SHIFT)) & I2S_TCR4_FRSZ_MASK) - -#define I2S_TCR4_FPACK_MASK (0x3000000U) -#define I2S_TCR4_FPACK_SHIFT (24U) -/*! FPACK - FIFO Packing Mode - * 0b00..Disable FIFO packing - * 0b01..Reserved - * 0b10..Enable 8-bit FIFO packing - * 0b11..Enable 16-bit FIFO packing - */ -#define I2S_TCR4_FPACK(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_FPACK_SHIFT)) & I2S_TCR4_FPACK_MASK) - -#define I2S_TCR4_FCOMB_MASK (0xC000000U) -#define I2S_TCR4_FCOMB_SHIFT (26U) -/*! FCOMB - FIFO Combine Mode - * 0b00..Disable - * 0b01..Enable on FIFO reads (from transmit shift registers) - * 0b10..Enable on FIFO writes (by software) - * 0b11..Enable on FIFO reads (from transmit shift registers) and writes (by software) - */ -#define I2S_TCR4_FCOMB(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_FCOMB_SHIFT)) & I2S_TCR4_FCOMB_MASK) - -#define I2S_TCR4_FCONT_MASK (0x10000000U) -#define I2S_TCR4_FCONT_SHIFT (28U) -/*! FCONT - FIFO Continue on Error - * 0b0..Continue from the start of the next frame - * 0b1..Continue from the same word that caused the FIFO error - */ -#define I2S_TCR4_FCONT(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR4_FCONT_SHIFT)) & I2S_TCR4_FCONT_MASK) -/*! @} */ - -/*! @name TCR5 - Transmit Configuration 5 */ -/*! @{ */ - -#define I2S_TCR5_FBT_MASK (0x1F00U) -#define I2S_TCR5_FBT_SHIFT (8U) -/*! FBT - First Bit Shifted - * 0b00000..0 - * 0b00001-0b11110..FBT - * 0b11111..31 - */ -#define I2S_TCR5_FBT(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR5_FBT_SHIFT)) & I2S_TCR5_FBT_MASK) - -#define I2S_TCR5_W0W_MASK (0x1F0000U) -#define I2S_TCR5_W0W_SHIFT (16U) -/*! W0W - Word 0 Width - * 0b00111..8 - * 0b01000..9 - * 0b01001-0b11110..(W0W value + 1) - * 0b11111..32 - */ -#define I2S_TCR5_W0W(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR5_W0W_SHIFT)) & I2S_TCR5_W0W_MASK) - -#define I2S_TCR5_WNW_MASK (0x1F000000U) -#define I2S_TCR5_WNW_SHIFT (24U) -/*! WNW - Word N Width - * 0b00111..8 - * 0b01000..9 - * 0b01001-0b11110..(WNW value + 1) - * 0b11111..32 - */ -#define I2S_TCR5_WNW(x) (((uint32_t)(((uint32_t)(x)) << I2S_TCR5_WNW_SHIFT)) & I2S_TCR5_WNW_MASK) -/*! @} */ - -/*! @name TDR - Transmit Data */ -/*! @{ */ - -#define I2S_TDR_TDR_MASK (0xFFFFFFFFU) -#define I2S_TDR_TDR_SHIFT (0U) -/*! TDR - Transmit Data */ -#define I2S_TDR_TDR(x) (((uint32_t)(((uint32_t)(x)) << I2S_TDR_TDR_SHIFT)) & I2S_TDR_TDR_MASK) -/*! @} */ - -/* The count of I2S_TDR */ -#define I2S_TDR_COUNT (2U) - -/*! @name TFR - Transmit FIFO */ -/*! @{ */ - -#define I2S_TFR_RFP_MASK (0xFU) -#define I2S_TFR_RFP_SHIFT (0U) -/*! RFP - Read FIFO Pointer */ -#define I2S_TFR_RFP(x) (((uint32_t)(((uint32_t)(x)) << I2S_TFR_RFP_SHIFT)) & I2S_TFR_RFP_MASK) - -#define I2S_TFR_WFP_MASK (0xF0000U) -#define I2S_TFR_WFP_SHIFT (16U) -/*! WFP - Write FIFO Pointer */ -#define I2S_TFR_WFP(x) (((uint32_t)(((uint32_t)(x)) << I2S_TFR_WFP_SHIFT)) & I2S_TFR_WFP_MASK) - -#define I2S_TFR_WCP_MASK (0x80000000U) -#define I2S_TFR_WCP_SHIFT (31U) -/*! WCP - Write Channel Pointer - * 0b0..No effect - * 0b1..Next FIFO to be written - */ -#define I2S_TFR_WCP(x) (((uint32_t)(((uint32_t)(x)) << I2S_TFR_WCP_SHIFT)) & I2S_TFR_WCP_MASK) -/*! @} */ - -/* The count of I2S_TFR */ -#define I2S_TFR_COUNT (2U) - -/*! @name TMR - Transmit Mask */ -/*! @{ */ - -#define I2S_TMR_TWM_MASK (0xFFFFFFFFU) -#define I2S_TMR_TWM_SHIFT (0U) -/*! TWM - Transmit Word Mask - * 0b00000000000000000000000000000000..Enable - * 0b00000000000000000000000000000001..Mask - */ -#define I2S_TMR_TWM(x) (((uint32_t)(((uint32_t)(x)) << I2S_TMR_TWM_SHIFT)) & I2S_TMR_TWM_MASK) -/*! @} */ - -/*! @name RCSR - Receive Control */ -/*! @{ */ - -#define I2S_RCSR_FRDE_MASK (0x1U) -#define I2S_RCSR_FRDE_SHIFT (0U) -/*! FRDE - FIFO Request DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCSR_FRDE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FRDE_SHIFT)) & I2S_RCSR_FRDE_MASK) - -#define I2S_RCSR_FWDE_MASK (0x2U) -#define I2S_RCSR_FWDE_SHIFT (1U) -/*! FWDE - FIFO Warning DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCSR_FWDE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FWDE_SHIFT)) & I2S_RCSR_FWDE_MASK) - -#define I2S_RCSR_FRIE_MASK (0x100U) -#define I2S_RCSR_FRIE_SHIFT (8U) -/*! FRIE - FIFO Request Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCSR_FRIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FRIE_SHIFT)) & I2S_RCSR_FRIE_MASK) - -#define I2S_RCSR_FWIE_MASK (0x200U) -#define I2S_RCSR_FWIE_SHIFT (9U) -/*! FWIE - FIFO Warning Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCSR_FWIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FWIE_SHIFT)) & I2S_RCSR_FWIE_MASK) - -#define I2S_RCSR_FEIE_MASK (0x400U) -#define I2S_RCSR_FEIE_SHIFT (10U) -/*! FEIE - FIFO Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCSR_FEIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FEIE_SHIFT)) & I2S_RCSR_FEIE_MASK) - -#define I2S_RCSR_SEIE_MASK (0x800U) -#define I2S_RCSR_SEIE_SHIFT (11U) -/*! SEIE - Sync Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCSR_SEIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_SEIE_SHIFT)) & I2S_RCSR_SEIE_MASK) - -#define I2S_RCSR_WSIE_MASK (0x1000U) -#define I2S_RCSR_WSIE_SHIFT (12U) -/*! WSIE - Word Start Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCSR_WSIE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_WSIE_SHIFT)) & I2S_RCSR_WSIE_MASK) - -#define I2S_RCSR_FRF_MASK (0x10000U) -#define I2S_RCSR_FRF_SHIFT (16U) -/*! FRF - FIFO Request Flag - * 0b0..Watermark not reached - * 0b1..Watermark reached - */ -#define I2S_RCSR_FRF(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FRF_SHIFT)) & I2S_RCSR_FRF_MASK) - -#define I2S_RCSR_FWF_MASK (0x20000U) -#define I2S_RCSR_FWF_SHIFT (17U) -/*! FWF - FIFO Warning Flag - * 0b0..Not full - * 0b1..Full - */ -#define I2S_RCSR_FWF(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FWF_SHIFT)) & I2S_RCSR_FWF_MASK) - -#define I2S_RCSR_FEF_MASK (0x40000U) -#define I2S_RCSR_FEF_SHIFT (18U) -/*! FEF - FIFO Error Flag - * 0b0..No error - * 0b1..Receive overflow detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I2S_RCSR_FEF(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FEF_SHIFT)) & I2S_RCSR_FEF_MASK) - -#define I2S_RCSR_SEF_MASK (0x80000U) -#define I2S_RCSR_SEF_SHIFT (19U) -/*! SEF - Sync Error Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I2S_RCSR_SEF(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_SEF_SHIFT)) & I2S_RCSR_SEF_MASK) - -#define I2S_RCSR_WSF_MASK (0x100000U) -#define I2S_RCSR_WSF_SHIFT (20U) -/*! WSF - Word Start Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I2S_RCSR_WSF(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_WSF_SHIFT)) & I2S_RCSR_WSF_MASK) - -#define I2S_RCSR_SR_MASK (0x1000000U) -#define I2S_RCSR_SR_SHIFT (24U) -/*! SR - Software Reset - * 0b0..No effect - * 0b1..Software reset - */ -#define I2S_RCSR_SR(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_SR_SHIFT)) & I2S_RCSR_SR_MASK) - -#define I2S_RCSR_FR_MASK (0x2000000U) -#define I2S_RCSR_FR_SHIFT (25U) -/*! FR - FIFO Reset - * 0b0..No effect - * 0b1..Reset - */ -#define I2S_RCSR_FR(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_FR_SHIFT)) & I2S_RCSR_FR_MASK) - -#define I2S_RCSR_BCE_MASK (0x10000000U) -#define I2S_RCSR_BCE_SHIFT (28U) -/*! BCE - Bit Clock Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCSR_BCE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_BCE_SHIFT)) & I2S_RCSR_BCE_MASK) - -#define I2S_RCSR_DBGE_MASK (0x20000000U) -#define I2S_RCSR_DBGE_SHIFT (29U) -/*! DBGE - Debug Enable - * 0b0..Disable after completing the current frame - * 0b1..Enable - */ -#define I2S_RCSR_DBGE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_DBGE_SHIFT)) & I2S_RCSR_DBGE_MASK) - -#define I2S_RCSR_STOPE_MASK (0x40000000U) -#define I2S_RCSR_STOPE_SHIFT (30U) -/*! STOPE - Stop Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCSR_STOPE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_STOPE_SHIFT)) & I2S_RCSR_STOPE_MASK) - -#define I2S_RCSR_RE_MASK (0x80000000U) -#define I2S_RCSR_RE_SHIFT (31U) -/*! RE - Receiver Enable - * 0b0..Disable - * 0b1..Enable (or receiver disabled and not yet reached end of frame) - */ -#define I2S_RCSR_RE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCSR_RE_SHIFT)) & I2S_RCSR_RE_MASK) -/*! @} */ - -/*! @name RCR1 - Receive Configuration 1 */ -/*! @{ */ - -#define I2S_RCR1_RFW_MASK (0x7U) -#define I2S_RCR1_RFW_SHIFT (0U) -/*! RFW - Receive FIFO Watermark - * 0b000..1 - * 0b001..2 - * 0b010-0b110..(RFW value + 1) - * 0b111..8 - */ -#define I2S_RCR1_RFW(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR1_RFW_SHIFT)) & I2S_RCR1_RFW_MASK) -/*! @} */ - -/*! @name RCR2 - Receive Configuration 2 */ -/*! @{ */ - -#define I2S_RCR2_DIV_MASK (0xFFU) -#define I2S_RCR2_DIV_SHIFT (0U) -/*! DIV - Bit Clock Divide */ -#define I2S_RCR2_DIV(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_DIV_SHIFT)) & I2S_RCR2_DIV_MASK) - -#define I2S_RCR2_BYP_MASK (0x800000U) -#define I2S_RCR2_BYP_SHIFT (23U) -/*! BYP - Bit Clock Bypass - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCR2_BYP(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_BYP_SHIFT)) & I2S_RCR2_BYP_MASK) - -#define I2S_RCR2_BCD_MASK (0x1000000U) -#define I2S_RCR2_BCD_SHIFT (24U) -/*! BCD - Bit Clock Direction - * 0b0..Generated externally in Target mode - * 0b1..Generated internally in Controller mode - */ -#define I2S_RCR2_BCD(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_BCD_SHIFT)) & I2S_RCR2_BCD_MASK) - -#define I2S_RCR2_BCP_MASK (0x2000000U) -#define I2S_RCR2_BCP_SHIFT (25U) -/*! BCP - Bit Clock Polarity - * 0b0..Active high - * 0b1..Active low - */ -#define I2S_RCR2_BCP(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_BCP_SHIFT)) & I2S_RCR2_BCP_MASK) - -#define I2S_RCR2_MSEL_MASK (0xC000000U) -#define I2S_RCR2_MSEL_SHIFT (26U) -/*! MSEL - MCLK Select - * 0b00..Bus clock - * 0b01..Controller clock (MCLK) option 1 - * 0b10..Controller clock (MCLK) option 2 - * 0b11..Controller clock (MCLK) option 3 - */ -#define I2S_RCR2_MSEL(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_MSEL_SHIFT)) & I2S_RCR2_MSEL_MASK) - -#define I2S_RCR2_BCI_MASK (0x10000000U) -#define I2S_RCR2_BCI_SHIFT (28U) -/*! BCI - Bit Clock Input - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_RCR2_BCI(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_BCI_SHIFT)) & I2S_RCR2_BCI_MASK) - -#define I2S_RCR2_BCS_MASK (0x20000000U) -#define I2S_RCR2_BCS_SHIFT (29U) -/*! BCS - Bit Clock Swap - * 0b0..Use the normal bit clock source - * 0b1..Swap the bit clock source - */ -#define I2S_RCR2_BCS(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_BCS_SHIFT)) & I2S_RCR2_BCS_MASK) - -#define I2S_RCR2_SYNC_MASK (0xC0000000U) -#define I2S_RCR2_SYNC_SHIFT (30U) -/*! SYNC - Synchronous Mode - * 0b00..Asynchronous mode - * 0b01..Synchronous with transmitter - * 0b10..Synchronous with another SAI receiver - * 0b11..Synchronous with another SAI transmitter - */ -#define I2S_RCR2_SYNC(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR2_SYNC_SHIFT)) & I2S_RCR2_SYNC_MASK) -/*! @} */ - -/*! @name RCR3 - Receive Configuration 3 */ -/*! @{ */ - -#define I2S_RCR3_WDFL_MASK (0x1FU) -#define I2S_RCR3_WDFL_SHIFT (0U) -/*! WDFL - Word Flag Configuration - * 0b00000..Word 1 - * 0b00001..Word 2 - * 0b00010-0b11110..Word (WDFL value + 1) - * 0b11111..Word 32 - */ -#define I2S_RCR3_WDFL(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR3_WDFL_SHIFT)) & I2S_RCR3_WDFL_MASK) - -#define I2S_RCR3_RCE_MASK (0x30000U) -#define I2S_RCR3_RCE_SHIFT (16U) -/*! RCE - Receive Channel Enable */ -#define I2S_RCR3_RCE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR3_RCE_SHIFT)) & I2S_RCR3_RCE_MASK) - -#define I2S_RCR3_CFR_MASK (0x3000000U) -#define I2S_RCR3_CFR_SHIFT (24U) -/*! CFR - Channel FIFO Reset */ -#define I2S_RCR3_CFR(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR3_CFR_SHIFT)) & I2S_RCR3_CFR_MASK) -/*! @} */ - -/*! @name RCR4 - Receive Configuration 4 */ -/*! @{ */ - -#define I2S_RCR4_FSD_MASK (0x1U) -#define I2S_RCR4_FSD_SHIFT (0U) -/*! FSD - Frame Sync Direction - * 0b0..Generated externally in Target mode - * 0b1..Generated internally in Controller mode - */ -#define I2S_RCR4_FSD(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_FSD_SHIFT)) & I2S_RCR4_FSD_MASK) - -#define I2S_RCR4_FSP_MASK (0x2U) -#define I2S_RCR4_FSP_SHIFT (1U) -/*! FSP - Frame Sync Polarity - * 0b0..Active high - * 0b1..Active low - */ -#define I2S_RCR4_FSP(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_FSP_SHIFT)) & I2S_RCR4_FSP_MASK) - -#define I2S_RCR4_ONDEM_MASK (0x4U) -#define I2S_RCR4_ONDEM_SHIFT (2U) -/*! ONDEM - On-Demand Mode - * 0b0..Generated continuously - * 0b1..Generated when the FIFO warning flag is 0 - */ -#define I2S_RCR4_ONDEM(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_ONDEM_SHIFT)) & I2S_RCR4_ONDEM_MASK) - -#define I2S_RCR4_FSE_MASK (0x8U) -#define I2S_RCR4_FSE_SHIFT (3U) -/*! FSE - Frame Sync Early - * 0b0..First bit of the frame - * 0b1..One bit before the first bit of the frame - */ -#define I2S_RCR4_FSE(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_FSE_SHIFT)) & I2S_RCR4_FSE_MASK) - -#define I2S_RCR4_MF_MASK (0x10U) -#define I2S_RCR4_MF_SHIFT (4U) -/*! MF - MSB First - * 0b0..LSB - * 0b1..MSB - */ -#define I2S_RCR4_MF(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_MF_SHIFT)) & I2S_RCR4_MF_MASK) - -#define I2S_RCR4_SYWD_MASK (0x1F00U) -#define I2S_RCR4_SYWD_SHIFT (8U) -/*! SYWD - Sync Width - * 0b00000..1 - * 0b00001..2 - * 0b00010-0b11110..(SYWD value + 1) - * 0b11111..32 - */ -#define I2S_RCR4_SYWD(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_SYWD_SHIFT)) & I2S_RCR4_SYWD_MASK) - -#define I2S_RCR4_FRSZ_MASK (0x1F0000U) -#define I2S_RCR4_FRSZ_SHIFT (16U) -/*! FRSZ - Frame Size - * 0b00000..1 - * 0b00001..2 - * 0b00010-0b11110..(FRSZ value + 1) - * 0b11111..32 - */ -#define I2S_RCR4_FRSZ(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_FRSZ_SHIFT)) & I2S_RCR4_FRSZ_MASK) - -#define I2S_RCR4_FPACK_MASK (0x3000000U) -#define I2S_RCR4_FPACK_SHIFT (24U) -/*! FPACK - FIFO Packing Mode - * 0b00..Disable - * 0b01..Reserved - * 0b10..Enable 8-bit FIFO packing - * 0b11..Enable 16-bit FIFO packing - */ -#define I2S_RCR4_FPACK(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_FPACK_SHIFT)) & I2S_RCR4_FPACK_MASK) - -#define I2S_RCR4_FCOMB_MASK (0xC000000U) -#define I2S_RCR4_FCOMB_SHIFT (26U) -/*! FCOMB - FIFO Combine Mode - * 0b00..Disable - * 0b01..Enable on FIFO writes (from receive shift registers) - * 0b10..Enable on FIFO reads (by software) - * 0b11..Enable on FIFO writes (from receive shift registers) and reads (by software) - */ -#define I2S_RCR4_FCOMB(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_FCOMB_SHIFT)) & I2S_RCR4_FCOMB_MASK) - -#define I2S_RCR4_FCONT_MASK (0x10000000U) -#define I2S_RCR4_FCONT_SHIFT (28U) -/*! FCONT - FIFO Continue on Error - * 0b0..From the start of the next frame after the FIFO error flag is cleared - * 0b1..From the same word that caused the FIFO error to become 1 after the FIFO warning flag is cleared - */ -#define I2S_RCR4_FCONT(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR4_FCONT_SHIFT)) & I2S_RCR4_FCONT_MASK) -/*! @} */ - -/*! @name RCR5 - Receive Configuration 5 */ -/*! @{ */ - -#define I2S_RCR5_FBT_MASK (0x1F00U) -#define I2S_RCR5_FBT_SHIFT (8U) -/*! FBT - First Bit Shifted - * 0b00000..0 - * 0b00001-0b11110..FBT value - * 0b11111..31 - */ -#define I2S_RCR5_FBT(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR5_FBT_SHIFT)) & I2S_RCR5_FBT_MASK) - -#define I2S_RCR5_W0W_MASK (0x1F0000U) -#define I2S_RCR5_W0W_SHIFT (16U) -/*! W0W - Word 0 Width - * 0b00000..1 - * 0b00001..2 - * 0b00010-0b11110..(W0W value + 1) - * 0b11111..32 - */ -#define I2S_RCR5_W0W(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR5_W0W_SHIFT)) & I2S_RCR5_W0W_MASK) - -#define I2S_RCR5_WNW_MASK (0x1F000000U) -#define I2S_RCR5_WNW_SHIFT (24U) -/*! WNW - Word N Width - * 0b00111..8 - * 0b01000..9 - * 0b01001-0b11110..(WNW value + 1) - * 0b11111..32 - */ -#define I2S_RCR5_WNW(x) (((uint32_t)(((uint32_t)(x)) << I2S_RCR5_WNW_SHIFT)) & I2S_RCR5_WNW_MASK) -/*! @} */ - -/*! @name RDR - Receive Data */ -/*! @{ */ - -#define I2S_RDR_RDR_MASK (0xFFFFFFFFU) -#define I2S_RDR_RDR_SHIFT (0U) -/*! RDR - Receive Data */ -#define I2S_RDR_RDR(x) (((uint32_t)(((uint32_t)(x)) << I2S_RDR_RDR_SHIFT)) & I2S_RDR_RDR_MASK) -/*! @} */ - -/* The count of I2S_RDR */ -#define I2S_RDR_COUNT (2U) - -/*! @name RFR - Receive FIFO */ -/*! @{ */ - -#define I2S_RFR_RFP_MASK (0xFU) -#define I2S_RFR_RFP_SHIFT (0U) -/*! RFP - Read FIFO Pointer */ -#define I2S_RFR_RFP(x) (((uint32_t)(((uint32_t)(x)) << I2S_RFR_RFP_SHIFT)) & I2S_RFR_RFP_MASK) - -#define I2S_RFR_RCP_MASK (0x8000U) -#define I2S_RFR_RCP_SHIFT (15U) -/*! RCP - Read Channel Pointer - * 0b0..No effect - * 0b1..Next FIFO to be read - */ -#define I2S_RFR_RCP(x) (((uint32_t)(((uint32_t)(x)) << I2S_RFR_RCP_SHIFT)) & I2S_RFR_RCP_MASK) - -#define I2S_RFR_WFP_MASK (0xF0000U) -#define I2S_RFR_WFP_SHIFT (16U) -/*! WFP - Write FIFO Pointer */ -#define I2S_RFR_WFP(x) (((uint32_t)(((uint32_t)(x)) << I2S_RFR_WFP_SHIFT)) & I2S_RFR_WFP_MASK) -/*! @} */ - -/* The count of I2S_RFR */ -#define I2S_RFR_COUNT (2U) - -/*! @name RMR - Receive Mask */ -/*! @{ */ - -#define I2S_RMR_RWM_MASK (0xFFFFFFFFU) -#define I2S_RMR_RWM_SHIFT (0U) -/*! RWM - Receive Word Mask - * 0b00000000000000000000000000000000..Enable - * 0b00000000000000000000000000000001..Mask - */ -#define I2S_RMR_RWM(x) (((uint32_t)(((uint32_t)(x)) << I2S_RMR_RWM_SHIFT)) & I2S_RMR_RWM_MASK) -/*! @} */ - -/*! @name MCR - MCLK Control */ -/*! @{ */ - -#define I2S_MCR_DIV_MASK (0xFFU) -#define I2S_MCR_DIV_SHIFT (0U) -/*! DIV - MCLK Post Divide */ -#define I2S_MCR_DIV(x) (((uint32_t)(((uint32_t)(x)) << I2S_MCR_DIV_SHIFT)) & I2S_MCR_DIV_MASK) - -#define I2S_MCR_DIVEN_MASK (0x800000U) -#define I2S_MCR_DIVEN_SHIFT (23U) -/*! DIVEN - MCLK Post Divide Enable - * 0b0..Disable - * 0b1..Enable - */ -#define I2S_MCR_DIVEN(x) (((uint32_t)(((uint32_t)(x)) << I2S_MCR_DIVEN_SHIFT)) & I2S_MCR_DIVEN_MASK) - -#define I2S_MCR_MSEL_MASK (0x3000000U) -#define I2S_MCR_MSEL_SHIFT (24U) -/*! MSEL - MCLK Select - * 0b00..Controller clock (MCLK) option 1 - * 0b01..Reserved - * 0b10..Controller clock (MCLK) option 2 - * 0b11..Controller clock (MCLK) option 3 - */ -#define I2S_MCR_MSEL(x) (((uint32_t)(((uint32_t)(x)) << I2S_MCR_MSEL_SHIFT)) & I2S_MCR_MSEL_MASK) - -#define I2S_MCR_MOE_MASK (0x40000000U) -#define I2S_MCR_MOE_SHIFT (30U) -/*! MOE - MCLK Output Enable - * 0b0..Input - * 0b1..Output - */ -#define I2S_MCR_MOE(x) (((uint32_t)(((uint32_t)(x)) << I2S_MCR_MOE_SHIFT)) & I2S_MCR_MOE_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group I2S_Register_Masks */ - - -/* I2S - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral SAI0 base address */ - #define SAI0_BASE (0x50106000u) - /** Peripheral SAI0 base address */ - #define SAI0_BASE_NS (0x40106000u) - /** Peripheral SAI0 base pointer */ - #define SAI0 ((I2S_Type *)SAI0_BASE) - /** Peripheral SAI0 base pointer */ - #define SAI0_NS ((I2S_Type *)SAI0_BASE_NS) - /** Peripheral SAI1 base address */ - #define SAI1_BASE (0x50107000u) - /** Peripheral SAI1 base address */ - #define SAI1_BASE_NS (0x40107000u) - /** Peripheral SAI1 base pointer */ - #define SAI1 ((I2S_Type *)SAI1_BASE) - /** Peripheral SAI1 base pointer */ - #define SAI1_NS ((I2S_Type *)SAI1_BASE_NS) - /** Array initializer of I2S peripheral base addresses */ - #define I2S_BASE_ADDRS { SAI0_BASE, SAI1_BASE } - /** Array initializer of I2S peripheral base pointers */ - #define I2S_BASE_PTRS { SAI0, SAI1 } - /** Array initializer of I2S peripheral base addresses */ - #define I2S_BASE_ADDRS_NS { SAI0_BASE_NS, SAI1_BASE_NS } - /** Array initializer of I2S peripheral base pointers */ - #define I2S_BASE_PTRS_NS { SAI0_NS, SAI1_NS } -#else - /** Peripheral SAI0 base address */ - #define SAI0_BASE (0x40106000u) - /** Peripheral SAI0 base pointer */ - #define SAI0 ((I2S_Type *)SAI0_BASE) - /** Peripheral SAI1 base address */ - #define SAI1_BASE (0x40107000u) - /** Peripheral SAI1 base pointer */ - #define SAI1 ((I2S_Type *)SAI1_BASE) - /** Array initializer of I2S peripheral base addresses */ - #define I2S_BASE_ADDRS { SAI0_BASE, SAI1_BASE } - /** Array initializer of I2S peripheral base pointers */ - #define I2S_BASE_PTRS { SAI0, SAI1 } -#endif -/** Interrupt vectors for the I2S peripheral type */ -#define I2S_RX_IRQS { SAI0_IRQn, SAI1_IRQn } -#define I2S_TX_IRQS { SAI0_IRQn, SAI1_IRQn } - -/*! - * @} - */ /* end of group I2S_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- I3C Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup I3C_Peripheral_Access_Layer I3C Peripheral Access Layer - * @{ - */ - -/** I3C - Register Layout Typedef */ -typedef struct { - __IO uint32_t MCONFIG; /**< Controller Configuration, offset: 0x0 */ - __IO uint32_t SCONFIG; /**< Target Configuration, offset: 0x4 */ - __IO uint32_t SSTATUS; /**< Target Status, offset: 0x8 */ - __IO uint32_t SCTRL; /**< Target Control, offset: 0xC */ - __IO uint32_t SINTSET; /**< Target Interrupt Set, offset: 0x10 */ - __IO uint32_t SINTCLR; /**< Target Interrupt Clear, offset: 0x14 */ - __I uint32_t SINTMASKED; /**< Target Interrupt Mask, offset: 0x18 */ - __IO uint32_t SERRWARN; /**< Target Errors and Warnings, offset: 0x1C */ - __IO uint32_t SDMACTRL; /**< Target DMA Control, offset: 0x20 */ - uint8_t RESERVED_0[8]; - __IO uint32_t SDATACTRL; /**< Target Data Control, offset: 0x2C */ - __O uint32_t SWDATAB; /**< Target Write Data Byte, offset: 0x30 */ - __O uint32_t SWDATABE; /**< Target Write Data Byte End, offset: 0x34 */ - __O uint32_t SWDATAH; /**< Target Write Data Halfword, offset: 0x38 */ - __O uint32_t SWDATAHE; /**< Target Write Data Halfword End, offset: 0x3C */ - __I uint32_t SRDATAB; /**< Target Read Data Byte, offset: 0x40 */ - uint8_t RESERVED_1[4]; - __I uint32_t SRDATAH; /**< Target Read Data Halfword, offset: 0x48 */ - uint8_t RESERVED_2[8]; - __O uint32_t SWDATAB1; /**< Target Write Data Byte, offset: 0x54 */ - uint8_t RESERVED_3[4]; - __I uint32_t SCAPABILITIES2; /**< Target Capabilities 2, offset: 0x5C */ - __I uint32_t SCAPABILITIES; /**< Target Capabilities, offset: 0x60 */ - __IO uint32_t SDYNADDR; /**< Target Dynamic Address, offset: 0x64 */ - __IO uint32_t SMAXLIMITS; /**< Target Maximum Limits, offset: 0x68 */ - __IO uint32_t SIDPARTNO; /**< Target ID Part Number, offset: 0x6C */ - __IO uint32_t SIDEXT; /**< Target ID Extension, offset: 0x70 */ - __IO uint32_t SVENDORID; /**< Target Vendor ID, offset: 0x74 */ - __IO uint32_t STCCLOCK; /**< Target Time Control Clock, offset: 0x78 */ - __I uint32_t SMSGMAPADDR; /**< Target Message Map Address, offset: 0x7C */ - uint8_t RESERVED_4[4]; - __IO uint32_t MCTRL; /**< Controller Control, offset: 0x84 */ - __IO uint32_t MSTATUS; /**< Controller Status, offset: 0x88 */ - __IO uint32_t MIBIRULES; /**< Controller In-band Interrupt Registry and Rules, offset: 0x8C */ - __IO uint32_t MINTSET; /**< Controller Interrupt Set, offset: 0x90 */ - __IO uint32_t MINTCLR; /**< Controller Interrupt Clear, offset: 0x94 */ - __I uint32_t MINTMASKED; /**< Controller Interrupt Mask, offset: 0x98 */ - __IO uint32_t MERRWARN; /**< Controller Errors and Warnings, offset: 0x9C */ - __IO uint32_t MDMACTRL; /**< Controller DMA Control, offset: 0xA0 */ - uint8_t RESERVED_5[8]; - __IO uint32_t MDATACTRL; /**< Controller Data Control, offset: 0xAC */ - __O uint32_t MWDATAB; /**< Controller Write Data Byte, offset: 0xB0 */ - __O uint32_t MWDATABE; /**< Controller Write Data Byte End, offset: 0xB4 */ - __O uint32_t MWDATAH; /**< Controller Write Data Halfword, offset: 0xB8 */ - __O uint32_t MWDATAHE; /**< Controller Write Data Halfword End, offset: 0xBC */ - __I uint32_t MRDATAB; /**< Controller Read Data Byte, offset: 0xC0 */ - uint8_t RESERVED_6[4]; - __I uint32_t MRDATAH; /**< Controller Read Data Halfword, offset: 0xC8 */ - __O uint32_t MWDATAB1; /**< Controller Write Byte Data 1 (to Bus), offset: 0xCC */ - union { /* offset: 0xD0 */ - __O uint32_t MWMSG_SDR_CONTROL; /**< Controller Write Message Control in SDR mode, offset: 0xD0 */ - __O uint32_t MWMSG_SDR_DATA; /**< Controller Write Message Data in SDR mode, offset: 0xD0 */ - }; - __I uint32_t MRMSG_SDR; /**< Controller Read Message in SDR mode, offset: 0xD4 */ - union { /* offset: 0xD8 */ - __O uint32_t MWMSG_DDR_CONTROL; /**< Controller Write Message in DDR mode: First Control Word, offset: 0xD8 */ - __O uint32_t MWMSG_DDR_CONTROL2; /**< Controller Write Message in DDR Mode Control 2, offset: 0xD8 */ - __O uint32_t MWMSG_DDR_DATA; /**< Controller Write Message Data in DDR mode, offset: 0xD8 */ - }; - __I uint32_t MRMSG_DDR; /**< Controller Read Message in DDR mode, offset: 0xDC */ - uint8_t RESERVED_7[4]; - __IO uint32_t MDYNADDR; /**< Controller Dynamic Address, offset: 0xE4 */ - uint8_t RESERVED_8[52]; - __I uint32_t SMAPCTRL0; /**< Map Feature Control 0, offset: 0x11C */ - uint8_t RESERVED_9[32]; - __IO uint32_t IBIEXT1; /**< Extended IBI Data 1, offset: 0x140 */ - __IO uint32_t IBIEXT2; /**< Extended IBI Data 2, offset: 0x144 */ - uint8_t RESERVED_10[3764]; - __I uint32_t SID; /**< Target Module ID, offset: 0xFFC */ -} I3C_Type; - -/* ---------------------------------------------------------------------------- - -- I3C Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup I3C_Register_Masks I3C Register Masks - * @{ - */ - -/*! @name MCONFIG - Controller Configuration */ -/*! @{ */ - -#define I3C_MCONFIG_MSTENA_MASK (0x3U) -#define I3C_MCONFIG_MSTENA_SHIFT (0U) -/*! MSTENA - Controller Enable - * 0b00..CONTROLLER_OFF - * 0b01..CONTROLLER_ON - * 0b10..CONTROLLER_CAPABLE - * 0b11..I2C_CONTROLLER_MODE - */ -#define I3C_MCONFIG_MSTENA(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_MSTENA_SHIFT)) & I3C_MCONFIG_MSTENA_MASK) - -#define I3C_MCONFIG_DISTO_MASK (0x8U) -#define I3C_MCONFIG_DISTO_SHIFT (3U) -/*! DISTO - Disable Timeout - * 0b1..Disabled, if configured - * 0b0..Enabled - */ -#define I3C_MCONFIG_DISTO(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_DISTO_SHIFT)) & I3C_MCONFIG_DISTO_MASK) - -#define I3C_MCONFIG_HKEEP_MASK (0x30U) -#define I3C_MCONFIG_HKEEP_SHIFT (4U) -/*! HKEEP - High-Keeper - * 0b00..None - * 0b01..WIRED_IN - * 0b10..PASSIVE_SDA - * 0b11..PASSIVE_ON_SDA_SCL - */ -#define I3C_MCONFIG_HKEEP(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_HKEEP_SHIFT)) & I3C_MCONFIG_HKEEP_MASK) - -#define I3C_MCONFIG_ODSTOP_MASK (0x40U) -#define I3C_MCONFIG_ODSTOP_SHIFT (6U) -/*! ODSTOP - Open Drain Stop - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MCONFIG_ODSTOP(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_ODSTOP_SHIFT)) & I3C_MCONFIG_ODSTOP_MASK) - -#define I3C_MCONFIG_PPBAUD_MASK (0xF00U) -#define I3C_MCONFIG_PPBAUD_SHIFT (8U) -/*! PPBAUD - Push-Pull Baud Rate */ -#define I3C_MCONFIG_PPBAUD(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_PPBAUD_SHIFT)) & I3C_MCONFIG_PPBAUD_MASK) - -#define I3C_MCONFIG_PPLOW_MASK (0xF000U) -#define I3C_MCONFIG_PPLOW_SHIFT (12U) -/*! PPLOW - Push-Pull Low */ -#define I3C_MCONFIG_PPLOW(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_PPLOW_SHIFT)) & I3C_MCONFIG_PPLOW_MASK) - -#define I3C_MCONFIG_ODBAUD_MASK (0xFF0000U) -#define I3C_MCONFIG_ODBAUD_SHIFT (16U) -/*! ODBAUD - Open Drain Baud Rate */ -#define I3C_MCONFIG_ODBAUD(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_ODBAUD_SHIFT)) & I3C_MCONFIG_ODBAUD_MASK) - -#define I3C_MCONFIG_ODHPP_MASK (0x1000000U) -#define I3C_MCONFIG_ODHPP_SHIFT (24U) -/*! ODHPP - Open Drain High Push-Pull - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MCONFIG_ODHPP(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_ODHPP_SHIFT)) & I3C_MCONFIG_ODHPP_MASK) - -#define I3C_MCONFIG_SKEW_MASK (0xE000000U) -#define I3C_MCONFIG_SKEW_SHIFT (25U) -/*! SKEW - Skew */ -#define I3C_MCONFIG_SKEW(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_SKEW_SHIFT)) & I3C_MCONFIG_SKEW_MASK) - -#define I3C_MCONFIG_I2CBAUD_MASK (0xF0000000U) -#define I3C_MCONFIG_I2CBAUD_SHIFT (28U) -/*! I2CBAUD - I2C Baud Rate */ -#define I3C_MCONFIG_I2CBAUD(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCONFIG_I2CBAUD_SHIFT)) & I3C_MCONFIG_I2CBAUD_MASK) -/*! @} */ - -/*! @name SCONFIG - Target Configuration */ -/*! @{ */ - -#define I3C_SCONFIG_SLVENA_MASK (0x1U) -#define I3C_SCONFIG_SLVENA_SHIFT (0U) -/*! SLVENA - Target Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SCONFIG_SLVENA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_SLVENA_SHIFT)) & I3C_SCONFIG_SLVENA_MASK) - -#define I3C_SCONFIG_NACK_MASK (0x2U) -#define I3C_SCONFIG_NACK_SHIFT (1U) -/*! NACK - Not Acknowledge - * 0b1..Always enable NACK mode (works normally) - * 0b0..Always disable NACK mode - */ -#define I3C_SCONFIG_NACK(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_NACK_SHIFT)) & I3C_SCONFIG_NACK_MASK) - -#define I3C_SCONFIG_MATCHSS_MASK (0x4U) -#define I3C_SCONFIG_MATCHSS_SHIFT (2U) -/*! MATCHSS - Match Start or Stop - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SCONFIG_MATCHSS(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_MATCHSS_SHIFT)) & I3C_SCONFIG_MATCHSS_MASK) - -#define I3C_SCONFIG_S0IGNORE_MASK (0x8U) -#define I3C_SCONFIG_S0IGNORE_SHIFT (3U) -/*! S0IGNORE - Ignore TE0 or TE1 Errors - * 0b1..Ignore TE0 or TE1 errors - * 0b0..Do not ignore TE0 or TE1 errors - */ -#define I3C_SCONFIG_S0IGNORE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_S0IGNORE_SHIFT)) & I3C_SCONFIG_S0IGNORE_MASK) - -#define I3C_SCONFIG_DDROK_MASK (0x10U) -#define I3C_SCONFIG_DDROK_SHIFT (4U) -/*! DDROK - Double Data Rate OK - * 0b1..Allow HDR-DDR messaging - * 0b0..Do not allow HDR-DDR messaging - */ -#define I3C_SCONFIG_DDROK(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_DDROK_SHIFT)) & I3C_SCONFIG_DDROK_MASK) - -#define I3C_SCONFIG_IDRAND_MASK (0x100U) -#define I3C_SCONFIG_IDRAND_SHIFT (8U) -/*! IDRAND - ID random - * 0b1..Random value - * 0b0..Part number and an instance - */ -#define I3C_SCONFIG_IDRAND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_IDRAND_SHIFT)) & I3C_SCONFIG_IDRAND_MASK) - -#define I3C_SCONFIG_OFFLINE_MASK (0x200U) -#define I3C_SCONFIG_OFFLINE_SHIFT (9U) -/*! OFFLINE - Offline - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SCONFIG_OFFLINE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_OFFLINE_SHIFT)) & I3C_SCONFIG_OFFLINE_MASK) - -#define I3C_SCONFIG_BAMATCH_MASK (0xFF0000U) -#define I3C_SCONFIG_BAMATCH_SHIFT (16U) -/*! BAMATCH - Bus Available Match */ -#define I3C_SCONFIG_BAMATCH(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_BAMATCH_SHIFT)) & I3C_SCONFIG_BAMATCH_MASK) - -#define I3C_SCONFIG_SADDR_MASK (0xFE000000U) -#define I3C_SCONFIG_SADDR_SHIFT (25U) -/*! SADDR - Static Address */ -#define I3C_SCONFIG_SADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCONFIG_SADDR_SHIFT)) & I3C_SCONFIG_SADDR_MASK) -/*! @} */ - -/*! @name SSTATUS - Target Status */ -/*! @{ */ - -#define I3C_SSTATUS_STNOTSTOP_MASK (0x1U) -#define I3C_SSTATUS_STNOTSTOP_SHIFT (0U) -/*! STNOTSTOP - Status not Stop - * 0b1..Busy - * 0b0..In STOP condition - */ -#define I3C_SSTATUS_STNOTSTOP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STNOTSTOP_SHIFT)) & I3C_SSTATUS_STNOTSTOP_MASK) - -#define I3C_SSTATUS_STMSG_MASK (0x2U) -#define I3C_SSTATUS_STMSG_SHIFT (1U) -/*! STMSG - Status Message - * 0b1..Busy - * 0b0..Idle - */ -#define I3C_SSTATUS_STMSG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STMSG_SHIFT)) & I3C_SSTATUS_STMSG_MASK) - -#define I3C_SSTATUS_STCCCH_MASK (0x4U) -#define I3C_SSTATUS_STCCCH_SHIFT (2U) -/*! STCCCH - Status Common Command Code Handler - * 0b1..Handled automatically - * 0b0..No CCC message handled - */ -#define I3C_SSTATUS_STCCCH(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STCCCH_SHIFT)) & I3C_SSTATUS_STCCCH_MASK) - -#define I3C_SSTATUS_STREQRD_MASK (0x8U) -#define I3C_SSTATUS_STREQRD_SHIFT (3U) -/*! STREQRD - Status Request Read - * 0b1..SDR read from this target or an IBI is being pushed out - * 0b0..Not an SDR read - */ -#define I3C_SSTATUS_STREQRD(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STREQRD_SHIFT)) & I3C_SSTATUS_STREQRD_MASK) - -#define I3C_SSTATUS_STREQWR_MASK (0x10U) -#define I3C_SSTATUS_STREQWR_SHIFT (4U) -/*! STREQWR - Status Request Write - * 0b1..SDR write data from the controller, but not in ENTDAA mode - * 0b0..Not an SDR write - */ -#define I3C_SSTATUS_STREQWR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STREQWR_SHIFT)) & I3C_SSTATUS_STREQWR_MASK) - -#define I3C_SSTATUS_STDAA_MASK (0x20U) -#define I3C_SSTATUS_STDAA_SHIFT (5U) -/*! STDAA - Status Dynamic Address Assignment - * 0b1..In ENTDAA mode - * 0b0..Not in ENTDAA mode - */ -#define I3C_SSTATUS_STDAA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STDAA_SHIFT)) & I3C_SSTATUS_STDAA_MASK) - -#define I3C_SSTATUS_STHDR_MASK (0x40U) -#define I3C_SSTATUS_STHDR_SHIFT (6U) -/*! STHDR - Status High Data Rate - * 0b1..I3C bus in HDR-DDR mode - * 0b0..I3C bus not in HDR-DDR mode - */ -#define I3C_SSTATUS_STHDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STHDR_SHIFT)) & I3C_SSTATUS_STHDR_MASK) - -#define I3C_SSTATUS_START_MASK (0x100U) -#define I3C_SSTATUS_START_SHIFT (8U) -/*! START - Start - * 0b1..Detected - * 0b0..Not detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_START(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_START_SHIFT)) & I3C_SSTATUS_START_MASK) - -#define I3C_SSTATUS_MATCHED_MASK (0x200U) -#define I3C_SSTATUS_MATCHED_SHIFT (9U) -/*! MATCHED - Matched - * 0b1..Header matched - * 0b0..Header not matched - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_MATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_MATCHED_SHIFT)) & I3C_SSTATUS_MATCHED_MASK) - -#define I3C_SSTATUS_STOP_MASK (0x400U) -#define I3C_SSTATUS_STOP_SHIFT (10U) -/*! STOP - Stop - * 0b1..Stopped state detected - * 0b0..No Stopped state detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_STOP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_STOP_SHIFT)) & I3C_SSTATUS_STOP_MASK) - -#define I3C_SSTATUS_RX_PEND_MASK (0x800U) -#define I3C_SSTATUS_RX_PEND_SHIFT (11U) -/*! RX_PEND - Received Message Pending - * 0b1..Received message pending - * 0b0..No received message pending - */ -#define I3C_SSTATUS_RX_PEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_RX_PEND_SHIFT)) & I3C_SSTATUS_RX_PEND_MASK) - -#define I3C_SSTATUS_TXNOTFULL_MASK (0x1000U) -#define I3C_SSTATUS_TXNOTFULL_SHIFT (12U) -/*! TXNOTFULL - Transmit Buffer Not Full - * 0b1..Transmit buffer not full - * 0b0..Transmit buffer full - */ -#define I3C_SSTATUS_TXNOTFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_TXNOTFULL_SHIFT)) & I3C_SSTATUS_TXNOTFULL_MASK) - -#define I3C_SSTATUS_DACHG_MASK (0x2000U) -#define I3C_SSTATUS_DACHG_SHIFT (13U) -/*! DACHG - Dynamic Address Change - * 0b1..DA change detected - * 0b0..No DA change detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_DACHG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_DACHG_SHIFT)) & I3C_SSTATUS_DACHG_MASK) - -#define I3C_SSTATUS_CCC_MASK (0x4000U) -#define I3C_SSTATUS_CCC_SHIFT (14U) -/*! CCC - Common Command Code - * 0b1..CCC received - * 0b0..CCC not received - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_CCC(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_CCC_SHIFT)) & I3C_SSTATUS_CCC_MASK) - -#define I3C_SSTATUS_ERRWARN_MASK (0x8000U) -#define I3C_SSTATUS_ERRWARN_SHIFT (15U) -/*! ERRWARN - Error Warning */ -#define I3C_SSTATUS_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_ERRWARN_SHIFT)) & I3C_SSTATUS_ERRWARN_MASK) - -#define I3C_SSTATUS_HDRMATCH_MASK (0x10000U) -#define I3C_SSTATUS_HDRMATCH_SHIFT (16U) -/*! HDRMATCH - High Data Rate Command Match - * 0b1..Matched the I3C dynamic address - * 0b0..Did not match - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_HDRMATCH(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_HDRMATCH_SHIFT)) & I3C_SSTATUS_HDRMATCH_MASK) - -#define I3C_SSTATUS_CHANDLED_MASK (0x20000U) -#define I3C_SSTATUS_CHANDLED_SHIFT (17U) -/*! CHANDLED - Common Command Code Handled - * 0b1..CCC handling in progress - * 0b0..CCC handling not in progress - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_CHANDLED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_CHANDLED_SHIFT)) & I3C_SSTATUS_CHANDLED_MASK) - -#define I3C_SSTATUS_EVENT_MASK (0x40000U) -#define I3C_SSTATUS_EVENT_SHIFT (18U) -/*! EVENT - Event - * 0b1..IBI, CR, or HJ occurred - * 0b0..No event occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SSTATUS_EVENT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_EVENT_SHIFT)) & I3C_SSTATUS_EVENT_MASK) - -#define I3C_SSTATUS_EVDET_MASK (0x300000U) -#define I3C_SSTATUS_EVDET_SHIFT (20U) -/*! EVDET - Event Details - * 0b00..NONE (no event or no pending event) - * 0b01..NO_REQUEST (request is not sent yet; either there is no START condition yet, or is waiting for Bus-Available or Bus-Idle (HJ)) - * 0b10..NACKed (not acknowledged, request sent and rejected); I3C tries again - * 0b11..ACKed (acknowledged; request sent and accepted), so done (unless the time control data is still being sent) - */ -#define I3C_SSTATUS_EVDET(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_EVDET_SHIFT)) & I3C_SSTATUS_EVDET_MASK) - -#define I3C_SSTATUS_IBIDIS_MASK (0x1000000U) -#define I3C_SSTATUS_IBIDIS_SHIFT (24U) -/*! IBIDIS - In-Band Interrupts Disable - * 0b1..Disabled - * 0b0..Enabled - */ -#define I3C_SSTATUS_IBIDIS(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_IBIDIS_SHIFT)) & I3C_SSTATUS_IBIDIS_MASK) - -#define I3C_SSTATUS_MRDIS_MASK (0x2000000U) -#define I3C_SSTATUS_MRDIS_SHIFT (25U) -/*! MRDIS - Controller Requests Disable - * 0b1..Disabled - * 0b0..Enabled - */ -#define I3C_SSTATUS_MRDIS(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_MRDIS_SHIFT)) & I3C_SSTATUS_MRDIS_MASK) - -#define I3C_SSTATUS_HJDIS_MASK (0x8000000U) -#define I3C_SSTATUS_HJDIS_SHIFT (27U) -/*! HJDIS - Hot-Join Disabled - * 0b1..Disabled - * 0b0..Enabled - */ -#define I3C_SSTATUS_HJDIS(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_HJDIS_SHIFT)) & I3C_SSTATUS_HJDIS_MASK) - -#define I3C_SSTATUS_ACTSTATE_MASK (0x30000000U) -#define I3C_SSTATUS_ACTSTATE_SHIFT (28U) -/*! ACTSTATE - Activity State from Common Command Codes (CCC) - * 0b00..NO_LATENCY (normal bus operations) - * 0b01..LATENCY_1MS (1 ms of latency) - * 0b10..LATENCY_100MS (100 ms of latency) - * 0b11..LATENCY_10S (10 seconds of latency) - */ -#define I3C_SSTATUS_ACTSTATE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_ACTSTATE_SHIFT)) & I3C_SSTATUS_ACTSTATE_MASK) - -#define I3C_SSTATUS_TIMECTRL_MASK (0xC0000000U) -#define I3C_SSTATUS_TIMECTRL_SHIFT (30U) -/*! TIMECTRL - Time Control - * 0b00..NO_TIME_CONTROL (no time control is enabled) - * 0b01..SYNC_MODE (Synchronous mode is enabled) - * 0b10..ASYNC_MODE (Asynchronous standard mode (0 or 1) is enabled) - * 0b11..BOTHSYNCASYNC (both Synchronous and Asynchronous modes are enabled) - */ -#define I3C_SSTATUS_TIMECTRL(x) (((uint32_t)(((uint32_t)(x)) << I3C_SSTATUS_TIMECTRL_SHIFT)) & I3C_SSTATUS_TIMECTRL_MASK) -/*! @} */ - -/*! @name SCTRL - Target Control */ -/*! @{ */ - -#define I3C_SCTRL_EVENT_MASK (0x3U) -#define I3C_SCTRL_EVENT_SHIFT (0U) -/*! EVENT - Event - * 0b00..NORMAL_MODE - * 0b01..IBI - * 0b10..CONTROLLER_REQUEST - * 0b11..HOT_JOIN_REQUEST - */ -#define I3C_SCTRL_EVENT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCTRL_EVENT_SHIFT)) & I3C_SCTRL_EVENT_MASK) - -#define I3C_SCTRL_EXTDATA_MASK (0x8U) -#define I3C_SCTRL_EXTDATA_SHIFT (3U) -/*! EXTDATA - Extended Data - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SCTRL_EXTDATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCTRL_EXTDATA_SHIFT)) & I3C_SCTRL_EXTDATA_MASK) - -#define I3C_SCTRL_IBIDATA_MASK (0xFF00U) -#define I3C_SCTRL_IBIDATA_SHIFT (8U) -/*! IBIDATA - In-Band Interrupt Data */ -#define I3C_SCTRL_IBIDATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCTRL_IBIDATA_SHIFT)) & I3C_SCTRL_IBIDATA_MASK) - -#define I3C_SCTRL_PENDINT_MASK (0xF0000U) -#define I3C_SCTRL_PENDINT_SHIFT (16U) -/*! PENDINT - Pending Interrupt */ -#define I3C_SCTRL_PENDINT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCTRL_PENDINT_SHIFT)) & I3C_SCTRL_PENDINT_MASK) - -#define I3C_SCTRL_ACTSTATE_MASK (0x300000U) -#define I3C_SCTRL_ACTSTATE_SHIFT (20U) -/*! ACTSTATE - Activity State of Target */ -#define I3C_SCTRL_ACTSTATE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCTRL_ACTSTATE_SHIFT)) & I3C_SCTRL_ACTSTATE_MASK) - -#define I3C_SCTRL_VENDINFO_MASK (0xFF000000U) -#define I3C_SCTRL_VENDINFO_SHIFT (24U) -/*! VENDINFO - Vendor Information */ -#define I3C_SCTRL_VENDINFO(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCTRL_VENDINFO_SHIFT)) & I3C_SCTRL_VENDINFO_MASK) -/*! @} */ - -/*! @name SINTSET - Target Interrupt Set */ -/*! @{ */ - -#define I3C_SINTSET_START_MASK (0x100U) -#define I3C_SINTSET_START_SHIFT (8U) -/*! START - Start Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_START(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_START_SHIFT)) & I3C_SINTSET_START_MASK) - -#define I3C_SINTSET_MATCHED_MASK (0x200U) -#define I3C_SINTSET_MATCHED_SHIFT (9U) -/*! MATCHED - Match Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_MATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_MATCHED_SHIFT)) & I3C_SINTSET_MATCHED_MASK) - -#define I3C_SINTSET_STOP_MASK (0x400U) -#define I3C_SINTSET_STOP_SHIFT (10U) -/*! STOP - Stop Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_STOP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_STOP_SHIFT)) & I3C_SINTSET_STOP_MASK) - -#define I3C_SINTSET_RXPEND_MASK (0x800U) -#define I3C_SINTSET_RXPEND_SHIFT (11U) -/*! RXPEND - Receive Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_RXPEND_SHIFT)) & I3C_SINTSET_RXPEND_MASK) - -#define I3C_SINTSET_TXSEND_MASK (0x1000U) -#define I3C_SINTSET_TXSEND_SHIFT (12U) -/*! TXSEND - Transmit Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_TXSEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_TXSEND_SHIFT)) & I3C_SINTSET_TXSEND_MASK) - -#define I3C_SINTSET_DACHG_MASK (0x2000U) -#define I3C_SINTSET_DACHG_SHIFT (13U) -/*! DACHG - Dynamic Address Change Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_DACHG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_DACHG_SHIFT)) & I3C_SINTSET_DACHG_MASK) - -#define I3C_SINTSET_CCC_MASK (0x4000U) -#define I3C_SINTSET_CCC_SHIFT (14U) -/*! CCC - Common Command Code (CCC) Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_CCC(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_CCC_SHIFT)) & I3C_SINTSET_CCC_MASK) - -#define I3C_SINTSET_ERRWARN_MASK (0x8000U) -#define I3C_SINTSET_ERRWARN_SHIFT (15U) -/*! ERRWARN - Error or Warning Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_ERRWARN_SHIFT)) & I3C_SINTSET_ERRWARN_MASK) - -#define I3C_SINTSET_DDRMATCHED_MASK (0x10000U) -#define I3C_SINTSET_DDRMATCHED_SHIFT (16U) -/*! DDRMATCHED - Double Data Rate Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_DDRMATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_DDRMATCHED_SHIFT)) & I3C_SINTSET_DDRMATCHED_MASK) - -#define I3C_SINTSET_CHANDLED_MASK (0x20000U) -#define I3C_SINTSET_CHANDLED_SHIFT (17U) -/*! CHANDLED - Common Command Code (CCC) Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_CHANDLED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_CHANDLED_SHIFT)) & I3C_SINTSET_CHANDLED_MASK) - -#define I3C_SINTSET_EVENT_MASK (0x40000U) -#define I3C_SINTSET_EVENT_SHIFT (18U) -/*! EVENT - Event Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_SINTSET_EVENT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTSET_EVENT_SHIFT)) & I3C_SINTSET_EVENT_MASK) -/*! @} */ - -/*! @name SINTCLR - Target Interrupt Clear */ -/*! @{ */ - -#define I3C_SINTCLR_START_MASK (0x100U) -#define I3C_SINTCLR_START_SHIFT (8U) -/*! START - START Interrupt Enable Clear */ -#define I3C_SINTCLR_START(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_START_SHIFT)) & I3C_SINTCLR_START_MASK) - -#define I3C_SINTCLR_MATCHED_MASK (0x200U) -#define I3C_SINTCLR_MATCHED_SHIFT (9U) -/*! MATCHED - Matched Interrupt Enable Clear */ -#define I3C_SINTCLR_MATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_MATCHED_SHIFT)) & I3C_SINTCLR_MATCHED_MASK) - -#define I3C_SINTCLR_STOP_MASK (0x400U) -#define I3C_SINTCLR_STOP_SHIFT (10U) -/*! STOP - STOP Interrupt Enable Clear */ -#define I3C_SINTCLR_STOP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_STOP_SHIFT)) & I3C_SINTCLR_STOP_MASK) - -#define I3C_SINTCLR_RXPEND_MASK (0x800U) -#define I3C_SINTCLR_RXPEND_SHIFT (11U) -/*! RXPEND - RXPEND Interrupt Enable Clear */ -#define I3C_SINTCLR_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_RXPEND_SHIFT)) & I3C_SINTCLR_RXPEND_MASK) - -#define I3C_SINTCLR_TXSEND_MASK (0x1000U) -#define I3C_SINTCLR_TXSEND_SHIFT (12U) -/*! TXSEND - TXSEND Interrupt Enable Clear */ -#define I3C_SINTCLR_TXSEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_TXSEND_SHIFT)) & I3C_SINTCLR_TXSEND_MASK) - -#define I3C_SINTCLR_DACHG_MASK (0x2000U) -#define I3C_SINTCLR_DACHG_SHIFT (13U) -/*! DACHG - DACHG Interrupt Enable Clear */ -#define I3C_SINTCLR_DACHG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_DACHG_SHIFT)) & I3C_SINTCLR_DACHG_MASK) - -#define I3C_SINTCLR_CCC_MASK (0x4000U) -#define I3C_SINTCLR_CCC_SHIFT (14U) -/*! CCC - CCC Interrupt Enable Clear */ -#define I3C_SINTCLR_CCC(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_CCC_SHIFT)) & I3C_SINTCLR_CCC_MASK) - -#define I3C_SINTCLR_ERRWARN_MASK (0x8000U) -#define I3C_SINTCLR_ERRWARN_SHIFT (15U) -/*! ERRWARN - ERRWARN Interrupt Enable Clear */ -#define I3C_SINTCLR_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_ERRWARN_SHIFT)) & I3C_SINTCLR_ERRWARN_MASK) - -#define I3C_SINTCLR_DDRMATCHED_MASK (0x10000U) -#define I3C_SINTCLR_DDRMATCHED_SHIFT (16U) -/*! DDRMATCHED - DDRMATCHED Interrupt Enable Clear */ -#define I3C_SINTCLR_DDRMATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_DDRMATCHED_SHIFT)) & I3C_SINTCLR_DDRMATCHED_MASK) - -#define I3C_SINTCLR_CHANDLED_MASK (0x20000U) -#define I3C_SINTCLR_CHANDLED_SHIFT (17U) -/*! CHANDLED - CHANDLED Interrupt Enable Clear */ -#define I3C_SINTCLR_CHANDLED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_CHANDLED_SHIFT)) & I3C_SINTCLR_CHANDLED_MASK) - -#define I3C_SINTCLR_EVENT_MASK (0x40000U) -#define I3C_SINTCLR_EVENT_SHIFT (18U) -/*! EVENT - EVENT Interrupt Enable Clear */ -#define I3C_SINTCLR_EVENT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTCLR_EVENT_SHIFT)) & I3C_SINTCLR_EVENT_MASK) -/*! @} */ - -/*! @name SINTMASKED - Target Interrupt Mask */ -/*! @{ */ - -#define I3C_SINTMASKED_START_MASK (0x100U) -#define I3C_SINTMASKED_START_SHIFT (8U) -/*! START - START Interrupt Mask */ -#define I3C_SINTMASKED_START(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_START_SHIFT)) & I3C_SINTMASKED_START_MASK) - -#define I3C_SINTMASKED_MATCHED_MASK (0x200U) -#define I3C_SINTMASKED_MATCHED_SHIFT (9U) -/*! MATCHED - MATCHED Interrupt Mask */ -#define I3C_SINTMASKED_MATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_MATCHED_SHIFT)) & I3C_SINTMASKED_MATCHED_MASK) - -#define I3C_SINTMASKED_STOP_MASK (0x400U) -#define I3C_SINTMASKED_STOP_SHIFT (10U) -/*! STOP - STOP Interrupt Mask */ -#define I3C_SINTMASKED_STOP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_STOP_SHIFT)) & I3C_SINTMASKED_STOP_MASK) - -#define I3C_SINTMASKED_RXPEND_MASK (0x800U) -#define I3C_SINTMASKED_RXPEND_SHIFT (11U) -/*! RXPEND - RXPEND Interrupt Mask */ -#define I3C_SINTMASKED_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_RXPEND_SHIFT)) & I3C_SINTMASKED_RXPEND_MASK) - -#define I3C_SINTMASKED_TXSEND_MASK (0x1000U) -#define I3C_SINTMASKED_TXSEND_SHIFT (12U) -/*! TXSEND - TXSEND Interrupt Mask */ -#define I3C_SINTMASKED_TXSEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_TXSEND_SHIFT)) & I3C_SINTMASKED_TXSEND_MASK) - -#define I3C_SINTMASKED_DACHG_MASK (0x2000U) -#define I3C_SINTMASKED_DACHG_SHIFT (13U) -/*! DACHG - DACHG Interrupt Mask */ -#define I3C_SINTMASKED_DACHG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_DACHG_SHIFT)) & I3C_SINTMASKED_DACHG_MASK) - -#define I3C_SINTMASKED_CCC_MASK (0x4000U) -#define I3C_SINTMASKED_CCC_SHIFT (14U) -/*! CCC - CCC Interrupt Mask */ -#define I3C_SINTMASKED_CCC(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_CCC_SHIFT)) & I3C_SINTMASKED_CCC_MASK) - -#define I3C_SINTMASKED_ERRWARN_MASK (0x8000U) -#define I3C_SINTMASKED_ERRWARN_SHIFT (15U) -/*! ERRWARN - ERRWARN Interrupt Mask */ -#define I3C_SINTMASKED_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_ERRWARN_SHIFT)) & I3C_SINTMASKED_ERRWARN_MASK) - -#define I3C_SINTMASKED_DDRMATCHED_MASK (0x10000U) -#define I3C_SINTMASKED_DDRMATCHED_SHIFT (16U) -/*! DDRMATCHED - DDRMATCHED Interrupt Mask */ -#define I3C_SINTMASKED_DDRMATCHED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_DDRMATCHED_SHIFT)) & I3C_SINTMASKED_DDRMATCHED_MASK) - -#define I3C_SINTMASKED_CHANDLED_MASK (0x20000U) -#define I3C_SINTMASKED_CHANDLED_SHIFT (17U) -/*! CHANDLED - CHANDLED Interrupt Mask */ -#define I3C_SINTMASKED_CHANDLED(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_CHANDLED_SHIFT)) & I3C_SINTMASKED_CHANDLED_MASK) - -#define I3C_SINTMASKED_EVENT_MASK (0x40000U) -#define I3C_SINTMASKED_EVENT_SHIFT (18U) -/*! EVENT - EVENT Interrupt Mask */ -#define I3C_SINTMASKED_EVENT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SINTMASKED_EVENT_SHIFT)) & I3C_SINTMASKED_EVENT_MASK) -/*! @} */ - -/*! @name SERRWARN - Target Errors and Warnings */ -/*! @{ */ - -#define I3C_SERRWARN_ORUN_MASK (0x1U) -#define I3C_SERRWARN_ORUN_SHIFT (0U) -/*! ORUN - Overrun Error - * 0b1..Overrun error - * 0b0..No overrun error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_ORUN(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_ORUN_SHIFT)) & I3C_SERRWARN_ORUN_MASK) - -#define I3C_SERRWARN_URUN_MASK (0x2U) -#define I3C_SERRWARN_URUN_SHIFT (1U) -/*! URUN - Underrun Error - * 0b1..Underrun error - * 0b0..No underrun error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_URUN(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_URUN_SHIFT)) & I3C_SERRWARN_URUN_MASK) - -#define I3C_SERRWARN_URUNNACK_MASK (0x4U) -#define I3C_SERRWARN_URUNNACK_SHIFT (2U) -/*! URUNNACK - Underrun and Not Acknowledged (NACKed) Error - * 0b1..Underrun; not acknowledged error - * 0b0..No underrun; not acknowledged error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_URUNNACK(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_URUNNACK_SHIFT)) & I3C_SERRWARN_URUNNACK_MASK) - -#define I3C_SERRWARN_TERM_MASK (0x8U) -#define I3C_SERRWARN_TERM_SHIFT (3U) -/*! TERM - Terminated Error - * 0b1..Terminated error - * 0b0..No terminated error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_TERM(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_TERM_SHIFT)) & I3C_SERRWARN_TERM_MASK) - -#define I3C_SERRWARN_INVSTART_MASK (0x10U) -#define I3C_SERRWARN_INVSTART_SHIFT (4U) -/*! INVSTART - Invalid Start Error - * 0b1..Invalid start error - * 0b0..No invalid start error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_INVSTART(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_INVSTART_SHIFT)) & I3C_SERRWARN_INVSTART_MASK) - -#define I3C_SERRWARN_SPAR_MASK (0x100U) -#define I3C_SERRWARN_SPAR_SHIFT (8U) -/*! SPAR - SDR Parity Error - * 0b1..SDR parity error - * 0b0..No SDR parity error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_SPAR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_SPAR_SHIFT)) & I3C_SERRWARN_SPAR_MASK) - -#define I3C_SERRWARN_HPAR_MASK (0x200U) -#define I3C_SERRWARN_HPAR_SHIFT (9U) -/*! HPAR - HDR Parity Error - * 0b1..HDR parity error - * 0b0..No HDR parity error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_HPAR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_HPAR_SHIFT)) & I3C_SERRWARN_HPAR_MASK) - -#define I3C_SERRWARN_HCRC_MASK (0x400U) -#define I3C_SERRWARN_HCRC_SHIFT (10U) -/*! HCRC - HDR-DDR CRC Error - * 0b1..HDR-DDR CRC error occurred - * 0b0..No HDR-DDR CRC error occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_HCRC(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_HCRC_SHIFT)) & I3C_SERRWARN_HCRC_MASK) - -#define I3C_SERRWARN_S0S1_MASK (0x800U) -#define I3C_SERRWARN_S0S1_SHIFT (11U) -/*! S0S1 - TE0 or TE1 Error - * 0b1..TE0 or TE1 error occurred - * 0b0..No TE0 or TE1 error occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_S0S1(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_S0S1_SHIFT)) & I3C_SERRWARN_S0S1_MASK) - -#define I3C_SERRWARN_OREAD_MASK (0x10000U) -#define I3C_SERRWARN_OREAD_SHIFT (16U) -/*! OREAD - Over-Read Error - * 0b1..Over-read error - * 0b0..No over-read error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_OREAD(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_OREAD_SHIFT)) & I3C_SERRWARN_OREAD_MASK) - -#define I3C_SERRWARN_OWRITE_MASK (0x20000U) -#define I3C_SERRWARN_OWRITE_SHIFT (17U) -/*! OWRITE - Over-Write Error - * 0b1..Overwrite error - * 0b0..No overwrite error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_SERRWARN_OWRITE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SERRWARN_OWRITE_SHIFT)) & I3C_SERRWARN_OWRITE_MASK) -/*! @} */ - -/*! @name SDMACTRL - Target DMA Control */ -/*! @{ */ - -#define I3C_SDMACTRL_DMAFB_MASK (0x3U) -#define I3C_SDMACTRL_DMAFB_SHIFT (0U) -/*! DMAFB - DMA Read (From-Bus) Trigger - * 0b00..DMA not used - * 0b01..DMA enabled for one frame - * 0b10..DMA enabled until turned off - * 0b11.. - */ -#define I3C_SDMACTRL_DMAFB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDMACTRL_DMAFB_SHIFT)) & I3C_SDMACTRL_DMAFB_MASK) - -#define I3C_SDMACTRL_DMATB_MASK (0xCU) -#define I3C_SDMACTRL_DMATB_SHIFT (2U) -/*! DMATB - DMA Write (To-Bus) Trigger - * 0b00..DMA not used - * 0b01..DMA enabled for one frame - * 0b10..DMA enabled until turned off - * 0b11.. - */ -#define I3C_SDMACTRL_DMATB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDMACTRL_DMATB_SHIFT)) & I3C_SDMACTRL_DMATB_MASK) - -#define I3C_SDMACTRL_DMAWIDTH_MASK (0x30U) -#define I3C_SDMACTRL_DMAWIDTH_SHIFT (4U) -/*! DMAWIDTH - Width of DMA Operations - * 0b00, 0b01..Byte - * 0b10..Halfword (16 bits) (this value ensures that two bytes are available in the FIFO) - * 0b11.. - */ -#define I3C_SDMACTRL_DMAWIDTH(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDMACTRL_DMAWIDTH_SHIFT)) & I3C_SDMACTRL_DMAWIDTH_MASK) -/*! @} */ - -/*! @name SDATACTRL - Target Data Control */ -/*! @{ */ - -#define I3C_SDATACTRL_FLUSHTB_MASK (0x1U) -#define I3C_SDATACTRL_FLUSHTB_SHIFT (0U) -/*! FLUSHTB - Flush To-Bus Buffer or FIFO */ -#define I3C_SDATACTRL_FLUSHTB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_FLUSHTB_SHIFT)) & I3C_SDATACTRL_FLUSHTB_MASK) - -#define I3C_SDATACTRL_FLUSHFB_MASK (0x2U) -#define I3C_SDATACTRL_FLUSHFB_SHIFT (1U) -/*! FLUSHFB - Flush From-Bus Buffer or FIFO */ -#define I3C_SDATACTRL_FLUSHFB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_FLUSHFB_SHIFT)) & I3C_SDATACTRL_FLUSHFB_MASK) - -#define I3C_SDATACTRL_UNLOCK_MASK (0x8U) -#define I3C_SDATACTRL_UNLOCK_SHIFT (3U) -/*! UNLOCK - Unlock - * 0b0..Cannot be changed - * 0b1..Can be changed - */ -#define I3C_SDATACTRL_UNLOCK(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_UNLOCK_SHIFT)) & I3C_SDATACTRL_UNLOCK_MASK) - -#define I3C_SDATACTRL_TXTRIG_MASK (0x30U) -#define I3C_SDATACTRL_TXTRIG_SHIFT (4U) -/*! TXTRIG - Transmit Trigger Level - * 0b00..Trigger when empty - * 0b01..Trigger when 1/4 full or less - * 0b10..Trigger when 1/2 full or less - * 0b11..Default (trigger when 1 less than full or less) - */ -#define I3C_SDATACTRL_TXTRIG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_TXTRIG_SHIFT)) & I3C_SDATACTRL_TXTRIG_MASK) - -#define I3C_SDATACTRL_RXTRIG_MASK (0xC0U) -#define I3C_SDATACTRL_RXTRIG_SHIFT (6U) -/*! RXTRIG - Receive Trigger Level - * 0b00..Trigger when not empty - * 0b01..Trigger when 1/4 or more full - * 0b10..Trigger when 1/2 or more full - * 0b11..Trigger when 3/4 or more full - */ -#define I3C_SDATACTRL_RXTRIG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_RXTRIG_SHIFT)) & I3C_SDATACTRL_RXTRIG_MASK) - -#define I3C_SDATACTRL_TXCOUNT_MASK (0x1F0000U) -#define I3C_SDATACTRL_TXCOUNT_SHIFT (16U) -/*! TXCOUNT - Count of Bytes in Transmit */ -#define I3C_SDATACTRL_TXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_TXCOUNT_SHIFT)) & I3C_SDATACTRL_TXCOUNT_MASK) - -#define I3C_SDATACTRL_RXCOUNT_MASK (0x1F000000U) -#define I3C_SDATACTRL_RXCOUNT_SHIFT (24U) -/*! RXCOUNT - Count of Bytes in Receive */ -#define I3C_SDATACTRL_RXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_RXCOUNT_SHIFT)) & I3C_SDATACTRL_RXCOUNT_MASK) - -#define I3C_SDATACTRL_TXFULL_MASK (0x40000000U) -#define I3C_SDATACTRL_TXFULL_SHIFT (30U) -/*! TXFULL - Transmit is Full - * 0b1..Full - * 0b0..Not full - */ -#define I3C_SDATACTRL_TXFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_TXFULL_SHIFT)) & I3C_SDATACTRL_TXFULL_MASK) - -#define I3C_SDATACTRL_RXEMPTY_MASK (0x80000000U) -#define I3C_SDATACTRL_RXEMPTY_SHIFT (31U) -/*! RXEMPTY - Receive is Empty - * 0b1..Empty - * 0b0..Not empty - */ -#define I3C_SDATACTRL_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDATACTRL_RXEMPTY_SHIFT)) & I3C_SDATACTRL_RXEMPTY_MASK) -/*! @} */ - -/*! @name SWDATAB - Target Write Data Byte */ -/*! @{ */ - -#define I3C_SWDATAB_DATA_MASK (0xFFU) -#define I3C_SWDATAB_DATA_SHIFT (0U) -/*! DATA - Data */ -#define I3C_SWDATAB_DATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAB_DATA_SHIFT)) & I3C_SWDATAB_DATA_MASK) - -#define I3C_SWDATAB_END_MASK (0x100U) -#define I3C_SWDATAB_END_SHIFT (8U) -/*! END - End - * 0b1..End - * 0b0..Not the end - */ -#define I3C_SWDATAB_END(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAB_END_SHIFT)) & I3C_SWDATAB_END_MASK) - -#define I3C_SWDATAB_END_ALSO_MASK (0x10000U) -#define I3C_SWDATAB_END_ALSO_SHIFT (16U) -/*! END_ALSO - End Also - * 0b1..End - * 0b0..Not the end - */ -#define I3C_SWDATAB_END_ALSO(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAB_END_ALSO_SHIFT)) & I3C_SWDATAB_END_ALSO_MASK) -/*! @} */ - -/*! @name SWDATABE - Target Write Data Byte End */ -/*! @{ */ - -#define I3C_SWDATABE_DATA_MASK (0xFFU) -#define I3C_SWDATABE_DATA_SHIFT (0U) -/*! DATA - Data */ -#define I3C_SWDATABE_DATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATABE_DATA_SHIFT)) & I3C_SWDATABE_DATA_MASK) -/*! @} */ - -/*! @name SWDATAH - Target Write Data Halfword */ -/*! @{ */ - -#define I3C_SWDATAH_DATA0_MASK (0xFFU) -#define I3C_SWDATAH_DATA0_SHIFT (0U) -/*! DATA0 - Data 0 */ -#define I3C_SWDATAH_DATA0(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAH_DATA0_SHIFT)) & I3C_SWDATAH_DATA0_MASK) - -#define I3C_SWDATAH_DATA1_MASK (0xFF00U) -#define I3C_SWDATAH_DATA1_SHIFT (8U) -/*! DATA1 - Data 1 */ -#define I3C_SWDATAH_DATA1(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAH_DATA1_SHIFT)) & I3C_SWDATAH_DATA1_MASK) - -#define I3C_SWDATAH_END_MASK (0x10000U) -#define I3C_SWDATAH_END_SHIFT (16U) -/*! END - End of Message - * 0b1..End - * 0b0..Not the end - */ -#define I3C_SWDATAH_END(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAH_END_SHIFT)) & I3C_SWDATAH_END_MASK) -/*! @} */ - -/*! @name SWDATAHE - Target Write Data Halfword End */ -/*! @{ */ - -#define I3C_SWDATAHE_DATA0_MASK (0xFFU) -#define I3C_SWDATAHE_DATA0_SHIFT (0U) -/*! DATA0 - Data 0 */ -#define I3C_SWDATAHE_DATA0(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAHE_DATA0_SHIFT)) & I3C_SWDATAHE_DATA0_MASK) - -#define I3C_SWDATAHE_DATA1_MASK (0xFF00U) -#define I3C_SWDATAHE_DATA1_SHIFT (8U) -/*! DATA1 - Data 1 */ -#define I3C_SWDATAHE_DATA1(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAHE_DATA1_SHIFT)) & I3C_SWDATAHE_DATA1_MASK) -/*! @} */ - -/*! @name SRDATAB - Target Read Data Byte */ -/*! @{ */ - -#define I3C_SRDATAB_DATA0_MASK (0xFFU) -#define I3C_SRDATAB_DATA0_SHIFT (0U) -/*! DATA0 - Data 0 */ -#define I3C_SRDATAB_DATA0(x) (((uint32_t)(((uint32_t)(x)) << I3C_SRDATAB_DATA0_SHIFT)) & I3C_SRDATAB_DATA0_MASK) -/*! @} */ - -/*! @name SRDATAH - Target Read Data Halfword */ -/*! @{ */ - -#define I3C_SRDATAH_LSB_MASK (0xFFU) -#define I3C_SRDATAH_LSB_SHIFT (0U) -/*! LSB - Low Byte */ -#define I3C_SRDATAH_LSB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SRDATAH_LSB_SHIFT)) & I3C_SRDATAH_LSB_MASK) - -#define I3C_SRDATAH_MSB_MASK (0xFF00U) -#define I3C_SRDATAH_MSB_SHIFT (8U) -/*! MSB - High Byte */ -#define I3C_SRDATAH_MSB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SRDATAH_MSB_SHIFT)) & I3C_SRDATAH_MSB_MASK) -/*! @} */ - -/*! @name SWDATAB1 - Target Write Data Byte */ -/*! @{ */ - -#define I3C_SWDATAB1_DATA_MASK (0xFFU) -#define I3C_SWDATAB1_DATA_SHIFT (0U) -/*! DATA - Data */ -#define I3C_SWDATAB1_DATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SWDATAB1_DATA_SHIFT)) & I3C_SWDATAB1_DATA_MASK) -/*! @} */ - -/*! @name SCAPABILITIES2 - Target Capabilities 2 */ -/*! @{ */ - -#define I3C_SCAPABILITIES2_MAPCNT_MASK (0xFU) -#define I3C_SCAPABILITIES2_MAPCNT_SHIFT (0U) -/*! MAPCNT - Map Count */ -#define I3C_SCAPABILITIES2_MAPCNT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_MAPCNT_SHIFT)) & I3C_SCAPABILITIES2_MAPCNT_MASK) - -#define I3C_SCAPABILITIES2_I2C10B_MASK (0x10U) -#define I3C_SCAPABILITIES2_I2C10B_SHIFT (4U) -/*! I2C10B - I2C 10-bit Address - * 0b0..Not supported - * 0b1..Supported - */ -#define I3C_SCAPABILITIES2_I2C10B(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_I2C10B_SHIFT)) & I3C_SCAPABILITIES2_I2C10B_MASK) - -#define I3C_SCAPABILITIES2_I2CRST_MASK (0x20U) -#define I3C_SCAPABILITIES2_I2CRST_SHIFT (5U) -/*! I2CRST - I2C Software Reset - * 0b0..Not supported - * 0b1..Supported - */ -#define I3C_SCAPABILITIES2_I2CRST(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_I2CRST_SHIFT)) & I3C_SCAPABILITIES2_I2CRST_MASK) - -#define I3C_SCAPABILITIES2_I2CDEVID_MASK (0x40U) -#define I3C_SCAPABILITIES2_I2CDEVID_SHIFT (6U) -/*! I2CDEVID - I2C Device ID - * 0b0..Not supported - * 0b1..Supported - */ -#define I3C_SCAPABILITIES2_I2CDEVID(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_I2CDEVID_SHIFT)) & I3C_SCAPABILITIES2_I2CDEVID_MASK) - -#define I3C_SCAPABILITIES2_IBIEXT_MASK (0x100U) -#define I3C_SCAPABILITIES2_IBIEXT_SHIFT (8U) -/*! IBIEXT - In-Band Interrupt EXTDATA - * 0b0..Not supported - * 0b1..Supported - */ -#define I3C_SCAPABILITIES2_IBIEXT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_IBIEXT_SHIFT)) & I3C_SCAPABILITIES2_IBIEXT_MASK) - -#define I3C_SCAPABILITIES2_IBIXREG_MASK (0x200U) -#define I3C_SCAPABILITIES2_IBIXREG_SHIFT (9U) -/*! IBIXREG - In-Band Interrupt Extended Register - * 0b0..Not supported - * 0b1..Supported - */ -#define I3C_SCAPABILITIES2_IBIXREG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_IBIXREG_SHIFT)) & I3C_SCAPABILITIES2_IBIXREG_MASK) - -#define I3C_SCAPABILITIES2_SLVRST_MASK (0x20000U) -#define I3C_SCAPABILITIES2_SLVRST_SHIFT (17U) -/*! SLVRST - Target Reset - * 0b0..Not supported - * 0b1..Supported - */ -#define I3C_SCAPABILITIES2_SLVRST(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_SLVRST_SHIFT)) & I3C_SCAPABILITIES2_SLVRST_MASK) - -#define I3C_SCAPABILITIES2_GROUP_MASK (0xC0000U) -#define I3C_SCAPABILITIES2_GROUP_SHIFT (18U) -/*! GROUP - Group - * 0b00..v1.1 group addressing not supported - * 0b01..One group supported - * 0b10..Two groups supported - * 0b11..Three groups supported - */ -#define I3C_SCAPABILITIES2_GROUP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_GROUP_SHIFT)) & I3C_SCAPABILITIES2_GROUP_MASK) - -#define I3C_SCAPABILITIES2_AASA_MASK (0x200000U) -#define I3C_SCAPABILITIES2_AASA_SHIFT (21U) -/*! AASA - SETAASA - * 0b1..SETAASA supported - * 0b0..SETAASA not supported - */ -#define I3C_SCAPABILITIES2_AASA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_AASA_SHIFT)) & I3C_SCAPABILITIES2_AASA_MASK) - -#define I3C_SCAPABILITIES2_SSTSUB_MASK (0x400000U) -#define I3C_SCAPABILITIES2_SSTSUB_SHIFT (22U) -/*! SSTSUB - Target-Target(s)-Tunnel Subscriber Capable - * 0b1..Subscriber capable - * 0b0..Not subscriber capable - */ -#define I3C_SCAPABILITIES2_SSTSUB(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_SSTSUB_SHIFT)) & I3C_SCAPABILITIES2_SSTSUB_MASK) - -#define I3C_SCAPABILITIES2_SSTWR_MASK (0x800000U) -#define I3C_SCAPABILITIES2_SSTWR_SHIFT (23U) -/*! SSTWR - Target-Target(s)-Tunnel Write Capable - * 0b1..Write capable - * 0b0..Not write capable - */ -#define I3C_SCAPABILITIES2_SSTWR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES2_SSTWR_SHIFT)) & I3C_SCAPABILITIES2_SSTWR_MASK) -/*! @} */ - -/*! @name SCAPABILITIES - Target Capabilities */ -/*! @{ */ - -#define I3C_SCAPABILITIES_IDENA_MASK (0x3U) -#define I3C_SCAPABILITIES_IDENA_SHIFT (0U) -/*! IDENA - ID 48b Handler - * 0b00..Application - * 0b01..Hardware - * 0b10..Hardware, but the I3C module instance handles ID 48b - * 0b11..A part number register (PARTNO) - */ -#define I3C_SCAPABILITIES_IDENA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_IDENA_SHIFT)) & I3C_SCAPABILITIES_IDENA_MASK) - -#define I3C_SCAPABILITIES_IDREG_MASK (0x3CU) -#define I3C_SCAPABILITIES_IDREG_SHIFT (2U) -/*! IDREG - ID Register - * 0b0000..All ID register features disabled - * 0bxxx1..ID Instance is a register; used if there is no PARTNO register - * 0bxx1x..An ID Random field is available - * 0bx1xx..A Device Characteristic Register (DCR) is available - * 0b1xxx..A Bus Characteristics Register (BCR) is available - */ -#define I3C_SCAPABILITIES_IDREG(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_IDREG_SHIFT)) & I3C_SCAPABILITIES_IDREG_MASK) - -#define I3C_SCAPABILITIES_HDRSUPP_MASK (0xC0U) -#define I3C_SCAPABILITIES_HDRSUPP_SHIFT (6U) -/*! HDRSUPP - High Data Rate Support - * 0b00..No HDR modes supported - * 0b01..DDR mode supported - * *.. - */ -#define I3C_SCAPABILITIES_HDRSUPP(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_HDRSUPP_SHIFT)) & I3C_SCAPABILITIES_HDRSUPP_MASK) - -#define I3C_SCAPABILITIES_MASTER_MASK (0x200U) -#define I3C_SCAPABILITIES_MASTER_SHIFT (9U) -/*! MASTER - Controller - * 0b0..Not supported - * 0b1..Supported - */ -#define I3C_SCAPABILITIES_MASTER(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_MASTER_SHIFT)) & I3C_SCAPABILITIES_MASTER_MASK) - -#define I3C_SCAPABILITIES_SADDR_MASK (0xC00U) -#define I3C_SCAPABILITIES_SADDR_SHIFT (10U) -/*! SADDR - Static Address - * 0b00..No static address - * 0b01..Static address is fixed in hardware - * 0b10..Hardware controls the static address dynamically (for example, from the pin strap) - * 0b11..SCONFIG register supplies the static address - */ -#define I3C_SCAPABILITIES_SADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_SADDR_SHIFT)) & I3C_SCAPABILITIES_SADDR_MASK) - -#define I3C_SCAPABILITIES_CCCHANDLE_MASK (0xF000U) -#define I3C_SCAPABILITIES_CCCHANDLE_SHIFT (12U) -/*! CCCHANDLE - Common Command Codes Handling - * 0b0000..All handling features disabled - * 0bxxx1..The I3C module manages events, activities, status, HDR, and if enabled for it, ID and static-address-related items - * 0bxx1x..The I3C module manages maximum read and write lengths, and max data speed - * 0bx1xx..GETSTATUS CCC returns the values of SCTRL[PENDINT] and SCTRL[ACTSTATE] - * 0b1xxx..GETSTATUS CCC returns the value of SCTRL[VENDINFO] - */ -#define I3C_SCAPABILITIES_CCCHANDLE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_CCCHANDLE_SHIFT)) & I3C_SCAPABILITIES_CCCHANDLE_MASK) - -#define I3C_SCAPABILITIES_IBI_MR_HJ_MASK (0x1F0000U) -#define I3C_SCAPABILITIES_IBI_MR_HJ_SHIFT (16U) -/*! IBI_MR_HJ - In-Band Interrupts, Controller Requests, Hot-Join Events - * 0b00000..Application cannot generate IBI, CR, or HJ - * 0bxxxx1..Application can generate an IBI - * 0bxxx1x..When bit 0 = 1, the IBI has data from the SCTRL register - * 0bxx1xx..Application can generate a controller request for a secondary controller - * 0bx1xxx..Application can generate a Hot-Join event - * 0b1xxxx..Application can use SCONFIG[BAMATCH] for bus-available timing - */ -#define I3C_SCAPABILITIES_IBI_MR_HJ(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_IBI_MR_HJ_SHIFT)) & I3C_SCAPABILITIES_IBI_MR_HJ_MASK) - -#define I3C_SCAPABILITIES_TIMECTRL_MASK (0x200000U) -#define I3C_SCAPABILITIES_TIMECTRL_SHIFT (21U) -/*! TIMECTRL - Time Control - * 0b0..No time control supported - * 0b1..At least one time-control type supported - */ -#define I3C_SCAPABILITIES_TIMECTRL(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_TIMECTRL_SHIFT)) & I3C_SCAPABILITIES_TIMECTRL_MASK) - -#define I3C_SCAPABILITIES_EXTFIFO_MASK (0x3800000U) -#define I3C_SCAPABILITIES_EXTFIFO_SHIFT (23U) -/*! EXTFIFO - External FIFO - * 0b000..No external FIFO available - * 0b001..Standard available or free external FIFO - * 0b010..Request track external FIFO - * *.. - */ -#define I3C_SCAPABILITIES_EXTFIFO(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_EXTFIFO_SHIFT)) & I3C_SCAPABILITIES_EXTFIFO_MASK) - -#define I3C_SCAPABILITIES_FIFOTX_MASK (0xC000000U) -#define I3C_SCAPABILITIES_FIFOTX_SHIFT (26U) -/*! FIFOTX - FIFO Transmit - * 0b00..Two - * 0b01..Four - * 0b10..Eight - * 0b11..16 or larger - */ -#define I3C_SCAPABILITIES_FIFOTX(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_FIFOTX_SHIFT)) & I3C_SCAPABILITIES_FIFOTX_MASK) - -#define I3C_SCAPABILITIES_FIFORX_MASK (0x30000000U) -#define I3C_SCAPABILITIES_FIFORX_SHIFT (28U) -/*! FIFORX - FIFO Receive - * 0b00..Two or three - * 0b01..Four - * 0b10..Eight - * 0b11..16 or larger - */ -#define I3C_SCAPABILITIES_FIFORX(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_FIFORX_SHIFT)) & I3C_SCAPABILITIES_FIFORX_MASK) - -#define I3C_SCAPABILITIES_INT_MASK (0x40000000U) -#define I3C_SCAPABILITIES_INT_SHIFT (30U) -/*! INT - Interrupts - * 0b1..Supported - * 0b0..Not supported - */ -#define I3C_SCAPABILITIES_INT(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_INT_SHIFT)) & I3C_SCAPABILITIES_INT_MASK) - -#define I3C_SCAPABILITIES_DMA_MASK (0x80000000U) -#define I3C_SCAPABILITIES_DMA_SHIFT (31U) -/*! DMA - Direct Memory Access - * 0b1..Supported - * 0b0..Not supported - */ -#define I3C_SCAPABILITIES_DMA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SCAPABILITIES_DMA_SHIFT)) & I3C_SCAPABILITIES_DMA_MASK) -/*! @} */ - -/*! @name SDYNADDR - Target Dynamic Address */ -/*! @{ */ - -#define I3C_SDYNADDR_DAVALID_MASK (0x1U) -#define I3C_SDYNADDR_DAVALID_SHIFT (0U) -/*! DAVALID - Dynamic Address Valid - * 0b0..DANOTASSIGNED: a dynamic address is not assigned - * 0b1..DAASSIGNED: a dynamic address is assigned - */ -#define I3C_SDYNADDR_DAVALID(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDYNADDR_DAVALID_SHIFT)) & I3C_SDYNADDR_DAVALID_MASK) - -#define I3C_SDYNADDR_DADDR_MASK (0xFEU) -#define I3C_SDYNADDR_DADDR_SHIFT (1U) -/*! DADDR - Dynamic Address */ -#define I3C_SDYNADDR_DADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDYNADDR_DADDR_SHIFT)) & I3C_SDYNADDR_DADDR_MASK) - -#define I3C_SDYNADDR_MAPSA_MASK (0x1000U) -#define I3C_SDYNADDR_MAPSA_SHIFT (12U) -/*! MAPSA - Map a Static Address */ -#define I3C_SDYNADDR_MAPSA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDYNADDR_MAPSA_SHIFT)) & I3C_SDYNADDR_MAPSA_MASK) - -#define I3C_SDYNADDR_SA10B_MASK (0xE000U) -#define I3C_SDYNADDR_SA10B_SHIFT (13U) -/*! SA10B - 10-Bit Static Address */ -#define I3C_SDYNADDR_SA10B(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDYNADDR_SA10B_SHIFT)) & I3C_SDYNADDR_SA10B_MASK) - -#define I3C_SDYNADDR_KEY_MASK (0xFFFF0000U) -#define I3C_SDYNADDR_KEY_SHIFT (16U) -/*! KEY - Key */ -#define I3C_SDYNADDR_KEY(x) (((uint32_t)(((uint32_t)(x)) << I3C_SDYNADDR_KEY_SHIFT)) & I3C_SDYNADDR_KEY_MASK) -/*! @} */ - -/*! @name SMAXLIMITS - Target Maximum Limits */ -/*! @{ */ - -#define I3C_SMAXLIMITS_MAXRD_MASK (0xFFFU) -#define I3C_SMAXLIMITS_MAXRD_SHIFT (0U) -/*! MAXRD - Maximum Read Length */ -#define I3C_SMAXLIMITS_MAXRD(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMAXLIMITS_MAXRD_SHIFT)) & I3C_SMAXLIMITS_MAXRD_MASK) - -#define I3C_SMAXLIMITS_MAXWR_MASK (0xFFF0000U) -#define I3C_SMAXLIMITS_MAXWR_SHIFT (16U) -/*! MAXWR - Maximum Write Length */ -#define I3C_SMAXLIMITS_MAXWR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMAXLIMITS_MAXWR_SHIFT)) & I3C_SMAXLIMITS_MAXWR_MASK) -/*! @} */ - -/*! @name SIDPARTNO - Target ID Part Number */ -/*! @{ */ - -#define I3C_SIDPARTNO_PARTNO_MASK (0xFFFFFFFFU) -#define I3C_SIDPARTNO_PARTNO_SHIFT (0U) -/*! PARTNO - Part Number */ -#define I3C_SIDPARTNO_PARTNO(x) (((uint32_t)(((uint32_t)(x)) << I3C_SIDPARTNO_PARTNO_SHIFT)) & I3C_SIDPARTNO_PARTNO_MASK) -/*! @} */ - -/*! @name SIDEXT - Target ID Extension */ -/*! @{ */ - -#define I3C_SIDEXT_DCR_MASK (0xFF00U) -#define I3C_SIDEXT_DCR_SHIFT (8U) -/*! DCR - Device Characteristic Register */ -#define I3C_SIDEXT_DCR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SIDEXT_DCR_SHIFT)) & I3C_SIDEXT_DCR_MASK) - -#define I3C_SIDEXT_BCR_MASK (0xFF0000U) -#define I3C_SIDEXT_BCR_SHIFT (16U) -/*! BCR - Bus Characteristics Register */ -#define I3C_SIDEXT_BCR(x) (((uint32_t)(((uint32_t)(x)) << I3C_SIDEXT_BCR_SHIFT)) & I3C_SIDEXT_BCR_MASK) -/*! @} */ - -/*! @name SVENDORID - Target Vendor ID */ -/*! @{ */ - -#define I3C_SVENDORID_VID_MASK (0x7FFFU) -#define I3C_SVENDORID_VID_SHIFT (0U) -/*! VID - Vendor ID */ -#define I3C_SVENDORID_VID(x) (((uint32_t)(((uint32_t)(x)) << I3C_SVENDORID_VID_SHIFT)) & I3C_SVENDORID_VID_MASK) -/*! @} */ - -/*! @name STCCLOCK - Target Time Control Clock */ -/*! @{ */ - -#define I3C_STCCLOCK_ACCURACY_MASK (0xFFU) -#define I3C_STCCLOCK_ACCURACY_SHIFT (0U) -/*! ACCURACY - Clock Accuracy */ -#define I3C_STCCLOCK_ACCURACY(x) (((uint32_t)(((uint32_t)(x)) << I3C_STCCLOCK_ACCURACY_SHIFT)) & I3C_STCCLOCK_ACCURACY_MASK) - -#define I3C_STCCLOCK_FREQ_MASK (0xFF00U) -#define I3C_STCCLOCK_FREQ_SHIFT (8U) -/*! FREQ - Clock Frequency */ -#define I3C_STCCLOCK_FREQ(x) (((uint32_t)(((uint32_t)(x)) << I3C_STCCLOCK_FREQ_SHIFT)) & I3C_STCCLOCK_FREQ_MASK) -/*! @} */ - -/*! @name SMSGMAPADDR - Target Message Map Address */ -/*! @{ */ - -#define I3C_SMSGMAPADDR_MAPLAST_MASK (0xFU) -#define I3C_SMSGMAPADDR_MAPLAST_SHIFT (0U) -/*! MAPLAST - Matched Address Index */ -#define I3C_SMSGMAPADDR_MAPLAST(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMSGMAPADDR_MAPLAST_SHIFT)) & I3C_SMSGMAPADDR_MAPLAST_MASK) - -#define I3C_SMSGMAPADDR_LASTSTATIC_MASK (0x10U) -#define I3C_SMSGMAPADDR_LASTSTATIC_SHIFT (4U) -/*! LASTSTATIC - Last Static Address Matched - * 0b1..I2C static address - * 0b0..I3C dynamic address - */ -#define I3C_SMSGMAPADDR_LASTSTATIC(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMSGMAPADDR_LASTSTATIC_SHIFT)) & I3C_SMSGMAPADDR_LASTSTATIC_MASK) - -#define I3C_SMSGMAPADDR_MAPLASTM1_MASK (0xF00U) -#define I3C_SMSGMAPADDR_MAPLASTM1_SHIFT (8U) -/*! MAPLASTM1 - Matched Previous Address Index 1 */ -#define I3C_SMSGMAPADDR_MAPLASTM1(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMSGMAPADDR_MAPLASTM1_SHIFT)) & I3C_SMSGMAPADDR_MAPLASTM1_MASK) - -#define I3C_SMSGMAPADDR_MAPLASTM2_MASK (0xF0000U) -#define I3C_SMSGMAPADDR_MAPLASTM2_SHIFT (16U) -/*! MAPLASTM2 - Matched Previous Index 2 */ -#define I3C_SMSGMAPADDR_MAPLASTM2(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMSGMAPADDR_MAPLASTM2_SHIFT)) & I3C_SMSGMAPADDR_MAPLASTM2_MASK) -/*! @} */ - -/*! @name MCTRL - Controller Control */ -/*! @{ */ - -#define I3C_MCTRL_REQUEST_MASK (0x7U) -#define I3C_MCTRL_REQUEST_SHIFT (0U) -/*! REQUEST - Request - * 0b000..NONE - * 0b001..EMITSTARTADDR - * 0b010..EMITSTOP - * 0b011..IBIACKNACK - * 0b100..PROCESSDAA - * 0b101.. - * 0b110..Force Exit and Target Reset - * 0b111..AUTOIBI - */ -#define I3C_MCTRL_REQUEST(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCTRL_REQUEST_SHIFT)) & I3C_MCTRL_REQUEST_MASK) - -#define I3C_MCTRL_TYPE_MASK (0x30U) -#define I3C_MCTRL_TYPE_SHIFT (4U) -/*! TYPE - Bus Type with EmitStartAddr - * 0b00..I3C - * 0b01..I2C - * 0b10..DDR - * 0b11.. - */ -#define I3C_MCTRL_TYPE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCTRL_TYPE_SHIFT)) & I3C_MCTRL_TYPE_MASK) - -#define I3C_MCTRL_IBIRESP_MASK (0xC0U) -#define I3C_MCTRL_IBIRESP_SHIFT (6U) -/*! IBIRESP - In-Band Interrupt Response - * 0b00..ACK (acknowledge) - * 0b01..NACK (reject) - * 0b10..Acknowledge with mandatory byte - * 0b11..Manual - */ -#define I3C_MCTRL_IBIRESP(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCTRL_IBIRESP_SHIFT)) & I3C_MCTRL_IBIRESP_MASK) - -#define I3C_MCTRL_DIR_MASK (0x100U) -#define I3C_MCTRL_DIR_SHIFT (8U) -/*! DIR - Direction - * 0b0..Write - * 0b1..Read - */ -#define I3C_MCTRL_DIR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCTRL_DIR_SHIFT)) & I3C_MCTRL_DIR_MASK) - -#define I3C_MCTRL_ADDR_MASK (0xFE00U) -#define I3C_MCTRL_ADDR_SHIFT (9U) -/*! ADDR - Address */ -#define I3C_MCTRL_ADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCTRL_ADDR_SHIFT)) & I3C_MCTRL_ADDR_MASK) - -#define I3C_MCTRL_RDTERM_MASK (0xFF0000U) -#define I3C_MCTRL_RDTERM_SHIFT (16U) -/*! RDTERM - Read Terminate Counter */ -#define I3C_MCTRL_RDTERM(x) (((uint32_t)(((uint32_t)(x)) << I3C_MCTRL_RDTERM_SHIFT)) & I3C_MCTRL_RDTERM_MASK) -/*! @} */ - -/*! @name MSTATUS - Controller Status */ -/*! @{ */ - -#define I3C_MSTATUS_STATE_MASK (0x7U) -#define I3C_MSTATUS_STATE_SHIFT (0U) -/*! STATE - State of the Controller - * 0b000..IDLE (bus has stopped) - * 0b001..SLVREQ (target request) - * 0b010..MSGSDR - * 0b011..NORMACT - * 0b100..MSGDDR - * 0b101..DAA - * 0b110..IBIACK - * 0b111..IBIRCV - */ -#define I3C_MSTATUS_STATE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_STATE_SHIFT)) & I3C_MSTATUS_STATE_MASK) - -#define I3C_MSTATUS_BETWEEN_MASK (0x10U) -#define I3C_MSTATUS_BETWEEN_SHIFT (4U) -/*! BETWEEN - Between - * 0b0..Inactive (for other cases) - * 0b1..Active - */ -#define I3C_MSTATUS_BETWEEN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_BETWEEN_SHIFT)) & I3C_MSTATUS_BETWEEN_MASK) - -#define I3C_MSTATUS_NACKED_MASK (0x20U) -#define I3C_MSTATUS_NACKED_SHIFT (5U) -/*! NACKED - Not Acknowledged - * 0b1..NACKed (not acknowledged) - * 0b0..Not NACKed - */ -#define I3C_MSTATUS_NACKED(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_NACKED_SHIFT)) & I3C_MSTATUS_NACKED_MASK) - -#define I3C_MSTATUS_IBITYPE_MASK (0xC0U) -#define I3C_MSTATUS_IBITYPE_SHIFT (6U) -/*! IBITYPE - In-Band Interrupt (IBI) Type - * 0b00..NONE (no IBI: this status occurs when MSTATUS[IBIWON] becomes 0) - * 0b01..IBI - * 0b10..CR - * 0b11..HJ - */ -#define I3C_MSTATUS_IBITYPE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_IBITYPE_SHIFT)) & I3C_MSTATUS_IBITYPE_MASK) - -#define I3C_MSTATUS_SLVSTART_MASK (0x100U) -#define I3C_MSTATUS_SLVSTART_SHIFT (8U) -/*! SLVSTART - Target Start - * 0b1..Target requesting START - * 0b0..Target not requesting START - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MSTATUS_SLVSTART(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_SLVSTART_SHIFT)) & I3C_MSTATUS_SLVSTART_MASK) - -#define I3C_MSTATUS_MCTRLDONE_MASK (0x200U) -#define I3C_MSTATUS_MCTRLDONE_SHIFT (9U) -/*! MCTRLDONE - Controller Control Done - * 0b1..Done - * 0b0..Not done - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MSTATUS_MCTRLDONE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_MCTRLDONE_SHIFT)) & I3C_MSTATUS_MCTRLDONE_MASK) - -#define I3C_MSTATUS_COMPLETE_MASK (0x400U) -#define I3C_MSTATUS_COMPLETE_SHIFT (10U) -/*! COMPLETE - Complete - * 0b1..Complete - * 0b0..Not complete - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MSTATUS_COMPLETE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_COMPLETE_SHIFT)) & I3C_MSTATUS_COMPLETE_MASK) - -#define I3C_MSTATUS_RXPEND_MASK (0x800U) -#define I3C_MSTATUS_RXPEND_SHIFT (11U) -/*! RXPEND - RXPEND - * 0b1..Receive message pending - * 0b0..No receive message pending - */ -#define I3C_MSTATUS_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_RXPEND_SHIFT)) & I3C_MSTATUS_RXPEND_MASK) - -#define I3C_MSTATUS_TXNOTFULL_MASK (0x1000U) -#define I3C_MSTATUS_TXNOTFULL_SHIFT (12U) -/*! TXNOTFULL - TX Buffer or FIFO Not Full - * 0b1..Receive buffer or FIFO not full - * 0b0..Receive buffer or FIFO full - */ -#define I3C_MSTATUS_TXNOTFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_TXNOTFULL_SHIFT)) & I3C_MSTATUS_TXNOTFULL_MASK) - -#define I3C_MSTATUS_IBIWON_MASK (0x2000U) -#define I3C_MSTATUS_IBIWON_SHIFT (13U) -/*! IBIWON - In-Band Interrupt (IBI) Won - * 0b1..IBI arbitration won - * 0b0..No IBI arbitration won - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MSTATUS_IBIWON(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_IBIWON_SHIFT)) & I3C_MSTATUS_IBIWON_MASK) - -#define I3C_MSTATUS_ERRWARN_MASK (0x8000U) -#define I3C_MSTATUS_ERRWARN_SHIFT (15U) -/*! ERRWARN - Error or Warning - * 0b1..Error or warning - * 0b0..No error or warning - */ -#define I3C_MSTATUS_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_ERRWARN_SHIFT)) & I3C_MSTATUS_ERRWARN_MASK) - -#define I3C_MSTATUS_NOWMASTER_MASK (0x80000U) -#define I3C_MSTATUS_NOWMASTER_SHIFT (19U) -/*! NOWMASTER - Module is now Controller - * 0b1..Controller - * 0b0..Not a controller - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MSTATUS_NOWMASTER(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_NOWMASTER_SHIFT)) & I3C_MSTATUS_NOWMASTER_MASK) - -#define I3C_MSTATUS_IBIADDR_MASK (0x7F000000U) -#define I3C_MSTATUS_IBIADDR_SHIFT (24U) -/*! IBIADDR - IBI Address */ -#define I3C_MSTATUS_IBIADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MSTATUS_IBIADDR_SHIFT)) & I3C_MSTATUS_IBIADDR_MASK) -/*! @} */ - -/*! @name MIBIRULES - Controller In-band Interrupt Registry and Rules */ -/*! @{ */ - -#define I3C_MIBIRULES_ADDR0_MASK (0x3FU) -#define I3C_MIBIRULES_ADDR0_SHIFT (0U) -/*! ADDR0 - ADDR0 */ -#define I3C_MIBIRULES_ADDR0(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_ADDR0_SHIFT)) & I3C_MIBIRULES_ADDR0_MASK) - -#define I3C_MIBIRULES_ADDR1_MASK (0xFC0U) -#define I3C_MIBIRULES_ADDR1_SHIFT (6U) -/*! ADDR1 - ADDR1 */ -#define I3C_MIBIRULES_ADDR1(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_ADDR1_SHIFT)) & I3C_MIBIRULES_ADDR1_MASK) - -#define I3C_MIBIRULES_ADDR2_MASK (0x3F000U) -#define I3C_MIBIRULES_ADDR2_SHIFT (12U) -/*! ADDR2 - ADDR2 */ -#define I3C_MIBIRULES_ADDR2(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_ADDR2_SHIFT)) & I3C_MIBIRULES_ADDR2_MASK) - -#define I3C_MIBIRULES_ADDR3_MASK (0xFC0000U) -#define I3C_MIBIRULES_ADDR3_SHIFT (18U) -/*! ADDR3 - ADDR3 */ -#define I3C_MIBIRULES_ADDR3(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_ADDR3_SHIFT)) & I3C_MIBIRULES_ADDR3_MASK) - -#define I3C_MIBIRULES_ADDR4_MASK (0x3F000000U) -#define I3C_MIBIRULES_ADDR4_SHIFT (24U) -/*! ADDR4 - ADDR4 */ -#define I3C_MIBIRULES_ADDR4(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_ADDR4_SHIFT)) & I3C_MIBIRULES_ADDR4_MASK) - -#define I3C_MIBIRULES_MSB0_MASK (0x40000000U) -#define I3C_MIBIRULES_MSB0_SHIFT (30U) -/*! MSB0 - Most Significant Address Bit is 0 - * 0b1..MSB is 0 - * 0b0..MSB is not 0 - */ -#define I3C_MIBIRULES_MSB0(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_MSB0_SHIFT)) & I3C_MIBIRULES_MSB0_MASK) - -#define I3C_MIBIRULES_NOBYTE_MASK (0x80000000U) -#define I3C_MIBIRULES_NOBYTE_SHIFT (31U) -/*! NOBYTE - No IBI byte - * 0b1..Without mandatory IBI byte - * 0b0..With mandatory IBI byte - */ -#define I3C_MIBIRULES_NOBYTE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MIBIRULES_NOBYTE_SHIFT)) & I3C_MIBIRULES_NOBYTE_MASK) -/*! @} */ - -/*! @name MINTSET - Controller Interrupt Set */ -/*! @{ */ - -#define I3C_MINTSET_SLVSTART_MASK (0x100U) -#define I3C_MINTSET_SLVSTART_SHIFT (8U) -/*! SLVSTART - Target Start Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_SLVSTART(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_SLVSTART_SHIFT)) & I3C_MINTSET_SLVSTART_MASK) - -#define I3C_MINTSET_MCTRLDONE_MASK (0x200U) -#define I3C_MINTSET_MCTRLDONE_SHIFT (9U) -/*! MCTRLDONE - Controller Control Done Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_MCTRLDONE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_MCTRLDONE_SHIFT)) & I3C_MINTSET_MCTRLDONE_MASK) - -#define I3C_MINTSET_COMPLETE_MASK (0x400U) -#define I3C_MINTSET_COMPLETE_SHIFT (10U) -/*! COMPLETE - Completed Message Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_COMPLETE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_COMPLETE_SHIFT)) & I3C_MINTSET_COMPLETE_MASK) - -#define I3C_MINTSET_RXPEND_MASK (0x800U) -#define I3C_MINTSET_RXPEND_SHIFT (11U) -/*! RXPEND - Receive Pending Interrupt Enable */ -#define I3C_MINTSET_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_RXPEND_SHIFT)) & I3C_MINTSET_RXPEND_MASK) - -#define I3C_MINTSET_TXNOTFULL_MASK (0x1000U) -#define I3C_MINTSET_TXNOTFULL_SHIFT (12U) -/*! TXNOTFULL - Transmit Buffer/FIFO Not Full Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_TXNOTFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_TXNOTFULL_SHIFT)) & I3C_MINTSET_TXNOTFULL_MASK) - -#define I3C_MINTSET_IBIWON_MASK (0x2000U) -#define I3C_MINTSET_IBIWON_SHIFT (13U) -/*! IBIWON - IBI Won Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_IBIWON(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_IBIWON_SHIFT)) & I3C_MINTSET_IBIWON_MASK) - -#define I3C_MINTSET_ERRWARN_MASK (0x8000U) -#define I3C_MINTSET_ERRWARN_SHIFT (15U) -/*! ERRWARN - Error or Warning (ERRWARN) Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_ERRWARN_SHIFT)) & I3C_MINTSET_ERRWARN_MASK) - -#define I3C_MINTSET_NOWMASTER_MASK (0x80000U) -#define I3C_MINTSET_NOWMASTER_SHIFT (19U) -/*! NOWMASTER - Now Controller Interrupt Enable - * 0b1..Enable - * 0b0..Disable - */ -#define I3C_MINTSET_NOWMASTER(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTSET_NOWMASTER_SHIFT)) & I3C_MINTSET_NOWMASTER_MASK) -/*! @} */ - -/*! @name MINTCLR - Controller Interrupt Clear */ -/*! @{ */ - -#define I3C_MINTCLR_SLVSTART_MASK (0x100U) -#define I3C_MINTCLR_SLVSTART_SHIFT (8U) -/*! SLVSTART - SLVSTART Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_SLVSTART(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_SLVSTART_SHIFT)) & I3C_MINTCLR_SLVSTART_MASK) - -#define I3C_MINTCLR_MCTRLDONE_MASK (0x200U) -#define I3C_MINTCLR_MCTRLDONE_SHIFT (9U) -/*! MCTRLDONE - MCTRLDONE Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_MCTRLDONE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_MCTRLDONE_SHIFT)) & I3C_MINTCLR_MCTRLDONE_MASK) - -#define I3C_MINTCLR_COMPLETE_MASK (0x400U) -#define I3C_MINTCLR_COMPLETE_SHIFT (10U) -/*! COMPLETE - COMPLETE Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_COMPLETE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_COMPLETE_SHIFT)) & I3C_MINTCLR_COMPLETE_MASK) - -#define I3C_MINTCLR_RXPEND_MASK (0x800U) -#define I3C_MINTCLR_RXPEND_SHIFT (11U) -/*! RXPEND - RXPEND Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_RXPEND_SHIFT)) & I3C_MINTCLR_RXPEND_MASK) - -#define I3C_MINTCLR_TXNOTFULL_MASK (0x1000U) -#define I3C_MINTCLR_TXNOTFULL_SHIFT (12U) -/*! TXNOTFULL - TXNOTFULL Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_TXNOTFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_TXNOTFULL_SHIFT)) & I3C_MINTCLR_TXNOTFULL_MASK) - -#define I3C_MINTCLR_IBIWON_MASK (0x2000U) -#define I3C_MINTCLR_IBIWON_SHIFT (13U) -/*! IBIWON - IBIWON Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_IBIWON(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_IBIWON_SHIFT)) & I3C_MINTCLR_IBIWON_MASK) - -#define I3C_MINTCLR_ERRWARN_MASK (0x8000U) -#define I3C_MINTCLR_ERRWARN_SHIFT (15U) -/*! ERRWARN - ERRWARN Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_ERRWARN_SHIFT)) & I3C_MINTCLR_ERRWARN_MASK) - -#define I3C_MINTCLR_NOWMASTER_MASK (0x80000U) -#define I3C_MINTCLR_NOWMASTER_SHIFT (19U) -/*! NOWMASTER - NOWCONTROLLER Interrupt Enable Clear - * 0b1..Interrupt enable cleared - * 0b0..No effect - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MINTCLR_NOWMASTER(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTCLR_NOWMASTER_SHIFT)) & I3C_MINTCLR_NOWMASTER_MASK) -/*! @} */ - -/*! @name MINTMASKED - Controller Interrupt Mask */ -/*! @{ */ - -#define I3C_MINTMASKED_SLVSTART_MASK (0x100U) -#define I3C_MINTMASKED_SLVSTART_SHIFT (8U) -/*! SLVSTART - SLVSTART Interrupt Mask - * 0b1..Enabled - * 0b0..Disabled - */ -#define I3C_MINTMASKED_SLVSTART(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_SLVSTART_SHIFT)) & I3C_MINTMASKED_SLVSTART_MASK) - -#define I3C_MINTMASKED_MCTRLDONE_MASK (0x200U) -#define I3C_MINTMASKED_MCTRLDONE_SHIFT (9U) -/*! MCTRLDONE - MCTRLDONE Interrupt Mask - * 0b1..Enabled - * 0b0..Disabled - */ -#define I3C_MINTMASKED_MCTRLDONE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_MCTRLDONE_SHIFT)) & I3C_MINTMASKED_MCTRLDONE_MASK) - -#define I3C_MINTMASKED_COMPLETE_MASK (0x400U) -#define I3C_MINTMASKED_COMPLETE_SHIFT (10U) -/*! COMPLETE - COMPLETE Interrupt Mask - * 0b1..Enabled - * 0b0..Disabled - */ -#define I3C_MINTMASKED_COMPLETE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_COMPLETE_SHIFT)) & I3C_MINTMASKED_COMPLETE_MASK) - -#define I3C_MINTMASKED_RXPEND_MASK (0x800U) -#define I3C_MINTMASKED_RXPEND_SHIFT (11U) -/*! RXPEND - RXPEND Interrupt Mask */ -#define I3C_MINTMASKED_RXPEND(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_RXPEND_SHIFT)) & I3C_MINTMASKED_RXPEND_MASK) - -#define I3C_MINTMASKED_TXNOTFULL_MASK (0x1000U) -#define I3C_MINTMASKED_TXNOTFULL_SHIFT (12U) -/*! TXNOTFULL - TXNOTFULL Interrupt Mask - * 0b1..Enabled - * 0b0..Disabled - */ -#define I3C_MINTMASKED_TXNOTFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_TXNOTFULL_SHIFT)) & I3C_MINTMASKED_TXNOTFULL_MASK) - -#define I3C_MINTMASKED_IBIWON_MASK (0x2000U) -#define I3C_MINTMASKED_IBIWON_SHIFT (13U) -/*! IBIWON - IBIWON Interrupt Mask - * 0b1..Enabled - * 0b0..Disabled - */ -#define I3C_MINTMASKED_IBIWON(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_IBIWON_SHIFT)) & I3C_MINTMASKED_IBIWON_MASK) - -#define I3C_MINTMASKED_ERRWARN_MASK (0x8000U) -#define I3C_MINTMASKED_ERRWARN_SHIFT (15U) -/*! ERRWARN - ERRWARN Interrupt Mask - * 0b1..Enabled - * 0b0..Disabled - */ -#define I3C_MINTMASKED_ERRWARN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_ERRWARN_SHIFT)) & I3C_MINTMASKED_ERRWARN_MASK) - -#define I3C_MINTMASKED_NOWMASTER_MASK (0x80000U) -#define I3C_MINTMASKED_NOWMASTER_SHIFT (19U) -/*! NOWMASTER - NOWCONTROLLER Interrupt Mask - * 0b1..Enabled - * 0b0..Disabled - */ -#define I3C_MINTMASKED_NOWMASTER(x) (((uint32_t)(((uint32_t)(x)) << I3C_MINTMASKED_NOWMASTER_SHIFT)) & I3C_MINTMASKED_NOWMASTER_MASK) -/*! @} */ - -/*! @name MERRWARN - Controller Errors and Warnings */ -/*! @{ */ - -#define I3C_MERRWARN_NACK_MASK (0x4U) -#define I3C_MERRWARN_NACK_SHIFT (2U) -/*! NACK - Not Acknowledge Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_NACK(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_NACK_SHIFT)) & I3C_MERRWARN_NACK_MASK) - -#define I3C_MERRWARN_WRABT_MASK (0x8U) -#define I3C_MERRWARN_WRABT_SHIFT (3U) -/*! WRABT - Write Abort Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_WRABT(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_WRABT_SHIFT)) & I3C_MERRWARN_WRABT_MASK) - -#define I3C_MERRWARN_HPAR_MASK (0x200U) -#define I3C_MERRWARN_HPAR_SHIFT (9U) -/*! HPAR - High Data Rate Parity - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_HPAR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_HPAR_SHIFT)) & I3C_MERRWARN_HPAR_MASK) - -#define I3C_MERRWARN_HCRC_MASK (0x400U) -#define I3C_MERRWARN_HCRC_SHIFT (10U) -/*! HCRC - High Data Rate CRC Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_HCRC(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_HCRC_SHIFT)) & I3C_MERRWARN_HCRC_MASK) - -#define I3C_MERRWARN_OREAD_MASK (0x10000U) -#define I3C_MERRWARN_OREAD_SHIFT (16U) -/*! OREAD - Overread Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_OREAD(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_OREAD_SHIFT)) & I3C_MERRWARN_OREAD_MASK) - -#define I3C_MERRWARN_OWRITE_MASK (0x20000U) -#define I3C_MERRWARN_OWRITE_SHIFT (17U) -/*! OWRITE - Overwrite Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_OWRITE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_OWRITE_SHIFT)) & I3C_MERRWARN_OWRITE_MASK) - -#define I3C_MERRWARN_MSGERR_MASK (0x40000U) -#define I3C_MERRWARN_MSGERR_SHIFT (18U) -/*! MSGERR - Message Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_MSGERR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_MSGERR_SHIFT)) & I3C_MERRWARN_MSGERR_MASK) - -#define I3C_MERRWARN_INVREQ_MASK (0x80000U) -#define I3C_MERRWARN_INVREQ_SHIFT (19U) -/*! INVREQ - Invalid Request Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_INVREQ(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_INVREQ_SHIFT)) & I3C_MERRWARN_INVREQ_MASK) - -#define I3C_MERRWARN_TIMEOUT_MASK (0x100000U) -#define I3C_MERRWARN_TIMEOUT_SHIFT (20U) -/*! TIMEOUT - Timeout Error - * 0b1..Error - * 0b0..No error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define I3C_MERRWARN_TIMEOUT(x) (((uint32_t)(((uint32_t)(x)) << I3C_MERRWARN_TIMEOUT_SHIFT)) & I3C_MERRWARN_TIMEOUT_MASK) -/*! @} */ - -/*! @name MDMACTRL - Controller DMA Control */ -/*! @{ */ - -#define I3C_MDMACTRL_DMAFB_MASK (0x3U) -#define I3C_MDMACTRL_DMAFB_SHIFT (0U) -/*! DMAFB - DMA from Bus - * 0b00..DMA not used - * 0b01..Enable DMA for one frame - * 0b10..Enable DMA until DMA is turned off - * 0b11.. - */ -#define I3C_MDMACTRL_DMAFB(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDMACTRL_DMAFB_SHIFT)) & I3C_MDMACTRL_DMAFB_MASK) - -#define I3C_MDMACTRL_DMATB_MASK (0xCU) -#define I3C_MDMACTRL_DMATB_SHIFT (2U) -/*! DMATB - DMA to Bus - * 0b00..DMA not used - * 0b01..Enable DMA for one frame (ended by DMA or terminated) - * 0b10..Enable DMA until DMA is turned off - * 0b11.. - */ -#define I3C_MDMACTRL_DMATB(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDMACTRL_DMATB_SHIFT)) & I3C_MDMACTRL_DMATB_MASK) - -#define I3C_MDMACTRL_DMAWIDTH_MASK (0x30U) -#define I3C_MDMACTRL_DMAWIDTH_SHIFT (4U) -/*! DMAWIDTH - DMA Width - * 0b00, 0b01..Byte - * 0b10..Halfword (16 bits) - * 0b11.. - */ -#define I3C_MDMACTRL_DMAWIDTH(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDMACTRL_DMAWIDTH_SHIFT)) & I3C_MDMACTRL_DMAWIDTH_MASK) -/*! @} */ - -/*! @name MDATACTRL - Controller Data Control */ -/*! @{ */ - -#define I3C_MDATACTRL_FLUSHTB_MASK (0x1U) -#define I3C_MDATACTRL_FLUSHTB_SHIFT (0U) -/*! FLUSHTB - Flush To-Bus Buffer or FIFO - * 0b1..Flush the buffer - * 0b0..No action - */ -#define I3C_MDATACTRL_FLUSHTB(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_FLUSHTB_SHIFT)) & I3C_MDATACTRL_FLUSHTB_MASK) - -#define I3C_MDATACTRL_FLUSHFB_MASK (0x2U) -#define I3C_MDATACTRL_FLUSHFB_SHIFT (1U) -/*! FLUSHFB - Flush From-Bus Buffer or FIFO - * 0b1..Flush the buffer - * 0b0..No action - */ -#define I3C_MDATACTRL_FLUSHFB(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_FLUSHFB_SHIFT)) & I3C_MDATACTRL_FLUSHFB_MASK) - -#define I3C_MDATACTRL_UNLOCK_MASK (0x8U) -#define I3C_MDATACTRL_UNLOCK_SHIFT (3U) -/*! UNLOCK - Unlock - * 0b0..Locked - * 0b1..Unlocked - */ -#define I3C_MDATACTRL_UNLOCK(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_UNLOCK_SHIFT)) & I3C_MDATACTRL_UNLOCK_MASK) - -#define I3C_MDATACTRL_TXTRIG_MASK (0x30U) -#define I3C_MDATACTRL_TXTRIG_SHIFT (4U) -/*! TXTRIG - Transmit Trigger Level - * 0b00..Trigger when empty - * 0b01..Trigger when 1/4 full or less - * 0b10..Trigger when 1/2 full or less - * 0b11..Trigger when 1 less than full or less (default) - */ -#define I3C_MDATACTRL_TXTRIG(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_TXTRIG_SHIFT)) & I3C_MDATACTRL_TXTRIG_MASK) - -#define I3C_MDATACTRL_RXTRIG_MASK (0xC0U) -#define I3C_MDATACTRL_RXTRIG_SHIFT (6U) -/*! RXTRIG - Receive Trigger Level - * 0b00..Trigger when not empty - * 0b01..Trigger when 1/4 full or more - * 0b10..Trigger when 1/2 full or more - * 0b11..Trigger when 3/4 full or more - */ -#define I3C_MDATACTRL_RXTRIG(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_RXTRIG_SHIFT)) & I3C_MDATACTRL_RXTRIG_MASK) - -#define I3C_MDATACTRL_TXCOUNT_MASK (0x1F0000U) -#define I3C_MDATACTRL_TXCOUNT_SHIFT (16U) -/*! TXCOUNT - Transmit Byte Count */ -#define I3C_MDATACTRL_TXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_TXCOUNT_SHIFT)) & I3C_MDATACTRL_TXCOUNT_MASK) - -#define I3C_MDATACTRL_RXCOUNT_MASK (0x1F000000U) -#define I3C_MDATACTRL_RXCOUNT_SHIFT (24U) -/*! RXCOUNT - Receive Byte Count */ -#define I3C_MDATACTRL_RXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_RXCOUNT_SHIFT)) & I3C_MDATACTRL_RXCOUNT_MASK) - -#define I3C_MDATACTRL_TXFULL_MASK (0x40000000U) -#define I3C_MDATACTRL_TXFULL_SHIFT (30U) -/*! TXFULL - Transmit is Full - * 0b0..Not full - * 0b1..Full - */ -#define I3C_MDATACTRL_TXFULL(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_TXFULL_SHIFT)) & I3C_MDATACTRL_TXFULL_MASK) - -#define I3C_MDATACTRL_RXEMPTY_MASK (0x80000000U) -#define I3C_MDATACTRL_RXEMPTY_SHIFT (31U) -/*! RXEMPTY - Receive is Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define I3C_MDATACTRL_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDATACTRL_RXEMPTY_SHIFT)) & I3C_MDATACTRL_RXEMPTY_MASK) -/*! @} */ - -/*! @name MWDATAB - Controller Write Data Byte */ -/*! @{ */ - -#define I3C_MWDATAB_VALUE_MASK (0xFFU) -#define I3C_MWDATAB_VALUE_SHIFT (0U) -/*! VALUE - Data Byte */ -#define I3C_MWDATAB_VALUE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAB_VALUE_SHIFT)) & I3C_MWDATAB_VALUE_MASK) - -#define I3C_MWDATAB_END_MASK (0x100U) -#define I3C_MWDATAB_END_SHIFT (8U) -/*! END - End of Message - * 0b0..Not the end - * 0b1..End - */ -#define I3C_MWDATAB_END(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAB_END_SHIFT)) & I3C_MWDATAB_END_MASK) - -#define I3C_MWDATAB_END_ALSO_MASK (0x10000U) -#define I3C_MWDATAB_END_ALSO_SHIFT (16U) -/*! END_ALSO - End of Message ALSO - * 0b0..Not the end - * 0b1..End - */ -#define I3C_MWDATAB_END_ALSO(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAB_END_ALSO_SHIFT)) & I3C_MWDATAB_END_ALSO_MASK) -/*! @} */ - -/*! @name MWDATABE - Controller Write Data Byte End */ -/*! @{ */ - -#define I3C_MWDATABE_VALUE_MASK (0xFFU) -#define I3C_MWDATABE_VALUE_SHIFT (0U) -/*! VALUE - Data */ -#define I3C_MWDATABE_VALUE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATABE_VALUE_SHIFT)) & I3C_MWDATABE_VALUE_MASK) -/*! @} */ - -/*! @name MWDATAH - Controller Write Data Halfword */ -/*! @{ */ - -#define I3C_MWDATAH_DATA0_MASK (0xFFU) -#define I3C_MWDATAH_DATA0_SHIFT (0U) -/*! DATA0 - Data Byte 0 */ -#define I3C_MWDATAH_DATA0(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAH_DATA0_SHIFT)) & I3C_MWDATAH_DATA0_MASK) - -#define I3C_MWDATAH_DATA1_MASK (0xFF00U) -#define I3C_MWDATAH_DATA1_SHIFT (8U) -/*! DATA1 - Data Byte 1 */ -#define I3C_MWDATAH_DATA1(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAH_DATA1_SHIFT)) & I3C_MWDATAH_DATA1_MASK) - -#define I3C_MWDATAH_END_MASK (0x10000U) -#define I3C_MWDATAH_END_SHIFT (16U) -/*! END - End of Message - * 0b0..Not the end - * 0b1..End - */ -#define I3C_MWDATAH_END(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAH_END_SHIFT)) & I3C_MWDATAH_END_MASK) -/*! @} */ - -/*! @name MWDATAHE - Controller Write Data Halfword End */ -/*! @{ */ - -#define I3C_MWDATAHE_DATA0_MASK (0xFFU) -#define I3C_MWDATAHE_DATA0_SHIFT (0U) -/*! DATA0 - Data Byte 0 */ -#define I3C_MWDATAHE_DATA0(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAHE_DATA0_SHIFT)) & I3C_MWDATAHE_DATA0_MASK) - -#define I3C_MWDATAHE_DATA1_MASK (0xFF00U) -#define I3C_MWDATAHE_DATA1_SHIFT (8U) -/*! DATA1 - Data Byte 1 */ -#define I3C_MWDATAHE_DATA1(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAHE_DATA1_SHIFT)) & I3C_MWDATAHE_DATA1_MASK) -/*! @} */ - -/*! @name MRDATAB - Controller Read Data Byte */ -/*! @{ */ - -#define I3C_MRDATAB_VALUE_MASK (0xFFU) -#define I3C_MRDATAB_VALUE_SHIFT (0U) -/*! VALUE - Value */ -#define I3C_MRDATAB_VALUE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MRDATAB_VALUE_SHIFT)) & I3C_MRDATAB_VALUE_MASK) -/*! @} */ - -/*! @name MRDATAH - Controller Read Data Halfword */ -/*! @{ */ - -#define I3C_MRDATAH_LSB_MASK (0xFFU) -#define I3C_MRDATAH_LSB_SHIFT (0U) -/*! LSB - Low Byte */ -#define I3C_MRDATAH_LSB(x) (((uint32_t)(((uint32_t)(x)) << I3C_MRDATAH_LSB_SHIFT)) & I3C_MRDATAH_LSB_MASK) - -#define I3C_MRDATAH_MSB_MASK (0xFF00U) -#define I3C_MRDATAH_MSB_SHIFT (8U) -/*! MSB - High Byte */ -#define I3C_MRDATAH_MSB(x) (((uint32_t)(((uint32_t)(x)) << I3C_MRDATAH_MSB_SHIFT)) & I3C_MRDATAH_MSB_MASK) -/*! @} */ - -/*! @name MWDATAB1 - Controller Write Byte Data 1 (to Bus) */ -/*! @{ */ - -#define I3C_MWDATAB1_VALUE_MASK (0xFFU) -#define I3C_MWDATAB1_VALUE_SHIFT (0U) -/*! VALUE - Value */ -#define I3C_MWDATAB1_VALUE(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWDATAB1_VALUE_SHIFT)) & I3C_MWDATAB1_VALUE_MASK) -/*! @} */ - -/*! @name MWMSG_SDR_CONTROL - Controller Write Message Control in SDR mode */ -/*! @{ */ - -#define I3C_MWMSG_SDR_CONTROL_DIR_MASK (0x1U) -#define I3C_MWMSG_SDR_CONTROL_DIR_SHIFT (0U) -/*! DIR - Direction - * 0b0..Write - * 0b1..Read - */ -#define I3C_MWMSG_SDR_CONTROL_DIR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_SDR_CONTROL_DIR_SHIFT)) & I3C_MWMSG_SDR_CONTROL_DIR_MASK) - -#define I3C_MWMSG_SDR_CONTROL_ADDR_MASK (0xFEU) -#define I3C_MWMSG_SDR_CONTROL_ADDR_SHIFT (1U) -/*! ADDR - Address */ -#define I3C_MWMSG_SDR_CONTROL_ADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_SDR_CONTROL_ADDR_SHIFT)) & I3C_MWMSG_SDR_CONTROL_ADDR_MASK) - -#define I3C_MWMSG_SDR_CONTROL_END_MASK (0x100U) -#define I3C_MWMSG_SDR_CONTROL_END_SHIFT (8U) -/*! END - End of SDR Message - * 0b0..Not the end - * 0b1..End - */ -#define I3C_MWMSG_SDR_CONTROL_END(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_SDR_CONTROL_END_SHIFT)) & I3C_MWMSG_SDR_CONTROL_END_MASK) - -#define I3C_MWMSG_SDR_CONTROL_I2C_MASK (0x400U) -#define I3C_MWMSG_SDR_CONTROL_I2C_SHIFT (10U) -/*! I2C - I2C - * 0b0..I3C message - * 0b1..I2C message - */ -#define I3C_MWMSG_SDR_CONTROL_I2C(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_SDR_CONTROL_I2C_SHIFT)) & I3C_MWMSG_SDR_CONTROL_I2C_MASK) - -#define I3C_MWMSG_SDR_CONTROL_LEN_MASK (0xF800U) -#define I3C_MWMSG_SDR_CONTROL_LEN_SHIFT (11U) -/*! LEN - Length */ -#define I3C_MWMSG_SDR_CONTROL_LEN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_SDR_CONTROL_LEN_SHIFT)) & I3C_MWMSG_SDR_CONTROL_LEN_MASK) -/*! @} */ - -/*! @name MWMSG_SDR_DATA - Controller Write Message Data in SDR mode */ -/*! @{ */ - -#define I3C_MWMSG_SDR_DATA_DATA16B_MASK (0xFFFFU) -#define I3C_MWMSG_SDR_DATA_DATA16B_SHIFT (0U) -/*! DATA16B - Data */ -#define I3C_MWMSG_SDR_DATA_DATA16B(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_SDR_DATA_DATA16B_SHIFT)) & I3C_MWMSG_SDR_DATA_DATA16B_MASK) -/*! @} */ - -/*! @name MRMSG_SDR - Controller Read Message in SDR mode */ -/*! @{ */ - -#define I3C_MRMSG_SDR_DATA_MASK (0xFFFFU) -#define I3C_MRMSG_SDR_DATA_SHIFT (0U) -/*! DATA - Data */ -#define I3C_MRMSG_SDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_MRMSG_SDR_DATA_SHIFT)) & I3C_MRMSG_SDR_DATA_MASK) -/*! @} */ - -/*! @name MWMSG_DDR_CONTROL - Controller Write Message in DDR mode: First Control Word */ -/*! @{ */ - -#define I3C_MWMSG_DDR_CONTROL_ADDRCMD_MASK (0xFFFFU) -#define I3C_MWMSG_DDR_CONTROL_ADDRCMD_SHIFT (0U) -/*! ADDRCMD - Address Command */ -#define I3C_MWMSG_DDR_CONTROL_ADDRCMD(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_DDR_CONTROL_ADDRCMD_SHIFT)) & I3C_MWMSG_DDR_CONTROL_ADDRCMD_MASK) -/*! @} */ - -/*! @name MWMSG_DDR_CONTROL2 - Controller Write Message in DDR Mode Control 2 */ -/*! @{ */ - -#define I3C_MWMSG_DDR_CONTROL2_LEN_MASK (0x3FFU) -#define I3C_MWMSG_DDR_CONTROL2_LEN_SHIFT (0U) -/*! LEN - Length of Message */ -#define I3C_MWMSG_DDR_CONTROL2_LEN(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_DDR_CONTROL2_LEN_SHIFT)) & I3C_MWMSG_DDR_CONTROL2_LEN_MASK) - -#define I3C_MWMSG_DDR_CONTROL2_END_MASK (0x4000U) -#define I3C_MWMSG_DDR_CONTROL2_END_SHIFT (14U) -/*! END - End of Message - * 0b1..End - * 0b0..Not the end - */ -#define I3C_MWMSG_DDR_CONTROL2_END(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_DDR_CONTROL2_END_SHIFT)) & I3C_MWMSG_DDR_CONTROL2_END_MASK) -/*! @} */ - -/*! @name MWMSG_DDR_DATA - Controller Write Message Data in DDR mode */ -/*! @{ */ - -#define I3C_MWMSG_DDR_DATA_DATA16B_MASK (0xFFFFU) -#define I3C_MWMSG_DDR_DATA_DATA16B_SHIFT (0U) -/*! DATA16B - Data */ -#define I3C_MWMSG_DDR_DATA_DATA16B(x) (((uint32_t)(((uint32_t)(x)) << I3C_MWMSG_DDR_DATA_DATA16B_SHIFT)) & I3C_MWMSG_DDR_DATA_DATA16B_MASK) -/*! @} */ - -/*! @name MRMSG_DDR - Controller Read Message in DDR mode */ -/*! @{ */ - -#define I3C_MRMSG_DDR_DATA_MASK (0xFFFFU) -#define I3C_MRMSG_DDR_DATA_SHIFT (0U) -/*! DATA - Data */ -#define I3C_MRMSG_DDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << I3C_MRMSG_DDR_DATA_SHIFT)) & I3C_MRMSG_DDR_DATA_MASK) -/*! @} */ - -/*! @name MDYNADDR - Controller Dynamic Address */ -/*! @{ */ - -#define I3C_MDYNADDR_DAVALID_MASK (0x1U) -#define I3C_MDYNADDR_DAVALID_SHIFT (0U) -/*! DAVALID - Dynamic Address Valid - * 0b1..Valid DA assigned - * 0b0..No valid DA assigned - */ -#define I3C_MDYNADDR_DAVALID(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDYNADDR_DAVALID_SHIFT)) & I3C_MDYNADDR_DAVALID_MASK) - -#define I3C_MDYNADDR_DADDR_MASK (0xFEU) -#define I3C_MDYNADDR_DADDR_SHIFT (1U) -/*! DADDR - Dynamic Address */ -#define I3C_MDYNADDR_DADDR(x) (((uint32_t)(((uint32_t)(x)) << I3C_MDYNADDR_DADDR_SHIFT)) & I3C_MDYNADDR_DADDR_MASK) -/*! @} */ - -/*! @name SMAPCTRL0 - Map Feature Control 0 */ -/*! @{ */ - -#define I3C_SMAPCTRL0_ENA_MASK (0x1U) -#define I3C_SMAPCTRL0_ENA_SHIFT (0U) -/*! ENA - Enable Primary Dynamic Address - * 0b0..Disabled - * 0b1..Enabled - */ -#define I3C_SMAPCTRL0_ENA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMAPCTRL0_ENA_SHIFT)) & I3C_SMAPCTRL0_ENA_MASK) - -#define I3C_SMAPCTRL0_DA_MASK (0xFEU) -#define I3C_SMAPCTRL0_DA_SHIFT (1U) -/*! DA - Dynamic Address */ -#define I3C_SMAPCTRL0_DA(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMAPCTRL0_DA_SHIFT)) & I3C_SMAPCTRL0_DA_MASK) - -#define I3C_SMAPCTRL0_CAUSE_MASK (0x700U) -#define I3C_SMAPCTRL0_CAUSE_SHIFT (8U) -/*! CAUSE - Cause - * 0b000..No information (this value occurs when not configured to write DA) - * 0b001..Set using ENTDAA - * 0b010..Set using SETDASA, SETAASA, or SETNEWDA - * 0b011..Cleared using RSTDAA - * 0b100..Auto MAP change happened last - * *.. - */ -#define I3C_SMAPCTRL0_CAUSE(x) (((uint32_t)(((uint32_t)(x)) << I3C_SMAPCTRL0_CAUSE_SHIFT)) & I3C_SMAPCTRL0_CAUSE_MASK) -/*! @} */ - -/*! @name IBIEXT1 - Extended IBI Data 1 */ -/*! @{ */ - -#define I3C_IBIEXT1_CNT_MASK (0x7U) -#define I3C_IBIEXT1_CNT_SHIFT (0U) -/*! CNT - Count */ -#define I3C_IBIEXT1_CNT(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT1_CNT_SHIFT)) & I3C_IBIEXT1_CNT_MASK) - -#define I3C_IBIEXT1_MAX_MASK (0x70U) -#define I3C_IBIEXT1_MAX_SHIFT (4U) -/*! MAX - Maximum */ -#define I3C_IBIEXT1_MAX(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT1_MAX_SHIFT)) & I3C_IBIEXT1_MAX_MASK) - -#define I3C_IBIEXT1_EXT1_MASK (0xFF00U) -#define I3C_IBIEXT1_EXT1_SHIFT (8U) -/*! EXT1 - Extra Byte 1 */ -#define I3C_IBIEXT1_EXT1(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT1_EXT1_SHIFT)) & I3C_IBIEXT1_EXT1_MASK) - -#define I3C_IBIEXT1_EXT2_MASK (0xFF0000U) -#define I3C_IBIEXT1_EXT2_SHIFT (16U) -/*! EXT2 - Extra Byte 2 */ -#define I3C_IBIEXT1_EXT2(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT1_EXT2_SHIFT)) & I3C_IBIEXT1_EXT2_MASK) - -#define I3C_IBIEXT1_EXT3_MASK (0xFF000000U) -#define I3C_IBIEXT1_EXT3_SHIFT (24U) -/*! EXT3 - Extra Byte 3 */ -#define I3C_IBIEXT1_EXT3(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT1_EXT3_SHIFT)) & I3C_IBIEXT1_EXT3_MASK) -/*! @} */ - -/*! @name IBIEXT2 - Extended IBI Data 2 */ -/*! @{ */ - -#define I3C_IBIEXT2_EXT4_MASK (0xFFU) -#define I3C_IBIEXT2_EXT4_SHIFT (0U) -/*! EXT4 - Extra Byte 4 */ -#define I3C_IBIEXT2_EXT4(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT2_EXT4_SHIFT)) & I3C_IBIEXT2_EXT4_MASK) - -#define I3C_IBIEXT2_EXT5_MASK (0xFF00U) -#define I3C_IBIEXT2_EXT5_SHIFT (8U) -/*! EXT5 - Extra Byte 5 */ -#define I3C_IBIEXT2_EXT5(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT2_EXT5_SHIFT)) & I3C_IBIEXT2_EXT5_MASK) - -#define I3C_IBIEXT2_EXT6_MASK (0xFF0000U) -#define I3C_IBIEXT2_EXT6_SHIFT (16U) -/*! EXT6 - Extra Byte 6 */ -#define I3C_IBIEXT2_EXT6(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT2_EXT6_SHIFT)) & I3C_IBIEXT2_EXT6_MASK) - -#define I3C_IBIEXT2_EXT7_MASK (0xFF000000U) -#define I3C_IBIEXT2_EXT7_SHIFT (24U) -/*! EXT7 - Extra Byte 7 */ -#define I3C_IBIEXT2_EXT7(x) (((uint32_t)(((uint32_t)(x)) << I3C_IBIEXT2_EXT7_SHIFT)) & I3C_IBIEXT2_EXT7_MASK) -/*! @} */ - -/*! @name SID - Target Module ID */ -/*! @{ */ - -#define I3C_SID_ID_MASK (0xFFFFFFFFU) -#define I3C_SID_ID_SHIFT (0U) -/*! ID - ID */ -#define I3C_SID_ID(x) (((uint32_t)(((uint32_t)(x)) << I3C_SID_ID_SHIFT)) & I3C_SID_ID_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group I3C_Register_Masks */ - - -/* I3C - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral I3C0 base address */ - #define I3C0_BASE (0x50021000u) - /** Peripheral I3C0 base address */ - #define I3C0_BASE_NS (0x40021000u) - /** Peripheral I3C0 base pointer */ - #define I3C0 ((I3C_Type *)I3C0_BASE) - /** Peripheral I3C0 base pointer */ - #define I3C0_NS ((I3C_Type *)I3C0_BASE_NS) - /** Peripheral I3C1 base address */ - #define I3C1_BASE (0x50022000u) - /** Peripheral I3C1 base address */ - #define I3C1_BASE_NS (0x40022000u) - /** Peripheral I3C1 base pointer */ - #define I3C1 ((I3C_Type *)I3C1_BASE) - /** Peripheral I3C1 base pointer */ - #define I3C1_NS ((I3C_Type *)I3C1_BASE_NS) - /** Array initializer of I3C peripheral base addresses */ - #define I3C_BASE_ADDRS { I3C0_BASE, I3C1_BASE } - /** Array initializer of I3C peripheral base pointers */ - #define I3C_BASE_PTRS { I3C0, I3C1 } - /** Array initializer of I3C peripheral base addresses */ - #define I3C_BASE_ADDRS_NS { I3C0_BASE_NS, I3C1_BASE_NS } - /** Array initializer of I3C peripheral base pointers */ - #define I3C_BASE_PTRS_NS { I3C0_NS, I3C1_NS } -#else - /** Peripheral I3C0 base address */ - #define I3C0_BASE (0x40021000u) - /** Peripheral I3C0 base pointer */ - #define I3C0 ((I3C_Type *)I3C0_BASE) - /** Peripheral I3C1 base address */ - #define I3C1_BASE (0x40022000u) - /** Peripheral I3C1 base pointer */ - #define I3C1 ((I3C_Type *)I3C1_BASE) - /** Array initializer of I3C peripheral base addresses */ - #define I3C_BASE_ADDRS { I3C0_BASE, I3C1_BASE } - /** Array initializer of I3C peripheral base pointers */ - #define I3C_BASE_PTRS { I3C0, I3C1 } -#endif -/** Interrupt vectors for the I3C peripheral type */ -#define I3C_IRQS { I3C0_IRQn, I3C1_IRQn } - -/*! - * @} - */ /* end of group I3C_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- INPUTMUX Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup INPUTMUX_Peripheral_Access_Layer INPUTMUX Peripheral Access Layer - * @{ - */ - -/** INPUTMUX - Register Layout Typedef */ -typedef struct { - __IO uint32_t SCT0_INMUX[8]; /**< Inputmux Register for SCT0 Input, array offset: 0x0, array step: 0x4 */ - __IO uint32_t CTIMER0CAP0; /**< Capture Select Register for CTIMER Inputs, offset: 0x20 */ - __IO uint32_t CTIMER0CAP1; /**< Capture Select Register for CTIMER Inputs, offset: 0x24 */ - __IO uint32_t CTIMER0CAP2; /**< Capture Select Register for CTIMER Inputs, offset: 0x28 */ - __IO uint32_t CTIMER0CAP3; /**< Capture Select Register for CTIMER Inputs, offset: 0x2C */ - __IO uint32_t TIMER0TRIG; /**< Trigger Register for CTIMER, offset: 0x30 */ - uint8_t RESERVED_0[12]; - __IO uint32_t CTIMER1CAP0; /**< Capture Select Register for CTIMER Inputs, offset: 0x40 */ - __IO uint32_t CTIMER1CAP1; /**< Capture Select Register for CTIMER Inputs, offset: 0x44 */ - __IO uint32_t CTIMER1CAP2; /**< Capture Select Register for CTIMER Inputs, offset: 0x48 */ - __IO uint32_t CTIMER1CAP3; /**< Capture Select Register for CTIMER Inputs, offset: 0x4C */ - __IO uint32_t TIMER1TRIG; /**< Trigger Register for CTIMER, offset: 0x50 */ - uint8_t RESERVED_1[12]; - __IO uint32_t CTIMER2CAP0; /**< Capture Select Register for CTIMER Inputs, offset: 0x60 */ - __IO uint32_t CTIMER2CAP1; /**< Capture Select Register for CTIMER Inputs, offset: 0x64 */ - __IO uint32_t CTIMER2CAP2; /**< Capture Select Register for CTIMER Inputs, offset: 0x68 */ - __IO uint32_t CTIMER2CAP3; /**< Capture Select Register for CTIMER Inputs, offset: 0x6C */ - __IO uint32_t TIMER2TRIG; /**< Trigger Register for CTIMER, offset: 0x70 */ - uint8_t RESERVED_2[44]; - __IO uint32_t SMARTDMAARCHB_INMUX[8]; /**< Inputmux Register for SMARTDMA Arch B Inputs, array offset: 0xA0, array step: 0x4 */ - __IO uint32_t PINTSEL[8]; /**< Pin Interrupt Select, array offset: 0xC0, array step: 0x4 */ - uint8_t RESERVED_3[160]; - __IO uint32_t FREQMEAS_REF; /**< Selection for Frequency Measurement Reference Clock, offset: 0x180 */ - __IO uint32_t FREQMEAS_TAR; /**< Selection for Frequency Measurement Target Clock, offset: 0x184 */ - uint8_t RESERVED_4[24]; - __IO uint32_t CTIMER3CAP0; /**< Capture Select Register for CTIMER Inputs, offset: 0x1A0 */ - __IO uint32_t CTIMER3CAP1; /**< Capture Select Register for CTIMER Inputs, offset: 0x1A4 */ - __IO uint32_t CTIMER3CAP2; /**< Capture Select Register for CTIMER Inputs, offset: 0x1A8 */ - __IO uint32_t CTIMER3CAP3; /**< Capture Select Register for CTIMER Inputs, offset: 0x1AC */ - __IO uint32_t TIMER3TRIG; /**< Trigger Register for CTIMER, offset: 0x1B0 */ - uint8_t RESERVED_5[12]; - __IO uint32_t CTIMER4CAP0; /**< Capture Select Register for CTIMER Inputs, offset: 0x1C0 */ - __IO uint32_t CTIMER4CAP1; /**< Capture Select Register for CTIMER Inputs, offset: 0x1C4 */ - __IO uint32_t CTIMER4CAP2; /**< Capture Select Register for CTIMER Inputs, offset: 0x1C8 */ - __IO uint32_t CTIMER4CAP3; /**< Capture Select Register for CTIMER Inputs, offset: 0x1CC */ - __IO uint32_t TIMER4TRIG; /**< Trigger Register for CTIMER, offset: 0x1D0 */ - uint8_t RESERVED_6[140]; - __IO uint32_t CMP0_TRIG; /**< CMP0 Input Connections, offset: 0x260 */ - uint8_t RESERVED_7[28]; - __IO uint32_t ADC0_TRIG[4]; /**< ADC Trigger Input Connections, array offset: 0x280, array step: 0x4 */ - uint8_t RESERVED_8[48]; - __IO uint32_t ADC1_TRIG[4]; /**< ADC Trigger Input Connections, array offset: 0x2C0, array step: 0x4 */ - uint8_t RESERVED_9[48]; - __IO uint32_t DAC0_TRIG; /**< DAC0 Trigger Inputs, offset: 0x300 */ - uint8_t RESERVED_10[28]; - __IO uint32_t DAC1_TRIG; /**< DAC1 Trigger Inputs, offset: 0x320 */ - uint8_t RESERVED_11[28]; - __IO uint32_t DAC2_TRIG; /**< DAC2 Trigger Inputs, offset: 0x340 */ - uint8_t RESERVED_12[28]; - struct { /* offset: 0x360, array step: 0x20 */ - __IO uint32_t QDC_TRIG; /**< QDC0 Trigger Input Connections..QDC1 Trigger Input Connections, array offset: 0x360, array step: 0x20 */ - __IO uint32_t QDC_HOME; /**< QDC0 Input Connections..QDC1 Input Connections, array offset: 0x364, array step: 0x20 */ - __IO uint32_t QDC_INDEX; /**< QDC0 Input Connections..QDC1 Input Connections, array offset: 0x368, array step: 0x20 */ - __IO uint32_t QDC_PHASEB; /**< QDC0 Input Connections..QDC1 Input Connections, array offset: 0x36C, array step: 0x20 */ - __IO uint32_t QDC_PHASEA; /**< QDC0 Input Connections..QDC1 Input Connections, array offset: 0x370, array step: 0x20 */ - uint8_t RESERVED_0[12]; - } QDCN[2]; - __IO uint32_t FLEXPWM0_SM_EXTSYNC[4]; /**< PWM0 External Synchronization, array offset: 0x3A0, array step: 0x4 */ - __IO uint32_t FLEXPWM0_SM_EXTA[4]; /**< PWM0 Input Trigger Connections, array offset: 0x3B0, array step: 0x4 */ - __IO uint32_t FLEXPWM0_EXTFORCE; /**< PWM0 External Force Trigger Connections, offset: 0x3C0 */ - __IO uint32_t FLEXPWM0_FAULT[4]; /**< PWM0 Fault Input Trigger Connections, array offset: 0x3C4, array step: 0x4 */ - uint8_t RESERVED_13[12]; - __IO uint32_t FLEXPWM1_SM_EXTSYNC[4]; /**< PWM1 External Synchronization, array offset: 0x3E0, array step: 0x4 */ - __IO uint32_t FLEXPWM1_SM_EXTA[4]; /**< PWM1 Input EXTA Connections, array offset: 0x3F0, array step: 0x4 */ - __IO uint32_t FLEXPWM1_EXTFORCE; /**< PWM1 External Force Trigger Connections, offset: 0x400 */ - __IO uint32_t FLEXPWM1_FAULT[4]; /**< PWM1 Fault Input Trigger Connections, array offset: 0x404, array step: 0x4 */ - uint8_t RESERVED_14[12]; - __IO uint32_t PWM0_EXT_CLK; /**< PWM0 External Clock Trigger, offset: 0x420 */ - __IO uint32_t PWM1_EXT_CLK; /**< PWM1 External Clock Trigger, offset: 0x424 */ - uint8_t RESERVED_15[24]; - __IO uint32_t EVTG_TRIG[16]; /**< EVTG Trigger Input Connections, array offset: 0x440, array step: 0x4 */ - __IO uint32_t USBFS_TRIG; /**< USB-FS Trigger Input Connections, offset: 0x480 */ - uint8_t RESERVED_16[28]; - __IO uint32_t TSI_TRIG; /**< TSI Trigger Input Connections, offset: 0x4A0 */ - uint8_t RESERVED_17[28]; - __IO uint32_t EXT_TRIG[8]; /**< EXT Trigger Connections, array offset: 0x4C0, array step: 0x4 */ - __IO uint32_t CMP1_TRIG; /**< CMP1 Input Connections, offset: 0x4E0 */ - uint8_t RESERVED_18[28]; - __IO uint32_t CMP2_TRIG; /**< CMP2 Input Connections, offset: 0x500 */ - uint8_t RESERVED_19[28]; - __IO uint32_t SINC_FILTER_CH[5]; /**< SINC Filter Channel Trigger Input Connections, array offset: 0x520, array step: 0x4 */ - uint8_t RESERVED_20[76]; - __IO uint32_t OPAMP_TRIG[3]; /**< OPAMP Trigger Input Connections, array offset: 0x580, array step: 0x4 */ - uint8_t RESERVED_21[20]; - __IO uint32_t FLEXCOMM0_TRIG; /**< LP_FLEXCOMM0 Trigger Input Connections, offset: 0x5A0 */ - uint8_t RESERVED_22[28]; - __IO uint32_t FLEXCOMM1_TRIG; /**< LP_FLEXCOMM1 Trigger Input Connections, offset: 0x5C0 */ - uint8_t RESERVED_23[28]; - __IO uint32_t FLEXCOMM2_TRIG; /**< LP_FLEXCOMM2 Trigger Input Connections, offset: 0x5E0 */ - uint8_t RESERVED_24[28]; - __IO uint32_t FLEXCOMM3_TRIG; /**< LP_FLEXCOMM3 Trigger Input Connections, offset: 0x600 */ - uint8_t RESERVED_25[28]; - __IO uint32_t FLEXCOMM4_TRIG; /**< LP_FLEXCOMM4 Trigger Input Connections, offset: 0x620 */ - uint8_t RESERVED_26[28]; - __IO uint32_t FLEXCOMM5_TRIG; /**< LP_FLEXCOMM5 Trigger Input Connections, offset: 0x640 */ - uint8_t RESERVED_27[28]; - __IO uint32_t FLEXCOMM6_TRIG; /**< LP_FLEXCOMM6 Trigger Input Connections, offset: 0x660 */ - uint8_t RESERVED_28[28]; - __IO uint32_t FLEXCOMM7_TRIG; /**< LP_FLEXCOMM7 Trigger Input Connections, offset: 0x680 */ - uint8_t RESERVED_29[28]; - __IO uint32_t FLEXCOMM8_TRIG; /**< LP_FLEXCOMM8 Trigger Input Connections, offset: 0x6A0 */ - uint8_t RESERVED_30[28]; - __IO uint32_t FLEXCOMM9_TRIG; /**< LP_FLEXCOMM9 Trigger Input Connections, offset: 0x6C0 */ - uint8_t RESERVED_31[28]; - __IO uint32_t FLEXIO_TRIG[8]; /**< FlexIO Trigger Input Connections, array offset: 0x6E0, array step: 0x4 */ - __IO uint32_t DMA0_REQ_ENABLE0; /**< DMA0 Request Enable0, offset: 0x700 */ - __O uint32_t DMA0_REQ_ENABLE0_SET; /**< DMA0 Request Enable0, offset: 0x704 */ - __O uint32_t DMA0_REQ_ENABLE0_CLR; /**< DMA0 Request Enable0, offset: 0x708 */ - __O uint32_t DMA0_REQ_ENABLE0_TOG; /**< DMA0 Request Enable0, offset: 0x70C */ - __IO uint32_t DMA0_REQ_ENABLE1; /**< DMA0 Request Enable1, offset: 0x710 */ - __O uint32_t DMA0_REQ_ENABLE1_SET; /**< DMA0 Request Enable1, offset: 0x714 */ - __O uint32_t DMA0_REQ_ENABLE1_CLR; /**< DMA0 Request Enable1, offset: 0x718 */ - __O uint32_t DMA0_REQ_ENABLE1_TOG; /**< DMA0 Request Enable1, offset: 0x71C */ - __IO uint32_t DMA0_REQ_ENABLE2; /**< DMA0 Request Enable2, offset: 0x720 */ - __O uint32_t DMA0_REQ_ENABLE2_SET; /**< DMA0 Request Enable2, offset: 0x724 */ - __O uint32_t DMA0_REQ_ENABLE2_CLR; /**< DMA0 Request Enable2, offset: 0x728 */ - __O uint32_t DMA0_REQ_ENABLE2_TOG; /**< DMA0 Request Enable2, offset: 0x72C */ - __IO uint32_t DMA0_REQ_ENABLE3; /**< DMA0 Request Enable3, offset: 0x730 */ - __O uint32_t DMA0_REQ_ENABLE3_SET; /**< DMA0 Request Enable3, offset: 0x734 */ - __O uint32_t DMA0_REQ_ENABLE3_CLR; /**< DMA0 Request Enable3, offset: 0x738 */ - uint8_t RESERVED_32[68]; - __IO uint32_t DMA1_REQ_ENABLE0; /**< DMA1 Request Enable0, offset: 0x780 */ - __O uint32_t DMA1_REQ_ENABLE0_SET; /**< DMA1 Request Enable0, offset: 0x784 */ - __O uint32_t DMA1_REQ_ENABLE0_CLR; /**< DMA1 Request Enable0, offset: 0x788 */ - __O uint32_t DMA1_REQ_ENABLE0_TOG; /**< DMA1 Request Enable0, offset: 0x78C */ - __IO uint32_t DMA1_REQ_ENABLE1; /**< DMA1 Request Enable1, offset: 0x790 */ - __O uint32_t DMA1_REQ_ENABLE1_SET; /**< DMA1 Request Enable1, offset: 0x794 */ - __O uint32_t DMA1_REQ_ENABLE1_CLR; /**< DMA1 Request Enable1, offset: 0x798 */ - __O uint32_t DMA1_REQ_ENABLE1_TOG; /**< DMA1 Request Enable1, offset: 0x79C */ - __IO uint32_t DMA1_REQ_ENABLE2; /**< DMA1 Request Enable2, offset: 0x7A0 */ - __O uint32_t DMA1_REQ_ENABLE2_SET; /**< DMA1 Request Enable2, offset: 0x7A4 */ - __O uint32_t DMA1_REQ_ENABLE2_CLR; /**< DMA1 Request Enable2, offset: 0x7A8 */ - __O uint32_t DMA1_REQ_ENABLE2_TOG; /**< DMA1 Request Enable2, offset: 0x7AC */ - __IO uint32_t DMA1_REQ_ENABLE3; /**< DMA1 Request Enable3, offset: 0x7B0 */ - __O uint32_t DMA1_REQ_ENABLE3_SET; /**< DMA1 Request Enable3, offset: 0x7B4 */ - __O uint32_t DMA1_REQ_ENABLE3_CLR; /**< DMA1 Request Enable3, offset: 0x7B8 */ -} INPUTMUX_Type; - -/* ---------------------------------------------------------------------------- - -- INPUTMUX Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup INPUTMUX_Register_Masks INPUTMUX Register Masks - * @{ - */ - -/*! @name INPUTMUX_SCT0_SCT0_INMUX - Inputmux Register for SCT0 Input */ -/*! @{ */ - -#define INPUTMUX_INPUTMUX_SCT0_SCT0_INMUX_INP_MASK (0x7FU) -#define INPUTMUX_INPUTMUX_SCT0_SCT0_INMUX_INP_SHIFT (0U) -/*! INP - Input number to SCT0 inputs. - * 0b0000000..SCT0_IN0 input is selected - * 0b0000001..SCT0_IN1 input is selected - * 0b0000010..SCT0_IN2 input is selected - * 0b0000011..SCT0_IN3 input is selected - * 0b0000100..SCT0_IN4 input is selected - * 0b0000101..SCT0_IN5 input is selected - * 0b0000110..SCT0_IN6 input is selected - * 0b0000111..SCT0_IN7 input is selected - * 0b0001000..CTIMER0_MAT0 input is selected - * 0b0001001..CTIMER1_MAT0 input is selected - * 0b0001010..CTIMER2_MAT0 input is selected - * 0b0001011..CTIMER3_MAT0 input is selected - * 0b0001100..CTIMER4_MAT0 input is selected - * 0b0001101..ADC0 ADC0_IRQ input is selected - * 0b0001110..PINT GPIO_INT_BMAT input is selected - * 0b0001111..usb0 start of frame input is selected - * 0b0010000..usb1 start of frame input is selected - * 0b0010001..SINC Filter CH0 Conversion Complete input is selected - * 0b0010010..SINC Filter CH1 Conversion Complete input is selected - * 0b0010011..SINC Filter CH2 Conversion Complete input is selected - * 0b0010100..SINC Filter CH3 Conversion Complete input is selected - * 0b0010101..SINC Filter CH4 Conversion Complete input is selected - * 0b0010110..Reserved - * 0b0010111..DEBUG_HALTED input is selected - * 0b0011000..ADC1_IRQ input is selected - * 0b0011001..ADC0_tcomp[0] input is selected - * 0b0011010..ADC0_tcomp[1] input is selected - * 0b0011011..ADC0_tcomp[2] input is selected - * 0b0011100..ADC0_tcomp[3] input is selected - * 0b0011101..ADC1_tcomp[0] input is selected - * 0b0011110..ADC1_tcomp[1] input is selected - * 0b0011111..ADC1_tcomp[2] input is selected - * 0b0100000..ADC1_tcomp[3] input is selected - * 0b0100001..CMP0_OUT input is selected - * 0b0100010..CMP1_OUT input is selected - * 0b0100011..CMP2_OUT input is selected - * 0b0100100..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0100101..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100110..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100111..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0101000..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0101001..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0101010..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0101011..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0101100..QDC0_CMP/POS_MATCH input is selected - * 0b0101101..QDC1_CMP/POS_MATCH input is selected - * 0b0101110..EVTG_OUT0A input is selected - * 0b0101111..EVTG_OUT0B input is selected - * 0b0110000..EVTG_OUT1A input is selected - * 0b0110001..EVTG_OUT1B input is selected - * 0b0110010..EVTG_OUT2A input is selected - * 0b0110011..EVTG_OUT2B input is selected - * 0b0110100..EVTG_OUT3A input is selected - * 0b0110101..EVTG_OUT3B input is selected - * 0b0110110..FC3_P0 (SDO, SDA) input is selected - * 0b0110111..FC3_P1 (SCK, TXD, SCL) input is selected - * 0b0111000..FC3_P2 (RTS, SCLS, TXD) input is selected - * 0b0111001..FC3_P3 (PCS[0], CTS, SDAS) input is selected - * 0b0111010..Reserved - * 0b0111011..Reserved - * 0b0111100..LP_FLEXCOMM0 trig 0 (lpuart_trg_txword) input is selected - * 0b0111101..LP_FLEXCOMM0 trig 1 (lpuart_trg_rxword) input is selected - * 0b0111110..LP_FLEXCOMM0 trig 2 (lpuart_trg_rxidle) input is selected - * 0b0111111..LP_FLEXCOMM1 trig 0 input is selected - * 0b1000000..LP_FLEXCOMM1 trig 1 input is selected - * 0b1000001..LP_FLEXCOMM1 trig 2 input is selected - * 0b1000010..LP_FLEXCOMM2 trig 0 input is selected - * 0b1000011..LP_FLEXCOMM2 trig 1 input is selected - * 0b1000100..LP_FLEXCOMM2 trig 2 input is selected - * 0b1000101..LP_FLEXCOMM3 trig 0 input is selected - * 0b1000110..LP_FLEXCOMM3 trig 1 input is selected - * 0b1000111..LP_FLEXCOMM3 trig 2 input is selected - * 0b1001000..LP_FLEXCOMM3 trig 3 input is selected - * 0b1001001..SAI0 TX BCLK input is selected - * 0b1001010..SAI0 RX BCLK input is selected - * 0b1001011..SAI1 TX BCLK input is selected - * 0b1001100..SAI1 RX BCLK input is selected - * *.. - */ -#define INPUTMUX_INPUTMUX_SCT0_SCT0_INMUX_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_INPUTMUX_SCT0_SCT0_INMUX_INP_SHIFT)) & INPUTMUX_INPUTMUX_SCT0_SCT0_INMUX_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_INPUTMUX_SCT0_SCT0_INMUX */ -#define INPUTMUX_INPUTMUX_SCT0_SCT0_INMUX_COUNT (8U) - -/*! @name CTIMER0CAP0 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER0CAP0_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER0CAP0_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER0CAP0_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER0CAP0_INP_SHIFT)) & INPUTMUX_CTIMER0CAP0_INP_MASK) -/*! @} */ - -/*! @name CTIMER0CAP1 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER0CAP1_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER0CAP1_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER0CAP1_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER0CAP1_INP_SHIFT)) & INPUTMUX_CTIMER0CAP1_INP_MASK) -/*! @} */ - -/*! @name CTIMER0CAP2 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER0CAP2_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER0CAP2_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER0CAP2_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER0CAP2_INP_SHIFT)) & INPUTMUX_CTIMER0CAP2_INP_MASK) -/*! @} */ - -/*! @name CTIMER0CAP3 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER0CAP3_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER0CAP3_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER0CAP3_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER0CAP3_INP_SHIFT)) & INPUTMUX_CTIMER0CAP3_INP_MASK) -/*! @} */ - -/*! @name TIMER0TRIG - Trigger Register for CTIMER */ -/*! @{ */ - -#define INPUTMUX_TIMER0TRIG_INP_MASK (0x7FU) -#define INPUTMUX_TIMER0TRIG_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_TIMER0TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_TIMER0TRIG_INP_SHIFT)) & INPUTMUX_TIMER0TRIG_INP_MASK) -/*! @} */ - -/*! @name CTIMER1CAP0 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER1CAP0_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER1CAP0_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER1CAP0_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER1CAP0_INP_SHIFT)) & INPUTMUX_CTIMER1CAP0_INP_MASK) -/*! @} */ - -/*! @name CTIMER1CAP1 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER1CAP1_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER1CAP1_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER1CAP1_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER1CAP1_INP_SHIFT)) & INPUTMUX_CTIMER1CAP1_INP_MASK) -/*! @} */ - -/*! @name CTIMER1CAP2 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER1CAP2_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER1CAP2_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER1CAP2_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER1CAP2_INP_SHIFT)) & INPUTMUX_CTIMER1CAP2_INP_MASK) -/*! @} */ - -/*! @name CTIMER1CAP3 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER1CAP3_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER1CAP3_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER1CAP3_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER1CAP3_INP_SHIFT)) & INPUTMUX_CTIMER1CAP3_INP_MASK) -/*! @} */ - -/*! @name TIMER1TRIG - Trigger Register for CTIMER */ -/*! @{ */ - -#define INPUTMUX_TIMER1TRIG_INP_MASK (0x7FU) -#define INPUTMUX_TIMER1TRIG_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_TIMER1TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_TIMER1TRIG_INP_SHIFT)) & INPUTMUX_TIMER1TRIG_INP_MASK) -/*! @} */ - -/*! @name CTIMER2CAP0 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER2CAP0_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER2CAP0_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER2CAP0_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER2CAP0_INP_SHIFT)) & INPUTMUX_CTIMER2CAP0_INP_MASK) -/*! @} */ - -/*! @name CTIMER2CAP1 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER2CAP1_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER2CAP1_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER2CAP1_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER2CAP1_INP_SHIFT)) & INPUTMUX_CTIMER2CAP1_INP_MASK) -/*! @} */ - -/*! @name CTIMER2CAP2 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER2CAP2_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER2CAP2_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER2CAP2_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER2CAP2_INP_SHIFT)) & INPUTMUX_CTIMER2CAP2_INP_MASK) -/*! @} */ - -/*! @name CTIMER2CAP3 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER2CAP3_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER2CAP3_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER2CAP3_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER2CAP3_INP_SHIFT)) & INPUTMUX_CTIMER2CAP3_INP_MASK) -/*! @} */ - -/*! @name TIMER2TRIG - Trigger Register for CTIMER */ -/*! @{ */ - -#define INPUTMUX_TIMER2TRIG_INP_MASK (0x7FU) -#define INPUTMUX_TIMER2TRIG_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0_IRQ input is selected - * 0b0011010..ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_TIMER2TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_TIMER2TRIG_INP_SHIFT)) & INPUTMUX_TIMER2TRIG_INP_MASK) -/*! @} */ - -/*! @name INPUTMUX_SMARTDMA_SMARTDMAARCHB_INMUX - Inputmux Register for SMARTDMA Arch B Inputs */ -/*! @{ */ - -#define INPUTMUX_INPUTMUX_SMARTDMA_SMARTDMAARCHB_INMUX_INP_MASK (0x7FU) -#define INPUTMUX_INPUTMUX_SMARTDMA_SMARTDMAARCHB_INMUX_INP_SHIFT (0U) -/*! INP - Input number select to SmartDMA ARCHB input - * 0b0000000..FlexIO interrupt is selected as input - * 0b0000001..GPIO P0_1 input is selected - * 0b0000010..GPIO P0_2 input is selected - * 0b0000011..GPIO P0_3 input is selected - * 0b0000100..GPIO P0_4 input is selected - * 0b0000101..GPIO P0_5 input is selected - * 0b0000110..GPIO P0_6 input is selected - * 0b0000111..GPIO P0_7 input is selected - * 0b0001000..GPIO P0_8 input is selected - * 0b0001001..GPIO P0_9 input is selected - * 0b0001010..GPIO P0_10 input is selected - * 0b0001011..GPIO P0_11 input is selected - * 0b0001100..GPIO P0_12 input is selected - * 0b0001101..GPIO P0_13 input is selected - * 0b0001110..GPIO P0_14 input is selected - * 0b0001111..GPIO P0_15 input is selected - * 0b0010000..SCT0 SCT_OUT8 input is selected - * 0b0010001..SCT0 SCT_OUT9 input is selected - * 0b0010010..Reserved - * 0b0010011..Reserved - * 0b0010100..MRT0 MRT_CH0_IRQ input is selected - * 0b0010101..MRT0 MRT_CH1_IRQ input is selected - * 0b0010110..CTIMER4_MAT3 input is selected - * 0b0010111..CTIMER4_MAT2 input is selected - * 0b0011000..CTIMER3_MAT3 input is selected - * 0b0011001..CTIMER3_MAT2 input is selected - * 0b0011010..CTIMER1_MAT3 input is selected - * 0b0011011..CTIMER1_MAT2 input is selected - * 0b0011100..UTICK0 UTICK_IRQ input is selected - * 0b0011101..WWDT0 WDT0_IRQ input is selected - * 0b0011110..ADC0 ADC0_IRQ input is selected - * 0b0011111..CMP0_IRQ input is selected - * 0b0100000..Reserved - * 0b0100001..LP_FLEXCOMM7_IRQ input is selected - * 0b0100010..LP_FLEXCOMM6_IRQ input is selected - * 0b0100011..LP_FLEXCOMM5_IRQ input is selected - * 0b0100100..LP_FLEXCOMM4_IRQ input is selected - * 0b0100101..LP_FLEXCOMM3_IRQ input is selected - * 0b0100110..LP_FLEXCOMM2_IRQ input is selected - * 0b0100111..LP_FLEXCOMM1_IRQ input is selected - * 0b0101000..LP_FLEXCOMM0_IRQ input is selected - * 0b0101001..DMA0_IRQ input is selected - * 0b0101010..DMA1_IRQ input is selected - * 0b0101011..SYS_IRQSYS_IRQ combines the CDOG IRQ, WWDT IRQ, MBC secure violation IRQ, Secure AHB Matrix secure - * violation IRQ, GDET IRQ, ELS S50 error IRQ, PKC error IRQ, and VBAT IRQ using the logical OR - * operation. input is selected - * 0b0101100..RTC_COMBO_IRQ input is selected - * 0b0101101..ARM_TXEV input is selected - * 0b0101110..PINT0 GPIO_INT_BMATCH input is selected - * 0b0101111..Reserved - * 0b0110000..Reserved - * 0b0110001..CMP0_OUT input is selected - * 0b0110010..usb0 start of frame input is selected - * 0b0110011..usb1 start of frame input is selected - * 0b0110100..OSTIMER0 OS_EVENT_TIMER_IRQ input is selected - * 0b0110101..ADC1_IRQ input is selected - * 0b0110110..CMP0_IRQ/CMP1_IRQ/CMP2_IRQ input is selected - * 0b0110111..DAC0_IRQ input is selected - * 0b0111000..DAC1_IRQ/DAC2_IRQ input is selected - * 0b0111001..PWM0_IRQ input is selected - * 0b0111010..PWM1_IRQ input is selected - * 0b0111011..QDC0_IRQ input is selected - * 0b0111100..QDC1_IRQ input is selected - * 0b0111101..EVTG_OUT0A input is selected - * 0b0111110..EVTG_OUT1A input is selected - * 0b0111111..Reserved - * 0b1000000..Reserved - * 0b1000001..GPIO1_alias0 GPIO1 Pin Event Trig 0 input is selected - * 0b1000010..GPIO1_alias1 GPIO1 Pin Event Trig 1 input is selected - * 0b1000011..GPIO2_alias0 GPIO2 Pin Event Trig 0 input is selected - * 0b1000100..GPIO2_alias1 GPIO2 Pin Event Trig 1 input is selected - * 0b1000101..GPIO3_alias0 GPIO3 Pin Event Trig 0 input is selected - * 0b1000110..GPIO3_alias1 GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_INPUTMUX_SMARTDMA_SMARTDMAARCHB_INMUX_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_INPUTMUX_SMARTDMA_SMARTDMAARCHB_INMUX_INP_SHIFT)) & INPUTMUX_INPUTMUX_SMARTDMA_SMARTDMAARCHB_INMUX_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_INPUTMUX_SMARTDMA_SMARTDMAARCHB_INMUX */ -#define INPUTMUX_INPUTMUX_SMARTDMA_SMARTDMAARCHB_INMUX_COUNT (8U) - -/*! @name INPUTMUX_GPIO_INT_PINTSEL - Pin Interrupt Select */ -/*! @{ */ - -#define INPUTMUX_INPUTMUX_GPIO_INT_PINTSEL_INP_MASK (0x7FU) -#define INPUTMUX_INPUTMUX_GPIO_INT_PINTSEL_INP_SHIFT (0U) -/*! INP - Pin number select for pin interrupt or pattern match engine input. For PIOx_y: INP = (x * - * 32) + y. PIO0_0 to PIO1_31 correspond to numbers 0 to 63. - * 0b0000000..GPIO P0_0 input is selected - * 0b0000001..GPIO P0_1 input is selected - * 0b0000010..GPIO P0_2 input is selected - * 0b0000011..GPIO P0_3 input is selected - * 0b0000100..GPIO P0_4 input is selected - * 0b0000101..GPIO P0_5 input is selected - * 0b0000110..GPIO P0_6 input is selected - * 0b0000111..GPIO P0_7 input is selected - * 0b0001000..GPIO P0_8 input is selected - * 0b0001001..GPIO P0_9 input is selected - * 0b0001010..GPIO P0_10 input is selected - * 0b0001011..GPIO P0_11 input is selected - * 0b0001100..GPIO P0_12 input is selected - * 0b0001101..GPIO P0_13 input is selected - * 0b0001110..GPIO P0_14 input is selected - * 0b0001111..GPIO P0_15 input is selected - * 0b0010000..GPIO P0_16 input is selected - * 0b0010001..GPIO P0_17 input is selected - * 0b0010010..GPIO P0_18 input is selected - * 0b0010011..GPIO P0_19 input is selected - * 0b0010100..GPIO P0_20 input is selected - * 0b0010101..GPIO P0_21 input is selected - * 0b0010110..GPIO P0_22 input is selected - * 0b0010111..GPIO P0_23 input is selected - * 0b0011000..GPIO P0_24 input is selected - * 0b0011001..GPIO P0_25 input is selected - * 0b0011010..GPIO P0_26 input is selected - * 0b0011011..GPIO P0_27 input is selected - * 0b0011100..GPIO P0_28 input is selected - * 0b0011101..GPIO P0_29 input is selected - * 0b0011110..GPIO P0_30 input is selected - * 0b0011111..GPIO P0_31 input is selected - * 0b0100000..GPIO P1_0 input is selected - * 0b0100001..GPIO P1_1 input is selected - * 0b0100010..GPIO P1_2 input is selected - * 0b0100011..GPIO P1_3 input is selected - * 0b0100100..GPIO P1_4 input is selected - * 0b0100101..GPIO P1_5 input is selected - * 0b0100110..GPIO P1_6 input is selected - * 0b0100111..GPIO P1_7 input is selected - * 0b0101000..GPIO P1_8 input is selected - * 0b0101001..GPIO P1_9 input is selected - * 0b0101010..GPIO P1_10 input is selected - * 0b0101011..GPIO P1_11 input is selected - * 0b0101100..GPIO P1_12 input is selected - * 0b0101101..GPIO P1_13 input is selected - * 0b0101110..GPIO P1_14 input is selected - * 0b0101111..GPIO P1_15 input is selected - * 0b0110000..GPIO P1_16 input is selected - * 0b0110001..GPIO P1_17 input is selected - * 0b0110010..GPIO P1_18 input is selected - * 0b0110011..GPIO P1_19 input is selected - * 0b0110100..GPIO P1_20 input is selected - * 0b0110101..GPIO P1_21 input is selected - * 0b0110110..GPIO P1_22 input is selected - * 0b0110111..GPIO P1_23 input is selected - * 0b0111000..Reserved - * 0b0111001..Reserved - * 0b0111010..Reserved - * 0b0111011..Reserved - * 0b0111100..Reserved - * 0b0111101..Reserved - * 0b0111110..GPIO P1_30 input is selected - * 0b0111111..GPIO P1_31 input is selected - * *.. - */ -#define INPUTMUX_INPUTMUX_GPIO_INT_PINTSEL_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_INPUTMUX_GPIO_INT_PINTSEL_INP_SHIFT)) & INPUTMUX_INPUTMUX_GPIO_INT_PINTSEL_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_INPUTMUX_GPIO_INT_PINTSEL */ -#define INPUTMUX_INPUTMUX_GPIO_INT_PINTSEL_COUNT (8U) - -/*! @name FREQMEAS_REF - Selection for Frequency Measurement Reference Clock */ -/*! @{ */ - -#define INPUTMUX_FREQMEAS_REF_INP_MASK (0x3FU) -#define INPUTMUX_FREQMEAS_REF_INP_SHIFT (0U) -/*! INP - Clock source number (binary value) for frequency measure function reference clock. - * 0b000000..clk_in (output of clk_in or XTAL mux in Clockgen) input is selected - * 0b000001..FRO_12M input is selected - * 0b000010..FRO_144M input is selected - * 0b000011..Reserved - * 0b000100..OSC_32K input is selected - * 0b000101..CPU/system_clk input is selected - * 0b000110..FREQME_CLK_IN0 input is selected - * 0b000111..FREQME_CLK_IN1 input is selected - * 0b001000..EVTG_OUT0A input is selected - * 0b001001..EVTG_OUT1A input is selected - * *.. - */ -#define INPUTMUX_FREQMEAS_REF_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FREQMEAS_REF_INP_SHIFT)) & INPUTMUX_FREQMEAS_REF_INP_MASK) -/*! @} */ - -/*! @name FREQMEAS_TAR - Selection for Frequency Measurement Target Clock */ -/*! @{ */ - -#define INPUTMUX_FREQMEAS_TAR_INP_MASK (0x3FU) -#define INPUTMUX_FREQMEAS_TAR_INP_SHIFT (0U) -/*! INP - Clock source number (binary value) for frequency measure function target clock. - * 0b000000..clk_in (output of clk_in or XTAL mux in Clockgen) input is selected - * 0b000001..FRO_12M input is selected - * 0b000010..FRO_144M input is selected - * 0b000011..Reserved - * 0b000100..OSC_32K input is selected - * 0b000101..CPU/system_clk input is selected - * 0b000110..FREQME_CLK_IN0 input is selected - * 0b000111..FREQME_CLK_IN1 input is selected - * 0b001000..EVTG_OUT0A input is selected - * 0b001001..EVTG_OUT1A input is selected - * *.. - */ -#define INPUTMUX_FREQMEAS_TAR_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FREQMEAS_TAR_INP_SHIFT)) & INPUTMUX_FREQMEAS_TAR_INP_MASK) -/*! @} */ - -/*! @name CTIMER3CAP0 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER3CAP0_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER3CAP0_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0 ADC0_IRQ input is selected - * 0b0011010..ADC0 ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER3CAP0_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER3CAP0_INP_SHIFT)) & INPUTMUX_CTIMER3CAP0_INP_MASK) -/*! @} */ - -/*! @name CTIMER3CAP1 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER3CAP1_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER3CAP1_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0 ADC0_IRQ input is selected - * 0b0011010..ADC0 ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER3CAP1_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER3CAP1_INP_SHIFT)) & INPUTMUX_CTIMER3CAP1_INP_MASK) -/*! @} */ - -/*! @name CTIMER3CAP2 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER3CAP2_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER3CAP2_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0 ADC0_IRQ input is selected - * 0b0011010..ADC0 ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER3CAP2_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER3CAP2_INP_SHIFT)) & INPUTMUX_CTIMER3CAP2_INP_MASK) -/*! @} */ - -/*! @name CTIMER3CAP3 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER3CAP3_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER3CAP3_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0 ADC0_IRQ input is selected - * 0b0011010..ADC0 ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER3CAP3_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER3CAP3_INP_SHIFT)) & INPUTMUX_CTIMER3CAP3_INP_MASK) -/*! @} */ - -/*! @name TIMER3TRIG - Trigger Register for CTIMER */ -/*! @{ */ - -#define INPUTMUX_TIMER3TRIG_INP_MASK (0x7FU) -#define INPUTMUX_TIMER3TRIG_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0 ADC0_IRQ input is selected - * 0b0011010..ADC0 ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_TIMER3TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_TIMER3TRIG_INP_SHIFT)) & INPUTMUX_TIMER3TRIG_INP_MASK) -/*! @} */ - -/*! @name CTIMER4CAP0 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER4CAP0_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER4CAP0_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0 ADC0_IRQ input is selected - * 0b0011010..ADC0 ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER4CAP0_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER4CAP0_INP_SHIFT)) & INPUTMUX_CTIMER4CAP0_INP_MASK) -/*! @} */ - -/*! @name CTIMER4CAP1 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER4CAP1_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER4CAP1_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0 ADC0_IRQ input is selected - * 0b0011010..ADC0 ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER4CAP1_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER4CAP1_INP_SHIFT)) & INPUTMUX_CTIMER4CAP1_INP_MASK) -/*! @} */ - -/*! @name CTIMER4CAP2 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER4CAP2_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER4CAP2_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0 ADC0_IRQ input is selected - * 0b0011010..ADC0 ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER4CAP2_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER4CAP2_INP_SHIFT)) & INPUTMUX_CTIMER4CAP2_INP_MASK) -/*! @} */ - -/*! @name CTIMER4CAP3 - Capture Select Register for CTIMER Inputs */ -/*! @{ */ - -#define INPUTMUX_CTIMER4CAP3_INP_MASK (0x7FU) -#define INPUTMUX_CTIMER4CAP3_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0 ADC0_IRQ input is selected - * 0b0011010..ADC0 ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_CTIMER4CAP3_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CTIMER4CAP3_INP_SHIFT)) & INPUTMUX_CTIMER4CAP3_INP_MASK) -/*! @} */ - -/*! @name TIMER4TRIG - Trigger Register for CTIMER */ -/*! @{ */ - -#define INPUTMUX_TIMER4TRIG_INP_MASK (0x7FU) -#define INPUTMUX_TIMER4TRIG_INP_SHIFT (0U) -/*! INP - Input number for CTIMER - * 0b0000000..CT_INP0 input is selected - * 0b0000001..CT_INP1 input is selected - * 0b0000010..CT_INP2 input is selected - * 0b0000011..CT_INP3 input is selected - * 0b0000100..CT_INP4 input is selected - * 0b0000101..CT_INP5 input is selected - * 0b0000110..CT_INP6 input is selected - * 0b0000111..CT_INP7 input is selected - * 0b0001000..CT_INP8 input is selected - * 0b0001001..CT_INP9 input is selected - * 0b0001010..CT_INP10 input is selected - * 0b0001011..CT_INP11 input is selected - * 0b0001100..CT_INP12 input is selected - * 0b0001101..CT_INP13 input is selected - * 0b0001110..CT_INP14 input is selected - * 0b0001111..CT_INP15 input is selected - * 0b0010000..CT_INP16 input is selected - * 0b0010001..CT_INP17 input is selected - * 0b0010010..CT_INP18 input is selected - * 0b0010011..CT_INP19 input is selected - * 0b0010100..usb0 start of frame input is selected - * 0b0010101..usb1 start of frame input is selected - * 0b0010110..DCDC_BURST_ACTIVE input is selected - * 0b0010111..sai0_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011000..sai0_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * 0b0011001..ADC0 ADC0_IRQ input is selected - * 0b0011010..ADC0 ADC1_IRQ input is selected - * 0b0011011..CMP0_OUT input is selected - * 0b0011100..CMP1_OUT input is selected - * 0b0011101..CMP2_OUT input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b0100100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b0100110..QDC0_CMP/POS_MATCH input is selected - * 0b0100111..QDC1_CMP/POS_MATCH input is selected - * 0b0101000..EVTG_OUT0A input is selected - * 0b0101001..EVTG_OUT0B input is selected - * 0b0101010..EVTG_OUT1A input is selected - * 0b0101011..EVTG_OUT1B input is selected - * 0b0101100..EVTG_OUT2A input is selected - * 0b0101101..EVTG_OUT2B input is selected - * 0b0101110..EVTG_OUT3A input is selected - * 0b0101111..EVTG_OUT3B input is selected - * 0b0110000..Reserved - * 0b0110001..Reserved - * 0b0110010..LP_FLEXCOMM0 trig 0 input is selected - * 0b0110011..LP_FLEXCOMM0 trig 1 input is selected - * 0b0110100..LP_FLEXCOMM0 trig 2 input is selected - * 0b0110101..LP_FLEXCOMM1 trig 0 input is selected - * 0b0110110..LP_FLEXCOMM1 trig 1 input is selected - * 0b0110111..LP_FLEXCOMM1 trig 2 input is selected - * 0b0111000..LP_FLEXCOMM2 trig 0 input is selected - * 0b0111001..LP_FLEXCOMM2 trig 1 input is selected - * 0b0111010..LP_FLEXCOMM2 trig 2 input is selected - * 0b0111011..LP_FLEXCOMM3 trig 0 input is selected - * 0b0111100..LP_FLEXCOMM3 trig 1 input is selected - * 0b0111101..LP_FLEXCOMM3 trig 2 input is selected - * 0b0111110..LP_FLEXCOMM3 trig 3 input is selected - * 0b0111111..sai1_tx_sync_outsai_tx_sync_out is Transmit Frame Sync for multi-SAI synchronous operation. input is selected - * 0b1000000..sai1_rx_sync_outsai_rx_sync_out is Receive Frame Sync for multi-SAI synchronous operation. input is selected - * *.. - */ -#define INPUTMUX_TIMER4TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_TIMER4TRIG_INP_SHIFT)) & INPUTMUX_TIMER4TRIG_INP_MASK) -/*! @} */ - -/*! @name CMP0_TRIG - CMP0 Input Connections */ -/*! @{ */ - -#define INPUTMUX_CMP0_TRIG_TRIGIN_MASK (0x3FU) -#define INPUTMUX_CMP0_TRIG_TRIGIN_SHIFT (0U) -/*! TRIGIN - CMP0 input trigger - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT6 input is selected - * 0b000010..SCT_OUT4 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT6 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER0_MAT0 input is selected - * 0b001001..CTIMER4_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..Reserved - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC1_tcomp[0] input is selected - * 0b001111..Reserved - * 0b010000..Reserved - * 0b010001..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b010010..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b010011..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b010100..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b010101..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b010110..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b010111..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b011000..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b011001..QDC0_CMP/POS_MATCH input is selected - * 0b011010..QDC1_CMP/POS_MATCH input is selected - * 0b011011..EVTG_OUT0A input is selected - * 0b011100..EVTG_OUT0B input is selected - * 0b011101..EVTG_OUT1A input is selected - * 0b011110..EVTG_OUT1B input is selected - * 0b011111..EVTG_OUT2A input is selected - * 0b100000..EVTG_OUT2B input is selected - * 0b100001..EVTG_OUT3A input is selected - * 0b100010..EVTG_OUT3B input is selected - * 0b100011..LPTMR0 input is selected - * 0b100100..LPTMR1 input is selected - * 0b100101..GPIO2 Pin Event Trig 0 input is selected - * 0b100110..GPIO2 Pin Event Trig 1 input is selected - * 0b100111..GPIO3 Pin Event Trig 0 input is selected - * 0b101000..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_CMP0_TRIG_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CMP0_TRIG_TRIGIN_SHIFT)) & INPUTMUX_CMP0_TRIG_TRIGIN_MASK) -/*! @} */ - -/*! @name ADC0_TRIGM_ADC0_TRIG - ADC Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_ADC0_TRIGM_ADC0_TRIG_TRIGIN_MASK (0xFFU) -#define INPUTMUX_ADC0_TRIGM_ADC0_TRIG_TRIGIN_SHIFT (0U) -/*! TRIGIN - ADC0 trigger inputs - * 0b00000000..PINT PIN_INT0 input is selected - * 0b00000001..PINT PIN_INT1 input is selected - * 0b00000010..SCT0 SCT_OUT4 input is selected - * 0b00000011..SCT0 SCT_OUT5 input is selected - * 0b00000100..SCT0 SCT_OUT9 input is selected - * 0b00000101..CTIMER0_MAT3 input is selected - * 0b00000110..CTIMER1_MAT3 input is selected - * 0b00000111..CTIMER2_MAT3 input is selected - * 0b00001000..CTIMER3_MAT3 input is selected - * 0b00001001..CTIMER4_MAT3 input is selected - * 0b00001010..DCDC_Burst_Done_Trig input is selected - * 0b00001011..Reserved - * 0b00001100..PINT GPIO_INT_BMAT input is selected - * 0b00001101..ADC0_tcomp[0] input is selected - * 0b00001110..ADC0_tcomp[1] input is selected - * 0b00001111..ADC0_tcomp[2] input is selected - * 0b00010000..ADC0_tcomp[3] input is selected - * 0b00010001..ADC1_tcomp[0] input is selected - * 0b00010010..ADC1_tcomp[1] input is selected - * 0b00010011..ADC1_tcomp[2] input is selected - * 0b00010100..ADC1_tcomp[3] input is selected - * 0b00010101..CMP0_OUT input is selected - * 0b00010110..CMP1_OUT input is selected - * 0b00010111..CMP2_OUT input is selected - * 0b00011000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b00011001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b00011010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b00011011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b00011100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b00011101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b00011110..PWM0_SM3_MUX_TRIG0 input is selected - * 0b00011111..PWM0_SM3_MUX_TRIG1 input is selected - * 0b00100000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b00100001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b00100010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b00100011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b00100100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b00100101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b00100110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b00100111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b00101000..QDC0_CMP/POS_MATCH input is selected - * 0b00101001..QDC1_CMP/POS_MATCH input is selected - * 0b00101010..EVTG_OUT0A input is selected - * 0b00101011..EVTG_OUT0B input is selected - * 0b00101100..EVTG_OUT1A input is selected - * 0b00101101..EVTG_OUT1B input is selected - * 0b00101110..EVTG_OUT2A input is selected - * 0b00101111..EVTG_OUT2B input is selected - * 0b00110000..EVTG_OUT3A input is selected - * 0b00110001..EVTG_OUT3B input is selected - * 0b00110010..LPTMR0 input is selected - * 0b00110011..LPTMR1 input is selected - * 0b00110100..FlexIO CH0 input is selected - * 0b00110101..FlexIO CH1 input is selected - * 0b00110110..FlexIO CH2 input is selected - * 0b00110111..FlexIO CH3 input is selected - * 0b00111000..SINC Filter CH0 Conversion Complete input is selected - * 0b00111001..SINC Filter CH1 Conversion Complete input is selected - * 0b00111010..SINC Filter CH2 Conversion Complete input is selected - * 0b00111011..SINC Filter CH3 Conversion Complete input is selected - * 0b00111100..SINC Filter CH4 Conversion Complete input is selected - * 0b00111101..GPIO2 Pin Event Trig 0 input is selected - * 0b00111110..GPIO2 Pin Event Trig 1 input is selected - * 0b00111111..GPIO3 Pin Event Trig 0 input is selected - * 0b01000000..GPIO3 Pin Event Trig 1 input is selected - * 0b01000001..WUU input is selected - * *.. - */ -#define INPUTMUX_ADC0_TRIGM_ADC0_TRIG_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_ADC0_TRIGM_ADC0_TRIG_TRIGIN_SHIFT)) & INPUTMUX_ADC0_TRIGM_ADC0_TRIG_TRIGIN_MASK) -/*! @} */ - -/* The count of INPUTMUX_ADC0_TRIGM_ADC0_TRIG */ -#define INPUTMUX_ADC0_TRIGM_ADC0_TRIG_COUNT (4U) - -/*! @name ADC1_TRIGN_ADC1_TRIG - ADC Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_ADC1_TRIGN_ADC1_TRIG_TRIGIN_MASK (0xFFU) -#define INPUTMUX_ADC1_TRIGN_ADC1_TRIG_TRIGIN_SHIFT (0U) -/*! TRIGIN - ADC1 trigger inputs - * 0b00000000..PINT PIN_INT0 input is selected - * 0b00000001..PINT PIN_INT2 input is selected - * 0b00000010..SCT0 SCT_OUT4 input is selected - * 0b00000011..SCT0 SCT_OUT5 input is selected - * 0b00000100..SCT0 SCT_OUT3 input is selected - * 0b00000101..CTIMER0_MAT3 input is selected - * 0b00000110..CTIMER1_MAT3 input is selected - * 0b00000111..CTIMER2_MAT3 input is selected - * 0b00001000..CTIMER3_MAT2 input is selected - * 0b00001001..CTIMER4_MAT1 input is selected - * 0b00001010..DCDC_Burst_Done_Trig input is selected - * 0b00001011..Reserved - * 0b00001100..PINT GPIO_INT_BMAT input is selected - * 0b00001101..ADC0_tcomp[0] input is selected - * 0b00001110..ADC0_tcomp[1] input is selected - * 0b00001111..ADC0_tcomp[2] input is selected - * 0b00010000..ADC0_tcomp[3] input is selected - * 0b00010001..ADC1_tcomp[0] input is selected - * 0b00010010..ADC1_tcomp[1] input is selected - * 0b00010011..ADC1_tcomp[2] input is selected - * 0b00010100..ADC1_tcomp[3] input is selected - * 0b00010101..CMP0_OUT input is selected - * 0b00010110..CMP1_OUT input is selected - * 0b00010111..CMP2_OUT input is selected - * 0b00011000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b00011001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b00011010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b00011011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b00011100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b00011101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b00011110..PWM0_SM3_MUX_TRIG0 input is selected - * 0b00011111..PWM0_SM3_MUX_TRIG1 input is selected - * 0b00100000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b00100001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b00100010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b00100011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b00100100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b00100101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b00100110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b00100111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b00101000..QDC0_CMP/POS_MATCH input is selected - * 0b00101001..QDC1_CMP/POS_MATCH input is selected - * 0b00101010..EVTG_OUT0A input is selected - * 0b00101011..EVTG_OUT0B input is selected - * 0b00101100..EVTG_OUT1A input is selected - * 0b00101101..EVTG_OUT1B input is selected - * 0b00101110..EVTG_OUT2A input is selected - * 0b00101111..EVTG_OUT2B input is selected - * 0b00110000..EVTG_OUT3A input is selected - * 0b00110001..EVTG_OUT3B input is selected - * 0b00110010..LPTMR0 input is selected - * 0b00110011..LPTMR1 input is selected - * 0b00110100..FlexIO CH0 input is selected - * 0b00110101..FlexIO CH1 input is selected - * 0b00110110..FlexIO CH2 input is selected - * 0b00110111..FlexIO CH3 input is selected - * 0b00111000..SINC Filter CH0 Conversion Complete input is selected - * 0b00111001..SINC Filter CH1 Conversion Complete input is selected - * 0b00111010..SINC Filter CH2 Conversion Complete input is selected - * 0b00111011..SINC Filter CH3 Conversion Complete input is selected - * 0b00111100..SINC Filter CH4 Conversion Complete input is selected - * 0b00111101..GPIO2 Pin Event Trig 0 input is selected - * 0b00111110..GPIO2 Pin Event Trig 1 input is selected - * 0b00111111..GPIO3 Pin Event Trig 0 input is selected - * 0b01000000..GPIO3 Pin Event Trig 1 input is selected - * 0b01000001..WUU input is selected - * *.. - */ -#define INPUTMUX_ADC1_TRIGN_ADC1_TRIG_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_ADC1_TRIGN_ADC1_TRIG_TRIGIN_SHIFT)) & INPUTMUX_ADC1_TRIGN_ADC1_TRIG_TRIGIN_MASK) -/*! @} */ - -/* The count of INPUTMUX_ADC1_TRIGN_ADC1_TRIG */ -#define INPUTMUX_ADC1_TRIGN_ADC1_TRIG_COUNT (4U) - -/*! @name DAC0_TRIG - DAC0 Trigger Inputs */ -/*! @{ */ - -#define INPUTMUX_DAC0_TRIG_TRIGIN_MASK (0x3FU) -#define INPUTMUX_DAC0_TRIG_TRIGIN_SHIFT (0U) -/*! TRIGIN - DAC0 trigger input - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT3 input is selected - * 0b000010..SCT0 SCT_OUT4 input is selected - * 0b000011..SCT0 SCT_OUT5 input is selected - * 0b000100..SCT0 SCT_OUT0 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER2_MAT0 input is selected - * 0b001001..CTIMER3_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..Reserved - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC1_tcomp[0] input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..CMP2_OUT input is selected - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..LPTMR0 input is selected - * 0b011011..LPTMR1 input is selected - * 0b011100..GPIO2 Pin Event Trig 0 input is selected - * 0b011101..GPIO2 Pin Event Trig 1 input is selected - * 0b011110..GPIO3 Pin Event Trig 0 input is selected - * 0b011111..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_DAC0_TRIG_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DAC0_TRIG_TRIGIN_SHIFT)) & INPUTMUX_DAC0_TRIG_TRIGIN_MASK) -/*! @} */ - -/*! @name DAC1_TRIG - DAC1 Trigger Inputs */ -/*! @{ */ - -#define INPUTMUX_DAC1_TRIG_TRIGIN_MASK (0x3FU) -#define INPUTMUX_DAC1_TRIG_TRIGIN_SHIFT (0U) -/*! TRIGIN - DAC1 trigger input - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT4 input is selected - * 0b000010..SCT0 SCT_OUT4 input is selected - * 0b000011..SCT0 SCT_OUT5 input is selected - * 0b000100..SCT0 SCT_OUT1 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER2_MAT1 input is selected - * 0b001001..CTIMER3_MAT1 input is selected - * 0b001010..Reserved - * 0b001011..Reserved - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[1] input is selected - * 0b001110..ADC1_tcomp[1] input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..CMP2_OUT input is selected - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..LPTMR0 input is selected - * 0b011011..LPTMR1 input is selected - * 0b011100..GPIO2 Pin Event Trig 0 input is selected - * 0b011101..GPIO2 Pin Event Trig 1 input is selected - * 0b011110..GPIO3 Pin Event Trig 0 input is selected - * 0b011111..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_DAC1_TRIG_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DAC1_TRIG_TRIGIN_SHIFT)) & INPUTMUX_DAC1_TRIG_TRIGIN_MASK) -/*! @} */ - -/*! @name DAC2_TRIG - DAC2 Trigger Inputs */ -/*! @{ */ - -#define INPUTMUX_DAC2_TRIG_TRIGIN_MASK (0x3FU) -#define INPUTMUX_DAC2_TRIG_TRIGIN_SHIFT (0U) -/*! TRIGIN - DAC2 trigger input - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..SCT0 SCT_OUT4 input is selected - * 0b000011..SCT0 SCT_OUT5 input is selected - * 0b000100..SCT0 SCT_OUT2 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER2_MAT2 input is selected - * 0b001001..CTIMER3_MAT2 input is selected - * 0b001010..Reserved - * 0b001011..Reserved - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[2] input is selected - * 0b001110..ADC1_tcomp[2] input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..CMP2_OUT input is selected - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..LPTMR0 input is selected - * 0b011011..LPTMR1 input is selected - * 0b011100..GPIO2 Pin Event Trig 0 input is selected - * 0b011101..GPIO2 Pin Event Trig 1 input is selected - * 0b011110..GPIO3 Pin Event Trig 0 input is selected - * 0b011111..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_DAC2_TRIG_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DAC2_TRIG_TRIGIN_SHIFT)) & INPUTMUX_DAC2_TRIG_TRIGIN_MASK) -/*! @} */ - -/*! @name QDCN_QDC_TRIG - QDC0 Trigger Input Connections..QDC1 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDCN_QDC_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_QDCN_QDC_TRIG_INP_SHIFT (0U) -/*! INP - QDC1 trigger input connections - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT4 input is selected - * 0b000010..SCT_OUT4 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT1 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER1_MAT0 input is selected - * 0b001001..CTIMER3_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..CMP2_OUT input is selected - * 0b011000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * *.. - */ -#define INPUTMUX_QDCN_QDC_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDCN_QDC_TRIG_INP_SHIFT)) & INPUTMUX_QDCN_QDC_TRIG_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_QDCN_QDC_TRIG */ -#define INPUTMUX_QDCN_QDC_TRIG_COUNT (2U) - -/*! @name QDCN_QDC_HOME - QDC0 Input Connections..QDC1 Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDCN_QDC_HOME_INP_MASK (0x3FU) -#define INPUTMUX_QDCN_QDC_HOME_INP_SHIFT (0U) -/*! INP - QDC1 HOME input connections - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT4 input is selected - * 0b000010..SCT0 SCT_OUT4 input is selected - * 0b000011..SCT0 SCT_OUT5 input is selected - * 0b000100..SCT0 SCT_OUT1 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER1_MAT0 input is selected - * 0b001001..CTIMER3_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..CMP2_OUT input is selected - * 0b011000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * *.. - */ -#define INPUTMUX_QDCN_QDC_HOME_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDCN_QDC_HOME_INP_SHIFT)) & INPUTMUX_QDCN_QDC_HOME_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_QDCN_QDC_HOME */ -#define INPUTMUX_QDCN_QDC_HOME_COUNT (2U) - -/*! @name QDCN_QDC_INDEX - QDC0 Input Connections..QDC1 Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDCN_QDC_INDEX_INP_MASK (0x3FU) -#define INPUTMUX_QDCN_QDC_INDEX_INP_SHIFT (0U) -/*! INP - QDC1 INDEX input connections - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT4 input is selected - * 0b000010..SCT_OUT4 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT1 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER1_MAT0 input is selected - * 0b001001..CTIMER3_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..CMP2_OUT input is selected - * 0b011000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * *.. - */ -#define INPUTMUX_QDCN_QDC_INDEX_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDCN_QDC_INDEX_INP_SHIFT)) & INPUTMUX_QDCN_QDC_INDEX_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_QDCN_QDC_INDEX */ -#define INPUTMUX_QDCN_QDC_INDEX_COUNT (2U) - -/*! @name QDCN_QDC_PHASEB - QDC0 Input Connections..QDC1 Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDCN_QDC_PHASEB_INP_MASK (0x3FU) -#define INPUTMUX_QDCN_QDC_PHASEB_INP_SHIFT (0U) -/*! INP - QDC1 PHASEB input connections - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT4 input is selected - * 0b000010..SCT_OUT4 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT1 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER1_MAT0 input is selected - * 0b001001..CTIMER3_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..CMP2_OUT input is selected - * 0b011000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * *.. - */ -#define INPUTMUX_QDCN_QDC_PHASEB_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDCN_QDC_PHASEB_INP_SHIFT)) & INPUTMUX_QDCN_QDC_PHASEB_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_QDCN_QDC_PHASEB */ -#define INPUTMUX_QDCN_QDC_PHASEB_COUNT (2U) - -/*! @name QDCN_QDC_PHASEA - QDC0 Input Connections..QDC1 Input Connections */ -/*! @{ */ - -#define INPUTMUX_QDCN_QDC_PHASEA_INP_MASK (0x3FU) -#define INPUTMUX_QDCN_QDC_PHASEA_INP_SHIFT (0U) -/*! INP - QDC1 PHASEA input connections - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT4 input is selected - * 0b000010..SCT_OUT4 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT1 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER1_MAT0 input is selected - * 0b001001..CTIMER3_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..CMP2_OUT input is selected - * 0b011000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * *.. - */ -#define INPUTMUX_QDCN_QDC_PHASEA_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_QDCN_QDC_PHASEA_INP_SHIFT)) & INPUTMUX_QDCN_QDC_PHASEA_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_QDCN_QDC_PHASEA */ -#define INPUTMUX_QDCN_QDC_PHASEA_COUNT (2U) - -/*! @name FLEXPWM_SM_EXTSYNC_FLEXPWM0_SM_EXTSYNC - PWM0 External Synchronization */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM_SM_EXTSYNC_FLEXPWM0_SM_EXTSYNC_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM_SM_EXTSYNC_FLEXPWM0_SM_EXTSYNC_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXTSYNC input connections for PWM0 - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..SCT_OUT4 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT2 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER2_MAT0 input is selected - * 0b001001..CTIMER4_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..CMP2_OUT input is selected - * 0b011000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * 0b110100..SINC Filter CH0 sync Break input is selected - * 0b110101..SINC Filter CH1 sync Break input is selected - * 0b110110..SINC Filter CH2 sync Break input is selected - * 0b110111..SINC Filter CH3 sync Break input is selected - * 0b111000..SINC Filter CH4 sync Break input is selected - * 0b111001..GPIO2 Pin Event Trig 0 input is selected - * 0b111010..GPIO2 Pin Event Trig 1 input is selected - * 0b111011..GPIO3 Pin Event Trig 0 input is selected - * 0b111100..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM_SM_EXTSYNC_FLEXPWM0_SM_EXTSYNC_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM_SM_EXTSYNC_FLEXPWM0_SM_EXTSYNC_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM_SM_EXTSYNC_FLEXPWM0_SM_EXTSYNC_TRIGIN_MASK) -/*! @} */ - -/* The count of INPUTMUX_FLEXPWM_SM_EXTSYNC_FLEXPWM0_SM_EXTSYNC */ -#define INPUTMUX_FLEXPWM_SM_EXTSYNC_FLEXPWM0_SM_EXTSYNC_COUNT (4U) - -/*! @name FLEXPWM_SM_EXT_FLEXPWM0_SM_EXTA - PWM0 Input Trigger Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM_SM_EXT_FLEXPWM0_SM_EXTA_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM_SM_EXT_FLEXPWM0_SM_EXTA_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXTA input connections for PWM0 - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..SCT_OUT4 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT2 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER2_MAT0 input is selected - * 0b001001..CTIMER4_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..CMP2_OUT input is selected - * 0b011000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * 0b110100..SINC Filter CH0 sync Break input is selected - * 0b110101..SINC Filter CH1 sync Break input is selected - * 0b110110..SINC Filter CH2 sync Break input is selected - * 0b110111..SINC Filter CH3 sync Break input is selected - * 0b111000..SINC Filter CH4 sync Break input is selected - * 0b111001..GPIO2 Pin Event Trig 0 input is selected - * 0b111010..GPIO2 Pin Event Trig 1 input is selected - * 0b111011..GPIO3 Pin Event Trig 0 input is selected - * 0b111100..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM_SM_EXT_FLEXPWM0_SM_EXTA_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM_SM_EXT_FLEXPWM0_SM_EXTA_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM_SM_EXT_FLEXPWM0_SM_EXTA_TRIGIN_MASK) -/*! @} */ - -/* The count of INPUTMUX_FLEXPWM_SM_EXT_FLEXPWM0_SM_EXTA */ -#define INPUTMUX_FLEXPWM_SM_EXT_FLEXPWM0_SM_EXTA_COUNT (4U) - -/*! @name FLEXPWM0_EXTFORCE - PWM0 External Force Trigger Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM0_EXTFORCE_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM0_EXTFORCE_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXTFORCE input connections for PWM0 - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..SCT_OUT4 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT2 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER2_MAT0 input is selected - * 0b001001..CTIMER4_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..CMP2_OUT input is selected - * 0b011000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * 0b110100..SINC Filter CH0 sync Break input is selected - * 0b110101..SINC Filter CH1 sync Break input is selected - * 0b110110..SINC Filter CH2 sync Break input is selected - * 0b110111..SINC Filter CH3 sync Break input is selected - * 0b111000..SINC Filter CH4 sync Break input is selected - * 0b111001..GPIO2 Pin Event Trig 0 input is selected - * 0b111010..GPIO2 Pin Event Trig 1 input is selected - * 0b111011..GPIO3 Pin Event Trig 0 input is selected - * 0b111100..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM0_EXTFORCE_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM0_EXTFORCE_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM0_EXTFORCE_TRIGIN_MASK) -/*! @} */ - -/*! @name FLEXPWM_FAULT_FLEXPWM0_FAULT - PWM0 Fault Input Trigger Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM_FAULT_FLEXPWM0_FAULT_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM_FAULT_FLEXPWM0_FAULT_TRIGIN_SHIFT (0U) -/*! TRIGIN - FAULT input connections for PWM0 - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..SCT_OUT4 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT2 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER2_MAT0 input is selected - * 0b001001..CTIMER4_MAT0 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..CMP2_OUT input is selected - * 0b011000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * 0b110100..SINC Filter CH0 sync Break input is selected - * 0b110101..SINC Filter CH1 sync Break input is selected - * 0b110110..SINC Filter CH2 sync Break input is selected - * 0b110111..SINC Filter CH3 sync Break input is selected - * 0b111000..SINC Filter CH4 sync Break input is selected - * 0b111001..GPIO2 Pin Event Trig 0 input is selected - * 0b111010..GPIO2 Pin Event Trig 1 input is selected - * 0b111011..GPIO3 Pin Event Trig 0 input is selected - * 0b111100..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM_FAULT_FLEXPWM0_FAULT_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM_FAULT_FLEXPWM0_FAULT_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM_FAULT_FLEXPWM0_FAULT_TRIGIN_MASK) -/*! @} */ - -/* The count of INPUTMUX_FLEXPWM_FAULT_FLEXPWM0_FAULT */ -#define INPUTMUX_FLEXPWM_FAULT_FLEXPWM0_FAULT_COUNT (4U) - -/*! @name FLEXPWM1_SM_EXTSYNC_ARRAY_FLEXPWM1_SM_EXTSYNC - PWM1 External Synchronization */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM1_SM_EXTSYNC_ARRAY_FLEXPWM1_SM_EXTSYNC_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM1_SM_EXTSYNC_ARRAY_FLEXPWM1_SM_EXTSYNC_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXTSYNC input connections for PWM1 - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT2 input is selected - * 0b000010..SCT_OUT4 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT3 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER2_MAT1 input is selected - * 0b001001..CTIMER4_MAT1 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..CMP2_OUT input is selected - * 0b011000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM0_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM0_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * 0b110100..SINC Filter CH0 sync Break input is selected - * 0b110101..SINC Filter CH1 sync Break input is selected - * 0b110110..SINC Filter CH2 sync Break input is selected - * 0b110111..SINC Filter CH3 sync Break input is selected - * 0b111000..SINC Filter CH4 sync Break input is selected - * 0b111001..GPIO2 Pin Event Trig 0 input is selected - * 0b111010..GPIO2 Pin Event Trig 1 input is selected - * 0b111011..GPIO3 Pin Event Trig 0 input is selected - * 0b111100..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM1_SM_EXTSYNC_ARRAY_FLEXPWM1_SM_EXTSYNC_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM1_SM_EXTSYNC_ARRAY_FLEXPWM1_SM_EXTSYNC_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM1_SM_EXTSYNC_ARRAY_FLEXPWM1_SM_EXTSYNC_TRIGIN_MASK) -/*! @} */ - -/* The count of INPUTMUX_FLEXPWM1_SM_EXTSYNC_ARRAY_FLEXPWM1_SM_EXTSYNC */ -#define INPUTMUX_FLEXPWM1_SM_EXTSYNC_ARRAY_FLEXPWM1_SM_EXTSYNC_COUNT (4U) - -/*! @name FLEXPWM_SM1_EXTA_ARRAY_FLEXPWM1_SM_EXTA - PWM1 Input EXTA Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM_SM1_EXTA_ARRAY_FLEXPWM1_SM_EXTA_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM_SM1_EXTA_ARRAY_FLEXPWM1_SM_EXTA_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXTA input connections for PWM1 - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT2 input is selected - * 0b000010..SCT_OUT4 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT3 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER2_MAT1 input is selected - * 0b001001..CTIMER4_MAT1 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..CMP2_OUT input is selected - * 0b011000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM0_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM0_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * 0b110100..SINC Filter CH0 sync Break input is selected - * 0b110101..SINC Filter CH1 sync Break input is selected - * 0b110110..SINC Filter CH2 sync Break input is selected - * 0b110111..SINC Filter CH3 sync Break input is selected - * 0b111000..SINC Filter CH4 sync Break input is selected - * 0b111001..GPIO2 Pin Event Trig 0 input is selected - * 0b111010..GPIO2 Pin Event Trig 1 input is selected - * 0b111011..GPIO3 Pin Event Trig 0 input is selected - * 0b111100..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM_SM1_EXTA_ARRAY_FLEXPWM1_SM_EXTA_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM_SM1_EXTA_ARRAY_FLEXPWM1_SM_EXTA_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM_SM1_EXTA_ARRAY_FLEXPWM1_SM_EXTA_TRIGIN_MASK) -/*! @} */ - -/* The count of INPUTMUX_FLEXPWM_SM1_EXTA_ARRAY_FLEXPWM1_SM_EXTA */ -#define INPUTMUX_FLEXPWM_SM1_EXTA_ARRAY_FLEXPWM1_SM_EXTA_COUNT (4U) - -/*! @name FLEXPWM1_EXTFORCE - PWM1 External Force Trigger Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM1_EXTFORCE_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM1_EXTFORCE_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXTFORCE input connections for PWM1 - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT2 input is selected - * 0b000010..SCT_OUT4 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT3 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER2_MAT1 input is selected - * 0b001001..CTIMER4_MAT1 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..CMP2_OUT input is selected - * 0b011000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM0_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM0_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * 0b110100..SINC Filter CH0 sync Break input is selected - * 0b110101..SINC Filter CH1 sync Break input is selected - * 0b110110..SINC Filter CH2 sync Break input is selected - * 0b110111..SINC Filter CH3 sync Break input is selected - * 0b111000..SINC Filter CH4 sync Break input is selected - * 0b111001..GPIO2 Pin Event Trig 0 input is selected - * 0b111010..GPIO2 Pin Event Trig 1 input is selected - * 0b111011..GPIO3 Pin Event Trig 0 input is selected - * 0b111100..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM1_EXTFORCE_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM1_EXTFORCE_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM1_EXTFORCE_TRIGIN_MASK) -/*! @} */ - -/*! @name FLEXPWM1_FAULT - PWM1 Fault Input Trigger Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXPWM1_FAULT_TRIGIN_MASK (0x3FU) -#define INPUTMUX_FLEXPWM1_FAULT_TRIGIN_SHIFT (0U) -/*! TRIGIN - FAULT input connections for PWM1 - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT2 input is selected - * 0b000010..SCT_OUT4 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT3 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER2_MAT1 input is selected - * 0b001001..CTIMER4_MAT1 input is selected - * 0b001010..Reserved - * 0b001011..ARM_TXEV input is selected - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..CMP2_OUT input is selected - * 0b011000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM0_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM0_SM3_MUX_TRIG1 input is selected - * 0b100000..QDC0_CMP/POS_MATCH input is selected - * 0b100001..QDC1_CMP/POS_MATCH input is selected - * 0b100010..EVTG_OUT0A input is selected - * 0b100011..EVTG_OUT0B input is selected - * 0b100100..EVTG_OUT1A input is selected - * 0b100101..EVTG_OUT1B input is selected - * 0b100110..EVTG_OUT2A input is selected - * 0b100111..EVTG_OUT2B input is selected - * 0b101000..EVTG_OUT3A input is selected - * 0b101001..EVTG_OUT3B input is selected - * 0b101010..TRIG_IN0 input is selected - * 0b101011..TRIG_IN1 input is selected - * 0b101100..TRIG_IN2 input is selected - * 0b101101..TRIG_IN3 input is selected - * 0b101110..TRIG_IN4 input is selected - * 0b101111..TRIG_IN5 input is selected - * 0b110000..TRIG_IN6 input is selected - * 0b110001..TRIG_IN7 input is selected - * 0b110010..TRIG_IN8 input is selected - * 0b110011..TRIG_IN9 input is selected - * 0b110100..SINC Filter CH0 sync Break input is selected - * 0b110101..SINC Filter CH1 sync Break input is selected - * 0b110110..SINC Filter CH2 sync Break input is selected - * 0b110111..SINC Filter CH3 sync Break input is selected - * 0b111000..SINC Filter CH4 sync Break input is selected - * 0b111001..GPIO2 Pin Event Trig 0 input is selected - * 0b111010..GPIO2 Pin Event Trig 1 input is selected - * 0b111011..GPIO3 Pin Event Trig 0 input is selected - * 0b111100..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_FLEXPWM1_FAULT_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXPWM1_FAULT_TRIGIN_SHIFT)) & INPUTMUX_FLEXPWM1_FAULT_TRIGIN_MASK) -/*! @} */ - -/* The count of INPUTMUX_FLEXPWM1_FAULT */ -#define INPUTMUX_FLEXPWM1_FAULT_COUNT (4U) - -/*! @name PWM0_EXT_CLK - PWM0 External Clock Trigger */ -/*! @{ */ - -#define INPUTMUX_PWM0_EXT_CLK_TRIGIN_MASK (0x7U) -#define INPUTMUX_PWM0_EXT_CLK_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXT_CLK input connections for PWM0 - * 0b000..FRO16K input is selected - * 0b001..OSC_32k input is selected - * 0b010..EVTG_OUT0A input is selected - * 0b011..EVTG_OUT1A input is selected - * 0b100..TRIG_IN0 input is selected - * 0b101..TRIG_IN7 input is selected - * *.. - */ -#define INPUTMUX_PWM0_EXT_CLK_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_PWM0_EXT_CLK_TRIGIN_SHIFT)) & INPUTMUX_PWM0_EXT_CLK_TRIGIN_MASK) -/*! @} */ - -/*! @name PWM1_EXT_CLK - PWM1 External Clock Trigger */ -/*! @{ */ - -#define INPUTMUX_PWM1_EXT_CLK_TRIGIN_MASK (0xFU) -#define INPUTMUX_PWM1_EXT_CLK_TRIGIN_SHIFT (0U) -/*! TRIGIN - EXT_CLK input connections for PWM1 - * 0b0000..FRO16K input is selected - * 0b0001..OSC_32k input is selected - * 0b0010..EVTG_OUT0A input is selected - * 0b0011..EVTG_OUT1A input is selected - * 0b0100..TRIG_IN0 input is selected - * 0b0101..TRIG_IN7 input is selected - * *.. - */ -#define INPUTMUX_PWM1_EXT_CLK_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_PWM1_EXT_CLK_TRIGIN_SHIFT)) & INPUTMUX_PWM1_EXT_CLK_TRIGIN_MASK) -/*! @} */ - -/*! @name EVTG_TRIGN_EVTG_TRIG - EVTG Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_EVTG_TRIGN_EVTG_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_EVTG_TRIGN_EVTG_TRIG_INP_SHIFT (0U) -/*! INP - EVTG trigger input connections - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT1 input is selected - * 0b000010..SCT_OUT0 input is selected - * 0b000011..SCT_OUT1 input is selected - * 0b000100..SCT_OUT2 input is selected - * 0b000101..SCT_OUT3 input is selected - * 0b000110..CTIMER0_MAT3 input is selected - * 0b000111..CTIMER1_MAT3 input is selected - * 0b001000..CTIMER2_MAT3 input is selected - * 0b001001..CTIMER2_MAT2 input is selected - * 0b001010..CTIMER3_MAT2 input is selected - * 0b001011..CTIMER4_MAT2 input is selected - * 0b001100..Reserved - * 0b001101..PINT GPIO_INT_BMAT input is selected - * 0b001110..ADC0_IRQ input is selected - * 0b001111..ADC1_IRQ input is selected - * 0b010000..ADC0_tcomp[0] input is selected - * 0b010001..ADC0_tcomp[1] input is selected - * 0b010010..ADC0_tcomp[2] input is selected - * 0b010011..ADC0_tcomp[3] input is selected - * 0b010100..ADC1_tcomp[0] input is selected - * 0b010101..ADC1_tcomp[1] input is selected - * 0b010110..ADC1_tcomp[2] input is selected - * 0b010111..ADC1_tcomp[3] input is selected - * 0b011000..CMP0_OUT input is selected - * 0b011001..CMP1_OUT input is selected - * 0b011010..CMP2_OUT input is selected - * 0b011011..PWM0_SM0_MUX_TRIG0 input is selected - * 0b011100..PWM0_SM0_MUX_TRIG1 input is selected - * 0b011101..PWM0_SM1_MUX_TRIG0 input is selected - * 0b011110..PWM0_SM1_MUX_TRIG1 input is selected - * 0b011111..PWM0_SM2_MUX_TRIG0 input is selected - * 0b100000..PWM0_SM2_MUX_TRIG1 input is selected - * 0b100001..PWM0_SM3_MUX_TRIG0 input is selected - * 0b100010..PWM0_SM3_MUX_TRIG1 input is selected - * 0b100011..PWM1_SM0_MUX_TRIG0 input is selected - * 0b100100..PWM1_SM0_MUX_TRIG1 input is selected - * 0b100101..PWM1_SM1_MUX_TRIG0 input is selected - * 0b100110..PWM1_SM1_MUX_TRIG1 input is selected - * 0b100111..PWM1_SM2_MUX_TRIG0 input is selected - * 0b101000..PWM1_SM2_MUX_TRIG1 input is selected - * 0b101001..PWM1_SM3_MUX_TRIG0 input is selected - * 0b101010..PWM1_SM3_MUX_TRIG1 input is selected - * 0b101011..QDC0_CMP/POS_MATCH input is selected - * 0b101100..QDC1_CMP/POS_MATCH input is selected - * 0b101101..TRIG_IN0 input is selected - * 0b101110..TRIG_IN1 input is selected - * 0b101111..TRIG_IN2 input is selected - * 0b110000..TRIG_IN3 input is selected - * 0b110001..LPTMR0 input is selected - * 0b110010..LPTMR1 input is selected - * 0b110011..SINC Filter CH0 Break input is selected - * 0b110100..SINC Filter CH1 Break input is selected - * 0b110101..SINC Filter CH2 Break input is selected - * 0b110110..SINC Filter CH3 Break input is selected - * 0b110111..SINC Filter CH4 Break input is selected - * 0b111000..Reserved - * 0b111001..Reserved - * *.. - */ -#define INPUTMUX_EVTG_TRIGN_EVTG_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_EVTG_TRIGN_EVTG_TRIG_INP_SHIFT)) & INPUTMUX_EVTG_TRIGN_EVTG_TRIG_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_EVTG_TRIGN_EVTG_TRIG */ -#define INPUTMUX_EVTG_TRIGN_EVTG_TRIG_COUNT (16U) - -/*! @name USBFS_TRIG - USB-FS Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_USBFS_TRIG_INP_MASK (0xFU) -#define INPUTMUX_USBFS_TRIG_INP_SHIFT (0U) -/*! INP - USB-FS trigger input connections. The trigger output of LP_FLEXCOMM is an input of peripheral INPUTMUX. - * 0b0000..LP_FLEXCOMM 0 trigger out [3] input is selected - * 0b0001..LP_FLEXCOMM 1 trigger out [3] input is selected - * 0b0010..LP_FLEXCOMM 2 trigger out [3] input is selected - * 0b0011..LP_FLEXCOMM 3 trigger out [3] input is selected - * 0b0100..LP_FLEXCOMM 4 trigger out [3] input is selected - * 0b0101..LP_FLEXCOMM 5 trigger out [3] input is selected - * 0b0110..LP_FLEXCOMM 6 trigger out [3] input is selected - * 0b0111..LP_FLEXCOMM 7 trigger out [3] input is selected - * 0b1000..LP_FLEXCOMM 8 trigger out [3] input is selected - * 0b1001..LP_FLEXCOMM 9 trigger out [3] input is selected - * *.. - */ -#define INPUTMUX_USBFS_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_USBFS_TRIG_INP_SHIFT)) & INPUTMUX_USBFS_TRIG_INP_MASK) -/*! @} */ - -/*! @name TSI_TRIG - TSI Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_TSI_TRIG_INP_MASK (0x3U) -#define INPUTMUX_TSI_TRIG_INP_SHIFT (0U) -/*! INP - TSI trigger input connections - * 0b00..LPTMR0 input is selected - * 0b01..LPTMR1 input is selected - * *.. - */ -#define INPUTMUX_TSI_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_TSI_TRIG_INP_SHIFT)) & INPUTMUX_TSI_TRIG_INP_MASK) -/*! @} */ - -/*! @name EXT_TRIGN_EXT_TRIG - EXT Trigger Connections */ -/*! @{ */ - -#define INPUTMUX_EXT_TRIGN_EXT_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_EXT_TRIGN_EXT_TRIG_INP_SHIFT (0U) -/*! INP - TRIG_OUTa pin input connections - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT1 input is selected - * 0b000010..ADC0_IRQ input is selected - * 0b000011..ADC1_IRQ input is selected - * 0b000100..ADC0_tcomp[0] input is selected - * 0b000101..ADC1_tcomp[0] input is selected - * 0b000110..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b000111..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b001000..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b001001..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b001010..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b001011..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b001100..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b001101..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b001110..QDC0_CMP/POS_MATCH input is selected - * 0b001111..QDC1_CMP/POS_MATCH input is selected - * 0b010000..EVTG_OUT0A input is selected - * 0b010001..EVTG_OUT0B input is selected - * 0b010010..EVTG_OUT1A input is selected - * 0b010011..EVTG_OUT1B input is selected - * 0b010100..EVTG_OUT2A input is selected - * 0b010101..EVTG_OUT2B input is selected - * 0b010110..EVTG_OUT3A input is selected - * 0b010111..EVTG_OUT3B input is selected - * 0b011000..Reserved - * 0b011001..Reserved - * 0b011010..LPTMR0 input is selected - * 0b011011..LPTMR1 input is selected - * 0b011100..SCT Out0 input is selected - * 0b011101..SCT Out1 input is selected - * 0b011110..SCT Out2 input is selected - * 0b011111..SCT Out3 input is selected - * 0b100000..SCT Out4 input is selected - * 0b100001..SCT Out5 input is selected - * 0b100010..LP_FLEXCOMM0 trigger output 3 input is selected - * 0b100011..LP_FLEXCOMM1 trigger output 3 input is selected - * 0b100100..LP_FLEXCOMM2 trigger output 3 input is selected - * 0b100101..LP_FLEXCOMM3 trigger output 3 input is selected - * 0b100110..LP_FLEXCOMM4 trigger output 3 input is selected - * 0b100111..LP_FLEXCOMM5 trigger output 3 input is selected - * 0b101000..LP_FLEXCOMM6 trigger output 3 input is selected - * 0b101001..LP_FLEXCOMM7 trigger output 3 input is selected - * 0b101010..LP_FLEXCOMM8 trigger output 3 input is selected - * 0b101011..LP_FLEXCOMM9 trigger output 3 input is selected - * 0b101100..CMP0_OUT input is selected - * 0b101101..CMP1_OUT input is selected - * 0b101110..CMP2_OUT input is selected - * 0b101111..ENET_PPS_OUT_0 input is selected - * *.. - */ -#define INPUTMUX_EXT_TRIGN_EXT_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_EXT_TRIGN_EXT_TRIG_INP_SHIFT)) & INPUTMUX_EXT_TRIGN_EXT_TRIG_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_EXT_TRIGN_EXT_TRIG */ -#define INPUTMUX_EXT_TRIGN_EXT_TRIG_COUNT (8U) - -/*! @name CMP1_TRIG - CMP1 Input Connections */ -/*! @{ */ - -#define INPUTMUX_CMP1_TRIG_TRIGIN_MASK (0x3FU) -#define INPUTMUX_CMP1_TRIG_TRIGIN_SHIFT (0U) -/*! TRIGIN - CMP1 input trigger - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT7 input is selected - * 0b000010..SCT0 SCT_OUT4 input is selected - * 0b000011..SCT0 SCT_OUT5 input is selected - * 0b000100..SCT0 SCT_OUT7 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER3_MAT1 input is selected - * 0b001001..CTIMER4_MAT1 input is selected - * 0b001010..Reserved - * 0b001011..Reserved - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[1] input is selected - * 0b001110..ADC1_tcomp[1] input is selected - * 0b001111..Reserved - * 0b010000..Reserved - * 0b010001..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b010010..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b010011..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b010100..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b010101..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b010110..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b010111..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b011000..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b011001..QDC0_CMP/POS_MATCH input is selected - * 0b011010..QDC1_CMP/POS_MATCH input is selected - * 0b011011..EVTG_OUT0A input is selected - * 0b011100..EVTG_OUT0B input is selected - * 0b011101..EVTG_OUT1A input is selected - * 0b011110..EVTG_OUT1B input is selected - * 0b011111..EVTG_OUT2A input is selected - * 0b100000..EVTG_OUT2B input is selected - * 0b100001..EVTG_OUT3A input is selected - * 0b100010..EVTG_OUT3B input is selected - * 0b100011..LPTMR0 input is selected - * 0b100100..LPTMR1 input is selected - * 0b100101..GPIO2 Pin Event Trig 0 input is selected - * 0b100110..GPIO2 Pin Event Trig 1 input is selected - * 0b100111..GPIO3 Pin Event Trig 0 input is selected - * 0b101000..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_CMP1_TRIG_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CMP1_TRIG_TRIGIN_SHIFT)) & INPUTMUX_CMP1_TRIG_TRIGIN_MASK) -/*! @} */ - -/*! @name CMP2_TRIG - CMP2 Input Connections */ -/*! @{ */ - -#define INPUTMUX_CMP2_TRIG_TRIGIN_MASK (0x3FU) -#define INPUTMUX_CMP2_TRIG_TRIGIN_SHIFT (0U) -/*! TRIGIN - CMP2 input trigger - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT4 input is selected - * 0b000010..SCT0 SCT_OUT4 input is selected - * 0b000011..SCT0 SCT_OUT5 input is selected - * 0b000100..SCT0 SCT_OUT8 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER3_MAT2 input is selected - * 0b001001..CTIMER4_MAT2 input is selected - * 0b001010..Reserved - * 0b001011..Reserved - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[2] input is selected - * 0b001110..ADC1_tcomp[2] input is selected - * 0b001111..Reserved - * 0b010000..Reserved - * 0b010001..PWM0_SM0_MUX_TRIG0/PWM0_SM0_MUX_TRIG1 input is selected - * 0b010010..PWM0_SM1_MUX_TRIG0/PWM0_SM1_MUX_TRIG1 input is selected - * 0b010011..PWM0_SM2_MUX_TRIG0/PWM0_SM2_MUX_TRIG1 input is selected - * 0b010100..PWM0_SM3_MUX_TRIG0/PWM0_SM3_MUX_TRIG1 input is selected - * 0b010101..PWM1_SM0_MUX_TRIG0/PWM1_SM0_MUX_TRIG1 input is selected - * 0b010110..PWM1_SM1_MUX_TRIG0/PWM1_SM1_MUX_TRIG1 input is selected - * 0b010111..PWM1_SM2_MUX_TRIG0/PWM1_SM2_MUX_TRIG1 input is selected - * 0b011000..PWM1_SM3_MUX_TRIG0/PWM1_SM3_MUX_TRIG1 input is selected - * 0b011001..QDC0_CMP/POS_MATCH input is selected - * 0b011010..QDC1_CMP/POS_MATCH input is selected - * 0b011011..EVTG_OUT0A input is selected - * 0b011100..EVTG_OUT0B input is selected - * 0b011101..EVTG_OUT1A input is selected - * 0b011110..EVTG_OUT1B input is selected - * 0b011111..EVTG_OUT2A input is selected - * 0b100000..EVTG_OUT2B input is selected - * 0b100001..EVTG_OUT3A input is selected - * 0b100010..EVTG_OUT3B input is selected - * 0b100011..LPTMR0 input is selected - * 0b100100..LPTMR1 input is selected - * 0b100101..GPIO2 Pin Event Trig 0 input is selected - * 0b100110..GPIO2 Pin Event Trig 1 input is selected - * 0b100111..GPIO3 Pin Event Trig 0 input is selected - * 0b101000..GPIO3 Pin Event Trig 1 input is selected - * *.. - */ -#define INPUTMUX_CMP2_TRIG_TRIGIN(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_CMP2_TRIG_TRIGIN_SHIFT)) & INPUTMUX_CMP2_TRIG_TRIGIN_MASK) -/*! @} */ - -/*! @name SINC_FILTER_CHN_SINC_FILTER_CH - SINC Filter Channel Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_SINC_FILTER_CHN_SINC_FILTER_CH_INP_MASK (0x3FU) -#define INPUTMUX_SINC_FILTER_CHN_SINC_FILTER_CH_INP_SHIFT (0U) -/*! INP - SINC FILTER trigger input connections - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT1 input is selected - * 0b000010..SCT_OUT4 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT9 input is selected - * 0b000101..CTIMER0_MAT3 input is selected - * 0b000110..CTIMER1_MAT3 input is selected - * 0b000111..CTIMER2_MAT3 input is selected - * 0b001000..CTIMER3_MAT3 input is selected - * 0b001001..CTIMER4_MAT3 input is selected - * 0b001010..Reserved - * 0b001011..Reserved - * 0b001100..PINT GPIO_INT_BMAT input is selected - * 0b001101..ADC0_tcomp[0] input is selected - * 0b001110..ADC0_tcomp[1] input is selected - * 0b001111..ADC0_tcomp[2] input is selected - * 0b010000..ADC0_tcomp[3] input is selected - * 0b010001..ADC1_tcomp[0] input is selected - * 0b010010..ADC1_tcomp[1] input is selected - * 0b010011..ADC1_tcomp[2] input is selected - * 0b010100..ADC1_tcomp[3] input is selected - * 0b010101..CMP0_OUT input is selected - * 0b010110..CMP1_OUT input is selected - * 0b010111..CMP2_OUT input is selected - * 0b011000..PWM0_SM0_MUX_TRIG0 input is selected - * 0b011001..PWM0_SM0_MUX_TRIG1 input is selected - * 0b011010..PWM0_SM1_MUX_TRIG0 input is selected - * 0b011011..PWM0_SM1_MUX_TRIG1 input is selected - * 0b011100..PWM0_SM2_MUX_TRIG0 input is selected - * 0b011101..PWM0_SM2_MUX_TRIG1 input is selected - * 0b011110..PWM0_SM3_MUX_TRIG0 input is selected - * 0b011111..PWM0_SM3_MUX_TRIG1 input is selected - * 0b100000..PWM1_SM0_MUX_TRIG0 input is selected - * 0b100001..PWM1_SM0_MUX_TRIG1 input is selected - * 0b100010..PWM1_SM1_MUX_TRIG0 input is selected - * 0b100011..PWM1_SM1_MUX_TRIG1 input is selected - * 0b100100..PWM1_SM2_MUX_TRIG0 input is selected - * 0b100101..PWM1_SM2_MUX_TRIG1 input is selected - * 0b100110..PWM1_SM3_MUX_TRIG0 input is selected - * 0b100111..PWM1_SM3_MUX_TRIG1 input is selected - * 0b101000..QDC0_CMP/POS_MATCH input is selected - * 0b101001..QDC1_CMP/POS_MATCH input is selected - * 0b101010..EVTG_OUT0A input is selected - * 0b101011..EVTG_OUT0B input is selected - * 0b101100..EVTG_OUT1A input is selected - * 0b101101..EVTG_OUT1B input is selected - * 0b101110..EVTG_OUT2A input is selected - * 0b101111..EVTG_OUT2B input is selected - * 0b110000..EVTG_OUT3A input is selected - * 0b110001..EVTG_OUT3B input is selected - * 0b110010..LPTMR0 input is selected - * 0b110011..LPTMR1 input is selected - * 0b110100..FlexIO CH0 input is selected - * 0b110101..FlexIO CH1 input is selected - * 0b110110..FlexIO CH2 input is selected - * 0b110111..FlexIO CH3 input is selected - * 0b111000..WUU input is selected - * *.. - */ -#define INPUTMUX_SINC_FILTER_CHN_SINC_FILTER_CH_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_SINC_FILTER_CHN_SINC_FILTER_CH_INP_SHIFT)) & INPUTMUX_SINC_FILTER_CHN_SINC_FILTER_CH_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_SINC_FILTER_CHN_SINC_FILTER_CH */ -#define INPUTMUX_SINC_FILTER_CHN_SINC_FILTER_CH_COUNT (5U) - -/*! @name OPAMPN_TRIG_OPAMP_TRIG - OPAMP Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_OPAMPN_TRIG_OPAMP_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_OPAMPN_TRIG_OPAMP_TRIG_INP_SHIFT (0U) -/*! INP - OPAMP trigger input connections - * 0b000000..PINT PIN_INT0 input is selected - * 0b000001..PINT PIN_INT1 input is selected - * 0b000010..PINT PIN_INT2 input is selected - * 0b000011..PINT PIN_INT3 input is selected - * 0b000100..SCT_OUT4 input is selected - * 0b000101..SCT_OUT5 input is selected - * 0b000110..SCT_OUT6 input is selected - * 0b000111..SCT_OUT7 input is selected - * 0b001000..SCT_OUT8 input is selected - * 0b001001..CTIMER0_MAT3 input is selected - * 0b001010..CTIMER1_MAT3 input is selected - * 0b001011..CTIMER2_MAT3 input is selected - * 0b001100..CTIMER3_MAT3 input is selected - * 0b001101..CTIMER4_MAT3 input is selected - * 0b001110..PINT GPIO_INT_BMAT input is selected - * 0b001111..ADC0_tcomp[0] input is selected - * 0b010000..ADC0_tcomp[1] input is selected - * 0b010001..ADC0_tcomp[2] input is selected - * 0b010010..ADC0_tcomp[3] input is selected - * 0b010011..ADC1_tcomp[0] input is selected - * 0b010100..ADC1_tcomp[1] input is selected - * 0b010101..ADC1_tcomp[2] input is selected - * 0b010110..ADC1_tcomp[3] input is selected - * 0b010111..PWM0_SM0_MUX_TRIG0 input is selected - * 0b011000..PWM0_SM0_MUX_TRIG1 input is selected - * 0b011001..PWM0_SM1_MUX_TRIG0 input is selected - * 0b011010..PWM0_SM1_MUX_TRIG1 input is selected - * 0b011011..PWM0_SM2_MUX_TRIG0 input is selected - * 0b011100..PWM0_SM2_MUX_TRIG1 input is selected - * 0b011101..PWM0_SM3_MUX_TRIG0 input is selected - * 0b011110..PWM0_SM3_MUX_TRIG1 input is selected - * 0b011111..PWM1_SM0_MUX_TRIG0 input is selected - * 0b100000..PWM1_SM0_MUX_TRIG1 input is selected - * 0b100001..PWM1_SM1_MUX_TRIG0 input is selected - * 0b100010..PWM1_SM1_MUX_TRIG1 input is selected - * 0b100011..PWM1_SM2_MUX_TRIG0 input is selected - * 0b100100..PWM1_SM2_MUX_TRIG1 input is selected - * 0b100101..PWM1_SM3_MUX_TRIG0 input is selected - * 0b100110..PWM1_SM3_MUX_TRIG1 input is selected - * 0b100111..EVTG_OUT0A input is selected - * 0b101000..EVTG_OUT0B input is selected - * 0b101001..EVTG_OUT1A input is selected - * 0b101010..EVTG_OUT1B input is selected - * 0b101011..EVTG_OUT2A input is selected - * 0b101100..EVTG_OUT2B input is selected - * 0b101101..EVTG_OUT3A input is selected - * 0b101110..EVTG_OUT3B input is selected - * 0b101111..TRIG_IN0 input is selected - * 0b110000..TRIG_IN1 input is selected - * 0b110001..TRIG_IN2 input is selected - * 0b110010..TRIG_IN3 input is selected - * 0b110011..FlexIO CH4 input is selected - * 0b110100..FlexIO CH5 input is selected - * 0b110101..FlexIO CH6 input is selected - * 0b110110..FlexIO CH7 input is selected - * *.. - */ -#define INPUTMUX_OPAMPN_TRIG_OPAMP_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_OPAMPN_TRIG_OPAMP_TRIG_INP_SHIFT)) & INPUTMUX_OPAMPN_TRIG_OPAMP_TRIG_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_OPAMPN_TRIG_OPAMP_TRIG */ -#define INPUTMUX_OPAMPN_TRIG_OPAMP_TRIG_COUNT (3U) - -/*! @name FLEXCOMM0_TRIG - LP_FLEXCOMM0 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXCOMM0_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_FLEXCOMM0_TRIG_INP_SHIFT (0U) -/*! INP - LP_FLEXCOMM0 trigger input connections - * 0b000000..PINT PIN_INT4 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..PINT PIN_INT6 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT6 input is selected - * 0b000101..SCT_OUT7 input is selected - * 0b000110..CTIMER0_MAT1 input is selected - * 0b000111..CTIMER1_MAT1 input is selected - * 0b001000..CTIMER2_MAT0 input is selected - * 0b001001..CTIMER3_MAT0 input is selected - * 0b001010..CTIMER4_MAT0 input is selected - * 0b001011..LPTMR0 input is selected - * 0b001100..LPTMR1 input is selected - * 0b001101..Reserved - * 0b001110..PINT GPIO_INT_BMAT input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..CMP2_OUT input is selected - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..TRIG_IN0 input is selected - * 0b011011..TRIG_IN1 input is selected - * 0b011100..TRIG_IN2 input is selected - * 0b011101..TRIG_IN3 input is selected - * 0b011110..TRIG_IN4 input is selected - * 0b011111..TRIG_IN10 input is selected - * 0b100000..TRIG_IN11 input is selected - * 0b100001..FlexIO CH4 input is selected - * 0b100010..FlexIO CH5 input is selected - * 0b100011..FlexIO CH6 input is selected - * 0b100100..FlexIO CH7 input is selected - * 0b100101..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO2 Pin Event Trig 1 input is selected - * 0b101000..GPIO3 Pin Event Trig 0 input is selected - * 0b101001..GPIO3 Pin Event Trig 1 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXCOMM0_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXCOMM0_TRIG_INP_SHIFT)) & INPUTMUX_FLEXCOMM0_TRIG_INP_MASK) -/*! @} */ - -/*! @name FLEXCOMM1_TRIG - LP_FLEXCOMM1 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXCOMM1_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_FLEXCOMM1_TRIG_INP_SHIFT (0U) -/*! INP - LP_FLEXCOMM1 trigger input connections - * 0b000000..PINT PIN_INT4 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..PINT PIN_INT6 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT6 input is selected - * 0b000101..SCT_OUT7 input is selected - * 0b000110..CTIMER0_MAT1 input is selected - * 0b000111..CTIMER1_MAT1 input is selected - * 0b001000..CTIMER2_MAT0 input is selected - * 0b001001..CTIMER3_MAT0 input is selected - * 0b001010..CTIMER4_MAT0 input is selected - * 0b001011..LPTMR0 input is selected - * 0b001100..LPTMR1 input is selected - * 0b001101..Reserved - * 0b001110..PINT GPIO_INT_BMAT input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..CMP2_OUT input is selected - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..TRIG_IN0 input is selected - * 0b011011..TRIG_IN1 input is selected - * 0b011100..TRIG_IN2 input is selected - * 0b011101..TRIG_IN3 input is selected - * 0b011110..TRIG_IN4 input is selected - * 0b011111..TRIG_IN10 input is selected - * 0b100000..TRIG_IN11 input is selected - * 0b100001..FlexIO CH4 input is selected - * 0b100010..FlexIO CH5 input is selected - * 0b100011..FlexIO CH6 input is selected - * 0b100100..FlexIO CH7 input is selected - * 0b100101..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO2 Pin Event Trig 1 input is selected - * 0b101000..GPIO3 Pin Event Trig 0 input is selected - * 0b101001..GPIO3 Pin Event Trig 1 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXCOMM1_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXCOMM1_TRIG_INP_SHIFT)) & INPUTMUX_FLEXCOMM1_TRIG_INP_MASK) -/*! @} */ - -/*! @name FLEXCOMM2_TRIG - LP_FLEXCOMM2 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXCOMM2_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_FLEXCOMM2_TRIG_INP_SHIFT (0U) -/*! INP - LP_FLEXCOMM2 trigger input connections - * 0b000000..PINT PIN_INT4 input is selected - * 0b000001..PINT PIN_INT6 input is selected - * 0b000010..PINT PIN_INT7 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT8 input is selected - * 0b000101..SCT_OUT9 input is selected - * 0b000110..CTIMER0_MAT1 input is selected - * 0b000111..CTIMER1_MAT1 input is selected - * 0b001000..CTIMER2_MAT1 input is selected - * 0b001001..CTIMER3_MAT1 input is selected - * 0b001010..CTIMER4_MAT1 input is selected - * 0b001011..LPTMR0 input is selected - * 0b001100..LPTMR1 input is selected - * 0b001101..Reserved - * 0b001110..PINT GPIO_INT_BMAT input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..CMP2_OUT input is selected - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..TRIG_IN0 input is selected - * 0b011011..TRIG_IN1 input is selected - * 0b011100..TRIG_IN2 input is selected - * 0b011101..TRIG_IN3 input is selected - * 0b011110..TRIG_IN4 input is selected - * 0b011111..TRIG_IN10 input is selected - * 0b100000..TRIG_IN11 input is selected - * 0b100001..FlexIO CH4 input is selected - * 0b100010..FlexIO CH5 input is selected - * 0b100011..FlexIO CH6 input is selected - * 0b100100..FlexIO CH7 input is selected - * 0b100101..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO2 Pin Event Trig 1 input is selected - * 0b101000..GPIO3 Pin Event Trig 0 input is selected - * 0b101001..GPIO3 Pin Event Trig 1 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXCOMM2_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXCOMM2_TRIG_INP_SHIFT)) & INPUTMUX_FLEXCOMM2_TRIG_INP_MASK) -/*! @} */ - -/*! @name FLEXCOMM3_TRIG - LP_FLEXCOMM3 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXCOMM3_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_FLEXCOMM3_TRIG_INP_SHIFT (0U) -/*! INP - LP_FLEXCOMM3 trigger input connections - * 0b000000..PINT PIN_INT4 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..PINT PIN_INT7 input is selected - * 0b000011..SCT_OUT5 input is selected - * 0b000100..SCT_OUT8 input is selected - * 0b000101..SCT_OUT9 input is selected - * 0b000110..CTIMER0_MAT1 input is selected - * 0b000111..CTIMER1_MAT1 input is selected - * 0b001000..CTIMER2_MAT1 input is selected - * 0b001001..CTIMER3_MAT1 input is selected - * 0b001010..CTIMER4_MAT1 input is selected - * 0b001011..LPTMR0 input is selected - * 0b001100..LPTMR1 input is selected - * 0b001101..Reserved - * 0b001110..PINT GPIO_INT_BMAT input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..CMP2_OUT input is selected - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..TRIG_IN0 input is selected - * 0b011011..TRIG_IN1 input is selected - * 0b011100..TRIG_IN2 input is selected - * 0b011101..TRIG_IN3 input is selected - * 0b011110..TRIG_IN4 input is selected - * 0b011111..TRIG_IN10 input is selected - * 0b100000..TRIG_IN11 input is selected - * 0b100001..FlexIO CH4 input is selected - * 0b100010..FlexIO CH5 input is selected - * 0b100011..FlexIO CH6 input is selected - * 0b100100..FlexIO CH7 input is selected - * 0b100101..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO2 Pin Event Trig 1 input is selected - * 0b101000..GPIO3 Pin Event Trig 0 input is selected - * 0b101001..GPIO3 Pin Event Trig 1 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXCOMM3_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXCOMM3_TRIG_INP_SHIFT)) & INPUTMUX_FLEXCOMM3_TRIG_INP_MASK) -/*! @} */ - -/*! @name FLEXCOMM4_TRIG - LP_FLEXCOMM4 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXCOMM4_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_FLEXCOMM4_TRIG_INP_SHIFT (0U) -/*! INP - LP_FLEXCOMM4 trigger input connections - * 0b000000..PINT PIN_INT4 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..PINT PIN_INT7 input is selected - * 0b000011..SCT_OUT0 input is selected - * 0b000100..SCT_OUT1 input is selected - * 0b000101..SCT_OUT2 input is selected - * 0b000110..CTIMER0_MAT1 input is selected - * 0b000111..CTIMER1_MAT1 input is selected - * 0b001000..CTIMER2_MAT2 input is selected - * 0b001001..CTIMER3_MAT2 input is selected - * 0b001010..CTIMER4_MAT2 input is selected - * 0b001011..LPTMR0 input is selected - * 0b001100..LPTMR1 input is selected - * 0b001101..Reserved - * 0b001110..PINT GPIO_INT_BMAT input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..CMP2_OUT input is selected - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..TRIG_IN0 input is selected - * 0b011011..TRIG_IN1 input is selected - * 0b011100..TRIG_IN2 input is selected - * 0b011101..TRIG_IN3 input is selected - * 0b011110..TRIG_IN4 input is selected - * 0b011111..TRIG_IN10 input is selected - * 0b100000..TRIG_IN11 input is selected - * 0b100001..FlexIO CH4 input is selected - * 0b100010..FlexIO CH5 input is selected - * 0b100011..FlexIO CH6 input is selected - * 0b100100..FlexIO CH7 input is selected - * 0b100101..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO2 Pin Event Trig 1 input is selected - * 0b101000..GPIO3 Pin Event Trig 0 input is selected - * 0b101001..GPIO3 Pin Event Trig 1 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXCOMM4_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXCOMM4_TRIG_INP_SHIFT)) & INPUTMUX_FLEXCOMM4_TRIG_INP_MASK) -/*! @} */ - -/*! @name FLEXCOMM5_TRIG - LP_FLEXCOMM5 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXCOMM5_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_FLEXCOMM5_TRIG_INP_SHIFT (0U) -/*! INP - LP_FLEXCOMM5 trigger input connections - * 0b000000..PINT PIN_INT4 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..PINT PIN_INT7 input is selected - * 0b000011..SCT_OUT0 input is selected - * 0b000100..SCT_OUT1 input is selected - * 0b000101..SCT_OUT2 input is selected - * 0b000110..CTIMER0_MAT1 input is selected - * 0b000111..CTIMER1_MAT1 input is selected - * 0b001000..CTIMER2_MAT2 input is selected - * 0b001001..CTIMER3_MAT2 input is selected - * 0b001010..CTIMER4_MAT2 input is selected - * 0b001011..LPTMR0 input is selected - * 0b001100..LPTMR1 input is selected - * 0b001101..Reserved - * 0b001110..PINT GPIO_INT_BMAT input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..CMP2_OUT input is selected - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..TRIG_IN0 input is selected - * 0b011011..TRIG_IN1 input is selected - * 0b011100..TRIG_IN2 input is selected - * 0b011101..TRIG_IN3 input is selected - * 0b011110..TRIG_IN4 input is selected - * 0b011111..TRIG_IN10 input is selected - * 0b100000..TRIG_IN11 input is selected - * 0b100001..FlexIO CH4 input is selected - * 0b100010..FlexIO CH5 input is selected - * 0b100011..FlexIO CH6 input is selected - * 0b100100..FlexIO CH7 input is selected - * 0b100101..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO2 Pin Event Trig 1 input is selected - * 0b101000..GPIO3 Pin Event Trig 0 input is selected - * 0b101001..GPIO3 Pin Event Trig 1 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXCOMM5_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXCOMM5_TRIG_INP_SHIFT)) & INPUTMUX_FLEXCOMM5_TRIG_INP_MASK) -/*! @} */ - -/*! @name FLEXCOMM6_TRIG - LP_FLEXCOMM6 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXCOMM6_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_FLEXCOMM6_TRIG_INP_SHIFT (0U) -/*! INP - LP_FLEXCOMM6 trigger input connections - * 0b000000..PINT PIN_INT4 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..PINT PIN_INT7 input is selected - * 0b000011..SCT_OUT0 input is selected - * 0b000100..SCT_OUT3 input is selected - * 0b000101..SCT_OUT4 input is selected - * 0b000110..CTIMER0_MAT1 input is selected - * 0b000111..CTIMER1_MAT1 input is selected - * 0b001000..CTIMER2_MAT3 input is selected - * 0b001001..CTIMER3_MAT3 input is selected - * 0b001010..CTIMER4_MAT3 input is selected - * 0b001011..LPTMR0 input is selected - * 0b001100..LPTMR1 input is selected - * 0b001101..Reserved - * 0b001110..PINT GPIO_INT_BMAT input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..CMP2_OUT input is selected - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..TRIG_IN0 input is selected - * 0b011011..TRIG_IN1 input is selected - * 0b011100..TRIG_IN2 input is selected - * 0b011101..TRIG_IN3 input is selected - * 0b011110..TRIG_IN4 input is selected - * 0b011111..TRIG_IN10 input is selected - * 0b100000..TRIG_IN11 input is selected - * 0b100001..FlexIO CH4 input is selected - * 0b100010..FlexIO CH5 input is selected - * 0b100011..FlexIO CH6 input is selected - * 0b100100..FlexIO CH7 input is selected - * 0b100101..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO2 Pin Event Trig 1 input is selected - * 0b101000..GPIO3 Pin Event Trig 0 input is selected - * 0b101001..GPIO3 Pin Event Trig 1 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXCOMM6_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXCOMM6_TRIG_INP_SHIFT)) & INPUTMUX_FLEXCOMM6_TRIG_INP_MASK) -/*! @} */ - -/*! @name FLEXCOMM7_TRIG - LP_FLEXCOMM7 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXCOMM7_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_FLEXCOMM7_TRIG_INP_SHIFT (0U) -/*! INP - LP_FLEXCOMM7 trigger input connections - * 0b000000..PINT PIN_INT4 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..PINT PIN_INT7 input is selected - * 0b000011..SCT_OUT0 input is selected - * 0b000100..SCT_OUT3 input is selected - * 0b000101..SCT_OUT4 input is selected - * 0b000110..CTIMER0_MAT1 input is selected - * 0b000111..CTIMER1_MAT1 input is selected - * 0b001000..CTIMER2_MAT3 input is selected - * 0b001001..CTIMER3_MAT3 input is selected - * 0b001010..CTIMER4_MAT3 input is selected - * 0b001011..LPTMR0 input is selected - * 0b001100..LPTMR1 input is selected - * 0b001101..Reserved - * 0b001110..PINT GPIO_INT_BMAT input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..CMP2_OUT input is selected - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..TRIG_IN0 input is selected - * 0b011011..TRIG_IN1 input is selected - * 0b011100..TRIG_IN2 input is selected - * 0b011101..TRIG_IN3 input is selected - * 0b011110..TRIG_IN4 input is selected - * 0b011111..TRIG_IN10 input is selected - * 0b100000..TRIG_IN11 input is selected - * 0b100001..FlexIO CH4 input is selected - * 0b100010..FlexIO CH5 input is selected - * 0b100011..FlexIO CH6 input is selected - * 0b100100..FlexIO CH7 input is selected - * 0b100101..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO2 Pin Event Trig 1 input is selected - * 0b101000..GPIO3 Pin Event Trig 0 input is selected - * 0b101001..GPIO3 Pin Event Trig 1 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXCOMM7_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXCOMM7_TRIG_INP_SHIFT)) & INPUTMUX_FLEXCOMM7_TRIG_INP_MASK) -/*! @} */ - -/*! @name FLEXCOMM8_TRIG - LP_FLEXCOMM8 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXCOMM8_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_FLEXCOMM8_TRIG_INP_SHIFT (0U) -/*! INP - LP_FLEXCOMM8 trigger input connections - * 0b000000..PINT PIN_INT4 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..PINT PIN_INT7 input is selected - * 0b000011..SCT_OUT0 input is selected - * 0b000100..SCT_OUT3 input is selected - * 0b000101..SCT_OUT4 input is selected - * 0b000110..CTIMER0_MAT1 input is selected - * 0b000111..CTIMER1_MAT1 input is selected - * 0b001000..CTIMER2_MAT3 input is selected - * 0b001001..CTIMER3_MAT3 input is selected - * 0b001010..CTIMER4_MAT3 input is selected - * 0b001011..LPTMR0 input is selected - * 0b001100..LPTMR1 input is selected - * 0b001101..Reserved - * 0b001110..PINT GPIO_INT_BMAT input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..CMP2_OUT input is selected - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..TRIG_IN0 input is selected - * 0b011011..TRIG_IN1 input is selected - * 0b011100..TRIG_IN2 input is selected - * 0b011101..TRIG_IN3 input is selected - * 0b011110..TRIG_IN4 input is selected - * 0b011111..TRIG_IN10 input is selected - * 0b100000..TRIG_IN11 input is selected - * 0b100001..FlexIO CH4 input is selected - * 0b100010..FlexIO CH5 input is selected - * 0b100011..FlexIO CH6 input is selected - * 0b100100..FlexIO CH7 input is selected - * 0b100101..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO2 Pin Event Trig 1 input is selected - * 0b101000..GPIO3 Pin Event Trig 0 input is selected - * 0b101001..GPIO3 Pin Event Trig 1 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXCOMM8_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXCOMM8_TRIG_INP_SHIFT)) & INPUTMUX_FLEXCOMM8_TRIG_INP_MASK) -/*! @} */ - -/*! @name FLEXCOMM9_TRIG - LP_FLEXCOMM9 Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXCOMM9_TRIG_INP_MASK (0x3FU) -#define INPUTMUX_FLEXCOMM9_TRIG_INP_SHIFT (0U) -/*! INP - LP_FLEXCOMM9 trigger input connections - * 0b000000..PINT PIN_INT4 input is selected - * 0b000001..PINT PIN_INT5 input is selected - * 0b000010..PINT PIN_INT7 input is selected - * 0b000011..SCT_OUT0 input is selected - * 0b000100..SCT_OUT3 input is selected - * 0b000101..SCT_OUT4 input is selected - * 0b000110..CTIMER0_MAT1 input is selected - * 0b000111..CTIMER1_MAT1 input is selected - * 0b001000..CTIMER2_MAT0 input is selected - * 0b001001..CTIMER3_MAT0 input is selected - * 0b001010..CTIMER4_MAT0 input is selected - * 0b001011..LPTMR0 input is selected - * 0b001100..LPTMR1 input is selected - * 0b001101..Reserved - * 0b001110..PINT GPIO_INT_BMAT input is selected - * 0b001111..CMP0_OUT input is selected - * 0b010000..CMP1_OUT input is selected - * 0b010001..CMP2_OUT input is selected - * 0b010010..EVTG_OUT0A input is selected - * 0b010011..EVTG_OUT0B input is selected - * 0b010100..EVTG_OUT1A input is selected - * 0b010101..EVTG_OUT1B input is selected - * 0b010110..EVTG_OUT2A input is selected - * 0b010111..EVTG_OUT2B input is selected - * 0b011000..EVTG_OUT3A input is selected - * 0b011001..EVTG_OUT3B input is selected - * 0b011010..TRIG_IN0 input is selected - * 0b011011..TRIG_IN1 input is selected - * 0b011100..TRIG_IN2 input is selected - * 0b011101..TRIG_IN3 input is selected - * 0b011110..TRIG_IN4 input is selected - * 0b011111..TRIG_IN10 input is selected - * 0b100000..TRIG_IN11 input is selected - * 0b100001..FlexIO CH4 input is selected - * 0b100010..FlexIO CH5 input is selected - * 0b100011..FlexIO CH6 input is selected - * 0b100100..FlexIO CH7 input is selected - * 0b100101..USB0 ipp_ind_uart_rxd_usbmux input is selected - * 0b100110..GPIO2 Pin Event Trig 0 input is selected - * 0b100111..GPIO2 Pin Event Trig 1 input is selected - * 0b101000..GPIO3 Pin Event Trig 0 input is selected - * 0b101001..GPIO3 Pin Event Trig 1 input is selected - * 0b101010..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXCOMM9_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXCOMM9_TRIG_INP_SHIFT)) & INPUTMUX_FLEXCOMM9_TRIG_INP_MASK) -/*! @} */ - -/*! @name FLEXIO_TRIGN_FLEXIO_TRIG - FlexIO Trigger Input Connections */ -/*! @{ */ - -#define INPUTMUX_FLEXIO_TRIGN_FLEXIO_TRIG_INP_MASK (0x7FU) -#define INPUTMUX_FLEXIO_TRIGN_FLEXIO_TRIG_INP_SHIFT (0U) -/*! INP - Input number for FlexIO0. - * 0b0000000..PINT PIN_INT4 input is selected - * 0b0000001..PINT PIN_INT5 input is selected - * 0b0000010..PINT PIN_INT6 input is selected - * 0b0000011..PINT PIN_INT7 input is selected - * 0b0000100..SCT_OUT5 input is selected - * 0b0000101..SCT_OUT6 input is selected - * 0b0000110..SCT_OUT7 input is selected - * 0b0000111..SCT_OUT8 input is selected - * 0b0001000..SCT_OUT9 input is selected - * 0b0001001..T0_MAT1 input is selected - * 0b0001010..T1_MAT1 input is selected - * 0b0001011..T2_MAT1 input is selected - * 0b0001100..T3_MAT1 input is selected - * 0b0001101..T4_MAT1 input is selected - * 0b0001110..LPTMR0 input is selected - * 0b0001111..LPTMR1 input is selected - * 0b0010000..Reserved - * 0b0010001..PINT GPIO_INT_BMAT input is selected - * 0b0010010..ADC0_tcomp[0] input is selected - * 0b0010011..ADC0_tcomp[1] input is selected - * 0b0010100..ADC0_tcomp[2] input is selected - * 0b0010101..ADC0_tcomp[3] input is selected - * 0b0010110..ADC1_tcomp[0] input is selected - * 0b0010111..ADC1_tcomp[1] input is selected - * 0b0011000..ADC1_tcomp[2] input is selected - * 0b0011001..ADC1_tcomp[3] input is selected - * 0b0011010..CMP0_OUT input is selected - * 0b0011011..CMP1_OUT input is selected - * 0b0011100..CMP2_OUT input is selected - * 0b0011101..PWM0_SM0_MUX_TRIG0 input is selected - * 0b0011110..PWM0_SM0_MUX_TRIG1 input is selected - * 0b0011111..PWM0_SM1_MUX_TRIG0 input is selected - * 0b0100000..PWM0_SM1_MUX_TRIG1 input is selected - * 0b0100001..PWM0_SM2_MUX_TRIG0 input is selected - * 0b0100010..PWM0_SM2_MUX_TRIG1 input is selected - * 0b0100011..PWM0_SM3_MUX_TRIG0 input is selected - * 0b0100100..PWM0_SM3_MUX_TRIG1 input is selected - * 0b0100101..PWM1_SM0_MUX_TRIG0 input is selected - * 0b0100110..PWM1_SM0_MUX_TRIG1 input is selected - * 0b0100111..PWM1_SM1_MUX_TRIG0 input is selected - * 0b0101000..PWM1_SM1_MUX_TRIG1 input is selected - * 0b0101001..PWM1_SM2_MUX_TRIG0 input is selected - * 0b0101010..PWM1_SM2_MUX_TRIG1 input is selected - * 0b0101011..PWM1_SM3_MUX_TRIG0 input is selected - * 0b0101100..PWM1_SM3_MUX_TRIG1 input is selected - * 0b0101101..EVTG_OUT0A input is selected - * 0b0101110..EVTG_OUT0B input is selected - * 0b0101111..EVTG_OUT1A input is selected - * 0b0110000..EVTG_OUT1B input is selected - * 0b0110001..EVTG_OUT2A input is selected - * 0b0110010..EVTG_OUT2B input is selected - * 0b0110011..EVTG_OUT3A input is selected - * 0b0110100..EVTG_OUT3B input is selected - * 0b0110101..TRIG_IN0 input is selected - * 0b0110110..TRIG_IN1 input is selected - * 0b0110111..TRIG_IN2 input is selected - * 0b0111000..TRIG_IN3 input is selected - * 0b0111001..TRIG_IN4 input is selected - * 0b0111010..SINC Filter CH0 Conversion Complete input is selected - * 0b0111011..SINC Filter CH1 Conversion Complete input is selected - * 0b0111100..SINC Filter CH2 Conversion Complete input is selected - * 0b0111101..SINC Filter CH3 Conversion Complete input is selected - * 0b0111110..SINC Filter CH4 Conversion Complete input is selected - * 0b0111111..LP_FLEXCOMM0 trig 0 (lpuart_trg_txword) input is selected - * 0b1000000..LP_FLEXCOMM0 trig 1 (lpuart_trg_rxword) input is selected - * 0b1000001..LP_FLEXCOMM0 trig 2 (lpuart_trg_rxidle) input is selected - * 0b1000010..LP_FLEXCOMM1 trig 0 input is selected - * 0b1000011..LP_FLEXCOMM1 trig 1 input is selected - * 0b1000100..LP_FLEXCOMM1 trig 2 input is selected - * 0b1000101..LP_FLEXCOMM2 trig 0 input is selected - * 0b1000110..LP_FLEXCOMM2 trig 1 input is selected - * 0b1000111..LP_FLEXCOMM2 trig 2 input is selected - * 0b1001000..LP_FLEXCOMM3 trig 0 input is selected - * 0b1001001..LP_FLEXCOMM3 trig 1 input is selected - * 0b1001010..LP_FLEXCOMM3 trig 2 input is selected - * 0b1001011..LP_FLEXCOMM3 trig 3 input is selected - * 0b1001100..WUU input is selected - * *.. - */ -#define INPUTMUX_FLEXIO_TRIGN_FLEXIO_TRIG_INP(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_FLEXIO_TRIGN_FLEXIO_TRIG_INP_SHIFT)) & INPUTMUX_FLEXIO_TRIGN_FLEXIO_TRIG_INP_MASK) -/*! @} */ - -/* The count of INPUTMUX_FLEXIO_TRIGN_FLEXIO_TRIG */ -#define INPUTMUX_FLEXIO_TRIGN_FLEXIO_TRIG_COUNT (8U) - -/*! @name DMA0_REQ_ENABLE0 - DMA0 Request Enable0 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ1_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ1_EN0_SHIFT (1U) -/*! REQ1_EN0 - This register is used to enable and disable FLEXSPI0 receive event request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ1_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ1_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ1_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ2_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ2_EN0_SHIFT (2U) -/*! REQ2_EN0 - This register is used to enable and disable FLEXSPI0 transmit event request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ2_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ2_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ2_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ3_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ3_EN0_SHIFT (3U) -/*! REQ3_EN0 - This register is used to enable and disable PINT0 INT0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ3_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ3_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ3_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ4_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ4_EN0_SHIFT (4U) -/*! REQ4_EN0 - This register is used to enable and disable PINT0 INT1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ4_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ4_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ4_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ5_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ5_EN0_SHIFT (5U) -/*! REQ5_EN0 - This register is used to enable and disable PINT0 INT2 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ5_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ5_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ5_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ6_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ6_EN0_SHIFT (6U) -/*! REQ6_EN0 - This register is used to enable and disable PINT0 INT3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ6_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ6_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ6_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ7_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ7_EN0_SHIFT (7U) -/*! REQ7_EN0 - This register is used to enable and disable CTIMER0 DMAREQ_M0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ7_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ7_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ7_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ8_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ8_EN0_SHIFT (8U) -/*! REQ8_EN0 - This register is used to enable and disable CTIMER0 DMAREQ_M1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ8_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ8_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ8_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ9_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ9_EN0_SHIFT (9U) -/*! REQ9_EN0 - This register is used to enable and disable CTIMER1 DMAREQ_M0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ9_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ9_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ9_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ10_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ10_EN0_SHIFT (10U) -/*! REQ10_EN0 - This register is used to enable and disable CTIMER1 DMAREQ_M1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ10_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ10_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ10_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ11_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ11_EN0_SHIFT (11U) -/*! REQ11_EN0 - This register is used to enable and disable CTIMER2 DMAREQ_M0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ11_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ11_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ11_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ12_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ12_EN0_SHIFT (12U) -/*! REQ12_EN0 - This register is used to enable and disable CTIMER2 DMAREQ_M1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ12_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ12_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ12_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ13_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ13_EN0_SHIFT (13U) -/*! REQ13_EN0 - This register is used to enable and disable CTIMER3 DMAREQ_M0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ13_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ13_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ13_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ14_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ14_EN0_SHIFT (14U) -/*! REQ14_EN0 - This register is used to enable and disable CTIMER3 DMAREQ_M1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ14_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ14_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ14_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ15_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ15_EN0_SHIFT (15U) -/*! REQ15_EN0 - This register is used to enable and disable CTIMER4 DMAREQ_M0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ15_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ15_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ15_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ16_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ16_EN0_SHIFT (16U) -/*! REQ16_EN0 - This register is used to enable and disable CTIMER4 DMAREQ_M1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ16_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ16_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ16_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ17_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ17_EN0_SHIFT (17U) -/*! REQ17_EN0 - This register is used to enable and disable WUU0 wake up event request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ17_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ17_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ17_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ18_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ18_EN0_SHIFT (18U) -/*! REQ18_EN0 - This register is used to enable and disable MICFIL0 FIFO_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ18_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ18_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ18_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ19_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ19_EN0_SHIFT (19U) -/*! REQ19_EN0 - This register is used to enable and disable SCT0 DMA0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ19_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ19_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ19_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ20_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ20_EN0_SHIFT (20U) -/*! REQ20_EN0 - This register is used to enable and disable SCT0 DMA1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ20_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ20_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ20_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ21_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ21_EN0_SHIFT (21U) -/*! REQ21_EN0 - This register is used to enable and disable ADC0 FIFO A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ21_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ21_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ21_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ22_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ22_EN0_SHIFT (22U) -/*! REQ22_EN0 - This register is used to enable and disable ADC0 FIFO B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ22_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ22_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ22_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ23_EN0_MASK (0x800000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ23_EN0_SHIFT (23U) -/*! REQ23_EN0 - This register is used to enable and disable ADC1 FIFO A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ23_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ23_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ23_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ24_EN0_MASK (0x1000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ24_EN0_SHIFT (24U) -/*! REQ24_EN0 - This register is used to enable and disable ADC1 FIFO B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ24_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ24_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ24_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ25_EN0_MASK (0x2000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ25_EN0_SHIFT (25U) -/*! REQ25_EN0 - This register is used to enable and disable DAC0 FIFO_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ25_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ25_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ25_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ26_EN0_MASK (0x4000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ26_EN0_SHIFT (26U) -/*! REQ26_EN0 - This register is used to enable and disable DAC1 FIFO_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ26_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ26_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ26_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ27_EN0_MASK (0x8000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ27_EN0_SHIFT (27U) -/*! REQ27_EN0 - This register is used to enable and disable DAC2 FIFO_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ27_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ27_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ27_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ28_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ28_EN0_SHIFT (28U) -/*! REQ28_EN0 - This register is used to enable and disable CMP0 DMA_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ28_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ28_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ28_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ29_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ29_EN0_SHIFT (29U) -/*! REQ29_EN0 - This register is used to enable and disable CMP1 DMA_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ29_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ29_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ29_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ30_EN0_MASK (0x40000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ30_EN0_SHIFT (30U) -/*! REQ30_EN0 - This register is used to enable and disable CMP2 DMA_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ30_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ30_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ30_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ31_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ31_EN0_SHIFT (31U) -/*! REQ31_EN0 - This register is used to enable and disable EVTG0 OUT0A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE0_REQ31_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_REQ31_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_REQ31_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE0_SET - DMA0 Request Enable0 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ1_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ1_EN0_SHIFT (1U) -/*! REQ1_EN0 - Writing a 1 to REQ1_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ1_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ1_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ1_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ2_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ2_EN0_SHIFT (2U) -/*! REQ2_EN0 - Writing a 1 to REQ2_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ2_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ2_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ2_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ3_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ3_EN0_SHIFT (3U) -/*! REQ3_EN0 - Writing a 1 to REQ3_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ3_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ3_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ3_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ4_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ4_EN0_SHIFT (4U) -/*! REQ4_EN0 - Writing a 1 to REQ4_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ4_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ4_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ4_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ5_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ5_EN0_SHIFT (5U) -/*! REQ5_EN0 - Writing a 1 to REQ5_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ5_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ5_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ5_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ6_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ6_EN0_SHIFT (6U) -/*! REQ6_EN0 - Writing a 1 to REQ6_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ6_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ6_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ6_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ7_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ7_EN0_SHIFT (7U) -/*! REQ7_EN0 - Writing a 1 to REQ7_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ7_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ7_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ7_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ8_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ8_EN0_SHIFT (8U) -/*! REQ8_EN0 - Writing a 1 to REQ8_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ8_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ8_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ8_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ9_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ9_EN0_SHIFT (9U) -/*! REQ9_EN0 - Writing a 1 to REQ9_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ9_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ9_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ9_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ10_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ10_EN0_SHIFT (10U) -/*! REQ10_EN0 - Writing a 1 to REQ10_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ10_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ10_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ10_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ11_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ11_EN0_SHIFT (11U) -/*! REQ11_EN0 - Writing a 1 to REQ11_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ11_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ11_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ11_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ12_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ12_EN0_SHIFT (12U) -/*! REQ12_EN0 - Writing a 1 to REQ12_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ12_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ12_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ12_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ13_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ13_EN0_SHIFT (13U) -/*! REQ13_EN0 - Writing a 1 to REQ13_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ13_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ13_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ13_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ14_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ14_EN0_SHIFT (14U) -/*! REQ14_EN0 - Writing a 1 to REQ14_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ14_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ14_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ14_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ15_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ15_EN0_SHIFT (15U) -/*! REQ15_EN0 - Writing a 1 to REQ15_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ15_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ15_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ15_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ16_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ16_EN0_SHIFT (16U) -/*! REQ16_EN0 - Writing a 1 to REQ16_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ16_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ16_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ16_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ17_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ17_EN0_SHIFT (17U) -/*! REQ17_EN0 - Writing a 1 to REQ17_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ17_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ17_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ17_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ18_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ18_EN0_SHIFT (18U) -/*! REQ18_EN0 - Writing a 1 to REQ18_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ18_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ18_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ18_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ19_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ19_EN0_SHIFT (19U) -/*! REQ19_EN0 - Writing a 1 to REQ19_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ19_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ19_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ19_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ20_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ20_EN0_SHIFT (20U) -/*! REQ20_EN0 - Writing a 1 to REQ20_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ20_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ20_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ20_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ21_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ21_EN0_SHIFT (21U) -/*! REQ21_EN0 - Writing a 1 to REQ21_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ21_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ21_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ21_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ22_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ22_EN0_SHIFT (22U) -/*! REQ22_EN0 - Writing a 1 to REQ22_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ22_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ22_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ22_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ23_EN0_MASK (0x800000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ23_EN0_SHIFT (23U) -/*! REQ23_EN0 - Writing a 1 to REQ23_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ23_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ23_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ23_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ24_EN0_MASK (0x1000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ24_EN0_SHIFT (24U) -/*! REQ24_EN0 - Writing a 1 to REQ24_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ24_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ24_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ24_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ25_EN0_MASK (0x2000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ25_EN0_SHIFT (25U) -/*! REQ25_EN0 - Writing a 1 to REQ25_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ25_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ25_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ25_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ26_EN0_MASK (0x4000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ26_EN0_SHIFT (26U) -/*! REQ26_EN0 - Writing a 1 to REQ26_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ26_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ26_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ26_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ27_EN0_MASK (0x8000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ27_EN0_SHIFT (27U) -/*! REQ27_EN0 - Writing a 1 to REQ27_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ27_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ27_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ27_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ28_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ28_EN0_SHIFT (28U) -/*! REQ28_EN0 - Writing a 1 to REQ28_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ28_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ28_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ28_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ29_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ29_EN0_SHIFT (29U) -/*! REQ29_EN0 - Writing a 1 to REQ29_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ29_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ29_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ29_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ30_EN0_MASK (0x40000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ30_EN0_SHIFT (30U) -/*! REQ30_EN0 - Writing a 1 to REQ30_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ30_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ30_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ30_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ31_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ31_EN0_SHIFT (31U) -/*! REQ31_EN0 - Writing a 1 to REQ31_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ31_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ31_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_SET_REQ31_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE0_CLR - DMA0 Request Enable0 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ1_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ1_EN0_SHIFT (1U) -/*! REQ1_EN0 - Writing a 1 to REQ1_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ1_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ1_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ1_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ2_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ2_EN0_SHIFT (2U) -/*! REQ2_EN0 - Writing a 1 to REQ2_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ2_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ2_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ2_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ3_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ3_EN0_SHIFT (3U) -/*! REQ3_EN0 - Writing a 1 to REQ3_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ3_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ3_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ3_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ4_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ4_EN0_SHIFT (4U) -/*! REQ4_EN0 - Writing a 1 to REQ4_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ4_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ4_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ4_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ5_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ5_EN0_SHIFT (5U) -/*! REQ5_EN0 - Writing a 1 to REQ5_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ5_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ5_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ5_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ6_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ6_EN0_SHIFT (6U) -/*! REQ6_EN0 - Writing a 1 to REQ6_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ6_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ6_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ6_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ7_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ7_EN0_SHIFT (7U) -/*! REQ7_EN0 - Writing a 1 to REQ7_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ7_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ7_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ7_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ8_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ8_EN0_SHIFT (8U) -/*! REQ8_EN0 - Writing a 1 to REQ8_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ8_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ8_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ8_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ9_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ9_EN0_SHIFT (9U) -/*! REQ9_EN0 - Writing a 1 to REQ9_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ9_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ9_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ9_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ10_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ10_EN0_SHIFT (10U) -/*! REQ10_EN0 - Writing a 1 to REQ10_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ10_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ10_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ10_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ11_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ11_EN0_SHIFT (11U) -/*! REQ11_EN0 - Writing a 1 to REQ11_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ11_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ11_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ11_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ12_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ12_EN0_SHIFT (12U) -/*! REQ12_EN0 - Writing a 1 to REQ12_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ12_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ12_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ12_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ13_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ13_EN0_SHIFT (13U) -/*! REQ13_EN0 - Writing a 1 to REQ13_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ13_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ13_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ13_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ14_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ14_EN0_SHIFT (14U) -/*! REQ14_EN0 - Writing a 1 to REQ14_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ14_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ14_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ14_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ15_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ15_EN0_SHIFT (15U) -/*! REQ15_EN0 - Writing a 1 to REQ15_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ15_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ15_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ15_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ16_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ16_EN0_SHIFT (16U) -/*! REQ16_EN0 - Writing a 1 to REQ16_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ16_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ16_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ16_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ17_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ17_EN0_SHIFT (17U) -/*! REQ17_EN0 - Writing a 1 to REQ17_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ17_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ17_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ17_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ18_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ18_EN0_SHIFT (18U) -/*! REQ18_EN0 - Writing a 1 to REQ18_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ18_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ18_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ18_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ19_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ19_EN0_SHIFT (19U) -/*! REQ19_EN0 - Writing a 1 to REQ19_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ19_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ19_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ19_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ20_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ20_EN0_SHIFT (20U) -/*! REQ20_EN0 - Writing a 1 to REQ20_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ20_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ20_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ20_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ21_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ21_EN0_SHIFT (21U) -/*! REQ21_EN0 - Writing a 1 to REQ21_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ21_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ21_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ21_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ22_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ22_EN0_SHIFT (22U) -/*! REQ22_EN0 - Writing a 1 to REQ22_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ22_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ22_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ22_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ23_EN0_MASK (0x800000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ23_EN0_SHIFT (23U) -/*! REQ23_EN0 - Writing a 1 to REQ23_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ23_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ23_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ23_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ24_EN0_MASK (0x1000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ24_EN0_SHIFT (24U) -/*! REQ24_EN0 - Writing a 1 to REQ24_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ24_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ24_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ24_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ25_EN0_MASK (0x2000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ25_EN0_SHIFT (25U) -/*! REQ25_EN0 - Writing a 1 to REQ25_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ25_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ25_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ25_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ26_EN0_MASK (0x4000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ26_EN0_SHIFT (26U) -/*! REQ26_EN0 - Writing a 1 to REQ26_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ26_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ26_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ26_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ27_EN0_MASK (0x8000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ27_EN0_SHIFT (27U) -/*! REQ27_EN0 - Writing a 1 to REQ27_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ27_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ27_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ27_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ28_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ28_EN0_SHIFT (28U) -/*! REQ28_EN0 - Writing a 1 to REQ28_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ28_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ28_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ28_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ29_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ29_EN0_SHIFT (29U) -/*! REQ29_EN0 - Writing a 1 to REQ29_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ29_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ29_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ29_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ30_EN0_MASK (0x40000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ30_EN0_SHIFT (30U) -/*! REQ30_EN0 - Writing a 1 to REQ30_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ30_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ30_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ30_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ31_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ31_EN0_SHIFT (31U) -/*! REQ31_EN0 - Writing a 1 to REQ31_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ31_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ31_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_CLR_REQ31_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE0_TOG - DMA0 Request Enable0 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ1_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ1_EN0_SHIFT (1U) -/*! REQ1_EN0 - Writing a 1 to REQ1_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ1_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ1_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ1_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ2_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ2_EN0_SHIFT (2U) -/*! REQ2_EN0 - Writing a 1 to REQ2_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ2_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ2_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ2_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ3_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ3_EN0_SHIFT (3U) -/*! REQ3_EN0 - Writing a 1 to REQ3_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ3_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ3_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ3_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ4_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ4_EN0_SHIFT (4U) -/*! REQ4_EN0 - Writing a 1 to REQ4_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ4_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ4_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ4_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ5_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ5_EN0_SHIFT (5U) -/*! REQ5_EN0 - Writing a 1 to REQ5_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ5_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ5_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ5_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ6_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ6_EN0_SHIFT (6U) -/*! REQ6_EN0 - Writing a 1 to REQ6_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ6_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ6_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ6_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ7_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ7_EN0_SHIFT (7U) -/*! REQ7_EN0 - Writing a 1 to REQ7_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ7_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ7_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ7_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ8_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ8_EN0_SHIFT (8U) -/*! REQ8_EN0 - Writing a 1 to REQ8_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ8_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ8_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ8_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ9_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ9_EN0_SHIFT (9U) -/*! REQ9_EN0 - Writing a 1 to RE9_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ9_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ9_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ9_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ10_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ10_EN0_SHIFT (10U) -/*! REQ10_EN0 - Writing a 1 to REQ10_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ10_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ10_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ10_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ11_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ11_EN0_SHIFT (11U) -/*! REQ11_EN0 - Writing a 1 to REQ11_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ11_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ11_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ11_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ12_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ12_EN0_SHIFT (12U) -/*! REQ12_EN0 - Writing a 1 to REQ12_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ12_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ12_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ12_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ13_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ13_EN0_SHIFT (13U) -/*! REQ13_EN0 - Writing a 1 to REQ13_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ13_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ13_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ13_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ14_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ14_EN0_SHIFT (14U) -/*! REQ14_EN0 - Writing a 1 to REQ14_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ14_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ14_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ14_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ15_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ15_EN0_SHIFT (15U) -/*! REQ15_EN0 - Writing a 1 to REQ15_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ15_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ15_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ15_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ16_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ16_EN0_SHIFT (16U) -/*! REQ16_EN0 - Writing a 1 to REQ16_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ16_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ16_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ16_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ17_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ17_EN0_SHIFT (17U) -/*! REQ17_EN0 - Writing a 1 to REQ17_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ17_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ17_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ17_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ18_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ18_EN0_SHIFT (18U) -/*! REQ18_EN0 - Writing a 1 to REQ18_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ18_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ18_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ18_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ19_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ19_EN0_SHIFT (19U) -/*! REQ19_EN0 - Writing a 1 to REQ19_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ19_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ19_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ19_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ20_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ20_EN0_SHIFT (20U) -/*! REQ20_EN0 - Writing a 1 to REQ20_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ20_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ20_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ20_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ21_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ21_EN0_SHIFT (21U) -/*! REQ21_EN0 - Writing a 1 to REQ21_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ21_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ21_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ21_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ22_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ22_EN0_SHIFT (22U) -/*! REQ22_EN0 - Writing a 1 to REQ22_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ22_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ22_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ22_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ23_EN0_MASK (0x800000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ23_EN0_SHIFT (23U) -/*! REQ23_EN0 - Writing a 1 to REQ23_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ23_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ23_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ23_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ24_EN0_MASK (0x1000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ24_EN0_SHIFT (24U) -/*! REQ24_EN0 - Writing a 1 to REQ24_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ24_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ24_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ24_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ25_EN0_MASK (0x2000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ25_EN0_SHIFT (25U) -/*! REQ25_EN0 - Writing a 1 to REQ25_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ25_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ25_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ25_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ26_EN0_MASK (0x4000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ26_EN0_SHIFT (26U) -/*! REQ26_EN0 - Writing a 1 to REQ26_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ26_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ26_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ26_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ27_EN0_MASK (0x8000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ27_EN0_SHIFT (27U) -/*! REQ27_EN0 - Writing a 1 to REQ27_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ27_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ27_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ27_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ28_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ28_EN0_SHIFT (28U) -/*! REQ28_EN0 - Writing a 1 to REQ28_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ28_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ28_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ28_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ29_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ29_EN0_SHIFT (29U) -/*! REQ29_EN0 - Writing a 1 to REQ29_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ29_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ29_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ29_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ30_EN0_MASK (0x40000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ30_EN0_SHIFT (30U) -/*! REQ30_EN0 - Writing a 1 to REQ30_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ30_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ30_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ30_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ31_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ31_EN0_SHIFT (31U) -/*! REQ31_EN0 - Writing a 1 to REQ31_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE0. */ -#define INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ31_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ31_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE0_TOG_REQ31_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE1 - DMA0 Request Enable1 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ32_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ32_EN0_SHIFT (0U) -/*! REQ32_EN0 - This register is used to enable and disable EVTG0 OUT0B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ32_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ32_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ32_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ33_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ33_EN0_SHIFT (1U) -/*! REQ33_EN0 - This register is used to enable and disable EVTG0 OUT1A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ33_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ33_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ33_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ34_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ34_EN0_SHIFT (2U) -/*! REQ34_EN0 - This register is used to enable and disable EVTG0 OUT1B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ34_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ34_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ34_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ35_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ35_EN0_SHIFT (3U) -/*! REQ35_EN0 - This register is used to enable and disable EVTG0 OUT2A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ35_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ35_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ35_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ36_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ36_EN0_SHIFT (4U) -/*! REQ36_EN0 - This register is used to enable and disable EVTG0 OUT2B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ36_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ36_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ36_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ37_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ37_EN0_SHIFT (5U) -/*! REQ37_EN0 - This register is used to enable and disable EVTG0 OUT3A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ37_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ37_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ37_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ38_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ38_EN0_SHIFT (6U) -/*! REQ38_EN0 - This register is used to enable and disable EVTG0 OUT3B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ38_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ38_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ38_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ39_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ39_EN0_SHIFT (7U) -/*! REQ39_EN0 - This register is used to enable and disable PWM0 Req_capt0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ39_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ39_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ39_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ40_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ40_EN0_SHIFT (8U) -/*! REQ40_EN0 - This register is used to enable and disable PWM0 Req_capt1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ40_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ40_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ40_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ41_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ41_EN0_SHIFT (9U) -/*! REQ41_EN0 - This register is used to enable and disable PWM0 Req_capt2 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ41_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ41_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ41_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ42_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ42_EN0_SHIFT (10U) -/*! REQ42_EN0 - This register is used to enable and disable PWM0 Req_capt3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ42_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ42_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ42_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ43_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ43_EN0_SHIFT (11U) -/*! REQ43_EN0 - This register is used to enable and disable PWM0 Req_val0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ43_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ43_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ43_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ44_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ44_EN0_SHIFT (12U) -/*! REQ44_EN0 - This register is used to enable and disable PWM0 Req_val1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ44_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ44_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ44_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ45_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ45_EN0_SHIFT (13U) -/*! REQ45_EN0 - This register is used to enable and disable PWM0 Req_val2 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ45_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ45_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ45_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ46_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ46_EN0_SHIFT (14U) -/*! REQ46_EN0 - This register is used to enable and disable PWM0 Req_val3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ46_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ46_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ46_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ47_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ47_EN0_SHIFT (15U) -/*! REQ47_EN0 - This register is used to enable and disable PWM1 Req_capt0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ47_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ47_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ47_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ48_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ48_EN0_SHIFT (16U) -/*! REQ48_EN0 - This register is used to enable and disable PWM1 Req_capt1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ48_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ48_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ48_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ49_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ49_EN0_SHIFT (17U) -/*! REQ49_EN0 - This register is used to enable and disable PWM1 Req_capt2 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ49_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ49_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ49_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ50_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ50_EN0_SHIFT (18U) -/*! REQ50_EN0 - This register is used to enable and disable PWM1 Req_capt3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ50_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ50_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ50_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ51_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ51_EN0_SHIFT (19U) -/*! REQ51_EN0 - This register is used to enable and disable PWM1 Req_val0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ51_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ51_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ51_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ52_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ52_EN0_SHIFT (20U) -/*! REQ52_EN0 - This register is used to enable and disable PWM1 Req_val1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ52_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ52_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ52_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ53_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ53_EN0_SHIFT (21U) -/*! REQ53_EN0 - This register is used to enable and disable PWM1 Req_val2 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ53_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ53_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ53_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ54_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ54_EN0_SHIFT (22U) -/*! REQ54_EN0 - This register is used to enable and disable PWM1 Req_val3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ54_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ54_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ54_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ57_EN0_MASK (0x2000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ57_EN0_SHIFT (25U) -/*! REQ57_EN0 - This register is used to enable and disable LPTMR0 counter match event request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ57_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ57_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ57_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ58_EN0_MASK (0x4000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ58_EN0_SHIFT (26U) -/*! REQ58_EN0 - This register is used to enable and disable LPTMR1 counter match event request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ58_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ58_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ58_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ59_EN0_MASK (0x8000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ59_EN0_SHIFT (27U) -/*! REQ59_EN0 - This register is used to enable and disable CAN0 DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ59_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ59_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ59_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ60_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ60_EN0_SHIFT (28U) -/*! REQ60_EN0 - This register is used to enable and disable CAN1 DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ60_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ60_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ60_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ61_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ61_EN0_SHIFT (29U) -/*! REQ61_EN0 - This register is used to enable and disable FlexIO0 Shifter0 Status DMA request OR Timer0 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ61_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ61_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ61_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ62_EN0_MASK (0x40000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ62_EN0_SHIFT (30U) -/*! REQ62_EN0 - This register is used to enable and disable FlexIO0 Shifter1 Status DMA request OR Timer1 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ62_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ62_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ62_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ63_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ63_EN0_SHIFT (31U) -/*! REQ63_EN0 - This register is used to enable and disable FlexIO0 Shifter2 Status DMA request OR Timer2 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE1_REQ63_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_REQ63_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_REQ63_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE1_SET - DMA0 Request Enable1 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ32_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ32_EN0_SHIFT (0U) -/*! REQ32_EN0 - Writing a 1 to REQ32_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ32_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ32_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ32_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ33_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ33_EN0_SHIFT (1U) -/*! REQ33_EN0 - Writing a 1 to REQ33_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ33_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ33_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ33_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ34_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ34_EN0_SHIFT (2U) -/*! REQ34_EN0 - Writing a 1 to REQ34_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ34_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ34_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ34_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ35_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ35_EN0_SHIFT (3U) -/*! REQ35_EN0 - Writing a 1 to REQ35_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ35_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ35_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ35_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ36_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ36_EN0_SHIFT (4U) -/*! REQ36_EN0 - Writing a 1 to REQ36_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ36_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ36_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ36_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ37_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ37_EN0_SHIFT (5U) -/*! REQ37_EN0 - Writing a 1 to REQ37_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ37_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ37_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ37_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ38_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ38_EN0_SHIFT (6U) -/*! REQ38_EN0 - Writing a 1 to REQ38_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ38_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ38_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ38_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ39_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ39_EN0_SHIFT (7U) -/*! REQ39_EN0 - Writing a 1 to REQ39_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ39_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ39_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ39_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ40_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ40_EN0_SHIFT (8U) -/*! REQ40_EN0 - Writing a 1 to REQ40_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ40_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ40_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ40_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ41_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ41_EN0_SHIFT (9U) -/*! REQ41_EN0 - Writing a 1 to REQ41_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ41_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ41_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ41_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ42_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ42_EN0_SHIFT (10U) -/*! REQ42_EN0 - Writing a 1 to REQ42_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ42_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ42_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ42_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ43_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ43_EN0_SHIFT (11U) -/*! REQ43_EN0 - Writing a 1 to REQ43_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ43_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ43_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ43_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ44_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ44_EN0_SHIFT (12U) -/*! REQ44_EN0 - Writing a 1 to REQ44_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ44_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ44_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ44_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ45_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ45_EN0_SHIFT (13U) -/*! REQ45_EN0 - Writing a 1 to REQ45_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ45_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ45_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ45_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ46_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ46_EN0_SHIFT (14U) -/*! REQ46_EN0 - Writing a 1 to REQ46_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ46_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ46_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ46_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ47_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ47_EN0_SHIFT (15U) -/*! REQ47_EN0 - Writing a 1 to REQ47_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ47_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ47_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ47_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ48_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ48_EN0_SHIFT (16U) -/*! REQ48_EN0 - Writing a 1 to REQ48_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ48_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ48_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ48_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ49_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ49_EN0_SHIFT (17U) -/*! REQ49_EN0 - Writing a 1 to REQ49_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ49_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ49_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ49_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ50_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ50_EN0_SHIFT (18U) -/*! REQ50_EN0 - Writing a 1 to REQ50_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ50_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ50_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ50_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ51_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ51_EN0_SHIFT (19U) -/*! REQ51_EN0 - Writing a 1 to REQ51_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ51_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ51_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ51_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ52_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ52_EN0_SHIFT (20U) -/*! REQ52_EN0 - Writing a 1 to REQ52_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ52_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ52_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ52_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ53_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ53_EN0_SHIFT (21U) -/*! REQ53_EN0 - Writing a 1 to REQ53_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ53_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ53_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ53_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ54_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ54_EN0_SHIFT (22U) -/*! REQ54_EN0 - Writing a 1 to REQ54_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ54_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ54_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ54_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ57_EN0_MASK (0x2000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ57_EN0_SHIFT (25U) -/*! REQ57_EN0 - Writing a 1 to REQ57_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ57_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ57_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ57_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ58_EN0_MASK (0x4000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ58_EN0_SHIFT (26U) -/*! REQ58_EN0 - Writing a 1 to REQ58_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ58_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ58_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ58_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ59_EN0_MASK (0x8000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ59_EN0_SHIFT (27U) -/*! REQ59_EN0 - Writing a 1 to REQ59_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ59_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ59_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ59_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ60_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ60_EN0_SHIFT (28U) -/*! REQ60_EN0 - Writing a 1 to REQ60_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ60_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ60_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ60_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ61_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ61_EN0_SHIFT (29U) -/*! REQ61_EN0 - Writing a 1 to REQ61_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ61_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ61_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ61_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ62_EN0_MASK (0x40000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ62_EN0_SHIFT (30U) -/*! REQ62_EN0 - Writing a 1 to REQ62_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ62_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ62_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ62_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ63_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ63_EN0_SHIFT (31U) -/*! REQ63_EN0 - Writing a 1 to REQ63_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ63_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ63_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_SET_REQ63_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE1_CLR - DMA0 Request Enable1 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ32_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ32_EN0_SHIFT (0U) -/*! REQ32_EN0 - Writing a 1 to REQ32_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ32_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ32_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ32_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ33_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ33_EN0_SHIFT (1U) -/*! REQ33_EN0 - Writing a 1 to REQ33_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ33_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ33_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ33_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ34_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ34_EN0_SHIFT (2U) -/*! REQ34_EN0 - Writing a 1 to REQ34_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ34_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ34_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ34_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ35_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ35_EN0_SHIFT (3U) -/*! REQ35_EN0 - Writing a 1 to REQ35_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ35_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ35_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ35_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ36_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ36_EN0_SHIFT (4U) -/*! REQ36_EN0 - Writing a 1 to REQ36_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ36_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ36_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ36_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ37_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ37_EN0_SHIFT (5U) -/*! REQ37_EN0 - Writing a 1 to REQ37_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ37_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ37_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ37_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ38_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ38_EN0_SHIFT (6U) -/*! REQ38_EN0 - Writing a 1 to REQ38_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ38_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ38_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ38_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ39_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ39_EN0_SHIFT (7U) -/*! REQ39_EN0 - Writing a 1 to REQ39_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ39_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ39_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ39_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ40_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ40_EN0_SHIFT (8U) -/*! REQ40_EN0 - Writing a 1 to REQ40_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ40_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ40_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ40_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ41_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ41_EN0_SHIFT (9U) -/*! REQ41_EN0 - Writing a 1 to REQ41_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ41_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ41_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ41_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ42_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ42_EN0_SHIFT (10U) -/*! REQ42_EN0 - Writing a 1 to REQ42_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ42_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ42_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ42_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ43_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ43_EN0_SHIFT (11U) -/*! REQ43_EN0 - Writing a 1 to REQ43_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ43_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ43_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ43_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ44_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ44_EN0_SHIFT (12U) -/*! REQ44_EN0 - Writing a 1 to REQ44_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ44_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ44_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ44_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ45_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ45_EN0_SHIFT (13U) -/*! REQ45_EN0 - Writing a 1 to REQ45_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ45_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ45_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ45_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ46_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ46_EN0_SHIFT (14U) -/*! REQ46_EN0 - Writing a 1 to REQ46_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ46_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ46_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ46_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ47_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ47_EN0_SHIFT (15U) -/*! REQ47_EN0 - Writing a 1 to REQ47_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ47_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ47_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ47_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ48_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ48_EN0_SHIFT (16U) -/*! REQ48_EN0 - Writing a 1 to REQ48_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ48_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ48_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ48_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ49_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ49_EN0_SHIFT (17U) -/*! REQ49_EN0 - Writing a 1 to REQ49_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ49_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ49_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ49_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ50_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ50_EN0_SHIFT (18U) -/*! REQ50_EN0 - Writing a 1 to REQ50_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ50_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ50_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ50_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ51_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ51_EN0_SHIFT (19U) -/*! REQ51_EN0 - Writing a 1 to REQ51_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ51_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ51_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ51_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ52_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ52_EN0_SHIFT (20U) -/*! REQ52_EN0 - Writing a 1 to REQ52_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ52_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ52_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ52_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ53_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ53_EN0_SHIFT (21U) -/*! REQ53_EN0 - Writing a 1 to REQ53_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ53_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ53_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ53_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ54_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ54_EN0_SHIFT (22U) -/*! REQ54_EN0 - Writing a 1 to REQ54_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ54_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ54_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ54_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ57_EN0_MASK (0x2000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ57_EN0_SHIFT (25U) -/*! REQ57_EN0 - Writing a 1 to REQ57_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ57_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ57_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ57_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ58_EN0_MASK (0x4000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ58_EN0_SHIFT (26U) -/*! REQ58_EN0 - Writing a 1 to REQ58_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ58_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ58_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ58_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ59_EN0_MASK (0x8000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ59_EN0_SHIFT (27U) -/*! REQ59_EN0 - Writing a 1 to REQ59_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ59_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ59_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ59_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ60_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ60_EN0_SHIFT (28U) -/*! REQ60_EN0 - Writing a 1 to REQ60_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ60_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ60_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ60_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ61_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ61_EN0_SHIFT (29U) -/*! REQ61_EN0 - Writing a 1 to REQ61_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ61_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ61_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ61_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ62_EN0_MASK (0x40000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ62_EN0_SHIFT (30U) -/*! REQ62_EN0 - Writing a 1 to REQ62_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ62_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ62_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ62_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ63_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ63_EN0_SHIFT (31U) -/*! REQ63_EN0 - Writing a 1 to REQ63_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ63_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ63_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_CLR_REQ63_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE1_TOG - DMA0 Request Enable1 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ32_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ32_EN0_SHIFT (0U) -/*! REQ32_EN0 - Writing a 1 to REQ32_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ32_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ32_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ32_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ33_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ33_EN0_SHIFT (1U) -/*! REQ33_EN0 - Writing a 1 to REQ33_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ33_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ33_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ33_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ34_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ34_EN0_SHIFT (2U) -/*! REQ34_EN0 - Writing a 1 to REQ34_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ34_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ34_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ34_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ35_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ35_EN0_SHIFT (3U) -/*! REQ35_EN0 - Writing a 1 to REQ35_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ35_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ35_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ35_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ36_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ36_EN0_SHIFT (4U) -/*! REQ36_EN0 - Writing a 1 to REQ36_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ36_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ36_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ36_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ37_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ37_EN0_SHIFT (5U) -/*! REQ37_EN0 - Writing a 1 to REQ37_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ37_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ37_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ37_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ38_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ38_EN0_SHIFT (6U) -/*! REQ38_EN0 - Writing a 1 to REQ38_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ38_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ38_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ38_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ39_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ39_EN0_SHIFT (7U) -/*! REQ39_EN0 - Writing a 1 to REQ39_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ39_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ39_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ39_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ40_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ40_EN0_SHIFT (8U) -/*! REQ40_EN0 - Writing a 1 to REQ40_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ40_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ40_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ40_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ41_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ41_EN0_SHIFT (9U) -/*! REQ41_EN0 - Writing a 1 to REQ41_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ41_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ41_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ41_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ42_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ42_EN0_SHIFT (10U) -/*! REQ42_EN0 - Writing a 1 to REQ42_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ42_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ42_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ42_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ43_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ43_EN0_SHIFT (11U) -/*! REQ43_EN0 - Writing a 1 to REQ43_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ43_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ43_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ43_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ44_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ44_EN0_SHIFT (12U) -/*! REQ44_EN0 - Writing a 1 to REQ44_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ44_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ44_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ44_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ45_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ45_EN0_SHIFT (13U) -/*! REQ45_EN0 - Writing a 1 to REQ55_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ45_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ45_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ45_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ46_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ46_EN0_SHIFT (14U) -/*! REQ46_EN0 - Writing a 1 to REQ46_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ46_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ46_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ46_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ47_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ47_EN0_SHIFT (15U) -/*! REQ47_EN0 - Writing a 1 to REQ47_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ47_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ47_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ47_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ48_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ48_EN0_SHIFT (16U) -/*! REQ48_EN0 - Writing a 1 to REQ48_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ48_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ48_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ48_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ49_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ49_EN0_SHIFT (17U) -/*! REQ49_EN0 - Writing a 1 to REQ49_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ49_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ49_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ49_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ50_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ50_EN0_SHIFT (18U) -/*! REQ50_EN0 - Writing a 1 to REQ50_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ50_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ50_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ50_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ51_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ51_EN0_SHIFT (19U) -/*! REQ51_EN0 - Writing a 1 to REQ51_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ51_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ51_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ51_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ52_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ52_EN0_SHIFT (20U) -/*! REQ52_EN0 - Writing a 1 to REQ52_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ52_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ52_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ52_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ53_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ53_EN0_SHIFT (21U) -/*! REQ53_EN0 - Writing a 1 to REQ53_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ53_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ53_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ53_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ54_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ54_EN0_SHIFT (22U) -/*! REQ54_EN0 - Writing a 1 to REQ54_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ54_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ54_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ54_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ57_EN0_MASK (0x2000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ57_EN0_SHIFT (25U) -/*! REQ57_EN0 - Writing a 1 to REQ57_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ57_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ57_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ57_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ58_EN0_MASK (0x4000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ58_EN0_SHIFT (26U) -/*! REQ58_EN0 - Writing a 1 to REQ58_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ58_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ58_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ58_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ59_EN0_MASK (0x8000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ59_EN0_SHIFT (27U) -/*! REQ59_EN0 - Writing a 1 to REQ59_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ59_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ59_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ59_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ60_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ60_EN0_SHIFT (28U) -/*! REQ60_EN0 - Writing a 1 to REQ60_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ60_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ60_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ60_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ61_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ61_EN0_SHIFT (29U) -/*! REQ61_EN0 - Writing a 1 to REQ61_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ61_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ61_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ61_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ62_EN0_MASK (0x40000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ62_EN0_SHIFT (30U) -/*! REQ62_EN0 - Writing a 1 to REQ62_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ62_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ62_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ62_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ63_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ63_EN0_SHIFT (31U) -/*! REQ63_EN0 - Writing a 1 to REQ63_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE1. */ -#define INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ63_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ63_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE1_TOG_REQ63_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE2 - DMA0 Request Enable2 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ64_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ64_EN0_SHIFT (0U) -/*! REQ64_EN0 - This register is used to enable and disable FlexIO0 shift register 3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ64_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ64_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ64_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ65_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ65_EN0_SHIFT (1U) -/*! REQ65_EN0 - This register is used to enable and disable FlexIO0 shift register 4 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ65_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ65_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ65_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ66_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ66_EN0_SHIFT (2U) -/*! REQ66_EN0 - This register is used to enable and disable FlexIO0 shift register 5 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ66_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ66_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ66_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ67_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ67_EN0_SHIFT (3U) -/*! REQ67_EN0 - This register is used to enable and disable FlexIO0 shift register 6 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ67_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ67_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ67_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ68_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ68_EN0_SHIFT (4U) -/*! REQ68_EN0 - This register is used to enable and disable FlexIO0 shift register 7 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ68_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ68_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ68_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ69_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ69_EN0_SHIFT (5U) -/*! REQ69_EN0 - This register is used to enable and disable LP_FLEXCOMM0 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ69_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ69_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ69_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ70_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ70_EN0_SHIFT (6U) -/*! REQ70_EN0 - This register is used to enable and disable LP_FLEXCOMM0 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ70_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ70_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ70_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ71_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ71_EN0_SHIFT (7U) -/*! REQ71_EN0 - This register is used to enable and disable LP_FLEXCOMM1 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ71_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ71_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ71_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ72_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ72_EN0_SHIFT (8U) -/*! REQ72_EN0 - This register is used to enable and disable LP_FLEXCOMM1 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ72_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ72_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ72_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ73_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ73_EN0_SHIFT (9U) -/*! REQ73_EN0 - This register is used to enable and disable LP_FLEXCOMM2 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ73_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ73_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ73_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ74_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ74_EN0_SHIFT (10U) -/*! REQ74_EN0 - This register is used to enable and disable LP_FLEXCOMM2 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ74_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ74_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ74_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ75_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ75_EN0_SHIFT (11U) -/*! REQ75_EN0 - This register is used to enable and disable LP_FLEXCOMM3 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ75_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ75_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ75_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ76_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ76_EN0_SHIFT (12U) -/*! REQ76_EN0 - This register is used to enable and disable LP_FLEXCOMM3 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ76_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ76_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ76_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ77_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ77_EN0_SHIFT (13U) -/*! REQ77_EN0 - This register is used to enable and disable LP_FLEXCOMM4 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ77_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ77_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ77_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ78_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ78_EN0_SHIFT (14U) -/*! REQ78_EN0 - This register is used to enable and disable LP_FLEXCOMM4 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ78_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ78_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ78_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ79_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ79_EN0_SHIFT (15U) -/*! REQ79_EN0 - This register is used to enable and disable LP_FLEXCOMM5 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ79_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ79_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ79_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ80_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ80_EN0_SHIFT (16U) -/*! REQ80_EN0 - This register is used to enable and disable LP_FLEXCOMM5 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ80_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ80_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ80_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ81_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ81_EN0_SHIFT (17U) -/*! REQ81_EN0 - This register is used to enable and disable LP_FLEXCOMM6 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ81_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ81_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ81_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ82_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ82_EN0_SHIFT (18U) -/*! REQ82_EN0 - This register is used to enable and disable LP_FLEXCOMM6 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ82_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ82_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ82_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ83_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ83_EN0_SHIFT (19U) -/*! REQ83_EN0 - This register is used to enable and disable LP_FLEXCOMM7 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ83_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ83_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ83_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ84_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ84_EN0_SHIFT (20U) -/*! REQ84_EN0 - This register is used to enable and disable LP_FLEXCOMM7 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ84_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ84_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ84_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ85_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ85_EN0_SHIFT (21U) -/*! REQ85_EN0 - This register is used to enable and disable LP_FLEXCOMM8 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ85_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ85_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ85_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ86_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ86_EN0_SHIFT (22U) -/*! REQ86_EN0 - This register is used to enable and disable LP_FLEXCOMM8 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ86_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ86_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ86_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ87_EN0_MASK (0x800000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ87_EN0_SHIFT (23U) -/*! REQ87_EN0 - This register is used to enable and disable LP_FLEXCOMM9 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ87_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ87_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ87_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ88_EN0_MASK (0x1000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ88_EN0_SHIFT (24U) -/*! REQ88_EN0 - This register is used to enable and disable LP_FLEXCOMM9 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ88_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ88_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ88_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ91_EN0_MASK (0x8000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ91_EN0_SHIFT (27U) -/*! REQ91_EN0 - This register is used to enable and disable EMVSIM0 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ91_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ91_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ91_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ92_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ92_EN0_SHIFT (28U) -/*! REQ92_EN0 - This register is used to enable and disable EMVSIM0 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ92_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ92_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ92_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ93_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ93_EN0_SHIFT (29U) -/*! REQ93_EN0 - This register is used to enable and disable EMVSIM1 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ93_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ93_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ93_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ94_EN0_MASK (0x40000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ94_EN0_SHIFT (30U) -/*! REQ94_EN0 - This register is used to enable and disable EMVSIM1 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ94_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ94_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ94_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ95_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ95_EN0_SHIFT (31U) -/*! REQ95_EN0 - This register is used to enable and disable I3C0 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE2_REQ95_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_REQ95_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_REQ95_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE2_SET - DMA0 Request Enable2 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ64_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ64_EN0_SHIFT (0U) -/*! REQ64_EN0 - Writing a 1 to REQ64_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ64_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ64_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ64_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ65_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ65_EN0_SHIFT (1U) -/*! REQ65_EN0 - Writing a 1 to REQ65_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ65_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ65_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ65_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ66_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ66_EN0_SHIFT (2U) -/*! REQ66_EN0 - Writing a 1 to REQ66_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ66_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ66_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ66_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ67_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ67_EN0_SHIFT (3U) -/*! REQ67_EN0 - Writing a 1 to REQ67_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ67_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ67_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ67_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ68_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ68_EN0_SHIFT (4U) -/*! REQ68_EN0 - Writing a 1 to REQ68_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ68_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ68_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ68_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ69_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ69_EN0_SHIFT (5U) -/*! REQ69_EN0 - Writing a 1 to REQ69_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ69_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ69_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ69_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ70_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ70_EN0_SHIFT (6U) -/*! REQ70_EN0 - Writing a 1 to REQ70_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ70_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ70_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ70_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ71_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ71_EN0_SHIFT (7U) -/*! REQ71_EN0 - Writing a 1 to REQ71_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ71_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ71_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ71_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ72_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ72_EN0_SHIFT (8U) -/*! REQ72_EN0 - Writing a 1 to REQ72_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ72_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ72_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ72_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ73_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ73_EN0_SHIFT (9U) -/*! REQ73_EN0 - Writing a 1 to REQ73_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ73_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ73_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ73_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ74_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ74_EN0_SHIFT (10U) -/*! REQ74_EN0 - Writing a 1 to REQ74_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ74_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ74_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ74_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ75_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ75_EN0_SHIFT (11U) -/*! REQ75_EN0 - Writing a 1 to REQ75_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ75_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ75_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ75_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ76_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ76_EN0_SHIFT (12U) -/*! REQ76_EN0 - Writing a 1 to REQ876_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ76_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ76_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ76_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ77_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ77_EN0_SHIFT (13U) -/*! REQ77_EN0 - Writing a 1 to REQ77_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ77_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ77_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ77_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ78_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ78_EN0_SHIFT (14U) -/*! REQ78_EN0 - Writing a 1 to REQ78_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ78_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ78_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ78_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ79_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ79_EN0_SHIFT (15U) -/*! REQ79_EN0 - Writing a 1 to REQ79_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ79_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ79_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ79_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ80_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ80_EN0_SHIFT (16U) -/*! REQ80_EN0 - Writing a 1 to REQ80_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ80_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ80_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ80_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ81_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ81_EN0_SHIFT (17U) -/*! REQ81_EN0 - Writing a 1 to REQ81_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ81_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ81_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ81_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ82_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ82_EN0_SHIFT (18U) -/*! REQ82_EN0 - Writing a 1 to REQ82_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ82_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ82_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ82_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ83_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ83_EN0_SHIFT (19U) -/*! REQ83_EN0 - Writing a 1 to REQ83_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ83_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ83_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ83_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ84_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ84_EN0_SHIFT (20U) -/*! REQ84_EN0 - Writing a 1 to REQ84_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ84_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ84_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ84_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ85_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ85_EN0_SHIFT (21U) -/*! REQ85_EN0 - Writing a 1 to REQ85_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ85_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ85_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ85_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ86_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ86_EN0_SHIFT (22U) -/*! REQ86_EN0 - Writing a 1 to REQ86_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ86_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ86_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ86_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ87_EN0_MASK (0x800000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ87_EN0_SHIFT (23U) -/*! REQ87_EN0 - Writing a 1 to REQ87_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ87_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ87_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ87_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ88_EN0_MASK (0x1000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ88_EN0_SHIFT (24U) -/*! REQ88_EN0 - Writing a 1 to REQ88_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ88_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ88_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ88_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ91_EN0_MASK (0x8000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ91_EN0_SHIFT (27U) -/*! REQ91_EN0 - Writing a 1 to REQ91_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ91_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ91_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ91_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ92_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ92_EN0_SHIFT (28U) -/*! REQ92_EN0 - Writing a 1 to REQ92_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ92_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ92_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ92_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ93_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ93_EN0_SHIFT (29U) -/*! REQ93_EN0 - Writing a 1 to REQ93_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ93_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ93_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ93_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ94_EN0_MASK (0x40000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ94_EN0_SHIFT (30U) -/*! REQ94_EN0 - Writing a 1 to REQ94_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ94_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ94_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ94_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ95_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ95_EN0_SHIFT (31U) -/*! REQ95_EN0 - Writing a 1 to REQ95_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ95_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ95_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_SET_REQ95_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE2_CLR - DMA0 Request Enable2 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ64_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ64_EN0_SHIFT (0U) -/*! REQ64_EN0 - Writing a 1 to REQ64_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ64_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ64_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ64_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ65_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ65_EN0_SHIFT (1U) -/*! REQ65_EN0 - Writing a 1 to REQ65_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ65_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ65_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ65_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ66_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ66_EN0_SHIFT (2U) -/*! REQ66_EN0 - Writing a 1 to REQ66_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ66_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ66_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ66_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ67_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ67_EN0_SHIFT (3U) -/*! REQ67_EN0 - Writing a 1 to REQ67_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ67_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ67_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ67_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ68_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ68_EN0_SHIFT (4U) -/*! REQ68_EN0 - Writing a 1 to REQ68_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ68_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ68_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ68_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ69_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ69_EN0_SHIFT (5U) -/*! REQ69_EN0 - Writing a 1 to REQ69_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ69_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ69_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ69_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ70_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ70_EN0_SHIFT (6U) -/*! REQ70_EN0 - Writing a 1 to REQ70_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ70_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ70_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ70_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ71_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ71_EN0_SHIFT (7U) -/*! REQ71_EN0 - Writing a 1 to REQ71_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ71_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ71_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ71_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ72_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ72_EN0_SHIFT (8U) -/*! REQ72_EN0 - Writing a 1 to REQ72_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ72_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ72_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ72_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ73_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ73_EN0_SHIFT (9U) -/*! REQ73_EN0 - Writing a 1 to REQ73_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ73_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ73_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ73_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ74_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ74_EN0_SHIFT (10U) -/*! REQ74_EN0 - Writing a 1 to REQ74_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ74_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ74_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ74_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ75_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ75_EN0_SHIFT (11U) -/*! REQ75_EN0 - Writing a 1 to REQ75_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ75_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ75_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ75_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ76_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ76_EN0_SHIFT (12U) -/*! REQ76_EN0 - Writing a 1 to REQ76_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ76_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ76_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ76_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ77_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ77_EN0_SHIFT (13U) -/*! REQ77_EN0 - Writing a 1 to REQ77_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ77_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ77_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ77_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ78_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ78_EN0_SHIFT (14U) -/*! REQ78_EN0 - Writing a 1 to REQ78_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ78_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ78_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ78_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ79_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ79_EN0_SHIFT (15U) -/*! REQ79_EN0 - Writing a 1 to REQ79_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ79_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ79_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ79_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ80_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ80_EN0_SHIFT (16U) -/*! REQ80_EN0 - Writing a 1 to REQ80_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ80_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ80_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ80_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ81_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ81_EN0_SHIFT (17U) -/*! REQ81_EN0 - Writing a 1 to REQ81_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ81_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ81_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ81_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ82_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ82_EN0_SHIFT (18U) -/*! REQ82_EN0 - Writing a 1 to REQ82_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ82_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ82_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ82_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ83_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ83_EN0_SHIFT (19U) -/*! REQ83_EN0 - Writing a 1 to REQ83_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ83_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ83_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ83_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ84_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ84_EN0_SHIFT (20U) -/*! REQ84_EN0 - Writing a 1 to REQ84_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ84_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ84_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ84_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ85_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ85_EN0_SHIFT (21U) -/*! REQ85_EN0 - Writing a 1 to REQ85_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ85_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ85_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ85_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ86_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ86_EN0_SHIFT (22U) -/*! REQ86_EN0 - Writing a 1 to REQ86_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ86_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ86_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ86_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ87_EN0_MASK (0x800000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ87_EN0_SHIFT (23U) -/*! REQ87_EN0 - Writing a 1 to REQ87_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ87_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ87_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ87_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ88_EN0_MASK (0x1000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ88_EN0_SHIFT (24U) -/*! REQ88_EN0 - Writing a 1 to REQ88_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ88_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ88_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ88_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ91_EN0_MASK (0x8000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ91_EN0_SHIFT (27U) -/*! REQ91_EN0 - Writing a 1 to REQ91_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ91_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ91_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ91_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ92_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ92_EN0_SHIFT (28U) -/*! REQ92_EN0 - Writing a 1 to REQ92_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ92_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ92_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ92_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ93_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ93_EN0_SHIFT (29U) -/*! REQ93_EN0 - Writing a 1 to REQ93_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ93_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ93_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ93_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ94_EN0_MASK (0x40000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ94_EN0_SHIFT (30U) -/*! REQ94_EN0 - Writing a 1 to REQ94_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ94_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ94_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ94_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ95_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ95_EN0_SHIFT (31U) -/*! REQ95_EN0 - Writing a 1 to REQ95_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ95_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ95_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_CLR_REQ95_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE2_TOG - DMA0 Request Enable2 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ64_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ64_EN0_SHIFT (0U) -/*! REQ64_EN0 - Writing a 1 to REQ64_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ64_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ64_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ64_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ65_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ65_EN0_SHIFT (1U) -/*! REQ65_EN0 - Writing a 1 to REQ65_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ65_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ65_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ65_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ66_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ66_EN0_SHIFT (2U) -/*! REQ66_EN0 - Writing a 1 to REQ66_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ66_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ66_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ66_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ67_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ67_EN0_SHIFT (3U) -/*! REQ67_EN0 - Writing a 1 to REQ67_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ67_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ67_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ67_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ68_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ68_EN0_SHIFT (4U) -/*! REQ68_EN0 - Writing a 1 to REQ68_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ68_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ68_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ68_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ69_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ69_EN0_SHIFT (5U) -/*! REQ69_EN0 - Writing a 1 to REQ69_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ69_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ69_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ69_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ70_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ70_EN0_SHIFT (6U) -/*! REQ70_EN0 - Writing a 1 to REQ70_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ70_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ70_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ70_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ71_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ71_EN0_SHIFT (7U) -/*! REQ71_EN0 - Writing a 1 to REQ71_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ71_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ71_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ71_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ72_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ72_EN0_SHIFT (8U) -/*! REQ72_EN0 - Writing a 1 to REQ72_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ72_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ72_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ72_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ73_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ73_EN0_SHIFT (9U) -/*! REQ73_EN0 - Writing a 1 to REQ73_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ73_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ73_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ73_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ74_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ74_EN0_SHIFT (10U) -/*! REQ74_EN0 - Writing a 1 to REQ74_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ74_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ74_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ74_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ75_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ75_EN0_SHIFT (11U) -/*! REQ75_EN0 - Writing a 1 to REQ75_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ75_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ75_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ75_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ76_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ76_EN0_SHIFT (12U) -/*! REQ76_EN0 - Writing a 1 to REQ76_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ76_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ76_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ76_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ77_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ77_EN0_SHIFT (13U) -/*! REQ77_EN0 - Writing a 1 to REQ77_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ77_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ77_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ77_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ78_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ78_EN0_SHIFT (14U) -/*! REQ78_EN0 - Writing a 1 to REQ78_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ78_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ78_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ78_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ79_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ79_EN0_SHIFT (15U) -/*! REQ79_EN0 - Writing a 1 to REQ79_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ79_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ79_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ79_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ80_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ80_EN0_SHIFT (16U) -/*! REQ80_EN0 - Writing a 1 to REQ80_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ80_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ80_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ80_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ81_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ81_EN0_SHIFT (17U) -/*! REQ81_EN0 - Writing a 1 to REQ81_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ81_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ81_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ81_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ82_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ82_EN0_SHIFT (18U) -/*! REQ82_EN0 - Writing a 1 to REQ82_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ82_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ82_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ82_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ83_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ83_EN0_SHIFT (19U) -/*! REQ83_EN0 - Writing a 1 to REQ83_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ83_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ83_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ83_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ84_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ84_EN0_SHIFT (20U) -/*! REQ84_EN0 - Writing a 1 to REQ84_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ84_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ84_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ84_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ85_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ85_EN0_SHIFT (21U) -/*! REQ85_EN0 - Writing a 1 to REQ85_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ85_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ85_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ85_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ86_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ86_EN0_SHIFT (22U) -/*! REQ86_EN0 - Writing a 1 to REQ86_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ86_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ86_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ86_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ87_EN0_MASK (0x800000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ87_EN0_SHIFT (23U) -/*! REQ87_EN0 - Writing a 1 to REQ87_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ87_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ87_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ87_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ88_EN0_MASK (0x1000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ88_EN0_SHIFT (24U) -/*! REQ88_EN0 - Writing a 1 to REQ88_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ88_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ88_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ88_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ91_EN0_MASK (0x8000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ91_EN0_SHIFT (27U) -/*! REQ91_EN0 - Writing a 1 to REQ91_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ91_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ91_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ91_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ92_EN0_MASK (0x10000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ92_EN0_SHIFT (28U) -/*! REQ92_EN0 - Writing a 1 to REQ92_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ92_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ92_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ92_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ93_EN0_MASK (0x20000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ93_EN0_SHIFT (29U) -/*! REQ93_EN0 - Writing a 1 to REQ93_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ93_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ93_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ93_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ94_EN0_MASK (0x40000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ94_EN0_SHIFT (30U) -/*! REQ94_EN0 - Writing a 1 to REQ94_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ94_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ94_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ94_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ95_EN0_MASK (0x80000000U) -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ95_EN0_SHIFT (31U) -/*! REQ95_EN0 - Writing a 1 to REQ95_EN0 in this register toggles the corresponding bit in DMA0_REQ_ENABLE2. */ -#define INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ95_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ95_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE2_TOG_REQ95_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE3 - DMA0 Request Enable3 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ96_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ96_EN0_SHIFT (0U) -/*! REQ96_EN0 - This register is used to enable and disable I3C0 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ96_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ96_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ96_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ97_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ97_EN0_SHIFT (1U) -/*! REQ97_EN0 - This register is used to enable and disable I3C1 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ97_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ97_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ97_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ98_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ98_EN0_SHIFT (2U) -/*! REQ98_EN0 - This register is used to enable and disable I3C1 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ98_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ98_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ98_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ99_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ99_EN0_SHIFT (3U) -/*! REQ99_EN0 - This register is used to enable and disable SAI0 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ99_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ99_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ99_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ100_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ100_EN0_SHIFT (4U) -/*! REQ100_EN0 - This register is used to enable and disable SAI0 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ100_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ100_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ100_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ101_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ101_EN0_SHIFT (5U) -/*! REQ101_EN0 - This register is used to enable and disable SAI1 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ101_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ101_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ101_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ102_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ102_EN0_SHIFT (6U) -/*! REQ102_EN0 - This register is used to enable and disable SAI1 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ102_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ102_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ102_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ103_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ103_EN0_SHIFT (7U) -/*! REQ103_EN0 - This register is used to enable and disable SINC0 ipd_req_sinc[0] or ipd_req_alt [0] request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ103_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ103_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ103_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ104_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ104_EN0_SHIFT (8U) -/*! REQ104_EN0 - This register is used to enable and disable SINC0 ipd_req_sinc[1] or ipd_req_alt [1] request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ104_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ104_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ104_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ105_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ105_EN0_SHIFT (9U) -/*! REQ105_EN0 - This register is used to enable and disable SINC0 ipd_req_sinc[2] or ipd_req_alt [2] request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ105_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ105_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ105_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ106_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ106_EN0_SHIFT (10U) -/*! REQ106_EN0 - This register is used to enable and disable SINC0 ipd_req_sinc[3] or ipd_req_alt [3] request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ106_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ106_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ106_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ107_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ107_EN0_SHIFT (11U) -/*! REQ107_EN0 - This register is used to enable and disable SINC0 ipd_req_sinc[4] or ipd_req_alt [4] request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ107_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ107_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ107_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ108_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ108_EN0_SHIFT (12U) -/*! REQ108_EN0 - This register is used to enable and disable GPIO0 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ108_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ108_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ108_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ109_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ109_EN0_SHIFT (13U) -/*! REQ109_EN0 - This register is used to enable and disable GPIO0 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ109_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ109_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ109_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ110_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ110_EN0_SHIFT (14U) -/*! REQ110_EN0 - This register is used to enable and disable GPIO1 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ110_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ110_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ110_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ111_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ111_EN0_SHIFT (15U) -/*! REQ111_EN0 - This register is used to enable and disable GPIO1 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ111_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ111_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ111_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ112_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ112_EN0_SHIFT (16U) -/*! REQ112_EN0 - This register is used to enable and disable GPIO2 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ112_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ112_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ112_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ113_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ113_EN0_SHIFT (17U) -/*! REQ113_EN0 - This register is used to enable and disable GPIO2 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ113_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ113_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ113_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ114_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ114_EN0_SHIFT (18U) -/*! REQ114_EN0 - This register is used to enable and disable GPIO3 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ114_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ114_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ114_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ115_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ115_EN0_SHIFT (19U) -/*! REQ115_EN0 - This register is used to enable and disable GPIO3 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ115_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ115_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ115_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ116_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ116_EN0_SHIFT (20U) -/*! REQ116_EN0 - This register is used to enable and disable GPIO4 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ116_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ116_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ116_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ117_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ117_EN0_SHIFT (21U) -/*! REQ117_EN0 - This register is used to enable and disable GPIO4 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ117_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ117_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ117_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ118_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ118_EN0_SHIFT (22U) -/*! REQ118_EN0 - This register is used to enable and disable GPIO5 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ118_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ118_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ118_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ119_EN0_MASK (0x800000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ119_EN0_SHIFT (23U) -/*! REQ119_EN0 - This register is used to enable and disable GPIO5 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ119_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ119_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ119_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ120_EN0_MASK (0x1000000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ120_EN0_SHIFT (24U) -/*! REQ120_EN0 - This register is used to enable and disable TSI0 end of scan request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ120_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ120_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ120_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ121_EN0_MASK (0x2000000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ121_EN0_SHIFT (25U) -/*! REQ121_EN0 - This register is used to enable and disable TSI0 out of range request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA0_REQ_ENABLE3_REQ121_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_REQ121_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_REQ121_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE3_SET - DMA0 Request Enable3 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ96_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ96_EN0_SHIFT (0U) -/*! REQ96_EN0 - Writing a 1 to REQ96_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ96_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ96_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ96_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ97_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ97_EN0_SHIFT (1U) -/*! REQ97_EN0 - Writing a 1 to REQ97_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ97_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ97_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ97_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ98_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ98_EN0_SHIFT (2U) -/*! REQ98_EN0 - Writing a 1 to REQ98_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ98_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ98_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ98_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ99_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ99_EN0_SHIFT (3U) -/*! REQ99_EN0 - Writing a 1 to REQ99_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ99_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ99_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ99_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ100_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ100_EN0_SHIFT (4U) -/*! REQ100_EN0 - Writing a 1 to REQ100_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ100_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ100_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ100_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ101_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ101_EN0_SHIFT (5U) -/*! REQ101_EN0 - Writing a 1 to REQ101_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ101_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ101_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ101_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ102_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ102_EN0_SHIFT (6U) -/*! REQ102_EN0 - Writing a 1 to REQ102_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ102_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ102_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ102_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ103_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ103_EN0_SHIFT (7U) -/*! REQ103_EN0 - Writing a 1 to REQ103_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ103_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ103_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ103_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ104_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ104_EN0_SHIFT (8U) -/*! REQ104_EN0 - Writing a 1 to REQ104_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ104_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ104_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ104_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ105_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ105_EN0_SHIFT (9U) -/*! REQ105_EN0 - Writing a 1 to REQ105_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ105_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ105_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ105_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ106_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ106_EN0_SHIFT (10U) -/*! REQ106_EN0 - Writing a 1 to REQ106_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ106_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ106_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ106_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ107_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ107_EN0_SHIFT (11U) -/*! REQ107_EN0 - Writing a 1 to REQ107_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ107_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ107_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ107_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ108_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ108_EN0_SHIFT (12U) -/*! REQ108_EN0 - Writing a 1 to REQ108_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ108_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ108_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ108_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ109_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ109_EN0_SHIFT (13U) -/*! REQ109_EN0 - Writing a 1 to REQ109_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ109_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ109_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ109_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ110_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ110_EN0_SHIFT (14U) -/*! REQ110_EN0 - Writing a 1 to REQ110_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ110_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ110_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ110_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ111_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ111_EN0_SHIFT (15U) -/*! REQ111_EN0 - Writing a 1 to REQ111_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ111_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ111_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ111_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ112_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ112_EN0_SHIFT (16U) -/*! REQ112_EN0 - Writing a 1 to REQ112_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ112_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ112_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ112_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ113_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ113_EN0_SHIFT (17U) -/*! REQ113_EN0 - Writing a 1 to REQ113_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ113_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ113_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ113_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ114_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ114_EN0_SHIFT (18U) -/*! REQ114_EN0 - Writing a 1 to REQ114_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ114_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ114_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ114_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ115_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ115_EN0_SHIFT (19U) -/*! REQ115_EN0 - Writing a 1 to REQ115_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ115_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ115_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ115_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ116_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ116_EN0_SHIFT (20U) -/*! REQ116_EN0 - Writing a 1 to REQ116_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ116_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ116_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ116_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ117_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ117_EN0_SHIFT (21U) -/*! REQ117_EN0 - Writing a 1 to REQ117_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ117_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ117_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ117_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ118_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ118_EN0_SHIFT (22U) -/*! REQ118_EN0 - Writing a 1 to REQ118_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ118_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ118_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ118_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ119_EN0_MASK (0x800000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ119_EN0_SHIFT (23U) -/*! REQ119_EN0 - Writing a 1 to REQ119_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ119_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ119_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ119_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ120_EN0_MASK (0x1000000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ120_EN0_SHIFT (24U) -/*! REQ120_EN0 - Writing a 1 to REQ120_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ120_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ120_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ120_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ121_EN0_MASK (0x2000000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ121_EN0_SHIFT (25U) -/*! REQ121_EN0 - Writing a 1 to REQ121_EN0 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ121_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ121_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_SET_REQ121_EN0_MASK) -/*! @} */ - -/*! @name DMA0_REQ_ENABLE3_CLR - DMA0 Request Enable3 */ -/*! @{ */ - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ96_EN0_MASK (0x1U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ96_EN0_SHIFT (0U) -/*! REQ96_EN0 - Writing a 1 to REQ96_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ96_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ96_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ96_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ97_EN0_MASK (0x2U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ97_EN0_SHIFT (1U) -/*! REQ97_EN0 - Writing a 1 to REQ97_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ97_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ97_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ97_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ98_EN0_MASK (0x4U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ98_EN0_SHIFT (2U) -/*! REQ98_EN0 - Writing a 1 to REQ98_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ98_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ98_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ98_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ99_EN0_MASK (0x8U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ99_EN0_SHIFT (3U) -/*! REQ99_EN0 - Writing a 1 to REQ99_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ99_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ99_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ99_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ100_EN0_MASK (0x10U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ100_EN0_SHIFT (4U) -/*! REQ100_EN0 - Writing a 1 to REQ100_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ100_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ100_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ100_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ101_EN0_MASK (0x20U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ101_EN0_SHIFT (5U) -/*! REQ101_EN0 - Writing a 1 to REQ101_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ101_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ101_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ101_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ102_EN0_MASK (0x40U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ102_EN0_SHIFT (6U) -/*! REQ102_EN0 - Writing a 1 to REQ102_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ102_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ102_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ102_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ103_EN0_MASK (0x80U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ103_EN0_SHIFT (7U) -/*! REQ103_EN0 - Writing a 1 to REQ103_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ103_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ103_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ103_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ104_EN0_MASK (0x100U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ104_EN0_SHIFT (8U) -/*! REQ104_EN0 - Writing a 1 to REQ104_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ104_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ104_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ104_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ105_EN0_MASK (0x200U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ105_EN0_SHIFT (9U) -/*! REQ105_EN0 - Writing a 1 to REQ105_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ105_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ105_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ105_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ106_EN0_MASK (0x400U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ106_EN0_SHIFT (10U) -/*! REQ106_EN0 - Writing a 1 to REQ106_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ106_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ106_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ106_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ107_EN0_MASK (0x800U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ107_EN0_SHIFT (11U) -/*! REQ107_EN0 - Writing a 1 to REQ107_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ107_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ107_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ107_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ108_EN0_MASK (0x1000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ108_EN0_SHIFT (12U) -/*! REQ108_EN0 - Writing a 1 to REQ108_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ108_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ108_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ108_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ109_EN0_MASK (0x2000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ109_EN0_SHIFT (13U) -/*! REQ109_EN0 - Writing a 1 to REQ109_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ109_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ109_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ109_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ110_EN0_MASK (0x4000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ110_EN0_SHIFT (14U) -/*! REQ110_EN0 - Writing a 1 to REQ110_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ110_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ110_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ110_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ111_EN0_MASK (0x8000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ111_EN0_SHIFT (15U) -/*! REQ111_EN0 - Writing a 1 to REQ111_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ111_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ111_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ111_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ112_EN0_MASK (0x10000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ112_EN0_SHIFT (16U) -/*! REQ112_EN0 - Writing a 1 to REQ112_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ112_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ112_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ112_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ113_EN0_MASK (0x20000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ113_EN0_SHIFT (17U) -/*! REQ113_EN0 - Writing a 1 to REQ113_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ113_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ113_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ113_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ114_EN0_MASK (0x40000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ114_EN0_SHIFT (18U) -/*! REQ114_EN0 - Writing a 1 to REQ114_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ114_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ114_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ114_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ115_EN0_MASK (0x80000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ115_EN0_SHIFT (19U) -/*! REQ115_EN0 - Writing a 1 to REQ115_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ115_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ115_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ115_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ116_EN0_MASK (0x100000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ116_EN0_SHIFT (20U) -/*! REQ116_EN0 - Writing a 1 to REQ116_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ116_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ116_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ116_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ117_EN0_MASK (0x200000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ117_EN0_SHIFT (21U) -/*! REQ117_EN0 - Writing a 1 to REQ117_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ117_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ117_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ117_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ118_EN0_MASK (0x400000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ118_EN0_SHIFT (22U) -/*! REQ118_EN0 - Writing a 1 to REQ118_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ118_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ118_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ118_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ119_EN0_MASK (0x800000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ119_EN0_SHIFT (23U) -/*! REQ119_EN0 - Writing a 1 to REQ119_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ119_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ119_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ119_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ120_EN0_MASK (0x1000000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ120_EN0_SHIFT (24U) -/*! REQ120_EN0 - Writing a 1 to REQ120_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ120_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ120_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ120_EN0_MASK) - -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ121_EN0_MASK (0x2000000U) -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ121_EN0_SHIFT (25U) -/*! REQ121_EN0 - Writing a 1 to REQ121_EN0 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ121_EN0(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ121_EN0_SHIFT)) & INPUTMUX_DMA0_REQ_ENABLE3_CLR_REQ121_EN0_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE0 - DMA1 Request Enable0 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ1_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ1_EN1_SHIFT (1U) -/*! REQ1_EN1 - This register is used to enable and disable FLEXSPI0 receive event request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ1_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ1_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ1_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ2_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ2_EN1_SHIFT (2U) -/*! REQ2_EN1 - This register is used to enable and disable FLEXSPI0 transmit event request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ2_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ2_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ2_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ3_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ3_EN1_SHIFT (3U) -/*! REQ3_EN1 - This register is used to enable and disable PINT0 INT0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ3_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ3_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ3_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ4_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ4_EN1_SHIFT (4U) -/*! REQ4_EN1 - This register is used to enable and disable PINT0 INT1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ4_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ4_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ4_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ5_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ5_EN1_SHIFT (5U) -/*! REQ5_EN1 - This register is used to enable and disable PINT0 INT2 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ5_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ5_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ5_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ6_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ6_EN1_SHIFT (6U) -/*! REQ6_EN1 - This register is used to enable and disable PINT0 INT3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ6_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ6_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ6_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ7_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ7_EN1_SHIFT (7U) -/*! REQ7_EN1 - This register is used to enable and disable CTIMER0 DMAREQ_M0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ7_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ7_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ7_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ8_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ8_EN1_SHIFT (8U) -/*! REQ8_EN1 - This register is used to enable and disable CTIMER0 DMAREQ_M1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ8_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ8_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ8_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ9_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ9_EN1_SHIFT (9U) -/*! REQ9_EN1 - This register is used to enable and disable CTIMER1 DMAREQ_M0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ9_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ9_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ9_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ10_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ10_EN1_SHIFT (10U) -/*! REQ10_EN1 - This register is used to enable and disable CTIMER1 DMAREQ_M1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ10_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ10_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ10_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ11_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ11_EN1_SHIFT (11U) -/*! REQ11_EN1 - This register is used to enable and disable CTIMER2 DMAREQ_M0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ11_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ11_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ11_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ12_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ12_EN1_SHIFT (12U) -/*! REQ12_EN1 - This register is used to enable and disable CTIMER2 DMAREQ_M1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ12_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ12_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ12_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ13_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ13_EN1_SHIFT (13U) -/*! REQ13_EN1 - This register is used to enable and disable CTIMER3 DMAREQ_M0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ13_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ13_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ13_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ14_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ14_EN1_SHIFT (14U) -/*! REQ14_EN1 - This register is used to enable and disable CTIMER3 DMAREQ_M1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ14_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ14_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ14_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ15_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ15_EN1_SHIFT (15U) -/*! REQ15_EN1 - This register is used to enable and disable CTIMER4 DMAREQ_M0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ15_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ15_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ15_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ16_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ16_EN1_SHIFT (16U) -/*! REQ16_EN1 - This register is used to enable and disable CTIMER4 DMAREQ_M1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ16_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ16_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ16_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ17_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ17_EN1_SHIFT (17U) -/*! REQ17_EN1 - This register is used to enable and disable WUU0 wake up event request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ17_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ17_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ17_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ18_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ18_EN1_SHIFT (18U) -/*! REQ18_EN1 - This register is used to enable and disable MICFIL0 FIFO_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ18_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ18_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ18_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ19_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ19_EN1_SHIFT (19U) -/*! REQ19_EN1 - This register is used to enable and disable SCT0 DMA0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ19_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ19_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ19_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ20_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ20_EN1_SHIFT (20U) -/*! REQ20_EN1 - This register is used to enable and disable SCT0 DMA1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ20_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ20_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ20_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ21_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ21_EN1_SHIFT (21U) -/*! REQ21_EN1 - This register is used to enable and disable ADC0 FIFO A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ21_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ21_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ21_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ22_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ22_EN1_SHIFT (22U) -/*! REQ22_EN1 - This register is used to enable and disable ADC0 FIFO B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ22_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ22_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ22_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ23_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ23_EN1_SHIFT (23U) -/*! REQ23_EN1 - This register is used to enable and disable ADC1 FIFO A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ23_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ23_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ23_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ24_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ24_EN1_SHIFT (24U) -/*! REQ24_EN1 - This register is used to enable and disable ADC1 FIFO B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ24_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ24_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ24_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ25_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ25_EN1_SHIFT (25U) -/*! REQ25_EN1 - This register is used to enable and disable DAC0 FIFO_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ25_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ25_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ25_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ26_EN1_MASK (0x4000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ26_EN1_SHIFT (26U) -/*! REQ26_EN1 - This register is used to enable and disable DAC1 FIFO_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ26_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ26_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ26_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ27_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ27_EN1_SHIFT (27U) -/*! REQ27_EN1 - This register is used to enable and disable DAC2 FIFO_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ27_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ27_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ27_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ28_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ28_EN1_SHIFT (28U) -/*! REQ28_EN1 - This register is used to enable and disable CMP0 DMA_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ28_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ28_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ28_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ29_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ29_EN1_SHIFT (29U) -/*! REQ29_EN1 - This register is used to enable and disable CMP1 DMA_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ29_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ29_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ29_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ30_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ30_EN1_SHIFT (30U) -/*! REQ30_EN1 - This register is used to enable and disable CMP2 DMA_request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ30_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ30_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ30_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ31_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ31_EN1_SHIFT (31U) -/*! REQ31_EN1 - This register is used to enable and disable EVTG0 OUT0A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE0_REQ31_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_REQ31_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_REQ31_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE0_SET - DMA1 Request Enable0 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ1_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ1_EN1_SHIFT (1U) -/*! REQ1_EN1 - Writing a 1 to REQ1_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ1_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ1_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ1_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ2_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ2_EN1_SHIFT (2U) -/*! REQ2_EN1 - Writing a 1 to REQ2_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ2_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ2_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ2_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ3_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ3_EN1_SHIFT (3U) -/*! REQ3_EN1 - Writing a 1 to REQ3_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ3_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ3_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ3_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ4_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ4_EN1_SHIFT (4U) -/*! REQ4_EN1 - Writing a 1 to REQ4_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ4_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ4_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ4_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ5_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ5_EN1_SHIFT (5U) -/*! REQ5_EN1 - Writing a 1 to REQ5_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ5_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ5_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ5_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ6_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ6_EN1_SHIFT (6U) -/*! REQ6_EN1 - Writing a 1 to REQ6_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ6_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ6_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ6_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ7_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ7_EN1_SHIFT (7U) -/*! REQ7_EN1 - Writing a 1 to REQ7_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ7_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ7_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ7_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ8_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ8_EN1_SHIFT (8U) -/*! REQ8_EN1 - Writing a 1 to REQ8_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ8_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ8_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ8_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ9_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ9_EN1_SHIFT (9U) -/*! REQ9_EN1 - Writing a 1 to REQ9_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ9_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ9_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ9_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ10_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ10_EN1_SHIFT (10U) -/*! REQ10_EN1 - Writing a 1 to REQ10_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ10_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ10_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ10_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ11_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ11_EN1_SHIFT (11U) -/*! REQ11_EN1 - Writing a 1 to REQ11_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ11_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ11_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ11_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ12_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ12_EN1_SHIFT (12U) -/*! REQ12_EN1 - Writing a 1 to REQ12_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ12_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ12_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ12_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ13_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ13_EN1_SHIFT (13U) -/*! REQ13_EN1 - Writing a 1 to REQ13_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ13_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ13_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ13_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ14_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ14_EN1_SHIFT (14U) -/*! REQ14_EN1 - Writing a 1 to REQ14_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ14_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ14_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ14_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ15_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ15_EN1_SHIFT (15U) -/*! REQ15_EN1 - Writing a 1 to REQ15_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ15_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ15_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ15_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ16_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ16_EN1_SHIFT (16U) -/*! REQ16_EN1 - Writing a 1 to REQ16_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ16_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ16_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ16_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ17_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ17_EN1_SHIFT (17U) -/*! REQ17_EN1 - Writing a 1 to REQ17_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ17_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ17_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ17_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ18_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ18_EN1_SHIFT (18U) -/*! REQ18_EN1 - Writing a 1 to REQ18_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ18_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ18_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ18_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ19_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ19_EN1_SHIFT (19U) -/*! REQ19_EN1 - Writing a 1 to REQ19_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ19_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ19_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ19_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ20_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ20_EN1_SHIFT (20U) -/*! REQ20_EN1 - Writing a 1 to REQ20_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ20_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ20_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ20_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ21_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ21_EN1_SHIFT (21U) -/*! REQ21_EN1 - Writing a 1 to REQ21_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ21_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ21_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ21_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ22_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ22_EN1_SHIFT (22U) -/*! REQ22_EN1 - Writing a 1 to REQ22_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ22_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ22_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ22_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ23_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ23_EN1_SHIFT (23U) -/*! REQ23_EN1 - Writing a 1 to REQ23_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ23_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ23_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ23_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ24_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ24_EN1_SHIFT (24U) -/*! REQ24_EN1 - Writing a 1 to REQ24_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ24_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ24_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ24_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ25_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ25_EN1_SHIFT (25U) -/*! REQ25_EN1 - Writing a 1 to REQ25_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ25_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ25_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ25_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ26_EN1_MASK (0x4000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ26_EN1_SHIFT (26U) -/*! REQ26_EN1 - Writing a 1 to REQ26_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ26_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ26_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ26_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ27_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ27_EN1_SHIFT (27U) -/*! REQ27_EN1 - Writing a 1 to REQ27_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ27_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ27_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ27_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ28_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ28_EN1_SHIFT (28U) -/*! REQ28_EN1 - Writing a 1 to REQ28_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ28_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ28_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ28_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ29_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ29_EN1_SHIFT (29U) -/*! REQ29_EN1 - Writing a 1 to REQ29_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ29_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ29_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ29_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ30_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ30_EN1_SHIFT (30U) -/*! REQ30_EN1 - Writing a 1 to REQ30_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ30_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ30_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ30_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ31_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ31_EN1_SHIFT (31U) -/*! REQ31_EN1 - Writing a 1 to REQ31_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ31_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ31_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_SET_REQ31_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE0_CLR - DMA1 Request Enable0 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ1_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ1_EN1_SHIFT (1U) -/*! REQ1_EN1 - Writing a 1 to REQ1_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ1_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ1_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ1_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ2_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ2_EN1_SHIFT (2U) -/*! REQ2_EN1 - Writing a 1 to REQ2_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ2_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ2_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ2_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ3_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ3_EN1_SHIFT (3U) -/*! REQ3_EN1 - Writing a 1 to REQ3_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ3_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ3_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ3_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ4_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ4_EN1_SHIFT (4U) -/*! REQ4_EN1 - Writing a 1 to REQ4_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ4_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ4_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ4_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ5_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ5_EN1_SHIFT (5U) -/*! REQ5_EN1 - Writing a 1 to REQ5_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ5_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ5_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ5_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ6_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ6_EN1_SHIFT (6U) -/*! REQ6_EN1 - Writing a 1 to REQ6_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ6_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ6_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ6_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ7_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ7_EN1_SHIFT (7U) -/*! REQ7_EN1 - Writing a 1 to REQ7_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ7_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ7_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ7_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ8_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ8_EN1_SHIFT (8U) -/*! REQ8_EN1 - Writing a 1 to REQ8_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ8_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ8_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ8_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ9_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ9_EN1_SHIFT (9U) -/*! REQ9_EN1 - Writing a 1 to REQ9_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ9_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ9_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ9_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ10_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ10_EN1_SHIFT (10U) -/*! REQ10_EN1 - Writing a 1 to REQ10_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ10_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ10_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ10_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ11_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ11_EN1_SHIFT (11U) -/*! REQ11_EN1 - Writing a 1 to REQ11_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ11_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ11_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ11_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ12_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ12_EN1_SHIFT (12U) -/*! REQ12_EN1 - Writing a 1 to REQ12_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ12_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ12_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ12_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ13_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ13_EN1_SHIFT (13U) -/*! REQ13_EN1 - Writing a 1 to REQ13_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ13_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ13_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ13_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ14_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ14_EN1_SHIFT (14U) -/*! REQ14_EN1 - Writing a 1 to REQ14_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ14_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ14_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ14_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ15_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ15_EN1_SHIFT (15U) -/*! REQ15_EN1 - Writing a 1 to REQ15_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ15_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ15_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ15_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ16_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ16_EN1_SHIFT (16U) -/*! REQ16_EN1 - Writing a 1 to REQ16_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ16_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ16_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ16_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ17_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ17_EN1_SHIFT (17U) -/*! REQ17_EN1 - Writing a 1 to REQ17_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ17_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ17_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ17_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ18_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ18_EN1_SHIFT (18U) -/*! REQ18_EN1 - Writing a 1 to REQ18_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ18_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ18_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ18_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ19_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ19_EN1_SHIFT (19U) -/*! REQ19_EN1 - Writing a 1 to REQ19_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ19_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ19_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ19_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ20_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ20_EN1_SHIFT (20U) -/*! REQ20_EN1 - Writing a 1 to REQ20_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ20_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ20_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ20_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ21_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ21_EN1_SHIFT (21U) -/*! REQ21_EN1 - Writing a 1 to REQ21_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ21_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ21_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ21_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ22_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ22_EN1_SHIFT (22U) -/*! REQ22_EN1 - Writing a 1 to REQ22_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ22_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ22_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ22_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ23_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ23_EN1_SHIFT (23U) -/*! REQ23_EN1 - Writing a 1 to REQ23_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ23_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ23_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ23_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ24_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ24_EN1_SHIFT (24U) -/*! REQ24_EN1 - Writing a 1 to REQ24_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ24_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ24_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ24_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ25_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ25_EN1_SHIFT (25U) -/*! REQ25_EN1 - Writing a 1 to REQ25_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ25_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ25_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ25_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ26_EN1_MASK (0x4000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ26_EN1_SHIFT (26U) -/*! REQ26_EN1 - Writing a 1 to REQ26_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ26_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ26_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ26_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ27_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ27_EN1_SHIFT (27U) -/*! REQ27_EN1 - Writing a 1 to REQ27_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ27_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ27_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ27_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ28_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ28_EN1_SHIFT (28U) -/*! REQ28_EN1 - Writing a 1 to REQ28_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ28_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ28_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ28_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ29_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ29_EN1_SHIFT (29U) -/*! REQ29_EN1 - Writing a 1 to REQ29_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ29_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ29_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ29_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ30_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ30_EN1_SHIFT (30U) -/*! REQ30_EN1 - Writing a 1 to REQ30_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ30_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ30_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ30_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ31_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ31_EN1_SHIFT (31U) -/*! REQ31_EN1 - Writing a 1 to REQ31_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ31_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ31_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_CLR_REQ31_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE0_TOG - DMA1 Request Enable0 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ1_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ1_EN1_SHIFT (1U) -/*! REQ1_EN1 - Writing a 1 to REQ1_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ1_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ1_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ1_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ2_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ2_EN1_SHIFT (2U) -/*! REQ2_EN1 - Writing a 1 to REQ2_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ2_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ2_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ2_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ3_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ3_EN1_SHIFT (3U) -/*! REQ3_EN1 - Writing a 1 to REQ3_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ3_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ3_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ3_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ4_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ4_EN1_SHIFT (4U) -/*! REQ4_EN1 - Writing a 1 to REQ4_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ4_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ4_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ4_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ5_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ5_EN1_SHIFT (5U) -/*! REQ5_EN1 - Writing a 1 to REQ5_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ5_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ5_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ5_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ6_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ6_EN1_SHIFT (6U) -/*! REQ6_EN1 - Writing a 1 to REQ6_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ6_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ6_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ6_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ7_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ7_EN1_SHIFT (7U) -/*! REQ7_EN1 - Writing a 1 to REQ7_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ7_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ7_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ7_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ8_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ8_EN1_SHIFT (8U) -/*! REQ8_EN1 - Writing a 1 to REQ8_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ8_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ8_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ8_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ9_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ9_EN1_SHIFT (9U) -/*! REQ9_EN1 - Writing a 1 to RE9_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ9_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ9_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ9_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ10_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ10_EN1_SHIFT (10U) -/*! REQ10_EN1 - Writing a 1 to REQ10_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ10_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ10_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ10_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ11_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ11_EN1_SHIFT (11U) -/*! REQ11_EN1 - Writing a 1 to REQ11_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ11_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ11_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ11_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ12_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ12_EN1_SHIFT (12U) -/*! REQ12_EN1 - Writing a 1 to REQ12_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ12_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ12_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ12_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ13_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ13_EN1_SHIFT (13U) -/*! REQ13_EN1 - Writing a 1 to REQ13_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ13_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ13_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ13_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ14_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ14_EN1_SHIFT (14U) -/*! REQ14_EN1 - Writing a 1 to REQ14_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ14_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ14_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ14_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ15_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ15_EN1_SHIFT (15U) -/*! REQ15_EN1 - Writing a 1 to REQ15_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ15_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ15_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ15_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ16_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ16_EN1_SHIFT (16U) -/*! REQ16_EN1 - Writing a 1 to REQ16_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ16_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ16_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ16_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ17_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ17_EN1_SHIFT (17U) -/*! REQ17_EN1 - Writing a 1 to REQ17_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ17_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ17_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ17_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ18_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ18_EN1_SHIFT (18U) -/*! REQ18_EN1 - Writing a 1 to REQ18_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ18_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ18_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ18_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ19_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ19_EN1_SHIFT (19U) -/*! REQ19_EN1 - Writing a 1 to REQ19_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ19_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ19_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ19_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ20_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ20_EN1_SHIFT (20U) -/*! REQ20_EN1 - Writing a 1 to REQ20_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ20_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ20_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ20_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ21_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ21_EN1_SHIFT (21U) -/*! REQ21_EN1 - Writing a 1 to REQ21_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ21_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ21_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ21_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ22_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ22_EN1_SHIFT (22U) -/*! REQ22_EN1 - Writing a 1 to REQ22_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ22_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ22_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ22_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ23_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ23_EN1_SHIFT (23U) -/*! REQ23_EN1 - Writing a 1 to REQ23_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ23_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ23_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ23_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ24_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ24_EN1_SHIFT (24U) -/*! REQ24_EN1 - Writing a 1 to REQ24_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ24_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ24_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ24_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ25_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ25_EN1_SHIFT (25U) -/*! REQ25_EN1 - Writing a 1 to REQ25_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ25_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ25_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ25_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ26_EN1_MASK (0x4000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ26_EN1_SHIFT (26U) -/*! REQ26_EN1 - Writing a 1 to REQ26_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ26_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ26_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ26_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ27_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ27_EN1_SHIFT (27U) -/*! REQ27_EN1 - Writing a 1 to REQ27_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ27_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ27_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ27_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ28_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ28_EN1_SHIFT (28U) -/*! REQ28_EN1 - Writing a 1 to REQ28_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ28_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ28_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ28_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ29_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ29_EN1_SHIFT (29U) -/*! REQ29_EN1 - Writing a 1 to REQ29_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ29_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ29_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ29_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ30_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ30_EN1_SHIFT (30U) -/*! REQ30_EN1 - Writing a 1 to REQ30_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ30_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ30_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ30_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ31_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ31_EN1_SHIFT (31U) -/*! REQ31_EN1 - Writing a 1 to REQ31_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE0. */ -#define INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ31_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ31_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE0_TOG_REQ31_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE1 - DMA1 Request Enable1 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ32_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ32_EN1_SHIFT (0U) -/*! REQ32_EN1 - This register is used to enable and disable EVTG0 OUT0B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ32_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ32_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ32_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ33_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ33_EN1_SHIFT (1U) -/*! REQ33_EN1 - This register is used to enable and disable EVTG0 OUT1A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ33_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ33_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ33_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ34_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ34_EN1_SHIFT (2U) -/*! REQ34_EN1 - This register is used to enable and disable EVTG0 OUT1B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ34_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ34_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ34_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ35_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ35_EN1_SHIFT (3U) -/*! REQ35_EN1 - This register is used to enable and disable EVTG0 OUT2A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ35_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ35_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ35_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ36_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ36_EN1_SHIFT (4U) -/*! REQ36_EN1 - This register is used to enable and disable EVTG0 OUT2B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ36_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ36_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ36_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ37_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ37_EN1_SHIFT (5U) -/*! REQ37_EN1 - This register is used to enable and disable EVTG0 OUT3A request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ37_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ37_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ37_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ38_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ38_EN1_SHIFT (6U) -/*! REQ38_EN1 - This register is used to enable and disable EVTG0 OUT3B request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ38_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ38_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ38_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ39_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ39_EN1_SHIFT (7U) -/*! REQ39_EN1 - This register is used to enable and disable PWM0 Req_capt0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ39_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ39_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ39_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ40_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ40_EN1_SHIFT (8U) -/*! REQ40_EN1 - This register is used to enable and disable PWM0 Req_capt1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ40_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ40_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ40_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ41_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ41_EN1_SHIFT (9U) -/*! REQ41_EN1 - This register is used to enable and disable PWM0 Req_capt2 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ41_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ41_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ41_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ42_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ42_EN1_SHIFT (10U) -/*! REQ42_EN1 - This register is used to enable and disable PWM0 Req_capt3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ42_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ42_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ42_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ43_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ43_EN1_SHIFT (11U) -/*! REQ43_EN1 - This register is used to enable and disable PWM0 Req_val0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ43_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ43_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ43_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ44_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ44_EN1_SHIFT (12U) -/*! REQ44_EN1 - This register is used to enable and disable PWM0 Req_val1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ44_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ44_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ44_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ45_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ45_EN1_SHIFT (13U) -/*! REQ45_EN1 - This register is used to enable and disable PWM0 Req_val2 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ45_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ45_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ45_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ46_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ46_EN1_SHIFT (14U) -/*! REQ46_EN1 - This register is used to enable and disable PWM0 Req_val3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ46_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ46_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ46_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ47_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ47_EN1_SHIFT (15U) -/*! REQ47_EN1 - This register is used to enable and disable PWM1 Req_capt0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ47_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ47_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ47_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ48_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ48_EN1_SHIFT (16U) -/*! REQ48_EN1 - This register is used to enable and disable PWM1 Req_capt1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ48_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ48_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ48_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ49_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ49_EN1_SHIFT (17U) -/*! REQ49_EN1 - This register is used to enable and disable PWM1 Req_capt2 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ49_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ49_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ49_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ50_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ50_EN1_SHIFT (18U) -/*! REQ50_EN1 - This register is used to enable and disable PWM1 Req_capt3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ50_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ50_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ50_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ51_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ51_EN1_SHIFT (19U) -/*! REQ51_EN1 - This register is used to enable and disable PWM1 Req_val0 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ51_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ51_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ51_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ52_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ52_EN1_SHIFT (20U) -/*! REQ52_EN1 - This register is used to enable and disable PWM1 Req_val1 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ52_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ52_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ52_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ53_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ53_EN1_SHIFT (21U) -/*! REQ53_EN1 - This register is used to enable and disable PWM1 Req_val2 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ53_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ53_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ53_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ54_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ54_EN1_SHIFT (22U) -/*! REQ54_EN1 - This register is used to enable and disable PWM1 Req_val3 request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ54_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ54_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ54_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ57_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ57_EN1_SHIFT (25U) -/*! REQ57_EN1 - This register is used to enable and disable LPTMR0 counter match event request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ57_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ57_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ57_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ58_EN1_MASK (0x4000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ58_EN1_SHIFT (26U) -/*! REQ58_EN1 - This register is used to enable and disable LPTMR1 counter match event request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ58_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ58_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ58_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ59_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ59_EN1_SHIFT (27U) -/*! REQ59_EN1 - This register is used to enable and disable CAN0 DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ59_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ59_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ59_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ60_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ60_EN1_SHIFT (28U) -/*! REQ60_EN1 - This register is used to enable and disable CAN1 DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ60_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ60_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ60_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ61_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ61_EN1_SHIFT (29U) -/*! REQ61_EN1 - This register is used to enable and disable FlexIO0 Shifter0 Status DMA request OR Timer0 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ61_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ61_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ61_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ62_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ62_EN1_SHIFT (30U) -/*! REQ62_EN1 - This register is used to enable and disable FlexIO0 Shifter1 Status DMA request OR Timer1 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ62_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ62_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ62_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ63_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ63_EN1_SHIFT (31U) -/*! REQ63_EN1 - This register is used to enable and disable FlexIO0 Shifter2 Status DMA request OR Timer2 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE1_REQ63_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_REQ63_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_REQ63_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE1_SET - DMA1 Request Enable1 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ32_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ32_EN1_SHIFT (0U) -/*! REQ32_EN1 - Writing a 1 to REQ32_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ32_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ32_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ32_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ33_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ33_EN1_SHIFT (1U) -/*! REQ33_EN1 - Writing a 1 to REQ33_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ33_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ33_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ33_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ34_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ34_EN1_SHIFT (2U) -/*! REQ34_EN1 - Writing a 1 to REQ34_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ34_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ34_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ34_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ35_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ35_EN1_SHIFT (3U) -/*! REQ35_EN1 - Writing a 1 to REQ35_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ35_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ35_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ35_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ36_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ36_EN1_SHIFT (4U) -/*! REQ36_EN1 - Writing a 1 to REQ36_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ36_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ36_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ36_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ37_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ37_EN1_SHIFT (5U) -/*! REQ37_EN1 - Writing a 1 to REQ37_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ37_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ37_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ37_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ38_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ38_EN1_SHIFT (6U) -/*! REQ38_EN1 - Writing a 1 to REQ38_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ38_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ38_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ38_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ39_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ39_EN1_SHIFT (7U) -/*! REQ39_EN1 - Writing a 1 to REQ39_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ39_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ39_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ39_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ40_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ40_EN1_SHIFT (8U) -/*! REQ40_EN1 - Writing a 1 to REQ40_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ40_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ40_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ40_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ41_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ41_EN1_SHIFT (9U) -/*! REQ41_EN1 - Writing a 1 to REQ41_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ41_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ41_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ41_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ42_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ42_EN1_SHIFT (10U) -/*! REQ42_EN1 - Writing a 1 to REQ42_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ42_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ42_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ42_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ43_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ43_EN1_SHIFT (11U) -/*! REQ43_EN1 - Writing a 1 to REQ43_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ43_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ43_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ43_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ44_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ44_EN1_SHIFT (12U) -/*! REQ44_EN1 - Writing a 1 to REQ44_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ44_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ44_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ44_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ45_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ45_EN1_SHIFT (13U) -/*! REQ45_EN1 - Writing a 1 to REQ45_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ45_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ45_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ45_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ46_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ46_EN1_SHIFT (14U) -/*! REQ46_EN1 - Writing a 1 to REQ46_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ46_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ46_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ46_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ47_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ47_EN1_SHIFT (15U) -/*! REQ47_EN1 - Writing a 1 to REQ47_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ47_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ47_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ47_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ48_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ48_EN1_SHIFT (16U) -/*! REQ48_EN1 - Writing a 1 to REQ48_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ48_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ48_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ48_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ49_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ49_EN1_SHIFT (17U) -/*! REQ49_EN1 - Writing a 1 to REQ49_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ49_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ49_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ49_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ50_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ50_EN1_SHIFT (18U) -/*! REQ50_EN1 - Writing a 1 to REQ50_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ50_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ50_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ50_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ51_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ51_EN1_SHIFT (19U) -/*! REQ51_EN1 - Writing a 1 to REQ51_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ51_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ51_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ51_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ52_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ52_EN1_SHIFT (20U) -/*! REQ52_EN1 - Writing a 1 to REQ52_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ52_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ52_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ52_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ53_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ53_EN1_SHIFT (21U) -/*! REQ53_EN1 - Writing a 1 to REQ53_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ53_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ53_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ53_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ54_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ54_EN1_SHIFT (22U) -/*! REQ54_EN1 - Writing a 1 to REQ54_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ54_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ54_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ54_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ57_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ57_EN1_SHIFT (25U) -/*! REQ57_EN1 - Writing a 1 to REQ57_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ57_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ57_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ57_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ58_EN1_MASK (0x4000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ58_EN1_SHIFT (26U) -/*! REQ58_EN1 - Writing a 1 to REQ58_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ58_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ58_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ58_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ59_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ59_EN1_SHIFT (27U) -/*! REQ59_EN1 - Writing a 1 to REQ59_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ59_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ59_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ59_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ60_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ60_EN1_SHIFT (28U) -/*! REQ60_EN1 - Writing a 1 to REQ60_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ60_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ60_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ60_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ61_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ61_EN1_SHIFT (29U) -/*! REQ61_EN1 - Writing a 1 to REQ61_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ61_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ61_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ61_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ62_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ62_EN1_SHIFT (30U) -/*! REQ62_EN1 - Writing a 1 to REQ62_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ62_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ62_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ62_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ63_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ63_EN1_SHIFT (31U) -/*! REQ63_EN1 - Writing a 1 to REQ63_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ63_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ63_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_SET_REQ63_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE1_CLR - DMA1 Request Enable1 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ32_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ32_EN1_SHIFT (0U) -/*! REQ32_EN1 - Writing a 1 to REQ32_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ32_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ32_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ32_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ33_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ33_EN1_SHIFT (1U) -/*! REQ33_EN1 - Writing a 1 to REQ33_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ33_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ33_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ33_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ34_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ34_EN1_SHIFT (2U) -/*! REQ34_EN1 - Writing a 1 to REQ34_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ34_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ34_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ34_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ35_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ35_EN1_SHIFT (3U) -/*! REQ35_EN1 - Writing a 1 to REQ35_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ35_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ35_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ35_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ36_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ36_EN1_SHIFT (4U) -/*! REQ36_EN1 - Writing a 1 to REQ36_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ36_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ36_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ36_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ37_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ37_EN1_SHIFT (5U) -/*! REQ37_EN1 - Writing a 1 to REQ37_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ37_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ37_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ37_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ38_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ38_EN1_SHIFT (6U) -/*! REQ38_EN1 - Writing a 1 to REQ38_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ38_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ38_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ38_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ39_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ39_EN1_SHIFT (7U) -/*! REQ39_EN1 - Writing a 1 to REQ39_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ39_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ39_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ39_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ40_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ40_EN1_SHIFT (8U) -/*! REQ40_EN1 - Writing a 1 to REQ40_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ40_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ40_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ40_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ41_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ41_EN1_SHIFT (9U) -/*! REQ41_EN1 - Writing a 1 to REQ41_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ41_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ41_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ41_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ42_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ42_EN1_SHIFT (10U) -/*! REQ42_EN1 - Writing a 1 to REQ42_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ42_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ42_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ42_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ43_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ43_EN1_SHIFT (11U) -/*! REQ43_EN1 - Writing a 1 to REQ43_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ43_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ43_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ43_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ44_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ44_EN1_SHIFT (12U) -/*! REQ44_EN1 - Writing a 1 to REQ44_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ44_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ44_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ44_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ45_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ45_EN1_SHIFT (13U) -/*! REQ45_EN1 - Writing a 1 to REQ45_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ45_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ45_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ45_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ46_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ46_EN1_SHIFT (14U) -/*! REQ46_EN1 - Writing a 1 to REQ46_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ46_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ46_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ46_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ47_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ47_EN1_SHIFT (15U) -/*! REQ47_EN1 - Writing a 1 to REQ47_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ47_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ47_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ47_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ48_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ48_EN1_SHIFT (16U) -/*! REQ48_EN1 - Writing a 1 to REQ48_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ48_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ48_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ48_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ49_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ49_EN1_SHIFT (17U) -/*! REQ49_EN1 - Writing a 1 to REQ49_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ49_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ49_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ49_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ50_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ50_EN1_SHIFT (18U) -/*! REQ50_EN1 - Writing a 1 to REQ50_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ50_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ50_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ50_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ51_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ51_EN1_SHIFT (19U) -/*! REQ51_EN1 - Writing a 1 to REQ51_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ51_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ51_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ51_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ52_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ52_EN1_SHIFT (20U) -/*! REQ52_EN1 - Writing a 1 to REQ52_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ52_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ52_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ52_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ53_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ53_EN1_SHIFT (21U) -/*! REQ53_EN1 - Writing a 1 to REQ53_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ53_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ53_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ53_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ54_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ54_EN1_SHIFT (22U) -/*! REQ54_EN1 - Writing a 1 to REQ54_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ54_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ54_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ54_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ57_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ57_EN1_SHIFT (25U) -/*! REQ57_EN1 - Writing a 1 to REQ57_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ57_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ57_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ57_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ58_EN1_MASK (0x4000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ58_EN1_SHIFT (26U) -/*! REQ58_EN1 - Writing a 1 to REQ58_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ58_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ58_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ58_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ59_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ59_EN1_SHIFT (27U) -/*! REQ59_EN1 - Writing a 1 to REQ59_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ59_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ59_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ59_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ60_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ60_EN1_SHIFT (28U) -/*! REQ60_EN1 - Writing a 1 to REQ60_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ60_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ60_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ60_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ61_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ61_EN1_SHIFT (29U) -/*! REQ61_EN1 - Writing a 1 to REQ61_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ61_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ61_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ61_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ62_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ62_EN1_SHIFT (30U) -/*! REQ62_EN1 - Writing a 1 to REQ62_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ62_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ62_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ62_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ63_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ63_EN1_SHIFT (31U) -/*! REQ63_EN1 - Writing a 1 to REQ63_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ63_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ63_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_CLR_REQ63_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE1_TOG - DMA1 Request Enable1 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ32_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ32_EN1_SHIFT (0U) -/*! REQ32_EN1 - Writing a 1 to REQ32_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ32_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ32_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ32_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ33_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ33_EN1_SHIFT (1U) -/*! REQ33_EN1 - Writing a 1 to REQ33_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ33_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ33_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ33_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ34_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ34_EN1_SHIFT (2U) -/*! REQ34_EN1 - Writing a 1 to REQ34_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ34_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ34_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ34_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ35_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ35_EN1_SHIFT (3U) -/*! REQ35_EN1 - Writing a 1 to REQ35_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ35_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ35_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ35_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ36_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ36_EN1_SHIFT (4U) -/*! REQ36_EN1 - Writing a 1 to REQ36_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ36_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ36_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ36_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ37_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ37_EN1_SHIFT (5U) -/*! REQ37_EN1 - Writing a 1 to REQ37_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ37_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ37_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ37_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ38_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ38_EN1_SHIFT (6U) -/*! REQ38_EN1 - Writing a 1 to REQ38_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ38_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ38_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ38_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ39_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ39_EN1_SHIFT (7U) -/*! REQ39_EN1 - Writing a 1 to REQ39_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ39_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ39_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ39_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ40_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ40_EN1_SHIFT (8U) -/*! REQ40_EN1 - Writing a 1 to REQ40_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ40_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ40_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ40_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ41_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ41_EN1_SHIFT (9U) -/*! REQ41_EN1 - Writing a 1 to REQ41_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ41_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ41_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ41_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ42_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ42_EN1_SHIFT (10U) -/*! REQ42_EN1 - Writing a 1 to REQ42_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ42_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ42_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ42_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ43_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ43_EN1_SHIFT (11U) -/*! REQ43_EN1 - Writing a 1 to REQ43_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ43_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ43_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ43_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ44_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ44_EN1_SHIFT (12U) -/*! REQ44_EN1 - Writing a 1 to REQ44_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ44_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ44_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ44_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ45_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ45_EN1_SHIFT (13U) -/*! REQ45_EN1 - Writing a 1 to REQ55_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ45_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ45_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ45_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ46_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ46_EN1_SHIFT (14U) -/*! REQ46_EN1 - Writing a 1 to REQ46_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ46_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ46_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ46_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ47_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ47_EN1_SHIFT (15U) -/*! REQ47_EN1 - Writing a 1 to REQ47_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ47_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ47_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ47_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ48_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ48_EN1_SHIFT (16U) -/*! REQ48_EN1 - Writing a 1 to REQ48_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ48_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ48_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ48_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ49_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ49_EN1_SHIFT (17U) -/*! REQ49_EN1 - Writing a 1 to REQ49_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ49_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ49_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ49_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ50_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ50_EN1_SHIFT (18U) -/*! REQ50_EN1 - Writing a 1 to REQ50_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ50_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ50_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ50_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ51_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ51_EN1_SHIFT (19U) -/*! REQ51_EN1 - Writing a 1 to REQ51_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ51_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ51_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ51_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ52_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ52_EN1_SHIFT (20U) -/*! REQ52_EN1 - Writing a 1 to REQ52_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ52_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ52_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ52_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ53_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ53_EN1_SHIFT (21U) -/*! REQ53_EN1 - Writing a 1 to REQ53_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ53_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ53_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ53_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ54_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ54_EN1_SHIFT (22U) -/*! REQ54_EN1 - Writing a 1 to REQ54_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ54_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ54_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ54_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ57_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ57_EN1_SHIFT (25U) -/*! REQ57_EN1 - Writing a 1 to REQ57_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ57_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ57_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ57_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ58_EN1_MASK (0x4000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ58_EN1_SHIFT (26U) -/*! REQ58_EN1 - Writing a 1 to REQ58_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ58_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ58_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ58_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ59_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ59_EN1_SHIFT (27U) -/*! REQ59_EN1 - Writing a 1 to REQ59_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ59_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ59_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ59_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ60_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ60_EN1_SHIFT (28U) -/*! REQ60_EN1 - Writing a 1 to REQ60_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ60_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ60_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ60_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ61_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ61_EN1_SHIFT (29U) -/*! REQ61_EN1 - Writing a 1 to REQ61_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ61_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ61_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ61_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ62_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ62_EN1_SHIFT (30U) -/*! REQ62_EN1 - Writing a 1 to REQ62_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ62_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ62_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ62_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ63_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ63_EN1_SHIFT (31U) -/*! REQ63_EN1 - Writing a 1 to REQ63_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE1. */ -#define INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ63_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ63_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE1_TOG_REQ63_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE2 - DMA1 Request Enable2 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ64_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ64_EN1_SHIFT (0U) -/*! REQ64_EN1 - This register is used to enable and disable FlexIO0 Shifter3 Status DMA request OR Timer3 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ64_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ64_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ64_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ65_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ65_EN1_SHIFT (1U) -/*! REQ65_EN1 - This register is used to enable and disable FlexIO0 Shifter4 Status DMA request OR Timer4 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ65_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ65_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ65_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ66_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ66_EN1_SHIFT (2U) -/*! REQ66_EN1 - This register is used to enable and disable FlexIO0 Shifter5 Status DMA request OR Timer5 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ66_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ66_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ66_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ67_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ67_EN1_SHIFT (3U) -/*! REQ67_EN1 - This register is used to enable and disable FlexIO0 Shifter6 Status DMA request OR Timer6 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ67_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ67_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ67_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ68_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ68_EN1_SHIFT (4U) -/*! REQ68_EN1 - This register is used to enable and disable FlexIO0 Shifter7 Status DMA request OR Timer7 Status DMA request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ68_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ68_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ68_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ69_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ69_EN1_SHIFT (5U) -/*! REQ69_EN1 - This register is used to enable and disable LP_FLEXCOMM0 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ69_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ69_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ69_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ70_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ70_EN1_SHIFT (6U) -/*! REQ70_EN1 - This register is used to enable and disable LP_FLEXCOMM0 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ70_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ70_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ70_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ71_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ71_EN1_SHIFT (7U) -/*! REQ71_EN1 - This register is used to enable and disable LP_FLEXCOMM1 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ71_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ71_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ71_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ72_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ72_EN1_SHIFT (8U) -/*! REQ72_EN1 - This register is used to enable and disable LP_FLEXCOMM1 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ72_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ72_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ72_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ73_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ73_EN1_SHIFT (9U) -/*! REQ73_EN1 - This register is used to enable and disable LP_FLEXCOMM2 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ73_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ73_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ73_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ74_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ74_EN1_SHIFT (10U) -/*! REQ74_EN1 - This register is used to enable and disable LP_FLEXCOMM2 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ74_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ74_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ74_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ75_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ75_EN1_SHIFT (11U) -/*! REQ75_EN1 - This register is used to enable and disable LP_FLEXCOMM3 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ75_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ75_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ75_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ76_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ76_EN1_SHIFT (12U) -/*! REQ76_EN1 - This register is used to enable and disable LP_FLEXCOMM3 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ76_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ76_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ76_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ77_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ77_EN1_SHIFT (13U) -/*! REQ77_EN1 - This register is used to enable and disable LP_FLEXCOMM4 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ77_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ77_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ77_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ78_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ78_EN1_SHIFT (14U) -/*! REQ78_EN1 - This register is used to enable and disable LP_FLEXCOMM4 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ78_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ78_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ78_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ79_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ79_EN1_SHIFT (15U) -/*! REQ79_EN1 - This register is used to enable and disable LP_FLEXCOMM5 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ79_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ79_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ79_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ80_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ80_EN1_SHIFT (16U) -/*! REQ80_EN1 - This register is used to enable and disable LP_FLEXCOMM5 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ80_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ80_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ80_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ81_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ81_EN1_SHIFT (17U) -/*! REQ81_EN1 - This register is used to enable and disable LP_FLEXCOMM6 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ81_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ81_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ81_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ82_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ82_EN1_SHIFT (18U) -/*! REQ82_EN1 - This register is used to enable and disable LP_FLEXCOMM6 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ82_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ82_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ82_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ83_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ83_EN1_SHIFT (19U) -/*! REQ83_EN1 - This register is used to enable and disable LP_FLEXCOMM7 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ83_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ83_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ83_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ84_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ84_EN1_SHIFT (20U) -/*! REQ84_EN1 - This register is used to enable and disable LP_FLEXCOMM7 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ84_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ84_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ84_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ85_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ85_EN1_SHIFT (21U) -/*! REQ85_EN1 - This register is used to enable and disable LP_FLEXCOMM8 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ85_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ85_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ85_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ86_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ86_EN1_SHIFT (22U) -/*! REQ86_EN1 - This register is used to enable and disable LP_FLEXCOMM8 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ86_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ86_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ86_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ87_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ87_EN1_SHIFT (23U) -/*! REQ87_EN1 - This register is used to enable and disable LP_FLEXCOMM9 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ87_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ87_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ87_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ88_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ88_EN1_SHIFT (24U) -/*! REQ88_EN1 - This register is used to enable and disable LP_FLEXCOMM9 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ88_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ88_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ88_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ91_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ91_EN1_SHIFT (27U) -/*! REQ91_EN1 - This register is used to enable and disable EMVSIM0 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ91_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ91_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ91_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ92_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ92_EN1_SHIFT (28U) -/*! REQ92_EN1 - This register is used to enable and disable EMVSIM0 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ92_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ92_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ92_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ93_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ93_EN1_SHIFT (29U) -/*! REQ93_EN1 - This register is used to enable and disable EMVSIM1 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ93_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ93_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ93_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ94_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ94_EN1_SHIFT (30U) -/*! REQ94_EN1 - This register is used to enable and disable EMVSIM1 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ94_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ94_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ94_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ95_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ95_EN1_SHIFT (31U) -/*! REQ95_EN1 - This register is used to enable and disable I3C0 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE2_REQ95_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_REQ95_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_REQ95_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE2_SET - DMA1 Request Enable2 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ64_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ64_EN1_SHIFT (0U) -/*! REQ64_EN1 - Writing a 1 to REQ64_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ64_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ64_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ64_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ65_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ65_EN1_SHIFT (1U) -/*! REQ65_EN1 - Writing a 1 to REQ65_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ65_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ65_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ65_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ66_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ66_EN1_SHIFT (2U) -/*! REQ66_EN1 - Writing a 1 to REQ66_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ66_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ66_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ66_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ67_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ67_EN1_SHIFT (3U) -/*! REQ67_EN1 - Writing a 1 to REQ67_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ67_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ67_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ67_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ68_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ68_EN1_SHIFT (4U) -/*! REQ68_EN1 - Writing a 1 to REQ68_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ68_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ68_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ68_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ69_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ69_EN1_SHIFT (5U) -/*! REQ69_EN1 - Writing a 1 to REQ69_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ69_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ69_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ69_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ70_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ70_EN1_SHIFT (6U) -/*! REQ70_EN1 - Writing a 1 to REQ70_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ70_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ70_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ70_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ71_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ71_EN1_SHIFT (7U) -/*! REQ71_EN1 - Writing a 1 to REQ71_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ71_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ71_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ71_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ72_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ72_EN1_SHIFT (8U) -/*! REQ72_EN1 - Writing a 1 to REQ72_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ72_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ72_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ72_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ73_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ73_EN1_SHIFT (9U) -/*! REQ73_EN1 - Writing a 1 to REQ73_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ73_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ73_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ73_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ74_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ74_EN1_SHIFT (10U) -/*! REQ74_EN1 - Writing a 1 to REQ74_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ74_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ74_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ74_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ75_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ75_EN1_SHIFT (11U) -/*! REQ75_EN1 - Writing a 1 to REQ75_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ75_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ75_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ75_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ76_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ76_EN1_SHIFT (12U) -/*! REQ76_EN1 - Writing a 1 to REQ876_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ76_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ76_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ76_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ77_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ77_EN1_SHIFT (13U) -/*! REQ77_EN1 - Writing a 1 to REQ77_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ77_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ77_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ77_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ78_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ78_EN1_SHIFT (14U) -/*! REQ78_EN1 - Writing a 1 to REQ78_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ78_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ78_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ78_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ79_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ79_EN1_SHIFT (15U) -/*! REQ79_EN1 - Writing a 1 to REQ79_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ79_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ79_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ79_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ80_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ80_EN1_SHIFT (16U) -/*! REQ80_EN1 - Writing a 1 to REQ80_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ80_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ80_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ80_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ81_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ81_EN1_SHIFT (17U) -/*! REQ81_EN1 - Writing a 1 to REQ81_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ81_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ81_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ81_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ82_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ82_EN1_SHIFT (18U) -/*! REQ82_EN1 - Writing a 1 to REQ82_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ82_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ82_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ82_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ83_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ83_EN1_SHIFT (19U) -/*! REQ83_EN1 - Writing a 1 to REQ83_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ83_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ83_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ83_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ84_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ84_EN1_SHIFT (20U) -/*! REQ84_EN1 - Writing a 1 to REQ84_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ84_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ84_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ84_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ85_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ85_EN1_SHIFT (21U) -/*! REQ85_EN1 - Writing a 1 to REQ85_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ85_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ85_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ85_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ86_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ86_EN1_SHIFT (22U) -/*! REQ86_EN1 - Writing a 1 to REQ86_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ86_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ86_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ86_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ87_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ87_EN1_SHIFT (23U) -/*! REQ87_EN1 - Writing a 1 to REQ87_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ87_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ87_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ87_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ88_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ88_EN1_SHIFT (24U) -/*! REQ88_EN1 - Writing a 1 to REQ88_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ88_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ88_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ88_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ89_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ89_EN1_SHIFT (25U) -/*! REQ89_EN1 - Writing a 1 to REQ89_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ89_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ89_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ89_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ90_EN1_MASK (0x4000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ90_EN1_SHIFT (26U) -/*! REQ90_EN1 - Writing a 1 to REQ90_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ90_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ90_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ90_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ91_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ91_EN1_SHIFT (27U) -/*! REQ91_EN1 - Writing a 1 to REQ91_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ91_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ91_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ91_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ92_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ92_EN1_SHIFT (28U) -/*! REQ92_EN1 - Writing a 1 to REQ92_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ92_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ92_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ92_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ93_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ93_EN1_SHIFT (29U) -/*! REQ93_EN1 - Writing a 1 to REQ93_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ93_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ93_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ93_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ94_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ94_EN1_SHIFT (30U) -/*! REQ94_EN1 - Writing a 1 to REQ94_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ94_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ94_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ94_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ95_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ95_EN1_SHIFT (31U) -/*! REQ95_EN1 - Writing a 1 to REQ95_EN1 in this register sets the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ95_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ95_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_SET_REQ95_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE2_CLR - DMA1 Request Enable2 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ64_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ64_EN1_SHIFT (0U) -/*! REQ64_EN1 - Writing a 1 to REQ64_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ64_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ64_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ64_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ65_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ65_EN1_SHIFT (1U) -/*! REQ65_EN1 - Writing a 1 to REQ65_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ65_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ65_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ65_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ66_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ66_EN1_SHIFT (2U) -/*! REQ66_EN1 - Writing a 1 to REQ66_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ66_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ66_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ66_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ67_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ67_EN1_SHIFT (3U) -/*! REQ67_EN1 - Writing a 1 to REQ67_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ67_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ67_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ67_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ68_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ68_EN1_SHIFT (4U) -/*! REQ68_EN1 - Writing a 1 to REQ68_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ68_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ68_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ68_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ69_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ69_EN1_SHIFT (5U) -/*! REQ69_EN1 - Writing a 1 to REQ69_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ69_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ69_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ69_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ70_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ70_EN1_SHIFT (6U) -/*! REQ70_EN1 - Writing a 1 to REQ70_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ70_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ70_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ70_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ71_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ71_EN1_SHIFT (7U) -/*! REQ71_EN1 - Writing a 1 to REQ71_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ71_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ71_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ71_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ72_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ72_EN1_SHIFT (8U) -/*! REQ72_EN1 - Writing a 1 to REQ72_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ72_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ72_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ72_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ73_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ73_EN1_SHIFT (9U) -/*! REQ73_EN1 - Writing a 1 to REQ73_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ73_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ73_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ73_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ74_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ74_EN1_SHIFT (10U) -/*! REQ74_EN1 - Writing a 1 to REQ74_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ74_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ74_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ74_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ75_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ75_EN1_SHIFT (11U) -/*! REQ75_EN1 - Writing a 1 to REQ75_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ75_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ75_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ75_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ76_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ76_EN1_SHIFT (12U) -/*! REQ76_EN1 - Writing a 1 to REQ76_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ76_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ76_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ76_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ77_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ77_EN1_SHIFT (13U) -/*! REQ77_EN1 - Writing a 1 to REQ77_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ77_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ77_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ77_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ78_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ78_EN1_SHIFT (14U) -/*! REQ78_EN1 - Writing a 1 to REQ78_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ78_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ78_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ78_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ79_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ79_EN1_SHIFT (15U) -/*! REQ79_EN1 - Writing a 1 to REQ79_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ79_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ79_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ79_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ80_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ80_EN1_SHIFT (16U) -/*! REQ80_EN1 - Writing a 1 to REQ80_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ80_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ80_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ80_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ81_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ81_EN1_SHIFT (17U) -/*! REQ81_EN1 - Writing a 1 to REQ81_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ81_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ81_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ81_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ82_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ82_EN1_SHIFT (18U) -/*! REQ82_EN1 - Writing a 1 to REQ82_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ82_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ82_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ82_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ83_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ83_EN1_SHIFT (19U) -/*! REQ83_EN1 - Writing a 1 to REQ83_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ83_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ83_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ83_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ84_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ84_EN1_SHIFT (20U) -/*! REQ84_EN1 - Writing a 1 to REQ84_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ84_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ84_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ84_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ85_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ85_EN1_SHIFT (21U) -/*! REQ85_EN1 - Writing a 1 to REQ85_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ85_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ85_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ85_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ86_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ86_EN1_SHIFT (22U) -/*! REQ86_EN1 - Writing a 1 to REQ86_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ86_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ86_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ86_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ87_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ87_EN1_SHIFT (23U) -/*! REQ87_EN1 - Writing a 1 to REQ87_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ87_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ87_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ87_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ88_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ88_EN1_SHIFT (24U) -/*! REQ88_EN1 - Writing a 1 to REQ88_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ88_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ88_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ88_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ89_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ89_EN1_SHIFT (25U) -/*! REQ89_EN1 - Writing a 1 to REQ89_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ89_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ89_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ89_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ90_EN1_MASK (0x4000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ90_EN1_SHIFT (26U) -/*! REQ90_EN1 - Writing a 1 to REQ90_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ90_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ90_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ90_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ91_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ91_EN1_SHIFT (27U) -/*! REQ91_EN1 - Writing a 1 to REQ91_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ91_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ91_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ91_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ92_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ92_EN1_SHIFT (28U) -/*! REQ92_EN1 - Writing a 1 to REQ92_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ92_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ92_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ92_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ93_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ93_EN1_SHIFT (29U) -/*! REQ93_EN1 - Writing a 1 to REQ93_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ93_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ93_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ93_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ94_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ94_EN1_SHIFT (30U) -/*! REQ94_EN1 - Writing a 1 to REQ94_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ94_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ94_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ94_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ95_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ95_EN1_SHIFT (31U) -/*! REQ95_EN1 - Writing a 1 to REQ95_EN1 in this register clears the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ95_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ95_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_CLR_REQ95_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE2_TOG - DMA1 Request Enable2 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ64_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ64_EN1_SHIFT (0U) -/*! REQ64_EN1 - Writing a 1 to REQ64_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ64_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ64_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ64_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ65_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ65_EN1_SHIFT (1U) -/*! REQ65_EN1 - Writing a 1 to REQ65_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ65_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ65_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ65_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ66_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ66_EN1_SHIFT (2U) -/*! REQ66_EN1 - Writing a 1 to REQ66_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ66_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ66_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ66_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ67_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ67_EN1_SHIFT (3U) -/*! REQ67_EN1 - Writing a 1 to REQ67_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ67_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ67_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ67_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ68_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ68_EN1_SHIFT (4U) -/*! REQ68_EN1 - Writing a 1 to REQ68_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ68_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ68_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ68_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ69_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ69_EN1_SHIFT (5U) -/*! REQ69_EN1 - Writing a 1 to REQ69_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ69_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ69_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ69_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ70_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ70_EN1_SHIFT (6U) -/*! REQ70_EN1 - Writing a 1 to REQ70_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ70_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ70_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ70_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ71_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ71_EN1_SHIFT (7U) -/*! REQ71_EN1 - Writing a 1 to REQ71_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ71_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ71_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ71_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ72_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ72_EN1_SHIFT (8U) -/*! REQ72_EN1 - Writing a 1 to REQ72_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ72_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ72_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ72_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ73_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ73_EN1_SHIFT (9U) -/*! REQ73_EN1 - Writing a 1 to REQ73_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ73_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ73_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ73_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ74_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ74_EN1_SHIFT (10U) -/*! REQ74_EN1 - Writing a 1 to REQ74_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ74_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ74_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ74_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ75_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ75_EN1_SHIFT (11U) -/*! REQ75_EN1 - Writing a 1 to REQ75_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ75_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ75_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ75_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ76_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ76_EN1_SHIFT (12U) -/*! REQ76_EN1 - Writing a 1 to REQ76_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ76_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ76_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ76_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ77_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ77_EN1_SHIFT (13U) -/*! REQ77_EN1 - Writing a 1 to REQ77_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ77_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ77_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ77_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ78_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ78_EN1_SHIFT (14U) -/*! REQ78_EN1 - Writing a 1 to REQ78_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ78_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ78_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ78_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ79_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ79_EN1_SHIFT (15U) -/*! REQ79_EN1 - Writing a 1 to REQ79_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ79_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ79_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ79_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ80_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ80_EN1_SHIFT (16U) -/*! REQ80_EN1 - Writing a 1 to REQ80_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ80_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ80_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ80_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ81_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ81_EN1_SHIFT (17U) -/*! REQ81_EN1 - Writing a 1 to REQ81_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ81_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ81_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ81_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ82_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ82_EN1_SHIFT (18U) -/*! REQ82_EN1 - Writing a 1 to REQ82_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ82_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ82_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ82_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ83_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ83_EN1_SHIFT (19U) -/*! REQ83_EN1 - Writing a 1 to REQ83_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ83_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ83_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ83_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ84_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ84_EN1_SHIFT (20U) -/*! REQ84_EN1 - Writing a 1 to REQ84_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ84_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ84_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ84_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ85_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ85_EN1_SHIFT (21U) -/*! REQ85_EN1 - Writing a 1 to REQ85_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ85_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ85_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ85_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ86_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ86_EN1_SHIFT (22U) -/*! REQ86_EN1 - Writing a 1 to REQ86_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ86_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ86_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ86_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ87_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ87_EN1_SHIFT (23U) -/*! REQ87_EN1 - Writing a 1 to REQ87_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ87_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ87_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ87_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ88_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ88_EN1_SHIFT (24U) -/*! REQ88_EN1 - Writing a 1 to REQ88_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ88_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ88_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ88_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ89_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ89_EN1_SHIFT (25U) -/*! REQ89_EN1 - Writing a 1 to REQ89_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ89_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ89_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ89_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ90_EN1_MASK (0x4000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ90_EN1_SHIFT (26U) -/*! REQ90_EN1 - Writing a 1 to REQ90_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ90_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ90_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ90_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ91_EN1_MASK (0x8000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ91_EN1_SHIFT (27U) -/*! REQ91_EN1 - Writing a 1 to REQ91_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ91_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ91_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ91_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ92_EN1_MASK (0x10000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ92_EN1_SHIFT (28U) -/*! REQ92_EN1 - Writing a 1 to REQ92_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ92_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ92_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ92_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ93_EN1_MASK (0x20000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ93_EN1_SHIFT (29U) -/*! REQ93_EN1 - Writing a 1 to REQ93_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ93_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ93_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ93_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ94_EN1_MASK (0x40000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ94_EN1_SHIFT (30U) -/*! REQ94_EN1 - Writing a 1 to REQ94_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ94_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ94_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ94_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ95_EN1_MASK (0x80000000U) -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ95_EN1_SHIFT (31U) -/*! REQ95_EN1 - Writing a 1 to REQ95_EN1 in this register toggles the corresponding bit in DMA1_REQ_ENABLE2. */ -#define INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ95_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ95_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE2_TOG_REQ95_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE3 - DMA1 Request Enable3 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ96_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ96_EN1_SHIFT (0U) -/*! REQ96_EN1 - This register is used to enable and disable I3C0 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ96_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ96_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ96_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ97_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ97_EN1_SHIFT (1U) -/*! REQ97_EN1 - This register is used to enable and disable I3C1 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ97_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ97_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ97_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ98_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ98_EN1_SHIFT (2U) -/*! REQ98_EN1 - This register is used to enable and disable I3C1 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ98_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ98_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ98_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ99_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ99_EN1_SHIFT (3U) -/*! REQ99_EN1 - This register is used to enable and disable SAI0 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ99_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ99_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ99_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ100_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ100_EN1_SHIFT (4U) -/*! REQ100_EN1 - This register is used to enable and disable SAI0 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ100_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ100_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ100_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ101_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ101_EN1_SHIFT (5U) -/*! REQ101_EN1 - This register is used to enable and disable SAI1 receive request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ101_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ101_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ101_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ102_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ102_EN1_SHIFT (6U) -/*! REQ102_EN1 - This register is used to enable and disable SAI1 transmit request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ102_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ102_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ102_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ103_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ103_EN1_SHIFT (7U) -/*! REQ103_EN1 - This register is used to enable and disable SINC0 ipd_req_sinc[0] or ipd_req_alt [0] request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ103_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ103_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ103_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ104_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ104_EN1_SHIFT (8U) -/*! REQ104_EN1 - This register is used to enable and disable SINC0 ipd_req_sinc[1] or ipd_req_alt [1] request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ104_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ104_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ104_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ105_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ105_EN1_SHIFT (9U) -/*! REQ105_EN1 - This register is used to enable and disable SINC0 ipd_req_sinc[2] or ipd_req_alt [2] request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ105_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ105_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ105_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ106_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ106_EN1_SHIFT (10U) -/*! REQ106_EN1 - This register is used to enable and disable SINC0 ipd_req_sinc[3] or ipd_req_alt [3] request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ106_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ106_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ106_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ107_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ107_EN1_SHIFT (11U) -/*! REQ107_EN1 - This register is used to enable and disable SINC0 ipd_req_sinc[4] or ipd_req_alt [4] request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ107_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ107_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ107_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ108_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ108_EN1_SHIFT (12U) -/*! REQ108_EN1 - This register is used to enable and disable GPIO0 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ108_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ108_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ108_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ109_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ109_EN1_SHIFT (13U) -/*! REQ109_EN1 - This register is used to enable and disable GPIO0 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ109_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ109_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ109_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ110_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ110_EN1_SHIFT (14U) -/*! REQ110_EN1 - This register is used to enable and disable GPIO1 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ110_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ110_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ110_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ111_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ111_EN1_SHIFT (15U) -/*! REQ111_EN1 - This register is used to enable and disable GPIO1 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ111_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ111_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ111_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ112_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ112_EN1_SHIFT (16U) -/*! REQ112_EN1 - This register is used to enable and disable GPIO2 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ112_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ112_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ112_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ113_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ113_EN1_SHIFT (17U) -/*! REQ113_EN1 - This register is used to enable and disable GPIO2 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ113_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ113_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ113_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ114_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ114_EN1_SHIFT (18U) -/*! REQ114_EN1 - This register is used to enable and disable GPIO3 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ114_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ114_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ114_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ115_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ115_EN1_SHIFT (19U) -/*! REQ115_EN1 - This register is used to enable and disable GPIO3 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ115_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ115_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ115_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ116_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ116_EN1_SHIFT (20U) -/*! REQ116_EN1 - This register is used to enable and disable GPIO4 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ116_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ116_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ116_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ117_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ117_EN1_SHIFT (21U) -/*! REQ117_EN1 - This register is used to enable and disable GPIO4 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ117_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ117_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ117_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ118_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ118_EN1_SHIFT (22U) -/*! REQ118_EN1 - This register is used to enable and disable GPIO5 pin event request 0. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ118_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ118_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ118_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ119_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ119_EN1_SHIFT (23U) -/*! REQ119_EN1 - This register is used to enable and disable GPIO5 pin event request 1. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ119_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ119_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ119_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ120_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ120_EN1_SHIFT (24U) -/*! REQ120_EN1 - This register is used to enable and disable TSI0 end of scan request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ120_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ120_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ120_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ121_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ121_EN1_SHIFT (25U) -/*! REQ121_EN1 - This register is used to enable and disable TSI0 out of range request. - * 0b0..Disable - * 0b1..Enable - */ -#define INPUTMUX_DMA1_REQ_ENABLE3_REQ121_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_REQ121_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_REQ121_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE3_SET - DMA1 Request Enable3 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ96_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ96_EN1_SHIFT (0U) -/*! REQ96_EN1 - Writing a 1 to REQ96_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ96_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ96_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ96_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ97_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ97_EN1_SHIFT (1U) -/*! REQ97_EN1 - Writing a 1 to REQ97_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ97_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ97_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ97_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ98_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ98_EN1_SHIFT (2U) -/*! REQ98_EN1 - Writing a 1 to REQ98_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ98_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ98_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ98_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ99_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ99_EN1_SHIFT (3U) -/*! REQ99_EN1 - Writing a 1 to REQ99_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ99_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ99_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ99_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ100_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ100_EN1_SHIFT (4U) -/*! REQ100_EN1 - Writing a 1 to REQ100_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ100_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ100_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ100_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ101_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ101_EN1_SHIFT (5U) -/*! REQ101_EN1 - Writing a 1 to REQ101_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ101_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ101_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ101_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ102_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ102_EN1_SHIFT (6U) -/*! REQ102_EN1 - Writing a 1 to REQ102_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ102_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ102_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ102_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ103_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ103_EN1_SHIFT (7U) -/*! REQ103_EN1 - Writing a 1 to REQ103_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ103_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ103_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ103_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ104_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ104_EN1_SHIFT (8U) -/*! REQ104_EN1 - Writing a 1 to REQ104_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ104_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ104_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ104_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ105_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ105_EN1_SHIFT (9U) -/*! REQ105_EN1 - Writing a 1 to REQ105_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ105_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ105_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ105_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ106_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ106_EN1_SHIFT (10U) -/*! REQ106_EN1 - Writing a 1 to REQ106_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ106_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ106_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ106_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ107_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ107_EN1_SHIFT (11U) -/*! REQ107_EN1 - Writing a 1 to REQ107_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ107_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ107_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ107_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ108_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ108_EN1_SHIFT (12U) -/*! REQ108_EN1 - Writing a 1 to REQ108_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ108_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ108_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ108_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ109_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ109_EN1_SHIFT (13U) -/*! REQ109_EN1 - Writing a 1 to REQ109_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ109_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ109_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ109_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ110_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ110_EN1_SHIFT (14U) -/*! REQ110_EN1 - Writing a 1 to REQ110_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ110_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ110_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ110_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ111_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ111_EN1_SHIFT (15U) -/*! REQ111_EN1 - Writing a 1 to REQ111_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ111_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ111_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ111_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ112_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ112_EN1_SHIFT (16U) -/*! REQ112_EN1 - Writing a 1 to REQ112_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ112_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ112_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ112_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ113_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ113_EN1_SHIFT (17U) -/*! REQ113_EN1 - Writing a 1 to REQ113_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ113_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ113_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ113_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ114_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ114_EN1_SHIFT (18U) -/*! REQ114_EN1 - Writing a 1 to REQ114_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ114_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ114_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ114_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ115_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ115_EN1_SHIFT (19U) -/*! REQ115_EN1 - Writing a 1 to REQ115_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ115_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ115_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ115_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ116_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ116_EN1_SHIFT (20U) -/*! REQ116_EN1 - Writing a 1 to REQ116_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ116_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ116_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ116_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ117_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ117_EN1_SHIFT (21U) -/*! REQ117_EN1 - Writing a 1 to REQ117_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ117_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ117_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ117_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ118_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ118_EN1_SHIFT (22U) -/*! REQ118_EN1 - Writing a 1 to REQ118_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ118_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ118_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ118_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ119_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ119_EN1_SHIFT (23U) -/*! REQ119_EN1 - Writing a 1 to REQ119_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ119_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ119_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ119_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ120_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ120_EN1_SHIFT (24U) -/*! REQ120_EN1 - Writing a 1 to REQ120_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ120_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ120_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ120_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ121_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ121_EN1_SHIFT (25U) -/*! REQ121_EN1 - Writing a 1 to REQ121_EN1 in this register sets the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ121_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ121_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_SET_REQ121_EN1_MASK) -/*! @} */ - -/*! @name DMA1_REQ_ENABLE3_CLR - DMA1 Request Enable3 */ -/*! @{ */ - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ96_EN1_MASK (0x1U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ96_EN1_SHIFT (0U) -/*! REQ96_EN1 - Writing a 1 to REQ96_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ96_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ96_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ96_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ97_EN1_MASK (0x2U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ97_EN1_SHIFT (1U) -/*! REQ97_EN1 - Writing a 1 to REQ97_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ97_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ97_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ97_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ98_EN1_MASK (0x4U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ98_EN1_SHIFT (2U) -/*! REQ98_EN1 - Writing a 1 to REQ98_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ98_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ98_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ98_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ99_EN1_MASK (0x8U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ99_EN1_SHIFT (3U) -/*! REQ99_EN1 - Writing a 1 to REQ99_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ99_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ99_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ99_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ100_EN1_MASK (0x10U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ100_EN1_SHIFT (4U) -/*! REQ100_EN1 - Writing a 1 to REQ100_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ100_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ100_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ100_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ101_EN1_MASK (0x20U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ101_EN1_SHIFT (5U) -/*! REQ101_EN1 - Writing a 1 to REQ101_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ101_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ101_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ101_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ102_EN1_MASK (0x40U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ102_EN1_SHIFT (6U) -/*! REQ102_EN1 - Writing a 1 to REQ102_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ102_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ102_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ102_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ103_EN1_MASK (0x80U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ103_EN1_SHIFT (7U) -/*! REQ103_EN1 - Writing a 1 to REQ103_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ103_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ103_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ103_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ104_EN1_MASK (0x100U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ104_EN1_SHIFT (8U) -/*! REQ104_EN1 - Writing a 1 to REQ104_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ104_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ104_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ104_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ105_EN1_MASK (0x200U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ105_EN1_SHIFT (9U) -/*! REQ105_EN1 - Writing a 1 to REQ105_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ105_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ105_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ105_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ106_EN1_MASK (0x400U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ106_EN1_SHIFT (10U) -/*! REQ106_EN1 - Writing a 1 to REQ106_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ106_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ106_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ106_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ107_EN1_MASK (0x800U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ107_EN1_SHIFT (11U) -/*! REQ107_EN1 - Writing a 1 to REQ107_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ107_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ107_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ107_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ108_EN1_MASK (0x1000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ108_EN1_SHIFT (12U) -/*! REQ108_EN1 - Writing a 1 to REQ108_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ108_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ108_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ108_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ109_EN1_MASK (0x2000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ109_EN1_SHIFT (13U) -/*! REQ109_EN1 - Writing a 1 to REQ109_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ109_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ109_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ109_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ110_EN1_MASK (0x4000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ110_EN1_SHIFT (14U) -/*! REQ110_EN1 - Writing a 1 to REQ110_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ110_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ110_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ110_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ111_EN1_MASK (0x8000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ111_EN1_SHIFT (15U) -/*! REQ111_EN1 - Writing a 1 to REQ111_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ111_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ111_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ111_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ112_EN1_MASK (0x10000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ112_EN1_SHIFT (16U) -/*! REQ112_EN1 - Writing a 1 to REQ112_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ112_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ112_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ112_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ113_EN1_MASK (0x20000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ113_EN1_SHIFT (17U) -/*! REQ113_EN1 - Writing a 1 to REQ113_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ113_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ113_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ113_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ114_EN1_MASK (0x40000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ114_EN1_SHIFT (18U) -/*! REQ114_EN1 - Writing a 1 to REQ114_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ114_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ114_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ114_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ115_EN1_MASK (0x80000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ115_EN1_SHIFT (19U) -/*! REQ115_EN1 - Writing a 1 to REQ115_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ115_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ115_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ115_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ116_EN1_MASK (0x100000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ116_EN1_SHIFT (20U) -/*! REQ116_EN1 - Writing a 1 to REQ116_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ116_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ116_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ116_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ117_EN1_MASK (0x200000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ117_EN1_SHIFT (21U) -/*! REQ117_EN1 - Writing a 1 to REQ117_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ117_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ117_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ117_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ118_EN1_MASK (0x400000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ118_EN1_SHIFT (22U) -/*! REQ118_EN1 - Writing a 1 to REQ118_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ118_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ118_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ118_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ119_EN1_MASK (0x800000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ119_EN1_SHIFT (23U) -/*! REQ119_EN1 - Writing a 1 to REQ119_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ119_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ119_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ119_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ120_EN1_MASK (0x1000000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ120_EN1_SHIFT (24U) -/*! REQ120_EN1 - Writing a 1 to REQ120_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3 */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ120_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ120_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ120_EN1_MASK) - -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ121_EN1_MASK (0x2000000U) -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ121_EN1_SHIFT (25U) -/*! REQ121_EN1 - Writing a 1 to REQ121_EN1 in this register clears the corresponding bit in DMA0_REQ_ENABLE3. */ -#define INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ121_EN1(x) (((uint32_t)(((uint32_t)(x)) << INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ121_EN1_SHIFT)) & INPUTMUX_DMA1_REQ_ENABLE3_CLR_REQ121_EN1_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group INPUTMUX_Register_Masks */ - - -/* INPUTMUX - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral INPUTMUX0 base address */ - #define INPUTMUX0_BASE (0x50006000u) - /** Peripheral INPUTMUX0 base address */ - #define INPUTMUX0_BASE_NS (0x40006000u) - /** Peripheral INPUTMUX0 base pointer */ - #define INPUTMUX0 ((INPUTMUX_Type *)INPUTMUX0_BASE) - /** Peripheral INPUTMUX0 base pointer */ - #define INPUTMUX0_NS ((INPUTMUX_Type *)INPUTMUX0_BASE_NS) - /** Array initializer of INPUTMUX peripheral base addresses */ - #define INPUTMUX_BASE_ADDRS { INPUTMUX0_BASE } - /** Array initializer of INPUTMUX peripheral base pointers */ - #define INPUTMUX_BASE_PTRS { INPUTMUX0 } - /** Array initializer of INPUTMUX peripheral base addresses */ - #define INPUTMUX_BASE_ADDRS_NS { INPUTMUX0_BASE_NS } - /** Array initializer of INPUTMUX peripheral base pointers */ - #define INPUTMUX_BASE_PTRS_NS { INPUTMUX0_NS } -#else - /** Peripheral INPUTMUX0 base address */ - #define INPUTMUX0_BASE (0x40006000u) - /** Peripheral INPUTMUX0 base pointer */ - #define INPUTMUX0 ((INPUTMUX_Type *)INPUTMUX0_BASE) - /** Array initializer of INPUTMUX peripheral base addresses */ - #define INPUTMUX_BASE_ADDRS { INPUTMUX0_BASE } - /** Array initializer of INPUTMUX peripheral base pointers */ - #define INPUTMUX_BASE_PTRS { INPUTMUX0 } -#endif -/* Backward compatibility for INPUTMUX */ -#define INPUTMUX INPUTMUX0 - - -/*! - * @} - */ /* end of group INPUTMUX_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- INTM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup INTM_Peripheral_Access_Layer INTM Peripheral Access Layer - * @{ - */ - -/** INTM - Register Layout Typedef */ -typedef struct { - __IO uint32_t INTM_MM; /**< Monitor Mode, offset: 0x0 */ - __O uint32_t INTM_IACK; /**< Interrupt Acknowledge, offset: 0x4 */ - struct { /* offset: 0x8, array step: 0x10 */ - __IO uint32_t INTM_IRQSEL; /**< Interrupt Request Select for Monitor 0..Interrupt Request Select for Monitor 3, array offset: 0x8, array step: 0x10 */ - __IO uint32_t INTM_LATENCY; /**< Interrupt Latency for Monitor 0..Interrupt Latency for Monitor 3, array offset: 0xC, array step: 0x10 */ - __IO uint32_t INTM_TIMER; /**< Timer for Monitor 0..Timer for Monitor 3, array offset: 0x10, array step: 0x10 */ - __I uint32_t INTM_STATUS; /**< Status for Monitor 0..Status for Monitor 3, array offset: 0x14, array step: 0x10 */ - } MON[4]; -} INTM_Type; - -/* ---------------------------------------------------------------------------- - -- INTM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup INTM_Register_Masks INTM Register Masks - * @{ - */ - -/*! @name INTM_MM - Monitor Mode */ -/*! @{ */ - -#define INTM_INTM_MM_MM_MASK (0x1U) -#define INTM_INTM_MM_MM_SHIFT (0U) -/*! MM - Monitor Mode - * 0b1..Enable - * 0b0..Disable - */ -#define INTM_INTM_MM_MM(x) (((uint32_t)(((uint32_t)(x)) << INTM_INTM_MM_MM_SHIFT)) & INTM_INTM_MM_MM_MASK) -/*! @} */ - -/*! @name INTM_IACK - Interrupt Acknowledge */ -/*! @{ */ - -#define INTM_INTM_IACK_IRQ_MASK (0x3FFU) -#define INTM_INTM_IACK_IRQ_SHIFT (0U) -/*! IRQ - Interrupt Request */ -#define INTM_INTM_IACK_IRQ(x) (((uint32_t)(((uint32_t)(x)) << INTM_INTM_IACK_IRQ_SHIFT)) & INTM_INTM_IACK_IRQ_MASK) -/*! @} */ - -/*! @name MON_INTM_IRQSEL - Interrupt Request Select for Monitor 0..Interrupt Request Select for Monitor 3 */ -/*! @{ */ - -#define INTM_MON_INTM_IRQSEL_IRQ_MASK (0x3FFU) -#define INTM_MON_INTM_IRQSEL_IRQ_SHIFT (0U) -/*! IRQ - Interrupt Request */ -#define INTM_MON_INTM_IRQSEL_IRQ(x) (((uint32_t)(((uint32_t)(x)) << INTM_MON_INTM_IRQSEL_IRQ_SHIFT)) & INTM_MON_INTM_IRQSEL_IRQ_MASK) -/*! @} */ - -/* The count of INTM_MON_INTM_IRQSEL */ -#define INTM_MON_INTM_IRQSEL_COUNT (4U) - -/*! @name MON_INTM_LATENCY - Interrupt Latency for Monitor 0..Interrupt Latency for Monitor 3 */ -/*! @{ */ - -#define INTM_MON_INTM_LATENCY_LAT_MASK (0xFFFFFFU) -#define INTM_MON_INTM_LATENCY_LAT_SHIFT (0U) -/*! LAT - Latency */ -#define INTM_MON_INTM_LATENCY_LAT(x) (((uint32_t)(((uint32_t)(x)) << INTM_MON_INTM_LATENCY_LAT_SHIFT)) & INTM_MON_INTM_LATENCY_LAT_MASK) -/*! @} */ - -/* The count of INTM_MON_INTM_LATENCY */ -#define INTM_MON_INTM_LATENCY_COUNT (4U) - -/*! @name MON_INTM_TIMER - Timer for Monitor 0..Timer for Monitor 3 */ -/*! @{ */ - -#define INTM_MON_INTM_TIMER_TIMER_MASK (0xFFFFFFU) -#define INTM_MON_INTM_TIMER_TIMER_SHIFT (0U) -/*! TIMER - Timer */ -#define INTM_MON_INTM_TIMER_TIMER(x) (((uint32_t)(((uint32_t)(x)) << INTM_MON_INTM_TIMER_TIMER_SHIFT)) & INTM_MON_INTM_TIMER_TIMER_MASK) -/*! @} */ - -/* The count of INTM_MON_INTM_TIMER */ -#define INTM_MON_INTM_TIMER_COUNT (4U) - -/*! @name MON_INTM_STATUS - Status for Monitor 0..Status for Monitor 3 */ -/*! @{ */ - -#define INTM_MON_INTM_STATUS_STATUS_MASK (0x1U) -#define INTM_MON_INTM_STATUS_STATUS_SHIFT (0U) -/*! STATUS - Monitor status - * 0b1..Exceeded - * 0b0..Did not exceed - */ -#define INTM_MON_INTM_STATUS_STATUS(x) (((uint32_t)(((uint32_t)(x)) << INTM_MON_INTM_STATUS_STATUS_SHIFT)) & INTM_MON_INTM_STATUS_STATUS_MASK) -/*! @} */ - -/* The count of INTM_MON_INTM_STATUS */ -#define INTM_MON_INTM_STATUS_COUNT (4U) - - -/*! - * @} - */ /* end of group INTM_Register_Masks */ - - -/* INTM - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral INTM0 base address */ - #define INTM0_BASE (0x5005D000u) - /** Peripheral INTM0 base address */ - #define INTM0_BASE_NS (0x4005D000u) - /** Peripheral INTM0 base pointer */ - #define INTM0 ((INTM_Type *)INTM0_BASE) - /** Peripheral INTM0 base pointer */ - #define INTM0_NS ((INTM_Type *)INTM0_BASE_NS) - /** Array initializer of INTM peripheral base addresses */ - #define INTM_BASE_ADDRS { INTM0_BASE } - /** Array initializer of INTM peripheral base pointers */ - #define INTM_BASE_PTRS { INTM0 } - /** Array initializer of INTM peripheral base addresses */ - #define INTM_BASE_ADDRS_NS { INTM0_BASE_NS } - /** Array initializer of INTM peripheral base pointers */ - #define INTM_BASE_PTRS_NS { INTM0_NS } -#else - /** Peripheral INTM0 base address */ - #define INTM0_BASE (0x4005D000u) - /** Peripheral INTM0 base pointer */ - #define INTM0 ((INTM_Type *)INTM0_BASE) - /** Array initializer of INTM peripheral base addresses */ - #define INTM_BASE_ADDRS { INTM0_BASE } - /** Array initializer of INTM peripheral base pointers */ - #define INTM_BASE_PTRS { INTM0 } -#endif - -/*! - * @} - */ /* end of group INTM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- ITRC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ITRC_Peripheral_Access_Layer ITRC Peripheral Access Layer - * @{ - */ - -/** ITRC - Register Layout Typedef */ -typedef struct { - __IO uint32_t STATUS; /**< ITRC outputs and IN0 to IN15 Status, offset: 0x0 */ - __IO uint32_t STATUS1; /**< ITRC IN16 to IN47 Status, offset: 0x4 */ - __IO uint32_t OUT_SEL[7][2]; /**< Trigger Source IN0 to IN15 selector, array offset: 0x8, array step: index*0x8, index2*0x4 */ - uint8_t RESERVED_0[8]; - __IO uint32_t OUT_SEL_1[7][2]; /**< Trigger Source IN16 to IN31 selector, array offset: 0x48, array step: index*0x8, index2*0x4 */ - uint8_t RESERVED_1[8]; - __IO uint32_t OUT_SEL_2[7][2]; /**< Trigger source IN32 to IN47 selector, array offset: 0x88, array step: index*0x8, index2*0x4 */ - uint8_t RESERVED_2[48]; - __O uint32_t SW_EVENT0; /**< Software event 0, offset: 0xF0 */ - __O uint32_t SW_EVENT1; /**< Software event 1, offset: 0xF4 */ -} ITRC_Type; - -/* ---------------------------------------------------------------------------- - -- ITRC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup ITRC_Register_Masks ITRC Register Masks - * @{ - */ - -/*! @name STATUS - ITRC outputs and IN0 to IN15 Status */ -/*! @{ */ - -#define ITRC_STATUS_IN0_STATUS_MASK (0x1U) -#define ITRC_STATUS_IN0_STATUS_SHIFT (0U) -/*! IN0_STATUS - GDET0 & 1 interrupt. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN0_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN0_STATUS_SHIFT)) & ITRC_STATUS_IN0_STATUS_MASK) - -#define ITRC_STATUS_IN1_STATUS_MASK (0x2U) -#define ITRC_STATUS_IN1_STATUS_SHIFT (1U) -/*! IN1_STATUS - TDET tamper output. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN1_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN1_STATUS_SHIFT)) & ITRC_STATUS_IN1_STATUS_MASK) - -#define ITRC_STATUS_IN2_STATUS_MASK (0x4U) -#define ITRC_STATUS_IN2_STATUS_SHIFT (2U) -/*! IN2_STATUS - Code Watchdog 0 interrupt. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN2_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN2_STATUS_SHIFT)) & ITRC_STATUS_IN2_STATUS_MASK) - -#define ITRC_STATUS_IN3_STATUS_MASK (0x8U) -#define ITRC_STATUS_IN3_STATUS_SHIFT (3U) -/*! IN3_STATUS - VBAT volt tamper output. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN3_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN3_STATUS_SHIFT)) & ITRC_STATUS_IN3_STATUS_MASK) - -#define ITRC_STATUS_IN4_STATUS_MASK (0x10U) -#define ITRC_STATUS_IN4_STATUS_SHIFT (4U) -/*! IN4_STATUS - SPC VDD_CORE_LVD detect. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN4_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN4_STATUS_SHIFT)) & ITRC_STATUS_IN4_STATUS_MASK) - -#define ITRC_STATUS_IN5_STATUS_MASK (0x20U) -#define ITRC_STATUS_IN5_STATUS_SHIFT (5U) -/*! IN5_STATUS - Watch Dog timer event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN5_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN5_STATUS_SHIFT)) & ITRC_STATUS_IN5_STATUS_MASK) - -#define ITRC_STATUS_IN6_STATUS_MASK (0x40U) -#define ITRC_STATUS_IN6_STATUS_SHIFT (6U) -/*! IN6_STATUS - Flash ECC mismatch event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN6_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN6_STATUS_SHIFT)) & ITRC_STATUS_IN6_STATUS_MASK) - -#define ITRC_STATUS_IN7_STATUS_MASK (0x80U) -#define ITRC_STATUS_IN7_STATUS_SHIFT (7U) -/*! IN7_STATUS - AHB secure bus checkers detected illegal access. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN7_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN7_STATUS_SHIFT)) & ITRC_STATUS_IN7_STATUS_MASK) - -#define ITRC_STATUS_IN8_STATUS_MASK (0x100U) -#define ITRC_STATUS_IN8_STATUS_SHIFT (8U) -/*! IN8_STATUS - ELS error event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN8_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN8_STATUS_SHIFT)) & ITRC_STATUS_IN8_STATUS_MASK) - -#define ITRC_STATUS_IN9_STATUS_MASK (0x200U) -#define ITRC_STATUS_IN9_STATUS_SHIFT (9U) -/*! IN9_STATUS - SPC VDD_CORE glitch detect event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN9_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN9_STATUS_SHIFT)) & ITRC_STATUS_IN9_STATUS_MASK) - -#define ITRC_STATUS_IN10_STATUS_MASK (0x400U) -#define ITRC_STATUS_IN10_STATUS_SHIFT (10U) -/*! IN10_STATUS - PKC module detected an error event. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN10_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN10_STATUS_SHIFT)) & ITRC_STATUS_IN10_STATUS_MASK) - -#define ITRC_STATUS_IN11_STATUS_MASK (0x800U) -#define ITRC_STATUS_IN11_STATUS_SHIFT (11U) -/*! IN11_STATUS - Code Watchdog 1 interrupt. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN11_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN11_STATUS_SHIFT)) & ITRC_STATUS_IN11_STATUS_MASK) - -#define ITRC_STATUS_IN112_STATUS_MASK (0x1000U) -#define ITRC_STATUS_IN112_STATUS_SHIFT (12U) -/*! IN112_STATUS - Watchdog 1 timer event interrupt. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN112_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN112_STATUS_SHIFT)) & ITRC_STATUS_IN112_STATUS_MASK) - -#define ITRC_STATUS_IN113_STATUS_MASK (0x2000U) -#define ITRC_STATUS_IN113_STATUS_SHIFT (13U) -/*! IN113_STATUS - FREQME out of range status output. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN113_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN113_STATUS_SHIFT)) & ITRC_STATUS_IN113_STATUS_MASK) - -#define ITRC_STATUS_IN14_STATUS_MASK (0x4000U) -#define ITRC_STATUS_IN14_STATUS_SHIFT (14U) -/*! IN14_STATUS - Software event 0 occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN14_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN14_STATUS_SHIFT)) & ITRC_STATUS_IN14_STATUS_MASK) - -#define ITRC_STATUS_IN15_STATUS_MASK (0x8000U) -#define ITRC_STATUS_IN15_STATUS_SHIFT (15U) -/*! IN15_STATUS - Software event 1 occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_IN15_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_IN15_STATUS_SHIFT)) & ITRC_STATUS_IN15_STATUS_MASK) - -#define ITRC_STATUS_OUT0_STATUS_MASK (0x10000U) -#define ITRC_STATUS_OUT0_STATUS_SHIFT (16U) -/*! OUT0_STATUS - ITRC triggered ITRC_IRQ output. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_OUT0_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_OUT0_STATUS_SHIFT)) & ITRC_STATUS_OUT0_STATUS_MASK) - -#define ITRC_STATUS_OUT1_STATUS_MASK (0x20000U) -#define ITRC_STATUS_OUT1_STATUS_SHIFT (17U) -/*! OUT1_STATUS - ITRC triggered ELS_RESET to clear ELS key store. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_OUT1_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_OUT1_STATUS_SHIFT)) & ITRC_STATUS_OUT1_STATUS_MASK) - -#define ITRC_STATUS_OUT2_STATUS_MASK (0x40000U) -#define ITRC_STATUS_OUT2_STATUS_SHIFT (18U) -/*! OUT2_STATUS - ITRC triggered PUF_ZEROIZE to clear PUF key store and RAM. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_OUT2_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_OUT2_STATUS_SHIFT)) & ITRC_STATUS_OUT2_STATUS_MASK) - -#define ITRC_STATUS_OUT3_STATUS_MASK (0x80000U) -#define ITRC_STATUS_OUT3_STATUS_SHIFT (19U) -/*! OUT3_STATUS - ITRC triggered RAM_ZEROIZE. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_OUT3_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_OUT3_STATUS_SHIFT)) & ITRC_STATUS_OUT3_STATUS_MASK) - -#define ITRC_STATUS_OUT4_STATUS_MASK (0x100000U) -#define ITRC_STATUS_OUT4_STATUS_SHIFT (20U) -/*! OUT4_STATUS - ITRC triggered CHIP_RESET to reset the chip after all other response process finished. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_OUT4_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_OUT4_STATUS_SHIFT)) & ITRC_STATUS_OUT4_STATUS_MASK) - -#define ITRC_STATUS_OUT5_STATUS_MASK (0x200000U) -#define ITRC_STATUS_OUT5_STATUS_SHIFT (21U) -/*! OUT5_STATUS - ITRC triggered TMPR_OUT0 internal signal connected to various on-chip multiplexers. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_OUT5_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_OUT5_STATUS_SHIFT)) & ITRC_STATUS_OUT5_STATUS_MASK) - -#define ITRC_STATUS_OUT6_STATUS_MASK (0x400000U) -#define ITRC_STATUS_OUT6_STATUS_SHIFT (22U) -/*! OUT6_STATUS - ITRC triggered TMPR_OUT1 internal signal connected to various on-chip multiplexers. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS_OUT6_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS_OUT6_STATUS_SHIFT)) & ITRC_STATUS_OUT6_STATUS_MASK) -/*! @} */ - -/*! @name STATUS1 - ITRC IN16 to IN47 Status */ -/*! @{ */ - -#define ITRC_STATUS1_IN16_STATUS_MASK (0x1U) -#define ITRC_STATUS1_IN16_STATUS_SHIFT (0U) -/*! IN16_STATUS - SSPC VDD_SYS_LVD detect event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN16_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN16_STATUS_SHIFT)) & ITRC_STATUS1_IN16_STATUS_MASK) - -#define ITRC_STATUS1_IN17_STATUS_MASK (0x2U) -#define ITRC_STATUS1_IN17_STATUS_SHIFT (1U) -/*! IN17_STATUS - SPC VDD_IO_LVD detect event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN17_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN17_STATUS_SHIFT)) & ITRC_STATUS1_IN17_STATUS_MASK) - -#define ITRC_STATUS1_IN18_STATUS_MASK (0x4U) -#define ITRC_STATUS1_IN18_STATUS_SHIFT (2U) -/*! IN18_STATUS - Reserved - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN18_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN18_STATUS_SHIFT)) & ITRC_STATUS1_IN18_STATUS_MASK) - -#define ITRC_STATUS1_IN19_STATUS_MASK (0x8U) -#define ITRC_STATUS1_IN19_STATUS_SHIFT (3U) -/*! IN19_STATUS - Reserved - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN19_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN19_STATUS_SHIFT)) & ITRC_STATUS1_IN19_STATUS_MASK) - -#define ITRC_STATUS1_IN20_STATUS_MASK (0x10U) -#define ITRC_STATUS1_IN20_STATUS_SHIFT (4U) -/*! IN20_STATUS - VBAT clock tamper output event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN20_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN20_STATUS_SHIFT)) & ITRC_STATUS1_IN20_STATUS_MASK) - -#define ITRC_STATUS1_IN24_21_STATUS_MASK (0x1E0U) -#define ITRC_STATUS1_IN24_21_STATUS_SHIFT (5U) -/*! IN24_21_STATUS - INTM interrupt monitor error 3~0 event occurred. - * 0b0000..Output not triggered. - * 0b0001..Output has been triggered. - */ -#define ITRC_STATUS1_IN24_21_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN24_21_STATUS_SHIFT)) & ITRC_STATUS1_IN24_21_STATUS_MASK) - -#define ITRC_STATUS1_IN32_25_STATUS_MASK (0x1FE00U) -#define ITRC_STATUS1_IN32_25_STATUS_SHIFT (9U) -/*! IN32_25_STATUS - MSF SOCTRIM 7~0 ECC error event occurred. - * 0b00000000..Output not triggered. - * 0b00000001..Output has been triggered. - */ -#define ITRC_STATUS1_IN32_25_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN32_25_STATUS_SHIFT)) & ITRC_STATUS1_IN32_25_STATUS_MASK) - -#define ITRC_STATUS1_IN33_STATUS_MASK (0x20000U) -#define ITRC_STATUS1_IN33_STATUS_SHIFT (17U) -/*! IN33_STATUS - GDET0/1 SFR error event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN33_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN33_STATUS_SHIFT)) & ITRC_STATUS1_IN33_STATUS_MASK) - -#define ITRC_STATUS1_IN34_STATUS_MASK (0x40000U) -#define ITRC_STATUS1_IN34_STATUS_SHIFT (18U) -/*! IN34_STATUS - SPC VDD_CORE high voltage detect event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN34_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN34_STATUS_SHIFT)) & ITRC_STATUS1_IN34_STATUS_MASK) - -#define ITRC_STATUS1_IN35_STATUS_MASK (0x80000U) -#define ITRC_STATUS1_IN35_STATUS_SHIFT (19U) -/*! IN35_STATUS - SPC VDD_SYS_HVD high voltage detect event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN35_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN35_STATUS_SHIFT)) & ITRC_STATUS1_IN35_STATUS_MASK) - -#define ITRC_STATUS1_IN36_STATUS_MASK (0x100000U) -#define ITRC_STATUS1_IN36_STATUS_SHIFT (20U) -/*! IN36_STATUS - SPC VDD_IO high voltage detect event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN36_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN36_STATUS_SHIFT)) & ITRC_STATUS1_IN36_STATUS_MASK) - -#define ITRC_STATUS1_IN37_STATUS_MASK (0x200000U) -#define ITRC_STATUS1_IN37_STATUS_SHIFT (21U) -/*! IN37_STATUS - FLEXSPI GCM error event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN37_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN37_STATUS_SHIFT)) & ITRC_STATUS1_IN37_STATUS_MASK) - -#define ITRC_STATUS1_IN46_STATUS_MASK (0x40000000U) -#define ITRC_STATUS1_IN46_STATUS_SHIFT (30U) -/*! IN46_STATUS - SM3 SGI error event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN46_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN46_STATUS_SHIFT)) & ITRC_STATUS1_IN46_STATUS_MASK) - -#define ITRC_STATUS1_IN47_STATUS_MASK (0x80000000U) -#define ITRC_STATUS1_IN47_STATUS_SHIFT (31U) -/*! IN47_STATUS - TRNG HW error event occurred. - * 0b0..Output not triggered. - * 0b1..Output has been triggered. - */ -#define ITRC_STATUS1_IN47_STATUS(x) (((uint32_t)(((uint32_t)(x)) << ITRC_STATUS1_IN47_STATUS_SHIFT)) & ITRC_STATUS1_IN47_STATUS_MASK) -/*! @} */ - -/*! @name OUTX_SEL_OUTX_SELY_OUT_SEL - Trigger Source IN0 to IN15 selector */ -/*! @{ */ - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN0_SELn_MASK (0x3U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN0_SELn_SHIFT (0U) -/*! IN0_SELn - Selects digital glitch detector as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN0_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN0_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN0_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN1_SELn_MASK (0xCU) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN1_SELn_SHIFT (2U) -/*! IN1_SELn - Selects TDET event as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN1_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN1_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN1_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN2_SELn_MASK (0x30U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN2_SELn_SHIFT (4U) -/*! IN2_SELn - Selects Code Watchdog 0 event as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN2_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN2_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN2_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN3_SELn_MASK (0xC0U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN3_SELn_SHIFT (6U) -/*! IN3_SELn - Selects VBAT voltage tamper event as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN3_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN3_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN3_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN4_SELn_MASK (0x300U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN4_SELn_SHIFT (8U) -/*! IN4_SELn - Selects low-voltage event on VDD_CORE rail as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN4_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN4_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN4_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN5_SELn_MASK (0xC00U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN5_SELn_SHIFT (10U) -/*! IN5_SELn - Selects Watchdog 0 timer event as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN5_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN5_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN5_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN6_SELn_MASK (0x3000U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN6_SELn_SHIFT (12U) -/*! IN6_SELn - Selects Flash ECC mismatch event as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN6_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN6_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN6_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN7_SELn_MASK (0xC000U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN7_SELn_SHIFT (14U) -/*! IN7_SELn - Selects AHB secure bus or MBC bus illegal access event as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN7_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN7_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN7_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN8_SELn_MASK (0x30000U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN8_SELn_SHIFT (16U) -/*! IN8_SELn - Selects ELS error event as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN8_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN8_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN8_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN9_SELn_MASK (0xC0000U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN9_SELn_SHIFT (18U) -/*! IN9_SELn - Selects SPC VDD_CORE glitch detector as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN9_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN9_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN9_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN10_SELn_MASK (0x300000U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN10_SELn_SHIFT (20U) -/*! IN10_SELn - Selects PKC error event as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN10_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN10_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN10_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN11_SELn_MASK (0xC00000U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN11_SELn_SHIFT (22U) -/*! IN11_SELn - Selects Code Watchdog 1 event as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN11_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN11_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN11_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN12_SELn_MASK (0x3000000U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN12_SELn_SHIFT (24U) -/*! IN12_SELn - Selects Watchdog 1 timer event as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN12_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN12_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN12_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN13_SELn_MASK (0xC000000U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN13_SELn_SHIFT (26U) -/*! IN13_SELn - Selects FREQME out of range status output as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN13_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN13_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN13_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN14_SELn_MASK (0x30000000U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN14_SELn_SHIFT (28U) -/*! IN14_SELn - Selects software event 0 as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN14_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN14_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN14_SELn_MASK) - -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN15_SELn_MASK (0xC0000000U) -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN15_SELn_SHIFT (30U) -/*! IN15_SELn - Selects software event 1 as a trigger source. */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN15_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN15_SELn_SHIFT)) & ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN15_SELn_MASK) -/*! @} */ - -/* The count of ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_COUNT (7U) - -/* The count of ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL */ -#define ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_COUNT2 (2U) - -/*! @name OUTX_SEL_1_OUTX_SELY_OUT_SEL_1 - Trigger Source IN16 to IN31 selector */ -/*! @{ */ - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN16_SELn_MASK (0x3U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN16_SELn_SHIFT (0U) -/*! IN16_SELn - Selects SPC VDD_SYS_LVD detect as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN16_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN16_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN16_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN17_SELn_MASK (0xCU) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN17_SELn_SHIFT (2U) -/*! IN17_SELn - Selects SPC VDD_IO_LVD detect as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN17_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN17_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN17_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN18_SELn_MASK (0x30U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN18_SELn_SHIFT (4U) -/*! IN18_SELn - Reserved. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN18_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN18_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN18_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN19_SELn_MASK (0xC0U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN19_SELn_SHIFT (6U) -/*! IN19_SELn - Selects VBAT temperature tamper output event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN19_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN19_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN19_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN20_SELn_MASK (0x300U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN20_SELn_SHIFT (8U) -/*! IN20_SELn - Selects VBAT clock tamper output event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN20_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN20_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN20_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN21_SELn_MASK (0xC00U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN21_SELn_SHIFT (10U) -/*! IN21_SELn - Selects INTM interrupt monitor error 0 event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN21_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN21_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN21_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN22_SELn_MASK (0x3000U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN22_SELn_SHIFT (12U) -/*! IN22_SELn - Selects INTM interrupt monitor error 1 event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN22_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN22_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN22_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN23_SELn_MASK (0xC000U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN23_SELn_SHIFT (14U) -/*! IN23_SELn - Selects INTM interrupt monitor error 2 event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN23_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN23_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN23_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN24_SELn_MASK (0x30000U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN24_SELn_SHIFT (16U) -/*! IN24_SELn - Selects INTM interrupt monitor error 3 event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN24_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN24_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN24_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN25_SELn_MASK (0xC0000U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN25_SELn_SHIFT (18U) -/*! IN25_SELn - Selects MSF SOCTRIM 0 ECC error event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN25_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN25_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN25_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN26_SELn_MASK (0x300000U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN26_SELn_SHIFT (20U) -/*! IN26_SELn - Selects MSF SOCTRIM 1 ECC error event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN26_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN26_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN26_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN27_SELn_MASK (0xC00000U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN27_SELn_SHIFT (22U) -/*! IN27_SELn - Selects MSF SOCTRIM 2 ECC error event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN27_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN27_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN27_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN28_SELn_MASK (0x3000000U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN28_SELn_SHIFT (24U) -/*! IN28_SELn - Selects MSF SOCTRIM 3 ECC error event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN28_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN28_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN28_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN29_SELn_MASK (0xC000000U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN29_SELn_SHIFT (26U) -/*! IN29_SELn - Selects MSF SOCTRIM 4 ECC error event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN29_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN29_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN29_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN30_SELn_MASK (0x30000000U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN30_SELn_SHIFT (28U) -/*! IN30_SELn - Selects MSF SOCTRIM 5 ECC error event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN30_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN30_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN30_SELn_MASK) - -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN31_SELn_MASK (0xC0000000U) -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN31_SELn_SHIFT (30U) -/*! IN31_SELn - Selects MSF SOCTRIM 6 ECC error event as a trigger source. */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN31_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN31_SELn_SHIFT)) & ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN31_SELn_MASK) -/*! @} */ - -/* The count of ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1 */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_COUNT (7U) - -/* The count of ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1 */ -#define ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_COUNT2 (2U) - -/*! @name OUTX_SEL_2_OUTX_SELY_OUT_SEL_2 - Trigger source IN32 to IN47 selector */ -/*! @{ */ - -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN32_SELn_MASK (0x3U) -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN32_SELn_SHIFT (0U) -/*! IN32_SELn - Selects MSF SOCTRIM 7 ECC error event as a trigger source. */ -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN32_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN32_SELn_SHIFT)) & ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN32_SELn_MASK) - -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN33_SELn_MASK (0xCU) -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN33_SELn_SHIFT (2U) -/*! IN33_SELn - Selects GDET0 & 1 SFR error detect as a trigger source. */ -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN33_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN33_SELn_SHIFT)) & ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN33_SELn_MASK) - -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN34_SELn_MASK (0x30U) -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN34_SELn_SHIFT (4U) -/*! IN34_SELn - Selects SPC VDD_CORE_HVD as a trigger source. */ -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN34_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN34_SELn_SHIFT)) & ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN34_SELn_MASK) - -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN35_SELn_MASK (0xC0U) -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN35_SELn_SHIFT (6U) -/*! IN35_SELn - Selects VDD_SYS_HVD as a trigger source. */ -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN35_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN35_SELn_SHIFT)) & ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN35_SELn_MASK) - -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN36_SELn_MASK (0x300U) -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN36_SELn_SHIFT (8U) -/*! IN36_SELn - Selects VDD_IO_HVD as a trigger source. */ -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN36_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN36_SELn_SHIFT)) & ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN36_SELn_MASK) - -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN37_SELn_MASK (0xC00U) -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN37_SELn_SHIFT (10U) -/*! IN37_SELn - Selects FLEXSPI GCM error as a trigger source. */ -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN37_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN37_SELn_SHIFT)) & ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN37_SELn_MASK) - -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN46_SELn_MASK (0x30000000U) -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN46_SELn_SHIFT (28U) -/*! IN46_SELn - Selects SM3 SGI error as a trigger source. */ -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN46_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN46_SELn_SHIFT)) & ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN46_SELn_MASK) - -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN47_SELn_MASK (0xC0000000U) -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN47_SELn_SHIFT (30U) -/*! IN47_SELn - Selects TRNG HW Error as a trigger source. */ -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN47_SELn(x) (((uint32_t)(((uint32_t)(x)) << ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN47_SELn_SHIFT)) & ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN47_SELn_MASK) -/*! @} */ - -/* The count of ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2 */ -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_COUNT (7U) - -/* The count of ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2 */ -#define ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_COUNT2 (2U) - -/*! @name SW_EVENT0 - Software event 0 */ -/*! @{ */ - -#define ITRC_SW_EVENT0_TRIGGER_SW_EVENT_0_MASK (0xFFFFFFFFU) -#define ITRC_SW_EVENT0_TRIGGER_SW_EVENT_0_SHIFT (0U) -/*! TRIGGER_SW_EVENT_0 - Trigger software event 0. */ -#define ITRC_SW_EVENT0_TRIGGER_SW_EVENT_0(x) (((uint32_t)(((uint32_t)(x)) << ITRC_SW_EVENT0_TRIGGER_SW_EVENT_0_SHIFT)) & ITRC_SW_EVENT0_TRIGGER_SW_EVENT_0_MASK) -/*! @} */ - -/*! @name SW_EVENT1 - Software event 1 */ -/*! @{ */ - -#define ITRC_SW_EVENT1_TRIGGER_SW_EVENT_1_MASK (0xFFFFFFFFU) -#define ITRC_SW_EVENT1_TRIGGER_SW_EVENT_1_SHIFT (0U) -/*! TRIGGER_SW_EVENT_1 - Trigger software event 1. */ -#define ITRC_SW_EVENT1_TRIGGER_SW_EVENT_1(x) (((uint32_t)(((uint32_t)(x)) << ITRC_SW_EVENT1_TRIGGER_SW_EVENT_1_SHIFT)) & ITRC_SW_EVENT1_TRIGGER_SW_EVENT_1_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group ITRC_Register_Masks */ - - -/* ITRC - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral ITRC0 base address */ - #define ITRC0_BASE (0x50026000u) - /** Peripheral ITRC0 base address */ - #define ITRC0_BASE_NS (0x40026000u) - /** Peripheral ITRC0 base pointer */ - #define ITRC0 ((ITRC_Type *)ITRC0_BASE) - /** Peripheral ITRC0 base pointer */ - #define ITRC0_NS ((ITRC_Type *)ITRC0_BASE_NS) - /** Array initializer of ITRC peripheral base addresses */ - #define ITRC_BASE_ADDRS { ITRC0_BASE } - /** Array initializer of ITRC peripheral base pointers */ - #define ITRC_BASE_PTRS { ITRC0 } - /** Array initializer of ITRC peripheral base addresses */ - #define ITRC_BASE_ADDRS_NS { ITRC0_BASE_NS } - /** Array initializer of ITRC peripheral base pointers */ - #define ITRC_BASE_PTRS_NS { ITRC0_NS } -#else - /** Peripheral ITRC0 base address */ - #define ITRC0_BASE (0x40026000u) - /** Peripheral ITRC0 base pointer */ - #define ITRC0 ((ITRC_Type *)ITRC0_BASE) - /** Array initializer of ITRC peripheral base addresses */ - #define ITRC_BASE_ADDRS { ITRC0_BASE } - /** Array initializer of ITRC peripheral base pointers */ - #define ITRC_BASE_PTRS { ITRC0 } -#endif - -/*! - * @} - */ /* end of group ITRC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LPCMP Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPCMP_Peripheral_Access_Layer LPCMP Peripheral Access Layer - * @{ - */ - -/** LPCMP - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - __IO uint32_t CCR0; /**< Comparator Control Register 0, offset: 0x8 */ - __IO uint32_t CCR1; /**< Comparator Control Register 1, offset: 0xC */ - __IO uint32_t CCR2; /**< Comparator Control Register 2, offset: 0x10 */ - uint8_t RESERVED_0[4]; - __IO uint32_t DCR; /**< DAC Control, offset: 0x18 */ - __IO uint32_t IER; /**< Interrupt Enable, offset: 0x1C */ - __IO uint32_t CSR; /**< Comparator Status, offset: 0x20 */ - __IO uint32_t RRCR0; /**< Round Robin Control Register 0, offset: 0x24 */ - __IO uint32_t RRCR1; /**< Round Robin Control Register 1, offset: 0x28 */ - __IO uint32_t RRCSR; /**< Round Robin Control and Status, offset: 0x2C */ - __IO uint32_t RRSR; /**< Round Robin Status, offset: 0x30 */ - uint8_t RESERVED_1[4]; - __IO uint32_t RRCR2; /**< Round Robin Control Register 2, offset: 0x38 */ -} LPCMP_Type; - -/* ---------------------------------------------------------------------------- - -- LPCMP Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPCMP_Register_Masks LPCMP Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define LPCMP_VERID_FEATURE_MASK (0xFFFFU) -#define LPCMP_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000001..Round robin feature - */ -#define LPCMP_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_VERID_FEATURE_SHIFT)) & LPCMP_VERID_FEATURE_MASK) - -#define LPCMP_VERID_MINOR_MASK (0xFF0000U) -#define LPCMP_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define LPCMP_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_VERID_MINOR_SHIFT)) & LPCMP_VERID_MINOR_MASK) - -#define LPCMP_VERID_MAJOR_MASK (0xFF000000U) -#define LPCMP_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define LPCMP_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_VERID_MAJOR_SHIFT)) & LPCMP_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define LPCMP_PARAM_DAC_RES_MASK (0xFU) -#define LPCMP_PARAM_DAC_RES_SHIFT (0U) -/*! DAC_RES - DAC Resolution - * 0b0000..4-bit DAC - * 0b0001..6-bit DAC - * 0b0010..8-bit DAC - * 0b0011..10-bit DAC - * 0b0100..12-bit DAC - * 0b0101..14-bit DAC - * 0b0110..16-bit DAC - */ -#define LPCMP_PARAM_DAC_RES(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_PARAM_DAC_RES_SHIFT)) & LPCMP_PARAM_DAC_RES_MASK) -/*! @} */ - -/*! @name CCR0 - Comparator Control Register 0 */ -/*! @{ */ - -#define LPCMP_CCR0_CMP_EN_MASK (0x1U) -#define LPCMP_CCR0_CMP_EN_SHIFT (0U) -/*! CMP_EN - Comparator Enable - * 0b0..Disable (The analog logic remains off and consumes no power.) - * 0b1..Enable - */ -#define LPCMP_CCR0_CMP_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR0_CMP_EN_SHIFT)) & LPCMP_CCR0_CMP_EN_MASK) - -#define LPCMP_CCR0_CMP_STOP_EN_MASK (0x2U) -#define LPCMP_CCR0_CMP_STOP_EN_SHIFT (1U) -/*! CMP_STOP_EN - Comparator Deep sleep Mode Enable - * 0b0..Disables the analog comparator regardless of CMP_EN. - * 0b1..Allows CMP_EN to enable the analog comparator. - */ -#define LPCMP_CCR0_CMP_STOP_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR0_CMP_STOP_EN_SHIFT)) & LPCMP_CCR0_CMP_STOP_EN_MASK) -/*! @} */ - -/*! @name CCR1 - Comparator Control Register 1 */ -/*! @{ */ - -#define LPCMP_CCR1_WINDOW_EN_MASK (0x1U) -#define LPCMP_CCR1_WINDOW_EN_SHIFT (0U) -/*! WINDOW_EN - Windowing Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPCMP_CCR1_WINDOW_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_WINDOW_EN_SHIFT)) & LPCMP_CCR1_WINDOW_EN_MASK) - -#define LPCMP_CCR1_SAMPLE_EN_MASK (0x2U) -#define LPCMP_CCR1_SAMPLE_EN_SHIFT (1U) -/*! SAMPLE_EN - Sampling Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPCMP_CCR1_SAMPLE_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_SAMPLE_EN_SHIFT)) & LPCMP_CCR1_SAMPLE_EN_MASK) - -#define LPCMP_CCR1_DMA_EN_MASK (0x4U) -#define LPCMP_CCR1_DMA_EN_SHIFT (2U) -/*! DMA_EN - DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPCMP_CCR1_DMA_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_DMA_EN_SHIFT)) & LPCMP_CCR1_DMA_EN_MASK) - -#define LPCMP_CCR1_COUT_INV_MASK (0x8U) -#define LPCMP_CCR1_COUT_INV_SHIFT (3U) -/*! COUT_INV - Comparator Invert - * 0b0..Do not invert - * 0b1..Invert - */ -#define LPCMP_CCR1_COUT_INV(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_COUT_INV_SHIFT)) & LPCMP_CCR1_COUT_INV_MASK) - -#define LPCMP_CCR1_COUT_SEL_MASK (0x10U) -#define LPCMP_CCR1_COUT_SEL_SHIFT (4U) -/*! COUT_SEL - Comparator Output Select - * 0b0..Use COUT (filtered) - * 0b1..Use COUTA (unfiltered) - */ -#define LPCMP_CCR1_COUT_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_COUT_SEL_SHIFT)) & LPCMP_CCR1_COUT_SEL_MASK) - -#define LPCMP_CCR1_COUT_PEN_MASK (0x20U) -#define LPCMP_CCR1_COUT_PEN_SHIFT (5U) -/*! COUT_PEN - Comparator Output Pin Enable - * 0b0..Not available - * 0b1..Available - */ -#define LPCMP_CCR1_COUT_PEN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_COUT_PEN_SHIFT)) & LPCMP_CCR1_COUT_PEN_MASK) - -#define LPCMP_CCR1_COUTA_OWEN_MASK (0x40U) -#define LPCMP_CCR1_COUTA_OWEN_SHIFT (6U) -/*! COUTA_OWEN - COUTA_OW Enable - * 0b0..COUTA holds the last sampled value. - * 0b1..Enables the COUTA signal value to be defined by COUTA_OW. - */ -#define LPCMP_CCR1_COUTA_OWEN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_COUTA_OWEN_SHIFT)) & LPCMP_CCR1_COUTA_OWEN_MASK) - -#define LPCMP_CCR1_COUTA_OW_MASK (0x80U) -#define LPCMP_CCR1_COUTA_OW_SHIFT (7U) -/*! COUTA_OW - COUTA Output Level for Closed Window - * 0b0..COUTA is 0 - * 0b1..COUTA is 1 - */ -#define LPCMP_CCR1_COUTA_OW(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_COUTA_OW_SHIFT)) & LPCMP_CCR1_COUTA_OW_MASK) - -#define LPCMP_CCR1_WINDOW_INV_MASK (0x100U) -#define LPCMP_CCR1_WINDOW_INV_SHIFT (8U) -/*! WINDOW_INV - WINDOW/SAMPLE Signal Invert - * 0b0..Do not invert - * 0b1..Invert - */ -#define LPCMP_CCR1_WINDOW_INV(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_WINDOW_INV_SHIFT)) & LPCMP_CCR1_WINDOW_INV_MASK) - -#define LPCMP_CCR1_WINDOW_CLS_MASK (0x200U) -#define LPCMP_CCR1_WINDOW_CLS_SHIFT (9U) -/*! WINDOW_CLS - COUT Event Window Close - * 0b0..COUT event cannot close the window - * 0b1..COUT event can close the window - */ -#define LPCMP_CCR1_WINDOW_CLS(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_WINDOW_CLS_SHIFT)) & LPCMP_CCR1_WINDOW_CLS_MASK) - -#define LPCMP_CCR1_EVT_SEL_MASK (0xC00U) -#define LPCMP_CCR1_EVT_SEL_SHIFT (10U) -/*! EVT_SEL - COUT Event Select - * 0b00..Rising edge - * 0b01..Falling edge - * 0b1x..Both edges - */ -#define LPCMP_CCR1_EVT_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_EVT_SEL_SHIFT)) & LPCMP_CCR1_EVT_SEL_MASK) - -#define LPCMP_CCR1_FUNC_CLK_SEL_MASK (0x3000U) -#define LPCMP_CCR1_FUNC_CLK_SEL_SHIFT (12U) -/*! FUNC_CLK_SEL - Functional Clock Source Select - * 0b00..Select functional clock source 0 - * 0b01..Select functional clock source 1 - * 0b10..Select functional clock source 2 - * 0b11..Select functional clock source 3 - */ -#define LPCMP_CCR1_FUNC_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_FUNC_CLK_SEL_SHIFT)) & LPCMP_CCR1_FUNC_CLK_SEL_MASK) - -#define LPCMP_CCR1_FILT_CNT_MASK (0x70000U) -#define LPCMP_CCR1_FILT_CNT_SHIFT (16U) -/*! FILT_CNT - Filter Sample Count - * 0b000..Filter is bypassed: COUT = COUTA - * 0b001..1 consecutive sample (Comparator output is simply sampled.) - * 0b010..2 consecutive samples - * 0b011..3 consecutive samples - * 0b100..4 consecutive samples - * 0b101..5 consecutive samples - * 0b110..6 consecutive samples - * 0b111..7 consecutive samples - */ -#define LPCMP_CCR1_FILT_CNT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_FILT_CNT_SHIFT)) & LPCMP_CCR1_FILT_CNT_MASK) - -#define LPCMP_CCR1_FILT_PER_MASK (0xFF000000U) -#define LPCMP_CCR1_FILT_PER_SHIFT (24U) -/*! FILT_PER - Filter Sample Period */ -#define LPCMP_CCR1_FILT_PER(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_FILT_PER_SHIFT)) & LPCMP_CCR1_FILT_PER_MASK) -/*! @} */ - -/*! @name CCR2 - Comparator Control Register 2 */ -/*! @{ */ - -#define LPCMP_CCR2_CMP_HPMD_MASK (0x1U) -#define LPCMP_CCR2_CMP_HPMD_SHIFT (0U) -/*! CMP_HPMD - CMP High Power Mode Select - * 0b0..Low power (speed) comparison mode - * 0b1..High power (speed) comparison mode - */ -#define LPCMP_CCR2_CMP_HPMD(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR2_CMP_HPMD_SHIFT)) & LPCMP_CCR2_CMP_HPMD_MASK) - -#define LPCMP_CCR2_CMP_NPMD_MASK (0x2U) -#define LPCMP_CCR2_CMP_NPMD_SHIFT (1U) -/*! CMP_NPMD - CMP Nano Power Mode Select - * 0b0..Disables CMP Nano power mode. CCR2[CMP_HPMD] determines the mode for the comparator. - * 0b1..Enables CMP Nano power mode. - */ -#define LPCMP_CCR2_CMP_NPMD(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR2_CMP_NPMD_SHIFT)) & LPCMP_CCR2_CMP_NPMD_MASK) - -#define LPCMP_CCR2_HYSTCTR_MASK (0x30U) -#define LPCMP_CCR2_HYSTCTR_SHIFT (4U) -/*! HYSTCTR - Comparator Hysteresis Control - * 0b00..Level 0: Analog comparator hysteresis 0 mV. - * 0b01..Level 1: Analog comparator hysteresis 10 mV. - * 0b10..Level 2: Analog comparator hysteresis 20 mV. - * 0b11..Level 3: Analog comparator hysteresis 30 mV. - */ -#define LPCMP_CCR2_HYSTCTR(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR2_HYSTCTR_SHIFT)) & LPCMP_CCR2_HYSTCTR_MASK) - -#define LPCMP_CCR2_PSEL_MASK (0x70000U) -#define LPCMP_CCR2_PSEL_SHIFT (16U) -/*! PSEL - Plus Input MUX Select - * 0b000..Input 0p - * 0b001..Input 1p - * 0b010..Input 2p - * 0b011..Input 3p - * 0b100..Input 4p - * 0b101..Input 5p - * 0b110..Reserved - * 0b111..Internal DAC output - */ -#define LPCMP_CCR2_PSEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR2_PSEL_SHIFT)) & LPCMP_CCR2_PSEL_MASK) - -#define LPCMP_CCR2_MSEL_MASK (0x700000U) -#define LPCMP_CCR2_MSEL_SHIFT (20U) -/*! MSEL - Minus Input MUX Select - * 0b000..Input 0m - * 0b001..Input 1m - * 0b010..Input 2m - * 0b011..Input 3m - * 0b100..Input 4m - * 0b101..Input 5m - * 0b110..Reserved - * 0b111..Internal DAC output - */ -#define LPCMP_CCR2_MSEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR2_MSEL_SHIFT)) & LPCMP_CCR2_MSEL_MASK) -/*! @} */ - -/*! @name DCR - DAC Control */ -/*! @{ */ - -#define LPCMP_DCR_DAC_EN_MASK (0x1U) -#define LPCMP_DCR_DAC_EN_SHIFT (0U) -/*! DAC_EN - DAC Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPCMP_DCR_DAC_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_DCR_DAC_EN_SHIFT)) & LPCMP_DCR_DAC_EN_MASK) - -#define LPCMP_DCR_DAC_HPMD_MASK (0x2U) -#define LPCMP_DCR_DAC_HPMD_SHIFT (1U) -/*! DAC_HPMD - DAC High Power Mode - * 0b0..Disable - * 0b1..Enable - */ -#define LPCMP_DCR_DAC_HPMD(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_DCR_DAC_HPMD_SHIFT)) & LPCMP_DCR_DAC_HPMD_MASK) - -#define LPCMP_DCR_VRSEL_MASK (0x100U) -#define LPCMP_DCR_VRSEL_SHIFT (8U) -/*! VRSEL - DAC Reference High Voltage Source Select - * 0b0..VREFH0 - * 0b1..VREFH1 - */ -#define LPCMP_DCR_VRSEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_DCR_VRSEL_SHIFT)) & LPCMP_DCR_VRSEL_MASK) - -#define LPCMP_DCR_DAC_DATA_MASK (0xFF0000U) -#define LPCMP_DCR_DAC_DATA_SHIFT (16U) -/*! DAC_DATA - DAC Output Voltage Select */ -#define LPCMP_DCR_DAC_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_DCR_DAC_DATA_SHIFT)) & LPCMP_DCR_DAC_DATA_MASK) -/*! @} */ - -/*! @name IER - Interrupt Enable */ -/*! @{ */ - -#define LPCMP_IER_CFR_IE_MASK (0x1U) -#define LPCMP_IER_CFR_IE_SHIFT (0U) -/*! CFR_IE - Comparator Flag Rising Interrupt Enable - * 0b0..Disables the comparator flag rising interrupt. - * 0b1..Enables the comparator flag rising interrupt when CFR is set. - */ -#define LPCMP_IER_CFR_IE(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_IER_CFR_IE_SHIFT)) & LPCMP_IER_CFR_IE_MASK) - -#define LPCMP_IER_CFF_IE_MASK (0x2U) -#define LPCMP_IER_CFF_IE_SHIFT (1U) -/*! CFF_IE - Comparator Flag Falling Interrupt Enable - * 0b0..Disables the comparator flag falling interrupt. - * 0b1..Enables the comparator flag falling interrupt when CFF is set. - */ -#define LPCMP_IER_CFF_IE(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_IER_CFF_IE_SHIFT)) & LPCMP_IER_CFF_IE_MASK) - -#define LPCMP_IER_RRF_IE_MASK (0x4U) -#define LPCMP_IER_RRF_IE_SHIFT (2U) -/*! RRF_IE - Round-Robin Flag Interrupt Enable - * 0b0..Disables the round-robin flag interrupt. - * 0b1..Enables the round-robin flag interrupt when the comparison result changes for a given channel. - */ -#define LPCMP_IER_RRF_IE(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_IER_RRF_IE_SHIFT)) & LPCMP_IER_RRF_IE_MASK) -/*! @} */ - -/*! @name CSR - Comparator Status */ -/*! @{ */ - -#define LPCMP_CSR_CFR_MASK (0x1U) -#define LPCMP_CSR_CFR_SHIFT (0U) -/*! CFR - Analog Comparator Flag Rising - * 0b0..Not detected - * 0b1..Detected - */ -#define LPCMP_CSR_CFR(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CSR_CFR_SHIFT)) & LPCMP_CSR_CFR_MASK) - -#define LPCMP_CSR_CFF_MASK (0x2U) -#define LPCMP_CSR_CFF_SHIFT (1U) -/*! CFF - Analog Comparator Flag Falling - * 0b0..Not detected - * 0b1..Detected - */ -#define LPCMP_CSR_CFF(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CSR_CFF_SHIFT)) & LPCMP_CSR_CFF_MASK) - -#define LPCMP_CSR_RRF_MASK (0x4U) -#define LPCMP_CSR_RRF_SHIFT (2U) -/*! RRF - Round-Robin Flag - * 0b0..Not detected - * 0b1..Detected - */ -#define LPCMP_CSR_RRF(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CSR_RRF_SHIFT)) & LPCMP_CSR_RRF_MASK) - -#define LPCMP_CSR_COUT_MASK (0x100U) -#define LPCMP_CSR_COUT_SHIFT (8U) -/*! COUT - Analog Comparator Output */ -#define LPCMP_CSR_COUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_CSR_COUT_SHIFT)) & LPCMP_CSR_COUT_MASK) -/*! @} */ - -/*! @name RRCR0 - Round Robin Control Register 0 */ -/*! @{ */ - -#define LPCMP_RRCR0_RR_EN_MASK (0x1U) -#define LPCMP_RRCR0_RR_EN_SHIFT (0U) -/*! RR_EN - Round-Robin Enable - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR0_RR_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_EN_SHIFT)) & LPCMP_RRCR0_RR_EN_MASK) - -#define LPCMP_RRCR0_RR_TRG_SEL_MASK (0x2U) -#define LPCMP_RRCR0_RR_TRG_SEL_SHIFT (1U) -/*! RR_TRG_SEL - Round-Robin Trigger Select - * 0b0..External trigger - * 0b1..Internal trigger - */ -#define LPCMP_RRCR0_RR_TRG_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_TRG_SEL_SHIFT)) & LPCMP_RRCR0_RR_TRG_SEL_MASK) - -#define LPCMP_RRCR0_RR_EXTTRG_SEL_MASK (0x3CU) -#define LPCMP_RRCR0_RR_EXTTRG_SEL_SHIFT (2U) -/*! RR_EXTTRG_SEL - External Trigger Source Select - * 0b0000..Select external trigger source 0 - * 0b0001..Select external trigger source 1 - * 0b0010..Select external trigger source 2 - * 0b0011..Select external trigger source 3 - * 0b0100..Select external trigger source 4 - * 0b0101..Select external trigger source 5 - * 0b0110..Select external trigger source 6 - * 0b0111..Select external trigger source 7 - * 0b1000..Select external trigger source 8 - * 0b1001..Select external trigger source 9 - * 0b1010..Select external trigger source 10 - * 0b1011..Select external trigger source 11 - * 0b1100..Select external trigger source 12 - * 0b1101..Select external trigger source 13 - * 0b1110..Select external trigger source 14 - * 0b1111..Select external trigger source 15 - */ -#define LPCMP_RRCR0_RR_EXTTRG_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_EXTTRG_SEL_SHIFT)) & LPCMP_RRCR0_RR_EXTTRG_SEL_MASK) - -#define LPCMP_RRCR0_RR_NSAM_MASK (0x300U) -#define LPCMP_RRCR0_RR_NSAM_SHIFT (8U) -/*! RR_NSAM - Number of Sample Clocks - * 0b00..0 clock - * 0b01..1 clock - * 0b10..2 clocks - * 0b11..3 clocks - */ -#define LPCMP_RRCR0_RR_NSAM(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_NSAM_SHIFT)) & LPCMP_RRCR0_RR_NSAM_MASK) - -#define LPCMP_RRCR0_RR_CLK_SEL_MASK (0x3000U) -#define LPCMP_RRCR0_RR_CLK_SEL_SHIFT (12U) -/*! RR_CLK_SEL - Round Robin Clock Source Select - * 0b00..Select Round Robin clock Source 0 - * 0b01..Select Round Robin clock Source 1 - * 0b10..Select Round Robin clock Source 2 - * 0b11..Select Round Robin clock Source 3 - */ -#define LPCMP_RRCR0_RR_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_CLK_SEL_SHIFT)) & LPCMP_RRCR0_RR_CLK_SEL_MASK) - -#define LPCMP_RRCR0_RR_INITMOD_MASK (0x3F0000U) -#define LPCMP_RRCR0_RR_INITMOD_SHIFT (16U) -/*! RR_INITMOD - Initialization Delay Modulus - * 0b000000..63 cycles (same as 111111b) - * 0b000001-0b111111..1 to 63 cycles - */ -#define LPCMP_RRCR0_RR_INITMOD(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_INITMOD_SHIFT)) & LPCMP_RRCR0_RR_INITMOD_MASK) - -#define LPCMP_RRCR0_RR_SAMPLE_CNT_MASK (0xF000000U) -#define LPCMP_RRCR0_RR_SAMPLE_CNT_SHIFT (24U) -/*! RR_SAMPLE_CNT - Number of Sample for One Channel - * 0b0000..1 samples - * 0b0001..2 samples - * 0b0010..3 samples - * 0b0011..4 samples - * 0b0100..5 samples - * 0b0101..6 samples - * 0b0110..7 samples - * 0b0111..8 samples - * 0b1000..9 samples - * 0b1001..10 samples - * 0b1010..11 samples - * 0b1011..12 samples - * 0b1100..13 samples - * 0b1101..14 samples - * 0b1110..15 samples - * 0b1111..16 samples - */ -#define LPCMP_RRCR0_RR_SAMPLE_CNT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_SAMPLE_CNT_SHIFT)) & LPCMP_RRCR0_RR_SAMPLE_CNT_MASK) - -#define LPCMP_RRCR0_RR_SAMPLE_THRESHOLD_MASK (0xF0000000U) -#define LPCMP_RRCR0_RR_SAMPLE_THRESHOLD_SHIFT (28U) -/*! RR_SAMPLE_THRESHOLD - Sample Time Threshold - * 0b0000..At least 1 sampled "1", the final result is "1" - * 0b0001..At least 2 sampled "1", the final result is "1" - * 0b0010..At least 3 sampled "1", the final result is "1" - * 0b0011..At least 4 sampled "1", the final result is "1" - * 0b0100..At least 5 sampled "1", the final result is "1" - * 0b0101..At least 6 sampled "1", the final result is "1" - * 0b0110..At least 7 sampled "1", the final result is "1" - * 0b0111..At least 8 sampled "1", the final result is "1" - * 0b1000..At least 9 sampled "1", the final result is "1" - * 0b1001..At least 10 sampled "1", the final result is "1" - * 0b1010..At least 11 sampled "1", the final result is "1" - * 0b1011..At least 12 sampled "1", the final result is "1" - * 0b1100..At least 13 sampled "1", the final result is "1" - * 0b1101..At least 14 sampled "1", the final result is "1" - * 0b1110..At least 15 sampled "1", the final result is "1" - * 0b1111..At least 16 sampled "1", the final result is "1" - */ -#define LPCMP_RRCR0_RR_SAMPLE_THRESHOLD(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR0_RR_SAMPLE_THRESHOLD_SHIFT)) & LPCMP_RRCR0_RR_SAMPLE_THRESHOLD_MASK) -/*! @} */ - -/*! @name RRCR1 - Round Robin Control Register 1 */ -/*! @{ */ - -#define LPCMP_RRCR1_RR_CH0EN_MASK (0x1U) -#define LPCMP_RRCR1_RR_CH0EN_SHIFT (0U) -/*! RR_CH0EN - Channel 0 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH0EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH0EN_SHIFT)) & LPCMP_RRCR1_RR_CH0EN_MASK) - -#define LPCMP_RRCR1_RR_CH1EN_MASK (0x2U) -#define LPCMP_RRCR1_RR_CH1EN_SHIFT (1U) -/*! RR_CH1EN - Channel 1 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH1EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH1EN_SHIFT)) & LPCMP_RRCR1_RR_CH1EN_MASK) - -#define LPCMP_RRCR1_RR_CH2EN_MASK (0x4U) -#define LPCMP_RRCR1_RR_CH2EN_SHIFT (2U) -/*! RR_CH2EN - Channel 2 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH2EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH2EN_SHIFT)) & LPCMP_RRCR1_RR_CH2EN_MASK) - -#define LPCMP_RRCR1_RR_CH3EN_MASK (0x8U) -#define LPCMP_RRCR1_RR_CH3EN_SHIFT (3U) -/*! RR_CH3EN - Channel 3 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH3EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH3EN_SHIFT)) & LPCMP_RRCR1_RR_CH3EN_MASK) - -#define LPCMP_RRCR1_RR_CH4EN_MASK (0x10U) -#define LPCMP_RRCR1_RR_CH4EN_SHIFT (4U) -/*! RR_CH4EN - Channel 4 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH4EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH4EN_SHIFT)) & LPCMP_RRCR1_RR_CH4EN_MASK) - -#define LPCMP_RRCR1_RR_CH5EN_MASK (0x20U) -#define LPCMP_RRCR1_RR_CH5EN_SHIFT (5U) -/*! RR_CH5EN - Channel 5 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH5EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH5EN_SHIFT)) & LPCMP_RRCR1_RR_CH5EN_MASK) - -#define LPCMP_RRCR1_RR_CH6EN_MASK (0x40U) -#define LPCMP_RRCR1_RR_CH6EN_SHIFT (6U) -/*! RR_CH6EN - Channel 6 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH6EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH6EN_SHIFT)) & LPCMP_RRCR1_RR_CH6EN_MASK) - -#define LPCMP_RRCR1_RR_CH7EN_MASK (0x80U) -#define LPCMP_RRCR1_RR_CH7EN_SHIFT (7U) -/*! RR_CH7EN - Channel 7 Input Enable in Trigger Mode - * 0b1..Enable - * 0b0..Disable - */ -#define LPCMP_RRCR1_RR_CH7EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_RR_CH7EN_SHIFT)) & LPCMP_RRCR1_RR_CH7EN_MASK) - -#define LPCMP_RRCR1_FIXP_MASK (0x10000U) -#define LPCMP_RRCR1_FIXP_SHIFT (16U) -/*! FIXP - Fixed Port - * 0b0..Fix the plus port. Sweep only the inputs to the minus port. - * 0b1..Fix the minus port. Sweep only the inputs to the plus port. - */ -#define LPCMP_RRCR1_FIXP(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_FIXP_SHIFT)) & LPCMP_RRCR1_FIXP_MASK) - -#define LPCMP_RRCR1_FIXCH_MASK (0x700000U) -#define LPCMP_RRCR1_FIXCH_SHIFT (20U) -/*! FIXCH - Fixed Channel Select - * 0b000..Channel 0 - * 0b001..Channel 1 - * 0b010..Channel 2 - * 0b011..Channel 3 - * 0b100..Channel 4 - * 0b101..Channel 5 - * 0b110..Channel 6 - * 0b111..Channel 7 - */ -#define LPCMP_RRCR1_FIXCH(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR1_FIXCH_SHIFT)) & LPCMP_RRCR1_FIXCH_MASK) -/*! @} */ - -/*! @name RRCSR - Round Robin Control and Status */ -/*! @{ */ - -#define LPCMP_RRCSR_RR_CH0OUT_MASK (0x1U) -#define LPCMP_RRCSR_RR_CH0OUT_SHIFT (0U) -/*! RR_CH0OUT - Comparison Result for Channel 0 */ -#define LPCMP_RRCSR_RR_CH0OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH0OUT_SHIFT)) & LPCMP_RRCSR_RR_CH0OUT_MASK) - -#define LPCMP_RRCSR_RR_CH1OUT_MASK (0x2U) -#define LPCMP_RRCSR_RR_CH1OUT_SHIFT (1U) -/*! RR_CH1OUT - Comparison Result for Channel 1 */ -#define LPCMP_RRCSR_RR_CH1OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH1OUT_SHIFT)) & LPCMP_RRCSR_RR_CH1OUT_MASK) - -#define LPCMP_RRCSR_RR_CH2OUT_MASK (0x4U) -#define LPCMP_RRCSR_RR_CH2OUT_SHIFT (2U) -/*! RR_CH2OUT - Comparison Result for Channel 2 */ -#define LPCMP_RRCSR_RR_CH2OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH2OUT_SHIFT)) & LPCMP_RRCSR_RR_CH2OUT_MASK) - -#define LPCMP_RRCSR_RR_CH3OUT_MASK (0x8U) -#define LPCMP_RRCSR_RR_CH3OUT_SHIFT (3U) -/*! RR_CH3OUT - Comparison Result for Channel 3 */ -#define LPCMP_RRCSR_RR_CH3OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH3OUT_SHIFT)) & LPCMP_RRCSR_RR_CH3OUT_MASK) - -#define LPCMP_RRCSR_RR_CH4OUT_MASK (0x10U) -#define LPCMP_RRCSR_RR_CH4OUT_SHIFT (4U) -/*! RR_CH4OUT - Comparison Result for Channel 4 */ -#define LPCMP_RRCSR_RR_CH4OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH4OUT_SHIFT)) & LPCMP_RRCSR_RR_CH4OUT_MASK) - -#define LPCMP_RRCSR_RR_CH5OUT_MASK (0x20U) -#define LPCMP_RRCSR_RR_CH5OUT_SHIFT (5U) -/*! RR_CH5OUT - Comparison Result for Channel 5 */ -#define LPCMP_RRCSR_RR_CH5OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH5OUT_SHIFT)) & LPCMP_RRCSR_RR_CH5OUT_MASK) - -#define LPCMP_RRCSR_RR_CH6OUT_MASK (0x40U) -#define LPCMP_RRCSR_RR_CH6OUT_SHIFT (6U) -/*! RR_CH6OUT - Comparison Result for Channel 6 */ -#define LPCMP_RRCSR_RR_CH6OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH6OUT_SHIFT)) & LPCMP_RRCSR_RR_CH6OUT_MASK) - -#define LPCMP_RRCSR_RR_CH7OUT_MASK (0x80U) -#define LPCMP_RRCSR_RR_CH7OUT_SHIFT (7U) -/*! RR_CH7OUT - Comparison Result for Channel 7 */ -#define LPCMP_RRCSR_RR_CH7OUT(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCSR_RR_CH7OUT_SHIFT)) & LPCMP_RRCSR_RR_CH7OUT_MASK) -/*! @} */ - -/*! @name RRSR - Round Robin Status */ -/*! @{ */ - -#define LPCMP_RRSR_RR_CH0F_MASK (0x1U) -#define LPCMP_RRSR_RR_CH0F_SHIFT (0U) -/*! RR_CH0F - Channel 0 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH0F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH0F_SHIFT)) & LPCMP_RRSR_RR_CH0F_MASK) - -#define LPCMP_RRSR_RR_CH1F_MASK (0x2U) -#define LPCMP_RRSR_RR_CH1F_SHIFT (1U) -/*! RR_CH1F - Channel 1 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH1F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH1F_SHIFT)) & LPCMP_RRSR_RR_CH1F_MASK) - -#define LPCMP_RRSR_RR_CH2F_MASK (0x4U) -#define LPCMP_RRSR_RR_CH2F_SHIFT (2U) -/*! RR_CH2F - Channel 2 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH2F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH2F_SHIFT)) & LPCMP_RRSR_RR_CH2F_MASK) - -#define LPCMP_RRSR_RR_CH3F_MASK (0x8U) -#define LPCMP_RRSR_RR_CH3F_SHIFT (3U) -/*! RR_CH3F - Channel 3 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH3F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH3F_SHIFT)) & LPCMP_RRSR_RR_CH3F_MASK) - -#define LPCMP_RRSR_RR_CH4F_MASK (0x10U) -#define LPCMP_RRSR_RR_CH4F_SHIFT (4U) -/*! RR_CH4F - Channel 4 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH4F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH4F_SHIFT)) & LPCMP_RRSR_RR_CH4F_MASK) - -#define LPCMP_RRSR_RR_CH5F_MASK (0x20U) -#define LPCMP_RRSR_RR_CH5F_SHIFT (5U) -/*! RR_CH5F - Channel 5 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH5F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH5F_SHIFT)) & LPCMP_RRSR_RR_CH5F_MASK) - -#define LPCMP_RRSR_RR_CH6F_MASK (0x40U) -#define LPCMP_RRSR_RR_CH6F_SHIFT (6U) -/*! RR_CH6F - Channel 6 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH6F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH6F_SHIFT)) & LPCMP_RRSR_RR_CH6F_MASK) - -#define LPCMP_RRSR_RR_CH7F_MASK (0x80U) -#define LPCMP_RRSR_RR_CH7F_SHIFT (7U) -/*! RR_CH7F - Channel 7 Input Changed Flag - * 0b0..No different - * 0b1..Different - */ -#define LPCMP_RRSR_RR_CH7F(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRSR_RR_CH7F_SHIFT)) & LPCMP_RRSR_RR_CH7F_MASK) -/*! @} */ - -/*! @name RRCR2 - Round Robin Control Register 2 */ -/*! @{ */ - -#define LPCMP_RRCR2_RR_TIMER_RELOAD_MASK (0xFFFFFFFU) -#define LPCMP_RRCR2_RR_TIMER_RELOAD_SHIFT (0U) -/*! RR_TIMER_RELOAD - Number of Sample Clocks */ -#define LPCMP_RRCR2_RR_TIMER_RELOAD(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR2_RR_TIMER_RELOAD_SHIFT)) & LPCMP_RRCR2_RR_TIMER_RELOAD_MASK) - -#define LPCMP_RRCR2_RR_TIMER_EN_MASK (0x80000000U) -#define LPCMP_RRCR2_RR_TIMER_EN_SHIFT (31U) -/*! RR_TIMER_EN - Round-Robin Internal Timer Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPCMP_RRCR2_RR_TIMER_EN(x) (((uint32_t)(((uint32_t)(x)) << LPCMP_RRCR2_RR_TIMER_EN_SHIFT)) & LPCMP_RRCR2_RR_TIMER_EN_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group LPCMP_Register_Masks */ - - -/* LPCMP - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral CMP0 base address */ - #define CMP0_BASE (0x50051000u) - /** Peripheral CMP0 base address */ - #define CMP0_BASE_NS (0x40051000u) - /** Peripheral CMP0 base pointer */ - #define CMP0 ((LPCMP_Type *)CMP0_BASE) - /** Peripheral CMP0 base pointer */ - #define CMP0_NS ((LPCMP_Type *)CMP0_BASE_NS) - /** Peripheral CMP1 base address */ - #define CMP1_BASE (0x50052000u) - /** Peripheral CMP1 base address */ - #define CMP1_BASE_NS (0x40052000u) - /** Peripheral CMP1 base pointer */ - #define CMP1 ((LPCMP_Type *)CMP1_BASE) - /** Peripheral CMP1 base pointer */ - #define CMP1_NS ((LPCMP_Type *)CMP1_BASE_NS) - /** Peripheral CMP2 base address */ - #define CMP2_BASE (0x50053000u) - /** Peripheral CMP2 base address */ - #define CMP2_BASE_NS (0x40053000u) - /** Peripheral CMP2 base pointer */ - #define CMP2 ((LPCMP_Type *)CMP2_BASE) - /** Peripheral CMP2 base pointer */ - #define CMP2_NS ((LPCMP_Type *)CMP2_BASE_NS) - /** Array initializer of LPCMP peripheral base addresses */ - #define LPCMP_BASE_ADDRS { CMP0_BASE, CMP1_BASE, CMP2_BASE } - /** Array initializer of LPCMP peripheral base pointers */ - #define LPCMP_BASE_PTRS { CMP0, CMP1, CMP2 } - /** Array initializer of LPCMP peripheral base addresses */ - #define LPCMP_BASE_ADDRS_NS { CMP0_BASE_NS, CMP1_BASE_NS, CMP2_BASE_NS } - /** Array initializer of LPCMP peripheral base pointers */ - #define LPCMP_BASE_PTRS_NS { CMP0_NS, CMP1_NS, CMP2_NS } -#else - /** Peripheral CMP0 base address */ - #define CMP0_BASE (0x40051000u) - /** Peripheral CMP0 base pointer */ - #define CMP0 ((LPCMP_Type *)CMP0_BASE) - /** Peripheral CMP1 base address */ - #define CMP1_BASE (0x40052000u) - /** Peripheral CMP1 base pointer */ - #define CMP1 ((LPCMP_Type *)CMP1_BASE) - /** Peripheral CMP2 base address */ - #define CMP2_BASE (0x40053000u) - /** Peripheral CMP2 base pointer */ - #define CMP2 ((LPCMP_Type *)CMP2_BASE) - /** Array initializer of LPCMP peripheral base addresses */ - #define LPCMP_BASE_ADDRS { CMP0_BASE, CMP1_BASE, CMP2_BASE } - /** Array initializer of LPCMP peripheral base pointers */ - #define LPCMP_BASE_PTRS { CMP0, CMP1, CMP2 } -#endif -/** Interrupt vectors for the LPCMP peripheral type */ -#define LPCMP_IRQS { HSCMP0_IRQn, HSCMP1_IRQn, HSCMP2_IRQn } - -/*! - * @} - */ /* end of group LPCMP_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LPDAC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPDAC_Peripheral_Access_Layer LPDAC Peripheral Access Layer - * @{ - */ - -/** LPDAC - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version Identifier, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - __O uint32_t DATA; /**< Data, offset: 0x8 */ - __IO uint32_t GCR; /**< Global Control, offset: 0xC */ - __IO uint32_t FCR; /**< DAC FIFO Control, offset: 0x10 */ - __I uint32_t FPR; /**< DAC FIFO Pointer, offset: 0x14 */ - __IO uint32_t FSR; /**< FIFO Status, offset: 0x18 */ - __IO uint32_t IER; /**< Interrupt Enable, offset: 0x1C */ - __IO uint32_t DER; /**< DMA Enable, offset: 0x20 */ - __IO uint32_t RCR; /**< Reset Control, offset: 0x24 */ - __O uint32_t TCR; /**< Trigger Control, offset: 0x28 */ - __IO uint32_t PCR; /**< Periodic Trigger Control, offset: 0x2C */ -} LPDAC_Type; - -/* ---------------------------------------------------------------------------- - -- LPDAC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPDAC_Register_Masks LPDAC Register Masks - * @{ - */ - -/*! @name VERID - Version Identifier */ -/*! @{ */ - -#define LPDAC_VERID_FEATURE_MASK (0xFFFFU) -#define LPDAC_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Identification Number */ -#define LPDAC_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_VERID_FEATURE_SHIFT)) & LPDAC_VERID_FEATURE_MASK) - -#define LPDAC_VERID_MINOR_MASK (0xFF0000U) -#define LPDAC_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define LPDAC_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_VERID_MINOR_SHIFT)) & LPDAC_VERID_MINOR_MASK) - -#define LPDAC_VERID_MAJOR_MASK (0xFF000000U) -#define LPDAC_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define LPDAC_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_VERID_MAJOR_SHIFT)) & LPDAC_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define LPDAC_PARAM_FIFOSZ_MASK (0x7U) -#define LPDAC_PARAM_FIFOSZ_SHIFT (0U) -/*! FIFOSZ - FIFO Size - * 0b000..Reserved - * 0b001..FIFO depth is 4 - * 0b010..FIFO depth is 8 - * 0b011..FIFO depth is 16 - * 0b100..FIFO depth is 32 - * 0b101..FIFO depth is 64 - * 0b110..FIFO depth is 128 - * 0b111..FIFO depth is 256 - */ -#define LPDAC_PARAM_FIFOSZ(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_PARAM_FIFOSZ_SHIFT)) & LPDAC_PARAM_FIFOSZ_MASK) -/*! @} */ - -/*! @name DATA - Data */ -/*! @{ */ - -#define LPDAC_DATA_DATA_MASK (0xFFFU) -#define LPDAC_DATA_DATA_SHIFT (0U) -/*! DATA - FIFO Entry or Buffer Entry */ -#define LPDAC_DATA_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_DATA_DATA_SHIFT)) & LPDAC_DATA_DATA_MASK) -/*! @} */ - -/*! @name GCR - Global Control */ -/*! @{ */ - -#define LPDAC_GCR_DACEN_MASK (0x1U) -#define LPDAC_GCR_DACEN_SHIFT (0U) -/*! DACEN - DAC Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_GCR_DACEN(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_DACEN_SHIFT)) & LPDAC_GCR_DACEN_MASK) - -#define LPDAC_GCR_DACRFS_MASK (0x6U) -#define LPDAC_GCR_DACRFS_SHIFT (1U) -/*! DACRFS - DAC Reference Select - * 0b00..Selects VREFH0 as the reference voltage. - * 0b01..Selects VREFH1 as the reference voltage. - * 0b10..Selects VREFH2 as the reference voltage. - * 0b11..Reserved. - */ -#define LPDAC_GCR_DACRFS(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_DACRFS_SHIFT)) & LPDAC_GCR_DACRFS_MASK) - -#define LPDAC_GCR_FIFOEN_MASK (0x8U) -#define LPDAC_GCR_FIFOEN_SHIFT (3U) -/*! FIFOEN - FIFO Enable - * 0b0..Enables FIFO mode and disables Buffer mode. Any data written to DATA[DATA] goes to buffer then goes to conversion. - * 0b1..Enables FIFO mode. Data will be first read from FIFO to buffer and then goes to conversion. - */ -#define LPDAC_GCR_FIFOEN(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_FIFOEN_SHIFT)) & LPDAC_GCR_FIFOEN_MASK) - -#define LPDAC_GCR_SWMD_MASK (0x10U) -#define LPDAC_GCR_SWMD_SHIFT (4U) -/*! SWMD - Swing Back Mode - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_GCR_SWMD(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_SWMD_SHIFT)) & LPDAC_GCR_SWMD_MASK) - -#define LPDAC_GCR_TRGSEL_MASK (0x20U) -#define LPDAC_GCR_TRGSEL_SHIFT (5U) -/*! TRGSEL - DAC Trigger Select - * 0b0..Hardware trigger - * 0b1..Software trigger - */ -#define LPDAC_GCR_TRGSEL(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_TRGSEL_SHIFT)) & LPDAC_GCR_TRGSEL_MASK) - -#define LPDAC_GCR_PTGEN_MASK (0x40U) -#define LPDAC_GCR_PTGEN_SHIFT (6U) -/*! PTGEN - DAC Periodic Trigger Mode Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_GCR_PTGEN(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_PTGEN_SHIFT)) & LPDAC_GCR_PTGEN_MASK) - -#define LPDAC_GCR_LATCH_CYC_MASK (0xF00U) -#define LPDAC_GCR_LATCH_CYC_SHIFT (8U) -/*! LATCH_CYC - RCLK Cycles Before Data Latch */ -#define LPDAC_GCR_LATCH_CYC(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_LATCH_CYC_SHIFT)) & LPDAC_GCR_LATCH_CYC_MASK) - -#define LPDAC_GCR_BUF_EN_MASK (0x20000U) -#define LPDAC_GCR_BUF_EN_SHIFT (17U) -/*! BUF_EN - Buffer Enable - * 0b0..Not used - * 0b1..Used - */ -#define LPDAC_GCR_BUF_EN(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_BUF_EN_SHIFT)) & LPDAC_GCR_BUF_EN_MASK) - -#define LPDAC_GCR_IREF_PTAT_EXT_SEL_MASK (0x100000U) -#define LPDAC_GCR_IREF_PTAT_EXT_SEL_SHIFT (20U) -/*! IREF_PTAT_EXT_SEL - External On-Chip PTAT Current Reference Select - * 0b0..Not selected - * 0b1..Selected - */ -#define LPDAC_GCR_IREF_PTAT_EXT_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_IREF_PTAT_EXT_SEL_SHIFT)) & LPDAC_GCR_IREF_PTAT_EXT_SEL_MASK) - -#define LPDAC_GCR_IREF_ZTC_EXT_SEL_MASK (0x200000U) -#define LPDAC_GCR_IREF_ZTC_EXT_SEL_SHIFT (21U) -/*! IREF_ZTC_EXT_SEL - External On-Chip ZTC Current Reference Select - * 0b0..Not selected - * 0b1..Selected - */ -#define LPDAC_GCR_IREF_ZTC_EXT_SEL(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_IREF_ZTC_EXT_SEL_SHIFT)) & LPDAC_GCR_IREF_ZTC_EXT_SEL_MASK) - -#define LPDAC_GCR_BUF_SPD_CTRL_MASK (0x800000U) -#define LPDAC_GCR_BUF_SPD_CTRL_SHIFT (23U) -/*! BUF_SPD_CTRL - OPAMP as Buffer, Speed Control Signal - * 0b0..Lower Low-Power mode - * 0b1..Low-Power mode - */ -#define LPDAC_GCR_BUF_SPD_CTRL(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_GCR_BUF_SPD_CTRL_SHIFT)) & LPDAC_GCR_BUF_SPD_CTRL_MASK) -/*! @} */ - -/*! @name FCR - DAC FIFO Control */ -/*! @{ */ - -#define LPDAC_FCR_WML_MASK (0xFU) -#define LPDAC_FCR_WML_SHIFT (0U) -/*! WML - Watermark Level */ -#define LPDAC_FCR_WML(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_FCR_WML_SHIFT)) & LPDAC_FCR_WML_MASK) -/*! @} */ - -/*! @name FPR - DAC FIFO Pointer */ -/*! @{ */ - -#define LPDAC_FPR_FIFO_RPT_MASK (0xFU) -#define LPDAC_FPR_FIFO_RPT_SHIFT (0U) -/*! FIFO_RPT - FIFO Read Pointer */ -#define LPDAC_FPR_FIFO_RPT(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_FPR_FIFO_RPT_SHIFT)) & LPDAC_FPR_FIFO_RPT_MASK) - -#define LPDAC_FPR_FIFO_WPT_MASK (0xF0000U) -#define LPDAC_FPR_FIFO_WPT_SHIFT (16U) -/*! FIFO_WPT - FIFO Write Pointer */ -#define LPDAC_FPR_FIFO_WPT(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_FPR_FIFO_WPT_SHIFT)) & LPDAC_FPR_FIFO_WPT_MASK) -/*! @} */ - -/*! @name FSR - FIFO Status */ -/*! @{ */ - -#define LPDAC_FSR_FULL_MASK (0x1U) -#define LPDAC_FSR_FULL_SHIFT (0U) -/*! FULL - FIFO Full Flag - * 0b0..Not full - * 0b1..Full - */ -#define LPDAC_FSR_FULL(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_FSR_FULL_SHIFT)) & LPDAC_FSR_FULL_MASK) - -#define LPDAC_FSR_EMPTY_MASK (0x2U) -#define LPDAC_FSR_EMPTY_SHIFT (1U) -/*! EMPTY - FIFO Empty Flag - * 0b0..Not empty - * 0b1..Empty - */ -#define LPDAC_FSR_EMPTY(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_FSR_EMPTY_SHIFT)) & LPDAC_FSR_EMPTY_MASK) - -#define LPDAC_FSR_WM_MASK (0x4U) -#define LPDAC_FSR_WM_SHIFT (2U) -/*! WM - FIFO Watermark Status Flag - * 0b0..Data in FIFO is more than watermark level - * 0b1..Data in FIFO is less than or equal to watermark level - */ -#define LPDAC_FSR_WM(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_FSR_WM_SHIFT)) & LPDAC_FSR_WM_MASK) - -#define LPDAC_FSR_SWBK_MASK (0x8U) -#define LPDAC_FSR_SWBK_SHIFT (3U) -/*! SWBK - Swing Back One Cycle Complete Flag - * 0b0..No swing back cycle has completed since the last time the flag was cleared - * 0b1..At least one swing back cycle has occurred since the last time the flag was cleared - */ -#define LPDAC_FSR_SWBK(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_FSR_SWBK_SHIFT)) & LPDAC_FSR_SWBK_MASK) - -#define LPDAC_FSR_OF_MASK (0x40U) -#define LPDAC_FSR_OF_SHIFT (6U) -/*! OF - FIFO Overflow Flag - * 0b0..No overflow has occurred since the last time the flag was cleared - * 0b1..At least one FIFO overflow has occurred since the last time the flag was cleared - */ -#define LPDAC_FSR_OF(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_FSR_OF_SHIFT)) & LPDAC_FSR_OF_MASK) - -#define LPDAC_FSR_UF_MASK (0x80U) -#define LPDAC_FSR_UF_SHIFT (7U) -/*! UF - FIFO Underflow Flag - * 0b0..No underflow has occurred since the last time the flag was cleared - * 0b1..At least one trigger underflow has occurred since the last time the flag was cleared - */ -#define LPDAC_FSR_UF(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_FSR_UF_SHIFT)) & LPDAC_FSR_UF_MASK) - -#define LPDAC_FSR_PTGCOCO_MASK (0x100U) -#define LPDAC_FSR_PTGCOCO_SHIFT (8U) -/*! PTGCOCO - Period Trigger Mode Conversion Complete Flag - * 0b0..Not completed or not started - * 0b1..Completed - */ -#define LPDAC_FSR_PTGCOCO(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_FSR_PTGCOCO_SHIFT)) & LPDAC_FSR_PTGCOCO_MASK) -/*! @} */ - -/*! @name IER - Interrupt Enable */ -/*! @{ */ - -#define LPDAC_IER_FULL_IE_MASK (0x1U) -#define LPDAC_IER_FULL_IE_SHIFT (0U) -/*! FULL_IE - FIFO Full Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_IER_FULL_IE(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_IER_FULL_IE_SHIFT)) & LPDAC_IER_FULL_IE_MASK) - -#define LPDAC_IER_EMPTY_IE_MASK (0x2U) -#define LPDAC_IER_EMPTY_IE_SHIFT (1U) -/*! EMPTY_IE - FIFO Empty Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_IER_EMPTY_IE(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_IER_EMPTY_IE_SHIFT)) & LPDAC_IER_EMPTY_IE_MASK) - -#define LPDAC_IER_WM_IE_MASK (0x4U) -#define LPDAC_IER_WM_IE_SHIFT (2U) -/*! WM_IE - FIFO Watermark Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_IER_WM_IE(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_IER_WM_IE_SHIFT)) & LPDAC_IER_WM_IE_MASK) - -#define LPDAC_IER_SWBK_IE_MASK (0x8U) -#define LPDAC_IER_SWBK_IE_SHIFT (3U) -/*! SWBK_IE - Swing Back One Cycle Complete Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_IER_SWBK_IE(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_IER_SWBK_IE_SHIFT)) & LPDAC_IER_SWBK_IE_MASK) - -#define LPDAC_IER_OF_IE_MASK (0x40U) -#define LPDAC_IER_OF_IE_SHIFT (6U) -/*! OF_IE - FIFO Overflow Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_IER_OF_IE(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_IER_OF_IE_SHIFT)) & LPDAC_IER_OF_IE_MASK) - -#define LPDAC_IER_UF_IE_MASK (0x80U) -#define LPDAC_IER_UF_IE_SHIFT (7U) -/*! UF_IE - FIFO Underflow Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_IER_UF_IE(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_IER_UF_IE_SHIFT)) & LPDAC_IER_UF_IE_MASK) - -#define LPDAC_IER_PTGCOCO_IE_MASK (0x100U) -#define LPDAC_IER_PTGCOCO_IE_SHIFT (8U) -/*! PTGCOCO_IE - PTG Mode Conversion Complete Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_IER_PTGCOCO_IE(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_IER_PTGCOCO_IE_SHIFT)) & LPDAC_IER_PTGCOCO_IE_MASK) -/*! @} */ - -/*! @name DER - DMA Enable */ -/*! @{ */ - -#define LPDAC_DER_EMPTY_DMAEN_MASK (0x2U) -#define LPDAC_DER_EMPTY_DMAEN_SHIFT (1U) -/*! EMPTY_DMAEN - FIFO Empty DMA Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_DER_EMPTY_DMAEN(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_DER_EMPTY_DMAEN_SHIFT)) & LPDAC_DER_EMPTY_DMAEN_MASK) - -#define LPDAC_DER_WM_DMAEN_MASK (0x4U) -#define LPDAC_DER_WM_DMAEN_SHIFT (2U) -/*! WM_DMAEN - FIFO Watermark DMA Enable - * 0b0..Disables - * 0b1..Enables - */ -#define LPDAC_DER_WM_DMAEN(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_DER_WM_DMAEN_SHIFT)) & LPDAC_DER_WM_DMAEN_MASK) -/*! @} */ - -/*! @name RCR - Reset Control */ -/*! @{ */ - -#define LPDAC_RCR_SWRST_MASK (0x1U) -#define LPDAC_RCR_SWRST_SHIFT (0U) -/*! SWRST - Software Reset - * 0b0..No effect - * 0b1..Software reset - */ -#define LPDAC_RCR_SWRST(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_RCR_SWRST_SHIFT)) & LPDAC_RCR_SWRST_MASK) - -#define LPDAC_RCR_FIFORST_MASK (0x2U) -#define LPDAC_RCR_FIFORST_SHIFT (1U) -/*! FIFORST - FIFO Reset - * 0b0..No effect - * 0b1..FIFO reset - */ -#define LPDAC_RCR_FIFORST(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_RCR_FIFORST_SHIFT)) & LPDAC_RCR_FIFORST_MASK) -/*! @} */ - -/*! @name TCR - Trigger Control */ -/*! @{ */ - -#define LPDAC_TCR_SWTRG_MASK (0x1U) -#define LPDAC_TCR_SWTRG_SHIFT (0U) -/*! SWTRG - Software Trigger - * 0b0..Not valid - * 0b1..Valid - */ -#define LPDAC_TCR_SWTRG(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_TCR_SWTRG_SHIFT)) & LPDAC_TCR_SWTRG_MASK) -/*! @} */ - -/*! @name PCR - Periodic Trigger Control */ -/*! @{ */ - -#define LPDAC_PCR_PTG_NUM_MASK (0xFFFFU) -#define LPDAC_PCR_PTG_NUM_SHIFT (0U) -/*! PTG_NUM - Periodic Trigger Number */ -#define LPDAC_PCR_PTG_NUM(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_PCR_PTG_NUM_SHIFT)) & LPDAC_PCR_PTG_NUM_MASK) - -#define LPDAC_PCR_PTG_PERIOD_MASK (0xFFFF0000U) -#define LPDAC_PCR_PTG_PERIOD_SHIFT (16U) -/*! PTG_PERIOD - Periodic Trigger Period Width */ -#define LPDAC_PCR_PTG_PERIOD(x) (((uint32_t)(((uint32_t)(x)) << LPDAC_PCR_PTG_PERIOD_SHIFT)) & LPDAC_PCR_PTG_PERIOD_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group LPDAC_Register_Masks */ - - -/* LPDAC - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral DAC0 base address */ - #define DAC0_BASE (0x5010F000u) - /** Peripheral DAC0 base address */ - #define DAC0_BASE_NS (0x4010F000u) - /** Peripheral DAC0 base pointer */ - #define DAC0 ((LPDAC_Type *)DAC0_BASE) - /** Peripheral DAC0 base pointer */ - #define DAC0_NS ((LPDAC_Type *)DAC0_BASE_NS) - /** Peripheral DAC1 base address */ - #define DAC1_BASE (0x50112000u) - /** Peripheral DAC1 base address */ - #define DAC1_BASE_NS (0x40112000u) - /** Peripheral DAC1 base pointer */ - #define DAC1 ((LPDAC_Type *)DAC1_BASE) - /** Peripheral DAC1 base pointer */ - #define DAC1_NS ((LPDAC_Type *)DAC1_BASE_NS) - /** Array initializer of LPDAC peripheral base addresses */ - #define LPDAC_BASE_ADDRS { DAC0_BASE, DAC1_BASE } - /** Array initializer of LPDAC peripheral base pointers */ - #define LPDAC_BASE_PTRS { DAC0, DAC1 } - /** Array initializer of LPDAC peripheral base addresses */ - #define LPDAC_BASE_ADDRS_NS { DAC0_BASE_NS, DAC1_BASE_NS } - /** Array initializer of LPDAC peripheral base pointers */ - #define LPDAC_BASE_PTRS_NS { DAC0_NS, DAC1_NS } -#else - /** Peripheral DAC0 base address */ - #define DAC0_BASE (0x4010F000u) - /** Peripheral DAC0 base pointer */ - #define DAC0 ((LPDAC_Type *)DAC0_BASE) - /** Peripheral DAC1 base address */ - #define DAC1_BASE (0x40112000u) - /** Peripheral DAC1 base pointer */ - #define DAC1 ((LPDAC_Type *)DAC1_BASE) - /** Array initializer of LPDAC peripheral base addresses */ - #define LPDAC_BASE_ADDRS { DAC0_BASE, DAC1_BASE } - /** Array initializer of LPDAC peripheral base pointers */ - #define LPDAC_BASE_PTRS { DAC0, DAC1 } -#endif -/** Interrupt vectors for the LPDAC peripheral type */ -#define LPDAC_IRQS { DAC0_IRQn, DAC1_IRQn } - -/*! - * @} - */ /* end of group LPDAC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LPI2C Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPI2C_Peripheral_Access_Layer LPI2C Peripheral Access Layer - * @{ - */ - -/** LPI2C - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - uint8_t RESERVED_0[8]; - __IO uint32_t MCR; /**< Controller Control, offset: 0x10 */ - __IO uint32_t MSR; /**< Controller Status, offset: 0x14 */ - __IO uint32_t MIER; /**< Controller Interrupt Enable, offset: 0x18 */ - __IO uint32_t MDER; /**< Controller DMA Enable, offset: 0x1C */ - __IO uint32_t MCFGR0; /**< Controller Configuration 0, offset: 0x20 */ - __IO uint32_t MCFGR1; /**< Controller Configuration 1, offset: 0x24 */ - __IO uint32_t MCFGR2; /**< Controller Configuration 2, offset: 0x28 */ - __IO uint32_t MCFGR3; /**< Controller Configuration 3, offset: 0x2C */ - uint8_t RESERVED_1[16]; - __IO uint32_t MDMR; /**< Controller Data Match, offset: 0x40 */ - uint8_t RESERVED_2[4]; - __IO uint32_t MCCR0; /**< Controller Clock Configuration 0, offset: 0x48 */ - uint8_t RESERVED_3[4]; - __IO uint32_t MCCR1; /**< Controller Clock Configuration 1, offset: 0x50 */ - uint8_t RESERVED_4[4]; - __IO uint32_t MFCR; /**< Controller FIFO Control, offset: 0x58 */ - __I uint32_t MFSR; /**< Controller FIFO Status, offset: 0x5C */ - __O uint32_t MTDR; /**< Controller Transmit Data, offset: 0x60 */ - uint8_t RESERVED_5[12]; - __I uint32_t MRDR; /**< Controller Receive Data, offset: 0x70 */ - uint8_t RESERVED_6[4]; - __I uint32_t MRDROR; /**< Controller Receive Data Read Only, offset: 0x78 */ - uint8_t RESERVED_7[148]; - __IO uint32_t SCR; /**< Target Control, offset: 0x110 */ - __IO uint32_t SSR; /**< Target Status, offset: 0x114 */ - __IO uint32_t SIER; /**< Target Interrupt Enable, offset: 0x118 */ - __IO uint32_t SDER; /**< Target DMA Enable, offset: 0x11C */ - __IO uint32_t SCFGR0; /**< Target Configuration 0, offset: 0x120 */ - __IO uint32_t SCFGR1; /**< Target Configuration 1, offset: 0x124 */ - __IO uint32_t SCFGR2; /**< Target Configuration 2, offset: 0x128 */ - uint8_t RESERVED_8[20]; - __IO uint32_t SAMR; /**< Target Address Match, offset: 0x140 */ - uint8_t RESERVED_9[12]; - __I uint32_t SASR; /**< Target Address Status, offset: 0x150 */ - __IO uint32_t STAR; /**< Target Transmit ACK, offset: 0x154 */ - uint8_t RESERVED_10[8]; - __O uint32_t STDR; /**< Target Transmit Data, offset: 0x160 */ - uint8_t RESERVED_11[12]; - __I uint32_t SRDR; /**< Target Receive Data, offset: 0x170 */ - uint8_t RESERVED_12[4]; - __I uint32_t SRDROR; /**< Target Receive Data Read Only, offset: 0x178 */ - uint8_t RESERVED_13[132]; - __O uint32_t MTCBR[128]; /**< Controller Transmit Command Burst, array offset: 0x200, array step: 0x4 */ - __O uint32_t MTDBR[253]; /**< Transmit Data Burst, array offset: 0x400, array step: 0x4 */ -} LPI2C_Type; - -/* ---------------------------------------------------------------------------- - -- LPI2C Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPI2C_Register_Masks LPI2C Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define LPI2C_VERID_FEATURE_MASK (0xFFFFU) -#define LPI2C_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000010..Controller only, with standard feature set - * 0b0000000000000011..Controller and target, with standard feature set - */ -#define LPI2C_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_VERID_FEATURE_SHIFT)) & LPI2C_VERID_FEATURE_MASK) - -#define LPI2C_VERID_MINOR_MASK (0xFF0000U) -#define LPI2C_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define LPI2C_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_VERID_MINOR_SHIFT)) & LPI2C_VERID_MINOR_MASK) - -#define LPI2C_VERID_MAJOR_MASK (0xFF000000U) -#define LPI2C_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define LPI2C_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_VERID_MAJOR_SHIFT)) & LPI2C_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define LPI2C_PARAM_MTXFIFO_MASK (0xFU) -#define LPI2C_PARAM_MTXFIFO_SHIFT (0U) -/*! MTXFIFO - Controller Transmit FIFO Size */ -#define LPI2C_PARAM_MTXFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_PARAM_MTXFIFO_SHIFT)) & LPI2C_PARAM_MTXFIFO_MASK) - -#define LPI2C_PARAM_MRXFIFO_MASK (0xF00U) -#define LPI2C_PARAM_MRXFIFO_SHIFT (8U) -/*! MRXFIFO - Controller Receive FIFO Size */ -#define LPI2C_PARAM_MRXFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_PARAM_MRXFIFO_SHIFT)) & LPI2C_PARAM_MRXFIFO_MASK) -/*! @} */ - -/*! @name MCR - Controller Control */ -/*! @{ */ - -#define LPI2C_MCR_MEN_MASK (0x1U) -#define LPI2C_MCR_MEN_SHIFT (0U) -/*! MEN - Controller Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MCR_MEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCR_MEN_SHIFT)) & LPI2C_MCR_MEN_MASK) - -#define LPI2C_MCR_RST_MASK (0x2U) -#define LPI2C_MCR_RST_SHIFT (1U) -/*! RST - Software Reset - * 0b0..No effect - * 0b1..Reset - */ -#define LPI2C_MCR_RST(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCR_RST_SHIFT)) & LPI2C_MCR_RST_MASK) - -#define LPI2C_MCR_DOZEN_MASK (0x4U) -#define LPI2C_MCR_DOZEN_SHIFT (2U) -/*! DOZEN - Doze Mode Enable - * 0b0..Enable - * 0b1..Disable - */ -#define LPI2C_MCR_DOZEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCR_DOZEN_SHIFT)) & LPI2C_MCR_DOZEN_MASK) - -#define LPI2C_MCR_DBGEN_MASK (0x8U) -#define LPI2C_MCR_DBGEN_SHIFT (3U) -/*! DBGEN - Debug Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MCR_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCR_DBGEN_SHIFT)) & LPI2C_MCR_DBGEN_MASK) - -#define LPI2C_MCR_RTF_MASK (0x100U) -#define LPI2C_MCR_RTF_SHIFT (8U) -/*! RTF - Reset Transmit FIFO - * 0b0..No effect - * 0b1..Reset transmit FIFO - */ -#define LPI2C_MCR_RTF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCR_RTF_SHIFT)) & LPI2C_MCR_RTF_MASK) - -#define LPI2C_MCR_RRF_MASK (0x200U) -#define LPI2C_MCR_RRF_SHIFT (9U) -/*! RRF - Reset Receive FIFO - * 0b0..No effect - * 0b1..Reset receive FIFO - */ -#define LPI2C_MCR_RRF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCR_RRF_SHIFT)) & LPI2C_MCR_RRF_MASK) -/*! @} */ - -/*! @name MSR - Controller Status */ -/*! @{ */ - -#define LPI2C_MSR_TDF_MASK (0x1U) -#define LPI2C_MSR_TDF_SHIFT (0U) -/*! TDF - Transmit Data Flag - * 0b0..Transmit data not requested - * 0b1..Transmit data requested - */ -#define LPI2C_MSR_TDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_TDF_SHIFT)) & LPI2C_MSR_TDF_MASK) - -#define LPI2C_MSR_RDF_MASK (0x2U) -#define LPI2C_MSR_RDF_SHIFT (1U) -/*! RDF - Receive Data Flag - * 0b0..Receive data not ready - * 0b1..Receive data ready - */ -#define LPI2C_MSR_RDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_RDF_SHIFT)) & LPI2C_MSR_RDF_MASK) - -#define LPI2C_MSR_EPF_MASK (0x100U) -#define LPI2C_MSR_EPF_SHIFT (8U) -/*! EPF - End Packet Flag - * 0b0..No Stop or repeated Start generated - * 0b1..Stop or repeated Start generated - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_EPF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_EPF_SHIFT)) & LPI2C_MSR_EPF_MASK) - -#define LPI2C_MSR_SDF_MASK (0x200U) -#define LPI2C_MSR_SDF_SHIFT (9U) -/*! SDF - Stop Detect Flag - * 0b0..No Stop condition generated - * 0b1..Stop condition generated - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_SDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_SDF_SHIFT)) & LPI2C_MSR_SDF_MASK) - -#define LPI2C_MSR_NDF_MASK (0x400U) -#define LPI2C_MSR_NDF_SHIFT (10U) -/*! NDF - NACK Detect Flag - * 0b0..No unexpected NACK detected - * 0b1..Unexpected NACK detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_NDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_NDF_SHIFT)) & LPI2C_MSR_NDF_MASK) - -#define LPI2C_MSR_ALF_MASK (0x800U) -#define LPI2C_MSR_ALF_SHIFT (11U) -/*! ALF - Arbitration Lost Flag - * 0b0..Controller did not lose arbitration - * 0b1..Controller lost arbitration - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_ALF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_ALF_SHIFT)) & LPI2C_MSR_ALF_MASK) - -#define LPI2C_MSR_FEF_MASK (0x1000U) -#define LPI2C_MSR_FEF_SHIFT (12U) -/*! FEF - FIFO Error Flag - * 0b0..No FIFO error - * 0b1..FIFO error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_FEF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_FEF_SHIFT)) & LPI2C_MSR_FEF_MASK) - -#define LPI2C_MSR_PLTF_MASK (0x2000U) -#define LPI2C_MSR_PLTF_SHIFT (13U) -/*! PLTF - Pin Low Timeout Flag - * 0b0..Pin low timeout did not occur - * 0b1..Pin low timeout occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_PLTF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_PLTF_SHIFT)) & LPI2C_MSR_PLTF_MASK) - -#define LPI2C_MSR_DMF_MASK (0x4000U) -#define LPI2C_MSR_DMF_SHIFT (14U) -/*! DMF - Data Match Flag - * 0b0..Matching data not received - * 0b1..Matching data received - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_DMF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_DMF_SHIFT)) & LPI2C_MSR_DMF_MASK) - -#define LPI2C_MSR_STF_MASK (0x8000U) -#define LPI2C_MSR_STF_SHIFT (15U) -/*! STF - Start Flag - * 0b0..Start condition not detected - * 0b1..Start condition detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_MSR_STF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_STF_SHIFT)) & LPI2C_MSR_STF_MASK) - -#define LPI2C_MSR_MBF_MASK (0x1000000U) -#define LPI2C_MSR_MBF_SHIFT (24U) -/*! MBF - Controller Busy Flag - * 0b0..Idle - * 0b1..Busy - */ -#define LPI2C_MSR_MBF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_MBF_SHIFT)) & LPI2C_MSR_MBF_MASK) - -#define LPI2C_MSR_BBF_MASK (0x2000000U) -#define LPI2C_MSR_BBF_SHIFT (25U) -/*! BBF - Bus Busy Flag - * 0b0..Idle - * 0b1..Busy - */ -#define LPI2C_MSR_BBF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MSR_BBF_SHIFT)) & LPI2C_MSR_BBF_MASK) -/*! @} */ - -/*! @name MIER - Controller Interrupt Enable */ -/*! @{ */ - -#define LPI2C_MIER_TDIE_MASK (0x1U) -#define LPI2C_MIER_TDIE_SHIFT (0U) -/*! TDIE - Transmit Data Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_TDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_TDIE_SHIFT)) & LPI2C_MIER_TDIE_MASK) - -#define LPI2C_MIER_RDIE_MASK (0x2U) -#define LPI2C_MIER_RDIE_SHIFT (1U) -/*! RDIE - Receive Data Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_RDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_RDIE_SHIFT)) & LPI2C_MIER_RDIE_MASK) - -#define LPI2C_MIER_EPIE_MASK (0x100U) -#define LPI2C_MIER_EPIE_SHIFT (8U) -/*! EPIE - End Packet Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_EPIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_EPIE_SHIFT)) & LPI2C_MIER_EPIE_MASK) - -#define LPI2C_MIER_SDIE_MASK (0x200U) -#define LPI2C_MIER_SDIE_SHIFT (9U) -/*! SDIE - Stop Detect Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_SDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_SDIE_SHIFT)) & LPI2C_MIER_SDIE_MASK) - -#define LPI2C_MIER_NDIE_MASK (0x400U) -#define LPI2C_MIER_NDIE_SHIFT (10U) -/*! NDIE - NACK Detect Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_NDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_NDIE_SHIFT)) & LPI2C_MIER_NDIE_MASK) - -#define LPI2C_MIER_ALIE_MASK (0x800U) -#define LPI2C_MIER_ALIE_SHIFT (11U) -/*! ALIE - Arbitration Lost Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_ALIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_ALIE_SHIFT)) & LPI2C_MIER_ALIE_MASK) - -#define LPI2C_MIER_FEIE_MASK (0x1000U) -#define LPI2C_MIER_FEIE_SHIFT (12U) -/*! FEIE - FIFO Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_FEIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_FEIE_SHIFT)) & LPI2C_MIER_FEIE_MASK) - -#define LPI2C_MIER_PLTIE_MASK (0x2000U) -#define LPI2C_MIER_PLTIE_SHIFT (13U) -/*! PLTIE - Pin Low Timeout Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_PLTIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_PLTIE_SHIFT)) & LPI2C_MIER_PLTIE_MASK) - -#define LPI2C_MIER_DMIE_MASK (0x4000U) -#define LPI2C_MIER_DMIE_SHIFT (14U) -/*! DMIE - Data Match Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_DMIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_DMIE_SHIFT)) & LPI2C_MIER_DMIE_MASK) - -#define LPI2C_MIER_STIE_MASK (0x8000U) -#define LPI2C_MIER_STIE_SHIFT (15U) -/*! STIE - Start Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MIER_STIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MIER_STIE_SHIFT)) & LPI2C_MIER_STIE_MASK) -/*! @} */ - -/*! @name MDER - Controller DMA Enable */ -/*! @{ */ - -#define LPI2C_MDER_TDDE_MASK (0x1U) -#define LPI2C_MDER_TDDE_SHIFT (0U) -/*! TDDE - Transmit Data DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MDER_TDDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MDER_TDDE_SHIFT)) & LPI2C_MDER_TDDE_MASK) - -#define LPI2C_MDER_RDDE_MASK (0x2U) -#define LPI2C_MDER_RDDE_SHIFT (1U) -/*! RDDE - Receive Data DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MDER_RDDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MDER_RDDE_SHIFT)) & LPI2C_MDER_RDDE_MASK) -/*! @} */ - -/*! @name MCFGR0 - Controller Configuration 0 */ -/*! @{ */ - -#define LPI2C_MCFGR0_HREN_MASK (0x1U) -#define LPI2C_MCFGR0_HREN_SHIFT (0U) -/*! HREN - Host Request Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MCFGR0_HREN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_HREN_SHIFT)) & LPI2C_MCFGR0_HREN_MASK) - -#define LPI2C_MCFGR0_HRPOL_MASK (0x2U) -#define LPI2C_MCFGR0_HRPOL_SHIFT (1U) -/*! HRPOL - Host Request Polarity - * 0b0..Active low - * 0b1..Active high - */ -#define LPI2C_MCFGR0_HRPOL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_HRPOL_SHIFT)) & LPI2C_MCFGR0_HRPOL_MASK) - -#define LPI2C_MCFGR0_HRSEL_MASK (0x4U) -#define LPI2C_MCFGR0_HRSEL_SHIFT (2U) -/*! HRSEL - Host Request Select - * 0b0..Host request input is pin HREQ - * 0b1..Host request input is input trigger - */ -#define LPI2C_MCFGR0_HRSEL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_HRSEL_SHIFT)) & LPI2C_MCFGR0_HRSEL_MASK) - -#define LPI2C_MCFGR0_HRDIR_MASK (0x8U) -#define LPI2C_MCFGR0_HRDIR_SHIFT (3U) -/*! HRDIR - Host Request Direction - * 0b0..HREQ pin is input (for LPI2C controller) - * 0b1..HREQ pin is output (for LPI2C target) - */ -#define LPI2C_MCFGR0_HRDIR(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_HRDIR_SHIFT)) & LPI2C_MCFGR0_HRDIR_MASK) - -#define LPI2C_MCFGR0_CIRFIFO_MASK (0x100U) -#define LPI2C_MCFGR0_CIRFIFO_SHIFT (8U) -/*! CIRFIFO - Circular FIFO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_MCFGR0_CIRFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_CIRFIFO_SHIFT)) & LPI2C_MCFGR0_CIRFIFO_MASK) - -#define LPI2C_MCFGR0_RDMO_MASK (0x200U) -#define LPI2C_MCFGR0_RDMO_SHIFT (9U) -/*! RDMO - Receive Data Match Only - * 0b0..Received data is stored in the receive FIFO - * 0b1..Received data is discarded unless MSR[DMF] is set - */ -#define LPI2C_MCFGR0_RDMO(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_RDMO_SHIFT)) & LPI2C_MCFGR0_RDMO_MASK) - -#define LPI2C_MCFGR0_RELAX_MASK (0x10000U) -#define LPI2C_MCFGR0_RELAX_SHIFT (16U) -/*! RELAX - Relaxed Mode - * 0b0..Normal transfer - * 0b1..Relaxed transfer - */ -#define LPI2C_MCFGR0_RELAX(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_RELAX_SHIFT)) & LPI2C_MCFGR0_RELAX_MASK) - -#define LPI2C_MCFGR0_ABORT_MASK (0x20000U) -#define LPI2C_MCFGR0_ABORT_SHIFT (17U) -/*! ABORT - Abort Transfer - * 0b0..Normal transfer - * 0b1..Abort existing transfer and do not start a new one - */ -#define LPI2C_MCFGR0_ABORT(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR0_ABORT_SHIFT)) & LPI2C_MCFGR0_ABORT_MASK) -/*! @} */ - -/*! @name MCFGR1 - Controller Configuration 1 */ -/*! @{ */ - -#define LPI2C_MCFGR1_PRESCALE_MASK (0x7U) -#define LPI2C_MCFGR1_PRESCALE_SHIFT (0U) -/*! PRESCALE - Prescaler - * 0b000..Divide by 1 - * 0b001..Divide by 2 - * 0b010..Divide by 4 - * 0b011..Divide by 8 - * 0b100..Divide by 16 - * 0b101..Divide by 32 - * 0b110..Divide by 64 - * 0b111..Divide by 128 - */ -#define LPI2C_MCFGR1_PRESCALE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_PRESCALE_SHIFT)) & LPI2C_MCFGR1_PRESCALE_MASK) - -#define LPI2C_MCFGR1_AUTOSTOP_MASK (0x100U) -#define LPI2C_MCFGR1_AUTOSTOP_SHIFT (8U) -/*! AUTOSTOP - Automatic Stop Generation - * 0b0..No effect - * 0b1..Stop automatically generated - */ -#define LPI2C_MCFGR1_AUTOSTOP(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_AUTOSTOP_SHIFT)) & LPI2C_MCFGR1_AUTOSTOP_MASK) - -#define LPI2C_MCFGR1_IGNACK_MASK (0x200U) -#define LPI2C_MCFGR1_IGNACK_SHIFT (9U) -/*! IGNACK - Ignore NACK - * 0b0..No effect - * 0b1..Treat a received NACK as an ACK - */ -#define LPI2C_MCFGR1_IGNACK(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_IGNACK_SHIFT)) & LPI2C_MCFGR1_IGNACK_MASK) - -#define LPI2C_MCFGR1_TIMECFG_MASK (0x400U) -#define LPI2C_MCFGR1_TIMECFG_SHIFT (10U) -/*! TIMECFG - Timeout Configuration - * 0b0..SCL - * 0b1..SCL or SDA - */ -#define LPI2C_MCFGR1_TIMECFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_TIMECFG_SHIFT)) & LPI2C_MCFGR1_TIMECFG_MASK) - -#define LPI2C_MCFGR1_STOPCFG_MASK (0x800U) -#define LPI2C_MCFGR1_STOPCFG_SHIFT (11U) -/*! STOPCFG - Stop Configuration - * 0b0..Any Stop condition - * 0b1..Last Stop condition - */ -#define LPI2C_MCFGR1_STOPCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_STOPCFG_SHIFT)) & LPI2C_MCFGR1_STOPCFG_MASK) - -#define LPI2C_MCFGR1_STARTCFG_MASK (0x1000U) -#define LPI2C_MCFGR1_STARTCFG_SHIFT (12U) -/*! STARTCFG - Start Configuration - * 0b0..Sets when both I2C bus and LPI2C controller are idle - * 0b1..Sets when I2C bus is idle - */ -#define LPI2C_MCFGR1_STARTCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_STARTCFG_SHIFT)) & LPI2C_MCFGR1_STARTCFG_MASK) - -#define LPI2C_MCFGR1_MATCFG_MASK (0x70000U) -#define LPI2C_MCFGR1_MATCFG_SHIFT (16U) -/*! MATCFG - Match Configuration - * 0b000..Match is disabled - * 0b001..Reserved - * 0b010..Match is enabled: first data word equals MDMR[MATCH0] OR MDMR[MATCH1] - * 0b011..Match is enabled: any data word equals MDMR[MATCH0] OR MDMR[MATCH1] - * 0b100..Match is enabled: (first data word equals MDMR[MATCH0]) AND (second data word equals MDMR[MATCH1) - * 0b101..Match is enabled: (any data word equals MDMR[MATCH0]) AND (next data word equals MDMR[MATCH1) - * 0b110..Match is enabled: (first data word AND MDMR[MATCH1]) equals (MDMR[MATCH0] AND MDMR[MATCH1]) - * 0b111..Match is enabled: (any data word AND MDMR[MATCH1]) equals (MDMR[MATCH0] AND MDMR[MATCH1]) - */ -#define LPI2C_MCFGR1_MATCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_MATCFG_SHIFT)) & LPI2C_MCFGR1_MATCFG_MASK) - -#define LPI2C_MCFGR1_PINCFG_MASK (0x7000000U) -#define LPI2C_MCFGR1_PINCFG_SHIFT (24U) -/*! PINCFG - Pin Configuration - * 0b000..Two-pin open drain mode - * 0b001..Two-pin output only mode (Ultra-Fast mode) - * 0b010..Two-pin push-pull mode - * 0b011..Four-pin push-pull mode - * 0b100..Two-pin open-drain mode with separate LPI2C target - * 0b101..Two-pin output only mode (Ultra-Fast mode) with separate LPI2C target - * 0b110..Two-pin push-pull mode with separate LPI2C target - * 0b111..Four-pin push-pull mode (inverted outputs) - */ -#define LPI2C_MCFGR1_PINCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR1_PINCFG_SHIFT)) & LPI2C_MCFGR1_PINCFG_MASK) -/*! @} */ - -/*! @name MCFGR2 - Controller Configuration 2 */ -/*! @{ */ - -#define LPI2C_MCFGR2_BUSIDLE_MASK (0xFFFU) -#define LPI2C_MCFGR2_BUSIDLE_SHIFT (0U) -/*! BUSIDLE - Bus Idle Timeout */ -#define LPI2C_MCFGR2_BUSIDLE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR2_BUSIDLE_SHIFT)) & LPI2C_MCFGR2_BUSIDLE_MASK) - -#define LPI2C_MCFGR2_FILTSCL_MASK (0xF0000U) -#define LPI2C_MCFGR2_FILTSCL_SHIFT (16U) -/*! FILTSCL - Glitch Filter SCL */ -#define LPI2C_MCFGR2_FILTSCL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR2_FILTSCL_SHIFT)) & LPI2C_MCFGR2_FILTSCL_MASK) - -#define LPI2C_MCFGR2_FILTSDA_MASK (0xF000000U) -#define LPI2C_MCFGR2_FILTSDA_SHIFT (24U) -/*! FILTSDA - Glitch Filter SDA */ -#define LPI2C_MCFGR2_FILTSDA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR2_FILTSDA_SHIFT)) & LPI2C_MCFGR2_FILTSDA_MASK) -/*! @} */ - -/*! @name MCFGR3 - Controller Configuration 3 */ -/*! @{ */ - -#define LPI2C_MCFGR3_PINLOW_MASK (0xFFF00U) -#define LPI2C_MCFGR3_PINLOW_SHIFT (8U) -/*! PINLOW - Pin Low Timeout */ -#define LPI2C_MCFGR3_PINLOW(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCFGR3_PINLOW_SHIFT)) & LPI2C_MCFGR3_PINLOW_MASK) -/*! @} */ - -/*! @name MDMR - Controller Data Match */ -/*! @{ */ - -#define LPI2C_MDMR_MATCH0_MASK (0xFFU) -#define LPI2C_MDMR_MATCH0_SHIFT (0U) -/*! MATCH0 - Match 0 Value */ -#define LPI2C_MDMR_MATCH0(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MDMR_MATCH0_SHIFT)) & LPI2C_MDMR_MATCH0_MASK) - -#define LPI2C_MDMR_MATCH1_MASK (0xFF0000U) -#define LPI2C_MDMR_MATCH1_SHIFT (16U) -/*! MATCH1 - Match 1 Value */ -#define LPI2C_MDMR_MATCH1(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MDMR_MATCH1_SHIFT)) & LPI2C_MDMR_MATCH1_MASK) -/*! @} */ - -/*! @name MCCR0 - Controller Clock Configuration 0 */ -/*! @{ */ - -#define LPI2C_MCCR0_CLKLO_MASK (0x3FU) -#define LPI2C_MCCR0_CLKLO_SHIFT (0U) -/*! CLKLO - Clock Low Period */ -#define LPI2C_MCCR0_CLKLO(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR0_CLKLO_SHIFT)) & LPI2C_MCCR0_CLKLO_MASK) - -#define LPI2C_MCCR0_CLKHI_MASK (0x3F00U) -#define LPI2C_MCCR0_CLKHI_SHIFT (8U) -/*! CLKHI - Clock High Period */ -#define LPI2C_MCCR0_CLKHI(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR0_CLKHI_SHIFT)) & LPI2C_MCCR0_CLKHI_MASK) - -#define LPI2C_MCCR0_SETHOLD_MASK (0x3F0000U) -#define LPI2C_MCCR0_SETHOLD_SHIFT (16U) -/*! SETHOLD - Setup Hold Delay */ -#define LPI2C_MCCR0_SETHOLD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR0_SETHOLD_SHIFT)) & LPI2C_MCCR0_SETHOLD_MASK) - -#define LPI2C_MCCR0_DATAVD_MASK (0x3F000000U) -#define LPI2C_MCCR0_DATAVD_SHIFT (24U) -/*! DATAVD - Data Valid Delay */ -#define LPI2C_MCCR0_DATAVD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR0_DATAVD_SHIFT)) & LPI2C_MCCR0_DATAVD_MASK) -/*! @} */ - -/*! @name MCCR1 - Controller Clock Configuration 1 */ -/*! @{ */ - -#define LPI2C_MCCR1_CLKLO_MASK (0x3FU) -#define LPI2C_MCCR1_CLKLO_SHIFT (0U) -/*! CLKLO - Clock Low Period */ -#define LPI2C_MCCR1_CLKLO(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR1_CLKLO_SHIFT)) & LPI2C_MCCR1_CLKLO_MASK) - -#define LPI2C_MCCR1_CLKHI_MASK (0x3F00U) -#define LPI2C_MCCR1_CLKHI_SHIFT (8U) -/*! CLKHI - Clock High Period */ -#define LPI2C_MCCR1_CLKHI(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR1_CLKHI_SHIFT)) & LPI2C_MCCR1_CLKHI_MASK) - -#define LPI2C_MCCR1_SETHOLD_MASK (0x3F0000U) -#define LPI2C_MCCR1_SETHOLD_SHIFT (16U) -/*! SETHOLD - Setup Hold Delay */ -#define LPI2C_MCCR1_SETHOLD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR1_SETHOLD_SHIFT)) & LPI2C_MCCR1_SETHOLD_MASK) - -#define LPI2C_MCCR1_DATAVD_MASK (0x3F000000U) -#define LPI2C_MCCR1_DATAVD_SHIFT (24U) -/*! DATAVD - Data Valid Delay */ -#define LPI2C_MCCR1_DATAVD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MCCR1_DATAVD_SHIFT)) & LPI2C_MCCR1_DATAVD_MASK) -/*! @} */ - -/*! @name MFCR - Controller FIFO Control */ -/*! @{ */ - -#define LPI2C_MFCR_TXWATER_MASK (0x7U) -#define LPI2C_MFCR_TXWATER_SHIFT (0U) -/*! TXWATER - Transmit FIFO Watermark */ -#define LPI2C_MFCR_TXWATER(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MFCR_TXWATER_SHIFT)) & LPI2C_MFCR_TXWATER_MASK) - -#define LPI2C_MFCR_RXWATER_MASK (0x70000U) -#define LPI2C_MFCR_RXWATER_SHIFT (16U) -/*! RXWATER - Receive FIFO Watermark */ -#define LPI2C_MFCR_RXWATER(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MFCR_RXWATER_SHIFT)) & LPI2C_MFCR_RXWATER_MASK) -/*! @} */ - -/*! @name MFSR - Controller FIFO Status */ -/*! @{ */ - -#define LPI2C_MFSR_TXCOUNT_MASK (0xFU) -#define LPI2C_MFSR_TXCOUNT_SHIFT (0U) -/*! TXCOUNT - Transmit FIFO Count */ -#define LPI2C_MFSR_TXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MFSR_TXCOUNT_SHIFT)) & LPI2C_MFSR_TXCOUNT_MASK) - -#define LPI2C_MFSR_RXCOUNT_MASK (0xF0000U) -#define LPI2C_MFSR_RXCOUNT_SHIFT (16U) -/*! RXCOUNT - Receive FIFO Count */ -#define LPI2C_MFSR_RXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MFSR_RXCOUNT_SHIFT)) & LPI2C_MFSR_RXCOUNT_MASK) -/*! @} */ - -/*! @name MTDR - Controller Transmit Data */ -/*! @{ */ - -#define LPI2C_MTDR_DATA_MASK (0xFFU) -#define LPI2C_MTDR_DATA_SHIFT (0U) -/*! DATA - Transmit Data */ -#define LPI2C_MTDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MTDR_DATA_SHIFT)) & LPI2C_MTDR_DATA_MASK) - -#define LPI2C_MTDR_CMD_MASK (0x700U) -#define LPI2C_MTDR_CMD_SHIFT (8U) -/*! CMD - Command Data - * 0b000..Transmit the value in DATA[7:0] - * 0b001..Receive (DATA[7:0] + 1) bytes - * 0b010..Generate Stop condition on I2C bus - * 0b011..Receive and discard (DATA[7:0] + 1) bytes - * 0b100..Generate (repeated) Start on the I2C bus and transmit the address in DATA[7:0] - * 0b101..Generate (repeated) Start on the I2C bus and transmit the address in DATA[7:0] (this transfer expects a NACK to be returned) - * 0b110..Generate (repeated) Start on the I2C bus and transmit the address in DATA[7:0] using HS mode - * 0b111..Generate (repeated) Start on the I2C bus and transmit the address in DATA[7:0] using HS mode (this transfer expects a NACK to be returned) - */ -#define LPI2C_MTDR_CMD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MTDR_CMD_SHIFT)) & LPI2C_MTDR_CMD_MASK) -/*! @} */ - -/*! @name MRDR - Controller Receive Data */ -/*! @{ */ - -#define LPI2C_MRDR_DATA_MASK (0xFFU) -#define LPI2C_MRDR_DATA_SHIFT (0U) -/*! DATA - Receive Data */ -#define LPI2C_MRDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MRDR_DATA_SHIFT)) & LPI2C_MRDR_DATA_MASK) - -#define LPI2C_MRDR_RXEMPTY_MASK (0x4000U) -#define LPI2C_MRDR_RXEMPTY_SHIFT (14U) -/*! RXEMPTY - Receive Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPI2C_MRDR_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MRDR_RXEMPTY_SHIFT)) & LPI2C_MRDR_RXEMPTY_MASK) -/*! @} */ - -/*! @name MRDROR - Controller Receive Data Read Only */ -/*! @{ */ - -#define LPI2C_MRDROR_DATA_MASK (0xFFU) -#define LPI2C_MRDROR_DATA_SHIFT (0U) -/*! DATA - Receive Data */ -#define LPI2C_MRDROR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MRDROR_DATA_SHIFT)) & LPI2C_MRDROR_DATA_MASK) - -#define LPI2C_MRDROR_RXEMPTY_MASK (0x4000U) -#define LPI2C_MRDROR_RXEMPTY_SHIFT (14U) -/*! RXEMPTY - RX Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPI2C_MRDROR_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MRDROR_RXEMPTY_SHIFT)) & LPI2C_MRDROR_RXEMPTY_MASK) -/*! @} */ - -/*! @name SCR - Target Control */ -/*! @{ */ - -#define LPI2C_SCR_SEN_MASK (0x1U) -#define LPI2C_SCR_SEN_SHIFT (0U) -/*! SEN - Target Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCR_SEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCR_SEN_SHIFT)) & LPI2C_SCR_SEN_MASK) - -#define LPI2C_SCR_RST_MASK (0x2U) -#define LPI2C_SCR_RST_SHIFT (1U) -/*! RST - Software Reset - * 0b0..Not reset - * 0b1..Reset - */ -#define LPI2C_SCR_RST(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCR_RST_SHIFT)) & LPI2C_SCR_RST_MASK) - -#define LPI2C_SCR_FILTEN_MASK (0x10U) -#define LPI2C_SCR_FILTEN_SHIFT (4U) -/*! FILTEN - Filter Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCR_FILTEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCR_FILTEN_SHIFT)) & LPI2C_SCR_FILTEN_MASK) - -#define LPI2C_SCR_FILTDZ_MASK (0x20U) -#define LPI2C_SCR_FILTDZ_SHIFT (5U) -/*! FILTDZ - Filter Doze Enable - * 0b0..Enable - * 0b1..Disable - */ -#define LPI2C_SCR_FILTDZ(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCR_FILTDZ_SHIFT)) & LPI2C_SCR_FILTDZ_MASK) - -#define LPI2C_SCR_RTF_MASK (0x100U) -#define LPI2C_SCR_RTF_SHIFT (8U) -/*! RTF - Reset Transmit FIFO - * 0b0..No effect - * 0b1..STDR is now empty - */ -#define LPI2C_SCR_RTF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCR_RTF_SHIFT)) & LPI2C_SCR_RTF_MASK) - -#define LPI2C_SCR_RRF_MASK (0x200U) -#define LPI2C_SCR_RRF_SHIFT (9U) -/*! RRF - Reset Receive FIFO - * 0b0..No effect - * 0b1..SRDR is now empty - */ -#define LPI2C_SCR_RRF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCR_RRF_SHIFT)) & LPI2C_SCR_RRF_MASK) -/*! @} */ - -/*! @name SSR - Target Status */ -/*! @{ */ - -#define LPI2C_SSR_TDF_MASK (0x1U) -#define LPI2C_SSR_TDF_SHIFT (0U) -/*! TDF - Transmit Data Flag - * 0b0..Transmit data not requested - * 0b1..Transmit data is requested - */ -#define LPI2C_SSR_TDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_TDF_SHIFT)) & LPI2C_SSR_TDF_MASK) - -#define LPI2C_SSR_RDF_MASK (0x2U) -#define LPI2C_SSR_RDF_SHIFT (1U) -/*! RDF - Receive Data Flag - * 0b0..Not ready - * 0b1..Ready - */ -#define LPI2C_SSR_RDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_RDF_SHIFT)) & LPI2C_SSR_RDF_MASK) - -#define LPI2C_SSR_AVF_MASK (0x4U) -#define LPI2C_SSR_AVF_SHIFT (2U) -/*! AVF - Address Valid Flag - * 0b0..Not valid - * 0b1..Valid - */ -#define LPI2C_SSR_AVF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_AVF_SHIFT)) & LPI2C_SSR_AVF_MASK) - -#define LPI2C_SSR_TAF_MASK (0x8U) -#define LPI2C_SSR_TAF_SHIFT (3U) -/*! TAF - Transmit ACK Flag - * 0b0..Not required - * 0b1..Required - */ -#define LPI2C_SSR_TAF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_TAF_SHIFT)) & LPI2C_SSR_TAF_MASK) - -#define LPI2C_SSR_RSF_MASK (0x100U) -#define LPI2C_SSR_RSF_SHIFT (8U) -/*! RSF - Repeated Start Flag - * 0b0..No repeated Start detected - * 0b1..Repeated Start detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_SSR_RSF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_RSF_SHIFT)) & LPI2C_SSR_RSF_MASK) - -#define LPI2C_SSR_SDF_MASK (0x200U) -#define LPI2C_SSR_SDF_SHIFT (9U) -/*! SDF - Stop Detect Flag - * 0b0..No Stop detected - * 0b1..Stop detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_SSR_SDF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_SDF_SHIFT)) & LPI2C_SSR_SDF_MASK) - -#define LPI2C_SSR_BEF_MASK (0x400U) -#define LPI2C_SSR_BEF_SHIFT (10U) -/*! BEF - Bit Error Flag - * 0b0..No bit error occurred - * 0b1..Bit error occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_SSR_BEF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_BEF_SHIFT)) & LPI2C_SSR_BEF_MASK) - -#define LPI2C_SSR_FEF_MASK (0x800U) -#define LPI2C_SSR_FEF_SHIFT (11U) -/*! FEF - FIFO Error Flag - * 0b0..No FIFO error - * 0b1..FIFO error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPI2C_SSR_FEF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_FEF_SHIFT)) & LPI2C_SSR_FEF_MASK) - -#define LPI2C_SSR_AM0F_MASK (0x1000U) -#define LPI2C_SSR_AM0F_SHIFT (12U) -/*! AM0F - Address Match 0 Flag - * 0b0..ADDR0 matching address not received - * 0b1..ADDR0 matching address received - */ -#define LPI2C_SSR_AM0F(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_AM0F_SHIFT)) & LPI2C_SSR_AM0F_MASK) - -#define LPI2C_SSR_AM1F_MASK (0x2000U) -#define LPI2C_SSR_AM1F_SHIFT (13U) -/*! AM1F - Address Match 1 Flag - * 0b0..Matching address not received - * 0b1..Matching address received - */ -#define LPI2C_SSR_AM1F(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_AM1F_SHIFT)) & LPI2C_SSR_AM1F_MASK) - -#define LPI2C_SSR_GCF_MASK (0x4000U) -#define LPI2C_SSR_GCF_SHIFT (14U) -/*! GCF - General Call Flag - * 0b0..General call address disabled or not detected - * 0b1..General call address detected - */ -#define LPI2C_SSR_GCF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_GCF_SHIFT)) & LPI2C_SSR_GCF_MASK) - -#define LPI2C_SSR_SARF_MASK (0x8000U) -#define LPI2C_SSR_SARF_SHIFT (15U) -/*! SARF - SMBus Alert Response Flag - * 0b0..Disabled or not detected - * 0b1..Enabled and detected - */ -#define LPI2C_SSR_SARF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_SARF_SHIFT)) & LPI2C_SSR_SARF_MASK) - -#define LPI2C_SSR_SBF_MASK (0x1000000U) -#define LPI2C_SSR_SBF_SHIFT (24U) -/*! SBF - Target Busy Flag - * 0b0..Idle - * 0b1..Busy - */ -#define LPI2C_SSR_SBF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_SBF_SHIFT)) & LPI2C_SSR_SBF_MASK) - -#define LPI2C_SSR_BBF_MASK (0x2000000U) -#define LPI2C_SSR_BBF_SHIFT (25U) -/*! BBF - Bus Busy Flag - * 0b0..Idle - * 0b1..Busy - */ -#define LPI2C_SSR_BBF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SSR_BBF_SHIFT)) & LPI2C_SSR_BBF_MASK) -/*! @} */ - -/*! @name SIER - Target Interrupt Enable */ -/*! @{ */ - -#define LPI2C_SIER_TDIE_MASK (0x1U) -#define LPI2C_SIER_TDIE_SHIFT (0U) -/*! TDIE - Transmit Data Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_TDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_TDIE_SHIFT)) & LPI2C_SIER_TDIE_MASK) - -#define LPI2C_SIER_RDIE_MASK (0x2U) -#define LPI2C_SIER_RDIE_SHIFT (1U) -/*! RDIE - Receive Data Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_RDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_RDIE_SHIFT)) & LPI2C_SIER_RDIE_MASK) - -#define LPI2C_SIER_AVIE_MASK (0x4U) -#define LPI2C_SIER_AVIE_SHIFT (2U) -/*! AVIE - Address Valid Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_AVIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_AVIE_SHIFT)) & LPI2C_SIER_AVIE_MASK) - -#define LPI2C_SIER_TAIE_MASK (0x8U) -#define LPI2C_SIER_TAIE_SHIFT (3U) -/*! TAIE - Transmit ACK Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_TAIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_TAIE_SHIFT)) & LPI2C_SIER_TAIE_MASK) - -#define LPI2C_SIER_RSIE_MASK (0x100U) -#define LPI2C_SIER_RSIE_SHIFT (8U) -/*! RSIE - Repeated Start Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_RSIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_RSIE_SHIFT)) & LPI2C_SIER_RSIE_MASK) - -#define LPI2C_SIER_SDIE_MASK (0x200U) -#define LPI2C_SIER_SDIE_SHIFT (9U) -/*! SDIE - Stop Detect Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_SDIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_SDIE_SHIFT)) & LPI2C_SIER_SDIE_MASK) - -#define LPI2C_SIER_BEIE_MASK (0x400U) -#define LPI2C_SIER_BEIE_SHIFT (10U) -/*! BEIE - Bit Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_BEIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_BEIE_SHIFT)) & LPI2C_SIER_BEIE_MASK) - -#define LPI2C_SIER_FEIE_MASK (0x800U) -#define LPI2C_SIER_FEIE_SHIFT (11U) -/*! FEIE - FIFO Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_FEIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_FEIE_SHIFT)) & LPI2C_SIER_FEIE_MASK) - -#define LPI2C_SIER_AM0IE_MASK (0x1000U) -#define LPI2C_SIER_AM0IE_SHIFT (12U) -/*! AM0IE - Address Match 0 Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_AM0IE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_AM0IE_SHIFT)) & LPI2C_SIER_AM0IE_MASK) - -#define LPI2C_SIER_AM1IE_MASK (0x2000U) -#define LPI2C_SIER_AM1IE_SHIFT (13U) -/*! AM1IE - Address Match 1 Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_AM1IE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_AM1IE_SHIFT)) & LPI2C_SIER_AM1IE_MASK) - -#define LPI2C_SIER_GCIE_MASK (0x4000U) -#define LPI2C_SIER_GCIE_SHIFT (14U) -/*! GCIE - General Call Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define LPI2C_SIER_GCIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_GCIE_SHIFT)) & LPI2C_SIER_GCIE_MASK) - -#define LPI2C_SIER_SARIE_MASK (0x8000U) -#define LPI2C_SIER_SARIE_SHIFT (15U) -/*! SARIE - SMBus Alert Response Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SIER_SARIE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SIER_SARIE_SHIFT)) & LPI2C_SIER_SARIE_MASK) -/*! @} */ - -/*! @name SDER - Target DMA Enable */ -/*! @{ */ - -#define LPI2C_SDER_TDDE_MASK (0x1U) -#define LPI2C_SDER_TDDE_SHIFT (0U) -/*! TDDE - Transmit Data DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SDER_TDDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SDER_TDDE_SHIFT)) & LPI2C_SDER_TDDE_MASK) - -#define LPI2C_SDER_RDDE_MASK (0x2U) -#define LPI2C_SDER_RDDE_SHIFT (1U) -/*! RDDE - Receive Data DMA Enable - * 0b0..Disable DMA request - * 0b1..Enable DMA request - */ -#define LPI2C_SDER_RDDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SDER_RDDE_SHIFT)) & LPI2C_SDER_RDDE_MASK) - -#define LPI2C_SDER_AVDE_MASK (0x4U) -#define LPI2C_SDER_AVDE_SHIFT (2U) -/*! AVDE - Address Valid DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SDER_AVDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SDER_AVDE_SHIFT)) & LPI2C_SDER_AVDE_MASK) - -#define LPI2C_SDER_RSDE_MASK (0x100U) -#define LPI2C_SDER_RSDE_SHIFT (8U) -/*! RSDE - Repeated Start DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SDER_RSDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SDER_RSDE_SHIFT)) & LPI2C_SDER_RSDE_MASK) - -#define LPI2C_SDER_SDDE_MASK (0x200U) -#define LPI2C_SDER_SDDE_SHIFT (9U) -/*! SDDE - Stop Detect DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SDER_SDDE(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SDER_SDDE_SHIFT)) & LPI2C_SDER_SDDE_MASK) -/*! @} */ - -/*! @name SCFGR0 - Target Configuration 0 */ -/*! @{ */ - -#define LPI2C_SCFGR0_RDREQ_MASK (0x1U) -#define LPI2C_SCFGR0_RDREQ_SHIFT (0U) -/*! RDREQ - Read Request - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR0_RDREQ(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR0_RDREQ_SHIFT)) & LPI2C_SCFGR0_RDREQ_MASK) - -#define LPI2C_SCFGR0_RDACK_MASK (0x2U) -#define LPI2C_SCFGR0_RDACK_SHIFT (1U) -/*! RDACK - Read Acknowledge Flag - * 0b0..Read Request not acknowledged - * 0b1..Read Request acknowledged - */ -#define LPI2C_SCFGR0_RDACK(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR0_RDACK_SHIFT)) & LPI2C_SCFGR0_RDACK_MASK) -/*! @} */ - -/*! @name SCFGR1 - Target Configuration 1 */ -/*! @{ */ - -#define LPI2C_SCFGR1_ADRSTALL_MASK (0x1U) -#define LPI2C_SCFGR1_ADRSTALL_SHIFT (0U) -/*! ADRSTALL - Address SCL Stall - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_ADRSTALL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_ADRSTALL_SHIFT)) & LPI2C_SCFGR1_ADRSTALL_MASK) - -#define LPI2C_SCFGR1_RXSTALL_MASK (0x2U) -#define LPI2C_SCFGR1_RXSTALL_SHIFT (1U) -/*! RXSTALL - RX SCL Stall - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_RXSTALL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_RXSTALL_SHIFT)) & LPI2C_SCFGR1_RXSTALL_MASK) - -#define LPI2C_SCFGR1_TXDSTALL_MASK (0x4U) -#define LPI2C_SCFGR1_TXDSTALL_SHIFT (2U) -/*! TXDSTALL - Transmit Data SCL Stall - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_TXDSTALL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_TXDSTALL_SHIFT)) & LPI2C_SCFGR1_TXDSTALL_MASK) - -#define LPI2C_SCFGR1_ACKSTALL_MASK (0x8U) -#define LPI2C_SCFGR1_ACKSTALL_SHIFT (3U) -/*! ACKSTALL - ACK SCL Stall - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_ACKSTALL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_ACKSTALL_SHIFT)) & LPI2C_SCFGR1_ACKSTALL_MASK) - -#define LPI2C_SCFGR1_RXNACK_MASK (0x10U) -#define LPI2C_SCFGR1_RXNACK_SHIFT (4U) -/*! RXNACK - Receive NACK - * 0b0..ACK or NACK always determined by STAR[TXNACK] - * 0b1..NACK always generated on address overrun or receive data overrun, otherwise ACK or NACK is determined by STAR[TXNACK] - */ -#define LPI2C_SCFGR1_RXNACK(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_RXNACK_SHIFT)) & LPI2C_SCFGR1_RXNACK_MASK) - -#define LPI2C_SCFGR1_GCEN_MASK (0x100U) -#define LPI2C_SCFGR1_GCEN_SHIFT (8U) -/*! GCEN - General Call Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_GCEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_GCEN_SHIFT)) & LPI2C_SCFGR1_GCEN_MASK) - -#define LPI2C_SCFGR1_SAEN_MASK (0x200U) -#define LPI2C_SCFGR1_SAEN_SHIFT (9U) -/*! SAEN - SMBus Alert Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_SAEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_SAEN_SHIFT)) & LPI2C_SCFGR1_SAEN_MASK) - -#define LPI2C_SCFGR1_TXCFG_MASK (0x400U) -#define LPI2C_SCFGR1_TXCFG_SHIFT (10U) -/*! TXCFG - Transmit Flag Configuration - * 0b0..MSR[TDF] is set only during a target-transmit transfer when STDR is empty - * 0b1..MSR[TDF] is set whenever STDR is empty - */ -#define LPI2C_SCFGR1_TXCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_TXCFG_SHIFT)) & LPI2C_SCFGR1_TXCFG_MASK) - -#define LPI2C_SCFGR1_RXCFG_MASK (0x800U) -#define LPI2C_SCFGR1_RXCFG_SHIFT (11U) -/*! RXCFG - Receive Data Configuration - * 0b0..Return received data, clear MSR[RDF] - * 0b1..Return SASR and clear SSR[AVF] when SSR[AVF] is set, return received data and clear MSR[RDF] when SSR[AFV] is not set - */ -#define LPI2C_SCFGR1_RXCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_RXCFG_SHIFT)) & LPI2C_SCFGR1_RXCFG_MASK) - -#define LPI2C_SCFGR1_IGNACK_MASK (0x1000U) -#define LPI2C_SCFGR1_IGNACK_SHIFT (12U) -/*! IGNACK - Ignore NACK - * 0b0..End transfer on NACK - * 0b1..Do not end transfer on NACK - */ -#define LPI2C_SCFGR1_IGNACK(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_IGNACK_SHIFT)) & LPI2C_SCFGR1_IGNACK_MASK) - -#define LPI2C_SCFGR1_HSMEN_MASK (0x2000U) -#define LPI2C_SCFGR1_HSMEN_SHIFT (13U) -/*! HSMEN - HS Mode Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_HSMEN(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_HSMEN_SHIFT)) & LPI2C_SCFGR1_HSMEN_MASK) - -#define LPI2C_SCFGR1_ADDRCFG_MASK (0x70000U) -#define LPI2C_SCFGR1_ADDRCFG_SHIFT (16U) -/*! ADDRCFG - Address Configuration - * 0b000..Address match 0 (7-bit) - * 0b001..Address match 0 (10-bit) - * 0b010..Address match 0 (7-bit) or address match 1 (7-bit) - * 0b011..Address match 0 (10-bit) or address match 1 (10-bit) - * 0b100..Address match 0 (7-bit) or address match 1 (10-bit) - * 0b101..Address match 0 (10-bit) or address match 1 (7-bit) - * 0b110..From address match 0 (7-bit) to address match 1 (7-bit) - * 0b111..From address match 0 (10-bit) to address match 1 (10-bit) - */ -#define LPI2C_SCFGR1_ADDRCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_ADDRCFG_SHIFT)) & LPI2C_SCFGR1_ADDRCFG_MASK) - -#define LPI2C_SCFGR1_RXALL_MASK (0x1000000U) -#define LPI2C_SCFGR1_RXALL_SHIFT (24U) -/*! RXALL - Receive All - * 0b0..Disable - * 0b1..Enable - */ -#define LPI2C_SCFGR1_RXALL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_RXALL_SHIFT)) & LPI2C_SCFGR1_RXALL_MASK) - -#define LPI2C_SCFGR1_RSCFG_MASK (0x2000000U) -#define LPI2C_SCFGR1_RSCFG_SHIFT (25U) -/*! RSCFG - Repeated Start Configuration - * 0b0..Any repeated Start condition following an address match - * 0b1..Any repeated Start condition - */ -#define LPI2C_SCFGR1_RSCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_RSCFG_SHIFT)) & LPI2C_SCFGR1_RSCFG_MASK) - -#define LPI2C_SCFGR1_SDCFG_MASK (0x4000000U) -#define LPI2C_SCFGR1_SDCFG_SHIFT (26U) -/*! SDCFG - Stop Detect Configuration - * 0b0..Any Stop condition following an address match - * 0b1..Any Stop condition - */ -#define LPI2C_SCFGR1_SDCFG(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR1_SDCFG_SHIFT)) & LPI2C_SCFGR1_SDCFG_MASK) -/*! @} */ - -/*! @name SCFGR2 - Target Configuration 2 */ -/*! @{ */ - -#define LPI2C_SCFGR2_CLKHOLD_MASK (0xFU) -#define LPI2C_SCFGR2_CLKHOLD_SHIFT (0U) -/*! CLKHOLD - Clock Hold Time */ -#define LPI2C_SCFGR2_CLKHOLD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR2_CLKHOLD_SHIFT)) & LPI2C_SCFGR2_CLKHOLD_MASK) - -#define LPI2C_SCFGR2_DATAVD_MASK (0x3F00U) -#define LPI2C_SCFGR2_DATAVD_SHIFT (8U) -/*! DATAVD - Data Valid Delay */ -#define LPI2C_SCFGR2_DATAVD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR2_DATAVD_SHIFT)) & LPI2C_SCFGR2_DATAVD_MASK) - -#define LPI2C_SCFGR2_FILTSCL_MASK (0xF0000U) -#define LPI2C_SCFGR2_FILTSCL_SHIFT (16U) -/*! FILTSCL - Glitch Filter SCL */ -#define LPI2C_SCFGR2_FILTSCL(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR2_FILTSCL_SHIFT)) & LPI2C_SCFGR2_FILTSCL_MASK) - -#define LPI2C_SCFGR2_FILTSDA_MASK (0xF000000U) -#define LPI2C_SCFGR2_FILTSDA_SHIFT (24U) -/*! FILTSDA - Glitch Filter SDA */ -#define LPI2C_SCFGR2_FILTSDA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SCFGR2_FILTSDA_SHIFT)) & LPI2C_SCFGR2_FILTSDA_MASK) -/*! @} */ - -/*! @name SAMR - Target Address Match */ -/*! @{ */ - -#define LPI2C_SAMR_ADDR0_MASK (0x7FEU) -#define LPI2C_SAMR_ADDR0_SHIFT (1U) -/*! ADDR0 - Address 0 Value */ -#define LPI2C_SAMR_ADDR0(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SAMR_ADDR0_SHIFT)) & LPI2C_SAMR_ADDR0_MASK) - -#define LPI2C_SAMR_ADDR1_MASK (0x7FE0000U) -#define LPI2C_SAMR_ADDR1_SHIFT (17U) -/*! ADDR1 - Address 1 Value */ -#define LPI2C_SAMR_ADDR1(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SAMR_ADDR1_SHIFT)) & LPI2C_SAMR_ADDR1_MASK) -/*! @} */ - -/*! @name SASR - Target Address Status */ -/*! @{ */ - -#define LPI2C_SASR_RADDR_MASK (0x7FFU) -#define LPI2C_SASR_RADDR_SHIFT (0U) -/*! RADDR - Received Address */ -#define LPI2C_SASR_RADDR(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SASR_RADDR_SHIFT)) & LPI2C_SASR_RADDR_MASK) - -#define LPI2C_SASR_ANV_MASK (0x4000U) -#define LPI2C_SASR_ANV_SHIFT (14U) -/*! ANV - Address Not Valid - * 0b0..Valid - * 0b1..Not valid - */ -#define LPI2C_SASR_ANV(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SASR_ANV_SHIFT)) & LPI2C_SASR_ANV_MASK) -/*! @} */ - -/*! @name STAR - Target Transmit ACK */ -/*! @{ */ - -#define LPI2C_STAR_TXNACK_MASK (0x1U) -#define LPI2C_STAR_TXNACK_SHIFT (0U) -/*! TXNACK - Transmit NACK - * 0b0..Transmit ACK - * 0b1..Transmit NACK - */ -#define LPI2C_STAR_TXNACK(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_STAR_TXNACK_SHIFT)) & LPI2C_STAR_TXNACK_MASK) -/*! @} */ - -/*! @name STDR - Target Transmit Data */ -/*! @{ */ - -#define LPI2C_STDR_DATA_MASK (0xFFU) -#define LPI2C_STDR_DATA_SHIFT (0U) -/*! DATA - Transmit Data */ -#define LPI2C_STDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_STDR_DATA_SHIFT)) & LPI2C_STDR_DATA_MASK) -/*! @} */ - -/*! @name SRDR - Target Receive Data */ -/*! @{ */ - -#define LPI2C_SRDR_DATA_MASK (0xFFU) -#define LPI2C_SRDR_DATA_SHIFT (0U) -/*! DATA - Received Data */ -#define LPI2C_SRDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDR_DATA_SHIFT)) & LPI2C_SRDR_DATA_MASK) - -#define LPI2C_SRDR_RADDR_MASK (0x700U) -#define LPI2C_SRDR_RADDR_SHIFT (8U) -/*! RADDR - Received Address */ -#define LPI2C_SRDR_RADDR(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDR_RADDR_SHIFT)) & LPI2C_SRDR_RADDR_MASK) - -#define LPI2C_SRDR_RXEMPTY_MASK (0x4000U) -#define LPI2C_SRDR_RXEMPTY_SHIFT (14U) -/*! RXEMPTY - Receive Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPI2C_SRDR_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDR_RXEMPTY_SHIFT)) & LPI2C_SRDR_RXEMPTY_MASK) - -#define LPI2C_SRDR_SOF_MASK (0x8000U) -#define LPI2C_SRDR_SOF_SHIFT (15U) -/*! SOF - Start of Frame - * 0b0..Not first - * 0b1..First - */ -#define LPI2C_SRDR_SOF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDR_SOF_SHIFT)) & LPI2C_SRDR_SOF_MASK) -/*! @} */ - -/*! @name SRDROR - Target Receive Data Read Only */ -/*! @{ */ - -#define LPI2C_SRDROR_DATA_MASK (0xFFU) -#define LPI2C_SRDROR_DATA_SHIFT (0U) -/*! DATA - Receive Data */ -#define LPI2C_SRDROR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDROR_DATA_SHIFT)) & LPI2C_SRDROR_DATA_MASK) - -#define LPI2C_SRDROR_RADDR_MASK (0x700U) -#define LPI2C_SRDROR_RADDR_SHIFT (8U) -/*! RADDR - Received Address */ -#define LPI2C_SRDROR_RADDR(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDROR_RADDR_SHIFT)) & LPI2C_SRDROR_RADDR_MASK) - -#define LPI2C_SRDROR_RXEMPTY_MASK (0x4000U) -#define LPI2C_SRDROR_RXEMPTY_SHIFT (14U) -/*! RXEMPTY - Receive Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPI2C_SRDROR_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDROR_RXEMPTY_SHIFT)) & LPI2C_SRDROR_RXEMPTY_MASK) - -#define LPI2C_SRDROR_SOF_MASK (0x8000U) -#define LPI2C_SRDROR_SOF_SHIFT (15U) -/*! SOF - Start of Frame - * 0b0..Not the first - * 0b1..First - */ -#define LPI2C_SRDROR_SOF(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_SRDROR_SOF_SHIFT)) & LPI2C_SRDROR_SOF_MASK) -/*! @} */ - -/*! @name MTCBR - Controller Transmit Command Burst */ -/*! @{ */ - -#define LPI2C_MTCBR_DATA_MASK (0xFFU) -#define LPI2C_MTCBR_DATA_SHIFT (0U) -/*! DATA - Data */ -#define LPI2C_MTCBR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MTCBR_DATA_SHIFT)) & LPI2C_MTCBR_DATA_MASK) - -#define LPI2C_MTCBR_CMD_MASK (0x700U) -#define LPI2C_MTCBR_CMD_SHIFT (8U) -/*! CMD - Command */ -#define LPI2C_MTCBR_CMD(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MTCBR_CMD_SHIFT)) & LPI2C_MTCBR_CMD_MASK) -/*! @} */ - -/* The count of LPI2C_MTCBR */ -#define LPI2C_MTCBR_COUNT (128U) - -/*! @name MTDBR - Transmit Data Burst */ -/*! @{ */ - -#define LPI2C_MTDBR_DATA0_MASK (0xFFU) -#define LPI2C_MTDBR_DATA0_SHIFT (0U) -/*! DATA0 - Data */ -#define LPI2C_MTDBR_DATA0(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MTDBR_DATA0_SHIFT)) & LPI2C_MTDBR_DATA0_MASK) - -#define LPI2C_MTDBR_DATA1_MASK (0xFF00U) -#define LPI2C_MTDBR_DATA1_SHIFT (8U) -/*! DATA1 - Data */ -#define LPI2C_MTDBR_DATA1(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MTDBR_DATA1_SHIFT)) & LPI2C_MTDBR_DATA1_MASK) - -#define LPI2C_MTDBR_DATA2_MASK (0xFF0000U) -#define LPI2C_MTDBR_DATA2_SHIFT (16U) -/*! DATA2 - Data */ -#define LPI2C_MTDBR_DATA2(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MTDBR_DATA2_SHIFT)) & LPI2C_MTDBR_DATA2_MASK) - -#define LPI2C_MTDBR_DATA3_MASK (0xFF000000U) -#define LPI2C_MTDBR_DATA3_SHIFT (24U) -/*! DATA3 - Data */ -#define LPI2C_MTDBR_DATA3(x) (((uint32_t)(((uint32_t)(x)) << LPI2C_MTDBR_DATA3_SHIFT)) & LPI2C_MTDBR_DATA3_MASK) -/*! @} */ - -/* The count of LPI2C_MTDBR */ -#define LPI2C_MTDBR_COUNT (253U) - - -/*! - * @} - */ /* end of group LPI2C_Register_Masks */ - - -/* LPI2C - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral LPI2C0 base address */ - #define LPI2C0_BASE (0x50092800u) - /** Peripheral LPI2C0 base address */ - #define LPI2C0_BASE_NS (0x40092800u) - /** Peripheral LPI2C0 base pointer */ - #define LPI2C0 ((LPI2C_Type *)LPI2C0_BASE) - /** Peripheral LPI2C0 base pointer */ - #define LPI2C0_NS ((LPI2C_Type *)LPI2C0_BASE_NS) - /** Peripheral LPI2C1 base address */ - #define LPI2C1_BASE (0x50093800u) - /** Peripheral LPI2C1 base address */ - #define LPI2C1_BASE_NS (0x40093800u) - /** Peripheral LPI2C1 base pointer */ - #define LPI2C1 ((LPI2C_Type *)LPI2C1_BASE) - /** Peripheral LPI2C1 base pointer */ - #define LPI2C1_NS ((LPI2C_Type *)LPI2C1_BASE_NS) - /** Peripheral LPI2C2 base address */ - #define LPI2C2_BASE (0x50094800u) - /** Peripheral LPI2C2 base address */ - #define LPI2C2_BASE_NS (0x40094800u) - /** Peripheral LPI2C2 base pointer */ - #define LPI2C2 ((LPI2C_Type *)LPI2C2_BASE) - /** Peripheral LPI2C2 base pointer */ - #define LPI2C2_NS ((LPI2C_Type *)LPI2C2_BASE_NS) - /** Peripheral LPI2C3 base address */ - #define LPI2C3_BASE (0x50095800u) - /** Peripheral LPI2C3 base address */ - #define LPI2C3_BASE_NS (0x40095800u) - /** Peripheral LPI2C3 base pointer */ - #define LPI2C3 ((LPI2C_Type *)LPI2C3_BASE) - /** Peripheral LPI2C3 base pointer */ - #define LPI2C3_NS ((LPI2C_Type *)LPI2C3_BASE_NS) - /** Peripheral LPI2C4 base address */ - #define LPI2C4_BASE (0x500B4800u) - /** Peripheral LPI2C4 base address */ - #define LPI2C4_BASE_NS (0x400B4800u) - /** Peripheral LPI2C4 base pointer */ - #define LPI2C4 ((LPI2C_Type *)LPI2C4_BASE) - /** Peripheral LPI2C4 base pointer */ - #define LPI2C4_NS ((LPI2C_Type *)LPI2C4_BASE_NS) - /** Peripheral LPI2C5 base address */ - #define LPI2C5_BASE (0x500B5800u) - /** Peripheral LPI2C5 base address */ - #define LPI2C5_BASE_NS (0x400B5800u) - /** Peripheral LPI2C5 base pointer */ - #define LPI2C5 ((LPI2C_Type *)LPI2C5_BASE) - /** Peripheral LPI2C5 base pointer */ - #define LPI2C5_NS ((LPI2C_Type *)LPI2C5_BASE_NS) - /** Peripheral LPI2C6 base address */ - #define LPI2C6_BASE (0x500B6800u) - /** Peripheral LPI2C6 base address */ - #define LPI2C6_BASE_NS (0x400B6800u) - /** Peripheral LPI2C6 base pointer */ - #define LPI2C6 ((LPI2C_Type *)LPI2C6_BASE) - /** Peripheral LPI2C6 base pointer */ - #define LPI2C6_NS ((LPI2C_Type *)LPI2C6_BASE_NS) - /** Peripheral LPI2C7 base address */ - #define LPI2C7_BASE (0x500B7800u) - /** Peripheral LPI2C7 base address */ - #define LPI2C7_BASE_NS (0x400B7800u) - /** Peripheral LPI2C7 base pointer */ - #define LPI2C7 ((LPI2C_Type *)LPI2C7_BASE) - /** Peripheral LPI2C7 base pointer */ - #define LPI2C7_NS ((LPI2C_Type *)LPI2C7_BASE_NS) - /** Peripheral LPI2C8 base address */ - #define LPI2C8_BASE (0x500B8800u) - /** Peripheral LPI2C8 base address */ - #define LPI2C8_BASE_NS (0x400B8800u) - /** Peripheral LPI2C8 base pointer */ - #define LPI2C8 ((LPI2C_Type *)LPI2C8_BASE) - /** Peripheral LPI2C8 base pointer */ - #define LPI2C8_NS ((LPI2C_Type *)LPI2C8_BASE_NS) - /** Peripheral LPI2C9 base address */ - #define LPI2C9_BASE (0x500B9800u) - /** Peripheral LPI2C9 base address */ - #define LPI2C9_BASE_NS (0x400B9800u) - /** Peripheral LPI2C9 base pointer */ - #define LPI2C9 ((LPI2C_Type *)LPI2C9_BASE) - /** Peripheral LPI2C9 base pointer */ - #define LPI2C9_NS ((LPI2C_Type *)LPI2C9_BASE_NS) - /** Array initializer of LPI2C peripheral base addresses */ - #define LPI2C_BASE_ADDRS { LPI2C0_BASE, LPI2C1_BASE, LPI2C2_BASE, LPI2C3_BASE, LPI2C4_BASE, LPI2C5_BASE, LPI2C6_BASE, LPI2C7_BASE, LPI2C8_BASE, LPI2C9_BASE } - /** Array initializer of LPI2C peripheral base pointers */ - #define LPI2C_BASE_PTRS { LPI2C0, LPI2C1, LPI2C2, LPI2C3, LPI2C4, LPI2C5, LPI2C6, LPI2C7, LPI2C8, LPI2C9 } - /** Array initializer of LPI2C peripheral base addresses */ - #define LPI2C_BASE_ADDRS_NS { LPI2C0_BASE_NS, LPI2C1_BASE_NS, LPI2C2_BASE_NS, LPI2C3_BASE_NS, LPI2C4_BASE_NS, LPI2C5_BASE_NS, LPI2C6_BASE_NS, LPI2C7_BASE_NS, LPI2C8_BASE_NS, LPI2C9_BASE_NS } - /** Array initializer of LPI2C peripheral base pointers */ - #define LPI2C_BASE_PTRS_NS { LPI2C0_NS, LPI2C1_NS, LPI2C2_NS, LPI2C3_NS, LPI2C4_NS, LPI2C5_NS, LPI2C6_NS, LPI2C7_NS, LPI2C8_NS, LPI2C9_NS } -#else - /** Peripheral LPI2C0 base address */ - #define LPI2C0_BASE (0x40092800u) - /** Peripheral LPI2C0 base pointer */ - #define LPI2C0 ((LPI2C_Type *)LPI2C0_BASE) - /** Peripheral LPI2C1 base address */ - #define LPI2C1_BASE (0x40093800u) - /** Peripheral LPI2C1 base pointer */ - #define LPI2C1 ((LPI2C_Type *)LPI2C1_BASE) - /** Peripheral LPI2C2 base address */ - #define LPI2C2_BASE (0x40094800u) - /** Peripheral LPI2C2 base pointer */ - #define LPI2C2 ((LPI2C_Type *)LPI2C2_BASE) - /** Peripheral LPI2C3 base address */ - #define LPI2C3_BASE (0x40095800u) - /** Peripheral LPI2C3 base pointer */ - #define LPI2C3 ((LPI2C_Type *)LPI2C3_BASE) - /** Peripheral LPI2C4 base address */ - #define LPI2C4_BASE (0x400B4800u) - /** Peripheral LPI2C4 base pointer */ - #define LPI2C4 ((LPI2C_Type *)LPI2C4_BASE) - /** Peripheral LPI2C5 base address */ - #define LPI2C5_BASE (0x400B5800u) - /** Peripheral LPI2C5 base pointer */ - #define LPI2C5 ((LPI2C_Type *)LPI2C5_BASE) - /** Peripheral LPI2C6 base address */ - #define LPI2C6_BASE (0x400B6800u) - /** Peripheral LPI2C6 base pointer */ - #define LPI2C6 ((LPI2C_Type *)LPI2C6_BASE) - /** Peripheral LPI2C7 base address */ - #define LPI2C7_BASE (0x400B7800u) - /** Peripheral LPI2C7 base pointer */ - #define LPI2C7 ((LPI2C_Type *)LPI2C7_BASE) - /** Peripheral LPI2C8 base address */ - #define LPI2C8_BASE (0x400B8800u) - /** Peripheral LPI2C8 base pointer */ - #define LPI2C8 ((LPI2C_Type *)LPI2C8_BASE) - /** Peripheral LPI2C9 base address */ - #define LPI2C9_BASE (0x400B9800u) - /** Peripheral LPI2C9 base pointer */ - #define LPI2C9 ((LPI2C_Type *)LPI2C9_BASE) - /** Array initializer of LPI2C peripheral base addresses */ - #define LPI2C_BASE_ADDRS { LPI2C0_BASE, LPI2C1_BASE, LPI2C2_BASE, LPI2C3_BASE, LPI2C4_BASE, LPI2C5_BASE, LPI2C6_BASE, LPI2C7_BASE, LPI2C8_BASE, LPI2C9_BASE } - /** Array initializer of LPI2C peripheral base pointers */ - #define LPI2C_BASE_PTRS { LPI2C0, LPI2C1, LPI2C2, LPI2C3, LPI2C4, LPI2C5, LPI2C6, LPI2C7, LPI2C8, LPI2C9 } -#endif -/** Interrupt vectors for the LPI2C peripheral type */ -#define LPI2C_IRQS { LP_FLEXCOMM0_IRQn, LP_FLEXCOMM1_IRQn, LP_FLEXCOMM2_IRQn, LP_FLEXCOMM3_IRQn, LP_FLEXCOMM4_IRQn, LP_FLEXCOMM5_IRQn, LP_FLEXCOMM6_IRQn, LP_FLEXCOMM7_IRQn, LP_FLEXCOMM8_IRQn, LP_FLEXCOMM9_IRQn } - -/*! - * @} - */ /* end of group LPI2C_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LPSPI Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPSPI_Peripheral_Access_Layer LPSPI Peripheral Access Layer - * @{ - */ - -/** LPSPI - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - uint8_t RESERVED_0[8]; - __IO uint32_t CR; /**< Control, offset: 0x10 */ - __IO uint32_t SR; /**< Status, offset: 0x14 */ - __IO uint32_t IER; /**< Interrupt Enable, offset: 0x18 */ - __IO uint32_t DER; /**< DMA Enable, offset: 0x1C */ - __IO uint32_t CFGR0; /**< Configuration 0, offset: 0x20 */ - __IO uint32_t CFGR1; /**< Configuration 1, offset: 0x24 */ - uint8_t RESERVED_1[8]; - __IO uint32_t DMR0; /**< Data Match 0, offset: 0x30 */ - __IO uint32_t DMR1; /**< Data Match 1, offset: 0x34 */ - uint8_t RESERVED_2[8]; - __IO uint32_t CCR; /**< Clock Configuration, offset: 0x40 */ - __IO uint32_t CCR1; /**< Clock Configuration 1, offset: 0x44 */ - uint8_t RESERVED_3[16]; - __IO uint32_t FCR; /**< FIFO Control, offset: 0x58 */ - __I uint32_t FSR; /**< FIFO Status, offset: 0x5C */ - __IO uint32_t TCR; /**< Transmit Command, offset: 0x60 */ - __O uint32_t TDR; /**< Transmit Data, offset: 0x64 */ - uint8_t RESERVED_4[8]; - __I uint32_t RSR; /**< Receive Status, offset: 0x70 */ - __I uint32_t RDR; /**< Receive Data, offset: 0x74 */ - __I uint32_t RDROR; /**< Receive Data Read Only, offset: 0x78 */ - uint8_t RESERVED_5[896]; - __O uint32_t TCBR; /**< Transmit Command Burst, offset: 0x3FC */ - __O uint32_t TDBR[128]; /**< Transmit Data Burst, array offset: 0x400, array step: 0x4 */ - __I uint32_t RDBR[128]; /**< Receive Data Burst, array offset: 0x600, array step: 0x4 */ -} LPSPI_Type; - -/* ---------------------------------------------------------------------------- - -- LPSPI Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPSPI_Register_Masks LPSPI Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define LPSPI_VERID_FEATURE_MASK (0xFFFFU) -#define LPSPI_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Module Identification Number - * 0b0000000000000100..Standard feature set supporting a 32-bit shift register. - * *.. - */ -#define LPSPI_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_VERID_FEATURE_SHIFT)) & LPSPI_VERID_FEATURE_MASK) - -#define LPSPI_VERID_MINOR_MASK (0xFF0000U) -#define LPSPI_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define LPSPI_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_VERID_MINOR_SHIFT)) & LPSPI_VERID_MINOR_MASK) - -#define LPSPI_VERID_MAJOR_MASK (0xFF000000U) -#define LPSPI_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define LPSPI_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_VERID_MAJOR_SHIFT)) & LPSPI_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define LPSPI_PARAM_TXFIFO_MASK (0xFFU) -#define LPSPI_PARAM_TXFIFO_SHIFT (0U) -/*! TXFIFO - Transmit FIFO Size */ -#define LPSPI_PARAM_TXFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_PARAM_TXFIFO_SHIFT)) & LPSPI_PARAM_TXFIFO_MASK) - -#define LPSPI_PARAM_RXFIFO_MASK (0xFF00U) -#define LPSPI_PARAM_RXFIFO_SHIFT (8U) -/*! RXFIFO - Receive FIFO Size */ -#define LPSPI_PARAM_RXFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_PARAM_RXFIFO_SHIFT)) & LPSPI_PARAM_RXFIFO_MASK) - -#define LPSPI_PARAM_PCSNUM_MASK (0xFF0000U) -#define LPSPI_PARAM_PCSNUM_SHIFT (16U) -/*! PCSNUM - PCS Number */ -#define LPSPI_PARAM_PCSNUM(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_PARAM_PCSNUM_SHIFT)) & LPSPI_PARAM_PCSNUM_MASK) -/*! @} */ - -/*! @name CR - Control */ -/*! @{ */ - -#define LPSPI_CR_MEN_MASK (0x1U) -#define LPSPI_CR_MEN_SHIFT (0U) -/*! MEN - Module Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CR_MEN(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CR_MEN_SHIFT)) & LPSPI_CR_MEN_MASK) - -#define LPSPI_CR_RST_MASK (0x2U) -#define LPSPI_CR_RST_SHIFT (1U) -/*! RST - Software Reset - * 0b0..Not reset - * 0b1..Reset - */ -#define LPSPI_CR_RST(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CR_RST_SHIFT)) & LPSPI_CR_RST_MASK) - -#define LPSPI_CR_DBGEN_MASK (0x8U) -#define LPSPI_CR_DBGEN_SHIFT (3U) -/*! DBGEN - Debug Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CR_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CR_DBGEN_SHIFT)) & LPSPI_CR_DBGEN_MASK) - -#define LPSPI_CR_RTF_MASK (0x100U) -#define LPSPI_CR_RTF_SHIFT (8U) -/*! RTF - Reset Transmit FIFO - * 0b0..No effect - * 0b1..Reset - */ -#define LPSPI_CR_RTF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CR_RTF_SHIFT)) & LPSPI_CR_RTF_MASK) - -#define LPSPI_CR_RRF_MASK (0x200U) -#define LPSPI_CR_RRF_SHIFT (9U) -/*! RRF - Reset Receive FIFO - * 0b0..No effect - * 0b1..Reset - */ -#define LPSPI_CR_RRF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CR_RRF_SHIFT)) & LPSPI_CR_RRF_MASK) -/*! @} */ - -/*! @name SR - Status */ -/*! @{ */ - -#define LPSPI_SR_TDF_MASK (0x1U) -#define LPSPI_SR_TDF_SHIFT (0U) -/*! TDF - Transmit Data Flag - * 0b0..Transmit data not requested - * 0b1..Transmit data requested - */ -#define LPSPI_SR_TDF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_TDF_SHIFT)) & LPSPI_SR_TDF_MASK) - -#define LPSPI_SR_RDF_MASK (0x2U) -#define LPSPI_SR_RDF_SHIFT (1U) -/*! RDF - Receive Data Flag - * 0b0..Receive data not ready - * 0b1..Receive data ready - */ -#define LPSPI_SR_RDF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_RDF_SHIFT)) & LPSPI_SR_RDF_MASK) - -#define LPSPI_SR_WCF_MASK (0x100U) -#define LPSPI_SR_WCF_SHIFT (8U) -/*! WCF - Word Complete Flag - * 0b0..Not complete - * 0b1..Complete - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPSPI_SR_WCF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_WCF_SHIFT)) & LPSPI_SR_WCF_MASK) - -#define LPSPI_SR_FCF_MASK (0x200U) -#define LPSPI_SR_FCF_SHIFT (9U) -/*! FCF - Frame Complete Flag - * 0b0..Not complete - * 0b1..Complete - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPSPI_SR_FCF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_FCF_SHIFT)) & LPSPI_SR_FCF_MASK) - -#define LPSPI_SR_TCF_MASK (0x400U) -#define LPSPI_SR_TCF_SHIFT (10U) -/*! TCF - Transfer Complete Flag - * 0b0..Not complete - * 0b1..Complete - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPSPI_SR_TCF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_TCF_SHIFT)) & LPSPI_SR_TCF_MASK) - -#define LPSPI_SR_TEF_MASK (0x800U) -#define LPSPI_SR_TEF_SHIFT (11U) -/*! TEF - Transmit Error Flag - * 0b0..No underrun - * 0b1..Underrun - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPSPI_SR_TEF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_TEF_SHIFT)) & LPSPI_SR_TEF_MASK) - -#define LPSPI_SR_REF_MASK (0x1000U) -#define LPSPI_SR_REF_SHIFT (12U) -/*! REF - Receive Error Flag - * 0b0..No overflow - * 0b1..Overflow - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPSPI_SR_REF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_REF_SHIFT)) & LPSPI_SR_REF_MASK) - -#define LPSPI_SR_DMF_MASK (0x2000U) -#define LPSPI_SR_DMF_SHIFT (13U) -/*! DMF - Data Match Flag - * 0b0..No match - * 0b1..Match - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPSPI_SR_DMF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_DMF_SHIFT)) & LPSPI_SR_DMF_MASK) - -#define LPSPI_SR_MBF_MASK (0x1000000U) -#define LPSPI_SR_MBF_SHIFT (24U) -/*! MBF - Module Busy Flag - * 0b0..LPSPI is idle - * 0b1..LPSPI is busy - */ -#define LPSPI_SR_MBF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_SR_MBF_SHIFT)) & LPSPI_SR_MBF_MASK) -/*! @} */ - -/*! @name IER - Interrupt Enable */ -/*! @{ */ - -#define LPSPI_IER_TDIE_MASK (0x1U) -#define LPSPI_IER_TDIE_SHIFT (0U) -/*! TDIE - Transmit Data Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_TDIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_TDIE_SHIFT)) & LPSPI_IER_TDIE_MASK) - -#define LPSPI_IER_RDIE_MASK (0x2U) -#define LPSPI_IER_RDIE_SHIFT (1U) -/*! RDIE - Receive Data Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_RDIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_RDIE_SHIFT)) & LPSPI_IER_RDIE_MASK) - -#define LPSPI_IER_WCIE_MASK (0x100U) -#define LPSPI_IER_WCIE_SHIFT (8U) -/*! WCIE - Word Complete Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_WCIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_WCIE_SHIFT)) & LPSPI_IER_WCIE_MASK) - -#define LPSPI_IER_FCIE_MASK (0x200U) -#define LPSPI_IER_FCIE_SHIFT (9U) -/*! FCIE - Frame Complete Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_FCIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_FCIE_SHIFT)) & LPSPI_IER_FCIE_MASK) - -#define LPSPI_IER_TCIE_MASK (0x400U) -#define LPSPI_IER_TCIE_SHIFT (10U) -/*! TCIE - Transfer Complete Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_TCIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_TCIE_SHIFT)) & LPSPI_IER_TCIE_MASK) - -#define LPSPI_IER_TEIE_MASK (0x800U) -#define LPSPI_IER_TEIE_SHIFT (11U) -/*! TEIE - Transmit Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_TEIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_TEIE_SHIFT)) & LPSPI_IER_TEIE_MASK) - -#define LPSPI_IER_REIE_MASK (0x1000U) -#define LPSPI_IER_REIE_SHIFT (12U) -/*! REIE - Receive Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_REIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_REIE_SHIFT)) & LPSPI_IER_REIE_MASK) - -#define LPSPI_IER_DMIE_MASK (0x2000U) -#define LPSPI_IER_DMIE_SHIFT (13U) -/*! DMIE - Data Match Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_IER_DMIE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_IER_DMIE_SHIFT)) & LPSPI_IER_DMIE_MASK) -/*! @} */ - -/*! @name DER - DMA Enable */ -/*! @{ */ - -#define LPSPI_DER_TDDE_MASK (0x1U) -#define LPSPI_DER_TDDE_SHIFT (0U) -/*! TDDE - Transmit Data DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_DER_TDDE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_DER_TDDE_SHIFT)) & LPSPI_DER_TDDE_MASK) - -#define LPSPI_DER_RDDE_MASK (0x2U) -#define LPSPI_DER_RDDE_SHIFT (1U) -/*! RDDE - Receive Data DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_DER_RDDE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_DER_RDDE_SHIFT)) & LPSPI_DER_RDDE_MASK) - -#define LPSPI_DER_FCDE_MASK (0x200U) -#define LPSPI_DER_FCDE_SHIFT (9U) -/*! FCDE - Frame Complete DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_DER_FCDE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_DER_FCDE_SHIFT)) & LPSPI_DER_FCDE_MASK) -/*! @} */ - -/*! @name CFGR0 - Configuration 0 */ -/*! @{ */ - -#define LPSPI_CFGR0_HREN_MASK (0x1U) -#define LPSPI_CFGR0_HREN_SHIFT (0U) -/*! HREN - Host Request Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CFGR0_HREN(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR0_HREN_SHIFT)) & LPSPI_CFGR0_HREN_MASK) - -#define LPSPI_CFGR0_HRPOL_MASK (0x2U) -#define LPSPI_CFGR0_HRPOL_SHIFT (1U) -/*! HRPOL - Host Request Polarity - * 0b0..Active high - * 0b1..Active low - */ -#define LPSPI_CFGR0_HRPOL(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR0_HRPOL_SHIFT)) & LPSPI_CFGR0_HRPOL_MASK) - -#define LPSPI_CFGR0_HRSEL_MASK (0x4U) -#define LPSPI_CFGR0_HRSEL_SHIFT (2U) -/*! HRSEL - Host Request Select - * 0b0..HREQ pin - * 0b1..Input trigger - */ -#define LPSPI_CFGR0_HRSEL(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR0_HRSEL_SHIFT)) & LPSPI_CFGR0_HRSEL_MASK) - -#define LPSPI_CFGR0_HRDIR_MASK (0x8U) -#define LPSPI_CFGR0_HRDIR_SHIFT (3U) -/*! HRDIR - Host Request Direction - * 0b0..Input - * 0b1..Output - */ -#define LPSPI_CFGR0_HRDIR(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR0_HRDIR_SHIFT)) & LPSPI_CFGR0_HRDIR_MASK) - -#define LPSPI_CFGR0_CIRFIFO_MASK (0x100U) -#define LPSPI_CFGR0_CIRFIFO_SHIFT (8U) -/*! CIRFIFO - Circular FIFO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CFGR0_CIRFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR0_CIRFIFO_SHIFT)) & LPSPI_CFGR0_CIRFIFO_MASK) - -#define LPSPI_CFGR0_RDMO_MASK (0x200U) -#define LPSPI_CFGR0_RDMO_SHIFT (9U) -/*! RDMO - Receive Data Match Only - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CFGR0_RDMO(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR0_RDMO_SHIFT)) & LPSPI_CFGR0_RDMO_MASK) -/*! @} */ - -/*! @name CFGR1 - Configuration 1 */ -/*! @{ */ - -#define LPSPI_CFGR1_MASTER_MASK (0x1U) -#define LPSPI_CFGR1_MASTER_SHIFT (0U) -/*! MASTER - Master Mode - * 0b0..Slave mode - * 0b1..Master mode - */ -#define LPSPI_CFGR1_MASTER(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_MASTER_SHIFT)) & LPSPI_CFGR1_MASTER_MASK) - -#define LPSPI_CFGR1_SAMPLE_MASK (0x2U) -#define LPSPI_CFGR1_SAMPLE_SHIFT (1U) -/*! SAMPLE - Sample Point - * 0b0..SCK edge - * 0b1..Delayed SCK edge - */ -#define LPSPI_CFGR1_SAMPLE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_SAMPLE_SHIFT)) & LPSPI_CFGR1_SAMPLE_MASK) - -#define LPSPI_CFGR1_AUTOPCS_MASK (0x4U) -#define LPSPI_CFGR1_AUTOPCS_SHIFT (2U) -/*! AUTOPCS - Automatic PCS - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CFGR1_AUTOPCS(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_AUTOPCS_SHIFT)) & LPSPI_CFGR1_AUTOPCS_MASK) - -#define LPSPI_CFGR1_NOSTALL_MASK (0x8U) -#define LPSPI_CFGR1_NOSTALL_SHIFT (3U) -/*! NOSTALL - No Stall - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_CFGR1_NOSTALL(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_NOSTALL_SHIFT)) & LPSPI_CFGR1_NOSTALL_MASK) - -#define LPSPI_CFGR1_PARTIAL_MASK (0x10U) -#define LPSPI_CFGR1_PARTIAL_SHIFT (4U) -/*! PARTIAL - Partial Enable - * 0b0..Discard - * 0b1..Store - */ -#define LPSPI_CFGR1_PARTIAL(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_PARTIAL_SHIFT)) & LPSPI_CFGR1_PARTIAL_MASK) - -#define LPSPI_CFGR1_PCSPOL_MASK (0xF00U) -#define LPSPI_CFGR1_PCSPOL_SHIFT (8U) -/*! PCSPOL - Peripheral Chip Select Polarity - * 0b0000..Active low - * 0b0001..Active high - */ -#define LPSPI_CFGR1_PCSPOL(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_PCSPOL_SHIFT)) & LPSPI_CFGR1_PCSPOL_MASK) - -#define LPSPI_CFGR1_MATCFG_MASK (0x70000U) -#define LPSPI_CFGR1_MATCFG_SHIFT (16U) -/*! MATCFG - Match Configuration - * 0b000..Match is disabled - * 0b001.. - * 0b010..Match first data word with compare word - * 0b011..Match any data word with compare word - * 0b100..Sequential match, first data word - * 0b101..Sequential match, any data word - * 0b110..Match first data word (masked) with compare word (masked) - * 0b111..Match any data word (masked) with compare word (masked) - */ -#define LPSPI_CFGR1_MATCFG(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_MATCFG_SHIFT)) & LPSPI_CFGR1_MATCFG_MASK) - -#define LPSPI_CFGR1_PINCFG_MASK (0x3000000U) -#define LPSPI_CFGR1_PINCFG_SHIFT (24U) -/*! PINCFG - Pin Configuration - * 0b00..SIN is used for input data; SOUT is used for output data - * 0b01..SIN is used for both input and output data; only half-duplex serial transfers are supported - * 0b10..SOUT is used for both input and output data; only half-duplex serial transfers are supported - * 0b11..SOUT is used for input data; SIN is used for output data - */ -#define LPSPI_CFGR1_PINCFG(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_PINCFG_SHIFT)) & LPSPI_CFGR1_PINCFG_MASK) - -#define LPSPI_CFGR1_OUTCFG_MASK (0x4000000U) -#define LPSPI_CFGR1_OUTCFG_SHIFT (26U) -/*! OUTCFG - Output Configuration - * 0b0..Retain last value - * 0b1..3-stated - */ -#define LPSPI_CFGR1_OUTCFG(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_OUTCFG_SHIFT)) & LPSPI_CFGR1_OUTCFG_MASK) - -#define LPSPI_CFGR1_PCSCFG_MASK (0x8000000U) -#define LPSPI_CFGR1_PCSCFG_SHIFT (27U) -/*! PCSCFG - Peripheral Chip Select Configuration - * 0b0..PCS[3:2] configured for chip select function - * 0b1..PCS[3:2] configured for half-duplex 4-bit transfers (PCS[3:2] = DATA[3:2]) - */ -#define LPSPI_CFGR1_PCSCFG(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CFGR1_PCSCFG_SHIFT)) & LPSPI_CFGR1_PCSCFG_MASK) -/*! @} */ - -/*! @name DMR0 - Data Match 0 */ -/*! @{ */ - -#define LPSPI_DMR0_MATCH0_MASK (0xFFFFFFFFU) -#define LPSPI_DMR0_MATCH0_SHIFT (0U) -/*! MATCH0 - Match 0 Value */ -#define LPSPI_DMR0_MATCH0(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_DMR0_MATCH0_SHIFT)) & LPSPI_DMR0_MATCH0_MASK) -/*! @} */ - -/*! @name DMR1 - Data Match 1 */ -/*! @{ */ - -#define LPSPI_DMR1_MATCH1_MASK (0xFFFFFFFFU) -#define LPSPI_DMR1_MATCH1_SHIFT (0U) -/*! MATCH1 - Match 1 Value */ -#define LPSPI_DMR1_MATCH1(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_DMR1_MATCH1_SHIFT)) & LPSPI_DMR1_MATCH1_MASK) -/*! @} */ - -/*! @name CCR - Clock Configuration */ -/*! @{ */ - -#define LPSPI_CCR_SCKDIV_MASK (0xFFU) -#define LPSPI_CCR_SCKDIV_SHIFT (0U) -/*! SCKDIV - SCK Divider */ -#define LPSPI_CCR_SCKDIV(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR_SCKDIV_SHIFT)) & LPSPI_CCR_SCKDIV_MASK) - -#define LPSPI_CCR_DBT_MASK (0xFF00U) -#define LPSPI_CCR_DBT_SHIFT (8U) -/*! DBT - Delay Between Transfers */ -#define LPSPI_CCR_DBT(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR_DBT_SHIFT)) & LPSPI_CCR_DBT_MASK) - -#define LPSPI_CCR_PCSSCK_MASK (0xFF0000U) -#define LPSPI_CCR_PCSSCK_SHIFT (16U) -/*! PCSSCK - PCS-to-SCK Delay */ -#define LPSPI_CCR_PCSSCK(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR_PCSSCK_SHIFT)) & LPSPI_CCR_PCSSCK_MASK) - -#define LPSPI_CCR_SCKPCS_MASK (0xFF000000U) -#define LPSPI_CCR_SCKPCS_SHIFT (24U) -/*! SCKPCS - SCK-to-PCS Delay */ -#define LPSPI_CCR_SCKPCS(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR_SCKPCS_SHIFT)) & LPSPI_CCR_SCKPCS_MASK) -/*! @} */ - -/*! @name CCR1 - Clock Configuration 1 */ -/*! @{ */ - -#define LPSPI_CCR1_SCKSET_MASK (0xFFU) -#define LPSPI_CCR1_SCKSET_SHIFT (0U) -/*! SCKSET - SCK Setup */ -#define LPSPI_CCR1_SCKSET(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR1_SCKSET_SHIFT)) & LPSPI_CCR1_SCKSET_MASK) - -#define LPSPI_CCR1_SCKHLD_MASK (0xFF00U) -#define LPSPI_CCR1_SCKHLD_SHIFT (8U) -/*! SCKHLD - SCK Hold */ -#define LPSPI_CCR1_SCKHLD(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR1_SCKHLD_SHIFT)) & LPSPI_CCR1_SCKHLD_MASK) - -#define LPSPI_CCR1_PCSPCS_MASK (0xFF0000U) -#define LPSPI_CCR1_PCSPCS_SHIFT (16U) -/*! PCSPCS - PCS to PCS Delay */ -#define LPSPI_CCR1_PCSPCS(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR1_PCSPCS_SHIFT)) & LPSPI_CCR1_PCSPCS_MASK) - -#define LPSPI_CCR1_SCKSCK_MASK (0xFF000000U) -#define LPSPI_CCR1_SCKSCK_SHIFT (24U) -/*! SCKSCK - SCK Inter-Frame Delay */ -#define LPSPI_CCR1_SCKSCK(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_CCR1_SCKSCK_SHIFT)) & LPSPI_CCR1_SCKSCK_MASK) -/*! @} */ - -/*! @name FCR - FIFO Control */ -/*! @{ */ - -#define LPSPI_FCR_TXWATER_MASK (0x7U) -#define LPSPI_FCR_TXWATER_SHIFT (0U) -/*! TXWATER - Transmit FIFO Watermark */ -#define LPSPI_FCR_TXWATER(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_FCR_TXWATER_SHIFT)) & LPSPI_FCR_TXWATER_MASK) - -#define LPSPI_FCR_RXWATER_MASK (0x70000U) -#define LPSPI_FCR_RXWATER_SHIFT (16U) -/*! RXWATER - Receive FIFO Watermark */ -#define LPSPI_FCR_RXWATER(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_FCR_RXWATER_SHIFT)) & LPSPI_FCR_RXWATER_MASK) -/*! @} */ - -/*! @name FSR - FIFO Status */ -/*! @{ */ - -#define LPSPI_FSR_TXCOUNT_MASK (0xFU) -#define LPSPI_FSR_TXCOUNT_SHIFT (0U) -/*! TXCOUNT - Transmit FIFO Count */ -#define LPSPI_FSR_TXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_FSR_TXCOUNT_SHIFT)) & LPSPI_FSR_TXCOUNT_MASK) - -#define LPSPI_FSR_RXCOUNT_MASK (0xF0000U) -#define LPSPI_FSR_RXCOUNT_SHIFT (16U) -/*! RXCOUNT - Receive FIFO Count */ -#define LPSPI_FSR_RXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_FSR_RXCOUNT_SHIFT)) & LPSPI_FSR_RXCOUNT_MASK) -/*! @} */ - -/*! @name TCR - Transmit Command */ -/*! @{ */ - -#define LPSPI_TCR_FRAMESZ_MASK (0xFFFU) -#define LPSPI_TCR_FRAMESZ_SHIFT (0U) -/*! FRAMESZ - Frame Size */ -#define LPSPI_TCR_FRAMESZ(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_FRAMESZ_SHIFT)) & LPSPI_TCR_FRAMESZ_MASK) - -#define LPSPI_TCR_WIDTH_MASK (0x30000U) -#define LPSPI_TCR_WIDTH_SHIFT (16U) -/*! WIDTH - Transfer Width - * 0b00..1-bit transfer - * 0b01..2-bit transfer - * 0b10..4-bit transfer - * 0b11..Reserved - */ -#define LPSPI_TCR_WIDTH(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_WIDTH_SHIFT)) & LPSPI_TCR_WIDTH_MASK) - -#define LPSPI_TCR_TXMSK_MASK (0x40000U) -#define LPSPI_TCR_TXMSK_SHIFT (18U) -/*! TXMSK - Transmit Data Mask - * 0b0..Normal transfer - * 0b1..Mask transmit data - */ -#define LPSPI_TCR_TXMSK(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_TXMSK_SHIFT)) & LPSPI_TCR_TXMSK_MASK) - -#define LPSPI_TCR_RXMSK_MASK (0x80000U) -#define LPSPI_TCR_RXMSK_SHIFT (19U) -/*! RXMSK - Receive Data Mask - * 0b0..Normal transfer - * 0b1..Mask receive data - */ -#define LPSPI_TCR_RXMSK(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_RXMSK_SHIFT)) & LPSPI_TCR_RXMSK_MASK) - -#define LPSPI_TCR_CONTC_MASK (0x100000U) -#define LPSPI_TCR_CONTC_SHIFT (20U) -/*! CONTC - Continuing Command - * 0b0..Command word for start of new transfer - * 0b1..Command word for continuing transfer - */ -#define LPSPI_TCR_CONTC(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_CONTC_SHIFT)) & LPSPI_TCR_CONTC_MASK) - -#define LPSPI_TCR_CONT_MASK (0x200000U) -#define LPSPI_TCR_CONT_SHIFT (21U) -/*! CONT - Continuous Transfer - * 0b0..Disable - * 0b1..Enable - */ -#define LPSPI_TCR_CONT(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_CONT_SHIFT)) & LPSPI_TCR_CONT_MASK) - -#define LPSPI_TCR_BYSW_MASK (0x400000U) -#define LPSPI_TCR_BYSW_SHIFT (22U) -/*! BYSW - Byte Swap - * 0b0..Disable byte swap - * 0b1..Enable byte swap - */ -#define LPSPI_TCR_BYSW(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_BYSW_SHIFT)) & LPSPI_TCR_BYSW_MASK) - -#define LPSPI_TCR_LSBF_MASK (0x800000U) -#define LPSPI_TCR_LSBF_SHIFT (23U) -/*! LSBF - LSB First - * 0b0..MSB first - * 0b1..LSB first - */ -#define LPSPI_TCR_LSBF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_LSBF_SHIFT)) & LPSPI_TCR_LSBF_MASK) - -#define LPSPI_TCR_PCS_MASK (0x3000000U) -#define LPSPI_TCR_PCS_SHIFT (24U) -/*! PCS - Peripheral Chip Select - * 0b00..Transfer using PCS[0] - * 0b01..Transfer using PCS[1] - * 0b10..Transfer using PCS[2] - * 0b11..Transfer using PCS[3] - */ -#define LPSPI_TCR_PCS(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_PCS_SHIFT)) & LPSPI_TCR_PCS_MASK) - -#define LPSPI_TCR_PRESCALE_MASK (0x38000000U) -#define LPSPI_TCR_PRESCALE_SHIFT (27U) -/*! PRESCALE - Prescaler Value - * 0b000..Divide by 1 - * 0b001..Divide by 2 - * 0b010..Divide by 4 - * 0b011..Divide by 8 - * 0b100..Divide by 16 - * 0b101..Divide by 32 - * 0b110..Divide by 64 - * 0b111..Divide by 128 - */ -#define LPSPI_TCR_PRESCALE(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_PRESCALE_SHIFT)) & LPSPI_TCR_PRESCALE_MASK) - -#define LPSPI_TCR_CPHA_MASK (0x40000000U) -#define LPSPI_TCR_CPHA_SHIFT (30U) -/*! CPHA - Clock Phase - * 0b0..Captured - * 0b1..Changed - */ -#define LPSPI_TCR_CPHA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_CPHA_SHIFT)) & LPSPI_TCR_CPHA_MASK) - -#define LPSPI_TCR_CPOL_MASK (0x80000000U) -#define LPSPI_TCR_CPOL_SHIFT (31U) -/*! CPOL - Clock Polarity - * 0b0..Inactive low - * 0b1..Inactive high - */ -#define LPSPI_TCR_CPOL(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCR_CPOL_SHIFT)) & LPSPI_TCR_CPOL_MASK) -/*! @} */ - -/*! @name TDR - Transmit Data */ -/*! @{ */ - -#define LPSPI_TDR_DATA_MASK (0xFFFFFFFFU) -#define LPSPI_TDR_DATA_SHIFT (0U) -/*! DATA - Transmit Data */ -#define LPSPI_TDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TDR_DATA_SHIFT)) & LPSPI_TDR_DATA_MASK) -/*! @} */ - -/*! @name RSR - Receive Status */ -/*! @{ */ - -#define LPSPI_RSR_SOF_MASK (0x1U) -#define LPSPI_RSR_SOF_SHIFT (0U) -/*! SOF - Start of Frame - * 0b0..Subsequent data word - * 0b1..First data word - */ -#define LPSPI_RSR_SOF(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_RSR_SOF_SHIFT)) & LPSPI_RSR_SOF_MASK) - -#define LPSPI_RSR_RXEMPTY_MASK (0x2U) -#define LPSPI_RSR_RXEMPTY_SHIFT (1U) -/*! RXEMPTY - RX FIFO Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPSPI_RSR_RXEMPTY(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_RSR_RXEMPTY_SHIFT)) & LPSPI_RSR_RXEMPTY_MASK) -/*! @} */ - -/*! @name RDR - Receive Data */ -/*! @{ */ - -#define LPSPI_RDR_DATA_MASK (0xFFFFFFFFU) -#define LPSPI_RDR_DATA_SHIFT (0U) -/*! DATA - Receive Data */ -#define LPSPI_RDR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_RDR_DATA_SHIFT)) & LPSPI_RDR_DATA_MASK) -/*! @} */ - -/*! @name RDROR - Receive Data Read Only */ -/*! @{ */ - -#define LPSPI_RDROR_DATA_MASK (0xFFFFFFFFU) -#define LPSPI_RDROR_DATA_SHIFT (0U) -/*! DATA - Receive Data */ -#define LPSPI_RDROR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_RDROR_DATA_SHIFT)) & LPSPI_RDROR_DATA_MASK) -/*! @} */ - -/*! @name TCBR - Transmit Command Burst */ -/*! @{ */ - -#define LPSPI_TCBR_DATA_MASK (0xFFFFFFFFU) -#define LPSPI_TCBR_DATA_SHIFT (0U) -/*! DATA - Command Data */ -#define LPSPI_TCBR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TCBR_DATA_SHIFT)) & LPSPI_TCBR_DATA_MASK) -/*! @} */ - -/*! @name TDBR - Transmit Data Burst */ -/*! @{ */ - -#define LPSPI_TDBR_DATA_MASK (0xFFFFFFFFU) -#define LPSPI_TDBR_DATA_SHIFT (0U) -/*! DATA - Data */ -#define LPSPI_TDBR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_TDBR_DATA_SHIFT)) & LPSPI_TDBR_DATA_MASK) -/*! @} */ - -/* The count of LPSPI_TDBR */ -#define LPSPI_TDBR_COUNT (128U) - -/*! @name RDBR - Receive Data Burst */ -/*! @{ */ - -#define LPSPI_RDBR_DATA_MASK (0xFFFFFFFFU) -#define LPSPI_RDBR_DATA_SHIFT (0U) -/*! DATA - Data */ -#define LPSPI_RDBR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPSPI_RDBR_DATA_SHIFT)) & LPSPI_RDBR_DATA_MASK) -/*! @} */ - -/* The count of LPSPI_RDBR */ -#define LPSPI_RDBR_COUNT (128U) - - -/*! - * @} - */ /* end of group LPSPI_Register_Masks */ - - -/* LPSPI - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral LPSPI0 base address */ - #define LPSPI0_BASE (0x50092000u) - /** Peripheral LPSPI0 base address */ - #define LPSPI0_BASE_NS (0x40092000u) - /** Peripheral LPSPI0 base pointer */ - #define LPSPI0 ((LPSPI_Type *)LPSPI0_BASE) - /** Peripheral LPSPI0 base pointer */ - #define LPSPI0_NS ((LPSPI_Type *)LPSPI0_BASE_NS) - /** Peripheral LPSPI1 base address */ - #define LPSPI1_BASE (0x50093000u) - /** Peripheral LPSPI1 base address */ - #define LPSPI1_BASE_NS (0x40093000u) - /** Peripheral LPSPI1 base pointer */ - #define LPSPI1 ((LPSPI_Type *)LPSPI1_BASE) - /** Peripheral LPSPI1 base pointer */ - #define LPSPI1_NS ((LPSPI_Type *)LPSPI1_BASE_NS) - /** Peripheral LPSPI2 base address */ - #define LPSPI2_BASE (0x50094000u) - /** Peripheral LPSPI2 base address */ - #define LPSPI2_BASE_NS (0x40094000u) - /** Peripheral LPSPI2 base pointer */ - #define LPSPI2 ((LPSPI_Type *)LPSPI2_BASE) - /** Peripheral LPSPI2 base pointer */ - #define LPSPI2_NS ((LPSPI_Type *)LPSPI2_BASE_NS) - /** Peripheral LPSPI3 base address */ - #define LPSPI3_BASE (0x50095000u) - /** Peripheral LPSPI3 base address */ - #define LPSPI3_BASE_NS (0x40095000u) - /** Peripheral LPSPI3 base pointer */ - #define LPSPI3 ((LPSPI_Type *)LPSPI3_BASE) - /** Peripheral LPSPI3 base pointer */ - #define LPSPI3_NS ((LPSPI_Type *)LPSPI3_BASE_NS) - /** Peripheral LPSPI4 base address */ - #define LPSPI4_BASE (0x500B4000u) - /** Peripheral LPSPI4 base address */ - #define LPSPI4_BASE_NS (0x400B4000u) - /** Peripheral LPSPI4 base pointer */ - #define LPSPI4 ((LPSPI_Type *)LPSPI4_BASE) - /** Peripheral LPSPI4 base pointer */ - #define LPSPI4_NS ((LPSPI_Type *)LPSPI4_BASE_NS) - /** Peripheral LPSPI5 base address */ - #define LPSPI5_BASE (0x500B5000u) - /** Peripheral LPSPI5 base address */ - #define LPSPI5_BASE_NS (0x400B5000u) - /** Peripheral LPSPI5 base pointer */ - #define LPSPI5 ((LPSPI_Type *)LPSPI5_BASE) - /** Peripheral LPSPI5 base pointer */ - #define LPSPI5_NS ((LPSPI_Type *)LPSPI5_BASE_NS) - /** Peripheral LPSPI6 base address */ - #define LPSPI6_BASE (0x500B6000u) - /** Peripheral LPSPI6 base address */ - #define LPSPI6_BASE_NS (0x400B6000u) - /** Peripheral LPSPI6 base pointer */ - #define LPSPI6 ((LPSPI_Type *)LPSPI6_BASE) - /** Peripheral LPSPI6 base pointer */ - #define LPSPI6_NS ((LPSPI_Type *)LPSPI6_BASE_NS) - /** Peripheral LPSPI7 base address */ - #define LPSPI7_BASE (0x500B7000u) - /** Peripheral LPSPI7 base address */ - #define LPSPI7_BASE_NS (0x400B7000u) - /** Peripheral LPSPI7 base pointer */ - #define LPSPI7 ((LPSPI_Type *)LPSPI7_BASE) - /** Peripheral LPSPI7 base pointer */ - #define LPSPI7_NS ((LPSPI_Type *)LPSPI7_BASE_NS) - /** Peripheral LPSPI8 base address */ - #define LPSPI8_BASE (0x500B8000u) - /** Peripheral LPSPI8 base address */ - #define LPSPI8_BASE_NS (0x400B8000u) - /** Peripheral LPSPI8 base pointer */ - #define LPSPI8 ((LPSPI_Type *)LPSPI8_BASE) - /** Peripheral LPSPI8 base pointer */ - #define LPSPI8_NS ((LPSPI_Type *)LPSPI8_BASE_NS) - /** Peripheral LPSPI9 base address */ - #define LPSPI9_BASE (0x500B9000u) - /** Peripheral LPSPI9 base address */ - #define LPSPI9_BASE_NS (0x400B9000u) - /** Peripheral LPSPI9 base pointer */ - #define LPSPI9 ((LPSPI_Type *)LPSPI9_BASE) - /** Peripheral LPSPI9 base pointer */ - #define LPSPI9_NS ((LPSPI_Type *)LPSPI9_BASE_NS) - /** Array initializer of LPSPI peripheral base addresses */ - #define LPSPI_BASE_ADDRS { LPSPI0_BASE, LPSPI1_BASE, LPSPI2_BASE, LPSPI3_BASE, LPSPI4_BASE, LPSPI5_BASE, LPSPI6_BASE, LPSPI7_BASE, LPSPI8_BASE, LPSPI9_BASE } - /** Array initializer of LPSPI peripheral base pointers */ - #define LPSPI_BASE_PTRS { LPSPI0, LPSPI1, LPSPI2, LPSPI3, LPSPI4, LPSPI5, LPSPI6, LPSPI7, LPSPI8, LPSPI9 } - /** Array initializer of LPSPI peripheral base addresses */ - #define LPSPI_BASE_ADDRS_NS { LPSPI0_BASE_NS, LPSPI1_BASE_NS, LPSPI2_BASE_NS, LPSPI3_BASE_NS, LPSPI4_BASE_NS, LPSPI5_BASE_NS, LPSPI6_BASE_NS, LPSPI7_BASE_NS, LPSPI8_BASE_NS, LPSPI9_BASE_NS } - /** Array initializer of LPSPI peripheral base pointers */ - #define LPSPI_BASE_PTRS_NS { LPSPI0_NS, LPSPI1_NS, LPSPI2_NS, LPSPI3_NS, LPSPI4_NS, LPSPI5_NS, LPSPI6_NS, LPSPI7_NS, LPSPI8_NS, LPSPI9_NS } -#else - /** Peripheral LPSPI0 base address */ - #define LPSPI0_BASE (0x40092000u) - /** Peripheral LPSPI0 base pointer */ - #define LPSPI0 ((LPSPI_Type *)LPSPI0_BASE) - /** Peripheral LPSPI1 base address */ - #define LPSPI1_BASE (0x40093000u) - /** Peripheral LPSPI1 base pointer */ - #define LPSPI1 ((LPSPI_Type *)LPSPI1_BASE) - /** Peripheral LPSPI2 base address */ - #define LPSPI2_BASE (0x40094000u) - /** Peripheral LPSPI2 base pointer */ - #define LPSPI2 ((LPSPI_Type *)LPSPI2_BASE) - /** Peripheral LPSPI3 base address */ - #define LPSPI3_BASE (0x40095000u) - /** Peripheral LPSPI3 base pointer */ - #define LPSPI3 ((LPSPI_Type *)LPSPI3_BASE) - /** Peripheral LPSPI4 base address */ - #define LPSPI4_BASE (0x400B4000u) - /** Peripheral LPSPI4 base pointer */ - #define LPSPI4 ((LPSPI_Type *)LPSPI4_BASE) - /** Peripheral LPSPI5 base address */ - #define LPSPI5_BASE (0x400B5000u) - /** Peripheral LPSPI5 base pointer */ - #define LPSPI5 ((LPSPI_Type *)LPSPI5_BASE) - /** Peripheral LPSPI6 base address */ - #define LPSPI6_BASE (0x400B6000u) - /** Peripheral LPSPI6 base pointer */ - #define LPSPI6 ((LPSPI_Type *)LPSPI6_BASE) - /** Peripheral LPSPI7 base address */ - #define LPSPI7_BASE (0x400B7000u) - /** Peripheral LPSPI7 base pointer */ - #define LPSPI7 ((LPSPI_Type *)LPSPI7_BASE) - /** Peripheral LPSPI8 base address */ - #define LPSPI8_BASE (0x400B8000u) - /** Peripheral LPSPI8 base pointer */ - #define LPSPI8 ((LPSPI_Type *)LPSPI8_BASE) - /** Peripheral LPSPI9 base address */ - #define LPSPI9_BASE (0x400B9000u) - /** Peripheral LPSPI9 base pointer */ - #define LPSPI9 ((LPSPI_Type *)LPSPI9_BASE) - /** Array initializer of LPSPI peripheral base addresses */ - #define LPSPI_BASE_ADDRS { LPSPI0_BASE, LPSPI1_BASE, LPSPI2_BASE, LPSPI3_BASE, LPSPI4_BASE, LPSPI5_BASE, LPSPI6_BASE, LPSPI7_BASE, LPSPI8_BASE, LPSPI9_BASE } - /** Array initializer of LPSPI peripheral base pointers */ - #define LPSPI_BASE_PTRS { LPSPI0, LPSPI1, LPSPI2, LPSPI3, LPSPI4, LPSPI5, LPSPI6, LPSPI7, LPSPI8, LPSPI9 } -#endif -/** Interrupt vectors for the LPSPI peripheral type */ -#define LPSPI_IRQS { LP_FLEXCOMM0_IRQn, LP_FLEXCOMM1_IRQn, LP_FLEXCOMM2_IRQn, LP_FLEXCOMM3_IRQn, LP_FLEXCOMM4_IRQn, LP_FLEXCOMM5_IRQn, LP_FLEXCOMM6_IRQn, LP_FLEXCOMM7_IRQn, LP_FLEXCOMM8_IRQn, LP_FLEXCOMM9_IRQn } - -/*! - * @} - */ /* end of group LPSPI_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LPTMR Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPTMR_Peripheral_Access_Layer LPTMR Peripheral Access Layer - * @{ - */ - -/** LPTMR - Register Layout Typedef */ -typedef struct { - __IO uint32_t CSR; /**< Control Status, offset: 0x0 */ - __IO uint32_t PSR; /**< Prescaler and Glitch Filter, offset: 0x4 */ - __IO uint32_t CMR; /**< Compare, offset: 0x8 */ - __IO uint32_t CNR; /**< Counter, offset: 0xC */ -} LPTMR_Type; - -/* ---------------------------------------------------------------------------- - -- LPTMR Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPTMR_Register_Masks LPTMR Register Masks - * @{ - */ - -/*! @name CSR - Control Status */ -/*! @{ */ - -#define LPTMR_CSR_TEN_MASK (0x1U) -#define LPTMR_CSR_TEN_SHIFT (0U) -/*! TEN - Timer Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPTMR_CSR_TEN(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TEN_SHIFT)) & LPTMR_CSR_TEN_MASK) - -#define LPTMR_CSR_TMS_MASK (0x2U) -#define LPTMR_CSR_TMS_SHIFT (1U) -/*! TMS - Timer Mode Select - * 0b0..Time Counter - * 0b1..Pulse Counter - */ -#define LPTMR_CSR_TMS(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TMS_SHIFT)) & LPTMR_CSR_TMS_MASK) - -#define LPTMR_CSR_TFC_MASK (0x4U) -#define LPTMR_CSR_TFC_SHIFT (2U) -/*! TFC - Timer Free-Running Counter - * 0b0..Reset when TCF asserts - * 0b1..Reset on overflow - */ -#define LPTMR_CSR_TFC(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TFC_SHIFT)) & LPTMR_CSR_TFC_MASK) - -#define LPTMR_CSR_TPP_MASK (0x8U) -#define LPTMR_CSR_TPP_SHIFT (3U) -/*! TPP - Timer Pin Polarity - * 0b0..Active-high - * 0b1..Active-low - */ -#define LPTMR_CSR_TPP(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TPP_SHIFT)) & LPTMR_CSR_TPP_MASK) - -#define LPTMR_CSR_TPS_MASK (0x30U) -#define LPTMR_CSR_TPS_SHIFT (4U) -/*! TPS - Timer Pin Select - * 0b00..Input 0 - * 0b01..Input 1 - * 0b10..Input 2 - * 0b11..Input 3 - */ -#define LPTMR_CSR_TPS(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TPS_SHIFT)) & LPTMR_CSR_TPS_MASK) - -#define LPTMR_CSR_TIE_MASK (0x40U) -#define LPTMR_CSR_TIE_SHIFT (6U) -/*! TIE - Timer Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPTMR_CSR_TIE(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TIE_SHIFT)) & LPTMR_CSR_TIE_MASK) - -#define LPTMR_CSR_TCF_MASK (0x80U) -#define LPTMR_CSR_TCF_SHIFT (7U) -/*! TCF - Timer Compare Flag - * 0b0..CNR != (CMR + 1) - * 0b1..CNR = (CMR + 1) - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPTMR_CSR_TCF(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TCF_SHIFT)) & LPTMR_CSR_TCF_MASK) - -#define LPTMR_CSR_TDRE_MASK (0x100U) -#define LPTMR_CSR_TDRE_SHIFT (8U) -/*! TDRE - Timer DMA Request Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPTMR_CSR_TDRE(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CSR_TDRE_SHIFT)) & LPTMR_CSR_TDRE_MASK) -/*! @} */ - -/*! @name PSR - Prescaler and Glitch Filter */ -/*! @{ */ - -#define LPTMR_PSR_PCS_MASK (0x3U) -#define LPTMR_PSR_PCS_SHIFT (0U) -/*! PCS - Prescaler and Glitch Filter Clock Select - * 0b00..Clock 0 - * 0b01..Clock 1 - * 0b10..Clock 2 - * 0b11..Clock 3 - */ -#define LPTMR_PSR_PCS(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_PSR_PCS_SHIFT)) & LPTMR_PSR_PCS_MASK) - -#define LPTMR_PSR_PBYP_MASK (0x4U) -#define LPTMR_PSR_PBYP_SHIFT (2U) -/*! PBYP - Prescaler and Glitch Filter Bypass - * 0b0..Prescaler and glitch filter enable - * 0b1..Prescaler and glitch filter bypass - */ -#define LPTMR_PSR_PBYP(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_PSR_PBYP_SHIFT)) & LPTMR_PSR_PBYP_MASK) - -#define LPTMR_PSR_PRESCALE_MASK (0x78U) -#define LPTMR_PSR_PRESCALE_SHIFT (3U) -/*! PRESCALE - Prescaler and Glitch Filter Value - * 0b0000..Prescaler divides the prescaler clock by 2; glitch filter does not support this configuration - * 0b0001..Prescaler divides the prescaler clock by 4; glitch filter recognizes change on input pin after two rising clock edges - * 0b0010..Prescaler divides the prescaler clock by 8; glitch filter recognizes change on input pin after four rising clock edges - * 0b0011..Prescaler divides the prescaler clock by 16; glitch filter recognizes change on input pin after eight rising clock edges - * 0b0100..Prescaler divides the prescaler clock by 32; glitch filter recognizes change on input pin after 16 rising clock edges - * 0b0101..Prescaler divides the prescaler clock by 64; glitch filter recognizes change on input pin after 32 rising clock edges - * 0b0110..Prescaler divides the prescaler clock by 128; glitch filter recognizes change on input pin after 64 rising clock edges - * 0b0111..Prescaler divides the prescaler clock by 256; glitch filter recognizes change on input pin after 128 rising clock edges - * 0b1000..Prescaler divides the prescaler clock by 512; glitch filter recognizes change on input pin after 256 rising clock edges - * 0b1001..Prescaler divides the prescaler clock by 1024; glitch filter recognizes change on input pin after 512 rising clock edges - * 0b1010..Prescaler divides the prescaler clock by 2048; glitch filter recognizes change on input pin after 1024 rising clock edges - * 0b1011..Prescaler divides the prescaler clock by 4096; glitch filter recognizes change on input pin after 2048 rising clock edges - * 0b1100..Prescaler divides the prescaler clock by 8192; glitch filter recognizes change on input pin after 4096 rising clock edges - * 0b1101..Prescaler divides the prescaler clock by 16,384; glitch filter recognizes change on input pin after 8192 rising clock edges - * 0b1110..Prescaler divides the prescaler clock by 32,768; glitch filter recognizes change on input pin after 16,384 rising clock edges - * 0b1111..Prescaler divides the prescaler clock by 65,536; glitch filter recognizes change on input pin after 32,768 rising clock edges - */ -#define LPTMR_PSR_PRESCALE(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_PSR_PRESCALE_SHIFT)) & LPTMR_PSR_PRESCALE_MASK) -/*! @} */ - -/*! @name CMR - Compare */ -/*! @{ */ - -#define LPTMR_CMR_COMPARE_MASK (0xFFFFFFFFU) -#define LPTMR_CMR_COMPARE_SHIFT (0U) -/*! COMPARE - Compare Value */ -#define LPTMR_CMR_COMPARE(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CMR_COMPARE_SHIFT)) & LPTMR_CMR_COMPARE_MASK) -/*! @} */ - -/*! @name CNR - Counter */ -/*! @{ */ - -#define LPTMR_CNR_COUNTER_MASK (0xFFFFFFFFU) -#define LPTMR_CNR_COUNTER_SHIFT (0U) -/*! COUNTER - Counter Value */ -#define LPTMR_CNR_COUNTER(x) (((uint32_t)(((uint32_t)(x)) << LPTMR_CNR_COUNTER_SHIFT)) & LPTMR_CNR_COUNTER_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group LPTMR_Register_Masks */ - - -/* LPTMR - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral LPTMR0 base address */ - #define LPTMR0_BASE (0x5004A000u) - /** Peripheral LPTMR0 base address */ - #define LPTMR0_BASE_NS (0x4004A000u) - /** Peripheral LPTMR0 base pointer */ - #define LPTMR0 ((LPTMR_Type *)LPTMR0_BASE) - /** Peripheral LPTMR0 base pointer */ - #define LPTMR0_NS ((LPTMR_Type *)LPTMR0_BASE_NS) - /** Peripheral LPTMR1 base address */ - #define LPTMR1_BASE (0x5004B000u) - /** Peripheral LPTMR1 base address */ - #define LPTMR1_BASE_NS (0x4004B000u) - /** Peripheral LPTMR1 base pointer */ - #define LPTMR1 ((LPTMR_Type *)LPTMR1_BASE) - /** Peripheral LPTMR1 base pointer */ - #define LPTMR1_NS ((LPTMR_Type *)LPTMR1_BASE_NS) - /** Array initializer of LPTMR peripheral base addresses */ - #define LPTMR_BASE_ADDRS { LPTMR0_BASE, LPTMR1_BASE } - /** Array initializer of LPTMR peripheral base pointers */ - #define LPTMR_BASE_PTRS { LPTMR0, LPTMR1 } - /** Array initializer of LPTMR peripheral base addresses */ - #define LPTMR_BASE_ADDRS_NS { LPTMR0_BASE_NS, LPTMR1_BASE_NS } - /** Array initializer of LPTMR peripheral base pointers */ - #define LPTMR_BASE_PTRS_NS { LPTMR0_NS, LPTMR1_NS } -#else - /** Peripheral LPTMR0 base address */ - #define LPTMR0_BASE (0x4004A000u) - /** Peripheral LPTMR0 base pointer */ - #define LPTMR0 ((LPTMR_Type *)LPTMR0_BASE) - /** Peripheral LPTMR1 base address */ - #define LPTMR1_BASE (0x4004B000u) - /** Peripheral LPTMR1 base pointer */ - #define LPTMR1 ((LPTMR_Type *)LPTMR1_BASE) - /** Array initializer of LPTMR peripheral base addresses */ - #define LPTMR_BASE_ADDRS { LPTMR0_BASE, LPTMR1_BASE } - /** Array initializer of LPTMR peripheral base pointers */ - #define LPTMR_BASE_PTRS { LPTMR0, LPTMR1 } -#endif -/** Interrupt vectors for the LPTMR peripheral type */ -#define LPTMR_IRQS { LPTMR0_IRQn, LPTMR1_IRQn } - -/*! - * @} - */ /* end of group LPTMR_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LPUART Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPUART_Peripheral_Access_Layer LPUART Peripheral Access Layer - * @{ - */ - -/** LPUART - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - __IO uint32_t GLOBAL; /**< Global, offset: 0x8 */ - __IO uint32_t PINCFG; /**< Pin Configuration, offset: 0xC */ - __IO uint32_t BAUD; /**< Baud Rate, offset: 0x10 */ - __IO uint32_t STAT; /**< Status, offset: 0x14 */ - __IO uint32_t CTRL; /**< Control, offset: 0x18 */ - __IO uint32_t DATA; /**< Data, offset: 0x1C */ - __IO uint32_t MATCH; /**< Match Address, offset: 0x20 */ - __IO uint32_t MODIR; /**< MODEM IrDA, offset: 0x24 */ - __IO uint32_t FIFO; /**< FIFO, offset: 0x28 */ - __IO uint32_t WATER; /**< Watermark, offset: 0x2C */ - __I uint32_t DATARO; /**< Data Read-Only, offset: 0x30 */ - uint8_t RESERVED_0[12]; - __IO uint32_t MCR; /**< MODEM Control, offset: 0x40 */ - __IO uint32_t MSR; /**< MODEM Status, offset: 0x44 */ - __IO uint32_t REIR; /**< Receiver Extended Idle, offset: 0x48 */ - __IO uint32_t TEIR; /**< Transmitter Extended Idle, offset: 0x4C */ - __IO uint32_t HDCR; /**< Half Duplex Control, offset: 0x50 */ - uint8_t RESERVED_1[4]; - __IO uint32_t TOCR; /**< Timeout Control, offset: 0x58 */ - __IO uint32_t TOSR; /**< Timeout Status, offset: 0x5C */ - __IO uint32_t TIMEOUT[4]; /**< Timeout N, array offset: 0x60, array step: 0x4 */ - uint8_t RESERVED_2[400]; - __O uint32_t TCBR[128]; /**< Transmit Command Burst, array offset: 0x200, array step: 0x4 */ - __O uint32_t TDBR[256]; /**< Transmit Data Burst, array offset: 0x400, array step: 0x4 */ -} LPUART_Type; - -/* ---------------------------------------------------------------------------- - -- LPUART Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LPUART_Register_Masks LPUART Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define LPUART_VERID_FEATURE_MASK (0xFFFFU) -#define LPUART_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Identification Number - * 0b0000000000000001..Standard feature set - * 0b0000000000000011..Standard feature set with MODEM and IrDA support - * 0b0000000000000111..Enhanced feature set with full MODEM, IrDA, and enhanced idle detection - */ -#define LPUART_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_VERID_FEATURE_SHIFT)) & LPUART_VERID_FEATURE_MASK) - -#define LPUART_VERID_MINOR_MASK (0xFF0000U) -#define LPUART_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define LPUART_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_VERID_MINOR_SHIFT)) & LPUART_VERID_MINOR_MASK) - -#define LPUART_VERID_MAJOR_MASK (0xFF000000U) -#define LPUART_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define LPUART_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_VERID_MAJOR_SHIFT)) & LPUART_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define LPUART_PARAM_TXFIFO_MASK (0xFFU) -#define LPUART_PARAM_TXFIFO_SHIFT (0U) -/*! TXFIFO - Transmit FIFO Size */ -#define LPUART_PARAM_TXFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPUART_PARAM_TXFIFO_SHIFT)) & LPUART_PARAM_TXFIFO_MASK) - -#define LPUART_PARAM_RXFIFO_MASK (0xFF00U) -#define LPUART_PARAM_RXFIFO_SHIFT (8U) -/*! RXFIFO - Receive FIFO Size */ -#define LPUART_PARAM_RXFIFO(x) (((uint32_t)(((uint32_t)(x)) << LPUART_PARAM_RXFIFO_SHIFT)) & LPUART_PARAM_RXFIFO_MASK) -/*! @} */ - -/*! @name GLOBAL - Global */ -/*! @{ */ - -#define LPUART_GLOBAL_RST_MASK (0x2U) -#define LPUART_GLOBAL_RST_SHIFT (1U) -/*! RST - Software Reset - * 0b0..Not reset - * 0b1..Reset - */ -#define LPUART_GLOBAL_RST(x) (((uint32_t)(((uint32_t)(x)) << LPUART_GLOBAL_RST_SHIFT)) & LPUART_GLOBAL_RST_MASK) -/*! @} */ - -/*! @name PINCFG - Pin Configuration */ -/*! @{ */ - -#define LPUART_PINCFG_TRGSEL_MASK (0x3U) -#define LPUART_PINCFG_TRGSEL_SHIFT (0U) -/*! TRGSEL - Trigger Select - * 0b00..Input trigger disabled - * 0b01..Input trigger used instead of the RXD pin input - * 0b10..Input trigger used instead of the CTS_B pin input - * 0b11..Input trigger used to modulate the TXD pin output, which (after TXINV configuration) is internally ANDed with the input trigger - */ -#define LPUART_PINCFG_TRGSEL(x) (((uint32_t)(((uint32_t)(x)) << LPUART_PINCFG_TRGSEL_SHIFT)) & LPUART_PINCFG_TRGSEL_MASK) -/*! @} */ - -/*! @name BAUD - Baud Rate */ -/*! @{ */ - -#define LPUART_BAUD_SBR_MASK (0x1FFFU) -#define LPUART_BAUD_SBR_SHIFT (0U) -/*! SBR - Baud Rate Modulo Divisor */ -#define LPUART_BAUD_SBR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_SBR_SHIFT)) & LPUART_BAUD_SBR_MASK) - -#define LPUART_BAUD_SBNS_MASK (0x2000U) -#define LPUART_BAUD_SBNS_SHIFT (13U) -/*! SBNS - Stop Bit Number Select - * 0b0..One stop bit - * 0b1..Two stop bits - */ -#define LPUART_BAUD_SBNS(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_SBNS_SHIFT)) & LPUART_BAUD_SBNS_MASK) - -#define LPUART_BAUD_RXEDGIE_MASK (0x4000U) -#define LPUART_BAUD_RXEDGIE_SHIFT (14U) -/*! RXEDGIE - RX Input Active Edge Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_RXEDGIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_RXEDGIE_SHIFT)) & LPUART_BAUD_RXEDGIE_MASK) - -#define LPUART_BAUD_LBKDIE_MASK (0x8000U) -#define LPUART_BAUD_LBKDIE_SHIFT (15U) -/*! LBKDIE - LIN Break Detect Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_LBKDIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_LBKDIE_SHIFT)) & LPUART_BAUD_LBKDIE_MASK) - -#define LPUART_BAUD_RESYNCDIS_MASK (0x10000U) -#define LPUART_BAUD_RESYNCDIS_SHIFT (16U) -/*! RESYNCDIS - Resynchronization Disable - * 0b0..Enable - * 0b1..Disable - */ -#define LPUART_BAUD_RESYNCDIS(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_RESYNCDIS_SHIFT)) & LPUART_BAUD_RESYNCDIS_MASK) - -#define LPUART_BAUD_BOTHEDGE_MASK (0x20000U) -#define LPUART_BAUD_BOTHEDGE_SHIFT (17U) -/*! BOTHEDGE - Both Edge Sampling - * 0b0..Rising edge - * 0b1..Both rising and falling edges - */ -#define LPUART_BAUD_BOTHEDGE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_BOTHEDGE_SHIFT)) & LPUART_BAUD_BOTHEDGE_MASK) - -#define LPUART_BAUD_MATCFG_MASK (0xC0000U) -#define LPUART_BAUD_MATCFG_SHIFT (18U) -/*! MATCFG - Match Configuration - * 0b00..Address match wake-up - * 0b01..Idle match wake-up - * 0b10..Match on and match off - * 0b11..Enables RWU on data match and match on or off for the transmitter CTS input - */ -#define LPUART_BAUD_MATCFG(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_MATCFG_SHIFT)) & LPUART_BAUD_MATCFG_MASK) - -#define LPUART_BAUD_RIDMAE_MASK (0x100000U) -#define LPUART_BAUD_RIDMAE_SHIFT (20U) -/*! RIDMAE - Receiver Idle DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_RIDMAE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_RIDMAE_SHIFT)) & LPUART_BAUD_RIDMAE_MASK) - -#define LPUART_BAUD_RDMAE_MASK (0x200000U) -#define LPUART_BAUD_RDMAE_SHIFT (21U) -/*! RDMAE - Receiver Full DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_RDMAE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_RDMAE_SHIFT)) & LPUART_BAUD_RDMAE_MASK) - -#define LPUART_BAUD_TDMAE_MASK (0x800000U) -#define LPUART_BAUD_TDMAE_SHIFT (23U) -/*! TDMAE - Transmitter DMA Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_TDMAE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_TDMAE_SHIFT)) & LPUART_BAUD_TDMAE_MASK) - -#define LPUART_BAUD_OSR_MASK (0x1F000000U) -#define LPUART_BAUD_OSR_SHIFT (24U) -/*! OSR - Oversampling Ratio - * 0b00000..Results in an OSR of 16 - * 0b00001..Reserved - * 0b00010..Reserved - * 0b00011..Results in an OSR of 4 (requires BAUD[BOTHEDGE] to be 1) - * 0b00100..Results in an OSR of 5 (requires BAUD[BOTHEDGE] to be 1) - * 0b00101..Results in an OSR of 6 (requires BAUD[BOTHEDGE] to be 1) - * 0b00110..Results in an OSR of 7 (requires BAUD[BOTHEDGE] to be 1) - * 0b00111..Results in an OSR of 8 - * 0b01000..Results in an OSR of 9 - * 0b01001..Results in an OSR of 10 - * 0b01010..Results in an OSR of 11 - * 0b01011..Results in an OSR of 12 - * 0b01100..Results in an OSR of 13 - * 0b01101..Results in an OSR of 14 - * 0b01110..Results in an OSR of 15 - * 0b01111..Results in an OSR of 16 - * 0b10000..Results in an OSR of 17 - * 0b10001..Results in an OSR of 18 - * 0b10010..Results in an OSR of 19 - * 0b10011..Results in an OSR of 20 - * 0b10100..Results in an OSR of 21 - * 0b10101..Results in an OSR of 22 - * 0b10110..Results in an OSR of 23 - * 0b10111..Results in an OSR of 24 - * 0b11000..Results in an OSR of 25 - * 0b11001..Results in an OSR of 26 - * 0b11010..Results in an OSR of 27 - * 0b11011..Results in an OSR of 28 - * 0b11100..Results in an OSR of 29 - * 0b11101..Results in an OSR of 30 - * 0b11110..Results in an OSR of 31 - * 0b11111..Results in an OSR of 32 - */ -#define LPUART_BAUD_OSR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_OSR_SHIFT)) & LPUART_BAUD_OSR_MASK) - -#define LPUART_BAUD_M10_MASK (0x20000000U) -#define LPUART_BAUD_M10_SHIFT (29U) -/*! M10 - 10-Bit Mode Select - * 0b0..Receiver and transmitter use 7-bit to 9-bit data characters - * 0b1..Receiver and transmitter use 10-bit data characters - */ -#define LPUART_BAUD_M10(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_M10_SHIFT)) & LPUART_BAUD_M10_MASK) - -#define LPUART_BAUD_MAEN2_MASK (0x40000000U) -#define LPUART_BAUD_MAEN2_SHIFT (30U) -/*! MAEN2 - Match Address Mode Enable 2 - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_MAEN2(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_MAEN2_SHIFT)) & LPUART_BAUD_MAEN2_MASK) - -#define LPUART_BAUD_MAEN1_MASK (0x80000000U) -#define LPUART_BAUD_MAEN1_SHIFT (31U) -/*! MAEN1 - Match Address Mode Enable 1 - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_BAUD_MAEN1(x) (((uint32_t)(((uint32_t)(x)) << LPUART_BAUD_MAEN1_SHIFT)) & LPUART_BAUD_MAEN1_MASK) -/*! @} */ - -/*! @name STAT - Status */ -/*! @{ */ - -#define LPUART_STAT_LBKFE_MASK (0x1U) -#define LPUART_STAT_LBKFE_SHIFT (0U) -/*! LBKFE - LIN Break Flag Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_STAT_LBKFE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_LBKFE_SHIFT)) & LPUART_STAT_LBKFE_MASK) - -#define LPUART_STAT_AME_MASK (0x2U) -#define LPUART_STAT_AME_SHIFT (1U) -/*! AME - Address Mark Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_STAT_AME(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_AME_SHIFT)) & LPUART_STAT_AME_MASK) - -#define LPUART_STAT_MSF_MASK (0x100U) -#define LPUART_STAT_MSF_SHIFT (8U) -/*! MSF - MODEM Status Flag - * 0b0..Field is 0 - * 0b1..Field is 1 - */ -#define LPUART_STAT_MSF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_MSF_SHIFT)) & LPUART_STAT_MSF_MASK) - -#define LPUART_STAT_TSF_MASK (0x200U) -#define LPUART_STAT_TSF_SHIFT (9U) -/*! TSF - Timeout Status Flag - * 0b0..Field is 0 - * 0b1..Field is 1 - */ -#define LPUART_STAT_TSF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_TSF_SHIFT)) & LPUART_STAT_TSF_MASK) - -#define LPUART_STAT_MA2F_MASK (0x4000U) -#define LPUART_STAT_MA2F_SHIFT (14U) -/*! MA2F - Match 2 Flag - * 0b0..Not equal to MA2 - * 0b1..Equal to MA2 - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_MA2F(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_MA2F_SHIFT)) & LPUART_STAT_MA2F_MASK) - -#define LPUART_STAT_MA1F_MASK (0x8000U) -#define LPUART_STAT_MA1F_SHIFT (15U) -/*! MA1F - Match 1 Flag - * 0b0..Not equal to MA1 - * 0b1..Equal to MA1 - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_MA1F(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_MA1F_SHIFT)) & LPUART_STAT_MA1F_MASK) - -#define LPUART_STAT_PF_MASK (0x10000U) -#define LPUART_STAT_PF_SHIFT (16U) -/*! PF - Parity Error Flag - * 0b0..No parity error detected - * 0b1..Parity error detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_PF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_PF_SHIFT)) & LPUART_STAT_PF_MASK) - -#define LPUART_STAT_FE_MASK (0x20000U) -#define LPUART_STAT_FE_SHIFT (17U) -/*! FE - Framing Error Flag - * 0b0..No framing error detected (this does not guarantee that the framing is correct) - * 0b1..Framing error detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_FE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_FE_SHIFT)) & LPUART_STAT_FE_MASK) - -#define LPUART_STAT_NF_MASK (0x40000U) -#define LPUART_STAT_NF_SHIFT (18U) -/*! NF - Noise Flag - * 0b0..No noise detected - * 0b1..Noise detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_NF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_NF_SHIFT)) & LPUART_STAT_NF_MASK) - -#define LPUART_STAT_OR_MASK (0x80000U) -#define LPUART_STAT_OR_SHIFT (19U) -/*! OR - Receiver Overrun Flag - * 0b0..No overrun - * 0b1..Receive overrun (new LPUART data is lost) - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_OR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_OR_SHIFT)) & LPUART_STAT_OR_MASK) - -#define LPUART_STAT_IDLE_MASK (0x100000U) -#define LPUART_STAT_IDLE_SHIFT (20U) -/*! IDLE - Idle Line Flag - * 0b0..Idle line detected - * 0b1..Idle line not detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_IDLE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_IDLE_SHIFT)) & LPUART_STAT_IDLE_MASK) - -#define LPUART_STAT_RDRF_MASK (0x200000U) -#define LPUART_STAT_RDRF_SHIFT (21U) -/*! RDRF - Receive Data Register Full Flag - * 0b0..Equal to or less than watermark - * 0b1..Greater than watermark - */ -#define LPUART_STAT_RDRF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_RDRF_SHIFT)) & LPUART_STAT_RDRF_MASK) - -#define LPUART_STAT_TC_MASK (0x400000U) -#define LPUART_STAT_TC_SHIFT (22U) -/*! TC - Transmission Complete Flag - * 0b0..Transmitter active - * 0b1..Transmitter idle - */ -#define LPUART_STAT_TC(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_TC_SHIFT)) & LPUART_STAT_TC_MASK) - -#define LPUART_STAT_TDRE_MASK (0x800000U) -#define LPUART_STAT_TDRE_SHIFT (23U) -/*! TDRE - Transmit Data Register Empty Flag - * 0b0..Greater than watermark - * 0b1..Equal to or less than watermark - */ -#define LPUART_STAT_TDRE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_TDRE_SHIFT)) & LPUART_STAT_TDRE_MASK) - -#define LPUART_STAT_RAF_MASK (0x1000000U) -#define LPUART_STAT_RAF_SHIFT (24U) -/*! RAF - Receiver Active Flag - * 0b0..Idle, waiting for a start bit - * 0b1..Receiver active (RXD pin input not idle) - */ -#define LPUART_STAT_RAF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_RAF_SHIFT)) & LPUART_STAT_RAF_MASK) - -#define LPUART_STAT_LBKDE_MASK (0x2000000U) -#define LPUART_STAT_LBKDE_SHIFT (25U) -/*! LBKDE - LIN Break Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_STAT_LBKDE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_LBKDE_SHIFT)) & LPUART_STAT_LBKDE_MASK) - -#define LPUART_STAT_BRK13_MASK (0x4000000U) -#define LPUART_STAT_BRK13_SHIFT (26U) -/*! BRK13 - Break Character Generation Length - * 0b0..9 to 13 bit times - * 0b1..12 to 15 bit times - */ -#define LPUART_STAT_BRK13(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_BRK13_SHIFT)) & LPUART_STAT_BRK13_MASK) - -#define LPUART_STAT_RWUID_MASK (0x8000000U) -#define LPUART_STAT_RWUID_SHIFT (27U) -/*! RWUID - Receive Wake Up Idle Detect - * 0b0..STAT[IDLE] does not become 1 - * 0b1..STAT[IDLE] becomes 1 - */ -#define LPUART_STAT_RWUID(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_RWUID_SHIFT)) & LPUART_STAT_RWUID_MASK) - -#define LPUART_STAT_RXINV_MASK (0x10000000U) -#define LPUART_STAT_RXINV_SHIFT (28U) -/*! RXINV - Receive Data Inversion - * 0b0..Inverted - * 0b1..Not inverted - */ -#define LPUART_STAT_RXINV(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_RXINV_SHIFT)) & LPUART_STAT_RXINV_MASK) - -#define LPUART_STAT_MSBF_MASK (0x20000000U) -#define LPUART_STAT_MSBF_SHIFT (29U) -/*! MSBF - MSB First - * 0b0..LSB - * 0b1..MSB - */ -#define LPUART_STAT_MSBF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_MSBF_SHIFT)) & LPUART_STAT_MSBF_MASK) - -#define LPUART_STAT_RXEDGIF_MASK (0x40000000U) -#define LPUART_STAT_RXEDGIF_SHIFT (30U) -/*! RXEDGIF - RXD Pin Active Edge Interrupt Flag - * 0b0..Not occurred - * 0b1..Occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_RXEDGIF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_RXEDGIF_SHIFT)) & LPUART_STAT_RXEDGIF_MASK) - -#define LPUART_STAT_LBKDIF_MASK (0x80000000U) -#define LPUART_STAT_LBKDIF_SHIFT (31U) -/*! LBKDIF - LIN Break Detect Interrupt Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_STAT_LBKDIF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_STAT_LBKDIF_SHIFT)) & LPUART_STAT_LBKDIF_MASK) -/*! @} */ - -/*! @name CTRL - Control */ -/*! @{ */ - -#define LPUART_CTRL_PT_MASK (0x1U) -#define LPUART_CTRL_PT_SHIFT (0U) -/*! PT - Parity Type - * 0b0..Even parity - * 0b1..Odd parity - */ -#define LPUART_CTRL_PT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_PT_SHIFT)) & LPUART_CTRL_PT_MASK) - -#define LPUART_CTRL_PE_MASK (0x2U) -#define LPUART_CTRL_PE_SHIFT (1U) -/*! PE - Parity Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_PE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_PE_SHIFT)) & LPUART_CTRL_PE_MASK) - -#define LPUART_CTRL_ILT_MASK (0x4U) -#define LPUART_CTRL_ILT_SHIFT (2U) -/*! ILT - Idle Line Type Select - * 0b0..After the start bit - * 0b1..After the stop bit - */ -#define LPUART_CTRL_ILT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_ILT_SHIFT)) & LPUART_CTRL_ILT_MASK) - -#define LPUART_CTRL_WAKE_MASK (0x8U) -#define LPUART_CTRL_WAKE_SHIFT (3U) -/*! WAKE - Receiver Wake-Up Method Select - * 0b0..Idle - * 0b1..Mark - */ -#define LPUART_CTRL_WAKE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_WAKE_SHIFT)) & LPUART_CTRL_WAKE_MASK) - -#define LPUART_CTRL_M_MASK (0x10U) -#define LPUART_CTRL_M_SHIFT (4U) -/*! M - 9-Bit Or 8-Bit Mode Select - * 0b0..8-bit - * 0b1..9-bit - */ -#define LPUART_CTRL_M(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_M_SHIFT)) & LPUART_CTRL_M_MASK) - -#define LPUART_CTRL_RSRC_MASK (0x20U) -#define LPUART_CTRL_RSRC_SHIFT (5U) -/*! RSRC - Receiver Source Select - * 0b0..Internal Loopback mode - * 0b1..Single-wire mode - */ -#define LPUART_CTRL_RSRC(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_RSRC_SHIFT)) & LPUART_CTRL_RSRC_MASK) - -#define LPUART_CTRL_DOZEEN_MASK (0x40U) -#define LPUART_CTRL_DOZEEN_SHIFT (6U) -/*! DOZEEN - Doze Mode - * 0b0..Enable - * 0b1..Disable - */ -#define LPUART_CTRL_DOZEEN(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_DOZEEN_SHIFT)) & LPUART_CTRL_DOZEEN_MASK) - -#define LPUART_CTRL_LOOPS_MASK (0x80U) -#define LPUART_CTRL_LOOPS_SHIFT (7U) -/*! LOOPS - Loop Mode Select - * 0b0..Normal operation: RXD and TXD use separate pins - * 0b1..Loop mode or Single-Wire mode - */ -#define LPUART_CTRL_LOOPS(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_LOOPS_SHIFT)) & LPUART_CTRL_LOOPS_MASK) - -#define LPUART_CTRL_IDLECFG_MASK (0x700U) -#define LPUART_CTRL_IDLECFG_SHIFT (8U) -/*! IDLECFG - Idle Configuration - * 0b000..1 - * 0b001..2 - * 0b010..4 - * 0b011..8 - * 0b100..16 - * 0b101..32 - * 0b110..64 - * 0b111..128 - */ -#define LPUART_CTRL_IDLECFG(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_IDLECFG_SHIFT)) & LPUART_CTRL_IDLECFG_MASK) - -#define LPUART_CTRL_M7_MASK (0x800U) -#define LPUART_CTRL_M7_SHIFT (11U) -/*! M7 - 7-Bit Mode Select - * 0b0..8-bit to 10-bit - * 0b1..7-bit - */ -#define LPUART_CTRL_M7(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_M7_SHIFT)) & LPUART_CTRL_M7_MASK) - -#define LPUART_CTRL_MA2IE_MASK (0x4000U) -#define LPUART_CTRL_MA2IE_SHIFT (14U) -/*! MA2IE - Match 2 (MA2F) Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_MA2IE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_MA2IE_SHIFT)) & LPUART_CTRL_MA2IE_MASK) - -#define LPUART_CTRL_MA1IE_MASK (0x8000U) -#define LPUART_CTRL_MA1IE_SHIFT (15U) -/*! MA1IE - Match 1 (MA1F) Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_MA1IE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_MA1IE_SHIFT)) & LPUART_CTRL_MA1IE_MASK) - -#define LPUART_CTRL_SBK_MASK (0x10000U) -#define LPUART_CTRL_SBK_SHIFT (16U) -/*! SBK - Send Break - * 0b0..Normal transmitter operation - * 0b1..Queue break character(s) to be sent - */ -#define LPUART_CTRL_SBK(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_SBK_SHIFT)) & LPUART_CTRL_SBK_MASK) - -#define LPUART_CTRL_RWU_MASK (0x20000U) -#define LPUART_CTRL_RWU_SHIFT (17U) -/*! RWU - Receiver Wake-Up Control - * 0b0..Normal receiver operation - * 0b1..LPUART receiver in standby, waiting for a wake-up condition - */ -#define LPUART_CTRL_RWU(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_RWU_SHIFT)) & LPUART_CTRL_RWU_MASK) - -#define LPUART_CTRL_RE_MASK (0x40000U) -#define LPUART_CTRL_RE_SHIFT (18U) -/*! RE - Receiver Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_RE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_RE_SHIFT)) & LPUART_CTRL_RE_MASK) - -#define LPUART_CTRL_TE_MASK (0x80000U) -#define LPUART_CTRL_TE_SHIFT (19U) -/*! TE - Transmitter Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_TE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_TE_SHIFT)) & LPUART_CTRL_TE_MASK) - -#define LPUART_CTRL_ILIE_MASK (0x100000U) -#define LPUART_CTRL_ILIE_SHIFT (20U) -/*! ILIE - Idle Line Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_ILIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_ILIE_SHIFT)) & LPUART_CTRL_ILIE_MASK) - -#define LPUART_CTRL_RIE_MASK (0x200000U) -#define LPUART_CTRL_RIE_SHIFT (21U) -/*! RIE - Receiver Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_RIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_RIE_SHIFT)) & LPUART_CTRL_RIE_MASK) - -#define LPUART_CTRL_TCIE_MASK (0x400000U) -#define LPUART_CTRL_TCIE_SHIFT (22U) -/*! TCIE - Transmission Complete Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_TCIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_TCIE_SHIFT)) & LPUART_CTRL_TCIE_MASK) - -#define LPUART_CTRL_TIE_MASK (0x800000U) -#define LPUART_CTRL_TIE_SHIFT (23U) -/*! TIE - Transmit Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_TIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_TIE_SHIFT)) & LPUART_CTRL_TIE_MASK) - -#define LPUART_CTRL_PEIE_MASK (0x1000000U) -#define LPUART_CTRL_PEIE_SHIFT (24U) -/*! PEIE - Parity Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_PEIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_PEIE_SHIFT)) & LPUART_CTRL_PEIE_MASK) - -#define LPUART_CTRL_FEIE_MASK (0x2000000U) -#define LPUART_CTRL_FEIE_SHIFT (25U) -/*! FEIE - Framing Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_FEIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_FEIE_SHIFT)) & LPUART_CTRL_FEIE_MASK) - -#define LPUART_CTRL_NEIE_MASK (0x4000000U) -#define LPUART_CTRL_NEIE_SHIFT (26U) -/*! NEIE - Noise Error Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_NEIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_NEIE_SHIFT)) & LPUART_CTRL_NEIE_MASK) - -#define LPUART_CTRL_ORIE_MASK (0x8000000U) -#define LPUART_CTRL_ORIE_SHIFT (27U) -/*! ORIE - Overrun Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_CTRL_ORIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_ORIE_SHIFT)) & LPUART_CTRL_ORIE_MASK) - -#define LPUART_CTRL_TXINV_MASK (0x10000000U) -#define LPUART_CTRL_TXINV_SHIFT (28U) -/*! TXINV - Transmit Data Inversion - * 0b0..Not inverted - * 0b1..Inverted - */ -#define LPUART_CTRL_TXINV(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_TXINV_SHIFT)) & LPUART_CTRL_TXINV_MASK) - -#define LPUART_CTRL_TXDIR_MASK (0x20000000U) -#define LPUART_CTRL_TXDIR_SHIFT (29U) -/*! TXDIR - TXD Pin Direction in Single-Wire Mode - * 0b0..Input - * 0b1..Output - */ -#define LPUART_CTRL_TXDIR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_TXDIR_SHIFT)) & LPUART_CTRL_TXDIR_MASK) - -#define LPUART_CTRL_R9T8_MASK (0x40000000U) -#define LPUART_CTRL_R9T8_SHIFT (30U) -/*! R9T8 - Receive Bit 9 Transmit Bit 8 */ -#define LPUART_CTRL_R9T8(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_R9T8_SHIFT)) & LPUART_CTRL_R9T8_MASK) - -#define LPUART_CTRL_R8T9_MASK (0x80000000U) -#define LPUART_CTRL_R8T9_SHIFT (31U) -/*! R8T9 - Receive Bit 8 Transmit Bit 9 */ -#define LPUART_CTRL_R8T9(x) (((uint32_t)(((uint32_t)(x)) << LPUART_CTRL_R8T9_SHIFT)) & LPUART_CTRL_R8T9_MASK) -/*! @} */ - -/*! @name DATA - Data */ -/*! @{ */ - -#define LPUART_DATA_R0T0_MASK (0x1U) -#define LPUART_DATA_R0T0_SHIFT (0U) -/*! R0T0 - Read receive FIFO bit 0 or write transmit FIFO bit 0 */ -#define LPUART_DATA_R0T0(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R0T0_SHIFT)) & LPUART_DATA_R0T0_MASK) - -#define LPUART_DATA_R1T1_MASK (0x2U) -#define LPUART_DATA_R1T1_SHIFT (1U) -/*! R1T1 - Read receive FIFO bit 1 or write transmit FIFO bit 1 */ -#define LPUART_DATA_R1T1(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R1T1_SHIFT)) & LPUART_DATA_R1T1_MASK) - -#define LPUART_DATA_R2T2_MASK (0x4U) -#define LPUART_DATA_R2T2_SHIFT (2U) -/*! R2T2 - Read receive FIFO bit 2 or write transmit FIFO bit 2 */ -#define LPUART_DATA_R2T2(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R2T2_SHIFT)) & LPUART_DATA_R2T2_MASK) - -#define LPUART_DATA_R3T3_MASK (0x8U) -#define LPUART_DATA_R3T3_SHIFT (3U) -/*! R3T3 - Read receive FIFO bit 3 or write transmit FIFO bit 3 */ -#define LPUART_DATA_R3T3(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R3T3_SHIFT)) & LPUART_DATA_R3T3_MASK) - -#define LPUART_DATA_R4T4_MASK (0x10U) -#define LPUART_DATA_R4T4_SHIFT (4U) -/*! R4T4 - Read receive FIFO bit 4 or write transmit FIFO bit 4 */ -#define LPUART_DATA_R4T4(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R4T4_SHIFT)) & LPUART_DATA_R4T4_MASK) - -#define LPUART_DATA_R5T5_MASK (0x20U) -#define LPUART_DATA_R5T5_SHIFT (5U) -/*! R5T5 - Read receive FIFO bit 5 or write transmit FIFO bit 5 */ -#define LPUART_DATA_R5T5(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R5T5_SHIFT)) & LPUART_DATA_R5T5_MASK) - -#define LPUART_DATA_R6T6_MASK (0x40U) -#define LPUART_DATA_R6T6_SHIFT (6U) -/*! R6T6 - Read receive FIFO bit 6 or write transmit FIFO bit 6 */ -#define LPUART_DATA_R6T6(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R6T6_SHIFT)) & LPUART_DATA_R6T6_MASK) - -#define LPUART_DATA_R7T7_MASK (0x80U) -#define LPUART_DATA_R7T7_SHIFT (7U) -/*! R7T7 - Read receive FIFO bit 7 or write transmit FIFO bit 7 */ -#define LPUART_DATA_R7T7(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R7T7_SHIFT)) & LPUART_DATA_R7T7_MASK) - -#define LPUART_DATA_R8T8_MASK (0x100U) -#define LPUART_DATA_R8T8_SHIFT (8U) -/*! R8T8 - Read receive FIFO bit 8 or write transmit FIFO bit 8 */ -#define LPUART_DATA_R8T8(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R8T8_SHIFT)) & LPUART_DATA_R8T8_MASK) - -#define LPUART_DATA_R9T9_MASK (0x200U) -#define LPUART_DATA_R9T9_SHIFT (9U) -/*! R9T9 - Read receive FIFO bit 9 or write transmit FIFO bit 9 */ -#define LPUART_DATA_R9T9(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_R9T9_SHIFT)) & LPUART_DATA_R9T9_MASK) - -#define LPUART_DATA_LINBRK_MASK (0x400U) -#define LPUART_DATA_LINBRK_SHIFT (10U) -/*! LINBRK - LIN Break - * 0b0..Not detected - * 0b1..Detected - */ -#define LPUART_DATA_LINBRK(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_LINBRK_SHIFT)) & LPUART_DATA_LINBRK_MASK) - -#define LPUART_DATA_IDLINE_MASK (0x800U) -#define LPUART_DATA_IDLINE_SHIFT (11U) -/*! IDLINE - Idle Line - * 0b0..Not idle - * 0b1..Idle - */ -#define LPUART_DATA_IDLINE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_IDLINE_SHIFT)) & LPUART_DATA_IDLINE_MASK) - -#define LPUART_DATA_RXEMPT_MASK (0x1000U) -#define LPUART_DATA_RXEMPT_SHIFT (12U) -/*! RXEMPT - Receive Buffer Empty - * 0b0..Valid data - * 0b1..Invalid data and empty - */ -#define LPUART_DATA_RXEMPT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_RXEMPT_SHIFT)) & LPUART_DATA_RXEMPT_MASK) - -#define LPUART_DATA_FRETSC_MASK (0x2000U) -#define LPUART_DATA_FRETSC_SHIFT (13U) -/*! FRETSC - Frame Error Transmit Special Character - * 0b0..Received without a frame error on reads or transmits a normal character on writes - * 0b1..Received with a frame error on reads or transmits an idle or break character on writes - */ -#define LPUART_DATA_FRETSC(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_FRETSC_SHIFT)) & LPUART_DATA_FRETSC_MASK) - -#define LPUART_DATA_PARITYE_MASK (0x4000U) -#define LPUART_DATA_PARITYE_SHIFT (14U) -/*! PARITYE - Parity Error - * 0b0..Received without a parity error - * 0b1..Received with a parity error - */ -#define LPUART_DATA_PARITYE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_PARITYE_SHIFT)) & LPUART_DATA_PARITYE_MASK) - -#define LPUART_DATA_NOISY_MASK (0x8000U) -#define LPUART_DATA_NOISY_SHIFT (15U) -/*! NOISY - Noisy Data Received - * 0b0..Received without noise - * 0b1..Received with noise - */ -#define LPUART_DATA_NOISY(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATA_NOISY_SHIFT)) & LPUART_DATA_NOISY_MASK) -/*! @} */ - -/*! @name MATCH - Match Address */ -/*! @{ */ - -#define LPUART_MATCH_MA1_MASK (0x3FFU) -#define LPUART_MATCH_MA1_SHIFT (0U) -/*! MA1 - Match Address 1 */ -#define LPUART_MATCH_MA1(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MATCH_MA1_SHIFT)) & LPUART_MATCH_MA1_MASK) - -#define LPUART_MATCH_MA2_MASK (0x3FF0000U) -#define LPUART_MATCH_MA2_SHIFT (16U) -/*! MA2 - Match Address 2 */ -#define LPUART_MATCH_MA2(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MATCH_MA2_SHIFT)) & LPUART_MATCH_MA2_MASK) -/*! @} */ - -/*! @name MODIR - MODEM IrDA */ -/*! @{ */ - -#define LPUART_MODIR_TXCTSE_MASK (0x1U) -#define LPUART_MODIR_TXCTSE_SHIFT (0U) -/*! TXCTSE - Transmitter CTS Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_MODIR_TXCTSE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_TXCTSE_SHIFT)) & LPUART_MODIR_TXCTSE_MASK) - -#define LPUART_MODIR_TXRTSE_MASK (0x2U) -#define LPUART_MODIR_TXRTSE_SHIFT (1U) -/*! TXRTSE - Transmitter RTS Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_MODIR_TXRTSE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_TXRTSE_SHIFT)) & LPUART_MODIR_TXRTSE_MASK) - -#define LPUART_MODIR_TXRTSPOL_MASK (0x4U) -#define LPUART_MODIR_TXRTSPOL_SHIFT (2U) -/*! TXRTSPOL - Transmitter RTS Polarity - * 0b0..Active low - * 0b1..Active high - */ -#define LPUART_MODIR_TXRTSPOL(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_TXRTSPOL_SHIFT)) & LPUART_MODIR_TXRTSPOL_MASK) - -#define LPUART_MODIR_RXRTSE_MASK (0x8U) -#define LPUART_MODIR_RXRTSE_SHIFT (3U) -/*! RXRTSE - Receiver RTS Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_MODIR_RXRTSE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_RXRTSE_SHIFT)) & LPUART_MODIR_RXRTSE_MASK) - -#define LPUART_MODIR_TXCTSC_MASK (0x10U) -#define LPUART_MODIR_TXCTSC_SHIFT (4U) -/*! TXCTSC - Transmit CTS Configuration - * 0b0..Sampled at the start of each character - * 0b1..Sampled when the transmitter is idle - */ -#define LPUART_MODIR_TXCTSC(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_TXCTSC_SHIFT)) & LPUART_MODIR_TXCTSC_MASK) - -#define LPUART_MODIR_TXCTSSRC_MASK (0x20U) -#define LPUART_MODIR_TXCTSSRC_SHIFT (5U) -/*! TXCTSSRC - Transmit CTS Source - * 0b0..The CTS_B pin - * 0b1..An internal connection to the receiver address match result - */ -#define LPUART_MODIR_TXCTSSRC(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_TXCTSSRC_SHIFT)) & LPUART_MODIR_TXCTSSRC_MASK) - -#define LPUART_MODIR_RTSWATER_MASK (0x700U) -#define LPUART_MODIR_RTSWATER_SHIFT (8U) -/*! RTSWATER - Receive RTS Configuration */ -#define LPUART_MODIR_RTSWATER(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_RTSWATER_SHIFT)) & LPUART_MODIR_RTSWATER_MASK) - -#define LPUART_MODIR_TNP_MASK (0x30000U) -#define LPUART_MODIR_TNP_SHIFT (16U) -/*! TNP - Transmitter Narrow Pulse - * 0b00..1 / OSR - * 0b01..2 / OSR - * 0b10..3 / OSR - * 0b11..4 / OSR - */ -#define LPUART_MODIR_TNP(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_TNP_SHIFT)) & LPUART_MODIR_TNP_MASK) - -#define LPUART_MODIR_IREN_MASK (0x40000U) -#define LPUART_MODIR_IREN_SHIFT (18U) -/*! IREN - IR Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_MODIR_IREN(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MODIR_IREN_SHIFT)) & LPUART_MODIR_IREN_MASK) -/*! @} */ - -/*! @name FIFO - FIFO */ -/*! @{ */ - -#define LPUART_FIFO_RXFIFOSIZE_MASK (0x7U) -#define LPUART_FIFO_RXFIFOSIZE_SHIFT (0U) -/*! RXFIFOSIZE - Receive FIFO Buffer Depth - * 0b000..1 - * 0b001..4 - * 0b010..8 - * 0b011..16 - * 0b100..32 - * 0b101..64 - * 0b110..128 - * 0b111..256 - */ -#define LPUART_FIFO_RXFIFOSIZE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXFIFOSIZE_SHIFT)) & LPUART_FIFO_RXFIFOSIZE_MASK) - -#define LPUART_FIFO_RXFE_MASK (0x8U) -#define LPUART_FIFO_RXFE_SHIFT (3U) -/*! RXFE - Receive FIFO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_FIFO_RXFE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXFE_SHIFT)) & LPUART_FIFO_RXFE_MASK) - -#define LPUART_FIFO_TXFIFOSIZE_MASK (0x70U) -#define LPUART_FIFO_TXFIFOSIZE_SHIFT (4U) -/*! TXFIFOSIZE - Transmit FIFO Buffer Depth - * 0b000..1 - * 0b001..4 - * 0b010..8 - * 0b011..16 - * 0b100..32 - * 0b101..64 - * 0b110..128 - * 0b111..256 - */ -#define LPUART_FIFO_TXFIFOSIZE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_TXFIFOSIZE_SHIFT)) & LPUART_FIFO_TXFIFOSIZE_MASK) - -#define LPUART_FIFO_TXFE_MASK (0x80U) -#define LPUART_FIFO_TXFE_SHIFT (7U) -/*! TXFE - Transmit FIFO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_FIFO_TXFE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_TXFE_SHIFT)) & LPUART_FIFO_TXFE_MASK) - -#define LPUART_FIFO_RXUFE_MASK (0x100U) -#define LPUART_FIFO_RXUFE_SHIFT (8U) -/*! RXUFE - Receive FIFO Underflow Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_FIFO_RXUFE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXUFE_SHIFT)) & LPUART_FIFO_RXUFE_MASK) - -#define LPUART_FIFO_TXOFE_MASK (0x200U) -#define LPUART_FIFO_TXOFE_SHIFT (9U) -/*! TXOFE - Transmit FIFO Overflow Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define LPUART_FIFO_TXOFE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_TXOFE_SHIFT)) & LPUART_FIFO_TXOFE_MASK) - -#define LPUART_FIFO_RXIDEN_MASK (0x1C00U) -#define LPUART_FIFO_RXIDEN_SHIFT (10U) -/*! RXIDEN - Receiver Idle Empty Enable - * 0b000..Disable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle - * 0b001..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for one character - * 0b010..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for two characters - * 0b011..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for four characters - * 0b100..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for eight characters - * 0b101..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for 16 characters - * 0b110..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for 32 characters - * 0b111..Enable STAT[RDRF] to become 1 because of partially filled FIFO when the receiver is idle for 64 characters - */ -#define LPUART_FIFO_RXIDEN(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXIDEN_SHIFT)) & LPUART_FIFO_RXIDEN_MASK) - -#define LPUART_FIFO_RXFLUSH_MASK (0x4000U) -#define LPUART_FIFO_RXFLUSH_SHIFT (14U) -/*! RXFLUSH - Receive FIFO Flush - * 0b0..No effect - * 0b1..All data flushed out - */ -#define LPUART_FIFO_RXFLUSH(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXFLUSH_SHIFT)) & LPUART_FIFO_RXFLUSH_MASK) - -#define LPUART_FIFO_TXFLUSH_MASK (0x8000U) -#define LPUART_FIFO_TXFLUSH_SHIFT (15U) -/*! TXFLUSH - Transmit FIFO Flush - * 0b0..No effect - * 0b1..All data flushed out - */ -#define LPUART_FIFO_TXFLUSH(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_TXFLUSH_SHIFT)) & LPUART_FIFO_TXFLUSH_MASK) - -#define LPUART_FIFO_RXUF_MASK (0x10000U) -#define LPUART_FIFO_RXUF_SHIFT (16U) -/*! RXUF - Receiver FIFO Underflow Flag - * 0b0..No underflow - * 0b1..Underflow - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_FIFO_RXUF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXUF_SHIFT)) & LPUART_FIFO_RXUF_MASK) - -#define LPUART_FIFO_TXOF_MASK (0x20000U) -#define LPUART_FIFO_TXOF_SHIFT (17U) -/*! TXOF - Transmitter FIFO Overflow Flag - * 0b0..No overflow - * 0b1..Overflow - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_FIFO_TXOF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_TXOF_SHIFT)) & LPUART_FIFO_TXOF_MASK) - -#define LPUART_FIFO_RXEMPT_MASK (0x400000U) -#define LPUART_FIFO_RXEMPT_SHIFT (22U) -/*! RXEMPT - Receive FIFO Or Buffer Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPUART_FIFO_RXEMPT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_RXEMPT_SHIFT)) & LPUART_FIFO_RXEMPT_MASK) - -#define LPUART_FIFO_TXEMPT_MASK (0x800000U) -#define LPUART_FIFO_TXEMPT_SHIFT (23U) -/*! TXEMPT - Transmit FIFO Or Buffer Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define LPUART_FIFO_TXEMPT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_FIFO_TXEMPT_SHIFT)) & LPUART_FIFO_TXEMPT_MASK) -/*! @} */ - -/*! @name WATER - Watermark */ -/*! @{ */ - -#define LPUART_WATER_TXWATER_MASK (0x7U) -#define LPUART_WATER_TXWATER_SHIFT (0U) -/*! TXWATER - Transmit Watermark */ -#define LPUART_WATER_TXWATER(x) (((uint32_t)(((uint32_t)(x)) << LPUART_WATER_TXWATER_SHIFT)) & LPUART_WATER_TXWATER_MASK) - -#define LPUART_WATER_TXCOUNT_MASK (0xF00U) -#define LPUART_WATER_TXCOUNT_SHIFT (8U) -/*! TXCOUNT - Transmit Counter */ -#define LPUART_WATER_TXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_WATER_TXCOUNT_SHIFT)) & LPUART_WATER_TXCOUNT_MASK) - -#define LPUART_WATER_RXWATER_MASK (0x70000U) -#define LPUART_WATER_RXWATER_SHIFT (16U) -/*! RXWATER - Receive Watermark */ -#define LPUART_WATER_RXWATER(x) (((uint32_t)(((uint32_t)(x)) << LPUART_WATER_RXWATER_SHIFT)) & LPUART_WATER_RXWATER_MASK) - -#define LPUART_WATER_RXCOUNT_MASK (0xF000000U) -#define LPUART_WATER_RXCOUNT_SHIFT (24U) -/*! RXCOUNT - Receive Counter */ -#define LPUART_WATER_RXCOUNT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_WATER_RXCOUNT_SHIFT)) & LPUART_WATER_RXCOUNT_MASK) -/*! @} */ - -/*! @name DATARO - Data Read-Only */ -/*! @{ */ - -#define LPUART_DATARO_DATA_MASK (0xFFFFU) -#define LPUART_DATARO_DATA_SHIFT (0U) -/*! DATA - Receive Data */ -#define LPUART_DATARO_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPUART_DATARO_DATA_SHIFT)) & LPUART_DATARO_DATA_MASK) -/*! @} */ - -/*! @name MCR - MODEM Control */ -/*! @{ */ - -#define LPUART_MCR_CTS_MASK (0x1U) -#define LPUART_MCR_CTS_SHIFT (0U) -/*! CTS - Clear To Send - * 0b0..Disable interrupt - * 0b1..Enable interrupt - */ -#define LPUART_MCR_CTS(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MCR_CTS_SHIFT)) & LPUART_MCR_CTS_MASK) - -#define LPUART_MCR_DSR_MASK (0x2U) -#define LPUART_MCR_DSR_SHIFT (1U) -/*! DSR - Data Set Ready - * 0b0..Disable interrupt - * 0b1..Enable interrupt - */ -#define LPUART_MCR_DSR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MCR_DSR_SHIFT)) & LPUART_MCR_DSR_MASK) - -#define LPUART_MCR_RIN_MASK (0x4U) -#define LPUART_MCR_RIN_SHIFT (2U) -/*! RIN - Ring Indicator - * 0b0..Disable interrupt - * 0b1..Enable interrupt - */ -#define LPUART_MCR_RIN(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MCR_RIN_SHIFT)) & LPUART_MCR_RIN_MASK) - -#define LPUART_MCR_DCD_MASK (0x8U) -#define LPUART_MCR_DCD_SHIFT (3U) -/*! DCD - Data Carrier Detect - * 0b0..Disable interrupt - * 0b1..Enable interrupt - */ -#define LPUART_MCR_DCD(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MCR_DCD_SHIFT)) & LPUART_MCR_DCD_MASK) - -#define LPUART_MCR_DTR_MASK (0x100U) -#define LPUART_MCR_DTR_SHIFT (8U) -/*! DTR - Data Terminal Ready - * 0b0..Logic one - * 0b1..Logic zero - */ -#define LPUART_MCR_DTR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MCR_DTR_SHIFT)) & LPUART_MCR_DTR_MASK) - -#define LPUART_MCR_RTS_MASK (0x200U) -#define LPUART_MCR_RTS_SHIFT (9U) -/*! RTS - Request To Send - * 0b0..Logic one - * 0b1..Logic zero - */ -#define LPUART_MCR_RTS(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MCR_RTS_SHIFT)) & LPUART_MCR_RTS_MASK) -/*! @} */ - -/*! @name MSR - MODEM Status */ -/*! @{ */ - -#define LPUART_MSR_DCTS_MASK (0x1U) -#define LPUART_MSR_DCTS_SHIFT (0U) -/*! DCTS - Delta Clear To Send - * 0b0..Did not change state - * 0b1..Changed state - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_MSR_DCTS(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MSR_DCTS_SHIFT)) & LPUART_MSR_DCTS_MASK) - -#define LPUART_MSR_DDSR_MASK (0x2U) -#define LPUART_MSR_DDSR_SHIFT (1U) -/*! DDSR - Delta Data Set Ready - * 0b0..Did not change state - * 0b1..Changed state - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_MSR_DDSR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MSR_DDSR_SHIFT)) & LPUART_MSR_DDSR_MASK) - -#define LPUART_MSR_DRI_MASK (0x4U) -#define LPUART_MSR_DRI_SHIFT (2U) -/*! DRI - Delta Ring Indicator - * 0b0..Did not change state - * 0b1..Changed state - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_MSR_DRI(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MSR_DRI_SHIFT)) & LPUART_MSR_DRI_MASK) - -#define LPUART_MSR_DDCD_MASK (0x8U) -#define LPUART_MSR_DDCD_SHIFT (3U) -/*! DDCD - Delta Data Carrier Detect - * 0b0..Did not change state - * 0b1..Changed state - * 0b0..No effect - * 0b1..Clear the flag - */ -#define LPUART_MSR_DDCD(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MSR_DDCD_SHIFT)) & LPUART_MSR_DDCD_MASK) - -#define LPUART_MSR_CTS_MASK (0x10U) -#define LPUART_MSR_CTS_SHIFT (4U) -/*! CTS - Clear To Send - * 0b0..Logic one - * 0b1..Logic zero - */ -#define LPUART_MSR_CTS(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MSR_CTS_SHIFT)) & LPUART_MSR_CTS_MASK) - -#define LPUART_MSR_DSR_MASK (0x20U) -#define LPUART_MSR_DSR_SHIFT (5U) -/*! DSR - Data Set Ready - * 0b0..Logic one - * 0b1..Logic zero - */ -#define LPUART_MSR_DSR(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MSR_DSR_SHIFT)) & LPUART_MSR_DSR_MASK) - -#define LPUART_MSR_RIN_MASK (0x40U) -#define LPUART_MSR_RIN_SHIFT (6U) -/*! RIN - Ring Indicator - * 0b0..Logic one - * 0b1..Logic zero - */ -#define LPUART_MSR_RIN(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MSR_RIN_SHIFT)) & LPUART_MSR_RIN_MASK) - -#define LPUART_MSR_DCD_MASK (0x80U) -#define LPUART_MSR_DCD_SHIFT (7U) -/*! DCD - Data Carrier Detect - * 0b0..Logic one - * 0b1..Logic zero - */ -#define LPUART_MSR_DCD(x) (((uint32_t)(((uint32_t)(x)) << LPUART_MSR_DCD_SHIFT)) & LPUART_MSR_DCD_MASK) -/*! @} */ - -/*! @name REIR - Receiver Extended Idle */ -/*! @{ */ - -#define LPUART_REIR_IDTIME_MASK (0x3FFFU) -#define LPUART_REIR_IDTIME_SHIFT (0U) -/*! IDTIME - Idle Time */ -#define LPUART_REIR_IDTIME(x) (((uint32_t)(((uint32_t)(x)) << LPUART_REIR_IDTIME_SHIFT)) & LPUART_REIR_IDTIME_MASK) -/*! @} */ - -/*! @name TEIR - Transmitter Extended Idle */ -/*! @{ */ - -#define LPUART_TEIR_IDTIME_MASK (0x3FFFU) -#define LPUART_TEIR_IDTIME_SHIFT (0U) -/*! IDTIME - Idle Time */ -#define LPUART_TEIR_IDTIME(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TEIR_IDTIME_SHIFT)) & LPUART_TEIR_IDTIME_MASK) -/*! @} */ - -/*! @name HDCR - Half Duplex Control */ -/*! @{ */ - -#define LPUART_HDCR_TXSTALL_MASK (0x1U) -#define LPUART_HDCR_TXSTALL_SHIFT (0U) -/*! TXSTALL - Transmit Stall - * 0b0..No effect - * 0b1..Does not become busy - */ -#define LPUART_HDCR_TXSTALL(x) (((uint32_t)(((uint32_t)(x)) << LPUART_HDCR_TXSTALL_SHIFT)) & LPUART_HDCR_TXSTALL_MASK) - -#define LPUART_HDCR_RXSEL_MASK (0x2U) -#define LPUART_HDCR_RXSEL_SHIFT (1U) -/*! RXSEL - Receive Select - * 0b0..RXD - * 0b1..TXD - */ -#define LPUART_HDCR_RXSEL(x) (((uint32_t)(((uint32_t)(x)) << LPUART_HDCR_RXSEL_SHIFT)) & LPUART_HDCR_RXSEL_MASK) - -#define LPUART_HDCR_RXWRMSK_MASK (0x4U) -#define LPUART_HDCR_RXWRMSK_SHIFT (2U) -/*! RXWRMSK - Receive FIFO Write Mask - * 0b0..Do not mask - * 0b1..Mask - */ -#define LPUART_HDCR_RXWRMSK(x) (((uint32_t)(((uint32_t)(x)) << LPUART_HDCR_RXWRMSK_SHIFT)) & LPUART_HDCR_RXWRMSK_MASK) - -#define LPUART_HDCR_RXMSK_MASK (0x8U) -#define LPUART_HDCR_RXMSK_SHIFT (3U) -/*! RXMSK - Receive Mask - * 0b0..Do not mask - * 0b1..Mask - */ -#define LPUART_HDCR_RXMSK(x) (((uint32_t)(((uint32_t)(x)) << LPUART_HDCR_RXMSK_SHIFT)) & LPUART_HDCR_RXMSK_MASK) - -#define LPUART_HDCR_RTSEXT_MASK (0xFF00U) -#define LPUART_HDCR_RTSEXT_SHIFT (8U) -/*! RTSEXT - RTS Extended */ -#define LPUART_HDCR_RTSEXT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_HDCR_RTSEXT_SHIFT)) & LPUART_HDCR_RTSEXT_MASK) -/*! @} */ - -/*! @name TOCR - Timeout Control */ -/*! @{ */ - -#define LPUART_TOCR_TOEN_MASK (0xFU) -#define LPUART_TOCR_TOEN_SHIFT (0U) -/*! TOEN - Timeout Enable */ -#define LPUART_TOCR_TOEN(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TOCR_TOEN_SHIFT)) & LPUART_TOCR_TOEN_MASK) - -#define LPUART_TOCR_TOIE_MASK (0xF00U) -#define LPUART_TOCR_TOIE_SHIFT (8U) -/*! TOIE - Timeout Interrupt Enable */ -#define LPUART_TOCR_TOIE(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TOCR_TOIE_SHIFT)) & LPUART_TOCR_TOIE_MASK) -/*! @} */ - -/*! @name TOSR - Timeout Status */ -/*! @{ */ - -#define LPUART_TOSR_TOZ_MASK (0xFU) -#define LPUART_TOSR_TOZ_SHIFT (0U) -/*! TOZ - Timeout Zero */ -#define LPUART_TOSR_TOZ(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TOSR_TOZ_SHIFT)) & LPUART_TOSR_TOZ_MASK) - -#define LPUART_TOSR_TOF_MASK (0xF00U) -#define LPUART_TOSR_TOF_SHIFT (8U) -/*! TOF - Timeout Flag - * 0b0000..Not occurred - * 0b0001..Occurred - * 0b0000..No effect - * 0b0001..Clear the flag - */ -#define LPUART_TOSR_TOF(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TOSR_TOF_SHIFT)) & LPUART_TOSR_TOF_MASK) -/*! @} */ - -/*! @name TIMEOUT - Timeout N */ -/*! @{ */ - -#define LPUART_TIMEOUT_TIMEOUT_MASK (0x3FFFU) -#define LPUART_TIMEOUT_TIMEOUT_SHIFT (0U) -/*! TIMEOUT - Timeout Value */ -#define LPUART_TIMEOUT_TIMEOUT(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TIMEOUT_TIMEOUT_SHIFT)) & LPUART_TIMEOUT_TIMEOUT_MASK) - -#define LPUART_TIMEOUT_CFG_MASK (0xC0000000U) -#define LPUART_TIMEOUT_CFG_SHIFT (30U) -/*! CFG - Idle Configuration - * 0b00..Becomes 1 after timeout characters are received - * 0b01..Becomes 1 when idle for timeout bit clocks - * 0b10..Becomes 1 when idle for timeout bit clocks following the next character - * 0b11..Becomes 1 when idle for at least timeout bit clocks, but a new character is detected before the extended idle timeout is reached - */ -#define LPUART_TIMEOUT_CFG(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TIMEOUT_CFG_SHIFT)) & LPUART_TIMEOUT_CFG_MASK) -/*! @} */ - -/* The count of LPUART_TIMEOUT */ -#define LPUART_TIMEOUT_COUNT (4U) - -/*! @name TCBR - Transmit Command Burst */ -/*! @{ */ - -#define LPUART_TCBR_DATA_MASK (0xFFFFU) -#define LPUART_TCBR_DATA_SHIFT (0U) -/*! DATA - Data */ -#define LPUART_TCBR_DATA(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TCBR_DATA_SHIFT)) & LPUART_TCBR_DATA_MASK) -/*! @} */ - -/* The count of LPUART_TCBR */ -#define LPUART_TCBR_COUNT (128U) - -/*! @name TDBR - Transmit Data Burst */ -/*! @{ */ - -#define LPUART_TDBR_DATA0_MASK (0xFFU) -#define LPUART_TDBR_DATA0_SHIFT (0U) -/*! DATA0 - Data0 */ -#define LPUART_TDBR_DATA0(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TDBR_DATA0_SHIFT)) & LPUART_TDBR_DATA0_MASK) - -#define LPUART_TDBR_DATA1_MASK (0xFF00U) -#define LPUART_TDBR_DATA1_SHIFT (8U) -/*! DATA1 - Data1 */ -#define LPUART_TDBR_DATA1(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TDBR_DATA1_SHIFT)) & LPUART_TDBR_DATA1_MASK) - -#define LPUART_TDBR_DATA2_MASK (0xFF0000U) -#define LPUART_TDBR_DATA2_SHIFT (16U) -/*! DATA2 - Data2 */ -#define LPUART_TDBR_DATA2(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TDBR_DATA2_SHIFT)) & LPUART_TDBR_DATA2_MASK) - -#define LPUART_TDBR_DATA3_MASK (0xFF000000U) -#define LPUART_TDBR_DATA3_SHIFT (24U) -/*! DATA3 - Data3 */ -#define LPUART_TDBR_DATA3(x) (((uint32_t)(((uint32_t)(x)) << LPUART_TDBR_DATA3_SHIFT)) & LPUART_TDBR_DATA3_MASK) -/*! @} */ - -/* The count of LPUART_TDBR */ -#define LPUART_TDBR_COUNT (256U) - - -/*! - * @} - */ /* end of group LPUART_Register_Masks */ - - -/* LPUART - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral LPUART0 base address */ - #define LPUART0_BASE (0x50092000u) - /** Peripheral LPUART0 base address */ - #define LPUART0_BASE_NS (0x40092000u) - /** Peripheral LPUART0 base pointer */ - #define LPUART0 ((LPUART_Type *)LPUART0_BASE) - /** Peripheral LPUART0 base pointer */ - #define LPUART0_NS ((LPUART_Type *)LPUART0_BASE_NS) - /** Peripheral LPUART1 base address */ - #define LPUART1_BASE (0x50093000u) - /** Peripheral LPUART1 base address */ - #define LPUART1_BASE_NS (0x40093000u) - /** Peripheral LPUART1 base pointer */ - #define LPUART1 ((LPUART_Type *)LPUART1_BASE) - /** Peripheral LPUART1 base pointer */ - #define LPUART1_NS ((LPUART_Type *)LPUART1_BASE_NS) - /** Peripheral LPUART2 base address */ - #define LPUART2_BASE (0x50094000u) - /** Peripheral LPUART2 base address */ - #define LPUART2_BASE_NS (0x40094000u) - /** Peripheral LPUART2 base pointer */ - #define LPUART2 ((LPUART_Type *)LPUART2_BASE) - /** Peripheral LPUART2 base pointer */ - #define LPUART2_NS ((LPUART_Type *)LPUART2_BASE_NS) - /** Peripheral LPUART3 base address */ - #define LPUART3_BASE (0x50095000u) - /** Peripheral LPUART3 base address */ - #define LPUART3_BASE_NS (0x40095000u) - /** Peripheral LPUART3 base pointer */ - #define LPUART3 ((LPUART_Type *)LPUART3_BASE) - /** Peripheral LPUART3 base pointer */ - #define LPUART3_NS ((LPUART_Type *)LPUART3_BASE_NS) - /** Peripheral LPUART4 base address */ - #define LPUART4_BASE (0x500B4000u) - /** Peripheral LPUART4 base address */ - #define LPUART4_BASE_NS (0x400B4000u) - /** Peripheral LPUART4 base pointer */ - #define LPUART4 ((LPUART_Type *)LPUART4_BASE) - /** Peripheral LPUART4 base pointer */ - #define LPUART4_NS ((LPUART_Type *)LPUART4_BASE_NS) - /** Peripheral LPUART5 base address */ - #define LPUART5_BASE (0x500B5000u) - /** Peripheral LPUART5 base address */ - #define LPUART5_BASE_NS (0x400B5000u) - /** Peripheral LPUART5 base pointer */ - #define LPUART5 ((LPUART_Type *)LPUART5_BASE) - /** Peripheral LPUART5 base pointer */ - #define LPUART5_NS ((LPUART_Type *)LPUART5_BASE_NS) - /** Peripheral LPUART6 base address */ - #define LPUART6_BASE (0x500B6000u) - /** Peripheral LPUART6 base address */ - #define LPUART6_BASE_NS (0x400B6000u) - /** Peripheral LPUART6 base pointer */ - #define LPUART6 ((LPUART_Type *)LPUART6_BASE) - /** Peripheral LPUART6 base pointer */ - #define LPUART6_NS ((LPUART_Type *)LPUART6_BASE_NS) - /** Peripheral LPUART7 base address */ - #define LPUART7_BASE (0x500B7000u) - /** Peripheral LPUART7 base address */ - #define LPUART7_BASE_NS (0x400B7000u) - /** Peripheral LPUART7 base pointer */ - #define LPUART7 ((LPUART_Type *)LPUART7_BASE) - /** Peripheral LPUART7 base pointer */ - #define LPUART7_NS ((LPUART_Type *)LPUART7_BASE_NS) - /** Peripheral LPUART8 base address */ - #define LPUART8_BASE (0x500B8000u) - /** Peripheral LPUART8 base address */ - #define LPUART8_BASE_NS (0x400B8000u) - /** Peripheral LPUART8 base pointer */ - #define LPUART8 ((LPUART_Type *)LPUART8_BASE) - /** Peripheral LPUART8 base pointer */ - #define LPUART8_NS ((LPUART_Type *)LPUART8_BASE_NS) - /** Peripheral LPUART9 base address */ - #define LPUART9_BASE (0x500B9000u) - /** Peripheral LPUART9 base address */ - #define LPUART9_BASE_NS (0x400B9000u) - /** Peripheral LPUART9 base pointer */ - #define LPUART9 ((LPUART_Type *)LPUART9_BASE) - /** Peripheral LPUART9 base pointer */ - #define LPUART9_NS ((LPUART_Type *)LPUART9_BASE_NS) - /** Array initializer of LPUART peripheral base addresses */ - #define LPUART_BASE_ADDRS { LPUART0_BASE, LPUART1_BASE, LPUART2_BASE, LPUART3_BASE, LPUART4_BASE, LPUART5_BASE, LPUART6_BASE, LPUART7_BASE, LPUART8_BASE, LPUART9_BASE } - /** Array initializer of LPUART peripheral base pointers */ - #define LPUART_BASE_PTRS { LPUART0, LPUART1, LPUART2, LPUART3, LPUART4, LPUART5, LPUART6, LPUART7, LPUART8, LPUART9 } - /** Array initializer of LPUART peripheral base addresses */ - #define LPUART_BASE_ADDRS_NS { LPUART0_BASE_NS, LPUART1_BASE_NS, LPUART2_BASE_NS, LPUART3_BASE_NS, LPUART4_BASE_NS, LPUART5_BASE_NS, LPUART6_BASE_NS, LPUART7_BASE_NS, LPUART8_BASE_NS, LPUART9_BASE_NS } - /** Array initializer of LPUART peripheral base pointers */ - #define LPUART_BASE_PTRS_NS { LPUART0_NS, LPUART1_NS, LPUART2_NS, LPUART3_NS, LPUART4_NS, LPUART5_NS, LPUART6_NS, LPUART7_NS, LPUART8_NS, LPUART9_NS } -#else - /** Peripheral LPUART0 base address */ - #define LPUART0_BASE (0x40092000u) - /** Peripheral LPUART0 base pointer */ - #define LPUART0 ((LPUART_Type *)LPUART0_BASE) - /** Peripheral LPUART1 base address */ - #define LPUART1_BASE (0x40093000u) - /** Peripheral LPUART1 base pointer */ - #define LPUART1 ((LPUART_Type *)LPUART1_BASE) - /** Peripheral LPUART2 base address */ - #define LPUART2_BASE (0x40094000u) - /** Peripheral LPUART2 base pointer */ - #define LPUART2 ((LPUART_Type *)LPUART2_BASE) - /** Peripheral LPUART3 base address */ - #define LPUART3_BASE (0x40095000u) - /** Peripheral LPUART3 base pointer */ - #define LPUART3 ((LPUART_Type *)LPUART3_BASE) - /** Peripheral LPUART4 base address */ - #define LPUART4_BASE (0x400B4000u) - /** Peripheral LPUART4 base pointer */ - #define LPUART4 ((LPUART_Type *)LPUART4_BASE) - /** Peripheral LPUART5 base address */ - #define LPUART5_BASE (0x400B5000u) - /** Peripheral LPUART5 base pointer */ - #define LPUART5 ((LPUART_Type *)LPUART5_BASE) - /** Peripheral LPUART6 base address */ - #define LPUART6_BASE (0x400B6000u) - /** Peripheral LPUART6 base pointer */ - #define LPUART6 ((LPUART_Type *)LPUART6_BASE) - /** Peripheral LPUART7 base address */ - #define LPUART7_BASE (0x400B7000u) - /** Peripheral LPUART7 base pointer */ - #define LPUART7 ((LPUART_Type *)LPUART7_BASE) - /** Peripheral LPUART8 base address */ - #define LPUART8_BASE (0x400B8000u) - /** Peripheral LPUART8 base pointer */ - #define LPUART8 ((LPUART_Type *)LPUART8_BASE) - /** Peripheral LPUART9 base address */ - #define LPUART9_BASE (0x400B9000u) - /** Peripheral LPUART9 base pointer */ - #define LPUART9 ((LPUART_Type *)LPUART9_BASE) - /** Array initializer of LPUART peripheral base addresses */ - #define LPUART_BASE_ADDRS { LPUART0_BASE, LPUART1_BASE, LPUART2_BASE, LPUART3_BASE, LPUART4_BASE, LPUART5_BASE, LPUART6_BASE, LPUART7_BASE, LPUART8_BASE, LPUART9_BASE } - /** Array initializer of LPUART peripheral base pointers */ - #define LPUART_BASE_PTRS { LPUART0, LPUART1, LPUART2, LPUART3, LPUART4, LPUART5, LPUART6, LPUART7, LPUART8, LPUART9 } -#endif -/** Interrupt vectors for the LPUART peripheral type */ -#define LPUART_RX_TX_IRQS { LP_FLEXCOMM0_IRQn, LP_FLEXCOMM1_IRQn, LP_FLEXCOMM2_IRQn, LP_FLEXCOMM3_IRQn, LP_FLEXCOMM4_IRQn, LP_FLEXCOMM5_IRQn, LP_FLEXCOMM6_IRQn, LP_FLEXCOMM7_IRQn, LP_FLEXCOMM8_IRQn, LP_FLEXCOMM9_IRQn } -#define LPUART_ERR_IRQS { LP_FLEXCOMM0_IRQn, LP_FLEXCOMM1_IRQn, LP_FLEXCOMM2_IRQn, LP_FLEXCOMM3_IRQn, LP_FLEXCOMM4_IRQn, LP_FLEXCOMM5_IRQn, LP_FLEXCOMM6_IRQn, LP_FLEXCOMM7_IRQn, LP_FLEXCOMM8_IRQn, LP_FLEXCOMM9_IRQn } - -/*! - * @} - */ /* end of group LPUART_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- LP_FLEXCOMM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LP_FLEXCOMM_Peripheral_Access_Layer LP_FLEXCOMM Peripheral Access Layer - * @{ - */ - -/** LP_FLEXCOMM - Register Layout Typedef */ -typedef struct { - uint8_t RESERVED_0[4084]; - __I uint32_t ISTAT; /**< Interrupt Status, offset: 0xFF4 */ - __IO uint32_t PSELID; /**< Peripheral Select and ID, offset: 0xFF8 */ -} LP_FLEXCOMM_Type; - -/* ---------------------------------------------------------------------------- - -- LP_FLEXCOMM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup LP_FLEXCOMM_Register_Masks LP_FLEXCOMM Register Masks - * @{ - */ - -/*! @name ISTAT - Interrupt Status */ -/*! @{ */ - -#define LP_FLEXCOMM_ISTAT_UARTTX_MASK (0x1U) -#define LP_FLEXCOMM_ISTAT_UARTTX_SHIFT (0U) -/*! UARTTX - UART TX Interrupt - * 0b0..Clear - * 0b1..Set - */ -#define LP_FLEXCOMM_ISTAT_UARTTX(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_ISTAT_UARTTX_SHIFT)) & LP_FLEXCOMM_ISTAT_UARTTX_MASK) - -#define LP_FLEXCOMM_ISTAT_UARTRX_MASK (0x2U) -#define LP_FLEXCOMM_ISTAT_UARTRX_SHIFT (1U) -/*! UARTRX - UART RX Interrupt - * 0b0..Clear - * 0b1..Set - */ -#define LP_FLEXCOMM_ISTAT_UARTRX(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_ISTAT_UARTRX_SHIFT)) & LP_FLEXCOMM_ISTAT_UARTRX_MASK) - -#define LP_FLEXCOMM_ISTAT_SPI_MASK (0x4U) -#define LP_FLEXCOMM_ISTAT_SPI_SHIFT (2U) -/*! SPI - SPI Interrupt - * 0b0..Clear - * 0b1..Set - */ -#define LP_FLEXCOMM_ISTAT_SPI(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_ISTAT_SPI_SHIFT)) & LP_FLEXCOMM_ISTAT_SPI_MASK) - -#define LP_FLEXCOMM_ISTAT_I2CM_MASK (0x10U) -#define LP_FLEXCOMM_ISTAT_I2CM_SHIFT (4U) -/*! I2CM - I2C Controller Interrupt - * 0b0..Clear - * 0b1..Set - */ -#define LP_FLEXCOMM_ISTAT_I2CM(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_ISTAT_I2CM_SHIFT)) & LP_FLEXCOMM_ISTAT_I2CM_MASK) - -#define LP_FLEXCOMM_ISTAT_I2CS_MASK (0x20U) -#define LP_FLEXCOMM_ISTAT_I2CS_SHIFT (5U) -/*! I2CS - I2C Subordinate Interrupt - * 0b0..Clear - * 0b1..Set - */ -#define LP_FLEXCOMM_ISTAT_I2CS(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_ISTAT_I2CS_SHIFT)) & LP_FLEXCOMM_ISTAT_I2CS_MASK) -/*! @} */ - -/*! @name PSELID - Peripheral Select and ID */ -/*! @{ */ - -#define LP_FLEXCOMM_PSELID_PERSEL_MASK (0x7U) -#define LP_FLEXCOMM_PSELID_PERSEL_SHIFT (0U) -/*! PERSEL - Peripheral Select - * 0b000..No peripheral selected - * 0b001..UART - * 0b011..I2C - * 0b111..UART and I2C - * 0b010..SPI - */ -#define LP_FLEXCOMM_PSELID_PERSEL(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_PSELID_PERSEL_SHIFT)) & LP_FLEXCOMM_PSELID_PERSEL_MASK) - -#define LP_FLEXCOMM_PSELID_LOCK_MASK (0x8U) -#define LP_FLEXCOMM_PSELID_LOCK_SHIFT (3U) -/*! LOCK - Lock - * 0b0..PERSEL is writable - * 0b1..PERSEL is not writable - */ -#define LP_FLEXCOMM_PSELID_LOCK(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_PSELID_LOCK_SHIFT)) & LP_FLEXCOMM_PSELID_LOCK_MASK) - -#define LP_FLEXCOMM_PSELID_UARTPRESENT_MASK (0x10U) -#define LP_FLEXCOMM_PSELID_UARTPRESENT_SHIFT (4U) -/*! UARTPRESENT - UART Present - * 0b0..Not supported - * 0b1..Supported - */ -#define LP_FLEXCOMM_PSELID_UARTPRESENT(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_PSELID_UARTPRESENT_SHIFT)) & LP_FLEXCOMM_PSELID_UARTPRESENT_MASK) - -#define LP_FLEXCOMM_PSELID_SPIPRESENT_MASK (0x20U) -#define LP_FLEXCOMM_PSELID_SPIPRESENT_SHIFT (5U) -/*! SPIPRESENT - SPI Present - * 0b0..Not supported - * 0b1..Supported - */ -#define LP_FLEXCOMM_PSELID_SPIPRESENT(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_PSELID_SPIPRESENT_SHIFT)) & LP_FLEXCOMM_PSELID_SPIPRESENT_MASK) - -#define LP_FLEXCOMM_PSELID_I2CPRESENT_MASK (0x40U) -#define LP_FLEXCOMM_PSELID_I2CPRESENT_SHIFT (6U) -/*! I2CPRESENT - I2C Present - * 0b0..Not supported - * 0b1..Supported - */ -#define LP_FLEXCOMM_PSELID_I2CPRESENT(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_PSELID_I2CPRESENT_SHIFT)) & LP_FLEXCOMM_PSELID_I2CPRESENT_MASK) - -#define LP_FLEXCOMM_PSELID_ID_MASK (0xFFFFF000U) -#define LP_FLEXCOMM_PSELID_ID_SHIFT (12U) -/*! ID - LP_FLEXCOMM interface ID */ -#define LP_FLEXCOMM_PSELID_ID(x) (((uint32_t)(((uint32_t)(x)) << LP_FLEXCOMM_PSELID_ID_SHIFT)) & LP_FLEXCOMM_PSELID_ID_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group LP_FLEXCOMM_Register_Masks */ - - -/* LP_FLEXCOMM - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral LP_FLEXCOMM0 base address */ - #define LP_FLEXCOMM0_BASE (0x50092000u) - /** Peripheral LP_FLEXCOMM0 base address */ - #define LP_FLEXCOMM0_BASE_NS (0x40092000u) - /** Peripheral LP_FLEXCOMM0 base pointer */ - #define LP_FLEXCOMM0 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM0_BASE) - /** Peripheral LP_FLEXCOMM0 base pointer */ - #define LP_FLEXCOMM0_NS ((LP_FLEXCOMM_Type *)LP_FLEXCOMM0_BASE_NS) - /** Peripheral LP_FLEXCOMM1 base address */ - #define LP_FLEXCOMM1_BASE (0x50093000u) - /** Peripheral LP_FLEXCOMM1 base address */ - #define LP_FLEXCOMM1_BASE_NS (0x40093000u) - /** Peripheral LP_FLEXCOMM1 base pointer */ - #define LP_FLEXCOMM1 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM1_BASE) - /** Peripheral LP_FLEXCOMM1 base pointer */ - #define LP_FLEXCOMM1_NS ((LP_FLEXCOMM_Type *)LP_FLEXCOMM1_BASE_NS) - /** Peripheral LP_FLEXCOMM2 base address */ - #define LP_FLEXCOMM2_BASE (0x50094000u) - /** Peripheral LP_FLEXCOMM2 base address */ - #define LP_FLEXCOMM2_BASE_NS (0x40094000u) - /** Peripheral LP_FLEXCOMM2 base pointer */ - #define LP_FLEXCOMM2 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM2_BASE) - /** Peripheral LP_FLEXCOMM2 base pointer */ - #define LP_FLEXCOMM2_NS ((LP_FLEXCOMM_Type *)LP_FLEXCOMM2_BASE_NS) - /** Peripheral LP_FLEXCOMM3 base address */ - #define LP_FLEXCOMM3_BASE (0x50095000u) - /** Peripheral LP_FLEXCOMM3 base address */ - #define LP_FLEXCOMM3_BASE_NS (0x40095000u) - /** Peripheral LP_FLEXCOMM3 base pointer */ - #define LP_FLEXCOMM3 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM3_BASE) - /** Peripheral LP_FLEXCOMM3 base pointer */ - #define LP_FLEXCOMM3_NS ((LP_FLEXCOMM_Type *)LP_FLEXCOMM3_BASE_NS) - /** Peripheral LP_FLEXCOMM4 base address */ - #define LP_FLEXCOMM4_BASE (0x500B4000u) - /** Peripheral LP_FLEXCOMM4 base address */ - #define LP_FLEXCOMM4_BASE_NS (0x400B4000u) - /** Peripheral LP_FLEXCOMM4 base pointer */ - #define LP_FLEXCOMM4 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM4_BASE) - /** Peripheral LP_FLEXCOMM4 base pointer */ - #define LP_FLEXCOMM4_NS ((LP_FLEXCOMM_Type *)LP_FLEXCOMM4_BASE_NS) - /** Peripheral LP_FLEXCOMM5 base address */ - #define LP_FLEXCOMM5_BASE (0x500B5000u) - /** Peripheral LP_FLEXCOMM5 base address */ - #define LP_FLEXCOMM5_BASE_NS (0x400B5000u) - /** Peripheral LP_FLEXCOMM5 base pointer */ - #define LP_FLEXCOMM5 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM5_BASE) - /** Peripheral LP_FLEXCOMM5 base pointer */ - #define LP_FLEXCOMM5_NS ((LP_FLEXCOMM_Type *)LP_FLEXCOMM5_BASE_NS) - /** Peripheral LP_FLEXCOMM6 base address */ - #define LP_FLEXCOMM6_BASE (0x500B6000u) - /** Peripheral LP_FLEXCOMM6 base address */ - #define LP_FLEXCOMM6_BASE_NS (0x400B6000u) - /** Peripheral LP_FLEXCOMM6 base pointer */ - #define LP_FLEXCOMM6 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM6_BASE) - /** Peripheral LP_FLEXCOMM6 base pointer */ - #define LP_FLEXCOMM6_NS ((LP_FLEXCOMM_Type *)LP_FLEXCOMM6_BASE_NS) - /** Peripheral LP_FLEXCOMM7 base address */ - #define LP_FLEXCOMM7_BASE (0x500B7000u) - /** Peripheral LP_FLEXCOMM7 base address */ - #define LP_FLEXCOMM7_BASE_NS (0x400B7000u) - /** Peripheral LP_FLEXCOMM7 base pointer */ - #define LP_FLEXCOMM7 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM7_BASE) - /** Peripheral LP_FLEXCOMM7 base pointer */ - #define LP_FLEXCOMM7_NS ((LP_FLEXCOMM_Type *)LP_FLEXCOMM7_BASE_NS) - /** Peripheral LP_FLEXCOMM8 base address */ - #define LP_FLEXCOMM8_BASE (0x500B8000u) - /** Peripheral LP_FLEXCOMM8 base address */ - #define LP_FLEXCOMM8_BASE_NS (0x400B8000u) - /** Peripheral LP_FLEXCOMM8 base pointer */ - #define LP_FLEXCOMM8 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM8_BASE) - /** Peripheral LP_FLEXCOMM8 base pointer */ - #define LP_FLEXCOMM8_NS ((LP_FLEXCOMM_Type *)LP_FLEXCOMM8_BASE_NS) - /** Peripheral LP_FLEXCOMM9 base address */ - #define LP_FLEXCOMM9_BASE (0x500B9000u) - /** Peripheral LP_FLEXCOMM9 base address */ - #define LP_FLEXCOMM9_BASE_NS (0x400B9000u) - /** Peripheral LP_FLEXCOMM9 base pointer */ - #define LP_FLEXCOMM9 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM9_BASE) - /** Peripheral LP_FLEXCOMM9 base pointer */ - #define LP_FLEXCOMM9_NS ((LP_FLEXCOMM_Type *)LP_FLEXCOMM9_BASE_NS) - /** Array initializer of LP_FLEXCOMM peripheral base addresses */ - #define LP_FLEXCOMM_BASE_ADDRS { LP_FLEXCOMM0_BASE, LP_FLEXCOMM1_BASE, LP_FLEXCOMM2_BASE, LP_FLEXCOMM3_BASE, LP_FLEXCOMM4_BASE, LP_FLEXCOMM5_BASE, LP_FLEXCOMM6_BASE, LP_FLEXCOMM7_BASE, LP_FLEXCOMM8_BASE, LP_FLEXCOMM9_BASE } - /** Array initializer of LP_FLEXCOMM peripheral base pointers */ - #define LP_FLEXCOMM_BASE_PTRS { LP_FLEXCOMM0, LP_FLEXCOMM1, LP_FLEXCOMM2, LP_FLEXCOMM3, LP_FLEXCOMM4, LP_FLEXCOMM5, LP_FLEXCOMM6, LP_FLEXCOMM7, LP_FLEXCOMM8, LP_FLEXCOMM9 } - /** Array initializer of LP_FLEXCOMM peripheral base addresses */ - #define LP_FLEXCOMM_BASE_ADDRS_NS { LP_FLEXCOMM0_BASE_NS, LP_FLEXCOMM1_BASE_NS, LP_FLEXCOMM2_BASE_NS, LP_FLEXCOMM3_BASE_NS, LP_FLEXCOMM4_BASE_NS, LP_FLEXCOMM5_BASE_NS, LP_FLEXCOMM6_BASE_NS, LP_FLEXCOMM7_BASE_NS, LP_FLEXCOMM8_BASE_NS, LP_FLEXCOMM9_BASE_NS } - /** Array initializer of LP_FLEXCOMM peripheral base pointers */ - #define LP_FLEXCOMM_BASE_PTRS_NS { LP_FLEXCOMM0_NS, LP_FLEXCOMM1_NS, LP_FLEXCOMM2_NS, LP_FLEXCOMM3_NS, LP_FLEXCOMM4_NS, LP_FLEXCOMM5_NS, LP_FLEXCOMM6_NS, LP_FLEXCOMM7_NS, LP_FLEXCOMM8_NS, LP_FLEXCOMM9_NS } -#else - /** Peripheral LP_FLEXCOMM0 base address */ - #define LP_FLEXCOMM0_BASE (0x40092000u) - /** Peripheral LP_FLEXCOMM0 base pointer */ - #define LP_FLEXCOMM0 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM0_BASE) - /** Peripheral LP_FLEXCOMM1 base address */ - #define LP_FLEXCOMM1_BASE (0x40093000u) - /** Peripheral LP_FLEXCOMM1 base pointer */ - #define LP_FLEXCOMM1 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM1_BASE) - /** Peripheral LP_FLEXCOMM2 base address */ - #define LP_FLEXCOMM2_BASE (0x40094000u) - /** Peripheral LP_FLEXCOMM2 base pointer */ - #define LP_FLEXCOMM2 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM2_BASE) - /** Peripheral LP_FLEXCOMM3 base address */ - #define LP_FLEXCOMM3_BASE (0x40095000u) - /** Peripheral LP_FLEXCOMM3 base pointer */ - #define LP_FLEXCOMM3 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM3_BASE) - /** Peripheral LP_FLEXCOMM4 base address */ - #define LP_FLEXCOMM4_BASE (0x400B4000u) - /** Peripheral LP_FLEXCOMM4 base pointer */ - #define LP_FLEXCOMM4 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM4_BASE) - /** Peripheral LP_FLEXCOMM5 base address */ - #define LP_FLEXCOMM5_BASE (0x400B5000u) - /** Peripheral LP_FLEXCOMM5 base pointer */ - #define LP_FLEXCOMM5 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM5_BASE) - /** Peripheral LP_FLEXCOMM6 base address */ - #define LP_FLEXCOMM6_BASE (0x400B6000u) - /** Peripheral LP_FLEXCOMM6 base pointer */ - #define LP_FLEXCOMM6 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM6_BASE) - /** Peripheral LP_FLEXCOMM7 base address */ - #define LP_FLEXCOMM7_BASE (0x400B7000u) - /** Peripheral LP_FLEXCOMM7 base pointer */ - #define LP_FLEXCOMM7 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM7_BASE) - /** Peripheral LP_FLEXCOMM8 base address */ - #define LP_FLEXCOMM8_BASE (0x400B8000u) - /** Peripheral LP_FLEXCOMM8 base pointer */ - #define LP_FLEXCOMM8 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM8_BASE) - /** Peripheral LP_FLEXCOMM9 base address */ - #define LP_FLEXCOMM9_BASE (0x400B9000u) - /** Peripheral LP_FLEXCOMM9 base pointer */ - #define LP_FLEXCOMM9 ((LP_FLEXCOMM_Type *)LP_FLEXCOMM9_BASE) - /** Array initializer of LP_FLEXCOMM peripheral base addresses */ - #define LP_FLEXCOMM_BASE_ADDRS { LP_FLEXCOMM0_BASE, LP_FLEXCOMM1_BASE, LP_FLEXCOMM2_BASE, LP_FLEXCOMM3_BASE, LP_FLEXCOMM4_BASE, LP_FLEXCOMM5_BASE, LP_FLEXCOMM6_BASE, LP_FLEXCOMM7_BASE, LP_FLEXCOMM8_BASE, LP_FLEXCOMM9_BASE } - /** Array initializer of LP_FLEXCOMM peripheral base pointers */ - #define LP_FLEXCOMM_BASE_PTRS { LP_FLEXCOMM0, LP_FLEXCOMM1, LP_FLEXCOMM2, LP_FLEXCOMM3, LP_FLEXCOMM4, LP_FLEXCOMM5, LP_FLEXCOMM6, LP_FLEXCOMM7, LP_FLEXCOMM8, LP_FLEXCOMM9 } -#endif -/** Interrupt vectors for the LP_FLEXCOMM peripheral type */ -#define LP_FLEXCOMM_IRQS { LP_FLEXCOMM0_IRQn, LP_FLEXCOMM1_IRQn, LP_FLEXCOMM2_IRQn, LP_FLEXCOMM3_IRQn, LP_FLEXCOMM4_IRQn, LP_FLEXCOMM5_IRQn, LP_FLEXCOMM6_IRQn, LP_FLEXCOMM7_IRQn, LP_FLEXCOMM8_IRQn, LP_FLEXCOMM9_IRQn } - -/*! - * @} - */ /* end of group LP_FLEXCOMM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- MAILBOX Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup MAILBOX_Peripheral_Access_Layer MAILBOX Peripheral Access Layer - * @{ - */ - -/** MAILBOX - Register Layout Typedef */ -typedef struct { - struct { /* offset: 0x0, array step: 0x10 */ - __IO uint32_t IRQ; /**< Cortex-M33 (CPU0) Interrupt..CoolFlux (CPU1) Interrupt, array offset: 0x0, array step: 0x10 */ - __O uint32_t IRQSET; /**< Cortex-M33 (CPU0) Interrupt Set..CoolFlux (CPU1) Interrupt Set, array offset: 0x4, array step: 0x10 */ - __O uint32_t IRQCLR; /**< Cortex-M33 (CPU0) Interrupt Clear..CoolFlux (CPU1) Interrupt Clear, array offset: 0x8, array step: 0x10 */ - uint8_t RESERVED_0[4]; - } MBOXIRQ[2]; - uint8_t RESERVED_0[216]; - __IO uint32_t MUTEX; /**< Mutual Exclusion, offset: 0xF8 */ -} MAILBOX_Type; - -/* ---------------------------------------------------------------------------- - -- MAILBOX Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup MAILBOX_Register_Masks MAILBOX Register Masks - * @{ - */ - -/*! @name MBOXIRQ_IRQ - Cortex-M33 (CPU0) Interrupt..CoolFlux (CPU1) Interrupt */ -/*! @{ */ - -#define MAILBOX_MBOXIRQ_IRQ_INTREQ_MASK (0xFFFFFFFFU) -#define MAILBOX_MBOXIRQ_IRQ_INTREQ_SHIFT (0U) -/*! INTREQ - Interrupt Request */ -#define MAILBOX_MBOXIRQ_IRQ_INTREQ(x) (((uint32_t)(((uint32_t)(x)) << MAILBOX_MBOXIRQ_IRQ_INTREQ_SHIFT)) & MAILBOX_MBOXIRQ_IRQ_INTREQ_MASK) -/*! @} */ - -/* The count of MAILBOX_MBOXIRQ_IRQ */ -#define MAILBOX_MBOXIRQ_IRQ_COUNT (2U) - -/*! @name MBOXIRQ_IRQSET - Cortex-M33 (CPU0) Interrupt Set..CoolFlux (CPU1) Interrupt Set */ -/*! @{ */ - -#define MAILBOX_MBOXIRQ_IRQSET_INTREQSET_MASK (0xFFFFFFFFU) -#define MAILBOX_MBOXIRQ_IRQSET_INTREQSET_SHIFT (0U) -/*! INTREQSET - Interrupt Request Set 1 */ -#define MAILBOX_MBOXIRQ_IRQSET_INTREQSET(x) (((uint32_t)(((uint32_t)(x)) << MAILBOX_MBOXIRQ_IRQSET_INTREQSET_SHIFT)) & MAILBOX_MBOXIRQ_IRQSET_INTREQSET_MASK) -/*! @} */ - -/* The count of MAILBOX_MBOXIRQ_IRQSET */ -#define MAILBOX_MBOXIRQ_IRQSET_COUNT (2U) - -/*! @name MBOXIRQ_IRQCLR - Cortex-M33 (CPU0) Interrupt Clear..CoolFlux (CPU1) Interrupt Clear */ -/*! @{ */ - -#define MAILBOX_MBOXIRQ_IRQCLR_INTREQCLR_MASK (0xFFFFFFFFU) -#define MAILBOX_MBOXIRQ_IRQCLR_INTREQCLR_SHIFT (0U) -/*! INTREQCLR - Interrupt Request Clear 1 */ -#define MAILBOX_MBOXIRQ_IRQCLR_INTREQCLR(x) (((uint32_t)(((uint32_t)(x)) << MAILBOX_MBOXIRQ_IRQCLR_INTREQCLR_SHIFT)) & MAILBOX_MBOXIRQ_IRQCLR_INTREQCLR_MASK) -/*! @} */ - -/* The count of MAILBOX_MBOXIRQ_IRQCLR */ -#define MAILBOX_MBOXIRQ_IRQCLR_COUNT (2U) - -/*! @name MUTEX - Mutual Exclusion */ -/*! @{ */ - -#define MAILBOX_MUTEX_EX_MASK (0x1U) -#define MAILBOX_MUTEX_EX_SHIFT (0U) -/*! EX - Mutual Exclusion Request - * 0b0..Resource unavailable - * 0b1..Resource available - */ -#define MAILBOX_MUTEX_EX(x) (((uint32_t)(((uint32_t)(x)) << MAILBOX_MUTEX_EX_SHIFT)) & MAILBOX_MUTEX_EX_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group MAILBOX_Register_Masks */ - - -/* MAILBOX - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral MAILBOX base address */ - #define MAILBOX_BASE (0x500B2000u) - /** Peripheral MAILBOX base address */ - #define MAILBOX_BASE_NS (0x400B2000u) - /** Peripheral MAILBOX base pointer */ - #define MAILBOX ((MAILBOX_Type *)MAILBOX_BASE) - /** Peripheral MAILBOX base pointer */ - #define MAILBOX_NS ((MAILBOX_Type *)MAILBOX_BASE_NS) - /** Array initializer of MAILBOX peripheral base addresses */ - #define MAILBOX_BASE_ADDRS { MAILBOX_BASE } - /** Array initializer of MAILBOX peripheral base pointers */ - #define MAILBOX_BASE_PTRS { MAILBOX } - /** Array initializer of MAILBOX peripheral base addresses */ - #define MAILBOX_BASE_ADDRS_NS { MAILBOX_BASE_NS } - /** Array initializer of MAILBOX peripheral base pointers */ - #define MAILBOX_BASE_PTRS_NS { MAILBOX_NS } -#else - /** Peripheral MAILBOX base address */ - #define MAILBOX_BASE (0x400B2000u) - /** Peripheral MAILBOX base pointer */ - #define MAILBOX ((MAILBOX_Type *)MAILBOX_BASE) - /** Array initializer of MAILBOX peripheral base addresses */ - #define MAILBOX_BASE_ADDRS { MAILBOX_BASE } - /** Array initializer of MAILBOX peripheral base pointers */ - #define MAILBOX_BASE_PTRS { MAILBOX } -#endif - -/*! - * @} - */ /* end of group MAILBOX_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- MRT Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup MRT_Peripheral_Access_Layer MRT Peripheral Access Layer - * @{ - */ - -/** MRT - Register Layout Typedef */ -typedef struct { - struct { /* offset: 0x0, array step: 0x10 */ - __IO uint32_t INTVAL; /**< Time Interval Value, array offset: 0x0, array step: 0x10 */ - __I uint32_t TIMER; /**< Timer, array offset: 0x4, array step: 0x10 */ - __IO uint32_t CTRL; /**< Control, array offset: 0x8, array step: 0x10 */ - __IO uint32_t STAT; /**< Status, array offset: 0xC, array step: 0x10 */ - } CHANNEL[4]; - uint8_t RESERVED_0[176]; - __IO uint32_t MODCFG; /**< Module Configuration, offset: 0xF0 */ - __I uint32_t IDLE_CH; /**< Idle Channel, offset: 0xF4 */ - __IO uint32_t IRQ_FLAG; /**< Global Interrupt Flag, offset: 0xF8 */ -} MRT_Type; - -/* ---------------------------------------------------------------------------- - -- MRT Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup MRT_Register_Masks MRT Register Masks - * @{ - */ - -/*! @name CHANNEL_INTVAL - Time Interval Value */ -/*! @{ */ - -#define MRT_CHANNEL_INTVAL_IVALUE_MASK (0xFFFFFFU) -#define MRT_CHANNEL_INTVAL_IVALUE_SHIFT (0U) -/*! IVALUE - Time Interval Load Value. */ -#define MRT_CHANNEL_INTVAL_IVALUE(x) (((uint32_t)(((uint32_t)(x)) << MRT_CHANNEL_INTVAL_IVALUE_SHIFT)) & MRT_CHANNEL_INTVAL_IVALUE_MASK) - -#define MRT_CHANNEL_INTVAL_LOAD_MASK (0x80000000U) -#define MRT_CHANNEL_INTVAL_LOAD_SHIFT (31U) -/*! LOAD - Force Load Enable - * 0b0..No force load - * 0b1..Force load - */ -#define MRT_CHANNEL_INTVAL_LOAD(x) (((uint32_t)(((uint32_t)(x)) << MRT_CHANNEL_INTVAL_LOAD_SHIFT)) & MRT_CHANNEL_INTVAL_LOAD_MASK) -/*! @} */ - -/* The count of MRT_CHANNEL_INTVAL */ -#define MRT_CHANNEL_INTVAL_COUNT (4U) - -/*! @name CHANNEL_TIMER - Timer */ -/*! @{ */ - -#define MRT_CHANNEL_TIMER_VALUE_MASK (0xFFFFFFU) -#define MRT_CHANNEL_TIMER_VALUE_SHIFT (0U) -/*! VALUE - Current Timer Value */ -#define MRT_CHANNEL_TIMER_VALUE(x) (((uint32_t)(((uint32_t)(x)) << MRT_CHANNEL_TIMER_VALUE_SHIFT)) & MRT_CHANNEL_TIMER_VALUE_MASK) -/*! @} */ - -/* The count of MRT_CHANNEL_TIMER */ -#define MRT_CHANNEL_TIMER_COUNT (4U) - -/*! @name CHANNEL_CTRL - Control */ -/*! @{ */ - -#define MRT_CHANNEL_CTRL_INTEN_MASK (0x1U) -#define MRT_CHANNEL_CTRL_INTEN_SHIFT (0U) -/*! INTEN - Interrupt request - * 0b0..Disabled - * 0b1..Enabled - */ -#define MRT_CHANNEL_CTRL_INTEN(x) (((uint32_t)(((uint32_t)(x)) << MRT_CHANNEL_CTRL_INTEN_SHIFT)) & MRT_CHANNEL_CTRL_INTEN_MASK) - -#define MRT_CHANNEL_CTRL_MODE_MASK (0x6U) -#define MRT_CHANNEL_CTRL_MODE_SHIFT (1U) -/*! MODE - MRT Operating mode - * 0b00..Repeat Interrupt mode - * 0b01..One-Shot Interrupt mode - * 0b10..One-Shot Stall mode - * 0b11..Reserved - */ -#define MRT_CHANNEL_CTRL_MODE(x) (((uint32_t)(((uint32_t)(x)) << MRT_CHANNEL_CTRL_MODE_SHIFT)) & MRT_CHANNEL_CTRL_MODE_MASK) -/*! @} */ - -/* The count of MRT_CHANNEL_CTRL */ -#define MRT_CHANNEL_CTRL_COUNT (4U) - -/*! @name CHANNEL_STAT - Status */ -/*! @{ */ - -#define MRT_CHANNEL_STAT_INTFLAG_MASK (0x1U) -#define MRT_CHANNEL_STAT_INTFLAG_SHIFT (0U) -/*! INTFLAG - Interrupt Flag - * 0b0..No pending interrupt. - * 0b1..Pending interrupt. - */ -#define MRT_CHANNEL_STAT_INTFLAG(x) (((uint32_t)(((uint32_t)(x)) << MRT_CHANNEL_STAT_INTFLAG_SHIFT)) & MRT_CHANNEL_STAT_INTFLAG_MASK) - -#define MRT_CHANNEL_STAT_RUN_MASK (0x2U) -#define MRT_CHANNEL_STAT_RUN_SHIFT (1U) -/*! RUN - Timer n State - * 0b0..Idle state. - * 0b1..Running. - */ -#define MRT_CHANNEL_STAT_RUN(x) (((uint32_t)(((uint32_t)(x)) << MRT_CHANNEL_STAT_RUN_SHIFT)) & MRT_CHANNEL_STAT_RUN_MASK) - -#define MRT_CHANNEL_STAT_INUSE_MASK (0x4U) -#define MRT_CHANNEL_STAT_INUSE_SHIFT (2U) -/*! INUSE - Channel-In-Use flag - * 0b0..This timer channel is not in use. - * 0b1..This timer channel is in use. - */ -#define MRT_CHANNEL_STAT_INUSE(x) (((uint32_t)(((uint32_t)(x)) << MRT_CHANNEL_STAT_INUSE_SHIFT)) & MRT_CHANNEL_STAT_INUSE_MASK) -/*! @} */ - -/* The count of MRT_CHANNEL_STAT */ -#define MRT_CHANNEL_STAT_COUNT (4U) - -/*! @name MODCFG - Module Configuration */ -/*! @{ */ - -#define MRT_MODCFG_NOC_MASK (0xFU) -#define MRT_MODCFG_NOC_SHIFT (0U) -/*! NOC - Number of Channels */ -#define MRT_MODCFG_NOC(x) (((uint32_t)(((uint32_t)(x)) << MRT_MODCFG_NOC_SHIFT)) & MRT_MODCFG_NOC_MASK) - -#define MRT_MODCFG_NOB_MASK (0x1F0U) -#define MRT_MODCFG_NOB_SHIFT (4U) -/*! NOB - Number of Bits */ -#define MRT_MODCFG_NOB(x) (((uint32_t)(((uint32_t)(x)) << MRT_MODCFG_NOB_SHIFT)) & MRT_MODCFG_NOB_MASK) - -#define MRT_MODCFG_MULTITASK_MASK (0x80000000U) -#define MRT_MODCFG_MULTITASK_SHIFT (31U) -/*! MULTITASK - MULTITASK - * 0b0..Hardware status mode. - * 0b1..Multitask mode - */ -#define MRT_MODCFG_MULTITASK(x) (((uint32_t)(((uint32_t)(x)) << MRT_MODCFG_MULTITASK_SHIFT)) & MRT_MODCFG_MULTITASK_MASK) -/*! @} */ - -/*! @name IDLE_CH - Idle Channel */ -/*! @{ */ - -#define MRT_IDLE_CH_CHAN_MASK (0xF0U) -#define MRT_IDLE_CH_CHAN_SHIFT (4U) -/*! CHAN - Idle Channel */ -#define MRT_IDLE_CH_CHAN(x) (((uint32_t)(((uint32_t)(x)) << MRT_IDLE_CH_CHAN_SHIFT)) & MRT_IDLE_CH_CHAN_MASK) -/*! @} */ - -/*! @name IRQ_FLAG - Global Interrupt Flag */ -/*! @{ */ - -#define MRT_IRQ_FLAG_GFLAG0_MASK (0x1U) -#define MRT_IRQ_FLAG_GFLAG0_SHIFT (0U) -/*! GFLAG0 - Interrupt Flag - * 0b0..No pending interrupt. - * 0b1..Pending interrupt - */ -#define MRT_IRQ_FLAG_GFLAG0(x) (((uint32_t)(((uint32_t)(x)) << MRT_IRQ_FLAG_GFLAG0_SHIFT)) & MRT_IRQ_FLAG_GFLAG0_MASK) - -#define MRT_IRQ_FLAG_GFLAG1_MASK (0x2U) -#define MRT_IRQ_FLAG_GFLAG1_SHIFT (1U) -/*! GFLAG1 - Interrupt Flag */ -#define MRT_IRQ_FLAG_GFLAG1(x) (((uint32_t)(((uint32_t)(x)) << MRT_IRQ_FLAG_GFLAG1_SHIFT)) & MRT_IRQ_FLAG_GFLAG1_MASK) - -#define MRT_IRQ_FLAG_GFLAG2_MASK (0x4U) -#define MRT_IRQ_FLAG_GFLAG2_SHIFT (2U) -/*! GFLAG2 - Interrupt Flag */ -#define MRT_IRQ_FLAG_GFLAG2(x) (((uint32_t)(((uint32_t)(x)) << MRT_IRQ_FLAG_GFLAG2_SHIFT)) & MRT_IRQ_FLAG_GFLAG2_MASK) - -#define MRT_IRQ_FLAG_GFLAG3_MASK (0x8U) -#define MRT_IRQ_FLAG_GFLAG3_SHIFT (3U) -/*! GFLAG3 - Interrupt Flag */ -#define MRT_IRQ_FLAG_GFLAG3(x) (((uint32_t)(((uint32_t)(x)) << MRT_IRQ_FLAG_GFLAG3_SHIFT)) & MRT_IRQ_FLAG_GFLAG3_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group MRT_Register_Masks */ - - -/* MRT - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral MRT0 base address */ - #define MRT0_BASE (0x50013000u) - /** Peripheral MRT0 base address */ - #define MRT0_BASE_NS (0x40013000u) - /** Peripheral MRT0 base pointer */ - #define MRT0 ((MRT_Type *)MRT0_BASE) - /** Peripheral MRT0 base pointer */ - #define MRT0_NS ((MRT_Type *)MRT0_BASE_NS) - /** Array initializer of MRT peripheral base addresses */ - #define MRT_BASE_ADDRS { MRT0_BASE } - /** Array initializer of MRT peripheral base pointers */ - #define MRT_BASE_PTRS { MRT0 } - /** Array initializer of MRT peripheral base addresses */ - #define MRT_BASE_ADDRS_NS { MRT0_BASE_NS } - /** Array initializer of MRT peripheral base pointers */ - #define MRT_BASE_PTRS_NS { MRT0_NS } -#else - /** Peripheral MRT0 base address */ - #define MRT0_BASE (0x40013000u) - /** Peripheral MRT0 base pointer */ - #define MRT0 ((MRT_Type *)MRT0_BASE) - /** Array initializer of MRT peripheral base addresses */ - #define MRT_BASE_ADDRS { MRT0_BASE } - /** Array initializer of MRT peripheral base pointers */ - #define MRT_BASE_PTRS { MRT0 } -#endif -/** Interrupt vectors for the MRT peripheral type */ -#define MRT_IRQS { MRT0_IRQn } - -/*! - * @} - */ /* end of group MRT_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- NPX Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup NPX_Peripheral_Access_Layer NPX Peripheral Access Layer - * @{ - */ - -/** NPX - Register Layout Typedef */ -typedef struct { - __IO uint32_t NPXCR; /**< NPX Control Register, offset: 0x0 */ - uint8_t RESERVED_0[4]; - __I uint32_t NPXSR; /**< NPX Status Register, offset: 0x8 */ - uint8_t RESERVED_1[4]; - __O uint32_t CACMSK; /**< Flash Cache Obfuscation Mask, offset: 0x10 */ - uint8_t RESERVED_2[12]; - __IO uint32_t REMAP; /**< Data Remap, offset: 0x20 */ - uint8_t RESERVED_3[28]; - struct { /* offset: 0x40, array step: 0x10 */ - __IO uint32_t VMAPCTX_WD[2]; /**< Bitmap of Valid Control for Memory Context 0..Bitmap of Valid Control for Memory Context 3, array offset: 0x40, array step: index*0x10, index2*0x4 */ - __O uint32_t BIVCTX_WD[2]; /**< Block Initial Vector for Memory Context 0..Block Initial Vector for Memory Context 3, array offset: 0x48, array step: index*0x10, index2*0x4 */ - } CTX_VALID_IV_ARRAY[4]; -} NPX_Type; - -/* ---------------------------------------------------------------------------- - -- NPX Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup NPX_Register_Masks NPX Register Masks - * @{ - */ - -/*! @name NPXCR - NPX Control Register */ -/*! @{ */ - -#define NPX_NPXCR_GEE_MASK (0x1U) -#define NPX_NPXCR_GEE_SHIFT (0U) -/*! GEE - Global Encryption Enable - * 0b1..Global encryption enabled. NPX on-the-fly encryption is enabled if the flash access hits in a valid - * memory context. Subsequent reads return 1. - * 0b0..Global encryption disabled. NPX on-the-fly encryption is disabled. Subsequent reads return 0. - */ -#define NPX_NPXCR_GEE(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXCR_GEE_SHIFT)) & NPX_NPXCR_GEE_MASK) - -#define NPX_NPXCR_GDE_MASK (0x4U) -#define NPX_NPXCR_GDE_SHIFT (2U) -/*! GDE - Global Decryption Enable - * 0b1..Global decryption enabled. NPX on-the-fly decryption is globally enabled. Subsequent reads return 1. - * 0b0..Global decryption disabled. NPX on-the-fly decryption is globally disabled. Subsequent reads return 0. - */ -#define NPX_NPXCR_GDE(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXCR_GDE_SHIFT)) & NPX_NPXCR_GDE_MASK) - -#define NPX_NPXCR_GLK_MASK (0x10U) -#define NPX_NPXCR_GLK_SHIFT (4U) -/*! GLK - Global Lock Enable - * 0b1..Lock enabled: cannot write to VMAPCTXn, NPXCR, or CACMSK. Subsequent reads return 1. - * 0b0..Lock disabled. Subsequent reads return 0. - */ -#define NPX_NPXCR_GLK(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXCR_GLK_SHIFT)) & NPX_NPXCR_GLK_MASK) - -#define NPX_NPXCR_MLK_MASK (0x40U) -#define NPX_NPXCR_MLK_SHIFT (6U) -/*! MLK - Mask Lock Enable - * 0b1..Lock enabled: cannot write to mask. Subsequent reads return 1. - * 0b0..Lock disabled. Subsequent reads return 0. - */ -#define NPX_NPXCR_MLK(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXCR_MLK_SHIFT)) & NPX_NPXCR_MLK_MASK) - -#define NPX_NPXCR_CTX0LK_MASK (0x100U) -#define NPX_NPXCR_CTX0LK_SHIFT (8U) -/*! CTX0LK - Lock Enable for Context 0 - * 0b1..Lock enabled: cannot write to VMAPCTX0 (becomes read-only) - * 0b0..Lock disabled: VMAPCTX0 remains read-write - */ -#define NPX_NPXCR_CTX0LK(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXCR_CTX0LK_SHIFT)) & NPX_NPXCR_CTX0LK_MASK) - -#define NPX_NPXCR_CTX1LK_MASK (0x400U) -#define NPX_NPXCR_CTX1LK_SHIFT (10U) -/*! CTX1LK - Lock Enable for Context 1 - * 0b1..Lock enabled: cannot write to VMAPCTX1 (becomes read-only) - * 0b0..Lock disabled: VMAPCTX1 remains read-write - */ -#define NPX_NPXCR_CTX1LK(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXCR_CTX1LK_SHIFT)) & NPX_NPXCR_CTX1LK_MASK) - -#define NPX_NPXCR_CTX2LK_MASK (0x1000U) -#define NPX_NPXCR_CTX2LK_SHIFT (12U) -/*! CTX2LK - Lock Enable for Context 2 - * 0b1..Lock enabled: cannot write to VMAPCTX2 (becomes read-only) - * 0b0..Lock disabled: VMAPCTX2 remains read-write - */ -#define NPX_NPXCR_CTX2LK(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXCR_CTX2LK_SHIFT)) & NPX_NPXCR_CTX2LK_MASK) - -#define NPX_NPXCR_CTX3LK_MASK (0x4000U) -#define NPX_NPXCR_CTX3LK_SHIFT (14U) -/*! CTX3LK - Lock Enable for Context 3 - * 0b1..Lock enabled: cannot write to VMAPCTX3 (becomes read-only) - * 0b0..Lock disabled: VMAPCTX3 remains read-write - */ -#define NPX_NPXCR_CTX3LK(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXCR_CTX3LK_SHIFT)) & NPX_NPXCR_CTX3LK_MASK) -/*! @} */ - -/*! @name NPXSR - NPX Status Register */ -/*! @{ */ - -#define NPX_NPXSR_NUMCTX_MASK (0xFU) -#define NPX_NPXSR_NUMCTX_SHIFT (0U) -/*! NUMCTX - Number of implemented memory contexts - * 0b0000..No (zero) implemented memory contexts - * 0b0001..1 implemented memory contexts - * 0b0010..2 implemented memory contexts - * 0b0011..3 implemented memory contexts - * 0b0100..4 implemented memory contexts - */ -#define NPX_NPXSR_NUMCTX(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXSR_NUMCTX_SHIFT)) & NPX_NPXSR_NUMCTX_MASK) - -#define NPX_NPXSR_V0_MASK (0x100U) -#define NPX_NPXSR_V0_SHIFT (8U) -/*! V0 - Key n Valid - * 0b0..Not valid - * 0b1..Valid - */ -#define NPX_NPXSR_V0(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXSR_V0_SHIFT)) & NPX_NPXSR_V0_MASK) - -#define NPX_NPXSR_V1_MASK (0x200U) -#define NPX_NPXSR_V1_SHIFT (9U) -/*! V1 - Key n Valid - * 0b0..Not valid - * 0b1..Valid - */ -#define NPX_NPXSR_V1(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXSR_V1_SHIFT)) & NPX_NPXSR_V1_MASK) - -#define NPX_NPXSR_V2_MASK (0x400U) -#define NPX_NPXSR_V2_SHIFT (10U) -/*! V2 - Key n Valid - * 0b0..Not valid - * 0b1..Valid - */ -#define NPX_NPXSR_V2(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXSR_V2_SHIFT)) & NPX_NPXSR_V2_MASK) - -#define NPX_NPXSR_V3_MASK (0x800U) -#define NPX_NPXSR_V3_SHIFT (11U) -/*! V3 - Key n Valid - * 0b0..Not valid - * 0b1..Valid - */ -#define NPX_NPXSR_V3(x) (((uint32_t)(((uint32_t)(x)) << NPX_NPXSR_V3_SHIFT)) & NPX_NPXSR_V3_MASK) -/*! @} */ - -/*! @name CACMSK - Flash Cache Obfuscation Mask */ -/*! @{ */ - -#define NPX_CACMSK_OBMASK_MASK (0xFFFFFFFFU) -#define NPX_CACMSK_OBMASK_SHIFT (0U) -/*! OBMASK - Obfuscation Mask */ -#define NPX_CACMSK_OBMASK(x) (((uint32_t)(((uint32_t)(x)) << NPX_CACMSK_OBMASK_SHIFT)) & NPX_CACMSK_OBMASK_MASK) -/*! @} */ - -/*! @name REMAP - Data Remap */ -/*! @{ */ - -#define NPX_REMAP_REMAPLK_MASK (0x1U) -#define NPX_REMAP_REMAPLK_SHIFT (0U) -/*! REMAPLK - Remap Lock Enable - * 0b1..Lock enabled: cannot write to REMAP - * 0b0..Lock disabled: can write to REMAP - */ -#define NPX_REMAP_REMAPLK(x) (((uint32_t)(((uint32_t)(x)) << NPX_REMAP_REMAPLK_SHIFT)) & NPX_REMAP_REMAPLK_MASK) - -#define NPX_REMAP_LIM_MASK (0x1F0000U) -#define NPX_REMAP_LIM_SHIFT (16U) -/*! LIM - LIM Remapping Address */ -#define NPX_REMAP_LIM(x) (((uint32_t)(((uint32_t)(x)) << NPX_REMAP_LIM_SHIFT)) & NPX_REMAP_LIM_MASK) - -#define NPX_REMAP_LIMDP_MASK (0x1F000000U) -#define NPX_REMAP_LIMDP_SHIFT (24U) -/*! LIMDP - LIMDP Remapping Address */ -#define NPX_REMAP_LIMDP(x) (((uint32_t)(((uint32_t)(x)) << NPX_REMAP_LIMDP_SHIFT)) & NPX_REMAP_LIMDP_MASK) -/*! @} */ - -/*! @name CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD - Bitmap of Valid Control for Memory Context 0..Bitmap of Valid Control for Memory Context 3 */ -/*! @{ */ - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL0_MASK (0x1U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL0_SHIFT (0U) -/*! VAL0 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL0(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL0_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL0_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL32_MASK (0x1U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL32_SHIFT (0U) -/*! VAL32 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL32(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL32_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL32_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL1_MASK (0x2U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL1_SHIFT (1U) -/*! VAL1 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL1(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL1_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL1_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL33_MASK (0x2U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL33_SHIFT (1U) -/*! VAL33 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL33(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL33_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL33_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL2_MASK (0x4U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL2_SHIFT (2U) -/*! VAL2 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL2(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL2_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL2_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL34_MASK (0x4U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL34_SHIFT (2U) -/*! VAL34 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL34(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL34_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL34_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL3_MASK (0x8U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL3_SHIFT (3U) -/*! VAL3 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL3(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL3_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL3_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL35_MASK (0x8U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL35_SHIFT (3U) -/*! VAL35 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL35(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL35_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL35_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL4_MASK (0x10U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL4_SHIFT (4U) -/*! VAL4 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL4(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL4_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL4_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL36_MASK (0x10U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL36_SHIFT (4U) -/*! VAL36 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL36(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL36_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL36_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL5_MASK (0x20U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL5_SHIFT (5U) -/*! VAL5 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL5(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL5_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL5_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL37_MASK (0x20U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL37_SHIFT (5U) -/*! VAL37 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL37(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL37_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL37_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL6_MASK (0x40U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL6_SHIFT (6U) -/*! VAL6 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL6(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL6_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL6_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL38_MASK (0x40U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL38_SHIFT (6U) -/*! VAL38 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL38(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL38_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL38_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL7_MASK (0x80U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL7_SHIFT (7U) -/*! VAL7 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL7(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL7_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL7_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL39_MASK (0x80U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL39_SHIFT (7U) -/*! VAL39 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL39(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL39_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL39_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL8_MASK (0x100U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL8_SHIFT (8U) -/*! VAL8 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL8(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL8_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL8_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL40_MASK (0x100U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL40_SHIFT (8U) -/*! VAL40 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL40(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL40_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL40_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL9_MASK (0x200U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL9_SHIFT (9U) -/*! VAL9 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL9(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL9_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL9_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL41_MASK (0x200U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL41_SHIFT (9U) -/*! VAL41 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL41(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL41_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL41_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL10_MASK (0x400U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL10_SHIFT (10U) -/*! VAL10 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL10(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL10_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL10_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL42_MASK (0x400U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL42_SHIFT (10U) -/*! VAL42 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL42(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL42_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL42_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL11_MASK (0x800U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL11_SHIFT (11U) -/*! VAL11 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL11(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL11_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL11_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL43_MASK (0x800U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL43_SHIFT (11U) -/*! VAL43 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL43(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL43_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL43_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL12_MASK (0x1000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL12_SHIFT (12U) -/*! VAL12 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL12(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL12_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL12_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL44_MASK (0x1000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL44_SHIFT (12U) -/*! VAL44 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL44(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL44_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL44_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL13_MASK (0x2000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL13_SHIFT (13U) -/*! VAL13 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL13(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL13_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL13_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL45_MASK (0x2000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL45_SHIFT (13U) -/*! VAL45 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL45(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL45_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL45_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL14_MASK (0x4000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL14_SHIFT (14U) -/*! VAL14 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL14(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL14_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL14_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL46_MASK (0x4000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL46_SHIFT (14U) -/*! VAL46 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL46(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL46_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL46_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL15_MASK (0x8000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL15_SHIFT (15U) -/*! VAL15 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL15(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL15_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL15_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL47_MASK (0x8000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL47_SHIFT (15U) -/*! VAL47 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL47(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL47_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL47_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL16_MASK (0x10000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL16_SHIFT (16U) -/*! VAL16 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL16(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL16_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL16_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL48_MASK (0x10000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL48_SHIFT (16U) -/*! VAL48 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL48(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL48_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL48_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL17_MASK (0x20000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL17_SHIFT (17U) -/*! VAL17 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL17(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL17_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL17_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL49_MASK (0x20000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL49_SHIFT (17U) -/*! VAL49 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL49(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL49_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL49_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL18_MASK (0x40000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL18_SHIFT (18U) -/*! VAL18 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL18(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL18_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL18_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL50_MASK (0x40000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL50_SHIFT (18U) -/*! VAL50 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL50(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL50_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL50_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL19_MASK (0x80000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL19_SHIFT (19U) -/*! VAL19 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL19(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL19_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL19_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL51_MASK (0x80000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL51_SHIFT (19U) -/*! VAL51 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL51(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL51_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL51_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL20_MASK (0x100000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL20_SHIFT (20U) -/*! VAL20 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL20(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL20_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL20_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL52_MASK (0x100000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL52_SHIFT (20U) -/*! VAL52 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL52(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL52_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL52_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL21_MASK (0x200000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL21_SHIFT (21U) -/*! VAL21 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL21(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL21_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL21_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL53_MASK (0x200000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL53_SHIFT (21U) -/*! VAL53 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL53(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL53_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL53_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL22_MASK (0x400000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL22_SHIFT (22U) -/*! VAL22 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL22(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL22_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL22_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL54_MASK (0x400000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL54_SHIFT (22U) -/*! VAL54 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL54(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL54_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL54_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL23_MASK (0x800000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL23_SHIFT (23U) -/*! VAL23 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL23(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL23_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL23_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL55_MASK (0x800000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL55_SHIFT (23U) -/*! VAL55 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL55(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL55_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL55_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL24_MASK (0x1000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL24_SHIFT (24U) -/*! VAL24 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL24(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL24_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL24_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL56_MASK (0x1000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL56_SHIFT (24U) -/*! VAL56 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL56(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL56_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL56_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL25_MASK (0x2000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL25_SHIFT (25U) -/*! VAL25 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL25(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL25_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL25_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL57_MASK (0x2000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL57_SHIFT (25U) -/*! VAL57 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL57(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL57_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL57_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL26_MASK (0x4000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL26_SHIFT (26U) -/*! VAL26 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL26(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL26_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL26_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL58_MASK (0x4000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL58_SHIFT (26U) -/*! VAL58 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL58(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL58_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL58_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL27_MASK (0x8000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL27_SHIFT (27U) -/*! VAL27 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL27(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL27_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL27_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL59_MASK (0x8000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL59_SHIFT (27U) -/*! VAL59 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL59(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL59_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL59_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL28_MASK (0x10000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL28_SHIFT (28U) -/*! VAL28 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL28(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL28_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL28_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL60_MASK (0x10000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL60_SHIFT (28U) -/*! VAL60 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL60(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL60_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL60_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL29_MASK (0x20000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL29_SHIFT (29U) -/*! VAL29 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL29(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL29_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL29_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL61_MASK (0x20000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL61_SHIFT (29U) -/*! VAL61 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL61(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL61_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL61_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL30_MASK (0x40000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL30_SHIFT (30U) -/*! VAL30 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL30(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL30_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL30_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL62_MASK (0x40000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL62_SHIFT (30U) -/*! VAL62 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL62(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL62_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL62_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL31_MASK (0x80000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL31_SHIFT (31U) -/*! VAL31 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL31(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL31_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL31_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL63_MASK (0x80000000U) -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL63_SHIFT (31U) -/*! VAL63 - Block valid enable for encryption/decryption - * 0b0..Disable - * 0b1..Enable - */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL63(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL63_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_VAL63_MASK) -/*! @} */ - -/* The count of NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_COUNT (4U) - -/* The count of NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD */ -#define NPX_CTX_VALID_IV_ARRAY_VMAPCTX_ARRAY_VMAPCTX_WD_COUNT2 (2U) - -/*! @name CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD - Block Initial Vector for Memory Context 0..Block Initial Vector for Memory Context 3 */ -/*! @{ */ - -#define NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_BIV_WD0_MASK (0xFFFFFFFFU) -#define NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_BIV_WD0_SHIFT (0U) -/*! BIV_WD0 - Block Initial Vector Word0 */ -#define NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_BIV_WD0(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_BIV_WD0_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_BIV_WD0_MASK) - -#define NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_BIV_WD1_MASK (0xFFFFFFFFU) -#define NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_BIV_WD1_SHIFT (0U) -/*! BIV_WD1 - Block Initial Vector Word1 */ -#define NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_BIV_WD1(x) (((uint32_t)(((uint32_t)(x)) << NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_BIV_WD1_SHIFT)) & NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_BIV_WD1_MASK) -/*! @} */ - -/* The count of NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD */ -#define NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_COUNT (4U) - -/* The count of NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD */ -#define NPX_CTX_VALID_IV_ARRAY_BIVCTX_ARRAY_BIVCTX_WD_COUNT2 (2U) - - -/*! - * @} - */ /* end of group NPX_Register_Masks */ - - -/* NPX - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral NPX0 base address */ - #define NPX0_BASE (0x500CC000u) - /** Peripheral NPX0 base address */ - #define NPX0_BASE_NS (0x400CC000u) - /** Peripheral NPX0 base pointer */ - #define NPX0 ((NPX_Type *)NPX0_BASE) - /** Peripheral NPX0 base pointer */ - #define NPX0_NS ((NPX_Type *)NPX0_BASE_NS) - /** Array initializer of NPX peripheral base addresses */ - #define NPX_BASE_ADDRS { NPX0_BASE } - /** Array initializer of NPX peripheral base pointers */ - #define NPX_BASE_PTRS { NPX0 } - /** Array initializer of NPX peripheral base addresses */ - #define NPX_BASE_ADDRS_NS { NPX0_BASE_NS } - /** Array initializer of NPX peripheral base pointers */ - #define NPX_BASE_PTRS_NS { NPX0_NS } -#else - /** Peripheral NPX0 base address */ - #define NPX0_BASE (0x400CC000u) - /** Peripheral NPX0 base pointer */ - #define NPX0 ((NPX_Type *)NPX0_BASE) - /** Array initializer of NPX peripheral base addresses */ - #define NPX_BASE_ADDRS { NPX0_BASE } - /** Array initializer of NPX peripheral base pointers */ - #define NPX_BASE_PTRS { NPX0 } -#endif - -/*! - * @} - */ /* end of group NPX_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- OPAMP Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup OPAMP_Peripheral_Access_Layer OPAMP Peripheral Access Layer - * @{ - */ - -/** OPAMP - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - __IO uint32_t OPAMP_CTR; /**< OPAMP Control, offset: 0x8 */ -} OPAMP_Type; - -/* ---------------------------------------------------------------------------- - -- OPAMP Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup OPAMP_Register_Masks OPAMP Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define OPAMP_VERID_FEATURE_MASK (0xFFFFU) -#define OPAMP_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number */ -#define OPAMP_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_VERID_FEATURE_SHIFT)) & OPAMP_VERID_FEATURE_MASK) - -#define OPAMP_VERID_MINOR_MASK (0xFF0000U) -#define OPAMP_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define OPAMP_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_VERID_MINOR_SHIFT)) & OPAMP_VERID_MINOR_MASK) - -#define OPAMP_VERID_MAJOR_MASK (0xFF000000U) -#define OPAMP_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define OPAMP_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_VERID_MAJOR_SHIFT)) & OPAMP_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define OPAMP_PARAM_PGA_FUNCTION_MASK (0x1U) -#define OPAMP_PARAM_PGA_FUNCTION_SHIFT (0U) -/*! PGA_FUNCTION - PGA Function Option - * 0b0..Core amplifier enabled - * 0b1..PGA function enabled - */ -#define OPAMP_PARAM_PGA_FUNCTION(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_PARAM_PGA_FUNCTION_SHIFT)) & OPAMP_PARAM_PGA_FUNCTION_MASK) -/*! @} */ - -/*! @name OPAMP_CTR - OPAMP Control */ -/*! @{ */ - -#define OPAMP_OPAMP_CTR_EN_MASK (0x1U) -#define OPAMP_OPAMP_CTR_EN_SHIFT (0U) -/*! EN - OPAMP Enable - * 0b0..Disable - * 0b1..Enable - */ -#define OPAMP_OPAMP_CTR_EN(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_EN_SHIFT)) & OPAMP_OPAMP_CTR_EN_MASK) - -#define OPAMP_OPAMP_CTR_MODE_MASK (0x2U) -#define OPAMP_OPAMP_CTR_MODE_SHIFT (1U) -/*! MODE - Mode Selection - * 0b0..High performance mode - * 0b1..Low power mode - */ -#define OPAMP_OPAMP_CTR_MODE(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_MODE_SHIFT)) & OPAMP_OPAMP_CTR_MODE_MASK) - -#define OPAMP_OPAMP_CTR_BIASC_MASK (0xCU) -#define OPAMP_OPAMP_CTR_BIASC_SHIFT (2U) -/*! BIASC - Bias Current Trim Selection - * 0b00..Default - * 0b01..Increase current - * 0b10..Decrease current - * 0b11..Further decrease current - */ -#define OPAMP_OPAMP_CTR_BIASC(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_BIASC_SHIFT)) & OPAMP_OPAMP_CTR_BIASC_MASK) - -#define OPAMP_OPAMP_CTR_INTREF_MASK (0x30U) -#define OPAMP_OPAMP_CTR_INTREF_SHIFT (4U) -/*! INTREF - Provide OPAMP rail to rail voltage selection - * 0b00..Select OPAMP input rail to rail voltage from 0 to VDD_ANA - * 0b01..Select OPAMP input rail to rail voltage from 0 to VDD_ANA-0.8V - * 0b10..Select OPAMP input rail to rail voltage from 0.8V to VDD_ANA - * 0b11..Not allowed - */ -#define OPAMP_OPAMP_CTR_INTREF(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_INTREF_SHIFT)) & OPAMP_OPAMP_CTR_INTREF_MASK) - -#define OPAMP_OPAMP_CTR_TRIGMD_MASK (0x100U) -#define OPAMP_OPAMP_CTR_TRIGMD_SHIFT (8U) -/*! TRIGMD - Trigger Mode - * 0b0..Disable - * 0b1..Enable - */ -#define OPAMP_OPAMP_CTR_TRIGMD(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_TRIGMD_SHIFT)) & OPAMP_OPAMP_CTR_TRIGMD_MASK) - -#define OPAMP_OPAMP_CTR_INPSEL_MASK (0x200U) -#define OPAMP_OPAMP_CTR_INPSEL_SHIFT (9U) -/*! INPSEL - Positive Input Channel Selection - * 0b0..When OPAMP is not in trigger mode, select positive input 0 (INP0) - * 0b1..When OPAMP is not in trigger mode, select positive input 1 (INP1) - */ -#define OPAMP_OPAMP_CTR_INPSEL(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_INPSEL_SHIFT)) & OPAMP_OPAMP_CTR_INPSEL_MASK) - -#define OPAMP_OPAMP_CTR_INPF_MASK (0x1000U) -#define OPAMP_OPAMP_CTR_INPF_SHIFT (12U) -/*! INPF - Positive Input Connection Status - * 0b0..Positive input 0 (INP0) - * 0b1..Positive input 1 (INP1) - */ -#define OPAMP_OPAMP_CTR_INPF(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_INPF_SHIFT)) & OPAMP_OPAMP_CTR_INPF_MASK) - -#define OPAMP_OPAMP_CTR_BUFEN_MASK (0x10000U) -#define OPAMP_OPAMP_CTR_BUFEN_SHIFT (16U) -/*! BUFEN - Reference Buffer - * 0b0..Disables - * 0b1..Enables - */ -#define OPAMP_OPAMP_CTR_BUFEN(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_BUFEN_SHIFT)) & OPAMP_OPAMP_CTR_BUFEN_MASK) - -#define OPAMP_OPAMP_CTR_PREF_MASK (0x60000U) -#define OPAMP_OPAMP_CTR_PREF_SHIFT (17U) -/*! PREF - Positive Reference Voltage Selection - * 0b00..Input 0 - * 0b01..Input 1 - * 0b10..Input 2 - * 0b11..Input 3 - */ -#define OPAMP_OPAMP_CTR_PREF(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_PREF_SHIFT)) & OPAMP_OPAMP_CTR_PREF_MASK) - -#define OPAMP_OPAMP_CTR_ADCSW1_MASK (0x100000U) -#define OPAMP_OPAMP_CTR_ADCSW1_SHIFT (20U) -/*! ADCSW1 - Measure Switch 1 - * 0b0..Measure negative gain resistor ladder voltage switch off - * 0b1..Measure negative gain resistor ladder voltage switch on - */ -#define OPAMP_OPAMP_CTR_ADCSW1(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_ADCSW1_SHIFT)) & OPAMP_OPAMP_CTR_ADCSW1_MASK) - -#define OPAMP_OPAMP_CTR_ADCSW2_MASK (0x200000U) -#define OPAMP_OPAMP_CTR_ADCSW2_SHIFT (21U) -/*! ADCSW2 - Measure Switch 2 - * 0b0..Measure positive gain resistor ladder reference voltage switch off - * 0b1..Measure positive gain resistor ladder reference voltage switch on - */ -#define OPAMP_OPAMP_CTR_ADCSW2(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_ADCSW2_SHIFT)) & OPAMP_OPAMP_CTR_ADCSW2_MASK) - -#define OPAMP_OPAMP_CTR_OUTSW_MASK (0x400000U) -#define OPAMP_OPAMP_CTR_OUTSW_SHIFT (22U) -/*! OUTSW - Output Switch - * 0b0..OPAMP out to negative gain resistor ladder switch off - * 0b1..OPAMP out to negative gain resistor ladder switch on - */ -#define OPAMP_OPAMP_CTR_OUTSW(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_OUTSW_SHIFT)) & OPAMP_OPAMP_CTR_OUTSW_MASK) - -#define OPAMP_OPAMP_CTR_PGAIN_MASK (0x7000000U) -#define OPAMP_OPAMP_CTR_PGAIN_SHIFT (24U) -/*! PGAIN - Positive PGA Selection - * 0b000..Positive input 1 (INP1) - * 0b001..Pgain=1 - * 0b010..Pgain=2 - * 0b011..Pgain=4 - * 0b100..Pgain=8 - * 0b101..Pgain=16 - * 0b110..Pgain=33 - * 0b111..Pgain=64 - */ -#define OPAMP_OPAMP_CTR_PGAIN(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_PGAIN_SHIFT)) & OPAMP_OPAMP_CTR_PGAIN_MASK) - -#define OPAMP_OPAMP_CTR_NGAIN_MASK (0x70000000U) -#define OPAMP_OPAMP_CTR_NGAIN_SHIFT (28U) -/*! NGAIN - Negative PGA Selection - * 0b000..Buffer - * 0b001..Ngain=1 - * 0b010..Ngain=2 - * 0b011..Ngain=4 - * 0b100..Ngain=8 - * 0b101..Ngain=16 - * 0b110..Ngain=33 - * 0b111..Ngain=64 - */ -#define OPAMP_OPAMP_CTR_NGAIN(x) (((uint32_t)(((uint32_t)(x)) << OPAMP_OPAMP_CTR_NGAIN_SHIFT)) & OPAMP_OPAMP_CTR_NGAIN_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group OPAMP_Register_Masks */ - - -/* OPAMP - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral OPAMP0 base address */ - #define OPAMP0_BASE (0x50110000u) - /** Peripheral OPAMP0 base address */ - #define OPAMP0_BASE_NS (0x40110000u) - /** Peripheral OPAMP0 base pointer */ - #define OPAMP0 ((OPAMP_Type *)OPAMP0_BASE) - /** Peripheral OPAMP0 base pointer */ - #define OPAMP0_NS ((OPAMP_Type *)OPAMP0_BASE_NS) - /** Peripheral OPAMP1 base address */ - #define OPAMP1_BASE (0x50113000u) - /** Peripheral OPAMP1 base address */ - #define OPAMP1_BASE_NS (0x40113000u) - /** Peripheral OPAMP1 base pointer */ - #define OPAMP1 ((OPAMP_Type *)OPAMP1_BASE) - /** Peripheral OPAMP1 base pointer */ - #define OPAMP1_NS ((OPAMP_Type *)OPAMP1_BASE_NS) - /** Peripheral OPAMP2 base address */ - #define OPAMP2_BASE (0x50115000u) - /** Peripheral OPAMP2 base address */ - #define OPAMP2_BASE_NS (0x40115000u) - /** Peripheral OPAMP2 base pointer */ - #define OPAMP2 ((OPAMP_Type *)OPAMP2_BASE) - /** Peripheral OPAMP2 base pointer */ - #define OPAMP2_NS ((OPAMP_Type *)OPAMP2_BASE_NS) - /** Array initializer of OPAMP peripheral base addresses */ - #define OPAMP_BASE_ADDRS { OPAMP0_BASE, OPAMP1_BASE, OPAMP2_BASE } - /** Array initializer of OPAMP peripheral base pointers */ - #define OPAMP_BASE_PTRS { OPAMP0, OPAMP1, OPAMP2 } - /** Array initializer of OPAMP peripheral base addresses */ - #define OPAMP_BASE_ADDRS_NS { OPAMP0_BASE_NS, OPAMP1_BASE_NS, OPAMP2_BASE_NS } - /** Array initializer of OPAMP peripheral base pointers */ - #define OPAMP_BASE_PTRS_NS { OPAMP0_NS, OPAMP1_NS, OPAMP2_NS } -#else - /** Peripheral OPAMP0 base address */ - #define OPAMP0_BASE (0x40110000u) - /** Peripheral OPAMP0 base pointer */ - #define OPAMP0 ((OPAMP_Type *)OPAMP0_BASE) - /** Peripheral OPAMP1 base address */ - #define OPAMP1_BASE (0x40113000u) - /** Peripheral OPAMP1 base pointer */ - #define OPAMP1 ((OPAMP_Type *)OPAMP1_BASE) - /** Peripheral OPAMP2 base address */ - #define OPAMP2_BASE (0x40115000u) - /** Peripheral OPAMP2 base pointer */ - #define OPAMP2 ((OPAMP_Type *)OPAMP2_BASE) - /** Array initializer of OPAMP peripheral base addresses */ - #define OPAMP_BASE_ADDRS { OPAMP0_BASE, OPAMP1_BASE, OPAMP2_BASE } - /** Array initializer of OPAMP peripheral base pointers */ - #define OPAMP_BASE_PTRS { OPAMP0, OPAMP1, OPAMP2 } -#endif - -/*! - * @} - */ /* end of group OPAMP_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- OSTIMER Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup OSTIMER_Peripheral_Access_Layer OSTIMER Peripheral Access Layer - * @{ - */ - -/** OSTIMER - Register Layout Typedef */ -typedef struct { - __I uint32_t EVTIMERL; /**< EVTIMER Low, offset: 0x0 */ - __I uint32_t EVTIMERH; /**< EVTIMER High, offset: 0x4 */ - __I uint32_t CAPTURE_L; /**< Local Capture Low for CPU, offset: 0x8 */ - __I uint32_t CAPTURE_H; /**< Local Capture High for CPU, offset: 0xC */ - __IO uint32_t MATCH_L; /**< Local Match Low for CPU, offset: 0x10 */ - __IO uint32_t MATCH_H; /**< Local Match High for CPU, offset: 0x14 */ - uint8_t RESERVED_0[4]; - __IO uint32_t OSEVENT_CTRL; /**< OSTIMER Control for CPU, offset: 0x1C */ -} OSTIMER_Type; - -/* ---------------------------------------------------------------------------- - -- OSTIMER Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup OSTIMER_Register_Masks OSTIMER Register Masks - * @{ - */ - -/*! @name EVTIMERL - EVTIMER Low */ -/*! @{ */ - -#define OSTIMER_EVTIMERL_EVTIMER_COUNT_VALUE_MASK (0xFFFFFFFFU) -#define OSTIMER_EVTIMERL_EVTIMER_COUNT_VALUE_SHIFT (0U) -/*! EVTIMER_COUNT_VALUE - EVTimer Count Value */ -#define OSTIMER_EVTIMERL_EVTIMER_COUNT_VALUE(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_EVTIMERL_EVTIMER_COUNT_VALUE_SHIFT)) & OSTIMER_EVTIMERL_EVTIMER_COUNT_VALUE_MASK) -/*! @} */ - -/*! @name EVTIMERH - EVTIMER High */ -/*! @{ */ - -#define OSTIMER_EVTIMERH_EVTIMER_COUNT_VALUE_MASK (0x3FFU) -#define OSTIMER_EVTIMERH_EVTIMER_COUNT_VALUE_SHIFT (0U) -/*! EVTIMER_COUNT_VALUE - EVTimer Count Value */ -#define OSTIMER_EVTIMERH_EVTIMER_COUNT_VALUE(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_EVTIMERH_EVTIMER_COUNT_VALUE_SHIFT)) & OSTIMER_EVTIMERH_EVTIMER_COUNT_VALUE_MASK) -/*! @} */ - -/*! @name CAPTURE_L - Local Capture Low for CPU */ -/*! @{ */ - -#define OSTIMER_CAPTURE_L_CAPTURE_VALUE_MASK (0xFFFFFFFFU) -#define OSTIMER_CAPTURE_L_CAPTURE_VALUE_SHIFT (0U) -/*! CAPTURE_VALUE - EVTimer Capture Value */ -#define OSTIMER_CAPTURE_L_CAPTURE_VALUE(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_CAPTURE_L_CAPTURE_VALUE_SHIFT)) & OSTIMER_CAPTURE_L_CAPTURE_VALUE_MASK) -/*! @} */ - -/*! @name CAPTURE_H - Local Capture High for CPU */ -/*! @{ */ - -#define OSTIMER_CAPTURE_H_CAPTURE_VALUE_MASK (0x3FFU) -#define OSTIMER_CAPTURE_H_CAPTURE_VALUE_SHIFT (0U) -/*! CAPTURE_VALUE - EVTimer Capture Value */ -#define OSTIMER_CAPTURE_H_CAPTURE_VALUE(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_CAPTURE_H_CAPTURE_VALUE_SHIFT)) & OSTIMER_CAPTURE_H_CAPTURE_VALUE_MASK) -/*! @} */ - -/*! @name MATCH_L - Local Match Low for CPU */ -/*! @{ */ - -#define OSTIMER_MATCH_L_MATCH_VALUE_MASK (0xFFFFFFFFU) -#define OSTIMER_MATCH_L_MATCH_VALUE_SHIFT (0U) -/*! MATCH_VALUE - EVTimer Match Value */ -#define OSTIMER_MATCH_L_MATCH_VALUE(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_MATCH_L_MATCH_VALUE_SHIFT)) & OSTIMER_MATCH_L_MATCH_VALUE_MASK) -/*! @} */ - -/*! @name MATCH_H - Local Match High for CPU */ -/*! @{ */ - -#define OSTIMER_MATCH_H_MATCH_VALUE_MASK (0x3FFU) -#define OSTIMER_MATCH_H_MATCH_VALUE_SHIFT (0U) -/*! MATCH_VALUE - EVTimer Match Value */ -#define OSTIMER_MATCH_H_MATCH_VALUE(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_MATCH_H_MATCH_VALUE_SHIFT)) & OSTIMER_MATCH_H_MATCH_VALUE_MASK) -/*! @} */ - -/*! @name OSEVENT_CTRL - OSTIMER Control for CPU */ -/*! @{ */ - -#define OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG_MASK (0x1U) -#define OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG_SHIFT (0U) -/*! OSTIMER_INTRFLAG - Interrupt Flag */ -#define OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG_SHIFT)) & OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG_MASK) - -#define OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_MASK (0x2U) -#define OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_SHIFT (1U) -/*! OSTIMER_INTENA - Interrupt or Wake-Up Request - * 0b0..Interrupts blocked - * 0b1..Interrupts enabled - */ -#define OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_SHIFT)) & OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_MASK) - -#define OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK (0x4U) -#define OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_SHIFT (2U) -/*! MATCH_WR_RDY - EVTimer Match Write Ready */ -#define OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY(x) (((uint32_t)(((uint32_t)(x)) << OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_SHIFT)) & OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group OSTIMER_Register_Masks */ - - -/* OSTIMER - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral OSTIMER0 base address */ - #define OSTIMER0_BASE (0x50049000u) - /** Peripheral OSTIMER0 base address */ - #define OSTIMER0_BASE_NS (0x40049000u) - /** Peripheral OSTIMER0 base pointer */ - #define OSTIMER0 ((OSTIMER_Type *)OSTIMER0_BASE) - /** Peripheral OSTIMER0 base pointer */ - #define OSTIMER0_NS ((OSTIMER_Type *)OSTIMER0_BASE_NS) - /** Array initializer of OSTIMER peripheral base addresses */ - #define OSTIMER_BASE_ADDRS { OSTIMER0_BASE } - /** Array initializer of OSTIMER peripheral base pointers */ - #define OSTIMER_BASE_PTRS { OSTIMER0 } - /** Array initializer of OSTIMER peripheral base addresses */ - #define OSTIMER_BASE_ADDRS_NS { OSTIMER0_BASE_NS } - /** Array initializer of OSTIMER peripheral base pointers */ - #define OSTIMER_BASE_PTRS_NS { OSTIMER0_NS } -#else - /** Peripheral OSTIMER0 base address */ - #define OSTIMER0_BASE (0x40049000u) - /** Peripheral OSTIMER0 base pointer */ - #define OSTIMER0 ((OSTIMER_Type *)OSTIMER0_BASE) - /** Array initializer of OSTIMER peripheral base addresses */ - #define OSTIMER_BASE_ADDRS { OSTIMER0_BASE } - /** Array initializer of OSTIMER peripheral base pointers */ - #define OSTIMER_BASE_PTRS { OSTIMER0 } -#endif -/** Interrupt vectors for the OSTIMER peripheral type */ -#define OSTIMER_IRQS { OS_EVENT_IRQn } - -/*! - * @} - */ /* end of group OSTIMER_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- OTPC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup OTPC_Peripheral_Access_Layer OTPC Peripheral Access Layer - * @{ - */ - -/** OTPC - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameters, offset: 0x4 */ - __IO uint32_t SR; /**< Status, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __IO uint32_t RWC; /**< Read and Write Control, offset: 0x10 */ - __IO uint32_t RLC; /**< Reload Control, offset: 0x14 */ - __IO uint32_t PCR; /**< Power Control, offset: 0x18 */ - uint8_t RESERVED_1[4]; - __IO uint32_t WDATA; /**< Write Data, offset: 0x20 */ - __I uint32_t RDATA; /**< Read Data, offset: 0x24 */ - uint8_t RESERVED_2[8]; - __IO uint32_t TIMING1; /**< Timing1, offset: 0x30 */ - __IO uint32_t TIMING2; /**< Timing2, offset: 0x34 */ - uint8_t RESERVED_3[456]; - __I uint32_t LOCK; /**< Lock, offset: 0x200 */ - __I uint32_t SECURE; /**< Secure, offset: 0x204 */ - __I uint32_t SECURE_INV; /**< Inverted Secure, offset: 0x208 */ - __I uint32_t DBG_KEY; /**< Debug and Key, offset: 0x20C */ - __IO uint32_t MISC_CFG; /**< MISC Config, offset: 0x210 */ - __IO uint32_t PHANTOM_CFG; /**< PHANTOM Config, offset: 0x214 */ - __IO uint32_t FLEX_CFG0; /**< Flexible Config 0, offset: 0x218 */ - __IO uint32_t FLEX_CFG1; /**< Flexible Config 1, offset: 0x21C */ -} OTPC_Type; - -/* ---------------------------------------------------------------------------- - -- OTPC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup OTPC_Register_Masks OTPC Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define OTPC_VERID_FEATURE_MASK (0xFFFFU) -#define OTPC_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Standard feature set - */ -#define OTPC_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << OTPC_VERID_FEATURE_SHIFT)) & OTPC_VERID_FEATURE_MASK) - -#define OTPC_VERID_MINOR_MASK (0xFF0000U) -#define OTPC_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define OTPC_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << OTPC_VERID_MINOR_SHIFT)) & OTPC_VERID_MINOR_MASK) - -#define OTPC_VERID_MAJOR_MASK (0xFF000000U) -#define OTPC_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define OTPC_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << OTPC_VERID_MAJOR_SHIFT)) & OTPC_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameters */ -/*! @{ */ - -#define OTPC_PARAM_NUM_FUSE_MASK (0xFFFFU) -#define OTPC_PARAM_NUM_FUSE_SHIFT (0U) -/*! NUM_FUSE - Number of fuse bytes */ -#define OTPC_PARAM_NUM_FUSE(x) (((uint32_t)(((uint32_t)(x)) << OTPC_PARAM_NUM_FUSE_SHIFT)) & OTPC_PARAM_NUM_FUSE_MASK) -/*! @} */ - -/*! @name SR - Status */ -/*! @{ */ - -#define OTPC_SR_BUSY_MASK (0x1U) -#define OTPC_SR_BUSY_SHIFT (0U) -/*! BUSY - Busy status - * 0b0..Not busy (transaction complete) - * 0b1..Busy - */ -#define OTPC_SR_BUSY(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_BUSY_SHIFT)) & OTPC_SR_BUSY_MASK) - -#define OTPC_SR_ERROR_MASK (0x2U) -#define OTPC_SR_ERROR_SHIFT (1U) -/*! ERROR - Error flag - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_ERROR(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_ERROR_SHIFT)) & OTPC_SR_ERROR_MASK) - -#define OTPC_SR_ECC_SF_MASK (0x4U) -#define OTPC_SR_ECC_SF_SHIFT (2U) -/*! ECC_SF - ECC single fault - * 0b0..No fault - * 0b1..Fault - */ -#define OTPC_SR_ECC_SF(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_ECC_SF_SHIFT)) & OTPC_SR_ECC_SF_MASK) - -#define OTPC_SR_ECC_DF_MASK (0x8U) -#define OTPC_SR_ECC_DF_SHIFT (3U) -/*! ECC_DF - ECC double fault - * 0b0..No fault - * 0b1..Fault - */ -#define OTPC_SR_ECC_DF(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_ECC_DF_SHIFT)) & OTPC_SR_ECC_DF_MASK) - -#define OTPC_SR_TRI_F_MASK (0x10U) -#define OTPC_SR_TRI_F_SHIFT (4U) -/*! TRI_F - Triple voting fault - * 0b0..No fault - * 0b1..Fault - */ -#define OTPC_SR_TRI_F(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_TRI_F_SHIFT)) & OTPC_SR_TRI_F_MASK) - -#define OTPC_SR_RD_FUSE_LOCK_MASK (0x100U) -#define OTPC_SR_RD_FUSE_LOCK_SHIFT (8U) -/*! RD_FUSE_LOCK - Read fuse lock error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_RD_FUSE_LOCK(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_RD_FUSE_LOCK_SHIFT)) & OTPC_SR_RD_FUSE_LOCK_MASK) - -#define OTPC_SR_WR_FUSE_LOCK_MASK (0x200U) -#define OTPC_SR_WR_FUSE_LOCK_SHIFT (9U) -/*! WR_FUSE_LOCK - Write fuse lock error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_WR_FUSE_LOCK(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_WR_FUSE_LOCK_SHIFT)) & OTPC_SR_WR_FUSE_LOCK_MASK) - -#define OTPC_SR_RD_REG_LOCK_MASK (0x400U) -#define OTPC_SR_RD_REG_LOCK_SHIFT (10U) -/*! RD_REG_LOCK - Read register lock error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_RD_REG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_RD_REG_LOCK_SHIFT)) & OTPC_SR_RD_REG_LOCK_MASK) - -#define OTPC_SR_WR_REG_LOCK_MASK (0x800U) -#define OTPC_SR_WR_REG_LOCK_SHIFT (11U) -/*! WR_REG_LOCK - Write register lock error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_WR_REG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_WR_REG_LOCK_SHIFT)) & OTPC_SR_WR_REG_LOCK_MASK) - -#define OTPC_SR_WR_REG_BUSY_MASK (0x1000U) -#define OTPC_SR_WR_REG_BUSY_SHIFT (12U) -/*! WR_REG_BUSY - Write register when busy error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_WR_REG_BUSY(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_WR_REG_BUSY_SHIFT)) & OTPC_SR_WR_REG_BUSY_MASK) - -#define OTPC_SR_WR_POWER_OFF_MASK (0x2000U) -#define OTPC_SR_WR_POWER_OFF_SHIFT (13U) -/*! WR_POWER_OFF - Write when power off error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_WR_POWER_OFF(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_WR_POWER_OFF_SHIFT)) & OTPC_SR_WR_POWER_OFF_MASK) - -#define OTPC_SR_FSM_MASK (0x10000U) -#define OTPC_SR_FSM_SHIFT (16U) -/*! FSM - Finite-state machine error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_FSM(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_FSM_SHIFT)) & OTPC_SR_FSM_MASK) - -#define OTPC_SR_FLC_MASK (0x20000U) -#define OTPC_SR_FLC_SHIFT (17U) -/*! FLC - Fuse load counter error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_FLC(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_FLC_SHIFT)) & OTPC_SR_FLC_MASK) - -#define OTPC_SR_ADC_MASK (0x40000U) -#define OTPC_SR_ADC_SHIFT (18U) -/*! ADC - Address and data compare error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_ADC(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_ADC_SHIFT)) & OTPC_SR_ADC_MASK) - -#define OTPC_SR_IRC_MASK (0x80000U) -#define OTPC_SR_IRC_SHIFT (19U) -/*! IRC - Inverted register compare error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_IRC(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_IRC_SHIFT)) & OTPC_SR_IRC_MASK) - -#define OTPC_SR_FSC_MASK (0x100000U) -#define OTPC_SR_FSC_SHIFT (20U) -/*! FSC - Fuse and shadow register compare error - * 0b0..No error - * 0b1..Error - */ -#define OTPC_SR_FSC(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SR_FSC_SHIFT)) & OTPC_SR_FSC_MASK) -/*! @} */ - -/*! @name RWC - Read and Write Control */ -/*! @{ */ - -#define OTPC_RWC_ADDR_MASK (0x7FU) -#define OTPC_RWC_ADDR_SHIFT (0U) -/*! ADDR - EFUSE address */ -#define OTPC_RWC_ADDR(x) (((uint32_t)(((uint32_t)(x)) << OTPC_RWC_ADDR_SHIFT)) & OTPC_RWC_ADDR_MASK) - -#define OTPC_RWC_WR_ALL1S_MASK (0x1000U) -#define OTPC_RWC_WR_ALL1S_SHIFT (12U) -/*! WR_ALL1S - Write all 1s - * 0b0..Uses the WDATA value - * 0b1..Writes all 1s - */ -#define OTPC_RWC_WR_ALL1S(x) (((uint32_t)(((uint32_t)(x)) << OTPC_RWC_WR_ALL1S_SHIFT)) & OTPC_RWC_WR_ALL1S_MASK) - -#define OTPC_RWC_READ_EFUSE_MASK (0x2000U) -#define OTPC_RWC_READ_EFUSE_SHIFT (13U) -/*! READ_EFUSE - Read EFUSE - * 0b0..Starts program operation when the WR_UNLOCK value is 0x9527; otherwise, takes no action. - * 0b1..Starts read operation - */ -#define OTPC_RWC_READ_EFUSE(x) (((uint32_t)(((uint32_t)(x)) << OTPC_RWC_READ_EFUSE_SHIFT)) & OTPC_RWC_READ_EFUSE_MASK) - -#define OTPC_RWC_READ_UPDATE_MASK (0x4000U) -#define OTPC_RWC_READ_UPDATE_SHIFT (14U) -/*! READ_UPDATE - Read update - * 0b0..Shadow register does not update - * 0b1..Shadow register updates - */ -#define OTPC_RWC_READ_UPDATE(x) (((uint32_t)(((uint32_t)(x)) << OTPC_RWC_READ_UPDATE_SHIFT)) & OTPC_RWC_READ_UPDATE_MASK) - -#define OTPC_RWC_WR_UNLOCK_MASK (0xFFFF0000U) -#define OTPC_RWC_WR_UNLOCK_SHIFT (16U) -/*! WR_UNLOCK - Write Unlock */ -#define OTPC_RWC_WR_UNLOCK(x) (((uint32_t)(((uint32_t)(x)) << OTPC_RWC_WR_UNLOCK_SHIFT)) & OTPC_RWC_WR_UNLOCK_MASK) -/*! @} */ - -/*! @name RLC - Reload Control */ -/*! @{ */ - -#define OTPC_RLC_RELOAD_SHADOWS_MASK (0x1U) -#define OTPC_RLC_RELOAD_SHADOWS_SHIFT (0U) -/*! RELOAD_SHADOWS - Reload shadow registers - * 0b0..No action (when writing) or reload complete (when reading) - * 0b1..Reload - */ -#define OTPC_RLC_RELOAD_SHADOWS(x) (((uint32_t)(((uint32_t)(x)) << OTPC_RLC_RELOAD_SHADOWS_SHIFT)) & OTPC_RLC_RELOAD_SHADOWS_MASK) -/*! @} */ - -/*! @name PCR - Power Control */ -/*! @{ */ - -#define OTPC_PCR_HVREQ_MASK (0x1U) -#define OTPC_PCR_HVREQ_SHIFT (0U) -/*! HVREQ - Strong switch request - * 0b0..Turn off - * 0b1..Turn on - */ -#define OTPC_PCR_HVREQ(x) (((uint32_t)(((uint32_t)(x)) << OTPC_PCR_HVREQ_SHIFT)) & OTPC_PCR_HVREQ_MASK) - -#define OTPC_PCR_LVREQ_MASK (0x2U) -#define OTPC_PCR_LVREQ_SHIFT (1U) -/*! LVREQ - Weak switch request - * 0b0..Turn off - * 0b1..Turn on - */ -#define OTPC_PCR_LVREQ(x) (((uint32_t)(((uint32_t)(x)) << OTPC_PCR_LVREQ_SHIFT)) & OTPC_PCR_LVREQ_MASK) - -#define OTPC_PCR_PDREQ_MASK (0x4U) -#define OTPC_PCR_PDREQ_SHIFT (2U) -/*! PDREQ - Power down request - * 0b0..PD pin is set to low when OTPC is in idle state. It means EFUSE hardmacro is in standby mode. Idle state - * means OTPC is not in read and program modes. - * 0b1..PD pin is set to high when OTPC is in idle state. It means EFUSE hardmacro is in power down mode. - */ -#define OTPC_PCR_PDREQ(x) (((uint32_t)(((uint32_t)(x)) << OTPC_PCR_PDREQ_SHIFT)) & OTPC_PCR_PDREQ_MASK) -/*! @} */ - -/*! @name WDATA - Write Data */ -/*! @{ */ - -#define OTPC_WDATA_DAT_MASK (0xFFFFFFFFU) -#define OTPC_WDATA_DAT_SHIFT (0U) -/*! DAT - Write data */ -#define OTPC_WDATA_DAT(x) (((uint32_t)(((uint32_t)(x)) << OTPC_WDATA_DAT_SHIFT)) & OTPC_WDATA_DAT_MASK) -/*! @} */ - -/*! @name RDATA - Read Data */ -/*! @{ */ - -#define OTPC_RDATA_DAT_MASK (0xFFFFFFFFU) -#define OTPC_RDATA_DAT_SHIFT (0U) -/*! DAT - Read data */ -#define OTPC_RDATA_DAT(x) (((uint32_t)(((uint32_t)(x)) << OTPC_RDATA_DAT_SHIFT)) & OTPC_RDATA_DAT_MASK) -/*! @} */ - -/*! @name TIMING1 - Timing1 */ -/*! @{ */ - -#define OTPC_TIMING1_TADDR_MASK (0xFU) -#define OTPC_TIMING1_TADDR_SHIFT (0U) -/*! TADDR - Address to STROBE setup and hold time */ -#define OTPC_TIMING1_TADDR(x) (((uint32_t)(((uint32_t)(x)) << OTPC_TIMING1_TADDR_SHIFT)) & OTPC_TIMING1_TADDR_MASK) - -#define OTPC_TIMING1_TRELAX_MASK (0xF0U) -#define OTPC_TIMING1_TRELAX_SHIFT (4U) -/*! TRELAX - CSB, PGENB and LOAD to STROBE setup and hold time */ -#define OTPC_TIMING1_TRELAX(x) (((uint32_t)(((uint32_t)(x)) << OTPC_TIMING1_TRELAX_SHIFT)) & OTPC_TIMING1_TRELAX_MASK) - -#define OTPC_TIMING1_TRD_MASK (0x3F00U) -#define OTPC_TIMING1_TRD_SHIFT (8U) -/*! TRD - Read strobe pulse width time */ -#define OTPC_TIMING1_TRD(x) (((uint32_t)(((uint32_t)(x)) << OTPC_TIMING1_TRD_SHIFT)) & OTPC_TIMING1_TRD_MASK) - -#define OTPC_TIMING1_TPS_MASK (0x3F0000U) -#define OTPC_TIMING1_TPS_SHIFT (16U) -/*! TPS - PS to CSB setup and hold time between power switch and chip select assertion */ -#define OTPC_TIMING1_TPS(x) (((uint32_t)(((uint32_t)(x)) << OTPC_TIMING1_TPS_SHIFT)) & OTPC_TIMING1_TPS_MASK) - -#define OTPC_TIMING1_TPD_MASK (0xFF000000U) -#define OTPC_TIMING1_TPD_SHIFT (24U) -/*! TPD - PD to CSB setup time between power down signal deassertion and chip select signal assertion */ -#define OTPC_TIMING1_TPD(x) (((uint32_t)(((uint32_t)(x)) << OTPC_TIMING1_TPD_SHIFT)) & OTPC_TIMING1_TPD_MASK) -/*! @} */ - -/*! @name TIMING2 - Timing2 */ -/*! @{ */ - -#define OTPC_TIMING2_TPGM_MASK (0xFFFU) -#define OTPC_TIMING2_TPGM_SHIFT (0U) -/*! TPGM - Typical program strobe pulse width time */ -#define OTPC_TIMING2_TPGM(x) (((uint32_t)(((uint32_t)(x)) << OTPC_TIMING2_TPGM_SHIFT)) & OTPC_TIMING2_TPGM_MASK) -/*! @} */ - -/*! @name LOCK - Lock */ -/*! @{ */ - -#define OTPC_LOCK_NXP_PART_CFG_LOCK_MASK (0x7U) -#define OTPC_LOCK_NXP_PART_CFG_LOCK_SHIFT (0U) -/*! NXP_PART_CFG_LOCK - NXP Part Config Lock */ -#define OTPC_LOCK_NXP_PART_CFG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << OTPC_LOCK_NXP_PART_CFG_LOCK_SHIFT)) & OTPC_LOCK_NXP_PART_CFG_LOCK_MASK) - -#define OTPC_LOCK_NXP_EXT_LOCK_MASK (0x38U) -#define OTPC_LOCK_NXP_EXT_LOCK_SHIFT (3U) -/*! NXP_EXT_LOCK - NXP EXT Lock */ -#define OTPC_LOCK_NXP_EXT_LOCK(x) (((uint32_t)(((uint32_t)(x)) << OTPC_LOCK_NXP_EXT_LOCK_SHIFT)) & OTPC_LOCK_NXP_EXT_LOCK_MASK) - -#define OTPC_LOCK_BOOT_CFG_LOCK_MASK (0xE00U) -#define OTPC_LOCK_BOOT_CFG_LOCK_SHIFT (9U) -/*! BOOT_CFG_LOCK - Boot config Lock */ -#define OTPC_LOCK_BOOT_CFG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << OTPC_LOCK_BOOT_CFG_LOCK_SHIFT)) & OTPC_LOCK_BOOT_CFG_LOCK_MASK) - -#define OTPC_LOCK_PRINCE_CFG_LOCK_MASK (0x7000U) -#define OTPC_LOCK_PRINCE_CFG_LOCK_SHIFT (12U) -/*! PRINCE_CFG_LOCK - Prince Config Lock */ -#define OTPC_LOCK_PRINCE_CFG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << OTPC_LOCK_PRINCE_CFG_LOCK_SHIFT)) & OTPC_LOCK_PRINCE_CFG_LOCK_MASK) - -#define OTPC_LOCK_OSCAA_KEY_LOCK_MASK (0x38000U) -#define OTPC_LOCK_OSCAA_KEY_LOCK_SHIFT (15U) -/*! OSCAA_KEY_LOCK - OSCAA Key Lock */ -#define OTPC_LOCK_OSCAA_KEY_LOCK(x) (((uint32_t)(((uint32_t)(x)) << OTPC_LOCK_OSCAA_KEY_LOCK_SHIFT)) & OTPC_LOCK_OSCAA_KEY_LOCK_MASK) - -#define OTPC_LOCK_CUST_LOCK0_MASK (0x1C0000U) -#define OTPC_LOCK_CUST_LOCK0_SHIFT (18U) -/*! CUST_LOCK0 - CUST Lock 0 */ -#define OTPC_LOCK_CUST_LOCK0(x) (((uint32_t)(((uint32_t)(x)) << OTPC_LOCK_CUST_LOCK0_SHIFT)) & OTPC_LOCK_CUST_LOCK0_MASK) - -#define OTPC_LOCK_CUST_LOCK1_MASK (0xE00000U) -#define OTPC_LOCK_CUST_LOCK1_SHIFT (21U) -/*! CUST_LOCK1 - CUST Lock 1 */ -#define OTPC_LOCK_CUST_LOCK1(x) (((uint32_t)(((uint32_t)(x)) << OTPC_LOCK_CUST_LOCK1_SHIFT)) & OTPC_LOCK_CUST_LOCK1_MASK) - -#define OTPC_LOCK_CUST_LOCK2_MASK (0x7000000U) -#define OTPC_LOCK_CUST_LOCK2_SHIFT (24U) -/*! CUST_LOCK2 - CUST Lock 2 */ -#define OTPC_LOCK_CUST_LOCK2(x) (((uint32_t)(((uint32_t)(x)) << OTPC_LOCK_CUST_LOCK2_SHIFT)) & OTPC_LOCK_CUST_LOCK2_MASK) - -#define OTPC_LOCK_CUST_LOCK3_MASK (0x38000000U) -#define OTPC_LOCK_CUST_LOCK3_SHIFT (27U) -/*! CUST_LOCK3 - CUST Lock 3 */ -#define OTPC_LOCK_CUST_LOCK3(x) (((uint32_t)(((uint32_t)(x)) << OTPC_LOCK_CUST_LOCK3_SHIFT)) & OTPC_LOCK_CUST_LOCK3_MASK) -/*! @} */ - -/*! @name SECURE - Secure */ -/*! @{ */ - -#define OTPC_SECURE_DAT_MASK (0xFFFFFFFFU) -#define OTPC_SECURE_DAT_SHIFT (0U) -/*! DAT - Data */ -#define OTPC_SECURE_DAT(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SECURE_DAT_SHIFT)) & OTPC_SECURE_DAT_MASK) -/*! @} */ - -/*! @name SECURE_INV - Inverted Secure */ -/*! @{ */ - -#define OTPC_SECURE_INV_DAT_MASK (0xFFFFFFFFU) -#define OTPC_SECURE_INV_DAT_SHIFT (0U) -/*! DAT - Data */ -#define OTPC_SECURE_INV_DAT(x) (((uint32_t)(((uint32_t)(x)) << OTPC_SECURE_INV_DAT_SHIFT)) & OTPC_SECURE_INV_DAT_MASK) -/*! @} */ - -/*! @name DBG_KEY - Debug and Key */ -/*! @{ */ - -#define OTPC_DBG_KEY_DAT_MASK (0xFFFFFFFFU) -#define OTPC_DBG_KEY_DAT_SHIFT (0U) -/*! DAT - Data */ -#define OTPC_DBG_KEY_DAT(x) (((uint32_t)(((uint32_t)(x)) << OTPC_DBG_KEY_DAT_SHIFT)) & OTPC_DBG_KEY_DAT_MASK) -/*! @} */ - -/*! @name MISC_CFG - MISC Config */ -/*! @{ */ - -#define OTPC_MISC_CFG_DAT_MASK (0xFFFFFFFFU) -#define OTPC_MISC_CFG_DAT_SHIFT (0U) -/*! DAT - Data */ -#define OTPC_MISC_CFG_DAT(x) (((uint32_t)(((uint32_t)(x)) << OTPC_MISC_CFG_DAT_SHIFT)) & OTPC_MISC_CFG_DAT_MASK) -/*! @} */ - -/*! @name PHANTOM_CFG - PHANTOM Config */ -/*! @{ */ - -#define OTPC_PHANTOM_CFG_DAT_MASK (0xFFFFFFFFU) -#define OTPC_PHANTOM_CFG_DAT_SHIFT (0U) -/*! DAT - Data */ -#define OTPC_PHANTOM_CFG_DAT(x) (((uint32_t)(((uint32_t)(x)) << OTPC_PHANTOM_CFG_DAT_SHIFT)) & OTPC_PHANTOM_CFG_DAT_MASK) -/*! @} */ - -/*! @name FLEX_CFG0 - Flexible Config 0 */ -/*! @{ */ - -#define OTPC_FLEX_CFG0_DAT_MASK (0xFFFFFFFFU) -#define OTPC_FLEX_CFG0_DAT_SHIFT (0U) -/*! DAT - Data */ -#define OTPC_FLEX_CFG0_DAT(x) (((uint32_t)(((uint32_t)(x)) << OTPC_FLEX_CFG0_DAT_SHIFT)) & OTPC_FLEX_CFG0_DAT_MASK) -/*! @} */ - -/*! @name FLEX_CFG1 - Flexible Config 1 */ -/*! @{ */ - -#define OTPC_FLEX_CFG1_DAT_MASK (0xFFFFFFFFU) -#define OTPC_FLEX_CFG1_DAT_SHIFT (0U) -/*! DAT - Data */ -#define OTPC_FLEX_CFG1_DAT(x) (((uint32_t)(((uint32_t)(x)) << OTPC_FLEX_CFG1_DAT_SHIFT)) & OTPC_FLEX_CFG1_DAT_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group OTPC_Register_Masks */ - - -/* OTPC - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral OTPC0 base address */ - #define OTPC0_BASE (0x500C9000u) - /** Peripheral OTPC0 base address */ - #define OTPC0_BASE_NS (0x400C9000u) - /** Peripheral OTPC0 base pointer */ - #define OTPC0 ((OTPC_Type *)OTPC0_BASE) - /** Peripheral OTPC0 base pointer */ - #define OTPC0_NS ((OTPC_Type *)OTPC0_BASE_NS) - /** Array initializer of OTPC peripheral base addresses */ - #define OTPC_BASE_ADDRS { OTPC0_BASE } - /** Array initializer of OTPC peripheral base pointers */ - #define OTPC_BASE_PTRS { OTPC0 } - /** Array initializer of OTPC peripheral base addresses */ - #define OTPC_BASE_ADDRS_NS { OTPC0_BASE_NS } - /** Array initializer of OTPC peripheral base pointers */ - #define OTPC_BASE_PTRS_NS { OTPC0_NS } -#else - /** Peripheral OTPC0 base address */ - #define OTPC0_BASE (0x400C9000u) - /** Peripheral OTPC0 base pointer */ - #define OTPC0 ((OTPC_Type *)OTPC0_BASE) - /** Array initializer of OTPC peripheral base addresses */ - #define OTPC_BASE_ADDRS { OTPC0_BASE } - /** Array initializer of OTPC peripheral base pointers */ - #define OTPC_BASE_PTRS { OTPC0 } -#endif - -/*! - * @} - */ /* end of group OTPC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- PDM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PDM_Peripheral_Access_Layer PDM Peripheral Access Layer - * @{ - */ - -/** PDM - Register Layout Typedef */ -typedef struct { - __IO uint32_t CTRL_1; /**< MICFIL Control 1, offset: 0x0 */ - __IO uint32_t CTRL_2; /**< MICFIL Control 2, offset: 0x4 */ - __IO uint32_t STAT; /**< MICFIL Status, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __IO uint32_t FIFO_CTRL; /**< MICFIL FIFO Control, offset: 0x10 */ - __IO uint32_t FIFO_STAT; /**< MICFIL FIFO Status, offset: 0x14 */ - uint8_t RESERVED_1[12]; - __I uint32_t DATACH[4]; /**< MICFIL Output Result, array offset: 0x24, array step: 0x4 */ - uint8_t RESERVED_2[48]; - __I uint32_t DC_CTRL; /**< MICFIL DC Remover Control, offset: 0x64 */ - __IO uint32_t DC_OUT_CTRL; /**< MICFIL Output DC Remover Control, offset: 0x68 */ - uint8_t RESERVED_3[8]; - __IO uint32_t RANGE_CTRL; /**< MICFIL Range Control, offset: 0x74 */ - uint8_t RESERVED_4[4]; - __IO uint32_t RANGE_STAT; /**< MICFIL Range Status, offset: 0x7C */ - __IO uint32_t FSYNC_CTRL; /**< Frame Synchronization Control, offset: 0x80 */ - __I uint32_t VERID; /**< Version ID, offset: 0x84 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x88 */ -} PDM_Type; - -/* ---------------------------------------------------------------------------- - -- PDM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PDM_Register_Masks PDM Register Masks - * @{ - */ - -/*! @name CTRL_1 - MICFIL Control 1 */ -/*! @{ */ - -#define PDM_CTRL_1_CH0EN_MASK (0x1U) -#define PDM_CTRL_1_CH0EN_SHIFT (0U) -/*! CH0EN - Channel 0 Enable */ -#define PDM_CTRL_1_CH0EN(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_CH0EN_SHIFT)) & PDM_CTRL_1_CH0EN_MASK) - -#define PDM_CTRL_1_CH1EN_MASK (0x2U) -#define PDM_CTRL_1_CH1EN_SHIFT (1U) -/*! CH1EN - Channel 1 Enable */ -#define PDM_CTRL_1_CH1EN(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_CH1EN_SHIFT)) & PDM_CTRL_1_CH1EN_MASK) - -#define PDM_CTRL_1_CH2EN_MASK (0x4U) -#define PDM_CTRL_1_CH2EN_SHIFT (2U) -/*! CH2EN - Channel 2 Enable */ -#define PDM_CTRL_1_CH2EN(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_CH2EN_SHIFT)) & PDM_CTRL_1_CH2EN_MASK) - -#define PDM_CTRL_1_CH3EN_MASK (0x8U) -#define PDM_CTRL_1_CH3EN_SHIFT (3U) -/*! CH3EN - Channel 3 Enable */ -#define PDM_CTRL_1_CH3EN(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_CH3EN_SHIFT)) & PDM_CTRL_1_CH3EN_MASK) - -#define PDM_CTRL_1_FSYNCEN_MASK (0x10000U) -#define PDM_CTRL_1_FSYNCEN_SHIFT (16U) -/*! FSYNCEN - Frame Synchronization Enable - * 0b0..Disables - * 0b1..Enables - */ -#define PDM_CTRL_1_FSYNCEN(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_FSYNCEN_SHIFT)) & PDM_CTRL_1_FSYNCEN_MASK) - -#define PDM_CTRL_1_DECFILS_MASK (0x100000U) -#define PDM_CTRL_1_DECFILS_SHIFT (20U) -/*! DECFILS - Decimation Filter Enable in Stop - * 0b0..Stops decimation filter - * 0b1..Keeps decimation filter running - */ -#define PDM_CTRL_1_DECFILS(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_DECFILS_SHIFT)) & PDM_CTRL_1_DECFILS_MASK) - -#define PDM_CTRL_1_ERREN_MASK (0x800000U) -#define PDM_CTRL_1_ERREN_SHIFT (23U) -/*! ERREN - Error Interruption Enable - * 0b0..Disables - * 0b1..Enables - */ -#define PDM_CTRL_1_ERREN(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_ERREN_SHIFT)) & PDM_CTRL_1_ERREN_MASK) - -#define PDM_CTRL_1_DISEL_MASK (0x3000000U) -#define PDM_CTRL_1_DISEL_SHIFT (24U) -/*! DISEL - DMA Interrupt Selection - * 0b00..Disables DMA and interrupt requests - * 0b01..Enables DMA requests - * 0b10..Enables interrupt requests - * 0b11..Reserved - */ -#define PDM_CTRL_1_DISEL(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_DISEL_SHIFT)) & PDM_CTRL_1_DISEL_MASK) - -#define PDM_CTRL_1_DBGE_MASK (0x4000000U) -#define PDM_CTRL_1_DBGE_SHIFT (26U) -/*! DBGE - Module Enable in Debug - * 0b0..Disables after completing the current frame - * 0b1..Enables operation - */ -#define PDM_CTRL_1_DBGE(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_DBGE_SHIFT)) & PDM_CTRL_1_DBGE_MASK) - -#define PDM_CTRL_1_SRES_MASK (0x8000000U) -#define PDM_CTRL_1_SRES_SHIFT (27U) -/*! SRES - Software Reset - * 0b0..No action - * 0b1..Software reset - */ -#define PDM_CTRL_1_SRES(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_SRES_SHIFT)) & PDM_CTRL_1_SRES_MASK) - -#define PDM_CTRL_1_DBG_MASK (0x10000000U) -#define PDM_CTRL_1_DBG_SHIFT (28U) -/*! DBG - Debug Mode - * 0b0..Normal - * 0b1..Debug - */ -#define PDM_CTRL_1_DBG(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_DBG_SHIFT)) & PDM_CTRL_1_DBG_MASK) - -#define PDM_CTRL_1_PDMIEN_MASK (0x20000000U) -#define PDM_CTRL_1_PDMIEN_SHIFT (29U) -/*! PDMIEN - MICFIL Enable - * 0b0..Stops MICFIL operation - * 0b1..Starts MICFIL operation - */ -#define PDM_CTRL_1_PDMIEN(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_PDMIEN_SHIFT)) & PDM_CTRL_1_PDMIEN_MASK) - -#define PDM_CTRL_1_DOZEN_MASK (0x40000000U) -#define PDM_CTRL_1_DOZEN_SHIFT (30U) -/*! DOZEN - Stop Enable - * 0b0..Disables - * 0b1..Enables - */ -#define PDM_CTRL_1_DOZEN(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_DOZEN_SHIFT)) & PDM_CTRL_1_DOZEN_MASK) - -#define PDM_CTRL_1_MDIS_MASK (0x80000000U) -#define PDM_CTRL_1_MDIS_SHIFT (31U) -/*! MDIS - Module Disable - * 0b0..Normal mode - * 0b1..DLL mode - */ -#define PDM_CTRL_1_MDIS(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_1_MDIS_SHIFT)) & PDM_CTRL_1_MDIS_MASK) -/*! @} */ - -/*! @name CTRL_2 - MICFIL Control 2 */ -/*! @{ */ - -#define PDM_CTRL_2_CLKDIV_MASK (0xFFU) -#define PDM_CTRL_2_CLKDIV_SHIFT (0U) -/*! CLKDIV - Clock Divider - * 0b00000000..Internal clock divider value = 0 - * 0b00000001..Internal clock divider value = 1 - * 0b00000010-0b11111110..... - * 0b11111111..Internal clock divider value = 255 - */ -#define PDM_CTRL_2_CLKDIV(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_2_CLKDIV_SHIFT)) & PDM_CTRL_2_CLKDIV_MASK) - -#define PDM_CTRL_2_CLKDIVDIS_MASK (0x8000U) -#define PDM_CTRL_2_CLKDIVDIS_SHIFT (15U) -/*! CLKDIVDIS - Clock Divider Disable - * 0b0..Enables - * 0b1..Disables - */ -#define PDM_CTRL_2_CLKDIVDIS(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_2_CLKDIVDIS_SHIFT)) & PDM_CTRL_2_CLKDIVDIS_MASK) - -#define PDM_CTRL_2_CICOSR_MASK (0xF0000U) -#define PDM_CTRL_2_CICOSR_SHIFT (16U) -/*! CICOSR - CIC Decimation Rate - * 0b0000..CIC oversampling rate = 0 - * 0b0001..CIC oversampling rate = 1 - * 0b0010-0b1110..... - * 0b1111..CIC oversampling rate = 15 - */ -#define PDM_CTRL_2_CICOSR(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_2_CICOSR_SHIFT)) & PDM_CTRL_2_CICOSR_MASK) - -#define PDM_CTRL_2_QSEL_MASK (0xE000000U) -#define PDM_CTRL_2_QSEL_SHIFT (25U) -/*! QSEL - Quality Mode - * 0b001..High-Quality mode - * 0b000..Medium-Quality mode - * 0b111..Low-Quality mode - * 0b110..Very-Low-Quality 0 mode - * 0b101..Very-Low-Quality 1 mode - * 0b100..Very-Low-Quality 2 mode - */ -#define PDM_CTRL_2_QSEL(x) (((uint32_t)(((uint32_t)(x)) << PDM_CTRL_2_QSEL_SHIFT)) & PDM_CTRL_2_QSEL_MASK) -/*! @} */ - -/*! @name STAT - MICFIL Status */ -/*! @{ */ - -#define PDM_STAT_CH0F_MASK (0x1U) -#define PDM_STAT_CH0F_SHIFT (0U) -/*! CH0F - Channel 0 Output Data Flag - * 0b0..Not surpassed - * 0b1..Surpassed - */ -#define PDM_STAT_CH0F(x) (((uint32_t)(((uint32_t)(x)) << PDM_STAT_CH0F_SHIFT)) & PDM_STAT_CH0F_MASK) - -#define PDM_STAT_CH1F_MASK (0x2U) -#define PDM_STAT_CH1F_SHIFT (1U) -/*! CH1F - Channel 1 Output Data Flag - * 0b0..Not surpassed - * 0b1..Surpassed - */ -#define PDM_STAT_CH1F(x) (((uint32_t)(((uint32_t)(x)) << PDM_STAT_CH1F_SHIFT)) & PDM_STAT_CH1F_MASK) - -#define PDM_STAT_CH2F_MASK (0x4U) -#define PDM_STAT_CH2F_SHIFT (2U) -/*! CH2F - Channel 2 Output Data Flag - * 0b0..Not surpassed - * 0b1..Surpassed - */ -#define PDM_STAT_CH2F(x) (((uint32_t)(((uint32_t)(x)) << PDM_STAT_CH2F_SHIFT)) & PDM_STAT_CH2F_MASK) - -#define PDM_STAT_CH3F_MASK (0x8U) -#define PDM_STAT_CH3F_SHIFT (3U) -/*! CH3F - Channel 3 Output Data Flag - * 0b0..Not surpassed - * 0b1..Surpassed - */ -#define PDM_STAT_CH3F(x) (((uint32_t)(((uint32_t)(x)) << PDM_STAT_CH3F_SHIFT)) & PDM_STAT_CH3F_MASK) - -#define PDM_STAT_BSY_FIL_MASK (0x80000000U) -#define PDM_STAT_BSY_FIL_SHIFT (31U) -/*! BSY_FIL - Busy Flag - * 0b1..MICFIL is running - * 0b0..MICFIL is stopped - */ -#define PDM_STAT_BSY_FIL(x) (((uint32_t)(((uint32_t)(x)) << PDM_STAT_BSY_FIL_SHIFT)) & PDM_STAT_BSY_FIL_MASK) -/*! @} */ - -/*! @name FIFO_CTRL - MICFIL FIFO Control */ -/*! @{ */ - -#define PDM_FIFO_CTRL_FIFOWMK_MASK (0xFU) -#define PDM_FIFO_CTRL_FIFOWMK_SHIFT (0U) -/*! FIFOWMK - FIFO Watermark Control */ -#define PDM_FIFO_CTRL_FIFOWMK(x) (((uint32_t)(((uint32_t)(x)) << PDM_FIFO_CTRL_FIFOWMK_SHIFT)) & PDM_FIFO_CTRL_FIFOWMK_MASK) -/*! @} */ - -/*! @name FIFO_STAT - MICFIL FIFO Status */ -/*! @{ */ - -#define PDM_FIFO_STAT_FIFOOVF0_MASK (0x1U) -#define PDM_FIFO_STAT_FIFOOVF0_SHIFT (0U) -/*! FIFOOVF0 - FIFO Overflow Exception Flag for Channel 0 - * 0b0..No exception by FIFO overflow - * 0b1..Exception by FIFO overflow - */ -#define PDM_FIFO_STAT_FIFOOVF0(x) (((uint32_t)(((uint32_t)(x)) << PDM_FIFO_STAT_FIFOOVF0_SHIFT)) & PDM_FIFO_STAT_FIFOOVF0_MASK) - -#define PDM_FIFO_STAT_FIFOOVF1_MASK (0x2U) -#define PDM_FIFO_STAT_FIFOOVF1_SHIFT (1U) -/*! FIFOOVF1 - FIFO Overflow Exception Flag for Channel 1 - * 0b0..No exception by FIFO overflow - * 0b1..Exception by FIFO overflow - */ -#define PDM_FIFO_STAT_FIFOOVF1(x) (((uint32_t)(((uint32_t)(x)) << PDM_FIFO_STAT_FIFOOVF1_SHIFT)) & PDM_FIFO_STAT_FIFOOVF1_MASK) - -#define PDM_FIFO_STAT_FIFOOVF2_MASK (0x4U) -#define PDM_FIFO_STAT_FIFOOVF2_SHIFT (2U) -/*! FIFOOVF2 - FIFO Overflow Exception Flag for Channel 2 - * 0b0..No exception by FIFO overflow - * 0b1..Exception by FIFO overflow - */ -#define PDM_FIFO_STAT_FIFOOVF2(x) (((uint32_t)(((uint32_t)(x)) << PDM_FIFO_STAT_FIFOOVF2_SHIFT)) & PDM_FIFO_STAT_FIFOOVF2_MASK) - -#define PDM_FIFO_STAT_FIFOOVF3_MASK (0x8U) -#define PDM_FIFO_STAT_FIFOOVF3_SHIFT (3U) -/*! FIFOOVF3 - FIFO Overflow Exception Flag for Channel 3 - * 0b0..No exception by FIFO overflow - * 0b1..Exception by FIFO overflow - */ -#define PDM_FIFO_STAT_FIFOOVF3(x) (((uint32_t)(((uint32_t)(x)) << PDM_FIFO_STAT_FIFOOVF3_SHIFT)) & PDM_FIFO_STAT_FIFOOVF3_MASK) - -#define PDM_FIFO_STAT_FIFOUND0_MASK (0x100U) -#define PDM_FIFO_STAT_FIFOUND0_SHIFT (8U) -/*! FIFOUND0 - FIFO Underflow Exception Flag for Channel 0 - * 0b0..No exception by FIFO underflow - * 0b1..Exception by FIFO underflow - */ -#define PDM_FIFO_STAT_FIFOUND0(x) (((uint32_t)(((uint32_t)(x)) << PDM_FIFO_STAT_FIFOUND0_SHIFT)) & PDM_FIFO_STAT_FIFOUND0_MASK) - -#define PDM_FIFO_STAT_FIFOUND1_MASK (0x200U) -#define PDM_FIFO_STAT_FIFOUND1_SHIFT (9U) -/*! FIFOUND1 - FIFO Underflow Exception Flag for Channel 1 - * 0b0..No exception by FIFO underflow - * 0b1..Exception by FIFO underflow - */ -#define PDM_FIFO_STAT_FIFOUND1(x) (((uint32_t)(((uint32_t)(x)) << PDM_FIFO_STAT_FIFOUND1_SHIFT)) & PDM_FIFO_STAT_FIFOUND1_MASK) - -#define PDM_FIFO_STAT_FIFOUND2_MASK (0x400U) -#define PDM_FIFO_STAT_FIFOUND2_SHIFT (10U) -/*! FIFOUND2 - FIFO Underflow Exception Flag for Channel 2 - * 0b0..No exception by FIFO underflow - * 0b1..Exception by FIFO underflow - */ -#define PDM_FIFO_STAT_FIFOUND2(x) (((uint32_t)(((uint32_t)(x)) << PDM_FIFO_STAT_FIFOUND2_SHIFT)) & PDM_FIFO_STAT_FIFOUND2_MASK) - -#define PDM_FIFO_STAT_FIFOUND3_MASK (0x800U) -#define PDM_FIFO_STAT_FIFOUND3_SHIFT (11U) -/*! FIFOUND3 - FIFO Underflow Exception Flag for Channel 3 - * 0b0..No exception by FIFO underflow - * 0b1..Exception by FIFO underflow - */ -#define PDM_FIFO_STAT_FIFOUND3(x) (((uint32_t)(((uint32_t)(x)) << PDM_FIFO_STAT_FIFOUND3_SHIFT)) & PDM_FIFO_STAT_FIFOUND3_MASK) -/*! @} */ - -/*! @name DATACHN_DATACH - MICFIL Output Result */ -/*! @{ */ - -#define PDM_DATACHN_DATACH_DATA_MASK (0xFFFFFFFFU) -#define PDM_DATACHN_DATACH_DATA_SHIFT (0U) -/*! DATA - Channel n Data */ -#define PDM_DATACHN_DATACH_DATA(x) (((uint32_t)(((uint32_t)(x)) << PDM_DATACHN_DATACH_DATA_SHIFT)) & PDM_DATACHN_DATACH_DATA_MASK) -/*! @} */ - -/* The count of PDM_DATACHN_DATACH */ -#define PDM_DATACHN_DATACH_COUNT (4U) - -/*! @name DC_CTRL - MICFIL DC Remover Control */ -/*! @{ */ - -#define PDM_DC_CTRL_DCCONFIG0_MASK (0x3U) -#define PDM_DC_CTRL_DCCONFIG0_SHIFT (0U) -/*! DCCONFIG0 - Channel 0 DC Remover Configuration - * 0b11..DC remover is bypassed - * 0b00..20 Hz (PDM_CLK = 3.072 MHz) - * 0b01..13.3 Hz (PDM_CLK = 3.072 MHz) - * 0b10..40 Hz (PDM_CLK = 3.072 MHz) - */ -#define PDM_DC_CTRL_DCCONFIG0(x) (((uint32_t)(((uint32_t)(x)) << PDM_DC_CTRL_DCCONFIG0_SHIFT)) & PDM_DC_CTRL_DCCONFIG0_MASK) - -#define PDM_DC_CTRL_DCCONFIG1_MASK (0xCU) -#define PDM_DC_CTRL_DCCONFIG1_SHIFT (2U) -/*! DCCONFIG1 - Channel 1 DC Remover Configuration - * 0b11..DC remover is bypassed - * 0b00..20 Hz (PDM_CLK = 3.072 MHz) - * 0b01..13.3 Hz (PDM_CLK = 3.072 MHz) - * 0b10..40 Hz (PDM_CLK = 3.072 MHz) - */ -#define PDM_DC_CTRL_DCCONFIG1(x) (((uint32_t)(((uint32_t)(x)) << PDM_DC_CTRL_DCCONFIG1_SHIFT)) & PDM_DC_CTRL_DCCONFIG1_MASK) - -#define PDM_DC_CTRL_DCCONFIG2_MASK (0x30U) -#define PDM_DC_CTRL_DCCONFIG2_SHIFT (4U) -/*! DCCONFIG2 - Channel 2 DC Remover Configuration - * 0b11..DC remover is bypassed - * 0b00..20 Hz (PDM_CLK = 3.072 MHz) - * 0b01..13.3 Hz (PDM_CLK = 3.072 MHz) - * 0b10..40 Hz (PDM_CLK = 3.072 MHz) - */ -#define PDM_DC_CTRL_DCCONFIG2(x) (((uint32_t)(((uint32_t)(x)) << PDM_DC_CTRL_DCCONFIG2_SHIFT)) & PDM_DC_CTRL_DCCONFIG2_MASK) - -#define PDM_DC_CTRL_DCCONFIG3_MASK (0xC0U) -#define PDM_DC_CTRL_DCCONFIG3_SHIFT (6U) -/*! DCCONFIG3 - Channel 3 DC Remover Configuration - * 0b11..DC remover is bypassed - * 0b00..20 Hz (PDM_CLK = 3.072 MHz) - * 0b01..13.3 Hz (PDM_CLK = 3.072 MHz) - * 0b10..40 Hz (PDM_CLK = 3.072 MHz) - */ -#define PDM_DC_CTRL_DCCONFIG3(x) (((uint32_t)(((uint32_t)(x)) << PDM_DC_CTRL_DCCONFIG3_SHIFT)) & PDM_DC_CTRL_DCCONFIG3_MASK) -/*! @} */ - -/*! @name DC_OUT_CTRL - MICFIL Output DC Remover Control */ -/*! @{ */ - -#define PDM_DC_OUT_CTRL_DCCONFIG0_MASK (0x3U) -#define PDM_DC_OUT_CTRL_DCCONFIG0_SHIFT (0U) -/*! DCCONFIG0 - Channel 0 DC Remover Configuration - * 0b11..DC remover is bypassed - * 0b00..20 Hz (FS = 48 kHz) - * 0b01..13.3 Hz (FS = 48 kHz) - * 0b10..40 Hz (FS = 48 kHz) - */ -#define PDM_DC_OUT_CTRL_DCCONFIG0(x) (((uint32_t)(((uint32_t)(x)) << PDM_DC_OUT_CTRL_DCCONFIG0_SHIFT)) & PDM_DC_OUT_CTRL_DCCONFIG0_MASK) - -#define PDM_DC_OUT_CTRL_DCCONFIG1_MASK (0xCU) -#define PDM_DC_OUT_CTRL_DCCONFIG1_SHIFT (2U) -/*! DCCONFIG1 - Channel 1 DC Remover Configuration - * 0b11..DC remover is bypassed - * 0b00..20 Hz (FS = 48 kHz) - * 0b01..13.3 Hz (FS = 48 kHz) - * 0b10..40 Hz (FS = 48 kHz) - */ -#define PDM_DC_OUT_CTRL_DCCONFIG1(x) (((uint32_t)(((uint32_t)(x)) << PDM_DC_OUT_CTRL_DCCONFIG1_SHIFT)) & PDM_DC_OUT_CTRL_DCCONFIG1_MASK) - -#define PDM_DC_OUT_CTRL_DCCONFIG2_MASK (0x30U) -#define PDM_DC_OUT_CTRL_DCCONFIG2_SHIFT (4U) -/*! DCCONFIG2 - Channel 2 DC Remover Configuration - * 0b11..DC remover is bypassed - * 0b00..20 Hz (FS = 48 kHz) - * 0b01..13.3 Hz (FS = 48 kHz) - * 0b10..40 Hz (FS = 48 kHz) - */ -#define PDM_DC_OUT_CTRL_DCCONFIG2(x) (((uint32_t)(((uint32_t)(x)) << PDM_DC_OUT_CTRL_DCCONFIG2_SHIFT)) & PDM_DC_OUT_CTRL_DCCONFIG2_MASK) - -#define PDM_DC_OUT_CTRL_DCCONFIG3_MASK (0xC0U) -#define PDM_DC_OUT_CTRL_DCCONFIG3_SHIFT (6U) -/*! DCCONFIG3 - Channel 3 DC Remover Configuration - * 0b11..DC remover is bypassed - * 0b00..20 Hz (FS = 48 kHz) - * 0b01..13.3 Hz (FS = 48 kHz) - * 0b10..40 Hz (FS = 48 kHz) - */ -#define PDM_DC_OUT_CTRL_DCCONFIG3(x) (((uint32_t)(((uint32_t)(x)) << PDM_DC_OUT_CTRL_DCCONFIG3_SHIFT)) & PDM_DC_OUT_CTRL_DCCONFIG3_MASK) -/*! @} */ - -/*! @name RANGE_CTRL - MICFIL Range Control */ -/*! @{ */ - -#define PDM_RANGE_CTRL_RANGEADJ0_MASK (0xFU) -#define PDM_RANGE_CTRL_RANGEADJ0_SHIFT (0U) -/*! RANGEADJ0 - Channel 0 Range Adjustment */ -#define PDM_RANGE_CTRL_RANGEADJ0(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_CTRL_RANGEADJ0_SHIFT)) & PDM_RANGE_CTRL_RANGEADJ0_MASK) - -#define PDM_RANGE_CTRL_RANGEADJ1_MASK (0xF0U) -#define PDM_RANGE_CTRL_RANGEADJ1_SHIFT (4U) -/*! RANGEADJ1 - Channel 1 Range Adjustment */ -#define PDM_RANGE_CTRL_RANGEADJ1(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_CTRL_RANGEADJ1_SHIFT)) & PDM_RANGE_CTRL_RANGEADJ1_MASK) - -#define PDM_RANGE_CTRL_RANGEADJ2_MASK (0xF00U) -#define PDM_RANGE_CTRL_RANGEADJ2_SHIFT (8U) -/*! RANGEADJ2 - Channel 2 Range Adjustment */ -#define PDM_RANGE_CTRL_RANGEADJ2(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_CTRL_RANGEADJ2_SHIFT)) & PDM_RANGE_CTRL_RANGEADJ2_MASK) - -#define PDM_RANGE_CTRL_RANGEADJ3_MASK (0xF000U) -#define PDM_RANGE_CTRL_RANGEADJ3_SHIFT (12U) -/*! RANGEADJ3 - Channel 3 Range Adjustment */ -#define PDM_RANGE_CTRL_RANGEADJ3(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_CTRL_RANGEADJ3_SHIFT)) & PDM_RANGE_CTRL_RANGEADJ3_MASK) -/*! @} */ - -/*! @name RANGE_STAT - MICFIL Range Status */ -/*! @{ */ - -#define PDM_RANGE_STAT_RANGEOVF0_MASK (0x1U) -#define PDM_RANGE_STAT_RANGEOVF0_SHIFT (0U) -/*! RANGEOVF0 - Channel 0 Range Overflow Error Flag - * 0b0..No exception by range overflow - * 0b1..Exception by range overflow - */ -#define PDM_RANGE_STAT_RANGEOVF0(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_STAT_RANGEOVF0_SHIFT)) & PDM_RANGE_STAT_RANGEOVF0_MASK) - -#define PDM_RANGE_STAT_RANGEOVF1_MASK (0x2U) -#define PDM_RANGE_STAT_RANGEOVF1_SHIFT (1U) -/*! RANGEOVF1 - Channel 1 Range Overflow Error Flag - * 0b0..No exception by range overflow - * 0b1..Exception by range overflow - */ -#define PDM_RANGE_STAT_RANGEOVF1(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_STAT_RANGEOVF1_SHIFT)) & PDM_RANGE_STAT_RANGEOVF1_MASK) - -#define PDM_RANGE_STAT_RANGEOVF2_MASK (0x4U) -#define PDM_RANGE_STAT_RANGEOVF2_SHIFT (2U) -/*! RANGEOVF2 - Channel 2 Range Overflow Error Flag - * 0b0..No exception by range overflow - * 0b1..Exception by range overflow - */ -#define PDM_RANGE_STAT_RANGEOVF2(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_STAT_RANGEOVF2_SHIFT)) & PDM_RANGE_STAT_RANGEOVF2_MASK) - -#define PDM_RANGE_STAT_RANGEOVF3_MASK (0x8U) -#define PDM_RANGE_STAT_RANGEOVF3_SHIFT (3U) -/*! RANGEOVF3 - Channel 3 Range Overflow Error Flag - * 0b0..No exception by range overflow - * 0b1..Exception by range overflow - */ -#define PDM_RANGE_STAT_RANGEOVF3(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_STAT_RANGEOVF3_SHIFT)) & PDM_RANGE_STAT_RANGEOVF3_MASK) - -#define PDM_RANGE_STAT_RANGEUNF0_MASK (0x10000U) -#define PDM_RANGE_STAT_RANGEUNF0_SHIFT (16U) -/*! RANGEUNF0 - Channel 0 Range Underflow Error Flag - * 0b0..No exception by range underflow - * 0b1..Exception by range underflow - */ -#define PDM_RANGE_STAT_RANGEUNF0(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_STAT_RANGEUNF0_SHIFT)) & PDM_RANGE_STAT_RANGEUNF0_MASK) - -#define PDM_RANGE_STAT_RANGEUNF1_MASK (0x20000U) -#define PDM_RANGE_STAT_RANGEUNF1_SHIFT (17U) -/*! RANGEUNF1 - Channel 1 Range Underflow Error Flag - * 0b0..No exception by range underflow - * 0b1..Exception by range underflow - */ -#define PDM_RANGE_STAT_RANGEUNF1(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_STAT_RANGEUNF1_SHIFT)) & PDM_RANGE_STAT_RANGEUNF1_MASK) - -#define PDM_RANGE_STAT_RANGEUNF2_MASK (0x40000U) -#define PDM_RANGE_STAT_RANGEUNF2_SHIFT (18U) -/*! RANGEUNF2 - Channel 2 Range Underflow Error Flag - * 0b0..No exception by range underflow - * 0b1..Exception by range underflow - */ -#define PDM_RANGE_STAT_RANGEUNF2(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_STAT_RANGEUNF2_SHIFT)) & PDM_RANGE_STAT_RANGEUNF2_MASK) - -#define PDM_RANGE_STAT_RANGEUNF3_MASK (0x80000U) -#define PDM_RANGE_STAT_RANGEUNF3_SHIFT (19U) -/*! RANGEUNF3 - Channel 3 Range Underflow Error Flag - * 0b0..No exception by range underflow - * 0b1..Exception by range underflow - */ -#define PDM_RANGE_STAT_RANGEUNF3(x) (((uint32_t)(((uint32_t)(x)) << PDM_RANGE_STAT_RANGEUNF3_SHIFT)) & PDM_RANGE_STAT_RANGEUNF3_MASK) -/*! @} */ - -/*! @name FSYNC_CTRL - Frame Synchronization Control */ -/*! @{ */ - -#define PDM_FSYNC_CTRL_FSYNCLEN_MASK (0xFFFFFFFFU) -#define PDM_FSYNC_CTRL_FSYNCLEN_SHIFT (0U) -/*! FSYNCLEN - Frame Synchronization Window Length */ -#define PDM_FSYNC_CTRL_FSYNCLEN(x) (((uint32_t)(((uint32_t)(x)) << PDM_FSYNC_CTRL_FSYNCLEN_SHIFT)) & PDM_FSYNC_CTRL_FSYNCLEN_MASK) -/*! @} */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define PDM_VERID_FEATURE_MASK (0xFFFFU) -#define PDM_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number */ -#define PDM_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << PDM_VERID_FEATURE_SHIFT)) & PDM_VERID_FEATURE_MASK) - -#define PDM_VERID_MINOR_MASK (0xFF0000U) -#define PDM_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define PDM_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << PDM_VERID_MINOR_SHIFT)) & PDM_VERID_MINOR_MASK) - -#define PDM_VERID_MAJOR_MASK (0xFF000000U) -#define PDM_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define PDM_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << PDM_VERID_MAJOR_SHIFT)) & PDM_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define PDM_PARAM_NPAIR_MASK (0xFU) -#define PDM_PARAM_NPAIR_SHIFT (0U) -/*! NPAIR - Number of Microphone Pairs - * 0b0000..None - * 0b0001..1 pair - * 0b0010..2 pairs - * 0b0011-0b1110..... - * 0b1111..15 pairs - */ -#define PDM_PARAM_NPAIR(x) (((uint32_t)(((uint32_t)(x)) << PDM_PARAM_NPAIR_SHIFT)) & PDM_PARAM_NPAIR_MASK) - -#define PDM_PARAM_FIFO_PTRWID_MASK (0xF0U) -#define PDM_PARAM_FIFO_PTRWID_SHIFT (4U) -/*! FIFO_PTRWID - FIFO Pointer Width - * 0b0000..0 bits - * 0b0001..1 bit - * 0b0010..2 bits - * 0b0011-0b1110..... - * 0b1111..15 bits - */ -#define PDM_PARAM_FIFO_PTRWID(x) (((uint32_t)(((uint32_t)(x)) << PDM_PARAM_FIFO_PTRWID_SHIFT)) & PDM_PARAM_FIFO_PTRWID_MASK) - -#define PDM_PARAM_FIL_OUT_WIDTH_24B_MASK (0x100U) -#define PDM_PARAM_FIL_OUT_WIDTH_24B_SHIFT (8U) -/*! FIL_OUT_WIDTH_24B - Filter Output Width - * 0b0..16 bits - * 0b1..24 bits - */ -#define PDM_PARAM_FIL_OUT_WIDTH_24B(x) (((uint32_t)(((uint32_t)(x)) << PDM_PARAM_FIL_OUT_WIDTH_24B_SHIFT)) & PDM_PARAM_FIL_OUT_WIDTH_24B_MASK) - -#define PDM_PARAM_LOW_POWER_MASK (0x200U) -#define PDM_PARAM_LOW_POWER_SHIFT (9U) -/*! LOW_POWER - Low-Power Decimation Filter - * 0b0..Disables - * 0b1..Enables - */ -#define PDM_PARAM_LOW_POWER(x) (((uint32_t)(((uint32_t)(x)) << PDM_PARAM_LOW_POWER_SHIFT)) & PDM_PARAM_LOW_POWER_MASK) - -#define PDM_PARAM_DC_BYPASS_MASK (0x400U) -#define PDM_PARAM_DC_BYPASS_SHIFT (10U) -/*! DC_BYPASS - Input DC Remover Bypass - * 0b0..Active - * 0b1..Disabled - */ -#define PDM_PARAM_DC_BYPASS(x) (((uint32_t)(((uint32_t)(x)) << PDM_PARAM_DC_BYPASS_SHIFT)) & PDM_PARAM_DC_BYPASS_MASK) - -#define PDM_PARAM_DC_OUT_BYPASS_MASK (0x800U) -#define PDM_PARAM_DC_OUT_BYPASS_SHIFT (11U) -/*! DC_OUT_BYPASS - Output DC Remover Bypass - * 0b0..Active - * 0b1..Disabled - */ -#define PDM_PARAM_DC_OUT_BYPASS(x) (((uint32_t)(((uint32_t)(x)) << PDM_PARAM_DC_OUT_BYPASS_SHIFT)) & PDM_PARAM_DC_OUT_BYPASS_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group PDM_Register_Masks */ - - -/* PDM - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral PDM base address */ - #define PDM_BASE (0x5010C000u) - /** Peripheral PDM base address */ - #define PDM_BASE_NS (0x4010C000u) - /** Peripheral PDM base pointer */ - #define PDM ((PDM_Type *)PDM_BASE) - /** Peripheral PDM base pointer */ - #define PDM_NS ((PDM_Type *)PDM_BASE_NS) - /** Array initializer of PDM peripheral base addresses */ - #define PDM_BASE_ADDRS { PDM_BASE } - /** Array initializer of PDM peripheral base pointers */ - #define PDM_BASE_PTRS { PDM } - /** Array initializer of PDM peripheral base addresses */ - #define PDM_BASE_ADDRS_NS { PDM_BASE_NS } - /** Array initializer of PDM peripheral base pointers */ - #define PDM_BASE_PTRS_NS { PDM_NS } -#else - /** Peripheral PDM base address */ - #define PDM_BASE (0x4010C000u) - /** Peripheral PDM base pointer */ - #define PDM ((PDM_Type *)PDM_BASE) - /** Array initializer of PDM peripheral base addresses */ - #define PDM_BASE_ADDRS { PDM_BASE } - /** Array initializer of PDM peripheral base pointers */ - #define PDM_BASE_PTRS { PDM } -#endif -/** Interrupt vectors for the PDM peripheral type */ -#define PDM_IRQS { PDM_EVENT_IRQn } - -/*! - * @} - */ /* end of group PDM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- PINT Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PINT_Peripheral_Access_Layer PINT Peripheral Access Layer - * @{ - */ - -/** PINT - Register Layout Typedef */ -typedef struct { - __IO uint32_t ISEL; /**< Pin Interrupt Mode, offset: 0x0 */ - __IO uint32_t IENR; /**< Pin Interrupt Level or Rising-Edge Interrupt Enable, offset: 0x4 */ - __O uint32_t SIENR; /**< Pin Interrupt Level or Rising-Edge Interrupt Set, offset: 0x8 */ - __IO uint32_t CIENR; /**< Pin Interrupt Level (Rising-Edge Interrupt) Clear, offset: 0xC */ - __IO uint32_t IENF; /**< Pin Interrupt Active Level or Falling-Edge Interrupt Enable, offset: 0x10 */ - __O uint32_t SIENF; /**< Pin Interrupt Active Level or Falling-Edge Interrupt Set, offset: 0x14 */ - __O uint32_t CIENF; /**< Pin Interrupt Active Level or Falling-Edge Interrupt Clear, offset: 0x18 */ - __IO uint32_t RISE; /**< Pin Interrupt Rising Edge, offset: 0x1C */ - __IO uint32_t FALL; /**< Pin Interrupt Falling Edge, offset: 0x20 */ - __IO uint32_t IST; /**< Pin Interrupt Status, offset: 0x24 */ - __IO uint32_t PMCTRL; /**< Pattern-Match Interrupt Control, offset: 0x28 */ - __IO uint32_t PMSRC; /**< Pattern-Match Interrupt Bit-Slice Source, offset: 0x2C */ - __IO uint32_t PMCFG; /**< Pattern-Match Interrupt Bit Slice Configuration, offset: 0x30 */ -} PINT_Type; - -/* ---------------------------------------------------------------------------- - -- PINT Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PINT_Register_Masks PINT Register Masks - * @{ - */ - -/*! @name ISEL - Pin Interrupt Mode */ -/*! @{ */ - -#define PINT_ISEL_PMODE_MASK (0xFFU) -#define PINT_ISEL_PMODE_SHIFT (0U) -/*! PMODE - Interrupt mode - * 0b00000000..In bit n configures the interrupt to be edge-sensitive - * 0b00000001..In bit n configures the interrupt to be level-sensitive - */ -#define PINT_ISEL_PMODE(x) (((uint32_t)(((uint32_t)(x)) << PINT_ISEL_PMODE_SHIFT)) & PINT_ISEL_PMODE_MASK) -/*! @} */ - -/*! @name IENR - Pin Interrupt Level or Rising-Edge Interrupt Enable */ -/*! @{ */ - -#define PINT_IENR_ENRL_MASK (0xFFU) -#define PINT_IENR_ENRL_SHIFT (0U) -/*! ENRL - Enables Interrupt - * 0b00000000..In bit n disables the corresponding interrupt - * 0b00000001..In bit n enables the corresponding interrupt - */ -#define PINT_IENR_ENRL(x) (((uint32_t)(((uint32_t)(x)) << PINT_IENR_ENRL_SHIFT)) & PINT_IENR_ENRL_MASK) -/*! @} */ - -/*! @name SIENR - Pin Interrupt Level or Rising-Edge Interrupt Set */ -/*! @{ */ - -#define PINT_SIENR_SETENRL_MASK (0xFFU) -#define PINT_SIENR_SETENRL_SHIFT (0U) -/*! SETENRL - Configures IENR - * 0b00000000..No operation for interrupt n - * 0b00000001..Enable rising edge or level interrupt for interrupt n - */ -#define PINT_SIENR_SETENRL(x) (((uint32_t)(((uint32_t)(x)) << PINT_SIENR_SETENRL_SHIFT)) & PINT_SIENR_SETENRL_MASK) -/*! @} */ - -/*! @name CIENR - Pin Interrupt Level (Rising-Edge Interrupt) Clear */ -/*! @{ */ - -#define PINT_CIENR_CENRL_MASK (0xFFU) -#define PINT_CIENR_CENRL_SHIFT (0U) -/*! CENRL - Clear bits in IENR - * 0b00000000..No operation - * 0b00000001..Disable rising edge or level interrupt - */ -#define PINT_CIENR_CENRL(x) (((uint32_t)(((uint32_t)(x)) << PINT_CIENR_CENRL_SHIFT)) & PINT_CIENR_CENRL_MASK) -/*! @} */ - -/*! @name IENF - Pin Interrupt Active Level or Falling-Edge Interrupt Enable */ -/*! @{ */ - -#define PINT_IENF_ENAF_MASK (0xFFU) -#define PINT_IENF_ENAF_SHIFT (0U) -/*! ENAF - Enables Interrupt - * 0b00000000..Disable (set active interrupt level LOW) - * 0b00000001..Enable (set active interrupt level HIGH) - */ -#define PINT_IENF_ENAF(x) (((uint32_t)(((uint32_t)(x)) << PINT_IENF_ENAF_SHIFT)) & PINT_IENF_ENAF_MASK) -/*! @} */ - -/*! @name SIENF - Pin Interrupt Active Level or Falling-Edge Interrupt Set */ -/*! @{ */ - -#define PINT_SIENF_SETENAF_MASK (0xFFU) -#define PINT_SIENF_SETENAF_SHIFT (0U) -/*! SETENAF - * 0b00000000..Writes 0 to IENF. - * 0b00000001..Select HIGH-active interrupt or enable falling-edge interrupt - */ -#define PINT_SIENF_SETENAF(x) (((uint32_t)(((uint32_t)(x)) << PINT_SIENF_SETENAF_SHIFT)) & PINT_SIENF_SETENAF_MASK) -/*! @} */ - -/*! @name CIENF - Pin Interrupt Active Level or Falling-Edge Interrupt Clear */ -/*! @{ */ - -#define PINT_CIENF_CENAF_MASK (0xFFU) -#define PINT_CIENF_CENAF_SHIFT (0U) -/*! CENAF - Writes 0 to IENF - * 0b00000000..No operation - * 0b00000001..LOW-active interrupt selected or falling-edge interrupt disabled - */ -#define PINT_CIENF_CENAF(x) (((uint32_t)(((uint32_t)(x)) << PINT_CIENF_CENAF_SHIFT)) & PINT_CIENF_CENAF_MASK) -/*! @} */ - -/*! @name RISE - Pin Interrupt Rising Edge */ -/*! @{ */ - -#define PINT_RISE_RDET_MASK (0xFFU) -#define PINT_RISE_RDET_SHIFT (0U) -/*! RDET - Rising-Edge Detect - * 0b00000000..Read 0- No rising edge (since Reset or you wrote a 1 to this field last time), Write 0- No operation - * 0b00000001..Read 1- Rising edge (since Reset or you wrote a 1 to this field last time), Write 1- Clear rising-edge detection for this pin - */ -#define PINT_RISE_RDET(x) (((uint32_t)(((uint32_t)(x)) << PINT_RISE_RDET_SHIFT)) & PINT_RISE_RDET_MASK) -/*! @} */ - -/*! @name FALL - Pin Interrupt Falling Edge */ -/*! @{ */ - -#define PINT_FALL_FDET_MASK (0xFFU) -#define PINT_FALL_FDET_SHIFT (0U) -/*! FDET - Falling-Edge Detect - * 0b00000000..Read 0- No falling edge (since Reset or you wrote a 1 to this field last time), Write 0- No operation - * 0b00000001..Read 1- Falling edge (since Reset or you wrote a 1 to this field last time), Write 1- Clear falling-edge detection for this bit - */ -#define PINT_FALL_FDET(x) (((uint32_t)(((uint32_t)(x)) << PINT_FALL_FDET_SHIFT)) & PINT_FALL_FDET_MASK) -/*! @} */ - -/*! @name IST - Pin Interrupt Status */ -/*! @{ */ - -#define PINT_IST_PSTAT_MASK (0xFFU) -#define PINT_IST_PSTAT_SHIFT (0U) -/*! PSTAT - Pin Interrupt Status - * 0b00000000..Read 0- Interrupt is not requested, Write 0- No operation - * 0b00000001..Read 1- Interrupt is requested, Write 1 (edge-sensitive)- clear rising- and falling-edge detection - * for this pin, Write 1 (level-sensitive)- switch the active level for this pin in - */ -#define PINT_IST_PSTAT(x) (((uint32_t)(((uint32_t)(x)) << PINT_IST_PSTAT_SHIFT)) & PINT_IST_PSTAT_MASK) -/*! @} */ - -/*! @name PMCTRL - Pattern-Match Interrupt Control */ -/*! @{ */ - -#define PINT_PMCTRL_SEL_PMATCH_MASK (0x1U) -#define PINT_PMCTRL_SEL_PMATCH_SHIFT (0U) -/*! SEL_PMATCH - Specifies whether the pin interrupts are controlled by the pin interrupt function - * or by the pattern-match function. If this value is 0b, interrupts are driven in response to the - * standard pin interrupt function. If this value is 1b, interrupts are driven in response to - * pattern matches. - * 0b0..Pin interrupt - * 0b1..Pattern match - */ -#define PINT_PMCTRL_SEL_PMATCH(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCTRL_SEL_PMATCH_SHIFT)) & PINT_PMCTRL_SEL_PMATCH_MASK) - -#define PINT_PMCTRL_ENA_RXEV_MASK (0x2U) -#define PINT_PMCTRL_ENA_RXEV_SHIFT (1U) -/*! ENA_RXEV - Enables the RXEV output to the CPU and/or to a GPIO output, when the specified - * Boolean expression evaluates to true. If this value is 0b, RXEV output to the CPU is disabled. If - * this value is 1b, RXEV output to the CPU is enabled. - * 0b0..Disabled - * 0b1..Enabled - */ -#define PINT_PMCTRL_ENA_RXEV(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCTRL_ENA_RXEV_SHIFT)) & PINT_PMCTRL_ENA_RXEV_MASK) - -#define PINT_PMCTRL_PMAT_MASK (0xFF000000U) -#define PINT_PMCTRL_PMAT_SHIFT (24U) -/*! PMAT - Pattern Matches - * 0b00000001..The corresponding product term is matched by the current state of the appropriate inputs - */ -#define PINT_PMCTRL_PMAT(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCTRL_PMAT_SHIFT)) & PINT_PMCTRL_PMAT_MASK) -/*! @} */ - -/*! @name PMSRC - Pattern-Match Interrupt Bit-Slice Source */ -/*! @{ */ - -#define PINT_PMSRC_SRC0_MASK (0x700U) -#define PINT_PMSRC_SRC0_SHIFT (8U) -/*! SRC0 - Selects the input source for bit slice 0 - * 0b000..Input 0 (selects the pin identified in PINSEL0) - * 0b001..Input 1 (selects the pin identified in PINSEL1) - * 0b010..Input 2 (selects the pin identified in PINSEL2) - * 0b011..Input 3 (selects the pin identified in PINSEL3) - * 0b100..Input 4 (selects the pin identified in PINSEL4) - * 0b101..Input 5 (selects the pin identified in PINSEL5) - * 0b110..Input 6 (selects the pin identified in PINSEL6) - * 0b111..Input 7 (selects the pin identified in PINSEL7) - */ -#define PINT_PMSRC_SRC0(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMSRC_SRC0_SHIFT)) & PINT_PMSRC_SRC0_MASK) - -#define PINT_PMSRC_SRC1_MASK (0x3800U) -#define PINT_PMSRC_SRC1_SHIFT (11U) -/*! SRC1 - Selects the input source for bit slice 1 - * 0b000..Input 0 (selects the pin identified in PINSEL0) - * 0b001..Input 1 (selects the pin identified in PINSEL1) - * 0b010..Input 2 (selects the pin identified in PINSEL2) - * 0b011..Input 3 (selects the pin identified in PINSEL3) - * 0b100..Input 4 (selects the pin identified in PINSEL4) - * 0b101..Input 5 (selects the pin identified in PINSEL5) - * 0b110..Input 6 (selects the pin identified in PINSEL6) - * 0b111..Input 7 (selects the pin identified in PINSEL7) - */ -#define PINT_PMSRC_SRC1(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMSRC_SRC1_SHIFT)) & PINT_PMSRC_SRC1_MASK) - -#define PINT_PMSRC_SRC2_MASK (0x1C000U) -#define PINT_PMSRC_SRC2_SHIFT (14U) -/*! SRC2 - Selects the input source for bit slice 2 - * 0b000..Input 0 (selects the pin identified in PINSEL0) - * 0b001..Input 1 (selects the pin identified in PINSEL1) - * 0b010..Input 2 (selects the pin identified in PINSEL2) - * 0b011..Input 3 (selects the pin identified in PINSEL3) - * 0b100..Input 4 (selects the pin identified in PINSEL4) - * 0b101..Input 5 (selects the pin identified in PINSEL5) - * 0b110..Input 6 (selects the pin identified in PINSEL6) - * 0b111..Input 7 (selects the pin identified in PINSEL7) - */ -#define PINT_PMSRC_SRC2(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMSRC_SRC2_SHIFT)) & PINT_PMSRC_SRC2_MASK) - -#define PINT_PMSRC_SRC3_MASK (0xE0000U) -#define PINT_PMSRC_SRC3_SHIFT (17U) -/*! SRC3 - Selects the input source for bit slice 3 - * 0b000..Input 0 (selects the pin identified in PINSEL0) - * 0b001..Input 1 (selects the pin identified in PINSEL1) - * 0b010..Input 2 (selects the pin identified in PINSEL2) - * 0b011..Input 3 (selects the pin identified in PINSEL3) - * 0b100..Input 4 (selects the pin identified in PINSEL4) - * 0b101..Input 5 (selects the pin identified in PINSEL5) - * 0b110..Input 6 (selects the pin identified in PINSEL6) - * 0b111..Input 7 (selects the pin identified in PINSEL7) - */ -#define PINT_PMSRC_SRC3(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMSRC_SRC3_SHIFT)) & PINT_PMSRC_SRC3_MASK) - -#define PINT_PMSRC_SRC4_MASK (0x700000U) -#define PINT_PMSRC_SRC4_SHIFT (20U) -/*! SRC4 - Selects the input source for bit slice 4 - * 0b000..Input 0 (selects the pin identified in PINSEL0) - * 0b001..Input 1 (selects the pin identified in PINSEL1) - * 0b010..Input 2 (selects the pin identified in PINSEL2) - * 0b011..Input 3 (selects the pin identified in PINSEL3) - * 0b100..Input 4 (selects the pin identified in PINSEL4) - * 0b101..Input 5 (selects the pin identified in PINSEL5) - * 0b110..Input 6 (selects the pin identified in PINSEL6) - * 0b111..Input 7 (selects the pin identified in PINSEL7) - */ -#define PINT_PMSRC_SRC4(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMSRC_SRC4_SHIFT)) & PINT_PMSRC_SRC4_MASK) - -#define PINT_PMSRC_SRC5_MASK (0x3800000U) -#define PINT_PMSRC_SRC5_SHIFT (23U) -/*! SRC5 - Selects the input source for bit slice 5 - * 0b000..Input 0 (selects the pin identified in PINSEL0) - * 0b001..Input 1 (selects the pin identified in PINSEL1) - * 0b010..Input 2 (selects the pin identified in PINSEL2) - * 0b011..Input 3 (selects the pin identified in PINSEL3) - * 0b100..Input 4 (selects the pin identified in PINSEL4) - * 0b101..Input 5 (selects the pin identified in PINSEL5) - * 0b110..Input 6 (selects the pin identified in PINSEL6) - * 0b111..Input 7 (selects the pin identified in PINSEL7) - */ -#define PINT_PMSRC_SRC5(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMSRC_SRC5_SHIFT)) & PINT_PMSRC_SRC5_MASK) - -#define PINT_PMSRC_SRC6_MASK (0x1C000000U) -#define PINT_PMSRC_SRC6_SHIFT (26U) -/*! SRC6 - Selects the input source for bit slice 6 - * 0b000..Input 0 (selects the pin identified in PINSEL0) - * 0b001..Input 1 (selects the pin identified in PINSEL1) - * 0b010..Input 2 (selects the pin identified in PINSEL2) - * 0b011..Input 3 (selects the pin identified in PINSEL3) - * 0b100..Input 4 (selects the pin identified in PINSEL4) - * 0b101..Input 5 (selects the pin identified in PINSEL5) - * 0b110..Input 6 (selects the pin identified in PINSEL6) - * 0b111..Input 7 (selects the pin identified in PINSEL7) - */ -#define PINT_PMSRC_SRC6(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMSRC_SRC6_SHIFT)) & PINT_PMSRC_SRC6_MASK) - -#define PINT_PMSRC_SRC7_MASK (0xE0000000U) -#define PINT_PMSRC_SRC7_SHIFT (29U) -/*! SRC7 - Selects the input source for bit slice 7 - * 0b000..Input 0 (selects the pin identified in PINSEL0) - * 0b001..Input 1 (selects the pin identified in PINSEL1) - * 0b010..Input 2 (selects the pin identified in PINSEL2) - * 0b011..Input 3 (selects the pin identified in PINSEL3) - * 0b100..Input 4 (selects the pin identified in PINSEL4) - * 0b101..Input 5 (selects the pin identified in PINSEL5) - * 0b110..Input 6 (selects the pin identified in PINSEL6) - * 0b111..Input 7 (selects the pin identified in PINSEL7) - */ -#define PINT_PMSRC_SRC7(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMSRC_SRC7_SHIFT)) & PINT_PMSRC_SRC7_MASK) -/*! @} */ - -/*! @name PMCFG - Pattern-Match Interrupt Bit Slice Configuration */ -/*! @{ */ - -#define PINT_PMCFG_PROD_ENDPTS0_MASK (0x1U) -#define PINT_PMCFG_PROD_ENDPTS0_SHIFT (0U) -/*! PROD_ENDPTS0 - Determines whether slice 0 is an endpoint. Slice 0 is not an endpoint. Slice 0 is - * the endpoint of a product term (minterm). Pin interrupt 0 in the NVIC is raised if the - * minterm evaluates as true. - * 0b0..No effect - * 0b1..Endpoint - */ -#define PINT_PMCFG_PROD_ENDPTS0(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_PROD_ENDPTS0_SHIFT)) & PINT_PMCFG_PROD_ENDPTS0_MASK) - -#define PINT_PMCFG_PROD_ENDPTS1_MASK (0x2U) -#define PINT_PMCFG_PROD_ENDPTS1_SHIFT (1U) -/*! PROD_ENDPTS1 - Determines whether slice 1 is an endpoint. Slice 1 is not an endpoint. Slice 1 is - * the endpoint of a product term (minterm). Pin interrupt 1 in the NVIC is raised if the - * minterm evaluates as true. - * 0b0..No effect - * 0b1..Endpoint - */ -#define PINT_PMCFG_PROD_ENDPTS1(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_PROD_ENDPTS1_SHIFT)) & PINT_PMCFG_PROD_ENDPTS1_MASK) - -#define PINT_PMCFG_PROD_ENDPTS2_MASK (0x4U) -#define PINT_PMCFG_PROD_ENDPTS2_SHIFT (2U) -/*! PROD_ENDPTS2 - Determines whether slice 2 is an endpoint. Slice 2 is not an endpoint. Slice 2 is - * the endpoint of a product term (minterm). Pin interrupt 2 in the NVIC is raised if the - * minterm evaluates as true. - * 0b0..No effect - * 0b1..Endpoint - */ -#define PINT_PMCFG_PROD_ENDPTS2(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_PROD_ENDPTS2_SHIFT)) & PINT_PMCFG_PROD_ENDPTS2_MASK) - -#define PINT_PMCFG_PROD_ENDPTS3_MASK (0x8U) -#define PINT_PMCFG_PROD_ENDPTS3_SHIFT (3U) -/*! PROD_ENDPTS3 - Determines whether slice 3 is an endpoint. Slice 3 is not an endpoint. Slice 3 is - * the endpoint of a product term (minterm). Pin interrupt 3 in the NVIC is raised if the - * minterm evaluates as true. - * 0b0..No effect - * 0b1..Endpoint - */ -#define PINT_PMCFG_PROD_ENDPTS3(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_PROD_ENDPTS3_SHIFT)) & PINT_PMCFG_PROD_ENDPTS3_MASK) - -#define PINT_PMCFG_PROD_ENDPTS4_MASK (0x10U) -#define PINT_PMCFG_PROD_ENDPTS4_SHIFT (4U) -/*! PROD_ENDPTS4 - Determines whether slice 4 is an endpoint. Slice 4 is not an endpoint. Slice 4 is - * the endpoint of a product term (minterm). Pin interrupt 4 in the NVIC is raised if the - * minterm evaluates as true. - * 0b0..No effect - * 0b1..Endpoint - */ -#define PINT_PMCFG_PROD_ENDPTS4(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_PROD_ENDPTS4_SHIFT)) & PINT_PMCFG_PROD_ENDPTS4_MASK) - -#define PINT_PMCFG_PROD_ENDPTS5_MASK (0x20U) -#define PINT_PMCFG_PROD_ENDPTS5_SHIFT (5U) -/*! PROD_ENDPTS5 - Determines whether slice 5 is an endpoint. Slice 5 is not an endpoint. Slice 5 is - * the endpoint of a product term (minterm). Pin interrupt 5 in the NVIC is raised if the - * minterm evaluates as true. - * 0b0..No effect - * 0b1..Endpoint - */ -#define PINT_PMCFG_PROD_ENDPTS5(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_PROD_ENDPTS5_SHIFT)) & PINT_PMCFG_PROD_ENDPTS5_MASK) - -#define PINT_PMCFG_PROD_ENDPTS6_MASK (0x40U) -#define PINT_PMCFG_PROD_ENDPTS6_SHIFT (6U) -/*! PROD_ENDPTS6 - Determines whether slice 6 is an endpoint. Slice 6 is not an endpoint. Slice 6 is - * the endpoint of a product term (minterm). Pin interrupt 6 in the NVIC is raised if the - * minterm evaluates as true. - * 0b0..No effect - * 0b1..Endpoint - */ -#define PINT_PMCFG_PROD_ENDPTS6(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_PROD_ENDPTS6_SHIFT)) & PINT_PMCFG_PROD_ENDPTS6_MASK) - -#define PINT_PMCFG_CFG0_MASK (0x700U) -#define PINT_PMCFG_CFG0_SHIFT (8U) -/*! CFG0 - Match Configuration - * 0b000..Constant HIGH - * 0b001..Sticky rising edge - * 0b010..Sticky falling edge - * 0b011..Sticky rising or falling edge - * 0b100..High level - * 0b101..Low level - * 0b110..Constant 0 - * 0b111..Event (Nonsticky rising or falling edge) - */ -#define PINT_PMCFG_CFG0(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_CFG0_SHIFT)) & PINT_PMCFG_CFG0_MASK) - -#define PINT_PMCFG_CFG1_MASK (0x3800U) -#define PINT_PMCFG_CFG1_SHIFT (11U) -/*! CFG1 - Match Configuration - * 0b000..Constant HIGH - * 0b001..Sticky rising edge - * 0b010..Sticky falling edge - * 0b011..Sticky rising or falling edge - * 0b100..High level - * 0b101..Low level - * 0b110..Constant 0 - * 0b111..Event (Nonsticky rising or falling edge) - */ -#define PINT_PMCFG_CFG1(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_CFG1_SHIFT)) & PINT_PMCFG_CFG1_MASK) - -#define PINT_PMCFG_CFG2_MASK (0x1C000U) -#define PINT_PMCFG_CFG2_SHIFT (14U) -/*! CFG2 - Match Configuration - * 0b000..Constant HIGH - * 0b001..Sticky rising edge - * 0b010..Sticky falling edge - * 0b011..Sticky rising or falling edge - * 0b100..High level - * 0b101..Low level - * 0b110..Constant 0 - * 0b111..Event (Nonsticky rising or falling edge) - */ -#define PINT_PMCFG_CFG2(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_CFG2_SHIFT)) & PINT_PMCFG_CFG2_MASK) - -#define PINT_PMCFG_CFG3_MASK (0xE0000U) -#define PINT_PMCFG_CFG3_SHIFT (17U) -/*! CFG3 - Match Configuration - * 0b000..Constant HIGH - * 0b001..Sticky rising edge - * 0b010..Sticky falling edge - * 0b011..Sticky rising or falling edge - * 0b100..High level - * 0b101..Low level - * 0b110..Constant 0 - * 0b111..Event (Nonsticky rising or falling edge) - */ -#define PINT_PMCFG_CFG3(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_CFG3_SHIFT)) & PINT_PMCFG_CFG3_MASK) - -#define PINT_PMCFG_CFG4_MASK (0x700000U) -#define PINT_PMCFG_CFG4_SHIFT (20U) -/*! CFG4 - Match Configuration - * 0b000..Constant HIGH - * 0b001..Sticky rising edge - * 0b010..Sticky falling edge - * 0b011..Sticky rising or falling edge - * 0b100..High level - * 0b101..Low level - * 0b110..Constant 0 - * 0b111..Event (Nonsticky rising or falling edge) - */ -#define PINT_PMCFG_CFG4(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_CFG4_SHIFT)) & PINT_PMCFG_CFG4_MASK) - -#define PINT_PMCFG_CFG5_MASK (0x3800000U) -#define PINT_PMCFG_CFG5_SHIFT (23U) -/*! CFG5 - Match Configuration - * 0b000..Constant HIGH - * 0b001..Sticky rising edge - * 0b010..Sticky falling edge - * 0b011..Sticky rising or falling edge - * 0b100..High level - * 0b101..Low level - * 0b110..Constant 0 - * 0b111..Event (Nonsticky rising or falling edge) - */ -#define PINT_PMCFG_CFG5(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_CFG5_SHIFT)) & PINT_PMCFG_CFG5_MASK) - -#define PINT_PMCFG_CFG6_MASK (0x1C000000U) -#define PINT_PMCFG_CFG6_SHIFT (26U) -/*! CFG6 - Match Configuration - * 0b000..Constant HIGH - * 0b001..Sticky rising edge - * 0b010..Sticky falling edge - * 0b011..Sticky rising or falling edge - * 0b100..High level - * 0b101..Low level - * 0b110..Constant 0 - * 0b111..Event (Nonsticky rising or falling edge) - */ -#define PINT_PMCFG_CFG6(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_CFG6_SHIFT)) & PINT_PMCFG_CFG6_MASK) - -#define PINT_PMCFG_CFG7_MASK (0xE0000000U) -#define PINT_PMCFG_CFG7_SHIFT (29U) -/*! CFG7 - Match Configuration - * 0b000..Constant HIGH - * 0b001..Sticky rising edge - * 0b010..Sticky falling edge - * 0b011..Sticky rising or falling edge - * 0b100..High level - * 0b101..Low level - * 0b110..Constant 0 - * 0b111..Event (Nonsticky rising or falling edge) - */ -#define PINT_PMCFG_CFG7(x) (((uint32_t)(((uint32_t)(x)) << PINT_PMCFG_CFG7_SHIFT)) & PINT_PMCFG_CFG7_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group PINT_Register_Masks */ - - -/* PINT - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral PINT0 base address */ - #define PINT0_BASE (0x50004000u) - /** Peripheral PINT0 base address */ - #define PINT0_BASE_NS (0x40004000u) - /** Peripheral PINT0 base pointer */ - #define PINT0 ((PINT_Type *)PINT0_BASE) - /** Peripheral PINT0 base pointer */ - #define PINT0_NS ((PINT_Type *)PINT0_BASE_NS) - /** Array initializer of PINT peripheral base addresses */ - #define PINT_BASE_ADDRS { PINT0_BASE } - /** Array initializer of PINT peripheral base pointers */ - #define PINT_BASE_PTRS { PINT0 } - /** Array initializer of PINT peripheral base addresses */ - #define PINT_BASE_ADDRS_NS { PINT0_BASE_NS } - /** Array initializer of PINT peripheral base pointers */ - #define PINT_BASE_PTRS_NS { PINT0_NS } -#else - /** Peripheral PINT0 base address */ - #define PINT0_BASE (0x40004000u) - /** Peripheral PINT0 base pointer */ - #define PINT0 ((PINT_Type *)PINT0_BASE) - /** Array initializer of PINT peripheral base addresses */ - #define PINT_BASE_ADDRS { PINT0_BASE } - /** Array initializer of PINT peripheral base pointers */ - #define PINT_BASE_PTRS { PINT0 } -#endif -/** Interrupt vectors for the PINT peripheral type */ -#define PINT_IRQS { PINT0_IRQn } -/* Backward compatibility */ -#define PINT PINT0 - - -/*! - * @} - */ /* end of group PINT_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- PKC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PKC_Peripheral_Access_Layer PKC Peripheral Access Layer - * @{ - */ - -/** PKC - Register Layout Typedef */ -typedef struct { - __I uint32_t PKC_STATUS; /**< Status Register, offset: 0x0 */ - __IO uint32_t PKC_CTRL; /**< Control Register, offset: 0x4 */ - __IO uint32_t PKC_CFG; /**< Configuration register, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __IO uint32_t PKC_MODE1; /**< Mode register, parameter set 1, offset: 0x10 */ - __IO uint32_t PKC_XYPTR1; /**< X+Y pointer register, parameter set 1, offset: 0x14 */ - __IO uint32_t PKC_ZRPTR1; /**< Z+R pointer register, parameter set 1, offset: 0x18 */ - __IO uint32_t PKC_LEN1; /**< Length register, parameter set 1, offset: 0x1C */ - __IO uint32_t PKC_MODE2; /**< Mode register, parameter set 2, offset: 0x20 */ - __IO uint32_t PKC_XYPTR2; /**< X+Y pointer register, parameter set 2, offset: 0x24 */ - __IO uint32_t PKC_ZRPTR2; /**< Z+R pointer register, parameter set 2, offset: 0x28 */ - __IO uint32_t PKC_LEN2; /**< Length register, parameter set 2, offset: 0x2C */ - uint8_t RESERVED_1[16]; - __IO uint32_t PKC_UPTR; /**< Universal pointer FUP program, offset: 0x40 */ - __IO uint32_t PKC_UPTRT; /**< Universal pointer FUP table, offset: 0x44 */ - __IO uint32_t PKC_ULEN; /**< Universal pointer length, offset: 0x48 */ - uint8_t RESERVED_2[4]; - __IO uint32_t PKC_MCDATA; /**< MC pattern data interface, offset: 0x50 */ - uint8_t RESERVED_3[12]; - __I uint32_t PKC_VERSION; /**< PKC version register, offset: 0x60 */ - uint8_t RESERVED_4[3916]; - __O uint32_t PKC_SOFT_RST; /**< Software reset, offset: 0xFB0 */ - uint8_t RESERVED_5[12]; - __I uint32_t PKC_ACCESS_ERR; /**< Access Error, offset: 0xFC0 */ - __O uint32_t PKC_ACCESS_ERR_CLR; /**< Clear Access Error, offset: 0xFC4 */ - uint8_t RESERVED_6[16]; - __O uint32_t PKC_INT_CLR_ENABLE; /**< Interrupt enable clear, offset: 0xFD8 */ - __O uint32_t PKC_INT_SET_ENABLE; /**< Interrupt enable set, offset: 0xFDC */ - __I uint32_t PKC_INT_STATUS; /**< Interrupt status, offset: 0xFE0 */ - __I uint32_t PKC_INT_ENABLE; /**< Interrupt enable, offset: 0xFE4 */ - __O uint32_t PKC_INT_CLR_STATUS; /**< Interrupt status clear, offset: 0xFE8 */ - __O uint32_t PKC_INT_SET_STATUS; /**< Interrupt status set, offset: 0xFEC */ - uint8_t RESERVED_7[12]; - __I uint32_t PKC_MODULE_ID; /**< Module ID, offset: 0xFFC */ -} PKC_Type; - -/* ---------------------------------------------------------------------------- - -- PKC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PKC_Register_Masks PKC Register Masks - * @{ - */ - -/*! @name PKC_STATUS - Status Register */ -/*! @{ */ - -#define PKC_PKC_STATUS_ACTIV_MASK (0x1U) -#define PKC_PKC_STATUS_ACTIV_SHIFT (0U) -/*! ACTIV - PKC ACTIV */ -#define PKC_PKC_STATUS_ACTIV(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_STATUS_ACTIV_SHIFT)) & PKC_PKC_STATUS_ACTIV_MASK) - -#define PKC_PKC_STATUS_CARRY_MASK (0x2U) -#define PKC_PKC_STATUS_CARRY_SHIFT (1U) -/*! CARRY - Carry overflow flag */ -#define PKC_PKC_STATUS_CARRY(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_STATUS_CARRY_SHIFT)) & PKC_PKC_STATUS_CARRY_MASK) - -#define PKC_PKC_STATUS_ZERO_MASK (0x4U) -#define PKC_PKC_STATUS_ZERO_SHIFT (2U) -/*! ZERO - Zero result flag */ -#define PKC_PKC_STATUS_ZERO(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_STATUS_ZERO_SHIFT)) & PKC_PKC_STATUS_ZERO_MASK) - -#define PKC_PKC_STATUS_GOANY_MASK (0x8U) -#define PKC_PKC_STATUS_GOANY_SHIFT (3U) -/*! GOANY - Combined GO status flag */ -#define PKC_PKC_STATUS_GOANY(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_STATUS_GOANY_SHIFT)) & PKC_PKC_STATUS_GOANY_MASK) - -#define PKC_PKC_STATUS_LOCKED_MASK (0x60U) -#define PKC_PKC_STATUS_LOCKED_SHIFT (5U) -/*! LOCKED - Parameter set locked */ -#define PKC_PKC_STATUS_LOCKED(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_STATUS_LOCKED_SHIFT)) & PKC_PKC_STATUS_LOCKED_MASK) -/*! @} */ - -/*! @name PKC_CTRL - Control Register */ -/*! @{ */ - -#define PKC_PKC_CTRL_RESET_MASK (0x1U) -#define PKC_PKC_CTRL_RESET_SHIFT (0U) -/*! RESET - PKC reset control bit */ -#define PKC_PKC_CTRL_RESET(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_RESET_SHIFT)) & PKC_PKC_CTRL_RESET_MASK) - -#define PKC_PKC_CTRL_STOP_MASK (0x2U) -#define PKC_PKC_CTRL_STOP_SHIFT (1U) -/*! STOP - Freeze PKC calculation */ -#define PKC_PKC_CTRL_STOP(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_STOP_SHIFT)) & PKC_PKC_CTRL_STOP_MASK) - -#define PKC_PKC_CTRL_GOD1_MASK (0x4U) -#define PKC_PKC_CTRL_GOD1_SHIFT (2U) -/*! GOD1 - Control bit to start direct operation using parameter set 1 */ -#define PKC_PKC_CTRL_GOD1(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_GOD1_SHIFT)) & PKC_PKC_CTRL_GOD1_MASK) - -#define PKC_PKC_CTRL_GOD2_MASK (0x8U) -#define PKC_PKC_CTRL_GOD2_SHIFT (3U) -/*! GOD2 - Control bit to start direct operation using parameter set 2 */ -#define PKC_PKC_CTRL_GOD2(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_GOD2_SHIFT)) & PKC_PKC_CTRL_GOD2_MASK) - -#define PKC_PKC_CTRL_GOM1_MASK (0x10U) -#define PKC_PKC_CTRL_GOM1_SHIFT (4U) -/*! GOM1 - Control bit to start MC pattern using parameter set 1 */ -#define PKC_PKC_CTRL_GOM1(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_GOM1_SHIFT)) & PKC_PKC_CTRL_GOM1_MASK) - -#define PKC_PKC_CTRL_GOM2_MASK (0x20U) -#define PKC_PKC_CTRL_GOM2_SHIFT (5U) -/*! GOM2 - Control bit to start MC pattern using parameter set 2 */ -#define PKC_PKC_CTRL_GOM2(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_GOM2_SHIFT)) & PKC_PKC_CTRL_GOM2_MASK) - -#define PKC_PKC_CTRL_GOU_MASK (0x40U) -#define PKC_PKC_CTRL_GOU_SHIFT (6U) -/*! GOU - Control bit to start pipe operation */ -#define PKC_PKC_CTRL_GOU(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_GOU_SHIFT)) & PKC_PKC_CTRL_GOU_MASK) - -#define PKC_PKC_CTRL_GF2CONV_MASK (0x80U) -#define PKC_PKC_CTRL_GF2CONV_SHIFT (7U) -/*! GF2CONV - Convert to GF2 calculation modes */ -#define PKC_PKC_CTRL_GF2CONV(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_GF2CONV_SHIFT)) & PKC_PKC_CTRL_GF2CONV_MASK) - -#define PKC_PKC_CTRL_CLRCACHE_MASK (0x100U) -#define PKC_PKC_CTRL_CLRCACHE_SHIFT (8U) -/*! CLRCACHE - Clear universal pointer cache */ -#define PKC_PKC_CTRL_CLRCACHE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_CLRCACHE_SHIFT)) & PKC_PKC_CTRL_CLRCACHE_MASK) - -#define PKC_PKC_CTRL_CACHE_EN_MASK (0x200U) -#define PKC_PKC_CTRL_CACHE_EN_SHIFT (9U) -/*! CACHE_EN - Enable universal pointer cache */ -#define PKC_PKC_CTRL_CACHE_EN(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_CACHE_EN_SHIFT)) & PKC_PKC_CTRL_CACHE_EN_MASK) - -#define PKC_PKC_CTRL_REDMUL_MASK (0xC00U) -#define PKC_PKC_CTRL_REDMUL_SHIFT (10U) -/*! REDMUL - Reduced multiplier mode - * 0b00..full size mode, 3 least significant bits of pointer and length are ignored, minimum supported length 0x0008 - * 0b01..Reserved - Error Generated if selected - * 0b10..64-bit mode, 3 least significant bits of pointer and length are ignored, minimum supported length 0x0008 - * 0b11..Reserved - Error Generated if selected - */ -#define PKC_PKC_CTRL_REDMUL(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CTRL_REDMUL_SHIFT)) & PKC_PKC_CTRL_REDMUL_MASK) -/*! @} */ - -/*! @name PKC_CFG - Configuration register */ -/*! @{ */ - -#define PKC_PKC_CFG_IDLEOP_MASK (0x1U) -#define PKC_PKC_CFG_IDLEOP_SHIFT (0U) -#define PKC_PKC_CFG_IDLEOP(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CFG_IDLEOP_SHIFT)) & PKC_PKC_CFG_IDLEOP_MASK) - -#define PKC_PKC_CFG_RFU1_MASK (0x2U) -#define PKC_PKC_CFG_RFU1_SHIFT (1U) -#define PKC_PKC_CFG_RFU1(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CFG_RFU1_SHIFT)) & PKC_PKC_CFG_RFU1_MASK) - -#define PKC_PKC_CFG_RFU2_MASK (0x4U) -#define PKC_PKC_CFG_RFU2_SHIFT (2U) -#define PKC_PKC_CFG_RFU2(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CFG_RFU2_SHIFT)) & PKC_PKC_CFG_RFU2_MASK) - -#define PKC_PKC_CFG_CLKRND_MASK (0x8U) -#define PKC_PKC_CFG_CLKRND_SHIFT (3U) -#define PKC_PKC_CFG_CLKRND(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CFG_CLKRND_SHIFT)) & PKC_PKC_CFG_CLKRND_MASK) - -#define PKC_PKC_CFG_REDMULNOISE_MASK (0x10U) -#define PKC_PKC_CFG_REDMULNOISE_SHIFT (4U) -#define PKC_PKC_CFG_REDMULNOISE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CFG_REDMULNOISE_SHIFT)) & PKC_PKC_CFG_REDMULNOISE_MASK) - -#define PKC_PKC_CFG_RNDDLY_MASK (0xE0U) -#define PKC_PKC_CFG_RNDDLY_SHIFT (5U) -#define PKC_PKC_CFG_RNDDLY(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CFG_RNDDLY_SHIFT)) & PKC_PKC_CFG_RNDDLY_MASK) - -#define PKC_PKC_CFG_SBXNOISE_MASK (0x100U) -#define PKC_PKC_CFG_SBXNOISE_SHIFT (8U) -#define PKC_PKC_CFG_SBXNOISE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CFG_SBXNOISE_SHIFT)) & PKC_PKC_CFG_SBXNOISE_MASK) - -#define PKC_PKC_CFG_ALPNOISE_MASK (0x200U) -#define PKC_PKC_CFG_ALPNOISE_SHIFT (9U) -#define PKC_PKC_CFG_ALPNOISE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CFG_ALPNOISE_SHIFT)) & PKC_PKC_CFG_ALPNOISE_MASK) - -#define PKC_PKC_CFG_FMULNOISE_MASK (0x400U) -#define PKC_PKC_CFG_FMULNOISE_SHIFT (10U) -#define PKC_PKC_CFG_FMULNOISE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_CFG_FMULNOISE_SHIFT)) & PKC_PKC_CFG_FMULNOISE_MASK) -/*! @} */ - -/*! @name PKC_MODE1 - Mode register, parameter set 1 */ -/*! @{ */ - -#define PKC_PKC_MODE1_MODE_MASK (0xFFU) -#define PKC_PKC_MODE1_MODE_SHIFT (0U) -/*! MODE - Calculation Mode / MC Start address */ -#define PKC_PKC_MODE1_MODE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_MODE1_MODE_SHIFT)) & PKC_PKC_MODE1_MODE_MASK) -/*! @} */ - -/*! @name PKC_XYPTR1 - X+Y pointer register, parameter set 1 */ -/*! @{ */ - -#define PKC_PKC_XYPTR1_XPTR_MASK (0xFFFFU) -#define PKC_PKC_XYPTR1_XPTR_SHIFT (0U) -/*! XPTR - Start address of X operand in PKCRAM with byte granularity */ -#define PKC_PKC_XYPTR1_XPTR(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_XYPTR1_XPTR_SHIFT)) & PKC_PKC_XYPTR1_XPTR_MASK) - -#define PKC_PKC_XYPTR1_YPTR_MASK (0xFFFF0000U) -#define PKC_PKC_XYPTR1_YPTR_SHIFT (16U) -/*! YPTR - Start address of Y operand in PKCRAM with byte granularity */ -#define PKC_PKC_XYPTR1_YPTR(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_XYPTR1_YPTR_SHIFT)) & PKC_PKC_XYPTR1_YPTR_MASK) -/*! @} */ - -/*! @name PKC_ZRPTR1 - Z+R pointer register, parameter set 1 */ -/*! @{ */ - -#define PKC_PKC_ZRPTR1_ZPTR_MASK (0xFFFFU) -#define PKC_PKC_ZRPTR1_ZPTR_SHIFT (0U) -/*! ZPTR - Start address of Z operand in PKCRAM with byte granularity or constant for calculation modes using CONST */ -#define PKC_PKC_ZRPTR1_ZPTR(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ZRPTR1_ZPTR_SHIFT)) & PKC_PKC_ZRPTR1_ZPTR_MASK) - -#define PKC_PKC_ZRPTR1_RPTR_MASK (0xFFFF0000U) -#define PKC_PKC_ZRPTR1_RPTR_SHIFT (16U) -/*! RPTR - Start address of R result in PKCRAM with byte granularity */ -#define PKC_PKC_ZRPTR1_RPTR(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ZRPTR1_RPTR_SHIFT)) & PKC_PKC_ZRPTR1_RPTR_MASK) -/*! @} */ - -/*! @name PKC_LEN1 - Length register, parameter set 1 */ -/*! @{ */ - -#define PKC_PKC_LEN1_LEN_MASK (0xFFFFU) -#define PKC_PKC_LEN1_LEN_SHIFT (0U) -/*! LEN - Operand length */ -#define PKC_PKC_LEN1_LEN(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_LEN1_LEN_SHIFT)) & PKC_PKC_LEN1_LEN_MASK) - -#define PKC_PKC_LEN1_MCLEN_MASK (0xFFFF0000U) -#define PKC_PKC_LEN1_MCLEN_SHIFT (16U) -/*! MCLEN - Loop counter for microcode pattern */ -#define PKC_PKC_LEN1_MCLEN(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_LEN1_MCLEN_SHIFT)) & PKC_PKC_LEN1_MCLEN_MASK) -/*! @} */ - -/*! @name PKC_MODE2 - Mode register, parameter set 2 */ -/*! @{ */ - -#define PKC_PKC_MODE2_MODE_MASK (0xFFU) -#define PKC_PKC_MODE2_MODE_SHIFT (0U) -/*! MODE - Calculation Mode / MC Start address */ -#define PKC_PKC_MODE2_MODE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_MODE2_MODE_SHIFT)) & PKC_PKC_MODE2_MODE_MASK) -/*! @} */ - -/*! @name PKC_XYPTR2 - X+Y pointer register, parameter set 2 */ -/*! @{ */ - -#define PKC_PKC_XYPTR2_XPTR_MASK (0xFFFFU) -#define PKC_PKC_XYPTR2_XPTR_SHIFT (0U) -/*! XPTR - Start address of X operand in PKCRAM with byte granularity */ -#define PKC_PKC_XYPTR2_XPTR(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_XYPTR2_XPTR_SHIFT)) & PKC_PKC_XYPTR2_XPTR_MASK) - -#define PKC_PKC_XYPTR2_YPTR_MASK (0xFFFF0000U) -#define PKC_PKC_XYPTR2_YPTR_SHIFT (16U) -/*! YPTR - Start address of Y operand in PKCRAM with byte granularity */ -#define PKC_PKC_XYPTR2_YPTR(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_XYPTR2_YPTR_SHIFT)) & PKC_PKC_XYPTR2_YPTR_MASK) -/*! @} */ - -/*! @name PKC_ZRPTR2 - Z+R pointer register, parameter set 2 */ -/*! @{ */ - -#define PKC_PKC_ZRPTR2_ZPT_MASK (0xFFFFU) -#define PKC_PKC_ZRPTR2_ZPT_SHIFT (0U) -/*! ZPT - Start address of Z operand in PKCRAM with byte granularity or constant for calculation modes using CONST */ -#define PKC_PKC_ZRPTR2_ZPT(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ZRPTR2_ZPT_SHIFT)) & PKC_PKC_ZRPTR2_ZPT_MASK) - -#define PKC_PKC_ZRPTR2_RPTR_MASK (0xFFFF0000U) -#define PKC_PKC_ZRPTR2_RPTR_SHIFT (16U) -/*! RPTR - Start address of R result in PKCRAM with byte granularity */ -#define PKC_PKC_ZRPTR2_RPTR(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ZRPTR2_RPTR_SHIFT)) & PKC_PKC_ZRPTR2_RPTR_MASK) -/*! @} */ - -/*! @name PKC_LEN2 - Length register, parameter set 2 */ -/*! @{ */ - -#define PKC_PKC_LEN2_LEN_MASK (0xFFFFU) -#define PKC_PKC_LEN2_LEN_SHIFT (0U) -/*! LEN - Operand length */ -#define PKC_PKC_LEN2_LEN(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_LEN2_LEN_SHIFT)) & PKC_PKC_LEN2_LEN_MASK) - -#define PKC_PKC_LEN2_MCLEN_MASK (0xFFFF0000U) -#define PKC_PKC_LEN2_MCLEN_SHIFT (16U) -/*! MCLEN - Loop counter for microcode pattern */ -#define PKC_PKC_LEN2_MCLEN(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_LEN2_MCLEN_SHIFT)) & PKC_PKC_LEN2_MCLEN_MASK) -/*! @} */ - -/*! @name PKC_UPTR - Universal pointer FUP program */ -/*! @{ */ - -#define PKC_PKC_UPTR_PTR_MASK (0xFFFFFFFFU) -#define PKC_PKC_UPTR_PTR_SHIFT (0U) -/*! PTR - Pointer to start address of PKC FUP program */ -#define PKC_PKC_UPTR_PTR(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_UPTR_PTR_SHIFT)) & PKC_PKC_UPTR_PTR_MASK) -/*! @} */ - -/*! @name PKC_UPTRT - Universal pointer FUP table */ -/*! @{ */ - -#define PKC_PKC_UPTRT_PTR_MASK (0xFFFFFFFFU) -#define PKC_PKC_UPTRT_PTR_SHIFT (0U) -/*! PTR - Pointer to start address of PKC FUP table */ -#define PKC_PKC_UPTRT_PTR(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_UPTRT_PTR_SHIFT)) & PKC_PKC_UPTRT_PTR_MASK) -/*! @} */ - -/*! @name PKC_ULEN - Universal pointer length */ -/*! @{ */ - -#define PKC_PKC_ULEN_LEN_MASK (0xFFU) -#define PKC_PKC_ULEN_LEN_SHIFT (0U) -/*! LEN - Length of universal pointer calculation */ -#define PKC_PKC_ULEN_LEN(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ULEN_LEN_SHIFT)) & PKC_PKC_ULEN_LEN_MASK) -/*! @} */ - -/*! @name PKC_MCDATA - MC pattern data interface */ -/*! @{ */ - -#define PKC_PKC_MCDATA_MCDATA_MASK (0xFFFFFFFFU) -#define PKC_PKC_MCDATA_MCDATA_SHIFT (0U) -/*! MCDATA - Microcode read/write data */ -#define PKC_PKC_MCDATA_MCDATA(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_MCDATA_MCDATA_SHIFT)) & PKC_PKC_MCDATA_MCDATA_MASK) -/*! @} */ - -/*! @name PKC_VERSION - PKC version register */ -/*! @{ */ - -#define PKC_PKC_VERSION_MULSIZE_MASK (0x3U) -#define PKC_PKC_VERSION_MULSIZE_SHIFT (0U) -/*! MULSIZE - * 0b01..32-bit multiplier - * 0b10..64-bit multiplier - * 0b11..128-bit multiplier - * 0b10..128-bit multiplier - * 0b01..64-bit multiplier - */ -#define PKC_PKC_VERSION_MULSIZE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_MULSIZE_SHIFT)) & PKC_PKC_VERSION_MULSIZE_MASK) - -#define PKC_PKC_VERSION_MCAVAIL_MASK (0x4U) -#define PKC_PKC_VERSION_MCAVAIL_SHIFT (2U) -#define PKC_PKC_VERSION_MCAVAIL(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_MCAVAIL_SHIFT)) & PKC_PKC_VERSION_MCAVAIL_MASK) - -#define PKC_PKC_VERSION_UPAVAIL_MASK (0x8U) -#define PKC_PKC_VERSION_UPAVAIL_SHIFT (3U) -#define PKC_PKC_VERSION_UPAVAIL(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_UPAVAIL_SHIFT)) & PKC_PKC_VERSION_UPAVAIL_MASK) - -#define PKC_PKC_VERSION_UPCACHEAVAIL_MASK (0x10U) -#define PKC_PKC_VERSION_UPCACHEAVAIL_SHIFT (4U) -#define PKC_PKC_VERSION_UPCACHEAVAIL(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_UPCACHEAVAIL_SHIFT)) & PKC_PKC_VERSION_UPCACHEAVAIL_MASK) - -#define PKC_PKC_VERSION_GF2AVAIL_MASK (0x20U) -#define PKC_PKC_VERSION_GF2AVAIL_SHIFT (5U) -#define PKC_PKC_VERSION_GF2AVAIL(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_GF2AVAIL_SHIFT)) & PKC_PKC_VERSION_GF2AVAIL_MASK) - -#define PKC_PKC_VERSION_PARAMNUM_MASK (0xC0U) -#define PKC_PKC_VERSION_PARAMNUM_SHIFT (6U) -#define PKC_PKC_VERSION_PARAMNUM(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_PARAMNUM_SHIFT)) & PKC_PKC_VERSION_PARAMNUM_MASK) - -#define PKC_PKC_VERSION_SBX0AVAIL_MASK (0x100U) -#define PKC_PKC_VERSION_SBX0AVAIL_SHIFT (8U) -#define PKC_PKC_VERSION_SBX0AVAIL(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_SBX0AVAIL_SHIFT)) & PKC_PKC_VERSION_SBX0AVAIL_MASK) - -#define PKC_PKC_VERSION_SBX1AVAIL_MASK (0x200U) -#define PKC_PKC_VERSION_SBX1AVAIL_SHIFT (9U) -#define PKC_PKC_VERSION_SBX1AVAIL(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_SBX1AVAIL_SHIFT)) & PKC_PKC_VERSION_SBX1AVAIL_MASK) - -#define PKC_PKC_VERSION_SBX2AVAIL_MASK (0x400U) -#define PKC_PKC_VERSION_SBX2AVAIL_SHIFT (10U) -#define PKC_PKC_VERSION_SBX2AVAIL(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_SBX2AVAIL_SHIFT)) & PKC_PKC_VERSION_SBX2AVAIL_MASK) - -#define PKC_PKC_VERSION_SBX3AVAIL_MASK (0x800U) -#define PKC_PKC_VERSION_SBX3AVAIL_SHIFT (11U) -#define PKC_PKC_VERSION_SBX3AVAIL(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_SBX3AVAIL_SHIFT)) & PKC_PKC_VERSION_SBX3AVAIL_MASK) - -#define PKC_PKC_VERSION_MCRECONF_SIZE_MASK (0xFF000U) -#define PKC_PKC_VERSION_MCRECONF_SIZE_SHIFT (12U) -#define PKC_PKC_VERSION_MCRECONF_SIZE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_VERSION_MCRECONF_SIZE_SHIFT)) & PKC_PKC_VERSION_MCRECONF_SIZE_MASK) -/*! @} */ - -/*! @name PKC_SOFT_RST - Software reset */ -/*! @{ */ - -#define PKC_PKC_SOFT_RST_SOFT_RST_MASK (0x1U) -#define PKC_PKC_SOFT_RST_SOFT_RST_SHIFT (0U) -#define PKC_PKC_SOFT_RST_SOFT_RST(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_SOFT_RST_SOFT_RST_SHIFT)) & PKC_PKC_SOFT_RST_SOFT_RST_MASK) -/*! @} */ - -/*! @name PKC_ACCESS_ERR - Access Error */ -/*! @{ */ - -#define PKC_PKC_ACCESS_ERR_APB_NOTAV_MASK (0x1U) -#define PKC_PKC_ACCESS_ERR_APB_NOTAV_SHIFT (0U) -/*! APB_NOTAV - APB Error */ -#define PKC_PKC_ACCESS_ERR_APB_NOTAV(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ACCESS_ERR_APB_NOTAV_SHIFT)) & PKC_PKC_ACCESS_ERR_APB_NOTAV_MASK) - -#define PKC_PKC_ACCESS_ERR_APB_WRGMD_MASK (0x2U) -#define PKC_PKC_ACCESS_ERR_APB_WRGMD_SHIFT (1U) -/*! APB_WRGMD - APB Error */ -#define PKC_PKC_ACCESS_ERR_APB_WRGMD(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ACCESS_ERR_APB_WRGMD_SHIFT)) & PKC_PKC_ACCESS_ERR_APB_WRGMD_MASK) - -#define PKC_PKC_ACCESS_ERR_APB_MASTER_MASK (0xF0U) -#define PKC_PKC_ACCESS_ERR_APB_MASTER_SHIFT (4U) -#define PKC_PKC_ACCESS_ERR_APB_MASTER(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ACCESS_ERR_APB_MASTER_SHIFT)) & PKC_PKC_ACCESS_ERR_APB_MASTER_MASK) - -#define PKC_PKC_ACCESS_ERR_AHB_MASK (0x400U) -#define PKC_PKC_ACCESS_ERR_AHB_SHIFT (10U) -/*! AHB - AHB Error */ -#define PKC_PKC_ACCESS_ERR_AHB(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ACCESS_ERR_AHB_SHIFT)) & PKC_PKC_ACCESS_ERR_AHB_MASK) - -#define PKC_PKC_ACCESS_ERR_PKCC_MASK (0x10000U) -#define PKC_PKC_ACCESS_ERR_PKCC_SHIFT (16U) -#define PKC_PKC_ACCESS_ERR_PKCC(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ACCESS_ERR_PKCC_SHIFT)) & PKC_PKC_ACCESS_ERR_PKCC_MASK) - -#define PKC_PKC_ACCESS_ERR_FDET_MASK (0x20000U) -#define PKC_PKC_ACCESS_ERR_FDET_SHIFT (17U) -#define PKC_PKC_ACCESS_ERR_FDET(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ACCESS_ERR_FDET_SHIFT)) & PKC_PKC_ACCESS_ERR_FDET_MASK) - -#define PKC_PKC_ACCESS_ERR_CTRL_MASK (0x40000U) -#define PKC_PKC_ACCESS_ERR_CTRL_SHIFT (18U) -#define PKC_PKC_ACCESS_ERR_CTRL(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ACCESS_ERR_CTRL_SHIFT)) & PKC_PKC_ACCESS_ERR_CTRL_MASK) - -#define PKC_PKC_ACCESS_ERR_UCRC_MASK (0x80000U) -#define PKC_PKC_ACCESS_ERR_UCRC_SHIFT (19U) -#define PKC_PKC_ACCESS_ERR_UCRC(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ACCESS_ERR_UCRC_SHIFT)) & PKC_PKC_ACCESS_ERR_UCRC_MASK) -/*! @} */ - -/*! @name PKC_ACCESS_ERR_CLR - Clear Access Error */ -/*! @{ */ - -#define PKC_PKC_ACCESS_ERR_CLR_ERR_CLR_MASK (0x1U) -#define PKC_PKC_ACCESS_ERR_CLR_ERR_CLR_SHIFT (0U) -#define PKC_PKC_ACCESS_ERR_CLR_ERR_CLR(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_ACCESS_ERR_CLR_ERR_CLR_SHIFT)) & PKC_PKC_ACCESS_ERR_CLR_ERR_CLR_MASK) -/*! @} */ - -/*! @name PKC_INT_CLR_ENABLE - Interrupt enable clear */ -/*! @{ */ - -#define PKC_PKC_INT_CLR_ENABLE_EN_PDONE_MASK (0x1U) -#define PKC_PKC_INT_CLR_ENABLE_EN_PDONE_SHIFT (0U) -#define PKC_PKC_INT_CLR_ENABLE_EN_PDONE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_INT_CLR_ENABLE_EN_PDONE_SHIFT)) & PKC_PKC_INT_CLR_ENABLE_EN_PDONE_MASK) -/*! @} */ - -/*! @name PKC_INT_SET_ENABLE - Interrupt enable set */ -/*! @{ */ - -#define PKC_PKC_INT_SET_ENABLE_EN_PDONE_MASK (0x1U) -#define PKC_PKC_INT_SET_ENABLE_EN_PDONE_SHIFT (0U) -#define PKC_PKC_INT_SET_ENABLE_EN_PDONE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_INT_SET_ENABLE_EN_PDONE_SHIFT)) & PKC_PKC_INT_SET_ENABLE_EN_PDONE_MASK) -/*! @} */ - -/*! @name PKC_INT_STATUS - Interrupt status */ -/*! @{ */ - -#define PKC_PKC_INT_STATUS_INT_PDONE_MASK (0x1U) -#define PKC_PKC_INT_STATUS_INT_PDONE_SHIFT (0U) -/*! INT_PDONE - End-of-computation status flag */ -#define PKC_PKC_INT_STATUS_INT_PDONE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_INT_STATUS_INT_PDONE_SHIFT)) & PKC_PKC_INT_STATUS_INT_PDONE_MASK) -/*! @} */ - -/*! @name PKC_INT_ENABLE - Interrupt enable */ -/*! @{ */ - -#define PKC_PKC_INT_ENABLE_EN_PDONE_MASK (0x1U) -#define PKC_PKC_INT_ENABLE_EN_PDONE_SHIFT (0U) -/*! EN_PDONE - PDONE interrupt enable flag */ -#define PKC_PKC_INT_ENABLE_EN_PDONE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_INT_ENABLE_EN_PDONE_SHIFT)) & PKC_PKC_INT_ENABLE_EN_PDONE_MASK) -/*! @} */ - -/*! @name PKC_INT_CLR_STATUS - Interrupt status clear */ -/*! @{ */ - -#define PKC_PKC_INT_CLR_STATUS_INT_PDONE_MASK (0x1U) -#define PKC_PKC_INT_CLR_STATUS_INT_PDONE_SHIFT (0U) -#define PKC_PKC_INT_CLR_STATUS_INT_PDONE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_INT_CLR_STATUS_INT_PDONE_SHIFT)) & PKC_PKC_INT_CLR_STATUS_INT_PDONE_MASK) -/*! @} */ - -/*! @name PKC_INT_SET_STATUS - Interrupt status set */ -/*! @{ */ - -#define PKC_PKC_INT_SET_STATUS_INT_PDONE_MASK (0x1U) -#define PKC_PKC_INT_SET_STATUS_INT_PDONE_SHIFT (0U) -#define PKC_PKC_INT_SET_STATUS_INT_PDONE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_INT_SET_STATUS_INT_PDONE_SHIFT)) & PKC_PKC_INT_SET_STATUS_INT_PDONE_MASK) -/*! @} */ - -/*! @name PKC_MODULE_ID - Module ID */ -/*! @{ */ - -#define PKC_PKC_MODULE_ID_SIZE_MASK (0xFFU) -#define PKC_PKC_MODULE_ID_SIZE_SHIFT (0U) -#define PKC_PKC_MODULE_ID_SIZE(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_MODULE_ID_SIZE_SHIFT)) & PKC_PKC_MODULE_ID_SIZE_MASK) - -#define PKC_PKC_MODULE_ID_MINOR_REV_MASK (0xF00U) -#define PKC_PKC_MODULE_ID_MINOR_REV_SHIFT (8U) -#define PKC_PKC_MODULE_ID_MINOR_REV(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_MODULE_ID_MINOR_REV_SHIFT)) & PKC_PKC_MODULE_ID_MINOR_REV_MASK) - -#define PKC_PKC_MODULE_ID_MAJOR_REV_MASK (0xF000U) -#define PKC_PKC_MODULE_ID_MAJOR_REV_SHIFT (12U) -#define PKC_PKC_MODULE_ID_MAJOR_REV(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_MODULE_ID_MAJOR_REV_SHIFT)) & PKC_PKC_MODULE_ID_MAJOR_REV_MASK) - -#define PKC_PKC_MODULE_ID_ID_MASK (0xFFFF0000U) -#define PKC_PKC_MODULE_ID_ID_SHIFT (16U) -#define PKC_PKC_MODULE_ID_ID(x) (((uint32_t)(((uint32_t)(x)) << PKC_PKC_MODULE_ID_ID_SHIFT)) & PKC_PKC_MODULE_ID_ID_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group PKC_Register_Masks */ - - -/* PKC - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral PKC0 base address */ - #define PKC0_BASE (0x5002B000u) - /** Peripheral PKC0 base address */ - #define PKC0_BASE_NS (0x4002B000u) - /** Peripheral PKC0 base pointer */ - #define PKC0 ((PKC_Type *)PKC0_BASE) - /** Peripheral PKC0 base pointer */ - #define PKC0_NS ((PKC_Type *)PKC0_BASE_NS) - /** Array initializer of PKC peripheral base addresses */ - #define PKC_BASE_ADDRS { PKC0_BASE } - /** Array initializer of PKC peripheral base pointers */ - #define PKC_BASE_PTRS { PKC0 } - /** Array initializer of PKC peripheral base addresses */ - #define PKC_BASE_ADDRS_NS { PKC0_BASE_NS } - /** Array initializer of PKC peripheral base pointers */ - #define PKC_BASE_PTRS_NS { PKC0_NS } -#else - /** Peripheral PKC0 base address */ - #define PKC0_BASE (0x4002B000u) - /** Peripheral PKC0 base pointer */ - #define PKC0 ((PKC_Type *)PKC0_BASE) - /** Array initializer of PKC peripheral base addresses */ - #define PKC_BASE_ADDRS { PKC0_BASE } - /** Array initializer of PKC peripheral base pointers */ - #define PKC_BASE_PTRS { PKC0 } -#endif - -/*! - * @} - */ /* end of group PKC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- PLU Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PLU_Peripheral_Access_Layer PLU Peripheral Access Layer - * @{ - */ - -/** PLU - Register Layout Typedef */ -typedef struct { - struct { /* offset: 0x0, array step: 0x20 */ - __IO uint32_t INP_MUX[5]; /**< Input select register for LUTn (0 to 25), Inputx (5 inputs), array offset: 0x0, array step: index*0x20, index2*0x4 */ - uint8_t RESERVED_0[12]; - } LUT[26]; - uint8_t RESERVED_0[1216]; - __IO uint32_t LUT_TRUTH[26]; /**< PLU LUT truth table, array offset: 0x800, array step: 0x4 */ - uint8_t RESERVED_1[152]; - __I uint32_t OUTPUTS; /**< PLU outputs, offset: 0x900 */ - __IO uint32_t WAKEINT_CTRL; /**< Wakeup interrupt control, offset: 0x904 */ - uint8_t RESERVED_2[760]; - __IO uint32_t OUTPUT_MUX[8]; /**< PLU output multiplexer, array offset: 0xC00, array step: 0x4 */ -} PLU_Type; - -/* ---------------------------------------------------------------------------- - -- PLU Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PLU_Register_Masks PLU Register Masks - * @{ - */ - -/*! @name LUT_INP_MUX - Input select register for LUTn (0 to 25), Inputx (5 inputs) */ -/*! @{ */ - -#define PLU_LUT_INP_MUX_LUTn_INPx_MASK (0x3FU) -#define PLU_LUT_INP_MUX_LUTn_INPx_SHIFT (0U) -/*! LUTn_INPx - Selects the input source to be connected to LUTn_INPx - * 0b000000..PLU primary inputs 0 - * 0b000001..PLU primary inputs 1 - * 0b000010..PLU primary inputs 2 - * 0b000011..PLU primary inputs 3 - * 0b000100..PLU primary inputs 4 - * 0b000101..PLU primary inputs 5 - * 0b000110..Output of LUT0 - * 0b000111..Output of LUT1 - * 0b001000..Output of LUT2 - * 0b001001..Output of LUT3 - * 0b001010..Output of LUT4 - * 0b001011..Output of LUT5 - * 0b001100..Output of LUT6 - * 0b001101..Output of LUT7 - * 0b001110..Output of LUT8 - * 0b001111..Output of LUT9 - * 0b010000..Output of LUT10 - * 0b010001..Output of LUT11 - * 0b010010..Output of LUT12 - * 0b010011..Output of LUT13 - * 0b010100..Output of LUT14 - * 0b010101..Output of LUT15 - * 0b010110..Output of LUT16 - * 0b010111..Output of LUT17 - * 0b011000..Output of LUT18 - * 0b011001..Output of LUT19 - * 0b011010..Output of LUT20 - * 0b011011..Output of LUT21 - * 0b011100..Output of LUT22 - * 0b011101..Output of LUT23 - * 0b011110..Output of LUT24 - * 0b011111..Output of LUT25 - * 0b100000..State[0] - * 0b100001..State[1] - * 0b100010..State[2] - * 0b100011..State[3] - */ -#define PLU_LUT_INP_MUX_LUTn_INPx(x) (((uint32_t)(((uint32_t)(x)) << PLU_LUT_INP_MUX_LUTn_INPx_SHIFT)) & PLU_LUT_INP_MUX_LUTn_INPx_MASK) -/*! @} */ - -/* The count of PLU_LUT_INP_MUX */ -#define PLU_LUT_INP_MUX_COUNT (26U) - -/* The count of PLU_LUT_INP_MUX */ -#define PLU_LUT_INP_MUX_COUNT2 (5U) - -/*! @name LUT_TRUTH - PLU LUT truth table */ -/*! @{ */ - -#define PLU_LUT_TRUTH_LUT_TRUTH_MASK (0xFFFFFFFFU) -#define PLU_LUT_TRUTH_LUT_TRUTH_SHIFT (0U) -/*! LUT_TRUTH - LUT truth table */ -#define PLU_LUT_TRUTH_LUT_TRUTH(x) (((uint32_t)(((uint32_t)(x)) << PLU_LUT_TRUTH_LUT_TRUTH_SHIFT)) & PLU_LUT_TRUTH_LUT_TRUTH_MASK) -/*! @} */ - -/* The count of PLU_LUT_TRUTH */ -#define PLU_LUT_TRUTH_COUNT (26U) - -/*! @name OUTPUTS - PLU outputs */ -/*! @{ */ - -#define PLU_OUTPUTS_OUTPUT_STATE_MASK (0xFFU) -#define PLU_OUTPUTS_OUTPUT_STATE_SHIFT (0U) -/*! OUTPUT_STATE - Output state */ -#define PLU_OUTPUTS_OUTPUT_STATE(x) (((uint32_t)(((uint32_t)(x)) << PLU_OUTPUTS_OUTPUT_STATE_SHIFT)) & PLU_OUTPUTS_OUTPUT_STATE_MASK) -/*! @} */ - -/*! @name WAKEINT_CTRL - Wakeup interrupt control */ -/*! @{ */ - -#define PLU_WAKEINT_CTRL_MASK_MASK (0xFFU) -#define PLU_WAKEINT_CTRL_MASK_SHIFT (0U) -/*! MASK - Interrupt mask */ -#define PLU_WAKEINT_CTRL_MASK(x) (((uint32_t)(((uint32_t)(x)) << PLU_WAKEINT_CTRL_MASK_SHIFT)) & PLU_WAKEINT_CTRL_MASK_MASK) - -#define PLU_WAKEINT_CTRL_FILTER_MODE_MASK (0x300U) -#define PLU_WAKEINT_CTRL_FILTER_MODE_SHIFT (8U) -/*! FILTER_MODE - Filter Mode - * 0b00..Bypass mode - * 0b01..Filter 1 clock period - * 0b10..Filter 2 clock period - * 0b11..Filter 3 clock period - */ -#define PLU_WAKEINT_CTRL_FILTER_MODE(x) (((uint32_t)(((uint32_t)(x)) << PLU_WAKEINT_CTRL_FILTER_MODE_SHIFT)) & PLU_WAKEINT_CTRL_FILTER_MODE_MASK) - -#define PLU_WAKEINT_CTRL_FILTER_CLKSEL_MASK (0xC00U) -#define PLU_WAKEINT_CTRL_FILTER_CLKSEL_SHIFT (10U) -/*! FILTER_CLKSEL - Filter clock select - * 0b00..Selects the 1 MHz low-power oscillator as the filter clock. - * 0b01..Selects the 12 MHz FRO as the filter clock. - * 0b10..Reserved - * 0b11..Reserved - */ -#define PLU_WAKEINT_CTRL_FILTER_CLKSEL(x) (((uint32_t)(((uint32_t)(x)) << PLU_WAKEINT_CTRL_FILTER_CLKSEL_SHIFT)) & PLU_WAKEINT_CTRL_FILTER_CLKSEL_MASK) - -#define PLU_WAKEINT_CTRL_LATCH_ENABLE_MASK (0x1000U) -#define PLU_WAKEINT_CTRL_LATCH_ENABLE_SHIFT (12U) -/*! LATCH_ENABLE - Latch the interrupt */ -#define PLU_WAKEINT_CTRL_LATCH_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << PLU_WAKEINT_CTRL_LATCH_ENABLE_SHIFT)) & PLU_WAKEINT_CTRL_LATCH_ENABLE_MASK) - -#define PLU_WAKEINT_CTRL_INTR_CLEAR_MASK (0x2000U) -#define PLU_WAKEINT_CTRL_INTR_CLEAR_SHIFT (13U) -/*! INTR_CLEAR - Write to clear wakeint_latched */ -#define PLU_WAKEINT_CTRL_INTR_CLEAR(x) (((uint32_t)(((uint32_t)(x)) << PLU_WAKEINT_CTRL_INTR_CLEAR_SHIFT)) & PLU_WAKEINT_CTRL_INTR_CLEAR_MASK) -/*! @} */ - -/*! @name OUTPUT_MUX - PLU output multiplexer */ -/*! @{ */ - -#define PLU_OUTPUT_MUX_OUTPUT_MASK (0x1FU) -#define PLU_OUTPUT_MUX_OUTPUT_SHIFT (0U) -/*! OUTPUT - Selects the source to be connected to PLU output n. - * 0b00000..LUT output 0 - * 0b00001..LUT output 1 - * 0b00010..LUT output 2 - * 0b00011..LUT output 3 - * 0b00100..LUT output 4 - * 0b00101..LUT output 5 - * 0b00110..LUT output 6 - * 0b00111..LUT output 7 - * 0b01000..LUT output 8 - * 0b01001..LUT output 9 - * 0b01010..LUT output 10 - * 0b01011..LUT output 11 - * 0b01100..LUT output 12 - * 0b01101..LUT output 13 - * 0b01110..LUT output 14 - * 0b01111..LUT output 15 - * 0b10000..LUT output 16 - * 0b10001..LUT output 17 - * 0b10010..LUT output 18 - * 0b10011..LUT output 19 - * 0b10100..LUT output 20 - * 0b10101..LUT output 21 - * 0b10110..LUT output 22 - * 0b10111..LUT output 23 - * 0b11000..LUT output 24 - * 0b11001..LUT output 25 - * 0b11010..State[0] - * 0b11011..State[1] - * 0b11100..State[2] - * 0b11101..State[3] - */ -#define PLU_OUTPUT_MUX_OUTPUT(x) (((uint32_t)(((uint32_t)(x)) << PLU_OUTPUT_MUX_OUTPUT_SHIFT)) & PLU_OUTPUT_MUX_OUTPUT_MASK) -/*! @} */ - -/* The count of PLU_OUTPUT_MUX */ -#define PLU_OUTPUT_MUX_COUNT (8U) - - -/*! - * @} - */ /* end of group PLU_Register_Masks */ - - -/* PLU - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral PLU0 base address */ - #define PLU0_BASE (0x50034000u) - /** Peripheral PLU0 base address */ - #define PLU0_BASE_NS (0x40034000u) - /** Peripheral PLU0 base pointer */ - #define PLU0 ((PLU_Type *)PLU0_BASE) - /** Peripheral PLU0 base pointer */ - #define PLU0_NS ((PLU_Type *)PLU0_BASE_NS) - /** Array initializer of PLU peripheral base addresses */ - #define PLU_BASE_ADDRS { PLU0_BASE } - /** Array initializer of PLU peripheral base pointers */ - #define PLU_BASE_PTRS { PLU0 } - /** Array initializer of PLU peripheral base addresses */ - #define PLU_BASE_ADDRS_NS { PLU0_BASE_NS } - /** Array initializer of PLU peripheral base pointers */ - #define PLU_BASE_PTRS_NS { PLU0_NS } -#else - /** Peripheral PLU0 base address */ - #define PLU0_BASE (0x40034000u) - /** Peripheral PLU0 base pointer */ - #define PLU0 ((PLU_Type *)PLU0_BASE) - /** Array initializer of PLU peripheral base addresses */ - #define PLU_BASE_ADDRS { PLU0_BASE } - /** Array initializer of PLU peripheral base pointers */ - #define PLU_BASE_PTRS { PLU0 } -#endif -/* Backward compatibility */ -#define PLU PLU0 - - -/*! - * @} - */ /* end of group PLU_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- PORT Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PORT_Peripheral_Access_Layer PORT Peripheral Access Layer - * @{ - */ - -/** PORT - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - uint8_t RESERVED_0[12]; - __O uint32_t GPCLR; /**< Global Pin Control Low, offset: 0x10 */ - __O uint32_t GPCHR; /**< Global Pin Control High, offset: 0x14 */ - uint8_t RESERVED_1[8]; - __IO uint32_t CONFIG; /**< Configuration, offset: 0x20 */ - uint8_t RESERVED_2[28]; - __I uint32_t EDFR; /**< EFT Detect Flag, offset: 0x40 */ - __IO uint32_t EDIER; /**< EFT Detect Interrupt Enable, offset: 0x44 */ - __IO uint32_t EDCR; /**< EFT Detect Clear, offset: 0x48 */ - uint8_t RESERVED_3[20]; - __IO uint32_t CALIB0; /**< Calibration 0, offset: 0x60, available only on: PORT0, PORT1, PORT2, PORT3 (missing on PORT4, PORT5) */ - __IO uint32_t CALIB1; /**< Calibration 1, offset: 0x64, available only on: PORT0, PORT1, PORT2, PORT3 (missing on PORT4, PORT5) */ - uint8_t RESERVED_4[24]; - __IO uint32_t PCR[32]; /**< Pin Control 0..Pin Control 31, array offset: 0x80, array step: 0x4, irregular array, not all indices are valid */ -} PORT_Type; - -/* ---------------------------------------------------------------------------- - -- PORT Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PORT_Register_Masks PORT Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define PORT_VERID_FEATURE_MASK (0xFFFFU) -#define PORT_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Basic implementation - */ -#define PORT_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << PORT_VERID_FEATURE_SHIFT)) & PORT_VERID_FEATURE_MASK) - -#define PORT_VERID_MINOR_MASK (0xFF0000U) -#define PORT_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define PORT_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << PORT_VERID_MINOR_SHIFT)) & PORT_VERID_MINOR_MASK) - -#define PORT_VERID_MAJOR_MASK (0xFF000000U) -#define PORT_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define PORT_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << PORT_VERID_MAJOR_SHIFT)) & PORT_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name GPCLR - Global Pin Control Low */ -/*! @{ */ - -#define PORT_GPCLR_GPWD_MASK (0xFFFFU) -#define PORT_GPCLR_GPWD_SHIFT (0U) -/*! GPWD - Global Pin Write Data */ -#define PORT_GPCLR_GPWD(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWD_SHIFT)) & PORT_GPCLR_GPWD_MASK) - -#define PORT_GPCLR_GPWE0_MASK (0x10000U) -#define PORT_GPCLR_GPWE0_SHIFT (16U) -/*! GPWE0 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE0(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE0_SHIFT)) & PORT_GPCLR_GPWE0_MASK) - -#define PORT_GPCLR_GPWE1_MASK (0x20000U) -#define PORT_GPCLR_GPWE1_SHIFT (17U) -/*! GPWE1 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE1(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE1_SHIFT)) & PORT_GPCLR_GPWE1_MASK) - -#define PORT_GPCLR_GPWE2_MASK (0x40000U) -#define PORT_GPCLR_GPWE2_SHIFT (18U) -/*! GPWE2 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE2(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE2_SHIFT)) & PORT_GPCLR_GPWE2_MASK) - -#define PORT_GPCLR_GPWE3_MASK (0x80000U) -#define PORT_GPCLR_GPWE3_SHIFT (19U) -/*! GPWE3 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE3(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE3_SHIFT)) & PORT_GPCLR_GPWE3_MASK) - -#define PORT_GPCLR_GPWE4_MASK (0x100000U) -#define PORT_GPCLR_GPWE4_SHIFT (20U) -/*! GPWE4 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE4(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE4_SHIFT)) & PORT_GPCLR_GPWE4_MASK) - -#define PORT_GPCLR_GPWE5_MASK (0x200000U) -#define PORT_GPCLR_GPWE5_SHIFT (21U) -/*! GPWE5 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE5(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE5_SHIFT)) & PORT_GPCLR_GPWE5_MASK) - -#define PORT_GPCLR_GPWE6_MASK (0x400000U) -#define PORT_GPCLR_GPWE6_SHIFT (22U) -/*! GPWE6 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE6(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE6_SHIFT)) & PORT_GPCLR_GPWE6_MASK) - -#define PORT_GPCLR_GPWE7_MASK (0x800000U) -#define PORT_GPCLR_GPWE7_SHIFT (23U) -/*! GPWE7 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE7(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE7_SHIFT)) & PORT_GPCLR_GPWE7_MASK) - -#define PORT_GPCLR_GPWE8_MASK (0x1000000U) -#define PORT_GPCLR_GPWE8_SHIFT (24U) -/*! GPWE8 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE8(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE8_SHIFT)) & PORT_GPCLR_GPWE8_MASK) - -#define PORT_GPCLR_GPWE9_MASK (0x2000000U) -#define PORT_GPCLR_GPWE9_SHIFT (25U) -/*! GPWE9 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE9(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE9_SHIFT)) & PORT_GPCLR_GPWE9_MASK) - -#define PORT_GPCLR_GPWE10_MASK (0x4000000U) -#define PORT_GPCLR_GPWE10_SHIFT (26U) -/*! GPWE10 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE10(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE10_SHIFT)) & PORT_GPCLR_GPWE10_MASK) - -#define PORT_GPCLR_GPWE11_MASK (0x8000000U) -#define PORT_GPCLR_GPWE11_SHIFT (27U) -/*! GPWE11 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE11(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE11_SHIFT)) & PORT_GPCLR_GPWE11_MASK) - -#define PORT_GPCLR_GPWE12_MASK (0x10000000U) -#define PORT_GPCLR_GPWE12_SHIFT (28U) -/*! GPWE12 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE12(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE12_SHIFT)) & PORT_GPCLR_GPWE12_MASK) - -#define PORT_GPCLR_GPWE13_MASK (0x20000000U) -#define PORT_GPCLR_GPWE13_SHIFT (29U) -/*! GPWE13 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE13(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE13_SHIFT)) & PORT_GPCLR_GPWE13_MASK) - -#define PORT_GPCLR_GPWE14_MASK (0x40000000U) -#define PORT_GPCLR_GPWE14_SHIFT (30U) -/*! GPWE14 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE14(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE14_SHIFT)) & PORT_GPCLR_GPWE14_MASK) - -#define PORT_GPCLR_GPWE15_MASK (0x80000000U) -#define PORT_GPCLR_GPWE15_SHIFT (31U) -/*! GPWE15 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCLR_GPWE15(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCLR_GPWE15_SHIFT)) & PORT_GPCLR_GPWE15_MASK) -/*! @} */ - -/*! @name GPCHR - Global Pin Control High */ -/*! @{ */ - -#define PORT_GPCHR_GPWD_MASK (0xFFFFU) -#define PORT_GPCHR_GPWD_SHIFT (0U) -/*! GPWD - Global Pin Write Data */ -#define PORT_GPCHR_GPWD(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWD_SHIFT)) & PORT_GPCHR_GPWD_MASK) - -#define PORT_GPCHR_GPWE16_MASK (0x10000U) -#define PORT_GPCHR_GPWE16_SHIFT (16U) -/*! GPWE16 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE16(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE16_SHIFT)) & PORT_GPCHR_GPWE16_MASK) - -#define PORT_GPCHR_GPWE17_MASK (0x20000U) -#define PORT_GPCHR_GPWE17_SHIFT (17U) -/*! GPWE17 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE17(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE17_SHIFT)) & PORT_GPCHR_GPWE17_MASK) - -#define PORT_GPCHR_GPWE18_MASK (0x40000U) -#define PORT_GPCHR_GPWE18_SHIFT (18U) -/*! GPWE18 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE18(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE18_SHIFT)) & PORT_GPCHR_GPWE18_MASK) - -#define PORT_GPCHR_GPWE19_MASK (0x80000U) -#define PORT_GPCHR_GPWE19_SHIFT (19U) -/*! GPWE19 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE19(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE19_SHIFT)) & PORT_GPCHR_GPWE19_MASK) - -#define PORT_GPCHR_GPWE20_MASK (0x100000U) -#define PORT_GPCHR_GPWE20_SHIFT (20U) -/*! GPWE20 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE20(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE20_SHIFT)) & PORT_GPCHR_GPWE20_MASK) - -#define PORT_GPCHR_GPWE21_MASK (0x200000U) -#define PORT_GPCHR_GPWE21_SHIFT (21U) -/*! GPWE21 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE21(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE21_SHIFT)) & PORT_GPCHR_GPWE21_MASK) - -#define PORT_GPCHR_GPWE22_MASK (0x400000U) -#define PORT_GPCHR_GPWE22_SHIFT (22U) -/*! GPWE22 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE22(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE22_SHIFT)) & PORT_GPCHR_GPWE22_MASK) - -#define PORT_GPCHR_GPWE23_MASK (0x800000U) -#define PORT_GPCHR_GPWE23_SHIFT (23U) -/*! GPWE23 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE23(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE23_SHIFT)) & PORT_GPCHR_GPWE23_MASK) - -#define PORT_GPCHR_GPWE24_MASK (0x1000000U) -#define PORT_GPCHR_GPWE24_SHIFT (24U) -/*! GPWE24 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE24(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE24_SHIFT)) & PORT_GPCHR_GPWE24_MASK) - -#define PORT_GPCHR_GPWE25_MASK (0x2000000U) -#define PORT_GPCHR_GPWE25_SHIFT (25U) -/*! GPWE25 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE25(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE25_SHIFT)) & PORT_GPCHR_GPWE25_MASK) - -#define PORT_GPCHR_GPWE26_MASK (0x4000000U) -#define PORT_GPCHR_GPWE26_SHIFT (26U) -/*! GPWE26 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE26(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE26_SHIFT)) & PORT_GPCHR_GPWE26_MASK) - -#define PORT_GPCHR_GPWE27_MASK (0x8000000U) -#define PORT_GPCHR_GPWE27_SHIFT (27U) -/*! GPWE27 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE27(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE27_SHIFT)) & PORT_GPCHR_GPWE27_MASK) - -#define PORT_GPCHR_GPWE28_MASK (0x10000000U) -#define PORT_GPCHR_GPWE28_SHIFT (28U) -/*! GPWE28 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE28(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE28_SHIFT)) & PORT_GPCHR_GPWE28_MASK) - -#define PORT_GPCHR_GPWE29_MASK (0x20000000U) -#define PORT_GPCHR_GPWE29_SHIFT (29U) -/*! GPWE29 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE29(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE29_SHIFT)) & PORT_GPCHR_GPWE29_MASK) - -#define PORT_GPCHR_GPWE30_MASK (0x40000000U) -#define PORT_GPCHR_GPWE30_SHIFT (30U) -/*! GPWE30 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE30(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE30_SHIFT)) & PORT_GPCHR_GPWE30_MASK) - -#define PORT_GPCHR_GPWE31_MASK (0x80000000U) -#define PORT_GPCHR_GPWE31_SHIFT (31U) -/*! GPWE31 - Global Pin Write Enable - * 0b0..Not updated - * 0b1..Updated - */ -#define PORT_GPCHR_GPWE31(x) (((uint32_t)(((uint32_t)(x)) << PORT_GPCHR_GPWE31_SHIFT)) & PORT_GPCHR_GPWE31_MASK) -/*! @} */ - -/*! @name CONFIG - Configuration */ -/*! @{ */ - -#define PORT_CONFIG_RANGE_MASK (0x1U) -#define PORT_CONFIG_RANGE_SHIFT (0U) -/*! RANGE - Port Voltage Range - * 0b0..1.71 V-3.6 V - * 0b1..2.70 V-3.6 V - */ -#define PORT_CONFIG_RANGE(x) (((uint32_t)(((uint32_t)(x)) << PORT_CONFIG_RANGE_SHIFT)) & PORT_CONFIG_RANGE_MASK) -/*! @} */ - -/*! @name EDFR - EFT Detect Flag */ -/*! @{ */ - -#define PORT_EDFR_EDF0_MASK (0x1U) -#define PORT_EDFR_EDF0_SHIFT (0U) -/*! EDF0 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF0(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF0_SHIFT)) & PORT_EDFR_EDF0_MASK) - -#define PORT_EDFR_EDF1_MASK (0x2U) -#define PORT_EDFR_EDF1_SHIFT (1U) -/*! EDF1 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF1(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF1_SHIFT)) & PORT_EDFR_EDF1_MASK) - -#define PORT_EDFR_EDF2_MASK (0x4U) -#define PORT_EDFR_EDF2_SHIFT (2U) -/*! EDF2 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF2(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF2_SHIFT)) & PORT_EDFR_EDF2_MASK) - -#define PORT_EDFR_EDF3_MASK (0x8U) -#define PORT_EDFR_EDF3_SHIFT (3U) -/*! EDF3 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF3(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF3_SHIFT)) & PORT_EDFR_EDF3_MASK) - -#define PORT_EDFR_EDF4_MASK (0x10U) -#define PORT_EDFR_EDF4_SHIFT (4U) -/*! EDF4 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF4(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF4_SHIFT)) & PORT_EDFR_EDF4_MASK) - -#define PORT_EDFR_EDF5_MASK (0x20U) -#define PORT_EDFR_EDF5_SHIFT (5U) -/*! EDF5 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF5(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF5_SHIFT)) & PORT_EDFR_EDF5_MASK) - -#define PORT_EDFR_EDF6_MASK (0x40U) -#define PORT_EDFR_EDF6_SHIFT (6U) -/*! EDF6 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF6(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF6_SHIFT)) & PORT_EDFR_EDF6_MASK) - -#define PORT_EDFR_EDF7_MASK (0x80U) -#define PORT_EDFR_EDF7_SHIFT (7U) -/*! EDF7 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF7(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF7_SHIFT)) & PORT_EDFR_EDF7_MASK) - -#define PORT_EDFR_EDF8_MASK (0x100U) -#define PORT_EDFR_EDF8_SHIFT (8U) -/*! EDF8 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF8(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF8_SHIFT)) & PORT_EDFR_EDF8_MASK) - -#define PORT_EDFR_EDF9_MASK (0x200U) -#define PORT_EDFR_EDF9_SHIFT (9U) -/*! EDF9 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF9(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF9_SHIFT)) & PORT_EDFR_EDF9_MASK) - -#define PORT_EDFR_EDF10_MASK (0x400U) -#define PORT_EDFR_EDF10_SHIFT (10U) -/*! EDF10 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF10(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF10_SHIFT)) & PORT_EDFR_EDF10_MASK) - -#define PORT_EDFR_EDF11_MASK (0x800U) -#define PORT_EDFR_EDF11_SHIFT (11U) -/*! EDF11 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF11(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF11_SHIFT)) & PORT_EDFR_EDF11_MASK) - -#define PORT_EDFR_EDF12_MASK (0x1000U) -#define PORT_EDFR_EDF12_SHIFT (12U) -/*! EDF12 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF12(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF12_SHIFT)) & PORT_EDFR_EDF12_MASK) - -#define PORT_EDFR_EDF13_MASK (0x2000U) -#define PORT_EDFR_EDF13_SHIFT (13U) -/*! EDF13 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF13(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF13_SHIFT)) & PORT_EDFR_EDF13_MASK) - -#define PORT_EDFR_EDF14_MASK (0x4000U) -#define PORT_EDFR_EDF14_SHIFT (14U) -/*! EDF14 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF14(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF14_SHIFT)) & PORT_EDFR_EDF14_MASK) - -#define PORT_EDFR_EDF15_MASK (0x8000U) -#define PORT_EDFR_EDF15_SHIFT (15U) -/*! EDF15 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF15(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF15_SHIFT)) & PORT_EDFR_EDF15_MASK) - -#define PORT_EDFR_EDF16_MASK (0x10000U) -#define PORT_EDFR_EDF16_SHIFT (16U) -/*! EDF16 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF16(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF16_SHIFT)) & PORT_EDFR_EDF16_MASK) - -#define PORT_EDFR_EDF17_MASK (0x20000U) -#define PORT_EDFR_EDF17_SHIFT (17U) -/*! EDF17 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF17(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF17_SHIFT)) & PORT_EDFR_EDF17_MASK) - -#define PORT_EDFR_EDF18_MASK (0x40000U) -#define PORT_EDFR_EDF18_SHIFT (18U) -/*! EDF18 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF18(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF18_SHIFT)) & PORT_EDFR_EDF18_MASK) - -#define PORT_EDFR_EDF19_MASK (0x80000U) -#define PORT_EDFR_EDF19_SHIFT (19U) -/*! EDF19 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF19(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF19_SHIFT)) & PORT_EDFR_EDF19_MASK) - -#define PORT_EDFR_EDF20_MASK (0x100000U) -#define PORT_EDFR_EDF20_SHIFT (20U) -/*! EDF20 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF20(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF20_SHIFT)) & PORT_EDFR_EDF20_MASK) - -#define PORT_EDFR_EDF21_MASK (0x200000U) -#define PORT_EDFR_EDF21_SHIFT (21U) -/*! EDF21 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF21(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF21_SHIFT)) & PORT_EDFR_EDF21_MASK) - -#define PORT_EDFR_EDF22_MASK (0x400000U) -#define PORT_EDFR_EDF22_SHIFT (22U) -/*! EDF22 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF22(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF22_SHIFT)) & PORT_EDFR_EDF22_MASK) - -#define PORT_EDFR_EDF23_MASK (0x800000U) -#define PORT_EDFR_EDF23_SHIFT (23U) -/*! EDF23 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF23(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF23_SHIFT)) & PORT_EDFR_EDF23_MASK) - -#define PORT_EDFR_EDF24_MASK (0x1000000U) -#define PORT_EDFR_EDF24_SHIFT (24U) -/*! EDF24 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF24(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF24_SHIFT)) & PORT_EDFR_EDF24_MASK) - -#define PORT_EDFR_EDF25_MASK (0x2000000U) -#define PORT_EDFR_EDF25_SHIFT (25U) -/*! EDF25 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF25(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF25_SHIFT)) & PORT_EDFR_EDF25_MASK) - -#define PORT_EDFR_EDF26_MASK (0x4000000U) -#define PORT_EDFR_EDF26_SHIFT (26U) -/*! EDF26 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF26(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF26_SHIFT)) & PORT_EDFR_EDF26_MASK) - -#define PORT_EDFR_EDF27_MASK (0x8000000U) -#define PORT_EDFR_EDF27_SHIFT (27U) -/*! EDF27 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF27(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF27_SHIFT)) & PORT_EDFR_EDF27_MASK) - -#define PORT_EDFR_EDF28_MASK (0x10000000U) -#define PORT_EDFR_EDF28_SHIFT (28U) -/*! EDF28 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF28(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF28_SHIFT)) & PORT_EDFR_EDF28_MASK) - -#define PORT_EDFR_EDF29_MASK (0x20000000U) -#define PORT_EDFR_EDF29_SHIFT (29U) -/*! EDF29 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF29(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF29_SHIFT)) & PORT_EDFR_EDF29_MASK) - -#define PORT_EDFR_EDF30_MASK (0x40000000U) -#define PORT_EDFR_EDF30_SHIFT (30U) -/*! EDF30 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF30(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF30_SHIFT)) & PORT_EDFR_EDF30_MASK) - -#define PORT_EDFR_EDF31_MASK (0x80000000U) -#define PORT_EDFR_EDF31_SHIFT (31U) -/*! EDF31 - EFT Detect Flag - * 0b0..No EFT event detected - * 0b1..High or/and low EFT event detected - */ -#define PORT_EDFR_EDF31(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDFR_EDF31_SHIFT)) & PORT_EDFR_EDF31_MASK) -/*! @} */ - -/*! @name EDIER - EFT Detect Interrupt Enable */ -/*! @{ */ - -#define PORT_EDIER_EDIE0_MASK (0x1U) -#define PORT_EDIER_EDIE0_SHIFT (0U) -/*! EDIE0 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE0(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE0_SHIFT)) & PORT_EDIER_EDIE0_MASK) - -#define PORT_EDIER_EDIE1_MASK (0x2U) -#define PORT_EDIER_EDIE1_SHIFT (1U) -/*! EDIE1 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE1(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE1_SHIFT)) & PORT_EDIER_EDIE1_MASK) - -#define PORT_EDIER_EDIE2_MASK (0x4U) -#define PORT_EDIER_EDIE2_SHIFT (2U) -/*! EDIE2 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE2(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE2_SHIFT)) & PORT_EDIER_EDIE2_MASK) - -#define PORT_EDIER_EDIE3_MASK (0x8U) -#define PORT_EDIER_EDIE3_SHIFT (3U) -/*! EDIE3 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE3(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE3_SHIFT)) & PORT_EDIER_EDIE3_MASK) - -#define PORT_EDIER_EDIE4_MASK (0x10U) -#define PORT_EDIER_EDIE4_SHIFT (4U) -/*! EDIE4 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE4(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE4_SHIFT)) & PORT_EDIER_EDIE4_MASK) - -#define PORT_EDIER_EDIE5_MASK (0x20U) -#define PORT_EDIER_EDIE5_SHIFT (5U) -/*! EDIE5 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE5(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE5_SHIFT)) & PORT_EDIER_EDIE5_MASK) - -#define PORT_EDIER_EDIE6_MASK (0x40U) -#define PORT_EDIER_EDIE6_SHIFT (6U) -/*! EDIE6 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE6(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE6_SHIFT)) & PORT_EDIER_EDIE6_MASK) - -#define PORT_EDIER_EDIE7_MASK (0x80U) -#define PORT_EDIER_EDIE7_SHIFT (7U) -/*! EDIE7 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE7(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE7_SHIFT)) & PORT_EDIER_EDIE7_MASK) - -#define PORT_EDIER_EDIE8_MASK (0x100U) -#define PORT_EDIER_EDIE8_SHIFT (8U) -/*! EDIE8 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE8(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE8_SHIFT)) & PORT_EDIER_EDIE8_MASK) - -#define PORT_EDIER_EDIE9_MASK (0x200U) -#define PORT_EDIER_EDIE9_SHIFT (9U) -/*! EDIE9 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE9(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE9_SHIFT)) & PORT_EDIER_EDIE9_MASK) - -#define PORT_EDIER_EDIE10_MASK (0x400U) -#define PORT_EDIER_EDIE10_SHIFT (10U) -/*! EDIE10 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE10(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE10_SHIFT)) & PORT_EDIER_EDIE10_MASK) - -#define PORT_EDIER_EDIE11_MASK (0x800U) -#define PORT_EDIER_EDIE11_SHIFT (11U) -/*! EDIE11 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE11(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE11_SHIFT)) & PORT_EDIER_EDIE11_MASK) - -#define PORT_EDIER_EDIE12_MASK (0x1000U) -#define PORT_EDIER_EDIE12_SHIFT (12U) -/*! EDIE12 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE12(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE12_SHIFT)) & PORT_EDIER_EDIE12_MASK) - -#define PORT_EDIER_EDIE13_MASK (0x2000U) -#define PORT_EDIER_EDIE13_SHIFT (13U) -/*! EDIE13 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE13(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE13_SHIFT)) & PORT_EDIER_EDIE13_MASK) - -#define PORT_EDIER_EDIE14_MASK (0x4000U) -#define PORT_EDIER_EDIE14_SHIFT (14U) -/*! EDIE14 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE14(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE14_SHIFT)) & PORT_EDIER_EDIE14_MASK) - -#define PORT_EDIER_EDIE15_MASK (0x8000U) -#define PORT_EDIER_EDIE15_SHIFT (15U) -/*! EDIE15 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE15(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE15_SHIFT)) & PORT_EDIER_EDIE15_MASK) - -#define PORT_EDIER_EDIE16_MASK (0x10000U) -#define PORT_EDIER_EDIE16_SHIFT (16U) -/*! EDIE16 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE16(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE16_SHIFT)) & PORT_EDIER_EDIE16_MASK) - -#define PORT_EDIER_EDIE17_MASK (0x20000U) -#define PORT_EDIER_EDIE17_SHIFT (17U) -/*! EDIE17 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE17(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE17_SHIFT)) & PORT_EDIER_EDIE17_MASK) - -#define PORT_EDIER_EDIE18_MASK (0x40000U) -#define PORT_EDIER_EDIE18_SHIFT (18U) -/*! EDIE18 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE18(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE18_SHIFT)) & PORT_EDIER_EDIE18_MASK) - -#define PORT_EDIER_EDIE19_MASK (0x80000U) -#define PORT_EDIER_EDIE19_SHIFT (19U) -/*! EDIE19 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE19(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE19_SHIFT)) & PORT_EDIER_EDIE19_MASK) - -#define PORT_EDIER_EDIE20_MASK (0x100000U) -#define PORT_EDIER_EDIE20_SHIFT (20U) -/*! EDIE20 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE20(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE20_SHIFT)) & PORT_EDIER_EDIE20_MASK) - -#define PORT_EDIER_EDIE21_MASK (0x200000U) -#define PORT_EDIER_EDIE21_SHIFT (21U) -/*! EDIE21 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE21(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE21_SHIFT)) & PORT_EDIER_EDIE21_MASK) - -#define PORT_EDIER_EDIE22_MASK (0x400000U) -#define PORT_EDIER_EDIE22_SHIFT (22U) -/*! EDIE22 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE22(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE22_SHIFT)) & PORT_EDIER_EDIE22_MASK) - -#define PORT_EDIER_EDIE23_MASK (0x800000U) -#define PORT_EDIER_EDIE23_SHIFT (23U) -/*! EDIE23 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE23(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE23_SHIFT)) & PORT_EDIER_EDIE23_MASK) - -#define PORT_EDIER_EDIE24_MASK (0x1000000U) -#define PORT_EDIER_EDIE24_SHIFT (24U) -/*! EDIE24 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE24(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE24_SHIFT)) & PORT_EDIER_EDIE24_MASK) - -#define PORT_EDIER_EDIE25_MASK (0x2000000U) -#define PORT_EDIER_EDIE25_SHIFT (25U) -/*! EDIE25 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE25(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE25_SHIFT)) & PORT_EDIER_EDIE25_MASK) - -#define PORT_EDIER_EDIE26_MASK (0x4000000U) -#define PORT_EDIER_EDIE26_SHIFT (26U) -/*! EDIE26 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE26(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE26_SHIFT)) & PORT_EDIER_EDIE26_MASK) - -#define PORT_EDIER_EDIE27_MASK (0x8000000U) -#define PORT_EDIER_EDIE27_SHIFT (27U) -/*! EDIE27 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE27(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE27_SHIFT)) & PORT_EDIER_EDIE27_MASK) - -#define PORT_EDIER_EDIE28_MASK (0x10000000U) -#define PORT_EDIER_EDIE28_SHIFT (28U) -/*! EDIE28 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE28(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE28_SHIFT)) & PORT_EDIER_EDIE28_MASK) - -#define PORT_EDIER_EDIE29_MASK (0x20000000U) -#define PORT_EDIER_EDIE29_SHIFT (29U) -/*! EDIE29 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE29(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE29_SHIFT)) & PORT_EDIER_EDIE29_MASK) - -#define PORT_EDIER_EDIE30_MASK (0x40000000U) -#define PORT_EDIER_EDIE30_SHIFT (30U) -/*! EDIE30 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE30(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE30_SHIFT)) & PORT_EDIER_EDIE30_MASK) - -#define PORT_EDIER_EDIE31_MASK (0x80000000U) -#define PORT_EDIER_EDIE31_SHIFT (31U) -/*! EDIE31 - EFT Detect Interrupt Enable - * 0b0..Interrupt not generated upon detection of the EFT event - * 0b1..Interrupt generated upon detection of the EFT event - */ -#define PORT_EDIER_EDIE31(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDIER_EDIE31_SHIFT)) & PORT_EDIER_EDIE31_MASK) -/*! @} */ - -/*! @name EDCR - EFT Detect Clear */ -/*! @{ */ - -#define PORT_EDCR_EDHC_MASK (0x1U) -#define PORT_EDCR_EDHC_SHIFT (0U) -/*! EDHC - EFT Detect High Clear - * 0b0..Does not clear - * 0b1..Clears - */ -#define PORT_EDCR_EDHC(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDCR_EDHC_SHIFT)) & PORT_EDCR_EDHC_MASK) - -#define PORT_EDCR_EDLC_MASK (0x2U) -#define PORT_EDCR_EDLC_SHIFT (1U) -/*! EDLC - EFT Detect Low Clear - * 0b0..Does not clear - * 0b1..Clears - */ -#define PORT_EDCR_EDLC(x) (((uint32_t)(((uint32_t)(x)) << PORT_EDCR_EDLC_SHIFT)) & PORT_EDCR_EDLC_MASK) -/*! @} */ - -/*! @name CALIB0 - Calibration 0 */ -/*! @{ */ - -#define PORT_CALIB0_NCAL_MASK (0x3FU) -#define PORT_CALIB0_NCAL_SHIFT (0U) -/*! NCAL - Calibration of NMOS Output Driver */ -#define PORT_CALIB0_NCAL(x) (((uint32_t)(((uint32_t)(x)) << PORT_CALIB0_NCAL_SHIFT)) & PORT_CALIB0_NCAL_MASK) - -#define PORT_CALIB0_PCAL_MASK (0x3F0000U) -#define PORT_CALIB0_PCAL_SHIFT (16U) -/*! PCAL - Calibration of PMOS Output Driver */ -#define PORT_CALIB0_PCAL(x) (((uint32_t)(((uint32_t)(x)) << PORT_CALIB0_PCAL_SHIFT)) & PORT_CALIB0_PCAL_MASK) -/*! @} */ - -/*! @name CALIB1 - Calibration 1 */ -/*! @{ */ - -#define PORT_CALIB1_NCAL_MASK (0x3FU) -#define PORT_CALIB1_NCAL_SHIFT (0U) -/*! NCAL - Calibration of NMOS Output Driver */ -#define PORT_CALIB1_NCAL(x) (((uint32_t)(((uint32_t)(x)) << PORT_CALIB1_NCAL_SHIFT)) & PORT_CALIB1_NCAL_MASK) - -#define PORT_CALIB1_PCAL_MASK (0x3F0000U) -#define PORT_CALIB1_PCAL_SHIFT (16U) -/*! PCAL - Calibration of PMOS Output Driver */ -#define PORT_CALIB1_PCAL(x) (((uint32_t)(((uint32_t)(x)) << PORT_CALIB1_PCAL_SHIFT)) & PORT_CALIB1_PCAL_MASK) -/*! @} */ - -/*! @name PCR - Pin Control 0..Pin Control 31 */ -/*! @{ */ - -#define PORT_PCR_PS_MASK (0x1U) -#define PORT_PCR_PS_SHIFT (0U) -/*! PS - Pull Select - * 0b0..Enables internal pulldown resistor - * 0b1..Enables internal pullup resistor - */ -#define PORT_PCR_PS(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_PS_SHIFT)) & PORT_PCR_PS_MASK) - -#define PORT_PCR_PE_MASK (0x2U) -#define PORT_PCR_PE_SHIFT (1U) -/*! PE - Pull Enable - * 0b0..Disables - * 0b1..Enables - */ -#define PORT_PCR_PE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_PE_SHIFT)) & PORT_PCR_PE_MASK) - -#define PORT_PCR_PV_MASK (0x4U) -#define PORT_PCR_PV_SHIFT (2U) -/*! PV - Pull Value - * 0b0..Low - * 0b1..High - */ -#define PORT_PCR_PV(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_PV_SHIFT)) & PORT_PCR_PV_MASK) - -#define PORT_PCR_SRE_MASK (0x8U) -#define PORT_PCR_SRE_SHIFT (3U) -/*! SRE - Slew Rate Enable - * 0b0..Fast - * 0b1..Slow - */ -#define PORT_PCR_SRE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_SRE_SHIFT)) & PORT_PCR_SRE_MASK) - -#define PORT_PCR_PFE_MASK (0x10U) -#define PORT_PCR_PFE_SHIFT (4U) -/*! PFE - Passive Filter Enable - * 0b0..Disables - * 0b1..Enables - */ -#define PORT_PCR_PFE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_PFE_SHIFT)) & PORT_PCR_PFE_MASK) - -#define PORT_PCR_ODE_MASK (0x20U) -#define PORT_PCR_ODE_SHIFT (5U) -/*! ODE - Open Drain Enable - * 0b0..Disables - * 0b1..Enables - */ -#define PORT_PCR_ODE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_ODE_SHIFT)) & PORT_PCR_ODE_MASK) - -#define PORT_PCR_DSE_MASK (0x40U) -#define PORT_PCR_DSE_SHIFT (6U) -/*! DSE - Drive Strength Enable - * 0b0..Low - * 0b1..High - */ -#define PORT_PCR_DSE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_DSE_SHIFT)) & PORT_PCR_DSE_MASK) - -#define PORT_PCR_MUX_MASK (0xF00U) /* Merged from fields with different position or width, of widths (2, 4), largest definition used */ -#define PORT_PCR_MUX_SHIFT (8U) -/*! MUX - Pin Multiplex Control - * 0b0000..Alternative 0 (GPIO) - * 0b0001..Alternative 1 (chip-specific) - * 0b0010..Alternative 2 (chip-specific) - * 0b0011..Alternative 3 (chip-specific) - * 0b0100..Alternative 4 (chip-specific) - * 0b0101..Alternative 5 (chip-specific) - * 0b0110..Alternative 6 (chip-specific) - * 0b0111..Alternative 7 (chip-specific) - * 0b1000..Alternative 8 (chip-specific) - * 0b1001..Alternative 9 (chip-specific) - * 0b1010..Alternative 10 (chip-specific) - * 0b1011..Alternative 11 (chip-specific) - * 0b1100..Alternative 12 (chip-specific) - * 0b1101..Alternative 13 (chip-specific) - */ -#define PORT_PCR_MUX(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_MUX_SHIFT)) & PORT_PCR_MUX_MASK) /* Merged from fields with different position or width, of widths (2, 4), largest definition used */ - -#define PORT_PCR_IBE_MASK (0x1000U) -#define PORT_PCR_IBE_SHIFT (12U) -/*! IBE - Input Buffer Enable - * 0b0..Disables - * 0b1..Enables - */ -#define PORT_PCR_IBE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_IBE_SHIFT)) & PORT_PCR_IBE_MASK) - -#define PORT_PCR_INV_MASK (0x2000U) -#define PORT_PCR_INV_SHIFT (13U) -/*! INV - Invert Input - * 0b0..Does not invert - * 0b1..Inverts - */ -#define PORT_PCR_INV(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_INV_SHIFT)) & PORT_PCR_INV_MASK) - -#define PORT_PCR_LK_MASK (0x8000U) -#define PORT_PCR_LK_SHIFT (15U) -/*! LK - Lock Register - * 0b0..Does not lock - * 0b1..Locks - */ -#define PORT_PCR_LK(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_LK_SHIFT)) & PORT_PCR_LK_MASK) -/*! @} */ - -/* The count of PORT_PCR */ -#define PORT_PCR_COUNT (32U) - - -/*! - * @} - */ /* end of group PORT_Register_Masks */ - - -/* PORT - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral PORT0 base address */ - #define PORT0_BASE (0x50116000u) - /** Peripheral PORT0 base address */ - #define PORT0_BASE_NS (0x40116000u) - /** Peripheral PORT0 base pointer */ - #define PORT0 ((PORT_Type *)PORT0_BASE) - /** Peripheral PORT0 base pointer */ - #define PORT0_NS ((PORT_Type *)PORT0_BASE_NS) - /** Peripheral PORT1 base address */ - #define PORT1_BASE (0x50117000u) - /** Peripheral PORT1 base address */ - #define PORT1_BASE_NS (0x40117000u) - /** Peripheral PORT1 base pointer */ - #define PORT1 ((PORT_Type *)PORT1_BASE) - /** Peripheral PORT1 base pointer */ - #define PORT1_NS ((PORT_Type *)PORT1_BASE_NS) - /** Peripheral PORT2 base address */ - #define PORT2_BASE (0x50118000u) - /** Peripheral PORT2 base address */ - #define PORT2_BASE_NS (0x40118000u) - /** Peripheral PORT2 base pointer */ - #define PORT2 ((PORT_Type *)PORT2_BASE) - /** Peripheral PORT2 base pointer */ - #define PORT2_NS ((PORT_Type *)PORT2_BASE_NS) - /** Peripheral PORT3 base address */ - #define PORT3_BASE (0x50119000u) - /** Peripheral PORT3 base address */ - #define PORT3_BASE_NS (0x40119000u) - /** Peripheral PORT3 base pointer */ - #define PORT3 ((PORT_Type *)PORT3_BASE) - /** Peripheral PORT3 base pointer */ - #define PORT3_NS ((PORT_Type *)PORT3_BASE_NS) - /** Peripheral PORT4 base address */ - #define PORT4_BASE (0x5011A000u) - /** Peripheral PORT4 base address */ - #define PORT4_BASE_NS (0x4011A000u) - /** Peripheral PORT4 base pointer */ - #define PORT4 ((PORT_Type *)PORT4_BASE) - /** Peripheral PORT4 base pointer */ - #define PORT4_NS ((PORT_Type *)PORT4_BASE_NS) - /** Peripheral PORT5 base address */ - #define PORT5_BASE (0x50042000u) - /** Peripheral PORT5 base address */ - #define PORT5_BASE_NS (0x40042000u) - /** Peripheral PORT5 base pointer */ - #define PORT5 ((PORT_Type *)PORT5_BASE) - /** Peripheral PORT5 base pointer */ - #define PORT5_NS ((PORT_Type *)PORT5_BASE_NS) - /** Array initializer of PORT peripheral base addresses */ - #define PORT_BASE_ADDRS { PORT0_BASE, PORT1_BASE, PORT2_BASE, PORT3_BASE, PORT4_BASE, PORT5_BASE } - /** Array initializer of PORT peripheral base pointers */ - #define PORT_BASE_PTRS { PORT0, PORT1, PORT2, PORT3, PORT4, PORT5 } - /** Array initializer of PORT peripheral base addresses */ - #define PORT_BASE_ADDRS_NS { PORT0_BASE_NS, PORT1_BASE_NS, PORT2_BASE_NS, PORT3_BASE_NS, PORT4_BASE_NS, PORT5_BASE_NS } - /** Array initializer of PORT peripheral base pointers */ - #define PORT_BASE_PTRS_NS { PORT0_NS, PORT1_NS, PORT2_NS, PORT3_NS, PORT4_NS, PORT5_NS } -#else - /** Peripheral PORT0 base address */ - #define PORT0_BASE (0x40116000u) - /** Peripheral PORT0 base pointer */ - #define PORT0 ((PORT_Type *)PORT0_BASE) - /** Peripheral PORT1 base address */ - #define PORT1_BASE (0x40117000u) - /** Peripheral PORT1 base pointer */ - #define PORT1 ((PORT_Type *)PORT1_BASE) - /** Peripheral PORT2 base address */ - #define PORT2_BASE (0x40118000u) - /** Peripheral PORT2 base pointer */ - #define PORT2 ((PORT_Type *)PORT2_BASE) - /** Peripheral PORT3 base address */ - #define PORT3_BASE (0x40119000u) - /** Peripheral PORT3 base pointer */ - #define PORT3 ((PORT_Type *)PORT3_BASE) - /** Peripheral PORT4 base address */ - #define PORT4_BASE (0x4011A000u) - /** Peripheral PORT4 base pointer */ - #define PORT4 ((PORT_Type *)PORT4_BASE) - /** Peripheral PORT5 base address */ - #define PORT5_BASE (0x40042000u) - /** Peripheral PORT5 base pointer */ - #define PORT5 ((PORT_Type *)PORT5_BASE) - /** Array initializer of PORT peripheral base addresses */ - #define PORT_BASE_ADDRS { PORT0_BASE, PORT1_BASE, PORT2_BASE, PORT3_BASE, PORT4_BASE, PORT5_BASE } - /** Array initializer of PORT peripheral base pointers */ - #define PORT_BASE_PTRS { PORT0, PORT1, PORT2, PORT3, PORT4, PORT5 } -#endif - -/*! - * @} - */ /* end of group PORT_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- POWERQUAD Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup POWERQUAD_Peripheral_Access_Layer POWERQUAD Peripheral Access Layer - * @{ - */ - -/** POWERQUAD - Register Layout Typedef */ -typedef struct { - __IO uint32_t OUTBASE; /**< Output Base, offset: 0x0 */ - __IO uint32_t OUTFORMAT; /**< Output Format, offset: 0x4 */ - __IO uint32_t TMPBASE; /**< Temporary Base, offset: 0x8 */ - __IO uint32_t TMPFORMAT; /**< Temporary Format, offset: 0xC */ - __IO uint32_t INABASE; /**< Input A Base, offset: 0x10 */ - __IO uint32_t INAFORMAT; /**< Input A Format, offset: 0x14 */ - __IO uint32_t INBBASE; /**< Input B Base, offset: 0x18 */ - __IO uint32_t INBFORMAT; /**< Input B Format, offset: 0x1C */ - uint8_t RESERVED_0[224]; - __IO uint32_t CONTROL; /**< Control, offset: 0x100 */ - __IO uint32_t LENGTH; /**< Length, offset: 0x104 */ - __IO uint32_t CPPRE; /**< Coprocessor Prescale, offset: 0x108 */ - __IO uint32_t MISC; /**< Miscellaneous, offset: 0x10C */ - __IO uint32_t CURSORY; /**< Cursory, offset: 0x110 */ - uint8_t RESERVED_1[108]; - __IO uint32_t CORDIC_X; /**< CORDIC Input X, offset: 0x180 */ - __IO uint32_t CORDIC_Y; /**< CORDIC Input Y, offset: 0x184 */ - __IO uint32_t CORDIC_Z; /**< CORDIC Input Z, offset: 0x188 */ - __IO uint32_t ERRSTAT; /**< Error Status, offset: 0x18C */ - __IO uint32_t INTREN; /**< Interrupt Enable, offset: 0x190 */ - __IO uint32_t EVENTEN; /**< Event Enable, offset: 0x194 */ - __IO uint32_t INTRSTAT; /**< Interrupt Status, offset: 0x198 */ - uint8_t RESERVED_2[100]; - __IO uint32_t GPREG[16]; /**< General Purpose Register Bank n, array offset: 0x200, array step: 0x4 */ - __IO uint32_t COMPREG[8]; /**< Compute Register Bank n, array offset: 0x240, array step: 0x4 */ -} POWERQUAD_Type; - -/* ---------------------------------------------------------------------------- - -- POWERQUAD Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup POWERQUAD_Register_Masks POWERQUAD Register Masks - * @{ - */ - -/*! @name OUTBASE - Output Base */ -/*! @{ */ - -#define POWERQUAD_OUTBASE_OUTBASE_MASK (0xFFFFFFFFU) -#define POWERQUAD_OUTBASE_OUTBASE_SHIFT (0U) -/*! OUTBASE - Output Region Base Address */ -#define POWERQUAD_OUTBASE_OUTBASE(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_OUTBASE_OUTBASE_SHIFT)) & POWERQUAD_OUTBASE_OUTBASE_MASK) -/*! @} */ - -/*! @name OUTFORMAT - Output Format */ -/*! @{ */ - -#define POWERQUAD_OUTFORMAT_OUT_FORMATINT_MASK (0x3U) -#define POWERQUAD_OUTFORMAT_OUT_FORMATINT_SHIFT (0U) -/*! OUT_FORMATINT - Output Internal Format - * 0b00..Q15 16-bit fixed-point integer - * 0b01..Q31 32-bit fixed-point integer - * 0b10..F32 32-bit floating-point format - * 0b11.. - */ -#define POWERQUAD_OUTFORMAT_OUT_FORMATINT(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_OUTFORMAT_OUT_FORMATINT_SHIFT)) & POWERQUAD_OUTFORMAT_OUT_FORMATINT_MASK) - -#define POWERQUAD_OUTFORMAT_OUT_FORMATEXT_MASK (0x30U) -#define POWERQUAD_OUTFORMAT_OUT_FORMATEXT_SHIFT (4U) -/*! OUT_FORMATEXT - Output External Format - * 0b00..Q15 16-bit fixed-point integer - * 0b01..Q31 32-bit fixed-point integer - * 0b10..F32 32-bit floating-point format - * 0b11.. - */ -#define POWERQUAD_OUTFORMAT_OUT_FORMATEXT(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_OUTFORMAT_OUT_FORMATEXT_SHIFT)) & POWERQUAD_OUTFORMAT_OUT_FORMATEXT_MASK) - -#define POWERQUAD_OUTFORMAT_OUT_SCALER_MASK (0xFF00U) -#define POWERQUAD_OUTFORMAT_OUT_SCALER_SHIFT (8U) -/*! OUT_SCALER - 8-bit Scaling Value for Result Data */ -#define POWERQUAD_OUTFORMAT_OUT_SCALER(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_OUTFORMAT_OUT_SCALER_SHIFT)) & POWERQUAD_OUTFORMAT_OUT_SCALER_MASK) -/*! @} */ - -/*! @name TMPBASE - Temporary Base */ -/*! @{ */ - -#define POWERQUAD_TMPBASE_TMPBASE_MASK (0xFFFFFFFFU) -#define POWERQUAD_TMPBASE_TMPBASE_SHIFT (0U) -/*! TMPBASE - Base Address for the Temporary Region */ -#define POWERQUAD_TMPBASE_TMPBASE(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_TMPBASE_TMPBASE_SHIFT)) & POWERQUAD_TMPBASE_TMPBASE_MASK) -/*! @} */ - -/*! @name TMPFORMAT - Temporary Format */ -/*! @{ */ - -#define POWERQUAD_TMPFORMAT_TMP_FORMATINT_MASK (0x3U) -#define POWERQUAD_TMPFORMAT_TMP_FORMATINT_SHIFT (0U) -/*! TMP_FORMATINT - Temporary Internal Format - * 0b00..Q15 16-bit fixed-point integer - * 0b01..Q31 32-bit fixed-point integer - * 0b10..F32 32-bit floating-point format - * 0b11.. - */ -#define POWERQUAD_TMPFORMAT_TMP_FORMATINT(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_TMPFORMAT_TMP_FORMATINT_SHIFT)) & POWERQUAD_TMPFORMAT_TMP_FORMATINT_MASK) - -#define POWERQUAD_TMPFORMAT_TMP_FORMATEXT_MASK (0x30U) -#define POWERQUAD_TMPFORMAT_TMP_FORMATEXT_SHIFT (4U) -/*! TMP_FORMATEXT - Temporary External Format - * 0b00..Q15 16-bit fixed-point integer - * 0b01..Q31 32-bit fixed-point integer - * 0b10..F32 32-bit floating-point format - * 0b11.. - */ -#define POWERQUAD_TMPFORMAT_TMP_FORMATEXT(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_TMPFORMAT_TMP_FORMATEXT_SHIFT)) & POWERQUAD_TMPFORMAT_TMP_FORMATEXT_MASK) - -#define POWERQUAD_TMPFORMAT_TMP_SCALER_MASK (0xFF00U) -#define POWERQUAD_TMPFORMAT_TMP_SCALER_SHIFT (8U) -/*! TMP_SCALER - Scaling Value for Temporary Data. */ -#define POWERQUAD_TMPFORMAT_TMP_SCALER(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_TMPFORMAT_TMP_SCALER_SHIFT)) & POWERQUAD_TMPFORMAT_TMP_SCALER_MASK) -/*! @} */ - -/*! @name INABASE - Input A Base */ -/*! @{ */ - -#define POWERQUAD_INABASE_INABASE_MASK (0xFFFFFFFFU) -#define POWERQUAD_INABASE_INABASE_SHIFT (0U) -/*! INABASE - Input A Base */ -#define POWERQUAD_INABASE_INABASE(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_INABASE_INABASE_SHIFT)) & POWERQUAD_INABASE_INABASE_MASK) -/*! @} */ - -/*! @name INAFORMAT - Input A Format */ -/*! @{ */ - -#define POWERQUAD_INAFORMAT_INA_FORMATINT_MASK (0x3U) -#define POWERQUAD_INAFORMAT_INA_FORMATINT_SHIFT (0U) -/*! INA_FORMATINT - Input A Internal Format - * 0b00..Q15 16-bit fixed-point integer - * 0b01..Q31 32-bit fixed-point integer - * 0b10..F32 32-bit floating-point format - * 0b11.. - */ -#define POWERQUAD_INAFORMAT_INA_FORMATINT(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_INAFORMAT_INA_FORMATINT_SHIFT)) & POWERQUAD_INAFORMAT_INA_FORMATINT_MASK) - -#define POWERQUAD_INAFORMAT_INA_FORMATEXT_MASK (0x30U) -#define POWERQUAD_INAFORMAT_INA_FORMATEXT_SHIFT (4U) -/*! INA_FORMATEXT - Input A External Format - * 0b00..Q15 16-bit fixed-point integer - * 0b01..Q31 32-bit fixed-point integer - * 0b10..F32 32-bit floating-point format - * 0b11.. - */ -#define POWERQUAD_INAFORMAT_INA_FORMATEXT(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_INAFORMAT_INA_FORMATEXT_SHIFT)) & POWERQUAD_INAFORMAT_INA_FORMATEXT_MASK) - -#define POWERQUAD_INAFORMAT_INA_SCALER_MASK (0xFF00U) -#define POWERQUAD_INAFORMAT_INA_SCALER_SHIFT (8U) -/*! INA_SCALER - Input A Scaler Value */ -#define POWERQUAD_INAFORMAT_INA_SCALER(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_INAFORMAT_INA_SCALER_SHIFT)) & POWERQUAD_INAFORMAT_INA_SCALER_MASK) -/*! @} */ - -/*! @name INBBASE - Input B Base */ -/*! @{ */ - -#define POWERQUAD_INBBASE_INBBASE_MASK (0xFFFFFFFFU) -#define POWERQUAD_INBBASE_INBBASE_SHIFT (0U) -/*! INBBASE - Input B Base */ -#define POWERQUAD_INBBASE_INBBASE(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_INBBASE_INBBASE_SHIFT)) & POWERQUAD_INBBASE_INBBASE_MASK) -/*! @} */ - -/*! @name INBFORMAT - Input B Format */ -/*! @{ */ - -#define POWERQUAD_INBFORMAT_INB_FORMATINT_MASK (0x3U) -#define POWERQUAD_INBFORMAT_INB_FORMATINT_SHIFT (0U) -/*! INB_FORMATINT - Input B Internal Format - * 0b00..Q15 16-bit fixed-point integer - * 0b01..Q31 32-bit fixed-point integer - * 0b10..F32 32-bit floating-point format - * 0b11.. - */ -#define POWERQUAD_INBFORMAT_INB_FORMATINT(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_INBFORMAT_INB_FORMATINT_SHIFT)) & POWERQUAD_INBFORMAT_INB_FORMATINT_MASK) - -#define POWERQUAD_INBFORMAT_INB_FORMATEXT_MASK (0x30U) -#define POWERQUAD_INBFORMAT_INB_FORMATEXT_SHIFT (4U) -/*! INB_FORMATEXT - Input B External Format - * 0b00..Q15 16-bit fixed-point integer - * 0b01..Q31 32-bit fixed-point integer - * 0b10..F32 32-bit floating-point format - * 0b11.. - */ -#define POWERQUAD_INBFORMAT_INB_FORMATEXT(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_INBFORMAT_INB_FORMATEXT_SHIFT)) & POWERQUAD_INBFORMAT_INB_FORMATEXT_MASK) - -#define POWERQUAD_INBFORMAT_INB_SCALER_MASK (0xFF00U) -#define POWERQUAD_INBFORMAT_INB_SCALER_SHIFT (8U) -/*! INB_SCALER - Input B Scaler */ -#define POWERQUAD_INBFORMAT_INB_SCALER(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_INBFORMAT_INB_SCALER_SHIFT)) & POWERQUAD_INBFORMAT_INB_SCALER_MASK) -/*! @} */ - -/*! @name CONTROL - Control */ -/*! @{ */ - -#define POWERQUAD_CONTROL_DECODE_OPCODE_MASK (0xFU) -#define POWERQUAD_CONTROL_DECODE_OPCODE_SHIFT (0U) -/*! DECODE_OPCODE - Decode Opcode */ -#define POWERQUAD_CONTROL_DECODE_OPCODE(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_CONTROL_DECODE_OPCODE_SHIFT)) & POWERQUAD_CONTROL_DECODE_OPCODE_MASK) - -#define POWERQUAD_CONTROL_DECODE_MACHINE_MASK (0xF0U) -#define POWERQUAD_CONTROL_DECODE_MACHINE_SHIFT (4U) -/*! DECODE_MACHINE - Decode Machine - * 0b0000..Coprocessor - * 0b0001..Matrix engine - * 0b0010..Transform engine - * 0b0011..Filter engine - * 0b0101..CORDIC engine - * 0b0100, 0b0110-0b1111.. - */ -#define POWERQUAD_CONTROL_DECODE_MACHINE(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_CONTROL_DECODE_MACHINE_SHIFT)) & POWERQUAD_CONTROL_DECODE_MACHINE_MASK) - -#define POWERQUAD_CONTROL_INST_BUSY_MASK (0x80000000U) -#define POWERQUAD_CONTROL_INST_BUSY_SHIFT (31U) -/*! INST_BUSY - Instruction Busy - * 0b1..Busy - * 0b0..Not busy - */ -#define POWERQUAD_CONTROL_INST_BUSY(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_CONTROL_INST_BUSY_SHIFT)) & POWERQUAD_CONTROL_INST_BUSY_MASK) -/*! @} */ - -/*! @name LENGTH - Length */ -/*! @{ */ - -#define POWERQUAD_LENGTH_INST_LENGTH_MASK (0xFFFFFFFFU) -#define POWERQUAD_LENGTH_INST_LENGTH_SHIFT (0U) -/*! INST_LENGTH - Instruction length */ -#define POWERQUAD_LENGTH_INST_LENGTH(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_LENGTH_INST_LENGTH_SHIFT)) & POWERQUAD_LENGTH_INST_LENGTH_MASK) -/*! @} */ - -/*! @name CPPRE - Coprocessor Prescale */ -/*! @{ */ - -#define POWERQUAD_CPPRE_CPPRE_IN_MASK (0xFFU) -#define POWERQUAD_CPPRE_CPPRE_IN_SHIFT (0U) -/*! CPPRE_IN - Prescaling Input */ -#define POWERQUAD_CPPRE_CPPRE_IN(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_CPPRE_CPPRE_IN_SHIFT)) & POWERQUAD_CPPRE_CPPRE_IN_MASK) - -#define POWERQUAD_CPPRE_CPPRE_OUT_MASK (0xFF00U) -#define POWERQUAD_CPPRE_CPPRE_OUT_SHIFT (8U) -/*! CPPRE_OUT - Postscaling Output */ -#define POWERQUAD_CPPRE_CPPRE_OUT(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_CPPRE_CPPRE_OUT_SHIFT)) & POWERQUAD_CPPRE_CPPRE_OUT_MASK) - -#define POWERQUAD_CPPRE_CPPRE_SAT_MASK (0x10000U) -#define POWERQUAD_CPPRE_CPPRE_SAT_SHIFT (16U) -/*! CPPRE_SAT - Saturation - * 0b0..No saturation - * 0b1..Forces sub-32 bit saturation - */ -#define POWERQUAD_CPPRE_CPPRE_SAT(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_CPPRE_CPPRE_SAT_SHIFT)) & POWERQUAD_CPPRE_CPPRE_SAT_MASK) - -#define POWERQUAD_CPPRE_CPPRE_SAT8_MASK (0x20000U) -#define POWERQUAD_CPPRE_CPPRE_SAT8_SHIFT (17U) -/*! CPPRE_SAT8 - Saturation 8 - * 0b0..8 bits - * 0b1..16 bits - */ -#define POWERQUAD_CPPRE_CPPRE_SAT8(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_CPPRE_CPPRE_SAT8_SHIFT)) & POWERQUAD_CPPRE_CPPRE_SAT8_MASK) -/*! @} */ - -/*! @name MISC - Miscellaneous */ -/*! @{ */ - -#define POWERQUAD_MISC_INST_MISC_MASK (0xFFFFFFFFU) -#define POWERQUAD_MISC_INST_MISC_SHIFT (0U) -/*! INST_MISC - Scaling Factor */ -#define POWERQUAD_MISC_INST_MISC(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_MISC_INST_MISC_SHIFT)) & POWERQUAD_MISC_INST_MISC_MASK) -/*! @} */ - -/*! @name CURSORY - Cursory */ -/*! @{ */ - -#define POWERQUAD_CURSORY_CURSORY_MASK (0x1U) -#define POWERQUAD_CURSORY_CURSORY_SHIFT (0U) -/*! CURSORY - Cursory Mode - * 0b0..Disable cursory mode, full floating-point accuracy (24-bit mantissa + 2 bits before rounding). - * 0b1..Enable cursory Mode, 16-bit mantissa (bottom bits are zeroed for inputs and outputs of MACs). - */ -#define POWERQUAD_CURSORY_CURSORY(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_CURSORY_CURSORY_SHIFT)) & POWERQUAD_CURSORY_CURSORY_MASK) -/*! @} */ - -/*! @name CORDIC_X - CORDIC Input X */ -/*! @{ */ - -#define POWERQUAD_CORDIC_X_CORDIC_X_MASK (0xFFFFFFFFU) -#define POWERQUAD_CORDIC_X_CORDIC_X_SHIFT (0U) -/*! CORDIC_X - CORDIC Input X */ -#define POWERQUAD_CORDIC_X_CORDIC_X(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_CORDIC_X_CORDIC_X_SHIFT)) & POWERQUAD_CORDIC_X_CORDIC_X_MASK) -/*! @} */ - -/*! @name CORDIC_Y - CORDIC Input Y */ -/*! @{ */ - -#define POWERQUAD_CORDIC_Y_CORDIC_Y_MASK (0xFFFFFFFFU) -#define POWERQUAD_CORDIC_Y_CORDIC_Y_SHIFT (0U) -/*! CORDIC_Y - CORDIC Input Y */ -#define POWERQUAD_CORDIC_Y_CORDIC_Y(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_CORDIC_Y_CORDIC_Y_SHIFT)) & POWERQUAD_CORDIC_Y_CORDIC_Y_MASK) -/*! @} */ - -/*! @name CORDIC_Z - CORDIC Input Z */ -/*! @{ */ - -#define POWERQUAD_CORDIC_Z_CORDIC_Z_MASK (0xFFFFFFFFU) -#define POWERQUAD_CORDIC_Z_CORDIC_Z_SHIFT (0U) -/*! CORDIC_Z - CORDIC Input Z */ -#define POWERQUAD_CORDIC_Z_CORDIC_Z(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_CORDIC_Z_CORDIC_Z_SHIFT)) & POWERQUAD_CORDIC_Z_CORDIC_Z_MASK) -/*! @} */ - -/*! @name ERRSTAT - Error Status */ -/*! @{ */ - -#define POWERQUAD_ERRSTAT_OVERFLOW_MASK (0x1U) -#define POWERQUAD_ERRSTAT_OVERFLOW_SHIFT (0U) -/*! OVERFLOW - Floating-point Overflow - * 0b0..No error - * 0b1..Error on floating-point overflow - */ -#define POWERQUAD_ERRSTAT_OVERFLOW(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_ERRSTAT_OVERFLOW_SHIFT)) & POWERQUAD_ERRSTAT_OVERFLOW_MASK) - -#define POWERQUAD_ERRSTAT_NAN_MASK (0x2U) -#define POWERQUAD_ERRSTAT_NAN_SHIFT (1U) -/*! NAN - Floating-Point Not-a-Number (NaN) - * 0b0..No error - * 0b1..Error on floating-point NaN - */ -#define POWERQUAD_ERRSTAT_NAN(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_ERRSTAT_NAN_SHIFT)) & POWERQUAD_ERRSTAT_NAN_MASK) - -#define POWERQUAD_ERRSTAT_FIXEDOVERFLOW_MASK (0x4U) -#define POWERQUAD_ERRSTAT_FIXEDOVERFLOW_SHIFT (2U) -/*! FIXEDOVERFLOW - Fixed-point Overflow - * 0b0..No error - * 0b1..Error on fixed-point overflow - */ -#define POWERQUAD_ERRSTAT_FIXEDOVERFLOW(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_ERRSTAT_FIXEDOVERFLOW_SHIFT)) & POWERQUAD_ERRSTAT_FIXEDOVERFLOW_MASK) - -#define POWERQUAD_ERRSTAT_UNDERFLOW_MASK (0x8U) -#define POWERQUAD_ERRSTAT_UNDERFLOW_SHIFT (3U) -/*! UNDERFLOW - Underflow - * 0b0..No error - * 0b1..Error on underflow - */ -#define POWERQUAD_ERRSTAT_UNDERFLOW(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_ERRSTAT_UNDERFLOW_SHIFT)) & POWERQUAD_ERRSTAT_UNDERFLOW_MASK) - -#define POWERQUAD_ERRSTAT_BUSERROR_MASK (0x10U) -#define POWERQUAD_ERRSTAT_BUSERROR_SHIFT (4U) -/*! BUSERROR - Bus Error - * 0b0..No error - * 0b1..Error on bus - */ -#define POWERQUAD_ERRSTAT_BUSERROR(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_ERRSTAT_BUSERROR_SHIFT)) & POWERQUAD_ERRSTAT_BUSERROR_MASK) -/*! @} */ - -/*! @name INTREN - Interrupt Enable */ -/*! @{ */ - -#define POWERQUAD_INTREN_INTR_OFLOW_MASK (0x1U) -#define POWERQUAD_INTREN_INTR_OFLOW_SHIFT (0U) -/*! INTR_OFLOW - Interrupt Floating-point Overflow - * 0b0..Disable interrupt - * 0b1..Enable interrupt - */ -#define POWERQUAD_INTREN_INTR_OFLOW(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_INTREN_INTR_OFLOW_SHIFT)) & POWERQUAD_INTREN_INTR_OFLOW_MASK) - -#define POWERQUAD_INTREN_INTR_NAN_MASK (0x2U) -#define POWERQUAD_INTREN_INTR_NAN_SHIFT (1U) -/*! INTR_NAN - Interrupt Floating-point NaN - * 0b0..Disable interrupt - * 0b1..Enable interrupt - */ -#define POWERQUAD_INTREN_INTR_NAN(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_INTREN_INTR_NAN_SHIFT)) & POWERQUAD_INTREN_INTR_NAN_MASK) - -#define POWERQUAD_INTREN_INTR_FIXED_MASK (0x4U) -#define POWERQUAD_INTREN_INTR_FIXED_SHIFT (2U) -/*! INTR_FIXED - Interrupt on Fixed-point Overflow - * 0b0..Disable interrupt - * 0b1..Enable interrupt - */ -#define POWERQUAD_INTREN_INTR_FIXED(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_INTREN_INTR_FIXED_SHIFT)) & POWERQUAD_INTREN_INTR_FIXED_MASK) - -#define POWERQUAD_INTREN_INTR_UFLOW_MASK (0x8U) -#define POWERQUAD_INTREN_INTR_UFLOW_SHIFT (3U) -/*! INTR_UFLOW - Interrupt on Underflow - * 0b0..Disable interrupt - * 0b1..Enable interrupt - */ -#define POWERQUAD_INTREN_INTR_UFLOW(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_INTREN_INTR_UFLOW_SHIFT)) & POWERQUAD_INTREN_INTR_UFLOW_MASK) - -#define POWERQUAD_INTREN_INTR_BERR_MASK (0x10U) -#define POWERQUAD_INTREN_INTR_BERR_SHIFT (4U) -/*! INTR_BERR - Interrupt on AHBM Bus Error - * 0b0..Disable interrupt - * 0b1..Enable interrupt - */ -#define POWERQUAD_INTREN_INTR_BERR(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_INTREN_INTR_BERR_SHIFT)) & POWERQUAD_INTREN_INTR_BERR_MASK) - -#define POWERQUAD_INTREN_INTR_COMP_MASK (0x80U) -#define POWERQUAD_INTREN_INTR_COMP_SHIFT (7U) -/*! INTR_COMP - Interrupt on Instruction Completion - * 0b0..Disable interrupt - * 0b1..Enable interrupt - */ -#define POWERQUAD_INTREN_INTR_COMP(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_INTREN_INTR_COMP_SHIFT)) & POWERQUAD_INTREN_INTR_COMP_MASK) -/*! @} */ - -/*! @name EVENTEN - Event Enable */ -/*! @{ */ - -#define POWERQUAD_EVENTEN_EVENT_OFLOW_MASK (0x1U) -#define POWERQUAD_EVENTEN_EVENT_OFLOW_SHIFT (0U) -/*! EVENT_OFLOW - Event Trigger on Floating-point Overflow - * 0b0..Disable event trigger - * 0b1..Enable event trigger - */ -#define POWERQUAD_EVENTEN_EVENT_OFLOW(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_EVENTEN_EVENT_OFLOW_SHIFT)) & POWERQUAD_EVENTEN_EVENT_OFLOW_MASK) - -#define POWERQUAD_EVENTEN_EVENT_NAN_MASK (0x2U) -#define POWERQUAD_EVENTEN_EVENT_NAN_SHIFT (1U) -/*! EVENT_NAN - Event Trigger on Floating-Point NaN - * 0b0..Disable event trigger - * 0b1..Enable event trigger - */ -#define POWERQUAD_EVENTEN_EVENT_NAN(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_EVENTEN_EVENT_NAN_SHIFT)) & POWERQUAD_EVENTEN_EVENT_NAN_MASK) - -#define POWERQUAD_EVENTEN_EVENT_FIXED_MASK (0x4U) -#define POWERQUAD_EVENTEN_EVENT_FIXED_SHIFT (2U) -/*! EVENT_FIXED - Event Trigger on Fixed-point Overflow - * 0b0..Disable event trigger - * 0b1..Enable event trigger - */ -#define POWERQUAD_EVENTEN_EVENT_FIXED(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_EVENTEN_EVENT_FIXED_SHIFT)) & POWERQUAD_EVENTEN_EVENT_FIXED_MASK) - -#define POWERQUAD_EVENTEN_EVENT_UFLOW_MASK (0x8U) -#define POWERQUAD_EVENTEN_EVENT_UFLOW_SHIFT (3U) -/*! EVENT_UFLOW - Event Trigger on Underflow - * 0b0..Disable event trigger - * 0b1..Enable event trigger - */ -#define POWERQUAD_EVENTEN_EVENT_UFLOW(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_EVENTEN_EVENT_UFLOW_SHIFT)) & POWERQUAD_EVENTEN_EVENT_UFLOW_MASK) - -#define POWERQUAD_EVENTEN_EVENT_BERR_MASK (0x10U) -#define POWERQUAD_EVENTEN_EVENT_BERR_SHIFT (4U) -/*! EVENT_BERR - Event Trigger on AHBM Bus Error - * 0b0..Disable event trigger - * 0b1..Enable event trigger - */ -#define POWERQUAD_EVENTEN_EVENT_BERR(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_EVENTEN_EVENT_BERR_SHIFT)) & POWERQUAD_EVENTEN_EVENT_BERR_MASK) - -#define POWERQUAD_EVENTEN_EVENT_COMP_MASK (0x80U) -#define POWERQUAD_EVENTEN_EVENT_COMP_SHIFT (7U) -/*! EVENT_COMP - Event Trigger on Instruction Completion - * 0b0..Disable event trigger - * 0b1..Enable event trigger - */ -#define POWERQUAD_EVENTEN_EVENT_COMP(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_EVENTEN_EVENT_COMP_SHIFT)) & POWERQUAD_EVENTEN_EVENT_COMP_MASK) -/*! @} */ - -/*! @name INTRSTAT - Interrupt Status */ -/*! @{ */ - -#define POWERQUAD_INTRSTAT_INTR_STAT_MASK (0x1U) -#define POWERQUAD_INTRSTAT_INTR_STAT_SHIFT (0U) -/*! INTR_STAT - Interrupt Status - * 0b0..No new interrupt - * 0b1..Interrupt captured - */ -#define POWERQUAD_INTRSTAT_INTR_STAT(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_INTRSTAT_INTR_STAT_SHIFT)) & POWERQUAD_INTRSTAT_INTR_STAT_MASK) -/*! @} */ - -/*! @name GPREG - General Purpose Register Bank n */ -/*! @{ */ - -#define POWERQUAD_GPREG_GPREG_MASK (0xFFFFFFFFU) -#define POWERQUAD_GPREG_GPREG_SHIFT (0U) -/*! GPREG - General Purpose Bank */ -#define POWERQUAD_GPREG_GPREG(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_GPREG_GPREG_SHIFT)) & POWERQUAD_GPREG_GPREG_MASK) -/*! @} */ - -/* The count of POWERQUAD_GPREG */ -#define POWERQUAD_GPREG_COUNT (16U) - -/*! @name COMPREGS_COMPREG - Compute Register Bank n */ -/*! @{ */ - -#define POWERQUAD_COMPREGS_COMPREG_COMPREG_MASK (0xFFFFFFFFU) -#define POWERQUAD_COMPREGS_COMPREG_COMPREG_SHIFT (0U) -/*! COMPREG - Compute bank */ -#define POWERQUAD_COMPREGS_COMPREG_COMPREG(x) (((uint32_t)(((uint32_t)(x)) << POWERQUAD_COMPREGS_COMPREG_COMPREG_SHIFT)) & POWERQUAD_COMPREGS_COMPREG_COMPREG_MASK) -/*! @} */ - -/* The count of POWERQUAD_COMPREGS_COMPREG */ -#define POWERQUAD_COMPREGS_COMPREG_COUNT (8U) - - -/*! - * @} - */ /* end of group POWERQUAD_Register_Masks */ - - -/* POWERQUAD - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral POWERQUAD base address */ - #define POWERQUAD_BASE (0x500BF000u) - /** Peripheral POWERQUAD base address */ - #define POWERQUAD_BASE_NS (0x400BF000u) - /** Peripheral POWERQUAD base pointer */ - #define POWERQUAD ((POWERQUAD_Type *)POWERQUAD_BASE) - /** Peripheral POWERQUAD base pointer */ - #define POWERQUAD_NS ((POWERQUAD_Type *)POWERQUAD_BASE_NS) - /** Array initializer of POWERQUAD peripheral base addresses */ - #define POWERQUAD_BASE_ADDRS { POWERQUAD_BASE } - /** Array initializer of POWERQUAD peripheral base pointers */ - #define POWERQUAD_BASE_PTRS { POWERQUAD } - /** Array initializer of POWERQUAD peripheral base addresses */ - #define POWERQUAD_BASE_ADDRS_NS { POWERQUAD_BASE_NS } - /** Array initializer of POWERQUAD peripheral base pointers */ - #define POWERQUAD_BASE_PTRS_NS { POWERQUAD_NS } -#else - /** Peripheral POWERQUAD base address */ - #define POWERQUAD_BASE (0x400BF000u) - /** Peripheral POWERQUAD base pointer */ - #define POWERQUAD ((POWERQUAD_Type *)POWERQUAD_BASE) - /** Array initializer of POWERQUAD peripheral base addresses */ - #define POWERQUAD_BASE_ADDRS { POWERQUAD_BASE } - /** Array initializer of POWERQUAD peripheral base pointers */ - #define POWERQUAD_BASE_PTRS { POWERQUAD } -#endif -/** Interrupt vectors for the POWERQUAD peripheral type */ -#define POWERQUAD_IRQS { PQ_IRQn } - -/*! - * @} - */ /* end of group POWERQUAD_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- PUF Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PUF_Peripheral_Access_Layer PUF Peripheral Access Layer - * @{ - */ - -/** PUF - Register Layout Typedef */ -typedef struct { - __IO uint32_t CR; /**< Control, offset: 0x0 */ - __I uint32_t ORR; /**< Operation Result, offset: 0x4 */ - __IO uint32_t SR; /**< Status, offset: 0x8 */ - __I uint32_t AR; /**< Allow, offset: 0xC */ - __IO uint32_t IER; /**< Interrupt Enable, offset: 0x10 */ - __IO uint32_t IMR; /**< Interrupt Mask, offset: 0x14 */ - __IO uint32_t ISR; /**< Interrupt Status, offset: 0x18 */ - uint8_t RESERVED_0[4]; - __IO uint32_t DATA_DEST; /**< Data Destination, offset: 0x20 */ - __IO uint32_t DATA_SRC; /**< Data Source, offset: 0x24 */ - uint8_t RESERVED_1[120]; - __O uint32_t DIR; /**< Data Input, offset: 0xA0 */ - uint8_t RESERVED_2[4]; - __I uint32_t DOR; /**< Data Output, offset: 0xA8 */ - uint8_t RESERVED_3[20]; - __IO uint32_t MISC; /**< Miscellaneous, offset: 0xC0 */ - uint8_t RESERVED_4[12]; - __IO uint32_t IF_SR; /**< Interface Status, offset: 0xD0 */ - uint8_t RESERVED_5[8]; - __I uint32_t PSR; /**< PUF Score, offset: 0xDC */ - __I uint32_t HW_RUC0; /**< Hardware Restrict User Context 0, offset: 0xE0 */ - __I uint32_t HW_RUC1; /**< Hardware Restrict User Context 1, offset: 0xE4 */ - uint8_t RESERVED_6[12]; - __I uint32_t HW_INFO; /**< Hardware Information, offset: 0xF4 */ - __I uint32_t HW_ID; /**< Hardware Identifier, offset: 0xF8 */ - __I uint32_t HW_VER; /**< Hardware Version, offset: 0xFC */ - __IO uint32_t CONFIG; /**< PUF command blocking configuration, offset: 0x100 */ - __IO uint32_t SEC_LOCK; /**< Security level lock, offset: 0x104 */ - __IO uint32_t APP_CTX_MASK; /**< Application defined context mask, offset: 0x108 */ - uint8_t RESERVED_7[500]; - __IO uint32_t SRAM_CFG; /**< SRAM Configuration, offset: 0x300 */ - __I uint32_t SRAM_STATUS; /**< Status, offset: 0x304 */ - uint8_t RESERVED_8[208]; - __O uint32_t SRAM_INT_CLR_ENABLE; /**< Interrupt Enable Clear, offset: 0x3D8 */ - __O uint32_t SRAM_INT_SET_ENABLE; /**< Interrupt Enable Set, offset: 0x3DC */ - __I uint32_t SRAM_INT_STATUS; /**< Interrupt Status, offset: 0x3E0 */ - __I uint32_t SRAM_INT_ENABLE; /**< Interrupt Enable, offset: 0x3E4 */ - __O uint32_t SRAM_INT_CLR_STATUS; /**< Interrupt Status Clear, offset: 0x3E8 */ - __O uint32_t SRAM_INT_SET_STATUS; /**< Interrupt Status set, offset: 0x3EC */ -} PUF_Type; - -/* ---------------------------------------------------------------------------- - -- PUF Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PUF_Register_Masks PUF Register Masks - * @{ - */ - -/*! @name CR - Control */ -/*! @{ */ - -#define PUF_CR_ZEROIZE_MASK (0x1U) -#define PUF_CR_ZEROIZE_SHIFT (0U) -/*! ZEROIZE - Zeroize operation */ -#define PUF_CR_ZEROIZE(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_ZEROIZE_SHIFT)) & PUF_CR_ZEROIZE_MASK) - -#define PUF_CR_ENROLL_MASK (0x2U) -#define PUF_CR_ENROLL_SHIFT (1U) -/*! ENROLL - Enroll operation */ -#define PUF_CR_ENROLL(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_ENROLL_SHIFT)) & PUF_CR_ENROLL_MASK) - -#define PUF_CR_START_MASK (0x4U) -#define PUF_CR_START_SHIFT (2U) -/*! START - Start operation */ -#define PUF_CR_START(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_START_SHIFT)) & PUF_CR_START_MASK) - -#define PUF_CR_RECONSTRUCT_MASK (0x8U) -#define PUF_CR_RECONSTRUCT_SHIFT (3U) -/*! RECONSTRUCT - Reconstruct operation */ -#define PUF_CR_RECONSTRUCT(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_RECONSTRUCT_SHIFT)) & PUF_CR_RECONSTRUCT_MASK) - -#define PUF_CR_STOP_MASK (0x20U) -#define PUF_CR_STOP_SHIFT (5U) -/*! STOP - Stop operation */ -#define PUF_CR_STOP(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_STOP_SHIFT)) & PUF_CR_STOP_MASK) - -#define PUF_CR_GET_KEY_MASK (0x40U) -#define PUF_CR_GET_KEY_SHIFT (6U) -/*! GET_KEY - Get Key operation */ -#define PUF_CR_GET_KEY(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_GET_KEY_SHIFT)) & PUF_CR_GET_KEY_MASK) - -#define PUF_CR_UNWRAP_MASK (0x80U) -#define PUF_CR_UNWRAP_SHIFT (7U) -/*! UNWRAP - Unwrap operation */ -#define PUF_CR_UNWRAP(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_UNWRAP_SHIFT)) & PUF_CR_UNWRAP_MASK) - -#define PUF_CR_WRAP_GENERATED_RANDOM_MASK (0x100U) -#define PUF_CR_WRAP_GENERATED_RANDOM_SHIFT (8U) -/*! WRAP_GENERATED_RANDOM - Wrap Generated Random operation */ -#define PUF_CR_WRAP_GENERATED_RANDOM(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_WRAP_GENERATED_RANDOM_SHIFT)) & PUF_CR_WRAP_GENERATED_RANDOM_MASK) - -#define PUF_CR_WRAP_MASK (0x200U) -#define PUF_CR_WRAP_SHIFT (9U) -/*! WRAP - Wrap operation */ -#define PUF_CR_WRAP(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_WRAP_SHIFT)) & PUF_CR_WRAP_MASK) - -#define PUF_CR_GENERATE_RANDOM_MASK (0x8000U) -#define PUF_CR_GENERATE_RANDOM_SHIFT (15U) -/*! GENERATE_RANDOM - Generate Random operation */ -#define PUF_CR_GENERATE_RANDOM(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_GENERATE_RANDOM_SHIFT)) & PUF_CR_GENERATE_RANDOM_MASK) - -#define PUF_CR_TEST_MEMORY_MASK (0x40000000U) -#define PUF_CR_TEST_MEMORY_SHIFT (30U) -/*! TEST_MEMORY - Test memory operation */ -#define PUF_CR_TEST_MEMORY(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_TEST_MEMORY_SHIFT)) & PUF_CR_TEST_MEMORY_MASK) - -#define PUF_CR_TEST_PUF_MASK (0x80000000U) -#define PUF_CR_TEST_PUF_SHIFT (31U) -/*! TEST_PUF - Test PUF operation */ -#define PUF_CR_TEST_PUF(x) (((uint32_t)(((uint32_t)(x)) << PUF_CR_TEST_PUF_SHIFT)) & PUF_CR_TEST_PUF_MASK) -/*! @} */ - -/*! @name ORR - Operation Result */ -/*! @{ */ - -#define PUF_ORR_RESULT_CODE_MASK (0xFFU) -#define PUF_ORR_RESULT_CODE_SHIFT (0U) -/*! RESULT_CODE - Result code of last operation - * 0b00000000..Indicates that the last operation was successful or operation is in progress. - * 0b11110000..Indicates that the AC is not for the current product/version. - * 0b11110001..Indicates that the AC in the second phase is not for the current product/version. - * 0b11110010..Indicates that the AC is corrupted. - * 0b11110011..Indicates that the AC in the second phase is corrupted. - * 0b11110100..Indicates that the authentication of the provided AC failed. - * 0b11110101..Indicates that the authentication of the provided AC failed in the second phase. - * 0b11110110..Indicates that the SRAM PUF quality verification fails. - * 0b11110111..Indicates that the incorrect or unsupported context is provided. - * 0b11111000..Indicates that a data destination was set that is not allowed according to other settings and the current PUF state. - * 0b11111111..Indicates that the PUF SRAM access has failed. - */ -#define PUF_ORR_RESULT_CODE(x) (((uint32_t)(((uint32_t)(x)) << PUF_ORR_RESULT_CODE_SHIFT)) & PUF_ORR_RESULT_CODE_MASK) - -#define PUF_ORR_LAST_OPERATION_MASK (0xFF000000U) -#define PUF_ORR_LAST_OPERATION_SHIFT (24U) -/*! LAST_OPERATION - Last operation type - * 0b00000000..Indicates that the operation is in progress. - * 0b00000001..Indicates that the last operation was Enroll. - * 0b00000010..Indicates that the last operation was Start. - * 0b00000011..Indicates that the last operation was Reconstruct - * 0b00000101..Indicates that the last operation was Stop. - * 0b00000110..Indicates that the last operation was Get Key. - * 0b00000111..Indicates that the last operation was Unwrap. - * 0b00001000..Indicates that the last operation was Wrap Generated Random. - * 0b00001001..Indicates that the last operation was Wrap. - * 0b00001111..Indicates that the last operation was Generate Random. - * 0b00011110..Indicates that the last operation was Test Memory. - * 0b00011111..Indicates that the last operation was Test PUF. - * 0b00100000..Indicates that the last operation was Initialization. - * 0b00101111..Indicates that the last operation was Zeroize. - */ -#define PUF_ORR_LAST_OPERATION(x) (((uint32_t)(((uint32_t)(x)) << PUF_ORR_LAST_OPERATION_SHIFT)) & PUF_ORR_LAST_OPERATION_MASK) -/*! @} */ - -/*! @name SR - Status */ -/*! @{ */ - -#define PUF_SR_BUSY_MASK (0x1U) -#define PUF_SR_BUSY_SHIFT (0U) -/*! BUSY - Operation in progress */ -#define PUF_SR_BUSY(x) (((uint32_t)(((uint32_t)(x)) << PUF_SR_BUSY_SHIFT)) & PUF_SR_BUSY_MASK) - -#define PUF_SR_OK_MASK (0x2U) -#define PUF_SR_OK_SHIFT (1U) -/*! OK - Last operation successful */ -#define PUF_SR_OK(x) (((uint32_t)(((uint32_t)(x)) << PUF_SR_OK_SHIFT)) & PUF_SR_OK_MASK) - -#define PUF_SR_ERROR_MASK (0x4U) -#define PUF_SR_ERROR_SHIFT (2U) -/*! ERROR - Last operation failed */ -#define PUF_SR_ERROR(x) (((uint32_t)(((uint32_t)(x)) << PUF_SR_ERROR_SHIFT)) & PUF_SR_ERROR_MASK) - -#define PUF_SR_ZEROIZED_MASK (0x8U) -#define PUF_SR_ZEROIZED_SHIFT (3U) -/*! ZEROIZED - Zeroized or Locked state */ -#define PUF_SR_ZEROIZED(x) (((uint32_t)(((uint32_t)(x)) << PUF_SR_ZEROIZED_SHIFT)) & PUF_SR_ZEROIZED_MASK) - -#define PUF_SR_REJECTED_MASK (0x10U) -#define PUF_SR_REJECTED_SHIFT (4U) -/*! REJECTED - Operation rejected */ -#define PUF_SR_REJECTED(x) (((uint32_t)(((uint32_t)(x)) << PUF_SR_REJECTED_SHIFT)) & PUF_SR_REJECTED_MASK) - -#define PUF_SR_DI_REQUEST_MASK (0x20U) -#define PUF_SR_DI_REQUEST_SHIFT (5U) -/*! DI_REQUEST - Indicates the request for data in transfer via the DIR register */ -#define PUF_SR_DI_REQUEST(x) (((uint32_t)(((uint32_t)(x)) << PUF_SR_DI_REQUEST_SHIFT)) & PUF_SR_DI_REQUEST_MASK) - -#define PUF_SR_DO_REQUEST_MASK (0x40U) -#define PUF_SR_DO_REQUEST_SHIFT (6U) -/*! DO_REQUEST - Indicates the request for data out transfer via the DOR register */ -#define PUF_SR_DO_REQUEST(x) (((uint32_t)(((uint32_t)(x)) << PUF_SR_DO_REQUEST_SHIFT)) & PUF_SR_DO_REQUEST_MASK) -/*! @} */ - -/*! @name AR - Allow */ -/*! @{ */ - -#define PUF_AR_ALLOW_ENROLL_MASK (0x2U) -#define PUF_AR_ALLOW_ENROLL_SHIFT (1U) -/*! ALLOW_ENROLL - Enroll operation - * 0b0..Indicates that the Enroll operation is not allowed - * 0b1..Indicates that the Enroll operation is allowed - */ -#define PUF_AR_ALLOW_ENROLL(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_ENROLL_SHIFT)) & PUF_AR_ALLOW_ENROLL_MASK) - -#define PUF_AR_ALLOW_START_MASK (0x4U) -#define PUF_AR_ALLOW_START_SHIFT (2U) -/*! ALLOW_START - Start operation - * 0b0..Indicates that the Start operation is not allowed - * 0b1..Indicates that the Start operation is allowed - */ -#define PUF_AR_ALLOW_START(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_START_SHIFT)) & PUF_AR_ALLOW_START_MASK) - -#define PUF_AR_ALLOW_RECONSTRUCT_MASK (0x8U) -#define PUF_AR_ALLOW_RECONSTRUCT_SHIFT (3U) -/*! ALLOW_RECONSTRUCT - Reconstruct operation - * 0b0..Indicates that the Reconstruct operation is not allowed - * 0b1..Indicates that the Reconstruct operation is allowed - */ -#define PUF_AR_ALLOW_RECONSTRUCT(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_RECONSTRUCT_SHIFT)) & PUF_AR_ALLOW_RECONSTRUCT_MASK) - -#define PUF_AR_ALLOW_STOP_MASK (0x20U) -#define PUF_AR_ALLOW_STOP_SHIFT (5U) -/*! ALLOW_STOP - Stop operation - * 0b0..Indicates that the Stop operation is not allowed - * 0b1..Indicates that the Stop operation is allowed - */ -#define PUF_AR_ALLOW_STOP(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_STOP_SHIFT)) & PUF_AR_ALLOW_STOP_MASK) - -#define PUF_AR_ALLOW_GET_KEY_MASK (0x40U) -#define PUF_AR_ALLOW_GET_KEY_SHIFT (6U) -/*! ALLOW_GET_KEY - Get Key operation - * 0b0..Indicates that the Get Key operation is not allowed - * 0b1..Indicates that the Get Key operation is allowed - */ -#define PUF_AR_ALLOW_GET_KEY(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_GET_KEY_SHIFT)) & PUF_AR_ALLOW_GET_KEY_MASK) - -#define PUF_AR_ALLOW_UNWRAP_MASK (0x80U) -#define PUF_AR_ALLOW_UNWRAP_SHIFT (7U) -/*! ALLOW_UNWRAP - Unwrap operation - * 0b0..Indicates that the Unwrap operation is not allowed - * 0b1..Indicates that the Unwrap operation is allowed - */ -#define PUF_AR_ALLOW_UNWRAP(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_UNWRAP_SHIFT)) & PUF_AR_ALLOW_UNWRAP_MASK) - -#define PUF_AR_ALLOW_WRAP_GENERATED_RANDOM_MASK (0x100U) -#define PUF_AR_ALLOW_WRAP_GENERATED_RANDOM_SHIFT (8U) -/*! ALLOW_WRAP_GENERATED_RANDOM - Wrap Generated Random operation - * 0b0..Indicates that the Wrap Generated Random operation is not allowed - * 0b1..Indicates that the Wrap Generated Random operation is allowed - */ -#define PUF_AR_ALLOW_WRAP_GENERATED_RANDOM(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_WRAP_GENERATED_RANDOM_SHIFT)) & PUF_AR_ALLOW_WRAP_GENERATED_RANDOM_MASK) - -#define PUF_AR_ALLOW_WRAP_MASK (0x200U) -#define PUF_AR_ALLOW_WRAP_SHIFT (9U) -/*! ALLOW_WRAP - Wrap operation - * 0b0..Indicates that the Wrap operation is not allowed - * 0b1..Indicates that the Wrap operation is allowed - */ -#define PUF_AR_ALLOW_WRAP(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_WRAP_SHIFT)) & PUF_AR_ALLOW_WRAP_MASK) - -#define PUF_AR_ALLOW_GENERATE_RANDOM_MASK (0x8000U) -#define PUF_AR_ALLOW_GENERATE_RANDOM_SHIFT (15U) -/*! ALLOW_GENERATE_RANDOM - Generate Random operation - * 0b0..Indicates that the Generate Random operation is not allowed - * 0b1..Indicates that the Generate Random operation is allowed - */ -#define PUF_AR_ALLOW_GENERATE_RANDOM(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_GENERATE_RANDOM_SHIFT)) & PUF_AR_ALLOW_GENERATE_RANDOM_MASK) - -#define PUF_AR_ALLOW_TEST_MEMORY_MASK (0x40000000U) -#define PUF_AR_ALLOW_TEST_MEMORY_SHIFT (30U) -/*! ALLOW_TEST_MEMORY - * 0b0..Indicates that the Test Memory operation is not allowed - * 0b1..Indicates that the Test Memory operation is allowed - */ -#define PUF_AR_ALLOW_TEST_MEMORY(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_TEST_MEMORY_SHIFT)) & PUF_AR_ALLOW_TEST_MEMORY_MASK) - -#define PUF_AR_ALLOW_TEST_PUF_MASK (0x80000000U) -#define PUF_AR_ALLOW_TEST_PUF_SHIFT (31U) -/*! ALLOW_TEST_PUF - Test PUF operation - * 0b0..Test PUF operation is not allowed - * 0b1..Test PUF operation is allowed - */ -#define PUF_AR_ALLOW_TEST_PUF(x) (((uint32_t)(((uint32_t)(x)) << PUF_AR_ALLOW_TEST_PUF_SHIFT)) & PUF_AR_ALLOW_TEST_PUF_MASK) -/*! @} */ - -/*! @name IER - Interrupt Enable */ -/*! @{ */ - -#define PUF_IER_INT_EN_MASK (0x1U) -#define PUF_IER_INT_EN_SHIFT (0U) -/*! INT_EN - Interrupt enable - * 0b0..Disables all PUF interrupts - * 0b1..Enables all PUF interrupts that are enabled in the Interrupt Mask register - */ -#define PUF_IER_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << PUF_IER_INT_EN_SHIFT)) & PUF_IER_INT_EN_MASK) -/*! @} */ - -/*! @name IMR - Interrupt Mask */ -/*! @{ */ - -#define PUF_IMR_INT_EN_BUSY_MASK (0x1U) -#define PUF_IMR_INT_EN_BUSY_SHIFT (0U) -/*! INT_EN_BUSY - Busy interrupt */ -#define PUF_IMR_INT_EN_BUSY(x) (((uint32_t)(((uint32_t)(x)) << PUF_IMR_INT_EN_BUSY_SHIFT)) & PUF_IMR_INT_EN_BUSY_MASK) - -#define PUF_IMR_INT_EN_OK_MASK (0x2U) -#define PUF_IMR_INT_EN_OK_SHIFT (1U) -/*! INT_EN_OK - Ok interrupt */ -#define PUF_IMR_INT_EN_OK(x) (((uint32_t)(((uint32_t)(x)) << PUF_IMR_INT_EN_OK_SHIFT)) & PUF_IMR_INT_EN_OK_MASK) - -#define PUF_IMR_INT_EN_ERROR_MASK (0x4U) -#define PUF_IMR_INT_EN_ERROR_SHIFT (2U) -/*! INT_EN_ERROR - Error interrupt */ -#define PUF_IMR_INT_EN_ERROR(x) (((uint32_t)(((uint32_t)(x)) << PUF_IMR_INT_EN_ERROR_SHIFT)) & PUF_IMR_INT_EN_ERROR_MASK) - -#define PUF_IMR_INT_EN_ZEROIZED_MASK (0x8U) -#define PUF_IMR_INT_EN_ZEROIZED_SHIFT (3U) -/*! INT_EN_ZEROIZED - Zeroized interrupt */ -#define PUF_IMR_INT_EN_ZEROIZED(x) (((uint32_t)(((uint32_t)(x)) << PUF_IMR_INT_EN_ZEROIZED_SHIFT)) & PUF_IMR_INT_EN_ZEROIZED_MASK) - -#define PUF_IMR_INT_EN_REJECTED_MASK (0x10U) -#define PUF_IMR_INT_EN_REJECTED_SHIFT (4U) -/*! INT_EN_REJECTED - Rejected interrupt */ -#define PUF_IMR_INT_EN_REJECTED(x) (((uint32_t)(((uint32_t)(x)) << PUF_IMR_INT_EN_REJECTED_SHIFT)) & PUF_IMR_INT_EN_REJECTED_MASK) - -#define PUF_IMR_INT_EN_DI_REQUEST_MASK (0x20U) -#define PUF_IMR_INT_EN_DI_REQUEST_SHIFT (5U) -/*! INT_EN_DI_REQUEST - Data in request interrupt */ -#define PUF_IMR_INT_EN_DI_REQUEST(x) (((uint32_t)(((uint32_t)(x)) << PUF_IMR_INT_EN_DI_REQUEST_SHIFT)) & PUF_IMR_INT_EN_DI_REQUEST_MASK) - -#define PUF_IMR_INT_EN_DO_REQUEST_MASK (0x40U) -#define PUF_IMR_INT_EN_DO_REQUEST_SHIFT (6U) -/*! INT_EN_DO_REQUEST - Data out request interrupt */ -#define PUF_IMR_INT_EN_DO_REQUEST(x) (((uint32_t)(((uint32_t)(x)) << PUF_IMR_INT_EN_DO_REQUEST_SHIFT)) & PUF_IMR_INT_EN_DO_REQUEST_MASK) -/*! @} */ - -/*! @name ISR - Interrupt Status */ -/*! @{ */ - -#define PUF_ISR_INT_BUSY_MASK (0x1U) -#define PUF_ISR_INT_BUSY_SHIFT (0U) -/*! INT_BUSY - Negative edge occurred on Busy */ -#define PUF_ISR_INT_BUSY(x) (((uint32_t)(((uint32_t)(x)) << PUF_ISR_INT_BUSY_SHIFT)) & PUF_ISR_INT_BUSY_MASK) - -#define PUF_ISR_INT_OK_MASK (0x2U) -#define PUF_ISR_INT_OK_SHIFT (1U) -/*! INT_OK - Positive edge occurred on Ok */ -#define PUF_ISR_INT_OK(x) (((uint32_t)(((uint32_t)(x)) << PUF_ISR_INT_OK_SHIFT)) & PUF_ISR_INT_OK_MASK) - -#define PUF_ISR_INT_ERROR_MASK (0x4U) -#define PUF_ISR_INT_ERROR_SHIFT (2U) -/*! INT_ERROR - Positive edge occurred on Error */ -#define PUF_ISR_INT_ERROR(x) (((uint32_t)(((uint32_t)(x)) << PUF_ISR_INT_ERROR_SHIFT)) & PUF_ISR_INT_ERROR_MASK) - -#define PUF_ISR_INT_ZEROIZED_MASK (0x8U) -#define PUF_ISR_INT_ZEROIZED_SHIFT (3U) -/*! INT_ZEROIZED - Positive edge occurred on Zeroized */ -#define PUF_ISR_INT_ZEROIZED(x) (((uint32_t)(((uint32_t)(x)) << PUF_ISR_INT_ZEROIZED_SHIFT)) & PUF_ISR_INT_ZEROIZED_MASK) - -#define PUF_ISR_INT_REJECTED_MASK (0x10U) -#define PUF_ISR_INT_REJECTED_SHIFT (4U) -/*! INT_REJECTED - Positive edge occurred on Rejected */ -#define PUF_ISR_INT_REJECTED(x) (((uint32_t)(((uint32_t)(x)) << PUF_ISR_INT_REJECTED_SHIFT)) & PUF_ISR_INT_REJECTED_MASK) - -#define PUF_ISR_INT_DI_REQUEST_MASK (0x20U) -#define PUF_ISR_INT_DI_REQUEST_SHIFT (5U) -/*! INT_DI_REQUEST - Positive edge occurred on di_request */ -#define PUF_ISR_INT_DI_REQUEST(x) (((uint32_t)(((uint32_t)(x)) << PUF_ISR_INT_DI_REQUEST_SHIFT)) & PUF_ISR_INT_DI_REQUEST_MASK) - -#define PUF_ISR_INT_DO_REQUEST_MASK (0x40U) -#define PUF_ISR_INT_DO_REQUEST_SHIFT (6U) -/*! INT_DO_REQUEST - Positive edge occurred on do_request */ -#define PUF_ISR_INT_DO_REQUEST(x) (((uint32_t)(((uint32_t)(x)) << PUF_ISR_INT_DO_REQUEST_SHIFT)) & PUF_ISR_INT_DO_REQUEST_MASK) -/*! @} */ - -/*! @name DATA_DEST - Data Destination */ -/*! @{ */ - -#define PUF_DATA_DEST_DEST_DOR_MASK (0x1U) -#define PUF_DATA_DEST_DEST_DOR_SHIFT (0U) -/*! DEST_DOR - Key available via the DOR register */ -#define PUF_DATA_DEST_DEST_DOR(x) (((uint32_t)(((uint32_t)(x)) << PUF_DATA_DEST_DEST_DOR_SHIFT)) & PUF_DATA_DEST_DEST_DOR_MASK) - -#define PUF_DATA_DEST_DEST_SO_MASK (0x2U) -#define PUF_DATA_DEST_DEST_SO_SHIFT (1U) -/*! DEST_SO - Key available to ELS */ -#define PUF_DATA_DEST_DEST_SO(x) (((uint32_t)(((uint32_t)(x)) << PUF_DATA_DEST_DEST_SO_SHIFT)) & PUF_DATA_DEST_DEST_SO_MASK) -/*! @} */ - -/*! @name DATA_SRC - Data Source */ -/*! @{ */ - -#define PUF_DATA_SRC_SRC_DIR_MASK (0x1U) -#define PUF_DATA_SRC_SRC_DIR_SHIFT (0U) -/*! SRC_DIR - Data provided via the DIR register */ -#define PUF_DATA_SRC_SRC_DIR(x) (((uint32_t)(((uint32_t)(x)) << PUF_DATA_SRC_SRC_DIR_SHIFT)) & PUF_DATA_SRC_SRC_DIR_MASK) - -#define PUF_DATA_SRC_SRC_SI_MASK (0x2U) -#define PUF_DATA_SRC_SRC_SI_SHIFT (1U) -/*! SRC_SI - Data provided via the SI interface */ -#define PUF_DATA_SRC_SRC_SI(x) (((uint32_t)(((uint32_t)(x)) << PUF_DATA_SRC_SRC_SI_SHIFT)) & PUF_DATA_SRC_SRC_SI_MASK) -/*! @} */ - -/*! @name DIR - Data Input */ -/*! @{ */ - -#define PUF_DIR_DI_MASK (0xFFFFFFFFU) -#define PUF_DIR_DI_SHIFT (0U) -/*! DI - Input data */ -#define PUF_DIR_DI(x) (((uint32_t)(((uint32_t)(x)) << PUF_DIR_DI_SHIFT)) & PUF_DIR_DI_MASK) -/*! @} */ - -/*! @name DOR - Data Output */ -/*! @{ */ - -#define PUF_DOR_DO_MASK (0xFFFFFFFFU) -#define PUF_DOR_DO_SHIFT (0U) -/*! DO - Output data */ -#define PUF_DOR_DO(x) (((uint32_t)(((uint32_t)(x)) << PUF_DOR_DO_SHIFT)) & PUF_DOR_DO_MASK) -/*! @} */ - -/*! @name MISC - Miscellaneous */ -/*! @{ */ - -#define PUF_MISC_DATA_ENDIANNESS_MASK (0x1U) -#define PUF_MISC_DATA_ENDIANNESS_SHIFT (0U) -/*! DATA_ENDIANNESS - Defines the endianness of data in DIR and DOR: - * 0b0..Little endian - * 0b1..Big endian (default) - */ -#define PUF_MISC_DATA_ENDIANNESS(x) (((uint32_t)(((uint32_t)(x)) << PUF_MISC_DATA_ENDIANNESS_SHIFT)) & PUF_MISC_DATA_ENDIANNESS_MASK) -/*! @} */ - -/*! @name IF_SR - Interface Status */ -/*! @{ */ - -#define PUF_IF_SR_APB_ERROR_MASK (0x1U) -#define PUF_IF_SR_APB_ERROR_SHIFT (0U) -/*! APB_ERROR - APB error */ -#define PUF_IF_SR_APB_ERROR(x) (((uint32_t)(((uint32_t)(x)) << PUF_IF_SR_APB_ERROR_SHIFT)) & PUF_IF_SR_APB_ERROR_MASK) -/*! @} */ - -/*! @name PSR - PUF Score */ -/*! @{ */ - -#define PUF_PSR_PUF_SCORE_MASK (0xFU) -#define PUF_PSR_PUF_SCORE_SHIFT (0U) -/*! PUF_SCORE - Provides the PUF score obtained during the last Test PUF, Enroll or Start operation. */ -#define PUF_PSR_PUF_SCORE(x) (((uint32_t)(((uint32_t)(x)) << PUF_PSR_PUF_SCORE_SHIFT)) & PUF_PSR_PUF_SCORE_MASK) -/*! @} */ - -/*! @name HW_RUC0 - Hardware Restrict User Context 0 */ -/*! @{ */ - -#define PUF_HW_RUC0_LC_STATE_MASK (0xFFU) -#define PUF_HW_RUC0_LC_STATE_SHIFT (0U) -/*! LC_STATE - Life cycle state based restrictions - * 0b00000011..OEM Develop - * 0b00000111..OEM Develop 2 - * 0b00001111..OEM In-field - * 0b00011111..OEM Field return - * 0b00111111..NXP Field Return/Failure Analysis - * 0b11001111..In-field Locked - * 0b11111111..Bricked - */ -#define PUF_HW_RUC0_LC_STATE(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_RUC0_LC_STATE_SHIFT)) & PUF_HW_RUC0_LC_STATE_MASK) - -#define PUF_HW_RUC0_BOOT_STATE_MASK (0xFFFF00U) -#define PUF_HW_RUC0_BOOT_STATE_SHIFT (8U) -/*! BOOT_STATE - Temporal boot state */ -#define PUF_HW_RUC0_BOOT_STATE(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_RUC0_BOOT_STATE_SHIFT)) & PUF_HW_RUC0_BOOT_STATE_MASK) - -#define PUF_HW_RUC0_CPU0_DEBUG_MASK (0x1000000U) -#define PUF_HW_RUC0_CPU0_DEBUG_SHIFT (24U) -/*! CPU0_DEBUG - Disable key access when debugger is attached to CPU0 after power-up */ -#define PUF_HW_RUC0_CPU0_DEBUG(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_RUC0_CPU0_DEBUG_SHIFT)) & PUF_HW_RUC0_CPU0_DEBUG_MASK) - -#define PUF_HW_RUC0_COOLFLUX_DEBUG_MASK (0x2000000U) -#define PUF_HW_RUC0_COOLFLUX_DEBUG_SHIFT (25U) -/*! COOLFLUX_DEBUG - Disable key access when debugger is attached to COOLFLUX after power-up */ -#define PUF_HW_RUC0_COOLFLUX_DEBUG(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_RUC0_COOLFLUX_DEBUG_SHIFT)) & PUF_HW_RUC0_COOLFLUX_DEBUG_MASK) - -#define PUF_HW_RUC0_dsp_debug_MASK (0x4000000U) -#define PUF_HW_RUC0_dsp_debug_SHIFT (26U) -/*! dsp_debug - DSP debug status. */ -#define PUF_HW_RUC0_dsp_debug(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_RUC0_dsp_debug_SHIFT)) & PUF_HW_RUC0_dsp_debug_MASK) - -#define PUF_HW_RUC0_ACCESS_LEVEL_MASK (0xF0000000U) -#define PUF_HW_RUC0_ACCESS_LEVEL_SHIFT (28U) -/*! ACCESS_LEVEL - Restrict the key access based on TrustZone security level */ -#define PUF_HW_RUC0_ACCESS_LEVEL(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_RUC0_ACCESS_LEVEL_SHIFT)) & PUF_HW_RUC0_ACCESS_LEVEL_MASK) -/*! @} */ - -/*! @name HW_RUC1 - Hardware Restrict User Context 1 */ -/*! @{ */ - -#define PUF_HW_RUC1_APP_CTX_MASK (0xFFFFFFFFU) -#define PUF_HW_RUC1_APP_CTX_SHIFT (0U) -/*! APP_CTX - Application customizable context */ -#define PUF_HW_RUC1_APP_CTX(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_RUC1_APP_CTX_SHIFT)) & PUF_HW_RUC1_APP_CTX_MASK) -/*! @} */ - -/*! @name HW_INFO - Hardware Information */ -/*! @{ */ - -#define PUF_HW_INFO_CONFIG_WRAP_MASK (0x1000000U) -#define PUF_HW_INFO_CONFIG_WRAP_SHIFT (24U) -/*! CONFIG_WRAP - Wrap configuration - * 0b0..Indicates that Wrap is not included - * 0b1..Indicates that Wrap is included - */ -#define PUF_HW_INFO_CONFIG_WRAP(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_INFO_CONFIG_WRAP_SHIFT)) & PUF_HW_INFO_CONFIG_WRAP_MASK) - -#define PUF_HW_INFO_CONFIG_TYPE_MASK (0xF0000000U) -#define PUF_HW_INFO_CONFIG_TYPE_SHIFT (28U) -/*! CONFIG_TYPE - PUF configuration - * 0b0001..Indicates that PUF configuration is Safe. - * 0b0010..Indicates that PUF configuration is Plus. - */ -#define PUF_HW_INFO_CONFIG_TYPE(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_INFO_CONFIG_TYPE_SHIFT)) & PUF_HW_INFO_CONFIG_TYPE_MASK) -/*! @} */ - -/*! @name HW_ID - Hardware Identifier */ -/*! @{ */ - -#define PUF_HW_ID_HW_ID_MASK (0xFFFFFFFFU) -#define PUF_HW_ID_HW_ID_SHIFT (0U) -/*! HW_ID - Provides the hardware identifier */ -#define PUF_HW_ID_HW_ID(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_ID_HW_ID_SHIFT)) & PUF_HW_ID_HW_ID_MASK) -/*! @} */ - -/*! @name HW_VER - Hardware Version */ -/*! @{ */ - -#define PUF_HW_VER_HW_REV_MASK (0xFFU) -#define PUF_HW_VER_HW_REV_SHIFT (0U) -/*! HW_REV - Provides the hardware version, patch part */ -#define PUF_HW_VER_HW_REV(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_VER_HW_REV_SHIFT)) & PUF_HW_VER_HW_REV_MASK) - -#define PUF_HW_VER_HW_VERSION_MINOR_MASK (0xFF00U) -#define PUF_HW_VER_HW_VERSION_MINOR_SHIFT (8U) -/*! HW_VERSION_MINOR - Provides the hardware version, minor part */ -#define PUF_HW_VER_HW_VERSION_MINOR(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_VER_HW_VERSION_MINOR_SHIFT)) & PUF_HW_VER_HW_VERSION_MINOR_MASK) - -#define PUF_HW_VER_HW_VERSION_MAJOR_MASK (0xFF0000U) -#define PUF_HW_VER_HW_VERSION_MAJOR_SHIFT (16U) -/*! HW_VERSION_MAJOR - Provides the hardware version, major part */ -#define PUF_HW_VER_HW_VERSION_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << PUF_HW_VER_HW_VERSION_MAJOR_SHIFT)) & PUF_HW_VER_HW_VERSION_MAJOR_MASK) -/*! @} */ - -/*! @name CONFIG - PUF command blocking configuration */ -/*! @{ */ - -#define PUF_CONFIG_DIS_PUF_ENROLL_MASK (0x2U) -#define PUF_CONFIG_DIS_PUF_ENROLL_SHIFT (1U) -/*! DIS_PUF_ENROLL - Disable PUF enroll command - * 0b0..Command enabled - * 0b1..Command disabled - */ -#define PUF_CONFIG_DIS_PUF_ENROLL(x) (((uint32_t)(((uint32_t)(x)) << PUF_CONFIG_DIS_PUF_ENROLL_SHIFT)) & PUF_CONFIG_DIS_PUF_ENROLL_MASK) - -#define PUF_CONFIG_DIS_PUF_START_MASK (0x4U) -#define PUF_CONFIG_DIS_PUF_START_SHIFT (2U) -/*! DIS_PUF_START - Disable PUF start command - * 0b0..Command enabled - * 0b1..Command disabled - */ -#define PUF_CONFIG_DIS_PUF_START(x) (((uint32_t)(((uint32_t)(x)) << PUF_CONFIG_DIS_PUF_START_SHIFT)) & PUF_CONFIG_DIS_PUF_START_MASK) - -#define PUF_CONFIG_DIS_PUF_STOP_MASK (0x20U) -#define PUF_CONFIG_DIS_PUF_STOP_SHIFT (5U) -/*! DIS_PUF_STOP - Disable PUF stop command - * 0b0..Command enabled - * 0b1..Command disabled - */ -#define PUF_CONFIG_DIS_PUF_STOP(x) (((uint32_t)(((uint32_t)(x)) << PUF_CONFIG_DIS_PUF_STOP_SHIFT)) & PUF_CONFIG_DIS_PUF_STOP_MASK) - -#define PUF_CONFIG_DIS_PUF_GET_KEY_MASK (0x40U) -#define PUF_CONFIG_DIS_PUF_GET_KEY_SHIFT (6U) -/*! DIS_PUF_GET_KEY - Disable PUF get key command - * 0b0..Command enabled - * 0b1..Command disabled - */ -#define PUF_CONFIG_DIS_PUF_GET_KEY(x) (((uint32_t)(((uint32_t)(x)) << PUF_CONFIG_DIS_PUF_GET_KEY_SHIFT)) & PUF_CONFIG_DIS_PUF_GET_KEY_MASK) - -#define PUF_CONFIG_DIS_PUF_UNWRAP_KEY_MASK (0x80U) -#define PUF_CONFIG_DIS_PUF_UNWRAP_KEY_SHIFT (7U) -/*! DIS_PUF_UNWRAP_KEY - Disable PUF unwrap key command - * 0b0..Command enabled - * 0b1..Command disabled - */ -#define PUF_CONFIG_DIS_PUF_UNWRAP_KEY(x) (((uint32_t)(((uint32_t)(x)) << PUF_CONFIG_DIS_PUF_UNWRAP_KEY_SHIFT)) & PUF_CONFIG_DIS_PUF_UNWRAP_KEY_MASK) - -#define PUF_CONFIG_DIS_PUF_GEN_WRAP_KEY_MASK (0x100U) -#define PUF_CONFIG_DIS_PUF_GEN_WRAP_KEY_SHIFT (8U) -/*! DIS_PUF_GEN_WRAP_KEY - Disable PUF generate and wrap key command - * 0b0..Command enabled - * 0b1..Command disabled - */ -#define PUF_CONFIG_DIS_PUF_GEN_WRAP_KEY(x) (((uint32_t)(((uint32_t)(x)) << PUF_CONFIG_DIS_PUF_GEN_WRAP_KEY_SHIFT)) & PUF_CONFIG_DIS_PUF_GEN_WRAP_KEY_MASK) - -#define PUF_CONFIG_DIS_PUF_WRAP_KEY_MASK (0x200U) -#define PUF_CONFIG_DIS_PUF_WRAP_KEY_SHIFT (9U) -/*! DIS_PUF_WRAP_KEY - Disable PUF wrap key command - * 0b0..Command enabled - * 0b1..Command disabled - */ -#define PUF_CONFIG_DIS_PUF_WRAP_KEY(x) (((uint32_t)(((uint32_t)(x)) << PUF_CONFIG_DIS_PUF_WRAP_KEY_SHIFT)) & PUF_CONFIG_DIS_PUF_WRAP_KEY_MASK) - -#define PUF_CONFIG_DIS_PUF_GEN_RANDOM_NUMBER_MASK (0x8000U) -#define PUF_CONFIG_DIS_PUF_GEN_RANDOM_NUMBER_SHIFT (15U) -/*! DIS_PUF_GEN_RANDOM_NUMBER - Disable PUF generate and wrap key command - * 0b0..Command enabled - * 0b1..Command disabled - */ -#define PUF_CONFIG_DIS_PUF_GEN_RANDOM_NUMBER(x) (((uint32_t)(((uint32_t)(x)) << PUF_CONFIG_DIS_PUF_GEN_RANDOM_NUMBER_SHIFT)) & PUF_CONFIG_DIS_PUF_GEN_RANDOM_NUMBER_MASK) - -#define PUF_CONFIG_DIS_PUF_TEST_MASK (0x80000000U) -#define PUF_CONFIG_DIS_PUF_TEST_SHIFT (31U) -/*! DIS_PUF_TEST - Disable PUF test command - * 0b0..Command enabled - * 0b1..Command disabled - */ -#define PUF_CONFIG_DIS_PUF_TEST(x) (((uint32_t)(((uint32_t)(x)) << PUF_CONFIG_DIS_PUF_TEST_SHIFT)) & PUF_CONFIG_DIS_PUF_TEST_MASK) -/*! @} */ - -/*! @name SEC_LOCK - Security level lock */ -/*! @{ */ - -#define PUF_SEC_LOCK_SEC_LEVEL_MASK (0x3U) -#define PUF_SEC_LOCK_SEC_LEVEL_SHIFT (0U) -/*! SEC_LEVEL - Security Level - * 0b00..Non-secure and non-privileged Master - * 0b01..Non-secure and privileged Master - * 0b10..Secure and non-privileged Master - * 0b11..Secure and privileged Master - */ -#define PUF_SEC_LOCK_SEC_LEVEL(x) (((uint32_t)(((uint32_t)(x)) << PUF_SEC_LOCK_SEC_LEVEL_SHIFT)) & PUF_SEC_LOCK_SEC_LEVEL_MASK) - -#define PUF_SEC_LOCK_ANTI_POLE_SEC_LEVEL_MASK (0xCU) -#define PUF_SEC_LOCK_ANTI_POLE_SEC_LEVEL_SHIFT (2U) -/*! ANTI_POLE_SEC_LEVEL - Anti-pole of security level - * 0b00..Secure and privileged Master - * 0b01..Secure and non-privileged Master - * 0b10..Non-secure and privileged Master - * 0b11..Non-secure and non-privileged Master - */ -#define PUF_SEC_LOCK_ANTI_POLE_SEC_LEVEL(x) (((uint32_t)(((uint32_t)(x)) << PUF_SEC_LOCK_ANTI_POLE_SEC_LEVEL_SHIFT)) & PUF_SEC_LOCK_ANTI_POLE_SEC_LEVEL_MASK) - -#define PUF_SEC_LOCK_PATTERN_MASK (0xFFF0U) -#define PUF_SEC_LOCK_PATTERN_SHIFT (4U) -/*! PATTERN - Pattern */ -#define PUF_SEC_LOCK_PATTERN(x) (((uint32_t)(((uint32_t)(x)) << PUF_SEC_LOCK_PATTERN_SHIFT)) & PUF_SEC_LOCK_PATTERN_MASK) -/*! @} */ - -/*! @name APP_CTX_MASK - Application defined context mask */ -/*! @{ */ - -#define PUF_APP_CTX_MASK_APP_CTX_MASK_MASK (0xFFFFFFFFU) -#define PUF_APP_CTX_MASK_APP_CTX_MASK_SHIFT (0U) -/*! APP_CTX_MASK - Application defined context */ -#define PUF_APP_CTX_MASK_APP_CTX_MASK(x) (((uint32_t)(((uint32_t)(x)) << PUF_APP_CTX_MASK_APP_CTX_MASK_SHIFT)) & PUF_APP_CTX_MASK_APP_CTX_MASK_MASK) -/*! @} */ - -/*! @name SRAM_CFG - SRAM Configuration */ -/*! @{ */ - -#define PUF_SRAM_CFG_ENABLE_MASK (0x1U) -#define PUF_SRAM_CFG_ENABLE_SHIFT (0U) -/*! ENABLE - PUF SRAM Controller activation - * 0b0..Disabled - * 0b1..Enabled - */ -#define PUF_SRAM_CFG_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_CFG_ENABLE_SHIFT)) & PUF_SRAM_CFG_ENABLE_MASK) - -#define PUF_SRAM_CFG_CKGATING_MASK (0x4U) -#define PUF_SRAM_CFG_CKGATING_SHIFT (2U) -/*! CKGATING - PUF SRAM Clock Gating control - * 0b0..Disabled - * 0b1..Enabled - */ -#define PUF_SRAM_CFG_CKGATING(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_CFG_CKGATING_SHIFT)) & PUF_SRAM_CFG_CKGATING_MASK) -/*! @} */ - -/*! @name SRAM_STATUS - Status */ -/*! @{ */ - -#define PUF_SRAM_STATUS_READY_MASK (0x1U) -#define PUF_SRAM_STATUS_READY_SHIFT (0U) -/*! READY - PUF SRAM Controller State */ -#define PUF_SRAM_STATUS_READY(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_STATUS_READY_SHIFT)) & PUF_SRAM_STATUS_READY_MASK) -/*! @} */ - -/*! @name SRAM_INT_CLR_ENABLE - Interrupt Enable Clear */ -/*! @{ */ - -#define PUF_SRAM_INT_CLR_ENABLE_READY_MASK (0x1U) -#define PUF_SRAM_INT_CLR_ENABLE_READY_SHIFT (0U) -/*! READY - READY Interrupt Enable clear */ -#define PUF_SRAM_INT_CLR_ENABLE_READY(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_CLR_ENABLE_READY_SHIFT)) & PUF_SRAM_INT_CLR_ENABLE_READY_MASK) - -#define PUF_SRAM_INT_CLR_ENABLE_APB_ERR_MASK (0x2U) -#define PUF_SRAM_INT_CLR_ENABLE_APB_ERR_SHIFT (1U) -/*! APB_ERR - APB_ERR Interrupt Enable clear */ -#define PUF_SRAM_INT_CLR_ENABLE_APB_ERR(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_CLR_ENABLE_APB_ERR_SHIFT)) & PUF_SRAM_INT_CLR_ENABLE_APB_ERR_MASK) -/*! @} */ - -/*! @name SRAM_INT_SET_ENABLE - Interrupt Enable Set */ -/*! @{ */ - -#define PUF_SRAM_INT_SET_ENABLE_READY_MASK (0x1U) -#define PUF_SRAM_INT_SET_ENABLE_READY_SHIFT (0U) -/*! READY - READY Interrupt Enable set */ -#define PUF_SRAM_INT_SET_ENABLE_READY(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_SET_ENABLE_READY_SHIFT)) & PUF_SRAM_INT_SET_ENABLE_READY_MASK) - -#define PUF_SRAM_INT_SET_ENABLE_APB_ERR_MASK (0x2U) -#define PUF_SRAM_INT_SET_ENABLE_APB_ERR_SHIFT (1U) -/*! APB_ERR - APB_ERR Interrupt Enable set */ -#define PUF_SRAM_INT_SET_ENABLE_APB_ERR(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_SET_ENABLE_APB_ERR_SHIFT)) & PUF_SRAM_INT_SET_ENABLE_APB_ERR_MASK) -/*! @} */ - -/*! @name SRAM_INT_STATUS - Interrupt Status */ -/*! @{ */ - -#define PUF_SRAM_INT_STATUS_READY_MASK (0x1U) -#define PUF_SRAM_INT_STATUS_READY_SHIFT (0U) -/*! READY - READY Interrupt Status */ -#define PUF_SRAM_INT_STATUS_READY(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_STATUS_READY_SHIFT)) & PUF_SRAM_INT_STATUS_READY_MASK) - -#define PUF_SRAM_INT_STATUS_APB_ERR_MASK (0x2U) -#define PUF_SRAM_INT_STATUS_APB_ERR_SHIFT (1U) -/*! APB_ERR - APB_ERR Interrupt Status */ -#define PUF_SRAM_INT_STATUS_APB_ERR(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_STATUS_APB_ERR_SHIFT)) & PUF_SRAM_INT_STATUS_APB_ERR_MASK) -/*! @} */ - -/*! @name SRAM_INT_ENABLE - Interrupt Enable */ -/*! @{ */ - -#define PUF_SRAM_INT_ENABLE_READY_MASK (0x1U) -#define PUF_SRAM_INT_ENABLE_READY_SHIFT (0U) -/*! READY - READY Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define PUF_SRAM_INT_ENABLE_READY(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_ENABLE_READY_SHIFT)) & PUF_SRAM_INT_ENABLE_READY_MASK) - -#define PUF_SRAM_INT_ENABLE_SRAM_APB_ERR_MASK (0x2U) -#define PUF_SRAM_INT_ENABLE_SRAM_APB_ERR_SHIFT (1U) -/*! SRAM_APB_ERR - APB_ERR Interrupt Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define PUF_SRAM_INT_ENABLE_SRAM_APB_ERR(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_ENABLE_SRAM_APB_ERR_SHIFT)) & PUF_SRAM_INT_ENABLE_SRAM_APB_ERR_MASK) -/*! @} */ - -/*! @name SRAM_INT_CLR_STATUS - Interrupt Status Clear */ -/*! @{ */ - -#define PUF_SRAM_INT_CLR_STATUS_READY_MASK (0x1U) -#define PUF_SRAM_INT_CLR_STATUS_READY_SHIFT (0U) -/*! READY - READY Interrupt Status clear */ -#define PUF_SRAM_INT_CLR_STATUS_READY(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_CLR_STATUS_READY_SHIFT)) & PUF_SRAM_INT_CLR_STATUS_READY_MASK) - -#define PUF_SRAM_INT_CLR_STATUS_APB_ERR_MASK (0x2U) -#define PUF_SRAM_INT_CLR_STATUS_APB_ERR_SHIFT (1U) -/*! APB_ERR - APB_ERR Interrupt Status Clear - * 0b0..No effect - * 0b1..Clears the APB_ERR bit field in register INT_STATUS. Automatically reset by the Hardware - */ -#define PUF_SRAM_INT_CLR_STATUS_APB_ERR(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_CLR_STATUS_APB_ERR_SHIFT)) & PUF_SRAM_INT_CLR_STATUS_APB_ERR_MASK) -/*! @} */ - -/*! @name SRAM_INT_SET_STATUS - Interrupt Status set */ -/*! @{ */ - -#define PUF_SRAM_INT_SET_STATUS_READY_MASK (0x1U) -#define PUF_SRAM_INT_SET_STATUS_READY_SHIFT (0U) -/*! READY - READY Interrupt Status set */ -#define PUF_SRAM_INT_SET_STATUS_READY(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_SET_STATUS_READY_SHIFT)) & PUF_SRAM_INT_SET_STATUS_READY_MASK) - -#define PUF_SRAM_INT_SET_STATUS_APB_ERR_MASK (0x2U) -#define PUF_SRAM_INT_SET_STATUS_APB_ERR_SHIFT (1U) -/*! APB_ERR - APB_ERR Interrupt Status Set - * 0b0..No effect - * 0b1..Clears the APB_ERR bit field in register INT_STATUS. Automatically reset by the Hardware - */ -#define PUF_SRAM_INT_SET_STATUS_APB_ERR(x) (((uint32_t)(((uint32_t)(x)) << PUF_SRAM_INT_SET_STATUS_APB_ERR_SHIFT)) & PUF_SRAM_INT_SET_STATUS_APB_ERR_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group PUF_Register_Masks */ - - -/* PUF - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral PUF base address */ - #define PUF_BASE (0x5002C000u) - /** Peripheral PUF base address */ - #define PUF_BASE_NS (0x4002C000u) - /** Peripheral PUF base pointer */ - #define PUF ((PUF_Type *)PUF_BASE) - /** Peripheral PUF base pointer */ - #define PUF_NS ((PUF_Type *)PUF_BASE_NS) - /** Peripheral PUF_ALIAS1 base address */ - #define PUF_ALIAS1_BASE (0x5002D000u) - /** Peripheral PUF_ALIAS1 base address */ - #define PUF_ALIAS1_BASE_NS (0x4002D000u) - /** Peripheral PUF_ALIAS1 base pointer */ - #define PUF_ALIAS1 ((PUF_Type *)PUF_ALIAS1_BASE) - /** Peripheral PUF_ALIAS1 base pointer */ - #define PUF_ALIAS1_NS ((PUF_Type *)PUF_ALIAS1_BASE_NS) - /** Peripheral PUF_ALIAS2 base address */ - #define PUF_ALIAS2_BASE (0x5002E000u) - /** Peripheral PUF_ALIAS2 base address */ - #define PUF_ALIAS2_BASE_NS (0x4002E000u) - /** Peripheral PUF_ALIAS2 base pointer */ - #define PUF_ALIAS2 ((PUF_Type *)PUF_ALIAS2_BASE) - /** Peripheral PUF_ALIAS2 base pointer */ - #define PUF_ALIAS2_NS ((PUF_Type *)PUF_ALIAS2_BASE_NS) - /** Peripheral PUF_ALIAS3 base address */ - #define PUF_ALIAS3_BASE (0x5002F000u) - /** Peripheral PUF_ALIAS3 base address */ - #define PUF_ALIAS3_BASE_NS (0x4002F000u) - /** Peripheral PUF_ALIAS3 base pointer */ - #define PUF_ALIAS3 ((PUF_Type *)PUF_ALIAS3_BASE) - /** Peripheral PUF_ALIAS3 base pointer */ - #define PUF_ALIAS3_NS ((PUF_Type *)PUF_ALIAS3_BASE_NS) - /** Array initializer of PUF peripheral base addresses */ - #define PUF_BASE_ADDRS { PUF_BASE, PUF_ALIAS1_BASE, PUF_ALIAS2_BASE, PUF_ALIAS3_BASE } - /** Array initializer of PUF peripheral base pointers */ - #define PUF_BASE_PTRS { PUF, PUF_ALIAS1, PUF_ALIAS2, PUF_ALIAS3 } - /** Array initializer of PUF peripheral base addresses */ - #define PUF_BASE_ADDRS_NS { PUF_BASE_NS, PUF_ALIAS1_BASE_NS, PUF_ALIAS2_BASE_NS, PUF_ALIAS3_BASE_NS } - /** Array initializer of PUF peripheral base pointers */ - #define PUF_BASE_PTRS_NS { PUF_NS, PUF_ALIAS1_NS, PUF_ALIAS2_NS, PUF_ALIAS3_NS } -#else - /** Peripheral PUF base address */ - #define PUF_BASE (0x4002C000u) - /** Peripheral PUF base pointer */ - #define PUF ((PUF_Type *)PUF_BASE) - /** Peripheral PUF_ALIAS1 base address */ - #define PUF_ALIAS1_BASE (0x4002D000u) - /** Peripheral PUF_ALIAS1 base pointer */ - #define PUF_ALIAS1 ((PUF_Type *)PUF_ALIAS1_BASE) - /** Peripheral PUF_ALIAS2 base address */ - #define PUF_ALIAS2_BASE (0x4002E000u) - /** Peripheral PUF_ALIAS2 base pointer */ - #define PUF_ALIAS2 ((PUF_Type *)PUF_ALIAS2_BASE) - /** Peripheral PUF_ALIAS3 base address */ - #define PUF_ALIAS3_BASE (0x4002F000u) - /** Peripheral PUF_ALIAS3 base pointer */ - #define PUF_ALIAS3 ((PUF_Type *)PUF_ALIAS3_BASE) - /** Array initializer of PUF peripheral base addresses */ - #define PUF_BASE_ADDRS { PUF_BASE, PUF_ALIAS1_BASE, PUF_ALIAS2_BASE, PUF_ALIAS3_BASE } - /** Array initializer of PUF peripheral base pointers */ - #define PUF_BASE_PTRS { PUF, PUF_ALIAS1, PUF_ALIAS2, PUF_ALIAS3 } -#endif - -/*! - * @} - */ /* end of group PUF_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- PWM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PWM_Peripheral_Access_Layer PWM Peripheral Access Layer - * @{ - */ - -/** PWM - Register Layout Typedef */ -typedef struct { - struct { /* offset: 0x0, array step: 0x60 */ - __I uint16_t CNT; /**< Counter Register, array offset: 0x0, array step: 0x60 */ - __IO uint16_t INIT; /**< Initial Count Register, array offset: 0x2, array step: 0x60 */ - __IO uint16_t CTRL2; /**< Control 2 Register, array offset: 0x4, array step: 0x60 */ - __IO uint16_t CTRL; /**< Control Register, array offset: 0x6, array step: 0x60 */ - uint8_t RESERVED_0[2]; - __IO uint16_t VAL0; /**< Value Register 0, array offset: 0xA, array step: 0x60 */ - __IO uint16_t FRACVAL1; /**< Fractional Value Register 1, array offset: 0xC, array step: 0x60 */ - __IO uint16_t VAL1; /**< Value Register 1, array offset: 0xE, array step: 0x60 */ - __IO uint16_t FRACVAL2; /**< Fractional Value Register 2, array offset: 0x10, array step: 0x60 */ - __IO uint16_t VAL2; /**< Value Register 2, array offset: 0x12, array step: 0x60 */ - __IO uint16_t FRACVAL3; /**< Fractional Value Register 3, array offset: 0x14, array step: 0x60 */ - __IO uint16_t VAL3; /**< Value Register 3, array offset: 0x16, array step: 0x60 */ - __IO uint16_t FRACVAL4; /**< Fractional Value Register 4, array offset: 0x18, array step: 0x60 */ - __IO uint16_t VAL4; /**< Value Register 4, array offset: 0x1A, array step: 0x60 */ - __IO uint16_t FRACVAL5; /**< Fractional Value Register 5, array offset: 0x1C, array step: 0x60 */ - __IO uint16_t VAL5; /**< Value Register 5, array offset: 0x1E, array step: 0x60 */ - __IO uint16_t FRCTRL; /**< Fractional Control Register, array offset: 0x20, array step: 0x60 */ - __IO uint16_t OCTRL; /**< Output Control Register, array offset: 0x22, array step: 0x60 */ - __IO uint16_t STS; /**< Status Register, array offset: 0x24, array step: 0x60 */ - __IO uint16_t INTEN; /**< Interrupt Enable Register, array offset: 0x26, array step: 0x60 */ - __IO uint16_t DMAEN; /**< DMA Enable Register, array offset: 0x28, array step: 0x60 */ - __IO uint16_t TCTRL; /**< Output Trigger Control Register, array offset: 0x2A, array step: 0x60 */ - __IO uint16_t DISMAP[1]; /**< Fault Disable Mapping Register 0, array offset: 0x2C, array step: index*0x60, index2*0x2 */ - uint8_t RESERVED_1[2]; - __IO uint16_t DTCNT0; /**< Deadtime Count Register 0, array offset: 0x30, array step: 0x60 */ - __IO uint16_t DTCNT1; /**< Deadtime Count Register 1, array offset: 0x32, array step: 0x60 */ - __IO uint16_t CAPTCTRLA; /**< Capture Control A Register, array offset: 0x34, array step: 0x60 */ - __IO uint16_t CAPTCOMPA; /**< Capture Compare A Register, array offset: 0x36, array step: 0x60 */ - __IO uint16_t CAPTCTRLB; /**< Capture Control B Register, array offset: 0x38, array step: 0x60 */ - __IO uint16_t CAPTCOMPB; /**< Capture Compare B Register, array offset: 0x3A, array step: 0x60 */ - __IO uint16_t CAPTCTRLX; /**< Capture Control X Register, array offset: 0x3C, array step: 0x60 */ - __IO uint16_t CAPTCOMPX; /**< Capture Compare X Register, array offset: 0x3E, array step: 0x60 */ - __I uint16_t CVAL0; /**< Capture Value 0 Register, array offset: 0x40, array step: 0x60 */ - __I uint16_t CVAL0CYC; /**< Capture Value 0 Cycle Register, array offset: 0x42, array step: 0x60 */ - __I uint16_t CVAL1; /**< Capture Value 1 Register, array offset: 0x44, array step: 0x60 */ - __I uint16_t CVAL1CYC; /**< Capture Value 1 Cycle Register, array offset: 0x46, array step: 0x60 */ - __I uint16_t CVAL2; /**< Capture Value 2 Register, array offset: 0x48, array step: 0x60 */ - __I uint16_t CVAL2CYC; /**< Capture Value 2 Cycle Register, array offset: 0x4A, array step: 0x60 */ - __I uint16_t CVAL3; /**< Capture Value 3 Register, array offset: 0x4C, array step: 0x60 */ - __I uint16_t CVAL3CYC; /**< Capture Value 3 Cycle Register, array offset: 0x4E, array step: 0x60 */ - __I uint16_t CVAL4; /**< Capture Value 4 Register, array offset: 0x50, array step: 0x60 */ - __I uint16_t CVAL4CYC; /**< Capture Value 4 Cycle Register, array offset: 0x52, array step: 0x60 */ - __I uint16_t CVAL5; /**< Capture Value 5 Register, array offset: 0x54, array step: 0x60 */ - __I uint16_t CVAL5CYC; /**< Capture Value 5 Cycle Register, array offset: 0x56, array step: 0x60 */ - __IO uint16_t PHASEDLY; /**< Phase Delay Register, array offset: 0x58, array step: 0x60, valid indices: [1-3] */ - __IO uint16_t CAPTFILTA; /**< Capture PWM_A Input Filter Register, array offset: 0x5A, array step: 0x60 */ - __IO uint16_t CAPTFILTB; /**< Capture PWM_B Input Filter Register, array offset: 0x5C, array step: 0x60 */ - __IO uint16_t CAPTFILTX; /**< Capture PWM_X Input Filter Register, array offset: 0x5E, array step: 0x60 */ - } SM[4]; - __IO uint16_t OUTEN; /**< Output Enable Register, offset: 0x180 */ - __IO uint16_t MASK; /**< Mask Register, offset: 0x182 */ - __IO uint16_t SWCOUT; /**< Software Controlled Output Register, offset: 0x184 */ - __IO uint16_t DTSRCSEL; /**< PWM Source Select Register, offset: 0x186 */ - __IO uint16_t MCTRL; /**< Master Control Register, offset: 0x188 */ - __IO uint16_t MCTRL2; /**< Master Control 2 Register, offset: 0x18A */ - __IO uint16_t FCTRL; /**< Fault Control Register, offset: 0x18C */ - __IO uint16_t FSTS; /**< Fault Status Register, offset: 0x18E */ - __IO uint16_t FFILT; /**< Fault Filter Register, offset: 0x190 */ - __IO uint16_t FTST; /**< Fault Test Register, offset: 0x192 */ - __IO uint16_t FCTRL2; /**< Fault Control 2 Register, offset: 0x194 */ -} PWM_Type; - -/* ---------------------------------------------------------------------------- - -- PWM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup PWM_Register_Masks PWM Register Masks - * @{ - */ - -/*! @name CNT - Counter Register */ -/*! @{ */ - -#define PWM_CNT_CNT_MASK (0xFFFFU) -#define PWM_CNT_CNT_SHIFT (0U) -/*! CNT - Counter Register Bits */ -#define PWM_CNT_CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CNT_CNT_SHIFT)) & PWM_CNT_CNT_MASK) -/*! @} */ - -/* The count of PWM_CNT */ -#define PWM_CNT_COUNT (4U) - -/*! @name INIT - Initial Count Register */ -/*! @{ */ - -#define PWM_INIT_INIT_MASK (0xFFFFU) -#define PWM_INIT_INIT_SHIFT (0U) -/*! INIT - Initial Count Register Bits */ -#define PWM_INIT_INIT(x) (((uint16_t)(((uint16_t)(x)) << PWM_INIT_INIT_SHIFT)) & PWM_INIT_INIT_MASK) -/*! @} */ - -/* The count of PWM_INIT */ -#define PWM_INIT_COUNT (4U) - -/*! @name CTRL2 - Control 2 Register */ -/*! @{ */ - -#define PWM_CTRL2_CLK_SEL_MASK (0x3U) -#define PWM_CTRL2_CLK_SEL_SHIFT (0U) -/*! CLK_SEL - Clock Source Select - * 0b00..The IPBus clock is used as the clock for the local prescaler and counter. - * 0b01..EXT_CLK is used as the clock for the local prescaler and counter. - * 0b10..Submodule 0's clock (AUX_CLK) is used as the source clock for the local prescaler and counter. This - * setting should not be used in submodule 0 as it forces the clock to logic 0. - * 0b11..Reserved - */ -#define PWM_CTRL2_CLK_SEL(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_CLK_SEL_SHIFT)) & PWM_CTRL2_CLK_SEL_MASK) - -#define PWM_CTRL2_RELOAD_SEL_MASK (0x4U) -#define PWM_CTRL2_RELOAD_SEL_SHIFT (2U) -/*! RELOAD_SEL - Reload Source Select - * 0b0..The local RELOAD signal is used to reload registers. - * 0b1..The master RELOAD signal (from submodule 0) is used to reload registers. This setting should not be used - * in submodule 0 as it forces the RELOAD signal to logic 0. - */ -#define PWM_CTRL2_RELOAD_SEL(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_RELOAD_SEL_SHIFT)) & PWM_CTRL2_RELOAD_SEL_MASK) - -#define PWM_CTRL2_FORCE_SEL_MASK (0x38U) -#define PWM_CTRL2_FORCE_SEL_SHIFT (3U) -/*! FORCE_SEL - Force Select - * 0b000..The local force signal, CTRL2[FORCE], from this submodule is used to force updates. - * 0b001..The master force signal from submodule 0 is used to force updates. This setting should not be used in - * submodule 0 as it holds the FORCE OUTPUT signal to logic 0. - * 0b010..The local reload signal from this submodule is used to force updates without regard to the state of LDOK. - * 0b011..The master reload signal from submodule0 is used to force updates if LDOK is set. This setting should - * not be used in submodule0 as it holds the FORCE OUTPUT signal to logic 0. - * 0b100..The local sync signal from this submodule is used to force updates. - * 0b101..The master sync signal from submodule0 is used to force updates. This setting should not be used in - * submodule0 as it holds the FORCE OUTPUT signal to logic 0. - * 0b110..The external force signal, EXT_FORCE, from outside the PWM module causes updates. - * 0b111..The external sync signal, EXT_SYNC, from outside the PWM module causes updates. - */ -#define PWM_CTRL2_FORCE_SEL(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_FORCE_SEL_SHIFT)) & PWM_CTRL2_FORCE_SEL_MASK) - -#define PWM_CTRL2_FORCE_MASK (0x40U) -#define PWM_CTRL2_FORCE_SHIFT (6U) -/*! FORCE - Force Initialization */ -#define PWM_CTRL2_FORCE(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_FORCE_SHIFT)) & PWM_CTRL2_FORCE_MASK) - -#define PWM_CTRL2_FRCEN_MASK (0x80U) -#define PWM_CTRL2_FRCEN_SHIFT (7U) -/*! FRCEN - Force Enable - * 0b0..Initialization from a FORCE_OUT is disabled. - * 0b1..Initialization from a FORCE_OUT is enabled. - */ -#define PWM_CTRL2_FRCEN(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_FRCEN_SHIFT)) & PWM_CTRL2_FRCEN_MASK) - -#define PWM_CTRL2_INIT_SEL_MASK (0x300U) -#define PWM_CTRL2_INIT_SEL_SHIFT (8U) -/*! INIT_SEL - Initialization Control Select - * 0b00..Local sync (PWM_X) causes initialization. - * 0b01..Master reload from submodule 0 causes initialization. This setting should not be used in submodule 0 as - * it forces the INIT signal to logic 0. The submodule counter will only re-initialize when a master reload - * occurs. - * 0b10..Master sync from submodule 0 causes initialization. This setting should not be used in submodule 0 as it forces the INIT signal to logic 0. - * 0b11..EXT_SYNC causes initialization. - */ -#define PWM_CTRL2_INIT_SEL(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_INIT_SEL_SHIFT)) & PWM_CTRL2_INIT_SEL_MASK) - -#define PWM_CTRL2_PWMX_INIT_MASK (0x400U) -#define PWM_CTRL2_PWMX_INIT_SHIFT (10U) -/*! PWMX_INIT - PWM_X Initial Value */ -#define PWM_CTRL2_PWMX_INIT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_PWMX_INIT_SHIFT)) & PWM_CTRL2_PWMX_INIT_MASK) - -#define PWM_CTRL2_PWM45_INIT_MASK (0x800U) -#define PWM_CTRL2_PWM45_INIT_SHIFT (11U) -/*! PWM45_INIT - PWM45 Initial Value */ -#define PWM_CTRL2_PWM45_INIT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_PWM45_INIT_SHIFT)) & PWM_CTRL2_PWM45_INIT_MASK) - -#define PWM_CTRL2_PWM23_INIT_MASK (0x1000U) -#define PWM_CTRL2_PWM23_INIT_SHIFT (12U) -/*! PWM23_INIT - PWM23 Initial Value */ -#define PWM_CTRL2_PWM23_INIT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_PWM23_INIT_SHIFT)) & PWM_CTRL2_PWM23_INIT_MASK) - -#define PWM_CTRL2_INDEP_MASK (0x2000U) -#define PWM_CTRL2_INDEP_SHIFT (13U) -/*! INDEP - Independent or Complementary Pair Operation - * 0b0..PWM_A and PWM_B form a complementary PWM pair. - * 0b1..PWM_A and PWM_B outputs are independent PWMs. - */ -#define PWM_CTRL2_INDEP(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_INDEP_SHIFT)) & PWM_CTRL2_INDEP_MASK) - -#define PWM_CTRL2_DBGEN_MASK (0x8000U) -#define PWM_CTRL2_DBGEN_SHIFT (15U) -/*! DBGEN - Debug Enable */ -#define PWM_CTRL2_DBGEN(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL2_DBGEN_SHIFT)) & PWM_CTRL2_DBGEN_MASK) -/*! @} */ - -/* The count of PWM_CTRL2 */ -#define PWM_CTRL2_COUNT (4U) - -/*! @name CTRL - Control Register */ -/*! @{ */ - -#define PWM_CTRL_DBLEN_MASK (0x1U) -#define PWM_CTRL_DBLEN_SHIFT (0U) -/*! DBLEN - Double Switching Enable - * 0b0..Double switching disabled. - * 0b1..Double switching enabled. - */ -#define PWM_CTRL_DBLEN(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_DBLEN_SHIFT)) & PWM_CTRL_DBLEN_MASK) - -#define PWM_CTRL_DBLX_MASK (0x2U) -#define PWM_CTRL_DBLX_SHIFT (1U) -/*! DBLX - PWM_X Double Switching Enable - * 0b0..PWM_X double pulse disabled. - * 0b1..PWM_X double pulse enabled. - */ -#define PWM_CTRL_DBLX(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_DBLX_SHIFT)) & PWM_CTRL_DBLX_MASK) - -#define PWM_CTRL_LDMOD_MASK (0x4U) -#define PWM_CTRL_LDMOD_SHIFT (2U) -/*! LDMOD - Load Mode Select - * 0b0..Buffered registers of this submodule are loaded and take effect at the next PWM reload if MCTRL[LDOK] is set. - * 0b1..Buffered registers of this submodule are loaded and take effect immediately upon MCTRL[LDOK] being set. - * In this case, it is not necessary to set CTRL[FULL] or CTRL[HALF]. - */ -#define PWM_CTRL_LDMOD(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_LDMOD_SHIFT)) & PWM_CTRL_LDMOD_MASK) - -#define PWM_CTRL_SPLIT_MASK (0x8U) -#define PWM_CTRL_SPLIT_SHIFT (3U) -/*! SPLIT - Split the DBLPWM signal to PWM_A and PWM_B - * 0b0..DBLPWM is not split. PWM_A and PWM_B each have double pulses. - * 0b1..DBLPWM is split to PWM_A and PWM_B. - */ -#define PWM_CTRL_SPLIT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_SPLIT_SHIFT)) & PWM_CTRL_SPLIT_MASK) - -#define PWM_CTRL_PRSC_MASK (0x70U) -#define PWM_CTRL_PRSC_SHIFT (4U) -/*! PRSC - Prescaler - * 0b000..Prescaler 1 - * 0b001..Prescaler 2 - * 0b010..Prescaler 4 - * 0b011..Prescaler 8 - * 0b100..Prescaler 16 - * 0b101..Prescaler 32 - * 0b110..Prescaler 64 - * 0b111..Prescaler 128 - */ -#define PWM_CTRL_PRSC(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_PRSC_SHIFT)) & PWM_CTRL_PRSC_MASK) - -#define PWM_CTRL_COMPMODE_MASK (0x80U) -#define PWM_CTRL_COMPMODE_SHIFT (7U) -/*! COMPMODE - Compare Mode - * 0b0..The VAL* registers and the PWM counter are compared using an "equal to" method. This means that PWM edges - * are only produced when the counter is equal to one of the VAL* register values. This implies that a PWM_A - * output that is high at the end of a period maintains this state until a match with VAL3 clears the output - * in the following period. - * 0b1..The VAL* registers and the PWM counter are compared using an "equal to or greater than" method. This - * means that PWM edges are produced when the counter is equal to or greater than one of the VAL* register - * values. This implies that a PWM_A output that is high at the end of a period could go low at the start of the - * next period if the starting counter value is greater than (but not necessarily equal to) the new VAL3 value. - */ -#define PWM_CTRL_COMPMODE(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_COMPMODE_SHIFT)) & PWM_CTRL_COMPMODE_MASK) - -#define PWM_CTRL_DT_MASK (0x300U) -#define PWM_CTRL_DT_SHIFT (8U) -/*! DT - Deadtime */ -#define PWM_CTRL_DT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_DT_SHIFT)) & PWM_CTRL_DT_MASK) - -#define PWM_CTRL_FULL_MASK (0x400U) -#define PWM_CTRL_FULL_SHIFT (10U) -/*! FULL - Full Cycle Reload - * 0b0..Full-cycle reloads disabled. - * 0b1..Full-cycle reloads enabled. - */ -#define PWM_CTRL_FULL(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_FULL_SHIFT)) & PWM_CTRL_FULL_MASK) - -#define PWM_CTRL_HALF_MASK (0x800U) -#define PWM_CTRL_HALF_SHIFT (11U) -/*! HALF - Half Cycle Reload - * 0b0..Half-cycle reloads disabled. - * 0b1..Half-cycle reloads enabled. - */ -#define PWM_CTRL_HALF(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_HALF_SHIFT)) & PWM_CTRL_HALF_MASK) - -#define PWM_CTRL_LDFQ_MASK (0xF000U) -#define PWM_CTRL_LDFQ_SHIFT (12U) -/*! LDFQ - Load Frequency - * 0b0000..Every PWM opportunity - * 0b0001..Every 2 PWM opportunities - * 0b0010..Every 3 PWM opportunities - * 0b0011..Every 4 PWM opportunities - * 0b0100..Every 5 PWM opportunities - * 0b0101..Every 6 PWM opportunities - * 0b0110..Every 7 PWM opportunities - * 0b0111..Every 8 PWM opportunities - * 0b1000..Every 9 PWM opportunities - * 0b1001..Every 10 PWM opportunities - * 0b1010..Every 11 PWM opportunities - * 0b1011..Every 12 PWM opportunities - * 0b1100..Every 13 PWM opportunities - * 0b1101..Every 14 PWM opportunities - * 0b1110..Every 15 PWM opportunities - * 0b1111..Every 16 PWM opportunities - */ -#define PWM_CTRL_LDFQ(x) (((uint16_t)(((uint16_t)(x)) << PWM_CTRL_LDFQ_SHIFT)) & PWM_CTRL_LDFQ_MASK) -/*! @} */ - -/* The count of PWM_CTRL */ -#define PWM_CTRL_COUNT (4U) - -/*! @name VAL0 - Value Register 0 */ -/*! @{ */ - -#define PWM_VAL0_VAL0_MASK (0xFFFFU) -#define PWM_VAL0_VAL0_SHIFT (0U) -/*! VAL0 - Value 0 */ -#define PWM_VAL0_VAL0(x) (((uint16_t)(((uint16_t)(x)) << PWM_VAL0_VAL0_SHIFT)) & PWM_VAL0_VAL0_MASK) -/*! @} */ - -/* The count of PWM_VAL0 */ -#define PWM_VAL0_COUNT (4U) - -/*! @name FRACVAL1 - Fractional Value Register 1 */ -/*! @{ */ - -#define PWM_FRACVAL1_FRACVAL1_MASK (0xF800U) -#define PWM_FRACVAL1_FRACVAL1_SHIFT (11U) -/*! FRACVAL1 - Fractional Value 1 */ -#define PWM_FRACVAL1_FRACVAL1(x) (((uint16_t)(((uint16_t)(x)) << PWM_FRACVAL1_FRACVAL1_SHIFT)) & PWM_FRACVAL1_FRACVAL1_MASK) -/*! @} */ - -/* The count of PWM_FRACVAL1 */ -#define PWM_FRACVAL1_COUNT (4U) - -/*! @name VAL1 - Value Register 1 */ -/*! @{ */ - -#define PWM_VAL1_VAL1_MASK (0xFFFFU) -#define PWM_VAL1_VAL1_SHIFT (0U) -/*! VAL1 - Value 1 */ -#define PWM_VAL1_VAL1(x) (((uint16_t)(((uint16_t)(x)) << PWM_VAL1_VAL1_SHIFT)) & PWM_VAL1_VAL1_MASK) -/*! @} */ - -/* The count of PWM_VAL1 */ -#define PWM_VAL1_COUNT (4U) - -/*! @name FRACVAL2 - Fractional Value Register 2 */ -/*! @{ */ - -#define PWM_FRACVAL2_FRACVAL2_MASK (0xF800U) -#define PWM_FRACVAL2_FRACVAL2_SHIFT (11U) -/*! FRACVAL2 - Fractional Value 2 */ -#define PWM_FRACVAL2_FRACVAL2(x) (((uint16_t)(((uint16_t)(x)) << PWM_FRACVAL2_FRACVAL2_SHIFT)) & PWM_FRACVAL2_FRACVAL2_MASK) -/*! @} */ - -/* The count of PWM_FRACVAL2 */ -#define PWM_FRACVAL2_COUNT (4U) - -/*! @name VAL2 - Value Register 2 */ -/*! @{ */ - -#define PWM_VAL2_VAL2_MASK (0xFFFFU) -#define PWM_VAL2_VAL2_SHIFT (0U) -/*! VAL2 - Value 2 */ -#define PWM_VAL2_VAL2(x) (((uint16_t)(((uint16_t)(x)) << PWM_VAL2_VAL2_SHIFT)) & PWM_VAL2_VAL2_MASK) -/*! @} */ - -/* The count of PWM_VAL2 */ -#define PWM_VAL2_COUNT (4U) - -/*! @name FRACVAL3 - Fractional Value Register 3 */ -/*! @{ */ - -#define PWM_FRACVAL3_FRACVAL3_MASK (0xF800U) -#define PWM_FRACVAL3_FRACVAL3_SHIFT (11U) -/*! FRACVAL3 - Fractional Value 3 */ -#define PWM_FRACVAL3_FRACVAL3(x) (((uint16_t)(((uint16_t)(x)) << PWM_FRACVAL3_FRACVAL3_SHIFT)) & PWM_FRACVAL3_FRACVAL3_MASK) -/*! @} */ - -/* The count of PWM_FRACVAL3 */ -#define PWM_FRACVAL3_COUNT (4U) - -/*! @name VAL3 - Value Register 3 */ -/*! @{ */ - -#define PWM_VAL3_VAL3_MASK (0xFFFFU) -#define PWM_VAL3_VAL3_SHIFT (0U) -/*! VAL3 - Value 3 */ -#define PWM_VAL3_VAL3(x) (((uint16_t)(((uint16_t)(x)) << PWM_VAL3_VAL3_SHIFT)) & PWM_VAL3_VAL3_MASK) -/*! @} */ - -/* The count of PWM_VAL3 */ -#define PWM_VAL3_COUNT (4U) - -/*! @name FRACVAL4 - Fractional Value Register 4 */ -/*! @{ */ - -#define PWM_FRACVAL4_FRACVAL4_MASK (0xF800U) -#define PWM_FRACVAL4_FRACVAL4_SHIFT (11U) -/*! FRACVAL4 - Fractional Value 4 */ -#define PWM_FRACVAL4_FRACVAL4(x) (((uint16_t)(((uint16_t)(x)) << PWM_FRACVAL4_FRACVAL4_SHIFT)) & PWM_FRACVAL4_FRACVAL4_MASK) -/*! @} */ - -/* The count of PWM_FRACVAL4 */ -#define PWM_FRACVAL4_COUNT (4U) - -/*! @name VAL4 - Value Register 4 */ -/*! @{ */ - -#define PWM_VAL4_VAL4_MASK (0xFFFFU) -#define PWM_VAL4_VAL4_SHIFT (0U) -/*! VAL4 - Value 4 */ -#define PWM_VAL4_VAL4(x) (((uint16_t)(((uint16_t)(x)) << PWM_VAL4_VAL4_SHIFT)) & PWM_VAL4_VAL4_MASK) -/*! @} */ - -/* The count of PWM_VAL4 */ -#define PWM_VAL4_COUNT (4U) - -/*! @name FRACVAL5 - Fractional Value Register 5 */ -/*! @{ */ - -#define PWM_FRACVAL5_FRACVAL5_MASK (0xF800U) -#define PWM_FRACVAL5_FRACVAL5_SHIFT (11U) -/*! FRACVAL5 - Fractional Value 5 */ -#define PWM_FRACVAL5_FRACVAL5(x) (((uint16_t)(((uint16_t)(x)) << PWM_FRACVAL5_FRACVAL5_SHIFT)) & PWM_FRACVAL5_FRACVAL5_MASK) -/*! @} */ - -/* The count of PWM_FRACVAL5 */ -#define PWM_FRACVAL5_COUNT (4U) - -/*! @name VAL5 - Value Register 5 */ -/*! @{ */ - -#define PWM_VAL5_VAL5_MASK (0xFFFFU) -#define PWM_VAL5_VAL5_SHIFT (0U) -/*! VAL5 - Value 5 */ -#define PWM_VAL5_VAL5(x) (((uint16_t)(((uint16_t)(x)) << PWM_VAL5_VAL5_SHIFT)) & PWM_VAL5_VAL5_MASK) -/*! @} */ - -/* The count of PWM_VAL5 */ -#define PWM_VAL5_COUNT (4U) - -/*! @name FRCTRL - Fractional Control Register */ -/*! @{ */ - -#define PWM_FRCTRL_FRAC1_EN_MASK (0x2U) -#define PWM_FRCTRL_FRAC1_EN_SHIFT (1U) -/*! FRAC1_EN - Fractional Cycle PWM Period Enable - * 0b0..Disable fractional cycle length for the PWM period. - * 0b1..Enable fractional cycle length for the PWM period. - */ -#define PWM_FRCTRL_FRAC1_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_FRCTRL_FRAC1_EN_SHIFT)) & PWM_FRCTRL_FRAC1_EN_MASK) - -#define PWM_FRCTRL_FRAC23_EN_MASK (0x4U) -#define PWM_FRCTRL_FRAC23_EN_SHIFT (2U) -/*! FRAC23_EN - Fractional Cycle Placement Enable for PWM_A - * 0b0..Disable fractional cycle placement for PWM_A. - * 0b1..Enable fractional cycle placement for PWM_A. - */ -#define PWM_FRCTRL_FRAC23_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_FRCTRL_FRAC23_EN_SHIFT)) & PWM_FRCTRL_FRAC23_EN_MASK) - -#define PWM_FRCTRL_FRAC45_EN_MASK (0x10U) -#define PWM_FRCTRL_FRAC45_EN_SHIFT (4U) -/*! FRAC45_EN - Fractional Cycle Placement Enable for PWM_B - * 0b0..Disable fractional cycle placement for PWM_B. - * 0b1..Enable fractional cycle placement for PWM_B. - */ -#define PWM_FRCTRL_FRAC45_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_FRCTRL_FRAC45_EN_SHIFT)) & PWM_FRCTRL_FRAC45_EN_MASK) - -#define PWM_FRCTRL_TEST_MASK (0x8000U) -#define PWM_FRCTRL_TEST_SHIFT (15U) -/*! TEST - Test Status Bit */ -#define PWM_FRCTRL_TEST(x) (((uint16_t)(((uint16_t)(x)) << PWM_FRCTRL_TEST_SHIFT)) & PWM_FRCTRL_TEST_MASK) -/*! @} */ - -/* The count of PWM_FRCTRL */ -#define PWM_FRCTRL_COUNT (4U) - -/*! @name OCTRL - Output Control Register */ -/*! @{ */ - -#define PWM_OCTRL_PWMXFS_MASK (0x3U) -#define PWM_OCTRL_PWMXFS_SHIFT (0U) -/*! PWMXFS - PWM_X Fault State - * 0b00..Output is forced to logic 0 state prior to consideration of output polarity control. - * 0b01..Output is forced to logic 1 state prior to consideration of output polarity control. - * 0b10, 0b11..Output is put in a high-impedance state. - */ -#define PWM_OCTRL_PWMXFS(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_PWMXFS_SHIFT)) & PWM_OCTRL_PWMXFS_MASK) - -#define PWM_OCTRL_PWMBFS_MASK (0xCU) -#define PWM_OCTRL_PWMBFS_SHIFT (2U) -/*! PWMBFS - PWM_B Fault State - * 0b00..Output is forced to logic 0 state prior to consideration of output polarity control. - * 0b01..Output is forced to logic 1 state prior to consideration of output polarity control. - * 0b10, 0b11..Output is put in a high-impedance state. - */ -#define PWM_OCTRL_PWMBFS(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_PWMBFS_SHIFT)) & PWM_OCTRL_PWMBFS_MASK) - -#define PWM_OCTRL_PWMAFS_MASK (0x30U) -#define PWM_OCTRL_PWMAFS_SHIFT (4U) -/*! PWMAFS - PWM_A Fault State - * 0b00..Output is forced to logic 0 state prior to consideration of output polarity control. - * 0b01..Output is forced to logic 1 state prior to consideration of output polarity control. - * 0b10, 0b11..Output is put in a high-impedance state. - */ -#define PWM_OCTRL_PWMAFS(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_PWMAFS_SHIFT)) & PWM_OCTRL_PWMAFS_MASK) - -#define PWM_OCTRL_POLX_MASK (0x100U) -#define PWM_OCTRL_POLX_SHIFT (8U) -/*! POLX - PWM_X Output Polarity - * 0b0..PWM_X output not inverted. A high level on the PWM_X pin represents the "on" or "active" state. - * 0b1..PWM_X output inverted. A low level on the PWM_X pin represents the "on" or "active" state. - */ -#define PWM_OCTRL_POLX(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_POLX_SHIFT)) & PWM_OCTRL_POLX_MASK) - -#define PWM_OCTRL_POLB_MASK (0x200U) -#define PWM_OCTRL_POLB_SHIFT (9U) -/*! POLB - PWM_B Output Polarity - * 0b0..PWM_B output not inverted. A high level on the PWM_B pin represents the "on" or "active" state. - * 0b1..PWM_B output inverted. A low level on the PWM_B pin represents the "on" or "active" state. - */ -#define PWM_OCTRL_POLB(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_POLB_SHIFT)) & PWM_OCTRL_POLB_MASK) - -#define PWM_OCTRL_POLA_MASK (0x400U) -#define PWM_OCTRL_POLA_SHIFT (10U) -/*! POLA - PWM_A Output Polarity - * 0b0..PWM_A output not inverted. A high level on the PWM_A pin represents the "on" or "active" state. - * 0b1..PWM_A output inverted. A low level on the PWM_A pin represents the "on" or "active" state. - */ -#define PWM_OCTRL_POLA(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_POLA_SHIFT)) & PWM_OCTRL_POLA_MASK) - -#define PWM_OCTRL_PWMX_IN_MASK (0x2000U) -#define PWM_OCTRL_PWMX_IN_SHIFT (13U) -/*! PWMX_IN - PWM_X Input */ -#define PWM_OCTRL_PWMX_IN(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_PWMX_IN_SHIFT)) & PWM_OCTRL_PWMX_IN_MASK) - -#define PWM_OCTRL_PWMB_IN_MASK (0x4000U) -#define PWM_OCTRL_PWMB_IN_SHIFT (14U) -/*! PWMB_IN - PWM_B Input */ -#define PWM_OCTRL_PWMB_IN(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_PWMB_IN_SHIFT)) & PWM_OCTRL_PWMB_IN_MASK) - -#define PWM_OCTRL_PWMA_IN_MASK (0x8000U) -#define PWM_OCTRL_PWMA_IN_SHIFT (15U) -/*! PWMA_IN - PWM_A Input */ -#define PWM_OCTRL_PWMA_IN(x) (((uint16_t)(((uint16_t)(x)) << PWM_OCTRL_PWMA_IN_SHIFT)) & PWM_OCTRL_PWMA_IN_MASK) -/*! @} */ - -/* The count of PWM_OCTRL */ -#define PWM_OCTRL_COUNT (4U) - -/*! @name STS - Status Register */ -/*! @{ */ - -#define PWM_STS_CMPF_MASK (0x3FU) -#define PWM_STS_CMPF_SHIFT (0U) -/*! CMPF - Compare Flags - * 0b000000..No compare event has occurred for a particular VALx value. - * 0b000001..A compare event has occurred for a particular VALx value. - */ -#define PWM_STS_CMPF(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_CMPF_SHIFT)) & PWM_STS_CMPF_MASK) - -#define PWM_STS_CFX0_MASK (0x40U) -#define PWM_STS_CFX0_SHIFT (6U) -/*! CFX0 - Capture Flag X0 */ -#define PWM_STS_CFX0(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_CFX0_SHIFT)) & PWM_STS_CFX0_MASK) - -#define PWM_STS_CFX1_MASK (0x80U) -#define PWM_STS_CFX1_SHIFT (7U) -/*! CFX1 - Capture Flag X1 */ -#define PWM_STS_CFX1(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_CFX1_SHIFT)) & PWM_STS_CFX1_MASK) - -#define PWM_STS_CFB0_MASK (0x100U) -#define PWM_STS_CFB0_SHIFT (8U) -/*! CFB0 - Capture Flag B0 */ -#define PWM_STS_CFB0(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_CFB0_SHIFT)) & PWM_STS_CFB0_MASK) - -#define PWM_STS_CFB1_MASK (0x200U) -#define PWM_STS_CFB1_SHIFT (9U) -/*! CFB1 - Capture Flag B1 */ -#define PWM_STS_CFB1(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_CFB1_SHIFT)) & PWM_STS_CFB1_MASK) - -#define PWM_STS_CFA0_MASK (0x400U) -#define PWM_STS_CFA0_SHIFT (10U) -/*! CFA0 - Capture Flag A0 */ -#define PWM_STS_CFA0(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_CFA0_SHIFT)) & PWM_STS_CFA0_MASK) - -#define PWM_STS_CFA1_MASK (0x800U) -#define PWM_STS_CFA1_SHIFT (11U) -/*! CFA1 - Capture Flag A1 */ -#define PWM_STS_CFA1(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_CFA1_SHIFT)) & PWM_STS_CFA1_MASK) - -#define PWM_STS_RF_MASK (0x1000U) -#define PWM_STS_RF_SHIFT (12U) -/*! RF - Reload Flag - * 0b0..No new reload cycle since last STS[RF] clearing - * 0b1..New reload cycle since last STS[RF] clearing - */ -#define PWM_STS_RF(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_RF_SHIFT)) & PWM_STS_RF_MASK) - -#define PWM_STS_REF_MASK (0x2000U) -#define PWM_STS_REF_SHIFT (13U) -/*! REF - Reload Error Flag - * 0b0..No reload error occurred. - * 0b1..Reload signal occurred with non-coherent data and MCTRL[LDOK] = 0. - */ -#define PWM_STS_REF(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_REF_SHIFT)) & PWM_STS_REF_MASK) - -#define PWM_STS_RUF_MASK (0x4000U) -#define PWM_STS_RUF_SHIFT (14U) -/*! RUF - Registers Updated Flag - * 0b0..No register update has occurred since last reload. - * 0b1..At least one of the double buffered registers has been updated since the last reload. - */ -#define PWM_STS_RUF(x) (((uint16_t)(((uint16_t)(x)) << PWM_STS_RUF_SHIFT)) & PWM_STS_RUF_MASK) -/*! @} */ - -/* The count of PWM_STS */ -#define PWM_STS_COUNT (4U) - -/*! @name INTEN - Interrupt Enable Register */ -/*! @{ */ - -#define PWM_INTEN_CMPIE_MASK (0x3FU) -#define PWM_INTEN_CMPIE_SHIFT (0U) -/*! CMPIE - Compare Interrupt Enables - * 0b000000..The corresponding STS[CMPF] bit will not cause an interrupt request. - * 0b000001..The corresponding STS[CMPF] bit will cause an interrupt request. - */ -#define PWM_INTEN_CMPIE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_CMPIE_SHIFT)) & PWM_INTEN_CMPIE_MASK) - -#define PWM_INTEN_CX0IE_MASK (0x40U) -#define PWM_INTEN_CX0IE_SHIFT (6U) -/*! CX0IE - Capture X 0 Interrupt Enable - * 0b0..Interrupt request disabled for STS[CFX0]. - * 0b1..Interrupt request enabled for STS[CFX0]. - */ -#define PWM_INTEN_CX0IE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_CX0IE_SHIFT)) & PWM_INTEN_CX0IE_MASK) - -#define PWM_INTEN_CX1IE_MASK (0x80U) -#define PWM_INTEN_CX1IE_SHIFT (7U) -/*! CX1IE - Capture X 1 Interrupt Enable - * 0b0..Interrupt request disabled for STS[CFX1]. - * 0b1..Interrupt request enabled for STS[CFX1]. - */ -#define PWM_INTEN_CX1IE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_CX1IE_SHIFT)) & PWM_INTEN_CX1IE_MASK) - -#define PWM_INTEN_CB0IE_MASK (0x100U) -#define PWM_INTEN_CB0IE_SHIFT (8U) -/*! CB0IE - Capture B 0 Interrupt Enable - * 0b0..Interrupt request disabled for STS[CFB0]. - * 0b1..Interrupt request enabled for STS[CFB0]. - */ -#define PWM_INTEN_CB0IE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_CB0IE_SHIFT)) & PWM_INTEN_CB0IE_MASK) - -#define PWM_INTEN_CB1IE_MASK (0x200U) -#define PWM_INTEN_CB1IE_SHIFT (9U) -/*! CB1IE - Capture B 1 Interrupt Enable - * 0b0..Interrupt request disabled for STS[CFB1]. - * 0b1..Interrupt request enabled for STS[CFB1]. - */ -#define PWM_INTEN_CB1IE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_CB1IE_SHIFT)) & PWM_INTEN_CB1IE_MASK) - -#define PWM_INTEN_CA0IE_MASK (0x400U) -#define PWM_INTEN_CA0IE_SHIFT (10U) -/*! CA0IE - Capture A 0 Interrupt Enable - * 0b0..Interrupt request disabled for STS[CFA0]. - * 0b1..Interrupt request enabled for STS[CFA0]. - */ -#define PWM_INTEN_CA0IE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_CA0IE_SHIFT)) & PWM_INTEN_CA0IE_MASK) - -#define PWM_INTEN_CA1IE_MASK (0x800U) -#define PWM_INTEN_CA1IE_SHIFT (11U) -/*! CA1IE - Capture A 1 Interrupt Enable - * 0b0..Interrupt request disabled for STS[CFA1] - * 0b1..Interrupt request enabled for STS[CFA1] - */ -#define PWM_INTEN_CA1IE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_CA1IE_SHIFT)) & PWM_INTEN_CA1IE_MASK) - -#define PWM_INTEN_RIE_MASK (0x1000U) -#define PWM_INTEN_RIE_SHIFT (12U) -/*! RIE - Reload Interrupt Enable - * 0b0..STS[RF] CPU interrupt requests disabled - * 0b1..STS[RF] CPU interrupt requests enabled - */ -#define PWM_INTEN_RIE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_RIE_SHIFT)) & PWM_INTEN_RIE_MASK) - -#define PWM_INTEN_REIE_MASK (0x2000U) -#define PWM_INTEN_REIE_SHIFT (13U) -/*! REIE - Reload Error Interrupt Enable - * 0b0..STS[REF] CPU interrupt requests disabled - * 0b1..STS[REF] CPU interrupt requests enabled - */ -#define PWM_INTEN_REIE(x) (((uint16_t)(((uint16_t)(x)) << PWM_INTEN_REIE_SHIFT)) & PWM_INTEN_REIE_MASK) -/*! @} */ - -/* The count of PWM_INTEN */ -#define PWM_INTEN_COUNT (4U) - -/*! @name DMAEN - DMA Enable Register */ -/*! @{ */ - -#define PWM_DMAEN_CX0DE_MASK (0x1U) -#define PWM_DMAEN_CX0DE_SHIFT (0U) -/*! CX0DE - Capture X0 FIFO DMA Enable */ -#define PWM_DMAEN_CX0DE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_CX0DE_SHIFT)) & PWM_DMAEN_CX0DE_MASK) - -#define PWM_DMAEN_CX1DE_MASK (0x2U) -#define PWM_DMAEN_CX1DE_SHIFT (1U) -/*! CX1DE - Capture X1 FIFO DMA Enable */ -#define PWM_DMAEN_CX1DE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_CX1DE_SHIFT)) & PWM_DMAEN_CX1DE_MASK) - -#define PWM_DMAEN_CB0DE_MASK (0x4U) -#define PWM_DMAEN_CB0DE_SHIFT (2U) -/*! CB0DE - Capture B0 FIFO DMA Enable */ -#define PWM_DMAEN_CB0DE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_CB0DE_SHIFT)) & PWM_DMAEN_CB0DE_MASK) - -#define PWM_DMAEN_CB1DE_MASK (0x8U) -#define PWM_DMAEN_CB1DE_SHIFT (3U) -/*! CB1DE - Capture B1 FIFO DMA Enable */ -#define PWM_DMAEN_CB1DE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_CB1DE_SHIFT)) & PWM_DMAEN_CB1DE_MASK) - -#define PWM_DMAEN_CA0DE_MASK (0x10U) -#define PWM_DMAEN_CA0DE_SHIFT (4U) -/*! CA0DE - Capture A0 FIFO DMA Enable */ -#define PWM_DMAEN_CA0DE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_CA0DE_SHIFT)) & PWM_DMAEN_CA0DE_MASK) - -#define PWM_DMAEN_CA1DE_MASK (0x20U) -#define PWM_DMAEN_CA1DE_SHIFT (5U) -/*! CA1DE - Capture A1 FIFO DMA Enable */ -#define PWM_DMAEN_CA1DE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_CA1DE_SHIFT)) & PWM_DMAEN_CA1DE_MASK) - -#define PWM_DMAEN_CAPTDE_MASK (0xC0U) -#define PWM_DMAEN_CAPTDE_SHIFT (6U) -/*! CAPTDE - Capture DMA Enable Source Select - * 0b00..Read DMA requests disabled. - * 0b01..Exceeding a FIFO watermark sets the DMA read request. This requires at least one of DMAEN[CA1DE], - * DMAEN[CA0DE], DMAEN[CB1DE], DMAEN[CB0DE], DMAEN[CX1DE], or DMAEN[CX0DE] to be set to determine which - * watermark(s) the DMA request is sensitive. - * 0b10..A local synchronization (VAL1 matches counter) sets the read DMA request. - * 0b11..A local reload (STS[RF] being set) sets the read DMA request. - */ -#define PWM_DMAEN_CAPTDE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_CAPTDE_SHIFT)) & PWM_DMAEN_CAPTDE_MASK) - -#define PWM_DMAEN_FAND_MASK (0x100U) -#define PWM_DMAEN_FAND_SHIFT (8U) -/*! FAND - FIFO Watermark AND Control - * 0b0..Selected FIFO watermarks are OR'ed together. - * 0b1..Selected FIFO watermarks are AND'ed together. - */ -#define PWM_DMAEN_FAND(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_FAND_SHIFT)) & PWM_DMAEN_FAND_MASK) - -#define PWM_DMAEN_VALDE_MASK (0x200U) -#define PWM_DMAEN_VALDE_SHIFT (9U) -/*! VALDE - Value Registers DMA Enable - * 0b0..DMA write requests disabled - * 0b1..Enabled - */ -#define PWM_DMAEN_VALDE(x) (((uint16_t)(((uint16_t)(x)) << PWM_DMAEN_VALDE_SHIFT)) & PWM_DMAEN_VALDE_MASK) -/*! @} */ - -/* The count of PWM_DMAEN */ -#define PWM_DMAEN_COUNT (4U) - -/*! @name TCTRL - Output Trigger Control Register */ -/*! @{ */ - -#define PWM_TCTRL_OUT_TRIG_EN_MASK (0x3FU) -#define PWM_TCTRL_OUT_TRIG_EN_SHIFT (0U) -/*! OUT_TRIG_EN - Output Trigger Enables - * 0bxxxxx1..PWM_OUT_TRIG0 will set when the counter value matches the VAL0 value. - * 0bxxxx1x..PWM_OUT_TRIG1 will set when the counter value matches the VAL1 value. - * 0bxxx1xx..PWM_OUT_TRIG0 will set when the counter value matches the VAL2 value. - * 0bxx1xxx..PWM_OUT_TRIG1 will set when the counter value matches the VAL3 value. - * 0bx1xxxx..PWM_OUT_TRIG0 will set when the counter value matches the VAL4 value. - * 0b1xxxxx..PWM_OUT_TRIG1 will set when the counter value matches the VAL5 value. - */ -#define PWM_TCTRL_OUT_TRIG_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_TCTRL_OUT_TRIG_EN_SHIFT)) & PWM_TCTRL_OUT_TRIG_EN_MASK) - -#define PWM_TCTRL_TRGFRQ_MASK (0x1000U) -#define PWM_TCTRL_TRGFRQ_SHIFT (12U) -/*! TRGFRQ - Trigger Frequency - * 0b0..Trigger outputs are generated during every PWM period even if the PWM is not reloaded every period due to CTRL[LDFQ] being non-zero. - * 0b1..Trigger outputs are generated only during the final PWM period prior to a reload opportunity when the PWM - * is not reloaded every period due to CTRL[LDFQ] being non-zero. - */ -#define PWM_TCTRL_TRGFRQ(x) (((uint16_t)(((uint16_t)(x)) << PWM_TCTRL_TRGFRQ_SHIFT)) & PWM_TCTRL_TRGFRQ_MASK) - -#define PWM_TCTRL_PWBOT1_MASK (0x4000U) -#define PWM_TCTRL_PWBOT1_SHIFT (14U) -/*! PWBOT1 - Mux Output Trigger 1 Source Select - * 0b0..Route the PWM_OUT_TRIG1 signal to PWM_MUX_TRIG1 port. - * 0b1..Route the PWM_B output to the PWM_MUX_TRIG1 port. - */ -#define PWM_TCTRL_PWBOT1(x) (((uint16_t)(((uint16_t)(x)) << PWM_TCTRL_PWBOT1_SHIFT)) & PWM_TCTRL_PWBOT1_MASK) - -#define PWM_TCTRL_PWAOT0_MASK (0x8000U) -#define PWM_TCTRL_PWAOT0_SHIFT (15U) -/*! PWAOT0 - Mux Output Trigger 0 Source Select - * 0b0..Route the PWM_OUT_TRIG0 signal to PWM_MUX_TRIG0 port. - * 0b1..Route the PWM_A output to the PWM_MUX_TRIG0 port. - */ -#define PWM_TCTRL_PWAOT0(x) (((uint16_t)(((uint16_t)(x)) << PWM_TCTRL_PWAOT0_SHIFT)) & PWM_TCTRL_PWAOT0_MASK) -/*! @} */ - -/* The count of PWM_TCTRL */ -#define PWM_TCTRL_COUNT (4U) - -/*! @name DISMAP - Fault Disable Mapping Register 0 */ -/*! @{ */ - -#define PWM_DISMAP_DIS0A_MASK (0xFU) -#define PWM_DISMAP_DIS0A_SHIFT (0U) -/*! DIS0A - PWM_A Fault Disable Mask 0 */ -#define PWM_DISMAP_DIS0A(x) (((uint16_t)(((uint16_t)(x)) << PWM_DISMAP_DIS0A_SHIFT)) & PWM_DISMAP_DIS0A_MASK) - -#define PWM_DISMAP_DIS0B_MASK (0xF0U) -#define PWM_DISMAP_DIS0B_SHIFT (4U) -/*! DIS0B - PWM_B Fault Disable Mask 0 */ -#define PWM_DISMAP_DIS0B(x) (((uint16_t)(((uint16_t)(x)) << PWM_DISMAP_DIS0B_SHIFT)) & PWM_DISMAP_DIS0B_MASK) - -#define PWM_DISMAP_DIS0X_MASK (0xF00U) -#define PWM_DISMAP_DIS0X_SHIFT (8U) -/*! DIS0X - PWM_X Fault Disable Mask 0 */ -#define PWM_DISMAP_DIS0X(x) (((uint16_t)(((uint16_t)(x)) << PWM_DISMAP_DIS0X_SHIFT)) & PWM_DISMAP_DIS0X_MASK) -/*! @} */ - -/* The count of PWM_DISMAP */ -#define PWM_DISMAP_COUNT (4U) - -/* The count of PWM_DISMAP */ -#define PWM_DISMAP_COUNT2 (1U) - -/*! @name DTCNT0 - Deadtime Count Register 0 */ -/*! @{ */ - -#define PWM_DTCNT0_DTCNT0_MASK (0x7FFU) -#define PWM_DTCNT0_DTCNT0_SHIFT (0U) -/*! DTCNT0 - Deadtime Count Register 0 */ -#define PWM_DTCNT0_DTCNT0(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTCNT0_DTCNT0_SHIFT)) & PWM_DTCNT0_DTCNT0_MASK) -/*! @} */ - -/* The count of PWM_DTCNT0 */ -#define PWM_DTCNT0_COUNT (4U) - -/*! @name DTCNT1 - Deadtime Count Register 1 */ -/*! @{ */ - -#define PWM_DTCNT1_DTCNT1_MASK (0x7FFU) -#define PWM_DTCNT1_DTCNT1_SHIFT (0U) -/*! DTCNT1 - Deadtime Count Register 1 */ -#define PWM_DTCNT1_DTCNT1(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTCNT1_DTCNT1_SHIFT)) & PWM_DTCNT1_DTCNT1_MASK) -/*! @} */ - -/* The count of PWM_DTCNT1 */ -#define PWM_DTCNT1_COUNT (4U) - -/*! @name CAPTCTRLA - Capture Control A Register */ -/*! @{ */ - -#define PWM_CAPTCTRLA_ARMA_MASK (0x1U) -#define PWM_CAPTCTRLA_ARMA_SHIFT (0U) -/*! ARMA - Arm A - * 0b0..Input capture operation is disabled. - * 0b1..Input capture operation as specified by CAPTCTRLA[EDGAx] is enabled. - */ -#define PWM_CAPTCTRLA_ARMA(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLA_ARMA_SHIFT)) & PWM_CAPTCTRLA_ARMA_MASK) - -#define PWM_CAPTCTRLA_ONESHOTA_MASK (0x2U) -#define PWM_CAPTCTRLA_ONESHOTA_SHIFT (1U) -/*! ONESHOTA - One Shot Mode A - * 0b0..Free Running - * 0b1..One Shot - */ -#define PWM_CAPTCTRLA_ONESHOTA(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLA_ONESHOTA_SHIFT)) & PWM_CAPTCTRLA_ONESHOTA_MASK) - -#define PWM_CAPTCTRLA_EDGA0_MASK (0xCU) -#define PWM_CAPTCTRLA_EDGA0_SHIFT (2U) -/*! EDGA0 - Edge A 0 - * 0b00..Disabled - * 0b01..Capture falling edges - * 0b10..Capture rising edges - * 0b11..Capture any edge - */ -#define PWM_CAPTCTRLA_EDGA0(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLA_EDGA0_SHIFT)) & PWM_CAPTCTRLA_EDGA0_MASK) - -#define PWM_CAPTCTRLA_EDGA1_MASK (0x30U) -#define PWM_CAPTCTRLA_EDGA1_SHIFT (4U) -/*! EDGA1 - Edge A 1 - * 0b00..Disabled - * 0b01..Capture falling edges - * 0b10..Capture rising edges - * 0b11..Capture any edge - */ -#define PWM_CAPTCTRLA_EDGA1(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLA_EDGA1_SHIFT)) & PWM_CAPTCTRLA_EDGA1_MASK) - -#define PWM_CAPTCTRLA_INP_SELA_MASK (0x40U) -#define PWM_CAPTCTRLA_INP_SELA_SHIFT (6U) -/*! INP_SELA - Input Select A - * 0b0..Raw PWM_A input signal selected as source. - * 0b1..Edge Counter - */ -#define PWM_CAPTCTRLA_INP_SELA(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLA_INP_SELA_SHIFT)) & PWM_CAPTCTRLA_INP_SELA_MASK) - -#define PWM_CAPTCTRLA_EDGCNTA_EN_MASK (0x80U) -#define PWM_CAPTCTRLA_EDGCNTA_EN_SHIFT (7U) -/*! EDGCNTA_EN - Edge Counter A Enable - * 0b0..Edge counter disabled and held in reset - * 0b1..Edge counter enabled - */ -#define PWM_CAPTCTRLA_EDGCNTA_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLA_EDGCNTA_EN_SHIFT)) & PWM_CAPTCTRLA_EDGCNTA_EN_MASK) - -#define PWM_CAPTCTRLA_CFAWM_MASK (0x300U) -#define PWM_CAPTCTRLA_CFAWM_SHIFT (8U) -/*! CFAWM - Capture A FIFOs Water Mark */ -#define PWM_CAPTCTRLA_CFAWM(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLA_CFAWM_SHIFT)) & PWM_CAPTCTRLA_CFAWM_MASK) - -#define PWM_CAPTCTRLA_CA0CNT_MASK (0x1C00U) -#define PWM_CAPTCTRLA_CA0CNT_SHIFT (10U) -/*! CA0CNT - Capture A0 FIFO Word Count */ -#define PWM_CAPTCTRLA_CA0CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLA_CA0CNT_SHIFT)) & PWM_CAPTCTRLA_CA0CNT_MASK) - -#define PWM_CAPTCTRLA_CA1CNT_MASK (0xE000U) -#define PWM_CAPTCTRLA_CA1CNT_SHIFT (13U) -/*! CA1CNT - Capture A1 FIFO Word Count */ -#define PWM_CAPTCTRLA_CA1CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLA_CA1CNT_SHIFT)) & PWM_CAPTCTRLA_CA1CNT_MASK) -/*! @} */ - -/* The count of PWM_CAPTCTRLA */ -#define PWM_CAPTCTRLA_COUNT (4U) - -/*! @name CAPTCOMPA - Capture Compare A Register */ -/*! @{ */ - -#define PWM_CAPTCOMPA_EDGCMPA_MASK (0xFFU) -#define PWM_CAPTCOMPA_EDGCMPA_SHIFT (0U) -/*! EDGCMPA - Edge Compare A */ -#define PWM_CAPTCOMPA_EDGCMPA(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCOMPA_EDGCMPA_SHIFT)) & PWM_CAPTCOMPA_EDGCMPA_MASK) - -#define PWM_CAPTCOMPA_EDGCNTA_MASK (0xFF00U) -#define PWM_CAPTCOMPA_EDGCNTA_SHIFT (8U) -/*! EDGCNTA - Edge Counter A */ -#define PWM_CAPTCOMPA_EDGCNTA(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCOMPA_EDGCNTA_SHIFT)) & PWM_CAPTCOMPA_EDGCNTA_MASK) -/*! @} */ - -/* The count of PWM_CAPTCOMPA */ -#define PWM_CAPTCOMPA_COUNT (4U) - -/*! @name CAPTCTRLB - Capture Control B Register */ -/*! @{ */ - -#define PWM_CAPTCTRLB_ARMB_MASK (0x1U) -#define PWM_CAPTCTRLB_ARMB_SHIFT (0U) -/*! ARMB - Arm B - * 0b0..Input capture operation is disabled. - * 0b1..Input capture operation as specified by CAPTCTRLB[EDGBx] is enabled. - */ -#define PWM_CAPTCTRLB_ARMB(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLB_ARMB_SHIFT)) & PWM_CAPTCTRLB_ARMB_MASK) - -#define PWM_CAPTCTRLB_ONESHOTB_MASK (0x2U) -#define PWM_CAPTCTRLB_ONESHOTB_SHIFT (1U) -/*! ONESHOTB - One Shot Mode B - * 0b0..Free Running - * 0b1..One Shot - */ -#define PWM_CAPTCTRLB_ONESHOTB(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLB_ONESHOTB_SHIFT)) & PWM_CAPTCTRLB_ONESHOTB_MASK) - -#define PWM_CAPTCTRLB_EDGB0_MASK (0xCU) -#define PWM_CAPTCTRLB_EDGB0_SHIFT (2U) -/*! EDGB0 - Edge B 0 - * 0b00..Disabled - * 0b01..Capture falling edges - * 0b10..Capture rising edges - * 0b11..Capture any edge - */ -#define PWM_CAPTCTRLB_EDGB0(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLB_EDGB0_SHIFT)) & PWM_CAPTCTRLB_EDGB0_MASK) - -#define PWM_CAPTCTRLB_EDGB1_MASK (0x30U) -#define PWM_CAPTCTRLB_EDGB1_SHIFT (4U) -/*! EDGB1 - Edge B 1 - * 0b00..Disabled - * 0b01..Capture falling edges - * 0b10..Capture rising edges - * 0b11..Capture any edge - */ -#define PWM_CAPTCTRLB_EDGB1(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLB_EDGB1_SHIFT)) & PWM_CAPTCTRLB_EDGB1_MASK) - -#define PWM_CAPTCTRLB_INP_SELB_MASK (0x40U) -#define PWM_CAPTCTRLB_INP_SELB_SHIFT (6U) -/*! INP_SELB - Input Select B - * 0b0..Raw PWM_B input signal selected as source. - * 0b1..Edge Counter - */ -#define PWM_CAPTCTRLB_INP_SELB(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLB_INP_SELB_SHIFT)) & PWM_CAPTCTRLB_INP_SELB_MASK) - -#define PWM_CAPTCTRLB_EDGCNTB_EN_MASK (0x80U) -#define PWM_CAPTCTRLB_EDGCNTB_EN_SHIFT (7U) -/*! EDGCNTB_EN - Edge Counter B Enable - * 0b0..Edge counter disabled and held in reset - * 0b1..Edge counter enabled - */ -#define PWM_CAPTCTRLB_EDGCNTB_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLB_EDGCNTB_EN_SHIFT)) & PWM_CAPTCTRLB_EDGCNTB_EN_MASK) - -#define PWM_CAPTCTRLB_CFBWM_MASK (0x300U) -#define PWM_CAPTCTRLB_CFBWM_SHIFT (8U) -/*! CFBWM - Capture B FIFOs Water Mark */ -#define PWM_CAPTCTRLB_CFBWM(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLB_CFBWM_SHIFT)) & PWM_CAPTCTRLB_CFBWM_MASK) - -#define PWM_CAPTCTRLB_CB0CNT_MASK (0x1C00U) -#define PWM_CAPTCTRLB_CB0CNT_SHIFT (10U) -/*! CB0CNT - Capture B0 FIFO Word Count */ -#define PWM_CAPTCTRLB_CB0CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLB_CB0CNT_SHIFT)) & PWM_CAPTCTRLB_CB0CNT_MASK) - -#define PWM_CAPTCTRLB_CB1CNT_MASK (0xE000U) -#define PWM_CAPTCTRLB_CB1CNT_SHIFT (13U) -/*! CB1CNT - Capture B1 FIFO Word Count */ -#define PWM_CAPTCTRLB_CB1CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLB_CB1CNT_SHIFT)) & PWM_CAPTCTRLB_CB1CNT_MASK) -/*! @} */ - -/* The count of PWM_CAPTCTRLB */ -#define PWM_CAPTCTRLB_COUNT (4U) - -/*! @name CAPTCOMPB - Capture Compare B Register */ -/*! @{ */ - -#define PWM_CAPTCOMPB_EDGCMPB_MASK (0xFFU) -#define PWM_CAPTCOMPB_EDGCMPB_SHIFT (0U) -/*! EDGCMPB - Edge Compare B */ -#define PWM_CAPTCOMPB_EDGCMPB(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCOMPB_EDGCMPB_SHIFT)) & PWM_CAPTCOMPB_EDGCMPB_MASK) - -#define PWM_CAPTCOMPB_EDGCNTB_MASK (0xFF00U) -#define PWM_CAPTCOMPB_EDGCNTB_SHIFT (8U) -/*! EDGCNTB - Edge Counter B */ -#define PWM_CAPTCOMPB_EDGCNTB(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCOMPB_EDGCNTB_SHIFT)) & PWM_CAPTCOMPB_EDGCNTB_MASK) -/*! @} */ - -/* The count of PWM_CAPTCOMPB */ -#define PWM_CAPTCOMPB_COUNT (4U) - -/*! @name CAPTCTRLX - Capture Control X Register */ -/*! @{ */ - -#define PWM_CAPTCTRLX_ARMX_MASK (0x1U) -#define PWM_CAPTCTRLX_ARMX_SHIFT (0U) -/*! ARMX - Arm X - * 0b0..Input capture operation is disabled. - * 0b1..Input capture operation as specified by CAPTCTRLX[EDGXx] is enabled. - */ -#define PWM_CAPTCTRLX_ARMX(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_ARMX_SHIFT)) & PWM_CAPTCTRLX_ARMX_MASK) - -#define PWM_CAPTCTRLX_ONESHOTX_MASK (0x2U) -#define PWM_CAPTCTRLX_ONESHOTX_SHIFT (1U) -/*! ONESHOTX - One Shot Mode Aux - * 0b0..Free Running - * 0b1..One Shot - */ -#define PWM_CAPTCTRLX_ONESHOTX(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_ONESHOTX_SHIFT)) & PWM_CAPTCTRLX_ONESHOTX_MASK) - -#define PWM_CAPTCTRLX_EDGX0_MASK (0xCU) -#define PWM_CAPTCTRLX_EDGX0_SHIFT (2U) -/*! EDGX0 - Edge X 0 - * 0b00..Disabled - * 0b01..Capture falling edges - * 0b10..Capture rising edges - * 0b11..Capture any edge - */ -#define PWM_CAPTCTRLX_EDGX0(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_EDGX0_SHIFT)) & PWM_CAPTCTRLX_EDGX0_MASK) - -#define PWM_CAPTCTRLX_EDGX1_MASK (0x30U) -#define PWM_CAPTCTRLX_EDGX1_SHIFT (4U) -/*! EDGX1 - Edge X 1 - * 0b00..Disabled - * 0b01..Capture falling edges - * 0b10..Capture rising edges - * 0b11..Capture any edge - */ -#define PWM_CAPTCTRLX_EDGX1(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_EDGX1_SHIFT)) & PWM_CAPTCTRLX_EDGX1_MASK) - -#define PWM_CAPTCTRLX_INP_SELX_MASK (0x40U) -#define PWM_CAPTCTRLX_INP_SELX_SHIFT (6U) -/*! INP_SELX - Input Select X - * 0b0..Raw PWM_X input signal selected as source. - * 0b1..Edge Counter - */ -#define PWM_CAPTCTRLX_INP_SELX(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_INP_SELX_SHIFT)) & PWM_CAPTCTRLX_INP_SELX_MASK) - -#define PWM_CAPTCTRLX_EDGCNTX_EN_MASK (0x80U) -#define PWM_CAPTCTRLX_EDGCNTX_EN_SHIFT (7U) -/*! EDGCNTX_EN - Edge Counter X Enable - * 0b0..Edge counter disabled and held in reset - * 0b1..Edge counter enabled - */ -#define PWM_CAPTCTRLX_EDGCNTX_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_EDGCNTX_EN_SHIFT)) & PWM_CAPTCTRLX_EDGCNTX_EN_MASK) - -#define PWM_CAPTCTRLX_CFXWM_MASK (0x300U) -#define PWM_CAPTCTRLX_CFXWM_SHIFT (8U) -/*! CFXWM - Capture X FIFOs Water Mark */ -#define PWM_CAPTCTRLX_CFXWM(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_CFXWM_SHIFT)) & PWM_CAPTCTRLX_CFXWM_MASK) - -#define PWM_CAPTCTRLX_CX0CNT_MASK (0x1C00U) -#define PWM_CAPTCTRLX_CX0CNT_SHIFT (10U) -/*! CX0CNT - Capture X0 FIFO Word Count */ -#define PWM_CAPTCTRLX_CX0CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_CX0CNT_SHIFT)) & PWM_CAPTCTRLX_CX0CNT_MASK) - -#define PWM_CAPTCTRLX_CX1CNT_MASK (0xE000U) -#define PWM_CAPTCTRLX_CX1CNT_SHIFT (13U) -/*! CX1CNT - Capture X1 FIFO Word Count */ -#define PWM_CAPTCTRLX_CX1CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCTRLX_CX1CNT_SHIFT)) & PWM_CAPTCTRLX_CX1CNT_MASK) -/*! @} */ - -/* The count of PWM_CAPTCTRLX */ -#define PWM_CAPTCTRLX_COUNT (4U) - -/*! @name CAPTCOMPX - Capture Compare X Register */ -/*! @{ */ - -#define PWM_CAPTCOMPX_EDGCMPX_MASK (0xFFU) -#define PWM_CAPTCOMPX_EDGCMPX_SHIFT (0U) -/*! EDGCMPX - Edge Compare X */ -#define PWM_CAPTCOMPX_EDGCMPX(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCOMPX_EDGCMPX_SHIFT)) & PWM_CAPTCOMPX_EDGCMPX_MASK) - -#define PWM_CAPTCOMPX_EDGCNTX_MASK (0xFF00U) -#define PWM_CAPTCOMPX_EDGCNTX_SHIFT (8U) -/*! EDGCNTX - Edge Counter X */ -#define PWM_CAPTCOMPX_EDGCNTX(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTCOMPX_EDGCNTX_SHIFT)) & PWM_CAPTCOMPX_EDGCNTX_MASK) -/*! @} */ - -/* The count of PWM_CAPTCOMPX */ -#define PWM_CAPTCOMPX_COUNT (4U) - -/*! @name CVAL0 - Capture Value 0 Register */ -/*! @{ */ - -#define PWM_CVAL0_CAPTVAL0_MASK (0xFFFFU) -#define PWM_CVAL0_CAPTVAL0_SHIFT (0U) -/*! CAPTVAL0 - Capture Value 0 */ -#define PWM_CVAL0_CAPTVAL0(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL0_CAPTVAL0_SHIFT)) & PWM_CVAL0_CAPTVAL0_MASK) -/*! @} */ - -/* The count of PWM_CVAL0 */ -#define PWM_CVAL0_COUNT (4U) - -/*! @name CVAL0CYC - Capture Value 0 Cycle Register */ -/*! @{ */ - -#define PWM_CVAL0CYC_CVAL0CYC_MASK (0xFU) -#define PWM_CVAL0CYC_CVAL0CYC_SHIFT (0U) -/*! CVAL0CYC - Capture Value 0 Cycle */ -#define PWM_CVAL0CYC_CVAL0CYC(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL0CYC_CVAL0CYC_SHIFT)) & PWM_CVAL0CYC_CVAL0CYC_MASK) -/*! @} */ - -/* The count of PWM_CVAL0CYC */ -#define PWM_CVAL0CYC_COUNT (4U) - -/*! @name CVAL1 - Capture Value 1 Register */ -/*! @{ */ - -#define PWM_CVAL1_CAPTVAL1_MASK (0xFFFFU) -#define PWM_CVAL1_CAPTVAL1_SHIFT (0U) -/*! CAPTVAL1 - Capture Value 1 */ -#define PWM_CVAL1_CAPTVAL1(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL1_CAPTVAL1_SHIFT)) & PWM_CVAL1_CAPTVAL1_MASK) -/*! @} */ - -/* The count of PWM_CVAL1 */ -#define PWM_CVAL1_COUNT (4U) - -/*! @name CVAL1CYC - Capture Value 1 Cycle Register */ -/*! @{ */ - -#define PWM_CVAL1CYC_CVAL1CYC_MASK (0xFU) -#define PWM_CVAL1CYC_CVAL1CYC_SHIFT (0U) -/*! CVAL1CYC - Capture Value 1 Cycle */ -#define PWM_CVAL1CYC_CVAL1CYC(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL1CYC_CVAL1CYC_SHIFT)) & PWM_CVAL1CYC_CVAL1CYC_MASK) -/*! @} */ - -/* The count of PWM_CVAL1CYC */ -#define PWM_CVAL1CYC_COUNT (4U) - -/*! @name CVAL2 - Capture Value 2 Register */ -/*! @{ */ - -#define PWM_CVAL2_CAPTVAL2_MASK (0xFFFFU) -#define PWM_CVAL2_CAPTVAL2_SHIFT (0U) -/*! CAPTVAL2 - Capture Value 2 */ -#define PWM_CVAL2_CAPTVAL2(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL2_CAPTVAL2_SHIFT)) & PWM_CVAL2_CAPTVAL2_MASK) -/*! @} */ - -/* The count of PWM_CVAL2 */ -#define PWM_CVAL2_COUNT (4U) - -/*! @name CVAL2CYC - Capture Value 2 Cycle Register */ -/*! @{ */ - -#define PWM_CVAL2CYC_CVAL2CYC_MASK (0xFU) -#define PWM_CVAL2CYC_CVAL2CYC_SHIFT (0U) -/*! CVAL2CYC - Capture Value 2 Cycle */ -#define PWM_CVAL2CYC_CVAL2CYC(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL2CYC_CVAL2CYC_SHIFT)) & PWM_CVAL2CYC_CVAL2CYC_MASK) -/*! @} */ - -/* The count of PWM_CVAL2CYC */ -#define PWM_CVAL2CYC_COUNT (4U) - -/*! @name CVAL3 - Capture Value 3 Register */ -/*! @{ */ - -#define PWM_CVAL3_CAPTVAL3_MASK (0xFFFFU) -#define PWM_CVAL3_CAPTVAL3_SHIFT (0U) -/*! CAPTVAL3 - Capture Value 3 */ -#define PWM_CVAL3_CAPTVAL3(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL3_CAPTVAL3_SHIFT)) & PWM_CVAL3_CAPTVAL3_MASK) -/*! @} */ - -/* The count of PWM_CVAL3 */ -#define PWM_CVAL3_COUNT (4U) - -/*! @name CVAL3CYC - Capture Value 3 Cycle Register */ -/*! @{ */ - -#define PWM_CVAL3CYC_CVAL3CYC_MASK (0xFU) -#define PWM_CVAL3CYC_CVAL3CYC_SHIFT (0U) -/*! CVAL3CYC - Capture Value 3 Cycle */ -#define PWM_CVAL3CYC_CVAL3CYC(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL3CYC_CVAL3CYC_SHIFT)) & PWM_CVAL3CYC_CVAL3CYC_MASK) -/*! @} */ - -/* The count of PWM_CVAL3CYC */ -#define PWM_CVAL3CYC_COUNT (4U) - -/*! @name CVAL4 - Capture Value 4 Register */ -/*! @{ */ - -#define PWM_CVAL4_CAPTVAL4_MASK (0xFFFFU) -#define PWM_CVAL4_CAPTVAL4_SHIFT (0U) -/*! CAPTVAL4 - Capture Value 4 */ -#define PWM_CVAL4_CAPTVAL4(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL4_CAPTVAL4_SHIFT)) & PWM_CVAL4_CAPTVAL4_MASK) -/*! @} */ - -/* The count of PWM_CVAL4 */ -#define PWM_CVAL4_COUNT (4U) - -/*! @name CVAL4CYC - Capture Value 4 Cycle Register */ -/*! @{ */ - -#define PWM_CVAL4CYC_CVAL4CYC_MASK (0xFU) -#define PWM_CVAL4CYC_CVAL4CYC_SHIFT (0U) -/*! CVAL4CYC - Capture Value 4 Cycle */ -#define PWM_CVAL4CYC_CVAL4CYC(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL4CYC_CVAL4CYC_SHIFT)) & PWM_CVAL4CYC_CVAL4CYC_MASK) -/*! @} */ - -/* The count of PWM_CVAL4CYC */ -#define PWM_CVAL4CYC_COUNT (4U) - -/*! @name CVAL5 - Capture Value 5 Register */ -/*! @{ */ - -#define PWM_CVAL5_CAPTVAL5_MASK (0xFFFFU) -#define PWM_CVAL5_CAPTVAL5_SHIFT (0U) -/*! CAPTVAL5 - Capture Value 5 */ -#define PWM_CVAL5_CAPTVAL5(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL5_CAPTVAL5_SHIFT)) & PWM_CVAL5_CAPTVAL5_MASK) -/*! @} */ - -/* The count of PWM_CVAL5 */ -#define PWM_CVAL5_COUNT (4U) - -/*! @name CVAL5CYC - Capture Value 5 Cycle Register */ -/*! @{ */ - -#define PWM_CVAL5CYC_CVAL5CYC_MASK (0xFU) -#define PWM_CVAL5CYC_CVAL5CYC_SHIFT (0U) -/*! CVAL5CYC - Capture Value 5 Cycle */ -#define PWM_CVAL5CYC_CVAL5CYC(x) (((uint16_t)(((uint16_t)(x)) << PWM_CVAL5CYC_CVAL5CYC_SHIFT)) & PWM_CVAL5CYC_CVAL5CYC_MASK) -/*! @} */ - -/* The count of PWM_CVAL5CYC */ -#define PWM_CVAL5CYC_COUNT (4U) - -/*! @name PHASEDLY - Phase Delay Register */ -/*! @{ */ - -#define PWM_PHASEDLY_PHASEDLY_MASK (0xFFFFU) -#define PWM_PHASEDLY_PHASEDLY_SHIFT (0U) -/*! PHASEDLY - Initial Count Register Bits */ -#define PWM_PHASEDLY_PHASEDLY(x) (((uint16_t)(((uint16_t)(x)) << PWM_PHASEDLY_PHASEDLY_SHIFT)) & PWM_PHASEDLY_PHASEDLY_MASK) -/*! @} */ - -/* The count of PWM_PHASEDLY */ -#define PWM_PHASEDLY_COUNT (4U) - -/*! @name CAPTFILTA - Capture PWM_A Input Filter Register */ -/*! @{ */ - -#define PWM_CAPTFILTA_CAPTA_FILT_PER_MASK (0xFFU) -#define PWM_CAPTFILTA_CAPTA_FILT_PER_SHIFT (0U) -/*! CAPTA_FILT_PER - Input Capture Filter Period */ -#define PWM_CAPTFILTA_CAPTA_FILT_PER(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTFILTA_CAPTA_FILT_PER_SHIFT)) & PWM_CAPTFILTA_CAPTA_FILT_PER_MASK) - -#define PWM_CAPTFILTA_CAPTA_FILT_CNT_MASK (0x700U) -#define PWM_CAPTFILTA_CAPTA_FILT_CNT_SHIFT (8U) -/*! CAPTA_FILT_CNT - Input Capture Filter Count */ -#define PWM_CAPTFILTA_CAPTA_FILT_CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTFILTA_CAPTA_FILT_CNT_SHIFT)) & PWM_CAPTFILTA_CAPTA_FILT_CNT_MASK) -/*! @} */ - -/* The count of PWM_CAPTFILTA */ -#define PWM_CAPTFILTA_COUNT (4U) - -/*! @name CAPTFILTB - Capture PWM_B Input Filter Register */ -/*! @{ */ - -#define PWM_CAPTFILTB_CAPTB_FILT_PER_MASK (0xFFU) -#define PWM_CAPTFILTB_CAPTB_FILT_PER_SHIFT (0U) -/*! CAPTB_FILT_PER - Input Capture Filter Period */ -#define PWM_CAPTFILTB_CAPTB_FILT_PER(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTFILTB_CAPTB_FILT_PER_SHIFT)) & PWM_CAPTFILTB_CAPTB_FILT_PER_MASK) - -#define PWM_CAPTFILTB_CAPTB_FILT_CNT_MASK (0x700U) -#define PWM_CAPTFILTB_CAPTB_FILT_CNT_SHIFT (8U) -/*! CAPTB_FILT_CNT - Input Capture Filter Count */ -#define PWM_CAPTFILTB_CAPTB_FILT_CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTFILTB_CAPTB_FILT_CNT_SHIFT)) & PWM_CAPTFILTB_CAPTB_FILT_CNT_MASK) -/*! @} */ - -/* The count of PWM_CAPTFILTB */ -#define PWM_CAPTFILTB_COUNT (4U) - -/*! @name CAPTFILTX - Capture PWM_X Input Filter Register */ -/*! @{ */ - -#define PWM_CAPTFILTX_CAPTX_FILT_PER_MASK (0xFFU) -#define PWM_CAPTFILTX_CAPTX_FILT_PER_SHIFT (0U) -/*! CAPTX_FILT_PER - Input Capture Filter Period */ -#define PWM_CAPTFILTX_CAPTX_FILT_PER(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTFILTX_CAPTX_FILT_PER_SHIFT)) & PWM_CAPTFILTX_CAPTX_FILT_PER_MASK) - -#define PWM_CAPTFILTX_CAPTX_FILT_CNT_MASK (0x700U) -#define PWM_CAPTFILTX_CAPTX_FILT_CNT_SHIFT (8U) -/*! CAPTX_FILT_CNT - Input Capture Filter Count */ -#define PWM_CAPTFILTX_CAPTX_FILT_CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_CAPTFILTX_CAPTX_FILT_CNT_SHIFT)) & PWM_CAPTFILTX_CAPTX_FILT_CNT_MASK) -/*! @} */ - -/* The count of PWM_CAPTFILTX */ -#define PWM_CAPTFILTX_COUNT (4U) - -/*! @name OUTEN - Output Enable Register */ -/*! @{ */ - -#define PWM_OUTEN_PWMX_EN_MASK (0xFU) -#define PWM_OUTEN_PWMX_EN_SHIFT (0U) -/*! PWMX_EN - PWM_X Output Enables */ -#define PWM_OUTEN_PWMX_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_OUTEN_PWMX_EN_SHIFT)) & PWM_OUTEN_PWMX_EN_MASK) - -#define PWM_OUTEN_PWMB_EN_MASK (0xF0U) -#define PWM_OUTEN_PWMB_EN_SHIFT (4U) -/*! PWMB_EN - PWM_B Output Enables */ -#define PWM_OUTEN_PWMB_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_OUTEN_PWMB_EN_SHIFT)) & PWM_OUTEN_PWMB_EN_MASK) - -#define PWM_OUTEN_PWMA_EN_MASK (0xF00U) -#define PWM_OUTEN_PWMA_EN_SHIFT (8U) -/*! PWMA_EN - PWM_A Output Enables */ -#define PWM_OUTEN_PWMA_EN(x) (((uint16_t)(((uint16_t)(x)) << PWM_OUTEN_PWMA_EN_SHIFT)) & PWM_OUTEN_PWMA_EN_MASK) -/*! @} */ - -/*! @name MASK - Mask Register */ -/*! @{ */ - -#define PWM_MASK_MASKX_MASK (0xFU) -#define PWM_MASK_MASKX_SHIFT (0U) -/*! MASKX - PWM_X Masks */ -#define PWM_MASK_MASKX(x) (((uint16_t)(((uint16_t)(x)) << PWM_MASK_MASKX_SHIFT)) & PWM_MASK_MASKX_MASK) - -#define PWM_MASK_MASKB_MASK (0xF0U) -#define PWM_MASK_MASKB_SHIFT (4U) -/*! MASKB - PWM_B Masks */ -#define PWM_MASK_MASKB(x) (((uint16_t)(((uint16_t)(x)) << PWM_MASK_MASKB_SHIFT)) & PWM_MASK_MASKB_MASK) - -#define PWM_MASK_MASKA_MASK (0xF00U) -#define PWM_MASK_MASKA_SHIFT (8U) -/*! MASKA - PWM_A Masks */ -#define PWM_MASK_MASKA(x) (((uint16_t)(((uint16_t)(x)) << PWM_MASK_MASKA_SHIFT)) & PWM_MASK_MASKA_MASK) - -#define PWM_MASK_UPDATE_MASK_MASK (0xF000U) -#define PWM_MASK_UPDATE_MASK_SHIFT (12U) -/*! UPDATE_MASK - Update Mask Bits Immediately */ -#define PWM_MASK_UPDATE_MASK(x) (((uint16_t)(((uint16_t)(x)) << PWM_MASK_UPDATE_MASK_SHIFT)) & PWM_MASK_UPDATE_MASK_MASK) -/*! @} */ - -/*! @name SWCOUT - Software Controlled Output Register */ -/*! @{ */ - -#define PWM_SWCOUT_SM0OUT45_MASK (0x1U) -#define PWM_SWCOUT_SM0OUT45_SHIFT (0U) -/*! SM0OUT45 - Submodule 0 Software Controlled Output 45 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 0 instead of PWM45. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 0 instead of PWM45. - */ -#define PWM_SWCOUT_SM0OUT45(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM0OUT45_SHIFT)) & PWM_SWCOUT_SM0OUT45_MASK) - -#define PWM_SWCOUT_SM0OUT23_MASK (0x2U) -#define PWM_SWCOUT_SM0OUT23_SHIFT (1U) -/*! SM0OUT23 - Submodule 0 Software Controlled Output 23 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 0 instead of PWM23. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 0 instead of PWM23. - */ -#define PWM_SWCOUT_SM0OUT23(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM0OUT23_SHIFT)) & PWM_SWCOUT_SM0OUT23_MASK) - -#define PWM_SWCOUT_SM1OUT45_MASK (0x4U) -#define PWM_SWCOUT_SM1OUT45_SHIFT (2U) -/*! SM1OUT45 - Submodule 1 Software Controlled Output 45 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 1 instead of PWM45. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 1 instead of PWM45. - */ -#define PWM_SWCOUT_SM1OUT45(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM1OUT45_SHIFT)) & PWM_SWCOUT_SM1OUT45_MASK) - -#define PWM_SWCOUT_SM1OUT23_MASK (0x8U) -#define PWM_SWCOUT_SM1OUT23_SHIFT (3U) -/*! SM1OUT23 - Submodule 1 Software Controlled Output 23 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 1 instead of PWM23. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 1 instead of PWM23. - */ -#define PWM_SWCOUT_SM1OUT23(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM1OUT23_SHIFT)) & PWM_SWCOUT_SM1OUT23_MASK) - -#define PWM_SWCOUT_SM2OUT45_MASK (0x10U) -#define PWM_SWCOUT_SM2OUT45_SHIFT (4U) -/*! SM2OUT45 - Submodule 2 Software Controlled Output 45 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 2 instead of PWM45. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 2 instead of PWM45. - */ -#define PWM_SWCOUT_SM2OUT45(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM2OUT45_SHIFT)) & PWM_SWCOUT_SM2OUT45_MASK) - -#define PWM_SWCOUT_SM2OUT23_MASK (0x20U) -#define PWM_SWCOUT_SM2OUT23_SHIFT (5U) -/*! SM2OUT23 - Submodule 2 Software Controlled Output 23 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 2 instead of PWM23. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 2 instead of PWM23. - */ -#define PWM_SWCOUT_SM2OUT23(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM2OUT23_SHIFT)) & PWM_SWCOUT_SM2OUT23_MASK) - -#define PWM_SWCOUT_SM3OUT45_MASK (0x40U) -#define PWM_SWCOUT_SM3OUT45_SHIFT (6U) -/*! SM3OUT45 - Submodule 3 Software Controlled Output 45 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 3 instead of PWM45. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 3 instead of PWM45. - */ -#define PWM_SWCOUT_SM3OUT45(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM3OUT45_SHIFT)) & PWM_SWCOUT_SM3OUT45_MASK) - -#define PWM_SWCOUT_SM3OUT23_MASK (0x80U) -#define PWM_SWCOUT_SM3OUT23_SHIFT (7U) -/*! SM3OUT23 - Submodule 3 Software Controlled Output 23 - * 0b0..A logic 0 is supplied to the deadtime generator of submodule 3 instead of PWM23. - * 0b1..A logic 1 is supplied to the deadtime generator of submodule 3 instead of PWM23. - */ -#define PWM_SWCOUT_SM3OUT23(x) (((uint16_t)(((uint16_t)(x)) << PWM_SWCOUT_SM3OUT23_SHIFT)) & PWM_SWCOUT_SM3OUT23_MASK) -/*! @} */ - -/*! @name DTSRCSEL - PWM Source Select Register */ -/*! @{ */ - -#define PWM_DTSRCSEL_SM0SEL45_MASK (0x3U) -#define PWM_DTSRCSEL_SM0SEL45_SHIFT (0U) -/*! SM0SEL45 - Submodule 0 PWM45 Control Select - * 0b00..Generated SM0PWM45 signal used by the deadtime logic. - * 0b01..Inverted generated SM0PWM45 signal used by the deadtime logic. - * 0b10..SWCOUT[SM0OUT45] used by the deadtime logic. - * 0b11..Reserved - */ -#define PWM_DTSRCSEL_SM0SEL45(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM0SEL45_SHIFT)) & PWM_DTSRCSEL_SM0SEL45_MASK) - -#define PWM_DTSRCSEL_SM0SEL23_MASK (0xCU) -#define PWM_DTSRCSEL_SM0SEL23_SHIFT (2U) -/*! SM0SEL23 - Submodule 0 PWM23 Control Select - * 0b00..Generated SM0PWM23 signal used by the deadtime logic. - * 0b01..Inverted generated SM0PWM23 signal used by the deadtime logic. - * 0b10..SWCOUT[SM0OUT23] used by the deadtime logic. - * 0b11..PWM0_EXTA signal used by the deadtime logic. - */ -#define PWM_DTSRCSEL_SM0SEL23(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM0SEL23_SHIFT)) & PWM_DTSRCSEL_SM0SEL23_MASK) - -#define PWM_DTSRCSEL_SM1SEL45_MASK (0x30U) -#define PWM_DTSRCSEL_SM1SEL45_SHIFT (4U) -/*! SM1SEL45 - Submodule 1 PWM45 Control Select - * 0b00..Generated SM1PWM45 signal used by the deadtime logic. - * 0b01..Inverted generated SM1PWM45 signal used by the deadtime logic. - * 0b10..SWCOUT[SM1OUT45] used by the deadtime logic. - * 0b11..Reserved - */ -#define PWM_DTSRCSEL_SM1SEL45(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM1SEL45_SHIFT)) & PWM_DTSRCSEL_SM1SEL45_MASK) - -#define PWM_DTSRCSEL_SM1SEL23_MASK (0xC0U) -#define PWM_DTSRCSEL_SM1SEL23_SHIFT (6U) -/*! SM1SEL23 - Submodule 1 PWM23 Control Select - * 0b00..Generated SM1PWM23 signal used by the deadtime logic. - * 0b01..Inverted generated SM1PWM23 signal used by the deadtime logic. - * 0b10..SWCOUT[SM1OUT23] used by the deadtime logic. - * 0b11..PWM1_EXTA signal used by the deadtime logic. - */ -#define PWM_DTSRCSEL_SM1SEL23(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM1SEL23_SHIFT)) & PWM_DTSRCSEL_SM1SEL23_MASK) - -#define PWM_DTSRCSEL_SM2SEL45_MASK (0x300U) -#define PWM_DTSRCSEL_SM2SEL45_SHIFT (8U) -/*! SM2SEL45 - Submodule 2 PWM45 Control Select - * 0b00..Generated SM2PWM45 signal used by the deadtime logic. - * 0b01..Inverted generated SM2PWM45 signal used by the deadtime logic. - * 0b10..SWCOUT[SM2OUT45] used by the deadtime logic. - * 0b11..Reserved - */ -#define PWM_DTSRCSEL_SM2SEL45(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM2SEL45_SHIFT)) & PWM_DTSRCSEL_SM2SEL45_MASK) - -#define PWM_DTSRCSEL_SM2SEL23_MASK (0xC00U) -#define PWM_DTSRCSEL_SM2SEL23_SHIFT (10U) -/*! SM2SEL23 - Submodule 2 PWM23 Control Select - * 0b00..Generated SM2PWM23 signal used by the deadtime logic. - * 0b01..Inverted generated SM2PWM23 signal used by the deadtime logic. - * 0b10..SWCOUT[SM2OUT23] used by the deadtime logic. - * 0b11..PWM2_EXTA signal used by the deadtime logic. - */ -#define PWM_DTSRCSEL_SM2SEL23(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM2SEL23_SHIFT)) & PWM_DTSRCSEL_SM2SEL23_MASK) - -#define PWM_DTSRCSEL_SM3SEL45_MASK (0x3000U) -#define PWM_DTSRCSEL_SM3SEL45_SHIFT (12U) -/*! SM3SEL45 - Submodule 3 PWM45 Control Select - * 0b00..Generated SM3PWM45 signal used by the deadtime logic. - * 0b01..Inverted generated SM3PWM45 signal used by the deadtime logic. - * 0b10..SWCOUT[SM3OUT45] used by the deadtime logic. - * 0b11..Reserved - */ -#define PWM_DTSRCSEL_SM3SEL45(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM3SEL45_SHIFT)) & PWM_DTSRCSEL_SM3SEL45_MASK) - -#define PWM_DTSRCSEL_SM3SEL23_MASK (0xC000U) -#define PWM_DTSRCSEL_SM3SEL23_SHIFT (14U) -/*! SM3SEL23 - Submodule 3 PWM23 Control Select - * 0b00..Generated SM3PWM23 signal used by the deadtime logic. - * 0b01..Inverted generated SM3PWM23 signal used by the deadtime logic. - * 0b10..SWCOUT[SM3OUT23] used by the deadtime logic. - * 0b11..PWM3_EXTA signal used by the deadtime logic. - */ -#define PWM_DTSRCSEL_SM3SEL23(x) (((uint16_t)(((uint16_t)(x)) << PWM_DTSRCSEL_SM3SEL23_SHIFT)) & PWM_DTSRCSEL_SM3SEL23_MASK) -/*! @} */ - -/*! @name MCTRL - Master Control Register */ -/*! @{ */ - -#define PWM_MCTRL_LDOK_MASK (0xFU) -#define PWM_MCTRL_LDOK_SHIFT (0U) -/*! LDOK - Load Okay - * 0b0000..Do not load new values. - * 0b0001..Load prescaler, modulus, and PWM values of the corresponding submodule. - */ -#define PWM_MCTRL_LDOK(x) (((uint16_t)(((uint16_t)(x)) << PWM_MCTRL_LDOK_SHIFT)) & PWM_MCTRL_LDOK_MASK) - -#define PWM_MCTRL_CLDOK_MASK (0xF0U) -#define PWM_MCTRL_CLDOK_SHIFT (4U) -/*! CLDOK - Clear Load Okay */ -#define PWM_MCTRL_CLDOK(x) (((uint16_t)(((uint16_t)(x)) << PWM_MCTRL_CLDOK_SHIFT)) & PWM_MCTRL_CLDOK_MASK) - -#define PWM_MCTRL_RUN_MASK (0xF00U) -#define PWM_MCTRL_RUN_SHIFT (8U) -/*! RUN - Run - * 0b0000..PWM counter is stopped, but PWM outputs hold the current state. - * 0b0001..PWM counter is started in the corresponding submodule. - */ -#define PWM_MCTRL_RUN(x) (((uint16_t)(((uint16_t)(x)) << PWM_MCTRL_RUN_SHIFT)) & PWM_MCTRL_RUN_MASK) - -#define PWM_MCTRL_IPOL_MASK (0xF000U) -#define PWM_MCTRL_IPOL_SHIFT (12U) -/*! IPOL - Current Polarity - * 0b0000..PWM23 is used to generate complementary PWM pair in the corresponding submodule. - * 0b0001..PWM45 is used to generate complementary PWM pair in the corresponding submodule. - */ -#define PWM_MCTRL_IPOL(x) (((uint16_t)(((uint16_t)(x)) << PWM_MCTRL_IPOL_SHIFT)) & PWM_MCTRL_IPOL_MASK) -/*! @} */ - -/*! @name MCTRL2 - Master Control 2 Register */ -/*! @{ */ - -#define PWM_MCTRL2_WRPROT_MASK (0xCU) -#define PWM_MCTRL2_WRPROT_SHIFT (2U) -/*! WRPROT - Write protect - * 0b00..Write protection off (default). - * 0b01..Write protection on. - * 0b10..Write protection off and locked until chip reset. - * 0b11..Write protection on and locked until chip reset. - */ -#define PWM_MCTRL2_WRPROT(x) (((uint16_t)(((uint16_t)(x)) << PWM_MCTRL2_WRPROT_SHIFT)) & PWM_MCTRL2_WRPROT_MASK) - -#define PWM_MCTRL2_STRETCH_CNT_PRSC_MASK (0xC0U) -#define PWM_MCTRL2_STRETCH_CNT_PRSC_SHIFT (6U) -/*! STRETCH_CNT_PRSC - Stretch IPBus clock count prescaler for mux0_trig/mux1_trig/out0_trig/out1_trig/pwma_trig/pwmb_trig - * 0b00..Stretch count is zero, no stretch. - * 0b01..Stretch mux0_trig/mux1_trig/out0_trig/out1_trig/pwma_trig/pwmb_trig for 2 IPBus clock period. - * 0b10..Stretch mux0_trig/mux1_trig/out0_trig/out1_trig/pwma_trig/pwmb_trig for 4 IPBus clock period. - * 0b11..Stretch mux0_trig/mux1_trig/out0_trig/out1_trig/pwma_trig/pwmb_trig for 8 IPBus clock period. - */ -#define PWM_MCTRL2_STRETCH_CNT_PRSC(x) (((uint16_t)(((uint16_t)(x)) << PWM_MCTRL2_STRETCH_CNT_PRSC_SHIFT)) & PWM_MCTRL2_STRETCH_CNT_PRSC_MASK) -/*! @} */ - -/*! @name FCTRL - Fault Control Register */ -/*! @{ */ - -#define PWM_FCTRL_FIE_MASK (0xFU) -#define PWM_FCTRL_FIE_SHIFT (0U) -/*! FIE - Fault Interrupt Enables - * 0b0000..FAULTx CPU interrupt requests disabled. - * 0b0001..FAULTx CPU interrupt requests enabled. - */ -#define PWM_FCTRL_FIE(x) (((uint16_t)(((uint16_t)(x)) << PWM_FCTRL_FIE_SHIFT)) & PWM_FCTRL_FIE_MASK) - -#define PWM_FCTRL_FSAFE_MASK (0xF0U) -#define PWM_FCTRL_FSAFE_SHIFT (4U) -/*! FSAFE - Fault Safety Mode - * 0b0000..Normal mode. PWM outputs disabled by this fault are not enabled until FSTS[FFLAGx] is clear at the - * start of a half cycle or full cycle depending on the states of FSTS[FHALF] and FSTS[FFULL] without regard - * to the state of FSTS[FFPINx]. If neither FHALF nor FFULL is set, then the fault condition cannot be - * cleared. The PWM outputs disabled by this fault input will not be re-enabled until the actual FAULTx input - * signal de-asserts since the fault input will combinationally disable the PWM outputs (as programmed in - * DISMAPn). - * 0b0001..Safe mode. PWM outputs disabled by this fault are not enabled until FSTS[FFLAGx] is clear and - * FSTS[FFPINx] is clear at the start of a half cycle or full cycle depending on the states of FSTS[FHALF] and - * FSTS[FFULL]. If neither FHLAF nor FFULL is set, then the fault condition cannot be cleared. - */ -#define PWM_FCTRL_FSAFE(x) (((uint16_t)(((uint16_t)(x)) << PWM_FCTRL_FSAFE_SHIFT)) & PWM_FCTRL_FSAFE_MASK) - -#define PWM_FCTRL_FAUTO_MASK (0xF00U) -#define PWM_FCTRL_FAUTO_SHIFT (8U) -/*! FAUTO - Automatic Fault Clearing - * 0b0000..Manual fault clearing. PWM outputs disabled by this fault are not enabled until FSTS[FFLAGx] is clear - * at the start of a half cycle or full cycle depending on the states of FSTS[FHALF] and FSTS[FFULL]. If - * neither FFULL nor FHALF is set, then the fault condition cannot be cleared. This is further controlled - * by FCTRL[FSAFE]. - * 0b0001..Automatic fault clearing. PWM outputs disabled by this fault are enabled when FSTS[FFPINx] is clear at - * the start of a half cycle or full cycle depending on the states of FSTS[FHALF] and FSTS[FFULL] without - * regard to the state of FSTS[FFLAGx]. If neither FFULL nor FHALF is set, then the fault condition - * cannot be cleared. - */ -#define PWM_FCTRL_FAUTO(x) (((uint16_t)(((uint16_t)(x)) << PWM_FCTRL_FAUTO_SHIFT)) & PWM_FCTRL_FAUTO_MASK) - -#define PWM_FCTRL_FLVL_MASK (0xF000U) -#define PWM_FCTRL_FLVL_SHIFT (12U) -/*! FLVL - Fault Level - * 0b0000..A logic 0 on the fault input indicates a fault condition. - * 0b0001..A logic 1 on the fault input indicates a fault condition. - */ -#define PWM_FCTRL_FLVL(x) (((uint16_t)(((uint16_t)(x)) << PWM_FCTRL_FLVL_SHIFT)) & PWM_FCTRL_FLVL_MASK) -/*! @} */ - -/*! @name FSTS - Fault Status Register */ -/*! @{ */ - -#define PWM_FSTS_FFLAG_MASK (0xFU) -#define PWM_FSTS_FFLAG_SHIFT (0U) -/*! FFLAG - Fault Flags - * 0b0000..No fault on the FAULTx pin. - * 0b0001..Fault on the FAULTx pin. - */ -#define PWM_FSTS_FFLAG(x) (((uint16_t)(((uint16_t)(x)) << PWM_FSTS_FFLAG_SHIFT)) & PWM_FSTS_FFLAG_MASK) - -#define PWM_FSTS_FFULL_MASK (0xF0U) -#define PWM_FSTS_FFULL_SHIFT (4U) -/*! FFULL - Full Cycle - * 0b0000..PWM outputs are not re-enabled at the start of a full cycle - * 0b0001..PWM outputs are re-enabled at the start of a full cycle - */ -#define PWM_FSTS_FFULL(x) (((uint16_t)(((uint16_t)(x)) << PWM_FSTS_FFULL_SHIFT)) & PWM_FSTS_FFULL_MASK) - -#define PWM_FSTS_FFPIN_MASK (0xF00U) -#define PWM_FSTS_FFPIN_SHIFT (8U) -/*! FFPIN - Filtered Fault Pins */ -#define PWM_FSTS_FFPIN(x) (((uint16_t)(((uint16_t)(x)) << PWM_FSTS_FFPIN_SHIFT)) & PWM_FSTS_FFPIN_MASK) - -#define PWM_FSTS_FHALF_MASK (0xF000U) -#define PWM_FSTS_FHALF_SHIFT (12U) -/*! FHALF - Half Cycle Fault Recovery - * 0b0000..PWM outputs are not re-enabled at the start of a half cycle. - * 0b0001..PWM outputs are re-enabled at the start of a half cycle (as defined by VAL0). - */ -#define PWM_FSTS_FHALF(x) (((uint16_t)(((uint16_t)(x)) << PWM_FSTS_FHALF_SHIFT)) & PWM_FSTS_FHALF_MASK) -/*! @} */ - -/*! @name FFILT - Fault Filter Register */ -/*! @{ */ - -#define PWM_FFILT_FILT_PER_MASK (0xFFU) -#define PWM_FFILT_FILT_PER_SHIFT (0U) -/*! FILT_PER - Fault Filter Period */ -#define PWM_FFILT_FILT_PER(x) (((uint16_t)(((uint16_t)(x)) << PWM_FFILT_FILT_PER_SHIFT)) & PWM_FFILT_FILT_PER_MASK) - -#define PWM_FFILT_FILT_CNT_MASK (0x700U) -#define PWM_FFILT_FILT_CNT_SHIFT (8U) -/*! FILT_CNT - Fault Filter Count */ -#define PWM_FFILT_FILT_CNT(x) (((uint16_t)(((uint16_t)(x)) << PWM_FFILT_FILT_CNT_SHIFT)) & PWM_FFILT_FILT_CNT_MASK) - -#define PWM_FFILT_GSTR_MASK (0x8000U) -#define PWM_FFILT_GSTR_SHIFT (15U) -/*! GSTR - Fault Glitch Stretch Enable - * 0b0..Fault input glitch stretching is disabled. - * 0b1..Input fault signals are stretched to at least 2 IPBus clock cycles. - */ -#define PWM_FFILT_GSTR(x) (((uint16_t)(((uint16_t)(x)) << PWM_FFILT_GSTR_SHIFT)) & PWM_FFILT_GSTR_MASK) -/*! @} */ - -/*! @name FTST - Fault Test Register */ -/*! @{ */ - -#define PWM_FTST_FTEST_MASK (0x1U) -#define PWM_FTST_FTEST_SHIFT (0U) -/*! FTEST - Fault Test - * 0b0..No fault - * 0b1..Cause a simulated fault - */ -#define PWM_FTST_FTEST(x) (((uint16_t)(((uint16_t)(x)) << PWM_FTST_FTEST_SHIFT)) & PWM_FTST_FTEST_MASK) -/*! @} */ - -/*! @name FCTRL2 - Fault Control 2 Register */ -/*! @{ */ - -#define PWM_FCTRL2_NOCOMB_MASK (0xFU) -#define PWM_FCTRL2_NOCOMB_SHIFT (0U) -/*! NOCOMB - No Combinational Path From Fault Input To PWM Output - * 0b0000..There is a combinational link from the fault inputs to the PWM outputs. The fault inputs are combined - * with the filtered and latched fault signals to disable the PWM outputs. - * 0b0001..The direct combinational path from the fault inputs to the PWM outputs is disabled and the filtered - * and latched fault signals are used to disable the PWM outputs. - */ -#define PWM_FCTRL2_NOCOMB(x) (((uint16_t)(((uint16_t)(x)) << PWM_FCTRL2_NOCOMB_SHIFT)) & PWM_FCTRL2_NOCOMB_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group PWM_Register_Masks */ - - -/* PWM - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral PWM0 base address */ - #define PWM0_BASE (0x500CE000u) - /** Peripheral PWM0 base address */ - #define PWM0_BASE_NS (0x400CE000u) - /** Peripheral PWM0 base pointer */ - #define PWM0 ((PWM_Type *)PWM0_BASE) - /** Peripheral PWM0 base pointer */ - #define PWM0_NS ((PWM_Type *)PWM0_BASE_NS) - /** Peripheral PWM1 base address */ - #define PWM1_BASE (0x500D0000u) - /** Peripheral PWM1 base address */ - #define PWM1_BASE_NS (0x400D0000u) - /** Peripheral PWM1 base pointer */ - #define PWM1 ((PWM_Type *)PWM1_BASE) - /** Peripheral PWM1 base pointer */ - #define PWM1_NS ((PWM_Type *)PWM1_BASE_NS) - /** Array initializer of PWM peripheral base addresses */ - #define PWM_BASE_ADDRS { PWM0_BASE, PWM1_BASE } - /** Array initializer of PWM peripheral base pointers */ - #define PWM_BASE_PTRS { PWM0, PWM1 } - /** Array initializer of PWM peripheral base addresses */ - #define PWM_BASE_ADDRS_NS { PWM0_BASE_NS, PWM1_BASE_NS } - /** Array initializer of PWM peripheral base pointers */ - #define PWM_BASE_PTRS_NS { PWM0_NS, PWM1_NS } -#else - /** Peripheral PWM0 base address */ - #define PWM0_BASE (0x400CE000u) - /** Peripheral PWM0 base pointer */ - #define PWM0 ((PWM_Type *)PWM0_BASE) - /** Peripheral PWM1 base address */ - #define PWM1_BASE (0x400D0000u) - /** Peripheral PWM1 base pointer */ - #define PWM1 ((PWM_Type *)PWM1_BASE) - /** Array initializer of PWM peripheral base addresses */ - #define PWM_BASE_ADDRS { PWM0_BASE, PWM1_BASE } - /** Array initializer of PWM peripheral base pointers */ - #define PWM_BASE_PTRS { PWM0, PWM1 } -#endif -/** Interrupt vectors for the PWM peripheral type */ -#define PWM_CMP_IRQS { { FLEXPWM0_SUBMODULE0_IRQn, FLEXPWM0_SUBMODULE1_IRQn, FLEXPWM0_SUBMODULE2_IRQn, FLEXPWM0_SUBMODULE3_IRQn }, { FLEXPWM1_SUBMODULE0_IRQn, FLEXPWM1_SUBMODULE1_IRQn, FLEXPWM1_SUBMODULE2_IRQn, FLEXPWM1_SUBMODULE3_IRQn } } -#define PWM_RELOAD_IRQS { { FLEXPWM0_SUBMODULE0_IRQn, FLEXPWM0_SUBMODULE1_IRQn, FLEXPWM0_SUBMODULE2_IRQn, FLEXPWM0_SUBMODULE3_IRQn }, { FLEXPWM1_SUBMODULE0_IRQn, FLEXPWM1_SUBMODULE1_IRQn, FLEXPWM1_SUBMODULE2_IRQn, FLEXPWM1_SUBMODULE3_IRQn } } -#define PWM_CAPTURE_IRQS { { FLEXPWM0_SUBMODULE0_IRQn, FLEXPWM0_SUBMODULE1_IRQn, FLEXPWM0_SUBMODULE2_IRQn, FLEXPWM0_SUBMODULE3_IRQn }, { FLEXPWM1_SUBMODULE0_IRQn, FLEXPWM1_SUBMODULE1_IRQn, FLEXPWM1_SUBMODULE2_IRQn, FLEXPWM1_SUBMODULE3_IRQn } } -#define PWM_FAULT_IRQS { FLEXPWM0_FAULT_IRQn, FLEXPWM1_FAULT_IRQn } -#define PWM_RELOAD_ERROR_IRQS { FLEXPWM0_RELOAD_ERROR_IRQn, FLEXPWM1_RELOAD_ERROR_IRQn } - -/*! - * @} - */ /* end of group PWM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- QDC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup QDC_Peripheral_Access_Layer QDC Peripheral Access Layer - * @{ - */ - -/** QDC - Register Layout Typedef */ -typedef struct { - __IO uint16_t CTRL; /**< Control, offset: 0x0 */ - __IO uint16_t FILT; /**< Input Filter, offset: 0x2 */ - __IO uint16_t WTR; /**< Watchdog Timeout, offset: 0x4 */ - __IO uint16_t POSD; /**< Position Difference Counter, offset: 0x6 */ - __I uint16_t POSDH; /**< Position Difference Hold, offset: 0x8 */ - __IO uint16_t REV; /**< Revolution Counter, offset: 0xA */ - __I uint16_t REVH; /**< Revolution Hold, offset: 0xC */ - __IO uint16_t UPOS; /**< Upper Position Counter, offset: 0xE */ - __IO uint16_t LPOS; /**< Lower Position Counter, offset: 0x10 */ - __I uint16_t UPOSH; /**< Upper Position Hold, offset: 0x12 */ - __I uint16_t LPOSH; /**< Lower Position Hold, offset: 0x14 */ - __IO uint16_t UINIT; /**< Upper Initialization, offset: 0x16 */ - __IO uint16_t LINIT; /**< Lower Initialization, offset: 0x18 */ - __I uint16_t IMR; /**< Input Monitor, offset: 0x1A */ - __IO uint16_t TST; /**< Test, offset: 0x1C */ - __IO uint16_t CTRL2; /**< Control 2, offset: 0x1E */ - __IO uint16_t UMOD; /**< Upper Modulus, offset: 0x20 */ - __IO uint16_t LMOD; /**< Lower Modulus, offset: 0x22 */ - __IO uint16_t UCOMP; /**< Upper Position Compare, offset: 0x24 */ - __IO uint16_t LCOMP; /**< Lower Position Compare, offset: 0x26 */ - __I uint16_t LASTEDGE; /**< Last Edge Time, offset: 0x28 */ - __I uint16_t LASTEDGEH; /**< Last Edge Time Hold, offset: 0x2A */ - __I uint16_t POSDPER; /**< Position Difference Period Counter, offset: 0x2C */ - __I uint16_t POSDPERBFR; /**< Position Difference Period Buffer, offset: 0x2E */ - __I uint16_t POSDPERH; /**< Position Difference Period Hold, offset: 0x30 */ - __IO uint16_t CTRL3; /**< Control 3, offset: 0x32 */ -} QDC_Type; - -/* ---------------------------------------------------------------------------- - -- QDC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup QDC_Register_Masks QDC Register Masks - * @{ - */ - -/*! @name CTRL - Control */ -/*! @{ */ - -#define QDC_CTRL_CMPIE_MASK (0x1U) -#define QDC_CTRL_CMPIE_SHIFT (0U) -/*! CMPIE - Compare Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL_CMPIE(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_CMPIE_SHIFT)) & QDC_CTRL_CMPIE_MASK) - -#define QDC_CTRL_CMPIRQ_MASK (0x2U) -#define QDC_CTRL_CMPIRQ_SHIFT (1U) -/*! CMPIRQ - Compare Interrupt Request - * 0b0..No match has occurred - * 0b1..COMP match has occurred - */ -#define QDC_CTRL_CMPIRQ(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_CMPIRQ_SHIFT)) & QDC_CTRL_CMPIRQ_MASK) - -#define QDC_CTRL_WDE_MASK (0x4U) -#define QDC_CTRL_WDE_SHIFT (2U) -/*! WDE - Watchdog Enable - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL_WDE(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_WDE_SHIFT)) & QDC_CTRL_WDE_MASK) - -#define QDC_CTRL_DIE_MASK (0x8U) -#define QDC_CTRL_DIE_SHIFT (3U) -/*! DIE - Watchdog Timeout Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL_DIE(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_DIE_SHIFT)) & QDC_CTRL_DIE_MASK) - -#define QDC_CTRL_DIRQ_MASK (0x10U) -#define QDC_CTRL_DIRQ_SHIFT (4U) -/*! DIRQ - Watchdog Timeout Interrupt Request - * 0b0..Not occurred - * 0b1..Occurred - */ -#define QDC_CTRL_DIRQ(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_DIRQ_SHIFT)) & QDC_CTRL_DIRQ_MASK) - -#define QDC_CTRL_XNE_MASK (0x20U) -#define QDC_CTRL_XNE_SHIFT (5U) -/*! XNE - Select Positive and Negative Edge of INDEX Pulse - * 0b0..Use positive edge - * 0b1..Use negative edge - */ -#define QDC_CTRL_XNE(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_XNE_SHIFT)) & QDC_CTRL_XNE_MASK) - -#define QDC_CTRL_XIP_MASK (0x40U) -#define QDC_CTRL_XIP_SHIFT (6U) -/*! XIP - INDEX Triggered Initialization of Position Counters UPOS and LPOS - * 0b0..Does not initialize - * 0b1..Initializes - */ -#define QDC_CTRL_XIP(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_XIP_SHIFT)) & QDC_CTRL_XIP_MASK) - -#define QDC_CTRL_XIE_MASK (0x80U) -#define QDC_CTRL_XIE_SHIFT (7U) -/*! XIE - INDEX Pulse Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL_XIE(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_XIE_SHIFT)) & QDC_CTRL_XIE_MASK) - -#define QDC_CTRL_XIRQ_MASK (0x100U) -#define QDC_CTRL_XIRQ_SHIFT (8U) -/*! XIRQ - INDEX Pulse Interrupt Request - * 0b0..Not occurred - * 0b1..Occurred - */ -#define QDC_CTRL_XIRQ(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_XIRQ_SHIFT)) & QDC_CTRL_XIRQ_MASK) - -#define QDC_CTRL_PH1_MASK (0x200U) -#define QDC_CTRL_PH1_SHIFT (9U) -/*! PH1 - Enable Signal Phase Count Mode - * 0b0..Uses the standard quadrature decoder, where PHASEA and PHASEB represent a two-phase quadrature signal. - * 0b1..Bypasses the quadrature decoder. A positive transition of the PHASEA input generates a count signal. - * PHASEB input and CTRL[REV] controls the counter direction. If the value of CTRL[REV] and PHASEB are identical; - * then count is up. If the value of CTRL[REV] and PHASEB is different, then count is down. - */ -#define QDC_CTRL_PH1(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_PH1_SHIFT)) & QDC_CTRL_PH1_MASK) - -#define QDC_CTRL_REV_MASK (0x400U) -#define QDC_CTRL_REV_SHIFT (10U) -/*! REV - Enable Reverse Direction Counting - * 0b0..Counts normally - * 0b1..Counts in the reverse direction - */ -#define QDC_CTRL_REV(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_REV_SHIFT)) & QDC_CTRL_REV_MASK) - -#define QDC_CTRL_SWIP_MASK (0x800U) -#define QDC_CTRL_SWIP_SHIFT (11U) -/*! SWIP - Software-Triggered Initialization of Position Counters UPOS and LPOS - * 0b0..No action - * 0b1..Initialize position counter - */ -#define QDC_CTRL_SWIP(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_SWIP_SHIFT)) & QDC_CTRL_SWIP_MASK) - -#define QDC_CTRL_HNE_MASK (0x1000U) -#define QDC_CTRL_HNE_SHIFT (12U) -/*! HNE - Use Negative Edge of HOME Input - * 0b0..Use positive-going edge-to-trigger initialization of position counters UPOS and LPOS - * 0b1..Use negative-going edge-to-trigger initialization of position counters UPOS and LPOS - */ -#define QDC_CTRL_HNE(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_HNE_SHIFT)) & QDC_CTRL_HNE_MASK) - -#define QDC_CTRL_HIP_MASK (0x2000U) -#define QDC_CTRL_HIP_SHIFT (13U) -/*! HIP - Enable HOME to Initialize Position Counters UPOS and LPOS - * 0b0..No action - * 0b1..HOME signal initializes the position counter - */ -#define QDC_CTRL_HIP(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_HIP_SHIFT)) & QDC_CTRL_HIP_MASK) - -#define QDC_CTRL_HIE_MASK (0x4000U) -#define QDC_CTRL_HIE_SHIFT (14U) -/*! HIE - HOME Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL_HIE(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_HIE_SHIFT)) & QDC_CTRL_HIE_MASK) - -#define QDC_CTRL_HIRQ_MASK (0x8000U) -#define QDC_CTRL_HIRQ_SHIFT (15U) -/*! HIRQ - HOME Signal Transition Interrupt Request - * 0b0..Not occurred - * 0b1..Occurred - */ -#define QDC_CTRL_HIRQ(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL_HIRQ_SHIFT)) & QDC_CTRL_HIRQ_MASK) -/*! @} */ - -/*! @name FILT - Input Filter */ -/*! @{ */ - -#define QDC_FILT_FILT_PER_MASK (0xFFU) -#define QDC_FILT_FILT_PER_SHIFT (0U) -/*! FILT_PER - Input Filter Sample Period */ -#define QDC_FILT_FILT_PER(x) (((uint16_t)(((uint16_t)(x)) << QDC_FILT_FILT_PER_SHIFT)) & QDC_FILT_FILT_PER_MASK) - -#define QDC_FILT_FILT_CNT_MASK (0x700U) -#define QDC_FILT_FILT_CNT_SHIFT (8U) -/*! FILT_CNT - Input Filter Sample Count */ -#define QDC_FILT_FILT_CNT(x) (((uint16_t)(((uint16_t)(x)) << QDC_FILT_FILT_CNT_SHIFT)) & QDC_FILT_FILT_CNT_MASK) - -#define QDC_FILT_FILT_PRSC_MASK (0xE000U) -#define QDC_FILT_FILT_PRSC_SHIFT (13U) -/*! FILT_PRSC - Prescaler Divide IPBus Clock to FILT Clock */ -#define QDC_FILT_FILT_PRSC(x) (((uint16_t)(((uint16_t)(x)) << QDC_FILT_FILT_PRSC_SHIFT)) & QDC_FILT_FILT_PRSC_MASK) -/*! @} */ - -/*! @name WTR - Watchdog Timeout */ -/*! @{ */ - -#define QDC_WTR_WDOG_MASK (0xFFFFU) -#define QDC_WTR_WDOG_SHIFT (0U) -/*! WDOG - WDOG */ -#define QDC_WTR_WDOG(x) (((uint16_t)(((uint16_t)(x)) << QDC_WTR_WDOG_SHIFT)) & QDC_WTR_WDOG_MASK) -/*! @} */ - -/*! @name POSD - Position Difference Counter */ -/*! @{ */ - -#define QDC_POSD_POSD_MASK (0xFFFFU) -#define QDC_POSD_POSD_SHIFT (0U) -/*! POSD - POSD */ -#define QDC_POSD_POSD(x) (((uint16_t)(((uint16_t)(x)) << QDC_POSD_POSD_SHIFT)) & QDC_POSD_POSD_MASK) -/*! @} */ - -/*! @name POSDH - Position Difference Hold */ -/*! @{ */ - -#define QDC_POSDH_POSDH_MASK (0xFFFFU) -#define QDC_POSDH_POSDH_SHIFT (0U) -/*! POSDH - POSDH */ -#define QDC_POSDH_POSDH(x) (((uint16_t)(((uint16_t)(x)) << QDC_POSDH_POSDH_SHIFT)) & QDC_POSDH_POSDH_MASK) -/*! @} */ - -/*! @name REV - Revolution Counter */ -/*! @{ */ - -#define QDC_REV_REV_MASK (0xFFFFU) -#define QDC_REV_REV_SHIFT (0U) -/*! REV - REV */ -#define QDC_REV_REV(x) (((uint16_t)(((uint16_t)(x)) << QDC_REV_REV_SHIFT)) & QDC_REV_REV_MASK) -/*! @} */ - -/*! @name REVH - Revolution Hold */ -/*! @{ */ - -#define QDC_REVH_REVH_MASK (0xFFFFU) -#define QDC_REVH_REVH_SHIFT (0U) -/*! REVH - REVH */ -#define QDC_REVH_REVH(x) (((uint16_t)(((uint16_t)(x)) << QDC_REVH_REVH_SHIFT)) & QDC_REVH_REVH_MASK) -/*! @} */ - -/*! @name UPOS - Upper Position Counter */ -/*! @{ */ - -#define QDC_UPOS_POS_MASK (0xFFFFU) -#define QDC_UPOS_POS_SHIFT (0U) -/*! POS - POS */ -#define QDC_UPOS_POS(x) (((uint16_t)(((uint16_t)(x)) << QDC_UPOS_POS_SHIFT)) & QDC_UPOS_POS_MASK) -/*! @} */ - -/*! @name LPOS - Lower Position Counter */ -/*! @{ */ - -#define QDC_LPOS_POS_MASK (0xFFFFU) -#define QDC_LPOS_POS_SHIFT (0U) -/*! POS - POS */ -#define QDC_LPOS_POS(x) (((uint16_t)(((uint16_t)(x)) << QDC_LPOS_POS_SHIFT)) & QDC_LPOS_POS_MASK) -/*! @} */ - -/*! @name UPOSH - Upper Position Hold */ -/*! @{ */ - -#define QDC_UPOSH_POSH_MASK (0xFFFFU) -#define QDC_UPOSH_POSH_SHIFT (0U) -/*! POSH - POSH */ -#define QDC_UPOSH_POSH(x) (((uint16_t)(((uint16_t)(x)) << QDC_UPOSH_POSH_SHIFT)) & QDC_UPOSH_POSH_MASK) -/*! @} */ - -/*! @name LPOSH - Lower Position Hold */ -/*! @{ */ - -#define QDC_LPOSH_POSH_MASK (0xFFFFU) -#define QDC_LPOSH_POSH_SHIFT (0U) -/*! POSH - POSH */ -#define QDC_LPOSH_POSH(x) (((uint16_t)(((uint16_t)(x)) << QDC_LPOSH_POSH_SHIFT)) & QDC_LPOSH_POSH_MASK) -/*! @} */ - -/*! @name UINIT - Upper Initialization */ -/*! @{ */ - -#define QDC_UINIT_INIT_MASK (0xFFFFU) -#define QDC_UINIT_INIT_SHIFT (0U) -/*! INIT - INIT */ -#define QDC_UINIT_INIT(x) (((uint16_t)(((uint16_t)(x)) << QDC_UINIT_INIT_SHIFT)) & QDC_UINIT_INIT_MASK) -/*! @} */ - -/*! @name LINIT - Lower Initialization */ -/*! @{ */ - -#define QDC_LINIT_INIT_MASK (0xFFFFU) -#define QDC_LINIT_INIT_SHIFT (0U) -/*! INIT - INIT */ -#define QDC_LINIT_INIT(x) (((uint16_t)(((uint16_t)(x)) << QDC_LINIT_INIT_SHIFT)) & QDC_LINIT_INIT_MASK) -/*! @} */ - -/*! @name IMR - Input Monitor */ -/*! @{ */ - -#define QDC_IMR_HOME_MASK (0x1U) -#define QDC_IMR_HOME_SHIFT (0U) -/*! HOME - HOME */ -#define QDC_IMR_HOME(x) (((uint16_t)(((uint16_t)(x)) << QDC_IMR_HOME_SHIFT)) & QDC_IMR_HOME_MASK) - -#define QDC_IMR_INDEX_MASK (0x2U) -#define QDC_IMR_INDEX_SHIFT (1U) -/*! INDEX - INDEX */ -#define QDC_IMR_INDEX(x) (((uint16_t)(((uint16_t)(x)) << QDC_IMR_INDEX_SHIFT)) & QDC_IMR_INDEX_MASK) - -#define QDC_IMR_PHB_MASK (0x4U) -#define QDC_IMR_PHB_SHIFT (2U) -/*! PHB - PHB */ -#define QDC_IMR_PHB(x) (((uint16_t)(((uint16_t)(x)) << QDC_IMR_PHB_SHIFT)) & QDC_IMR_PHB_MASK) - -#define QDC_IMR_PHA_MASK (0x8U) -#define QDC_IMR_PHA_SHIFT (3U) -/*! PHA - PHA */ -#define QDC_IMR_PHA(x) (((uint16_t)(((uint16_t)(x)) << QDC_IMR_PHA_SHIFT)) & QDC_IMR_PHA_MASK) - -#define QDC_IMR_FHOM_MASK (0x10U) -#define QDC_IMR_FHOM_SHIFT (4U) -/*! FHOM - FHOM */ -#define QDC_IMR_FHOM(x) (((uint16_t)(((uint16_t)(x)) << QDC_IMR_FHOM_SHIFT)) & QDC_IMR_FHOM_MASK) - -#define QDC_IMR_FIND_MASK (0x20U) -#define QDC_IMR_FIND_SHIFT (5U) -/*! FIND - FIND */ -#define QDC_IMR_FIND(x) (((uint16_t)(((uint16_t)(x)) << QDC_IMR_FIND_SHIFT)) & QDC_IMR_FIND_MASK) - -#define QDC_IMR_FPHB_MASK (0x40U) -#define QDC_IMR_FPHB_SHIFT (6U) -/*! FPHB - FPHB */ -#define QDC_IMR_FPHB(x) (((uint16_t)(((uint16_t)(x)) << QDC_IMR_FPHB_SHIFT)) & QDC_IMR_FPHB_MASK) - -#define QDC_IMR_FPHA_MASK (0x80U) -#define QDC_IMR_FPHA_SHIFT (7U) -/*! FPHA - FPHA */ -#define QDC_IMR_FPHA(x) (((uint16_t)(((uint16_t)(x)) << QDC_IMR_FPHA_SHIFT)) & QDC_IMR_FPHA_MASK) -/*! @} */ - -/*! @name TST - Test */ -/*! @{ */ - -#define QDC_TST_TEST_COUNT_MASK (0xFFU) -#define QDC_TST_TEST_COUNT_SHIFT (0U) -/*! TEST_COUNT - TEST_COUNT */ -#define QDC_TST_TEST_COUNT(x) (((uint16_t)(((uint16_t)(x)) << QDC_TST_TEST_COUNT_SHIFT)) & QDC_TST_TEST_COUNT_MASK) - -#define QDC_TST_TEST_PERIOD_MASK (0x1F00U) -#define QDC_TST_TEST_PERIOD_SHIFT (8U) -/*! TEST_PERIOD - TEST_PERIOD */ -#define QDC_TST_TEST_PERIOD(x) (((uint16_t)(((uint16_t)(x)) << QDC_TST_TEST_PERIOD_SHIFT)) & QDC_TST_TEST_PERIOD_MASK) - -#define QDC_TST_QDN_MASK (0x2000U) -#define QDC_TST_QDN_SHIFT (13U) -/*! QDN - Quadrature Decoder Negative Signal - * 0b0..Positive quadrature decoder signal - * 0b1..Negative quadrature decoder signal - */ -#define QDC_TST_QDN(x) (((uint16_t)(((uint16_t)(x)) << QDC_TST_QDN_SHIFT)) & QDC_TST_QDN_MASK) - -#define QDC_TST_TCE_MASK (0x4000U) -#define QDC_TST_TCE_SHIFT (14U) -/*! TCE - Test Counter Enable - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_TST_TCE(x) (((uint16_t)(((uint16_t)(x)) << QDC_TST_TCE_SHIFT)) & QDC_TST_TCE_MASK) - -#define QDC_TST_TEN_MASK (0x8000U) -#define QDC_TST_TEN_SHIFT (15U) -/*! TEN - Test Mode Enable - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_TST_TEN(x) (((uint16_t)(((uint16_t)(x)) << QDC_TST_TEN_SHIFT)) & QDC_TST_TEN_MASK) -/*! @} */ - -/*! @name CTRL2 - Control 2 */ -/*! @{ */ - -#define QDC_CTRL2_UPDHLD_MASK (0x1U) -#define QDC_CTRL2_UPDHLD_SHIFT (0U) -/*! UPDHLD - Update Hold Registers - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL2_UPDHLD(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_UPDHLD_SHIFT)) & QDC_CTRL2_UPDHLD_MASK) - -#define QDC_CTRL2_UPDPOS_MASK (0x2U) -#define QDC_CTRL2_UPDPOS_SHIFT (1U) -/*! UPDPOS - Update Position Registers - * 0b0..No action - * 0b1..Clear - */ -#define QDC_CTRL2_UPDPOS(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_UPDPOS_SHIFT)) & QDC_CTRL2_UPDPOS_MASK) - -#define QDC_CTRL2_MOD_MASK (0x4U) -#define QDC_CTRL2_MOD_SHIFT (2U) -/*! MOD - Enable Modulo Counting - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL2_MOD(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_MOD_SHIFT)) & QDC_CTRL2_MOD_MASK) - -#define QDC_CTRL2_DIR_MASK (0x8U) -#define QDC_CTRL2_DIR_SHIFT (3U) -/*! DIR - Count Direction Flag - * 0b0..Down direction - * 0b1..Up direction - */ -#define QDC_CTRL2_DIR(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_DIR_SHIFT)) & QDC_CTRL2_DIR_MASK) - -#define QDC_CTRL2_RUIE_MASK (0x10U) -#define QDC_CTRL2_RUIE_SHIFT (4U) -/*! RUIE - Roll-under Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL2_RUIE(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_RUIE_SHIFT)) & QDC_CTRL2_RUIE_MASK) - -#define QDC_CTRL2_RUIRQ_MASK (0x20U) -#define QDC_CTRL2_RUIRQ_SHIFT (5U) -/*! RUIRQ - Roll-under Interrupt Request - * 0b0..No roll-under has occurred - * 0b1..Roll-under has occurred - */ -#define QDC_CTRL2_RUIRQ(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_RUIRQ_SHIFT)) & QDC_CTRL2_RUIRQ_MASK) - -#define QDC_CTRL2_ROIE_MASK (0x40U) -#define QDC_CTRL2_ROIE_SHIFT (6U) -/*! ROIE - Roll-over Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL2_ROIE(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_ROIE_SHIFT)) & QDC_CTRL2_ROIE_MASK) - -#define QDC_CTRL2_ROIRQ_MASK (0x80U) -#define QDC_CTRL2_ROIRQ_SHIFT (7U) -/*! ROIRQ - Roll-over Interrupt Request - * 0b0..Did not occur - * 0b1..Occurred - */ -#define QDC_CTRL2_ROIRQ(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_ROIRQ_SHIFT)) & QDC_CTRL2_ROIRQ_MASK) - -#define QDC_CTRL2_REVMOD_MASK (0x100U) -#define QDC_CTRL2_REVMOD_SHIFT (8U) -/*! REVMOD - Revolution Counter Modulus Enable - * 0b0..Use INDEX pulse - * 0b1..Use modulus counting roll-over or roll-under - */ -#define QDC_CTRL2_REVMOD(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_REVMOD_SHIFT)) & QDC_CTRL2_REVMOD_MASK) - -#define QDC_CTRL2_OUTCTL_MASK (0x200U) -#define QDC_CTRL2_OUTCTL_SHIFT (9U) -/*! OUTCTL - Output Control - * 0b0..POSMATCH pulses when a match occurs between the position counters (POS) and the corresponding compare value (COMP ) - * 0b1..POSMATCH pulses when the UPOS, LPOS, REV, or POSD registers are read - */ -#define QDC_CTRL2_OUTCTL(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_OUTCTL_SHIFT)) & QDC_CTRL2_OUTCTL_MASK) - -#define QDC_CTRL2_SABIE_MASK (0x400U) -#define QDC_CTRL2_SABIE_SHIFT (10U) -/*! SABIE - Simultaneous PHASEA and PHASEB Change Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define QDC_CTRL2_SABIE(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_SABIE_SHIFT)) & QDC_CTRL2_SABIE_MASK) - -#define QDC_CTRL2_SABIRQ_MASK (0x800U) -#define QDC_CTRL2_SABIRQ_SHIFT (11U) -/*! SABIRQ - Simultaneous PHASEA and PHASEB Change Interrupt Request - * 0b0..No simultaneous change has occurred - * 0b1..A simultaneous change has occurred - */ -#define QDC_CTRL2_SABIRQ(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_SABIRQ_SHIFT)) & QDC_CTRL2_SABIRQ_MASK) - -#define QDC_CTRL2_INITPOS_MASK (0x1000U) -#define QDC_CTRL2_INITPOS_SHIFT (12U) -/*! INITPOS - Initialize Position Registers - * 0b0..Don't initialize position counter - * 0b1..Initialize position counter - */ -#define QDC_CTRL2_INITPOS(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL2_INITPOS_SHIFT)) & QDC_CTRL2_INITPOS_MASK) -/*! @} */ - -/*! @name UMOD - Upper Modulus */ -/*! @{ */ - -#define QDC_UMOD_MOD_MASK (0xFFFFU) -#define QDC_UMOD_MOD_SHIFT (0U) -/*! MOD - MOD */ -#define QDC_UMOD_MOD(x) (((uint16_t)(((uint16_t)(x)) << QDC_UMOD_MOD_SHIFT)) & QDC_UMOD_MOD_MASK) -/*! @} */ - -/*! @name LMOD - Lower Modulus */ -/*! @{ */ - -#define QDC_LMOD_MOD_MASK (0xFFFFU) -#define QDC_LMOD_MOD_SHIFT (0U) -/*! MOD - MOD */ -#define QDC_LMOD_MOD(x) (((uint16_t)(((uint16_t)(x)) << QDC_LMOD_MOD_SHIFT)) & QDC_LMOD_MOD_MASK) -/*! @} */ - -/*! @name UCOMP - Upper Position Compare */ -/*! @{ */ - -#define QDC_UCOMP_COMP_MASK (0xFFFFU) -#define QDC_UCOMP_COMP_SHIFT (0U) -/*! COMP - COMP */ -#define QDC_UCOMP_COMP(x) (((uint16_t)(((uint16_t)(x)) << QDC_UCOMP_COMP_SHIFT)) & QDC_UCOMP_COMP_MASK) -/*! @} */ - -/*! @name LCOMP - Lower Position Compare */ -/*! @{ */ - -#define QDC_LCOMP_COMP_MASK (0xFFFFU) -#define QDC_LCOMP_COMP_SHIFT (0U) -/*! COMP - COMP */ -#define QDC_LCOMP_COMP(x) (((uint16_t)(((uint16_t)(x)) << QDC_LCOMP_COMP_SHIFT)) & QDC_LCOMP_COMP_MASK) -/*! @} */ - -/*! @name LASTEDGE - Last Edge Time */ -/*! @{ */ - -#define QDC_LASTEDGE_LASTEDGE_MASK (0xFFFFU) -#define QDC_LASTEDGE_LASTEDGE_SHIFT (0U) -/*! LASTEDGE - Last Edge Time Counter */ -#define QDC_LASTEDGE_LASTEDGE(x) (((uint16_t)(((uint16_t)(x)) << QDC_LASTEDGE_LASTEDGE_SHIFT)) & QDC_LASTEDGE_LASTEDGE_MASK) -/*! @} */ - -/*! @name LASTEDGEH - Last Edge Time Hold */ -/*! @{ */ - -#define QDC_LASTEDGEH_LASTEDGEH_MASK (0xFFFFU) -#define QDC_LASTEDGEH_LASTEDGEH_SHIFT (0U) -/*! LASTEDGEH - Last Edge Time Hold */ -#define QDC_LASTEDGEH_LASTEDGEH(x) (((uint16_t)(((uint16_t)(x)) << QDC_LASTEDGEH_LASTEDGEH_SHIFT)) & QDC_LASTEDGEH_LASTEDGEH_MASK) -/*! @} */ - -/*! @name POSDPER - Position Difference Period Counter */ -/*! @{ */ - -#define QDC_POSDPER_POSDPER_MASK (0xFFFFU) -#define QDC_POSDPER_POSDPER_SHIFT (0U) -/*! POSDPER - Position difference period */ -#define QDC_POSDPER_POSDPER(x) (((uint16_t)(((uint16_t)(x)) << QDC_POSDPER_POSDPER_SHIFT)) & QDC_POSDPER_POSDPER_MASK) -/*! @} */ - -/*! @name POSDPERBFR - Position Difference Period Buffer */ -/*! @{ */ - -#define QDC_POSDPERBFR_POSDPERBFR_MASK (0xFFFFU) -#define QDC_POSDPERBFR_POSDPERBFR_SHIFT (0U) -/*! POSDPERBFR - Position difference period buffer */ -#define QDC_POSDPERBFR_POSDPERBFR(x) (((uint16_t)(((uint16_t)(x)) << QDC_POSDPERBFR_POSDPERBFR_SHIFT)) & QDC_POSDPERBFR_POSDPERBFR_MASK) -/*! @} */ - -/*! @name POSDPERH - Position Difference Period Hold */ -/*! @{ */ - -#define QDC_POSDPERH_POSDPERH_MASK (0xFFFFU) -#define QDC_POSDPERH_POSDPERH_SHIFT (0U) -/*! POSDPERH - Position difference period hold */ -#define QDC_POSDPERH_POSDPERH(x) (((uint16_t)(((uint16_t)(x)) << QDC_POSDPERH_POSDPERH_SHIFT)) & QDC_POSDPERH_POSDPERH_MASK) -/*! @} */ - -/*! @name CTRL3 - Control 3 */ -/*! @{ */ - -#define QDC_CTRL3_PMEN_MASK (0x1U) -#define QDC_CTRL3_PMEN_SHIFT (0U) -/*! PMEN - Period Measurement Function Enable - * 0b0..Not used - * 0b1..Used - */ -#define QDC_CTRL3_PMEN(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL3_PMEN_SHIFT)) & QDC_CTRL3_PMEN_MASK) - -#define QDC_CTRL3_PRSC_MASK (0xF0U) -#define QDC_CTRL3_PRSC_SHIFT (4U) -/*! PRSC - Prescaler */ -#define QDC_CTRL3_PRSC(x) (((uint16_t)(((uint16_t)(x)) << QDC_CTRL3_PRSC_SHIFT)) & QDC_CTRL3_PRSC_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group QDC_Register_Masks */ - - -/* QDC - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral QDC0 base address */ - #define QDC0_BASE (0x500CF000u) - /** Peripheral QDC0 base address */ - #define QDC0_BASE_NS (0x400CF000u) - /** Peripheral QDC0 base pointer */ - #define QDC0 ((QDC_Type *)QDC0_BASE) - /** Peripheral QDC0 base pointer */ - #define QDC0_NS ((QDC_Type *)QDC0_BASE_NS) - /** Peripheral QDC1 base address */ - #define QDC1_BASE (0x500D1000u) - /** Peripheral QDC1 base address */ - #define QDC1_BASE_NS (0x400D1000u) - /** Peripheral QDC1 base pointer */ - #define QDC1 ((QDC_Type *)QDC1_BASE) - /** Peripheral QDC1 base pointer */ - #define QDC1_NS ((QDC_Type *)QDC1_BASE_NS) - /** Array initializer of QDC peripheral base addresses */ - #define QDC_BASE_ADDRS { QDC0_BASE, QDC1_BASE } - /** Array initializer of QDC peripheral base pointers */ - #define QDC_BASE_PTRS { QDC0, QDC1 } - /** Array initializer of QDC peripheral base addresses */ - #define QDC_BASE_ADDRS_NS { QDC0_BASE_NS, QDC1_BASE_NS } - /** Array initializer of QDC peripheral base pointers */ - #define QDC_BASE_PTRS_NS { QDC0_NS, QDC1_NS } -#else - /** Peripheral QDC0 base address */ - #define QDC0_BASE (0x400CF000u) - /** Peripheral QDC0 base pointer */ - #define QDC0 ((QDC_Type *)QDC0_BASE) - /** Peripheral QDC1 base address */ - #define QDC1_BASE (0x400D1000u) - /** Peripheral QDC1 base pointer */ - #define QDC1 ((QDC_Type *)QDC1_BASE) - /** Array initializer of QDC peripheral base addresses */ - #define QDC_BASE_ADDRS { QDC0_BASE, QDC1_BASE } - /** Array initializer of QDC peripheral base pointers */ - #define QDC_BASE_PTRS { QDC0, QDC1 } -#endif -/** Interrupt vectors for the QDC peripheral type */ -#define QDC_COMPARE_IRQS { QDC0_COMPARE_IRQn, QDC1_COMPARE_IRQn } -#define QDC_HOME_IRQS { QDC0_HOME_IRQn, QDC1_HOME_IRQn } -#define QDC_WDOG_IRQS { QDC0_WDG_SAB_IRQn, QDC1_WDG_SAB_IRQn } -#define QDC_INDEX_IRQS { QDC0_IDX_IRQn, QDC1_IDX_IRQn } - -/*! - * @} - */ /* end of group QDC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- RTC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup RTC_Peripheral_Access_Layer RTC Peripheral Access Layer - * @{ - */ - -/** RTC - Register Layout Typedef */ -typedef struct { - __IO uint16_t YEARMON; /**< Year and Month Counters, offset: 0x0 */ - __IO uint16_t DAYS; /**< Days and Day-of-Week Counters, offset: 0x2 */ - __IO uint16_t HOURMIN; /**< Hours and Minutes Counters, offset: 0x4 */ - __IO uint16_t SECONDS; /**< Seconds Counters, offset: 0x6 */ - __IO uint16_t ALM_YEARMON; /**< Year and Months Alarm, offset: 0x8 */ - __IO uint16_t ALM_DAYS; /**< Days Alarm, offset: 0xA */ - __IO uint16_t ALM_HOURMIN; /**< Hours and Minutes Alarm, offset: 0xC */ - __IO uint16_t ALM_SECONDS; /**< Seconds Alarm, offset: 0xE */ - __IO uint16_t CTRL; /**< Control, offset: 0x10 */ - __IO uint16_t STATUS; /**< Status, offset: 0x12 */ - __IO uint16_t ISR; /**< Interrupt Status, offset: 0x14 */ - __IO uint16_t IER; /**< Interrupt Enable, offset: 0x16 */ - uint8_t RESERVED_0[4]; - __I uint16_t RTC_TEST2; /**< Sub Second Counter, offset: 0x1C */ - uint8_t RESERVED_1[4]; - __IO uint16_t DST_HOUR; /**< Daylight Saving Hour, offset: 0x22 */ - __IO uint16_t DST_MONTH; /**< Daylight Saving Month, offset: 0x24 */ - __IO uint16_t DST_DAY; /**< Daylight Saving Day, offset: 0x26 */ - __IO uint16_t COMPEN; /**< Compensation, offset: 0x28 */ - uint8_t RESERVED_2[2006]; - __IO uint32_t SUBSECOND_CTRL; /**< Subsecond Control, offset: 0x800 */ - __I uint32_t SUBSECOND_CNT; /**< Subsecond Counter, offset: 0x804 */ - uint8_t RESERVED_3[1016]; - __IO uint32_t WAKE_TIMER_CTRL; /**< Wake Timer Control, offset: 0xC00 */ - uint8_t RESERVED_4[8]; - __IO uint32_t WAKE_TIMER_CNT; /**< Wake Timer Counter, offset: 0xC0C */ -} RTC_Type; - -/* ---------------------------------------------------------------------------- - -- RTC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup RTC_Register_Masks RTC Register Masks - * @{ - */ - -/*! @name YEARMON - Year and Month Counters */ -/*! @{ */ - -#define RTC_YEARMON_MON_CNT_MASK (0xFU) -#define RTC_YEARMON_MON_CNT_SHIFT (0U) -/*! MON_CNT - Month Counter - * 0b0000, 0b1101, 0b1110, 0b1111..Illegal Value - * 0b0001..January - * 0b0010..February - * 0b0011..March - * 0b0100..April - * 0b0101..May - * 0b0110..June - * 0b0111..July - * 0b1000..August - * 0b1001..September - * 0b1010..October - * 0b1011..November - * 0b1100..December - */ -#define RTC_YEARMON_MON_CNT(x) (((uint16_t)(((uint16_t)(x)) << RTC_YEARMON_MON_CNT_SHIFT)) & RTC_YEARMON_MON_CNT_MASK) - -#define RTC_YEARMON_YROFST_MASK (0xFF00U) -#define RTC_YEARMON_YROFST_SHIFT (8U) -/*! YROFST - Year Offset Count Value */ -#define RTC_YEARMON_YROFST(x) (((uint16_t)(((uint16_t)(x)) << RTC_YEARMON_YROFST_SHIFT)) & RTC_YEARMON_YROFST_MASK) -/*! @} */ - -/*! @name DAYS - Days and Day-of-Week Counters */ -/*! @{ */ - -#define RTC_DAYS_DAY_CNT_MASK (0x1FU) -#define RTC_DAYS_DAY_CNT_SHIFT (0U) -/*! DAY_CNT - Days Counter Value */ -#define RTC_DAYS_DAY_CNT(x) (((uint16_t)(((uint16_t)(x)) << RTC_DAYS_DAY_CNT_SHIFT)) & RTC_DAYS_DAY_CNT_MASK) - -#define RTC_DAYS_DOW_MASK (0x700U) -#define RTC_DAYS_DOW_SHIFT (8U) -/*! DOW - Day of Week Counter Value - * 0b000..Sunday - * 0b001..Monday - * 0b010..Tuesday - * 0b011..Wednesday - * 0b100..Thursday - * 0b101..Friday - * 0b110..Saturday - * 0b111.. - */ -#define RTC_DAYS_DOW(x) (((uint16_t)(((uint16_t)(x)) << RTC_DAYS_DOW_SHIFT)) & RTC_DAYS_DOW_MASK) -/*! @} */ - -/*! @name HOURMIN - Hours and Minutes Counters */ -/*! @{ */ - -#define RTC_HOURMIN_MIN_CNT_MASK (0x3FU) -#define RTC_HOURMIN_MIN_CNT_SHIFT (0U) -/*! MIN_CNT - Minutes Counter Value */ -#define RTC_HOURMIN_MIN_CNT(x) (((uint16_t)(((uint16_t)(x)) << RTC_HOURMIN_MIN_CNT_SHIFT)) & RTC_HOURMIN_MIN_CNT_MASK) - -#define RTC_HOURMIN_HOUR_CNT_MASK (0x1F00U) -#define RTC_HOURMIN_HOUR_CNT_SHIFT (8U) -/*! HOUR_CNT - Hours Counter Value */ -#define RTC_HOURMIN_HOUR_CNT(x) (((uint16_t)(((uint16_t)(x)) << RTC_HOURMIN_HOUR_CNT_SHIFT)) & RTC_HOURMIN_HOUR_CNT_MASK) -/*! @} */ - -/*! @name SECONDS - Seconds Counters */ -/*! @{ */ - -#define RTC_SECONDS_SEC_CNT_MASK (0x3FU) -#define RTC_SECONDS_SEC_CNT_SHIFT (0U) -/*! SEC_CNT - Seconds Counter Value */ -#define RTC_SECONDS_SEC_CNT(x) (((uint16_t)(((uint16_t)(x)) << RTC_SECONDS_SEC_CNT_SHIFT)) & RTC_SECONDS_SEC_CNT_MASK) -/*! @} */ - -/*! @name ALM_YEARMON - Year and Months Alarm */ -/*! @{ */ - -#define RTC_ALM_YEARMON_ALM_MON_MASK (0xFU) -#define RTC_ALM_YEARMON_ALM_MON_SHIFT (0U) -/*! ALM_MON - Months Value for Alarm */ -#define RTC_ALM_YEARMON_ALM_MON(x) (((uint16_t)(((uint16_t)(x)) << RTC_ALM_YEARMON_ALM_MON_SHIFT)) & RTC_ALM_YEARMON_ALM_MON_MASK) - -#define RTC_ALM_YEARMON_ALM_YEAR_MASK (0xFF00U) -#define RTC_ALM_YEARMON_ALM_YEAR_SHIFT (8U) -/*! ALM_YEAR - Year Value for Alarm */ -#define RTC_ALM_YEARMON_ALM_YEAR(x) (((uint16_t)(((uint16_t)(x)) << RTC_ALM_YEARMON_ALM_YEAR_SHIFT)) & RTC_ALM_YEARMON_ALM_YEAR_MASK) -/*! @} */ - -/*! @name ALM_DAYS - Days Alarm */ -/*! @{ */ - -#define RTC_ALM_DAYS_ALM_DAY_MASK (0x1FU) -#define RTC_ALM_DAYS_ALM_DAY_SHIFT (0U) -/*! ALM_DAY - Days Value for Alarm */ -#define RTC_ALM_DAYS_ALM_DAY(x) (((uint16_t)(((uint16_t)(x)) << RTC_ALM_DAYS_ALM_DAY_SHIFT)) & RTC_ALM_DAYS_ALM_DAY_MASK) -/*! @} */ - -/*! @name ALM_HOURMIN - Hours and Minutes Alarm */ -/*! @{ */ - -#define RTC_ALM_HOURMIN_ALM_MIN_MASK (0x3FU) -#define RTC_ALM_HOURMIN_ALM_MIN_SHIFT (0U) -/*! ALM_MIN - Minutes Value for Alarm */ -#define RTC_ALM_HOURMIN_ALM_MIN(x) (((uint16_t)(((uint16_t)(x)) << RTC_ALM_HOURMIN_ALM_MIN_SHIFT)) & RTC_ALM_HOURMIN_ALM_MIN_MASK) - -#define RTC_ALM_HOURMIN_ALM_HOUR_MASK (0x1F00U) -#define RTC_ALM_HOURMIN_ALM_HOUR_SHIFT (8U) -/*! ALM_HOUR - Hours Value for Alarm */ -#define RTC_ALM_HOURMIN_ALM_HOUR(x) (((uint16_t)(((uint16_t)(x)) << RTC_ALM_HOURMIN_ALM_HOUR_SHIFT)) & RTC_ALM_HOURMIN_ALM_HOUR_MASK) -/*! @} */ - -/*! @name ALM_SECONDS - Seconds Alarm */ -/*! @{ */ - -#define RTC_ALM_SECONDS_ALM_SEC_MASK (0x3FU) -#define RTC_ALM_SECONDS_ALM_SEC_SHIFT (0U) -/*! ALM_SEC - Seconds Alarm Value */ -#define RTC_ALM_SECONDS_ALM_SEC(x) (((uint16_t)(((uint16_t)(x)) << RTC_ALM_SECONDS_ALM_SEC_SHIFT)) & RTC_ALM_SECONDS_ALM_SEC_MASK) - -#define RTC_ALM_SECONDS_DEC_SEC_MASK (0x100U) -#define RTC_ALM_SECONDS_DEC_SEC_SHIFT (8U) -/*! DEC_SEC - Decrement Seconds Counter by 1. */ -#define RTC_ALM_SECONDS_DEC_SEC(x) (((uint16_t)(((uint16_t)(x)) << RTC_ALM_SECONDS_DEC_SEC_SHIFT)) & RTC_ALM_SECONDS_DEC_SEC_MASK) - -#define RTC_ALM_SECONDS_INC_SEC_MASK (0x200U) -#define RTC_ALM_SECONDS_INC_SEC_SHIFT (9U) -/*! INC_SEC - Increment Seconds Counter by 1. */ -#define RTC_ALM_SECONDS_INC_SEC(x) (((uint16_t)(((uint16_t)(x)) << RTC_ALM_SECONDS_INC_SEC_SHIFT)) & RTC_ALM_SECONDS_INC_SEC_MASK) -/*! @} */ - -/*! @name CTRL - Control */ -/*! @{ */ - -#define RTC_CTRL_FINEEN_MASK (0x1U) -#define RTC_CTRL_FINEEN_SHIFT (0U) -/*! FINEEN - Fine Compensation Enable - * 0b1..Fine compensation is enabled. - * 0b0..Fine compensation is disabled - */ -#define RTC_CTRL_FINEEN(x) (((uint16_t)(((uint16_t)(x)) << RTC_CTRL_FINEEN_SHIFT)) & RTC_CTRL_FINEEN_MASK) - -#define RTC_CTRL_COMP_EN_MASK (0x2U) -#define RTC_CTRL_COMP_EN_SHIFT (1U) -/*! COMP_EN - Compensation Enable - * 0b0..Coarse compensation is disabled. - * 0b1..Coarse compensation is enabled. - */ -#define RTC_CTRL_COMP_EN(x) (((uint16_t)(((uint16_t)(x)) << RTC_CTRL_COMP_EN_SHIFT)) & RTC_CTRL_COMP_EN_MASK) - -#define RTC_CTRL_ALM_MATCH_MASK (0xCU) -#define RTC_CTRL_ALM_MATCH_SHIFT (2U) -/*! ALM_MATCH - Alarm Match - * 0b00..Only seconds, minutes, and hours matched. - * 0b01..Only seconds, minutes, hours, and days matched. - * 0b10..Only seconds, minutes, hours, days, and months matched. - * 0b11..Only seconds, minutes, hours, days, months, and year (offset) matched. - */ -#define RTC_CTRL_ALM_MATCH(x) (((uint16_t)(((uint16_t)(x)) << RTC_CTRL_ALM_MATCH_SHIFT)) & RTC_CTRL_ALM_MATCH_MASK) - -#define RTC_CTRL_DST_EN_MASK (0x40U) -#define RTC_CTRL_DST_EN_SHIFT (6U) -/*! DST_EN - Daylight Saving Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define RTC_CTRL_DST_EN(x) (((uint16_t)(((uint16_t)(x)) << RTC_CTRL_DST_EN_SHIFT)) & RTC_CTRL_DST_EN_MASK) - -#define RTC_CTRL_SWR_MASK (0x100U) -#define RTC_CTRL_SWR_SHIFT (8U) -/*! SWR - Software Reset - * 0b0..Software Reset cleared - * 0b1..Software Reset asserted - */ -#define RTC_CTRL_SWR(x) (((uint16_t)(((uint16_t)(x)) << RTC_CTRL_SWR_SHIFT)) & RTC_CTRL_SWR_MASK) - -#define RTC_CTRL_CLK_SEL_MASK (0x200U) -#define RTC_CTRL_CLK_SEL_SHIFT (9U) -/*! CLK_SEL - RTC Clock Select - * 0b0..16.384 kHz clock is selected - * 0b1..32.768 kHz clock is selected - */ -#define RTC_CTRL_CLK_SEL(x) (((uint16_t)(((uint16_t)(x)) << RTC_CTRL_CLK_SEL_SHIFT)) & RTC_CTRL_CLK_SEL_MASK) - -#define RTC_CTRL_CLKO_DIS_MASK (0x400U) -#define RTC_CTRL_CLKO_DIS_SHIFT (10U) -/*! CLKO_DIS - Clock Output Disable - * 0b0..The selected clock is output to other peripherals. - * 0b1..The selected clock is not output to other peripherals. - */ -#define RTC_CTRL_CLKO_DIS(x) (((uint16_t)(((uint16_t)(x)) << RTC_CTRL_CLKO_DIS_SHIFT)) & RTC_CTRL_CLKO_DIS_MASK) - -#define RTC_CTRL_CLKOUT_MASK (0x6000U) -#define RTC_CTRL_CLKOUT_SHIFT (13U) -/*! CLKOUT - RTC Clock Output Selection - * 0b00..No output clock - * 0b01..Fine 1 Hz clock with both precise edges - * 0b10..32.768 or 16.384 kHz clock - * 0b11..Coarse 1 Hz clock with both precise edges - */ -#define RTC_CTRL_CLKOUT(x) (((uint16_t)(((uint16_t)(x)) << RTC_CTRL_CLKOUT_SHIFT)) & RTC_CTRL_CLKOUT_MASK) -/*! @} */ - -/*! @name STATUS - Status */ -/*! @{ */ - -#define RTC_STATUS_INVAL_BIT_MASK (0x1U) -#define RTC_STATUS_INVAL_BIT_SHIFT (0U) -/*! INVAL_BIT - Invalidate CPU Read/Write Access - * 0b0..Time and date counters can be read or written. Time and date is valid. - * 0b1..Time and date counter values are changing or time and date is invalid and cannot be read or written. - */ -#define RTC_STATUS_INVAL_BIT(x) (((uint16_t)(((uint16_t)(x)) << RTC_STATUS_INVAL_BIT_SHIFT)) & RTC_STATUS_INVAL_BIT_MASK) - -#define RTC_STATUS_WRITE_PROT_EN_MASK (0x2U) -#define RTC_STATUS_WRITE_PROT_EN_SHIFT (1U) -/*! WRITE_PROT_EN - Write Protect Enable Status - * 0b0..Registers are unlocked and can be accessed. - * 0b1..Registers are locked and in read-only mode. - */ -#define RTC_STATUS_WRITE_PROT_EN(x) (((uint16_t)(((uint16_t)(x)) << RTC_STATUS_WRITE_PROT_EN_SHIFT)) & RTC_STATUS_WRITE_PROT_EN_MASK) - -#define RTC_STATUS_CMP_INT_MASK (0x20U) -#define RTC_STATUS_CMP_INT_SHIFT (5U) -/*! CMP_INT - Compensation Interval */ -#define RTC_STATUS_CMP_INT(x) (((uint16_t)(((uint16_t)(x)) << RTC_STATUS_CMP_INT_SHIFT)) & RTC_STATUS_CMP_INT_MASK) - -#define RTC_STATUS_WE_MASK (0xC0U) -#define RTC_STATUS_WE_SHIFT (6U) -/*! WE - Write Enable - * 0b10..Enable Write Protection - Registers are locked. - */ -#define RTC_STATUS_WE(x) (((uint16_t)(((uint16_t)(x)) << RTC_STATUS_WE_SHIFT)) & RTC_STATUS_WE_MASK) - -#define RTC_STATUS_BUS_ERR_MASK (0x100U) -#define RTC_STATUS_BUS_ERR_SHIFT (8U) -/*! BUS_ERR - Bus Error - * 0b0..Read and write accesses are normal. - * 0b1..Read or write accesses occurred when STATUS[INVAL_BIT] was asserted. - */ -#define RTC_STATUS_BUS_ERR(x) (((uint16_t)(((uint16_t)(x)) << RTC_STATUS_BUS_ERR_SHIFT)) & RTC_STATUS_BUS_ERR_MASK) - -#define RTC_STATUS_CMP_DONE_MASK (0x800U) -#define RTC_STATUS_CMP_DONE_SHIFT (11U) -/*! CMP_DONE - Compensation Done - * 0b0..Compensation busy or not enabled - * 0b1..Compensation completed - */ -#define RTC_STATUS_CMP_DONE(x) (((uint16_t)(((uint16_t)(x)) << RTC_STATUS_CMP_DONE_SHIFT)) & RTC_STATUS_CMP_DONE_MASK) -/*! @} */ - -/*! @name ISR - Interrupt Status */ -/*! @{ */ - -#define RTC_ISR_ALM_IS_MASK (0x4U) -#define RTC_ISR_ALM_IS_SHIFT (2U) -/*! ALM_IS - Alarm Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_ALM_IS(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_ALM_IS_SHIFT)) & RTC_ISR_ALM_IS_MASK) - -#define RTC_ISR_DAY_IS_MASK (0x8U) -#define RTC_ISR_DAY_IS_SHIFT (3U) -/*! DAY_IS - Days Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_DAY_IS(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_DAY_IS_SHIFT)) & RTC_ISR_DAY_IS_MASK) - -#define RTC_ISR_HOUR_IS_MASK (0x10U) -#define RTC_ISR_HOUR_IS_SHIFT (4U) -/*! HOUR_IS - Hours Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_HOUR_IS(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_HOUR_IS_SHIFT)) & RTC_ISR_HOUR_IS_MASK) - -#define RTC_ISR_MIN_IS_MASK (0x20U) -#define RTC_ISR_MIN_IS_SHIFT (5U) -/*! MIN_IS - Minutes Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_MIN_IS(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_MIN_IS_SHIFT)) & RTC_ISR_MIN_IS_MASK) - -#define RTC_ISR_IS_1HZ_MASK (0x40U) -#define RTC_ISR_IS_1HZ_SHIFT (6U) -/*! IS_1HZ - 1 Hz Interval Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_IS_1HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_IS_1HZ_SHIFT)) & RTC_ISR_IS_1HZ_MASK) - -#define RTC_ISR_IS_2HZ_MASK (0x80U) -#define RTC_ISR_IS_2HZ_SHIFT (7U) -/*! IS_2HZ - 2 Hz Interval Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_IS_2HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_IS_2HZ_SHIFT)) & RTC_ISR_IS_2HZ_MASK) - -#define RTC_ISR_IS_4HZ_MASK (0x100U) -#define RTC_ISR_IS_4HZ_SHIFT (8U) -/*! IS_4HZ - 4 Hz Interval Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_IS_4HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_IS_4HZ_SHIFT)) & RTC_ISR_IS_4HZ_MASK) - -#define RTC_ISR_IS_8HZ_MASK (0x200U) -#define RTC_ISR_IS_8HZ_SHIFT (9U) -/*! IS_8HZ - 8 Hz Interval Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_IS_8HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_IS_8HZ_SHIFT)) & RTC_ISR_IS_8HZ_MASK) - -#define RTC_ISR_IS_16HZ_MASK (0x400U) -#define RTC_ISR_IS_16HZ_SHIFT (10U) -/*! IS_16HZ - 16 Hz Interval Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_IS_16HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_IS_16HZ_SHIFT)) & RTC_ISR_IS_16HZ_MASK) - -#define RTC_ISR_IS_32HZ_MASK (0x800U) -#define RTC_ISR_IS_32HZ_SHIFT (11U) -/*! IS_32HZ - 32 Hz Interval Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_IS_32HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_IS_32HZ_SHIFT)) & RTC_ISR_IS_32HZ_MASK) - -#define RTC_ISR_IS_64HZ_MASK (0x1000U) -#define RTC_ISR_IS_64HZ_SHIFT (12U) -/*! IS_64HZ - 64 Hz Interval Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_IS_64HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_IS_64HZ_SHIFT)) & RTC_ISR_IS_64HZ_MASK) - -#define RTC_ISR_IS_128HZ_MASK (0x2000U) -#define RTC_ISR_IS_128HZ_SHIFT (13U) -/*! IS_128HZ - 128 Hz Interval Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_IS_128HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_IS_128HZ_SHIFT)) & RTC_ISR_IS_128HZ_MASK) - -#define RTC_ISR_IS_256HZ_MASK (0x4000U) -#define RTC_ISR_IS_256HZ_SHIFT (14U) -/*! IS_256HZ - 256 Hz Interval Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_IS_256HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_IS_256HZ_SHIFT)) & RTC_ISR_IS_256HZ_MASK) - -#define RTC_ISR_IS_512HZ_MASK (0x8000U) -#define RTC_ISR_IS_512HZ_SHIFT (15U) -/*! IS_512HZ - 512 Hz Interval Interrupt Status - * 0b0..Interrupt is de-asserted. - * 0b1..Interrupt is asserted. - */ -#define RTC_ISR_IS_512HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_ISR_IS_512HZ_SHIFT)) & RTC_ISR_IS_512HZ_MASK) -/*! @} */ - -/*! @name IER - Interrupt Enable */ -/*! @{ */ - -#define RTC_IER_ALM_IE_MASK (0x4U) -#define RTC_IER_ALM_IE_SHIFT (2U) -/*! ALM_IE - Alarm Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_ALM_IE(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_ALM_IE_SHIFT)) & RTC_IER_ALM_IE_MASK) - -#define RTC_IER_DAY_IE_MASK (0x8U) -#define RTC_IER_DAY_IE_SHIFT (3U) -/*! DAY_IE - Days Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_DAY_IE(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_DAY_IE_SHIFT)) & RTC_IER_DAY_IE_MASK) - -#define RTC_IER_HOUR_IE_MASK (0x10U) -#define RTC_IER_HOUR_IE_SHIFT (4U) -/*! HOUR_IE - Hours Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_HOUR_IE(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_HOUR_IE_SHIFT)) & RTC_IER_HOUR_IE_MASK) - -#define RTC_IER_MIN_IE_MASK (0x20U) -#define RTC_IER_MIN_IE_SHIFT (5U) -/*! MIN_IE - Minutes Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_MIN_IE(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_MIN_IE_SHIFT)) & RTC_IER_MIN_IE_MASK) - -#define RTC_IER_IE_1HZ_MASK (0x40U) -#define RTC_IER_IE_1HZ_SHIFT (6U) -/*! IE_1HZ - 1 Hz Interval Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_IE_1HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_IE_1HZ_SHIFT)) & RTC_IER_IE_1HZ_MASK) - -#define RTC_IER_IE_2HZ_MASK (0x80U) -#define RTC_IER_IE_2HZ_SHIFT (7U) -/*! IE_2HZ - 2 Hz Interval Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_IE_2HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_IE_2HZ_SHIFT)) & RTC_IER_IE_2HZ_MASK) - -#define RTC_IER_IE_4HZ_MASK (0x100U) -#define RTC_IER_IE_4HZ_SHIFT (8U) -/*! IE_4HZ - 4 Hz Interval Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_IE_4HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_IE_4HZ_SHIFT)) & RTC_IER_IE_4HZ_MASK) - -#define RTC_IER_IE_8HZ_MASK (0x200U) -#define RTC_IER_IE_8HZ_SHIFT (9U) -/*! IE_8HZ - 8 Hz Interval Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_IE_8HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_IE_8HZ_SHIFT)) & RTC_IER_IE_8HZ_MASK) - -#define RTC_IER_IE_16HZ_MASK (0x400U) -#define RTC_IER_IE_16HZ_SHIFT (10U) -/*! IE_16HZ - 16 Hz Interval Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_IE_16HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_IE_16HZ_SHIFT)) & RTC_IER_IE_16HZ_MASK) - -#define RTC_IER_IE_32HZ_MASK (0x800U) -#define RTC_IER_IE_32HZ_SHIFT (11U) -/*! IE_32HZ - 32 Hz Interval Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_IE_32HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_IE_32HZ_SHIFT)) & RTC_IER_IE_32HZ_MASK) - -#define RTC_IER_IE_64HZ_MASK (0x1000U) -#define RTC_IER_IE_64HZ_SHIFT (12U) -/*! IE_64HZ - 64 Hz Interval Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_IE_64HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_IE_64HZ_SHIFT)) & RTC_IER_IE_64HZ_MASK) - -#define RTC_IER_IE_128HZ_MASK (0x2000U) -#define RTC_IER_IE_128HZ_SHIFT (13U) -/*! IE_128HZ - 128 Hz Interval Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_IE_128HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_IE_128HZ_SHIFT)) & RTC_IER_IE_128HZ_MASK) - -#define RTC_IER_IE_256HZ_MASK (0x4000U) -#define RTC_IER_IE_256HZ_SHIFT (14U) -/*! IE_256HZ - 256 Hz Interval Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_IE_256HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_IE_256HZ_SHIFT)) & RTC_IER_IE_256HZ_MASK) - -#define RTC_IER_IE_512HZ_MASK (0x8000U) -#define RTC_IER_IE_512HZ_SHIFT (15U) -/*! IE_512HZ - 512 Hz Interval Interrupt Enable - * 0b0..Interrupt is disabled. - * 0b1..Interrupt is enabled. - */ -#define RTC_IER_IE_512HZ(x) (((uint16_t)(((uint16_t)(x)) << RTC_IER_IE_512HZ_SHIFT)) & RTC_IER_IE_512HZ_MASK) -/*! @} */ - -/*! @name RTC_TEST2 - Sub Second Counter */ -/*! @{ */ - -#define RTC_RTC_TEST2_SUB_SECOND_COUNT_MASK (0xFFFFU) -#define RTC_RTC_TEST2_SUB_SECOND_COUNT_SHIFT (0U) -/*! SUB_SECOND_COUNT - Sub Second Counter Value */ -#define RTC_RTC_TEST2_SUB_SECOND_COUNT(x) (((uint16_t)(((uint16_t)(x)) << RTC_RTC_TEST2_SUB_SECOND_COUNT_SHIFT)) & RTC_RTC_TEST2_SUB_SECOND_COUNT_MASK) -/*! @} */ - -/*! @name DST_HOUR - Daylight Saving Hour */ -/*! @{ */ - -#define RTC_DST_HOUR_DST_END_HOUR_MASK (0x1FU) -#define RTC_DST_HOUR_DST_END_HOUR_SHIFT (0U) -/*! DST_END_HOUR - Daylight Saving Time (DST) Hours End Value */ -#define RTC_DST_HOUR_DST_END_HOUR(x) (((uint16_t)(((uint16_t)(x)) << RTC_DST_HOUR_DST_END_HOUR_SHIFT)) & RTC_DST_HOUR_DST_END_HOUR_MASK) - -#define RTC_DST_HOUR_DST_START_HOUR_MASK (0x1F00U) -#define RTC_DST_HOUR_DST_START_HOUR_SHIFT (8U) -/*! DST_START_HOUR - Daylight Saving Time (DST) Hours Start Value */ -#define RTC_DST_HOUR_DST_START_HOUR(x) (((uint16_t)(((uint16_t)(x)) << RTC_DST_HOUR_DST_START_HOUR_SHIFT)) & RTC_DST_HOUR_DST_START_HOUR_MASK) -/*! @} */ - -/*! @name DST_MONTH - Daylight Saving Month */ -/*! @{ */ - -#define RTC_DST_MONTH_DST_END_MONTH_MASK (0xFU) -#define RTC_DST_MONTH_DST_END_MONTH_SHIFT (0U) -/*! DST_END_MONTH - Daylight Saving Time (DST) Month End Value */ -#define RTC_DST_MONTH_DST_END_MONTH(x) (((uint16_t)(((uint16_t)(x)) << RTC_DST_MONTH_DST_END_MONTH_SHIFT)) & RTC_DST_MONTH_DST_END_MONTH_MASK) - -#define RTC_DST_MONTH_DST_START_MONTH_MASK (0xF00U) -#define RTC_DST_MONTH_DST_START_MONTH_SHIFT (8U) -/*! DST_START_MONTH - Daylight Saving Time (DST) Month Start Value */ -#define RTC_DST_MONTH_DST_START_MONTH(x) (((uint16_t)(((uint16_t)(x)) << RTC_DST_MONTH_DST_START_MONTH_SHIFT)) & RTC_DST_MONTH_DST_START_MONTH_MASK) -/*! @} */ - -/*! @name DST_DAY - Daylight Saving Day */ -/*! @{ */ - -#define RTC_DST_DAY_DST_END_DAY_MASK (0x1FU) -#define RTC_DST_DAY_DST_END_DAY_SHIFT (0U) -/*! DST_END_DAY - Daylight Saving Time (DST) Day End Value */ -#define RTC_DST_DAY_DST_END_DAY(x) (((uint16_t)(((uint16_t)(x)) << RTC_DST_DAY_DST_END_DAY_SHIFT)) & RTC_DST_DAY_DST_END_DAY_MASK) - -#define RTC_DST_DAY_DST_START_DAY_MASK (0x1F00U) -#define RTC_DST_DAY_DST_START_DAY_SHIFT (8U) -/*! DST_START_DAY - Daylight Saving Time (DST) Day Start Value */ -#define RTC_DST_DAY_DST_START_DAY(x) (((uint16_t)(((uint16_t)(x)) << RTC_DST_DAY_DST_START_DAY_SHIFT)) & RTC_DST_DAY_DST_START_DAY_MASK) -/*! @} */ - -/*! @name COMPEN - Compensation */ -/*! @{ */ - -#define RTC_COMPEN_COMPEN_VAL_MASK (0xFFFFU) -#define RTC_COMPEN_COMPEN_VAL_SHIFT (0U) -/*! COMPEN_VAL - Compensation Value */ -#define RTC_COMPEN_COMPEN_VAL(x) (((uint16_t)(((uint16_t)(x)) << RTC_COMPEN_COMPEN_VAL_SHIFT)) & RTC_COMPEN_COMPEN_VAL_MASK) -/*! @} */ - -/*! @name SUBSECOND_CTRL - Subsecond Control */ -/*! @{ */ - -#define RTC_SUBSECOND_CTRL_SUB_SECOND_CNT_EN_MASK (0x1U) -#define RTC_SUBSECOND_CTRL_SUB_SECOND_CNT_EN_SHIFT (0U) -/*! SUB_SECOND_CNT_EN - Subsecond Counter Enable - * 0b0..Disable - * 0b1..Enable - */ -#define RTC_SUBSECOND_CTRL_SUB_SECOND_CNT_EN(x) (((uint32_t)(((uint32_t)(x)) << RTC_SUBSECOND_CTRL_SUB_SECOND_CNT_EN_SHIFT)) & RTC_SUBSECOND_CTRL_SUB_SECOND_CNT_EN_MASK) -/*! @} */ - -/*! @name SUBSECOND_CNT - Subsecond Counter */ -/*! @{ */ - -#define RTC_SUBSECOND_CNT_SUBSECOND_CNT_MASK (0xFFFFU) -#define RTC_SUBSECOND_CNT_SUBSECOND_CNT_SHIFT (0U) -/*! SUBSECOND_CNT - Current Subsecond Counter Value */ -#define RTC_SUBSECOND_CNT_SUBSECOND_CNT(x) (((uint32_t)(((uint32_t)(x)) << RTC_SUBSECOND_CNT_SUBSECOND_CNT_SHIFT)) & RTC_SUBSECOND_CNT_SUBSECOND_CNT_MASK) -/*! @} */ - -/*! @name WAKE_TIMER_CTRL - Wake Timer Control */ -/*! @{ */ - -#define RTC_WAKE_TIMER_CTRL_WAKE_FLAG_MASK (0x2U) -#define RTC_WAKE_TIMER_CTRL_WAKE_FLAG_SHIFT (1U) -/*! WAKE_FLAG - Wake Timer Status Flag - * 0b0..Not timed out - * 0b1..Timed out - */ -#define RTC_WAKE_TIMER_CTRL_WAKE_FLAG(x) (((uint32_t)(((uint32_t)(x)) << RTC_WAKE_TIMER_CTRL_WAKE_FLAG_SHIFT)) & RTC_WAKE_TIMER_CTRL_WAKE_FLAG_MASK) - -#define RTC_WAKE_TIMER_CTRL_CLR_WAKE_TIMER_MASK (0x4U) -#define RTC_WAKE_TIMER_CTRL_CLR_WAKE_TIMER_SHIFT (2U) -/*! CLR_WAKE_TIMER - Clear Wake Timer - * 0b0..No effect - * 0b1..Clear the wake timer counter - */ -#define RTC_WAKE_TIMER_CTRL_CLR_WAKE_TIMER(x) (((uint32_t)(((uint32_t)(x)) << RTC_WAKE_TIMER_CTRL_CLR_WAKE_TIMER_SHIFT)) & RTC_WAKE_TIMER_CTRL_CLR_WAKE_TIMER_MASK) - -#define RTC_WAKE_TIMER_CTRL_OSC_DIV_ENA_MASK (0x10U) -#define RTC_WAKE_TIMER_CTRL_OSC_DIV_ENA_SHIFT (4U) -/*! OSC_DIV_ENA - OSC Divide Enable - * 0b0..Disable - * 0b1..Enable - */ -#define RTC_WAKE_TIMER_CTRL_OSC_DIV_ENA(x) (((uint32_t)(((uint32_t)(x)) << RTC_WAKE_TIMER_CTRL_OSC_DIV_ENA_SHIFT)) & RTC_WAKE_TIMER_CTRL_OSC_DIV_ENA_MASK) - -#define RTC_WAKE_TIMER_CTRL_INTR_EN_MASK (0x20U) -#define RTC_WAKE_TIMER_CTRL_INTR_EN_SHIFT (5U) -/*! INTR_EN - Enable Interrupt - * 0b0..Disable - * 0b1..Enable - */ -#define RTC_WAKE_TIMER_CTRL_INTR_EN(x) (((uint32_t)(((uint32_t)(x)) << RTC_WAKE_TIMER_CTRL_INTR_EN_SHIFT)) & RTC_WAKE_TIMER_CTRL_INTR_EN_MASK) -/*! @} */ - -/*! @name WAKE_TIMER_CNT - Wake Timer Counter */ -/*! @{ */ - -#define RTC_WAKE_TIMER_CNT_WAKE_CNT_MASK (0xFFFFFFFFU) -#define RTC_WAKE_TIMER_CNT_WAKE_CNT_SHIFT (0U) -/*! WAKE_CNT - Wake Counter */ -#define RTC_WAKE_TIMER_CNT_WAKE_CNT(x) (((uint32_t)(((uint32_t)(x)) << RTC_WAKE_TIMER_CNT_WAKE_CNT_SHIFT)) & RTC_WAKE_TIMER_CNT_WAKE_CNT_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group RTC_Register_Masks */ - - -/* RTC - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral RTC0 base address */ - #define RTC0_BASE (0x5004C000u) - /** Peripheral RTC0 base address */ - #define RTC0_BASE_NS (0x4004C000u) - /** Peripheral RTC0 base pointer */ - #define RTC0 ((RTC_Type *)RTC0_BASE) - /** Peripheral RTC0 base pointer */ - #define RTC0_NS ((RTC_Type *)RTC0_BASE_NS) - /** Array initializer of RTC peripheral base addresses */ - #define RTC_BASE_ADDRS { RTC0_BASE } - /** Array initializer of RTC peripheral base pointers */ - #define RTC_BASE_PTRS { RTC0 } - /** Array initializer of RTC peripheral base addresses */ - #define RTC_BASE_ADDRS_NS { RTC0_BASE_NS } - /** Array initializer of RTC peripheral base pointers */ - #define RTC_BASE_PTRS_NS { RTC0_NS } -#else - /** Peripheral RTC0 base address */ - #define RTC0_BASE (0x4004C000u) - /** Peripheral RTC0 base pointer */ - #define RTC0 ((RTC_Type *)RTC0_BASE) - /** Array initializer of RTC peripheral base addresses */ - #define RTC_BASE_ADDRS { RTC0_BASE } - /** Array initializer of RTC peripheral base pointers */ - #define RTC_BASE_PTRS { RTC0 } -#endif -/** Interrupt vectors for the RTC peripheral type */ -#define RTC_IRQS { RTC_IRQn } -/* Backward compatibility for RTC */ -#define RTC RTC0 - - -/*! - * @} - */ /* end of group RTC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- S50 Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup S50_Peripheral_Access_Layer S50 Peripheral Access Layer - * @{ - */ - -/** S50 - Register Layout Typedef */ -typedef struct { - __I uint32_t ELS_STATUS; /**< Status Register, offset: 0x0 */ - __IO uint32_t ELS_CTRL; /**< Control Register, offset: 0x4 */ - __IO uint32_t ELS_CMDCFG0; /**< Command Configuration, offset: 0x8 */ - __IO uint32_t ELS_CFG; /**< Configuration Register, offset: 0xC */ - __IO uint32_t ELS_KIDX0; /**< Keystore Index 0, offset: 0x10 */ - __IO uint32_t ELS_KIDX1; /**< Keystore Index 1, offset: 0x14 */ - __IO uint32_t ELS_KPROPIN; /**< Key Properties Request, offset: 0x18 */ - uint8_t RESERVED_0[4]; - __IO uint32_t ELS_DMA_SRC0; /**< DMA Source 0, offset: 0x20 */ - __IO uint32_t ELS_DMA_SRC0_LEN; /**< DMA Source 0 Length, offset: 0x24 */ - __IO uint32_t ELS_DMA_SRC1; /**< DMA Source 1, offset: 0x28 */ - uint8_t RESERVED_1[4]; - __IO uint32_t ELS_DMA_SRC2; /**< DMA Source 2, offset: 0x30 */ - __IO uint32_t ELS_DMA_SRC2_LEN; /**< DMA Source 2 Length, offset: 0x34 */ - __IO uint32_t ELS_DMA_RES0; /**< DMA Result 0, offset: 0x38 */ - __IO uint32_t ELS_DMA_RES0_LEN; /**< DMA Result 0 Length, offset: 0x3C */ - __IO uint32_t ELS_INT_ENABLE; /**< Interrupt Enable, offset: 0x40 */ - __O uint32_t ELS_INT_STATUS_CLR; /**< Interrupt Status Clear, offset: 0x44 */ - __O uint32_t ELS_INT_STATUS_SET; /**< Interrupt Status Set, offset: 0x48 */ - __I uint32_t ELS_ERR_STATUS; /**< Error Status, offset: 0x4C */ - __O uint32_t ELS_ERR_STATUS_CLR; /**< Error Status Clear, offset: 0x50 */ - __I uint32_t ELS_VERSION; /**< Version Register, offset: 0x54 */ - uint8_t RESERVED_2[4]; - __I uint32_t ELS_PRNG_DATOUT; /**< PRNG SW Read Out, offset: 0x5C */ - __IO uint32_t ELS_CMDCRC_CTRL; /**< CRC Configuration, offset: 0x60 */ - __I uint32_t ELS_CMDCRC; /**< Command CRC Value, offset: 0x64 */ - __IO uint32_t ELS_SESSION_ID; /**< Session ID, offset: 0x68 */ - uint8_t RESERVED_3[4]; - __I uint32_t ELS_DMA_FIN_ADDR; /**< Final DMA Address, offset: 0x70 */ - __IO uint32_t ELS_MASTER_ID; /**< Master ID, offset: 0x74 */ - __IO uint32_t ELS_KIDX2; /**< Keystore Index 2, offset: 0x78 */ - uint8_t RESERVED_4[212]; - __I uint32_t ELS_KS0; /**< Status Register, offset: 0x150 */ - __I uint32_t ELS_KS1; /**< Status Register, offset: 0x154 */ - __I uint32_t ELS_KS2; /**< Status Register, offset: 0x158 */ - __I uint32_t ELS_KS3; /**< Status Register, offset: 0x15C */ - __I uint32_t ELS_KS4; /**< Status Register, offset: 0x160 */ - __I uint32_t ELS_KS5; /**< Status Register, offset: 0x164 */ - __I uint32_t ELS_KS6; /**< Status Register, offset: 0x168 */ - __I uint32_t ELS_KS7; /**< Status Register, offset: 0x16C */ - __I uint32_t ELS_KS8; /**< Status Register, offset: 0x170 */ - __I uint32_t ELS_KS9; /**< Status Register, offset: 0x174 */ - __I uint32_t ELS_KS10; /**< Status Register, offset: 0x178 */ - __I uint32_t ELS_KS11; /**< Status Register, offset: 0x17C */ - __I uint32_t ELS_KS12; /**< Status Register, offset: 0x180 */ - __I uint32_t ELS_KS13; /**< Status Register, offset: 0x184 */ - __I uint32_t ELS_KS14; /**< Status Register, offset: 0x188 */ - __I uint32_t ELS_KS15; /**< Status Register, offset: 0x18C */ - __I uint32_t ELS_KS16; /**< Status Register, offset: 0x190 */ - __I uint32_t ELS_KS17; /**< Status Register, offset: 0x194 */ - __I uint32_t ELS_KS18; /**< Status Register, offset: 0x198 */ - __I uint32_t ELS_KS19; /**< Status Register, offset: 0x19C */ -} S50_Type; - -/* ---------------------------------------------------------------------------- - -- S50 Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup S50_Register_Masks S50 Register Masks - * @{ - */ - -/*! @name ELS_STATUS - Status Register */ -/*! @{ */ - -#define S50_ELS_STATUS_ELS_BUSY_MASK (0x1U) -#define S50_ELS_STATUS_ELS_BUSY_SHIFT (0U) -/*! ELS_BUSY - * 0b1..Crypto sequence executing - * 0b0..Crypto sequence not executing - */ -#define S50_ELS_STATUS_ELS_BUSY(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_STATUS_ELS_BUSY_SHIFT)) & S50_ELS_STATUS_ELS_BUSY_MASK) - -#define S50_ELS_STATUS_ELS_IRQ_MASK (0x2U) -#define S50_ELS_STATUS_ELS_IRQ_SHIFT (1U) -/*! ELS_IRQ - * 0b1..Active interrupt - * 0b0..No active interrupt - */ -#define S50_ELS_STATUS_ELS_IRQ(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_STATUS_ELS_IRQ_SHIFT)) & S50_ELS_STATUS_ELS_IRQ_MASK) - -#define S50_ELS_STATUS_ELS_ERR_MASK (0x4U) -#define S50_ELS_STATUS_ELS_ERR_SHIFT (2U) -/*! ELS_ERR - * 0b1..Internal error detected - * 0b0..Internal error not detected - */ -#define S50_ELS_STATUS_ELS_ERR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_STATUS_ELS_ERR_SHIFT)) & S50_ELS_STATUS_ELS_ERR_MASK) - -#define S50_ELS_STATUS_PRNG_RDY_MASK (0x8U) -#define S50_ELS_STATUS_PRNG_RDY_SHIFT (3U) -/*! PRNG_RDY - * 0b0..Internal PRNG not ready - * 0b1..Internal PRNG ready - */ -#define S50_ELS_STATUS_PRNG_RDY(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_STATUS_PRNG_RDY_SHIFT)) & S50_ELS_STATUS_PRNG_RDY_MASK) - -#define S50_ELS_STATUS_ECDSA_VFY_STATUS_MASK (0x30U) -#define S50_ELS_STATUS_ECDSA_VFY_STATUS_SHIFT (4U) -/*! ECDSA_VFY_STATUS - * 0b11..Invalid, Error - * 0b00..No verify run - * 0b01..Signature verify failed - * 0b10..Signature verify passed - */ -#define S50_ELS_STATUS_ECDSA_VFY_STATUS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_STATUS_ECDSA_VFY_STATUS_SHIFT)) & S50_ELS_STATUS_ECDSA_VFY_STATUS_MASK) - -#define S50_ELS_STATUS_PPROT_MASK (0xC0U) -#define S50_ELS_STATUS_PPROT_SHIFT (6U) -/*! PPROT - * 0b10..Non-secure, non-privileged - * 0b11..Non-secure, privileged - * 0b00..Secure, non-privileged - * 0b01..Secure, privileged - */ -#define S50_ELS_STATUS_PPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_STATUS_PPROT_SHIFT)) & S50_ELS_STATUS_PPROT_MASK) - -#define S50_ELS_STATUS_DRBG_ENT_LVL_MASK (0x300U) -#define S50_ELS_STATUS_DRBG_ENT_LVL_SHIFT (8U) -/*! DRBG_ENT_LVL - * 0b10..HIGH, DRBG generates random numbers of high quality entropy - * 0b01..LOW, DRBG generates random numbers of low quality entropy - * 0b00..NONE - * 0b11..RFU, Reserved for Future Use - */ -#define S50_ELS_STATUS_DRBG_ENT_LVL(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_STATUS_DRBG_ENT_LVL_SHIFT)) & S50_ELS_STATUS_DRBG_ENT_LVL_MASK) - -#define S50_ELS_STATUS_DTRNG_BUSY_MASK (0x400U) -#define S50_ELS_STATUS_DTRNG_BUSY_SHIFT (10U) -/*! DTRNG_BUSY - * 0b1..Gathering entropy - * 0b0..Not gathering entropy - */ -#define S50_ELS_STATUS_DTRNG_BUSY(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_STATUS_DTRNG_BUSY_SHIFT)) & S50_ELS_STATUS_DTRNG_BUSY_MASK) - -#define S50_ELS_STATUS_ELS_LOCKED_MASK (0x10000U) -#define S50_ELS_STATUS_ELS_LOCKED_SHIFT (16U) -/*! ELS_LOCKED - * 0b1..Locked by master - * 0b0..Not locked by master - */ -#define S50_ELS_STATUS_ELS_LOCKED(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_STATUS_ELS_LOCKED_SHIFT)) & S50_ELS_STATUS_ELS_LOCKED_MASK) -/*! @} */ - -/*! @name ELS_CTRL - Control Register */ -/*! @{ */ - -#define S50_ELS_CTRL_ELS_EN_MASK (0x1U) -#define S50_ELS_CTRL_ELS_EN_SHIFT (0U) -/*! ELS_EN - * 0b0..Disabled - * 0b1..Enabled - */ -#define S50_ELS_CTRL_ELS_EN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_CTRL_ELS_EN_SHIFT)) & S50_ELS_CTRL_ELS_EN_MASK) - -#define S50_ELS_CTRL_ELS_START_MASK (0x2U) -#define S50_ELS_CTRL_ELS_START_SHIFT (1U) -#define S50_ELS_CTRL_ELS_START(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_CTRL_ELS_START_SHIFT)) & S50_ELS_CTRL_ELS_START_MASK) - -#define S50_ELS_CTRL_ELS_RESET_MASK (0x4U) -#define S50_ELS_CTRL_ELS_RESET_SHIFT (2U) -#define S50_ELS_CTRL_ELS_RESET(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_CTRL_ELS_RESET_SHIFT)) & S50_ELS_CTRL_ELS_RESET_MASK) - -#define S50_ELS_CTRL_ELS_CMD_MASK (0xF8U) -#define S50_ELS_CTRL_ELS_CMD_SHIFT (3U) -/*! ELS_CMD - ELS Command ID */ -#define S50_ELS_CTRL_ELS_CMD(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_CTRL_ELS_CMD_SHIFT)) & S50_ELS_CTRL_ELS_CMD_MASK) - -#define S50_ELS_CTRL_BYTE_ORDER_MASK (0x100U) -#define S50_ELS_CTRL_BYTE_ORDER_SHIFT (8U) -/*! BYTE_ORDER - * 0b1..Big endian - * 0b0..Little endian - */ -#define S50_ELS_CTRL_BYTE_ORDER(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_CTRL_BYTE_ORDER_SHIFT)) & S50_ELS_CTRL_BYTE_ORDER_MASK) -/*! @} */ - -/*! @name ELS_CMDCFG0 - Command Configuration */ -/*! @{ */ - -#define S50_ELS_CMDCFG0_CMDCFG0_MASK (0xFFFFFFFFU) -#define S50_ELS_CMDCFG0_CMDCFG0_SHIFT (0U) -#define S50_ELS_CMDCFG0_CMDCFG0(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_CMDCFG0_CMDCFG0_SHIFT)) & S50_ELS_CMDCFG0_CMDCFG0_MASK) -/*! @} */ - -/*! @name ELS_CFG - Configuration Register */ -/*! @{ */ - -#define S50_ELS_CFG_ADCTRL_MASK (0x3FF0000U) -#define S50_ELS_CFG_ADCTRL_SHIFT (16U) -#define S50_ELS_CFG_ADCTRL(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_CFG_ADCTRL_SHIFT)) & S50_ELS_CFG_ADCTRL_MASK) -/*! @} */ - -/*! @name ELS_KIDX0 - Keystore Index 0 */ -/*! @{ */ - -#define S50_ELS_KIDX0_KIDX0_MASK (0x1FU) -#define S50_ELS_KIDX0_KIDX0_SHIFT (0U) -#define S50_ELS_KIDX0_KIDX0(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KIDX0_KIDX0_SHIFT)) & S50_ELS_KIDX0_KIDX0_MASK) -/*! @} */ - -/*! @name ELS_KIDX1 - Keystore Index 1 */ -/*! @{ */ - -#define S50_ELS_KIDX1_KIDX1_MASK (0x1FU) -#define S50_ELS_KIDX1_KIDX1_SHIFT (0U) -#define S50_ELS_KIDX1_KIDX1(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KIDX1_KIDX1_SHIFT)) & S50_ELS_KIDX1_KIDX1_MASK) -/*! @} */ - -/*! @name ELS_KPROPIN - Key Properties Request */ -/*! @{ */ - -#define S50_ELS_KPROPIN_KPROPIN_MASK (0xFFFFFFFFU) -#define S50_ELS_KPROPIN_KPROPIN_SHIFT (0U) -#define S50_ELS_KPROPIN_KPROPIN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KPROPIN_KPROPIN_SHIFT)) & S50_ELS_KPROPIN_KPROPIN_MASK) -/*! @} */ - -/*! @name ELS_DMA_SRC0 - DMA Source 0 */ -/*! @{ */ - -#define S50_ELS_DMA_SRC0_ADDR_SRC0_MASK (0xFFFFFFFFU) -#define S50_ELS_DMA_SRC0_ADDR_SRC0_SHIFT (0U) -#define S50_ELS_DMA_SRC0_ADDR_SRC0(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_DMA_SRC0_ADDR_SRC0_SHIFT)) & S50_ELS_DMA_SRC0_ADDR_SRC0_MASK) -/*! @} */ - -/*! @name ELS_DMA_SRC0_LEN - DMA Source 0 Length */ -/*! @{ */ - -#define S50_ELS_DMA_SRC0_LEN_SIZE_SRC0_LEN_MASK (0xFFFFFFFFU) -#define S50_ELS_DMA_SRC0_LEN_SIZE_SRC0_LEN_SHIFT (0U) -#define S50_ELS_DMA_SRC0_LEN_SIZE_SRC0_LEN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_DMA_SRC0_LEN_SIZE_SRC0_LEN_SHIFT)) & S50_ELS_DMA_SRC0_LEN_SIZE_SRC0_LEN_MASK) -/*! @} */ - -/*! @name ELS_DMA_SRC1 - DMA Source 1 */ -/*! @{ */ - -#define S50_ELS_DMA_SRC1_ADDR_SRC1_MASK (0xFFFFFFFFU) -#define S50_ELS_DMA_SRC1_ADDR_SRC1_SHIFT (0U) -#define S50_ELS_DMA_SRC1_ADDR_SRC1(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_DMA_SRC1_ADDR_SRC1_SHIFT)) & S50_ELS_DMA_SRC1_ADDR_SRC1_MASK) -/*! @} */ - -/*! @name ELS_DMA_SRC2 - DMA Source 2 */ -/*! @{ */ - -#define S50_ELS_DMA_SRC2_ADDR_SRC2_MASK (0xFFFFFFFFU) -#define S50_ELS_DMA_SRC2_ADDR_SRC2_SHIFT (0U) -#define S50_ELS_DMA_SRC2_ADDR_SRC2(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_DMA_SRC2_ADDR_SRC2_SHIFT)) & S50_ELS_DMA_SRC2_ADDR_SRC2_MASK) -/*! @} */ - -/*! @name ELS_DMA_SRC2_LEN - DMA Source 2 Length */ -/*! @{ */ - -#define S50_ELS_DMA_SRC2_LEN_SIZE_SRC2_LEN_MASK (0xFFFFFFFFU) -#define S50_ELS_DMA_SRC2_LEN_SIZE_SRC2_LEN_SHIFT (0U) -#define S50_ELS_DMA_SRC2_LEN_SIZE_SRC2_LEN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_DMA_SRC2_LEN_SIZE_SRC2_LEN_SHIFT)) & S50_ELS_DMA_SRC2_LEN_SIZE_SRC2_LEN_MASK) -/*! @} */ - -/*! @name ELS_DMA_RES0 - DMA Result 0 */ -/*! @{ */ - -#define S50_ELS_DMA_RES0_ADDR_RES0_MASK (0xFFFFFFFFU) -#define S50_ELS_DMA_RES0_ADDR_RES0_SHIFT (0U) -#define S50_ELS_DMA_RES0_ADDR_RES0(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_DMA_RES0_ADDR_RES0_SHIFT)) & S50_ELS_DMA_RES0_ADDR_RES0_MASK) -/*! @} */ - -/*! @name ELS_DMA_RES0_LEN - DMA Result 0 Length */ -/*! @{ */ - -#define S50_ELS_DMA_RES0_LEN_SIZE_RES0_LEN_MASK (0xFFFFFFFFU) -#define S50_ELS_DMA_RES0_LEN_SIZE_RES0_LEN_SHIFT (0U) -#define S50_ELS_DMA_RES0_LEN_SIZE_RES0_LEN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_DMA_RES0_LEN_SIZE_RES0_LEN_SHIFT)) & S50_ELS_DMA_RES0_LEN_SIZE_RES0_LEN_MASK) -/*! @} */ - -/*! @name ELS_INT_ENABLE - Interrupt Enable */ -/*! @{ */ - -#define S50_ELS_INT_ENABLE_INT_EN_MASK (0x1U) -#define S50_ELS_INT_ENABLE_INT_EN_SHIFT (0U) -/*! INT_EN - * 0b0..Disables - * 0b1..Enables - */ -#define S50_ELS_INT_ENABLE_INT_EN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_INT_ENABLE_INT_EN_SHIFT)) & S50_ELS_INT_ENABLE_INT_EN_MASK) -/*! @} */ - -/*! @name ELS_INT_STATUS_CLR - Interrupt Status Clear */ -/*! @{ */ - -#define S50_ELS_INT_STATUS_CLR_INT_CLR_MASK (0x1U) -#define S50_ELS_INT_STATUS_CLR_INT_CLR_SHIFT (0U) -#define S50_ELS_INT_STATUS_CLR_INT_CLR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_INT_STATUS_CLR_INT_CLR_SHIFT)) & S50_ELS_INT_STATUS_CLR_INT_CLR_MASK) -/*! @} */ - -/*! @name ELS_INT_STATUS_SET - Interrupt Status Set */ -/*! @{ */ - -#define S50_ELS_INT_STATUS_SET_INT_SET_MASK (0x1U) -#define S50_ELS_INT_STATUS_SET_INT_SET_SHIFT (0U) -#define S50_ELS_INT_STATUS_SET_INT_SET(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_INT_STATUS_SET_INT_SET_SHIFT)) & S50_ELS_INT_STATUS_SET_INT_SET_MASK) -/*! @} */ - -/*! @name ELS_ERR_STATUS - Error Status */ -/*! @{ */ - -#define S50_ELS_ERR_STATUS_BUS_ERR_MASK (0x1U) -#define S50_ELS_ERR_STATUS_BUS_ERR_SHIFT (0U) -/*! BUS_ERR - * 0b0..No error - * 0b1..Error occurred - */ -#define S50_ELS_ERR_STATUS_BUS_ERR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_ERR_STATUS_BUS_ERR_SHIFT)) & S50_ELS_ERR_STATUS_BUS_ERR_MASK) - -#define S50_ELS_ERR_STATUS_OPN_ERR_MASK (0x2U) -#define S50_ELS_ERR_STATUS_OPN_ERR_SHIFT (1U) -/*! OPN_ERR - * 0b0..No error - * 0b1..Error occurred - */ -#define S50_ELS_ERR_STATUS_OPN_ERR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_ERR_STATUS_OPN_ERR_SHIFT)) & S50_ELS_ERR_STATUS_OPN_ERR_MASK) - -#define S50_ELS_ERR_STATUS_ALG_ERR_MASK (0x4U) -#define S50_ELS_ERR_STATUS_ALG_ERR_SHIFT (2U) -/*! ALG_ERR - * 0b0..No error - * 0b1..Error occurred - */ -#define S50_ELS_ERR_STATUS_ALG_ERR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_ERR_STATUS_ALG_ERR_SHIFT)) & S50_ELS_ERR_STATUS_ALG_ERR_MASK) - -#define S50_ELS_ERR_STATUS_ITG_ERR_MASK (0x8U) -#define S50_ELS_ERR_STATUS_ITG_ERR_SHIFT (3U) -/*! ITG_ERR - * 0b0..No error - * 0b1..Error occurred - */ -#define S50_ELS_ERR_STATUS_ITG_ERR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_ERR_STATUS_ITG_ERR_SHIFT)) & S50_ELS_ERR_STATUS_ITG_ERR_MASK) - -#define S50_ELS_ERR_STATUS_FLT_ERR_MASK (0x10U) -#define S50_ELS_ERR_STATUS_FLT_ERR_SHIFT (4U) -/*! FLT_ERR - * 0b0..No error - * 0b1..Error occurred - */ -#define S50_ELS_ERR_STATUS_FLT_ERR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_ERR_STATUS_FLT_ERR_SHIFT)) & S50_ELS_ERR_STATUS_FLT_ERR_MASK) - -#define S50_ELS_ERR_STATUS_PRNG_ERR_MASK (0x20U) -#define S50_ELS_ERR_STATUS_PRNG_ERR_SHIFT (5U) -/*! PRNG_ERR - * 0b0..No error - * 0b1..Error occurred - */ -#define S50_ELS_ERR_STATUS_PRNG_ERR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_ERR_STATUS_PRNG_ERR_SHIFT)) & S50_ELS_ERR_STATUS_PRNG_ERR_MASK) - -#define S50_ELS_ERR_STATUS_ERR_LVL_MASK (0xC0U) -#define S50_ELS_ERR_STATUS_ERR_LVL_SHIFT (6U) -#define S50_ELS_ERR_STATUS_ERR_LVL(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_ERR_STATUS_ERR_LVL_SHIFT)) & S50_ELS_ERR_STATUS_ERR_LVL_MASK) - -#define S50_ELS_ERR_STATUS_DTRNG_ERR_MASK (0x100U) -#define S50_ELS_ERR_STATUS_DTRNG_ERR_SHIFT (8U) -/*! DTRNG_ERR - * 0b0..No error - * 0b1..TRNG error occurred - */ -#define S50_ELS_ERR_STATUS_DTRNG_ERR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_ERR_STATUS_DTRNG_ERR_SHIFT)) & S50_ELS_ERR_STATUS_DTRNG_ERR_MASK) -/*! @} */ - -/*! @name ELS_ERR_STATUS_CLR - Error Status Clear */ -/*! @{ */ - -#define S50_ELS_ERR_STATUS_CLR_ERR_CLR_MASK (0x1U) -#define S50_ELS_ERR_STATUS_CLR_ERR_CLR_SHIFT (0U) -/*! ERR_CLR - * 0b1..Clears ELS error state - * 0b0..Exits ELS error state - */ -#define S50_ELS_ERR_STATUS_CLR_ERR_CLR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_ERR_STATUS_CLR_ERR_CLR_SHIFT)) & S50_ELS_ERR_STATUS_CLR_ERR_CLR_MASK) -/*! @} */ - -/*! @name ELS_VERSION - Version Register */ -/*! @{ */ - -#define S50_ELS_VERSION_Z_MASK (0xFU) -#define S50_ELS_VERSION_Z_SHIFT (0U) -#define S50_ELS_VERSION_Z(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_VERSION_Z_SHIFT)) & S50_ELS_VERSION_Z_MASK) - -#define S50_ELS_VERSION_Y2_MASK (0xF0U) -#define S50_ELS_VERSION_Y2_SHIFT (4U) -#define S50_ELS_VERSION_Y2(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_VERSION_Y2_SHIFT)) & S50_ELS_VERSION_Y2_MASK) - -#define S50_ELS_VERSION_Y1_MASK (0xF00U) -#define S50_ELS_VERSION_Y1_SHIFT (8U) -#define S50_ELS_VERSION_Y1(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_VERSION_Y1_SHIFT)) & S50_ELS_VERSION_Y1_MASK) - -#define S50_ELS_VERSION_X_MASK (0xF000U) -#define S50_ELS_VERSION_X_SHIFT (12U) -#define S50_ELS_VERSION_X(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_VERSION_X_SHIFT)) & S50_ELS_VERSION_X_MASK) - -#define S50_ELS_VERSION_SW_Z_MASK (0xF0000U) -#define S50_ELS_VERSION_SW_Z_SHIFT (16U) -#define S50_ELS_VERSION_SW_Z(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_VERSION_SW_Z_SHIFT)) & S50_ELS_VERSION_SW_Z_MASK) - -#define S50_ELS_VERSION_SW_Y2_MASK (0xF00000U) -#define S50_ELS_VERSION_SW_Y2_SHIFT (20U) -#define S50_ELS_VERSION_SW_Y2(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_VERSION_SW_Y2_SHIFT)) & S50_ELS_VERSION_SW_Y2_MASK) - -#define S50_ELS_VERSION_SW_Y1_MASK (0xF000000U) -#define S50_ELS_VERSION_SW_Y1_SHIFT (24U) -#define S50_ELS_VERSION_SW_Y1(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_VERSION_SW_Y1_SHIFT)) & S50_ELS_VERSION_SW_Y1_MASK) - -#define S50_ELS_VERSION_SW_X_MASK (0xF0000000U) -#define S50_ELS_VERSION_SW_X_SHIFT (28U) -#define S50_ELS_VERSION_SW_X(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_VERSION_SW_X_SHIFT)) & S50_ELS_VERSION_SW_X_MASK) -/*! @} */ - -/*! @name ELS_PRNG_DATOUT - PRNG SW Read Out */ -/*! @{ */ - -#define S50_ELS_PRNG_DATOUT_PRNG_DATOUT_MASK (0xFFFFFFFFU) -#define S50_ELS_PRNG_DATOUT_PRNG_DATOUT_SHIFT (0U) -#define S50_ELS_PRNG_DATOUT_PRNG_DATOUT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_PRNG_DATOUT_PRNG_DATOUT_SHIFT)) & S50_ELS_PRNG_DATOUT_PRNG_DATOUT_MASK) -/*! @} */ - -/*! @name ELS_CMDCRC_CTRL - CRC Configuration */ -/*! @{ */ - -#define S50_ELS_CMDCRC_CTRL_CMDCRC_RST_MASK (0x1U) -#define S50_ELS_CMDCRC_CTRL_CMDCRC_RST_SHIFT (0U) -/*! CMDCRC_RST - * 0b1..Resets the CRC command to its default value - * 0b0..No effect - */ -#define S50_ELS_CMDCRC_CTRL_CMDCRC_RST(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_CMDCRC_CTRL_CMDCRC_RST_SHIFT)) & S50_ELS_CMDCRC_CTRL_CMDCRC_RST_MASK) - -#define S50_ELS_CMDCRC_CTRL_CMDCRC_EN_MASK (0x2U) -#define S50_ELS_CMDCRC_CTRL_CMDCRC_EN_SHIFT (1U) -/*! CMDCRC_EN - * 0b1..Enables the CRC command. The CRC command will be updated on completion of each ELS command. - * 0b0..Disables the CRC command CRC. The CRC command will not be updated on completion of each ELS command. - */ -#define S50_ELS_CMDCRC_CTRL_CMDCRC_EN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_CMDCRC_CTRL_CMDCRC_EN_SHIFT)) & S50_ELS_CMDCRC_CTRL_CMDCRC_EN_MASK) -/*! @} */ - -/*! @name ELS_CMDCRC - Command CRC Value */ -/*! @{ */ - -#define S50_ELS_CMDCRC_CMDCRC_MASK (0xFFFFFFFFU) -#define S50_ELS_CMDCRC_CMDCRC_SHIFT (0U) -#define S50_ELS_CMDCRC_CMDCRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_CMDCRC_CMDCRC_SHIFT)) & S50_ELS_CMDCRC_CMDCRC_MASK) -/*! @} */ - -/*! @name ELS_SESSION_ID - Session ID */ -/*! @{ */ - -#define S50_ELS_SESSION_ID_SESSION_ID_MASK (0xFFFFFFFFU) -#define S50_ELS_SESSION_ID_SESSION_ID_SHIFT (0U) -#define S50_ELS_SESSION_ID_SESSION_ID(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_SESSION_ID_SESSION_ID_SHIFT)) & S50_ELS_SESSION_ID_SESSION_ID_MASK) -/*! @} */ - -/*! @name ELS_DMA_FIN_ADDR - Final DMA Address */ -/*! @{ */ - -#define S50_ELS_DMA_FIN_ADDR_DMA_FIN_ADDR_MASK (0xFFFFFFFFU) -#define S50_ELS_DMA_FIN_ADDR_DMA_FIN_ADDR_SHIFT (0U) -#define S50_ELS_DMA_FIN_ADDR_DMA_FIN_ADDR(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_DMA_FIN_ADDR_DMA_FIN_ADDR_SHIFT)) & S50_ELS_DMA_FIN_ADDR_DMA_FIN_ADDR_MASK) -/*! @} */ - -/*! @name ELS_MASTER_ID - Master ID */ -/*! @{ */ - -#define S50_ELS_MASTER_ID_MASTER_ID_MASK (0x1FU) -#define S50_ELS_MASTER_ID_MASTER_ID_SHIFT (0U) -#define S50_ELS_MASTER_ID_MASTER_ID(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_MASTER_ID_MASTER_ID_SHIFT)) & S50_ELS_MASTER_ID_MASTER_ID_MASK) -/*! @} */ - -/*! @name ELS_KIDX2 - Keystore Index 2 */ -/*! @{ */ - -#define S50_ELS_KIDX2_KIDX2_MASK (0x1FU) -#define S50_ELS_KIDX2_KIDX2_SHIFT (0U) -#define S50_ELS_KIDX2_KIDX2(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KIDX2_KIDX2_SHIFT)) & S50_ELS_KIDX2_KIDX2_MASK) -/*! @} */ - -/*! @name ELS_KS0 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS0_KS0_KSIZE_MASK (0x3U) -#define S50_ELS_KS0_KS0_KSIZE_SHIFT (0U) -/*! KS0_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS0_KS0_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_KSIZE_SHIFT)) & S50_ELS_KS0_KS0_KSIZE_MASK) - -#define S50_ELS_KS0_KS0_KACT_MASK (0x20U) -#define S50_ELS_KS0_KS0_KACT_SHIFT (5U) -#define S50_ELS_KS0_KS0_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_KACT_SHIFT)) & S50_ELS_KS0_KS0_KACT_MASK) - -#define S50_ELS_KS0_KS0_KBASE_MASK (0x40U) -#define S50_ELS_KS0_KS0_KBASE_SHIFT (6U) -#define S50_ELS_KS0_KS0_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_KBASE_SHIFT)) & S50_ELS_KS0_KS0_KBASE_MASK) - -#define S50_ELS_KS0_KS0_FGP_MASK (0x80U) -#define S50_ELS_KS0_KS0_FGP_SHIFT (7U) -#define S50_ELS_KS0_KS0_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_FGP_SHIFT)) & S50_ELS_KS0_KS0_FGP_MASK) - -#define S50_ELS_KS0_KS0_FRTN_MASK (0x100U) -#define S50_ELS_KS0_KS0_FRTN_SHIFT (8U) -#define S50_ELS_KS0_KS0_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_FRTN_SHIFT)) & S50_ELS_KS0_KS0_FRTN_MASK) - -#define S50_ELS_KS0_KS0_FHWO_MASK (0x200U) -#define S50_ELS_KS0_KS0_FHWO_SHIFT (9U) -#define S50_ELS_KS0_KS0_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_FHWO_SHIFT)) & S50_ELS_KS0_KS0_FHWO_MASK) - -#define S50_ELS_KS0_KS0_UKPUK_MASK (0x800U) -#define S50_ELS_KS0_KS0_UKPUK_SHIFT (11U) -#define S50_ELS_KS0_KS0_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UKPUK_SHIFT)) & S50_ELS_KS0_KS0_UKPUK_MASK) - -#define S50_ELS_KS0_KS0_UTECDH_MASK (0x1000U) -#define S50_ELS_KS0_KS0_UTECDH_SHIFT (12U) -#define S50_ELS_KS0_KS0_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UTECDH_SHIFT)) & S50_ELS_KS0_KS0_UTECDH_MASK) - -#define S50_ELS_KS0_KS0_UCMAC_MASK (0x2000U) -#define S50_ELS_KS0_KS0_UCMAC_SHIFT (13U) -#define S50_ELS_KS0_KS0_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UCMAC_SHIFT)) & S50_ELS_KS0_KS0_UCMAC_MASK) - -#define S50_ELS_KS0_KS0_UKSK_MASK (0x4000U) -#define S50_ELS_KS0_KS0_UKSK_SHIFT (14U) -#define S50_ELS_KS0_KS0_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UKSK_SHIFT)) & S50_ELS_KS0_KS0_UKSK_MASK) - -#define S50_ELS_KS0_KS0_URTF_MASK (0x8000U) -#define S50_ELS_KS0_KS0_URTF_SHIFT (15U) -#define S50_ELS_KS0_KS0_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_URTF_SHIFT)) & S50_ELS_KS0_KS0_URTF_MASK) - -#define S50_ELS_KS0_KS0_UCKDF_MASK (0x10000U) -#define S50_ELS_KS0_KS0_UCKDF_SHIFT (16U) -#define S50_ELS_KS0_KS0_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UCKDF_SHIFT)) & S50_ELS_KS0_KS0_UCKDF_MASK) - -#define S50_ELS_KS0_KS0_UHKDF_MASK (0x20000U) -#define S50_ELS_KS0_KS0_UHKDF_SHIFT (17U) -#define S50_ELS_KS0_KS0_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UHKDF_SHIFT)) & S50_ELS_KS0_KS0_UHKDF_MASK) - -#define S50_ELS_KS0_KS0_UECSG_MASK (0x40000U) -#define S50_ELS_KS0_KS0_UECSG_SHIFT (18U) -#define S50_ELS_KS0_KS0_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UECSG_SHIFT)) & S50_ELS_KS0_KS0_UECSG_MASK) - -#define S50_ELS_KS0_KS0_UECDH_MASK (0x80000U) -#define S50_ELS_KS0_KS0_UECDH_SHIFT (19U) -#define S50_ELS_KS0_KS0_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UECDH_SHIFT)) & S50_ELS_KS0_KS0_UECDH_MASK) - -#define S50_ELS_KS0_KS0_UAES_MASK (0x100000U) -#define S50_ELS_KS0_KS0_UAES_SHIFT (20U) -#define S50_ELS_KS0_KS0_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UAES_SHIFT)) & S50_ELS_KS0_KS0_UAES_MASK) - -#define S50_ELS_KS0_KS0_UHMAC_MASK (0x200000U) -#define S50_ELS_KS0_KS0_UHMAC_SHIFT (21U) -#define S50_ELS_KS0_KS0_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UHMAC_SHIFT)) & S50_ELS_KS0_KS0_UHMAC_MASK) - -#define S50_ELS_KS0_KS0_UKWK_MASK (0x400000U) -#define S50_ELS_KS0_KS0_UKWK_SHIFT (22U) -#define S50_ELS_KS0_KS0_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UKWK_SHIFT)) & S50_ELS_KS0_KS0_UKWK_MASK) - -#define S50_ELS_KS0_KS0_UKUOK_MASK (0x800000U) -#define S50_ELS_KS0_KS0_UKUOK_SHIFT (23U) -#define S50_ELS_KS0_KS0_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UKUOK_SHIFT)) & S50_ELS_KS0_KS0_UKUOK_MASK) - -#define S50_ELS_KS0_KS0_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS0_KS0_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS0_KS0_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UTLSPMS_SHIFT)) & S50_ELS_KS0_KS0_UTLSPMS_MASK) - -#define S50_ELS_KS0_KS0_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS0_KS0_UTLSMS_SHIFT (25U) -#define S50_ELS_KS0_KS0_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UTLSMS_SHIFT)) & S50_ELS_KS0_KS0_UTLSMS_MASK) - -#define S50_ELS_KS0_KS0_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS0_KS0_UKGSRC_SHIFT (26U) -#define S50_ELS_KS0_KS0_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UKGSRC_SHIFT)) & S50_ELS_KS0_KS0_UKGSRC_MASK) - -#define S50_ELS_KS0_KS0_UHWO_MASK (0x8000000U) -#define S50_ELS_KS0_KS0_UHWO_SHIFT (27U) -#define S50_ELS_KS0_KS0_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UHWO_SHIFT)) & S50_ELS_KS0_KS0_UHWO_MASK) - -#define S50_ELS_KS0_KS0_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS0_KS0_UWRPOK_SHIFT (28U) -#define S50_ELS_KS0_KS0_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UWRPOK_SHIFT)) & S50_ELS_KS0_KS0_UWRPOK_MASK) - -#define S50_ELS_KS0_KS0_UDUK_MASK (0x20000000U) -#define S50_ELS_KS0_KS0_UDUK_SHIFT (29U) -#define S50_ELS_KS0_KS0_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UDUK_SHIFT)) & S50_ELS_KS0_KS0_UDUK_MASK) - -#define S50_ELS_KS0_KS0_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS0_KS0_UPPROT_SHIFT (30U) -#define S50_ELS_KS0_KS0_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS0_KS0_UPPROT_SHIFT)) & S50_ELS_KS0_KS0_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS1 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS1_KS1_KSIZE_MASK (0x3U) -#define S50_ELS_KS1_KS1_KSIZE_SHIFT (0U) -/*! KS1_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS1_KS1_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_KSIZE_SHIFT)) & S50_ELS_KS1_KS1_KSIZE_MASK) - -#define S50_ELS_KS1_KS1_KACT_MASK (0x20U) -#define S50_ELS_KS1_KS1_KACT_SHIFT (5U) -#define S50_ELS_KS1_KS1_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_KACT_SHIFT)) & S50_ELS_KS1_KS1_KACT_MASK) - -#define S50_ELS_KS1_KS1_KBASE_MASK (0x40U) -#define S50_ELS_KS1_KS1_KBASE_SHIFT (6U) -#define S50_ELS_KS1_KS1_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_KBASE_SHIFT)) & S50_ELS_KS1_KS1_KBASE_MASK) - -#define S50_ELS_KS1_KS1_FGP_MASK (0x80U) -#define S50_ELS_KS1_KS1_FGP_SHIFT (7U) -#define S50_ELS_KS1_KS1_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_FGP_SHIFT)) & S50_ELS_KS1_KS1_FGP_MASK) - -#define S50_ELS_KS1_KS1_FRTN_MASK (0x100U) -#define S50_ELS_KS1_KS1_FRTN_SHIFT (8U) -#define S50_ELS_KS1_KS1_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_FRTN_SHIFT)) & S50_ELS_KS1_KS1_FRTN_MASK) - -#define S50_ELS_KS1_KS1_FHWO_MASK (0x200U) -#define S50_ELS_KS1_KS1_FHWO_SHIFT (9U) -#define S50_ELS_KS1_KS1_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_FHWO_SHIFT)) & S50_ELS_KS1_KS1_FHWO_MASK) - -#define S50_ELS_KS1_KS1_UKPUK_MASK (0x800U) -#define S50_ELS_KS1_KS1_UKPUK_SHIFT (11U) -#define S50_ELS_KS1_KS1_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UKPUK_SHIFT)) & S50_ELS_KS1_KS1_UKPUK_MASK) - -#define S50_ELS_KS1_KS1_UTECDH_MASK (0x1000U) -#define S50_ELS_KS1_KS1_UTECDH_SHIFT (12U) -#define S50_ELS_KS1_KS1_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UTECDH_SHIFT)) & S50_ELS_KS1_KS1_UTECDH_MASK) - -#define S50_ELS_KS1_KS1_UCMAC_MASK (0x2000U) -#define S50_ELS_KS1_KS1_UCMAC_SHIFT (13U) -#define S50_ELS_KS1_KS1_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UCMAC_SHIFT)) & S50_ELS_KS1_KS1_UCMAC_MASK) - -#define S50_ELS_KS1_KS1_UKSK_MASK (0x4000U) -#define S50_ELS_KS1_KS1_UKSK_SHIFT (14U) -#define S50_ELS_KS1_KS1_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UKSK_SHIFT)) & S50_ELS_KS1_KS1_UKSK_MASK) - -#define S50_ELS_KS1_KS1_URTF_MASK (0x8000U) -#define S50_ELS_KS1_KS1_URTF_SHIFT (15U) -#define S50_ELS_KS1_KS1_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_URTF_SHIFT)) & S50_ELS_KS1_KS1_URTF_MASK) - -#define S50_ELS_KS1_KS1_UCKDF_MASK (0x10000U) -#define S50_ELS_KS1_KS1_UCKDF_SHIFT (16U) -#define S50_ELS_KS1_KS1_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UCKDF_SHIFT)) & S50_ELS_KS1_KS1_UCKDF_MASK) - -#define S50_ELS_KS1_KS1_UHKDF_MASK (0x20000U) -#define S50_ELS_KS1_KS1_UHKDF_SHIFT (17U) -#define S50_ELS_KS1_KS1_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UHKDF_SHIFT)) & S50_ELS_KS1_KS1_UHKDF_MASK) - -#define S50_ELS_KS1_KS1_UECSG_MASK (0x40000U) -#define S50_ELS_KS1_KS1_UECSG_SHIFT (18U) -#define S50_ELS_KS1_KS1_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UECSG_SHIFT)) & S50_ELS_KS1_KS1_UECSG_MASK) - -#define S50_ELS_KS1_KS1_UECDH_MASK (0x80000U) -#define S50_ELS_KS1_KS1_UECDH_SHIFT (19U) -#define S50_ELS_KS1_KS1_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UECDH_SHIFT)) & S50_ELS_KS1_KS1_UECDH_MASK) - -#define S50_ELS_KS1_KS1_UAES_MASK (0x100000U) -#define S50_ELS_KS1_KS1_UAES_SHIFT (20U) -#define S50_ELS_KS1_KS1_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UAES_SHIFT)) & S50_ELS_KS1_KS1_UAES_MASK) - -#define S50_ELS_KS1_KS1_UHMAC_MASK (0x200000U) -#define S50_ELS_KS1_KS1_UHMAC_SHIFT (21U) -#define S50_ELS_KS1_KS1_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UHMAC_SHIFT)) & S50_ELS_KS1_KS1_UHMAC_MASK) - -#define S50_ELS_KS1_KS1_UKWK_MASK (0x400000U) -#define S50_ELS_KS1_KS1_UKWK_SHIFT (22U) -#define S50_ELS_KS1_KS1_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UKWK_SHIFT)) & S50_ELS_KS1_KS1_UKWK_MASK) - -#define S50_ELS_KS1_KS1_UKUOK_MASK (0x800000U) -#define S50_ELS_KS1_KS1_UKUOK_SHIFT (23U) -#define S50_ELS_KS1_KS1_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UKUOK_SHIFT)) & S50_ELS_KS1_KS1_UKUOK_MASK) - -#define S50_ELS_KS1_KS1_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS1_KS1_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS1_KS1_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UTLSPMS_SHIFT)) & S50_ELS_KS1_KS1_UTLSPMS_MASK) - -#define S50_ELS_KS1_KS1_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS1_KS1_UTLSMS_SHIFT (25U) -#define S50_ELS_KS1_KS1_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UTLSMS_SHIFT)) & S50_ELS_KS1_KS1_UTLSMS_MASK) - -#define S50_ELS_KS1_KS1_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS1_KS1_UKGSRC_SHIFT (26U) -#define S50_ELS_KS1_KS1_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UKGSRC_SHIFT)) & S50_ELS_KS1_KS1_UKGSRC_MASK) - -#define S50_ELS_KS1_KS1_UHWO_MASK (0x8000000U) -#define S50_ELS_KS1_KS1_UHWO_SHIFT (27U) -#define S50_ELS_KS1_KS1_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UHWO_SHIFT)) & S50_ELS_KS1_KS1_UHWO_MASK) - -#define S50_ELS_KS1_KS1_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS1_KS1_UWRPOK_SHIFT (28U) -#define S50_ELS_KS1_KS1_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UWRPOK_SHIFT)) & S50_ELS_KS1_KS1_UWRPOK_MASK) - -#define S50_ELS_KS1_KS1_UDUK_MASK (0x20000000U) -#define S50_ELS_KS1_KS1_UDUK_SHIFT (29U) -#define S50_ELS_KS1_KS1_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UDUK_SHIFT)) & S50_ELS_KS1_KS1_UDUK_MASK) - -#define S50_ELS_KS1_KS1_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS1_KS1_UPPROT_SHIFT (30U) -#define S50_ELS_KS1_KS1_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS1_KS1_UPPROT_SHIFT)) & S50_ELS_KS1_KS1_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS2 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS2_KS2_KSIZE_MASK (0x3U) -#define S50_ELS_KS2_KS2_KSIZE_SHIFT (0U) -/*! KS2_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS2_KS2_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_KSIZE_SHIFT)) & S50_ELS_KS2_KS2_KSIZE_MASK) - -#define S50_ELS_KS2_KS2_KACT_MASK (0x20U) -#define S50_ELS_KS2_KS2_KACT_SHIFT (5U) -#define S50_ELS_KS2_KS2_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_KACT_SHIFT)) & S50_ELS_KS2_KS2_KACT_MASK) - -#define S50_ELS_KS2_KS2_KBASE_MASK (0x40U) -#define S50_ELS_KS2_KS2_KBASE_SHIFT (6U) -#define S50_ELS_KS2_KS2_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_KBASE_SHIFT)) & S50_ELS_KS2_KS2_KBASE_MASK) - -#define S50_ELS_KS2_KS2_FGP_MASK (0x80U) -#define S50_ELS_KS2_KS2_FGP_SHIFT (7U) -#define S50_ELS_KS2_KS2_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_FGP_SHIFT)) & S50_ELS_KS2_KS2_FGP_MASK) - -#define S50_ELS_KS2_KS2_FRTN_MASK (0x100U) -#define S50_ELS_KS2_KS2_FRTN_SHIFT (8U) -#define S50_ELS_KS2_KS2_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_FRTN_SHIFT)) & S50_ELS_KS2_KS2_FRTN_MASK) - -#define S50_ELS_KS2_KS2_FHWO_MASK (0x200U) -#define S50_ELS_KS2_KS2_FHWO_SHIFT (9U) -#define S50_ELS_KS2_KS2_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_FHWO_SHIFT)) & S50_ELS_KS2_KS2_FHWO_MASK) - -#define S50_ELS_KS2_KS2_UKPUK_MASK (0x800U) -#define S50_ELS_KS2_KS2_UKPUK_SHIFT (11U) -#define S50_ELS_KS2_KS2_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UKPUK_SHIFT)) & S50_ELS_KS2_KS2_UKPUK_MASK) - -#define S50_ELS_KS2_KS2_UTECDH_MASK (0x1000U) -#define S50_ELS_KS2_KS2_UTECDH_SHIFT (12U) -#define S50_ELS_KS2_KS2_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UTECDH_SHIFT)) & S50_ELS_KS2_KS2_UTECDH_MASK) - -#define S50_ELS_KS2_KS2_UCMAC_MASK (0x2000U) -#define S50_ELS_KS2_KS2_UCMAC_SHIFT (13U) -#define S50_ELS_KS2_KS2_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UCMAC_SHIFT)) & S50_ELS_KS2_KS2_UCMAC_MASK) - -#define S50_ELS_KS2_KS2_UKSK_MASK (0x4000U) -#define S50_ELS_KS2_KS2_UKSK_SHIFT (14U) -#define S50_ELS_KS2_KS2_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UKSK_SHIFT)) & S50_ELS_KS2_KS2_UKSK_MASK) - -#define S50_ELS_KS2_KS2_URTF_MASK (0x8000U) -#define S50_ELS_KS2_KS2_URTF_SHIFT (15U) -#define S50_ELS_KS2_KS2_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_URTF_SHIFT)) & S50_ELS_KS2_KS2_URTF_MASK) - -#define S50_ELS_KS2_KS2_UCKDF_MASK (0x10000U) -#define S50_ELS_KS2_KS2_UCKDF_SHIFT (16U) -#define S50_ELS_KS2_KS2_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UCKDF_SHIFT)) & S50_ELS_KS2_KS2_UCKDF_MASK) - -#define S50_ELS_KS2_KS2_UHKDF_MASK (0x20000U) -#define S50_ELS_KS2_KS2_UHKDF_SHIFT (17U) -#define S50_ELS_KS2_KS2_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UHKDF_SHIFT)) & S50_ELS_KS2_KS2_UHKDF_MASK) - -#define S50_ELS_KS2_KS2_UECSG_MASK (0x40000U) -#define S50_ELS_KS2_KS2_UECSG_SHIFT (18U) -#define S50_ELS_KS2_KS2_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UECSG_SHIFT)) & S50_ELS_KS2_KS2_UECSG_MASK) - -#define S50_ELS_KS2_KS2_UECDH_MASK (0x80000U) -#define S50_ELS_KS2_KS2_UECDH_SHIFT (19U) -#define S50_ELS_KS2_KS2_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UECDH_SHIFT)) & S50_ELS_KS2_KS2_UECDH_MASK) - -#define S50_ELS_KS2_KS2_UAES_MASK (0x100000U) -#define S50_ELS_KS2_KS2_UAES_SHIFT (20U) -#define S50_ELS_KS2_KS2_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UAES_SHIFT)) & S50_ELS_KS2_KS2_UAES_MASK) - -#define S50_ELS_KS2_KS2_UHMAC_MASK (0x200000U) -#define S50_ELS_KS2_KS2_UHMAC_SHIFT (21U) -#define S50_ELS_KS2_KS2_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UHMAC_SHIFT)) & S50_ELS_KS2_KS2_UHMAC_MASK) - -#define S50_ELS_KS2_KS2_UKWK_MASK (0x400000U) -#define S50_ELS_KS2_KS2_UKWK_SHIFT (22U) -#define S50_ELS_KS2_KS2_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UKWK_SHIFT)) & S50_ELS_KS2_KS2_UKWK_MASK) - -#define S50_ELS_KS2_KS2_UKUOK_MASK (0x800000U) -#define S50_ELS_KS2_KS2_UKUOK_SHIFT (23U) -#define S50_ELS_KS2_KS2_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UKUOK_SHIFT)) & S50_ELS_KS2_KS2_UKUOK_MASK) - -#define S50_ELS_KS2_KS2_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS2_KS2_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS2_KS2_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UTLSPMS_SHIFT)) & S50_ELS_KS2_KS2_UTLSPMS_MASK) - -#define S50_ELS_KS2_KS2_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS2_KS2_UTLSMS_SHIFT (25U) -#define S50_ELS_KS2_KS2_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UTLSMS_SHIFT)) & S50_ELS_KS2_KS2_UTLSMS_MASK) - -#define S50_ELS_KS2_KS2_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS2_KS2_UKGSRC_SHIFT (26U) -#define S50_ELS_KS2_KS2_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UKGSRC_SHIFT)) & S50_ELS_KS2_KS2_UKGSRC_MASK) - -#define S50_ELS_KS2_KS2_UHWO_MASK (0x8000000U) -#define S50_ELS_KS2_KS2_UHWO_SHIFT (27U) -#define S50_ELS_KS2_KS2_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UHWO_SHIFT)) & S50_ELS_KS2_KS2_UHWO_MASK) - -#define S50_ELS_KS2_KS2_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS2_KS2_UWRPOK_SHIFT (28U) -#define S50_ELS_KS2_KS2_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UWRPOK_SHIFT)) & S50_ELS_KS2_KS2_UWRPOK_MASK) - -#define S50_ELS_KS2_KS2_UDUK_MASK (0x20000000U) -#define S50_ELS_KS2_KS2_UDUK_SHIFT (29U) -#define S50_ELS_KS2_KS2_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UDUK_SHIFT)) & S50_ELS_KS2_KS2_UDUK_MASK) - -#define S50_ELS_KS2_KS2_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS2_KS2_UPPROT_SHIFT (30U) -#define S50_ELS_KS2_KS2_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS2_KS2_UPPROT_SHIFT)) & S50_ELS_KS2_KS2_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS3 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS3_KS3_KSIZE_MASK (0x3U) -#define S50_ELS_KS3_KS3_KSIZE_SHIFT (0U) -/*! KS3_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS3_KS3_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_KSIZE_SHIFT)) & S50_ELS_KS3_KS3_KSIZE_MASK) - -#define S50_ELS_KS3_KS3_KACT_MASK (0x20U) -#define S50_ELS_KS3_KS3_KACT_SHIFT (5U) -#define S50_ELS_KS3_KS3_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_KACT_SHIFT)) & S50_ELS_KS3_KS3_KACT_MASK) - -#define S50_ELS_KS3_KS3_KBASE_MASK (0x40U) -#define S50_ELS_KS3_KS3_KBASE_SHIFT (6U) -#define S50_ELS_KS3_KS3_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_KBASE_SHIFT)) & S50_ELS_KS3_KS3_KBASE_MASK) - -#define S50_ELS_KS3_KS3_FGP_MASK (0x80U) -#define S50_ELS_KS3_KS3_FGP_SHIFT (7U) -#define S50_ELS_KS3_KS3_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_FGP_SHIFT)) & S50_ELS_KS3_KS3_FGP_MASK) - -#define S50_ELS_KS3_KS3_FRTN_MASK (0x100U) -#define S50_ELS_KS3_KS3_FRTN_SHIFT (8U) -#define S50_ELS_KS3_KS3_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_FRTN_SHIFT)) & S50_ELS_KS3_KS3_FRTN_MASK) - -#define S50_ELS_KS3_KS3_FHWO_MASK (0x200U) -#define S50_ELS_KS3_KS3_FHWO_SHIFT (9U) -#define S50_ELS_KS3_KS3_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_FHWO_SHIFT)) & S50_ELS_KS3_KS3_FHWO_MASK) - -#define S50_ELS_KS3_KS3_UKPUK_MASK (0x800U) -#define S50_ELS_KS3_KS3_UKPUK_SHIFT (11U) -#define S50_ELS_KS3_KS3_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UKPUK_SHIFT)) & S50_ELS_KS3_KS3_UKPUK_MASK) - -#define S50_ELS_KS3_KS3_UTECDH_MASK (0x1000U) -#define S50_ELS_KS3_KS3_UTECDH_SHIFT (12U) -#define S50_ELS_KS3_KS3_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UTECDH_SHIFT)) & S50_ELS_KS3_KS3_UTECDH_MASK) - -#define S50_ELS_KS3_KS3_UCMAC_MASK (0x2000U) -#define S50_ELS_KS3_KS3_UCMAC_SHIFT (13U) -#define S50_ELS_KS3_KS3_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UCMAC_SHIFT)) & S50_ELS_KS3_KS3_UCMAC_MASK) - -#define S50_ELS_KS3_KS3_UKSK_MASK (0x4000U) -#define S50_ELS_KS3_KS3_UKSK_SHIFT (14U) -#define S50_ELS_KS3_KS3_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UKSK_SHIFT)) & S50_ELS_KS3_KS3_UKSK_MASK) - -#define S50_ELS_KS3_KS3_URTF_MASK (0x8000U) -#define S50_ELS_KS3_KS3_URTF_SHIFT (15U) -#define S50_ELS_KS3_KS3_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_URTF_SHIFT)) & S50_ELS_KS3_KS3_URTF_MASK) - -#define S50_ELS_KS3_KS3_UCKDF_MASK (0x10000U) -#define S50_ELS_KS3_KS3_UCKDF_SHIFT (16U) -#define S50_ELS_KS3_KS3_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UCKDF_SHIFT)) & S50_ELS_KS3_KS3_UCKDF_MASK) - -#define S50_ELS_KS3_KS3_UHKDF_MASK (0x20000U) -#define S50_ELS_KS3_KS3_UHKDF_SHIFT (17U) -#define S50_ELS_KS3_KS3_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UHKDF_SHIFT)) & S50_ELS_KS3_KS3_UHKDF_MASK) - -#define S50_ELS_KS3_KS3_UECSG_MASK (0x40000U) -#define S50_ELS_KS3_KS3_UECSG_SHIFT (18U) -#define S50_ELS_KS3_KS3_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UECSG_SHIFT)) & S50_ELS_KS3_KS3_UECSG_MASK) - -#define S50_ELS_KS3_KS3_UECDH_MASK (0x80000U) -#define S50_ELS_KS3_KS3_UECDH_SHIFT (19U) -#define S50_ELS_KS3_KS3_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UECDH_SHIFT)) & S50_ELS_KS3_KS3_UECDH_MASK) - -#define S50_ELS_KS3_KS3_UAES_MASK (0x100000U) -#define S50_ELS_KS3_KS3_UAES_SHIFT (20U) -#define S50_ELS_KS3_KS3_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UAES_SHIFT)) & S50_ELS_KS3_KS3_UAES_MASK) - -#define S50_ELS_KS3_KS3_UHMAC_MASK (0x200000U) -#define S50_ELS_KS3_KS3_UHMAC_SHIFT (21U) -#define S50_ELS_KS3_KS3_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UHMAC_SHIFT)) & S50_ELS_KS3_KS3_UHMAC_MASK) - -#define S50_ELS_KS3_KS3_UKWK_MASK (0x400000U) -#define S50_ELS_KS3_KS3_UKWK_SHIFT (22U) -#define S50_ELS_KS3_KS3_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UKWK_SHIFT)) & S50_ELS_KS3_KS3_UKWK_MASK) - -#define S50_ELS_KS3_KS3_UKUOK_MASK (0x800000U) -#define S50_ELS_KS3_KS3_UKUOK_SHIFT (23U) -#define S50_ELS_KS3_KS3_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UKUOK_SHIFT)) & S50_ELS_KS3_KS3_UKUOK_MASK) - -#define S50_ELS_KS3_KS3_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS3_KS3_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS3_KS3_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UTLSPMS_SHIFT)) & S50_ELS_KS3_KS3_UTLSPMS_MASK) - -#define S50_ELS_KS3_KS3_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS3_KS3_UTLSMS_SHIFT (25U) -#define S50_ELS_KS3_KS3_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UTLSMS_SHIFT)) & S50_ELS_KS3_KS3_UTLSMS_MASK) - -#define S50_ELS_KS3_KS3_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS3_KS3_UKGSRC_SHIFT (26U) -#define S50_ELS_KS3_KS3_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UKGSRC_SHIFT)) & S50_ELS_KS3_KS3_UKGSRC_MASK) - -#define S50_ELS_KS3_KS3_UHWO_MASK (0x8000000U) -#define S50_ELS_KS3_KS3_UHWO_SHIFT (27U) -#define S50_ELS_KS3_KS3_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UHWO_SHIFT)) & S50_ELS_KS3_KS3_UHWO_MASK) - -#define S50_ELS_KS3_KS3_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS3_KS3_UWRPOK_SHIFT (28U) -#define S50_ELS_KS3_KS3_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UWRPOK_SHIFT)) & S50_ELS_KS3_KS3_UWRPOK_MASK) - -#define S50_ELS_KS3_KS3_UDUK_MASK (0x20000000U) -#define S50_ELS_KS3_KS3_UDUK_SHIFT (29U) -#define S50_ELS_KS3_KS3_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UDUK_SHIFT)) & S50_ELS_KS3_KS3_UDUK_MASK) - -#define S50_ELS_KS3_KS3_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS3_KS3_UPPROT_SHIFT (30U) -#define S50_ELS_KS3_KS3_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS3_KS3_UPPROT_SHIFT)) & S50_ELS_KS3_KS3_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS4 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS4_KS4_KSIZE_MASK (0x3U) -#define S50_ELS_KS4_KS4_KSIZE_SHIFT (0U) -/*! KS4_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS4_KS4_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_KSIZE_SHIFT)) & S50_ELS_KS4_KS4_KSIZE_MASK) - -#define S50_ELS_KS4_KS4_KACT_MASK (0x20U) -#define S50_ELS_KS4_KS4_KACT_SHIFT (5U) -#define S50_ELS_KS4_KS4_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_KACT_SHIFT)) & S50_ELS_KS4_KS4_KACT_MASK) - -#define S50_ELS_KS4_KS4_KBASE_MASK (0x40U) -#define S50_ELS_KS4_KS4_KBASE_SHIFT (6U) -#define S50_ELS_KS4_KS4_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_KBASE_SHIFT)) & S50_ELS_KS4_KS4_KBASE_MASK) - -#define S50_ELS_KS4_KS4_FGP_MASK (0x80U) -#define S50_ELS_KS4_KS4_FGP_SHIFT (7U) -#define S50_ELS_KS4_KS4_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_FGP_SHIFT)) & S50_ELS_KS4_KS4_FGP_MASK) - -#define S50_ELS_KS4_KS4_FRTN_MASK (0x100U) -#define S50_ELS_KS4_KS4_FRTN_SHIFT (8U) -#define S50_ELS_KS4_KS4_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_FRTN_SHIFT)) & S50_ELS_KS4_KS4_FRTN_MASK) - -#define S50_ELS_KS4_KS4_FHWO_MASK (0x200U) -#define S50_ELS_KS4_KS4_FHWO_SHIFT (9U) -#define S50_ELS_KS4_KS4_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_FHWO_SHIFT)) & S50_ELS_KS4_KS4_FHWO_MASK) - -#define S50_ELS_KS4_KS4_UKPUK_MASK (0x800U) -#define S50_ELS_KS4_KS4_UKPUK_SHIFT (11U) -#define S50_ELS_KS4_KS4_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UKPUK_SHIFT)) & S50_ELS_KS4_KS4_UKPUK_MASK) - -#define S50_ELS_KS4_KS4_UTECDH_MASK (0x1000U) -#define S50_ELS_KS4_KS4_UTECDH_SHIFT (12U) -#define S50_ELS_KS4_KS4_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UTECDH_SHIFT)) & S50_ELS_KS4_KS4_UTECDH_MASK) - -#define S50_ELS_KS4_KS4_UCMAC_MASK (0x2000U) -#define S50_ELS_KS4_KS4_UCMAC_SHIFT (13U) -#define S50_ELS_KS4_KS4_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UCMAC_SHIFT)) & S50_ELS_KS4_KS4_UCMAC_MASK) - -#define S50_ELS_KS4_KS4_UKSK_MASK (0x4000U) -#define S50_ELS_KS4_KS4_UKSK_SHIFT (14U) -#define S50_ELS_KS4_KS4_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UKSK_SHIFT)) & S50_ELS_KS4_KS4_UKSK_MASK) - -#define S50_ELS_KS4_KS4_URTF_MASK (0x8000U) -#define S50_ELS_KS4_KS4_URTF_SHIFT (15U) -#define S50_ELS_KS4_KS4_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_URTF_SHIFT)) & S50_ELS_KS4_KS4_URTF_MASK) - -#define S50_ELS_KS4_KS4_UCKDF_MASK (0x10000U) -#define S50_ELS_KS4_KS4_UCKDF_SHIFT (16U) -#define S50_ELS_KS4_KS4_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UCKDF_SHIFT)) & S50_ELS_KS4_KS4_UCKDF_MASK) - -#define S50_ELS_KS4_KS4_UHKDF_MASK (0x20000U) -#define S50_ELS_KS4_KS4_UHKDF_SHIFT (17U) -#define S50_ELS_KS4_KS4_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UHKDF_SHIFT)) & S50_ELS_KS4_KS4_UHKDF_MASK) - -#define S50_ELS_KS4_KS4_UECSG_MASK (0x40000U) -#define S50_ELS_KS4_KS4_UECSG_SHIFT (18U) -#define S50_ELS_KS4_KS4_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UECSG_SHIFT)) & S50_ELS_KS4_KS4_UECSG_MASK) - -#define S50_ELS_KS4_KS4_UECDH_MASK (0x80000U) -#define S50_ELS_KS4_KS4_UECDH_SHIFT (19U) -#define S50_ELS_KS4_KS4_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UECDH_SHIFT)) & S50_ELS_KS4_KS4_UECDH_MASK) - -#define S50_ELS_KS4_KS4_UAES_MASK (0x100000U) -#define S50_ELS_KS4_KS4_UAES_SHIFT (20U) -#define S50_ELS_KS4_KS4_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UAES_SHIFT)) & S50_ELS_KS4_KS4_UAES_MASK) - -#define S50_ELS_KS4_KS4_UHMAC_MASK (0x200000U) -#define S50_ELS_KS4_KS4_UHMAC_SHIFT (21U) -#define S50_ELS_KS4_KS4_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UHMAC_SHIFT)) & S50_ELS_KS4_KS4_UHMAC_MASK) - -#define S50_ELS_KS4_KS4_UKWK_MASK (0x400000U) -#define S50_ELS_KS4_KS4_UKWK_SHIFT (22U) -#define S50_ELS_KS4_KS4_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UKWK_SHIFT)) & S50_ELS_KS4_KS4_UKWK_MASK) - -#define S50_ELS_KS4_KS4_UKUOK_MASK (0x800000U) -#define S50_ELS_KS4_KS4_UKUOK_SHIFT (23U) -#define S50_ELS_KS4_KS4_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UKUOK_SHIFT)) & S50_ELS_KS4_KS4_UKUOK_MASK) - -#define S50_ELS_KS4_KS4_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS4_KS4_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS4_KS4_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UTLSPMS_SHIFT)) & S50_ELS_KS4_KS4_UTLSPMS_MASK) - -#define S50_ELS_KS4_KS4_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS4_KS4_UTLSMS_SHIFT (25U) -#define S50_ELS_KS4_KS4_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UTLSMS_SHIFT)) & S50_ELS_KS4_KS4_UTLSMS_MASK) - -#define S50_ELS_KS4_KS4_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS4_KS4_UKGSRC_SHIFT (26U) -#define S50_ELS_KS4_KS4_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UKGSRC_SHIFT)) & S50_ELS_KS4_KS4_UKGSRC_MASK) - -#define S50_ELS_KS4_KS4_UHWO_MASK (0x8000000U) -#define S50_ELS_KS4_KS4_UHWO_SHIFT (27U) -#define S50_ELS_KS4_KS4_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UHWO_SHIFT)) & S50_ELS_KS4_KS4_UHWO_MASK) - -#define S50_ELS_KS4_KS4_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS4_KS4_UWRPOK_SHIFT (28U) -#define S50_ELS_KS4_KS4_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UWRPOK_SHIFT)) & S50_ELS_KS4_KS4_UWRPOK_MASK) - -#define S50_ELS_KS4_KS4_UDUK_MASK (0x20000000U) -#define S50_ELS_KS4_KS4_UDUK_SHIFT (29U) -#define S50_ELS_KS4_KS4_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UDUK_SHIFT)) & S50_ELS_KS4_KS4_UDUK_MASK) - -#define S50_ELS_KS4_KS4_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS4_KS4_UPPROT_SHIFT (30U) -#define S50_ELS_KS4_KS4_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS4_KS4_UPPROT_SHIFT)) & S50_ELS_KS4_KS4_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS5 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS5_KS5_KSIZE_MASK (0x3U) -#define S50_ELS_KS5_KS5_KSIZE_SHIFT (0U) -/*! KS5_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS5_KS5_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_KSIZE_SHIFT)) & S50_ELS_KS5_KS5_KSIZE_MASK) - -#define S50_ELS_KS5_KS5_KACT_MASK (0x20U) -#define S50_ELS_KS5_KS5_KACT_SHIFT (5U) -#define S50_ELS_KS5_KS5_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_KACT_SHIFT)) & S50_ELS_KS5_KS5_KACT_MASK) - -#define S50_ELS_KS5_KS5_KBASE_MASK (0x40U) -#define S50_ELS_KS5_KS5_KBASE_SHIFT (6U) -#define S50_ELS_KS5_KS5_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_KBASE_SHIFT)) & S50_ELS_KS5_KS5_KBASE_MASK) - -#define S50_ELS_KS5_KS5_FGP_MASK (0x80U) -#define S50_ELS_KS5_KS5_FGP_SHIFT (7U) -#define S50_ELS_KS5_KS5_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_FGP_SHIFT)) & S50_ELS_KS5_KS5_FGP_MASK) - -#define S50_ELS_KS5_KS5_FRTN_MASK (0x100U) -#define S50_ELS_KS5_KS5_FRTN_SHIFT (8U) -#define S50_ELS_KS5_KS5_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_FRTN_SHIFT)) & S50_ELS_KS5_KS5_FRTN_MASK) - -#define S50_ELS_KS5_KS5_FHWO_MASK (0x200U) -#define S50_ELS_KS5_KS5_FHWO_SHIFT (9U) -#define S50_ELS_KS5_KS5_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_FHWO_SHIFT)) & S50_ELS_KS5_KS5_FHWO_MASK) - -#define S50_ELS_KS5_KS5_UKPUK_MASK (0x800U) -#define S50_ELS_KS5_KS5_UKPUK_SHIFT (11U) -#define S50_ELS_KS5_KS5_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UKPUK_SHIFT)) & S50_ELS_KS5_KS5_UKPUK_MASK) - -#define S50_ELS_KS5_KS5_UTECDH_MASK (0x1000U) -#define S50_ELS_KS5_KS5_UTECDH_SHIFT (12U) -#define S50_ELS_KS5_KS5_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UTECDH_SHIFT)) & S50_ELS_KS5_KS5_UTECDH_MASK) - -#define S50_ELS_KS5_KS5_UCMAC_MASK (0x2000U) -#define S50_ELS_KS5_KS5_UCMAC_SHIFT (13U) -#define S50_ELS_KS5_KS5_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UCMAC_SHIFT)) & S50_ELS_KS5_KS5_UCMAC_MASK) - -#define S50_ELS_KS5_KS5_UKSK_MASK (0x4000U) -#define S50_ELS_KS5_KS5_UKSK_SHIFT (14U) -#define S50_ELS_KS5_KS5_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UKSK_SHIFT)) & S50_ELS_KS5_KS5_UKSK_MASK) - -#define S50_ELS_KS5_KS5_URTF_MASK (0x8000U) -#define S50_ELS_KS5_KS5_URTF_SHIFT (15U) -#define S50_ELS_KS5_KS5_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_URTF_SHIFT)) & S50_ELS_KS5_KS5_URTF_MASK) - -#define S50_ELS_KS5_KS5_UCKDF_MASK (0x10000U) -#define S50_ELS_KS5_KS5_UCKDF_SHIFT (16U) -#define S50_ELS_KS5_KS5_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UCKDF_SHIFT)) & S50_ELS_KS5_KS5_UCKDF_MASK) - -#define S50_ELS_KS5_KS5_UHKDF_MASK (0x20000U) -#define S50_ELS_KS5_KS5_UHKDF_SHIFT (17U) -#define S50_ELS_KS5_KS5_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UHKDF_SHIFT)) & S50_ELS_KS5_KS5_UHKDF_MASK) - -#define S50_ELS_KS5_KS5_UECSG_MASK (0x40000U) -#define S50_ELS_KS5_KS5_UECSG_SHIFT (18U) -#define S50_ELS_KS5_KS5_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UECSG_SHIFT)) & S50_ELS_KS5_KS5_UECSG_MASK) - -#define S50_ELS_KS5_KS5_UECDH_MASK (0x80000U) -#define S50_ELS_KS5_KS5_UECDH_SHIFT (19U) -#define S50_ELS_KS5_KS5_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UECDH_SHIFT)) & S50_ELS_KS5_KS5_UECDH_MASK) - -#define S50_ELS_KS5_KS5_UAES_MASK (0x100000U) -#define S50_ELS_KS5_KS5_UAES_SHIFT (20U) -#define S50_ELS_KS5_KS5_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UAES_SHIFT)) & S50_ELS_KS5_KS5_UAES_MASK) - -#define S50_ELS_KS5_KS5_UHMAC_MASK (0x200000U) -#define S50_ELS_KS5_KS5_UHMAC_SHIFT (21U) -#define S50_ELS_KS5_KS5_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UHMAC_SHIFT)) & S50_ELS_KS5_KS5_UHMAC_MASK) - -#define S50_ELS_KS5_KS5_UKWK_MASK (0x400000U) -#define S50_ELS_KS5_KS5_UKWK_SHIFT (22U) -#define S50_ELS_KS5_KS5_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UKWK_SHIFT)) & S50_ELS_KS5_KS5_UKWK_MASK) - -#define S50_ELS_KS5_KS5_UKUOK_MASK (0x800000U) -#define S50_ELS_KS5_KS5_UKUOK_SHIFT (23U) -#define S50_ELS_KS5_KS5_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UKUOK_SHIFT)) & S50_ELS_KS5_KS5_UKUOK_MASK) - -#define S50_ELS_KS5_KS5_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS5_KS5_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS5_KS5_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UTLSPMS_SHIFT)) & S50_ELS_KS5_KS5_UTLSPMS_MASK) - -#define S50_ELS_KS5_KS5_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS5_KS5_UTLSMS_SHIFT (25U) -#define S50_ELS_KS5_KS5_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UTLSMS_SHIFT)) & S50_ELS_KS5_KS5_UTLSMS_MASK) - -#define S50_ELS_KS5_KS5_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS5_KS5_UKGSRC_SHIFT (26U) -#define S50_ELS_KS5_KS5_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UKGSRC_SHIFT)) & S50_ELS_KS5_KS5_UKGSRC_MASK) - -#define S50_ELS_KS5_KS5_UHWO_MASK (0x8000000U) -#define S50_ELS_KS5_KS5_UHWO_SHIFT (27U) -#define S50_ELS_KS5_KS5_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UHWO_SHIFT)) & S50_ELS_KS5_KS5_UHWO_MASK) - -#define S50_ELS_KS5_KS5_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS5_KS5_UWRPOK_SHIFT (28U) -#define S50_ELS_KS5_KS5_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UWRPOK_SHIFT)) & S50_ELS_KS5_KS5_UWRPOK_MASK) - -#define S50_ELS_KS5_KS5_UDUK_MASK (0x20000000U) -#define S50_ELS_KS5_KS5_UDUK_SHIFT (29U) -#define S50_ELS_KS5_KS5_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UDUK_SHIFT)) & S50_ELS_KS5_KS5_UDUK_MASK) - -#define S50_ELS_KS5_KS5_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS5_KS5_UPPROT_SHIFT (30U) -#define S50_ELS_KS5_KS5_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS5_KS5_UPPROT_SHIFT)) & S50_ELS_KS5_KS5_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS6 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS6_KS6_KSIZE_MASK (0x3U) -#define S50_ELS_KS6_KS6_KSIZE_SHIFT (0U) -/*! KS6_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS6_KS6_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_KSIZE_SHIFT)) & S50_ELS_KS6_KS6_KSIZE_MASK) - -#define S50_ELS_KS6_KS6_KACT_MASK (0x20U) -#define S50_ELS_KS6_KS6_KACT_SHIFT (5U) -#define S50_ELS_KS6_KS6_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_KACT_SHIFT)) & S50_ELS_KS6_KS6_KACT_MASK) - -#define S50_ELS_KS6_KS6_KBASE_MASK (0x40U) -#define S50_ELS_KS6_KS6_KBASE_SHIFT (6U) -#define S50_ELS_KS6_KS6_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_KBASE_SHIFT)) & S50_ELS_KS6_KS6_KBASE_MASK) - -#define S50_ELS_KS6_KS6_FGP_MASK (0x80U) -#define S50_ELS_KS6_KS6_FGP_SHIFT (7U) -#define S50_ELS_KS6_KS6_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_FGP_SHIFT)) & S50_ELS_KS6_KS6_FGP_MASK) - -#define S50_ELS_KS6_KS6_FRTN_MASK (0x100U) -#define S50_ELS_KS6_KS6_FRTN_SHIFT (8U) -#define S50_ELS_KS6_KS6_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_FRTN_SHIFT)) & S50_ELS_KS6_KS6_FRTN_MASK) - -#define S50_ELS_KS6_KS6_FHWO_MASK (0x200U) -#define S50_ELS_KS6_KS6_FHWO_SHIFT (9U) -#define S50_ELS_KS6_KS6_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_FHWO_SHIFT)) & S50_ELS_KS6_KS6_FHWO_MASK) - -#define S50_ELS_KS6_KS6_UKPUK_MASK (0x800U) -#define S50_ELS_KS6_KS6_UKPUK_SHIFT (11U) -#define S50_ELS_KS6_KS6_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UKPUK_SHIFT)) & S50_ELS_KS6_KS6_UKPUK_MASK) - -#define S50_ELS_KS6_KS6_UTECDH_MASK (0x1000U) -#define S50_ELS_KS6_KS6_UTECDH_SHIFT (12U) -#define S50_ELS_KS6_KS6_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UTECDH_SHIFT)) & S50_ELS_KS6_KS6_UTECDH_MASK) - -#define S50_ELS_KS6_KS6_UCMAC_MASK (0x2000U) -#define S50_ELS_KS6_KS6_UCMAC_SHIFT (13U) -#define S50_ELS_KS6_KS6_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UCMAC_SHIFT)) & S50_ELS_KS6_KS6_UCMAC_MASK) - -#define S50_ELS_KS6_KS6_UKSK_MASK (0x4000U) -#define S50_ELS_KS6_KS6_UKSK_SHIFT (14U) -#define S50_ELS_KS6_KS6_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UKSK_SHIFT)) & S50_ELS_KS6_KS6_UKSK_MASK) - -#define S50_ELS_KS6_KS6_URTF_MASK (0x8000U) -#define S50_ELS_KS6_KS6_URTF_SHIFT (15U) -#define S50_ELS_KS6_KS6_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_URTF_SHIFT)) & S50_ELS_KS6_KS6_URTF_MASK) - -#define S50_ELS_KS6_KS6_UCKDF_MASK (0x10000U) -#define S50_ELS_KS6_KS6_UCKDF_SHIFT (16U) -#define S50_ELS_KS6_KS6_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UCKDF_SHIFT)) & S50_ELS_KS6_KS6_UCKDF_MASK) - -#define S50_ELS_KS6_KS6_UHKDF_MASK (0x20000U) -#define S50_ELS_KS6_KS6_UHKDF_SHIFT (17U) -#define S50_ELS_KS6_KS6_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UHKDF_SHIFT)) & S50_ELS_KS6_KS6_UHKDF_MASK) - -#define S50_ELS_KS6_KS6_UECSG_MASK (0x40000U) -#define S50_ELS_KS6_KS6_UECSG_SHIFT (18U) -#define S50_ELS_KS6_KS6_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UECSG_SHIFT)) & S50_ELS_KS6_KS6_UECSG_MASK) - -#define S50_ELS_KS6_KS6_UECDH_MASK (0x80000U) -#define S50_ELS_KS6_KS6_UECDH_SHIFT (19U) -#define S50_ELS_KS6_KS6_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UECDH_SHIFT)) & S50_ELS_KS6_KS6_UECDH_MASK) - -#define S50_ELS_KS6_KS6_UAES_MASK (0x100000U) -#define S50_ELS_KS6_KS6_UAES_SHIFT (20U) -#define S50_ELS_KS6_KS6_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UAES_SHIFT)) & S50_ELS_KS6_KS6_UAES_MASK) - -#define S50_ELS_KS6_KS6_UHMAC_MASK (0x200000U) -#define S50_ELS_KS6_KS6_UHMAC_SHIFT (21U) -#define S50_ELS_KS6_KS6_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UHMAC_SHIFT)) & S50_ELS_KS6_KS6_UHMAC_MASK) - -#define S50_ELS_KS6_KS6_UKWK_MASK (0x400000U) -#define S50_ELS_KS6_KS6_UKWK_SHIFT (22U) -#define S50_ELS_KS6_KS6_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UKWK_SHIFT)) & S50_ELS_KS6_KS6_UKWK_MASK) - -#define S50_ELS_KS6_KS6_UKUOK_MASK (0x800000U) -#define S50_ELS_KS6_KS6_UKUOK_SHIFT (23U) -#define S50_ELS_KS6_KS6_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UKUOK_SHIFT)) & S50_ELS_KS6_KS6_UKUOK_MASK) - -#define S50_ELS_KS6_KS6_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS6_KS6_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS6_KS6_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UTLSPMS_SHIFT)) & S50_ELS_KS6_KS6_UTLSPMS_MASK) - -#define S50_ELS_KS6_KS6_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS6_KS6_UTLSMS_SHIFT (25U) -#define S50_ELS_KS6_KS6_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UTLSMS_SHIFT)) & S50_ELS_KS6_KS6_UTLSMS_MASK) - -#define S50_ELS_KS6_KS6_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS6_KS6_UKGSRC_SHIFT (26U) -#define S50_ELS_KS6_KS6_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UKGSRC_SHIFT)) & S50_ELS_KS6_KS6_UKGSRC_MASK) - -#define S50_ELS_KS6_KS6_UHWO_MASK (0x8000000U) -#define S50_ELS_KS6_KS6_UHWO_SHIFT (27U) -#define S50_ELS_KS6_KS6_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UHWO_SHIFT)) & S50_ELS_KS6_KS6_UHWO_MASK) - -#define S50_ELS_KS6_KS6_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS6_KS6_UWRPOK_SHIFT (28U) -#define S50_ELS_KS6_KS6_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UWRPOK_SHIFT)) & S50_ELS_KS6_KS6_UWRPOK_MASK) - -#define S50_ELS_KS6_KS6_UDUK_MASK (0x20000000U) -#define S50_ELS_KS6_KS6_UDUK_SHIFT (29U) -#define S50_ELS_KS6_KS6_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UDUK_SHIFT)) & S50_ELS_KS6_KS6_UDUK_MASK) - -#define S50_ELS_KS6_KS6_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS6_KS6_UPPROT_SHIFT (30U) -#define S50_ELS_KS6_KS6_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS6_KS6_UPPROT_SHIFT)) & S50_ELS_KS6_KS6_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS7 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS7_KS7_KSIZE_MASK (0x3U) -#define S50_ELS_KS7_KS7_KSIZE_SHIFT (0U) -/*! KS7_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS7_KS7_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_KSIZE_SHIFT)) & S50_ELS_KS7_KS7_KSIZE_MASK) - -#define S50_ELS_KS7_KS7_KACT_MASK (0x20U) -#define S50_ELS_KS7_KS7_KACT_SHIFT (5U) -#define S50_ELS_KS7_KS7_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_KACT_SHIFT)) & S50_ELS_KS7_KS7_KACT_MASK) - -#define S50_ELS_KS7_KS7_KBASE_MASK (0x40U) -#define S50_ELS_KS7_KS7_KBASE_SHIFT (6U) -#define S50_ELS_KS7_KS7_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_KBASE_SHIFT)) & S50_ELS_KS7_KS7_KBASE_MASK) - -#define S50_ELS_KS7_KS7_FGP_MASK (0x80U) -#define S50_ELS_KS7_KS7_FGP_SHIFT (7U) -#define S50_ELS_KS7_KS7_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_FGP_SHIFT)) & S50_ELS_KS7_KS7_FGP_MASK) - -#define S50_ELS_KS7_KS7_FRTN_MASK (0x100U) -#define S50_ELS_KS7_KS7_FRTN_SHIFT (8U) -#define S50_ELS_KS7_KS7_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_FRTN_SHIFT)) & S50_ELS_KS7_KS7_FRTN_MASK) - -#define S50_ELS_KS7_KS7_FHWO_MASK (0x200U) -#define S50_ELS_KS7_KS7_FHWO_SHIFT (9U) -#define S50_ELS_KS7_KS7_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_FHWO_SHIFT)) & S50_ELS_KS7_KS7_FHWO_MASK) - -#define S50_ELS_KS7_KS7_UKPUK_MASK (0x800U) -#define S50_ELS_KS7_KS7_UKPUK_SHIFT (11U) -#define S50_ELS_KS7_KS7_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UKPUK_SHIFT)) & S50_ELS_KS7_KS7_UKPUK_MASK) - -#define S50_ELS_KS7_KS7_UTECDH_MASK (0x1000U) -#define S50_ELS_KS7_KS7_UTECDH_SHIFT (12U) -#define S50_ELS_KS7_KS7_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UTECDH_SHIFT)) & S50_ELS_KS7_KS7_UTECDH_MASK) - -#define S50_ELS_KS7_KS7_UCMAC_MASK (0x2000U) -#define S50_ELS_KS7_KS7_UCMAC_SHIFT (13U) -#define S50_ELS_KS7_KS7_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UCMAC_SHIFT)) & S50_ELS_KS7_KS7_UCMAC_MASK) - -#define S50_ELS_KS7_KS7_UKSK_MASK (0x4000U) -#define S50_ELS_KS7_KS7_UKSK_SHIFT (14U) -#define S50_ELS_KS7_KS7_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UKSK_SHIFT)) & S50_ELS_KS7_KS7_UKSK_MASK) - -#define S50_ELS_KS7_KS7_URTF_MASK (0x8000U) -#define S50_ELS_KS7_KS7_URTF_SHIFT (15U) -#define S50_ELS_KS7_KS7_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_URTF_SHIFT)) & S50_ELS_KS7_KS7_URTF_MASK) - -#define S50_ELS_KS7_KS7_UCKDF_MASK (0x10000U) -#define S50_ELS_KS7_KS7_UCKDF_SHIFT (16U) -#define S50_ELS_KS7_KS7_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UCKDF_SHIFT)) & S50_ELS_KS7_KS7_UCKDF_MASK) - -#define S50_ELS_KS7_KS7_UHKDF_MASK (0x20000U) -#define S50_ELS_KS7_KS7_UHKDF_SHIFT (17U) -#define S50_ELS_KS7_KS7_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UHKDF_SHIFT)) & S50_ELS_KS7_KS7_UHKDF_MASK) - -#define S50_ELS_KS7_KS7_UECSG_MASK (0x40000U) -#define S50_ELS_KS7_KS7_UECSG_SHIFT (18U) -#define S50_ELS_KS7_KS7_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UECSG_SHIFT)) & S50_ELS_KS7_KS7_UECSG_MASK) - -#define S50_ELS_KS7_KS7_UECDH_MASK (0x80000U) -#define S50_ELS_KS7_KS7_UECDH_SHIFT (19U) -#define S50_ELS_KS7_KS7_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UECDH_SHIFT)) & S50_ELS_KS7_KS7_UECDH_MASK) - -#define S50_ELS_KS7_KS7_UAES_MASK (0x100000U) -#define S50_ELS_KS7_KS7_UAES_SHIFT (20U) -#define S50_ELS_KS7_KS7_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UAES_SHIFT)) & S50_ELS_KS7_KS7_UAES_MASK) - -#define S50_ELS_KS7_KS7_UHMAC_MASK (0x200000U) -#define S50_ELS_KS7_KS7_UHMAC_SHIFT (21U) -#define S50_ELS_KS7_KS7_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UHMAC_SHIFT)) & S50_ELS_KS7_KS7_UHMAC_MASK) - -#define S50_ELS_KS7_KS7_UKWK_MASK (0x400000U) -#define S50_ELS_KS7_KS7_UKWK_SHIFT (22U) -#define S50_ELS_KS7_KS7_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UKWK_SHIFT)) & S50_ELS_KS7_KS7_UKWK_MASK) - -#define S50_ELS_KS7_KS7_UKUOK_MASK (0x800000U) -#define S50_ELS_KS7_KS7_UKUOK_SHIFT (23U) -#define S50_ELS_KS7_KS7_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UKUOK_SHIFT)) & S50_ELS_KS7_KS7_UKUOK_MASK) - -#define S50_ELS_KS7_KS7_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS7_KS7_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS7_KS7_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UTLSPMS_SHIFT)) & S50_ELS_KS7_KS7_UTLSPMS_MASK) - -#define S50_ELS_KS7_KS7_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS7_KS7_UTLSMS_SHIFT (25U) -#define S50_ELS_KS7_KS7_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UTLSMS_SHIFT)) & S50_ELS_KS7_KS7_UTLSMS_MASK) - -#define S50_ELS_KS7_KS7_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS7_KS7_UKGSRC_SHIFT (26U) -#define S50_ELS_KS7_KS7_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UKGSRC_SHIFT)) & S50_ELS_KS7_KS7_UKGSRC_MASK) - -#define S50_ELS_KS7_KS7_UHWO_MASK (0x8000000U) -#define S50_ELS_KS7_KS7_UHWO_SHIFT (27U) -#define S50_ELS_KS7_KS7_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UHWO_SHIFT)) & S50_ELS_KS7_KS7_UHWO_MASK) - -#define S50_ELS_KS7_KS7_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS7_KS7_UWRPOK_SHIFT (28U) -#define S50_ELS_KS7_KS7_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UWRPOK_SHIFT)) & S50_ELS_KS7_KS7_UWRPOK_MASK) - -#define S50_ELS_KS7_KS7_UDUK_MASK (0x20000000U) -#define S50_ELS_KS7_KS7_UDUK_SHIFT (29U) -#define S50_ELS_KS7_KS7_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UDUK_SHIFT)) & S50_ELS_KS7_KS7_UDUK_MASK) - -#define S50_ELS_KS7_KS7_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS7_KS7_UPPROT_SHIFT (30U) -#define S50_ELS_KS7_KS7_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS7_KS7_UPPROT_SHIFT)) & S50_ELS_KS7_KS7_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS8 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS8_KS8_KSIZE_MASK (0x3U) -#define S50_ELS_KS8_KS8_KSIZE_SHIFT (0U) -/*! KS8_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS8_KS8_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_KSIZE_SHIFT)) & S50_ELS_KS8_KS8_KSIZE_MASK) - -#define S50_ELS_KS8_KS8_KACT_MASK (0x20U) -#define S50_ELS_KS8_KS8_KACT_SHIFT (5U) -#define S50_ELS_KS8_KS8_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_KACT_SHIFT)) & S50_ELS_KS8_KS8_KACT_MASK) - -#define S50_ELS_KS8_KS8_KBASE_MASK (0x40U) -#define S50_ELS_KS8_KS8_KBASE_SHIFT (6U) -#define S50_ELS_KS8_KS8_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_KBASE_SHIFT)) & S50_ELS_KS8_KS8_KBASE_MASK) - -#define S50_ELS_KS8_KS8_FGP_MASK (0x80U) -#define S50_ELS_KS8_KS8_FGP_SHIFT (7U) -#define S50_ELS_KS8_KS8_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_FGP_SHIFT)) & S50_ELS_KS8_KS8_FGP_MASK) - -#define S50_ELS_KS8_KS8_FRTN_MASK (0x100U) -#define S50_ELS_KS8_KS8_FRTN_SHIFT (8U) -#define S50_ELS_KS8_KS8_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_FRTN_SHIFT)) & S50_ELS_KS8_KS8_FRTN_MASK) - -#define S50_ELS_KS8_KS8_FHWO_MASK (0x200U) -#define S50_ELS_KS8_KS8_FHWO_SHIFT (9U) -#define S50_ELS_KS8_KS8_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_FHWO_SHIFT)) & S50_ELS_KS8_KS8_FHWO_MASK) - -#define S50_ELS_KS8_KS8_UKPUK_MASK (0x800U) -#define S50_ELS_KS8_KS8_UKPUK_SHIFT (11U) -#define S50_ELS_KS8_KS8_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UKPUK_SHIFT)) & S50_ELS_KS8_KS8_UKPUK_MASK) - -#define S50_ELS_KS8_KS8_UTECDH_MASK (0x1000U) -#define S50_ELS_KS8_KS8_UTECDH_SHIFT (12U) -#define S50_ELS_KS8_KS8_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UTECDH_SHIFT)) & S50_ELS_KS8_KS8_UTECDH_MASK) - -#define S50_ELS_KS8_KS8_UCMAC_MASK (0x2000U) -#define S50_ELS_KS8_KS8_UCMAC_SHIFT (13U) -#define S50_ELS_KS8_KS8_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UCMAC_SHIFT)) & S50_ELS_KS8_KS8_UCMAC_MASK) - -#define S50_ELS_KS8_KS8_UKSK_MASK (0x4000U) -#define S50_ELS_KS8_KS8_UKSK_SHIFT (14U) -#define S50_ELS_KS8_KS8_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UKSK_SHIFT)) & S50_ELS_KS8_KS8_UKSK_MASK) - -#define S50_ELS_KS8_KS8_URTF_MASK (0x8000U) -#define S50_ELS_KS8_KS8_URTF_SHIFT (15U) -#define S50_ELS_KS8_KS8_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_URTF_SHIFT)) & S50_ELS_KS8_KS8_URTF_MASK) - -#define S50_ELS_KS8_KS8_UCKDF_MASK (0x10000U) -#define S50_ELS_KS8_KS8_UCKDF_SHIFT (16U) -#define S50_ELS_KS8_KS8_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UCKDF_SHIFT)) & S50_ELS_KS8_KS8_UCKDF_MASK) - -#define S50_ELS_KS8_KS8_UHKDF_MASK (0x20000U) -#define S50_ELS_KS8_KS8_UHKDF_SHIFT (17U) -#define S50_ELS_KS8_KS8_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UHKDF_SHIFT)) & S50_ELS_KS8_KS8_UHKDF_MASK) - -#define S50_ELS_KS8_KS8_UECSG_MASK (0x40000U) -#define S50_ELS_KS8_KS8_UECSG_SHIFT (18U) -#define S50_ELS_KS8_KS8_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UECSG_SHIFT)) & S50_ELS_KS8_KS8_UECSG_MASK) - -#define S50_ELS_KS8_KS8_UECDH_MASK (0x80000U) -#define S50_ELS_KS8_KS8_UECDH_SHIFT (19U) -#define S50_ELS_KS8_KS8_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UECDH_SHIFT)) & S50_ELS_KS8_KS8_UECDH_MASK) - -#define S50_ELS_KS8_KS8_UAES_MASK (0x100000U) -#define S50_ELS_KS8_KS8_UAES_SHIFT (20U) -#define S50_ELS_KS8_KS8_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UAES_SHIFT)) & S50_ELS_KS8_KS8_UAES_MASK) - -#define S50_ELS_KS8_KS8_UHMAC_MASK (0x200000U) -#define S50_ELS_KS8_KS8_UHMAC_SHIFT (21U) -#define S50_ELS_KS8_KS8_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UHMAC_SHIFT)) & S50_ELS_KS8_KS8_UHMAC_MASK) - -#define S50_ELS_KS8_KS8_UKWK_MASK (0x400000U) -#define S50_ELS_KS8_KS8_UKWK_SHIFT (22U) -#define S50_ELS_KS8_KS8_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UKWK_SHIFT)) & S50_ELS_KS8_KS8_UKWK_MASK) - -#define S50_ELS_KS8_KS8_UKUOK_MASK (0x800000U) -#define S50_ELS_KS8_KS8_UKUOK_SHIFT (23U) -#define S50_ELS_KS8_KS8_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UKUOK_SHIFT)) & S50_ELS_KS8_KS8_UKUOK_MASK) - -#define S50_ELS_KS8_KS8_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS8_KS8_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS8_KS8_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UTLSPMS_SHIFT)) & S50_ELS_KS8_KS8_UTLSPMS_MASK) - -#define S50_ELS_KS8_KS8_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS8_KS8_UTLSMS_SHIFT (25U) -#define S50_ELS_KS8_KS8_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UTLSMS_SHIFT)) & S50_ELS_KS8_KS8_UTLSMS_MASK) - -#define S50_ELS_KS8_KS8_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS8_KS8_UKGSRC_SHIFT (26U) -#define S50_ELS_KS8_KS8_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UKGSRC_SHIFT)) & S50_ELS_KS8_KS8_UKGSRC_MASK) - -#define S50_ELS_KS8_KS8_UHWO_MASK (0x8000000U) -#define S50_ELS_KS8_KS8_UHWO_SHIFT (27U) -#define S50_ELS_KS8_KS8_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UHWO_SHIFT)) & S50_ELS_KS8_KS8_UHWO_MASK) - -#define S50_ELS_KS8_KS8_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS8_KS8_UWRPOK_SHIFT (28U) -#define S50_ELS_KS8_KS8_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UWRPOK_SHIFT)) & S50_ELS_KS8_KS8_UWRPOK_MASK) - -#define S50_ELS_KS8_KS8_UDUK_MASK (0x20000000U) -#define S50_ELS_KS8_KS8_UDUK_SHIFT (29U) -#define S50_ELS_KS8_KS8_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UDUK_SHIFT)) & S50_ELS_KS8_KS8_UDUK_MASK) - -#define S50_ELS_KS8_KS8_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS8_KS8_UPPROT_SHIFT (30U) -#define S50_ELS_KS8_KS8_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS8_KS8_UPPROT_SHIFT)) & S50_ELS_KS8_KS8_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS9 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS9_KS9_KSIZE_MASK (0x3U) -#define S50_ELS_KS9_KS9_KSIZE_SHIFT (0U) -/*! KS9_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS9_KS9_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_KSIZE_SHIFT)) & S50_ELS_KS9_KS9_KSIZE_MASK) - -#define S50_ELS_KS9_KS9_KACT_MASK (0x20U) -#define S50_ELS_KS9_KS9_KACT_SHIFT (5U) -#define S50_ELS_KS9_KS9_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_KACT_SHIFT)) & S50_ELS_KS9_KS9_KACT_MASK) - -#define S50_ELS_KS9_KS9_KBASE_MASK (0x40U) -#define S50_ELS_KS9_KS9_KBASE_SHIFT (6U) -#define S50_ELS_KS9_KS9_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_KBASE_SHIFT)) & S50_ELS_KS9_KS9_KBASE_MASK) - -#define S50_ELS_KS9_KS9_FGP_MASK (0x80U) -#define S50_ELS_KS9_KS9_FGP_SHIFT (7U) -#define S50_ELS_KS9_KS9_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_FGP_SHIFT)) & S50_ELS_KS9_KS9_FGP_MASK) - -#define S50_ELS_KS9_KS9_FRTN_MASK (0x100U) -#define S50_ELS_KS9_KS9_FRTN_SHIFT (8U) -#define S50_ELS_KS9_KS9_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_FRTN_SHIFT)) & S50_ELS_KS9_KS9_FRTN_MASK) - -#define S50_ELS_KS9_KS9_FHWO_MASK (0x200U) -#define S50_ELS_KS9_KS9_FHWO_SHIFT (9U) -#define S50_ELS_KS9_KS9_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_FHWO_SHIFT)) & S50_ELS_KS9_KS9_FHWO_MASK) - -#define S50_ELS_KS9_KS9_UKPUK_MASK (0x800U) -#define S50_ELS_KS9_KS9_UKPUK_SHIFT (11U) -#define S50_ELS_KS9_KS9_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UKPUK_SHIFT)) & S50_ELS_KS9_KS9_UKPUK_MASK) - -#define S50_ELS_KS9_KS9_UTECDH_MASK (0x1000U) -#define S50_ELS_KS9_KS9_UTECDH_SHIFT (12U) -#define S50_ELS_KS9_KS9_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UTECDH_SHIFT)) & S50_ELS_KS9_KS9_UTECDH_MASK) - -#define S50_ELS_KS9_KS9_UCMAC_MASK (0x2000U) -#define S50_ELS_KS9_KS9_UCMAC_SHIFT (13U) -#define S50_ELS_KS9_KS9_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UCMAC_SHIFT)) & S50_ELS_KS9_KS9_UCMAC_MASK) - -#define S50_ELS_KS9_KS9_UKSK_MASK (0x4000U) -#define S50_ELS_KS9_KS9_UKSK_SHIFT (14U) -#define S50_ELS_KS9_KS9_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UKSK_SHIFT)) & S50_ELS_KS9_KS9_UKSK_MASK) - -#define S50_ELS_KS9_KS9_URTF_MASK (0x8000U) -#define S50_ELS_KS9_KS9_URTF_SHIFT (15U) -#define S50_ELS_KS9_KS9_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_URTF_SHIFT)) & S50_ELS_KS9_KS9_URTF_MASK) - -#define S50_ELS_KS9_KS9_UCKDF_MASK (0x10000U) -#define S50_ELS_KS9_KS9_UCKDF_SHIFT (16U) -#define S50_ELS_KS9_KS9_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UCKDF_SHIFT)) & S50_ELS_KS9_KS9_UCKDF_MASK) - -#define S50_ELS_KS9_KS9_UHKDF_MASK (0x20000U) -#define S50_ELS_KS9_KS9_UHKDF_SHIFT (17U) -#define S50_ELS_KS9_KS9_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UHKDF_SHIFT)) & S50_ELS_KS9_KS9_UHKDF_MASK) - -#define S50_ELS_KS9_KS9_UECSG_MASK (0x40000U) -#define S50_ELS_KS9_KS9_UECSG_SHIFT (18U) -#define S50_ELS_KS9_KS9_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UECSG_SHIFT)) & S50_ELS_KS9_KS9_UECSG_MASK) - -#define S50_ELS_KS9_KS9_UECDH_MASK (0x80000U) -#define S50_ELS_KS9_KS9_UECDH_SHIFT (19U) -#define S50_ELS_KS9_KS9_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UECDH_SHIFT)) & S50_ELS_KS9_KS9_UECDH_MASK) - -#define S50_ELS_KS9_KS9_UAES_MASK (0x100000U) -#define S50_ELS_KS9_KS9_UAES_SHIFT (20U) -#define S50_ELS_KS9_KS9_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UAES_SHIFT)) & S50_ELS_KS9_KS9_UAES_MASK) - -#define S50_ELS_KS9_KS9_UHMAC_MASK (0x200000U) -#define S50_ELS_KS9_KS9_UHMAC_SHIFT (21U) -#define S50_ELS_KS9_KS9_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UHMAC_SHIFT)) & S50_ELS_KS9_KS9_UHMAC_MASK) - -#define S50_ELS_KS9_KS9_UKWK_MASK (0x400000U) -#define S50_ELS_KS9_KS9_UKWK_SHIFT (22U) -#define S50_ELS_KS9_KS9_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UKWK_SHIFT)) & S50_ELS_KS9_KS9_UKWK_MASK) - -#define S50_ELS_KS9_KS9_UKUOK_MASK (0x800000U) -#define S50_ELS_KS9_KS9_UKUOK_SHIFT (23U) -#define S50_ELS_KS9_KS9_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UKUOK_SHIFT)) & S50_ELS_KS9_KS9_UKUOK_MASK) - -#define S50_ELS_KS9_KS9_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS9_KS9_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS9_KS9_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UTLSPMS_SHIFT)) & S50_ELS_KS9_KS9_UTLSPMS_MASK) - -#define S50_ELS_KS9_KS9_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS9_KS9_UTLSMS_SHIFT (25U) -#define S50_ELS_KS9_KS9_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UTLSMS_SHIFT)) & S50_ELS_KS9_KS9_UTLSMS_MASK) - -#define S50_ELS_KS9_KS9_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS9_KS9_UKGSRC_SHIFT (26U) -#define S50_ELS_KS9_KS9_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UKGSRC_SHIFT)) & S50_ELS_KS9_KS9_UKGSRC_MASK) - -#define S50_ELS_KS9_KS9_UHWO_MASK (0x8000000U) -#define S50_ELS_KS9_KS9_UHWO_SHIFT (27U) -#define S50_ELS_KS9_KS9_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UHWO_SHIFT)) & S50_ELS_KS9_KS9_UHWO_MASK) - -#define S50_ELS_KS9_KS9_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS9_KS9_UWRPOK_SHIFT (28U) -#define S50_ELS_KS9_KS9_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UWRPOK_SHIFT)) & S50_ELS_KS9_KS9_UWRPOK_MASK) - -#define S50_ELS_KS9_KS9_UDUK_MASK (0x20000000U) -#define S50_ELS_KS9_KS9_UDUK_SHIFT (29U) -#define S50_ELS_KS9_KS9_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UDUK_SHIFT)) & S50_ELS_KS9_KS9_UDUK_MASK) - -#define S50_ELS_KS9_KS9_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS9_KS9_UPPROT_SHIFT (30U) -#define S50_ELS_KS9_KS9_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS9_KS9_UPPROT_SHIFT)) & S50_ELS_KS9_KS9_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS10 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS10_KS10_KSIZE_MASK (0x3U) -#define S50_ELS_KS10_KS10_KSIZE_SHIFT (0U) -/*! KS10_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS10_KS10_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_KSIZE_SHIFT)) & S50_ELS_KS10_KS10_KSIZE_MASK) - -#define S50_ELS_KS10_KS10_KACT_MASK (0x20U) -#define S50_ELS_KS10_KS10_KACT_SHIFT (5U) -#define S50_ELS_KS10_KS10_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_KACT_SHIFT)) & S50_ELS_KS10_KS10_KACT_MASK) - -#define S50_ELS_KS10_KS10_KBASE_MASK (0x40U) -#define S50_ELS_KS10_KS10_KBASE_SHIFT (6U) -#define S50_ELS_KS10_KS10_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_KBASE_SHIFT)) & S50_ELS_KS10_KS10_KBASE_MASK) - -#define S50_ELS_KS10_KS10_FGP_MASK (0x80U) -#define S50_ELS_KS10_KS10_FGP_SHIFT (7U) -#define S50_ELS_KS10_KS10_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_FGP_SHIFT)) & S50_ELS_KS10_KS10_FGP_MASK) - -#define S50_ELS_KS10_KS10_FRTN_MASK (0x100U) -#define S50_ELS_KS10_KS10_FRTN_SHIFT (8U) -#define S50_ELS_KS10_KS10_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_FRTN_SHIFT)) & S50_ELS_KS10_KS10_FRTN_MASK) - -#define S50_ELS_KS10_KS10_FHWO_MASK (0x200U) -#define S50_ELS_KS10_KS10_FHWO_SHIFT (9U) -#define S50_ELS_KS10_KS10_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_FHWO_SHIFT)) & S50_ELS_KS10_KS10_FHWO_MASK) - -#define S50_ELS_KS10_KS10_UKPUK_MASK (0x800U) -#define S50_ELS_KS10_KS10_UKPUK_SHIFT (11U) -#define S50_ELS_KS10_KS10_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UKPUK_SHIFT)) & S50_ELS_KS10_KS10_UKPUK_MASK) - -#define S50_ELS_KS10_KS10_UTECDH_MASK (0x1000U) -#define S50_ELS_KS10_KS10_UTECDH_SHIFT (12U) -#define S50_ELS_KS10_KS10_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UTECDH_SHIFT)) & S50_ELS_KS10_KS10_UTECDH_MASK) - -#define S50_ELS_KS10_KS10_UCMAC_MASK (0x2000U) -#define S50_ELS_KS10_KS10_UCMAC_SHIFT (13U) -#define S50_ELS_KS10_KS10_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UCMAC_SHIFT)) & S50_ELS_KS10_KS10_UCMAC_MASK) - -#define S50_ELS_KS10_KS10_UKSK_MASK (0x4000U) -#define S50_ELS_KS10_KS10_UKSK_SHIFT (14U) -#define S50_ELS_KS10_KS10_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UKSK_SHIFT)) & S50_ELS_KS10_KS10_UKSK_MASK) - -#define S50_ELS_KS10_KS10_URTF_MASK (0x8000U) -#define S50_ELS_KS10_KS10_URTF_SHIFT (15U) -#define S50_ELS_KS10_KS10_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_URTF_SHIFT)) & S50_ELS_KS10_KS10_URTF_MASK) - -#define S50_ELS_KS10_KS10_UCKDF_MASK (0x10000U) -#define S50_ELS_KS10_KS10_UCKDF_SHIFT (16U) -#define S50_ELS_KS10_KS10_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UCKDF_SHIFT)) & S50_ELS_KS10_KS10_UCKDF_MASK) - -#define S50_ELS_KS10_KS10_UHKDF_MASK (0x20000U) -#define S50_ELS_KS10_KS10_UHKDF_SHIFT (17U) -#define S50_ELS_KS10_KS10_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UHKDF_SHIFT)) & S50_ELS_KS10_KS10_UHKDF_MASK) - -#define S50_ELS_KS10_KS10_UECSG_MASK (0x40000U) -#define S50_ELS_KS10_KS10_UECSG_SHIFT (18U) -#define S50_ELS_KS10_KS10_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UECSG_SHIFT)) & S50_ELS_KS10_KS10_UECSG_MASK) - -#define S50_ELS_KS10_KS10_UECDH_MASK (0x80000U) -#define S50_ELS_KS10_KS10_UECDH_SHIFT (19U) -#define S50_ELS_KS10_KS10_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UECDH_SHIFT)) & S50_ELS_KS10_KS10_UECDH_MASK) - -#define S50_ELS_KS10_KS10_UAES_MASK (0x100000U) -#define S50_ELS_KS10_KS10_UAES_SHIFT (20U) -#define S50_ELS_KS10_KS10_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UAES_SHIFT)) & S50_ELS_KS10_KS10_UAES_MASK) - -#define S50_ELS_KS10_KS10_UHMAC_MASK (0x200000U) -#define S50_ELS_KS10_KS10_UHMAC_SHIFT (21U) -#define S50_ELS_KS10_KS10_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UHMAC_SHIFT)) & S50_ELS_KS10_KS10_UHMAC_MASK) - -#define S50_ELS_KS10_KS10_UKWK_MASK (0x400000U) -#define S50_ELS_KS10_KS10_UKWK_SHIFT (22U) -#define S50_ELS_KS10_KS10_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UKWK_SHIFT)) & S50_ELS_KS10_KS10_UKWK_MASK) - -#define S50_ELS_KS10_KS10_UKUOK_MASK (0x800000U) -#define S50_ELS_KS10_KS10_UKUOK_SHIFT (23U) -#define S50_ELS_KS10_KS10_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UKUOK_SHIFT)) & S50_ELS_KS10_KS10_UKUOK_MASK) - -#define S50_ELS_KS10_KS10_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS10_KS10_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS10_KS10_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UTLSPMS_SHIFT)) & S50_ELS_KS10_KS10_UTLSPMS_MASK) - -#define S50_ELS_KS10_KS10_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS10_KS10_UTLSMS_SHIFT (25U) -#define S50_ELS_KS10_KS10_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UTLSMS_SHIFT)) & S50_ELS_KS10_KS10_UTLSMS_MASK) - -#define S50_ELS_KS10_KS10_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS10_KS10_UKGSRC_SHIFT (26U) -#define S50_ELS_KS10_KS10_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UKGSRC_SHIFT)) & S50_ELS_KS10_KS10_UKGSRC_MASK) - -#define S50_ELS_KS10_KS10_UHWO_MASK (0x8000000U) -#define S50_ELS_KS10_KS10_UHWO_SHIFT (27U) -#define S50_ELS_KS10_KS10_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UHWO_SHIFT)) & S50_ELS_KS10_KS10_UHWO_MASK) - -#define S50_ELS_KS10_KS10_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS10_KS10_UWRPOK_SHIFT (28U) -#define S50_ELS_KS10_KS10_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UWRPOK_SHIFT)) & S50_ELS_KS10_KS10_UWRPOK_MASK) - -#define S50_ELS_KS10_KS10_UDUK_MASK (0x20000000U) -#define S50_ELS_KS10_KS10_UDUK_SHIFT (29U) -#define S50_ELS_KS10_KS10_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UDUK_SHIFT)) & S50_ELS_KS10_KS10_UDUK_MASK) - -#define S50_ELS_KS10_KS10_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS10_KS10_UPPROT_SHIFT (30U) -#define S50_ELS_KS10_KS10_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS10_KS10_UPPROT_SHIFT)) & S50_ELS_KS10_KS10_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS11 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS11_KS11_KSIZE_MASK (0x3U) -#define S50_ELS_KS11_KS11_KSIZE_SHIFT (0U) -/*! KS11_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS11_KS11_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_KSIZE_SHIFT)) & S50_ELS_KS11_KS11_KSIZE_MASK) - -#define S50_ELS_KS11_KS11_KACT_MASK (0x20U) -#define S50_ELS_KS11_KS11_KACT_SHIFT (5U) -#define S50_ELS_KS11_KS11_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_KACT_SHIFT)) & S50_ELS_KS11_KS11_KACT_MASK) - -#define S50_ELS_KS11_KS11_KBASE_MASK (0x40U) -#define S50_ELS_KS11_KS11_KBASE_SHIFT (6U) -#define S50_ELS_KS11_KS11_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_KBASE_SHIFT)) & S50_ELS_KS11_KS11_KBASE_MASK) - -#define S50_ELS_KS11_KS11_FGP_MASK (0x80U) -#define S50_ELS_KS11_KS11_FGP_SHIFT (7U) -#define S50_ELS_KS11_KS11_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_FGP_SHIFT)) & S50_ELS_KS11_KS11_FGP_MASK) - -#define S50_ELS_KS11_KS11_FRTN_MASK (0x100U) -#define S50_ELS_KS11_KS11_FRTN_SHIFT (8U) -#define S50_ELS_KS11_KS11_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_FRTN_SHIFT)) & S50_ELS_KS11_KS11_FRTN_MASK) - -#define S50_ELS_KS11_KS11_FHWO_MASK (0x200U) -#define S50_ELS_KS11_KS11_FHWO_SHIFT (9U) -#define S50_ELS_KS11_KS11_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_FHWO_SHIFT)) & S50_ELS_KS11_KS11_FHWO_MASK) - -#define S50_ELS_KS11_KS11_UKPUK_MASK (0x800U) -#define S50_ELS_KS11_KS11_UKPUK_SHIFT (11U) -#define S50_ELS_KS11_KS11_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UKPUK_SHIFT)) & S50_ELS_KS11_KS11_UKPUK_MASK) - -#define S50_ELS_KS11_KS11_UTECDH_MASK (0x1000U) -#define S50_ELS_KS11_KS11_UTECDH_SHIFT (12U) -#define S50_ELS_KS11_KS11_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UTECDH_SHIFT)) & S50_ELS_KS11_KS11_UTECDH_MASK) - -#define S50_ELS_KS11_KS11_UCMAC_MASK (0x2000U) -#define S50_ELS_KS11_KS11_UCMAC_SHIFT (13U) -#define S50_ELS_KS11_KS11_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UCMAC_SHIFT)) & S50_ELS_KS11_KS11_UCMAC_MASK) - -#define S50_ELS_KS11_KS11_UKSK_MASK (0x4000U) -#define S50_ELS_KS11_KS11_UKSK_SHIFT (14U) -#define S50_ELS_KS11_KS11_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UKSK_SHIFT)) & S50_ELS_KS11_KS11_UKSK_MASK) - -#define S50_ELS_KS11_KS11_URTF_MASK (0x8000U) -#define S50_ELS_KS11_KS11_URTF_SHIFT (15U) -#define S50_ELS_KS11_KS11_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_URTF_SHIFT)) & S50_ELS_KS11_KS11_URTF_MASK) - -#define S50_ELS_KS11_KS11_UCKDF_MASK (0x10000U) -#define S50_ELS_KS11_KS11_UCKDF_SHIFT (16U) -#define S50_ELS_KS11_KS11_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UCKDF_SHIFT)) & S50_ELS_KS11_KS11_UCKDF_MASK) - -#define S50_ELS_KS11_KS11_UHKDF_MASK (0x20000U) -#define S50_ELS_KS11_KS11_UHKDF_SHIFT (17U) -#define S50_ELS_KS11_KS11_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UHKDF_SHIFT)) & S50_ELS_KS11_KS11_UHKDF_MASK) - -#define S50_ELS_KS11_KS11_UECSG_MASK (0x40000U) -#define S50_ELS_KS11_KS11_UECSG_SHIFT (18U) -#define S50_ELS_KS11_KS11_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UECSG_SHIFT)) & S50_ELS_KS11_KS11_UECSG_MASK) - -#define S50_ELS_KS11_KS11_UECDH_MASK (0x80000U) -#define S50_ELS_KS11_KS11_UECDH_SHIFT (19U) -#define S50_ELS_KS11_KS11_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UECDH_SHIFT)) & S50_ELS_KS11_KS11_UECDH_MASK) - -#define S50_ELS_KS11_KS11_UAES_MASK (0x100000U) -#define S50_ELS_KS11_KS11_UAES_SHIFT (20U) -#define S50_ELS_KS11_KS11_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UAES_SHIFT)) & S50_ELS_KS11_KS11_UAES_MASK) - -#define S50_ELS_KS11_KS11_UHMAC_MASK (0x200000U) -#define S50_ELS_KS11_KS11_UHMAC_SHIFT (21U) -#define S50_ELS_KS11_KS11_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UHMAC_SHIFT)) & S50_ELS_KS11_KS11_UHMAC_MASK) - -#define S50_ELS_KS11_KS11_UKWK_MASK (0x400000U) -#define S50_ELS_KS11_KS11_UKWK_SHIFT (22U) -#define S50_ELS_KS11_KS11_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UKWK_SHIFT)) & S50_ELS_KS11_KS11_UKWK_MASK) - -#define S50_ELS_KS11_KS11_UKUOK_MASK (0x800000U) -#define S50_ELS_KS11_KS11_UKUOK_SHIFT (23U) -#define S50_ELS_KS11_KS11_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UKUOK_SHIFT)) & S50_ELS_KS11_KS11_UKUOK_MASK) - -#define S50_ELS_KS11_KS11_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS11_KS11_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS11_KS11_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UTLSPMS_SHIFT)) & S50_ELS_KS11_KS11_UTLSPMS_MASK) - -#define S50_ELS_KS11_KS11_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS11_KS11_UTLSMS_SHIFT (25U) -#define S50_ELS_KS11_KS11_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UTLSMS_SHIFT)) & S50_ELS_KS11_KS11_UTLSMS_MASK) - -#define S50_ELS_KS11_KS11_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS11_KS11_UKGSRC_SHIFT (26U) -#define S50_ELS_KS11_KS11_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UKGSRC_SHIFT)) & S50_ELS_KS11_KS11_UKGSRC_MASK) - -#define S50_ELS_KS11_KS11_UHWO_MASK (0x8000000U) -#define S50_ELS_KS11_KS11_UHWO_SHIFT (27U) -#define S50_ELS_KS11_KS11_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UHWO_SHIFT)) & S50_ELS_KS11_KS11_UHWO_MASK) - -#define S50_ELS_KS11_KS11_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS11_KS11_UWRPOK_SHIFT (28U) -#define S50_ELS_KS11_KS11_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UWRPOK_SHIFT)) & S50_ELS_KS11_KS11_UWRPOK_MASK) - -#define S50_ELS_KS11_KS11_UDUK_MASK (0x20000000U) -#define S50_ELS_KS11_KS11_UDUK_SHIFT (29U) -#define S50_ELS_KS11_KS11_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UDUK_SHIFT)) & S50_ELS_KS11_KS11_UDUK_MASK) - -#define S50_ELS_KS11_KS11_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS11_KS11_UPPROT_SHIFT (30U) -#define S50_ELS_KS11_KS11_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS11_KS11_UPPROT_SHIFT)) & S50_ELS_KS11_KS11_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS12 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS12_KS12_KSIZE_MASK (0x3U) -#define S50_ELS_KS12_KS12_KSIZE_SHIFT (0U) -/*! KS12_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS12_KS12_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_KSIZE_SHIFT)) & S50_ELS_KS12_KS12_KSIZE_MASK) - -#define S50_ELS_KS12_KS12_KACT_MASK (0x20U) -#define S50_ELS_KS12_KS12_KACT_SHIFT (5U) -#define S50_ELS_KS12_KS12_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_KACT_SHIFT)) & S50_ELS_KS12_KS12_KACT_MASK) - -#define S50_ELS_KS12_KS12_KBASE_MASK (0x40U) -#define S50_ELS_KS12_KS12_KBASE_SHIFT (6U) -#define S50_ELS_KS12_KS12_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_KBASE_SHIFT)) & S50_ELS_KS12_KS12_KBASE_MASK) - -#define S50_ELS_KS12_KS12_FGP_MASK (0x80U) -#define S50_ELS_KS12_KS12_FGP_SHIFT (7U) -#define S50_ELS_KS12_KS12_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_FGP_SHIFT)) & S50_ELS_KS12_KS12_FGP_MASK) - -#define S50_ELS_KS12_KS12_FRTN_MASK (0x100U) -#define S50_ELS_KS12_KS12_FRTN_SHIFT (8U) -#define S50_ELS_KS12_KS12_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_FRTN_SHIFT)) & S50_ELS_KS12_KS12_FRTN_MASK) - -#define S50_ELS_KS12_KS12_FHWO_MASK (0x200U) -#define S50_ELS_KS12_KS12_FHWO_SHIFT (9U) -#define S50_ELS_KS12_KS12_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_FHWO_SHIFT)) & S50_ELS_KS12_KS12_FHWO_MASK) - -#define S50_ELS_KS12_KS12_UKPUK_MASK (0x800U) -#define S50_ELS_KS12_KS12_UKPUK_SHIFT (11U) -#define S50_ELS_KS12_KS12_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UKPUK_SHIFT)) & S50_ELS_KS12_KS12_UKPUK_MASK) - -#define S50_ELS_KS12_KS12_UTECDH_MASK (0x1000U) -#define S50_ELS_KS12_KS12_UTECDH_SHIFT (12U) -#define S50_ELS_KS12_KS12_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UTECDH_SHIFT)) & S50_ELS_KS12_KS12_UTECDH_MASK) - -#define S50_ELS_KS12_KS12_UCMAC_MASK (0x2000U) -#define S50_ELS_KS12_KS12_UCMAC_SHIFT (13U) -#define S50_ELS_KS12_KS12_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UCMAC_SHIFT)) & S50_ELS_KS12_KS12_UCMAC_MASK) - -#define S50_ELS_KS12_KS12_UKSK_MASK (0x4000U) -#define S50_ELS_KS12_KS12_UKSK_SHIFT (14U) -#define S50_ELS_KS12_KS12_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UKSK_SHIFT)) & S50_ELS_KS12_KS12_UKSK_MASK) - -#define S50_ELS_KS12_KS12_URTF_MASK (0x8000U) -#define S50_ELS_KS12_KS12_URTF_SHIFT (15U) -#define S50_ELS_KS12_KS12_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_URTF_SHIFT)) & S50_ELS_KS12_KS12_URTF_MASK) - -#define S50_ELS_KS12_KS12_UCKDF_MASK (0x10000U) -#define S50_ELS_KS12_KS12_UCKDF_SHIFT (16U) -#define S50_ELS_KS12_KS12_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UCKDF_SHIFT)) & S50_ELS_KS12_KS12_UCKDF_MASK) - -#define S50_ELS_KS12_KS12_UHKDF_MASK (0x20000U) -#define S50_ELS_KS12_KS12_UHKDF_SHIFT (17U) -#define S50_ELS_KS12_KS12_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UHKDF_SHIFT)) & S50_ELS_KS12_KS12_UHKDF_MASK) - -#define S50_ELS_KS12_KS12_UECSG_MASK (0x40000U) -#define S50_ELS_KS12_KS12_UECSG_SHIFT (18U) -#define S50_ELS_KS12_KS12_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UECSG_SHIFT)) & S50_ELS_KS12_KS12_UECSG_MASK) - -#define S50_ELS_KS12_KS12_UECDH_MASK (0x80000U) -#define S50_ELS_KS12_KS12_UECDH_SHIFT (19U) -#define S50_ELS_KS12_KS12_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UECDH_SHIFT)) & S50_ELS_KS12_KS12_UECDH_MASK) - -#define S50_ELS_KS12_KS12_UAES_MASK (0x100000U) -#define S50_ELS_KS12_KS12_UAES_SHIFT (20U) -#define S50_ELS_KS12_KS12_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UAES_SHIFT)) & S50_ELS_KS12_KS12_UAES_MASK) - -#define S50_ELS_KS12_KS12_UHMAC_MASK (0x200000U) -#define S50_ELS_KS12_KS12_UHMAC_SHIFT (21U) -#define S50_ELS_KS12_KS12_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UHMAC_SHIFT)) & S50_ELS_KS12_KS12_UHMAC_MASK) - -#define S50_ELS_KS12_KS12_UKWK_MASK (0x400000U) -#define S50_ELS_KS12_KS12_UKWK_SHIFT (22U) -#define S50_ELS_KS12_KS12_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UKWK_SHIFT)) & S50_ELS_KS12_KS12_UKWK_MASK) - -#define S50_ELS_KS12_KS12_UKUOK_MASK (0x800000U) -#define S50_ELS_KS12_KS12_UKUOK_SHIFT (23U) -#define S50_ELS_KS12_KS12_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UKUOK_SHIFT)) & S50_ELS_KS12_KS12_UKUOK_MASK) - -#define S50_ELS_KS12_KS12_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS12_KS12_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS12_KS12_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UTLSPMS_SHIFT)) & S50_ELS_KS12_KS12_UTLSPMS_MASK) - -#define S50_ELS_KS12_KS12_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS12_KS12_UTLSMS_SHIFT (25U) -#define S50_ELS_KS12_KS12_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UTLSMS_SHIFT)) & S50_ELS_KS12_KS12_UTLSMS_MASK) - -#define S50_ELS_KS12_KS12_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS12_KS12_UKGSRC_SHIFT (26U) -#define S50_ELS_KS12_KS12_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UKGSRC_SHIFT)) & S50_ELS_KS12_KS12_UKGSRC_MASK) - -#define S50_ELS_KS12_KS12_UHWO_MASK (0x8000000U) -#define S50_ELS_KS12_KS12_UHWO_SHIFT (27U) -#define S50_ELS_KS12_KS12_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UHWO_SHIFT)) & S50_ELS_KS12_KS12_UHWO_MASK) - -#define S50_ELS_KS12_KS12_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS12_KS12_UWRPOK_SHIFT (28U) -#define S50_ELS_KS12_KS12_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UWRPOK_SHIFT)) & S50_ELS_KS12_KS12_UWRPOK_MASK) - -#define S50_ELS_KS12_KS12_UDUK_MASK (0x20000000U) -#define S50_ELS_KS12_KS12_UDUK_SHIFT (29U) -#define S50_ELS_KS12_KS12_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UDUK_SHIFT)) & S50_ELS_KS12_KS12_UDUK_MASK) - -#define S50_ELS_KS12_KS12_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS12_KS12_UPPROT_SHIFT (30U) -#define S50_ELS_KS12_KS12_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS12_KS12_UPPROT_SHIFT)) & S50_ELS_KS12_KS12_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS13 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS13_KS13_KSIZE_MASK (0x3U) -#define S50_ELS_KS13_KS13_KSIZE_SHIFT (0U) -/*! KS13_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS13_KS13_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_KSIZE_SHIFT)) & S50_ELS_KS13_KS13_KSIZE_MASK) - -#define S50_ELS_KS13_KS13_KACT_MASK (0x20U) -#define S50_ELS_KS13_KS13_KACT_SHIFT (5U) -#define S50_ELS_KS13_KS13_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_KACT_SHIFT)) & S50_ELS_KS13_KS13_KACT_MASK) - -#define S50_ELS_KS13_KS13_KBASE_MASK (0x40U) -#define S50_ELS_KS13_KS13_KBASE_SHIFT (6U) -#define S50_ELS_KS13_KS13_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_KBASE_SHIFT)) & S50_ELS_KS13_KS13_KBASE_MASK) - -#define S50_ELS_KS13_KS13_FGP_MASK (0x80U) -#define S50_ELS_KS13_KS13_FGP_SHIFT (7U) -#define S50_ELS_KS13_KS13_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_FGP_SHIFT)) & S50_ELS_KS13_KS13_FGP_MASK) - -#define S50_ELS_KS13_KS13_FRTN_MASK (0x100U) -#define S50_ELS_KS13_KS13_FRTN_SHIFT (8U) -#define S50_ELS_KS13_KS13_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_FRTN_SHIFT)) & S50_ELS_KS13_KS13_FRTN_MASK) - -#define S50_ELS_KS13_KS13_FHWO_MASK (0x200U) -#define S50_ELS_KS13_KS13_FHWO_SHIFT (9U) -#define S50_ELS_KS13_KS13_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_FHWO_SHIFT)) & S50_ELS_KS13_KS13_FHWO_MASK) - -#define S50_ELS_KS13_KS13_UKPUK_MASK (0x800U) -#define S50_ELS_KS13_KS13_UKPUK_SHIFT (11U) -#define S50_ELS_KS13_KS13_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UKPUK_SHIFT)) & S50_ELS_KS13_KS13_UKPUK_MASK) - -#define S50_ELS_KS13_KS13_UTECDH_MASK (0x1000U) -#define S50_ELS_KS13_KS13_UTECDH_SHIFT (12U) -#define S50_ELS_KS13_KS13_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UTECDH_SHIFT)) & S50_ELS_KS13_KS13_UTECDH_MASK) - -#define S50_ELS_KS13_KS13_UCMAC_MASK (0x2000U) -#define S50_ELS_KS13_KS13_UCMAC_SHIFT (13U) -#define S50_ELS_KS13_KS13_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UCMAC_SHIFT)) & S50_ELS_KS13_KS13_UCMAC_MASK) - -#define S50_ELS_KS13_KS13_UKSK_MASK (0x4000U) -#define S50_ELS_KS13_KS13_UKSK_SHIFT (14U) -#define S50_ELS_KS13_KS13_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UKSK_SHIFT)) & S50_ELS_KS13_KS13_UKSK_MASK) - -#define S50_ELS_KS13_KS13_URTF_MASK (0x8000U) -#define S50_ELS_KS13_KS13_URTF_SHIFT (15U) -#define S50_ELS_KS13_KS13_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_URTF_SHIFT)) & S50_ELS_KS13_KS13_URTF_MASK) - -#define S50_ELS_KS13_KS13_UCKDF_MASK (0x10000U) -#define S50_ELS_KS13_KS13_UCKDF_SHIFT (16U) -#define S50_ELS_KS13_KS13_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UCKDF_SHIFT)) & S50_ELS_KS13_KS13_UCKDF_MASK) - -#define S50_ELS_KS13_KS13_UHKDF_MASK (0x20000U) -#define S50_ELS_KS13_KS13_UHKDF_SHIFT (17U) -#define S50_ELS_KS13_KS13_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UHKDF_SHIFT)) & S50_ELS_KS13_KS13_UHKDF_MASK) - -#define S50_ELS_KS13_KS13_UECSG_MASK (0x40000U) -#define S50_ELS_KS13_KS13_UECSG_SHIFT (18U) -#define S50_ELS_KS13_KS13_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UECSG_SHIFT)) & S50_ELS_KS13_KS13_UECSG_MASK) - -#define S50_ELS_KS13_KS13_UECDH_MASK (0x80000U) -#define S50_ELS_KS13_KS13_UECDH_SHIFT (19U) -#define S50_ELS_KS13_KS13_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UECDH_SHIFT)) & S50_ELS_KS13_KS13_UECDH_MASK) - -#define S50_ELS_KS13_KS13_UAES_MASK (0x100000U) -#define S50_ELS_KS13_KS13_UAES_SHIFT (20U) -#define S50_ELS_KS13_KS13_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UAES_SHIFT)) & S50_ELS_KS13_KS13_UAES_MASK) - -#define S50_ELS_KS13_KS13_UHMAC_MASK (0x200000U) -#define S50_ELS_KS13_KS13_UHMAC_SHIFT (21U) -#define S50_ELS_KS13_KS13_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UHMAC_SHIFT)) & S50_ELS_KS13_KS13_UHMAC_MASK) - -#define S50_ELS_KS13_KS13_UKWK_MASK (0x400000U) -#define S50_ELS_KS13_KS13_UKWK_SHIFT (22U) -#define S50_ELS_KS13_KS13_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UKWK_SHIFT)) & S50_ELS_KS13_KS13_UKWK_MASK) - -#define S50_ELS_KS13_KS13_UKUOK_MASK (0x800000U) -#define S50_ELS_KS13_KS13_UKUOK_SHIFT (23U) -#define S50_ELS_KS13_KS13_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UKUOK_SHIFT)) & S50_ELS_KS13_KS13_UKUOK_MASK) - -#define S50_ELS_KS13_KS13_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS13_KS13_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS13_KS13_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UTLSPMS_SHIFT)) & S50_ELS_KS13_KS13_UTLSPMS_MASK) - -#define S50_ELS_KS13_KS13_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS13_KS13_UTLSMS_SHIFT (25U) -#define S50_ELS_KS13_KS13_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UTLSMS_SHIFT)) & S50_ELS_KS13_KS13_UTLSMS_MASK) - -#define S50_ELS_KS13_KS13_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS13_KS13_UKGSRC_SHIFT (26U) -#define S50_ELS_KS13_KS13_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UKGSRC_SHIFT)) & S50_ELS_KS13_KS13_UKGSRC_MASK) - -#define S50_ELS_KS13_KS13_UHWO_MASK (0x8000000U) -#define S50_ELS_KS13_KS13_UHWO_SHIFT (27U) -#define S50_ELS_KS13_KS13_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UHWO_SHIFT)) & S50_ELS_KS13_KS13_UHWO_MASK) - -#define S50_ELS_KS13_KS13_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS13_KS13_UWRPOK_SHIFT (28U) -#define S50_ELS_KS13_KS13_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UWRPOK_SHIFT)) & S50_ELS_KS13_KS13_UWRPOK_MASK) - -#define S50_ELS_KS13_KS13_UDUK_MASK (0x20000000U) -#define S50_ELS_KS13_KS13_UDUK_SHIFT (29U) -#define S50_ELS_KS13_KS13_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UDUK_SHIFT)) & S50_ELS_KS13_KS13_UDUK_MASK) - -#define S50_ELS_KS13_KS13_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS13_KS13_UPPROT_SHIFT (30U) -#define S50_ELS_KS13_KS13_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS13_KS13_UPPROT_SHIFT)) & S50_ELS_KS13_KS13_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS14 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS14_KS14_KSIZE_MASK (0x3U) -#define S50_ELS_KS14_KS14_KSIZE_SHIFT (0U) -/*! KS14_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS14_KS14_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_KSIZE_SHIFT)) & S50_ELS_KS14_KS14_KSIZE_MASK) - -#define S50_ELS_KS14_KS14_KACT_MASK (0x20U) -#define S50_ELS_KS14_KS14_KACT_SHIFT (5U) -#define S50_ELS_KS14_KS14_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_KACT_SHIFT)) & S50_ELS_KS14_KS14_KACT_MASK) - -#define S50_ELS_KS14_KS14_KBASE_MASK (0x40U) -#define S50_ELS_KS14_KS14_KBASE_SHIFT (6U) -#define S50_ELS_KS14_KS14_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_KBASE_SHIFT)) & S50_ELS_KS14_KS14_KBASE_MASK) - -#define S50_ELS_KS14_KS14_FGP_MASK (0x80U) -#define S50_ELS_KS14_KS14_FGP_SHIFT (7U) -#define S50_ELS_KS14_KS14_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_FGP_SHIFT)) & S50_ELS_KS14_KS14_FGP_MASK) - -#define S50_ELS_KS14_KS14_FRTN_MASK (0x100U) -#define S50_ELS_KS14_KS14_FRTN_SHIFT (8U) -#define S50_ELS_KS14_KS14_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_FRTN_SHIFT)) & S50_ELS_KS14_KS14_FRTN_MASK) - -#define S50_ELS_KS14_KS14_FHWO_MASK (0x200U) -#define S50_ELS_KS14_KS14_FHWO_SHIFT (9U) -#define S50_ELS_KS14_KS14_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_FHWO_SHIFT)) & S50_ELS_KS14_KS14_FHWO_MASK) - -#define S50_ELS_KS14_KS14_UKPUK_MASK (0x800U) -#define S50_ELS_KS14_KS14_UKPUK_SHIFT (11U) -#define S50_ELS_KS14_KS14_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UKPUK_SHIFT)) & S50_ELS_KS14_KS14_UKPUK_MASK) - -#define S50_ELS_KS14_KS14_UTECDH_MASK (0x1000U) -#define S50_ELS_KS14_KS14_UTECDH_SHIFT (12U) -#define S50_ELS_KS14_KS14_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UTECDH_SHIFT)) & S50_ELS_KS14_KS14_UTECDH_MASK) - -#define S50_ELS_KS14_KS14_UCMAC_MASK (0x2000U) -#define S50_ELS_KS14_KS14_UCMAC_SHIFT (13U) -#define S50_ELS_KS14_KS14_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UCMAC_SHIFT)) & S50_ELS_KS14_KS14_UCMAC_MASK) - -#define S50_ELS_KS14_KS14_UKSK_MASK (0x4000U) -#define S50_ELS_KS14_KS14_UKSK_SHIFT (14U) -#define S50_ELS_KS14_KS14_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UKSK_SHIFT)) & S50_ELS_KS14_KS14_UKSK_MASK) - -#define S50_ELS_KS14_KS14_URTF_MASK (0x8000U) -#define S50_ELS_KS14_KS14_URTF_SHIFT (15U) -#define S50_ELS_KS14_KS14_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_URTF_SHIFT)) & S50_ELS_KS14_KS14_URTF_MASK) - -#define S50_ELS_KS14_KS14_UCKDF_MASK (0x10000U) -#define S50_ELS_KS14_KS14_UCKDF_SHIFT (16U) -#define S50_ELS_KS14_KS14_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UCKDF_SHIFT)) & S50_ELS_KS14_KS14_UCKDF_MASK) - -#define S50_ELS_KS14_KS14_UHKDF_MASK (0x20000U) -#define S50_ELS_KS14_KS14_UHKDF_SHIFT (17U) -#define S50_ELS_KS14_KS14_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UHKDF_SHIFT)) & S50_ELS_KS14_KS14_UHKDF_MASK) - -#define S50_ELS_KS14_KS14_UECSG_MASK (0x40000U) -#define S50_ELS_KS14_KS14_UECSG_SHIFT (18U) -#define S50_ELS_KS14_KS14_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UECSG_SHIFT)) & S50_ELS_KS14_KS14_UECSG_MASK) - -#define S50_ELS_KS14_KS14_UECDH_MASK (0x80000U) -#define S50_ELS_KS14_KS14_UECDH_SHIFT (19U) -#define S50_ELS_KS14_KS14_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UECDH_SHIFT)) & S50_ELS_KS14_KS14_UECDH_MASK) - -#define S50_ELS_KS14_KS14_UAES_MASK (0x100000U) -#define S50_ELS_KS14_KS14_UAES_SHIFT (20U) -#define S50_ELS_KS14_KS14_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UAES_SHIFT)) & S50_ELS_KS14_KS14_UAES_MASK) - -#define S50_ELS_KS14_KS14_UHMAC_MASK (0x200000U) -#define S50_ELS_KS14_KS14_UHMAC_SHIFT (21U) -#define S50_ELS_KS14_KS14_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UHMAC_SHIFT)) & S50_ELS_KS14_KS14_UHMAC_MASK) - -#define S50_ELS_KS14_KS14_UKWK_MASK (0x400000U) -#define S50_ELS_KS14_KS14_UKWK_SHIFT (22U) -#define S50_ELS_KS14_KS14_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UKWK_SHIFT)) & S50_ELS_KS14_KS14_UKWK_MASK) - -#define S50_ELS_KS14_KS14_UKUOK_MASK (0x800000U) -#define S50_ELS_KS14_KS14_UKUOK_SHIFT (23U) -#define S50_ELS_KS14_KS14_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UKUOK_SHIFT)) & S50_ELS_KS14_KS14_UKUOK_MASK) - -#define S50_ELS_KS14_KS14_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS14_KS14_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS14_KS14_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UTLSPMS_SHIFT)) & S50_ELS_KS14_KS14_UTLSPMS_MASK) - -#define S50_ELS_KS14_KS14_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS14_KS14_UTLSMS_SHIFT (25U) -#define S50_ELS_KS14_KS14_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UTLSMS_SHIFT)) & S50_ELS_KS14_KS14_UTLSMS_MASK) - -#define S50_ELS_KS14_KS14_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS14_KS14_UKGSRC_SHIFT (26U) -#define S50_ELS_KS14_KS14_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UKGSRC_SHIFT)) & S50_ELS_KS14_KS14_UKGSRC_MASK) - -#define S50_ELS_KS14_KS14_UHWO_MASK (0x8000000U) -#define S50_ELS_KS14_KS14_UHWO_SHIFT (27U) -#define S50_ELS_KS14_KS14_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UHWO_SHIFT)) & S50_ELS_KS14_KS14_UHWO_MASK) - -#define S50_ELS_KS14_KS14_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS14_KS14_UWRPOK_SHIFT (28U) -#define S50_ELS_KS14_KS14_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UWRPOK_SHIFT)) & S50_ELS_KS14_KS14_UWRPOK_MASK) - -#define S50_ELS_KS14_KS14_UDUK_MASK (0x20000000U) -#define S50_ELS_KS14_KS14_UDUK_SHIFT (29U) -#define S50_ELS_KS14_KS14_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UDUK_SHIFT)) & S50_ELS_KS14_KS14_UDUK_MASK) - -#define S50_ELS_KS14_KS14_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS14_KS14_UPPROT_SHIFT (30U) -#define S50_ELS_KS14_KS14_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS14_KS14_UPPROT_SHIFT)) & S50_ELS_KS14_KS14_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS15 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS15_KS15_KSIZE_MASK (0x3U) -#define S50_ELS_KS15_KS15_KSIZE_SHIFT (0U) -/*! KS15_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS15_KS15_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_KSIZE_SHIFT)) & S50_ELS_KS15_KS15_KSIZE_MASK) - -#define S50_ELS_KS15_KS15_KACT_MASK (0x20U) -#define S50_ELS_KS15_KS15_KACT_SHIFT (5U) -#define S50_ELS_KS15_KS15_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_KACT_SHIFT)) & S50_ELS_KS15_KS15_KACT_MASK) - -#define S50_ELS_KS15_KS15_KBASE_MASK (0x40U) -#define S50_ELS_KS15_KS15_KBASE_SHIFT (6U) -#define S50_ELS_KS15_KS15_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_KBASE_SHIFT)) & S50_ELS_KS15_KS15_KBASE_MASK) - -#define S50_ELS_KS15_KS15_FGP_MASK (0x80U) -#define S50_ELS_KS15_KS15_FGP_SHIFT (7U) -#define S50_ELS_KS15_KS15_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_FGP_SHIFT)) & S50_ELS_KS15_KS15_FGP_MASK) - -#define S50_ELS_KS15_KS15_FRTN_MASK (0x100U) -#define S50_ELS_KS15_KS15_FRTN_SHIFT (8U) -#define S50_ELS_KS15_KS15_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_FRTN_SHIFT)) & S50_ELS_KS15_KS15_FRTN_MASK) - -#define S50_ELS_KS15_KS15_FHWO_MASK (0x200U) -#define S50_ELS_KS15_KS15_FHWO_SHIFT (9U) -#define S50_ELS_KS15_KS15_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_FHWO_SHIFT)) & S50_ELS_KS15_KS15_FHWO_MASK) - -#define S50_ELS_KS15_KS15_UKPUK_MASK (0x800U) -#define S50_ELS_KS15_KS15_UKPUK_SHIFT (11U) -#define S50_ELS_KS15_KS15_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UKPUK_SHIFT)) & S50_ELS_KS15_KS15_UKPUK_MASK) - -#define S50_ELS_KS15_KS15_UTECDH_MASK (0x1000U) -#define S50_ELS_KS15_KS15_UTECDH_SHIFT (12U) -#define S50_ELS_KS15_KS15_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UTECDH_SHIFT)) & S50_ELS_KS15_KS15_UTECDH_MASK) - -#define S50_ELS_KS15_KS15_UCMAC_MASK (0x2000U) -#define S50_ELS_KS15_KS15_UCMAC_SHIFT (13U) -#define S50_ELS_KS15_KS15_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UCMAC_SHIFT)) & S50_ELS_KS15_KS15_UCMAC_MASK) - -#define S50_ELS_KS15_KS15_UKSK_MASK (0x4000U) -#define S50_ELS_KS15_KS15_UKSK_SHIFT (14U) -#define S50_ELS_KS15_KS15_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UKSK_SHIFT)) & S50_ELS_KS15_KS15_UKSK_MASK) - -#define S50_ELS_KS15_KS15_URTF_MASK (0x8000U) -#define S50_ELS_KS15_KS15_URTF_SHIFT (15U) -#define S50_ELS_KS15_KS15_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_URTF_SHIFT)) & S50_ELS_KS15_KS15_URTF_MASK) - -#define S50_ELS_KS15_KS15_UCKDF_MASK (0x10000U) -#define S50_ELS_KS15_KS15_UCKDF_SHIFT (16U) -#define S50_ELS_KS15_KS15_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UCKDF_SHIFT)) & S50_ELS_KS15_KS15_UCKDF_MASK) - -#define S50_ELS_KS15_KS15_UHKDF_MASK (0x20000U) -#define S50_ELS_KS15_KS15_UHKDF_SHIFT (17U) -#define S50_ELS_KS15_KS15_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UHKDF_SHIFT)) & S50_ELS_KS15_KS15_UHKDF_MASK) - -#define S50_ELS_KS15_KS15_UECSG_MASK (0x40000U) -#define S50_ELS_KS15_KS15_UECSG_SHIFT (18U) -#define S50_ELS_KS15_KS15_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UECSG_SHIFT)) & S50_ELS_KS15_KS15_UECSG_MASK) - -#define S50_ELS_KS15_KS15_UECDH_MASK (0x80000U) -#define S50_ELS_KS15_KS15_UECDH_SHIFT (19U) -#define S50_ELS_KS15_KS15_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UECDH_SHIFT)) & S50_ELS_KS15_KS15_UECDH_MASK) - -#define S50_ELS_KS15_KS15_UAES_MASK (0x100000U) -#define S50_ELS_KS15_KS15_UAES_SHIFT (20U) -#define S50_ELS_KS15_KS15_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UAES_SHIFT)) & S50_ELS_KS15_KS15_UAES_MASK) - -#define S50_ELS_KS15_KS15_UHMAC_MASK (0x200000U) -#define S50_ELS_KS15_KS15_UHMAC_SHIFT (21U) -#define S50_ELS_KS15_KS15_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UHMAC_SHIFT)) & S50_ELS_KS15_KS15_UHMAC_MASK) - -#define S50_ELS_KS15_KS15_UKWK_MASK (0x400000U) -#define S50_ELS_KS15_KS15_UKWK_SHIFT (22U) -#define S50_ELS_KS15_KS15_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UKWK_SHIFT)) & S50_ELS_KS15_KS15_UKWK_MASK) - -#define S50_ELS_KS15_KS15_UKUOK_MASK (0x800000U) -#define S50_ELS_KS15_KS15_UKUOK_SHIFT (23U) -#define S50_ELS_KS15_KS15_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UKUOK_SHIFT)) & S50_ELS_KS15_KS15_UKUOK_MASK) - -#define S50_ELS_KS15_KS15_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS15_KS15_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS15_KS15_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UTLSPMS_SHIFT)) & S50_ELS_KS15_KS15_UTLSPMS_MASK) - -#define S50_ELS_KS15_KS15_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS15_KS15_UTLSMS_SHIFT (25U) -#define S50_ELS_KS15_KS15_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UTLSMS_SHIFT)) & S50_ELS_KS15_KS15_UTLSMS_MASK) - -#define S50_ELS_KS15_KS15_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS15_KS15_UKGSRC_SHIFT (26U) -#define S50_ELS_KS15_KS15_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UKGSRC_SHIFT)) & S50_ELS_KS15_KS15_UKGSRC_MASK) - -#define S50_ELS_KS15_KS15_UHWO_MASK (0x8000000U) -#define S50_ELS_KS15_KS15_UHWO_SHIFT (27U) -#define S50_ELS_KS15_KS15_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UHWO_SHIFT)) & S50_ELS_KS15_KS15_UHWO_MASK) - -#define S50_ELS_KS15_KS15_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS15_KS15_UWRPOK_SHIFT (28U) -#define S50_ELS_KS15_KS15_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UWRPOK_SHIFT)) & S50_ELS_KS15_KS15_UWRPOK_MASK) - -#define S50_ELS_KS15_KS15_UDUK_MASK (0x20000000U) -#define S50_ELS_KS15_KS15_UDUK_SHIFT (29U) -#define S50_ELS_KS15_KS15_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UDUK_SHIFT)) & S50_ELS_KS15_KS15_UDUK_MASK) - -#define S50_ELS_KS15_KS15_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS15_KS15_UPPROT_SHIFT (30U) -#define S50_ELS_KS15_KS15_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS15_KS15_UPPROT_SHIFT)) & S50_ELS_KS15_KS15_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS16 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS16_KS16_KSIZE_MASK (0x3U) -#define S50_ELS_KS16_KS16_KSIZE_SHIFT (0U) -/*! KS16_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS16_KS16_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_KSIZE_SHIFT)) & S50_ELS_KS16_KS16_KSIZE_MASK) - -#define S50_ELS_KS16_KS16_KACT_MASK (0x20U) -#define S50_ELS_KS16_KS16_KACT_SHIFT (5U) -#define S50_ELS_KS16_KS16_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_KACT_SHIFT)) & S50_ELS_KS16_KS16_KACT_MASK) - -#define S50_ELS_KS16_KS16_KBASE_MASK (0x40U) -#define S50_ELS_KS16_KS16_KBASE_SHIFT (6U) -#define S50_ELS_KS16_KS16_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_KBASE_SHIFT)) & S50_ELS_KS16_KS16_KBASE_MASK) - -#define S50_ELS_KS16_KS16_FGP_MASK (0x80U) -#define S50_ELS_KS16_KS16_FGP_SHIFT (7U) -#define S50_ELS_KS16_KS16_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_FGP_SHIFT)) & S50_ELS_KS16_KS16_FGP_MASK) - -#define S50_ELS_KS16_KS16_FRTN_MASK (0x100U) -#define S50_ELS_KS16_KS16_FRTN_SHIFT (8U) -#define S50_ELS_KS16_KS16_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_FRTN_SHIFT)) & S50_ELS_KS16_KS16_FRTN_MASK) - -#define S50_ELS_KS16_KS16_FHWO_MASK (0x200U) -#define S50_ELS_KS16_KS16_FHWO_SHIFT (9U) -#define S50_ELS_KS16_KS16_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_FHWO_SHIFT)) & S50_ELS_KS16_KS16_FHWO_MASK) - -#define S50_ELS_KS16_KS16_UKPUK_MASK (0x800U) -#define S50_ELS_KS16_KS16_UKPUK_SHIFT (11U) -#define S50_ELS_KS16_KS16_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UKPUK_SHIFT)) & S50_ELS_KS16_KS16_UKPUK_MASK) - -#define S50_ELS_KS16_KS16_UTECDH_MASK (0x1000U) -#define S50_ELS_KS16_KS16_UTECDH_SHIFT (12U) -#define S50_ELS_KS16_KS16_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UTECDH_SHIFT)) & S50_ELS_KS16_KS16_UTECDH_MASK) - -#define S50_ELS_KS16_KS16_UCMAC_MASK (0x2000U) -#define S50_ELS_KS16_KS16_UCMAC_SHIFT (13U) -#define S50_ELS_KS16_KS16_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UCMAC_SHIFT)) & S50_ELS_KS16_KS16_UCMAC_MASK) - -#define S50_ELS_KS16_KS16_UKSK_MASK (0x4000U) -#define S50_ELS_KS16_KS16_UKSK_SHIFT (14U) -#define S50_ELS_KS16_KS16_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UKSK_SHIFT)) & S50_ELS_KS16_KS16_UKSK_MASK) - -#define S50_ELS_KS16_KS16_URTF_MASK (0x8000U) -#define S50_ELS_KS16_KS16_URTF_SHIFT (15U) -#define S50_ELS_KS16_KS16_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_URTF_SHIFT)) & S50_ELS_KS16_KS16_URTF_MASK) - -#define S50_ELS_KS16_KS16_UCKDF_MASK (0x10000U) -#define S50_ELS_KS16_KS16_UCKDF_SHIFT (16U) -#define S50_ELS_KS16_KS16_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UCKDF_SHIFT)) & S50_ELS_KS16_KS16_UCKDF_MASK) - -#define S50_ELS_KS16_KS16_UHKDF_MASK (0x20000U) -#define S50_ELS_KS16_KS16_UHKDF_SHIFT (17U) -#define S50_ELS_KS16_KS16_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UHKDF_SHIFT)) & S50_ELS_KS16_KS16_UHKDF_MASK) - -#define S50_ELS_KS16_KS16_UECSG_MASK (0x40000U) -#define S50_ELS_KS16_KS16_UECSG_SHIFT (18U) -#define S50_ELS_KS16_KS16_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UECSG_SHIFT)) & S50_ELS_KS16_KS16_UECSG_MASK) - -#define S50_ELS_KS16_KS16_UECDH_MASK (0x80000U) -#define S50_ELS_KS16_KS16_UECDH_SHIFT (19U) -#define S50_ELS_KS16_KS16_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UECDH_SHIFT)) & S50_ELS_KS16_KS16_UECDH_MASK) - -#define S50_ELS_KS16_KS16_UAES_MASK (0x100000U) -#define S50_ELS_KS16_KS16_UAES_SHIFT (20U) -#define S50_ELS_KS16_KS16_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UAES_SHIFT)) & S50_ELS_KS16_KS16_UAES_MASK) - -#define S50_ELS_KS16_KS16_UHMAC_MASK (0x200000U) -#define S50_ELS_KS16_KS16_UHMAC_SHIFT (21U) -#define S50_ELS_KS16_KS16_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UHMAC_SHIFT)) & S50_ELS_KS16_KS16_UHMAC_MASK) - -#define S50_ELS_KS16_KS16_UKWK_MASK (0x400000U) -#define S50_ELS_KS16_KS16_UKWK_SHIFT (22U) -#define S50_ELS_KS16_KS16_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UKWK_SHIFT)) & S50_ELS_KS16_KS16_UKWK_MASK) - -#define S50_ELS_KS16_KS16_UKUOK_MASK (0x800000U) -#define S50_ELS_KS16_KS16_UKUOK_SHIFT (23U) -#define S50_ELS_KS16_KS16_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UKUOK_SHIFT)) & S50_ELS_KS16_KS16_UKUOK_MASK) - -#define S50_ELS_KS16_KS16_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS16_KS16_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS16_KS16_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UTLSPMS_SHIFT)) & S50_ELS_KS16_KS16_UTLSPMS_MASK) - -#define S50_ELS_KS16_KS16_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS16_KS16_UTLSMS_SHIFT (25U) -#define S50_ELS_KS16_KS16_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UTLSMS_SHIFT)) & S50_ELS_KS16_KS16_UTLSMS_MASK) - -#define S50_ELS_KS16_KS16_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS16_KS16_UKGSRC_SHIFT (26U) -#define S50_ELS_KS16_KS16_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UKGSRC_SHIFT)) & S50_ELS_KS16_KS16_UKGSRC_MASK) - -#define S50_ELS_KS16_KS16_UHWO_MASK (0x8000000U) -#define S50_ELS_KS16_KS16_UHWO_SHIFT (27U) -#define S50_ELS_KS16_KS16_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UHWO_SHIFT)) & S50_ELS_KS16_KS16_UHWO_MASK) - -#define S50_ELS_KS16_KS16_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS16_KS16_UWRPOK_SHIFT (28U) -#define S50_ELS_KS16_KS16_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UWRPOK_SHIFT)) & S50_ELS_KS16_KS16_UWRPOK_MASK) - -#define S50_ELS_KS16_KS16_UDUK_MASK (0x20000000U) -#define S50_ELS_KS16_KS16_UDUK_SHIFT (29U) -#define S50_ELS_KS16_KS16_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UDUK_SHIFT)) & S50_ELS_KS16_KS16_UDUK_MASK) - -#define S50_ELS_KS16_KS16_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS16_KS16_UPPROT_SHIFT (30U) -#define S50_ELS_KS16_KS16_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS16_KS16_UPPROT_SHIFT)) & S50_ELS_KS16_KS16_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS17 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS17_KS17_KSIZE_MASK (0x3U) -#define S50_ELS_KS17_KS17_KSIZE_SHIFT (0U) -/*! KS17_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS17_KS17_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_KSIZE_SHIFT)) & S50_ELS_KS17_KS17_KSIZE_MASK) - -#define S50_ELS_KS17_KS17_KACT_MASK (0x20U) -#define S50_ELS_KS17_KS17_KACT_SHIFT (5U) -#define S50_ELS_KS17_KS17_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_KACT_SHIFT)) & S50_ELS_KS17_KS17_KACT_MASK) - -#define S50_ELS_KS17_KS17_KBASE_MASK (0x40U) -#define S50_ELS_KS17_KS17_KBASE_SHIFT (6U) -#define S50_ELS_KS17_KS17_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_KBASE_SHIFT)) & S50_ELS_KS17_KS17_KBASE_MASK) - -#define S50_ELS_KS17_KS17_FGP_MASK (0x80U) -#define S50_ELS_KS17_KS17_FGP_SHIFT (7U) -#define S50_ELS_KS17_KS17_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_FGP_SHIFT)) & S50_ELS_KS17_KS17_FGP_MASK) - -#define S50_ELS_KS17_KS17_FRTN_MASK (0x100U) -#define S50_ELS_KS17_KS17_FRTN_SHIFT (8U) -#define S50_ELS_KS17_KS17_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_FRTN_SHIFT)) & S50_ELS_KS17_KS17_FRTN_MASK) - -#define S50_ELS_KS17_KS17_FHWO_MASK (0x200U) -#define S50_ELS_KS17_KS17_FHWO_SHIFT (9U) -#define S50_ELS_KS17_KS17_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_FHWO_SHIFT)) & S50_ELS_KS17_KS17_FHWO_MASK) - -#define S50_ELS_KS17_KS17_UKPUK_MASK (0x800U) -#define S50_ELS_KS17_KS17_UKPUK_SHIFT (11U) -#define S50_ELS_KS17_KS17_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UKPUK_SHIFT)) & S50_ELS_KS17_KS17_UKPUK_MASK) - -#define S50_ELS_KS17_KS17_UTECDH_MASK (0x1000U) -#define S50_ELS_KS17_KS17_UTECDH_SHIFT (12U) -#define S50_ELS_KS17_KS17_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UTECDH_SHIFT)) & S50_ELS_KS17_KS17_UTECDH_MASK) - -#define S50_ELS_KS17_KS17_UCMAC_MASK (0x2000U) -#define S50_ELS_KS17_KS17_UCMAC_SHIFT (13U) -#define S50_ELS_KS17_KS17_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UCMAC_SHIFT)) & S50_ELS_KS17_KS17_UCMAC_MASK) - -#define S50_ELS_KS17_KS17_UKSK_MASK (0x4000U) -#define S50_ELS_KS17_KS17_UKSK_SHIFT (14U) -#define S50_ELS_KS17_KS17_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UKSK_SHIFT)) & S50_ELS_KS17_KS17_UKSK_MASK) - -#define S50_ELS_KS17_KS17_URTF_MASK (0x8000U) -#define S50_ELS_KS17_KS17_URTF_SHIFT (15U) -#define S50_ELS_KS17_KS17_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_URTF_SHIFT)) & S50_ELS_KS17_KS17_URTF_MASK) - -#define S50_ELS_KS17_KS17_UCKDF_MASK (0x10000U) -#define S50_ELS_KS17_KS17_UCKDF_SHIFT (16U) -#define S50_ELS_KS17_KS17_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UCKDF_SHIFT)) & S50_ELS_KS17_KS17_UCKDF_MASK) - -#define S50_ELS_KS17_KS17_UHKDF_MASK (0x20000U) -#define S50_ELS_KS17_KS17_UHKDF_SHIFT (17U) -#define S50_ELS_KS17_KS17_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UHKDF_SHIFT)) & S50_ELS_KS17_KS17_UHKDF_MASK) - -#define S50_ELS_KS17_KS17_UECSG_MASK (0x40000U) -#define S50_ELS_KS17_KS17_UECSG_SHIFT (18U) -#define S50_ELS_KS17_KS17_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UECSG_SHIFT)) & S50_ELS_KS17_KS17_UECSG_MASK) - -#define S50_ELS_KS17_KS17_UECDH_MASK (0x80000U) -#define S50_ELS_KS17_KS17_UECDH_SHIFT (19U) -#define S50_ELS_KS17_KS17_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UECDH_SHIFT)) & S50_ELS_KS17_KS17_UECDH_MASK) - -#define S50_ELS_KS17_KS17_UAES_MASK (0x100000U) -#define S50_ELS_KS17_KS17_UAES_SHIFT (20U) -#define S50_ELS_KS17_KS17_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UAES_SHIFT)) & S50_ELS_KS17_KS17_UAES_MASK) - -#define S50_ELS_KS17_KS17_UHMAC_MASK (0x200000U) -#define S50_ELS_KS17_KS17_UHMAC_SHIFT (21U) -#define S50_ELS_KS17_KS17_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UHMAC_SHIFT)) & S50_ELS_KS17_KS17_UHMAC_MASK) - -#define S50_ELS_KS17_KS17_UKWK_MASK (0x400000U) -#define S50_ELS_KS17_KS17_UKWK_SHIFT (22U) -#define S50_ELS_KS17_KS17_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UKWK_SHIFT)) & S50_ELS_KS17_KS17_UKWK_MASK) - -#define S50_ELS_KS17_KS17_UKUOK_MASK (0x800000U) -#define S50_ELS_KS17_KS17_UKUOK_SHIFT (23U) -#define S50_ELS_KS17_KS17_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UKUOK_SHIFT)) & S50_ELS_KS17_KS17_UKUOK_MASK) - -#define S50_ELS_KS17_KS17_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS17_KS17_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS17_KS17_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UTLSPMS_SHIFT)) & S50_ELS_KS17_KS17_UTLSPMS_MASK) - -#define S50_ELS_KS17_KS17_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS17_KS17_UTLSMS_SHIFT (25U) -#define S50_ELS_KS17_KS17_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UTLSMS_SHIFT)) & S50_ELS_KS17_KS17_UTLSMS_MASK) - -#define S50_ELS_KS17_KS17_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS17_KS17_UKGSRC_SHIFT (26U) -#define S50_ELS_KS17_KS17_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UKGSRC_SHIFT)) & S50_ELS_KS17_KS17_UKGSRC_MASK) - -#define S50_ELS_KS17_KS17_UHWO_MASK (0x8000000U) -#define S50_ELS_KS17_KS17_UHWO_SHIFT (27U) -#define S50_ELS_KS17_KS17_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UHWO_SHIFT)) & S50_ELS_KS17_KS17_UHWO_MASK) - -#define S50_ELS_KS17_KS17_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS17_KS17_UWRPOK_SHIFT (28U) -#define S50_ELS_KS17_KS17_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UWRPOK_SHIFT)) & S50_ELS_KS17_KS17_UWRPOK_MASK) - -#define S50_ELS_KS17_KS17_UDUK_MASK (0x20000000U) -#define S50_ELS_KS17_KS17_UDUK_SHIFT (29U) -#define S50_ELS_KS17_KS17_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UDUK_SHIFT)) & S50_ELS_KS17_KS17_UDUK_MASK) - -#define S50_ELS_KS17_KS17_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS17_KS17_UPPROT_SHIFT (30U) -#define S50_ELS_KS17_KS17_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS17_KS17_UPPROT_SHIFT)) & S50_ELS_KS17_KS17_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS18 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS18_KS18_KSIZE_MASK (0x3U) -#define S50_ELS_KS18_KS18_KSIZE_SHIFT (0U) -/*! KS18_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS18_KS18_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_KSIZE_SHIFT)) & S50_ELS_KS18_KS18_KSIZE_MASK) - -#define S50_ELS_KS18_KS18_KACT_MASK (0x20U) -#define S50_ELS_KS18_KS18_KACT_SHIFT (5U) -#define S50_ELS_KS18_KS18_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_KACT_SHIFT)) & S50_ELS_KS18_KS18_KACT_MASK) - -#define S50_ELS_KS18_KS18_KBASE_MASK (0x40U) -#define S50_ELS_KS18_KS18_KBASE_SHIFT (6U) -#define S50_ELS_KS18_KS18_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_KBASE_SHIFT)) & S50_ELS_KS18_KS18_KBASE_MASK) - -#define S50_ELS_KS18_KS18_FGP_MASK (0x80U) -#define S50_ELS_KS18_KS18_FGP_SHIFT (7U) -#define S50_ELS_KS18_KS18_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_FGP_SHIFT)) & S50_ELS_KS18_KS18_FGP_MASK) - -#define S50_ELS_KS18_KS18_FRTN_MASK (0x100U) -#define S50_ELS_KS18_KS18_FRTN_SHIFT (8U) -#define S50_ELS_KS18_KS18_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_FRTN_SHIFT)) & S50_ELS_KS18_KS18_FRTN_MASK) - -#define S50_ELS_KS18_KS18_FHWO_MASK (0x200U) -#define S50_ELS_KS18_KS18_FHWO_SHIFT (9U) -#define S50_ELS_KS18_KS18_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_FHWO_SHIFT)) & S50_ELS_KS18_KS18_FHWO_MASK) - -#define S50_ELS_KS18_KS18_UKPUK_MASK (0x800U) -#define S50_ELS_KS18_KS18_UKPUK_SHIFT (11U) -#define S50_ELS_KS18_KS18_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UKPUK_SHIFT)) & S50_ELS_KS18_KS18_UKPUK_MASK) - -#define S50_ELS_KS18_KS18_UTECDH_MASK (0x1000U) -#define S50_ELS_KS18_KS18_UTECDH_SHIFT (12U) -#define S50_ELS_KS18_KS18_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UTECDH_SHIFT)) & S50_ELS_KS18_KS18_UTECDH_MASK) - -#define S50_ELS_KS18_KS18_UCMAC_MASK (0x2000U) -#define S50_ELS_KS18_KS18_UCMAC_SHIFT (13U) -#define S50_ELS_KS18_KS18_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UCMAC_SHIFT)) & S50_ELS_KS18_KS18_UCMAC_MASK) - -#define S50_ELS_KS18_KS18_UKSK_MASK (0x4000U) -#define S50_ELS_KS18_KS18_UKSK_SHIFT (14U) -#define S50_ELS_KS18_KS18_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UKSK_SHIFT)) & S50_ELS_KS18_KS18_UKSK_MASK) - -#define S50_ELS_KS18_KS18_URTF_MASK (0x8000U) -#define S50_ELS_KS18_KS18_URTF_SHIFT (15U) -#define S50_ELS_KS18_KS18_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_URTF_SHIFT)) & S50_ELS_KS18_KS18_URTF_MASK) - -#define S50_ELS_KS18_KS18_UCKDF_MASK (0x10000U) -#define S50_ELS_KS18_KS18_UCKDF_SHIFT (16U) -#define S50_ELS_KS18_KS18_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UCKDF_SHIFT)) & S50_ELS_KS18_KS18_UCKDF_MASK) - -#define S50_ELS_KS18_KS18_UHKDF_MASK (0x20000U) -#define S50_ELS_KS18_KS18_UHKDF_SHIFT (17U) -#define S50_ELS_KS18_KS18_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UHKDF_SHIFT)) & S50_ELS_KS18_KS18_UHKDF_MASK) - -#define S50_ELS_KS18_KS18_UECSG_MASK (0x40000U) -#define S50_ELS_KS18_KS18_UECSG_SHIFT (18U) -#define S50_ELS_KS18_KS18_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UECSG_SHIFT)) & S50_ELS_KS18_KS18_UECSG_MASK) - -#define S50_ELS_KS18_KS18_UECDH_MASK (0x80000U) -#define S50_ELS_KS18_KS18_UECDH_SHIFT (19U) -#define S50_ELS_KS18_KS18_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UECDH_SHIFT)) & S50_ELS_KS18_KS18_UECDH_MASK) - -#define S50_ELS_KS18_KS18_UAES_MASK (0x100000U) -#define S50_ELS_KS18_KS18_UAES_SHIFT (20U) -#define S50_ELS_KS18_KS18_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UAES_SHIFT)) & S50_ELS_KS18_KS18_UAES_MASK) - -#define S50_ELS_KS18_KS18_UHMAC_MASK (0x200000U) -#define S50_ELS_KS18_KS18_UHMAC_SHIFT (21U) -#define S50_ELS_KS18_KS18_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UHMAC_SHIFT)) & S50_ELS_KS18_KS18_UHMAC_MASK) - -#define S50_ELS_KS18_KS18_UKWK_MASK (0x400000U) -#define S50_ELS_KS18_KS18_UKWK_SHIFT (22U) -#define S50_ELS_KS18_KS18_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UKWK_SHIFT)) & S50_ELS_KS18_KS18_UKWK_MASK) - -#define S50_ELS_KS18_KS18_UKUOK_MASK (0x800000U) -#define S50_ELS_KS18_KS18_UKUOK_SHIFT (23U) -#define S50_ELS_KS18_KS18_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UKUOK_SHIFT)) & S50_ELS_KS18_KS18_UKUOK_MASK) - -#define S50_ELS_KS18_KS18_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS18_KS18_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS18_KS18_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UTLSPMS_SHIFT)) & S50_ELS_KS18_KS18_UTLSPMS_MASK) - -#define S50_ELS_KS18_KS18_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS18_KS18_UTLSMS_SHIFT (25U) -#define S50_ELS_KS18_KS18_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UTLSMS_SHIFT)) & S50_ELS_KS18_KS18_UTLSMS_MASK) - -#define S50_ELS_KS18_KS18_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS18_KS18_UKGSRC_SHIFT (26U) -#define S50_ELS_KS18_KS18_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UKGSRC_SHIFT)) & S50_ELS_KS18_KS18_UKGSRC_MASK) - -#define S50_ELS_KS18_KS18_UHWO_MASK (0x8000000U) -#define S50_ELS_KS18_KS18_UHWO_SHIFT (27U) -#define S50_ELS_KS18_KS18_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UHWO_SHIFT)) & S50_ELS_KS18_KS18_UHWO_MASK) - -#define S50_ELS_KS18_KS18_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS18_KS18_UWRPOK_SHIFT (28U) -#define S50_ELS_KS18_KS18_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UWRPOK_SHIFT)) & S50_ELS_KS18_KS18_UWRPOK_MASK) - -#define S50_ELS_KS18_KS18_UDUK_MASK (0x20000000U) -#define S50_ELS_KS18_KS18_UDUK_SHIFT (29U) -#define S50_ELS_KS18_KS18_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UDUK_SHIFT)) & S50_ELS_KS18_KS18_UDUK_MASK) - -#define S50_ELS_KS18_KS18_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS18_KS18_UPPROT_SHIFT (30U) -#define S50_ELS_KS18_KS18_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS18_KS18_UPPROT_SHIFT)) & S50_ELS_KS18_KS18_UPPROT_MASK) -/*! @} */ - -/*! @name ELS_KS19 - Status Register */ -/*! @{ */ - -#define S50_ELS_KS19_KS19_KSIZE_MASK (0x3U) -#define S50_ELS_KS19_KS19_KSIZE_SHIFT (0U) -/*! KS19_KSIZE - * 0b00..128 - * 0b01..256 - */ -#define S50_ELS_KS19_KS19_KSIZE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_KSIZE_SHIFT)) & S50_ELS_KS19_KS19_KSIZE_MASK) - -#define S50_ELS_KS19_KS19_KACT_MASK (0x20U) -#define S50_ELS_KS19_KS19_KACT_SHIFT (5U) -#define S50_ELS_KS19_KS19_KACT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_KACT_SHIFT)) & S50_ELS_KS19_KS19_KACT_MASK) - -#define S50_ELS_KS19_KS19_KBASE_MASK (0x40U) -#define S50_ELS_KS19_KS19_KBASE_SHIFT (6U) -#define S50_ELS_KS19_KS19_KBASE(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_KBASE_SHIFT)) & S50_ELS_KS19_KS19_KBASE_MASK) - -#define S50_ELS_KS19_KS19_FGP_MASK (0x80U) -#define S50_ELS_KS19_KS19_FGP_SHIFT (7U) -#define S50_ELS_KS19_KS19_FGP(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_FGP_SHIFT)) & S50_ELS_KS19_KS19_FGP_MASK) - -#define S50_ELS_KS19_KS19_FRTN_MASK (0x100U) -#define S50_ELS_KS19_KS19_FRTN_SHIFT (8U) -#define S50_ELS_KS19_KS19_FRTN(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_FRTN_SHIFT)) & S50_ELS_KS19_KS19_FRTN_MASK) - -#define S50_ELS_KS19_KS19_FHWO_MASK (0x200U) -#define S50_ELS_KS19_KS19_FHWO_SHIFT (9U) -#define S50_ELS_KS19_KS19_FHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_FHWO_SHIFT)) & S50_ELS_KS19_KS19_FHWO_MASK) - -#define S50_ELS_KS19_KS19_UKPUK_MASK (0x800U) -#define S50_ELS_KS19_KS19_UKPUK_SHIFT (11U) -#define S50_ELS_KS19_KS19_UKPUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UKPUK_SHIFT)) & S50_ELS_KS19_KS19_UKPUK_MASK) - -#define S50_ELS_KS19_KS19_UTECDH_MASK (0x1000U) -#define S50_ELS_KS19_KS19_UTECDH_SHIFT (12U) -#define S50_ELS_KS19_KS19_UTECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UTECDH_SHIFT)) & S50_ELS_KS19_KS19_UTECDH_MASK) - -#define S50_ELS_KS19_KS19_UCMAC_MASK (0x2000U) -#define S50_ELS_KS19_KS19_UCMAC_SHIFT (13U) -#define S50_ELS_KS19_KS19_UCMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UCMAC_SHIFT)) & S50_ELS_KS19_KS19_UCMAC_MASK) - -#define S50_ELS_KS19_KS19_UKSK_MASK (0x4000U) -#define S50_ELS_KS19_KS19_UKSK_SHIFT (14U) -#define S50_ELS_KS19_KS19_UKSK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UKSK_SHIFT)) & S50_ELS_KS19_KS19_UKSK_MASK) - -#define S50_ELS_KS19_KS19_URTF_MASK (0x8000U) -#define S50_ELS_KS19_KS19_URTF_SHIFT (15U) -#define S50_ELS_KS19_KS19_URTF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_URTF_SHIFT)) & S50_ELS_KS19_KS19_URTF_MASK) - -#define S50_ELS_KS19_KS19_UCKDF_MASK (0x10000U) -#define S50_ELS_KS19_KS19_UCKDF_SHIFT (16U) -#define S50_ELS_KS19_KS19_UCKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UCKDF_SHIFT)) & S50_ELS_KS19_KS19_UCKDF_MASK) - -#define S50_ELS_KS19_KS19_UHKDF_MASK (0x20000U) -#define S50_ELS_KS19_KS19_UHKDF_SHIFT (17U) -#define S50_ELS_KS19_KS19_UHKDF(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UHKDF_SHIFT)) & S50_ELS_KS19_KS19_UHKDF_MASK) - -#define S50_ELS_KS19_KS19_UECSG_MASK (0x40000U) -#define S50_ELS_KS19_KS19_UECSG_SHIFT (18U) -#define S50_ELS_KS19_KS19_UECSG(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UECSG_SHIFT)) & S50_ELS_KS19_KS19_UECSG_MASK) - -#define S50_ELS_KS19_KS19_UECDH_MASK (0x80000U) -#define S50_ELS_KS19_KS19_UECDH_SHIFT (19U) -#define S50_ELS_KS19_KS19_UECDH(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UECDH_SHIFT)) & S50_ELS_KS19_KS19_UECDH_MASK) - -#define S50_ELS_KS19_KS19_UAES_MASK (0x100000U) -#define S50_ELS_KS19_KS19_UAES_SHIFT (20U) -#define S50_ELS_KS19_KS19_UAES(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UAES_SHIFT)) & S50_ELS_KS19_KS19_UAES_MASK) - -#define S50_ELS_KS19_KS19_UHMAC_MASK (0x200000U) -#define S50_ELS_KS19_KS19_UHMAC_SHIFT (21U) -#define S50_ELS_KS19_KS19_UHMAC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UHMAC_SHIFT)) & S50_ELS_KS19_KS19_UHMAC_MASK) - -#define S50_ELS_KS19_KS19_UKWK_MASK (0x400000U) -#define S50_ELS_KS19_KS19_UKWK_SHIFT (22U) -#define S50_ELS_KS19_KS19_UKWK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UKWK_SHIFT)) & S50_ELS_KS19_KS19_UKWK_MASK) - -#define S50_ELS_KS19_KS19_UKUOK_MASK (0x800000U) -#define S50_ELS_KS19_KS19_UKUOK_SHIFT (23U) -#define S50_ELS_KS19_KS19_UKUOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UKUOK_SHIFT)) & S50_ELS_KS19_KS19_UKUOK_MASK) - -#define S50_ELS_KS19_KS19_UTLSPMS_MASK (0x1000000U) -#define S50_ELS_KS19_KS19_UTLSPMS_SHIFT (24U) -#define S50_ELS_KS19_KS19_UTLSPMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UTLSPMS_SHIFT)) & S50_ELS_KS19_KS19_UTLSPMS_MASK) - -#define S50_ELS_KS19_KS19_UTLSMS_MASK (0x2000000U) -#define S50_ELS_KS19_KS19_UTLSMS_SHIFT (25U) -#define S50_ELS_KS19_KS19_UTLSMS(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UTLSMS_SHIFT)) & S50_ELS_KS19_KS19_UTLSMS_MASK) - -#define S50_ELS_KS19_KS19_UKGSRC_MASK (0x4000000U) -#define S50_ELS_KS19_KS19_UKGSRC_SHIFT (26U) -#define S50_ELS_KS19_KS19_UKGSRC(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UKGSRC_SHIFT)) & S50_ELS_KS19_KS19_UKGSRC_MASK) - -#define S50_ELS_KS19_KS19_UHWO_MASK (0x8000000U) -#define S50_ELS_KS19_KS19_UHWO_SHIFT (27U) -#define S50_ELS_KS19_KS19_UHWO(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UHWO_SHIFT)) & S50_ELS_KS19_KS19_UHWO_MASK) - -#define S50_ELS_KS19_KS19_UWRPOK_MASK (0x10000000U) -#define S50_ELS_KS19_KS19_UWRPOK_SHIFT (28U) -#define S50_ELS_KS19_KS19_UWRPOK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UWRPOK_SHIFT)) & S50_ELS_KS19_KS19_UWRPOK_MASK) - -#define S50_ELS_KS19_KS19_UDUK_MASK (0x20000000U) -#define S50_ELS_KS19_KS19_UDUK_SHIFT (29U) -#define S50_ELS_KS19_KS19_UDUK(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UDUK_SHIFT)) & S50_ELS_KS19_KS19_UDUK_MASK) - -#define S50_ELS_KS19_KS19_UPPROT_MASK (0xC0000000U) -#define S50_ELS_KS19_KS19_UPPROT_SHIFT (30U) -#define S50_ELS_KS19_KS19_UPPROT(x) (((uint32_t)(((uint32_t)(x)) << S50_ELS_KS19_KS19_UPPROT_SHIFT)) & S50_ELS_KS19_KS19_UPPROT_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group S50_Register_Masks */ - - -/* S50 - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral ELS base address */ - #define ELS_BASE (0x50054000u) - /** Peripheral ELS base address */ - #define ELS_BASE_NS (0x40054000u) - /** Peripheral ELS base pointer */ - #define ELS ((S50_Type *)ELS_BASE) - /** Peripheral ELS base pointer */ - #define ELS_NS ((S50_Type *)ELS_BASE_NS) - /** Peripheral ELS_ALIAS1 base address */ - #define ELS_ALIAS1_BASE (0x50055000u) - /** Peripheral ELS_ALIAS1 base address */ - #define ELS_ALIAS1_BASE_NS (0x40055000u) - /** Peripheral ELS_ALIAS1 base pointer */ - #define ELS_ALIAS1 ((S50_Type *)ELS_ALIAS1_BASE) - /** Peripheral ELS_ALIAS1 base pointer */ - #define ELS_ALIAS1_NS ((S50_Type *)ELS_ALIAS1_BASE_NS) - /** Peripheral ELS_ALIAS2 base address */ - #define ELS_ALIAS2_BASE (0x50056000u) - /** Peripheral ELS_ALIAS2 base address */ - #define ELS_ALIAS2_BASE_NS (0x40056000u) - /** Peripheral ELS_ALIAS2 base pointer */ - #define ELS_ALIAS2 ((S50_Type *)ELS_ALIAS2_BASE) - /** Peripheral ELS_ALIAS2 base pointer */ - #define ELS_ALIAS2_NS ((S50_Type *)ELS_ALIAS2_BASE_NS) - /** Peripheral ELS_ALIAS3 base address */ - #define ELS_ALIAS3_BASE (0x50057000u) - /** Peripheral ELS_ALIAS3 base address */ - #define ELS_ALIAS3_BASE_NS (0x40057000u) - /** Peripheral ELS_ALIAS3 base pointer */ - #define ELS_ALIAS3 ((S50_Type *)ELS_ALIAS3_BASE) - /** Peripheral ELS_ALIAS3 base pointer */ - #define ELS_ALIAS3_NS ((S50_Type *)ELS_ALIAS3_BASE_NS) - /** Array initializer of S50 peripheral base addresses */ - #define S50_BASE_ADDRS { ELS_BASE, ELS_ALIAS1_BASE, ELS_ALIAS2_BASE, ELS_ALIAS3_BASE } - /** Array initializer of S50 peripheral base pointers */ - #define S50_BASE_PTRS { ELS, ELS_ALIAS1, ELS_ALIAS2, ELS_ALIAS3 } - /** Array initializer of S50 peripheral base addresses */ - #define S50_BASE_ADDRS_NS { ELS_BASE_NS, ELS_ALIAS1_BASE_NS, ELS_ALIAS2_BASE_NS, ELS_ALIAS3_BASE_NS } - /** Array initializer of S50 peripheral base pointers */ - #define S50_BASE_PTRS_NS { ELS_NS, ELS_ALIAS1_NS, ELS_ALIAS2_NS, ELS_ALIAS3_NS } -#else - /** Peripheral ELS base address */ - #define ELS_BASE (0x40054000u) - /** Peripheral ELS base pointer */ - #define ELS ((S50_Type *)ELS_BASE) - /** Peripheral ELS_ALIAS1 base address */ - #define ELS_ALIAS1_BASE (0x40055000u) - /** Peripheral ELS_ALIAS1 base pointer */ - #define ELS_ALIAS1 ((S50_Type *)ELS_ALIAS1_BASE) - /** Peripheral ELS_ALIAS2 base address */ - #define ELS_ALIAS2_BASE (0x40056000u) - /** Peripheral ELS_ALIAS2 base pointer */ - #define ELS_ALIAS2 ((S50_Type *)ELS_ALIAS2_BASE) - /** Peripheral ELS_ALIAS3 base address */ - #define ELS_ALIAS3_BASE (0x40057000u) - /** Peripheral ELS_ALIAS3 base pointer */ - #define ELS_ALIAS3 ((S50_Type *)ELS_ALIAS3_BASE) - /** Array initializer of S50 peripheral base addresses */ - #define S50_BASE_ADDRS { ELS_BASE, ELS_ALIAS1_BASE, ELS_ALIAS2_BASE, ELS_ALIAS3_BASE } - /** Array initializer of S50 peripheral base pointers */ - #define S50_BASE_PTRS { ELS, ELS_ALIAS1, ELS_ALIAS2, ELS_ALIAS3 } -#endif - -/*! - * @} - */ /* end of group S50_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- SCG Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SCG_Peripheral_Access_Layer SCG Peripheral Access Layer - * @{ - */ - -/** SCG - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID Register, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter Register, offset: 0x4 */ - __IO uint32_t TRIM_LOCK; /**< Trim Lock register, offset: 0x8 */ - uint8_t RESERVED_0[4]; - __I uint32_t CSR; /**< Clock Status Register, offset: 0x10 */ - __IO uint32_t RCCR; /**< Run Clock Control Register, offset: 0x14 */ - uint8_t RESERVED_1[232]; - __IO uint32_t SOSCCSR; /**< SOSC Control Status Register, offset: 0x100 */ - uint8_t RESERVED_2[4]; - __IO uint32_t SOSCCFG; /**< SOSC Configuration Register, offset: 0x108 */ - uint8_t RESERVED_3[244]; - __IO uint32_t SIRCCSR; /**< SIRC Control Status Register, offset: 0x200 */ - uint8_t RESERVED_4[8]; - __IO uint32_t SIRCTCFG; /**< SIRC Trim Configuration Register, offset: 0x20C */ - __IO uint32_t SIRCTRIM; /**< SIRC Trim Register, offset: 0x210 */ - uint8_t RESERVED_5[4]; - __IO uint32_t SIRCSTAT; /**< SIRC Auto-trimming Status Register, offset: 0x218 */ - uint8_t RESERVED_6[228]; - __IO uint32_t FIRCCSR; /**< FIRC Control Status Register, offset: 0x300 */ - uint8_t RESERVED_7[4]; - __IO uint32_t FIRCCFG; /**< FIRC Configuration Register, offset: 0x308 */ - __IO uint32_t FIRCTCFG; /**< FIRC Trim Configuration Register, offset: 0x30C */ - __IO uint32_t FIRCTRIM; /**< FIRC Trim Register, offset: 0x310 */ - uint8_t RESERVED_8[4]; - __IO uint32_t FIRCSTAT; /**< FIRC Auto-trimming Status Register, offset: 0x318 */ - uint8_t RESERVED_9[228]; - __IO uint32_t ROSCCSR; /**< ROSC Control Status Register, offset: 0x400 */ - uint8_t RESERVED_10[252]; - __IO uint32_t APLLCSR; /**< APLL Control Status Register, offset: 0x500 */ - __IO uint32_t APLLCTRL; /**< APLL Control Register, offset: 0x504 */ - __I uint32_t APLLSTAT; /**< APLL Status Register, offset: 0x508 */ - __IO uint32_t APLLNDIV; /**< APLL N Divider Register, offset: 0x50C */ - __IO uint32_t APLLMDIV; /**< APLL M Divider Register, offset: 0x510 */ - __IO uint32_t APLLPDIV; /**< APLL P Divider Register, offset: 0x514 */ - __IO uint32_t APLLLOCK_CNFG; /**< APLL LOCK Configuration Register, offset: 0x518 */ - uint8_t RESERVED_11[4]; - __I uint32_t APLLSSCGSTAT; /**< APLL SSCG Status Register, offset: 0x520 */ - __IO uint32_t APLLSSCG0; /**< APLL Spread Spectrum Control 0 Register, offset: 0x524 */ - __IO uint32_t APLLSSCG1; /**< APLL Spread Spectrum Control 1 Register, offset: 0x528 */ - uint8_t RESERVED_12[200]; - __IO uint32_t APLL_OVRD; /**< APLL Override Register, offset: 0x5F4 */ - uint8_t RESERVED_13[8]; - __IO uint32_t SPLLCSR; /**< SPLL Control Status Register, offset: 0x600 */ - __IO uint32_t SPLLCTRL; /**< SPLL Control Register, offset: 0x604 */ - __I uint32_t SPLLSTAT; /**< SPLL Status Register, offset: 0x608 */ - __IO uint32_t SPLLNDIV; /**< SPLL N Divider Register, offset: 0x60C */ - __IO uint32_t SPLLMDIV; /**< SPLL M Divider Register, offset: 0x610 */ - __IO uint32_t SPLLPDIV; /**< SPLL P Divider Register, offset: 0x614 */ - __IO uint32_t SPLLLOCK_CNFG; /**< SPLL LOCK Configuration Register, offset: 0x618 */ - uint8_t RESERVED_14[4]; - __I uint32_t SPLLSSCGSTAT; /**< SPLL SSCG Status Register, offset: 0x620 */ - __IO uint32_t SPLLSSCG0; /**< SPLL Spread Spectrum Control 0 Register, offset: 0x624 */ - __IO uint32_t SPLLSSCG1; /**< SPLL Spread Spectrum Control 1 Register, offset: 0x628 */ - uint8_t RESERVED_15[200]; - __IO uint32_t SPLL_OVRD; /**< SPLL Override Register, offset: 0x6F4 */ - uint8_t RESERVED_16[8]; - __IO uint32_t UPLLCSR; /**< UPLL Control Status Register, offset: 0x700 */ - uint8_t RESERVED_17[252]; - __IO uint32_t LDOCSR; /**< LDO Control and Status Register, offset: 0x800 */ -} SCG_Type; - -/* ---------------------------------------------------------------------------- - -- SCG Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SCG_Register_Masks SCG Register Masks - * @{ - */ - -/*! @name VERID - Version ID Register */ -/*! @{ */ - -#define SCG_VERID_VERSION_MASK (0xFFFFFFFFU) -#define SCG_VERID_VERSION_SHIFT (0U) -/*! VERSION - SCG Version Number */ -#define SCG_VERID_VERSION(x) (((uint32_t)(((uint32_t)(x)) << SCG_VERID_VERSION_SHIFT)) & SCG_VERID_VERSION_MASK) -/*! @} */ - -/*! @name PARAM - Parameter Register */ -/*! @{ */ - -#define SCG_PARAM_SOSCCLKPRES_MASK (0x2U) -#define SCG_PARAM_SOSCCLKPRES_SHIFT (1U) -/*! SOSCCLKPRES - SOSC Clock Present - * 0b1..SOSC clock source is present - * 0b0..SOSC clock source is not present - */ -#define SCG_PARAM_SOSCCLKPRES(x) (((uint32_t)(((uint32_t)(x)) << SCG_PARAM_SOSCCLKPRES_SHIFT)) & SCG_PARAM_SOSCCLKPRES_MASK) - -#define SCG_PARAM_SIRCCLKPRES_MASK (0x4U) -#define SCG_PARAM_SIRCCLKPRES_SHIFT (2U) -/*! SIRCCLKPRES - SIRC Clock Present - * 0b1..SIRC clock source is present - * 0b0..SIRC clock source is not present - */ -#define SCG_PARAM_SIRCCLKPRES(x) (((uint32_t)(((uint32_t)(x)) << SCG_PARAM_SIRCCLKPRES_SHIFT)) & SCG_PARAM_SIRCCLKPRES_MASK) - -#define SCG_PARAM_FIRCCLKPRES_MASK (0x8U) -#define SCG_PARAM_FIRCCLKPRES_SHIFT (3U) -/*! FIRCCLKPRES - FIRC Clock Present - * 0b1..FIRC clock source is present - * 0b0..FIRC clock source is not present - */ -#define SCG_PARAM_FIRCCLKPRES(x) (((uint32_t)(((uint32_t)(x)) << SCG_PARAM_FIRCCLKPRES_SHIFT)) & SCG_PARAM_FIRCCLKPRES_MASK) - -#define SCG_PARAM_ROSCCLKPRES_MASK (0x10U) -#define SCG_PARAM_ROSCCLKPRES_SHIFT (4U) -/*! ROSCCLKPRES - ROSC Clock Present - * 0b1..ROSC clock source is present - * 0b0..ROSC clock source is not present - */ -#define SCG_PARAM_ROSCCLKPRES(x) (((uint32_t)(((uint32_t)(x)) << SCG_PARAM_ROSCCLKPRES_SHIFT)) & SCG_PARAM_ROSCCLKPRES_MASK) - -#define SCG_PARAM_APLLCLKPRES_MASK (0x20U) -#define SCG_PARAM_APLLCLKPRES_SHIFT (5U) -/*! APLLCLKPRES - APLL Clock Present - * 0b1..APLL clock source is present - * 0b0..APLL clock source is not present - */ -#define SCG_PARAM_APLLCLKPRES(x) (((uint32_t)(((uint32_t)(x)) << SCG_PARAM_APLLCLKPRES_SHIFT)) & SCG_PARAM_APLLCLKPRES_MASK) - -#define SCG_PARAM_SPLLCLKPRES_MASK (0x40U) -#define SCG_PARAM_SPLLCLKPRES_SHIFT (6U) -/*! SPLLCLKPRES - SPLL Clock Present - * 0b1..SPLL clock source is present - * 0b0..SPLL clock source is not present - */ -#define SCG_PARAM_SPLLCLKPRES(x) (((uint32_t)(((uint32_t)(x)) << SCG_PARAM_SPLLCLKPRES_SHIFT)) & SCG_PARAM_SPLLCLKPRES_MASK) - -#define SCG_PARAM_UPLLCLKPRES_MASK (0x80U) -#define SCG_PARAM_UPLLCLKPRES_SHIFT (7U) -/*! UPLLCLKPRES - UPLL Clock Present - * 0b1..UPLL clock source is present - * 0b0..UPLL clock source is not present - */ -#define SCG_PARAM_UPLLCLKPRES(x) (((uint32_t)(((uint32_t)(x)) << SCG_PARAM_UPLLCLKPRES_SHIFT)) & SCG_PARAM_UPLLCLKPRES_MASK) -/*! @} */ - -/*! @name TRIM_LOCK - Trim Lock register */ -/*! @{ */ - -#define SCG_TRIM_LOCK_TRIM_UNLOCK_MASK (0x1U) -#define SCG_TRIM_LOCK_TRIM_UNLOCK_SHIFT (0U) -/*! TRIM_UNLOCK - TRIM_UNLOCK - * 0b0..SCG Trim registers are locked and not writable. - * 0b1..SCG Trim registers are unlocked and writable. - */ -#define SCG_TRIM_LOCK_TRIM_UNLOCK(x) (((uint32_t)(((uint32_t)(x)) << SCG_TRIM_LOCK_TRIM_UNLOCK_SHIFT)) & SCG_TRIM_LOCK_TRIM_UNLOCK_MASK) - -#define SCG_TRIM_LOCK_IFR_DISABLE_MASK (0x2U) -#define SCG_TRIM_LOCK_IFR_DISABLE_SHIFT (1U) -/*! IFR_DISABLE - IFR_DISABLE - * 0b0..IFR write access to SCG trim registers not disabled. The SCG Trim registers are reprogrammed with the IFR values after any system reset. - * 0b1..IFR write access to SCG trim registers during system reset is blocked. - */ -#define SCG_TRIM_LOCK_IFR_DISABLE(x) (((uint32_t)(((uint32_t)(x)) << SCG_TRIM_LOCK_IFR_DISABLE_SHIFT)) & SCG_TRIM_LOCK_IFR_DISABLE_MASK) - -#define SCG_TRIM_LOCK_TRIM_LOCK_KEY_MASK (0xFFFF0000U) -#define SCG_TRIM_LOCK_TRIM_LOCK_KEY_SHIFT (16U) -/*! TRIM_LOCK_KEY - TRIM_LOCK_KEY */ -#define SCG_TRIM_LOCK_TRIM_LOCK_KEY(x) (((uint32_t)(((uint32_t)(x)) << SCG_TRIM_LOCK_TRIM_LOCK_KEY_SHIFT)) & SCG_TRIM_LOCK_TRIM_LOCK_KEY_MASK) -/*! @} */ - -/*! @name CSR - Clock Status Register */ -/*! @{ */ - -#define SCG_CSR_SCS_MASK (0xF000000U) -#define SCG_CSR_SCS_SHIFT (24U) -/*! SCS - System Clock Source - * 0b0000..Reserved - * 0b0001..SOSC - * 0b0010..SIRC - * 0b0011..FIRC - * 0b0100..ROSC - * 0b0101..APLL - * 0b0110..SPLL - * 0b0111..UPLL - * 0b1000-0b1111..Reserved - */ -#define SCG_CSR_SCS(x) (((uint32_t)(((uint32_t)(x)) << SCG_CSR_SCS_SHIFT)) & SCG_CSR_SCS_MASK) -/*! @} */ - -/*! @name RCCR - Run Clock Control Register */ -/*! @{ */ - -#define SCG_RCCR_SCS_MASK (0xF000000U) -#define SCG_RCCR_SCS_SHIFT (24U) -/*! SCS - System Clock Source - * 0b0000..Reserved - * 0b0001..SOSC - * 0b0010..SIRC - * 0b0011..FIRC - * 0b0100..ROSC - * 0b0101..APLL - * 0b0110..SPLL - * 0b0111..UPLL - * 0b1000-0b1111..Reserved - */ -#define SCG_RCCR_SCS(x) (((uint32_t)(((uint32_t)(x)) << SCG_RCCR_SCS_SHIFT)) & SCG_RCCR_SCS_MASK) -/*! @} */ - -/*! @name SOSCCSR - SOSC Control Status Register */ -/*! @{ */ - -#define SCG_SOSCCSR_SOSCEN_MASK (0x1U) -#define SCG_SOSCCSR_SOSCEN_SHIFT (0U) -/*! SOSCEN - SOSC Enable - * 0b0..SOSC is disabled - * 0b1..SOSC is enabled - */ -#define SCG_SOSCCSR_SOSCEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCEN_SHIFT)) & SCG_SOSCCSR_SOSCEN_MASK) - -#define SCG_SOSCCSR_SOSCSTEN_MASK (0x2U) -#define SCG_SOSCCSR_SOSCSTEN_SHIFT (1U) -/*! SOSCSTEN - SOSC Stop Enable - * 0b0..SOSC is disabled in Deep Sleep mode - * 0b1..SOSC is enabled in Deep Sleep mode only if SOSCEN is set - */ -#define SCG_SOSCCSR_SOSCSTEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCSTEN_SHIFT)) & SCG_SOSCCSR_SOSCSTEN_MASK) - -#define SCG_SOSCCSR_SOSCCM_MASK (0x10000U) -#define SCG_SOSCCSR_SOSCCM_SHIFT (16U) -/*! SOSCCM - SOSC Clock Monitor Enable - * 0b0..SOSC Clock Monitor is disabled - * 0b1..SOSC Clock Monitor is enabled - */ -#define SCG_SOSCCSR_SOSCCM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCCM_SHIFT)) & SCG_SOSCCSR_SOSCCM_MASK) - -#define SCG_SOSCCSR_SOSCCMRE_MASK (0x20000U) -#define SCG_SOSCCSR_SOSCCMRE_SHIFT (17U) -/*! SOSCCMRE - SOSC Clock Monitor Reset Enable - * 0b0..Clock monitor generates an interrupt when an error is detected - * 0b1..Clock monitor generates a reset when an error is detected - */ -#define SCG_SOSCCSR_SOSCCMRE(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCCMRE_SHIFT)) & SCG_SOSCCSR_SOSCCMRE_MASK) - -#define SCG_SOSCCSR_LK_MASK (0x800000U) -#define SCG_SOSCCSR_LK_SHIFT (23U) -/*! LK - Lock Register - * 0b0..This Control Status Register can be written - * 0b1..This Control Status Register cannot be written - */ -#define SCG_SOSCCSR_LK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_LK_SHIFT)) & SCG_SOSCCSR_LK_MASK) - -#define SCG_SOSCCSR_SOSCVLD_MASK (0x1000000U) -#define SCG_SOSCCSR_SOSCVLD_SHIFT (24U) -/*! SOSCVLD - SOSC Valid - * 0b0..SOSC is not enabled or clock is not valid - * 0b1..SOSC is enabled and output clock is valid - */ -#define SCG_SOSCCSR_SOSCVLD(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCVLD_SHIFT)) & SCG_SOSCCSR_SOSCVLD_MASK) - -#define SCG_SOSCCSR_SOSCSEL_MASK (0x2000000U) -#define SCG_SOSCCSR_SOSCSEL_SHIFT (25U) -/*! SOSCSEL - SOSC Selected - * 0b0..SOSC is not the system clock source - * 0b1..SOSC is the system clock source - */ -#define SCG_SOSCCSR_SOSCSEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCSEL_SHIFT)) & SCG_SOSCCSR_SOSCSEL_MASK) - -#define SCG_SOSCCSR_SOSCERR_MASK (0x4000000U) -#define SCG_SOSCCSR_SOSCERR_SHIFT (26U) -/*! SOSCERR - SOSC Clock Error - * 0b0..SOSC Clock Monitor is disabled or has not detected an error - * 0b1..SOSC Clock Monitor is enabled and detected an error - */ -#define SCG_SOSCCSR_SOSCERR(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCERR_SHIFT)) & SCG_SOSCCSR_SOSCERR_MASK) - -#define SCG_SOSCCSR_SOSCVLD_IE_MASK (0x40000000U) -#define SCG_SOSCCSR_SOSCVLD_IE_SHIFT (30U) -/*! SOSCVLD_IE - SOSC Valid Interrupt Enable - * 0b0..SOSCVLD interrupt is not enabled - * 0b1..SOSCVLD interrupt is enabled - */ -#define SCG_SOSCCSR_SOSCVLD_IE(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCSR_SOSCVLD_IE_SHIFT)) & SCG_SOSCCSR_SOSCVLD_IE_MASK) -/*! @} */ - -/*! @name SOSCCFG - SOSC Configuration Register */ -/*! @{ */ - -#define SCG_SOSCCFG_EREFS_MASK (0x4U) -#define SCG_SOSCCFG_EREFS_SHIFT (2U) -/*! EREFS - External Reference Select - * 0b0..External reference clock selected. LDO can be disabled in this case. - * 0b1..Internal crystal oscillator of OSC selected. - */ -#define SCG_SOSCCFG_EREFS(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCFG_EREFS_SHIFT)) & SCG_SOSCCFG_EREFS_MASK) - -#define SCG_SOSCCFG_RANGE_MASK (0x30U) -#define SCG_SOSCCFG_RANGE_SHIFT (4U) -/*! RANGE - SOSC Range Select - * 0b00..Frequency range select of 16-20 MHz. - * 0b01..Frequency range select of 20-30 MHz. - * 0b10..Frequency range select of 30-50 MHz. - * 0b11..Frequency range select of 50-66 MHz. - */ -#define SCG_SOSCCFG_RANGE(x) (((uint32_t)(((uint32_t)(x)) << SCG_SOSCCFG_RANGE_SHIFT)) & SCG_SOSCCFG_RANGE_MASK) -/*! @} */ - -/*! @name SIRCCSR - SIRC Control Status Register */ -/*! @{ */ - -#define SCG_SIRCCSR_SIRCSTEN_MASK (0x2U) -#define SCG_SIRCCSR_SIRCSTEN_SHIFT (1U) -/*! SIRCSTEN - SIRC Stop Enable - * 0b0..SIRC is disabled in Deep Sleep mode - * 0b1..SIRC is enabled in Deep Sleep mode - */ -#define SCG_SIRCCSR_SIRCSTEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCSTEN_SHIFT)) & SCG_SIRCCSR_SIRCSTEN_MASK) - -#define SCG_SIRCCSR_SIRC_CLK_PERIPH_EN_MASK (0x20U) -#define SCG_SIRCCSR_SIRC_CLK_PERIPH_EN_SHIFT (5U) -/*! SIRC_CLK_PERIPH_EN - SIRC Clock to Peripherals Enable - * 0b0..SIRC clock to peripherals is disabled - * 0b1..SIRC clock to peripherals is enabled - */ -#define SCG_SIRCCSR_SIRC_CLK_PERIPH_EN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRC_CLK_PERIPH_EN_SHIFT)) & SCG_SIRCCSR_SIRC_CLK_PERIPH_EN_MASK) - -#define SCG_SIRCCSR_SIRCTREN_MASK (0x100U) -#define SCG_SIRCCSR_SIRCTREN_SHIFT (8U) -/*! SIRCTREN - SIRC 12 MHz Trim Enable (SIRCCFG[RANGE]=1) - * 0b0..Disables trimming SIRC to an external clock source - * 0b1..Enables trimming SIRC to an external clock source - */ -#define SCG_SIRCCSR_SIRCTREN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCTREN_SHIFT)) & SCG_SIRCCSR_SIRCTREN_MASK) - -#define SCG_SIRCCSR_SIRCTRUP_MASK (0x200U) -#define SCG_SIRCCSR_SIRCTRUP_SHIFT (9U) -/*! SIRCTRUP - SIRC Trim Update - * 0b0..Disables SIRC trimming updates - * 0b1..Enables SIRC trimming updates - */ -#define SCG_SIRCCSR_SIRCTRUP(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCTRUP_SHIFT)) & SCG_SIRCCSR_SIRCTRUP_MASK) - -#define SCG_SIRCCSR_TRIM_LOCK_MASK (0x400U) -#define SCG_SIRCCSR_TRIM_LOCK_SHIFT (10U) -/*! TRIM_LOCK - SIRC TRIM LOCK - * 0b0..SIRC auto trim not locked to target frequency range - * 0b1..SIRC auto trim locked to target frequency range - */ -#define SCG_SIRCCSR_TRIM_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_TRIM_LOCK_SHIFT)) & SCG_SIRCCSR_TRIM_LOCK_MASK) - -#define SCG_SIRCCSR_COARSE_TRIM_BYPASS_MASK (0x800U) -#define SCG_SIRCCSR_COARSE_TRIM_BYPASS_SHIFT (11U) -/*! COARSE_TRIM_BYPASS - Coarse Auto Trim Bypass - * 0b0..SIRC coarse auto-trim is not bypassed - * 0b1..SIRC coarse auto-trim is bypassed - */ -#define SCG_SIRCCSR_COARSE_TRIM_BYPASS(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_COARSE_TRIM_BYPASS_SHIFT)) & SCG_SIRCCSR_COARSE_TRIM_BYPASS_MASK) - -#define SCG_SIRCCSR_LK_MASK (0x800000U) -#define SCG_SIRCCSR_LK_SHIFT (23U) -/*! LK - Lock Register - * 0b0..Control Status Register can be written - * 0b1..Control Status Register cannot be written - */ -#define SCG_SIRCCSR_LK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_LK_SHIFT)) & SCG_SIRCCSR_LK_MASK) - -#define SCG_SIRCCSR_SIRCVLD_MASK (0x1000000U) -#define SCG_SIRCCSR_SIRCVLD_SHIFT (24U) -/*! SIRCVLD - SIRC Valid - * 0b0..SIRC is not enabled or clock is not valid - * 0b1..SIRC is enabled and output clock is valid - */ -#define SCG_SIRCCSR_SIRCVLD(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCVLD_SHIFT)) & SCG_SIRCCSR_SIRCVLD_MASK) - -#define SCG_SIRCCSR_SIRCSEL_MASK (0x2000000U) -#define SCG_SIRCCSR_SIRCSEL_SHIFT (25U) -/*! SIRCSEL - SIRC Selected - * 0b0..SIRC is not the system clock source - * 0b1..SIRC is the system clock source - */ -#define SCG_SIRCCSR_SIRCSEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCSEL_SHIFT)) & SCG_SIRCCSR_SIRCSEL_MASK) - -#define SCG_SIRCCSR_SIRCERR_MASK (0x4000000U) -#define SCG_SIRCCSR_SIRCERR_SHIFT (26U) -/*! SIRCERR - SIRC Clock Error - * 0b0..Error not detected with the SIRC trimming - * 0b1..Error detected with the SIRC trimming - */ -#define SCG_SIRCCSR_SIRCERR(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCERR_SHIFT)) & SCG_SIRCCSR_SIRCERR_MASK) - -#define SCG_SIRCCSR_SIRCERR_IE_MASK (0x8000000U) -#define SCG_SIRCCSR_SIRCERR_IE_SHIFT (27U) -/*! SIRCERR_IE - SIRC Clock Error Interrupt Enable - * 0b0..SIRCERR interrupt is not enabled - * 0b1..SIRCERR interrupt is enabled - */ -#define SCG_SIRCCSR_SIRCERR_IE(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCCSR_SIRCERR_IE_SHIFT)) & SCG_SIRCCSR_SIRCERR_IE_MASK) -/*! @} */ - -/*! @name SIRCTCFG - SIRC Trim Configuration Register */ -/*! @{ */ - -#define SCG_SIRCTCFG_TRIMSRC_MASK (0x3U) -#define SCG_SIRCTCFG_TRIMSRC_SHIFT (0U) -/*! TRIMSRC - Trim Source - * 0b00..Reserved - * 0b01..Reserved - * 0b10..SOSC - * 0b11..ROSC (32.768 kHz) - */ -#define SCG_SIRCTCFG_TRIMSRC(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCTCFG_TRIMSRC_SHIFT)) & SCG_SIRCTCFG_TRIMSRC_MASK) - -#define SCG_SIRCTCFG_TRIMDIV_MASK (0x7F0000U) -#define SCG_SIRCTCFG_TRIMDIV_SHIFT (16U) -/*! TRIMDIV - SIRC Trim Predivider */ -#define SCG_SIRCTCFG_TRIMDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCTCFG_TRIMDIV_SHIFT)) & SCG_SIRCTCFG_TRIMDIV_MASK) -/*! @} */ - -/*! @name SIRCTRIM - SIRC Trim Register */ -/*! @{ */ - -#define SCG_SIRCTRIM_CCOTRIM_MASK (0x3FU) -#define SCG_SIRCTRIM_CCOTRIM_SHIFT (0U) -/*! CCOTRIM - CCO Trim */ -#define SCG_SIRCTRIM_CCOTRIM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCTRIM_CCOTRIM_SHIFT)) & SCG_SIRCTRIM_CCOTRIM_MASK) - -#define SCG_SIRCTRIM_CLTRIM_MASK (0x3F00U) -#define SCG_SIRCTRIM_CLTRIM_SHIFT (8U) -/*! CLTRIM - CL Trim */ -#define SCG_SIRCTRIM_CLTRIM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCTRIM_CLTRIM_SHIFT)) & SCG_SIRCTRIM_CLTRIM_MASK) - -#define SCG_SIRCTRIM_TCTRIM_MASK (0x1F0000U) -#define SCG_SIRCTRIM_TCTRIM_SHIFT (16U) -/*! TCTRIM - Trim Temp */ -#define SCG_SIRCTRIM_TCTRIM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCTRIM_TCTRIM_SHIFT)) & SCG_SIRCTRIM_TCTRIM_MASK) - -#define SCG_SIRCTRIM_FVCHTRIM_MASK (0x1F000000U) -#define SCG_SIRCTRIM_FVCHTRIM_SHIFT (24U) -#define SCG_SIRCTRIM_FVCHTRIM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCTRIM_FVCHTRIM_SHIFT)) & SCG_SIRCTRIM_FVCHTRIM_MASK) -/*! @} */ - -/*! @name SIRCSTAT - SIRC Auto-trimming Status Register */ -/*! @{ */ - -#define SCG_SIRCSTAT_CCOTRIM_MASK (0x3FU) -#define SCG_SIRCSTAT_CCOTRIM_SHIFT (0U) -/*! CCOTRIM - CCO Trim */ -#define SCG_SIRCSTAT_CCOTRIM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCSTAT_CCOTRIM_SHIFT)) & SCG_SIRCSTAT_CCOTRIM_MASK) - -#define SCG_SIRCSTAT_CLTRIM_MASK (0x3F00U) -#define SCG_SIRCSTAT_CLTRIM_SHIFT (8U) -/*! CLTRIM - CL Trim */ -#define SCG_SIRCSTAT_CLTRIM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SIRCSTAT_CLTRIM_SHIFT)) & SCG_SIRCSTAT_CLTRIM_MASK) -/*! @} */ - -/*! @name FIRCCSR - FIRC Control Status Register */ -/*! @{ */ - -#define SCG_FIRCCSR_FIRCEN_MASK (0x1U) -#define SCG_FIRCCSR_FIRCEN_SHIFT (0U) -/*! FIRCEN - FIRC Enable - * 0b0..FIRC is disabled - * 0b1..FIRC is enabled - */ -#define SCG_FIRCCSR_FIRCEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCEN_SHIFT)) & SCG_FIRCCSR_FIRCEN_MASK) - -#define SCG_FIRCCSR_FIRCSTEN_MASK (0x2U) -#define SCG_FIRCCSR_FIRCSTEN_SHIFT (1U) -/*! FIRCSTEN - FIRC Stop Enable - * 0b0..FIRC is disabled in Deep Sleep mode - * 0b1..FIRC is enabled in Deep Sleep mode - */ -#define SCG_FIRCCSR_FIRCSTEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCSTEN_SHIFT)) & SCG_FIRCCSR_FIRCSTEN_MASK) - -#define SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_MASK (0x10U) -#define SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_SHIFT (4U) -/*! FIRC_SCLK_PERIPH_EN - FIRC 48 MHz Clock to peripherals Enable - * 0b0..FIRC 48 MHz to peripherals is disabled - * 0b1..FIRC 48 MHz to peripherals is enabled - */ -#define SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_SHIFT)) & SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_MASK) - -#define SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN_MASK (0x20U) -#define SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN_SHIFT (5U) -/*! FIRC_FCLK_PERIPH_EN - FIRC 144 MHz Clock to peripherals Enable - * 0b0..FIRC 144 MHz to peripherals is disabled - * 0b1..FIRC 144 MHz to peripherals is enabled - */ -#define SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN_SHIFT)) & SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN_MASK) - -#define SCG_FIRCCSR_FIRCTREN_MASK (0x100U) -#define SCG_FIRCCSR_FIRCTREN_SHIFT (8U) -/*! FIRCTREN - FIRC 144 MHz Trim Enable (FIRCCFG[RANGE]=1) - * 0b0..Disables trimming FIRC to an external clock source - * 0b1..Enables trimming FIRC to an external clock source - */ -#define SCG_FIRCCSR_FIRCTREN(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCTREN_SHIFT)) & SCG_FIRCCSR_FIRCTREN_MASK) - -#define SCG_FIRCCSR_FIRCTRUP_MASK (0x200U) -#define SCG_FIRCCSR_FIRCTRUP_SHIFT (9U) -/*! FIRCTRUP - FIRC Trim Update - * 0b0..Disables FIRC trimming updates - * 0b1..Enables FIRC trimming updates - */ -#define SCG_FIRCCSR_FIRCTRUP(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCTRUP_SHIFT)) & SCG_FIRCCSR_FIRCTRUP_MASK) - -#define SCG_FIRCCSR_TRIM_LOCK_MASK (0x400U) -#define SCG_FIRCCSR_TRIM_LOCK_SHIFT (10U) -/*! TRIM_LOCK - FIRC TRIM LOCK - * 0b0..FIRC auto trim not locked to target frequency range - * 0b1..FIRC auto trim locked to target frequency range - */ -#define SCG_FIRCCSR_TRIM_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_TRIM_LOCK_SHIFT)) & SCG_FIRCCSR_TRIM_LOCK_MASK) - -#define SCG_FIRCCSR_COARSE_TRIM_BYPASS_MASK (0x800U) -#define SCG_FIRCCSR_COARSE_TRIM_BYPASS_SHIFT (11U) -/*! COARSE_TRIM_BYPASS - Coarse Auto Trim Bypass - * 0b0..FIRC coarse auto trim is not bypassed - * 0b1..FIRC coarse auto trim is bypassed - */ -#define SCG_FIRCCSR_COARSE_TRIM_BYPASS(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_COARSE_TRIM_BYPASS_SHIFT)) & SCG_FIRCCSR_COARSE_TRIM_BYPASS_MASK) - -#define SCG_FIRCCSR_LK_MASK (0x800000U) -#define SCG_FIRCCSR_LK_SHIFT (23U) -/*! LK - Lock Register - * 0b0..Control Status Register can be written - * 0b1..Control Status Register cannot be written - */ -#define SCG_FIRCCSR_LK(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_LK_SHIFT)) & SCG_FIRCCSR_LK_MASK) - -#define SCG_FIRCCSR_FIRCVLD_MASK (0x1000000U) -#define SCG_FIRCCSR_FIRCVLD_SHIFT (24U) -/*! FIRCVLD - FIRC Valid status - * 0b0..FIRC is not enabled or clock is not valid. - * 0b1..FIRC is enabled and output clock is valid. The clock is valid after there is an output clock from the FIRC analog. - */ -#define SCG_FIRCCSR_FIRCVLD(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCVLD_SHIFT)) & SCG_FIRCCSR_FIRCVLD_MASK) - -#define SCG_FIRCCSR_FIRCSEL_MASK (0x2000000U) -#define SCG_FIRCCSR_FIRCSEL_SHIFT (25U) -/*! FIRCSEL - FIRC Selected - * 0b0..FIRC is not the system clock source - * 0b1..FIRC is the system clock source - */ -#define SCG_FIRCCSR_FIRCSEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCSEL_SHIFT)) & SCG_FIRCCSR_FIRCSEL_MASK) - -#define SCG_FIRCCSR_FIRCERR_MASK (0x4000000U) -#define SCG_FIRCCSR_FIRCERR_SHIFT (26U) -/*! FIRCERR - FIRC Clock Error - * 0b0..Error not detected with the FIRC trimming - * 0b1..Error detected with the FIRC trimming - */ -#define SCG_FIRCCSR_FIRCERR(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCERR_SHIFT)) & SCG_FIRCCSR_FIRCERR_MASK) - -#define SCG_FIRCCSR_FIRCERR_IE_MASK (0x8000000U) -#define SCG_FIRCCSR_FIRCERR_IE_SHIFT (27U) -/*! FIRCERR_IE - FIRC Clock Error Interrupt Enable - * 0b0..FIRCERR interrupt is not enabled - * 0b1..FIRCERR interrupt is enabled - */ -#define SCG_FIRCCSR_FIRCERR_IE(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCERR_IE_SHIFT)) & SCG_FIRCCSR_FIRCERR_IE_MASK) - -#define SCG_FIRCCSR_FIRCACC_IE_MASK (0x40000000U) -#define SCG_FIRCCSR_FIRCACC_IE_SHIFT (30U) -/*! FIRCACC_IE - FIRC Accurate Interrupt Enable - * 0b0..FIRCACC interrupt is not enabled - * 0b1..FIRCACC interrupt is enabled - */ -#define SCG_FIRCCSR_FIRCACC_IE(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCACC_IE_SHIFT)) & SCG_FIRCCSR_FIRCACC_IE_MASK) - -#define SCG_FIRCCSR_FIRCACC_MASK (0x80000000U) -#define SCG_FIRCCSR_FIRCACC_SHIFT (31U) -/*! FIRCACC - FIRC Frequency Accurate - * 0b0..FIRC is not enabled or clock is not accurate. - * 0b1..FIRC is enabled and output clock is accurate. The clock is accurate after 4096 clock cycles of 144 MHz - * (RANGE=1) or 1365 clock cycles of 48 MHz(RANGE=0) from the FIRC analog. - */ -#define SCG_FIRCCSR_FIRCACC(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCSR_FIRCACC_SHIFT)) & SCG_FIRCCSR_FIRCACC_MASK) -/*! @} */ - -/*! @name FIRCCFG - FIRC Configuration Register */ -/*! @{ */ - -#define SCG_FIRCCFG_RANGE_MASK (0x1U) -#define SCG_FIRCCFG_RANGE_SHIFT (0U) -/*! RANGE - Frequency Range - * 0b0..48 MHz FIRC clock selected - * 0b1..144 MHz FIRC clock selected - */ -#define SCG_FIRCCFG_RANGE(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCCFG_RANGE_SHIFT)) & SCG_FIRCCFG_RANGE_MASK) -/*! @} */ - -/*! @name FIRCTCFG - FIRC Trim Configuration Register */ -/*! @{ */ - -#define SCG_FIRCTCFG_TRIMSRC_MASK (0x3U) -#define SCG_FIRCTCFG_TRIMSRC_SHIFT (0U) -/*! TRIMSRC - Trim Source - * 0b00..USB0 Start of Frame (1 kHz). This option does not use TRIMDIV - * 0b01..Reserved - * 0b10..SOSC - * 0b11..ROSC - */ -#define SCG_FIRCTCFG_TRIMSRC(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTCFG_TRIMSRC_SHIFT)) & SCG_FIRCTCFG_TRIMSRC_MASK) - -#define SCG_FIRCTCFG_TRIMDIV_MASK (0x7F0000U) -#define SCG_FIRCTCFG_TRIMDIV_SHIFT (16U) -/*! TRIMDIV - FIRC Trim Predivider */ -#define SCG_FIRCTCFG_TRIMDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTCFG_TRIMDIV_SHIFT)) & SCG_FIRCTCFG_TRIMDIV_MASK) -/*! @} */ - -/*! @name FIRCTRIM - FIRC Trim Register */ -/*! @{ */ - -#define SCG_FIRCTRIM_TRIMFINE_MASK (0xFFU) -#define SCG_FIRCTRIM_TRIMFINE_SHIFT (0U) -/*! TRIMFINE - Trim Fine */ -#define SCG_FIRCTRIM_TRIMFINE(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTRIM_TRIMFINE_SHIFT)) & SCG_FIRCTRIM_TRIMFINE_MASK) - -#define SCG_FIRCTRIM_TRIMCOAR_MASK (0x3F00U) -#define SCG_FIRCTRIM_TRIMCOAR_SHIFT (8U) -/*! TRIMCOAR - Trim Coarse */ -#define SCG_FIRCTRIM_TRIMCOAR(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTRIM_TRIMCOAR_SHIFT)) & SCG_FIRCTRIM_TRIMCOAR_MASK) - -#define SCG_FIRCTRIM_TRIMTEMP_MASK (0x30000U) -#define SCG_FIRCTRIM_TRIMTEMP_SHIFT (16U) -/*! TRIMTEMP - Trim Temperature */ -#define SCG_FIRCTRIM_TRIMTEMP(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTRIM_TRIMTEMP_SHIFT)) & SCG_FIRCTRIM_TRIMTEMP_MASK) - -#define SCG_FIRCTRIM_TRIMSTART_MASK (0x3F000000U) -#define SCG_FIRCTRIM_TRIMSTART_SHIFT (24U) -/*! TRIMSTART - Trim Start */ -#define SCG_FIRCTRIM_TRIMSTART(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCTRIM_TRIMSTART_SHIFT)) & SCG_FIRCTRIM_TRIMSTART_MASK) -/*! @} */ - -/*! @name FIRCSTAT - FIRC Auto-trimming Status Register */ -/*! @{ */ - -#define SCG_FIRCSTAT_TRIMFINE_MASK (0xFFU) -#define SCG_FIRCSTAT_TRIMFINE_SHIFT (0U) -/*! TRIMFINE - Trim Fine */ -#define SCG_FIRCSTAT_TRIMFINE(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCSTAT_TRIMFINE_SHIFT)) & SCG_FIRCSTAT_TRIMFINE_MASK) - -#define SCG_FIRCSTAT_TRIMCOAR_MASK (0x3F00U) -#define SCG_FIRCSTAT_TRIMCOAR_SHIFT (8U) -/*! TRIMCOAR - Trim Coarse */ -#define SCG_FIRCSTAT_TRIMCOAR(x) (((uint32_t)(((uint32_t)(x)) << SCG_FIRCSTAT_TRIMCOAR_SHIFT)) & SCG_FIRCSTAT_TRIMCOAR_MASK) -/*! @} */ - -/*! @name ROSCCSR - ROSC Control Status Register */ -/*! @{ */ - -#define SCG_ROSCCSR_ROSCCM_MASK (0x10000U) -#define SCG_ROSCCSR_ROSCCM_SHIFT (16U) -/*! ROSCCM - ROSC Clock Monitor - * 0b0..ROSC clock monitor is disabled - * 0b1..ROSC clock monitor is enabled - */ -#define SCG_ROSCCSR_ROSCCM(x) (((uint32_t)(((uint32_t)(x)) << SCG_ROSCCSR_ROSCCM_SHIFT)) & SCG_ROSCCSR_ROSCCM_MASK) - -#define SCG_ROSCCSR_ROSCCMRE_MASK (0x20000U) -#define SCG_ROSCCSR_ROSCCMRE_SHIFT (17U) -/*! ROSCCMRE - ROSC Clock Monitor Reset Enable - * 0b0..Clock monitor generates an interrupt when an error is detected - * 0b1..Clock monitor generates a reset when an error is detected - */ -#define SCG_ROSCCSR_ROSCCMRE(x) (((uint32_t)(((uint32_t)(x)) << SCG_ROSCCSR_ROSCCMRE_SHIFT)) & SCG_ROSCCSR_ROSCCMRE_MASK) - -#define SCG_ROSCCSR_LK_MASK (0x800000U) -#define SCG_ROSCCSR_LK_SHIFT (23U) -/*! LK - Lock Register - * 0b0..Control Status Register can be written - * 0b1..Control Status Register cannot be written - */ -#define SCG_ROSCCSR_LK(x) (((uint32_t)(((uint32_t)(x)) << SCG_ROSCCSR_LK_SHIFT)) & SCG_ROSCCSR_LK_MASK) - -#define SCG_ROSCCSR_ROSCVLD_MASK (0x1000000U) -#define SCG_ROSCCSR_ROSCVLD_SHIFT (24U) -/*! ROSCVLD - ROSC Valid - * 0b0..ROSC is not enabled or clock is not valid - * 0b1..ROSC is enabled and output clock is valid - */ -#define SCG_ROSCCSR_ROSCVLD(x) (((uint32_t)(((uint32_t)(x)) << SCG_ROSCCSR_ROSCVLD_SHIFT)) & SCG_ROSCCSR_ROSCVLD_MASK) - -#define SCG_ROSCCSR_ROSCSEL_MASK (0x2000000U) -#define SCG_ROSCCSR_ROSCSEL_SHIFT (25U) -/*! ROSCSEL - ROSC Selected - * 0b0..ROSC is not the system clock source - * 0b1..ROSC is the system clock source - */ -#define SCG_ROSCCSR_ROSCSEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_ROSCCSR_ROSCSEL_SHIFT)) & SCG_ROSCCSR_ROSCSEL_MASK) - -#define SCG_ROSCCSR_ROSCERR_MASK (0x4000000U) -#define SCG_ROSCCSR_ROSCERR_SHIFT (26U) -/*! ROSCERR - ROSC Clock Error - * 0b0..ROSC Clock Monitor is disabled or has not detected an error - * 0b1..ROSC Clock Monitor is enabled and detected an RTC loss of clock error - */ -#define SCG_ROSCCSR_ROSCERR(x) (((uint32_t)(((uint32_t)(x)) << SCG_ROSCCSR_ROSCERR_SHIFT)) & SCG_ROSCCSR_ROSCERR_MASK) -/*! @} */ - -/*! @name APLLCSR - APLL Control Status Register */ -/*! @{ */ - -#define SCG_APLLCSR_APLLPWREN_MASK (0x1U) -#define SCG_APLLCSR_APLLPWREN_SHIFT (0U) -/*! APLLPWREN - APLL Power Enable - * 0b0..APLL clock is powered off - * 0b1..APLL clock is powered on - */ -#define SCG_APLLCSR_APLLPWREN(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_APLLPWREN_SHIFT)) & SCG_APLLCSR_APLLPWREN_MASK) - -#define SCG_APLLCSR_APLLCLKEN_MASK (0x2U) -#define SCG_APLLCSR_APLLCLKEN_SHIFT (1U) -/*! APLLCLKEN - APLL Clock Enable - * 0b0..APLL clock is disabled - * 0b1..APLL clock is enabled - */ -#define SCG_APLLCSR_APLLCLKEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_APLLCLKEN_SHIFT)) & SCG_APLLCSR_APLLCLKEN_MASK) - -#define SCG_APLLCSR_APLLSTEN_MASK (0x4U) -#define SCG_APLLCSR_APLLSTEN_SHIFT (2U) -/*! APLLSTEN - APLL Stop Enable - * 0b0..APLL is disabled in Deep Sleep mode - * 0b1..APLL is enabled in Deep Sleep mode - */ -#define SCG_APLLCSR_APLLSTEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_APLLSTEN_SHIFT)) & SCG_APLLCSR_APLLSTEN_MASK) - -#define SCG_APLLCSR_APLLCM_MASK (0x10000U) -#define SCG_APLLCSR_APLLCM_SHIFT (16U) -/*! APLLCM - APLL Clock Monitor - * 0b0..APLL Clock Monitor is disabled - * 0b1..APLL Clock Monitor is enabled - */ -#define SCG_APLLCSR_APLLCM(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_APLLCM_SHIFT)) & SCG_APLLCSR_APLLCM_MASK) - -#define SCG_APLLCSR_APLLCMRE_MASK (0x20000U) -#define SCG_APLLCSR_APLLCMRE_SHIFT (17U) -/*! APLLCMRE - APLL Clock Monitor Reset Enable - * 0b0..Clock monitor generates an interrupt when an error is detected - * 0b1..Clock monitor generates a reset when an error is detected - */ -#define SCG_APLLCSR_APLLCMRE(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_APLLCMRE_SHIFT)) & SCG_APLLCSR_APLLCMRE_MASK) - -#define SCG_APLLCSR_LK_MASK (0x800000U) -#define SCG_APLLCSR_LK_SHIFT (23U) -/*! LK - Lock Register - * 0b0..Control Status Register can be written - * 0b1..Control Status Register cannot be written - */ -#define SCG_APLLCSR_LK(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_LK_SHIFT)) & SCG_APLLCSR_LK_MASK) - -#define SCG_APLLCSR_APLL_LOCK_MASK (0x1000000U) -#define SCG_APLLCSR_APLL_LOCK_SHIFT (24U) -/*! APLL_LOCK - APLL LOCK - * 0b0..APLL is not powered on or not locked - * 0b1..APLL is locked - */ -#define SCG_APLLCSR_APLL_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_APLL_LOCK_SHIFT)) & SCG_APLLCSR_APLL_LOCK_MASK) - -#define SCG_APLLCSR_APLLSEL_MASK (0x2000000U) -#define SCG_APLLCSR_APLLSEL_SHIFT (25U) -/*! APLLSEL - APLL Selected - * 0b0..APLL is not the system clock source - * 0b1..APLL is the system clock source - */ -#define SCG_APLLCSR_APLLSEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_APLLSEL_SHIFT)) & SCG_APLLCSR_APLLSEL_MASK) - -#define SCG_APLLCSR_APLLERR_MASK (0x4000000U) -#define SCG_APLLCSR_APLLERR_SHIFT (26U) -/*! APLLERR - APLL Clock Error - * 0b0..APLL Clock Monitor is disabled or has not detected an error - * 0b1..APLL Clock Monitor is enabled and detected an error - */ -#define SCG_APLLCSR_APLLERR(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_APLLERR_SHIFT)) & SCG_APLLCSR_APLLERR_MASK) - -#define SCG_APLLCSR_APLL_LOCK_IE_MASK (0x40000000U) -#define SCG_APLLCSR_APLL_LOCK_IE_SHIFT (30U) -/*! APLL_LOCK_IE - APLL LOCK Interrupt Enable - * 0b0..APLL_LOCK interrupt is not enabled - * 0b1..APLL_LOCK interrupt is enabled - */ -#define SCG_APLLCSR_APLL_LOCK_IE(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCSR_APLL_LOCK_IE_SHIFT)) & SCG_APLLCSR_APLL_LOCK_IE_MASK) -/*! @} */ - -/*! @name APLLCTRL - APLL Control Register */ -/*! @{ */ - -#define SCG_APLLCTRL_SELR_MASK (0xFU) -#define SCG_APLLCTRL_SELR_SHIFT (0U) -/*! SELR - Bandwidth select R (resistor) value. */ -#define SCG_APLLCTRL_SELR(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCTRL_SELR_SHIFT)) & SCG_APLLCTRL_SELR_MASK) - -#define SCG_APLLCTRL_SELI_MASK (0x3F0U) -#define SCG_APLLCTRL_SELI_SHIFT (4U) -/*! SELI - Bandwidth select I (integration) value. */ -#define SCG_APLLCTRL_SELI(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCTRL_SELI_SHIFT)) & SCG_APLLCTRL_SELI_MASK) - -#define SCG_APLLCTRL_SELP_MASK (0x7C00U) -#define SCG_APLLCTRL_SELP_SHIFT (10U) -/*! SELP - Bandwidth select P (proportional) value. */ -#define SCG_APLLCTRL_SELP(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCTRL_SELP_SHIFT)) & SCG_APLLCTRL_SELP_MASK) - -#define SCG_APLLCTRL_BYPASSPOSTDIV2_MASK (0x10000U) -#define SCG_APLLCTRL_BYPASSPOSTDIV2_SHIFT (16U) -/*! BYPASSPOSTDIV2 - Bypass of Divide-by-2 Divider - * 0b0..Use the divide-by-2 divider in the postdivider - * 0b1..Bypass of the divide-by-2 divider in the postdivider - */ -#define SCG_APLLCTRL_BYPASSPOSTDIV2(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCTRL_BYPASSPOSTDIV2_SHIFT)) & SCG_APLLCTRL_BYPASSPOSTDIV2_MASK) - -#define SCG_APLLCTRL_LIMUPOFF_MASK (0x20000U) -#define SCG_APLLCTRL_LIMUPOFF_SHIFT (17U) -/*! LIMUPOFF - Up Limiter - * 0b0..Application set to non-Spectrum and Fractional applications. - * 0b1..Application set to Spectrum and Fractional applications. - */ -#define SCG_APLLCTRL_LIMUPOFF(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCTRL_LIMUPOFF_SHIFT)) & SCG_APLLCTRL_LIMUPOFF_MASK) - -#define SCG_APLLCTRL_BANDDIRECT_MASK (0x40000U) -#define SCG_APLLCTRL_BANDDIRECT_SHIFT (18U) -/*! BANDDIRECT - Control of the bandwidth of the PLL. - * 0b0..The bandwidth is changed synchronously with the feedback-divider - * 0b1..Modifies the bandwidth of the PLL directly - */ -#define SCG_APLLCTRL_BANDDIRECT(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCTRL_BANDDIRECT_SHIFT)) & SCG_APLLCTRL_BANDDIRECT_MASK) - -#define SCG_APLLCTRL_BYPASSPREDIV_MASK (0x80000U) -#define SCG_APLLCTRL_BYPASSPREDIV_SHIFT (19U) -/*! BYPASSPREDIV - Bypass of the predivider - * 0b0..Use the predivider. - * 0b1..Bypass of the predivider. - */ -#define SCG_APLLCTRL_BYPASSPREDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCTRL_BYPASSPREDIV_SHIFT)) & SCG_APLLCTRL_BYPASSPREDIV_MASK) - -#define SCG_APLLCTRL_BYPASSPOSTDIV_MASK (0x100000U) -#define SCG_APLLCTRL_BYPASSPOSTDIV_SHIFT (20U) -/*! BYPASSPOSTDIV - Bypass of the postdivider - * 0b0..Use the postdivider. - * 0b1..Bypass of the postdivider - */ -#define SCG_APLLCTRL_BYPASSPOSTDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCTRL_BYPASSPOSTDIV_SHIFT)) & SCG_APLLCTRL_BYPASSPOSTDIV_MASK) - -#define SCG_APLLCTRL_SOURCE_MASK (0x6000000U) -#define SCG_APLLCTRL_SOURCE_SHIFT (25U) -/*! SOURCE - Clock Source - * 0b00..SOSC - * 0b01..FIRC 48 MHz clock. FIRC_SCLK_PERIPH_EN must be set to use FIRC 48 MHz clock. - * 0b10..Reserved - * 0b11..No clock - */ -#define SCG_APLLCTRL_SOURCE(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLCTRL_SOURCE_SHIFT)) & SCG_APLLCTRL_SOURCE_MASK) -/*! @} */ - -/*! @name APLLSTAT - APLL Status Register */ -/*! @{ */ - -#define SCG_APLLSTAT_NDIVACK_MASK (0x2U) -#define SCG_APLLSTAT_NDIVACK_SHIFT (1U) -/*! NDIVACK - Predivider(N) ratio change acknowledge. - * 0b0..The predivider (N) ratio change is not accepted by the analog PLL - * 0b1..The predivider (N) ratio change is accepted by the analog PLL - */ -#define SCG_APLLSTAT_NDIVACK(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSTAT_NDIVACK_SHIFT)) & SCG_APLLSTAT_NDIVACK_MASK) - -#define SCG_APLLSTAT_MDIVACK_MASK (0x4U) -#define SCG_APLLSTAT_MDIVACK_SHIFT (2U) -/*! MDIVACK - Feedback(M) divider ratio change acknowledge. - * 0b0..The feedback (M) ratio change is not accepted by the analog PLL - * 0b1..The feedback (M) ratio change is accepted by the analog PLL - */ -#define SCG_APLLSTAT_MDIVACK(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSTAT_MDIVACK_SHIFT)) & SCG_APLLSTAT_MDIVACK_MASK) - -#define SCG_APLLSTAT_PDIVACK_MASK (0x8U) -#define SCG_APLLSTAT_PDIVACK_SHIFT (3U) -/*! PDIVACK - Postdivider(P) ratio change acknowledge. - * 0b0..The postdivider (P) ratio change is not accepted by the analog PLL - * 0b1..The postdivider (P) ratio change is accepted by the analog PLL - */ -#define SCG_APLLSTAT_PDIVACK(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSTAT_PDIVACK_SHIFT)) & SCG_APLLSTAT_PDIVACK_MASK) -/*! @} */ - -/*! @name APLLNDIV - APLL N Divider Register */ -/*! @{ */ - -#define SCG_APLLNDIV_NDIV_MASK (0xFFU) -#define SCG_APLLNDIV_NDIV_SHIFT (0U) -/*! NDIV - Predivider divider ratio (N-divider). */ -#define SCG_APLLNDIV_NDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLNDIV_NDIV_SHIFT)) & SCG_APLLNDIV_NDIV_MASK) - -#define SCG_APLLNDIV_NREQ_MASK (0x80000000U) -#define SCG_APLLNDIV_NREQ_SHIFT (31U) -/*! NREQ - Predivider ratio change request. - * 0b0..Predivider ratio change is not requested - * 0b1..Predivider ratio change is requested - */ -#define SCG_APLLNDIV_NREQ(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLNDIV_NREQ_SHIFT)) & SCG_APLLNDIV_NREQ_MASK) -/*! @} */ - -/*! @name APLLMDIV - APLL M Divider Register */ -/*! @{ */ - -#define SCG_APLLMDIV_MDIV_MASK (0xFFFFU) -#define SCG_APLLMDIV_MDIV_SHIFT (0U) -/*! MDIV - Feedback divider divider ratio (M-divider). */ -#define SCG_APLLMDIV_MDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLMDIV_MDIV_SHIFT)) & SCG_APLLMDIV_MDIV_MASK) - -#define SCG_APLLMDIV_MREQ_MASK (0x80000000U) -#define SCG_APLLMDIV_MREQ_SHIFT (31U) -/*! MREQ - Feedback ratio change request. - * 0b0..Feedback ratio change is not requested - * 0b1..Feedback ratio change is requested - */ -#define SCG_APLLMDIV_MREQ(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLMDIV_MREQ_SHIFT)) & SCG_APLLMDIV_MREQ_MASK) -/*! @} */ - -/*! @name APLLPDIV - APLL P Divider Register */ -/*! @{ */ - -#define SCG_APLLPDIV_PDIV_MASK (0x1FU) -#define SCG_APLLPDIV_PDIV_SHIFT (0U) -/*! PDIV - Postdivider divider ratio (P-divider) */ -#define SCG_APLLPDIV_PDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLPDIV_PDIV_SHIFT)) & SCG_APLLPDIV_PDIV_MASK) - -#define SCG_APLLPDIV_PREQ_MASK (0x80000000U) -#define SCG_APLLPDIV_PREQ_SHIFT (31U) -/*! PREQ - Postdivider ratio change request - * 0b0..Postdivider ratio change is not requested - * 0b1..Postdivider ratio change is requested - */ -#define SCG_APLLPDIV_PREQ(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLPDIV_PREQ_SHIFT)) & SCG_APLLPDIV_PREQ_MASK) -/*! @} */ - -/*! @name APLLLOCK_CNFG - APLL LOCK Configuration Register */ -/*! @{ */ - -#define SCG_APLLLOCK_CNFG_LOCK_TIME_MASK (0x1FFFFU) -#define SCG_APLLLOCK_CNFG_LOCK_TIME_SHIFT (0U) -/*! LOCK_TIME - Configures the number of reference clocks to count before APLL is considered locked. */ -#define SCG_APLLLOCK_CNFG_LOCK_TIME(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLLOCK_CNFG_LOCK_TIME_SHIFT)) & SCG_APLLLOCK_CNFG_LOCK_TIME_MASK) -/*! @} */ - -/*! @name APLLSSCGSTAT - APLL SSCG Status Register */ -/*! @{ */ - -#define SCG_APLLSSCGSTAT_SS_MDIV_ACK_MASK (0x1U) -#define SCG_APLLSSCGSTAT_SS_MDIV_ACK_SHIFT (0U) -/*! SS_MDIV_ACK - SS_MDIV change acknowledge - * 0b0..The SS_MDIV, MF, MR, and MC ratio change is not accepted by the analog PLL - * 0b1..The SS_MDIV, MF, MR, and MC ratio change is accepted by the analog PLL - */ -#define SCG_APLLSSCGSTAT_SS_MDIV_ACK(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSSCGSTAT_SS_MDIV_ACK_SHIFT)) & SCG_APLLSSCGSTAT_SS_MDIV_ACK_MASK) -/*! @} */ - -/*! @name APLLSSCG0 - APLL Spread Spectrum Control 0 Register */ -/*! @{ */ - -#define SCG_APLLSSCG0_SS_MDIV_LSB_MASK (0xFFFFFFFFU) -#define SCG_APLLSSCG0_SS_MDIV_LSB_SHIFT (0U) -/*! SS_MDIV_LSB - SS_MDIV */ -#define SCG_APLLSSCG0_SS_MDIV_LSB(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSSCG0_SS_MDIV_LSB_SHIFT)) & SCG_APLLSSCG0_SS_MDIV_LSB_MASK) -/*! @} */ - -/*! @name APLLSSCG1 - APLL Spread Spectrum Control 1 Register */ -/*! @{ */ - -#define SCG_APLLSSCG1_SS_MDIV_MSB_MASK (0x1U) -#define SCG_APLLSSCG1_SS_MDIV_MSB_SHIFT (0U) -/*! SS_MDIV_MSB - SS_MDIV[32] */ -#define SCG_APLLSSCG1_SS_MDIV_MSB(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSSCG1_SS_MDIV_MSB_SHIFT)) & SCG_APLLSSCG1_SS_MDIV_MSB_MASK) - -#define SCG_APLLSSCG1_SS_MDIV_REQ_MASK (0x2U) -#define SCG_APLLSSCG1_SS_MDIV_REQ_SHIFT (1U) -/*! SS_MDIV_REQ - SS_MDIV[32:0] change request. - * 0b0..SS_MDIV change is not requested - * 0b1..SS_MDIV change is requested - */ -#define SCG_APLLSSCG1_SS_MDIV_REQ(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSSCG1_SS_MDIV_REQ_SHIFT)) & SCG_APLLSSCG1_SS_MDIV_REQ_MASK) - -#define SCG_APLLSSCG1_MF_MASK (0x1CU) -#define SCG_APLLSSCG1_MF_SHIFT (2U) -/*! MF - Modulation Frequency Control */ -#define SCG_APLLSSCG1_MF(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSSCG1_MF_SHIFT)) & SCG_APLLSSCG1_MF_MASK) - -#define SCG_APLLSSCG1_MR_MASK (0xE0U) -#define SCG_APLLSSCG1_MR_SHIFT (5U) -/*! MR - Modulation Depth Control */ -#define SCG_APLLSSCG1_MR(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSSCG1_MR_SHIFT)) & SCG_APLLSSCG1_MR_MASK) - -#define SCG_APLLSSCG1_MC_MASK (0x300U) -#define SCG_APLLSSCG1_MC_SHIFT (8U) -/*! MC - Modulation Waveform Control - * 0b00..MC[1:0] no compensation - * 0b11..MC[1:0] maximum compensation - */ -#define SCG_APLLSSCG1_MC(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSSCG1_MC_SHIFT)) & SCG_APLLSSCG1_MC_MASK) - -#define SCG_APLLSSCG1_DITHER_MASK (0x400U) -#define SCG_APLLSSCG1_DITHER_SHIFT (10U) -/*! DITHER - Dither Enable - * 0b0..Dither is not enabled - * 0b1..Dither is enabled - */ -#define SCG_APLLSSCG1_DITHER(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSSCG1_DITHER_SHIFT)) & SCG_APLLSSCG1_DITHER_MASK) - -#define SCG_APLLSSCG1_SEL_SS_MDIV_MASK (0x800U) -#define SCG_APLLSSCG1_SEL_SS_MDIV_SHIFT (11U) -/*! SEL_SS_MDIV - SS_MDIV select. - * 0b0..Feedback divider ratio is MDIV[15:0] - * 0b1..Feedback divider ratio is SS_MDIV[32:0] - */ -#define SCG_APLLSSCG1_SEL_SS_MDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSSCG1_SEL_SS_MDIV_SHIFT)) & SCG_APLLSSCG1_SEL_SS_MDIV_MASK) - -#define SCG_APLLSSCG1_SS_PD_MASK (0x80000000U) -#define SCG_APLLSSCG1_SS_PD_SHIFT (31U) -/*! SS_PD - SSCG Power Down - * 0b0..SSCG is powered on - * 0b1..SSCG is powered off - */ -#define SCG_APLLSSCG1_SS_PD(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLLSSCG1_SS_PD_SHIFT)) & SCG_APLLSSCG1_SS_PD_MASK) -/*! @} */ - -/*! @name APLL_OVRD - APLL Override Register */ -/*! @{ */ - -#define SCG_APLL_OVRD_APLLPWREN_OVRD_MASK (0x1U) -#define SCG_APLL_OVRD_APLLPWREN_OVRD_SHIFT (0U) -/*! APLLPWREN_OVRD - APLL Power Enable Override if APLL_OVRD_EN=1 - * 0b0..APLL clock is powered off - * 0b1..APLL clock is powered on - */ -#define SCG_APLL_OVRD_APLLPWREN_OVRD(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLL_OVRD_APLLPWREN_OVRD_SHIFT)) & SCG_APLL_OVRD_APLLPWREN_OVRD_MASK) - -#define SCG_APLL_OVRD_APLLCLKEN_OVRD_MASK (0x2U) -#define SCG_APLL_OVRD_APLLCLKEN_OVRD_SHIFT (1U) -/*! APLLCLKEN_OVRD - APLL Clock Enable Override if APLL_OVRD_EN=1 - * 0b0..APLL clock is disabled - * 0b1..APLL clock is enabled - */ -#define SCG_APLL_OVRD_APLLCLKEN_OVRD(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLL_OVRD_APLLCLKEN_OVRD_SHIFT)) & SCG_APLL_OVRD_APLLCLKEN_OVRD_MASK) - -#define SCG_APLL_OVRD_APLL_OVRD_EN_MASK (0x80000000U) -#define SCG_APLL_OVRD_APLL_OVRD_EN_SHIFT (31U) -/*! APLL_OVRD_EN - APLL Override Enable - * 0b0..APLL override is disabled - * 0b1..APLL override is enabled - */ -#define SCG_APLL_OVRD_APLL_OVRD_EN(x) (((uint32_t)(((uint32_t)(x)) << SCG_APLL_OVRD_APLL_OVRD_EN_SHIFT)) & SCG_APLL_OVRD_APLL_OVRD_EN_MASK) -/*! @} */ - -/*! @name SPLLCSR - SPLL Control Status Register */ -/*! @{ */ - -#define SCG_SPLLCSR_SPLLPWREN_MASK (0x1U) -#define SCG_SPLLCSR_SPLLPWREN_SHIFT (0U) -/*! SPLLPWREN - SPLL Power Enable - * 0b0..SPLL clock is powered off - * 0b1..SPLL clock is powered on - */ -#define SCG_SPLLCSR_SPLLPWREN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_SPLLPWREN_SHIFT)) & SCG_SPLLCSR_SPLLPWREN_MASK) - -#define SCG_SPLLCSR_SPLLCLKEN_MASK (0x2U) -#define SCG_SPLLCSR_SPLLCLKEN_SHIFT (1U) -/*! SPLLCLKEN - SPLL Clock Enable - * 0b0..SPLL clock is disabled - * 0b1..SPLL clock is enabled - */ -#define SCG_SPLLCSR_SPLLCLKEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_SPLLCLKEN_SHIFT)) & SCG_SPLLCSR_SPLLCLKEN_MASK) - -#define SCG_SPLLCSR_SPLLSTEN_MASK (0x4U) -#define SCG_SPLLCSR_SPLLSTEN_SHIFT (2U) -/*! SPLLSTEN - SPLL Stop Enable - * 0b0..SPLL is disabled in Deep Sleep mode - * 0b1..SPLL is enabled in Deep Sleep mode - */ -#define SCG_SPLLCSR_SPLLSTEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_SPLLSTEN_SHIFT)) & SCG_SPLLCSR_SPLLSTEN_MASK) - -#define SCG_SPLLCSR_SPLLCM_MASK (0x10000U) -#define SCG_SPLLCSR_SPLLCM_SHIFT (16U) -/*! SPLLCM - SPLL Clock Monitor - * 0b0..SPLL Clock Monitor is disabled - * 0b1..SPLL Clock Monitor is enabled - */ -#define SCG_SPLLCSR_SPLLCM(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_SPLLCM_SHIFT)) & SCG_SPLLCSR_SPLLCM_MASK) - -#define SCG_SPLLCSR_SPLLCMRE_MASK (0x20000U) -#define SCG_SPLLCSR_SPLLCMRE_SHIFT (17U) -/*! SPLLCMRE - SPLL Clock Monitor Reset Enable - * 0b0..Clock monitor generates an interrupt when an error is detected - * 0b1..Clock monitor generates a reset when an error is detected - */ -#define SCG_SPLLCSR_SPLLCMRE(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_SPLLCMRE_SHIFT)) & SCG_SPLLCSR_SPLLCMRE_MASK) - -#define SCG_SPLLCSR_LK_MASK (0x800000U) -#define SCG_SPLLCSR_LK_SHIFT (23U) -/*! LK - Lock Register - * 0b0..Control Status Register can be written - * 0b1..Control Status Register cannot be written - */ -#define SCG_SPLLCSR_LK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_LK_SHIFT)) & SCG_SPLLCSR_LK_MASK) - -#define SCG_SPLLCSR_SPLL_LOCK_MASK (0x1000000U) -#define SCG_SPLLCSR_SPLL_LOCK_SHIFT (24U) -/*! SPLL_LOCK - SPLL LOCK - * 0b0..SPLL is not powered on or not locked - * 0b1..SPLL is locked - */ -#define SCG_SPLLCSR_SPLL_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_SPLL_LOCK_SHIFT)) & SCG_SPLLCSR_SPLL_LOCK_MASK) - -#define SCG_SPLLCSR_SPLLSEL_MASK (0x2000000U) -#define SCG_SPLLCSR_SPLLSEL_SHIFT (25U) -/*! SPLLSEL - SPLL Selected - * 0b0..SPLL is not the system clock source - * 0b1..SPLL is the system clock source - */ -#define SCG_SPLLCSR_SPLLSEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_SPLLSEL_SHIFT)) & SCG_SPLLCSR_SPLLSEL_MASK) - -#define SCG_SPLLCSR_SPLLERR_MASK (0x4000000U) -#define SCG_SPLLCSR_SPLLERR_SHIFT (26U) -/*! SPLLERR - SPLL Clock Error - * 0b0..SPLL Clock Monitor is disabled or has not detected an error - * 0b1..SPLL Clock Monitor is enabled and detected an error - */ -#define SCG_SPLLCSR_SPLLERR(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_SPLLERR_SHIFT)) & SCG_SPLLCSR_SPLLERR_MASK) - -#define SCG_SPLLCSR_SPLL_LOCK_IE_MASK (0x40000000U) -#define SCG_SPLLCSR_SPLL_LOCK_IE_SHIFT (30U) -/*! SPLL_LOCK_IE - SPLL LOCK Interrupt Enable - * 0b0..SPLL_LOCK interrupt is not enabled - * 0b1..SPLL_LOCK interrupt is enabled - */ -#define SCG_SPLLCSR_SPLL_LOCK_IE(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCSR_SPLL_LOCK_IE_SHIFT)) & SCG_SPLLCSR_SPLL_LOCK_IE_MASK) -/*! @} */ - -/*! @name SPLLCTRL - SPLL Control Register */ -/*! @{ */ - -#define SCG_SPLLCTRL_SELR_MASK (0xFU) -#define SCG_SPLLCTRL_SELR_SHIFT (0U) -/*! SELR - Bandwidth select R (resistor) value. */ -#define SCG_SPLLCTRL_SELR(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCTRL_SELR_SHIFT)) & SCG_SPLLCTRL_SELR_MASK) - -#define SCG_SPLLCTRL_SELI_MASK (0x3F0U) -#define SCG_SPLLCTRL_SELI_SHIFT (4U) -/*! SELI - Bandwidth select I (integration) value. */ -#define SCG_SPLLCTRL_SELI(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCTRL_SELI_SHIFT)) & SCG_SPLLCTRL_SELI_MASK) - -#define SCG_SPLLCTRL_SELP_MASK (0x7C00U) -#define SCG_SPLLCTRL_SELP_SHIFT (10U) -/*! SELP - Bandwidth select P (proportional) value. */ -#define SCG_SPLLCTRL_SELP(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCTRL_SELP_SHIFT)) & SCG_SPLLCTRL_SELP_MASK) - -#define SCG_SPLLCTRL_BYPASSPOSTDIV2_MASK (0x10000U) -#define SCG_SPLLCTRL_BYPASSPOSTDIV2_SHIFT (16U) -/*! BYPASSPOSTDIV2 - Bypass of Divide-by-2 Divider - * 0b0..Use the divide-by-2 divider in the postdivider. - * 0b1..Bypass of the divide-by-2 divider in the postdivider - */ -#define SCG_SPLLCTRL_BYPASSPOSTDIV2(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCTRL_BYPASSPOSTDIV2_SHIFT)) & SCG_SPLLCTRL_BYPASSPOSTDIV2_MASK) - -#define SCG_SPLLCTRL_LIMUPOFF_MASK (0x20000U) -#define SCG_SPLLCTRL_LIMUPOFF_SHIFT (17U) -/*! LIMUPOFF - Up Limiter. - * 0b0..Application set to non-Spectrum and Fractional applications. - * 0b1..Application set to Spectrum and Fractional applications. - */ -#define SCG_SPLLCTRL_LIMUPOFF(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCTRL_LIMUPOFF_SHIFT)) & SCG_SPLLCTRL_LIMUPOFF_MASK) - -#define SCG_SPLLCTRL_BANDDIRECT_MASK (0x40000U) -#define SCG_SPLLCTRL_BANDDIRECT_SHIFT (18U) -/*! BANDDIRECT - Control of the bandwidth of the PLL. - * 0b0..The bandwidth is changed synchronously with the feedback-divider - * 0b1..Modifies the bandwidth of the PLL directly - */ -#define SCG_SPLLCTRL_BANDDIRECT(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCTRL_BANDDIRECT_SHIFT)) & SCG_SPLLCTRL_BANDDIRECT_MASK) - -#define SCG_SPLLCTRL_BYPASSPREDIV_MASK (0x80000U) -#define SCG_SPLLCTRL_BYPASSPREDIV_SHIFT (19U) -/*! BYPASSPREDIV - Bypass of the predivider. - * 0b0..Use the predivider - * 0b1..Bypass of the predivider - */ -#define SCG_SPLLCTRL_BYPASSPREDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCTRL_BYPASSPREDIV_SHIFT)) & SCG_SPLLCTRL_BYPASSPREDIV_MASK) - -#define SCG_SPLLCTRL_BYPASSPOSTDIV_MASK (0x100000U) -#define SCG_SPLLCTRL_BYPASSPOSTDIV_SHIFT (20U) -/*! BYPASSPOSTDIV - Bypass of the postdivider. - * 0b0..Use the postdivider - * 0b1..Bypass of the postdivider - */ -#define SCG_SPLLCTRL_BYPASSPOSTDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCTRL_BYPASSPOSTDIV_SHIFT)) & SCG_SPLLCTRL_BYPASSPOSTDIV_MASK) - -#define SCG_SPLLCTRL_SOURCE_MASK (0x6000000U) -#define SCG_SPLLCTRL_SOURCE_SHIFT (25U) -/*! SOURCE - Clock Source - * 0b00..SOSC - * 0b01..FIRC 48 MHz clock. FIRC_SCLK_PERIPH_EN must be set to use FIRC 48 MHz clock. - * 0b10..Reserved - * 0b11..No clock - */ -#define SCG_SPLLCTRL_SOURCE(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLCTRL_SOURCE_SHIFT)) & SCG_SPLLCTRL_SOURCE_MASK) -/*! @} */ - -/*! @name SPLLSTAT - SPLL Status Register */ -/*! @{ */ - -#define SCG_SPLLSTAT_NDIVACK_MASK (0x2U) -#define SCG_SPLLSTAT_NDIVACK_SHIFT (1U) -/*! NDIVACK - Predivider (N) ratio change acknowledge - * 0b0..The predivider (N) ratio change is not accepted by the analog PLL. - * 0b1..The predivider (N) ratio change is accepted by the analog PLL. - */ -#define SCG_SPLLSTAT_NDIVACK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSTAT_NDIVACK_SHIFT)) & SCG_SPLLSTAT_NDIVACK_MASK) - -#define SCG_SPLLSTAT_MDIVACK_MASK (0x4U) -#define SCG_SPLLSTAT_MDIVACK_SHIFT (2U) -/*! MDIVACK - Feedback (M) divider ratio change acknowledge - * 0b0..The feedback (M) ratio change is not accepted by the analog PLL. - * 0b1..The feedback (M) ratio change is accepted by the analog PLL. - */ -#define SCG_SPLLSTAT_MDIVACK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSTAT_MDIVACK_SHIFT)) & SCG_SPLLSTAT_MDIVACK_MASK) - -#define SCG_SPLLSTAT_PDIVACK_MASK (0x8U) -#define SCG_SPLLSTAT_PDIVACK_SHIFT (3U) -/*! PDIVACK - Postdivider (P) ratio change acknowledge - * 0b0..The postdivider (P) ratio change is not accepted by the analog PLL - * 0b1..The postdivider (P) ratio change is accepted by the analog PLL - */ -#define SCG_SPLLSTAT_PDIVACK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSTAT_PDIVACK_SHIFT)) & SCG_SPLLSTAT_PDIVACK_MASK) -/*! @} */ - -/*! @name SPLLNDIV - SPLL N Divider Register */ -/*! @{ */ - -#define SCG_SPLLNDIV_NDIV_MASK (0xFFU) -#define SCG_SPLLNDIV_NDIV_SHIFT (0U) -/*! NDIV - Predivider divider ratio (N-divider). */ -#define SCG_SPLLNDIV_NDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLNDIV_NDIV_SHIFT)) & SCG_SPLLNDIV_NDIV_MASK) - -#define SCG_SPLLNDIV_NREQ_MASK (0x80000000U) -#define SCG_SPLLNDIV_NREQ_SHIFT (31U) -/*! NREQ - Predivider ratio change request. - * 0b0..Predivider ratio change is not requested - * 0b1..Predivider ratio change is requested - */ -#define SCG_SPLLNDIV_NREQ(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLNDIV_NREQ_SHIFT)) & SCG_SPLLNDIV_NREQ_MASK) -/*! @} */ - -/*! @name SPLLMDIV - SPLL M Divider Register */ -/*! @{ */ - -#define SCG_SPLLMDIV_MDIV_MASK (0xFFFFU) -#define SCG_SPLLMDIV_MDIV_SHIFT (0U) -/*! MDIV - Feedback divider divider ratio (M-divider). */ -#define SCG_SPLLMDIV_MDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLMDIV_MDIV_SHIFT)) & SCG_SPLLMDIV_MDIV_MASK) - -#define SCG_SPLLMDIV_MREQ_MASK (0x80000000U) -#define SCG_SPLLMDIV_MREQ_SHIFT (31U) -/*! MREQ - Feedback ratio change request. - * 0b0..Feedback ratio change is not requested - * 0b1..Feedback ratio change is requested - */ -#define SCG_SPLLMDIV_MREQ(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLMDIV_MREQ_SHIFT)) & SCG_SPLLMDIV_MREQ_MASK) -/*! @} */ - -/*! @name SPLLPDIV - SPLL P Divider Register */ -/*! @{ */ - -#define SCG_SPLLPDIV_PDIV_MASK (0x1FU) -#define SCG_SPLLPDIV_PDIV_SHIFT (0U) -/*! PDIV - Postdivider divider ratio (P-divider) */ -#define SCG_SPLLPDIV_PDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLPDIV_PDIV_SHIFT)) & SCG_SPLLPDIV_PDIV_MASK) - -#define SCG_SPLLPDIV_PREQ_MASK (0x80000000U) -#define SCG_SPLLPDIV_PREQ_SHIFT (31U) -/*! PREQ - Postdivider ratio change request - * 0b0..Postdivider ratio change is not requested - * 0b1..Postdivider ratio change is requested - */ -#define SCG_SPLLPDIV_PREQ(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLPDIV_PREQ_SHIFT)) & SCG_SPLLPDIV_PREQ_MASK) -/*! @} */ - -/*! @name SPLLLOCK_CNFG - SPLL LOCK Configuration Register */ -/*! @{ */ - -#define SCG_SPLLLOCK_CNFG_LOCK_TIME_MASK (0x1FFFFU) -#define SCG_SPLLLOCK_CNFG_LOCK_TIME_SHIFT (0U) -/*! LOCK_TIME - Configures the number of reference clocks to count before SPLL is considered locked. */ -#define SCG_SPLLLOCK_CNFG_LOCK_TIME(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLLOCK_CNFG_LOCK_TIME_SHIFT)) & SCG_SPLLLOCK_CNFG_LOCK_TIME_MASK) -/*! @} */ - -/*! @name SPLLSSCGSTAT - SPLL SSCG Status Register */ -/*! @{ */ - -#define SCG_SPLLSSCGSTAT_SS_MDIV_ACK_MASK (0x1U) -#define SCG_SPLLSSCGSTAT_SS_MDIV_ACK_SHIFT (0U) -/*! SS_MDIV_ACK - SS_MDIV change acknowledge - * 0b0..The SS_MDIV, MF, MR, and MC ratio change is not accepted by the analog PLL - * 0b1..The SS_MDIV, MF, MR, and MC ratio change is accepted by the analog PLL - */ -#define SCG_SPLLSSCGSTAT_SS_MDIV_ACK(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSSCGSTAT_SS_MDIV_ACK_SHIFT)) & SCG_SPLLSSCGSTAT_SS_MDIV_ACK_MASK) -/*! @} */ - -/*! @name SPLLSSCG0 - SPLL Spread Spectrum Control 0 Register */ -/*! @{ */ - -#define SCG_SPLLSSCG0_SS_MDIV_LSB_MASK (0xFFFFFFFFU) -#define SCG_SPLLSSCG0_SS_MDIV_LSB_SHIFT (0U) -/*! SS_MDIV_LSB - SS_MDIV[31:0] */ -#define SCG_SPLLSSCG0_SS_MDIV_LSB(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSSCG0_SS_MDIV_LSB_SHIFT)) & SCG_SPLLSSCG0_SS_MDIV_LSB_MASK) -/*! @} */ - -/*! @name SPLLSSCG1 - SPLL Spread Spectrum Control 1 Register */ -/*! @{ */ - -#define SCG_SPLLSSCG1_SS_MDIV_MSB_MASK (0x1U) -#define SCG_SPLLSSCG1_SS_MDIV_MSB_SHIFT (0U) -/*! SS_MDIV_MSB - SS_MDIV[32] */ -#define SCG_SPLLSSCG1_SS_MDIV_MSB(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSSCG1_SS_MDIV_MSB_SHIFT)) & SCG_SPLLSSCG1_SS_MDIV_MSB_MASK) - -#define SCG_SPLLSSCG1_SS_MDIV_REQ_MASK (0x2U) -#define SCG_SPLLSSCG1_SS_MDIV_REQ_SHIFT (1U) -/*! SS_MDIV_REQ - SS_MDIV[32:0] change request. - * 0b0..SS_MDIV change is not requested - * 0b1..SS_MDIV change is requested - */ -#define SCG_SPLLSSCG1_SS_MDIV_REQ(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSSCG1_SS_MDIV_REQ_SHIFT)) & SCG_SPLLSSCG1_SS_MDIV_REQ_MASK) - -#define SCG_SPLLSSCG1_MF_MASK (0x1CU) -#define SCG_SPLLSSCG1_MF_SHIFT (2U) -/*! MF - Modulation Frequency Control */ -#define SCG_SPLLSSCG1_MF(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSSCG1_MF_SHIFT)) & SCG_SPLLSSCG1_MF_MASK) - -#define SCG_SPLLSSCG1_MR_MASK (0xE0U) -#define SCG_SPLLSSCG1_MR_SHIFT (5U) -/*! MR - Modulation Depth Control */ -#define SCG_SPLLSSCG1_MR(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSSCG1_MR_SHIFT)) & SCG_SPLLSSCG1_MR_MASK) - -#define SCG_SPLLSSCG1_MC_MASK (0x300U) -#define SCG_SPLLSSCG1_MC_SHIFT (8U) -/*! MC - Modulation Waveform Control - * 0b00..MC[1:0] no compensation - * 0b11..MC[1:0] maximum compensation - */ -#define SCG_SPLLSSCG1_MC(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSSCG1_MC_SHIFT)) & SCG_SPLLSSCG1_MC_MASK) - -#define SCG_SPLLSSCG1_DITHER_MASK (0x400U) -#define SCG_SPLLSSCG1_DITHER_SHIFT (10U) -/*! DITHER - Dither Enable - * 0b0..Dither is not enabled - * 0b1..Dither is enabled - */ -#define SCG_SPLLSSCG1_DITHER(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSSCG1_DITHER_SHIFT)) & SCG_SPLLSSCG1_DITHER_MASK) - -#define SCG_SPLLSSCG1_SEL_SS_MDIV_MASK (0x800U) -#define SCG_SPLLSSCG1_SEL_SS_MDIV_SHIFT (11U) -/*! SEL_SS_MDIV - SS_MDIV select. - * 0b0..Feedback divider ratio is MDIV[15:0] - * 0b1..Feedback divider ratio is SS_MDIV[32:0] - */ -#define SCG_SPLLSSCG1_SEL_SS_MDIV(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSSCG1_SEL_SS_MDIV_SHIFT)) & SCG_SPLLSSCG1_SEL_SS_MDIV_MASK) - -#define SCG_SPLLSSCG1_SS_PD_MASK (0x80000000U) -#define SCG_SPLLSSCG1_SS_PD_SHIFT (31U) -/*! SS_PD - SSCG Power Down - * 0b0..SSCG is powered on - * 0b1..SSCG is powered off - */ -#define SCG_SPLLSSCG1_SS_PD(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLLSSCG1_SS_PD_SHIFT)) & SCG_SPLLSSCG1_SS_PD_MASK) -/*! @} */ - -/*! @name SPLL_OVRD - SPLL Override Register */ -/*! @{ */ - -#define SCG_SPLL_OVRD_SPLLPWREN_OVRD_MASK (0x1U) -#define SCG_SPLL_OVRD_SPLLPWREN_OVRD_SHIFT (0U) -/*! SPLLPWREN_OVRD - SPLL Power Enable Override if SPLL_OVRD_EN=1 - * 0b0..SPLL clock is powered off - * 0b1..SPLL clock is powered on - */ -#define SCG_SPLL_OVRD_SPLLPWREN_OVRD(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLL_OVRD_SPLLPWREN_OVRD_SHIFT)) & SCG_SPLL_OVRD_SPLLPWREN_OVRD_MASK) - -#define SCG_SPLL_OVRD_SPLLCLKEN_OVRD_MASK (0x2U) -#define SCG_SPLL_OVRD_SPLLCLKEN_OVRD_SHIFT (1U) -/*! SPLLCLKEN_OVRD - SPLL Clock Enable Override if SPLL_OVRD_EN=1 - * 0b0..SPLL clock is disabled - * 0b1..SPLL clock is enabled - */ -#define SCG_SPLL_OVRD_SPLLCLKEN_OVRD(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLL_OVRD_SPLLCLKEN_OVRD_SHIFT)) & SCG_SPLL_OVRD_SPLLCLKEN_OVRD_MASK) - -#define SCG_SPLL_OVRD_SPLL_OVRD_EN_MASK (0x80000000U) -#define SCG_SPLL_OVRD_SPLL_OVRD_EN_SHIFT (31U) -/*! SPLL_OVRD_EN - SPLL Override Enable - * 0b0..SPLL override is disabled - * 0b1..SPLL override is enabled - */ -#define SCG_SPLL_OVRD_SPLL_OVRD_EN(x) (((uint32_t)(((uint32_t)(x)) << SCG_SPLL_OVRD_SPLL_OVRD_EN_SHIFT)) & SCG_SPLL_OVRD_SPLL_OVRD_EN_MASK) -/*! @} */ - -/*! @name UPLLCSR - UPLL Control Status Register */ -/*! @{ */ - -#define SCG_UPLLCSR_UPLLCM_MASK (0x10000U) -#define SCG_UPLLCSR_UPLLCM_SHIFT (16U) -/*! UPLLCM - UPLL Clock Monitor - * 0b0..UPLL Clock Monitor is disabled - * 0b1..UPLL Clock Monitor is enabled - */ -#define SCG_UPLLCSR_UPLLCM(x) (((uint32_t)(((uint32_t)(x)) << SCG_UPLLCSR_UPLLCM_SHIFT)) & SCG_UPLLCSR_UPLLCM_MASK) - -#define SCG_UPLLCSR_UPLLCMRE_MASK (0x20000U) -#define SCG_UPLLCSR_UPLLCMRE_SHIFT (17U) -/*! UPLLCMRE - UPLL Clock Monitor Reset Enable - * 0b0..Clock monitor generates an interrupt when an error is detected - * 0b1..Clock monitor generates a reset when an error is detected - */ -#define SCG_UPLLCSR_UPLLCMRE(x) (((uint32_t)(((uint32_t)(x)) << SCG_UPLLCSR_UPLLCMRE_SHIFT)) & SCG_UPLLCSR_UPLLCMRE_MASK) - -#define SCG_UPLLCSR_LK_MASK (0x800000U) -#define SCG_UPLLCSR_LK_SHIFT (23U) -/*! LK - Lock Register - * 0b0..Control Status Register can be written - * 0b1..Control Status Register cannot be written - */ -#define SCG_UPLLCSR_LK(x) (((uint32_t)(((uint32_t)(x)) << SCG_UPLLCSR_LK_SHIFT)) & SCG_UPLLCSR_LK_MASK) - -#define SCG_UPLLCSR_UPLLVLD_MASK (0x1000000U) -#define SCG_UPLLCSR_UPLLVLD_SHIFT (24U) -/*! UPLLVLD - UPLL Valid - * 0b0..UPLL is not enabled or clock is not valid - * 0b1..UPLL is enabled and output clock is valid - */ -#define SCG_UPLLCSR_UPLLVLD(x) (((uint32_t)(((uint32_t)(x)) << SCG_UPLLCSR_UPLLVLD_SHIFT)) & SCG_UPLLCSR_UPLLVLD_MASK) - -#define SCG_UPLLCSR_UPLLSEL_MASK (0x2000000U) -#define SCG_UPLLCSR_UPLLSEL_SHIFT (25U) -/*! UPLLSEL - UPLL Selected - * 0b0..UPLL is not the system clock source - * 0b1..UPLL is the system clock source - */ -#define SCG_UPLLCSR_UPLLSEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_UPLLCSR_UPLLSEL_SHIFT)) & SCG_UPLLCSR_UPLLSEL_MASK) - -#define SCG_UPLLCSR_UPLLERR_MASK (0x4000000U) -#define SCG_UPLLCSR_UPLLERR_SHIFT (26U) -/*! UPLLERR - UPLL Clock Error - * 0b0..UPLL Clock Monitor is disabled or has not detected an error - * 0b1..UPLL Clock Monitor is enabled and detected an error - */ -#define SCG_UPLLCSR_UPLLERR(x) (((uint32_t)(((uint32_t)(x)) << SCG_UPLLCSR_UPLLERR_SHIFT)) & SCG_UPLLCSR_UPLLERR_MASK) -/*! @} */ - -/*! @name LDOCSR - LDO Control and Status Register */ -/*! @{ */ - -#define SCG_LDOCSR_LDOEN_MASK (0x1U) -#define SCG_LDOCSR_LDOEN_SHIFT (0U) -/*! LDOEN - LDO Enable - * 0b0..LDO is disabled - * 0b1..LDO is enabled - */ -#define SCG_LDOCSR_LDOEN(x) (((uint32_t)(((uint32_t)(x)) << SCG_LDOCSR_LDOEN_SHIFT)) & SCG_LDOCSR_LDOEN_MASK) - -#define SCG_LDOCSR_VOUT_SEL_MASK (0xEU) -#define SCG_LDOCSR_VOUT_SEL_SHIFT (1U) -/*! VOUT_SEL - LDO output voltage select - * 0b000..VOUT = 1V - * 0b001..VOUT = 1V - * 0b010..VOUT = 1V - * 0b011..VOUT = 1.05V - * 0b100..VOUT = 1.1V - * 0b101..VOUT = 1.15V - * 0b110..VOUT = 1.2V - * 0b111..VOUT = 1.25V - */ -#define SCG_LDOCSR_VOUT_SEL(x) (((uint32_t)(((uint32_t)(x)) << SCG_LDOCSR_VOUT_SEL_SHIFT)) & SCG_LDOCSR_VOUT_SEL_MASK) - -#define SCG_LDOCSR_LDOBYPASS_MASK (0x10U) -#define SCG_LDOCSR_LDOBYPASS_SHIFT (4U) -/*! LDOBYPASS - LDO Bypass - * 0b0..LDO is not bypassed - * 0b1..LDO is bypassed - */ -#define SCG_LDOCSR_LDOBYPASS(x) (((uint32_t)(((uint32_t)(x)) << SCG_LDOCSR_LDOBYPASS_SHIFT)) & SCG_LDOCSR_LDOBYPASS_MASK) - -#define SCG_LDOCSR_VOUT_OK_MASK (0x80000000U) -#define SCG_LDOCSR_VOUT_OK_SHIFT (31U) -/*! VOUT_OK - LDO VOUT OK Inform. - * 0b0..LDO output VOUT is not OK - * 0b1..LDO output VOUT is OK - */ -#define SCG_LDOCSR_VOUT_OK(x) (((uint32_t)(((uint32_t)(x)) << SCG_LDOCSR_VOUT_OK_SHIFT)) & SCG_LDOCSR_VOUT_OK_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group SCG_Register_Masks */ - - -/* SCG - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral SCG0 base address */ - #define SCG0_BASE (0x50044000u) - /** Peripheral SCG0 base address */ - #define SCG0_BASE_NS (0x40044000u) - /** Peripheral SCG0 base pointer */ - #define SCG0 ((SCG_Type *)SCG0_BASE) - /** Peripheral SCG0 base pointer */ - #define SCG0_NS ((SCG_Type *)SCG0_BASE_NS) - /** Array initializer of SCG peripheral base addresses */ - #define SCG_BASE_ADDRS { SCG0_BASE } - /** Array initializer of SCG peripheral base pointers */ - #define SCG_BASE_PTRS { SCG0 } - /** Array initializer of SCG peripheral base addresses */ - #define SCG_BASE_ADDRS_NS { SCG0_BASE_NS } - /** Array initializer of SCG peripheral base pointers */ - #define SCG_BASE_PTRS_NS { SCG0_NS } -#else - /** Peripheral SCG0 base address */ - #define SCG0_BASE (0x40044000u) - /** Peripheral SCG0 base pointer */ - #define SCG0 ((SCG_Type *)SCG0_BASE) - /** Array initializer of SCG peripheral base addresses */ - #define SCG_BASE_ADDRS { SCG0_BASE } - /** Array initializer of SCG peripheral base pointers */ - #define SCG_BASE_PTRS { SCG0 } -#endif - -/*! - * @} - */ /* end of group SCG_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- SCT Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SCT_Peripheral_Access_Layer SCT Peripheral Access Layer - * @{ - */ - -/** SCT - Register Layout Typedef */ -typedef struct { - __IO uint32_t CONFIG; /**< SCT Configuration, offset: 0x0 */ - union { /* offset: 0x4 */ - struct { /* offset: 0x4 */ - __IO uint16_t CTRLL; /**< SCT_CTRLL register, offset: 0x4 */ - __IO uint16_t CTRLH; /**< SCT_CTRLH register, offset: 0x6 */ - } CTRL_ACCESS16BIT; - __IO uint32_t CTRL; /**< SCT Control, offset: 0x4 */ - }; - union { /* offset: 0x8 */ - struct { /* offset: 0x8 */ - __IO uint16_t LIMITL; /**< SCT_LIMITL register, offset: 0x8 */ - __IO uint16_t LIMITH; /**< SCT_LIMITH register, offset: 0xA */ - } LIMIT_ACCESS16BIT; - __IO uint32_t LIMIT; /**< SCT Limit Event Select, offset: 0x8 */ - }; - union { /* offset: 0xC */ - struct { /* offset: 0xC */ - __IO uint16_t HALTL; /**< SCT_HALTL register, offset: 0xC */ - __IO uint16_t HALTH; /**< SCT_HALTH register, offset: 0xE */ - } HALT_ACCESS16BIT; - __IO uint32_t HALT; /**< Halt Event Select, offset: 0xC */ - }; - union { /* offset: 0x10 */ - struct { /* offset: 0x10 */ - __IO uint16_t STOPL; /**< SCT_STOPL register, offset: 0x10 */ - __IO uint16_t STOPH; /**< SCT_STOPH register, offset: 0x12 */ - } STOP_ACCESS16BIT; - __IO uint32_t STOP; /**< Stop Event Select, offset: 0x10 */ - }; - union { /* offset: 0x14 */ - struct { /* offset: 0x14 */ - __IO uint16_t STARTL; /**< SCT_STARTL register, offset: 0x14 */ - __IO uint16_t STARTH; /**< SCT_STARTH register, offset: 0x16 */ - } START_ACCESS16BIT; - __IO uint32_t START; /**< Start Event Select, offset: 0x14 */ - }; - __IO uint32_t DITHER; /**< Dither Condition, offset: 0x18 */ - uint8_t RESERVED_0[36]; - union { /* offset: 0x40 */ - struct { /* offset: 0x40 */ - __IO uint16_t COUNTL; /**< SCT_COUNTL register, offset: 0x40 */ - __IO uint16_t COUNTH; /**< SCT_COUNTH register, offset: 0x42 */ - } COUNT_ACCESS16BIT; - __IO uint32_t COUNT; /**< Counter Value, offset: 0x40 */ - }; - union { /* offset: 0x44 */ - struct { /* offset: 0x44 */ - __IO uint16_t STATEL; /**< SCT_STATEL register, offset: 0x44 */ - __IO uint16_t STATEH; /**< SCT_STATEH register, offset: 0x46 */ - } STATE_ACCESS16BIT; - __IO uint32_t STATE; /**< State Variable, offset: 0x44 */ - }; - __I uint32_t INPUT; /**< Input State, offset: 0x48 */ - union { /* offset: 0x4C */ - struct { /* offset: 0x4C */ - __IO uint16_t REGMODEL; /**< SCT_REGMODEL register, offset: 0x4C */ - __IO uint16_t REGMODEH; /**< SCT_REGMODEH register, offset: 0x4E */ - } REGMODE_ACCESS16BIT; - __IO uint32_t REGMODE; /**< Match and Capture Register Mode, offset: 0x4C */ - }; - __IO uint32_t OUTPUT; /**< Output State, offset: 0x50 */ - __IO uint32_t OUTPUTDIRCTRL; /**< Output Counter Direction Control, offset: 0x54 */ - __IO uint32_t RES; /**< Output Conflict Resolution, offset: 0x58 */ - __IO uint32_t DMAREQ0; /**< DMA Request 0, offset: 0x5C */ - __IO uint32_t DMAREQ1; /**< DMA Request 1, offset: 0x60 */ - uint8_t RESERVED_1[140]; - __IO uint32_t EVEN; /**< Event Interrupt Enable, offset: 0xF0 */ - __IO uint32_t EVFLAG; /**< Event Flag, offset: 0xF4 */ - __IO uint32_t CONEN; /**< Conflict Interrupt Enable, offset: 0xF8 */ - __IO uint32_t CONFLAG; /**< Conflict Flag, offset: 0xFC */ - union { /* offset: 0x100 */ - union { /* offset: 0x100, array step: 0x4 */ - struct { /* offset: 0x100, array step: 0x4 */ - __IO uint16_t CAPL; /**< SCT_CAPL register, array offset: 0x100, array step: 0x4 */ - __IO uint16_t CAPH; /**< SCT_CAPH register, array offset: 0x102, array step: 0x4 */ - } CAP_ACCESS16BIT[16]; - __IO uint32_t CAP[16]; /**< Capture Value, array offset: 0x100, array step: 0x4 */ - }; - union { /* offset: 0x100, array step: 0x4 */ - struct { /* offset: 0x100, array step: 0x4 */ - __IO uint16_t MATCHL; /**< SCT_MATCHL register, array offset: 0x100, array step: 0x4 */ - __IO uint16_t MATCHH; /**< SCT_MATCHH register, array offset: 0x102, array step: 0x4 */ - } MATCH_ACCESS16BIT[16]; - __IO uint32_t MATCH[16]; /**< Match Value, array offset: 0x100, array step: 0x4 */ - }; - }; - __IO uint32_t FRACMAT[6]; /**< Fractional Match, array offset: 0x140, array step: 0x4 */ - uint8_t RESERVED_2[168]; - union { /* offset: 0x200 */ - union { /* offset: 0x200, array step: 0x4 */ - struct { /* offset: 0x200, array step: 0x4 */ - __IO uint16_t CAPCTRLL; /**< SCT_CAPCTRLL register, array offset: 0x200, array step: 0x4 */ - __IO uint16_t CAPCTRLH; /**< SCT_CAPCTRLH register, array offset: 0x202, array step: 0x4 */ - } CAPCTRL_ACCESS16BIT[16]; - __IO uint32_t CAPCTRL[16]; /**< Capture Control, array offset: 0x200, array step: 0x4 */ - }; - union { /* offset: 0x200, array step: 0x4 */ - struct { /* offset: 0x200, array step: 0x4 */ - __IO uint16_t MATCHRELL; /**< SCT_MATCHRELL register, array offset: 0x200, array step: 0x4 */ - __IO uint16_t MATCHRELH; /**< SCT_MATCHRELH register, array offset: 0x202, array step: 0x4 */ - } MATCHREL_ACCESS16BIT[16]; - __IO uint32_t MATCHREL[16]; /**< Match Reload Value, array offset: 0x200, array step: 0x4 */ - }; - }; - __IO uint32_t FRACMATREL[6]; /**< Fractional Match Reload, array offset: 0x240, array step: 0x4 */ - uint8_t RESERVED_3[168]; - struct { /* offset: 0x300, array step: 0x8 */ - __IO uint32_t STATE; /**< Event n State, array offset: 0x300, array step: 0x8 */ - __IO uint32_t CTRL; /**< Event n Control, array offset: 0x304, array step: 0x8 */ - } EV[16]; - uint8_t RESERVED_4[384]; - struct { /* offset: 0x500, array step: 0x8 */ - __IO uint32_t SET; /**< Output n Set, array offset: 0x500, array step: 0x8 */ - __IO uint32_t CLR; /**< Output n Clear, array offset: 0x504, array step: 0x8 */ - } OUT[10]; -} SCT_Type; - -/* ---------------------------------------------------------------------------- - -- SCT Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SCT_Register_Masks SCT Register Masks - * @{ - */ - -/*! @name CONFIG - SCT Configuration */ -/*! @{ */ - -#define SCT_CONFIG_UNIFY_MASK (0x1U) -#define SCT_CONFIG_UNIFY_SHIFT (0U) -/*! UNIFY - SCT Operation - * 0b0..Dual counters, COUNTER_L and COUNTER_H - * 0b1..Unified counter - */ -#define SCT_CONFIG_UNIFY(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFIG_UNIFY_SHIFT)) & SCT_CONFIG_UNIFY_MASK) - -#define SCT_CONFIG_CLKMODE_MASK (0x6U) -#define SCT_CONFIG_CLKMODE_SHIFT (1U) -/*! CLKMODE - SCT Clock Mode - * 0b00..System Clock mode - * 0b01..Sampled System Clock mode - * 0b10..SCT Input Clock mode - * 0b11..Asynchronous mode - */ -#define SCT_CONFIG_CLKMODE(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFIG_CLKMODE_SHIFT)) & SCT_CONFIG_CLKMODE_MASK) - -#define SCT_CONFIG_CKSEL_MASK (0x78U) -#define SCT_CONFIG_CKSEL_SHIFT (3U) -/*! CKSEL - SCT Clock Select - * 0b0000..Rising edges on input 0 - * 0b0001..Falling edges on input 0 - * 0b0010..Rising edges on input 1 - * 0b0011..Falling edges on input 1 - * 0b0100..Rising edges on input 2 - * 0b0101..Falling edges on input 2 - * 0b0110..Rising edges on input 3 - * 0b0111..Falling edges on input 3 - * 0b1000..Rising edges on input 4 - * 0b1001..Falling edges on input 4 - * 0b1010..Rising edges on input 5 - * 0b1011..Falling edges on input 5 - * 0b1100..Rising edges on input 6 - * 0b1101..Falling edges on input 6 - * 0b1110..Rising edges on input 7 - * 0b1111..Falling edges on input 7 - */ -#define SCT_CONFIG_CKSEL(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFIG_CKSEL_SHIFT)) & SCT_CONFIG_CKSEL_MASK) - -#define SCT_CONFIG_NORELOAD_L_MASK (0x80U) -#define SCT_CONFIG_NORELOAD_L_SHIFT (7U) -/*! NORELOAD_L - No Reload Lower Match - * 0b0..Reloaded - * 0b1..Not reloaded - */ -#define SCT_CONFIG_NORELOAD_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFIG_NORELOAD_L_SHIFT)) & SCT_CONFIG_NORELOAD_L_MASK) - -#define SCT_CONFIG_NORELOAD_H_MASK (0x100U) -#define SCT_CONFIG_NORELOAD_H_SHIFT (8U) -/*! NORELOAD_H - No Reload Higher Match - * 0b0..Reloaded - * 0b1..Not reloaded - */ -#define SCT_CONFIG_NORELOAD_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFIG_NORELOAD_H_SHIFT)) & SCT_CONFIG_NORELOAD_H_MASK) - -#define SCT_CONFIG_INSYNC_MASK (0x1FE00U) -#define SCT_CONFIG_INSYNC_SHIFT (9U) -/*! INSYNC - Input Synchronization */ -#define SCT_CONFIG_INSYNC(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFIG_INSYNC_SHIFT)) & SCT_CONFIG_INSYNC_MASK) - -#define SCT_CONFIG_AUTOLIMIT_L_MASK (0x20000U) -#define SCT_CONFIG_AUTOLIMIT_L_SHIFT (17U) -/*! AUTOLIMIT_L - Auto Limit Lower - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_CONFIG_AUTOLIMIT_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFIG_AUTOLIMIT_L_SHIFT)) & SCT_CONFIG_AUTOLIMIT_L_MASK) - -#define SCT_CONFIG_AUTOLIMIT_H_MASK (0x40000U) -#define SCT_CONFIG_AUTOLIMIT_H_SHIFT (18U) -/*! AUTOLIMIT_H - Auto Limit Higher - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_CONFIG_AUTOLIMIT_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFIG_AUTOLIMIT_H_SHIFT)) & SCT_CONFIG_AUTOLIMIT_H_MASK) -/*! @} */ - -/*! @name CTRLL - SCT_CTRLL register */ -/*! @{ */ - -#define SCT_CTRLL_DOWN_L_MASK (0x1U) -#define SCT_CTRLL_DOWN_L_SHIFT (0U) -/*! DOWN_L - Down Counter Low - * 0b0..Up - * 0b1..Down - */ -#define SCT_CTRLL_DOWN_L(x) (((uint16_t)(((uint16_t)(x)) << SCT_CTRLL_DOWN_L_SHIFT)) & SCT_CTRLL_DOWN_L_MASK) - -#define SCT_CTRLL_STOP_L_MASK (0x2U) -#define SCT_CTRLL_STOP_L_SHIFT (1U) -/*! STOP_L - Stop Counter Low - * 0b0..Disabled - * 0b1..Enabled - */ -#define SCT_CTRLL_STOP_L(x) (((uint16_t)(((uint16_t)(x)) << SCT_CTRLL_STOP_L_SHIFT)) & SCT_CTRLL_STOP_L_MASK) - -#define SCT_CTRLL_HALT_L_MASK (0x4U) -#define SCT_CTRLL_HALT_L_SHIFT (2U) -/*! HALT_L - Halt Counter Low - * 0b0..Disabled - * 0b1..Enabled - */ -#define SCT_CTRLL_HALT_L(x) (((uint16_t)(((uint16_t)(x)) << SCT_CTRLL_HALT_L_SHIFT)) & SCT_CTRLL_HALT_L_MASK) - -#define SCT_CTRLL_CLRCTR_L_MASK (0x8U) -#define SCT_CTRLL_CLRCTR_L_SHIFT (3U) -/*! CLRCTR_L - Clear Counter Low */ -#define SCT_CTRLL_CLRCTR_L(x) (((uint16_t)(((uint16_t)(x)) << SCT_CTRLL_CLRCTR_L_SHIFT)) & SCT_CTRLL_CLRCTR_L_MASK) - -#define SCT_CTRLL_BIDIR_L_MASK (0x10U) -#define SCT_CTRLL_BIDIR_L_SHIFT (4U) -/*! BIDIR_L - Bidirectional Select Low - * 0b0..Up - * 0b1..Up-down - */ -#define SCT_CTRLL_BIDIR_L(x) (((uint16_t)(((uint16_t)(x)) << SCT_CTRLL_BIDIR_L_SHIFT)) & SCT_CTRLL_BIDIR_L_MASK) - -#define SCT_CTRLL_PRE_L_MASK (0x1FE0U) -#define SCT_CTRLL_PRE_L_SHIFT (5U) -/*! PRE_L - Prescaler for Low Counter */ -#define SCT_CTRLL_PRE_L(x) (((uint16_t)(((uint16_t)(x)) << SCT_CTRLL_PRE_L_SHIFT)) & SCT_CTRLL_PRE_L_MASK) -/*! @} */ - -/*! @name CTRLH - SCT_CTRLH register */ -/*! @{ */ - -#define SCT_CTRLH_DOWN_H_MASK (0x1U) -#define SCT_CTRLH_DOWN_H_SHIFT (0U) -/*! DOWN_H - Down Counter High - * 0b0..Up - * 0b1..Down - */ -#define SCT_CTRLH_DOWN_H(x) (((uint16_t)(((uint16_t)(x)) << SCT_CTRLH_DOWN_H_SHIFT)) & SCT_CTRLH_DOWN_H_MASK) - -#define SCT_CTRLH_STOP_H_MASK (0x2U) -#define SCT_CTRLH_STOP_H_SHIFT (1U) -/*! STOP_H - Stop Counter High - * 0b0..Disabled - * 0b1..Enabled - */ -#define SCT_CTRLH_STOP_H(x) (((uint16_t)(((uint16_t)(x)) << SCT_CTRLH_STOP_H_SHIFT)) & SCT_CTRLH_STOP_H_MASK) - -#define SCT_CTRLH_HALT_H_MASK (0x4U) -#define SCT_CTRLH_HALT_H_SHIFT (2U) -/*! HALT_H - Halt Counter High - * 0b0..Disable - * 0b1..Enable - */ -#define SCT_CTRLH_HALT_H(x) (((uint16_t)(((uint16_t)(x)) << SCT_CTRLH_HALT_H_SHIFT)) & SCT_CTRLH_HALT_H_MASK) - -#define SCT_CTRLH_CLRCTR_H_MASK (0x8U) -#define SCT_CTRLH_CLRCTR_H_SHIFT (3U) -/*! CLRCTR_H - Clear Counter High */ -#define SCT_CTRLH_CLRCTR_H(x) (((uint16_t)(((uint16_t)(x)) << SCT_CTRLH_CLRCTR_H_SHIFT)) & SCT_CTRLH_CLRCTR_H_MASK) - -#define SCT_CTRLH_BIDIR_H_MASK (0x10U) -#define SCT_CTRLH_BIDIR_H_SHIFT (4U) -/*! BIDIR_H - Bidirectional Select High - * 0b0..Up - * 0b1..Up-down - */ -#define SCT_CTRLH_BIDIR_H(x) (((uint16_t)(((uint16_t)(x)) << SCT_CTRLH_BIDIR_H_SHIFT)) & SCT_CTRLH_BIDIR_H_MASK) - -#define SCT_CTRLH_PRE_H_MASK (0x1FE0U) -#define SCT_CTRLH_PRE_H_SHIFT (5U) -/*! PRE_H - Prescaler for High Counter */ -#define SCT_CTRLH_PRE_H(x) (((uint16_t)(((uint16_t)(x)) << SCT_CTRLH_PRE_H_SHIFT)) & SCT_CTRLH_PRE_H_MASK) -/*! @} */ - -/*! @name CTRL - SCT Control */ -/*! @{ */ - -#define SCT_CTRL_DOWN_L_MASK (0x1U) -#define SCT_CTRL_DOWN_L_SHIFT (0U) -/*! DOWN_L - Down Counter Low - * 0b0..Up - * 0b1..Down - */ -#define SCT_CTRL_DOWN_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_CTRL_DOWN_L_SHIFT)) & SCT_CTRL_DOWN_L_MASK) - -#define SCT_CTRL_STOP_L_MASK (0x2U) -#define SCT_CTRL_STOP_L_SHIFT (1U) -/*! STOP_L - Stop Counter Low - * 0b0..Disabled - * 0b1..Enabled - */ -#define SCT_CTRL_STOP_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_CTRL_STOP_L_SHIFT)) & SCT_CTRL_STOP_L_MASK) - -#define SCT_CTRL_HALT_L_MASK (0x4U) -#define SCT_CTRL_HALT_L_SHIFT (2U) -/*! HALT_L - Halt Counter Low - * 0b0..Disabled - * 0b1..Enabled - */ -#define SCT_CTRL_HALT_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_CTRL_HALT_L_SHIFT)) & SCT_CTRL_HALT_L_MASK) - -#define SCT_CTRL_CLRCTR_L_MASK (0x8U) -#define SCT_CTRL_CLRCTR_L_SHIFT (3U) -/*! CLRCTR_L - Clear Counter Low */ -#define SCT_CTRL_CLRCTR_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_CTRL_CLRCTR_L_SHIFT)) & SCT_CTRL_CLRCTR_L_MASK) - -#define SCT_CTRL_BIDIR_L_MASK (0x10U) -#define SCT_CTRL_BIDIR_L_SHIFT (4U) -/*! BIDIR_L - Bidirectional Select Low - * 0b0..Up - * 0b1..Up-down - */ -#define SCT_CTRL_BIDIR_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_CTRL_BIDIR_L_SHIFT)) & SCT_CTRL_BIDIR_L_MASK) - -#define SCT_CTRL_PRE_L_MASK (0x1FE0U) -#define SCT_CTRL_PRE_L_SHIFT (5U) -/*! PRE_L - Prescaler for Low Counter */ -#define SCT_CTRL_PRE_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_CTRL_PRE_L_SHIFT)) & SCT_CTRL_PRE_L_MASK) - -#define SCT_CTRL_DOWN_H_MASK (0x10000U) -#define SCT_CTRL_DOWN_H_SHIFT (16U) -/*! DOWN_H - Down Counter High - * 0b0..Up - * 0b1..Down - */ -#define SCT_CTRL_DOWN_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_CTRL_DOWN_H_SHIFT)) & SCT_CTRL_DOWN_H_MASK) - -#define SCT_CTRL_STOP_H_MASK (0x20000U) -#define SCT_CTRL_STOP_H_SHIFT (17U) -/*! STOP_H - Stop Counter High - * 0b0..Disabled - * 0b1..Enabled - */ -#define SCT_CTRL_STOP_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_CTRL_STOP_H_SHIFT)) & SCT_CTRL_STOP_H_MASK) - -#define SCT_CTRL_HALT_H_MASK (0x40000U) -#define SCT_CTRL_HALT_H_SHIFT (18U) -/*! HALT_H - Halt Counter High - * 0b0..Disable - * 0b1..Enable - */ -#define SCT_CTRL_HALT_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_CTRL_HALT_H_SHIFT)) & SCT_CTRL_HALT_H_MASK) - -#define SCT_CTRL_CLRCTR_H_MASK (0x80000U) -#define SCT_CTRL_CLRCTR_H_SHIFT (19U) -/*! CLRCTR_H - Clear Counter High */ -#define SCT_CTRL_CLRCTR_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_CTRL_CLRCTR_H_SHIFT)) & SCT_CTRL_CLRCTR_H_MASK) - -#define SCT_CTRL_BIDIR_H_MASK (0x100000U) -#define SCT_CTRL_BIDIR_H_SHIFT (20U) -/*! BIDIR_H - Bidirectional Select High - * 0b0..Up - * 0b1..Up-down - */ -#define SCT_CTRL_BIDIR_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_CTRL_BIDIR_H_SHIFT)) & SCT_CTRL_BIDIR_H_MASK) - -#define SCT_CTRL_PRE_H_MASK (0x1FE00000U) -#define SCT_CTRL_PRE_H_SHIFT (21U) -/*! PRE_H - Prescaler for High Counter */ -#define SCT_CTRL_PRE_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_CTRL_PRE_H_SHIFT)) & SCT_CTRL_PRE_H_MASK) -/*! @} */ - -/*! @name LIMITL - SCT_LIMITL register */ -/*! @{ */ - -#define SCT_LIMITL_LIMITL_MASK (0xFFFFU) -#define SCT_LIMITL_LIMITL_SHIFT (0U) -#define SCT_LIMITL_LIMITL(x) (((uint16_t)(((uint16_t)(x)) << SCT_LIMITL_LIMITL_SHIFT)) & SCT_LIMITL_LIMITL_MASK) -/*! @} */ - -/*! @name LIMITH - SCT_LIMITH register */ -/*! @{ */ - -#define SCT_LIMITH_LIMITH_MASK (0xFFFFU) -#define SCT_LIMITH_LIMITH_SHIFT (0U) -#define SCT_LIMITH_LIMITH(x) (((uint16_t)(((uint16_t)(x)) << SCT_LIMITH_LIMITH_SHIFT)) & SCT_LIMITH_LIMITH_MASK) -/*! @} */ - -/*! @name LIMIT - SCT Limit Event Select */ -/*! @{ */ - -#define SCT_LIMIT_LIMMSK_L_MASK (0xFFFFU) -#define SCT_LIMIT_LIMMSK_L_SHIFT (0U) -/*! LIMMSK_L - Limit Event Counter Low */ -#define SCT_LIMIT_LIMMSK_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_LIMIT_LIMMSK_L_SHIFT)) & SCT_LIMIT_LIMMSK_L_MASK) - -#define SCT_LIMIT_LIMMSK_H_MASK (0xFFFF0000U) -#define SCT_LIMIT_LIMMSK_H_SHIFT (16U) -/*! LIMMSK_H - Limit Event Counter High */ -#define SCT_LIMIT_LIMMSK_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_LIMIT_LIMMSK_H_SHIFT)) & SCT_LIMIT_LIMMSK_H_MASK) -/*! @} */ - -/*! @name HALTL - SCT_HALTL register */ -/*! @{ */ - -#define SCT_HALTL_HALTL_MASK (0xFFFFU) -#define SCT_HALTL_HALTL_SHIFT (0U) -#define SCT_HALTL_HALTL(x) (((uint16_t)(((uint16_t)(x)) << SCT_HALTL_HALTL_SHIFT)) & SCT_HALTL_HALTL_MASK) -/*! @} */ - -/*! @name HALTH - SCT_HALTH register */ -/*! @{ */ - -#define SCT_HALTH_HALTH_MASK (0xFFFFU) -#define SCT_HALTH_HALTH_SHIFT (0U) -#define SCT_HALTH_HALTH(x) (((uint16_t)(((uint16_t)(x)) << SCT_HALTH_HALTH_SHIFT)) & SCT_HALTH_HALTH_MASK) -/*! @} */ - -/*! @name HALT - Halt Event Select */ -/*! @{ */ - -#define SCT_HALT_HALTMSK_L_MASK (0xFFFFU) -#define SCT_HALT_HALTMSK_L_SHIFT (0U) -/*! HALTMSK_L - Halt Event Low */ -#define SCT_HALT_HALTMSK_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_HALT_HALTMSK_L_SHIFT)) & SCT_HALT_HALTMSK_L_MASK) - -#define SCT_HALT_HALTMSK_H_MASK (0xFFFF0000U) -#define SCT_HALT_HALTMSK_H_SHIFT (16U) -/*! HALTMSK_H - Halt Event High */ -#define SCT_HALT_HALTMSK_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_HALT_HALTMSK_H_SHIFT)) & SCT_HALT_HALTMSK_H_MASK) -/*! @} */ - -/*! @name STOPL - SCT_STOPL register */ -/*! @{ */ - -#define SCT_STOPL_STOPL_MASK (0xFFFFU) -#define SCT_STOPL_STOPL_SHIFT (0U) -#define SCT_STOPL_STOPL(x) (((uint16_t)(((uint16_t)(x)) << SCT_STOPL_STOPL_SHIFT)) & SCT_STOPL_STOPL_MASK) -/*! @} */ - -/*! @name STOPH - SCT_STOPH register */ -/*! @{ */ - -#define SCT_STOPH_STOPH_MASK (0xFFFFU) -#define SCT_STOPH_STOPH_SHIFT (0U) -#define SCT_STOPH_STOPH(x) (((uint16_t)(((uint16_t)(x)) << SCT_STOPH_STOPH_SHIFT)) & SCT_STOPH_STOPH_MASK) -/*! @} */ - -/*! @name STOP - Stop Event Select */ -/*! @{ */ - -#define SCT_STOP_STOPMSK_L_MASK (0xFFFFU) -#define SCT_STOP_STOPMSK_L_SHIFT (0U) -/*! STOPMSK_L - Stop Event Low */ -#define SCT_STOP_STOPMSK_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_STOP_STOPMSK_L_SHIFT)) & SCT_STOP_STOPMSK_L_MASK) - -#define SCT_STOP_STOPMSK_H_MASK (0xFFFF0000U) -#define SCT_STOP_STOPMSK_H_SHIFT (16U) -/*! STOPMSK_H - Stop Event High */ -#define SCT_STOP_STOPMSK_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_STOP_STOPMSK_H_SHIFT)) & SCT_STOP_STOPMSK_H_MASK) -/*! @} */ - -/*! @name STARTL - SCT_STARTL register */ -/*! @{ */ - -#define SCT_STARTL_STARTL_MASK (0xFFFFU) -#define SCT_STARTL_STARTL_SHIFT (0U) -#define SCT_STARTL_STARTL(x) (((uint16_t)(((uint16_t)(x)) << SCT_STARTL_STARTL_SHIFT)) & SCT_STARTL_STARTL_MASK) -/*! @} */ - -/*! @name STARTH - SCT_STARTH register */ -/*! @{ */ - -#define SCT_STARTH_STARTH_MASK (0xFFFFU) -#define SCT_STARTH_STARTH_SHIFT (0U) -#define SCT_STARTH_STARTH(x) (((uint16_t)(((uint16_t)(x)) << SCT_STARTH_STARTH_SHIFT)) & SCT_STARTH_STARTH_MASK) -/*! @} */ - -/*! @name START - Start Event Select */ -/*! @{ */ - -#define SCT_START_STARTMSK_L_MASK (0xFFFFU) -#define SCT_START_STARTMSK_L_SHIFT (0U) -/*! STARTMSK_L - Start Event Low */ -#define SCT_START_STARTMSK_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_START_STARTMSK_L_SHIFT)) & SCT_START_STARTMSK_L_MASK) - -#define SCT_START_STARTMSK_H_MASK (0xFFFF0000U) -#define SCT_START_STARTMSK_H_SHIFT (16U) -/*! STARTMSK_H - Start Event High */ -#define SCT_START_STARTMSK_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_START_STARTMSK_H_SHIFT)) & SCT_START_STARTMSK_H_MASK) -/*! @} */ - -/*! @name DITHER - Dither Condition */ -/*! @{ */ - -#define SCT_DITHER_DITHER_L_MASK (0xFFFFU) -#define SCT_DITHER_DITHER_L_SHIFT (0U) -/*! DITHER_L - Dither Low */ -#define SCT_DITHER_DITHER_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_DITHER_DITHER_L_SHIFT)) & SCT_DITHER_DITHER_L_MASK) - -#define SCT_DITHER_DITHER_H_MASK (0xFFFF0000U) -#define SCT_DITHER_DITHER_H_SHIFT (16U) -/*! DITHER_H - Dither High */ -#define SCT_DITHER_DITHER_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_DITHER_DITHER_H_SHIFT)) & SCT_DITHER_DITHER_H_MASK) -/*! @} */ - -/*! @name COUNTL - SCT_COUNTL register */ -/*! @{ */ - -#define SCT_COUNTL_COUNTL_MASK (0xFFFFU) -#define SCT_COUNTL_COUNTL_SHIFT (0U) -#define SCT_COUNTL_COUNTL(x) (((uint16_t)(((uint16_t)(x)) << SCT_COUNTL_COUNTL_SHIFT)) & SCT_COUNTL_COUNTL_MASK) -/*! @} */ - -/*! @name COUNTH - SCT_COUNTH register */ -/*! @{ */ - -#define SCT_COUNTH_COUNTH_MASK (0xFFFFU) -#define SCT_COUNTH_COUNTH_SHIFT (0U) -#define SCT_COUNTH_COUNTH(x) (((uint16_t)(((uint16_t)(x)) << SCT_COUNTH_COUNTH_SHIFT)) & SCT_COUNTH_COUNTH_MASK) -/*! @} */ - -/*! @name COUNT - Counter Value */ -/*! @{ */ - -#define SCT_COUNT_CTR_L_MASK (0xFFFFU) -#define SCT_COUNT_CTR_L_SHIFT (0U) -/*! CTR_L - Counter Low */ -#define SCT_COUNT_CTR_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_COUNT_CTR_L_SHIFT)) & SCT_COUNT_CTR_L_MASK) - -#define SCT_COUNT_CTR_H_MASK (0xFFFF0000U) -#define SCT_COUNT_CTR_H_SHIFT (16U) -/*! CTR_H - Counter High */ -#define SCT_COUNT_CTR_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_COUNT_CTR_H_SHIFT)) & SCT_COUNT_CTR_H_MASK) -/*! @} */ - -/*! @name STATEL - SCT_STATEL register */ -/*! @{ */ - -#define SCT_STATEL_STATEL_MASK (0xFFFFU) -#define SCT_STATEL_STATEL_SHIFT (0U) -#define SCT_STATEL_STATEL(x) (((uint16_t)(((uint16_t)(x)) << SCT_STATEL_STATEL_SHIFT)) & SCT_STATEL_STATEL_MASK) -/*! @} */ - -/*! @name STATEH - SCT_STATEH register */ -/*! @{ */ - -#define SCT_STATEH_STATEH_MASK (0xFFFFU) -#define SCT_STATEH_STATEH_SHIFT (0U) -#define SCT_STATEH_STATEH(x) (((uint16_t)(((uint16_t)(x)) << SCT_STATEH_STATEH_SHIFT)) & SCT_STATEH_STATEH_MASK) -/*! @} */ - -/*! @name STATE - State Variable */ -/*! @{ */ - -#define SCT_STATE_STATE_L_MASK (0x1FU) -#define SCT_STATE_STATE_L_SHIFT (0U) -/*! STATE_L - State Variable Low */ -#define SCT_STATE_STATE_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_STATE_STATE_L_SHIFT)) & SCT_STATE_STATE_L_MASK) - -#define SCT_STATE_STATE_H_MASK (0x1F0000U) -#define SCT_STATE_STATE_H_SHIFT (16U) -/*! STATE_H - State Variable High */ -#define SCT_STATE_STATE_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_STATE_STATE_H_SHIFT)) & SCT_STATE_STATE_H_MASK) -/*! @} */ - -/*! @name INPUT - Input State */ -/*! @{ */ - -#define SCT_INPUT_AIN0_MASK (0x1U) -#define SCT_INPUT_AIN0_SHIFT (0U) -/*! AIN0 - Input 0 state */ -#define SCT_INPUT_AIN0(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN0_SHIFT)) & SCT_INPUT_AIN0_MASK) - -#define SCT_INPUT_AIN1_MASK (0x2U) -#define SCT_INPUT_AIN1_SHIFT (1U) -/*! AIN1 - Input 1 state */ -#define SCT_INPUT_AIN1(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN1_SHIFT)) & SCT_INPUT_AIN1_MASK) - -#define SCT_INPUT_AIN2_MASK (0x4U) -#define SCT_INPUT_AIN2_SHIFT (2U) -/*! AIN2 - Input 2 state */ -#define SCT_INPUT_AIN2(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN2_SHIFT)) & SCT_INPUT_AIN2_MASK) - -#define SCT_INPUT_AIN3_MASK (0x8U) -#define SCT_INPUT_AIN3_SHIFT (3U) -/*! AIN3 - Input 3 state */ -#define SCT_INPUT_AIN3(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN3_SHIFT)) & SCT_INPUT_AIN3_MASK) - -#define SCT_INPUT_AIN4_MASK (0x10U) -#define SCT_INPUT_AIN4_SHIFT (4U) -/*! AIN4 - Input 4 state */ -#define SCT_INPUT_AIN4(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN4_SHIFT)) & SCT_INPUT_AIN4_MASK) - -#define SCT_INPUT_AIN5_MASK (0x20U) -#define SCT_INPUT_AIN5_SHIFT (5U) -/*! AIN5 - Input 5 state */ -#define SCT_INPUT_AIN5(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN5_SHIFT)) & SCT_INPUT_AIN5_MASK) - -#define SCT_INPUT_AIN6_MASK (0x40U) -#define SCT_INPUT_AIN6_SHIFT (6U) -/*! AIN6 - Input 6 state */ -#define SCT_INPUT_AIN6(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN6_SHIFT)) & SCT_INPUT_AIN6_MASK) - -#define SCT_INPUT_AIN7_MASK (0x80U) -#define SCT_INPUT_AIN7_SHIFT (7U) -/*! AIN7 - Input 7 state */ -#define SCT_INPUT_AIN7(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN7_SHIFT)) & SCT_INPUT_AIN7_MASK) - -#define SCT_INPUT_AIN8_MASK (0x100U) -#define SCT_INPUT_AIN8_SHIFT (8U) -/*! AIN8 - Input 8 state */ -#define SCT_INPUT_AIN8(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN8_SHIFT)) & SCT_INPUT_AIN8_MASK) - -#define SCT_INPUT_AIN9_MASK (0x200U) -#define SCT_INPUT_AIN9_SHIFT (9U) -/*! AIN9 - Input 9 state */ -#define SCT_INPUT_AIN9(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN9_SHIFT)) & SCT_INPUT_AIN9_MASK) - -#define SCT_INPUT_AIN10_MASK (0x400U) -#define SCT_INPUT_AIN10_SHIFT (10U) -/*! AIN10 - Input 10 state */ -#define SCT_INPUT_AIN10(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN10_SHIFT)) & SCT_INPUT_AIN10_MASK) - -#define SCT_INPUT_AIN11_MASK (0x800U) -#define SCT_INPUT_AIN11_SHIFT (11U) -/*! AIN11 - Input 11 state */ -#define SCT_INPUT_AIN11(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN11_SHIFT)) & SCT_INPUT_AIN11_MASK) - -#define SCT_INPUT_AIN12_MASK (0x1000U) -#define SCT_INPUT_AIN12_SHIFT (12U) -/*! AIN12 - Input 12 state */ -#define SCT_INPUT_AIN12(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN12_SHIFT)) & SCT_INPUT_AIN12_MASK) - -#define SCT_INPUT_AIN13_MASK (0x2000U) -#define SCT_INPUT_AIN13_SHIFT (13U) -/*! AIN13 - Input 13 state */ -#define SCT_INPUT_AIN13(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN13_SHIFT)) & SCT_INPUT_AIN13_MASK) - -#define SCT_INPUT_AIN14_MASK (0x4000U) -#define SCT_INPUT_AIN14_SHIFT (14U) -/*! AIN14 - Input 14 state */ -#define SCT_INPUT_AIN14(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN14_SHIFT)) & SCT_INPUT_AIN14_MASK) - -#define SCT_INPUT_AIN15_MASK (0x8000U) -#define SCT_INPUT_AIN15_SHIFT (15U) -/*! AIN15 - Input 15 state */ -#define SCT_INPUT_AIN15(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_AIN15_SHIFT)) & SCT_INPUT_AIN15_MASK) - -#define SCT_INPUT_SIN0_MASK (0x10000U) -#define SCT_INPUT_SIN0_SHIFT (16U) -/*! SIN0 - Input 0 state */ -#define SCT_INPUT_SIN0(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN0_SHIFT)) & SCT_INPUT_SIN0_MASK) - -#define SCT_INPUT_SIN1_MASK (0x20000U) -#define SCT_INPUT_SIN1_SHIFT (17U) -/*! SIN1 - Input 1 state */ -#define SCT_INPUT_SIN1(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN1_SHIFT)) & SCT_INPUT_SIN1_MASK) - -#define SCT_INPUT_SIN2_MASK (0x40000U) -#define SCT_INPUT_SIN2_SHIFT (18U) -/*! SIN2 - Input 2 state */ -#define SCT_INPUT_SIN2(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN2_SHIFT)) & SCT_INPUT_SIN2_MASK) - -#define SCT_INPUT_SIN3_MASK (0x80000U) -#define SCT_INPUT_SIN3_SHIFT (19U) -/*! SIN3 - Input 3 state */ -#define SCT_INPUT_SIN3(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN3_SHIFT)) & SCT_INPUT_SIN3_MASK) - -#define SCT_INPUT_SIN4_MASK (0x100000U) -#define SCT_INPUT_SIN4_SHIFT (20U) -/*! SIN4 - Input 4 state */ -#define SCT_INPUT_SIN4(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN4_SHIFT)) & SCT_INPUT_SIN4_MASK) - -#define SCT_INPUT_SIN5_MASK (0x200000U) -#define SCT_INPUT_SIN5_SHIFT (21U) -/*! SIN5 - Input 5 state */ -#define SCT_INPUT_SIN5(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN5_SHIFT)) & SCT_INPUT_SIN5_MASK) - -#define SCT_INPUT_SIN6_MASK (0x400000U) -#define SCT_INPUT_SIN6_SHIFT (22U) -/*! SIN6 - Input 6 state */ -#define SCT_INPUT_SIN6(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN6_SHIFT)) & SCT_INPUT_SIN6_MASK) - -#define SCT_INPUT_SIN7_MASK (0x800000U) -#define SCT_INPUT_SIN7_SHIFT (23U) -/*! SIN7 - Input 7 state */ -#define SCT_INPUT_SIN7(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN7_SHIFT)) & SCT_INPUT_SIN7_MASK) - -#define SCT_INPUT_SIN8_MASK (0x1000000U) -#define SCT_INPUT_SIN8_SHIFT (24U) -/*! SIN8 - Input 8 state */ -#define SCT_INPUT_SIN8(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN8_SHIFT)) & SCT_INPUT_SIN8_MASK) - -#define SCT_INPUT_SIN9_MASK (0x2000000U) -#define SCT_INPUT_SIN9_SHIFT (25U) -/*! SIN9 - Input 9 state */ -#define SCT_INPUT_SIN9(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN9_SHIFT)) & SCT_INPUT_SIN9_MASK) - -#define SCT_INPUT_SIN10_MASK (0x4000000U) -#define SCT_INPUT_SIN10_SHIFT (26U) -/*! SIN10 - Input 10 state */ -#define SCT_INPUT_SIN10(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN10_SHIFT)) & SCT_INPUT_SIN10_MASK) - -#define SCT_INPUT_SIN11_MASK (0x8000000U) -#define SCT_INPUT_SIN11_SHIFT (27U) -/*! SIN11 - Input 11 state */ -#define SCT_INPUT_SIN11(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN11_SHIFT)) & SCT_INPUT_SIN11_MASK) - -#define SCT_INPUT_SIN12_MASK (0x10000000U) -#define SCT_INPUT_SIN12_SHIFT (28U) -/*! SIN12 - Input 12 state */ -#define SCT_INPUT_SIN12(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN12_SHIFT)) & SCT_INPUT_SIN12_MASK) - -#define SCT_INPUT_SIN13_MASK (0x20000000U) -#define SCT_INPUT_SIN13_SHIFT (29U) -/*! SIN13 - Input 13 state */ -#define SCT_INPUT_SIN13(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN13_SHIFT)) & SCT_INPUT_SIN13_MASK) - -#define SCT_INPUT_SIN14_MASK (0x40000000U) -#define SCT_INPUT_SIN14_SHIFT (30U) -/*! SIN14 - Input 14 state */ -#define SCT_INPUT_SIN14(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN14_SHIFT)) & SCT_INPUT_SIN14_MASK) - -#define SCT_INPUT_SIN15_MASK (0x80000000U) -#define SCT_INPUT_SIN15_SHIFT (31U) -/*! SIN15 - Input 15 state */ -#define SCT_INPUT_SIN15(x) (((uint32_t)(((uint32_t)(x)) << SCT_INPUT_SIN15_SHIFT)) & SCT_INPUT_SIN15_MASK) -/*! @} */ - -/*! @name REGMODEL - SCT_REGMODEL register */ -/*! @{ */ - -#define SCT_REGMODEL_REGMODEL_MASK (0xFFFFU) -#define SCT_REGMODEL_REGMODEL_SHIFT (0U) -/*! REGMODEL - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODEL_REGMODEL(x) (((uint16_t)(((uint16_t)(x)) << SCT_REGMODEL_REGMODEL_SHIFT)) & SCT_REGMODEL_REGMODEL_MASK) - -#define SCT_REGMODEL_REGMOD_L_MASK (0xFFFFU) -#define SCT_REGMODEL_REGMOD_L_SHIFT (0U) -#define SCT_REGMODEL_REGMOD_L(x) (((uint16_t)(((uint16_t)(x)) << SCT_REGMODEL_REGMOD_L_SHIFT)) & SCT_REGMODEL_REGMOD_L_MASK) - -#define SCT_REGMODEL_REGMOD_H_MASK (0xFFFF0000U) -#define SCT_REGMODEL_REGMOD_H_SHIFT (16U) -#define SCT_REGMODEL_REGMOD_H(x) (((uint16_t)(((uint16_t)(x)) << SCT_REGMODEL_REGMOD_H_SHIFT)) & SCT_REGMODEL_REGMOD_H_MASK) -/*! @} */ - -/*! @name REGMODEH - SCT_REGMODEH register */ -/*! @{ */ - -#define SCT_REGMODEH_REGMODEH_MASK (0xFFFFU) -#define SCT_REGMODEH_REGMODEH_SHIFT (0U) -/*! REGMODEH - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODEH_REGMODEH(x) (((uint16_t)(((uint16_t)(x)) << SCT_REGMODEH_REGMODEH_SHIFT)) & SCT_REGMODEH_REGMODEH_MASK) - -#define SCT_REGMODEH_REGMOD_L_MASK (0xFFFFU) -#define SCT_REGMODEH_REGMOD_L_SHIFT (0U) -#define SCT_REGMODEH_REGMOD_L(x) (((uint16_t)(((uint16_t)(x)) << SCT_REGMODEH_REGMOD_L_SHIFT)) & SCT_REGMODEH_REGMOD_L_MASK) - -#define SCT_REGMODEH_REGMOD_H_MASK (0xFFFF0000U) -#define SCT_REGMODEH_REGMOD_H_SHIFT (16U) -#define SCT_REGMODEH_REGMOD_H(x) (((uint16_t)(((uint16_t)(x)) << SCT_REGMODEH_REGMOD_H_SHIFT)) & SCT_REGMODEH_REGMOD_H_MASK) -/*! @} */ - -/*! @name REGMODE - Match and Capture Register Mode */ -/*! @{ */ - -#define SCT_REGMODE_REGMOD_L_MASK (0xFFFFU) -#define SCT_REGMODE_REGMOD_L_SHIFT (0U) -#define SCT_REGMODE_REGMOD_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L_SHIFT)) & SCT_REGMODE_REGMOD_L_MASK) - -#define SCT_REGMODE_REGMOD_L0_MASK (0x1U) -#define SCT_REGMODE_REGMOD_L0_SHIFT (0U) -/*! REGMOD_L0 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L0(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L0_SHIFT)) & SCT_REGMODE_REGMOD_L0_MASK) - -#define SCT_REGMODE_REGMOD_L1_MASK (0x2U) -#define SCT_REGMODE_REGMOD_L1_SHIFT (1U) -/*! REGMOD_L1 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L1(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L1_SHIFT)) & SCT_REGMODE_REGMOD_L1_MASK) - -#define SCT_REGMODE_REGMOD_L2_MASK (0x4U) -#define SCT_REGMODE_REGMOD_L2_SHIFT (2U) -/*! REGMOD_L2 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L2(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L2_SHIFT)) & SCT_REGMODE_REGMOD_L2_MASK) - -#define SCT_REGMODE_REGMOD_L3_MASK (0x8U) -#define SCT_REGMODE_REGMOD_L3_SHIFT (3U) -/*! REGMOD_L3 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L3(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L3_SHIFT)) & SCT_REGMODE_REGMOD_L3_MASK) - -#define SCT_REGMODE_REGMOD_L4_MASK (0x10U) -#define SCT_REGMODE_REGMOD_L4_SHIFT (4U) -/*! REGMOD_L4 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L4(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L4_SHIFT)) & SCT_REGMODE_REGMOD_L4_MASK) - -#define SCT_REGMODE_REGMOD_L5_MASK (0x20U) -#define SCT_REGMODE_REGMOD_L5_SHIFT (5U) -/*! REGMOD_L5 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L5(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L5_SHIFT)) & SCT_REGMODE_REGMOD_L5_MASK) - -#define SCT_REGMODE_REGMOD_L6_MASK (0x40U) -#define SCT_REGMODE_REGMOD_L6_SHIFT (6U) -/*! REGMOD_L6 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L6(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L6_SHIFT)) & SCT_REGMODE_REGMOD_L6_MASK) - -#define SCT_REGMODE_REGMOD_L7_MASK (0x80U) -#define SCT_REGMODE_REGMOD_L7_SHIFT (7U) -/*! REGMOD_L7 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L7(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L7_SHIFT)) & SCT_REGMODE_REGMOD_L7_MASK) - -#define SCT_REGMODE_REGMOD_L8_MASK (0x100U) -#define SCT_REGMODE_REGMOD_L8_SHIFT (8U) -/*! REGMOD_L8 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L8(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L8_SHIFT)) & SCT_REGMODE_REGMOD_L8_MASK) - -#define SCT_REGMODE_REGMOD_L9_MASK (0x200U) -#define SCT_REGMODE_REGMOD_L9_SHIFT (9U) -/*! REGMOD_L9 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L9(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L9_SHIFT)) & SCT_REGMODE_REGMOD_L9_MASK) - -#define SCT_REGMODE_REGMOD_L10_MASK (0x400U) -#define SCT_REGMODE_REGMOD_L10_SHIFT (10U) -/*! REGMOD_L10 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L10(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L10_SHIFT)) & SCT_REGMODE_REGMOD_L10_MASK) - -#define SCT_REGMODE_REGMOD_L11_MASK (0x800U) -#define SCT_REGMODE_REGMOD_L11_SHIFT (11U) -/*! REGMOD_L11 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L11(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L11_SHIFT)) & SCT_REGMODE_REGMOD_L11_MASK) - -#define SCT_REGMODE_REGMOD_L12_MASK (0x1000U) -#define SCT_REGMODE_REGMOD_L12_SHIFT (12U) -/*! REGMOD_L12 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L12(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L12_SHIFT)) & SCT_REGMODE_REGMOD_L12_MASK) - -#define SCT_REGMODE_REGMOD_L13_MASK (0x2000U) -#define SCT_REGMODE_REGMOD_L13_SHIFT (13U) -/*! REGMOD_L13 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L13(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L13_SHIFT)) & SCT_REGMODE_REGMOD_L13_MASK) - -#define SCT_REGMODE_REGMOD_L14_MASK (0x4000U) -#define SCT_REGMODE_REGMOD_L14_SHIFT (14U) -/*! REGMOD_L14 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L14(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L14_SHIFT)) & SCT_REGMODE_REGMOD_L14_MASK) - -#define SCT_REGMODE_REGMOD_L15_MASK (0x8000U) -#define SCT_REGMODE_REGMOD_L15_SHIFT (15U) -/*! REGMOD_L15 - Register Mode Low - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_L15(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_L15_SHIFT)) & SCT_REGMODE_REGMOD_L15_MASK) - -#define SCT_REGMODE_REGMOD_H_MASK (0xFFFF0000U) -#define SCT_REGMODE_REGMOD_H_SHIFT (16U) -#define SCT_REGMODE_REGMOD_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H_SHIFT)) & SCT_REGMODE_REGMOD_H_MASK) - -#define SCT_REGMODE_REGMOD_H0_MASK (0x10000U) -#define SCT_REGMODE_REGMOD_H0_SHIFT (16U) -/*! REGMOD_H0 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H0(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H0_SHIFT)) & SCT_REGMODE_REGMOD_H0_MASK) - -#define SCT_REGMODE_REGMOD_H1_MASK (0x20000U) -#define SCT_REGMODE_REGMOD_H1_SHIFT (17U) -/*! REGMOD_H1 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H1(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H1_SHIFT)) & SCT_REGMODE_REGMOD_H1_MASK) - -#define SCT_REGMODE_REGMOD_H2_MASK (0x40000U) -#define SCT_REGMODE_REGMOD_H2_SHIFT (18U) -/*! REGMOD_H2 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H2(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H2_SHIFT)) & SCT_REGMODE_REGMOD_H2_MASK) - -#define SCT_REGMODE_REGMOD_H3_MASK (0x80000U) -#define SCT_REGMODE_REGMOD_H3_SHIFT (19U) -/*! REGMOD_H3 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H3(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H3_SHIFT)) & SCT_REGMODE_REGMOD_H3_MASK) - -#define SCT_REGMODE_REGMOD_H4_MASK (0x100000U) -#define SCT_REGMODE_REGMOD_H4_SHIFT (20U) -/*! REGMOD_H4 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H4(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H4_SHIFT)) & SCT_REGMODE_REGMOD_H4_MASK) - -#define SCT_REGMODE_REGMOD_H5_MASK (0x200000U) -#define SCT_REGMODE_REGMOD_H5_SHIFT (21U) -/*! REGMOD_H5 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H5(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H5_SHIFT)) & SCT_REGMODE_REGMOD_H5_MASK) - -#define SCT_REGMODE_REGMOD_H6_MASK (0x400000U) -#define SCT_REGMODE_REGMOD_H6_SHIFT (22U) -/*! REGMOD_H6 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H6(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H6_SHIFT)) & SCT_REGMODE_REGMOD_H6_MASK) - -#define SCT_REGMODE_REGMOD_H7_MASK (0x800000U) -#define SCT_REGMODE_REGMOD_H7_SHIFT (23U) -/*! REGMOD_H7 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H7(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H7_SHIFT)) & SCT_REGMODE_REGMOD_H7_MASK) - -#define SCT_REGMODE_REGMOD_H8_MASK (0x1000000U) -#define SCT_REGMODE_REGMOD_H8_SHIFT (24U) -/*! REGMOD_H8 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H8(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H8_SHIFT)) & SCT_REGMODE_REGMOD_H8_MASK) - -#define SCT_REGMODE_REGMOD_H9_MASK (0x2000000U) -#define SCT_REGMODE_REGMOD_H9_SHIFT (25U) -/*! REGMOD_H9 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H9(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H9_SHIFT)) & SCT_REGMODE_REGMOD_H9_MASK) - -#define SCT_REGMODE_REGMOD_H10_MASK (0x4000000U) -#define SCT_REGMODE_REGMOD_H10_SHIFT (26U) -/*! REGMOD_H10 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H10(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H10_SHIFT)) & SCT_REGMODE_REGMOD_H10_MASK) - -#define SCT_REGMODE_REGMOD_H11_MASK (0x8000000U) -#define SCT_REGMODE_REGMOD_H11_SHIFT (27U) -/*! REGMOD_H11 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H11(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H11_SHIFT)) & SCT_REGMODE_REGMOD_H11_MASK) - -#define SCT_REGMODE_REGMOD_H12_MASK (0x10000000U) -#define SCT_REGMODE_REGMOD_H12_SHIFT (28U) -/*! REGMOD_H12 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H12(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H12_SHIFT)) & SCT_REGMODE_REGMOD_H12_MASK) - -#define SCT_REGMODE_REGMOD_H13_MASK (0x20000000U) -#define SCT_REGMODE_REGMOD_H13_SHIFT (29U) -/*! REGMOD_H13 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H13(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H13_SHIFT)) & SCT_REGMODE_REGMOD_H13_MASK) - -#define SCT_REGMODE_REGMOD_H14_MASK (0x40000000U) -#define SCT_REGMODE_REGMOD_H14_SHIFT (30U) -/*! REGMOD_H14 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H14(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H14_SHIFT)) & SCT_REGMODE_REGMOD_H14_MASK) - -#define SCT_REGMODE_REGMOD_H15_MASK (0x80000000U) -#define SCT_REGMODE_REGMOD_H15_SHIFT (31U) -/*! REGMOD_H15 - Register Mode High - * 0b0..Match - * 0b1..Capture - */ -#define SCT_REGMODE_REGMOD_H15(x) (((uint32_t)(((uint32_t)(x)) << SCT_REGMODE_REGMOD_H15_SHIFT)) & SCT_REGMODE_REGMOD_H15_MASK) -/*! @} */ - -/*! @name OUTPUT - Output State */ -/*! @{ */ - -#define SCT_OUTPUT_OUT0_MASK (0x1U) -#define SCT_OUTPUT_OUT0_SHIFT (0U) -/*! OUT0 - Output Low and High - * 0b0..Forces the corresponding output low - * 0b1..Forces the corresponding output high - */ -#define SCT_OUTPUT_OUT0(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUT_OUT0_SHIFT)) & SCT_OUTPUT_OUT0_MASK) - -#define SCT_OUTPUT_OUT1_MASK (0x2U) -#define SCT_OUTPUT_OUT1_SHIFT (1U) -/*! OUT1 - Output Low and High - * 0b0..Forces the corresponding output low - * 0b1..Forces the corresponding output high - */ -#define SCT_OUTPUT_OUT1(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUT_OUT1_SHIFT)) & SCT_OUTPUT_OUT1_MASK) - -#define SCT_OUTPUT_OUT2_MASK (0x4U) -#define SCT_OUTPUT_OUT2_SHIFT (2U) -/*! OUT2 - Output Low and High - * 0b0..Forces the corresponding output low - * 0b1..Forces the corresponding output high - */ -#define SCT_OUTPUT_OUT2(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUT_OUT2_SHIFT)) & SCT_OUTPUT_OUT2_MASK) - -#define SCT_OUTPUT_OUT3_MASK (0x8U) -#define SCT_OUTPUT_OUT3_SHIFT (3U) -/*! OUT3 - Output Low and High - * 0b0..Forces the corresponding output low - * 0b1..Forces the corresponding output high - */ -#define SCT_OUTPUT_OUT3(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUT_OUT3_SHIFT)) & SCT_OUTPUT_OUT3_MASK) - -#define SCT_OUTPUT_OUT4_MASK (0x10U) -#define SCT_OUTPUT_OUT4_SHIFT (4U) -/*! OUT4 - Output Low and High - * 0b0..Forces the corresponding output low - * 0b1..Forces the corresponding output high - */ -#define SCT_OUTPUT_OUT4(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUT_OUT4_SHIFT)) & SCT_OUTPUT_OUT4_MASK) - -#define SCT_OUTPUT_OUT5_MASK (0x20U) -#define SCT_OUTPUT_OUT5_SHIFT (5U) -/*! OUT5 - Output Low and High - * 0b0..Forces the corresponding output low - * 0b1..Forces the corresponding output high - */ -#define SCT_OUTPUT_OUT5(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUT_OUT5_SHIFT)) & SCT_OUTPUT_OUT5_MASK) - -#define SCT_OUTPUT_OUT6_MASK (0x40U) -#define SCT_OUTPUT_OUT6_SHIFT (6U) -/*! OUT6 - Output Low and High - * 0b0..Forces the corresponding output low - * 0b1..Forces the corresponding output high - */ -#define SCT_OUTPUT_OUT6(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUT_OUT6_SHIFT)) & SCT_OUTPUT_OUT6_MASK) - -#define SCT_OUTPUT_OUT7_MASK (0x80U) -#define SCT_OUTPUT_OUT7_SHIFT (7U) -/*! OUT7 - Output Low and High - * 0b0..Forces the corresponding output low - * 0b1..Forces the corresponding output high - */ -#define SCT_OUTPUT_OUT7(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUT_OUT7_SHIFT)) & SCT_OUTPUT_OUT7_MASK) - -#define SCT_OUTPUT_OUT8_MASK (0x100U) -#define SCT_OUTPUT_OUT8_SHIFT (8U) -/*! OUT8 - Output Low and High - * 0b0..Forces the corresponding output low - * 0b1..Forces the corresponding output high - */ -#define SCT_OUTPUT_OUT8(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUT_OUT8_SHIFT)) & SCT_OUTPUT_OUT8_MASK) - -#define SCT_OUTPUT_OUT9_MASK (0x200U) -#define SCT_OUTPUT_OUT9_SHIFT (9U) -/*! OUT9 - Output Low and High - * 0b0..Forces the corresponding output low - * 0b1..Forces the corresponding output high - */ -#define SCT_OUTPUT_OUT9(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUT_OUT9_SHIFT)) & SCT_OUTPUT_OUT9_MASK) -/*! @} */ - -/*! @name OUTPUTDIRCTRL - Output Counter Direction Control */ -/*! @{ */ - -#define SCT_OUTPUTDIRCTRL_SETCLR0_MASK (0x3U) -#define SCT_OUTPUTDIRCTRL_SETCLR0_SHIFT (0U) -/*! SETCLR0 - Set and Clear Operation on Output - * 0b00..Not dependent on the direction of any counter - * 0b01..Reversed when counter L or the unified counter is counting down - * 0b10..Reversed when counter H is counting down (do not use this value when CONFIG[UNIFY] = 1) - * 0b11..Reserved (do not program this value) - */ -#define SCT_OUTPUTDIRCTRL_SETCLR0(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUTDIRCTRL_SETCLR0_SHIFT)) & SCT_OUTPUTDIRCTRL_SETCLR0_MASK) - -#define SCT_OUTPUTDIRCTRL_SETCLR1_MASK (0xCU) -#define SCT_OUTPUTDIRCTRL_SETCLR1_SHIFT (2U) -/*! SETCLR1 - Set and Clear Operation on Output - * 0b00..Not dependent on the direction of any counter - * 0b01..Reversed when counter L or the unified counter is counting down - * 0b10..Reversed when counter H is counting down (do not use this value when CONFIG[UNIFY] = 1) - * 0b11..Reserved (do not program this value) - */ -#define SCT_OUTPUTDIRCTRL_SETCLR1(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUTDIRCTRL_SETCLR1_SHIFT)) & SCT_OUTPUTDIRCTRL_SETCLR1_MASK) - -#define SCT_OUTPUTDIRCTRL_SETCLR2_MASK (0x30U) -#define SCT_OUTPUTDIRCTRL_SETCLR2_SHIFT (4U) -/*! SETCLR2 - Set and Clear Operation on Output - * 0b00..Not dependent on the direction of any counter - * 0b01..Reversed when counter L or the unified counter is counting down - * 0b10..Reversed when counter H is counting down (do not use this value when CONFIG[UNIFY] = 1) - * 0b11..Reserved (do not program this value) - */ -#define SCT_OUTPUTDIRCTRL_SETCLR2(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUTDIRCTRL_SETCLR2_SHIFT)) & SCT_OUTPUTDIRCTRL_SETCLR2_MASK) - -#define SCT_OUTPUTDIRCTRL_SETCLR3_MASK (0xC0U) -#define SCT_OUTPUTDIRCTRL_SETCLR3_SHIFT (6U) -/*! SETCLR3 - Set and Clear Operation on Output - * 0b00..Not dependent on the direction of any counter - * 0b01..Reversed when counter L or the unified counter is counting down - * 0b10..Reversed when counter H is counting down (do not use this value when CONFIG[UNIFY] = 1) - * 0b11..Reserved (do not program this value) - */ -#define SCT_OUTPUTDIRCTRL_SETCLR3(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUTDIRCTRL_SETCLR3_SHIFT)) & SCT_OUTPUTDIRCTRL_SETCLR3_MASK) - -#define SCT_OUTPUTDIRCTRL_SETCLR4_MASK (0x300U) -#define SCT_OUTPUTDIRCTRL_SETCLR4_SHIFT (8U) -/*! SETCLR4 - Set and Clear Operation on Output - * 0b00..Not dependent on the direction of any counter - * 0b01..Reversed when counter L or the unified counter is counting down - * 0b10..Reversed when counter H is counting down (do not use this value when CONFIG[UNIFY] = 1) - * 0b11..Reserved (do not program this value) - */ -#define SCT_OUTPUTDIRCTRL_SETCLR4(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUTDIRCTRL_SETCLR4_SHIFT)) & SCT_OUTPUTDIRCTRL_SETCLR4_MASK) - -#define SCT_OUTPUTDIRCTRL_SETCLR5_MASK (0xC00U) -#define SCT_OUTPUTDIRCTRL_SETCLR5_SHIFT (10U) -/*! SETCLR5 - Set and Clear Operation on Output - * 0b00..Not dependent on the direction of any counter - * 0b01..Reversed when counter L or the unified counter is counting down - * 0b10..Reversed when counter H is counting down (do not use this value when CONFIG[UNIFY] = 1) - * 0b11..Reserved (do not program this value) - */ -#define SCT_OUTPUTDIRCTRL_SETCLR5(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUTDIRCTRL_SETCLR5_SHIFT)) & SCT_OUTPUTDIRCTRL_SETCLR5_MASK) - -#define SCT_OUTPUTDIRCTRL_SETCLR6_MASK (0x3000U) -#define SCT_OUTPUTDIRCTRL_SETCLR6_SHIFT (12U) -/*! SETCLR6 - Set and Clear Operation on Output - * 0b00..Not dependent on the direction of any counter - * 0b01..Reversed when counter L or the unified counter is counting down - * 0b10..Reversed when counter H is counting down (do not use this value when CONFIG[UNIFY] = 1) - * 0b11..Reserved (do not program this value) - */ -#define SCT_OUTPUTDIRCTRL_SETCLR6(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUTDIRCTRL_SETCLR6_SHIFT)) & SCT_OUTPUTDIRCTRL_SETCLR6_MASK) - -#define SCT_OUTPUTDIRCTRL_SETCLR7_MASK (0xC000U) -#define SCT_OUTPUTDIRCTRL_SETCLR7_SHIFT (14U) -/*! SETCLR7 - Set and Clear Operation on Output - * 0b00..Not dependent on the direction of any counter - * 0b01..Reversed when counter L or the unified counter is counting down - * 0b10..Reversed when counter H is counting down (do not use this value when CONFIG[UNIFY] = 1) - * 0b11..Reserved (do not program this value) - */ -#define SCT_OUTPUTDIRCTRL_SETCLR7(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUTDIRCTRL_SETCLR7_SHIFT)) & SCT_OUTPUTDIRCTRL_SETCLR7_MASK) - -#define SCT_OUTPUTDIRCTRL_SETCLR8_MASK (0x30000U) -#define SCT_OUTPUTDIRCTRL_SETCLR8_SHIFT (16U) -/*! SETCLR8 - Set and Clear Operation on Output - * 0b00..Not dependent on the direction of any counter - * 0b01..Reversed when counter L or the unified counter is counting down - * 0b10..Reversed when counter H is counting down (do not use this value when CONFIG[UNIFY] = 1) - * 0b11..Reserved (do not program this value) - */ -#define SCT_OUTPUTDIRCTRL_SETCLR8(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUTDIRCTRL_SETCLR8_SHIFT)) & SCT_OUTPUTDIRCTRL_SETCLR8_MASK) - -#define SCT_OUTPUTDIRCTRL_SETCLR9_MASK (0xC0000U) -#define SCT_OUTPUTDIRCTRL_SETCLR9_SHIFT (18U) -/*! SETCLR9 - Set and Clear Operation on Output - * 0b00..Not dependent on the direction of any counter - * 0b01..Reversed when counter L or the unified counter is counting down - * 0b10..Reversed when counter H is counting down (do not use this value when CONFIG[UNIFY] = 1) - * 0b11..Reserved (do not program this value) - */ -#define SCT_OUTPUTDIRCTRL_SETCLR9(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUTPUTDIRCTRL_SETCLR9_SHIFT)) & SCT_OUTPUTDIRCTRL_SETCLR9_MASK) -/*! @} */ - -/*! @name RES - Output Conflict Resolution */ -/*! @{ */ - -#define SCT_RES_O0RES_MASK (0x3U) -#define SCT_RES_O0RES_SHIFT (0U) -/*! O0RES - Output Resolution - * 0b00..No change - * 0b01..Set output (or clear, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b10..Clear output (or set, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b11..Toggle output - */ -#define SCT_RES_O0RES(x) (((uint32_t)(((uint32_t)(x)) << SCT_RES_O0RES_SHIFT)) & SCT_RES_O0RES_MASK) - -#define SCT_RES_O1RES_MASK (0xCU) -#define SCT_RES_O1RES_SHIFT (2U) -/*! O1RES - Output Resolution - * 0b00..No change - * 0b01..Set output (or clear, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b10..Clear output (or set, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b11..Toggle output - */ -#define SCT_RES_O1RES(x) (((uint32_t)(((uint32_t)(x)) << SCT_RES_O1RES_SHIFT)) & SCT_RES_O1RES_MASK) - -#define SCT_RES_O2RES_MASK (0x30U) -#define SCT_RES_O2RES_SHIFT (4U) -/*! O2RES - Output Resolution - * 0b00..No change - * 0b01..Set output (or clear, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b10..Clear output (or set, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b11..Toggle output - */ -#define SCT_RES_O2RES(x) (((uint32_t)(((uint32_t)(x)) << SCT_RES_O2RES_SHIFT)) & SCT_RES_O2RES_MASK) - -#define SCT_RES_O3RES_MASK (0xC0U) -#define SCT_RES_O3RES_SHIFT (6U) -/*! O3RES - Output Resolution - * 0b00..No change - * 0b01..Set output (or clear, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b10..Clear output (or set, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b11..Toggle output - */ -#define SCT_RES_O3RES(x) (((uint32_t)(((uint32_t)(x)) << SCT_RES_O3RES_SHIFT)) & SCT_RES_O3RES_MASK) - -#define SCT_RES_O4RES_MASK (0x300U) -#define SCT_RES_O4RES_SHIFT (8U) -/*! O4RES - Output Resolution - * 0b00..No change - * 0b01..Set output (or clear, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b10..Clear output (or set, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b11..Toggle output - */ -#define SCT_RES_O4RES(x) (((uint32_t)(((uint32_t)(x)) << SCT_RES_O4RES_SHIFT)) & SCT_RES_O4RES_MASK) - -#define SCT_RES_O5RES_MASK (0xC00U) -#define SCT_RES_O5RES_SHIFT (10U) -/*! O5RES - Output Resolution - * 0b00..No change - * 0b01..Set output (or clear, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b10..Clear output (or set, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b11..Toggle output - */ -#define SCT_RES_O5RES(x) (((uint32_t)(((uint32_t)(x)) << SCT_RES_O5RES_SHIFT)) & SCT_RES_O5RES_MASK) - -#define SCT_RES_O6RES_MASK (0x3000U) -#define SCT_RES_O6RES_SHIFT (12U) -/*! O6RES - Output Resolution - * 0b00..No change - * 0b01..Set output (or clear, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b10..Clear output (or set, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b11..Toggle output - */ -#define SCT_RES_O6RES(x) (((uint32_t)(((uint32_t)(x)) << SCT_RES_O6RES_SHIFT)) & SCT_RES_O6RES_MASK) - -#define SCT_RES_O7RES_MASK (0xC000U) -#define SCT_RES_O7RES_SHIFT (14U) -/*! O7RES - Output Resolution - * 0b00..No change - * 0b01..Set output (or clear, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b10..Clear output (or set, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b11..Toggle output - */ -#define SCT_RES_O7RES(x) (((uint32_t)(((uint32_t)(x)) << SCT_RES_O7RES_SHIFT)) & SCT_RES_O7RES_MASK) - -#define SCT_RES_O8RES_MASK (0x30000U) -#define SCT_RES_O8RES_SHIFT (16U) -/*! O8RES - Output Resolution - * 0b00..No change - * 0b01..Set output (or clear, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b10..Clear output (or set, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b11..Toggle output - */ -#define SCT_RES_O8RES(x) (((uint32_t)(((uint32_t)(x)) << SCT_RES_O8RES_SHIFT)) & SCT_RES_O8RES_MASK) - -#define SCT_RES_O9RES_MASK (0xC0000U) -#define SCT_RES_O9RES_SHIFT (18U) -/*! O9RES - Output Resolution - * 0b00..No change - * 0b01..Set output (or clear, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b10..Clear output (or set, based on OUTPUTDIRCTRL[SETCLRn]) - * 0b11..Toggle output - */ -#define SCT_RES_O9RES(x) (((uint32_t)(((uint32_t)(x)) << SCT_RES_O9RES_SHIFT)) & SCT_RES_O9RES_MASK) -/*! @} */ - -/*! @name DMAREQ0 - DMA Request 0 */ -/*! @{ */ - -#define SCT_DMAREQ0_DEV_0_MASK (0x1U) -#define SCT_DMAREQ0_DEV_0_SHIFT (0U) -/*! DEV_0 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_0(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_0_SHIFT)) & SCT_DMAREQ0_DEV_0_MASK) - -#define SCT_DMAREQ0_DEV_1_MASK (0x2U) -#define SCT_DMAREQ0_DEV_1_SHIFT (1U) -/*! DEV_1 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_1(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_1_SHIFT)) & SCT_DMAREQ0_DEV_1_MASK) - -#define SCT_DMAREQ0_DEV_2_MASK (0x4U) -#define SCT_DMAREQ0_DEV_2_SHIFT (2U) -/*! DEV_2 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_2(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_2_SHIFT)) & SCT_DMAREQ0_DEV_2_MASK) - -#define SCT_DMAREQ0_DEV_3_MASK (0x8U) -#define SCT_DMAREQ0_DEV_3_SHIFT (3U) -/*! DEV_3 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_3(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_3_SHIFT)) & SCT_DMAREQ0_DEV_3_MASK) - -#define SCT_DMAREQ0_DEV_4_MASK (0x10U) -#define SCT_DMAREQ0_DEV_4_SHIFT (4U) -/*! DEV_4 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_4(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_4_SHIFT)) & SCT_DMAREQ0_DEV_4_MASK) - -#define SCT_DMAREQ0_DEV_5_MASK (0x20U) -#define SCT_DMAREQ0_DEV_5_SHIFT (5U) -/*! DEV_5 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_5(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_5_SHIFT)) & SCT_DMAREQ0_DEV_5_MASK) - -#define SCT_DMAREQ0_DEV_6_MASK (0x40U) -#define SCT_DMAREQ0_DEV_6_SHIFT (6U) -/*! DEV_6 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_6(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_6_SHIFT)) & SCT_DMAREQ0_DEV_6_MASK) - -#define SCT_DMAREQ0_DEV_7_MASK (0x80U) -#define SCT_DMAREQ0_DEV_7_SHIFT (7U) -/*! DEV_7 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_7(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_7_SHIFT)) & SCT_DMAREQ0_DEV_7_MASK) - -#define SCT_DMAREQ0_DEV_8_MASK (0x100U) -#define SCT_DMAREQ0_DEV_8_SHIFT (8U) -/*! DEV_8 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_8(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_8_SHIFT)) & SCT_DMAREQ0_DEV_8_MASK) - -#define SCT_DMAREQ0_DEV_9_MASK (0x200U) -#define SCT_DMAREQ0_DEV_9_SHIFT (9U) -/*! DEV_9 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_9(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_9_SHIFT)) & SCT_DMAREQ0_DEV_9_MASK) - -#define SCT_DMAREQ0_DEV_10_MASK (0x400U) -#define SCT_DMAREQ0_DEV_10_SHIFT (10U) -/*! DEV_10 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_10(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_10_SHIFT)) & SCT_DMAREQ0_DEV_10_MASK) - -#define SCT_DMAREQ0_DEV_11_MASK (0x800U) -#define SCT_DMAREQ0_DEV_11_SHIFT (11U) -/*! DEV_11 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_11(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_11_SHIFT)) & SCT_DMAREQ0_DEV_11_MASK) - -#define SCT_DMAREQ0_DEV_12_MASK (0x1000U) -#define SCT_DMAREQ0_DEV_12_SHIFT (12U) -/*! DEV_12 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_12(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_12_SHIFT)) & SCT_DMAREQ0_DEV_12_MASK) - -#define SCT_DMAREQ0_DEV_13_MASK (0x2000U) -#define SCT_DMAREQ0_DEV_13_SHIFT (13U) -/*! DEV_13 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_13(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_13_SHIFT)) & SCT_DMAREQ0_DEV_13_MASK) - -#define SCT_DMAREQ0_DEV_14_MASK (0x4000U) -#define SCT_DMAREQ0_DEV_14_SHIFT (14U) -/*! DEV_14 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_14(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_14_SHIFT)) & SCT_DMAREQ0_DEV_14_MASK) - -#define SCT_DMAREQ0_DEV_15_MASK (0x8000U) -#define SCT_DMAREQ0_DEV_15_SHIFT (15U) -/*! DEV_15 - DMA Request Event */ -#define SCT_DMAREQ0_DEV_15(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DEV_15_SHIFT)) & SCT_DMAREQ0_DEV_15_MASK) - -#define SCT_DMAREQ0_DRL0_MASK (0x40000000U) -#define SCT_DMAREQ0_DRL0_SHIFT (30U) -/*! DRL0 - DMA Request Low 0 */ -#define SCT_DMAREQ0_DRL0(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DRL0_SHIFT)) & SCT_DMAREQ0_DRL0_MASK) - -#define SCT_DMAREQ0_DRQ0_MASK (0x80000000U) -#define SCT_DMAREQ0_DRQ0_SHIFT (31U) -/*! DRQ0 - DMA Request 0 State */ -#define SCT_DMAREQ0_DRQ0(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ0_DRQ0_SHIFT)) & SCT_DMAREQ0_DRQ0_MASK) -/*! @} */ - -/*! @name DMAREQ1 - DMA Request 1 */ -/*! @{ */ - -#define SCT_DMAREQ1_DEV_0_MASK (0x1U) -#define SCT_DMAREQ1_DEV_0_SHIFT (0U) -/*! DEV_0 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_0(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_0_SHIFT)) & SCT_DMAREQ1_DEV_0_MASK) - -#define SCT_DMAREQ1_DEV_1_MASK (0x2U) -#define SCT_DMAREQ1_DEV_1_SHIFT (1U) -/*! DEV_1 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_1(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_1_SHIFT)) & SCT_DMAREQ1_DEV_1_MASK) - -#define SCT_DMAREQ1_DEV_2_MASK (0x4U) -#define SCT_DMAREQ1_DEV_2_SHIFT (2U) -/*! DEV_2 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_2(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_2_SHIFT)) & SCT_DMAREQ1_DEV_2_MASK) - -#define SCT_DMAREQ1_DEV_3_MASK (0x8U) -#define SCT_DMAREQ1_DEV_3_SHIFT (3U) -/*! DEV_3 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_3(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_3_SHIFT)) & SCT_DMAREQ1_DEV_3_MASK) - -#define SCT_DMAREQ1_DEV_4_MASK (0x10U) -#define SCT_DMAREQ1_DEV_4_SHIFT (4U) -/*! DEV_4 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_4(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_4_SHIFT)) & SCT_DMAREQ1_DEV_4_MASK) - -#define SCT_DMAREQ1_DEV_5_MASK (0x20U) -#define SCT_DMAREQ1_DEV_5_SHIFT (5U) -/*! DEV_5 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_5(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_5_SHIFT)) & SCT_DMAREQ1_DEV_5_MASK) - -#define SCT_DMAREQ1_DEV_6_MASK (0x40U) -#define SCT_DMAREQ1_DEV_6_SHIFT (6U) -/*! DEV_6 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_6(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_6_SHIFT)) & SCT_DMAREQ1_DEV_6_MASK) - -#define SCT_DMAREQ1_DEV_7_MASK (0x80U) -#define SCT_DMAREQ1_DEV_7_SHIFT (7U) -/*! DEV_7 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_7(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_7_SHIFT)) & SCT_DMAREQ1_DEV_7_MASK) - -#define SCT_DMAREQ1_DEV_8_MASK (0x100U) -#define SCT_DMAREQ1_DEV_8_SHIFT (8U) -/*! DEV_8 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_8(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_8_SHIFT)) & SCT_DMAREQ1_DEV_8_MASK) - -#define SCT_DMAREQ1_DEV_9_MASK (0x200U) -#define SCT_DMAREQ1_DEV_9_SHIFT (9U) -/*! DEV_9 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_9(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_9_SHIFT)) & SCT_DMAREQ1_DEV_9_MASK) - -#define SCT_DMAREQ1_DEV_10_MASK (0x400U) -#define SCT_DMAREQ1_DEV_10_SHIFT (10U) -/*! DEV_10 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_10(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_10_SHIFT)) & SCT_DMAREQ1_DEV_10_MASK) - -#define SCT_DMAREQ1_DEV_11_MASK (0x800U) -#define SCT_DMAREQ1_DEV_11_SHIFT (11U) -/*! DEV_11 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_11(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_11_SHIFT)) & SCT_DMAREQ1_DEV_11_MASK) - -#define SCT_DMAREQ1_DEV_12_MASK (0x1000U) -#define SCT_DMAREQ1_DEV_12_SHIFT (12U) -/*! DEV_12 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_12(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_12_SHIFT)) & SCT_DMAREQ1_DEV_12_MASK) - -#define SCT_DMAREQ1_DEV_13_MASK (0x2000U) -#define SCT_DMAREQ1_DEV_13_SHIFT (13U) -/*! DEV_13 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_13(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_13_SHIFT)) & SCT_DMAREQ1_DEV_13_MASK) - -#define SCT_DMAREQ1_DEV_14_MASK (0x4000U) -#define SCT_DMAREQ1_DEV_14_SHIFT (14U) -/*! DEV_14 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_14(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_14_SHIFT)) & SCT_DMAREQ1_DEV_14_MASK) - -#define SCT_DMAREQ1_DEV_15_MASK (0x8000U) -#define SCT_DMAREQ1_DEV_15_SHIFT (15U) -/*! DEV_15 - DMA Request Event */ -#define SCT_DMAREQ1_DEV_15(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DEV_15_SHIFT)) & SCT_DMAREQ1_DEV_15_MASK) - -#define SCT_DMAREQ1_DRL1_MASK (0x40000000U) -#define SCT_DMAREQ1_DRL1_SHIFT (30U) -/*! DRL1 - DMA Request Low 1 */ -#define SCT_DMAREQ1_DRL1(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DRL1_SHIFT)) & SCT_DMAREQ1_DRL1_MASK) - -#define SCT_DMAREQ1_DRQ1_MASK (0x80000000U) -#define SCT_DMAREQ1_DRQ1_SHIFT (31U) -/*! DRQ1 - DMA Request 1 State */ -#define SCT_DMAREQ1_DRQ1(x) (((uint32_t)(((uint32_t)(x)) << SCT_DMAREQ1_DRQ1_SHIFT)) & SCT_DMAREQ1_DRQ1_MASK) -/*! @} */ - -/*! @name EVEN - Event Interrupt Enable */ -/*! @{ */ - -#define SCT_EVEN_IEN0_MASK (0x1U) -#define SCT_EVEN_IEN0_SHIFT (0U) -/*! IEN0 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN0(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN0_SHIFT)) & SCT_EVEN_IEN0_MASK) - -#define SCT_EVEN_IEN1_MASK (0x2U) -#define SCT_EVEN_IEN1_SHIFT (1U) -/*! IEN1 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN1(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN1_SHIFT)) & SCT_EVEN_IEN1_MASK) - -#define SCT_EVEN_IEN2_MASK (0x4U) -#define SCT_EVEN_IEN2_SHIFT (2U) -/*! IEN2 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN2(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN2_SHIFT)) & SCT_EVEN_IEN2_MASK) - -#define SCT_EVEN_IEN3_MASK (0x8U) -#define SCT_EVEN_IEN3_SHIFT (3U) -/*! IEN3 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN3(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN3_SHIFT)) & SCT_EVEN_IEN3_MASK) - -#define SCT_EVEN_IEN4_MASK (0x10U) -#define SCT_EVEN_IEN4_SHIFT (4U) -/*! IEN4 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN4(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN4_SHIFT)) & SCT_EVEN_IEN4_MASK) - -#define SCT_EVEN_IEN5_MASK (0x20U) -#define SCT_EVEN_IEN5_SHIFT (5U) -/*! IEN5 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN5(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN5_SHIFT)) & SCT_EVEN_IEN5_MASK) - -#define SCT_EVEN_IEN6_MASK (0x40U) -#define SCT_EVEN_IEN6_SHIFT (6U) -/*! IEN6 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN6(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN6_SHIFT)) & SCT_EVEN_IEN6_MASK) - -#define SCT_EVEN_IEN7_MASK (0x80U) -#define SCT_EVEN_IEN7_SHIFT (7U) -/*! IEN7 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN7(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN7_SHIFT)) & SCT_EVEN_IEN7_MASK) - -#define SCT_EVEN_IEN8_MASK (0x100U) -#define SCT_EVEN_IEN8_SHIFT (8U) -/*! IEN8 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN8(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN8_SHIFT)) & SCT_EVEN_IEN8_MASK) - -#define SCT_EVEN_IEN9_MASK (0x200U) -#define SCT_EVEN_IEN9_SHIFT (9U) -/*! IEN9 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN9(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN9_SHIFT)) & SCT_EVEN_IEN9_MASK) - -#define SCT_EVEN_IEN10_MASK (0x400U) -#define SCT_EVEN_IEN10_SHIFT (10U) -/*! IEN10 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN10(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN10_SHIFT)) & SCT_EVEN_IEN10_MASK) - -#define SCT_EVEN_IEN11_MASK (0x800U) -#define SCT_EVEN_IEN11_SHIFT (11U) -/*! IEN11 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN11(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN11_SHIFT)) & SCT_EVEN_IEN11_MASK) - -#define SCT_EVEN_IEN12_MASK (0x1000U) -#define SCT_EVEN_IEN12_SHIFT (12U) -/*! IEN12 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN12(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN12_SHIFT)) & SCT_EVEN_IEN12_MASK) - -#define SCT_EVEN_IEN13_MASK (0x2000U) -#define SCT_EVEN_IEN13_SHIFT (13U) -/*! IEN13 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN13(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN13_SHIFT)) & SCT_EVEN_IEN13_MASK) - -#define SCT_EVEN_IEN14_MASK (0x4000U) -#define SCT_EVEN_IEN14_SHIFT (14U) -/*! IEN14 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN14(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN14_SHIFT)) & SCT_EVEN_IEN14_MASK) - -#define SCT_EVEN_IEN15_MASK (0x8000U) -#define SCT_EVEN_IEN15_SHIFT (15U) -/*! IEN15 - Event Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SCT_EVEN_IEN15(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVEN_IEN15_SHIFT)) & SCT_EVEN_IEN15_MASK) -/*! @} */ - -/*! @name EVFLAG - Event Flag */ -/*! @{ */ - -#define SCT_EVFLAG_FLAG0_MASK (0x1U) -#define SCT_EVFLAG_FLAG0_SHIFT (0U) -/*! FLAG0 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG0(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG0_SHIFT)) & SCT_EVFLAG_FLAG0_MASK) - -#define SCT_EVFLAG_FLAG1_MASK (0x2U) -#define SCT_EVFLAG_FLAG1_SHIFT (1U) -/*! FLAG1 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG1(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG1_SHIFT)) & SCT_EVFLAG_FLAG1_MASK) - -#define SCT_EVFLAG_FLAG2_MASK (0x4U) -#define SCT_EVFLAG_FLAG2_SHIFT (2U) -/*! FLAG2 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG2(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG2_SHIFT)) & SCT_EVFLAG_FLAG2_MASK) - -#define SCT_EVFLAG_FLAG3_MASK (0x8U) -#define SCT_EVFLAG_FLAG3_SHIFT (3U) -/*! FLAG3 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG3(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG3_SHIFT)) & SCT_EVFLAG_FLAG3_MASK) - -#define SCT_EVFLAG_FLAG4_MASK (0x10U) -#define SCT_EVFLAG_FLAG4_SHIFT (4U) -/*! FLAG4 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG4(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG4_SHIFT)) & SCT_EVFLAG_FLAG4_MASK) - -#define SCT_EVFLAG_FLAG5_MASK (0x20U) -#define SCT_EVFLAG_FLAG5_SHIFT (5U) -/*! FLAG5 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG5(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG5_SHIFT)) & SCT_EVFLAG_FLAG5_MASK) - -#define SCT_EVFLAG_FLAG6_MASK (0x40U) -#define SCT_EVFLAG_FLAG6_SHIFT (6U) -/*! FLAG6 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG6(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG6_SHIFT)) & SCT_EVFLAG_FLAG6_MASK) - -#define SCT_EVFLAG_FLAG7_MASK (0x80U) -#define SCT_EVFLAG_FLAG7_SHIFT (7U) -/*! FLAG7 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG7(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG7_SHIFT)) & SCT_EVFLAG_FLAG7_MASK) - -#define SCT_EVFLAG_FLAG8_MASK (0x100U) -#define SCT_EVFLAG_FLAG8_SHIFT (8U) -/*! FLAG8 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG8(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG8_SHIFT)) & SCT_EVFLAG_FLAG8_MASK) - -#define SCT_EVFLAG_FLAG9_MASK (0x200U) -#define SCT_EVFLAG_FLAG9_SHIFT (9U) -/*! FLAG9 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG9(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG9_SHIFT)) & SCT_EVFLAG_FLAG9_MASK) - -#define SCT_EVFLAG_FLAG10_MASK (0x400U) -#define SCT_EVFLAG_FLAG10_SHIFT (10U) -/*! FLAG10 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG10(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG10_SHIFT)) & SCT_EVFLAG_FLAG10_MASK) - -#define SCT_EVFLAG_FLAG11_MASK (0x800U) -#define SCT_EVFLAG_FLAG11_SHIFT (11U) -/*! FLAG11 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG11(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG11_SHIFT)) & SCT_EVFLAG_FLAG11_MASK) - -#define SCT_EVFLAG_FLAG12_MASK (0x1000U) -#define SCT_EVFLAG_FLAG12_SHIFT (12U) -/*! FLAG12 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG12(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG12_SHIFT)) & SCT_EVFLAG_FLAG12_MASK) - -#define SCT_EVFLAG_FLAG13_MASK (0x2000U) -#define SCT_EVFLAG_FLAG13_SHIFT (13U) -/*! FLAG13 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG13(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG13_SHIFT)) & SCT_EVFLAG_FLAG13_MASK) - -#define SCT_EVFLAG_FLAG14_MASK (0x4000U) -#define SCT_EVFLAG_FLAG14_SHIFT (14U) -/*! FLAG14 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG14(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG14_SHIFT)) & SCT_EVFLAG_FLAG14_MASK) - -#define SCT_EVFLAG_FLAG15_MASK (0x8000U) -#define SCT_EVFLAG_FLAG15_SHIFT (15U) -/*! FLAG15 - Event Flag - * 0b0..No flag - * 0b1..Event n flag - */ -#define SCT_EVFLAG_FLAG15(x) (((uint32_t)(((uint32_t)(x)) << SCT_EVFLAG_FLAG15_SHIFT)) & SCT_EVFLAG_FLAG15_MASK) -/*! @} */ - -/*! @name CONEN - Conflict Interrupt Enable */ -/*! @{ */ - -#define SCT_CONEN_NCEN0_MASK (0x1U) -#define SCT_CONEN_NCEN0_SHIFT (0U) -/*! NCEN0 - No Change Conflict Event and Interrupt Enable - * 0b0..No interrupt - * 0b1..Interrupt - */ -#define SCT_CONEN_NCEN0(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONEN_NCEN0_SHIFT)) & SCT_CONEN_NCEN0_MASK) - -#define SCT_CONEN_NCEN1_MASK (0x2U) -#define SCT_CONEN_NCEN1_SHIFT (1U) -/*! NCEN1 - No Change Conflict Event and Interrupt Enable - * 0b0..No interrupt - * 0b1..Interrupt - */ -#define SCT_CONEN_NCEN1(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONEN_NCEN1_SHIFT)) & SCT_CONEN_NCEN1_MASK) - -#define SCT_CONEN_NCEN2_MASK (0x4U) -#define SCT_CONEN_NCEN2_SHIFT (2U) -/*! NCEN2 - No Change Conflict Event and Interrupt Enable - * 0b0..No interrupt - * 0b1..Interrupt - */ -#define SCT_CONEN_NCEN2(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONEN_NCEN2_SHIFT)) & SCT_CONEN_NCEN2_MASK) - -#define SCT_CONEN_NCEN3_MASK (0x8U) -#define SCT_CONEN_NCEN3_SHIFT (3U) -/*! NCEN3 - No Change Conflict Event and Interrupt Enable - * 0b0..No interrupt - * 0b1..Interrupt - */ -#define SCT_CONEN_NCEN3(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONEN_NCEN3_SHIFT)) & SCT_CONEN_NCEN3_MASK) - -#define SCT_CONEN_NCEN4_MASK (0x10U) -#define SCT_CONEN_NCEN4_SHIFT (4U) -/*! NCEN4 - No Change Conflict Event and Interrupt Enable - * 0b0..No interrupt - * 0b1..Interrupt - */ -#define SCT_CONEN_NCEN4(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONEN_NCEN4_SHIFT)) & SCT_CONEN_NCEN4_MASK) - -#define SCT_CONEN_NCEN5_MASK (0x20U) -#define SCT_CONEN_NCEN5_SHIFT (5U) -/*! NCEN5 - No Change Conflict Event and Interrupt Enable - * 0b0..No interrupt - * 0b1..Interrupt - */ -#define SCT_CONEN_NCEN5(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONEN_NCEN5_SHIFT)) & SCT_CONEN_NCEN5_MASK) - -#define SCT_CONEN_NCEN6_MASK (0x40U) -#define SCT_CONEN_NCEN6_SHIFT (6U) -/*! NCEN6 - No Change Conflict Event and Interrupt Enable - * 0b0..No interrupt - * 0b1..Interrupt - */ -#define SCT_CONEN_NCEN6(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONEN_NCEN6_SHIFT)) & SCT_CONEN_NCEN6_MASK) - -#define SCT_CONEN_NCEN7_MASK (0x80U) -#define SCT_CONEN_NCEN7_SHIFT (7U) -/*! NCEN7 - No Change Conflict Event and Interrupt Enable - * 0b0..No interrupt - * 0b1..Interrupt - */ -#define SCT_CONEN_NCEN7(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONEN_NCEN7_SHIFT)) & SCT_CONEN_NCEN7_MASK) - -#define SCT_CONEN_NCEN8_MASK (0x100U) -#define SCT_CONEN_NCEN8_SHIFT (8U) -/*! NCEN8 - No Change Conflict Event and Interrupt Enable - * 0b0..No interrupt - * 0b1..Interrupt - */ -#define SCT_CONEN_NCEN8(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONEN_NCEN8_SHIFT)) & SCT_CONEN_NCEN8_MASK) - -#define SCT_CONEN_NCEN9_MASK (0x200U) -#define SCT_CONEN_NCEN9_SHIFT (9U) -/*! NCEN9 - No Change Conflict Event and Interrupt Enable - * 0b0..No interrupt - * 0b1..Interrupt - */ -#define SCT_CONEN_NCEN9(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONEN_NCEN9_SHIFT)) & SCT_CONEN_NCEN9_MASK) -/*! @} */ - -/*! @name CONFLAG - Conflict Flag */ -/*! @{ */ - -#define SCT_CONFLAG_NCFLAG0_MASK (0x1U) -#define SCT_CONFLAG_NCFLAG0_SHIFT (0U) -/*! NCFLAG0 - No Change Conflict Event Flag - * 0b0..Did not occur - * 0b1..Occurred - */ -#define SCT_CONFLAG_NCFLAG0(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFLAG_NCFLAG0_SHIFT)) & SCT_CONFLAG_NCFLAG0_MASK) - -#define SCT_CONFLAG_NCFLAG1_MASK (0x2U) -#define SCT_CONFLAG_NCFLAG1_SHIFT (1U) -/*! NCFLAG1 - No Change Conflict Event Flag - * 0b0..Did not occur - * 0b1..Occurred - */ -#define SCT_CONFLAG_NCFLAG1(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFLAG_NCFLAG1_SHIFT)) & SCT_CONFLAG_NCFLAG1_MASK) - -#define SCT_CONFLAG_NCFLAG2_MASK (0x4U) -#define SCT_CONFLAG_NCFLAG2_SHIFT (2U) -/*! NCFLAG2 - No Change Conflict Event Flag - * 0b0..Did not occur - * 0b1..Occurred - */ -#define SCT_CONFLAG_NCFLAG2(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFLAG_NCFLAG2_SHIFT)) & SCT_CONFLAG_NCFLAG2_MASK) - -#define SCT_CONFLAG_NCFLAG3_MASK (0x8U) -#define SCT_CONFLAG_NCFLAG3_SHIFT (3U) -/*! NCFLAG3 - No Change Conflict Event Flag - * 0b0..Did not occur - * 0b1..Occurred - */ -#define SCT_CONFLAG_NCFLAG3(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFLAG_NCFLAG3_SHIFT)) & SCT_CONFLAG_NCFLAG3_MASK) - -#define SCT_CONFLAG_NCFLAG4_MASK (0x10U) -#define SCT_CONFLAG_NCFLAG4_SHIFT (4U) -/*! NCFLAG4 - No Change Conflict Event Flag - * 0b0..Did not occur - * 0b1..Occurred - */ -#define SCT_CONFLAG_NCFLAG4(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFLAG_NCFLAG4_SHIFT)) & SCT_CONFLAG_NCFLAG4_MASK) - -#define SCT_CONFLAG_NCFLAG5_MASK (0x20U) -#define SCT_CONFLAG_NCFLAG5_SHIFT (5U) -/*! NCFLAG5 - No Change Conflict Event Flag - * 0b0..Did not occur - * 0b1..Occurred - */ -#define SCT_CONFLAG_NCFLAG5(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFLAG_NCFLAG5_SHIFT)) & SCT_CONFLAG_NCFLAG5_MASK) - -#define SCT_CONFLAG_NCFLAG6_MASK (0x40U) -#define SCT_CONFLAG_NCFLAG6_SHIFT (6U) -/*! NCFLAG6 - No Change Conflict Event Flag - * 0b0..Did not occur - * 0b1..Occurred - */ -#define SCT_CONFLAG_NCFLAG6(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFLAG_NCFLAG6_SHIFT)) & SCT_CONFLAG_NCFLAG6_MASK) - -#define SCT_CONFLAG_NCFLAG7_MASK (0x80U) -#define SCT_CONFLAG_NCFLAG7_SHIFT (7U) -/*! NCFLAG7 - No Change Conflict Event Flag - * 0b0..Did not occur - * 0b1..Occurred - */ -#define SCT_CONFLAG_NCFLAG7(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFLAG_NCFLAG7_SHIFT)) & SCT_CONFLAG_NCFLAG7_MASK) - -#define SCT_CONFLAG_NCFLAG8_MASK (0x100U) -#define SCT_CONFLAG_NCFLAG8_SHIFT (8U) -/*! NCFLAG8 - No Change Conflict Event Flag - * 0b0..Did not occur - * 0b1..Occurred - */ -#define SCT_CONFLAG_NCFLAG8(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFLAG_NCFLAG8_SHIFT)) & SCT_CONFLAG_NCFLAG8_MASK) - -#define SCT_CONFLAG_NCFLAG9_MASK (0x200U) -#define SCT_CONFLAG_NCFLAG9_SHIFT (9U) -/*! NCFLAG9 - No Change Conflict Event Flag - * 0b0..Did not occur - * 0b1..Occurred - */ -#define SCT_CONFLAG_NCFLAG9(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFLAG_NCFLAG9_SHIFT)) & SCT_CONFLAG_NCFLAG9_MASK) - -#define SCT_CONFLAG_BUSERRL_MASK (0x40000000U) -#define SCT_CONFLAG_BUSERRL_SHIFT (30U) -/*! BUSERRL - Bus Error Low or Unified */ -#define SCT_CONFLAG_BUSERRL(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFLAG_BUSERRL_SHIFT)) & SCT_CONFLAG_BUSERRL_MASK) - -#define SCT_CONFLAG_BUSERRH_MASK (0x80000000U) -#define SCT_CONFLAG_BUSERRH_SHIFT (31U) -/*! BUSERRH - Bus Error High */ -#define SCT_CONFLAG_BUSERRH(x) (((uint32_t)(((uint32_t)(x)) << SCT_CONFLAG_BUSERRH_SHIFT)) & SCT_CONFLAG_BUSERRH_MASK) -/*! @} */ - -/*! @name CAPL - SCT_CAPL register */ -/*! @{ */ - -#define SCT_CAPL_CAPL_MASK (0xFFFFU) -#define SCT_CAPL_CAPL_SHIFT (0U) -#define SCT_CAPL_CAPL(x) (((uint16_t)(((uint16_t)(x)) << SCT_CAPL_CAPL_SHIFT)) & SCT_CAPL_CAPL_MASK) -/*! @} */ - -/* The count of SCT_CAPL */ -#define SCT_CAPL_COUNT (16U) - -/*! @name CAPH - SCT_CAPH register */ -/*! @{ */ - -#define SCT_CAPH_CAPH_MASK (0xFFFFU) -#define SCT_CAPH_CAPH_SHIFT (0U) -#define SCT_CAPH_CAPH(x) (((uint16_t)(((uint16_t)(x)) << SCT_CAPH_CAPH_SHIFT)) & SCT_CAPH_CAPH_MASK) -/*! @} */ - -/* The count of SCT_CAPH */ -#define SCT_CAPH_COUNT (16U) - -/*! @name CAP - Capture Value */ -/*! @{ */ - -#define SCT_CAP_CAPn_L_MASK (0xFFFFU) -#define SCT_CAP_CAPn_L_SHIFT (0U) -/*! CAPn_L - Capture Low */ -#define SCT_CAP_CAPn_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_CAP_CAPn_L_SHIFT)) & SCT_CAP_CAPn_L_MASK) - -#define SCT_CAP_CAPn_H_MASK (0xFFFF0000U) -#define SCT_CAP_CAPn_H_SHIFT (16U) -/*! CAPn_H - Capture High */ -#define SCT_CAP_CAPn_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_CAP_CAPn_H_SHIFT)) & SCT_CAP_CAPn_H_MASK) -/*! @} */ - -/* The count of SCT_CAP */ -#define SCT_CAP_COUNT (16U) - -/*! @name MATCHL - SCT_MATCHL register */ -/*! @{ */ - -#define SCT_MATCHL_MATCHL_MASK (0xFFFFU) -#define SCT_MATCHL_MATCHL_SHIFT (0U) -#define SCT_MATCHL_MATCHL(x) (((uint16_t)(((uint16_t)(x)) << SCT_MATCHL_MATCHL_SHIFT)) & SCT_MATCHL_MATCHL_MASK) -/*! @} */ - -/* The count of SCT_MATCHL */ -#define SCT_MATCHL_COUNT (16U) - -/*! @name MATCHH - SCT_MATCHH register */ -/*! @{ */ - -#define SCT_MATCHH_MATCHH_MASK (0xFFFFU) -#define SCT_MATCHH_MATCHH_SHIFT (0U) -#define SCT_MATCHH_MATCHH(x) (((uint16_t)(((uint16_t)(x)) << SCT_MATCHH_MATCHH_SHIFT)) & SCT_MATCHH_MATCHH_MASK) -/*! @} */ - -/* The count of SCT_MATCHH */ -#define SCT_MATCHH_COUNT (16U) - -/*! @name MATCH - Match Value */ -/*! @{ */ - -#define SCT_MATCH_MATCHn_L_MASK (0xFFFFU) -#define SCT_MATCH_MATCHn_L_SHIFT (0U) -/*! MATCHn_L - Match Low */ -#define SCT_MATCH_MATCHn_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_MATCH_MATCHn_L_SHIFT)) & SCT_MATCH_MATCHn_L_MASK) - -#define SCT_MATCH_MATCHn_H_MASK (0xFFFF0000U) -#define SCT_MATCH_MATCHn_H_SHIFT (16U) -/*! MATCHn_H - Match High */ -#define SCT_MATCH_MATCHn_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_MATCH_MATCHn_H_SHIFT)) & SCT_MATCH_MATCHn_H_MASK) -/*! @} */ - -/* The count of SCT_MATCH */ -#define SCT_MATCH_COUNT (16U) - -/*! @name FRACMAT - Fractional Match */ -/*! @{ */ - -#define SCT_FRACMAT_FRACMAT_L_MASK (0xFU) -#define SCT_FRACMAT_FRACMAT_L_SHIFT (0U) -/*! FRACMAT_L - Fractional Match Low */ -#define SCT_FRACMAT_FRACMAT_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_FRACMAT_FRACMAT_L_SHIFT)) & SCT_FRACMAT_FRACMAT_L_MASK) - -#define SCT_FRACMAT_FRACMAT_H_MASK (0xF0000U) -#define SCT_FRACMAT_FRACMAT_H_SHIFT (16U) -/*! FRACMAT_H - Fractional Match High */ -#define SCT_FRACMAT_FRACMAT_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_FRACMAT_FRACMAT_H_SHIFT)) & SCT_FRACMAT_FRACMAT_H_MASK) -/*! @} */ - -/* The count of SCT_FRACMAT */ -#define SCT_FRACMAT_COUNT (6U) - -/*! @name CAPCTRLL - SCT_CAPCTRLL register */ -/*! @{ */ - -#define SCT_CAPCTRLL_CAPCTRLL_MASK (0xFFFFU) -#define SCT_CAPCTRLL_CAPCTRLL_SHIFT (0U) -#define SCT_CAPCTRLL_CAPCTRLL(x) (((uint16_t)(((uint16_t)(x)) << SCT_CAPCTRLL_CAPCTRLL_SHIFT)) & SCT_CAPCTRLL_CAPCTRLL_MASK) -/*! @} */ - -/* The count of SCT_CAPCTRLL */ -#define SCT_CAPCTRLL_COUNT (16U) - -/*! @name CAPCTRLH - SCT_CAPCTRLH register */ -/*! @{ */ - -#define SCT_CAPCTRLH_CAPCTRLH_MASK (0xFFFFU) -#define SCT_CAPCTRLH_CAPCTRLH_SHIFT (0U) -#define SCT_CAPCTRLH_CAPCTRLH(x) (((uint16_t)(((uint16_t)(x)) << SCT_CAPCTRLH_CAPCTRLH_SHIFT)) & SCT_CAPCTRLH_CAPCTRLH_MASK) -/*! @} */ - -/* The count of SCT_CAPCTRLH */ -#define SCT_CAPCTRLH_COUNT (16U) - -/*! @name SCTCAPCTRL_CAPCTRL - Capture Control */ -/*! @{ */ - -#define SCT_SCTCAPCTRL_CAPCTRL_CAPCONn_L_MASK (0xFFFFU) -#define SCT_SCTCAPCTRL_CAPCTRL_CAPCONn_L_SHIFT (0U) -/*! CAPCONn_L - Capture Control Low */ -#define SCT_SCTCAPCTRL_CAPCTRL_CAPCONn_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_SCTCAPCTRL_CAPCTRL_CAPCONn_L_SHIFT)) & SCT_SCTCAPCTRL_CAPCTRL_CAPCONn_L_MASK) - -#define SCT_SCTCAPCTRL_CAPCTRL_CAPCONn_H_MASK (0xFFFF0000U) -#define SCT_SCTCAPCTRL_CAPCTRL_CAPCONn_H_SHIFT (16U) -/*! CAPCONn_H - Capture Control High */ -#define SCT_SCTCAPCTRL_CAPCTRL_CAPCONn_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_SCTCAPCTRL_CAPCTRL_CAPCONn_H_SHIFT)) & SCT_SCTCAPCTRL_CAPCTRL_CAPCONn_H_MASK) -/*! @} */ - -/* The count of SCT_SCTCAPCTRL_CAPCTRL */ -#define SCT_SCTCAPCTRL_CAPCTRL_COUNT (16U) - -/*! @name MATCHRELL - SCT_MATCHRELL register */ -/*! @{ */ - -#define SCT_MATCHRELL_MATCHRELL_MASK (0xFFFFU) -#define SCT_MATCHRELL_MATCHRELL_SHIFT (0U) -#define SCT_MATCHRELL_MATCHRELL(x) (((uint16_t)(((uint16_t)(x)) << SCT_MATCHRELL_MATCHRELL_SHIFT)) & SCT_MATCHRELL_MATCHRELL_MASK) -/*! @} */ - -/* The count of SCT_MATCHRELL */ -#define SCT_MATCHRELL_COUNT (16U) - -/*! @name MATCHRELH - SCT_MATCHRELH register */ -/*! @{ */ - -#define SCT_MATCHRELH_MATCHRELH_MASK (0xFFFFU) -#define SCT_MATCHRELH_MATCHRELH_SHIFT (0U) -#define SCT_MATCHRELH_MATCHRELH(x) (((uint16_t)(((uint16_t)(x)) << SCT_MATCHRELH_MATCHRELH_SHIFT)) & SCT_MATCHRELH_MATCHRELH_MASK) -/*! @} */ - -/* The count of SCT_MATCHRELH */ -#define SCT_MATCHRELH_COUNT (16U) - -/*! @name MATCHREL - Match Reload Value */ -/*! @{ */ - -#define SCT_MATCHREL_RELOADn_L_MASK (0xFFFFU) -#define SCT_MATCHREL_RELOADn_L_SHIFT (0U) -/*! RELOADn_L - Reload Low */ -#define SCT_MATCHREL_RELOADn_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_MATCHREL_RELOADn_L_SHIFT)) & SCT_MATCHREL_RELOADn_L_MASK) - -#define SCT_MATCHREL_RELOADn_H_MASK (0xFFFF0000U) -#define SCT_MATCHREL_RELOADn_H_SHIFT (16U) -/*! RELOADn_H - Reload High */ -#define SCT_MATCHREL_RELOADn_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_MATCHREL_RELOADn_H_SHIFT)) & SCT_MATCHREL_RELOADn_H_MASK) -/*! @} */ - -/* The count of SCT_MATCHREL */ -#define SCT_MATCHREL_COUNT (16U) - -/*! @name FRACMATREL - Fractional Match Reload */ -/*! @{ */ - -#define SCT_FRACMATREL_RELFRAC_L_MASK (0xFU) -#define SCT_FRACMATREL_RELFRAC_L_SHIFT (0U) -/*! RELFRAC_L - Reload Fractional Match Low */ -#define SCT_FRACMATREL_RELFRAC_L(x) (((uint32_t)(((uint32_t)(x)) << SCT_FRACMATREL_RELFRAC_L_SHIFT)) & SCT_FRACMATREL_RELFRAC_L_MASK) - -#define SCT_FRACMATREL_RELFRAC_H_MASK (0xF0000U) -#define SCT_FRACMATREL_RELFRAC_H_SHIFT (16U) -/*! RELFRAC_H - Reload Fractional Match High */ -#define SCT_FRACMATREL_RELFRAC_H(x) (((uint32_t)(((uint32_t)(x)) << SCT_FRACMATREL_RELFRAC_H_SHIFT)) & SCT_FRACMATREL_RELFRAC_H_MASK) -/*! @} */ - -/* The count of SCT_FRACMATREL */ -#define SCT_FRACMATREL_COUNT (6U) - -/*! @name EV_STATE - Event n State */ -/*! @{ */ - -#define SCT_EV_STATE_STATEMSKn_MASK (0xFFFFFFFFU) -#define SCT_EV_STATE_STATEMSKn_SHIFT (0U) -/*! STATEMSKn - Event State Mask */ -#define SCT_EV_STATE_STATEMSKn(x) (((uint32_t)(((uint32_t)(x)) << SCT_EV_STATE_STATEMSKn_SHIFT)) & SCT_EV_STATE_STATEMSKn_MASK) -/*! @} */ - -/* The count of SCT_EV_STATE */ -#define SCT_EV_STATE_COUNT (16U) - -/*! @name EV_CTRL - Event n Control */ -/*! @{ */ - -#define SCT_EV_CTRL_MATCHSEL_MASK (0xFU) -#define SCT_EV_CTRL_MATCHSEL_SHIFT (0U) -/*! MATCHSEL - Match Select */ -#define SCT_EV_CTRL_MATCHSEL(x) (((uint32_t)(((uint32_t)(x)) << SCT_EV_CTRL_MATCHSEL_SHIFT)) & SCT_EV_CTRL_MATCHSEL_MASK) - -#define SCT_EV_CTRL_HEVENT_MASK (0x10U) -#define SCT_EV_CTRL_HEVENT_SHIFT (4U) -/*! HEVENT - High Event - * 0b0..Low counter (selects the L state and the L match register that the MATCHSEL field specifies) - * 0b1..High counter (selects the H state and the H match register that the MATCHSEL field specifies) - */ -#define SCT_EV_CTRL_HEVENT(x) (((uint32_t)(((uint32_t)(x)) << SCT_EV_CTRL_HEVENT_SHIFT)) & SCT_EV_CTRL_HEVENT_MASK) - -#define SCT_EV_CTRL_OUTSEL_MASK (0x20U) -#define SCT_EV_CTRL_OUTSEL_SHIFT (5U) -/*! OUTSEL - Input and Output Select - * 0b0..Inputs - * 0b1..Outputs - */ -#define SCT_EV_CTRL_OUTSEL(x) (((uint32_t)(((uint32_t)(x)) << SCT_EV_CTRL_OUTSEL_SHIFT)) & SCT_EV_CTRL_OUTSEL_MASK) - -#define SCT_EV_CTRL_IOSEL_MASK (0x3C0U) -#define SCT_EV_CTRL_IOSEL_SHIFT (6U) -/*! IOSEL - Input or Output Signal Select */ -#define SCT_EV_CTRL_IOSEL(x) (((uint32_t)(((uint32_t)(x)) << SCT_EV_CTRL_IOSEL_SHIFT)) & SCT_EV_CTRL_IOSEL_MASK) - -#define SCT_EV_CTRL_IOCOND_MASK (0xC00U) -#define SCT_EV_CTRL_IOCOND_SHIFT (10U) -/*! IOCOND - Input or Output Condition - * 0b00..Low - * 0b01..Rise - * 0b10..Fall - * 0b11..High - */ -#define SCT_EV_CTRL_IOCOND(x) (((uint32_t)(((uint32_t)(x)) << SCT_EV_CTRL_IOCOND_SHIFT)) & SCT_EV_CTRL_IOCOND_MASK) - -#define SCT_EV_CTRL_COMBMODE_MASK (0x3000U) -#define SCT_EV_CTRL_COMBMODE_SHIFT (12U) -/*! COMBMODE - Combination Mode - * 0b00..OR (the event occurs when either the specified match or I/O condition occurs) - * 0b01..MATCH (uses the specified match only) - * 0b10..IO (uses the specified I/O condition only) - * 0b11..AND (the event occurs when the specified match and I/O condition occur simultaneously) - */ -#define SCT_EV_CTRL_COMBMODE(x) (((uint32_t)(((uint32_t)(x)) << SCT_EV_CTRL_COMBMODE_SHIFT)) & SCT_EV_CTRL_COMBMODE_MASK) - -#define SCT_EV_CTRL_STATELD_MASK (0x4000U) -#define SCT_EV_CTRL_STATELD_SHIFT (14U) -/*! STATELD - State Load - * 0b0..Value of STATEV added to that of STATE (the carry out is ignored) - * 0b1..Value of STATEV loaded into that of STATE - */ -#define SCT_EV_CTRL_STATELD(x) (((uint32_t)(((uint32_t)(x)) << SCT_EV_CTRL_STATELD_SHIFT)) & SCT_EV_CTRL_STATELD_MASK) - -#define SCT_EV_CTRL_STATEV_MASK (0xF8000U) -#define SCT_EV_CTRL_STATEV_SHIFT (15U) -/*! STATEV - State Value */ -#define SCT_EV_CTRL_STATEV(x) (((uint32_t)(((uint32_t)(x)) << SCT_EV_CTRL_STATEV_SHIFT)) & SCT_EV_CTRL_STATEV_MASK) - -#define SCT_EV_CTRL_MATCHMEM_MASK (0x100000U) -#define SCT_EV_CTRL_MATCHMEM_SHIFT (20U) -/*! MATCHMEM - Match Mem */ -#define SCT_EV_CTRL_MATCHMEM(x) (((uint32_t)(((uint32_t)(x)) << SCT_EV_CTRL_MATCHMEM_SHIFT)) & SCT_EV_CTRL_MATCHMEM_MASK) - -#define SCT_EV_CTRL_DIRECTION_MASK (0x600000U) -#define SCT_EV_CTRL_DIRECTION_SHIFT (21U) -/*! DIRECTION - Direction - * 0b00..Direction independent (event triggered regardless of the count direction) - * 0b01..Counting up (event triggered only during up-counting when CTRL[BIDIR] = 1) - * 0b10..Counting down (event triggered only during down-counting when CTRL[BIDIR] = 1) - * 0b11..Reserved - */ -#define SCT_EV_CTRL_DIRECTION(x) (((uint32_t)(((uint32_t)(x)) << SCT_EV_CTRL_DIRECTION_SHIFT)) & SCT_EV_CTRL_DIRECTION_MASK) -/*! @} */ - -/* The count of SCT_EV_CTRL */ -#define SCT_EV_CTRL_COUNT (16U) - -/*! @name OUT_SET - Output n Set */ -/*! @{ */ - -#define SCT_OUT_SET_SET_MASK (0xFFFFU) -#define SCT_OUT_SET_SET_SHIFT (0U) -/*! SET - Set Output */ -#define SCT_OUT_SET_SET(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUT_SET_SET_SHIFT)) & SCT_OUT_SET_SET_MASK) -/*! @} */ - -/* The count of SCT_OUT_SET */ -#define SCT_OUT_SET_COUNT (10U) - -/*! @name OUT_CLR - Output n Clear */ -/*! @{ */ - -#define SCT_OUT_CLR_CLR_MASK (0xFFFFU) -#define SCT_OUT_CLR_CLR_SHIFT (0U) -/*! CLR - Clear Output */ -#define SCT_OUT_CLR_CLR(x) (((uint32_t)(((uint32_t)(x)) << SCT_OUT_CLR_CLR_SHIFT)) & SCT_OUT_CLR_CLR_MASK) -/*! @} */ - -/* The count of SCT_OUT_CLR */ -#define SCT_OUT_CLR_COUNT (10U) - - -/*! - * @} - */ /* end of group SCT_Register_Masks */ - - -/* SCT - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral SCT0 base address */ - #define SCT0_BASE (0x50091000u) - /** Peripheral SCT0 base address */ - #define SCT0_BASE_NS (0x40091000u) - /** Peripheral SCT0 base pointer */ - #define SCT0 ((SCT_Type *)SCT0_BASE) - /** Peripheral SCT0 base pointer */ - #define SCT0_NS ((SCT_Type *)SCT0_BASE_NS) - /** Array initializer of SCT peripheral base addresses */ - #define SCT_BASE_ADDRS { SCT0_BASE } - /** Array initializer of SCT peripheral base pointers */ - #define SCT_BASE_PTRS { SCT0 } - /** Array initializer of SCT peripheral base addresses */ - #define SCT_BASE_ADDRS_NS { SCT0_BASE_NS } - /** Array initializer of SCT peripheral base pointers */ - #define SCT_BASE_PTRS_NS { SCT0_NS } -#else - /** Peripheral SCT0 base address */ - #define SCT0_BASE (0x40091000u) - /** Peripheral SCT0 base pointer */ - #define SCT0 ((SCT_Type *)SCT0_BASE) - /** Array initializer of SCT peripheral base addresses */ - #define SCT_BASE_ADDRS { SCT0_BASE } - /** Array initializer of SCT peripheral base pointers */ - #define SCT_BASE_PTRS { SCT0 } -#endif -/** Interrupt vectors for the SCT peripheral type */ -#define SCT_IRQS { SCT0_IRQn } - -/*! - * @} - */ /* end of group SCT_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- SEMA42 Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SEMA42_Peripheral_Access_Layer SEMA42 Peripheral Access Layer - * @{ - */ - -/** SEMA42 - Register Layout Typedef */ -typedef struct { - __IO uint8_t GATE3; /**< Gate, offset: 0x0 */ - __IO uint8_t GATE2; /**< Gate, offset: 0x1 */ - __IO uint8_t GATE1; /**< Gate, offset: 0x2 */ - __IO uint8_t GATE0; /**< Gate, offset: 0x3 */ - __IO uint8_t GATE7; /**< Gate, offset: 0x4 */ - __IO uint8_t GATE6; /**< Gate, offset: 0x5 */ - __IO uint8_t GATE5; /**< Gate, offset: 0x6 */ - __IO uint8_t GATE4; /**< Gate, offset: 0x7 */ - __IO uint8_t GATE11; /**< Gate, offset: 0x8 */ - __IO uint8_t GATE10; /**< Gate, offset: 0x9 */ - __IO uint8_t GATE9; /**< Gate, offset: 0xA */ - __IO uint8_t GATE8; /**< Gate, offset: 0xB */ - __IO uint8_t GATE15; /**< Gate, offset: 0xC */ - __IO uint8_t GATE14; /**< Gate, offset: 0xD */ - __IO uint8_t GATE13; /**< Gate, offset: 0xE */ - __IO uint8_t GATE12; /**< Gate, offset: 0xF */ - uint8_t RESERVED_0[50]; - union { /* offset: 0x42 */ - __I uint16_t RSTGT_R; /**< Reset Gate Read, offset: 0x42 */ - __O uint16_t RSTGT_W; /**< Reset Gate Write, offset: 0x42 */ - }; -} SEMA42_Type; - -/* ---------------------------------------------------------------------------- - -- SEMA42 Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SEMA42_Register_Masks SEMA42 Register Masks - * @{ - */ - -/*! @name GATE3 - Gate */ -/*! @{ */ - -#define SEMA42_GATE3_GTFSM_MASK (0xFU) -#define SEMA42_GATE3_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE3_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE3_GTFSM_SHIFT)) & SEMA42_GATE3_GTFSM_MASK) -/*! @} */ - -/*! @name GATE2 - Gate */ -/*! @{ */ - -#define SEMA42_GATE2_GTFSM_MASK (0xFU) -#define SEMA42_GATE2_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE2_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE2_GTFSM_SHIFT)) & SEMA42_GATE2_GTFSM_MASK) -/*! @} */ - -/*! @name GATE1 - Gate */ -/*! @{ */ - -#define SEMA42_GATE1_GTFSM_MASK (0xFU) -#define SEMA42_GATE1_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE1_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE1_GTFSM_SHIFT)) & SEMA42_GATE1_GTFSM_MASK) -/*! @} */ - -/*! @name GATE0 - Gate */ -/*! @{ */ - -#define SEMA42_GATE0_GTFSM_MASK (0xFU) -#define SEMA42_GATE0_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE0_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE0_GTFSM_SHIFT)) & SEMA42_GATE0_GTFSM_MASK) -/*! @} */ - -/*! @name GATE7 - Gate */ -/*! @{ */ - -#define SEMA42_GATE7_GTFSM_MASK (0xFU) -#define SEMA42_GATE7_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE7_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE7_GTFSM_SHIFT)) & SEMA42_GATE7_GTFSM_MASK) -/*! @} */ - -/*! @name GATE6 - Gate */ -/*! @{ */ - -#define SEMA42_GATE6_GTFSM_MASK (0xFU) -#define SEMA42_GATE6_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE6_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE6_GTFSM_SHIFT)) & SEMA42_GATE6_GTFSM_MASK) -/*! @} */ - -/*! @name GATE5 - Gate */ -/*! @{ */ - -#define SEMA42_GATE5_GTFSM_MASK (0xFU) -#define SEMA42_GATE5_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE5_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE5_GTFSM_SHIFT)) & SEMA42_GATE5_GTFSM_MASK) -/*! @} */ - -/*! @name GATE4 - Gate */ -/*! @{ */ - -#define SEMA42_GATE4_GTFSM_MASK (0xFU) -#define SEMA42_GATE4_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE4_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE4_GTFSM_SHIFT)) & SEMA42_GATE4_GTFSM_MASK) -/*! @} */ - -/*! @name GATE11 - Gate */ -/*! @{ */ - -#define SEMA42_GATE11_GTFSM_MASK (0xFU) -#define SEMA42_GATE11_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE11_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE11_GTFSM_SHIFT)) & SEMA42_GATE11_GTFSM_MASK) -/*! @} */ - -/*! @name GATE10 - Gate */ -/*! @{ */ - -#define SEMA42_GATE10_GTFSM_MASK (0xFU) -#define SEMA42_GATE10_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE10_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE10_GTFSM_SHIFT)) & SEMA42_GATE10_GTFSM_MASK) -/*! @} */ - -/*! @name GATE9 - Gate */ -/*! @{ */ - -#define SEMA42_GATE9_GTFSM_MASK (0xFU) -#define SEMA42_GATE9_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE9_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE9_GTFSM_SHIFT)) & SEMA42_GATE9_GTFSM_MASK) -/*! @} */ - -/*! @name GATE8 - Gate */ -/*! @{ */ - -#define SEMA42_GATE8_GTFSM_MASK (0xFU) -#define SEMA42_GATE8_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE8_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE8_GTFSM_SHIFT)) & SEMA42_GATE8_GTFSM_MASK) -/*! @} */ - -/*! @name GATE15 - Gate */ -/*! @{ */ - -#define SEMA42_GATE15_GTFSM_MASK (0xFU) -#define SEMA42_GATE15_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE15_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE15_GTFSM_SHIFT)) & SEMA42_GATE15_GTFSM_MASK) -/*! @} */ - -/*! @name GATE14 - Gate */ -/*! @{ */ - -#define SEMA42_GATE14_GTFSM_MASK (0xFU) -#define SEMA42_GATE14_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE14_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE14_GTFSM_SHIFT)) & SEMA42_GATE14_GTFSM_MASK) -/*! @} */ - -/*! @name GATE13 - Gate */ -/*! @{ */ - -#define SEMA42_GATE13_GTFSM_MASK (0xFU) -#define SEMA42_GATE13_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE13_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE13_GTFSM_SHIFT)) & SEMA42_GATE13_GTFSM_MASK) -/*! @} */ - -/*! @name GATE12 - Gate */ -/*! @{ */ - -#define SEMA42_GATE12_GTFSM_MASK (0xFU) -#define SEMA42_GATE12_GTFSM_SHIFT (0U) -/*! GTFSM - Gate Finite State Machine - * 0b0000..The gate is unlocked (free). - * 0b0001..Domain 0 locked the gate. - * 0b0010..Domain 1 locked the gate. - * 0b0011..Domain 2 locked the gate. - * 0b0100..Domain 3 locked the gate. - * 0b0101..Domain 4 locked the gate. - * 0b0110..Domain 5 locked the gate. - * 0b0111..Domain 6 locked the gate. - * 0b1000..Domain 7 locked the gate. - * 0b1001..Domain 8 locked the gate. - * 0b1010..Domain 9 locked the gate. - * 0b1011..Domain 10 locked the gate. - * 0b1100..Domain 11 locked the gate. - * 0b1101..Domain 12 locked the gate. - * 0b1110..Domain 13 locked the gate. - * 0b1111..Domain 14 locked the gate. - */ -#define SEMA42_GATE12_GTFSM(x) (((uint8_t)(((uint8_t)(x)) << SEMA42_GATE12_GTFSM_SHIFT)) & SEMA42_GATE12_GTFSM_MASK) -/*! @} */ - -/*! @name RSTGT_R - Reset Gate Read */ -/*! @{ */ - -#define SEMA42_RSTGT_R_RSTGTN_MASK (0xFFU) -#define SEMA42_RSTGT_R_RSTGTN_SHIFT (0U) -/*! RSTGTN - Reset Gate Number */ -#define SEMA42_RSTGT_R_RSTGTN(x) (((uint16_t)(((uint16_t)(x)) << SEMA42_RSTGT_R_RSTGTN_SHIFT)) & SEMA42_RSTGT_R_RSTGTN_MASK) - -#define SEMA42_RSTGT_R_RSTGMS_MASK (0xF00U) -#define SEMA42_RSTGT_R_RSTGMS_SHIFT (8U) -/*! RSTGMS - Reset Gate Domain */ -#define SEMA42_RSTGT_R_RSTGMS(x) (((uint16_t)(((uint16_t)(x)) << SEMA42_RSTGT_R_RSTGMS_SHIFT)) & SEMA42_RSTGT_R_RSTGMS_MASK) - -#define SEMA42_RSTGT_R_RSTGSM_MASK (0x3000U) -#define SEMA42_RSTGT_R_RSTGSM_SHIFT (12U) -/*! RSTGSM - Reset Gate Finite State Machine - * 0b00..Idle, waiting for the first data pattern write. - * 0b01..Waiting for the second data pattern write - * 0b10..The 2-write sequence has completed. Generate the specified gate reset(s). After the reset is performed, - * this machine returns to the idle (waiting for first data pattern write) state. - * 0b11..This state encoding is never used and therefore reserved. - */ -#define SEMA42_RSTGT_R_RSTGSM(x) (((uint16_t)(((uint16_t)(x)) << SEMA42_RSTGT_R_RSTGSM_SHIFT)) & SEMA42_RSTGT_R_RSTGSM_MASK) -/*! @} */ - -/*! @name RSTGT_W - Reset Gate Write */ -/*! @{ */ - -#define SEMA42_RSTGT_W_RSTGTN_MASK (0xFFU) -#define SEMA42_RSTGT_W_RSTGTN_SHIFT (0U) -/*! RSTGTN - Reset Gate Number */ -#define SEMA42_RSTGT_W_RSTGTN(x) (((uint16_t)(((uint16_t)(x)) << SEMA42_RSTGT_W_RSTGTN_SHIFT)) & SEMA42_RSTGT_W_RSTGTN_MASK) - -#define SEMA42_RSTGT_W_RSTGDP_MASK (0xFF00U) -#define SEMA42_RSTGT_W_RSTGDP_SHIFT (8U) -/*! RSTGDP - Reset Gate Data Pattern */ -#define SEMA42_RSTGT_W_RSTGDP(x) (((uint16_t)(((uint16_t)(x)) << SEMA42_RSTGT_W_RSTGDP_SHIFT)) & SEMA42_RSTGT_W_RSTGDP_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group SEMA42_Register_Masks */ - - -/* SEMA42 - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral SEMA42_0 base address */ - #define SEMA42_0_BASE (0x500B1000u) - /** Peripheral SEMA42_0 base address */ - #define SEMA42_0_BASE_NS (0x400B1000u) - /** Peripheral SEMA42_0 base pointer */ - #define SEMA42_0 ((SEMA42_Type *)SEMA42_0_BASE) - /** Peripheral SEMA42_0 base pointer */ - #define SEMA42_0_NS ((SEMA42_Type *)SEMA42_0_BASE_NS) - /** Array initializer of SEMA42 peripheral base addresses */ - #define SEMA42_BASE_ADDRS { SEMA42_0_BASE } - /** Array initializer of SEMA42 peripheral base pointers */ - #define SEMA42_BASE_PTRS { SEMA42_0 } - /** Array initializer of SEMA42 peripheral base addresses */ - #define SEMA42_BASE_ADDRS_NS { SEMA42_0_BASE_NS } - /** Array initializer of SEMA42 peripheral base pointers */ - #define SEMA42_BASE_PTRS_NS { SEMA42_0_NS } -#else - /** Peripheral SEMA42_0 base address */ - #define SEMA42_0_BASE (0x400B1000u) - /** Peripheral SEMA42_0 base pointer */ - #define SEMA42_0 ((SEMA42_Type *)SEMA42_0_BASE) - /** Array initializer of SEMA42 peripheral base addresses */ - #define SEMA42_BASE_ADDRS { SEMA42_0_BASE } - /** Array initializer of SEMA42 peripheral base pointers */ - #define SEMA42_BASE_PTRS { SEMA42_0 } -#endif - -/*! - * @} - */ /* end of group SEMA42_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- SINC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SINC_Peripheral_Access_Layer SINC Peripheral Access Layer - * @{ - */ - -/** SINC - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAMETER; /**< Parameters, offset: 0x4 */ - __IO uint32_t MCR; /**< Main Control, offset: 0x8 */ - __IO uint32_t NIE; /**< Normal Interrupt Enable, offset: 0xC */ - __IO uint32_t EIE; /**< Error Interrupt Enable, offset: 0x10 */ - __IO uint32_t FIFOIE; /**< FIFO And CAD Error Interrupt Enable, offset: 0x14 */ - __IO uint32_t NIS; /**< Normal Interrupt Status, offset: 0x18 */ - __IO uint32_t EIS; /**< Error Interrupt Status, offset: 0x1C */ - __IO uint32_t FIFOIS; /**< FIFO And CAD Error Interrupt Status, offset: 0x20 */ - __I uint32_t SR; /**< Status, offset: 0x24 */ - uint8_t RESERVED_0[16]; - struct { /* offset: 0x38, array step: 0x30 */ - __IO uint32_t CCR; /**< Channel 0 Control..Channel 4 Control, array offset: 0x38, array step: 0x30 */ - __IO uint32_t CDR; /**< Channel 0 Data Rate..Channel 4 Data Rate, array offset: 0x3C, array step: 0x30 */ - __IO uint32_t CCFR; /**< Channel 0 Configuration..Channel 4 Configuration, array offset: 0x40, array step: 0x30 */ - __IO uint32_t CPROT; /**< Channel 0 Protection..Channel 4 Protection, array offset: 0x44, array step: 0x30 */ - __IO uint32_t CBIAS; /**< Channel 0 Bias..Channel 4 Bias, array offset: 0x48, array step: 0x30 */ - __IO uint32_t CLOLMT; /**< Channel 0 Low Limit..Channel 4 Low Limit, array offset: 0x4C, array step: 0x30 */ - __IO uint32_t CHILMT; /**< Channel 0 High Limit..Channel 4 High Limit, array offset: 0x50, array step: 0x30 */ - __I uint32_t CRDATA; /**< Channel 0 Result Data..Channel 4 Result Data, array offset: 0x54, array step: 0x30 */ - __IO uint32_t CMPDATA; /**< Channel 0 Multipurpose Data..Channel 4 Multipurpose Data, array offset: 0x58, array step: 0x30 */ - __IO uint32_t CACFR; /**< Channel 0 Advanced Configuration..Channel 4 Advanced Configuration, array offset: 0x5C, array step: 0x30 */ - __IO uint32_t CSR; /**< Channel 0 Status..Channel 4 Status, array offset: 0x60, array step: 0x30 */ - __I uint32_t CDBGR; /**< Channel 0 Debug..Channel 4 Debug, array offset: 0x64, array step: 0x30 */ - } CHANNEL[5]; -} SINC_Type; - -/* ---------------------------------------------------------------------------- - -- SINC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SINC_Register_Masks SINC Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define SINC_VERID_FEATURE_MASK (0xFFFFU) -#define SINC_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Code */ -#define SINC_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << SINC_VERID_FEATURE_SHIFT)) & SINC_VERID_FEATURE_MASK) - -#define SINC_VERID_MINOR_MASK (0xFF0000U) -#define SINC_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number - * 0b00000000..x.0 - * *.. - */ -#define SINC_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << SINC_VERID_MINOR_SHIFT)) & SINC_VERID_MINOR_MASK) - -#define SINC_VERID_MAJOR_MASK (0xFF000000U) -#define SINC_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number - * 0b00000001..1.x - * 0b00000010..2.x - * *.. - */ -#define SINC_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << SINC_VERID_MAJOR_SHIFT)) & SINC_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAMETER - Parameters */ -/*! @{ */ - -#define SINC_PARAMETER_FIFO_DEPTH_MASK (0x1FU) -#define SINC_PARAMETER_FIFO_DEPTH_SHIFT (0U) -/*! FIFO_DEPTH - FIFO Depth */ -#define SINC_PARAMETER_FIFO_DEPTH(x) (((uint32_t)(((uint32_t)(x)) << SINC_PARAMETER_FIFO_DEPTH_SHIFT)) & SINC_PARAMETER_FIFO_DEPTH_MASK) - -#define SINC_PARAMETER_FLT_NUM_MASK (0xF00U) -#define SINC_PARAMETER_FLT_NUM_SHIFT (8U) -/*! FLT_NUM - Filter Channel Number */ -#define SINC_PARAMETER_FLT_NUM(x) (((uint32_t)(((uint32_t)(x)) << SINC_PARAMETER_FLT_NUM_SHIFT)) & SINC_PARAMETER_FLT_NUM_MASK) - -#define SINC_PARAMETER_PF_ORD_SEL_MASK (0x180000U) -#define SINC_PARAMETER_PF_ORD_SEL_SHIFT (19U) -/*! PF_ORD_SEL - PF Order Select - * 0b10..3 - * 0b11..2 - * *.. - */ -#define SINC_PARAMETER_PF_ORD_SEL(x) (((uint32_t)(((uint32_t)(x)) << SINC_PARAMETER_PF_ORD_SEL_SHIFT)) & SINC_PARAMETER_PF_ORD_SEL_MASK) -/*! @} */ - -/*! @name MCR - Main Control */ -/*! @{ */ - -#define SINC_MCR_STRIG0_MASK (0x1U) -#define SINC_MCR_STRIG0_SHIFT (0U) -/*! STRIG0 - Software Trigger For Channel 0 - * 0b0..No effect - * 0b1..Trigger - */ -#define SINC_MCR_STRIG0(x) (((uint32_t)(((uint32_t)(x)) << SINC_MCR_STRIG0_SHIFT)) & SINC_MCR_STRIG0_MASK) - -#define SINC_MCR_STRIG1_MASK (0x2U) -#define SINC_MCR_STRIG1_SHIFT (1U) -/*! STRIG1 - Software Trigger For Channel 1 - * 0b0..No effect - * 0b1..Trigger - */ -#define SINC_MCR_STRIG1(x) (((uint32_t)(((uint32_t)(x)) << SINC_MCR_STRIG1_SHIFT)) & SINC_MCR_STRIG1_MASK) - -#define SINC_MCR_STRIG2_MASK (0x4U) -#define SINC_MCR_STRIG2_SHIFT (2U) -/*! STRIG2 - Software Trigger For Channel 2 - * 0b0..No effect - * 0b1..Trigger - */ -#define SINC_MCR_STRIG2(x) (((uint32_t)(((uint32_t)(x)) << SINC_MCR_STRIG2_SHIFT)) & SINC_MCR_STRIG2_MASK) - -#define SINC_MCR_STRIG3_MASK (0x8U) -#define SINC_MCR_STRIG3_SHIFT (3U) -/*! STRIG3 - Software Trigger For Channel 3 - * 0b0..No effect - * 0b1..Trigger - */ -#define SINC_MCR_STRIG3(x) (((uint32_t)(((uint32_t)(x)) << SINC_MCR_STRIG3_SHIFT)) & SINC_MCR_STRIG3_MASK) - -#define SINC_MCR_STRIG4_MASK (0x10U) -#define SINC_MCR_STRIG4_SHIFT (4U) -/*! STRIG4 - Software Trigger For Channel 4 - * 0b0..No effect - * 0b1..Trigger - */ -#define SINC_MCR_STRIG4(x) (((uint32_t)(((uint32_t)(x)) << SINC_MCR_STRIG4_SHIFT)) & SINC_MCR_STRIG4_MASK) - -#define SINC_MCR_DOZEN_MASK (0x400U) -#define SINC_MCR_DOZEN_SHIFT (10U) -/*! DOZEN - Doze Or Stop Enable - * 0b0..Enables - * 0b1..Disables - */ -#define SINC_MCR_DOZEN(x) (((uint32_t)(((uint32_t)(x)) << SINC_MCR_DOZEN_SHIFT)) & SINC_MCR_DOZEN_MASK) - -#define SINC_MCR_RST_MASK (0x2000U) -#define SINC_MCR_RST_SHIFT (13U) -/*! RST - Software Reset - * 0b0..Do not reset - * 0b1..Reset - */ -#define SINC_MCR_RST(x) (((uint32_t)(((uint32_t)(x)) << SINC_MCR_RST_SHIFT)) & SINC_MCR_RST_MASK) - -#define SINC_MCR_MEN_MASK (0x8000U) -#define SINC_MCR_MEN_SHIFT (15U) -/*! MEN - Master Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_MCR_MEN(x) (((uint32_t)(((uint32_t)(x)) << SINC_MCR_MEN_SHIFT)) & SINC_MCR_MEN_MASK) - -#define SINC_MCR_MCLKDIV_MASK (0xFF0000U) -#define SINC_MCR_MCLKDIV_SHIFT (16U) -/*! MCLKDIV - Modulator Clock Divider - * 0b00000000..Prohibited - * *..Added to 1 to specify the clock divider - */ -#define SINC_MCR_MCLKDIV(x) (((uint32_t)(((uint32_t)(x)) << SINC_MCR_MCLKDIV_SHIFT)) & SINC_MCR_MCLKDIV_MASK) - -#define SINC_MCR_PRESCALE_MASK (0x6000000U) -#define SINC_MCR_PRESCALE_SHIFT (25U) -/*! PRESCALE - Prescale Before Clock Divider - * 0b00..No prescale - * 0b01..2 - * 0b10..4 - * 0b11..8 - */ -#define SINC_MCR_PRESCALE(x) (((uint32_t)(((uint32_t)(x)) << SINC_MCR_PRESCALE_SHIFT)) & SINC_MCR_PRESCALE_MASK) - -#define SINC_MCR_MCLK0DIS_MASK (0x8000000U) -#define SINC_MCR_MCLK0DIS_SHIFT (27U) -/*! MCLK0DIS - Disable Modulator Clock 0 Output - * 0b0..Enabled when MEN = 1 - * 0b1..Disabled regardless of MEN value - */ -#define SINC_MCR_MCLK0DIS(x) (((uint32_t)(((uint32_t)(x)) << SINC_MCR_MCLK0DIS_SHIFT)) & SINC_MCR_MCLK0DIS_MASK) - -#define SINC_MCR_MCLK1DIS_MASK (0x10000000U) -#define SINC_MCR_MCLK1DIS_SHIFT (28U) -/*! MCLK1DIS - Disable Modulator Clock 1 Output - * 0b0..Enabled when MEN = 1 - * 0b1..Disabled regardless of MEN value - */ -#define SINC_MCR_MCLK1DIS(x) (((uint32_t)(((uint32_t)(x)) << SINC_MCR_MCLK1DIS_SHIFT)) & SINC_MCR_MCLK1DIS_MASK) - -#define SINC_MCR_MCLK2DIS_MASK (0x20000000U) -#define SINC_MCR_MCLK2DIS_SHIFT (29U) -/*! MCLK2DIS - Disable Modulator Clock 2 Output - * 0b0..Enabled when MEN = 1 - * 0b1..Disabled regardless of MEN value - */ -#define SINC_MCR_MCLK2DIS(x) (((uint32_t)(((uint32_t)(x)) << SINC_MCR_MCLK2DIS_SHIFT)) & SINC_MCR_MCLK2DIS_MASK) -/*! @} */ - -/*! @name NIE - Normal Interrupt Enable */ -/*! @{ */ - -#define SINC_NIE_COCIE0_MASK (0x1U) -#define SINC_NIE_COCIE0_SHIFT (0U) -/*! COCIE0 - Conversion Complete Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_NIE_COCIE0(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIE_COCIE0_SHIFT)) & SINC_NIE_COCIE0_MASK) - -#define SINC_NIE_COCIE1_MASK (0x2U) -#define SINC_NIE_COCIE1_SHIFT (1U) -/*! COCIE1 - Conversion Complete Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_NIE_COCIE1(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIE_COCIE1_SHIFT)) & SINC_NIE_COCIE1_MASK) - -#define SINC_NIE_COCIE2_MASK (0x4U) -#define SINC_NIE_COCIE2_SHIFT (2U) -/*! COCIE2 - Conversion Complete Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_NIE_COCIE2(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIE_COCIE2_SHIFT)) & SINC_NIE_COCIE2_MASK) - -#define SINC_NIE_COCIE3_MASK (0x8U) -#define SINC_NIE_COCIE3_SHIFT (3U) -/*! COCIE3 - Conversion Complete Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_NIE_COCIE3(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIE_COCIE3_SHIFT)) & SINC_NIE_COCIE3_MASK) - -#define SINC_NIE_COCIE4_MASK (0x10U) -#define SINC_NIE_COCIE4_SHIFT (4U) -/*! COCIE4 - Conversion Complete Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_NIE_COCIE4(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIE_COCIE4_SHIFT)) & SINC_NIE_COCIE4_MASK) - -#define SINC_NIE_CHFIE0_MASK (0x100U) -#define SINC_NIE_CHFIE0_SHIFT (8U) -/*! CHFIE0 - Data Output Ready Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_NIE_CHFIE0(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIE_CHFIE0_SHIFT)) & SINC_NIE_CHFIE0_MASK) - -#define SINC_NIE_CHFIE1_MASK (0x200U) -#define SINC_NIE_CHFIE1_SHIFT (9U) -/*! CHFIE1 - Data Output Ready Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_NIE_CHFIE1(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIE_CHFIE1_SHIFT)) & SINC_NIE_CHFIE1_MASK) - -#define SINC_NIE_CHFIE2_MASK (0x400U) -#define SINC_NIE_CHFIE2_SHIFT (10U) -/*! CHFIE2 - Data Output Ready Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_NIE_CHFIE2(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIE_CHFIE2_SHIFT)) & SINC_NIE_CHFIE2_MASK) - -#define SINC_NIE_CHFIE3_MASK (0x800U) -#define SINC_NIE_CHFIE3_SHIFT (11U) -/*! CHFIE3 - Data Output Ready Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_NIE_CHFIE3(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIE_CHFIE3_SHIFT)) & SINC_NIE_CHFIE3_MASK) - -#define SINC_NIE_CHFIE4_MASK (0x1000U) -#define SINC_NIE_CHFIE4_SHIFT (12U) -/*! CHFIE4 - Data Output Ready Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_NIE_CHFIE4(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIE_CHFIE4_SHIFT)) & SINC_NIE_CHFIE4_MASK) - -#define SINC_NIE_ZCDIE0_MASK (0x10000U) -#define SINC_NIE_ZCDIE0_SHIFT (16U) -/*! ZCDIE0 - Zero Cross Detected Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_NIE_ZCDIE0(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIE_ZCDIE0_SHIFT)) & SINC_NIE_ZCDIE0_MASK) - -#define SINC_NIE_ZCDIE1_MASK (0x20000U) -#define SINC_NIE_ZCDIE1_SHIFT (17U) -/*! ZCDIE1 - Zero Cross Detected Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_NIE_ZCDIE1(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIE_ZCDIE1_SHIFT)) & SINC_NIE_ZCDIE1_MASK) - -#define SINC_NIE_ZCDIE2_MASK (0x40000U) -#define SINC_NIE_ZCDIE2_SHIFT (18U) -/*! ZCDIE2 - Zero Cross Detected Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_NIE_ZCDIE2(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIE_ZCDIE2_SHIFT)) & SINC_NIE_ZCDIE2_MASK) - -#define SINC_NIE_ZCDIE3_MASK (0x80000U) -#define SINC_NIE_ZCDIE3_SHIFT (19U) -/*! ZCDIE3 - Zero Cross Detected Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_NIE_ZCDIE3(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIE_ZCDIE3_SHIFT)) & SINC_NIE_ZCDIE3_MASK) - -#define SINC_NIE_ZCDIE4_MASK (0x100000U) -#define SINC_NIE_ZCDIE4_SHIFT (20U) -/*! ZCDIE4 - Zero Cross Detected Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_NIE_ZCDIE4(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIE_ZCDIE4_SHIFT)) & SINC_NIE_ZCDIE4_MASK) -/*! @} */ - -/*! @name EIE - Error Interrupt Enable */ -/*! @{ */ - -#define SINC_EIE_SCDIE0_MASK (0x1U) -#define SINC_EIE_SCDIE0_SHIFT (0U) -/*! SCDIE0 - Short Circuit Detected Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_SCDIE0(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_SCDIE0_SHIFT)) & SINC_EIE_SCDIE0_MASK) - -#define SINC_EIE_SCDIE1_MASK (0x2U) -#define SINC_EIE_SCDIE1_SHIFT (1U) -/*! SCDIE1 - Short Circuit Detected Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_SCDIE1(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_SCDIE1_SHIFT)) & SINC_EIE_SCDIE1_MASK) - -#define SINC_EIE_SCDIE2_MASK (0x4U) -#define SINC_EIE_SCDIE2_SHIFT (2U) -/*! SCDIE2 - Short Circuit Detected Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_SCDIE2(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_SCDIE2_SHIFT)) & SINC_EIE_SCDIE2_MASK) - -#define SINC_EIE_SCDIE3_MASK (0x8U) -#define SINC_EIE_SCDIE3_SHIFT (3U) -/*! SCDIE3 - Short Circuit Detected Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_SCDIE3(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_SCDIE3_SHIFT)) & SINC_EIE_SCDIE3_MASK) - -#define SINC_EIE_SCDIE4_MASK (0x10U) -#define SINC_EIE_SCDIE4_SHIFT (4U) -/*! SCDIE4 - Short Circuit Detected Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_SCDIE4(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_SCDIE4_SHIFT)) & SINC_EIE_SCDIE4_MASK) - -#define SINC_EIE_WLMTIE0_MASK (0x100U) -#define SINC_EIE_WLMTIE0_SHIFT (8U) -/*! WLMTIE0 - Window Limit Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_WLMTIE0(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_WLMTIE0_SHIFT)) & SINC_EIE_WLMTIE0_MASK) - -#define SINC_EIE_WLMTIE1_MASK (0x200U) -#define SINC_EIE_WLMTIE1_SHIFT (9U) -/*! WLMTIE1 - Window Limit Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_WLMTIE1(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_WLMTIE1_SHIFT)) & SINC_EIE_WLMTIE1_MASK) - -#define SINC_EIE_WLMTIE2_MASK (0x400U) -#define SINC_EIE_WLMTIE2_SHIFT (10U) -/*! WLMTIE2 - Window Limit Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_WLMTIE2(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_WLMTIE2_SHIFT)) & SINC_EIE_WLMTIE2_MASK) - -#define SINC_EIE_WLMTIE3_MASK (0x800U) -#define SINC_EIE_WLMTIE3_SHIFT (11U) -/*! WLMTIE3 - Window Limit Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_WLMTIE3(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_WLMTIE3_SHIFT)) & SINC_EIE_WLMTIE3_MASK) - -#define SINC_EIE_WLMTIE4_MASK (0x1000U) -#define SINC_EIE_WLMTIE4_SHIFT (12U) -/*! WLMTIE4 - Window Limit Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_WLMTIE4(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_WLMTIE4_SHIFT)) & SINC_EIE_WLMTIE4_MASK) - -#define SINC_EIE_LLMTIE0_MASK (0x10000U) -#define SINC_EIE_LLMTIE0_SHIFT (16U) -/*! LLMTIE0 - Low Limit Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_LLMTIE0(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_LLMTIE0_SHIFT)) & SINC_EIE_LLMTIE0_MASK) - -#define SINC_EIE_LLMTIE1_MASK (0x20000U) -#define SINC_EIE_LLMTIE1_SHIFT (17U) -/*! LLMTIE1 - Low Limit Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_LLMTIE1(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_LLMTIE1_SHIFT)) & SINC_EIE_LLMTIE1_MASK) - -#define SINC_EIE_LLMTIE2_MASK (0x40000U) -#define SINC_EIE_LLMTIE2_SHIFT (18U) -/*! LLMTIE2 - Low Limit Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_LLMTIE2(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_LLMTIE2_SHIFT)) & SINC_EIE_LLMTIE2_MASK) - -#define SINC_EIE_LLMTIE3_MASK (0x80000U) -#define SINC_EIE_LLMTIE3_SHIFT (19U) -/*! LLMTIE3 - Low Limit Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_LLMTIE3(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_LLMTIE3_SHIFT)) & SINC_EIE_LLMTIE3_MASK) - -#define SINC_EIE_LLMTIE4_MASK (0x100000U) -#define SINC_EIE_LLMTIE4_SHIFT (20U) -/*! LLMTIE4 - Low Limit Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_LLMTIE4(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_LLMTIE4_SHIFT)) & SINC_EIE_LLMTIE4_MASK) - -#define SINC_EIE_HLMTIE0_MASK (0x1000000U) -#define SINC_EIE_HLMTIE0_SHIFT (24U) -/*! HLMTIE0 - High Limit Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_HLMTIE0(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_HLMTIE0_SHIFT)) & SINC_EIE_HLMTIE0_MASK) - -#define SINC_EIE_HLMTIE1_MASK (0x2000000U) -#define SINC_EIE_HLMTIE1_SHIFT (25U) -/*! HLMTIE1 - High Limit Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_HLMTIE1(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_HLMTIE1_SHIFT)) & SINC_EIE_HLMTIE1_MASK) - -#define SINC_EIE_HLMTIE2_MASK (0x4000000U) -#define SINC_EIE_HLMTIE2_SHIFT (26U) -/*! HLMTIE2 - High Limit Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_HLMTIE2(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_HLMTIE2_SHIFT)) & SINC_EIE_HLMTIE2_MASK) - -#define SINC_EIE_HLMTIE3_MASK (0x8000000U) -#define SINC_EIE_HLMTIE3_SHIFT (27U) -/*! HLMTIE3 - High Limit Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_HLMTIE3(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_HLMTIE3_SHIFT)) & SINC_EIE_HLMTIE3_MASK) - -#define SINC_EIE_HLMTIE4_MASK (0x10000000U) -#define SINC_EIE_HLMTIE4_SHIFT (28U) -/*! HLMTIE4 - High Limit Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_EIE_HLMTIE4(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIE_HLMTIE4_SHIFT)) & SINC_EIE_HLMTIE4_MASK) -/*! @} */ - -/*! @name FIFOIE - FIFO And CAD Error Interrupt Enable */ -/*! @{ */ - -#define SINC_FIFOIE_FUNFIE0_MASK (0x1U) -#define SINC_FIFOIE_FUNFIE0_SHIFT (0U) -/*! FUNFIE0 - FIFO Underflow Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_FUNFIE0(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_FUNFIE0_SHIFT)) & SINC_FIFOIE_FUNFIE0_MASK) - -#define SINC_FIFOIE_FUNFIE1_MASK (0x2U) -#define SINC_FIFOIE_FUNFIE1_SHIFT (1U) -/*! FUNFIE1 - FIFO Underflow Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_FUNFIE1(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_FUNFIE1_SHIFT)) & SINC_FIFOIE_FUNFIE1_MASK) - -#define SINC_FIFOIE_FUNFIE2_MASK (0x4U) -#define SINC_FIFOIE_FUNFIE2_SHIFT (2U) -/*! FUNFIE2 - FIFO Underflow Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_FUNFIE2(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_FUNFIE2_SHIFT)) & SINC_FIFOIE_FUNFIE2_MASK) - -#define SINC_FIFOIE_FUNFIE3_MASK (0x8U) -#define SINC_FIFOIE_FUNFIE3_SHIFT (3U) -/*! FUNFIE3 - FIFO Underflow Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_FUNFIE3(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_FUNFIE3_SHIFT)) & SINC_FIFOIE_FUNFIE3_MASK) - -#define SINC_FIFOIE_FUNFIE4_MASK (0x10U) -#define SINC_FIFOIE_FUNFIE4_SHIFT (4U) -/*! FUNFIE4 - FIFO Underflow Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_FUNFIE4(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_FUNFIE4_SHIFT)) & SINC_FIFOIE_FUNFIE4_MASK) - -#define SINC_FIFOIE_FOVFIE0_MASK (0x100U) -#define SINC_FIFOIE_FOVFIE0_SHIFT (8U) -/*! FOVFIE0 - FIFO Overflow Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_FOVFIE0(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_FOVFIE0_SHIFT)) & SINC_FIFOIE_FOVFIE0_MASK) - -#define SINC_FIFOIE_FOVFIE1_MASK (0x200U) -#define SINC_FIFOIE_FOVFIE1_SHIFT (9U) -/*! FOVFIE1 - FIFO Overflow Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_FOVFIE1(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_FOVFIE1_SHIFT)) & SINC_FIFOIE_FOVFIE1_MASK) - -#define SINC_FIFOIE_FOVFIE2_MASK (0x400U) -#define SINC_FIFOIE_FOVFIE2_SHIFT (10U) -/*! FOVFIE2 - FIFO Overflow Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_FOVFIE2(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_FOVFIE2_SHIFT)) & SINC_FIFOIE_FOVFIE2_MASK) - -#define SINC_FIFOIE_FOVFIE3_MASK (0x800U) -#define SINC_FIFOIE_FOVFIE3_SHIFT (11U) -/*! FOVFIE3 - FIFO Overflow Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_FOVFIE3(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_FOVFIE3_SHIFT)) & SINC_FIFOIE_FOVFIE3_MASK) - -#define SINC_FIFOIE_FOVFIE4_MASK (0x1000U) -#define SINC_FIFOIE_FOVFIE4_SHIFT (12U) -/*! FOVFIE4 - FIFO Overflow Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_FOVFIE4(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_FOVFIE4_SHIFT)) & SINC_FIFOIE_FOVFIE4_MASK) - -#define SINC_FIFOIE_CADIE0_MASK (0x10000U) -#define SINC_FIFOIE_CADIE0_SHIFT (16U) -/*! CADIE0 - Clock Absence Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_CADIE0(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_CADIE0_SHIFT)) & SINC_FIFOIE_CADIE0_MASK) - -#define SINC_FIFOIE_CADIE1_MASK (0x20000U) -#define SINC_FIFOIE_CADIE1_SHIFT (17U) -/*! CADIE1 - Clock Absence Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_CADIE1(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_CADIE1_SHIFT)) & SINC_FIFOIE_CADIE1_MASK) - -#define SINC_FIFOIE_CADIE2_MASK (0x40000U) -#define SINC_FIFOIE_CADIE2_SHIFT (18U) -/*! CADIE2 - Clock Absence Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_CADIE2(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_CADIE2_SHIFT)) & SINC_FIFOIE_CADIE2_MASK) - -#define SINC_FIFOIE_CADIE3_MASK (0x80000U) -#define SINC_FIFOIE_CADIE3_SHIFT (19U) -/*! CADIE3 - Clock Absence Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_CADIE3(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_CADIE3_SHIFT)) & SINC_FIFOIE_CADIE3_MASK) - -#define SINC_FIFOIE_CADIE4_MASK (0x100000U) -#define SINC_FIFOIE_CADIE4_SHIFT (20U) -/*! CADIE4 - Clock Absence Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_CADIE4(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_CADIE4_SHIFT)) & SINC_FIFOIE_CADIE4_MASK) - -#define SINC_FIFOIE_SATIE0_MASK (0x1000000U) -#define SINC_FIFOIE_SATIE0_SHIFT (24U) -/*! SATIE0 - Saturation Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_SATIE0(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_SATIE0_SHIFT)) & SINC_FIFOIE_SATIE0_MASK) - -#define SINC_FIFOIE_SATIE1_MASK (0x2000000U) -#define SINC_FIFOIE_SATIE1_SHIFT (25U) -/*! SATIE1 - Saturation Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_SATIE1(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_SATIE1_SHIFT)) & SINC_FIFOIE_SATIE1_MASK) - -#define SINC_FIFOIE_SATIE2_MASK (0x4000000U) -#define SINC_FIFOIE_SATIE2_SHIFT (26U) -/*! SATIE2 - Saturation Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_SATIE2(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_SATIE2_SHIFT)) & SINC_FIFOIE_SATIE2_MASK) - -#define SINC_FIFOIE_SATIE3_MASK (0x8000000U) -#define SINC_FIFOIE_SATIE3_SHIFT (27U) -/*! SATIE3 - Saturation Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_SATIE3(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_SATIE3_SHIFT)) & SINC_FIFOIE_SATIE3_MASK) - -#define SINC_FIFOIE_SATIE4_MASK (0x10000000U) -#define SINC_FIFOIE_SATIE4_SHIFT (28U) -/*! SATIE4 - Saturation Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_FIFOIE_SATIE4(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIE_SATIE4_SHIFT)) & SINC_FIFOIE_SATIE4_MASK) -/*! @} */ - -/*! @name NIS - Normal Interrupt Status */ -/*! @{ */ - -#define SINC_NIS_COC0_MASK (0x1U) -#define SINC_NIS_COC0_SHIFT (0U) -/*! COC0 - Conversion Complete Flag - * 0b0..Not finished; data not available - * 0b1..Finished; data available - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_NIS_COC0(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIS_COC0_SHIFT)) & SINC_NIS_COC0_MASK) - -#define SINC_NIS_COC1_MASK (0x2U) -#define SINC_NIS_COC1_SHIFT (1U) -/*! COC1 - Conversion Complete Flag - * 0b0..Not finished; data not available - * 0b1..Finished; data available - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_NIS_COC1(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIS_COC1_SHIFT)) & SINC_NIS_COC1_MASK) - -#define SINC_NIS_COC2_MASK (0x4U) -#define SINC_NIS_COC2_SHIFT (2U) -/*! COC2 - Conversion Complete Flag - * 0b0..Not finished; data not available - * 0b1..Finished; data available - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_NIS_COC2(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIS_COC2_SHIFT)) & SINC_NIS_COC2_MASK) - -#define SINC_NIS_COC3_MASK (0x8U) -#define SINC_NIS_COC3_SHIFT (3U) -/*! COC3 - Conversion Complete Flag - * 0b0..Not finished; data not available - * 0b1..Finished; data available - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_NIS_COC3(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIS_COC3_SHIFT)) & SINC_NIS_COC3_MASK) - -#define SINC_NIS_COC4_MASK (0x10U) -#define SINC_NIS_COC4_SHIFT (4U) -/*! COC4 - Conversion Complete Flag - * 0b0..Not finished; data not available - * 0b1..Finished; data available - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_NIS_COC4(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIS_COC4_SHIFT)) & SINC_NIS_COC4_MASK) - -#define SINC_NIS_CHF0_MASK (0x100U) -#define SINC_NIS_CHF0_SHIFT (8U) -/*! CHF0 - Data Output Ready Flag - * 0b0..No overflow; data not available - * 0b1..Overflow; data available - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_NIS_CHF0(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIS_CHF0_SHIFT)) & SINC_NIS_CHF0_MASK) - -#define SINC_NIS_CHF1_MASK (0x200U) -#define SINC_NIS_CHF1_SHIFT (9U) -/*! CHF1 - Data Output Ready Flag - * 0b0..No overflow; data not available - * 0b1..Overflow; data available - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_NIS_CHF1(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIS_CHF1_SHIFT)) & SINC_NIS_CHF1_MASK) - -#define SINC_NIS_CHF2_MASK (0x400U) -#define SINC_NIS_CHF2_SHIFT (10U) -/*! CHF2 - Data Output Ready Flag - * 0b0..No overflow; data not available - * 0b1..Overflow; data available - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_NIS_CHF2(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIS_CHF2_SHIFT)) & SINC_NIS_CHF2_MASK) - -#define SINC_NIS_CHF3_MASK (0x800U) -#define SINC_NIS_CHF3_SHIFT (11U) -/*! CHF3 - Data Output Ready Flag - * 0b0..No overflow; data not available - * 0b1..Overflow; data available - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_NIS_CHF3(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIS_CHF3_SHIFT)) & SINC_NIS_CHF3_MASK) - -#define SINC_NIS_CHF4_MASK (0x1000U) -#define SINC_NIS_CHF4_SHIFT (12U) -/*! CHF4 - Data Output Ready Flag - * 0b0..No overflow; data not available - * 0b1..Overflow; data available - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_NIS_CHF4(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIS_CHF4_SHIFT)) & SINC_NIS_CHF4_MASK) - -#define SINC_NIS_ZCD0_MASK (0x10000U) -#define SINC_NIS_ZCD0_SHIFT (16U) -/*! ZCD0 - Zero Cross Detected Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_NIS_ZCD0(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIS_ZCD0_SHIFT)) & SINC_NIS_ZCD0_MASK) - -#define SINC_NIS_ZCD1_MASK (0x20000U) -#define SINC_NIS_ZCD1_SHIFT (17U) -/*! ZCD1 - Zero Cross Detected Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_NIS_ZCD1(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIS_ZCD1_SHIFT)) & SINC_NIS_ZCD1_MASK) - -#define SINC_NIS_ZCD2_MASK (0x40000U) -#define SINC_NIS_ZCD2_SHIFT (18U) -/*! ZCD2 - Zero Cross Detected Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_NIS_ZCD2(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIS_ZCD2_SHIFT)) & SINC_NIS_ZCD2_MASK) - -#define SINC_NIS_ZCD3_MASK (0x80000U) -#define SINC_NIS_ZCD3_SHIFT (19U) -/*! ZCD3 - Zero Cross Detected Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_NIS_ZCD3(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIS_ZCD3_SHIFT)) & SINC_NIS_ZCD3_MASK) - -#define SINC_NIS_ZCD4_MASK (0x100000U) -#define SINC_NIS_ZCD4_SHIFT (20U) -/*! ZCD4 - Zero Cross Detected Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_NIS_ZCD4(x) (((uint32_t)(((uint32_t)(x)) << SINC_NIS_ZCD4_SHIFT)) & SINC_NIS_ZCD4_MASK) -/*! @} */ - -/*! @name EIS - Error Interrupt Status */ -/*! @{ */ - -#define SINC_EIS_SCD0_MASK (0x1U) -#define SINC_EIS_SCD0_SHIFT (0U) -/*! SCD0 - Short Circuit Detected Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_SCD0(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_SCD0_SHIFT)) & SINC_EIS_SCD0_MASK) - -#define SINC_EIS_SCD1_MASK (0x2U) -#define SINC_EIS_SCD1_SHIFT (1U) -/*! SCD1 - Short Circuit Detected Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_SCD1(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_SCD1_SHIFT)) & SINC_EIS_SCD1_MASK) - -#define SINC_EIS_SCD2_MASK (0x4U) -#define SINC_EIS_SCD2_SHIFT (2U) -/*! SCD2 - Short Circuit Detected Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_SCD2(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_SCD2_SHIFT)) & SINC_EIS_SCD2_MASK) - -#define SINC_EIS_SCD3_MASK (0x8U) -#define SINC_EIS_SCD3_SHIFT (3U) -/*! SCD3 - Short Circuit Detected Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_SCD3(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_SCD3_SHIFT)) & SINC_EIS_SCD3_MASK) - -#define SINC_EIS_SCD4_MASK (0x10U) -#define SINC_EIS_SCD4_SHIFT (4U) -/*! SCD4 - Short Circuit Detected Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_SCD4(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_SCD4_SHIFT)) & SINC_EIS_SCD4_MASK) - -#define SINC_EIS_WLMT0_MASK (0x100U) -#define SINC_EIS_WLMT0_SHIFT (8U) -/*! WLMT0 - Window Limit Flag - * 0b0..Not exceeded - * 0b1..Exceeded - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_WLMT0(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_WLMT0_SHIFT)) & SINC_EIS_WLMT0_MASK) - -#define SINC_EIS_WLMT1_MASK (0x200U) -#define SINC_EIS_WLMT1_SHIFT (9U) -/*! WLMT1 - Window Limit Flag - * 0b0..Not exceeded - * 0b1..Exceeded - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_WLMT1(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_WLMT1_SHIFT)) & SINC_EIS_WLMT1_MASK) - -#define SINC_EIS_WLMT2_MASK (0x400U) -#define SINC_EIS_WLMT2_SHIFT (10U) -/*! WLMT2 - Window Limit Flag - * 0b0..Not exceeded - * 0b1..Exceeded - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_WLMT2(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_WLMT2_SHIFT)) & SINC_EIS_WLMT2_MASK) - -#define SINC_EIS_WLMT3_MASK (0x800U) -#define SINC_EIS_WLMT3_SHIFT (11U) -/*! WLMT3 - Window Limit Flag - * 0b0..Not exceeded - * 0b1..Exceeded - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_WLMT3(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_WLMT3_SHIFT)) & SINC_EIS_WLMT3_MASK) - -#define SINC_EIS_WLMT4_MASK (0x1000U) -#define SINC_EIS_WLMT4_SHIFT (12U) -/*! WLMT4 - Window Limit Flag - * 0b0..Not exceeded - * 0b1..Exceeded - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_WLMT4(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_WLMT4_SHIFT)) & SINC_EIS_WLMT4_MASK) - -#define SINC_EIS_LLMT0_MASK (0x10000U) -#define SINC_EIS_LLMT0_SHIFT (16U) -/*! LLMT0 - Low Limit Flag - * 0b0..Not exceeded - * 0b1..Exceeded - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_LLMT0(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_LLMT0_SHIFT)) & SINC_EIS_LLMT0_MASK) - -#define SINC_EIS_LLMT1_MASK (0x20000U) -#define SINC_EIS_LLMT1_SHIFT (17U) -/*! LLMT1 - Low Limit Flag - * 0b0..Not exceeded - * 0b1..Exceeded - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_LLMT1(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_LLMT1_SHIFT)) & SINC_EIS_LLMT1_MASK) - -#define SINC_EIS_LLMT2_MASK (0x40000U) -#define SINC_EIS_LLMT2_SHIFT (18U) -/*! LLMT2 - Low Limit Flag - * 0b0..Not exceeded - * 0b1..Exceeded - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_LLMT2(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_LLMT2_SHIFT)) & SINC_EIS_LLMT2_MASK) - -#define SINC_EIS_LLMT3_MASK (0x80000U) -#define SINC_EIS_LLMT3_SHIFT (19U) -/*! LLMT3 - Low Limit Flag - * 0b0..Not exceeded - * 0b1..Exceeded - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_LLMT3(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_LLMT3_SHIFT)) & SINC_EIS_LLMT3_MASK) - -#define SINC_EIS_LLMT4_MASK (0x100000U) -#define SINC_EIS_LLMT4_SHIFT (20U) -/*! LLMT4 - Low Limit Flag - * 0b0..Not exceeded - * 0b1..Exceeded - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_LLMT4(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_LLMT4_SHIFT)) & SINC_EIS_LLMT4_MASK) - -#define SINC_EIS_HLMT0_MASK (0x1000000U) -#define SINC_EIS_HLMT0_SHIFT (24U) -/*! HLMT0 - High Limit Flag - * 0b0..Not exceeded - * 0b1..Exceeded - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_HLMT0(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_HLMT0_SHIFT)) & SINC_EIS_HLMT0_MASK) - -#define SINC_EIS_HLMT1_MASK (0x2000000U) -#define SINC_EIS_HLMT1_SHIFT (25U) -/*! HLMT1 - High Limit Flag - * 0b0..Not exceeded - * 0b1..Exceeded - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_HLMT1(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_HLMT1_SHIFT)) & SINC_EIS_HLMT1_MASK) - -#define SINC_EIS_HLMT2_MASK (0x4000000U) -#define SINC_EIS_HLMT2_SHIFT (26U) -/*! HLMT2 - High Limit Flag - * 0b0..Not exceeded - * 0b1..Exceeded - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_HLMT2(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_HLMT2_SHIFT)) & SINC_EIS_HLMT2_MASK) - -#define SINC_EIS_HLMT3_MASK (0x8000000U) -#define SINC_EIS_HLMT3_SHIFT (27U) -/*! HLMT3 - High Limit Flag - * 0b0..Not exceeded - * 0b1..Exceeded - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_HLMT3(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_HLMT3_SHIFT)) & SINC_EIS_HLMT3_MASK) - -#define SINC_EIS_HLMT4_MASK (0x10000000U) -#define SINC_EIS_HLMT4_SHIFT (28U) -/*! HLMT4 - High Limit Flag - * 0b0..Not exceeded - * 0b1..Exceeded - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_EIS_HLMT4(x) (((uint32_t)(((uint32_t)(x)) << SINC_EIS_HLMT4_SHIFT)) & SINC_EIS_HLMT4_MASK) -/*! @} */ - -/*! @name FIFOIS - FIFO And CAD Error Interrupt Status */ -/*! @{ */ - -#define SINC_FIFOIS_FUNF0_MASK (0x1U) -#define SINC_FIFOIS_FUNF0_SHIFT (0U) -/*! FUNF0 - FIFO Underflow Flag - * 0b0..Did not occur - * 0b1..Occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_FUNF0(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_FUNF0_SHIFT)) & SINC_FIFOIS_FUNF0_MASK) - -#define SINC_FIFOIS_FUNF1_MASK (0x2U) -#define SINC_FIFOIS_FUNF1_SHIFT (1U) -/*! FUNF1 - FIFO Underflow Flag - * 0b0..Did not occur - * 0b1..Occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_FUNF1(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_FUNF1_SHIFT)) & SINC_FIFOIS_FUNF1_MASK) - -#define SINC_FIFOIS_FUNF2_MASK (0x4U) -#define SINC_FIFOIS_FUNF2_SHIFT (2U) -/*! FUNF2 - FIFO Underflow Flag - * 0b0..Did not occur - * 0b1..Occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_FUNF2(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_FUNF2_SHIFT)) & SINC_FIFOIS_FUNF2_MASK) - -#define SINC_FIFOIS_FUNF3_MASK (0x8U) -#define SINC_FIFOIS_FUNF3_SHIFT (3U) -/*! FUNF3 - FIFO Underflow Flag - * 0b0..Did not occur - * 0b1..Occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_FUNF3(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_FUNF3_SHIFT)) & SINC_FIFOIS_FUNF3_MASK) - -#define SINC_FIFOIS_FUNF4_MASK (0x10U) -#define SINC_FIFOIS_FUNF4_SHIFT (4U) -/*! FUNF4 - FIFO Underflow Flag - * 0b0..Did not occur - * 0b1..Occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_FUNF4(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_FUNF4_SHIFT)) & SINC_FIFOIS_FUNF4_MASK) - -#define SINC_FIFOIS_FOVF0_MASK (0x100U) -#define SINC_FIFOIS_FOVF0_SHIFT (8U) -/*! FOVF0 - FIFO Overflow Flag - * 0b0..Did not occur - * 0b1..Occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_FOVF0(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_FOVF0_SHIFT)) & SINC_FIFOIS_FOVF0_MASK) - -#define SINC_FIFOIS_FOVF1_MASK (0x200U) -#define SINC_FIFOIS_FOVF1_SHIFT (9U) -/*! FOVF1 - FIFO Overflow Flag - * 0b0..Did not occur - * 0b1..Occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_FOVF1(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_FOVF1_SHIFT)) & SINC_FIFOIS_FOVF1_MASK) - -#define SINC_FIFOIS_FOVF2_MASK (0x400U) -#define SINC_FIFOIS_FOVF2_SHIFT (10U) -/*! FOVF2 - FIFO Overflow Flag - * 0b0..Did not occur - * 0b1..Occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_FOVF2(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_FOVF2_SHIFT)) & SINC_FIFOIS_FOVF2_MASK) - -#define SINC_FIFOIS_FOVF3_MASK (0x800U) -#define SINC_FIFOIS_FOVF3_SHIFT (11U) -/*! FOVF3 - FIFO Overflow Flag - * 0b0..Did not occur - * 0b1..Occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_FOVF3(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_FOVF3_SHIFT)) & SINC_FIFOIS_FOVF3_MASK) - -#define SINC_FIFOIS_FOVF4_MASK (0x1000U) -#define SINC_FIFOIS_FOVF4_SHIFT (12U) -/*! FOVF4 - FIFO Overflow Flag - * 0b0..Did not occur - * 0b1..Occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_FOVF4(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_FOVF4_SHIFT)) & SINC_FIFOIS_FOVF4_MASK) - -#define SINC_FIFOIS_CAD0_MASK (0x10000U) -#define SINC_FIFOIS_CAD0_SHIFT (16U) -/*! CAD0 - Clock Absence Flag - * 0b0..Clock present - * 0b1..Clock absent - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_CAD0(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_CAD0_SHIFT)) & SINC_FIFOIS_CAD0_MASK) - -#define SINC_FIFOIS_CAD1_MASK (0x20000U) -#define SINC_FIFOIS_CAD1_SHIFT (17U) -/*! CAD1 - Clock Absence Flag - * 0b0..Clock present - * 0b1..Clock absent - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_CAD1(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_CAD1_SHIFT)) & SINC_FIFOIS_CAD1_MASK) - -#define SINC_FIFOIS_CAD2_MASK (0x40000U) -#define SINC_FIFOIS_CAD2_SHIFT (18U) -/*! CAD2 - Clock Absence Flag - * 0b0..Clock present - * 0b1..Clock absent - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_CAD2(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_CAD2_SHIFT)) & SINC_FIFOIS_CAD2_MASK) - -#define SINC_FIFOIS_CAD3_MASK (0x80000U) -#define SINC_FIFOIS_CAD3_SHIFT (19U) -/*! CAD3 - Clock Absence Flag - * 0b0..Clock present - * 0b1..Clock absent - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_CAD3(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_CAD3_SHIFT)) & SINC_FIFOIS_CAD3_MASK) - -#define SINC_FIFOIS_CAD4_MASK (0x100000U) -#define SINC_FIFOIS_CAD4_SHIFT (20U) -/*! CAD4 - Clock Absence Flag - * 0b0..Clock present - * 0b1..Clock absent - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_CAD4(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_CAD4_SHIFT)) & SINC_FIFOIS_CAD4_MASK) - -#define SINC_FIFOIS_SAT0_MASK (0x1000000U) -#define SINC_FIFOIS_SAT0_SHIFT (24U) -/*! SAT0 - Saturation Flag - * 0b0..Not saturated - * 0b1..Saturated - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_SAT0(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_SAT0_SHIFT)) & SINC_FIFOIS_SAT0_MASK) - -#define SINC_FIFOIS_SAT1_MASK (0x2000000U) -#define SINC_FIFOIS_SAT1_SHIFT (25U) -/*! SAT1 - Saturation Flag - * 0b0..Not saturated - * 0b1..Saturated - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_SAT1(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_SAT1_SHIFT)) & SINC_FIFOIS_SAT1_MASK) - -#define SINC_FIFOIS_SAT2_MASK (0x4000000U) -#define SINC_FIFOIS_SAT2_SHIFT (26U) -/*! SAT2 - Saturation Flag - * 0b0..Not saturated - * 0b1..Saturated - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_SAT2(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_SAT2_SHIFT)) & SINC_FIFOIS_SAT2_MASK) - -#define SINC_FIFOIS_SAT3_MASK (0x8000000U) -#define SINC_FIFOIS_SAT3_SHIFT (27U) -/*! SAT3 - Saturation Flag - * 0b0..Not saturated - * 0b1..Saturated - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_SAT3(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_SAT3_SHIFT)) & SINC_FIFOIS_SAT3_MASK) - -#define SINC_FIFOIS_SAT4_MASK (0x10000000U) -#define SINC_FIFOIS_SAT4_SHIFT (28U) -/*! SAT4 - Saturation Flag - * 0b0..Not saturated - * 0b1..Saturated - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SINC_FIFOIS_SAT4(x) (((uint32_t)(((uint32_t)(x)) << SINC_FIFOIS_SAT4_SHIFT)) & SINC_FIFOIS_SAT4_MASK) -/*! @} */ - -/*! @name SR - Status */ -/*! @{ */ - -#define SINC_SR_CIP0_MASK (0x1U) -#define SINC_SR_CIP0_SHIFT (0U) -/*! CIP0 - Conversion In Progress - * 0b0..Not in progress - * 0b1..In progress - */ -#define SINC_SR_CIP0(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_CIP0_SHIFT)) & SINC_SR_CIP0_MASK) - -#define SINC_SR_CIP1_MASK (0x2U) -#define SINC_SR_CIP1_SHIFT (1U) -/*! CIP1 - Conversion In Progress - * 0b0..Not in progress - * 0b1..In progress - */ -#define SINC_SR_CIP1(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_CIP1_SHIFT)) & SINC_SR_CIP1_MASK) - -#define SINC_SR_CIP2_MASK (0x4U) -#define SINC_SR_CIP2_SHIFT (2U) -/*! CIP2 - Conversion In Progress - * 0b0..Not in progress - * 0b1..In progress - */ -#define SINC_SR_CIP2(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_CIP2_SHIFT)) & SINC_SR_CIP2_MASK) - -#define SINC_SR_CIP3_MASK (0x8U) -#define SINC_SR_CIP3_SHIFT (3U) -/*! CIP3 - Conversion In Progress - * 0b0..Not in progress - * 0b1..In progress - */ -#define SINC_SR_CIP3(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_CIP3_SHIFT)) & SINC_SR_CIP3_MASK) - -#define SINC_SR_CIP4_MASK (0x10U) -#define SINC_SR_CIP4_SHIFT (4U) -/*! CIP4 - Conversion In Progress - * 0b0..Not in progress - * 0b1..In progress - */ -#define SINC_SR_CIP4(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_CIP4_SHIFT)) & SINC_SR_CIP4_MASK) - -#define SINC_SR_CHRDY0_MASK (0x100U) -#define SINC_SR_CHRDY0_SHIFT (8U) -/*! CHRDY0 - Channel Ready For Conversion - * 0b0..Not ready - * 0b1..Ready - */ -#define SINC_SR_CHRDY0(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_CHRDY0_SHIFT)) & SINC_SR_CHRDY0_MASK) - -#define SINC_SR_CHRDY1_MASK (0x200U) -#define SINC_SR_CHRDY1_SHIFT (9U) -/*! CHRDY1 - Channel Ready For Conversion - * 0b0..Not ready - * 0b1..Ready - */ -#define SINC_SR_CHRDY1(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_CHRDY1_SHIFT)) & SINC_SR_CHRDY1_MASK) - -#define SINC_SR_CHRDY2_MASK (0x400U) -#define SINC_SR_CHRDY2_SHIFT (10U) -/*! CHRDY2 - Channel Ready For Conversion - * 0b0..Not ready - * 0b1..Ready - */ -#define SINC_SR_CHRDY2(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_CHRDY2_SHIFT)) & SINC_SR_CHRDY2_MASK) - -#define SINC_SR_CHRDY3_MASK (0x800U) -#define SINC_SR_CHRDY3_SHIFT (11U) -/*! CHRDY3 - Channel Ready For Conversion - * 0b0..Not ready - * 0b1..Ready - */ -#define SINC_SR_CHRDY3(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_CHRDY3_SHIFT)) & SINC_SR_CHRDY3_MASK) - -#define SINC_SR_CHRDY4_MASK (0x1000U) -#define SINC_SR_CHRDY4_SHIFT (12U) -/*! CHRDY4 - Channel Ready For Conversion - * 0b0..Not ready - * 0b1..Ready - */ -#define SINC_SR_CHRDY4(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_CHRDY4_SHIFT)) & SINC_SR_CHRDY4_MASK) - -#define SINC_SR_FIFOEMPTY0_MASK (0x10000U) -#define SINC_SR_FIFOEMPTY0_SHIFT (16U) -/*! FIFOEMPTY0 - FIFO Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define SINC_SR_FIFOEMPTY0(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_FIFOEMPTY0_SHIFT)) & SINC_SR_FIFOEMPTY0_MASK) - -#define SINC_SR_FIFOEMPTY1_MASK (0x20000U) -#define SINC_SR_FIFOEMPTY1_SHIFT (17U) -/*! FIFOEMPTY1 - FIFO Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define SINC_SR_FIFOEMPTY1(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_FIFOEMPTY1_SHIFT)) & SINC_SR_FIFOEMPTY1_MASK) - -#define SINC_SR_FIFOEMPTY2_MASK (0x40000U) -#define SINC_SR_FIFOEMPTY2_SHIFT (18U) -/*! FIFOEMPTY2 - FIFO Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define SINC_SR_FIFOEMPTY2(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_FIFOEMPTY2_SHIFT)) & SINC_SR_FIFOEMPTY2_MASK) - -#define SINC_SR_FIFOEMPTY3_MASK (0x80000U) -#define SINC_SR_FIFOEMPTY3_SHIFT (19U) -/*! FIFOEMPTY3 - FIFO Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define SINC_SR_FIFOEMPTY3(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_FIFOEMPTY3_SHIFT)) & SINC_SR_FIFOEMPTY3_MASK) - -#define SINC_SR_FIFOEMPTY4_MASK (0x100000U) -#define SINC_SR_FIFOEMPTY4_SHIFT (20U) -/*! FIFOEMPTY4 - FIFO Empty - * 0b0..Not empty - * 0b1..Empty - */ -#define SINC_SR_FIFOEMPTY4(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_FIFOEMPTY4_SHIFT)) & SINC_SR_FIFOEMPTY4_MASK) - -#define SINC_SR_MCLKRDY0_MASK (0x1000000U) -#define SINC_SR_MCLKRDY0_SHIFT (24U) -/*! MCLKRDY0 - Modulator Clock 0 Ready - * 0b0..Not ready - * 0b1..Ready - */ -#define SINC_SR_MCLKRDY0(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_MCLKRDY0_SHIFT)) & SINC_SR_MCLKRDY0_MASK) - -#define SINC_SR_MCLKRDY1_MASK (0x2000000U) -#define SINC_SR_MCLKRDY1_SHIFT (25U) -/*! MCLKRDY1 - Modulator Clock 1 Ready - * 0b0..Not ready - * 0b1..Ready - */ -#define SINC_SR_MCLKRDY1(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_MCLKRDY1_SHIFT)) & SINC_SR_MCLKRDY1_MASK) - -#define SINC_SR_MCLKRDY2_MASK (0x4000000U) -#define SINC_SR_MCLKRDY2_SHIFT (26U) -/*! MCLKRDY2 - Modulator Clock 2 Ready - * 0b0..Not ready - * 0b1..Ready - */ -#define SINC_SR_MCLKRDY2(x) (((uint32_t)(((uint32_t)(x)) << SINC_SR_MCLKRDY2_SHIFT)) & SINC_SR_MCLKRDY2_MASK) -/*! @} */ - -/*! @name CCR - Channel 0 Control..Channel 4 Control */ -/*! @{ */ - -#define SINC_CCR_CHEN_MASK (0x1U) -#define SINC_CCR_CHEN_SHIFT (0U) -/*! CHEN - Channel Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_CCR_CHEN(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCR_CHEN_SHIFT)) & SINC_CCR_CHEN_MASK) - -#define SINC_CCR_PFEN_MASK (0x2U) -#define SINC_CCR_PFEN_SHIFT (1U) -/*! PFEN - PF Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_CCR_PFEN(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCR_PFEN_SHIFT)) & SINC_CCR_PFEN_MASK) - -#define SINC_CCR_DMAEN_MASK (0x8U) -#define SINC_CCR_DMAEN_SHIFT (3U) -/*! DMAEN - DMA Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_CCR_DMAEN(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCR_DMAEN_SHIFT)) & SINC_CCR_DMAEN_MASK) - -#define SINC_CCR_SCDEN_MASK (0x100U) -#define SINC_CCR_SCDEN_SHIFT (8U) -/*! SCDEN - Short Circuit Detect Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_CCR_SCDEN(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCR_SCDEN_SHIFT)) & SINC_CCR_SCDEN_MASK) - -#define SINC_CCR_CADEN_MASK (0x200U) -#define SINC_CCR_CADEN_SHIFT (9U) -/*! CADEN - Clock Absence Detect Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_CCR_CADEN(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCR_CADEN_SHIFT)) & SINC_CCR_CADEN_MASK) - -#define SINC_CCR_ZCDEN_MASK (0x1000U) -#define SINC_CCR_ZCDEN_SHIFT (12U) -/*! ZCDEN - Zero Cross Detect Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_CCR_ZCDEN(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCR_ZCDEN_SHIFT)) & SINC_CCR_ZCDEN_MASK) - -#define SINC_CCR_LMTEN_MASK (0x2000U) -#define SINC_CCR_LMTEN_SHIFT (13U) -/*! LMTEN - Limit Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_CCR_LMTEN(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCR_LMTEN_SHIFT)) & SINC_CCR_LMTEN_MASK) - -#define SINC_CCR_FIFOEN_MASK (0x4000U) -#define SINC_CCR_FIFOEN_SHIFT (14U) -/*! FIFOEN - FIFO Enable - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_CCR_FIFOEN(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCR_FIFOEN_SHIFT)) & SINC_CCR_FIFOEN_MASK) - -#define SINC_CCR_DBGSEL_MASK (0xF00000U) -#define SINC_CCR_DBGSEL_SHIFT (20U) -/*! DBGSEL - Debug Output Selection - * 0b0000..Final data from the PF (24 bits) - * 0b0001..Offset data (24 bits) - * 0b0010..Shifted data from the PF (24 bits) - * 0b0011..DC remover (HPF) data (32 bits) - * 0b0100..Raw data from the PF's CIC filter - * 0b0110..Historical data from SCD - * 0b0111..Data from the Manchester decoder - * 0b1000..Data from CAD - * 0b1001..Number of available entries in the FIFO - * 0b1010..Status of the parallel or serial data converter - * *.. - */ -#define SINC_CCR_DBGSEL(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCR_DBGSEL_SHIFT)) & SINC_CCR_DBGSEL_MASK) -/*! @} */ - -/* The count of SINC_CCR */ -#define SINC_CCR_COUNT (5U) - -/*! @name CDR - Channel 0 Data Rate..Channel 4 Data Rate */ -/*! @{ */ - -#define SINC_CDR_PFOSR_MASK (0x7FFU) -#define SINC_CDR_PFOSR_SHIFT (0U) -/*! PFOSR - PF OSR */ -#define SINC_CDR_PFOSR(x) (((uint32_t)(((uint32_t)(x)) << SINC_CDR_PFOSR_SHIFT)) & SINC_CDR_PFOSR_MASK) - -#define SINC_CDR_PFORD_MASK (0x1800U) -#define SINC_CDR_PFORD_SHIFT (11U) -/*! PFORD - PF Order - * 0b00..FastSinc - * 0b01..First order - * 0b10..Second order - * 0b11..Third order - */ -#define SINC_CDR_PFORD(x) (((uint32_t)(((uint32_t)(x)) << SINC_CDR_PFORD_SHIFT)) & SINC_CDR_PFORD_MASK) - -#define SINC_CDR_PFCM_MASK (0xC000U) -#define SINC_CDR_PFCM_SHIFT (14U) -/*! PFCM - PF Conversion Mode - * 0b00..Single - * 0b01..Continuous - * 0b10..Always - * 0b11..Fixed number - */ -#define SINC_CDR_PFCM(x) (((uint32_t)(((uint32_t)(x)) << SINC_CDR_PFCM_SHIFT)) & SINC_CDR_PFCM_MASK) -/*! @} */ - -/* The count of SINC_CDR */ -#define SINC_CDR_COUNT (5U) - -/*! @name CCFR - Channel 0 Configuration..Channel 4 Configuration */ -/*! @{ */ - -#define SINC_CCFR_PFSFT_MASK (0x1FU) -#define SINC_CCFR_PFSFT_SHIFT (0U) -/*! PFSFT - PF Shift */ -#define SINC_CCFR_PFSFT(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCFR_PFSFT_SHIFT)) & SINC_CCFR_PFSFT_MASK) - -#define SINC_CCFR_RDFMT_MASK (0x40U) -#define SINC_CCFR_RDFMT_SHIFT (6U) -/*! RDFMT - Result Data Format - * 0b0..Left justified, signed - * 0b1..Left justified, unsigned - */ -#define SINC_CCFR_RDFMT(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCFR_RDFMT_SHIFT)) & SINC_CCFR_RDFMT_MASK) - -#define SINC_CCFR_FIFOWMK_MASK (0x1C00U) -#define SINC_CCFR_FIFOWMK_SHIFT (10U) -/*! FIFOWMK - FIFO Watermark */ -#define SINC_CCFR_FIFOWMK(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCFR_FIFOWMK_SHIFT)) & SINC_CCFR_FIFOWMK_MASK) - -#define SINC_CCFR_IBFMT_MASK (0x30000U) -#define SINC_CCFR_IBFMT_SHIFT (16U) -/*! IBFMT - Input Bit Format - * 0b00..External bitstream from the MBIT[n] signal - * 0b01..External Manchester code; ICESEL selects the rise or fall decoder - * 0b10..Internal 16-bit parallel data from MPDATA - * 0b11..Internal 32-bit serial data from MPDATA - */ -#define SINC_CCFR_IBFMT(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCFR_IBFMT_SHIFT)) & SINC_CCFR_IBFMT_MASK) - -#define SINC_CCFR_ICSEL_MASK (0x1C0000U) -#define SINC_CCFR_ICSEL_SHIFT (18U) -/*! ICSEL - Input Clock Select - * 0b000..MCLK_OUT0 with internal routeback - * 0b001..MCLK_OUT1 with internal routeback - * 0b010..MCLK_OUT2 with internal routeback - * 0b011..External modulator clock dedicated to this channel - * 0b111..Grouped clock shared with an adjacent channel; the adjacent channel's ICSEL field determines the input clock - * *.. - */ -#define SINC_CCFR_ICSEL(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCFR_ICSEL_SHIFT)) & SINC_CCFR_ICSEL_MASK) - -#define SINC_CCFR_ICESEL_MASK (0xE00000U) -#define SINC_CCFR_ICESEL_SHIFT (21U) -/*! ICESEL - Input Clock Edge Select - * 0b001..Positive edge - * 0b010..Negative edge - * 0b011..Both edges - * 0b100..Every other odd positive edge - * 0b101..Every other even positive edge - * 0b110..Every other odd negative edge - * 0b111..Every other even negative edge - * *.. - */ -#define SINC_CCFR_ICESEL(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCFR_ICESEL_SHIFT)) & SINC_CCFR_ICESEL_MASK) - -#define SINC_CCFR_ITSEL_MASK (0x3000000U) -#define SINC_CCFR_ITSEL_SHIFT (24U) -/*! ITSEL - Input Trigger Select - * 0b00..Software - * 0b01..Hardware trigger dedicated to the channel - * 0b11..Grouped trigger shared with an adjacent channel; the adjacent channel's ITSEL field determines the trigger - * *.. - */ -#define SINC_CCFR_ITSEL(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCFR_ITSEL_SHIFT)) & SINC_CCFR_ITSEL_MASK) - -#define SINC_CCFR_IBSEL_MASK (0xC000000U) -#define SINC_CCFR_IBSEL_SHIFT (26U) -/*! IBSEL - Input Bit Select - * 0b00..External bitstream from the MBIT[n] signal - * 0b01..Alternate internal bitstream from the INP[n] signal - * 0b11..Grouped bitstream shared with an adjacent channel; the adjacent channel's IBSEL field determines the input - * *.. - */ -#define SINC_CCFR_IBSEL(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCFR_IBSEL_SHIFT)) & SINC_CCFR_IBSEL_MASK) - -#define SINC_CCFR_ITLVL_MASK (0x10000000U) -#define SINC_CCFR_ITLVL_SHIFT (28U) -/*! ITLVL - Input Trigger Level Type - * 0b0..Edge - * 0b1..Level - */ -#define SINC_CCFR_ITLVL(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCFR_ITLVL_SHIFT)) & SINC_CCFR_ITLVL_MASK) - -#define SINC_CCFR_ZCOP_MASK (0xC0000000U) -#define SINC_CCFR_ZCOP_SHIFT (30U) -/*! ZCOP - Zero Cross Option - * 0b00..Both rise and fall - * 0b10..Rise - * 0b01..Fall - * *.. - */ -#define SINC_CCFR_ZCOP(x) (((uint32_t)(((uint32_t)(x)) << SINC_CCFR_ZCOP_SHIFT)) & SINC_CCFR_ZCOP_MASK) -/*! @} */ - -/* The count of SINC_CCFR */ -#define SINC_CCFR_COUNT (5U) - -/*! @name CPROT - Channel 0 Protection..Channel 4 Protection */ -/*! @{ */ - -#define SINC_CPROT_SCDLMT_MASK (0xFFU) -#define SINC_CPROT_SCDLMT_SHIFT (0U) -/*! SCDLMT - SCD Limit Threshold - * 0b00000000-0b00000001..Disables SCD - * *..Threshold value - */ -#define SINC_CPROT_SCDLMT(x) (((uint32_t)(((uint32_t)(x)) << SINC_CPROT_SCDLMT_SHIFT)) & SINC_CPROT_SCDLMT_MASK) - -#define SINC_CPROT_SCDCM_MASK (0x800U) -#define SINC_CPROT_SCDCM_SHIFT (11U) -/*! SCDCM - SCD Conversion Mode - * 0b0..Constantly when CnCR[CHEN] = MCR[MEN] = 1 - * 0b1..Only when the PF is performing a conversion - */ -#define SINC_CPROT_SCDCM(x) (((uint32_t)(((uint32_t)(x)) << SINC_CPROT_SCDCM_SHIFT)) & SINC_CPROT_SCDCM_MASK) - -#define SINC_CPROT_SCDOP_MASK (0x3000U) -#define SINC_CPROT_SCDOP_SHIFT (12U) -/*! SCDOP - SCD Option - * 0b00..Both 0 and 1 - * 0b01..Only 1 - * 0b10..Only 0 - * 0b11.. - */ -#define SINC_CPROT_SCDOP(x) (((uint32_t)(((uint32_t)(x)) << SINC_CPROT_SCDOP_SHIFT)) & SINC_CPROT_SCDOP_MASK) - -#define SINC_CPROT_LMTOP_MASK (0xC000U) -#define SINC_CPROT_LMTOP_SHIFT (14U) -/*! LMTOP - Limit Detection Option - * 0b00..Both high and low limits - * 0b01..High limit - * 0b10..Low limit - * 0b11..Windowed value - */ -#define SINC_CPROT_LMTOP(x) (((uint32_t)(((uint32_t)(x)) << SINC_CPROT_LMTOP_SHIFT)) & SINC_CPROT_LMTOP_MASK) - -#define SINC_CPROT_CADLMT_MASK (0xF0000U) -#define SINC_CPROT_CADLMT_SHIFT (16U) -/*! CADLMT - CAD Limit Threshold - * 0b0000..Disables CAD - * *..Threshold value - */ -#define SINC_CPROT_CADLMT(x) (((uint32_t)(((uint32_t)(x)) << SINC_CPROT_CADLMT_SHIFT)) & SINC_CPROT_CADLMT_MASK) - -#define SINC_CPROT_CADBK_MASK (0x4000000U) -#define SINC_CPROT_CADBK_SHIFT (26U) -/*! CADBK - CAD Break Signal - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_CPROT_CADBK(x) (((uint32_t)(((uint32_t)(x)) << SINC_CPROT_CADBK_SHIFT)) & SINC_CPROT_CADBK_MASK) - -#define SINC_CPROT_SCDBK_MASK (0x8000000U) -#define SINC_CPROT_SCDBK_SHIFT (27U) -/*! SCDBK - SCD Break Signal - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_CPROT_SCDBK(x) (((uint32_t)(((uint32_t)(x)) << SINC_CPROT_SCDBK_SHIFT)) & SINC_CPROT_SCDBK_MASK) - -#define SINC_CPROT_LLMTBK_MASK (0x20000000U) -#define SINC_CPROT_LLMTBK_SHIFT (29U) -/*! LLMTBK - Low Limit Break Signal - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_CPROT_LLMTBK(x) (((uint32_t)(((uint32_t)(x)) << SINC_CPROT_LLMTBK_SHIFT)) & SINC_CPROT_LLMTBK_MASK) - -#define SINC_CPROT_WLMTBK_MASK (0x40000000U) -#define SINC_CPROT_WLMTBK_SHIFT (30U) -/*! WLMTBK - Window Limit Break Signal - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_CPROT_WLMTBK(x) (((uint32_t)(((uint32_t)(x)) << SINC_CPROT_WLMTBK_SHIFT)) & SINC_CPROT_WLMTBK_MASK) - -#define SINC_CPROT_HLMTBK_MASK (0x80000000U) -#define SINC_CPROT_HLMTBK_SHIFT (31U) -/*! HLMTBK - High Limit Break Signal - * 0b0..Disables - * 0b1..Enables - */ -#define SINC_CPROT_HLMTBK(x) (((uint32_t)(((uint32_t)(x)) << SINC_CPROT_HLMTBK_SHIFT)) & SINC_CPROT_HLMTBK_MASK) -/*! @} */ - -/* The count of SINC_CPROT */ -#define SINC_CPROT_COUNT (5U) - -/*! @name CBIAS - Channel 0 Bias..Channel 4 Bias */ -/*! @{ */ - -#define SINC_CBIAS_BIAS_MASK (0xFFFFFF00U) -#define SINC_CBIAS_BIAS_SHIFT (8U) -/*! BIAS - Bias Value */ -#define SINC_CBIAS_BIAS(x) (((uint32_t)(((uint32_t)(x)) << SINC_CBIAS_BIAS_SHIFT)) & SINC_CBIAS_BIAS_MASK) -/*! @} */ - -/* The count of SINC_CBIAS */ -#define SINC_CBIAS_COUNT (5U) - -/*! @name CLOLMT - Channel 0 Low Limit..Channel 4 Low Limit */ -/*! @{ */ - -#define SINC_CLOLMT_LOLMT_MASK (0xFFFFFF00U) -#define SINC_CLOLMT_LOLMT_SHIFT (8U) -/*! LOLMT - Low Limit Threshold */ -#define SINC_CLOLMT_LOLMT(x) (((uint32_t)(((uint32_t)(x)) << SINC_CLOLMT_LOLMT_SHIFT)) & SINC_CLOLMT_LOLMT_MASK) -/*! @} */ - -/* The count of SINC_CLOLMT */ -#define SINC_CLOLMT_COUNT (5U) - -/*! @name CHILMT - Channel 0 High Limit..Channel 4 High Limit */ -/*! @{ */ - -#define SINC_CHILMT_HILMT_MASK (0xFFFFFF00U) -#define SINC_CHILMT_HILMT_SHIFT (8U) -/*! HILMT - High Limit Threshold */ -#define SINC_CHILMT_HILMT(x) (((uint32_t)(((uint32_t)(x)) << SINC_CHILMT_HILMT_SHIFT)) & SINC_CHILMT_HILMT_MASK) -/*! @} */ - -/* The count of SINC_CHILMT */ -#define SINC_CHILMT_COUNT (5U) - -/*! @name CRDATA - Channel 0 Result Data..Channel 4 Result Data */ -/*! @{ */ - -#define SINC_CRDATA_RDATA_MASK (0xFFFFFF00U) -#define SINC_CRDATA_RDATA_SHIFT (8U) -/*! RDATA - Result Data */ -#define SINC_CRDATA_RDATA(x) (((uint32_t)(((uint32_t)(x)) << SINC_CRDATA_RDATA_SHIFT)) & SINC_CRDATA_RDATA_MASK) -/*! @} */ - -/* The count of SINC_CRDATA */ -#define SINC_CRDATA_COUNT (5U) - -/*! @name CMPDATA - Channel 0 Multipurpose Data..Channel 4 Multipurpose Data */ -/*! @{ */ - -#define SINC_CMPDATA_MPDATA_MASK (0xFFFFFFFFU) -#define SINC_CMPDATA_MPDATA_SHIFT (0U) -/*! MPDATA - Multipurpose Data */ -#define SINC_CMPDATA_MPDATA(x) (((uint32_t)(((uint32_t)(x)) << SINC_CMPDATA_MPDATA_SHIFT)) & SINC_CMPDATA_MPDATA_MASK) -/*! @} */ - -/* The count of SINC_CMPDATA */ -#define SINC_CMPDATA_COUNT (5U) - -/*! @name CACFR - Channel 0 Advanced Configuration..Channel 4 Advanced Configuration */ -/*! @{ */ - -#define SINC_CACFR_ADMASEL_MASK (0xF000U) -#define SINC_CACFR_ADMASEL_SHIFT (12U) -/*! ADMASEL - Alternate DMA Source Selection - * 0b0000..Alternate DMA disabled - * 0b0001..PF conversion complete - * 0b0010..PF data output ready - * 0b0011..Zero crossing detected - * 0b0100..Short circuit detected - * 0b0101..Window limit detected - * 0b0110..Low limit detected - * 0b0111..High limit - * 0b1000..FIFO underflow - * 0b1001..FIFO overflow - * 0b1010..Clock absence - * 0b1011..Saturation - */ -#define SINC_CACFR_ADMASEL(x) (((uint32_t)(((uint32_t)(x)) << SINC_CACFR_ADMASEL_SHIFT)) & SINC_CACFR_ADMASEL_MASK) - -#define SINC_CACFR_HPFA_MASK (0xF0000U) -#define SINC_CACFR_HPFA_SHIFT (16U) -/*! HPFA - HPF DC Remover Alpha Coefficient */ -#define SINC_CACFR_HPFA(x) (((uint32_t)(((uint32_t)(x)) << SINC_CACFR_HPFA_SHIFT)) & SINC_CACFR_HPFA_MASK) - -#define SINC_CACFR_IBDLY_MASK (0xF00000U) -#define SINC_CACFR_IBDLY_SHIFT (20U) -/*! IBDLY - Input Modulator Bitstream Delay - * 0b0000..Disabled - * *..Delay in clock cycles - */ -#define SINC_CACFR_IBDLY(x) (((uint32_t)(((uint32_t)(x)) << SINC_CACFR_IBDLY_SHIFT)) & SINC_CACFR_IBDLY_MASK) -/*! @} */ - -/* The count of SINC_CACFR */ -#define SINC_CACFR_COUNT (5U) - -/*! @name CSR - Channel 0 Status..Channel 4 Status */ -/*! @{ */ - -#define SINC_CSR_FIFOAVIL_MASK (0x1FU) -#define SINC_CSR_FIFOAVIL_SHIFT (0U) -/*! FIFOAVIL - FIFO Available Data */ -#define SINC_CSR_FIFOAVIL(x) (((uint32_t)(((uint32_t)(x)) << SINC_CSR_FIFOAVIL_SHIFT)) & SINC_CSR_FIFOAVIL_MASK) - -#define SINC_CSR_PSRDY_MASK (0x80U) -#define SINC_CSR_PSRDY_SHIFT (7U) -/*! PSRDY - Parallel or Serial Data Ready - * 0b0..Not ready - * 0b1..Ready - */ -#define SINC_CSR_PSRDY(x) (((uint32_t)(((uint32_t)(x)) << SINC_CSR_PSRDY_SHIFT)) & SINC_CSR_PSRDY_MASK) - -#define SINC_CSR_PFSAT_MASK (0x100U) -#define SINC_CSR_PFSAT_SHIFT (8U) -/*! PFSAT - Primary CIC Saturation Flag - * 0b0..Did not occur - * 0b1..Occurred - */ -#define SINC_CSR_PFSAT(x) (((uint32_t)(((uint32_t)(x)) << SINC_CSR_PFSAT_SHIFT)) & SINC_CSR_PFSAT_MASK) - -#define SINC_CSR_HPFSAT_MASK (0x200U) -#define SINC_CSR_HPFSAT_SHIFT (9U) -/*! HPFSAT - HPF Saturation Flag - * 0b0..Did not occur - * 0b1..Occurred - */ -#define SINC_CSR_HPFSAT(x) (((uint32_t)(((uint32_t)(x)) << SINC_CSR_HPFSAT_SHIFT)) & SINC_CSR_HPFSAT_MASK) - -#define SINC_CSR_SFTSAT_MASK (0x400U) -#define SINC_CSR_SFTSAT_SHIFT (10U) -/*! SFTSAT - Shift Saturation Flag - * 0b0..Did not occur - * 0b1..Occurred - */ -#define SINC_CSR_SFTSAT(x) (((uint32_t)(((uint32_t)(x)) << SINC_CSR_SFTSAT_SHIFT)) & SINC_CSR_SFTSAT_MASK) - -#define SINC_CSR_BIASSAT_MASK (0x800U) -#define SINC_CSR_BIASSAT_SHIFT (11U) -/*! BIASSAT - Bias Saturation Flag - * 0b0..Did not occur - * 0b1..Occurred - */ -#define SINC_CSR_BIASSAT(x) (((uint32_t)(((uint32_t)(x)) << SINC_CSR_BIASSAT_SHIFT)) & SINC_CSR_BIASSAT_MASK) - -#define SINC_CSR_RDRS_MASK (0x1000U) -#define SINC_CSR_RDRS_SHIFT (12U) -/*! RDRS - Result Data Direct Read Status - * 0b0..Valid - * 0b1..Invalid - */ -#define SINC_CSR_RDRS(x) (((uint32_t)(((uint32_t)(x)) << SINC_CSR_RDRS_SHIFT)) & SINC_CSR_RDRS_MASK) - -#define SINC_CSR_SRDS_MASK (0x2000U) -#define SINC_CSR_SRDS_SHIFT (13U) -/*! SRDS - Start Read Debug Data Sync - * 0b0..Data valid - * 0b1..Procedure in progress - * 0b0..No effect - * 0b1..Starts the procedure - */ -#define SINC_CSR_SRDS(x) (((uint32_t)(((uint32_t)(x)) << SINC_CSR_SRDS_SHIFT)) & SINC_CSR_SRDS_MASK) - -#define SINC_CSR_DBGRS_MASK (0xC000U) -#define SINC_CSR_DBGRS_SHIFT (14U) -/*! DBGRS - Debug Data Read Status - * 0b00..Valid - * 0b01-0b11..Invalid - */ -#define SINC_CSR_DBGRS(x) (((uint32_t)(((uint32_t)(x)) << SINC_CSR_DBGRS_SHIFT)) & SINC_CSR_DBGRS_MASK) - -#define SINC_CSR_CNUM_MASK (0x7F0000U) -#define SINC_CSR_CNUM_SHIFT (16U) -/*! CNUM - Number Of Conversions */ -#define SINC_CSR_CNUM(x) (((uint32_t)(((uint32_t)(x)) << SINC_CSR_CNUM_SHIFT)) & SINC_CSR_CNUM_MASK) - -#define SINC_CSR_CNUM_OV_MASK (0x800000U) -#define SINC_CSR_CNUM_OV_SHIFT (23U) -/*! CNUM_OV - Overflow In Number Of Conversions - * 0b0..No overflow - * 0b1..Overflow - */ -#define SINC_CSR_CNUM_OV(x) (((uint32_t)(((uint32_t)(x)) << SINC_CSR_CNUM_OV_SHIFT)) & SINC_CSR_CNUM_OV_MASK) -/*! @} */ - -/* The count of SINC_CSR */ -#define SINC_CSR_COUNT (5U) - -/*! @name CDBGR - Channel 0 Debug..Channel 4 Debug */ -/*! @{ */ - -#define SINC_CDBGR_DBGDATA_MASK (0xFFFFFFFFU) -#define SINC_CDBGR_DBGDATA_SHIFT (0U) -/*! DBGDATA - Debug Data */ -#define SINC_CDBGR_DBGDATA(x) (((uint32_t)(((uint32_t)(x)) << SINC_CDBGR_DBGDATA_SHIFT)) & SINC_CDBGR_DBGDATA_MASK) -/*! @} */ - -/* The count of SINC_CDBGR */ -#define SINC_CDBGR_COUNT (5U) - - -/*! - * @} - */ /* end of group SINC_Register_Masks */ - - -/* SINC - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral SINC0 base address */ - #define SINC0_BASE (0x50108000u) - /** Peripheral SINC0 base address */ - #define SINC0_BASE_NS (0x40108000u) - /** Peripheral SINC0 base pointer */ - #define SINC0 ((SINC_Type *)SINC0_BASE) - /** Peripheral SINC0 base pointer */ - #define SINC0_NS ((SINC_Type *)SINC0_BASE_NS) - /** Array initializer of SINC peripheral base addresses */ - #define SINC_BASE_ADDRS { SINC0_BASE } - /** Array initializer of SINC peripheral base pointers */ - #define SINC_BASE_PTRS { SINC0 } - /** Array initializer of SINC peripheral base addresses */ - #define SINC_BASE_ADDRS_NS { SINC0_BASE_NS } - /** Array initializer of SINC peripheral base pointers */ - #define SINC_BASE_PTRS_NS { SINC0_NS } -#else - /** Peripheral SINC0 base address */ - #define SINC0_BASE (0x40108000u) - /** Peripheral SINC0 base pointer */ - #define SINC0 ((SINC_Type *)SINC0_BASE) - /** Array initializer of SINC peripheral base addresses */ - #define SINC_BASE_ADDRS { SINC0_BASE } - /** Array initializer of SINC peripheral base pointers */ - #define SINC_BASE_PTRS { SINC0 } -#endif - -/*! - * @} - */ /* end of group SINC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- SMARTDMA Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SMARTDMA_Peripheral_Access_Layer SMARTDMA Peripheral Access Layer - * @{ - */ - -/** SMARTDMA - Register Layout Typedef */ -typedef struct { - uint8_t RESERVED_0[32]; - __IO uint32_t BOOTADR; /**< Boot Address, offset: 0x20 */ - __IO uint32_t CTRL; /**< Control, offset: 0x24 */ - __I uint32_t PC; /**< Program Counter, offset: 0x28 */ - __I uint32_t SP; /**< Stack Pointer, offset: 0x2C */ - __IO uint32_t BREAK_ADDR; /**< Breakpoint Address, offset: 0x30 */ - __IO uint32_t BREAK_VECT; /**< Breakpoint Vector, offset: 0x34 */ - __IO uint32_t EMER_VECT; /**< Emergency Vector, offset: 0x38 */ - __IO uint32_t EMER_SEL; /**< Emergency Select, offset: 0x3C */ - __IO uint32_t ARM2EZH; /**< ARM to EZH Interrupt Control, offset: 0x40 */ - __IO uint32_t EZH2ARM; /**< EZH to ARM Trigger, offset: 0x44 */ - __IO uint32_t PENDTRAP; /**< Pending Trap Control, offset: 0x48 */ -} SMARTDMA_Type; - -/* ---------------------------------------------------------------------------- - -- SMARTDMA Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SMARTDMA_Register_Masks SMARTDMA Register Masks - * @{ - */ - -/*! @name BOOTADR - Boot Address */ -/*! @{ */ - -#define SMARTDMA_BOOTADR_ADDR_MASK (0xFFFFFFFCU) -#define SMARTDMA_BOOTADR_ADDR_SHIFT (2U) -/*! ADDR - 32-bit boot address, the boot address should be 4-byte aligned. */ -#define SMARTDMA_BOOTADR_ADDR(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_BOOTADR_ADDR_SHIFT)) & SMARTDMA_BOOTADR_ADDR_MASK) -/*! @} */ - -/*! @name CTRL - Control */ -/*! @{ */ - -#define SMARTDMA_CTRL_START_MASK (0x1U) -#define SMARTDMA_CTRL_START_SHIFT (0U) -/*! START - Start Bit Ignition */ -#define SMARTDMA_CTRL_START(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_CTRL_START_SHIFT)) & SMARTDMA_CTRL_START_MASK) - -#define SMARTDMA_CTRL_EXF_MASK (0x2U) -#define SMARTDMA_CTRL_EXF_SHIFT (1U) -/*! EXF - External Flag */ -#define SMARTDMA_CTRL_EXF(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_CTRL_EXF_SHIFT)) & SMARTDMA_CTRL_EXF_MASK) - -#define SMARTDMA_CTRL_ERRDIS_MASK (0x4U) -#define SMARTDMA_CTRL_ERRDIS_SHIFT (2U) -/*! ERRDIS - Error Disable */ -#define SMARTDMA_CTRL_ERRDIS(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_CTRL_ERRDIS_SHIFT)) & SMARTDMA_CTRL_ERRDIS_MASK) - -#define SMARTDMA_CTRL_BUFEN_MASK (0x8U) -#define SMARTDMA_CTRL_BUFEN_SHIFT (3U) -/*! BUFEN - Buffer Enable */ -#define SMARTDMA_CTRL_BUFEN(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_CTRL_BUFEN_SHIFT)) & SMARTDMA_CTRL_BUFEN_MASK) - -#define SMARTDMA_CTRL_SYNCEN_MASK (0x10U) -#define SMARTDMA_CTRL_SYNCEN_SHIFT (4U) -/*! SYNCEN - Sync Enable */ -#define SMARTDMA_CTRL_SYNCEN(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_CTRL_SYNCEN_SHIFT)) & SMARTDMA_CTRL_SYNCEN_MASK) - -#define SMARTDMA_CTRL_WKEY_MASK (0xFFFF0000U) -#define SMARTDMA_CTRL_WKEY_SHIFT (16U) -/*! WKEY - Write Key */ -#define SMARTDMA_CTRL_WKEY(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_CTRL_WKEY_SHIFT)) & SMARTDMA_CTRL_WKEY_MASK) -/*! @} */ - -/*! @name PC - Program Counter */ -/*! @{ */ - -#define SMARTDMA_PC_PC_MASK (0xFFFFFFFFU) -#define SMARTDMA_PC_PC_SHIFT (0U) -/*! PC - Program Counter */ -#define SMARTDMA_PC_PC(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_PC_PC_SHIFT)) & SMARTDMA_PC_PC_MASK) -/*! @} */ - -/*! @name SP - Stack Pointer */ -/*! @{ */ - -#define SMARTDMA_SP_SP_MASK (0xFFFFFFFFU) -#define SMARTDMA_SP_SP_SHIFT (0U) -/*! SP - Stack Pointer */ -#define SMARTDMA_SP_SP(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_SP_SP_SHIFT)) & SMARTDMA_SP_SP_MASK) -/*! @} */ - -/*! @name BREAK_ADDR - Breakpoint Address */ -/*! @{ */ - -#define SMARTDMA_BREAK_ADDR_ADDR_MASK (0xFFFFFFFCU) -#define SMARTDMA_BREAK_ADDR_ADDR_SHIFT (2U) -/*! ADDR - 32-bit address to swap to EZHB_BREAK_VECT location */ -#define SMARTDMA_BREAK_ADDR_ADDR(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_BREAK_ADDR_ADDR_SHIFT)) & SMARTDMA_BREAK_ADDR_ADDR_MASK) -/*! @} */ - -/*! @name BREAK_VECT - Breakpoint Vector */ -/*! @{ */ - -#define SMARTDMA_BREAK_VECT_VEC_MASK (0xFFFFFFFCU) -#define SMARTDMA_BREAK_VECT_VEC_SHIFT (2U) -/*! VEC - Vector address of user debug routine. */ -#define SMARTDMA_BREAK_VECT_VEC(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_BREAK_VECT_VEC_SHIFT)) & SMARTDMA_BREAK_VECT_VEC_MASK) -/*! @} */ - -/*! @name EMER_VECT - Emergency Vector */ -/*! @{ */ - -#define SMARTDMA_EMER_VECT_VEC_MASK (0xFFFFFFFCU) -#define SMARTDMA_EMER_VECT_VEC_SHIFT (2U) -/*! VEC - Vector address of emergency code routine */ -#define SMARTDMA_EMER_VECT_VEC(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_EMER_VECT_VEC_SHIFT)) & SMARTDMA_EMER_VECT_VEC_MASK) -/*! @} */ - -/*! @name EMER_SEL - Emergency Select */ -/*! @{ */ - -#define SMARTDMA_EMER_SEL_EN_MASK (0x100U) -#define SMARTDMA_EMER_SEL_EN_SHIFT (8U) -/*! EN - Emergency code routine */ -#define SMARTDMA_EMER_SEL_EN(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_EMER_SEL_EN_SHIFT)) & SMARTDMA_EMER_SEL_EN_MASK) - -#define SMARTDMA_EMER_SEL_RQ_MASK (0x200U) -#define SMARTDMA_EMER_SEL_RQ_SHIFT (9U) -/*! RQ - Software emergency request */ -#define SMARTDMA_EMER_SEL_RQ(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_EMER_SEL_RQ_SHIFT)) & SMARTDMA_EMER_SEL_RQ_MASK) -/*! @} */ - -/*! @name ARM2EZH - ARM to EZH Interrupt Control */ -/*! @{ */ - -#define SMARTDMA_ARM2EZH_IE_MASK (0x3U) -#define SMARTDMA_ARM2EZH_IE_SHIFT (0U) -/*! IE - Interrupt Enable */ -#define SMARTDMA_ARM2EZH_IE(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_ARM2EZH_IE_SHIFT)) & SMARTDMA_ARM2EZH_IE_MASK) - -#define SMARTDMA_ARM2EZH_GP_MASK (0xFFFFFFFCU) -#define SMARTDMA_ARM2EZH_GP_SHIFT (2U) -/*! GP - General purpose register bits */ -#define SMARTDMA_ARM2EZH_GP(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_ARM2EZH_GP_SHIFT)) & SMARTDMA_ARM2EZH_GP_MASK) -/*! @} */ - -/*! @name EZH2ARM - EZH to ARM Trigger */ -/*! @{ */ - -#define SMARTDMA_EZH2ARM_GP_MASK (0xFFFFFFFFU) -#define SMARTDMA_EZH2ARM_GP_SHIFT (0U) -/*! GP - General purpose register bits Writing to EZH2ARM triggers the ARM interrupt when ARM2EZH [1:0] == 2h */ -#define SMARTDMA_EZH2ARM_GP(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_EZH2ARM_GP_SHIFT)) & SMARTDMA_EZH2ARM_GP_MASK) -/*! @} */ - -/*! @name PENDTRAP - Pending Trap Control */ -/*! @{ */ - -#define SMARTDMA_PENDTRAP_STATUS_MASK (0xFFU) -#define SMARTDMA_PENDTRAP_STATUS_SHIFT (0U) -/*! STATUS - Status Flag or Pending Trap Request */ -#define SMARTDMA_PENDTRAP_STATUS(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_PENDTRAP_STATUS_SHIFT)) & SMARTDMA_PENDTRAP_STATUS_MASK) - -#define SMARTDMA_PENDTRAP_POL_MASK (0xFF00U) -#define SMARTDMA_PENDTRAP_POL_SHIFT (8U) -/*! POL - Polarity */ -#define SMARTDMA_PENDTRAP_POL(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_PENDTRAP_POL_SHIFT)) & SMARTDMA_PENDTRAP_POL_MASK) - -#define SMARTDMA_PENDTRAP_EN_MASK (0xFF0000U) -#define SMARTDMA_PENDTRAP_EN_SHIFT (16U) -/*! EN - Enable Pending Trap */ -#define SMARTDMA_PENDTRAP_EN(x) (((uint32_t)(((uint32_t)(x)) << SMARTDMA_PENDTRAP_EN_SHIFT)) & SMARTDMA_PENDTRAP_EN_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group SMARTDMA_Register_Masks */ - - -/* SMARTDMA - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral SMARTDMA0 base address */ - #define SMARTDMA0_BASE (0x50033000u) - /** Peripheral SMARTDMA0 base address */ - #define SMARTDMA0_BASE_NS (0x40033000u) - /** Peripheral SMARTDMA0 base pointer */ - #define SMARTDMA0 ((SMARTDMA_Type *)SMARTDMA0_BASE) - /** Peripheral SMARTDMA0 base pointer */ - #define SMARTDMA0_NS ((SMARTDMA_Type *)SMARTDMA0_BASE_NS) - /** Array initializer of SMARTDMA peripheral base addresses */ - #define SMARTDMA_BASE_ADDRS { SMARTDMA0_BASE } - /** Array initializer of SMARTDMA peripheral base pointers */ - #define SMARTDMA_BASE_PTRS { SMARTDMA0 } - /** Array initializer of SMARTDMA peripheral base addresses */ - #define SMARTDMA_BASE_ADDRS_NS { SMARTDMA0_BASE_NS } - /** Array initializer of SMARTDMA peripheral base pointers */ - #define SMARTDMA_BASE_PTRS_NS { SMARTDMA0_NS } -#else - /** Peripheral SMARTDMA0 base address */ - #define SMARTDMA0_BASE (0x40033000u) - /** Peripheral SMARTDMA0 base pointer */ - #define SMARTDMA0 ((SMARTDMA_Type *)SMARTDMA0_BASE) - /** Array initializer of SMARTDMA peripheral base addresses */ - #define SMARTDMA_BASE_ADDRS { SMARTDMA0_BASE } - /** Array initializer of SMARTDMA peripheral base pointers */ - #define SMARTDMA_BASE_PTRS { SMARTDMA0 } -#endif - -/*! - * @} - */ /* end of group SMARTDMA_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- SPC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SPC_Peripheral_Access_Layer SPC Peripheral Access Layer - * @{ - */ - -/** SPC - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - uint8_t RESERVED_0[12]; - __IO uint32_t SC; /**< Status Control, offset: 0x10 */ - __IO uint32_t CNTRL; /**< SPC Regulator Control, offset: 0x14 */ - uint8_t RESERVED_1[4]; - __IO uint32_t LPREQ_CFG; /**< Low-Power Request Configuration, offset: 0x1C */ - uint8_t RESERVED_2[16]; - __IO uint32_t PD_STATUS[2]; /**< SPC Power Domain Mode Status, array offset: 0x30, array step: 0x4 */ - uint8_t RESERVED_3[8]; - __IO uint32_t SRAMCTL; /**< SRAM Control, offset: 0x40 */ - uint8_t RESERVED_4[188]; - __IO uint32_t ACTIVE_CFG; /**< Active Power Mode Configuration, offset: 0x100 */ - __IO uint32_t ACTIVE_CFG1; /**< Active Power Mode Configuration 1, offset: 0x104 */ - __IO uint32_t LP_CFG; /**< Low-Power Mode Configuration, offset: 0x108 */ - __IO uint32_t LP_CFG1; /**< Low Power Mode Configuration 1, offset: 0x10C */ - uint8_t RESERVED_5[16]; - __IO uint32_t LPWKUP_DELAY; /**< Low Power Wake-Up Delay, offset: 0x120 */ - __IO uint32_t ACTIVE_VDELAY; /**< Active Voltage Trim Delay, offset: 0x124 */ - uint8_t RESERVED_6[8]; - __IO uint32_t VD_STAT; /**< Voltage Detect Status, offset: 0x130 */ - __IO uint32_t VD_CORE_CFG; /**< Core Voltage Detect Configuration, offset: 0x134 */ - __IO uint32_t VD_SYS_CFG; /**< System Voltage Detect Configuration, offset: 0x138 */ - __IO uint32_t VD_IO_CFG; /**< IO Voltage Detect Configuration, offset: 0x13C */ - __IO uint32_t EVD_CFG; /**< External Voltage Domain Configuration, offset: 0x140 */ - __IO uint32_t GLITCH_DETECT_SC; /**< Glitch Detect Status Control, offset: 0x144 */ - uint8_t RESERVED_7[440]; - __IO uint32_t CORELDO_CFG; /**< LDO_CORE Configuration, offset: 0x300 */ - uint8_t RESERVED_8[252]; - __IO uint32_t SYSLDO_CFG; /**< LDO_SYS Configuration, offset: 0x400 */ - uint8_t RESERVED_9[252]; - __IO uint32_t DCDC_CFG; /**< DCDC Configuration, offset: 0x500 */ - __IO uint32_t DCDC_BURST_CFG; /**< DCDC Burst Configuration, offset: 0x504 */ -} SPC_Type; - -/* ---------------------------------------------------------------------------- - -- SPC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SPC_Register_Masks SPC Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define SPC_VERID_FEATURE_MASK (0xFFFFU) -#define SPC_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Standard features - * *.. - */ -#define SPC_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VERID_FEATURE_SHIFT)) & SPC_VERID_FEATURE_MASK) - -#define SPC_VERID_MINOR_MASK (0xFF0000U) -#define SPC_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define SPC_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << SPC_VERID_MINOR_SHIFT)) & SPC_VERID_MINOR_MASK) - -#define SPC_VERID_MAJOR_MASK (0xFF000000U) -#define SPC_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define SPC_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << SPC_VERID_MAJOR_SHIFT)) & SPC_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name SC - Status Control */ -/*! @{ */ - -#define SPC_SC_BUSY_MASK (0x1U) -#define SPC_SC_BUSY_SHIFT (0U) -/*! BUSY - SPC Busy Status Flag - * 0b0..Not busy - * 0b1..Busy - */ -#define SPC_SC_BUSY(x) (((uint32_t)(((uint32_t)(x)) << SPC_SC_BUSY_SHIFT)) & SPC_SC_BUSY_MASK) - -#define SPC_SC_SPC_LP_REQ_MASK (0x2U) -#define SPC_SC_SPC_LP_REQ_SHIFT (1U) -/*! SPC_LP_REQ - SPC Power Mode Configuration Status Flag - * 0b0..SPC is in Active or Sleep mode; the ACTIVE_CFG register has control - * 0b1..All power domains requested low-power mode; SPC entered a low-power state; power-mode configuration based on the LP_CFG register - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_SC_SPC_LP_REQ(x) (((uint32_t)(((uint32_t)(x)) << SPC_SC_SPC_LP_REQ_SHIFT)) & SPC_SC_SPC_LP_REQ_MASK) - -#define SPC_SC_SPC_LP_MODE_MASK (0xF0U) -#define SPC_SC_SPC_LP_MODE_SHIFT (4U) -/*! SPC_LP_MODE - Power Domain Low-Power Mode Request - * 0b0000..Sleep mode with system clock running - * 0b0001..DSLEEP with system clock off - * 0b0010..PDOWN with system clock off - * 0b0100.. - * 0b1000..DPDOWN with system clock off - */ -#define SPC_SC_SPC_LP_MODE(x) (((uint32_t)(((uint32_t)(x)) << SPC_SC_SPC_LP_MODE_SHIFT)) & SPC_SC_SPC_LP_MODE_MASK) - -#define SPC_SC_ISO_CLR_MASK (0x30000U) -#define SPC_SC_ISO_CLR_SHIFT (16U) -/*! ISO_CLR - Isolation Clear Flags */ -#define SPC_SC_ISO_CLR(x) (((uint32_t)(((uint32_t)(x)) << SPC_SC_ISO_CLR_SHIFT)) & SPC_SC_ISO_CLR_MASK) -/*! @} */ - -/*! @name CNTRL - SPC Regulator Control */ -/*! @{ */ - -#define SPC_CNTRL_CORELDO_EN_MASK (0x1U) -#define SPC_CNTRL_CORELDO_EN_SHIFT (0U) -/*! CORELDO_EN - LDO_CORE Regulator Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_CNTRL_CORELDO_EN(x) (((uint32_t)(((uint32_t)(x)) << SPC_CNTRL_CORELDO_EN_SHIFT)) & SPC_CNTRL_CORELDO_EN_MASK) - -#define SPC_CNTRL_SYSLDO_EN_MASK (0x2U) -#define SPC_CNTRL_SYSLDO_EN_SHIFT (1U) -/*! SYSLDO_EN - LDO_SYS Regulator Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_CNTRL_SYSLDO_EN(x) (((uint32_t)(((uint32_t)(x)) << SPC_CNTRL_SYSLDO_EN_SHIFT)) & SPC_CNTRL_SYSLDO_EN_MASK) - -#define SPC_CNTRL_DCDC_EN_MASK (0x4U) -#define SPC_CNTRL_DCDC_EN_SHIFT (2U) -/*! DCDC_EN - DCDC_CORE Regulator Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_CNTRL_DCDC_EN(x) (((uint32_t)(((uint32_t)(x)) << SPC_CNTRL_DCDC_EN_SHIFT)) & SPC_CNTRL_DCDC_EN_MASK) -/*! @} */ - -/*! @name LPREQ_CFG - Low-Power Request Configuration */ -/*! @{ */ - -#define SPC_LPREQ_CFG_LPREQOE_MASK (0x1U) -#define SPC_LPREQ_CFG_LPREQOE_SHIFT (0U) -/*! LPREQOE - Low-Power Request Output Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LPREQ_CFG_LPREQOE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LPREQ_CFG_LPREQOE_SHIFT)) & SPC_LPREQ_CFG_LPREQOE_MASK) - -#define SPC_LPREQ_CFG_LPREQPOL_MASK (0x2U) -#define SPC_LPREQ_CFG_LPREQPOL_SHIFT (1U) -/*! LPREQPOL - Low-Power Request Output Pin Polarity Control - * 0b0..High - * 0b1..Low - */ -#define SPC_LPREQ_CFG_LPREQPOL(x) (((uint32_t)(((uint32_t)(x)) << SPC_LPREQ_CFG_LPREQPOL_SHIFT)) & SPC_LPREQ_CFG_LPREQPOL_MASK) - -#define SPC_LPREQ_CFG_LPREQOV_MASK (0xCU) -#define SPC_LPREQ_CFG_LPREQOV_SHIFT (2U) -/*! LPREQOV - Low-Power Request Output Override - * 0b00..Not forced - * 0b01.. - * 0b10..Forced low (ignore LPREQPOL settings) - * 0b11..Forced high (ignore LPREQPOL settings) - */ -#define SPC_LPREQ_CFG_LPREQOV(x) (((uint32_t)(((uint32_t)(x)) << SPC_LPREQ_CFG_LPREQOV_SHIFT)) & SPC_LPREQ_CFG_LPREQOV_MASK) -/*! @} */ - -/*! @name PD_STATUS - SPC Power Domain Mode Status */ -/*! @{ */ - -#define SPC_PD_STATUS_PWR_REQ_STATUS_MASK (0x1U) -#define SPC_PD_STATUS_PWR_REQ_STATUS_SHIFT (0U) -/*! PWR_REQ_STATUS - Power Request Status Flag - * 0b0..Did not request - * 0b1..Requested - */ -#define SPC_PD_STATUS_PWR_REQ_STATUS(x) (((uint32_t)(((uint32_t)(x)) << SPC_PD_STATUS_PWR_REQ_STATUS_SHIFT)) & SPC_PD_STATUS_PWR_REQ_STATUS_MASK) - -#define SPC_PD_STATUS_PD_LP_REQ_MASK (0x10U) -#define SPC_PD_STATUS_PD_LP_REQ_SHIFT (4U) -/*! PD_LP_REQ - Power Domain Low Power Request Flag - * 0b0..Did not request - * 0b1..Requested - */ -#define SPC_PD_STATUS_PD_LP_REQ(x) (((uint32_t)(((uint32_t)(x)) << SPC_PD_STATUS_PD_LP_REQ_SHIFT)) & SPC_PD_STATUS_PD_LP_REQ_MASK) - -#define SPC_PD_STATUS_LP_MODE_MASK (0xF00U) -#define SPC_PD_STATUS_LP_MODE_SHIFT (8U) -/*! LP_MODE - Power Domain Low Power Mode Request - * 0b0000..SLEEP with system clock running - * 0b0001..DSLEEP with system clock off - * 0b0010..PDOWN with system clock off - * 0b0100.. - * 0b1000..DPDOWN with system clock off - */ -#define SPC_PD_STATUS_LP_MODE(x) (((uint32_t)(((uint32_t)(x)) << SPC_PD_STATUS_LP_MODE_SHIFT)) & SPC_PD_STATUS_LP_MODE_MASK) -/*! @} */ - -/* The count of SPC_PD_STATUS */ -#define SPC_PD_STATUS_COUNT (2U) - -/*! @name SRAMCTL - SRAM Control */ -/*! @{ */ - -#define SPC_SRAMCTL_VSM_MASK (0x3U) -#define SPC_SRAMCTL_VSM_SHIFT (0U) -/*! VSM - Voltage Select Margin - * 0b00.. - * 0b01..1.0 V - * 0b10..1.1 V - * 0b11.. - */ -#define SPC_SRAMCTL_VSM(x) (((uint32_t)(((uint32_t)(x)) << SPC_SRAMCTL_VSM_SHIFT)) & SPC_SRAMCTL_VSM_MASK) - -#define SPC_SRAMCTL_REQ_MASK (0x40000000U) -#define SPC_SRAMCTL_REQ_SHIFT (30U) -/*! REQ - SRAM Voltage Update Request - * 0b0..Do not request - * 0b1..Request - */ -#define SPC_SRAMCTL_REQ(x) (((uint32_t)(((uint32_t)(x)) << SPC_SRAMCTL_REQ_SHIFT)) & SPC_SRAMCTL_REQ_MASK) - -#define SPC_SRAMCTL_ACK_MASK (0x80000000U) -#define SPC_SRAMCTL_ACK_SHIFT (31U) -/*! ACK - SRAM Voltage Update Request Acknowledge - * 0b0..Not acknowledged - * 0b1..Acknowledged - */ -#define SPC_SRAMCTL_ACK(x) (((uint32_t)(((uint32_t)(x)) << SPC_SRAMCTL_ACK_SHIFT)) & SPC_SRAMCTL_ACK_MASK) -/*! @} */ - -/*! @name ACTIVE_CFG - Active Power Mode Configuration */ -/*! @{ */ - -#define SPC_ACTIVE_CFG_CORELDO_VDD_DS_MASK (0x1U) -#define SPC_ACTIVE_CFG_CORELDO_VDD_DS_SHIFT (0U) -/*! CORELDO_VDD_DS - LDO_CORE VDD Drive Strength - * 0b0..Low - * 0b1..Normal - */ -#define SPC_ACTIVE_CFG_CORELDO_VDD_DS(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_CORELDO_VDD_DS_SHIFT)) & SPC_ACTIVE_CFG_CORELDO_VDD_DS_MASK) - -#define SPC_ACTIVE_CFG_CORELDO_VDD_LVL_MASK (0xCU) -#define SPC_ACTIVE_CFG_CORELDO_VDD_LVL_SHIFT (2U) -/*! CORELDO_VDD_LVL - LDO_CORE VDD Regulator Voltage Level - * 0b00.. - * 0b01..Regulate to mid voltage (1.0 V) - * 0b10..Regulate to normal voltage (1.1 V) - * 0b11..Regulate to overdrive voltage (1.2 V) - */ -#define SPC_ACTIVE_CFG_CORELDO_VDD_LVL(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_CORELDO_VDD_LVL_SHIFT)) & SPC_ACTIVE_CFG_CORELDO_VDD_LVL_MASK) - -#define SPC_ACTIVE_CFG_SYSLDO_VDD_DS_MASK (0x10U) -#define SPC_ACTIVE_CFG_SYSLDO_VDD_DS_SHIFT (4U) -/*! SYSLDO_VDD_DS - LDO_SYS VDD Drive Strength - * 0b0..Low - * 0b1..Normal - */ -#define SPC_ACTIVE_CFG_SYSLDO_VDD_DS(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_SYSLDO_VDD_DS_SHIFT)) & SPC_ACTIVE_CFG_SYSLDO_VDD_DS_MASK) - -#define SPC_ACTIVE_CFG_SYSLDO_VDD_LVL_MASK (0x40U) -#define SPC_ACTIVE_CFG_SYSLDO_VDD_LVL_SHIFT (6U) -/*! SYSLDO_VDD_LVL - LDO_SYS VDD Regulator Voltage Level - * 0b0..Normal voltage (1.8 V) - * 0b1..Overdrive voltage (2.5 V) - */ -#define SPC_ACTIVE_CFG_SYSLDO_VDD_LVL(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_SYSLDO_VDD_LVL_SHIFT)) & SPC_ACTIVE_CFG_SYSLDO_VDD_LVL_MASK) - -#define SPC_ACTIVE_CFG_DCDC_VDD_DS_MASK (0x300U) -#define SPC_ACTIVE_CFG_DCDC_VDD_DS_SHIFT (8U) -/*! DCDC_VDD_DS - DCDC VDD Drive Strength - * 0b01..Low - * 0b10..Normal - * *.. - */ -#define SPC_ACTIVE_CFG_DCDC_VDD_DS(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_DCDC_VDD_DS_SHIFT)) & SPC_ACTIVE_CFG_DCDC_VDD_DS_MASK) - -#define SPC_ACTIVE_CFG_DCDC_VDD_LVL_MASK (0xC00U) -#define SPC_ACTIVE_CFG_DCDC_VDD_LVL_SHIFT (10U) -/*! DCDC_VDD_LVL - DCDC VDD Regulator Voltage Level - * 0b00..Reserved - * 0b01..Midvoltage (1.0 V) - * 0b10..Normal voltage (1.1 V) - * 0b11..Overdrive voltage (1.2 V) - */ -#define SPC_ACTIVE_CFG_DCDC_VDD_LVL(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_DCDC_VDD_LVL_SHIFT)) & SPC_ACTIVE_CFG_DCDC_VDD_LVL_MASK) - -#define SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE_MASK (0x1000U) -#define SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE_SHIFT (12U) -/*! GLITCH_DETECT_DISABLE - Glitch Detect Disable - * 0b0..Low Voltage Glitch Detect enabled - * 0b1..Low Voltage Glitch Detect disabled - */ -#define SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE_SHIFT)) & SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE_MASK) - -#define SPC_ACTIVE_CFG_LPBUFF_EN_MASK (0x40000U) -#define SPC_ACTIVE_CFG_LPBUFF_EN_SHIFT (18U) -/*! LPBUFF_EN - CMP Bandgap Buffer Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_ACTIVE_CFG_LPBUFF_EN(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_LPBUFF_EN_SHIFT)) & SPC_ACTIVE_CFG_LPBUFF_EN_MASK) - -#define SPC_ACTIVE_CFG_BGMODE_MASK (0x300000U) -#define SPC_ACTIVE_CFG_BGMODE_SHIFT (20U) -/*! BGMODE - Bandgap Mode - * 0b00..Bandgap disabled - * 0b01..Bandgap enabled, buffer disabled - * 0b10..Bandgap enabled, buffer enabled - * 0b11.. - */ -#define SPC_ACTIVE_CFG_BGMODE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_BGMODE_SHIFT)) & SPC_ACTIVE_CFG_BGMODE_MASK) - -#define SPC_ACTIVE_CFG_VDD_VD_DISABLE_MASK (0x800000U) -#define SPC_ACTIVE_CFG_VDD_VD_DISABLE_SHIFT (23U) -/*! VDD_VD_DISABLE - VDD Voltage Detect Disable - * 0b0..Enable - * 0b1..Disable - */ -#define SPC_ACTIVE_CFG_VDD_VD_DISABLE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_VDD_VD_DISABLE_SHIFT)) & SPC_ACTIVE_CFG_VDD_VD_DISABLE_MASK) - -#define SPC_ACTIVE_CFG_CORE_LVDE_MASK (0x1000000U) -#define SPC_ACTIVE_CFG_CORE_LVDE_SHIFT (24U) -/*! CORE_LVDE - Core Low-Voltage Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_ACTIVE_CFG_CORE_LVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_CORE_LVDE_SHIFT)) & SPC_ACTIVE_CFG_CORE_LVDE_MASK) - -#define SPC_ACTIVE_CFG_SYS_LVDE_MASK (0x2000000U) -#define SPC_ACTIVE_CFG_SYS_LVDE_SHIFT (25U) -/*! SYS_LVDE - System Low-Voltage Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_ACTIVE_CFG_SYS_LVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_SYS_LVDE_SHIFT)) & SPC_ACTIVE_CFG_SYS_LVDE_MASK) - -#define SPC_ACTIVE_CFG_IO_LVDE_MASK (0x4000000U) -#define SPC_ACTIVE_CFG_IO_LVDE_SHIFT (26U) -/*! IO_LVDE - IO Low-Voltage Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_ACTIVE_CFG_IO_LVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_IO_LVDE_SHIFT)) & SPC_ACTIVE_CFG_IO_LVDE_MASK) - -#define SPC_ACTIVE_CFG_CORE_HVDE_MASK (0x8000000U) -#define SPC_ACTIVE_CFG_CORE_HVDE_SHIFT (27U) -/*! CORE_HVDE - Core High-Voltage Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_ACTIVE_CFG_CORE_HVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_CORE_HVDE_SHIFT)) & SPC_ACTIVE_CFG_CORE_HVDE_MASK) - -#define SPC_ACTIVE_CFG_SYS_HVDE_MASK (0x10000000U) -#define SPC_ACTIVE_CFG_SYS_HVDE_SHIFT (28U) -/*! SYS_HVDE - System High-Voltage Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_ACTIVE_CFG_SYS_HVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_SYS_HVDE_SHIFT)) & SPC_ACTIVE_CFG_SYS_HVDE_MASK) - -#define SPC_ACTIVE_CFG_IO_HVDE_MASK (0x20000000U) -#define SPC_ACTIVE_CFG_IO_HVDE_SHIFT (29U) -/*! IO_HVDE - IO High-Voltage Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_ACTIVE_CFG_IO_HVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG_IO_HVDE_SHIFT)) & SPC_ACTIVE_CFG_IO_HVDE_MASK) -/*! @} */ - -/*! @name ACTIVE_CFG1 - Active Power Mode Configuration 1 */ -/*! @{ */ - -#define SPC_ACTIVE_CFG1_SOC_CNTRL_MASK (0xFFFFFFFFU) -#define SPC_ACTIVE_CFG1_SOC_CNTRL_SHIFT (0U) -/*! SOC_CNTRL - Active Config Chip Control */ -#define SPC_ACTIVE_CFG1_SOC_CNTRL(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_CFG1_SOC_CNTRL_SHIFT)) & SPC_ACTIVE_CFG1_SOC_CNTRL_MASK) -/*! @} */ - -/*! @name LP_CFG - Low-Power Mode Configuration */ -/*! @{ */ - -#define SPC_LP_CFG_CORELDO_VDD_DS_MASK (0x1U) -#define SPC_LP_CFG_CORELDO_VDD_DS_SHIFT (0U) -/*! CORELDO_VDD_DS - LDO_CORE VDD Drive Strength - * 0b0..Low - * 0b1..Normal - */ -#define SPC_LP_CFG_CORELDO_VDD_DS(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_CORELDO_VDD_DS_SHIFT)) & SPC_LP_CFG_CORELDO_VDD_DS_MASK) - -#define SPC_LP_CFG_CORELDO_VDD_LVL_MASK (0xCU) -#define SPC_LP_CFG_CORELDO_VDD_LVL_SHIFT (2U) -/*! CORELDO_VDD_LVL - LDO_CORE VDD Regulator Voltage Level - * 0b00..Retention voltage - * 0b01..Mid voltage (1.0 V) - * 0b10..Normal voltage (1.1 V) - * 0b11..Overdrive voltage (1.2 V) - */ -#define SPC_LP_CFG_CORELDO_VDD_LVL(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_CORELDO_VDD_LVL_SHIFT)) & SPC_LP_CFG_CORELDO_VDD_LVL_MASK) - -#define SPC_LP_CFG_SYSLDO_VDD_DS_MASK (0x10U) -#define SPC_LP_CFG_SYSLDO_VDD_DS_SHIFT (4U) -/*! SYSLDO_VDD_DS - LDO_SYS VDD Drive Strength - * 0b0..Low - * 0b1..Normal - */ -#define SPC_LP_CFG_SYSLDO_VDD_DS(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_SYSLDO_VDD_DS_SHIFT)) & SPC_LP_CFG_SYSLDO_VDD_DS_MASK) - -#define SPC_LP_CFG_DCDC_VDD_DS_MASK (0x300U) -#define SPC_LP_CFG_DCDC_VDD_DS_SHIFT (8U) -/*! DCDC_VDD_DS - DCDC VDD Drive Strength - * 0b00..Pulse refresh - * 0b01..Low - * 0b10..Normal - * 0b11.. - */ -#define SPC_LP_CFG_DCDC_VDD_DS(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_DCDC_VDD_DS_SHIFT)) & SPC_LP_CFG_DCDC_VDD_DS_MASK) - -#define SPC_LP_CFG_DCDC_VDD_LVL_MASK (0xC00U) -#define SPC_LP_CFG_DCDC_VDD_LVL_SHIFT (10U) -/*! DCDC_VDD_LVL - DCDC VDD Regulator Voltage Level - * 0b00..Retention voltage (0.7 V) - * 0b01..Mid voltage (1.0 V) - * 0b10..Normal voltage (1.1 V) - * 0b11..Overdrive voltage (1.2 V) - */ -#define SPC_LP_CFG_DCDC_VDD_LVL(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_DCDC_VDD_LVL_SHIFT)) & SPC_LP_CFG_DCDC_VDD_LVL_MASK) - -#define SPC_LP_CFG_GLITCH_DETECT_DISABLE_MASK (0x1000U) -#define SPC_LP_CFG_GLITCH_DETECT_DISABLE_SHIFT (12U) -/*! GLITCH_DETECT_DISABLE - Glitch Detect Disable - * 0b0..Enable - * 0b1..Disable - */ -#define SPC_LP_CFG_GLITCH_DETECT_DISABLE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_GLITCH_DETECT_DISABLE_SHIFT)) & SPC_LP_CFG_GLITCH_DETECT_DISABLE_MASK) - -#define SPC_LP_CFG_COREVDD_IVS_EN_MASK (0x20000U) -#define SPC_LP_CFG_COREVDD_IVS_EN_SHIFT (17U) -/*! COREVDD_IVS_EN - CORE VDD Internal Voltage Scaling (IVS) Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LP_CFG_COREVDD_IVS_EN(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_COREVDD_IVS_EN_SHIFT)) & SPC_LP_CFG_COREVDD_IVS_EN_MASK) - -#define SPC_LP_CFG_LPBUFF_EN_MASK (0x40000U) -#define SPC_LP_CFG_LPBUFF_EN_SHIFT (18U) -/*! LPBUFF_EN - CMP Bandgap Buffer Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LP_CFG_LPBUFF_EN(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_LPBUFF_EN_SHIFT)) & SPC_LP_CFG_LPBUFF_EN_MASK) - -#define SPC_LP_CFG_BGMODE_MASK (0x300000U) -#define SPC_LP_CFG_BGMODE_SHIFT (20U) -/*! BGMODE - Bandgap Mode - * 0b00..Bandgap disabled - * 0b01..Bandgap enabled, buffer disabled - * 0b10..Bandgap enabled, buffer enabled - * 0b11.. - */ -#define SPC_LP_CFG_BGMODE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_BGMODE_SHIFT)) & SPC_LP_CFG_BGMODE_MASK) - -#define SPC_LP_CFG_LP_IREFEN_MASK (0x800000U) -#define SPC_LP_CFG_LP_IREFEN_SHIFT (23U) -/*! LP_IREFEN - Low-Power IREF Enable - * 0b0..Disable for power saving in Deep Power Down mode - * 0b1..Enable - */ -#define SPC_LP_CFG_LP_IREFEN(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_LP_IREFEN_SHIFT)) & SPC_LP_CFG_LP_IREFEN_MASK) - -#define SPC_LP_CFG_CORE_LVDE_MASK (0x1000000U) -#define SPC_LP_CFG_CORE_LVDE_SHIFT (24U) -/*! CORE_LVDE - Core Low Voltage Detect Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LP_CFG_CORE_LVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_CORE_LVDE_SHIFT)) & SPC_LP_CFG_CORE_LVDE_MASK) - -#define SPC_LP_CFG_SYS_LVDE_MASK (0x2000000U) -#define SPC_LP_CFG_SYS_LVDE_SHIFT (25U) -/*! SYS_LVDE - System Low Voltage Detect Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LP_CFG_SYS_LVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_SYS_LVDE_SHIFT)) & SPC_LP_CFG_SYS_LVDE_MASK) - -#define SPC_LP_CFG_IO_LVDE_MASK (0x4000000U) -#define SPC_LP_CFG_IO_LVDE_SHIFT (26U) -/*! IO_LVDE - IO Low Voltage Detect Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LP_CFG_IO_LVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_IO_LVDE_SHIFT)) & SPC_LP_CFG_IO_LVDE_MASK) - -#define SPC_LP_CFG_CORE_HVDE_MASK (0x8000000U) -#define SPC_LP_CFG_CORE_HVDE_SHIFT (27U) -/*! CORE_HVDE - Core High Voltage Detect Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LP_CFG_CORE_HVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_CORE_HVDE_SHIFT)) & SPC_LP_CFG_CORE_HVDE_MASK) - -#define SPC_LP_CFG_SYS_HVDE_MASK (0x10000000U) -#define SPC_LP_CFG_SYS_HVDE_SHIFT (28U) -/*! SYS_HVDE - System High Voltage Detect Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LP_CFG_SYS_HVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_SYS_HVDE_SHIFT)) & SPC_LP_CFG_SYS_HVDE_MASK) - -#define SPC_LP_CFG_IO_HVDE_MASK (0x20000000U) -#define SPC_LP_CFG_IO_HVDE_SHIFT (29U) -/*! IO_HVDE - IO High Voltage Detect Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_LP_CFG_IO_HVDE(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG_IO_HVDE_SHIFT)) & SPC_LP_CFG_IO_HVDE_MASK) -/*! @} */ - -/*! @name LP_CFG1 - Low Power Mode Configuration 1 */ -/*! @{ */ - -#define SPC_LP_CFG1_SOC_CNTRL_MASK (0xFFFFFFFFU) -#define SPC_LP_CFG1_SOC_CNTRL_SHIFT (0U) -/*! SOC_CNTRL - Low-Power Configuration Chip Control */ -#define SPC_LP_CFG1_SOC_CNTRL(x) (((uint32_t)(((uint32_t)(x)) << SPC_LP_CFG1_SOC_CNTRL_SHIFT)) & SPC_LP_CFG1_SOC_CNTRL_MASK) -/*! @} */ - -/*! @name LPWKUP_DELAY - Low Power Wake-Up Delay */ -/*! @{ */ - -#define SPC_LPWKUP_DELAY_LPWKUP_DELAY_MASK (0xFFFFU) -#define SPC_LPWKUP_DELAY_LPWKUP_DELAY_SHIFT (0U) -/*! LPWKUP_DELAY - Low-Power Wake-Up Delay */ -#define SPC_LPWKUP_DELAY_LPWKUP_DELAY(x) (((uint32_t)(((uint32_t)(x)) << SPC_LPWKUP_DELAY_LPWKUP_DELAY_SHIFT)) & SPC_LPWKUP_DELAY_LPWKUP_DELAY_MASK) -/*! @} */ - -/*! @name ACTIVE_VDELAY - Active Voltage Trim Delay */ -/*! @{ */ - -#define SPC_ACTIVE_VDELAY_ACTIVE_VDELAY_MASK (0xFFFFU) -#define SPC_ACTIVE_VDELAY_ACTIVE_VDELAY_SHIFT (0U) -/*! ACTIVE_VDELAY - Active Voltage Delay */ -#define SPC_ACTIVE_VDELAY_ACTIVE_VDELAY(x) (((uint32_t)(((uint32_t)(x)) << SPC_ACTIVE_VDELAY_ACTIVE_VDELAY_SHIFT)) & SPC_ACTIVE_VDELAY_ACTIVE_VDELAY_MASK) -/*! @} */ - -/*! @name VD_STAT - Voltage Detect Status */ -/*! @{ */ - -#define SPC_VD_STAT_COREVDD_LVDF_MASK (0x1U) -#define SPC_VD_STAT_COREVDD_LVDF_SHIFT (0U) -/*! COREVDD_LVDF - Core Low-Voltage Detect Flag - * 0b0..Event not detected - * 0b1..Event detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_VD_STAT_COREVDD_LVDF(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_STAT_COREVDD_LVDF_SHIFT)) & SPC_VD_STAT_COREVDD_LVDF_MASK) - -#define SPC_VD_STAT_SYSVDD_LVDF_MASK (0x2U) -#define SPC_VD_STAT_SYSVDD_LVDF_SHIFT (1U) -/*! SYSVDD_LVDF - System Low-Voltage Detect Flag - * 0b0..Event not detected - * 0b1..Event detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_VD_STAT_SYSVDD_LVDF(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_STAT_SYSVDD_LVDF_SHIFT)) & SPC_VD_STAT_SYSVDD_LVDF_MASK) - -#define SPC_VD_STAT_IOVDD_LVDF_MASK (0x4U) -#define SPC_VD_STAT_IOVDD_LVDF_SHIFT (2U) -/*! IOVDD_LVDF - IO VDD LVD Flag - * 0b0..Event not detected - * 0b1..Event detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_VD_STAT_IOVDD_LVDF(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_STAT_IOVDD_LVDF_SHIFT)) & SPC_VD_STAT_IOVDD_LVDF_MASK) - -#define SPC_VD_STAT_COREVDD_HVDF_MASK (0x10U) -#define SPC_VD_STAT_COREVDD_HVDF_SHIFT (4U) -/*! COREVDD_HVDF - Core VDD HVD Flag - * 0b0..Event not detected - * 0b1..Event detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_VD_STAT_COREVDD_HVDF(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_STAT_COREVDD_HVDF_SHIFT)) & SPC_VD_STAT_COREVDD_HVDF_MASK) - -#define SPC_VD_STAT_SYSVDD_HVDF_MASK (0x20U) -#define SPC_VD_STAT_SYSVDD_HVDF_SHIFT (5U) -/*! SYSVDD_HVDF - System HVD Flag - * 0b0..Event not detected - * 0b1..Event detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_VD_STAT_SYSVDD_HVDF(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_STAT_SYSVDD_HVDF_SHIFT)) & SPC_VD_STAT_SYSVDD_HVDF_MASK) - -#define SPC_VD_STAT_IOVDD_HVDF_MASK (0x40U) -#define SPC_VD_STAT_IOVDD_HVDF_SHIFT (6U) -/*! IOVDD_HVDF - IO VDD HVD Flag - * 0b0..Event not detected - * 0b1..Event detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_VD_STAT_IOVDD_HVDF(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_STAT_IOVDD_HVDF_SHIFT)) & SPC_VD_STAT_IOVDD_HVDF_MASK) -/*! @} */ - -/*! @name VD_CORE_CFG - Core Voltage Detect Configuration */ -/*! @{ */ - -#define SPC_VD_CORE_CFG_LVDRE_MASK (0x1U) -#define SPC_VD_CORE_CFG_LVDRE_SHIFT (0U) -/*! LVDRE - Core LVD Reset Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_CORE_CFG_LVDRE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_CORE_CFG_LVDRE_SHIFT)) & SPC_VD_CORE_CFG_LVDRE_MASK) - -#define SPC_VD_CORE_CFG_LVDIE_MASK (0x2U) -#define SPC_VD_CORE_CFG_LVDIE_SHIFT (1U) -/*! LVDIE - Core LVD Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_CORE_CFG_LVDIE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_CORE_CFG_LVDIE_SHIFT)) & SPC_VD_CORE_CFG_LVDIE_MASK) - -#define SPC_VD_CORE_CFG_HVDRE_MASK (0x4U) -#define SPC_VD_CORE_CFG_HVDRE_SHIFT (2U) -/*! HVDRE - Core VDD HVD Reset Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_CORE_CFG_HVDRE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_CORE_CFG_HVDRE_SHIFT)) & SPC_VD_CORE_CFG_HVDRE_MASK) - -#define SPC_VD_CORE_CFG_HVDIE_MASK (0x8U) -#define SPC_VD_CORE_CFG_HVDIE_SHIFT (3U) -/*! HVDIE - Core VDD HVD Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_CORE_CFG_HVDIE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_CORE_CFG_HVDIE_SHIFT)) & SPC_VD_CORE_CFG_HVDIE_MASK) - -#define SPC_VD_CORE_CFG_LOCK_MASK (0x10000U) -#define SPC_VD_CORE_CFG_LOCK_SHIFT (16U) -/*! LOCK - Core Voltage Detect Reset Enable Lock - * 0b0..Allow - * 0b1..Deny - */ -#define SPC_VD_CORE_CFG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_CORE_CFG_LOCK_SHIFT)) & SPC_VD_CORE_CFG_LOCK_MASK) -/*! @} */ - -/*! @name VD_SYS_CFG - System Voltage Detect Configuration */ -/*! @{ */ - -#define SPC_VD_SYS_CFG_LVDRE_MASK (0x1U) -#define SPC_VD_SYS_CFG_LVDRE_SHIFT (0U) -/*! LVDRE - System LVD Reset Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_SYS_CFG_LVDRE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_SYS_CFG_LVDRE_SHIFT)) & SPC_VD_SYS_CFG_LVDRE_MASK) - -#define SPC_VD_SYS_CFG_LVDIE_MASK (0x2U) -#define SPC_VD_SYS_CFG_LVDIE_SHIFT (1U) -/*! LVDIE - System LVD Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_SYS_CFG_LVDIE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_SYS_CFG_LVDIE_SHIFT)) & SPC_VD_SYS_CFG_LVDIE_MASK) - -#define SPC_VD_SYS_CFG_HVDRE_MASK (0x4U) -#define SPC_VD_SYS_CFG_HVDRE_SHIFT (2U) -/*! HVDRE - System HVD Reset Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_SYS_CFG_HVDRE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_SYS_CFG_HVDRE_SHIFT)) & SPC_VD_SYS_CFG_HVDRE_MASK) - -#define SPC_VD_SYS_CFG_HVDIE_MASK (0x8U) -#define SPC_VD_SYS_CFG_HVDIE_SHIFT (3U) -/*! HVDIE - System HVD Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_SYS_CFG_HVDIE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_SYS_CFG_HVDIE_SHIFT)) & SPC_VD_SYS_CFG_HVDIE_MASK) - -#define SPC_VD_SYS_CFG_LOCK_MASK (0x10000U) -#define SPC_VD_SYS_CFG_LOCK_SHIFT (16U) -/*! LOCK - System Voltage Detect Reset Enable Lock - * 0b0..Allow - * 0b1..Deny - */ -#define SPC_VD_SYS_CFG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_SYS_CFG_LOCK_SHIFT)) & SPC_VD_SYS_CFG_LOCK_MASK) -/*! @} */ - -/*! @name VD_IO_CFG - IO Voltage Detect Configuration */ -/*! @{ */ - -#define SPC_VD_IO_CFG_LVDRE_MASK (0x1U) -#define SPC_VD_IO_CFG_LVDRE_SHIFT (0U) -/*! LVDRE - IO VDD LVD Reset Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_IO_CFG_LVDRE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_IO_CFG_LVDRE_SHIFT)) & SPC_VD_IO_CFG_LVDRE_MASK) - -#define SPC_VD_IO_CFG_LVDIE_MASK (0x2U) -#define SPC_VD_IO_CFG_LVDIE_SHIFT (1U) -/*! LVDIE - IO VDD LVD Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_IO_CFG_LVDIE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_IO_CFG_LVDIE_SHIFT)) & SPC_VD_IO_CFG_LVDIE_MASK) - -#define SPC_VD_IO_CFG_HVDRE_MASK (0x4U) -#define SPC_VD_IO_CFG_HVDRE_SHIFT (2U) -/*! HVDRE - IO VDD HVD Reset Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_IO_CFG_HVDRE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_IO_CFG_HVDRE_SHIFT)) & SPC_VD_IO_CFG_HVDRE_MASK) - -#define SPC_VD_IO_CFG_HVDIE_MASK (0x8U) -#define SPC_VD_IO_CFG_HVDIE_SHIFT (3U) -/*! HVDIE - IO VDD HVD Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_VD_IO_CFG_HVDIE(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_IO_CFG_HVDIE_SHIFT)) & SPC_VD_IO_CFG_HVDIE_MASK) - -#define SPC_VD_IO_CFG_LVSEL_MASK (0x100U) -#define SPC_VD_IO_CFG_LVSEL_SHIFT (8U) -/*! LVSEL - IO VDD Low-Voltage Level Select - * 0b0..High range - * 0b1..Low range - */ -#define SPC_VD_IO_CFG_LVSEL(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_IO_CFG_LVSEL_SHIFT)) & SPC_VD_IO_CFG_LVSEL_MASK) - -#define SPC_VD_IO_CFG_LOCK_MASK (0x10000U) -#define SPC_VD_IO_CFG_LOCK_SHIFT (16U) -/*! LOCK - IO Voltage Detect Reset Enable Lock - * 0b0..Allow - * 0b1..Deny - */ -#define SPC_VD_IO_CFG_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SPC_VD_IO_CFG_LOCK_SHIFT)) & SPC_VD_IO_CFG_LOCK_MASK) -/*! @} */ - -/*! @name EVD_CFG - External Voltage Domain Configuration */ -/*! @{ */ - -#define SPC_EVD_CFG_EVDISO_MASK (0x3FU) -#define SPC_EVD_CFG_EVDISO_SHIFT (0U) -/*! EVDISO - External Voltage Domain Isolation */ -#define SPC_EVD_CFG_EVDISO(x) (((uint32_t)(((uint32_t)(x)) << SPC_EVD_CFG_EVDISO_SHIFT)) & SPC_EVD_CFG_EVDISO_MASK) - -#define SPC_EVD_CFG_EVDLPISO_MASK (0x3F00U) -#define SPC_EVD_CFG_EVDLPISO_SHIFT (8U) -/*! EVDLPISO - External Voltage Domain Low-Power Isolation */ -#define SPC_EVD_CFG_EVDLPISO(x) (((uint32_t)(((uint32_t)(x)) << SPC_EVD_CFG_EVDLPISO_SHIFT)) & SPC_EVD_CFG_EVDLPISO_MASK) - -#define SPC_EVD_CFG_EVDSTAT_MASK (0x3F0000U) -#define SPC_EVD_CFG_EVDSTAT_SHIFT (16U) -/*! EVDSTAT - External Voltage Domain Status */ -#define SPC_EVD_CFG_EVDSTAT(x) (((uint32_t)(((uint32_t)(x)) << SPC_EVD_CFG_EVDSTAT_SHIFT)) & SPC_EVD_CFG_EVDSTAT_MASK) -/*! @} */ - -/*! @name GLITCH_DETECT_SC - Glitch Detect Status Control */ -/*! @{ */ - -#define SPC_GLITCH_DETECT_SC_CNT_SELECT_MASK (0x3U) -#define SPC_GLITCH_DETECT_SC_CNT_SELECT_SHIFT (0U) -/*! CNT_SELECT - Counter Select - * 0b00..0 - * 0b01..1 - * 0b10..2 - * 0b11..3 - */ -#define SPC_GLITCH_DETECT_SC_CNT_SELECT(x) (((uint32_t)(((uint32_t)(x)) << SPC_GLITCH_DETECT_SC_CNT_SELECT_SHIFT)) & SPC_GLITCH_DETECT_SC_CNT_SELECT_MASK) - -#define SPC_GLITCH_DETECT_SC_TIMEOUT_MASK (0x3CU) -#define SPC_GLITCH_DETECT_SC_TIMEOUT_SHIFT (2U) -/*! TIMEOUT - Timeout */ -#define SPC_GLITCH_DETECT_SC_TIMEOUT(x) (((uint32_t)(((uint32_t)(x)) << SPC_GLITCH_DETECT_SC_TIMEOUT_SHIFT)) & SPC_GLITCH_DETECT_SC_TIMEOUT_MASK) - -#define SPC_GLITCH_DETECT_SC_RE_MASK (0x40U) -#define SPC_GLITCH_DETECT_SC_RE_SHIFT (6U) -/*! RE - Glitch Detect Reset Enable - * 0b0..GLITCH_DETECT_FLAG[CNT_SELECT] does not generate POR/LVD reset - * 0b1..GLITCH_DETECT_FLAG[CNT_SELECT] does generate POR/LVD reset - */ -#define SPC_GLITCH_DETECT_SC_RE(x) (((uint32_t)(((uint32_t)(x)) << SPC_GLITCH_DETECT_SC_RE_SHIFT)) & SPC_GLITCH_DETECT_SC_RE_MASK) - -#define SPC_GLITCH_DETECT_SC_IE_MASK (0x80U) -#define SPC_GLITCH_DETECT_SC_IE_SHIFT (7U) -/*! IE - Glitch Detect Interrupt Enable - * 0b0..GLITCH_DETECT_FLAG[CNT_SELECT] does not generate hardware interrupt (user polling) - * 0b1..GLITCH_DETECT_FLAG[CNT_SELECT] does generate hardware interrupt - */ -#define SPC_GLITCH_DETECT_SC_IE(x) (((uint32_t)(((uint32_t)(x)) << SPC_GLITCH_DETECT_SC_IE_SHIFT)) & SPC_GLITCH_DETECT_SC_IE_MASK) - -#define SPC_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG_MASK (0xF00U) -#define SPC_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG_SHIFT (8U) -/*! GLITCH_DETECT_FLAG - GLITCH_DETECT_FLAG */ -#define SPC_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG(x) (((uint32_t)(((uint32_t)(x)) << SPC_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG_SHIFT)) & SPC_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG_MASK) - -#define SPC_GLITCH_DETECT_SC_LOCK_MASK (0x10000U) -#define SPC_GLITCH_DETECT_SC_LOCK_SHIFT (16U) -/*! LOCK - Glitch Detect Reset Enable Lock Bit - * 0b0..Writes to RE are allowed. - * 0b1..Writes to RE are ignored. - */ -#define SPC_GLITCH_DETECT_SC_LOCK(x) (((uint32_t)(((uint32_t)(x)) << SPC_GLITCH_DETECT_SC_LOCK_SHIFT)) & SPC_GLITCH_DETECT_SC_LOCK_MASK) -/*! @} */ - -/*! @name CORELDO_CFG - LDO_CORE Configuration */ -/*! @{ */ - -#define SPC_CORELDO_CFG_DPDOWN_PULLDOWN_DISABLE_MASK (0x10000U) -#define SPC_CORELDO_CFG_DPDOWN_PULLDOWN_DISABLE_SHIFT (16U) -/*! DPDOWN_PULLDOWN_DISABLE - LDO_CORE Deep Power Down Pulldown Disable - * 0b0..LDO_CORE pulldown in Deep Power Down not disabled - * 0b1..LDO_CORE pulldown in Deep Power Down disabled - */ -#define SPC_CORELDO_CFG_DPDOWN_PULLDOWN_DISABLE(x) (((uint32_t)(((uint32_t)(x)) << SPC_CORELDO_CFG_DPDOWN_PULLDOWN_DISABLE_SHIFT)) & SPC_CORELDO_CFG_DPDOWN_PULLDOWN_DISABLE_MASK) -/*! @} */ - -/*! @name SYSLDO_CFG - LDO_SYS Configuration */ -/*! @{ */ - -#define SPC_SYSLDO_CFG_ISINKEN_MASK (0x1U) -#define SPC_SYSLDO_CFG_ISINKEN_SHIFT (0U) -/*! ISINKEN - Current Sink Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_SYSLDO_CFG_ISINKEN(x) (((uint32_t)(((uint32_t)(x)) << SPC_SYSLDO_CFG_ISINKEN_SHIFT)) & SPC_SYSLDO_CFG_ISINKEN_MASK) -/*! @} */ - -/*! @name DCDC_CFG - DCDC Configuration */ -/*! @{ */ - -#define SPC_DCDC_CFG_FREQ_CNTRL_ON_MASK (0x1U) -#define SPC_DCDC_CFG_FREQ_CNTRL_ON_SHIFT (0U) -/*! FREQ_CNTRL_ON - DCDC Burst Frequency Control Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_DCDC_CFG_FREQ_CNTRL_ON(x) (((uint32_t)(((uint32_t)(x)) << SPC_DCDC_CFG_FREQ_CNTRL_ON_SHIFT)) & SPC_DCDC_CFG_FREQ_CNTRL_ON_MASK) - -#define SPC_DCDC_CFG_FREQ_CNTRL_MASK (0x3F00U) -#define SPC_DCDC_CFG_FREQ_CNTRL_SHIFT (8U) -/*! FREQ_CNTRL - DCDC Burst Frequency Control */ -#define SPC_DCDC_CFG_FREQ_CNTRL(x) (((uint32_t)(((uint32_t)(x)) << SPC_DCDC_CFG_FREQ_CNTRL_SHIFT)) & SPC_DCDC_CFG_FREQ_CNTRL_MASK) - -#define SPC_DCDC_CFG_BLEED_EN_MASK (0x80000U) -#define SPC_DCDC_CFG_BLEED_EN_SHIFT (19U) -/*! BLEED_EN - DCDC Bleed Enable - * 0b0..Do not add - * 0b1..Add - */ -#define SPC_DCDC_CFG_BLEED_EN(x) (((uint32_t)(((uint32_t)(x)) << SPC_DCDC_CFG_BLEED_EN_SHIFT)) & SPC_DCDC_CFG_BLEED_EN_MASK) -/*! @} */ - -/*! @name DCDC_BURST_CFG - DCDC Burst Configuration */ -/*! @{ */ - -#define SPC_DCDC_BURST_CFG_BURST_REQ_MASK (0x1U) -#define SPC_DCDC_BURST_CFG_BURST_REQ_SHIFT (0U) -/*! BURST_REQ - Software Burst Request - * 0b0..Do not generate - * 0b1..Generate - */ -#define SPC_DCDC_BURST_CFG_BURST_REQ(x) (((uint32_t)(((uint32_t)(x)) << SPC_DCDC_BURST_CFG_BURST_REQ_SHIFT)) & SPC_DCDC_BURST_CFG_BURST_REQ_MASK) - -#define SPC_DCDC_BURST_CFG_EXT_BURST_EN_MASK (0x2U) -#define SPC_DCDC_BURST_CFG_EXT_BURST_EN_SHIFT (1U) -/*! EXT_BURST_EN - External Burst Request Enable - * 0b0..Disable - * 0b1..Enable - */ -#define SPC_DCDC_BURST_CFG_EXT_BURST_EN(x) (((uint32_t)(((uint32_t)(x)) << SPC_DCDC_BURST_CFG_EXT_BURST_EN_SHIFT)) & SPC_DCDC_BURST_CFG_EXT_BURST_EN_MASK) - -#define SPC_DCDC_BURST_CFG_BURST_ACK_MASK (0x8U) -#define SPC_DCDC_BURST_CFG_BURST_ACK_SHIFT (3U) -/*! BURST_ACK - Burst Acknowledge Flag - * 0b0..Did not complete - * 0b1..Completed - * 0b0..No effect - * 0b1..Clear the flag - */ -#define SPC_DCDC_BURST_CFG_BURST_ACK(x) (((uint32_t)(((uint32_t)(x)) << SPC_DCDC_BURST_CFG_BURST_ACK_SHIFT)) & SPC_DCDC_BURST_CFG_BURST_ACK_MASK) - -#define SPC_DCDC_BURST_CFG_PULSE_REFRESH_CNT_MASK (0xFFFF0000U) -#define SPC_DCDC_BURST_CFG_PULSE_REFRESH_CNT_SHIFT (16U) -/*! PULSE_REFRESH_CNT - Refresh Count Value */ -#define SPC_DCDC_BURST_CFG_PULSE_REFRESH_CNT(x) (((uint32_t)(((uint32_t)(x)) << SPC_DCDC_BURST_CFG_PULSE_REFRESH_CNT_SHIFT)) & SPC_DCDC_BURST_CFG_PULSE_REFRESH_CNT_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group SPC_Register_Masks */ - - -/* SPC - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral SPC0 base address */ - #define SPC0_BASE (0x50045000u) - /** Peripheral SPC0 base address */ - #define SPC0_BASE_NS (0x40045000u) - /** Peripheral SPC0 base pointer */ - #define SPC0 ((SPC_Type *)SPC0_BASE) - /** Peripheral SPC0 base pointer */ - #define SPC0_NS ((SPC_Type *)SPC0_BASE_NS) - /** Array initializer of SPC peripheral base addresses */ - #define SPC_BASE_ADDRS { SPC0_BASE } - /** Array initializer of SPC peripheral base pointers */ - #define SPC_BASE_PTRS { SPC0 } - /** Array initializer of SPC peripheral base addresses */ - #define SPC_BASE_ADDRS_NS { SPC0_BASE_NS } - /** Array initializer of SPC peripheral base pointers */ - #define SPC_BASE_PTRS_NS { SPC0_NS } -#else - /** Peripheral SPC0 base address */ - #define SPC0_BASE (0x40045000u) - /** Peripheral SPC0 base pointer */ - #define SPC0 ((SPC_Type *)SPC0_BASE) - /** Array initializer of SPC peripheral base addresses */ - #define SPC_BASE_ADDRS { SPC0_BASE } - /** Array initializer of SPC peripheral base pointers */ - #define SPC_BASE_PTRS { SPC0 } -#endif - -/*! - * @} - */ /* end of group SPC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- SYSCON Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SYSCON_Peripheral_Access_Layer SYSCON Peripheral Access Layer - * @{ - */ - -/** SYSCON - Register Layout Typedef */ -typedef struct { - uint8_t RESERVED_0[16]; - __IO uint32_t AHBMATPRIO; /**< AHB Matrix Priority Control, offset: 0x10 */ - uint8_t RESERVED_1[36]; - __IO uint32_t CPU0STCKCAL; /**< Secure CPU0 System Tick Calibration, offset: 0x38 */ - __IO uint32_t CPU0NSTCKCAL; /**< Non-Secure CPU0 System Tick Calibration, offset: 0x3C */ - __IO uint32_t CPU1STCKCAL; /**< System tick calibration for CPU1, offset: 0x40 */ - uint8_t RESERVED_2[4]; - __IO uint32_t NMISRC; /**< NMI Source Select, offset: 0x48 */ - uint8_t RESERVED_3[180]; - __IO uint32_t PRESETCTRL0; /**< Peripheral Reset Control 0, offset: 0x100 */ - __IO uint32_t PRESETCTRL1; /**< Peripheral Reset Control 1, offset: 0x104 */ - __IO uint32_t PRESETCTRL2; /**< Peripheral Reset Control 2, offset: 0x108 */ - __IO uint32_t PRESETCTRL3; /**< Peripheral Reset Control 3, offset: 0x10C */ - uint8_t RESERVED_4[16]; - __O uint32_t PRESETCTRLSET[4]; /**< Peripheral Reset Control Set, array offset: 0x120, array step: 0x4 */ - uint8_t RESERVED_5[16]; - __O uint32_t PRESETCTRLCLR[4]; /**< Peripheral Reset Control Clear, array offset: 0x140, array step: 0x4 */ - uint8_t RESERVED_6[176]; - __IO uint32_t AHBCLKCTRL0; /**< AHB Clock Control 0, offset: 0x200 */ - __IO uint32_t AHBCLKCTRL1; /**< AHB Clock Control 1, offset: 0x204 */ - __IO uint32_t AHBCLKCTRL2; /**< AHB Clock Control 2, offset: 0x208 */ - __IO uint32_t AHBCLKCTRL3; /**< AHB Clock Control 3, offset: 0x20C */ - uint8_t RESERVED_7[16]; - __O uint32_t AHBCLKCTRLSET[4]; /**< AHB Clock Control Set, array offset: 0x220, array step: 0x4 */ - uint8_t RESERVED_8[16]; - __O uint32_t AHBCLKCTRLCLR[4]; /**< AHB Clock Control Clear, array offset: 0x240, array step: 0x4 */ - uint8_t RESERVED_9[16]; - __IO uint32_t SYSTICKCLKSEL0; /**< CPU0 System Tick Timer Source Select, offset: 0x260 */ - __IO uint32_t SYSTICKCLKSEL1; /**< CPU1 System Tick Timer Source Select, offset: 0x264 */ - __IO uint32_t TRACECLKSEL; /**< Trace Clock Source Select, offset: 0x268 */ - __IO uint32_t CTIMERCLKSEL[5]; /**< CTIMER Clock Source Select, array offset: 0x26C, array step: 0x4 */ - uint8_t RESERVED_10[8]; - __IO uint32_t CLKOUTSEL; /**< CLKOUT Clock Source Select, offset: 0x288 */ - uint8_t RESERVED_11[24]; - __IO uint32_t ADC0CLKSEL; /**< ADC0 Clock Source Select, offset: 0x2A4 */ - __IO uint32_t USB0CLKSEL; /**< USB-FS Clock Source Select, offset: 0x2A8 */ - uint8_t RESERVED_12[4]; - __IO uint32_t FCCLKSEL[10]; /**< LP_FLEXCOMM Clock Source Select for Fractional Rate Divider, array offset: 0x2B0, array step: 0x4 */ - uint8_t RESERVED_13[24]; - __IO uint32_t SCTCLKSEL; /**< SCTimer/PWM Clock Source Select, offset: 0x2F0 */ - uint8_t RESERVED_14[12]; - __IO uint32_t SYSTICKCLKDIV[2]; /**< CPU0 System Tick Timer Divider..CPU1 System Tick Timer Divider, array offset: 0x300, array step: 0x4 */ - __IO uint32_t TRACECLKDIV; /**< TRACE Clock Divider, offset: 0x308 */ - uint8_t RESERVED_15[68]; - __IO uint32_t TSICLKSEL; /**< TSI Function Clock Source Select, offset: 0x350 */ - uint8_t RESERVED_16[12]; - __IO uint32_t SINCFILTCLKSEL; /**< SINC FILTER Function Clock Source Select, offset: 0x360 */ - uint8_t RESERVED_17[20]; - __IO uint32_t SLOWCLKDIV; /**< SLOW_CLK Clock Divider, offset: 0x378 */ - __IO uint32_t TSICLKDIV; /**< TSI Function Clock Divider, offset: 0x37C */ - __IO uint32_t AHBCLKDIV; /**< System Clock Divider, offset: 0x380 */ - __IO uint32_t CLKOUTDIV; /**< CLKOUT Clock Divider, offset: 0x384 */ - __IO uint32_t FROHFDIV; /**< FRO_HF_DIV Clock Divider, offset: 0x388 */ - __IO uint32_t WDT0CLKDIV; /**< WDT0 Clock Divider, offset: 0x38C */ - uint8_t RESERVED_18[4]; - __IO uint32_t ADC0CLKDIV; /**< ADC0 Clock Divider, offset: 0x394 */ - __IO uint32_t USB0CLKDIV; /**< USB-FS Clock Divider, offset: 0x398 */ - uint8_t RESERVED_19[24]; - __IO uint32_t SCTCLKDIV; /**< SCT/PWM Clock Divider, offset: 0x3B4 */ - uint8_t RESERVED_20[12]; - __IO uint32_t PLLCLKDIV; /**< PLL Clock Divider, offset: 0x3C4 */ - uint8_t RESERVED_21[8]; - __IO uint32_t CTIMERCLKDIV[5]; /**< CTimer Clock Divider, array offset: 0x3D0, array step: 0x4 */ - __IO uint32_t PLL1CLK0DIV; /**< PLL1 Clock 0 Divider, offset: 0x3E4 */ - __IO uint32_t PLL1CLK1DIV; /**< PLL1 Clock 1 Divider, offset: 0x3E8 */ - uint8_t RESERVED_22[4]; - __IO uint32_t UTICKCLKDIV; /**< UTICK Clock Divider, offset: 0x3F0 */ - __IO uint32_t CLKOUT_FRGCTRL; /**< CLKOUT FRG Control, offset: 0x3F4 */ - uint8_t RESERVED_23[4]; - __IO uint32_t CLKUNLOCK; /**< Clock Configuration Unlock, offset: 0x3FC */ - __IO uint32_t NVM_CTRL; /**< NVM Control, offset: 0x400 */ - __IO uint32_t ROMCR; /**< ROM Wait State, offset: 0x404 */ - uint8_t RESERVED_24[12]; - __IO uint32_t SMARTDMAINT; /**< SmartDMA Interrupt Hijack, offset: 0x414 */ - uint8_t RESERVED_25[76]; - __IO uint32_t ADC1CLKSEL; /**< ADC1 Clock Source Select, offset: 0x464 */ - __IO uint32_t ADC1CLKDIV; /**< ADC1 Clock Divider, offset: 0x468 */ - uint8_t RESERVED_26[4]; - __IO uint32_t RAM_INTERLEAVE; /**< Control PKC RAM Interleave Access, offset: 0x470 */ - uint8_t RESERVED_27[28]; - struct { /* offset: 0x490, array step: 0x8 */ - __IO uint32_t CLKSEL; /**< DAC0 Functional Clock Selection..DAC2 Functional Clock Selection, array offset: 0x490, array step: 0x8 */ - __IO uint32_t CLKDIV; /**< DAC0 functional clock divider..DAC2 functional clock divider, array offset: 0x494, array step: 0x8 */ - } DAC[3]; - __IO uint32_t FLEXSPICLKSEL; /**< FlexSPI Clock Selection, offset: 0x4A8 */ - __IO uint32_t FLEXSPICLKDIV; /**< FlexSPI Clock Divider, offset: 0x4AC */ - uint8_t RESERVED_28[124]; - __IO uint32_t PLLCLKDIVSEL; /**< PLL Clock Divider Clock Selection, offset: 0x52C */ - __IO uint32_t I3C0FCLKSEL; /**< I3C0 Functional Clock Selection, offset: 0x530 */ - __IO uint32_t I3C0FCLKSTCSEL; /**< I3C0 FCLK_STC Clock Selection, offset: 0x534 */ - __IO uint32_t I3C0FCLKSTCDIV; /**< I3C0 FCLK_STC Clock Divider, offset: 0x538 */ - __IO uint32_t I3C0FCLKSDIV; /**< I3C0 FCLK Slow Clock Divider, offset: 0x53C */ - __IO uint32_t I3C0FCLKDIV; /**< I3C0 Functional Clock FCLK Divider, offset: 0x540 */ - __IO uint32_t I3C0FCLKSSEL; /**< I3C0 FCLK Slow Selection, offset: 0x544 */ - __IO uint32_t MICFILFCLKSEL; /**< MICFIL Clock Selection, offset: 0x548 */ - __IO uint32_t MICFILFCLKDIV; /**< MICFIL Clock Division, offset: 0x54C */ - uint8_t RESERVED_29[8]; - __IO uint32_t USDHCCLKSEL; /**< uSDHC Clock Selection, offset: 0x558 */ - __IO uint32_t USDHCCLKDIV; /**< uSDHC Function Clock Divider, offset: 0x55C */ - __IO uint32_t FLEXIOCLKSEL; /**< FLEXIO Clock Selection, offset: 0x560 */ - __IO uint32_t FLEXIOCLKDIV; /**< FLEXIO Function Clock Divider, offset: 0x564 */ - uint8_t RESERVED_30[56]; - __IO uint32_t FLEXCAN0CLKSEL; /**< FLEXCAN0 Clock Selection, offset: 0x5A0 */ - __IO uint32_t FLEXCAN0CLKDIV; /**< FLEXCAN0 Function Clock Divider, offset: 0x5A4 */ - __IO uint32_t FLEXCAN1CLKSEL; /**< FLEXCAN1 Clock Selection, offset: 0x5A8 */ - __IO uint32_t FLEXCAN1CLKDIV; /**< FLEXCAN1 Function Clock Divider, offset: 0x5AC */ - __IO uint32_t ENETRMIICLKSEL; /**< Ethernet RMII Clock Selection, offset: 0x5B0 */ - __IO uint32_t ENETRMIICLKDIV; /**< Ethernet RMII Function Clock Divider, offset: 0x5B4 */ - __IO uint32_t ENETPTPREFCLKSEL; /**< Ethernet PTP REF Clock Selection, offset: 0x5B8 */ - __IO uint32_t ENETPTPREFCLKDIV; /**< Ethernet PTP REF Function Clock Divider, offset: 0x5BC */ - __IO uint32_t ENET_PHY_INTF_SEL; /**< Ethernet PHY Interface Select, offset: 0x5C0 */ - __IO uint32_t ENET_SBD_FLOW_CTRL; /**< Sideband Flow Control, offset: 0x5C4 */ - uint8_t RESERVED_31[12]; - __IO uint32_t EWM0CLKSEL; /**< EWM0 Clock Selection, offset: 0x5D4 */ - __IO uint32_t WDT1CLKSEL; /**< WDT1 Clock Selection, offset: 0x5D8 */ - __IO uint32_t WDT1CLKDIV; /**< WDT1 Function Clock Divider, offset: 0x5DC */ - __IO uint32_t OSTIMERCLKSEL; /**< OSTIMER Clock Selection, offset: 0x5E0 */ - uint8_t RESERVED_32[12]; - __IO uint32_t CMP0FCLKSEL; /**< CMP0 Function Clock Selection, offset: 0x5F0 */ - __IO uint32_t CMP0FCLKDIV; /**< CMP0 Function Clock Divider, offset: 0x5F4 */ - __IO uint32_t CMP0RRCLKSEL; /**< CMP0 Round Robin Clock Selection, offset: 0x5F8 */ - __IO uint32_t CMP0RRCLKDIV; /**< CMP0 Round Robin Clock Divider, offset: 0x5FC */ - __IO uint32_t CMP1FCLKSEL; /**< CMP1 Function Clock Selection, offset: 0x600 */ - __IO uint32_t CMP1FCLKDIV; /**< CMP1 Function Clock Divider, offset: 0x604 */ - __IO uint32_t CMP1RRCLKSEL; /**< CMP1 Round Robin Clock Source Select, offset: 0x608 */ - __IO uint32_t CMP1RRCLKDIV; /**< CMP1 Round Robin Clock Division, offset: 0x60C */ - __IO uint32_t CMP2FCLKSEL; /**< CMP2 Function Clock Source Select, offset: 0x610 */ - __IO uint32_t CMP2FCLKDIV; /**< CMP2 Function Clock Division, offset: 0x614 */ - __IO uint32_t CMP2RRCLKSEL; /**< CMP2 Round Robin Clock Source Select, offset: 0x618 */ - __IO uint32_t CMP2RRCLKDIV; /**< CMP2 Round Robin Clock Division, offset: 0x61C */ - uint8_t RESERVED_33[480]; - __IO uint32_t CPUCTRL; /**< CPU Control for Multiple Processors, offset: 0x800 */ - __IO uint32_t CPBOOT; /**< Coprocessor Boot Address, offset: 0x804 */ - uint8_t RESERVED_34[4]; - __I uint32_t CPUSTAT; /**< CPU Status, offset: 0x80C */ - uint8_t RESERVED_35[20]; - __IO uint32_t LPCAC_CTRL; /**< LPCAC Control, offset: 0x824 */ - uint8_t RESERVED_36[40]; - __IO uint32_t FLEXCOMMCLKDIV[10]; /**< LP_FLEXCOMM Clock Divider, array offset: 0x850, array step: 0x4 */ - __IO uint32_t UTICKCLKSEL; /**< UTICK Function Clock Source Select, offset: 0x878 */ - uint8_t RESERVED_37[4]; - __IO uint32_t SAI0CLKSEL; /**< SAI0 Function Clock Source Select, offset: 0x880 */ - __IO uint32_t SAI1CLKSEL; /**< SAI1 Function Clock Source Select, offset: 0x884 */ - __IO uint32_t SAI0CLKDIV; /**< SAI0 Function Clock Division, offset: 0x888 */ - __IO uint32_t SAI1CLKDIV; /**< SAI1 Function Clock Division, offset: 0x88C */ - __IO uint32_t EMVSIM0CLKSEL; /**< EMVSIM0 Clock Source Select, offset: 0x890 */ - __IO uint32_t EMVSIM1CLKSEL; /**< EMVSIM1 Clock Source Select, offset: 0x894 */ - __IO uint32_t EMVSIM0CLKDIV; /**< EMVSIM0 Function Clock Division, offset: 0x898 */ - __IO uint32_t EMVSIM1CLKDIV; /**< EMVSIM1 Function Clock Division, offset: 0x89C */ - uint8_t RESERVED_38[176]; - __IO uint32_t KEY_RETAIN_CTRL; /**< Key Retain Control, offset: 0x950 */ - uint8_t RESERVED_39[12]; - __IO uint32_t REF_CLK_CTRL; /**< FRO 48MHz Reference Clock Control, offset: 0x960 */ - __O uint32_t REF_CLK_CTRL_SET; /**< FRO 48MHz Reference Clock Control Set, offset: 0x964 */ - __O uint32_t REF_CLK_CTRL_CLR; /**< FRO 48MHz Reference Clock Control Clear, offset: 0x968 */ - __IO uint32_t GDET_CTRL[2]; /**< GDET Control Register, array offset: 0x96C, array step: 0x4 */ - __IO uint32_t ELS_ASSET_PROT; /**< ELS Asset Protection Register, offset: 0x974 */ - __IO uint32_t ELS_LOCK_CTRL; /**< ELS Lock Control, offset: 0x978 */ - __IO uint32_t ELS_LOCK_CTRL_DP; /**< ELS Lock Control DP, offset: 0x97C */ - __I uint32_t ELS_OTP_LC_STATE; /**< Life Cycle State Register, offset: 0x980 */ - __I uint32_t ELS_OTP_LC_STATE_DP; /**< Life Cycle State Register (Duplicate), offset: 0x984 */ - __IO uint32_t ELS_TEMPORAL_STATE; /**< ELS Temporal State, offset: 0x988 */ - __IO uint32_t ELS_KDF_MASK; /**< Key Derivation Function Mask, offset: 0x98C */ - uint8_t RESERVED_40[64]; - __I uint32_t ELS_AS_CFG0; /**< ELS AS Configuration, offset: 0x9D0 */ - __I uint32_t ELS_AS_CFG1; /**< ELS AS Configuration1, offset: 0x9D4 */ - __I uint32_t ELS_AS_CFG2; /**< ELS AS Configuration2, offset: 0x9D8 */ - __I uint32_t ELS_AS_CFG3; /**< ELS AS Configuration3, offset: 0x9DC */ - __I uint32_t ELS_AS_ST0; /**< ELS AS State Register, offset: 0x9E0 */ - __I uint32_t ELS_AS_ST1; /**< ELS AS State1, offset: 0x9E4 */ - __I uint32_t ELS_AS_BOOT_LOG0; /**< Boot state captured during boot: Main ROM log, offset: 0x9E8 */ - __I uint32_t ELS_AS_BOOT_LOG1; /**< Boot state captured during boot: Library log, offset: 0x9EC */ - __I uint32_t ELS_AS_BOOT_LOG2; /**< Boot state captured during boot: Hardware status signals log, offset: 0x9F0 */ - __I uint32_t ELS_AS_BOOT_LOG3; /**< Boot state captured during boot: Security log, offset: 0x9F4 */ - __I uint32_t ELS_AS_FLAG0; /**< ELS AS Flag0, offset: 0x9F8 */ - __I uint32_t ELS_AS_FLAG1; /**< ELS AS Flag1, offset: 0x9FC */ - uint8_t RESERVED_41[24]; - __IO uint32_t CLOCK_CTRL; /**< Clock Control, offset: 0xA18 */ - uint8_t RESERVED_42[276]; - __IO uint32_t I3C1FCLKSEL; /**< I3C1 Functional Clock Selection, offset: 0xB30 */ - __IO uint32_t I3C1FCLKSTCSEL; /**< Selects the I3C1 Time Control clock, offset: 0xB34 */ - __IO uint32_t I3C1FCLKSTCDIV; /**< I3C1 FCLK_STC Clock Divider, offset: 0xB38 */ - __IO uint32_t I3C1FCLKSDIV; /**< I3C1 FCLK Slow clock Divider, offset: 0xB3C */ - __IO uint32_t I3C1FCLKDIV; /**< I3C1 Functional Clock FCLK Divider, offset: 0xB40 */ - __IO uint32_t I3C1FCLKSSEL; /**< I3C1 FCLK Slow Selection, offset: 0xB44 */ - uint8_t RESERVED_43[8]; - __IO uint32_t ETB_STATUS; /**< ETB Counter Status Register, offset: 0xB50 */ - __IO uint32_t ETB_COUNTER_CTRL; /**< ETB Counter Control Register, offset: 0xB54 */ - __IO uint32_t ETB_COUNTER_RELOAD; /**< ETB Counter Reload Register, offset: 0xB58 */ - __I uint32_t ETB_COUNTER_VALUE; /**< ETB Counter Value Register, offset: 0xB5C */ - __IO uint32_t GRAY_CODE_LSB; /**< Gray to Binary Converter Gray code_gray[31:0], offset: 0xB60 */ - __IO uint32_t GRAY_CODE_MSB; /**< Gray to Binary Converter Gray code_gray[41:32], offset: 0xB64 */ - __I uint32_t BINARY_CODE_LSB; /**< Gray to Binary Converter Binary Code [31:0], offset: 0xB68 */ - __I uint32_t BINARY_CODE_MSB; /**< Gray to Binary Converter Binary Code [41:32], offset: 0xB6C */ - uint8_t RESERVED_44[660]; - __IO uint32_t AUTOCLKGATEOVERRIDE; /**< Control Automatic Clock Gating, offset: 0xE04 */ - uint8_t RESERVED_45[36]; - __IO uint32_t AUTOCLKGATEOVERRIDEC; /**< Control Automatic Clock Gating C, offset: 0xE2C */ - uint8_t RESERVED_46[8]; - __IO uint32_t PWM0SUBCTL; /**< PWM0 Submodule Control, offset: 0xE38 */ - __IO uint32_t PWM1SUBCTL; /**< PWM1 Submodule Control, offset: 0xE3C */ - __IO uint32_t CTIMERGLOBALSTARTEN; /**< CTIMER Global Start Enable, offset: 0xE40 */ - __IO uint32_t ECC_ENABLE_CTRL; /**< RAM ECC Enable Control, offset: 0xE44 */ - uint8_t RESERVED_47[344]; - __IO uint32_t DEBUG_LOCK_EN; /**< Control Write Access to Security, offset: 0xFA0 */ - __IO uint32_t DEBUG_FEATURES; /**< Cortex Debug Features Control, offset: 0xFA4 */ - __IO uint32_t DEBUG_FEATURES_DP; /**< Cortex Debug Features Control (Duplicate), offset: 0xFA8 */ - uint8_t RESERVED_48[8]; - __IO uint32_t SWD_ACCESS_CPU[2]; /**< CPU0 Software Debug Access..CPU1 Software Debug Access, array offset: 0xFB4, array step: 0x4 */ - uint8_t RESERVED_49[4]; - __IO uint32_t DEBUG_AUTH_BEACON; /**< Debug Authentication BEACON, offset: 0xFC0 */ - __IO uint32_t SWD_ACCESS_DSP; /**< DSP Software Debug Access, offset: 0xFC4 */ - uint8_t RESERVED_50[40]; - __I uint32_t JTAG_ID; /**< JTAG Chip ID, offset: 0xFF0 */ - __I uint32_t DEVICE_TYPE; /**< Device Type, offset: 0xFF4 */ - __I uint32_t DEVICE_ID0; /**< Device ID, offset: 0xFF8 */ - __I uint32_t DIEID; /**< Chip Revision ID and Number, offset: 0xFFC */ -} SYSCON_Type; - -/* ---------------------------------------------------------------------------- - -- SYSCON Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SYSCON_Register_Masks SYSCON Register Masks - * @{ - */ - -/*! @name AHBMATPRIO - AHB Matrix Priority Control */ -/*! @{ */ - -#define SYSCON_AHBMATPRIO_PRI_CPU0_CBUS_MASK (0x3U) -#define SYSCON_AHBMATPRIO_PRI_CPU0_CBUS_SHIFT (0U) -/*! PRI_CPU0_CBUS - CPU0 C-AHB bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_PRI_CPU0_CBUS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_PRI_CPU0_CBUS_SHIFT)) & SYSCON_AHBMATPRIO_PRI_CPU0_CBUS_MASK) - -#define SYSCON_AHBMATPRIO_PRI_CPU0_SBUS_MASK (0xCU) -#define SYSCON_AHBMATPRIO_PRI_CPU0_SBUS_SHIFT (2U) -/*! PRI_CPU0_SBUS - CPU0 S-AHB bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_PRI_CPU0_SBUS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_PRI_CPU0_SBUS_SHIFT)) & SYSCON_AHBMATPRIO_PRI_CPU0_SBUS_MASK) - -#define SYSCON_AHBMATPRIO_PRI_CPU1_SBUS_SmartDMA_D_MASK (0x30U) -#define SYSCON_AHBMATPRIO_PRI_CPU1_SBUS_SmartDMA_D_SHIFT (4U) -/*! PRI_CPU1_SBUS_SmartDMA_D - CPU1 S-AHB/SmartDMA-D bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_PRI_CPU1_SBUS_SmartDMA_D(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_PRI_CPU1_SBUS_SmartDMA_D_SHIFT)) & SYSCON_AHBMATPRIO_PRI_CPU1_SBUS_SmartDMA_D_MASK) - -#define SYSCON_AHBMATPRIO_PRI_CPU1_CBUS_SmartDMA_I_MASK (0xC0U) -#define SYSCON_AHBMATPRIO_PRI_CPU1_CBUS_SmartDMA_I_SHIFT (6U) -/*! PRI_CPU1_CBUS_SmartDMA_I - CPU1 C-AHB/SmartDMA-I bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_PRI_CPU1_CBUS_SmartDMA_I(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_PRI_CPU1_CBUS_SmartDMA_I_SHIFT)) & SYSCON_AHBMATPRIO_PRI_CPU1_CBUS_SmartDMA_I_MASK) - -#define SYSCON_AHBMATPRIO_DMA0_MASK (0x300U) -#define SYSCON_AHBMATPRIO_DMA0_SHIFT (8U) -/*! DMA0 - DMA0 controller bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_DMA0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_DMA0_SHIFT)) & SYSCON_AHBMATPRIO_DMA0_MASK) - -#define SYSCON_AHBMATPRIO_DMA1_MASK (0xC00U) -#define SYSCON_AHBMATPRIO_DMA1_SHIFT (10U) -/*! DMA1 - DMA1 controller bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_DMA1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_DMA1_SHIFT)) & SYSCON_AHBMATPRIO_DMA1_MASK) - -#define SYSCON_AHBMATPRIO_PRI_PKC_ELS_MASK (0x3000U) -#define SYSCON_AHBMATPRIO_PRI_PKC_ELS_SHIFT (12U) -/*! PRI_PKC_ELS - PKC and ELS bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_PRI_PKC_ELS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_PRI_PKC_ELS_SHIFT)) & SYSCON_AHBMATPRIO_PRI_PKC_ELS_MASK) - -#define SYSCON_AHBMATPRIO_PRI_NPU_PQ_MASK (0xC000U) -#define SYSCON_AHBMATPRIO_PRI_NPU_PQ_SHIFT (14U) -/*! PRI_NPU_PQ - NPU O bus and Powerquad bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_PRI_NPU_PQ(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_PRI_NPU_PQ_SHIFT)) & SYSCON_AHBMATPRIO_PRI_NPU_PQ_MASK) - -#define SYSCON_AHBMATPRIO_PRI_COOLFLUX_I_MASK (0x30000U) -#define SYSCON_AHBMATPRIO_PRI_COOLFLUX_I_SHIFT (16U) -/*! PRI_COOLFLUX_I - CoolFlux I bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_PRI_COOLFLUX_I(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_PRI_COOLFLUX_I_SHIFT)) & SYSCON_AHBMATPRIO_PRI_COOLFLUX_I_MASK) - -#define SYSCON_AHBMATPRIO_PRI_COOLFLUX_X_MASK (0xC0000U) -#define SYSCON_AHBMATPRIO_PRI_COOLFLUX_X_SHIFT (18U) -/*! PRI_COOLFLUX_X - CoolFlux X bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_PRI_COOLFLUX_X(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_PRI_COOLFLUX_X_SHIFT)) & SYSCON_AHBMATPRIO_PRI_COOLFLUX_X_MASK) - -#define SYSCON_AHBMATPRIO_PRI_COOLFLUX_Y_ESPI_MASK (0x300000U) -#define SYSCON_AHBMATPRIO_PRI_COOLFLUX_Y_ESPI_SHIFT (20U) -/*! PRI_COOLFLUX_Y_ESPI - CoolFlux Y bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_PRI_COOLFLUX_Y_ESPI(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_PRI_COOLFLUX_Y_ESPI_SHIFT)) & SYSCON_AHBMATPRIO_PRI_COOLFLUX_Y_ESPI_MASK) - -#define SYSCON_AHBMATPRIO_PRI_NPU_D_MASK (0xC00000U) -#define SYSCON_AHBMATPRIO_PRI_NPU_D_SHIFT (22U) -/*! PRI_NPU_D - NPU D bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_PRI_NPU_D(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_PRI_NPU_D_SHIFT)) & SYSCON_AHBMATPRIO_PRI_NPU_D_MASK) - -#define SYSCON_AHBMATPRIO_PRI_USB_FS_ENET_MASK (0x3000000U) -#define SYSCON_AHBMATPRIO_PRI_USB_FS_ENET_SHIFT (24U) -/*! PRI_USB_FS_ENET - USB-FS and ENET bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_PRI_USB_FS_ENET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_PRI_USB_FS_ENET_SHIFT)) & SYSCON_AHBMATPRIO_PRI_USB_FS_ENET_MASK) - -#define SYSCON_AHBMATPRIO_PRI_USB_HS_MASK (0xC000000U) -#define SYSCON_AHBMATPRIO_PRI_USB_HS_SHIFT (26U) -/*! PRI_USB_HS - USB-HS bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_PRI_USB_HS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_PRI_USB_HS_SHIFT)) & SYSCON_AHBMATPRIO_PRI_USB_HS_MASK) - -#define SYSCON_AHBMATPRIO_PRI_USDHC_MASK (0x30000000U) -#define SYSCON_AHBMATPRIO_PRI_USDHC_SHIFT (28U) -/*! PRI_USDHC - USDHC bus master priority level - * 0b00..level 0 - * 0b01..level 1 - * 0b10..level 2 - * 0b11..level 3 - */ -#define SYSCON_AHBMATPRIO_PRI_USDHC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBMATPRIO_PRI_USDHC_SHIFT)) & SYSCON_AHBMATPRIO_PRI_USDHC_MASK) -/*! @} */ - -/*! @name CPU0STCKCAL - Secure CPU0 System Tick Calibration */ -/*! @{ */ - -#define SYSCON_CPU0STCKCAL_TENMS_MASK (0xFFFFFFU) -#define SYSCON_CPU0STCKCAL_TENMS_SHIFT (0U) -/*! TENMS - Reload value for 10 ms (100 Hz) timing, subject to system clock skew errors. If the - * value reads as zero, the calibration value is not known. - */ -#define SYSCON_CPU0STCKCAL_TENMS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPU0STCKCAL_TENMS_SHIFT)) & SYSCON_CPU0STCKCAL_TENMS_MASK) - -#define SYSCON_CPU0STCKCAL_SKEW_MASK (0x1000000U) -#define SYSCON_CPU0STCKCAL_SKEW_SHIFT (24U) -/*! SKEW - Whether the TENMS value is exact. - * 0b0..TENMS value is exact - * 0b1..TENMS value is not exact or not given - */ -#define SYSCON_CPU0STCKCAL_SKEW(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPU0STCKCAL_SKEW_SHIFT)) & SYSCON_CPU0STCKCAL_SKEW_MASK) - -#define SYSCON_CPU0STCKCAL_NOREF_MASK (0x2000000U) -#define SYSCON_CPU0STCKCAL_NOREF_SHIFT (25U) -/*! NOREF - Whether the device provides a reference clock to the processor. - * 0b0..Reference clock is provided - * 0b1..No reference clock is provided - */ -#define SYSCON_CPU0STCKCAL_NOREF(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPU0STCKCAL_NOREF_SHIFT)) & SYSCON_CPU0STCKCAL_NOREF_MASK) -/*! @} */ - -/*! @name CPU0NSTCKCAL - Non-Secure CPU0 System Tick Calibration */ -/*! @{ */ - -#define SYSCON_CPU0NSTCKCAL_TENMS_MASK (0xFFFFFFU) -#define SYSCON_CPU0NSTCKCAL_TENMS_SHIFT (0U) -/*! TENMS - Reload value for 10 ms (100 Hz) timing, subject to system clock skew errors. If the - * value reads as zero, the calibration value is not known. - */ -#define SYSCON_CPU0NSTCKCAL_TENMS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPU0NSTCKCAL_TENMS_SHIFT)) & SYSCON_CPU0NSTCKCAL_TENMS_MASK) - -#define SYSCON_CPU0NSTCKCAL_SKEW_MASK (0x1000000U) -#define SYSCON_CPU0NSTCKCAL_SKEW_SHIFT (24U) -/*! SKEW - Indicates whether the TENMS value is exact. - * 0b0..TENMS value is exact - * 0b1..TENMS value is not exact or not given - */ -#define SYSCON_CPU0NSTCKCAL_SKEW(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPU0NSTCKCAL_SKEW_SHIFT)) & SYSCON_CPU0NSTCKCAL_SKEW_MASK) - -#define SYSCON_CPU0NSTCKCAL_NOREF_MASK (0x2000000U) -#define SYSCON_CPU0NSTCKCAL_NOREF_SHIFT (25U) -/*! NOREF - Indicates whether the device provides a reference clock to the processor. - * 0b0..Reference clock is provided - * 0b1..No reference clock is provided - */ -#define SYSCON_CPU0NSTCKCAL_NOREF(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPU0NSTCKCAL_NOREF_SHIFT)) & SYSCON_CPU0NSTCKCAL_NOREF_MASK) -/*! @} */ - -/*! @name CPU1STCKCAL - System tick calibration for CPU1 */ -/*! @{ */ - -#define SYSCON_CPU1STCKCAL_TENMS_MASK (0xFFFFFFU) -#define SYSCON_CPU1STCKCAL_TENMS_SHIFT (0U) -/*! TENMS - Reload value for 10 ms (100 Hz) timing, subject to system clock skew errors. If the - * value reads as zero, the calibration value is not known. - */ -#define SYSCON_CPU1STCKCAL_TENMS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPU1STCKCAL_TENMS_SHIFT)) & SYSCON_CPU1STCKCAL_TENMS_MASK) - -#define SYSCON_CPU1STCKCAL_SKEW_MASK (0x1000000U) -#define SYSCON_CPU1STCKCAL_SKEW_SHIFT (24U) -/*! SKEW - Indicates whether the TENMS value is exact. - * 0b0..TENMS value is exact - * 0b1..TENMS value is not exact or not given - */ -#define SYSCON_CPU1STCKCAL_SKEW(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPU1STCKCAL_SKEW_SHIFT)) & SYSCON_CPU1STCKCAL_SKEW_MASK) - -#define SYSCON_CPU1STCKCAL_NOREF_MASK (0x2000000U) -#define SYSCON_CPU1STCKCAL_NOREF_SHIFT (25U) -/*! NOREF - Indicates whether the device provides a reference clock to the processor. - * 0b0..Reference clock is provided - * 0b1..No reference clock is provided - */ -#define SYSCON_CPU1STCKCAL_NOREF(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPU1STCKCAL_NOREF_SHIFT)) & SYSCON_CPU1STCKCAL_NOREF_MASK) -/*! @} */ - -/*! @name NMISRC - NMI Source Select */ -/*! @{ */ - -#define SYSCON_NMISRC_IRQCPU0_MASK (0xFFU) -#define SYSCON_NMISRC_IRQCPU0_SHIFT (0U) -/*! IRQCPU0 - The IRQ number of the interrupt that acts as the Non-Maskable Interrupt (NMI) for CPU0, if enabled by NMIENCPU0. */ -#define SYSCON_NMISRC_IRQCPU0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NMISRC_IRQCPU0_SHIFT)) & SYSCON_NMISRC_IRQCPU0_MASK) - -#define SYSCON_NMISRC_IRQCPU1_MASK (0xFF00U) -#define SYSCON_NMISRC_IRQCPU1_SHIFT (8U) -/*! IRQCPU1 - The IRQ number of the interrupt that acts as the Non-Maskable Interrupt (NMI) for CPU1, if enabled by NMIENCPU1. */ -#define SYSCON_NMISRC_IRQCPU1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NMISRC_IRQCPU1_SHIFT)) & SYSCON_NMISRC_IRQCPU1_MASK) - -#define SYSCON_NMISRC_NMIENCPU1_MASK (0x40000000U) -#define SYSCON_NMISRC_NMIENCPU1_SHIFT (30U) -/*! NMIENCPU1 - Enables the Non-Maskable Interrupt (NMI) source selected by IRQCPU1. - * 0b1..Enable. - * 0b0..Disable. - */ -#define SYSCON_NMISRC_NMIENCPU1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NMISRC_NMIENCPU1_SHIFT)) & SYSCON_NMISRC_NMIENCPU1_MASK) - -#define SYSCON_NMISRC_NMIENCPU0_MASK (0x80000000U) -#define SYSCON_NMISRC_NMIENCPU0_SHIFT (31U) -/*! NMIENCPU0 - Enables the Non-Maskable Interrupt (NMI) source selected by IRQCPU0. - * 0b1..Enable. - * 0b0..Disable. - */ -#define SYSCON_NMISRC_NMIENCPU0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NMISRC_NMIENCPU0_SHIFT)) & SYSCON_NMISRC_NMIENCPU0_MASK) -/*! @} */ - -/*! @name PRESETCTRL0 - Peripheral Reset Control 0 */ -/*! @{ */ - -#define SYSCON_PRESETCTRL0_FMU_RST_MASK (0x200U) -#define SYSCON_PRESETCTRL0_FMU_RST_SHIFT (9U) -/*! FMU_RST - Flash management unit reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_FMU_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_FMU_RST_SHIFT)) & SYSCON_PRESETCTRL0_FMU_RST_MASK) - -#define SYSCON_PRESETCTRL0_FLEXSPI_RST_MASK (0x800U) -#define SYSCON_PRESETCTRL0_FLEXSPI_RST_SHIFT (11U) -/*! FLEXSPI_RST - FlexSPI reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_FLEXSPI_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_FLEXSPI_RST_SHIFT)) & SYSCON_PRESETCTRL0_FLEXSPI_RST_MASK) - -#define SYSCON_PRESETCTRL0_MUX_RST_MASK (0x1000U) -#define SYSCON_PRESETCTRL0_MUX_RST_SHIFT (12U) -/*! MUX_RST - INPUTMUX reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_MUX_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_MUX_RST_SHIFT)) & SYSCON_PRESETCTRL0_MUX_RST_MASK) - -#define SYSCON_PRESETCTRL0_PORT0_RST_MASK (0x2000U) -#define SYSCON_PRESETCTRL0_PORT0_RST_SHIFT (13U) -/*! PORT0_RST - PORT0 controller reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_PORT0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_PORT0_RST_SHIFT)) & SYSCON_PRESETCTRL0_PORT0_RST_MASK) - -#define SYSCON_PRESETCTRL0_PORT1_RST_MASK (0x4000U) -#define SYSCON_PRESETCTRL0_PORT1_RST_SHIFT (14U) -/*! PORT1_RST - PORT1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_PORT1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_PORT1_RST_SHIFT)) & SYSCON_PRESETCTRL0_PORT1_RST_MASK) - -#define SYSCON_PRESETCTRL0_PORT2_RST_MASK (0x8000U) -#define SYSCON_PRESETCTRL0_PORT2_RST_SHIFT (15U) -/*! PORT2_RST - PORT2 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_PORT2_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_PORT2_RST_SHIFT)) & SYSCON_PRESETCTRL0_PORT2_RST_MASK) - -#define SYSCON_PRESETCTRL0_PORT3_RST_MASK (0x10000U) -#define SYSCON_PRESETCTRL0_PORT3_RST_SHIFT (16U) -/*! PORT3_RST - PORT3 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_PORT3_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_PORT3_RST_SHIFT)) & SYSCON_PRESETCTRL0_PORT3_RST_MASK) - -#define SYSCON_PRESETCTRL0_PORT4_RST_MASK (0x20000U) -#define SYSCON_PRESETCTRL0_PORT4_RST_SHIFT (17U) -/*! PORT4_RST - PORT4 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_PORT4_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_PORT4_RST_SHIFT)) & SYSCON_PRESETCTRL0_PORT4_RST_MASK) - -#define SYSCON_PRESETCTRL0_GPIO0_RST_MASK (0x80000U) -#define SYSCON_PRESETCTRL0_GPIO0_RST_SHIFT (19U) -/*! GPIO0_RST - GPIO0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_GPIO0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_GPIO0_RST_SHIFT)) & SYSCON_PRESETCTRL0_GPIO0_RST_MASK) - -#define SYSCON_PRESETCTRL0_GPIO1_RST_MASK (0x100000U) -#define SYSCON_PRESETCTRL0_GPIO1_RST_SHIFT (20U) -/*! GPIO1_RST - GPIO1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_GPIO1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_GPIO1_RST_SHIFT)) & SYSCON_PRESETCTRL0_GPIO1_RST_MASK) - -#define SYSCON_PRESETCTRL0_GPIO2_RST_MASK (0x200000U) -#define SYSCON_PRESETCTRL0_GPIO2_RST_SHIFT (21U) -/*! GPIO2_RST - GPIO2 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_GPIO2_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_GPIO2_RST_SHIFT)) & SYSCON_PRESETCTRL0_GPIO2_RST_MASK) - -#define SYSCON_PRESETCTRL0_GPIO3_RST_MASK (0x400000U) -#define SYSCON_PRESETCTRL0_GPIO3_RST_SHIFT (22U) -/*! GPIO3_RST - GPIO3 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_GPIO3_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_GPIO3_RST_SHIFT)) & SYSCON_PRESETCTRL0_GPIO3_RST_MASK) - -#define SYSCON_PRESETCTRL0_GPIO4_RST_MASK (0x800000U) -#define SYSCON_PRESETCTRL0_GPIO4_RST_SHIFT (23U) -/*! GPIO4_RST - GPIO4 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_GPIO4_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_GPIO4_RST_SHIFT)) & SYSCON_PRESETCTRL0_GPIO4_RST_MASK) - -#define SYSCON_PRESETCTRL0_PINT_RST_MASK (0x2000000U) -#define SYSCON_PRESETCTRL0_PINT_RST_SHIFT (25U) -/*! PINT_RST - PINT reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_PINT_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_PINT_RST_SHIFT)) & SYSCON_PRESETCTRL0_PINT_RST_MASK) - -#define SYSCON_PRESETCTRL0_DMA0_RST_MASK (0x4000000U) -#define SYSCON_PRESETCTRL0_DMA0_RST_SHIFT (26U) -/*! DMA0_RST - DMA0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_DMA0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_DMA0_RST_SHIFT)) & SYSCON_PRESETCTRL0_DMA0_RST_MASK) - -#define SYSCON_PRESETCTRL0_CRC_RST_MASK (0x8000000U) -#define SYSCON_PRESETCTRL0_CRC_RST_SHIFT (27U) -/*! CRC_RST - CRC reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_CRC_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_CRC_RST_SHIFT)) & SYSCON_PRESETCTRL0_CRC_RST_MASK) - -#define SYSCON_PRESETCTRL0_MAILBOX_RST_MASK (0x80000000U) -#define SYSCON_PRESETCTRL0_MAILBOX_RST_SHIFT (31U) -/*! MAILBOX_RST - Inter-CPU communication Mailbox reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL0_MAILBOX_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL0_MAILBOX_RST_SHIFT)) & SYSCON_PRESETCTRL0_MAILBOX_RST_MASK) -/*! @} */ - -/*! @name PRESETCTRL1 - Peripheral Reset Control 1 */ -/*! @{ */ - -#define SYSCON_PRESETCTRL1_MRT_RST_MASK (0x1U) -#define SYSCON_PRESETCTRL1_MRT_RST_SHIFT (0U) -/*! MRT_RST - MRT reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_MRT_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_MRT_RST_SHIFT)) & SYSCON_PRESETCTRL1_MRT_RST_MASK) - -#define SYSCON_PRESETCTRL1_OSTIMER_RST_MASK (0x2U) -#define SYSCON_PRESETCTRL1_OSTIMER_RST_SHIFT (1U) -/*! OSTIMER_RST - OS Event Timer reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_OSTIMER_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_OSTIMER_RST_SHIFT)) & SYSCON_PRESETCTRL1_OSTIMER_RST_MASK) - -#define SYSCON_PRESETCTRL1_SCT_RST_MASK (0x4U) -#define SYSCON_PRESETCTRL1_SCT_RST_SHIFT (2U) -/*! SCT_RST - SCT reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_SCT_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_SCT_RST_SHIFT)) & SYSCON_PRESETCTRL1_SCT_RST_MASK) - -#define SYSCON_PRESETCTRL1_ADC0_RST_MASK (0x8U) -#define SYSCON_PRESETCTRL1_ADC0_RST_SHIFT (3U) -/*! ADC0_RST - ADC0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_ADC0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_ADC0_RST_SHIFT)) & SYSCON_PRESETCTRL1_ADC0_RST_MASK) - -#define SYSCON_PRESETCTRL1_ADC1_RST_MASK (0x10U) -#define SYSCON_PRESETCTRL1_ADC1_RST_SHIFT (4U) -/*! ADC1_RST - ADC1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_ADC1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_ADC1_RST_SHIFT)) & SYSCON_PRESETCTRL1_ADC1_RST_MASK) - -#define SYSCON_PRESETCTRL1_DAC0_RST_MASK (0x20U) -#define SYSCON_PRESETCTRL1_DAC0_RST_SHIFT (5U) -/*! DAC0_RST - DAC0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_DAC0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_DAC0_RST_SHIFT)) & SYSCON_PRESETCTRL1_DAC0_RST_MASK) - -#define SYSCON_PRESETCTRL1_RTC_RST_MASK (0x40U) -#define SYSCON_PRESETCTRL1_RTC_RST_SHIFT (6U) -/*! RTC_RST - RTC reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_RTC_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_RTC_RST_SHIFT)) & SYSCON_PRESETCTRL1_RTC_RST_MASK) - -#define SYSCON_PRESETCTRL1_EVSIM0_RST_MASK (0x100U) -#define SYSCON_PRESETCTRL1_EVSIM0_RST_SHIFT (8U) -/*! EVSIM0_RST - EVSIM0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_EVSIM0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_EVSIM0_RST_SHIFT)) & SYSCON_PRESETCTRL1_EVSIM0_RST_MASK) - -#define SYSCON_PRESETCTRL1_EVSIM1_RST_MASK (0x200U) -#define SYSCON_PRESETCTRL1_EVSIM1_RST_SHIFT (9U) -/*! EVSIM1_RST - EVSIM1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_EVSIM1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_EVSIM1_RST_SHIFT)) & SYSCON_PRESETCTRL1_EVSIM1_RST_MASK) - -#define SYSCON_PRESETCTRL1_UTICK_RST_MASK (0x400U) -#define SYSCON_PRESETCTRL1_UTICK_RST_SHIFT (10U) -/*! UTICK_RST - UTICK reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_UTICK_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_UTICK_RST_SHIFT)) & SYSCON_PRESETCTRL1_UTICK_RST_MASK) - -#define SYSCON_PRESETCTRL1_FC0_RST_MASK (0x800U) -#define SYSCON_PRESETCTRL1_FC0_RST_SHIFT (11U) -/*! FC0_RST - LP_FLEXCOMM0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_FC0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_FC0_RST_SHIFT)) & SYSCON_PRESETCTRL1_FC0_RST_MASK) - -#define SYSCON_PRESETCTRL1_FC1_RST_MASK (0x1000U) -#define SYSCON_PRESETCTRL1_FC1_RST_SHIFT (12U) -/*! FC1_RST - LP_FLEXCOMM1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_FC1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_FC1_RST_SHIFT)) & SYSCON_PRESETCTRL1_FC1_RST_MASK) - -#define SYSCON_PRESETCTRL1_FC2_RST_MASK (0x2000U) -#define SYSCON_PRESETCTRL1_FC2_RST_SHIFT (13U) -/*! FC2_RST - LP_FLEXCOMM2 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_FC2_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_FC2_RST_SHIFT)) & SYSCON_PRESETCTRL1_FC2_RST_MASK) - -#define SYSCON_PRESETCTRL1_FC3_RST_MASK (0x4000U) -#define SYSCON_PRESETCTRL1_FC3_RST_SHIFT (14U) -/*! FC3_RST - LP_FLEXCOMM3 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_FC3_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_FC3_RST_SHIFT)) & SYSCON_PRESETCTRL1_FC3_RST_MASK) - -#define SYSCON_PRESETCTRL1_FC4_RST_MASK (0x8000U) -#define SYSCON_PRESETCTRL1_FC4_RST_SHIFT (15U) -/*! FC4_RST - LP_FLEXCOMM4 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_FC4_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_FC4_RST_SHIFT)) & SYSCON_PRESETCTRL1_FC4_RST_MASK) - -#define SYSCON_PRESETCTRL1_FC5_RST_MASK (0x10000U) -#define SYSCON_PRESETCTRL1_FC5_RST_SHIFT (16U) -/*! FC5_RST - LP_FLEXCOMM5 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_FC5_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_FC5_RST_SHIFT)) & SYSCON_PRESETCTRL1_FC5_RST_MASK) - -#define SYSCON_PRESETCTRL1_FC6_RST_MASK (0x20000U) -#define SYSCON_PRESETCTRL1_FC6_RST_SHIFT (17U) -/*! FC6_RST - LP_FLEXCOMM6 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_FC6_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_FC6_RST_SHIFT)) & SYSCON_PRESETCTRL1_FC6_RST_MASK) - -#define SYSCON_PRESETCTRL1_FC7_RST_MASK (0x40000U) -#define SYSCON_PRESETCTRL1_FC7_RST_SHIFT (18U) -/*! FC7_RST - LP_FLEXCOMM7 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_FC7_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_FC7_RST_SHIFT)) & SYSCON_PRESETCTRL1_FC7_RST_MASK) - -#define SYSCON_PRESETCTRL1_FC8_RST_MASK (0x80000U) -#define SYSCON_PRESETCTRL1_FC8_RST_SHIFT (19U) -/*! FC8_RST - LP_FLEXCOMM8 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_FC8_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_FC8_RST_SHIFT)) & SYSCON_PRESETCTRL1_FC8_RST_MASK) - -#define SYSCON_PRESETCTRL1_FC9_RST_MASK (0x100000U) -#define SYSCON_PRESETCTRL1_FC9_RST_SHIFT (20U) -/*! FC9_RST - LP_FLEXCOMM9 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_FC9_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_FC9_RST_SHIFT)) & SYSCON_PRESETCTRL1_FC9_RST_MASK) - -#define SYSCON_PRESETCTRL1_MICFIL_RST_MASK (0x200000U) -#define SYSCON_PRESETCTRL1_MICFIL_RST_SHIFT (21U) -/*! MICFIL_RST - MICFIL reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_MICFIL_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_MICFIL_RST_SHIFT)) & SYSCON_PRESETCTRL1_MICFIL_RST_MASK) - -#define SYSCON_PRESETCTRL1_TIMER2_RST_MASK (0x400000U) -#define SYSCON_PRESETCTRL1_TIMER2_RST_SHIFT (22U) -/*! TIMER2_RST - CTIMER2 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_TIMER2_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_TIMER2_RST_SHIFT)) & SYSCON_PRESETCTRL1_TIMER2_RST_MASK) - -#define SYSCON_PRESETCTRL1_USB0_FS_DCD_RST_MASK (0x1000000U) -#define SYSCON_PRESETCTRL1_USB0_FS_DCD_RST_SHIFT (24U) -/*! USB0_FS_DCD_RST - USB FS DCD reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_USB0_FS_DCD_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_USB0_FS_DCD_RST_SHIFT)) & SYSCON_PRESETCTRL1_USB0_FS_DCD_RST_MASK) - -#define SYSCON_PRESETCTRL1_USB0_FS_RST_MASK (0x2000000U) -#define SYSCON_PRESETCTRL1_USB0_FS_RST_SHIFT (25U) -/*! USB0_FS_RST - USB FS reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_USB0_FS_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_USB0_FS_RST_SHIFT)) & SYSCON_PRESETCTRL1_USB0_FS_RST_MASK) - -#define SYSCON_PRESETCTRL1_TIMER0_RST_MASK (0x4000000U) -#define SYSCON_PRESETCTRL1_TIMER0_RST_SHIFT (26U) -/*! TIMER0_RST - CTIMER0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_TIMER0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_TIMER0_RST_SHIFT)) & SYSCON_PRESETCTRL1_TIMER0_RST_MASK) - -#define SYSCON_PRESETCTRL1_TIMER1_RST_MASK (0x8000000U) -#define SYSCON_PRESETCTRL1_TIMER1_RST_SHIFT (27U) -/*! TIMER1_RST - CTIMER1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_TIMER1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_TIMER1_RST_SHIFT)) & SYSCON_PRESETCTRL1_TIMER1_RST_MASK) - -#define SYSCON_PRESETCTRL1_SmartDMA_RST_MASK (0x80000000U) -#define SYSCON_PRESETCTRL1_SmartDMA_RST_SHIFT (31U) -/*! SmartDMA_RST - SmartDMA reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL1_SmartDMA_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL1_SmartDMA_RST_SHIFT)) & SYSCON_PRESETCTRL1_SmartDMA_RST_MASK) -/*! @} */ - -/*! @name PRESETCTRL2 - Peripheral Reset Control 2 */ -/*! @{ */ - -#define SYSCON_PRESETCTRL2_DMA1_RST_MASK (0x2U) -#define SYSCON_PRESETCTRL2_DMA1_RST_SHIFT (1U) -/*! DMA1_RST - DMA1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_DMA1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_DMA1_RST_SHIFT)) & SYSCON_PRESETCTRL2_DMA1_RST_MASK) - -#define SYSCON_PRESETCTRL2_ENET_RST_MASK (0x4U) -#define SYSCON_PRESETCTRL2_ENET_RST_SHIFT (2U) -/*! ENET_RST - Ethernet reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_ENET_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_ENET_RST_SHIFT)) & SYSCON_PRESETCTRL2_ENET_RST_MASK) - -#define SYSCON_PRESETCTRL2_USDHC_RST_MASK (0x8U) -#define SYSCON_PRESETCTRL2_USDHC_RST_SHIFT (3U) -/*! USDHC_RST - uSDHC reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_USDHC_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_USDHC_RST_SHIFT)) & SYSCON_PRESETCTRL2_USDHC_RST_MASK) - -#define SYSCON_PRESETCTRL2_FLEXIO_RST_MASK (0x10U) -#define SYSCON_PRESETCTRL2_FLEXIO_RST_SHIFT (4U) -/*! FLEXIO_RST - FLEXIO reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_FLEXIO_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_FLEXIO_RST_SHIFT)) & SYSCON_PRESETCTRL2_FLEXIO_RST_MASK) - -#define SYSCON_PRESETCTRL2_SAI0_RST_MASK (0x20U) -#define SYSCON_PRESETCTRL2_SAI0_RST_SHIFT (5U) -/*! SAI0_RST - SAI0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_SAI0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_SAI0_RST_SHIFT)) & SYSCON_PRESETCTRL2_SAI0_RST_MASK) - -#define SYSCON_PRESETCTRL2_SAI1_RST_MASK (0x40U) -#define SYSCON_PRESETCTRL2_SAI1_RST_SHIFT (6U) -/*! SAI1_RST - SAI1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_SAI1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_SAI1_RST_SHIFT)) & SYSCON_PRESETCTRL2_SAI1_RST_MASK) - -#define SYSCON_PRESETCTRL2_TRO_RST_MASK (0x80U) -#define SYSCON_PRESETCTRL2_TRO_RST_SHIFT (7U) -/*! TRO_RST - TRO reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_TRO_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_TRO_RST_SHIFT)) & SYSCON_PRESETCTRL2_TRO_RST_MASK) - -#define SYSCON_PRESETCTRL2_FREQME_RST_MASK (0x100U) -#define SYSCON_PRESETCTRL2_FREQME_RST_SHIFT (8U) -/*! FREQME_RST - FREQME reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_FREQME_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_FREQME_RST_SHIFT)) & SYSCON_PRESETCTRL2_FREQME_RST_MASK) - -#define SYSCON_PRESETCTRL2_TRNG_RST_MASK (0x2000U) -#define SYSCON_PRESETCTRL2_TRNG_RST_SHIFT (13U) -/*! TRNG_RST - TRNG reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_TRNG_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_TRNG_RST_SHIFT)) & SYSCON_PRESETCTRL2_TRNG_RST_MASK) - -#define SYSCON_PRESETCTRL2_FLEXCAN0_RST_MASK (0x4000U) -#define SYSCON_PRESETCTRL2_FLEXCAN0_RST_SHIFT (14U) -/*! FLEXCAN0_RST - CAN0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_FLEXCAN0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_FLEXCAN0_RST_SHIFT)) & SYSCON_PRESETCTRL2_FLEXCAN0_RST_MASK) - -#define SYSCON_PRESETCTRL2_FLEXCAN1_RST_MASK (0x8000U) -#define SYSCON_PRESETCTRL2_FLEXCAN1_RST_SHIFT (15U) -/*! FLEXCAN1_RST - CAN1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_FLEXCAN1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_FLEXCAN1_RST_SHIFT)) & SYSCON_PRESETCTRL2_FLEXCAN1_RST_MASK) - -#define SYSCON_PRESETCTRL2_USB_HS_RST_MASK (0x10000U) -#define SYSCON_PRESETCTRL2_USB_HS_RST_SHIFT (16U) -/*! USB_HS_RST - USB HS reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_USB_HS_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_USB_HS_RST_SHIFT)) & SYSCON_PRESETCTRL2_USB_HS_RST_MASK) - -#define SYSCON_PRESETCTRL2_USB_HS_PHY_RST_MASK (0x20000U) -#define SYSCON_PRESETCTRL2_USB_HS_PHY_RST_SHIFT (17U) -/*! USB_HS_PHY_RST - USB HS PHY reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_USB_HS_PHY_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_USB_HS_PHY_RST_SHIFT)) & SYSCON_PRESETCTRL2_USB_HS_PHY_RST_MASK) - -#define SYSCON_PRESETCTRL2_PQ_RST_MASK (0x80000U) -#define SYSCON_PRESETCTRL2_PQ_RST_SHIFT (19U) -/*! PQ_RST - PowerQuad reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_PQ_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_PQ_RST_SHIFT)) & SYSCON_PRESETCTRL2_PQ_RST_MASK) - -#define SYSCON_PRESETCTRL2_PLU_RST_MASK (0x100000U) -#define SYSCON_PRESETCTRL2_PLU_RST_SHIFT (20U) -/*! PLU_RST - PLU reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_PLU_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_PLU_RST_SHIFT)) & SYSCON_PRESETCTRL2_PLU_RST_MASK) - -#define SYSCON_PRESETCTRL2_TIMER3_RST_MASK (0x200000U) -#define SYSCON_PRESETCTRL2_TIMER3_RST_SHIFT (21U) -/*! TIMER3_RST - CTIMER3 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_TIMER3_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_TIMER3_RST_SHIFT)) & SYSCON_PRESETCTRL2_TIMER3_RST_MASK) - -#define SYSCON_PRESETCTRL2_TIMER4_RST_MASK (0x400000U) -#define SYSCON_PRESETCTRL2_TIMER4_RST_SHIFT (22U) -/*! TIMER4_RST - CTIMER4 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_TIMER4_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_TIMER4_RST_SHIFT)) & SYSCON_PRESETCTRL2_TIMER4_RST_MASK) - -#define SYSCON_PRESETCTRL2_PUF_RST_MASK (0x800000U) -#define SYSCON_PRESETCTRL2_PUF_RST_SHIFT (23U) -/*! PUF_RST - PUF reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_PUF_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_PUF_RST_SHIFT)) & SYSCON_PRESETCTRL2_PUF_RST_MASK) - -#define SYSCON_PRESETCTRL2_PKC_RST_MASK (0x1000000U) -#define SYSCON_PRESETCTRL2_PKC_RST_SHIFT (24U) -/*! PKC_RST - PKC reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_PKC_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_PKC_RST_SHIFT)) & SYSCON_PRESETCTRL2_PKC_RST_MASK) - -#define SYSCON_PRESETCTRL2_SM3_RST_MASK (0x40000000U) -#define SYSCON_PRESETCTRL2_SM3_RST_SHIFT (30U) -/*! SM3_RST - SM3 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL2_SM3_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL2_SM3_RST_SHIFT)) & SYSCON_PRESETCTRL2_SM3_RST_MASK) -/*! @} */ - -/*! @name PRESETCTRL3 - Peripheral Reset Control 3 */ -/*! @{ */ - -#define SYSCON_PRESETCTRL3_I3C0_RST_MASK (0x1U) -#define SYSCON_PRESETCTRL3_I3C0_RST_SHIFT (0U) -/*! I3C0_RST - I3C0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_I3C0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_I3C0_RST_SHIFT)) & SYSCON_PRESETCTRL3_I3C0_RST_MASK) - -#define SYSCON_PRESETCTRL3_I3C1_RST_MASK (0x2U) -#define SYSCON_PRESETCTRL3_I3C1_RST_SHIFT (1U) -/*! I3C1_RST - I3C1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_I3C1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_I3C1_RST_SHIFT)) & SYSCON_PRESETCTRL3_I3C1_RST_MASK) - -#define SYSCON_PRESETCTRL3_SINC_RST_MASK (0x4U) -#define SYSCON_PRESETCTRL3_SINC_RST_SHIFT (2U) -/*! SINC_RST - SINC reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_SINC_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_SINC_RST_SHIFT)) & SYSCON_PRESETCTRL3_SINC_RST_MASK) - -#define SYSCON_PRESETCTRL3_COOLFLUX_RST_MASK (0x8U) -#define SYSCON_PRESETCTRL3_COOLFLUX_RST_SHIFT (3U) -/*! COOLFLUX_RST - CoolFlux reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_COOLFLUX_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_COOLFLUX_RST_SHIFT)) & SYSCON_PRESETCTRL3_COOLFLUX_RST_MASK) - -#define SYSCON_PRESETCTRL3_QDC0_RST_MASK (0x10U) -#define SYSCON_PRESETCTRL3_QDC0_RST_SHIFT (4U) -/*! QDC0_RST - QDC0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_QDC0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_QDC0_RST_SHIFT)) & SYSCON_PRESETCTRL3_QDC0_RST_MASK) - -#define SYSCON_PRESETCTRL3_QDC1_RST_MASK (0x20U) -#define SYSCON_PRESETCTRL3_QDC1_RST_SHIFT (5U) -/*! QDC1_RST - QDC1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_QDC1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_QDC1_RST_SHIFT)) & SYSCON_PRESETCTRL3_QDC1_RST_MASK) - -#define SYSCON_PRESETCTRL3_PWM0_RST_MASK (0x40U) -#define SYSCON_PRESETCTRL3_PWM0_RST_SHIFT (6U) -/*! PWM0_RST - PWM0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_PWM0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_PWM0_RST_SHIFT)) & SYSCON_PRESETCTRL3_PWM0_RST_MASK) - -#define SYSCON_PRESETCTRL3_PWM1_RST_MASK (0x80U) -#define SYSCON_PRESETCTRL3_PWM1_RST_SHIFT (7U) -/*! PWM1_RST - PWM1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_PWM1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_PWM1_RST_SHIFT)) & SYSCON_PRESETCTRL3_PWM1_RST_MASK) - -#define SYSCON_PRESETCTRL3_AOI0_RST_MASK (0x100U) -#define SYSCON_PRESETCTRL3_AOI0_RST_SHIFT (8U) -/*! AOI0_RST - AOI0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_AOI0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_AOI0_RST_SHIFT)) & SYSCON_PRESETCTRL3_AOI0_RST_MASK) - -#define SYSCON_PRESETCTRL3_DAC1_RST_MASK (0x800U) -#define SYSCON_PRESETCTRL3_DAC1_RST_SHIFT (11U) -/*! DAC1_RST - DAC1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_DAC1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_DAC1_RST_SHIFT)) & SYSCON_PRESETCTRL3_DAC1_RST_MASK) - -#define SYSCON_PRESETCTRL3_DAC2_RST_MASK (0x1000U) -#define SYSCON_PRESETCTRL3_DAC2_RST_SHIFT (12U) -/*! DAC2_RST - DAC2 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_DAC2_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_DAC2_RST_SHIFT)) & SYSCON_PRESETCTRL3_DAC2_RST_MASK) - -#define SYSCON_PRESETCTRL3_OPAMP0_RST_MASK (0x2000U) -#define SYSCON_PRESETCTRL3_OPAMP0_RST_SHIFT (13U) -/*! OPAMP0_RST - OPAMP0 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_OPAMP0_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_OPAMP0_RST_SHIFT)) & SYSCON_PRESETCTRL3_OPAMP0_RST_MASK) - -#define SYSCON_PRESETCTRL3_OPAMP1_RST_MASK (0x4000U) -#define SYSCON_PRESETCTRL3_OPAMP1_RST_SHIFT (14U) -/*! OPAMP1_RST - OPAMP1 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_OPAMP1_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_OPAMP1_RST_SHIFT)) & SYSCON_PRESETCTRL3_OPAMP1_RST_MASK) - -#define SYSCON_PRESETCTRL3_OPAMP2_RST_MASK (0x8000U) -#define SYSCON_PRESETCTRL3_OPAMP2_RST_SHIFT (15U) -/*! OPAMP2_RST - OPAMP2 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_OPAMP2_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_OPAMP2_RST_SHIFT)) & SYSCON_PRESETCTRL3_OPAMP2_RST_MASK) - -#define SYSCON_PRESETCTRL3_CMP2_RST_MASK (0x40000U) -#define SYSCON_PRESETCTRL3_CMP2_RST_SHIFT (18U) -/*! CMP2_RST - CMP2 reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_CMP2_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_CMP2_RST_SHIFT)) & SYSCON_PRESETCTRL3_CMP2_RST_MASK) - -#define SYSCON_PRESETCTRL3_VREF_RST_MASK (0x80000U) -#define SYSCON_PRESETCTRL3_VREF_RST_SHIFT (19U) -/*! VREF_RST - VREF reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_VREF_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_VREF_RST_SHIFT)) & SYSCON_PRESETCTRL3_VREF_RST_MASK) - -#define SYSCON_PRESETCTRL3_COOLFLUX_APB_RST_MASK (0x100000U) -#define SYSCON_PRESETCTRL3_COOLFLUX_APB_RST_SHIFT (20U) -/*! COOLFLUX_APB_RST - CoolFlux APB reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_COOLFLUX_APB_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_COOLFLUX_APB_RST_SHIFT)) & SYSCON_PRESETCTRL3_COOLFLUX_APB_RST_MASK) - -#define SYSCON_PRESETCTRL3_NPU_RST_MASK (0x200000U) -#define SYSCON_PRESETCTRL3_NPU_RST_SHIFT (21U) -/*! NPU_RST - NPU reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_NPU_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_NPU_RST_SHIFT)) & SYSCON_PRESETCTRL3_NPU_RST_MASK) - -#define SYSCON_PRESETCTRL3_TSI_RST_MASK (0x400000U) -#define SYSCON_PRESETCTRL3_TSI_RST_SHIFT (22U) -/*! TSI_RST - TSI reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_TSI_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_TSI_RST_SHIFT)) & SYSCON_PRESETCTRL3_TSI_RST_MASK) - -#define SYSCON_PRESETCTRL3_EWM_RST_MASK (0x800000U) -#define SYSCON_PRESETCTRL3_EWM_RST_SHIFT (23U) -/*! EWM_RST - EWM reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_EWM_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_EWM_RST_SHIFT)) & SYSCON_PRESETCTRL3_EWM_RST_MASK) - -#define SYSCON_PRESETCTRL3_EIM_RST_MASK (0x1000000U) -#define SYSCON_PRESETCTRL3_EIM_RST_SHIFT (24U) -/*! EIM_RST - EIM reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_EIM_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_EIM_RST_SHIFT)) & SYSCON_PRESETCTRL3_EIM_RST_MASK) - -#define SYSCON_PRESETCTRL3_SEMA42_RST_MASK (0x8000000U) -#define SYSCON_PRESETCTRL3_SEMA42_RST_SHIFT (27U) -/*! SEMA42_RST - Semaphore reset control - * 0b1..Block is reset - * 0b0..Block is not reset - */ -#define SYSCON_PRESETCTRL3_SEMA42_RST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRL3_SEMA42_RST_SHIFT)) & SYSCON_PRESETCTRL3_SEMA42_RST_MASK) -/*! @} */ - -/*! @name PRESETCTRLSET - Peripheral Reset Control Set */ -/*! @{ */ - -#define SYSCON_PRESETCTRLSET_DATA_MASK (0xFFFFFFFFU) -#define SYSCON_PRESETCTRLSET_DATA_SHIFT (0U) -/*! DATA - Data array value, refer to corresponding position in PRESETCTRLn. */ -#define SYSCON_PRESETCTRLSET_DATA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRLSET_DATA_SHIFT)) & SYSCON_PRESETCTRLSET_DATA_MASK) -/*! @} */ - -/* The count of SYSCON_PRESETCTRLSET */ -#define SYSCON_PRESETCTRLSET_COUNT (4U) - -/*! @name PRESETCTRLCLR - Peripheral Reset Control Clear */ -/*! @{ */ - -#define SYSCON_PRESETCTRLCLR_DATA_MASK (0xFFFFFFFFU) -#define SYSCON_PRESETCTRLCLR_DATA_SHIFT (0U) -/*! DATA - Data array value, refer to corresponding position in PRESETCTRLn. */ -#define SYSCON_PRESETCTRLCLR_DATA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PRESETCTRLCLR_DATA_SHIFT)) & SYSCON_PRESETCTRLCLR_DATA_MASK) -/*! @} */ - -/* The count of SYSCON_PRESETCTRLCLR */ -#define SYSCON_PRESETCTRLCLR_COUNT (4U) - -/*! @name AHBCLKCTRL0 - AHB Clock Control 0 */ -/*! @{ */ - -#define SYSCON_AHBCLKCTRL0_ROM_MASK (0x2U) -#define SYSCON_AHBCLKCTRL0_ROM_SHIFT (1U) -/*! ROM - Enables the clock for the ROM - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_ROM(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_ROM_SHIFT)) & SYSCON_AHBCLKCTRL0_ROM_MASK) - -#define SYSCON_AHBCLKCTRL0_RAMB_CTRL_MASK (0x4U) -#define SYSCON_AHBCLKCTRL0_RAMB_CTRL_SHIFT (2U) -/*! RAMB_CTRL - Enables the clock for the RAMB Controller - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_RAMB_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_RAMB_CTRL_SHIFT)) & SYSCON_AHBCLKCTRL0_RAMB_CTRL_MASK) - -#define SYSCON_AHBCLKCTRL0_RAMC_CTRL_MASK (0x8U) -#define SYSCON_AHBCLKCTRL0_RAMC_CTRL_SHIFT (3U) -/*! RAMC_CTRL - Enables the clock for the RAMC Controller - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_RAMC_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_RAMC_CTRL_SHIFT)) & SYSCON_AHBCLKCTRL0_RAMC_CTRL_MASK) - -#define SYSCON_AHBCLKCTRL0_RAMD_CTRL_MASK (0x10U) -#define SYSCON_AHBCLKCTRL0_RAMD_CTRL_SHIFT (4U) -/*! RAMD_CTRL - Enables the clock for the RAMD Controller - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_RAMD_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_RAMD_CTRL_SHIFT)) & SYSCON_AHBCLKCTRL0_RAMD_CTRL_MASK) - -#define SYSCON_AHBCLKCTRL0_RAME_CTRL_MASK (0x20U) -#define SYSCON_AHBCLKCTRL0_RAME_CTRL_SHIFT (5U) -/*! RAME_CTRL - Enables the clock for the RAME Controller - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_RAME_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_RAME_CTRL_SHIFT)) & SYSCON_AHBCLKCTRL0_RAME_CTRL_MASK) - -#define SYSCON_AHBCLKCTRL0_RAMF_CTRL_MASK (0x40U) -#define SYSCON_AHBCLKCTRL0_RAMF_CTRL_SHIFT (6U) -/*! RAMF_CTRL - Enables the clock for the RAMF Controller - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_RAMF_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_RAMF_CTRL_SHIFT)) & SYSCON_AHBCLKCTRL0_RAMF_CTRL_MASK) - -#define SYSCON_AHBCLKCTRL0_RAMG_CTRL_MASK (0x80U) -#define SYSCON_AHBCLKCTRL0_RAMG_CTRL_SHIFT (7U) -/*! RAMG_CTRL - Enables the clock for the RAMG Controller - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_RAMG_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_RAMG_CTRL_SHIFT)) & SYSCON_AHBCLKCTRL0_RAMG_CTRL_MASK) - -#define SYSCON_AHBCLKCTRL0_RAMH_CTRL_MASK (0x100U) -#define SYSCON_AHBCLKCTRL0_RAMH_CTRL_SHIFT (8U) -/*! RAMH_CTRL - Enables the clock for the RAMH Controller - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_RAMH_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_RAMH_CTRL_SHIFT)) & SYSCON_AHBCLKCTRL0_RAMH_CTRL_MASK) - -#define SYSCON_AHBCLKCTRL0_FMU_MASK (0x200U) -#define SYSCON_AHBCLKCTRL0_FMU_SHIFT (9U) -/*! FMU - Enables the clock for the Flash Management Unit - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_FMU(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_FMU_SHIFT)) & SYSCON_AHBCLKCTRL0_FMU_MASK) - -#define SYSCON_AHBCLKCTRL0_FMC_MASK (0x400U) -#define SYSCON_AHBCLKCTRL0_FMC_SHIFT (10U) -/*! FMC - Enables the clock for the Flash Memory Controller - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_FMC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_FMC_SHIFT)) & SYSCON_AHBCLKCTRL0_FMC_MASK) - -#define SYSCON_AHBCLKCTRL0_FLEXSPI_MASK (0x800U) -#define SYSCON_AHBCLKCTRL0_FLEXSPI_SHIFT (11U) -/*! FLEXSPI - Enables the clock for FlexSPI - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_FLEXSPI(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_FLEXSPI_SHIFT)) & SYSCON_AHBCLKCTRL0_FLEXSPI_MASK) - -#define SYSCON_AHBCLKCTRL0_MUX_MASK (0x1000U) -#define SYSCON_AHBCLKCTRL0_MUX_SHIFT (12U) -/*! MUX - Enables the clock for INPUTMUX - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_MUX(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_MUX_SHIFT)) & SYSCON_AHBCLKCTRL0_MUX_MASK) - -#define SYSCON_AHBCLKCTRL0_PORT0_MASK (0x2000U) -#define SYSCON_AHBCLKCTRL0_PORT0_SHIFT (13U) -/*! PORT0 - Enables the clock for PORT0 controller - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_PORT0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_PORT0_SHIFT)) & SYSCON_AHBCLKCTRL0_PORT0_MASK) - -#define SYSCON_AHBCLKCTRL0_PORT1_MASK (0x4000U) -#define SYSCON_AHBCLKCTRL0_PORT1_SHIFT (14U) -/*! PORT1 - Enables the clock for PORT1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_PORT1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_PORT1_SHIFT)) & SYSCON_AHBCLKCTRL0_PORT1_MASK) - -#define SYSCON_AHBCLKCTRL0_PORT2_MASK (0x8000U) -#define SYSCON_AHBCLKCTRL0_PORT2_SHIFT (15U) -/*! PORT2 - Enables the clock for PORT2 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_PORT2(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_PORT2_SHIFT)) & SYSCON_AHBCLKCTRL0_PORT2_MASK) - -#define SYSCON_AHBCLKCTRL0_PORT3_MASK (0x10000U) -#define SYSCON_AHBCLKCTRL0_PORT3_SHIFT (16U) -/*! PORT3 - Enables the clock for PORT3 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_PORT3(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_PORT3_SHIFT)) & SYSCON_AHBCLKCTRL0_PORT3_MASK) - -#define SYSCON_AHBCLKCTRL0_PORT4_MASK (0x20000U) -#define SYSCON_AHBCLKCTRL0_PORT4_SHIFT (17U) -/*! PORT4 - Enables the clock for PORT4 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_PORT4(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_PORT4_SHIFT)) & SYSCON_AHBCLKCTRL0_PORT4_MASK) - -#define SYSCON_AHBCLKCTRL0_GPIO0_MASK (0x80000U) -#define SYSCON_AHBCLKCTRL0_GPIO0_SHIFT (19U) -/*! GPIO0 - Enables the clock for GPIO0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_GPIO0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_GPIO0_SHIFT)) & SYSCON_AHBCLKCTRL0_GPIO0_MASK) - -#define SYSCON_AHBCLKCTRL0_GPIO1_MASK (0x100000U) -#define SYSCON_AHBCLKCTRL0_GPIO1_SHIFT (20U) -/*! GPIO1 - Enables the clock for GPIO1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_GPIO1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_GPIO1_SHIFT)) & SYSCON_AHBCLKCTRL0_GPIO1_MASK) - -#define SYSCON_AHBCLKCTRL0_GPIO2_MASK (0x200000U) -#define SYSCON_AHBCLKCTRL0_GPIO2_SHIFT (21U) -/*! GPIO2 - Enables the clock for GPIO2 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_GPIO2(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_GPIO2_SHIFT)) & SYSCON_AHBCLKCTRL0_GPIO2_MASK) - -#define SYSCON_AHBCLKCTRL0_GPIO3_MASK (0x400000U) -#define SYSCON_AHBCLKCTRL0_GPIO3_SHIFT (22U) -/*! GPIO3 - Enables the clock for GPIO3 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_GPIO3(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_GPIO3_SHIFT)) & SYSCON_AHBCLKCTRL0_GPIO3_MASK) - -#define SYSCON_AHBCLKCTRL0_GPIO4_MASK (0x800000U) -#define SYSCON_AHBCLKCTRL0_GPIO4_SHIFT (23U) -/*! GPIO4 - Enables the clock for GPIO4 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_GPIO4(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_GPIO4_SHIFT)) & SYSCON_AHBCLKCTRL0_GPIO4_MASK) - -#define SYSCON_AHBCLKCTRL0_PINT_MASK (0x2000000U) -#define SYSCON_AHBCLKCTRL0_PINT_SHIFT (25U) -/*! PINT - Enables the clock for PINT - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_PINT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_PINT_SHIFT)) & SYSCON_AHBCLKCTRL0_PINT_MASK) - -#define SYSCON_AHBCLKCTRL0_DMA0_MASK (0x4000000U) -#define SYSCON_AHBCLKCTRL0_DMA0_SHIFT (26U) -/*! DMA0 - Enables the clock for DMA0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_DMA0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_DMA0_SHIFT)) & SYSCON_AHBCLKCTRL0_DMA0_MASK) - -#define SYSCON_AHBCLKCTRL0_CRC_MASK (0x8000000U) -#define SYSCON_AHBCLKCTRL0_CRC_SHIFT (27U) -/*! CRC - Enables the clock for CRC - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_CRC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_CRC_SHIFT)) & SYSCON_AHBCLKCTRL0_CRC_MASK) - -#define SYSCON_AHBCLKCTRL0_WWDT0_MASK (0x10000000U) -#define SYSCON_AHBCLKCTRL0_WWDT0_SHIFT (28U) -/*! WWDT0 - Enables the clock for WWDT0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_WWDT0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_WWDT0_SHIFT)) & SYSCON_AHBCLKCTRL0_WWDT0_MASK) - -#define SYSCON_AHBCLKCTRL0_WWDT1_MASK (0x20000000U) -#define SYSCON_AHBCLKCTRL0_WWDT1_SHIFT (29U) -/*! WWDT1 - Enables the clock for WWDT1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_WWDT1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_WWDT1_SHIFT)) & SYSCON_AHBCLKCTRL0_WWDT1_MASK) - -#define SYSCON_AHBCLKCTRL0_MAILBOX_MASK (0x80000000U) -#define SYSCON_AHBCLKCTRL0_MAILBOX_SHIFT (31U) -/*! MAILBOX - Enables the clock for the Inter CPU communication Mailbox. - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL0_MAILBOX(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL0_MAILBOX_SHIFT)) & SYSCON_AHBCLKCTRL0_MAILBOX_MASK) -/*! @} */ - -/*! @name AHBCLKCTRL1 - AHB Clock Control 1 */ -/*! @{ */ - -#define SYSCON_AHBCLKCTRL1_MRT_MASK (0x1U) -#define SYSCON_AHBCLKCTRL1_MRT_SHIFT (0U) -/*! MRT - Enables the clock for MRT - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_MRT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_MRT_SHIFT)) & SYSCON_AHBCLKCTRL1_MRT_MASK) - -#define SYSCON_AHBCLKCTRL1_OSTIMER_MASK (0x2U) -#define SYSCON_AHBCLKCTRL1_OSTIMER_SHIFT (1U) -/*! OSTIMER - Enables the clock for the OS Event Timer - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_OSTIMER(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_OSTIMER_SHIFT)) & SYSCON_AHBCLKCTRL1_OSTIMER_MASK) - -#define SYSCON_AHBCLKCTRL1_SCT_MASK (0x4U) -#define SYSCON_AHBCLKCTRL1_SCT_SHIFT (2U) -/*! SCT - Enables the clock for SCT - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_SCT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_SCT_SHIFT)) & SYSCON_AHBCLKCTRL1_SCT_MASK) - -#define SYSCON_AHBCLKCTRL1_ADC0_MASK (0x8U) -#define SYSCON_AHBCLKCTRL1_ADC0_SHIFT (3U) -/*! ADC0 - Enables the clock for ADC0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_ADC0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_ADC0_SHIFT)) & SYSCON_AHBCLKCTRL1_ADC0_MASK) - -#define SYSCON_AHBCLKCTRL1_ADC1_MASK (0x10U) -#define SYSCON_AHBCLKCTRL1_ADC1_SHIFT (4U) -/*! ADC1 - Enables the clock for ADC1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_ADC1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_ADC1_SHIFT)) & SYSCON_AHBCLKCTRL1_ADC1_MASK) - -#define SYSCON_AHBCLKCTRL1_DAC0_MASK (0x20U) -#define SYSCON_AHBCLKCTRL1_DAC0_SHIFT (5U) -/*! DAC0 - Enables the clock for DAC0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_DAC0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_DAC0_SHIFT)) & SYSCON_AHBCLKCTRL1_DAC0_MASK) - -#define SYSCON_AHBCLKCTRL1_RTC_MASK (0x40U) -#define SYSCON_AHBCLKCTRL1_RTC_SHIFT (6U) -/*! RTC - Enables the clock for RTC - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_RTC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_RTC_SHIFT)) & SYSCON_AHBCLKCTRL1_RTC_MASK) - -#define SYSCON_AHBCLKCTRL1_EVSIM0_MASK (0x100U) -#define SYSCON_AHBCLKCTRL1_EVSIM0_SHIFT (8U) -/*! EVSIM0 - Enables the clock for EVSIM0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_EVSIM0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_EVSIM0_SHIFT)) & SYSCON_AHBCLKCTRL1_EVSIM0_MASK) - -#define SYSCON_AHBCLKCTRL1_EVSIM1_MASK (0x200U) -#define SYSCON_AHBCLKCTRL1_EVSIM1_SHIFT (9U) -/*! EVSIM1 - Enables the clock for EVSIM1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_EVSIM1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_EVSIM1_SHIFT)) & SYSCON_AHBCLKCTRL1_EVSIM1_MASK) - -#define SYSCON_AHBCLKCTRL1_UTICK_MASK (0x400U) -#define SYSCON_AHBCLKCTRL1_UTICK_SHIFT (10U) -/*! UTICK - Enables the clock for UTICK - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_UTICK(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_UTICK_SHIFT)) & SYSCON_AHBCLKCTRL1_UTICK_MASK) - -#define SYSCON_AHBCLKCTRL1_FC0_MASK (0x800U) -#define SYSCON_AHBCLKCTRL1_FC0_SHIFT (11U) -/*! FC0 - Enables the clock for LP_FLEXCOMM0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_FC0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_FC0_SHIFT)) & SYSCON_AHBCLKCTRL1_FC0_MASK) - -#define SYSCON_AHBCLKCTRL1_FC1_MASK (0x1000U) -#define SYSCON_AHBCLKCTRL1_FC1_SHIFT (12U) -/*! FC1 - Enables the clock for LP_FLEXCOMM1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_FC1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_FC1_SHIFT)) & SYSCON_AHBCLKCTRL1_FC1_MASK) - -#define SYSCON_AHBCLKCTRL1_FC2_MASK (0x2000U) -#define SYSCON_AHBCLKCTRL1_FC2_SHIFT (13U) -/*! FC2 - Enables the clock for LP_FLEXCOMM2 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_FC2(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_FC2_SHIFT)) & SYSCON_AHBCLKCTRL1_FC2_MASK) - -#define SYSCON_AHBCLKCTRL1_FC3_MASK (0x4000U) -#define SYSCON_AHBCLKCTRL1_FC3_SHIFT (14U) -/*! FC3 - Enables the clock for LP_FLEXCOMM3 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_FC3(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_FC3_SHIFT)) & SYSCON_AHBCLKCTRL1_FC3_MASK) - -#define SYSCON_AHBCLKCTRL1_FC4_MASK (0x8000U) -#define SYSCON_AHBCLKCTRL1_FC4_SHIFT (15U) -/*! FC4 - Enables the clock for LP_FLEXCOMM4 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_FC4(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_FC4_SHIFT)) & SYSCON_AHBCLKCTRL1_FC4_MASK) - -#define SYSCON_AHBCLKCTRL1_FC5_MASK (0x10000U) -#define SYSCON_AHBCLKCTRL1_FC5_SHIFT (16U) -/*! FC5 - Enables the clock for LP_FLEXCOMM5 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_FC5(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_FC5_SHIFT)) & SYSCON_AHBCLKCTRL1_FC5_MASK) - -#define SYSCON_AHBCLKCTRL1_FC6_MASK (0x20000U) -#define SYSCON_AHBCLKCTRL1_FC6_SHIFT (17U) -/*! FC6 - Enables the clock for LP_FLEXCOMM6 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_FC6(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_FC6_SHIFT)) & SYSCON_AHBCLKCTRL1_FC6_MASK) - -#define SYSCON_AHBCLKCTRL1_FC7_MASK (0x40000U) -#define SYSCON_AHBCLKCTRL1_FC7_SHIFT (18U) -/*! FC7 - Enables the clock for LP_FLEXCOMM7 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_FC7(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_FC7_SHIFT)) & SYSCON_AHBCLKCTRL1_FC7_MASK) - -#define SYSCON_AHBCLKCTRL1_FC8_MASK (0x80000U) -#define SYSCON_AHBCLKCTRL1_FC8_SHIFT (19U) -/*! FC8 - Enables the clock for LP_FLEXCOMM8 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_FC8(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_FC8_SHIFT)) & SYSCON_AHBCLKCTRL1_FC8_MASK) - -#define SYSCON_AHBCLKCTRL1_FC9_MASK (0x100000U) -#define SYSCON_AHBCLKCTRL1_FC9_SHIFT (20U) -/*! FC9 - Enables the clock for LP_FLEXCOMM9 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_FC9(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_FC9_SHIFT)) & SYSCON_AHBCLKCTRL1_FC9_MASK) - -#define SYSCON_AHBCLKCTRL1_MICFIL_MASK (0x200000U) -#define SYSCON_AHBCLKCTRL1_MICFIL_SHIFT (21U) -/*! MICFIL - Enables the clock for MICFIL - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_MICFIL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_MICFIL_SHIFT)) & SYSCON_AHBCLKCTRL1_MICFIL_MASK) - -#define SYSCON_AHBCLKCTRL1_TIMER2_MASK (0x400000U) -#define SYSCON_AHBCLKCTRL1_TIMER2_SHIFT (22U) -/*! TIMER2 - Enables the clock for CTIMER2 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_TIMER2(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_TIMER2_SHIFT)) & SYSCON_AHBCLKCTRL1_TIMER2_MASK) - -#define SYSCON_AHBCLKCTRL1_USB0_FS_DCD_MASK (0x1000000U) -#define SYSCON_AHBCLKCTRL1_USB0_FS_DCD_SHIFT (24U) -/*! USB0_FS_DCD - Enables the clock for USB-FS DCD - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_USB0_FS_DCD(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_USB0_FS_DCD_SHIFT)) & SYSCON_AHBCLKCTRL1_USB0_FS_DCD_MASK) - -#define SYSCON_AHBCLKCTRL1_USB0_FS_MASK (0x2000000U) -#define SYSCON_AHBCLKCTRL1_USB0_FS_SHIFT (25U) -/*! USB0_FS - Enables the clock for USB-FS - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_USB0_FS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_USB0_FS_SHIFT)) & SYSCON_AHBCLKCTRL1_USB0_FS_MASK) - -#define SYSCON_AHBCLKCTRL1_TIMER0_MASK (0x4000000U) -#define SYSCON_AHBCLKCTRL1_TIMER0_SHIFT (26U) -/*! TIMER0 - Enables the clock for CTIMER0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_TIMER0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_TIMER0_SHIFT)) & SYSCON_AHBCLKCTRL1_TIMER0_MASK) - -#define SYSCON_AHBCLKCTRL1_TIMER1_MASK (0x8000000U) -#define SYSCON_AHBCLKCTRL1_TIMER1_SHIFT (27U) -/*! TIMER1 - Enables the clock for CTIMER1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_TIMER1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_TIMER1_SHIFT)) & SYSCON_AHBCLKCTRL1_TIMER1_MASK) - -#define SYSCON_AHBCLKCTRL1_PKC_RAM_MASK (0x20000000U) -#define SYSCON_AHBCLKCTRL1_PKC_RAM_SHIFT (29U) -/*! PKC_RAM - Enables the clock for PKC RAM - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_PKC_RAM(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_PKC_RAM_SHIFT)) & SYSCON_AHBCLKCTRL1_PKC_RAM_MASK) - -#define SYSCON_AHBCLKCTRL1_SmartDMA_MASK (0x80000000U) -#define SYSCON_AHBCLKCTRL1_SmartDMA_SHIFT (31U) -/*! SmartDMA - Enables the clock for SmartDMA - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL1_SmartDMA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL1_SmartDMA_SHIFT)) & SYSCON_AHBCLKCTRL1_SmartDMA_MASK) -/*! @} */ - -/*! @name AHBCLKCTRL2 - AHB Clock Control 2 */ -/*! @{ */ - -#define SYSCON_AHBCLKCTRL2_DMA1_MASK (0x2U) -#define SYSCON_AHBCLKCTRL2_DMA1_SHIFT (1U) -/*! DMA1 - Enables the clock for DMA1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_DMA1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_DMA1_SHIFT)) & SYSCON_AHBCLKCTRL2_DMA1_MASK) - -#define SYSCON_AHBCLKCTRL2_ENET_MASK (0x4U) -#define SYSCON_AHBCLKCTRL2_ENET_SHIFT (2U) -/*! ENET - Enables the clock for Ethernet - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_ENET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_ENET_SHIFT)) & SYSCON_AHBCLKCTRL2_ENET_MASK) - -#define SYSCON_AHBCLKCTRL2_uSDHC_MASK (0x8U) -#define SYSCON_AHBCLKCTRL2_uSDHC_SHIFT (3U) -/*! uSDHC - Enables the clock for uSDHC - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_uSDHC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_uSDHC_SHIFT)) & SYSCON_AHBCLKCTRL2_uSDHC_MASK) - -#define SYSCON_AHBCLKCTRL2_FLEXIO_MASK (0x10U) -#define SYSCON_AHBCLKCTRL2_FLEXIO_SHIFT (4U) -/*! FLEXIO - Enables the clock for Flexio - * 0b1..Enable clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_FLEXIO(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_FLEXIO_SHIFT)) & SYSCON_AHBCLKCTRL2_FLEXIO_MASK) - -#define SYSCON_AHBCLKCTRL2_SAI0_MASK (0x20U) -#define SYSCON_AHBCLKCTRL2_SAI0_SHIFT (5U) -/*! SAI0 - Enables the clock for SAI0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_SAI0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_SAI0_SHIFT)) & SYSCON_AHBCLKCTRL2_SAI0_MASK) - -#define SYSCON_AHBCLKCTRL2_SAI1_MASK (0x40U) -#define SYSCON_AHBCLKCTRL2_SAI1_SHIFT (6U) -/*! SAI1 - Enables the clock for SAI1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_SAI1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_SAI1_SHIFT)) & SYSCON_AHBCLKCTRL2_SAI1_MASK) - -#define SYSCON_AHBCLKCTRL2_TRO_MASK (0x80U) -#define SYSCON_AHBCLKCTRL2_TRO_SHIFT (7U) -/*! TRO - Enables the clock for TRO - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_TRO(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_TRO_SHIFT)) & SYSCON_AHBCLKCTRL2_TRO_MASK) - -#define SYSCON_AHBCLKCTRL2_FREQME_MASK (0x100U) -#define SYSCON_AHBCLKCTRL2_FREQME_SHIFT (8U) -/*! FREQME - Enables the clock for the Frequency meter - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_FREQME(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_FREQME_SHIFT)) & SYSCON_AHBCLKCTRL2_FREQME_MASK) - -#define SYSCON_AHBCLKCTRL2_TRNG_MASK (0x2000U) -#define SYSCON_AHBCLKCTRL2_TRNG_SHIFT (13U) -/*! TRNG - Enables the clock for TRNG - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_TRNG(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_TRNG_SHIFT)) & SYSCON_AHBCLKCTRL2_TRNG_MASK) - -#define SYSCON_AHBCLKCTRL2_FLEXCAN0_MASK (0x4000U) -#define SYSCON_AHBCLKCTRL2_FLEXCAN0_SHIFT (14U) -/*! FLEXCAN0 - Enables the clock for FLEXCAN0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_FLEXCAN0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_FLEXCAN0_SHIFT)) & SYSCON_AHBCLKCTRL2_FLEXCAN0_MASK) - -#define SYSCON_AHBCLKCTRL2_FLEXCAN1_MASK (0x8000U) -#define SYSCON_AHBCLKCTRL2_FLEXCAN1_SHIFT (15U) -/*! FLEXCAN1 - Enables the clock for FLEXCAN1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_FLEXCAN1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_FLEXCAN1_SHIFT)) & SYSCON_AHBCLKCTRL2_FLEXCAN1_MASK) - -#define SYSCON_AHBCLKCTRL2_USB_HS_MASK (0x10000U) -#define SYSCON_AHBCLKCTRL2_USB_HS_SHIFT (16U) -/*! USB_HS - Enables the clock for USB HS - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_USB_HS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_USB_HS_SHIFT)) & SYSCON_AHBCLKCTRL2_USB_HS_MASK) - -#define SYSCON_AHBCLKCTRL2_USB_HS_PHY_MASK (0x20000U) -#define SYSCON_AHBCLKCTRL2_USB_HS_PHY_SHIFT (17U) -/*! USB_HS_PHY - Enables the clock for USB HS PHY - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_USB_HS_PHY(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_USB_HS_PHY_SHIFT)) & SYSCON_AHBCLKCTRL2_USB_HS_PHY_MASK) - -#define SYSCON_AHBCLKCTRL2_ELS_MASK (0x40000U) -#define SYSCON_AHBCLKCTRL2_ELS_SHIFT (18U) -/*! ELS - Enables the clock for ELS - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_ELS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_ELS_SHIFT)) & SYSCON_AHBCLKCTRL2_ELS_MASK) - -#define SYSCON_AHBCLKCTRL2_PQ_MASK (0x80000U) -#define SYSCON_AHBCLKCTRL2_PQ_SHIFT (19U) -/*! PQ - Enables the clock for Powerquad - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_PQ(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_PQ_SHIFT)) & SYSCON_AHBCLKCTRL2_PQ_MASK) - -#define SYSCON_AHBCLKCTRL2_PLU_LUT_MASK (0x100000U) -#define SYSCON_AHBCLKCTRL2_PLU_LUT_SHIFT (20U) -/*! PLU_LUT - Enables the clock for PLU_LUT - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_PLU_LUT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_PLU_LUT_SHIFT)) & SYSCON_AHBCLKCTRL2_PLU_LUT_MASK) - -#define SYSCON_AHBCLKCTRL2_TIMER3_MASK (0x200000U) -#define SYSCON_AHBCLKCTRL2_TIMER3_SHIFT (21U) -/*! TIMER3 - Enables the clock for CTIMER3 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_TIMER3(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_TIMER3_SHIFT)) & SYSCON_AHBCLKCTRL2_TIMER3_MASK) - -#define SYSCON_AHBCLKCTRL2_TIMER4_MASK (0x400000U) -#define SYSCON_AHBCLKCTRL2_TIMER4_SHIFT (22U) -/*! TIMER4 - Enables the clock for CTIMER4 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_TIMER4(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_TIMER4_SHIFT)) & SYSCON_AHBCLKCTRL2_TIMER4_MASK) - -#define SYSCON_AHBCLKCTRL2_PUF_MASK (0x800000U) -#define SYSCON_AHBCLKCTRL2_PUF_SHIFT (23U) -/*! PUF - Enables the clock for PUF - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_PUF(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_PUF_SHIFT)) & SYSCON_AHBCLKCTRL2_PUF_MASK) - -#define SYSCON_AHBCLKCTRL2_PKC_MASK (0x1000000U) -#define SYSCON_AHBCLKCTRL2_PKC_SHIFT (24U) -/*! PKC - Enables the clock for PKC - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_PKC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_PKC_SHIFT)) & SYSCON_AHBCLKCTRL2_PKC_MASK) - -#define SYSCON_AHBCLKCTRL2_SCG_MASK (0x4000000U) -#define SYSCON_AHBCLKCTRL2_SCG_SHIFT (26U) -/*! SCG - Enables the clock for SCG - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_SCG(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_SCG_SHIFT)) & SYSCON_AHBCLKCTRL2_SCG_MASK) - -#define SYSCON_AHBCLKCTRL2_GDET_MASK (0x20000000U) -#define SYSCON_AHBCLKCTRL2_GDET_SHIFT (29U) -/*! GDET - Enables the clock for GDET0 and GDET1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_GDET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_GDET_SHIFT)) & SYSCON_AHBCLKCTRL2_GDET_MASK) - -#define SYSCON_AHBCLKCTRL2_SM3_MASK (0x40000000U) -#define SYSCON_AHBCLKCTRL2_SM3_SHIFT (30U) -/*! SM3 - Enables the clock for SM3 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL2_SM3(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL2_SM3_SHIFT)) & SYSCON_AHBCLKCTRL2_SM3_MASK) -/*! @} */ - -/*! @name AHBCLKCTRL3 - AHB Clock Control 3 */ -/*! @{ */ - -#define SYSCON_AHBCLKCTRL3_I3C0_MASK (0x1U) -#define SYSCON_AHBCLKCTRL3_I3C0_SHIFT (0U) -/*! I3C0 - Enables the clock for I3C0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_I3C0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_I3C0_SHIFT)) & SYSCON_AHBCLKCTRL3_I3C0_MASK) - -#define SYSCON_AHBCLKCTRL3_I3C1_MASK (0x2U) -#define SYSCON_AHBCLKCTRL3_I3C1_SHIFT (1U) -/*! I3C1 - Enables the clock for I3C1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_I3C1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_I3C1_SHIFT)) & SYSCON_AHBCLKCTRL3_I3C1_MASK) - -#define SYSCON_AHBCLKCTRL3_SINC_MASK (0x4U) -#define SYSCON_AHBCLKCTRL3_SINC_SHIFT (2U) -/*! SINC - Enables the clock for SINC - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_SINC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_SINC_SHIFT)) & SYSCON_AHBCLKCTRL3_SINC_MASK) - -#define SYSCON_AHBCLKCTRL3_COOLFLUX_MASK (0x8U) -#define SYSCON_AHBCLKCTRL3_COOLFLUX_SHIFT (3U) -/*! COOLFLUX - Enables the clock for CoolFlux - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_COOLFLUX(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_COOLFLUX_SHIFT)) & SYSCON_AHBCLKCTRL3_COOLFLUX_MASK) - -#define SYSCON_AHBCLKCTRL3_QDC0_MASK (0x10U) -#define SYSCON_AHBCLKCTRL3_QDC0_SHIFT (4U) -/*! QDC0 - Enables the clock for QDC0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_QDC0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_QDC0_SHIFT)) & SYSCON_AHBCLKCTRL3_QDC0_MASK) - -#define SYSCON_AHBCLKCTRL3_QDC1_MASK (0x20U) -#define SYSCON_AHBCLKCTRL3_QDC1_SHIFT (5U) -/*! QDC1 - Enables the clock for QDC1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_QDC1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_QDC1_SHIFT)) & SYSCON_AHBCLKCTRL3_QDC1_MASK) - -#define SYSCON_AHBCLKCTRL3_PWM0_MASK (0x40U) -#define SYSCON_AHBCLKCTRL3_PWM0_SHIFT (6U) -/*! PWM0 - Enables the clock for PWM0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_PWM0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_PWM0_SHIFT)) & SYSCON_AHBCLKCTRL3_PWM0_MASK) - -#define SYSCON_AHBCLKCTRL3_PWM1_MASK (0x80U) -#define SYSCON_AHBCLKCTRL3_PWM1_SHIFT (7U) -/*! PWM1 - Enables the clock for PWM1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_PWM1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_PWM1_SHIFT)) & SYSCON_AHBCLKCTRL3_PWM1_MASK) - -#define SYSCON_AHBCLKCTRL3_EVTG_MASK (0x100U) -#define SYSCON_AHBCLKCTRL3_EVTG_SHIFT (8U) -/*! EVTG - Enables the clock for EVTG - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_EVTG(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_EVTG_SHIFT)) & SYSCON_AHBCLKCTRL3_EVTG_MASK) - -#define SYSCON_AHBCLKCTRL3_DAC1_MASK (0x800U) -#define SYSCON_AHBCLKCTRL3_DAC1_SHIFT (11U) -/*! DAC1 - Enables the clock for DAC1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_DAC1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_DAC1_SHIFT)) & SYSCON_AHBCLKCTRL3_DAC1_MASK) - -#define SYSCON_AHBCLKCTRL3_DAC2_MASK (0x1000U) -#define SYSCON_AHBCLKCTRL3_DAC2_SHIFT (12U) -/*! DAC2 - Enables the clock for DAC2 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_DAC2(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_DAC2_SHIFT)) & SYSCON_AHBCLKCTRL3_DAC2_MASK) - -#define SYSCON_AHBCLKCTRL3_OPAMP0_MASK (0x2000U) -#define SYSCON_AHBCLKCTRL3_OPAMP0_SHIFT (13U) -/*! OPAMP0 - Enables the clock for OPAMP0 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_OPAMP0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_OPAMP0_SHIFT)) & SYSCON_AHBCLKCTRL3_OPAMP0_MASK) - -#define SYSCON_AHBCLKCTRL3_OPAMP1_MASK (0x4000U) -#define SYSCON_AHBCLKCTRL3_OPAMP1_SHIFT (14U) -/*! OPAMP1 - Enables the clock for OPAMP1 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_OPAMP1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_OPAMP1_SHIFT)) & SYSCON_AHBCLKCTRL3_OPAMP1_MASK) - -#define SYSCON_AHBCLKCTRL3_OPAMP2_MASK (0x8000U) -#define SYSCON_AHBCLKCTRL3_OPAMP2_SHIFT (15U) -/*! OPAMP2 - Enables the clock for OPAMP2 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_OPAMP2(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_OPAMP2_SHIFT)) & SYSCON_AHBCLKCTRL3_OPAMP2_MASK) - -#define SYSCON_AHBCLKCTRL3_CMP2_MASK (0x40000U) -#define SYSCON_AHBCLKCTRL3_CMP2_SHIFT (18U) -/*! CMP2 - Enables the clock for CMP2 - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_CMP2(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_CMP2_SHIFT)) & SYSCON_AHBCLKCTRL3_CMP2_MASK) - -#define SYSCON_AHBCLKCTRL3_VREF_MASK (0x80000U) -#define SYSCON_AHBCLKCTRL3_VREF_SHIFT (19U) -/*! VREF - Enables the clock for VREF - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_VREF(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_VREF_SHIFT)) & SYSCON_AHBCLKCTRL3_VREF_MASK) - -#define SYSCON_AHBCLKCTRL3_COOLFLUX_APB_MASK (0x100000U) -#define SYSCON_AHBCLKCTRL3_COOLFLUX_APB_SHIFT (20U) -/*! COOLFLUX_APB - Enables the clock for CoolFlux APB - * 0b1..Enables clock (CoolFlux needs to be properly programmed before the clock enabled.) - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_COOLFLUX_APB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_COOLFLUX_APB_SHIFT)) & SYSCON_AHBCLKCTRL3_COOLFLUX_APB_MASK) - -#define SYSCON_AHBCLKCTRL3_NPU_MASK (0x200000U) -#define SYSCON_AHBCLKCTRL3_NPU_SHIFT (21U) -/*! NPU - Enables the clock for NPU - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_NPU(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_NPU_SHIFT)) & SYSCON_AHBCLKCTRL3_NPU_MASK) - -#define SYSCON_AHBCLKCTRL3_TSI_MASK (0x400000U) -#define SYSCON_AHBCLKCTRL3_TSI_SHIFT (22U) -/*! TSI - Enables the clock for TSI - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_TSI(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_TSI_SHIFT)) & SYSCON_AHBCLKCTRL3_TSI_MASK) - -#define SYSCON_AHBCLKCTRL3_EWM_MASK (0x800000U) -#define SYSCON_AHBCLKCTRL3_EWM_SHIFT (23U) -/*! EWM - Enables the clock for EWM - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_EWM(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_EWM_SHIFT)) & SYSCON_AHBCLKCTRL3_EWM_MASK) - -#define SYSCON_AHBCLKCTRL3_EIM_MASK (0x1000000U) -#define SYSCON_AHBCLKCTRL3_EIM_SHIFT (24U) -/*! EIM - Enables the clock for EIM - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_EIM(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_EIM_SHIFT)) & SYSCON_AHBCLKCTRL3_EIM_MASK) - -#define SYSCON_AHBCLKCTRL3_ERM_MASK (0x2000000U) -#define SYSCON_AHBCLKCTRL3_ERM_SHIFT (25U) -/*! ERM - Enables the clock for ERM - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_ERM(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_ERM_SHIFT)) & SYSCON_AHBCLKCTRL3_ERM_MASK) - -#define SYSCON_AHBCLKCTRL3_INTM_MASK (0x4000000U) -#define SYSCON_AHBCLKCTRL3_INTM_SHIFT (26U) -/*! INTM - Enables the clock for INTM - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_INTM(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_INTM_SHIFT)) & SYSCON_AHBCLKCTRL3_INTM_MASK) - -#define SYSCON_AHBCLKCTRL3_SEMA42_MASK (0x8000000U) -#define SYSCON_AHBCLKCTRL3_SEMA42_SHIFT (27U) -/*! SEMA42 - Enables the clock for Semaphore - * 0b1..Enables clock - * 0b0..Disables clock - */ -#define SYSCON_AHBCLKCTRL3_SEMA42(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRL3_SEMA42_SHIFT)) & SYSCON_AHBCLKCTRL3_SEMA42_MASK) -/*! @} */ - -/*! @name AHBCLKCTRLSET - AHB Clock Control Set */ -/*! @{ */ - -#define SYSCON_AHBCLKCTRLSET_DATA_MASK (0xFFFFFFFFU) -#define SYSCON_AHBCLKCTRLSET_DATA_SHIFT (0U) -/*! DATA - Data array value */ -#define SYSCON_AHBCLKCTRLSET_DATA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRLSET_DATA_SHIFT)) & SYSCON_AHBCLKCTRLSET_DATA_MASK) -/*! @} */ - -/* The count of SYSCON_AHBCLKCTRLSET */ -#define SYSCON_AHBCLKCTRLSET_COUNT (4U) - -/*! @name AHBCLKCTRLCLR - AHB Clock Control Clear */ -/*! @{ */ - -#define SYSCON_AHBCLKCTRLCLR_DATA_MASK (0xFFFFFFFFU) -#define SYSCON_AHBCLKCTRLCLR_DATA_SHIFT (0U) -/*! DATA - Data array value */ -#define SYSCON_AHBCLKCTRLCLR_DATA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKCTRLCLR_DATA_SHIFT)) & SYSCON_AHBCLKCTRLCLR_DATA_MASK) -/*! @} */ - -/* The count of SYSCON_AHBCLKCTRLCLR */ -#define SYSCON_AHBCLKCTRLCLR_COUNT (4U) - -/*! @name SYSTICKCLKSEL0 - CPU0 System Tick Timer Source Select */ -/*! @{ */ - -#define SYSCON_SYSTICKCLKSEL0_SEL_MASK (0x7U) -#define SYSCON_SYSTICKCLKSEL0_SEL_SHIFT (0U) -/*! SEL - Selects the System Tick Timer for CPU0 source - * 0b000..SYSTICKCLKDIV0 output - * 0b001..Clk 1 MHz clock - * 0b010..LP Oscillator clock - * 0b011..No clock - * 0b100..No clock - * 0b101..No clock - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_SYSTICKCLKSEL0_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SYSTICKCLKSEL0_SEL_SHIFT)) & SYSCON_SYSTICKCLKSEL0_SEL_MASK) -/*! @} */ - -/*! @name SYSTICKCLKSEL1 - CPU1 System Tick Timer Source Select */ -/*! @{ */ - -#define SYSCON_SYSTICKCLKSEL1_SEL_MASK (0x7U) -#define SYSCON_SYSTICKCLKSEL1_SEL_SHIFT (0U) -/*! SEL - Selects the System Tick Timer for CPU1 source. - * 0b000..SYSTICKCLKDIV1 output - * 0b001..Clk 1 MHz clock - * 0b010..LP Oscillator clock - * 0b011..No clock - * 0b100..No clock - * 0b101..No clock - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_SYSTICKCLKSEL1_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SYSTICKCLKSEL1_SEL_SHIFT)) & SYSCON_SYSTICKCLKSEL1_SEL_MASK) -/*! @} */ - -/*! @name TRACECLKSEL - Trace Clock Source Select */ -/*! @{ */ - -#define SYSCON_TRACECLKSEL_SEL_MASK (0x7U) -#define SYSCON_TRACECLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the trace clock source. - * 0b000..TRACECLKDIV output - * 0b001..Clk 1 MHz clock - * 0b010..LP Oscillator clock - * 0b011..No clock - * 0b100..No clock - * 0b101..No clock - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_TRACECLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_TRACECLKSEL_SEL_SHIFT)) & SYSCON_TRACECLKSEL_SEL_MASK) -/*! @} */ - -/*! @name CTIMERCLKSEL - CTIMER Clock Source Select */ -/*! @{ */ - -#define SYSCON_CTIMERCLKSEL_SEL_MASK (0xFU) -#define SYSCON_CTIMERCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the CTIMER clock source. - * 0b0000..FRO_1M clock - * 0b0001..PLL0 clock - * 0b0010..PLL1_clk0 clock - * 0b0011..FRO_HF clock - * 0b0100..FRO 12MHz clock - * 0b0101..SAI0 MCLK IN clock - * 0b0110..LP Oscillator clock - * 0b0111..No clock - * 0b1000..SAI1 MCLK IN clock - * 0b1001..SAI0 TX_BCLK clock - * 0b1010..SAI0 RX_BCLK clock - * 0b1011..SAI1 TX_BCLK clock - * 0b1100..SAI1 RX_BCLK clock - * 0b1101..No clock - * 0b1110..No clock - * 0b1111..No clock - */ -#define SYSCON_CTIMERCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERCLKSEL_SEL_SHIFT)) & SYSCON_CTIMERCLKSEL_SEL_MASK) -/*! @} */ - -/* The count of SYSCON_CTIMERCLKSEL */ -#define SYSCON_CTIMERCLKSEL_COUNT (5U) - -/*! @name CLKOUTSEL - CLKOUT Clock Source Select */ -/*! @{ */ - -#define SYSCON_CLKOUTSEL_SEL_MASK (0xFU) -#define SYSCON_CLKOUTSEL_SEL_SHIFT (0U) -/*! SEL - Selects the CLKOUT clock source. - * 0b0000..Main clock (main_clk) - * 0b0001..PLL0 clock (pll0_clk) - * 0b0010..CLKIN clock (clk_in) - * 0b0011..FRO_HF clock (fro_hf) - * 0b0100..FRO 12 MHz clock (fro_12m) - * 0b0101..PLL1_clk0 clock (pll1_clk) - * 0b0110..LP Oscillator clock (lp_osc) - * 0b0111..USB PLL clock (usb_pll_clk) - * 0b1000..No clock - * 0b1001..No clock - * 0b1010..No clock - * 0b1011..No clock - * 0b1100..No clock - * 0b1101..No clock - * 0b1110..No clock - * 0b1111..No clock - */ -#define SYSCON_CLKOUTSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLKOUTSEL_SEL_SHIFT)) & SYSCON_CLKOUTSEL_SEL_MASK) -/*! @} */ - -/*! @name ADC0CLKSEL - ADC0 Clock Source Select */ -/*! @{ */ - -#define SYSCON_ADC0CLKSEL_SEL_MASK (0x7U) -#define SYSCON_ADC0CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the ADC0 clock source. - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..FRO_HF clock - * 0b011..FRO 12 MHz clock - * 0b100..Clk_in - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_ADC0CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ADC0CLKSEL_SEL_SHIFT)) & SYSCON_ADC0CLKSEL_SEL_MASK) -/*! @} */ - -/*! @name USB0CLKSEL - USB-FS Clock Source Select */ -/*! @{ */ - -#define SYSCON_USB0CLKSEL_SEL_MASK (0x7U) -#define SYSCON_USB0CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the USB-FS clock source. - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..No clock - * 0b011..Clk 48 MHz clock - * 0b100..Clk_in - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_USB0CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_USB0CLKSEL_SEL_SHIFT)) & SYSCON_USB0CLKSEL_SEL_MASK) -/*! @} */ - -/*! @name FCCLKSEL - LP_FLEXCOMM Clock Source Select for Fractional Rate Divider */ -/*! @{ */ - -#define SYSCON_FCCLKSEL_SEL_MASK (0x7U) -#define SYSCON_FCCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the LP_FLEXCOMM clock source for Fractional Rate Divider. - * 0b000..No clock - * 0b001..PLL divided clock - * 0b010..FRO 12 MHz clock - * 0b011..fro_hf_div clock - * 0b100..clk_1m clock - * 0b101..USB PLL clock - * 0b110..LP Oscillator clock - * 0b111..No clock - */ -#define SYSCON_FCCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FCCLKSEL_SEL_SHIFT)) & SYSCON_FCCLKSEL_SEL_MASK) -/*! @} */ - -/* The count of SYSCON_FCCLKSEL */ -#define SYSCON_FCCLKSEL_COUNT (10U) - -/*! @name SCTCLKSEL - SCTimer/PWM Clock Source Select */ -/*! @{ */ - -#define SYSCON_SCTCLKSEL_SEL_MASK (0xFU) -#define SYSCON_SCTCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the SCTimer/PWM clock source. - * 0b0000..No clock - * 0b0001..PLL0 clock - * 0b0010..CLKIN clock - * 0b0011..FRO_HF clock - * 0b0100..PLL1_clk0 clock - * 0b0101..SAI0 MCLK_IN clock - * 0b0110..USB PLL clock - * 0b0111..No clock - * 0b1000..SAI1 MCLK_IN clock - * 0b1001..No clock - * 0b1010..No clock - * 0b1011..No clock - * 0b1100..No clock - * 0b1101..No clock - * 0b1110..No clock - * 0b1111..No clock - */ -#define SYSCON_SCTCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SCTCLKSEL_SEL_SHIFT)) & SYSCON_SCTCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name SYSTICKCLKDIV - CPU0 System Tick Timer Divider..CPU1 System Tick Timer Divider */ -/*! @{ */ - -#define SYSCON_SYSTICKCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_SYSTICKCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_SYSTICKCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SYSTICKCLKDIV_DIV_SHIFT)) & SYSCON_SYSTICKCLKDIV_DIV_MASK) - -#define SYSCON_SYSTICKCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_SYSTICKCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset. - * 0b0..Divider is not reset - */ -#define SYSCON_SYSTICKCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SYSTICKCLKDIV_RESET_SHIFT)) & SYSCON_SYSTICKCLKDIV_RESET_MASK) - -#define SYSCON_SYSTICKCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_SYSTICKCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_SYSTICKCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SYSTICKCLKDIV_HALT_SHIFT)) & SYSCON_SYSTICKCLKDIV_HALT_MASK) - -#define SYSCON_SYSTICKCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_SYSTICKCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_SYSTICKCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SYSTICKCLKDIV_UNSTAB_SHIFT)) & SYSCON_SYSTICKCLKDIV_UNSTAB_MASK) -/*! @} */ - -/* The count of SYSCON_SYSTICKCLKDIV */ -#define SYSCON_SYSTICKCLKDIV_COUNT (2U) - -/*! @name TRACECLKDIV - TRACE Clock Divider */ -/*! @{ */ - -#define SYSCON_TRACECLKDIV_DIV_MASK (0xFFU) -#define SYSCON_TRACECLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_TRACECLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_TRACECLKDIV_DIV_SHIFT)) & SYSCON_TRACECLKDIV_DIV_MASK) - -#define SYSCON_TRACECLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_TRACECLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_TRACECLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_TRACECLKDIV_RESET_SHIFT)) & SYSCON_TRACECLKDIV_RESET_MASK) - -#define SYSCON_TRACECLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_TRACECLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_TRACECLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_TRACECLKDIV_HALT_SHIFT)) & SYSCON_TRACECLKDIV_HALT_MASK) - -#define SYSCON_TRACECLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_TRACECLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_TRACECLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_TRACECLKDIV_UNSTAB_SHIFT)) & SYSCON_TRACECLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name TSICLKSEL - TSI Function Clock Source Select */ -/*! @{ */ - -#define SYSCON_TSICLKSEL_SEL_MASK (0x7U) -#define SYSCON_TSICLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the TSI function clock source. - * 0b000..No clock - * 0b001..No clock - * 0b010..clk_in - * 0b011..No clock - * 0b100..FRO_12Mhz clock - * 0b101..No clock - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_TSICLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_TSICLKSEL_SEL_SHIFT)) & SYSCON_TSICLKSEL_SEL_MASK) -/*! @} */ - -/*! @name SINCFILTCLKSEL - SINC FILTER Function Clock Source Select */ -/*! @{ */ - -#define SYSCON_SINCFILTCLKSEL_SEL_MASK (0x7U) -#define SYSCON_SINCFILTCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the SINC FILTER function clock source. - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..clk_in - * 0b011..FRO_HF clock - * 0b100..FRO_12Mhz clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_SINCFILTCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SINCFILTCLKSEL_SEL_SHIFT)) & SYSCON_SINCFILTCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name SLOWCLKDIV - SLOW_CLK Clock Divider */ -/*! @{ */ - -#define SYSCON_SLOWCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_SLOWCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_SLOWCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SLOWCLKDIV_RESET_SHIFT)) & SYSCON_SLOWCLKDIV_RESET_MASK) - -#define SYSCON_SLOWCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_SLOWCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_SLOWCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SLOWCLKDIV_HALT_SHIFT)) & SYSCON_SLOWCLKDIV_HALT_MASK) - -#define SYSCON_SLOWCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_SLOWCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_SLOWCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SLOWCLKDIV_UNSTAB_SHIFT)) & SYSCON_SLOWCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name TSICLKDIV - TSI Function Clock Divider */ -/*! @{ */ - -#define SYSCON_TSICLKDIV_DIV_MASK (0xFFU) -#define SYSCON_TSICLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value: */ -#define SYSCON_TSICLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_TSICLKDIV_DIV_SHIFT)) & SYSCON_TSICLKDIV_DIV_MASK) - -#define SYSCON_TSICLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_TSICLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_TSICLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_TSICLKDIV_RESET_SHIFT)) & SYSCON_TSICLKDIV_RESET_MASK) - -#define SYSCON_TSICLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_TSICLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_TSICLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_TSICLKDIV_HALT_SHIFT)) & SYSCON_TSICLKDIV_HALT_MASK) - -#define SYSCON_TSICLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_TSICLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_TSICLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_TSICLKDIV_UNSTAB_SHIFT)) & SYSCON_TSICLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name AHBCLKDIV - System Clock Divider */ -/*! @{ */ - -#define SYSCON_AHBCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_AHBCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_AHBCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKDIV_DIV_SHIFT)) & SYSCON_AHBCLKDIV_DIV_MASK) - -#define SYSCON_AHBCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_AHBCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_AHBCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AHBCLKDIV_UNSTAB_SHIFT)) & SYSCON_AHBCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name CLKOUTDIV - CLKOUT Clock Divider */ -/*! @{ */ - -#define SYSCON_CLKOUTDIV_DIV_MASK (0xFFU) -#define SYSCON_CLKOUTDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_CLKOUTDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLKOUTDIV_DIV_SHIFT)) & SYSCON_CLKOUTDIV_DIV_MASK) - -#define SYSCON_CLKOUTDIV_RESET_MASK (0x20000000U) -#define SYSCON_CLKOUTDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_CLKOUTDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLKOUTDIV_RESET_SHIFT)) & SYSCON_CLKOUTDIV_RESET_MASK) - -#define SYSCON_CLKOUTDIV_HALT_MASK (0x40000000U) -#define SYSCON_CLKOUTDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_CLKOUTDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLKOUTDIV_HALT_SHIFT)) & SYSCON_CLKOUTDIV_HALT_MASK) - -#define SYSCON_CLKOUTDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_CLKOUTDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_CLKOUTDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLKOUTDIV_UNSTAB_SHIFT)) & SYSCON_CLKOUTDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name FROHFDIV - FRO_HF_DIV Clock Divider */ -/*! @{ */ - -#define SYSCON_FROHFDIV_DIV_MASK (0xFFU) -#define SYSCON_FROHFDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_FROHFDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FROHFDIV_DIV_SHIFT)) & SYSCON_FROHFDIV_DIV_MASK) - -#define SYSCON_FROHFDIV_HALT_MASK (0x40000000U) -#define SYSCON_FROHFDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running, this bit is set to 0 when the register is written. - */ -#define SYSCON_FROHFDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FROHFDIV_HALT_SHIFT)) & SYSCON_FROHFDIV_HALT_MASK) - -#define SYSCON_FROHFDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_FROHFDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_FROHFDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FROHFDIV_UNSTAB_SHIFT)) & SYSCON_FROHFDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name WDT0CLKDIV - WDT0 Clock Divider */ -/*! @{ */ - -#define SYSCON_WDT0CLKDIV_DIV_MASK (0x3FU) -#define SYSCON_WDT0CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_WDT0CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_WDT0CLKDIV_DIV_SHIFT)) & SYSCON_WDT0CLKDIV_DIV_MASK) - -#define SYSCON_WDT0CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_WDT0CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_WDT0CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_WDT0CLKDIV_RESET_SHIFT)) & SYSCON_WDT0CLKDIV_RESET_MASK) - -#define SYSCON_WDT0CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_WDT0CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_WDT0CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_WDT0CLKDIV_HALT_SHIFT)) & SYSCON_WDT0CLKDIV_HALT_MASK) - -#define SYSCON_WDT0CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_WDT0CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_WDT0CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_WDT0CLKDIV_UNSTAB_SHIFT)) & SYSCON_WDT0CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name ADC0CLKDIV - ADC0 Clock Divider */ -/*! @{ */ - -#define SYSCON_ADC0CLKDIV_DIV_MASK (0x7U) -#define SYSCON_ADC0CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_ADC0CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ADC0CLKDIV_DIV_SHIFT)) & SYSCON_ADC0CLKDIV_DIV_MASK) - -#define SYSCON_ADC0CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_ADC0CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_ADC0CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ADC0CLKDIV_RESET_SHIFT)) & SYSCON_ADC0CLKDIV_RESET_MASK) - -#define SYSCON_ADC0CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_ADC0CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_ADC0CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ADC0CLKDIV_HALT_SHIFT)) & SYSCON_ADC0CLKDIV_HALT_MASK) - -#define SYSCON_ADC0CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_ADC0CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_ADC0CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ADC0CLKDIV_UNSTAB_SHIFT)) & SYSCON_ADC0CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name USB0CLKDIV - USB-FS Clock Divider */ -/*! @{ */ - -#define SYSCON_USB0CLKDIV_DIV_MASK (0xFFU) -#define SYSCON_USB0CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_USB0CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_USB0CLKDIV_DIV_SHIFT)) & SYSCON_USB0CLKDIV_DIV_MASK) - -#define SYSCON_USB0CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_USB0CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_USB0CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_USB0CLKDIV_RESET_SHIFT)) & SYSCON_USB0CLKDIV_RESET_MASK) - -#define SYSCON_USB0CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_USB0CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_USB0CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_USB0CLKDIV_HALT_SHIFT)) & SYSCON_USB0CLKDIV_HALT_MASK) - -#define SYSCON_USB0CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_USB0CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_USB0CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_USB0CLKDIV_UNSTAB_SHIFT)) & SYSCON_USB0CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name SCTCLKDIV - SCT/PWM Clock Divider */ -/*! @{ */ - -#define SYSCON_SCTCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_SCTCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_SCTCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SCTCLKDIV_DIV_SHIFT)) & SYSCON_SCTCLKDIV_DIV_MASK) - -#define SYSCON_SCTCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_SCTCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_SCTCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SCTCLKDIV_RESET_SHIFT)) & SYSCON_SCTCLKDIV_RESET_MASK) - -#define SYSCON_SCTCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_SCTCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_SCTCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SCTCLKDIV_HALT_SHIFT)) & SYSCON_SCTCLKDIV_HALT_MASK) - -#define SYSCON_SCTCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_SCTCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_SCTCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SCTCLKDIV_UNSTAB_SHIFT)) & SYSCON_SCTCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name PLLCLKDIV - PLL Clock Divider */ -/*! @{ */ - -#define SYSCON_PLLCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_PLLCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_PLLCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLLCLKDIV_DIV_SHIFT)) & SYSCON_PLLCLKDIV_DIV_MASK) - -#define SYSCON_PLLCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_PLLCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_PLLCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLLCLKDIV_RESET_SHIFT)) & SYSCON_PLLCLKDIV_RESET_MASK) - -#define SYSCON_PLLCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_PLLCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_PLLCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLLCLKDIV_HALT_SHIFT)) & SYSCON_PLLCLKDIV_HALT_MASK) - -#define SYSCON_PLLCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_PLLCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_PLLCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLLCLKDIV_UNSTAB_SHIFT)) & SYSCON_PLLCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name CTIMERXCLKDIV_CTIMERCLKDIV - CTimer Clock Divider */ -/*! @{ */ - -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_DIV_SHIFT)) & SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_DIV_MASK) - -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b0..Divider is not reset - * 0b1..Divider is reset - */ -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_RESET_SHIFT)) & SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_RESET_MASK) - -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b0..Divider clock is running - * 0b1..Divider clock has stopped - */ -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_HALT_SHIFT)) & SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_HALT_MASK) - -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b0..Stable divider clock - * 0b1..Unstable clock frequency - */ -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_UNSTAB_SHIFT)) & SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_UNSTAB_MASK) -/*! @} */ - -/* The count of SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV */ -#define SYSCON_CTIMERXCLKDIV_CTIMERCLKDIV_COUNT (5U) - -/*! @name PLL1CLK0DIV - PLL1 Clock 0 Divider */ -/*! @{ */ - -#define SYSCON_PLL1CLK0DIV_DIV_MASK (0xFFU) -#define SYSCON_PLL1CLK0DIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_PLL1CLK0DIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLL1CLK0DIV_DIV_SHIFT)) & SYSCON_PLL1CLK0DIV_DIV_MASK) - -#define SYSCON_PLL1CLK0DIV_RESET_MASK (0x20000000U) -#define SYSCON_PLL1CLK0DIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_PLL1CLK0DIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLL1CLK0DIV_RESET_SHIFT)) & SYSCON_PLL1CLK0DIV_RESET_MASK) - -#define SYSCON_PLL1CLK0DIV_HALT_MASK (0x40000000U) -#define SYSCON_PLL1CLK0DIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_PLL1CLK0DIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLL1CLK0DIV_HALT_SHIFT)) & SYSCON_PLL1CLK0DIV_HALT_MASK) - -#define SYSCON_PLL1CLK0DIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_PLL1CLK0DIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_PLL1CLK0DIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLL1CLK0DIV_UNSTAB_SHIFT)) & SYSCON_PLL1CLK0DIV_UNSTAB_MASK) -/*! @} */ - -/*! @name PLL1CLK1DIV - PLL1 Clock 1 Divider */ -/*! @{ */ - -#define SYSCON_PLL1CLK1DIV_DIV_MASK (0xFFU) -#define SYSCON_PLL1CLK1DIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_PLL1CLK1DIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLL1CLK1DIV_DIV_SHIFT)) & SYSCON_PLL1CLK1DIV_DIV_MASK) - -#define SYSCON_PLL1CLK1DIV_RESET_MASK (0x20000000U) -#define SYSCON_PLL1CLK1DIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_PLL1CLK1DIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLL1CLK1DIV_RESET_SHIFT)) & SYSCON_PLL1CLK1DIV_RESET_MASK) - -#define SYSCON_PLL1CLK1DIV_HALT_MASK (0x40000000U) -#define SYSCON_PLL1CLK1DIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_PLL1CLK1DIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLL1CLK1DIV_HALT_SHIFT)) & SYSCON_PLL1CLK1DIV_HALT_MASK) - -#define SYSCON_PLL1CLK1DIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_PLL1CLK1DIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_PLL1CLK1DIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLL1CLK1DIV_UNSTAB_SHIFT)) & SYSCON_PLL1CLK1DIV_UNSTAB_MASK) -/*! @} */ - -/*! @name UTICKCLKDIV - UTICK Clock Divider */ -/*! @{ */ - -#define SYSCON_UTICKCLKDIV_DIV_MASK (0x3FU) -#define SYSCON_UTICKCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_UTICKCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_UTICKCLKDIV_DIV_SHIFT)) & SYSCON_UTICKCLKDIV_DIV_MASK) - -#define SYSCON_UTICKCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_UTICKCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_UTICKCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_UTICKCLKDIV_RESET_SHIFT)) & SYSCON_UTICKCLKDIV_RESET_MASK) - -#define SYSCON_UTICKCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_UTICKCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_UTICKCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_UTICKCLKDIV_HALT_SHIFT)) & SYSCON_UTICKCLKDIV_HALT_MASK) - -#define SYSCON_UTICKCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_UTICKCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_UTICKCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_UTICKCLKDIV_UNSTAB_SHIFT)) & SYSCON_UTICKCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name CLKOUT_FRGCTRL - CLKOUT FRG Control */ -/*! @{ */ - -#define SYSCON_CLKOUT_FRGCTRL_DIV_MASK (0xFFU) -#define SYSCON_CLKOUT_FRGCTRL_DIV_SHIFT (0U) -/*! DIV - Divider value */ -#define SYSCON_CLKOUT_FRGCTRL_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLKOUT_FRGCTRL_DIV_SHIFT)) & SYSCON_CLKOUT_FRGCTRL_DIV_MASK) - -#define SYSCON_CLKOUT_FRGCTRL_MULT_MASK (0xFF00U) -#define SYSCON_CLKOUT_FRGCTRL_MULT_SHIFT (8U) -/*! MULT - Numerator value */ -#define SYSCON_CLKOUT_FRGCTRL_MULT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLKOUT_FRGCTRL_MULT_SHIFT)) & SYSCON_CLKOUT_FRGCTRL_MULT_MASK) -/*! @} */ - -/*! @name CLKUNLOCK - Clock Configuration Unlock */ -/*! @{ */ - -#define SYSCON_CLKUNLOCK_UNLOCK_MASK (0x1U) -#define SYSCON_CLKUNLOCK_UNLOCK_SHIFT (0U) -/*! UNLOCK - Controls clock configuration registers access (for example, xxxDIV, xxxSEL) - * 0b1..Freezes all clock configuration registers update - * 0b0..Updates are allowed to all clock configuration registers - */ -#define SYSCON_CLKUNLOCK_UNLOCK(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLKUNLOCK_UNLOCK_SHIFT)) & SYSCON_CLKUNLOCK_UNLOCK_MASK) -/*! @} */ - -/*! @name NVM_CTRL - NVM Control */ -/*! @{ */ - -#define SYSCON_NVM_CTRL_DIS_FLASH_SPEC_MASK (0x1U) -#define SYSCON_NVM_CTRL_DIS_FLASH_SPEC_SHIFT (0U) -/*! DIS_FLASH_SPEC - Flash speculation control - * 0b0..Enables flash speculation - * 0b1..Disables flash speculation - */ -#define SYSCON_NVM_CTRL_DIS_FLASH_SPEC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_DIS_FLASH_SPEC_SHIFT)) & SYSCON_NVM_CTRL_DIS_FLASH_SPEC_MASK) - -#define SYSCON_NVM_CTRL_DIS_DATA_SPEC_MASK (0x2U) -#define SYSCON_NVM_CTRL_DIS_DATA_SPEC_SHIFT (1U) -/*! DIS_DATA_SPEC - Flash data speculation control - * 0b0..Enables data speculation - * 0b1..Disables data speculation - */ -#define SYSCON_NVM_CTRL_DIS_DATA_SPEC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_DIS_DATA_SPEC_SHIFT)) & SYSCON_NVM_CTRL_DIS_DATA_SPEC_MASK) - -#define SYSCON_NVM_CTRL_DIS_FLASH_CACHE_MASK (0x4U) -#define SYSCON_NVM_CTRL_DIS_FLASH_CACHE_SHIFT (2U) -/*! DIS_FLASH_CACHE - Flash cache control - * 0b0..Enables flash cache - * 0b1..Disables flash cache - */ -#define SYSCON_NVM_CTRL_DIS_FLASH_CACHE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_DIS_FLASH_CACHE_SHIFT)) & SYSCON_NVM_CTRL_DIS_FLASH_CACHE_MASK) - -#define SYSCON_NVM_CTRL_DIS_FLASH_INST_MASK (0x8U) -#define SYSCON_NVM_CTRL_DIS_FLASH_INST_SHIFT (3U) -/*! DIS_FLASH_INST - Flash instruction cache control - * 0b0..Enables flash instruction cache when DIS_FLASH_CACHE=0 - * 0b1..Disables flash instruction cache - */ -#define SYSCON_NVM_CTRL_DIS_FLASH_INST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_DIS_FLASH_INST_SHIFT)) & SYSCON_NVM_CTRL_DIS_FLASH_INST_MASK) - -#define SYSCON_NVM_CTRL_DIS_FLASH_DATA_MASK (0x10U) -#define SYSCON_NVM_CTRL_DIS_FLASH_DATA_SHIFT (4U) -/*! DIS_FLASH_DATA - Flash data cache control - * 0b0..Enables flash data cache when DIS_FLASH_CACHE=0 - * 0b1..Disables flash data cache - */ -#define SYSCON_NVM_CTRL_DIS_FLASH_DATA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_DIS_FLASH_DATA_SHIFT)) & SYSCON_NVM_CTRL_DIS_FLASH_DATA_MASK) - -#define SYSCON_NVM_CTRL_CLR_FLASH_CACHE_MASK (0x20U) -#define SYSCON_NVM_CTRL_CLR_FLASH_CACHE_SHIFT (5U) -/*! CLR_FLASH_CACHE - Clear flash cache control - * 0b0..No clear flash cache - * 0b1..Clears flash cache - */ -#define SYSCON_NVM_CTRL_CLR_FLASH_CACHE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_CLR_FLASH_CACHE_SHIFT)) & SYSCON_NVM_CTRL_CLR_FLASH_CACHE_MASK) - -#define SYSCON_NVM_CTRL_FLASH_STALL_EN_MASK (0x400U) -#define SYSCON_NVM_CTRL_FLASH_STALL_EN_SHIFT (10U) -/*! FLASH_STALL_EN - FLASH stall on busy control - * 0b0..No stall on FLASH busy - * 0b1..Stall on FLASH busy - */ -#define SYSCON_NVM_CTRL_FLASH_STALL_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_FLASH_STALL_EN_SHIFT)) & SYSCON_NVM_CTRL_FLASH_STALL_EN_MASK) - -#define SYSCON_NVM_CTRL_DIS_MBECC_ERR_INST_MASK (0x10000U) -#define SYSCON_NVM_CTRL_DIS_MBECC_ERR_INST_SHIFT (16U) -/*! DIS_MBECC_ERR_INST - * 0b0..Enables bus error on multi-bit ECC error for instruction - * 0b1..Disables bus error on multi-bit ECC error for instruction - */ -#define SYSCON_NVM_CTRL_DIS_MBECC_ERR_INST(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_DIS_MBECC_ERR_INST_SHIFT)) & SYSCON_NVM_CTRL_DIS_MBECC_ERR_INST_MASK) - -#define SYSCON_NVM_CTRL_DIS_MBECC_ERR_DATA_MASK (0x20000U) -#define SYSCON_NVM_CTRL_DIS_MBECC_ERR_DATA_SHIFT (17U) -/*! DIS_MBECC_ERR_DATA - * 0b0..Enables bus error on multi-bit ECC error for data - * 0b1..Disables bus error on multi-bit ECC error for data - */ -#define SYSCON_NVM_CTRL_DIS_MBECC_ERR_DATA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_NVM_CTRL_DIS_MBECC_ERR_DATA_SHIFT)) & SYSCON_NVM_CTRL_DIS_MBECC_ERR_DATA_MASK) -/*! @} */ - -/*! @name ROMCR - ROM Wait State */ -/*! @{ */ - -#define SYSCON_ROMCR_ROM_WAIT_MASK (0x1U) -#define SYSCON_ROMCR_ROM_WAIT_SHIFT (0U) -/*! ROM_WAIT - ROM waiting Arm core and other masters for one cycle - * 0b0..Disabled - * 0b1..Enabled - */ -#define SYSCON_ROMCR_ROM_WAIT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ROMCR_ROM_WAIT_SHIFT)) & SYSCON_ROMCR_ROM_WAIT_MASK) -/*! @} */ - -/*! @name SMARTDMAINT - SmartDMA Interrupt Hijack */ -/*! @{ */ - -#define SYSCON_SMARTDMAINT_INT0_MASK (0x1U) -#define SYSCON_SMARTDMAINT_INT0_SHIFT (0U) -/*! INT0 - SmartDMA hijack NVIC IRQ1 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT0_SHIFT)) & SYSCON_SMARTDMAINT_INT0_MASK) - -#define SYSCON_SMARTDMAINT_INT1_MASK (0x2U) -#define SYSCON_SMARTDMAINT_INT1_SHIFT (1U) -/*! INT1 - SmartDMA hijack NVIC IRQ17 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT1_SHIFT)) & SYSCON_SMARTDMAINT_INT1_MASK) - -#define SYSCON_SMARTDMAINT_INT2_MASK (0x4U) -#define SYSCON_SMARTDMAINT_INT2_SHIFT (2U) -/*! INT2 - SmartDMA hijack NVIC IRQ18 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT2(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT2_SHIFT)) & SYSCON_SMARTDMAINT_INT2_MASK) - -#define SYSCON_SMARTDMAINT_INT3_MASK (0x8U) -#define SYSCON_SMARTDMAINT_INT3_SHIFT (3U) -/*! INT3 - SmartDMA hijack NVIC IRQ29 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT3(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT3_SHIFT)) & SYSCON_SMARTDMAINT_INT3_MASK) - -#define SYSCON_SMARTDMAINT_INT4_MASK (0x10U) -#define SYSCON_SMARTDMAINT_INT4_SHIFT (4U) -/*! INT4 - SmartDMA hijack NVIC IRQ30 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT4(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT4_SHIFT)) & SYSCON_SMARTDMAINT_INT4_MASK) - -#define SYSCON_SMARTDMAINT_INT5_MASK (0x20U) -#define SYSCON_SMARTDMAINT_INT5_SHIFT (5U) -/*! INT5 - SmartDMA hijack NVIC IRQ31 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT5(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT5_SHIFT)) & SYSCON_SMARTDMAINT_INT5_MASK) - -#define SYSCON_SMARTDMAINT_INT6_MASK (0x40U) -#define SYSCON_SMARTDMAINT_INT6_SHIFT (6U) -/*! INT6 - SmartDMA hijack NVIC IRQ32 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT6(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT6_SHIFT)) & SYSCON_SMARTDMAINT_INT6_MASK) - -#define SYSCON_SMARTDMAINT_INT7_MASK (0x80U) -#define SYSCON_SMARTDMAINT_INT7_SHIFT (7U) -/*! INT7 - SmartDMA hijack NVIC IRQ33 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT7(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT7_SHIFT)) & SYSCON_SMARTDMAINT_INT7_MASK) - -#define SYSCON_SMARTDMAINT_INT8_MASK (0x100U) -#define SYSCON_SMARTDMAINT_INT8_SHIFT (8U) -/*! INT8 - SmartDMA hijack NVIC IRQ34 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT8(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT8_SHIFT)) & SYSCON_SMARTDMAINT_INT8_MASK) - -#define SYSCON_SMARTDMAINT_INT9_MASK (0x200U) -#define SYSCON_SMARTDMAINT_INT9_SHIFT (9U) -/*! INT9 - SmartDMA hijack NVIC IRQ35 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT9(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT9_SHIFT)) & SYSCON_SMARTDMAINT_INT9_MASK) - -#define SYSCON_SMARTDMAINT_INT10_MASK (0x400U) -#define SYSCON_SMARTDMAINT_INT10_SHIFT (10U) -/*! INT10 - SmartDMA hijack NVIC IRQ36 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT10(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT10_SHIFT)) & SYSCON_SMARTDMAINT_INT10_MASK) - -#define SYSCON_SMARTDMAINT_INT11_MASK (0x800U) -#define SYSCON_SMARTDMAINT_INT11_SHIFT (11U) -/*! INT11 - SmartDMA hijack NVIC IRQ37 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT11(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT11_SHIFT)) & SYSCON_SMARTDMAINT_INT11_MASK) - -#define SYSCON_SMARTDMAINT_INT12_MASK (0x1000U) -#define SYSCON_SMARTDMAINT_INT12_SHIFT (12U) -/*! INT12 - SmartDMA hijack NVIC IRQ38 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT12(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT12_SHIFT)) & SYSCON_SMARTDMAINT_INT12_MASK) - -#define SYSCON_SMARTDMAINT_INT13_MASK (0x2000U) -#define SYSCON_SMARTDMAINT_INT13_SHIFT (13U) -/*! INT13 - SmartDMA hijack NVIC IRQ39 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT13(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT13_SHIFT)) & SYSCON_SMARTDMAINT_INT13_MASK) - -#define SYSCON_SMARTDMAINT_INT14_MASK (0x4000U) -#define SYSCON_SMARTDMAINT_INT14_SHIFT (14U) -/*! INT14 - SmartDMA hijack NVIC IRQ40 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT14(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT14_SHIFT)) & SYSCON_SMARTDMAINT_INT14_MASK) - -#define SYSCON_SMARTDMAINT_INT15_MASK (0x8000U) -#define SYSCON_SMARTDMAINT_INT15_SHIFT (15U) -/*! INT15 - SmartDMA hijack NVIC IRQ41 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT15(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT15_SHIFT)) & SYSCON_SMARTDMAINT_INT15_MASK) - -#define SYSCON_SMARTDMAINT_INT16_MASK (0x10000U) -#define SYSCON_SMARTDMAINT_INT16_SHIFT (16U) -/*! INT16 - SmartDMA hijack NVIC IRQ42 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT16(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT16_SHIFT)) & SYSCON_SMARTDMAINT_INT16_MASK) - -#define SYSCON_SMARTDMAINT_INT17_MASK (0x20000U) -#define SYSCON_SMARTDMAINT_INT17_SHIFT (17U) -/*! INT17 - SmartDMA hijack NVIC IRQ45 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT17(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT17_SHIFT)) & SYSCON_SMARTDMAINT_INT17_MASK) - -#define SYSCON_SMARTDMAINT_INT18_MASK (0x40000U) -#define SYSCON_SMARTDMAINT_INT18_SHIFT (18U) -/*! INT18 - SmartDMA hijack NVIC IRQ47 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT18(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT18_SHIFT)) & SYSCON_SMARTDMAINT_INT18_MASK) - -#define SYSCON_SMARTDMAINT_INT19_MASK (0x80000U) -#define SYSCON_SMARTDMAINT_INT19_SHIFT (19U) -/*! INT19 - SmartDMA hijack NVIC IRQ50 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT19(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT19_SHIFT)) & SYSCON_SMARTDMAINT_INT19_MASK) - -#define SYSCON_SMARTDMAINT_INT20_MASK (0x100000U) -#define SYSCON_SMARTDMAINT_INT20_SHIFT (20U) -/*! INT20 - SmartDMA hijack NVIC IRQ51 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT20(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT20_SHIFT)) & SYSCON_SMARTDMAINT_INT20_MASK) - -#define SYSCON_SMARTDMAINT_INT21_MASK (0x200000U) -#define SYSCON_SMARTDMAINT_INT21_SHIFT (21U) -/*! INT21 - SmartDMA hijack NVIC IRQ66 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT21(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT21_SHIFT)) & SYSCON_SMARTDMAINT_INT21_MASK) - -#define SYSCON_SMARTDMAINT_INT22_MASK (0x400000U) -#define SYSCON_SMARTDMAINT_INT22_SHIFT (22U) -/*! INT22 - SmartDMA hijack NVIC IRQ67 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT22(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT22_SHIFT)) & SYSCON_SMARTDMAINT_INT22_MASK) - -#define SYSCON_SMARTDMAINT_INT23_MASK (0x800000U) -#define SYSCON_SMARTDMAINT_INT23_SHIFT (23U) -/*! INT23 - SmartDMA hijack NVIC IRQ77 - * 0b0..Disable - * 0b1..Enable - */ -#define SYSCON_SMARTDMAINT_INT23(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SMARTDMAINT_INT23_SHIFT)) & SYSCON_SMARTDMAINT_INT23_MASK) -/*! @} */ - -/*! @name ADC1CLKSEL - ADC1 Clock Source Select */ -/*! @{ */ - -#define SYSCON_ADC1CLKSEL_SEL_MASK (0x7U) -#define SYSCON_ADC1CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the ADC1 clock source - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..FRO_HF clock - * 0b011..FRO 12 MHz clock - * 0b100..Clk_in clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_ADC1CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ADC1CLKSEL_SEL_SHIFT)) & SYSCON_ADC1CLKSEL_SEL_MASK) -/*! @} */ - -/*! @name ADC1CLKDIV - ADC1 Clock Divider */ -/*! @{ */ - -#define SYSCON_ADC1CLKDIV_DIV_MASK (0x7U) -#define SYSCON_ADC1CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_ADC1CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ADC1CLKDIV_DIV_SHIFT)) & SYSCON_ADC1CLKDIV_DIV_MASK) - -#define SYSCON_ADC1CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_ADC1CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_ADC1CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ADC1CLKDIV_RESET_SHIFT)) & SYSCON_ADC1CLKDIV_RESET_MASK) - -#define SYSCON_ADC1CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_ADC1CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_ADC1CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ADC1CLKDIV_HALT_SHIFT)) & SYSCON_ADC1CLKDIV_HALT_MASK) - -#define SYSCON_ADC1CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_ADC1CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_ADC1CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ADC1CLKDIV_UNSTAB_SHIFT)) & SYSCON_ADC1CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name RAM_INTERLEAVE - Control PKC RAM Interleave Access */ -/*! @{ */ - -#define SYSCON_RAM_INTERLEAVE_INTERLEAVE_MASK (0x1U) -#define SYSCON_RAM_INTERLEAVE_INTERLEAVE_SHIFT (0U) -/*! INTERLEAVE - Controls PKC RAM access for PKC RAM 0 and PKC RAM 1 - * 0b1..RAM access to PKC RAM 0 and PKC RAM 1 is interleaved. This setting is need for PKC L0 memory access. - * 0b0..RAM access to PKC RAM 0 and PKC RAM 1 is consecutive. - */ -#define SYSCON_RAM_INTERLEAVE_INTERLEAVE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_RAM_INTERLEAVE_INTERLEAVE_SHIFT)) & SYSCON_RAM_INTERLEAVE_INTERLEAVE_MASK) -/*! @} */ - -/*! @name DAC_CLKSEL - DAC0 Functional Clock Selection..DAC2 Functional Clock Selection */ -/*! @{ */ - -#define SYSCON_DAC_CLKSEL_SEL_MASK (0x7U) -#define SYSCON_DAC_CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the DAC clock source - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..Clk_in - * 0b011..FRO_HF - * 0b100..FRO_12M - * 0b101..PLL1_clk0 clock - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_DAC_CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DAC_CLKSEL_SEL_SHIFT)) & SYSCON_DAC_CLKSEL_SEL_MASK) -/*! @} */ - -/* The count of SYSCON_DAC_CLKSEL */ -#define SYSCON_DAC_CLKSEL_COUNT (3U) - -/*! @name DAC_CLKDIV - DAC0 functional clock divider..DAC2 functional clock divider */ -/*! @{ */ - -#define SYSCON_DAC_CLKDIV_DIV_MASK (0x7U) -#define SYSCON_DAC_CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_DAC_CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DAC_CLKDIV_DIV_SHIFT)) & SYSCON_DAC_CLKDIV_DIV_MASK) - -#define SYSCON_DAC_CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_DAC_CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_DAC_CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DAC_CLKDIV_RESET_SHIFT)) & SYSCON_DAC_CLKDIV_RESET_MASK) - -#define SYSCON_DAC_CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_DAC_CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_DAC_CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DAC_CLKDIV_HALT_SHIFT)) & SYSCON_DAC_CLKDIV_HALT_MASK) - -#define SYSCON_DAC_CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_DAC_CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_DAC_CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DAC_CLKDIV_UNSTAB_SHIFT)) & SYSCON_DAC_CLKDIV_UNSTAB_MASK) -/*! @} */ - -/* The count of SYSCON_DAC_CLKDIV */ -#define SYSCON_DAC_CLKDIV_COUNT (3U) - -/*! @name FLEXSPICLKSEL - FlexSPI Clock Selection */ -/*! @{ */ - -#define SYSCON_FLEXSPICLKSEL_SEL_MASK (0xFU) -#define SYSCON_FLEXSPICLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the FlexSPI clock - * 0b0000..No clock - * 0b0001..PLL0 clock - * 0b0010..No clock - * 0b0011..FRO_HF - * 0b0100..No clock - * 0b0101..pll1_clock - * 0b0110..USB PLL clock - * 0b0111..No clock - * 0b1000..No clock - * 0b1001..No clock - * 0b1010..No clock - * 0b1011..No clock - * 0b1100..No clock - * 0b1101..No clock - * 0b1110..No clock - * 0b1111..No clock - */ -#define SYSCON_FLEXSPICLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXSPICLKSEL_SEL_SHIFT)) & SYSCON_FLEXSPICLKSEL_SEL_MASK) -/*! @} */ - -/*! @name FLEXSPICLKDIV - FlexSPI Clock Divider */ -/*! @{ */ - -#define SYSCON_FLEXSPICLKDIV_DIV_MASK (0x7U) -#define SYSCON_FLEXSPICLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_FLEXSPICLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXSPICLKDIV_DIV_SHIFT)) & SYSCON_FLEXSPICLKDIV_DIV_MASK) - -#define SYSCON_FLEXSPICLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_FLEXSPICLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_FLEXSPICLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXSPICLKDIV_RESET_SHIFT)) & SYSCON_FLEXSPICLKDIV_RESET_MASK) - -#define SYSCON_FLEXSPICLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_FLEXSPICLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_FLEXSPICLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXSPICLKDIV_HALT_SHIFT)) & SYSCON_FLEXSPICLKDIV_HALT_MASK) - -#define SYSCON_FLEXSPICLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_FLEXSPICLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_FLEXSPICLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXSPICLKDIV_UNSTAB_SHIFT)) & SYSCON_FLEXSPICLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name PLLCLKDIVSEL - PLL Clock Divider Clock Selection */ -/*! @{ */ - -#define SYSCON_PLLCLKDIVSEL_SEL_MASK (0x7U) -#define SYSCON_PLLCLKDIVSEL_SEL_SHIFT (0U) -/*! SEL - Selects the PLL Clock Divider source clock - * 0b000..PLL0 clock - * 0b001..pll1_clk0 - * 0b010..No clock - * 0b011..No clock - * 0b100..No clock - * 0b101..No clock - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_PLLCLKDIVSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PLLCLKDIVSEL_SEL_SHIFT)) & SYSCON_PLLCLKDIVSEL_SEL_MASK) -/*! @} */ - -/*! @name I3C0FCLKSEL - I3C0 Functional Clock Selection */ -/*! @{ */ - -#define SYSCON_I3C0FCLKSEL_SEL_MASK (0x7U) -#define SYSCON_I3C0FCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the I3C0 clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..FRO_HF clock - * 0b100..No clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_I3C0FCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKSEL_SEL_SHIFT)) & SYSCON_I3C0FCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name I3C0FCLKSTCSEL - I3C0 FCLK_STC Clock Selection */ -/*! @{ */ - -#define SYSCON_I3C0FCLKSTCSEL_SEL_MASK (0x7U) -#define SYSCON_I3C0FCLKSTCSEL_SEL_SHIFT (0U) -/*! SEL - Selects the I3C0 Time Control clock - * 0b000..I3C0 functional clock I3C0FCLK - * 0b001..FRO_1M clock - * 0b010..No clock - * 0b011..No clock - * 0b100..No clock - * 0b101..No clock - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_I3C0FCLKSTCSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKSTCSEL_SEL_SHIFT)) & SYSCON_I3C0FCLKSTCSEL_SEL_MASK) -/*! @} */ - -/*! @name I3C0FCLKSTCDIV - I3C0 FCLK_STC Clock Divider */ -/*! @{ */ - -#define SYSCON_I3C0FCLKSTCDIV_DIV_MASK (0xFFU) -#define SYSCON_I3C0FCLKSTCDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_I3C0FCLKSTCDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKSTCDIV_DIV_SHIFT)) & SYSCON_I3C0FCLKSTCDIV_DIV_MASK) - -#define SYSCON_I3C0FCLKSTCDIV_RESET_MASK (0x20000000U) -#define SYSCON_I3C0FCLKSTCDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_I3C0FCLKSTCDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKSTCDIV_RESET_SHIFT)) & SYSCON_I3C0FCLKSTCDIV_RESET_MASK) - -#define SYSCON_I3C0FCLKSTCDIV_HALT_MASK (0x40000000U) -#define SYSCON_I3C0FCLKSTCDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_I3C0FCLKSTCDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKSTCDIV_HALT_SHIFT)) & SYSCON_I3C0FCLKSTCDIV_HALT_MASK) - -#define SYSCON_I3C0FCLKSTCDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_I3C0FCLKSTCDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_I3C0FCLKSTCDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKSTCDIV_UNSTAB_SHIFT)) & SYSCON_I3C0FCLKSTCDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name I3C0FCLKSDIV - I3C0 FCLK Slow Clock Divider */ -/*! @{ */ - -#define SYSCON_I3C0FCLKSDIV_DIV_MASK (0xFFU) -#define SYSCON_I3C0FCLKSDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_I3C0FCLKSDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKSDIV_DIV_SHIFT)) & SYSCON_I3C0FCLKSDIV_DIV_MASK) - -#define SYSCON_I3C0FCLKSDIV_RESET_MASK (0x20000000U) -#define SYSCON_I3C0FCLKSDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_I3C0FCLKSDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKSDIV_RESET_SHIFT)) & SYSCON_I3C0FCLKSDIV_RESET_MASK) - -#define SYSCON_I3C0FCLKSDIV_HALT_MASK (0x40000000U) -#define SYSCON_I3C0FCLKSDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_I3C0FCLKSDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKSDIV_HALT_SHIFT)) & SYSCON_I3C0FCLKSDIV_HALT_MASK) - -#define SYSCON_I3C0FCLKSDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_I3C0FCLKSDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_I3C0FCLKSDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKSDIV_UNSTAB_SHIFT)) & SYSCON_I3C0FCLKSDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name I3C0FCLKDIV - I3C0 Functional Clock FCLK Divider */ -/*! @{ */ - -#define SYSCON_I3C0FCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_I3C0FCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_I3C0FCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKDIV_DIV_SHIFT)) & SYSCON_I3C0FCLKDIV_DIV_MASK) - -#define SYSCON_I3C0FCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_I3C0FCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_I3C0FCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKDIV_RESET_SHIFT)) & SYSCON_I3C0FCLKDIV_RESET_MASK) - -#define SYSCON_I3C0FCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_I3C0FCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_I3C0FCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKDIV_HALT_SHIFT)) & SYSCON_I3C0FCLKDIV_HALT_MASK) - -#define SYSCON_I3C0FCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_I3C0FCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_I3C0FCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKDIV_UNSTAB_SHIFT)) & SYSCON_I3C0FCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name I3C0FCLKSSEL - I3C0 FCLK Slow Selection */ -/*! @{ */ - -#define SYSCON_I3C0FCLKSSEL_SEL_MASK (0x7U) -#define SYSCON_I3C0FCLKSSEL_SEL_SHIFT (0U) -/*! SEL - Selects the I3C FCLK Slow clock - * 0b000..FRO_1M clock - * 0b001..No clock - * 0b010..No clock - * 0b011..No clock - * 0b100..No clock - * 0b101..No clock - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_I3C0FCLKSSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C0FCLKSSEL_SEL_SHIFT)) & SYSCON_I3C0FCLKSSEL_SEL_MASK) -/*! @} */ - -/*! @name MICFILFCLKSEL - MICFIL Clock Selection */ -/*! @{ */ - -#define SYSCON_MICFILFCLKSEL_SEL_MASK (0xFU) -#define SYSCON_MICFILFCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the MICFIL clock - * 0b0000..FRO_12M clock - * 0b0001..PLL0 clock - * 0b0010..CLKIN clock - * 0b0011..FRO_HF clock - * 0b0100..PLL1_clk0 clock - * 0b0101..SAI0_MCLK clock - * 0b0110..USB PLL clock - * 0b0111..No clock - * 0b1000..SAI1_MCLK clock - * 0b1001..No clock - * 0b1010..No clock - * 0b1011..No clock - * 0b1100..No clock - * 0b1101..No clock - * 0b1110..No clock - * 0b1111..No clock - */ -#define SYSCON_MICFILFCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_MICFILFCLKSEL_SEL_SHIFT)) & SYSCON_MICFILFCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name MICFILFCLKDIV - MICFIL Clock Division */ -/*! @{ */ - -#define SYSCON_MICFILFCLKDIV_DIV_MASK (0x7U) -#define SYSCON_MICFILFCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_MICFILFCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_MICFILFCLKDIV_DIV_SHIFT)) & SYSCON_MICFILFCLKDIV_DIV_MASK) - -#define SYSCON_MICFILFCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_MICFILFCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_MICFILFCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_MICFILFCLKDIV_RESET_SHIFT)) & SYSCON_MICFILFCLKDIV_RESET_MASK) - -#define SYSCON_MICFILFCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_MICFILFCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_MICFILFCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_MICFILFCLKDIV_HALT_SHIFT)) & SYSCON_MICFILFCLKDIV_HALT_MASK) - -#define SYSCON_MICFILFCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_MICFILFCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_MICFILFCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_MICFILFCLKDIV_UNSTAB_SHIFT)) & SYSCON_MICFILFCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name USDHCCLKSEL - uSDHC Clock Selection */ -/*! @{ */ - -#define SYSCON_USDHCCLKSEL_SEL_MASK (0x7U) -#define SYSCON_USDHCCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the uSDHC clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..FRO_HF clock - * 0b100..FRO_12M clock - * 0b101..pll1_clk1 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_USDHCCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_USDHCCLKSEL_SEL_SHIFT)) & SYSCON_USDHCCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name USDHCCLKDIV - uSDHC Function Clock Divider */ -/*! @{ */ - -#define SYSCON_USDHCCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_USDHCCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_USDHCCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_USDHCCLKDIV_DIV_SHIFT)) & SYSCON_USDHCCLKDIV_DIV_MASK) - -#define SYSCON_USDHCCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_USDHCCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_USDHCCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_USDHCCLKDIV_RESET_SHIFT)) & SYSCON_USDHCCLKDIV_RESET_MASK) - -#define SYSCON_USDHCCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_USDHCCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_USDHCCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_USDHCCLKDIV_HALT_SHIFT)) & SYSCON_USDHCCLKDIV_HALT_MASK) - -#define SYSCON_USDHCCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_USDHCCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_USDHCCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_USDHCCLKDIV_UNSTAB_SHIFT)) & SYSCON_USDHCCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name FLEXIOCLKSEL - FLEXIO Clock Selection */ -/*! @{ */ - -#define SYSCON_FLEXIOCLKSEL_SEL_MASK (0x7U) -#define SYSCON_FLEXIOCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the FLEXIO clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..FRO_HF clock - * 0b100..FRO_12M clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_FLEXIOCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXIOCLKSEL_SEL_SHIFT)) & SYSCON_FLEXIOCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name FLEXIOCLKDIV - FLEXIO Function Clock Divider */ -/*! @{ */ - -#define SYSCON_FLEXIOCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_FLEXIOCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_FLEXIOCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXIOCLKDIV_DIV_SHIFT)) & SYSCON_FLEXIOCLKDIV_DIV_MASK) - -#define SYSCON_FLEXIOCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_FLEXIOCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_FLEXIOCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXIOCLKDIV_RESET_SHIFT)) & SYSCON_FLEXIOCLKDIV_RESET_MASK) - -#define SYSCON_FLEXIOCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_FLEXIOCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_FLEXIOCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXIOCLKDIV_HALT_SHIFT)) & SYSCON_FLEXIOCLKDIV_HALT_MASK) - -#define SYSCON_FLEXIOCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_FLEXIOCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_FLEXIOCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXIOCLKDIV_UNSTAB_SHIFT)) & SYSCON_FLEXIOCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name FLEXCAN0CLKSEL - FLEXCAN0 Clock Selection */ -/*! @{ */ - -#define SYSCON_FLEXCAN0CLKSEL_SEL_MASK (0x7U) -#define SYSCON_FLEXCAN0CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the FLEXCAN0 clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..FRO_HF clock - * 0b100..No clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_FLEXCAN0CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCAN0CLKSEL_SEL_SHIFT)) & SYSCON_FLEXCAN0CLKSEL_SEL_MASK) -/*! @} */ - -/*! @name FLEXCAN0CLKDIV - FLEXCAN0 Function Clock Divider */ -/*! @{ */ - -#define SYSCON_FLEXCAN0CLKDIV_DIV_MASK (0xFFU) -#define SYSCON_FLEXCAN0CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_FLEXCAN0CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCAN0CLKDIV_DIV_SHIFT)) & SYSCON_FLEXCAN0CLKDIV_DIV_MASK) - -#define SYSCON_FLEXCAN0CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_FLEXCAN0CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_FLEXCAN0CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCAN0CLKDIV_RESET_SHIFT)) & SYSCON_FLEXCAN0CLKDIV_RESET_MASK) - -#define SYSCON_FLEXCAN0CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_FLEXCAN0CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_FLEXCAN0CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCAN0CLKDIV_HALT_SHIFT)) & SYSCON_FLEXCAN0CLKDIV_HALT_MASK) - -#define SYSCON_FLEXCAN0CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_FLEXCAN0CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_FLEXCAN0CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCAN0CLKDIV_UNSTAB_SHIFT)) & SYSCON_FLEXCAN0CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name FLEXCAN1CLKSEL - FLEXCAN1 Clock Selection */ -/*! @{ */ - -#define SYSCON_FLEXCAN1CLKSEL_SEL_MASK (0x7U) -#define SYSCON_FLEXCAN1CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the FLEXCAN1 clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..FRO_HF clock - * 0b100..No clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_FLEXCAN1CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCAN1CLKSEL_SEL_SHIFT)) & SYSCON_FLEXCAN1CLKSEL_SEL_MASK) -/*! @} */ - -/*! @name FLEXCAN1CLKDIV - FLEXCAN1 Function Clock Divider */ -/*! @{ */ - -#define SYSCON_FLEXCAN1CLKDIV_DIV_MASK (0xFFU) -#define SYSCON_FLEXCAN1CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_FLEXCAN1CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCAN1CLKDIV_DIV_SHIFT)) & SYSCON_FLEXCAN1CLKDIV_DIV_MASK) - -#define SYSCON_FLEXCAN1CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_FLEXCAN1CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_FLEXCAN1CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCAN1CLKDIV_RESET_SHIFT)) & SYSCON_FLEXCAN1CLKDIV_RESET_MASK) - -#define SYSCON_FLEXCAN1CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_FLEXCAN1CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_FLEXCAN1CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCAN1CLKDIV_HALT_SHIFT)) & SYSCON_FLEXCAN1CLKDIV_HALT_MASK) - -#define SYSCON_FLEXCAN1CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_FLEXCAN1CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_FLEXCAN1CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCAN1CLKDIV_UNSTAB_SHIFT)) & SYSCON_FLEXCAN1CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name ENETRMIICLKSEL - Ethernet RMII Clock Selection */ -/*! @{ */ - -#define SYSCON_ENETRMIICLKSEL_SEL_MASK (0x7U) -#define SYSCON_ENETRMIICLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the Ethernet RMII clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..No clock - * 0b100..No clock - * 0b101..PLL1_clk0 clock - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_ENETRMIICLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ENETRMIICLKSEL_SEL_SHIFT)) & SYSCON_ENETRMIICLKSEL_SEL_MASK) -/*! @} */ - -/*! @name ENETRMIICLKDIV - Ethernet RMII Function Clock Divider */ -/*! @{ */ - -#define SYSCON_ENETRMIICLKDIV_DIV_MASK (0xFFU) -#define SYSCON_ENETRMIICLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_ENETRMIICLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ENETRMIICLKDIV_DIV_SHIFT)) & SYSCON_ENETRMIICLKDIV_DIV_MASK) - -#define SYSCON_ENETRMIICLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_ENETRMIICLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_ENETRMIICLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ENETRMIICLKDIV_RESET_SHIFT)) & SYSCON_ENETRMIICLKDIV_RESET_MASK) - -#define SYSCON_ENETRMIICLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_ENETRMIICLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_ENETRMIICLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ENETRMIICLKDIV_HALT_SHIFT)) & SYSCON_ENETRMIICLKDIV_HALT_MASK) - -#define SYSCON_ENETRMIICLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_ENETRMIICLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_ENETRMIICLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ENETRMIICLKDIV_UNSTAB_SHIFT)) & SYSCON_ENETRMIICLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name ENETPTPREFCLKSEL - Ethernet PTP REF Clock Selection */ -/*! @{ */ - -#define SYSCON_ENETPTPREFCLKSEL_SEL_MASK (0x7U) -#define SYSCON_ENETPTPREFCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the Ethernet PTP REF clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..No clock - * 0b100..enet0_tx_clk clock - * 0b101..pll1_clk1 clock - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_ENETPTPREFCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ENETPTPREFCLKSEL_SEL_SHIFT)) & SYSCON_ENETPTPREFCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name ENETPTPREFCLKDIV - Ethernet PTP REF Function Clock Divider */ -/*! @{ */ - -#define SYSCON_ENETPTPREFCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_ENETPTPREFCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_ENETPTPREFCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ENETPTPREFCLKDIV_DIV_SHIFT)) & SYSCON_ENETPTPREFCLKDIV_DIV_MASK) - -#define SYSCON_ENETPTPREFCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_ENETPTPREFCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_ENETPTPREFCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ENETPTPREFCLKDIV_RESET_SHIFT)) & SYSCON_ENETPTPREFCLKDIV_RESET_MASK) - -#define SYSCON_ENETPTPREFCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_ENETPTPREFCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_ENETPTPREFCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ENETPTPREFCLKDIV_HALT_SHIFT)) & SYSCON_ENETPTPREFCLKDIV_HALT_MASK) - -#define SYSCON_ENETPTPREFCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_ENETPTPREFCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_ENETPTPREFCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ENETPTPREFCLKDIV_UNSTAB_SHIFT)) & SYSCON_ENETPTPREFCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name ENET_PHY_INTF_SEL - Ethernet PHY Interface Select */ -/*! @{ */ - -#define SYSCON_ENET_PHY_INTF_SEL_PHY_SEL_MASK (0x4U) -#define SYSCON_ENET_PHY_INTF_SEL_PHY_SEL_SHIFT (2U) -/*! PHY_SEL - Selects the PHY interface - * 0b1..Selects RMII PHY Interface - * 0b0..Selects MII PHY Interface - */ -#define SYSCON_ENET_PHY_INTF_SEL_PHY_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ENET_PHY_INTF_SEL_PHY_SEL_SHIFT)) & SYSCON_ENET_PHY_INTF_SEL_PHY_SEL_MASK) -/*! @} */ - -/*! @name ENET_SBD_FLOW_CTRL - Sideband Flow Control */ -/*! @{ */ - -#define SYSCON_ENET_SBD_FLOW_CTRL_SEL_ch0_MASK (0x1U) -#define SYSCON_ENET_SBD_FLOW_CTRL_SEL_ch0_SHIFT (0U) -/*! SEL_ch0 - Sideband Flow Control for channel0 - * 0b1..Trigger flow control - * 0b0..No trigger flow control - */ -#define SYSCON_ENET_SBD_FLOW_CTRL_SEL_ch0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ENET_SBD_FLOW_CTRL_SEL_ch0_SHIFT)) & SYSCON_ENET_SBD_FLOW_CTRL_SEL_ch0_MASK) - -#define SYSCON_ENET_SBD_FLOW_CTRL_SEL_ch1_MASK (0x2U) -#define SYSCON_ENET_SBD_FLOW_CTRL_SEL_ch1_SHIFT (1U) -/*! SEL_ch1 - Sideband Flow Control for channel1 - * 0b1..Trigger flow control - * 0b0..No trigger flow control - */ -#define SYSCON_ENET_SBD_FLOW_CTRL_SEL_ch1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ENET_SBD_FLOW_CTRL_SEL_ch1_SHIFT)) & SYSCON_ENET_SBD_FLOW_CTRL_SEL_ch1_MASK) -/*! @} */ - -/*! @name EWM0CLKSEL - EWM0 Clock Selection */ -/*! @{ */ - -#define SYSCON_EWM0CLKSEL_SEL_MASK (0x1U) -#define SYSCON_EWM0CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the EWM0 clock - * 0b0..clk_16k[2] - * 0b1..xtal32k[2] - */ -#define SYSCON_EWM0CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_EWM0CLKSEL_SEL_SHIFT)) & SYSCON_EWM0CLKSEL_SEL_MASK) -/*! @} */ - -/*! @name WDT1CLKSEL - WDT1 Clock Selection */ -/*! @{ */ - -#define SYSCON_WDT1CLKSEL_SEL_MASK (0x3U) -#define SYSCON_WDT1CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the WDT1 clock - * 0b00..FRO16K clock 2 - * 0b01..fro_hf_div clock - * 0b10..clk_1m clock - * 0b11..clk_1m clock - */ -#define SYSCON_WDT1CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_WDT1CLKSEL_SEL_SHIFT)) & SYSCON_WDT1CLKSEL_SEL_MASK) -/*! @} */ - -/*! @name WDT1CLKDIV - WDT1 Function Clock Divider */ -/*! @{ */ - -#define SYSCON_WDT1CLKDIV_DIV_MASK (0x3FU) -#define SYSCON_WDT1CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_WDT1CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_WDT1CLKDIV_DIV_SHIFT)) & SYSCON_WDT1CLKDIV_DIV_MASK) - -#define SYSCON_WDT1CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_WDT1CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_WDT1CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_WDT1CLKDIV_RESET_SHIFT)) & SYSCON_WDT1CLKDIV_RESET_MASK) - -#define SYSCON_WDT1CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_WDT1CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_WDT1CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_WDT1CLKDIV_HALT_SHIFT)) & SYSCON_WDT1CLKDIV_HALT_MASK) - -#define SYSCON_WDT1CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_WDT1CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_WDT1CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_WDT1CLKDIV_UNSTAB_SHIFT)) & SYSCON_WDT1CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name OSTIMERCLKSEL - OSTIMER Clock Selection */ -/*! @{ */ - -#define SYSCON_OSTIMERCLKSEL_SEL_MASK (0x3U) -#define SYSCON_OSTIMERCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the OS Event Timer clock - * 0b00..clk_16k[2] - * 0b01..xtal32k[2] - * 0b10..clk_1m clock - * 0b11..No clock - */ -#define SYSCON_OSTIMERCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_OSTIMERCLKSEL_SEL_SHIFT)) & SYSCON_OSTIMERCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name CMP0FCLKSEL - CMP0 Function Clock Selection */ -/*! @{ */ - -#define SYSCON_CMP0FCLKSEL_SEL_MASK (0x7U) -#define SYSCON_CMP0FCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the CMP0 function clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..FRO_HF clock - * 0b011..FRO_12M clock - * 0b100..CLKIN clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_CMP0FCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP0FCLKSEL_SEL_SHIFT)) & SYSCON_CMP0FCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name CMP0FCLKDIV - CMP0 Function Clock Divider */ -/*! @{ */ - -#define SYSCON_CMP0FCLKDIV_DIV_MASK (0xFU) -#define SYSCON_CMP0FCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_CMP0FCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP0FCLKDIV_DIV_SHIFT)) & SYSCON_CMP0FCLKDIV_DIV_MASK) - -#define SYSCON_CMP0FCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_CMP0FCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_CMP0FCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP0FCLKDIV_RESET_SHIFT)) & SYSCON_CMP0FCLKDIV_RESET_MASK) - -#define SYSCON_CMP0FCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_CMP0FCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_CMP0FCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP0FCLKDIV_HALT_SHIFT)) & SYSCON_CMP0FCLKDIV_HALT_MASK) - -#define SYSCON_CMP0FCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_CMP0FCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_CMP0FCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP0FCLKDIV_UNSTAB_SHIFT)) & SYSCON_CMP0FCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name CMP0RRCLKSEL - CMP0 Round Robin Clock Selection */ -/*! @{ */ - -#define SYSCON_CMP0RRCLKSEL_SEL_MASK (0x7U) -#define SYSCON_CMP0RRCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the CMP0 round robin clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..FRO_HF clock - * 0b011..FRO_12M clock - * 0b100..CLKIN clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_CMP0RRCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP0RRCLKSEL_SEL_SHIFT)) & SYSCON_CMP0RRCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name CMP0RRCLKDIV - CMP0 Round Robin Clock Divider */ -/*! @{ */ - -#define SYSCON_CMP0RRCLKDIV_DIV_MASK (0xFU) -#define SYSCON_CMP0RRCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_CMP0RRCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP0RRCLKDIV_DIV_SHIFT)) & SYSCON_CMP0RRCLKDIV_DIV_MASK) - -#define SYSCON_CMP0RRCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_CMP0RRCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_CMP0RRCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP0RRCLKDIV_RESET_SHIFT)) & SYSCON_CMP0RRCLKDIV_RESET_MASK) - -#define SYSCON_CMP0RRCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_CMP0RRCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_CMP0RRCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP0RRCLKDIV_HALT_SHIFT)) & SYSCON_CMP0RRCLKDIV_HALT_MASK) - -#define SYSCON_CMP0RRCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_CMP0RRCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_CMP0RRCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP0RRCLKDIV_UNSTAB_SHIFT)) & SYSCON_CMP0RRCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name CMP1FCLKSEL - CMP1 Function Clock Selection */ -/*! @{ */ - -#define SYSCON_CMP1FCLKSEL_SEL_MASK (0x7U) -#define SYSCON_CMP1FCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the CMP1 function clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..FRO_HF clock - * 0b011..FRO_12M clock - * 0b100..CLKIN clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_CMP1FCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP1FCLKSEL_SEL_SHIFT)) & SYSCON_CMP1FCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name CMP1FCLKDIV - CMP1 Function Clock Divider */ -/*! @{ */ - -#define SYSCON_CMP1FCLKDIV_DIV_MASK (0xFU) -#define SYSCON_CMP1FCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_CMP1FCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP1FCLKDIV_DIV_SHIFT)) & SYSCON_CMP1FCLKDIV_DIV_MASK) - -#define SYSCON_CMP1FCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_CMP1FCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_CMP1FCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP1FCLKDIV_RESET_SHIFT)) & SYSCON_CMP1FCLKDIV_RESET_MASK) - -#define SYSCON_CMP1FCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_CMP1FCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_CMP1FCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP1FCLKDIV_HALT_SHIFT)) & SYSCON_CMP1FCLKDIV_HALT_MASK) - -#define SYSCON_CMP1FCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_CMP1FCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_CMP1FCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP1FCLKDIV_UNSTAB_SHIFT)) & SYSCON_CMP1FCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name CMP1RRCLKSEL - CMP1 Round Robin Clock Source Select */ -/*! @{ */ - -#define SYSCON_CMP1RRCLKSEL_SEL_MASK (0x7U) -#define SYSCON_CMP1RRCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the CMP1 round robin clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..FRO_HF clock - * 0b011..FRO_12M clock - * 0b100..CLKIN clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_CMP1RRCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP1RRCLKSEL_SEL_SHIFT)) & SYSCON_CMP1RRCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name CMP1RRCLKDIV - CMP1 Round Robin Clock Division */ -/*! @{ */ - -#define SYSCON_CMP1RRCLKDIV_DIV_MASK (0xFU) -#define SYSCON_CMP1RRCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_CMP1RRCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP1RRCLKDIV_DIV_SHIFT)) & SYSCON_CMP1RRCLKDIV_DIV_MASK) - -#define SYSCON_CMP1RRCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_CMP1RRCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_CMP1RRCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP1RRCLKDIV_RESET_SHIFT)) & SYSCON_CMP1RRCLKDIV_RESET_MASK) - -#define SYSCON_CMP1RRCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_CMP1RRCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_CMP1RRCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP1RRCLKDIV_HALT_SHIFT)) & SYSCON_CMP1RRCLKDIV_HALT_MASK) - -#define SYSCON_CMP1RRCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_CMP1RRCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_CMP1RRCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP1RRCLKDIV_UNSTAB_SHIFT)) & SYSCON_CMP1RRCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name CMP2FCLKSEL - CMP2 Function Clock Source Select */ -/*! @{ */ - -#define SYSCON_CMP2FCLKSEL_SEL_MASK (0x7U) -#define SYSCON_CMP2FCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the CMP2 function clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..FRO_HF clock - * 0b011..FRO_12M clock - * 0b100..CLKIN clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_CMP2FCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP2FCLKSEL_SEL_SHIFT)) & SYSCON_CMP2FCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name CMP2FCLKDIV - CMP2 Function Clock Division */ -/*! @{ */ - -#define SYSCON_CMP2FCLKDIV_DIV_MASK (0xFU) -#define SYSCON_CMP2FCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_CMP2FCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP2FCLKDIV_DIV_SHIFT)) & SYSCON_CMP2FCLKDIV_DIV_MASK) - -#define SYSCON_CMP2FCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_CMP2FCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_CMP2FCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP2FCLKDIV_RESET_SHIFT)) & SYSCON_CMP2FCLKDIV_RESET_MASK) - -#define SYSCON_CMP2FCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_CMP2FCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_CMP2FCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP2FCLKDIV_HALT_SHIFT)) & SYSCON_CMP2FCLKDIV_HALT_MASK) - -#define SYSCON_CMP2FCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_CMP2FCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_CMP2FCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP2FCLKDIV_UNSTAB_SHIFT)) & SYSCON_CMP2FCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name CMP2RRCLKSEL - CMP2 Round Robin Clock Source Select */ -/*! @{ */ - -#define SYSCON_CMP2RRCLKSEL_SEL_MASK (0x7U) -#define SYSCON_CMP2RRCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the CMP2 round robin clock - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..FRO_HF clock - * 0b011..FRO_12M clock - * 0b100..CLKIN clock - * 0b101..PLL1_clk0 clock0 - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_CMP2RRCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP2RRCLKSEL_SEL_SHIFT)) & SYSCON_CMP2RRCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name CMP2RRCLKDIV - CMP2 Round Robin Clock Division */ -/*! @{ */ - -#define SYSCON_CMP2RRCLKDIV_DIV_MASK (0xFU) -#define SYSCON_CMP2RRCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_CMP2RRCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP2RRCLKDIV_DIV_SHIFT)) & SYSCON_CMP2RRCLKDIV_DIV_MASK) - -#define SYSCON_CMP2RRCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_CMP2RRCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_CMP2RRCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP2RRCLKDIV_RESET_SHIFT)) & SYSCON_CMP2RRCLKDIV_RESET_MASK) - -#define SYSCON_CMP2RRCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_CMP2RRCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_CMP2RRCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP2RRCLKDIV_HALT_SHIFT)) & SYSCON_CMP2RRCLKDIV_HALT_MASK) - -#define SYSCON_CMP2RRCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_CMP2RRCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_CMP2RRCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CMP2RRCLKDIV_UNSTAB_SHIFT)) & SYSCON_CMP2RRCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name CPUCTRL - CPU Control for Multiple Processors */ -/*! @{ */ - -#define SYSCON_CPUCTRL_CPU1CLKEN_MASK (0x8U) -#define SYSCON_CPUCTRL_CPU1CLKEN_SHIFT (3U) -/*! CPU1CLKEN - Enables the CPU1 clock - * 0b1..The CPU1 clock is enabled - * 0b0..The CPU1 clock is not enabled - */ -#define SYSCON_CPUCTRL_CPU1CLKEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPUCTRL_CPU1CLKEN_SHIFT)) & SYSCON_CPUCTRL_CPU1CLKEN_MASK) - -#define SYSCON_CPUCTRL_CPU1RSTEN_MASK (0x20U) -#define SYSCON_CPUCTRL_CPU1RSTEN_SHIFT (5U) -/*! CPU1RSTEN - CPU1 reset - * 0b1..The CPU1 is reset. - * 0b0..The CPU1 is not reset. - */ -#define SYSCON_CPUCTRL_CPU1RSTEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPUCTRL_CPU1RSTEN_SHIFT)) & SYSCON_CPUCTRL_CPU1RSTEN_MASK) - -#define SYSCON_CPUCTRL_PROT_MASK (0xFFFF0000U) -#define SYSCON_CPUCTRL_PROT_SHIFT (16U) -/*! PROT - Write Protect - * 0b1100000011000100..For write operation to have an effect. - */ -#define SYSCON_CPUCTRL_PROT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPUCTRL_PROT_SHIFT)) & SYSCON_CPUCTRL_PROT_MASK) -/*! @} */ - -/*! @name CPBOOT - Coprocessor Boot Address */ -/*! @{ */ - -#define SYSCON_CPBOOT_CPBOOT_MASK (0xFFFFFF80U) -#define SYSCON_CPBOOT_CPBOOT_SHIFT (7U) -/*! CPBOOT - Coprocessor Boot VTOR Address [31:7] for CPU1 */ -#define SYSCON_CPBOOT_CPBOOT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPBOOT_CPBOOT_SHIFT)) & SYSCON_CPBOOT_CPBOOT_MASK) -/*! @} */ - -/*! @name CPUSTAT - CPU Status */ -/*! @{ */ - -#define SYSCON_CPUSTAT_CPU0SLEEPING_MASK (0x1U) -#define SYSCON_CPUSTAT_CPU0SLEEPING_SHIFT (0U) -/*! CPU0SLEEPING - CPU0 sleeping state - * 0b1..CPU is sleeping - * 0b0..CPU is not sleeping - */ -#define SYSCON_CPUSTAT_CPU0SLEEPING(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPUSTAT_CPU0SLEEPING_SHIFT)) & SYSCON_CPUSTAT_CPU0SLEEPING_MASK) - -#define SYSCON_CPUSTAT_CPU1SLEEPING_MASK (0x2U) -#define SYSCON_CPUSTAT_CPU1SLEEPING_SHIFT (1U) -/*! CPU1SLEEPING - CPU1 sleeping state - * 0b1..CPU is sleeping - * 0b0..CPU is not sleeping - */ -#define SYSCON_CPUSTAT_CPU1SLEEPING(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPUSTAT_CPU1SLEEPING_SHIFT)) & SYSCON_CPUSTAT_CPU1SLEEPING_MASK) - -#define SYSCON_CPUSTAT_CPU0LOCKUP_MASK (0x4U) -#define SYSCON_CPUSTAT_CPU0LOCKUP_SHIFT (2U) -/*! CPU0LOCKUP - CPU0 lockup state - * 0b1..CPU is in lockup - * 0b0..CPU is not in lockup - */ -#define SYSCON_CPUSTAT_CPU0LOCKUP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPUSTAT_CPU0LOCKUP_SHIFT)) & SYSCON_CPUSTAT_CPU0LOCKUP_MASK) - -#define SYSCON_CPUSTAT_CPU1LOCKUP_MASK (0x8U) -#define SYSCON_CPUSTAT_CPU1LOCKUP_SHIFT (3U) -/*! CPU1LOCKUP - CPU1 lockup state - * 0b1..CPU is in lockup - * 0b0..CPU is not in lockup - */ -#define SYSCON_CPUSTAT_CPU1LOCKUP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CPUSTAT_CPU1LOCKUP_SHIFT)) & SYSCON_CPUSTAT_CPU1LOCKUP_MASK) -/*! @} */ - -/*! @name LPCAC_CTRL - LPCAC Control */ -/*! @{ */ - -#define SYSCON_LPCAC_CTRL_DIS_LPCAC_MASK (0x1U) -#define SYSCON_LPCAC_CTRL_DIS_LPCAC_SHIFT (0U) -/*! DIS_LPCAC - Disables/enables the cache function. - * 0b0..Enabled - * 0b1..Disabled - */ -#define SYSCON_LPCAC_CTRL_DIS_LPCAC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_DIS_LPCAC_SHIFT)) & SYSCON_LPCAC_CTRL_DIS_LPCAC_MASK) - -#define SYSCON_LPCAC_CTRL_CLR_LPCAC_MASK (0x2U) -#define SYSCON_LPCAC_CTRL_CLR_LPCAC_SHIFT (1U) -/*! CLR_LPCAC - Clears the cache function. - * 0b0..Unclears the cache - * 0b1..Clears the cache - */ -#define SYSCON_LPCAC_CTRL_CLR_LPCAC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_CLR_LPCAC_SHIFT)) & SYSCON_LPCAC_CTRL_CLR_LPCAC_MASK) - -#define SYSCON_LPCAC_CTRL_FRC_NO_ALLOC_MASK (0x4U) -#define SYSCON_LPCAC_CTRL_FRC_NO_ALLOC_SHIFT (2U) -/*! FRC_NO_ALLOC - Forces no allocation. - * 0b0..Forces allocation - * 0b1..Forces no allocation - */ -#define SYSCON_LPCAC_CTRL_FRC_NO_ALLOC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_FRC_NO_ALLOC_SHIFT)) & SYSCON_LPCAC_CTRL_FRC_NO_ALLOC_MASK) - -#define SYSCON_LPCAC_CTRL_PARITY_MISS_EN_MASK (0x8U) -#define SYSCON_LPCAC_CTRL_PARITY_MISS_EN_SHIFT (3U) -/*! PARITY_MISS_EN - Enables parity miss. - * 0b0..Disabled - * 0b1..Enables parity, miss on parity error - */ -#define SYSCON_LPCAC_CTRL_PARITY_MISS_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_PARITY_MISS_EN_SHIFT)) & SYSCON_LPCAC_CTRL_PARITY_MISS_EN_MASK) - -#define SYSCON_LPCAC_CTRL_DIS_LPCAC_WTBF_MASK (0x10U) -#define SYSCON_LPCAC_CTRL_DIS_LPCAC_WTBF_SHIFT (4U) -/*! DIS_LPCAC_WTBF - Disable LPCAC Write Through Buffer. - * 0b1..Disables write through buffer - * 0b0..Enables write through buffer - */ -#define SYSCON_LPCAC_CTRL_DIS_LPCAC_WTBF(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_DIS_LPCAC_WTBF_SHIFT)) & SYSCON_LPCAC_CTRL_DIS_LPCAC_WTBF_MASK) - -#define SYSCON_LPCAC_CTRL_LIM_LPCAC_WTBF_MASK (0x20U) -#define SYSCON_LPCAC_CTRL_LIM_LPCAC_WTBF_SHIFT (5U) -/*! LIM_LPCAC_WTBF - Limit LPCAC Write Through Buffer. - * 0b1..Write buffer enabled when transaction is cacheable and bufferable - * 0b0..Write buffer enabled when transaction is bufferable. - */ -#define SYSCON_LPCAC_CTRL_LIM_LPCAC_WTBF(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_LIM_LPCAC_WTBF_SHIFT)) & SYSCON_LPCAC_CTRL_LIM_LPCAC_WTBF_MASK) - -#define SYSCON_LPCAC_CTRL_PARITY_FAULT_EN_MASK (0x40U) -#define SYSCON_LPCAC_CTRL_PARITY_FAULT_EN_SHIFT (6U) -/*! PARITY_FAULT_EN - Enable parity error report. - * 0b1..Enables parity error report - * 0b0..Disables parity error report - */ -#define SYSCON_LPCAC_CTRL_PARITY_FAULT_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_PARITY_FAULT_EN_SHIFT)) & SYSCON_LPCAC_CTRL_PARITY_FAULT_EN_MASK) - -#define SYSCON_LPCAC_CTRL_LPCAC_XOM_MASK (0x80U) -#define SYSCON_LPCAC_CTRL_LPCAC_XOM_SHIFT (7U) -/*! LPCAC_XOM - LPCAC XOM(eXecute-Only-Memory) attribute control - * 0b1..Enabled. - * 0b0..Disabled. - */ -#define SYSCON_LPCAC_CTRL_LPCAC_XOM(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_LPCAC_CTRL_LPCAC_XOM_SHIFT)) & SYSCON_LPCAC_CTRL_LPCAC_XOM_MASK) -/*! @} */ - -/*! @name FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV - LP_FLEXCOMM Clock Divider */ -/*! @{ */ - -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_DIV_SHIFT)) & SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_DIV_MASK) - -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_RESET_SHIFT)) & SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_RESET_MASK) - -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_HALT_SHIFT)) & SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_HALT_MASK) - -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_UNSTAB_SHIFT)) & SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_UNSTAB_MASK) -/*! @} */ - -/* The count of SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV */ -#define SYSCON_FLEXCOMMXCLKDIV_FLEXCOMMCLKDIV_COUNT (10U) - -/*! @name UTICKCLKSEL - UTICK Function Clock Source Select */ -/*! @{ */ - -#define SYSCON_UTICKCLKSEL_SEL_MASK (0x3U) -#define SYSCON_UTICKCLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the clock source - * 0b00..clk_in - * 0b01..xtal32k[2] - * 0b10..clk_1m clock - * 0b11..No clock - */ -#define SYSCON_UTICKCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_UTICKCLKSEL_SEL_SHIFT)) & SYSCON_UTICKCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name SAI0CLKSEL - SAI0 Function Clock Source Select */ -/*! @{ */ - -#define SYSCON_SAI0CLKSEL_SEL_MASK (0x7U) -#define SYSCON_SAI0CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the clock source - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..FRO_HF clock - * 0b100..PLL1_CLK0 clock - * 0b101..No clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_SAI0CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SAI0CLKSEL_SEL_SHIFT)) & SYSCON_SAI0CLKSEL_SEL_MASK) -/*! @} */ - -/*! @name SAI1CLKSEL - SAI1 Function Clock Source Select */ -/*! @{ */ - -#define SYSCON_SAI1CLKSEL_SEL_MASK (0x7U) -#define SYSCON_SAI1CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the clock source - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..FRO_HF clock - * 0b100..PLL1_CLK0 clock - * 0b101..No clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_SAI1CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SAI1CLKSEL_SEL_SHIFT)) & SYSCON_SAI1CLKSEL_SEL_MASK) -/*! @} */ - -/*! @name SAI0CLKDIV - SAI0 Function Clock Division */ -/*! @{ */ - -#define SYSCON_SAI0CLKDIV_DIV_MASK (0x7U) -#define SYSCON_SAI0CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_SAI0CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SAI0CLKDIV_DIV_SHIFT)) & SYSCON_SAI0CLKDIV_DIV_MASK) - -#define SYSCON_SAI0CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_SAI0CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_SAI0CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SAI0CLKDIV_RESET_SHIFT)) & SYSCON_SAI0CLKDIV_RESET_MASK) - -#define SYSCON_SAI0CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_SAI0CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_SAI0CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SAI0CLKDIV_HALT_SHIFT)) & SYSCON_SAI0CLKDIV_HALT_MASK) - -#define SYSCON_SAI0CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_SAI0CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_SAI0CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SAI0CLKDIV_UNSTAB_SHIFT)) & SYSCON_SAI0CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name SAI1CLKDIV - SAI1 Function Clock Division */ -/*! @{ */ - -#define SYSCON_SAI1CLKDIV_DIV_MASK (0x7U) -#define SYSCON_SAI1CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_SAI1CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SAI1CLKDIV_DIV_SHIFT)) & SYSCON_SAI1CLKDIV_DIV_MASK) - -#define SYSCON_SAI1CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_SAI1CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_SAI1CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SAI1CLKDIV_RESET_SHIFT)) & SYSCON_SAI1CLKDIV_RESET_MASK) - -#define SYSCON_SAI1CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_SAI1CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_SAI1CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SAI1CLKDIV_HALT_SHIFT)) & SYSCON_SAI1CLKDIV_HALT_MASK) - -#define SYSCON_SAI1CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_SAI1CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_SAI1CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SAI1CLKDIV_UNSTAB_SHIFT)) & SYSCON_SAI1CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name EMVSIM0CLKSEL - EMVSIM0 Clock Source Select */ -/*! @{ */ - -#define SYSCON_EMVSIM0CLKSEL_SEL_MASK (0x7U) -#define SYSCON_EMVSIM0CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the EMVSIM0 function clock source - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..FRO_HF clock - * 0b100..FRO_12M clock - * 0b101..PLL1_clk0 clock0 - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_EMVSIM0CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_EMVSIM0CLKSEL_SEL_SHIFT)) & SYSCON_EMVSIM0CLKSEL_SEL_MASK) -/*! @} */ - -/*! @name EMVSIM1CLKSEL - EMVSIM1 Clock Source Select */ -/*! @{ */ - -#define SYSCON_EMVSIM1CLKSEL_SEL_MASK (0x7U) -#define SYSCON_EMVSIM1CLKSEL_SEL_SHIFT (0U) -/*! SEL - Selects the EMVSIM1 function clock source - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..FRO_HF clock - * 0b100..FRO_12M clock - * 0b101..PLL1_clk0 clock0 - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_EMVSIM1CLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_EMVSIM1CLKSEL_SEL_SHIFT)) & SYSCON_EMVSIM1CLKSEL_SEL_MASK) -/*! @} */ - -/*! @name EMVSIM0CLKDIV - EMVSIM0 Function Clock Division */ -/*! @{ */ - -#define SYSCON_EMVSIM0CLKDIV_DIV_MASK (0x7U) -#define SYSCON_EMVSIM0CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_EMVSIM0CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_EMVSIM0CLKDIV_DIV_SHIFT)) & SYSCON_EMVSIM0CLKDIV_DIV_MASK) - -#define SYSCON_EMVSIM0CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_EMVSIM0CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_EMVSIM0CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_EMVSIM0CLKDIV_RESET_SHIFT)) & SYSCON_EMVSIM0CLKDIV_RESET_MASK) - -#define SYSCON_EMVSIM0CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_EMVSIM0CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_EMVSIM0CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_EMVSIM0CLKDIV_HALT_SHIFT)) & SYSCON_EMVSIM0CLKDIV_HALT_MASK) - -#define SYSCON_EMVSIM0CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_EMVSIM0CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_EMVSIM0CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_EMVSIM0CLKDIV_UNSTAB_SHIFT)) & SYSCON_EMVSIM0CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name EMVSIM1CLKDIV - EMVSIM1 Function Clock Division */ -/*! @{ */ - -#define SYSCON_EMVSIM1CLKDIV_DIV_MASK (0x7U) -#define SYSCON_EMVSIM1CLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_EMVSIM1CLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_EMVSIM1CLKDIV_DIV_SHIFT)) & SYSCON_EMVSIM1CLKDIV_DIV_MASK) - -#define SYSCON_EMVSIM1CLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_EMVSIM1CLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_EMVSIM1CLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_EMVSIM1CLKDIV_RESET_SHIFT)) & SYSCON_EMVSIM1CLKDIV_RESET_MASK) - -#define SYSCON_EMVSIM1CLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_EMVSIM1CLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_EMVSIM1CLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_EMVSIM1CLKDIV_HALT_SHIFT)) & SYSCON_EMVSIM1CLKDIV_HALT_MASK) - -#define SYSCON_EMVSIM1CLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_EMVSIM1CLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_EMVSIM1CLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_EMVSIM1CLKDIV_UNSTAB_SHIFT)) & SYSCON_EMVSIM1CLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name KEY_RETAIN_CTRL - Key Retain Control */ -/*! @{ */ - -#define SYSCON_KEY_RETAIN_CTRL_KEY_RETAIN_VALID_MASK (0x1U) -#define SYSCON_KEY_RETAIN_CTRL_KEY_RETAIN_VALID_SHIFT (0U) -/*! KEY_RETAIN_VALID - Indicates if the PUF key has been retained in the VBAT domain and has not - * been reset or otherwise invalidated by software. - * 0b0..PUF key is not retained in VBAT domain. - * 0b1..PUF key is retained in VBAT domain. - */ -#define SYSCON_KEY_RETAIN_CTRL_KEY_RETAIN_VALID(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_KEY_RETAIN_CTRL_KEY_RETAIN_VALID_SHIFT)) & SYSCON_KEY_RETAIN_CTRL_KEY_RETAIN_VALID_MASK) - -#define SYSCON_KEY_RETAIN_CTRL_KEY_RETAIN_DONE_MASK (0x2U) -#define SYSCON_KEY_RETAIN_CTRL_KEY_RETAIN_DONE_SHIFT (1U) -/*! KEY_RETAIN_DONE - Indicates the successful completion of the key_save or key_load routine. Once - * set, to clear the key_retain_done flag, both key_save and key_load should be cleared by - * software. - * 0b0..Key save / load sequence has not completed. - * 0b1..Key save / load sequence has completed. - */ -#define SYSCON_KEY_RETAIN_CTRL_KEY_RETAIN_DONE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_KEY_RETAIN_CTRL_KEY_RETAIN_DONE_SHIFT)) & SYSCON_KEY_RETAIN_CTRL_KEY_RETAIN_DONE_MASK) - -#define SYSCON_KEY_RETAIN_CTRL_KEY_SAVE_MASK (0x10000U) -#define SYSCON_KEY_RETAIN_CTRL_KEY_SAVE_SHIFT (16U) -/*! KEY_SAVE - * 0b0..Key save sequence is disabled. - * 0b1..Key save sequence is enabled. - */ -#define SYSCON_KEY_RETAIN_CTRL_KEY_SAVE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_KEY_RETAIN_CTRL_KEY_SAVE_SHIFT)) & SYSCON_KEY_RETAIN_CTRL_KEY_SAVE_MASK) - -#define SYSCON_KEY_RETAIN_CTRL_KEY_LOAD_MASK (0x20000U) -#define SYSCON_KEY_RETAIN_CTRL_KEY_LOAD_SHIFT (17U) -/*! KEY_LOAD - * 0b0..Key load sequence is disabled. - * 0b1..Key load sequence is enabled. - */ -#define SYSCON_KEY_RETAIN_CTRL_KEY_LOAD(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_KEY_RETAIN_CTRL_KEY_LOAD_SHIFT)) & SYSCON_KEY_RETAIN_CTRL_KEY_LOAD_MASK) -/*! @} */ - -/*! @name REF_CLK_CTRL - FRO 48MHz Reference Clock Control */ -/*! @{ */ - -#define SYSCON_REF_CLK_CTRL_GDET_REFCLK_EN_MASK (0x1U) -#define SYSCON_REF_CLK_CTRL_GDET_REFCLK_EN_SHIFT (0U) -/*! GDET_REFCLK_EN - GDET reference clock enable bit - * 0b1..Enabled - * 0b0..Disabled. - */ -#define SYSCON_REF_CLK_CTRL_GDET_REFCLK_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_REF_CLK_CTRL_GDET_REFCLK_EN_SHIFT)) & SYSCON_REF_CLK_CTRL_GDET_REFCLK_EN_MASK) - -#define SYSCON_REF_CLK_CTRL_TRNG_REFCLK_EN_MASK (0x2U) -#define SYSCON_REF_CLK_CTRL_TRNG_REFCLK_EN_SHIFT (1U) -/*! TRNG_REFCLK_EN - ELS TRNG reference clock enable bit - * 0b1..Enabled - * 0b0..Disabled. - */ -#define SYSCON_REF_CLK_CTRL_TRNG_REFCLK_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_REF_CLK_CTRL_TRNG_REFCLK_EN_SHIFT)) & SYSCON_REF_CLK_CTRL_TRNG_REFCLK_EN_MASK) -/*! @} */ - -/*! @name REF_CLK_CTRL_SET - FRO 48MHz Reference Clock Control Set */ -/*! @{ */ - -#define SYSCON_REF_CLK_CTRL_SET_GDET_REFCLK_EN_SET_MASK (0x1U) -#define SYSCON_REF_CLK_CTRL_SET_GDET_REFCLK_EN_SET_SHIFT (0U) -/*! GDET_REFCLK_EN_SET - GDET reference clock enable set bit - * 0b1..Set to 1 - * 0b0..No effect. - */ -#define SYSCON_REF_CLK_CTRL_SET_GDET_REFCLK_EN_SET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_REF_CLK_CTRL_SET_GDET_REFCLK_EN_SET_SHIFT)) & SYSCON_REF_CLK_CTRL_SET_GDET_REFCLK_EN_SET_MASK) - -#define SYSCON_REF_CLK_CTRL_SET_TRNG_REFCLK_EN_SET_MASK (0x2U) -#define SYSCON_REF_CLK_CTRL_SET_TRNG_REFCLK_EN_SET_SHIFT (1U) -/*! TRNG_REFCLK_EN_SET - ELS TRNG reference clock enable set bit - * 0b1..Set to 1 - * 0b0..No effect. - */ -#define SYSCON_REF_CLK_CTRL_SET_TRNG_REFCLK_EN_SET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_REF_CLK_CTRL_SET_TRNG_REFCLK_EN_SET_SHIFT)) & SYSCON_REF_CLK_CTRL_SET_TRNG_REFCLK_EN_SET_MASK) -/*! @} */ - -/*! @name REF_CLK_CTRL_CLR - FRO 48MHz Reference Clock Control Clear */ -/*! @{ */ - -#define SYSCON_REF_CLK_CTRL_CLR_GDET_REFCLK_EN_CLR_MASK (0x1U) -#define SYSCON_REF_CLK_CTRL_CLR_GDET_REFCLK_EN_CLR_SHIFT (0U) -/*! GDET_REFCLK_EN_CLR - GDET reference clock enable clear bit - * 0b1..Set to 0 - * 0b0..No effect. - */ -#define SYSCON_REF_CLK_CTRL_CLR_GDET_REFCLK_EN_CLR(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_REF_CLK_CTRL_CLR_GDET_REFCLK_EN_CLR_SHIFT)) & SYSCON_REF_CLK_CTRL_CLR_GDET_REFCLK_EN_CLR_MASK) - -#define SYSCON_REF_CLK_CTRL_CLR_TRNG_REFCLK_EN_CLR_MASK (0x2U) -#define SYSCON_REF_CLK_CTRL_CLR_TRNG_REFCLK_EN_CLR_SHIFT (1U) -/*! TRNG_REFCLK_EN_CLR - ELS TRNG reference clock enable clear bit - * 0b1..Set to 0 - * 0b0..No effect. - */ -#define SYSCON_REF_CLK_CTRL_CLR_TRNG_REFCLK_EN_CLR(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_REF_CLK_CTRL_CLR_TRNG_REFCLK_EN_CLR_SHIFT)) & SYSCON_REF_CLK_CTRL_CLR_TRNG_REFCLK_EN_CLR_MASK) -/*! @} */ - -/*! @name GDETX_CTRL_GDET_CTRL - GDET Control Register */ -/*! @{ */ - -#define SYSCON_GDETX_CTRL_GDET_CTRL_GDET_EVTCNT_CLR_MASK (0x1U) -#define SYSCON_GDETX_CTRL_GDET_CTRL_GDET_EVTCNT_CLR_SHIFT (0U) -/*! GDET_EVTCNT_CLR - Controls the GDET clean event counter - * 0b1..Clears event counter - * 0b0..Event counter not cleared - */ -#define SYSCON_GDETX_CTRL_GDET_CTRL_GDET_EVTCNT_CLR(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GDETX_CTRL_GDET_CTRL_GDET_EVTCNT_CLR_SHIFT)) & SYSCON_GDETX_CTRL_GDET_CTRL_GDET_EVTCNT_CLR_MASK) - -#define SYSCON_GDETX_CTRL_GDET_CTRL_GDET_ERR_CLR_MASK (0x2U) -#define SYSCON_GDETX_CTRL_GDET_CTRL_GDET_ERR_CLR_SHIFT (1U) -/*! GDET_ERR_CLR - Clears GDET error status - * 0b1..Clears error status - * 0b0..Error status not cleared - */ -#define SYSCON_GDETX_CTRL_GDET_CTRL_GDET_ERR_CLR(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GDETX_CTRL_GDET_CTRL_GDET_ERR_CLR_SHIFT)) & SYSCON_GDETX_CTRL_GDET_CTRL_GDET_ERR_CLR_MASK) - -#define SYSCON_GDETX_CTRL_GDET_CTRL_GDET_ISO_SW_MASK (0xCU) -#define SYSCON_GDETX_CTRL_GDET_CTRL_GDET_ISO_SW_SHIFT (2U) -/*! GDET_ISO_SW - GDET isolation control - * 0b10..Isolation is enabled. When both GDET0_CTRL/GDET1_CTRL GDET_ISO_SW are "10", isolation_on is asserted. - * 0b00..Isolation is disabled - * 0b01..Isolation is disabled - * 0b11..Isolation is disabled - */ -#define SYSCON_GDETX_CTRL_GDET_CTRL_GDET_ISO_SW(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GDETX_CTRL_GDET_CTRL_GDET_ISO_SW_SHIFT)) & SYSCON_GDETX_CTRL_GDET_CTRL_GDET_ISO_SW_MASK) - -#define SYSCON_GDETX_CTRL_GDET_CTRL_EVENT_CNT_MASK (0xFF00U) -#define SYSCON_GDETX_CTRL_GDET_CTRL_EVENT_CNT_SHIFT (8U) -/*! EVENT_CNT - Event count value */ -#define SYSCON_GDETX_CTRL_GDET_CTRL_EVENT_CNT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GDETX_CTRL_GDET_CTRL_EVENT_CNT_SHIFT)) & SYSCON_GDETX_CTRL_GDET_CTRL_EVENT_CNT_MASK) - -#define SYSCON_GDETX_CTRL_GDET_CTRL_POS_SYNC_MASK (0x10000U) -#define SYSCON_GDETX_CTRL_GDET_CTRL_POS_SYNC_SHIFT (16U) -/*! POS_SYNC - Positive glitch detected - * 0b1..Positive glitch detected - * 0b0..Positive glitch not detected - */ -#define SYSCON_GDETX_CTRL_GDET_CTRL_POS_SYNC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GDETX_CTRL_GDET_CTRL_POS_SYNC_SHIFT)) & SYSCON_GDETX_CTRL_GDET_CTRL_POS_SYNC_MASK) - -#define SYSCON_GDETX_CTRL_GDET_CTRL_NEG_SYNC_MASK (0x20000U) -#define SYSCON_GDETX_CTRL_GDET_CTRL_NEG_SYNC_SHIFT (17U) -/*! NEG_SYNC - Negative glitch detected - * 0b1..Negative glitch detected - * 0b0..Negative glitch not detected - */ -#define SYSCON_GDETX_CTRL_GDET_CTRL_NEG_SYNC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GDETX_CTRL_GDET_CTRL_NEG_SYNC_SHIFT)) & SYSCON_GDETX_CTRL_GDET_CTRL_NEG_SYNC_MASK) - -#define SYSCON_GDETX_CTRL_GDET_CTRL_EVENT_CLR_FLAG_MASK (0x40000U) -#define SYSCON_GDETX_CTRL_GDET_CTRL_EVENT_CLR_FLAG_SHIFT (18U) -/*! EVENT_CLR_FLAG - Event counter cleared - * 0b1..Event counter cleared - * 0b0..Event counter not cleared - */ -#define SYSCON_GDETX_CTRL_GDET_CTRL_EVENT_CLR_FLAG(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GDETX_CTRL_GDET_CTRL_EVENT_CLR_FLAG_SHIFT)) & SYSCON_GDETX_CTRL_GDET_CTRL_EVENT_CLR_FLAG_MASK) -/*! @} */ - -/* The count of SYSCON_GDETX_CTRL_GDET_CTRL */ -#define SYSCON_GDETX_CTRL_GDET_CTRL_COUNT (2U) - -/*! @name ELS_ASSET_PROT - ELS Asset Protection Register */ -/*! @{ */ - -#define SYSCON_ELS_ASSET_PROT_ASSET_PROTECTION_MASK (0x3U) -#define SYSCON_ELS_ASSET_PROT_ASSET_PROTECTION_SHIFT (0U) -/*! ASSET_PROTECTION - ELS asset protection. This field controls the asset protection port to the - * ELS module. Refer to the ELS chapter in the SRM for more details. - * 0b00..ELS asset is protected - * 0b10..ELS asset is protected - * 0b11..ELS asset is protected - * 0b01..ELS asset is not protected - */ -#define SYSCON_ELS_ASSET_PROT_ASSET_PROTECTION(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_ASSET_PROT_ASSET_PROTECTION_SHIFT)) & SYSCON_ELS_ASSET_PROT_ASSET_PROTECTION_MASK) -/*! @} */ - -/*! @name ELS_LOCK_CTRL - ELS Lock Control */ -/*! @{ */ - -#define SYSCON_ELS_LOCK_CTRL_LOCK_CTRL_MASK (0x3U) -#define SYSCON_ELS_LOCK_CTRL_LOCK_CTRL_SHIFT (0U) -/*! LOCK_CTRL - ELS Lock Control */ -#define SYSCON_ELS_LOCK_CTRL_LOCK_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_LOCK_CTRL_LOCK_CTRL_SHIFT)) & SYSCON_ELS_LOCK_CTRL_LOCK_CTRL_MASK) -/*! @} */ - -/*! @name ELS_LOCK_CTRL_DP - ELS Lock Control DP */ -/*! @{ */ - -#define SYSCON_ELS_LOCK_CTRL_DP_LOCK_CTRL_DP_MASK (0x3U) -#define SYSCON_ELS_LOCK_CTRL_DP_LOCK_CTRL_DP_SHIFT (0U) -/*! LOCK_CTRL_DP - Refer to ELS_LOCK_CTRL[1:0] */ -#define SYSCON_ELS_LOCK_CTRL_DP_LOCK_CTRL_DP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_LOCK_CTRL_DP_LOCK_CTRL_DP_SHIFT)) & SYSCON_ELS_LOCK_CTRL_DP_LOCK_CTRL_DP_MASK) -/*! @} */ - -/*! @name ELS_OTP_LC_STATE - Life Cycle State Register */ -/*! @{ */ - -#define SYSCON_ELS_OTP_LC_STATE_OTP_LC_STATE_MASK (0xFFU) -#define SYSCON_ELS_OTP_LC_STATE_OTP_LC_STATE_SHIFT (0U) -/*! OTP_LC_STATE - OTP life cycle state */ -#define SYSCON_ELS_OTP_LC_STATE_OTP_LC_STATE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_OTP_LC_STATE_OTP_LC_STATE_SHIFT)) & SYSCON_ELS_OTP_LC_STATE_OTP_LC_STATE_MASK) -/*! @} */ - -/*! @name ELS_OTP_LC_STATE_DP - Life Cycle State Register (Duplicate) */ -/*! @{ */ - -#define SYSCON_ELS_OTP_LC_STATE_DP_OTP_LC_STATE_DP_MASK (0xFFU) -#define SYSCON_ELS_OTP_LC_STATE_DP_OTP_LC_STATE_DP_SHIFT (0U) -/*! OTP_LC_STATE_DP - OTP life cycle state */ -#define SYSCON_ELS_OTP_LC_STATE_DP_OTP_LC_STATE_DP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_OTP_LC_STATE_DP_OTP_LC_STATE_DP_SHIFT)) & SYSCON_ELS_OTP_LC_STATE_DP_OTP_LC_STATE_DP_MASK) -/*! @} */ - -/*! @name ELS_TEMPORAL_STATE - ELS Temporal State */ -/*! @{ */ - -#define SYSCON_ELS_TEMPORAL_STATE_TEMPORAL_STATE_MASK (0xFU) -#define SYSCON_ELS_TEMPORAL_STATE_TEMPORAL_STATE_SHIFT (0U) -/*! TEMPORAL_STATE - Temporal state */ -#define SYSCON_ELS_TEMPORAL_STATE_TEMPORAL_STATE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_TEMPORAL_STATE_TEMPORAL_STATE_SHIFT)) & SYSCON_ELS_TEMPORAL_STATE_TEMPORAL_STATE_MASK) -/*! @} */ - -/*! @name ELS_KDF_MASK - Key Derivation Function Mask */ -/*! @{ */ - -#define SYSCON_ELS_KDF_MASK_KDF_MASK_MASK (0xFFFFFFFFU) -#define SYSCON_ELS_KDF_MASK_KDF_MASK_SHIFT (0U) -/*! KDF_MASK - Key derivation function mask */ -#define SYSCON_ELS_KDF_MASK_KDF_MASK(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_KDF_MASK_KDF_MASK_SHIFT)) & SYSCON_ELS_KDF_MASK_KDF_MASK_MASK) -/*! @} */ - -/*! @name ELS_AS_CFG0 - ELS AS Configuration */ -/*! @{ */ - -#define SYSCON_ELS_AS_CFG0_CFG_LC_STATE_MASK (0xFFU) -#define SYSCON_ELS_AS_CFG0_CFG_LC_STATE_SHIFT (0U) -/*! CFG_LC_STATE - LC state configuration bit */ -#define SYSCON_ELS_AS_CFG0_CFG_LC_STATE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_LC_STATE_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_LC_STATE_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_LVD_CORE_RESET_ENABLED_MASK (0x200U) -#define SYSCON_ELS_AS_CFG0_CFG_LVD_CORE_RESET_ENABLED_SHIFT (9U) -/*! CFG_LVD_CORE_RESET_ENABLED - When SPC CORE LVD analog detector are turned on, and CORE LVD reset are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_LVD_CORE_RESET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_LVD_CORE_RESET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_LVD_CORE_RESET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_LVD_CORE_IRQ_ENABLED_MASK (0x800U) -#define SYSCON_ELS_AS_CFG0_CFG_LVD_CORE_IRQ_ENABLED_SHIFT (11U) -/*! CFG_LVD_CORE_IRQ_ENABLED - When SPC CORE LVD analog detector are turned on, and CORE LVD IRQ are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_LVD_CORE_IRQ_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_LVD_CORE_IRQ_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_LVD_CORE_IRQ_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_WDT0_ENABLED_MASK (0x1000U) -#define SYSCON_ELS_AS_CFG0_CFG_WDT0_ENABLED_SHIFT (12U) -/*! CFG_WDT0_ENABLED - When WatchDog Timer 0 is activated, this bit indicates state 1 */ -#define SYSCON_ELS_AS_CFG0_CFG_WDT0_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_WDT0_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_WDT0_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_CWDT0_ENABLED_MASK (0x2000U) -#define SYSCON_ELS_AS_CFG0_CFG_CWDT0_ENABLED_SHIFT (13U) -/*! CFG_CWDT0_ENABLED - When Code WatchDog Timer 0 is activated, this bit indicates state 1 */ -#define SYSCON_ELS_AS_CFG0_CFG_CWDT0_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_CWDT0_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_CWDT0_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_ELS_GDET_ENABLED_MASK (0x4000U) -#define SYSCON_ELS_AS_CFG0_CFG_ELS_GDET_ENABLED_SHIFT (14U) -/*! CFG_ELS_GDET_ENABLED - When either GDET is enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_ELS_GDET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_ELS_GDET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_ELS_GDET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_ANA_GDET_RESET_ENABLED_MASK (0x8000U) -#define SYSCON_ELS_AS_CFG0_CFG_ANA_GDET_RESET_ENABLED_SHIFT (15U) -/*! CFG_ANA_GDET_RESET_ENABLED - When SPC analog glitch detect reset is enabled, this bit indicates state 1 */ -#define SYSCON_ELS_AS_CFG0_CFG_ANA_GDET_RESET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_ANA_GDET_RESET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_ANA_GDET_RESET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_ANA_GDET_IRQ_ENABLED_MASK (0x10000U) -#define SYSCON_ELS_AS_CFG0_CFG_ANA_GDET_IRQ_ENABLED_SHIFT (16U) -/*! CFG_ANA_GDET_IRQ_ENABLED - When SPC analog glitch detect IRQ is enabled, this bit indicates state 1 */ -#define SYSCON_ELS_AS_CFG0_CFG_ANA_GDET_IRQ_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_ANA_GDET_IRQ_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_ANA_GDET_IRQ_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_TAMPER_DET_ENABLED_MASK (0x20000U) -#define SYSCON_ELS_AS_CFG0_CFG_TAMPER_DET_ENABLED_SHIFT (17U) -/*! CFG_TAMPER_DET_ENABLED - When tamper detector is enabled in TDET, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_TAMPER_DET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_TAMPER_DET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_TAMPER_DET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VSYS_RESET_ENABLED_MASK (0x40000U) -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VSYS_RESET_ENABLED_SHIFT (18U) -/*! CFG_LVD_VSYS_RESET_ENABLED - When SPC VSYS LVD analog detector are turned on and VSYS LVD reset are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VSYS_RESET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_LVD_VSYS_RESET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_LVD_VSYS_RESET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VDDIO_RESET_ENABLED_MASK (0x80000U) -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VDDIO_RESET_ENABLED_SHIFT (19U) -/*! CFG_LVD_VDDIO_RESET_ENABLED - When SPC VDDIO LVD analog detector are turned on and VDDIO LVD reset are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VDDIO_RESET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_LVD_VDDIO_RESET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_LVD_VDDIO_RESET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VSYS_IRQ_ENABLED_MASK (0x100000U) -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VSYS_IRQ_ENABLED_SHIFT (20U) -/*! CFG_LVD_VSYS_IRQ_ENABLED - When SPC VSYS LVD analog detector are turned on and VSYS LVD irq are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VSYS_IRQ_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_LVD_VSYS_IRQ_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_LVD_VSYS_IRQ_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VDDIO_IRQ_ENABLED_MASK (0x200000U) -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VDDIO_IRQ_ENABLED_SHIFT (21U) -/*! CFG_LVD_VDDIO_IRQ_ENABLED - When SPC VDDIO LVD analog detector are turned on and VDDIO LVD irq are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_LVD_VDDIO_IRQ_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_LVD_VDDIO_IRQ_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_LVD_VDDIO_IRQ_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_WDT1_ENABLED_MASK (0x400000U) -#define SYSCON_ELS_AS_CFG0_CFG_WDT1_ENABLED_SHIFT (22U) -/*! CFG_WDT1_ENABLED - When WatchDog Timer 1 is activated, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_WDT1_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_WDT1_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_WDT1_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_CWDT1_ENABLED_MASK (0x800000U) -#define SYSCON_ELS_AS_CFG0_CFG_CWDT1_ENABLED_SHIFT (23U) -/*! CFG_CWDT1_ENABLED - When Code WatchDog Timer 1 is activated, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_CWDT1_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_CWDT1_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_CWDT1_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_TEMPTAMPER_DET_ENABLED_MASK (0x1000000U) -#define SYSCON_ELS_AS_CFG0_CFG_TEMPTAMPER_DET_ENABLED_SHIFT (24U) -/*! CFG_TEMPTAMPER_DET_ENABLED - When temperature tamper detector is enabled in VBAT, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_TEMPTAMPER_DET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_TEMPTAMPER_DET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_TEMPTAMPER_DET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_VOLTAMPER_DET_ENABLED_MASK (0x2000000U) -#define SYSCON_ELS_AS_CFG0_CFG_VOLTAMPER_DET_ENABLED_SHIFT (25U) -/*! CFG_VOLTAMPER_DET_ENABLED - When voltage tamper detector is enabled in VBAT, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_VOLTAMPER_DET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_VOLTAMPER_DET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_VOLTAMPER_DET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_LHTTAMPER_DET_ENABLED_MASK (0x4000000U) -#define SYSCON_ELS_AS_CFG0_CFG_LHTTAMPER_DET_ENABLED_SHIFT (26U) -/*! CFG_LHTTAMPER_DET_ENABLED - When light tamper detector is enabled in VBAT, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_LHTTAMPER_DET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_LHTTAMPER_DET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_LHTTAMPER_DET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_CLKTAMPER_DET_ENABLED_MASK (0x8000000U) -#define SYSCON_ELS_AS_CFG0_CFG_CLKTAMPER_DET_ENABLED_SHIFT (27U) -/*! CFG_CLKTAMPER_DET_ENABLED - When clk tamper detector is enabled in VBAT, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG0_CFG_CLKTAMPER_DET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_CLKTAMPER_DET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_CLKTAMPER_DET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_QK_DISABLE_ENROLL_MASK (0x10000000U) -#define SYSCON_ELS_AS_CFG0_CFG_QK_DISABLE_ENROLL_SHIFT (28U) -/*! CFG_QK_DISABLE_ENROLL - When QK PUF "qk_disable_enroll" input is driven 1, this bit indicates state 1 */ -#define SYSCON_ELS_AS_CFG0_CFG_QK_DISABLE_ENROLL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_QK_DISABLE_ENROLL_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_QK_DISABLE_ENROLL_MASK) - -#define SYSCON_ELS_AS_CFG0_CFG_QK_DISABLE_WRAP_MASK (0x20000000U) -#define SYSCON_ELS_AS_CFG0_CFG_QK_DISABLE_WRAP_SHIFT (29U) -/*! CFG_QK_DISABLE_WRAP - When QK PUF "qk_disable_wrap" input is driven 1, this bit indicates state 1 */ -#define SYSCON_ELS_AS_CFG0_CFG_QK_DISABLE_WRAP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG0_CFG_QK_DISABLE_WRAP_SHIFT)) & SYSCON_ELS_AS_CFG0_CFG_QK_DISABLE_WRAP_MASK) -/*! @} */ - -/*! @name ELS_AS_CFG1 - ELS AS Configuration1 */ -/*! @{ */ - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_DIS_STRICT_MODE_MASK (0x2U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_DIS_STRICT_MODE_SHIFT (1U) -/*! CFG_SEC_DIS_STRICT_MODE - When CFG_SEC_ENA_SEC_CHK indicates state 0 or when DISABLE_STRICT_MODE - * bits in MISC_CTRL_REG and MISC_CTRL_DP_REG on the AHB secure controller are equal to 01, this - * bit indicates state 1 - */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_DIS_STRICT_MODE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_DIS_STRICT_MODE_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_DIS_STRICT_MODE_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_DIS_VIOL_ABORT_MASK (0x4U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_DIS_VIOL_ABORT_SHIFT (2U) -/*! CFG_SEC_DIS_VIOL_ABORT - When the DISABLE_VIOLATION_ABORT bits in MISC_CTRL_REG and - * MISC_CTRL_DP_REG on the AHB secure controller are not equal to 10, this bit indicates state 1 - */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_DIS_VIOL_ABORT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_DIS_VIOL_ABORT_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_DIS_VIOL_ABORT_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_NS_PRIV_CHK_MASK (0x8U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_NS_PRIV_CHK_SHIFT (3U) -/*! CFG_SEC_ENA_NS_PRIV_CHK - When the ENABLE_NS_PRIV_CHECK bits in MISC_CTRL_REG and - * MISC_CTRL_DP_REG on the AHB secure controller are not equal to 10, this bit indicates state 1 - */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_NS_PRIV_CHK(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_NS_PRIV_CHK_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_NS_PRIV_CHK_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_S_PRIV_CHK_MASK (0x10U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_S_PRIV_CHK_SHIFT (4U) -/*! CFG_SEC_ENA_S_PRIV_CHK - When the ENABLE_S_PRIV_CHECK bits in MISC_CTRL_REG and MISC_CTRL_DP_REG - * on the AHB secure controller are not equal to 10, this bit indicates state 1 - */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_S_PRIV_CHK(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_S_PRIV_CHK_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_S_PRIV_CHK_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_SEC_CHK_MASK (0x20U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_SEC_CHK_SHIFT (5U) -/*! CFG_SEC_ENA_SEC_CHK - When the ENABLE_SECURE_CHECKING bits in MISC_CTRL_REG and MISC_CTRL_DP_REG - * on the AHB secure controller are not equal to 10, this bit indicates state 1 - */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_SEC_CHK(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_SEC_CHK_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_ENA_SEC_CHK_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_IDAU_ALLNS_MASK (0x40U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_IDAU_ALLNS_SHIFT (6U) -/*! CFG_SEC_IDAU_ALLNS - When the IDAU_ALL_NS bits in MISC_CTRL_REG and MISC_CTRL_DP_REG on the AHB - * secure controller are equal to 01, this bit indicates state 1 - */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_IDAU_ALLNS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_IDAU_ALLNS_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_IDAU_ALLNS_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_NS_MPU_MASK (0x100U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_NS_MPU_SHIFT (8U) -/*! CFG_SEC_LOCK_NS_MPU - When the LOCK_NS_MPU bits in CPU0_LOCK_REG on the AHB secure controller are not equal to 10, this bit indicates state 1 */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_NS_MPU(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_NS_MPU_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_NS_MPU_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_NS_VTOR_MASK (0x200U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_NS_VTOR_SHIFT (9U) -/*! CFG_SEC_LOCK_NS_VTOR - When the LOCK_NS_VTOR bits in CPU0_LOCK_REG on the AHB secure controller are not equal to 10, this bit indicates state 1 */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_NS_VTOR(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_NS_VTOR_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_NS_VTOR_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_S_MPU_MASK (0x400U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_S_MPU_SHIFT (10U) -/*! CFG_SEC_LOCK_S_MPU - When the LOCK_S_MPU bits in CPU0_LOCK_REG on the AHB secure controller are not equal to 10, this bit indicates state 1 */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_S_MPU(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_S_MPU_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_S_MPU_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_S_VTAIRCR_MASK (0x800U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_S_VTAIRCR_SHIFT (11U) -/*! CFG_SEC_LOCK_S_VTAIRCR - When the LOCK_S_VTAIRCR bits in CPU0_LOCK_REG on the AHB secure - * controller are not equal to 10, this bit indicates state 1 - */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_S_VTAIRCR(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_S_VTAIRCR_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_S_VTAIRCR_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_SAU_MASK (0x1000U) -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_SAU_SHIFT (12U) -/*! CFG_SEC_LOCK_SAU - When the LOCK_SAU bits in CPU0_LOCK_REG on the AHB secure controller are not equal to 10, this bit indicates state 1 */ -#define SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_SAU(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_SAU_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_SEC_LOCK_SAU_MASK) - -#define SYSCON_ELS_AS_CFG1_METAL_VERSION_MASK (0x1FE000U) -#define SYSCON_ELS_AS_CFG1_METAL_VERSION_SHIFT (13U) -/*! METAL_VERSION - metal version */ -#define SYSCON_ELS_AS_CFG1_METAL_VERSION(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_METAL_VERSION_SHIFT)) & SYSCON_ELS_AS_CFG1_METAL_VERSION_MASK) - -#define SYSCON_ELS_AS_CFG1_ROM_PATCH_VERSION_MASK (0x1E00000U) -#define SYSCON_ELS_AS_CFG1_ROM_PATCH_VERSION_SHIFT (21U) -/*! ROM_PATCH_VERSION - ROM patch version */ -#define SYSCON_ELS_AS_CFG1_ROM_PATCH_VERSION(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_ROM_PATCH_VERSION_SHIFT)) & SYSCON_ELS_AS_CFG1_ROM_PATCH_VERSION_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_HVD_CORE_RESET_ENABLED_MASK (0x4000000U) -#define SYSCON_ELS_AS_CFG1_CFG_HVD_CORE_RESET_ENABLED_SHIFT (26U) -/*! CFG_HVD_CORE_RESET_ENABLED - When SPC CORE HVD analog detector are turned on, and CORE HVD reset are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG1_CFG_HVD_CORE_RESET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_HVD_CORE_RESET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_HVD_CORE_RESET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_HVD_CORE_IRQ_ENABLED_MASK (0x8000000U) -#define SYSCON_ELS_AS_CFG1_CFG_HVD_CORE_IRQ_ENABLED_SHIFT (27U) -/*! CFG_HVD_CORE_IRQ_ENABLED - When SPC CORE HVD analog detector are turned on, and CORE HVD IRQ are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG1_CFG_HVD_CORE_IRQ_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_HVD_CORE_IRQ_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_HVD_CORE_IRQ_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VSYS_RESET_ENABLED_MASK (0x10000000U) -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VSYS_RESET_ENABLED_SHIFT (28U) -/*! CFG_HVD_VSYS_RESET_ENABLED - When SPC VSYS HVD analog detector are turned on and VSYS HVD reset are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VSYS_RESET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_HVD_VSYS_RESET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_HVD_VSYS_RESET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VDDIO_RESET_ENABLED_MASK (0x20000000U) -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VDDIO_RESET_ENABLED_SHIFT (29U) -/*! CFG_HVD_VDDIO_RESET_ENABLED - When SPC VDDIO HVD analog detector are turned on and VDDIO HVD reset are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VDDIO_RESET_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_HVD_VDDIO_RESET_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_HVD_VDDIO_RESET_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VSYS_IRQ_ENABLED_MASK (0x40000000U) -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VSYS_IRQ_ENABLED_SHIFT (30U) -/*! CFG_HVD_VSYS_IRQ_ENABLED - When SPC VSYS HVD analog detector are turned on and VSYS HVD irq are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VSYS_IRQ_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_HVD_VSYS_IRQ_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_HVD_VSYS_IRQ_ENABLED_MASK) - -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VDDIO_IRQ_ENABLED_MASK (0x80000000U) -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VDDIO_IRQ_ENABLED_SHIFT (31U) -/*! CFG_HVD_VDDIO_IRQ_ENABLED - When SPC VDDIO HVD analog detector are turned on and VDDIO HVD irq are enabled, this bit indicates state 1. */ -#define SYSCON_ELS_AS_CFG1_CFG_HVD_VDDIO_IRQ_ENABLED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG1_CFG_HVD_VDDIO_IRQ_ENABLED_SHIFT)) & SYSCON_ELS_AS_CFG1_CFG_HVD_VDDIO_IRQ_ENABLED_MASK) -/*! @} */ - -/*! @name ELS_AS_CFG2 - ELS AS Configuration2 */ -/*! @{ */ - -#define SYSCON_ELS_AS_CFG2_CFG_ELS_CMD_EN_MASK (0xFFFFFFFFU) -#define SYSCON_ELS_AS_CFG2_CFG_ELS_CMD_EN_SHIFT (0U) -/*! CFG_ELS_CMD_EN - ELS configuration command enable bit */ -#define SYSCON_ELS_AS_CFG2_CFG_ELS_CMD_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG2_CFG_ELS_CMD_EN_SHIFT)) & SYSCON_ELS_AS_CFG2_CFG_ELS_CMD_EN_MASK) -/*! @} */ - -/*! @name ELS_AS_CFG3 - ELS AS Configuration3 */ -/*! @{ */ - -#define SYSCON_ELS_AS_CFG3_DEVICE_TYPE_MASK (0xFFFFFFFFU) -#define SYSCON_ELS_AS_CFG3_DEVICE_TYPE_SHIFT (0U) -/*! DEVICE_TYPE - Device type identification data */ -#define SYSCON_ELS_AS_CFG3_DEVICE_TYPE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_CFG3_DEVICE_TYPE_SHIFT)) & SYSCON_ELS_AS_CFG3_DEVICE_TYPE_MASK) -/*! @} */ - -/*! @name ELS_AS_ST0 - ELS AS State Register */ -/*! @{ */ - -#define SYSCON_ELS_AS_ST0_ST_TEMPORAL_STATE_MASK (0xFU) -#define SYSCON_ELS_AS_ST0_ST_TEMPORAL_STATE_SHIFT (0U) -/*! ST_TEMPORAL_STATE - TEMPORAL_STATE[3:0] in the ELS_TEMPORAL_STATE register reflects this register */ -#define SYSCON_ELS_AS_ST0_ST_TEMPORAL_STATE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_TEMPORAL_STATE_SHIFT)) & SYSCON_ELS_AS_ST0_ST_TEMPORAL_STATE_MASK) - -#define SYSCON_ELS_AS_ST0_ST_CPU0_DBGEN_MASK (0x10U) -#define SYSCON_ELS_AS_ST0_ST_CPU0_DBGEN_SHIFT (4U) -/*! ST_CPU0_DBGEN - When CPU0 (CM33) "deben" input is state 1, this bit indicates state 1 */ -#define SYSCON_ELS_AS_ST0_ST_CPU0_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_CPU0_DBGEN_SHIFT)) & SYSCON_ELS_AS_ST0_ST_CPU0_DBGEN_MASK) - -#define SYSCON_ELS_AS_ST0_ST_CPU0_NIDEN_MASK (0x20U) -#define SYSCON_ELS_AS_ST0_ST_CPU0_NIDEN_SHIFT (5U) -/*! ST_CPU0_NIDEN - When CPU0 (CM33) "niden" input is state 1, this bit indicates state 1 */ -#define SYSCON_ELS_AS_ST0_ST_CPU0_NIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_CPU0_NIDEN_SHIFT)) & SYSCON_ELS_AS_ST0_ST_CPU0_NIDEN_MASK) - -#define SYSCON_ELS_AS_ST0_ST_CPU0_SPIDEN_MASK (0x40U) -#define SYSCON_ELS_AS_ST0_ST_CPU0_SPIDEN_SHIFT (6U) -/*! ST_CPU0_SPIDEN - When CPU0 (CM33) "spiden" input is state 1, this bit indicates state 1 */ -#define SYSCON_ELS_AS_ST0_ST_CPU0_SPIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_CPU0_SPIDEN_SHIFT)) & SYSCON_ELS_AS_ST0_ST_CPU0_SPIDEN_MASK) - -#define SYSCON_ELS_AS_ST0_ST_CPU0_SPNIDEN_MASK (0x80U) -#define SYSCON_ELS_AS_ST0_ST_CPU0_SPNIDEN_SHIFT (7U) -/*! ST_CPU0_SPNIDEN - When CPU0 (CM33) "spniden" input is state 1, this bit indicates state 1 */ -#define SYSCON_ELS_AS_ST0_ST_CPU0_SPNIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_CPU0_SPNIDEN_SHIFT)) & SYSCON_ELS_AS_ST0_ST_CPU0_SPNIDEN_MASK) - -#define SYSCON_ELS_AS_ST0_ST_CPU1_DBGEN_MASK (0x100U) -#define SYSCON_ELS_AS_ST0_ST_CPU1_DBGEN_SHIFT (8U) -/*! ST_CPU1_DBGEN - When CPU1 (CM33) "deben" input is state 1, this bit indicates state 1. */ -#define SYSCON_ELS_AS_ST0_ST_CPU1_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_CPU1_DBGEN_SHIFT)) & SYSCON_ELS_AS_ST0_ST_CPU1_DBGEN_MASK) - -#define SYSCON_ELS_AS_ST0_ST_CPU1_NIDEN_MASK (0x200U) -#define SYSCON_ELS_AS_ST0_ST_CPU1_NIDEN_SHIFT (9U) -/*! ST_CPU1_NIDEN - When CPU1 (CM33) "niden" input is state 1, this bit indicates state 1. */ -#define SYSCON_ELS_AS_ST0_ST_CPU1_NIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_CPU1_NIDEN_SHIFT)) & SYSCON_ELS_AS_ST0_ST_CPU1_NIDEN_MASK) - -#define SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_CPU0_MASK (0x400U) -#define SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_CPU0_SHIFT (10U) -/*! ST_DAP_ENABLE_CPU0 - When DAP to AP0 for CPU0 (CM33) debug access is allowed, this bit indicates state 1 */ -#define SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_CPU0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_CPU0_SHIFT)) & SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_CPU0_MASK) - -#define SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_CPU1_MASK (0x800U) -#define SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_CPU1_SHIFT (11U) -/*! ST_DAP_ENABLE_CPU1 - When DAP to AP1 for CPU1 (CM33) debug access is allowed, this bit indicates state 1. */ -#define SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_CPU1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_CPU1_SHIFT)) & SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_CPU1_MASK) - -#define SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_DSP_MASK (0x1000U) -#define SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_DSP_SHIFT (12U) -/*! ST_DAP_ENABLE_DSP - When DAP to AP3 for DSP (CoolFlux) debug access is allowed, this bit indicates state 1 */ -#define SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_DSP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_DSP_SHIFT)) & SYSCON_ELS_AS_ST0_ST_DAP_ENABLE_DSP_MASK) - -#define SYSCON_ELS_AS_ST0_ST_ALLOW_TEST_ACCESS_MASK (0x4000U) -#define SYSCON_ELS_AS_ST0_ST_ALLOW_TEST_ACCESS_SHIFT (14U) -/*! ST_ALLOW_TEST_ACCESS - When JTAG TAP access is allowed, this bit indicates state 1. */ -#define SYSCON_ELS_AS_ST0_ST_ALLOW_TEST_ACCESS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_ALLOW_TEST_ACCESS_SHIFT)) & SYSCON_ELS_AS_ST0_ST_ALLOW_TEST_ACCESS_MASK) - -#define SYSCON_ELS_AS_ST0_ST_XO32K_FAILED_MASK (0x8000U) -#define SYSCON_ELS_AS_ST0_ST_XO32K_FAILED_SHIFT (15U) -/*! ST_XO32K_FAILED - When XO32K oscillation fail flag is state 1, this bit indicates state 1 */ -#define SYSCON_ELS_AS_ST0_ST_XO32K_FAILED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_XO32K_FAILED_SHIFT)) & SYSCON_ELS_AS_ST0_ST_XO32K_FAILED_MASK) - -#define SYSCON_ELS_AS_ST0_ST_XO40M_FAILED_MASK (0x10000U) -#define SYSCON_ELS_AS_ST0_ST_XO40M_FAILED_SHIFT (16U) -/*! ST_XO40M_FAILED - When XO40M oscillation fail flag is state 1, this bit indicates state 1 */ -#define SYSCON_ELS_AS_ST0_ST_XO40M_FAILED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_XO40M_FAILED_SHIFT)) & SYSCON_ELS_AS_ST0_ST_XO40M_FAILED_MASK) - -#define SYSCON_ELS_AS_ST0_ST_IFR_LOAD_FAILED_MASK (0x20000U) -#define SYSCON_ELS_AS_ST0_ST_IFR_LOAD_FAILED_SHIFT (17U) -/*! ST_IFR_LOAD_FAILED - When IFR load fail flag is state 1, this bit indicates state 1 */ -#define SYSCON_ELS_AS_ST0_ST_IFR_LOAD_FAILED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_IFR_LOAD_FAILED_SHIFT)) & SYSCON_ELS_AS_ST0_ST_IFR_LOAD_FAILED_MASK) - -#define SYSCON_ELS_AS_ST0_ST_GLITCH_DETECT_FLAG_MASK (0x3C0000U) -#define SYSCON_ELS_AS_ST0_ST_GLITCH_DETECT_FLAG_SHIFT (18U) -/*! ST_GLITCH_DETECT_FLAG - GLITCH_DETECT_FLAG is state of 4-bit Glitch Ripple Counter output. */ -#define SYSCON_ELS_AS_ST0_ST_GLITCH_DETECT_FLAG(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST0_ST_GLITCH_DETECT_FLAG_SHIFT)) & SYSCON_ELS_AS_ST0_ST_GLITCH_DETECT_FLAG_MASK) -/*! @} */ - -/*! @name ELS_AS_ST1 - ELS AS State1 */ -/*! @{ */ - -#define SYSCON_ELS_AS_ST1_ST_QK_PUF_SCORE_MASK (0xFU) -#define SYSCON_ELS_AS_ST1_ST_QK_PUF_SCORE_SHIFT (0U) -/*! ST_QK_PUF_SCORE - These register bits indicate the state of "qk_puf_score[3:0]" outputs from QK PUF block */ -#define SYSCON_ELS_AS_ST1_ST_QK_PUF_SCORE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST1_ST_QK_PUF_SCORE_SHIFT)) & SYSCON_ELS_AS_ST1_ST_QK_PUF_SCORE_MASK) - -#define SYSCON_ELS_AS_ST1_ST_QK_ZEROIZED_MASK (0x10U) -#define SYSCON_ELS_AS_ST1_ST_QK_ZEROIZED_SHIFT (4U) -/*! ST_QK_ZEROIZED - This register bit indicates the state of "qk_zeroized" output from QK PUF block */ -#define SYSCON_ELS_AS_ST1_ST_QK_ZEROIZED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST1_ST_QK_ZEROIZED_SHIFT)) & SYSCON_ELS_AS_ST1_ST_QK_ZEROIZED_MASK) - -#define SYSCON_ELS_AS_ST1_ST_MAIN_CLK_IS_EXT_MASK (0x20U) -#define SYSCON_ELS_AS_ST1_ST_MAIN_CLK_IS_EXT_SHIFT (5U) -/*! ST_MAIN_CLK_IS_EXT - When MAIN_CLK is running from external clock source either XO32M, XO32K or GPIO CLKIN, this bit indicates state 1 */ -#define SYSCON_ELS_AS_ST1_ST_MAIN_CLK_IS_EXT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST1_ST_MAIN_CLK_IS_EXT_SHIFT)) & SYSCON_ELS_AS_ST1_ST_MAIN_CLK_IS_EXT_MASK) - -#define SYSCON_ELS_AS_ST1_ST_DCDC_VOUT_MASK (0xC0U) -#define SYSCON_ELS_AS_ST1_ST_DCDC_VOUT_SHIFT (6U) -/*! ST_DCDC_VOUT - VOUT[1:0] setting on DCDC0 register in SPC block will reflect to this register. Default is 1.0V */ -#define SYSCON_ELS_AS_ST1_ST_DCDC_VOUT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST1_ST_DCDC_VOUT_SHIFT)) & SYSCON_ELS_AS_ST1_ST_DCDC_VOUT_MASK) - -#define SYSCON_ELS_AS_ST1_ST_DCDC_DS_MASK (0x300U) -#define SYSCON_ELS_AS_ST1_ST_DCDC_DS_SHIFT (8U) -/*! ST_DCDC_DS - DCDC drive strength setting. Default is normal drive. */ -#define SYSCON_ELS_AS_ST1_ST_DCDC_DS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST1_ST_DCDC_DS_SHIFT)) & SYSCON_ELS_AS_ST1_ST_DCDC_DS_MASK) - -#define SYSCON_ELS_AS_ST1_ST_BOOT_MODE_MASK (0xC00U) -#define SYSCON_ELS_AS_ST1_ST_BOOT_MODE_SHIFT (10U) -/*! ST_BOOT_MODE - ISP pin status during boot. By default ISP pin is pulled up. If want to enter ISP - * mode during boot, ISP pin should be pull down when out of reset. - */ -#define SYSCON_ELS_AS_ST1_ST_BOOT_MODE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST1_ST_BOOT_MODE_SHIFT)) & SYSCON_ELS_AS_ST1_ST_BOOT_MODE_MASK) - -#define SYSCON_ELS_AS_ST1_ST_BOOT_RETRY_CNT_MASK (0xF000U) -#define SYSCON_ELS_AS_ST1_ST_BOOT_RETRY_CNT_SHIFT (12U) -/*! ST_BOOT_RETRY_CNT - BOOT_RETRY_CNT[3:0] in the ELS_BOOT_RETRY_CNT register reflects this register */ -#define SYSCON_ELS_AS_ST1_ST_BOOT_RETRY_CNT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST1_ST_BOOT_RETRY_CNT_SHIFT)) & SYSCON_ELS_AS_ST1_ST_BOOT_RETRY_CNT_MASK) - -#define SYSCON_ELS_AS_ST1_ST_LDO_CORE_VOUT_MASK (0x30000U) -#define SYSCON_ELS_AS_ST1_ST_LDO_CORE_VOUT_SHIFT (16U) -/*! ST_LDO_CORE_VOUT - VOUT[1:0] setting on LDO Core register in SPC block will reflect to this register. Default is 1.0V */ -#define SYSCON_ELS_AS_ST1_ST_LDO_CORE_VOUT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST1_ST_LDO_CORE_VOUT_SHIFT)) & SYSCON_ELS_AS_ST1_ST_LDO_CORE_VOUT_MASK) - -#define SYSCON_ELS_AS_ST1_ST_LDO_CORE_DS_MASK (0xC0000U) -#define SYSCON_ELS_AS_ST1_ST_LDO_CORE_DS_SHIFT (18U) -/*! ST_LDO_CORE_DS - LDO_CORE drive strength setting. Default is normal drive. */ -#define SYSCON_ELS_AS_ST1_ST_LDO_CORE_DS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_ST1_ST_LDO_CORE_DS_SHIFT)) & SYSCON_ELS_AS_ST1_ST_LDO_CORE_DS_MASK) -/*! @} */ - -/*! @name ELS_AS_BOOT_LOG0 - Boot state captured during boot: Main ROM log */ -/*! @{ */ - -#define SYSCON_ELS_AS_BOOT_LOG0_BOOT_IMAGE_MASK (0xFU) -#define SYSCON_ELS_AS_BOOT_LOG0_BOOT_IMAGE_SHIFT (0U) -/*! BOOT_IMAGE - Boot image source used during this boot. - * 0b0000..Internal flash image 0 - * 0b0001..Internal flash image 1 - * 0b0010..FlexSPI flash image 0 - * 0b0011..FlexSPI flash image 1 - * 0b0100..Recovery SPI flash image - * 0b0101..Serial boot image (write-memory and execute ISP command used) - * 0b0110..Receive SB3 containing SB_JUMP command is used. - * 0b0111..Customer SBL/recovery image (Bank1 IFR0). - * 0b1000..NXP MAD recovery image (Bank1 IFR0). - * 0b1001..NXP ROM extension (NMPA - Bank0 IFR0). - * 0b1010..Reserved. - * 0b1011..Reserved. - * 0b1100..Reserved. - * 0b1101..Reserved. - * 0b1110..Reserved. - * 0b1111..Reserved. - */ -#define SYSCON_ELS_AS_BOOT_LOG0_BOOT_IMAGE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_BOOT_IMAGE_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_BOOT_IMAGE_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_CMAC_MASK (0x10U) -#define SYSCON_ELS_AS_BOOT_LOG0_CMAC_SHIFT (4U) -/*! CMAC - CMAC verify is used instead of ECDSA verify on this boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_CMAC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_CMAC_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_CMAC_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_ECDSA_MASK (0x40U) -#define SYSCON_ELS_AS_BOOT_LOG0_ECDSA_SHIFT (6U) -/*! ECDSA - ECDSA P-384 verification is done on this boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_ECDSA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_ECDSA_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_ECDSA_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_OFF_CHIP_MASK (0x80U) -#define SYSCON_ELS_AS_BOOT_LOG0_OFF_CHIP_SHIFT (7U) -/*! OFF_CHIP - Off-chip Prince is enabled during boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_OFF_CHIP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_OFF_CHIP_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_OFF_CHIP_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_ON_CHIP_MASK (0x100U) -#define SYSCON_ELS_AS_BOOT_LOG0_ON_CHIP_SHIFT (8U) -/*! ON_CHIP - On-chip Prince is enabled during boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_ON_CHIP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_ON_CHIP_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_ON_CHIP_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_CDI_CSR_MASK (0x200U) -#define SYSCON_ELS_AS_BOOT_LOG0_CDI_CSR_SHIFT (9U) -/*! CDI_CSR - CDI based device keys are derived for CSR harvesting on this boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_CDI_CSR(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_CDI_CSR_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_CDI_CSR_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_CDI_DICE_MASK (0x400U) -#define SYSCON_ELS_AS_BOOT_LOG0_CDI_DICE_SHIFT (10U) -/*! CDI_DICE - CDI per DICE specification is computed on this boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_CDI_DICE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_CDI_DICE_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_CDI_DICE_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_TRUSTZONE_MASK (0x800U) -#define SYSCON_ELS_AS_BOOT_LOG0_TRUSTZONE_SHIFT (11U) -/*! TRUSTZONE - TrustZone preset data is loaded during this boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_TRUSTZONE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_TRUSTZONE_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_TRUSTZONE_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_DEBUG_AUTH_MASK (0x1000U) -#define SYSCON_ELS_AS_BOOT_LOG0_DEBUG_AUTH_SHIFT (12U) -/*! DEBUG_AUTH - Debug authentication done in this session prior to boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_DEBUG_AUTH(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_DEBUG_AUTH_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_DEBUG_AUTH_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_ITRC_MASK (0x2000U) -#define SYSCON_ELS_AS_BOOT_LOG0_ITRC_SHIFT (13U) -/*! ITRC - ITRC zeroize event is handled in this session of boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_ITRC(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_ITRC_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_ITRC_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_DIG_GDET_MASK (0x4000U) -#define SYSCON_ELS_AS_BOOT_LOG0_DIG_GDET_SHIFT (14U) -/*! DIG_GDET - Digital glitch detector is enabled during boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_DIG_GDET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_DIG_GDET_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_DIG_GDET_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_ANA_GDET_MASK (0x8000U) -#define SYSCON_ELS_AS_BOOT_LOG0_ANA_GDET_SHIFT (15U) -/*! ANA_GDET - Analog glitch detector is enabled during boot. */ -#define SYSCON_ELS_AS_BOOT_LOG0_ANA_GDET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_ANA_GDET_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_ANA_GDET_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_DEEP_PD_MASK (0x10000U) -#define SYSCON_ELS_AS_BOOT_LOG0_DEEP_PD_SHIFT (16U) -/*! DEEP_PD - Boot from deep-power down state. */ -#define SYSCON_ELS_AS_BOOT_LOG0_DEEP_PD(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_DEEP_PD_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_DEEP_PD_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_LOW_POWER_MASK (0xF000000U) -#define SYSCON_ELS_AS_BOOT_LOG0_LOW_POWER_SHIFT (24U) -/*! LOW_POWER - Last low-power mode value. ROM copies SPC_LP_MODE field from SPC->SC[7:4]. */ -#define SYSCON_ELS_AS_BOOT_LOG0_LOW_POWER(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_LOW_POWER_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_LOW_POWER_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG0_ISP_MASK (0x80000000U) -#define SYSCON_ELS_AS_BOOT_LOG0_ISP_SHIFT (31U) -/*! ISP - ISP pin state at boot time. ROM copies CMC->MR0[0]. */ -#define SYSCON_ELS_AS_BOOT_LOG0_ISP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG0_ISP_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG0_ISP_MASK) -/*! @} */ - -/*! @name ELS_AS_BOOT_LOG1 - Boot state captured during boot: Library log */ -/*! @{ */ - -#define SYSCON_ELS_AS_BOOT_LOG1_RoTK_MASK (0x3U) -#define SYSCON_ELS_AS_BOOT_LOG1_RoTK_SHIFT (0U) -/*! RoTK - RoTK index used for this boot. */ -#define SYSCON_ELS_AS_BOOT_LOG1_RoTK(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG1_RoTK_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG1_RoTK_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG1_FIPS_MASK (0x3FCU) -#define SYSCON_ELS_AS_BOOT_LOG1_FIPS_SHIFT (2U) -/*! FIPS - FIPS self-test is executed and PASS during this boot. When a bit is set, means self-test - * is executed and it FAILS. When a bit is clear, means corresponding self-test is executed and - * PASS or it is not executed. - */ -#define SYSCON_ELS_AS_BOOT_LOG1_FIPS(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG1_FIPS_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG1_FIPS_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG1_SB3_MASK (0xC00U) -#define SYSCON_ELS_AS_BOOT_LOG1_SB3_SHIFT (10U) -/*! SB3 - SB3 type (valid after nboot_sb3_load_manifest()). - * 0b00..customer fw load/update file. - * 0b01..NXP Provisioning FW. - * 0b10..ELS signed OEM Provisioning FW. - */ -#define SYSCON_ELS_AS_BOOT_LOG1_SB3(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG1_SB3_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG1_SB3_MASK) -/*! @} */ - -/*! @name ELS_AS_BOOT_LOG2 - Boot state captured during boot: Hardware status signals log */ -/*! @{ */ - -#define SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS0_MASK (0x3FU) -#define SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS0_SHIFT (0U) -/*! CMC_SRS0 - CMC->SRS[5:0] */ -#define SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS0_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS0_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG2_VBAT_STATUS0_MASK (0xC0U) -#define SYSCON_ELS_AS_BOOT_LOG2_VBAT_STATUS0_SHIFT (6U) -/*! VBAT_STATUS0 - VBAT->STATUSA[1:0] | ~VBAT->STATUSB[1:0] */ -#define SYSCON_ELS_AS_BOOT_LOG2_VBAT_STATUS0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG2_VBAT_STATUS0_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG2_VBAT_STATUS0_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS1_MASK (0x1FF00U) -#define SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS1_SHIFT (8U) -/*! CMC_SRS1 - CMC->SRS[16:8] */ -#define SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS1_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS1_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG2_VBAT_STATUS1_MASK (0xFC0000U) -#define SYSCON_ELS_AS_BOOT_LOG2_VBAT_STATUS1_SHIFT (18U) -/*! VBAT_STATUS1 - VBAT->STATUSA[11:6] | ~VBAT->STATUSB[11:6] */ -#define SYSCON_ELS_AS_BOOT_LOG2_VBAT_STATUS1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG2_VBAT_STATUS1_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG2_VBAT_STATUS1_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS2_MASK (0xFF000000U) -#define SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS2_SHIFT (24U) -/*! CMC_SRS2 - CMC->SRS[31:24] */ -#define SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS2(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS2_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG2_CMC_SRS2_MASK) -/*! @} */ - -/*! @name ELS_AS_BOOT_LOG3 - Boot state captured during boot: Security log */ -/*! @{ */ - -#define SYSCON_ELS_AS_BOOT_LOG3_ERR_AUTH_FAIL_COUNT_MASK (0xFFU) -#define SYSCON_ELS_AS_BOOT_LOG3_ERR_AUTH_FAIL_COUNT_SHIFT (0U) -/*! ERR_AUTH_FAIL_COUNT - CFPA->ERR_AUTH_FAIL_COUNT[7:0] */ -#define SYSCON_ELS_AS_BOOT_LOG3_ERR_AUTH_FAIL_COUNT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG3_ERR_AUTH_FAIL_COUNT_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG3_ERR_AUTH_FAIL_COUNT_MASK) - -#define SYSCON_ELS_AS_BOOT_LOG3_ERR_ITRC_COUNT_MASK (0xFF00U) -#define SYSCON_ELS_AS_BOOT_LOG3_ERR_ITRC_COUNT_SHIFT (8U) -/*! ERR_ITRC_COUNT - CFPA->ERR_ITRC_COUNT[7:0] */ -#define SYSCON_ELS_AS_BOOT_LOG3_ERR_ITRC_COUNT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_BOOT_LOG3_ERR_ITRC_COUNT_SHIFT)) & SYSCON_ELS_AS_BOOT_LOG3_ERR_ITRC_COUNT_MASK) -/*! @} */ - -/*! @name ELS_AS_FLAG0 - ELS AS Flag0 */ -/*! @{ */ - -#define SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_CPU0_MASK (0x1U) -#define SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_CPU0_SHIFT (0U) -/*! FLAG_AP_ENABLE_CPU0 - This flag bit is set as 1 when DAP enables AP0 for CPU0 (CM33) debug - * access. The register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_CPU0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_CPU0_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_CPU0_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_CPU1_MASK (0x2U) -#define SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_CPU1_SHIFT (1U) -/*! FLAG_AP_ENABLE_CPU1 - This flag bit is set as 1 when DAP enables AP1 for CPU1 (CM33) debug - * access. The register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_CPU1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_CPU1_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_CPU1_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_DSP_MASK (0x4U) -#define SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_DSP_SHIFT (2U) -/*! FLAG_AP_ENABLE_DSP - This flag bit is set as 1 when DAP enables AP3 for DSP (CoolFlux) debug - * access. The register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_DSP(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_DSP_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_AP_ENABLE_DSP_MASK) - -#define SYSCON_ELS_AS_FLAG0_EFUSE_ATTACK_DETECT_MASK (0x8U) -#define SYSCON_ELS_AS_FLAG0_EFUSE_ATTACK_DETECT_SHIFT (3U) -/*! EFUSE_ATTACK_DETECT - OTPC can output attack_detect signal when it detects attack when load - * shadow registers. The output will be cleared by reset. ELS_AS_FLAG is reset by PoR, so the status - * can be recorded. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_EFUSE_ATTACK_DETECT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_EFUSE_ATTACK_DETECT_SHIFT)) & SYSCON_ELS_AS_FLAG0_EFUSE_ATTACK_DETECT_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_LVD_CORE_OCCURED_MASK (0x20U) -#define SYSCON_ELS_AS_FLAG0_FLAG_LVD_CORE_OCCURED_SHIFT (5U) -/*! FLAG_LVD_CORE_OCCURED - This flag register is set 1 when VDD_CORE LVD event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_LVD_CORE_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_LVD_CORE_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_LVD_CORE_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT0_RESET_OCCURED_MASK (0x100U) -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT0_RESET_OCCURED_SHIFT (8U) -/*! FLAG_WDT0_RESET_OCCURED - This flag bit is set as 1 when WatchDog Timer 0 reset is enabled and - * reset event is triggered. This register is cleared 0 by AO domain POR. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT0_RESET_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_WDT0_RESET_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_WDT0_RESET_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT0_RESET_OCCURED_MASK (0x200U) -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT0_RESET_OCCURED_SHIFT (9U) -/*! FLAG_CWDT0_RESET_OCCURED - This flag bit is set as 1 when Code WatchDog Timer 0 reset is enabled - * and reset event is triggered. This register is cleared 0 by AO domain POR. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT0_RESET_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_CWDT0_RESET_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_CWDT0_RESET_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT0_IRQ_OCCURED_MASK (0x400U) -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT0_IRQ_OCCURED_SHIFT (10U) -/*! FLAG_WDT0_IRQ_OCCURED - This flag bit is set as 1 when WatchDog Timer 0 IRQ is enabled and IRQ - * event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT0_IRQ_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_WDT0_IRQ_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_WDT0_IRQ_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT0_IRQ_OCCURED_MASK (0x800U) -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT0_IRQ_OCCURED_SHIFT (11U) -/*! FLAG_CWDT0_IRQ_OCCURED - This flag bit is set as 1 when Code WatchDog Timer 0 IRQ is enabled and - * IRQ event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT0_IRQ_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_CWDT0_IRQ_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_CWDT0_IRQ_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_QK_ERROR_MASK (0x1000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_QK_ERROR_SHIFT (12U) -/*! FLAG_QK_ERROR - This flag bit is set as 1 when QK_ERROR is flagged from QK PUF block. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_QK_ERROR(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_QK_ERROR_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_QK_ERROR_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_ELS_GLITCH_DETECTED_MASK (0x2000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_ELS_GLITCH_DETECTED_SHIFT (13U) -/*! FLAG_ELS_GLITCH_DETECTED - This flag bit is set as 1 when GDET error is flagged. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_ELS_GLITCH_DETECTED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_ELS_GLITCH_DETECTED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_ELS_GLITCH_DETECTED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_ANA_GLITCH_DETECTED_MASK (0x4000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_ANA_GLITCH_DETECTED_SHIFT (14U) -/*! FLAG_ANA_GLITCH_DETECTED - This flag bit is set as 1 when ANALOG GDET error is flagged in SYSCON - * block. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_ANA_GLITCH_DETECTED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_ANA_GLITCH_DETECTED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_ANA_GLITCH_DETECTED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_TAMPER_EVENT_DETECTED_MASK (0x8000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_TAMPER_EVENT_DETECTED_SHIFT (15U) -/*! FLAG_TAMPER_EVENT_DETECTED - This flag bit is set as 1 when tamper event is flagged from TDET. - * This register is cleared 0 by AO domain POR or by PMC reset event, if tamper detection event is - * cleared by software. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_TAMPER_EVENT_DETECTED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_TAMPER_EVENT_DETECTED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_TAMPER_EVENT_DETECTED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_FLASH_ECC_INVALID_MASK (0x10000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_FLASH_ECC_INVALID_SHIFT (16U) -/*! FLAG_FLASH_ECC_INVALID - This flag bit is set as 1 when FLASH controller indicates ECC error. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_FLASH_ECC_INVALID(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_FLASH_ECC_INVALID_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_FLASH_ECC_INVALID_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_SEC_VIOL_IRQ_OCURRED_MASK (0x20000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_SEC_VIOL_IRQ_OCURRED_SHIFT (17U) -/*! FLAG_SEC_VIOL_IRQ_OCURRED - This flag bit is set as 1 when security violation is indicated from FLASH sub-system or AHB bus matrix. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_SEC_VIOL_IRQ_OCURRED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_SEC_VIOL_IRQ_OCURRED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_SEC_VIOL_IRQ_OCURRED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_CPU0_NS_C_ACC_OCCURED_MASK (0x40000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_CPU0_NS_C_ACC_OCCURED_SHIFT (18U) -/*! FLAG_CPU0_NS_C_ACC_OCCURED - This flag bit is set as 1 when CPU0 (CM33) makes non-secure code - * transactions. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_CPU0_NS_C_ACC_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_CPU0_NS_C_ACC_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_CPU0_NS_C_ACC_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_CPU0_NS_D_ACC_OCCURED_MASK (0x80000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_CPU0_NS_D_ACC_OCCURED_SHIFT (19U) -/*! FLAG_CPU0_NS_D_ACC_OCCURED - This flag bit is set as 1 when CPU0 (CM33) makes non-secure data - * transactions. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_CPU0_NS_D_ACC_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_CPU0_NS_D_ACC_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_CPU0_NS_D_ACC_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_LVD_VSYS_OCCURED_MASK (0x100000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_LVD_VSYS_OCCURED_SHIFT (20U) -/*! FLAG_LVD_VSYS_OCCURED - This flag register is set 1 when VDD_SYS LVD event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_LVD_VSYS_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_LVD_VSYS_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_LVD_VSYS_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_LVD_VDDIO_OCCURED_MASK (0x200000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_LVD_VDDIO_OCCURED_SHIFT (21U) -/*! FLAG_LVD_VDDIO_OCCURED - This flag register is set 1 when VDD LVD event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_LVD_VDDIO_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_LVD_VDDIO_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_LVD_VDDIO_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT1_RESET_OCCURED_MASK (0x400000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT1_RESET_OCCURED_SHIFT (22U) -/*! FLAG_WDT1_RESET_OCCURED - This flag bit is set as 1 when WatchDog Timer 1 reset is enabled and - * reset event is triggered. This register is cleared 0 by AO domain POR. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT1_RESET_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_WDT1_RESET_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_WDT1_RESET_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT1_RESET_OCCURED_MASK (0x800000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT1_RESET_OCCURED_SHIFT (23U) -/*! FLAG_CWDT1_RESET_OCCURED - This flag bit is set as 1 when Code WatchDog Timer 1 reset is enabled - * and reset event is triggered. This register is cleared 0 by AO domain POR. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT1_RESET_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_CWDT1_RESET_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_CWDT1_RESET_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT1_IRQ_OCCURED_MASK (0x1000000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT1_IRQ_OCCURED_SHIFT (24U) -/*! FLAG_WDT1_IRQ_OCCURED - This flag bit is set as 1 when WatchDog Timer 1 IRQ is enabled and IRQ - * event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_WDT1_IRQ_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_WDT1_IRQ_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_WDT1_IRQ_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT1_IRQ_OCCURED_MASK (0x2000000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT1_IRQ_OCCURED_SHIFT (25U) -/*! FLAG_CWDT1_IRQ_OCCURED - This flag bit is set as 1 when Code WatchDog Timer 1 IRQ is enabled and - * IRQ event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_CWDT1_IRQ_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_CWDT1_IRQ_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_CWDT1_IRQ_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_TEMPTAMPER_DET_IRQ_OCCURED_MASK (0x4000000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_TEMPTAMPER_DET_IRQ_OCCURED_SHIFT (26U) -/*! FLAG_TEMPTAMPER_DET_IRQ_OCCURED - This flag bit is set as 1 when temperature temper IRQ is - * enabled and IRQ event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_TEMPTAMPER_DET_IRQ_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_TEMPTAMPER_DET_IRQ_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_TEMPTAMPER_DET_IRQ_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_VOLTAMPER_DET_IRQ_OCCURED_MASK (0x8000000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_VOLTAMPER_DET_IRQ_OCCURED_SHIFT (27U) -/*! FLAG_VOLTAMPER_DET_IRQ_OCCURED - This flag bit is set as 1 when voltage temper IRQ is enabled - * and IRQ event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_VOLTAMPER_DET_IRQ_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_VOLTAMPER_DET_IRQ_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_VOLTAMPER_DET_IRQ_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_LHTTAMPER_DET_IRQ_OCCURED_MASK (0x10000000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_LHTTAMPER_DET_IRQ_OCCURED_SHIFT (28U) -/*! FLAG_LHTTAMPER_DET_IRQ_OCCURED - This flag bit is set as 1 when light temper IRQ is enabled and - * IRQ event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_LHTTAMPER_DET_IRQ_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_LHTTAMPER_DET_IRQ_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_LHTTAMPER_DET_IRQ_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG0_FLAG_CLKTAMPER_DET_IRQ_OCCURED_MASK (0x20000000U) -#define SYSCON_ELS_AS_FLAG0_FLAG_CLKTAMPER_DET_IRQ_OCCURED_SHIFT (29U) -/*! FLAG_CLKTAMPER_DET_IRQ_OCCURED - This flag bit is set as 1 when clock temper IRQ is enabled and - * IRQ event is triggered. This register is cleared 0 by PMC reset event. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG0_FLAG_CLKTAMPER_DET_IRQ_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG0_FLAG_CLKTAMPER_DET_IRQ_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG0_FLAG_CLKTAMPER_DET_IRQ_OCCURED_MASK) -/*! @} */ - -/*! @name ELS_AS_FLAG1 - ELS AS Flag1 */ -/*! @{ */ - -#define SYSCON_ELS_AS_FLAG1_FLAG_HVD_CORE_OCCURED_MASK (0x20000000U) -#define SYSCON_ELS_AS_FLAG1_FLAG_HVD_CORE_OCCURED_SHIFT (29U) -/*! FLAG_HVD_CORE_OCCURED - This flag bit is set as 1 when HVD from VDD_CORE power domain is triggered. - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG1_FLAG_HVD_CORE_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG1_FLAG_HVD_CORE_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG1_FLAG_HVD_CORE_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG1_FLAG_HVD_VSYS_OCCURED_MASK (0x40000000U) -#define SYSCON_ELS_AS_FLAG1_FLAG_HVD_VSYS_OCCURED_SHIFT (30U) -/*! FLAG_HVD_VSYS_OCCURED - This flag bit is set as 1 when HVD from VDD_SYS power domain is triggered - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG1_FLAG_HVD_VSYS_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG1_FLAG_HVD_VSYS_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG1_FLAG_HVD_VSYS_OCCURED_MASK) - -#define SYSCON_ELS_AS_FLAG1_FLAG_HVD_VDDIO_OCCURED_MASK (0x80000000U) -#define SYSCON_ELS_AS_FLAG1_FLAG_HVD_VDDIO_OCCURED_SHIFT (31U) -/*! FLAG_HVD_VDDIO_OCCURED - This flag bit is set as 1 when HVD from VDD power domain is triggered - * 0b1..Triggered - * 0b0..Not Triggered - */ -#define SYSCON_ELS_AS_FLAG1_FLAG_HVD_VDDIO_OCCURED(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ELS_AS_FLAG1_FLAG_HVD_VDDIO_OCCURED_SHIFT)) & SYSCON_ELS_AS_FLAG1_FLAG_HVD_VDDIO_OCCURED_MASK) -/*! @} */ - -/*! @name CLOCK_CTRL - Clock Control */ -/*! @{ */ - -#define SYSCON_CLOCK_CTRL_CLKIN_ENA_FM_USBH_LPT_MASK (0x2U) -#define SYSCON_CLOCK_CTRL_CLKIN_ENA_FM_USBH_LPT_SHIFT (1U) -/*! CLKIN_ENA_FM_USBH_LPT - Enables the clk_in clock for the Frequency Measurement, USB HS and LPTMR0/1 modules. - * 0b1..Clock is enabled - * 0b0..Clock is not enabled - */ -#define SYSCON_CLOCK_CTRL_CLKIN_ENA_FM_USBH_LPT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLOCK_CTRL_CLKIN_ENA_FM_USBH_LPT_SHIFT)) & SYSCON_CLOCK_CTRL_CLKIN_ENA_FM_USBH_LPT_MASK) - -#define SYSCON_CLOCK_CTRL_FRO1MHZ_ENA_MASK (0x4U) -#define SYSCON_CLOCK_CTRL_FRO1MHZ_ENA_SHIFT (2U) -/*! FRO1MHZ_ENA - Enables the FRO_1MHz clock for RTC module and for UTICK - * 0b1..Clock is enabled - * 0b0..Clock is not enabled - */ -#define SYSCON_CLOCK_CTRL_FRO1MHZ_ENA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLOCK_CTRL_FRO1MHZ_ENA_SHIFT)) & SYSCON_CLOCK_CTRL_FRO1MHZ_ENA_MASK) - -#define SYSCON_CLOCK_CTRL_FRO12MHZ_ENA_MASK (0x8U) -#define SYSCON_CLOCK_CTRL_FRO12MHZ_ENA_SHIFT (3U) -/*! FRO12MHZ_ENA - Enables the FRO_12MHz clock for the Flash, LPTMR0/1, and Frequency Measurement modules - * 0b1..Clock is enabled - * 0b0..Clock is not enabled - */ -#define SYSCON_CLOCK_CTRL_FRO12MHZ_ENA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLOCK_CTRL_FRO12MHZ_ENA_SHIFT)) & SYSCON_CLOCK_CTRL_FRO12MHZ_ENA_MASK) - -#define SYSCON_CLOCK_CTRL_FRO_HF_ENA_MASK (0x10U) -#define SYSCON_CLOCK_CTRL_FRO_HF_ENA_SHIFT (4U) -/*! FRO_HF_ENA - Enables FRO HF clock for the Frequency Measure module - * 0b1..Clock is enabled - * 0b0..Clock is not enabled - */ -#define SYSCON_CLOCK_CTRL_FRO_HF_ENA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLOCK_CTRL_FRO_HF_ENA_SHIFT)) & SYSCON_CLOCK_CTRL_FRO_HF_ENA_MASK) - -#define SYSCON_CLOCK_CTRL_CLKIN_ENA_MASK (0x20U) -#define SYSCON_CLOCK_CTRL_CLKIN_ENA_SHIFT (5U) -/*! CLKIN_ENA - Enables clk_in clock for MICFIL, CAN0/1, I3C0/1, SAI0/1, clkout. - * 0b1..Clock is enabled - * 0b0..Clock is not enabled - */ -#define SYSCON_CLOCK_CTRL_CLKIN_ENA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLOCK_CTRL_CLKIN_ENA_SHIFT)) & SYSCON_CLOCK_CTRL_CLKIN_ENA_MASK) - -#define SYSCON_CLOCK_CTRL_FRO1MHZ_CLK_ENA_MASK (0x40U) -#define SYSCON_CLOCK_CTRL_FRO1MHZ_CLK_ENA_SHIFT (6U) -/*! FRO1MHZ_CLK_ENA - Enables FRO_1MHz clock for clock muxing in clock gen - * 0b1..Clock is enabled - * 0b0..Clock is not enabled - */ -#define SYSCON_CLOCK_CTRL_FRO1MHZ_CLK_ENA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLOCK_CTRL_FRO1MHZ_CLK_ENA_SHIFT)) & SYSCON_CLOCK_CTRL_FRO1MHZ_CLK_ENA_MASK) - -#define SYSCON_CLOCK_CTRL_PLU_DEGLITCH_CLK_ENA_MASK (0x200U) -#define SYSCON_CLOCK_CTRL_PLU_DEGLITCH_CLK_ENA_SHIFT (9U) -/*! PLU_DEGLITCH_CLK_ENA - Enables clocks FRO_1MHz and FRO_12MHz for PLU deglitching. - * 0b1..Clock is enabled - * 0b0..Clock is not enabled - */ -#define SYSCON_CLOCK_CTRL_PLU_DEGLITCH_CLK_ENA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CLOCK_CTRL_PLU_DEGLITCH_CLK_ENA_SHIFT)) & SYSCON_CLOCK_CTRL_PLU_DEGLITCH_CLK_ENA_MASK) -/*! @} */ - -/*! @name I3C1FCLKSEL - I3C1 Functional Clock Selection */ -/*! @{ */ - -#define SYSCON_I3C1FCLKSEL_SEL_MASK (0x7U) -#define SYSCON_I3C1FCLKSEL_SEL_SHIFT (0U) -/*! SEL - I3C1 clock select - * 0b000..No clock - * 0b001..PLL0 clock - * 0b010..CLKIN clock - * 0b011..FRO_HF clock - * 0b100..No clock - * 0b101..PLL1_clk0 clock - * 0b110..USB PLL clock - * 0b111..No clock - */ -#define SYSCON_I3C1FCLKSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKSEL_SEL_SHIFT)) & SYSCON_I3C1FCLKSEL_SEL_MASK) -/*! @} */ - -/*! @name I3C1FCLKSTCSEL - Selects the I3C1 Time Control clock */ -/*! @{ */ - -#define SYSCON_I3C1FCLKSTCSEL_SEL_MASK (0x7U) -#define SYSCON_I3C1FCLKSTCSEL_SEL_SHIFT (0U) -/*! SEL - I3C1 FCLK_STC clock select - * 0b000..I3C1 functional clock I3C1FCLK - * 0b001..FRO_1M clock - * 0b010..No clock - * 0b011..No clock - * 0b100..No clock - * 0b101..No clock - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_I3C1FCLKSTCSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKSTCSEL_SEL_SHIFT)) & SYSCON_I3C1FCLKSTCSEL_SEL_MASK) -/*! @} */ - -/*! @name I3C1FCLKSTCDIV - I3C1 FCLK_STC Clock Divider */ -/*! @{ */ - -#define SYSCON_I3C1FCLKSTCDIV_DIV_MASK (0xFFU) -#define SYSCON_I3C1FCLKSTCDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_I3C1FCLKSTCDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKSTCDIV_DIV_SHIFT)) & SYSCON_I3C1FCLKSTCDIV_DIV_MASK) - -#define SYSCON_I3C1FCLKSTCDIV_RESET_MASK (0x20000000U) -#define SYSCON_I3C1FCLKSTCDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_I3C1FCLKSTCDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKSTCDIV_RESET_SHIFT)) & SYSCON_I3C1FCLKSTCDIV_RESET_MASK) - -#define SYSCON_I3C1FCLKSTCDIV_HALT_MASK (0x40000000U) -#define SYSCON_I3C1FCLKSTCDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_I3C1FCLKSTCDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKSTCDIV_HALT_SHIFT)) & SYSCON_I3C1FCLKSTCDIV_HALT_MASK) - -#define SYSCON_I3C1FCLKSTCDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_I3C1FCLKSTCDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_I3C1FCLKSTCDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKSTCDIV_UNSTAB_SHIFT)) & SYSCON_I3C1FCLKSTCDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name I3C1FCLKSDIV - I3C1 FCLK Slow clock Divider */ -/*! @{ */ - -#define SYSCON_I3C1FCLKSDIV_DIV_MASK (0xFFU) -#define SYSCON_I3C1FCLKSDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_I3C1FCLKSDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKSDIV_DIV_SHIFT)) & SYSCON_I3C1FCLKSDIV_DIV_MASK) - -#define SYSCON_I3C1FCLKSDIV_RESET_MASK (0x20000000U) -#define SYSCON_I3C1FCLKSDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_I3C1FCLKSDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKSDIV_RESET_SHIFT)) & SYSCON_I3C1FCLKSDIV_RESET_MASK) - -#define SYSCON_I3C1FCLKSDIV_HALT_MASK (0x40000000U) -#define SYSCON_I3C1FCLKSDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_I3C1FCLKSDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKSDIV_HALT_SHIFT)) & SYSCON_I3C1FCLKSDIV_HALT_MASK) - -#define SYSCON_I3C1FCLKSDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_I3C1FCLKSDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_I3C1FCLKSDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKSDIV_UNSTAB_SHIFT)) & SYSCON_I3C1FCLKSDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name I3C1FCLKDIV - I3C1 Functional Clock FCLK Divider */ -/*! @{ */ - -#define SYSCON_I3C1FCLKDIV_DIV_MASK (0xFFU) -#define SYSCON_I3C1FCLKDIV_DIV_SHIFT (0U) -/*! DIV - Clock divider value */ -#define SYSCON_I3C1FCLKDIV_DIV(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKDIV_DIV_SHIFT)) & SYSCON_I3C1FCLKDIV_DIV_MASK) - -#define SYSCON_I3C1FCLKDIV_RESET_MASK (0x20000000U) -#define SYSCON_I3C1FCLKDIV_RESET_SHIFT (29U) -/*! RESET - Resets the divider counter - * 0b1..Divider is reset - * 0b0..Divider is not reset - */ -#define SYSCON_I3C1FCLKDIV_RESET(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKDIV_RESET_SHIFT)) & SYSCON_I3C1FCLKDIV_RESET_MASK) - -#define SYSCON_I3C1FCLKDIV_HALT_MASK (0x40000000U) -#define SYSCON_I3C1FCLKDIV_HALT_SHIFT (30U) -/*! HALT - Halts the divider counter - * 0b1..Divider clock is stopped - * 0b0..Divider clock is running - */ -#define SYSCON_I3C1FCLKDIV_HALT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKDIV_HALT_SHIFT)) & SYSCON_I3C1FCLKDIV_HALT_MASK) - -#define SYSCON_I3C1FCLKDIV_UNSTAB_MASK (0x80000000U) -#define SYSCON_I3C1FCLKDIV_UNSTAB_SHIFT (31U) -/*! UNSTAB - Divider status flag - * 0b1..Clock frequency is not stable - * 0b0..Divider clock is stable - */ -#define SYSCON_I3C1FCLKDIV_UNSTAB(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKDIV_UNSTAB_SHIFT)) & SYSCON_I3C1FCLKDIV_UNSTAB_MASK) -/*! @} */ - -/*! @name I3C1FCLKSSEL - I3C1 FCLK Slow Selection */ -/*! @{ */ - -#define SYSCON_I3C1FCLKSSEL_SEL_MASK (0x7U) -#define SYSCON_I3C1FCLKSSEL_SEL_SHIFT (0U) -/*! SEL - I3C1 FCLK Slow Clock Select - * 0b000..FRO_1M clock - * 0b001..No clock - * 0b010..No clock - * 0b011..No clock - * 0b100..No clock - * 0b101..No clock - * 0b110..No clock - * 0b111..No clock - */ -#define SYSCON_I3C1FCLKSSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_I3C1FCLKSSEL_SEL_SHIFT)) & SYSCON_I3C1FCLKSSEL_SEL_MASK) -/*! @} */ - -/*! @name ETB_STATUS - ETB Counter Status Register */ -/*! @{ */ - -#define SYSCON_ETB_STATUS_IRQ_MASK (0x2U) -#define SYSCON_ETB_STATUS_IRQ_SHIFT (1U) -/*! IRQ - ETB Interrupt - * 0b1..ETB interrupt is asserted when ETB count expires. Write 1 to clear it. - * 0b0..ETB interrupt is not asserted - */ -#define SYSCON_ETB_STATUS_IRQ(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ETB_STATUS_IRQ_SHIFT)) & SYSCON_ETB_STATUS_IRQ_MASK) - -#define SYSCON_ETB_STATUS_NMI_MASK (0x4U) -#define SYSCON_ETB_STATUS_NMI_SHIFT (2U) -/*! NMI - ETB NMI - * 0b1..ETB NMI is asserted. Write 1 to clear it. - * 0b0..ETB NMI is not asserted - */ -#define SYSCON_ETB_STATUS_NMI(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ETB_STATUS_NMI_SHIFT)) & SYSCON_ETB_STATUS_NMI_MASK) - -#define SYSCON_ETB_STATUS_DBG_HALT_REQ_MASK (0x8U) -#define SYSCON_ETB_STATUS_DBG_HALT_REQ_SHIFT (3U) -/*! DBG_HALT_REQ - Debug halt request - * 0b1..The debug halt request signal is asserted when the ETB count expires - * 0b0..The debug halt request signal is not asserted - */ -#define SYSCON_ETB_STATUS_DBG_HALT_REQ(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ETB_STATUS_DBG_HALT_REQ_SHIFT)) & SYSCON_ETB_STATUS_DBG_HALT_REQ_MASK) -/*! @} */ - -/*! @name ETB_COUNTER_CTRL - ETB Counter Control Register */ -/*! @{ */ - -#define SYSCON_ETB_COUNTER_CTRL_CNTEN_MASK (0x1U) -#define SYSCON_ETB_COUNTER_CTRL_CNTEN_SHIFT (0U) -/*! CNTEN - Enables the ETB counter - * 0b1..ETB counter is enabled - * 0b0..ETB counter is disabled - */ -#define SYSCON_ETB_COUNTER_CTRL_CNTEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ETB_COUNTER_CTRL_CNTEN_SHIFT)) & SYSCON_ETB_COUNTER_CTRL_CNTEN_MASK) - -#define SYSCON_ETB_COUNTER_CTRL_RSPT_MASK (0x6U) -#define SYSCON_ETB_COUNTER_CTRL_RSPT_SHIFT (1U) -/*! RSPT - Response Type - * 0b11..Generates a debug halt when the ETB count expires via CPU0 CTICHIN[2] - * 0b10..Generates an NMI interrupt when the ETB count expires - * 0b01..Generates a normal interrupt when the ETB count expires - * 0b00..No response when the ETB count expires - */ -#define SYSCON_ETB_COUNTER_CTRL_RSPT(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ETB_COUNTER_CTRL_RSPT_SHIFT)) & SYSCON_ETB_COUNTER_CTRL_RSPT_MASK) - -#define SYSCON_ETB_COUNTER_CTRL_RLRQ_MASK (0x8U) -#define SYSCON_ETB_COUNTER_CTRL_RLRQ_SHIFT (3U) -/*! RLRQ - Reload request - * 0b1..Clears pending debug halt, NMI, or IRQ interrupt requests - * 0b0..No effect - */ -#define SYSCON_ETB_COUNTER_CTRL_RLRQ(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ETB_COUNTER_CTRL_RLRQ_SHIFT)) & SYSCON_ETB_COUNTER_CTRL_RLRQ_MASK) -/*! @} */ - -/*! @name ETB_COUNTER_RELOAD - ETB Counter Reload Register */ -/*! @{ */ - -#define SYSCON_ETB_COUNTER_RELOAD_RELOAD_MASK (0x7FFU) -#define SYSCON_ETB_COUNTER_RELOAD_RELOAD_SHIFT (0U) -/*! RELOAD - Byte count reload value */ -#define SYSCON_ETB_COUNTER_RELOAD_RELOAD(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ETB_COUNTER_RELOAD_RELOAD_SHIFT)) & SYSCON_ETB_COUNTER_RELOAD_RELOAD_MASK) -/*! @} */ - -/*! @name ETB_COUNTER_VALUE - ETB Counter Value Register */ -/*! @{ */ - -#define SYSCON_ETB_COUNTER_VALUE_COUNTER_VALUE_MASK (0x7FFU) -#define SYSCON_ETB_COUNTER_VALUE_COUNTER_VALUE_SHIFT (0U) -/*! COUNTER_VALUE - Byte count counter value */ -#define SYSCON_ETB_COUNTER_VALUE_COUNTER_VALUE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ETB_COUNTER_VALUE_COUNTER_VALUE_SHIFT)) & SYSCON_ETB_COUNTER_VALUE_COUNTER_VALUE_MASK) -/*! @} */ - -/*! @name GRAY_CODE_LSB - Gray to Binary Converter Gray code_gray[31:0] */ -/*! @{ */ - -#define SYSCON_GRAY_CODE_LSB_code_gray_31_0_MASK (0xFFFFFFFFU) -#define SYSCON_GRAY_CODE_LSB_code_gray_31_0_SHIFT (0U) -/*! code_gray_31_0 - Gray code [31:0] */ -#define SYSCON_GRAY_CODE_LSB_code_gray_31_0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GRAY_CODE_LSB_code_gray_31_0_SHIFT)) & SYSCON_GRAY_CODE_LSB_code_gray_31_0_MASK) -/*! @} */ - -/*! @name GRAY_CODE_MSB - Gray to Binary Converter Gray code_gray[41:32] */ -/*! @{ */ - -#define SYSCON_GRAY_CODE_MSB_code_gray_41_32_MASK (0x3FFU) -#define SYSCON_GRAY_CODE_MSB_code_gray_41_32_SHIFT (0U) -/*! code_gray_41_32 - Gray code [41:32] */ -#define SYSCON_GRAY_CODE_MSB_code_gray_41_32(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_GRAY_CODE_MSB_code_gray_41_32_SHIFT)) & SYSCON_GRAY_CODE_MSB_code_gray_41_32_MASK) -/*! @} */ - -/*! @name BINARY_CODE_LSB - Gray to Binary Converter Binary Code [31:0] */ -/*! @{ */ - -#define SYSCON_BINARY_CODE_LSB_code_bin_31_0_MASK (0xFFFFFFFFU) -#define SYSCON_BINARY_CODE_LSB_code_bin_31_0_SHIFT (0U) -/*! code_bin_31_0 - Binary code [31:0] */ -#define SYSCON_BINARY_CODE_LSB_code_bin_31_0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_BINARY_CODE_LSB_code_bin_31_0_SHIFT)) & SYSCON_BINARY_CODE_LSB_code_bin_31_0_MASK) -/*! @} */ - -/*! @name BINARY_CODE_MSB - Gray to Binary Converter Binary Code [41:32] */ -/*! @{ */ - -#define SYSCON_BINARY_CODE_MSB_code_bin_41_32_MASK (0x3FFU) -#define SYSCON_BINARY_CODE_MSB_code_bin_41_32_SHIFT (0U) -/*! code_bin_41_32 - Binary code [41:32] */ -#define SYSCON_BINARY_CODE_MSB_code_bin_41_32(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_BINARY_CODE_MSB_code_bin_41_32_SHIFT)) & SYSCON_BINARY_CODE_MSB_code_bin_41_32_MASK) -/*! @} */ - -/*! @name AUTOCLKGATEOVERRIDE - Control Automatic Clock Gating */ -/*! @{ */ - -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMB_CTRL_MASK (0x4U) -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMB_CTRL_SHIFT (2U) -/*! RAMB_CTRL - Controls automatic clock gating for the RAMB Controller - * 0b1..Automatic clock gating is overridden (Automatic clock gating is disabled). - * 0b0..Automatic clock gating is not overridden - */ -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMB_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AUTOCLKGATEOVERRIDE_RAMB_CTRL_SHIFT)) & SYSCON_AUTOCLKGATEOVERRIDE_RAMB_CTRL_MASK) - -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMC_CTRL_MASK (0x8U) -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMC_CTRL_SHIFT (3U) -/*! RAMC_CTRL - Controls automatic clock gating for the RAMC Controller - * 0b1..Automatic clock gating is overridden (Automatic clock gating is disabled). - * 0b0..Automatic clock gating is not overridden - */ -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMC_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AUTOCLKGATEOVERRIDE_RAMC_CTRL_SHIFT)) & SYSCON_AUTOCLKGATEOVERRIDE_RAMC_CTRL_MASK) - -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMD_CTRL_MASK (0x10U) -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMD_CTRL_SHIFT (4U) -/*! RAMD_CTRL - Controls automatic clock gating for the RAMD Controller - * 0b1..Automatic clock gating is overridden (Automatic clock gating is disabled). - * 0b0..Automatic clock gating is not overridden - */ -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMD_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AUTOCLKGATEOVERRIDE_RAMD_CTRL_SHIFT)) & SYSCON_AUTOCLKGATEOVERRIDE_RAMD_CTRL_MASK) - -#define SYSCON_AUTOCLKGATEOVERRIDE_RAME_CTRL_MASK (0x20U) -#define SYSCON_AUTOCLKGATEOVERRIDE_RAME_CTRL_SHIFT (5U) -/*! RAME_CTRL - Controls automatic clock gating for the RAMD Controller. - * 0b1..Automatic clock gating is overridden (Automatic clock gating is disabled). - * 0b0..Automatic clock gating is not overridden - */ -#define SYSCON_AUTOCLKGATEOVERRIDE_RAME_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AUTOCLKGATEOVERRIDE_RAME_CTRL_SHIFT)) & SYSCON_AUTOCLKGATEOVERRIDE_RAME_CTRL_MASK) - -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMF_CTRL_MASK (0x40U) -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMF_CTRL_SHIFT (6U) -/*! RAMF_CTRL - Controls automatic clock gating for the RAMF Controller - * 0b1..Automatic clock gating is overridden (Automatic clock gating is disabled). - * 0b0..Automatic clock gating is not overridden - */ -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMF_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AUTOCLKGATEOVERRIDE_RAMF_CTRL_SHIFT)) & SYSCON_AUTOCLKGATEOVERRIDE_RAMF_CTRL_MASK) - -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMG_CTRL_MASK (0x80U) -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMG_CTRL_SHIFT (7U) -/*! RAMG_CTRL - Controls automatic clock gating for the RAMG Controller - * 0b1..Automatic clock gating is overridden (Automatic clock gating is disabled). - * 0b0..Automatic clock gating is not overridden - */ -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMG_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AUTOCLKGATEOVERRIDE_RAMG_CTRL_SHIFT)) & SYSCON_AUTOCLKGATEOVERRIDE_RAMG_CTRL_MASK) - -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMH_CTRL_MASK (0x100U) -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMH_CTRL_SHIFT (8U) -/*! RAMH_CTRL - Controls automatic clock gating for the RAMG Controller - * 0b1..Automatic clock gating is overridden (Automatic clock gating is disabled). - * 0b0..Automatic clock gating is not overridden - */ -#define SYSCON_AUTOCLKGATEOVERRIDE_RAMH_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AUTOCLKGATEOVERRIDE_RAMH_CTRL_SHIFT)) & SYSCON_AUTOCLKGATEOVERRIDE_RAMH_CTRL_MASK) -/*! @} */ - -/*! @name AUTOCLKGATEOVERRIDEC - Control Automatic Clock Gating C */ -/*! @{ */ - -#define SYSCON_AUTOCLKGATEOVERRIDEC_RAMX_MASK (0x40000000U) -#define SYSCON_AUTOCLKGATEOVERRIDEC_RAMX_SHIFT (30U) -/*! RAMX - Controls automatic clock gating of the RAMX controller - * 0b1..Automatic clock gating is overridden (Automatic clock gating is disabled). - * 0b0..Automatic clock gating is not overridden - */ -#define SYSCON_AUTOCLKGATEOVERRIDEC_RAMX(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AUTOCLKGATEOVERRIDEC_RAMX_SHIFT)) & SYSCON_AUTOCLKGATEOVERRIDEC_RAMX_MASK) - -#define SYSCON_AUTOCLKGATEOVERRIDEC_RAMA_MASK (0x80000000U) -#define SYSCON_AUTOCLKGATEOVERRIDEC_RAMA_SHIFT (31U) -/*! RAMA - Controls automatic clock gating of the RAMA controller - * 0b1..Automatic clock gating is overridden (Automatic clock gating is disabled). - * 0b0..Automatic clock gating is not overridden - */ -#define SYSCON_AUTOCLKGATEOVERRIDEC_RAMA(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_AUTOCLKGATEOVERRIDEC_RAMA_SHIFT)) & SYSCON_AUTOCLKGATEOVERRIDEC_RAMA_MASK) -/*! @} */ - -/*! @name PWM0SUBCTL - PWM0 Submodule Control */ -/*! @{ */ - -#define SYSCON_PWM0SUBCTL_CLK0_EN_MASK (0x1U) -#define SYSCON_PWM0SUBCTL_CLK0_EN_SHIFT (0U) -/*! CLK0_EN - Enables PWM0 SUB Clock0 */ -#define SYSCON_PWM0SUBCTL_CLK0_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_CLK0_EN_SHIFT)) & SYSCON_PWM0SUBCTL_CLK0_EN_MASK) - -#define SYSCON_PWM0SUBCTL_CLK1_EN_MASK (0x2U) -#define SYSCON_PWM0SUBCTL_CLK1_EN_SHIFT (1U) -/*! CLK1_EN - Enables PWM0 SUB Clock1 */ -#define SYSCON_PWM0SUBCTL_CLK1_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_CLK1_EN_SHIFT)) & SYSCON_PWM0SUBCTL_CLK1_EN_MASK) - -#define SYSCON_PWM0SUBCTL_CLK2_EN_MASK (0x4U) -#define SYSCON_PWM0SUBCTL_CLK2_EN_SHIFT (2U) -/*! CLK2_EN - Enables PWM0 SUB Clock2 */ -#define SYSCON_PWM0SUBCTL_CLK2_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_CLK2_EN_SHIFT)) & SYSCON_PWM0SUBCTL_CLK2_EN_MASK) - -#define SYSCON_PWM0SUBCTL_CLK3_EN_MASK (0x8U) -#define SYSCON_PWM0SUBCTL_CLK3_EN_SHIFT (3U) -/*! CLK3_EN - Enables PWM0 SUB Clock3 */ -#define SYSCON_PWM0SUBCTL_CLK3_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_CLK3_EN_SHIFT)) & SYSCON_PWM0SUBCTL_CLK3_EN_MASK) - -#define SYSCON_PWM0SUBCTL_DMAVALM0_MASK (0x1000U) -#define SYSCON_PWM0SUBCTL_DMAVALM0_SHIFT (12U) -/*! DMAVALM0 - PWM0 submodule 0 DMA compare value done mask */ -#define SYSCON_PWM0SUBCTL_DMAVALM0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_DMAVALM0_SHIFT)) & SYSCON_PWM0SUBCTL_DMAVALM0_MASK) - -#define SYSCON_PWM0SUBCTL_DMAVALM1_MASK (0x2000U) -#define SYSCON_PWM0SUBCTL_DMAVALM1_SHIFT (13U) -/*! DMAVALM1 - PWM0 submodule 1 DMA compare value done mask */ -#define SYSCON_PWM0SUBCTL_DMAVALM1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_DMAVALM1_SHIFT)) & SYSCON_PWM0SUBCTL_DMAVALM1_MASK) - -#define SYSCON_PWM0SUBCTL_DMAVALM2_MASK (0x4000U) -#define SYSCON_PWM0SUBCTL_DMAVALM2_SHIFT (14U) -/*! DMAVALM2 - PWM0 submodule 2 DMA compare value done mask */ -#define SYSCON_PWM0SUBCTL_DMAVALM2(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_DMAVALM2_SHIFT)) & SYSCON_PWM0SUBCTL_DMAVALM2_MASK) - -#define SYSCON_PWM0SUBCTL_DMAVALM3_MASK (0x8000U) -#define SYSCON_PWM0SUBCTL_DMAVALM3_SHIFT (15U) -/*! DMAVALM3 - PWM0 submodule 3 DMA compare value done mask */ -#define SYSCON_PWM0SUBCTL_DMAVALM3(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM0SUBCTL_DMAVALM3_SHIFT)) & SYSCON_PWM0SUBCTL_DMAVALM3_MASK) -/*! @} */ - -/*! @name PWM1SUBCTL - PWM1 Submodule Control */ -/*! @{ */ - -#define SYSCON_PWM1SUBCTL_CLK0_EN_MASK (0x1U) -#define SYSCON_PWM1SUBCTL_CLK0_EN_SHIFT (0U) -/*! CLK0_EN - Enables PWM1 SUB Clock0 */ -#define SYSCON_PWM1SUBCTL_CLK0_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM1SUBCTL_CLK0_EN_SHIFT)) & SYSCON_PWM1SUBCTL_CLK0_EN_MASK) - -#define SYSCON_PWM1SUBCTL_CLK1_EN_MASK (0x2U) -#define SYSCON_PWM1SUBCTL_CLK1_EN_SHIFT (1U) -/*! CLK1_EN - Enables PWM1 SUB Clock1 */ -#define SYSCON_PWM1SUBCTL_CLK1_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM1SUBCTL_CLK1_EN_SHIFT)) & SYSCON_PWM1SUBCTL_CLK1_EN_MASK) - -#define SYSCON_PWM1SUBCTL_CLK2_EN_MASK (0x4U) -#define SYSCON_PWM1SUBCTL_CLK2_EN_SHIFT (2U) -/*! CLK2_EN - Enables PWM1 SUB Clock2 */ -#define SYSCON_PWM1SUBCTL_CLK2_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM1SUBCTL_CLK2_EN_SHIFT)) & SYSCON_PWM1SUBCTL_CLK2_EN_MASK) - -#define SYSCON_PWM1SUBCTL_CLK3_EN_MASK (0x8U) -#define SYSCON_PWM1SUBCTL_CLK3_EN_SHIFT (3U) -/*! CLK3_EN - Enables PWM1 SUB Clock3 */ -#define SYSCON_PWM1SUBCTL_CLK3_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM1SUBCTL_CLK3_EN_SHIFT)) & SYSCON_PWM1SUBCTL_CLK3_EN_MASK) - -#define SYSCON_PWM1SUBCTL_DMAVALM0_MASK (0x1000U) -#define SYSCON_PWM1SUBCTL_DMAVALM0_SHIFT (12U) -/*! DMAVALM0 - PWM1 submodule 0 DMA compare value done mask */ -#define SYSCON_PWM1SUBCTL_DMAVALM0(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM1SUBCTL_DMAVALM0_SHIFT)) & SYSCON_PWM1SUBCTL_DMAVALM0_MASK) - -#define SYSCON_PWM1SUBCTL_DMAVALM1_MASK (0x2000U) -#define SYSCON_PWM1SUBCTL_DMAVALM1_SHIFT (13U) -/*! DMAVALM1 - PWM1 submodule 1 DMA compare value done mask */ -#define SYSCON_PWM1SUBCTL_DMAVALM1(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM1SUBCTL_DMAVALM1_SHIFT)) & SYSCON_PWM1SUBCTL_DMAVALM1_MASK) - -#define SYSCON_PWM1SUBCTL_DMAVALM2_MASK (0x4000U) -#define SYSCON_PWM1SUBCTL_DMAVALM2_SHIFT (14U) -/*! DMAVALM2 - PWM1 submodule 2 DMA compare value done mask */ -#define SYSCON_PWM1SUBCTL_DMAVALM2(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM1SUBCTL_DMAVALM2_SHIFT)) & SYSCON_PWM1SUBCTL_DMAVALM2_MASK) - -#define SYSCON_PWM1SUBCTL_DMAVALM3_MASK (0x8000U) -#define SYSCON_PWM1SUBCTL_DMAVALM3_SHIFT (15U) -/*! DMAVALM3 - PWM1 submodule 3 DMA compare value done mask */ -#define SYSCON_PWM1SUBCTL_DMAVALM3(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_PWM1SUBCTL_DMAVALM3_SHIFT)) & SYSCON_PWM1SUBCTL_DMAVALM3_MASK) -/*! @} */ - -/*! @name CTIMERGLOBALSTARTEN - CTIMER Global Start Enable */ -/*! @{ */ - -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER0_CLK_EN_MASK (0x1U) -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER0_CLK_EN_SHIFT (0U) -/*! CTIMER0_CLK_EN - Enables the CTIMER0 function clock - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER0_CLK_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERGLOBALSTARTEN_CTIMER0_CLK_EN_SHIFT)) & SYSCON_CTIMERGLOBALSTARTEN_CTIMER0_CLK_EN_MASK) - -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER1_CLK_EN_MASK (0x2U) -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER1_CLK_EN_SHIFT (1U) -/*! CTIMER1_CLK_EN - Enables the CTIMER1 function clock - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER1_CLK_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERGLOBALSTARTEN_CTIMER1_CLK_EN_SHIFT)) & SYSCON_CTIMERGLOBALSTARTEN_CTIMER1_CLK_EN_MASK) - -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER2_CLK_EN_MASK (0x4U) -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER2_CLK_EN_SHIFT (2U) -/*! CTIMER2_CLK_EN - Enables the CTIMER2 function clock - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER2_CLK_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERGLOBALSTARTEN_CTIMER2_CLK_EN_SHIFT)) & SYSCON_CTIMERGLOBALSTARTEN_CTIMER2_CLK_EN_MASK) - -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER3_CLK_EN_MASK (0x8U) -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER3_CLK_EN_SHIFT (3U) -/*! CTIMER3_CLK_EN - Enables the CTIMER3 function clock - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER3_CLK_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERGLOBALSTARTEN_CTIMER3_CLK_EN_SHIFT)) & SYSCON_CTIMERGLOBALSTARTEN_CTIMER3_CLK_EN_MASK) - -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER4_CLK_EN_MASK (0x10U) -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER4_CLK_EN_SHIFT (4U) -/*! CTIMER4_CLK_EN - Enables the CTIMER4 function clock - * 0b1..Enable - * 0b0..Disable - */ -#define SYSCON_CTIMERGLOBALSTARTEN_CTIMER4_CLK_EN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_CTIMERGLOBALSTARTEN_CTIMER4_CLK_EN_SHIFT)) & SYSCON_CTIMERGLOBALSTARTEN_CTIMER4_CLK_EN_MASK) -/*! @} */ - -/*! @name ECC_ENABLE_CTRL - RAM ECC Enable Control */ -/*! @{ */ - -#define SYSCON_ECC_ENABLE_CTRL_RAMA_ECC_ENABLE_MASK (0x1U) -#define SYSCON_ECC_ENABLE_CTRL_RAMA_ECC_ENABLE_SHIFT (0U) -/*! RAMA_ECC_ENABLE - RAMA ECC enable - * 0b1..ECC is enabled - * 0b0..ECC is disabled - */ -#define SYSCON_ECC_ENABLE_CTRL_RAMA_ECC_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ECC_ENABLE_CTRL_RAMA_ECC_ENABLE_SHIFT)) & SYSCON_ECC_ENABLE_CTRL_RAMA_ECC_ENABLE_MASK) - -#define SYSCON_ECC_ENABLE_CTRL_RAMB_RAMX_ECC_ENABLE_MASK (0x2U) -#define SYSCON_ECC_ENABLE_CTRL_RAMB_RAMX_ECC_ENABLE_SHIFT (1U) -/*! RAMB_RAMX_ECC_ENABLE - RAMB and RAMX ECC enable - * 0b1..ECC is enabled - * 0b0..ECC is disabled - */ -#define SYSCON_ECC_ENABLE_CTRL_RAMB_RAMX_ECC_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ECC_ENABLE_CTRL_RAMB_RAMX_ECC_ENABLE_SHIFT)) & SYSCON_ECC_ENABLE_CTRL_RAMB_RAMX_ECC_ENABLE_MASK) - -#define SYSCON_ECC_ENABLE_CTRL_RAMD_RAMC_ECC_ENABLE_MASK (0x4U) -#define SYSCON_ECC_ENABLE_CTRL_RAMD_RAMC_ECC_ENABLE_SHIFT (2U) -/*! RAMD_RAMC_ECC_ENABLE - RAMD and RAMC ECC enable - * 0b1..ECC is enabled - * 0b0..ECC is disabled - */ -#define SYSCON_ECC_ENABLE_CTRL_RAMD_RAMC_ECC_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ECC_ENABLE_CTRL_RAMD_RAMC_ECC_ENABLE_SHIFT)) & SYSCON_ECC_ENABLE_CTRL_RAMD_RAMC_ECC_ENABLE_MASK) - -#define SYSCON_ECC_ENABLE_CTRL_RAMF_RAME_ECC_ENABLE_MASK (0x8U) -#define SYSCON_ECC_ENABLE_CTRL_RAMF_RAME_ECC_ENABLE_SHIFT (3U) -/*! RAMF_RAME_ECC_ENABLE - RAMF and RAME ECC enable - * 0b1..ECC is enabled - * 0b0..ECC is disabled - */ -#define SYSCON_ECC_ENABLE_CTRL_RAMF_RAME_ECC_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_ECC_ENABLE_CTRL_RAMF_RAME_ECC_ENABLE_SHIFT)) & SYSCON_ECC_ENABLE_CTRL_RAMF_RAME_ECC_ENABLE_MASK) -/*! @} */ - -/*! @name DEBUG_LOCK_EN - Control Write Access to Security */ -/*! @{ */ - -#define SYSCON_DEBUG_LOCK_EN_LOCK_ALL_MASK (0xFU) -#define SYSCON_DEBUG_LOCK_EN_LOCK_ALL_SHIFT (0U) -/*! LOCK_ALL - Controls write access to the security registers - * 0b1010..Enables write access to all registers - * 0b0000..Any other value than b1010: disables write access to all registers - */ -#define SYSCON_DEBUG_LOCK_EN_LOCK_ALL(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_LOCK_EN_LOCK_ALL_SHIFT)) & SYSCON_DEBUG_LOCK_EN_LOCK_ALL_MASK) -/*! @} */ - -/*! @name DEBUG_FEATURES - Cortex Debug Features Control */ -/*! @{ */ - -#define SYSCON_DEBUG_FEATURES_CPU0_DBGEN_MASK (0x3U) -#define SYSCON_DEBUG_FEATURES_CPU0_DBGEN_SHIFT (0U) -/*! CPU0_DBGEN - CPU0 invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_CPU0_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_CPU0_DBGEN_SHIFT)) & SYSCON_DEBUG_FEATURES_CPU0_DBGEN_MASK) - -#define SYSCON_DEBUG_FEATURES_CPU0_NIDEN_MASK (0xCU) -#define SYSCON_DEBUG_FEATURES_CPU0_NIDEN_SHIFT (2U) -/*! CPU0_NIDEN - CPU0 non-invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_CPU0_NIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_CPU0_NIDEN_SHIFT)) & SYSCON_DEBUG_FEATURES_CPU0_NIDEN_MASK) - -#define SYSCON_DEBUG_FEATURES_CPU0_SPIDEN_MASK (0x30U) -#define SYSCON_DEBUG_FEATURES_CPU0_SPIDEN_SHIFT (4U) -/*! CPU0_SPIDEN - CPU0 secure privileged invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_CPU0_SPIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_CPU0_SPIDEN_SHIFT)) & SYSCON_DEBUG_FEATURES_CPU0_SPIDEN_MASK) - -#define SYSCON_DEBUG_FEATURES_CPU0_SPNIDEN_MASK (0xC0U) -#define SYSCON_DEBUG_FEATURES_CPU0_SPNIDEN_SHIFT (6U) -/*! CPU0_SPNIDEN - CPU0 secure privileged non-invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_CPU0_SPNIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_CPU0_SPNIDEN_SHIFT)) & SYSCON_DEBUG_FEATURES_CPU0_SPNIDEN_MASK) - -#define SYSCON_DEBUG_FEATURES_CPU1_DBGEN_MASK (0x300U) -#define SYSCON_DEBUG_FEATURES_CPU1_DBGEN_SHIFT (8U) -/*! CPU1_DBGEN - CPU1 invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_CPU1_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_CPU1_DBGEN_SHIFT)) & SYSCON_DEBUG_FEATURES_CPU1_DBGEN_MASK) - -#define SYSCON_DEBUG_FEATURES_CPU1_NIDEN_MASK (0xC00U) -#define SYSCON_DEBUG_FEATURES_CPU1_NIDEN_SHIFT (10U) -/*! CPU1_NIDEN - CPU1 non-invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_CPU1_NIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_CPU1_NIDEN_SHIFT)) & SYSCON_DEBUG_FEATURES_CPU1_NIDEN_MASK) - -#define SYSCON_DEBUG_FEATURES_DSP_DBGDEN_MASK (0x3000U) -#define SYSCON_DEBUG_FEATURES_DSP_DBGDEN_SHIFT (12U) -/*! DSP_DBGDEN - DSP invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_DSP_DBGDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_DSP_DBGDEN_SHIFT)) & SYSCON_DEBUG_FEATURES_DSP_DBGDEN_MASK) -/*! @} */ - -/*! @name DEBUG_FEATURES_DP - Cortex Debug Features Control (Duplicate) */ -/*! @{ */ - -#define SYSCON_DEBUG_FEATURES_DP_CPU0_DBGEN_MASK (0x3U) -#define SYSCON_DEBUG_FEATURES_DP_CPU0_DBGEN_SHIFT (0U) -/*! CPU0_DBGEN - CPU0 invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_DP_CPU0_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_DP_CPU0_DBGEN_SHIFT)) & SYSCON_DEBUG_FEATURES_DP_CPU0_DBGEN_MASK) - -#define SYSCON_DEBUG_FEATURES_DP_CPU0_NIDEN_MASK (0xCU) -#define SYSCON_DEBUG_FEATURES_DP_CPU0_NIDEN_SHIFT (2U) -/*! CPU0_NIDEN - CPU0 non-invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_DP_CPU0_NIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_DP_CPU0_NIDEN_SHIFT)) & SYSCON_DEBUG_FEATURES_DP_CPU0_NIDEN_MASK) - -#define SYSCON_DEBUG_FEATURES_DP_CPU0_SPIDEN_MASK (0x30U) -#define SYSCON_DEBUG_FEATURES_DP_CPU0_SPIDEN_SHIFT (4U) -/*! CPU0_SPIDEN - CPU0 secure privileged invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_DP_CPU0_SPIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_DP_CPU0_SPIDEN_SHIFT)) & SYSCON_DEBUG_FEATURES_DP_CPU0_SPIDEN_MASK) - -#define SYSCON_DEBUG_FEATURES_DP_CPU0_SPNIDEN_MASK (0xC0U) -#define SYSCON_DEBUG_FEATURES_DP_CPU0_SPNIDEN_SHIFT (6U) -/*! CPU0_SPNIDEN - CPU0 secure privileged non-invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_DP_CPU0_SPNIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_DP_CPU0_SPNIDEN_SHIFT)) & SYSCON_DEBUG_FEATURES_DP_CPU0_SPNIDEN_MASK) - -#define SYSCON_DEBUG_FEATURES_DP_CPU1_DBGEN_MASK (0x300U) -#define SYSCON_DEBUG_FEATURES_DP_CPU1_DBGEN_SHIFT (8U) -/*! CPU1_DBGEN - CPU1 invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_DP_CPU1_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_DP_CPU1_DBGEN_SHIFT)) & SYSCON_DEBUG_FEATURES_DP_CPU1_DBGEN_MASK) - -#define SYSCON_DEBUG_FEATURES_DP_CPU1_NIDEN_MASK (0xC00U) -#define SYSCON_DEBUG_FEATURES_DP_CPU1_NIDEN_SHIFT (10U) -/*! CPU1_NIDEN - CPU1 non-invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_DP_CPU1_NIDEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_DP_CPU1_NIDEN_SHIFT)) & SYSCON_DEBUG_FEATURES_DP_CPU1_NIDEN_MASK) - -#define SYSCON_DEBUG_FEATURES_DP_DSP_DBGEN_MASK (0x3000U) -#define SYSCON_DEBUG_FEATURES_DP_DSP_DBGEN_SHIFT (12U) -/*! DSP_DBGEN - DSP invasive debug control - * 0b01..Disables debug - * 0b10..Enables debug - */ -#define SYSCON_DEBUG_FEATURES_DP_DSP_DBGEN(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_FEATURES_DP_DSP_DBGEN_SHIFT)) & SYSCON_DEBUG_FEATURES_DP_DSP_DBGEN_MASK) -/*! @} */ - -/*! @name SWD_ACCESS_CPU - CPU0 Software Debug Access..CPU1 Software Debug Access */ -/*! @{ */ - -#define SYSCON_SWD_ACCESS_CPU_SEC_CODE_MASK (0xFFFFFFFFU) -#define SYSCON_SWD_ACCESS_CPU_SEC_CODE_SHIFT (0U) -/*! SEC_CODE - Security code to allow CPU1 DAP: 0x12345678 - * 0b00010010001101000101011001111000..Value to write to enable CPU0 SWD access. Reading back register is read as 0xA. - * 0b00000000000000000000000000000000..CPU0 DAP is not allowed. Reading back register is read as 0x5. - */ -#define SYSCON_SWD_ACCESS_CPU_SEC_CODE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SWD_ACCESS_CPU_SEC_CODE_SHIFT)) & SYSCON_SWD_ACCESS_CPU_SEC_CODE_MASK) -/*! @} */ - -/* The count of SYSCON_SWD_ACCESS_CPU */ -#define SYSCON_SWD_ACCESS_CPU_COUNT (2U) - -/*! @name DEBUG_AUTH_BEACON - Debug Authentication BEACON */ -/*! @{ */ - -#define SYSCON_DEBUG_AUTH_BEACON_BEACON_MASK (0xFFFFFFFFU) -#define SYSCON_DEBUG_AUTH_BEACON_BEACON_SHIFT (0U) -/*! BEACON - Sets by the debug authentication code in ROM to pass the debug beacons (Credential - * Beacon and Authentication Beacon) to the application code. - */ -#define SYSCON_DEBUG_AUTH_BEACON_BEACON(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEBUG_AUTH_BEACON_BEACON_SHIFT)) & SYSCON_DEBUG_AUTH_BEACON_BEACON_MASK) -/*! @} */ - -/*! @name SWD_ACCESS_DSP - DSP Software Debug Access */ -/*! @{ */ - -#define SYSCON_SWD_ACCESS_DSP_SEC_CODE_MASK (0xFFFFFFFFU) -#define SYSCON_SWD_ACCESS_DSP_SEC_CODE_SHIFT (0U) -/*! SEC_CODE - DSP SWD-AP: 0x12345678 - * 0b00010010001101000101011001111000..Value to write to enable DSP SWD access. Reading back register is read as 0xA. - * 0b00000000000000000000000000000000..DSP DAP is not allowed. Reading back register is read as 0x5. - */ -#define SYSCON_SWD_ACCESS_DSP_SEC_CODE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_SWD_ACCESS_DSP_SEC_CODE_SHIFT)) & SYSCON_SWD_ACCESS_DSP_SEC_CODE_MASK) -/*! @} */ - -/*! @name JTAG_ID - JTAG Chip ID */ -/*! @{ */ - -#define SYSCON_JTAG_ID_JTAG_ID_MASK (0xFFFFFFFFU) -#define SYSCON_JTAG_ID_JTAG_ID_SHIFT (0U) -/*! JTAG_ID - Indicates the device ID */ -#define SYSCON_JTAG_ID_JTAG_ID(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_JTAG_ID_JTAG_ID_SHIFT)) & SYSCON_JTAG_ID_JTAG_ID_MASK) -/*! @} */ - -/*! @name DEVICE_TYPE - Device Type */ -/*! @{ */ - -#define SYSCON_DEVICE_TYPE_DEVICE_TYPE_MASK (0xFFFFFFFFU) -#define SYSCON_DEVICE_TYPE_DEVICE_TYPE_SHIFT (0U) -/*! DEVICE_TYPE - Indicates DEVICE TYPE. */ -#define SYSCON_DEVICE_TYPE_DEVICE_TYPE(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEVICE_TYPE_DEVICE_TYPE_SHIFT)) & SYSCON_DEVICE_TYPE_DEVICE_TYPE_MASK) -/*! @} */ - -/*! @name DEVICE_ID0 - Device ID */ -/*! @{ */ - -#define SYSCON_DEVICE_ID0_ROM_REV_MINOR_MASK (0xF00000U) -#define SYSCON_DEVICE_ID0_ROM_REV_MINOR_SHIFT (20U) -/*! ROM_REV_MINOR - ROM revision. */ -#define SYSCON_DEVICE_ID0_ROM_REV_MINOR(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DEVICE_ID0_ROM_REV_MINOR_SHIFT)) & SYSCON_DEVICE_ID0_ROM_REV_MINOR_MASK) -/*! @} */ - -/*! @name DIEID - Chip Revision ID and Number */ -/*! @{ */ - -#define SYSCON_DIEID_MINOR_REVISION_MASK (0xFU) -#define SYSCON_DIEID_MINOR_REVISION_SHIFT (0U) -/*! MINOR_REVISION - Chip minor revision */ -#define SYSCON_DIEID_MINOR_REVISION(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DIEID_MINOR_REVISION_SHIFT)) & SYSCON_DIEID_MINOR_REVISION_MASK) - -#define SYSCON_DIEID_MAJOR_REVISION_MASK (0xF0U) -#define SYSCON_DIEID_MAJOR_REVISION_SHIFT (4U) -/*! MAJOR_REVISION - Chip major revision */ -#define SYSCON_DIEID_MAJOR_REVISION(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DIEID_MAJOR_REVISION_SHIFT)) & SYSCON_DIEID_MAJOR_REVISION_MASK) - -#define SYSCON_DIEID_MCO_NUM_IN_DIE_ID_MASK (0xFFFFF00U) -#define SYSCON_DIEID_MCO_NUM_IN_DIE_ID_SHIFT (8U) -/*! MCO_NUM_IN_DIE_ID - Chip number */ -#define SYSCON_DIEID_MCO_NUM_IN_DIE_ID(x) (((uint32_t)(((uint32_t)(x)) << SYSCON_DIEID_MCO_NUM_IN_DIE_ID_SHIFT)) & SYSCON_DIEID_MCO_NUM_IN_DIE_ID_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group SYSCON_Register_Masks */ - - -/* SYSCON - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral SYSCON0 base address */ - #define SYSCON0_BASE (0x50000000u) - /** Peripheral SYSCON0 base address */ - #define SYSCON0_BASE_NS (0x40000000u) - /** Peripheral SYSCON0 base pointer */ - #define SYSCON0 ((SYSCON_Type *)SYSCON0_BASE) - /** Peripheral SYSCON0 base pointer */ - #define SYSCON0_NS ((SYSCON_Type *)SYSCON0_BASE_NS) - /** Array initializer of SYSCON peripheral base addresses */ - #define SYSCON_BASE_ADDRS { SYSCON0_BASE } - /** Array initializer of SYSCON peripheral base pointers */ - #define SYSCON_BASE_PTRS { SYSCON0 } - /** Array initializer of SYSCON peripheral base addresses */ - #define SYSCON_BASE_ADDRS_NS { SYSCON0_BASE_NS } - /** Array initializer of SYSCON peripheral base pointers */ - #define SYSCON_BASE_PTRS_NS { SYSCON0_NS } -#else - /** Peripheral SYSCON0 base address */ - #define SYSCON0_BASE (0x40000000u) - /** Peripheral SYSCON0 base pointer */ - #define SYSCON0 ((SYSCON_Type *)SYSCON0_BASE) - /** Array initializer of SYSCON peripheral base addresses */ - #define SYSCON_BASE_ADDRS { SYSCON0_BASE } - /** Array initializer of SYSCON peripheral base pointers */ - #define SYSCON_BASE_PTRS { SYSCON0 } -#endif -/* Backward compatibility */ -#define SYSCON SYSCON0 - - -/*! - * @} - */ /* end of group SYSCON_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- SYSPM Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SYSPM_Peripheral_Access_Layer SYSPM Peripheral Access Layer - * @{ - */ - -/** SYSPM - Register Layout Typedef */ -typedef struct { - struct { /* offset: 0x0, array step: 0x30 */ - __IO uint32_t PMCR; /**< Performance Monitor Control, array offset: 0x0, array step: 0x30 */ - uint8_t RESERVED_0[20]; - struct { /* offset: 0x18, array step: index*0x30, index2*0x8 */ - __I uint8_t HI; /**< Performance Monitor Event Counter, array offset: 0x18, array step: index*0x30, index2*0x8 */ - uint8_t RESERVED_0[3]; - __I uint32_t LO; /**< Performance Monitor Event Counter, array offset: 0x1C, array step: index*0x30, index2*0x8 */ - } PMECTR[3]; - } PMCR[1]; -} SYSPM_Type; - -/* ---------------------------------------------------------------------------- - -- SYSPM Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SYSPM_Register_Masks SYSPM Register Masks - * @{ - */ - -/*! @name PMCR - Performance Monitor Control */ -/*! @{ */ - -#define SYSPM_PMCR_MENB_MASK (0x1U) -#define SYSPM_PMCR_MENB_SHIFT (0U) -/*! MENB - Module Is Enabled - * 0b0..Disabled - * 0b1..Enabled - */ -#define SYSPM_PMCR_MENB(x) (((uint32_t)(((uint32_t)(x)) << SYSPM_PMCR_MENB_SHIFT)) & SYSPM_PMCR_MENB_MASK) - -#define SYSPM_PMCR_SSC_MASK (0xEU) -#define SYSPM_PMCR_SSC_SHIFT (1U) -/*! SSC - Start and Stop Control - * 0b000..Idle or no-op - * 0b001..Local stop - * 0b010, 0b011..Local start - * 0b100.. - * 0b101.. - * 0b110, 0b111.. - */ -#define SYSPM_PMCR_SSC(x) (((uint32_t)(((uint32_t)(x)) << SYSPM_PMCR_SSC_SHIFT)) & SYSPM_PMCR_SSC_MASK) - -#define SYSPM_PMCR_CMODE_MASK (0x30U) -#define SYSPM_PMCR_CMODE_SHIFT (4U) -/*! CMODE - Count Mode - * 0b00..Counted in both User and Privileged modes - * 0b01.. - * 0b10..Counted only in User mode - * 0b11..Counted only in Privileged mode - */ -#define SYSPM_PMCR_CMODE(x) (((uint32_t)(((uint32_t)(x)) << SYSPM_PMCR_CMODE_SHIFT)) & SYSPM_PMCR_CMODE_MASK) - -#define SYSPM_PMCR_RECTR1_MASK (0x100U) -#define SYSPM_PMCR_RECTR1_SHIFT (8U) -/*! RECTR1 - Reset Event Counter 1 - * 0b0..Run normally - * 0b1..Reset - */ -#define SYSPM_PMCR_RECTR1(x) (((uint32_t)(((uint32_t)(x)) << SYSPM_PMCR_RECTR1_SHIFT)) & SYSPM_PMCR_RECTR1_MASK) - -#define SYSPM_PMCR_RECTR2_MASK (0x200U) -#define SYSPM_PMCR_RECTR2_SHIFT (9U) -/*! RECTR2 - Reset Event Counter 2 - * 0b0..Run normally - * 0b1..Reset - */ -#define SYSPM_PMCR_RECTR2(x) (((uint32_t)(((uint32_t)(x)) << SYSPM_PMCR_RECTR2_SHIFT)) & SYSPM_PMCR_RECTR2_MASK) - -#define SYSPM_PMCR_RECTR3_MASK (0x400U) -#define SYSPM_PMCR_RECTR3_SHIFT (10U) -/*! RECTR3 - Reset Event Counter 3 - * 0b0..Run normally - * 0b1..Reset - */ -#define SYSPM_PMCR_RECTR3(x) (((uint32_t)(((uint32_t)(x)) << SYSPM_PMCR_RECTR3_SHIFT)) & SYSPM_PMCR_RECTR3_MASK) - -#define SYSPM_PMCR_SELEVT1_MASK (0x3F800U) -#define SYSPM_PMCR_SELEVT1_SHIFT (11U) -/*! SELEVT1 - Select Event 1 */ -#define SYSPM_PMCR_SELEVT1(x) (((uint32_t)(((uint32_t)(x)) << SYSPM_PMCR_SELEVT1_SHIFT)) & SYSPM_PMCR_SELEVT1_MASK) - -#define SYSPM_PMCR_SELEVT2_MASK (0x1FC0000U) -#define SYSPM_PMCR_SELEVT2_SHIFT (18U) -/*! SELEVT2 - Select Event 2 */ -#define SYSPM_PMCR_SELEVT2(x) (((uint32_t)(((uint32_t)(x)) << SYSPM_PMCR_SELEVT2_SHIFT)) & SYSPM_PMCR_SELEVT2_MASK) - -#define SYSPM_PMCR_SELEVT3_MASK (0xFE000000U) -#define SYSPM_PMCR_SELEVT3_SHIFT (25U) -/*! SELEVT3 - Select Event 3 */ -#define SYSPM_PMCR_SELEVT3(x) (((uint32_t)(((uint32_t)(x)) << SYSPM_PMCR_SELEVT3_SHIFT)) & SYSPM_PMCR_SELEVT3_MASK) -/*! @} */ - -/* The count of SYSPM_PMCR */ -#define SYSPM_PMCR_COUNT (1U) - -/*! @name PMCR_PMECTR_HI - Performance Monitor Event Counter */ -/*! @{ */ - -#define SYSPM_PMCR_PMECTR_HI_ECTR_MASK (0xFFU) -#define SYSPM_PMCR_PMECTR_HI_ECTR_SHIFT (0U) -/*! ECTR - Event Counter */ -#define SYSPM_PMCR_PMECTR_HI_ECTR(x) (((uint8_t)(((uint8_t)(x)) << SYSPM_PMCR_PMECTR_HI_ECTR_SHIFT)) & SYSPM_PMCR_PMECTR_HI_ECTR_MASK) -/*! @} */ - -/* The count of SYSPM_PMCR_PMECTR_HI */ -#define SYSPM_PMCR_PMECTR_HI_COUNT (1U) - -/* The count of SYSPM_PMCR_PMECTR_HI */ -#define SYSPM_PMCR_PMECTR_HI_COUNT2 (3U) - -/*! @name PMCR_PMECTR_LO - Performance Monitor Event Counter */ -/*! @{ */ - -#define SYSPM_PMCR_PMECTR_LO_ECTR_MASK (0xFFFFFFFFU) -#define SYSPM_PMCR_PMECTR_LO_ECTR_SHIFT (0U) -/*! ECTR - Event Counter */ -#define SYSPM_PMCR_PMECTR_LO_ECTR(x) (((uint32_t)(((uint32_t)(x)) << SYSPM_PMCR_PMECTR_LO_ECTR_SHIFT)) & SYSPM_PMCR_PMECTR_LO_ECTR_MASK) -/*! @} */ - -/* The count of SYSPM_PMCR_PMECTR_LO */ -#define SYSPM_PMCR_PMECTR_LO_COUNT (1U) - -/* The count of SYSPM_PMCR_PMECTR_LO */ -#define SYSPM_PMCR_PMECTR_LO_COUNT2 (3U) - - -/*! - * @} - */ /* end of group SYSPM_Register_Masks */ - - -/* SYSPM - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral CMX_PERFMON0 base address */ - #define CMX_PERFMON0_BASE (0x500C1000u) - /** Peripheral CMX_PERFMON0 base address */ - #define CMX_PERFMON0_BASE_NS (0x400C1000u) - /** Peripheral CMX_PERFMON0 base pointer */ - #define CMX_PERFMON0 ((SYSPM_Type *)CMX_PERFMON0_BASE) - /** Peripheral CMX_PERFMON0 base pointer */ - #define CMX_PERFMON0_NS ((SYSPM_Type *)CMX_PERFMON0_BASE_NS) - /** Peripheral CMX_PERFMON1 base address */ - #define CMX_PERFMON1_BASE (0x500C2000u) - /** Peripheral CMX_PERFMON1 base address */ - #define CMX_PERFMON1_BASE_NS (0x400C2000u) - /** Peripheral CMX_PERFMON1 base pointer */ - #define CMX_PERFMON1 ((SYSPM_Type *)CMX_PERFMON1_BASE) - /** Peripheral CMX_PERFMON1 base pointer */ - #define CMX_PERFMON1_NS ((SYSPM_Type *)CMX_PERFMON1_BASE_NS) - /** Array initializer of SYSPM peripheral base addresses */ - #define SYSPM_BASE_ADDRS { CMX_PERFMON0_BASE, CMX_PERFMON1_BASE } - /** Array initializer of SYSPM peripheral base pointers */ - #define SYSPM_BASE_PTRS { CMX_PERFMON0, CMX_PERFMON1 } - /** Array initializer of SYSPM peripheral base addresses */ - #define SYSPM_BASE_ADDRS_NS { CMX_PERFMON0_BASE_NS, CMX_PERFMON1_BASE_NS } - /** Array initializer of SYSPM peripheral base pointers */ - #define SYSPM_BASE_PTRS_NS { CMX_PERFMON0_NS, CMX_PERFMON1_NS } -#else - /** Peripheral CMX_PERFMON0 base address */ - #define CMX_PERFMON0_BASE (0x400C1000u) - /** Peripheral CMX_PERFMON0 base pointer */ - #define CMX_PERFMON0 ((SYSPM_Type *)CMX_PERFMON0_BASE) - /** Peripheral CMX_PERFMON1 base address */ - #define CMX_PERFMON1_BASE (0x400C2000u) - /** Peripheral CMX_PERFMON1 base pointer */ - #define CMX_PERFMON1 ((SYSPM_Type *)CMX_PERFMON1_BASE) - /** Array initializer of SYSPM peripheral base addresses */ - #define SYSPM_BASE_ADDRS { CMX_PERFMON0_BASE, CMX_PERFMON1_BASE } - /** Array initializer of SYSPM peripheral base pointers */ - #define SYSPM_BASE_PTRS { CMX_PERFMON0, CMX_PERFMON1 } -#endif - -/*! - * @} - */ /* end of group SYSPM_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- TRDC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup TRDC_Peripheral_Access_Layer TRDC Peripheral Access Layer - * @{ - */ - -/** TRDC - Register Layout Typedef */ -typedef struct { - struct { /* offset: 0x0, array step: 0x1CC */ - __IO uint32_t MBC_MEM_GLBCFG[4]; /**< MBC Global Configuration Register, array offset: 0x0, array step: index*0x1CC, index2*0x4 */ - __IO uint32_t MBC_NSE_BLK_INDEX; /**< MBC NonSecure Enable Block Index, array offset: 0x10, array step: 0x1CC */ - __O uint32_t MBC_NSE_BLK_SET; /**< MBC NonSecure Enable Block Set, array offset: 0x14, array step: 0x1CC */ - __O uint32_t MBC_NSE_BLK_CLR; /**< MBC NonSecure Enable Block Clear, array offset: 0x18, array step: 0x1CC */ - __O uint32_t MBC_NSE_BLK_CLR_ALL; /**< MBC NonSecure Enable Block Clear All, array offset: 0x1C, array step: 0x1CC */ - __IO uint32_t MBC_MEMN_GLBAC[8]; /**< MBC Global Access Control, array offset: 0x20, array step: index*0x1CC, index2*0x4 */ - __IO uint32_t MBC_DOM0_MEM0_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x40, array step: index*0x1CC, index2*0x4 */ - uint8_t RESERVED_0[224]; - __IO uint32_t MBC_DOM0_MEM0_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x140, array step: index*0x1CC, index2*0x4 */ - uint8_t RESERVED_1[56]; - __IO uint32_t MBC_DOM0_MEM1_BLK_CFG_W[1]; /**< MBC Memory Block Configuration Word, array offset: 0x180, array step: index*0x1CC, index2*0x4 */ - uint8_t RESERVED_2[28]; - __IO uint32_t MBC_DOM0_MEM1_BLK_NSE_W[1]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x1A0, array step: index*0x1CC, index2*0x4 */ - uint8_t RESERVED_3[4]; - __IO uint32_t MBC_DOM0_MEM2_BLK_CFG_W[1]; /**< MBC Memory Block Configuration Word, array offset: 0x1A8, array step: index*0x1CC, index2*0x4 */ - uint8_t RESERVED_4[28]; - __IO uint32_t MBC_DOM0_MEM2_BLK_NSE_W[1]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x1C8, array step: index*0x1CC, index2*0x4 */ - } MBC_INDEX[1]; -} TRDC_Type; - -/* ---------------------------------------------------------------------------- - -- TRDC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup TRDC_Register_Masks TRDC Register Masks - * @{ - */ - -/*! @name MBC_INDEX_MBC_MEM_GLBCFG - MBC Global Configuration Register */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_NBLKS_MASK (0x3FFU) -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_NBLKS_SHIFT (0U) -/*! NBLKS - Number of blocks in this memory */ -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_NBLKS(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEM_GLBCFG_NBLKS_SHIFT)) & TRDC_MBC_INDEX_MBC_MEM_GLBCFG_NBLKS_MASK) - -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_SIZE_LOG2_MASK (0x1F0000U) -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_SIZE_LOG2_SHIFT (16U) -/*! SIZE_LOG2 - Log2 size per block */ -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_SIZE_LOG2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEM_GLBCFG_SIZE_LOG2_SHIFT)) & TRDC_MBC_INDEX_MBC_MEM_GLBCFG_SIZE_LOG2_MASK) - -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_CLRE_MASK (0xC0000000U) -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_CLRE_SHIFT (30U) -/*! CLRE - Clear Error */ -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_CLRE(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEM_GLBCFG_CLRE_SHIFT)) & TRDC_MBC_INDEX_MBC_MEM_GLBCFG_CLRE_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_MEM_GLBCFG */ -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_MEM_GLBCFG */ -#define TRDC_MBC_INDEX_MBC_MEM_GLBCFG_COUNT2 (4U) - -/*! @name MBC_INDEX_MBC_NSE_BLK_INDEX - MBC NonSecure Enable Block Index */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_WNDX_MASK (0x3CU) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_WNDX_SHIFT (2U) -/*! WNDX - Word index into the block NSE bitmap. It selects the BLK_NSE_Wn register, where WNDX determines the value of n. */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_WNDX(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_WNDX_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_WNDX_MASK) - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_MEM_SEL_MASK (0xF00U) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_MEM_SEL_SHIFT (8U) -/*! MEM_SEL - Memory Select */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_MEM_SEL(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_MEM_SEL_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_MEM_SEL_MASK) - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_DID_SEL0_MASK (0x10000U) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_DID_SEL0_SHIFT (16U) -/*! DID_SEL0 - DID Select - * 0b0..No effect. - * 0b1..Selects NSE bits for this domain. - */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_DID_SEL0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_DID_SEL0_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_DID_SEL0_MASK) - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_AI_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_AI_SHIFT (31U) -/*! AI - Auto Increment - * 0b0..No effect. - * 0b1..Add 1 to the WNDX field after the register write. - */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_AI(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_AI_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_AI_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_INDEX_COUNT (1U) - -/*! @name MBC_INDEX_MBC_NSE_BLK_SET - MBC NonSecure Enable Block Set */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_SET_W1SET_MASK (0xFFFFFFFFU) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_SET_W1SET_SHIFT (0U) -/*! W1SET - Write-1 Set */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_SET_W1SET(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_SET_W1SET_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_SET_W1SET_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_NSE_BLK_SET */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_SET_COUNT (1U) - -/*! @name MBC_INDEX_MBC_NSE_BLK_CLR - MBC NonSecure Enable Block Clear */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_W1CLR_MASK (0xFFFFFFFFU) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_W1CLR_SHIFT (0U) -/*! W1CLR - Write-1 Clear */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_W1CLR(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_W1CLR_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_W1CLR_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_NSE_BLK_CLR */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_COUNT (1U) - -/*! @name MBC_INDEX_MBC_NSE_BLK_CLR_ALL - MBC NonSecure Enable Block Clear All */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_MEMSEL_MASK (0xF00U) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_MEMSEL_SHIFT (8U) -/*! MEMSEL - Memory Select */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_MEMSEL(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_MEMSEL_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_MEMSEL_MASK) - -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_DID_SEL0_MASK (0x10000U) -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_DID_SEL0_SHIFT (16U) -/*! DID_SEL0 - DID Select - * 0b0..No effect. - * 0b1..Clear all NSE bits for this domain. - */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_DID_SEL0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_DID_SEL0_SHIFT)) & TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_DID_SEL0_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL */ -#define TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_COUNT (1U) - -/*! @name MBC_INDEX_MBC_MEMN_GLBAC - MBC Global Access Control */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUX_MASK (0x1U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUX_SHIFT (0U) -/*! NUX - NonsecureUser Execute - * 0b0..Execute access is not allowed in Nonsecure User mode. - * 0b1..Execute access is allowed in Nonsecure User mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUX(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUX_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUX_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUW_MASK (0x2U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUW_SHIFT (1U) -/*! NUW - NonsecureUser Write - * 0b0..Write access is not allowed in Nonsecure User mode. - * 0b1..Write access is allowed in Nonsecure User mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUW(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUW_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUW_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUR_MASK (0x4U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUR_SHIFT (2U) -/*! NUR - NonsecureUser Read - * 0b0..Read access is not allowed in Nonsecure User mode. - * 0b1..Read access is allowed in Nonsecure User mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUR(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUR_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NUR_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPX_MASK (0x10U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPX_SHIFT (4U) -/*! NPX - NonsecurePriv Execute - * 0b0..Execute access is not allowed in Nonsecure Privilege mode. - * 0b1..Execute access is allowed in Nonsecure Privilege mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPX(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPX_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPX_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPW_MASK (0x20U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPW_SHIFT (5U) -/*! NPW - NonsecurePriv Write - * 0b0..Write access is not allowed in Nonsecure Privilege mode. - * 0b1..Write access is allowed in Nonsecure Privilege mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPW(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPW_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPW_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPR_MASK (0x40U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPR_SHIFT (6U) -/*! NPR - NonsecurePriv Read - * 0b0..Read access is not allowed in Nonsecure Privilege mode. - * 0b1..Read access is allowed in Nonsecure Privilege mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPR(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPR_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_NPR_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUX_MASK (0x100U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUX_SHIFT (8U) -/*! SUX - SecureUser Execute - * 0b0..Execute access is not allowed in Secure User mode. - * 0b1..Execute access is allowed in Secure User mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUX(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUX_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUX_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUW_MASK (0x200U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUW_SHIFT (9U) -/*! SUW - SecureUser Write - * 0b0..Write access is not allowed in Secure User mode. - * 0b1..Write access is allowed in Secure User mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUW(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUW_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUW_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUR_MASK (0x400U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUR_SHIFT (10U) -/*! SUR - SecureUser Read - * 0b0..Read access is not allowed in Secure User mode. - * 0b1..Read access is allowed in Secure User mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUR(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUR_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SUR_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPX_MASK (0x1000U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPX_SHIFT (12U) -/*! SPX - SecurePriv Execute - * 0b0..Execute access is not allowed in Secure Privilege mode. - * 0b1..Execute access is allowed in Secure Privilege mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPX(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPX_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPX_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPW_MASK (0x2000U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPW_SHIFT (13U) -/*! SPW - SecurePriv Write - * 0b0..Write access is not allowed in Secure Privilege mode. - * 0b1..Write access is allowed in Secure Privilege mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPW(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPW_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPW_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPR_MASK (0x4000U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPR_SHIFT (14U) -/*! SPR - SecurePriv Read - * 0b0..Read access is not allowed in Secure Privilege mode. - * 0b1..Read access is allowed in Secure Privilege mode. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPR(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPR_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_SPR_MASK) - -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_LK_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_LK_SHIFT (31U) -/*! LK - LOCK - * 0b0..This register is not locked and can be altered. - * 0b1..This register is locked and cannot be altered. - */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_LK(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_MEMN_GLBAC_LK_SHIFT)) & TRDC_MBC_INDEX_MBC_MEMN_GLBAC_LK_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_MEMN_GLBAC */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_MEMN_GLBAC */ -#define TRDC_MBC_INDEX_MBC_MEMN_GLBAC_COUNT2 (8U) - -/*! @name MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W - MBC Memory Block Configuration Word */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL0_MASK (0x7U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL0_SHIFT (0U) -/*! MBACSEL0 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE0_MASK (0x8U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE0_SHIFT (3U) -/*! NSE0 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL1_MASK (0x70U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL1_SHIFT (4U) -/*! MBACSEL1 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE1_MASK (0x80U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE1_SHIFT (7U) -/*! NSE1 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL2_MASK (0x700U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL2_SHIFT (8U) -/*! MBACSEL2 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE2_MASK (0x800U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE2_SHIFT (11U) -/*! NSE2 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL3_MASK (0x7000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL3_SHIFT (12U) -/*! MBACSEL3 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE3_MASK (0x8000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE3_SHIFT (15U) -/*! NSE3 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL4_MASK (0x70000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL4_SHIFT (16U) -/*! MBACSEL4 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE4_MASK (0x80000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE4_SHIFT (19U) -/*! NSE4 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL5_MASK (0x700000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL5_SHIFT (20U) -/*! MBACSEL5 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE5_MASK (0x800000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE5_SHIFT (23U) -/*! NSE5 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL6_MASK (0x7000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL6_SHIFT (24U) -/*! MBACSEL6 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE6_MASK (0x8000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE6_SHIFT (27U) -/*! NSE6 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL7_MASK (0x70000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL7_SHIFT (28U) -/*! MBACSEL7 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_MBACSEL7_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE7_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE7_SHIFT (31U) -/*! NSE7 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_NSE7_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_CFG_W_MBC_DOM0_MEM0_BLK_CFG_W_COUNT2 (8U) - -/*! @name MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W - MBC Memory Block NonSecure Enable Word */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT0_MASK (0x1U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT0_SHIFT (0U) -/*! BIT0 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT1_MASK (0x2U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT1_SHIFT (1U) -/*! BIT1 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT2_MASK (0x4U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT2_SHIFT (2U) -/*! BIT2 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT3_MASK (0x8U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT3_SHIFT (3U) -/*! BIT3 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT4_MASK (0x10U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT4_SHIFT (4U) -/*! BIT4 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT5_MASK (0x20U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT5_SHIFT (5U) -/*! BIT5 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT6_MASK (0x40U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT6_SHIFT (6U) -/*! BIT6 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT7_MASK (0x80U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT7_SHIFT (7U) -/*! BIT7 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT7_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT8_MASK (0x100U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT8_SHIFT (8U) -/*! BIT8 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT8(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT8_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT8_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT9_MASK (0x200U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT9_SHIFT (9U) -/*! BIT9 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT9(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT9_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT9_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT10_MASK (0x400U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT10_SHIFT (10U) -/*! BIT10 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT10(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT10_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT10_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT11_MASK (0x800U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT11_SHIFT (11U) -/*! BIT11 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT11(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT11_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT11_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT12_MASK (0x1000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT12_SHIFT (12U) -/*! BIT12 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT12(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT12_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT12_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT13_MASK (0x2000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT13_SHIFT (13U) -/*! BIT13 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT13(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT13_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT13_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT14_MASK (0x4000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT14_SHIFT (14U) -/*! BIT14 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT14(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT14_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT14_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT15_MASK (0x8000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT15_SHIFT (15U) -/*! BIT15 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT15(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT15_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT15_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT16_MASK (0x10000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT16_SHIFT (16U) -/*! BIT16 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT16(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT16_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT16_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT17_MASK (0x20000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT17_SHIFT (17U) -/*! BIT17 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT17(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT17_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT17_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT18_MASK (0x40000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT18_SHIFT (18U) -/*! BIT18 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT18(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT18_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT18_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT19_MASK (0x80000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT19_SHIFT (19U) -/*! BIT19 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT19(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT19_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT19_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT20_MASK (0x100000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT20_SHIFT (20U) -/*! BIT20 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT20(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT20_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT20_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT21_MASK (0x200000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT21_SHIFT (21U) -/*! BIT21 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT21(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT21_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT21_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT22_MASK (0x400000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT22_SHIFT (22U) -/*! BIT22 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT22(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT22_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT22_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT23_MASK (0x800000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT23_SHIFT (23U) -/*! BIT23 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT23(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT23_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT23_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT24_MASK (0x1000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT24_SHIFT (24U) -/*! BIT24 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT24(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT24_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT24_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT25_MASK (0x2000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT25_SHIFT (25U) -/*! BIT25 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT25(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT25_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT25_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT26_MASK (0x4000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT26_SHIFT (26U) -/*! BIT26 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT26(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT26_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT26_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT27_MASK (0x8000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT27_SHIFT (27U) -/*! BIT27 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT27(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT27_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT27_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT28_MASK (0x10000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT28_SHIFT (28U) -/*! BIT28 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT28(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT28_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT28_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT29_MASK (0x20000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT29_SHIFT (29U) -/*! BIT29 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT29(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT29_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT29_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT30_MASK (0x40000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT30_SHIFT (30U) -/*! BIT30 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT30(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT30_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT30_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT31_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT31_SHIFT (31U) -/*! BIT31 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT31(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT31_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_BIT31_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM0_BLK_NSE_W_MBC_DOM0_MEM0_BLK_NSE_W_COUNT2 (2U) - -/*! @name MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W - MBC Memory Block Configuration Word */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL0_MASK (0x7U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL0_SHIFT (0U) -/*! MBACSEL0 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE0_MASK (0x8U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE0_SHIFT (3U) -/*! NSE0 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL1_MASK (0x70U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL1_SHIFT (4U) -/*! MBACSEL1 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE1_MASK (0x80U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE1_SHIFT (7U) -/*! NSE1 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL2_MASK (0x700U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL2_SHIFT (8U) -/*! MBACSEL2 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE2_MASK (0x800U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE2_SHIFT (11U) -/*! NSE2 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL3_MASK (0x7000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL3_SHIFT (12U) -/*! MBACSEL3 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE3_MASK (0x8000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE3_SHIFT (15U) -/*! NSE3 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL4_MASK (0x70000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL4_SHIFT (16U) -/*! MBACSEL4 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE4_MASK (0x80000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE4_SHIFT (19U) -/*! NSE4 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL5_MASK (0x700000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL5_SHIFT (20U) -/*! MBACSEL5 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE5_MASK (0x800000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE5_SHIFT (23U) -/*! NSE5 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL6_MASK (0x7000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL6_SHIFT (24U) -/*! MBACSEL6 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE6_MASK (0x8000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE6_SHIFT (27U) -/*! NSE6 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL7_MASK (0x70000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL7_SHIFT (28U) -/*! MBACSEL7 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_MBACSEL7_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE7_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE7_SHIFT (31U) -/*! NSE7 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_NSE7_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_CFG_W_MBC_DOM0_MEM1_BLK_CFG_W_COUNT2 (1U) - -/*! @name MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W - MBC Memory Block NonSecure Enable Word */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT0_MASK (0x1U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT0_SHIFT (0U) -/*! BIT0 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT1_MASK (0x2U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT1_SHIFT (1U) -/*! BIT1 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT2_MASK (0x4U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT2_SHIFT (2U) -/*! BIT2 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT3_MASK (0x8U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT3_SHIFT (3U) -/*! BIT3 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT4_MASK (0x10U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT4_SHIFT (4U) -/*! BIT4 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT5_MASK (0x20U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT5_SHIFT (5U) -/*! BIT5 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT6_MASK (0x40U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT6_SHIFT (6U) -/*! BIT6 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT7_MASK (0x80U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT7_SHIFT (7U) -/*! BIT7 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT7_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT8_MASK (0x100U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT8_SHIFT (8U) -/*! BIT8 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT8(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT8_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT8_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT9_MASK (0x200U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT9_SHIFT (9U) -/*! BIT9 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT9(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT9_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT9_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT10_MASK (0x400U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT10_SHIFT (10U) -/*! BIT10 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT10(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT10_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT10_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT11_MASK (0x800U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT11_SHIFT (11U) -/*! BIT11 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT11(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT11_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT11_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT12_MASK (0x1000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT12_SHIFT (12U) -/*! BIT12 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT12(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT12_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT12_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT13_MASK (0x2000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT13_SHIFT (13U) -/*! BIT13 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT13(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT13_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT13_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT14_MASK (0x4000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT14_SHIFT (14U) -/*! BIT14 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT14(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT14_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT14_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT15_MASK (0x8000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT15_SHIFT (15U) -/*! BIT15 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT15(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT15_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT15_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT16_MASK (0x10000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT16_SHIFT (16U) -/*! BIT16 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT16(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT16_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT16_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT17_MASK (0x20000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT17_SHIFT (17U) -/*! BIT17 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT17(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT17_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT17_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT18_MASK (0x40000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT18_SHIFT (18U) -/*! BIT18 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT18(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT18_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT18_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT19_MASK (0x80000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT19_SHIFT (19U) -/*! BIT19 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT19(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT19_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT19_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT20_MASK (0x100000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT20_SHIFT (20U) -/*! BIT20 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT20(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT20_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT20_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT21_MASK (0x200000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT21_SHIFT (21U) -/*! BIT21 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT21(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT21_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT21_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT22_MASK (0x400000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT22_SHIFT (22U) -/*! BIT22 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT22(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT22_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT22_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT23_MASK (0x800000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT23_SHIFT (23U) -/*! BIT23 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT23(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT23_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT23_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT24_MASK (0x1000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT24_SHIFT (24U) -/*! BIT24 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT24(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT24_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT24_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT25_MASK (0x2000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT25_SHIFT (25U) -/*! BIT25 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT25(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT25_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT25_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT26_MASK (0x4000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT26_SHIFT (26U) -/*! BIT26 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT26(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT26_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT26_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT27_MASK (0x8000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT27_SHIFT (27U) -/*! BIT27 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT27(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT27_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT27_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT28_MASK (0x10000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT28_SHIFT (28U) -/*! BIT28 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT28(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT28_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT28_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT29_MASK (0x20000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT29_SHIFT (29U) -/*! BIT29 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT29(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT29_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT29_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT30_MASK (0x40000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT30_SHIFT (30U) -/*! BIT30 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT30(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT30_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT30_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT31_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT31_SHIFT (31U) -/*! BIT31 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT31(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT31_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_BIT31_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM1_BLK_NSE_W_MBC_DOM0_MEM1_BLK_NSE_W_COUNT2 (1U) - -/*! @name MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W - MBC Memory Block Configuration Word */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL0_MASK (0x7U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL0_SHIFT (0U) -/*! MBACSEL0 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE0_MASK (0x8U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE0_SHIFT (3U) -/*! NSE0 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL1_MASK (0x70U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL1_SHIFT (4U) -/*! MBACSEL1 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE1_MASK (0x80U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE1_SHIFT (7U) -/*! NSE1 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL2_MASK (0x700U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL2_SHIFT (8U) -/*! MBACSEL2 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE2_MASK (0x800U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE2_SHIFT (11U) -/*! NSE2 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL3_MASK (0x7000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL3_SHIFT (12U) -/*! MBACSEL3 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE3_MASK (0x8000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE3_SHIFT (15U) -/*! NSE3 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL4_MASK (0x70000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL4_SHIFT (16U) -/*! MBACSEL4 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE4_MASK (0x80000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE4_SHIFT (19U) -/*! NSE4 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL5_MASK (0x700000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL5_SHIFT (20U) -/*! MBACSEL5 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE5_MASK (0x800000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE5_SHIFT (23U) -/*! NSE5 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL6_MASK (0x7000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL6_SHIFT (24U) -/*! MBACSEL6 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE6_MASK (0x8000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE6_SHIFT (27U) -/*! NSE6 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL7_MASK (0x70000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL7_SHIFT (28U) -/*! MBACSEL7 - Memory Block Access Control Select for block B - * 0b000..select MBC_MEMN_GLBAC0 access control policy for block B - * 0b001..select MBC_MEMN_GLBAC1 access control policy for block B - * 0b010..select MBC_MEMN_GLBAC2 access control policy for block B - * 0b011..select MBC_MEMN_GLBAC3 access control policy for block B - * 0b100..select MBC_MEMN_GLBAC4 access control policy for block B - * 0b101..select MBC_MEMN_GLBAC5 access control policy for block B - * 0b110..select MBC_MEMN_GLBAC6 access control policy for block B - * 0b111..select MBC_MEMN_GLBAC7 access control policy for block B - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_MBACSEL7_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE7_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE7_SHIFT (31U) -/*! NSE7 - NonSecure Enable for block B - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in this register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in this register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_NSE7_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_CFG_W_MBC_DOM0_MEM2_BLK_CFG_W_COUNT2 (1U) - -/*! @name MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W - MBC Memory Block NonSecure Enable Word */ -/*! @{ */ - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT0_MASK (0x1U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT0_SHIFT (0U) -/*! BIT0 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT0(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT0_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT0_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT1_MASK (0x2U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT1_SHIFT (1U) -/*! BIT1 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT1(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT1_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT1_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT2_MASK (0x4U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT2_SHIFT (2U) -/*! BIT2 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT2(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT2_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT2_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT3_MASK (0x8U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT3_SHIFT (3U) -/*! BIT3 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT3(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT3_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT3_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT4_MASK (0x10U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT4_SHIFT (4U) -/*! BIT4 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT4(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT4_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT4_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT5_MASK (0x20U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT5_SHIFT (5U) -/*! BIT5 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT5(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT5_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT5_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT6_MASK (0x40U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT6_SHIFT (6U) -/*! BIT6 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT6(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT6_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT6_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT7_MASK (0x80U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT7_SHIFT (7U) -/*! BIT7 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT7(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT7_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT7_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT8_MASK (0x100U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT8_SHIFT (8U) -/*! BIT8 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT8(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT8_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT8_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT9_MASK (0x200U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT9_SHIFT (9U) -/*! BIT9 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT9(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT9_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT9_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT10_MASK (0x400U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT10_SHIFT (10U) -/*! BIT10 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT10(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT10_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT10_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT11_MASK (0x800U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT11_SHIFT (11U) -/*! BIT11 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT11(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT11_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT11_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT12_MASK (0x1000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT12_SHIFT (12U) -/*! BIT12 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT12(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT12_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT12_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT13_MASK (0x2000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT13_SHIFT (13U) -/*! BIT13 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT13(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT13_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT13_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT14_MASK (0x4000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT14_SHIFT (14U) -/*! BIT14 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT14(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT14_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT14_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT15_MASK (0x8000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT15_SHIFT (15U) -/*! BIT15 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT15(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT15_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT15_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT16_MASK (0x10000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT16_SHIFT (16U) -/*! BIT16 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT16(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT16_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT16_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT17_MASK (0x20000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT17_SHIFT (17U) -/*! BIT17 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT17(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT17_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT17_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT18_MASK (0x40000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT18_SHIFT (18U) -/*! BIT18 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT18(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT18_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT18_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT19_MASK (0x80000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT19_SHIFT (19U) -/*! BIT19 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT19(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT19_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT19_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT20_MASK (0x100000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT20_SHIFT (20U) -/*! BIT20 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT20(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT20_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT20_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT21_MASK (0x200000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT21_SHIFT (21U) -/*! BIT21 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT21(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT21_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT21_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT22_MASK (0x400000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT22_SHIFT (22U) -/*! BIT22 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT22(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT22_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT22_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT23_MASK (0x800000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT23_SHIFT (23U) -/*! BIT23 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT23(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT23_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT23_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT24_MASK (0x1000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT24_SHIFT (24U) -/*! BIT24 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT24(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT24_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT24_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT25_MASK (0x2000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT25_SHIFT (25U) -/*! BIT25 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT25(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT25_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT25_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT26_MASK (0x4000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT26_SHIFT (26U) -/*! BIT26 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT26(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT26_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT26_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT27_MASK (0x8000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT27_SHIFT (27U) -/*! BIT27 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT27(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT27_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT27_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT28_MASK (0x10000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT28_SHIFT (28U) -/*! BIT28 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT28(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT28_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT28_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT29_MASK (0x20000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT29_SHIFT (29U) -/*! BIT29 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT29(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT29_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT29_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT30_MASK (0x40000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT30_SHIFT (30U) -/*! BIT30 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT30(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT30_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT30_MASK) - -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT31_MASK (0x80000000U) -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT31_SHIFT (31U) -/*! BIT31 - Bit b NonSecure Enable [b = 0 - 31] - * 0b0..Secure accesses to block B are based on corresponding MBACSEL field in register - * (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]), nonsecure accesses to block B are not allowed. - * 0b1..Secure accesses to block B are not allowed, nonsecure accesses to block B are based on corresponding - * MBACSEL field in register (MBCm_DOMd_MEMs_BLK_CFG_Ww[MBACSEL]). - */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT31(x) (((uint32_t)(((uint32_t)(x)) << TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT31_SHIFT)) & TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_BIT31_MASK) -/*! @} */ - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_COUNT (1U) - -/* The count of TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W */ -#define TRDC_MBC_INDEX_MBC_INDEX_DOM0_MEM2_BLK_NSE_W_MBC_DOM0_MEM2_BLK_NSE_W_COUNT2 (1U) - - -/*! - * @} - */ /* end of group TRDC_Register_Masks */ - - -/* TRDC - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral TRDC base address */ - #define TRDC_BASE (0x500C7000u) - /** Peripheral TRDC base address */ - #define TRDC_BASE_NS (0x400C7000u) - /** Peripheral TRDC base pointer */ - #define TRDC ((TRDC_Type *)TRDC_BASE) - /** Peripheral TRDC base pointer */ - #define TRDC_NS ((TRDC_Type *)TRDC_BASE_NS) - /** Array initializer of TRDC peripheral base addresses */ - #define TRDC_BASE_ADDRS { TRDC_BASE } - /** Array initializer of TRDC peripheral base pointers */ - #define TRDC_BASE_PTRS { TRDC } - /** Array initializer of TRDC peripheral base addresses */ - #define TRDC_BASE_ADDRS_NS { TRDC_BASE_NS } - /** Array initializer of TRDC peripheral base pointers */ - #define TRDC_BASE_PTRS_NS { TRDC_NS } -#else - /** Peripheral TRDC base address */ - #define TRDC_BASE (0x400C7000u) - /** Peripheral TRDC base pointer */ - #define TRDC ((TRDC_Type *)TRDC_BASE) - /** Array initializer of TRDC peripheral base addresses */ - #define TRDC_BASE_ADDRS { TRDC_BASE } - /** Array initializer of TRDC peripheral base pointers */ - #define TRDC_BASE_PTRS { TRDC } -#endif -#define MBC0_MEMORY_CFG_WORD_COUNT {1,2,4,1} -#define MBC1_MEMORY_CFG_WORD_COUNT {1,1,1,1} -#define MBC2_MEMORY_CFG_WORD_COUNT {9,6,1,1} -#define MBC3_MEMORY_CFG_WORD_COUNT {3,0,0,0} -#define MBC_MEMORY_CFG_WORD_COUNT {MBC0_MEMORY_CFG_WORD_COUNT , MBC1_MEMORY_CFG_WORD_COUNT, MBC2_MEMORY_CFG_WORD_COUNT, MBC3_MEMORY_CFG_WORD_COUNT} -#define MBC0_MEMORY_NSE_WORD_COUNT {1,1,1,1} -#define MBC1_MEMORY_NSE_WORD_COUNT {1,1,1,1} -#define MBC2_MEMORY_NSE_WORD_COUNT {3,2,1,1} -#define MBC3_MEMORY_NSE_WORD_COUNT {1,0,0,0} -#define MBC_MEMORY_NSE_WORD_COUNT {MBC0_MEMORY_NSE_WORD_COUNT , MBC1_MEMORY_NSE_WORD_COUNT, MBC2_MEMORY_NSE_WORD_COUNT, MBC3_MEMORY_NSE_WORD_COUNT} - - -/*! - * @} - */ /* end of group TRDC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- TSI Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup TSI_Peripheral_Access_Layer TSI Peripheral Access Layer - * @{ - */ - -/** TSI - Register Layout Typedef */ -typedef struct { - union { /* offset: 0x0 */ - __IO uint32_t CONFIG_MUTUAL; /**< TSI CONFIG (TSI_CONFIG) for Mutual-Capacitor, offset: 0x0 */ - __IO uint32_t CONFIG; /**< TSI CONFIG (TSI_CONFIG) for Self-Capacitor, offset: 0x0 */ - }; - __IO uint32_t TSHD; /**< TSI Threshold, offset: 0x4 */ - __IO uint32_t GENCS; /**< TSI General Control and Status, offset: 0x8 */ - __IO uint32_t MUL; /**< TSI Mutual-Capacitance, offset: 0xC */ - __IO uint32_t SINC; /**< TSI SINC Filter, offset: 0x10 */ - __IO uint32_t SSC0; /**< TSI SSC 0, offset: 0x14 */ - __IO uint32_t SSC1; /**< TSI SSC 1, offset: 0x18 */ - __IO uint32_t SSC2; /**< TSI SSC 2, offset: 0x1C */ - __IO uint32_t BASELINE; /**< TSI Baseline, offset: 0x20 */ - __IO uint32_t CHMERGE; /**< TSI Channel Merge, offset: 0x24 */ - __IO uint32_t SHIELD; /**< TSI Shield, offset: 0x28 */ - uint8_t RESERVED_0[212]; - __IO uint32_t DATA; /**< TSI Data and Status, offset: 0x100 */ - uint8_t RESERVED_1[4]; - __IO uint32_t MISC; /**< TSI Miscellaneous, offset: 0x108 */ - __IO uint32_t TRIG; /**< TSI AUTO TRIG, offset: 0x10C */ -} TSI_Type; - -/* ---------------------------------------------------------------------------- - -- TSI Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup TSI_Register_Masks TSI Register Masks - * @{ - */ - -/*! @name CONFIG_MUTUAL - TSI CONFIG (TSI_CONFIG) for Mutual-Capacitor */ -/*! @{ */ - -#define TSI_CONFIG_MUTUAL_MODE_MASK (0x1U) -#define TSI_CONFIG_MUTUAL_MODE_SHIFT (0U) -/*! MODE - Mode - * 0b0..Self capacitance - * 0b1..Mutual capacitance - */ -#define TSI_CONFIG_MUTUAL_MODE(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_MUTUAL_MODE_SHIFT)) & TSI_CONFIG_MUTUAL_MODE_MASK) - -#define TSI_CONFIG_MUTUAL_M_NMIRROR_MASK (0x6U) -#define TSI_CONFIG_MUTUAL_M_NMIRROR_SHIFT (1U) -/*! M_NMIRROR - NMOS Current Mirror - * 0b00..m = 1 - * 0b01..m = 2 - * 0b10..m = 3 - * 0b11..m = 4 - */ -#define TSI_CONFIG_MUTUAL_M_NMIRROR(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_MUTUAL_M_NMIRROR_SHIFT)) & TSI_CONFIG_MUTUAL_M_NMIRROR_MASK) - -#define TSI_CONFIG_MUTUAL_M_PMIRRORR_MASK (0x18U) -#define TSI_CONFIG_MUTUAL_M_PMIRRORR_SHIFT (3U) -/*! M_PMIRRORR - PMOS Current Mirror on Right Side - * 0b00..m = 1 - * 0b01..m = 2 - * 0b10..m = 3 - * 0b11..m = 4 - */ -#define TSI_CONFIG_MUTUAL_M_PMIRRORR(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_MUTUAL_M_PMIRRORR_SHIFT)) & TSI_CONFIG_MUTUAL_M_PMIRRORR_MASK) - -#define TSI_CONFIG_MUTUAL_M_PMIRRORL_MASK (0xE0U) -#define TSI_CONFIG_MUTUAL_M_PMIRRORL_SHIFT (5U) -/*! M_PMIRRORL - PMOS Current Mirror on Left Side - * 0b000..m = 4 - * 0b001..m = 8 - * 0b010..m = 12 - * 0b011..m = 16 - * 0b100..m = 20 - * 0b101..m = 24 - * 0b110..m = 28 - * 0b111..m = 32 - */ -#define TSI_CONFIG_MUTUAL_M_PMIRRORL(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_MUTUAL_M_PMIRRORL_SHIFT)) & TSI_CONFIG_MUTUAL_M_PMIRRORL_MASK) - -#define TSI_CONFIG_MUTUAL_M_SEL_RX_MASK (0x1F00U) -#define TSI_CONFIG_MUTUAL_M_SEL_RX_SHIFT (8U) -/*! M_SEL_RX - Mutual-Capacitance RX Channel Selection - * 0b00000..TSI[8] - * 0b00001..TSI[9] - * 0b00010..TSI[10] - * 0b00011..TSI[11] - * 0b00100..TSI[12] - * 0b00101..TSI[13] - * 0b00110..TSI[14] - * 0b00111..TSI[15] - * 0b01000..TSI[16] - * 0b01001..TSI[17] - * 0b01010..TSI[18] - * 0b01011..TSI[19] - * 0b01100..TSI[20] - * 0b01101..TSI[21] - * 0b01110..TSI[22] - * 0b01111..TSI[23] - * 0b10000..TSI[24] - */ -#define TSI_CONFIG_MUTUAL_M_SEL_RX(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_MUTUAL_M_SEL_RX_SHIFT)) & TSI_CONFIG_MUTUAL_M_SEL_RX_MASK) - -#define TSI_CONFIG_MUTUAL_M_SEL_TX_MASK (0xE000U) -#define TSI_CONFIG_MUTUAL_M_SEL_TX_SHIFT (13U) -/*! M_SEL_TX - Mutual-Capacitance TX Channel Selection - * 0b000..TSI[0] - * 0b001..TSI[1] - * 0b010..TSI[2] - * 0b011..TSI[3] - * 0b100..TSI[4] - * 0b101..TSI[5] - * 0b110..TSI[6] - * 0b111..TSI[7] - */ -#define TSI_CONFIG_MUTUAL_M_SEL_TX(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_MUTUAL_M_SEL_TX_SHIFT)) & TSI_CONFIG_MUTUAL_M_SEL_TX_MASK) - -#define TSI_CONFIG_MUTUAL_M_CNT_EN_MASK (0x10000U) -#define TSI_CONFIG_MUTUAL_M_CNT_EN_SHIFT (16U) -/*! M_CNT_EN - Mutual-Capacitance Counter Enable - * 0b0..Disables - * 0b1..Enables - */ -#define TSI_CONFIG_MUTUAL_M_CNT_EN(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_MUTUAL_M_CNT_EN_SHIFT)) & TSI_CONFIG_MUTUAL_M_CNT_EN_MASK) - -#define TSI_CONFIG_MUTUAL_M_TX_PD_EN_MASK (0x20000U) -#define TSI_CONFIG_MUTUAL_M_TX_PD_EN_SHIFT (17U) -/*! M_TX_PD_EN - Mutual-Capacitance TX Pulldown Enable - * 0b0..Disables - * 0b1..Enables - */ -#define TSI_CONFIG_MUTUAL_M_TX_PD_EN(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_MUTUAL_M_TX_PD_EN_SHIFT)) & TSI_CONFIG_MUTUAL_M_TX_PD_EN_MASK) - -#define TSI_CONFIG_MUTUAL_M_SEN_BOOST_MASK (0x7C0000U) -#define TSI_CONFIG_MUTUAL_M_SEN_BOOST_SHIFT (18U) -/*! M_SEN_BOOST - Mutual-Capacitance Sensitivity Boost - * 0b00000..0 uA - * 0b00001..2 uA - * 0b00010..4 uA - * 0b00011..6 uA - * 0b00100..8 uA - * 0b00101..10 uA - * 0b00110..12 uA - * 0b00111..14 uA - * 0b1xxxx..2 * n uA - * 0b11111..62 uA - */ -#define TSI_CONFIG_MUTUAL_M_SEN_BOOST(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_MUTUAL_M_SEN_BOOST_SHIFT)) & TSI_CONFIG_MUTUAL_M_SEN_BOOST_MASK) - -#define TSI_CONFIG_MUTUAL_M_PRE_RES_MASK (0x1C000000U) -#define TSI_CONFIG_MUTUAL_M_PRE_RES_SHIFT (26U) -/*! M_PRE_RES - Mutual-Capacitance Precharge Resistor - * 0b000..1 kΩ - * 0b001..2 kΩ - * 0b010..3 kΩ - * 0b011..4 kΩ - * 0b100..5 kΩ - * 0b101..6 kΩ - * 0b110..7 kΩ - * 0b111..8 kΩ - */ -#define TSI_CONFIG_MUTUAL_M_PRE_RES(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_MUTUAL_M_PRE_RES_SHIFT)) & TSI_CONFIG_MUTUAL_M_PRE_RES_MASK) - -#define TSI_CONFIG_MUTUAL_M_PRE_CURRENT_MASK (0xE0000000U) -#define TSI_CONFIG_MUTUAL_M_PRE_CURRENT_SHIFT (29U) -/*! M_PRE_CURRENT - Mutual-Capacitance Precharge Current - * 0b000..1 uA - * 0b001..2 uA - * 0b010..3 uA - * 0b011..4 uA - * 0b100..5 uA - * 0b101..6 uA - * 0b110..7 uA - * 0b111..8 uA - */ -#define TSI_CONFIG_MUTUAL_M_PRE_CURRENT(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_MUTUAL_M_PRE_CURRENT_SHIFT)) & TSI_CONFIG_MUTUAL_M_PRE_CURRENT_MASK) -/*! @} */ - -/*! @name CONFIG - TSI CONFIG (TSI_CONFIG) for Self-Capacitor */ -/*! @{ */ - -#define TSI_CONFIG_MODE_MASK (0x1U) -#define TSI_CONFIG_MODE_SHIFT (0U) -/*! MODE - Mode - * 0b0..Self capacitance - * 0b1..Mutual capacitance - */ -#define TSI_CONFIG_MODE(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_MODE_SHIFT)) & TSI_CONFIG_MODE_MASK) - -#define TSI_CONFIG_TSICH_MASK (0x3EU) -#define TSI_CONFIG_TSICH_SHIFT (1U) -/*! TSICH - TSI Channel - * 0b00000..Channel 0 - * 0b00001..Channel 1 - * 0b00010..Channel 2 - * 0b00011..Channel 3 - * 0b00100..Channel 4 - * 0b00101..Channel 5 - * 0b00110..Channel 6 - * 0b00111..Channel 7 - * 0b01000..Channel 8 - * 0b01001..Channel 9 - * 0b01010..Channel 10 - * 0b01011..Channel 11 - * 0b01100..Channel 12 - * 0b01101..Channel 13 - * 0b01110..Channel 14 - * 0b01111..Channel 15 - * 0b10000..Channel 16 - * 0b10001..Channel 17 - * 0b10010..Channel 18 - * 0b10011..Channel 19 - * 0b10100..Channel 20 - * 0b10101..Channel 21 - * 0b10110..Channel 22 - * 0b10111..Channel 23 - * 0b11000..Channel 24 - */ -#define TSI_CONFIG_TSICH(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_TSICH_SHIFT)) & TSI_CONFIG_TSICH_MASK) - -#define TSI_CONFIG_S_NOISE_MASK (0x80000U) -#define TSI_CONFIG_S_NOISE_SHIFT (19U) -/*! S_NOISE - Self-Capacitance Noise Cancelation - * 0b0..Disables - * 0b1..Enables - */ -#define TSI_CONFIG_S_NOISE(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_S_NOISE_SHIFT)) & TSI_CONFIG_S_NOISE_MASK) - -#define TSI_CONFIG_S_XCH_MASK (0x700000U) -#define TSI_CONFIG_S_XCH_SHIFT (20U) -/*! S_XCH - Self-Capacitance Charge Current Multiple - * 0b000..1 / 16 - * 0b001..1 / 8 - * 0b010..1 / 4 - * 0b011..1 / 2 - */ -#define TSI_CONFIG_S_XCH(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_S_XCH_SHIFT)) & TSI_CONFIG_S_XCH_MASK) - -#define TSI_CONFIG_S_XIN_MASK (0x800000U) -#define TSI_CONFIG_S_XIN_SHIFT (23U) -/*! S_XIN - Self-Capacitance Input Current Multiple - * 0b0..1 / 8 - * 0b1..1 / 4 - */ -#define TSI_CONFIG_S_XIN(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_S_XIN_SHIFT)) & TSI_CONFIG_S_XIN_MASK) - -#define TSI_CONFIG_S_CTRIM_MASK (0x7000000U) -#define TSI_CONFIG_S_CTRIM_SHIFT (24U) -/*! S_CTRIM - Capacitor Trim Setting - * 0b000..2.5 pF - * 0b001..5.0 pF - * 0b010..7.5 pF - * 0b011..10 pF - * 0b100..12.5 pF - * 0b101..15.0 pF - * 0b110..17.5 pF - * 0b111..20 pF - */ -#define TSI_CONFIG_S_CTRIM(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_S_CTRIM_SHIFT)) & TSI_CONFIG_S_CTRIM_MASK) - -#define TSI_CONFIG_S_SEN_MASK (0x8000000U) -#define TSI_CONFIG_S_SEN_SHIFT (27U) -/*! S_SEN - Self-Capacitance Sensitivity Boost - * 0b0..Disables - * 0b1..Enables - */ -#define TSI_CONFIG_S_SEN(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_S_SEN_SHIFT)) & TSI_CONFIG_S_SEN_MASK) - -#define TSI_CONFIG_S_XDN_MASK (0x70000000U) -#define TSI_CONFIG_S_XDN_SHIFT (28U) -/*! S_XDN - Self-Capacitance Discharge Current Multiple - * 0b000..1 / 16 - * 0b001..1 / 8 - * 0b010..1 / 4 - * 0b011..1 / 2 - */ -#define TSI_CONFIG_S_XDN(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_S_XDN_SHIFT)) & TSI_CONFIG_S_XDN_MASK) - -#define TSI_CONFIG_S_XIN_ADD_MASK (0x80000000U) -#define TSI_CONFIG_S_XIN_ADD_SHIFT (31U) -/*! S_XIN_ADD - S_XIN Adjust Ratio - * 0b0..Disables; S_XIN = 0 for 1 / 4, S_XIN = 1 for 1 / 8 - * 0b1..Enables; S_XIN = 0 for 1 / 8, S_XIN = 1 for 1 / 16 - */ -#define TSI_CONFIG_S_XIN_ADD(x) (((uint32_t)(((uint32_t)(x)) << TSI_CONFIG_S_XIN_ADD_SHIFT)) & TSI_CONFIG_S_XIN_ADD_MASK) -/*! @} */ - -/*! @name TSHD - TSI Threshold */ -/*! @{ */ - -#define TSI_TSHD_THRESL_MASK (0xFFFFU) -#define TSI_TSHD_THRESL_SHIFT (0U) -/*! THRESL - TSI Wakeup Channel Low Threshold */ -#define TSI_TSHD_THRESL(x) (((uint32_t)(((uint32_t)(x)) << TSI_TSHD_THRESL_SHIFT)) & TSI_TSHD_THRESL_MASK) - -#define TSI_TSHD_THRESH_MASK (0xFFFF0000U) -#define TSI_TSHD_THRESH_SHIFT (16U) -/*! THRESH - TSI Wakeup Channel High Threshold */ -#define TSI_TSHD_THRESH(x) (((uint32_t)(((uint32_t)(x)) << TSI_TSHD_THRESH_SHIFT)) & TSI_TSHD_THRESH_MASK) -/*! @} */ - -/*! @name GENCS - TSI General Control and Status */ -/*! @{ */ - -#define TSI_GENCS_DMAEN_EOS_MASK (0x1U) -#define TSI_GENCS_DMAEN_EOS_SHIFT (0U) -/*! DMAEN_EOS - In-Progress DMA Transfer Request Enable - * 0b0..Disables - * 0b1..Enables - */ -#define TSI_GENCS_DMAEN_EOS(x) (((uint32_t)(((uint32_t)(x)) << TSI_GENCS_DMAEN_EOS_SHIFT)) & TSI_GENCS_DMAEN_EOS_MASK) - -#define TSI_GENCS_DMAEN_OUTRG_MASK (0x4U) -#define TSI_GENCS_DMAEN_OUTRG_SHIFT (2U) -/*! DMAEN_OUTRG - Out-of-Range DMA Transfer Request Enable - * 0b0..Disables - * 0b1..Enables - */ -#define TSI_GENCS_DMAEN_OUTRG(x) (((uint32_t)(((uint32_t)(x)) << TSI_GENCS_DMAEN_OUTRG_SHIFT)) & TSI_GENCS_DMAEN_OUTRG_MASK) - -#define TSI_GENCS_STM_MASK (0x8U) -#define TSI_GENCS_STM_SHIFT (3U) -/*! STM - Scan Trigger Mode - * 0b0..Software trigger scan - * 0b1..Hardware trigger scan - */ -#define TSI_GENCS_STM(x) (((uint32_t)(((uint32_t)(x)) << TSI_GENCS_STM_SHIFT)) & TSI_GENCS_STM_MASK) - -#define TSI_GENCS_STPE_MASK (0x10U) -#define TSI_GENCS_STPE_SHIFT (4U) -/*! STPE - TSI Stop Enable - * 0b0..Disables - * 0b1..Enables - */ -#define TSI_GENCS_STPE(x) (((uint32_t)(((uint32_t)(x)) << TSI_GENCS_STPE_SHIFT)) & TSI_GENCS_STPE_MASK) - -#define TSI_GENCS_TSIEN_MASK (0x20U) -#define TSI_GENCS_TSIEN_SHIFT (5U) -/*! TSIEN - TSI Enable - * 0b0..Disables - * 0b1..Enables - */ -#define TSI_GENCS_TSIEN(x) (((uint32_t)(((uint32_t)(x)) << TSI_GENCS_TSIEN_SHIFT)) & TSI_GENCS_TSIEN_MASK) - -#define TSI_GENCS_SWTS_MASK (0x80U) -#define TSI_GENCS_SWTS_SHIFT (7U) -/*! SWTS - Software Trigger Start - * 0b0..No effect - * 0b1..Takes effect - */ -#define TSI_GENCS_SWTS(x) (((uint32_t)(((uint32_t)(x)) << TSI_GENCS_SWTS_SHIFT)) & TSI_GENCS_SWTS_MASK) - -#define TSI_GENCS_CTRIM_FINE_MASK (0xE00U) -#define TSI_GENCS_CTRIM_FINE_SHIFT (9U) -/*! CTRIM_FINE - Capacitor Fine Trim - * 0b000..0.3125 pF - * 0b001..0.625 pF - * 0b010..0.3125 * 3 pF - * 0b011..0.3125 * 4 pF - * 0b100..0.3125 * 5 pF - * 0b101..0.3125 * 6 pF - * 0b110..2.1875 pF - * 0b111..2.5 pF - */ -#define TSI_GENCS_CTRIM_FINE(x) (((uint32_t)(((uint32_t)(x)) << TSI_GENCS_CTRIM_FINE_SHIFT)) & TSI_GENCS_CTRIM_FINE_MASK) - -#define TSI_GENCS_DVOLT_MASK (0x7000U) -#define TSI_GENCS_DVOLT_SHIFT (12U) -/*! DVOLT - Delta Voltage - * 0b000..Vm = 0.6 V, Vp = 1.7 V - * 0b001..Vm = 0.6 V, Vp = 1.9 V - * 0b010..Vm = 0.6 V, Vp = 2.1 V - * 0b011..Vm = 0.6 V, Vp = 2.3 V - * 0b100..Vm = 0.6 V, Vp = 2.5 V - * 0b101..Vm = 0.6 V, Vp = 2.7 V - */ -#define TSI_GENCS_DVOLT(x) (((uint32_t)(((uint32_t)(x)) << TSI_GENCS_DVOLT_SHIFT)) & TSI_GENCS_DVOLT_MASK) - -#define TSI_GENCS_DEBOUNCE_MASK (0x1F0000U) -#define TSI_GENCS_DEBOUNCE_SHIFT (16U) -/*! DEBOUNCE - Debounce - * 0b00000..1 - * 0b00001..2 - * 0b1xxxx..n - * 0b11111..31 - */ -#define TSI_GENCS_DEBOUNCE(x) (((uint32_t)(((uint32_t)(x)) << TSI_GENCS_DEBOUNCE_SHIFT)) & TSI_GENCS_DEBOUNCE_MASK) - -#define TSI_GENCS_S_PROX_EN_MASK (0x400000U) -#define TSI_GENCS_S_PROX_EN_SHIFT (22U) -/*! S_PROX_EN - Proximity Enable Signal - * 0b0..Disables - * 0b1..Enables - */ -#define TSI_GENCS_S_PROX_EN(x) (((uint32_t)(((uint32_t)(x)) << TSI_GENCS_S_PROX_EN_SHIFT)) & TSI_GENCS_S_PROX_EN_MASK) - -#define TSI_GENCS_SETCLK_MASK (0x7000000U) -#define TSI_GENCS_SETCLK_SHIFT (24U) -/*! SETCLK - Set Clock - * 0b000..27.37 MHz - * 0b001..22.23 MHz - * 0b010..18.73 MHz - * 0b011..16.65 MHz - * 0b100..14.27 MHz - * 0b101..12.73 MHz - * 0b110..11.49 MHz - * 0b111..10.46 MHz - */ -#define TSI_GENCS_SETCLK(x) (((uint32_t)(((uint32_t)(x)) << TSI_GENCS_SETCLK_SHIFT)) & TSI_GENCS_SETCLK_MASK) - -#define TSI_GENCS_ESOR_MASK (0x8000000U) -#define TSI_GENCS_ESOR_SHIFT (27U) -/*! ESOR - End-of-Scan Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define TSI_GENCS_ESOR(x) (((uint32_t)(((uint32_t)(x)) << TSI_GENCS_ESOR_SHIFT)) & TSI_GENCS_ESOR_MASK) - -#define TSI_GENCS_OUTRG_EN_MASK (0x40000000U) -#define TSI_GENCS_OUTRG_EN_SHIFT (30U) -/*! OUTRG_EN - Out-of-Range Interrupt Enable - * 0b0..Disables - * 0b1..Enables - */ -#define TSI_GENCS_OUTRG_EN(x) (((uint32_t)(((uint32_t)(x)) << TSI_GENCS_OUTRG_EN_SHIFT)) & TSI_GENCS_OUTRG_EN_MASK) -/*! @} */ - -/*! @name MUL - TSI Mutual-Capacitance */ -/*! @{ */ - -#define TSI_MUL_M_VPRE_CHOOSE_MASK (0x2U) -#define TSI_MUL_M_VPRE_CHOOSE_SHIFT (1U) -/*! M_VPRE_CHOOSE - Mutual-Capacitance Prevoltage - * 0b0..Internal 1.2 V - * 0b1..External 1.2 V from PMC - */ -#define TSI_MUL_M_VPRE_CHOOSE(x) (((uint32_t)(((uint32_t)(x)) << TSI_MUL_M_VPRE_CHOOSE_SHIFT)) & TSI_MUL_M_VPRE_CHOOSE_MASK) - -#define TSI_MUL_M_MODE_MASK (0x4U) -#define TSI_MUL_M_MODE_SHIFT (2U) -/*! M_MODE - Mutual-Capacitance Mode - * 0b0..- 5 V ~ + 5 V - * 0b1..0 V ~ + 5 V - */ -#define TSI_MUL_M_MODE(x) (((uint32_t)(((uint32_t)(x)) << TSI_MUL_M_MODE_SHIFT)) & TSI_MUL_M_MODE_MASK) - -#define TSI_MUL_M_TRIM_CAP_MASK (0x18U) -#define TSI_MUL_M_TRIM_CAP_SHIFT (3U) -/*! M_TRIM_CAP - Mutual-Capacitance Trim Cap - * 0b00..0 pF - * 0b01..10 pF - * 0b10..10 pF - * 0b11..20 pF - */ -#define TSI_MUL_M_TRIM_CAP(x) (((uint32_t)(((uint32_t)(x)) << TSI_MUL_M_TRIM_CAP_SHIFT)) & TSI_MUL_M_TRIM_CAP_MASK) - -#define TSI_MUL_M_TX_USED_MASK (0x1FE0U) -#define TSI_MUL_M_TX_USED_SHIFT (5U) -/*! M_TX_USED - Mutual-Capacitance TX Used - * 0b00000000..GPIO - * 0b00000001..Mutual capacitance - */ -#define TSI_MUL_M_TX_USED(x) (((uint32_t)(((uint32_t)(x)) << TSI_MUL_M_TX_USED_SHIFT)) & TSI_MUL_M_TX_USED_MASK) - -#define TSI_MUL_M_TRIM_MASK (0xFFFF0000U) -#define TSI_MUL_M_TRIM_SHIFT (16U) -/*! M_TRIM - Mutual-Capacitance Trim */ -#define TSI_MUL_M_TRIM(x) (((uint32_t)(((uint32_t)(x)) << TSI_MUL_M_TRIM_SHIFT)) & TSI_MUL_M_TRIM_MASK) -/*! @} */ - -/*! @name SINC - TSI SINC Filter */ -/*! @{ */ - -#define TSI_SINC_SSC_CONTROL_OUT_MASK (0x1U) -#define TSI_SINC_SSC_CONTROL_OUT_SHIFT (0U) -/*! SSC_CONTROL_OUT - SSC Output Control - * 0b0..0 - * 0b1..1 - */ -#define TSI_SINC_SSC_CONTROL_OUT(x) (((uint32_t)(((uint32_t)(x)) << TSI_SINC_SSC_CONTROL_OUT_SHIFT)) & TSI_SINC_SSC_CONTROL_OUT_MASK) - -#define TSI_SINC_SINC_VALID_MASK (0x2U) -#define TSI_SINC_SINC_VALID_SHIFT (1U) -/*! SINC_VALID - SINC Valid - * 0b0..Disabled - * 0b1..Enabled - */ -#define TSI_SINC_SINC_VALID(x) (((uint32_t)(((uint32_t)(x)) << TSI_SINC_SINC_VALID_SHIFT)) & TSI_SINC_SINC_VALID_MASK) - -#define TSI_SINC_SINC_OVERFLOW_FLAG_MASK (0x4U) -#define TSI_SINC_SINC_OVERFLOW_FLAG_SHIFT (2U) -/*! SINC_OVERFLOW_FLAG - SINC Overflow Flag - * 0b0..No overflow - * 0b1..Overflow - */ -#define TSI_SINC_SINC_OVERFLOW_FLAG(x) (((uint32_t)(((uint32_t)(x)) << TSI_SINC_SINC_OVERFLOW_FLAG_SHIFT)) & TSI_SINC_SINC_OVERFLOW_FLAG_MASK) - -#define TSI_SINC_SWITCH_ENABLE_MASK (0x8U) -#define TSI_SINC_SWITCH_ENABLE_SHIFT (3U) -/*! SWITCH_ENABLE - Switch Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define TSI_SINC_SWITCH_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << TSI_SINC_SWITCH_ENABLE_SHIFT)) & TSI_SINC_SWITCH_ENABLE_MASK) - -#define TSI_SINC_DECIMATION_MASK (0x1F0000U) -#define TSI_SINC_DECIMATION_SHIFT (16U) -/*! DECIMATION - Decimation - * 0b00000..1 - * 0b00001..2 - * 0b00010..3 - * 0b00011..4 - * 0b00100..5 - * 0b00101..6 - * 0b00110..7 - * 0b00111..8 - * 0b01000..9 - * 0b01001..10 - * 0b01010..11 - * 0b01011..12 - * 0b01100..13 - * 0b01101..14 - * 0b01110..15 - * 0b01111..16 - * 0b10000..17 - * 0b10001..18 - * 0b10010..19 - * 0b10011..20 - * 0b10100..21 - * 0b10101..22 - * 0b10110..23 - * 0b10111..24 - * 0b11000..25 - * 0b11001..26 - * 0b11010..27 - * 0b11011..28 - * 0b11100..29 - * 0b11101..30 - * 0b11110..31 - * 0b11111..32 - */ -#define TSI_SINC_DECIMATION(x) (((uint32_t)(((uint32_t)(x)) << TSI_SINC_DECIMATION_SHIFT)) & TSI_SINC_DECIMATION_MASK) - -#define TSI_SINC_ORDER_MASK (0x200000U) -#define TSI_SINC_ORDER_SHIFT (21U) -/*! ORDER - Order - * 0b0..Order 1 - * 0b1..Order 2 - */ -#define TSI_SINC_ORDER(x) (((uint32_t)(((uint32_t)(x)) << TSI_SINC_ORDER_SHIFT)) & TSI_SINC_ORDER_MASK) - -#define TSI_SINC_CUTOFF_MASK (0xF000000U) -#define TSI_SINC_CUTOFF_SHIFT (24U) -/*! CUTOFF - Cutoff - * 0b0000..div = 1 - * 0b0001..div = 2 - * 0b0010..div = 4 - * 0b0011..div = 8 - * 0b0100..div = 16 - * 0b0101..div = 32 - * 0b0110..div = 64 - * 0b0111..div = 128 - * 0b1000..Do not use - * 0b1001..Do not use - * 0b1010..Do not use - * 0b1011..Do not use - * 0b1100..Do not use - * 0b1101..Do not use - * 0b1110..Do not use - * 0b1111..Do not use - */ -#define TSI_SINC_CUTOFF(x) (((uint32_t)(((uint32_t)(x)) << TSI_SINC_CUTOFF_SHIFT)) & TSI_SINC_CUTOFF_MASK) -/*! @} */ - -/*! @name SSC0 - TSI SSC 0 */ -/*! @{ */ - -#define TSI_SSC0_SSC_PRESCALE_NUM_MASK (0xFFU) -#define TSI_SSC0_SSC_PRESCALE_NUM_SHIFT (0U) -/*! SSC_PRESCALE_NUM - SSC Prescale Number - * 0b00000000..div = 1 - * 0b00000001..div = 2 - * 0b00000011..div = 4 - * 0b00000111..div = 8 - * 0b00001111..div = 16 - * 0b00011111..div = 32 - * 0b00111111..div = 64 - * 0b01111111..div = 128 - * 0b11111111..div = 256 - */ -#define TSI_SSC0_SSC_PRESCALE_NUM(x) (((uint32_t)(((uint32_t)(x)) << TSI_SSC0_SSC_PRESCALE_NUM_SHIFT)) & TSI_SSC0_SSC_PRESCALE_NUM_MASK) - -#define TSI_SSC0_BASE_NOCHARGE_NUM_MASK (0xF0000U) -#define TSI_SSC0_BASE_NOCHARGE_NUM_SHIFT (16U) -/*! BASE_NOCHARGE_NUM - Base Nocharge Number - * 0b0000..1 - * 0b0001..2 - * 0b0010..3 - * 0b0011..4 - * 0b0100..5 - * 0b0101..6 - * 0b0110..7 - * 0b0111..8 - * 0b1000..9 - * 0b1001..10 - * 0b1010..11 - * 0b1011..12 - * 0b1100..13 - * 0b1101..14 - * 0b1110..15 - * 0b1111..16 - */ -#define TSI_SSC0_BASE_NOCHARGE_NUM(x) (((uint32_t)(((uint32_t)(x)) << TSI_SSC0_BASE_NOCHARGE_NUM_SHIFT)) & TSI_SSC0_BASE_NOCHARGE_NUM_MASK) - -#define TSI_SSC0_CHARGE_NUM_MASK (0xF00000U) -#define TSI_SSC0_CHARGE_NUM_SHIFT (20U) -/*! CHARGE_NUM - Charge Number - * 0b0000..1 - * 0b0001..2 - * 0b0010..3 - * 0b0011..4 - * 0b0100..5 - * 0b0101..6 - * 0b0110..7 - * 0b0111..8 - * 0b1000..9 - * 0b1001..10 - * 0b1010..11 - * 0b1011..12 - * 0b1100..13 - * 0b1101..14 - * 0b1110..15 - * 0b1111..16 - */ -#define TSI_SSC0_CHARGE_NUM(x) (((uint32_t)(((uint32_t)(x)) << TSI_SSC0_CHARGE_NUM_SHIFT)) & TSI_SSC0_CHARGE_NUM_MASK) - -#define TSI_SSC0_SSC_CONTROL_REVERSE_MASK (0x1000000U) -#define TSI_SSC0_SSC_CONTROL_REVERSE_SHIFT (24U) -/*! SSC_CONTROL_REVERSE - SSC Control Reverse - * 0b0..Polarity retained - * 0b1..Polarity reversed - */ -#define TSI_SSC0_SSC_CONTROL_REVERSE(x) (((uint32_t)(((uint32_t)(x)) << TSI_SSC0_SSC_CONTROL_REVERSE_SHIFT)) & TSI_SSC0_SSC_CONTROL_REVERSE_MASK) - -#define TSI_SSC0_SSC_MODE_MASK (0x6000000U) -#define TSI_SSC0_SSC_MODE_SHIFT (25U) -/*! SSC_MODE - SSC Mode - * 0b00..PRBS mode - * 0b01..Up-Down Counter mode - * 0b10..Disables SSC function - * 0b11..Do not use - */ -#define TSI_SSC0_SSC_MODE(x) (((uint32_t)(((uint32_t)(x)) << TSI_SSC0_SSC_MODE_SHIFT)) & TSI_SSC0_SSC_MODE_MASK) - -#define TSI_SSC0_PRBS_OUTSEL_MASK (0xF0000000U) -#define TSI_SSC0_PRBS_OUTSEL_SHIFT (28U) -/*! PRBS_OUTSEL - PRBS Output Selection - * 0b0000..Do not use - * 0b0001..Do not use - * 0b0010..2 - * 0b0011..3 - * 0b0100..4 - * 0b0101..5 - * 0b0110..6 - * 0b0111..7 - * 0b1000..8 - * 0b1001..9 - * 0b1010..10 - * 0b1011..11 - * 0b1100..12 - * 0b1101..13 - * 0b1110..14 - * 0b1111..15 - */ -#define TSI_SSC0_PRBS_OUTSEL(x) (((uint32_t)(((uint32_t)(x)) << TSI_SSC0_PRBS_OUTSEL_SHIFT)) & TSI_SSC0_PRBS_OUTSEL_MASK) -/*! @} */ - -/*! @name SSC1 - TSI SSC 1 */ -/*! @{ */ - -#define TSI_SSC1_PRBS_SEED_LO_MASK (0xFFU) -#define TSI_SSC1_PRBS_SEED_LO_SHIFT (0U) -/*! PRBS_SEED_LO - PRBS Low Seed */ -#define TSI_SSC1_PRBS_SEED_LO(x) (((uint32_t)(((uint32_t)(x)) << TSI_SSC1_PRBS_SEED_LO_SHIFT)) & TSI_SSC1_PRBS_SEED_LO_MASK) - -#define TSI_SSC1_PRBS_SEED_HI_MASK (0xFF00U) -#define TSI_SSC1_PRBS_SEED_HI_SHIFT (8U) -/*! PRBS_SEED_HI - PRBS High Seed */ -#define TSI_SSC1_PRBS_SEED_HI(x) (((uint32_t)(((uint32_t)(x)) << TSI_SSC1_PRBS_SEED_HI_SHIFT)) & TSI_SSC1_PRBS_SEED_HI_MASK) - -#define TSI_SSC1_PRBS_WEIGHT_LO_MASK (0xFF0000U) -#define TSI_SSC1_PRBS_WEIGHT_LO_SHIFT (16U) -/*! PRBS_WEIGHT_LO - PRBS Low Weight */ -#define TSI_SSC1_PRBS_WEIGHT_LO(x) (((uint32_t)(((uint32_t)(x)) << TSI_SSC1_PRBS_WEIGHT_LO_SHIFT)) & TSI_SSC1_PRBS_WEIGHT_LO_MASK) - -#define TSI_SSC1_PRBS_WEIGHT_HI_MASK (0xFF000000U) -#define TSI_SSC1_PRBS_WEIGHT_HI_SHIFT (24U) -/*! PRBS_WEIGHT_HI - PRBS High Weight */ -#define TSI_SSC1_PRBS_WEIGHT_HI(x) (((uint32_t)(((uint32_t)(x)) << TSI_SSC1_PRBS_WEIGHT_HI_SHIFT)) & TSI_SSC1_PRBS_WEIGHT_HI_MASK) -/*! @} */ - -/*! @name SSC2 - TSI SSC 2 */ -/*! @{ */ - -#define TSI_SSC2_MOVE_REPEAT_NUM_MASK (0x1FU) -#define TSI_SSC2_MOVE_REPEAT_NUM_SHIFT (0U) -/*! MOVE_REPEAT_NUM - Move Repeat Number - * 0b00000..1 - * 0b00001..2 - * 0b00010..3 - * 0b00011..4 - * 0b00100..5 - * 0b00101..6 - * 0b00110..7 - */ -#define TSI_SSC2_MOVE_REPEAT_NUM(x) (((uint32_t)(((uint32_t)(x)) << TSI_SSC2_MOVE_REPEAT_NUM_SHIFT)) & TSI_SSC2_MOVE_REPEAT_NUM_MASK) - -#define TSI_SSC2_MOVE_STEPS_NUM_MASK (0x700U) -#define TSI_SSC2_MOVE_STEPS_NUM_SHIFT (8U) -/*! MOVE_STEPS_NUM - Move Steps Number - * 0b000..0 - * 0b001..1 - * 0b010..2 - * 0b011..3 - * 0b100..4 - * 0b101..5 - * 0b110..6 - * 0b111..7 - */ -#define TSI_SSC2_MOVE_STEPS_NUM(x) (((uint32_t)(((uint32_t)(x)) << TSI_SSC2_MOVE_STEPS_NUM_SHIFT)) & TSI_SSC2_MOVE_STEPS_NUM_MASK) - -#define TSI_SSC2_MOVE_NOCHARGE_MAX_MASK (0x3F0000U) -#define TSI_SSC2_MOVE_NOCHARGE_MAX_SHIFT (16U) -/*! MOVE_NOCHARGE_MAX - Move Nocharge Maximum */ -#define TSI_SSC2_MOVE_NOCHARGE_MAX(x) (((uint32_t)(((uint32_t)(x)) << TSI_SSC2_MOVE_NOCHARGE_MAX_SHIFT)) & TSI_SSC2_MOVE_NOCHARGE_MAX_MASK) - -#define TSI_SSC2_MOVE_NOCHARGE_MIN_MASK (0xF0000000U) -#define TSI_SSC2_MOVE_NOCHARGE_MIN_SHIFT (28U) -/*! MOVE_NOCHARGE_MIN - Move Nocharge Minimum - * 0b0000..(1 + SSC0[BASE_NOCHARGE_NUM]) - * 0b0001..(2 + SSC0[BASE_NOCHARGE_NUM]) - * 0b0010..(3 + SSC0[BASE_NOCHARGE_NUM]) - * 0b0011..(4 + SSC0[BASE_NOCHARGE_NUM]) - * 0b0100..(5 + SSC0[BASE_NOCHARGE_NUM]) - * 0b0101..(6 + SSC0[BASE_NOCHARGE_NUM]) - * 0b0110..(7 + SSC0[BASE_NOCHARGE_NUM]) - * 0b0111..(8 + SSC0[BASE_NOCHARGE_NUM]) - * 0b1000..(9 + SSC0[BASE_NOCHARGE_NUM]) - * 0b1001..(10 + SSC0[BASE_NOCHARGE_NUM]) - * 0b1010..(11 + SSC0[BASE_NOCHARGE_NUM]) - * 0b1011..(12 + SSC0[BASE_NOCHARGE_NUM]) - * 0b1100..(13 + SSC0[BASE_NOCHARGE_NUM]) - * 0b1101..(14 + SSC0[BASE_NOCHARGE_NUM]) - * 0b1110..(15 + SSC0[BASE_NOCHARGE_NUM]) - * 0b1111..(16 + SSC0[BASE_NOCHARGE_NUM]) - */ -#define TSI_SSC2_MOVE_NOCHARGE_MIN(x) (((uint32_t)(((uint32_t)(x)) << TSI_SSC2_MOVE_NOCHARGE_MIN_SHIFT)) & TSI_SSC2_MOVE_NOCHARGE_MIN_MASK) -/*! @} */ - -/*! @name BASELINE - TSI Baseline */ -/*! @{ */ - -#define TSI_BASELINE_BASELINE_MASK (0xFFFFU) -#define TSI_BASELINE_BASELINE_SHIFT (0U) -/*! BASELINE - Baseline */ -#define TSI_BASELINE_BASELINE(x) (((uint32_t)(((uint32_t)(x)) << TSI_BASELINE_BASELINE_SHIFT)) & TSI_BASELINE_BASELINE_MASK) - -#define TSI_BASELINE_BASE_TRACE_DEBOUNCE_MASK (0xF0000U) -#define TSI_BASELINE_BASE_TRACE_DEBOUNCE_SHIFT (16U) -/*! BASE_TRACE_DEBOUNCE - Base Trace Debounce - * 0b0000..0 - * 0b0001..1 / 16 - * 0b0010..2 / 16 - * 0b0011..3 / 16 - * 0b1xxx..n / 16 - * 0b1111..15 / 16 - */ -#define TSI_BASELINE_BASE_TRACE_DEBOUNCE(x) (((uint32_t)(((uint32_t)(x)) << TSI_BASELINE_BASE_TRACE_DEBOUNCE_SHIFT)) & TSI_BASELINE_BASE_TRACE_DEBOUNCE_MASK) - -#define TSI_BASELINE_BASE_TRACE_EN_MASK (0x100000U) -#define TSI_BASELINE_BASE_TRACE_EN_SHIFT (20U) -/*! BASE_TRACE_EN - Baseline Trace Enable */ -#define TSI_BASELINE_BASE_TRACE_EN(x) (((uint32_t)(((uint32_t)(x)) << TSI_BASELINE_BASE_TRACE_EN_SHIFT)) & TSI_BASELINE_BASE_TRACE_EN_MASK) - -#define TSI_BASELINE_THESHOLD_RATIO_MASK (0x70000000U) -#define TSI_BASELINE_THESHOLD_RATIO_SHIFT (28U) -/*! THESHOLD_RATIO - Threshold Ratio - * 0b000..thresholdh = (baseline + counter) / 2 and thresholdl = (baseline - counter) / 2 - * 0b001..thresholdh = (baseline + counter) / 4 and thresholdl = (baseline - counter) / 4 - * 0b010..thresholdh = (baseline + counter) / 8 and thresholdl = (baseline - counter) / 8 - * 0b011..thresholdh = (baseline + counter) / 16 and thresholdl = (baseline - counter) / 16 - * 0b100..thresholdh = (baseline + counter) / 32 and thresholdl = (baseline - counter) / 32 - * 0b101..thresholdh = (baseline + counter) / 64 and thresholdl = (baseline - counter) / 64 - * 0b110..thresholdh = (baseline + counter) / 128 and thresholdl = (baseline - counter) / 128 - * 0b111..thresholdh = (baseline + counter) / 256 and thresholdl = (baseline - counter) / 256 - */ -#define TSI_BASELINE_THESHOLD_RATIO(x) (((uint32_t)(((uint32_t)(x)) << TSI_BASELINE_THESHOLD_RATIO_SHIFT)) & TSI_BASELINE_THESHOLD_RATIO_MASK) - -#define TSI_BASELINE_THRESHOLD_TRACE_EN_MASK (0x80000000U) -#define TSI_BASELINE_THRESHOLD_TRACE_EN_SHIFT (31U) -/*! THRESHOLD_TRACE_EN - Threshold Trace Enable - * 0b0..Disables - * 0b1..Enables - */ -#define TSI_BASELINE_THRESHOLD_TRACE_EN(x) (((uint32_t)(((uint32_t)(x)) << TSI_BASELINE_THRESHOLD_TRACE_EN_SHIFT)) & TSI_BASELINE_THRESHOLD_TRACE_EN_MASK) -/*! @} */ - -/*! @name CHMERGE - TSI Channel Merge */ -/*! @{ */ - -#define TSI_CHMERGE_CHANNEL_ENABLE_MASK (0x1FFFFFFU) -#define TSI_CHMERGE_CHANNEL_ENABLE_SHIFT (0U) -/*! CHANNEL_ENABLE - Channel Enable - * 0b0000000000000000000000000..Channel not chosen for proximity pad - * 0b0000000000000000000000001..Channel chosen for proximity pad - */ -#define TSI_CHMERGE_CHANNEL_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << TSI_CHMERGE_CHANNEL_ENABLE_SHIFT)) & TSI_CHMERGE_CHANNEL_ENABLE_MASK) -/*! @} */ - -/*! @name SHIELD - TSI Shield */ -/*! @{ */ - -#define TSI_SHIELD_SHIELD_ENABLE_MASK (0xFU) -#define TSI_SHIELD_SHIELD_ENABLE_SHIFT (0U) -/*! SHIELD_ENABLE - Shield Enable - * 0b0000..Disables - * 0b0001..Enables - */ -#define TSI_SHIELD_SHIELD_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << TSI_SHIELD_SHIELD_ENABLE_SHIFT)) & TSI_SHIELD_SHIELD_ENABLE_MASK) - -#define TSI_SHIELD_M_SEN_RES_MASK (0x7E000000U) -#define TSI_SHIELD_M_SEN_RES_SHIFT (25U) -/*! M_SEN_RES - Mutual-Capacitance Sensitivity Resistor - * 0b000000..10 kΩ - * 0b000001..10 kΩ + (2.5 / 3) kΩ (just for auto-calibration) - * 0b000010..12.5 kΩ (default) - * 0b001110..25 kΩ - */ -#define TSI_SHIELD_M_SEN_RES(x) (((uint32_t)(((uint32_t)(x)) << TSI_SHIELD_M_SEN_RES_SHIFT)) & TSI_SHIELD_M_SEN_RES_MASK) -/*! @} */ - -/*! @name DATA - TSI Data and Status */ -/*! @{ */ - -#define TSI_DATA_TSICNT_MASK (0xFFFFU) -#define TSI_DATA_TSICNT_SHIFT (0U) -/*! TSICNT - TSI Conversion Counter Value */ -#define TSI_DATA_TSICNT(x) (((uint32_t)(((uint32_t)(x)) << TSI_DATA_TSICNT_SHIFT)) & TSI_DATA_TSICNT_MASK) - -#define TSI_DATA_EOSF_MASK (0x8000000U) -#define TSI_DATA_EOSF_SHIFT (27U) -/*! EOSF - End-of-Scan Flag */ -#define TSI_DATA_EOSF(x) (((uint32_t)(((uint32_t)(x)) << TSI_DATA_EOSF_SHIFT)) & TSI_DATA_EOSF_MASK) - -#define TSI_DATA_OVERRUNF_MASK (0x20000000U) -#define TSI_DATA_OVERRUNF_SHIFT (29U) -/*! OVERRUNF - Overrun Flag - * 0b0..No - * 0b1..Yes - */ -#define TSI_DATA_OVERRUNF(x) (((uint32_t)(((uint32_t)(x)) << TSI_DATA_OVERRUNF_SHIFT)) & TSI_DATA_OVERRUNF_MASK) - -#define TSI_DATA_OUTRGF_MASK (0x40000000U) -#define TSI_DATA_OUTRGF_SHIFT (30U) -/*! OUTRGF - Out-of-Range Flag */ -#define TSI_DATA_OUTRGF(x) (((uint32_t)(((uint32_t)(x)) << TSI_DATA_OUTRGF_SHIFT)) & TSI_DATA_OUTRGF_MASK) -/*! @} */ - -/*! @name MISC - TSI Miscellaneous */ -/*! @{ */ - -#define TSI_MISC_OSC_CLK_SEL_MASK (0x80000U) -#define TSI_MISC_OSC_CLK_SEL_SHIFT (19U) -/*! OSC_CLK_SEL - Oscillator Clock Select - * 0b0..Analog oscillator - * 0b1..Chip - */ -#define TSI_MISC_OSC_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << TSI_MISC_OSC_CLK_SEL_SHIFT)) & TSI_MISC_OSC_CLK_SEL_MASK) - -#define TSI_MISC_TEST_FINGER_MASK (0x700000U) -#define TSI_MISC_TEST_FINGER_SHIFT (20U) -/*! TEST_FINGER - Test Finger - * 0b000..Finger capacitor is 148 pF - * 0b001..Finger capacitor is 296 pF - * 0b010..Finger capacitor is 444 pF - * 0b011..Finger capacitor is 592 pF - * 0b100..Finger capacitor is 740 pF - * 0b101..Finger capacitor is 888 pF - * 0b110..Finger capacitor is 1036 pF - * 0b111..Finger capacitor is 1184 pF - */ -#define TSI_MISC_TEST_FINGER(x) (((uint32_t)(((uint32_t)(x)) << TSI_MISC_TEST_FINGER_SHIFT)) & TSI_MISC_TEST_FINGER_MASK) - -#define TSI_MISC_TEST_FINGER_EN_MASK (0x800000U) -#define TSI_MISC_TEST_FINGER_EN_SHIFT (23U) -/*! TEST_FINGER_EN - Test Finger Function Enable Signals - * 0b0..Disables - * 0b1..Enables - */ -#define TSI_MISC_TEST_FINGER_EN(x) (((uint32_t)(((uint32_t)(x)) << TSI_MISC_TEST_FINGER_EN_SHIFT)) & TSI_MISC_TEST_FINGER_EN_MASK) - -#define TSI_MISC_CLKDIVIDER_MASK (0x1F000000U) -#define TSI_MISC_CLKDIVIDER_SHIFT (24U) -/*! CLKDIVIDER - TSI Clock Divider */ -#define TSI_MISC_CLKDIVIDER(x) (((uint32_t)(((uint32_t)(x)) << TSI_MISC_CLKDIVIDER_SHIFT)) & TSI_MISC_CLKDIVIDER_MASK) -/*! @} */ - -/*! @name TRIG - TSI AUTO TRIG */ -/*! @{ */ - -#define TSI_TRIG_TRIG_PERIOD_COUNTER_MASK (0xFFFFFU) -#define TSI_TRIG_TRIG_PERIOD_COUNTER_SHIFT (0U) -/*! TRIG_PERIOD_COUNTER - Trigger Period Counter */ -#define TSI_TRIG_TRIG_PERIOD_COUNTER(x) (((uint32_t)(((uint32_t)(x)) << TSI_TRIG_TRIG_PERIOD_COUNTER_SHIFT)) & TSI_TRIG_TRIG_PERIOD_COUNTER_MASK) - -#define TSI_TRIG_TRIG_CLK_DIVIDER_MASK (0x1F000000U) -#define TSI_TRIG_TRIG_CLK_DIVIDER_SHIFT (24U) -/*! TRIG_CLK_DIVIDER - Trigger Clock Divider - * 0b00000..No divider - * 0b00001..Divided by 2 - * 0b00010..Divided by 3 - * 0b00011..Divided by 4 - * 0b1xxxx..Divided by n - */ -#define TSI_TRIG_TRIG_CLK_DIVIDER(x) (((uint32_t)(((uint32_t)(x)) << TSI_TRIG_TRIG_CLK_DIVIDER_SHIFT)) & TSI_TRIG_TRIG_CLK_DIVIDER_MASK) - -#define TSI_TRIG_TRIG_EN_MASK (0x40000000U) -#define TSI_TRIG_TRIG_EN_SHIFT (30U) -/*! TRIG_EN - Trigger Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define TSI_TRIG_TRIG_EN(x) (((uint32_t)(((uint32_t)(x)) << TSI_TRIG_TRIG_EN_SHIFT)) & TSI_TRIG_TRIG_EN_MASK) - -#define TSI_TRIG_TRIG_CLK_SEL_MASK (0x80000000U) -#define TSI_TRIG_TRIG_CLK_SEL_SHIFT (31U) -/*! TRIG_CLK_SEL - Trigger Clock Select - * 0b0..32 k clock - * 0b1..clksoc - */ -#define TSI_TRIG_TRIG_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << TSI_TRIG_TRIG_CLK_SEL_SHIFT)) & TSI_TRIG_TRIG_CLK_SEL_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group TSI_Register_Masks */ - - -/* TSI - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral TSI0 base address */ - #define TSI0_BASE (0x50050000u) - /** Peripheral TSI0 base address */ - #define TSI0_BASE_NS (0x40050000u) - /** Peripheral TSI0 base pointer */ - #define TSI0 ((TSI_Type *)TSI0_BASE) - /** Peripheral TSI0 base pointer */ - #define TSI0_NS ((TSI_Type *)TSI0_BASE_NS) - /** Array initializer of TSI peripheral base addresses */ - #define TSI_BASE_ADDRS { TSI0_BASE } - /** Array initializer of TSI peripheral base pointers */ - #define TSI_BASE_PTRS { TSI0 } - /** Array initializer of TSI peripheral base addresses */ - #define TSI_BASE_ADDRS_NS { TSI0_BASE_NS } - /** Array initializer of TSI peripheral base pointers */ - #define TSI_BASE_PTRS_NS { TSI0_NS } -#else - /** Peripheral TSI0 base address */ - #define TSI0_BASE (0x40050000u) - /** Peripheral TSI0 base pointer */ - #define TSI0 ((TSI_Type *)TSI0_BASE) - /** Array initializer of TSI peripheral base addresses */ - #define TSI_BASE_ADDRS { TSI0_BASE } - /** Array initializer of TSI peripheral base pointers */ - #define TSI_BASE_PTRS { TSI0 } -#endif - -/*! - * @} - */ /* end of group TSI_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- USB Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USB_Peripheral_Access_Layer USB Peripheral Access Layer - * @{ - */ - -/** USB - Register Layout Typedef */ -typedef struct { - __I uint8_t PERID; /**< Peripheral ID, offset: 0x0 */ - uint8_t RESERVED_0[3]; - __I uint8_t IDCOMP; /**< Peripheral ID Complement, offset: 0x4 */ - uint8_t RESERVED_1[3]; - __I uint8_t REV; /**< Peripheral Revision, offset: 0x8 */ - uint8_t RESERVED_2[3]; - __I uint8_t ADDINFO; /**< Peripheral Additional Information, offset: 0xC */ - uint8_t RESERVED_3[3]; - __IO uint8_t OTGISTAT; /**< OTG Interrupt Status, offset: 0x10 */ - uint8_t RESERVED_4[3]; - __IO uint8_t OTGICR; /**< OTG Interrupt Control, offset: 0x14 */ - uint8_t RESERVED_5[3]; - __I uint8_t OTGSTAT; /**< OTG Status, offset: 0x18 */ - uint8_t RESERVED_6[3]; - __IO uint8_t OTGCTL; /**< OTG Control, offset: 0x1C */ - uint8_t RESERVED_7[99]; - __IO uint8_t ISTAT; /**< Interrupt Status, offset: 0x80 */ - uint8_t RESERVED_8[3]; - __IO uint8_t INTEN; /**< Interrupt Enable, offset: 0x84 */ - uint8_t RESERVED_9[3]; - __IO uint8_t ERRSTAT; /**< Error Interrupt Status, offset: 0x88 */ - uint8_t RESERVED_10[3]; - __IO uint8_t ERREN; /**< Error Interrupt Enable, offset: 0x8C */ - uint8_t RESERVED_11[3]; - __I uint8_t STAT; /**< Status, offset: 0x90 */ - uint8_t RESERVED_12[3]; - __IO uint8_t CTL; /**< Control, offset: 0x94 */ - uint8_t RESERVED_13[3]; - __IO uint8_t ADDR; /**< Address, offset: 0x98 */ - uint8_t RESERVED_14[3]; - __IO uint8_t BDTPAGE1; /**< BDT Page 1, offset: 0x9C */ - uint8_t RESERVED_15[3]; - __I uint8_t FRMNUML; /**< Frame Number Register Low, offset: 0xA0 */ - uint8_t RESERVED_16[3]; - __I uint8_t FRMNUMH; /**< Frame Number Register High, offset: 0xA4 */ - uint8_t RESERVED_17[3]; - __IO uint8_t TOKEN; /**< Token, offset: 0xA8 */ - uint8_t RESERVED_18[3]; - __IO uint8_t SOFTHLD; /**< SOF Threshold, offset: 0xAC */ - uint8_t RESERVED_19[3]; - __IO uint8_t BDTPAGE2; /**< BDT Page 2, offset: 0xB0 */ - uint8_t RESERVED_20[3]; - __IO uint8_t BDTPAGE3; /**< BDT Page 3, offset: 0xB4 */ - uint8_t RESERVED_21[11]; - struct { /* offset: 0xC0, array step: 0x4 */ - __IO uint8_t ENDPT; /**< Endpoint Control, array offset: 0xC0, array step: 0x4 */ - uint8_t RESERVED_0[3]; - } ENDPOINT[16]; - __IO uint8_t USBCTRL; /**< USB Control, offset: 0x100 */ - uint8_t RESERVED_22[3]; - __I uint8_t OBSERVE; /**< USB OTG Observe, offset: 0x104 */ - uint8_t RESERVED_23[3]; - __IO uint8_t CONTROL; /**< USB OTG Control, offset: 0x108 */ - uint8_t RESERVED_24[3]; - __IO uint8_t USBTRC0; /**< USB Transceiver Control 0, offset: 0x10C */ - uint8_t RESERVED_25[7]; - __IO uint8_t USBFRMADJUST; /**< Frame Adjust, offset: 0x114 */ - uint8_t RESERVED_26[15]; - __IO uint8_t KEEP_ALIVE_CTRL; /**< Keep Alive Mode Control, offset: 0x124 */ - uint8_t RESERVED_27[3]; - __IO uint8_t KEEP_ALIVE_WKCTRL; /**< Keep Alive Mode Wakeup Control, offset: 0x128 */ - uint8_t RESERVED_28[3]; - __IO uint8_t MISCCTRL; /**< Miscellaneous Control, offset: 0x12C */ - uint8_t RESERVED_29[3]; - __IO uint8_t STALL_IL_DIS; /**< Peripheral Mode Stall Disable for Endpoints 7 to 0 in IN Direction, offset: 0x130 */ - uint8_t RESERVED_30[3]; - __IO uint8_t STALL_IH_DIS; /**< Peripheral Mode Stall Disable for Endpoints 15 to 8 in IN Direction, offset: 0x134 */ - uint8_t RESERVED_31[3]; - __IO uint8_t STALL_OL_DIS; /**< Peripheral Mode Stall Disable for Endpoints 7 to 0 in OUT Direction, offset: 0x138 */ - uint8_t RESERVED_32[3]; - __IO uint8_t STALL_OH_DIS; /**< Peripheral Mode Stall Disable for Endpoints 15 to 8 in OUT Direction, offset: 0x13C */ - uint8_t RESERVED_33[3]; - __IO uint8_t CLK_RECOVER_CTRL; /**< USB Clock Recovery Control, offset: 0x140 */ - uint8_t RESERVED_34[3]; - __IO uint8_t CLK_RECOVER_IRC_EN; /**< FIRC Oscillator Enable, offset: 0x144 */ - uint8_t RESERVED_35[15]; - __IO uint8_t CLK_RECOVER_INT_EN; /**< Clock Recovery Combined Interrupt Enable, offset: 0x154 */ - uint8_t RESERVED_36[7]; - __IO uint8_t CLK_RECOVER_INT_STATUS; /**< Clock Recovery Separated Interrupt Status, offset: 0x15C */ -} USB_Type; - -/* ---------------------------------------------------------------------------- - -- USB Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USB_Register_Masks USB Register Masks - * @{ - */ - -/*! @name PERID - Peripheral ID */ -/*! @{ */ - -#define USB_PERID_ID_MASK (0x3FU) -#define USB_PERID_ID_SHIFT (0U) -/*! ID - Peripheral Identification */ -#define USB_PERID_ID(x) (((uint8_t)(((uint8_t)(x)) << USB_PERID_ID_SHIFT)) & USB_PERID_ID_MASK) -/*! @} */ - -/*! @name IDCOMP - Peripheral ID Complement */ -/*! @{ */ - -#define USB_IDCOMP_NID_MASK (0x3FU) -#define USB_IDCOMP_NID_SHIFT (0U) -/*! NID - Negative Peripheral ID */ -#define USB_IDCOMP_NID(x) (((uint8_t)(((uint8_t)(x)) << USB_IDCOMP_NID_SHIFT)) & USB_IDCOMP_NID_MASK) -/*! @} */ - -/*! @name REV - Peripheral Revision */ -/*! @{ */ - -#define USB_REV_REV_MASK (0xFFU) -#define USB_REV_REV_SHIFT (0U) -/*! REV - Revision */ -#define USB_REV_REV(x) (((uint8_t)(((uint8_t)(x)) << USB_REV_REV_SHIFT)) & USB_REV_REV_MASK) -/*! @} */ - -/*! @name ADDINFO - Peripheral Additional Information */ -/*! @{ */ - -#define USB_ADDINFO_IEHOST_MASK (0x1U) -#define USB_ADDINFO_IEHOST_SHIFT (0U) -/*! IEHOST - Host Mode Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define USB_ADDINFO_IEHOST(x) (((uint8_t)(((uint8_t)(x)) << USB_ADDINFO_IEHOST_SHIFT)) & USB_ADDINFO_IEHOST_MASK) -/*! @} */ - -/*! @name OTGISTAT - OTG Interrupt Status */ -/*! @{ */ - -#define USB_OTGISTAT_LINE_STATE_CHG_MASK (0x20U) -#define USB_OTGISTAT_LINE_STATE_CHG_SHIFT (5U) -/*! LINE_STATE_CHG - Line State Change Interrupt Flag - * 0b0..Interrupt did not occur - * 0b1..Interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_OTGISTAT_LINE_STATE_CHG(x) (((uint8_t)(((uint8_t)(x)) << USB_OTGISTAT_LINE_STATE_CHG_SHIFT)) & USB_OTGISTAT_LINE_STATE_CHG_MASK) - -#define USB_OTGISTAT_ONEMSEC_MASK (0x40U) -#define USB_OTGISTAT_ONEMSEC_SHIFT (6U) -/*! ONEMSEC - One Millisecond Timer Timeout Flag - * 0b0..Not timed out - * 0b1..Timed out - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_OTGISTAT_ONEMSEC(x) (((uint8_t)(((uint8_t)(x)) << USB_OTGISTAT_ONEMSEC_SHIFT)) & USB_OTGISTAT_ONEMSEC_MASK) -/*! @} */ - -/*! @name OTGICR - OTG Interrupt Control */ -/*! @{ */ - -#define USB_OTGICR_LINESTATEEN_MASK (0x20U) -#define USB_OTGICR_LINESTATEEN_SHIFT (5U) -/*! LINESTATEEN - Line State Change Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_OTGICR_LINESTATEEN(x) (((uint8_t)(((uint8_t)(x)) << USB_OTGICR_LINESTATEEN_SHIFT)) & USB_OTGICR_LINESTATEEN_MASK) - -#define USB_OTGICR_ONEMSECEN_MASK (0x40U) -#define USB_OTGICR_ONEMSECEN_SHIFT (6U) -/*! ONEMSECEN - 1-Millisecond Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_OTGICR_ONEMSECEN(x) (((uint8_t)(((uint8_t)(x)) << USB_OTGICR_ONEMSECEN_SHIFT)) & USB_OTGICR_ONEMSECEN_MASK) -/*! @} */ - -/*! @name OTGSTAT - OTG Status */ -/*! @{ */ - -#define USB_OTGSTAT_LINESTATESTABLE_MASK (0x20U) -#define USB_OTGSTAT_LINESTATESTABLE_SHIFT (5U) -/*! LINESTATESTABLE - Line State Stable - * 0b0..Unstable - * 0b1..Stable - */ -#define USB_OTGSTAT_LINESTATESTABLE(x) (((uint8_t)(((uint8_t)(x)) << USB_OTGSTAT_LINESTATESTABLE_SHIFT)) & USB_OTGSTAT_LINESTATESTABLE_MASK) - -#define USB_OTGSTAT_ONEMSEC_MASK (0x40U) -#define USB_OTGSTAT_ONEMSEC_SHIFT (6U) -/*! ONEMSEC - Reserved for 1 ms count */ -#define USB_OTGSTAT_ONEMSEC(x) (((uint8_t)(((uint8_t)(x)) << USB_OTGSTAT_ONEMSEC_SHIFT)) & USB_OTGSTAT_ONEMSEC_MASK) -/*! @} */ - -/*! @name OTGCTL - OTG Control */ -/*! @{ */ - -#define USB_OTGCTL_OTGEN_MASK (0x4U) -#define USB_OTGCTL_OTGEN_SHIFT (2U) -/*! OTGEN - On-The-Go Pullup and Pulldown Resistor Enable - * 0b0..If USBENSOFEN is 1 and HOSTMODEEN is 0 in the Control Register (CTL), then the D+ Data line pullup - * resistors are enabled. If HOSTMODEEN is 1, then the D+ and D- Data line pulldown resistors are engaged. - * 0b1..Uses the pullup and pulldown controls in this register. - */ -#define USB_OTGCTL_OTGEN(x) (((uint8_t)(((uint8_t)(x)) << USB_OTGCTL_OTGEN_SHIFT)) & USB_OTGCTL_OTGEN_MASK) - -#define USB_OTGCTL_DMLOW_MASK (0x10U) -#define USB_OTGCTL_DMLOW_SHIFT (4U) -/*! DMLOW - D- Data Line Pulldown Resistor Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_OTGCTL_DMLOW(x) (((uint8_t)(((uint8_t)(x)) << USB_OTGCTL_DMLOW_SHIFT)) & USB_OTGCTL_DMLOW_MASK) - -#define USB_OTGCTL_DPLOW_MASK (0x20U) -#define USB_OTGCTL_DPLOW_SHIFT (5U) -/*! DPLOW - D+ Data Line pulldown Resistor Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_OTGCTL_DPLOW(x) (((uint8_t)(((uint8_t)(x)) << USB_OTGCTL_DPLOW_SHIFT)) & USB_OTGCTL_DPLOW_MASK) - -#define USB_OTGCTL_DPHIGH_MASK (0x80U) -#define USB_OTGCTL_DPHIGH_SHIFT (7U) -/*! DPHIGH - D+ Data Line Pullup Resistor Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_OTGCTL_DPHIGH(x) (((uint8_t)(((uint8_t)(x)) << USB_OTGCTL_DPHIGH_SHIFT)) & USB_OTGCTL_DPHIGH_MASK) -/*! @} */ - -/*! @name ISTAT - Interrupt Status */ -/*! @{ */ - -#define USB_ISTAT_USBRST_MASK (0x1U) -#define USB_ISTAT_USBRST_SHIFT (0U) -/*! USBRST - USB Reset Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ISTAT_USBRST(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_USBRST_SHIFT)) & USB_ISTAT_USBRST_MASK) - -#define USB_ISTAT_ERROR_MASK (0x2U) -#define USB_ISTAT_ERROR_SHIFT (1U) -/*! ERROR - Error Flag - * 0b0..Error did not occur - * 0b1..Error occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ISTAT_ERROR(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_ERROR_SHIFT)) & USB_ISTAT_ERROR_MASK) - -#define USB_ISTAT_SOFTOK_MASK (0x4U) -#define USB_ISTAT_SOFTOK_SHIFT (2U) -/*! SOFTOK - Start Of Frame (SOF) Token Flag - * 0b0..Did not receive - * 0b1..Received - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ISTAT_SOFTOK(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_SOFTOK_SHIFT)) & USB_ISTAT_SOFTOK_MASK) - -#define USB_ISTAT_TOKDNE_MASK (0x8U) -#define USB_ISTAT_TOKDNE_SHIFT (3U) -/*! TOKDNE - Current Token Processing Flag - * 0b0..Not processed - * 0b1..Processed - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ISTAT_TOKDNE(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_TOKDNE_SHIFT)) & USB_ISTAT_TOKDNE_MASK) - -#define USB_ISTAT_SLEEP_MASK (0x10U) -#define USB_ISTAT_SLEEP_SHIFT (4U) -/*! SLEEP - Sleep Flag - * 0b0..Interrupt did not occur - * 0b1..Interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ISTAT_SLEEP(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_SLEEP_SHIFT)) & USB_ISTAT_SLEEP_MASK) - -#define USB_ISTAT_RESUME_MASK (0x20U) -#define USB_ISTAT_RESUME_SHIFT (5U) -/*! RESUME - Resume Flag - * 0b0..Interrupt did not occur - * 0b1..Interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ISTAT_RESUME(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_RESUME_SHIFT)) & USB_ISTAT_RESUME_MASK) - -#define USB_ISTAT_ATTACH_MASK (0x40U) -#define USB_ISTAT_ATTACH_SHIFT (6U) -/*! ATTACH - Attach Interrupt Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ISTAT_ATTACH(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_ATTACH_SHIFT)) & USB_ISTAT_ATTACH_MASK) - -#define USB_ISTAT_STALL_MASK (0x80U) -#define USB_ISTAT_STALL_SHIFT (7U) -/*! STALL - Stall Interrupt Flag - * 0b0..Interrupt did not occur - * 0b1..Interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ISTAT_STALL(x) (((uint8_t)(((uint8_t)(x)) << USB_ISTAT_STALL_SHIFT)) & USB_ISTAT_STALL_MASK) -/*! @} */ - -/*! @name INTEN - Interrupt Enable */ -/*! @{ */ - -#define USB_INTEN_USBRSTEN_MASK (0x1U) -#define USB_INTEN_USBRSTEN_SHIFT (0U) -/*! USBRSTEN - USBRST Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_INTEN_USBRSTEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_USBRSTEN_SHIFT)) & USB_INTEN_USBRSTEN_MASK) - -#define USB_INTEN_ERROREN_MASK (0x2U) -#define USB_INTEN_ERROREN_SHIFT (1U) -/*! ERROREN - ERROR Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_INTEN_ERROREN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_ERROREN_SHIFT)) & USB_INTEN_ERROREN_MASK) - -#define USB_INTEN_SOFTOKEN_MASK (0x4U) -#define USB_INTEN_SOFTOKEN_SHIFT (2U) -/*! SOFTOKEN - SOFTOK Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_INTEN_SOFTOKEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_SOFTOKEN_SHIFT)) & USB_INTEN_SOFTOKEN_MASK) - -#define USB_INTEN_TOKDNEEN_MASK (0x8U) -#define USB_INTEN_TOKDNEEN_SHIFT (3U) -/*! TOKDNEEN - TOKDNE Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_INTEN_TOKDNEEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_TOKDNEEN_SHIFT)) & USB_INTEN_TOKDNEEN_MASK) - -#define USB_INTEN_SLEEPEN_MASK (0x10U) -#define USB_INTEN_SLEEPEN_SHIFT (4U) -/*! SLEEPEN - SLEEP Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_INTEN_SLEEPEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_SLEEPEN_SHIFT)) & USB_INTEN_SLEEPEN_MASK) - -#define USB_INTEN_RESUMEEN_MASK (0x20U) -#define USB_INTEN_RESUMEEN_SHIFT (5U) -/*! RESUMEEN - RESUME Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_INTEN_RESUMEEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_RESUMEEN_SHIFT)) & USB_INTEN_RESUMEEN_MASK) - -#define USB_INTEN_ATTACHEN_MASK (0x40U) -#define USB_INTEN_ATTACHEN_SHIFT (6U) -/*! ATTACHEN - ATTACH Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_INTEN_ATTACHEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_ATTACHEN_SHIFT)) & USB_INTEN_ATTACHEN_MASK) - -#define USB_INTEN_STALLEN_MASK (0x80U) -#define USB_INTEN_STALLEN_SHIFT (7U) -/*! STALLEN - STALL Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_INTEN_STALLEN(x) (((uint8_t)(((uint8_t)(x)) << USB_INTEN_STALLEN_SHIFT)) & USB_INTEN_STALLEN_MASK) -/*! @} */ - -/*! @name ERRSTAT - Error Interrupt Status */ -/*! @{ */ - -#define USB_ERRSTAT_PIDERR_MASK (0x1U) -#define USB_ERRSTAT_PIDERR_SHIFT (0U) -/*! PIDERR - PID Error Flag - * 0b0..Did not fail - * 0b1..Failed - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_PIDERR(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_PIDERR_SHIFT)) & USB_ERRSTAT_PIDERR_MASK) - -#define USB_ERRSTAT_CRC5EOF_MASK (0x2U) -#define USB_ERRSTAT_CRC5EOF_SHIFT (1U) -/*! CRC5EOF - CRC5 Error or End of Frame Error Flag - * 0b0..Interrupt did not occur - * 0b1..Interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_CRC5EOF(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_CRC5EOF_SHIFT)) & USB_ERRSTAT_CRC5EOF_MASK) - -#define USB_ERRSTAT_CRC16_MASK (0x4U) -#define USB_ERRSTAT_CRC16_SHIFT (2U) -/*! CRC16 - CRC16 Error Flag - * 0b0..Not rejected - * 0b1..Rejected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_CRC16(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_CRC16_SHIFT)) & USB_ERRSTAT_CRC16_MASK) - -#define USB_ERRSTAT_DFN8_MASK (0x8U) -#define USB_ERRSTAT_DFN8_SHIFT (3U) -/*! DFN8 - Data Field Not 8 Bits Flag - * 0b0..Integer number of bytes - * 0b1..Not an integer number of bytes - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_DFN8(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_DFN8_SHIFT)) & USB_ERRSTAT_DFN8_MASK) - -#define USB_ERRSTAT_BTOERR_MASK (0x10U) -#define USB_ERRSTAT_BTOERR_SHIFT (4U) -/*! BTOERR - Bus Turnaround Timeout Error Flag - * 0b0..Not timed out - * 0b1..Timed out - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_BTOERR(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_BTOERR_SHIFT)) & USB_ERRSTAT_BTOERR_MASK) - -#define USB_ERRSTAT_DMAERR_MASK (0x20U) -#define USB_ERRSTAT_DMAERR_SHIFT (5U) -/*! DMAERR - DMA Access Error Flag - * 0b0..Interrupt did not occur - * 0b1..Interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_DMAERR(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_DMAERR_SHIFT)) & USB_ERRSTAT_DMAERR_MASK) - -#define USB_ERRSTAT_OWNERR_MASK (0x40U) -#define USB_ERRSTAT_OWNERR_SHIFT (6U) -/*! OWNERR - BD Unavailable Error Flag - * 0b0..Interrupt did not occur - * 0b1..Interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_OWNERR(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_OWNERR_SHIFT)) & USB_ERRSTAT_OWNERR_MASK) - -#define USB_ERRSTAT_BTSERR_MASK (0x80U) -#define USB_ERRSTAT_BTSERR_SHIFT (7U) -/*! BTSERR - Bit Stuff Error Flag - * 0b0..Packet not rejected due to the error - * 0b1..Packet rejected due to the error - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_ERRSTAT_BTSERR(x) (((uint8_t)(((uint8_t)(x)) << USB_ERRSTAT_BTSERR_SHIFT)) & USB_ERRSTAT_BTSERR_MASK) -/*! @} */ - -/*! @name ERREN - Error Interrupt Enable */ -/*! @{ */ - -#define USB_ERREN_PIDERREN_MASK (0x1U) -#define USB_ERREN_PIDERREN_SHIFT (0U) -/*! PIDERREN - PIDERR Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_PIDERREN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_PIDERREN_SHIFT)) & USB_ERREN_PIDERREN_MASK) - -#define USB_ERREN_CRC5EOFEN_MASK (0x2U) -#define USB_ERREN_CRC5EOFEN_SHIFT (1U) -/*! CRC5EOFEN - CRC5/EOF Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_CRC5EOFEN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_CRC5EOFEN_SHIFT)) & USB_ERREN_CRC5EOFEN_MASK) - -#define USB_ERREN_CRC16EN_MASK (0x4U) -#define USB_ERREN_CRC16EN_SHIFT (2U) -/*! CRC16EN - CRC16 Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_CRC16EN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_CRC16EN_SHIFT)) & USB_ERREN_CRC16EN_MASK) - -#define USB_ERREN_DFN8EN_MASK (0x8U) -#define USB_ERREN_DFN8EN_SHIFT (3U) -/*! DFN8EN - DFN8 (Data Field Not Integer Number of Bytes) Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_DFN8EN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_DFN8EN_SHIFT)) & USB_ERREN_DFN8EN_MASK) - -#define USB_ERREN_BTOERREN_MASK (0x10U) -#define USB_ERREN_BTOERREN_SHIFT (4U) -/*! BTOERREN - BTOERR (Bus Timeout Error) Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_BTOERREN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_BTOERREN_SHIFT)) & USB_ERREN_BTOERREN_MASK) - -#define USB_ERREN_DMAERREN_MASK (0x20U) -#define USB_ERREN_DMAERREN_SHIFT (5U) -/*! DMAERREN - DMAERR Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_DMAERREN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_DMAERREN_SHIFT)) & USB_ERREN_DMAERREN_MASK) - -#define USB_ERREN_OWNERREN_MASK (0x40U) -#define USB_ERREN_OWNERREN_SHIFT (6U) -/*! OWNERREN - OWNERR Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_OWNERREN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_OWNERREN_SHIFT)) & USB_ERREN_OWNERREN_MASK) - -#define USB_ERREN_BTSERREN_MASK (0x80U) -#define USB_ERREN_BTSERREN_SHIFT (7U) -/*! BTSERREN - BTSERR (Bit Stuff Error) Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_ERREN_BTSERREN(x) (((uint8_t)(((uint8_t)(x)) << USB_ERREN_BTSERREN_SHIFT)) & USB_ERREN_BTSERREN_MASK) -/*! @} */ - -/*! @name STAT - Status */ -/*! @{ */ - -#define USB_STAT_ODD_MASK (0x4U) -#define USB_STAT_ODD_SHIFT (2U) -/*! ODD - Odd Bank - * 0b0..Not in the odd bank - * 0b1..In the odd bank - */ -#define USB_STAT_ODD(x) (((uint8_t)(((uint8_t)(x)) << USB_STAT_ODD_SHIFT)) & USB_STAT_ODD_MASK) - -#define USB_STAT_TX_MASK (0x8U) -#define USB_STAT_TX_SHIFT (3U) -/*! TX - Transmit Indicator - * 0b0..Receive - * 0b1..Transmit - */ -#define USB_STAT_TX(x) (((uint8_t)(((uint8_t)(x)) << USB_STAT_TX_SHIFT)) & USB_STAT_TX_MASK) - -#define USB_STAT_ENDP_MASK (0xF0U) -#define USB_STAT_ENDP_SHIFT (4U) -/*! ENDP - Endpoint address */ -#define USB_STAT_ENDP(x) (((uint8_t)(((uint8_t)(x)) << USB_STAT_ENDP_SHIFT)) & USB_STAT_ENDP_MASK) -/*! @} */ - -/*! @name CTL - Control */ -/*! @{ */ - -#define USB_CTL_USBENSOFEN_MASK (0x1U) -#define USB_CTL_USBENSOFEN_SHIFT (0U) -/*! USBENSOFEN - USB Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_CTL_USBENSOFEN(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_USBENSOFEN_SHIFT)) & USB_CTL_USBENSOFEN_MASK) - -#define USB_CTL_ODDRST_MASK (0x2U) -#define USB_CTL_ODDRST_SHIFT (1U) -/*! ODDRST - Odd Reset */ -#define USB_CTL_ODDRST(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_ODDRST_SHIFT)) & USB_CTL_ODDRST_MASK) - -#define USB_CTL_RESUME_MASK (0x4U) -#define USB_CTL_RESUME_SHIFT (2U) -/*! RESUME - Resume */ -#define USB_CTL_RESUME(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_RESUME_SHIFT)) & USB_CTL_RESUME_MASK) - -#define USB_CTL_HOSTMODEEN_MASK (0x8U) -#define USB_CTL_HOSTMODEEN_SHIFT (3U) -/*! HOSTMODEEN - Host Mode Enable - * 0b0..USBFS operates in Device mode. - * 0b1..USBFS operates in Host mode. In Host mode, USBFS performs USB transactions under the programmed control of the host processor. - */ -#define USB_CTL_HOSTMODEEN(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_HOSTMODEEN_SHIFT)) & USB_CTL_HOSTMODEEN_MASK) - -#define USB_CTL_RESET_MASK (0x10U) -#define USB_CTL_RESET_SHIFT (4U) -/*! RESET - Reset Signaling Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_CTL_RESET(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_RESET_SHIFT)) & USB_CTL_RESET_MASK) - -#define USB_CTL_TXSUSPENDTOKENBUSY_MASK (0x20U) -#define USB_CTL_TXSUSPENDTOKENBUSY_SHIFT (5U) -/*! TXSUSPENDTOKENBUSY - TXD Suspend And Token Busy */ -#define USB_CTL_TXSUSPENDTOKENBUSY(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_TXSUSPENDTOKENBUSY_SHIFT)) & USB_CTL_TXSUSPENDTOKENBUSY_MASK) - -#define USB_CTL_SE0_MASK (0x40U) -#define USB_CTL_SE0_SHIFT (6U) -/*! SE0 - Live USB Single-Ended Zero signal */ -#define USB_CTL_SE0(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_SE0_SHIFT)) & USB_CTL_SE0_MASK) - -#define USB_CTL_JSTATE_MASK (0x80U) -#define USB_CTL_JSTATE_SHIFT (7U) -/*! JSTATE - Live USB Differential Receiver JSTATE Signal */ -#define USB_CTL_JSTATE(x) (((uint8_t)(((uint8_t)(x)) << USB_CTL_JSTATE_SHIFT)) & USB_CTL_JSTATE_MASK) -/*! @} */ - -/*! @name ADDR - Address */ -/*! @{ */ - -#define USB_ADDR_ADDR_MASK (0x7FU) -#define USB_ADDR_ADDR_SHIFT (0U) -/*! ADDR - USB Address */ -#define USB_ADDR_ADDR(x) (((uint8_t)(((uint8_t)(x)) << USB_ADDR_ADDR_SHIFT)) & USB_ADDR_ADDR_MASK) - -#define USB_ADDR_LSEN_MASK (0x80U) -#define USB_ADDR_LSEN_SHIFT (7U) -/*! LSEN - Low Speed Enable */ -#define USB_ADDR_LSEN(x) (((uint8_t)(((uint8_t)(x)) << USB_ADDR_LSEN_SHIFT)) & USB_ADDR_LSEN_MASK) -/*! @} */ - -/*! @name BDTPAGE1 - BDT Page 1 */ -/*! @{ */ - -#define USB_BDTPAGE1_BDTBA_MASK (0xFEU) -#define USB_BDTPAGE1_BDTBA_SHIFT (1U) -/*! BDTBA - BDT Base Address */ -#define USB_BDTPAGE1_BDTBA(x) (((uint8_t)(((uint8_t)(x)) << USB_BDTPAGE1_BDTBA_SHIFT)) & USB_BDTPAGE1_BDTBA_MASK) -/*! @} */ - -/*! @name FRMNUML - Frame Number Register Low */ -/*! @{ */ - -#define USB_FRMNUML_FRM_MASK (0xFFU) -#define USB_FRMNUML_FRM_SHIFT (0U) -/*! FRM - Frame Number, Bits 0-7 */ -#define USB_FRMNUML_FRM(x) (((uint8_t)(((uint8_t)(x)) << USB_FRMNUML_FRM_SHIFT)) & USB_FRMNUML_FRM_MASK) -/*! @} */ - -/*! @name FRMNUMH - Frame Number Register High */ -/*! @{ */ - -#define USB_FRMNUMH_FRM_MASK (0x7U) -#define USB_FRMNUMH_FRM_SHIFT (0U) -/*! FRM - Frame Number, Bits 8-10 */ -#define USB_FRMNUMH_FRM(x) (((uint8_t)(((uint8_t)(x)) << USB_FRMNUMH_FRM_SHIFT)) & USB_FRMNUMH_FRM_MASK) -/*! @} */ - -/*! @name TOKEN - Token */ -/*! @{ */ - -#define USB_TOKEN_TOKENENDPT_MASK (0xFU) -#define USB_TOKEN_TOKENENDPT_SHIFT (0U) -/*! TOKENENDPT - Token Endpoint Address */ -#define USB_TOKEN_TOKENENDPT(x) (((uint8_t)(((uint8_t)(x)) << USB_TOKEN_TOKENENDPT_SHIFT)) & USB_TOKEN_TOKENENDPT_MASK) - -#define USB_TOKEN_TOKENPID_MASK (0xF0U) -#define USB_TOKEN_TOKENPID_SHIFT (4U) -/*! TOKENPID - Token Type - * 0b0001..OUT token. USBFS performs an OUT (TX) transaction. - * 0b1001..IN token. USBFS performs an IN (RX) transaction. - * 0b1101..SETUP token. USBFS performs a SETUP (TX) transaction - */ -#define USB_TOKEN_TOKENPID(x) (((uint8_t)(((uint8_t)(x)) << USB_TOKEN_TOKENPID_SHIFT)) & USB_TOKEN_TOKENPID_MASK) -/*! @} */ - -/*! @name SOFTHLD - SOF Threshold */ -/*! @{ */ - -#define USB_SOFTHLD_CNT_MASK (0xFFU) -#define USB_SOFTHLD_CNT_SHIFT (0U) -/*! CNT - SOF Count Threshold */ -#define USB_SOFTHLD_CNT(x) (((uint8_t)(((uint8_t)(x)) << USB_SOFTHLD_CNT_SHIFT)) & USB_SOFTHLD_CNT_MASK) -/*! @} */ - -/*! @name BDTPAGE2 - BDT Page 2 */ -/*! @{ */ - -#define USB_BDTPAGE2_BDTBA_MASK (0xFFU) -#define USB_BDTPAGE2_BDTBA_SHIFT (0U) -/*! BDTBA - BDT Base Address */ -#define USB_BDTPAGE2_BDTBA(x) (((uint8_t)(((uint8_t)(x)) << USB_BDTPAGE2_BDTBA_SHIFT)) & USB_BDTPAGE2_BDTBA_MASK) -/*! @} */ - -/*! @name BDTPAGE3 - BDT Page 3 */ -/*! @{ */ - -#define USB_BDTPAGE3_BDTBA_MASK (0xFFU) -#define USB_BDTPAGE3_BDTBA_SHIFT (0U) -/*! BDTBA - BDT Base Address */ -#define USB_BDTPAGE3_BDTBA(x) (((uint8_t)(((uint8_t)(x)) << USB_BDTPAGE3_BDTBA_SHIFT)) & USB_BDTPAGE3_BDTBA_MASK) -/*! @} */ - -/*! @name ENDPT - Endpoint Control */ -/*! @{ */ - -#define USB_ENDPT_EPHSHK_MASK (0x1U) -#define USB_ENDPT_EPHSHK_SHIFT (0U) -/*! EPHSHK - Endpoint Handshaking Enable */ -#define USB_ENDPT_EPHSHK(x) (((uint8_t)(((uint8_t)(x)) << USB_ENDPT_EPHSHK_SHIFT)) & USB_ENDPT_EPHSHK_MASK) - -#define USB_ENDPT_EPSTALL_MASK (0x2U) -#define USB_ENDPT_EPSTALL_SHIFT (1U) -/*! EPSTALL - Endpoint Stalled */ -#define USB_ENDPT_EPSTALL(x) (((uint8_t)(((uint8_t)(x)) << USB_ENDPT_EPSTALL_SHIFT)) & USB_ENDPT_EPSTALL_MASK) - -#define USB_ENDPT_EPTXEN_MASK (0x4U) -#define USB_ENDPT_EPTXEN_SHIFT (2U) -/*! EPTXEN - Endpoint for TX transfers enable */ -#define USB_ENDPT_EPTXEN(x) (((uint8_t)(((uint8_t)(x)) << USB_ENDPT_EPTXEN_SHIFT)) & USB_ENDPT_EPTXEN_MASK) - -#define USB_ENDPT_EPRXEN_MASK (0x8U) -#define USB_ENDPT_EPRXEN_SHIFT (3U) -/*! EPRXEN - Endpoint for RX transfers enable */ -#define USB_ENDPT_EPRXEN(x) (((uint8_t)(((uint8_t)(x)) << USB_ENDPT_EPRXEN_SHIFT)) & USB_ENDPT_EPRXEN_MASK) - -#define USB_ENDPT_EPCTLDIS_MASK (0x10U) -#define USB_ENDPT_EPCTLDIS_SHIFT (4U) -/*! EPCTLDIS - Control Transfer Disable - * 0b0..Enable - * 0b1..Disable - */ -#define USB_ENDPT_EPCTLDIS(x) (((uint8_t)(((uint8_t)(x)) << USB_ENDPT_EPCTLDIS_SHIFT)) & USB_ENDPT_EPCTLDIS_MASK) - -#define USB_ENDPT_RETRYDIS_MASK (0x40U) -#define USB_ENDPT_RETRYDIS_SHIFT (6U) -/*! RETRYDIS - Retry Disable - * 0b0..Retried NAK'ed transactions in hardware. - * 0b1..Do not retry NAK'ed transactions. When a transaction is NAK'ed, the BDT PID field is updated with the NAK - * PID, and the TOKEN_DNE interrupt becomes 1. - */ -#define USB_ENDPT_RETRYDIS(x) (((uint8_t)(((uint8_t)(x)) << USB_ENDPT_RETRYDIS_SHIFT)) & USB_ENDPT_RETRYDIS_MASK) - -#define USB_ENDPT_HOSTWOHUB_MASK (0x80U) -#define USB_ENDPT_HOSTWOHUB_SHIFT (7U) -/*! HOSTWOHUB - Host Without A Hub - * 0b0..Connected using a hub (USBFS generates PRE_PID as required) - * 0b1..Connected directly to host without a hub, or was used to attach - */ -#define USB_ENDPT_HOSTWOHUB(x) (((uint8_t)(((uint8_t)(x)) << USB_ENDPT_HOSTWOHUB_SHIFT)) & USB_ENDPT_HOSTWOHUB_MASK) -/*! @} */ - -/* The count of USB_ENDPT */ -#define USB_ENDPT_COUNT (16U) - -/*! @name USBCTRL - USB Control */ -/*! @{ */ - -#define USB_USBCTRL_DPDM_LANE_REVERSE_MASK (0x4U) -#define USB_USBCTRL_DPDM_LANE_REVERSE_SHIFT (2U) -/*! DPDM_LANE_REVERSE - DP and DM Lane Reversal Control - * 0b0..Standard USB DP and DM package pin assignment - * 0b1..Reverse roles of USB DP and DM package pins - */ -#define USB_USBCTRL_DPDM_LANE_REVERSE(x) (((uint8_t)(((uint8_t)(x)) << USB_USBCTRL_DPDM_LANE_REVERSE_SHIFT)) & USB_USBCTRL_DPDM_LANE_REVERSE_MASK) - -#define USB_USBCTRL_HOST_LS_EOP_MASK (0x8U) -#define USB_USBCTRL_HOST_LS_EOP_SHIFT (3U) -/*! HOST_LS_EOP - Host-Mode-Only Low-Speed Device EOP Signaling - * 0b0..Full-speed device or a low-speed device through a hub - * 0b1..Directly-connected low-speed device - */ -#define USB_USBCTRL_HOST_LS_EOP(x) (((uint8_t)(((uint8_t)(x)) << USB_USBCTRL_HOST_LS_EOP_SHIFT)) & USB_USBCTRL_HOST_LS_EOP_MASK) - -#define USB_USBCTRL_UARTSEL_MASK (0x10U) -#define USB_USBCTRL_UARTSEL_SHIFT (4U) -/*! UARTSEL - UART Select - * 0b0..USB DP and DM external package pins are used for USB signaling. - * 0b1..USB DP and DM external package pins are used for UART signaling. - */ -#define USB_USBCTRL_UARTSEL(x) (((uint8_t)(((uint8_t)(x)) << USB_USBCTRL_UARTSEL_SHIFT)) & USB_USBCTRL_UARTSEL_MASK) - -#define USB_USBCTRL_UARTCHLS_MASK (0x20U) -#define USB_USBCTRL_UARTCHLS_SHIFT (5U) -/*! UARTCHLS - UART Signal Channel Select - * 0b0..USB DP and DM signals are used as UART TX/RX. - * 0b1..USB DP and DM signals are used as UART RX/TX. - */ -#define USB_USBCTRL_UARTCHLS(x) (((uint8_t)(((uint8_t)(x)) << USB_USBCTRL_UARTCHLS_SHIFT)) & USB_USBCTRL_UARTCHLS_MASK) - -#define USB_USBCTRL_PDE_MASK (0x40U) -#define USB_USBCTRL_PDE_SHIFT (6U) -/*! PDE - Pulldown Enable - * 0b0..Disable on D+ and D- - * 0b1..Enable on D+ and D- - */ -#define USB_USBCTRL_PDE(x) (((uint8_t)(((uint8_t)(x)) << USB_USBCTRL_PDE_SHIFT)) & USB_USBCTRL_PDE_MASK) - -#define USB_USBCTRL_SUSP_MASK (0x80U) -#define USB_USBCTRL_SUSP_SHIFT (7U) -/*! SUSP - Suspend - * 0b0..Not in Suspend state - * 0b1..In Suspend state - */ -#define USB_USBCTRL_SUSP(x) (((uint8_t)(((uint8_t)(x)) << USB_USBCTRL_SUSP_SHIFT)) & USB_USBCTRL_SUSP_MASK) -/*! @} */ - -/*! @name OBSERVE - USB OTG Observe */ -/*! @{ */ - -#define USB_OBSERVE_DMPD_MASK (0x10U) -#define USB_OBSERVE_DMPD_SHIFT (4U) -/*! DMPD - D- Pulldown - * 0b0..Disabled - * 0b1..Enabled - */ -#define USB_OBSERVE_DMPD(x) (((uint8_t)(((uint8_t)(x)) << USB_OBSERVE_DMPD_SHIFT)) & USB_OBSERVE_DMPD_MASK) - -#define USB_OBSERVE_DPPD_MASK (0x40U) -#define USB_OBSERVE_DPPD_SHIFT (6U) -/*! DPPD - D+ Pulldown - * 0b0..Disabled - * 0b1..Enabled - */ -#define USB_OBSERVE_DPPD(x) (((uint8_t)(((uint8_t)(x)) << USB_OBSERVE_DPPD_SHIFT)) & USB_OBSERVE_DPPD_MASK) - -#define USB_OBSERVE_DPPU_MASK (0x80U) -#define USB_OBSERVE_DPPU_SHIFT (7U) -/*! DPPU - D+ Pullup - * 0b0..Disabled - * 0b1..Enabled - */ -#define USB_OBSERVE_DPPU(x) (((uint8_t)(((uint8_t)(x)) << USB_OBSERVE_DPPU_SHIFT)) & USB_OBSERVE_DPPU_MASK) -/*! @} */ - -/*! @name CONTROL - USB OTG Control */ -/*! @{ */ - -#define USB_CONTROL_VBUS_SOURCE_SEL_MASK (0x1U) -#define USB_CONTROL_VBUS_SOURCE_SEL_SHIFT (0U) -/*! VBUS_SOURCE_SEL - VBUS Monitoring Source Select - * 0b0..Reserved - * 0b1..Resistive divider attached to a GPIO pin - */ -#define USB_CONTROL_VBUS_SOURCE_SEL(x) (((uint8_t)(((uint8_t)(x)) << USB_CONTROL_VBUS_SOURCE_SEL_SHIFT)) & USB_CONTROL_VBUS_SOURCE_SEL_MASK) - -#define USB_CONTROL_SESS_VLD_MASK (0x2U) -#define USB_CONTROL_SESS_VLD_SHIFT (1U) -/*! SESS_VLD - VBUS Session Valid status - * 0b1..Above - * 0b0..Below - */ -#define USB_CONTROL_SESS_VLD(x) (((uint8_t)(((uint8_t)(x)) << USB_CONTROL_SESS_VLD_SHIFT)) & USB_CONTROL_SESS_VLD_MASK) - -#define USB_CONTROL_DPPULLUPNONOTG_MASK (0x10U) -#define USB_CONTROL_DPPULLUPNONOTG_SHIFT (4U) -/*! DPPULLUPNONOTG - DP Pullup in Non-OTG Device Mode - * 0b0..Disable - * 0b1..Enabled - */ -#define USB_CONTROL_DPPULLUPNONOTG(x) (((uint8_t)(((uint8_t)(x)) << USB_CONTROL_DPPULLUPNONOTG_SHIFT)) & USB_CONTROL_DPPULLUPNONOTG_MASK) -/*! @} */ - -/*! @name USBTRC0 - USB Transceiver Control 0 */ -/*! @{ */ - -#define USB_USBTRC0_USB_RESUME_INT_MASK (0x1U) -#define USB_USBTRC0_USB_RESUME_INT_SHIFT (0U) -/*! USB_RESUME_INT - USB Asynchronous Interrupt - * 0b0..Not generated - * 0b1..Generated because of the USB asynchronous interrupt - */ -#define USB_USBTRC0_USB_RESUME_INT(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_USB_RESUME_INT_SHIFT)) & USB_USBTRC0_USB_RESUME_INT_MASK) - -#define USB_USBTRC0_SYNC_DET_MASK (0x2U) -#define USB_USBTRC0_SYNC_DET_SHIFT (1U) -/*! SYNC_DET - Synchronous USB Interrupt Detect - * 0b0..Not detected - * 0b1..Detected - */ -#define USB_USBTRC0_SYNC_DET(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_SYNC_DET_SHIFT)) & USB_USBTRC0_SYNC_DET_MASK) - -#define USB_USBTRC0_USB_CLK_RECOVERY_INT_MASK (0x4U) -#define USB_USBTRC0_USB_CLK_RECOVERY_INT_SHIFT (2U) -/*! USB_CLK_RECOVERY_INT - Combined USB Clock Recovery interrupt status */ -#define USB_USBTRC0_USB_CLK_RECOVERY_INT(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_USB_CLK_RECOVERY_INT_SHIFT)) & USB_USBTRC0_USB_CLK_RECOVERY_INT_MASK) - -#define USB_USBTRC0_VREDG_DET_MASK (0x8U) -#define USB_USBTRC0_VREDG_DET_SHIFT (3U) -/*! VREDG_DET - VREGIN Rising Edge Interrupt Detect - * 0b0..Not detected - * 0b1..Detected - */ -#define USB_USBTRC0_VREDG_DET(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_VREDG_DET_SHIFT)) & USB_USBTRC0_VREDG_DET_MASK) - -#define USB_USBTRC0_VFEDG_DET_MASK (0x10U) -#define USB_USBTRC0_VFEDG_DET_SHIFT (4U) -/*! VFEDG_DET - VREGIN Falling Edge Interrupt Detect - * 0b0..Not detected - * 0b1..Detected - */ -#define USB_USBTRC0_VFEDG_DET(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_VFEDG_DET_SHIFT)) & USB_USBTRC0_VFEDG_DET_MASK) - -#define USB_USBTRC0_USBRESMEN_MASK (0x20U) -#define USB_USBTRC0_USBRESMEN_SHIFT (5U) -/*! USBRESMEN - Asynchronous Resume Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_USBTRC0_USBRESMEN(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_USBRESMEN_SHIFT)) & USB_USBTRC0_USBRESMEN_MASK) - -#define USB_USBTRC0_VREGIN_STS_MASK (0x40U) -#define USB_USBTRC0_VREGIN_STS_SHIFT (6U) -/*! VREGIN_STS - VREGIN Status */ -#define USB_USBTRC0_VREGIN_STS(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_VREGIN_STS_SHIFT)) & USB_USBTRC0_VREGIN_STS_MASK) - -#define USB_USBTRC0_USBRESET_MASK (0x80U) -#define USB_USBTRC0_USBRESET_SHIFT (7U) -/*! USBRESET - USB Reset - * 0b0..Normal USBFS operation - * 0b1..Returns USBFS to its reset state - */ -#define USB_USBTRC0_USBRESET(x) (((uint8_t)(((uint8_t)(x)) << USB_USBTRC0_USBRESET_SHIFT)) & USB_USBTRC0_USBRESET_MASK) -/*! @} */ - -/*! @name USBFRMADJUST - Frame Adjust */ -/*! @{ */ - -#define USB_USBFRMADJUST_ADJ_MASK (0xFFU) -#define USB_USBFRMADJUST_ADJ_SHIFT (0U) -/*! ADJ - Frame Adjustment */ -#define USB_USBFRMADJUST_ADJ(x) (((uint8_t)(((uint8_t)(x)) << USB_USBFRMADJUST_ADJ_SHIFT)) & USB_USBFRMADJUST_ADJ_MASK) -/*! @} */ - -/*! @name KEEP_ALIVE_CTRL - Keep Alive Mode Control */ -/*! @{ */ - -#define USB_KEEP_ALIVE_CTRL_KEEP_ALIVE_EN_MASK (0x1U) -#define USB_KEEP_ALIVE_CTRL_KEEP_ALIVE_EN_SHIFT (0U) -/*! KEEP_ALIVE_EN - Keep Alive Mode Enable - * 0b0..Everything remains same as before. - * 0b1..USB shall enter USB_KEEP_ALIVE mode after asserting ipg_stop. - */ -#define USB_KEEP_ALIVE_CTRL_KEEP_ALIVE_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_KEEP_ALIVE_CTRL_KEEP_ALIVE_EN_SHIFT)) & USB_KEEP_ALIVE_CTRL_KEEP_ALIVE_EN_MASK) - -#define USB_KEEP_ALIVE_CTRL_OWN_OVERRD_EN_MASK (0x2U) -#define USB_KEEP_ALIVE_CTRL_OWN_OVERRD_EN_SHIFT (1U) -/*! OWN_OVERRD_EN - OWN Bit Override Enable */ -#define USB_KEEP_ALIVE_CTRL_OWN_OVERRD_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_KEEP_ALIVE_CTRL_OWN_OVERRD_EN_SHIFT)) & USB_KEEP_ALIVE_CTRL_OWN_OVERRD_EN_MASK) - -#define USB_KEEP_ALIVE_CTRL_STOP_ACK_DLY_EN_MASK (0x4U) -#define USB_KEEP_ALIVE_CTRL_STOP_ACK_DLY_EN_SHIFT (2U) -/*! STOP_ACK_DLY_EN - Stop Acknowledge Delay Enable - * 0b0..Enter KEEP_ALIVE mode immediately when there is no USB AHB transfer. - * 0b1..Enter KEEP_ALIVE mode until the USB core is idle and there is no USB AHB transfer. - */ -#define USB_KEEP_ALIVE_CTRL_STOP_ACK_DLY_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_KEEP_ALIVE_CTRL_STOP_ACK_DLY_EN_SHIFT)) & USB_KEEP_ALIVE_CTRL_STOP_ACK_DLY_EN_MASK) - -#define USB_KEEP_ALIVE_CTRL_WAKE_REQ_EN_MASK (0x8U) -#define USB_KEEP_ALIVE_CTRL_WAKE_REQ_EN_SHIFT (3U) -/*! WAKE_REQ_EN - Wakeup Request Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_KEEP_ALIVE_CTRL_WAKE_REQ_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_KEEP_ALIVE_CTRL_WAKE_REQ_EN_SHIFT)) & USB_KEEP_ALIVE_CTRL_WAKE_REQ_EN_MASK) - -#define USB_KEEP_ALIVE_CTRL_WAKE_INT_EN_MASK (0x10U) -#define USB_KEEP_ALIVE_CTRL_WAKE_INT_EN_SHIFT (4U) -/*! WAKE_INT_EN - Wakeup Interrupt Enable */ -#define USB_KEEP_ALIVE_CTRL_WAKE_INT_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_KEEP_ALIVE_CTRL_WAKE_INT_EN_SHIFT)) & USB_KEEP_ALIVE_CTRL_WAKE_INT_EN_MASK) - -#define USB_KEEP_ALIVE_CTRL_KEEP_ALIVE_STS_MASK (0x40U) -#define USB_KEEP_ALIVE_CTRL_KEEP_ALIVE_STS_SHIFT (6U) -/*! KEEP_ALIVE_STS - Keep Alive Status - * 0b0..Not in Keep Alive mode - * 0b1..In Keep Alive mode - */ -#define USB_KEEP_ALIVE_CTRL_KEEP_ALIVE_STS(x) (((uint8_t)(((uint8_t)(x)) << USB_KEEP_ALIVE_CTRL_KEEP_ALIVE_STS_SHIFT)) & USB_KEEP_ALIVE_CTRL_KEEP_ALIVE_STS_MASK) - -#define USB_KEEP_ALIVE_CTRL_WAKE_INT_STS_MASK (0x80U) -#define USB_KEEP_ALIVE_CTRL_WAKE_INT_STS_SHIFT (7U) -/*! WAKE_INT_STS - Wakeup Interrupt Status Flag - * 0b0..Interrupt did not occur - * 0b1..Interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_KEEP_ALIVE_CTRL_WAKE_INT_STS(x) (((uint8_t)(((uint8_t)(x)) << USB_KEEP_ALIVE_CTRL_WAKE_INT_STS_SHIFT)) & USB_KEEP_ALIVE_CTRL_WAKE_INT_STS_MASK) -/*! @} */ - -/*! @name KEEP_ALIVE_WKCTRL - Keep Alive Mode Wakeup Control */ -/*! @{ */ - -#define USB_KEEP_ALIVE_WKCTRL_WAKE_ON_THIS_MASK (0xFU) -#define USB_KEEP_ALIVE_WKCTRL_WAKE_ON_THIS_SHIFT (0U) -/*! WAKE_ON_THIS - Token PID for the wakeup request - * 0b0001..Wake up after receiving OUT or SETUP token packet. - * 0b1101..Wake up after receiving SETUP token packet. All other values are reserved. - */ -#define USB_KEEP_ALIVE_WKCTRL_WAKE_ON_THIS(x) (((uint8_t)(((uint8_t)(x)) << USB_KEEP_ALIVE_WKCTRL_WAKE_ON_THIS_SHIFT)) & USB_KEEP_ALIVE_WKCTRL_WAKE_ON_THIS_MASK) - -#define USB_KEEP_ALIVE_WKCTRL_WAKE_ENDPT_MASK (0xF0U) -#define USB_KEEP_ALIVE_WKCTRL_WAKE_ENDPT_SHIFT (4U) -/*! WAKE_ENDPT - Endpoint address for the wakeup request */ -#define USB_KEEP_ALIVE_WKCTRL_WAKE_ENDPT(x) (((uint8_t)(((uint8_t)(x)) << USB_KEEP_ALIVE_WKCTRL_WAKE_ENDPT_SHIFT)) & USB_KEEP_ALIVE_WKCTRL_WAKE_ENDPT_MASK) -/*! @} */ - -/*! @name MISCCTRL - Miscellaneous Control */ -/*! @{ */ - -#define USB_MISCCTRL_SOFDYNTHLD_MASK (0x1U) -#define USB_MISCCTRL_SOFDYNTHLD_SHIFT (0U) -/*! SOFDYNTHLD - Dynamic SOF Threshold Compare mode - * 0b0..When the byte-times SOF threshold is reached - * 0b1..When 8 byte-times SOF threshold is reached or overstepped - */ -#define USB_MISCCTRL_SOFDYNTHLD(x) (((uint8_t)(((uint8_t)(x)) << USB_MISCCTRL_SOFDYNTHLD_SHIFT)) & USB_MISCCTRL_SOFDYNTHLD_MASK) - -#define USB_MISCCTRL_SOFBUSSET_MASK (0x2U) -#define USB_MISCCTRL_SOFBUSSET_SHIFT (1U) -/*! SOFBUSSET - SOF_TOK Interrupt Generation Mode Select - * 0b0..According to the SOF threshold value - * 0b1..When the SOF counter reaches 0 - */ -#define USB_MISCCTRL_SOFBUSSET(x) (((uint8_t)(((uint8_t)(x)) << USB_MISCCTRL_SOFBUSSET_SHIFT)) & USB_MISCCTRL_SOFBUSSET_MASK) - -#define USB_MISCCTRL_OWNERRISODIS_MASK (0x4U) -#define USB_MISCCTRL_OWNERRISODIS_SHIFT (2U) -/*! OWNERRISODIS - OWN Error Detect for ISO IN and ISO OUT Disable - * 0b0..Enable - * 0b1..Disable - */ -#define USB_MISCCTRL_OWNERRISODIS(x) (((uint8_t)(((uint8_t)(x)) << USB_MISCCTRL_OWNERRISODIS_SHIFT)) & USB_MISCCTRL_OWNERRISODIS_MASK) - -#define USB_MISCCTRL_VREDG_EN_MASK (0x8U) -#define USB_MISCCTRL_VREDG_EN_SHIFT (3U) -/*! VREDG_EN - VREGIN Rising Edge Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_MISCCTRL_VREDG_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_MISCCTRL_VREDG_EN_SHIFT)) & USB_MISCCTRL_VREDG_EN_MASK) - -#define USB_MISCCTRL_VFEDG_EN_MASK (0x10U) -#define USB_MISCCTRL_VFEDG_EN_SHIFT (4U) -/*! VFEDG_EN - VREGIN Falling Edge Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_MISCCTRL_VFEDG_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_MISCCTRL_VFEDG_EN_SHIFT)) & USB_MISCCTRL_VFEDG_EN_MASK) - -#define USB_MISCCTRL_STL_ADJ_EN_MASK (0x80U) -#define USB_MISCCTRL_STL_ADJ_EN_SHIFT (7U) -/*! STL_ADJ_EN - USB Peripheral Mode Stall Adjust Enable - * 0b0..If ENDPTn[END_STALL] = 1, both IN and OUT directions for the associated endpoint stalls. - * 0b1..If ENDPTn[END_STALL] = 1, the STALL_xx_DIS registers control which directions for the associated endpoint stalls. - */ -#define USB_MISCCTRL_STL_ADJ_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_MISCCTRL_STL_ADJ_EN_SHIFT)) & USB_MISCCTRL_STL_ADJ_EN_MASK) -/*! @} */ - -/*! @name STALL_IL_DIS - Peripheral Mode Stall Disable for Endpoints 7 to 0 in IN Direction */ -/*! @{ */ - -#define USB_STALL_IL_DIS_STALL_I_DIS0_MASK (0x1U) -#define USB_STALL_IL_DIS_STALL_I_DIS0_SHIFT (0U) -/*! STALL_I_DIS0 - Disable Endpoint 0 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS0(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS0_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS0_MASK) - -#define USB_STALL_IL_DIS_STALL_I_DIS1_MASK (0x2U) -#define USB_STALL_IL_DIS_STALL_I_DIS1_SHIFT (1U) -/*! STALL_I_DIS1 - Disable Endpoint 1 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS1(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS1_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS1_MASK) - -#define USB_STALL_IL_DIS_STALL_I_DIS2_MASK (0x4U) -#define USB_STALL_IL_DIS_STALL_I_DIS2_SHIFT (2U) -/*! STALL_I_DIS2 - Disable Endpoint 2 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS2(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS2_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS2_MASK) - -#define USB_STALL_IL_DIS_STALL_I_DIS3_MASK (0x8U) -#define USB_STALL_IL_DIS_STALL_I_DIS3_SHIFT (3U) -/*! STALL_I_DIS3 - Disable Endpoint 3 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS3(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS3_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS3_MASK) - -#define USB_STALL_IL_DIS_STALL_I_DIS4_MASK (0x10U) -#define USB_STALL_IL_DIS_STALL_I_DIS4_SHIFT (4U) -/*! STALL_I_DIS4 - Disable Endpoint 4 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS4(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS4_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS4_MASK) - -#define USB_STALL_IL_DIS_STALL_I_DIS5_MASK (0x20U) -#define USB_STALL_IL_DIS_STALL_I_DIS5_SHIFT (5U) -/*! STALL_I_DIS5 - Disable Endpoint 5 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS5(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS5_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS5_MASK) - -#define USB_STALL_IL_DIS_STALL_I_DIS6_MASK (0x40U) -#define USB_STALL_IL_DIS_STALL_I_DIS6_SHIFT (6U) -/*! STALL_I_DIS6 - Disable Endpoint 6 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS6(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS6_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS6_MASK) - -#define USB_STALL_IL_DIS_STALL_I_DIS7_MASK (0x80U) -#define USB_STALL_IL_DIS_STALL_I_DIS7_SHIFT (7U) -/*! STALL_I_DIS7 - Disable Endpoint 7 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IL_DIS_STALL_I_DIS7(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IL_DIS_STALL_I_DIS7_SHIFT)) & USB_STALL_IL_DIS_STALL_I_DIS7_MASK) -/*! @} */ - -/*! @name STALL_IH_DIS - Peripheral Mode Stall Disable for Endpoints 15 to 8 in IN Direction */ -/*! @{ */ - -#define USB_STALL_IH_DIS_STALL_I_DIS8_MASK (0x1U) -#define USB_STALL_IH_DIS_STALL_I_DIS8_SHIFT (0U) -/*! STALL_I_DIS8 - Disable Endpoint 8 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS8(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS8_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS8_MASK) - -#define USB_STALL_IH_DIS_STALL_I_DIS9_MASK (0x2U) -#define USB_STALL_IH_DIS_STALL_I_DIS9_SHIFT (1U) -/*! STALL_I_DIS9 - Disable Endpoint 9 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS9(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS9_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS9_MASK) - -#define USB_STALL_IH_DIS_STALL_I_DIS10_MASK (0x4U) -#define USB_STALL_IH_DIS_STALL_I_DIS10_SHIFT (2U) -/*! STALL_I_DIS10 - Disable Endpoint 10 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS10(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS10_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS10_MASK) - -#define USB_STALL_IH_DIS_STALL_I_DIS11_MASK (0x8U) -#define USB_STALL_IH_DIS_STALL_I_DIS11_SHIFT (3U) -/*! STALL_I_DIS11 - Disable Endpoint 11 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS11(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS11_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS11_MASK) - -#define USB_STALL_IH_DIS_STALL_I_DIS12_MASK (0x10U) -#define USB_STALL_IH_DIS_STALL_I_DIS12_SHIFT (4U) -/*! STALL_I_DIS12 - Disable Endpoint 12 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS12(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS12_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS12_MASK) - -#define USB_STALL_IH_DIS_STALL_I_DIS13_MASK (0x20U) -#define USB_STALL_IH_DIS_STALL_I_DIS13_SHIFT (5U) -/*! STALL_I_DIS13 - Disable Endpoint 13 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS13(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS13_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS13_MASK) - -#define USB_STALL_IH_DIS_STALL_I_DIS14_MASK (0x40U) -#define USB_STALL_IH_DIS_STALL_I_DIS14_SHIFT (6U) -/*! STALL_I_DIS14 - Disable Endpoint 14 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS14(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS14_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS14_MASK) - -#define USB_STALL_IH_DIS_STALL_I_DIS15_MASK (0x80U) -#define USB_STALL_IH_DIS_STALL_I_DIS15_SHIFT (7U) -/*! STALL_I_DIS15 - Disable Endpoint 15 IN Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_IH_DIS_STALL_I_DIS15(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_IH_DIS_STALL_I_DIS15_SHIFT)) & USB_STALL_IH_DIS_STALL_I_DIS15_MASK) -/*! @} */ - -/*! @name STALL_OL_DIS - Peripheral Mode Stall Disable for Endpoints 7 to 0 in OUT Direction */ -/*! @{ */ - -#define USB_STALL_OL_DIS_STALL_O_DIS0_MASK (0x1U) -#define USB_STALL_OL_DIS_STALL_O_DIS0_SHIFT (0U) -/*! STALL_O_DIS0 - Disable Endpoint 0 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS0(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS0_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS0_MASK) - -#define USB_STALL_OL_DIS_STALL_O_DIS1_MASK (0x2U) -#define USB_STALL_OL_DIS_STALL_O_DIS1_SHIFT (1U) -/*! STALL_O_DIS1 - Disable Endpoint 1 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS1(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS1_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS1_MASK) - -#define USB_STALL_OL_DIS_STALL_O_DIS2_MASK (0x4U) -#define USB_STALL_OL_DIS_STALL_O_DIS2_SHIFT (2U) -/*! STALL_O_DIS2 - Disable Endpoint 2 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS2(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS2_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS2_MASK) - -#define USB_STALL_OL_DIS_STALL_O_DIS3_MASK (0x8U) -#define USB_STALL_OL_DIS_STALL_O_DIS3_SHIFT (3U) -/*! STALL_O_DIS3 - Disable Endpoint 3 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS3(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS3_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS3_MASK) - -#define USB_STALL_OL_DIS_STALL_O_DIS4_MASK (0x10U) -#define USB_STALL_OL_DIS_STALL_O_DIS4_SHIFT (4U) -/*! STALL_O_DIS4 - Disable Endpoint 4 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS4(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS4_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS4_MASK) - -#define USB_STALL_OL_DIS_STALL_O_DIS5_MASK (0x20U) -#define USB_STALL_OL_DIS_STALL_O_DIS5_SHIFT (5U) -/*! STALL_O_DIS5 - Disable Endpoint 5 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS5(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS5_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS5_MASK) - -#define USB_STALL_OL_DIS_STALL_O_DIS6_MASK (0x40U) -#define USB_STALL_OL_DIS_STALL_O_DIS6_SHIFT (6U) -/*! STALL_O_DIS6 - Disable Endpoint 6 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS6(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS6_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS6_MASK) - -#define USB_STALL_OL_DIS_STALL_O_DIS7_MASK (0x80U) -#define USB_STALL_OL_DIS_STALL_O_DIS7_SHIFT (7U) -/*! STALL_O_DIS7 - Disable Endpoint 7 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OL_DIS_STALL_O_DIS7(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OL_DIS_STALL_O_DIS7_SHIFT)) & USB_STALL_OL_DIS_STALL_O_DIS7_MASK) -/*! @} */ - -/*! @name STALL_OH_DIS - Peripheral Mode Stall Disable for Endpoints 15 to 8 in OUT Direction */ -/*! @{ */ - -#define USB_STALL_OH_DIS_STALL_O_DIS8_MASK (0x1U) -#define USB_STALL_OH_DIS_STALL_O_DIS8_SHIFT (0U) -/*! STALL_O_DIS8 - Disable Endpoint 8 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS8(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS8_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS8_MASK) - -#define USB_STALL_OH_DIS_STALL_O_DIS9_MASK (0x2U) -#define USB_STALL_OH_DIS_STALL_O_DIS9_SHIFT (1U) -/*! STALL_O_DIS9 - Disable Endpoint 9 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS9(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS9_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS9_MASK) - -#define USB_STALL_OH_DIS_STALL_O_DIS10_MASK (0x4U) -#define USB_STALL_OH_DIS_STALL_O_DIS10_SHIFT (2U) -/*! STALL_O_DIS10 - Disable Endpoint 10 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS10(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS10_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS10_MASK) - -#define USB_STALL_OH_DIS_STALL_O_DIS11_MASK (0x8U) -#define USB_STALL_OH_DIS_STALL_O_DIS11_SHIFT (3U) -/*! STALL_O_DIS11 - Disable Endpoint 11 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS11(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS11_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS11_MASK) - -#define USB_STALL_OH_DIS_STALL_O_DIS12_MASK (0x10U) -#define USB_STALL_OH_DIS_STALL_O_DIS12_SHIFT (4U) -/*! STALL_O_DIS12 - Disable endpoint 12 OUT direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS12(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS12_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS12_MASK) - -#define USB_STALL_OH_DIS_STALL_O_DIS13_MASK (0x20U) -#define USB_STALL_OH_DIS_STALL_O_DIS13_SHIFT (5U) -/*! STALL_O_DIS13 - Disable Endpoint 13 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS13(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS13_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS13_MASK) - -#define USB_STALL_OH_DIS_STALL_O_DIS14_MASK (0x40U) -#define USB_STALL_OH_DIS_STALL_O_DIS14_SHIFT (6U) -/*! STALL_O_DIS14 - Disable Endpoint 14 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS14(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS14_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS14_MASK) - -#define USB_STALL_OH_DIS_STALL_O_DIS15_MASK (0x80U) -#define USB_STALL_OH_DIS_STALL_O_DIS15_SHIFT (7U) -/*! STALL_O_DIS15 - Disable Endpoint 15 OUT Direction - * 0b0..Enable - * 0b1..Disable - */ -#define USB_STALL_OH_DIS_STALL_O_DIS15(x) (((uint8_t)(((uint8_t)(x)) << USB_STALL_OH_DIS_STALL_O_DIS15_SHIFT)) & USB_STALL_OH_DIS_STALL_O_DIS15_MASK) -/*! @} */ - -/*! @name CLK_RECOVER_CTRL - USB Clock Recovery Control */ -/*! @{ */ - -#define USB_CLK_RECOVER_CTRL_TRIM_INIT_VAL_SEL_MASK (0x8U) -#define USB_CLK_RECOVER_CTRL_TRIM_INIT_VAL_SEL_SHIFT (3U) -/*! TRIM_INIT_VAL_SEL - Selects the source for the initial FIRC trim fine value used after a reset. - * 0b0..Mid-scale - * 0b1..IFR - */ -#define USB_CLK_RECOVER_CTRL_TRIM_INIT_VAL_SEL(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_CTRL_TRIM_INIT_VAL_SEL_SHIFT)) & USB_CLK_RECOVER_CTRL_TRIM_INIT_VAL_SEL_MASK) - -#define USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN_MASK (0x20U) -#define USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN_SHIFT (5U) -/*! RESTART_IFRTRIM_EN - Restart from IFR Trim Value - * 0b0..Trim fine adjustment always works based on the previous updated trim fine value. - * 0b1..Trim fine restarts from the IFR trim value whenever you detect bus_reset or bus_resume or deassert module enable. - */ -#define USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN_SHIFT)) & USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN_MASK) - -#define USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN_MASK (0x40U) -#define USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN_SHIFT (6U) -/*! RESET_RESUME_ROUGH_EN - Reset or Resume to Rough Phase Enable - * 0b0..Always works in tracking phase after the first time rough phase, to track transition. - * 0b1..Go back to rough stage whenever a bus reset or bus resume occurs. - */ -#define USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN_SHIFT)) & USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN_MASK) - -#define USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN_MASK (0x80U) -#define USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN_SHIFT (7U) -/*! CLOCK_RECOVER_EN - Crystal-Less USB Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN_SHIFT)) & USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN_MASK) -/*! @} */ - -/*! @name CLK_RECOVER_IRC_EN - FIRC Oscillator Enable */ -/*! @{ */ - -#define USB_CLK_RECOVER_IRC_EN_IRC_EN_MASK (0x2U) -#define USB_CLK_RECOVER_IRC_EN_IRC_EN_SHIFT (1U) -/*! IRC_EN - Fast IRC enable - * 0b0..Disable - * 0b1..Enable - */ -#define USB_CLK_RECOVER_IRC_EN_IRC_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_IRC_EN_IRC_EN_SHIFT)) & USB_CLK_RECOVER_IRC_EN_IRC_EN_MASK) -/*! @} */ - -/*! @name CLK_RECOVER_INT_EN - Clock Recovery Combined Interrupt Enable */ -/*! @{ */ - -#define USB_CLK_RECOVER_INT_EN_OVF_ERROR_EN_MASK (0x10U) -#define USB_CLK_RECOVER_INT_EN_OVF_ERROR_EN_SHIFT (4U) -/*! OVF_ERROR_EN - Overflow error interrupt enable - * 0b0..The interrupt is masked - * 0b1..The interrupt is enabled - */ -#define USB_CLK_RECOVER_INT_EN_OVF_ERROR_EN(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_INT_EN_OVF_ERROR_EN_SHIFT)) & USB_CLK_RECOVER_INT_EN_OVF_ERROR_EN_MASK) -/*! @} */ - -/*! @name CLK_RECOVER_INT_STATUS - Clock Recovery Separated Interrupt Status */ -/*! @{ */ - -#define USB_CLK_RECOVER_INT_STATUS_OVF_ERROR_MASK (0x10U) -#define USB_CLK_RECOVER_INT_STATUS_OVF_ERROR_SHIFT (4U) -/*! OVF_ERROR - Overflow Error Interrupt Status Flag - * 0b0..Interrupt did not occur - * 0b1..Unmasked interrupt occurred - * 0b0..No effect - * 0b1..Clear the flag - */ -#define USB_CLK_RECOVER_INT_STATUS_OVF_ERROR(x) (((uint8_t)(((uint8_t)(x)) << USB_CLK_RECOVER_INT_STATUS_OVF_ERROR_SHIFT)) & USB_CLK_RECOVER_INT_STATUS_OVF_ERROR_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group USB_Register_Masks */ - - -/* USB - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral USBFS0 base address */ - #define USBFS0_BASE (0x500DD000u) - /** Peripheral USBFS0 base address */ - #define USBFS0_BASE_NS (0x400DD000u) - /** Peripheral USBFS0 base pointer */ - #define USBFS0 ((USB_Type *)USBFS0_BASE) - /** Peripheral USBFS0 base pointer */ - #define USBFS0_NS ((USB_Type *)USBFS0_BASE_NS) - /** Array initializer of USB peripheral base addresses */ - #define USB_BASE_ADDRS { USBFS0_BASE } - /** Array initializer of USB peripheral base pointers */ - #define USB_BASE_PTRS { USBFS0 } - /** Array initializer of USB peripheral base addresses */ - #define USB_BASE_ADDRS_NS { USBFS0_BASE_NS } - /** Array initializer of USB peripheral base pointers */ - #define USB_BASE_PTRS_NS { USBFS0_NS } -#else - /** Peripheral USBFS0 base address */ - #define USBFS0_BASE (0x400DD000u) - /** Peripheral USBFS0 base pointer */ - #define USBFS0 ((USB_Type *)USBFS0_BASE) - /** Array initializer of USB peripheral base addresses */ - #define USB_BASE_ADDRS { USBFS0_BASE } - /** Array initializer of USB peripheral base pointers */ - #define USB_BASE_PTRS { USBFS0 } -#endif -/** Interrupt vectors for the USB peripheral type */ -#define USB_IRQS { USB0_FS_IRQn } -/* Backward compatibility */ -#define USBFS_IRQS USB_IRQS -#define USBFS_IRQHandler USB0_FS_IRQHandler - - -/*! - * @} - */ /* end of group USB_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- USBDCD Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USBDCD_Peripheral_Access_Layer USBDCD Peripheral Access Layer - * @{ - */ - -/** USBDCD - Register Layout Typedef */ -typedef struct { - __IO uint32_t CONTROL; /**< Control, offset: 0x0 */ - __IO uint32_t CLOCK; /**< Clock, offset: 0x4 */ - __I uint32_t STATUS; /**< Status, offset: 0x8 */ - __IO uint32_t SIGNAL_OVERRIDE; /**< Signal Override, offset: 0xC */ - __IO uint32_t TIMER0; /**< TIMER0, offset: 0x10 */ - __IO uint32_t TIMER1; /**< TIMER1, offset: 0x14 */ - union { /* offset: 0x18 */ - __IO uint32_t TIMER2_BC11; /**< TIMER2_BC11, offset: 0x18 */ - __IO uint32_t TIMER2_BC12; /**< TIMER2_BC12, offset: 0x18 */ - }; -} USBDCD_Type; - -/* ---------------------------------------------------------------------------- - -- USBDCD Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USBDCD_Register_Masks USBDCD Register Masks - * @{ - */ - -/*! @name CONTROL - Control */ -/*! @{ */ - -#define USBDCD_CONTROL_IACK_MASK (0x1U) -#define USBDCD_CONTROL_IACK_SHIFT (0U) -/*! IACK - Interrupt Acknowledge - * 0b0..Do not clear the interrupt. - * 0b1..Clear the IF field (interrupt flag). - */ -#define USBDCD_CONTROL_IACK(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_CONTROL_IACK_SHIFT)) & USBDCD_CONTROL_IACK_MASK) - -#define USBDCD_CONTROL_IF_MASK (0x100U) -#define USBDCD_CONTROL_IF_SHIFT (8U) -/*! IF - Interrupt Flag - * 0b0..No interrupt is pending. - * 0b1..An interrupt is pending. - */ -#define USBDCD_CONTROL_IF(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_CONTROL_IF_SHIFT)) & USBDCD_CONTROL_IF_MASK) - -#define USBDCD_CONTROL_IE_MASK (0x10000U) -#define USBDCD_CONTROL_IE_SHIFT (16U) -/*! IE - Interrupt Enable - * 0b0..Disable interrupts to the system. - * 0b1..Enable interrupts to the system. - */ -#define USBDCD_CONTROL_IE(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_CONTROL_IE_SHIFT)) & USBDCD_CONTROL_IE_MASK) - -#define USBDCD_CONTROL_BC12_MASK (0x20000U) -#define USBDCD_CONTROL_BC12_SHIFT (17U) -/*! BC12 - Battery Charging Revision 1.2 Compatibility - * 0b0..Compatible with BC1.1 - * 0b1..Compatible with BC1.2 (default) - */ -#define USBDCD_CONTROL_BC12(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_CONTROL_BC12_SHIFT)) & USBDCD_CONTROL_BC12_MASK) - -#define USBDCD_CONTROL_START_MASK (0x1000000U) -#define USBDCD_CONTROL_START_SHIFT (24U) -/*! START - Start Change Detection Sequence - * 0b0..Do not start the sequence. Writes of this value have no effect. - * 0b1..Initiate the charger detection sequence. If the sequence is already running, writes of this value have no effect. - */ -#define USBDCD_CONTROL_START(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_CONTROL_START_SHIFT)) & USBDCD_CONTROL_START_MASK) - -#define USBDCD_CONTROL_SR_MASK (0x2000000U) -#define USBDCD_CONTROL_SR_SHIFT (25U) -/*! SR - Software Reset - * 0b0..Do not perform a software reset. - * 0b1..Perform a software reset. - */ -#define USBDCD_CONTROL_SR(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_CONTROL_SR_SHIFT)) & USBDCD_CONTROL_SR_MASK) -/*! @} */ - -/*! @name CLOCK - Clock */ -/*! @{ */ - -#define USBDCD_CLOCK_CLOCK_UNIT_MASK (0x1U) -#define USBDCD_CLOCK_CLOCK_UNIT_SHIFT (0U) -/*! CLOCK_UNIT - Unit of Measurement Encoding for Clock Speed - * 0b0..kHz Speed (between 4 kHz and 1023 kHz) - * 0b1..MHz Speed (between 1 MHz and 1023 MHz) - */ -#define USBDCD_CLOCK_CLOCK_UNIT(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_CLOCK_CLOCK_UNIT_SHIFT)) & USBDCD_CLOCK_CLOCK_UNIT_MASK) - -#define USBDCD_CLOCK_CLOCK_SPEED_MASK (0xFFCU) -#define USBDCD_CLOCK_CLOCK_SPEED_SHIFT (2U) -/*! CLOCK_SPEED - Numerical Value of Clock Speed in Binary */ -#define USBDCD_CLOCK_CLOCK_SPEED(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_CLOCK_CLOCK_SPEED_SHIFT)) & USBDCD_CLOCK_CLOCK_SPEED_MASK) -/*! @} */ - -/*! @name STATUS - Status */ -/*! @{ */ - -#define USBDCD_STATUS_SEQ_RES_MASK (0x30000U) -#define USBDCD_STATUS_SEQ_RES_SHIFT (16U) -/*! SEQ_RES - Charger Detection Sequence Results - * 0b00..No results to report. - * 0b01..Attached to an SDP. Must comply with USB 2.0 by drawing only 2.5 mA (max) until connected. - * 0b10..Attached to a charging port. The exact meaning depends on the STATUS[SEQ_STAT] field (value 0: Attached - * to either a CDP or a DCP. The charger type detection has not completed. value 1: Attached to a CDP. The - * charger type detection has completed.) - * 0b11..Attached to a DCP. - */ -#define USBDCD_STATUS_SEQ_RES(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_STATUS_SEQ_RES_SHIFT)) & USBDCD_STATUS_SEQ_RES_MASK) - -#define USBDCD_STATUS_SEQ_STAT_MASK (0xC0000U) -#define USBDCD_STATUS_SEQ_STAT_SHIFT (18U) -/*! SEQ_STAT - Charger Detection Sequence Status - * 0b00..The module is either not enabled, or the module is enabled but the data pins have not yet been detected. - * 0b01..Data pin contact detection is complete. - * 0b10..Charging port detection is complete. - * 0b11..Charger type detection is complete. - */ -#define USBDCD_STATUS_SEQ_STAT(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_STATUS_SEQ_STAT_SHIFT)) & USBDCD_STATUS_SEQ_STAT_MASK) - -#define USBDCD_STATUS_ERR_MASK (0x100000U) -#define USBDCD_STATUS_ERR_SHIFT (20U) -/*! ERR - Error Flag - * 0b0..No sequence errors. - * 0b1..Error in the detection sequence. - */ -#define USBDCD_STATUS_ERR(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_STATUS_ERR_SHIFT)) & USBDCD_STATUS_ERR_MASK) - -#define USBDCD_STATUS_TO_MASK (0x200000U) -#define USBDCD_STATUS_TO_SHIFT (21U) -/*! TO - Timeout Flag - * 0b0..The detection sequence is not running for over 1 s. - * 0b1..It is over 1 s since the data pin contact was detected and debounced. - */ -#define USBDCD_STATUS_TO(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_STATUS_TO_SHIFT)) & USBDCD_STATUS_TO_MASK) - -#define USBDCD_STATUS_ACTIVE_MASK (0x400000U) -#define USBDCD_STATUS_ACTIVE_SHIFT (22U) -/*! ACTIVE - Active Status Indicator - * 0b0..The sequence is not running. - * 0b1..The sequence is running. - */ -#define USBDCD_STATUS_ACTIVE(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_STATUS_ACTIVE_SHIFT)) & USBDCD_STATUS_ACTIVE_MASK) -/*! @} */ - -/*! @name SIGNAL_OVERRIDE - Signal Override */ -/*! @{ */ - -#define USBDCD_SIGNAL_OVERRIDE_PS_MASK (0x7U) -#define USBDCD_SIGNAL_OVERRIDE_PS_SHIFT (0U) -/*! PS - Phase Selection - * 0b000..No overrides. Field must remain at this value during normal USB data communication to prevent - * unexpected conditions on USB_DP and USB_DM pins. (Default) - * 0b001..Reserved, not for customer use. - * 0b010..Enables VDP_SRC voltage source for the USB_DP pin and IDM_SINK current source for the USB_DM pin. - * 0b011..Reserved, not for customer use. - * 0b100..Enables VDM_SRC voltage source only. - * 0b101..Reserved, not for customer use. - * 0b110..Reserved, not for customer use. - * 0b111..Reserved, not for customer use. - */ -#define USBDCD_SIGNAL_OVERRIDE_PS(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_SIGNAL_OVERRIDE_PS_SHIFT)) & USBDCD_SIGNAL_OVERRIDE_PS_MASK) -/*! @} */ - -/*! @name TIMER0 - TIMER0 */ -/*! @{ */ - -#define USBDCD_TIMER0_TUNITCON_MASK (0xFFFU) -#define USBDCD_TIMER0_TUNITCON_SHIFT (0U) -/*! TUNITCON - Unit Connection Timer Elapse (in ms) */ -#define USBDCD_TIMER0_TUNITCON(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_TIMER0_TUNITCON_SHIFT)) & USBDCD_TIMER0_TUNITCON_MASK) - -#define USBDCD_TIMER0_TSEQ_INIT_MASK (0x3FF0000U) -#define USBDCD_TIMER0_TSEQ_INIT_SHIFT (16U) -/*! TSEQ_INIT - Sequence Initiation Time - * 0b0000000000-0b1111111111..0 ms - 1023 ms - */ -#define USBDCD_TIMER0_TSEQ_INIT(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_TIMER0_TSEQ_INIT_SHIFT)) & USBDCD_TIMER0_TSEQ_INIT_MASK) -/*! @} */ - -/*! @name TIMER1 - TIMER1 */ -/*! @{ */ - -#define USBDCD_TIMER1_TVDPSRC_ON_MASK (0x3FFU) -#define USBDCD_TIMER1_TVDPSRC_ON_SHIFT (0U) -/*! TVDPSRC_ON - Time Period Comparator Enabled - * 0b0000000001-0b1111111111..1 ms - 1023 ms - */ -#define USBDCD_TIMER1_TVDPSRC_ON(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_TIMER1_TVDPSRC_ON_SHIFT)) & USBDCD_TIMER1_TVDPSRC_ON_MASK) - -#define USBDCD_TIMER1_TDCD_DBNC_MASK (0x3FF0000U) -#define USBDCD_TIMER1_TDCD_DBNC_SHIFT (16U) -/*! TDCD_DBNC - Time Period to Debounce D+ Signal - * 0b0000000001-0b1111111111..1 ms - 1023 ms - */ -#define USBDCD_TIMER1_TDCD_DBNC(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_TIMER1_TDCD_DBNC_SHIFT)) & USBDCD_TIMER1_TDCD_DBNC_MASK) -/*! @} */ - -/*! @name TIMER2_BC11 - TIMER2_BC11 */ -/*! @{ */ - -#define USBDCD_TIMER2_BC11_CHECK_DM_MASK (0xFU) -#define USBDCD_TIMER2_BC11_CHECK_DM_SHIFT (0U) -/*! CHECK_DM - Time Before Check of D- Line - * 0b0001-0b1111..1 ms - 15 ms - */ -#define USBDCD_TIMER2_BC11_CHECK_DM(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_TIMER2_BC11_CHECK_DM_SHIFT)) & USBDCD_TIMER2_BC11_CHECK_DM_MASK) - -#define USBDCD_TIMER2_BC11_TVDPSRC_CON_MASK (0x3FF0000U) -#define USBDCD_TIMER2_BC11_TVDPSRC_CON_SHIFT (16U) -/*! TVDPSRC_CON - Time Period Before Enabling D+ Pullup - * 0b0000000001-0b1111111111..1 ms - 1023 ms - */ -#define USBDCD_TIMER2_BC11_TVDPSRC_CON(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_TIMER2_BC11_TVDPSRC_CON_SHIFT)) & USBDCD_TIMER2_BC11_TVDPSRC_CON_MASK) -/*! @} */ - -/*! @name TIMER2_BC12 - TIMER2_BC12 */ -/*! @{ */ - -#define USBDCD_TIMER2_BC12_TVDMSRC_ON_MASK (0x3FFU) -#define USBDCD_TIMER2_BC12_TVDMSRC_ON_SHIFT (0U) -/*! TVDMSRC_ON - TVDMSRC_ON - * 0b0000000000-0b0000101000..0 ms - 40 ms - */ -#define USBDCD_TIMER2_BC12_TVDMSRC_ON(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_TIMER2_BC12_TVDMSRC_ON_SHIFT)) & USBDCD_TIMER2_BC12_TVDMSRC_ON_MASK) - -#define USBDCD_TIMER2_BC12_TWAIT_AFTER_PRD_MASK (0x3FF0000U) -#define USBDCD_TIMER2_BC12_TWAIT_AFTER_PRD_SHIFT (16U) -/*! TWAIT_AFTER_PRD - TWAIT_AFTER_PRD - * 0b0000000001-0b1111111111..1 ms - 1023 ms - */ -#define USBDCD_TIMER2_BC12_TWAIT_AFTER_PRD(x) (((uint32_t)(((uint32_t)(x)) << USBDCD_TIMER2_BC12_TWAIT_AFTER_PRD_SHIFT)) & USBDCD_TIMER2_BC12_TWAIT_AFTER_PRD_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group USBDCD_Register_Masks */ - - -/* USBDCD - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral USBDCD0 base address */ - #define USBDCD0_BASE (0x500DC000u) - /** Peripheral USBDCD0 base address */ - #define USBDCD0_BASE_NS (0x400DC000u) - /** Peripheral USBDCD0 base pointer */ - #define USBDCD0 ((USBDCD_Type *)USBDCD0_BASE) - /** Peripheral USBDCD0 base pointer */ - #define USBDCD0_NS ((USBDCD_Type *)USBDCD0_BASE_NS) - /** Array initializer of USBDCD peripheral base addresses */ - #define USBDCD_BASE_ADDRS { USBDCD0_BASE } - /** Array initializer of USBDCD peripheral base pointers */ - #define USBDCD_BASE_PTRS { USBDCD0 } - /** Array initializer of USBDCD peripheral base addresses */ - #define USBDCD_BASE_ADDRS_NS { USBDCD0_BASE_NS } - /** Array initializer of USBDCD peripheral base pointers */ - #define USBDCD_BASE_PTRS_NS { USBDCD0_NS } -#else - /** Peripheral USBDCD0 base address */ - #define USBDCD0_BASE (0x400DC000u) - /** Peripheral USBDCD0 base pointer */ - #define USBDCD0 ((USBDCD_Type *)USBDCD0_BASE) - /** Array initializer of USBDCD peripheral base addresses */ - #define USBDCD_BASE_ADDRS { USBDCD0_BASE } - /** Array initializer of USBDCD peripheral base pointers */ - #define USBDCD_BASE_PTRS { USBDCD0 } -#endif -/** Interrupt vectors for the USBDCD peripheral type */ -#define USBDCD_IRQS { USB0_DCD_IRQn } - -/*! - * @} - */ /* end of group USBDCD_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- USBHS Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USBHS_Peripheral_Access_Layer USBHS Peripheral Access Layer - * @{ - */ - -/** USBHS - Register Layout Typedef */ -typedef struct { - __I uint32_t ID; /**< Identification, offset: 0x0 */ - __I uint32_t HWGENERAL; /**< Hardware General, offset: 0x4 */ - __I uint32_t HWHOST; /**< Host Hardware Parameters, offset: 0x8 */ - __I uint32_t HWDEVICE; /**< Device Hardware Parameters, offset: 0xC */ - __I uint32_t HWTXBUF; /**< TX Buffer Hardware Parameters, offset: 0x10 */ - __I uint32_t HWRXBUF; /**< RX Buffer Hardware Parameters, offset: 0x14 */ - uint8_t RESERVED_0[104]; - __IO uint32_t GPTIMER0LD; /**< General Purpose Timer #0 Load, offset: 0x80 */ - __IO uint32_t GPTIMER0CTRL; /**< General Purpose Timer #0 Controller, offset: 0x84 */ - __IO uint32_t GPTIMER1LD; /**< General Purpose Timer #1 Load, offset: 0x88 */ - __IO uint32_t GPTIMER1CTRL; /**< General Purpose Timer #1 Controller, offset: 0x8C */ - __IO uint32_t SBUSCFG; /**< System Bus Config, offset: 0x90 */ - uint8_t RESERVED_1[108]; - __I uint8_t CAPLENGTH; /**< Capability Registers Length, offset: 0x100 */ - uint8_t RESERVED_2[1]; - __I uint16_t HCIVERSION; /**< Host Controller Interface Version, offset: 0x102 */ - __I uint32_t HCSPARAMS; /**< Host Controller Structural Parameters, offset: 0x104 */ - __I uint32_t HCCPARAMS; /**< Host Controller Capability Parameters, offset: 0x108 */ - uint8_t RESERVED_3[20]; - __I uint16_t DCIVERSION; /**< Device Controller Interface Version, offset: 0x120 */ - uint8_t RESERVED_4[2]; - __I uint32_t DCCPARAMS; /**< Device Controller Capability Parameters, offset: 0x124 */ - uint8_t RESERVED_5[24]; - __IO uint32_t USBCMD; /**< USB Command, offset: 0x140 */ - __IO uint32_t USBSTS; /**< USB Status, offset: 0x144 */ - __IO uint32_t USBINTR; /**< Interrupt Enable, offset: 0x148 */ - __IO uint32_t FRINDEX; /**< USB Frame Index, offset: 0x14C */ - uint8_t RESERVED_6[4]; - union { /* offset: 0x154 */ - __IO uint32_t DEVICEADDR; /**< Device Address, offset: 0x154 */ - __IO uint32_t PERIODICLISTBASE; /**< Frame List Base Address, offset: 0x154 */ - }; - union { /* offset: 0x158 */ - __IO uint32_t ASYNCLISTADDR; /**< Next Asynch. Address, offset: 0x158 */ - __IO uint32_t ENDPTLISTADDR; /**< Endpoint List Address, offset: 0x158 */ - }; - uint8_t RESERVED_7[4]; - __IO uint32_t BURSTSIZE; /**< Programmable Burst Size, offset: 0x160 */ - __IO uint32_t TXFILLTUNING; /**< TX FIFO Fill Tuning, offset: 0x164 */ - uint8_t RESERVED_8[16]; - __IO uint32_t ENDPTNAK; /**< Endpoint NAK, offset: 0x178 */ - __IO uint32_t ENDPTNAKEN; /**< Endpoint NAK Enable, offset: 0x17C */ - __I uint32_t CONFIGFLAG; /**< Configure Flag, offset: 0x180 */ - __IO uint32_t PORTSC1; /**< Port Status & Control, offset: 0x184 */ - uint8_t RESERVED_9[28]; - __IO uint32_t OTGSC; /**< On-The-Go Status & Control, offset: 0x1A4 */ - __IO uint32_t USBMODE; /**< USB Device Mode, offset: 0x1A8 */ - __IO uint32_t ENDPTSETUPSTAT; /**< Endpoint Setup Status, offset: 0x1AC */ - __IO uint32_t ENDPTPRIME; /**< Endpoint Prime, offset: 0x1B0 */ - __IO uint32_t ENDPTFLUSH; /**< Endpoint Flush, offset: 0x1B4 */ - __I uint32_t ENDPTSTAT; /**< Endpoint Status, offset: 0x1B8 */ - __IO uint32_t ENDPTCOMPLETE; /**< Endpoint Complete, offset: 0x1BC */ - __IO uint32_t ENDPTCTRL0; /**< Endpoint Control 0, offset: 0x1C0 */ - __IO uint32_t ENDPTCTRL[7]; /**< Endpoint Control 1..Endpoint Control 7, array offset: 0x1C4, array step: 0x4 */ -} USBHS_Type; - -/* ---------------------------------------------------------------------------- - -- USBHS Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USBHS_Register_Masks USBHS Register Masks - * @{ - */ - -/*! @name ID - Identification */ -/*! @{ */ - -#define USBHS_ID_ID_MASK (0x3FU) -#define USBHS_ID_ID_SHIFT (0U) -/*! ID - Configuration Number */ -#define USBHS_ID_ID(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ID_ID_SHIFT)) & USBHS_ID_ID_MASK) - -#define USBHS_ID_NID_MASK (0x3F00U) -#define USBHS_ID_NID_SHIFT (8U) -/*! NID - Complement Version of ID */ -#define USBHS_ID_NID(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ID_NID_SHIFT)) & USBHS_ID_NID_MASK) - -#define USBHS_ID_REVISION_MASK (0xFF0000U) -#define USBHS_ID_REVISION_SHIFT (16U) -/*! REVISION - Revision Number of the Controller Core */ -#define USBHS_ID_REVISION(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ID_REVISION_SHIFT)) & USBHS_ID_REVISION_MASK) -/*! @} */ - -/*! @name HWGENERAL - Hardware General */ -/*! @{ */ - -#define USBHS_HWGENERAL_PHYW_MASK (0x30U) -#define USBHS_HWGENERAL_PHYW_SHIFT (4U) -/*! PHYW - Data width of the transceiver connected to the controller core - * 0b00..8 bit wide data bus (Software non-programmable) - * 0b01..16 bit wide data bus (Software non-programmable) - * 0b10..Reset to 8 bit wide data bus (Software programmable) - * 0b11..Reset to 16 bit wide data bus (Software programmable) - */ -#define USBHS_HWGENERAL_PHYW(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWGENERAL_PHYW_SHIFT)) & USBHS_HWGENERAL_PHYW_MASK) - -#define USBHS_HWGENERAL_PHYM_MASK (0x1C0U) -#define USBHS_HWGENERAL_PHYM_SHIFT (6U) -/*! PHYM - Transceiver Type - * 0b000..UTMI/UMTI+ - * 0b001..ULPI DDR - * 0b010..ULPI - * 0b011..Serial Only - * 0b100..Software programmable - reset to UTMI/UTMI+ - * 0b101..Software programmable - reset to ULPI DDR - * 0b110..Software programmable - reset to ULPI - * 0b111..Software programmable - reset to Serial - */ -#define USBHS_HWGENERAL_PHYM(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWGENERAL_PHYM_SHIFT)) & USBHS_HWGENERAL_PHYM_MASK) - -#define USBHS_HWGENERAL_SM_MASK (0x600U) -#define USBHS_HWGENERAL_SM_SHIFT (9U) -/*! SM - Serial interface mode capability - * 0b00..No Serial Engine, always use parallel signalling - * 0b01..Serial Engine present, always use serial signalling for FS/LS - * 0b10..Software programmable - Reset to use parallel signalling for FS/LS - * 0b11..Software programmable - Reset to use serial signalling for FS/LS - */ -#define USBHS_HWGENERAL_SM(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWGENERAL_SM_SHIFT)) & USBHS_HWGENERAL_SM_MASK) -/*! @} */ - -/*! @name HWHOST - Host Hardware Parameters */ -/*! @{ */ - -#define USBHS_HWHOST_HC_MASK (0x1U) -#define USBHS_HWHOST_HC_SHIFT (0U) -/*! HC - Host Capable - * 0b1..Supported - * 0b0..Not supported - */ -#define USBHS_HWHOST_HC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWHOST_HC_SHIFT)) & USBHS_HWHOST_HC_MASK) - -#define USBHS_HWHOST_NPORT_MASK (0xEU) -#define USBHS_HWHOST_NPORT_SHIFT (1U) -/*! NPORT - The Number of downstream ports supported by the host controller is (NPORT+1) */ -#define USBHS_HWHOST_NPORT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWHOST_NPORT_SHIFT)) & USBHS_HWHOST_NPORT_MASK) -/*! @} */ - -/*! @name HWDEVICE - Device Hardware Parameters */ -/*! @{ */ - -#define USBHS_HWDEVICE_DC_MASK (0x1U) -#define USBHS_HWDEVICE_DC_SHIFT (0U) -/*! DC - Device Capable - * 0b1..Supported - * 0b0..Not supported - */ -#define USBHS_HWDEVICE_DC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWDEVICE_DC_SHIFT)) & USBHS_HWDEVICE_DC_MASK) - -#define USBHS_HWDEVICE_DEVEP_MASK (0x3EU) -#define USBHS_HWDEVICE_DEVEP_SHIFT (1U) -/*! DEVEP - Device Endpoint Number */ -#define USBHS_HWDEVICE_DEVEP(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWDEVICE_DEVEP_SHIFT)) & USBHS_HWDEVICE_DEVEP_MASK) -/*! @} */ - -/*! @name HWTXBUF - TX Buffer Hardware Parameters */ -/*! @{ */ - -#define USBHS_HWTXBUF_TXBURST_MASK (0xFFU) -#define USBHS_HWTXBUF_TXBURST_SHIFT (0U) -/*! TXBURST - Default burst size for memory to TX buffer transfer */ -#define USBHS_HWTXBUF_TXBURST(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWTXBUF_TXBURST_SHIFT)) & USBHS_HWTXBUF_TXBURST_MASK) - -#define USBHS_HWTXBUF_TXCHANADD_MASK (0xFF0000U) -#define USBHS_HWTXBUF_TXCHANADD_SHIFT (16U) -/*! TXCHANADD - TX FIFO Buffer size is: (2^TXCHANADD) * 4 Bytes */ -#define USBHS_HWTXBUF_TXCHANADD(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWTXBUF_TXCHANADD_SHIFT)) & USBHS_HWTXBUF_TXCHANADD_MASK) -/*! @} */ - -/*! @name HWRXBUF - RX Buffer Hardware Parameters */ -/*! @{ */ - -#define USBHS_HWRXBUF_RXBURST_MASK (0xFFU) -#define USBHS_HWRXBUF_RXBURST_SHIFT (0U) -/*! RXBURST - Default burst size for memory to RX buffer transfer */ -#define USBHS_HWRXBUF_RXBURST(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWRXBUF_RXBURST_SHIFT)) & USBHS_HWRXBUF_RXBURST_MASK) - -#define USBHS_HWRXBUF_RXADD_MASK (0xFF00U) -#define USBHS_HWRXBUF_RXADD_SHIFT (8U) -/*! RXADD - Buffer total size for all receive endpoints is (2^RXADD) */ -#define USBHS_HWRXBUF_RXADD(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HWRXBUF_RXADD_SHIFT)) & USBHS_HWRXBUF_RXADD_MASK) -/*! @} */ - -/*! @name GPTIMER0LD - General Purpose Timer #0 Load */ -/*! @{ */ - -#define USBHS_GPTIMER0LD_GPTLD_MASK (0xFFFFFFU) -#define USBHS_GPTIMER0LD_GPTLD_SHIFT (0U) -/*! GPTLD - General Purpose Timer Load Value */ -#define USBHS_GPTIMER0LD_GPTLD(x) (((uint32_t)(((uint32_t)(x)) << USBHS_GPTIMER0LD_GPTLD_SHIFT)) & USBHS_GPTIMER0LD_GPTLD_MASK) -/*! @} */ - -/*! @name GPTIMER0CTRL - General Purpose Timer #0 Controller */ -/*! @{ */ - -#define USBHS_GPTIMER0CTRL_GPTCNT_MASK (0xFFFFFFU) -#define USBHS_GPTIMER0CTRL_GPTCNT_SHIFT (0U) -/*! GPTCNT - General Purpose Timer Counter */ -#define USBHS_GPTIMER0CTRL_GPTCNT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_GPTIMER0CTRL_GPTCNT_SHIFT)) & USBHS_GPTIMER0CTRL_GPTCNT_MASK) - -#define USBHS_GPTIMER0CTRL_GPTMODE_MASK (0x1000000U) -#define USBHS_GPTIMER0CTRL_GPTMODE_SHIFT (24U) -/*! GPTMODE - General Purpose Timer Mode - * 0b0..One Shot Mode - * 0b1..Repeat Mode - */ -#define USBHS_GPTIMER0CTRL_GPTMODE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_GPTIMER0CTRL_GPTMODE_SHIFT)) & USBHS_GPTIMER0CTRL_GPTMODE_MASK) - -#define USBHS_GPTIMER0CTRL_GPTRST_MASK (0x40000000U) -#define USBHS_GPTIMER0CTRL_GPTRST_SHIFT (30U) -/*! GPTRST - General Purpose Timer Reset - * 0b0..No action - * 0b1..Load counter value from GPTLD bits in n_GPTIMER0LD - */ -#define USBHS_GPTIMER0CTRL_GPTRST(x) (((uint32_t)(((uint32_t)(x)) << USBHS_GPTIMER0CTRL_GPTRST_SHIFT)) & USBHS_GPTIMER0CTRL_GPTRST_MASK) - -#define USBHS_GPTIMER0CTRL_GPTRUN_MASK (0x80000000U) -#define USBHS_GPTIMER0CTRL_GPTRUN_SHIFT (31U) -/*! GPTRUN - General Purpose Timer Run - * 0b0..Stop counting - * 0b1..Run - */ -#define USBHS_GPTIMER0CTRL_GPTRUN(x) (((uint32_t)(((uint32_t)(x)) << USBHS_GPTIMER0CTRL_GPTRUN_SHIFT)) & USBHS_GPTIMER0CTRL_GPTRUN_MASK) -/*! @} */ - -/*! @name GPTIMER1LD - General Purpose Timer #1 Load */ -/*! @{ */ - -#define USBHS_GPTIMER1LD_GPTLD_MASK (0xFFFFFFU) -#define USBHS_GPTIMER1LD_GPTLD_SHIFT (0U) -/*! GPTLD - General Purpose Timer Load Value */ -#define USBHS_GPTIMER1LD_GPTLD(x) (((uint32_t)(((uint32_t)(x)) << USBHS_GPTIMER1LD_GPTLD_SHIFT)) & USBHS_GPTIMER1LD_GPTLD_MASK) -/*! @} */ - -/*! @name GPTIMER1CTRL - General Purpose Timer #1 Controller */ -/*! @{ */ - -#define USBHS_GPTIMER1CTRL_GPTCNT_MASK (0xFFFFFFU) -#define USBHS_GPTIMER1CTRL_GPTCNT_SHIFT (0U) -/*! GPTCNT - General Purpose Timer Counter */ -#define USBHS_GPTIMER1CTRL_GPTCNT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_GPTIMER1CTRL_GPTCNT_SHIFT)) & USBHS_GPTIMER1CTRL_GPTCNT_MASK) - -#define USBHS_GPTIMER1CTRL_GPTMODE_MASK (0x1000000U) -#define USBHS_GPTIMER1CTRL_GPTMODE_SHIFT (24U) -/*! GPTMODE - General Purpose Timer Mode - * 0b0..One Shot Mode - * 0b1..Repeat Mode - */ -#define USBHS_GPTIMER1CTRL_GPTMODE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_GPTIMER1CTRL_GPTMODE_SHIFT)) & USBHS_GPTIMER1CTRL_GPTMODE_MASK) - -#define USBHS_GPTIMER1CTRL_GPTRST_MASK (0x40000000U) -#define USBHS_GPTIMER1CTRL_GPTRST_SHIFT (30U) -/*! GPTRST - General Purpose Timer Reset - * 0b0..No action - * 0b1..Load counter value from GPTLD bits in USB_n_GPTIMER0LD - */ -#define USBHS_GPTIMER1CTRL_GPTRST(x) (((uint32_t)(((uint32_t)(x)) << USBHS_GPTIMER1CTRL_GPTRST_SHIFT)) & USBHS_GPTIMER1CTRL_GPTRST_MASK) - -#define USBHS_GPTIMER1CTRL_GPTRUN_MASK (0x80000000U) -#define USBHS_GPTIMER1CTRL_GPTRUN_SHIFT (31U) -/*! GPTRUN - General Purpose Timer Run - * 0b0..Stop counting - * 0b1..Run - */ -#define USBHS_GPTIMER1CTRL_GPTRUN(x) (((uint32_t)(((uint32_t)(x)) << USBHS_GPTIMER1CTRL_GPTRUN_SHIFT)) & USBHS_GPTIMER1CTRL_GPTRUN_MASK) -/*! @} */ - -/*! @name SBUSCFG - System Bus Config */ -/*! @{ */ - -#define USBHS_SBUSCFG_AHBBRST_MASK (0x7U) -#define USBHS_SBUSCFG_AHBBRST_SHIFT (0U) -/*! AHBBRST - AHB master interface Burst configuration - * 0b000..Incremental burst of unspecified length only - * 0b001..INCR4 burst, then single transfer - * 0b010..INCR8 burst, INCR4 burst, then single transfer - * 0b011..INCR16 burst, INCR8 burst, INCR4 burst, then single transfer - * 0b100..Reserved, don't use - * 0b101..INCR4 burst, then incremental burst of unspecified length - * 0b110..INCR8 burst, INCR4 burst, then incremental burst of unspecified length - * 0b111..INCR16 burst, INCR8 burst, INCR4 burst, then incremental burst of unspecified length - */ -#define USBHS_SBUSCFG_AHBBRST(x) (((uint32_t)(((uint32_t)(x)) << USBHS_SBUSCFG_AHBBRST_SHIFT)) & USBHS_SBUSCFG_AHBBRST_MASK) -/*! @} */ - -/*! @name CAPLENGTH - Capability Registers Length */ -/*! @{ */ - -#define USBHS_CAPLENGTH_CAPLENGTH_MASK (0xFFU) -#define USBHS_CAPLENGTH_CAPLENGTH_SHIFT (0U) -/*! CAPLENGTH - These bits are used as an offset to add to register base to find the beginning of - * the Operational Register. Default value is '40h'. - */ -#define USBHS_CAPLENGTH_CAPLENGTH(x) (((uint8_t)(((uint8_t)(x)) << USBHS_CAPLENGTH_CAPLENGTH_SHIFT)) & USBHS_CAPLENGTH_CAPLENGTH_MASK) -/*! @} */ - -/*! @name HCIVERSION - Host Controller Interface Version */ -/*! @{ */ - -#define USBHS_HCIVERSION_HCIVERSION_MASK (0xFFFFU) -#define USBHS_HCIVERSION_HCIVERSION_SHIFT (0U) -/*! HCIVERSION - Host Controller Interface Version Number */ -#define USBHS_HCIVERSION_HCIVERSION(x) (((uint16_t)(((uint16_t)(x)) << USBHS_HCIVERSION_HCIVERSION_SHIFT)) & USBHS_HCIVERSION_HCIVERSION_MASK) -/*! @} */ - -/*! @name HCSPARAMS - Host Controller Structural Parameters */ -/*! @{ */ - -#define USBHS_HCSPARAMS_N_PORTS_MASK (0xFU) -#define USBHS_HCSPARAMS_N_PORTS_SHIFT (0U) -/*! N_PORTS - Number of Downstream Ports */ -#define USBHS_HCSPARAMS_N_PORTS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCSPARAMS_N_PORTS_SHIFT)) & USBHS_HCSPARAMS_N_PORTS_MASK) - -#define USBHS_HCSPARAMS_PPC_MASK (0x10U) -#define USBHS_HCSPARAMS_PPC_SHIFT (4U) -/*! PPC - Port Power Control */ -#define USBHS_HCSPARAMS_PPC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCSPARAMS_PPC_SHIFT)) & USBHS_HCSPARAMS_PPC_MASK) - -#define USBHS_HCSPARAMS_N_PCC_MASK (0xF00U) -#define USBHS_HCSPARAMS_N_PCC_SHIFT (8U) -/*! N_PCC - Number of Ports per Companion Controller */ -#define USBHS_HCSPARAMS_N_PCC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCSPARAMS_N_PCC_SHIFT)) & USBHS_HCSPARAMS_N_PCC_MASK) - -#define USBHS_HCSPARAMS_N_CC_MASK (0xF000U) -#define USBHS_HCSPARAMS_N_CC_SHIFT (12U) -/*! N_CC - Number of Companion Controller - * 0b0000..There is no internal Companion Controller and port-ownership hand-off is not supported - * 0b0001..There are internal companion controller(s) and port-ownership hand-offs is supported - */ -#define USBHS_HCSPARAMS_N_CC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCSPARAMS_N_CC_SHIFT)) & USBHS_HCSPARAMS_N_CC_MASK) - -#define USBHS_HCSPARAMS_PI_MASK (0x10000U) -#define USBHS_HCSPARAMS_PI_SHIFT (16U) -/*! PI - Port Indicators (P INDICATOR) */ -#define USBHS_HCSPARAMS_PI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCSPARAMS_PI_SHIFT)) & USBHS_HCSPARAMS_PI_MASK) - -#define USBHS_HCSPARAMS_N_PTT_MASK (0xF00000U) -#define USBHS_HCSPARAMS_N_PTT_SHIFT (20U) -/*! N_PTT - Number of Ports per Transaction Translator */ -#define USBHS_HCSPARAMS_N_PTT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCSPARAMS_N_PTT_SHIFT)) & USBHS_HCSPARAMS_N_PTT_MASK) - -#define USBHS_HCSPARAMS_N_TT_MASK (0xF000000U) -#define USBHS_HCSPARAMS_N_TT_SHIFT (24U) -/*! N_TT - Number of Transaction Translators */ -#define USBHS_HCSPARAMS_N_TT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCSPARAMS_N_TT_SHIFT)) & USBHS_HCSPARAMS_N_TT_MASK) -/*! @} */ - -/*! @name HCCPARAMS - Host Controller Capability Parameters */ -/*! @{ */ - -#define USBHS_HCCPARAMS_ADC_MASK (0x1U) -#define USBHS_HCCPARAMS_ADC_SHIFT (0U) -/*! ADC - 64-bit Addressing Capability */ -#define USBHS_HCCPARAMS_ADC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCCPARAMS_ADC_SHIFT)) & USBHS_HCCPARAMS_ADC_MASK) - -#define USBHS_HCCPARAMS_PFL_MASK (0x2U) -#define USBHS_HCCPARAMS_PFL_SHIFT (1U) -/*! PFL - Programmable Frame List Flag */ -#define USBHS_HCCPARAMS_PFL(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCCPARAMS_PFL_SHIFT)) & USBHS_HCCPARAMS_PFL_MASK) - -#define USBHS_HCCPARAMS_ASP_MASK (0x4U) -#define USBHS_HCCPARAMS_ASP_SHIFT (2U) -/*! ASP - Asynchronous Schedule Park Capability */ -#define USBHS_HCCPARAMS_ASP(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCCPARAMS_ASP_SHIFT)) & USBHS_HCCPARAMS_ASP_MASK) - -#define USBHS_HCCPARAMS_IST_MASK (0xF0U) -#define USBHS_HCCPARAMS_IST_SHIFT (4U) -/*! IST - Isochronous Scheduling Threshold */ -#define USBHS_HCCPARAMS_IST(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCCPARAMS_IST_SHIFT)) & USBHS_HCCPARAMS_IST_MASK) - -#define USBHS_HCCPARAMS_EECP_MASK (0xFF00U) -#define USBHS_HCCPARAMS_EECP_SHIFT (8U) -/*! EECP - EHCI Extended Capabilities Pointer */ -#define USBHS_HCCPARAMS_EECP(x) (((uint32_t)(((uint32_t)(x)) << USBHS_HCCPARAMS_EECP_SHIFT)) & USBHS_HCCPARAMS_EECP_MASK) -/*! @} */ - -/*! @name DCIVERSION - Device Controller Interface Version */ -/*! @{ */ - -#define USBHS_DCIVERSION_DCIVERSION_MASK (0xFFFFU) -#define USBHS_DCIVERSION_DCIVERSION_SHIFT (0U) -/*! DCIVERSION - Device Controller Interface Version Number */ -#define USBHS_DCIVERSION_DCIVERSION(x) (((uint16_t)(((uint16_t)(x)) << USBHS_DCIVERSION_DCIVERSION_SHIFT)) & USBHS_DCIVERSION_DCIVERSION_MASK) -/*! @} */ - -/*! @name DCCPARAMS - Device Controller Capability Parameters */ -/*! @{ */ - -#define USBHS_DCCPARAMS_DEN_MASK (0x1FU) -#define USBHS_DCCPARAMS_DEN_SHIFT (0U) -/*! DEN - Device Endpoint Number */ -#define USBHS_DCCPARAMS_DEN(x) (((uint32_t)(((uint32_t)(x)) << USBHS_DCCPARAMS_DEN_SHIFT)) & USBHS_DCCPARAMS_DEN_MASK) - -#define USBHS_DCCPARAMS_DC_MASK (0x80U) -#define USBHS_DCCPARAMS_DC_SHIFT (7U) -/*! DC - Device Capable */ -#define USBHS_DCCPARAMS_DC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_DCCPARAMS_DC_SHIFT)) & USBHS_DCCPARAMS_DC_MASK) - -#define USBHS_DCCPARAMS_HC_MASK (0x100U) -#define USBHS_DCCPARAMS_HC_SHIFT (8U) -/*! HC - Host Capable */ -#define USBHS_DCCPARAMS_HC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_DCCPARAMS_HC_SHIFT)) & USBHS_DCCPARAMS_HC_MASK) -/*! @} */ - -/*! @name USBCMD - USB Command */ -/*! @{ */ - -#define USBHS_USBCMD_RS_MASK (0x1U) -#define USBHS_USBCMD_RS_SHIFT (0U) -/*! RS - Run/Stop - * 0b0..Stop - * 0b1..Run - */ -#define USBHS_USBCMD_RS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_RS_SHIFT)) & USBHS_USBCMD_RS_MASK) - -#define USBHS_USBCMD_RST_MASK (0x2U) -#define USBHS_USBCMD_RST_SHIFT (1U) -/*! RST - Controller Reset */ -#define USBHS_USBCMD_RST(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_RST_SHIFT)) & USBHS_USBCMD_RST_MASK) - -#define USBHS_USBCMD_FS_1_MASK (0xCU) -#define USBHS_USBCMD_FS_1_SHIFT (2U) -/*! FS_1 - Frame List Size */ -#define USBHS_USBCMD_FS_1(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_FS_1_SHIFT)) & USBHS_USBCMD_FS_1_MASK) - -#define USBHS_USBCMD_PSE_MASK (0x10U) -#define USBHS_USBCMD_PSE_SHIFT (4U) -/*! PSE - Periodic Schedule Enable - * 0b0..Do not process the Periodic Schedule - * 0b1..Use the PERIODICLISTBASE register to access the Periodic Schedule - */ -#define USBHS_USBCMD_PSE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_PSE_SHIFT)) & USBHS_USBCMD_PSE_MASK) - -#define USBHS_USBCMD_ASE_MASK (0x20U) -#define USBHS_USBCMD_ASE_SHIFT (5U) -/*! ASE - Asynchronous Schedule Enable - * 0b0..Do not process the Asynchronous Schedule - * 0b1..Use the ASYNCLISTADDR register to access the Asynchronous Schedule - */ -#define USBHS_USBCMD_ASE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_ASE_SHIFT)) & USBHS_USBCMD_ASE_MASK) - -#define USBHS_USBCMD_IAA_MASK (0x40U) -#define USBHS_USBCMD_IAA_SHIFT (6U) -/*! IAA - Interrupt on Async Advance Doorbell */ -#define USBHS_USBCMD_IAA(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_IAA_SHIFT)) & USBHS_USBCMD_IAA_MASK) - -#define USBHS_USBCMD_ASP_MASK (0x300U) -#define USBHS_USBCMD_ASP_SHIFT (8U) -/*! ASP - Asynchronous Schedule Park Mode Count */ -#define USBHS_USBCMD_ASP(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_ASP_SHIFT)) & USBHS_USBCMD_ASP_MASK) - -#define USBHS_USBCMD_ASPE_MASK (0x800U) -#define USBHS_USBCMD_ASPE_SHIFT (11U) -/*! ASPE - Asynchronous Schedule Park Mode Enable */ -#define USBHS_USBCMD_ASPE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_ASPE_SHIFT)) & USBHS_USBCMD_ASPE_MASK) - -#define USBHS_USBCMD_SUTW_MASK (0x2000U) -#define USBHS_USBCMD_SUTW_SHIFT (13U) -/*! SUTW - Setup TripWire [device mode only] */ -#define USBHS_USBCMD_SUTW(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_SUTW_SHIFT)) & USBHS_USBCMD_SUTW_MASK) - -#define USBHS_USBCMD_ATDTW_MASK (0x4000U) -#define USBHS_USBCMD_ATDTW_SHIFT (14U) -/*! ATDTW - Add dTD TripWire[device mode only] */ -#define USBHS_USBCMD_ATDTW(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_ATDTW_SHIFT)) & USBHS_USBCMD_ATDTW_MASK) - -#define USBHS_USBCMD_FS_2_MASK (0x8000U) -#define USBHS_USBCMD_FS_2_SHIFT (15U) -/*! FS_2 - Frame List Size [host mode only] */ -#define USBHS_USBCMD_FS_2(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_FS_2_SHIFT)) & USBHS_USBCMD_FS_2_MASK) - -#define USBHS_USBCMD_ITC_MASK (0xFF0000U) -#define USBHS_USBCMD_ITC_SHIFT (16U) -/*! ITC - Interrupt Threshold Control - * 0b00000000..Immediate (no threshold) - * 0b00000001..1 micro-frame - * 0b00000010..2 micro-frames - * 0b00000100..4 micro-frames - * 0b00001000..8 micro-frames - * 0b00010000..16 micro-frames - * 0b00100000..32 micro-frames - * 0b01000000..64 micro-frames - */ -#define USBHS_USBCMD_ITC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBCMD_ITC_SHIFT)) & USBHS_USBCMD_ITC_MASK) -/*! @} */ - -/*! @name USBSTS - USB Status */ -/*! @{ */ - -#define USBHS_USBSTS_UI_MASK (0x1U) -#define USBHS_USBSTS_UI_SHIFT (0U) -/*! UI - USB Interrupt (USBINT) */ -#define USBHS_USBSTS_UI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_UI_SHIFT)) & USBHS_USBSTS_UI_MASK) - -#define USBHS_USBSTS_UEI_MASK (0x2U) -#define USBHS_USBSTS_UEI_SHIFT (1U) -/*! UEI - USB Error Interrupt (USBERRINT) */ -#define USBHS_USBSTS_UEI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_UEI_SHIFT)) & USBHS_USBSTS_UEI_MASK) - -#define USBHS_USBSTS_PCI_MASK (0x4U) -#define USBHS_USBSTS_PCI_SHIFT (2U) -/*! PCI - Port Change Detect */ -#define USBHS_USBSTS_PCI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_PCI_SHIFT)) & USBHS_USBSTS_PCI_MASK) - -#define USBHS_USBSTS_FRI_MASK (0x8U) -#define USBHS_USBSTS_FRI_SHIFT (3U) -/*! FRI - Frame List Rollover */ -#define USBHS_USBSTS_FRI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_FRI_SHIFT)) & USBHS_USBSTS_FRI_MASK) - -#define USBHS_USBSTS_SEI_MASK (0x10U) -#define USBHS_USBSTS_SEI_SHIFT (4U) -/*! SEI - System Error */ -#define USBHS_USBSTS_SEI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_SEI_SHIFT)) & USBHS_USBSTS_SEI_MASK) - -#define USBHS_USBSTS_AAI_MASK (0x20U) -#define USBHS_USBSTS_AAI_SHIFT (5U) -/*! AAI - Interrupt on Async Advance */ -#define USBHS_USBSTS_AAI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_AAI_SHIFT)) & USBHS_USBSTS_AAI_MASK) - -#define USBHS_USBSTS_URI_MASK (0x40U) -#define USBHS_USBSTS_URI_SHIFT (6U) -/*! URI - USB Reset Received */ -#define USBHS_USBSTS_URI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_URI_SHIFT)) & USBHS_USBSTS_URI_MASK) - -#define USBHS_USBSTS_SRI_MASK (0x80U) -#define USBHS_USBSTS_SRI_SHIFT (7U) -/*! SRI - SOF Received */ -#define USBHS_USBSTS_SRI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_SRI_SHIFT)) & USBHS_USBSTS_SRI_MASK) - -#define USBHS_USBSTS_SLI_MASK (0x100U) -#define USBHS_USBSTS_SLI_SHIFT (8U) -/*! SLI - DCSuspend */ -#define USBHS_USBSTS_SLI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_SLI_SHIFT)) & USBHS_USBSTS_SLI_MASK) - -#define USBHS_USBSTS_ULPII_MASK (0x400U) -#define USBHS_USBSTS_ULPII_SHIFT (10U) -/*! ULPII - ULPI Interrupt */ -#define USBHS_USBSTS_ULPII(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_ULPII_SHIFT)) & USBHS_USBSTS_ULPII_MASK) - -#define USBHS_USBSTS_HCH_MASK (0x1000U) -#define USBHS_USBSTS_HCH_SHIFT (12U) -/*! HCH - HCHaIted */ -#define USBHS_USBSTS_HCH(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_HCH_SHIFT)) & USBHS_USBSTS_HCH_MASK) - -#define USBHS_USBSTS_RCL_MASK (0x2000U) -#define USBHS_USBSTS_RCL_SHIFT (13U) -/*! RCL - Reclamation */ -#define USBHS_USBSTS_RCL(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_RCL_SHIFT)) & USBHS_USBSTS_RCL_MASK) - -#define USBHS_USBSTS_PS_MASK (0x4000U) -#define USBHS_USBSTS_PS_SHIFT (14U) -/*! PS - Periodic Schedule Status */ -#define USBHS_USBSTS_PS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_PS_SHIFT)) & USBHS_USBSTS_PS_MASK) - -#define USBHS_USBSTS_AS_MASK (0x8000U) -#define USBHS_USBSTS_AS_SHIFT (15U) -/*! AS - Asynchronous Schedule Status */ -#define USBHS_USBSTS_AS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_AS_SHIFT)) & USBHS_USBSTS_AS_MASK) - -#define USBHS_USBSTS_NAKI_MASK (0x10000U) -#define USBHS_USBSTS_NAKI_SHIFT (16U) -/*! NAKI - NAK Interrupt Bit */ -#define USBHS_USBSTS_NAKI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_NAKI_SHIFT)) & USBHS_USBSTS_NAKI_MASK) - -#define USBHS_USBSTS_TI0_MASK (0x1000000U) -#define USBHS_USBSTS_TI0_SHIFT (24U) -/*! TI0 - General Purpose Timer Interrupt 0 (GPTINT0) */ -#define USBHS_USBSTS_TI0(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_TI0_SHIFT)) & USBHS_USBSTS_TI0_MASK) - -#define USBHS_USBSTS_TI1_MASK (0x2000000U) -#define USBHS_USBSTS_TI1_SHIFT (25U) -/*! TI1 - General Purpose Timer Interrupt 1 (GPTINT1) */ -#define USBHS_USBSTS_TI1(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBSTS_TI1_SHIFT)) & USBHS_USBSTS_TI1_MASK) -/*! @} */ - -/*! @name USBINTR - Interrupt Enable */ -/*! @{ */ - -#define USBHS_USBINTR_UE_MASK (0x1U) -#define USBHS_USBINTR_UE_SHIFT (0U) -/*! UE - USB Interrupt Enable */ -#define USBHS_USBINTR_UE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_UE_SHIFT)) & USBHS_USBINTR_UE_MASK) - -#define USBHS_USBINTR_UEE_MASK (0x2U) -#define USBHS_USBINTR_UEE_SHIFT (1U) -/*! UEE - USB Error Interrupt Enable */ -#define USBHS_USBINTR_UEE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_UEE_SHIFT)) & USBHS_USBINTR_UEE_MASK) - -#define USBHS_USBINTR_PCE_MASK (0x4U) -#define USBHS_USBINTR_PCE_SHIFT (2U) -/*! PCE - Port Change Detect Interrupt Enable */ -#define USBHS_USBINTR_PCE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_PCE_SHIFT)) & USBHS_USBINTR_PCE_MASK) - -#define USBHS_USBINTR_FRE_MASK (0x8U) -#define USBHS_USBINTR_FRE_SHIFT (3U) -/*! FRE - Frame List Rollover Interrupt Enable */ -#define USBHS_USBINTR_FRE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_FRE_SHIFT)) & USBHS_USBINTR_FRE_MASK) - -#define USBHS_USBINTR_SEE_MASK (0x10U) -#define USBHS_USBINTR_SEE_SHIFT (4U) -/*! SEE - System Error Interrupt Enable */ -#define USBHS_USBINTR_SEE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_SEE_SHIFT)) & USBHS_USBINTR_SEE_MASK) - -#define USBHS_USBINTR_AAE_MASK (0x20U) -#define USBHS_USBINTR_AAE_SHIFT (5U) -/*! AAE - Async Advance Interrupt Enable */ -#define USBHS_USBINTR_AAE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_AAE_SHIFT)) & USBHS_USBINTR_AAE_MASK) - -#define USBHS_USBINTR_URE_MASK (0x40U) -#define USBHS_USBINTR_URE_SHIFT (6U) -/*! URE - USB Reset Interrupt Enable */ -#define USBHS_USBINTR_URE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_URE_SHIFT)) & USBHS_USBINTR_URE_MASK) - -#define USBHS_USBINTR_SRE_MASK (0x80U) -#define USBHS_USBINTR_SRE_SHIFT (7U) -/*! SRE - SOF Received Interrupt Enable */ -#define USBHS_USBINTR_SRE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_SRE_SHIFT)) & USBHS_USBINTR_SRE_MASK) - -#define USBHS_USBINTR_SLE_MASK (0x100U) -#define USBHS_USBINTR_SLE_SHIFT (8U) -/*! SLE - Sleep Interrupt Enable */ -#define USBHS_USBINTR_SLE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_SLE_SHIFT)) & USBHS_USBINTR_SLE_MASK) - -#define USBHS_USBINTR_NAKE_MASK (0x10000U) -#define USBHS_USBINTR_NAKE_SHIFT (16U) -/*! NAKE - NAK Interrupt Enable */ -#define USBHS_USBINTR_NAKE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_NAKE_SHIFT)) & USBHS_USBINTR_NAKE_MASK) - -#define USBHS_USBINTR_UAIE_MASK (0x40000U) -#define USBHS_USBINTR_UAIE_SHIFT (18U) -/*! UAIE - USB Host Asynchronous Interrupt Enable */ -#define USBHS_USBINTR_UAIE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_UAIE_SHIFT)) & USBHS_USBINTR_UAIE_MASK) - -#define USBHS_USBINTR_UPIE_MASK (0x80000U) -#define USBHS_USBINTR_UPIE_SHIFT (19U) -/*! UPIE - USB Host Periodic Interrupt Enable */ -#define USBHS_USBINTR_UPIE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_UPIE_SHIFT)) & USBHS_USBINTR_UPIE_MASK) - -#define USBHS_USBINTR_TIE0_MASK (0x1000000U) -#define USBHS_USBINTR_TIE0_SHIFT (24U) -/*! TIE0 - General Purpose Timer #0 Interrupt Enable */ -#define USBHS_USBINTR_TIE0(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_TIE0_SHIFT)) & USBHS_USBINTR_TIE0_MASK) - -#define USBHS_USBINTR_TIE1_MASK (0x2000000U) -#define USBHS_USBINTR_TIE1_SHIFT (25U) -/*! TIE1 - General Purpose Timer #1 Interrupt Enable */ -#define USBHS_USBINTR_TIE1(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBINTR_TIE1_SHIFT)) & USBHS_USBINTR_TIE1_MASK) -/*! @} */ - -/*! @name FRINDEX - USB Frame Index */ -/*! @{ */ - -#define USBHS_FRINDEX_FRINDEX_MASK (0x3FFFU) -#define USBHS_FRINDEX_FRINDEX_SHIFT (0U) -/*! FRINDEX - Frame Index - * 0b00000000000000..(1024) 12 - * 0b00000000000001..(512) 11 - * 0b00000000000010..(256) 10 - * 0b00000000000011..(128) 9 - * 0b00000000000100..(64) 8 - * 0b00000000000101..(32) 7 - * 0b00000000000110..(16) 6 - * 0b00000000000111..(8) 5 - */ -#define USBHS_FRINDEX_FRINDEX(x) (((uint32_t)(((uint32_t)(x)) << USBHS_FRINDEX_FRINDEX_SHIFT)) & USBHS_FRINDEX_FRINDEX_MASK) -/*! @} */ - -/*! @name DEVICEADDR - Device Address */ -/*! @{ */ - -#define USBHS_DEVICEADDR_USBADRA_MASK (0x1000000U) -#define USBHS_DEVICEADDR_USBADRA_SHIFT (24U) -/*! USBADRA - Device Address Advance */ -#define USBHS_DEVICEADDR_USBADRA(x) (((uint32_t)(((uint32_t)(x)) << USBHS_DEVICEADDR_USBADRA_SHIFT)) & USBHS_DEVICEADDR_USBADRA_MASK) - -#define USBHS_DEVICEADDR_USBADR_MASK (0xFE000000U) -#define USBHS_DEVICEADDR_USBADR_SHIFT (25U) -/*! USBADR - Device Address */ -#define USBHS_DEVICEADDR_USBADR(x) (((uint32_t)(((uint32_t)(x)) << USBHS_DEVICEADDR_USBADR_SHIFT)) & USBHS_DEVICEADDR_USBADR_MASK) -/*! @} */ - -/*! @name PERIODICLISTBASE - Frame List Base Address */ -/*! @{ */ - -#define USBHS_PERIODICLISTBASE_BASEADR_MASK (0xFFFFF000U) -#define USBHS_PERIODICLISTBASE_BASEADR_SHIFT (12U) -/*! BASEADR - Base Address (Low) */ -#define USBHS_PERIODICLISTBASE_BASEADR(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PERIODICLISTBASE_BASEADR_SHIFT)) & USBHS_PERIODICLISTBASE_BASEADR_MASK) -/*! @} */ - -/*! @name ASYNCLISTADDR - Next Asynch. Address */ -/*! @{ */ - -#define USBHS_ASYNCLISTADDR_ASYBASE_MASK (0xFFFFFFE0U) -#define USBHS_ASYNCLISTADDR_ASYBASE_SHIFT (5U) -/*! ASYBASE - Link Pointer Low (LPL) */ -#define USBHS_ASYNCLISTADDR_ASYBASE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ASYNCLISTADDR_ASYBASE_SHIFT)) & USBHS_ASYNCLISTADDR_ASYBASE_MASK) -/*! @} */ - -/*! @name ENDPTLISTADDR - Endpoint List Address */ -/*! @{ */ - -#define USBHS_ENDPTLISTADDR_EPBASE_MASK (0xFFFFF800U) -#define USBHS_ENDPTLISTADDR_EPBASE_SHIFT (11U) -/*! EPBASE - Endpoint List Pointer (Low) */ -#define USBHS_ENDPTLISTADDR_EPBASE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTLISTADDR_EPBASE_SHIFT)) & USBHS_ENDPTLISTADDR_EPBASE_MASK) -/*! @} */ - -/*! @name BURSTSIZE - Programmable Burst Size */ -/*! @{ */ - -#define USBHS_BURSTSIZE_RXPBURST_MASK (0xFFU) -#define USBHS_BURSTSIZE_RXPBURST_SHIFT (0U) -/*! RXPBURST - Programmable RX Burst Size */ -#define USBHS_BURSTSIZE_RXPBURST(x) (((uint32_t)(((uint32_t)(x)) << USBHS_BURSTSIZE_RXPBURST_SHIFT)) & USBHS_BURSTSIZE_RXPBURST_MASK) - -#define USBHS_BURSTSIZE_TXPBURST_MASK (0xFF00U) -#define USBHS_BURSTSIZE_TXPBURST_SHIFT (8U) -/*! TXPBURST - Programmable TX Burst Size */ -#define USBHS_BURSTSIZE_TXPBURST(x) (((uint32_t)(((uint32_t)(x)) << USBHS_BURSTSIZE_TXPBURST_SHIFT)) & USBHS_BURSTSIZE_TXPBURST_MASK) -/*! @} */ - -/*! @name TXFILLTUNING - TX FIFO Fill Tuning */ -/*! @{ */ - -#define USBHS_TXFILLTUNING_TXSCHOH_MASK (0x7FU) -#define USBHS_TXFILLTUNING_TXSCHOH_SHIFT (0U) -/*! TXSCHOH - Scheduler Overhead */ -#define USBHS_TXFILLTUNING_TXSCHOH(x) (((uint32_t)(((uint32_t)(x)) << USBHS_TXFILLTUNING_TXSCHOH_SHIFT)) & USBHS_TXFILLTUNING_TXSCHOH_MASK) - -#define USBHS_TXFILLTUNING_TXSCHHEALTH_MASK (0x1F00U) -#define USBHS_TXFILLTUNING_TXSCHHEALTH_SHIFT (8U) -/*! TXSCHHEALTH - Scheduler Health Counter */ -#define USBHS_TXFILLTUNING_TXSCHHEALTH(x) (((uint32_t)(((uint32_t)(x)) << USBHS_TXFILLTUNING_TXSCHHEALTH_SHIFT)) & USBHS_TXFILLTUNING_TXSCHHEALTH_MASK) - -#define USBHS_TXFILLTUNING_TXFIFOTHRES_MASK (0x3F0000U) -#define USBHS_TXFILLTUNING_TXFIFOTHRES_SHIFT (16U) -/*! TXFIFOTHRES - FIFO Burst Threshold */ -#define USBHS_TXFILLTUNING_TXFIFOTHRES(x) (((uint32_t)(((uint32_t)(x)) << USBHS_TXFILLTUNING_TXFIFOTHRES_SHIFT)) & USBHS_TXFILLTUNING_TXFIFOTHRES_MASK) -/*! @} */ - -/*! @name ENDPTNAK - Endpoint NAK */ -/*! @{ */ - -#define USBHS_ENDPTNAK_EPRN_MASK (0xFFU) -#define USBHS_ENDPTNAK_EPRN_SHIFT (0U) -/*! EPRN - RX Endpoint NAK */ -#define USBHS_ENDPTNAK_EPRN(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTNAK_EPRN_SHIFT)) & USBHS_ENDPTNAK_EPRN_MASK) - -#define USBHS_ENDPTNAK_EPTN_MASK (0xFF0000U) -#define USBHS_ENDPTNAK_EPTN_SHIFT (16U) -/*! EPTN - TX Endpoint NAK */ -#define USBHS_ENDPTNAK_EPTN(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTNAK_EPTN_SHIFT)) & USBHS_ENDPTNAK_EPTN_MASK) -/*! @} */ - -/*! @name ENDPTNAKEN - Endpoint NAK Enable */ -/*! @{ */ - -#define USBHS_ENDPTNAKEN_EPRNE_MASK (0xFFU) -#define USBHS_ENDPTNAKEN_EPRNE_SHIFT (0U) -/*! EPRNE - RX Endpoint NAK Enable */ -#define USBHS_ENDPTNAKEN_EPRNE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTNAKEN_EPRNE_SHIFT)) & USBHS_ENDPTNAKEN_EPRNE_MASK) - -#define USBHS_ENDPTNAKEN_EPTNE_MASK (0xFF0000U) -#define USBHS_ENDPTNAKEN_EPTNE_SHIFT (16U) -/*! EPTNE - TX Endpoint NAK Enable */ -#define USBHS_ENDPTNAKEN_EPTNE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTNAKEN_EPTNE_SHIFT)) & USBHS_ENDPTNAKEN_EPTNE_MASK) -/*! @} */ - -/*! @name CONFIGFLAG - Configure Flag */ -/*! @{ */ - -#define USBHS_CONFIGFLAG_CF_MASK (0x1U) -#define USBHS_CONFIGFLAG_CF_SHIFT (0U) -/*! CF - Configure Flag - * 0b0..Port routing control logic default-routes each port to an implementation dependent classic host controller - * 0b1..Port routing control logic default-routes all ports to this host controller - */ -#define USBHS_CONFIGFLAG_CF(x) (((uint32_t)(((uint32_t)(x)) << USBHS_CONFIGFLAG_CF_SHIFT)) & USBHS_CONFIGFLAG_CF_MASK) -/*! @} */ - -/*! @name PORTSC1 - Port Status & Control */ -/*! @{ */ - -#define USBHS_PORTSC1_CCS_MASK (0x1U) -#define USBHS_PORTSC1_CCS_SHIFT (0U) -/*! CCS - Current Connect Status - * 0b0..In Host mode: No device is present. In Device mode: Not attached - * 0b1..In Host mode: Device is present on port. In Device mode: Attached - */ -#define USBHS_PORTSC1_CCS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_CCS_SHIFT)) & USBHS_PORTSC1_CCS_MASK) - -#define USBHS_PORTSC1_CSC_MASK (0x2U) -#define USBHS_PORTSC1_CSC_SHIFT (1U) -/*! CSC - Connect Status Change - * 0b0..No change - * 0b1..Change in current connect status - */ -#define USBHS_PORTSC1_CSC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_CSC_SHIFT)) & USBHS_PORTSC1_CSC_MASK) - -#define USBHS_PORTSC1_PE_MASK (0x4U) -#define USBHS_PORTSC1_PE_SHIFT (2U) -/*! PE - Port Enabled/Disabled - * 0b0..Disable - * 0b1..Enable - */ -#define USBHS_PORTSC1_PE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PE_SHIFT)) & USBHS_PORTSC1_PE_MASK) - -#define USBHS_PORTSC1_PEC_MASK (0x8U) -#define USBHS_PORTSC1_PEC_SHIFT (3U) -/*! PEC - Port Enable/Disable Change - * 0b0..No change - * 0b1..Port enabled/disabled status has changed - */ -#define USBHS_PORTSC1_PEC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PEC_SHIFT)) & USBHS_PORTSC1_PEC_MASK) - -#define USBHS_PORTSC1_OCA_MASK (0x10U) -#define USBHS_PORTSC1_OCA_SHIFT (4U) -/*! OCA - Over-Current Active - * 0b1..This port currently has an over-current condition - * 0b0..This port does not have an over-current condition - */ -#define USBHS_PORTSC1_OCA(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_OCA_SHIFT)) & USBHS_PORTSC1_OCA_MASK) - -#define USBHS_PORTSC1_OCC_MASK (0x20U) -#define USBHS_PORTSC1_OCC_SHIFT (5U) -/*! OCC - Over-current Change */ -#define USBHS_PORTSC1_OCC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_OCC_SHIFT)) & USBHS_PORTSC1_OCC_MASK) - -#define USBHS_PORTSC1_FPR_MASK (0x40U) -#define USBHS_PORTSC1_FPR_SHIFT (6U) -/*! FPR - Force Port Resume - * 0b0..No resume (K-state) detected/driven on port - * 0b1..Resume detected/driven on port - */ -#define USBHS_PORTSC1_FPR(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_FPR_SHIFT)) & USBHS_PORTSC1_FPR_MASK) - -#define USBHS_PORTSC1_SUSP_MASK (0x80U) -#define USBHS_PORTSC1_SUSP_SHIFT (7U) -/*! SUSP - Suspend - * 0b0..Port not in suspend state - * 0b1..Port in suspend state - */ -#define USBHS_PORTSC1_SUSP(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_SUSP_SHIFT)) & USBHS_PORTSC1_SUSP_MASK) - -#define USBHS_PORTSC1_PR_MASK (0x100U) -#define USBHS_PORTSC1_PR_SHIFT (8U) -/*! PR - Port Reset - * 0b0..Port is not in reset - * 0b1..Port is in reset - */ -#define USBHS_PORTSC1_PR(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PR_SHIFT)) & USBHS_PORTSC1_PR_MASK) - -#define USBHS_PORTSC1_HSP_MASK (0x200U) -#define USBHS_PORTSC1_HSP_SHIFT (9U) -/*! HSP - High-Speed Port */ -#define USBHS_PORTSC1_HSP(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_HSP_SHIFT)) & USBHS_PORTSC1_HSP_MASK) - -#define USBHS_PORTSC1_LS_MASK (0xC00U) -#define USBHS_PORTSC1_LS_SHIFT (10U) -/*! LS - Line Status - * 0b00..SE0 - * 0b10..J-state - * 0b01..K-state - * 0b11..Undefined - */ -#define USBHS_PORTSC1_LS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_LS_SHIFT)) & USBHS_PORTSC1_LS_MASK) - -#define USBHS_PORTSC1_PP_MASK (0x1000U) -#define USBHS_PORTSC1_PP_SHIFT (12U) -/*! PP - Port Power */ -#define USBHS_PORTSC1_PP(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PP_SHIFT)) & USBHS_PORTSC1_PP_MASK) - -#define USBHS_PORTSC1_PO_MASK (0x2000U) -#define USBHS_PORTSC1_PO_SHIFT (13U) -/*! PO - Port Owner */ -#define USBHS_PORTSC1_PO(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PO_SHIFT)) & USBHS_PORTSC1_PO_MASK) - -#define USBHS_PORTSC1_PIC_MASK (0xC000U) -#define USBHS_PORTSC1_PIC_SHIFT (14U) -/*! PIC - Port Indicator Control - * 0b00..Port indicators are off - * 0b01..Amber - * 0b10..Green - * 0b11..Undefined - */ -#define USBHS_PORTSC1_PIC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PIC_SHIFT)) & USBHS_PORTSC1_PIC_MASK) - -#define USBHS_PORTSC1_PTC_MASK (0xF0000U) -#define USBHS_PORTSC1_PTC_SHIFT (16U) -/*! PTC - Port Test Control - * 0b0000..TEST_MODE_DISABLE - * 0b0001..J_STATE - * 0b0010..K_STATE - * 0b0011..SE0 (host) / NAK (device) - * 0b0100..Packet - * 0b0101..FORCE_ENABLE_HS - * 0b0110..FORCE_ENABLE_FS - * 0b0111..FORCE_ENABLE_LS - * 0b1000-0b1111..Reserved - */ -#define USBHS_PORTSC1_PTC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PTC_SHIFT)) & USBHS_PORTSC1_PTC_MASK) - -#define USBHS_PORTSC1_WKCN_MASK (0x100000U) -#define USBHS_PORTSC1_WKCN_SHIFT (20U) -/*! WKCN - Wake on Connect Enable (WKCNNT_E) */ -#define USBHS_PORTSC1_WKCN(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_WKCN_SHIFT)) & USBHS_PORTSC1_WKCN_MASK) - -#define USBHS_PORTSC1_WKDC_MASK (0x200000U) -#define USBHS_PORTSC1_WKDC_SHIFT (21U) -/*! WKDC - Wake on Disconnect Enable (WKDSCNNT_E) */ -#define USBHS_PORTSC1_WKDC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_WKDC_SHIFT)) & USBHS_PORTSC1_WKDC_MASK) - -#define USBHS_PORTSC1_WKOC_MASK (0x400000U) -#define USBHS_PORTSC1_WKOC_SHIFT (22U) -/*! WKOC - Wake on Over-current Enable (WKOC_E) */ -#define USBHS_PORTSC1_WKOC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_WKOC_SHIFT)) & USBHS_PORTSC1_WKOC_MASK) - -#define USBHS_PORTSC1_PHCD_MASK (0x800000U) -#define USBHS_PORTSC1_PHCD_SHIFT (23U) -/*! PHCD - PHY Low Power Suspend - Clock Disable (PLPSCD) - * 0b1..Disable PHY clock - * 0b0..Enable PHY clock - */ -#define USBHS_PORTSC1_PHCD(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PHCD_SHIFT)) & USBHS_PORTSC1_PHCD_MASK) - -#define USBHS_PORTSC1_PFSC_MASK (0x1000000U) -#define USBHS_PORTSC1_PFSC_SHIFT (24U) -/*! PFSC - Port Force Full Speed Connect - * 0b1..Forced to full speed - * 0b0..Normal operation - */ -#define USBHS_PORTSC1_PFSC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PFSC_SHIFT)) & USBHS_PORTSC1_PFSC_MASK) - -#define USBHS_PORTSC1_PTS_2_MASK (0x2000000U) -#define USBHS_PORTSC1_PTS_2_SHIFT (25U) -/*! PTS_2 - Parallel Transceiver Select */ -#define USBHS_PORTSC1_PTS_2(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PTS_2_SHIFT)) & USBHS_PORTSC1_PTS_2_MASK) - -#define USBHS_PORTSC1_PSPD_MASK (0xC000000U) -#define USBHS_PORTSC1_PSPD_SHIFT (26U) -/*! PSPD - Port Speed - * 0b00..Full Speed - * 0b01..Low Speed - * 0b10..High Speed - * 0b11..Undefined - */ -#define USBHS_PORTSC1_PSPD(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PSPD_SHIFT)) & USBHS_PORTSC1_PSPD_MASK) - -#define USBHS_PORTSC1_PTW_MASK (0x10000000U) -#define USBHS_PORTSC1_PTW_SHIFT (28U) -/*! PTW - Parallel Transceiver Width - Read/Write - * 0b0..Select the 8-bit UTMI interface [60 MHz] - * 0b1..Select the 16-bit UTMI interface [30 MHz] - */ -#define USBHS_PORTSC1_PTW(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PTW_SHIFT)) & USBHS_PORTSC1_PTW_MASK) - -#define USBHS_PORTSC1_STS_MASK (0x20000000U) -#define USBHS_PORTSC1_STS_SHIFT (29U) -/*! STS - Serial Transceiver Select - * 0b0..Parallel Interface signals is selected - * 0b1..Serial Interface Engine is selected - */ -#define USBHS_PORTSC1_STS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_STS_SHIFT)) & USBHS_PORTSC1_STS_MASK) - -#define USBHS_PORTSC1_PTS_1_MASK (0xC0000000U) -#define USBHS_PORTSC1_PTS_1_SHIFT (30U) -/*! PTS_1 - Parallel Transceiver Select */ -#define USBHS_PORTSC1_PTS_1(x) (((uint32_t)(((uint32_t)(x)) << USBHS_PORTSC1_PTS_1_SHIFT)) & USBHS_PORTSC1_PTS_1_MASK) -/*! @} */ - -/*! @name OTGSC - On-The-Go Status & Control */ -/*! @{ */ - -#define USBHS_OTGSC_VD_MASK (0x1U) -#define USBHS_OTGSC_VD_SHIFT (0U) -/*! VD - VBUS Discharge */ -#define USBHS_OTGSC_VD(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_VD_SHIFT)) & USBHS_OTGSC_VD_MASK) - -#define USBHS_OTGSC_VC_MASK (0x2U) -#define USBHS_OTGSC_VC_SHIFT (1U) -/*! VC - VBUS Charge */ -#define USBHS_OTGSC_VC(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_VC_SHIFT)) & USBHS_OTGSC_VC_MASK) - -#define USBHS_OTGSC_OT_MASK (0x8U) -#define USBHS_OTGSC_OT_SHIFT (3U) -/*! OT - OTG Termination */ -#define USBHS_OTGSC_OT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_OT_SHIFT)) & USBHS_OTGSC_OT_MASK) - -#define USBHS_OTGSC_DP_MASK (0x10U) -#define USBHS_OTGSC_DP_SHIFT (4U) -/*! DP - Data Pulsing */ -#define USBHS_OTGSC_DP(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_DP_SHIFT)) & USBHS_OTGSC_DP_MASK) - -#define USBHS_OTGSC_IDPU_MASK (0x20U) -#define USBHS_OTGSC_IDPU_SHIFT (5U) -/*! IDPU - ID Pullup - * 0b0..Off - * 0b1..On - */ -#define USBHS_OTGSC_IDPU(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_IDPU_SHIFT)) & USBHS_OTGSC_IDPU_MASK) - -#define USBHS_OTGSC_ID_MASK (0x100U) -#define USBHS_OTGSC_ID_SHIFT (8U) -/*! ID - USB ID - * 0b0..A device - * 0b1..B device - */ -#define USBHS_OTGSC_ID(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_ID_SHIFT)) & USBHS_OTGSC_ID_MASK) - -#define USBHS_OTGSC_AVV_MASK (0x200U) -#define USBHS_OTGSC_AVV_SHIFT (9U) -/*! AVV - A VBus Valid */ -#define USBHS_OTGSC_AVV(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_AVV_SHIFT)) & USBHS_OTGSC_AVV_MASK) - -#define USBHS_OTGSC_ASV_MASK (0x400U) -#define USBHS_OTGSC_ASV_SHIFT (10U) -/*! ASV - A Session Valid */ -#define USBHS_OTGSC_ASV(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_ASV_SHIFT)) & USBHS_OTGSC_ASV_MASK) - -#define USBHS_OTGSC_BSV_MASK (0x800U) -#define USBHS_OTGSC_BSV_SHIFT (11U) -/*! BSV - B Session Valid */ -#define USBHS_OTGSC_BSV(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_BSV_SHIFT)) & USBHS_OTGSC_BSV_MASK) - -#define USBHS_OTGSC_BSE_MASK (0x1000U) -#define USBHS_OTGSC_BSE_SHIFT (12U) -/*! BSE - B Session End */ -#define USBHS_OTGSC_BSE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_BSE_SHIFT)) & USBHS_OTGSC_BSE_MASK) - -#define USBHS_OTGSC_TOG_1MS_MASK (0x2000U) -#define USBHS_OTGSC_TOG_1MS_SHIFT (13U) -/*! TOG_1MS - 1 Millisecond Timer Toggle */ -#define USBHS_OTGSC_TOG_1MS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_TOG_1MS_SHIFT)) & USBHS_OTGSC_TOG_1MS_MASK) - -#define USBHS_OTGSC_DPS_MASK (0x4000U) -#define USBHS_OTGSC_DPS_SHIFT (14U) -/*! DPS - Data Bus Pulsing Status */ -#define USBHS_OTGSC_DPS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_DPS_SHIFT)) & USBHS_OTGSC_DPS_MASK) - -#define USBHS_OTGSC_IDIS_MASK (0x10000U) -#define USBHS_OTGSC_IDIS_SHIFT (16U) -/*! IDIS - USB ID Interrupt Status */ -#define USBHS_OTGSC_IDIS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_IDIS_SHIFT)) & USBHS_OTGSC_IDIS_MASK) - -#define USBHS_OTGSC_AVVIS_MASK (0x20000U) -#define USBHS_OTGSC_AVVIS_SHIFT (17U) -/*! AVVIS - A VBus Valid Interrupt Status */ -#define USBHS_OTGSC_AVVIS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_AVVIS_SHIFT)) & USBHS_OTGSC_AVVIS_MASK) - -#define USBHS_OTGSC_ASVIS_MASK (0x40000U) -#define USBHS_OTGSC_ASVIS_SHIFT (18U) -/*! ASVIS - A Session Valid Interrupt Status */ -#define USBHS_OTGSC_ASVIS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_ASVIS_SHIFT)) & USBHS_OTGSC_ASVIS_MASK) - -#define USBHS_OTGSC_BSVIS_MASK (0x80000U) -#define USBHS_OTGSC_BSVIS_SHIFT (19U) -/*! BSVIS - B Session Valid Interrupt Status */ -#define USBHS_OTGSC_BSVIS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_BSVIS_SHIFT)) & USBHS_OTGSC_BSVIS_MASK) - -#define USBHS_OTGSC_BSEIS_MASK (0x100000U) -#define USBHS_OTGSC_BSEIS_SHIFT (20U) -/*! BSEIS - B Session End Interrupt Status */ -#define USBHS_OTGSC_BSEIS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_BSEIS_SHIFT)) & USBHS_OTGSC_BSEIS_MASK) - -#define USBHS_OTGSC_STATUS_1MS_MASK (0x200000U) -#define USBHS_OTGSC_STATUS_1MS_SHIFT (21U) -/*! STATUS_1MS - 1 Millisecond Timer Interrupt Status */ -#define USBHS_OTGSC_STATUS_1MS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_STATUS_1MS_SHIFT)) & USBHS_OTGSC_STATUS_1MS_MASK) - -#define USBHS_OTGSC_DPIS_MASK (0x400000U) -#define USBHS_OTGSC_DPIS_SHIFT (22U) -/*! DPIS - Data Pulse Interrupt Status */ -#define USBHS_OTGSC_DPIS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_DPIS_SHIFT)) & USBHS_OTGSC_DPIS_MASK) - -#define USBHS_OTGSC_IDIE_MASK (0x1000000U) -#define USBHS_OTGSC_IDIE_SHIFT (24U) -/*! IDIE - USB ID Interrupt Enable */ -#define USBHS_OTGSC_IDIE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_IDIE_SHIFT)) & USBHS_OTGSC_IDIE_MASK) - -#define USBHS_OTGSC_AVVIE_MASK (0x2000000U) -#define USBHS_OTGSC_AVVIE_SHIFT (25U) -/*! AVVIE - A VBus Valid Interrupt Enable */ -#define USBHS_OTGSC_AVVIE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_AVVIE_SHIFT)) & USBHS_OTGSC_AVVIE_MASK) - -#define USBHS_OTGSC_ASVIE_MASK (0x4000000U) -#define USBHS_OTGSC_ASVIE_SHIFT (26U) -/*! ASVIE - A Session Valid Interrupt Enable */ -#define USBHS_OTGSC_ASVIE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_ASVIE_SHIFT)) & USBHS_OTGSC_ASVIE_MASK) - -#define USBHS_OTGSC_BSVIE_MASK (0x8000000U) -#define USBHS_OTGSC_BSVIE_SHIFT (27U) -/*! BSVIE - B Session Valid Interrupt Enable */ -#define USBHS_OTGSC_BSVIE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_BSVIE_SHIFT)) & USBHS_OTGSC_BSVIE_MASK) - -#define USBHS_OTGSC_BSEIE_MASK (0x10000000U) -#define USBHS_OTGSC_BSEIE_SHIFT (28U) -/*! BSEIE - B Session End Interrupt Enable */ -#define USBHS_OTGSC_BSEIE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_BSEIE_SHIFT)) & USBHS_OTGSC_BSEIE_MASK) - -#define USBHS_OTGSC_EN_1MS_MASK (0x20000000U) -#define USBHS_OTGSC_EN_1MS_SHIFT (29U) -/*! EN_1MS - 1 Millisecond Timer Interrupt Enable */ -#define USBHS_OTGSC_EN_1MS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_EN_1MS_SHIFT)) & USBHS_OTGSC_EN_1MS_MASK) - -#define USBHS_OTGSC_DPIE_MASK (0x40000000U) -#define USBHS_OTGSC_DPIE_SHIFT (30U) -/*! DPIE - Data Pulse Interrupt Enable */ -#define USBHS_OTGSC_DPIE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_OTGSC_DPIE_SHIFT)) & USBHS_OTGSC_DPIE_MASK) -/*! @} */ - -/*! @name USBMODE - USB Device Mode */ -/*! @{ */ - -#define USBHS_USBMODE_CM_MASK (0x3U) -#define USBHS_USBMODE_CM_SHIFT (0U) -/*! CM - Controller Mode - * 0b00..Idle [Default for combination host/device] - * 0b01..Reserved - * 0b10..Device Controller [Default for device only controller] - * 0b11..Host Controller [Default for host only controller] - */ -#define USBHS_USBMODE_CM(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBMODE_CM_SHIFT)) & USBHS_USBMODE_CM_MASK) - -#define USBHS_USBMODE_ES_MASK (0x4U) -#define USBHS_USBMODE_ES_SHIFT (2U) -/*! ES - Endian Select - * 0b0..Little Endian - * 0b1..Big Endian - */ -#define USBHS_USBMODE_ES(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBMODE_ES_SHIFT)) & USBHS_USBMODE_ES_MASK) - -#define USBHS_USBMODE_SLOM_MASK (0x8U) -#define USBHS_USBMODE_SLOM_SHIFT (3U) -/*! SLOM - Setup Lockout Mode - * 0b0..Setup Lockouts On (default); - * 0b1..Setup Lockouts Off - */ -#define USBHS_USBMODE_SLOM(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBMODE_SLOM_SHIFT)) & USBHS_USBMODE_SLOM_MASK) - -#define USBHS_USBMODE_SDIS_MASK (0x10U) -#define USBHS_USBMODE_SDIS_SHIFT (4U) -/*! SDIS - Stream Disable Mode - * 0b0..Inactive - * 0b1..Active - */ -#define USBHS_USBMODE_SDIS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_USBMODE_SDIS_SHIFT)) & USBHS_USBMODE_SDIS_MASK) -/*! @} */ - -/*! @name ENDPTSETUPSTAT - Endpoint Setup Status */ -/*! @{ */ - -#define USBHS_ENDPTSETUPSTAT_ENDPTSETUPSTAT_MASK (0xFFFFU) -#define USBHS_ENDPTSETUPSTAT_ENDPTSETUPSTAT_SHIFT (0U) -/*! ENDPTSETUPSTAT - Setup Endpoint Status */ -#define USBHS_ENDPTSETUPSTAT_ENDPTSETUPSTAT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTSETUPSTAT_ENDPTSETUPSTAT_SHIFT)) & USBHS_ENDPTSETUPSTAT_ENDPTSETUPSTAT_MASK) -/*! @} */ - -/*! @name ENDPTPRIME - Endpoint Prime */ -/*! @{ */ - -#define USBHS_ENDPTPRIME_PERB_MASK (0xFFU) -#define USBHS_ENDPTPRIME_PERB_SHIFT (0U) -/*! PERB - Prime Endpoint Receive Buffer */ -#define USBHS_ENDPTPRIME_PERB(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTPRIME_PERB_SHIFT)) & USBHS_ENDPTPRIME_PERB_MASK) - -#define USBHS_ENDPTPRIME_PETB_MASK (0xFF0000U) -#define USBHS_ENDPTPRIME_PETB_SHIFT (16U) -/*! PETB - Prime Endpoint Transmit Buffer */ -#define USBHS_ENDPTPRIME_PETB(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTPRIME_PETB_SHIFT)) & USBHS_ENDPTPRIME_PETB_MASK) -/*! @} */ - -/*! @name ENDPTFLUSH - Endpoint Flush */ -/*! @{ */ - -#define USBHS_ENDPTFLUSH_FERB_MASK (0xFFU) -#define USBHS_ENDPTFLUSH_FERB_SHIFT (0U) -/*! FERB - Flush Endpoint Receive Buffer */ -#define USBHS_ENDPTFLUSH_FERB(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTFLUSH_FERB_SHIFT)) & USBHS_ENDPTFLUSH_FERB_MASK) - -#define USBHS_ENDPTFLUSH_FETB_MASK (0xFF0000U) -#define USBHS_ENDPTFLUSH_FETB_SHIFT (16U) -/*! FETB - Flush Endpoint Transmit Buffer */ -#define USBHS_ENDPTFLUSH_FETB(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTFLUSH_FETB_SHIFT)) & USBHS_ENDPTFLUSH_FETB_MASK) -/*! @} */ - -/*! @name ENDPTSTAT - Endpoint Status */ -/*! @{ */ - -#define USBHS_ENDPTSTAT_ERBR_MASK (0xFFU) -#define USBHS_ENDPTSTAT_ERBR_SHIFT (0U) -/*! ERBR - Endpoint Receive Buffer Ready */ -#define USBHS_ENDPTSTAT_ERBR(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTSTAT_ERBR_SHIFT)) & USBHS_ENDPTSTAT_ERBR_MASK) - -#define USBHS_ENDPTSTAT_ETBR_MASK (0xFF0000U) -#define USBHS_ENDPTSTAT_ETBR_SHIFT (16U) -/*! ETBR - Endpoint Transmit Buffer Ready */ -#define USBHS_ENDPTSTAT_ETBR(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTSTAT_ETBR_SHIFT)) & USBHS_ENDPTSTAT_ETBR_MASK) -/*! @} */ - -/*! @name ENDPTCOMPLETE - Endpoint Complete */ -/*! @{ */ - -#define USBHS_ENDPTCOMPLETE_ERCE_MASK (0xFFU) -#define USBHS_ENDPTCOMPLETE_ERCE_SHIFT (0U) -/*! ERCE - Endpoint Receive Complete Event */ -#define USBHS_ENDPTCOMPLETE_ERCE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCOMPLETE_ERCE_SHIFT)) & USBHS_ENDPTCOMPLETE_ERCE_MASK) - -#define USBHS_ENDPTCOMPLETE_ETCE_MASK (0xFF0000U) -#define USBHS_ENDPTCOMPLETE_ETCE_SHIFT (16U) -/*! ETCE - Endpoint Transmit Complete Event */ -#define USBHS_ENDPTCOMPLETE_ETCE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCOMPLETE_ETCE_SHIFT)) & USBHS_ENDPTCOMPLETE_ETCE_MASK) -/*! @} */ - -/*! @name ENDPTCTRL0 - Endpoint Control 0 */ -/*! @{ */ - -#define USBHS_ENDPTCTRL0_RXS_MASK (0x1U) -#define USBHS_ENDPTCTRL0_RXS_SHIFT (0U) -/*! RXS - RX Endpoint Stall - * 0b0..Endpoint OK - * 0b1..Endpoint stalled - */ -#define USBHS_ENDPTCTRL0_RXS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL0_RXS_SHIFT)) & USBHS_ENDPTCTRL0_RXS_MASK) - -#define USBHS_ENDPTCTRL0_RXT_MASK (0xCU) -#define USBHS_ENDPTCTRL0_RXT_SHIFT (2U) -/*! RXT - RX Endpoint Type - * 0b00..Control - */ -#define USBHS_ENDPTCTRL0_RXT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL0_RXT_SHIFT)) & USBHS_ENDPTCTRL0_RXT_MASK) - -#define USBHS_ENDPTCTRL0_RXE_MASK (0x80U) -#define USBHS_ENDPTCTRL0_RXE_SHIFT (7U) -/*! RXE - RX Endpoint Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define USBHS_ENDPTCTRL0_RXE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL0_RXE_SHIFT)) & USBHS_ENDPTCTRL0_RXE_MASK) - -#define USBHS_ENDPTCTRL0_TXS_MASK (0x10000U) -#define USBHS_ENDPTCTRL0_TXS_SHIFT (16U) -/*! TXS - TX Endpoint Stall - * 0b0..Endpoint OK - * 0b1..Endpoint stalled - */ -#define USBHS_ENDPTCTRL0_TXS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL0_TXS_SHIFT)) & USBHS_ENDPTCTRL0_TXS_MASK) - -#define USBHS_ENDPTCTRL0_TXT_MASK (0xC0000U) -#define USBHS_ENDPTCTRL0_TXT_SHIFT (18U) -/*! TXT - TX Endpoint Type - * 0b00..Control - */ -#define USBHS_ENDPTCTRL0_TXT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL0_TXT_SHIFT)) & USBHS_ENDPTCTRL0_TXT_MASK) - -#define USBHS_ENDPTCTRL0_TXE_MASK (0x800000U) -#define USBHS_ENDPTCTRL0_TXE_SHIFT (23U) -/*! TXE - TX Endpoint Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define USBHS_ENDPTCTRL0_TXE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL0_TXE_SHIFT)) & USBHS_ENDPTCTRL0_TXE_MASK) -/*! @} */ - -/*! @name ENDPTCTRL - Endpoint Control 1..Endpoint Control 7 */ -/*! @{ */ - -#define USBHS_ENDPTCTRL_RXS_MASK (0x1U) -#define USBHS_ENDPTCTRL_RXS_SHIFT (0U) -/*! RXS - RX Endpoint Stall - * 0b0..Endpoint OK - * 0b1..Endpoint stalled - */ -#define USBHS_ENDPTCTRL_RXS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_RXS_SHIFT)) & USBHS_ENDPTCTRL_RXS_MASK) - -#define USBHS_ENDPTCTRL_RXD_MASK (0x2U) -#define USBHS_ENDPTCTRL_RXD_SHIFT (1U) -/*! RXD - RX Endpoint Data Sink - * 0b0..Dual Port Memory Buffer/DMA Engine - */ -#define USBHS_ENDPTCTRL_RXD(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_RXD_SHIFT)) & USBHS_ENDPTCTRL_RXD_MASK) - -#define USBHS_ENDPTCTRL_RXT_MASK (0xCU) -#define USBHS_ENDPTCTRL_RXT_SHIFT (2U) -/*! RXT - RX Endpoint Type - * 0b00..Control - * 0b01..Isochronous - * 0b10..Bulk - * 0b11..Interrupt - */ -#define USBHS_ENDPTCTRL_RXT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_RXT_SHIFT)) & USBHS_ENDPTCTRL_RXT_MASK) - -#define USBHS_ENDPTCTRL_RXI_MASK (0x20U) -#define USBHS_ENDPTCTRL_RXI_SHIFT (5U) -/*! RXI - RX Data Toggle Inhibit - * 0b0..Disabled - * 0b1..Enabled - */ -#define USBHS_ENDPTCTRL_RXI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_RXI_SHIFT)) & USBHS_ENDPTCTRL_RXI_MASK) - -#define USBHS_ENDPTCTRL_RXR_MASK (0x40U) -#define USBHS_ENDPTCTRL_RXR_SHIFT (6U) -/*! RXR - RX Data Toggle Reset (WS) - * 0b1..Reset PID sequence - */ -#define USBHS_ENDPTCTRL_RXR(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_RXR_SHIFT)) & USBHS_ENDPTCTRL_RXR_MASK) - -#define USBHS_ENDPTCTRL_RXE_MASK (0x80U) -#define USBHS_ENDPTCTRL_RXE_SHIFT (7U) -/*! RXE - RX Endpoint Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define USBHS_ENDPTCTRL_RXE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_RXE_SHIFT)) & USBHS_ENDPTCTRL_RXE_MASK) - -#define USBHS_ENDPTCTRL_TXS_MASK (0x10000U) -#define USBHS_ENDPTCTRL_TXS_SHIFT (16U) -/*! TXS - TX Endpoint Stall - * 0b0..Endpoint OK - * 0b1..Endpoint stalled - */ -#define USBHS_ENDPTCTRL_TXS(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_TXS_SHIFT)) & USBHS_ENDPTCTRL_TXS_MASK) - -#define USBHS_ENDPTCTRL_TXD_MASK (0x20000U) -#define USBHS_ENDPTCTRL_TXD_SHIFT (17U) -/*! TXD - TX Endpoint Data Source - * 0b0..Dual Port Memory Buffer/DMA Engine - */ -#define USBHS_ENDPTCTRL_TXD(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_TXD_SHIFT)) & USBHS_ENDPTCTRL_TXD_MASK) - -#define USBHS_ENDPTCTRL_TXT_MASK (0xC0000U) -#define USBHS_ENDPTCTRL_TXT_SHIFT (18U) -/*! TXT - TX Endpoint Type - * 0b00..Control - * 0b01..Isochronous - * 0b10..Bulk - * 0b11..Interrupt - */ -#define USBHS_ENDPTCTRL_TXT(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_TXT_SHIFT)) & USBHS_ENDPTCTRL_TXT_MASK) - -#define USBHS_ENDPTCTRL_TXI_MASK (0x200000U) -#define USBHS_ENDPTCTRL_TXI_SHIFT (21U) -/*! TXI - TX Data Toggle Inhibit - * 0b0..PID sequencing enabled - * 0b1..PID sequencing disabled - */ -#define USBHS_ENDPTCTRL_TXI(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_TXI_SHIFT)) & USBHS_ENDPTCTRL_TXI_MASK) - -#define USBHS_ENDPTCTRL_TXR_MASK (0x400000U) -#define USBHS_ENDPTCTRL_TXR_SHIFT (22U) -/*! TXR - TX Data Toggle Reset (WS) - * 0b1..Reset PID sequence - */ -#define USBHS_ENDPTCTRL_TXR(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_TXR_SHIFT)) & USBHS_ENDPTCTRL_TXR_MASK) - -#define USBHS_ENDPTCTRL_TXE_MASK (0x800000U) -#define USBHS_ENDPTCTRL_TXE_SHIFT (23U) -/*! TXE - TX Endpoint Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define USBHS_ENDPTCTRL_TXE(x) (((uint32_t)(((uint32_t)(x)) << USBHS_ENDPTCTRL_TXE_SHIFT)) & USBHS_ENDPTCTRL_TXE_MASK) -/*! @} */ - -/* The count of USBHS_ENDPTCTRL */ -#define USBHS_ENDPTCTRL_COUNT (7U) - - -/*! - * @} - */ /* end of group USBHS_Register_Masks */ - - -/* USBHS - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral USBHS1__USBC base address */ - #define USBHS1__USBC_BASE (0x5010B000u) - /** Peripheral USBHS1__USBC base address */ - #define USBHS1__USBC_BASE_NS (0x4010B000u) - /** Peripheral USBHS1__USBC base pointer */ - #define USBHS1__USBC ((USBHS_Type *)USBHS1__USBC_BASE) - /** Peripheral USBHS1__USBC base pointer */ - #define USBHS1__USBC_NS ((USBHS_Type *)USBHS1__USBC_BASE_NS) - /** Array initializer of USBHS peripheral base addresses */ - #define USBHS_BASE_ADDRS { USBHS1__USBC_BASE } - /** Array initializer of USBHS peripheral base pointers */ - #define USBHS_BASE_PTRS { USBHS1__USBC } - /** Array initializer of USBHS peripheral base addresses */ - #define USBHS_BASE_ADDRS_NS { USBHS1__USBC_BASE_NS } - /** Array initializer of USBHS peripheral base pointers */ - #define USBHS_BASE_PTRS_NS { USBHS1__USBC_NS } -#else - /** Peripheral USBHS1__USBC base address */ - #define USBHS1__USBC_BASE (0x4010B000u) - /** Peripheral USBHS1__USBC base pointer */ - #define USBHS1__USBC ((USBHS_Type *)USBHS1__USBC_BASE) - /** Array initializer of USBHS peripheral base addresses */ - #define USBHS_BASE_ADDRS { USBHS1__USBC_BASE } - /** Array initializer of USBHS peripheral base pointers */ - #define USBHS_BASE_PTRS { USBHS1__USBC } -#endif -/** Interrupt vectors for the USBHS peripheral type */ -#define USBHS_IRQS { USB1_HS_IRQn } -/* Backward compatibility */ -#define GPTIMER0CTL GPTIMER0CTRL -#define GPTIMER1CTL GPTIMER1CTRL -#define USB_SBUSCFG SBUSCFG -#define EPLISTADDR ENDPTLISTADDR -#define EPSETUPSR ENDPTSETUPSTAT -#define EPPRIME ENDPTPRIME -#define EPFLUSH ENDPTFLUSH -#define EPSR ENDPTSTAT -#define EPCOMPLETE ENDPTCOMPLETE -#define EPCR ENDPTCTRL -#define EPCR0 ENDPTCTRL0 -#define USBHS_GPTIMER0CTL_GPTCNT_MASK USBHS_GPTIMER0CTRL_GPTCNT_MASK -#define USBHS_GPTIMER0CTL_GPTCNT_SHIFT USBHS_GPTIMER0CTRL_GPTCNT_SHIFT -#define USBHS_GPTIMER0CTL_GPTCNT(x) USBHS_GPTIMER0CTRL_GPTCNT(x) -#define USBHS_GPTIMER0CTL_MODE_MASK USBHS_GPTIMER0CTRL_GPTMODE_MASK -#define USBHS_GPTIMER0CTL_MODE_SHIFT USBHS_GPTIMER0CTRL_GPTMODE_SHIFT -#define USBHS_GPTIMER0CTL_MODE(x) USBHS_GPTIMER0CTRL_GPTMODE(x) -#define USBHS_GPTIMER0CTL_RST_MASK USBHS_GPTIMER0CTRL_GPTRST_MASK -#define USBHS_GPTIMER0CTL_RST_SHIFT USBHS_GPTIMER0CTRL_GPTRST_SHIFT -#define USBHS_GPTIMER0CTL_RST(x) USBHS_GPTIMER0CTRL_GPTRST(x) -#define USBHS_GPTIMER0CTL_RUN_MASK USBHS_GPTIMER0CTRL_GPTRUN_MASK -#define USBHS_GPTIMER0CTL_RUN_SHIFT USBHS_GPTIMER0CTRL_GPTRUN_SHIFT -#define USBHS_GPTIMER0CTL_RUN(x) USBHS_GPTIMER0CTRL_GPTRUN(x) -#define USBHS_GPTIMER1CTL_GPTCNT_MASK USBHS_GPTIMER1CTRL_GPTCNT_MASK -#define USBHS_GPTIMER1CTL_GPTCNT_SHIFT USBHS_GPTIMER1CTRL_GPTCNT_SHIFT -#define USBHS_GPTIMER1CTL_GPTCNT(x) USBHS_GPTIMER1CTRL_GPTCNT(x) -#define USBHS_GPTIMER1CTL_MODE_MASK USBHS_GPTIMER1CTRL_GPTMODE_MASK -#define USBHS_GPTIMER1CTL_MODE_SHIFT USBHS_GPTIMER1CTRL_GPTMODE_SHIFT -#define USBHS_GPTIMER1CTL_MODE(x) USBHS_GPTIMER1CTRL_GPTMODE(x) -#define USBHS_GPTIMER1CTL_RST_MASK USBHS_GPTIMER1CTRL_GPTRST_MASK -#define USBHS_GPTIMER1CTL_RST_SHIFT USBHS_GPTIMER1CTRL_GPTRST_SHIFT -#define USBHS_GPTIMER1CTL_RST(x) USBHS_GPTIMER1CTRL_GPTRST(x) -#define USBHS_GPTIMER1CTL_RUN_MASK USBHS_GPTIMER1CTRL_GPTRUN_MASK -#define USBHS_GPTIMER1CTL_RUN_SHIFT USBHS_GPTIMER1CTRL_GPTRUN_SHIFT -#define USBHS_GPTIMER1CTL_RUN(x) USBHS_GPTIMER1CTRL_GPTRUN(x) -#define USBHS_USB_SBUSCFG_BURSTMODE_MASK USBHS_SBUSCFG_AHBBRST_MASK -#define USBHS_USB_SBUSCFG_BURSTMODE_SHIFT USBHS_SBUSCFG_AHBBRST_SHIFT -#define USBHS_USB_SBUSCFG_BURSTMODE(x) USBHS_SBUSCFG_AHBBRST(x) -#define USBHS_USBCMD_FS_MASK USBHS_USBCMD_FS_1_MASK -#define USBHS_USBCMD_FS_SHIFT USBHS_USBCMD_FS_1_SHIFT -#define USBHS_USBCMD_FS(x) USBHS_USBCMD_FS_1(x) -#define USBHS_EPLISTADDR_EPBASE_MASK USBHS_ENDPTLISTADDR_EPBASE_MASK -#define USBHS_EPLISTADDR_EPBASE_SHIFT USBHS_ENDPTLISTADDR_EPBASE_SHIFT -#define USBHS_EPLISTADDR_EPBASE(x) USBHS_ENDPTLISTADDR_EPBASE(x) -#define USBHS_EPSETUPSR_EPSETUPSTAT_MASK USBHS_ENDPTSETUPSTAT_ENDPTSETUPSTAT_MASK -#define USBHS_EPSETUPSR_EPSETUPSTAT_SHIFT USBHS_ENDPTSETUPSTAT_ENDPTSETUPSTAT_SHIFT -#define USBHS_EPSETUPSR_EPSETUPSTAT(x) USBHS_ENDPTSETUPSTAT_ENDPTSETUPSTAT(x) -#define USBHS_EPPRIME_PERB_MASK USBHS_ENDPTPRIME_PERB_MASK -#define USBHS_EPPRIME_PERB_SHIFT USBHS_ENDPTPRIME_PERB_SHIFT -#define USBHS_EPPRIME_PERB(x) USBHS_ENDPTPRIME_PERB(x) -#define USBHS_EPPRIME_PETB_MASK USBHS_ENDPTPRIME_PETB_MASK -#define USBHS_EPPRIME_PETB_SHIFT USBHS_ENDPTPRIME_PETB_SHIFT -#define USBHS_EPPRIME_PETB(x) USBHS_ENDPTPRIME_PETB(x) -#define USBHS_EPFLUSH_FERB_MASK USBHS_ENDPTFLUSH_FERB_MASK -#define USBHS_EPFLUSH_FERB_SHIFT USBHS_ENDPTFLUSH_FERB_SHIFT -#define USBHS_EPFLUSH_FERB(x) USBHS_ENDPTFLUSH_FERB(x) -#define USBHS_EPFLUSH_FETB_MASK USBHS_ENDPTFLUSH_FETB_MASK -#define USBHS_EPFLUSH_FETB_SHIFT USBHS_ENDPTFLUSH_FETB_SHIFT -#define USBHS_EPFLUSH_FETB(x) USBHS_ENDPTFLUSH_FETB(x) -#define USBHS_EPSR_ERBR_MASK USBHS_ENDPTSTAT_ERBR_MASK -#define USBHS_EPSR_ERBR_SHIFT USBHS_ENDPTSTAT_ERBR_SHIFT -#define USBHS_EPSR_ERBR(x) USBHS_ENDPTSTAT_ERBR(x) -#define USBHS_EPSR_ETBR_MASK USBHS_ENDPTSTAT_ETBR_MASK -#define USBHS_EPSR_ETBR_SHIFT USBHS_ENDPTSTAT_ETBR_SHIFT -#define USBHS_EPSR_ETBR(x) USBHS_ENDPTSTAT_ETBR(x) -#define USBHS_EPCOMPLETE_ERCE_MASK USBHS_ENDPTCOMPLETE_ERCE_MASK -#define USBHS_EPCOMPLETE_ERCE_SHIFT USBHS_ENDPTCOMPLETE_ERCE_SHIFT -#define USBHS_EPCOMPLETE_ERCE(x) USBHS_ENDPTCOMPLETE_ERCE(x) -#define USBHS_EPCOMPLETE_ETCE_MASK USBHS_ENDPTCOMPLETE_ETCE_MASK -#define USBHS_EPCOMPLETE_ETCE_SHIFT USBHS_ENDPTCOMPLETE_ETCE_SHIFT -#define USBHS_EPCOMPLETE_ETCE(x) USBHS_ENDPTCOMPLETE_ETCE(x) -#define USBHS_EPCR0_RXS_MASK USBHS_ENDPTCTRL0_RXS_MASK -#define USBHS_EPCR0_RXS_SHIFT USBHS_ENDPTCTRL0_RXS_SHIFT -#define USBHS_EPCR0_RXS(x) USBHS_ENDPTCTRL0_RXS(x) -#define USBHS_EPCR0_RXT_MASK USBHS_ENDPTCTRL0_RXT_MASK -#define USBHS_EPCR0_RXT_SHIFT USBHS_ENDPTCTRL0_RXT_SHIFT -#define USBHS_EPCR0_RXT(x) USBHS_ENDPTCTRL0_RXT(x) -#define USBHS_EPCR0_RXE_MASK USBHS_ENDPTCTRL0_RXE_MASK -#define USBHS_EPCR0_RXE_SHIFT USBHS_ENDPTCTRL0_RXE_SHIFT -#define USBHS_EPCR0_RXE(x) USBHS_ENDPTCTRL0_RXE(x) -#define USBHS_EPCR0_TXS_MASK USBHS_ENDPTCTRL0_TXS_MASK -#define USBHS_EPCR0_TXS_SHIFT USBHS_ENDPTCTRL0_TXS_SHIFT -#define USBHS_EPCR0_TXS(x) USBHS_ENDPTCTRL0_TXS(x) -#define USBHS_EPCR0_TXT_MASK USBHS_ENDPTCTRL0_TXT_MASK -#define USBHS_EPCR0_TXT_SHIFT USBHS_ENDPTCTRL0_TXT_SHIFT -#define USBHS_EPCR0_TXT(x) USBHS_ENDPTCTRL0_TXT(x) -#define USBHS_EPCR0_TXE_MASK USBHS_ENDPTCTRL0_TXE_MASK -#define USBHS_EPCR0_TXE_SHIFT USBHS_ENDPTCTRL0_TXE_SHIFT -#define USBHS_EPCR0_TXE(x) USBHS_ENDPTCTRL0_TXE(x) -#define USBHS_EPCR_RXS_MASK USBHS_ENDPTCTRL_RXS_MASK -#define USBHS_EPCR_RXS_SHIFT USBHS_ENDPTCTRL_RXS_SHIFT -#define USBHS_EPCR_RXS(x) USBHS_ENDPTCTRL_RXS(x) -#define USBHS_EPCR_RXD_MASK USBHS_ENDPTCTRL_RXD_MASK -#define USBHS_EPCR_RXD_SHIFT USBHS_ENDPTCTRL_RXD_SHIFT -#define USBHS_EPCR_RXD(x) USBHS_ENDPTCTRL_RXD(x) -#define USBHS_EPCR_RXT_MASK USBHS_ENDPTCTRL_RXT_MASK -#define USBHS_EPCR_RXT_SHIFT USBHS_ENDPTCTRL_RXT_SHIFT -#define USBHS_EPCR_RXT(x) USBHS_ENDPTCTRL_RXT(x) -#define USBHS_EPCR_RXI_MASK USBHS_ENDPTCTRL_RXI_MASK -#define USBHS_EPCR_RXI_SHIFT USBHS_ENDPTCTRL_RXI_SHIFT -#define USBHS_EPCR_RXI(x) USBHS_ENDPTCTRL_RXI(x) -#define USBHS_EPCR_RXR_MASK USBHS_ENDPTCTRL_RXR_MASK -#define USBHS_EPCR_RXR_SHIFT USBHS_ENDPTCTRL_RXR_SHIFT -#define USBHS_EPCR_RXR(x) USBHS_ENDPTCTRL_RXR(x) -#define USBHS_EPCR_RXE_MASK USBHS_ENDPTCTRL_RXE_MASK -#define USBHS_EPCR_RXE_SHIFT USBHS_ENDPTCTRL_RXE_SHIFT -#define USBHS_EPCR_RXE(x) USBHS_ENDPTCTRL_RXE(x) -#define USBHS_EPCR_TXS_MASK USBHS_ENDPTCTRL_TXS_MASK -#define USBHS_EPCR_TXS_SHIFT USBHS_ENDPTCTRL_TXS_SHIFT -#define USBHS_EPCR_TXS(x) USBHS_ENDPTCTRL_TXS(x) -#define USBHS_EPCR_TXD_MASK USBHS_ENDPTCTRL_TXD_MASK -#define USBHS_EPCR_TXD_SHIFT USBHS_ENDPTCTRL_TXD_SHIFT -#define USBHS_EPCR_TXD(x) USBHS_ENDPTCTRL_TXD(x) -#define USBHS_EPCR_TXT_MASK USBHS_ENDPTCTRL_TXT_MASK -#define USBHS_EPCR_TXT_SHIFT USBHS_ENDPTCTRL_TXT_SHIFT -#define USBHS_EPCR_TXT(x) USBHS_ENDPTCTRL_TXT(x) -#define USBHS_EPCR_TXI_MASK USBHS_ENDPTCTRL_TXI_MASK -#define USBHS_EPCR_TXI_SHIFT USBHS_ENDPTCTRL_TXI_SHIFT -#define USBHS_EPCR_TXI(x) USBHS_ENDPTCTRL_TXI(x) -#define USBHS_EPCR_TXR_MASK USBHS_ENDPTCTRL_TXR_MASK -#define USBHS_EPCR_TXR_SHIFT USBHS_ENDPTCTRL_TXR_SHIFT -#define USBHS_EPCR_TXR(x) USBHS_ENDPTCTRL_TXR(x) -#define USBHS_EPCR_TXE_MASK USBHS_ENDPTCTRL_TXE_MASK -#define USBHS_EPCR_TXE_SHIFT USBHS_ENDPTCTRL_TXE_SHIFT -#define USBHS_EPCR_TXE(x) USBHS_ENDPTCTRL_TXE(x) -#define USBHS_EPCR_COUNT USBHS_ENDPTCTRL_COUNT -#define USBHS_PORTSC1_WKDS_MASK USBHS_PORTSC1_WKDC_MASK -#define USBHS_PORTSC1_WKDS_SHIFT USBHS_PORTSC1_WKDC_SHIFT -#define USBHS_PORTSC1_WKDS(x) USBHS_PORTSC1_WKDC(x) -#define USBHS_IRQHandler USB1_HS_IRQHandler - - -/*! - * @} - */ /* end of group USBHS_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- USBHSDCD Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USBHSDCD_Peripheral_Access_Layer USBHSDCD Peripheral Access Layer - * @{ - */ - -/** USBHSDCD - Register Layout Typedef */ -typedef struct { - __IO uint32_t CONTROL; /**< Control, offset: 0x0 */ - __IO uint32_t CLOCK; /**< Clock, offset: 0x4 */ - __I uint32_t STATUS; /**< Status, offset: 0x8 */ - __IO uint32_t SIGNAL_OVERRIDE; /**< Signal Override, offset: 0xC */ - __IO uint32_t TIMER0; /**< TIMER0, offset: 0x10 */ - __IO uint32_t TIMER1; /**< TIMER1, offset: 0x14 */ - union { /* offset: 0x18 */ - __IO uint32_t TIMER2_BC11; /**< TIMER2_BC11, offset: 0x18 */ - __IO uint32_t TIMER2_BC12; /**< TIMER2_BC12, offset: 0x18 */ - }; -} USBHSDCD_Type; - -/* ---------------------------------------------------------------------------- - -- USBHSDCD Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USBHSDCD_Register_Masks USBHSDCD Register Masks - * @{ - */ - -/*! @name CONTROL - Control */ -/*! @{ */ - -#define USBHSDCD_CONTROL_IACK_MASK (0x1U) -#define USBHSDCD_CONTROL_IACK_SHIFT (0U) -/*! IACK - Interrupt Acknowledge - * 0b0..Do not clear the interrupt. - * 0b1..Clear the IF field (interrupt flag). - */ -#define USBHSDCD_CONTROL_IACK(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_CONTROL_IACK_SHIFT)) & USBHSDCD_CONTROL_IACK_MASK) - -#define USBHSDCD_CONTROL_IF_MASK (0x100U) -#define USBHSDCD_CONTROL_IF_SHIFT (8U) -/*! IF - Interrupt Flag - * 0b0..No interrupt is pending. - * 0b1..An interrupt is pending. - */ -#define USBHSDCD_CONTROL_IF(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_CONTROL_IF_SHIFT)) & USBHSDCD_CONTROL_IF_MASK) - -#define USBHSDCD_CONTROL_IE_MASK (0x10000U) -#define USBHSDCD_CONTROL_IE_SHIFT (16U) -/*! IE - Interrupt Enable - * 0b0..Disable interrupts to the system. - * 0b1..Enable interrupts to the system. - */ -#define USBHSDCD_CONTROL_IE(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_CONTROL_IE_SHIFT)) & USBHSDCD_CONTROL_IE_MASK) - -#define USBHSDCD_CONTROL_BC12_MASK (0x20000U) -#define USBHSDCD_CONTROL_BC12_SHIFT (17U) -/*! BC12 - Battery Charging Revision 1.2 Compatibility - * 0b0..Compatible with BC1.1 - * 0b1..Compatible with BC1.2 (default) - */ -#define USBHSDCD_CONTROL_BC12(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_CONTROL_BC12_SHIFT)) & USBHSDCD_CONTROL_BC12_MASK) - -#define USBHSDCD_CONTROL_START_MASK (0x1000000U) -#define USBHSDCD_CONTROL_START_SHIFT (24U) -/*! START - Start Change Detection Sequence - * 0b0..Do not start the sequence. Writes of this value have no effect. - * 0b1..Initiate the charger detection sequence. If the sequence is already running, writes of this value have no effect. - */ -#define USBHSDCD_CONTROL_START(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_CONTROL_START_SHIFT)) & USBHSDCD_CONTROL_START_MASK) - -#define USBHSDCD_CONTROL_SR_MASK (0x2000000U) -#define USBHSDCD_CONTROL_SR_SHIFT (25U) -/*! SR - Software Reset - * 0b0..Do not perform a software reset. - * 0b1..Perform a software reset. - */ -#define USBHSDCD_CONTROL_SR(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_CONTROL_SR_SHIFT)) & USBHSDCD_CONTROL_SR_MASK) -/*! @} */ - -/*! @name CLOCK - Clock */ -/*! @{ */ - -#define USBHSDCD_CLOCK_CLOCK_UNIT_MASK (0x1U) -#define USBHSDCD_CLOCK_CLOCK_UNIT_SHIFT (0U) -/*! CLOCK_UNIT - Unit of Measurement Encoding for Clock Speed - * 0b0..kHz Speed (between 4 kHz and 1023 kHz) - * 0b1..MHz Speed (between 1 MHz and 1023 MHz) - */ -#define USBHSDCD_CLOCK_CLOCK_UNIT(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_CLOCK_CLOCK_UNIT_SHIFT)) & USBHSDCD_CLOCK_CLOCK_UNIT_MASK) - -#define USBHSDCD_CLOCK_CLOCK_SPEED_MASK (0xFFCU) -#define USBHSDCD_CLOCK_CLOCK_SPEED_SHIFT (2U) -/*! CLOCK_SPEED - Numerical Value of Clock Speed in Binary */ -#define USBHSDCD_CLOCK_CLOCK_SPEED(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_CLOCK_CLOCK_SPEED_SHIFT)) & USBHSDCD_CLOCK_CLOCK_SPEED_MASK) -/*! @} */ - -/*! @name STATUS - Status */ -/*! @{ */ - -#define USBHSDCD_STATUS_SEQ_RES_MASK (0x30000U) -#define USBHSDCD_STATUS_SEQ_RES_SHIFT (16U) -/*! SEQ_RES - Charger Detection Sequence Results - * 0b00..No results to report. - * 0b01..Attached to an SDP. Must comply with USB 2.0 by drawing only 2.5 mA (max) until connected. - * 0b10..Attached to a charging port. The exact meaning depends on the STATUS[SEQ_STAT] field (value 0: Attached - * to either a CDP or a DCP. The charger type detection has not completed. value 1: Attached to a CDP. The - * charger type detection has completed.) - * 0b11..Attached to a DCP. - */ -#define USBHSDCD_STATUS_SEQ_RES(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_STATUS_SEQ_RES_SHIFT)) & USBHSDCD_STATUS_SEQ_RES_MASK) - -#define USBHSDCD_STATUS_SEQ_STAT_MASK (0xC0000U) -#define USBHSDCD_STATUS_SEQ_STAT_SHIFT (18U) -/*! SEQ_STAT - Charger Detection Sequence Status - * 0b00..The module is either not enabled, or the module is enabled but the data pins have not yet been detected. - * 0b01..Data pin contact detection is complete. - * 0b10..Charging port detection is complete. - * 0b11..Charger type detection is complete. - */ -#define USBHSDCD_STATUS_SEQ_STAT(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_STATUS_SEQ_STAT_SHIFT)) & USBHSDCD_STATUS_SEQ_STAT_MASK) - -#define USBHSDCD_STATUS_ERR_MASK (0x100000U) -#define USBHSDCD_STATUS_ERR_SHIFT (20U) -/*! ERR - Error Flag - * 0b0..No sequence errors. - * 0b1..Error in the detection sequence. - */ -#define USBHSDCD_STATUS_ERR(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_STATUS_ERR_SHIFT)) & USBHSDCD_STATUS_ERR_MASK) - -#define USBHSDCD_STATUS_TO_MASK (0x200000U) -#define USBHSDCD_STATUS_TO_SHIFT (21U) -/*! TO - Timeout Flag - * 0b0..The detection sequence is not running for over 1 s. - * 0b1..It is over 1 s since the data pin contact was detected and debounced. - */ -#define USBHSDCD_STATUS_TO(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_STATUS_TO_SHIFT)) & USBHSDCD_STATUS_TO_MASK) - -#define USBHSDCD_STATUS_ACTIVE_MASK (0x400000U) -#define USBHSDCD_STATUS_ACTIVE_SHIFT (22U) -/*! ACTIVE - Active Status Indicator - * 0b0..The sequence is not running. - * 0b1..The sequence is running. - */ -#define USBHSDCD_STATUS_ACTIVE(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_STATUS_ACTIVE_SHIFT)) & USBHSDCD_STATUS_ACTIVE_MASK) -/*! @} */ - -/*! @name SIGNAL_OVERRIDE - Signal Override */ -/*! @{ */ - -#define USBHSDCD_SIGNAL_OVERRIDE_PS_MASK (0x7U) -#define USBHSDCD_SIGNAL_OVERRIDE_PS_SHIFT (0U) -/*! PS - Phase Selection - * 0b000..No overrides. Field must remain at this value during normal USB data communication to prevent - * unexpected conditions on USB_DP and USB_DM pins. (Default) - * 0b001..Reserved, not for customer use. - * 0b010..Enables VDP_SRC voltage source for the USB_DP pin and IDM_SINK current source for the USB_DM pin. - * 0b011..Reserved, not for customer use. - * 0b100..Enables VDM_SRC voltage source only. - * 0b101..Reserved, not for customer use. - * 0b110..Reserved, not for customer use. - * 0b111..Reserved, not for customer use. - */ -#define USBHSDCD_SIGNAL_OVERRIDE_PS(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_SIGNAL_OVERRIDE_PS_SHIFT)) & USBHSDCD_SIGNAL_OVERRIDE_PS_MASK) -/*! @} */ - -/*! @name TIMER0 - TIMER0 */ -/*! @{ */ - -#define USBHSDCD_TIMER0_TUNITCON_MASK (0xFFFU) -#define USBHSDCD_TIMER0_TUNITCON_SHIFT (0U) -/*! TUNITCON - Unit Connection Timer Elapse (in ms) */ -#define USBHSDCD_TIMER0_TUNITCON(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_TIMER0_TUNITCON_SHIFT)) & USBHSDCD_TIMER0_TUNITCON_MASK) - -#define USBHSDCD_TIMER0_TSEQ_INIT_MASK (0x3FF0000U) -#define USBHSDCD_TIMER0_TSEQ_INIT_SHIFT (16U) -/*! TSEQ_INIT - Sequence Initiation Time - * 0b0000000000-0b1111111111..0 ms - 1023 ms - */ -#define USBHSDCD_TIMER0_TSEQ_INIT(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_TIMER0_TSEQ_INIT_SHIFT)) & USBHSDCD_TIMER0_TSEQ_INIT_MASK) -/*! @} */ - -/*! @name TIMER1 - TIMER1 */ -/*! @{ */ - -#define USBHSDCD_TIMER1_TVDPSRC_ON_MASK (0x3FFU) -#define USBHSDCD_TIMER1_TVDPSRC_ON_SHIFT (0U) -/*! TVDPSRC_ON - Time Period Comparator Enabled - * 0b0000000001-0b1111111111..1 ms - 1023 ms - */ -#define USBHSDCD_TIMER1_TVDPSRC_ON(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_TIMER1_TVDPSRC_ON_SHIFT)) & USBHSDCD_TIMER1_TVDPSRC_ON_MASK) - -#define USBHSDCD_TIMER1_TDCD_DBNC_MASK (0x3FF0000U) -#define USBHSDCD_TIMER1_TDCD_DBNC_SHIFT (16U) -/*! TDCD_DBNC - Time Period to Debounce D+ Signal - * 0b0000000001-0b1111111111..1 ms - 1023 ms - */ -#define USBHSDCD_TIMER1_TDCD_DBNC(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_TIMER1_TDCD_DBNC_SHIFT)) & USBHSDCD_TIMER1_TDCD_DBNC_MASK) -/*! @} */ - -/*! @name TIMER2_BC11 - TIMER2_BC11 */ -/*! @{ */ - -#define USBHSDCD_TIMER2_BC11_CHECK_DM_MASK (0xFU) -#define USBHSDCD_TIMER2_BC11_CHECK_DM_SHIFT (0U) -/*! CHECK_DM - Time Before Check of D- Line - * 0b0001-0b1111..1 ms - 15 ms - */ -#define USBHSDCD_TIMER2_BC11_CHECK_DM(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_TIMER2_BC11_CHECK_DM_SHIFT)) & USBHSDCD_TIMER2_BC11_CHECK_DM_MASK) - -#define USBHSDCD_TIMER2_BC11_TVDPSRC_CON_MASK (0x3FF0000U) -#define USBHSDCD_TIMER2_BC11_TVDPSRC_CON_SHIFT (16U) -/*! TVDPSRC_CON - Time Period Before Enabling D+ Pullup - * 0b0000000001-0b1111111111..1 ms - 1023 ms - */ -#define USBHSDCD_TIMER2_BC11_TVDPSRC_CON(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_TIMER2_BC11_TVDPSRC_CON_SHIFT)) & USBHSDCD_TIMER2_BC11_TVDPSRC_CON_MASK) -/*! @} */ - -/*! @name TIMER2_BC12 - TIMER2_BC12 */ -/*! @{ */ - -#define USBHSDCD_TIMER2_BC12_TVDMSRC_ON_MASK (0x3FFU) -#define USBHSDCD_TIMER2_BC12_TVDMSRC_ON_SHIFT (0U) -/*! TVDMSRC_ON - TVDMSRC_ON - * 0b0000000000-0b0000101000..0 ms - 40 ms - */ -#define USBHSDCD_TIMER2_BC12_TVDMSRC_ON(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_TIMER2_BC12_TVDMSRC_ON_SHIFT)) & USBHSDCD_TIMER2_BC12_TVDMSRC_ON_MASK) - -#define USBHSDCD_TIMER2_BC12_TWAIT_AFTER_PRD_MASK (0x3FF0000U) -#define USBHSDCD_TIMER2_BC12_TWAIT_AFTER_PRD_SHIFT (16U) -/*! TWAIT_AFTER_PRD - TWAIT_AFTER_PRD - * 0b0000000001-0b1111111111..1 ms - 1023 ms - */ -#define USBHSDCD_TIMER2_BC12_TWAIT_AFTER_PRD(x) (((uint32_t)(((uint32_t)(x)) << USBHSDCD_TIMER2_BC12_TWAIT_AFTER_PRD_SHIFT)) & USBHSDCD_TIMER2_BC12_TWAIT_AFTER_PRD_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group USBHSDCD_Register_Masks */ - - -/* USBHSDCD - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral USBHS1_PHY_DCD base address */ - #define USBHS1_PHY_DCD_BASE (0x5010A800u) - /** Peripheral USBHS1_PHY_DCD base address */ - #define USBHS1_PHY_DCD_BASE_NS (0x4010A800u) - /** Peripheral USBHS1_PHY_DCD base pointer */ - #define USBHS1_PHY_DCD ((USBHSDCD_Type *)USBHS1_PHY_DCD_BASE) - /** Peripheral USBHS1_PHY_DCD base pointer */ - #define USBHS1_PHY_DCD_NS ((USBHSDCD_Type *)USBHS1_PHY_DCD_BASE_NS) - /** Array initializer of USBHSDCD peripheral base addresses */ - #define USBHSDCD_BASE_ADDRS { USBHS1_PHY_DCD_BASE } - /** Array initializer of USBHSDCD peripheral base pointers */ - #define USBHSDCD_BASE_PTRS { USBHS1_PHY_DCD } - /** Array initializer of USBHSDCD peripheral base addresses */ - #define USBHSDCD_BASE_ADDRS_NS { USBHS1_PHY_DCD_BASE_NS } - /** Array initializer of USBHSDCD peripheral base pointers */ - #define USBHSDCD_BASE_PTRS_NS { USBHS1_PHY_DCD_NS } -#else - /** Peripheral USBHS1_PHY_DCD base address */ - #define USBHS1_PHY_DCD_BASE (0x4010A800u) - /** Peripheral USBHS1_PHY_DCD base pointer */ - #define USBHS1_PHY_DCD ((USBHSDCD_Type *)USBHS1_PHY_DCD_BASE) - /** Array initializer of USBHSDCD peripheral base addresses */ - #define USBHSDCD_BASE_ADDRS { USBHS1_PHY_DCD_BASE } - /** Array initializer of USBHSDCD peripheral base pointers */ - #define USBHSDCD_BASE_PTRS { USBHS1_PHY_DCD } -#endif -/* Backward compatibility */ -#define USBHSDCD_IRQS { USB1_HS_PHY_IRQn } -#define USB1_HS_PHY_IRQS USBPHY_IRQS - - -/*! - * @} - */ /* end of group USBHSDCD_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- USBNC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USBNC_Peripheral_Access_Layer USBNC Peripheral Access Layer - * @{ - */ - -/** USBNC - Register Layout Typedef */ -typedef struct { - __IO uint32_t CTRL1; /**< USB OTG Control 1, offset: 0x0 */ - __IO uint32_t CTRL2; /**< USB OTG Control 2, offset: 0x4 */ - uint8_t RESERVED_0[8]; - __IO uint32_t HSIC_CTRL; /**< USB Host HSIC Control, offset: 0x10 */ -} USBNC_Type; - -/* ---------------------------------------------------------------------------- - -- USBNC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USBNC_Register_Masks USBNC Register Masks - * @{ - */ - -/*! @name CTRL1 - USB OTG Control 1 */ -/*! @{ */ - -#define USBNC_CTRL1_OVER_CUR_DIS_MASK (0x80U) -#define USBNC_CTRL1_OVER_CUR_DIS_SHIFT (7U) -/*! OVER_CUR_DIS - Disable Overcurrent Detection - * 0b1..Disables - * 0b0..Enables - */ -#define USBNC_CTRL1_OVER_CUR_DIS(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL1_OVER_CUR_DIS_SHIFT)) & USBNC_CTRL1_OVER_CUR_DIS_MASK) - -#define USBNC_CTRL1_OVER_CUR_POL_MASK (0x100U) -#define USBNC_CTRL1_OVER_CUR_POL_SHIFT (8U) -/*! OVER_CUR_POL - Polarity of Overcurrent - * 0b1..Low active (low on this signal represents an overcurrent condition) - * 0b0..High active (high on this signal represents an overcurrent condition) - */ -#define USBNC_CTRL1_OVER_CUR_POL(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL1_OVER_CUR_POL_SHIFT)) & USBNC_CTRL1_OVER_CUR_POL_MASK) - -#define USBNC_CTRL1_PWR_POL_MASK (0x200U) -#define USBNC_CTRL1_PWR_POL_SHIFT (9U) -/*! PWR_POL - Power Polarity - * 0b1..PMIC Power Pin is High active. - * 0b0..PMIC Power Pin is Low active. - */ -#define USBNC_CTRL1_PWR_POL(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL1_PWR_POL_SHIFT)) & USBNC_CTRL1_PWR_POL_MASK) - -#define USBNC_CTRL1_WIE_MASK (0x400U) -#define USBNC_CTRL1_WIE_SHIFT (10U) -/*! WIE - Wake-up Interrupt Enable - * 0b1..Interrupt Enabled - * 0b0..Interrupt Disabled - */ -#define USBNC_CTRL1_WIE(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL1_WIE_SHIFT)) & USBNC_CTRL1_WIE_MASK) - -#define USBNC_CTRL1_WKUP_SW_EN_MASK (0x4000U) -#define USBNC_CTRL1_WKUP_SW_EN_SHIFT (14U) -/*! WKUP_SW_EN - Software Wake-up Enable - * 0b1..Enables - * 0b0..Disables - */ -#define USBNC_CTRL1_WKUP_SW_EN(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL1_WKUP_SW_EN_SHIFT)) & USBNC_CTRL1_WKUP_SW_EN_MASK) - -#define USBNC_CTRL1_WKUP_SW_MASK (0x8000U) -#define USBNC_CTRL1_WKUP_SW_SHIFT (15U) -/*! WKUP_SW - Software Wake-up - * 0b1..Force wake-up - * 0b0..Inactive - */ -#define USBNC_CTRL1_WKUP_SW(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL1_WKUP_SW_SHIFT)) & USBNC_CTRL1_WKUP_SW_MASK) - -#define USBNC_CTRL1_WKUP_ID_EN_MASK (0x10000U) -#define USBNC_CTRL1_WKUP_ID_EN_SHIFT (16U) -/*! WKUP_ID_EN - Wake-up on ID Change Enable - * 0b1..Enables - * 0b0..Disables - */ -#define USBNC_CTRL1_WKUP_ID_EN(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL1_WKUP_ID_EN_SHIFT)) & USBNC_CTRL1_WKUP_ID_EN_MASK) - -#define USBNC_CTRL1_WKUP_VBUS_EN_MASK (0x20000U) -#define USBNC_CTRL1_WKUP_VBUS_EN_SHIFT (17U) -/*! WKUP_VBUS_EN - Wake-up on VBUS Change Enable - * 0b1..Enables - * 0b0..Disables - */ -#define USBNC_CTRL1_WKUP_VBUS_EN(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL1_WKUP_VBUS_EN_SHIFT)) & USBNC_CTRL1_WKUP_VBUS_EN_MASK) - -#define USBNC_CTRL1_WKUP_DPDM_EN_MASK (0x20000000U) -#define USBNC_CTRL1_WKUP_DPDM_EN_SHIFT (29U) -/*! WKUP_DPDM_EN - Wake-up on DPDM Change Enable - * 0b1..DPDM changes wake-up to be enabled, it is for device only - * 0b0..DPDM changes wake-up to be disabled only when VBUS is 0 - */ -#define USBNC_CTRL1_WKUP_DPDM_EN(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL1_WKUP_DPDM_EN_SHIFT)) & USBNC_CTRL1_WKUP_DPDM_EN_MASK) - -#define USBNC_CTRL1_WIR_MASK (0x80000000U) -#define USBNC_CTRL1_WIR_SHIFT (31U) -/*! WIR - Wake-up Interrupt Request - * 0b1..Request received - * 0b0..No request received - */ -#define USBNC_CTRL1_WIR(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL1_WIR_SHIFT)) & USBNC_CTRL1_WIR_MASK) -/*! @} */ - -/*! @name CTRL2 - USB OTG Control 2 */ -/*! @{ */ - -#define USBNC_CTRL2_VBUS_SOURCE_SEL_MASK (0x3U) -#define USBNC_CTRL2_VBUS_SOURCE_SEL_SHIFT (0U) -/*! VBUS_SOURCE_SEL - VBUS Source Select - * 0b00..vbus_valid - * 0b01..sess_valid - * 0b10..sess_valid - * 0b11..sess_valid - */ -#define USBNC_CTRL2_VBUS_SOURCE_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL2_VBUS_SOURCE_SEL_SHIFT)) & USBNC_CTRL2_VBUS_SOURCE_SEL_MASK) - -#define USBNC_CTRL2_AUTURESUME_EN_MASK (0x4U) -#define USBNC_CTRL2_AUTURESUME_EN_SHIFT (2U) -/*! AUTURESUME_EN - Auto Resume Enable - * 0b0..Default - */ -#define USBNC_CTRL2_AUTURESUME_EN(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL2_AUTURESUME_EN_SHIFT)) & USBNC_CTRL2_AUTURESUME_EN_MASK) - -#define USBNC_CTRL2_LOWSPEED_EN_MASK (0x8U) -#define USBNC_CTRL2_LOWSPEED_EN_SHIFT (3U) -/*! LOWSPEED_EN - Low Speed Enable - * 0b0..Default - */ -#define USBNC_CTRL2_LOWSPEED_EN(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL2_LOWSPEED_EN_SHIFT)) & USBNC_CTRL2_LOWSPEED_EN_MASK) - -#define USBNC_CTRL2_UTMI_CLK_VLD_MASK (0x80000000U) -#define USBNC_CTRL2_UTMI_CLK_VLD_SHIFT (31U) -/*! UTMI_CLK_VLD - UTMI Clock Valid - * 0b0..Default - */ -#define USBNC_CTRL2_UTMI_CLK_VLD(x) (((uint32_t)(((uint32_t)(x)) << USBNC_CTRL2_UTMI_CLK_VLD_SHIFT)) & USBNC_CTRL2_UTMI_CLK_VLD_MASK) -/*! @} */ - -/*! @name HSIC_CTRL - USB Host HSIC Control */ -/*! @{ */ - -#define USBNC_HSIC_CTRL_HSIC_CLK_ON_MASK (0x800U) -#define USBNC_HSIC_CTRL_HSIC_CLK_ON_SHIFT (11U) -/*! HSIC_CLK_ON - HSIC Clock ON - * 0b1..Active - * 0b0..Inactive - */ -#define USBNC_HSIC_CTRL_HSIC_CLK_ON(x) (((uint32_t)(((uint32_t)(x)) << USBNC_HSIC_CTRL_HSIC_CLK_ON_SHIFT)) & USBNC_HSIC_CTRL_HSIC_CLK_ON_MASK) - -#define USBNC_HSIC_CTRL_HSIC_EN_MASK (0x1000U) -#define USBNC_HSIC_CTRL_HSIC_EN_SHIFT (12U) -/*! HSIC_EN - Host HSIC Enable - * 0b1..Enabled - * 0b0..Disabled - */ -#define USBNC_HSIC_CTRL_HSIC_EN(x) (((uint32_t)(((uint32_t)(x)) << USBNC_HSIC_CTRL_HSIC_EN_SHIFT)) & USBNC_HSIC_CTRL_HSIC_EN_MASK) - -#define USBNC_HSIC_CTRL_CLK_VLD_MASK (0x80000000U) -#define USBNC_HSIC_CTRL_CLK_VLD_SHIFT (31U) -/*! CLK_VLD - Clock Valid - * 0b1..Valid - * 0b0..Invalid - */ -#define USBNC_HSIC_CTRL_CLK_VLD(x) (((uint32_t)(((uint32_t)(x)) << USBNC_HSIC_CTRL_CLK_VLD_SHIFT)) & USBNC_HSIC_CTRL_CLK_VLD_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group USBNC_Register_Masks */ - - -/* USBNC - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral USBHS1__USBNC base address */ - #define USBHS1__USBNC_BASE (0x5010B200u) - /** Peripheral USBHS1__USBNC base address */ - #define USBHS1__USBNC_BASE_NS (0x4010B200u) - /** Peripheral USBHS1__USBNC base pointer */ - #define USBHS1__USBNC ((USBNC_Type *)USBHS1__USBNC_BASE) - /** Peripheral USBHS1__USBNC base pointer */ - #define USBHS1__USBNC_NS ((USBNC_Type *)USBHS1__USBNC_BASE_NS) - /** Array initializer of USBNC peripheral base addresses */ - #define USBNC_BASE_ADDRS { USBHS1__USBNC_BASE } - /** Array initializer of USBNC peripheral base pointers */ - #define USBNC_BASE_PTRS { USBHS1__USBNC } - /** Array initializer of USBNC peripheral base addresses */ - #define USBNC_BASE_ADDRS_NS { USBHS1__USBNC_BASE_NS } - /** Array initializer of USBNC peripheral base pointers */ - #define USBNC_BASE_PTRS_NS { USBHS1__USBNC_NS } -#else - /** Peripheral USBHS1__USBNC base address */ - #define USBHS1__USBNC_BASE (0x4010B200u) - /** Peripheral USBHS1__USBNC base pointer */ - #define USBHS1__USBNC ((USBNC_Type *)USBHS1__USBNC_BASE) - /** Array initializer of USBNC peripheral base addresses */ - #define USBNC_BASE_ADDRS { USBHS1__USBNC_BASE } - /** Array initializer of USBNC peripheral base pointers */ - #define USBNC_BASE_PTRS { USBHS1__USBNC } -#endif -/* Backward compatibility */ -#define USB_OTGn_CTRL CTRL1 -#define USBNC_USB_OTGn_CTRL_OVER_CUR_DIS_MASK USBNC_CTRL1_OVER_CUR_DIS_MASK -#define USBNC_USB_OTGn_CTRL_OVER_CUR_DIS_SHIFT USBNC_CTRL1_OVER_CUR_DIS_SHIFT -#define USBNC_USB_OTGn_CTRL_OVER_CUR_DIS(x) USBNC_CTRL1_OVER_CUR_DIS(x) -#define USBNC_USB_OTGn_CTRL_OVER_CUR_POL_MASK USBNC_CTRL1_OVER_CUR_POL_MASK -#define USBNC_USB_OTGn_CTRL_OVER_CUR_POL_SHIFT USBNC_CTRL1_OVER_CUR_POL_SHIFT -#define USBNC_USB_OTGn_CTRL_OVER_CUR_POL(x) USBNC_CTRL1_OVER_CUR_POL(x) -#define USBNC_USB_OTGn_CTRL_PWR_POL_MASK USBNC_CTRL1_PWR_POL_MASK -#define USBNC_USB_OTGn_CTRL_PWR_POL_SHIFT USBNC_CTRL1_PWR_POL_SHIFT -#define USBNC_USB_OTGn_CTRL_PWR_POL(x) USBNC_CTRL1_PWR_POL(x) -#define USBNC_USB_OTGn_CTRL_WIE_MASK USBNC_CTRL1_WIE_MASK -#define USBNC_USB_OTGn_CTRL_WIE_SHIFT USBNC_CTRL1_WIE_SHIFT -#define USBNC_USB_OTGn_CTRL_WIE(x) USBNC_CTRL1_WIE(x) -#define USBNC_USB_OTGn_CTRL_WKUP_SW_EN_MASK USBNC_CTRL1_WKUP_SW_EN_MASK -#define USBNC_USB_OTGn_CTRL_WKUP_SW_EN_SHIFT USBNC_CTRL1_WKUP_SW_EN_SHIFT -#define USBNC_USB_OTGn_CTRL_WKUP_SW_EN(x) USBNC_CTRL1_WKUP_SW_EN(x) -#define USBNC_USB_OTGn_CTRL_WKUP_SW_MASK USBNC_CTRL1_WKUP_SW_MASK -#define USBNC_USB_OTGn_CTRL_WKUP_SW_SHIFT USBNC_CTRL1_WKUP_SW_SHIFT -#define USBNC_USB_OTGn_CTRL_WKUP_SW(x) USBNC_CTRL1_WKUP_SW(x) -#define USBNC_USB_OTGn_CTRL_WKUP_ID_EN_MASK USBNC_CTRL1_WKUP_ID_EN_MASK -#define USBNC_USB_OTGn_CTRL_WKUP_ID_EN_SHIFT USBNC_CTRL1_WKUP_ID_EN_SHIFT -#define USBNC_USB_OTGn_CTRL_WKUP_ID_EN(x) USBNC_CTRL1_WKUP_ID_EN(x) -#define USBNC_USB_OTGn_CTRL_WKUP_VBUS_EN_MASK USBNC_CTRL1_WKUP_VBUS_EN_MASK -#define USBNC_USB_OTGn_CTRL_WKUP_VBUS_EN_SHIFT USBNC_CTRL1_WKUP_VBUS_EN_SHIFT -#define USBNC_USB_OTGn_CTRL_WKUP_VBUS_EN(x) USBNC_CTRL1_WKUP_VBUS_EN(x) -#define USBNC_USB_OTGn_CTRL_WKUP_DPDM_EN_MASK USBNC_CTRL1_WKUP_DPDM_EN_MASK -#define USBNC_USB_OTGn_CTRL_WKUP_DPDM_EN_SHIFT USBNC_CTRL1_WKUP_DPDM_EN_SHIFT -#define USBNC_USB_OTGn_CTRL_WKUP_DPDM_EN(x) USBNC_CTRL1_WKUP_DPDM_EN(x) -#define USBNC_USB_OTGn_CTRL_WIR_MASK USBNC_CTRL1_WIR_MASK -#define USBNC_USB_OTGn_CTRL_WIR_SHIFT USBNC_CTRL1_WIR_SHIFT -#define USBNC_USB_OTGn_CTRL_WIR(x) USBNC_CTRL1_WIR(x) - - -/*! - * @} - */ /* end of group USBNC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- USBPHY Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USBPHY_Peripheral_Access_Layer USBPHY Peripheral Access Layer - * @{ - */ - -/** USBPHY - Register Layout Typedef */ -typedef struct { - __IO uint32_t PWD; /**< Power Down, offset: 0x0 */ - __IO uint32_t PWD_SET; /**< Power Down, offset: 0x4 */ - __IO uint32_t PWD_CLR; /**< Power Down, offset: 0x8 */ - __IO uint32_t PWD_TOG; /**< Power Down, offset: 0xC */ - __IO uint32_t TX; /**< TX Control, offset: 0x10 */ - __IO uint32_t TX_SET; /**< TX Control, offset: 0x14 */ - __IO uint32_t TX_CLR; /**< TX Control, offset: 0x18 */ - __IO uint32_t TX_TOG; /**< TX Control, offset: 0x1C */ - __IO uint32_t RX; /**< RX Control, offset: 0x20 */ - __IO uint32_t RX_SET; /**< RX Control, offset: 0x24 */ - __IO uint32_t RX_CLR; /**< RX Control, offset: 0x28 */ - __IO uint32_t RX_TOG; /**< RX Control, offset: 0x2C */ - __IO uint32_t CTRL; /**< General Purpose Control, offset: 0x30 */ - __IO uint32_t CTRL_SET; /**< General Purpose Control, offset: 0x34 */ - __IO uint32_t CTRL_CLR; /**< General Purpose Control, offset: 0x38 */ - __IO uint32_t CTRL_TOG; /**< General Purpose Control, offset: 0x3C */ - __IO uint32_t STATUS; /**< Status, offset: 0x40 */ - uint8_t RESERVED_0[12]; - __IO uint32_t DEBUG0; /**< Debug 0, offset: 0x50 */ - __IO uint32_t DEBUG0_SET; /**< Debug 0, offset: 0x54 */ - __IO uint32_t DEBUG0_CLR; /**< Debug 0, offset: 0x58 */ - __IO uint32_t DEBUG0_TOG; /**< Debug 0, offset: 0x5C */ - uint8_t RESERVED_1[32]; - __I uint32_t VERSION; /**< Version, offset: 0x80 */ - uint8_t RESERVED_2[12]; - __IO uint32_t IP; /**< IP Block, offset: 0x90 */ - __IO uint32_t IP_SET; /**< IP Block, offset: 0x94 */ - __IO uint32_t IP_CLR; /**< IP Block, offset: 0x98 */ - __IO uint32_t IP_TOG; /**< IP Block, offset: 0x9C */ - __IO uint32_t PLL_SIC; /**< PLL SIC, offset: 0xA0 */ - __IO uint32_t PLL_SIC_SET; /**< PLL SIC, offset: 0xA4 */ - __IO uint32_t PLL_SIC_CLR; /**< PLL SIC, offset: 0xA8 */ - __IO uint32_t PLL_SIC_TOG; /**< PLL SIC, offset: 0xAC */ - uint8_t RESERVED_3[16]; - __IO uint32_t USB1_VBUS_DETECT; /**< VBUS Detect, offset: 0xC0 */ - __IO uint32_t USB1_VBUS_DETECT_SET; /**< VBUS Detect, offset: 0xC4 */ - __IO uint32_t USB1_VBUS_DETECT_CLR; /**< VBUS Detect, offset: 0xC8 */ - __IO uint32_t USB1_VBUS_DETECT_TOG; /**< VBUS Detect, offset: 0xCC */ - __I uint32_t USB1_VBUS_DET_STAT; /**< VBUS Detect Status, offset: 0xD0 */ - __I uint32_t USB1_VBUS_DET_STAT_SET; /**< VBUS Detect Status, offset: 0xD4 */ - __I uint32_t USB1_VBUS_DET_STAT_CLR; /**< VBUS Detect Status, offset: 0xD8 */ - __I uint32_t USB1_VBUS_DET_STAT_TOG; /**< VBUS Detect Status, offset: 0xDC */ - __IO uint32_t USB1_CHRG_DETECT; /**< Charger Detect, offset: 0xE0 */ - __IO uint32_t USB1_CHRG_DETECT_SET; /**< Charger Detect, offset: 0xE4 */ - __IO uint32_t USB1_CHRG_DETECT_CLR; /**< Charger Detect, offset: 0xE8 */ - __IO uint32_t USB1_CHRG_DETECT_TOG; /**< Charger Detect, offset: 0xEC */ - __I uint32_t USB1_CHRG_DET_STAT; /**< Charger Detect Status, offset: 0xF0 */ - __I uint32_t USB1_CHRG_DET_STAT_SET; /**< Charger Detect Status, offset: 0xF4 */ - __I uint32_t USB1_CHRG_DET_STAT_CLR; /**< Charger Detect Status, offset: 0xF8 */ - __I uint32_t USB1_CHRG_DET_STAT_TOG; /**< Charger Detect Status, offset: 0xFC */ - __IO uint32_t ANACTRL; /**< Analog Control, offset: 0x100 */ - __IO uint32_t ANACTRL_SET; /**< Analog Control, offset: 0x104 */ - __IO uint32_t ANACTRL_CLR; /**< Analog Control, offset: 0x108 */ - __IO uint32_t ANACTRL_TOG; /**< Analog Control, offset: 0x10C */ - uint8_t RESERVED_4[32]; - __IO uint32_t TRIM_OVERRIDE_EN; /**< Trim, offset: 0x130 */ - __IO uint32_t TRIM_OVERRIDE_EN_SET; /**< Trim, offset: 0x134 */ - __IO uint32_t TRIM_OVERRIDE_EN_CLR; /**< Trim, offset: 0x138 */ - __IO uint32_t TRIM_OVERRIDE_EN_TOG; /**< Trim, offset: 0x13C */ - __IO uint32_t PFDA; /**< PFD A, offset: 0x140 */ - __IO uint32_t PFDA_SET; /**< PFD A, offset: 0x144 */ - __IO uint32_t PFDA_CLR; /**< PFD A, offset: 0x148 */ - __IO uint32_t PFDA_TOG; /**< PFD A, offset: 0x14C */ -} USBPHY_Type; - -/* ---------------------------------------------------------------------------- - -- USBPHY Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USBPHY_Register_Masks USBPHY Register Masks - * @{ - */ - -/*! @name PWD - Power Down */ -/*! @{ */ - -#define USBPHY_PWD_TXPWDFS_MASK (0x400U) -#define USBPHY_PWD_TXPWDFS_SHIFT (10U) -/*! TXPWDFS - Power Down USB FS TX Drivers - * 0b0..Provide bias to enable - * 0b1..Disable or power down - */ -#define USBPHY_PWD_TXPWDFS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_TXPWDFS_SHIFT)) & USBPHY_PWD_TXPWDFS_MASK) - -#define USBPHY_PWD_TXPWDIBIAS_MASK (0x800U) -#define USBPHY_PWD_TXPWDIBIAS_SHIFT (11U) -/*! TXPWDIBIAS - Power Down USBPHY TX Current Bias Block - * 0b0..Enable - * 0b1..Disable or power down - */ -#define USBPHY_PWD_TXPWDIBIAS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_TXPWDIBIAS_SHIFT)) & USBPHY_PWD_TXPWDIBIAS_MASK) - -#define USBPHY_PWD_TXPWDV2I_MASK (0x1000U) -#define USBPHY_PWD_TXPWDV2I_SHIFT (12U) -/*! TXPWDV2I - Power Down USBPHY TX V-I Converter and Current Mirror - * 0b0..Enable - * 0b1..Disable or power down - */ -#define USBPHY_PWD_TXPWDV2I(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_TXPWDV2I_SHIFT)) & USBPHY_PWD_TXPWDV2I_MASK) - -#define USBPHY_PWD_RXPWDENV_MASK (0x20000U) -#define USBPHY_PWD_RXPWDENV_SHIFT (17U) -/*! RXPWDENV - Power Down USB HS RX Envelope Detector - * 0b0..Enable - * 0b1..Disable or power down - */ -#define USBPHY_PWD_RXPWDENV(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_RXPWDENV_SHIFT)) & USBPHY_PWD_RXPWDENV_MASK) - -#define USBPHY_PWD_RXPWD1PT1_MASK (0x40000U) -#define USBPHY_PWD_RXPWD1PT1_SHIFT (18U) -/*! RXPWD1PT1 - Power Down USB FS Differential Receiver - * 0b0..Enable - * 0b1..Disable or power down - */ -#define USBPHY_PWD_RXPWD1PT1(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_RXPWD1PT1_SHIFT)) & USBPHY_PWD_RXPWD1PT1_MASK) - -#define USBPHY_PWD_RXPWDDIFF_MASK (0x80000U) -#define USBPHY_PWD_RXPWDDIFF_SHIFT (19U) -/*! RXPWDDIFF - Power Down USB HS Differential Receiver - * 0b0..Enable - * 0b1..Disable or power down - */ -#define USBPHY_PWD_RXPWDDIFF(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_RXPWDDIFF_SHIFT)) & USBPHY_PWD_RXPWDDIFF_MASK) - -#define USBPHY_PWD_RXPWDRX_MASK (0x100000U) -#define USBPHY_PWD_RXPWDRX_SHIFT (20U) -/*! RXPWDRX - Power Down USBPHY Receiver Circuits - * 0b0..Enable - * 0b1..Disable or power down - */ -#define USBPHY_PWD_RXPWDRX(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_RXPWDRX_SHIFT)) & USBPHY_PWD_RXPWDRX_MASK) -/*! @} */ - -/*! @name PWD_SET - Power Down */ -/*! @{ */ - -#define USBPHY_PWD_SET_TXPWDFS_MASK (0x400U) -#define USBPHY_PWD_SET_TXPWDFS_SHIFT (10U) -/*! TXPWDFS - Power Down USB FS TX Drivers */ -#define USBPHY_PWD_SET_TXPWDFS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_SET_TXPWDFS_SHIFT)) & USBPHY_PWD_SET_TXPWDFS_MASK) - -#define USBPHY_PWD_SET_TXPWDIBIAS_MASK (0x800U) -#define USBPHY_PWD_SET_TXPWDIBIAS_SHIFT (11U) -/*! TXPWDIBIAS - Power Down USBPHY TX Current Bias Block */ -#define USBPHY_PWD_SET_TXPWDIBIAS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_SET_TXPWDIBIAS_SHIFT)) & USBPHY_PWD_SET_TXPWDIBIAS_MASK) - -#define USBPHY_PWD_SET_TXPWDV2I_MASK (0x1000U) -#define USBPHY_PWD_SET_TXPWDV2I_SHIFT (12U) -/*! TXPWDV2I - Power Down USBPHY TX V-I Converter and Current Mirror */ -#define USBPHY_PWD_SET_TXPWDV2I(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_SET_TXPWDV2I_SHIFT)) & USBPHY_PWD_SET_TXPWDV2I_MASK) - -#define USBPHY_PWD_SET_RXPWDENV_MASK (0x20000U) -#define USBPHY_PWD_SET_RXPWDENV_SHIFT (17U) -/*! RXPWDENV - Power Down USB HS RX Envelope Detector */ -#define USBPHY_PWD_SET_RXPWDENV(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_SET_RXPWDENV_SHIFT)) & USBPHY_PWD_SET_RXPWDENV_MASK) - -#define USBPHY_PWD_SET_RXPWD1PT1_MASK (0x40000U) -#define USBPHY_PWD_SET_RXPWD1PT1_SHIFT (18U) -/*! RXPWD1PT1 - Power Down USB FS Differential Receiver */ -#define USBPHY_PWD_SET_RXPWD1PT1(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_SET_RXPWD1PT1_SHIFT)) & USBPHY_PWD_SET_RXPWD1PT1_MASK) - -#define USBPHY_PWD_SET_RXPWDDIFF_MASK (0x80000U) -#define USBPHY_PWD_SET_RXPWDDIFF_SHIFT (19U) -/*! RXPWDDIFF - Power Down USB HS Differential Receiver */ -#define USBPHY_PWD_SET_RXPWDDIFF(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_SET_RXPWDDIFF_SHIFT)) & USBPHY_PWD_SET_RXPWDDIFF_MASK) - -#define USBPHY_PWD_SET_RXPWDRX_MASK (0x100000U) -#define USBPHY_PWD_SET_RXPWDRX_SHIFT (20U) -/*! RXPWDRX - Power Down USBPHY Receiver Circuits */ -#define USBPHY_PWD_SET_RXPWDRX(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_SET_RXPWDRX_SHIFT)) & USBPHY_PWD_SET_RXPWDRX_MASK) -/*! @} */ - -/*! @name PWD_CLR - Power Down */ -/*! @{ */ - -#define USBPHY_PWD_CLR_TXPWDFS_MASK (0x400U) -#define USBPHY_PWD_CLR_TXPWDFS_SHIFT (10U) -/*! TXPWDFS - Power Down USB FS TX Drivers */ -#define USBPHY_PWD_CLR_TXPWDFS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_CLR_TXPWDFS_SHIFT)) & USBPHY_PWD_CLR_TXPWDFS_MASK) - -#define USBPHY_PWD_CLR_TXPWDIBIAS_MASK (0x800U) -#define USBPHY_PWD_CLR_TXPWDIBIAS_SHIFT (11U) -/*! TXPWDIBIAS - Power Down USBPHY TX Current Bias Block */ -#define USBPHY_PWD_CLR_TXPWDIBIAS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_CLR_TXPWDIBIAS_SHIFT)) & USBPHY_PWD_CLR_TXPWDIBIAS_MASK) - -#define USBPHY_PWD_CLR_TXPWDV2I_MASK (0x1000U) -#define USBPHY_PWD_CLR_TXPWDV2I_SHIFT (12U) -/*! TXPWDV2I - Power Down USBPHY TX V-I Converter and Current Mirror */ -#define USBPHY_PWD_CLR_TXPWDV2I(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_CLR_TXPWDV2I_SHIFT)) & USBPHY_PWD_CLR_TXPWDV2I_MASK) - -#define USBPHY_PWD_CLR_RXPWDENV_MASK (0x20000U) -#define USBPHY_PWD_CLR_RXPWDENV_SHIFT (17U) -/*! RXPWDENV - Power Down USB HS RX Envelope Detector */ -#define USBPHY_PWD_CLR_RXPWDENV(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_CLR_RXPWDENV_SHIFT)) & USBPHY_PWD_CLR_RXPWDENV_MASK) - -#define USBPHY_PWD_CLR_RXPWD1PT1_MASK (0x40000U) -#define USBPHY_PWD_CLR_RXPWD1PT1_SHIFT (18U) -/*! RXPWD1PT1 - Power Down USB FS Differential Receiver */ -#define USBPHY_PWD_CLR_RXPWD1PT1(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_CLR_RXPWD1PT1_SHIFT)) & USBPHY_PWD_CLR_RXPWD1PT1_MASK) - -#define USBPHY_PWD_CLR_RXPWDDIFF_MASK (0x80000U) -#define USBPHY_PWD_CLR_RXPWDDIFF_SHIFT (19U) -/*! RXPWDDIFF - Power Down USB HS Differential Receiver */ -#define USBPHY_PWD_CLR_RXPWDDIFF(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_CLR_RXPWDDIFF_SHIFT)) & USBPHY_PWD_CLR_RXPWDDIFF_MASK) - -#define USBPHY_PWD_CLR_RXPWDRX_MASK (0x100000U) -#define USBPHY_PWD_CLR_RXPWDRX_SHIFT (20U) -/*! RXPWDRX - Power Down USBPHY Receiver Circuits */ -#define USBPHY_PWD_CLR_RXPWDRX(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_CLR_RXPWDRX_SHIFT)) & USBPHY_PWD_CLR_RXPWDRX_MASK) -/*! @} */ - -/*! @name PWD_TOG - Power Down */ -/*! @{ */ - -#define USBPHY_PWD_TOG_TXPWDFS_MASK (0x400U) -#define USBPHY_PWD_TOG_TXPWDFS_SHIFT (10U) -/*! TXPWDFS - Power Down USB FS TX Drivers */ -#define USBPHY_PWD_TOG_TXPWDFS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_TOG_TXPWDFS_SHIFT)) & USBPHY_PWD_TOG_TXPWDFS_MASK) - -#define USBPHY_PWD_TOG_TXPWDIBIAS_MASK (0x800U) -#define USBPHY_PWD_TOG_TXPWDIBIAS_SHIFT (11U) -/*! TXPWDIBIAS - Power Down USBPHY TX Current Bias Block */ -#define USBPHY_PWD_TOG_TXPWDIBIAS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_TOG_TXPWDIBIAS_SHIFT)) & USBPHY_PWD_TOG_TXPWDIBIAS_MASK) - -#define USBPHY_PWD_TOG_TXPWDV2I_MASK (0x1000U) -#define USBPHY_PWD_TOG_TXPWDV2I_SHIFT (12U) -/*! TXPWDV2I - Power Down USBPHY TX V-I Converter and Current Mirror */ -#define USBPHY_PWD_TOG_TXPWDV2I(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_TOG_TXPWDV2I_SHIFT)) & USBPHY_PWD_TOG_TXPWDV2I_MASK) - -#define USBPHY_PWD_TOG_RXPWDENV_MASK (0x20000U) -#define USBPHY_PWD_TOG_RXPWDENV_SHIFT (17U) -/*! RXPWDENV - Power Down USB HS RX Envelope Detector */ -#define USBPHY_PWD_TOG_RXPWDENV(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_TOG_RXPWDENV_SHIFT)) & USBPHY_PWD_TOG_RXPWDENV_MASK) - -#define USBPHY_PWD_TOG_RXPWD1PT1_MASK (0x40000U) -#define USBPHY_PWD_TOG_RXPWD1PT1_SHIFT (18U) -/*! RXPWD1PT1 - Power Down USB FS Differential Receiver */ -#define USBPHY_PWD_TOG_RXPWD1PT1(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_TOG_RXPWD1PT1_SHIFT)) & USBPHY_PWD_TOG_RXPWD1PT1_MASK) - -#define USBPHY_PWD_TOG_RXPWDDIFF_MASK (0x80000U) -#define USBPHY_PWD_TOG_RXPWDDIFF_SHIFT (19U) -/*! RXPWDDIFF - Power Down USB HS Differential Receiver */ -#define USBPHY_PWD_TOG_RXPWDDIFF(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_TOG_RXPWDDIFF_SHIFT)) & USBPHY_PWD_TOG_RXPWDDIFF_MASK) - -#define USBPHY_PWD_TOG_RXPWDRX_MASK (0x100000U) -#define USBPHY_PWD_TOG_RXPWDRX_SHIFT (20U) -/*! RXPWDRX - Power Down USBPHY Receiver Circuits */ -#define USBPHY_PWD_TOG_RXPWDRX(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PWD_TOG_RXPWDRX_SHIFT)) & USBPHY_PWD_TOG_RXPWDRX_MASK) -/*! @} */ - -/*! @name TX - TX Control */ -/*! @{ */ - -#define USBPHY_TX_D_CAL_MASK (0xFU) -#define USBPHY_TX_D_CAL_SHIFT (0U) -/*! D_CAL - HS TX Output Current Trim - * 0b0000..Maximum current, approximately 19% above nominal - * 0b0111..Nominal - * 0b1111..Minimum current, approximately 19% below nominal - */ -#define USBPHY_TX_D_CAL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_D_CAL_SHIFT)) & USBPHY_TX_D_CAL_MASK) - -#define USBPHY_TX_TXCAL45DN_MASK (0xF00U) -#define USBPHY_TX_TXCAL45DN_SHIFT (8U) -/*! TXCAL45DN - DM Series Termination Resistance Trim */ -#define USBPHY_TX_TXCAL45DN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_TXCAL45DN_SHIFT)) & USBPHY_TX_TXCAL45DN_MASK) - -#define USBPHY_TX_TXCAL45DP_MASK (0xF0000U) -#define USBPHY_TX_TXCAL45DP_SHIFT (16U) -/*! TXCAL45DP - DP Series Termination Resistance Trim */ -#define USBPHY_TX_TXCAL45DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_TXCAL45DP_SHIFT)) & USBPHY_TX_TXCAL45DP_MASK) -/*! @} */ - -/*! @name TX_SET - TX Control */ -/*! @{ */ - -#define USBPHY_TX_SET_D_CAL_MASK (0xFU) -#define USBPHY_TX_SET_D_CAL_SHIFT (0U) -/*! D_CAL - HS TX Output Current Trim */ -#define USBPHY_TX_SET_D_CAL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_SET_D_CAL_SHIFT)) & USBPHY_TX_SET_D_CAL_MASK) - -#define USBPHY_TX_SET_TXCAL45DN_MASK (0xF00U) -#define USBPHY_TX_SET_TXCAL45DN_SHIFT (8U) -/*! TXCAL45DN - DM Series Termination Resistance Trim */ -#define USBPHY_TX_SET_TXCAL45DN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_SET_TXCAL45DN_SHIFT)) & USBPHY_TX_SET_TXCAL45DN_MASK) - -#define USBPHY_TX_SET_TXCAL45DP_MASK (0xF0000U) -#define USBPHY_TX_SET_TXCAL45DP_SHIFT (16U) -/*! TXCAL45DP - DP Series Termination Resistance Trim */ -#define USBPHY_TX_SET_TXCAL45DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_SET_TXCAL45DP_SHIFT)) & USBPHY_TX_SET_TXCAL45DP_MASK) -/*! @} */ - -/*! @name TX_CLR - TX Control */ -/*! @{ */ - -#define USBPHY_TX_CLR_D_CAL_MASK (0xFU) -#define USBPHY_TX_CLR_D_CAL_SHIFT (0U) -/*! D_CAL - HS TX Output Current Trim */ -#define USBPHY_TX_CLR_D_CAL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_CLR_D_CAL_SHIFT)) & USBPHY_TX_CLR_D_CAL_MASK) - -#define USBPHY_TX_CLR_TXCAL45DN_MASK (0xF00U) -#define USBPHY_TX_CLR_TXCAL45DN_SHIFT (8U) -/*! TXCAL45DN - DM Series Termination Resistance Trim */ -#define USBPHY_TX_CLR_TXCAL45DN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_CLR_TXCAL45DN_SHIFT)) & USBPHY_TX_CLR_TXCAL45DN_MASK) - -#define USBPHY_TX_CLR_TXCAL45DP_MASK (0xF0000U) -#define USBPHY_TX_CLR_TXCAL45DP_SHIFT (16U) -/*! TXCAL45DP - DP Series Termination Resistance Trim */ -#define USBPHY_TX_CLR_TXCAL45DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_CLR_TXCAL45DP_SHIFT)) & USBPHY_TX_CLR_TXCAL45DP_MASK) -/*! @} */ - -/*! @name TX_TOG - TX Control */ -/*! @{ */ - -#define USBPHY_TX_TOG_D_CAL_MASK (0xFU) -#define USBPHY_TX_TOG_D_CAL_SHIFT (0U) -/*! D_CAL - HS TX Output Current Trim */ -#define USBPHY_TX_TOG_D_CAL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_TOG_D_CAL_SHIFT)) & USBPHY_TX_TOG_D_CAL_MASK) - -#define USBPHY_TX_TOG_TXCAL45DN_MASK (0xF00U) -#define USBPHY_TX_TOG_TXCAL45DN_SHIFT (8U) -/*! TXCAL45DN - DM Series Termination Resistance Trim */ -#define USBPHY_TX_TOG_TXCAL45DN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_TOG_TXCAL45DN_SHIFT)) & USBPHY_TX_TOG_TXCAL45DN_MASK) - -#define USBPHY_TX_TOG_TXCAL45DP_MASK (0xF0000U) -#define USBPHY_TX_TOG_TXCAL45DP_SHIFT (16U) -/*! TXCAL45DP - DP Series Termination Resistance Trim */ -#define USBPHY_TX_TOG_TXCAL45DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TX_TOG_TXCAL45DP_SHIFT)) & USBPHY_TX_TOG_TXCAL45DP_MASK) -/*! @} */ - -/*! @name RX - RX Control */ -/*! @{ */ - -#define USBPHY_RX_ENVADJ_MASK (0x7U) -#define USBPHY_RX_ENVADJ_SHIFT (0U) -/*! ENVADJ - Envelope Detector Trip Point - * 0b000..0.1000 V - * 0b001..0.1125 V - * 0b010..0.1250 V - * 0b011..0.0875 V - * 0b1xx.. - */ -#define USBPHY_RX_ENVADJ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_RX_ENVADJ_SHIFT)) & USBPHY_RX_ENVADJ_MASK) - -#define USBPHY_RX_DISCONADJ_MASK (0x70U) -#define USBPHY_RX_DISCONADJ_SHIFT (4U) -/*! DISCONADJ - Disconnect Detector Trip Point - * 0b000..0.56875 V - * 0b001..0.55000 V - * 0b010..0.58125 V - * 0b011..0.60000 V - * 0b1xx.. - */ -#define USBPHY_RX_DISCONADJ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_RX_DISCONADJ_SHIFT)) & USBPHY_RX_DISCONADJ_MASK) -/*! @} */ - -/*! @name RX_SET - RX Control */ -/*! @{ */ - -#define USBPHY_RX_SET_ENVADJ_MASK (0x7U) -#define USBPHY_RX_SET_ENVADJ_SHIFT (0U) -/*! ENVADJ - Envelope Detector Trip Point */ -#define USBPHY_RX_SET_ENVADJ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_RX_SET_ENVADJ_SHIFT)) & USBPHY_RX_SET_ENVADJ_MASK) - -#define USBPHY_RX_SET_DISCONADJ_MASK (0x70U) -#define USBPHY_RX_SET_DISCONADJ_SHIFT (4U) -/*! DISCONADJ - Disconnect Detector Trip Point */ -#define USBPHY_RX_SET_DISCONADJ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_RX_SET_DISCONADJ_SHIFT)) & USBPHY_RX_SET_DISCONADJ_MASK) -/*! @} */ - -/*! @name RX_CLR - RX Control */ -/*! @{ */ - -#define USBPHY_RX_CLR_ENVADJ_MASK (0x7U) -#define USBPHY_RX_CLR_ENVADJ_SHIFT (0U) -/*! ENVADJ - Envelope Detector Trip Point */ -#define USBPHY_RX_CLR_ENVADJ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_RX_CLR_ENVADJ_SHIFT)) & USBPHY_RX_CLR_ENVADJ_MASK) - -#define USBPHY_RX_CLR_DISCONADJ_MASK (0x70U) -#define USBPHY_RX_CLR_DISCONADJ_SHIFT (4U) -/*! DISCONADJ - Disconnect Detector Trip Point */ -#define USBPHY_RX_CLR_DISCONADJ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_RX_CLR_DISCONADJ_SHIFT)) & USBPHY_RX_CLR_DISCONADJ_MASK) -/*! @} */ - -/*! @name RX_TOG - RX Control */ -/*! @{ */ - -#define USBPHY_RX_TOG_ENVADJ_MASK (0x7U) -#define USBPHY_RX_TOG_ENVADJ_SHIFT (0U) -/*! ENVADJ - Envelope Detector Trip Point */ -#define USBPHY_RX_TOG_ENVADJ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_RX_TOG_ENVADJ_SHIFT)) & USBPHY_RX_TOG_ENVADJ_MASK) - -#define USBPHY_RX_TOG_DISCONADJ_MASK (0x70U) -#define USBPHY_RX_TOG_DISCONADJ_SHIFT (4U) -/*! DISCONADJ - Disconnect Detector Trip Point */ -#define USBPHY_RX_TOG_DISCONADJ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_RX_TOG_DISCONADJ_SHIFT)) & USBPHY_RX_TOG_DISCONADJ_MASK) -/*! @} */ - -/*! @name CTRL - General Purpose Control */ -/*! @{ */ - -#define USBPHY_CTRL_ENOTG_ID_CHG_IRQ_MASK (0x1U) -#define USBPHY_CTRL_ENOTG_ID_CHG_IRQ_SHIFT (0U) -/*! ENOTG_ID_CHG_IRQ - OTG ID Change Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENOTG_ID_CHG_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENOTG_ID_CHG_IRQ_SHIFT)) & USBPHY_CTRL_ENOTG_ID_CHG_IRQ_MASK) - -#define USBPHY_CTRL_ENHOSTDISCONDETECT_MASK (0x2U) -#define USBPHY_CTRL_ENHOSTDISCONDETECT_SHIFT (1U) -/*! ENHOSTDISCONDETECT - Host Disconnect Detection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENHOSTDISCONDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENHOSTDISCONDETECT_SHIFT)) & USBPHY_CTRL_ENHOSTDISCONDETECT_MASK) - -#define USBPHY_CTRL_ENIRQHOSTDISCON_MASK (0x4U) -#define USBPHY_CTRL_ENIRQHOSTDISCON_SHIFT (2U) -/*! ENIRQHOSTDISCON - Enable Interrupt for Host Disconnect - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENIRQHOSTDISCON(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENIRQHOSTDISCON_SHIFT)) & USBPHY_CTRL_ENIRQHOSTDISCON_MASK) - -#define USBPHY_CTRL_HOSTDISCONDETECT_IRQ_MASK (0x8U) -#define USBPHY_CTRL_HOSTDISCONDETECT_IRQ_SHIFT (3U) -/*! HOSTDISCONDETECT_IRQ - Host Disconnect Detection Interrupt - * 0b0..Connected - * 0b1..Disconnected - */ -#define USBPHY_CTRL_HOSTDISCONDETECT_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_HOSTDISCONDETECT_IRQ_SHIFT)) & USBPHY_CTRL_HOSTDISCONDETECT_IRQ_MASK) - -#define USBPHY_CTRL_ENDEVPLUGINDETECT_MASK (0x10U) -#define USBPHY_CTRL_ENDEVPLUGINDETECT_SHIFT (4U) -/*! ENDEVPLUGINDETECT - Enable Nonstandard Resistive Plugged-In Detection - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENDEVPLUGINDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENDEVPLUGINDETECT_SHIFT)) & USBPHY_CTRL_ENDEVPLUGINDETECT_MASK) - -#define USBPHY_CTRL_DEVPLUGIN_POLARITY_MASK (0x20U) -#define USBPHY_CTRL_DEVPLUGIN_POLARITY_SHIFT (5U) -/*! DEVPLUGIN_POLARITY - Device Plug-In Polarity - * 0b0..Plugged in - * 0b1..Unplugged - */ -#define USBPHY_CTRL_DEVPLUGIN_POLARITY(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_DEVPLUGIN_POLARITY_SHIFT)) & USBPHY_CTRL_DEVPLUGIN_POLARITY_MASK) - -#define USBPHY_CTRL_OTG_ID_CHG_IRQ_MASK (0x40U) -#define USBPHY_CTRL_OTG_ID_CHG_IRQ_SHIFT (6U) -/*! OTG_ID_CHG_IRQ - OTG ID Change Interrupt - * 0b0..No ID change interrupt - * 0b1..ID change interrupt - */ -#define USBPHY_CTRL_OTG_ID_CHG_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_OTG_ID_CHG_IRQ_SHIFT)) & USBPHY_CTRL_OTG_ID_CHG_IRQ_MASK) - -#define USBPHY_CTRL_ENOTGIDDETECT_MASK (0x80U) -#define USBPHY_CTRL_ENOTGIDDETECT_SHIFT (7U) -/*! ENOTGIDDETECT - Enable Internal OTG ID Detector - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENOTGIDDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENOTGIDDETECT_SHIFT)) & USBPHY_CTRL_ENOTGIDDETECT_MASK) - -#define USBPHY_CTRL_RESUMEIRQSTICKY_MASK (0x100U) -#define USBPHY_CTRL_RESUMEIRQSTICKY_SHIFT (8U) -/*! RESUMEIRQSTICKY - Resume Interrupt Sticky - * 0b0..During the resume or reset state signaling period - * 0b1..Until you write 0 to it - */ -#define USBPHY_CTRL_RESUMEIRQSTICKY(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_RESUMEIRQSTICKY_SHIFT)) & USBPHY_CTRL_RESUMEIRQSTICKY_MASK) - -#define USBPHY_CTRL_ENIRQRESUMEDETECT_MASK (0x200U) -#define USBPHY_CTRL_ENIRQRESUMEDETECT_SHIFT (9U) -/*! ENIRQRESUMEDETECT - Resume Detection Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENIRQRESUMEDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENIRQRESUMEDETECT_SHIFT)) & USBPHY_CTRL_ENIRQRESUMEDETECT_MASK) - -#define USBPHY_CTRL_RESUME_IRQ_MASK (0x400U) -#define USBPHY_CTRL_RESUME_IRQ_SHIFT (10U) -/*! RESUME_IRQ - Resume Interrupt - * 0b0..No resume interrupt - * 0b1..Resume interrupt - */ -#define USBPHY_CTRL_RESUME_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_RESUME_IRQ_SHIFT)) & USBPHY_CTRL_RESUME_IRQ_MASK) - -#define USBPHY_CTRL_ENIRQDEVPLUGIN_MASK (0x800U) -#define USBPHY_CTRL_ENIRQDEVPLUGIN_SHIFT (11U) -/*! ENIRQDEVPLUGIN - Enable Interrupt for Nonstandard Resistive Plugged-In Detection - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENIRQDEVPLUGIN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENIRQDEVPLUGIN_SHIFT)) & USBPHY_CTRL_ENIRQDEVPLUGIN_MASK) - -#define USBPHY_CTRL_DEVPLUGIN_IRQ_MASK (0x1000U) -#define USBPHY_CTRL_DEVPLUGIN_IRQ_SHIFT (12U) -/*! DEVPLUGIN_IRQ - Device Plug-In Interrupt */ -#define USBPHY_CTRL_DEVPLUGIN_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_DEVPLUGIN_IRQ_SHIFT)) & USBPHY_CTRL_DEVPLUGIN_IRQ_MASK) - -#define USBPHY_CTRL_DATA_ON_LRADC_MASK (0x2000U) -#define USBPHY_CTRL_DATA_ON_LRADC_SHIFT (13U) -/*! DATA_ON_LRADC - APB Clock Switch Option */ -#define USBPHY_CTRL_DATA_ON_LRADC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_DATA_ON_LRADC_SHIFT)) & USBPHY_CTRL_DATA_ON_LRADC_MASK) - -#define USBPHY_CTRL_ENUTMILEVEL2_MASK (0x4000U) -#define USBPHY_CTRL_ENUTMILEVEL2_SHIFT (14U) -/*! ENUTMILEVEL2 - UTMI Level 2 Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENUTMILEVEL2(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENUTMILEVEL2_SHIFT)) & USBPHY_CTRL_ENUTMILEVEL2_MASK) - -#define USBPHY_CTRL_ENUTMILEVEL3_MASK (0x8000U) -#define USBPHY_CTRL_ENUTMILEVEL3_SHIFT (15U) -/*! ENUTMILEVEL3 - UTMI Level 3 Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENUTMILEVEL3(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENUTMILEVEL3_SHIFT)) & USBPHY_CTRL_ENUTMILEVEL3_MASK) - -#define USBPHY_CTRL_ENIRQWAKEUP_MASK (0x10000U) -#define USBPHY_CTRL_ENIRQWAKEUP_SHIFT (16U) -/*! ENIRQWAKEUP - Wake-Up Interrupt Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENIRQWAKEUP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENIRQWAKEUP_SHIFT)) & USBPHY_CTRL_ENIRQWAKEUP_MASK) - -#define USBPHY_CTRL_WAKEUP_IRQ_MASK (0x20000U) -#define USBPHY_CTRL_WAKEUP_IRQ_SHIFT (17U) -/*! WAKEUP_IRQ - Wake-Up Interrupt */ -#define USBPHY_CTRL_WAKEUP_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_WAKEUP_IRQ_SHIFT)) & USBPHY_CTRL_WAKEUP_IRQ_MASK) - -#define USBPHY_CTRL_AUTORESUME_EN_MASK (0x40000U) -#define USBPHY_CTRL_AUTORESUME_EN_SHIFT (18U) -/*! AUTORESUME_EN - Autoresume Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_AUTORESUME_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_AUTORESUME_EN_SHIFT)) & USBPHY_CTRL_AUTORESUME_EN_MASK) - -#define USBPHY_CTRL_ENAUTOCLR_CLKGATE_MASK (0x80000U) -#define USBPHY_CTRL_ENAUTOCLR_CLKGATE_SHIFT (19U) -/*! ENAUTOCLR_CLKGATE - Autoclear Clock Gate Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENAUTOCLR_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENAUTOCLR_CLKGATE_SHIFT)) & USBPHY_CTRL_ENAUTOCLR_CLKGATE_MASK) - -#define USBPHY_CTRL_ENAUTOCLR_PHY_PWD_MASK (0x100000U) -#define USBPHY_CTRL_ENAUTOCLR_PHY_PWD_SHIFT (20U) -/*! ENAUTOCLR_PHY_PWD - PHY PWD Autoclear Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_CTRL_ENAUTOCLR_PHY_PWD(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_ENAUTOCLR_PHY_PWD_SHIFT)) & USBPHY_CTRL_ENAUTOCLR_PHY_PWD_MASK) - -#define USBPHY_CTRL_OTG_ID_VALUE_MASK (0x8000000U) -#define USBPHY_CTRL_OTG_ID_VALUE_SHIFT (27U) -/*! OTG_ID_VALUE - OTG ID Value - * 0b0..Host - * 0b1..Device - */ -#define USBPHY_CTRL_OTG_ID_VALUE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_OTG_ID_VALUE_SHIFT)) & USBPHY_CTRL_OTG_ID_VALUE_MASK) - -#define USBPHY_CTRL_UTMI_SUSPENDM_MASK (0x20000000U) -#define USBPHY_CTRL_UTMI_SUSPENDM_SHIFT (29U) -/*! UTMI_SUSPENDM - UTMI Suspend - * 0b0..Not suspended - * 0b1..Suspended - */ -#define USBPHY_CTRL_UTMI_SUSPENDM(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_UTMI_SUSPENDM_SHIFT)) & USBPHY_CTRL_UTMI_SUSPENDM_MASK) - -#define USBPHY_CTRL_CLKGATE_MASK (0x40000000U) -#define USBPHY_CTRL_CLKGATE_SHIFT (30U) -/*! CLKGATE - UTMI Clock Gate - * 0b0..Run clocks - * 0b1..Gate clocks - */ -#define USBPHY_CTRL_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLKGATE_SHIFT)) & USBPHY_CTRL_CLKGATE_MASK) - -#define USBPHY_CTRL_SFTRST_MASK (0x80000000U) -#define USBPHY_CTRL_SFTRST_SHIFT (31U) -/*! SFTRST - Software Reset - * 0b0..Release from reset - * 0b1..Soft-reset - */ -#define USBPHY_CTRL_SFTRST(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SFTRST_SHIFT)) & USBPHY_CTRL_SFTRST_MASK) -/*! @} */ - -/*! @name CTRL_SET - General Purpose Control */ -/*! @{ */ - -#define USBPHY_CTRL_SET_ENOTG_ID_CHG_IRQ_MASK (0x1U) -#define USBPHY_CTRL_SET_ENOTG_ID_CHG_IRQ_SHIFT (0U) -/*! ENOTG_ID_CHG_IRQ - OTG ID Change Interrupt Enable */ -#define USBPHY_CTRL_SET_ENOTG_ID_CHG_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENOTG_ID_CHG_IRQ_SHIFT)) & USBPHY_CTRL_SET_ENOTG_ID_CHG_IRQ_MASK) - -#define USBPHY_CTRL_SET_ENHOSTDISCONDETECT_MASK (0x2U) -#define USBPHY_CTRL_SET_ENHOSTDISCONDETECT_SHIFT (1U) -/*! ENHOSTDISCONDETECT - Host Disconnect Detection Enable */ -#define USBPHY_CTRL_SET_ENHOSTDISCONDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENHOSTDISCONDETECT_SHIFT)) & USBPHY_CTRL_SET_ENHOSTDISCONDETECT_MASK) - -#define USBPHY_CTRL_SET_ENIRQHOSTDISCON_MASK (0x4U) -#define USBPHY_CTRL_SET_ENIRQHOSTDISCON_SHIFT (2U) -/*! ENIRQHOSTDISCON - Enable Interrupt for Host Disconnect */ -#define USBPHY_CTRL_SET_ENIRQHOSTDISCON(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENIRQHOSTDISCON_SHIFT)) & USBPHY_CTRL_SET_ENIRQHOSTDISCON_MASK) - -#define USBPHY_CTRL_SET_HOSTDISCONDETECT_IRQ_MASK (0x8U) -#define USBPHY_CTRL_SET_HOSTDISCONDETECT_IRQ_SHIFT (3U) -/*! HOSTDISCONDETECT_IRQ - Host Disconnect Detection Interrupt */ -#define USBPHY_CTRL_SET_HOSTDISCONDETECT_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_HOSTDISCONDETECT_IRQ_SHIFT)) & USBPHY_CTRL_SET_HOSTDISCONDETECT_IRQ_MASK) - -#define USBPHY_CTRL_SET_ENDEVPLUGINDETECT_MASK (0x10U) -#define USBPHY_CTRL_SET_ENDEVPLUGINDETECT_SHIFT (4U) -/*! ENDEVPLUGINDETECT - Enable Nonstandard Resistive Plugged-In Detection */ -#define USBPHY_CTRL_SET_ENDEVPLUGINDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENDEVPLUGINDETECT_SHIFT)) & USBPHY_CTRL_SET_ENDEVPLUGINDETECT_MASK) - -#define USBPHY_CTRL_SET_DEVPLUGIN_POLARITY_MASK (0x20U) -#define USBPHY_CTRL_SET_DEVPLUGIN_POLARITY_SHIFT (5U) -/*! DEVPLUGIN_POLARITY - Device Plug-In Polarity */ -#define USBPHY_CTRL_SET_DEVPLUGIN_POLARITY(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_DEVPLUGIN_POLARITY_SHIFT)) & USBPHY_CTRL_SET_DEVPLUGIN_POLARITY_MASK) - -#define USBPHY_CTRL_SET_OTG_ID_CHG_IRQ_MASK (0x40U) -#define USBPHY_CTRL_SET_OTG_ID_CHG_IRQ_SHIFT (6U) -/*! OTG_ID_CHG_IRQ - OTG ID Change Interrupt */ -#define USBPHY_CTRL_SET_OTG_ID_CHG_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_OTG_ID_CHG_IRQ_SHIFT)) & USBPHY_CTRL_SET_OTG_ID_CHG_IRQ_MASK) - -#define USBPHY_CTRL_SET_ENOTGIDDETECT_MASK (0x80U) -#define USBPHY_CTRL_SET_ENOTGIDDETECT_SHIFT (7U) -/*! ENOTGIDDETECT - Enable Internal OTG ID Detector */ -#define USBPHY_CTRL_SET_ENOTGIDDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENOTGIDDETECT_SHIFT)) & USBPHY_CTRL_SET_ENOTGIDDETECT_MASK) - -#define USBPHY_CTRL_SET_RESUMEIRQSTICKY_MASK (0x100U) -#define USBPHY_CTRL_SET_RESUMEIRQSTICKY_SHIFT (8U) -/*! RESUMEIRQSTICKY - Resume Interrupt Sticky */ -#define USBPHY_CTRL_SET_RESUMEIRQSTICKY(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_RESUMEIRQSTICKY_SHIFT)) & USBPHY_CTRL_SET_RESUMEIRQSTICKY_MASK) - -#define USBPHY_CTRL_SET_ENIRQRESUMEDETECT_MASK (0x200U) -#define USBPHY_CTRL_SET_ENIRQRESUMEDETECT_SHIFT (9U) -/*! ENIRQRESUMEDETECT - Resume Detection Interrupt Enable */ -#define USBPHY_CTRL_SET_ENIRQRESUMEDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENIRQRESUMEDETECT_SHIFT)) & USBPHY_CTRL_SET_ENIRQRESUMEDETECT_MASK) - -#define USBPHY_CTRL_SET_RESUME_IRQ_MASK (0x400U) -#define USBPHY_CTRL_SET_RESUME_IRQ_SHIFT (10U) -/*! RESUME_IRQ - Resume Interrupt */ -#define USBPHY_CTRL_SET_RESUME_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_RESUME_IRQ_SHIFT)) & USBPHY_CTRL_SET_RESUME_IRQ_MASK) - -#define USBPHY_CTRL_SET_ENIRQDEVPLUGIN_MASK (0x800U) -#define USBPHY_CTRL_SET_ENIRQDEVPLUGIN_SHIFT (11U) -/*! ENIRQDEVPLUGIN - Enable Interrupt for Nonstandard Resistive Plugged-In Detection */ -#define USBPHY_CTRL_SET_ENIRQDEVPLUGIN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENIRQDEVPLUGIN_SHIFT)) & USBPHY_CTRL_SET_ENIRQDEVPLUGIN_MASK) - -#define USBPHY_CTRL_SET_DEVPLUGIN_IRQ_MASK (0x1000U) -#define USBPHY_CTRL_SET_DEVPLUGIN_IRQ_SHIFT (12U) -/*! DEVPLUGIN_IRQ - Device Plug-In Interrupt */ -#define USBPHY_CTRL_SET_DEVPLUGIN_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_DEVPLUGIN_IRQ_SHIFT)) & USBPHY_CTRL_SET_DEVPLUGIN_IRQ_MASK) - -#define USBPHY_CTRL_SET_DATA_ON_LRADC_MASK (0x2000U) -#define USBPHY_CTRL_SET_DATA_ON_LRADC_SHIFT (13U) -/*! DATA_ON_LRADC - APB Clock Switch Option */ -#define USBPHY_CTRL_SET_DATA_ON_LRADC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_DATA_ON_LRADC_SHIFT)) & USBPHY_CTRL_SET_DATA_ON_LRADC_MASK) - -#define USBPHY_CTRL_SET_ENUTMILEVEL2_MASK (0x4000U) -#define USBPHY_CTRL_SET_ENUTMILEVEL2_SHIFT (14U) -/*! ENUTMILEVEL2 - UTMI Level 2 Enable */ -#define USBPHY_CTRL_SET_ENUTMILEVEL2(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENUTMILEVEL2_SHIFT)) & USBPHY_CTRL_SET_ENUTMILEVEL2_MASK) - -#define USBPHY_CTRL_SET_ENUTMILEVEL3_MASK (0x8000U) -#define USBPHY_CTRL_SET_ENUTMILEVEL3_SHIFT (15U) -/*! ENUTMILEVEL3 - UTMI Level 3 Enable */ -#define USBPHY_CTRL_SET_ENUTMILEVEL3(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENUTMILEVEL3_SHIFT)) & USBPHY_CTRL_SET_ENUTMILEVEL3_MASK) - -#define USBPHY_CTRL_SET_ENIRQWAKEUP_MASK (0x10000U) -#define USBPHY_CTRL_SET_ENIRQWAKEUP_SHIFT (16U) -/*! ENIRQWAKEUP - Wake-Up Interrupt Enable */ -#define USBPHY_CTRL_SET_ENIRQWAKEUP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENIRQWAKEUP_SHIFT)) & USBPHY_CTRL_SET_ENIRQWAKEUP_MASK) - -#define USBPHY_CTRL_SET_WAKEUP_IRQ_MASK (0x20000U) -#define USBPHY_CTRL_SET_WAKEUP_IRQ_SHIFT (17U) -/*! WAKEUP_IRQ - Wake-Up Interrupt */ -#define USBPHY_CTRL_SET_WAKEUP_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_WAKEUP_IRQ_SHIFT)) & USBPHY_CTRL_SET_WAKEUP_IRQ_MASK) - -#define USBPHY_CTRL_SET_AUTORESUME_EN_MASK (0x40000U) -#define USBPHY_CTRL_SET_AUTORESUME_EN_SHIFT (18U) -/*! AUTORESUME_EN - Autoresume Enable */ -#define USBPHY_CTRL_SET_AUTORESUME_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_AUTORESUME_EN_SHIFT)) & USBPHY_CTRL_SET_AUTORESUME_EN_MASK) - -#define USBPHY_CTRL_SET_ENAUTOCLR_CLKGATE_MASK (0x80000U) -#define USBPHY_CTRL_SET_ENAUTOCLR_CLKGATE_SHIFT (19U) -/*! ENAUTOCLR_CLKGATE - Autoclear Clock Gate Enable */ -#define USBPHY_CTRL_SET_ENAUTOCLR_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENAUTOCLR_CLKGATE_SHIFT)) & USBPHY_CTRL_SET_ENAUTOCLR_CLKGATE_MASK) - -#define USBPHY_CTRL_SET_ENAUTOCLR_PHY_PWD_MASK (0x100000U) -#define USBPHY_CTRL_SET_ENAUTOCLR_PHY_PWD_SHIFT (20U) -/*! ENAUTOCLR_PHY_PWD - PHY PWD Autoclear Enable */ -#define USBPHY_CTRL_SET_ENAUTOCLR_PHY_PWD(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_ENAUTOCLR_PHY_PWD_SHIFT)) & USBPHY_CTRL_SET_ENAUTOCLR_PHY_PWD_MASK) - -#define USBPHY_CTRL_SET_OTG_ID_VALUE_MASK (0x8000000U) -#define USBPHY_CTRL_SET_OTG_ID_VALUE_SHIFT (27U) -/*! OTG_ID_VALUE - OTG ID Value */ -#define USBPHY_CTRL_SET_OTG_ID_VALUE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_OTG_ID_VALUE_SHIFT)) & USBPHY_CTRL_SET_OTG_ID_VALUE_MASK) - -#define USBPHY_CTRL_SET_UTMI_SUSPENDM_MASK (0x20000000U) -#define USBPHY_CTRL_SET_UTMI_SUSPENDM_SHIFT (29U) -/*! UTMI_SUSPENDM - UTMI Suspend */ -#define USBPHY_CTRL_SET_UTMI_SUSPENDM(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_UTMI_SUSPENDM_SHIFT)) & USBPHY_CTRL_SET_UTMI_SUSPENDM_MASK) - -#define USBPHY_CTRL_SET_CLKGATE_MASK (0x40000000U) -#define USBPHY_CTRL_SET_CLKGATE_SHIFT (30U) -/*! CLKGATE - UTMI Clock Gate */ -#define USBPHY_CTRL_SET_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_CLKGATE_SHIFT)) & USBPHY_CTRL_SET_CLKGATE_MASK) - -#define USBPHY_CTRL_SET_SFTRST_MASK (0x80000000U) -#define USBPHY_CTRL_SET_SFTRST_SHIFT (31U) -/*! SFTRST - Software Reset */ -#define USBPHY_CTRL_SET_SFTRST(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_SET_SFTRST_SHIFT)) & USBPHY_CTRL_SET_SFTRST_MASK) -/*! @} */ - -/*! @name CTRL_CLR - General Purpose Control */ -/*! @{ */ - -#define USBPHY_CTRL_CLR_ENOTG_ID_CHG_IRQ_MASK (0x1U) -#define USBPHY_CTRL_CLR_ENOTG_ID_CHG_IRQ_SHIFT (0U) -/*! ENOTG_ID_CHG_IRQ - OTG ID Change Interrupt Enable */ -#define USBPHY_CTRL_CLR_ENOTG_ID_CHG_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENOTG_ID_CHG_IRQ_SHIFT)) & USBPHY_CTRL_CLR_ENOTG_ID_CHG_IRQ_MASK) - -#define USBPHY_CTRL_CLR_ENHOSTDISCONDETECT_MASK (0x2U) -#define USBPHY_CTRL_CLR_ENHOSTDISCONDETECT_SHIFT (1U) -/*! ENHOSTDISCONDETECT - Host Disconnect Detection Enable */ -#define USBPHY_CTRL_CLR_ENHOSTDISCONDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENHOSTDISCONDETECT_SHIFT)) & USBPHY_CTRL_CLR_ENHOSTDISCONDETECT_MASK) - -#define USBPHY_CTRL_CLR_ENIRQHOSTDISCON_MASK (0x4U) -#define USBPHY_CTRL_CLR_ENIRQHOSTDISCON_SHIFT (2U) -/*! ENIRQHOSTDISCON - Enable Interrupt for Host Disconnect */ -#define USBPHY_CTRL_CLR_ENIRQHOSTDISCON(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENIRQHOSTDISCON_SHIFT)) & USBPHY_CTRL_CLR_ENIRQHOSTDISCON_MASK) - -#define USBPHY_CTRL_CLR_HOSTDISCONDETECT_IRQ_MASK (0x8U) -#define USBPHY_CTRL_CLR_HOSTDISCONDETECT_IRQ_SHIFT (3U) -/*! HOSTDISCONDETECT_IRQ - Host Disconnect Detection Interrupt */ -#define USBPHY_CTRL_CLR_HOSTDISCONDETECT_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_HOSTDISCONDETECT_IRQ_SHIFT)) & USBPHY_CTRL_CLR_HOSTDISCONDETECT_IRQ_MASK) - -#define USBPHY_CTRL_CLR_ENDEVPLUGINDETECT_MASK (0x10U) -#define USBPHY_CTRL_CLR_ENDEVPLUGINDETECT_SHIFT (4U) -/*! ENDEVPLUGINDETECT - Enable Nonstandard Resistive Plugged-In Detection */ -#define USBPHY_CTRL_CLR_ENDEVPLUGINDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENDEVPLUGINDETECT_SHIFT)) & USBPHY_CTRL_CLR_ENDEVPLUGINDETECT_MASK) - -#define USBPHY_CTRL_CLR_DEVPLUGIN_POLARITY_MASK (0x20U) -#define USBPHY_CTRL_CLR_DEVPLUGIN_POLARITY_SHIFT (5U) -/*! DEVPLUGIN_POLARITY - Device Plug-In Polarity */ -#define USBPHY_CTRL_CLR_DEVPLUGIN_POLARITY(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_DEVPLUGIN_POLARITY_SHIFT)) & USBPHY_CTRL_CLR_DEVPLUGIN_POLARITY_MASK) - -#define USBPHY_CTRL_CLR_OTG_ID_CHG_IRQ_MASK (0x40U) -#define USBPHY_CTRL_CLR_OTG_ID_CHG_IRQ_SHIFT (6U) -/*! OTG_ID_CHG_IRQ - OTG ID Change Interrupt */ -#define USBPHY_CTRL_CLR_OTG_ID_CHG_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_OTG_ID_CHG_IRQ_SHIFT)) & USBPHY_CTRL_CLR_OTG_ID_CHG_IRQ_MASK) - -#define USBPHY_CTRL_CLR_ENOTGIDDETECT_MASK (0x80U) -#define USBPHY_CTRL_CLR_ENOTGIDDETECT_SHIFT (7U) -/*! ENOTGIDDETECT - Enable Internal OTG ID Detector */ -#define USBPHY_CTRL_CLR_ENOTGIDDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENOTGIDDETECT_SHIFT)) & USBPHY_CTRL_CLR_ENOTGIDDETECT_MASK) - -#define USBPHY_CTRL_CLR_RESUMEIRQSTICKY_MASK (0x100U) -#define USBPHY_CTRL_CLR_RESUMEIRQSTICKY_SHIFT (8U) -/*! RESUMEIRQSTICKY - Resume Interrupt Sticky */ -#define USBPHY_CTRL_CLR_RESUMEIRQSTICKY(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_RESUMEIRQSTICKY_SHIFT)) & USBPHY_CTRL_CLR_RESUMEIRQSTICKY_MASK) - -#define USBPHY_CTRL_CLR_ENIRQRESUMEDETECT_MASK (0x200U) -#define USBPHY_CTRL_CLR_ENIRQRESUMEDETECT_SHIFT (9U) -/*! ENIRQRESUMEDETECT - Resume Detection Interrupt Enable */ -#define USBPHY_CTRL_CLR_ENIRQRESUMEDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENIRQRESUMEDETECT_SHIFT)) & USBPHY_CTRL_CLR_ENIRQRESUMEDETECT_MASK) - -#define USBPHY_CTRL_CLR_RESUME_IRQ_MASK (0x400U) -#define USBPHY_CTRL_CLR_RESUME_IRQ_SHIFT (10U) -/*! RESUME_IRQ - Resume Interrupt */ -#define USBPHY_CTRL_CLR_RESUME_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_RESUME_IRQ_SHIFT)) & USBPHY_CTRL_CLR_RESUME_IRQ_MASK) - -#define USBPHY_CTRL_CLR_ENIRQDEVPLUGIN_MASK (0x800U) -#define USBPHY_CTRL_CLR_ENIRQDEVPLUGIN_SHIFT (11U) -/*! ENIRQDEVPLUGIN - Enable Interrupt for Nonstandard Resistive Plugged-In Detection */ -#define USBPHY_CTRL_CLR_ENIRQDEVPLUGIN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENIRQDEVPLUGIN_SHIFT)) & USBPHY_CTRL_CLR_ENIRQDEVPLUGIN_MASK) - -#define USBPHY_CTRL_CLR_DEVPLUGIN_IRQ_MASK (0x1000U) -#define USBPHY_CTRL_CLR_DEVPLUGIN_IRQ_SHIFT (12U) -/*! DEVPLUGIN_IRQ - Device Plug-In Interrupt */ -#define USBPHY_CTRL_CLR_DEVPLUGIN_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_DEVPLUGIN_IRQ_SHIFT)) & USBPHY_CTRL_CLR_DEVPLUGIN_IRQ_MASK) - -#define USBPHY_CTRL_CLR_DATA_ON_LRADC_MASK (0x2000U) -#define USBPHY_CTRL_CLR_DATA_ON_LRADC_SHIFT (13U) -/*! DATA_ON_LRADC - APB Clock Switch Option */ -#define USBPHY_CTRL_CLR_DATA_ON_LRADC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_DATA_ON_LRADC_SHIFT)) & USBPHY_CTRL_CLR_DATA_ON_LRADC_MASK) - -#define USBPHY_CTRL_CLR_ENUTMILEVEL2_MASK (0x4000U) -#define USBPHY_CTRL_CLR_ENUTMILEVEL2_SHIFT (14U) -/*! ENUTMILEVEL2 - UTMI Level 2 Enable */ -#define USBPHY_CTRL_CLR_ENUTMILEVEL2(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENUTMILEVEL2_SHIFT)) & USBPHY_CTRL_CLR_ENUTMILEVEL2_MASK) - -#define USBPHY_CTRL_CLR_ENUTMILEVEL3_MASK (0x8000U) -#define USBPHY_CTRL_CLR_ENUTMILEVEL3_SHIFT (15U) -/*! ENUTMILEVEL3 - UTMI Level 3 Enable */ -#define USBPHY_CTRL_CLR_ENUTMILEVEL3(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENUTMILEVEL3_SHIFT)) & USBPHY_CTRL_CLR_ENUTMILEVEL3_MASK) - -#define USBPHY_CTRL_CLR_ENIRQWAKEUP_MASK (0x10000U) -#define USBPHY_CTRL_CLR_ENIRQWAKEUP_SHIFT (16U) -/*! ENIRQWAKEUP - Wake-Up Interrupt Enable */ -#define USBPHY_CTRL_CLR_ENIRQWAKEUP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENIRQWAKEUP_SHIFT)) & USBPHY_CTRL_CLR_ENIRQWAKEUP_MASK) - -#define USBPHY_CTRL_CLR_WAKEUP_IRQ_MASK (0x20000U) -#define USBPHY_CTRL_CLR_WAKEUP_IRQ_SHIFT (17U) -/*! WAKEUP_IRQ - Wake-Up Interrupt */ -#define USBPHY_CTRL_CLR_WAKEUP_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_WAKEUP_IRQ_SHIFT)) & USBPHY_CTRL_CLR_WAKEUP_IRQ_MASK) - -#define USBPHY_CTRL_CLR_AUTORESUME_EN_MASK (0x40000U) -#define USBPHY_CTRL_CLR_AUTORESUME_EN_SHIFT (18U) -/*! AUTORESUME_EN - Autoresume Enable */ -#define USBPHY_CTRL_CLR_AUTORESUME_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_AUTORESUME_EN_SHIFT)) & USBPHY_CTRL_CLR_AUTORESUME_EN_MASK) - -#define USBPHY_CTRL_CLR_ENAUTOCLR_CLKGATE_MASK (0x80000U) -#define USBPHY_CTRL_CLR_ENAUTOCLR_CLKGATE_SHIFT (19U) -/*! ENAUTOCLR_CLKGATE - Autoclear Clock Gate Enable */ -#define USBPHY_CTRL_CLR_ENAUTOCLR_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENAUTOCLR_CLKGATE_SHIFT)) & USBPHY_CTRL_CLR_ENAUTOCLR_CLKGATE_MASK) - -#define USBPHY_CTRL_CLR_ENAUTOCLR_PHY_PWD_MASK (0x100000U) -#define USBPHY_CTRL_CLR_ENAUTOCLR_PHY_PWD_SHIFT (20U) -/*! ENAUTOCLR_PHY_PWD - PHY PWD Autoclear Enable */ -#define USBPHY_CTRL_CLR_ENAUTOCLR_PHY_PWD(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_ENAUTOCLR_PHY_PWD_SHIFT)) & USBPHY_CTRL_CLR_ENAUTOCLR_PHY_PWD_MASK) - -#define USBPHY_CTRL_CLR_OTG_ID_VALUE_MASK (0x8000000U) -#define USBPHY_CTRL_CLR_OTG_ID_VALUE_SHIFT (27U) -/*! OTG_ID_VALUE - OTG ID Value */ -#define USBPHY_CTRL_CLR_OTG_ID_VALUE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_OTG_ID_VALUE_SHIFT)) & USBPHY_CTRL_CLR_OTG_ID_VALUE_MASK) - -#define USBPHY_CTRL_CLR_UTMI_SUSPENDM_MASK (0x20000000U) -#define USBPHY_CTRL_CLR_UTMI_SUSPENDM_SHIFT (29U) -/*! UTMI_SUSPENDM - UTMI Suspend */ -#define USBPHY_CTRL_CLR_UTMI_SUSPENDM(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_UTMI_SUSPENDM_SHIFT)) & USBPHY_CTRL_CLR_UTMI_SUSPENDM_MASK) - -#define USBPHY_CTRL_CLR_CLKGATE_MASK (0x40000000U) -#define USBPHY_CTRL_CLR_CLKGATE_SHIFT (30U) -/*! CLKGATE - UTMI Clock Gate */ -#define USBPHY_CTRL_CLR_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_CLKGATE_SHIFT)) & USBPHY_CTRL_CLR_CLKGATE_MASK) - -#define USBPHY_CTRL_CLR_SFTRST_MASK (0x80000000U) -#define USBPHY_CTRL_CLR_SFTRST_SHIFT (31U) -/*! SFTRST - Software Reset */ -#define USBPHY_CTRL_CLR_SFTRST(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_CLR_SFTRST_SHIFT)) & USBPHY_CTRL_CLR_SFTRST_MASK) -/*! @} */ - -/*! @name CTRL_TOG - General Purpose Control */ -/*! @{ */ - -#define USBPHY_CTRL_TOG_ENOTG_ID_CHG_IRQ_MASK (0x1U) -#define USBPHY_CTRL_TOG_ENOTG_ID_CHG_IRQ_SHIFT (0U) -/*! ENOTG_ID_CHG_IRQ - OTG ID Change Interrupt Enable */ -#define USBPHY_CTRL_TOG_ENOTG_ID_CHG_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENOTG_ID_CHG_IRQ_SHIFT)) & USBPHY_CTRL_TOG_ENOTG_ID_CHG_IRQ_MASK) - -#define USBPHY_CTRL_TOG_ENHOSTDISCONDETECT_MASK (0x2U) -#define USBPHY_CTRL_TOG_ENHOSTDISCONDETECT_SHIFT (1U) -/*! ENHOSTDISCONDETECT - Host Disconnect Detection Enable */ -#define USBPHY_CTRL_TOG_ENHOSTDISCONDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENHOSTDISCONDETECT_SHIFT)) & USBPHY_CTRL_TOG_ENHOSTDISCONDETECT_MASK) - -#define USBPHY_CTRL_TOG_ENIRQHOSTDISCON_MASK (0x4U) -#define USBPHY_CTRL_TOG_ENIRQHOSTDISCON_SHIFT (2U) -/*! ENIRQHOSTDISCON - Enable Interrupt for Host Disconnect */ -#define USBPHY_CTRL_TOG_ENIRQHOSTDISCON(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENIRQHOSTDISCON_SHIFT)) & USBPHY_CTRL_TOG_ENIRQHOSTDISCON_MASK) - -#define USBPHY_CTRL_TOG_HOSTDISCONDETECT_IRQ_MASK (0x8U) -#define USBPHY_CTRL_TOG_HOSTDISCONDETECT_IRQ_SHIFT (3U) -/*! HOSTDISCONDETECT_IRQ - Host Disconnect Detection Interrupt */ -#define USBPHY_CTRL_TOG_HOSTDISCONDETECT_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_HOSTDISCONDETECT_IRQ_SHIFT)) & USBPHY_CTRL_TOG_HOSTDISCONDETECT_IRQ_MASK) - -#define USBPHY_CTRL_TOG_ENDEVPLUGINDETECT_MASK (0x10U) -#define USBPHY_CTRL_TOG_ENDEVPLUGINDETECT_SHIFT (4U) -/*! ENDEVPLUGINDETECT - Enable Nonstandard Resistive Plugged-In Detection */ -#define USBPHY_CTRL_TOG_ENDEVPLUGINDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENDEVPLUGINDETECT_SHIFT)) & USBPHY_CTRL_TOG_ENDEVPLUGINDETECT_MASK) - -#define USBPHY_CTRL_TOG_DEVPLUGIN_POLARITY_MASK (0x20U) -#define USBPHY_CTRL_TOG_DEVPLUGIN_POLARITY_SHIFT (5U) -/*! DEVPLUGIN_POLARITY - Device Plug-In Polarity */ -#define USBPHY_CTRL_TOG_DEVPLUGIN_POLARITY(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_DEVPLUGIN_POLARITY_SHIFT)) & USBPHY_CTRL_TOG_DEVPLUGIN_POLARITY_MASK) - -#define USBPHY_CTRL_TOG_OTG_ID_CHG_IRQ_MASK (0x40U) -#define USBPHY_CTRL_TOG_OTG_ID_CHG_IRQ_SHIFT (6U) -/*! OTG_ID_CHG_IRQ - OTG ID Change Interrupt */ -#define USBPHY_CTRL_TOG_OTG_ID_CHG_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_OTG_ID_CHG_IRQ_SHIFT)) & USBPHY_CTRL_TOG_OTG_ID_CHG_IRQ_MASK) - -#define USBPHY_CTRL_TOG_ENOTGIDDETECT_MASK (0x80U) -#define USBPHY_CTRL_TOG_ENOTGIDDETECT_SHIFT (7U) -/*! ENOTGIDDETECT - Enable Internal OTG ID Detector */ -#define USBPHY_CTRL_TOG_ENOTGIDDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENOTGIDDETECT_SHIFT)) & USBPHY_CTRL_TOG_ENOTGIDDETECT_MASK) - -#define USBPHY_CTRL_TOG_RESUMEIRQSTICKY_MASK (0x100U) -#define USBPHY_CTRL_TOG_RESUMEIRQSTICKY_SHIFT (8U) -/*! RESUMEIRQSTICKY - Resume Interrupt Sticky */ -#define USBPHY_CTRL_TOG_RESUMEIRQSTICKY(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_RESUMEIRQSTICKY_SHIFT)) & USBPHY_CTRL_TOG_RESUMEIRQSTICKY_MASK) - -#define USBPHY_CTRL_TOG_ENIRQRESUMEDETECT_MASK (0x200U) -#define USBPHY_CTRL_TOG_ENIRQRESUMEDETECT_SHIFT (9U) -/*! ENIRQRESUMEDETECT - Resume Detection Interrupt Enable */ -#define USBPHY_CTRL_TOG_ENIRQRESUMEDETECT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENIRQRESUMEDETECT_SHIFT)) & USBPHY_CTRL_TOG_ENIRQRESUMEDETECT_MASK) - -#define USBPHY_CTRL_TOG_RESUME_IRQ_MASK (0x400U) -#define USBPHY_CTRL_TOG_RESUME_IRQ_SHIFT (10U) -/*! RESUME_IRQ - Resume Interrupt */ -#define USBPHY_CTRL_TOG_RESUME_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_RESUME_IRQ_SHIFT)) & USBPHY_CTRL_TOG_RESUME_IRQ_MASK) - -#define USBPHY_CTRL_TOG_ENIRQDEVPLUGIN_MASK (0x800U) -#define USBPHY_CTRL_TOG_ENIRQDEVPLUGIN_SHIFT (11U) -/*! ENIRQDEVPLUGIN - Enable Interrupt for Nonstandard Resistive Plugged-In Detection */ -#define USBPHY_CTRL_TOG_ENIRQDEVPLUGIN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENIRQDEVPLUGIN_SHIFT)) & USBPHY_CTRL_TOG_ENIRQDEVPLUGIN_MASK) - -#define USBPHY_CTRL_TOG_DEVPLUGIN_IRQ_MASK (0x1000U) -#define USBPHY_CTRL_TOG_DEVPLUGIN_IRQ_SHIFT (12U) -/*! DEVPLUGIN_IRQ - Device Plug-In Interrupt */ -#define USBPHY_CTRL_TOG_DEVPLUGIN_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_DEVPLUGIN_IRQ_SHIFT)) & USBPHY_CTRL_TOG_DEVPLUGIN_IRQ_MASK) - -#define USBPHY_CTRL_TOG_DATA_ON_LRADC_MASK (0x2000U) -#define USBPHY_CTRL_TOG_DATA_ON_LRADC_SHIFT (13U) -/*! DATA_ON_LRADC - APB Clock Switch Option */ -#define USBPHY_CTRL_TOG_DATA_ON_LRADC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_DATA_ON_LRADC_SHIFT)) & USBPHY_CTRL_TOG_DATA_ON_LRADC_MASK) - -#define USBPHY_CTRL_TOG_ENUTMILEVEL2_MASK (0x4000U) -#define USBPHY_CTRL_TOG_ENUTMILEVEL2_SHIFT (14U) -/*! ENUTMILEVEL2 - UTMI Level 2 Enable */ -#define USBPHY_CTRL_TOG_ENUTMILEVEL2(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENUTMILEVEL2_SHIFT)) & USBPHY_CTRL_TOG_ENUTMILEVEL2_MASK) - -#define USBPHY_CTRL_TOG_ENUTMILEVEL3_MASK (0x8000U) -#define USBPHY_CTRL_TOG_ENUTMILEVEL3_SHIFT (15U) -/*! ENUTMILEVEL3 - UTMI Level 3 Enable */ -#define USBPHY_CTRL_TOG_ENUTMILEVEL3(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENUTMILEVEL3_SHIFT)) & USBPHY_CTRL_TOG_ENUTMILEVEL3_MASK) - -#define USBPHY_CTRL_TOG_ENIRQWAKEUP_MASK (0x10000U) -#define USBPHY_CTRL_TOG_ENIRQWAKEUP_SHIFT (16U) -/*! ENIRQWAKEUP - Wake-Up Interrupt Enable */ -#define USBPHY_CTRL_TOG_ENIRQWAKEUP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENIRQWAKEUP_SHIFT)) & USBPHY_CTRL_TOG_ENIRQWAKEUP_MASK) - -#define USBPHY_CTRL_TOG_WAKEUP_IRQ_MASK (0x20000U) -#define USBPHY_CTRL_TOG_WAKEUP_IRQ_SHIFT (17U) -/*! WAKEUP_IRQ - Wake-Up Interrupt */ -#define USBPHY_CTRL_TOG_WAKEUP_IRQ(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_WAKEUP_IRQ_SHIFT)) & USBPHY_CTRL_TOG_WAKEUP_IRQ_MASK) - -#define USBPHY_CTRL_TOG_AUTORESUME_EN_MASK (0x40000U) -#define USBPHY_CTRL_TOG_AUTORESUME_EN_SHIFT (18U) -/*! AUTORESUME_EN - Autoresume Enable */ -#define USBPHY_CTRL_TOG_AUTORESUME_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_AUTORESUME_EN_SHIFT)) & USBPHY_CTRL_TOG_AUTORESUME_EN_MASK) - -#define USBPHY_CTRL_TOG_ENAUTOCLR_CLKGATE_MASK (0x80000U) -#define USBPHY_CTRL_TOG_ENAUTOCLR_CLKGATE_SHIFT (19U) -/*! ENAUTOCLR_CLKGATE - Autoclear Clock Gate Enable */ -#define USBPHY_CTRL_TOG_ENAUTOCLR_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENAUTOCLR_CLKGATE_SHIFT)) & USBPHY_CTRL_TOG_ENAUTOCLR_CLKGATE_MASK) - -#define USBPHY_CTRL_TOG_ENAUTOCLR_PHY_PWD_MASK (0x100000U) -#define USBPHY_CTRL_TOG_ENAUTOCLR_PHY_PWD_SHIFT (20U) -/*! ENAUTOCLR_PHY_PWD - PHY PWD Autoclear Enable */ -#define USBPHY_CTRL_TOG_ENAUTOCLR_PHY_PWD(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_ENAUTOCLR_PHY_PWD_SHIFT)) & USBPHY_CTRL_TOG_ENAUTOCLR_PHY_PWD_MASK) - -#define USBPHY_CTRL_TOG_OTG_ID_VALUE_MASK (0x8000000U) -#define USBPHY_CTRL_TOG_OTG_ID_VALUE_SHIFT (27U) -/*! OTG_ID_VALUE - OTG ID Value */ -#define USBPHY_CTRL_TOG_OTG_ID_VALUE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_OTG_ID_VALUE_SHIFT)) & USBPHY_CTRL_TOG_OTG_ID_VALUE_MASK) - -#define USBPHY_CTRL_TOG_UTMI_SUSPENDM_MASK (0x20000000U) -#define USBPHY_CTRL_TOG_UTMI_SUSPENDM_SHIFT (29U) -/*! UTMI_SUSPENDM - UTMI Suspend */ -#define USBPHY_CTRL_TOG_UTMI_SUSPENDM(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_UTMI_SUSPENDM_SHIFT)) & USBPHY_CTRL_TOG_UTMI_SUSPENDM_MASK) - -#define USBPHY_CTRL_TOG_CLKGATE_MASK (0x40000000U) -#define USBPHY_CTRL_TOG_CLKGATE_SHIFT (30U) -/*! CLKGATE - UTMI Clock Gate */ -#define USBPHY_CTRL_TOG_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_CLKGATE_SHIFT)) & USBPHY_CTRL_TOG_CLKGATE_MASK) - -#define USBPHY_CTRL_TOG_SFTRST_MASK (0x80000000U) -#define USBPHY_CTRL_TOG_SFTRST_SHIFT (31U) -/*! SFTRST - Software Reset */ -#define USBPHY_CTRL_TOG_SFTRST(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_CTRL_TOG_SFTRST_SHIFT)) & USBPHY_CTRL_TOG_SFTRST_MASK) -/*! @} */ - -/*! @name STATUS - Status */ -/*! @{ */ - -#define USBPHY_STATUS_OK_STATUS_3V_MASK (0x1U) -#define USBPHY_STATUS_OK_STATUS_3V_SHIFT (0U) -/*! OK_STATUS_3V - USB 3.3 V and 1.8 V Supply Status - * 0b0..Not powered - * 0b1..Powered - */ -#define USBPHY_STATUS_OK_STATUS_3V(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_STATUS_OK_STATUS_3V_SHIFT)) & USBPHY_STATUS_OK_STATUS_3V_MASK) - -#define USBPHY_STATUS_HOSTDISCONDETECT_STATUS_MASK (0x8U) -#define USBPHY_STATUS_HOSTDISCONDETECT_STATUS_SHIFT (3U) -/*! HOSTDISCONDETECT_STATUS - Host Disconnect Status - * 0b0..Not detected - * 0b1..Detected - */ -#define USBPHY_STATUS_HOSTDISCONDETECT_STATUS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_STATUS_HOSTDISCONDETECT_STATUS_SHIFT)) & USBPHY_STATUS_HOSTDISCONDETECT_STATUS_MASK) - -#define USBPHY_STATUS_DEVPLUGIN_STATUS_MASK (0x40U) -#define USBPHY_STATUS_DEVPLUGIN_STATUS_SHIFT (6U) -/*! DEVPLUGIN_STATUS - Status Indicator for Nonstandard Resistive Plugged-In Detection - * 0b0..No attachment detected - * 0b1..Cable attachment detected - */ -#define USBPHY_STATUS_DEVPLUGIN_STATUS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_STATUS_DEVPLUGIN_STATUS_SHIFT)) & USBPHY_STATUS_DEVPLUGIN_STATUS_MASK) - -#define USBPHY_STATUS_OTGID_STATUS_MASK (0x100U) -#define USBPHY_STATUS_OTGID_STATUS_SHIFT (8U) -/*! OTGID_STATUS - OTG ID Status - * 0b0..Host - * 0b1..Device - */ -#define USBPHY_STATUS_OTGID_STATUS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_STATUS_OTGID_STATUS_SHIFT)) & USBPHY_STATUS_OTGID_STATUS_MASK) - -#define USBPHY_STATUS_RESUME_STATUS_MASK (0x400U) -#define USBPHY_STATUS_RESUME_STATUS_SHIFT (10U) -/*! RESUME_STATUS - Resume Status */ -#define USBPHY_STATUS_RESUME_STATUS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_STATUS_RESUME_STATUS_SHIFT)) & USBPHY_STATUS_RESUME_STATUS_MASK) -/*! @} */ - -/*! @name DEBUG0 - Debug 0 */ -/*! @{ */ - -#define USBPHY_DEBUG0_OTGIDPIOLOCK_MASK (0x1U) -#define USBPHY_DEBUG0_OTGIDPIOLOCK_SHIFT (0U) -/*! OTGIDPIOLOCK - Hold OTG_ID */ -#define USBPHY_DEBUG0_OTGIDPIOLOCK(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_OTGIDPIOLOCK_SHIFT)) & USBPHY_DEBUG0_OTGIDPIOLOCK_MASK) - -#define USBPHY_DEBUG0_HSTPULLDOWN_MASK (0xCU) -#define USBPHY_DEBUG0_HSTPULLDOWN_SHIFT (2U) -/*! HSTPULLDOWN - Host Pulldown Overdrive Mode - * 0b00..Disconnect - * 0b01..Connect - */ -#define USBPHY_DEBUG0_HSTPULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_HSTPULLDOWN_SHIFT)) & USBPHY_DEBUG0_HSTPULLDOWN_MASK) - -#define USBPHY_DEBUG0_ENHSTPULLDOWN_MASK (0x30U) -#define USBPHY_DEBUG0_ENHSTPULLDOWN_SHIFT (4U) -/*! ENHSTPULLDOWN - Enable Host Pulldown Overdrive Mode - * 0b00..Disable - * 0b01..Enable - */ -#define USBPHY_DEBUG0_ENHSTPULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_ENHSTPULLDOWN_SHIFT)) & USBPHY_DEBUG0_ENHSTPULLDOWN_MASK) -/*! @} */ - -/*! @name DEBUG0_SET - Debug 0 */ -/*! @{ */ - -#define USBPHY_DEBUG0_SET_OTGIDPIOLOCK_MASK (0x1U) -#define USBPHY_DEBUG0_SET_OTGIDPIOLOCK_SHIFT (0U) -/*! OTGIDPIOLOCK - Hold OTG_ID */ -#define USBPHY_DEBUG0_SET_OTGIDPIOLOCK(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_SET_OTGIDPIOLOCK_SHIFT)) & USBPHY_DEBUG0_SET_OTGIDPIOLOCK_MASK) - -#define USBPHY_DEBUG0_SET_HSTPULLDOWN_MASK (0xCU) -#define USBPHY_DEBUG0_SET_HSTPULLDOWN_SHIFT (2U) -/*! HSTPULLDOWN - Host Pulldown Overdrive Mode */ -#define USBPHY_DEBUG0_SET_HSTPULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_SET_HSTPULLDOWN_SHIFT)) & USBPHY_DEBUG0_SET_HSTPULLDOWN_MASK) - -#define USBPHY_DEBUG0_SET_ENHSTPULLDOWN_MASK (0x30U) -#define USBPHY_DEBUG0_SET_ENHSTPULLDOWN_SHIFT (4U) -/*! ENHSTPULLDOWN - Enable Host Pulldown Overdrive Mode */ -#define USBPHY_DEBUG0_SET_ENHSTPULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_SET_ENHSTPULLDOWN_SHIFT)) & USBPHY_DEBUG0_SET_ENHSTPULLDOWN_MASK) -/*! @} */ - -/*! @name DEBUG0_CLR - Debug 0 */ -/*! @{ */ - -#define USBPHY_DEBUG0_CLR_OTGIDPIOLOCK_MASK (0x1U) -#define USBPHY_DEBUG0_CLR_OTGIDPIOLOCK_SHIFT (0U) -/*! OTGIDPIOLOCK - Hold OTG_ID */ -#define USBPHY_DEBUG0_CLR_OTGIDPIOLOCK(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_CLR_OTGIDPIOLOCK_SHIFT)) & USBPHY_DEBUG0_CLR_OTGIDPIOLOCK_MASK) - -#define USBPHY_DEBUG0_CLR_HSTPULLDOWN_MASK (0xCU) -#define USBPHY_DEBUG0_CLR_HSTPULLDOWN_SHIFT (2U) -/*! HSTPULLDOWN - Host Pulldown Overdrive Mode */ -#define USBPHY_DEBUG0_CLR_HSTPULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_CLR_HSTPULLDOWN_SHIFT)) & USBPHY_DEBUG0_CLR_HSTPULLDOWN_MASK) - -#define USBPHY_DEBUG0_CLR_ENHSTPULLDOWN_MASK (0x30U) -#define USBPHY_DEBUG0_CLR_ENHSTPULLDOWN_SHIFT (4U) -/*! ENHSTPULLDOWN - Enable Host Pulldown Overdrive Mode */ -#define USBPHY_DEBUG0_CLR_ENHSTPULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_CLR_ENHSTPULLDOWN_SHIFT)) & USBPHY_DEBUG0_CLR_ENHSTPULLDOWN_MASK) -/*! @} */ - -/*! @name DEBUG0_TOG - Debug 0 */ -/*! @{ */ - -#define USBPHY_DEBUG0_TOG_OTGIDPIOLOCK_MASK (0x1U) -#define USBPHY_DEBUG0_TOG_OTGIDPIOLOCK_SHIFT (0U) -/*! OTGIDPIOLOCK - Hold OTG_ID */ -#define USBPHY_DEBUG0_TOG_OTGIDPIOLOCK(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_TOG_OTGIDPIOLOCK_SHIFT)) & USBPHY_DEBUG0_TOG_OTGIDPIOLOCK_MASK) - -#define USBPHY_DEBUG0_TOG_HSTPULLDOWN_MASK (0xCU) -#define USBPHY_DEBUG0_TOG_HSTPULLDOWN_SHIFT (2U) -/*! HSTPULLDOWN - Host Pulldown Overdrive Mode */ -#define USBPHY_DEBUG0_TOG_HSTPULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_TOG_HSTPULLDOWN_SHIFT)) & USBPHY_DEBUG0_TOG_HSTPULLDOWN_MASK) - -#define USBPHY_DEBUG0_TOG_ENHSTPULLDOWN_MASK (0x30U) -#define USBPHY_DEBUG0_TOG_ENHSTPULLDOWN_SHIFT (4U) -/*! ENHSTPULLDOWN - Enable Host Pulldown Overdrive Mode */ -#define USBPHY_DEBUG0_TOG_ENHSTPULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_DEBUG0_TOG_ENHSTPULLDOWN_SHIFT)) & USBPHY_DEBUG0_TOG_ENHSTPULLDOWN_MASK) -/*! @} */ - -/*! @name VERSION - Version */ -/*! @{ */ - -#define USBPHY_VERSION_STEP_MASK (0xFFFFU) -#define USBPHY_VERSION_STEP_SHIFT (0U) -/*! STEP - Step */ -#define USBPHY_VERSION_STEP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_VERSION_STEP_SHIFT)) & USBPHY_VERSION_STEP_MASK) - -#define USBPHY_VERSION_MINOR_MASK (0xFF0000U) -#define USBPHY_VERSION_MINOR_SHIFT (16U) -/*! MINOR - Minor */ -#define USBPHY_VERSION_MINOR(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_VERSION_MINOR_SHIFT)) & USBPHY_VERSION_MINOR_MASK) - -#define USBPHY_VERSION_MAJOR_MASK (0xFF000000U) -#define USBPHY_VERSION_MAJOR_SHIFT (24U) -/*! MAJOR - Major */ -#define USBPHY_VERSION_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_VERSION_MAJOR_SHIFT)) & USBPHY_VERSION_MAJOR_MASK) -/*! @} */ - -/*! @name IP - IP Block */ -/*! @{ */ - -#define USBPHY_IP_POWER_CONTROL_SUSPEND_OPTION_MASK (0x1U) -#define USBPHY_IP_POWER_CONTROL_SUSPEND_OPTION_SHIFT (0U) -/*! POWER_CONTROL_SUSPEND_OPTION - Power Control Suspend Option */ -#define USBPHY_IP_POWER_CONTROL_SUSPEND_OPTION(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_IP_POWER_CONTROL_SUSPEND_OPTION_SHIFT)) & USBPHY_IP_POWER_CONTROL_SUSPEND_OPTION_MASK) -/*! @} */ - -/*! @name IP_SET - IP Block */ -/*! @{ */ - -#define USBPHY_IP_SET_POWER_CONTROL_SUSPEND_OPTION_MASK (0x1U) -#define USBPHY_IP_SET_POWER_CONTROL_SUSPEND_OPTION_SHIFT (0U) -/*! POWER_CONTROL_SUSPEND_OPTION - Power Control Suspend Option */ -#define USBPHY_IP_SET_POWER_CONTROL_SUSPEND_OPTION(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_IP_SET_POWER_CONTROL_SUSPEND_OPTION_SHIFT)) & USBPHY_IP_SET_POWER_CONTROL_SUSPEND_OPTION_MASK) -/*! @} */ - -/*! @name IP_CLR - IP Block */ -/*! @{ */ - -#define USBPHY_IP_CLR_POWER_CONTROL_SUSPEND_OPTION_MASK (0x1U) -#define USBPHY_IP_CLR_POWER_CONTROL_SUSPEND_OPTION_SHIFT (0U) -/*! POWER_CONTROL_SUSPEND_OPTION - Power Control Suspend Option */ -#define USBPHY_IP_CLR_POWER_CONTROL_SUSPEND_OPTION(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_IP_CLR_POWER_CONTROL_SUSPEND_OPTION_SHIFT)) & USBPHY_IP_CLR_POWER_CONTROL_SUSPEND_OPTION_MASK) -/*! @} */ - -/*! @name IP_TOG - IP Block */ -/*! @{ */ - -#define USBPHY_IP_TOG_POWER_CONTROL_SUSPEND_OPTION_MASK (0x1U) -#define USBPHY_IP_TOG_POWER_CONTROL_SUSPEND_OPTION_SHIFT (0U) -/*! POWER_CONTROL_SUSPEND_OPTION - Power Control Suspend Option */ -#define USBPHY_IP_TOG_POWER_CONTROL_SUSPEND_OPTION(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_IP_TOG_POWER_CONTROL_SUSPEND_OPTION_SHIFT)) & USBPHY_IP_TOG_POWER_CONTROL_SUSPEND_OPTION_MASK) -/*! @} */ - -/*! @name PLL_SIC - PLL SIC */ -/*! @{ */ - -#define USBPHY_PLL_SIC_MISC2_CONTROL0_MASK (0x20U) -#define USBPHY_PLL_SIC_MISC2_CONTROL0_SHIFT (5U) -/*! MISC2_CONTROL0 - Miscellaneous Control - * 0b0..Power up PLL - * 0b1..Power down PLL - */ -#define USBPHY_PLL_SIC_MISC2_CONTROL0(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_MISC2_CONTROL0_SHIFT)) & USBPHY_PLL_SIC_MISC2_CONTROL0_MASK) - -#define USBPHY_PLL_SIC_PLL_EN_USB_CLKS_MASK (0x40U) -#define USBPHY_PLL_SIC_PLL_EN_USB_CLKS_SHIFT (6U) -/*! PLL_EN_USB_CLKS - PLL Multi-Phase Clock Outputs Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_PLL_SIC_PLL_EN_USB_CLKS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_PLL_EN_USB_CLKS_SHIFT)) & USBPHY_PLL_SIC_PLL_EN_USB_CLKS_MASK) - -#define USBPHY_PLL_SIC_PLL_POWER_MASK (0x1000U) -#define USBPHY_PLL_SIC_PLL_POWER_SHIFT (12U) -/*! PLL_POWER - USB PLL Powerup Control - * 0b0..Power down - * 0b1..Allow powerup - */ -#define USBPHY_PLL_SIC_PLL_POWER(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_PLL_POWER_SHIFT)) & USBPHY_PLL_SIC_PLL_POWER_MASK) - -#define USBPHY_PLL_SIC_PLL_ENABLE_MASK (0x2000U) -#define USBPHY_PLL_SIC_PLL_ENABLE_SHIFT (13U) -/*! PLL_ENABLE - PLL Output Clock Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_PLL_SIC_PLL_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_PLL_ENABLE_SHIFT)) & USBPHY_PLL_SIC_PLL_ENABLE_MASK) - -#define USBPHY_PLL_SIC_PLL_BYPASS_MASK (0x10000U) -#define USBPHY_PLL_SIC_PLL_BYPASS_SHIFT (16U) -/*! PLL_BYPASS - Bypass USB PLL - * 0b0..480 MHz output clock - * 0b1..Input reference clock - */ -#define USBPHY_PLL_SIC_PLL_BYPASS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_PLL_BYPASS_SHIFT)) & USBPHY_PLL_SIC_PLL_BYPASS_MASK) - -#define USBPHY_PLL_SIC_REFBIAS_PWD_SEL_MASK (0x80000U) -#define USBPHY_PLL_SIC_REFBIAS_PWD_SEL_SHIFT (19U) -/*! REFBIAS_PWD_SEL - Reference Bias Power Control - * 0b0..PLL_POWER internal state signal - * 0b1..REFBIAS_PWD - */ -#define USBPHY_PLL_SIC_REFBIAS_PWD_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_REFBIAS_PWD_SEL_SHIFT)) & USBPHY_PLL_SIC_REFBIAS_PWD_SEL_MASK) - -#define USBPHY_PLL_SIC_REFBIAS_PWD_MASK (0x100000U) -#define USBPHY_PLL_SIC_REFBIAS_PWD_SHIFT (20U) -/*! REFBIAS_PWD - Power Down Reference Bias - * 0b0..Enable - * 0b1..Disable or power down - */ -#define USBPHY_PLL_SIC_REFBIAS_PWD(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_REFBIAS_PWD_SHIFT)) & USBPHY_PLL_SIC_REFBIAS_PWD_MASK) - -#define USBPHY_PLL_SIC_PLL_REG_ENABLE_MASK (0x200000U) -#define USBPHY_PLL_SIC_PLL_REG_ENABLE_SHIFT (21U) -/*! PLL_REG_ENABLE - Enable PLL Regulator - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_PLL_SIC_PLL_REG_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_PLL_REG_ENABLE_SHIFT)) & USBPHY_PLL_SIC_PLL_REG_ENABLE_MASK) - -#define USBPHY_PLL_SIC_PLL_DIV_SEL_MASK (0x1C00000U) -#define USBPHY_PLL_SIC_PLL_DIV_SEL_SHIFT (22U) -/*! PLL_DIV_SEL - PLL Divider Value Configuration - * 0b000..Configure for a 32 MHz input clock (divide by 15) - * 0b001..Configure for a 30 MHz input clock (divide by 16) - * 0b010..Configure for a 24 MHz input clock (divide by 20) - * 0b011..Reserved, not usable for USB operation (divide by 22) - * 0b100..Configure for a 20 MHz input clock (divide by 24) - * 0b101..Configure for a 19.2 MHz input clock (divide by 25) - * 0b110..Configure for a 16 MHz input clock (divide by 30) - * 0b111..Configure for a 12 MHz input clock (divide by 40) - */ -#define USBPHY_PLL_SIC_PLL_DIV_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_PLL_DIV_SEL_SHIFT)) & USBPHY_PLL_SIC_PLL_DIV_SEL_MASK) - -#define USBPHY_PLL_SIC_PLL_LOCK_MASK (0x80000000U) -#define USBPHY_PLL_SIC_PLL_LOCK_SHIFT (31U) -/*! PLL_LOCK - USB PLL Lock Status Indicator - * 0b0..Not locked - * 0b1..Locked - */ -#define USBPHY_PLL_SIC_PLL_LOCK(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_PLL_LOCK_SHIFT)) & USBPHY_PLL_SIC_PLL_LOCK_MASK) -/*! @} */ - -/*! @name PLL_SIC_SET - PLL SIC */ -/*! @{ */ - -#define USBPHY_PLL_SIC_SET_MISC2_CONTROL0_MASK (0x20U) -#define USBPHY_PLL_SIC_SET_MISC2_CONTROL0_SHIFT (5U) -/*! MISC2_CONTROL0 - Miscellaneous Control */ -#define USBPHY_PLL_SIC_SET_MISC2_CONTROL0(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_SET_MISC2_CONTROL0_SHIFT)) & USBPHY_PLL_SIC_SET_MISC2_CONTROL0_MASK) - -#define USBPHY_PLL_SIC_SET_PLL_EN_USB_CLKS_MASK (0x40U) -#define USBPHY_PLL_SIC_SET_PLL_EN_USB_CLKS_SHIFT (6U) -/*! PLL_EN_USB_CLKS - PLL Multi-Phase Clock Outputs Enable */ -#define USBPHY_PLL_SIC_SET_PLL_EN_USB_CLKS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_SET_PLL_EN_USB_CLKS_SHIFT)) & USBPHY_PLL_SIC_SET_PLL_EN_USB_CLKS_MASK) - -#define USBPHY_PLL_SIC_SET_PLL_POWER_MASK (0x1000U) -#define USBPHY_PLL_SIC_SET_PLL_POWER_SHIFT (12U) -/*! PLL_POWER - USB PLL Powerup Control */ -#define USBPHY_PLL_SIC_SET_PLL_POWER(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_SET_PLL_POWER_SHIFT)) & USBPHY_PLL_SIC_SET_PLL_POWER_MASK) - -#define USBPHY_PLL_SIC_SET_PLL_ENABLE_MASK (0x2000U) -#define USBPHY_PLL_SIC_SET_PLL_ENABLE_SHIFT (13U) -/*! PLL_ENABLE - PLL Output Clock Enable */ -#define USBPHY_PLL_SIC_SET_PLL_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_SET_PLL_ENABLE_SHIFT)) & USBPHY_PLL_SIC_SET_PLL_ENABLE_MASK) - -#define USBPHY_PLL_SIC_SET_PLL_BYPASS_MASK (0x10000U) -#define USBPHY_PLL_SIC_SET_PLL_BYPASS_SHIFT (16U) -/*! PLL_BYPASS - Bypass USB PLL */ -#define USBPHY_PLL_SIC_SET_PLL_BYPASS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_SET_PLL_BYPASS_SHIFT)) & USBPHY_PLL_SIC_SET_PLL_BYPASS_MASK) - -#define USBPHY_PLL_SIC_SET_REFBIAS_PWD_SEL_MASK (0x80000U) -#define USBPHY_PLL_SIC_SET_REFBIAS_PWD_SEL_SHIFT (19U) -/*! REFBIAS_PWD_SEL - Reference Bias Power Control */ -#define USBPHY_PLL_SIC_SET_REFBIAS_PWD_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_SET_REFBIAS_PWD_SEL_SHIFT)) & USBPHY_PLL_SIC_SET_REFBIAS_PWD_SEL_MASK) - -#define USBPHY_PLL_SIC_SET_REFBIAS_PWD_MASK (0x100000U) -#define USBPHY_PLL_SIC_SET_REFBIAS_PWD_SHIFT (20U) -/*! REFBIAS_PWD - Power Down Reference Bias */ -#define USBPHY_PLL_SIC_SET_REFBIAS_PWD(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_SET_REFBIAS_PWD_SHIFT)) & USBPHY_PLL_SIC_SET_REFBIAS_PWD_MASK) - -#define USBPHY_PLL_SIC_SET_PLL_REG_ENABLE_MASK (0x200000U) -#define USBPHY_PLL_SIC_SET_PLL_REG_ENABLE_SHIFT (21U) -/*! PLL_REG_ENABLE - Enable PLL Regulator */ -#define USBPHY_PLL_SIC_SET_PLL_REG_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_SET_PLL_REG_ENABLE_SHIFT)) & USBPHY_PLL_SIC_SET_PLL_REG_ENABLE_MASK) - -#define USBPHY_PLL_SIC_SET_PLL_DIV_SEL_MASK (0x1C00000U) -#define USBPHY_PLL_SIC_SET_PLL_DIV_SEL_SHIFT (22U) -/*! PLL_DIV_SEL - PLL Divider Value Configuration */ -#define USBPHY_PLL_SIC_SET_PLL_DIV_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_SET_PLL_DIV_SEL_SHIFT)) & USBPHY_PLL_SIC_SET_PLL_DIV_SEL_MASK) - -#define USBPHY_PLL_SIC_SET_PLL_LOCK_MASK (0x80000000U) -#define USBPHY_PLL_SIC_SET_PLL_LOCK_SHIFT (31U) -/*! PLL_LOCK - USB PLL Lock Status Indicator */ -#define USBPHY_PLL_SIC_SET_PLL_LOCK(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_SET_PLL_LOCK_SHIFT)) & USBPHY_PLL_SIC_SET_PLL_LOCK_MASK) -/*! @} */ - -/*! @name PLL_SIC_CLR - PLL SIC */ -/*! @{ */ - -#define USBPHY_PLL_SIC_CLR_MISC2_CONTROL0_MASK (0x20U) -#define USBPHY_PLL_SIC_CLR_MISC2_CONTROL0_SHIFT (5U) -/*! MISC2_CONTROL0 - Miscellaneous Control */ -#define USBPHY_PLL_SIC_CLR_MISC2_CONTROL0(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_CLR_MISC2_CONTROL0_SHIFT)) & USBPHY_PLL_SIC_CLR_MISC2_CONTROL0_MASK) - -#define USBPHY_PLL_SIC_CLR_PLL_EN_USB_CLKS_MASK (0x40U) -#define USBPHY_PLL_SIC_CLR_PLL_EN_USB_CLKS_SHIFT (6U) -/*! PLL_EN_USB_CLKS - PLL Multi-Phase Clock Outputs Enable */ -#define USBPHY_PLL_SIC_CLR_PLL_EN_USB_CLKS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_CLR_PLL_EN_USB_CLKS_SHIFT)) & USBPHY_PLL_SIC_CLR_PLL_EN_USB_CLKS_MASK) - -#define USBPHY_PLL_SIC_CLR_PLL_POWER_MASK (0x1000U) -#define USBPHY_PLL_SIC_CLR_PLL_POWER_SHIFT (12U) -/*! PLL_POWER - USB PLL Powerup Control */ -#define USBPHY_PLL_SIC_CLR_PLL_POWER(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_CLR_PLL_POWER_SHIFT)) & USBPHY_PLL_SIC_CLR_PLL_POWER_MASK) - -#define USBPHY_PLL_SIC_CLR_PLL_ENABLE_MASK (0x2000U) -#define USBPHY_PLL_SIC_CLR_PLL_ENABLE_SHIFT (13U) -/*! PLL_ENABLE - PLL Output Clock Enable */ -#define USBPHY_PLL_SIC_CLR_PLL_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_CLR_PLL_ENABLE_SHIFT)) & USBPHY_PLL_SIC_CLR_PLL_ENABLE_MASK) - -#define USBPHY_PLL_SIC_CLR_PLL_BYPASS_MASK (0x10000U) -#define USBPHY_PLL_SIC_CLR_PLL_BYPASS_SHIFT (16U) -/*! PLL_BYPASS - Bypass USB PLL */ -#define USBPHY_PLL_SIC_CLR_PLL_BYPASS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_CLR_PLL_BYPASS_SHIFT)) & USBPHY_PLL_SIC_CLR_PLL_BYPASS_MASK) - -#define USBPHY_PLL_SIC_CLR_REFBIAS_PWD_SEL_MASK (0x80000U) -#define USBPHY_PLL_SIC_CLR_REFBIAS_PWD_SEL_SHIFT (19U) -/*! REFBIAS_PWD_SEL - Reference Bias Power Control */ -#define USBPHY_PLL_SIC_CLR_REFBIAS_PWD_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_CLR_REFBIAS_PWD_SEL_SHIFT)) & USBPHY_PLL_SIC_CLR_REFBIAS_PWD_SEL_MASK) - -#define USBPHY_PLL_SIC_CLR_REFBIAS_PWD_MASK (0x100000U) -#define USBPHY_PLL_SIC_CLR_REFBIAS_PWD_SHIFT (20U) -/*! REFBIAS_PWD - Power Down Reference Bias */ -#define USBPHY_PLL_SIC_CLR_REFBIAS_PWD(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_CLR_REFBIAS_PWD_SHIFT)) & USBPHY_PLL_SIC_CLR_REFBIAS_PWD_MASK) - -#define USBPHY_PLL_SIC_CLR_PLL_REG_ENABLE_MASK (0x200000U) -#define USBPHY_PLL_SIC_CLR_PLL_REG_ENABLE_SHIFT (21U) -/*! PLL_REG_ENABLE - Enable PLL Regulator */ -#define USBPHY_PLL_SIC_CLR_PLL_REG_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_CLR_PLL_REG_ENABLE_SHIFT)) & USBPHY_PLL_SIC_CLR_PLL_REG_ENABLE_MASK) - -#define USBPHY_PLL_SIC_CLR_PLL_DIV_SEL_MASK (0x1C00000U) -#define USBPHY_PLL_SIC_CLR_PLL_DIV_SEL_SHIFT (22U) -/*! PLL_DIV_SEL - PLL Divider Value Configuration */ -#define USBPHY_PLL_SIC_CLR_PLL_DIV_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_CLR_PLL_DIV_SEL_SHIFT)) & USBPHY_PLL_SIC_CLR_PLL_DIV_SEL_MASK) - -#define USBPHY_PLL_SIC_CLR_PLL_LOCK_MASK (0x80000000U) -#define USBPHY_PLL_SIC_CLR_PLL_LOCK_SHIFT (31U) -/*! PLL_LOCK - USB PLL Lock Status Indicator */ -#define USBPHY_PLL_SIC_CLR_PLL_LOCK(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_CLR_PLL_LOCK_SHIFT)) & USBPHY_PLL_SIC_CLR_PLL_LOCK_MASK) -/*! @} */ - -/*! @name PLL_SIC_TOG - PLL SIC */ -/*! @{ */ - -#define USBPHY_PLL_SIC_TOG_MISC2_CONTROL0_MASK (0x20U) -#define USBPHY_PLL_SIC_TOG_MISC2_CONTROL0_SHIFT (5U) -/*! MISC2_CONTROL0 - Miscellaneous Control */ -#define USBPHY_PLL_SIC_TOG_MISC2_CONTROL0(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_TOG_MISC2_CONTROL0_SHIFT)) & USBPHY_PLL_SIC_TOG_MISC2_CONTROL0_MASK) - -#define USBPHY_PLL_SIC_TOG_PLL_EN_USB_CLKS_MASK (0x40U) -#define USBPHY_PLL_SIC_TOG_PLL_EN_USB_CLKS_SHIFT (6U) -/*! PLL_EN_USB_CLKS - PLL Multi-Phase Clock Outputs Enable */ -#define USBPHY_PLL_SIC_TOG_PLL_EN_USB_CLKS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_TOG_PLL_EN_USB_CLKS_SHIFT)) & USBPHY_PLL_SIC_TOG_PLL_EN_USB_CLKS_MASK) - -#define USBPHY_PLL_SIC_TOG_PLL_POWER_MASK (0x1000U) -#define USBPHY_PLL_SIC_TOG_PLL_POWER_SHIFT (12U) -/*! PLL_POWER - USB PLL Powerup Control */ -#define USBPHY_PLL_SIC_TOG_PLL_POWER(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_TOG_PLL_POWER_SHIFT)) & USBPHY_PLL_SIC_TOG_PLL_POWER_MASK) - -#define USBPHY_PLL_SIC_TOG_PLL_ENABLE_MASK (0x2000U) -#define USBPHY_PLL_SIC_TOG_PLL_ENABLE_SHIFT (13U) -/*! PLL_ENABLE - PLL Output Clock Enable */ -#define USBPHY_PLL_SIC_TOG_PLL_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_TOG_PLL_ENABLE_SHIFT)) & USBPHY_PLL_SIC_TOG_PLL_ENABLE_MASK) - -#define USBPHY_PLL_SIC_TOG_PLL_BYPASS_MASK (0x10000U) -#define USBPHY_PLL_SIC_TOG_PLL_BYPASS_SHIFT (16U) -/*! PLL_BYPASS - Bypass USB PLL */ -#define USBPHY_PLL_SIC_TOG_PLL_BYPASS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_TOG_PLL_BYPASS_SHIFT)) & USBPHY_PLL_SIC_TOG_PLL_BYPASS_MASK) - -#define USBPHY_PLL_SIC_TOG_REFBIAS_PWD_SEL_MASK (0x80000U) -#define USBPHY_PLL_SIC_TOG_REFBIAS_PWD_SEL_SHIFT (19U) -/*! REFBIAS_PWD_SEL - Reference Bias Power Control */ -#define USBPHY_PLL_SIC_TOG_REFBIAS_PWD_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_TOG_REFBIAS_PWD_SEL_SHIFT)) & USBPHY_PLL_SIC_TOG_REFBIAS_PWD_SEL_MASK) - -#define USBPHY_PLL_SIC_TOG_REFBIAS_PWD_MASK (0x100000U) -#define USBPHY_PLL_SIC_TOG_REFBIAS_PWD_SHIFT (20U) -/*! REFBIAS_PWD - Power Down Reference Bias */ -#define USBPHY_PLL_SIC_TOG_REFBIAS_PWD(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_TOG_REFBIAS_PWD_SHIFT)) & USBPHY_PLL_SIC_TOG_REFBIAS_PWD_MASK) - -#define USBPHY_PLL_SIC_TOG_PLL_REG_ENABLE_MASK (0x200000U) -#define USBPHY_PLL_SIC_TOG_PLL_REG_ENABLE_SHIFT (21U) -/*! PLL_REG_ENABLE - Enable PLL Regulator */ -#define USBPHY_PLL_SIC_TOG_PLL_REG_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_TOG_PLL_REG_ENABLE_SHIFT)) & USBPHY_PLL_SIC_TOG_PLL_REG_ENABLE_MASK) - -#define USBPHY_PLL_SIC_TOG_PLL_DIV_SEL_MASK (0x1C00000U) -#define USBPHY_PLL_SIC_TOG_PLL_DIV_SEL_SHIFT (22U) -/*! PLL_DIV_SEL - PLL Divider Value Configuration */ -#define USBPHY_PLL_SIC_TOG_PLL_DIV_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_TOG_PLL_DIV_SEL_SHIFT)) & USBPHY_PLL_SIC_TOG_PLL_DIV_SEL_MASK) - -#define USBPHY_PLL_SIC_TOG_PLL_LOCK_MASK (0x80000000U) -#define USBPHY_PLL_SIC_TOG_PLL_LOCK_SHIFT (31U) -/*! PLL_LOCK - USB PLL Lock Status Indicator */ -#define USBPHY_PLL_SIC_TOG_PLL_LOCK(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PLL_SIC_TOG_PLL_LOCK_SHIFT)) & USBPHY_PLL_SIC_TOG_PLL_LOCK_MASK) -/*! @} */ - -/*! @name USB1_VBUS_DETECT - VBUS Detect */ -/*! @{ */ - -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_THRESH_MASK (0x7U) -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_THRESH_SHIFT (0U) -/*! VBUSVALID_THRESH - VBUS Comparator Threshold - * 0b000..4.0 V - * 0b001..4.1 V - * 0b010..4.2 V - * 0b011..4.3 V - * 0b100..4.4 V - * 0b101..4.5 V - * 0b110..4.6 V - * 0b111..4.7 V - */ -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_THRESH(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_VBUSVALID_THRESH_SHIFT)) & USBPHY_USB1_VBUS_DETECT_VBUSVALID_THRESH_MASK) - -#define USBPHY_USB1_VBUS_DETECT_VBUS_OVERRIDE_EN_MASK (0x8U) -#define USBPHY_USB1_VBUS_DETECT_VBUS_OVERRIDE_EN_SHIFT (3U) -/*! VBUS_OVERRIDE_EN - VBUS Detect Signal Local Override Enable - * 0b0..Results of VBUS_VALID and session valid comparators for VBUS_VALID, AVALID, BVALID, and SESSEND - * 0b1..Override values for VBUS_VALID, AVALID, BVALID, and SESSEND - */ -#define USBPHY_USB1_VBUS_DETECT_VBUS_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_VBUS_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_VBUS_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SESSEND_OVERRIDE_MASK (0x10U) -#define USBPHY_USB1_VBUS_DETECT_SESSEND_OVERRIDE_SHIFT (4U) -/*! SESSEND_OVERRIDE - Override Value for SESSEND */ -#define USBPHY_USB1_VBUS_DETECT_SESSEND_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SESSEND_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SESSEND_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_BVALID_OVERRIDE_MASK (0x20U) -#define USBPHY_USB1_VBUS_DETECT_BVALID_OVERRIDE_SHIFT (5U) -/*! BVALID_OVERRIDE - Override Value for B-Device Session Valid */ -#define USBPHY_USB1_VBUS_DETECT_BVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_BVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_BVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_AVALID_OVERRIDE_MASK (0x40U) -#define USBPHY_USB1_VBUS_DETECT_AVALID_OVERRIDE_SHIFT (6U) -/*! AVALID_OVERRIDE - Override Value for A-Device Session Valid */ -#define USBPHY_USB1_VBUS_DETECT_AVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_AVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_AVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_OVERRIDE_MASK (0x80U) -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_OVERRIDE_SHIFT (7U) -/*! VBUSVALID_OVERRIDE - Override Value for the VBUS_VALID Signal */ -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_VBUSVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_VBUSVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_SEL_MASK (0x100U) -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_SEL_SHIFT (8U) -/*! VBUSVALID_SEL - VBUS_VALID Selection - * 0b0..VBUS_VALID comparator result - * 0b1..VBUS_VALID_3V comparator result - */ -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_VBUSVALID_SEL_SHIFT)) & USBPHY_USB1_VBUS_DETECT_VBUSVALID_SEL_MASK) - -#define USBPHY_USB1_VBUS_DETECT_VBUS_SOURCE_SEL_MASK (0x600U) -#define USBPHY_USB1_VBUS_DETECT_VBUS_SOURCE_SEL_SHIFT (9U) -/*! VBUS_SOURCE_SEL - VBUS_VALID Source Selection - * 0b00..VBUS_VALID comparator result - * 0b01..Session valid comparator result - * 0b10..Session valid comparator result - * 0b11.. - */ -#define USBPHY_USB1_VBUS_DETECT_VBUS_SOURCE_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_VBUS_SOURCE_SEL_SHIFT)) & USBPHY_USB1_VBUS_DETECT_VBUS_SOURCE_SEL_MASK) - -#define USBPHY_USB1_VBUS_DETECT_ID_OVERRIDE_EN_MASK (0x800U) -#define USBPHY_USB1_VBUS_DETECT_ID_OVERRIDE_EN_SHIFT (11U) -/*! ID_OVERRIDE_EN - Enable Local ID Pin Status Override - * 0b0..Use ID pin detector or external override - * 0b1..Allow local override of ID pin detection status - */ -#define USBPHY_USB1_VBUS_DETECT_ID_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_ID_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_ID_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_ID_OVERRIDE_MASK (0x1000U) -#define USBPHY_USB1_VBUS_DETECT_ID_OVERRIDE_SHIFT (12U) -/*! ID_OVERRIDE - ID Pin Status Local Override */ -#define USBPHY_USB1_VBUS_DETECT_ID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_ID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_ID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_EXT_ID_OVERRIDE_EN_MASK (0x2000U) -#define USBPHY_USB1_VBUS_DETECT_EXT_ID_OVERRIDE_EN_SHIFT (13U) -/*! EXT_ID_OVERRIDE_EN - External ID Override Enable - * 0b0..Internal detector or local override - * 0b1..External ID signal value - */ -#define USBPHY_USB1_VBUS_DETECT_EXT_ID_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_EXT_ID_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_EXT_ID_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_EXT_VBUS_OVERRIDE_EN_MASK (0x4000U) -#define USBPHY_USB1_VBUS_DETECT_EXT_VBUS_OVERRIDE_EN_SHIFT (14U) -/*! EXT_VBUS_OVERRIDE_EN - External VBUS Override Enable - * 0b0..Internal detector or local override - * 0b1..External VBUS_VALID value - */ -#define USBPHY_USB1_VBUS_DETECT_EXT_VBUS_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_EXT_VBUS_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_EXT_VBUS_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_TO_B_MASK (0x40000U) -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_TO_B_SHIFT (18U) -/*! VBUSVALID_TO_B - VBUS_VALID Comparator Selection - * 0b0..VBUS_VALID comparator - * 0b1..Session valid detector - */ -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_TO_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_VBUSVALID_TO_B_SHIFT)) & USBPHY_USB1_VBUS_DETECT_VBUSVALID_TO_B_MASK) - -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_PWRUP_CMPS_MASK (0x700000U) -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_PWRUP_CMPS_SHIFT (20U) -/*! VBUSVALID_PWRUP_CMPS - VBUS_VALID Comparator Enable - * 0bxx0..Disable or power down the VBUS_VALID comparator - * 0bxx1..Enable the VBUS_VALID comparator - * 0bx0x..Disable or power down the session valid detector - * 0bx1x..Enable the session valid detector - * 0b0xx..Disable or power down the VBUS_VALID_3V detector - * 0b1xx..Enable the VBUS_VALID_3V detector - */ -#define USBPHY_USB1_VBUS_DETECT_VBUSVALID_PWRUP_CMPS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_VBUSVALID_PWRUP_CMPS_SHIFT)) & USBPHY_USB1_VBUS_DETECT_VBUSVALID_PWRUP_CMPS_MASK) - -#define USBPHY_USB1_VBUS_DETECT_DISCHARGE_VBUS_MASK (0x4000000U) -#define USBPHY_USB1_VBUS_DETECT_DISCHARGE_VBUS_SHIFT (26U) -/*! DISCHARGE_VBUS - VBUS Discharge Resistor - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_USB1_VBUS_DETECT_DISCHARGE_VBUS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_DISCHARGE_VBUS_SHIFT)) & USBPHY_USB1_VBUS_DETECT_DISCHARGE_VBUS_MASK) -/*! @} */ - -/*! @name USB1_VBUS_DETECT_SET - VBUS Detect */ -/*! @{ */ - -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_THRESH_MASK (0x7U) -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_THRESH_SHIFT (0U) -/*! VBUSVALID_THRESH - VBUS Comparator Threshold */ -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_THRESH(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_THRESH_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_THRESH_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_VBUS_OVERRIDE_EN_MASK (0x8U) -#define USBPHY_USB1_VBUS_DETECT_SET_VBUS_OVERRIDE_EN_SHIFT (3U) -/*! VBUS_OVERRIDE_EN - VBUS Detect Signal Local Override Enable */ -#define USBPHY_USB1_VBUS_DETECT_SET_VBUS_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_VBUS_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_VBUS_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_SESSEND_OVERRIDE_MASK (0x10U) -#define USBPHY_USB1_VBUS_DETECT_SET_SESSEND_OVERRIDE_SHIFT (4U) -/*! SESSEND_OVERRIDE - Override Value for SESSEND */ -#define USBPHY_USB1_VBUS_DETECT_SET_SESSEND_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_SESSEND_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_SESSEND_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_BVALID_OVERRIDE_MASK (0x20U) -#define USBPHY_USB1_VBUS_DETECT_SET_BVALID_OVERRIDE_SHIFT (5U) -/*! BVALID_OVERRIDE - Override Value for B-Device Session Valid */ -#define USBPHY_USB1_VBUS_DETECT_SET_BVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_BVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_BVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_AVALID_OVERRIDE_MASK (0x40U) -#define USBPHY_USB1_VBUS_DETECT_SET_AVALID_OVERRIDE_SHIFT (6U) -/*! AVALID_OVERRIDE - Override Value for A-Device Session Valid */ -#define USBPHY_USB1_VBUS_DETECT_SET_AVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_AVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_AVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_OVERRIDE_MASK (0x80U) -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_OVERRIDE_SHIFT (7U) -/*! VBUSVALID_OVERRIDE - Override Value for the VBUS_VALID Signal */ -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_SEL_MASK (0x100U) -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_SEL_SHIFT (8U) -/*! VBUSVALID_SEL - VBUS_VALID Selection */ -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_SEL_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_SEL_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_VBUS_SOURCE_SEL_MASK (0x600U) -#define USBPHY_USB1_VBUS_DETECT_SET_VBUS_SOURCE_SEL_SHIFT (9U) -/*! VBUS_SOURCE_SEL - VBUS_VALID Source Selection */ -#define USBPHY_USB1_VBUS_DETECT_SET_VBUS_SOURCE_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_VBUS_SOURCE_SEL_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_VBUS_SOURCE_SEL_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_ID_OVERRIDE_EN_MASK (0x800U) -#define USBPHY_USB1_VBUS_DETECT_SET_ID_OVERRIDE_EN_SHIFT (11U) -/*! ID_OVERRIDE_EN - Enable Local ID Pin Status Override */ -#define USBPHY_USB1_VBUS_DETECT_SET_ID_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_ID_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_ID_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_ID_OVERRIDE_MASK (0x1000U) -#define USBPHY_USB1_VBUS_DETECT_SET_ID_OVERRIDE_SHIFT (12U) -/*! ID_OVERRIDE - ID Pin Status Local Override */ -#define USBPHY_USB1_VBUS_DETECT_SET_ID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_ID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_ID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_EXT_ID_OVERRIDE_EN_MASK (0x2000U) -#define USBPHY_USB1_VBUS_DETECT_SET_EXT_ID_OVERRIDE_EN_SHIFT (13U) -/*! EXT_ID_OVERRIDE_EN - External ID Override Enable */ -#define USBPHY_USB1_VBUS_DETECT_SET_EXT_ID_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_EXT_ID_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_EXT_ID_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_EXT_VBUS_OVERRIDE_EN_MASK (0x4000U) -#define USBPHY_USB1_VBUS_DETECT_SET_EXT_VBUS_OVERRIDE_EN_SHIFT (14U) -/*! EXT_VBUS_OVERRIDE_EN - External VBUS Override Enable */ -#define USBPHY_USB1_VBUS_DETECT_SET_EXT_VBUS_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_EXT_VBUS_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_EXT_VBUS_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_TO_B_MASK (0x40000U) -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_TO_B_SHIFT (18U) -/*! VBUSVALID_TO_B - VBUS_VALID Comparator Selection */ -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_TO_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_TO_B_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_TO_B_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_PWRUP_CMPS_MASK (0x700000U) -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_PWRUP_CMPS_SHIFT (20U) -/*! VBUSVALID_PWRUP_CMPS - VBUS_VALID Comparator Enable */ -#define USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_PWRUP_CMPS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_PWRUP_CMPS_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_VBUSVALID_PWRUP_CMPS_MASK) - -#define USBPHY_USB1_VBUS_DETECT_SET_DISCHARGE_VBUS_MASK (0x4000000U) -#define USBPHY_USB1_VBUS_DETECT_SET_DISCHARGE_VBUS_SHIFT (26U) -/*! DISCHARGE_VBUS - VBUS Discharge Resistor */ -#define USBPHY_USB1_VBUS_DETECT_SET_DISCHARGE_VBUS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_SET_DISCHARGE_VBUS_SHIFT)) & USBPHY_USB1_VBUS_DETECT_SET_DISCHARGE_VBUS_MASK) -/*! @} */ - -/*! @name USB1_VBUS_DETECT_CLR - VBUS Detect */ -/*! @{ */ - -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_THRESH_MASK (0x7U) -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_THRESH_SHIFT (0U) -/*! VBUSVALID_THRESH - VBUS Comparator Threshold */ -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_THRESH(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_THRESH_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_THRESH_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUS_OVERRIDE_EN_MASK (0x8U) -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUS_OVERRIDE_EN_SHIFT (3U) -/*! VBUS_OVERRIDE_EN - VBUS Detect Signal Local Override Enable */ -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUS_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_VBUS_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_VBUS_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_SESSEND_OVERRIDE_MASK (0x10U) -#define USBPHY_USB1_VBUS_DETECT_CLR_SESSEND_OVERRIDE_SHIFT (4U) -/*! SESSEND_OVERRIDE - Override Value for SESSEND */ -#define USBPHY_USB1_VBUS_DETECT_CLR_SESSEND_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_SESSEND_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_SESSEND_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_BVALID_OVERRIDE_MASK (0x20U) -#define USBPHY_USB1_VBUS_DETECT_CLR_BVALID_OVERRIDE_SHIFT (5U) -/*! BVALID_OVERRIDE - Override Value for B-Device Session Valid */ -#define USBPHY_USB1_VBUS_DETECT_CLR_BVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_BVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_BVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_AVALID_OVERRIDE_MASK (0x40U) -#define USBPHY_USB1_VBUS_DETECT_CLR_AVALID_OVERRIDE_SHIFT (6U) -/*! AVALID_OVERRIDE - Override Value for A-Device Session Valid */ -#define USBPHY_USB1_VBUS_DETECT_CLR_AVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_AVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_AVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_OVERRIDE_MASK (0x80U) -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_OVERRIDE_SHIFT (7U) -/*! VBUSVALID_OVERRIDE - Override Value for the VBUS_VALID Signal */ -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_SEL_MASK (0x100U) -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_SEL_SHIFT (8U) -/*! VBUSVALID_SEL - VBUS_VALID Selection */ -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_SEL_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_SEL_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUS_SOURCE_SEL_MASK (0x600U) -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUS_SOURCE_SEL_SHIFT (9U) -/*! VBUS_SOURCE_SEL - VBUS_VALID Source Selection */ -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUS_SOURCE_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_VBUS_SOURCE_SEL_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_VBUS_SOURCE_SEL_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_ID_OVERRIDE_EN_MASK (0x800U) -#define USBPHY_USB1_VBUS_DETECT_CLR_ID_OVERRIDE_EN_SHIFT (11U) -/*! ID_OVERRIDE_EN - Enable Local ID Pin Status Override */ -#define USBPHY_USB1_VBUS_DETECT_CLR_ID_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_ID_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_ID_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_ID_OVERRIDE_MASK (0x1000U) -#define USBPHY_USB1_VBUS_DETECT_CLR_ID_OVERRIDE_SHIFT (12U) -/*! ID_OVERRIDE - ID Pin Status Local Override */ -#define USBPHY_USB1_VBUS_DETECT_CLR_ID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_ID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_ID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_EXT_ID_OVERRIDE_EN_MASK (0x2000U) -#define USBPHY_USB1_VBUS_DETECT_CLR_EXT_ID_OVERRIDE_EN_SHIFT (13U) -/*! EXT_ID_OVERRIDE_EN - External ID Override Enable */ -#define USBPHY_USB1_VBUS_DETECT_CLR_EXT_ID_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_EXT_ID_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_EXT_ID_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_EXT_VBUS_OVERRIDE_EN_MASK (0x4000U) -#define USBPHY_USB1_VBUS_DETECT_CLR_EXT_VBUS_OVERRIDE_EN_SHIFT (14U) -/*! EXT_VBUS_OVERRIDE_EN - External VBUS Override Enable */ -#define USBPHY_USB1_VBUS_DETECT_CLR_EXT_VBUS_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_EXT_VBUS_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_EXT_VBUS_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_TO_B_MASK (0x40000U) -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_TO_B_SHIFT (18U) -/*! VBUSVALID_TO_B - VBUS_VALID Comparator Selection */ -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_TO_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_TO_B_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_TO_B_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_PWRUP_CMPS_MASK (0x700000U) -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_PWRUP_CMPS_SHIFT (20U) -/*! VBUSVALID_PWRUP_CMPS - VBUS_VALID Comparator Enable */ -#define USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_PWRUP_CMPS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_PWRUP_CMPS_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_VBUSVALID_PWRUP_CMPS_MASK) - -#define USBPHY_USB1_VBUS_DETECT_CLR_DISCHARGE_VBUS_MASK (0x4000000U) -#define USBPHY_USB1_VBUS_DETECT_CLR_DISCHARGE_VBUS_SHIFT (26U) -/*! DISCHARGE_VBUS - VBUS Discharge Resistor */ -#define USBPHY_USB1_VBUS_DETECT_CLR_DISCHARGE_VBUS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_CLR_DISCHARGE_VBUS_SHIFT)) & USBPHY_USB1_VBUS_DETECT_CLR_DISCHARGE_VBUS_MASK) -/*! @} */ - -/*! @name USB1_VBUS_DETECT_TOG - VBUS Detect */ -/*! @{ */ - -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_THRESH_MASK (0x7U) -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_THRESH_SHIFT (0U) -/*! VBUSVALID_THRESH - VBUS Comparator Threshold */ -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_THRESH(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_THRESH_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_THRESH_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUS_OVERRIDE_EN_MASK (0x8U) -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUS_OVERRIDE_EN_SHIFT (3U) -/*! VBUS_OVERRIDE_EN - VBUS Detect Signal Local Override Enable */ -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUS_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_VBUS_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_VBUS_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_SESSEND_OVERRIDE_MASK (0x10U) -#define USBPHY_USB1_VBUS_DETECT_TOG_SESSEND_OVERRIDE_SHIFT (4U) -/*! SESSEND_OVERRIDE - Override Value for SESSEND */ -#define USBPHY_USB1_VBUS_DETECT_TOG_SESSEND_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_SESSEND_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_SESSEND_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_BVALID_OVERRIDE_MASK (0x20U) -#define USBPHY_USB1_VBUS_DETECT_TOG_BVALID_OVERRIDE_SHIFT (5U) -/*! BVALID_OVERRIDE - Override Value for B-Device Session Valid */ -#define USBPHY_USB1_VBUS_DETECT_TOG_BVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_BVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_BVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_AVALID_OVERRIDE_MASK (0x40U) -#define USBPHY_USB1_VBUS_DETECT_TOG_AVALID_OVERRIDE_SHIFT (6U) -/*! AVALID_OVERRIDE - Override Value for A-Device Session Valid */ -#define USBPHY_USB1_VBUS_DETECT_TOG_AVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_AVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_AVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_OVERRIDE_MASK (0x80U) -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_OVERRIDE_SHIFT (7U) -/*! VBUSVALID_OVERRIDE - Override Value for the VBUS_VALID Signal */ -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_SEL_MASK (0x100U) -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_SEL_SHIFT (8U) -/*! VBUSVALID_SEL - VBUS_VALID Selection */ -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_SEL_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_SEL_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUS_SOURCE_SEL_MASK (0x600U) -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUS_SOURCE_SEL_SHIFT (9U) -/*! VBUS_SOURCE_SEL - VBUS_VALID Source Selection */ -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUS_SOURCE_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_VBUS_SOURCE_SEL_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_VBUS_SOURCE_SEL_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_ID_OVERRIDE_EN_MASK (0x800U) -#define USBPHY_USB1_VBUS_DETECT_TOG_ID_OVERRIDE_EN_SHIFT (11U) -/*! ID_OVERRIDE_EN - Enable Local ID Pin Status Override */ -#define USBPHY_USB1_VBUS_DETECT_TOG_ID_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_ID_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_ID_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_ID_OVERRIDE_MASK (0x1000U) -#define USBPHY_USB1_VBUS_DETECT_TOG_ID_OVERRIDE_SHIFT (12U) -/*! ID_OVERRIDE - ID Pin Status Local Override */ -#define USBPHY_USB1_VBUS_DETECT_TOG_ID_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_ID_OVERRIDE_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_ID_OVERRIDE_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_EXT_ID_OVERRIDE_EN_MASK (0x2000U) -#define USBPHY_USB1_VBUS_DETECT_TOG_EXT_ID_OVERRIDE_EN_SHIFT (13U) -/*! EXT_ID_OVERRIDE_EN - External ID Override Enable */ -#define USBPHY_USB1_VBUS_DETECT_TOG_EXT_ID_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_EXT_ID_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_EXT_ID_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_EXT_VBUS_OVERRIDE_EN_MASK (0x4000U) -#define USBPHY_USB1_VBUS_DETECT_TOG_EXT_VBUS_OVERRIDE_EN_SHIFT (14U) -/*! EXT_VBUS_OVERRIDE_EN - External VBUS Override Enable */ -#define USBPHY_USB1_VBUS_DETECT_TOG_EXT_VBUS_OVERRIDE_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_EXT_VBUS_OVERRIDE_EN_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_EXT_VBUS_OVERRIDE_EN_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_TO_B_MASK (0x40000U) -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_TO_B_SHIFT (18U) -/*! VBUSVALID_TO_B - VBUS_VALID Comparator Selection */ -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_TO_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_TO_B_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_TO_B_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_PWRUP_CMPS_MASK (0x700000U) -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_PWRUP_CMPS_SHIFT (20U) -/*! VBUSVALID_PWRUP_CMPS - VBUS_VALID Comparator Enable */ -#define USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_PWRUP_CMPS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_PWRUP_CMPS_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_VBUSVALID_PWRUP_CMPS_MASK) - -#define USBPHY_USB1_VBUS_DETECT_TOG_DISCHARGE_VBUS_MASK (0x4000000U) -#define USBPHY_USB1_VBUS_DETECT_TOG_DISCHARGE_VBUS_SHIFT (26U) -/*! DISCHARGE_VBUS - VBUS Discharge Resistor */ -#define USBPHY_USB1_VBUS_DETECT_TOG_DISCHARGE_VBUS(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DETECT_TOG_DISCHARGE_VBUS_SHIFT)) & USBPHY_USB1_VBUS_DETECT_TOG_DISCHARGE_VBUS_MASK) -/*! @} */ - -/*! @name USB1_VBUS_DET_STAT - VBUS Detect Status */ -/*! @{ */ - -#define USBPHY_USB1_VBUS_DET_STAT_SESSEND_MASK (0x1U) -#define USBPHY_USB1_VBUS_DET_STAT_SESSEND_SHIFT (0U) -/*! SESSEND - Session End Indicator - * 0b0..Above threshold - * 0b1..Below threshold - */ -#define USBPHY_USB1_VBUS_DET_STAT_SESSEND(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_SESSEND_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_SESSEND_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_BVALID_MASK (0x2U) -#define USBPHY_USB1_VBUS_DET_STAT_BVALID_SHIFT (1U) -/*! BVALID - B-Device Session Valid Status - * 0b0..Below threshold - * 0b1..Above threshold - */ -#define USBPHY_USB1_VBUS_DET_STAT_BVALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_BVALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_BVALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_AVALID_MASK (0x4U) -#define USBPHY_USB1_VBUS_DET_STAT_AVALID_SHIFT (2U) -/*! AVALID - A-Device Session Valid Status - * 0b0..Below threshold - * 0b1..Above threshold - */ -#define USBPHY_USB1_VBUS_DET_STAT_AVALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_AVALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_AVALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID_MASK (0x8U) -#define USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID_SHIFT (3U) -/*! VBUS_VALID - VBUS Voltage Status - * 0b0..Below threshold - * 0b1..Above threshold - */ -#define USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID_3V_MASK (0x10U) -#define USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID_3V_SHIFT (4U) -/*! VBUS_VALID_3V - VBUS_VALID_3V Detector Status - * 0b0..Below threshold - * 0b1..Above threshold - */ -#define USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID_3V(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID_3V_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_VBUS_VALID_3V_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_EXT_ID_MASK (0x20U) -#define USBPHY_USB1_VBUS_DET_STAT_EXT_ID_SHIFT (5U) -/*! EXT_ID - OTG ID External Override Status */ -#define USBPHY_USB1_VBUS_DET_STAT_EXT_ID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_EXT_ID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_EXT_ID_MASK) -/*! @} */ - -/*! @name USB1_VBUS_DET_STAT_SET - VBUS Detect Status */ -/*! @{ */ - -#define USBPHY_USB1_VBUS_DET_STAT_SET_SESSEND_MASK (0x1U) -#define USBPHY_USB1_VBUS_DET_STAT_SET_SESSEND_SHIFT (0U) -/*! SESSEND - Session End Indicator */ -#define USBPHY_USB1_VBUS_DET_STAT_SET_SESSEND(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_SET_SESSEND_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_SET_SESSEND_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_SET_BVALID_MASK (0x2U) -#define USBPHY_USB1_VBUS_DET_STAT_SET_BVALID_SHIFT (1U) -/*! BVALID - B-Device Session Valid Status */ -#define USBPHY_USB1_VBUS_DET_STAT_SET_BVALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_SET_BVALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_SET_BVALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_SET_AVALID_MASK (0x4U) -#define USBPHY_USB1_VBUS_DET_STAT_SET_AVALID_SHIFT (2U) -/*! AVALID - A-Device Session Valid Status */ -#define USBPHY_USB1_VBUS_DET_STAT_SET_AVALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_SET_AVALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_SET_AVALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_SET_VBUS_VALID_MASK (0x8U) -#define USBPHY_USB1_VBUS_DET_STAT_SET_VBUS_VALID_SHIFT (3U) -/*! VBUS_VALID - VBUS Voltage Status */ -#define USBPHY_USB1_VBUS_DET_STAT_SET_VBUS_VALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_SET_VBUS_VALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_SET_VBUS_VALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_SET_VBUS_VALID_3V_MASK (0x10U) -#define USBPHY_USB1_VBUS_DET_STAT_SET_VBUS_VALID_3V_SHIFT (4U) -/*! VBUS_VALID_3V - VBUS_VALID_3V Detector Status */ -#define USBPHY_USB1_VBUS_DET_STAT_SET_VBUS_VALID_3V(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_SET_VBUS_VALID_3V_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_SET_VBUS_VALID_3V_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_SET_EXT_ID_MASK (0x20U) -#define USBPHY_USB1_VBUS_DET_STAT_SET_EXT_ID_SHIFT (5U) -/*! EXT_ID - OTG ID External Override Status */ -#define USBPHY_USB1_VBUS_DET_STAT_SET_EXT_ID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_SET_EXT_ID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_SET_EXT_ID_MASK) -/*! @} */ - -/*! @name USB1_VBUS_DET_STAT_CLR - VBUS Detect Status */ -/*! @{ */ - -#define USBPHY_USB1_VBUS_DET_STAT_CLR_SESSEND_MASK (0x1U) -#define USBPHY_USB1_VBUS_DET_STAT_CLR_SESSEND_SHIFT (0U) -/*! SESSEND - Session End Indicator */ -#define USBPHY_USB1_VBUS_DET_STAT_CLR_SESSEND(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_CLR_SESSEND_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_CLR_SESSEND_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_CLR_BVALID_MASK (0x2U) -#define USBPHY_USB1_VBUS_DET_STAT_CLR_BVALID_SHIFT (1U) -/*! BVALID - B-Device Session Valid Status */ -#define USBPHY_USB1_VBUS_DET_STAT_CLR_BVALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_CLR_BVALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_CLR_BVALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_CLR_AVALID_MASK (0x4U) -#define USBPHY_USB1_VBUS_DET_STAT_CLR_AVALID_SHIFT (2U) -/*! AVALID - A-Device Session Valid Status */ -#define USBPHY_USB1_VBUS_DET_STAT_CLR_AVALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_CLR_AVALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_CLR_AVALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_CLR_VBUS_VALID_MASK (0x8U) -#define USBPHY_USB1_VBUS_DET_STAT_CLR_VBUS_VALID_SHIFT (3U) -/*! VBUS_VALID - VBUS Voltage Status */ -#define USBPHY_USB1_VBUS_DET_STAT_CLR_VBUS_VALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_CLR_VBUS_VALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_CLR_VBUS_VALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_CLR_VBUS_VALID_3V_MASK (0x10U) -#define USBPHY_USB1_VBUS_DET_STAT_CLR_VBUS_VALID_3V_SHIFT (4U) -/*! VBUS_VALID_3V - VBUS_VALID_3V Detector Status */ -#define USBPHY_USB1_VBUS_DET_STAT_CLR_VBUS_VALID_3V(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_CLR_VBUS_VALID_3V_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_CLR_VBUS_VALID_3V_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_CLR_EXT_ID_MASK (0x20U) -#define USBPHY_USB1_VBUS_DET_STAT_CLR_EXT_ID_SHIFT (5U) -/*! EXT_ID - OTG ID External Override Status */ -#define USBPHY_USB1_VBUS_DET_STAT_CLR_EXT_ID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_CLR_EXT_ID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_CLR_EXT_ID_MASK) -/*! @} */ - -/*! @name USB1_VBUS_DET_STAT_TOG - VBUS Detect Status */ -/*! @{ */ - -#define USBPHY_USB1_VBUS_DET_STAT_TOG_SESSEND_MASK (0x1U) -#define USBPHY_USB1_VBUS_DET_STAT_TOG_SESSEND_SHIFT (0U) -/*! SESSEND - Session End Indicator */ -#define USBPHY_USB1_VBUS_DET_STAT_TOG_SESSEND(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_TOG_SESSEND_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_TOG_SESSEND_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_TOG_BVALID_MASK (0x2U) -#define USBPHY_USB1_VBUS_DET_STAT_TOG_BVALID_SHIFT (1U) -/*! BVALID - B-Device Session Valid Status */ -#define USBPHY_USB1_VBUS_DET_STAT_TOG_BVALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_TOG_BVALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_TOG_BVALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_TOG_AVALID_MASK (0x4U) -#define USBPHY_USB1_VBUS_DET_STAT_TOG_AVALID_SHIFT (2U) -/*! AVALID - A-Device Session Valid Status */ -#define USBPHY_USB1_VBUS_DET_STAT_TOG_AVALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_TOG_AVALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_TOG_AVALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_TOG_VBUS_VALID_MASK (0x8U) -#define USBPHY_USB1_VBUS_DET_STAT_TOG_VBUS_VALID_SHIFT (3U) -/*! VBUS_VALID - VBUS Voltage Status */ -#define USBPHY_USB1_VBUS_DET_STAT_TOG_VBUS_VALID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_TOG_VBUS_VALID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_TOG_VBUS_VALID_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_TOG_VBUS_VALID_3V_MASK (0x10U) -#define USBPHY_USB1_VBUS_DET_STAT_TOG_VBUS_VALID_3V_SHIFT (4U) -/*! VBUS_VALID_3V - VBUS_VALID_3V Detector Status */ -#define USBPHY_USB1_VBUS_DET_STAT_TOG_VBUS_VALID_3V(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_TOG_VBUS_VALID_3V_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_TOG_VBUS_VALID_3V_MASK) - -#define USBPHY_USB1_VBUS_DET_STAT_TOG_EXT_ID_MASK (0x20U) -#define USBPHY_USB1_VBUS_DET_STAT_TOG_EXT_ID_SHIFT (5U) -/*! EXT_ID - OTG ID External Override Status */ -#define USBPHY_USB1_VBUS_DET_STAT_TOG_EXT_ID(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_VBUS_DET_STAT_TOG_EXT_ID_SHIFT)) & USBPHY_USB1_VBUS_DET_STAT_TOG_EXT_ID_MASK) -/*! @} */ - -/*! @name USB1_CHRG_DETECT - Charger Detect */ -/*! @{ */ - -#define USBPHY_USB1_CHRG_DETECT_DETECT_SEC_MASK (0x2U) -#define USBPHY_USB1_CHRG_DETECT_DETECT_SEC_SHIFT (1U) -/*! DETECT_SEC - Secondary Detection Function Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_USB1_CHRG_DETECT_DETECT_SEC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_DETECT_SEC_SHIFT)) & USBPHY_USB1_CHRG_DETECT_DETECT_SEC_MASK) - -#define USBPHY_USB1_CHRG_DETECT_PULLUP_DP_MASK (0x4U) -#define USBPHY_USB1_CHRG_DETECT_PULLUP_DP_SHIFT (2U) -/*! PULLUP_DP - DP Pullup Resistor Enable Override Control - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_USB1_CHRG_DETECT_PULLUP_DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_PULLUP_DP_SHIFT)) & USBPHY_USB1_CHRG_DETECT_PULLUP_DP_MASK) - -#define USBPHY_USB1_CHRG_DETECT_VDM_SRC_ENABLE_MASK (0x10U) -#define USBPHY_USB1_CHRG_DETECT_VDM_SRC_ENABLE_SHIFT (4U) -/*! VDM_SRC_ENABLE - VDM_SRC Function Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_USB1_CHRG_DETECT_VDM_SRC_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_VDM_SRC_ENABLE_SHIFT)) & USBPHY_USB1_CHRG_DETECT_VDM_SRC_ENABLE_MASK) - -#define USBPHY_USB1_CHRG_DETECT_CHK_CONTACT_MASK (0x40000U) -#define USBPHY_USB1_CHRG_DETECT_CHK_CONTACT_SHIFT (18U) -/*! CHK_CONTACT - BC Data Contact Detect Function Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_USB1_CHRG_DETECT_CHK_CONTACT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_CHK_CONTACT_SHIFT)) & USBPHY_USB1_CHRG_DETECT_CHK_CONTACT_MASK) - -#define USBPHY_USB1_CHRG_DETECT_CHK_CHRG_B_MASK (0x80000U) -#define USBPHY_USB1_CHRG_DETECT_CHK_CHRG_B_SHIFT (19U) -/*! CHK_CHRG_B - BC Charger Detection Function Enable - * 0b0..Enable - * 0b1..Disable - */ -#define USBPHY_USB1_CHRG_DETECT_CHK_CHRG_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_CHK_CHRG_B_SHIFT)) & USBPHY_USB1_CHRG_DETECT_CHK_CHRG_B_MASK) - -#define USBPHY_USB1_CHRG_DETECT_EN_B_MASK (0x100000U) -#define USBPHY_USB1_CHRG_DETECT_EN_B_SHIFT (20U) -/*! EN_B - Selection of BC v1.2 Function Enable - * 0b0..Enable - * 0b1..Disable - */ -#define USBPHY_USB1_CHRG_DETECT_EN_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_EN_B_SHIFT)) & USBPHY_USB1_CHRG_DETECT_EN_B_MASK) - -#define USBPHY_USB1_CHRG_DETECT_DCDSEL_MASK (0x80000000U) -#define USBPHY_USB1_CHRG_DETECT_DCDSEL_SHIFT (31U) -/*! DCDSEL - DCD Selection - * 0b0..Fields in USB1_CHRG_DETECT - * 0b1..Fields and state machines in the USBHSDCD module - */ -#define USBPHY_USB1_CHRG_DETECT_DCDSEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_DCDSEL_SHIFT)) & USBPHY_USB1_CHRG_DETECT_DCDSEL_MASK) -/*! @} */ - -/*! @name USB1_CHRG_DETECT_SET - Charger Detect */ -/*! @{ */ - -#define USBPHY_USB1_CHRG_DETECT_SET_DETECT_SEC_MASK (0x2U) -#define USBPHY_USB1_CHRG_DETECT_SET_DETECT_SEC_SHIFT (1U) -/*! DETECT_SEC - Secondary Detection Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_SET_DETECT_SEC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_SET_DETECT_SEC_SHIFT)) & USBPHY_USB1_CHRG_DETECT_SET_DETECT_SEC_MASK) - -#define USBPHY_USB1_CHRG_DETECT_SET_PULLUP_DP_MASK (0x4U) -#define USBPHY_USB1_CHRG_DETECT_SET_PULLUP_DP_SHIFT (2U) -/*! PULLUP_DP - DP Pullup Resistor Enable Override Control */ -#define USBPHY_USB1_CHRG_DETECT_SET_PULLUP_DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_SET_PULLUP_DP_SHIFT)) & USBPHY_USB1_CHRG_DETECT_SET_PULLUP_DP_MASK) - -#define USBPHY_USB1_CHRG_DETECT_SET_VDM_SRC_ENABLE_MASK (0x10U) -#define USBPHY_USB1_CHRG_DETECT_SET_VDM_SRC_ENABLE_SHIFT (4U) -/*! VDM_SRC_ENABLE - VDM_SRC Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_SET_VDM_SRC_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_SET_VDM_SRC_ENABLE_SHIFT)) & USBPHY_USB1_CHRG_DETECT_SET_VDM_SRC_ENABLE_MASK) - -#define USBPHY_USB1_CHRG_DETECT_SET_CHK_CONTACT_MASK (0x40000U) -#define USBPHY_USB1_CHRG_DETECT_SET_CHK_CONTACT_SHIFT (18U) -/*! CHK_CONTACT - BC Data Contact Detect Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_SET_CHK_CONTACT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_SET_CHK_CONTACT_SHIFT)) & USBPHY_USB1_CHRG_DETECT_SET_CHK_CONTACT_MASK) - -#define USBPHY_USB1_CHRG_DETECT_SET_CHK_CHRG_B_MASK (0x80000U) -#define USBPHY_USB1_CHRG_DETECT_SET_CHK_CHRG_B_SHIFT (19U) -/*! CHK_CHRG_B - BC Charger Detection Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_SET_CHK_CHRG_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_SET_CHK_CHRG_B_SHIFT)) & USBPHY_USB1_CHRG_DETECT_SET_CHK_CHRG_B_MASK) - -#define USBPHY_USB1_CHRG_DETECT_SET_EN_B_MASK (0x100000U) -#define USBPHY_USB1_CHRG_DETECT_SET_EN_B_SHIFT (20U) -/*! EN_B - Selection of BC v1.2 Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_SET_EN_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_SET_EN_B_SHIFT)) & USBPHY_USB1_CHRG_DETECT_SET_EN_B_MASK) - -#define USBPHY_USB1_CHRG_DETECT_SET_DCDSEL_MASK (0x80000000U) -#define USBPHY_USB1_CHRG_DETECT_SET_DCDSEL_SHIFT (31U) -/*! DCDSEL - DCD Selection */ -#define USBPHY_USB1_CHRG_DETECT_SET_DCDSEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_SET_DCDSEL_SHIFT)) & USBPHY_USB1_CHRG_DETECT_SET_DCDSEL_MASK) -/*! @} */ - -/*! @name USB1_CHRG_DETECT_CLR - Charger Detect */ -/*! @{ */ - -#define USBPHY_USB1_CHRG_DETECT_CLR_DETECT_SEC_MASK (0x2U) -#define USBPHY_USB1_CHRG_DETECT_CLR_DETECT_SEC_SHIFT (1U) -/*! DETECT_SEC - Secondary Detection Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_CLR_DETECT_SEC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_CLR_DETECT_SEC_SHIFT)) & USBPHY_USB1_CHRG_DETECT_CLR_DETECT_SEC_MASK) - -#define USBPHY_USB1_CHRG_DETECT_CLR_PULLUP_DP_MASK (0x4U) -#define USBPHY_USB1_CHRG_DETECT_CLR_PULLUP_DP_SHIFT (2U) -/*! PULLUP_DP - DP Pullup Resistor Enable Override Control */ -#define USBPHY_USB1_CHRG_DETECT_CLR_PULLUP_DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_CLR_PULLUP_DP_SHIFT)) & USBPHY_USB1_CHRG_DETECT_CLR_PULLUP_DP_MASK) - -#define USBPHY_USB1_CHRG_DETECT_CLR_VDM_SRC_ENABLE_MASK (0x10U) -#define USBPHY_USB1_CHRG_DETECT_CLR_VDM_SRC_ENABLE_SHIFT (4U) -/*! VDM_SRC_ENABLE - VDM_SRC Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_CLR_VDM_SRC_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_CLR_VDM_SRC_ENABLE_SHIFT)) & USBPHY_USB1_CHRG_DETECT_CLR_VDM_SRC_ENABLE_MASK) - -#define USBPHY_USB1_CHRG_DETECT_CLR_CHK_CONTACT_MASK (0x40000U) -#define USBPHY_USB1_CHRG_DETECT_CLR_CHK_CONTACT_SHIFT (18U) -/*! CHK_CONTACT - BC Data Contact Detect Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_CLR_CHK_CONTACT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_CLR_CHK_CONTACT_SHIFT)) & USBPHY_USB1_CHRG_DETECT_CLR_CHK_CONTACT_MASK) - -#define USBPHY_USB1_CHRG_DETECT_CLR_CHK_CHRG_B_MASK (0x80000U) -#define USBPHY_USB1_CHRG_DETECT_CLR_CHK_CHRG_B_SHIFT (19U) -/*! CHK_CHRG_B - BC Charger Detection Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_CLR_CHK_CHRG_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_CLR_CHK_CHRG_B_SHIFT)) & USBPHY_USB1_CHRG_DETECT_CLR_CHK_CHRG_B_MASK) - -#define USBPHY_USB1_CHRG_DETECT_CLR_EN_B_MASK (0x100000U) -#define USBPHY_USB1_CHRG_DETECT_CLR_EN_B_SHIFT (20U) -/*! EN_B - Selection of BC v1.2 Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_CLR_EN_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_CLR_EN_B_SHIFT)) & USBPHY_USB1_CHRG_DETECT_CLR_EN_B_MASK) - -#define USBPHY_USB1_CHRG_DETECT_CLR_DCDSEL_MASK (0x80000000U) -#define USBPHY_USB1_CHRG_DETECT_CLR_DCDSEL_SHIFT (31U) -/*! DCDSEL - DCD Selection */ -#define USBPHY_USB1_CHRG_DETECT_CLR_DCDSEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_CLR_DCDSEL_SHIFT)) & USBPHY_USB1_CHRG_DETECT_CLR_DCDSEL_MASK) -/*! @} */ - -/*! @name USB1_CHRG_DETECT_TOG - Charger Detect */ -/*! @{ */ - -#define USBPHY_USB1_CHRG_DETECT_TOG_DETECT_SEC_MASK (0x2U) -#define USBPHY_USB1_CHRG_DETECT_TOG_DETECT_SEC_SHIFT (1U) -/*! DETECT_SEC - Secondary Detection Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_TOG_DETECT_SEC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_TOG_DETECT_SEC_SHIFT)) & USBPHY_USB1_CHRG_DETECT_TOG_DETECT_SEC_MASK) - -#define USBPHY_USB1_CHRG_DETECT_TOG_PULLUP_DP_MASK (0x4U) -#define USBPHY_USB1_CHRG_DETECT_TOG_PULLUP_DP_SHIFT (2U) -/*! PULLUP_DP - DP Pullup Resistor Enable Override Control */ -#define USBPHY_USB1_CHRG_DETECT_TOG_PULLUP_DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_TOG_PULLUP_DP_SHIFT)) & USBPHY_USB1_CHRG_DETECT_TOG_PULLUP_DP_MASK) - -#define USBPHY_USB1_CHRG_DETECT_TOG_VDM_SRC_ENABLE_MASK (0x10U) -#define USBPHY_USB1_CHRG_DETECT_TOG_VDM_SRC_ENABLE_SHIFT (4U) -/*! VDM_SRC_ENABLE - VDM_SRC Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_TOG_VDM_SRC_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_TOG_VDM_SRC_ENABLE_SHIFT)) & USBPHY_USB1_CHRG_DETECT_TOG_VDM_SRC_ENABLE_MASK) - -#define USBPHY_USB1_CHRG_DETECT_TOG_CHK_CONTACT_MASK (0x40000U) -#define USBPHY_USB1_CHRG_DETECT_TOG_CHK_CONTACT_SHIFT (18U) -/*! CHK_CONTACT - BC Data Contact Detect Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_TOG_CHK_CONTACT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_TOG_CHK_CONTACT_SHIFT)) & USBPHY_USB1_CHRG_DETECT_TOG_CHK_CONTACT_MASK) - -#define USBPHY_USB1_CHRG_DETECT_TOG_CHK_CHRG_B_MASK (0x80000U) -#define USBPHY_USB1_CHRG_DETECT_TOG_CHK_CHRG_B_SHIFT (19U) -/*! CHK_CHRG_B - BC Charger Detection Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_TOG_CHK_CHRG_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_TOG_CHK_CHRG_B_SHIFT)) & USBPHY_USB1_CHRG_DETECT_TOG_CHK_CHRG_B_MASK) - -#define USBPHY_USB1_CHRG_DETECT_TOG_EN_B_MASK (0x100000U) -#define USBPHY_USB1_CHRG_DETECT_TOG_EN_B_SHIFT (20U) -/*! EN_B - Selection of BC v1.2 Function Enable */ -#define USBPHY_USB1_CHRG_DETECT_TOG_EN_B(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_TOG_EN_B_SHIFT)) & USBPHY_USB1_CHRG_DETECT_TOG_EN_B_MASK) - -#define USBPHY_USB1_CHRG_DETECT_TOG_DCDSEL_MASK (0x80000000U) -#define USBPHY_USB1_CHRG_DETECT_TOG_DCDSEL_SHIFT (31U) -/*! DCDSEL - DCD Selection */ -#define USBPHY_USB1_CHRG_DETECT_TOG_DCDSEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DETECT_TOG_DCDSEL_SHIFT)) & USBPHY_USB1_CHRG_DETECT_TOG_DCDSEL_MASK) -/*! @} */ - -/*! @name USB1_CHRG_DET_STAT - Charger Detect Status */ -/*! @{ */ - -#define USBPHY_USB1_CHRG_DET_STAT_PLUG_CONTACT_MASK (0x1U) -#define USBPHY_USB1_CHRG_DET_STAT_PLUG_CONTACT_SHIFT (0U) -/*! PLUG_CONTACT - Battery Charging Data Contact Detection Phase Output - * 0b0..Not detected - * 0b1..Detected - */ -#define USBPHY_USB1_CHRG_DET_STAT_PLUG_CONTACT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_PLUG_CONTACT_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_PLUG_CONTACT_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_CHRG_DETECTED_MASK (0x2U) -#define USBPHY_USB1_CHRG_DET_STAT_CHRG_DETECTED_SHIFT (1U) -/*! CHRG_DETECTED - Battery Charging Primary Detection Phase Output - * 0b0..SDP detected - * 0b1..Charging port detected - */ -#define USBPHY_USB1_CHRG_DET_STAT_CHRG_DETECTED(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_CHRG_DETECTED_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_CHRG_DETECTED_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_DM_STATE_MASK (0x4U) -#define USBPHY_USB1_CHRG_DET_STAT_DM_STATE_SHIFT (2U) -/*! DM_STATE - DM Voltage - * 0b0..USB_DM pin voltage is <= 0.8 V - * 0b1..USB_DM pin voltage is >= 2.0 V - */ -#define USBPHY_USB1_CHRG_DET_STAT_DM_STATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_DM_STATE_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_DM_STATE_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_DP_STATE_MASK (0x8U) -#define USBPHY_USB1_CHRG_DET_STAT_DP_STATE_SHIFT (3U) -/*! DP_STATE - DP Voltage - * 0b0..USB_DP pin voltage is <= 0.8 V - * 0b1..USB_DP pin voltage is >= 2.0 V - */ -#define USBPHY_USB1_CHRG_DET_STAT_DP_STATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_DP_STATE_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_DP_STATE_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_SECDET_DCP_MASK (0x10U) -#define USBPHY_USB1_CHRG_DET_STAT_SECDET_DCP_SHIFT (4U) -/*! SECDET_DCP - Battery Charging Secondary Detection Phase Output - * 0b0..CDP detected - * 0b1..DCP detected - */ -#define USBPHY_USB1_CHRG_DET_STAT_SECDET_DCP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_SECDET_DCP_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_SECDET_DCP_MASK) -/*! @} */ - -/*! @name USB1_CHRG_DET_STAT_SET - Charger Detect Status */ -/*! @{ */ - -#define USBPHY_USB1_CHRG_DET_STAT_SET_PLUG_CONTACT_MASK (0x1U) -#define USBPHY_USB1_CHRG_DET_STAT_SET_PLUG_CONTACT_SHIFT (0U) -/*! PLUG_CONTACT - Battery Charging Data Contact Detection Phase Output */ -#define USBPHY_USB1_CHRG_DET_STAT_SET_PLUG_CONTACT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_SET_PLUG_CONTACT_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_SET_PLUG_CONTACT_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_SET_CHRG_DETECTED_MASK (0x2U) -#define USBPHY_USB1_CHRG_DET_STAT_SET_CHRG_DETECTED_SHIFT (1U) -/*! CHRG_DETECTED - Battery Charging Primary Detection Phase Output */ -#define USBPHY_USB1_CHRG_DET_STAT_SET_CHRG_DETECTED(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_SET_CHRG_DETECTED_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_SET_CHRG_DETECTED_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_SET_DM_STATE_MASK (0x4U) -#define USBPHY_USB1_CHRG_DET_STAT_SET_DM_STATE_SHIFT (2U) -/*! DM_STATE - DM Voltage */ -#define USBPHY_USB1_CHRG_DET_STAT_SET_DM_STATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_SET_DM_STATE_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_SET_DM_STATE_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_SET_DP_STATE_MASK (0x8U) -#define USBPHY_USB1_CHRG_DET_STAT_SET_DP_STATE_SHIFT (3U) -/*! DP_STATE - DP Voltage */ -#define USBPHY_USB1_CHRG_DET_STAT_SET_DP_STATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_SET_DP_STATE_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_SET_DP_STATE_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_SET_SECDET_DCP_MASK (0x10U) -#define USBPHY_USB1_CHRG_DET_STAT_SET_SECDET_DCP_SHIFT (4U) -/*! SECDET_DCP - Battery Charging Secondary Detection Phase Output */ -#define USBPHY_USB1_CHRG_DET_STAT_SET_SECDET_DCP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_SET_SECDET_DCP_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_SET_SECDET_DCP_MASK) -/*! @} */ - -/*! @name USB1_CHRG_DET_STAT_CLR - Charger Detect Status */ -/*! @{ */ - -#define USBPHY_USB1_CHRG_DET_STAT_CLR_PLUG_CONTACT_MASK (0x1U) -#define USBPHY_USB1_CHRG_DET_STAT_CLR_PLUG_CONTACT_SHIFT (0U) -/*! PLUG_CONTACT - Battery Charging Data Contact Detection Phase Output */ -#define USBPHY_USB1_CHRG_DET_STAT_CLR_PLUG_CONTACT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_CLR_PLUG_CONTACT_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_CLR_PLUG_CONTACT_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_CLR_CHRG_DETECTED_MASK (0x2U) -#define USBPHY_USB1_CHRG_DET_STAT_CLR_CHRG_DETECTED_SHIFT (1U) -/*! CHRG_DETECTED - Battery Charging Primary Detection Phase Output */ -#define USBPHY_USB1_CHRG_DET_STAT_CLR_CHRG_DETECTED(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_CLR_CHRG_DETECTED_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_CLR_CHRG_DETECTED_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_CLR_DM_STATE_MASK (0x4U) -#define USBPHY_USB1_CHRG_DET_STAT_CLR_DM_STATE_SHIFT (2U) -/*! DM_STATE - DM Voltage */ -#define USBPHY_USB1_CHRG_DET_STAT_CLR_DM_STATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_CLR_DM_STATE_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_CLR_DM_STATE_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_CLR_DP_STATE_MASK (0x8U) -#define USBPHY_USB1_CHRG_DET_STAT_CLR_DP_STATE_SHIFT (3U) -/*! DP_STATE - DP Voltage */ -#define USBPHY_USB1_CHRG_DET_STAT_CLR_DP_STATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_CLR_DP_STATE_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_CLR_DP_STATE_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_CLR_SECDET_DCP_MASK (0x10U) -#define USBPHY_USB1_CHRG_DET_STAT_CLR_SECDET_DCP_SHIFT (4U) -/*! SECDET_DCP - Battery Charging Secondary Detection Phase Output */ -#define USBPHY_USB1_CHRG_DET_STAT_CLR_SECDET_DCP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_CLR_SECDET_DCP_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_CLR_SECDET_DCP_MASK) -/*! @} */ - -/*! @name USB1_CHRG_DET_STAT_TOG - Charger Detect Status */ -/*! @{ */ - -#define USBPHY_USB1_CHRG_DET_STAT_TOG_PLUG_CONTACT_MASK (0x1U) -#define USBPHY_USB1_CHRG_DET_STAT_TOG_PLUG_CONTACT_SHIFT (0U) -/*! PLUG_CONTACT - Battery Charging Data Contact Detection Phase Output */ -#define USBPHY_USB1_CHRG_DET_STAT_TOG_PLUG_CONTACT(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_TOG_PLUG_CONTACT_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_TOG_PLUG_CONTACT_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_TOG_CHRG_DETECTED_MASK (0x2U) -#define USBPHY_USB1_CHRG_DET_STAT_TOG_CHRG_DETECTED_SHIFT (1U) -/*! CHRG_DETECTED - Battery Charging Primary Detection Phase Output */ -#define USBPHY_USB1_CHRG_DET_STAT_TOG_CHRG_DETECTED(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_TOG_CHRG_DETECTED_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_TOG_CHRG_DETECTED_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_TOG_DM_STATE_MASK (0x4U) -#define USBPHY_USB1_CHRG_DET_STAT_TOG_DM_STATE_SHIFT (2U) -/*! DM_STATE - DM Voltage */ -#define USBPHY_USB1_CHRG_DET_STAT_TOG_DM_STATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_TOG_DM_STATE_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_TOG_DM_STATE_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_TOG_DP_STATE_MASK (0x8U) -#define USBPHY_USB1_CHRG_DET_STAT_TOG_DP_STATE_SHIFT (3U) -/*! DP_STATE - DP Voltage */ -#define USBPHY_USB1_CHRG_DET_STAT_TOG_DP_STATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_TOG_DP_STATE_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_TOG_DP_STATE_MASK) - -#define USBPHY_USB1_CHRG_DET_STAT_TOG_SECDET_DCP_MASK (0x10U) -#define USBPHY_USB1_CHRG_DET_STAT_TOG_SECDET_DCP_SHIFT (4U) -/*! SECDET_DCP - Battery Charging Secondary Detection Phase Output */ -#define USBPHY_USB1_CHRG_DET_STAT_TOG_SECDET_DCP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_USB1_CHRG_DET_STAT_TOG_SECDET_DCP_SHIFT)) & USBPHY_USB1_CHRG_DET_STAT_TOG_SECDET_DCP_MASK) -/*! @} */ - -/*! @name ANACTRL - Analog Control */ -/*! @{ */ - -#define USBPHY_ANACTRL_LVI_EN_MASK (0x2U) -#define USBPHY_ANACTRL_LVI_EN_SHIFT (1U) -/*! LVI_EN - Internal Low Voltage Detector Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_ANACTRL_LVI_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_LVI_EN_SHIFT)) & USBPHY_ANACTRL_LVI_EN_MASK) - -#define USBPHY_ANACTRL_PFD_CLK_SEL_MASK (0xCU) -#define USBPHY_ANACTRL_PFD_CLK_SEL_SHIFT (2U) -/*! PFD_CLK_SEL - PFD Clock Selection - * 0b00..USB1PFDCLK = USB PLL reference clock - * 0b01..USB1PFDCLK = pfd_clk / 4 - * 0b10..USB1PFDCLK frequency = pfd_clk / 2 - * 0b11..USB1PFDCLK = pfd_clk - */ -#define USBPHY_ANACTRL_PFD_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_PFD_CLK_SEL_SHIFT)) & USBPHY_ANACTRL_PFD_CLK_SEL_MASK) - -#define USBPHY_ANACTRL_DEV_PULLDOWN_MASK (0x400U) -#define USBPHY_ANACTRL_DEV_PULLDOWN_SHIFT (10U) -/*! DEV_PULLDOWN - Device Pulldown Enable - * 0b0..Disable - * 0b1..Enable - */ -#define USBPHY_ANACTRL_DEV_PULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_DEV_PULLDOWN_SHIFT)) & USBPHY_ANACTRL_DEV_PULLDOWN_MASK) -/*! @} */ - -/*! @name ANACTRL_SET - Analog Control */ -/*! @{ */ - -#define USBPHY_ANACTRL_SET_LVI_EN_MASK (0x2U) -#define USBPHY_ANACTRL_SET_LVI_EN_SHIFT (1U) -/*! LVI_EN - Internal Low Voltage Detector Enable */ -#define USBPHY_ANACTRL_SET_LVI_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_SET_LVI_EN_SHIFT)) & USBPHY_ANACTRL_SET_LVI_EN_MASK) - -#define USBPHY_ANACTRL_SET_PFD_CLK_SEL_MASK (0xCU) -#define USBPHY_ANACTRL_SET_PFD_CLK_SEL_SHIFT (2U) -/*! PFD_CLK_SEL - PFD Clock Selection */ -#define USBPHY_ANACTRL_SET_PFD_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_SET_PFD_CLK_SEL_SHIFT)) & USBPHY_ANACTRL_SET_PFD_CLK_SEL_MASK) - -#define USBPHY_ANACTRL_SET_DEV_PULLDOWN_MASK (0x400U) -#define USBPHY_ANACTRL_SET_DEV_PULLDOWN_SHIFT (10U) -/*! DEV_PULLDOWN - Device Pulldown Enable */ -#define USBPHY_ANACTRL_SET_DEV_PULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_SET_DEV_PULLDOWN_SHIFT)) & USBPHY_ANACTRL_SET_DEV_PULLDOWN_MASK) -/*! @} */ - -/*! @name ANACTRL_CLR - Analog Control */ -/*! @{ */ - -#define USBPHY_ANACTRL_CLR_LVI_EN_MASK (0x2U) -#define USBPHY_ANACTRL_CLR_LVI_EN_SHIFT (1U) -/*! LVI_EN - Internal Low Voltage Detector Enable */ -#define USBPHY_ANACTRL_CLR_LVI_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_CLR_LVI_EN_SHIFT)) & USBPHY_ANACTRL_CLR_LVI_EN_MASK) - -#define USBPHY_ANACTRL_CLR_PFD_CLK_SEL_MASK (0xCU) -#define USBPHY_ANACTRL_CLR_PFD_CLK_SEL_SHIFT (2U) -/*! PFD_CLK_SEL - PFD Clock Selection */ -#define USBPHY_ANACTRL_CLR_PFD_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_CLR_PFD_CLK_SEL_SHIFT)) & USBPHY_ANACTRL_CLR_PFD_CLK_SEL_MASK) - -#define USBPHY_ANACTRL_CLR_DEV_PULLDOWN_MASK (0x400U) -#define USBPHY_ANACTRL_CLR_DEV_PULLDOWN_SHIFT (10U) -/*! DEV_PULLDOWN - Device Pulldown Enable */ -#define USBPHY_ANACTRL_CLR_DEV_PULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_CLR_DEV_PULLDOWN_SHIFT)) & USBPHY_ANACTRL_CLR_DEV_PULLDOWN_MASK) -/*! @} */ - -/*! @name ANACTRL_TOG - Analog Control */ -/*! @{ */ - -#define USBPHY_ANACTRL_TOG_LVI_EN_MASK (0x2U) -#define USBPHY_ANACTRL_TOG_LVI_EN_SHIFT (1U) -/*! LVI_EN - Internal Low Voltage Detector Enable */ -#define USBPHY_ANACTRL_TOG_LVI_EN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_TOG_LVI_EN_SHIFT)) & USBPHY_ANACTRL_TOG_LVI_EN_MASK) - -#define USBPHY_ANACTRL_TOG_PFD_CLK_SEL_MASK (0xCU) -#define USBPHY_ANACTRL_TOG_PFD_CLK_SEL_SHIFT (2U) -/*! PFD_CLK_SEL - PFD Clock Selection */ -#define USBPHY_ANACTRL_TOG_PFD_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_TOG_PFD_CLK_SEL_SHIFT)) & USBPHY_ANACTRL_TOG_PFD_CLK_SEL_MASK) - -#define USBPHY_ANACTRL_TOG_DEV_PULLDOWN_MASK (0x400U) -#define USBPHY_ANACTRL_TOG_DEV_PULLDOWN_SHIFT (10U) -/*! DEV_PULLDOWN - Device Pulldown Enable */ -#define USBPHY_ANACTRL_TOG_DEV_PULLDOWN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_ANACTRL_TOG_DEV_PULLDOWN_SHIFT)) & USBPHY_ANACTRL_TOG_DEV_PULLDOWN_MASK) -/*! @} */ - -/*! @name TRIM_OVERRIDE_EN - Trim */ -/*! @{ */ - -#define USBPHY_TRIM_OVERRIDE_EN_DIV_SEL_OVERRIDE_MASK (0x1U) -#define USBPHY_TRIM_OVERRIDE_EN_DIV_SEL_OVERRIDE_SHIFT (0U) -/*! DIV_SEL_OVERRIDE - Override Enable for PLL Divider Value - * 0b0..TRIM_OVERRIDE_EN - * 0b1..PLL_SIC - */ -#define USBPHY_TRIM_OVERRIDE_EN_DIV_SEL_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_DIV_SEL_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_DIV_SEL_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_TX_D_CAL_OVERRIDE_MASK (0x4U) -#define USBPHY_TRIM_OVERRIDE_EN_TX_D_CAL_OVERRIDE_SHIFT (2U) -/*! TX_D_CAL_OVERRIDE - Override Enable for HS TX Output Current Trim - * 0b0..TRIM_OVERRIDE_EN - * 0b1..TX - */ -#define USBPHY_TRIM_OVERRIDE_EN_TX_D_CAL_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TX_D_CAL_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TX_D_CAL_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_TX_CAL45DP_OVERRIDE_MASK (0x8U) -#define USBPHY_TRIM_OVERRIDE_EN_TX_CAL45DP_OVERRIDE_SHIFT (3U) -/*! TX_CAL45DP_OVERRIDE - Override Enable for USB_DP Series Termination Trim - * 0b0..TRIM_OVERRIDE_EN - * 0b1..TX - */ -#define USBPHY_TRIM_OVERRIDE_EN_TX_CAL45DP_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TX_CAL45DP_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TX_CAL45DP_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_TX_CAL45DM_OVERRIDE_MASK (0x10U) -#define USBPHY_TRIM_OVERRIDE_EN_TX_CAL45DM_OVERRIDE_SHIFT (4U) -/*! TX_CAL45DM_OVERRIDE - Override Enable for USB_DM Series Termination Trim - * 0b0..TRIM_OVERRIDE_EN - * 0b1..TX - */ -#define USBPHY_TRIM_OVERRIDE_EN_TX_CAL45DM_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TX_CAL45DM_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TX_CAL45DM_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_PLL_CTRL0_DIV_SEL_MASK (0x38000U) -#define USBPHY_TRIM_OVERRIDE_EN_PLL_CTRL0_DIV_SEL_SHIFT (15U) -/*! PLL_CTRL0_DIV_SEL - PLL Divider Value Configuration Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_PLL_CTRL0_DIV_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_PLL_CTRL0_DIV_SEL_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_PLL_CTRL0_DIV_SEL_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_D_CAL_MASK (0xF00000U) -#define USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_D_CAL_SHIFT (20U) -/*! USBPHY_TX_D_CAL - HS TX Output Current Trim Bits from Outside USBPHY - * 0b0000..Maximum current, approximately 19% above nominal - * 0b0111..Nominal - * 0b1111..Minimum current, approximately 19% below nominal - */ -#define USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_D_CAL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_D_CAL_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_D_CAL_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_CAL45DP_MASK (0xF000000U) -#define USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_CAL45DP_SHIFT (24U) -/*! USBPHY_TX_CAL45DP - DP Series Termination Resistance Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_CAL45DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_CAL45DP_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_CAL45DP_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_CAL45DN_MASK (0xF0000000U) -#define USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_CAL45DN_SHIFT (28U) -/*! USBPHY_TX_CAL45DN - DM Series Termination Resistance Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_CAL45DN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_CAL45DN_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_USBPHY_TX_CAL45DN_MASK) -/*! @} */ - -/*! @name TRIM_OVERRIDE_EN_SET - Trim */ -/*! @{ */ - -#define USBPHY_TRIM_OVERRIDE_EN_SET_DIV_SEL_OVERRIDE_MASK (0x1U) -#define USBPHY_TRIM_OVERRIDE_EN_SET_DIV_SEL_OVERRIDE_SHIFT (0U) -/*! DIV_SEL_OVERRIDE - Override Enable for PLL Divider Value */ -#define USBPHY_TRIM_OVERRIDE_EN_SET_DIV_SEL_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_SET_DIV_SEL_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_SET_DIV_SEL_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_SET_TX_D_CAL_OVERRIDE_MASK (0x4U) -#define USBPHY_TRIM_OVERRIDE_EN_SET_TX_D_CAL_OVERRIDE_SHIFT (2U) -/*! TX_D_CAL_OVERRIDE - Override Enable for HS TX Output Current Trim */ -#define USBPHY_TRIM_OVERRIDE_EN_SET_TX_D_CAL_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_SET_TX_D_CAL_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_SET_TX_D_CAL_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_SET_TX_CAL45DP_OVERRIDE_MASK (0x8U) -#define USBPHY_TRIM_OVERRIDE_EN_SET_TX_CAL45DP_OVERRIDE_SHIFT (3U) -/*! TX_CAL45DP_OVERRIDE - Override Enable for USB_DP Series Termination Trim */ -#define USBPHY_TRIM_OVERRIDE_EN_SET_TX_CAL45DP_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_SET_TX_CAL45DP_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_SET_TX_CAL45DP_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_SET_TX_CAL45DM_OVERRIDE_MASK (0x10U) -#define USBPHY_TRIM_OVERRIDE_EN_SET_TX_CAL45DM_OVERRIDE_SHIFT (4U) -/*! TX_CAL45DM_OVERRIDE - Override Enable for USB_DM Series Termination Trim */ -#define USBPHY_TRIM_OVERRIDE_EN_SET_TX_CAL45DM_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_SET_TX_CAL45DM_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_SET_TX_CAL45DM_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_SET_PLL_CTRL0_DIV_SEL_MASK (0x38000U) -#define USBPHY_TRIM_OVERRIDE_EN_SET_PLL_CTRL0_DIV_SEL_SHIFT (15U) -/*! PLL_CTRL0_DIV_SEL - PLL Divider Value Configuration Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_SET_PLL_CTRL0_DIV_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_SET_PLL_CTRL0_DIV_SEL_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_SET_PLL_CTRL0_DIV_SEL_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_D_CAL_MASK (0xF00000U) -#define USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_D_CAL_SHIFT (20U) -/*! USBPHY_TX_D_CAL - HS TX Output Current Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_D_CAL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_D_CAL_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_D_CAL_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_CAL45DP_MASK (0xF000000U) -#define USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_CAL45DP_SHIFT (24U) -/*! USBPHY_TX_CAL45DP - DP Series Termination Resistance Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_CAL45DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_CAL45DP_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_CAL45DP_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_CAL45DN_MASK (0xF0000000U) -#define USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_CAL45DN_SHIFT (28U) -/*! USBPHY_TX_CAL45DN - DM Series Termination Resistance Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_CAL45DN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_CAL45DN_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_SET_USBPHY_TX_CAL45DN_MASK) -/*! @} */ - -/*! @name TRIM_OVERRIDE_EN_CLR - Trim */ -/*! @{ */ - -#define USBPHY_TRIM_OVERRIDE_EN_CLR_DIV_SEL_OVERRIDE_MASK (0x1U) -#define USBPHY_TRIM_OVERRIDE_EN_CLR_DIV_SEL_OVERRIDE_SHIFT (0U) -/*! DIV_SEL_OVERRIDE - Override Enable for PLL Divider Value */ -#define USBPHY_TRIM_OVERRIDE_EN_CLR_DIV_SEL_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_CLR_DIV_SEL_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_CLR_DIV_SEL_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_CLR_TX_D_CAL_OVERRIDE_MASK (0x4U) -#define USBPHY_TRIM_OVERRIDE_EN_CLR_TX_D_CAL_OVERRIDE_SHIFT (2U) -/*! TX_D_CAL_OVERRIDE - Override Enable for HS TX Output Current Trim */ -#define USBPHY_TRIM_OVERRIDE_EN_CLR_TX_D_CAL_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_CLR_TX_D_CAL_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_CLR_TX_D_CAL_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_CLR_TX_CAL45DP_OVERRIDE_MASK (0x8U) -#define USBPHY_TRIM_OVERRIDE_EN_CLR_TX_CAL45DP_OVERRIDE_SHIFT (3U) -/*! TX_CAL45DP_OVERRIDE - Override Enable for USB_DP Series Termination Trim */ -#define USBPHY_TRIM_OVERRIDE_EN_CLR_TX_CAL45DP_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_CLR_TX_CAL45DP_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_CLR_TX_CAL45DP_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_CLR_TX_CAL45DM_OVERRIDE_MASK (0x10U) -#define USBPHY_TRIM_OVERRIDE_EN_CLR_TX_CAL45DM_OVERRIDE_SHIFT (4U) -/*! TX_CAL45DM_OVERRIDE - Override Enable for USB_DM Series Termination Trim */ -#define USBPHY_TRIM_OVERRIDE_EN_CLR_TX_CAL45DM_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_CLR_TX_CAL45DM_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_CLR_TX_CAL45DM_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_CLR_PLL_CTRL0_DIV_SEL_MASK (0x38000U) -#define USBPHY_TRIM_OVERRIDE_EN_CLR_PLL_CTRL0_DIV_SEL_SHIFT (15U) -/*! PLL_CTRL0_DIV_SEL - PLL Divider Value Configuration Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_CLR_PLL_CTRL0_DIV_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_CLR_PLL_CTRL0_DIV_SEL_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_CLR_PLL_CTRL0_DIV_SEL_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_D_CAL_MASK (0xF00000U) -#define USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_D_CAL_SHIFT (20U) -/*! USBPHY_TX_D_CAL - HS TX Output Current Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_D_CAL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_D_CAL_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_D_CAL_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_CAL45DP_MASK (0xF000000U) -#define USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_CAL45DP_SHIFT (24U) -/*! USBPHY_TX_CAL45DP - DP Series Termination Resistance Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_CAL45DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_CAL45DP_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_CAL45DP_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_CAL45DN_MASK (0xF0000000U) -#define USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_CAL45DN_SHIFT (28U) -/*! USBPHY_TX_CAL45DN - DM Series Termination Resistance Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_CAL45DN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_CAL45DN_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_CLR_USBPHY_TX_CAL45DN_MASK) -/*! @} */ - -/*! @name TRIM_OVERRIDE_EN_TOG - Trim */ -/*! @{ */ - -#define USBPHY_TRIM_OVERRIDE_EN_TOG_DIV_SEL_OVERRIDE_MASK (0x1U) -#define USBPHY_TRIM_OVERRIDE_EN_TOG_DIV_SEL_OVERRIDE_SHIFT (0U) -/*! DIV_SEL_OVERRIDE - Override Enable for PLL Divider Value */ -#define USBPHY_TRIM_OVERRIDE_EN_TOG_DIV_SEL_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TOG_DIV_SEL_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TOG_DIV_SEL_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_TOG_TX_D_CAL_OVERRIDE_MASK (0x4U) -#define USBPHY_TRIM_OVERRIDE_EN_TOG_TX_D_CAL_OVERRIDE_SHIFT (2U) -/*! TX_D_CAL_OVERRIDE - Override Enable for HS TX Output Current Trim */ -#define USBPHY_TRIM_OVERRIDE_EN_TOG_TX_D_CAL_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TOG_TX_D_CAL_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TOG_TX_D_CAL_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_TOG_TX_CAL45DP_OVERRIDE_MASK (0x8U) -#define USBPHY_TRIM_OVERRIDE_EN_TOG_TX_CAL45DP_OVERRIDE_SHIFT (3U) -/*! TX_CAL45DP_OVERRIDE - Override Enable for USB_DP Series Termination Trim */ -#define USBPHY_TRIM_OVERRIDE_EN_TOG_TX_CAL45DP_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TOG_TX_CAL45DP_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TOG_TX_CAL45DP_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_TOG_TX_CAL45DM_OVERRIDE_MASK (0x10U) -#define USBPHY_TRIM_OVERRIDE_EN_TOG_TX_CAL45DM_OVERRIDE_SHIFT (4U) -/*! TX_CAL45DM_OVERRIDE - Override Enable for USB_DM Series Termination Trim */ -#define USBPHY_TRIM_OVERRIDE_EN_TOG_TX_CAL45DM_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TOG_TX_CAL45DM_OVERRIDE_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TOG_TX_CAL45DM_OVERRIDE_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_TOG_PLL_CTRL0_DIV_SEL_MASK (0x38000U) -#define USBPHY_TRIM_OVERRIDE_EN_TOG_PLL_CTRL0_DIV_SEL_SHIFT (15U) -/*! PLL_CTRL0_DIV_SEL - PLL Divider Value Configuration Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_TOG_PLL_CTRL0_DIV_SEL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TOG_PLL_CTRL0_DIV_SEL_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TOG_PLL_CTRL0_DIV_SEL_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_D_CAL_MASK (0xF00000U) -#define USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_D_CAL_SHIFT (20U) -/*! USBPHY_TX_D_CAL - HS TX Output Current Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_D_CAL(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_D_CAL_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_D_CAL_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_CAL45DP_MASK (0xF000000U) -#define USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_CAL45DP_SHIFT (24U) -/*! USBPHY_TX_CAL45DP - DP Series Termination Resistance Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_CAL45DP(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_CAL45DP_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_CAL45DP_MASK) - -#define USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_CAL45DN_MASK (0xF0000000U) -#define USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_CAL45DN_SHIFT (28U) -/*! USBPHY_TX_CAL45DN - DM Series Termination Resistance Trim Bits from Outside USBPHY */ -#define USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_CAL45DN(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_CAL45DN_SHIFT)) & USBPHY_TRIM_OVERRIDE_EN_TOG_USBPHY_TX_CAL45DN_MASK) -/*! @} */ - -/*! @name PFDA - PFD A */ -/*! @{ */ - -#define USBPHY_PFDA_PFD0_CLKGATE_MASK (0x1U) -#define USBPHY_PFDA_PFD0_CLKGATE_SHIFT (0U) -/*! PFD0_CLKGATE - PFD0 Clock Gate - * 0b0..Enable - * 0b1..Disable - */ -#define USBPHY_PFDA_PFD0_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_PFD0_CLKGATE_SHIFT)) & USBPHY_PFDA_PFD0_CLKGATE_MASK) - -#define USBPHY_PFDA_PFD0_FRAC_MASK (0x7EU) -#define USBPHY_PFDA_PFD0_FRAC_SHIFT (1U) -/*! PFD0_FRAC - PFD0 Fractional Divider */ -#define USBPHY_PFDA_PFD0_FRAC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_PFD0_FRAC_SHIFT)) & USBPHY_PFDA_PFD0_FRAC_MASK) - -#define USBPHY_PFDA_PFD0_STABLE_MASK (0x80U) -#define USBPHY_PFDA_PFD0_STABLE_SHIFT (7U) -/*! PFD0_STABLE - PFD0 Stable Signal - * 0b0..Not stable - * 0b1..Stable - */ -#define USBPHY_PFDA_PFD0_STABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_PFD0_STABLE_SHIFT)) & USBPHY_PFDA_PFD0_STABLE_MASK) -/*! @} */ - -/*! @name PFDA_SET - PFD A */ -/*! @{ */ - -#define USBPHY_PFDA_SET_PFD0_CLKGATE_MASK (0x1U) -#define USBPHY_PFDA_SET_PFD0_CLKGATE_SHIFT (0U) -/*! PFD0_CLKGATE - PFD0 Clock Gate */ -#define USBPHY_PFDA_SET_PFD0_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_SET_PFD0_CLKGATE_SHIFT)) & USBPHY_PFDA_SET_PFD0_CLKGATE_MASK) - -#define USBPHY_PFDA_SET_PFD0_FRAC_MASK (0x7EU) -#define USBPHY_PFDA_SET_PFD0_FRAC_SHIFT (1U) -/*! PFD0_FRAC - PFD0 Fractional Divider */ -#define USBPHY_PFDA_SET_PFD0_FRAC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_SET_PFD0_FRAC_SHIFT)) & USBPHY_PFDA_SET_PFD0_FRAC_MASK) - -#define USBPHY_PFDA_SET_PFD0_STABLE_MASK (0x80U) -#define USBPHY_PFDA_SET_PFD0_STABLE_SHIFT (7U) -/*! PFD0_STABLE - PFD0 Stable Signal */ -#define USBPHY_PFDA_SET_PFD0_STABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_SET_PFD0_STABLE_SHIFT)) & USBPHY_PFDA_SET_PFD0_STABLE_MASK) -/*! @} */ - -/*! @name PFDA_CLR - PFD A */ -/*! @{ */ - -#define USBPHY_PFDA_CLR_PFD0_CLKGATE_MASK (0x1U) -#define USBPHY_PFDA_CLR_PFD0_CLKGATE_SHIFT (0U) -/*! PFD0_CLKGATE - PFD0 Clock Gate */ -#define USBPHY_PFDA_CLR_PFD0_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_CLR_PFD0_CLKGATE_SHIFT)) & USBPHY_PFDA_CLR_PFD0_CLKGATE_MASK) - -#define USBPHY_PFDA_CLR_PFD0_FRAC_MASK (0x7EU) -#define USBPHY_PFDA_CLR_PFD0_FRAC_SHIFT (1U) -/*! PFD0_FRAC - PFD0 Fractional Divider */ -#define USBPHY_PFDA_CLR_PFD0_FRAC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_CLR_PFD0_FRAC_SHIFT)) & USBPHY_PFDA_CLR_PFD0_FRAC_MASK) - -#define USBPHY_PFDA_CLR_PFD0_STABLE_MASK (0x80U) -#define USBPHY_PFDA_CLR_PFD0_STABLE_SHIFT (7U) -/*! PFD0_STABLE - PFD0 Stable Signal */ -#define USBPHY_PFDA_CLR_PFD0_STABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_CLR_PFD0_STABLE_SHIFT)) & USBPHY_PFDA_CLR_PFD0_STABLE_MASK) -/*! @} */ - -/*! @name PFDA_TOG - PFD A */ -/*! @{ */ - -#define USBPHY_PFDA_TOG_PFD0_CLKGATE_MASK (0x1U) -#define USBPHY_PFDA_TOG_PFD0_CLKGATE_SHIFT (0U) -/*! PFD0_CLKGATE - PFD0 Clock Gate */ -#define USBPHY_PFDA_TOG_PFD0_CLKGATE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_TOG_PFD0_CLKGATE_SHIFT)) & USBPHY_PFDA_TOG_PFD0_CLKGATE_MASK) - -#define USBPHY_PFDA_TOG_PFD0_FRAC_MASK (0x7EU) -#define USBPHY_PFDA_TOG_PFD0_FRAC_SHIFT (1U) -/*! PFD0_FRAC - PFD0 Fractional Divider */ -#define USBPHY_PFDA_TOG_PFD0_FRAC(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_TOG_PFD0_FRAC_SHIFT)) & USBPHY_PFDA_TOG_PFD0_FRAC_MASK) - -#define USBPHY_PFDA_TOG_PFD0_STABLE_MASK (0x80U) -#define USBPHY_PFDA_TOG_PFD0_STABLE_SHIFT (7U) -/*! PFD0_STABLE - PFD0 Stable Signal */ -#define USBPHY_PFDA_TOG_PFD0_STABLE(x) (((uint32_t)(((uint32_t)(x)) << USBPHY_PFDA_TOG_PFD0_STABLE_SHIFT)) & USBPHY_PFDA_TOG_PFD0_STABLE_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group USBPHY_Register_Masks */ - - -/* USBPHY - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral USBPHY base address */ - #define USBPHY_BASE (0x5010A000u) - /** Peripheral USBPHY base address */ - #define USBPHY_BASE_NS (0x4010A000u) - /** Peripheral USBPHY base pointer */ - #define USBPHY ((USBPHY_Type *)USBPHY_BASE) - /** Peripheral USBPHY base pointer */ - #define USBPHY_NS ((USBPHY_Type *)USBPHY_BASE_NS) - /** Array initializer of USBPHY peripheral base addresses */ - #define USBPHY_BASE_ADDRS { USBPHY_BASE } - /** Array initializer of USBPHY peripheral base pointers */ - #define USBPHY_BASE_PTRS { USBPHY } - /** Array initializer of USBPHY peripheral base addresses */ - #define USBPHY_BASE_ADDRS_NS { USBPHY_BASE_NS } - /** Array initializer of USBPHY peripheral base pointers */ - #define USBPHY_BASE_PTRS_NS { USBPHY_NS } -#else - /** Peripheral USBPHY base address */ - #define USBPHY_BASE (0x4010A000u) - /** Peripheral USBPHY base pointer */ - #define USBPHY ((USBPHY_Type *)USBPHY_BASE) - /** Array initializer of USBPHY peripheral base addresses */ - #define USBPHY_BASE_ADDRS { USBPHY_BASE } - /** Array initializer of USBPHY peripheral base pointers */ - #define USBPHY_BASE_PTRS { USBPHY } -#endif -/** Interrupt vectors for the USBPHY peripheral type */ -#define USBPHY_IRQS { USB1_HS_PHY_IRQn } -/* Backward compatibility */ -#define USBPHY_CTRL_ENDEVPLUGINDET_MASK USBPHY_CTRL_ENDEVPLUGINDETECT_MASK -#define USBPHY_CTRL_ENDEVPLUGINDET_SHIFT USBPHY_CTRL_ENDEVPLUGINDETECT_SHIFT -#define USBPHY_CTRL_ENDEVPLUGINDET(x) USBPHY_CTRL_ENDEVPLUGINDETECT(x) -#define USBPHY_TX_TXCAL45DM_MASK USBPHY_TX_TXCAL45DN_MASK -#define USBPHY_TX_TXCAL45DM_SHIFT USBPHY_TX_TXCAL45DN_SHIFT -#define USBPHY_TX_TXCAL45DM(x) USBPHY_TX_TXCAL45DN(x) - - -/*! - * @} - */ /* end of group USBPHY_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- USDHC Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USDHC_Peripheral_Access_Layer USDHC Peripheral Access Layer - * @{ - */ - -/** USDHC - Register Layout Typedef */ -typedef struct { - __IO uint32_t DS_ADDR; /**< DMA System Address, offset: 0x0 */ - __IO uint32_t BLK_ATT; /**< Block Attributes, offset: 0x4 */ - __IO uint32_t CMD_ARG; /**< Command Argument, offset: 0x8 */ - __IO uint32_t CMD_XFR_TYP; /**< Command Transfer Type, offset: 0xC */ - __I uint32_t CMD_RSP0; /**< Command Response0, offset: 0x10 */ - __I uint32_t CMD_RSP1; /**< Command Response1, offset: 0x14 */ - __I uint32_t CMD_RSP2; /**< Command Response2, offset: 0x18 */ - __I uint32_t CMD_RSP3; /**< Command Response3, offset: 0x1C */ - __IO uint32_t DATA_BUFF_ACC_PORT; /**< Data Buffer Access Port, offset: 0x20 */ - __I uint32_t PRES_STATE; /**< Present State, offset: 0x24 */ - __IO uint32_t PROT_CTRL; /**< Protocol Control, offset: 0x28 */ - __IO uint32_t SYS_CTRL; /**< System Control, offset: 0x2C */ - __IO uint32_t INT_STATUS; /**< Interrupt Status, offset: 0x30 */ - __IO uint32_t INT_STATUS_EN; /**< Interrupt Status Enable, offset: 0x34 */ - __IO uint32_t INT_SIGNAL_EN; /**< Interrupt Signal Enable, offset: 0x38 */ - __IO uint32_t AUTOCMD12_ERR_STATUS; /**< Auto CMD12 Error Status, offset: 0x3C */ - __IO uint32_t HOST_CTRL_CAP; /**< Host Controller Capabilities, offset: 0x40 */ - __IO uint32_t WTMK_LVL; /**< Watermark Level, offset: 0x44 */ - __IO uint32_t MIX_CTRL; /**< Mixer Control, offset: 0x48 */ - uint8_t RESERVED_0[4]; - __O uint32_t FORCE_EVENT; /**< Force Event, offset: 0x50 */ - __I uint32_t ADMA_ERR_STATUS; /**< ADMA Error Status, offset: 0x54 */ - __IO uint32_t ADMA_SYS_ADDR; /**< ADMA System Address, offset: 0x58 */ - uint8_t RESERVED_1[4]; - __IO uint32_t DLL_CTRL; /**< DLL (Delay Line) Control, offset: 0x60 */ - __I uint32_t DLL_STATUS; /**< DLL Status, offset: 0x64 */ - __IO uint32_t CLK_TUNE_CTRL_STATUS; /**< CLK Tuning Control and Status, offset: 0x68 */ - uint8_t RESERVED_2[84]; - __IO uint32_t VEND_SPEC; /**< Vendor Specific Register, offset: 0xC0 */ - __IO uint32_t MMC_BOOT; /**< eMMC Boot, offset: 0xC4 */ - __IO uint32_t VEND_SPEC2; /**< Vendor Specific 2 Register, offset: 0xC8 */ - __IO uint32_t TUNING_CTRL; /**< Tuning Control, offset: 0xCC */ -} USDHC_Type; - -/* ---------------------------------------------------------------------------- - -- USDHC Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup USDHC_Register_Masks USDHC Register Masks - * @{ - */ - -/*! @name DS_ADDR - DMA System Address */ -/*! @{ */ - -#define USDHC_DS_ADDR_DS_ADDR_MASK (0xFFFFFFFFU) -#define USDHC_DS_ADDR_DS_ADDR_SHIFT (0U) -/*! DS_ADDR - System address */ -#define USDHC_DS_ADDR_DS_ADDR(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DS_ADDR_DS_ADDR_SHIFT)) & USDHC_DS_ADDR_DS_ADDR_MASK) -/*! @} */ - -/*! @name BLK_ATT - Block Attributes */ -/*! @{ */ - -#define USDHC_BLK_ATT_BLKSIZE_MASK (0x1FFFU) -#define USDHC_BLK_ATT_BLKSIZE_SHIFT (0U) -/*! BLKSIZE - Transfer block size - * 0b1000000000000..4096 bytes - * 0b0100000000000..2048 bytes - * 0b0001000000000..512 bytes - * 0b0000111111111..511 bytes - * 0b0000000000100..4 bytes - * 0b0000000000011..3 bytes - * 0b0000000000010..2 bytes - * 0b0000000000001..1 byte - * 0b0000000000000..No data transfer - */ -#define USDHC_BLK_ATT_BLKSIZE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_BLK_ATT_BLKSIZE_SHIFT)) & USDHC_BLK_ATT_BLKSIZE_MASK) - -#define USDHC_BLK_ATT_BLKCNT_MASK (0xFFFF0000U) -#define USDHC_BLK_ATT_BLKCNT_SHIFT (16U) -/*! BLKCNT - Blocks count for current transfer - * 0b1111111111111111..65535 blocks - * 0b0000000000000010..2 blocks - * 0b0000000000000001..1 block - * 0b0000000000000000..Stop count - */ -#define USDHC_BLK_ATT_BLKCNT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_BLK_ATT_BLKCNT_SHIFT)) & USDHC_BLK_ATT_BLKCNT_MASK) -/*! @} */ - -/*! @name CMD_ARG - Command Argument */ -/*! @{ */ - -#define USDHC_CMD_ARG_CMDARG_MASK (0xFFFFFFFFU) -#define USDHC_CMD_ARG_CMDARG_SHIFT (0U) -/*! CMDARG - Command argument */ -#define USDHC_CMD_ARG_CMDARG(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_ARG_CMDARG_SHIFT)) & USDHC_CMD_ARG_CMDARG_MASK) -/*! @} */ - -/*! @name CMD_XFR_TYP - Command Transfer Type */ -/*! @{ */ - -#define USDHC_CMD_XFR_TYP_DMAEN_MASK (0x1U) -#define USDHC_CMD_XFR_TYP_DMAEN_SHIFT (0U) -/*! DMAEN - DMAEN - * 0b0..Disable - * 0b1..Enable - */ -#define USDHC_CMD_XFR_TYP_DMAEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_XFR_TYP_DMAEN_SHIFT)) & USDHC_CMD_XFR_TYP_DMAEN_MASK) - -#define USDHC_CMD_XFR_TYP_BCEN_MASK (0x2U) -#define USDHC_CMD_XFR_TYP_BCEN_SHIFT (1U) -/*! BCEN - BCEN - * 0b0..Disable - * 0b1..Enable - */ -#define USDHC_CMD_XFR_TYP_BCEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_XFR_TYP_BCEN_SHIFT)) & USDHC_CMD_XFR_TYP_BCEN_MASK) - -#define USDHC_CMD_XFR_TYP_AC12EN_MASK (0x4U) -#define USDHC_CMD_XFR_TYP_AC12EN_SHIFT (2U) -/*! AC12EN - AC12EN - * 0b0..Disable - * 0b1..Enable - */ -#define USDHC_CMD_XFR_TYP_AC12EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_XFR_TYP_AC12EN_SHIFT)) & USDHC_CMD_XFR_TYP_AC12EN_MASK) - -#define USDHC_CMD_XFR_TYP_DDR_EN_MASK (0x8U) -#define USDHC_CMD_XFR_TYP_DDR_EN_SHIFT (3U) -/*! DDR_EN - DDR_EN - * 0b0..Disable - * 0b1..Enable - */ -#define USDHC_CMD_XFR_TYP_DDR_EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_XFR_TYP_DDR_EN_SHIFT)) & USDHC_CMD_XFR_TYP_DDR_EN_MASK) - -#define USDHC_CMD_XFR_TYP_DTDSEL_MASK (0x10U) -#define USDHC_CMD_XFR_TYP_DTDSEL_SHIFT (4U) -/*! DTDSEL - DTDSEL - * 0b0..Disable - * 0b1..Enable - */ -#define USDHC_CMD_XFR_TYP_DTDSEL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_XFR_TYP_DTDSEL_SHIFT)) & USDHC_CMD_XFR_TYP_DTDSEL_MASK) - -#define USDHC_CMD_XFR_TYP_MSBSEL_MASK (0x20U) -#define USDHC_CMD_XFR_TYP_MSBSEL_SHIFT (5U) -/*! MSBSEL - MSBSEL - * 0b0..Disable - * 0b1..Enable - */ -#define USDHC_CMD_XFR_TYP_MSBSEL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_XFR_TYP_MSBSEL_SHIFT)) & USDHC_CMD_XFR_TYP_MSBSEL_MASK) - -#define USDHC_CMD_XFR_TYP_NIBBLE_POS_MASK (0x40U) -#define USDHC_CMD_XFR_TYP_NIBBLE_POS_SHIFT (6U) -/*! NIBBLE_POS - NIBBLE_POS - * 0b0..Disable - * 0b1..Enable - */ -#define USDHC_CMD_XFR_TYP_NIBBLE_POS(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_XFR_TYP_NIBBLE_POS_SHIFT)) & USDHC_CMD_XFR_TYP_NIBBLE_POS_MASK) - -#define USDHC_CMD_XFR_TYP_AC23EN_MASK (0x80U) -#define USDHC_CMD_XFR_TYP_AC23EN_SHIFT (7U) -/*! AC23EN - AC23EN - * 0b0..Disable - * 0b1..Enable - */ -#define USDHC_CMD_XFR_TYP_AC23EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_XFR_TYP_AC23EN_SHIFT)) & USDHC_CMD_XFR_TYP_AC23EN_MASK) - -#define USDHC_CMD_XFR_TYP_RSPTYP_MASK (0x30000U) -#define USDHC_CMD_XFR_TYP_RSPTYP_SHIFT (16U) -/*! RSPTYP - Response type select - * 0b00..No response - * 0b01..Response length 136 - * 0b10..Response length 48 - * 0b11..Response length 48, check busy after response - */ -#define USDHC_CMD_XFR_TYP_RSPTYP(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_XFR_TYP_RSPTYP_SHIFT)) & USDHC_CMD_XFR_TYP_RSPTYP_MASK) - -#define USDHC_CMD_XFR_TYP_CCCEN_MASK (0x80000U) -#define USDHC_CMD_XFR_TYP_CCCEN_SHIFT (19U) -/*! CCCEN - Command CRC check enable - * 0b1..Enables command CRC check - * 0b0..Disables command CRC check - */ -#define USDHC_CMD_XFR_TYP_CCCEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_XFR_TYP_CCCEN_SHIFT)) & USDHC_CMD_XFR_TYP_CCCEN_MASK) - -#define USDHC_CMD_XFR_TYP_CICEN_MASK (0x100000U) -#define USDHC_CMD_XFR_TYP_CICEN_SHIFT (20U) -/*! CICEN - Command index check enable - * 0b1..Enables command index check - * 0b0..Disable command index check - */ -#define USDHC_CMD_XFR_TYP_CICEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_XFR_TYP_CICEN_SHIFT)) & USDHC_CMD_XFR_TYP_CICEN_MASK) - -#define USDHC_CMD_XFR_TYP_DPSEL_MASK (0x200000U) -#define USDHC_CMD_XFR_TYP_DPSEL_SHIFT (21U) -/*! DPSEL - Data present select - * 0b1..Data present - * 0b0..No data present - */ -#define USDHC_CMD_XFR_TYP_DPSEL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_XFR_TYP_DPSEL_SHIFT)) & USDHC_CMD_XFR_TYP_DPSEL_MASK) - -#define USDHC_CMD_XFR_TYP_CMDTYP_MASK (0xC00000U) -#define USDHC_CMD_XFR_TYP_CMDTYP_SHIFT (22U) -/*! CMDTYP - Command type - * 0b11..Abort CMD12, CMD52 for writing I/O Abort in CCCR - * 0b10..Resume CMD52 for writing function select in CCCR - * 0b01..Suspend CMD52 for writing bus suspend in CCCR - * 0b00..Normal other commands - */ -#define USDHC_CMD_XFR_TYP_CMDTYP(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_XFR_TYP_CMDTYP_SHIFT)) & USDHC_CMD_XFR_TYP_CMDTYP_MASK) - -#define USDHC_CMD_XFR_TYP_CMDINX_MASK (0x3F000000U) -#define USDHC_CMD_XFR_TYP_CMDINX_SHIFT (24U) -/*! CMDINX - Command index */ -#define USDHC_CMD_XFR_TYP_CMDINX(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_XFR_TYP_CMDINX_SHIFT)) & USDHC_CMD_XFR_TYP_CMDINX_MASK) -/*! @} */ - -/*! @name CMD_RSP0 - Command Response0 */ -/*! @{ */ - -#define USDHC_CMD_RSP0_CMDRSP0_MASK (0xFFFFFFFFU) -#define USDHC_CMD_RSP0_CMDRSP0_SHIFT (0U) -/*! CMDRSP0 - Command response 0 */ -#define USDHC_CMD_RSP0_CMDRSP0(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_RSP0_CMDRSP0_SHIFT)) & USDHC_CMD_RSP0_CMDRSP0_MASK) -/*! @} */ - -/*! @name CMD_RSP1 - Command Response1 */ -/*! @{ */ - -#define USDHC_CMD_RSP1_CMDRSP1_MASK (0xFFFFFFFFU) -#define USDHC_CMD_RSP1_CMDRSP1_SHIFT (0U) -/*! CMDRSP1 - Command response 1 */ -#define USDHC_CMD_RSP1_CMDRSP1(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_RSP1_CMDRSP1_SHIFT)) & USDHC_CMD_RSP1_CMDRSP1_MASK) -/*! @} */ - -/*! @name CMD_RSP2 - Command Response2 */ -/*! @{ */ - -#define USDHC_CMD_RSP2_CMDRSP2_MASK (0xFFFFFFFFU) -#define USDHC_CMD_RSP2_CMDRSP2_SHIFT (0U) -/*! CMDRSP2 - Command response 2 */ -#define USDHC_CMD_RSP2_CMDRSP2(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_RSP2_CMDRSP2_SHIFT)) & USDHC_CMD_RSP2_CMDRSP2_MASK) -/*! @} */ - -/*! @name CMD_RSP3 - Command Response3 */ -/*! @{ */ - -#define USDHC_CMD_RSP3_CMDRSP3_MASK (0xFFFFFFFFU) -#define USDHC_CMD_RSP3_CMDRSP3_SHIFT (0U) -/*! CMDRSP3 - Command response 3 */ -#define USDHC_CMD_RSP3_CMDRSP3(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CMD_RSP3_CMDRSP3_SHIFT)) & USDHC_CMD_RSP3_CMDRSP3_MASK) -/*! @} */ - -/*! @name DATA_BUFF_ACC_PORT - Data Buffer Access Port */ -/*! @{ */ - -#define USDHC_DATA_BUFF_ACC_PORT_DATCONT_MASK (0xFFFFFFFFU) -#define USDHC_DATA_BUFF_ACC_PORT_DATCONT_SHIFT (0U) -/*! DATCONT - Data content */ -#define USDHC_DATA_BUFF_ACC_PORT_DATCONT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DATA_BUFF_ACC_PORT_DATCONT_SHIFT)) & USDHC_DATA_BUFF_ACC_PORT_DATCONT_MASK) -/*! @} */ - -/*! @name PRES_STATE - Present State */ -/*! @{ */ - -#define USDHC_PRES_STATE_CIHB_MASK (0x1U) -#define USDHC_PRES_STATE_CIHB_SHIFT (0U) -/*! CIHB - Command inhibit (CMD) - * 0b1..Cannot issue command - * 0b0..Can issue command using only CMD line - */ -#define USDHC_PRES_STATE_CIHB(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PRES_STATE_CIHB_SHIFT)) & USDHC_PRES_STATE_CIHB_MASK) - -#define USDHC_PRES_STATE_CDIHB_MASK (0x2U) -#define USDHC_PRES_STATE_CDIHB_SHIFT (1U) -/*! CDIHB - Command Inhibit Data (DATA) - * 0b1..Cannot issue command that uses the DATA line - * 0b0..Can issue command that uses the DATA line - */ -#define USDHC_PRES_STATE_CDIHB(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PRES_STATE_CDIHB_SHIFT)) & USDHC_PRES_STATE_CDIHB_MASK) - -#define USDHC_PRES_STATE_DLA_MASK (0x4U) -#define USDHC_PRES_STATE_DLA_SHIFT (2U) -/*! DLA - Data line active - * 0b1..DATA line active - * 0b0..DATA line inactive - */ -#define USDHC_PRES_STATE_DLA(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PRES_STATE_DLA_SHIFT)) & USDHC_PRES_STATE_DLA_MASK) - -#define USDHC_PRES_STATE_SDSTB_MASK (0x8U) -#define USDHC_PRES_STATE_SDSTB_SHIFT (3U) -/*! SDSTB - SD clock stable - * 0b1..Clock is stable. - * 0b0..Clock is changing frequency and not stable. - */ -#define USDHC_PRES_STATE_SDSTB(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PRES_STATE_SDSTB_SHIFT)) & USDHC_PRES_STATE_SDSTB_MASK) - -#define USDHC_PRES_STATE_WTA_MASK (0x100U) -#define USDHC_PRES_STATE_WTA_SHIFT (8U) -/*! WTA - Write transfer active - * 0b1..Transferring data - * 0b0..No valid data - */ -#define USDHC_PRES_STATE_WTA(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PRES_STATE_WTA_SHIFT)) & USDHC_PRES_STATE_WTA_MASK) - -#define USDHC_PRES_STATE_RTA_MASK (0x200U) -#define USDHC_PRES_STATE_RTA_SHIFT (9U) -/*! RTA - Read transfer active - * 0b1..Transferring data - * 0b0..No valid data - */ -#define USDHC_PRES_STATE_RTA(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PRES_STATE_RTA_SHIFT)) & USDHC_PRES_STATE_RTA_MASK) - -#define USDHC_PRES_STATE_BWEN_MASK (0x400U) -#define USDHC_PRES_STATE_BWEN_SHIFT (10U) -/*! BWEN - Buffer write enable - * 0b1..Write enable - * 0b0..Write disable - */ -#define USDHC_PRES_STATE_BWEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PRES_STATE_BWEN_SHIFT)) & USDHC_PRES_STATE_BWEN_MASK) - -#define USDHC_PRES_STATE_BREN_MASK (0x800U) -#define USDHC_PRES_STATE_BREN_SHIFT (11U) -/*! BREN - Buffer read enable - * 0b1..Read enable - * 0b0..Read disable - */ -#define USDHC_PRES_STATE_BREN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PRES_STATE_BREN_SHIFT)) & USDHC_PRES_STATE_BREN_MASK) - -#define USDHC_PRES_STATE_RTR_MASK (0x1000U) -#define USDHC_PRES_STATE_RTR_SHIFT (12U) -/*! RTR - Re-Tuning Request (only for SD3.0 SDR104 mode) - * 0b1..Sampling clock needs re-tuning - * 0b0..Fixed or well tuned sampling clock - */ -#define USDHC_PRES_STATE_RTR(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PRES_STATE_RTR_SHIFT)) & USDHC_PRES_STATE_RTR_MASK) - -#define USDHC_PRES_STATE_TSCD_MASK (0x8000U) -#define USDHC_PRES_STATE_TSCD_SHIFT (15U) -/*! TSCD - Tap select change done - * 0b1..Delay cell select change is finished. - * 0b0..Delay cell select change is not finished. - */ -#define USDHC_PRES_STATE_TSCD(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PRES_STATE_TSCD_SHIFT)) & USDHC_PRES_STATE_TSCD_MASK) - -#define USDHC_PRES_STATE_CINST_MASK (0x10000U) -#define USDHC_PRES_STATE_CINST_SHIFT (16U) -/*! CINST - Card inserted - * 0b1..Card inserted - * 0b0..Power on reset or no card - */ -#define USDHC_PRES_STATE_CINST(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PRES_STATE_CINST_SHIFT)) & USDHC_PRES_STATE_CINST_MASK) - -#define USDHC_PRES_STATE_CLSL_MASK (0x800000U) -#define USDHC_PRES_STATE_CLSL_SHIFT (23U) -/*! CLSL - CMD line signal level */ -#define USDHC_PRES_STATE_CLSL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PRES_STATE_CLSL_SHIFT)) & USDHC_PRES_STATE_CLSL_MASK) - -#define USDHC_PRES_STATE_DLSL_MASK (0xFF000000U) -#define USDHC_PRES_STATE_DLSL_SHIFT (24U) -/*! DLSL - DATA[7:0] line signal level - * 0b10000000..Data 7 line signal level - * 0b01000000..Data 6 line signal level - * 0b00100000..Data 5 line signal level - * 0b00010000..Data 4 line signal level - * 0b00001000..Data 3 line signal level - * 0b00000100..Data 2 line signal level - * 0b00000010..Data 1 line signal level - * 0b00000001..Data 0 line signal level - */ -#define USDHC_PRES_STATE_DLSL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PRES_STATE_DLSL_SHIFT)) & USDHC_PRES_STATE_DLSL_MASK) -/*! @} */ - -/*! @name PROT_CTRL - Protocol Control */ -/*! @{ */ - -#define USDHC_PROT_CTRL_DTW_MASK (0x6U) -#define USDHC_PROT_CTRL_DTW_SHIFT (1U) -/*! DTW - Data transfer width - * 0b10..8-bit mode - * 0b01..4-bit mode - * 0b00..1-bit mode - * 0b11..Reserved - */ -#define USDHC_PROT_CTRL_DTW(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PROT_CTRL_DTW_SHIFT)) & USDHC_PROT_CTRL_DTW_MASK) - -#define USDHC_PROT_CTRL_D3CD_MASK (0x8U) -#define USDHC_PROT_CTRL_D3CD_SHIFT (3U) -/*! D3CD - DATA3 as card detection pin - * 0b1..DATA3 as card detection pin - * 0b0..DATA3 does not monitor card insertion - */ -#define USDHC_PROT_CTRL_D3CD(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PROT_CTRL_D3CD_SHIFT)) & USDHC_PROT_CTRL_D3CD_MASK) - -#define USDHC_PROT_CTRL_EMODE_MASK (0x30U) -#define USDHC_PROT_CTRL_EMODE_SHIFT (4U) -/*! EMODE - Endian mode - * 0b00..Big endian mode - * 0b01..Half word big endian mode - * 0b10..Little endian mode - * 0b11..Reserved - */ -#define USDHC_PROT_CTRL_EMODE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PROT_CTRL_EMODE_SHIFT)) & USDHC_PROT_CTRL_EMODE_MASK) - -#define USDHC_PROT_CTRL_DMASEL_MASK (0x300U) -#define USDHC_PROT_CTRL_DMASEL_SHIFT (8U) -/*! DMASEL - DMA select - * 0b00..No DMA or simple DMA is selected. - * 0b01..ADMA1 is selected. - * 0b10..ADMA2 is selected. - * 0b11..Reserved - */ -#define USDHC_PROT_CTRL_DMASEL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PROT_CTRL_DMASEL_SHIFT)) & USDHC_PROT_CTRL_DMASEL_MASK) - -#define USDHC_PROT_CTRL_SABGREQ_MASK (0x10000U) -#define USDHC_PROT_CTRL_SABGREQ_SHIFT (16U) -/*! SABGREQ - Stop at block gap request - * 0b1..Stop - * 0b0..Transfer - */ -#define USDHC_PROT_CTRL_SABGREQ(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PROT_CTRL_SABGREQ_SHIFT)) & USDHC_PROT_CTRL_SABGREQ_MASK) - -#define USDHC_PROT_CTRL_CREQ_MASK (0x20000U) -#define USDHC_PROT_CTRL_CREQ_SHIFT (17U) -/*! CREQ - Continue request - * 0b1..Restart - * 0b0..No effect - */ -#define USDHC_PROT_CTRL_CREQ(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PROT_CTRL_CREQ_SHIFT)) & USDHC_PROT_CTRL_CREQ_MASK) - -#define USDHC_PROT_CTRL_RWCTL_MASK (0x40000U) -#define USDHC_PROT_CTRL_RWCTL_SHIFT (18U) -/*! RWCTL - Read wait control - * 0b1..Enables read wait control and assert read wait without stopping SD clock at block gap when SABGREQ field is set - * 0b0..Disables read wait control and stop SD clock at block gap when SABGREQ field is set - */ -#define USDHC_PROT_CTRL_RWCTL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PROT_CTRL_RWCTL_SHIFT)) & USDHC_PROT_CTRL_RWCTL_MASK) - -#define USDHC_PROT_CTRL_IABG_MASK (0x80000U) -#define USDHC_PROT_CTRL_IABG_SHIFT (19U) -/*! IABG - Interrupt at block gap - * 0b1..Enables interrupt at block gap - * 0b0..Disables interrupt at block gap - */ -#define USDHC_PROT_CTRL_IABG(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PROT_CTRL_IABG_SHIFT)) & USDHC_PROT_CTRL_IABG_MASK) - -#define USDHC_PROT_CTRL_RD_DONE_NO_8CLK_MASK (0x100000U) -#define USDHC_PROT_CTRL_RD_DONE_NO_8CLK_SHIFT (20U) -/*! RD_DONE_NO_8CLK - Read performed number 8 clock */ -#define USDHC_PROT_CTRL_RD_DONE_NO_8CLK(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PROT_CTRL_RD_DONE_NO_8CLK_SHIFT)) & USDHC_PROT_CTRL_RD_DONE_NO_8CLK_MASK) - -#define USDHC_PROT_CTRL_WECINT_MASK (0x1000000U) -#define USDHC_PROT_CTRL_WECINT_SHIFT (24U) -/*! WECINT - Wakeup event enable on card interrupt - * 0b1..Enables wakeup event enable on card interrupt - * 0b0..Disables wakeup event enable on card interrupt - */ -#define USDHC_PROT_CTRL_WECINT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PROT_CTRL_WECINT_SHIFT)) & USDHC_PROT_CTRL_WECINT_MASK) - -#define USDHC_PROT_CTRL_WECINS_MASK (0x2000000U) -#define USDHC_PROT_CTRL_WECINS_SHIFT (25U) -/*! WECINS - Wakeup event enable on SD card insertion - * 0b1..Enable wakeup event enable on SD card insertion - * 0b0..Disable wakeup event enable on SD card insertion - */ -#define USDHC_PROT_CTRL_WECINS(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PROT_CTRL_WECINS_SHIFT)) & USDHC_PROT_CTRL_WECINS_MASK) - -#define USDHC_PROT_CTRL_WECRM_MASK (0x4000000U) -#define USDHC_PROT_CTRL_WECRM_SHIFT (26U) -/*! WECRM - Wakeup event enable on SD card removal - * 0b1..Enables wakeup event enable on SD card removal - * 0b0..Disables wakeup event enable on SD card removal - */ -#define USDHC_PROT_CTRL_WECRM(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PROT_CTRL_WECRM_SHIFT)) & USDHC_PROT_CTRL_WECRM_MASK) - -#define USDHC_PROT_CTRL_BURST_LEN_EN_MASK (0x38000000U) -#define USDHC_PROT_CTRL_BURST_LEN_EN_SHIFT (27U) -/*! BURST_LEN_EN - BURST length enable for INCR, INCR4 / INCR8 / INCR16, INCR4-WRAP / INCR8-WRAP / INCR16-WRAP - * 0bxx1..Burst length is enabled for INCR. - * 0bx1x..Burst length is enabled for INCR4 / INCR8 / INCR16. - * 0b1xx..Burst length is enabled for INCR4-WRAP / INCR8-WRAP / INCR16-WRAP. - */ -#define USDHC_PROT_CTRL_BURST_LEN_EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PROT_CTRL_BURST_LEN_EN_SHIFT)) & USDHC_PROT_CTRL_BURST_LEN_EN_MASK) - -#define USDHC_PROT_CTRL_NON_EXACT_BLK_RD_MASK (0x40000000U) -#define USDHC_PROT_CTRL_NON_EXACT_BLK_RD_SHIFT (30U) -/*! NON_EXACT_BLK_RD - Non-exact block read - * 0b1..The block read is non-exact block read. Host driver needs to issue abort command to terminate this multi-block read. - * 0b0..The block read is exact block read. Host driver does not need to issue abort command to terminate this multi-block read. - */ -#define USDHC_PROT_CTRL_NON_EXACT_BLK_RD(x) (((uint32_t)(((uint32_t)(x)) << USDHC_PROT_CTRL_NON_EXACT_BLK_RD_SHIFT)) & USDHC_PROT_CTRL_NON_EXACT_BLK_RD_MASK) -/*! @} */ - -/*! @name SYS_CTRL - System Control */ -/*! @{ */ - -#define USDHC_SYS_CTRL_DVS_MASK (0xF0U) -#define USDHC_SYS_CTRL_DVS_SHIFT (4U) -/*! DVS - Divisor - * 0b0000..Divide-by-1 - * 0b0001..Divide-by-2 - * 0b1110..Divide-by-15 - * 0b1111..Divide-by-16 - */ -#define USDHC_SYS_CTRL_DVS(x) (((uint32_t)(((uint32_t)(x)) << USDHC_SYS_CTRL_DVS_SHIFT)) & USDHC_SYS_CTRL_DVS_MASK) - -#define USDHC_SYS_CTRL_SDCLKFS_MASK (0xFF00U) -#define USDHC_SYS_CTRL_SDCLKFS_SHIFT (8U) -/*! SDCLKFS - SDCLK frequency select */ -#define USDHC_SYS_CTRL_SDCLKFS(x) (((uint32_t)(((uint32_t)(x)) << USDHC_SYS_CTRL_SDCLKFS_SHIFT)) & USDHC_SYS_CTRL_SDCLKFS_MASK) - -#define USDHC_SYS_CTRL_DTOCV_MASK (0xF0000U) -#define USDHC_SYS_CTRL_DTOCV_SHIFT (16U) -/*! DTOCV - Data timeout counter value - * 0b1110..SDCLK x 2 30, recommend to use for SDR104 mode - * 0b1101..SDCLK x 2 29, recommend to use for supported speed modes except SDR104 mode - * 0b0011..SDCLK x 2 19 - * 0b0010..SDCLK x 2 18 - * 0b0001..SDCLK x 2 33 - * 0b0000..SDCLK x 2 32 - */ -#define USDHC_SYS_CTRL_DTOCV(x) (((uint32_t)(((uint32_t)(x)) << USDHC_SYS_CTRL_DTOCV_SHIFT)) & USDHC_SYS_CTRL_DTOCV_MASK) - -#define USDHC_SYS_CTRL_RST_FIFO_MASK (0x400000U) -#define USDHC_SYS_CTRL_RST_FIFO_SHIFT (22U) -/*! RST_FIFO - Reset the async FIFO */ -#define USDHC_SYS_CTRL_RST_FIFO(x) (((uint32_t)(((uint32_t)(x)) << USDHC_SYS_CTRL_RST_FIFO_SHIFT)) & USDHC_SYS_CTRL_RST_FIFO_MASK) - -#define USDHC_SYS_CTRL_IPP_RST_N_MASK (0x800000U) -#define USDHC_SYS_CTRL_IPP_RST_N_SHIFT (23U) -/*! IPP_RST_N - Hardware reset */ -#define USDHC_SYS_CTRL_IPP_RST_N(x) (((uint32_t)(((uint32_t)(x)) << USDHC_SYS_CTRL_IPP_RST_N_SHIFT)) & USDHC_SYS_CTRL_IPP_RST_N_MASK) - -#define USDHC_SYS_CTRL_RSTA_MASK (0x1000000U) -#define USDHC_SYS_CTRL_RSTA_SHIFT (24U) -/*! RSTA - Software reset for all - * 0b1..Reset - * 0b0..No reset - */ -#define USDHC_SYS_CTRL_RSTA(x) (((uint32_t)(((uint32_t)(x)) << USDHC_SYS_CTRL_RSTA_SHIFT)) & USDHC_SYS_CTRL_RSTA_MASK) - -#define USDHC_SYS_CTRL_RSTC_MASK (0x2000000U) -#define USDHC_SYS_CTRL_RSTC_SHIFT (25U) -/*! RSTC - Software reset for CMD line - * 0b1..Reset - * 0b0..No reset - */ -#define USDHC_SYS_CTRL_RSTC(x) (((uint32_t)(((uint32_t)(x)) << USDHC_SYS_CTRL_RSTC_SHIFT)) & USDHC_SYS_CTRL_RSTC_MASK) - -#define USDHC_SYS_CTRL_RSTD_MASK (0x4000000U) -#define USDHC_SYS_CTRL_RSTD_SHIFT (26U) -/*! RSTD - Software reset for data line - * 0b1..Reset - * 0b0..No reset - */ -#define USDHC_SYS_CTRL_RSTD(x) (((uint32_t)(((uint32_t)(x)) << USDHC_SYS_CTRL_RSTD_SHIFT)) & USDHC_SYS_CTRL_RSTD_MASK) - -#define USDHC_SYS_CTRL_INITA_MASK (0x8000000U) -#define USDHC_SYS_CTRL_INITA_SHIFT (27U) -/*! INITA - Initialization active */ -#define USDHC_SYS_CTRL_INITA(x) (((uint32_t)(((uint32_t)(x)) << USDHC_SYS_CTRL_INITA_SHIFT)) & USDHC_SYS_CTRL_INITA_MASK) - -#define USDHC_SYS_CTRL_RSTT_MASK (0x10000000U) -#define USDHC_SYS_CTRL_RSTT_SHIFT (28U) -/*! RSTT - Reset tuning */ -#define USDHC_SYS_CTRL_RSTT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_SYS_CTRL_RSTT_SHIFT)) & USDHC_SYS_CTRL_RSTT_MASK) -/*! @} */ - -/*! @name INT_STATUS - Interrupt Status */ -/*! @{ */ - -#define USDHC_INT_STATUS_CC_MASK (0x1U) -#define USDHC_INT_STATUS_CC_SHIFT (0U) -/*! CC - Command complete - * 0b1..Command complete - * 0b0..Command not complete - */ -#define USDHC_INT_STATUS_CC(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_CC_SHIFT)) & USDHC_INT_STATUS_CC_MASK) - -#define USDHC_INT_STATUS_TC_MASK (0x2U) -#define USDHC_INT_STATUS_TC_SHIFT (1U) -/*! TC - Transfer complete - * 0b1..Transfer complete - * 0b0..Transfer does not complete - */ -#define USDHC_INT_STATUS_TC(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_TC_SHIFT)) & USDHC_INT_STATUS_TC_MASK) - -#define USDHC_INT_STATUS_BGE_MASK (0x4U) -#define USDHC_INT_STATUS_BGE_SHIFT (2U) -/*! BGE - Block gap event - * 0b1..Transaction stopped at block gap - * 0b0..No block gap event - */ -#define USDHC_INT_STATUS_BGE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_BGE_SHIFT)) & USDHC_INT_STATUS_BGE_MASK) - -#define USDHC_INT_STATUS_DINT_MASK (0x8U) -#define USDHC_INT_STATUS_DINT_SHIFT (3U) -/*! DINT - DMA interrupt - * 0b1..DMA interrupt is generated. - * 0b0..No DMA interrupt - */ -#define USDHC_INT_STATUS_DINT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_DINT_SHIFT)) & USDHC_INT_STATUS_DINT_MASK) - -#define USDHC_INT_STATUS_BWR_MASK (0x10U) -#define USDHC_INT_STATUS_BWR_SHIFT (4U) -/*! BWR - Buffer write ready - * 0b1..Ready to write buffer - * 0b0..Not ready to write buffer - */ -#define USDHC_INT_STATUS_BWR(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_BWR_SHIFT)) & USDHC_INT_STATUS_BWR_MASK) - -#define USDHC_INT_STATUS_BRR_MASK (0x20U) -#define USDHC_INT_STATUS_BRR_SHIFT (5U) -/*! BRR - Buffer read ready - * 0b1..Ready to read buffer - * 0b0..Not ready to read buffer - */ -#define USDHC_INT_STATUS_BRR(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_BRR_SHIFT)) & USDHC_INT_STATUS_BRR_MASK) - -#define USDHC_INT_STATUS_CINS_MASK (0x40U) -#define USDHC_INT_STATUS_CINS_SHIFT (6U) -/*! CINS - Card insertion - * 0b1..Card inserted - * 0b0..Card state unstable or removed - */ -#define USDHC_INT_STATUS_CINS(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_CINS_SHIFT)) & USDHC_INT_STATUS_CINS_MASK) - -#define USDHC_INT_STATUS_CRM_MASK (0x80U) -#define USDHC_INT_STATUS_CRM_SHIFT (7U) -/*! CRM - Card removal - * 0b1..Card removed - * 0b0..Card state unstable or inserted - */ -#define USDHC_INT_STATUS_CRM(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_CRM_SHIFT)) & USDHC_INT_STATUS_CRM_MASK) - -#define USDHC_INT_STATUS_CINT_MASK (0x100U) -#define USDHC_INT_STATUS_CINT_SHIFT (8U) -/*! CINT - Card interrupt - * 0b1..Generate card interrupt - * 0b0..No card interrupt - */ -#define USDHC_INT_STATUS_CINT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_CINT_SHIFT)) & USDHC_INT_STATUS_CINT_MASK) - -#define USDHC_INT_STATUS_RTE_MASK (0x1000U) -#define USDHC_INT_STATUS_RTE_SHIFT (12U) -/*! RTE - Re-tuning event: (only for SD3.0 SDR104 mode) - * 0b1..Re-tuning should be performed. - * 0b0..Re-tuning is not required. - */ -#define USDHC_INT_STATUS_RTE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_RTE_SHIFT)) & USDHC_INT_STATUS_RTE_MASK) - -#define USDHC_INT_STATUS_TP_MASK (0x4000U) -#define USDHC_INT_STATUS_TP_SHIFT (14U) -/*! TP - Tuning pass:(only for SD3.0 SDR104 mode) */ -#define USDHC_INT_STATUS_TP(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_TP_SHIFT)) & USDHC_INT_STATUS_TP_MASK) - -#define USDHC_INT_STATUS_ERR_INT_STATUS_MASK (0x8000U) -#define USDHC_INT_STATUS_ERR_INT_STATUS_SHIFT (15U) -/*! ERR_INT_STATUS - Error Interrupt Status */ -#define USDHC_INT_STATUS_ERR_INT_STATUS(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_ERR_INT_STATUS_SHIFT)) & USDHC_INT_STATUS_ERR_INT_STATUS_MASK) - -#define USDHC_INT_STATUS_CTOE_MASK (0x10000U) -#define USDHC_INT_STATUS_CTOE_SHIFT (16U) -/*! CTOE - Command timeout error - * 0b1..Time out - * 0b0..No error - */ -#define USDHC_INT_STATUS_CTOE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_CTOE_SHIFT)) & USDHC_INT_STATUS_CTOE_MASK) - -#define USDHC_INT_STATUS_CCE_MASK (0x20000U) -#define USDHC_INT_STATUS_CCE_SHIFT (17U) -/*! CCE - Command CRC error - * 0b1..CRC error generated - * 0b0..No error - */ -#define USDHC_INT_STATUS_CCE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_CCE_SHIFT)) & USDHC_INT_STATUS_CCE_MASK) - -#define USDHC_INT_STATUS_CEBE_MASK (0x40000U) -#define USDHC_INT_STATUS_CEBE_SHIFT (18U) -/*! CEBE - Command end bit error - * 0b1..End bit error generated - * 0b0..No error - */ -#define USDHC_INT_STATUS_CEBE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_CEBE_SHIFT)) & USDHC_INT_STATUS_CEBE_MASK) - -#define USDHC_INT_STATUS_CIE_MASK (0x80000U) -#define USDHC_INT_STATUS_CIE_SHIFT (19U) -/*! CIE - Command index error - * 0b1..Error - * 0b0..No error - */ -#define USDHC_INT_STATUS_CIE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_CIE_SHIFT)) & USDHC_INT_STATUS_CIE_MASK) - -#define USDHC_INT_STATUS_DTOE_MASK (0x100000U) -#define USDHC_INT_STATUS_DTOE_SHIFT (20U) -/*! DTOE - Data timeout error - * 0b1..Time out - * 0b0..No error - */ -#define USDHC_INT_STATUS_DTOE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_DTOE_SHIFT)) & USDHC_INT_STATUS_DTOE_MASK) - -#define USDHC_INT_STATUS_DCE_MASK (0x200000U) -#define USDHC_INT_STATUS_DCE_SHIFT (21U) -/*! DCE - Data CRC error - * 0b1..Error - * 0b0..No error - */ -#define USDHC_INT_STATUS_DCE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_DCE_SHIFT)) & USDHC_INT_STATUS_DCE_MASK) - -#define USDHC_INT_STATUS_DEBE_MASK (0x400000U) -#define USDHC_INT_STATUS_DEBE_SHIFT (22U) -/*! DEBE - Data end bit error - * 0b1..Error - * 0b0..No error - */ -#define USDHC_INT_STATUS_DEBE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_DEBE_SHIFT)) & USDHC_INT_STATUS_DEBE_MASK) - -#define USDHC_INT_STATUS_AC12E_MASK (0x1000000U) -#define USDHC_INT_STATUS_AC12E_SHIFT (24U) -/*! AC12E - Auto CMD12 error - * 0b1..Error - * 0b0..No error - */ -#define USDHC_INT_STATUS_AC12E(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_AC12E_SHIFT)) & USDHC_INT_STATUS_AC12E_MASK) - -#define USDHC_INT_STATUS_TNE_MASK (0x4000000U) -#define USDHC_INT_STATUS_TNE_SHIFT (26U) -/*! TNE - Tuning error: (only for SD3.0 SDR104 mode) */ -#define USDHC_INT_STATUS_TNE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_TNE_SHIFT)) & USDHC_INT_STATUS_TNE_MASK) - -#define USDHC_INT_STATUS_DMAE_MASK (0x10000000U) -#define USDHC_INT_STATUS_DMAE_SHIFT (28U) -/*! DMAE - DMA error - * 0b1..Error - * 0b0..No error - */ -#define USDHC_INT_STATUS_DMAE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_DMAE_SHIFT)) & USDHC_INT_STATUS_DMAE_MASK) -/*! @} */ - -/*! @name INT_STATUS_EN - Interrupt Status Enable */ -/*! @{ */ - -#define USDHC_INT_STATUS_EN_CCSEN_MASK (0x1U) -#define USDHC_INT_STATUS_EN_CCSEN_SHIFT (0U) -/*! CCSEN - Command complete status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_CCSEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_CCSEN_SHIFT)) & USDHC_INT_STATUS_EN_CCSEN_MASK) - -#define USDHC_INT_STATUS_EN_TCSEN_MASK (0x2U) -#define USDHC_INT_STATUS_EN_TCSEN_SHIFT (1U) -/*! TCSEN - Transfer complete status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_TCSEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_TCSEN_SHIFT)) & USDHC_INT_STATUS_EN_TCSEN_MASK) - -#define USDHC_INT_STATUS_EN_BGESEN_MASK (0x4U) -#define USDHC_INT_STATUS_EN_BGESEN_SHIFT (2U) -/*! BGESEN - Block gap event status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_BGESEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_BGESEN_SHIFT)) & USDHC_INT_STATUS_EN_BGESEN_MASK) - -#define USDHC_INT_STATUS_EN_DINTSEN_MASK (0x8U) -#define USDHC_INT_STATUS_EN_DINTSEN_SHIFT (3U) -/*! DINTSEN - DMA interrupt status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_DINTSEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_DINTSEN_SHIFT)) & USDHC_INT_STATUS_EN_DINTSEN_MASK) - -#define USDHC_INT_STATUS_EN_BWRSEN_MASK (0x10U) -#define USDHC_INT_STATUS_EN_BWRSEN_SHIFT (4U) -/*! BWRSEN - Buffer write ready status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_BWRSEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_BWRSEN_SHIFT)) & USDHC_INT_STATUS_EN_BWRSEN_MASK) - -#define USDHC_INT_STATUS_EN_BRRSEN_MASK (0x20U) -#define USDHC_INT_STATUS_EN_BRRSEN_SHIFT (5U) -/*! BRRSEN - Buffer read ready status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_BRRSEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_BRRSEN_SHIFT)) & USDHC_INT_STATUS_EN_BRRSEN_MASK) - -#define USDHC_INT_STATUS_EN_CINSSEN_MASK (0x40U) -#define USDHC_INT_STATUS_EN_CINSSEN_SHIFT (6U) -/*! CINSSEN - Card insertion status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_CINSSEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_CINSSEN_SHIFT)) & USDHC_INT_STATUS_EN_CINSSEN_MASK) - -#define USDHC_INT_STATUS_EN_CRMSEN_MASK (0x80U) -#define USDHC_INT_STATUS_EN_CRMSEN_SHIFT (7U) -/*! CRMSEN - Card removal status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_CRMSEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_CRMSEN_SHIFT)) & USDHC_INT_STATUS_EN_CRMSEN_MASK) - -#define USDHC_INT_STATUS_EN_CINTSEN_MASK (0x100U) -#define USDHC_INT_STATUS_EN_CINTSEN_SHIFT (8U) -/*! CINTSEN - Card interrupt status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_CINTSEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_CINTSEN_SHIFT)) & USDHC_INT_STATUS_EN_CINTSEN_MASK) - -#define USDHC_INT_STATUS_EN_RTESEN_MASK (0x1000U) -#define USDHC_INT_STATUS_EN_RTESEN_SHIFT (12U) -/*! RTESEN - Re-tuning event status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_RTESEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_RTESEN_SHIFT)) & USDHC_INT_STATUS_EN_RTESEN_MASK) - -#define USDHC_INT_STATUS_EN_TPSEN_MASK (0x4000U) -#define USDHC_INT_STATUS_EN_TPSEN_SHIFT (14U) -/*! TPSEN - Tuning pass status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_TPSEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_TPSEN_SHIFT)) & USDHC_INT_STATUS_EN_TPSEN_MASK) - -#define USDHC_INT_STATUS_EN_CTOESEN_MASK (0x10000U) -#define USDHC_INT_STATUS_EN_CTOESEN_SHIFT (16U) -/*! CTOESEN - Command timeout error status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_CTOESEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_CTOESEN_SHIFT)) & USDHC_INT_STATUS_EN_CTOESEN_MASK) - -#define USDHC_INT_STATUS_EN_CCESEN_MASK (0x20000U) -#define USDHC_INT_STATUS_EN_CCESEN_SHIFT (17U) -/*! CCESEN - Command CRC error status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_CCESEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_CCESEN_SHIFT)) & USDHC_INT_STATUS_EN_CCESEN_MASK) - -#define USDHC_INT_STATUS_EN_CEBESEN_MASK (0x40000U) -#define USDHC_INT_STATUS_EN_CEBESEN_SHIFT (18U) -/*! CEBESEN - Command end bit error status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_CEBESEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_CEBESEN_SHIFT)) & USDHC_INT_STATUS_EN_CEBESEN_MASK) - -#define USDHC_INT_STATUS_EN_CIESEN_MASK (0x80000U) -#define USDHC_INT_STATUS_EN_CIESEN_SHIFT (19U) -/*! CIESEN - Command index error status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_CIESEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_CIESEN_SHIFT)) & USDHC_INT_STATUS_EN_CIESEN_MASK) - -#define USDHC_INT_STATUS_EN_DTOESEN_MASK (0x100000U) -#define USDHC_INT_STATUS_EN_DTOESEN_SHIFT (20U) -/*! DTOESEN - Data timeout error status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_DTOESEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_DTOESEN_SHIFT)) & USDHC_INT_STATUS_EN_DTOESEN_MASK) - -#define USDHC_INT_STATUS_EN_DCESEN_MASK (0x200000U) -#define USDHC_INT_STATUS_EN_DCESEN_SHIFT (21U) -/*! DCESEN - Data CRC error status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_DCESEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_DCESEN_SHIFT)) & USDHC_INT_STATUS_EN_DCESEN_MASK) - -#define USDHC_INT_STATUS_EN_DEBESEN_MASK (0x400000U) -#define USDHC_INT_STATUS_EN_DEBESEN_SHIFT (22U) -/*! DEBESEN - Data end bit error status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_DEBESEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_DEBESEN_SHIFT)) & USDHC_INT_STATUS_EN_DEBESEN_MASK) - -#define USDHC_INT_STATUS_EN_AC12ESEN_MASK (0x1000000U) -#define USDHC_INT_STATUS_EN_AC12ESEN_SHIFT (24U) -/*! AC12ESEN - Auto CMD12 error status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_AC12ESEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_AC12ESEN_SHIFT)) & USDHC_INT_STATUS_EN_AC12ESEN_MASK) - -#define USDHC_INT_STATUS_EN_TNESEN_MASK (0x4000000U) -#define USDHC_INT_STATUS_EN_TNESEN_SHIFT (26U) -/*! TNESEN - Tuning error status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_TNESEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_TNESEN_SHIFT)) & USDHC_INT_STATUS_EN_TNESEN_MASK) - -#define USDHC_INT_STATUS_EN_DMAESEN_MASK (0x10000000U) -#define USDHC_INT_STATUS_EN_DMAESEN_SHIFT (28U) -/*! DMAESEN - DMA error status enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_STATUS_EN_DMAESEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_STATUS_EN_DMAESEN_SHIFT)) & USDHC_INT_STATUS_EN_DMAESEN_MASK) -/*! @} */ - -/*! @name INT_SIGNAL_EN - Interrupt Signal Enable */ -/*! @{ */ - -#define USDHC_INT_SIGNAL_EN_CCIEN_MASK (0x1U) -#define USDHC_INT_SIGNAL_EN_CCIEN_SHIFT (0U) -/*! CCIEN - Command complete interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_CCIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_CCIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_CCIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_TCIEN_MASK (0x2U) -#define USDHC_INT_SIGNAL_EN_TCIEN_SHIFT (1U) -/*! TCIEN - Transfer complete interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_TCIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_TCIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_TCIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_BGEIEN_MASK (0x4U) -#define USDHC_INT_SIGNAL_EN_BGEIEN_SHIFT (2U) -/*! BGEIEN - Block gap event interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_BGEIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_BGEIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_BGEIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_DINTIEN_MASK (0x8U) -#define USDHC_INT_SIGNAL_EN_DINTIEN_SHIFT (3U) -/*! DINTIEN - DMA interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_DINTIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_DINTIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_DINTIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_BWRIEN_MASK (0x10U) -#define USDHC_INT_SIGNAL_EN_BWRIEN_SHIFT (4U) -/*! BWRIEN - Buffer write ready interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_BWRIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_BWRIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_BWRIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_BRRIEN_MASK (0x20U) -#define USDHC_INT_SIGNAL_EN_BRRIEN_SHIFT (5U) -/*! BRRIEN - Buffer read ready interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_BRRIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_BRRIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_BRRIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_CINSIEN_MASK (0x40U) -#define USDHC_INT_SIGNAL_EN_CINSIEN_SHIFT (6U) -/*! CINSIEN - Card insertion interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_CINSIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_CINSIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_CINSIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_CRMIEN_MASK (0x80U) -#define USDHC_INT_SIGNAL_EN_CRMIEN_SHIFT (7U) -/*! CRMIEN - Card removal interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_CRMIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_CRMIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_CRMIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_CINTIEN_MASK (0x100U) -#define USDHC_INT_SIGNAL_EN_CINTIEN_SHIFT (8U) -/*! CINTIEN - Card interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_CINTIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_CINTIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_CINTIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_RTEIEN_MASK (0x1000U) -#define USDHC_INT_SIGNAL_EN_RTEIEN_SHIFT (12U) -/*! RTEIEN - Re-tuning event interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_RTEIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_RTEIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_RTEIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_TPIEN_MASK (0x4000U) -#define USDHC_INT_SIGNAL_EN_TPIEN_SHIFT (14U) -/*! TPIEN - Tuning Pass interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_TPIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_TPIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_TPIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_CTOEIEN_MASK (0x10000U) -#define USDHC_INT_SIGNAL_EN_CTOEIEN_SHIFT (16U) -/*! CTOEIEN - Command timeout error interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_CTOEIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_CTOEIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_CTOEIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_CCEIEN_MASK (0x20000U) -#define USDHC_INT_SIGNAL_EN_CCEIEN_SHIFT (17U) -/*! CCEIEN - Command CRC error interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_CCEIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_CCEIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_CCEIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_CEBEIEN_MASK (0x40000U) -#define USDHC_INT_SIGNAL_EN_CEBEIEN_SHIFT (18U) -/*! CEBEIEN - Command end bit error interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_CEBEIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_CEBEIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_CEBEIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_CIEIEN_MASK (0x80000U) -#define USDHC_INT_SIGNAL_EN_CIEIEN_SHIFT (19U) -/*! CIEIEN - Command index error interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_CIEIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_CIEIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_CIEIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_DTOEIEN_MASK (0x100000U) -#define USDHC_INT_SIGNAL_EN_DTOEIEN_SHIFT (20U) -/*! DTOEIEN - Data timeout error interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_DTOEIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_DTOEIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_DTOEIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_DCEIEN_MASK (0x200000U) -#define USDHC_INT_SIGNAL_EN_DCEIEN_SHIFT (21U) -/*! DCEIEN - Data CRC error interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_DCEIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_DCEIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_DCEIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_DEBEIEN_MASK (0x400000U) -#define USDHC_INT_SIGNAL_EN_DEBEIEN_SHIFT (22U) -/*! DEBEIEN - Data end bit error interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_DEBEIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_DEBEIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_DEBEIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_AC12EIEN_MASK (0x1000000U) -#define USDHC_INT_SIGNAL_EN_AC12EIEN_SHIFT (24U) -/*! AC12EIEN - Auto CMD12 error interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_AC12EIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_AC12EIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_AC12EIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_TNEIEN_MASK (0x4000000U) -#define USDHC_INT_SIGNAL_EN_TNEIEN_SHIFT (26U) -/*! TNEIEN - Tuning error interrupt enable - * 0b1..Enabled - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_TNEIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_TNEIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_TNEIEN_MASK) - -#define USDHC_INT_SIGNAL_EN_DMAEIEN_MASK (0x10000000U) -#define USDHC_INT_SIGNAL_EN_DMAEIEN_SHIFT (28U) -/*! DMAEIEN - DMA error interrupt enable - * 0b1..Enable - * 0b0..Masked - */ -#define USDHC_INT_SIGNAL_EN_DMAEIEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_INT_SIGNAL_EN_DMAEIEN_SHIFT)) & USDHC_INT_SIGNAL_EN_DMAEIEN_MASK) -/*! @} */ - -/*! @name AUTOCMD12_ERR_STATUS - Auto CMD12 Error Status */ -/*! @{ */ - -#define USDHC_AUTOCMD12_ERR_STATUS_AC12NE_MASK (0x1U) -#define USDHC_AUTOCMD12_ERR_STATUS_AC12NE_SHIFT (0U) -/*! AC12NE - Auto CMD12 not executed - * 0b1..Not executed - * 0b0..Executed - */ -#define USDHC_AUTOCMD12_ERR_STATUS_AC12NE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_AUTOCMD12_ERR_STATUS_AC12NE_SHIFT)) & USDHC_AUTOCMD12_ERR_STATUS_AC12NE_MASK) - -#define USDHC_AUTOCMD12_ERR_STATUS_AC12TOE_MASK (0x2U) -#define USDHC_AUTOCMD12_ERR_STATUS_AC12TOE_SHIFT (1U) -/*! AC12TOE - Auto CMD12 / 23 timeout error - * 0b1..Time out - * 0b0..No error - */ -#define USDHC_AUTOCMD12_ERR_STATUS_AC12TOE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_AUTOCMD12_ERR_STATUS_AC12TOE_SHIFT)) & USDHC_AUTOCMD12_ERR_STATUS_AC12TOE_MASK) - -#define USDHC_AUTOCMD12_ERR_STATUS_AC12CE_MASK (0x4U) -#define USDHC_AUTOCMD12_ERR_STATUS_AC12CE_SHIFT (2U) -/*! AC12CE - Auto CMD12 / 23 CRC error - * 0b1..CRC error met in Auto CMD12/23 response - * 0b0..No CRC error - */ -#define USDHC_AUTOCMD12_ERR_STATUS_AC12CE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_AUTOCMD12_ERR_STATUS_AC12CE_SHIFT)) & USDHC_AUTOCMD12_ERR_STATUS_AC12CE_MASK) - -#define USDHC_AUTOCMD12_ERR_STATUS_AC12EBE_MASK (0x8U) -#define USDHC_AUTOCMD12_ERR_STATUS_AC12EBE_SHIFT (3U) -/*! AC12EBE - Auto CMD12 / 23 end bit error - * 0b1..End bit error generated - * 0b0..No error - */ -#define USDHC_AUTOCMD12_ERR_STATUS_AC12EBE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_AUTOCMD12_ERR_STATUS_AC12EBE_SHIFT)) & USDHC_AUTOCMD12_ERR_STATUS_AC12EBE_MASK) - -#define USDHC_AUTOCMD12_ERR_STATUS_AC12IE_MASK (0x10U) -#define USDHC_AUTOCMD12_ERR_STATUS_AC12IE_SHIFT (4U) -/*! AC12IE - Auto CMD12 / 23 index error - * 0b1..Error, the CMD index in response is not CMD12/23 - * 0b0..No error - */ -#define USDHC_AUTOCMD12_ERR_STATUS_AC12IE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_AUTOCMD12_ERR_STATUS_AC12IE_SHIFT)) & USDHC_AUTOCMD12_ERR_STATUS_AC12IE_MASK) - -#define USDHC_AUTOCMD12_ERR_STATUS_CNIBAC12E_MASK (0x80U) -#define USDHC_AUTOCMD12_ERR_STATUS_CNIBAC12E_SHIFT (7U) -/*! CNIBAC12E - Command not issued by Auto CMD12 error - * 0b1..Not issued - * 0b0..No error - */ -#define USDHC_AUTOCMD12_ERR_STATUS_CNIBAC12E(x) (((uint32_t)(((uint32_t)(x)) << USDHC_AUTOCMD12_ERR_STATUS_CNIBAC12E_SHIFT)) & USDHC_AUTOCMD12_ERR_STATUS_CNIBAC12E_MASK) - -#define USDHC_AUTOCMD12_ERR_STATUS_EXECUTE_TUNING_MASK (0x400000U) -#define USDHC_AUTOCMD12_ERR_STATUS_EXECUTE_TUNING_SHIFT (22U) -/*! EXECUTE_TUNING - Execute tuning - * 0b1..Start tuning procedure - * 0b0..Tuning procedure is aborted - */ -#define USDHC_AUTOCMD12_ERR_STATUS_EXECUTE_TUNING(x) (((uint32_t)(((uint32_t)(x)) << USDHC_AUTOCMD12_ERR_STATUS_EXECUTE_TUNING_SHIFT)) & USDHC_AUTOCMD12_ERR_STATUS_EXECUTE_TUNING_MASK) - -#define USDHC_AUTOCMD12_ERR_STATUS_SMP_CLK_SEL_MASK (0x800000U) -#define USDHC_AUTOCMD12_ERR_STATUS_SMP_CLK_SEL_SHIFT (23U) -/*! SMP_CLK_SEL - Sample clock select - * 0b1..Tuned clock is used to sample data - * 0b0..Fixed clock is used to sample data - */ -#define USDHC_AUTOCMD12_ERR_STATUS_SMP_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_AUTOCMD12_ERR_STATUS_SMP_CLK_SEL_SHIFT)) & USDHC_AUTOCMD12_ERR_STATUS_SMP_CLK_SEL_MASK) -/*! @} */ - -/*! @name HOST_CTRL_CAP - Host Controller Capabilities */ -/*! @{ */ - -#define USDHC_HOST_CTRL_CAP_SDR50_SUPPORT_MASK (0x1U) -#define USDHC_HOST_CTRL_CAP_SDR50_SUPPORT_SHIFT (0U) -/*! SDR50_SUPPORT - SDR50 support */ -#define USDHC_HOST_CTRL_CAP_SDR50_SUPPORT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_HOST_CTRL_CAP_SDR50_SUPPORT_SHIFT)) & USDHC_HOST_CTRL_CAP_SDR50_SUPPORT_MASK) - -#define USDHC_HOST_CTRL_CAP_SDR104_SUPPORT_MASK (0x2U) -#define USDHC_HOST_CTRL_CAP_SDR104_SUPPORT_SHIFT (1U) -/*! SDR104_SUPPORT - SDR104 support */ -#define USDHC_HOST_CTRL_CAP_SDR104_SUPPORT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_HOST_CTRL_CAP_SDR104_SUPPORT_SHIFT)) & USDHC_HOST_CTRL_CAP_SDR104_SUPPORT_MASK) - -#define USDHC_HOST_CTRL_CAP_DDR50_SUPPORT_MASK (0x4U) -#define USDHC_HOST_CTRL_CAP_DDR50_SUPPORT_SHIFT (2U) -/*! DDR50_SUPPORT - DDR50 support */ -#define USDHC_HOST_CTRL_CAP_DDR50_SUPPORT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_HOST_CTRL_CAP_DDR50_SUPPORT_SHIFT)) & USDHC_HOST_CTRL_CAP_DDR50_SUPPORT_MASK) - -#define USDHC_HOST_CTRL_CAP_USE_TUNING_SDR50_MASK (0x2000U) -#define USDHC_HOST_CTRL_CAP_USE_TUNING_SDR50_SHIFT (13U) -/*! USE_TUNING_SDR50 - Use Tuning for SDR50 - * 0b1..SDR50 supports tuning - * 0b0..SDR50 does not support tuning - */ -#define USDHC_HOST_CTRL_CAP_USE_TUNING_SDR50(x) (((uint32_t)(((uint32_t)(x)) << USDHC_HOST_CTRL_CAP_USE_TUNING_SDR50_SHIFT)) & USDHC_HOST_CTRL_CAP_USE_TUNING_SDR50_MASK) - -#define USDHC_HOST_CTRL_CAP_MBL_MASK (0x70000U) -#define USDHC_HOST_CTRL_CAP_MBL_SHIFT (16U) -/*! MBL - Max block length - * 0b000..512 bytes - * 0b001..1024 bytes - * 0b010..2048 bytes - * 0b011..4096 bytes - */ -#define USDHC_HOST_CTRL_CAP_MBL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_HOST_CTRL_CAP_MBL_SHIFT)) & USDHC_HOST_CTRL_CAP_MBL_MASK) - -#define USDHC_HOST_CTRL_CAP_ADMAS_MASK (0x100000U) -#define USDHC_HOST_CTRL_CAP_ADMAS_SHIFT (20U) -/*! ADMAS - ADMA support - * 0b1..Advanced DMA supported - * 0b0..Advanced DMA not supported - */ -#define USDHC_HOST_CTRL_CAP_ADMAS(x) (((uint32_t)(((uint32_t)(x)) << USDHC_HOST_CTRL_CAP_ADMAS_SHIFT)) & USDHC_HOST_CTRL_CAP_ADMAS_MASK) - -#define USDHC_HOST_CTRL_CAP_HSS_MASK (0x200000U) -#define USDHC_HOST_CTRL_CAP_HSS_SHIFT (21U) -/*! HSS - High speed support - * 0b1..High speed supported - * 0b0..High speed not supported - */ -#define USDHC_HOST_CTRL_CAP_HSS(x) (((uint32_t)(((uint32_t)(x)) << USDHC_HOST_CTRL_CAP_HSS_SHIFT)) & USDHC_HOST_CTRL_CAP_HSS_MASK) - -#define USDHC_HOST_CTRL_CAP_DMAS_MASK (0x400000U) -#define USDHC_HOST_CTRL_CAP_DMAS_SHIFT (22U) -/*! DMAS - DMA support - * 0b1..DMA supported - * 0b0..DMA not supported - */ -#define USDHC_HOST_CTRL_CAP_DMAS(x) (((uint32_t)(((uint32_t)(x)) << USDHC_HOST_CTRL_CAP_DMAS_SHIFT)) & USDHC_HOST_CTRL_CAP_DMAS_MASK) - -#define USDHC_HOST_CTRL_CAP_SRS_MASK (0x800000U) -#define USDHC_HOST_CTRL_CAP_SRS_SHIFT (23U) -/*! SRS - Suspend / resume support - * 0b1..Supported - * 0b0..Not supported - */ -#define USDHC_HOST_CTRL_CAP_SRS(x) (((uint32_t)(((uint32_t)(x)) << USDHC_HOST_CTRL_CAP_SRS_SHIFT)) & USDHC_HOST_CTRL_CAP_SRS_MASK) - -#define USDHC_HOST_CTRL_CAP_VS33_MASK (0x1000000U) -#define USDHC_HOST_CTRL_CAP_VS33_SHIFT (24U) -/*! VS33 - Voltage support 3.3 V - * 0b1..3.3 V supported - * 0b0..3.3 V not supported - */ -#define USDHC_HOST_CTRL_CAP_VS33(x) (((uint32_t)(((uint32_t)(x)) << USDHC_HOST_CTRL_CAP_VS33_SHIFT)) & USDHC_HOST_CTRL_CAP_VS33_MASK) - -#define USDHC_HOST_CTRL_CAP_VS30_MASK (0x2000000U) -#define USDHC_HOST_CTRL_CAP_VS30_SHIFT (25U) -/*! VS30 - Voltage support 3.0 V - * 0b1..3.0 V supported - * 0b0..3.0 V not supported - */ -#define USDHC_HOST_CTRL_CAP_VS30(x) (((uint32_t)(((uint32_t)(x)) << USDHC_HOST_CTRL_CAP_VS30_SHIFT)) & USDHC_HOST_CTRL_CAP_VS30_MASK) - -#define USDHC_HOST_CTRL_CAP_VS18_MASK (0x4000000U) -#define USDHC_HOST_CTRL_CAP_VS18_SHIFT (26U) -/*! VS18 - Voltage support 1.8 V - * 0b1..1.8 V supported - * 0b0..1.8 V not supported - */ -#define USDHC_HOST_CTRL_CAP_VS18(x) (((uint32_t)(((uint32_t)(x)) << USDHC_HOST_CTRL_CAP_VS18_SHIFT)) & USDHC_HOST_CTRL_CAP_VS18_MASK) -/*! @} */ - -/*! @name WTMK_LVL - Watermark Level */ -/*! @{ */ - -#define USDHC_WTMK_LVL_RD_WML_MASK (0xFFU) -#define USDHC_WTMK_LVL_RD_WML_SHIFT (0U) -/*! RD_WML - Read watermark level */ -#define USDHC_WTMK_LVL_RD_WML(x) (((uint32_t)(((uint32_t)(x)) << USDHC_WTMK_LVL_RD_WML_SHIFT)) & USDHC_WTMK_LVL_RD_WML_MASK) - -#define USDHC_WTMK_LVL_RD_BRST_LEN_MASK (0x1F00U) -#define USDHC_WTMK_LVL_RD_BRST_LEN_SHIFT (8U) -/*! RD_BRST_LEN - Read burst length due to system restriction, the actual burst length might not exceed 16 */ -#define USDHC_WTMK_LVL_RD_BRST_LEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_WTMK_LVL_RD_BRST_LEN_SHIFT)) & USDHC_WTMK_LVL_RD_BRST_LEN_MASK) - -#define USDHC_WTMK_LVL_WR_WML_MASK (0xFF0000U) -#define USDHC_WTMK_LVL_WR_WML_SHIFT (16U) -/*! WR_WML - Write watermark level */ -#define USDHC_WTMK_LVL_WR_WML(x) (((uint32_t)(((uint32_t)(x)) << USDHC_WTMK_LVL_WR_WML_SHIFT)) & USDHC_WTMK_LVL_WR_WML_MASK) - -#define USDHC_WTMK_LVL_WR_BRST_LEN_MASK (0x1F000000U) -#define USDHC_WTMK_LVL_WR_BRST_LEN_SHIFT (24U) -/*! WR_BRST_LEN - Write burst length due to system restriction, the actual burst length might not exceed 16 */ -#define USDHC_WTMK_LVL_WR_BRST_LEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_WTMK_LVL_WR_BRST_LEN_SHIFT)) & USDHC_WTMK_LVL_WR_BRST_LEN_MASK) -/*! @} */ - -/*! @name MIX_CTRL - Mixer Control */ -/*! @{ */ - -#define USDHC_MIX_CTRL_DMAEN_MASK (0x1U) -#define USDHC_MIX_CTRL_DMAEN_SHIFT (0U) -/*! DMAEN - DMA enable - * 0b1..Enable - * 0b0..Disable - */ -#define USDHC_MIX_CTRL_DMAEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MIX_CTRL_DMAEN_SHIFT)) & USDHC_MIX_CTRL_DMAEN_MASK) - -#define USDHC_MIX_CTRL_BCEN_MASK (0x2U) -#define USDHC_MIX_CTRL_BCEN_SHIFT (1U) -/*! BCEN - Block count enable - * 0b1..Enable - * 0b0..Disable - */ -#define USDHC_MIX_CTRL_BCEN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MIX_CTRL_BCEN_SHIFT)) & USDHC_MIX_CTRL_BCEN_MASK) - -#define USDHC_MIX_CTRL_AC12EN_MASK (0x4U) -#define USDHC_MIX_CTRL_AC12EN_SHIFT (2U) -/*! AC12EN - Auto CMD12 enable - * 0b1..Enable - * 0b0..Disable - */ -#define USDHC_MIX_CTRL_AC12EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MIX_CTRL_AC12EN_SHIFT)) & USDHC_MIX_CTRL_AC12EN_MASK) - -#define USDHC_MIX_CTRL_DDR_EN_MASK (0x8U) -#define USDHC_MIX_CTRL_DDR_EN_SHIFT (3U) -/*! DDR_EN - Dual data rate mode selection */ -#define USDHC_MIX_CTRL_DDR_EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MIX_CTRL_DDR_EN_SHIFT)) & USDHC_MIX_CTRL_DDR_EN_MASK) - -#define USDHC_MIX_CTRL_DTDSEL_MASK (0x10U) -#define USDHC_MIX_CTRL_DTDSEL_SHIFT (4U) -/*! DTDSEL - Data transfer direction select - * 0b1..Read (Card to host) - * 0b0..Write (Host to card) - */ -#define USDHC_MIX_CTRL_DTDSEL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MIX_CTRL_DTDSEL_SHIFT)) & USDHC_MIX_CTRL_DTDSEL_MASK) - -#define USDHC_MIX_CTRL_MSBSEL_MASK (0x20U) -#define USDHC_MIX_CTRL_MSBSEL_SHIFT (5U) -/*! MSBSEL - Multi / Single block select - * 0b1..Multiple blocks - * 0b0..Single block - */ -#define USDHC_MIX_CTRL_MSBSEL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MIX_CTRL_MSBSEL_SHIFT)) & USDHC_MIX_CTRL_MSBSEL_MASK) - -#define USDHC_MIX_CTRL_NIBBLE_POS_MASK (0x40U) -#define USDHC_MIX_CTRL_NIBBLE_POS_SHIFT (6U) -/*! NIBBLE_POS - Nibble position indication */ -#define USDHC_MIX_CTRL_NIBBLE_POS(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MIX_CTRL_NIBBLE_POS_SHIFT)) & USDHC_MIX_CTRL_NIBBLE_POS_MASK) - -#define USDHC_MIX_CTRL_AC23EN_MASK (0x80U) -#define USDHC_MIX_CTRL_AC23EN_SHIFT (7U) -/*! AC23EN - Auto CMD23 enable */ -#define USDHC_MIX_CTRL_AC23EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MIX_CTRL_AC23EN_SHIFT)) & USDHC_MIX_CTRL_AC23EN_MASK) - -#define USDHC_MIX_CTRL_EXE_TUNE_MASK (0x400000U) -#define USDHC_MIX_CTRL_EXE_TUNE_SHIFT (22U) -/*! EXE_TUNE - Execute tuning: (Only used for SD3.0, SDR104 mode) - * 0b1..Execute tuning - * 0b0..Not tuned or tuning completed - */ -#define USDHC_MIX_CTRL_EXE_TUNE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MIX_CTRL_EXE_TUNE_SHIFT)) & USDHC_MIX_CTRL_EXE_TUNE_MASK) - -#define USDHC_MIX_CTRL_SMP_CLK_SEL_MASK (0x800000U) -#define USDHC_MIX_CTRL_SMP_CLK_SEL_SHIFT (23U) -/*! SMP_CLK_SEL - Clock selection - * 0b1..Tuned clock is used to sample data / cmd - * 0b0..Fixed clock is used to sample data / cmd - */ -#define USDHC_MIX_CTRL_SMP_CLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MIX_CTRL_SMP_CLK_SEL_SHIFT)) & USDHC_MIX_CTRL_SMP_CLK_SEL_MASK) - -#define USDHC_MIX_CTRL_AUTO_TUNE_EN_MASK (0x1000000U) -#define USDHC_MIX_CTRL_AUTO_TUNE_EN_SHIFT (24U) -/*! AUTO_TUNE_EN - Auto tuning enable (Only used for SD3.0, SDR104 mode) - * 0b1..Enable auto tuning - * 0b0..Disable auto tuning - */ -#define USDHC_MIX_CTRL_AUTO_TUNE_EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MIX_CTRL_AUTO_TUNE_EN_SHIFT)) & USDHC_MIX_CTRL_AUTO_TUNE_EN_MASK) - -#define USDHC_MIX_CTRL_FBCLK_SEL_MASK (0x2000000U) -#define USDHC_MIX_CTRL_FBCLK_SEL_SHIFT (25U) -/*! FBCLK_SEL - Feedback clock source selection (Only used for SD3.0, SDR104 mode) - * 0b1..Feedback clock comes from the ipp_card_clk_out - * 0b0..Feedback clock comes from the loopback CLK - */ -#define USDHC_MIX_CTRL_FBCLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MIX_CTRL_FBCLK_SEL_SHIFT)) & USDHC_MIX_CTRL_FBCLK_SEL_MASK) -/*! @} */ - -/*! @name FORCE_EVENT - Force Event */ -/*! @{ */ - -#define USDHC_FORCE_EVENT_FEVTAC12NE_MASK (0x1U) -#define USDHC_FORCE_EVENT_FEVTAC12NE_SHIFT (0U) -/*! FEVTAC12NE - Force event auto command 12 not executed */ -#define USDHC_FORCE_EVENT_FEVTAC12NE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTAC12NE_SHIFT)) & USDHC_FORCE_EVENT_FEVTAC12NE_MASK) - -#define USDHC_FORCE_EVENT_FEVTAC12TOE_MASK (0x2U) -#define USDHC_FORCE_EVENT_FEVTAC12TOE_SHIFT (1U) -/*! FEVTAC12TOE - Force event auto command 12 time out error */ -#define USDHC_FORCE_EVENT_FEVTAC12TOE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTAC12TOE_SHIFT)) & USDHC_FORCE_EVENT_FEVTAC12TOE_MASK) - -#define USDHC_FORCE_EVENT_FEVTAC12CE_MASK (0x4U) -#define USDHC_FORCE_EVENT_FEVTAC12CE_SHIFT (2U) -/*! FEVTAC12CE - Force event auto command 12 CRC error */ -#define USDHC_FORCE_EVENT_FEVTAC12CE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTAC12CE_SHIFT)) & USDHC_FORCE_EVENT_FEVTAC12CE_MASK) - -#define USDHC_FORCE_EVENT_FEVTAC12EBE_MASK (0x8U) -#define USDHC_FORCE_EVENT_FEVTAC12EBE_SHIFT (3U) -/*! FEVTAC12EBE - Force event Auto Command 12 end bit error */ -#define USDHC_FORCE_EVENT_FEVTAC12EBE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTAC12EBE_SHIFT)) & USDHC_FORCE_EVENT_FEVTAC12EBE_MASK) - -#define USDHC_FORCE_EVENT_FEVTAC12IE_MASK (0x10U) -#define USDHC_FORCE_EVENT_FEVTAC12IE_SHIFT (4U) -/*! FEVTAC12IE - Force event Auto Command 12 index error */ -#define USDHC_FORCE_EVENT_FEVTAC12IE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTAC12IE_SHIFT)) & USDHC_FORCE_EVENT_FEVTAC12IE_MASK) - -#define USDHC_FORCE_EVENT_FEVTCNIBAC12E_MASK (0x80U) -#define USDHC_FORCE_EVENT_FEVTCNIBAC12E_SHIFT (7U) -/*! FEVTCNIBAC12E - Force event command not executed by Auto Command 12 error */ -#define USDHC_FORCE_EVENT_FEVTCNIBAC12E(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTCNIBAC12E_SHIFT)) & USDHC_FORCE_EVENT_FEVTCNIBAC12E_MASK) - -#define USDHC_FORCE_EVENT_FEVTCTOE_MASK (0x10000U) -#define USDHC_FORCE_EVENT_FEVTCTOE_SHIFT (16U) -/*! FEVTCTOE - Force event command time out error */ -#define USDHC_FORCE_EVENT_FEVTCTOE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTCTOE_SHIFT)) & USDHC_FORCE_EVENT_FEVTCTOE_MASK) - -#define USDHC_FORCE_EVENT_FEVTCCE_MASK (0x20000U) -#define USDHC_FORCE_EVENT_FEVTCCE_SHIFT (17U) -/*! FEVTCCE - Force event command CRC error */ -#define USDHC_FORCE_EVENT_FEVTCCE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTCCE_SHIFT)) & USDHC_FORCE_EVENT_FEVTCCE_MASK) - -#define USDHC_FORCE_EVENT_FEVTCEBE_MASK (0x40000U) -#define USDHC_FORCE_EVENT_FEVTCEBE_SHIFT (18U) -/*! FEVTCEBE - Force event command end bit error */ -#define USDHC_FORCE_EVENT_FEVTCEBE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTCEBE_SHIFT)) & USDHC_FORCE_EVENT_FEVTCEBE_MASK) - -#define USDHC_FORCE_EVENT_FEVTCIE_MASK (0x80000U) -#define USDHC_FORCE_EVENT_FEVTCIE_SHIFT (19U) -/*! FEVTCIE - Force event command index error */ -#define USDHC_FORCE_EVENT_FEVTCIE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTCIE_SHIFT)) & USDHC_FORCE_EVENT_FEVTCIE_MASK) - -#define USDHC_FORCE_EVENT_FEVTDTOE_MASK (0x100000U) -#define USDHC_FORCE_EVENT_FEVTDTOE_SHIFT (20U) -/*! FEVTDTOE - Force event data time out error */ -#define USDHC_FORCE_EVENT_FEVTDTOE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTDTOE_SHIFT)) & USDHC_FORCE_EVENT_FEVTDTOE_MASK) - -#define USDHC_FORCE_EVENT_FEVTDCE_MASK (0x200000U) -#define USDHC_FORCE_EVENT_FEVTDCE_SHIFT (21U) -/*! FEVTDCE - Force event data CRC error */ -#define USDHC_FORCE_EVENT_FEVTDCE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTDCE_SHIFT)) & USDHC_FORCE_EVENT_FEVTDCE_MASK) - -#define USDHC_FORCE_EVENT_FEVTDEBE_MASK (0x400000U) -#define USDHC_FORCE_EVENT_FEVTDEBE_SHIFT (22U) -/*! FEVTDEBE - Force event data end bit error */ -#define USDHC_FORCE_EVENT_FEVTDEBE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTDEBE_SHIFT)) & USDHC_FORCE_EVENT_FEVTDEBE_MASK) - -#define USDHC_FORCE_EVENT_FEVTAC12E_MASK (0x1000000U) -#define USDHC_FORCE_EVENT_FEVTAC12E_SHIFT (24U) -/*! FEVTAC12E - Force event Auto Command 12 error */ -#define USDHC_FORCE_EVENT_FEVTAC12E(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTAC12E_SHIFT)) & USDHC_FORCE_EVENT_FEVTAC12E_MASK) - -#define USDHC_FORCE_EVENT_FEVTTNE_MASK (0x4000000U) -#define USDHC_FORCE_EVENT_FEVTTNE_SHIFT (26U) -/*! FEVTTNE - Force tuning error */ -#define USDHC_FORCE_EVENT_FEVTTNE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTTNE_SHIFT)) & USDHC_FORCE_EVENT_FEVTTNE_MASK) - -#define USDHC_FORCE_EVENT_FEVTDMAE_MASK (0x10000000U) -#define USDHC_FORCE_EVENT_FEVTDMAE_SHIFT (28U) -/*! FEVTDMAE - Force event DMA error */ -#define USDHC_FORCE_EVENT_FEVTDMAE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTDMAE_SHIFT)) & USDHC_FORCE_EVENT_FEVTDMAE_MASK) - -#define USDHC_FORCE_EVENT_FEVTCINT_MASK (0x80000000U) -#define USDHC_FORCE_EVENT_FEVTCINT_SHIFT (31U) -/*! FEVTCINT - Force event card interrupt */ -#define USDHC_FORCE_EVENT_FEVTCINT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_FORCE_EVENT_FEVTCINT_SHIFT)) & USDHC_FORCE_EVENT_FEVTCINT_MASK) -/*! @} */ - -/*! @name ADMA_ERR_STATUS - ADMA Error Status */ -/*! @{ */ - -#define USDHC_ADMA_ERR_STATUS_ADMAES_MASK (0x3U) -#define USDHC_ADMA_ERR_STATUS_ADMAES_SHIFT (0U) -/*! ADMAES - ADMA error state (when ADMA error is occurred) */ -#define USDHC_ADMA_ERR_STATUS_ADMAES(x) (((uint32_t)(((uint32_t)(x)) << USDHC_ADMA_ERR_STATUS_ADMAES_SHIFT)) & USDHC_ADMA_ERR_STATUS_ADMAES_MASK) - -#define USDHC_ADMA_ERR_STATUS_ADMALME_MASK (0x4U) -#define USDHC_ADMA_ERR_STATUS_ADMALME_SHIFT (2U) -/*! ADMALME - ADMA length mismatch error - * 0b1..Error - * 0b0..No error - */ -#define USDHC_ADMA_ERR_STATUS_ADMALME(x) (((uint32_t)(((uint32_t)(x)) << USDHC_ADMA_ERR_STATUS_ADMALME_SHIFT)) & USDHC_ADMA_ERR_STATUS_ADMALME_MASK) - -#define USDHC_ADMA_ERR_STATUS_ADMADCE_MASK (0x8U) -#define USDHC_ADMA_ERR_STATUS_ADMADCE_SHIFT (3U) -/*! ADMADCE - ADMA descriptor error - * 0b1..Error - * 0b0..No error - */ -#define USDHC_ADMA_ERR_STATUS_ADMADCE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_ADMA_ERR_STATUS_ADMADCE_SHIFT)) & USDHC_ADMA_ERR_STATUS_ADMADCE_MASK) -/*! @} */ - -/*! @name ADMA_SYS_ADDR - ADMA System Address */ -/*! @{ */ - -#define USDHC_ADMA_SYS_ADDR_ADS_ADDR_MASK (0xFFFFFFFCU) -#define USDHC_ADMA_SYS_ADDR_ADS_ADDR_SHIFT (2U) -/*! ADS_ADDR - ADMA system address */ -#define USDHC_ADMA_SYS_ADDR_ADS_ADDR(x) (((uint32_t)(((uint32_t)(x)) << USDHC_ADMA_SYS_ADDR_ADS_ADDR_SHIFT)) & USDHC_ADMA_SYS_ADDR_ADS_ADDR_MASK) -/*! @} */ - -/*! @name DLL_CTRL - DLL (Delay Line) Control */ -/*! @{ */ - -#define USDHC_DLL_CTRL_DLL_CTRL_ENABLE_MASK (0x1U) -#define USDHC_DLL_CTRL_DLL_CTRL_ENABLE_SHIFT (0U) -/*! DLL_CTRL_ENABLE - DLL and delay chain */ -#define USDHC_DLL_CTRL_DLL_CTRL_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DLL_CTRL_DLL_CTRL_ENABLE_SHIFT)) & USDHC_DLL_CTRL_DLL_CTRL_ENABLE_MASK) - -#define USDHC_DLL_CTRL_DLL_CTRL_RESET_MASK (0x2U) -#define USDHC_DLL_CTRL_DLL_CTRL_RESET_SHIFT (1U) -/*! DLL_CTRL_RESET - DLL reset */ -#define USDHC_DLL_CTRL_DLL_CTRL_RESET(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DLL_CTRL_DLL_CTRL_RESET_SHIFT)) & USDHC_DLL_CTRL_DLL_CTRL_RESET_MASK) - -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_FORCE_UPD_MASK (0x4U) -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_FORCE_UPD_SHIFT (2U) -/*! DLL_CTRL_SLV_FORCE_UPD - DLL slave delay line */ -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_FORCE_UPD(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DLL_CTRL_DLL_CTRL_SLV_FORCE_UPD_SHIFT)) & USDHC_DLL_CTRL_DLL_CTRL_SLV_FORCE_UPD_MASK) - -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET0_MASK (0x78U) -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET0_SHIFT (3U) -/*! DLL_CTRL_SLV_DLY_TARGET0 - DLL slave delay target0 */ -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET0(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET0_SHIFT)) & USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET0_MASK) - -#define USDHC_DLL_CTRL_DLL_CTRL_GATE_UPDATE_MASK (0x80U) -#define USDHC_DLL_CTRL_DLL_CTRL_GATE_UPDATE_SHIFT (7U) -/*! DLL_CTRL_GATE_UPDATE - DLL gate update */ -#define USDHC_DLL_CTRL_DLL_CTRL_GATE_UPDATE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DLL_CTRL_DLL_CTRL_GATE_UPDATE_SHIFT)) & USDHC_DLL_CTRL_DLL_CTRL_GATE_UPDATE_MASK) - -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_MASK (0x100U) -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_SHIFT (8U) -/*! DLL_CTRL_SLV_OVERRIDE - DLL slave override */ -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_SHIFT)) & USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_MASK) - -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_VAL_MASK (0xFE00U) -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_VAL_SHIFT (9U) -/*! DLL_CTRL_SLV_OVERRIDE_VAL - DLL slave override val */ -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_VAL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_VAL_SHIFT)) & USDHC_DLL_CTRL_DLL_CTRL_SLV_OVERRIDE_VAL_MASK) - -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET1_MASK (0x70000U) -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET1_SHIFT (16U) -/*! DLL_CTRL_SLV_DLY_TARGET1 - DLL slave delay target1 */ -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET1(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET1_SHIFT)) & USDHC_DLL_CTRL_DLL_CTRL_SLV_DLY_TARGET1_MASK) - -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_UPDATE_INT_MASK (0xFF00000U) -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_UPDATE_INT_SHIFT (20U) -/*! DLL_CTRL_SLV_UPDATE_INT - Slave delay line update interval */ -#define USDHC_DLL_CTRL_DLL_CTRL_SLV_UPDATE_INT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DLL_CTRL_DLL_CTRL_SLV_UPDATE_INT_SHIFT)) & USDHC_DLL_CTRL_DLL_CTRL_SLV_UPDATE_INT_MASK) - -#define USDHC_DLL_CTRL_DLL_CTRL_REF_UPDATE_INT_MASK (0xF0000000U) -#define USDHC_DLL_CTRL_DLL_CTRL_REF_UPDATE_INT_SHIFT (28U) -/*! DLL_CTRL_REF_UPDATE_INT - DLL control loop update interval */ -#define USDHC_DLL_CTRL_DLL_CTRL_REF_UPDATE_INT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DLL_CTRL_DLL_CTRL_REF_UPDATE_INT_SHIFT)) & USDHC_DLL_CTRL_DLL_CTRL_REF_UPDATE_INT_MASK) -/*! @} */ - -/*! @name DLL_STATUS - DLL Status */ -/*! @{ */ - -#define USDHC_DLL_STATUS_DLL_STS_SLV_LOCK_MASK (0x1U) -#define USDHC_DLL_STATUS_DLL_STS_SLV_LOCK_SHIFT (0U) -/*! DLL_STS_SLV_LOCK - Slave delay-line lock status */ -#define USDHC_DLL_STATUS_DLL_STS_SLV_LOCK(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DLL_STATUS_DLL_STS_SLV_LOCK_SHIFT)) & USDHC_DLL_STATUS_DLL_STS_SLV_LOCK_MASK) - -#define USDHC_DLL_STATUS_DLL_STS_REF_LOCK_MASK (0x2U) -#define USDHC_DLL_STATUS_DLL_STS_REF_LOCK_SHIFT (1U) -/*! DLL_STS_REF_LOCK - Reference DLL lock status */ -#define USDHC_DLL_STATUS_DLL_STS_REF_LOCK(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DLL_STATUS_DLL_STS_REF_LOCK_SHIFT)) & USDHC_DLL_STATUS_DLL_STS_REF_LOCK_MASK) - -#define USDHC_DLL_STATUS_DLL_STS_SLV_SEL_MASK (0x1FCU) -#define USDHC_DLL_STATUS_DLL_STS_SLV_SEL_SHIFT (2U) -/*! DLL_STS_SLV_SEL - Slave delay line select status */ -#define USDHC_DLL_STATUS_DLL_STS_SLV_SEL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DLL_STATUS_DLL_STS_SLV_SEL_SHIFT)) & USDHC_DLL_STATUS_DLL_STS_SLV_SEL_MASK) - -#define USDHC_DLL_STATUS_DLL_STS_REF_SEL_MASK (0xFE00U) -#define USDHC_DLL_STATUS_DLL_STS_REF_SEL_SHIFT (9U) -/*! DLL_STS_REF_SEL - Reference delay line select taps */ -#define USDHC_DLL_STATUS_DLL_STS_REF_SEL(x) (((uint32_t)(((uint32_t)(x)) << USDHC_DLL_STATUS_DLL_STS_REF_SEL_SHIFT)) & USDHC_DLL_STATUS_DLL_STS_REF_SEL_MASK) -/*! @} */ - -/*! @name CLK_TUNE_CTRL_STATUS - CLK Tuning Control and Status */ -/*! @{ */ - -#define USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_POST_MASK (0xFU) -#define USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_POST_SHIFT (0U) -/*! DLY_CELL_SET_POST - Delay cells on the feedback clock between CLK_OUT and CLK_POST */ -#define USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_POST(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_POST_SHIFT)) & USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_POST_MASK) - -#define USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_OUT_MASK (0xF0U) -#define USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_OUT_SHIFT (4U) -/*! DLY_CELL_SET_OUT - Delay cells on the feedback clock between CLK_PRE and CLK_OUT */ -#define USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_OUT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_OUT_SHIFT)) & USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_OUT_MASK) - -#define USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE_MASK (0x7F00U) -#define USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE_SHIFT (8U) -/*! DLY_CELL_SET_PRE - delay cells on the feedback clock between the feedback clock and CLK_PRE */ -#define USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE_SHIFT)) & USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE_MASK) - -#define USDHC_CLK_TUNE_CTRL_STATUS_NXT_ERR_MASK (0x8000U) -#define USDHC_CLK_TUNE_CTRL_STATUS_NXT_ERR_SHIFT (15U) -/*! NXT_ERR - NXT error */ -#define USDHC_CLK_TUNE_CTRL_STATUS_NXT_ERR(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CLK_TUNE_CTRL_STATUS_NXT_ERR_SHIFT)) & USDHC_CLK_TUNE_CTRL_STATUS_NXT_ERR_MASK) - -#define USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_POST_MASK (0xF0000U) -#define USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_POST_SHIFT (16U) -/*! TAP_SEL_POST - Delay cells added on the feedback clock between CLK_OUT and CLK_POST */ -#define USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_POST(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_POST_SHIFT)) & USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_POST_MASK) - -#define USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_OUT_MASK (0xF00000U) -#define USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_OUT_SHIFT (20U) -/*! TAP_SEL_OUT - Delay cells added on the feedback clock between CLK_PRE and CLK_OUT */ -#define USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_OUT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_OUT_SHIFT)) & USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_OUT_MASK) - -#define USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_PRE_MASK (0x7F000000U) -#define USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_PRE_SHIFT (24U) -/*! TAP_SEL_PRE - TAP_SEL_PRE */ -#define USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_PRE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_PRE_SHIFT)) & USDHC_CLK_TUNE_CTRL_STATUS_TAP_SEL_PRE_MASK) - -#define USDHC_CLK_TUNE_CTRL_STATUS_PRE_ERR_MASK (0x80000000U) -#define USDHC_CLK_TUNE_CTRL_STATUS_PRE_ERR_SHIFT (31U) -/*! PRE_ERR - PRE error */ -#define USDHC_CLK_TUNE_CTRL_STATUS_PRE_ERR(x) (((uint32_t)(((uint32_t)(x)) << USDHC_CLK_TUNE_CTRL_STATUS_PRE_ERR_SHIFT)) & USDHC_CLK_TUNE_CTRL_STATUS_PRE_ERR_MASK) -/*! @} */ - -/*! @name VEND_SPEC - Vendor Specific Register */ -/*! @{ */ - -#define USDHC_VEND_SPEC_AC12_WR_CHKBUSY_EN_MASK (0x8U) -#define USDHC_VEND_SPEC_AC12_WR_CHKBUSY_EN_SHIFT (3U) -/*! AC12_WR_CHKBUSY_EN - Check busy enable - * 0b0..Do not check busy after auto CMD12 for write data packet - * 0b1..Check busy after auto CMD12 for write data packet - */ -#define USDHC_VEND_SPEC_AC12_WR_CHKBUSY_EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_VEND_SPEC_AC12_WR_CHKBUSY_EN_SHIFT)) & USDHC_VEND_SPEC_AC12_WR_CHKBUSY_EN_MASK) - -#define USDHC_VEND_SPEC_FRC_SDCLK_ON_MASK (0x100U) -#define USDHC_VEND_SPEC_FRC_SDCLK_ON_SHIFT (8U) -/*! FRC_SDCLK_ON - Force CLK - * 0b0..CLK active or inactive is fully controlled by the hardware. - * 0b1..Force CLK active - */ -#define USDHC_VEND_SPEC_FRC_SDCLK_ON(x) (((uint32_t)(((uint32_t)(x)) << USDHC_VEND_SPEC_FRC_SDCLK_ON_SHIFT)) & USDHC_VEND_SPEC_FRC_SDCLK_ON_MASK) - -#define USDHC_VEND_SPEC_CRC_CHK_DIS_MASK (0x8000U) -#define USDHC_VEND_SPEC_CRC_CHK_DIS_SHIFT (15U) -/*! CRC_CHK_DIS - CRC Check Disable - * 0b0..Check CRC16 for every read data packet and check CRC fields for every write data packet - * 0b1..Ignore CRC16 check for every read data packet and ignore CRC fields check for every write data packet - */ -#define USDHC_VEND_SPEC_CRC_CHK_DIS(x) (((uint32_t)(((uint32_t)(x)) << USDHC_VEND_SPEC_CRC_CHK_DIS_SHIFT)) & USDHC_VEND_SPEC_CRC_CHK_DIS_MASK) - -#define USDHC_VEND_SPEC_CMD_BYTE_EN_MASK (0x80000000U) -#define USDHC_VEND_SPEC_CMD_BYTE_EN_SHIFT (31U) -/*! CMD_BYTE_EN - Register byte access for CMD_XFR_TYP - * 0b0..Disable. MIX_CTRL[7:0] is read/write and CMD_XFR_TYP[7:0] is read-only. - * 0b1..Enable. MIX_CTRL[7:0] is read-only and CMD_XFR_TYP[7:0] is read/write. - */ -#define USDHC_VEND_SPEC_CMD_BYTE_EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_VEND_SPEC_CMD_BYTE_EN_SHIFT)) & USDHC_VEND_SPEC_CMD_BYTE_EN_MASK) -/*! @} */ - -/*! @name MMC_BOOT - eMMC Boot */ -/*! @{ */ - -#define USDHC_MMC_BOOT_DTOCV_ACK_MASK (0xFU) -#define USDHC_MMC_BOOT_DTOCV_ACK_SHIFT (0U) -/*! DTOCV_ACK - Boot ACK time out - * 0b0000..SDCLK x 2^14 - * 0b0001..SDCLK x 2^15 - * 0b0010..SDCLK x 2^16 - * 0b0011..SDCLK x 2^17 - * 0b0100..SDCLK x 2^18 - * 0b0101..SDCLK x 2^19 - * 0b0110..SDCLK x 2^20 - * 0b0111..SDCLK x 2^21 - * 0b1110..SDCLK x 2^28 - * 0b1111..SDCLK x 2^29 - */ -#define USDHC_MMC_BOOT_DTOCV_ACK(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MMC_BOOT_DTOCV_ACK_SHIFT)) & USDHC_MMC_BOOT_DTOCV_ACK_MASK) - -#define USDHC_MMC_BOOT_BOOT_ACK_MASK (0x10U) -#define USDHC_MMC_BOOT_BOOT_ACK_SHIFT (4U) -/*! BOOT_ACK - BOOT ACK - * 0b0..No ack - * 0b1..Ack - */ -#define USDHC_MMC_BOOT_BOOT_ACK(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MMC_BOOT_BOOT_ACK_SHIFT)) & USDHC_MMC_BOOT_BOOT_ACK_MASK) - -#define USDHC_MMC_BOOT_BOOT_MODE_MASK (0x20U) -#define USDHC_MMC_BOOT_BOOT_MODE_SHIFT (5U) -/*! BOOT_MODE - Boot mode - * 0b0..Normal boot - * 0b1..Alternative boot - */ -#define USDHC_MMC_BOOT_BOOT_MODE(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MMC_BOOT_BOOT_MODE_SHIFT)) & USDHC_MMC_BOOT_BOOT_MODE_MASK) - -#define USDHC_MMC_BOOT_BOOT_EN_MASK (0x40U) -#define USDHC_MMC_BOOT_BOOT_EN_SHIFT (6U) -/*! BOOT_EN - Boot enable - * 0b0..Fast boot disable - * 0b1..Fast boot enable - */ -#define USDHC_MMC_BOOT_BOOT_EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MMC_BOOT_BOOT_EN_SHIFT)) & USDHC_MMC_BOOT_BOOT_EN_MASK) - -#define USDHC_MMC_BOOT_AUTO_SABG_EN_MASK (0x80U) -#define USDHC_MMC_BOOT_AUTO_SABG_EN_SHIFT (7U) -/*! AUTO_SABG_EN - Auto stop at block gap */ -#define USDHC_MMC_BOOT_AUTO_SABG_EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MMC_BOOT_AUTO_SABG_EN_SHIFT)) & USDHC_MMC_BOOT_AUTO_SABG_EN_MASK) - -#define USDHC_MMC_BOOT_DISABLE_TIME_OUT_MASK (0x100U) -#define USDHC_MMC_BOOT_DISABLE_TIME_OUT_SHIFT (8U) -/*! DISABLE_TIME_OUT - Time out - * 0b0..Enable time out - * 0b1..Disable time out - */ -#define USDHC_MMC_BOOT_DISABLE_TIME_OUT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MMC_BOOT_DISABLE_TIME_OUT_SHIFT)) & USDHC_MMC_BOOT_DISABLE_TIME_OUT_MASK) - -#define USDHC_MMC_BOOT_BOOT_BLK_CNT_MASK (0xFFFF0000U) -#define USDHC_MMC_BOOT_BOOT_BLK_CNT_SHIFT (16U) -/*! BOOT_BLK_CNT - Stop At Block Gap value of automatic mode */ -#define USDHC_MMC_BOOT_BOOT_BLK_CNT(x) (((uint32_t)(((uint32_t)(x)) << USDHC_MMC_BOOT_BOOT_BLK_CNT_SHIFT)) & USDHC_MMC_BOOT_BOOT_BLK_CNT_MASK) -/*! @} */ - -/*! @name VEND_SPEC2 - Vendor Specific 2 Register */ -/*! @{ */ - -#define USDHC_VEND_SPEC2_CARD_INT_D3_TEST_MASK (0x8U) -#define USDHC_VEND_SPEC2_CARD_INT_D3_TEST_SHIFT (3U) -/*! CARD_INT_D3_TEST - Card interrupt detection test - * 0b0..Check the card interrupt only when DATA3 is high. - * 0b1..Check the card interrupt by ignoring the status of DATA3. - */ -#define USDHC_VEND_SPEC2_CARD_INT_D3_TEST(x) (((uint32_t)(((uint32_t)(x)) << USDHC_VEND_SPEC2_CARD_INT_D3_TEST_SHIFT)) & USDHC_VEND_SPEC2_CARD_INT_D3_TEST_MASK) - -#define USDHC_VEND_SPEC2_TUNING_BIT_EN_MASK (0x30U) -#define USDHC_VEND_SPEC2_TUNING_BIT_EN_SHIFT (4U) -/*! TUNING_BIT_EN - Tuning bit enable - * 0b00..Enable Tuning circuit for DATA[3:0] - * 0b01..Enable Tuning circuit for DATA[7:0] - * 0b10..Enable Tuning circuit for DATA[0] - * 0b11..Invalid - */ -#define USDHC_VEND_SPEC2_TUNING_BIT_EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_VEND_SPEC2_TUNING_BIT_EN_SHIFT)) & USDHC_VEND_SPEC2_TUNING_BIT_EN_MASK) - -#define USDHC_VEND_SPEC2_TUNING_CMD_EN_MASK (0x40U) -#define USDHC_VEND_SPEC2_TUNING_CMD_EN_SHIFT (6U) -/*! TUNING_CMD_EN - Tuning command enable - * 0b0..Auto tuning circuit does not check the CMD line. - * 0b1..Auto tuning circuit checks the CMD line. - */ -#define USDHC_VEND_SPEC2_TUNING_CMD_EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_VEND_SPEC2_TUNING_CMD_EN_SHIFT)) & USDHC_VEND_SPEC2_TUNING_CMD_EN_MASK) - -#define USDHC_VEND_SPEC2_ACMD23_ARGU2_EN_MASK (0x1000U) -#define USDHC_VEND_SPEC2_ACMD23_ARGU2_EN_SHIFT (12U) -/*! ACMD23_ARGU2_EN - Argument2 register enable for ACMD23 - * 0b1..Argument2 register enable for ACMD23 sharing with SDMA system address register. Default is enabled. - * 0b0..Disable - */ -#define USDHC_VEND_SPEC2_ACMD23_ARGU2_EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_VEND_SPEC2_ACMD23_ARGU2_EN_SHIFT)) & USDHC_VEND_SPEC2_ACMD23_ARGU2_EN_MASK) - -#define USDHC_VEND_SPEC2_EN_32K_CLK_MASK (0x8000U) -#define USDHC_VEND_SPEC2_EN_32K_CLK_SHIFT (15U) -/*! EN_32K_CLK - Select the clock source for host card detection. - * 0b0..Use the peripheral clock (ipg_clk) for card detection. - * 0b1..Use the low power clock (ipg_clk_lp) for card detection. - */ -#define USDHC_VEND_SPEC2_EN_32K_CLK(x) (((uint32_t)(((uint32_t)(x)) << USDHC_VEND_SPEC2_EN_32K_CLK_SHIFT)) & USDHC_VEND_SPEC2_EN_32K_CLK_MASK) -/*! @} */ - -/*! @name TUNING_CTRL - Tuning Control */ -/*! @{ */ - -#define USDHC_TUNING_CTRL_TUNING_START_TAP_MASK (0x7FU) -#define USDHC_TUNING_CTRL_TUNING_START_TAP_SHIFT (0U) -/*! TUNING_START_TAP - Tuning start */ -#define USDHC_TUNING_CTRL_TUNING_START_TAP(x) (((uint32_t)(((uint32_t)(x)) << USDHC_TUNING_CTRL_TUNING_START_TAP_SHIFT)) & USDHC_TUNING_CTRL_TUNING_START_TAP_MASK) - -#define USDHC_TUNING_CTRL_DIS_CMD_CHK_FOR_STD_TUNING_MASK (0x80U) -#define USDHC_TUNING_CTRL_DIS_CMD_CHK_FOR_STD_TUNING_SHIFT (7U) -/*! DIS_CMD_CHK_FOR_STD_TUNING - Disable command check for standard tuning */ -#define USDHC_TUNING_CTRL_DIS_CMD_CHK_FOR_STD_TUNING(x) (((uint32_t)(((uint32_t)(x)) << USDHC_TUNING_CTRL_DIS_CMD_CHK_FOR_STD_TUNING_SHIFT)) & USDHC_TUNING_CTRL_DIS_CMD_CHK_FOR_STD_TUNING_MASK) - -#define USDHC_TUNING_CTRL_TUNING_COUNTER_MASK (0xFF00U) -#define USDHC_TUNING_CTRL_TUNING_COUNTER_SHIFT (8U) -/*! TUNING_COUNTER - Tuning counter */ -#define USDHC_TUNING_CTRL_TUNING_COUNTER(x) (((uint32_t)(((uint32_t)(x)) << USDHC_TUNING_CTRL_TUNING_COUNTER_SHIFT)) & USDHC_TUNING_CTRL_TUNING_COUNTER_MASK) - -#define USDHC_TUNING_CTRL_TUNING_STEP_MASK (0x70000U) -#define USDHC_TUNING_CTRL_TUNING_STEP_SHIFT (16U) -/*! TUNING_STEP - TUNING_STEP */ -#define USDHC_TUNING_CTRL_TUNING_STEP(x) (((uint32_t)(((uint32_t)(x)) << USDHC_TUNING_CTRL_TUNING_STEP_SHIFT)) & USDHC_TUNING_CTRL_TUNING_STEP_MASK) - -#define USDHC_TUNING_CTRL_TUNING_WINDOW_MASK (0x700000U) -#define USDHC_TUNING_CTRL_TUNING_WINDOW_SHIFT (20U) -/*! TUNING_WINDOW - Data window */ -#define USDHC_TUNING_CTRL_TUNING_WINDOW(x) (((uint32_t)(((uint32_t)(x)) << USDHC_TUNING_CTRL_TUNING_WINDOW_SHIFT)) & USDHC_TUNING_CTRL_TUNING_WINDOW_MASK) - -#define USDHC_TUNING_CTRL_STD_TUNING_EN_MASK (0x1000000U) -#define USDHC_TUNING_CTRL_STD_TUNING_EN_SHIFT (24U) -/*! STD_TUNING_EN - Standard tuning circuit and procedure enable */ -#define USDHC_TUNING_CTRL_STD_TUNING_EN(x) (((uint32_t)(((uint32_t)(x)) << USDHC_TUNING_CTRL_STD_TUNING_EN_SHIFT)) & USDHC_TUNING_CTRL_STD_TUNING_EN_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group USDHC_Register_Masks */ - - -/* USDHC - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral USDHC0 base address */ - #define USDHC0_BASE (0x50109000u) - /** Peripheral USDHC0 base address */ - #define USDHC0_BASE_NS (0x40109000u) - /** Peripheral USDHC0 base pointer */ - #define USDHC0 ((USDHC_Type *)USDHC0_BASE) - /** Peripheral USDHC0 base pointer */ - #define USDHC0_NS ((USDHC_Type *)USDHC0_BASE_NS) - /** Array initializer of USDHC peripheral base addresses */ - #define USDHC_BASE_ADDRS { USDHC0_BASE } - /** Array initializer of USDHC peripheral base pointers */ - #define USDHC_BASE_PTRS { USDHC0 } - /** Array initializer of USDHC peripheral base addresses */ - #define USDHC_BASE_ADDRS_NS { USDHC0_BASE_NS } - /** Array initializer of USDHC peripheral base pointers */ - #define USDHC_BASE_PTRS_NS { USDHC0_NS } -#else - /** Peripheral USDHC0 base address */ - #define USDHC0_BASE (0x40109000u) - /** Peripheral USDHC0 base pointer */ - #define USDHC0 ((USDHC_Type *)USDHC0_BASE) - /** Array initializer of USDHC peripheral base addresses */ - #define USDHC_BASE_ADDRS { USDHC0_BASE } - /** Array initializer of USDHC peripheral base pointers */ - #define USDHC_BASE_PTRS { USDHC0 } -#endif -/** Interrupt vectors for the USDHC peripheral type */ -#define USDHC_IRQS { USDHC0_IRQn } - -/*! - * @} - */ /* end of group USDHC_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- UTICK Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup UTICK_Peripheral_Access_Layer UTICK Peripheral Access Layer - * @{ - */ - -/** UTICK - Register Layout Typedef */ -typedef struct { - __IO uint32_t CTRL; /**< Control, offset: 0x0 */ - __IO uint32_t STAT; /**< Status, offset: 0x4 */ - __IO uint32_t CFG; /**< Capture Configuration, offset: 0x8 */ - __O uint32_t CAPCLR; /**< Capture Clear, offset: 0xC */ - __I uint32_t CAP[4]; /**< Capture, array offset: 0x10, array step: 0x4 */ -} UTICK_Type; - -/* ---------------------------------------------------------------------------- - -- UTICK Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup UTICK_Register_Masks UTICK Register Masks - * @{ - */ - -/*! @name CTRL - Control */ -/*! @{ */ - -#define UTICK_CTRL_DELAYVAL_MASK (0x7FFFFFFFU) -#define UTICK_CTRL_DELAYVAL_SHIFT (0U) -/*! DELAYVAL - Tick Interval - * 0b0000000000000000000000000000000.. - * *..Clock cycles as defined in the description - */ -#define UTICK_CTRL_DELAYVAL(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CTRL_DELAYVAL_SHIFT)) & UTICK_CTRL_DELAYVAL_MASK) - -#define UTICK_CTRL_REPEAT_MASK (0x80000000U) -#define UTICK_CTRL_REPEAT_SHIFT (31U) -/*! REPEAT - Repeat Delay - * 0b0..One-time delay - * 0b1..Delay repeats continuously - */ -#define UTICK_CTRL_REPEAT(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CTRL_REPEAT_SHIFT)) & UTICK_CTRL_REPEAT_MASK) -/*! @} */ - -/*! @name STAT - Status */ -/*! @{ */ - -#define UTICK_STAT_INTR_MASK (0x1U) -#define UTICK_STAT_INTR_SHIFT (0U) -/*! INTR - Interrupt Flag - * 0b0..Not pending - * 0b1..Pending - */ -#define UTICK_STAT_INTR(x) (((uint32_t)(((uint32_t)(x)) << UTICK_STAT_INTR_SHIFT)) & UTICK_STAT_INTR_MASK) - -#define UTICK_STAT_ACTIVE_MASK (0x2U) -#define UTICK_STAT_ACTIVE_SHIFT (1U) -/*! ACTIVE - Timer Active Flag - * 0b0..Inactive (stopped) - * 0b1..Active - */ -#define UTICK_STAT_ACTIVE(x) (((uint32_t)(((uint32_t)(x)) << UTICK_STAT_ACTIVE_SHIFT)) & UTICK_STAT_ACTIVE_MASK) -/*! @} */ - -/*! @name CFG - Capture Configuration */ -/*! @{ */ - -#define UTICK_CFG_CAPEN0_MASK (0x1U) -#define UTICK_CFG_CAPEN0_SHIFT (0U) -/*! CAPEN0 - Enable Capture 0 - * 0b0..Disable - * 0b1..Enable - */ -#define UTICK_CFG_CAPEN0(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPEN0_SHIFT)) & UTICK_CFG_CAPEN0_MASK) - -#define UTICK_CFG_CAPEN1_MASK (0x2U) -#define UTICK_CFG_CAPEN1_SHIFT (1U) -/*! CAPEN1 - Enable Capture 1 - * 0b0..Disable - * 0b1..Enable - */ -#define UTICK_CFG_CAPEN1(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPEN1_SHIFT)) & UTICK_CFG_CAPEN1_MASK) - -#define UTICK_CFG_CAPEN2_MASK (0x4U) -#define UTICK_CFG_CAPEN2_SHIFT (2U) -/*! CAPEN2 - Enable Capture 2 - * 0b0..Disable - * 0b1..Enable - */ -#define UTICK_CFG_CAPEN2(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPEN2_SHIFT)) & UTICK_CFG_CAPEN2_MASK) - -#define UTICK_CFG_CAPEN3_MASK (0x8U) -#define UTICK_CFG_CAPEN3_SHIFT (3U) -/*! CAPEN3 - Enable Capture 3 - * 0b0..Disable - * 0b1..Enable - */ -#define UTICK_CFG_CAPEN3(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPEN3_SHIFT)) & UTICK_CFG_CAPEN3_MASK) - -#define UTICK_CFG_CAPPOL0_MASK (0x100U) -#define UTICK_CFG_CAPPOL0_SHIFT (8U) -/*! CAPPOL0 - Capture Polarity 0 - * 0b0..Positive - * 0b1..Negative - */ -#define UTICK_CFG_CAPPOL0(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPPOL0_SHIFT)) & UTICK_CFG_CAPPOL0_MASK) - -#define UTICK_CFG_CAPPOL1_MASK (0x200U) -#define UTICK_CFG_CAPPOL1_SHIFT (9U) -/*! CAPPOL1 - Capture-Polarity 1 - * 0b0..Positive - * 0b1..Negative - */ -#define UTICK_CFG_CAPPOL1(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPPOL1_SHIFT)) & UTICK_CFG_CAPPOL1_MASK) - -#define UTICK_CFG_CAPPOL2_MASK (0x400U) -#define UTICK_CFG_CAPPOL2_SHIFT (10U) -/*! CAPPOL2 - Capture Polarity 2 - * 0b0..Positive - * 0b1..Negative - */ -#define UTICK_CFG_CAPPOL2(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPPOL2_SHIFT)) & UTICK_CFG_CAPPOL2_MASK) - -#define UTICK_CFG_CAPPOL3_MASK (0x800U) -#define UTICK_CFG_CAPPOL3_SHIFT (11U) -/*! CAPPOL3 - Capture Polarity 3 - * 0b0..Positive - * 0b1..Negative - */ -#define UTICK_CFG_CAPPOL3(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CFG_CAPPOL3_SHIFT)) & UTICK_CFG_CAPPOL3_MASK) -/*! @} */ - -/*! @name CAPCLR - Capture Clear */ -/*! @{ */ - -#define UTICK_CAPCLR_CAPCLR0_MASK (0x1U) -#define UTICK_CAPCLR_CAPCLR0_SHIFT (0U) -/*! CAPCLR0 - Clear Capture 0 - * 0b0..Does nothing - * 0b1..Clears the CAP0 register value - */ -#define UTICK_CAPCLR_CAPCLR0(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CAPCLR_CAPCLR0_SHIFT)) & UTICK_CAPCLR_CAPCLR0_MASK) - -#define UTICK_CAPCLR_CAPCLR1_MASK (0x2U) -#define UTICK_CAPCLR_CAPCLR1_SHIFT (1U) -/*! CAPCLR1 - Clear Capture 1 - * 0b0..Does nothing - * 0b1..Clears the CAP1 register value - */ -#define UTICK_CAPCLR_CAPCLR1(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CAPCLR_CAPCLR1_SHIFT)) & UTICK_CAPCLR_CAPCLR1_MASK) - -#define UTICK_CAPCLR_CAPCLR2_MASK (0x4U) -#define UTICK_CAPCLR_CAPCLR2_SHIFT (2U) -/*! CAPCLR2 - Clear Capture 2 - * 0b0..Does nothing - * 0b1..Clears the CAP2 register value - */ -#define UTICK_CAPCLR_CAPCLR2(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CAPCLR_CAPCLR2_SHIFT)) & UTICK_CAPCLR_CAPCLR2_MASK) - -#define UTICK_CAPCLR_CAPCLR3_MASK (0x8U) -#define UTICK_CAPCLR_CAPCLR3_SHIFT (3U) -/*! CAPCLR3 - Clear Capture 3 - * 0b0..Does nothing - * 0b1..Clears the CAP3 register value - */ -#define UTICK_CAPCLR_CAPCLR3(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CAPCLR_CAPCLR3_SHIFT)) & UTICK_CAPCLR_CAPCLR3_MASK) -/*! @} */ - -/*! @name CAP - Capture */ -/*! @{ */ - -#define UTICK_CAP_CAP_VALUE_MASK (0x7FFFFFFFU) -#define UTICK_CAP_CAP_VALUE_SHIFT (0U) -/*! CAP_VALUE - Captured Value for the Related Capture Event */ -#define UTICK_CAP_CAP_VALUE(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CAP_CAP_VALUE_SHIFT)) & UTICK_CAP_CAP_VALUE_MASK) - -#define UTICK_CAP_VALID_MASK (0x80000000U) -#define UTICK_CAP_VALID_SHIFT (31U) -/*! VALID - Captured Value Valid Flag - * 0b0..Valid value not captured - * 0b1..Valid value captured - */ -#define UTICK_CAP_VALID(x) (((uint32_t)(((uint32_t)(x)) << UTICK_CAP_VALID_SHIFT)) & UTICK_CAP_VALID_MASK) -/*! @} */ - -/* The count of UTICK_CAP */ -#define UTICK_CAP_COUNT (4U) - - -/*! - * @} - */ /* end of group UTICK_Register_Masks */ - - -/* UTICK - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral UTICK0 base address */ - #define UTICK0_BASE (0x50012000u) - /** Peripheral UTICK0 base address */ - #define UTICK0_BASE_NS (0x40012000u) - /** Peripheral UTICK0 base pointer */ - #define UTICK0 ((UTICK_Type *)UTICK0_BASE) - /** Peripheral UTICK0 base pointer */ - #define UTICK0_NS ((UTICK_Type *)UTICK0_BASE_NS) - /** Array initializer of UTICK peripheral base addresses */ - #define UTICK_BASE_ADDRS { UTICK0_BASE } - /** Array initializer of UTICK peripheral base pointers */ - #define UTICK_BASE_PTRS { UTICK0 } - /** Array initializer of UTICK peripheral base addresses */ - #define UTICK_BASE_ADDRS_NS { UTICK0_BASE_NS } - /** Array initializer of UTICK peripheral base pointers */ - #define UTICK_BASE_PTRS_NS { UTICK0_NS } -#else - /** Peripheral UTICK0 base address */ - #define UTICK0_BASE (0x40012000u) - /** Peripheral UTICK0 base pointer */ - #define UTICK0 ((UTICK_Type *)UTICK0_BASE) - /** Array initializer of UTICK peripheral base addresses */ - #define UTICK_BASE_ADDRS { UTICK0_BASE } - /** Array initializer of UTICK peripheral base pointers */ - #define UTICK_BASE_PTRS { UTICK0 } -#endif -/** Interrupt vectors for the UTICK peripheral type */ -#define UTICK_IRQS { UTICK0_IRQn } - -/*! - * @} - */ /* end of group UTICK_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- VBAT Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup VBAT_Peripheral_Access_Layer VBAT Peripheral Access Layer - * @{ - */ - -/** VBAT - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - uint8_t RESERVED_0[12]; - __IO uint32_t STATUSA; /**< Status A, offset: 0x10 */ - __IO uint32_t STATUSB; /**< Status B, offset: 0x14 */ - __IO uint32_t IRQENA; /**< Interrupt Enable A, offset: 0x18 */ - __IO uint32_t IRQENB; /**< Interrupt Enable B, offset: 0x1C */ - __IO uint32_t WAKENA; /**< Wake-up Enable A, offset: 0x20 */ - __IO uint32_t WAKENB; /**< Wake-up Enable B, offset: 0x24 */ - __IO uint32_t TAMPERA; /**< Tamper Enable A, offset: 0x28 */ - __IO uint32_t TAMPERB; /**< Tamper Enable B, offset: 0x2C */ - __IO uint32_t LOCKA; /**< Lock A, offset: 0x30 */ - __IO uint32_t LOCKB; /**< Lock B, offset: 0x34 */ - __IO uint32_t WAKECFG; /**< Wake-up Configuration, offset: 0x38 */ - uint8_t RESERVED_1[196]; - __IO uint32_t OSCCTLA; /**< Oscillator Control A, offset: 0x100 */ - __IO uint32_t OSCCTLB; /**< Oscillator Control B, offset: 0x104 */ - __IO uint32_t OSCCFGA; /**< Oscillator Configuration A, offset: 0x108 */ - __IO uint32_t OSCCFGB; /**< Oscillator Configuration B, offset: 0x10C */ - uint8_t RESERVED_2[8]; - __IO uint32_t OSCLCKA; /**< Oscillator Lock A, offset: 0x118 */ - __IO uint32_t OSCLCKB; /**< Oscillator Lock B, offset: 0x11C */ - __IO uint32_t OSCCLKE; /**< Oscillator Clock Enable, offset: 0x120 */ - uint8_t RESERVED_3[220]; - __IO uint32_t FROCTLA; /**< FRO16K Control A, offset: 0x200 */ - __IO uint32_t FROCTLB; /**< FRO16K Control B, offset: 0x204 */ - uint8_t RESERVED_4[16]; - __IO uint32_t FROLCKA; /**< FRO16K Lock A, offset: 0x218 */ - __IO uint32_t FROLCKB; /**< FRO16K Lock B, offset: 0x21C */ - __IO uint32_t FROCLKE; /**< FRO16K Clock Enable, offset: 0x220 */ - uint8_t RESERVED_5[220]; - __IO uint32_t LDOCTLA; /**< LDO_RAM Control A, offset: 0x300 */ - __IO uint32_t LDOCTLB; /**< LDO_RAM Control B, offset: 0x304 */ - uint8_t RESERVED_6[16]; - __IO uint32_t LDOLCKA; /**< LDO_RAM Lock A, offset: 0x318 */ - __IO uint32_t LDOLCKB; /**< LDO_RAM Lock B, offset: 0x31C */ - __IO uint32_t LDORAMC; /**< RAM Control, offset: 0x320 */ - uint8_t RESERVED_7[12]; - __IO uint32_t LDOTIMER0; /**< Bandgap Timer 0, offset: 0x330 */ - uint8_t RESERVED_8[4]; - __IO uint32_t LDOTIMER1; /**< Bandgap Timer 1, offset: 0x338 */ - uint8_t RESERVED_9[196]; - __IO uint32_t MONCTLA; /**< CLKMON Control A, offset: 0x400 */ - __IO uint32_t MONCTLB; /**< CLKMON Control B, offset: 0x404 */ - __IO uint32_t MONCFGA; /**< CLKMON Configuration A, offset: 0x408 */ - __IO uint32_t MONCFGB; /**< CLKMON Configuration B, offset: 0x40C */ - uint8_t RESERVED_10[8]; - __IO uint32_t MONLCKA; /**< CLKMON Lock A, offset: 0x418 */ - __IO uint32_t MONLCKB; /**< CLKMON Lock B, offset: 0x41C */ - uint8_t RESERVED_11[224]; - __IO uint32_t TAMCTLA; /**< TAMPER Control A, offset: 0x500 */ - __IO uint32_t TAMCTLB; /**< TAMPER Control B, offset: 0x504 */ - uint8_t RESERVED_12[16]; - __IO uint32_t TAMLCKA; /**< TAMPER Lock A, offset: 0x518 */ - __IO uint32_t TAMLCKB; /**< TAMPER Lock B, offset: 0x51C */ - uint8_t RESERVED_13[224]; - __IO uint32_t SWICTLA; /**< Switch Control A, offset: 0x600 */ - __IO uint32_t SWICTLB; /**< Switch Control B, offset: 0x604 */ - uint8_t RESERVED_14[16]; - __IO uint32_t SWILCKA; /**< Switch Lock A, offset: 0x618 */ - __IO uint32_t SWILCKB; /**< Switch Lock B, offset: 0x61C */ - uint8_t RESERVED_15[224]; - struct { /* offset: 0x700, array step: 0x8 */ - __IO uint32_t WAKEUPA; /**< Wakeup 0 Register A, array offset: 0x700, array step: 0x8 */ - __IO uint32_t WAKEUPB; /**< Wakeup 0 Register B, array offset: 0x704, array step: 0x8 */ - } WAKEUP[2]; - uint8_t RESERVED_16[232]; - __IO uint32_t WAKLCKA; /**< Wakeup Lock A, offset: 0x7F8 */ - __IO uint32_t WAKLCKB; /**< Wakeup Lock B, offset: 0x7FC */ -} VBAT_Type; - -/* ---------------------------------------------------------------------------- - -- VBAT Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup VBAT_Register_Masks VBAT Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define VBAT_VERID_FEATURE_MASK (0xFFFFU) -#define VBAT_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number */ -#define VBAT_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_VERID_FEATURE_SHIFT)) & VBAT_VERID_FEATURE_MASK) - -#define VBAT_VERID_MINOR_MASK (0xFF0000U) -#define VBAT_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define VBAT_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << VBAT_VERID_MINOR_SHIFT)) & VBAT_VERID_MINOR_MASK) - -#define VBAT_VERID_MAJOR_MASK (0xFF000000U) -#define VBAT_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define VBAT_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << VBAT_VERID_MAJOR_SHIFT)) & VBAT_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name STATUSA - Status A */ -/*! @{ */ - -#define VBAT_STATUSA_POR_DET_MASK (0x1U) -#define VBAT_STATUSA_POR_DET_SHIFT (0U) -/*! POR_DET - POR Detect Flag - * 0b0..Not reset - * 0b1..Reset - * 0b0..No effect - * 0b1..Clear the flag - */ -#define VBAT_STATUSA_POR_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_POR_DET_SHIFT)) & VBAT_STATUSA_POR_DET_MASK) - -#define VBAT_STATUSA_WAKEUP_FLAG_MASK (0x2U) -#define VBAT_STATUSA_WAKEUP_FLAG_SHIFT (1U) -/*! WAKEUP_FLAG - Wakeup Pin Flag - * 0b0..Not asserted - * 0b1..Asserted - * 0b0..No effect - * 0b1..Clear the flag - */ -#define VBAT_STATUSA_WAKEUP_FLAG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_WAKEUP_FLAG_SHIFT)) & VBAT_STATUSA_WAKEUP_FLAG_MASK) - -#define VBAT_STATUSA_TIMER0_FLAG_MASK (0x4U) -#define VBAT_STATUSA_TIMER0_FLAG_SHIFT (2U) -/*! TIMER0_FLAG - Bandgap Timer 0 Flag - * 0b0..Not reached - * 0b1..Reached - * 0b0..No effect - * 0b1..Clear the flag - */ -#define VBAT_STATUSA_TIMER0_FLAG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_TIMER0_FLAG_SHIFT)) & VBAT_STATUSA_TIMER0_FLAG_MASK) - -#define VBAT_STATUSA_TIMER1_FLAG_MASK (0x8U) -#define VBAT_STATUSA_TIMER1_FLAG_SHIFT (3U) -/*! TIMER1_FLAG - Bandgap Timer 1 Flag - * 0b0..Not reached - * 0b1..Reached - * 0b0..No effect - * 0b1..Clear the flag - */ -#define VBAT_STATUSA_TIMER1_FLAG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_TIMER1_FLAG_SHIFT)) & VBAT_STATUSA_TIMER1_FLAG_MASK) - -#define VBAT_STATUSA_LDO_RDY_MASK (0x10U) -#define VBAT_STATUSA_LDO_RDY_SHIFT (4U) -/*! LDO_RDY - LDO Ready - * 0b0..Disabled (not ready) - * 0b1..Enabled (ready) - */ -#define VBAT_STATUSA_LDO_RDY(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_LDO_RDY_SHIFT)) & VBAT_STATUSA_LDO_RDY_MASK) - -#define VBAT_STATUSA_OSC_RDY_MASK (0x20U) -#define VBAT_STATUSA_OSC_RDY_SHIFT (5U) -/*! OSC_RDY - OSC32k Ready - * 0b0..Disabled (clock not ready) - * 0b1..Enabled (clock ready) - */ -#define VBAT_STATUSA_OSC_RDY(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_OSC_RDY_SHIFT)) & VBAT_STATUSA_OSC_RDY_MASK) - -#define VBAT_STATUSA_CLOCK_DET_MASK (0x40U) -#define VBAT_STATUSA_CLOCK_DET_SHIFT (6U) -/*! CLOCK_DET - Clock Detect - * 0b0..Clock error not detected - * 0b1..Clock error detected - */ -#define VBAT_STATUSA_CLOCK_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_CLOCK_DET_SHIFT)) & VBAT_STATUSA_CLOCK_DET_MASK) - -#define VBAT_STATUSA_CONFIG_DET_MASK (0x80U) -#define VBAT_STATUSA_CONFIG_DET_SHIFT (7U) -/*! CONFIG_DET - Configuration Detect Flag - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define VBAT_STATUSA_CONFIG_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_CONFIG_DET_SHIFT)) & VBAT_STATUSA_CONFIG_DET_MASK) - -#define VBAT_STATUSA_VOLT_DET_MASK (0x100U) -#define VBAT_STATUSA_VOLT_DET_SHIFT (8U) -/*! VOLT_DET - Voltage Detect - * 0b0..Not detected - * 0b1..Detected - * 0b0..No effect - * 0b1..Clear the flag - */ -#define VBAT_STATUSA_VOLT_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_VOLT_DET_SHIFT)) & VBAT_STATUSA_VOLT_DET_MASK) - -#define VBAT_STATUSA_TEMP_DET_MASK (0x200U) -#define VBAT_STATUSA_TEMP_DET_SHIFT (9U) -/*! TEMP_DET - Temperature Detect - * 0b0..Temperature error not detected - * 0b1..Temperature error detected - */ -#define VBAT_STATUSA_TEMP_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_TEMP_DET_SHIFT)) & VBAT_STATUSA_TEMP_DET_MASK) - -#define VBAT_STATUSA_LIGHT_DET_MASK (0x400U) -#define VBAT_STATUSA_LIGHT_DET_SHIFT (10U) -/*! LIGHT_DET - Light Detect - * 0b0..Light error not detected - * 0b1..Light error detected - */ -#define VBAT_STATUSA_LIGHT_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_LIGHT_DET_SHIFT)) & VBAT_STATUSA_LIGHT_DET_MASK) - -#define VBAT_STATUSA_SEC0_DET_MASK (0x1000U) -#define VBAT_STATUSA_SEC0_DET_SHIFT (12U) -/*! SEC0_DET - Input 0 Detect - * 0b0..Security input 0 not detected - * 0b1..Security input 0 detected - */ -#define VBAT_STATUSA_SEC0_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_SEC0_DET_SHIFT)) & VBAT_STATUSA_SEC0_DET_MASK) - -#define VBAT_STATUSA_IRQ0_DET_MASK (0x10000U) -#define VBAT_STATUSA_IRQ0_DET_SHIFT (16U) -/*! IRQ0_DET - Interrupt 0 Detect - * 0b0..Not asserted - * 0b1..Asserted - */ -#define VBAT_STATUSA_IRQ0_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_IRQ0_DET_SHIFT)) & VBAT_STATUSA_IRQ0_DET_MASK) - -#define VBAT_STATUSA_IRQ1_DET_MASK (0x20000U) -#define VBAT_STATUSA_IRQ1_DET_SHIFT (17U) -/*! IRQ1_DET - Interrupt 1 Detect - * 0b0..Not asserted - * 0b1..Asserted - */ -#define VBAT_STATUSA_IRQ1_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_IRQ1_DET_SHIFT)) & VBAT_STATUSA_IRQ1_DET_MASK) - -#define VBAT_STATUSA_IRQ2_DET_MASK (0x40000U) -#define VBAT_STATUSA_IRQ2_DET_SHIFT (18U) -/*! IRQ2_DET - Interrupt 2 Detect - * 0b0..Not asserted - * 0b1..Asserted - */ -#define VBAT_STATUSA_IRQ2_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_IRQ2_DET_SHIFT)) & VBAT_STATUSA_IRQ2_DET_MASK) - -#define VBAT_STATUSA_IRQ3_DET_MASK (0x80000U) -#define VBAT_STATUSA_IRQ3_DET_SHIFT (19U) -/*! IRQ3_DET - Interrupt 3 Detect - * 0b0..Not asserted - * 0b1..Asserted - */ -#define VBAT_STATUSA_IRQ3_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSA_IRQ3_DET_SHIFT)) & VBAT_STATUSA_IRQ3_DET_MASK) -/*! @} */ - -/*! @name STATUSB - Status B */ -/*! @{ */ - -#define VBAT_STATUSB_INVERSE_MASK (0xFFFFFU) -#define VBAT_STATUSB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse value */ -#define VBAT_STATUSB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_STATUSB_INVERSE_SHIFT)) & VBAT_STATUSB_INVERSE_MASK) -/*! @} */ - -/*! @name IRQENA - Interrupt Enable A */ -/*! @{ */ - -#define VBAT_IRQENA_POR_DET_MASK (0x1U) -#define VBAT_IRQENA_POR_DET_SHIFT (0U) -/*! POR_DET - POR Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_POR_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_POR_DET_SHIFT)) & VBAT_IRQENA_POR_DET_MASK) - -#define VBAT_IRQENA_WAKEUP_FLAG_MASK (0x2U) -#define VBAT_IRQENA_WAKEUP_FLAG_SHIFT (1U) -/*! WAKEUP_FLAG - Wakeup Pin Flag - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_WAKEUP_FLAG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_WAKEUP_FLAG_SHIFT)) & VBAT_IRQENA_WAKEUP_FLAG_MASK) - -#define VBAT_IRQENA_TIMER0_FLAG_MASK (0x4U) -#define VBAT_IRQENA_TIMER0_FLAG_SHIFT (2U) -/*! TIMER0_FLAG - Bandgap Timer 0 - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_TIMER0_FLAG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_TIMER0_FLAG_SHIFT)) & VBAT_IRQENA_TIMER0_FLAG_MASK) - -#define VBAT_IRQENA_TIMER1_FLAG_MASK (0x8U) -#define VBAT_IRQENA_TIMER1_FLAG_SHIFT (3U) -/*! TIMER1_FLAG - Bandgap Timer 2 - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_TIMER1_FLAG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_TIMER1_FLAG_SHIFT)) & VBAT_IRQENA_TIMER1_FLAG_MASK) - -#define VBAT_IRQENA_LDO_RDY_MASK (0x10U) -#define VBAT_IRQENA_LDO_RDY_SHIFT (4U) -/*! LDO_RDY - LDO Ready - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_LDO_RDY(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_LDO_RDY_SHIFT)) & VBAT_IRQENA_LDO_RDY_MASK) - -#define VBAT_IRQENA_OSC_RDY_MASK (0x20U) -#define VBAT_IRQENA_OSC_RDY_SHIFT (5U) -/*! OSC_RDY - OSC32k Ready - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_OSC_RDY(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_OSC_RDY_SHIFT)) & VBAT_IRQENA_OSC_RDY_MASK) - -#define VBAT_IRQENA_CLOCK_DET_MASK (0x40U) -#define VBAT_IRQENA_CLOCK_DET_SHIFT (6U) -/*! CLOCK_DET - Clock Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_CLOCK_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_CLOCK_DET_SHIFT)) & VBAT_IRQENA_CLOCK_DET_MASK) - -#define VBAT_IRQENA_CONFIG_DET_MASK (0x80U) -#define VBAT_IRQENA_CONFIG_DET_SHIFT (7U) -/*! CONFIG_DET - Configuration Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_CONFIG_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_CONFIG_DET_SHIFT)) & VBAT_IRQENA_CONFIG_DET_MASK) - -#define VBAT_IRQENA_VOLT_DET_MASK (0x100U) -#define VBAT_IRQENA_VOLT_DET_SHIFT (8U) -/*! VOLT_DET - Voltage Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_VOLT_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_VOLT_DET_SHIFT)) & VBAT_IRQENA_VOLT_DET_MASK) - -#define VBAT_IRQENA_TEMP_DET_MASK (0x200U) -#define VBAT_IRQENA_TEMP_DET_SHIFT (9U) -/*! TEMP_DET - Temperature Detect - * 0b0..Interrupt disabled - * 0b1..Interrupt enabled - */ -#define VBAT_IRQENA_TEMP_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_TEMP_DET_SHIFT)) & VBAT_IRQENA_TEMP_DET_MASK) - -#define VBAT_IRQENA_LIGHT_DET_MASK (0x400U) -#define VBAT_IRQENA_LIGHT_DET_SHIFT (10U) -/*! LIGHT_DET - Light Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_LIGHT_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_LIGHT_DET_SHIFT)) & VBAT_IRQENA_LIGHT_DET_MASK) - -#define VBAT_IRQENA_SEC0_DET_MASK (0x1000U) -#define VBAT_IRQENA_SEC0_DET_SHIFT (12U) -/*! SEC0_DET - Input 0 Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_SEC0_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_SEC0_DET_SHIFT)) & VBAT_IRQENA_SEC0_DET_MASK) - -#define VBAT_IRQENA_IRQ0_DET_MASK (0x10000U) -#define VBAT_IRQENA_IRQ0_DET_SHIFT (16U) -/*! IRQ0_DET - Interrupt 0 Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_IRQ0_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_IRQ0_DET_SHIFT)) & VBAT_IRQENA_IRQ0_DET_MASK) - -#define VBAT_IRQENA_IRQ1_DET_MASK (0x20000U) -#define VBAT_IRQENA_IRQ1_DET_SHIFT (17U) -/*! IRQ1_DET - Interrupt 1 Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_IRQ1_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_IRQ1_DET_SHIFT)) & VBAT_IRQENA_IRQ1_DET_MASK) - -#define VBAT_IRQENA_IRQ2_DET_MASK (0x40000U) -#define VBAT_IRQENA_IRQ2_DET_SHIFT (18U) -/*! IRQ2_DET - Interrupt 2 Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_IRQ2_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_IRQ2_DET_SHIFT)) & VBAT_IRQENA_IRQ2_DET_MASK) - -#define VBAT_IRQENA_IRQ3_DET_MASK (0x80000U) -#define VBAT_IRQENA_IRQ3_DET_SHIFT (19U) -/*! IRQ3_DET - Interrupt 3 Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_IRQENA_IRQ3_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENA_IRQ3_DET_SHIFT)) & VBAT_IRQENA_IRQ3_DET_MASK) -/*! @} */ - -/*! @name IRQENB - Interrupt Enable B */ -/*! @{ */ - -#define VBAT_IRQENB_INVERSE_MASK (0xFFFFFU) -#define VBAT_IRQENB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse Value */ -#define VBAT_IRQENB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_IRQENB_INVERSE_SHIFT)) & VBAT_IRQENB_INVERSE_MASK) -/*! @} */ - -/*! @name WAKENA - Wake-up Enable A */ -/*! @{ */ - -#define VBAT_WAKENA_POR_DET_MASK (0x1U) -#define VBAT_WAKENA_POR_DET_SHIFT (0U) -/*! POR_DET - POR Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_POR_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_POR_DET_SHIFT)) & VBAT_WAKENA_POR_DET_MASK) - -#define VBAT_WAKENA_WAKEUP_FLAG_MASK (0x2U) -#define VBAT_WAKENA_WAKEUP_FLAG_SHIFT (1U) -/*! WAKEUP_FLAG - Wake-up Pin Flag - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_WAKEUP_FLAG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_WAKEUP_FLAG_SHIFT)) & VBAT_WAKENA_WAKEUP_FLAG_MASK) - -#define VBAT_WAKENA_TIMER0_FLAG_MASK (0x4U) -#define VBAT_WAKENA_TIMER0_FLAG_SHIFT (2U) -/*! TIMER0_FLAG - Bandgap Timer 0 - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_TIMER0_FLAG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_TIMER0_FLAG_SHIFT)) & VBAT_WAKENA_TIMER0_FLAG_MASK) - -#define VBAT_WAKENA_TIMER1_FLAG_MASK (0x8U) -#define VBAT_WAKENA_TIMER1_FLAG_SHIFT (3U) -/*! TIMER1_FLAG - Bandgap Timer 2 - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_TIMER1_FLAG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_TIMER1_FLAG_SHIFT)) & VBAT_WAKENA_TIMER1_FLAG_MASK) - -#define VBAT_WAKENA_LDO_RDY_MASK (0x10U) -#define VBAT_WAKENA_LDO_RDY_SHIFT (4U) -/*! LDO_RDY - LDO Ready - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_LDO_RDY(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_LDO_RDY_SHIFT)) & VBAT_WAKENA_LDO_RDY_MASK) - -#define VBAT_WAKENA_OSC_RDY_MASK (0x20U) -#define VBAT_WAKENA_OSC_RDY_SHIFT (5U) -/*! OSC_RDY - OSC32K Ready - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_OSC_RDY(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_OSC_RDY_SHIFT)) & VBAT_WAKENA_OSC_RDY_MASK) - -#define VBAT_WAKENA_CLOCK_DET_MASK (0x40U) -#define VBAT_WAKENA_CLOCK_DET_SHIFT (6U) -/*! CLOCK_DET - Clock Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_CLOCK_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_CLOCK_DET_SHIFT)) & VBAT_WAKENA_CLOCK_DET_MASK) - -#define VBAT_WAKENA_CONFIG_DET_MASK (0x80U) -#define VBAT_WAKENA_CONFIG_DET_SHIFT (7U) -/*! CONFIG_DET - Configuration Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_CONFIG_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_CONFIG_DET_SHIFT)) & VBAT_WAKENA_CONFIG_DET_MASK) - -#define VBAT_WAKENA_VOLT_DET_MASK (0x100U) -#define VBAT_WAKENA_VOLT_DET_SHIFT (8U) -/*! VOLT_DET - Voltage Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_VOLT_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_VOLT_DET_SHIFT)) & VBAT_WAKENA_VOLT_DET_MASK) - -#define VBAT_WAKENA_TEMP_DET_MASK (0x200U) -#define VBAT_WAKENA_TEMP_DET_SHIFT (9U) -/*! TEMP_DET - Temperature Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_TEMP_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_TEMP_DET_SHIFT)) & VBAT_WAKENA_TEMP_DET_MASK) - -#define VBAT_WAKENA_LIGHT_DET_MASK (0x400U) -#define VBAT_WAKENA_LIGHT_DET_SHIFT (10U) -/*! LIGHT_DET - Light Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_LIGHT_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_LIGHT_DET_SHIFT)) & VBAT_WAKENA_LIGHT_DET_MASK) - -#define VBAT_WAKENA_SEC0_DET_MASK (0x1000U) -#define VBAT_WAKENA_SEC0_DET_SHIFT (12U) -/*! SEC0_DET - Input 0 Detect - * 0b0..Disabled - * 0b1..Enabled - */ -#define VBAT_WAKENA_SEC0_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_SEC0_DET_SHIFT)) & VBAT_WAKENA_SEC0_DET_MASK) - -#define VBAT_WAKENA_IRQ0_DET_MASK (0x10000U) -#define VBAT_WAKENA_IRQ0_DET_SHIFT (16U) -/*! IRQ0_DET - Interrupt 0 Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_IRQ0_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_IRQ0_DET_SHIFT)) & VBAT_WAKENA_IRQ0_DET_MASK) - -#define VBAT_WAKENA_IRQ1_DET_MASK (0x20000U) -#define VBAT_WAKENA_IRQ1_DET_SHIFT (17U) -/*! IRQ1_DET - Interrupt 1 Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_IRQ1_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_IRQ1_DET_SHIFT)) & VBAT_WAKENA_IRQ1_DET_MASK) - -#define VBAT_WAKENA_IRQ2_DET_MASK (0x40000U) -#define VBAT_WAKENA_IRQ2_DET_SHIFT (18U) -/*! IRQ2_DET - Interrupt 2 Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_IRQ2_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_IRQ2_DET_SHIFT)) & VBAT_WAKENA_IRQ2_DET_MASK) - -#define VBAT_WAKENA_IRQ3_DET_MASK (0x80000U) -#define VBAT_WAKENA_IRQ3_DET_SHIFT (19U) -/*! IRQ3_DET - Interrupt 3 Detect - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_WAKENA_IRQ3_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENA_IRQ3_DET_SHIFT)) & VBAT_WAKENA_IRQ3_DET_MASK) -/*! @} */ - -/*! @name WAKENB - Wake-up Enable B */ -/*! @{ */ - -#define VBAT_WAKENB_INVERSE_MASK (0xFFFFFU) -#define VBAT_WAKENB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse Value */ -#define VBAT_WAKENB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKENB_INVERSE_SHIFT)) & VBAT_WAKENB_INVERSE_MASK) -/*! @} */ - -/*! @name TAMPERA - Tamper Enable A */ -/*! @{ */ - -#define VBAT_TAMPERA_POR_DET_MASK (0x1U) -#define VBAT_TAMPERA_POR_DET_SHIFT (0U) -/*! POR_DET - POR Detect - * 0b0..Tamper disabled - * 0b1..Tamper enabled - */ -#define VBAT_TAMPERA_POR_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMPERA_POR_DET_SHIFT)) & VBAT_TAMPERA_POR_DET_MASK) - -#define VBAT_TAMPERA_CLOCK_DET_MASK (0x40U) -#define VBAT_TAMPERA_CLOCK_DET_SHIFT (6U) -/*! CLOCK_DET - Clock Detect - * 0b0..Tamper disabled - * 0b1..Tamper enabled - */ -#define VBAT_TAMPERA_CLOCK_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMPERA_CLOCK_DET_SHIFT)) & VBAT_TAMPERA_CLOCK_DET_MASK) - -#define VBAT_TAMPERA_CONFIG_DET_MASK (0x80U) -#define VBAT_TAMPERA_CONFIG_DET_SHIFT (7U) -/*! CONFIG_DET - Configuration Detect - * 0b0..Tamper disabled - * 0b1..Tamper enabled - */ -#define VBAT_TAMPERA_CONFIG_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMPERA_CONFIG_DET_SHIFT)) & VBAT_TAMPERA_CONFIG_DET_MASK) - -#define VBAT_TAMPERA_VOLT_DET_MASK (0x100U) -#define VBAT_TAMPERA_VOLT_DET_SHIFT (8U) -/*! VOLT_DET - Voltage Detect - * 0b0..Tamper disabled - * 0b1..Tamper enabled - */ -#define VBAT_TAMPERA_VOLT_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMPERA_VOLT_DET_SHIFT)) & VBAT_TAMPERA_VOLT_DET_MASK) - -#define VBAT_TAMPERA_TEMP_DET_MASK (0x200U) -#define VBAT_TAMPERA_TEMP_DET_SHIFT (9U) -/*! TEMP_DET - Temperature Detect - * 0b0..Tamper disabled - * 0b1..Tamper enabled - */ -#define VBAT_TAMPERA_TEMP_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMPERA_TEMP_DET_SHIFT)) & VBAT_TAMPERA_TEMP_DET_MASK) - -#define VBAT_TAMPERA_LIGHT_DET_MASK (0x400U) -#define VBAT_TAMPERA_LIGHT_DET_SHIFT (10U) -/*! LIGHT_DET - Light Detect - * 0b0..Tamper disabled - * 0b1..Tamper enabled - */ -#define VBAT_TAMPERA_LIGHT_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMPERA_LIGHT_DET_SHIFT)) & VBAT_TAMPERA_LIGHT_DET_MASK) - -#define VBAT_TAMPERA_SEC0_DET_MASK (0x1000U) -#define VBAT_TAMPERA_SEC0_DET_SHIFT (12U) -/*! SEC0_DET - Input 0 Detect - * 0b0..Tamper disabled - * 0b1..Tamper enabled - */ -#define VBAT_TAMPERA_SEC0_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMPERA_SEC0_DET_SHIFT)) & VBAT_TAMPERA_SEC0_DET_MASK) -/*! @} */ - -/*! @name TAMPERB - Tamper Enable B */ -/*! @{ */ - -#define VBAT_TAMPERB_INVERSE_MASK (0xFFFFU) -#define VBAT_TAMPERB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse value */ -#define VBAT_TAMPERB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMPERB_INVERSE_SHIFT)) & VBAT_TAMPERB_INVERSE_MASK) -/*! @} */ - -/*! @name LOCKA - Lock A */ -/*! @{ */ - -#define VBAT_LOCKA_LOCK_MASK (0x1U) -#define VBAT_LOCKA_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b0..Disables lock - * 0b1..Enables lock. Cleared by VBAT POR. - */ -#define VBAT_LOCKA_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LOCKA_LOCK_SHIFT)) & VBAT_LOCKA_LOCK_MASK) -/*! @} */ - -/*! @name LOCKB - Lock B */ -/*! @{ */ - -#define VBAT_LOCKB_LOCK_MASK (0x1U) -#define VBAT_LOCKB_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b1..Disables lock - * 0b0..Enables lock - */ -#define VBAT_LOCKB_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LOCKB_LOCK_SHIFT)) & VBAT_LOCKB_LOCK_MASK) -/*! @} */ - -/*! @name WAKECFG - Wake-up Configuration */ -/*! @{ */ - -#define VBAT_WAKECFG_OUT_MASK (0x1U) -#define VBAT_WAKECFG_OUT_SHIFT (0U) -/*! OUT - Output - * 0b0..Logic zero (asserted) - * 0b1..Logic one - */ -#define VBAT_WAKECFG_OUT(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKECFG_OUT_SHIFT)) & VBAT_WAKECFG_OUT_MASK) -/*! @} */ - -/*! @name OSCCTLA - Oscillator Control A */ -/*! @{ */ - -#define VBAT_OSCCTLA_OSC_EN_MASK (0x1U) -#define VBAT_OSCCTLA_OSC_EN_SHIFT (0U) -/*! OSC_EN - Crystal Oscillator Enable - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_OSCCTLA_OSC_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCTLA_OSC_EN_SHIFT)) & VBAT_OSCCTLA_OSC_EN_MASK) - -#define VBAT_OSCCTLA_OSC_BYP_EN_MASK (0x2U) -#define VBAT_OSCCTLA_OSC_BYP_EN_SHIFT (1U) -/*! OSC_BYP_EN - Crystal Oscillator Bypass Enable - * 0b0..Does not bypass - * 0b1..Bypass - */ -#define VBAT_OSCCTLA_OSC_BYP_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCTLA_OSC_BYP_EN_SHIFT)) & VBAT_OSCCTLA_OSC_BYP_EN_MASK) - -#define VBAT_OSCCTLA_COARSE_AMP_GAIN_MASK (0xCU) -#define VBAT_OSCCTLA_COARSE_AMP_GAIN_SHIFT (2U) -/*! COARSE_AMP_GAIN - Amplifier gain adjustment bits to allow the use of a wide range of external - * crystal ESR values See the device datasheet for the ranges supported by this device - * 0b00..ESR Range 0 - * 0b01..ESR Range 1 - * 0b10..ESR Range 2 - * 0b11..ESR Range 3 - */ -#define VBAT_OSCCTLA_COARSE_AMP_GAIN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCTLA_COARSE_AMP_GAIN_SHIFT)) & VBAT_OSCCTLA_COARSE_AMP_GAIN_MASK) - -#define VBAT_OSCCTLA_CAP_SEL_EN_MASK (0x80U) -#define VBAT_OSCCTLA_CAP_SEL_EN_SHIFT (7U) -/*! CAP_SEL_EN - Crystal Load Capacitance Selection Enable - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_OSCCTLA_CAP_SEL_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCTLA_CAP_SEL_EN_SHIFT)) & VBAT_OSCCTLA_CAP_SEL_EN_MASK) - -#define VBAT_OSCCTLA_EXTAL_CAP_SEL_MASK (0xF00U) -#define VBAT_OSCCTLA_EXTAL_CAP_SEL_SHIFT (8U) -/*! EXTAL_CAP_SEL - Crystal Load Capacitance Selection - * 0b0000..0 pF - * 0b0001..2 pF - * 0b0010..4 pF - * 0b0011..6 pF - * 0b0100..8 pF - * 0b0101..10 pF - * 0b0110..12 pF - * 0b0111..14 pF - * 0b1000..16 pF - * 0b1001..18 pF - * 0b1010..20 pF - * 0b1011..22 pF - * 0b1100..24 pF - * 0b1101..26 pF - * 0b1110..28 pF - * 0b1111..30 pF - */ -#define VBAT_OSCCTLA_EXTAL_CAP_SEL(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCTLA_EXTAL_CAP_SEL_SHIFT)) & VBAT_OSCCTLA_EXTAL_CAP_SEL_MASK) - -#define VBAT_OSCCTLA_XTAL_CAP_SEL_MASK (0xF000U) -#define VBAT_OSCCTLA_XTAL_CAP_SEL_SHIFT (12U) -/*! XTAL_CAP_SEL - Crystal Load Capacitance Selection - * 0b0000..0 pF - * 0b0001..2 pF - * 0b0010..4 pF - * 0b0011..6 pF - * 0b0100..8 pF - * 0b0101..10 pF - * 0b0110..12 pF - * 0b0111..14 pF - * 0b1000..16 pF - * 0b1001..18 pF - * 0b1010..20 pF - * 0b1011..22 pF - * 0b1100..24 pF - * 0b1101..26 pF - * 0b1110..28 pF - * 0b1111..30 pF - */ -#define VBAT_OSCCTLA_XTAL_CAP_SEL(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCTLA_XTAL_CAP_SEL_SHIFT)) & VBAT_OSCCTLA_XTAL_CAP_SEL_MASK) - -#define VBAT_OSCCTLA_MODE_EN_MASK (0x30000U) -#define VBAT_OSCCTLA_MODE_EN_SHIFT (16U) -/*! MODE_EN - Mode Enable - * 0b00..Normal mode - * 0b01..Startup mode - * 0b11..Low power mode - */ -#define VBAT_OSCCTLA_MODE_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCTLA_MODE_EN_SHIFT)) & VBAT_OSCCTLA_MODE_EN_MASK) - -#define VBAT_OSCCTLA_SUPPLY_DET_MASK (0xC0000U) -#define VBAT_OSCCTLA_SUPPLY_DET_SHIFT (18U) -/*! SUPPLY_DET - Supply Detector Trim - * 0b00..VBAT supply is less than 3V - * 0b01..VBAT supply is greater than 3V - */ -#define VBAT_OSCCTLA_SUPPLY_DET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCTLA_SUPPLY_DET_SHIFT)) & VBAT_OSCCTLA_SUPPLY_DET_MASK) -/*! @} */ - -/*! @name OSCCTLB - Oscillator Control B */ -/*! @{ */ - -#define VBAT_OSCCTLB_INVERSE_MASK (0xFFFFFU) -#define VBAT_OSCCTLB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse Value */ -#define VBAT_OSCCTLB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCTLB_INVERSE_SHIFT)) & VBAT_OSCCTLB_INVERSE_MASK) -/*! @} */ - -/*! @name OSCCFGA - Oscillator Configuration A */ -/*! @{ */ - -#define VBAT_OSCCFGA_CMP_TRIM_MASK (0x3U) -#define VBAT_OSCCFGA_CMP_TRIM_SHIFT (0U) -/*! CMP_TRIM - Comparator Trim - * 0b00..760 mV - * 0b01..770 mV - * 0b11..740 mV - */ -#define VBAT_OSCCFGA_CMP_TRIM(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCFGA_CMP_TRIM_SHIFT)) & VBAT_OSCCFGA_CMP_TRIM_MASK) - -#define VBAT_OSCCFGA_CAP2_TRIM_MASK (0x4U) -#define VBAT_OSCCFGA_CAP2_TRIM_SHIFT (2U) -/*! CAP2_TRIM - CAP2_TRIM */ -#define VBAT_OSCCFGA_CAP2_TRIM(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCFGA_CAP2_TRIM_SHIFT)) & VBAT_OSCCFGA_CAP2_TRIM_MASK) - -#define VBAT_OSCCFGA_DLY_TRIM_MASK (0x78U) -#define VBAT_OSCCFGA_DLY_TRIM_SHIFT (3U) -/*! DLY_TRIM - Delay Trim - * 0b0000..P current 9(nA) and N Current 6(nA) - * 0b0001..P current 13(nA) and N Current 6(nA) - * 0b0011..P current 4(nA) and N Current 6(nA) - * 0b0100..P current 9(nA) and N Current 4(nA) - * 0b0101..P current 13(nA) and N Current 4(nA) - * 0b0111..P current 4(nA) and N Current 4(nA) - * 0b1000..P current 9(nA) and N Current 2(nA) - * 0b1001..P current 13(nA) and N Current 2(nA) - * 0b1011..P current 4(nA) and N Current 2(nA) - */ -#define VBAT_OSCCFGA_DLY_TRIM(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCFGA_DLY_TRIM_SHIFT)) & VBAT_OSCCFGA_DLY_TRIM_MASK) - -#define VBAT_OSCCFGA_CAP_TRIM_MASK (0x180U) -#define VBAT_OSCCFGA_CAP_TRIM_SHIFT (7U) -/*! CAP_TRIM - Capacitor Trim - * 0b00..Default (when CAP2_TRIM = 0 and CAP_TRIM[1:0] = 00 ) - * 0b01..-1us (when CAP2_TRIM = 0 and CAP_TRIM[1:0] = 01) - * 0b10..-2us (when CAP2_TRIM = 0 and CAP_TRIM[1:0] = 10) or or +3.5us (when CAP2_TRIM = 1 and CAP_TRIM[1:0] = 10) - * 0b11..-2.5us (when CAP2_TRIM = 0 and CAP_TRIM[1:0] = 11) or +1us (when CAP2_TRIM = 1 and CAP_TRIM[1:0] = 11) - */ -#define VBAT_OSCCFGA_CAP_TRIM(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCFGA_CAP_TRIM_SHIFT)) & VBAT_OSCCFGA_CAP_TRIM_MASK) - -#define VBAT_OSCCFGA_INIT_TRIM_MASK (0xE00U) -#define VBAT_OSCCFGA_INIT_TRIM_SHIFT (9U) -/*! INIT_TRIM - Initialization Trim - * 0b000..8 s - * 0b001..4 s - * 0b010..2 s - * 0b011..1 s - * 0b100..0.5 s - * 0b101..0.25 s - * 0b110..0.125 s - * 0b111..0.5 ms - */ -#define VBAT_OSCCFGA_INIT_TRIM(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCFGA_INIT_TRIM_SHIFT)) & VBAT_OSCCFGA_INIT_TRIM_MASK) -/*! @} */ - -/*! @name OSCCFGB - Oscillator Configuration B */ -/*! @{ */ - -#define VBAT_OSCCFGB_INVERSE_MASK (0xFFFU) -#define VBAT_OSCCFGB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse Value */ -#define VBAT_OSCCFGB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCFGB_INVERSE_SHIFT)) & VBAT_OSCCFGB_INVERSE_MASK) -/*! @} */ - -/*! @name OSCLCKA - Oscillator Lock A */ -/*! @{ */ - -#define VBAT_OSCLCKA_LOCK_MASK (0x1U) -#define VBAT_OSCLCKA_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b0..Do not block - * 0b1..Block - */ -#define VBAT_OSCLCKA_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCLCKA_LOCK_SHIFT)) & VBAT_OSCLCKA_LOCK_MASK) -/*! @} */ - -/*! @name OSCLCKB - Oscillator Lock B */ -/*! @{ */ - -#define VBAT_OSCLCKB_LOCK_MASK (0x1U) -#define VBAT_OSCLCKB_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b1..Do not block - * 0b0..Block - */ -#define VBAT_OSCLCKB_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCLCKB_LOCK_SHIFT)) & VBAT_OSCLCKB_LOCK_MASK) -/*! @} */ - -/*! @name OSCCLKE - Oscillator Clock Enable */ -/*! @{ */ - -#define VBAT_OSCCLKE_CLKE_MASK (0xFU) -#define VBAT_OSCCLKE_CLKE_SHIFT (0U) -/*! CLKE - Clock Enable */ -#define VBAT_OSCCLKE_CLKE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_OSCCLKE_CLKE_SHIFT)) & VBAT_OSCCLKE_CLKE_MASK) -/*! @} */ - -/*! @name FROCTLA - FRO16K Control A */ -/*! @{ */ - -#define VBAT_FROCTLA_FRO_EN_MASK (0x1U) -#define VBAT_FROCTLA_FRO_EN_SHIFT (0U) -/*! FRO_EN - FRO16K Enable - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_FROCTLA_FRO_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_FROCTLA_FRO_EN_SHIFT)) & VBAT_FROCTLA_FRO_EN_MASK) -/*! @} */ - -/*! @name FROCTLB - FRO16K Control B */ -/*! @{ */ - -#define VBAT_FROCTLB_INVERSE_MASK (0x1U) -#define VBAT_FROCTLB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse Value */ -#define VBAT_FROCTLB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_FROCTLB_INVERSE_SHIFT)) & VBAT_FROCTLB_INVERSE_MASK) -/*! @} */ - -/*! @name FROLCKA - FRO16K Lock A */ -/*! @{ */ - -#define VBAT_FROLCKA_LOCK_MASK (0x1U) -#define VBAT_FROLCKA_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b0..Do not block - * 0b1..Block - */ -#define VBAT_FROLCKA_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_FROLCKA_LOCK_SHIFT)) & VBAT_FROLCKA_LOCK_MASK) -/*! @} */ - -/*! @name FROLCKB - FRO16K Lock B */ -/*! @{ */ - -#define VBAT_FROLCKB_LOCK_MASK (0x1U) -#define VBAT_FROLCKB_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b1..Do not block - * 0b0..Block - */ -#define VBAT_FROLCKB_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_FROLCKB_LOCK_SHIFT)) & VBAT_FROLCKB_LOCK_MASK) -/*! @} */ - -/*! @name FROCLKE - FRO16K Clock Enable */ -/*! @{ */ - -#define VBAT_FROCLKE_CLKE_MASK (0xFU) -#define VBAT_FROCLKE_CLKE_SHIFT (0U) -/*! CLKE - Clock Enable */ -#define VBAT_FROCLKE_CLKE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_FROCLKE_CLKE_SHIFT)) & VBAT_FROCLKE_CLKE_MASK) -/*! @} */ - -/*! @name LDOCTLA - LDO_RAM Control A */ -/*! @{ */ - -#define VBAT_LDOCTLA_BG_EN_MASK (0x1U) -#define VBAT_LDOCTLA_BG_EN_SHIFT (0U) -/*! BG_EN - Bandgap Enable - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_LDOCTLA_BG_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDOCTLA_BG_EN_SHIFT)) & VBAT_LDOCTLA_BG_EN_MASK) - -#define VBAT_LDOCTLA_LDO_EN_MASK (0x2U) -#define VBAT_LDOCTLA_LDO_EN_SHIFT (1U) -/*! LDO_EN - LDO Enable - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_LDOCTLA_LDO_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDOCTLA_LDO_EN_SHIFT)) & VBAT_LDOCTLA_LDO_EN_MASK) - -#define VBAT_LDOCTLA_REFRESH_EN_MASK (0x4U) -#define VBAT_LDOCTLA_REFRESH_EN_SHIFT (2U) -/*! REFRESH_EN - Refresh Enable - * 0b0..Refresh mode is disabled - * 0b1..Refresh mode is enabled for low power operation - */ -#define VBAT_LDOCTLA_REFRESH_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDOCTLA_REFRESH_EN_SHIFT)) & VBAT_LDOCTLA_REFRESH_EN_MASK) -/*! @} */ - -/*! @name LDOCTLB - LDO_RAM Control B */ -/*! @{ */ - -#define VBAT_LDOCTLB_INVERSE_MASK (0x7U) -#define VBAT_LDOCTLB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse Value */ -#define VBAT_LDOCTLB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDOCTLB_INVERSE_SHIFT)) & VBAT_LDOCTLB_INVERSE_MASK) -/*! @} */ - -/*! @name LDOLCKA - LDO_RAM Lock A */ -/*! @{ */ - -#define VBAT_LDOLCKA_LOCK_MASK (0x1U) -#define VBAT_LDOLCKA_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b0..Do not block - * 0b1..Block - */ -#define VBAT_LDOLCKA_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDOLCKA_LOCK_SHIFT)) & VBAT_LDOLCKA_LOCK_MASK) -/*! @} */ - -/*! @name LDOLCKB - LDO_RAM Lock B */ -/*! @{ */ - -#define VBAT_LDOLCKB_LOCK_MASK (0x1U) -#define VBAT_LDOLCKB_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b1..Do not block - * 0b0..Block - */ -#define VBAT_LDOLCKB_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDOLCKB_LOCK_SHIFT)) & VBAT_LDOLCKB_LOCK_MASK) -/*! @} */ - -/*! @name LDORAMC - RAM Control */ -/*! @{ */ - -#define VBAT_LDORAMC_ISO_MASK (0x1U) -#define VBAT_LDORAMC_ISO_SHIFT (0U) -/*! ISO - Isolate SRAM - * 0b0..State follows the chip power modes - * 0b1..Isolates SRAM and places it in Low-Power Retention mode - */ -#define VBAT_LDORAMC_ISO(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDORAMC_ISO_SHIFT)) & VBAT_LDORAMC_ISO_MASK) - -#define VBAT_LDORAMC_SWI_MASK (0x2U) -#define VBAT_LDORAMC_SWI_SHIFT (1U) -/*! SWI - Switch SRAM - * 0b0..Supply follows the chip power modes - * 0b1..LDO_RAM powers the array - */ -#define VBAT_LDORAMC_SWI(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDORAMC_SWI_SHIFT)) & VBAT_LDORAMC_SWI_MASK) - -#define VBAT_LDORAMC_RET0_MASK (0x100U) -#define VBAT_LDORAMC_RET0_SHIFT (8U) -/*! RET0 - Retention - * 0b0..Corresponding SRAM array is retained in low-power modes - * 0b1..Corresponding SRAM array is not retained in low-power modes - */ -#define VBAT_LDORAMC_RET0(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDORAMC_RET0_SHIFT)) & VBAT_LDORAMC_RET0_MASK) - -#define VBAT_LDORAMC_RET1_MASK (0x200U) -#define VBAT_LDORAMC_RET1_SHIFT (9U) -/*! RET1 - Retention - * 0b0..Corresponding SRAM array is retained in low-power modes - * 0b1..Corresponding SRAM array is not retained in low-power modes - */ -#define VBAT_LDORAMC_RET1(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDORAMC_RET1_SHIFT)) & VBAT_LDORAMC_RET1_MASK) - -#define VBAT_LDORAMC_RET2_MASK (0x400U) -#define VBAT_LDORAMC_RET2_SHIFT (10U) -/*! RET2 - Retention - * 0b0..Corresponding SRAM array is retained in low-power modes - * 0b1..Corresponding SRAM array is not retained in low-power modes - */ -#define VBAT_LDORAMC_RET2(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDORAMC_RET2_SHIFT)) & VBAT_LDORAMC_RET2_MASK) - -#define VBAT_LDORAMC_RET3_MASK (0x800U) -#define VBAT_LDORAMC_RET3_SHIFT (11U) -/*! RET3 - Retention - * 0b0..Corresponding SRAM array is retained in low-power modes - * 0b1..Corresponding SRAM array is not retained in low-power modes - */ -#define VBAT_LDORAMC_RET3(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDORAMC_RET3_SHIFT)) & VBAT_LDORAMC_RET3_MASK) -/*! @} */ - -/*! @name LDOTIMER0 - Bandgap Timer 0 */ -/*! @{ */ - -#define VBAT_LDOTIMER0_TIMCFG_MASK (0x7U) -#define VBAT_LDOTIMER0_TIMCFG_SHIFT (0U) -/*! TIMCFG - Timeout Configuration - * 0b111..7.8125 ms - * 0b110..15.625 ms - * 0b101..31.25 ms - * 0b100..62.5 ms - * 0b011..125 ms - * 0b010..250 ms - * 0b001..500 ms - * 0b000..1 s - */ -#define VBAT_LDOTIMER0_TIMCFG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDOTIMER0_TIMCFG_SHIFT)) & VBAT_LDOTIMER0_TIMCFG_MASK) - -#define VBAT_LDOTIMER0_TIMEN_MASK (0x80000000U) -#define VBAT_LDOTIMER0_TIMEN_SHIFT (31U) -/*! TIMEN - Bandgap Timeout Period Enable - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_LDOTIMER0_TIMEN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDOTIMER0_TIMEN_SHIFT)) & VBAT_LDOTIMER0_TIMEN_MASK) -/*! @} */ - -/*! @name LDOTIMER1 - Bandgap Timer 1 */ -/*! @{ */ - -#define VBAT_LDOTIMER1_TIMCFG_MASK (0xFFFFFFU) -#define VBAT_LDOTIMER1_TIMCFG_SHIFT (0U) -/*! TIMCFG - Timeout Configuration */ -#define VBAT_LDOTIMER1_TIMCFG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDOTIMER1_TIMCFG_SHIFT)) & VBAT_LDOTIMER1_TIMCFG_MASK) - -#define VBAT_LDOTIMER1_TIMEN_MASK (0x80000000U) -#define VBAT_LDOTIMER1_TIMEN_SHIFT (31U) -/*! TIMEN - Bandgap Timeout Period Enable - * 0b0..Disable - * 0b1..Enable - */ -#define VBAT_LDOTIMER1_TIMEN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDOTIMER1_TIMEN_SHIFT)) & VBAT_LDOTIMER1_TIMEN_MASK) -/*! @} */ - -/*! @name MONCTLA - CLKMON Control A */ -/*! @{ */ - -#define VBAT_MONCTLA_MON_EN_MASK (0x1U) -#define VBAT_MONCTLA_MON_EN_SHIFT (0U) -/*! MON_EN - CLKMON Enable - * 0b0..CLKMON is disabled - * 0b1..CLKMON is enabled - */ -#define VBAT_MONCTLA_MON_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_MONCTLA_MON_EN_SHIFT)) & VBAT_MONCTLA_MON_EN_MASK) -/*! @} */ - -/*! @name MONCTLB - CLKMON Control B */ -/*! @{ */ - -#define VBAT_MONCTLB_INVERSE_MASK (0x1U) -#define VBAT_MONCTLB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse value */ -#define VBAT_MONCTLB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_MONCTLB_INVERSE_SHIFT)) & VBAT_MONCTLB_INVERSE_MASK) -/*! @} */ - -/*! @name MONCFGA - CLKMON Configuration A */ -/*! @{ */ - -#define VBAT_MONCFGA_FREQ_TRIM_MASK (0x3U) -#define VBAT_MONCFGA_FREQ_TRIM_SHIFT (0U) -/*! FREQ_TRIM - Frequency Trim - * 0b00..Clock monitor asserts 2 cycle after expected edge - * 0b01..Clock monitor asserts 4 cycles after expected edge - * 0b10..Clock monitor asserts 6 cycles after expected edge - * 0b11..Clock monitor asserts 8 cycles after expected edge - */ -#define VBAT_MONCFGA_FREQ_TRIM(x) (((uint32_t)(((uint32_t)(x)) << VBAT_MONCFGA_FREQ_TRIM_SHIFT)) & VBAT_MONCFGA_FREQ_TRIM_MASK) - -#define VBAT_MONCFGA_DIVIDE_TRIM_MASK (0x4U) -#define VBAT_MONCFGA_DIVIDE_TRIM_SHIFT (2U) -/*! DIVIDE_TRIM - Divide Trim - * 0b0..Clock monitor operates at 1 kHz - * 0b1..Clock monitor operates at 64 Hz - */ -#define VBAT_MONCFGA_DIVIDE_TRIM(x) (((uint32_t)(((uint32_t)(x)) << VBAT_MONCFGA_DIVIDE_TRIM_SHIFT)) & VBAT_MONCFGA_DIVIDE_TRIM_MASK) - -#define VBAT_MONCFGA_RSVD_TRIM_MASK (0xF8U) -#define VBAT_MONCFGA_RSVD_TRIM_SHIFT (3U) -/*! RSVD_TRIM - Reserved Trim */ -#define VBAT_MONCFGA_RSVD_TRIM(x) (((uint32_t)(((uint32_t)(x)) << VBAT_MONCFGA_RSVD_TRIM_SHIFT)) & VBAT_MONCFGA_RSVD_TRIM_MASK) -/*! @} */ - -/*! @name MONCFGB - CLKMON Configuration B */ -/*! @{ */ - -#define VBAT_MONCFGB_INVERSE_MASK (0xFFU) -#define VBAT_MONCFGB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse value */ -#define VBAT_MONCFGB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_MONCFGB_INVERSE_SHIFT)) & VBAT_MONCFGB_INVERSE_MASK) -/*! @} */ - -/*! @name MONLCKA - CLKMON Lock A */ -/*! @{ */ - -#define VBAT_MONLCKA_LOCK_MASK (0x1U) -#define VBAT_MONLCKA_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b0..Lock is disabled - * 0b1..Lock is enabled - */ -#define VBAT_MONLCKA_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_MONLCKA_LOCK_SHIFT)) & VBAT_MONLCKA_LOCK_MASK) -/*! @} */ - -/*! @name MONLCKB - CLKMON Lock B */ -/*! @{ */ - -#define VBAT_MONLCKB_LOCK_MASK (0x1U) -#define VBAT_MONLCKB_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b1..Lock is disabled - * 0b0..Lock is enabled - */ -#define VBAT_MONLCKB_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_MONLCKB_LOCK_SHIFT)) & VBAT_MONLCKB_LOCK_MASK) -/*! @} */ - -/*! @name TAMCTLA - TAMPER Control A */ -/*! @{ */ - -#define VBAT_TAMCTLA_VOLT_EN_MASK (0x1U) -#define VBAT_TAMCTLA_VOLT_EN_SHIFT (0U) -/*! VOLT_EN - Voltage Detect Enable - * 0b0..Voltage detect is disabled - * 0b1..Voltage detect is enabled - */ -#define VBAT_TAMCTLA_VOLT_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMCTLA_VOLT_EN_SHIFT)) & VBAT_TAMCTLA_VOLT_EN_MASK) - -#define VBAT_TAMCTLA_TEMP_EN_MASK (0x2U) -#define VBAT_TAMCTLA_TEMP_EN_SHIFT (1U) -/*! TEMP_EN - Temperature Detect Enable - * 0b0..Temperature detect is disabled - * 0b1..Temperature detect is enabled - */ -#define VBAT_TAMCTLA_TEMP_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMCTLA_TEMP_EN_SHIFT)) & VBAT_TAMCTLA_TEMP_EN_MASK) - -#define VBAT_TAMCTLA_LIGHT_EN_MASK (0x4U) -#define VBAT_TAMCTLA_LIGHT_EN_SHIFT (2U) -/*! LIGHT_EN - Light Detect Enable - * 0b0..Light detect is disabled - * 0b1..Light detect is enabled - */ -#define VBAT_TAMCTLA_LIGHT_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMCTLA_LIGHT_EN_SHIFT)) & VBAT_TAMCTLA_LIGHT_EN_MASK) -/*! @} */ - -/*! @name TAMCTLB - TAMPER Control B */ -/*! @{ */ - -#define VBAT_TAMCTLB_INVERSE_MASK (0xFU) -#define VBAT_TAMCTLB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse value */ -#define VBAT_TAMCTLB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMCTLB_INVERSE_SHIFT)) & VBAT_TAMCTLB_INVERSE_MASK) -/*! @} */ - -/*! @name TAMLCKA - TAMPER Lock A */ -/*! @{ */ - -#define VBAT_TAMLCKA_LOCK_MASK (0x1U) -#define VBAT_TAMLCKA_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b0..Lock is disabled - * 0b1..Lock is enabled - */ -#define VBAT_TAMLCKA_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMLCKA_LOCK_SHIFT)) & VBAT_TAMLCKA_LOCK_MASK) -/*! @} */ - -/*! @name TAMLCKB - TAMPER Lock B */ -/*! @{ */ - -#define VBAT_TAMLCKB_LOCK_MASK (0x1U) -#define VBAT_TAMLCKB_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b1..Lock is disabled - * 0b0..Lock is enabled - */ -#define VBAT_TAMLCKB_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_TAMLCKB_LOCK_SHIFT)) & VBAT_TAMLCKB_LOCK_MASK) -/*! @} */ - -/*! @name SWICTLA - Switch Control A */ -/*! @{ */ - -#define VBAT_SWICTLA_SWI_EN_MASK (0x1U) -#define VBAT_SWICTLA_SWI_EN_SHIFT (0U) -/*! SWI_EN - Switch Enable - * 0b0..VDD_BAT - * 0b1..VDD_SYS - */ -#define VBAT_SWICTLA_SWI_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_SWICTLA_SWI_EN_SHIFT)) & VBAT_SWICTLA_SWI_EN_MASK) - -#define VBAT_SWICTLA_LP_EN_MASK (0x2U) -#define VBAT_SWICTLA_LP_EN_SHIFT (1U) -/*! LP_EN - Low Power Enable - * 0b0..VDD_BAT always supplies VBAT modules in low-power modes - * 0b1..VDD_SYS always supplies VBAT modules if SWI_EN is also 1 - */ -#define VBAT_SWICTLA_LP_EN(x) (((uint32_t)(((uint32_t)(x)) << VBAT_SWICTLA_LP_EN_SHIFT)) & VBAT_SWICTLA_LP_EN_MASK) -/*! @} */ - -/*! @name SWICTLB - Switch Control B */ -/*! @{ */ - -#define VBAT_SWICTLB_INVERSE_MASK (0x3U) -#define VBAT_SWICTLB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse Value */ -#define VBAT_SWICTLB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_SWICTLB_INVERSE_SHIFT)) & VBAT_SWICTLB_INVERSE_MASK) -/*! @} */ - -/*! @name SWILCKA - Switch Lock A */ -/*! @{ */ - -#define VBAT_SWILCKA_LOCK_MASK (0x1U) -#define VBAT_SWILCKA_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b0..Do not block - * 0b1..Block - */ -#define VBAT_SWILCKA_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_SWILCKA_LOCK_SHIFT)) & VBAT_SWILCKA_LOCK_MASK) -/*! @} */ - -/*! @name SWILCKB - Switch Lock B */ -/*! @{ */ - -#define VBAT_SWILCKB_LOCK_MASK (0x1U) -#define VBAT_SWILCKB_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b1..Do not block - * 0b0..Block - */ -#define VBAT_SWILCKB_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_SWILCKB_LOCK_SHIFT)) & VBAT_SWILCKB_LOCK_MASK) -/*! @} */ - -/*! @name WAKEUP_WAKEUPA - Wakeup 0 Register A */ -/*! @{ */ - -#define VBAT_WAKEUP_WAKEUPA_REG_MASK (0xFFFFFFFFU) -#define VBAT_WAKEUP_WAKEUPA_REG_SHIFT (0U) -/*! REG - Register */ -#define VBAT_WAKEUP_WAKEUPA_REG(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKEUP_WAKEUPA_REG_SHIFT)) & VBAT_WAKEUP_WAKEUPA_REG_MASK) -/*! @} */ - -/* The count of VBAT_WAKEUP_WAKEUPA */ -#define VBAT_WAKEUP_WAKEUPA_COUNT (2U) - -/*! @name WAKEUP_WAKEUPB - Wakeup 0 Register B */ -/*! @{ */ - -#define VBAT_WAKEUP_WAKEUPB_INVERSE_MASK (0xFFFFFFFFU) -#define VBAT_WAKEUP_WAKEUPB_INVERSE_SHIFT (0U) -/*! INVERSE - Inverse value */ -#define VBAT_WAKEUP_WAKEUPB_INVERSE(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKEUP_WAKEUPB_INVERSE_SHIFT)) & VBAT_WAKEUP_WAKEUPB_INVERSE_MASK) -/*! @} */ - -/* The count of VBAT_WAKEUP_WAKEUPB */ -#define VBAT_WAKEUP_WAKEUPB_COUNT (2U) - -/*! @name WAKLCKA - Wakeup Lock A */ -/*! @{ */ - -#define VBAT_WAKLCKA_LOCK_MASK (0x1U) -#define VBAT_WAKLCKA_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b0..Lock is disabled - * 0b1..Lock is enabled - */ -#define VBAT_WAKLCKA_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKLCKA_LOCK_SHIFT)) & VBAT_WAKLCKA_LOCK_MASK) -/*! @} */ - -/*! @name WAKLCKB - Wakeup Lock B */ -/*! @{ */ - -#define VBAT_WAKLCKB_LOCK_MASK (0x1U) -#define VBAT_WAKLCKB_LOCK_SHIFT (0U) -/*! LOCK - Lock - * 0b1..Lock is disabled - * 0b0..Lock is enabled - */ -#define VBAT_WAKLCKB_LOCK(x) (((uint32_t)(((uint32_t)(x)) << VBAT_WAKLCKB_LOCK_SHIFT)) & VBAT_WAKLCKB_LOCK_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group VBAT_Register_Masks */ - - -/* VBAT - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral VBAT0 base address */ - #define VBAT0_BASE (0x50059000u) - /** Peripheral VBAT0 base address */ - #define VBAT0_BASE_NS (0x40059000u) - /** Peripheral VBAT0 base pointer */ - #define VBAT0 ((VBAT_Type *)VBAT0_BASE) - /** Peripheral VBAT0 base pointer */ - #define VBAT0_NS ((VBAT_Type *)VBAT0_BASE_NS) - /** Array initializer of VBAT peripheral base addresses */ - #define VBAT_BASE_ADDRS { VBAT0_BASE } - /** Array initializer of VBAT peripheral base pointers */ - #define VBAT_BASE_PTRS { VBAT0 } - /** Array initializer of VBAT peripheral base addresses */ - #define VBAT_BASE_ADDRS_NS { VBAT0_BASE_NS } - /** Array initializer of VBAT peripheral base pointers */ - #define VBAT_BASE_PTRS_NS { VBAT0_NS } -#else - /** Peripheral VBAT0 base address */ - #define VBAT0_BASE (0x40059000u) - /** Peripheral VBAT0 base pointer */ - #define VBAT0 ((VBAT_Type *)VBAT0_BASE) - /** Array initializer of VBAT peripheral base addresses */ - #define VBAT_BASE_ADDRS { VBAT0_BASE } - /** Array initializer of VBAT peripheral base pointers */ - #define VBAT_BASE_PTRS { VBAT0 } -#endif - -/*! - * @} - */ /* end of group VBAT_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- VREF Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup VREF_Peripheral_Access_Layer VREF Peripheral Access Layer - * @{ - */ - -/** VREF - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - uint8_t RESERVED_0[4]; - __IO uint32_t CSR; /**< Control and Status, offset: 0x8 */ - uint8_t RESERVED_1[4]; - __IO uint32_t UTRIM; /**< User Trim, offset: 0x10 */ -} VREF_Type; - -/* ---------------------------------------------------------------------------- - -- VREF Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup VREF_Register_Masks VREF Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define VREF_VERID_FEATURE_MASK (0xFFFFU) -#define VREF_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number */ -#define VREF_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << VREF_VERID_FEATURE_SHIFT)) & VREF_VERID_FEATURE_MASK) - -#define VREF_VERID_MINOR_MASK (0xFF0000U) -#define VREF_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define VREF_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << VREF_VERID_MINOR_SHIFT)) & VREF_VERID_MINOR_MASK) - -#define VREF_VERID_MAJOR_MASK (0xFF000000U) -#define VREF_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define VREF_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << VREF_VERID_MAJOR_SHIFT)) & VREF_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name CSR - Control and Status */ -/*! @{ */ - -#define VREF_CSR_HCBGEN_MASK (0x1U) -#define VREF_CSR_HCBGEN_SHIFT (0U) -/*! HCBGEN - HC Bandgap Enabled - * 0b0..Disables - * 0b1..Enables - */ -#define VREF_CSR_HCBGEN(x) (((uint32_t)(((uint32_t)(x)) << VREF_CSR_HCBGEN_SHIFT)) & VREF_CSR_HCBGEN_MASK) - -#define VREF_CSR_LPBGEN_MASK (0x2U) -#define VREF_CSR_LPBGEN_SHIFT (1U) -/*! LPBGEN - Low-Power Bandgap Enable - * 0b0..Disables - * 0b1..Enables - */ -#define VREF_CSR_LPBGEN(x) (((uint32_t)(((uint32_t)(x)) << VREF_CSR_LPBGEN_SHIFT)) & VREF_CSR_LPBGEN_MASK) - -#define VREF_CSR_LPBG_BUF_EN_MASK (0x4U) -#define VREF_CSR_LPBG_BUF_EN_SHIFT (2U) -/*! LPBG_BUF_EN - Low-Power Bandgap Buffer Enable - * 0b0..Disables - * 0b1..Enables - */ -#define VREF_CSR_LPBG_BUF_EN(x) (((uint32_t)(((uint32_t)(x)) << VREF_CSR_LPBG_BUF_EN_SHIFT)) & VREF_CSR_LPBG_BUF_EN_MASK) - -#define VREF_CSR_CHOPEN_MASK (0x8U) -#define VREF_CSR_CHOPEN_SHIFT (3U) -/*! CHOPEN - Chop Oscillator Enable - * 0b0..Disables - * 0b1..Enables - */ -#define VREF_CSR_CHOPEN(x) (((uint32_t)(((uint32_t)(x)) << VREF_CSR_CHOPEN_SHIFT)) & VREF_CSR_CHOPEN_MASK) - -#define VREF_CSR_ICOMPEN_MASK (0x10U) -#define VREF_CSR_ICOMPEN_SHIFT (4U) -/*! ICOMPEN - Current Compensation Enable - * 0b0..Disables - * 0b1..Enables - */ -#define VREF_CSR_ICOMPEN(x) (((uint32_t)(((uint32_t)(x)) << VREF_CSR_ICOMPEN_SHIFT)) & VREF_CSR_ICOMPEN_MASK) - -#define VREF_CSR_REGEN_MASK (0x20U) -#define VREF_CSR_REGEN_SHIFT (5U) -/*! REGEN - Regulator Enable - * 0b0..Disables - * 0b1..Enables - */ -#define VREF_CSR_REGEN(x) (((uint32_t)(((uint32_t)(x)) << VREF_CSR_REGEN_SHIFT)) & VREF_CSR_REGEN_MASK) - -#define VREF_CSR_HI_PWR_LV_MASK (0x800U) -#define VREF_CSR_HI_PWR_LV_SHIFT (11U) -/*! HI_PWR_LV - High-Power Level - * 0b0..Low-power - * 0b1..High-power - */ -#define VREF_CSR_HI_PWR_LV(x) (((uint32_t)(((uint32_t)(x)) << VREF_CSR_HI_PWR_LV_SHIFT)) & VREF_CSR_HI_PWR_LV_MASK) - -#define VREF_CSR_BUF21EN_MASK (0x10000U) -#define VREF_CSR_BUF21EN_SHIFT (16U) -/*! BUF21EN - Internal Buffer21 Enable - * 0b0..Disables - * 0b1..Enables - */ -#define VREF_CSR_BUF21EN(x) (((uint32_t)(((uint32_t)(x)) << VREF_CSR_BUF21EN_SHIFT)) & VREF_CSR_BUF21EN_MASK) - -#define VREF_CSR_VREFST_MASK (0x80000000U) -#define VREF_CSR_VREFST_SHIFT (31U) -/*! VREFST - Internal HC Voltage Reference Stable - * 0b0..Disabled and unstable - * 0b1..Stable - */ -#define VREF_CSR_VREFST(x) (((uint32_t)(((uint32_t)(x)) << VREF_CSR_VREFST_SHIFT)) & VREF_CSR_VREFST_MASK) -/*! @} */ - -/*! @name UTRIM - User Trim */ -/*! @{ */ - -#define VREF_UTRIM_TRIM2V1_MASK (0xFU) -#define VREF_UTRIM_TRIM2V1_SHIFT (0U) -/*! TRIM2V1 - VREF 2.1 V Trim */ -#define VREF_UTRIM_TRIM2V1(x) (((uint32_t)(((uint32_t)(x)) << VREF_UTRIM_TRIM2V1_SHIFT)) & VREF_UTRIM_TRIM2V1_MASK) - -#define VREF_UTRIM_VREFTRIM_MASK (0x3F00U) -#define VREF_UTRIM_VREFTRIM_SHIFT (8U) -/*! VREFTRIM - VREF Trim */ -#define VREF_UTRIM_VREFTRIM(x) (((uint32_t)(((uint32_t)(x)) << VREF_UTRIM_VREFTRIM_SHIFT)) & VREF_UTRIM_VREFTRIM_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group VREF_Register_Masks */ - - -/* VREF - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral VREF0 base address */ - #define VREF0_BASE (0x50111000u) - /** Peripheral VREF0 base address */ - #define VREF0_BASE_NS (0x40111000u) - /** Peripheral VREF0 base pointer */ - #define VREF0 ((VREF_Type *)VREF0_BASE) - /** Peripheral VREF0 base pointer */ - #define VREF0_NS ((VREF_Type *)VREF0_BASE_NS) - /** Array initializer of VREF peripheral base addresses */ - #define VREF_BASE_ADDRS { VREF0_BASE } - /** Array initializer of VREF peripheral base pointers */ - #define VREF_BASE_PTRS { VREF0 } - /** Array initializer of VREF peripheral base addresses */ - #define VREF_BASE_ADDRS_NS { VREF0_BASE_NS } - /** Array initializer of VREF peripheral base pointers */ - #define VREF_BASE_PTRS_NS { VREF0_NS } -#else - /** Peripheral VREF0 base address */ - #define VREF0_BASE (0x40111000u) - /** Peripheral VREF0 base pointer */ - #define VREF0 ((VREF_Type *)VREF0_BASE) - /** Array initializer of VREF peripheral base addresses */ - #define VREF_BASE_ADDRS { VREF0_BASE } - /** Array initializer of VREF peripheral base pointers */ - #define VREF_BASE_PTRS { VREF0 } -#endif - -/*! - * @} - */ /* end of group VREF_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- WUU Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup WUU_Peripheral_Access_Layer WUU Peripheral Access Layer - * @{ - */ - -/** WUU - Register Layout Typedef */ -typedef struct { - __I uint32_t VERID; /**< Version ID, offset: 0x0 */ - __I uint32_t PARAM; /**< Parameter, offset: 0x4 */ - __IO uint32_t PE1; /**< Pin Enable 1, offset: 0x8 */ - __IO uint32_t PE2; /**< Pin Enable 2, offset: 0xC */ - uint8_t RESERVED_0[8]; - __IO uint32_t ME; /**< Module Interrupt Enable, offset: 0x18 */ - __IO uint32_t DE; /**< Module DMA/Trigger Enable, offset: 0x1C */ - __IO uint32_t PF; /**< Pin Flag, offset: 0x20 */ - uint8_t RESERVED_1[12]; - __IO uint32_t FILT; /**< Pin Filter, offset: 0x30 */ - uint8_t RESERVED_2[4]; - __IO uint32_t PDC1; /**< Pin DMA/Trigger Configuration 1, offset: 0x38 */ - __IO uint32_t PDC2; /**< Pin DMA/Trigger Configuration 2, offset: 0x3C */ - uint8_t RESERVED_3[8]; - __IO uint32_t FDC; /**< Pin Filter DMA/Trigger Configuration, offset: 0x48 */ - uint8_t RESERVED_4[4]; - __IO uint32_t PMC; /**< Pin Mode Configuration, offset: 0x50 */ - uint8_t RESERVED_5[4]; - __IO uint32_t FMC; /**< Pin Filter Mode Configuration, offset: 0x58 */ -} WUU_Type; - -/* ---------------------------------------------------------------------------- - -- WUU Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup WUU_Register_Masks WUU Register Masks - * @{ - */ - -/*! @name VERID - Version ID */ -/*! @{ */ - -#define WUU_VERID_FEATURE_MASK (0xFFFFU) -#define WUU_VERID_FEATURE_SHIFT (0U) -/*! FEATURE - Feature Specification Number - * 0b0000000000000000..Standard features implemented - * 0b0000000000000001..Support for DMA/Trigger generation from wake-up pins and filters enabled. Support for - * external pin/filter detection during all power modes enabled. - * *.. - */ -#define WUU_VERID_FEATURE(x) (((uint32_t)(((uint32_t)(x)) << WUU_VERID_FEATURE_SHIFT)) & WUU_VERID_FEATURE_MASK) - -#define WUU_VERID_MINOR_MASK (0xFF0000U) -#define WUU_VERID_MINOR_SHIFT (16U) -/*! MINOR - Minor Version Number */ -#define WUU_VERID_MINOR(x) (((uint32_t)(((uint32_t)(x)) << WUU_VERID_MINOR_SHIFT)) & WUU_VERID_MINOR_MASK) - -#define WUU_VERID_MAJOR_MASK (0xFF000000U) -#define WUU_VERID_MAJOR_SHIFT (24U) -/*! MAJOR - Major Version Number */ -#define WUU_VERID_MAJOR(x) (((uint32_t)(((uint32_t)(x)) << WUU_VERID_MAJOR_SHIFT)) & WUU_VERID_MAJOR_MASK) -/*! @} */ - -/*! @name PARAM - Parameter */ -/*! @{ */ - -#define WUU_PARAM_FILTERS_MASK (0xFFU) -#define WUU_PARAM_FILTERS_SHIFT (0U) -/*! FILTERS - Filter Number */ -#define WUU_PARAM_FILTERS(x) (((uint32_t)(((uint32_t)(x)) << WUU_PARAM_FILTERS_SHIFT)) & WUU_PARAM_FILTERS_MASK) - -#define WUU_PARAM_DMAS_MASK (0xFF00U) -#define WUU_PARAM_DMAS_SHIFT (8U) -/*! DMAS - DMA Number */ -#define WUU_PARAM_DMAS(x) (((uint32_t)(((uint32_t)(x)) << WUU_PARAM_DMAS_SHIFT)) & WUU_PARAM_DMAS_MASK) - -#define WUU_PARAM_MODULES_MASK (0xFF0000U) -#define WUU_PARAM_MODULES_SHIFT (16U) -/*! MODULES - Module Number */ -#define WUU_PARAM_MODULES(x) (((uint32_t)(((uint32_t)(x)) << WUU_PARAM_MODULES_SHIFT)) & WUU_PARAM_MODULES_MASK) - -#define WUU_PARAM_PINS_MASK (0xFF000000U) -#define WUU_PARAM_PINS_SHIFT (24U) -/*! PINS - Pin Number */ -#define WUU_PARAM_PINS(x) (((uint32_t)(((uint32_t)(x)) << WUU_PARAM_PINS_SHIFT)) & WUU_PARAM_PINS_MASK) -/*! @} */ - -/*! @name PE1 - Pin Enable 1 */ -/*! @{ */ - -#define WUU_PE1_WUPE0_MASK (0x3U) -#define WUU_PE1_WUPE0_SHIFT (0U) -/*! WUPE0 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE0(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE0_SHIFT)) & WUU_PE1_WUPE0_MASK) - -#define WUU_PE1_WUPE1_MASK (0xCU) -#define WUU_PE1_WUPE1_SHIFT (2U) -/*! WUPE1 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE1(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE1_SHIFT)) & WUU_PE1_WUPE1_MASK) - -#define WUU_PE1_WUPE2_MASK (0x30U) -#define WUU_PE1_WUPE2_SHIFT (4U) -/*! WUPE2 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE2(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE2_SHIFT)) & WUU_PE1_WUPE2_MASK) - -#define WUU_PE1_WUPE3_MASK (0xC0U) -#define WUU_PE1_WUPE3_SHIFT (6U) -/*! WUPE3 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE3(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE3_SHIFT)) & WUU_PE1_WUPE3_MASK) - -#define WUU_PE1_WUPE4_MASK (0x300U) -#define WUU_PE1_WUPE4_SHIFT (8U) -/*! WUPE4 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE4(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE4_SHIFT)) & WUU_PE1_WUPE4_MASK) - -#define WUU_PE1_WUPE5_MASK (0xC00U) -#define WUU_PE1_WUPE5_SHIFT (10U) -/*! WUPE5 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE5(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE5_SHIFT)) & WUU_PE1_WUPE5_MASK) - -#define WUU_PE1_WUPE6_MASK (0x3000U) -#define WUU_PE1_WUPE6_SHIFT (12U) -/*! WUPE6 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE6(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE6_SHIFT)) & WUU_PE1_WUPE6_MASK) - -#define WUU_PE1_WUPE7_MASK (0xC000U) -#define WUU_PE1_WUPE7_SHIFT (14U) -/*! WUPE7 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE7(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE7_SHIFT)) & WUU_PE1_WUPE7_MASK) - -#define WUU_PE1_WUPE8_MASK (0x30000U) -#define WUU_PE1_WUPE8_SHIFT (16U) -/*! WUPE8 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE8(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE8_SHIFT)) & WUU_PE1_WUPE8_MASK) - -#define WUU_PE1_WUPE9_MASK (0xC0000U) -#define WUU_PE1_WUPE9_SHIFT (18U) -/*! WUPE9 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE9(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE9_SHIFT)) & WUU_PE1_WUPE9_MASK) - -#define WUU_PE1_WUPE10_MASK (0x300000U) -#define WUU_PE1_WUPE10_SHIFT (20U) -/*! WUPE10 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE10(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE10_SHIFT)) & WUU_PE1_WUPE10_MASK) - -#define WUU_PE1_WUPE11_MASK (0xC00000U) -#define WUU_PE1_WUPE11_SHIFT (22U) -/*! WUPE11 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE11(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE11_SHIFT)) & WUU_PE1_WUPE11_MASK) - -#define WUU_PE1_WUPE12_MASK (0x3000000U) -#define WUU_PE1_WUPE12_SHIFT (24U) -/*! WUPE12 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE12(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE12_SHIFT)) & WUU_PE1_WUPE12_MASK) - -#define WUU_PE1_WUPE13_MASK (0xC000000U) -#define WUU_PE1_WUPE13_SHIFT (26U) -/*! WUPE13 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE13(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE13_SHIFT)) & WUU_PE1_WUPE13_MASK) - -#define WUU_PE1_WUPE14_MASK (0x30000000U) -#define WUU_PE1_WUPE14_SHIFT (28U) -/*! WUPE14 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE14(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE14_SHIFT)) & WUU_PE1_WUPE14_MASK) - -#define WUU_PE1_WUPE15_MASK (0xC0000000U) -#define WUU_PE1_WUPE15_SHIFT (30U) -/*! WUPE15 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE1_WUPE15(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE1_WUPE15_SHIFT)) & WUU_PE1_WUPE15_MASK) -/*! @} */ - -/*! @name PE2 - Pin Enable 2 */ -/*! @{ */ - -#define WUU_PE2_WUPE16_MASK (0x3U) -#define WUU_PE2_WUPE16_SHIFT (0U) -/*! WUPE16 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE16(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE16_SHIFT)) & WUU_PE2_WUPE16_MASK) - -#define WUU_PE2_WUPE17_MASK (0xCU) -#define WUU_PE2_WUPE17_SHIFT (2U) -/*! WUPE17 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE17(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE17_SHIFT)) & WUU_PE2_WUPE17_MASK) - -#define WUU_PE2_WUPE18_MASK (0x30U) -#define WUU_PE2_WUPE18_SHIFT (4U) -/*! WUPE18 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE18(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE18_SHIFT)) & WUU_PE2_WUPE18_MASK) - -#define WUU_PE2_WUPE19_MASK (0xC0U) -#define WUU_PE2_WUPE19_SHIFT (6U) -/*! WUPE19 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE19(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE19_SHIFT)) & WUU_PE2_WUPE19_MASK) - -#define WUU_PE2_WUPE20_MASK (0x300U) -#define WUU_PE2_WUPE20_SHIFT (8U) -/*! WUPE20 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE20(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE20_SHIFT)) & WUU_PE2_WUPE20_MASK) - -#define WUU_PE2_WUPE21_MASK (0xC00U) -#define WUU_PE2_WUPE21_SHIFT (10U) -/*! WUPE21 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE21(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE21_SHIFT)) & WUU_PE2_WUPE21_MASK) - -#define WUU_PE2_WUPE22_MASK (0x3000U) -#define WUU_PE2_WUPE22_SHIFT (12U) -/*! WUPE22 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE22(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE22_SHIFT)) & WUU_PE2_WUPE22_MASK) - -#define WUU_PE2_WUPE23_MASK (0xC000U) -#define WUU_PE2_WUPE23_SHIFT (14U) -/*! WUPE23 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE23(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE23_SHIFT)) & WUU_PE2_WUPE23_MASK) - -#define WUU_PE2_WUPE24_MASK (0x30000U) -#define WUU_PE2_WUPE24_SHIFT (16U) -/*! WUPE24 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE24(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE24_SHIFT)) & WUU_PE2_WUPE24_MASK) - -#define WUU_PE2_WUPE25_MASK (0xC0000U) -#define WUU_PE2_WUPE25_SHIFT (18U) -/*! WUPE25 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE25(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE25_SHIFT)) & WUU_PE2_WUPE25_MASK) - -#define WUU_PE2_WUPE26_MASK (0x300000U) -#define WUU_PE2_WUPE26_SHIFT (20U) -/*! WUPE26 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE26(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE26_SHIFT)) & WUU_PE2_WUPE26_MASK) - -#define WUU_PE2_WUPE27_MASK (0xC00000U) -#define WUU_PE2_WUPE27_SHIFT (22U) -/*! WUPE27 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE27(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE27_SHIFT)) & WUU_PE2_WUPE27_MASK) - -#define WUU_PE2_WUPE28_MASK (0x3000000U) -#define WUU_PE2_WUPE28_SHIFT (24U) -/*! WUPE28 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE28(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE28_SHIFT)) & WUU_PE2_WUPE28_MASK) - -#define WUU_PE2_WUPE29_MASK (0xC000000U) -#define WUU_PE2_WUPE29_SHIFT (26U) -/*! WUPE29 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE29(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE29_SHIFT)) & WUU_PE2_WUPE29_MASK) - -#define WUU_PE2_WUPE30_MASK (0x30000000U) -#define WUU_PE2_WUPE30_SHIFT (28U) -/*! WUPE30 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE30(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE30_SHIFT)) & WUU_PE2_WUPE30_MASK) - -#define WUU_PE2_WUPE31_MASK (0xC0000000U) -#define WUU_PE2_WUPE31_SHIFT (30U) -/*! WUPE31 - Wake-up Pin Enable for WUU_Pn - * 0b00..Disable - * 0b01..Enable (detect on rising edge or high level) - * 0b10..Enable (detect on falling edge or low level) - * 0b11..Enable (detect on any edge) - */ -#define WUU_PE2_WUPE31(x) (((uint32_t)(((uint32_t)(x)) << WUU_PE2_WUPE31_SHIFT)) & WUU_PE2_WUPE31_MASK) -/*! @} */ - -/*! @name ME - Module Interrupt Enable */ -/*! @{ */ - -#define WUU_ME_WUME0_MASK (0x1U) -#define WUU_ME_WUME0_SHIFT (0U) -/*! WUME0 - Module Interrupt Wake-up Enable for Module 0 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME0(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME0_SHIFT)) & WUU_ME_WUME0_MASK) - -#define WUU_ME_WUME1_MASK (0x2U) -#define WUU_ME_WUME1_SHIFT (1U) -/*! WUME1 - Module Interrupt Wake-up Enable for Module 1 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME1(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME1_SHIFT)) & WUU_ME_WUME1_MASK) - -#define WUU_ME_WUME2_MASK (0x4U) -#define WUU_ME_WUME2_SHIFT (2U) -/*! WUME2 - Module Interrupt Wake-up Enable for Module 2 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME2(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME2_SHIFT)) & WUU_ME_WUME2_MASK) - -#define WUU_ME_WUME3_MASK (0x8U) -#define WUU_ME_WUME3_SHIFT (3U) -/*! WUME3 - Module Interrupt Wake-up Enable for Module 3 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME3(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME3_SHIFT)) & WUU_ME_WUME3_MASK) - -#define WUU_ME_WUME4_MASK (0x10U) -#define WUU_ME_WUME4_SHIFT (4U) -/*! WUME4 - Module Interrupt Wake-up Enable for Module 4 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME4(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME4_SHIFT)) & WUU_ME_WUME4_MASK) - -#define WUU_ME_WUME5_MASK (0x20U) -#define WUU_ME_WUME5_SHIFT (5U) -/*! WUME5 - Module Interrupt Wake-up Enable for Module 5 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME5(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME5_SHIFT)) & WUU_ME_WUME5_MASK) - -#define WUU_ME_WUME6_MASK (0x40U) -#define WUU_ME_WUME6_SHIFT (6U) -/*! WUME6 - Module Interrupt Wake-up Enable for Module 6 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME6(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME6_SHIFT)) & WUU_ME_WUME6_MASK) - -#define WUU_ME_WUME7_MASK (0x80U) -#define WUU_ME_WUME7_SHIFT (7U) -/*! WUME7 - Module Interrupt Wake-up Enable for Module 7 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME7(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME7_SHIFT)) & WUU_ME_WUME7_MASK) - -#define WUU_ME_WUME8_MASK (0x100U) -#define WUU_ME_WUME8_SHIFT (8U) -/*! WUME8 - Module Interrupt Wake-up Enable for Module 8 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME8(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME8_SHIFT)) & WUU_ME_WUME8_MASK) - -#define WUU_ME_WUME9_MASK (0x200U) -#define WUU_ME_WUME9_SHIFT (9U) -/*! WUME9 - Module Interrupt Wake-up Enable for Module 9 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_ME_WUME9(x) (((uint32_t)(((uint32_t)(x)) << WUU_ME_WUME9_SHIFT)) & WUU_ME_WUME9_MASK) -/*! @} */ - -/*! @name DE - Module DMA/Trigger Enable */ -/*! @{ */ - -#define WUU_DE_WUDE0_MASK (0x1U) -#define WUU_DE_WUDE0_SHIFT (0U) -/*! WUDE0 - DMA/Trigger Wake-up Enable for Module 0 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE0(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE0_SHIFT)) & WUU_DE_WUDE0_MASK) - -#define WUU_DE_WUDE1_MASK (0x2U) -#define WUU_DE_WUDE1_SHIFT (1U) -/*! WUDE1 - DMA/Trigger Wake-up Enable for Module 1 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE1(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE1_SHIFT)) & WUU_DE_WUDE1_MASK) - -#define WUU_DE_WUDE2_MASK (0x4U) -#define WUU_DE_WUDE2_SHIFT (2U) -/*! WUDE2 - DMA/Trigger Wake-up Enable for Module 2 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE2(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE2_SHIFT)) & WUU_DE_WUDE2_MASK) - -#define WUU_DE_WUDE3_MASK (0x8U) -#define WUU_DE_WUDE3_SHIFT (3U) -/*! WUDE3 - DMA/Trigger Wake-up Enable for Module 3 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE3(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE3_SHIFT)) & WUU_DE_WUDE3_MASK) - -#define WUU_DE_WUDE4_MASK (0x10U) -#define WUU_DE_WUDE4_SHIFT (4U) -/*! WUDE4 - DMA/Trigger Wake-up Enable for Module 4 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE4(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE4_SHIFT)) & WUU_DE_WUDE4_MASK) - -#define WUU_DE_WUDE5_MASK (0x20U) -#define WUU_DE_WUDE5_SHIFT (5U) -/*! WUDE5 - DMA/Trigger Wake-up Enable for Module 5 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE5(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE5_SHIFT)) & WUU_DE_WUDE5_MASK) - -#define WUU_DE_WUDE6_MASK (0x40U) -#define WUU_DE_WUDE6_SHIFT (6U) -/*! WUDE6 - DMA/Trigger Wake-up Enable for Module 6 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE6(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE6_SHIFT)) & WUU_DE_WUDE6_MASK) - -#define WUU_DE_WUDE7_MASK (0x80U) -#define WUU_DE_WUDE7_SHIFT (7U) -/*! WUDE7 - DMA/Trigger Wake-up Enable for Module 7 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE7(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE7_SHIFT)) & WUU_DE_WUDE7_MASK) - -#define WUU_DE_WUDE8_MASK (0x100U) -#define WUU_DE_WUDE8_SHIFT (8U) -/*! WUDE8 - DMA/Trigger Wake-up Enable for Module 8 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE8(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE8_SHIFT)) & WUU_DE_WUDE8_MASK) - -#define WUU_DE_WUDE9_MASK (0x200U) -#define WUU_DE_WUDE9_SHIFT (9U) -/*! WUDE9 - DMA/Trigger Wake-up Enable for Module 9 - * 0b0..Disable - * 0b1..Enable - */ -#define WUU_DE_WUDE9(x) (((uint32_t)(((uint32_t)(x)) << WUU_DE_WUDE9_SHIFT)) & WUU_DE_WUDE9_MASK) -/*! @} */ - -/*! @name PF - Pin Flag */ -/*! @{ */ - -#define WUU_PF_WUF0_MASK (0x1U) -#define WUU_PF_WUF0_SHIFT (0U) -/*! WUF0 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF0(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF0_SHIFT)) & WUU_PF_WUF0_MASK) - -#define WUU_PF_WUF1_MASK (0x2U) -#define WUU_PF_WUF1_SHIFT (1U) -/*! WUF1 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF1(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF1_SHIFT)) & WUU_PF_WUF1_MASK) - -#define WUU_PF_WUF2_MASK (0x4U) -#define WUU_PF_WUF2_SHIFT (2U) -/*! WUF2 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF2(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF2_SHIFT)) & WUU_PF_WUF2_MASK) - -#define WUU_PF_WUF3_MASK (0x8U) -#define WUU_PF_WUF3_SHIFT (3U) -/*! WUF3 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF3(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF3_SHIFT)) & WUU_PF_WUF3_MASK) - -#define WUU_PF_WUF4_MASK (0x10U) -#define WUU_PF_WUF4_SHIFT (4U) -/*! WUF4 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF4(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF4_SHIFT)) & WUU_PF_WUF4_MASK) - -#define WUU_PF_WUF5_MASK (0x20U) -#define WUU_PF_WUF5_SHIFT (5U) -/*! WUF5 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF5(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF5_SHIFT)) & WUU_PF_WUF5_MASK) - -#define WUU_PF_WUF6_MASK (0x40U) -#define WUU_PF_WUF6_SHIFT (6U) -/*! WUF6 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF6(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF6_SHIFT)) & WUU_PF_WUF6_MASK) - -#define WUU_PF_WUF7_MASK (0x80U) -#define WUU_PF_WUF7_SHIFT (7U) -/*! WUF7 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF7(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF7_SHIFT)) & WUU_PF_WUF7_MASK) - -#define WUU_PF_WUF8_MASK (0x100U) -#define WUU_PF_WUF8_SHIFT (8U) -/*! WUF8 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF8(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF8_SHIFT)) & WUU_PF_WUF8_MASK) - -#define WUU_PF_WUF9_MASK (0x200U) -#define WUU_PF_WUF9_SHIFT (9U) -/*! WUF9 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF9(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF9_SHIFT)) & WUU_PF_WUF9_MASK) - -#define WUU_PF_WUF10_MASK (0x400U) -#define WUU_PF_WUF10_SHIFT (10U) -/*! WUF10 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF10(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF10_SHIFT)) & WUU_PF_WUF10_MASK) - -#define WUU_PF_WUF11_MASK (0x800U) -#define WUU_PF_WUF11_SHIFT (11U) -/*! WUF11 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF11(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF11_SHIFT)) & WUU_PF_WUF11_MASK) - -#define WUU_PF_WUF12_MASK (0x1000U) -#define WUU_PF_WUF12_SHIFT (12U) -/*! WUF12 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF12(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF12_SHIFT)) & WUU_PF_WUF12_MASK) - -#define WUU_PF_WUF13_MASK (0x2000U) -#define WUU_PF_WUF13_SHIFT (13U) -/*! WUF13 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF13(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF13_SHIFT)) & WUU_PF_WUF13_MASK) - -#define WUU_PF_WUF14_MASK (0x4000U) -#define WUU_PF_WUF14_SHIFT (14U) -/*! WUF14 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF14(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF14_SHIFT)) & WUU_PF_WUF14_MASK) - -#define WUU_PF_WUF15_MASK (0x8000U) -#define WUU_PF_WUF15_SHIFT (15U) -/*! WUF15 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF15(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF15_SHIFT)) & WUU_PF_WUF15_MASK) - -#define WUU_PF_WUF16_MASK (0x10000U) -#define WUU_PF_WUF16_SHIFT (16U) -/*! WUF16 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF16(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF16_SHIFT)) & WUU_PF_WUF16_MASK) - -#define WUU_PF_WUF17_MASK (0x20000U) -#define WUU_PF_WUF17_SHIFT (17U) -/*! WUF17 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF17(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF17_SHIFT)) & WUU_PF_WUF17_MASK) - -#define WUU_PF_WUF18_MASK (0x40000U) -#define WUU_PF_WUF18_SHIFT (18U) -/*! WUF18 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF18(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF18_SHIFT)) & WUU_PF_WUF18_MASK) - -#define WUU_PF_WUF19_MASK (0x80000U) -#define WUU_PF_WUF19_SHIFT (19U) -/*! WUF19 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF19(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF19_SHIFT)) & WUU_PF_WUF19_MASK) - -#define WUU_PF_WUF20_MASK (0x100000U) -#define WUU_PF_WUF20_SHIFT (20U) -/*! WUF20 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF20(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF20_SHIFT)) & WUU_PF_WUF20_MASK) - -#define WUU_PF_WUF21_MASK (0x200000U) -#define WUU_PF_WUF21_SHIFT (21U) -/*! WUF21 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF21(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF21_SHIFT)) & WUU_PF_WUF21_MASK) - -#define WUU_PF_WUF22_MASK (0x400000U) -#define WUU_PF_WUF22_SHIFT (22U) -/*! WUF22 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF22(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF22_SHIFT)) & WUU_PF_WUF22_MASK) - -#define WUU_PF_WUF23_MASK (0x800000U) -#define WUU_PF_WUF23_SHIFT (23U) -/*! WUF23 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF23(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF23_SHIFT)) & WUU_PF_WUF23_MASK) - -#define WUU_PF_WUF24_MASK (0x1000000U) -#define WUU_PF_WUF24_SHIFT (24U) -/*! WUF24 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF24(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF24_SHIFT)) & WUU_PF_WUF24_MASK) - -#define WUU_PF_WUF25_MASK (0x2000000U) -#define WUU_PF_WUF25_SHIFT (25U) -/*! WUF25 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF25(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF25_SHIFT)) & WUU_PF_WUF25_MASK) - -#define WUU_PF_WUF26_MASK (0x4000000U) -#define WUU_PF_WUF26_SHIFT (26U) -/*! WUF26 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF26(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF26_SHIFT)) & WUU_PF_WUF26_MASK) - -#define WUU_PF_WUF27_MASK (0x8000000U) -#define WUU_PF_WUF27_SHIFT (27U) -/*! WUF27 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF27(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF27_SHIFT)) & WUU_PF_WUF27_MASK) - -#define WUU_PF_WUF28_MASK (0x10000000U) -#define WUU_PF_WUF28_SHIFT (28U) -/*! WUF28 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF28(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF28_SHIFT)) & WUU_PF_WUF28_MASK) - -#define WUU_PF_WUF29_MASK (0x20000000U) -#define WUU_PF_WUF29_SHIFT (29U) -/*! WUF29 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF29(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF29_SHIFT)) & WUU_PF_WUF29_MASK) - -#define WUU_PF_WUF30_MASK (0x40000000U) -#define WUU_PF_WUF30_SHIFT (30U) -/*! WUF30 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF30(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF30_SHIFT)) & WUU_PF_WUF30_MASK) - -#define WUU_PF_WUF31_MASK (0x80000000U) -#define WUU_PF_WUF31_SHIFT (31U) -/*! WUF31 - Wake-up Flag for WUU_Pn - * 0b0..No - * 0b1..Yes - */ -#define WUU_PF_WUF31(x) (((uint32_t)(((uint32_t)(x)) << WUU_PF_WUF31_SHIFT)) & WUU_PF_WUF31_MASK) -/*! @} */ - -/*! @name FILT - Pin Filter */ -/*! @{ */ - -#define WUU_FILT_FILTSEL1_MASK (0x1FU) -#define WUU_FILT_FILTSEL1_SHIFT (0U) -/*! FILTSEL1 - Filter 1 Pin Select */ -#define WUU_FILT_FILTSEL1(x) (((uint32_t)(((uint32_t)(x)) << WUU_FILT_FILTSEL1_SHIFT)) & WUU_FILT_FILTSEL1_MASK) - -#define WUU_FILT_FILTE1_MASK (0x60U) -#define WUU_FILT_FILTE1_SHIFT (5U) -/*! FILTE1 - Filter 1 Enable - * 0b00..Disable - * 0b01..Enable (Detect on rising edge or high level) - * 0b10..Enable (Detect on falling edge or low level) - * 0b11..Enable (Detect on any edge) - */ -#define WUU_FILT_FILTE1(x) (((uint32_t)(((uint32_t)(x)) << WUU_FILT_FILTE1_SHIFT)) & WUU_FILT_FILTE1_MASK) - -#define WUU_FILT_FILTF1_MASK (0x80U) -#define WUU_FILT_FILTF1_SHIFT (7U) -/*! FILTF1 - Filter 1 Flag - * 0b0..No - * 0b1..Yes - */ -#define WUU_FILT_FILTF1(x) (((uint32_t)(((uint32_t)(x)) << WUU_FILT_FILTF1_SHIFT)) & WUU_FILT_FILTF1_MASK) - -#define WUU_FILT_FILTSEL2_MASK (0x1F00U) -#define WUU_FILT_FILTSEL2_SHIFT (8U) -/*! FILTSEL2 - Filter 2 Pin Select */ -#define WUU_FILT_FILTSEL2(x) (((uint32_t)(((uint32_t)(x)) << WUU_FILT_FILTSEL2_SHIFT)) & WUU_FILT_FILTSEL2_MASK) - -#define WUU_FILT_FILTE2_MASK (0x6000U) -#define WUU_FILT_FILTE2_SHIFT (13U) -/*! FILTE2 - Filter 2 Enable - * 0b00..Disable - * 0b01..Enable (Detect on rising edge or high level) - * 0b10..Enable (Detect on falling edge or low level) - * 0b11..Enable (Detect on any edge) - */ -#define WUU_FILT_FILTE2(x) (((uint32_t)(((uint32_t)(x)) << WUU_FILT_FILTE2_SHIFT)) & WUU_FILT_FILTE2_MASK) - -#define WUU_FILT_FILTF2_MASK (0x8000U) -#define WUU_FILT_FILTF2_SHIFT (15U) -/*! FILTF2 - Filter 2 Flag - * 0b0..No - * 0b1..Yes - */ -#define WUU_FILT_FILTF2(x) (((uint32_t)(((uint32_t)(x)) << WUU_FILT_FILTF2_SHIFT)) & WUU_FILT_FILTF2_MASK) -/*! @} */ - -/*! @name PDC1 - Pin DMA/Trigger Configuration 1 */ -/*! @{ */ - -#define WUU_PDC1_WUPDC0_MASK (0x3U) -#define WUU_PDC1_WUPDC0_SHIFT (0U) -/*! WUPDC0 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC0(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC0_SHIFT)) & WUU_PDC1_WUPDC0_MASK) - -#define WUU_PDC1_WUPDC1_MASK (0xCU) -#define WUU_PDC1_WUPDC1_SHIFT (2U) -/*! WUPDC1 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC1(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC1_SHIFT)) & WUU_PDC1_WUPDC1_MASK) - -#define WUU_PDC1_WUPDC2_MASK (0x30U) -#define WUU_PDC1_WUPDC2_SHIFT (4U) -/*! WUPDC2 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC2(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC2_SHIFT)) & WUU_PDC1_WUPDC2_MASK) - -#define WUU_PDC1_WUPDC3_MASK (0xC0U) -#define WUU_PDC1_WUPDC3_SHIFT (6U) -/*! WUPDC3 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC3(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC3_SHIFT)) & WUU_PDC1_WUPDC3_MASK) - -#define WUU_PDC1_WUPDC4_MASK (0x300U) -#define WUU_PDC1_WUPDC4_SHIFT (8U) -/*! WUPDC4 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC4(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC4_SHIFT)) & WUU_PDC1_WUPDC4_MASK) - -#define WUU_PDC1_WUPDC5_MASK (0xC00U) -#define WUU_PDC1_WUPDC5_SHIFT (10U) -/*! WUPDC5 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC5(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC5_SHIFT)) & WUU_PDC1_WUPDC5_MASK) - -#define WUU_PDC1_WUPDC6_MASK (0x3000U) -#define WUU_PDC1_WUPDC6_SHIFT (12U) -/*! WUPDC6 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC6(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC6_SHIFT)) & WUU_PDC1_WUPDC6_MASK) - -#define WUU_PDC1_WUPDC7_MASK (0xC000U) -#define WUU_PDC1_WUPDC7_SHIFT (14U) -/*! WUPDC7 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC7(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC7_SHIFT)) & WUU_PDC1_WUPDC7_MASK) - -#define WUU_PDC1_WUPDC8_MASK (0x30000U) -#define WUU_PDC1_WUPDC8_SHIFT (16U) -/*! WUPDC8 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC8(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC8_SHIFT)) & WUU_PDC1_WUPDC8_MASK) - -#define WUU_PDC1_WUPDC9_MASK (0xC0000U) -#define WUU_PDC1_WUPDC9_SHIFT (18U) -/*! WUPDC9 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC9(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC9_SHIFT)) & WUU_PDC1_WUPDC9_MASK) - -#define WUU_PDC1_WUPDC10_MASK (0x300000U) -#define WUU_PDC1_WUPDC10_SHIFT (20U) -/*! WUPDC10 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC10(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC10_SHIFT)) & WUU_PDC1_WUPDC10_MASK) - -#define WUU_PDC1_WUPDC11_MASK (0xC00000U) -#define WUU_PDC1_WUPDC11_SHIFT (22U) -/*! WUPDC11 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC11(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC11_SHIFT)) & WUU_PDC1_WUPDC11_MASK) - -#define WUU_PDC1_WUPDC12_MASK (0x3000000U) -#define WUU_PDC1_WUPDC12_SHIFT (24U) -/*! WUPDC12 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC12(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC12_SHIFT)) & WUU_PDC1_WUPDC12_MASK) - -#define WUU_PDC1_WUPDC13_MASK (0xC000000U) -#define WUU_PDC1_WUPDC13_SHIFT (26U) -/*! WUPDC13 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC13(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC13_SHIFT)) & WUU_PDC1_WUPDC13_MASK) - -#define WUU_PDC1_WUPDC14_MASK (0x30000000U) -#define WUU_PDC1_WUPDC14_SHIFT (28U) -/*! WUPDC14 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC14(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC14_SHIFT)) & WUU_PDC1_WUPDC14_MASK) - -#define WUU_PDC1_WUPDC15_MASK (0xC0000000U) -#define WUU_PDC1_WUPDC15_SHIFT (30U) -/*! WUPDC15 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC1_WUPDC15(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC1_WUPDC15_SHIFT)) & WUU_PDC1_WUPDC15_MASK) -/*! @} */ - -/*! @name PDC2 - Pin DMA/Trigger Configuration 2 */ -/*! @{ */ - -#define WUU_PDC2_WUPDC16_MASK (0x3U) -#define WUU_PDC2_WUPDC16_SHIFT (0U) -/*! WUPDC16 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC16(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC16_SHIFT)) & WUU_PDC2_WUPDC16_MASK) - -#define WUU_PDC2_WUPDC17_MASK (0xCU) -#define WUU_PDC2_WUPDC17_SHIFT (2U) -/*! WUPDC17 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC17(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC17_SHIFT)) & WUU_PDC2_WUPDC17_MASK) - -#define WUU_PDC2_WUPDC18_MASK (0x30U) -#define WUU_PDC2_WUPDC18_SHIFT (4U) -/*! WUPDC18 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC18(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC18_SHIFT)) & WUU_PDC2_WUPDC18_MASK) - -#define WUU_PDC2_WUPDC19_MASK (0xC0U) -#define WUU_PDC2_WUPDC19_SHIFT (6U) -/*! WUPDC19 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC19(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC19_SHIFT)) & WUU_PDC2_WUPDC19_MASK) - -#define WUU_PDC2_WUPDC20_MASK (0x300U) -#define WUU_PDC2_WUPDC20_SHIFT (8U) -/*! WUPDC20 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC20(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC20_SHIFT)) & WUU_PDC2_WUPDC20_MASK) - -#define WUU_PDC2_WUPDC21_MASK (0xC00U) -#define WUU_PDC2_WUPDC21_SHIFT (10U) -/*! WUPDC21 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC21(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC21_SHIFT)) & WUU_PDC2_WUPDC21_MASK) - -#define WUU_PDC2_WUPDC22_MASK (0x3000U) -#define WUU_PDC2_WUPDC22_SHIFT (12U) -/*! WUPDC22 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC22(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC22_SHIFT)) & WUU_PDC2_WUPDC22_MASK) - -#define WUU_PDC2_WUPDC23_MASK (0xC000U) -#define WUU_PDC2_WUPDC23_SHIFT (14U) -/*! WUPDC23 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC23(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC23_SHIFT)) & WUU_PDC2_WUPDC23_MASK) - -#define WUU_PDC2_WUPDC24_MASK (0x30000U) -#define WUU_PDC2_WUPDC24_SHIFT (16U) -/*! WUPDC24 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC24(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC24_SHIFT)) & WUU_PDC2_WUPDC24_MASK) - -#define WUU_PDC2_WUPDC25_MASK (0xC0000U) -#define WUU_PDC2_WUPDC25_SHIFT (18U) -/*! WUPDC25 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC25(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC25_SHIFT)) & WUU_PDC2_WUPDC25_MASK) - -#define WUU_PDC2_WUPDC26_MASK (0x300000U) -#define WUU_PDC2_WUPDC26_SHIFT (20U) -/*! WUPDC26 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC26(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC26_SHIFT)) & WUU_PDC2_WUPDC26_MASK) - -#define WUU_PDC2_WUPDC27_MASK (0xC00000U) -#define WUU_PDC2_WUPDC27_SHIFT (22U) -/*! WUPDC27 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC27(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC27_SHIFT)) & WUU_PDC2_WUPDC27_MASK) - -#define WUU_PDC2_WUPDC28_MASK (0x3000000U) -#define WUU_PDC2_WUPDC28_SHIFT (24U) -/*! WUPDC28 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC28(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC28_SHIFT)) & WUU_PDC2_WUPDC28_MASK) - -#define WUU_PDC2_WUPDC29_MASK (0xC000000U) -#define WUU_PDC2_WUPDC29_SHIFT (26U) -/*! WUPDC29 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC29(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC29_SHIFT)) & WUU_PDC2_WUPDC29_MASK) - -#define WUU_PDC2_WUPDC30_MASK (0x30000000U) -#define WUU_PDC2_WUPDC30_SHIFT (28U) -/*! WUPDC30 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC30(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC30_SHIFT)) & WUU_PDC2_WUPDC30_MASK) - -#define WUU_PDC2_WUPDC31_MASK (0xC0000000U) -#define WUU_PDC2_WUPDC31_SHIFT (30U) -/*! WUPDC31 - Wake-up Pin Configuration for WUU_Pn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_PDC2_WUPDC31(x) (((uint32_t)(((uint32_t)(x)) << WUU_PDC2_WUPDC31_SHIFT)) & WUU_PDC2_WUPDC31_MASK) -/*! @} */ - -/*! @name FDC - Pin Filter DMA/Trigger Configuration */ -/*! @{ */ - -#define WUU_FDC_FILTC1_MASK (0x3U) -#define WUU_FDC_FILTC1_SHIFT (0U) -/*! FILTC1 - Filter Configuration for FILTn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_FDC_FILTC1(x) (((uint32_t)(((uint32_t)(x)) << WUU_FDC_FILTC1_SHIFT)) & WUU_FDC_FILTC1_MASK) - -#define WUU_FDC_FILTC2_MASK (0xCU) -#define WUU_FDC_FILTC2_SHIFT (2U) -/*! FILTC2 - Filter Configuration for FILTn - * 0b00..Interrupt - * 0b01..DMA request - * 0b10..Trigger event - * 0b11..Reserved - */ -#define WUU_FDC_FILTC2(x) (((uint32_t)(((uint32_t)(x)) << WUU_FDC_FILTC2_SHIFT)) & WUU_FDC_FILTC2_MASK) -/*! @} */ - -/*! @name PMC - Pin Mode Configuration */ -/*! @{ */ - -#define WUU_PMC_WUPMC0_MASK (0x1U) -#define WUU_PMC_WUPMC0_SHIFT (0U) -/*! WUPMC0 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC0(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC0_SHIFT)) & WUU_PMC_WUPMC0_MASK) - -#define WUU_PMC_WUPMC1_MASK (0x2U) -#define WUU_PMC_WUPMC1_SHIFT (1U) -/*! WUPMC1 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC1(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC1_SHIFT)) & WUU_PMC_WUPMC1_MASK) - -#define WUU_PMC_WUPMC2_MASK (0x4U) -#define WUU_PMC_WUPMC2_SHIFT (2U) -/*! WUPMC2 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC2(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC2_SHIFT)) & WUU_PMC_WUPMC2_MASK) - -#define WUU_PMC_WUPMC3_MASK (0x8U) -#define WUU_PMC_WUPMC3_SHIFT (3U) -/*! WUPMC3 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC3(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC3_SHIFT)) & WUU_PMC_WUPMC3_MASK) - -#define WUU_PMC_WUPMC4_MASK (0x10U) -#define WUU_PMC_WUPMC4_SHIFT (4U) -/*! WUPMC4 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC4(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC4_SHIFT)) & WUU_PMC_WUPMC4_MASK) - -#define WUU_PMC_WUPMC5_MASK (0x20U) -#define WUU_PMC_WUPMC5_SHIFT (5U) -/*! WUPMC5 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC5(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC5_SHIFT)) & WUU_PMC_WUPMC5_MASK) - -#define WUU_PMC_WUPMC6_MASK (0x40U) -#define WUU_PMC_WUPMC6_SHIFT (6U) -/*! WUPMC6 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC6(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC6_SHIFT)) & WUU_PMC_WUPMC6_MASK) - -#define WUU_PMC_WUPMC7_MASK (0x80U) -#define WUU_PMC_WUPMC7_SHIFT (7U) -/*! WUPMC7 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC7(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC7_SHIFT)) & WUU_PMC_WUPMC7_MASK) - -#define WUU_PMC_WUPMC8_MASK (0x100U) -#define WUU_PMC_WUPMC8_SHIFT (8U) -/*! WUPMC8 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC8(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC8_SHIFT)) & WUU_PMC_WUPMC8_MASK) - -#define WUU_PMC_WUPMC9_MASK (0x200U) -#define WUU_PMC_WUPMC9_SHIFT (9U) -/*! WUPMC9 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC9(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC9_SHIFT)) & WUU_PMC_WUPMC9_MASK) - -#define WUU_PMC_WUPMC10_MASK (0x400U) -#define WUU_PMC_WUPMC10_SHIFT (10U) -/*! WUPMC10 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC10(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC10_SHIFT)) & WUU_PMC_WUPMC10_MASK) - -#define WUU_PMC_WUPMC11_MASK (0x800U) -#define WUU_PMC_WUPMC11_SHIFT (11U) -/*! WUPMC11 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC11(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC11_SHIFT)) & WUU_PMC_WUPMC11_MASK) - -#define WUU_PMC_WUPMC12_MASK (0x1000U) -#define WUU_PMC_WUPMC12_SHIFT (12U) -/*! WUPMC12 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC12(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC12_SHIFT)) & WUU_PMC_WUPMC12_MASK) - -#define WUU_PMC_WUPMC13_MASK (0x2000U) -#define WUU_PMC_WUPMC13_SHIFT (13U) -/*! WUPMC13 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC13(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC13_SHIFT)) & WUU_PMC_WUPMC13_MASK) - -#define WUU_PMC_WUPMC14_MASK (0x4000U) -#define WUU_PMC_WUPMC14_SHIFT (14U) -/*! WUPMC14 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC14(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC14_SHIFT)) & WUU_PMC_WUPMC14_MASK) - -#define WUU_PMC_WUPMC15_MASK (0x8000U) -#define WUU_PMC_WUPMC15_SHIFT (15U) -/*! WUPMC15 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC15(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC15_SHIFT)) & WUU_PMC_WUPMC15_MASK) - -#define WUU_PMC_WUPMC16_MASK (0x10000U) -#define WUU_PMC_WUPMC16_SHIFT (16U) -/*! WUPMC16 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC16(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC16_SHIFT)) & WUU_PMC_WUPMC16_MASK) - -#define WUU_PMC_WUPMC17_MASK (0x20000U) -#define WUU_PMC_WUPMC17_SHIFT (17U) -/*! WUPMC17 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC17(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC17_SHIFT)) & WUU_PMC_WUPMC17_MASK) - -#define WUU_PMC_WUPMC18_MASK (0x40000U) -#define WUU_PMC_WUPMC18_SHIFT (18U) -/*! WUPMC18 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC18(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC18_SHIFT)) & WUU_PMC_WUPMC18_MASK) - -#define WUU_PMC_WUPMC19_MASK (0x80000U) -#define WUU_PMC_WUPMC19_SHIFT (19U) -/*! WUPMC19 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC19(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC19_SHIFT)) & WUU_PMC_WUPMC19_MASK) - -#define WUU_PMC_WUPMC20_MASK (0x100000U) -#define WUU_PMC_WUPMC20_SHIFT (20U) -/*! WUPMC20 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC20(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC20_SHIFT)) & WUU_PMC_WUPMC20_MASK) - -#define WUU_PMC_WUPMC21_MASK (0x200000U) -#define WUU_PMC_WUPMC21_SHIFT (21U) -/*! WUPMC21 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC21(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC21_SHIFT)) & WUU_PMC_WUPMC21_MASK) - -#define WUU_PMC_WUPMC22_MASK (0x400000U) -#define WUU_PMC_WUPMC22_SHIFT (22U) -/*! WUPMC22 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC22(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC22_SHIFT)) & WUU_PMC_WUPMC22_MASK) - -#define WUU_PMC_WUPMC23_MASK (0x800000U) -#define WUU_PMC_WUPMC23_SHIFT (23U) -/*! WUPMC23 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC23(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC23_SHIFT)) & WUU_PMC_WUPMC23_MASK) - -#define WUU_PMC_WUPMC24_MASK (0x1000000U) -#define WUU_PMC_WUPMC24_SHIFT (24U) -/*! WUPMC24 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC24(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC24_SHIFT)) & WUU_PMC_WUPMC24_MASK) - -#define WUU_PMC_WUPMC25_MASK (0x2000000U) -#define WUU_PMC_WUPMC25_SHIFT (25U) -/*! WUPMC25 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC25(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC25_SHIFT)) & WUU_PMC_WUPMC25_MASK) - -#define WUU_PMC_WUPMC26_MASK (0x4000000U) -#define WUU_PMC_WUPMC26_SHIFT (26U) -/*! WUPMC26 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC26(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC26_SHIFT)) & WUU_PMC_WUPMC26_MASK) - -#define WUU_PMC_WUPMC27_MASK (0x8000000U) -#define WUU_PMC_WUPMC27_SHIFT (27U) -/*! WUPMC27 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC27(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC27_SHIFT)) & WUU_PMC_WUPMC27_MASK) - -#define WUU_PMC_WUPMC28_MASK (0x10000000U) -#define WUU_PMC_WUPMC28_SHIFT (28U) -/*! WUPMC28 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC28(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC28_SHIFT)) & WUU_PMC_WUPMC28_MASK) - -#define WUU_PMC_WUPMC29_MASK (0x20000000U) -#define WUU_PMC_WUPMC29_SHIFT (29U) -/*! WUPMC29 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC29(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC29_SHIFT)) & WUU_PMC_WUPMC29_MASK) - -#define WUU_PMC_WUPMC30_MASK (0x40000000U) -#define WUU_PMC_WUPMC30_SHIFT (30U) -/*! WUPMC30 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC30(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC30_SHIFT)) & WUU_PMC_WUPMC30_MASK) - -#define WUU_PMC_WUPMC31_MASK (0x80000000U) -#define WUU_PMC_WUPMC31_SHIFT (31U) -/*! WUPMC31 - Wake-up Pin Mode Configuration for WUU_Pn - * 0b0..Active only during a low-leakage mode. You can modify the corresponding fields within Pin Enable (PEn) or - * Pin DMA/Trigger Configuration (PDCn). - * 0b1..Active during all power modes. Do not modify the corresponding fields within Pin Enable (PEn) or Pin DMA/Trigger Configuration (PDCn). - */ -#define WUU_PMC_WUPMC31(x) (((uint32_t)(((uint32_t)(x)) << WUU_PMC_WUPMC31_SHIFT)) & WUU_PMC_WUPMC31_MASK) -/*! @} */ - -/*! @name FMC - Pin Filter Mode Configuration */ -/*! @{ */ - -#define WUU_FMC_FILTM1_MASK (0x1U) -#define WUU_FMC_FILTM1_SHIFT (0U) -/*! FILTM1 - Filter Mode for FILTn - * 0b0..Active only during Power Down/Deep Power Down mode - * 0b1..Active during all power modes - */ -#define WUU_FMC_FILTM1(x) (((uint32_t)(((uint32_t)(x)) << WUU_FMC_FILTM1_SHIFT)) & WUU_FMC_FILTM1_MASK) - -#define WUU_FMC_FILTM2_MASK (0x2U) -#define WUU_FMC_FILTM2_SHIFT (1U) -/*! FILTM2 - Filter Mode for FILTn - * 0b0..Active only during Power Down/Deep Power Down mode - * 0b1..Active during all power modes - */ -#define WUU_FMC_FILTM2(x) (((uint32_t)(((uint32_t)(x)) << WUU_FMC_FILTM2_SHIFT)) & WUU_FMC_FILTM2_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group WUU_Register_Masks */ - - -/* WUU - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral WUU0 base address */ - #define WUU0_BASE (0x50046000u) - /** Peripheral WUU0 base address */ - #define WUU0_BASE_NS (0x40046000u) - /** Peripheral WUU0 base pointer */ - #define WUU0 ((WUU_Type *)WUU0_BASE) - /** Peripheral WUU0 base pointer */ - #define WUU0_NS ((WUU_Type *)WUU0_BASE_NS) - /** Array initializer of WUU peripheral base addresses */ - #define WUU_BASE_ADDRS { WUU0_BASE } - /** Array initializer of WUU peripheral base pointers */ - #define WUU_BASE_PTRS { WUU0 } - /** Array initializer of WUU peripheral base addresses */ - #define WUU_BASE_ADDRS_NS { WUU0_BASE_NS } - /** Array initializer of WUU peripheral base pointers */ - #define WUU_BASE_PTRS_NS { WUU0_NS } -#else - /** Peripheral WUU0 base address */ - #define WUU0_BASE (0x40046000u) - /** Peripheral WUU0 base pointer */ - #define WUU0 ((WUU_Type *)WUU0_BASE) - /** Array initializer of WUU peripheral base addresses */ - #define WUU_BASE_ADDRS { WUU0_BASE } - /** Array initializer of WUU peripheral base pointers */ - #define WUU_BASE_PTRS { WUU0 } -#endif - -/*! - * @} - */ /* end of group WUU_Peripheral_Access_Layer */ - - -/* ---------------------------------------------------------------------------- - -- WWDT Peripheral Access Layer - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup WWDT_Peripheral_Access_Layer WWDT Peripheral Access Layer - * @{ - */ - -/** WWDT - Register Layout Typedef */ -typedef struct { - __IO uint32_t MOD; /**< Mode, offset: 0x0 */ - __IO uint32_t TC; /**< Timer Constant, offset: 0x4 */ - __O uint32_t FEED; /**< Feed Sequence, offset: 0x8 */ - __I uint32_t TV; /**< Timer Value, offset: 0xC */ - uint8_t RESERVED_0[4]; - __IO uint32_t WARNINT; /**< Warning Interrupt Compare Value, offset: 0x14 */ - __IO uint32_t WINDOW; /**< Window Compare Value, offset: 0x18 */ -} WWDT_Type; - -/* ---------------------------------------------------------------------------- - -- WWDT Register Masks - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup WWDT_Register_Masks WWDT Register Masks - * @{ - */ - -/*! @name MOD - Mode */ -/*! @{ */ - -#define WWDT_MOD_WDEN_MASK (0x1U) -#define WWDT_MOD_WDEN_SHIFT (0U) -/*! WDEN - Watchdog Enable - * 0b0..Timer stopped - * 0b1..Timer running - */ -#define WWDT_MOD_WDEN(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_WDEN_SHIFT)) & WWDT_MOD_WDEN_MASK) - -#define WWDT_MOD_WDRESET_MASK (0x2U) -#define WWDT_MOD_WDRESET_SHIFT (1U) -/*! WDRESET - Watchdog Reset Enable - * 0b0..Interrupt - * 0b1..Reset - */ -#define WWDT_MOD_WDRESET(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_WDRESET_SHIFT)) & WWDT_MOD_WDRESET_MASK) - -#define WWDT_MOD_WDTOF_MASK (0x4U) -#define WWDT_MOD_WDTOF_SHIFT (2U) -/*! WDTOF - Watchdog Timeout Flag - * 0b0..Watchdog event has not occurred. - * 0b1..Watchdog event has occurred (causes a chip reset if WDRESET = 1). - */ -#define WWDT_MOD_WDTOF(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_WDTOF_SHIFT)) & WWDT_MOD_WDTOF_MASK) - -#define WWDT_MOD_WDINT_MASK (0x8U) -#define WWDT_MOD_WDINT_SHIFT (3U) -/*! WDINT - Warning Interrupt Flag - * 0b0..No flag - * 0b1..Flag - */ -#define WWDT_MOD_WDINT(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_WDINT_SHIFT)) & WWDT_MOD_WDINT_MASK) - -#define WWDT_MOD_WDPROTECT_MASK (0x10U) -#define WWDT_MOD_WDPROTECT_SHIFT (4U) -/*! WDPROTECT - Watchdog Update Mode - * 0b0..Flexible - * 0b1..Threshold - */ -#define WWDT_MOD_WDPROTECT(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_WDPROTECT_SHIFT)) & WWDT_MOD_WDPROTECT_MASK) - -#define WWDT_MOD_LOCK_MASK (0x20U) -#define WWDT_MOD_LOCK_SHIFT (5U) -/*! LOCK - Lock - * 0b0..No Lock - * 0b1..Lock - */ -#define WWDT_MOD_LOCK(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_LOCK_SHIFT)) & WWDT_MOD_LOCK_MASK) - -#define WWDT_MOD_DEBUG_EN_MASK (0x40U) -#define WWDT_MOD_DEBUG_EN_SHIFT (6U) -/*! DEBUG_EN - Debug Enable - * 0b0..Disabled - * 0b1..Enabled - */ -#define WWDT_MOD_DEBUG_EN(x) (((uint32_t)(((uint32_t)(x)) << WWDT_MOD_DEBUG_EN_SHIFT)) & WWDT_MOD_DEBUG_EN_MASK) -/*! @} */ - -/*! @name TC - Timer Constant */ -/*! @{ */ - -#define WWDT_TC_COUNT_MASK (0xFFFFFFU) -#define WWDT_TC_COUNT_SHIFT (0U) -/*! COUNT - Watchdog Timeout Value */ -#define WWDT_TC_COUNT(x) (((uint32_t)(((uint32_t)(x)) << WWDT_TC_COUNT_SHIFT)) & WWDT_TC_COUNT_MASK) -/*! @} */ - -/*! @name FEED - Feed Sequence */ -/*! @{ */ - -#define WWDT_FEED_FEED_MASK (0xFFU) -#define WWDT_FEED_FEED_SHIFT (0U) -/*! FEED - Feed Value */ -#define WWDT_FEED_FEED(x) (((uint32_t)(((uint32_t)(x)) << WWDT_FEED_FEED_SHIFT)) & WWDT_FEED_FEED_MASK) -/*! @} */ - -/*! @name TV - Timer Value */ -/*! @{ */ - -#define WWDT_TV_COUNT_MASK (0xFFFFFFU) -#define WWDT_TV_COUNT_SHIFT (0U) -/*! COUNT - Counter Timer Value */ -#define WWDT_TV_COUNT(x) (((uint32_t)(((uint32_t)(x)) << WWDT_TV_COUNT_SHIFT)) & WWDT_TV_COUNT_MASK) -/*! @} */ - -/*! @name WARNINT - Warning Interrupt Compare Value */ -/*! @{ */ - -#define WWDT_WARNINT_WARNINT_MASK (0x3FFU) -#define WWDT_WARNINT_WARNINT_SHIFT (0U) -/*! WARNINT - Watchdog Warning Interrupt Compare Value */ -#define WWDT_WARNINT_WARNINT(x) (((uint32_t)(((uint32_t)(x)) << WWDT_WARNINT_WARNINT_SHIFT)) & WWDT_WARNINT_WARNINT_MASK) -/*! @} */ - -/*! @name WINDOW - Window Compare Value */ -/*! @{ */ - -#define WWDT_WINDOW_WINDOW_MASK (0xFFFFFFU) -#define WWDT_WINDOW_WINDOW_SHIFT (0U) -/*! WINDOW - Watchdog Window Value */ -#define WWDT_WINDOW_WINDOW(x) (((uint32_t)(((uint32_t)(x)) << WWDT_WINDOW_WINDOW_SHIFT)) & WWDT_WINDOW_WINDOW_MASK) -/*! @} */ - - -/*! - * @} - */ /* end of group WWDT_Register_Masks */ - - -/* WWDT - Peripheral instance base addresses */ -#if ((defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE & 0x2)) || defined(CPU1_IS_SECURE_MASTER)) - /** Peripheral WWDT0 base address */ - #define WWDT0_BASE (0x50016000u) - /** Peripheral WWDT0 base address */ - #define WWDT0_BASE_NS (0x40016000u) - /** Peripheral WWDT0 base pointer */ - #define WWDT0 ((WWDT_Type *)WWDT0_BASE) - /** Peripheral WWDT0 base pointer */ - #define WWDT0_NS ((WWDT_Type *)WWDT0_BASE_NS) - /** Peripheral WWDT1 base address */ - #define WWDT1_BASE (0x50017000u) - /** Peripheral WWDT1 base address */ - #define WWDT1_BASE_NS (0x40017000u) - /** Peripheral WWDT1 base pointer */ - #define WWDT1 ((WWDT_Type *)WWDT1_BASE) - /** Peripheral WWDT1 base pointer */ - #define WWDT1_NS ((WWDT_Type *)WWDT1_BASE_NS) - /** Array initializer of WWDT peripheral base addresses */ - #define WWDT_BASE_ADDRS { WWDT0_BASE, WWDT1_BASE } - /** Array initializer of WWDT peripheral base pointers */ - #define WWDT_BASE_PTRS { WWDT0, WWDT1 } - /** Array initializer of WWDT peripheral base addresses */ - #define WWDT_BASE_ADDRS_NS { WWDT0_BASE_NS, WWDT1_BASE_NS } - /** Array initializer of WWDT peripheral base pointers */ - #define WWDT_BASE_PTRS_NS { WWDT0_NS, WWDT1_NS } -#else - /** Peripheral WWDT0 base address */ - #define WWDT0_BASE (0x40016000u) - /** Peripheral WWDT0 base pointer */ - #define WWDT0 ((WWDT_Type *)WWDT0_BASE) - /** Peripheral WWDT1 base address */ - #define WWDT1_BASE (0x40017000u) - /** Peripheral WWDT1 base pointer */ - #define WWDT1 ((WWDT_Type *)WWDT1_BASE) - /** Array initializer of WWDT peripheral base addresses */ - #define WWDT_BASE_ADDRS { WWDT0_BASE, WWDT1_BASE } - /** Array initializer of WWDT peripheral base pointers */ - #define WWDT_BASE_PTRS { WWDT0, WWDT1 } -#endif -/** Interrupt vectors for the WWDT peripheral type */ -#define WWDT_IRQS { WWDT0_IRQn, WWDT1_IRQn } - -/*! - * @} - */ /* end of group WWDT_Peripheral_Access_Layer */ - - -/* -** End of section using anonymous unions -*/ - -#if defined(__ARMCC_VERSION) - #if (__ARMCC_VERSION >= 6010050) - #pragma clang diagnostic pop - #else - #pragma pop - #endif -#elif defined(__GNUC__) - /* leave anonymous unions enabled */ -#elif defined(__IAR_SYSTEMS_ICC__) - #pragma language=default -#else - #error Not supported compiler type -#endif - -/*! - * @} - */ /* end of group Peripheral_access_layer */ - - -/* ---------------------------------------------------------------------------- - -- Macros for use with bit field definitions (xxx_SHIFT, xxx_MASK). - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup Bit_Field_Generic_Macros Macros for use with bit field definitions (xxx_SHIFT, xxx_MASK). - * @{ - */ - -#if defined(__ARMCC_VERSION) - #if (__ARMCC_VERSION >= 6010050) - #pragma clang system_header - #endif -#elif defined(__IAR_SYSTEMS_ICC__) - #pragma system_include -#endif - -/** - * @brief Mask and left-shift a bit field value for use in a register bit range. - * @param field Name of the register bit field. - * @param value Value of the bit field. - * @return Masked and shifted value. - */ -#define NXP_VAL2FLD(field, value) (((value) << (field ## _SHIFT)) & (field ## _MASK)) -/** - * @brief Mask and right-shift a register value to extract a bit field value. - * @param field Name of the register bit field. - * @param value Value of the register. - * @return Masked and shifted bit field value. - */ -#define NXP_FLD2VAL(field, value) (((value) & (field ## _MASK)) >> (field ## _SHIFT)) - -/*! - * @} - */ /* end of group Bit_Field_Generic_Macros */ - - -/* ---------------------------------------------------------------------------- - -- SDK Compatibility - ---------------------------------------------------------------------------- */ - -/*! - * @addtogroup SDK_Compatibility_Symbols SDK Compatibility - * @{ - */ - -/*! - * @brief Get the chip value. - * - * @return chip version, 0x0: A0 version chip, 0x1: A1 version chip, 0xFF: invalid version. - */ -static inline uint32_t Chip_GetVersion(void) -{ - uint32_t deviceRevision; - - deviceRevision = SYSCON->DIEID & SYSCON_DIEID_MINOR_REVISION_MASK; - - if(0UL == deviceRevision) /* A0 device revision is 0 */ - { - return 0x0; - } - else if(1UL == deviceRevision) /* A1 device revision is 1 */ - { - return 0x1; - } - else - { - return 0xFF; - } -} - - -/*! - * @} - */ /* end of group SDK_Compatibility_Symbols */ - - -#endif /* MCXN947_CM33_CORE1_H_ */ - diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/MCXN947_cm33_core1_features.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/MCXN947_cm33_core1_features.h deleted file mode 100644 index eac6672de6a..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/MCXN947_cm33_core1_features.h +++ /dev/null @@ -1,1087 +0,0 @@ -/* -** ################################################################### -** Version: rev. 1.0, 2021-08-03 -** Build: b240410 -** -** Abstract: -** Chip specific module features. -** -** Copyright 2016 Freescale Semiconductor, Inc. -** Copyright 2016-2024 NXP -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** Revisions: -** - rev. 1.0 (2021-08-03) -** Initial version based on SPEC1.6 -** -** ################################################################### -*/ - -#ifndef _MCXN947_cm33_core1_FEATURES_H_ -#define _MCXN947_cm33_core1_FEATURES_H_ - -/* SOC module features */ - -/* @brief CACHE64_CTRL availability on the SoC. */ -#define FSL_FEATURE_SOC_CACHE64_CTRL_COUNT (1) -/* @brief CACHE64_POLSEL availability on the SoC. */ -#define FSL_FEATURE_SOC_CACHE64_POLSEL_COUNT (1) -/* @brief CDOG availability on the SoC. */ -#define FSL_FEATURE_SOC_CDOG_COUNT (2) -/* @brief CMC availability on the SoC. */ -#define FSL_FEATURE_SOC_CMC_COUNT (1) -/* @brief CRC availability on the SoC. */ -#define FSL_FEATURE_SOC_CRC_COUNT (1) -/* @brief CTIMER availability on the SoC. */ -#define FSL_FEATURE_SOC_CTIMER_COUNT (5) -/* @brief EDMA availability on the SoC. */ -#define FSL_FEATURE_SOC_EDMA_COUNT (2) -/* @brief EIM availability on the SoC. */ -#define FSL_FEATURE_SOC_EIM_COUNT (1) -/* @brief EMVSIM availability on the SoC. */ -#define FSL_FEATURE_SOC_EMVSIM_COUNT (2) -/* @brief EVTG availability on the SoC. */ -#define FSL_FEATURE_SOC_EVTG_COUNT (1) -/* @brief EWM availability on the SoC. */ -#define FSL_FEATURE_SOC_EWM_COUNT (1) -/* @brief FLEXCAN availability on the SoC. */ -#define FSL_FEATURE_SOC_FLEXCAN_COUNT (2) -/* @brief FLEXIO availability on the SoC. */ -#define FSL_FEATURE_SOC_FLEXIO_COUNT (1) -/* @brief FLEXSPI availability on the SoC. */ -#define FSL_FEATURE_SOC_FLEXSPI_COUNT (1) -/* @brief FMC availability on the SoC. */ -#define FSL_FEATURE_SOC_FMC_COUNT (1) -/* @brief FREQME availability on the SoC. */ -#define FSL_FEATURE_SOC_FREQME_COUNT (1) -/* @brief GPIO availability on the SoC. */ -#define FSL_FEATURE_SOC_GPIO_COUNT (12) -/* @brief SPC availability on the SoC. */ -#define FSL_FEATURE_SOC_SPC_COUNT (1) -/* @brief HPDAC availability on the SoC. */ -#define FSL_FEATURE_SOC_HPDAC_COUNT (1) -/* @brief I3C availability on the SoC. */ -#define FSL_FEATURE_SOC_I3C_COUNT (2) -/* @brief I2S availability on the SoC. */ -#define FSL_FEATURE_SOC_I2S_COUNT (2) -/* @brief INPUTMUX availability on the SoC. */ -#define FSL_FEATURE_SOC_INPUTMUX_COUNT (1) -/* @brief ITRC availability on the SoC. */ -#define FSL_FEATURE_SOC_ITRC_COUNT (1) -/* @brief LPADC availability on the SoC. */ -#define FSL_FEATURE_SOC_LPADC_COUNT (2) -/* @brief LPCMP availability on the SoC. */ -#define FSL_FEATURE_SOC_LPCMP_COUNT (3) -/* @brief LPDAC availability on the SoC. */ -#define FSL_FEATURE_SOC_LPDAC_COUNT (2) -/* @brief LPI2C availability on the SoC. */ -#define FSL_FEATURE_SOC_LPI2C_COUNT (10) -/* @brief LPSPI availability on the SoC. */ -#define FSL_FEATURE_SOC_LPSPI_COUNT (10) -/* @brief LPTMR availability on the SoC. */ -#define FSL_FEATURE_SOC_LPTMR_COUNT (2) -/* @brief LPUART availability on the SoC. */ -#define FSL_FEATURE_SOC_LPUART_COUNT (10) -/* @brief MAILBOX availability on the SoC. */ -#define FSL_FEATURE_SOC_MAILBOX_COUNT (1) -/* @brief MCX_ENET availability on the SoC. */ -#define FSL_FEATURE_SOC_MCX_ENET_COUNT (1) -/* @brief MPU availability on the SoC. */ -#define FSL_FEATURE_SOC_MPU_COUNT (1) -/* @brief MRT availability on the SoC. */ -#define FSL_FEATURE_SOC_MRT_COUNT (1) -/* @brief OPAMP availability on the SoC. */ -#define FSL_FEATURE_SOC_OPAMP_COUNT (3) -/* @brief OSTIMER availability on the SoC. */ -#define FSL_FEATURE_SOC_OSTIMER_COUNT (1) -/* @brief PDM availability on the SoC. */ -#define FSL_FEATURE_SOC_PDM_COUNT (1) -/* @brief PINT availability on the SoC. */ -#define FSL_FEATURE_SOC_PINT_COUNT (1) -/* @brief PKC availability on the SoC. */ -#define FSL_FEATURE_SOC_PKC_COUNT (1) -/* @brief POWERQUAD availability on the SoC. */ -#define FSL_FEATURE_SOC_POWERQUAD_COUNT (1) -/* @brief PORT availability on the SoC. */ -#define FSL_FEATURE_SOC_PORT_COUNT (6) -/* @brief PWM availability on the SoC. */ -#define FSL_FEATURE_SOC_PWM_COUNT (2) -/* @brief PUF availability on the SoC. */ -#define FSL_FEATURE_SOC_PUF_COUNT (4) -/* @brief QDC availability on the SoC. */ -#define FSL_FEATURE_SOC_QDC_COUNT (2) -/* @brief RTC availability on the SoC. */ -#define FSL_FEATURE_SOC_RTC_COUNT (1) -/* @brief SCG availability on the SoC. */ -#define FSL_FEATURE_SOC_SCG_COUNT (1) -/* @brief SCT availability on the SoC. */ -#define FSL_FEATURE_SOC_SCT_COUNT (1) -/* @brief SEMA42 availability on the SoC. */ -#define FSL_FEATURE_SOC_SEMA42_COUNT (1) -/* @brief SINC availability on the SoC. */ -#define FSL_FEATURE_SOC_SINC_COUNT (1) -/* @brief SMARTDMA availability on the SoC. */ -#define FSL_FEATURE_SOC_SMARTDMA_COUNT (1) -/* @brief SYSCON availability on the SoC. */ -#define FSL_FEATURE_SOC_SYSCON_COUNT (1) -/* @brief SYSPM availability on the SoC. */ -#define FSL_FEATURE_SOC_SYSPM_COUNT (2) -/* @brief TSI availability on the SoC. */ -#define FSL_FEATURE_SOC_TSI_COUNT (1) -/* @brief USB availability on the SoC. */ -#define FSL_FEATURE_SOC_USB_COUNT (1) -/* @brief USBC availability on the SoC. */ -#define FSL_FEATURE_SOC_USBC_COUNT (1) -/* @brief USBHSDCD availability on the SoC. */ -#define FSL_FEATURE_SOC_USBHSDCD_COUNT (2) -/* @brief USBNC availability on the SoC. */ -#define FSL_FEATURE_SOC_USBNC_COUNT (1) -/* @brief USBPHY availability on the SoC. */ -#define FSL_FEATURE_SOC_USBPHY_COUNT (1) -/* @brief USDHC availability on the SoC. */ -#define FSL_FEATURE_SOC_USDHC_COUNT (1) -/* @brief UTICK availability on the SoC. */ -#define FSL_FEATURE_SOC_UTICK_COUNT (1) -/* @brief VREF availability on the SoC. */ -#define FSL_FEATURE_SOC_VREF_COUNT (1) -/* @brief WWDT availability on the SoC. */ -#define FSL_FEATURE_SOC_WWDT_COUNT (2) -/* @brief WUU availability on the SoC. */ -#define FSL_FEATURE_SOC_WUU_COUNT (1) - -/* LPADC module features */ - -/* @brief FIFO availability on the SoC. */ -#define FSL_FEATURE_LPADC_FIFO_COUNT (2) -/* @brief Has subsequent trigger priority (bitfield CFG[TPRICTRL]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_SUBSEQUENT_PRIORITY (1) -/* @brief Has differential mode (bitfield CMDLn[DIFF]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_DIFF (0) -/* @brief Has channel scale (bitfield CMDLn[CSCALE]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_CSCALE (0) -/* @brief Has conversion type select (bitfield CMDLn[CTYPE]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_CTYPE (1) -/* @brief Has conversion resolution select (bitfield CMDLn[MODE]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_MODE (1) -/* @brief Has compare function enable (bitfield CMDHn[CMPEN]). */ -#define FSL_FEATURE_LPADC_HAS_CMDH_CMPEN (1) -/* @brief Has Wait for trigger assertion before execution (bitfield CMDHn[WAIT_TRIG]). */ -#define FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG (1) -/* @brief Has offset calibration (bitfield CTRL[CALOFS]). */ -#define FSL_FEATURE_LPADC_HAS_CTRL_CALOFS (1) -/* @brief Has gain calibration (bitfield CTRL[CAL_REQ]). */ -#define FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ (1) -/* @brief Has calibration average (bitfield CTRL[CAL_AVGS]). */ -#define FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS (1) -/* @brief Has internal clock (bitfield CFG[ADCKEN]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_ADCKEN (0) -/* @brief Enable support for low voltage reference on option 1 reference (bitfield CFG[VREF1RNG]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG (0) -/* @brief Has calibration (bitfield CFG[CALOFS]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_CALOFS (0) -/* @brief Has offset trim (register OFSTRIM). */ -#define FSL_FEATURE_LPADC_HAS_OFSTRIM (1) -/* @brief OFSTRIM availability on the SoC. */ -#define FSL_FEATURE_LPADC_OFSTRIM_COUNT (2) -/* @brief Has Trigger status register. */ -#define FSL_FEATURE_LPADC_HAS_TSTAT (1) -/* @brief Has power select (bitfield CFG[PWRSEL]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_PWRSEL (1) -/* @brief Has alternate channel B scale (bitfield CMDLn[ALTB_CSCALE]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE (0) -/* @brief Has alternate channel B select enable (bitfield CMDLn[ALTBEN]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN (1) -/* @brief Has alternate channel input (bitfield CMDLn[ALTB_ADCH]). */ -#define FSL_FEATURE_LPADC_HAS_CMDL_ALTB_ADCH (1) -/* @brief Has offset calibration mode (bitfield CTRL[CALOFSMODE]). */ -#define FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE (0) -/* @brief Conversion averaged bitfiled width. */ -#define FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH (4) -/* @brief Has B side channels. */ -#define FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS (1) -/* @brief Indicate whether the LPADC STAT register has trigger exception interrupt function (bitfield STAT[TEXC_INT]). */ -#define FSL_FEATURE_LPADC_HAS_STAT_TEXC_INT (1) -/* @brief Indicate whether the LPADC STAT register has trigger completion interrupt function (bitfield STAT[TCOMP_INT]). */ -#define FSL_FEATURE_LPADC_HAS_STAT_TCOMP_INT (1) -/* @brief Indicate whether the LPADC STAT register has calibration ready function (bitfield STAT[CAL_RDY]). */ -#define FSL_FEATURE_LPADC_HAS_STAT_CAL_RDY (1) -/* @brief Indicate whether the LPADC STAT register has ADC active function (bitfield STAT[ADC_ACTIVE]). */ -#define FSL_FEATURE_LPADC_HAS_STAT_ADC_ACTIVE (1) -/* @brief Indicate whether the LPADC IE register has trigger exception interrupt enable function (bitfield IE[TEXC_IE]). */ -#define FSL_FEATURE_LPADC_HAS_IE_TEXC_IE (1) -/* @brief Indicate whether the LPADC IE register has trigger completion interrupt enable function (bitfield IE[TCOMP_IE]). */ -#define FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE (1) -/* @brief Indicate whether the LPADC CFG register has trigger resume/restart enable function (bitfield CFG[TRES]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_TRES (1) -/* @brief Indicate whether the LPADC CFG register has trigger command resume/restart enable function (bitfield CFG[TCMDRES]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_TCMDRES (1) -/* @brief Indicate whether the LPADC CFG register has high priority trigger exception disable function (bitfield CFG[HPT_EXDI]). */ -#define FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI (1) -/* @brief Indicate LPADC CFG register TPRICTRL bitfield width. */ -#define FSL_FEATURE_LPADC_CFG_TPRICTRL_BITFIELD_WIDTH (2) -/* @brief Temperature sensor parameter A (slope). */ -#define FSL_FEATURE_LPADC_TEMP_PARAMETER_A (783U) -/* @brief Temperature sensor parameter B (offset). */ -#define FSL_FEATURE_LPADC_TEMP_PARAMETER_B (297U) -/* @brief Temperature sensor parameter Alpha. */ -#define FSL_FEATURE_LPADC_TEMP_PARAMETER_ALPHA (9.63f) -/* @brief The buffer size of temperature sensor. */ -#define FSL_FEATURE_LPADC_TEMP_SENS_BUFFER_SIZE (2U) - -/* CACHE64_CTRL module features */ - -/* @brief Cache Line size in byte. */ -#define FSL_FEATURE_CACHE64_CTRL_LINESIZE_BYTE (32) - -/* CACHE64_POLSEL module features */ - -/* No feature definitions */ - -/* FLEXCAN module features */ - -/* @brief Has more than 64 MBs. */ -#define FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB (0) -/* @brief Message buffer size */ -#define FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(x) (32) -/* @brief Has doze mode support (register bit field MCR[DOZE]). */ -#define FSL_FEATURE_FLEXCAN_HAS_DOZE_MODE_SUPPORT (0) -/* @brief Insatnce has doze mode support (register bit field MCR[DOZE]). */ -#define FSL_FEATURE_FLEXCAN_INSTANCE_HAS_DOZE_MODE_SUPPORTn(x) (0) -/* @brief Has a glitch filter on the receive pin (register bit field MCR[WAKSRC]). */ -#define FSL_FEATURE_FLEXCAN_HAS_GLITCH_FILTER (1) -/* @brief Has extended interrupt mask and flag register (register IMASK2, IFLAG2). */ -#define FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER (0) -/* @brief Instance has extended bit timing register (register CBT). */ -#define FSL_FEATURE_FLEXCAN_INSTANCE_HAS_EXTENDED_TIMING_REGISTERn(x) (1) -/* @brief Has a receive FIFO DMA feature (register bit field MCR[DMA]). */ -#define FSL_FEATURE_FLEXCAN_HAS_RX_FIFO_DMA (1) -/* @brief Instance has a receive FIFO DMA feature (register bit field MCR[DMA]). */ -#define FSL_FEATURE_FLEXCAN_INSTANCE_HAS_RX_FIFO_DMAn(x) (1) -/* @brief Remove CAN Engine Clock Source Selection from unsupported part. */ -#define FSL_FEATURE_FLEXCAN_SUPPORT_ENGINE_CLK_SEL_REMOVE (1) -/* @brief Instance remove CAN Engine Clock Source Selection from unsupported part. */ -#define FSL_FEATURE_FLEXCAN_INSTANCE_SUPPORT_ENGINE_CLK_SEL_REMOVEn(x) (1) -/* @brief Is affected by errata with ID 5641 (Module does not transmit a message that is enabled to be transmitted at a specific moment during the arbitration process). */ -#define FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641 (0) -/* @brief Is affected by errata with ID 5829 (FlexCAN: FlexCAN does not transmit a message that is enabled to be transmitted in a specific moment during the arbitration process). */ -#define FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829 (0) -/* @brief Is affected by errata with ID 6032 (FlexCAN: A frame with wrong ID or payload is transmitted into the CAN bus when the Message Buffer under transmission is either aborted or deactivated while the CAN bus is in the Bus Idle state). */ -#define FSL_FEATURE_FLEXCAN_HAS_ERRATA_6032 (0) -/* @brief Is affected by errata with ID 9595 (FlexCAN: Corrupt frame possible if the Freeze Mode or the Low-Power Mode are entered during a Bus-Off state). */ -#define FSL_FEATURE_FLEXCAN_HAS_ERRATA_9595 (0) -/* @brief Has CAN with Flexible Data rate (CAN FD) protocol. */ -#define FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE (1) -/* @brief CAN instance support Flexible Data rate (CAN FD) protocol. */ -#define FSL_FEATURE_FLEXCAN_INSTANCE_HAS_FLEXIBLE_DATA_RATEn(x) (1) -/* @brief Has memory error control (register MECR). */ -#define FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL (0) -/* @brief Has enhanced bit timing register (register EPRS, ENCBT, EDCBT and ETDC). */ -#define FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG (1) -/* @brief Has Pretended Networking mode support. */ -#define FSL_FEATURE_FLEXCAN_HAS_PN_MODE (1) -/* @brief Has Enhanced Rx FIFO. */ -#define FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO (1) -/* @brief Enhanced Rx FIFO size (Indicates how many CAN FD messages can be stored). */ -#define FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO_SIZE (12) -/* @brief The number of enhanced Rx FIFO filter element registers. */ -#define FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO_FILTER_MAX_NUMBER (32) -/* @brief Does not support Supervisor Mode (bitfield MCR[SUPV]. */ -#define FSL_FEATURE_FLEXCAN_HAS_NO_SUPV_SUPPORT (1) -/* @brief FlexCAN maximum data rate. */ -#define FSL_FEATURE_FLEXCAN_MAX_CANFD_BITRATE (10000000) - -/* CDOG module features */ - -/* @brief CDOG Has No Reset */ -#define FSL_FEATURE_CDOG_HAS_NO_RESET (1) - -/* CMC module features */ - -/* @brief Has SRAM_DIS register */ -#define FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG (1) -/* @brief Has BSR register */ -#define FSL_FEATURE_MCX_CMC_HAS_BSR_REG (1) -/* @brief Has RSTCNT register */ -#define FSL_FEATURE_MCX_CMC_HAS_RSTCNT_REG (1) -/* @brief Has BLR register */ -#define FSL_FEATURE_MCX_CMC_HAS_BLR_REG (1) -/* @brief Has no bitfield FLASHWAKE in FLASHCR register */ -#define FSL_FEATURE_MCX_CMC_HAS_NO_FLASHCR_WAKE (1) - -/* LPCMP module features */ - -/* @brief Has CCR1 FUNC_CLK_SEL bitfield. */ -#define FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL (1) -/* @brief Has IER RRF_IE bitfield. */ -#define FSL_FEATURE_LPCMP_HAS_IER_RRF_IE (1) -/* @brief Has CSR RRF bitfield. */ -#define FSL_FEATURE_LPCMP_HAS_CSR_RRF (1) -/* @brief Has Round Robin mode (related to existence of registers RRCR0). */ -#define FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE (1) -/* @brief Has window mode (related to existence of CCR1.WINDOW_CLS). */ -#define FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL (1) -/* @brief Has no CCR0 CMP_STOP_EN bitfield. */ -#define FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN (1) - -/* SYSPM module features */ - -/* @brief Temperature sensor parameter A (slope). */ -#define FSL_FEATURE_SYSPM_HAS_PMCR_DCIFSH (0) -/* @brief Temperature sensor parameter B (offset). */ -#define FSL_FEATURE_SYSPM_HAS_PMCR_RICTR (0) -/* @brief Number of PMCR registers signals number of performance monitors available in single SYSPM instance. */ -#define FSL_FEATURE_SYSPM_PMCR_COUNT (1) - -/* CTIMER module features */ - -/* @brief CTIMER has no capture channel. */ -#define FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE (0) -/* @brief CTIMER has no capture 2 interrupt. */ -#define FSL_FEATURE_CTIMER_HAS_NO_IR_CR2INT (0) -/* @brief CTIMER capture 3 interrupt. */ -#define FSL_FEATURE_CTIMER_HAS_IR_CR3INT (1) -/* @brief Has CTIMER CCR_CAP2 (register bits CCR[CAP2RE][CAP2FE][CAP2I]. */ -#define FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2 (0) -/* @brief Has CTIMER CCR_CAP3 (register bits CCR[CAP3RE][CAP3FE][CAP3I]). */ -#define FSL_FEATURE_CTIMER_HAS_CCR_CAP3 (1) -/* @brief CTIMER Has register MSR */ -#define FSL_FEATURE_CTIMER_HAS_MSR (1) - -/* LPDAC module features */ - -/* @brief FIFO size. */ -#define FSL_FEATURE_LPDAC_FIFO_SIZE (16) -/* @brief Has OPAMP as buffer, speed control signal (bitfield GCR[BUF_SPD_CTRL]). */ -#define FSL_FEATURE_LPDAC_HAS_GCR_BUF_SPD_CTRL (1) -/* @brief Buffer Enable(bitfield GCR[BUF_EN]). */ -#define FSL_FEATURE_LPDAC_HAS_GCR_BUF_EN (1) -/* @brief RCLK cycles before data latch(bitfield GCR[LATCH_CYC]). */ -#define FSL_FEATURE_LPDAC_HAS_GCR_LATCH_CYC (1) -/* @brief VREF source number. */ -#define FSL_FEATURE_ANALOG_NUM_OF_VREF_SRC (3) -/* @brief Has internal reference current options. */ -#define FSL_FEATURE_LPDAC_HAS_INTERNAL_REFERENCE_CURRENT (1) -/* @brief Support Period trigger mode DAC (bitfield IER[PTGCOCO_IE]). */ -#define FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE (1) - -/* EDMA module features */ - -/* @brief Number of DMA channels (related to number of registers TCD, DCHPRI, bit fields ERQ[ERQn], EEI[EEIn], INT[INTn], ERR[ERRn], HRS[HRSn] and bit field widths ES[ERRCHN], CEEI[CEEI], SEEI[SEEI], CERQ[CERQ], SERQ[SERQ], CDNE[CDNE], SSRT[SSRT], CERR[CERR], CINT[CINT], TCDn_CITER_ELINKYES[LINKCH], TCDn_CSR[MAJORLINKCH], TCDn_BITER_ELINKYES[LINKCH]). (Valid only for eDMA modules.) */ -#define FSL_FEATURE_EDMA_MODULE_CHANNEL (16) -/* @brief If 8 bytes transfer supported. */ -#define FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER (1) -/* @brief Number of DMA channel groups (register bit fields CR[ERGA], CR[GRPnPRI], ES[GPE], DCHPRIn[GRPPRI]). (Valid only for eDMA modules.) */ -#define FSL_FEATURE_EDMA_CHANNEL_GROUP_COUNT (1) -/* @brief If 16 bytes transfer supported. */ -#define FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER (1) -/* @brief Has DMA_Error interrupt vector. */ -#define FSL_FEATURE_EDMA_HAS_ERROR_IRQ (1) -/* @brief If 64 bytes transfer supported. */ -#define FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER (0) -/* @brief whether has prot register */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_PROT_REGISTERn(x) (0) -/* @brief If 128 bytes transfer supported. */ -#define FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER (0) -/* @brief whether has MP channel mux */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_MP_CHANNEL_MUXn(x) (0) -/* @brief If 128 bytes transfer supported. */ -#define FSL_FEATURE_EDMA_INSTANCE_SUPPORT_128_BYTES_TRANSFERn(x) (0) -/* @brief If channel clock controlled independently */ -#define FSL_FEATURE_EDMA_CHANNEL_HAS_OWN_CLOCK_GATE (1) -/* @brief Has register CH_CSR. */ -#define FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG (1) -/* @brief Number of channel for each EDMA instance, (only defined for soc with different channel numbers for difference instance) */ -#define FSL_FEATURE_EDMA_INSTANCE_CHANNELn(x) (16) -/* @brief Has channel mux */ -#define FSL_FEATURE_EDMA_HAS_CHANNEL_MUX (1) -/* @brief Has no register bit fields MP_CSR[EBW]. */ -#define FSL_FEATURE_EDMA_HAS_NO_MP_CSR_EBW (1) -/* @brief Instance has channel mux */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_MUXn(x) (1) -/* @brief If dma has common clock gate */ -#define FSL_FEATURE_EDMA_HAS_COMMON_CLOCK_GATE (0) -/* @brief Has register CH_SBR. */ -#define FSL_FEATURE_EDMA_HAS_SBR (1) -/* @brief If dma channel IRQ support parameter */ -#define FSL_FEATURE_EDMA_MODULE_CHANNEL_IRQ_ENTRY_SUPPORT_PARAMETER (0) -/* @brief Has no register bit fields CH_SBR[ATTR]. */ -#define FSL_FEATURE_EDMA_HAS_NO_CH_SBR_ATTR (1) -/* @brief NBYTES must be multiple of 8 when using scatter gather. */ -#define FSL_FEATURE_EDMA_HAS_ERRATA_51327 (0) -/* @brief Has register bit field CH_CSR[SWAP]. */ -#define FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE (0) -/* @brief NBYTES must be multiple of 8 when using scatter gather. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_ERRATA_51327n(x) (0) -/* @brief Instance has register bit field CH_CSR[SWAP]. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_SWAP_SIZEn(x) (0) -/* @brief Has register bit fields MP_CSR[GMRC]. */ -#define FSL_FEATURE_EDMA_HAS_GLOBAL_MASTER_ID_REPLICATION (1) -/* @brief Has register bit field CH_SBR[INSTR]. */ -#define FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE (0) -/* @brief Instance has register bit field CH_SBR[INSTR]. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_ACCESS_TYPEn(x) (0) -/* @brief Has register bit fields CH_MATTR[WCACHE], CH_MATTR[RCACHE]. */ -#define FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE (0) -/* @brief Instance has register CH_MATTR. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_MEMORY_ATTRIBUTEn(x) (0) -/* @brief Has register bit field CH_CSR[SIGNEXT]. */ -#define FSL_FEATURE_EDMA_HAS_CHANNEL_SIGN_EXTENSION (0) -/* @brief Instance Has register bit field CH_CSR[SIGNEXT]. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_SIGN_EXTENSIONn(x) (0) -/* @brief Has register bit field TCD_CSR[BWC]. */ -#define FSL_FEATURE_EDMA_HAS_BANDWIDTH (1) -/* @brief Instance has register bit field TCD_CSR[BWC]. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_BANDWIDTHn(x) (1) -/* @brief Has register bit fields TCD_CSR[TMC]. */ -#define FSL_FEATURE_EDMA_HAS_TRANSFER_MODE (0) -/* @brief Instance has register bit fields TCD_CSR[TMC]. */ -#define FSL_FEATURE_EDMA_INSTANCE_HAS_TRANSFER_MODEn(x) (0) -/* @brief Has no register bit fields CH_SBR[SEC]. */ -#define FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC (0) -/* @brief edma5 has different tcd type. */ -#define FSL_FEATURE_EDMA_TCD_TYPEn(x) (0) -/* @brief Number of DMA channels with asynchronous request capability. (Valid only for eDMA modules.) */ -#define FSL_FEATURE_EDMA_ASYNCHRO_REQUEST_CHANNEL_COUNT (16) - -/* EVTG module features */ - -/* @brief OPAMP support force bypass */ -#define FSL_FEATURE_EVTG_HAS_FORCE_BYPASS_FLIPFLOP (1) - -/* FLEXIO module features */ - -/* @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) */ -#define FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_HALF_WORD_SWAP (1) -/* @brief Has Shifter Buffer N Nibble Swapped Register (FLEXIO_SHIFTBUFNISn) */ -#define FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_SWAP (1) -/* @brief Supports Shifter State Mode (FLEXIO_SHIFTCTLn[SMOD]) */ -#define FSL_FEATURE_FLEXIO_HAS_STATE_MODE (1) -/* @brief Supports Shifter Logic Mode (FLEXIO_SHIFTCTLn[SMOD]) */ -#define FSL_FEATURE_FLEXIO_HAS_LOGIC_MODE (1) -/* @brief Supports paralle width (FLEXIO_SHIFTCFGn[PWIDTH]) */ -#define FSL_FEATURE_FLEXIO_HAS_PARALLEL_WIDTH (1) -/* @brief Reset value of the FLEXIO_VERID register */ -#define FSL_FEATURE_FLEXIO_VERID_RESET_VALUE (0x2010003) -/* @brief Reset value of the FLEXIO_PARAM register */ -#define FSL_FEATURE_FLEXIO_PARAM_RESET_VALUE (0x8200808) -/* @brief Represent the bit width of the TIMDCE field (FLEXIO_TIMCFGLn[TIMDEC]) */ -#define FSL_FEATURE_FLEXIO_TIMCFG_TIMDCE_FIELD_WIDTH (3) - -/* FLEXSPI module features */ - -/* @brief FlexSPI AHB buffer count */ -#define FSL_FEATURE_FLEXSPI_AHB_BUFFER_COUNTn(x) (8) -/* @brief FlexSPI0 and FlexSPI1 have shared IRQ */ -#define FSL_FEATURE_FLEXSPI_HAS_SHARED_IRQ0_IRQ1 (0) -/* @brief FlexSPI has no MCR0 ARDFEN bit */ -#define FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_ARDFEN (0) -/* @brief FlexSPI has no MCR0 ATDFEN bit */ -#define FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_ATDFEN (0) -/* @brief FlexSPI DMA needs multiple DES to transfer */ -#define FSL_FEATURE_FLEXSPI_DMA_MULTIPLE_DES (1) -/* @brief FlexSPI AHB RX buffer size (byte) */ -#define FSL_FEATURE_FLEXSPI_AHB_RX_BUFFER_SIZEn(x) (2048) - -/* GPIO module features */ - -/* @brief Has GPIO attribute checker register (GACR). */ -#define FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER (0) -/* @brief Has GPIO version ID register (VERID). */ -#define FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER (1) -/* @brief Has secure/non-secure access protection registers (LOCK, PCNS, PCNP, ICNS, ICNP). */ -#define FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL (1) -/* @brief Has GPIO port input disable register (PIDR). */ -#define FSL_FEATURE_GPIO_HAS_PORT_INPUT_CONTROL (1) -/* @brief Has GPIO interrupt/DMA request/trigger output selection. */ -#define FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT (1) - -/* I3C module features */ - -/* @brief Has TERM bitfile in MERRWARN register. */ -#define FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM (1) -/* @brief SOC has no reset driver. */ -#define FSL_FEATURE_I3C_HAS_NO_RESET (0) -/* @brief Use fixed BAMATCH count, do not provide editable BAMATCH. */ -#define FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH (0) -/* @brief Register SCONFIG do not have IDRAND bitfield. */ -#define FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND (0) - -/* INPUTMUX module features */ - -/* @brief Inputmux has DMA Request Enable */ -#define FSL_FEATURE_INPUTMUX_HAS_SIGNAL_ENA (1) -/* @brief Inputmux has channel mux control */ -#define FSL_FEATURE_INPUTMUX_HAS_CHANNEL_MUX (0) - -/* INTM module features */ - -/* @brief Up to 4 programmable interrupt monitors */ -#define FSL_FEATURE_INTM_MONITOR_COUNT (4) - -/* LPI2C module features */ - -/* @brief Has separate DMA RX and TX requests. */ -#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) - -/* LPSPI module features */ - -/* @brief Capacity (number of entries) of the transmit/receive FIFO (or zero if no FIFO is available). */ -#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 */ -#define FSL_FEATURE_LPSPI_HAS_NO_PCSCFG (0) -/* @brief Has no WIDTH bits in TCR register */ -#define FSL_FEATURE_LPSPI_HAS_NO_MULTI_WIDTH (0) - -/* LPTMR module features */ - -/* @brief Has shared interrupt handler with another LPTMR module. */ -#define FSL_FEATURE_LPTMR_HAS_SHARED_IRQ_HANDLER (0) -/* @brief Whether LPTMR counter is 32 bits width. */ -#define FSL_FEATURE_LPTMR_CNR_WIDTH_IS_32B (1) -/* @brief Has timer DMA request enable (register bit CSR[TDRE]). */ -#define FSL_FEATURE_LPTMR_HAS_CSR_TDRE (1) -/* @brief Do not has prescaler clock source 0. */ -#define FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_0_SUPPORT (0) -/* @brief Do not has prescaler clock source 1. */ -#define FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT (0) -/* @brief Do not has prescaler clock source 2. */ -#define FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_2_SUPPORT (0) -/* @brief Do not has prescaler clock source 3. */ -#define FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_3_SUPPORT (0) - -/* LPUART module features */ - -/* @brief Has receive FIFO overflow detection (bit field CFIFO[RXOFE]). */ -#define FSL_FEATURE_LPUART_HAS_IRQ_EXTENDED_FUNCTIONS (0) -/* @brief Has low power features (can be enabled in wait mode via register bit C1[DOZEEN] or CTRL[DOZEEN] if the registers are 32-bit wide). */ -#define FSL_FEATURE_LPUART_HAS_LOW_POWER_UART_SUPPORT (1) -/* @brief Has extended data register ED (or extra flags in the DATA register if the registers are 32-bit wide). */ -#define FSL_FEATURE_LPUART_HAS_EXTENDED_DATA_REGISTER_FLAGS (1) -/* @brief Capacity (number of entries) of the transmit/receive FIFO (or zero if no FIFO is available). */ -#define FSL_FEATURE_LPUART_HAS_FIFO (1) -/* @brief Has 32-bit register MODIR */ -#define FSL_FEATURE_LPUART_HAS_MODIR (1) -/* @brief Hardware flow control (RTS, CTS) is supported. */ -#define FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT (1) -/* @brief Infrared (modulation) is supported. */ -#define FSL_FEATURE_LPUART_HAS_IR_SUPPORT (1) -/* @brief 2 bits long stop bit is available. */ -#define FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT (1) -/* @brief If 10-bit mode is supported. */ -#define FSL_FEATURE_LPUART_HAS_10BIT_DATA_SUPPORT (1) -/* @brief If 7-bit mode is supported. */ -#define FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT (1) -/* @brief Baud rate fine adjustment is available. */ -#define FSL_FEATURE_LPUART_HAS_BAUD_RATE_FINE_ADJUST_SUPPORT (0) -/* @brief Baud rate oversampling is available (has bit fields C4[OSR], C5[BOTHEDGE], C5[RESYNCDIS] or BAUD[OSR], BAUD[BOTHEDGE], BAUD[RESYNCDIS] if the registers are 32-bit wide). */ -#define FSL_FEATURE_LPUART_HAS_BAUD_RATE_OVER_SAMPLING_SUPPORT (1) -/* @brief Baud rate oversampling is available. */ -#define FSL_FEATURE_LPUART_HAS_RX_RESYNC_SUPPORT (1) -/* @brief Baud rate oversampling is available. */ -#define FSL_FEATURE_LPUART_HAS_BOTH_EDGE_SAMPLING_SUPPORT (1) -/* @brief Peripheral type. */ -#define FSL_FEATURE_LPUART_IS_SCI (1) -/* @brief Capacity (number of entries) of the transmit/receive FIFO (or zero if no FIFO is available). */ -#define FSL_FEATURE_LPUART_FIFO_SIZEn(x) (8) -/* @brief Supports two match addresses to filter incoming frames. */ -#define FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING (1) -/* @brief Has transmitter/receiver DMA enable bits C5[TDMAE]/C5[RDMAE] (or BAUD[TDMAE]/BAUD[RDMAE] if the registers are 32-bit wide). */ -#define FSL_FEATURE_LPUART_HAS_DMA_ENABLE (1) -/* @brief Has transmitter/receiver DMA select bits C4[TDMAS]/C4[RDMAS], resp. C5[TDMAS]/C5[RDMAS] if IS_SCI = 0. */ -#define FSL_FEATURE_LPUART_HAS_DMA_SELECT (0) -/* @brief Data character bit order selection is supported (bit field S2[MSBF] or STAT[MSBF] if the registers are 32-bit wide). */ -#define FSL_FEATURE_LPUART_HAS_BIT_ORDER_SELECT (1) -/* @brief Has smart card (ISO7816 protocol) support and no improved smart card support. */ -#define FSL_FEATURE_LPUART_HAS_SMART_CARD_SUPPORT (0) -/* @brief Has improved smart card (ISO7816 protocol) support. */ -#define FSL_FEATURE_LPUART_HAS_IMPROVED_SMART_CARD_SUPPORT (0) -/* @brief Has local operation network (CEA709.1-B protocol) support. */ -#define FSL_FEATURE_LPUART_HAS_LOCAL_OPERATION_NETWORK_SUPPORT (0) -/* @brief Has 32-bit registers (BAUD, STAT, CTRL, DATA, MATCH, MODIR) instead of 8-bit (BDH, BDL, C1, S1, D, etc.). */ -#define FSL_FEATURE_LPUART_HAS_32BIT_REGISTERS (1) -/* @brief Lin break detect available (has bit BAUD[LBKDIE]). */ -#define FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT (1) -/* @brief UART stops in Wait mode available (has bit C1[UARTSWAI]). */ -#define FSL_FEATURE_LPUART_HAS_WAIT_MODE_OPERATION (0) -/* @brief Has separate DMA RX and TX requests. */ -#define FSL_FEATURE_LPUART_HAS_SEPARATE_DMA_RX_TX_REQn(x) (1) -/* @brief Has separate RX and TX interrupts. */ -#define FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ (0) -/* @brief Has LPAURT_PARAM. */ -#define FSL_FEATURE_LPUART_HAS_PARAM (1) -/* @brief Has LPUART_VERID. */ -#define FSL_FEATURE_LPUART_HAS_VERID (1) -/* @brief Has LPUART_GLOBAL. */ -#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 (1) -/* @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) - -/* LP_FLEXCOMM module features */ - -/* No feature definitions */ - -/* MAILBOX module features */ - -/* @brief Mailbox side for current core */ -#define FSL_FEATURE_MAILBOX_SIDE_B (1) - -/* MRT module features */ - -/* @brief number of channels. */ -#define FSL_FEATURE_MRT_NUMBER_OF_CHANNELS (4) - -/* OPAMP module features */ - -/* @brief Opamp has OPAMP_CTR OUTSW bit */ -#define FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_OUTSW (1) -/* @brief Opamp has OPAMP_CTR ADCSW1 bit */ -#define FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW1 (1) -/* @brief Opamp has OPAMP_CTR ADCSW2 bit */ -#define FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW2 (1) -/* @brief Opamp has OPAMP_CTR BUFEN bit */ -#define FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_BUFEN (1) -/* @brief Opamp has OPAMP_CTR INPSEL bit */ -#define FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_INPSEL (1) -/* @brief Opamp has OPAMP_CTR TRIGMD bit */ -#define FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_TRIGMD (1) -/* @brief OPAMP support reference buffer */ -#define FSL_FEATURE_OPAMP_HAS_SUPPORT_REFERENCE_BUFFER (1) - -/* PDM module features */ - -/* @brief PDM FIFO offset */ -#define FSL_FEATURE_PDM_FIFO_OFFSET (4) -/* @brief PDM Channel Number */ -#define FSL_FEATURE_PDM_CHANNEL_NUM (4) -/* @brief PDM FIFO WIDTH Size */ -#define FSL_FEATURE_PDM_FIFO_WIDTH (4) -/* @brief PDM FIFO DEPTH Size */ -#define FSL_FEATURE_PDM_FIFO_DEPTH (16) -/* @brief PDM has RANGE_CTRL register */ -#define FSL_FEATURE_PDM_HAS_RANGE_CTRL (1) -/* @brief PDM Has Low Frequency */ -#define FSL_FEATURE_PDM_HAS_STATUS_LOW_FREQ (0) -/* @brief PDM Has No VADEF Bitfield In PDM VAD0_STAT Register */ -#define FSL_FEATURE_PDM_HAS_NO_VADEF (1) -/* @brief PDM Has no minimum clkdiv */ -#define FSL_FEATURE_PDM_HAS_NO_MINIMUM_CLKDIV (1) -/* @brief PDM Has no FIR_RDY Bitfield In PDM STAT Register */ -#define FSL_FEATURE_PDM_HAS_NO_FIR_RDY (1) -/* @brief PDM Has no DOZEN Bitfield In PDM CTRL_1 Register */ -#define FSL_FEATURE_PDM_HAS_NO_DOZEN (0) -/* @brief PDM Has DEC_BYPASS Bitfield In PDM CTRL_2 Register */ -#define FSL_FEATURE_PDM_HAS_DECIMATION_FILTER_BYPASS (0) -/* @brief PDM Has DC_OUT_CTRL */ -#define FSL_FEATURE_PDM_HAS_DC_OUT_CTRL (1) -/* @brief PDM Has Fixed DC CTRL VALUE. */ -#define FSL_FEATURE_PDM_DC_CTRL_VALUE_FIXED (1) -/* @brief PDM Has no independent error IRQ */ -#define FSL_FEATURE_PDM_HAS_NO_INDEPENDENT_ERROR_IRQ (1) -/* @brief PDM has no hardware Voice Activity Detector */ -#define FSL_FEATURE_PDM_HAS_NO_HWVAD (1) - -/* PINT module features */ - -/* @brief Number of connected outputs */ -#define FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS (8) -/* @brief PINT Interrupt Combine */ -#define FSL_FEATURE_PINT_INTERRUPT_COMBINE (1) - -/* PLU module features */ - -/* @brief Has WAKEINT_CTRL register. */ -#define FSL_FEATURE_PLU_HAS_WAKEINT_CTRL_REG (1) - -/* PORT module features */ - -/* @brief Has control lock (register bit PCR[LK]). */ -#define FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK (1) -/* @brief Has open drain control (register bit PCR[ODE]). */ -#define FSL_FEATURE_PORT_HAS_OPEN_DRAIN (1) -/* @brief Has digital filter (registers DFER, DFCR and DFWR). */ -#define FSL_FEATURE_PORT_HAS_DIGITAL_FILTER (0) -/* @brief Has DMA request (register bit field PCR[IRQC] or ICR[IRQC] values). */ -#define FSL_FEATURE_PORT_HAS_DMA_REQUEST (0) -/* @brief Has pull resistor selection available. */ -#define FSL_FEATURE_PORT_HAS_PULL_SELECTION (1) -/* @brief Has pull resistor enable (register bit PCR[PE]). */ -#define FSL_FEATURE_PORT_HAS_PULL_ENABLE (1) -/* @brief Has slew rate control (register bit PCR[SRE]). */ -#define FSL_FEATURE_PORT_HAS_SLEW_RATE (1) -/* @brief Has passive filter (register bit field PCR[PFE]). */ -#define FSL_FEATURE_PORT_HAS_PASSIVE_FILTER (1) -/* @brief Do not has interrupt control (register ISFR). */ -#define FSL_FEATURE_PORT_HAS_NO_INTERRUPT (1) -/* @brief Has pull value (register bit field PCR[PV]). */ -#define FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE (1) -/* @brief Has drive strength1 control (register bit PCR[DSE1]). */ -#define FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1 (0) -/* @brief Has version ID register (register VERID). */ -#define FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER (1) -/* @brief Has voltage range control (register bit CONFIG[RANGE]). */ -#define FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE (1) -/* @brief Has EFT detect (registers EDFR, EDIER and EDCR). */ -#define FSL_FEATURE_PORT_SUPPORT_EFT (1) -/* @brief Function 0 is GPIO. */ -#define FSL_FEATURE_PORT_PCR_MUX_GPIO (0) -/* @brief Has drive strength control (register bit PCR[DSE]). */ -#define FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH (1) -/* @brief Defines width of PCR[MUX] field. */ -#define FSL_FEATURE_PORT_PCR_MUX_WIDTH (4) -/* @brief Has dedicated interrupt vector. */ -#define FSL_FEATURE_PORT_HAS_INTERRUPT_VECTOR (1) -/* @brief Has independent interrupt control(register ICR). */ -#define FSL_FEATURE_PORT_HAS_INDEPENDENT_INTERRUPT_CONTROL (0) -/* @brief Has multiple pin IRQ configuration (register GICLR and GICHR). */ -#define FSL_FEATURE_PORT_HAS_MULTIPLE_IRQ_CONFIG (0) -/* @brief Has Input Buffer Enable (register bit field PCR[IBE]). */ -#define FSL_FEATURE_PORT_HAS_INPUT_BUFFER (1) -/* @brief Has Invert Input (register bit field PCR[IBE]). */ -#define FSL_FEATURE_PORT_HAS_INVERT_INPUT (1) -/* @brief Defines whether PCR[IRQC] bit-field has flag states. */ -#define FSL_FEATURE_PORT_HAS_IRQC_FLAG (0) -/* @brief Defines whether PCR[IRQC] bit-field has trigger states. */ -#define FSL_FEATURE_PORT_HAS_IRQC_TRIGGER (0) - -/* PUF module features */ - -/* @brief Puf Activation Code Address. */ -#define FSL_FEATURE_PUF_ACTIVATION_CODE_ADDRESS (17826304) -/* @brief Puf Activation Code Size. */ -#define FSL_FEATURE_PUF_ACTIVATION_CODE_SIZE (1000) - -/* PWM module features */ - -/* @brief If (e)FlexPWM has module A channels (outputs). */ -#define FSL_FEATURE_PWM_HAS_CHANNELA (1) -/* @brief If (e)FlexPWM has module B channels (outputs). */ -#define FSL_FEATURE_PWM_HAS_CHANNELB (1) -/* @brief If (e)FlexPWM has module X channels (outputs). */ -#define FSL_FEATURE_PWM_HAS_CHANNELX (1) -/* @brief If (e)FlexPWM has fractional feature. */ -#define FSL_FEATURE_PWM_HAS_FRACTIONAL (1) -/* @brief If (e)FlexPWM has mux trigger source select bit field. */ -#define FSL_FEATURE_PWM_HAS_MUX_TRIGGER_SOURCE_SEL (1) -/* @brief Number of submodules in each (e)FlexPWM module. */ -#define FSL_FEATURE_PWM_SUBMODULE_COUNT (4) -/* @brief Number of fault channel in each (e)FlexPWM module. */ -#define FSL_FEATURE_PWM_FAULT_CH_COUNT (1) -/* @brief (e)FlexPWM has no WAITEN Bitfield In CTRL2 Register. */ -#define FSL_FEATURE_PWM_HAS_NO_WAITEN (1) -/* @brief If (e)FlexPWM has phase delay feature. */ -#define FSL_FEATURE_PWM_HAS_PHASE_DELAY (1) -/* @brief If (e)FlexPWM has input filter capture feature. */ -#define FSL_FEATURE_PWM_HAS_INPUT_FILTER_CAPTURE (1) -/* @brief If (e)FlexPWM has module capture functionality on A channels (inputs). */ -#define FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA (1) -/* @brief If (e)FlexPWM has module capture functionality on B channels (inputs). */ -#define FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB (1) -/* @brief If (e)FlexPWM has module capture functionality on X channels (inputs). */ -#define FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX (1) - -/* QDC module features */ - -/* @brief Has no simultaneous PHASEA and PHASEB change interrupt (register bit field CTRL2[SABIE] and CTRL2[SABIRQ]). */ -#define FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT (0) -/* @brief Has register CTRL3. */ -#define FSL_FEATURE_QDC_HAS_CTRL3 (1) -/* @brief Has register LASTEDGE or LASTEDGEH. */ -#define FSL_FEATURE_QDC_HAS_LASTEDGE (1) -/* @brief Has register POSDPERBFR, POSDPERH, or POSDPER. */ -#define FSL_FEATURE_QDC_HAS_POSDPER (1) -/* @brief Has bitfiled FILT[FILT_PRSC]. */ -#define FSL_FEATURE_QDC_HAS_FILT_PRSC (1) - -/* RTC module features */ - -/* @brief Has Tamper Direction Register support. */ -#define FSL_FEATURE_RTC_HAS_TAMPER_DIRECTION (0) -/* @brief Has Tamper Queue Status and Control Register support. */ -#define FSL_FEATURE_RTC_HAS_TAMPER_QUEUE (0) -/* @brief Has RTC subsystem. */ -#define FSL_FEATURE_RTC_HAS_SUBSYSTEM (1) -/* @brief Has RTC Tamper 23 Filter Configuration Register support. */ -#define FSL_FEATURE_RTC_HAS_FILTER23_CFG (0) -/* @brief Has WAKEUP_MODE bitfile in CTRL2 register. */ -#define FSL_FEATURE_RTC_HAS_NO_CTRL2_WAKEUP_MODE (1) -/* @brief Has CLK_SEL bitfile in CTRL register. */ -#define FSL_FEATURE_RTC_HAS_CLOCK_SELECT (1) -/* @brief Has CLKO_DIS bitfile in CTRL register. */ -#define FSL_FEATURE_RTC_HAS_CLOCK_OUTPUT_DISABLE (1) -/* @brief Has No Tamper in RTC. */ -#define FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE (1) -/* @brief Has CPU_LOW_VOLT bitfile in STATUS register. */ -#define FSL_FEATURE_RTC_HAS_NO_CPU_LOW_VOLT_FLAG (1) -/* @brief Has RST_SRC bitfile in STATUS register. */ -#define FSL_FEATURE_RTC_HAS_NO_RST_SRC_FLAG (1) -/* @brief Has GP_DATA_REG register. */ -#define FSL_FEATURE_RTC_HAS_NO_GP_DATA_REG (1) -/* @brief Has TIMER_STB_MASK bitfile in CTRL register. */ -#define FSL_FEATURE_RTC_HAS_NO_TIMER_STB_MASK (1) - -/* SAI module features */ - -/* @brief SAI has FIFO in this soc (register bit fields TCR1[TFW]. */ -#define FSL_FEATURE_SAI_HAS_FIFO (1) -/* @brief Receive/transmit FIFO size in item count (register bit fields TCSR[FRDE], TCSR[FRIE], TCSR[FRF], TCR1[TFW], RCSR[FRDE], RCSR[FRIE], RCSR[FRF], RCR1[RFW], registers TFRn, RFRn). */ -#define FSL_FEATURE_SAI_FIFO_COUNTn(x) (8) -/* @brief Receive/transmit channel number (register bit fields TCR3[TCE], RCR3[RCE], registers TDRn and RDRn). */ -#define FSL_FEATURE_SAI_CHANNEL_COUNTn(x) (2) -/* @brief Maximum words per frame (register bit fields TCR3[WDFL], TCR4[FRSZ], TMR[TWM], RCR3[WDFL], RCR4[FRSZ], RMR[RWM]). */ -#define FSL_FEATURE_SAI_MAX_WORDS_PER_FRAME (32) -/* @brief Has support of combining multiple data channel FIFOs into single channel FIFO (register bit fields TCR3[CFR], TCR4[FCOMB], TFR0[WCP], TFR1[WCP], RCR3[CFR], RCR4[FCOMB], RFR0[RCP], RFR1[RCP]). */ -#define FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE (1) -/* @brief Has packing of 8-bit and 16-bit data into each 32-bit FIFO word (register bit fields TCR4[FPACK], RCR4[FPACK]). */ -#define FSL_FEATURE_SAI_HAS_FIFO_PACKING (1) -/* @brief Configures when the SAI will continue transmitting after a FIFO error has been detected (register bit fields TCR4[FCONT], RCR4[FCONT]). */ -#define FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR (1) -/* @brief Configures if the frame sync is generated internally, a frame sync is only generated when the FIFO warning flag is clear or continuously (register bit fields TCR4[ONDEM], RCR4[ONDEM]). */ -#define FSL_FEATURE_SAI_HAS_ON_DEMAND_MODE (1) -/* @brief Simplified bit clock source and asynchronous/synchronous mode selection (register bit fields TCR2[CLKMODE], RCR2[CLKMODE]), in comparison with the exclusively implemented TCR2[SYNC,BCS,BCI,MSEL], RCR2[SYNC,BCS,BCI,MSEL]. */ -#define FSL_FEATURE_SAI_HAS_CLOCKING_MODE (0) -/* @brief Has register for configuration of the MCLK divide ratio (register bit fields MDR[FRACT], MDR[DIVIDE]). */ -#define FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER (0) -/* @brief Interrupt source number */ -#define FSL_FEATURE_SAI_INT_SOURCE_NUM (1) -/* @brief Has register of MCR. */ -#define FSL_FEATURE_SAI_HAS_MCR (1) -/* @brief Has bit field MICS of the MCR register. */ -#define FSL_FEATURE_SAI_HAS_NO_MCR_MICS (1) -/* @brief Has register of MDR */ -#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]. */ -#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 (1) - -/* SCT module features */ - -/* @brief Number of events */ -#define FSL_FEATURE_SCT_NUMBER_OF_EVENTS (16) -/* @brief Number of states */ -#define FSL_FEATURE_SCT_NUMBER_OF_STATES (16) -/* @brief Number of match capture */ -#define FSL_FEATURE_SCT_NUMBER_OF_MATCH_CAPTURE (16) -/* @brief Number of outputs */ -#define FSL_FEATURE_SCT_NUMBER_OF_OUTPUTS (10) - -/* SEMA42 module features */ - -/* @brief Gate counts */ -#define FSL_FEATURE_SEMA42_GATE_COUNT (16) - -/* SINC module features */ - -/* @brief SINC channel count. */ -#define FSL_FEATURE_SINC_CHANNEL_COUNT (5) -/* @brief SINC CACFR register has bitfield ADMASEL. */ -#define FSL_FEATURE_SINC_CACFR_HAS_ADMASEL (1) -/* @brief SINC CACFR register has no bitfield PTMUX. */ -#define FSL_FEATURE_SINC_CACFR_HAS_NO_PTMUX (1) - -/* SPC module features */ - -/* @brief Has DCDC */ -#define FSL_FEATURE_MCX_SPC_HAS_DCDC (1) -/* @brief Has SYS LDO */ -#define FSL_FEATURE_MCX_SPC_HAS_SYS_LDO (1) -/* @brief Has IOVDD_LVDF */ -#define FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD (1) -/* @brief Has COREVDD_HVDF */ -#define FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD (1) -/* @brief Has CORELDO_VDD_DS */ -#define FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS (1) -/* @brief Has LPBUFF_EN */ -#define FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT (1) -/* @brief Has COREVDD_IVS_EN */ -#define FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT (1) -/* @brief Has SWITCH_STATE */ -#define FSL_FEATURE_MCX_SPC_HAS_SWITCH_STATE_BIT (0) -/* @brief Has SRAMRETLDO */ -#define FSL_FEATURE_MCX_SPC_HAS_SRAMRETLDO_REG (0) -/* @brief Has CFG register */ -#define FSL_FEATURE_MCX_SPC_HAS_CFG_REG (0) -/* @brief Has SRAMLDO_DPD_ON */ -#define FSL_FEATURE_MCX_SPC_HAS_SRAMLDO_DPD_ON_BIT (0) -/* @brief Has CNTRL register */ -#define FSL_FEATURE_MCX_SPC_HAS_CNTRL_REG (1) -/* @brief Has DPDOWN_PULLDOWN_DISABLE */ -#define FSL_FEATURE_MCX_SPC_HAS_DPDOWN_PULLDOWN_DISABLE_BIT (1) -/* @brief Has BLEED_EN */ -#define FSL_FEATURE_MCX_SPC_HAS_DCDC_CFG_BLEED_EN (1) - -/* SYSCON module features */ - -/* @brief Flash page size in bytes */ -#define FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES (128) -/* @brief Flash sector size in bytes */ -#define FSL_FEATURE_SYSCON_FLASH_SECTOR_SIZE_BYTES (8192) -/* @brief Flash size in bytes */ -#define FSL_FEATURE_SYSCON_FLASH_SIZE_BYTES (2097152) -/* @brief Starter register discontinuous. */ -#define FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS (1) -/* @brief Support ROMAPI. */ -#define FSL_FEATURE_SYSCON_ROMAPI (1) -/* @brief Powerlib API is different with other series devices.. */ -#define FSL_FEATURE_POWERLIB_EXTEND (1) - -/* TRDC module features */ - -/* @brief Process master count. */ -#define FSL_FEATURE_TRDC_PROCESSOR_MASTER_COUNT (2) -/* @brief TRDC instance has PID configuration or not. */ -#define FSL_FEATURE_TRDC_INSTANCE_HAS_PID_CONFIGURATIONn(x) (0) -/* @brief TRDC instance has MBC. */ -#define FSL_FEATURE_TRDC_HAS_MBC (1) -/* @brief TRDC instance has MRC. */ -#define FSL_FEATURE_TRDC_HAS_MRC (0) -/* @brief TRDC instance has TRDC_CR. */ -#define FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG (0) -/* @brief TRDC instance has MDA_Wx_y_DFMT. */ -#define FSL_FEATURE_TRDC_HAS_DOMAIN_ASSIGNMENT (0) -/* @brief TRDC instance has TRDC_FDID. */ -#define FSL_FEATURE_TRDC_HAS_DOMAIN_ERROR (0) -/* @brief TRDC instance has TRDC_FLW_CTL. */ -#define FSL_FEATURE_TRDC_HAS_FLW (0) - -/* TSI module features */ - -/* @brief TSI Version */ -#define FSL_FEATURE_TSI_VERSION (6U) -/* @brief TSI Channel Count */ -#define FSL_FEATURE_TSI_CHANNEL_COUNT (25U) - -/* USBHSDCD module features */ - -/* @brief Size of the USB dedicated RAM */ -#define FSL_FEATURE_USB_USB_RAM (2048) -/* @brief Base address of the USB dedicated RAM */ -#define FSL_FEATURE_USB_USB_RAM_BASE_ADDRESS (1074503680) - -/* USB module features */ - -/* @brief KHCI module instance count */ -#define FSL_FEATURE_USB_KHCI_COUNT (1) -/* @brief HOST mode enabled */ -#define FSL_FEATURE_USB_KHCI_HOST_ENABLED (1) -/* @brief OTG mode enabled */ -#define FSL_FEATURE_USB_KHCI_OTG_ENABLED (1) -/* @brief Size of the USB dedicated RAM */ -#define FSL_FEATURE_USB_KHCI_USB_RAM (2048) -/* @brief Base address of the USB dedicated RAM */ -#define FSL_FEATURE_USB_KHCI_USB_RAM_BASE_ADDRESS (1074503680) -/* @brief Has KEEP_ALIVE_CTRL register */ -#define FSL_FEATURE_USB_KHCI_KEEP_ALIVE_ENABLED (1) -/* @brief Mode control of the USB Keep Alive */ -#define FSL_FEATURE_USB_KHCI_KEEP_ALIVE_MODE_CONTROL (USB_KEEP_ALIVE_CTRL_WAKE_REQ_EN_MASK) -/* @brief Has the Dynamic SOF threshold compare support */ -#define FSL_FEATURE_USB_KHCI_DYNAMIC_SOF_THRESHOLD_COMPARE_ENABLED (1) -/* @brief Has the VBUS detect support */ -#define FSL_FEATURE_USB_KHCI_VBUS_DETECT_ENABLED (1) -/* @brief Has the IRC48M module clock support */ -#define FSL_FEATURE_USB_KHCI_IRC48M_MODULE_CLOCK_ENABLED (1) -/* @brief Number of endpoints supported */ -#define FSL_FEATURE_USB_ENDPT_COUNT (16) -/* @brief Has STALL_IL/OL_DIS registers */ -#define FSL_FEATURE_USB_KHCI_HAS_STALL_LOW (1) -/* @brief Has STALL_IH/OH_DIS registers */ -#define FSL_FEATURE_USB_KHCI_HAS_STALL_HIGH (1) - -/* USBPHY module features */ - -/* @brief USBPHY contain DCD analog module */ -#define FSL_FEATURE_USBPHY_HAS_DCD_ANALOG (0) -/* @brief USBPHY has register TRIM_OVERRIDE_EN */ -#define FSL_FEATURE_USBPHY_HAS_TRIM_OVERRIDE_EN (1) -/* @brief USBPHY is 28FDSOI */ -#define FSL_FEATURE_USBPHY_28FDSOI (0) - -/* USDHC module features */ - -/* @brief Has external DMA support (VEND_SPEC[EXT_DMA_EN]) */ -#define FSL_FEATURE_USDHC_HAS_EXT_DMA (0) -/* @brief Has HS400 mode (MIX_CTRL[HS400_MODE]) */ -#define FSL_FEATURE_USDHC_HAS_HS400_MODE (0) -/* @brief Has SDR50 support (HOST_CTRL_CAP[SDR50_SUPPORT]) */ -#define FSL_FEATURE_USDHC_HAS_SDR50_MODE (1) -/* @brief Has SDR104 support (HOST_CTRL_CAP[SDR104_SUPPORT]) */ -#define FSL_FEATURE_USDHC_HAS_SDR104_MODE (1) -/* @brief USDHC has reset control */ -#define FSL_FEATURE_USDHC_HAS_RESET (0) -/* @brief USDHC has no bitfield WTMK_LVL[WR_BRST_LEN] and WTMK_LVL[RD_BRST_LEN] */ -#define FSL_FEATURE_USDHC_HAS_NO_RW_BURST_LEN (0) -/* @brief If USDHC instance support 8 bit width */ -#define FSL_FEATURE_USDHC_INSTANCE_SUPPORT_8_BIT_WIDTHn(x) (1) -/* @brief If USDHC instance support HS400 mode */ -#define FSL_FEATURE_USDHC_INSTANCE_SUPPORT_HS400_MODEn(x) (0) -/* @brief If USDHC instance support 1v8 signal */ -#define FSL_FEATURE_USDHC_INSTANCE_SUPPORT_1V8_SIGNALn(x) (1) -/* @brief Has no retuning time counter (HOST_CTRL_CAP[TIME_COUNT_RETURNING]) */ -#define FSL_FEATURE_USDHC_REGISTER_HOST_CTRL_CAP_HAS_NO_RETUNING_TIME_COUNTER (1) -/* @brief Has no VSELECT bit in VEND_SPEC register */ -#define FSL_FEATURE_USDHC_HAS_NO_VOLTAGE_SELECT (1) -/* @brief Has no VS18 bit in HOST_CTRL_CAP register */ -#define FSL_FEATURE_USDHC_HAS_NO_VS18 (0) - -/* UTICK module features */ - -/* @brief UTICK does not support PD configure. */ -#define FSL_FEATURE_UTICK_HAS_NO_PDCFG (1) - -/* VBAT module features */ - -/* @brief Has STATUS register */ -#define FSL_FEATURE_MCX_VBAT_HAS_STATUS_REG (1) -/* @brief Has TAMPER register */ -#define FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG (1) -/* @brief Has BANDGAP register */ -#define FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER (1) -/* @brief Has LDOCTL register */ -#define FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG (1) -/* @brief Has OSCCTL register */ -#define FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG (1) -/* @brief Has SWICTL register */ -#define FSL_FEATURE_MCX_VBAT_HAS_SWICTL_REG (1) -/* @brief Has CLKMON register */ -#define FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG (0) -/* @brief Has FINE_AMP_GAIN bitfield in register OSCCTLA */ -#define FSL_FEATURE_MCX_VBAT_HAS_OSCCTLA_FINE_AMP_GAIN_BIT (0) - -/* WWDT module features */ - -/* @brief Has no RESET register. */ -#define FSL_FEATURE_WWDT_HAS_NO_RESET (1) -/* @brief WWDT does not support power down configure */ -#define FSL_FEATURE_WWDT_HAS_NO_PDCFG (1) - -#endif /* _MCXN947_cm33_core1_FEATURES_H_ */ - diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/arm/startup_MCXN947_cm33_core0.S b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/arm/startup_MCXN947_cm33_core0.S deleted file mode 100644 index eabf39e38c6..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/arm/startup_MCXN947_cm33_core0.S +++ /dev/null @@ -1,1858 +0,0 @@ -/* ------------------------------------------------------------------------- */ -/* @file: startup_MCXN947_cm33_core0.s */ -/* @purpose: CMSIS Cortex-M33 Core Device Startup File */ -/* MCXN947_cm33_core0 */ -/* @version: 2.0 */ -/* @date: 2023-2-1 */ -/* @build: b240410 */ -/* ------------------------------------------------------------------------- */ -/* */ -/* Copyright 1997-2016 Freescale Semiconductor, Inc. */ -/* Copyright 2016-2024 NXP */ -/* SPDX-License-Identifier: BSD-3-Clause */ -/*****************************************************************************/ -/* Version: GCC for ARM Embedded Processors */ -/*****************************************************************************/ - .syntax unified - .arch armv8-m.main - .eabi_attribute Tag_ABI_align_preserved, 1 /*8-byte alignment */ - - .section .isr_vector, "a" - .align 2 - .globl __Vectors -__Vectors: - .long Image$$ARM_LIB_STACK$$ZI$$Limit /* Top of Stack */ - .long Reset_Handler /* Reset Handler */ - .long NMI_Handler /* NMI Handler*/ - .long HardFault_Handler /* Hard Fault Handler*/ - .long MemManage_Handler /* MPU Fault Handler*/ - .long BusFault_Handler /* Bus Fault Handler*/ - .long UsageFault_Handler /* Usage Fault Handler*/ - .long SecureFault_Handler /* Secure Fault Handler*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long SVC_Handler /* SVCall Handler*/ - .long DebugMon_Handler /* Debug Monitor Handler*/ - .long 0 /* Reserved*/ - .long PendSV_Handler /* PendSV Handler*/ - .long SysTick_Handler /* SysTick Handler*/ - - /* External Interrupts*/ - .long OR_IRQHandler /* OR IRQ*/ - .long EDMA_0_CH0_IRQHandler /* eDMA_0_CH0 error or transfer complete*/ - .long EDMA_0_CH1_IRQHandler /* eDMA_0_CH1 error or transfer complete*/ - .long EDMA_0_CH2_IRQHandler /* eDMA_0_CH2 error or transfer complete*/ - .long EDMA_0_CH3_IRQHandler /* eDMA_0_CH3 error or transfer complete*/ - .long EDMA_0_CH4_IRQHandler /* eDMA_0_CH4 error or transfer complete*/ - .long EDMA_0_CH5_IRQHandler /* eDMA_0_CH5 error or transfer complete*/ - .long EDMA_0_CH6_IRQHandler /* eDMA_0_CH6 error or transfer complete*/ - .long EDMA_0_CH7_IRQHandler /* eDMA_0_CH7 error or transfer complete*/ - .long EDMA_0_CH8_IRQHandler /* eDMA_0_CH8 error or transfer complete*/ - .long EDMA_0_CH9_IRQHandler /* eDMA_0_CH9 error or transfer complete*/ - .long EDMA_0_CH10_IRQHandler /* eDMA_0_CH10 error or transfer complete*/ - .long EDMA_0_CH11_IRQHandler /* eDMA_0_CH11 error or transfer complete*/ - .long EDMA_0_CH12_IRQHandler /* eDMA_0_CH12 error or transfer complete*/ - .long EDMA_0_CH13_IRQHandler /* eDMA_0_CH13 error or transfer complete*/ - .long EDMA_0_CH14_IRQHandler /* eDMA_0_CH14 error or transfer complete*/ - .long EDMA_0_CH15_IRQHandler /* eDMA_0_CH15 error or transfer complete*/ - .long GPIO00_IRQHandler /* GPIO0 interrupt 0*/ - .long GPIO01_IRQHandler /* GPIO0 interrupt 1*/ - .long GPIO10_IRQHandler /* GPIO1 interrupt 0*/ - .long GPIO11_IRQHandler /* GPIO1 interrupt 1*/ - .long GPIO20_IRQHandler /* GPIO2 interrupt 0*/ - .long GPIO21_IRQHandler /* GPIO2 interrupt 1*/ - .long GPIO30_IRQHandler /* GPIO3 interrupt 0*/ - .long GPIO31_IRQHandler /* GPIO3 interrupt 1*/ - .long GPIO40_IRQHandler /* GPIO4 interrupt 0*/ - .long GPIO41_IRQHandler /* GPIO4 interrupt 1*/ - .long GPIO50_IRQHandler /* GPIO5 interrupt 0*/ - .long GPIO51_IRQHandler /* GPIO5 interrupt 1*/ - .long UTICK0_IRQHandler /* Micro-Tick Timer interrupt*/ - .long MRT0_IRQHandler /* Multi-Rate Timer interrupt*/ - .long CTIMER0_IRQHandler /* Standard counter/timer 0 interrupt*/ - .long CTIMER1_IRQHandler /* Standard counter/timer 1 interrupt*/ - .long SCT0_IRQHandler /* SCTimer/PWM interrupt*/ - .long CTIMER2_IRQHandler /* Standard counter/timer 2 interrupt*/ - .long LP_FLEXCOMM0_IRQHandler /* LP_FLEXCOMM0 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM1_IRQHandler /* LP_FLEXCOMM1 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM2_IRQHandler /* LP_FLEXCOMM2 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM3_IRQHandler /* LP_FLEXCOMM3 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM4_IRQHandler /* LP_FLEXCOMM4 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM5_IRQHandler /* LP_FLEXCOMM5 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM6_IRQHandler /* LP_FLEXCOMM6 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM7_IRQHandler /* LP_FLEXCOMM7 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM8_IRQHandler /* LP_FLEXCOMM8 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM9_IRQHandler /* LP_FLEXCOMM9 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long ADC0_IRQHandler /* Analog-to-Digital Converter 0 - General Purpose interrupt*/ - .long ADC1_IRQHandler /* Analog-to-Digital Converter 1 - General Purpose interrupt*/ - .long PINT0_IRQHandler /* Pin Interrupt Pattern Match Interrupt*/ - .long PDM_EVENT_IRQHandler /* Microphone Interface interrupt*/ - .long Reserved65_IRQHandler /* Reserved interrupt*/ - .long USB0_FS_IRQHandler /* Universal Serial Bus - Full Speed interrupt*/ - .long USB0_DCD_IRQHandler /* Universal Serial Bus - Device Charge Detect interrupt*/ - .long RTC_IRQHandler /* RTC Subsystem interrupt (RTC interrupt or Wake timer interrupt)*/ - .long SMARTDMA_IRQHandler /* SmartDMA_IRQ*/ - .long MAILBOX_IRQHandler /* Inter-CPU Mailbox interrupt0 for CPU0 Inter-CPU Mailbox interrupt1 for CPU1*/ - .long CTIMER3_IRQHandler /* Standard counter/timer 3 interrupt*/ - .long CTIMER4_IRQHandler /* Standard counter/timer 4 interrupt*/ - .long OS_EVENT_IRQHandler /* OS event timer interrupt*/ - .long FLEXSPI0_IRQHandler /* Flexible Serial Peripheral Interface interrupt*/ - .long SAI0_IRQHandler /* Serial Audio Interface 0 interrupt*/ - .long SAI1_IRQHandler /* Serial Audio Interface 1 interrupt*/ - .long USDHC0_IRQHandler /* Ultra Secured Digital Host Controller interrupt*/ - .long CAN0_IRQHandler /* Controller Area Network 0 interrupt*/ - .long CAN1_IRQHandler /* Controller Area Network 1 interrupt*/ - .long Reserved80_IRQHandler /* Reserved interrupt*/ - .long Reserved81_IRQHandler /* Reserved interrupt*/ - .long USB1_HS_PHY_IRQHandler /* USBHS DCD or USBHS Phy interrupt*/ - .long USB1_HS_IRQHandler /* USB High Speed OTG Controller interrupt */ - .long SEC_HYPERVISOR_CALL_IRQHandler /* AHB Secure Controller hypervisor call interrupt*/ - .long Reserved85_IRQHandler /* Reserved interrupt*/ - .long PLU_IRQHandler /* Programmable Logic Unit interrupt*/ - .long Freqme_IRQHandler /* Frequency Measurement interrupt*/ - .long SEC_VIO_IRQHandler /* Secure violation interrupt (Memory Block Checker interrupt or secure AHB matrix violation interrupt)*/ - .long ELS_IRQHandler /* ELS interrupt*/ - .long PKC_IRQHandler /* PKC interrupt*/ - .long PUF_IRQHandler /* Physical Unclonable Function interrupt*/ - .long PQ_IRQHandler /* Power Quad interrupt*/ - .long EDMA_1_CH0_IRQHandler /* eDMA_1_CH0 error or transfer complete*/ - .long EDMA_1_CH1_IRQHandler /* eDMA_1_CH1 error or transfer complete*/ - .long EDMA_1_CH2_IRQHandler /* eDMA_1_CH2 error or transfer complete*/ - .long EDMA_1_CH3_IRQHandler /* eDMA_1_CH3 error or transfer complete*/ - .long EDMA_1_CH4_IRQHandler /* eDMA_1_CH4 error or transfer complete*/ - .long EDMA_1_CH5_IRQHandler /* eDMA_1_CH5 error or transfer complete*/ - .long EDMA_1_CH6_IRQHandler /* eDMA_1_CH6 error or transfer complete*/ - .long EDMA_1_CH7_IRQHandler /* eDMA_1_CH7 error or transfer complete*/ - .long EDMA_1_CH8_IRQHandler /* eDMA_1_CH8 error or transfer complete*/ - .long EDMA_1_CH9_IRQHandler /* eDMA_1_CH9 error or transfer complete*/ - .long EDMA_1_CH10_IRQHandler /* eDMA_1_CH10 error or transfer complete*/ - .long EDMA_1_CH11_IRQHandler /* eDMA_1_CH11 error or transfer complete*/ - .long EDMA_1_CH12_IRQHandler /* eDMA_1_CH12 error or transfer complete*/ - .long EDMA_1_CH13_IRQHandler /* eDMA_1_CH13 error or transfer complete*/ - .long EDMA_1_CH14_IRQHandler /* eDMA_1_CH14 error or transfer complete*/ - .long EDMA_1_CH15_IRQHandler /* eDMA_1_CH15 error or transfer complete*/ - .long CDOG0_IRQHandler /* Code Watchdog Timer 0 interrupt*/ - .long CDOG1_IRQHandler /* Code Watchdog Timer 1 interrupt*/ - .long I3C0_IRQHandler /* Improved Inter Integrated Circuit interrupt 0*/ - .long I3C1_IRQHandler /* Improved Inter Integrated Circuit interrupt 1*/ - .long NPU_IRQHandler /* NPU interrupt*/ - .long GDET_IRQHandler /* Digital Glitch Detect 0 interrupt or Digital Glitch Detect 1 interrupt*/ - .long VBAT0_IRQHandler /* VBAT interrupt( VBAT interrupt or digital tamper interrupt)*/ - .long EWM0_IRQHandler /* External Watchdog Monitor interrupt*/ - .long TSI_END_OF_SCAN_IRQHandler /* TSI End of Scan interrupt*/ - .long TSI_OUT_OF_SCAN_IRQHandler /* TSI Out of Scan interrupt*/ - .long EMVSIM0_IRQHandler /* EMVSIM0 interrupt*/ - .long EMVSIM1_IRQHandler /* EMVSIM1 interrupt*/ - .long FLEXIO_IRQHandler /* Flexible Input/Output interrupt*/ - .long DAC0_IRQHandler /* Digital-to-Analog Converter 0 - General Purpose interrupt*/ - .long DAC1_IRQHandler /* Digital-to-Analog Converter 1 - General Purpose interrupt*/ - .long DAC2_IRQHandler /* 14-bit Digital-to-Analog Converter interrupt*/ - .long HSCMP0_IRQHandler /* High-Speed comparator0 interrupt*/ - .long HSCMP1_IRQHandler /* High-Speed comparator1 interrupt*/ - .long HSCMP2_IRQHandler /* High-Speed comparator2 interrupt*/ - .long FLEXPWM0_RELOAD_ERROR_IRQHandler /* FlexPWM0_reload_error interrupt*/ - .long FLEXPWM0_FAULT_IRQHandler /* FlexPWM0_fault interrupt*/ - .long FLEXPWM0_SUBMODULE0_IRQHandler /* FlexPWM0 Submodule 0 capture/compare/reload interrupt*/ - .long FLEXPWM0_SUBMODULE1_IRQHandler /* FlexPWM0 Submodule 1 capture/compare/reload interrupt*/ - .long FLEXPWM0_SUBMODULE2_IRQHandler /* FlexPWM0 Submodule 2 capture/compare/reload interrupt*/ - .long FLEXPWM0_SUBMODULE3_IRQHandler /* FlexPWM0 Submodule 3 capture/compare/reload interrupt*/ - .long FLEXPWM1_RELOAD_ERROR_IRQHandler /* FlexPWM1_reload_error interrupt*/ - .long FLEXPWM1_FAULT_IRQHandler /* FlexPWM1_fault interrupt*/ - .long FLEXPWM1_SUBMODULE0_IRQHandler /* FlexPWM1 Submodule 0 capture/compare/reload interrupt*/ - .long FLEXPWM1_SUBMODULE1_IRQHandler /* FlexPWM1 Submodule 1 capture/compare/reload interrupt*/ - .long FLEXPWM1_SUBMODULE2_IRQHandler /* FlexPWM1 Submodule 2 capture/compare/reload interrupt*/ - .long FLEXPWM1_SUBMODULE3_IRQHandler /* FlexPWM1 Submodule 3 capture/compare/reload interrupt*/ - .long QDC0_COMPARE_IRQHandler /* QDC0_Compare interrupt*/ - .long QDC0_HOME_IRQHandler /* QDC0_Home interrupt*/ - .long QDC0_WDG_SAB_IRQHandler /* QDC0_WDG_IRQ/SAB interrupt*/ - .long QDC0_IDX_IRQHandler /* QDC0_IDX interrupt*/ - .long QDC1_COMPARE_IRQHandler /* QDC1_Compare interrupt*/ - .long QDC1_HOME_IRQHandler /* QDC1_Home interrupt*/ - .long QDC1_WDG_SAB_IRQHandler /* QDC1_WDG_IRQ/SAB interrupt*/ - .long QDC1_IDX_IRQHandler /* QDC1_IDX interrupt*/ - .long ITRC0_IRQHandler /* Intrusion and Tamper Response Controller interrupt*/ - .long BSP32_IRQHandler /* CoolFlux BSP32 interrupt*/ - .long ELS_ERR_IRQHandler /* ELS error interrupt*/ - .long PKC_ERR_IRQHandler /* PKC error interrupt*/ - .long ERM_SINGLE_BIT_ERROR_IRQHandler /* ERM Single Bit error interrupt*/ - .long ERM_MULTI_BIT_ERROR_IRQHandler /* ERM Multi Bit error interrupt*/ - .long FMU0_IRQHandler /* Flash Management Unit interrupt*/ - .long ETHERNET_IRQHandler /* Ethernet QoS interrupt*/ - .long ETHERNET_PMT_IRQHandler /* Ethernet QoS power management interrupt*/ - .long ETHERNET_MACLP_IRQHandler /* Ethernet QoS MAC interrupt*/ - .long SINC_FILTER_IRQHandler /* SINC Filter interrupt */ - .long LPTMR0_IRQHandler /* Low Power Timer 0 interrupt*/ - .long LPTMR1_IRQHandler /* Low Power Timer 1 interrupt*/ - .long SCG_IRQHandler /* System Clock Generator interrupt*/ - .long SPC_IRQHandler /* System Power Controller interrupt*/ - .long WUU_IRQHandler /* Wake Up Unit interrupt*/ - .long PORT_EFT_IRQHandler /* PORT0~5 EFT interrupt*/ - .long ETB0_IRQHandler /* ETB counter expires interrupt*/ - .long Reserved166_IRQHandler /* Reserved interrupt*/ - .long Reserved167_IRQHandler /* Reserved interrupt*/ - .long WWDT0_IRQHandler /* Windowed Watchdog Timer 0 interrupt*/ - .long WWDT1_IRQHandler /* Windowed Watchdog Timer 1 interrupt*/ - .long CMC0_IRQHandler /* Core Mode Controller interrupt*/ - .long CTI0_IRQHandler /* Cross Trigger Interface interrupt*/ - - .size __Vectors, . - __Vectors - - .text - .thumb - -/* Reset Handler */ - - .thumb_func - .align 2 - .weak Reset_Handler - .type Reset_Handler, %function -Reset_Handler: - cpsid i /* Mask interrupts */ - .equ VTOR, 0xE000ED08 - ldr r0, =VTOR - ldr r1, =__Vectors - str r1, [r0] - ldr r2, [r1] - msr msp, r2 - ldr r0, =Image$$ARM_LIB_STACK$$ZI$$Base - msr msplim, r0 - ldr r0,=SystemInit - blx r0 - cpsie i /* Unmask interrupts */ - ldr r0,=__main - bx r0 - - .pool - .size Reset_Handler, . - Reset_Handler - - .align 1 - .thumb_func - .weak DefaultISR - .type DefaultISR, %function -DefaultISR: - b DefaultISR - .size DefaultISR, . - DefaultISR - - .align 1 - .thumb_func - .weak NMI_Handler - .type NMI_Handler, %function -NMI_Handler: - ldr r0,=NMI_Handler - bx r0 - .size NMI_Handler, . - NMI_Handler - - .align 1 - .thumb_func - .weak HardFault_Handler - .type HardFault_Handler, %function -HardFault_Handler: - ldr r0,=HardFault_Handler - bx r0 - .size HardFault_Handler, . - HardFault_Handler - - .align 1 - .thumb_func - .weak SVC_Handler - .type SVC_Handler, %function -SVC_Handler: - ldr r0,=SVC_Handler - bx r0 - .size SVC_Handler, . - SVC_Handler - - .align 1 - .thumb_func - .weak PendSV_Handler - .type PendSV_Handler, %function -PendSV_Handler: - ldr r0,=PendSV_Handler - bx r0 - .size PendSV_Handler, . - PendSV_Handler - - .align 1 - .thumb_func - .weak SysTick_Handler - .type SysTick_Handler, %function -SysTick_Handler: - ldr r0,=SysTick_Handler - bx r0 - .size SysTick_Handler, . - SysTick_Handler - - .align 1 - .thumb_func - .weak OR_IRQHandler - .type OR_IRQHandler, %function -OR_IRQHandler: - ldr r0,=OR_DriverIRQHandler - bx r0 - .size OR_IRQHandler, . - OR_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH0_IRQHandler - .type EDMA_0_CH0_IRQHandler, %function -EDMA_0_CH0_IRQHandler: - ldr r0,=EDMA_0_CH0_DriverIRQHandler - bx r0 - .size EDMA_0_CH0_IRQHandler, . - EDMA_0_CH0_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH1_IRQHandler - .type EDMA_0_CH1_IRQHandler, %function -EDMA_0_CH1_IRQHandler: - ldr r0,=EDMA_0_CH1_DriverIRQHandler - bx r0 - .size EDMA_0_CH1_IRQHandler, . - EDMA_0_CH1_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH2_IRQHandler - .type EDMA_0_CH2_IRQHandler, %function -EDMA_0_CH2_IRQHandler: - ldr r0,=EDMA_0_CH2_DriverIRQHandler - bx r0 - .size EDMA_0_CH2_IRQHandler, . - EDMA_0_CH2_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH3_IRQHandler - .type EDMA_0_CH3_IRQHandler, %function -EDMA_0_CH3_IRQHandler: - ldr r0,=EDMA_0_CH3_DriverIRQHandler - bx r0 - .size EDMA_0_CH3_IRQHandler, . - EDMA_0_CH3_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH4_IRQHandler - .type EDMA_0_CH4_IRQHandler, %function -EDMA_0_CH4_IRQHandler: - ldr r0,=EDMA_0_CH4_DriverIRQHandler - bx r0 - .size EDMA_0_CH4_IRQHandler, . - EDMA_0_CH4_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH5_IRQHandler - .type EDMA_0_CH5_IRQHandler, %function -EDMA_0_CH5_IRQHandler: - ldr r0,=EDMA_0_CH5_DriverIRQHandler - bx r0 - .size EDMA_0_CH5_IRQHandler, . - EDMA_0_CH5_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH6_IRQHandler - .type EDMA_0_CH6_IRQHandler, %function -EDMA_0_CH6_IRQHandler: - ldr r0,=EDMA_0_CH6_DriverIRQHandler - bx r0 - .size EDMA_0_CH6_IRQHandler, . - EDMA_0_CH6_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH7_IRQHandler - .type EDMA_0_CH7_IRQHandler, %function -EDMA_0_CH7_IRQHandler: - ldr r0,=EDMA_0_CH7_DriverIRQHandler - bx r0 - .size EDMA_0_CH7_IRQHandler, . - EDMA_0_CH7_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH8_IRQHandler - .type EDMA_0_CH8_IRQHandler, %function -EDMA_0_CH8_IRQHandler: - ldr r0,=EDMA_0_CH8_DriverIRQHandler - bx r0 - .size EDMA_0_CH8_IRQHandler, . - EDMA_0_CH8_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH9_IRQHandler - .type EDMA_0_CH9_IRQHandler, %function -EDMA_0_CH9_IRQHandler: - ldr r0,=EDMA_0_CH9_DriverIRQHandler - bx r0 - .size EDMA_0_CH9_IRQHandler, . - EDMA_0_CH9_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH10_IRQHandler - .type EDMA_0_CH10_IRQHandler, %function -EDMA_0_CH10_IRQHandler: - ldr r0,=EDMA_0_CH10_DriverIRQHandler - bx r0 - .size EDMA_0_CH10_IRQHandler, . - EDMA_0_CH10_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH11_IRQHandler - .type EDMA_0_CH11_IRQHandler, %function -EDMA_0_CH11_IRQHandler: - ldr r0,=EDMA_0_CH11_DriverIRQHandler - bx r0 - .size EDMA_0_CH11_IRQHandler, . - EDMA_0_CH11_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH12_IRQHandler - .type EDMA_0_CH12_IRQHandler, %function -EDMA_0_CH12_IRQHandler: - ldr r0,=EDMA_0_CH12_DriverIRQHandler - bx r0 - .size EDMA_0_CH12_IRQHandler, . - EDMA_0_CH12_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH13_IRQHandler - .type EDMA_0_CH13_IRQHandler, %function -EDMA_0_CH13_IRQHandler: - ldr r0,=EDMA_0_CH13_DriverIRQHandler - bx r0 - .size EDMA_0_CH13_IRQHandler, . - EDMA_0_CH13_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH14_IRQHandler - .type EDMA_0_CH14_IRQHandler, %function -EDMA_0_CH14_IRQHandler: - ldr r0,=EDMA_0_CH14_DriverIRQHandler - bx r0 - .size EDMA_0_CH14_IRQHandler, . - EDMA_0_CH14_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH15_IRQHandler - .type EDMA_0_CH15_IRQHandler, %function -EDMA_0_CH15_IRQHandler: - ldr r0,=EDMA_0_CH15_DriverIRQHandler - bx r0 - .size EDMA_0_CH15_IRQHandler, . - EDMA_0_CH15_IRQHandler - - .align 1 - .thumb_func - .weak GPIO00_IRQHandler - .type GPIO00_IRQHandler, %function -GPIO00_IRQHandler: - ldr r0,=GPIO00_DriverIRQHandler - bx r0 - .size GPIO00_IRQHandler, . - GPIO00_IRQHandler - - .align 1 - .thumb_func - .weak GPIO01_IRQHandler - .type GPIO01_IRQHandler, %function -GPIO01_IRQHandler: - ldr r0,=GPIO01_DriverIRQHandler - bx r0 - .size GPIO01_IRQHandler, . - GPIO01_IRQHandler - - .align 1 - .thumb_func - .weak GPIO10_IRQHandler - .type GPIO10_IRQHandler, %function -GPIO10_IRQHandler: - ldr r0,=GPIO10_DriverIRQHandler - bx r0 - .size GPIO10_IRQHandler, . - GPIO10_IRQHandler - - .align 1 - .thumb_func - .weak GPIO11_IRQHandler - .type GPIO11_IRQHandler, %function -GPIO11_IRQHandler: - ldr r0,=GPIO11_DriverIRQHandler - bx r0 - .size GPIO11_IRQHandler, . - GPIO11_IRQHandler - - .align 1 - .thumb_func - .weak GPIO20_IRQHandler - .type GPIO20_IRQHandler, %function -GPIO20_IRQHandler: - ldr r0,=GPIO20_DriverIRQHandler - bx r0 - .size GPIO20_IRQHandler, . - GPIO20_IRQHandler - - .align 1 - .thumb_func - .weak GPIO21_IRQHandler - .type GPIO21_IRQHandler, %function -GPIO21_IRQHandler: - ldr r0,=GPIO21_DriverIRQHandler - bx r0 - .size GPIO21_IRQHandler, . - GPIO21_IRQHandler - - .align 1 - .thumb_func - .weak GPIO30_IRQHandler - .type GPIO30_IRQHandler, %function -GPIO30_IRQHandler: - ldr r0,=GPIO30_DriverIRQHandler - bx r0 - .size GPIO30_IRQHandler, . - GPIO30_IRQHandler - - .align 1 - .thumb_func - .weak GPIO31_IRQHandler - .type GPIO31_IRQHandler, %function -GPIO31_IRQHandler: - ldr r0,=GPIO31_DriverIRQHandler - bx r0 - .size GPIO31_IRQHandler, . - GPIO31_IRQHandler - - .align 1 - .thumb_func - .weak GPIO40_IRQHandler - .type GPIO40_IRQHandler, %function -GPIO40_IRQHandler: - ldr r0,=GPIO40_DriverIRQHandler - bx r0 - .size GPIO40_IRQHandler, . - GPIO40_IRQHandler - - .align 1 - .thumb_func - .weak GPIO41_IRQHandler - .type GPIO41_IRQHandler, %function -GPIO41_IRQHandler: - ldr r0,=GPIO41_DriverIRQHandler - bx r0 - .size GPIO41_IRQHandler, . - GPIO41_IRQHandler - - .align 1 - .thumb_func - .weak GPIO50_IRQHandler - .type GPIO50_IRQHandler, %function -GPIO50_IRQHandler: - ldr r0,=GPIO50_DriverIRQHandler - bx r0 - .size GPIO50_IRQHandler, . - GPIO50_IRQHandler - - .align 1 - .thumb_func - .weak GPIO51_IRQHandler - .type GPIO51_IRQHandler, %function -GPIO51_IRQHandler: - ldr r0,=GPIO51_DriverIRQHandler - bx r0 - .size GPIO51_IRQHandler, . - GPIO51_IRQHandler - - .align 1 - .thumb_func - .weak UTICK0_IRQHandler - .type UTICK0_IRQHandler, %function -UTICK0_IRQHandler: - ldr r0,=UTICK0_DriverIRQHandler - bx r0 - .size UTICK0_IRQHandler, . - UTICK0_IRQHandler - - .align 1 - .thumb_func - .weak MRT0_IRQHandler - .type MRT0_IRQHandler, %function -MRT0_IRQHandler: - ldr r0,=MRT0_DriverIRQHandler - bx r0 - .size MRT0_IRQHandler, . - MRT0_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER0_IRQHandler - .type CTIMER0_IRQHandler, %function -CTIMER0_IRQHandler: - ldr r0,=CTIMER0_DriverIRQHandler - bx r0 - .size CTIMER0_IRQHandler, . - CTIMER0_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER1_IRQHandler - .type CTIMER1_IRQHandler, %function -CTIMER1_IRQHandler: - ldr r0,=CTIMER1_DriverIRQHandler - bx r0 - .size CTIMER1_IRQHandler, . - CTIMER1_IRQHandler - - .align 1 - .thumb_func - .weak SCT0_IRQHandler - .type SCT0_IRQHandler, %function -SCT0_IRQHandler: - ldr r0,=SCT0_DriverIRQHandler - bx r0 - .size SCT0_IRQHandler, . - SCT0_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER2_IRQHandler - .type CTIMER2_IRQHandler, %function -CTIMER2_IRQHandler: - ldr r0,=CTIMER2_DriverIRQHandler - bx r0 - .size CTIMER2_IRQHandler, . - CTIMER2_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM0_IRQHandler - .type LP_FLEXCOMM0_IRQHandler, %function -LP_FLEXCOMM0_IRQHandler: - ldr r0,=LP_FLEXCOMM0_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM0_IRQHandler, . - LP_FLEXCOMM0_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM1_IRQHandler - .type LP_FLEXCOMM1_IRQHandler, %function -LP_FLEXCOMM1_IRQHandler: - ldr r0,=LP_FLEXCOMM1_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM1_IRQHandler, . - LP_FLEXCOMM1_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM2_IRQHandler - .type LP_FLEXCOMM2_IRQHandler, %function -LP_FLEXCOMM2_IRQHandler: - ldr r0,=LP_FLEXCOMM2_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM2_IRQHandler, . - LP_FLEXCOMM2_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM3_IRQHandler - .type LP_FLEXCOMM3_IRQHandler, %function -LP_FLEXCOMM3_IRQHandler: - ldr r0,=LP_FLEXCOMM3_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM3_IRQHandler, . - LP_FLEXCOMM3_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM4_IRQHandler - .type LP_FLEXCOMM4_IRQHandler, %function -LP_FLEXCOMM4_IRQHandler: - ldr r0,=LP_FLEXCOMM4_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM4_IRQHandler, . - LP_FLEXCOMM4_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM5_IRQHandler - .type LP_FLEXCOMM5_IRQHandler, %function -LP_FLEXCOMM5_IRQHandler: - ldr r0,=LP_FLEXCOMM5_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM5_IRQHandler, . - LP_FLEXCOMM5_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM6_IRQHandler - .type LP_FLEXCOMM6_IRQHandler, %function -LP_FLEXCOMM6_IRQHandler: - ldr r0,=LP_FLEXCOMM6_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM6_IRQHandler, . - LP_FLEXCOMM6_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM7_IRQHandler - .type LP_FLEXCOMM7_IRQHandler, %function -LP_FLEXCOMM7_IRQHandler: - ldr r0,=LP_FLEXCOMM7_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM7_IRQHandler, . - LP_FLEXCOMM7_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM8_IRQHandler - .type LP_FLEXCOMM8_IRQHandler, %function -LP_FLEXCOMM8_IRQHandler: - ldr r0,=LP_FLEXCOMM8_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM8_IRQHandler, . - LP_FLEXCOMM8_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM9_IRQHandler - .type LP_FLEXCOMM9_IRQHandler, %function -LP_FLEXCOMM9_IRQHandler: - ldr r0,=LP_FLEXCOMM9_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM9_IRQHandler, . - LP_FLEXCOMM9_IRQHandler - - .align 1 - .thumb_func - .weak ADC0_IRQHandler - .type ADC0_IRQHandler, %function -ADC0_IRQHandler: - ldr r0,=ADC0_DriverIRQHandler - bx r0 - .size ADC0_IRQHandler, . - ADC0_IRQHandler - - .align 1 - .thumb_func - .weak ADC1_IRQHandler - .type ADC1_IRQHandler, %function -ADC1_IRQHandler: - ldr r0,=ADC1_DriverIRQHandler - bx r0 - .size ADC1_IRQHandler, . - ADC1_IRQHandler - - .align 1 - .thumb_func - .weak PINT0_IRQHandler - .type PINT0_IRQHandler, %function -PINT0_IRQHandler: - ldr r0,=PINT0_DriverIRQHandler - bx r0 - .size PINT0_IRQHandler, . - PINT0_IRQHandler - - .align 1 - .thumb_func - .weak PDM_EVENT_IRQHandler - .type PDM_EVENT_IRQHandler, %function -PDM_EVENT_IRQHandler: - ldr r0,=PDM_EVENT_DriverIRQHandler - bx r0 - .size PDM_EVENT_IRQHandler, . - PDM_EVENT_IRQHandler - - .align 1 - .thumb_func - .weak Reserved65_IRQHandler - .type Reserved65_IRQHandler, %function -Reserved65_IRQHandler: - ldr r0,=Reserved65_DriverIRQHandler - bx r0 - .size Reserved65_IRQHandler, . - Reserved65_IRQHandler - - .align 1 - .thumb_func - .weak USB0_FS_IRQHandler - .type USB0_FS_IRQHandler, %function -USB0_FS_IRQHandler: - ldr r0,=USB0_FS_DriverIRQHandler - bx r0 - .size USB0_FS_IRQHandler, . - USB0_FS_IRQHandler - - .align 1 - .thumb_func - .weak USB0_DCD_IRQHandler - .type USB0_DCD_IRQHandler, %function -USB0_DCD_IRQHandler: - ldr r0,=USB0_DCD_DriverIRQHandler - bx r0 - .size USB0_DCD_IRQHandler, . - USB0_DCD_IRQHandler - - .align 1 - .thumb_func - .weak RTC_IRQHandler - .type RTC_IRQHandler, %function -RTC_IRQHandler: - ldr r0,=RTC_DriverIRQHandler - bx r0 - .size RTC_IRQHandler, . - RTC_IRQHandler - - .align 1 - .thumb_func - .weak SMARTDMA_IRQHandler - .type SMARTDMA_IRQHandler, %function -SMARTDMA_IRQHandler: - ldr r0,=SMARTDMA_DriverIRQHandler - bx r0 - .size SMARTDMA_IRQHandler, . - SMARTDMA_IRQHandler - - .align 1 - .thumb_func - .weak MAILBOX_IRQHandler - .type MAILBOX_IRQHandler, %function -MAILBOX_IRQHandler: - ldr r0,=MAILBOX_DriverIRQHandler - bx r0 - .size MAILBOX_IRQHandler, . - MAILBOX_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER3_IRQHandler - .type CTIMER3_IRQHandler, %function -CTIMER3_IRQHandler: - ldr r0,=CTIMER3_DriverIRQHandler - bx r0 - .size CTIMER3_IRQHandler, . - CTIMER3_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER4_IRQHandler - .type CTIMER4_IRQHandler, %function -CTIMER4_IRQHandler: - ldr r0,=CTIMER4_DriverIRQHandler - bx r0 - .size CTIMER4_IRQHandler, . - CTIMER4_IRQHandler - - .align 1 - .thumb_func - .weak OS_EVENT_IRQHandler - .type OS_EVENT_IRQHandler, %function -OS_EVENT_IRQHandler: - ldr r0,=OS_EVENT_DriverIRQHandler - bx r0 - .size OS_EVENT_IRQHandler, . - OS_EVENT_IRQHandler - - .align 1 - .thumb_func - .weak FLEXSPI0_IRQHandler - .type FLEXSPI0_IRQHandler, %function -FLEXSPI0_IRQHandler: - ldr r0,=FLEXSPI0_DriverIRQHandler - bx r0 - .size FLEXSPI0_IRQHandler, . - FLEXSPI0_IRQHandler - - .align 1 - .thumb_func - .weak SAI0_IRQHandler - .type SAI0_IRQHandler, %function -SAI0_IRQHandler: - ldr r0,=SAI0_DriverIRQHandler - bx r0 - .size SAI0_IRQHandler, . - SAI0_IRQHandler - - .align 1 - .thumb_func - .weak SAI1_IRQHandler - .type SAI1_IRQHandler, %function -SAI1_IRQHandler: - ldr r0,=SAI1_DriverIRQHandler - bx r0 - .size SAI1_IRQHandler, . - SAI1_IRQHandler - - .align 1 - .thumb_func - .weak USDHC0_IRQHandler - .type USDHC0_IRQHandler, %function -USDHC0_IRQHandler: - ldr r0,=USDHC0_DriverIRQHandler - bx r0 - .size USDHC0_IRQHandler, . - USDHC0_IRQHandler - - .align 1 - .thumb_func - .weak CAN0_IRQHandler - .type CAN0_IRQHandler, %function -CAN0_IRQHandler: - ldr r0,=CAN0_DriverIRQHandler - bx r0 - .size CAN0_IRQHandler, . - CAN0_IRQHandler - - .align 1 - .thumb_func - .weak CAN1_IRQHandler - .type CAN1_IRQHandler, %function -CAN1_IRQHandler: - ldr r0,=CAN1_DriverIRQHandler - bx r0 - .size CAN1_IRQHandler, . - CAN1_IRQHandler - - .align 1 - .thumb_func - .weak Reserved80_IRQHandler - .type Reserved80_IRQHandler, %function -Reserved80_IRQHandler: - ldr r0,=Reserved80_DriverIRQHandler - bx r0 - .size Reserved80_IRQHandler, . - Reserved80_IRQHandler - - .align 1 - .thumb_func - .weak Reserved81_IRQHandler - .type Reserved81_IRQHandler, %function -Reserved81_IRQHandler: - ldr r0,=Reserved81_DriverIRQHandler - bx r0 - .size Reserved81_IRQHandler, . - Reserved81_IRQHandler - - .align 1 - .thumb_func - .weak USB1_HS_PHY_IRQHandler - .type USB1_HS_PHY_IRQHandler, %function -USB1_HS_PHY_IRQHandler: - ldr r0,=USB1_HS_PHY_DriverIRQHandler - bx r0 - .size USB1_HS_PHY_IRQHandler, . - USB1_HS_PHY_IRQHandler - - .align 1 - .thumb_func - .weak USB1_HS_IRQHandler - .type USB1_HS_IRQHandler, %function -USB1_HS_IRQHandler: - ldr r0,=USB1_HS_DriverIRQHandler - bx r0 - .size USB1_HS_IRQHandler, . - USB1_HS_IRQHandler - - .align 1 - .thumb_func - .weak SEC_HYPERVISOR_CALL_IRQHandler - .type SEC_HYPERVISOR_CALL_IRQHandler, %function -SEC_HYPERVISOR_CALL_IRQHandler: - ldr r0,=SEC_HYPERVISOR_CALL_DriverIRQHandler - bx r0 - .size SEC_HYPERVISOR_CALL_IRQHandler, . - SEC_HYPERVISOR_CALL_IRQHandler - - .align 1 - .thumb_func - .weak Reserved85_IRQHandler - .type Reserved85_IRQHandler, %function -Reserved85_IRQHandler: - ldr r0,=Reserved85_DriverIRQHandler - bx r0 - .size Reserved85_IRQHandler, . - Reserved85_IRQHandler - - .align 1 - .thumb_func - .weak PLU_IRQHandler - .type PLU_IRQHandler, %function -PLU_IRQHandler: - ldr r0,=PLU_DriverIRQHandler - bx r0 - .size PLU_IRQHandler, . - PLU_IRQHandler - - .align 1 - .thumb_func - .weak Freqme_IRQHandler - .type Freqme_IRQHandler, %function -Freqme_IRQHandler: - ldr r0,=Freqme_DriverIRQHandler - bx r0 - .size Freqme_IRQHandler, . - Freqme_IRQHandler - - .align 1 - .thumb_func - .weak SEC_VIO_IRQHandler - .type SEC_VIO_IRQHandler, %function -SEC_VIO_IRQHandler: - ldr r0,=SEC_VIO_DriverIRQHandler - bx r0 - .size SEC_VIO_IRQHandler, . - SEC_VIO_IRQHandler - - .align 1 - .thumb_func - .weak ELS_IRQHandler - .type ELS_IRQHandler, %function -ELS_IRQHandler: - ldr r0,=ELS_DriverIRQHandler - bx r0 - .size ELS_IRQHandler, . - ELS_IRQHandler - - .align 1 - .thumb_func - .weak PKC_IRQHandler - .type PKC_IRQHandler, %function -PKC_IRQHandler: - ldr r0,=PKC_DriverIRQHandler - bx r0 - .size PKC_IRQHandler, . - PKC_IRQHandler - - .align 1 - .thumb_func - .weak PUF_IRQHandler - .type PUF_IRQHandler, %function -PUF_IRQHandler: - ldr r0,=PUF_DriverIRQHandler - bx r0 - .size PUF_IRQHandler, . - PUF_IRQHandler - - .align 1 - .thumb_func - .weak PQ_IRQHandler - .type PQ_IRQHandler, %function -PQ_IRQHandler: - ldr r0,=PQ_DriverIRQHandler - bx r0 - .size PQ_IRQHandler, . - PQ_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH0_IRQHandler - .type EDMA_1_CH0_IRQHandler, %function -EDMA_1_CH0_IRQHandler: - ldr r0,=EDMA_1_CH0_DriverIRQHandler - bx r0 - .size EDMA_1_CH0_IRQHandler, . - EDMA_1_CH0_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH1_IRQHandler - .type EDMA_1_CH1_IRQHandler, %function -EDMA_1_CH1_IRQHandler: - ldr r0,=EDMA_1_CH1_DriverIRQHandler - bx r0 - .size EDMA_1_CH1_IRQHandler, . - EDMA_1_CH1_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH2_IRQHandler - .type EDMA_1_CH2_IRQHandler, %function -EDMA_1_CH2_IRQHandler: - ldr r0,=EDMA_1_CH2_DriverIRQHandler - bx r0 - .size EDMA_1_CH2_IRQHandler, . - EDMA_1_CH2_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH3_IRQHandler - .type EDMA_1_CH3_IRQHandler, %function -EDMA_1_CH3_IRQHandler: - ldr r0,=EDMA_1_CH3_DriverIRQHandler - bx r0 - .size EDMA_1_CH3_IRQHandler, . - EDMA_1_CH3_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH4_IRQHandler - .type EDMA_1_CH4_IRQHandler, %function -EDMA_1_CH4_IRQHandler: - ldr r0,=EDMA_1_CH4_DriverIRQHandler - bx r0 - .size EDMA_1_CH4_IRQHandler, . - EDMA_1_CH4_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH5_IRQHandler - .type EDMA_1_CH5_IRQHandler, %function -EDMA_1_CH5_IRQHandler: - ldr r0,=EDMA_1_CH5_DriverIRQHandler - bx r0 - .size EDMA_1_CH5_IRQHandler, . - EDMA_1_CH5_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH6_IRQHandler - .type EDMA_1_CH6_IRQHandler, %function -EDMA_1_CH6_IRQHandler: - ldr r0,=EDMA_1_CH6_DriverIRQHandler - bx r0 - .size EDMA_1_CH6_IRQHandler, . - EDMA_1_CH6_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH7_IRQHandler - .type EDMA_1_CH7_IRQHandler, %function -EDMA_1_CH7_IRQHandler: - ldr r0,=EDMA_1_CH7_DriverIRQHandler - bx r0 - .size EDMA_1_CH7_IRQHandler, . - EDMA_1_CH7_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH8_IRQHandler - .type EDMA_1_CH8_IRQHandler, %function -EDMA_1_CH8_IRQHandler: - ldr r0,=EDMA_1_CH8_DriverIRQHandler - bx r0 - .size EDMA_1_CH8_IRQHandler, . - EDMA_1_CH8_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH9_IRQHandler - .type EDMA_1_CH9_IRQHandler, %function -EDMA_1_CH9_IRQHandler: - ldr r0,=EDMA_1_CH9_DriverIRQHandler - bx r0 - .size EDMA_1_CH9_IRQHandler, . - EDMA_1_CH9_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH10_IRQHandler - .type EDMA_1_CH10_IRQHandler, %function -EDMA_1_CH10_IRQHandler: - ldr r0,=EDMA_1_CH10_DriverIRQHandler - bx r0 - .size EDMA_1_CH10_IRQHandler, . - EDMA_1_CH10_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH11_IRQHandler - .type EDMA_1_CH11_IRQHandler, %function -EDMA_1_CH11_IRQHandler: - ldr r0,=EDMA_1_CH11_DriverIRQHandler - bx r0 - .size EDMA_1_CH11_IRQHandler, . - EDMA_1_CH11_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH12_IRQHandler - .type EDMA_1_CH12_IRQHandler, %function -EDMA_1_CH12_IRQHandler: - ldr r0,=EDMA_1_CH12_DriverIRQHandler - bx r0 - .size EDMA_1_CH12_IRQHandler, . - EDMA_1_CH12_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH13_IRQHandler - .type EDMA_1_CH13_IRQHandler, %function -EDMA_1_CH13_IRQHandler: - ldr r0,=EDMA_1_CH13_DriverIRQHandler - bx r0 - .size EDMA_1_CH13_IRQHandler, . - EDMA_1_CH13_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH14_IRQHandler - .type EDMA_1_CH14_IRQHandler, %function -EDMA_1_CH14_IRQHandler: - ldr r0,=EDMA_1_CH14_DriverIRQHandler - bx r0 - .size EDMA_1_CH14_IRQHandler, . - EDMA_1_CH14_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH15_IRQHandler - .type EDMA_1_CH15_IRQHandler, %function -EDMA_1_CH15_IRQHandler: - ldr r0,=EDMA_1_CH15_DriverIRQHandler - bx r0 - .size EDMA_1_CH15_IRQHandler, . - EDMA_1_CH15_IRQHandler - - .align 1 - .thumb_func - .weak CDOG0_IRQHandler - .type CDOG0_IRQHandler, %function -CDOG0_IRQHandler: - ldr r0,=CDOG0_DriverIRQHandler - bx r0 - .size CDOG0_IRQHandler, . - CDOG0_IRQHandler - - .align 1 - .thumb_func - .weak CDOG1_IRQHandler - .type CDOG1_IRQHandler, %function -CDOG1_IRQHandler: - ldr r0,=CDOG1_DriverIRQHandler - bx r0 - .size CDOG1_IRQHandler, . - CDOG1_IRQHandler - - .align 1 - .thumb_func - .weak I3C0_IRQHandler - .type I3C0_IRQHandler, %function -I3C0_IRQHandler: - ldr r0,=I3C0_DriverIRQHandler - bx r0 - .size I3C0_IRQHandler, . - I3C0_IRQHandler - - .align 1 - .thumb_func - .weak I3C1_IRQHandler - .type I3C1_IRQHandler, %function -I3C1_IRQHandler: - ldr r0,=I3C1_DriverIRQHandler - bx r0 - .size I3C1_IRQHandler, . - I3C1_IRQHandler - - .align 1 - .thumb_func - .weak NPU_IRQHandler - .type NPU_IRQHandler, %function -NPU_IRQHandler: - ldr r0,=NPU_DriverIRQHandler - bx r0 - .size NPU_IRQHandler, . - NPU_IRQHandler - - .align 1 - .thumb_func - .weak GDET_IRQHandler - .type GDET_IRQHandler, %function -GDET_IRQHandler: - ldr r0,=GDET_DriverIRQHandler - bx r0 - .size GDET_IRQHandler, . - GDET_IRQHandler - - .align 1 - .thumb_func - .weak VBAT0_IRQHandler - .type VBAT0_IRQHandler, %function -VBAT0_IRQHandler: - ldr r0,=VBAT0_DriverIRQHandler - bx r0 - .size VBAT0_IRQHandler, . - VBAT0_IRQHandler - - .align 1 - .thumb_func - .weak EWM0_IRQHandler - .type EWM0_IRQHandler, %function -EWM0_IRQHandler: - ldr r0,=EWM0_DriverIRQHandler - bx r0 - .size EWM0_IRQHandler, . - EWM0_IRQHandler - - .align 1 - .thumb_func - .weak TSI_END_OF_SCAN_IRQHandler - .type TSI_END_OF_SCAN_IRQHandler, %function -TSI_END_OF_SCAN_IRQHandler: - ldr r0,=TSI_END_OF_SCAN_DriverIRQHandler - bx r0 - .size TSI_END_OF_SCAN_IRQHandler, . - TSI_END_OF_SCAN_IRQHandler - - .align 1 - .thumb_func - .weak TSI_OUT_OF_SCAN_IRQHandler - .type TSI_OUT_OF_SCAN_IRQHandler, %function -TSI_OUT_OF_SCAN_IRQHandler: - ldr r0,=TSI_OUT_OF_SCAN_DriverIRQHandler - bx r0 - .size TSI_OUT_OF_SCAN_IRQHandler, . - TSI_OUT_OF_SCAN_IRQHandler - - .align 1 - .thumb_func - .weak EMVSIM0_IRQHandler - .type EMVSIM0_IRQHandler, %function -EMVSIM0_IRQHandler: - ldr r0,=EMVSIM0_DriverIRQHandler - bx r0 - .size EMVSIM0_IRQHandler, . - EMVSIM0_IRQHandler - - .align 1 - .thumb_func - .weak EMVSIM1_IRQHandler - .type EMVSIM1_IRQHandler, %function -EMVSIM1_IRQHandler: - ldr r0,=EMVSIM1_DriverIRQHandler - bx r0 - .size EMVSIM1_IRQHandler, . - EMVSIM1_IRQHandler - - .align 1 - .thumb_func - .weak FLEXIO_IRQHandler - .type FLEXIO_IRQHandler, %function -FLEXIO_IRQHandler: - ldr r0,=FLEXIO_DriverIRQHandler - bx r0 - .size FLEXIO_IRQHandler, . - FLEXIO_IRQHandler - - .align 1 - .thumb_func - .weak DAC0_IRQHandler - .type DAC0_IRQHandler, %function -DAC0_IRQHandler: - ldr r0,=DAC0_DriverIRQHandler - bx r0 - .size DAC0_IRQHandler, . - DAC0_IRQHandler - - .align 1 - .thumb_func - .weak DAC1_IRQHandler - .type DAC1_IRQHandler, %function -DAC1_IRQHandler: - ldr r0,=DAC1_DriverIRQHandler - bx r0 - .size DAC1_IRQHandler, . - DAC1_IRQHandler - - .align 1 - .thumb_func - .weak DAC2_IRQHandler - .type DAC2_IRQHandler, %function -DAC2_IRQHandler: - ldr r0,=DAC2_DriverIRQHandler - bx r0 - .size DAC2_IRQHandler, . - DAC2_IRQHandler - - .align 1 - .thumb_func - .weak HSCMP0_IRQHandler - .type HSCMP0_IRQHandler, %function -HSCMP0_IRQHandler: - ldr r0,=HSCMP0_DriverIRQHandler - bx r0 - .size HSCMP0_IRQHandler, . - HSCMP0_IRQHandler - - .align 1 - .thumb_func - .weak HSCMP1_IRQHandler - .type HSCMP1_IRQHandler, %function -HSCMP1_IRQHandler: - ldr r0,=HSCMP1_DriverIRQHandler - bx r0 - .size HSCMP1_IRQHandler, . - HSCMP1_IRQHandler - - .align 1 - .thumb_func - .weak HSCMP2_IRQHandler - .type HSCMP2_IRQHandler, %function -HSCMP2_IRQHandler: - ldr r0,=HSCMP2_DriverIRQHandler - bx r0 - .size HSCMP2_IRQHandler, . - HSCMP2_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_RELOAD_ERROR_IRQHandler - .type FLEXPWM0_RELOAD_ERROR_IRQHandler, %function -FLEXPWM0_RELOAD_ERROR_IRQHandler: - ldr r0,=FLEXPWM0_RELOAD_ERROR_DriverIRQHandler - bx r0 - .size FLEXPWM0_RELOAD_ERROR_IRQHandler, . - FLEXPWM0_RELOAD_ERROR_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_FAULT_IRQHandler - .type FLEXPWM0_FAULT_IRQHandler, %function -FLEXPWM0_FAULT_IRQHandler: - ldr r0,=FLEXPWM0_FAULT_DriverIRQHandler - bx r0 - .size FLEXPWM0_FAULT_IRQHandler, . - FLEXPWM0_FAULT_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE0_IRQHandler - .type FLEXPWM0_SUBMODULE0_IRQHandler, %function -FLEXPWM0_SUBMODULE0_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE0_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE0_IRQHandler, . - FLEXPWM0_SUBMODULE0_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE1_IRQHandler - .type FLEXPWM0_SUBMODULE1_IRQHandler, %function -FLEXPWM0_SUBMODULE1_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE1_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE1_IRQHandler, . - FLEXPWM0_SUBMODULE1_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE2_IRQHandler - .type FLEXPWM0_SUBMODULE2_IRQHandler, %function -FLEXPWM0_SUBMODULE2_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE2_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE2_IRQHandler, . - FLEXPWM0_SUBMODULE2_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE3_IRQHandler - .type FLEXPWM0_SUBMODULE3_IRQHandler, %function -FLEXPWM0_SUBMODULE3_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE3_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE3_IRQHandler, . - FLEXPWM0_SUBMODULE3_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_RELOAD_ERROR_IRQHandler - .type FLEXPWM1_RELOAD_ERROR_IRQHandler, %function -FLEXPWM1_RELOAD_ERROR_IRQHandler: - ldr r0,=FLEXPWM1_RELOAD_ERROR_DriverIRQHandler - bx r0 - .size FLEXPWM1_RELOAD_ERROR_IRQHandler, . - FLEXPWM1_RELOAD_ERROR_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_FAULT_IRQHandler - .type FLEXPWM1_FAULT_IRQHandler, %function -FLEXPWM1_FAULT_IRQHandler: - ldr r0,=FLEXPWM1_FAULT_DriverIRQHandler - bx r0 - .size FLEXPWM1_FAULT_IRQHandler, . - FLEXPWM1_FAULT_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_SUBMODULE0_IRQHandler - .type FLEXPWM1_SUBMODULE0_IRQHandler, %function -FLEXPWM1_SUBMODULE0_IRQHandler: - ldr r0,=FLEXPWM1_SUBMODULE0_DriverIRQHandler - bx r0 - .size FLEXPWM1_SUBMODULE0_IRQHandler, . - FLEXPWM1_SUBMODULE0_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_SUBMODULE1_IRQHandler - .type FLEXPWM1_SUBMODULE1_IRQHandler, %function -FLEXPWM1_SUBMODULE1_IRQHandler: - ldr r0,=FLEXPWM1_SUBMODULE1_DriverIRQHandler - bx r0 - .size FLEXPWM1_SUBMODULE1_IRQHandler, . - FLEXPWM1_SUBMODULE1_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_SUBMODULE2_IRQHandler - .type FLEXPWM1_SUBMODULE2_IRQHandler, %function -FLEXPWM1_SUBMODULE2_IRQHandler: - ldr r0,=FLEXPWM1_SUBMODULE2_DriverIRQHandler - bx r0 - .size FLEXPWM1_SUBMODULE2_IRQHandler, . - FLEXPWM1_SUBMODULE2_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_SUBMODULE3_IRQHandler - .type FLEXPWM1_SUBMODULE3_IRQHandler, %function -FLEXPWM1_SUBMODULE3_IRQHandler: - ldr r0,=FLEXPWM1_SUBMODULE3_DriverIRQHandler - bx r0 - .size FLEXPWM1_SUBMODULE3_IRQHandler, . - FLEXPWM1_SUBMODULE3_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_COMPARE_IRQHandler - .type QDC0_COMPARE_IRQHandler, %function -QDC0_COMPARE_IRQHandler: - ldr r0,=QDC0_COMPARE_DriverIRQHandler - bx r0 - .size QDC0_COMPARE_IRQHandler, . - QDC0_COMPARE_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_HOME_IRQHandler - .type QDC0_HOME_IRQHandler, %function -QDC0_HOME_IRQHandler: - ldr r0,=QDC0_HOME_DriverIRQHandler - bx r0 - .size QDC0_HOME_IRQHandler, . - QDC0_HOME_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_WDG_SAB_IRQHandler - .type QDC0_WDG_SAB_IRQHandler, %function -QDC0_WDG_SAB_IRQHandler: - ldr r0,=QDC0_WDG_SAB_DriverIRQHandler - bx r0 - .size QDC0_WDG_SAB_IRQHandler, . - QDC0_WDG_SAB_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_IDX_IRQHandler - .type QDC0_IDX_IRQHandler, %function -QDC0_IDX_IRQHandler: - ldr r0,=QDC0_IDX_DriverIRQHandler - bx r0 - .size QDC0_IDX_IRQHandler, . - QDC0_IDX_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_COMPARE_IRQHandler - .type QDC1_COMPARE_IRQHandler, %function -QDC1_COMPARE_IRQHandler: - ldr r0,=QDC1_COMPARE_DriverIRQHandler - bx r0 - .size QDC1_COMPARE_IRQHandler, . - QDC1_COMPARE_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_HOME_IRQHandler - .type QDC1_HOME_IRQHandler, %function -QDC1_HOME_IRQHandler: - ldr r0,=QDC1_HOME_DriverIRQHandler - bx r0 - .size QDC1_HOME_IRQHandler, . - QDC1_HOME_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_WDG_SAB_IRQHandler - .type QDC1_WDG_SAB_IRQHandler, %function -QDC1_WDG_SAB_IRQHandler: - ldr r0,=QDC1_WDG_SAB_DriverIRQHandler - bx r0 - .size QDC1_WDG_SAB_IRQHandler, . - QDC1_WDG_SAB_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_IDX_IRQHandler - .type QDC1_IDX_IRQHandler, %function -QDC1_IDX_IRQHandler: - ldr r0,=QDC1_IDX_DriverIRQHandler - bx r0 - .size QDC1_IDX_IRQHandler, . - QDC1_IDX_IRQHandler - - .align 1 - .thumb_func - .weak ITRC0_IRQHandler - .type ITRC0_IRQHandler, %function -ITRC0_IRQHandler: - ldr r0,=ITRC0_DriverIRQHandler - bx r0 - .size ITRC0_IRQHandler, . - ITRC0_IRQHandler - - .align 1 - .thumb_func - .weak BSP32_IRQHandler - .type BSP32_IRQHandler, %function -BSP32_IRQHandler: - ldr r0,=BSP32_DriverIRQHandler - bx r0 - .size BSP32_IRQHandler, . - BSP32_IRQHandler - - .align 1 - .thumb_func - .weak ELS_ERR_IRQHandler - .type ELS_ERR_IRQHandler, %function -ELS_ERR_IRQHandler: - ldr r0,=ELS_ERR_DriverIRQHandler - bx r0 - .size ELS_ERR_IRQHandler, . - ELS_ERR_IRQHandler - - .align 1 - .thumb_func - .weak PKC_ERR_IRQHandler - .type PKC_ERR_IRQHandler, %function -PKC_ERR_IRQHandler: - ldr r0,=PKC_ERR_DriverIRQHandler - bx r0 - .size PKC_ERR_IRQHandler, . - PKC_ERR_IRQHandler - - .align 1 - .thumb_func - .weak ERM_SINGLE_BIT_ERROR_IRQHandler - .type ERM_SINGLE_BIT_ERROR_IRQHandler, %function -ERM_SINGLE_BIT_ERROR_IRQHandler: - ldr r0,=ERM_SINGLE_BIT_ERROR_DriverIRQHandler - bx r0 - .size ERM_SINGLE_BIT_ERROR_IRQHandler, . - ERM_SINGLE_BIT_ERROR_IRQHandler - - .align 1 - .thumb_func - .weak ERM_MULTI_BIT_ERROR_IRQHandler - .type ERM_MULTI_BIT_ERROR_IRQHandler, %function -ERM_MULTI_BIT_ERROR_IRQHandler: - ldr r0,=ERM_MULTI_BIT_ERROR_DriverIRQHandler - bx r0 - .size ERM_MULTI_BIT_ERROR_IRQHandler, . - ERM_MULTI_BIT_ERROR_IRQHandler - - .align 1 - .thumb_func - .weak FMU0_IRQHandler - .type FMU0_IRQHandler, %function -FMU0_IRQHandler: - ldr r0,=FMU0_DriverIRQHandler - bx r0 - .size FMU0_IRQHandler, . - FMU0_IRQHandler - - .align 1 - .thumb_func - .weak ETHERNET_IRQHandler - .type ETHERNET_IRQHandler, %function -ETHERNET_IRQHandler: - ldr r0,=ETHERNET_DriverIRQHandler - bx r0 - .size ETHERNET_IRQHandler, . - ETHERNET_IRQHandler - - .align 1 - .thumb_func - .weak ETHERNET_PMT_IRQHandler - .type ETHERNET_PMT_IRQHandler, %function -ETHERNET_PMT_IRQHandler: - ldr r0,=ETHERNET_PMT_DriverIRQHandler - bx r0 - .size ETHERNET_PMT_IRQHandler, . - ETHERNET_PMT_IRQHandler - - .align 1 - .thumb_func - .weak ETHERNET_MACLP_IRQHandler - .type ETHERNET_MACLP_IRQHandler, %function -ETHERNET_MACLP_IRQHandler: - ldr r0,=ETHERNET_MACLP_DriverIRQHandler - bx r0 - .size ETHERNET_MACLP_IRQHandler, . - ETHERNET_MACLP_IRQHandler - - .align 1 - .thumb_func - .weak SINC_FILTER_IRQHandler - .type SINC_FILTER_IRQHandler, %function -SINC_FILTER_IRQHandler: - ldr r0,=SINC_FILTER_DriverIRQHandler - bx r0 - .size SINC_FILTER_IRQHandler, . - SINC_FILTER_IRQHandler - - .align 1 - .thumb_func - .weak LPTMR0_IRQHandler - .type LPTMR0_IRQHandler, %function -LPTMR0_IRQHandler: - ldr r0,=LPTMR0_DriverIRQHandler - bx r0 - .size LPTMR0_IRQHandler, . - LPTMR0_IRQHandler - - .align 1 - .thumb_func - .weak LPTMR1_IRQHandler - .type LPTMR1_IRQHandler, %function -LPTMR1_IRQHandler: - ldr r0,=LPTMR1_DriverIRQHandler - bx r0 - .size LPTMR1_IRQHandler, . - LPTMR1_IRQHandler - - .align 1 - .thumb_func - .weak SCG_IRQHandler - .type SCG_IRQHandler, %function -SCG_IRQHandler: - ldr r0,=SCG_DriverIRQHandler - bx r0 - .size SCG_IRQHandler, . - SCG_IRQHandler - - .align 1 - .thumb_func - .weak SPC_IRQHandler - .type SPC_IRQHandler, %function -SPC_IRQHandler: - ldr r0,=SPC_DriverIRQHandler - bx r0 - .size SPC_IRQHandler, . - SPC_IRQHandler - - .align 1 - .thumb_func - .weak WUU_IRQHandler - .type WUU_IRQHandler, %function -WUU_IRQHandler: - ldr r0,=WUU_DriverIRQHandler - bx r0 - .size WUU_IRQHandler, . - WUU_IRQHandler - - .align 1 - .thumb_func - .weak PORT_EFT_IRQHandler - .type PORT_EFT_IRQHandler, %function -PORT_EFT_IRQHandler: - ldr r0,=PORT_EFT_DriverIRQHandler - bx r0 - .size PORT_EFT_IRQHandler, . - PORT_EFT_IRQHandler - - .align 1 - .thumb_func - .weak ETB0_IRQHandler - .type ETB0_IRQHandler, %function -ETB0_IRQHandler: - ldr r0,=ETB0_DriverIRQHandler - bx r0 - .size ETB0_IRQHandler, . - ETB0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved166_IRQHandler - .type Reserved166_IRQHandler, %function -Reserved166_IRQHandler: - ldr r0,=Reserved166_DriverIRQHandler - bx r0 - .size Reserved166_IRQHandler, . - Reserved166_IRQHandler - - .align 1 - .thumb_func - .weak Reserved167_IRQHandler - .type Reserved167_IRQHandler, %function -Reserved167_IRQHandler: - ldr r0,=Reserved167_DriverIRQHandler - bx r0 - .size Reserved167_IRQHandler, . - Reserved167_IRQHandler - - .align 1 - .thumb_func - .weak WWDT0_IRQHandler - .type WWDT0_IRQHandler, %function -WWDT0_IRQHandler: - ldr r0,=WWDT0_DriverIRQHandler - bx r0 - .size WWDT0_IRQHandler, . - WWDT0_IRQHandler - - .align 1 - .thumb_func - .weak WWDT1_IRQHandler - .type WWDT1_IRQHandler, %function -WWDT1_IRQHandler: - ldr r0,=WWDT1_DriverIRQHandler - bx r0 - .size WWDT1_IRQHandler, . - WWDT1_IRQHandler - - .align 1 - .thumb_func - .weak CMC0_IRQHandler - .type CMC0_IRQHandler, %function -CMC0_IRQHandler: - ldr r0,=CMC0_DriverIRQHandler - bx r0 - .size CMC0_IRQHandler, . - CMC0_IRQHandler - - .align 1 - .thumb_func - .weak CTI0_IRQHandler - .type CTI0_IRQHandler, %function -CTI0_IRQHandler: - ldr r0,=CTI0_DriverIRQHandler - bx r0 - .size CTI0_IRQHandler, . - CTI0_IRQHandler - - -/* Macro to define default handlers. Default handler - * will be weak symbol and just dead loops. They can be - * overwritten by other handlers */ - .macro def_irq_handler handler_name - .weak \handler_name - .set \handler_name, DefaultISR - .endm - -/* Exception Handlers */ - def_irq_handler MemManage_Handler - def_irq_handler BusFault_Handler - def_irq_handler UsageFault_Handler - def_irq_handler SecureFault_Handler - def_irq_handler DebugMon_Handler - def_irq_handler OR_DriverIRQHandler - def_irq_handler EDMA_0_CH0_DriverIRQHandler - def_irq_handler EDMA_0_CH1_DriverIRQHandler - def_irq_handler EDMA_0_CH2_DriverIRQHandler - def_irq_handler EDMA_0_CH3_DriverIRQHandler - def_irq_handler EDMA_0_CH4_DriverIRQHandler - def_irq_handler EDMA_0_CH5_DriverIRQHandler - def_irq_handler EDMA_0_CH6_DriverIRQHandler - def_irq_handler EDMA_0_CH7_DriverIRQHandler - def_irq_handler EDMA_0_CH8_DriverIRQHandler - def_irq_handler EDMA_0_CH9_DriverIRQHandler - def_irq_handler EDMA_0_CH10_DriverIRQHandler - def_irq_handler EDMA_0_CH11_DriverIRQHandler - def_irq_handler EDMA_0_CH12_DriverIRQHandler - def_irq_handler EDMA_0_CH13_DriverIRQHandler - def_irq_handler EDMA_0_CH14_DriverIRQHandler - def_irq_handler EDMA_0_CH15_DriverIRQHandler - def_irq_handler GPIO00_DriverIRQHandler - def_irq_handler GPIO01_DriverIRQHandler - def_irq_handler GPIO10_DriverIRQHandler - def_irq_handler GPIO11_DriverIRQHandler - def_irq_handler GPIO20_DriverIRQHandler - def_irq_handler GPIO21_DriverIRQHandler - def_irq_handler GPIO30_DriverIRQHandler - def_irq_handler GPIO31_DriverIRQHandler - def_irq_handler GPIO40_DriverIRQHandler - def_irq_handler GPIO41_DriverIRQHandler - def_irq_handler GPIO50_DriverIRQHandler - def_irq_handler GPIO51_DriverIRQHandler - def_irq_handler UTICK0_DriverIRQHandler - def_irq_handler MRT0_DriverIRQHandler - def_irq_handler CTIMER0_DriverIRQHandler - def_irq_handler CTIMER1_DriverIRQHandler - def_irq_handler SCT0_DriverIRQHandler - def_irq_handler CTIMER2_DriverIRQHandler - def_irq_handler LP_FLEXCOMM0_DriverIRQHandler - def_irq_handler LP_FLEXCOMM1_DriverIRQHandler - def_irq_handler LP_FLEXCOMM2_DriverIRQHandler - def_irq_handler LP_FLEXCOMM3_DriverIRQHandler - def_irq_handler LP_FLEXCOMM4_DriverIRQHandler - def_irq_handler LP_FLEXCOMM5_DriverIRQHandler - def_irq_handler LP_FLEXCOMM6_DriverIRQHandler - def_irq_handler LP_FLEXCOMM7_DriverIRQHandler - def_irq_handler LP_FLEXCOMM8_DriverIRQHandler - def_irq_handler LP_FLEXCOMM9_DriverIRQHandler - def_irq_handler ADC0_DriverIRQHandler - def_irq_handler ADC1_DriverIRQHandler - def_irq_handler PINT0_DriverIRQHandler - def_irq_handler PDM_EVENT_DriverIRQHandler - def_irq_handler Reserved65_DriverIRQHandler - def_irq_handler USB0_FS_DriverIRQHandler - def_irq_handler USB0_DCD_DriverIRQHandler - def_irq_handler RTC_DriverIRQHandler - def_irq_handler SMARTDMA_DriverIRQHandler - def_irq_handler MAILBOX_DriverIRQHandler - def_irq_handler CTIMER3_DriverIRQHandler - def_irq_handler CTIMER4_DriverIRQHandler - def_irq_handler OS_EVENT_DriverIRQHandler - def_irq_handler FLEXSPI0_DriverIRQHandler - def_irq_handler SAI0_DriverIRQHandler - def_irq_handler SAI1_DriverIRQHandler - def_irq_handler USDHC0_DriverIRQHandler - def_irq_handler CAN0_DriverIRQHandler - def_irq_handler CAN1_DriverIRQHandler - def_irq_handler Reserved80_DriverIRQHandler - def_irq_handler Reserved81_DriverIRQHandler - def_irq_handler USB1_HS_PHY_DriverIRQHandler - def_irq_handler USB1_HS_DriverIRQHandler - def_irq_handler SEC_HYPERVISOR_CALL_DriverIRQHandler - def_irq_handler Reserved85_DriverIRQHandler - def_irq_handler PLU_DriverIRQHandler - def_irq_handler Freqme_DriverIRQHandler - def_irq_handler SEC_VIO_DriverIRQHandler - def_irq_handler ELS_DriverIRQHandler - def_irq_handler PKC_DriverIRQHandler - def_irq_handler PUF_DriverIRQHandler - def_irq_handler PQ_DriverIRQHandler - def_irq_handler EDMA_1_CH0_DriverIRQHandler - def_irq_handler EDMA_1_CH1_DriverIRQHandler - def_irq_handler EDMA_1_CH2_DriverIRQHandler - def_irq_handler EDMA_1_CH3_DriverIRQHandler - def_irq_handler EDMA_1_CH4_DriverIRQHandler - def_irq_handler EDMA_1_CH5_DriverIRQHandler - def_irq_handler EDMA_1_CH6_DriverIRQHandler - def_irq_handler EDMA_1_CH7_DriverIRQHandler - def_irq_handler EDMA_1_CH8_DriverIRQHandler - def_irq_handler EDMA_1_CH9_DriverIRQHandler - def_irq_handler EDMA_1_CH10_DriverIRQHandler - def_irq_handler EDMA_1_CH11_DriverIRQHandler - def_irq_handler EDMA_1_CH12_DriverIRQHandler - def_irq_handler EDMA_1_CH13_DriverIRQHandler - def_irq_handler EDMA_1_CH14_DriverIRQHandler - def_irq_handler EDMA_1_CH15_DriverIRQHandler - def_irq_handler CDOG0_DriverIRQHandler - def_irq_handler CDOG1_DriverIRQHandler - def_irq_handler I3C0_DriverIRQHandler - def_irq_handler I3C1_DriverIRQHandler - def_irq_handler NPU_DriverIRQHandler - def_irq_handler GDET_DriverIRQHandler - def_irq_handler VBAT0_DriverIRQHandler - def_irq_handler EWM0_DriverIRQHandler - def_irq_handler TSI_END_OF_SCAN_DriverIRQHandler - def_irq_handler TSI_OUT_OF_SCAN_DriverIRQHandler - def_irq_handler EMVSIM0_DriverIRQHandler - def_irq_handler EMVSIM1_DriverIRQHandler - def_irq_handler FLEXIO_DriverIRQHandler - def_irq_handler DAC0_DriverIRQHandler - def_irq_handler DAC1_DriverIRQHandler - def_irq_handler DAC2_DriverIRQHandler - def_irq_handler HSCMP0_DriverIRQHandler - def_irq_handler HSCMP1_DriverIRQHandler - def_irq_handler HSCMP2_DriverIRQHandler - def_irq_handler FLEXPWM0_RELOAD_ERROR_DriverIRQHandler - def_irq_handler FLEXPWM0_FAULT_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE0_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE1_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE2_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE3_DriverIRQHandler - def_irq_handler FLEXPWM1_RELOAD_ERROR_DriverIRQHandler - def_irq_handler FLEXPWM1_FAULT_DriverIRQHandler - def_irq_handler FLEXPWM1_SUBMODULE0_DriverIRQHandler - def_irq_handler FLEXPWM1_SUBMODULE1_DriverIRQHandler - def_irq_handler FLEXPWM1_SUBMODULE2_DriverIRQHandler - def_irq_handler FLEXPWM1_SUBMODULE3_DriverIRQHandler - def_irq_handler QDC0_COMPARE_DriverIRQHandler - def_irq_handler QDC0_HOME_DriverIRQHandler - def_irq_handler QDC0_WDG_SAB_DriverIRQHandler - def_irq_handler QDC0_IDX_DriverIRQHandler - def_irq_handler QDC1_COMPARE_DriverIRQHandler - def_irq_handler QDC1_HOME_DriverIRQHandler - def_irq_handler QDC1_WDG_SAB_DriverIRQHandler - def_irq_handler QDC1_IDX_DriverIRQHandler - def_irq_handler ITRC0_DriverIRQHandler - def_irq_handler BSP32_DriverIRQHandler - def_irq_handler ELS_ERR_DriverIRQHandler - def_irq_handler PKC_ERR_DriverIRQHandler - def_irq_handler ERM_SINGLE_BIT_ERROR_DriverIRQHandler - def_irq_handler ERM_MULTI_BIT_ERROR_DriverIRQHandler - def_irq_handler FMU0_DriverIRQHandler - def_irq_handler ETHERNET_DriverIRQHandler - def_irq_handler ETHERNET_PMT_DriverIRQHandler - def_irq_handler ETHERNET_MACLP_DriverIRQHandler - def_irq_handler SINC_FILTER_DriverIRQHandler - def_irq_handler LPTMR0_DriverIRQHandler - def_irq_handler LPTMR1_DriverIRQHandler - def_irq_handler SCG_DriverIRQHandler - def_irq_handler SPC_DriverIRQHandler - def_irq_handler WUU_DriverIRQHandler - def_irq_handler PORT_EFT_DriverIRQHandler - def_irq_handler ETB0_DriverIRQHandler - def_irq_handler Reserved166_DriverIRQHandler - def_irq_handler Reserved167_DriverIRQHandler - def_irq_handler WWDT0_DriverIRQHandler - def_irq_handler WWDT1_DriverIRQHandler - def_irq_handler CMC0_DriverIRQHandler - def_irq_handler CTI0_DriverIRQHandler - - .end diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/arm/startup_MCXN947_cm33_core1.S b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/arm/startup_MCXN947_cm33_core1.S deleted file mode 100644 index d73abf86020..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/arm/startup_MCXN947_cm33_core1.S +++ /dev/null @@ -1,1850 +0,0 @@ -/* ------------------------------------------------------------------------- */ -/* @file: startup_MCXN947_cm33_core1.s */ -/* @purpose: CMSIS Cortex-M33 Core Device Startup File */ -/* MCXN947_cm33_core1 */ -/* @version: 2.0 */ -/* @date: 2023-2-1 */ -/* @build: b240410 */ -/* ------------------------------------------------------------------------- */ -/* */ -/* Copyright 1997-2016 Freescale Semiconductor, Inc. */ -/* Copyright 2016-2024 NXP */ -/* SPDX-License-Identifier: BSD-3-Clause */ -/*****************************************************************************/ -/* Version: GCC for ARM Embedded Processors */ -/*****************************************************************************/ - .syntax unified - .arch armv8-m.main - .eabi_attribute Tag_ABI_align_preserved, 1 /*8-byte alignment */ - - .section .isr_vector, "a" - .align 2 - .globl __Vectors -__Vectors: - .long Image$$ARM_LIB_STACK$$ZI$$Limit /* Top of Stack */ - .long Reset_Handler /* Reset Handler */ - .long NMI_Handler /* NMI Handler*/ - .long HardFault_Handler /* Hard Fault Handler*/ - .long MemManage_Handler /* MPU Fault Handler*/ - .long BusFault_Handler /* Bus Fault Handler*/ - .long UsageFault_Handler /* Usage Fault Handler*/ - .long SecureFault_Handler /* Secure Fault Handler*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long SVC_Handler /* SVCall Handler*/ - .long DebugMon_Handler /* Debug Monitor Handler*/ - .long 0 /* Reserved*/ - .long PendSV_Handler /* PendSV Handler*/ - .long SysTick_Handler /* SysTick Handler*/ - - /* External Interrupts*/ - .long OR_IRQHandler /* OR IRQ*/ - .long EDMA_0_CH0_IRQHandler /* eDMA_0_CH0 error or transfer complete*/ - .long EDMA_0_CH1_IRQHandler /* eDMA_0_CH1 error or transfer complete*/ - .long EDMA_0_CH2_IRQHandler /* eDMA_0_CH2 error or transfer complete*/ - .long EDMA_0_CH3_IRQHandler /* eDMA_0_CH3 error or transfer complete*/ - .long EDMA_0_CH4_IRQHandler /* eDMA_0_CH4 error or transfer complete*/ - .long EDMA_0_CH5_IRQHandler /* eDMA_0_CH5 error or transfer complete*/ - .long EDMA_0_CH6_IRQHandler /* eDMA_0_CH6 error or transfer complete*/ - .long EDMA_0_CH7_IRQHandler /* eDMA_0_CH7 error or transfer complete*/ - .long EDMA_0_CH8_IRQHandler /* eDMA_0_CH8 error or transfer complete*/ - .long EDMA_0_CH9_IRQHandler /* eDMA_0_CH9 error or transfer complete*/ - .long EDMA_0_CH10_IRQHandler /* eDMA_0_CH10 error or transfer complete*/ - .long EDMA_0_CH11_IRQHandler /* eDMA_0_CH11 error or transfer complete*/ - .long EDMA_0_CH12_IRQHandler /* eDMA_0_CH12 error or transfer complete*/ - .long EDMA_0_CH13_IRQHandler /* eDMA_0_CH13 error or transfer complete*/ - .long EDMA_0_CH14_IRQHandler /* eDMA_0_CH14 error or transfer complete*/ - .long EDMA_0_CH15_IRQHandler /* eDMA_0_CH15 error or transfer complete*/ - .long GPIO00_IRQHandler /* GPIO0 interrupt 0*/ - .long GPIO01_IRQHandler /* GPIO0 interrupt 1*/ - .long GPIO10_IRQHandler /* GPIO1 interrupt 0*/ - .long GPIO11_IRQHandler /* GPIO1 interrupt 1*/ - .long GPIO20_IRQHandler /* GPIO2 interrupt 0*/ - .long GPIO21_IRQHandler /* GPIO2 interrupt 1*/ - .long GPIO30_IRQHandler /* GPIO3 interrupt 0*/ - .long GPIO31_IRQHandler /* GPIO3 interrupt 1*/ - .long GPIO40_IRQHandler /* GPIO4 interrupt 0*/ - .long GPIO41_IRQHandler /* GPIO4 interrupt 1*/ - .long GPIO50_IRQHandler /* GPIO5 interrupt 0*/ - .long GPIO51_IRQHandler /* GPIO5 interrupt 1*/ - .long UTICK0_IRQHandler /* Micro-Tick Timer interrupt*/ - .long MRT0_IRQHandler /* Multi-Rate Timer interrupt*/ - .long CTIMER0_IRQHandler /* Standard counter/timer 0 interrupt*/ - .long CTIMER1_IRQHandler /* Standard counter/timer 1 interrupt*/ - .long SCT0_IRQHandler /* SCTimer/PWM interrupt*/ - .long CTIMER2_IRQHandler /* Standard counter/timer 2 interrupt*/ - .long LP_FLEXCOMM0_IRQHandler /* LP_FLEXCOMM0 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM1_IRQHandler /* LP_FLEXCOMM1 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM2_IRQHandler /* LP_FLEXCOMM2 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM3_IRQHandler /* LP_FLEXCOMM3 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM4_IRQHandler /* LP_FLEXCOMM4 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM5_IRQHandler /* LP_FLEXCOMM5 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM6_IRQHandler /* LP_FLEXCOMM6 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM7_IRQHandler /* LP_FLEXCOMM7 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM8_IRQHandler /* LP_FLEXCOMM8 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM9_IRQHandler /* LP_FLEXCOMM9 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long ADC0_IRQHandler /* Analog-to-Digital Converter 0 - General Purpose interrupt*/ - .long ADC1_IRQHandler /* Analog-to-Digital Converter 1 - General Purpose interrupt*/ - .long PINT0_IRQHandler /* Pin Interrupt Pattern Match Interrupt*/ - .long PDM_EVENT_IRQHandler /* Microphone Interface interrupt*/ - .long Reserved65_IRQHandler /* Reserved interrupt*/ - .long USB0_FS_IRQHandler /* Universal Serial Bus - Full Speed interrupt*/ - .long USB0_DCD_IRQHandler /* Universal Serial Bus - Device Charge Detect interrupt*/ - .long RTC_IRQHandler /* RTC Subsystem interrupt (RTC interrupt or Wake timer interrupt)*/ - .long SMARTDMA_IRQHandler /* SmartDMA_IRQ*/ - .long MAILBOX_IRQHandler /* Inter-CPU Mailbox interrupt0 for CPU0 Inter-CPU Mailbox interrupt1 for CPU1*/ - .long CTIMER3_IRQHandler /* Standard counter/timer 3 interrupt*/ - .long CTIMER4_IRQHandler /* Standard counter/timer 4 interrupt*/ - .long OS_EVENT_IRQHandler /* OS event timer interrupt*/ - .long FLEXSPI0_IRQHandler /* Flexible Serial Peripheral Interface interrupt*/ - .long SAI0_IRQHandler /* Serial Audio Interface 0 interrupt*/ - .long SAI1_IRQHandler /* Serial Audio Interface 1 interrupt*/ - .long USDHC0_IRQHandler /* Ultra Secured Digital Host Controller interrupt*/ - .long CAN0_IRQHandler /* Controller Area Network 0 interrupt*/ - .long CAN1_IRQHandler /* Controller Area Network 1 interrupt*/ - .long Reserved80_IRQHandler /* Reserved interrupt*/ - .long Reserved81_IRQHandler /* Reserved interrupt*/ - .long USB1_HS_PHY_IRQHandler /* USBHS DCD or USBHS Phy interrupt*/ - .long USB1_HS_IRQHandler /* USB High Speed OTG Controller interrupt */ - .long SEC_HYPERVISOR_CALL_IRQHandler /* AHB Secure Controller hypervisor call interrupt*/ - .long Reserved85_IRQHandler /* Reserved interrupt*/ - .long PLU_IRQHandler /* Programmable Logic Unit interrupt*/ - .long Freqme_IRQHandler /* Frequency Measurement interrupt*/ - .long SEC_VIO_IRQHandler /* Secure violation interrupt (Memory Block Checker interrupt or secure AHB matrix violation interrupt)*/ - .long ELS_IRQHandler /* ELS interrupt*/ - .long PKC_IRQHandler /* PKC interrupt*/ - .long PUF_IRQHandler /* Physical Unclonable Function interrupt*/ - .long PQ_IRQHandler /* Power Quad interrupt*/ - .long EDMA_1_CH0_IRQHandler /* eDMA_1_CH0 error or transfer complete*/ - .long EDMA_1_CH1_IRQHandler /* eDMA_1_CH1 error or transfer complete*/ - .long EDMA_1_CH2_IRQHandler /* eDMA_1_CH2 error or transfer complete*/ - .long EDMA_1_CH3_IRQHandler /* eDMA_1_CH3 error or transfer complete*/ - .long EDMA_1_CH4_IRQHandler /* eDMA_1_CH4 error or transfer complete*/ - .long EDMA_1_CH5_IRQHandler /* eDMA_1_CH5 error or transfer complete*/ - .long EDMA_1_CH6_IRQHandler /* eDMA_1_CH6 error or transfer complete*/ - .long EDMA_1_CH7_IRQHandler /* eDMA_1_CH7 error or transfer complete*/ - .long EDMA_1_CH8_IRQHandler /* eDMA_1_CH8 error or transfer complete*/ - .long EDMA_1_CH9_IRQHandler /* eDMA_1_CH9 error or transfer complete*/ - .long EDMA_1_CH10_IRQHandler /* eDMA_1_CH10 error or transfer complete*/ - .long EDMA_1_CH11_IRQHandler /* eDMA_1_CH11 error or transfer complete*/ - .long EDMA_1_CH12_IRQHandler /* eDMA_1_CH12 error or transfer complete*/ - .long EDMA_1_CH13_IRQHandler /* eDMA_1_CH13 error or transfer complete*/ - .long EDMA_1_CH14_IRQHandler /* eDMA_1_CH14 error or transfer complete*/ - .long EDMA_1_CH15_IRQHandler /* eDMA_1_CH15 error or transfer complete*/ - .long CDOG0_IRQHandler /* Code Watchdog Timer 0 interrupt*/ - .long CDOG1_IRQHandler /* Code Watchdog Timer 1 interrupt*/ - .long I3C0_IRQHandler /* Improved Inter Integrated Circuit interrupt 0*/ - .long I3C1_IRQHandler /* Improved Inter Integrated Circuit interrupt 1*/ - .long NPU_IRQHandler /* NPU interrupt*/ - .long GDET_IRQHandler /* Digital Glitch Detect 0 interrupt or Digital Glitch Detect 1 interrupt*/ - .long VBAT0_IRQHandler /* VBAT interrupt( VBAT interrupt or digital tamper interrupt)*/ - .long EWM0_IRQHandler /* External Watchdog Monitor interrupt*/ - .long TSI_END_OF_SCAN_IRQHandler /* TSI End of Scan interrupt*/ - .long TSI_OUT_OF_SCAN_IRQHandler /* TSI Out of Scan interrupt*/ - .long EMVSIM0_IRQHandler /* EMVSIM0 interrupt*/ - .long EMVSIM1_IRQHandler /* EMVSIM1 interrupt*/ - .long FLEXIO_IRQHandler /* Flexible Input/Output interrupt*/ - .long DAC0_IRQHandler /* Digital-to-Analog Converter 0 - General Purpose interrupt*/ - .long DAC1_IRQHandler /* Digital-to-Analog Converter 1 - General Purpose interrupt*/ - .long DAC2_IRQHandler /* 14-bit Digital-to-Analog Converter interrupt*/ - .long HSCMP0_IRQHandler /* High-Speed comparator0 interrupt*/ - .long HSCMP1_IRQHandler /* High-Speed comparator1 interrupt*/ - .long HSCMP2_IRQHandler /* High-Speed comparator2 interrupt*/ - .long FLEXPWM0_RELOAD_ERROR_IRQHandler /* FlexPWM0_reload_error interrupt*/ - .long FLEXPWM0_FAULT_IRQHandler /* FlexPWM0_fault interrupt*/ - .long FLEXPWM0_SUBMODULE0_IRQHandler /* FlexPWM0 Submodule 0 capture/compare/reload interrupt*/ - .long FLEXPWM0_SUBMODULE1_IRQHandler /* FlexPWM0 Submodule 1 capture/compare/reload interrupt*/ - .long FLEXPWM0_SUBMODULE2_IRQHandler /* FlexPWM0 Submodule 2 capture/compare/reload interrupt*/ - .long FLEXPWM0_SUBMODULE3_IRQHandler /* FlexPWM0 Submodule 3 capture/compare/reload interrupt*/ - .long FLEXPWM1_RELOAD_ERROR_IRQHandler /* FlexPWM1_reload_error interrupt*/ - .long FLEXPWM1_FAULT_IRQHandler /* FlexPWM1_fault interrupt*/ - .long FLEXPWM1_SUBMODULE0_IRQHandler /* FlexPWM1 Submodule 0 capture/compare/reload interrupt*/ - .long FLEXPWM1_SUBMODULE1_IRQHandler /* FlexPWM1 Submodule 1 capture/compare/reload interrupt*/ - .long FLEXPWM1_SUBMODULE2_IRQHandler /* FlexPWM1 Submodule 2 capture/compare/reload interrupt*/ - .long FLEXPWM1_SUBMODULE3_IRQHandler /* FlexPWM1 Submodule 3 capture/compare/reload interrupt*/ - .long QDC0_COMPARE_IRQHandler /* QDC0_Compare interrupt*/ - .long QDC0_HOME_IRQHandler /* QDC0_Home interrupt*/ - .long QDC0_WDG_SAB_IRQHandler /* QDC0_WDG_IRQ/SAB interrupt*/ - .long QDC0_IDX_IRQHandler /* QDC0_IDX interrupt*/ - .long QDC1_COMPARE_IRQHandler /* QDC1_Compare interrupt*/ - .long QDC1_HOME_IRQHandler /* QDC1_Home interrupt*/ - .long QDC1_WDG_SAB_IRQHandler /* QDC1_WDG_IRQ/SAB interrupt*/ - .long QDC1_IDX_IRQHandler /* QDC1_IDX interrupt*/ - .long ITRC0_IRQHandler /* Intrusion and Tamper Response Controller interrupt*/ - .long BSP32_IRQHandler /* CoolFlux BSP32 interrupt*/ - .long ELS_ERR_IRQHandler /* ELS error interrupt*/ - .long PKC_ERR_IRQHandler /* PKC error interrupt*/ - .long ERM_SINGLE_BIT_ERROR_IRQHandler /* ERM Single Bit error interrupt*/ - .long ERM_MULTI_BIT_ERROR_IRQHandler /* ERM Multi Bit error interrupt*/ - .long FMU0_IRQHandler /* Flash Management Unit interrupt*/ - .long ETHERNET_IRQHandler /* Ethernet QoS interrupt*/ - .long ETHERNET_PMT_IRQHandler /* Ethernet QoS power management interrupt*/ - .long ETHERNET_MACLP_IRQHandler /* Ethernet QoS MAC interrupt*/ - .long SINC_FILTER_IRQHandler /* SINC Filter interrupt */ - .long LPTMR0_IRQHandler /* Low Power Timer 0 interrupt*/ - .long LPTMR1_IRQHandler /* Low Power Timer 1 interrupt*/ - .long SCG_IRQHandler /* System Clock Generator interrupt*/ - .long SPC_IRQHandler /* System Power Controller interrupt*/ - .long WUU_IRQHandler /* Wake Up Unit interrupt*/ - .long PORT_EFT_IRQHandler /* PORT0~5 EFT interrupt*/ - .long ETB0_IRQHandler /* ETB counter expires interrupt*/ - .long Reserved166_IRQHandler /* Reserved interrupt*/ - .long Reserved167_IRQHandler /* Reserved interrupt*/ - .long WWDT0_IRQHandler /* Windowed Watchdog Timer 0 interrupt*/ - .long WWDT1_IRQHandler /* Windowed Watchdog Timer 1 interrupt*/ - .long CMC0_IRQHandler /* Core Mode Controller interrupt*/ - .long CTI0_IRQHandler /* Cross Trigger Interface interrupt*/ - - .size __Vectors, . - __Vectors - - .text - .thumb - -/* Reset Handler */ - - .thumb_func - .align 2 - .weak Reset_Handler - .type Reset_Handler, %function -Reset_Handler: - cpsid i /* Mask interrupts */ - ldr r0,=SystemInit - blx r0 - cpsie i /* Unmask interrupts */ - ldr r0,=__main - bx r0 - - .pool - .size Reset_Handler, . - Reset_Handler - - .align 1 - .thumb_func - .weak DefaultISR - .type DefaultISR, %function -DefaultISR: - b DefaultISR - .size DefaultISR, . - DefaultISR - - .align 1 - .thumb_func - .weak NMI_Handler - .type NMI_Handler, %function -NMI_Handler: - ldr r0,=NMI_Handler - bx r0 - .size NMI_Handler, . - NMI_Handler - - .align 1 - .thumb_func - .weak HardFault_Handler - .type HardFault_Handler, %function -HardFault_Handler: - ldr r0,=HardFault_Handler - bx r0 - .size HardFault_Handler, . - HardFault_Handler - - .align 1 - .thumb_func - .weak SVC_Handler - .type SVC_Handler, %function -SVC_Handler: - ldr r0,=SVC_Handler - bx r0 - .size SVC_Handler, . - SVC_Handler - - .align 1 - .thumb_func - .weak PendSV_Handler - .type PendSV_Handler, %function -PendSV_Handler: - ldr r0,=PendSV_Handler - bx r0 - .size PendSV_Handler, . - PendSV_Handler - - .align 1 - .thumb_func - .weak SysTick_Handler - .type SysTick_Handler, %function -SysTick_Handler: - ldr r0,=SysTick_Handler - bx r0 - .size SysTick_Handler, . - SysTick_Handler - - .align 1 - .thumb_func - .weak OR_IRQHandler - .type OR_IRQHandler, %function -OR_IRQHandler: - ldr r0,=OR_DriverIRQHandler - bx r0 - .size OR_IRQHandler, . - OR_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH0_IRQHandler - .type EDMA_0_CH0_IRQHandler, %function -EDMA_0_CH0_IRQHandler: - ldr r0,=EDMA_0_CH0_DriverIRQHandler - bx r0 - .size EDMA_0_CH0_IRQHandler, . - EDMA_0_CH0_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH1_IRQHandler - .type EDMA_0_CH1_IRQHandler, %function -EDMA_0_CH1_IRQHandler: - ldr r0,=EDMA_0_CH1_DriverIRQHandler - bx r0 - .size EDMA_0_CH1_IRQHandler, . - EDMA_0_CH1_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH2_IRQHandler - .type EDMA_0_CH2_IRQHandler, %function -EDMA_0_CH2_IRQHandler: - ldr r0,=EDMA_0_CH2_DriverIRQHandler - bx r0 - .size EDMA_0_CH2_IRQHandler, . - EDMA_0_CH2_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH3_IRQHandler - .type EDMA_0_CH3_IRQHandler, %function -EDMA_0_CH3_IRQHandler: - ldr r0,=EDMA_0_CH3_DriverIRQHandler - bx r0 - .size EDMA_0_CH3_IRQHandler, . - EDMA_0_CH3_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH4_IRQHandler - .type EDMA_0_CH4_IRQHandler, %function -EDMA_0_CH4_IRQHandler: - ldr r0,=EDMA_0_CH4_DriverIRQHandler - bx r0 - .size EDMA_0_CH4_IRQHandler, . - EDMA_0_CH4_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH5_IRQHandler - .type EDMA_0_CH5_IRQHandler, %function -EDMA_0_CH5_IRQHandler: - ldr r0,=EDMA_0_CH5_DriverIRQHandler - bx r0 - .size EDMA_0_CH5_IRQHandler, . - EDMA_0_CH5_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH6_IRQHandler - .type EDMA_0_CH6_IRQHandler, %function -EDMA_0_CH6_IRQHandler: - ldr r0,=EDMA_0_CH6_DriverIRQHandler - bx r0 - .size EDMA_0_CH6_IRQHandler, . - EDMA_0_CH6_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH7_IRQHandler - .type EDMA_0_CH7_IRQHandler, %function -EDMA_0_CH7_IRQHandler: - ldr r0,=EDMA_0_CH7_DriverIRQHandler - bx r0 - .size EDMA_0_CH7_IRQHandler, . - EDMA_0_CH7_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH8_IRQHandler - .type EDMA_0_CH8_IRQHandler, %function -EDMA_0_CH8_IRQHandler: - ldr r0,=EDMA_0_CH8_DriverIRQHandler - bx r0 - .size EDMA_0_CH8_IRQHandler, . - EDMA_0_CH8_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH9_IRQHandler - .type EDMA_0_CH9_IRQHandler, %function -EDMA_0_CH9_IRQHandler: - ldr r0,=EDMA_0_CH9_DriverIRQHandler - bx r0 - .size EDMA_0_CH9_IRQHandler, . - EDMA_0_CH9_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH10_IRQHandler - .type EDMA_0_CH10_IRQHandler, %function -EDMA_0_CH10_IRQHandler: - ldr r0,=EDMA_0_CH10_DriverIRQHandler - bx r0 - .size EDMA_0_CH10_IRQHandler, . - EDMA_0_CH10_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH11_IRQHandler - .type EDMA_0_CH11_IRQHandler, %function -EDMA_0_CH11_IRQHandler: - ldr r0,=EDMA_0_CH11_DriverIRQHandler - bx r0 - .size EDMA_0_CH11_IRQHandler, . - EDMA_0_CH11_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH12_IRQHandler - .type EDMA_0_CH12_IRQHandler, %function -EDMA_0_CH12_IRQHandler: - ldr r0,=EDMA_0_CH12_DriverIRQHandler - bx r0 - .size EDMA_0_CH12_IRQHandler, . - EDMA_0_CH12_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH13_IRQHandler - .type EDMA_0_CH13_IRQHandler, %function -EDMA_0_CH13_IRQHandler: - ldr r0,=EDMA_0_CH13_DriverIRQHandler - bx r0 - .size EDMA_0_CH13_IRQHandler, . - EDMA_0_CH13_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH14_IRQHandler - .type EDMA_0_CH14_IRQHandler, %function -EDMA_0_CH14_IRQHandler: - ldr r0,=EDMA_0_CH14_DriverIRQHandler - bx r0 - .size EDMA_0_CH14_IRQHandler, . - EDMA_0_CH14_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH15_IRQHandler - .type EDMA_0_CH15_IRQHandler, %function -EDMA_0_CH15_IRQHandler: - ldr r0,=EDMA_0_CH15_DriverIRQHandler - bx r0 - .size EDMA_0_CH15_IRQHandler, . - EDMA_0_CH15_IRQHandler - - .align 1 - .thumb_func - .weak GPIO00_IRQHandler - .type GPIO00_IRQHandler, %function -GPIO00_IRQHandler: - ldr r0,=GPIO00_DriverIRQHandler - bx r0 - .size GPIO00_IRQHandler, . - GPIO00_IRQHandler - - .align 1 - .thumb_func - .weak GPIO01_IRQHandler - .type GPIO01_IRQHandler, %function -GPIO01_IRQHandler: - ldr r0,=GPIO01_DriverIRQHandler - bx r0 - .size GPIO01_IRQHandler, . - GPIO01_IRQHandler - - .align 1 - .thumb_func - .weak GPIO10_IRQHandler - .type GPIO10_IRQHandler, %function -GPIO10_IRQHandler: - ldr r0,=GPIO10_DriverIRQHandler - bx r0 - .size GPIO10_IRQHandler, . - GPIO10_IRQHandler - - .align 1 - .thumb_func - .weak GPIO11_IRQHandler - .type GPIO11_IRQHandler, %function -GPIO11_IRQHandler: - ldr r0,=GPIO11_DriverIRQHandler - bx r0 - .size GPIO11_IRQHandler, . - GPIO11_IRQHandler - - .align 1 - .thumb_func - .weak GPIO20_IRQHandler - .type GPIO20_IRQHandler, %function -GPIO20_IRQHandler: - ldr r0,=GPIO20_DriverIRQHandler - bx r0 - .size GPIO20_IRQHandler, . - GPIO20_IRQHandler - - .align 1 - .thumb_func - .weak GPIO21_IRQHandler - .type GPIO21_IRQHandler, %function -GPIO21_IRQHandler: - ldr r0,=GPIO21_DriverIRQHandler - bx r0 - .size GPIO21_IRQHandler, . - GPIO21_IRQHandler - - .align 1 - .thumb_func - .weak GPIO30_IRQHandler - .type GPIO30_IRQHandler, %function -GPIO30_IRQHandler: - ldr r0,=GPIO30_DriverIRQHandler - bx r0 - .size GPIO30_IRQHandler, . - GPIO30_IRQHandler - - .align 1 - .thumb_func - .weak GPIO31_IRQHandler - .type GPIO31_IRQHandler, %function -GPIO31_IRQHandler: - ldr r0,=GPIO31_DriverIRQHandler - bx r0 - .size GPIO31_IRQHandler, . - GPIO31_IRQHandler - - .align 1 - .thumb_func - .weak GPIO40_IRQHandler - .type GPIO40_IRQHandler, %function -GPIO40_IRQHandler: - ldr r0,=GPIO40_DriverIRQHandler - bx r0 - .size GPIO40_IRQHandler, . - GPIO40_IRQHandler - - .align 1 - .thumb_func - .weak GPIO41_IRQHandler - .type GPIO41_IRQHandler, %function -GPIO41_IRQHandler: - ldr r0,=GPIO41_DriverIRQHandler - bx r0 - .size GPIO41_IRQHandler, . - GPIO41_IRQHandler - - .align 1 - .thumb_func - .weak GPIO50_IRQHandler - .type GPIO50_IRQHandler, %function -GPIO50_IRQHandler: - ldr r0,=GPIO50_DriverIRQHandler - bx r0 - .size GPIO50_IRQHandler, . - GPIO50_IRQHandler - - .align 1 - .thumb_func - .weak GPIO51_IRQHandler - .type GPIO51_IRQHandler, %function -GPIO51_IRQHandler: - ldr r0,=GPIO51_DriverIRQHandler - bx r0 - .size GPIO51_IRQHandler, . - GPIO51_IRQHandler - - .align 1 - .thumb_func - .weak UTICK0_IRQHandler - .type UTICK0_IRQHandler, %function -UTICK0_IRQHandler: - ldr r0,=UTICK0_DriverIRQHandler - bx r0 - .size UTICK0_IRQHandler, . - UTICK0_IRQHandler - - .align 1 - .thumb_func - .weak MRT0_IRQHandler - .type MRT0_IRQHandler, %function -MRT0_IRQHandler: - ldr r0,=MRT0_DriverIRQHandler - bx r0 - .size MRT0_IRQHandler, . - MRT0_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER0_IRQHandler - .type CTIMER0_IRQHandler, %function -CTIMER0_IRQHandler: - ldr r0,=CTIMER0_DriverIRQHandler - bx r0 - .size CTIMER0_IRQHandler, . - CTIMER0_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER1_IRQHandler - .type CTIMER1_IRQHandler, %function -CTIMER1_IRQHandler: - ldr r0,=CTIMER1_DriverIRQHandler - bx r0 - .size CTIMER1_IRQHandler, . - CTIMER1_IRQHandler - - .align 1 - .thumb_func - .weak SCT0_IRQHandler - .type SCT0_IRQHandler, %function -SCT0_IRQHandler: - ldr r0,=SCT0_DriverIRQHandler - bx r0 - .size SCT0_IRQHandler, . - SCT0_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER2_IRQHandler - .type CTIMER2_IRQHandler, %function -CTIMER2_IRQHandler: - ldr r0,=CTIMER2_DriverIRQHandler - bx r0 - .size CTIMER2_IRQHandler, . - CTIMER2_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM0_IRQHandler - .type LP_FLEXCOMM0_IRQHandler, %function -LP_FLEXCOMM0_IRQHandler: - ldr r0,=LP_FLEXCOMM0_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM0_IRQHandler, . - LP_FLEXCOMM0_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM1_IRQHandler - .type LP_FLEXCOMM1_IRQHandler, %function -LP_FLEXCOMM1_IRQHandler: - ldr r0,=LP_FLEXCOMM1_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM1_IRQHandler, . - LP_FLEXCOMM1_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM2_IRQHandler - .type LP_FLEXCOMM2_IRQHandler, %function -LP_FLEXCOMM2_IRQHandler: - ldr r0,=LP_FLEXCOMM2_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM2_IRQHandler, . - LP_FLEXCOMM2_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM3_IRQHandler - .type LP_FLEXCOMM3_IRQHandler, %function -LP_FLEXCOMM3_IRQHandler: - ldr r0,=LP_FLEXCOMM3_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM3_IRQHandler, . - LP_FLEXCOMM3_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM4_IRQHandler - .type LP_FLEXCOMM4_IRQHandler, %function -LP_FLEXCOMM4_IRQHandler: - ldr r0,=LP_FLEXCOMM4_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM4_IRQHandler, . - LP_FLEXCOMM4_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM5_IRQHandler - .type LP_FLEXCOMM5_IRQHandler, %function -LP_FLEXCOMM5_IRQHandler: - ldr r0,=LP_FLEXCOMM5_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM5_IRQHandler, . - LP_FLEXCOMM5_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM6_IRQHandler - .type LP_FLEXCOMM6_IRQHandler, %function -LP_FLEXCOMM6_IRQHandler: - ldr r0,=LP_FLEXCOMM6_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM6_IRQHandler, . - LP_FLEXCOMM6_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM7_IRQHandler - .type LP_FLEXCOMM7_IRQHandler, %function -LP_FLEXCOMM7_IRQHandler: - ldr r0,=LP_FLEXCOMM7_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM7_IRQHandler, . - LP_FLEXCOMM7_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM8_IRQHandler - .type LP_FLEXCOMM8_IRQHandler, %function -LP_FLEXCOMM8_IRQHandler: - ldr r0,=LP_FLEXCOMM8_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM8_IRQHandler, . - LP_FLEXCOMM8_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM9_IRQHandler - .type LP_FLEXCOMM9_IRQHandler, %function -LP_FLEXCOMM9_IRQHandler: - ldr r0,=LP_FLEXCOMM9_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM9_IRQHandler, . - LP_FLEXCOMM9_IRQHandler - - .align 1 - .thumb_func - .weak ADC0_IRQHandler - .type ADC0_IRQHandler, %function -ADC0_IRQHandler: - ldr r0,=ADC0_DriverIRQHandler - bx r0 - .size ADC0_IRQHandler, . - ADC0_IRQHandler - - .align 1 - .thumb_func - .weak ADC1_IRQHandler - .type ADC1_IRQHandler, %function -ADC1_IRQHandler: - ldr r0,=ADC1_DriverIRQHandler - bx r0 - .size ADC1_IRQHandler, . - ADC1_IRQHandler - - .align 1 - .thumb_func - .weak PINT0_IRQHandler - .type PINT0_IRQHandler, %function -PINT0_IRQHandler: - ldr r0,=PINT0_DriverIRQHandler - bx r0 - .size PINT0_IRQHandler, . - PINT0_IRQHandler - - .align 1 - .thumb_func - .weak PDM_EVENT_IRQHandler - .type PDM_EVENT_IRQHandler, %function -PDM_EVENT_IRQHandler: - ldr r0,=PDM_EVENT_DriverIRQHandler - bx r0 - .size PDM_EVENT_IRQHandler, . - PDM_EVENT_IRQHandler - - .align 1 - .thumb_func - .weak Reserved65_IRQHandler - .type Reserved65_IRQHandler, %function -Reserved65_IRQHandler: - ldr r0,=Reserved65_DriverIRQHandler - bx r0 - .size Reserved65_IRQHandler, . - Reserved65_IRQHandler - - .align 1 - .thumb_func - .weak USB0_FS_IRQHandler - .type USB0_FS_IRQHandler, %function -USB0_FS_IRQHandler: - ldr r0,=USB0_FS_DriverIRQHandler - bx r0 - .size USB0_FS_IRQHandler, . - USB0_FS_IRQHandler - - .align 1 - .thumb_func - .weak USB0_DCD_IRQHandler - .type USB0_DCD_IRQHandler, %function -USB0_DCD_IRQHandler: - ldr r0,=USB0_DCD_DriverIRQHandler - bx r0 - .size USB0_DCD_IRQHandler, . - USB0_DCD_IRQHandler - - .align 1 - .thumb_func - .weak RTC_IRQHandler - .type RTC_IRQHandler, %function -RTC_IRQHandler: - ldr r0,=RTC_DriverIRQHandler - bx r0 - .size RTC_IRQHandler, . - RTC_IRQHandler - - .align 1 - .thumb_func - .weak SMARTDMA_IRQHandler - .type SMARTDMA_IRQHandler, %function -SMARTDMA_IRQHandler: - ldr r0,=SMARTDMA_DriverIRQHandler - bx r0 - .size SMARTDMA_IRQHandler, . - SMARTDMA_IRQHandler - - .align 1 - .thumb_func - .weak MAILBOX_IRQHandler - .type MAILBOX_IRQHandler, %function -MAILBOX_IRQHandler: - ldr r0,=MAILBOX_DriverIRQHandler - bx r0 - .size MAILBOX_IRQHandler, . - MAILBOX_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER3_IRQHandler - .type CTIMER3_IRQHandler, %function -CTIMER3_IRQHandler: - ldr r0,=CTIMER3_DriverIRQHandler - bx r0 - .size CTIMER3_IRQHandler, . - CTIMER3_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER4_IRQHandler - .type CTIMER4_IRQHandler, %function -CTIMER4_IRQHandler: - ldr r0,=CTIMER4_DriverIRQHandler - bx r0 - .size CTIMER4_IRQHandler, . - CTIMER4_IRQHandler - - .align 1 - .thumb_func - .weak OS_EVENT_IRQHandler - .type OS_EVENT_IRQHandler, %function -OS_EVENT_IRQHandler: - ldr r0,=OS_EVENT_DriverIRQHandler - bx r0 - .size OS_EVENT_IRQHandler, . - OS_EVENT_IRQHandler - - .align 1 - .thumb_func - .weak FLEXSPI0_IRQHandler - .type FLEXSPI0_IRQHandler, %function -FLEXSPI0_IRQHandler: - ldr r0,=FLEXSPI0_DriverIRQHandler - bx r0 - .size FLEXSPI0_IRQHandler, . - FLEXSPI0_IRQHandler - - .align 1 - .thumb_func - .weak SAI0_IRQHandler - .type SAI0_IRQHandler, %function -SAI0_IRQHandler: - ldr r0,=SAI0_DriverIRQHandler - bx r0 - .size SAI0_IRQHandler, . - SAI0_IRQHandler - - .align 1 - .thumb_func - .weak SAI1_IRQHandler - .type SAI1_IRQHandler, %function -SAI1_IRQHandler: - ldr r0,=SAI1_DriverIRQHandler - bx r0 - .size SAI1_IRQHandler, . - SAI1_IRQHandler - - .align 1 - .thumb_func - .weak USDHC0_IRQHandler - .type USDHC0_IRQHandler, %function -USDHC0_IRQHandler: - ldr r0,=USDHC0_DriverIRQHandler - bx r0 - .size USDHC0_IRQHandler, . - USDHC0_IRQHandler - - .align 1 - .thumb_func - .weak CAN0_IRQHandler - .type CAN0_IRQHandler, %function -CAN0_IRQHandler: - ldr r0,=CAN0_DriverIRQHandler - bx r0 - .size CAN0_IRQHandler, . - CAN0_IRQHandler - - .align 1 - .thumb_func - .weak CAN1_IRQHandler - .type CAN1_IRQHandler, %function -CAN1_IRQHandler: - ldr r0,=CAN1_DriverIRQHandler - bx r0 - .size CAN1_IRQHandler, . - CAN1_IRQHandler - - .align 1 - .thumb_func - .weak Reserved80_IRQHandler - .type Reserved80_IRQHandler, %function -Reserved80_IRQHandler: - ldr r0,=Reserved80_DriverIRQHandler - bx r0 - .size Reserved80_IRQHandler, . - Reserved80_IRQHandler - - .align 1 - .thumb_func - .weak Reserved81_IRQHandler - .type Reserved81_IRQHandler, %function -Reserved81_IRQHandler: - ldr r0,=Reserved81_DriverIRQHandler - bx r0 - .size Reserved81_IRQHandler, . - Reserved81_IRQHandler - - .align 1 - .thumb_func - .weak USB1_HS_PHY_IRQHandler - .type USB1_HS_PHY_IRQHandler, %function -USB1_HS_PHY_IRQHandler: - ldr r0,=USB1_HS_PHY_DriverIRQHandler - bx r0 - .size USB1_HS_PHY_IRQHandler, . - USB1_HS_PHY_IRQHandler - - .align 1 - .thumb_func - .weak USB1_HS_IRQHandler - .type USB1_HS_IRQHandler, %function -USB1_HS_IRQHandler: - ldr r0,=USB1_HS_DriverIRQHandler - bx r0 - .size USB1_HS_IRQHandler, . - USB1_HS_IRQHandler - - .align 1 - .thumb_func - .weak SEC_HYPERVISOR_CALL_IRQHandler - .type SEC_HYPERVISOR_CALL_IRQHandler, %function -SEC_HYPERVISOR_CALL_IRQHandler: - ldr r0,=SEC_HYPERVISOR_CALL_DriverIRQHandler - bx r0 - .size SEC_HYPERVISOR_CALL_IRQHandler, . - SEC_HYPERVISOR_CALL_IRQHandler - - .align 1 - .thumb_func - .weak Reserved85_IRQHandler - .type Reserved85_IRQHandler, %function -Reserved85_IRQHandler: - ldr r0,=Reserved85_DriverIRQHandler - bx r0 - .size Reserved85_IRQHandler, . - Reserved85_IRQHandler - - .align 1 - .thumb_func - .weak PLU_IRQHandler - .type PLU_IRQHandler, %function -PLU_IRQHandler: - ldr r0,=PLU_DriverIRQHandler - bx r0 - .size PLU_IRQHandler, . - PLU_IRQHandler - - .align 1 - .thumb_func - .weak Freqme_IRQHandler - .type Freqme_IRQHandler, %function -Freqme_IRQHandler: - ldr r0,=Freqme_DriverIRQHandler - bx r0 - .size Freqme_IRQHandler, . - Freqme_IRQHandler - - .align 1 - .thumb_func - .weak SEC_VIO_IRQHandler - .type SEC_VIO_IRQHandler, %function -SEC_VIO_IRQHandler: - ldr r0,=SEC_VIO_DriverIRQHandler - bx r0 - .size SEC_VIO_IRQHandler, . - SEC_VIO_IRQHandler - - .align 1 - .thumb_func - .weak ELS_IRQHandler - .type ELS_IRQHandler, %function -ELS_IRQHandler: - ldr r0,=ELS_DriverIRQHandler - bx r0 - .size ELS_IRQHandler, . - ELS_IRQHandler - - .align 1 - .thumb_func - .weak PKC_IRQHandler - .type PKC_IRQHandler, %function -PKC_IRQHandler: - ldr r0,=PKC_DriverIRQHandler - bx r0 - .size PKC_IRQHandler, . - PKC_IRQHandler - - .align 1 - .thumb_func - .weak PUF_IRQHandler - .type PUF_IRQHandler, %function -PUF_IRQHandler: - ldr r0,=PUF_DriverIRQHandler - bx r0 - .size PUF_IRQHandler, . - PUF_IRQHandler - - .align 1 - .thumb_func - .weak PQ_IRQHandler - .type PQ_IRQHandler, %function -PQ_IRQHandler: - ldr r0,=PQ_DriverIRQHandler - bx r0 - .size PQ_IRQHandler, . - PQ_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH0_IRQHandler - .type EDMA_1_CH0_IRQHandler, %function -EDMA_1_CH0_IRQHandler: - ldr r0,=EDMA_1_CH0_DriverIRQHandler - bx r0 - .size EDMA_1_CH0_IRQHandler, . - EDMA_1_CH0_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH1_IRQHandler - .type EDMA_1_CH1_IRQHandler, %function -EDMA_1_CH1_IRQHandler: - ldr r0,=EDMA_1_CH1_DriverIRQHandler - bx r0 - .size EDMA_1_CH1_IRQHandler, . - EDMA_1_CH1_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH2_IRQHandler - .type EDMA_1_CH2_IRQHandler, %function -EDMA_1_CH2_IRQHandler: - ldr r0,=EDMA_1_CH2_DriverIRQHandler - bx r0 - .size EDMA_1_CH2_IRQHandler, . - EDMA_1_CH2_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH3_IRQHandler - .type EDMA_1_CH3_IRQHandler, %function -EDMA_1_CH3_IRQHandler: - ldr r0,=EDMA_1_CH3_DriverIRQHandler - bx r0 - .size EDMA_1_CH3_IRQHandler, . - EDMA_1_CH3_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH4_IRQHandler - .type EDMA_1_CH4_IRQHandler, %function -EDMA_1_CH4_IRQHandler: - ldr r0,=EDMA_1_CH4_DriverIRQHandler - bx r0 - .size EDMA_1_CH4_IRQHandler, . - EDMA_1_CH4_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH5_IRQHandler - .type EDMA_1_CH5_IRQHandler, %function -EDMA_1_CH5_IRQHandler: - ldr r0,=EDMA_1_CH5_DriverIRQHandler - bx r0 - .size EDMA_1_CH5_IRQHandler, . - EDMA_1_CH5_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH6_IRQHandler - .type EDMA_1_CH6_IRQHandler, %function -EDMA_1_CH6_IRQHandler: - ldr r0,=EDMA_1_CH6_DriverIRQHandler - bx r0 - .size EDMA_1_CH6_IRQHandler, . - EDMA_1_CH6_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH7_IRQHandler - .type EDMA_1_CH7_IRQHandler, %function -EDMA_1_CH7_IRQHandler: - ldr r0,=EDMA_1_CH7_DriverIRQHandler - bx r0 - .size EDMA_1_CH7_IRQHandler, . - EDMA_1_CH7_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH8_IRQHandler - .type EDMA_1_CH8_IRQHandler, %function -EDMA_1_CH8_IRQHandler: - ldr r0,=EDMA_1_CH8_DriverIRQHandler - bx r0 - .size EDMA_1_CH8_IRQHandler, . - EDMA_1_CH8_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH9_IRQHandler - .type EDMA_1_CH9_IRQHandler, %function -EDMA_1_CH9_IRQHandler: - ldr r0,=EDMA_1_CH9_DriverIRQHandler - bx r0 - .size EDMA_1_CH9_IRQHandler, . - EDMA_1_CH9_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH10_IRQHandler - .type EDMA_1_CH10_IRQHandler, %function -EDMA_1_CH10_IRQHandler: - ldr r0,=EDMA_1_CH10_DriverIRQHandler - bx r0 - .size EDMA_1_CH10_IRQHandler, . - EDMA_1_CH10_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH11_IRQHandler - .type EDMA_1_CH11_IRQHandler, %function -EDMA_1_CH11_IRQHandler: - ldr r0,=EDMA_1_CH11_DriverIRQHandler - bx r0 - .size EDMA_1_CH11_IRQHandler, . - EDMA_1_CH11_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH12_IRQHandler - .type EDMA_1_CH12_IRQHandler, %function -EDMA_1_CH12_IRQHandler: - ldr r0,=EDMA_1_CH12_DriverIRQHandler - bx r0 - .size EDMA_1_CH12_IRQHandler, . - EDMA_1_CH12_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH13_IRQHandler - .type EDMA_1_CH13_IRQHandler, %function -EDMA_1_CH13_IRQHandler: - ldr r0,=EDMA_1_CH13_DriverIRQHandler - bx r0 - .size EDMA_1_CH13_IRQHandler, . - EDMA_1_CH13_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH14_IRQHandler - .type EDMA_1_CH14_IRQHandler, %function -EDMA_1_CH14_IRQHandler: - ldr r0,=EDMA_1_CH14_DriverIRQHandler - bx r0 - .size EDMA_1_CH14_IRQHandler, . - EDMA_1_CH14_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH15_IRQHandler - .type EDMA_1_CH15_IRQHandler, %function -EDMA_1_CH15_IRQHandler: - ldr r0,=EDMA_1_CH15_DriverIRQHandler - bx r0 - .size EDMA_1_CH15_IRQHandler, . - EDMA_1_CH15_IRQHandler - - .align 1 - .thumb_func - .weak CDOG0_IRQHandler - .type CDOG0_IRQHandler, %function -CDOG0_IRQHandler: - ldr r0,=CDOG0_DriverIRQHandler - bx r0 - .size CDOG0_IRQHandler, . - CDOG0_IRQHandler - - .align 1 - .thumb_func - .weak CDOG1_IRQHandler - .type CDOG1_IRQHandler, %function -CDOG1_IRQHandler: - ldr r0,=CDOG1_DriverIRQHandler - bx r0 - .size CDOG1_IRQHandler, . - CDOG1_IRQHandler - - .align 1 - .thumb_func - .weak I3C0_IRQHandler - .type I3C0_IRQHandler, %function -I3C0_IRQHandler: - ldr r0,=I3C0_DriverIRQHandler - bx r0 - .size I3C0_IRQHandler, . - I3C0_IRQHandler - - .align 1 - .thumb_func - .weak I3C1_IRQHandler - .type I3C1_IRQHandler, %function -I3C1_IRQHandler: - ldr r0,=I3C1_DriverIRQHandler - bx r0 - .size I3C1_IRQHandler, . - I3C1_IRQHandler - - .align 1 - .thumb_func - .weak NPU_IRQHandler - .type NPU_IRQHandler, %function -NPU_IRQHandler: - ldr r0,=NPU_DriverIRQHandler - bx r0 - .size NPU_IRQHandler, . - NPU_IRQHandler - - .align 1 - .thumb_func - .weak GDET_IRQHandler - .type GDET_IRQHandler, %function -GDET_IRQHandler: - ldr r0,=GDET_DriverIRQHandler - bx r0 - .size GDET_IRQHandler, . - GDET_IRQHandler - - .align 1 - .thumb_func - .weak VBAT0_IRQHandler - .type VBAT0_IRQHandler, %function -VBAT0_IRQHandler: - ldr r0,=VBAT0_DriverIRQHandler - bx r0 - .size VBAT0_IRQHandler, . - VBAT0_IRQHandler - - .align 1 - .thumb_func - .weak EWM0_IRQHandler - .type EWM0_IRQHandler, %function -EWM0_IRQHandler: - ldr r0,=EWM0_DriverIRQHandler - bx r0 - .size EWM0_IRQHandler, . - EWM0_IRQHandler - - .align 1 - .thumb_func - .weak TSI_END_OF_SCAN_IRQHandler - .type TSI_END_OF_SCAN_IRQHandler, %function -TSI_END_OF_SCAN_IRQHandler: - ldr r0,=TSI_END_OF_SCAN_DriverIRQHandler - bx r0 - .size TSI_END_OF_SCAN_IRQHandler, . - TSI_END_OF_SCAN_IRQHandler - - .align 1 - .thumb_func - .weak TSI_OUT_OF_SCAN_IRQHandler - .type TSI_OUT_OF_SCAN_IRQHandler, %function -TSI_OUT_OF_SCAN_IRQHandler: - ldr r0,=TSI_OUT_OF_SCAN_DriverIRQHandler - bx r0 - .size TSI_OUT_OF_SCAN_IRQHandler, . - TSI_OUT_OF_SCAN_IRQHandler - - .align 1 - .thumb_func - .weak EMVSIM0_IRQHandler - .type EMVSIM0_IRQHandler, %function -EMVSIM0_IRQHandler: - ldr r0,=EMVSIM0_DriverIRQHandler - bx r0 - .size EMVSIM0_IRQHandler, . - EMVSIM0_IRQHandler - - .align 1 - .thumb_func - .weak EMVSIM1_IRQHandler - .type EMVSIM1_IRQHandler, %function -EMVSIM1_IRQHandler: - ldr r0,=EMVSIM1_DriverIRQHandler - bx r0 - .size EMVSIM1_IRQHandler, . - EMVSIM1_IRQHandler - - .align 1 - .thumb_func - .weak FLEXIO_IRQHandler - .type FLEXIO_IRQHandler, %function -FLEXIO_IRQHandler: - ldr r0,=FLEXIO_DriverIRQHandler - bx r0 - .size FLEXIO_IRQHandler, . - FLEXIO_IRQHandler - - .align 1 - .thumb_func - .weak DAC0_IRQHandler - .type DAC0_IRQHandler, %function -DAC0_IRQHandler: - ldr r0,=DAC0_DriverIRQHandler - bx r0 - .size DAC0_IRQHandler, . - DAC0_IRQHandler - - .align 1 - .thumb_func - .weak DAC1_IRQHandler - .type DAC1_IRQHandler, %function -DAC1_IRQHandler: - ldr r0,=DAC1_DriverIRQHandler - bx r0 - .size DAC1_IRQHandler, . - DAC1_IRQHandler - - .align 1 - .thumb_func - .weak DAC2_IRQHandler - .type DAC2_IRQHandler, %function -DAC2_IRQHandler: - ldr r0,=DAC2_DriverIRQHandler - bx r0 - .size DAC2_IRQHandler, . - DAC2_IRQHandler - - .align 1 - .thumb_func - .weak HSCMP0_IRQHandler - .type HSCMP0_IRQHandler, %function -HSCMP0_IRQHandler: - ldr r0,=HSCMP0_DriverIRQHandler - bx r0 - .size HSCMP0_IRQHandler, . - HSCMP0_IRQHandler - - .align 1 - .thumb_func - .weak HSCMP1_IRQHandler - .type HSCMP1_IRQHandler, %function -HSCMP1_IRQHandler: - ldr r0,=HSCMP1_DriverIRQHandler - bx r0 - .size HSCMP1_IRQHandler, . - HSCMP1_IRQHandler - - .align 1 - .thumb_func - .weak HSCMP2_IRQHandler - .type HSCMP2_IRQHandler, %function -HSCMP2_IRQHandler: - ldr r0,=HSCMP2_DriverIRQHandler - bx r0 - .size HSCMP2_IRQHandler, . - HSCMP2_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_RELOAD_ERROR_IRQHandler - .type FLEXPWM0_RELOAD_ERROR_IRQHandler, %function -FLEXPWM0_RELOAD_ERROR_IRQHandler: - ldr r0,=FLEXPWM0_RELOAD_ERROR_DriverIRQHandler - bx r0 - .size FLEXPWM0_RELOAD_ERROR_IRQHandler, . - FLEXPWM0_RELOAD_ERROR_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_FAULT_IRQHandler - .type FLEXPWM0_FAULT_IRQHandler, %function -FLEXPWM0_FAULT_IRQHandler: - ldr r0,=FLEXPWM0_FAULT_DriverIRQHandler - bx r0 - .size FLEXPWM0_FAULT_IRQHandler, . - FLEXPWM0_FAULT_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE0_IRQHandler - .type FLEXPWM0_SUBMODULE0_IRQHandler, %function -FLEXPWM0_SUBMODULE0_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE0_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE0_IRQHandler, . - FLEXPWM0_SUBMODULE0_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE1_IRQHandler - .type FLEXPWM0_SUBMODULE1_IRQHandler, %function -FLEXPWM0_SUBMODULE1_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE1_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE1_IRQHandler, . - FLEXPWM0_SUBMODULE1_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE2_IRQHandler - .type FLEXPWM0_SUBMODULE2_IRQHandler, %function -FLEXPWM0_SUBMODULE2_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE2_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE2_IRQHandler, . - FLEXPWM0_SUBMODULE2_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE3_IRQHandler - .type FLEXPWM0_SUBMODULE3_IRQHandler, %function -FLEXPWM0_SUBMODULE3_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE3_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE3_IRQHandler, . - FLEXPWM0_SUBMODULE3_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_RELOAD_ERROR_IRQHandler - .type FLEXPWM1_RELOAD_ERROR_IRQHandler, %function -FLEXPWM1_RELOAD_ERROR_IRQHandler: - ldr r0,=FLEXPWM1_RELOAD_ERROR_DriverIRQHandler - bx r0 - .size FLEXPWM1_RELOAD_ERROR_IRQHandler, . - FLEXPWM1_RELOAD_ERROR_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_FAULT_IRQHandler - .type FLEXPWM1_FAULT_IRQHandler, %function -FLEXPWM1_FAULT_IRQHandler: - ldr r0,=FLEXPWM1_FAULT_DriverIRQHandler - bx r0 - .size FLEXPWM1_FAULT_IRQHandler, . - FLEXPWM1_FAULT_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_SUBMODULE0_IRQHandler - .type FLEXPWM1_SUBMODULE0_IRQHandler, %function -FLEXPWM1_SUBMODULE0_IRQHandler: - ldr r0,=FLEXPWM1_SUBMODULE0_DriverIRQHandler - bx r0 - .size FLEXPWM1_SUBMODULE0_IRQHandler, . - FLEXPWM1_SUBMODULE0_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_SUBMODULE1_IRQHandler - .type FLEXPWM1_SUBMODULE1_IRQHandler, %function -FLEXPWM1_SUBMODULE1_IRQHandler: - ldr r0,=FLEXPWM1_SUBMODULE1_DriverIRQHandler - bx r0 - .size FLEXPWM1_SUBMODULE1_IRQHandler, . - FLEXPWM1_SUBMODULE1_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_SUBMODULE2_IRQHandler - .type FLEXPWM1_SUBMODULE2_IRQHandler, %function -FLEXPWM1_SUBMODULE2_IRQHandler: - ldr r0,=FLEXPWM1_SUBMODULE2_DriverIRQHandler - bx r0 - .size FLEXPWM1_SUBMODULE2_IRQHandler, . - FLEXPWM1_SUBMODULE2_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_SUBMODULE3_IRQHandler - .type FLEXPWM1_SUBMODULE3_IRQHandler, %function -FLEXPWM1_SUBMODULE3_IRQHandler: - ldr r0,=FLEXPWM1_SUBMODULE3_DriverIRQHandler - bx r0 - .size FLEXPWM1_SUBMODULE3_IRQHandler, . - FLEXPWM1_SUBMODULE3_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_COMPARE_IRQHandler - .type QDC0_COMPARE_IRQHandler, %function -QDC0_COMPARE_IRQHandler: - ldr r0,=QDC0_COMPARE_DriverIRQHandler - bx r0 - .size QDC0_COMPARE_IRQHandler, . - QDC0_COMPARE_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_HOME_IRQHandler - .type QDC0_HOME_IRQHandler, %function -QDC0_HOME_IRQHandler: - ldr r0,=QDC0_HOME_DriverIRQHandler - bx r0 - .size QDC0_HOME_IRQHandler, . - QDC0_HOME_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_WDG_SAB_IRQHandler - .type QDC0_WDG_SAB_IRQHandler, %function -QDC0_WDG_SAB_IRQHandler: - ldr r0,=QDC0_WDG_SAB_DriverIRQHandler - bx r0 - .size QDC0_WDG_SAB_IRQHandler, . - QDC0_WDG_SAB_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_IDX_IRQHandler - .type QDC0_IDX_IRQHandler, %function -QDC0_IDX_IRQHandler: - ldr r0,=QDC0_IDX_DriverIRQHandler - bx r0 - .size QDC0_IDX_IRQHandler, . - QDC0_IDX_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_COMPARE_IRQHandler - .type QDC1_COMPARE_IRQHandler, %function -QDC1_COMPARE_IRQHandler: - ldr r0,=QDC1_COMPARE_DriverIRQHandler - bx r0 - .size QDC1_COMPARE_IRQHandler, . - QDC1_COMPARE_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_HOME_IRQHandler - .type QDC1_HOME_IRQHandler, %function -QDC1_HOME_IRQHandler: - ldr r0,=QDC1_HOME_DriverIRQHandler - bx r0 - .size QDC1_HOME_IRQHandler, . - QDC1_HOME_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_WDG_SAB_IRQHandler - .type QDC1_WDG_SAB_IRQHandler, %function -QDC1_WDG_SAB_IRQHandler: - ldr r0,=QDC1_WDG_SAB_DriverIRQHandler - bx r0 - .size QDC1_WDG_SAB_IRQHandler, . - QDC1_WDG_SAB_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_IDX_IRQHandler - .type QDC1_IDX_IRQHandler, %function -QDC1_IDX_IRQHandler: - ldr r0,=QDC1_IDX_DriverIRQHandler - bx r0 - .size QDC1_IDX_IRQHandler, . - QDC1_IDX_IRQHandler - - .align 1 - .thumb_func - .weak ITRC0_IRQHandler - .type ITRC0_IRQHandler, %function -ITRC0_IRQHandler: - ldr r0,=ITRC0_DriverIRQHandler - bx r0 - .size ITRC0_IRQHandler, . - ITRC0_IRQHandler - - .align 1 - .thumb_func - .weak BSP32_IRQHandler - .type BSP32_IRQHandler, %function -BSP32_IRQHandler: - ldr r0,=BSP32_DriverIRQHandler - bx r0 - .size BSP32_IRQHandler, . - BSP32_IRQHandler - - .align 1 - .thumb_func - .weak ELS_ERR_IRQHandler - .type ELS_ERR_IRQHandler, %function -ELS_ERR_IRQHandler: - ldr r0,=ELS_ERR_DriverIRQHandler - bx r0 - .size ELS_ERR_IRQHandler, . - ELS_ERR_IRQHandler - - .align 1 - .thumb_func - .weak PKC_ERR_IRQHandler - .type PKC_ERR_IRQHandler, %function -PKC_ERR_IRQHandler: - ldr r0,=PKC_ERR_DriverIRQHandler - bx r0 - .size PKC_ERR_IRQHandler, . - PKC_ERR_IRQHandler - - .align 1 - .thumb_func - .weak ERM_SINGLE_BIT_ERROR_IRQHandler - .type ERM_SINGLE_BIT_ERROR_IRQHandler, %function -ERM_SINGLE_BIT_ERROR_IRQHandler: - ldr r0,=ERM_SINGLE_BIT_ERROR_DriverIRQHandler - bx r0 - .size ERM_SINGLE_BIT_ERROR_IRQHandler, . - ERM_SINGLE_BIT_ERROR_IRQHandler - - .align 1 - .thumb_func - .weak ERM_MULTI_BIT_ERROR_IRQHandler - .type ERM_MULTI_BIT_ERROR_IRQHandler, %function -ERM_MULTI_BIT_ERROR_IRQHandler: - ldr r0,=ERM_MULTI_BIT_ERROR_DriverIRQHandler - bx r0 - .size ERM_MULTI_BIT_ERROR_IRQHandler, . - ERM_MULTI_BIT_ERROR_IRQHandler - - .align 1 - .thumb_func - .weak FMU0_IRQHandler - .type FMU0_IRQHandler, %function -FMU0_IRQHandler: - ldr r0,=FMU0_DriverIRQHandler - bx r0 - .size FMU0_IRQHandler, . - FMU0_IRQHandler - - .align 1 - .thumb_func - .weak ETHERNET_IRQHandler - .type ETHERNET_IRQHandler, %function -ETHERNET_IRQHandler: - ldr r0,=ETHERNET_DriverIRQHandler - bx r0 - .size ETHERNET_IRQHandler, . - ETHERNET_IRQHandler - - .align 1 - .thumb_func - .weak ETHERNET_PMT_IRQHandler - .type ETHERNET_PMT_IRQHandler, %function -ETHERNET_PMT_IRQHandler: - ldr r0,=ETHERNET_PMT_DriverIRQHandler - bx r0 - .size ETHERNET_PMT_IRQHandler, . - ETHERNET_PMT_IRQHandler - - .align 1 - .thumb_func - .weak ETHERNET_MACLP_IRQHandler - .type ETHERNET_MACLP_IRQHandler, %function -ETHERNET_MACLP_IRQHandler: - ldr r0,=ETHERNET_MACLP_DriverIRQHandler - bx r0 - .size ETHERNET_MACLP_IRQHandler, . - ETHERNET_MACLP_IRQHandler - - .align 1 - .thumb_func - .weak SINC_FILTER_IRQHandler - .type SINC_FILTER_IRQHandler, %function -SINC_FILTER_IRQHandler: - ldr r0,=SINC_FILTER_DriverIRQHandler - bx r0 - .size SINC_FILTER_IRQHandler, . - SINC_FILTER_IRQHandler - - .align 1 - .thumb_func - .weak LPTMR0_IRQHandler - .type LPTMR0_IRQHandler, %function -LPTMR0_IRQHandler: - ldr r0,=LPTMR0_DriverIRQHandler - bx r0 - .size LPTMR0_IRQHandler, . - LPTMR0_IRQHandler - - .align 1 - .thumb_func - .weak LPTMR1_IRQHandler - .type LPTMR1_IRQHandler, %function -LPTMR1_IRQHandler: - ldr r0,=LPTMR1_DriverIRQHandler - bx r0 - .size LPTMR1_IRQHandler, . - LPTMR1_IRQHandler - - .align 1 - .thumb_func - .weak SCG_IRQHandler - .type SCG_IRQHandler, %function -SCG_IRQHandler: - ldr r0,=SCG_DriverIRQHandler - bx r0 - .size SCG_IRQHandler, . - SCG_IRQHandler - - .align 1 - .thumb_func - .weak SPC_IRQHandler - .type SPC_IRQHandler, %function -SPC_IRQHandler: - ldr r0,=SPC_DriverIRQHandler - bx r0 - .size SPC_IRQHandler, . - SPC_IRQHandler - - .align 1 - .thumb_func - .weak WUU_IRQHandler - .type WUU_IRQHandler, %function -WUU_IRQHandler: - ldr r0,=WUU_DriverIRQHandler - bx r0 - .size WUU_IRQHandler, . - WUU_IRQHandler - - .align 1 - .thumb_func - .weak PORT_EFT_IRQHandler - .type PORT_EFT_IRQHandler, %function -PORT_EFT_IRQHandler: - ldr r0,=PORT_EFT_DriverIRQHandler - bx r0 - .size PORT_EFT_IRQHandler, . - PORT_EFT_IRQHandler - - .align 1 - .thumb_func - .weak ETB0_IRQHandler - .type ETB0_IRQHandler, %function -ETB0_IRQHandler: - ldr r0,=ETB0_DriverIRQHandler - bx r0 - .size ETB0_IRQHandler, . - ETB0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved166_IRQHandler - .type Reserved166_IRQHandler, %function -Reserved166_IRQHandler: - ldr r0,=Reserved166_DriverIRQHandler - bx r0 - .size Reserved166_IRQHandler, . - Reserved166_IRQHandler - - .align 1 - .thumb_func - .weak Reserved167_IRQHandler - .type Reserved167_IRQHandler, %function -Reserved167_IRQHandler: - ldr r0,=Reserved167_DriverIRQHandler - bx r0 - .size Reserved167_IRQHandler, . - Reserved167_IRQHandler - - .align 1 - .thumb_func - .weak WWDT0_IRQHandler - .type WWDT0_IRQHandler, %function -WWDT0_IRQHandler: - ldr r0,=WWDT0_DriverIRQHandler - bx r0 - .size WWDT0_IRQHandler, . - WWDT0_IRQHandler - - .align 1 - .thumb_func - .weak WWDT1_IRQHandler - .type WWDT1_IRQHandler, %function -WWDT1_IRQHandler: - ldr r0,=WWDT1_DriverIRQHandler - bx r0 - .size WWDT1_IRQHandler, . - WWDT1_IRQHandler - - .align 1 - .thumb_func - .weak CMC0_IRQHandler - .type CMC0_IRQHandler, %function -CMC0_IRQHandler: - ldr r0,=CMC0_DriverIRQHandler - bx r0 - .size CMC0_IRQHandler, . - CMC0_IRQHandler - - .align 1 - .thumb_func - .weak CTI0_IRQHandler - .type CTI0_IRQHandler, %function -CTI0_IRQHandler: - ldr r0,=CTI0_DriverIRQHandler - bx r0 - .size CTI0_IRQHandler, . - CTI0_IRQHandler - - -/* Macro to define default handlers. Default handler - * will be weak symbol and just dead loops. They can be - * overwritten by other handlers */ - .macro def_irq_handler handler_name - .weak \handler_name - .set \handler_name, DefaultISR - .endm - -/* Exception Handlers */ - def_irq_handler MemManage_Handler - def_irq_handler BusFault_Handler - def_irq_handler UsageFault_Handler - def_irq_handler SecureFault_Handler - def_irq_handler DebugMon_Handler - def_irq_handler OR_DriverIRQHandler - def_irq_handler EDMA_0_CH0_DriverIRQHandler - def_irq_handler EDMA_0_CH1_DriverIRQHandler - def_irq_handler EDMA_0_CH2_DriverIRQHandler - def_irq_handler EDMA_0_CH3_DriverIRQHandler - def_irq_handler EDMA_0_CH4_DriverIRQHandler - def_irq_handler EDMA_0_CH5_DriverIRQHandler - def_irq_handler EDMA_0_CH6_DriverIRQHandler - def_irq_handler EDMA_0_CH7_DriverIRQHandler - def_irq_handler EDMA_0_CH8_DriverIRQHandler - def_irq_handler EDMA_0_CH9_DriverIRQHandler - def_irq_handler EDMA_0_CH10_DriverIRQHandler - def_irq_handler EDMA_0_CH11_DriverIRQHandler - def_irq_handler EDMA_0_CH12_DriverIRQHandler - def_irq_handler EDMA_0_CH13_DriverIRQHandler - def_irq_handler EDMA_0_CH14_DriverIRQHandler - def_irq_handler EDMA_0_CH15_DriverIRQHandler - def_irq_handler GPIO00_DriverIRQHandler - def_irq_handler GPIO01_DriverIRQHandler - def_irq_handler GPIO10_DriverIRQHandler - def_irq_handler GPIO11_DriverIRQHandler - def_irq_handler GPIO20_DriverIRQHandler - def_irq_handler GPIO21_DriverIRQHandler - def_irq_handler GPIO30_DriverIRQHandler - def_irq_handler GPIO31_DriverIRQHandler - def_irq_handler GPIO40_DriverIRQHandler - def_irq_handler GPIO41_DriverIRQHandler - def_irq_handler GPIO50_DriverIRQHandler - def_irq_handler GPIO51_DriverIRQHandler - def_irq_handler UTICK0_DriverIRQHandler - def_irq_handler MRT0_DriverIRQHandler - def_irq_handler CTIMER0_DriverIRQHandler - def_irq_handler CTIMER1_DriverIRQHandler - def_irq_handler SCT0_DriverIRQHandler - def_irq_handler CTIMER2_DriverIRQHandler - def_irq_handler LP_FLEXCOMM0_DriverIRQHandler - def_irq_handler LP_FLEXCOMM1_DriverIRQHandler - def_irq_handler LP_FLEXCOMM2_DriverIRQHandler - def_irq_handler LP_FLEXCOMM3_DriverIRQHandler - def_irq_handler LP_FLEXCOMM4_DriverIRQHandler - def_irq_handler LP_FLEXCOMM5_DriverIRQHandler - def_irq_handler LP_FLEXCOMM6_DriverIRQHandler - def_irq_handler LP_FLEXCOMM7_DriverIRQHandler - def_irq_handler LP_FLEXCOMM8_DriverIRQHandler - def_irq_handler LP_FLEXCOMM9_DriverIRQHandler - def_irq_handler ADC0_DriverIRQHandler - def_irq_handler ADC1_DriverIRQHandler - def_irq_handler PINT0_DriverIRQHandler - def_irq_handler PDM_EVENT_DriverIRQHandler - def_irq_handler Reserved65_DriverIRQHandler - def_irq_handler USB0_FS_DriverIRQHandler - def_irq_handler USB0_DCD_DriverIRQHandler - def_irq_handler RTC_DriverIRQHandler - def_irq_handler SMARTDMA_DriverIRQHandler - def_irq_handler MAILBOX_DriverIRQHandler - def_irq_handler CTIMER3_DriverIRQHandler - def_irq_handler CTIMER4_DriverIRQHandler - def_irq_handler OS_EVENT_DriverIRQHandler - def_irq_handler FLEXSPI0_DriverIRQHandler - def_irq_handler SAI0_DriverIRQHandler - def_irq_handler SAI1_DriverIRQHandler - def_irq_handler USDHC0_DriverIRQHandler - def_irq_handler CAN0_DriverIRQHandler - def_irq_handler CAN1_DriverIRQHandler - def_irq_handler Reserved80_DriverIRQHandler - def_irq_handler Reserved81_DriverIRQHandler - def_irq_handler USB1_HS_PHY_DriverIRQHandler - def_irq_handler USB1_HS_DriverIRQHandler - def_irq_handler SEC_HYPERVISOR_CALL_DriverIRQHandler - def_irq_handler Reserved85_DriverIRQHandler - def_irq_handler PLU_DriverIRQHandler - def_irq_handler Freqme_DriverIRQHandler - def_irq_handler SEC_VIO_DriverIRQHandler - def_irq_handler ELS_DriverIRQHandler - def_irq_handler PKC_DriverIRQHandler - def_irq_handler PUF_DriverIRQHandler - def_irq_handler PQ_DriverIRQHandler - def_irq_handler EDMA_1_CH0_DriverIRQHandler - def_irq_handler EDMA_1_CH1_DriverIRQHandler - def_irq_handler EDMA_1_CH2_DriverIRQHandler - def_irq_handler EDMA_1_CH3_DriverIRQHandler - def_irq_handler EDMA_1_CH4_DriverIRQHandler - def_irq_handler EDMA_1_CH5_DriverIRQHandler - def_irq_handler EDMA_1_CH6_DriverIRQHandler - def_irq_handler EDMA_1_CH7_DriverIRQHandler - def_irq_handler EDMA_1_CH8_DriverIRQHandler - def_irq_handler EDMA_1_CH9_DriverIRQHandler - def_irq_handler EDMA_1_CH10_DriverIRQHandler - def_irq_handler EDMA_1_CH11_DriverIRQHandler - def_irq_handler EDMA_1_CH12_DriverIRQHandler - def_irq_handler EDMA_1_CH13_DriverIRQHandler - def_irq_handler EDMA_1_CH14_DriverIRQHandler - def_irq_handler EDMA_1_CH15_DriverIRQHandler - def_irq_handler CDOG0_DriverIRQHandler - def_irq_handler CDOG1_DriverIRQHandler - def_irq_handler I3C0_DriverIRQHandler - def_irq_handler I3C1_DriverIRQHandler - def_irq_handler NPU_DriverIRQHandler - def_irq_handler GDET_DriverIRQHandler - def_irq_handler VBAT0_DriverIRQHandler - def_irq_handler EWM0_DriverIRQHandler - def_irq_handler TSI_END_OF_SCAN_DriverIRQHandler - def_irq_handler TSI_OUT_OF_SCAN_DriverIRQHandler - def_irq_handler EMVSIM0_DriverIRQHandler - def_irq_handler EMVSIM1_DriverIRQHandler - def_irq_handler FLEXIO_DriverIRQHandler - def_irq_handler DAC0_DriverIRQHandler - def_irq_handler DAC1_DriverIRQHandler - def_irq_handler DAC2_DriverIRQHandler - def_irq_handler HSCMP0_DriverIRQHandler - def_irq_handler HSCMP1_DriverIRQHandler - def_irq_handler HSCMP2_DriverIRQHandler - def_irq_handler FLEXPWM0_RELOAD_ERROR_DriverIRQHandler - def_irq_handler FLEXPWM0_FAULT_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE0_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE1_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE2_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE3_DriverIRQHandler - def_irq_handler FLEXPWM1_RELOAD_ERROR_DriverIRQHandler - def_irq_handler FLEXPWM1_FAULT_DriverIRQHandler - def_irq_handler FLEXPWM1_SUBMODULE0_DriverIRQHandler - def_irq_handler FLEXPWM1_SUBMODULE1_DriverIRQHandler - def_irq_handler FLEXPWM1_SUBMODULE2_DriverIRQHandler - def_irq_handler FLEXPWM1_SUBMODULE3_DriverIRQHandler - def_irq_handler QDC0_COMPARE_DriverIRQHandler - def_irq_handler QDC0_HOME_DriverIRQHandler - def_irq_handler QDC0_WDG_SAB_DriverIRQHandler - def_irq_handler QDC0_IDX_DriverIRQHandler - def_irq_handler QDC1_COMPARE_DriverIRQHandler - def_irq_handler QDC1_HOME_DriverIRQHandler - def_irq_handler QDC1_WDG_SAB_DriverIRQHandler - def_irq_handler QDC1_IDX_DriverIRQHandler - def_irq_handler ITRC0_DriverIRQHandler - def_irq_handler BSP32_DriverIRQHandler - def_irq_handler ELS_ERR_DriverIRQHandler - def_irq_handler PKC_ERR_DriverIRQHandler - def_irq_handler ERM_SINGLE_BIT_ERROR_DriverIRQHandler - def_irq_handler ERM_MULTI_BIT_ERROR_DriverIRQHandler - def_irq_handler FMU0_DriverIRQHandler - def_irq_handler ETHERNET_DriverIRQHandler - def_irq_handler ETHERNET_PMT_DriverIRQHandler - def_irq_handler ETHERNET_MACLP_DriverIRQHandler - def_irq_handler SINC_FILTER_DriverIRQHandler - def_irq_handler LPTMR0_DriverIRQHandler - def_irq_handler LPTMR1_DriverIRQHandler - def_irq_handler SCG_DriverIRQHandler - def_irq_handler SPC_DriverIRQHandler - def_irq_handler WUU_DriverIRQHandler - def_irq_handler PORT_EFT_DriverIRQHandler - def_irq_handler ETB0_DriverIRQHandler - def_irq_handler Reserved166_DriverIRQHandler - def_irq_handler Reserved167_DriverIRQHandler - def_irq_handler WWDT0_DriverIRQHandler - def_irq_handler WWDT1_DriverIRQHandler - def_irq_handler CMC0_DriverIRQHandler - def_irq_handler CTI0_DriverIRQHandler - - .end diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_cache.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_cache.c deleted file mode 100644 index 995880fe849..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_cache.c +++ /dev/null @@ -1,405 +0,0 @@ -/* - * Copyright 2016-2021, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_cache.h" -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.cache_cache64" -#endif - -#if (FSL_FEATURE_SOC_CACHE64_CTRL_COUNT > 0) -/******************************************************************************* - * Variables - ******************************************************************************/ -/* Array of CACHE64_CTRL peripheral base address. */ -static CACHE64_CTRL_Type *const s_cache64ctrlBases[] = CACHE64_CTRL_BASE_PTRS; - -#if (defined(FSL_FEATURE_SOC_CACHE64_POLSEL_COUNT) && (FSL_FEATURE_SOC_CACHE64_POLSEL_COUNT > 0)) -/* Array of CACHE64_POLSEL peripheral base address. */ -static CACHE64_POLSEL_Type *const s_cache64polselBases[] = CACHE64_POLSEL_BASE_PTRS; -#endif - -/* Array of CACHE64 physical memory base address. */ -static uint32_t const s_cache64PhymemBases[] = CACHE64_CTRL_PHYMEM_BASES; -/* Array of CACHE64 physical memory size. */ -static uint32_t const s_cache64PhymemSizes[] = CACHE64_CTRL_PHYMEM_SIZES; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#ifdef CACHE64_CLOCKS -/* Array of CACHE64_CTRL clock name. */ -static const clock_ip_name_t s_cache64Clocks[] = CACHE64_CLOCKS; -#endif -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/******************************************************************************* - * Code - ******************************************************************************/ -#if (defined(FSL_FEATURE_SOC_CACHE64_POLSEL_COUNT) && (FSL_FEATURE_SOC_CACHE64_POLSEL_COUNT > 0)) -/*! - * brief Returns an instance number given periphearl base address. - * - * param base The peripheral base address. - * return CACHE64_POLSEL instance number starting from 0. - */ -uint32_t CACHE64_GetInstance(CACHE64_POLSEL_Type *base) -{ - uint32_t i; - - for (i = 0; i < ARRAY_SIZE(s_cache64polselBases); i++) - { - if (base == s_cache64polselBases[i]) - { - break; - } - } - - assert(i < ARRAY_SIZE(s_cache64polselBases)); - - return i; -} -#endif - -/*! - * brief Returns an instance number given physical memory address. - * - * param address The physical memory address. - * return CACHE64_CTRL instance number starting from 0. - */ -uint32_t CACHE64_GetInstanceByAddr(uint32_t address) -{ - uint32_t i; - - for (i = 0; i < ARRAY_SIZE(s_cache64ctrlBases); i++) - { - if ((address >= s_cache64PhymemBases[i]) && - (address < (s_cache64PhymemBases[i] + s_cache64PhymemSizes[i] - 0x01U))) - { - break; - } - } - - return i; -} - -#if (defined(FSL_FEATURE_SOC_CACHE64_POLSEL_COUNT) && (FSL_FEATURE_SOC_CACHE64_POLSEL_COUNT > 0)) -/*! - * @brief Initializes an CACHE64 instance with the user configuration structure. - * - * This function configures the CACHE64 module with user-defined settings. Call the CACHE64_GetDefaultConfig() function - * to configure the configuration structure and get the default configuration. - * - * @param base CACHE64_POLSEL peripheral base address. - * @param config Pointer to a user-defined configuration structure. - * @retval kStatus_Success CACHE64 initialize succeed - */ -status_t CACHE64_Init(CACHE64_POLSEL_Type *base, const cache64_config_t *config) -{ - volatile uint32_t *topReg = &base->REG0_TOP; - uint32_t i; - uint32_t polsel = 0; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#ifdef CACHE64_CLOCKS - uint32_t instance = CACHE64_GetInstance(base); - - /* Enable CACHE64 clock */ - CLOCK_EnableClock(s_cache64Clocks[instance]); -#endif -#endif - - for (i = 0; i < CACHE64_REGION_NUM - 1U; i++) - { - assert((config->boundaryAddr[i] & (CACHE64_REGION_ALIGNMENT - 1U)) == 0U); - ((volatile uint32_t *)topReg)[i] = config->boundaryAddr[i] >= CACHE64_REGION_ALIGNMENT ? - config->boundaryAddr[i] - CACHE64_REGION_ALIGNMENT : - 0U; - } - - for (i = 0; i < CACHE64_REGION_NUM; i++) - { - polsel |= (((uint32_t)config->policy[i]) << (2U * i)); - } - base->POLSEL = polsel; - - return kStatus_Success; -} - -/*! - * @brief Gets the default configuration structure. - * - * This function initializes the CACHE64 configuration structure to a default value. The default - * values are first region covers whole cacheable area, and policy set to write back. - * - * @param config Pointer to a configuration structure. - */ -void CACHE64_GetDefaultConfig(cache64_config_t *config) -{ - (void)memset(config, 0, sizeof(cache64_config_t)); - - config->boundaryAddr[0] = s_cache64PhymemSizes[0]; - config->policy[0] = kCACHE64_PolicyWriteBack; -} -#endif - -/*! - * brief Enables the cache. - * - */ -void CACHE64_EnableCache(CACHE64_CTRL_Type *base) -{ - /* if CACHE is not enabled */ - if ((base->CCR & CACHE64_CTRL_CCR_ENCACHE_MASK) == 0x00U) - { - /* First, invalidate the entire cache. */ - CACHE64_InvalidateCache(base); - - /* Now enable the cache. */ - base->CCR |= CACHE64_CTRL_CCR_ENCACHE_MASK; - } -} - -/*! - * brief Disables the cache. - * - */ -void CACHE64_DisableCache(CACHE64_CTRL_Type *base) -{ - /* if CACHE is enabled */ - if ((base->CCR & CACHE64_CTRL_CCR_ENCACHE_MASK) != 0x00U) - { - /* First, push any modified contents. */ - CACHE64_CleanCache(base); - - /* Now disable the cache. */ - base->CCR &= ~CACHE64_CTRL_CCR_ENCACHE_MASK; - } -} - -/*! - * brief Invalidates the cache. - * - */ -void CACHE64_InvalidateCache(CACHE64_CTRL_Type *base) -{ - /* Invalidate all lines in both ways and initiate the cache command. */ - base->CCR |= CACHE64_CTRL_CCR_INVW0_MASK | CACHE64_CTRL_CCR_INVW1_MASK | CACHE64_CTRL_CCR_GO_MASK; - - /* Wait until the cache command completes. */ - while ((base->CCR & CACHE64_CTRL_CCR_GO_MASK) != 0x00U) - { - } - - /* As a precaution clear the bits to avoid inadvertently re-running this command. */ - base->CCR &= ~(CACHE64_CTRL_CCR_INVW0_MASK | CACHE64_CTRL_CCR_INVW1_MASK); -} - -/*! - * brief Invalidates cache by range. - * - * param address The physical address of cache. - * param size_byte size of the memory to be invalidated, should be larger than 0. - * note Address and size should be aligned to "L1CODCACHE_LINESIZE_BYTE". - * The startAddr here will be forced to align to CACHE64_LINESIZE_BYTE if - * startAddr is not aligned. For the size_byte, application should make sure the - * alignment or make sure the right operation order if the size_byte is not aligned. - */ -void CACHE64_InvalidateCacheByRange(uint32_t address, uint32_t size_byte) -{ - if (size_byte > 0UL) - { - uint32_t endAddr = address + size_byte - 0x01U; - uint32_t pccReg = 0; - /* Align address to cache line size. */ - uint32_t startAddr = address & ~((uint32_t)CACHE64_LINESIZE_BYTE - 1U); - uint32_t instance = CACHE64_GetInstanceByAddr(address); - uint32_t endLim; - CACHE64_CTRL_Type *base; - - if (instance >= ARRAY_SIZE(s_cache64ctrlBases)) - { - return; - } - base = s_cache64ctrlBases[instance]; - endLim = s_cache64PhymemBases[instance] + s_cache64PhymemSizes[instance] - 0x01U; - endAddr = endAddr > endLim ? endLim : endAddr; - - /* Set the invalidate by line command and use the physical address. */ - pccReg = (base->CLCR & ~CACHE64_CTRL_CLCR_LCMD_MASK) | CACHE64_CTRL_CLCR_LCMD(1) | CACHE64_CTRL_CLCR_LADSEL_MASK; - base->CLCR = pccReg; - - while (startAddr < endAddr) - { - /* Set the address and initiate the command. */ - base->CSAR = (startAddr & CACHE64_CTRL_CSAR_PHYADDR_MASK) | CACHE64_CTRL_CSAR_LGO_MASK; - - /* Wait until the cache command completes. */ - while ((base->CSAR & CACHE64_CTRL_CSAR_LGO_MASK) != 0x00U) - { - } - startAddr += (uint32_t)CACHE64_LINESIZE_BYTE; - } - } -} - -/*! - * brief Cleans the cache. - * - */ -void CACHE64_CleanCache(CACHE64_CTRL_Type *base) -{ - /* Enable the to push all modified lines. */ - base->CCR |= CACHE64_CTRL_CCR_PUSHW0_MASK | CACHE64_CTRL_CCR_PUSHW1_MASK | CACHE64_CTRL_CCR_GO_MASK; - - /* Wait until the cache command completes. */ - while ((base->CCR & CACHE64_CTRL_CCR_GO_MASK) != 0x00U) - { - } - - /* As a precaution clear the bits to avoid inadvertently re-running this command. */ - base->CCR &= ~(CACHE64_CTRL_CCR_PUSHW0_MASK | CACHE64_CTRL_CCR_PUSHW1_MASK); -} - -/*! - * brief Cleans cache by range. - * - * param address The physical address of cache. - * param size_byte size of the memory to be cleaned, should be larger than 0. - * note Address and size should be aligned to "CACHE64_LINESIZE_BYTE". - * The startAddr here will be forced to align to CACHE64_LINESIZE_BYTE if - * startAddr is not aligned. For the size_byte, application should make sure the - * alignment or make sure the right operation order if the size_byte is not aligned. - */ -void CACHE64_CleanCacheByRange(uint32_t address, uint32_t size_byte) -{ - if (size_byte > 0UL) - { - uint32_t endAddr = address + size_byte - 0x01U; - uint32_t pccReg = 0; - /* Align address to cache line size. */ - uint32_t startAddr = address & ~((uint32_t)CACHE64_LINESIZE_BYTE - 1U); - uint32_t instance = CACHE64_GetInstanceByAddr(address); - uint32_t endLim; - CACHE64_CTRL_Type *base; - - if (instance >= ARRAY_SIZE(s_cache64ctrlBases)) - { - return; - } - base = s_cache64ctrlBases[instance]; - endLim = s_cache64PhymemBases[instance] + s_cache64PhymemSizes[instance] - 0x01U; - endAddr = endAddr > endLim ? endLim : endAddr; - - /* Set the push by line command. */ - pccReg = (base->CLCR & ~CACHE64_CTRL_CLCR_LCMD_MASK) | CACHE64_CTRL_CLCR_LCMD(2) | CACHE64_CTRL_CLCR_LADSEL_MASK; - base->CLCR = pccReg; - - while (startAddr < endAddr) - { - /* Set the address and initiate the command. */ - base->CSAR = (startAddr & CACHE64_CTRL_CSAR_PHYADDR_MASK) | CACHE64_CTRL_CSAR_LGO_MASK; - - /* Wait until the cache command completes. */ - while ((base->CSAR & CACHE64_CTRL_CSAR_LGO_MASK) != 0x00U) - { - } - startAddr += (uint32_t)CACHE64_LINESIZE_BYTE; - } - } -} - -/*! - * brief Cleans and invalidates the cache. - * - */ -void CACHE64_CleanInvalidateCache(CACHE64_CTRL_Type *base) -{ - /* Push and invalidate all. */ - base->CCR |= CACHE64_CTRL_CCR_PUSHW0_MASK | CACHE64_CTRL_CCR_PUSHW1_MASK | CACHE64_CTRL_CCR_INVW0_MASK | - CACHE64_CTRL_CCR_INVW1_MASK | CACHE64_CTRL_CCR_GO_MASK; - - /* Wait until the cache command completes. */ - while ((base->CCR & CACHE64_CTRL_CCR_GO_MASK) != 0x00U) - { - } - - /* As a precaution clear the bits to avoid inadvertently re-running this command. */ - base->CCR &= ~(CACHE64_CTRL_CCR_PUSHW0_MASK | CACHE64_CTRL_CCR_PUSHW1_MASK | CACHE64_CTRL_CCR_INVW0_MASK | - CACHE64_CTRL_CCR_INVW1_MASK); -} - -/*! - * brief Cleans and invalidate cache by range. - * - * param address The physical address of cache. - * param size_byte size of the memory to be Cleaned and Invalidated, should be larger than 0. - * note Address and size should be aligned to "CACHE64_LINESIZE_BYTE". - * The startAddr here will be forced to align to CACHE64_LINESIZE_BYTE if - * startAddr is not aligned. For the size_byte, application should make sure the - * alignment or make sure the right operation order if the size_byte is not aligned. - */ -void CACHE64_CleanInvalidateCacheByRange(uint32_t address, uint32_t size_byte) -{ - if (size_byte > 0UL) - { - uint32_t endAddr = address + size_byte - 0x01U; - uint32_t pccReg = 0; - /* Align address to cache line size. */ - uint32_t startAddr = address & ~((uint32_t)CACHE64_LINESIZE_BYTE - 1U); - uint32_t instance = CACHE64_GetInstanceByAddr(address); - uint32_t endLim; - CACHE64_CTRL_Type *base; - - if (instance >= ARRAY_SIZE(s_cache64ctrlBases)) - { - return; - } - base = s_cache64ctrlBases[instance]; - endLim = s_cache64PhymemBases[instance] + s_cache64PhymemSizes[instance] - 0x01U; - endAddr = endAddr > endLim ? endLim : endAddr; - - /* Set the push by line command. */ - pccReg = (base->CLCR & ~CACHE64_CTRL_CLCR_LCMD_MASK) | CACHE64_CTRL_CLCR_LCMD(3) | CACHE64_CTRL_CLCR_LADSEL_MASK; - base->CLCR = pccReg; - - while (startAddr < endAddr) - { - /* Set the address and initiate the command. */ - base->CSAR = (startAddr & CACHE64_CTRL_CSAR_PHYADDR_MASK) | CACHE64_CTRL_CSAR_LGO_MASK; - - /* Wait until the cache command completes. */ - while ((base->CSAR & CACHE64_CTRL_CSAR_LGO_MASK) != 0x00U) - { - } - startAddr += (uint32_t)CACHE64_LINESIZE_BYTE; - } - } -} - -#if !(defined(FSL_FEATURE_CACHE64_CTRL_HAS_NO_WRITE_BUF) && FSL_FEATURE_CACHE64_CTRL_HAS_NO_WRITE_BUF) -/*! - * brief Enable the cache write buffer. - * - */ -void CACHE64_EnableWriteBuffer(CACHE64_CTRL_Type *base, bool enable) -{ - if (enable) - { - base->CCR |= CACHE64_CTRL_CCR_ENWRBUF_MASK; - } - else - { - base->CCR &= ~CACHE64_CTRL_CCR_ENWRBUF_MASK; - } -} - -#endif - -#endif /* FSL_FEATURE_SOC_CACHE64_CTRL_COUNT > 0 */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_cache.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_cache.h deleted file mode 100644 index f95c9ce69c1..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_cache.h +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Copyright 2016-2021, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_CACHE_H_ -#define FSL_CACHE_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup cache64 - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief cache driver version. */ -#define FSL_CACHE_DRIVER_VERSION (MAKE_VERSION(2, 0, 7)) -/*! @} */ - -/*! @brief cache line size. */ -#define CACHE64_LINESIZE_BYTE (FSL_FEATURE_CACHE64_CTRL_LINESIZE_BYTE) - -#if (defined(FSL_FEATURE_SOC_CACHE64_POLSEL_COUNT) && (FSL_FEATURE_SOC_CACHE64_POLSEL_COUNT > 0)) -/*! @brief cache region number. */ -#define CACHE64_REGION_NUM (3U) -/*! @brief cache region alignment. */ -#define CACHE64_REGION_ALIGNMENT (0x400U) - -/*! @brief Level 2 cache controller way size. */ -typedef enum _cache64_policy -{ - kCACHE64_PolicyNonCacheable = 0, /*!< Non-cacheable */ - kCACHE64_PolicyWriteThrough = 1, /*!< Write through */ - kCACHE64_PolicyWriteBack = 2, /*!< Write back */ -} cache64_policy_t; - -/*! @brief CACHE64 configuration structure. */ -typedef struct _cache64_config -{ - /*!< The cache controller can divide whole memory into 3 regions. - * Boundary address is the FlexSPI internal address (start from 0) instead of system - * address (start from FlexSPI AMBA base) to split adjacent regions and must be 1KB - * aligned. The boundary address itself locates in upper region. */ - uint32_t boundaryAddr[CACHE64_REGION_NUM - 1]; - /*!< Cacheable policy for each region. */ - cache64_policy_t policy[CACHE64_REGION_NUM]; -} cache64_config_t; -#endif - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name cache control for cache64 - *@{ - */ - -#if (defined(FSL_FEATURE_SOC_CACHE64_POLSEL_COUNT) && (FSL_FEATURE_SOC_CACHE64_POLSEL_COUNT > 0)) -/*! - * @brief Returns an instance number given periphearl base address. - * - * @param base The peripheral base address. - * @return CACHE64_POLSEL instance number starting from 0. - */ -uint32_t CACHE64_GetInstance(CACHE64_POLSEL_Type *base); -#endif - -/*! - * brief Returns an instance number given physical memory address. - * - * param address The physical memory address. - * @return CACHE64_CTRL instance number starting from 0. - */ -uint32_t CACHE64_GetInstanceByAddr(uint32_t address); - -#if (defined(FSL_FEATURE_SOC_CACHE64_POLSEL_COUNT) && (FSL_FEATURE_SOC_CACHE64_POLSEL_COUNT > 0)) -/*! - * @brief Initializes an CACHE64 instance with the user configuration structure. - * - * This function configures the CACHE64 module with user-defined settings. Call the CACHE64_GetDefaultConfig() function - * to configure the configuration structure and get the default configuration. - * - * @param base CACHE64_POLSEL peripheral base address. - * @param config Pointer to a user-defined configuration structure. - * @retval kStatus_Success CACHE64 initialize succeed - */ -status_t CACHE64_Init(CACHE64_POLSEL_Type *base, const cache64_config_t *config); - -/*! - * @brief Gets the default configuration structure. - * - * This function initializes the CACHE64 configuration structure to a default value. The default - * values are first region covers whole cacheable area, and policy set to write back. - * - * @param config Pointer to a configuration structure. - */ -void CACHE64_GetDefaultConfig(cache64_config_t *config); -#endif - -/*! - * @brief Enables the cache. - * - * @param base CACHE64_CTRL peripheral base address. - * - */ -void CACHE64_EnableCache(CACHE64_CTRL_Type *base); - -/*! - * @brief Disables the cache. - * - * @param base CACHE64_CTRL peripheral base address. - * - */ -void CACHE64_DisableCache(CACHE64_CTRL_Type *base); - -/*! - * @brief Invalidates the cache. - * - * @param base CACHE64_CTRL peripheral base address. - * - */ -void CACHE64_InvalidateCache(CACHE64_CTRL_Type *base); - -/*! - * @brief Invalidates cache by range. - * - * @param address The physical address of cache. - * @param size_byte size of the memory to be invalidated, should be larger than 0. - * @note Address and size should be aligned to "CACHE64_LINESIZE_BYTE". - * The startAddr here will be forced to align to CACHE64_LINESIZE_BYTE if - * startAddr is not aligned. For the size_byte, application should make sure the - * alignment or make sure the right operation order if the size_byte is not aligned. - */ -void CACHE64_InvalidateCacheByRange(uint32_t address, uint32_t size_byte); - -/*! - * @brief Cleans the cache. - * - * @param base CACHE64_CTRL peripheral base address. - * - */ -void CACHE64_CleanCache(CACHE64_CTRL_Type *base); - -/*! - * @brief Cleans cache by range. - * - * @param address The physical address of cache. - * @param size_byte size of the memory to be cleaned, should be larger than 0. - * @note Address and size should be aligned to "CACHE64_LINESIZE_BYTE". - * The startAddr here will be forced to align to CACHE64_LINESIZE_BYTE if - * startAddr is not aligned. For the size_byte, application should make sure the - * alignment or make sure the right operation order if the size_byte is not aligned. - */ -void CACHE64_CleanCacheByRange(uint32_t address, uint32_t size_byte); - -/*! - * @brief Cleans and invalidates the cache. - * - * @param base CACHE64_CTRL peripheral base address. - * - */ -void CACHE64_CleanInvalidateCache(CACHE64_CTRL_Type *base); - -/*! - * @brief Cleans and invalidate cache by range. - * - * @param address The physical address of cache. - * @param size_byte size of the memory to be Cleaned and Invalidated, should be larger than 0. - * @note Address and size should be aligned to "CACHE64_LINESIZE_BYTE". - * The startAddr here will be forced to align to CACHE64_LINESIZE_BYTE if - * startAddr is not aligned. For the size_byte, application should make sure the - * alignment or make sure the right operation order if the size_byte is not aligned. - */ -void CACHE64_CleanInvalidateCacheByRange(uint32_t address, uint32_t size_byte); - -#if !(defined(FSL_FEATURE_CACHE64_CTRL_HAS_NO_WRITE_BUF) && FSL_FEATURE_CACHE64_CTRL_HAS_NO_WRITE_BUF) -/*! - * @brief Enables/disables the write buffer. - * - * @param base CACHE64_CTRL peripheral base address. - * @param enable The enable or disable flag. - * true - enable the write buffer. - * false - disable the write buffer. - */ -void CACHE64_EnableWriteBuffer(CACHE64_CTRL_Type *base, bool enable); -#endif - -/*! @} */ - -/*! - * @name Unified Cache Control for all caches - *@{ - */ - -/*! - * @brief Invalidates instruction cache by range. - * - * @param address The physical address. - * @param size_byte size of the memory to be invalidated, should be larger than 0. - * @note Address and size should be aligned to CACHE64_LINESIZE_BYTE due to the cache operation unit - * FSL_FEATURE_CACHE64_CTRL_LINESIZE_BYTE. The startAddr here will be forced to align to the cache line - * size if startAddr is not aligned. For the size_byte, application should make sure the - * alignment or make sure the right operation order if the size_byte is not aligned. - */ -static inline void ICACHE_InvalidateByRange(uint32_t address, uint32_t size_byte) -{ - CACHE64_InvalidateCacheByRange(address, size_byte); -} - -/*! - * @brief Invalidates data cache by range. - * - * @param address The physical address. - * @param size_byte size of the memory to be invalidated, should be larger than 0. - * @note Address and size should be aligned to CACHE64_LINESIZE_BYTE due to the cache operation unit - * FSL_FEATURE_CACHE64_CTRL_LINESIZE_BYTE. The startAddr here will be forced to align to the cache line - * size if startAddr is not aligned. For the size_byte, application should make sure the - * alignment or make sure the right operation order if the size_byte is not aligned. - */ -static inline void DCACHE_InvalidateByRange(uint32_t address, uint32_t size_byte) -{ - CACHE64_InvalidateCacheByRange(address, size_byte); -} - -/*! - * @brief Clean data cache by range. - * - * @param address The physical address. - * @param size_byte size of the memory to be cleaned, should be larger than 0. - * @note Address and size should be aligned to CACHE64_LINESIZE_BYTE due to the cache operation unit - * FSL_FEATURE_CACHE64_CTRL_LINESIZE_BYTE. The startAddr here will be forced to align to the cache line - * size if startAddr is not aligned. For the size_byte, application should make sure the - * alignment or make sure the right operation order if the size_byte is not aligned. - */ -static inline void DCACHE_CleanByRange(uint32_t address, uint32_t size_byte) -{ - CACHE64_CleanCacheByRange(address, size_byte); -} - -/*! - * @brief Cleans and Invalidates data cache by range. - * - * @param address The physical address. - * @param size_byte size of the memory to be Cleaned and Invalidated, should be larger than 0. - * @note Address and size should be aligned to CACHE64_LINESIZE_BYTE due to the cache operation unit - * FSL_FEATURE_CACHE64_CTRL_LINESIZE_BYTE. The startAddr here will be forced to align to the cache line - * size if startAddr is not aligned. For the size_byte, application should make sure the - * alignment or make sure the right operation order if the size_byte is not aligned. - */ -static inline void DCACHE_CleanInvalidateByRange(uint32_t address, uint32_t size_byte) -{ - CACHE64_CleanInvalidateCacheByRange(address, size_byte); -} - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_CACHE_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_cache_lpcac.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_cache_lpcac.c deleted file mode 100644 index 31b4415e130..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_cache_lpcac.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2021-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_cache_lpcac.h" -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.cache_lpcac" -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_cache_lpcac.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_cache_lpcac.h deleted file mode 100644 index 54dd1fd8407..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_cache_lpcac.h +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright 2021-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_CACHE_LPCAC_H_ -#define FSL_CACHE_LPCAC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup cache_lpcac - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief cache driver version */ -#define FSL_CACHE_LPCAC_DRIVER_VERSION (MAKE_VERSION(2, 1, 1)) -/*@}*/ -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name cache control for the L1 low power cache controller - *@{ - */ - -/*! - * @brief Enables the processor code bus cache. - * - */ -static inline void L1CACHE_EnableCodeCache(void) -{ - SYSCON->LPCAC_CTRL &= ~SYSCON_LPCAC_CTRL_DIS_LPCAC_MASK; -} - -/*! - * @brief Disables the processor code bus cache. - * - */ -static inline void L1CACHE_DisableCodeCache(void) -{ - SYSCON->LPCAC_CTRL |= SYSCON_LPCAC_CTRL_DIS_LPCAC_MASK; -} - -/*! - * @brief Clears cache. - * - */ -static inline void L1CACHE_InvalidateCodeCache(void) -{ - SYSCON->LPCAC_CTRL |= SYSCON_LPCAC_CTRL_CLR_LPCAC_MASK; -} - -/*! - * @brief Enables allocation. - * - */ -static inline void L1CACHE_EnableAllocation(void) -{ - SYSCON->LPCAC_CTRL &= ~SYSCON_LPCAC_CTRL_FRC_NO_ALLOC_MASK; -} - -/*! - * @brief Disables allocation. - * - */ -static inline void L1CACHE_DisableAllocation(void) -{ - SYSCON->LPCAC_CTRL |= SYSCON_LPCAC_CTRL_FRC_NO_ALLOC_MASK; -} - -/*! - * @brief Enables parity. - * - */ -static inline void L1CACHE_EnableParity(void) -{ - SYSCON->LPCAC_CTRL |= SYSCON_LPCAC_CTRL_PARITY_MISS_EN_MASK; -} - -/*! - * @brief Disable parity. - * - */ -static inline void L1CACHE_DisableParity(void) -{ - SYSCON->LPCAC_CTRL &= ~SYSCON_LPCAC_CTRL_PARITY_MISS_EN_MASK; -} - -#if defined(FSL_FEATURE_LPCAC_SUPPORT_WRITE_BUFFER_CONTROL) && FSL_FEATURE_LPCAC_SUPPORT_WRITE_BUFFER_CONTROL -/*! - * @brief Enables write through buffer. - * - */ -static inline void L1CACHE_EnableWriteBuffer(void) -{ - SYSCON->LPCAC_CTRL &= ~SYSCON_LPCAC_CTRL_DIS_LPCAC_WTBF_MASK; -} - -/*! - * @brief Disables write through buffer. - * - */ -static inline void L1CACHE_DisableWriteBuffer(void) -{ - SYSCON->LPCAC_CTRL |= SYSCON_LPCAC_CTRL_DIS_LPCAC_WTBF_MASK; -} - -/*! - * @brief Limits write through buffer. - * - */ -static inline void L1CACHE_LimitWriteBuffer(void) -{ - SYSCON->LPCAC_CTRL &= ~SYSCON_LPCAC_CTRL_LIM_LPCAC_WTBF_MASK; -} - -/*! - * @brief Unlimits write through buffer. - * - */ -static inline void L1CACHE_UnlimitParity(void) -{ - SYSCON->LPCAC_CTRL |= SYSCON_LPCAC_CTRL_LIM_LPCAC_WTBF_MASK; -} - -/*! - * @brief Enables parity error report. - * - */ -static inline void L1CACHE_EnableParityErrorReport(void) -{ - SYSCON->LPCAC_CTRL |= SYSCON_LPCAC_CTRL_PARITY_FAULT_EN_MASK; -} - -/*! - * @brief Disables parity error report. - * - */ -static inline void L1CACHE_DisableParityErrorReport(void) -{ - SYSCON->LPCAC_CTRL &= ~SYSCON_LPCAC_CTRL_PARITY_FAULT_EN_MASK; -} - -/*! - * @brief Enables XOM(eXecute-Only-Memory) control. - * - */ -static inline void L1CACHE_EnableXOMControl(void) -{ - SYSCON->LPCAC_CTRL |= SYSCON_LPCAC_CTRL_LPCAC_XOM_MASK; -} - -/*! - * @brief Disables XOM(eXecute-Only-Memory) control. - * - */ -static inline void L1CACHE_DisableXOMControl(void) -{ - SYSCON->LPCAC_CTRL &= ~SYSCON_LPCAC_CTRL_LPCAC_XOM_MASK; -} -#endif - -/*@}*/ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_CACHE_LPCAC_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_cdog.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_cdog.c deleted file mode 100644 index cd3ed6eaa3f..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_cdog.c +++ /dev/null @@ -1,378 +0,0 @@ -/* - * Copyright 2020-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_cdog.h" - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.cdog" -#endif - -/* Reset CONTROL mask */ -#define RESERVED_CTRL_MASK 0x800u - -#if defined(CDOG_IRQS) -/* Array of IRQs */ -static const IRQn_Type s_CdogIrqs[] = CDOG_IRQS; -#endif /* CDOG_IRQS */ - -#ifdef CDOG_CLOCKS -static const clock_ip_name_t s_CdogClocks[] = CDOG_CLOCKS; -#endif /* CDOG_CLOCKS */ - -#ifdef CDOG_BASE_PTRS -static const CDOG_Type* s_cdogBases[] = CDOG_BASE_PTRS; -#endif /* CDOG_BASE_PTRS */ - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -static uint32_t CDOG_GetInstance(CDOG_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_cdogBases); instance++) - { - if (s_cdogBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_cdogBases)); - - return instance; -} - -/*! - * brief Sets the default configuration of CDOG - * - * This function initialize CDOG config structure to default values. - * - * param conf CDOG configuration structure - */ -void CDOG_GetDefaultConfig(cdog_config_t *conf) -{ - /* Default configuration after reset */ - conf->lock = (uint8_t)kCDOG_LockCtrl_Unlock; /* Lock control */ - conf->timeout = (uint8_t)kCDOG_FaultCtrl_NoAction; /* Timeout control */ - conf->miscompare = (uint8_t)kCDOG_FaultCtrl_NoAction; /* Miscompare control */ - conf->sequence = (uint8_t)kCDOG_FaultCtrl_NoAction; /* Sequence control */ - conf->state = (uint8_t)kCDOG_FaultCtrl_NoAction; /* State control */ - conf->address = (uint8_t)kCDOG_FaultCtrl_NoAction; /* Address control */ - conf->irq_pause = (uint8_t)kCDOG_IrqPauseCtrl_Run; /* IRQ pause control */ - conf->debug_halt = (uint8_t)kCDOG_DebugHaltCtrl_Run; /* Debug halt control */ - return; -} - -/*! - * brief Sets secure counter and instruction timer values - * - * This function sets value in RELOAD and START registers for instruction timer. - * - * param base CDOG peripheral base address - * param reload reload value - * param start start value - */ -void CDOG_Start(CDOG_Type *base, uint32_t reload, uint32_t start) -{ - base->RELOAD = reload; - base->START = start; -} - -/*! - * brief Stops secure counter and instruction timer - * - * This function stops instruction timer and secure counter. - * This also change state of CDOG to IDLE. - * - * param base CDOG peripheral base address - * param stop expected value which will be compared with value of secure counter - */ -void CDOG_Stop(CDOG_Type *base, uint32_t stop) -{ - base->STOP = stop; -} - -/*! - * brief Sets secure counter and instruction timer values - * - * This function sets value in STOP, RELOAD and START registers - * for instruction timer and secure counter. - * - * param base CDOG peripheral base address - * param stop expected value which will be compared with value of secure counter - * param reload reload value for instruction timer - * param start start value for secure timer - */ -void CDOG_Set(CDOG_Type *base, uint32_t stop, uint32_t reload, uint32_t start) -{ - base->STOP = stop; - base->RELOAD = reload; - base->START = start; -} - -/*! - * brief Add value to secure counter - * - * This function add specified value to secure counter. - * - * param base CDOG peripheral base address. - * param add Value to be added. - */ -void CDOG_Add(CDOG_Type *base, uint32_t add) -{ - base->ADD = (secure_counter_t)add; -} - -/*! - * brief Add 1 to secure counter - * - * This function add 1 to secure counter. - * - * param base CDOG peripheral base address. - * param add Value to be added. - */ -void CDOG_Add1(CDOG_Type *base) -{ - base->ADD1 = (secure_counter_t)0x1U; -} - -/*! - * brief Add 16 to secure counter - * - * This function add 16 to secure counter. - * - * param base CDOG peripheral base address. - * param add Value to be added. - */ -void CDOG_Add16(CDOG_Type *base) -{ - base->ADD16 = (secure_counter_t)0x1U; -} - -/*! - * brief Add 256 to secure counter - * - * This function add 256 to secure counter. - * - * param base CDOG peripheral base address. - * param add Value to be added. - */ -void CDOG_Add256(CDOG_Type *base) -{ - base->ADD256 = (secure_counter_t)0x1U; -} - -/*! - * brief Substract value to secure counter - * - * This function substract specified value to secure counter. - * - * param base CDOG peripheral base address. - * param sub Value to be substracted. - */ -void CDOG_Sub(CDOG_Type *base, uint32_t sub) -{ - base->SUB = (secure_counter_t)sub; -} - -/*! - * brief Substract 1 from secure counter - * - * This function substract specified 1 from secure counter. - * - * param base CDOG peripheral base address. - */ -void CDOG_Sub1(CDOG_Type *base) -{ - base->SUB1 = (secure_counter_t)0x1U; -} - -/*! - * brief Substract 16 from secure counter - * - * This function substract specified 16 from secure counter. - * - * param base CDOG peripheral base address. - */ -void CDOG_Sub16(CDOG_Type *base) -{ - base->SUB16 = (secure_counter_t)0x1U; -} - -/*! - * brief Substract 256 from secure counter - * - * This function substract specified 256 from secure counter. - * - * param base CDOG peripheral base address. - */ -void CDOG_Sub256(CDOG_Type *base) -{ - base->SUB256 = (secure_counter_t)0x1U; -} - -/*! - * brief Checks secure counter. - * - * This function compares stop value with secure counter value - * by writting to RELOAD refister. - * - * param base CDOG peripheral base address - * param check expected (stop) value. - */ -void CDOG_Check(CDOG_Type *base, uint32_t check) -{ -#if defined(FLS_FEATURE_CDOG_USE_RESTART) - base->RESTART = check; -#else - base->STOP = check; - base->RELOAD = base->RELOAD; - base->START= check; -#endif -} - -/*! - * brief Set the CDOG persistent word. - * - * param base CDOG peripheral base address. - * param value The value to be written. - */ -void CDOG_WritePersistent(CDOG_Type *base, uint32_t value) -{ - base->PERSISTENT = value; -} - -/*! - * brief Get the CDOG persistent word. - * - * param base CDOG peripheral base address. - * return The persistent word. - */ -uint32_t CDOG_ReadPersistent(CDOG_Type *base) -{ - return base->PERSISTENT; -} - -/*! - * brief Initialize CDOG - * - * This function initializes CDOG setting and enable all interrupts. - * - * param base CDOG peripheral base address - * param conf CDOG configuration structure - * return Status of the init operation - */ -status_t CDOG_Init(CDOG_Type *base, cdog_config_t *conf) -{ - /* Ungate clock to CDOG engine and reset it */ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#ifdef CDOG_CLOCKS - CLOCK_EnableClock(s_CdogClocks[CDOG_GetInstance(base)]); -#endif /* CDOG_CLOCKS */ -#endif /* !FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_FEATURE_CDOG_HAS_NO_RESET) && FSL_FEATURE_CDOG_HAS_NO_RESET) - RESET_PeripheralReset(kCDOG_RST_SHIFT_RSTn); -#endif /* !FSL_FEATURE_CDOG_HAS_NO_RESET */ - - if (base->CONTROL == 0x0U) - { - /* CDOG is not in IDLE mode, which may be cause after SW reset. */ - /* Writing to CONTROL register will trigger fault. */ - return kStatus_Fail; - } - - /* Clear pending errors, otherwise the device will reset */ - /* itself immediately after enable Code Watchdog */ - if ((uint32_t)kCDOG_LockCtrl_Lock == - ((base->CONTROL & CDOG_CONTROL_LOCK_CTRL_MASK) >> CDOG_CONTROL_LOCK_CTRL_SHIFT)) - - { - base->FLAGS = CDOG_FLAGS_TO_FLAG(1U) | CDOG_FLAGS_MISCOM_FLAG(1U) | CDOG_FLAGS_SEQ_FLAG(1U) | - CDOG_FLAGS_CNT_FLAG(1U) | CDOG_FLAGS_STATE_FLAG(1U) | CDOG_FLAGS_ADDR_FLAG(1U) | - CDOG_FLAGS_POR_FLAG(1U); - } - else - { -/* load default values for CDOG->CONTROL before flags clear */ -#if defined(FSL_FEATURE_CDOG_NEED_LOAD_DEFAULT_CONF) && (FSL_FEATURE_CDOG_NEED_LOAD_DEFAULT_CONF > 0) - cdog_config_t default_conf; - - /* Initialize CDOG */ - CDOG_GetDefaultConfig(&default_conf); - - /* Write default value to CDOG->CONTROL*/ - base->CONTROL = - CDOG_CONTROL_TIMEOUT_CTRL(default_conf.timeout) | /* Action if the timeout event is triggered */ - CDOG_CONTROL_MISCOMPARE_CTRL(default_conf.miscompare) | /* Action if the miscompare error event is triggered */ - CDOG_CONTROL_SEQUENCE_CTRL(default_conf.sequence) | /* Action if the sequence error event is triggered */ - CDOG_CONTROL_STATE_CTRL(default_conf.state) | /* Action if the state error event is triggered */ - CDOG_CONTROL_ADDRESS_CTRL(default_conf.address) | /* Action if the address error event is triggered */ - CDOG_CONTROL_IRQ_PAUSE(default_conf.irq_pause) | /* Pause running during interrupts setup */ - CDOG_CONTROL_DEBUG_HALT_CTRL(default_conf.debug_halt) | /* Halt CDOG timer during debug */ - CDOG_CONTROL_LOCK_CTRL(default_conf.lock) | RESERVED_CTRL_MASK; /* Lock control register, RESERVED */ -#endif /* FSL_FEATURE_CDOG_NEED_LOAD_DEFAULT_CONF */ - - base->FLAGS = CDOG_FLAGS_TO_FLAG(0U) | CDOG_FLAGS_MISCOM_FLAG(0U) | CDOG_FLAGS_SEQ_FLAG(0U) | - CDOG_FLAGS_CNT_FLAG(0U) | CDOG_FLAGS_STATE_FLAG(0U) | CDOG_FLAGS_ADDR_FLAG(0U) | - CDOG_FLAGS_POR_FLAG(0U); - } - - base->CONTROL = - CDOG_CONTROL_TIMEOUT_CTRL(conf->timeout) | /* Action if the timeout event is triggered */ - CDOG_CONTROL_MISCOMPARE_CTRL(conf->miscompare) | /* Action if the miscompare error event is triggered */ - CDOG_CONTROL_SEQUENCE_CTRL(conf->sequence) | /* Action if the sequence error event is triggered */ - CDOG_CONTROL_STATE_CTRL(conf->state) | /* Action if the state error event is triggered */ - CDOG_CONTROL_ADDRESS_CTRL(conf->address) | /* Action if the address error event is triggered */ - CDOG_CONTROL_IRQ_PAUSE(conf->irq_pause) | /* Pause running during interrupts setup */ - CDOG_CONTROL_DEBUG_HALT_CTRL(conf->debug_halt) | /* Halt CDOG timer during debug */ - CDOG_CONTROL_LOCK_CTRL(conf->lock) | RESERVED_CTRL_MASK; /* Lock control register, RESERVED */ - -#if defined(CDOG_IRQS) - /* Enable peripheral IRQ */ - NVIC_EnableIRQ(s_CdogIrqs[CDOG_GetInstance(base)]); -#endif /* CDOG_IRQS */ - - return kStatus_Success; -} - -/*! - * brief Deinitialize CDOG - * - * This function stops CDOG secure counter. - * - * param base CDOG peripheral base address - */ -void CDOG_Deinit(CDOG_Type *base) -{ -#if defined(CDOG_IRQS) - /* Disable peripheral IRQ */ - NVIC_DisableIRQ(s_CdogIrqs[CDOG_GetInstance(base)]); -#endif /* CDOG_IRQS */ - -#if !(defined(FSL_FEATURE_CDOG_HAS_NO_RESET) && FSL_FEATURE_CDOG_HAS_NO_RESET) - RESET_SetPeripheralReset(kCDOG_RST_SHIFT_RSTn); -#endif /* !FSL_FEATURE_CDOG_HAS_NO_RESET */ - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#ifdef CDOG_CLOCKS - CLOCK_DisableClock(s_CdogClocks[CDOG_GetInstance(base)]); -#endif /* CDOG_CLOCKS */ -#endif /* !FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_cdog.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_cdog.h deleted file mode 100644 index 7252eaccd8c..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_cdog.h +++ /dev/null @@ -1,329 +0,0 @@ -/* - * Copyright 2020-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_CDOG_H_ -#define FSL_CDOG_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup CDOG - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief Defines CDOG driver version 2.1.3. - * - * Change log: - * - Version 2.1.3 - * - Re-design multiple instance IRQs and Clocks - * - Add fix for RESTART command errata - * - Version 2.1.2 - * - Support multiple IRQs - * - Fix default CONTROL values - * - Version 2.1.1 - * - Remove bit CONTROL[CONTROL_CTRL] - * - Version 2.1.0 - * - Rename CWT to CDOG - * - Version 2.0.2 - * - Fix MISRA-2012 issues - * - Version 2.0.1 - * - Fix doxygen issues - * - Version 2.0.0 - * - initial version - */ -#define FSL_CDOG_DRIVER_VERSION (MAKE_VERSION(2, 1, 3)) -/*! @} */ - -typedef struct -{ - uint8_t lock : 2; - uint8_t timeout : 3; - uint8_t miscompare : 3; - uint8_t sequence : 3; - uint8_t state : 3; - uint8_t address : 3; - uint8_t reserved : 8; - uint8_t irq_pause : 2; - uint8_t debug_halt : 2; -} cdog_config_t; - -enum __cdog_debug_Action_ctrl_enum -{ - kCDOG_DebugHaltCtrl_Run = 0x1, - kCDOG_DebugHaltCtrl_Pause = 0x2, -}; - -enum __cdog_irq_pause_ctrl_enum -{ - kCDOG_IrqPauseCtrl_Run = 0x1, - kCDOG_IrqPauseCtrl_Pause = 0x2, -}; - -enum __cdog_fault_ctrl_enum -{ - kCDOG_FaultCtrl_EnableReset = 0x1U, - kCDOG_FaultCtrl_EnableInterrupt = 0x2U, - kCDOG_FaultCtrl_NoAction = 0x4U, -}; - -enum __code_lock_ctrl_enum -{ - kCDOG_LockCtrl_Lock = 0x1, - kCDOG_LockCtrl_Unlock = 0x2, -}; - -typedef uint32_t secure_counter_t; - -#define SC_ADD(add) \ - do \ - { \ - CDOG->ADD = (secure_counter_t)(add); \ - } while (0) - -#define SC_ADD1 \ - do \ - { \ - CDOG->ADD1 = (secure_counter_t)0x1U; \ - } while (0) - -#define SC_ADD16 \ - do \ - { \ - CDOG->ADD16 = (secure_counter_t)0x1U; \ - } while (0) - -#define SC_ADD256 \ - do \ - { \ - CDOG->ADD256 = (secure_counter_t)0x1U; \ - } while (0) - -#define SC_SUB(sub) \ - do \ - { \ - CDOG->SUB = (secure_counter_t)(sub); \ - } while (0) - -#define SC_SUB1 \ - do \ - { \ - CDOG->SUB1 = (secure_counter_t)0x1U; \ - } while (0) - -#define SC_SUB16 \ - do \ - { \ - CDOG->SUB16 = (secure_counter_t)0x1U; \ - } while (0) - -#define SC_SUB256 \ - do \ - { \ - CDOG->SUB256 = (secure_counter_t)0x1U; \ - } while (0) - -#define SC_CHECK(val) \ - do \ - { \ - CDOG->RESTART = (secure_counter_t)val; \ - } while (0) - -/******************************************************************************* - * API - *******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name CDOG Functional Operation - * @{ - */ - -/*! - * @brief Initialize CDOG - * - * This function initializes CDOG block and setting. - * - * @param base CDOG peripheral base address - * @param conf CDOG configuration structure - * @return Status of the init operation - */ -status_t CDOG_Init(CDOG_Type *base, cdog_config_t *conf); - -/*! - * @brief Deinitialize CDOG - * - * This function deinitializes CDOG secure counter. - * - * @param base CDOG peripheral base address - */ -void CDOG_Deinit(CDOG_Type *base); - -/*! - * @brief Sets the default configuration of CDOG - * - * This function initialize CDOG config structure to default values. - * - * @param conf CDOG configuration structure - */ -void CDOG_GetDefaultConfig(cdog_config_t *conf); - -/*! - * @brief Stops secure counter and instruction timer - * - * This function stops instruction timer and secure counter. - * This also change state od CDOG to IDLE. - * - * @param base CDOG peripheral base address - * @param stop expected value which will be compared with value of secure counter - */ -void CDOG_Stop(CDOG_Type *base, uint32_t stop); - -/*! - * @brief Sets secure counter and instruction timer values - * - * This function sets value in RELOAD and START registers - * for instruction timer and secure counter - * - * @param base CDOG peripheral base address - * @param reload reload value - * @param start start value - */ -void CDOG_Start(CDOG_Type *base, uint32_t reload, uint32_t start); - -/*! - * @brief Checks secure counter. - * - * This function compares stop value in handler with secure counter value - * by writting to RELOAD refister. - * - * @param base CDOG peripheral base address - * @param check expected (stop) value - */ -void CDOG_Check(CDOG_Type *base, uint32_t check); - -/*! - * @brief Sets secure counter and instruction timer values - * - * This function sets value in STOP, RELOAD and START registers - * for instruction timer and secure counter. - * - * @param base CDOG peripheral base address - * @param stop expected value which will be compared with value of secure counter - * @param reload reload value for instruction timer - * @param start start value for secure timer - */ -void CDOG_Set(CDOG_Type *base, uint32_t stop, uint32_t reload, uint32_t start); - -/*! - * @brief Add value to secure counter - * - * This function add specified value to secure counter. - * - * @param base CDOG peripheral base address. - * @param add Value to be added. - */ -void CDOG_Add(CDOG_Type *base, uint32_t add); - -/*! - * @brief Add 1 to secure counter - * - * This function add 1 to secure counter. - * - * @param base CDOG peripheral base address. - */ -void CDOG_Add1(CDOG_Type *base); - -/*! - * @brief Add 16 to secure counter - * - * This function add 16 to secure counter. - * - * @param base CDOG peripheral base address. - */ -void CDOG_Add16(CDOG_Type *base); - -/*! - * @brief Add 256 to secure counter - * - * This function add 256 to secure counter. - * - * @param base CDOG peripheral base address. - */ -void CDOG_Add256(CDOG_Type *base); - -/*! - * brief Substract value to secure counter - * - * This function substract specified value to secure counter. - * - * param base CDOG peripheral base address. - * param sub Value to be substracted. - */ -void CDOG_Sub(CDOG_Type *base, uint32_t sub); - -/*! - * @brief Substract 1 from secure counter - * - * This function substract specified 1 from secure counter. - * - * @param base CDOG peripheral base address. - */ -void CDOG_Sub1(CDOG_Type *base); - -/*! - * @brief Substract 16 from secure counter - * - * This function substract specified 16 from secure counter. - * - * @param base CDOG peripheral base address. - */ -void CDOG_Sub16(CDOG_Type *base); - -/*! - * @brief Substract 256 from secure counter - * - * This function substract specified 256 from secure counter. - * - * @param base CDOG peripheral base address. - */ -void CDOG_Sub256(CDOG_Type *base); - -/*! - * @brief Set the CDOG persistent word. - * - * @param base CDOG peripheral base address. - * @param value The value to be written. - */ -void CDOG_WritePersistent(CDOG_Type *base, uint32_t value); - -/*! - * @brief Get the CDOG persistent word. - * - * @param base CDOG peripheral base address. - * @return The persistent word. - */ -uint32_t CDOG_ReadPersistent(CDOG_Type *base); - -/*! @}*/ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @}*/ /* end of group cdog */ - -#endif /* FSL_CDOG_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_clock.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_clock.c deleted file mode 100644 index 3fef68439da..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_clock.c +++ /dev/null @@ -1,3136 +0,0 @@ -/* - * Copyright 2022-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_clock.h" -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.clock" -#endif - -#define NVALMAX (0x100U) -#define PVALMAX (0x20U) -#define MVALMAX (0x10000U) - -#define PLL_MAX_N_DIV 0x100U - -/*-------------------------------------------------------------------------- -!!! If required these #defines can be moved to chip library file -----------------------------------------------------------------------------*/ - -#define PLL_NDIV_VAL_P (0U) /* NDIV is in bits 7:0 */ -#define PLL_NDIV_VAL_M (0xFFUL << PLL_NDIV_VAL_P) -#define PLL_MDIV_VAL_P (0U) /* MDIV is in bits 15:0 */ -#define PLL_MDIV_VAL_M (0xFFFFULL << PLL_MDIV_VAL_P) -#define PLL_PDIV_VAL_P (0U) /* PDIV is in bits 4:0 */ -#define PLL_PDIV_VAL_M (0x1FUL << PLL_PDIV_VAL_P) - -#define PLL_MIN_CCO_FREQ_MHZ (275000000U) -#define PLL_MAX_CCO_FREQ_MHZ (550000000U) -#define PLL_LOWER_IN_LIMIT (32000U) /*!< Minimum PLL input rate */ -#define PLL_HIGHER_IN_LIMIT (150000000U) /*!< Maximum PLL input rate */ -#define PLL_MIN_IN_SSMODE (3000000U) -#define PLL_MAX_IN_SSMODE \ - (100000000U) /*!< Not find the value in UM, Just use the maximum frequency which device support */ - -/* PLL NDIV reg */ -#define PLL_NDIV_VAL_SET(value) (((unsigned long)(value) << PLL_NDIV_VAL_P) & PLL_NDIV_VAL_M) -/* PLL MDIV reg */ -#define PLL_MDIV_VAL_SET(value) (((unsigned long long)(value) << PLL_MDIV_VAL_P) & PLL_MDIV_VAL_M) -/* PLL PDIV reg */ -#define PLL_PDIV_VAL_SET(value) (((unsigned long)(value) << PLL_PDIV_VAL_P) & PLL_PDIV_VAL_M) - -/* PLL SSCG control1 */ -#define PLL_SSCG_MD_FRACT_P 0U -#define PLL_SSCG_MD_INT_P 25U -#define PLL_SSCG_MD_FRACT_M (0x1FFFFFFUL << PLL_SSCG_MD_FRACT_P) -#define PLL_SSCG_MD_INT_M ((uint64_t)0xFFUL << PLL_SSCG_MD_INT_P) - -#define PLL_SSCG_MD_FRACT_SET(value) (((uint64_t)(value) << PLL_SSCG_MD_FRACT_P) & PLL_SSCG_MD_FRACT_M) -#define PLL_SSCG_MD_INT_SET(value) (((uint64_t)(value) << PLL_SSCG_MD_INT_P) & PLL_SSCG_MD_INT_M) - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/** External clock rate on the CLKIN pin in Hz. If not used, - set this to 0. Otherwise, set it to the exact rate in Hz this pin is - being driven at. */ -volatile static uint32_t s_Ext_Clk_Freq = 16000000U; -/*! @brief External XTAL32K clock frequency. */ -volatile static uint32_t s_Xtal32_Freq = 32768U; -/*! @brief SAI MCLK clock frequency. */ -volatile static uint32_t s_Sai_Mclk_Freq[2] = {0U}; -/*! @brief SAI TX BCLK clock frequency. */ -volatile static uint32_t s_Sai_Tx_Bclk_Freq[2] = {0U}; -/*! @brief SAI RX BCLK clock frequency. */ -volatile static uint32_t s_Sai_Rx_Bclk_Freq[2] = {0U}; -/*! @brief ENET TX CLK clock frequency. */ -volatile static uint32_t s_Enet_Tx_Clk_Freq = 0U; - -/*! @brief external UPLL clock frequency. */ -static uint32_t s_extUpllFreq = 0U; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/* Get FRO 12M Clk */ -static uint32_t CLOCK_GetFro12MFreq(void); -/* Get CLK 1M Clk */ -static uint32_t CLOCK_GetClk1MFreq(void); -/* Get HF FRO Clk */ -static uint32_t CLOCK_GetFroHfFreq(void); -/* Get CLK 48M Clk */ -static uint32_t CLOCK_GetClk48MFreq(void); -/* Get CLK 144M Clk */ -static uint32_t CLOCK_GetClk144MFreq(void); -/* Get CLK 16K Clk */ -static uint32_t CLOCK_GetClk16KFreq(uint32_t id); -/* Get EXT OSC Clk */ -static uint32_t CLOCK_GetExtClkFreq(void); -/* Get OSC 32K Clk */ -static uint32_t CLOCK_GetOsc32KFreq(uint32_t id); -/* Get Systick Clk */ -static uint32_t CLOCK_GetSystickClkFreq(uint32_t id); -/* Get CLOCK OUT Clk */ -static uint32_t CLOCK_GetClockOutClkFreq(void); -/* Get LP_OSC Clk */ -static uint32_t CLOCK_GetLposcFreq(void); - -/* Find SELP, SELI, and SELR values for raw M value, max M = MVALMAX */ -static void pllFindSel(uint32_t M, uint32_t *pSelP, uint32_t *pSelI, uint32_t *pSelR); -/* Get predivider (N) from PLL0 NDIV setting */ -static uint32_t findPll0PreDiv(void); -/* Get predivider (N) from PLL1 NDIV setting */ -static uint32_t findPll1PreDiv(void); -/* Get postdivider (P) from PLL0 PDIV setting */ -static uint32_t findPll0PostDiv(void); -/* Get postdivider (P) from PLL1 PDIV setting */ -static uint32_t findPll1PostDiv(void); -/* Get multiplier (M) from PLL0 MDIV and SSCG settings */ -static float findPll0MMult(void); -/* Get multiplier (M) from PLL1 MDIV and SSCG settings */ -static float findPll1MMult(void); -/* Get the greatest common divisor */ -static uint32_t FindGreatestCommonDivisor(uint32_t m, uint32_t n); -/* Set PLL output based on desired output rate */ -static pll_error_t CLOCK_GetPllConfig(uint32_t finHz, uint32_t foutHz, pll_setup_t *pSetup, bool useSS); -/* Set PLL0 output based on desired output rate */ -static pll_error_t CLOCK_GetPllConfigInternal(uint32_t finHz, uint32_t foutHz, pll_setup_t *pSetup, bool useSS); -/* Get PLL input clock rate from setup structure */ -static uint32_t CLOCK_GetPLLInClockRateFromSetup(pll_setup_t *pSetup); -/* Get predivider (N) from setup structure */ -static uint32_t findPllPreDivFromSetup(pll_setup_t *pSetup); -/* Get postdivider (P) from setup structure */ -static uint32_t findPllPostDivFromSetup(pll_setup_t *pSetup); -/* Get multiplier (M) from setup structure */ -static float findPllMMultFromSetup(pll_setup_t *pSetup); - -/******************************************************************************* - * Code - ******************************************************************************/ - -/** - * @brief Initialize the Core clock to given frequency (48 or 144 MHz). - * This function turns on FIRC and select the given frequency as the source of fro_hf - * @param iFreq : Desired frequency (must be one of CLK_FRO_48MHZ or CLK_FRO_144MHZ) - * @return returns success or fail status. - */ -status_t CLOCK_SetupFROHFClocking(uint32_t iFreq) -{ - if ((iFreq != 48000000U) && (iFreq != 144000000U)) - { - return kStatus_Fail; - } - - /* Select 48MHz or 144MHz for FIRC clock */ - SCG0->FIRCCFG = SCG_FIRCCFG_RANGE((iFreq == 48000000U) ? 0 : 1); - - /* Unlock FIRCCSR */ - SCG0->FIRCCSR &= ~SCG_FIRCCSR_LK_MASK; - - /* Enable FIRC 48 MHz clock for peripheral use */ - SCG0->FIRCCSR |= SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_MASK; - /* Enable FIRC 144 MHz clock for peripheral use */ - SCG0->FIRCCSR |= SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN_MASK; - - /* Enable FIRC */ - SCG0->FIRCCSR |= SCG_FIRCCSR_FIRCEN_MASK; - - /* Wait for FIRC clock to be valid. */ - while ((SCG0->FIRCCSR & SCG_FIRCCSR_FIRCVLD_MASK) == 0U) - { - } - - return kStatus_Success; -} - -/** - * @brief Initialize the external osc clock to given frequency. - * @param iFreq : Desired frequency (must be equal to exact rate in Hz) - * @return returns success or fail status. - */ -status_t CLOCK_SetupExtClocking(uint32_t iFreq) -{ - uint8_t range = 0U; - - if ((iFreq >= 16000000U) && (iFreq < 20000000U)) - { - range = 0U; - } - else if ((iFreq >= 20000000U) && (iFreq < 30000000U)) - { - range = 1U; - } - else if ((iFreq >= 30000000U) && (iFreq < 50000000U)) - { - range = 2U; - } - else if ((iFreq >= 50000000U) && (iFreq < 66000000U)) - { - range = 3U; - } - else - { - return kStatus_InvalidArgument; - } - - /* If clock is used by system, return error. */ - if ((SCG0->SOSCCSR & SCG_SOSCCSR_SOSCSEL_MASK) != 0U) - { - return (status_t)kStatus_SCG_Busy; - } - - /* If sosc is used by PLL and PLL is used by system, return error. */ - if ((((SCG0->APLLCTRL & SCG_APLLCTRL_SOURCE_MASK) == 0u) && ((SCG0->APLLCSR & SCG_APLLCSR_APLLSEL_MASK) != 0U)) || - (((SCG0->SPLLCTRL & SCG_SPLLCTRL_SOURCE_MASK) == 0u) && ((SCG0->SPLLCSR & SCG_SPLLCSR_SPLLSEL_MASK) != 0U))) - { - return (status_t)kStatus_SCG_Busy; - } - - /* If configure register is locked, return error. */ - if ((SCG0->SOSCCSR & SCG_SOSCCSR_LK_MASK) != 0U) - { - return kStatus_ReadOnly; - } - - /* De-initializes the SCG SOSC */ - SCG0->SOSCCSR = SCG_SOSCCSR_SOSCERR_MASK; - - /* Enable LDO */ - SCG0->LDOCSR |= SCG_LDOCSR_LDOEN_MASK; - - /* Select SOSC source (internal crystal oscillator) and Configure SOSC range */ - SCG0->SOSCCFG = SCG_SOSCCFG_EREFS_MASK | SCG_SOSCCFG_RANGE(range); - - /* Unlock SOSCCSR */ - SCG0->SOSCCSR &= ~SCG_SOSCCSR_LK_MASK; - - /* Enable SOSC clock monitor and Enable SOSC */ - SCG0->SOSCCSR |= (SCG_SOSCCSR_SOSCCM_MASK | SCG_SOSCCSR_SOSCEN_MASK); - - /* Wait for SOSC clock to be valid. */ - while ((SCG0->SOSCCSR & SCG_SOSCCSR_SOSCVLD_MASK) == 0U) - { - } - - s_Ext_Clk_Freq = iFreq; - - return kStatus_Success; -} - -/** - * @brief Initialize the external reference clock to given frequency. - * @param iFreq : Desired frequency (must be equal to exact rate in Hz) - * @return returns success or fail status. - */ -status_t CLOCK_SetupExtRefClocking(uint32_t iFreq) -{ - uint8_t range = 0U; - - if ((iFreq >= 16000000U) && (iFreq < 20000000U)) - { - range = 0U; - } - else if ((iFreq >= 20000000U) && (iFreq < 30000000U)) - { - range = 1U; - } - else if ((iFreq >= 30000000U) && (iFreq < 50000000U)) - { - range = 2U; - } - else if ((iFreq >= 50000000U) && (iFreq < 66000000U)) - { - range = 3U; - } - else - { - return kStatus_InvalidArgument; - } - - /* If clock is used by system, return error. */ - if ((SCG0->SOSCCSR & SCG_SOSCCSR_SOSCSEL_MASK) != 0U) - { - return (status_t)kStatus_SCG_Busy; - } - - /* If sosc is used by PLL and PLL is used by system, return error. */ - if ((((SCG0->APLLCTRL & SCG_APLLCTRL_SOURCE_MASK) == 0u) && ((SCG0->APLLCSR & SCG_APLLCSR_APLLSEL_MASK) != 0U)) || - (((SCG0->SPLLCTRL & SCG_SPLLCTRL_SOURCE_MASK) == 0u) && ((SCG0->SPLLCSR & SCG_SPLLCSR_SPLLSEL_MASK) != 0U))) - { - return (status_t)kStatus_SCG_Busy; - } - - /* If configure register is locked, return error. */ - if ((SCG0->SOSCCSR & SCG_SOSCCSR_LK_MASK) != 0U) - { - return kStatus_ReadOnly; - } - - /* De-initializes the SCG SOSC */ - SCG0->SOSCCSR = SCG_SOSCCSR_SOSCERR_MASK; - - /* Enable LDO */ - SCG0->LDOCSR |= SCG_LDOCSR_LDOEN_MASK; - - /* Select SOSC source (external reference clock)*/ - SCG0->SOSCCFG &= ~SCG_SOSCCFG_EREFS_MASK; - - /*Configure SOSC range */ - SCG0->SOSCCFG |= SCG_SOSCCFG_RANGE(range); - - /* Unlock SOSCCSR */ - SCG0->SOSCCSR &= ~SCG_SOSCCSR_LK_MASK; - - /* Enable SOSC clock monitor and Enable SOSC */ - SCG0->SOSCCSR |= (SCG_SOSCCSR_SOSCCM_MASK | SCG_SOSCCSR_SOSCEN_MASK); - - /* Wait for SOSC clock to be valid. */ - while ((SCG0->SOSCCSR & SCG_SOSCCSR_SOSCVLD_MASK) == 0U) - { - } - - s_Ext_Clk_Freq = iFreq; - - return kStatus_Success; -} - -/** - * @brief Initialize the OSC 32K. - * @param id : OSC 32 kHz output clock to specified modules - * @return returns success or fail status. - */ -status_t CLOCK_SetupOsc32KClocking(uint32_t id) -{ - /* Enable LDO */ - SCG0->LDOCSR |= SCG_LDOCSR_LDOEN_MASK | SCG_LDOCSR_VOUT_OK_MASK; - - VBAT0->OSCCTLA = - (VBAT0->OSCCTLA & ~(VBAT_OSCCTLA_MODE_EN_MASK | VBAT_OSCCTLA_CAP_SEL_EN_MASK | VBAT_OSCCTLA_OSC_EN_MASK)) | - VBAT_OSCCTLA_MODE_EN(0x0) | VBAT_OSCCTLA_CAP_SEL_EN_MASK | VBAT_OSCCTLA_OSC_EN_MASK; - VBAT0->OSCCTLB = VBAT_OSCCTLB_INVERSE(0xFFF7E); - /* Wait for STATUSA[OSC_RDY] to set. */ - while ((VBAT0->STATUSA & VBAT_STATUSA_OSC_RDY_MASK) == 0U) - { - } - VBAT0->OSCLCKA = VBAT_OSCLCKA_LOCK_MASK; - VBAT0->OSCLCKB &= ~VBAT_OSCLCKA_LOCK_MASK; - - VBAT0->OSCCLKE |= VBAT_OSCCLKE_CLKE(id); - - /* De-initializes the SCG ROSC */ - SCG0->ROSCCSR = SCG_ROSCCSR_ROSCERR_MASK; - - /* Unlock ROSCCSR */ - SCG0->ROSCCSR &= ~SCG_ROSCCSR_LK_MASK; - - /* Enable SOSC clock monitor and Enable ROSC */ - SCG0->ROSCCSR |= SCG_ROSCCSR_ROSCCM_MASK; - - /* Wait for ROSC clock to be valid. */ - while ((SCG0->ROSCCSR & SCG_ROSCCSR_ROSCVLD_MASK) == 0U) - { - } - - s_Xtal32_Freq = 32768U; - - return kStatus_Success; -} - -/** - * @brief Initialize the CLK16K clock. - * @param id : CLK 16 kHz output clock to specified modules - * @return returns success or fail status. - */ -status_t CLOCK_SetupClk16KClocking(uint32_t id) -{ - VBAT0->FROCTLA |= VBAT_FROCTLA_FRO_EN_MASK; - VBAT0->FROCTLB &= ~VBAT_FROCTLB_INVERSE_MASK; - - VBAT0->FROLCKA |= VBAT_FROLCKA_LOCK_MASK; - VBAT0->FROLCKB &= ~VBAT_FROLCKB_LOCK_MASK; - - VBAT0->FROCLKE |= VBAT_FROCLKE_CLKE(id); - - return kStatus_Success; -} - -/** - * @brief Setup FROHF trim. - * @param config : FROHF trim value - * @return returns success or fail status. - */ -status_t CLOCK_FROHFTrimConfig(firc_trim_config_t config) -{ - SCG0->FIRCTCFG = SCG_FIRCTCFG_TRIMDIV(config.trimDiv) | SCG_FIRCTCFG_TRIMSRC(config.trimSrc); - - if (kSCG_FircTrimNonUpdate == config.trimMode) - { - SCG0->FIRCSTAT = SCG_FIRCSTAT_TRIMFINE(config.trimFine); - } - - /* Set trim mode. */ - SCG0->FIRCCSR = (uint32_t)config.trimMode; - - if ((SCG0->FIRCCSR & SCG_FIRCCSR_FIRCERR_MASK) == SCG_FIRCCSR_FIRCERR_MASK) - { - return (status_t)kStatus_Fail; - } - - return (status_t)kStatus_Success; -} - -/** - * @brief Setup FRO 12M trim. - * @param config : FRO 12M trim value - * @return returns success or fail status. - */ -status_t CLOCK_FRO12MTrimConfig(sirc_trim_config_t config) -{ - SCG0->SIRCTCFG = SCG_SIRCTCFG_TRIMDIV(config.trimDiv) | SCG_SIRCTCFG_TRIMSRC(config.trimSrc); - - if (kSCG_SircTrimNonUpdate == config.trimMode) - { - SCG0->SIRCSTAT = SCG_SIRCSTAT_CCOTRIM(config.cltrim); - SCG0->SIRCSTAT = SCG_SIRCSTAT_CCOTRIM(config.ccotrim); - } - - /* Set trim mode. */ - SCG0->SIRCCSR = (uint32_t)config.trimMode; - - if ((SCG0->SIRCCSR & SCG_SIRCCSR_SIRCERR_MASK) == SCG_SIRCCSR_SIRCERR_MASK) - { - return (status_t)kStatus_Fail; - } - - return (status_t)kStatus_Success; -} - -/*! - * @brief Sets the system OSC monitor mode. - * - * This function sets the system OSC monitor mode. The mode can be disabled, - * it can generate an interrupt when the error is disabled, or reset when the error is detected. - * - * @param mode Monitor mode to set. - */ -void CLOCK_SetSysOscMonitorMode(scg_sosc_monitor_mode_t mode) -{ - uint32_t reg = SCG0->SOSCCSR; - - reg &= ~(SCG_SOSCCSR_SOSCCM_MASK | SCG_SOSCCSR_SOSCCMRE_MASK); - - reg |= (uint32_t)mode; - - SCG0->SOSCCSR = reg; -} - -/*! - * @brief Sets the ROSC monitor mode. - * - * This function sets the ROSC monitor mode. The mode can be disabled, - * it can generate an interrupt when the error is disabled, or reset when the error is detected. - * - * @param mode Monitor mode to set. - */ -void CLOCK_SetRoscMonitorMode(scg_rosc_monitor_mode_t mode) -{ - uint32_t reg = SCG0->ROSCCSR; - - reg &= ~(SCG_ROSCCSR_ROSCCM_MASK | SCG_ROSCCSR_ROSCCMRE_MASK); - - reg |= (uint32_t)mode; - - SCG0->ROSCCSR = reg; -} - -/*! - * @brief Sets the UPLL monitor mode. - * - * This function sets the UPLL monitor mode. The mode can be disabled, - * it can generate an interrupt when the error is disabled, or reset when the error is detected. - * - * @param mode Monitor mode to set. - */ -void CLOCK_SetUpllMonitorMode(scg_upll_monitor_mode_t mode) -{ - uint32_t reg = SCG0->UPLLCSR; - - reg &= ~(SCG_UPLLCSR_UPLLCM_MASK | SCG_UPLLCSR_UPLLCMRE_MASK); - - reg |= (uint32_t)mode; - - SCG0->UPLLCSR = reg; -} - -/*! - * @brief Sets the PLL0 monitor mode. - * - * This function sets the PLL0 monitor mode. The mode can be disabled, - * it can generate an interrupt when the error is disabled, or reset when the error is detected. - * - * @param mode Monitor mode to set. - */ -void CLOCK_SetPll0MonitorMode(scg_pll0_monitor_mode_t mode) -{ - uint32_t reg = SCG0->APLLCSR; - - reg &= ~(SCG_APLLCSR_APLLCM_MASK | SCG_APLLCSR_APLLCMRE_MASK); - - reg |= (uint32_t)mode; - - SCG0->APLLCSR = reg; -} - -/*! - * @brief Sets the PLL1 monitor mode. - * - * This function sets the PLL1 monitor mode. The mode can be disabled, - * it can generate an interrupt when the error is disabled, or reset when the error is detected. - * - * @param mode Monitor mode to set. - */ -void CLOCK_SetPll1MonitorMode(scg_pll1_monitor_mode_t mode) -{ - uint32_t reg = SCG0->SPLLCSR; - - reg &= ~(SCG_SPLLCSR_SPLLCM_MASK | SCG_SPLLCSR_SPLLCMRE_MASK); - - reg |= (uint32_t)mode; - - SCG0->SPLLCSR = reg; -} - -/*! - * @brief Set the additional number of wait-states added to account for the ratio of system clock period to flash access - * time during full speed power mode. - * @param system_freq_hz : Input frequency - * @param mode : Active run mode (voltage level). - * @return success or fail status - */ -status_t CLOCK_SetFLASHAccessCyclesForFreq(uint32_t system_freq_hz, run_mode_t mode) -{ - uint32_t num_wait_states_added = 3UL; /* Default 3 additional wait states */ - switch ((uint32_t)mode) - { - case (uint32_t)kMD_Mode: - { - if (system_freq_hz > 50000000U) - { - return kStatus_Fail; - } - if (system_freq_hz > 24000000U) - { - num_wait_states_added = 1U; - } - else - { - num_wait_states_added = 0U; - } - break; - } - case (uint32_t)kSD_Mode: - { - if (system_freq_hz > 100000000U) - { - return kStatus_Fail; - } - if (system_freq_hz > 64000000U) - { - num_wait_states_added = 2U; - } - else if (system_freq_hz > 36000000U) - { - num_wait_states_added = 1U; - } - else - { - num_wait_states_added = 0U; - } - break; - } - case (uint32_t)kOD_Mode: - { - if (system_freq_hz > 150000000U) - { - return kStatus_Fail; - } - if (system_freq_hz > 100000000U) - { - num_wait_states_added = 3U; - } - else if (system_freq_hz > 64000000U) - { - num_wait_states_added = 2U; - } - else if (system_freq_hz > 36000000U) - { - num_wait_states_added = 1U; - } - else - { - num_wait_states_added = 0U; - } - break; - } - default: - num_wait_states_added = 0U; - break; - } - - /* additional wait-states are added */ - FMU0->FCTRL = (FMU0->FCTRL & 0xFFFFFFF0UL) | (num_wait_states_added & 0xFUL); - - return kStatus_Success; -} - -/*! - * @brief Config 32k Crystal Oscillator. - * - * @param base VBAT peripheral base address. - * @param config The pointer to the structure \ref vbat_osc_config_t. - */ -void VBAT_SetOscConfig(VBAT_Type *base, const vbat_osc_config_t *config) -{ - uint32_t tmp32; - - if (config->enableCrystalOscillatorBypass == true) - { - base->OSCCTLA |= VBAT_OSCCTLA_OSC_BYP_EN_MASK; - while ((VBAT0->STATUSA & VBAT_STATUSA_OSC_RDY_MASK) == 0U) - { - } - } - else - { - tmp32 = base->OSCCTLA; - - if (config != NULL) - { - if (config->enableInternalCapBank) - { - tmp32 &= ~(VBAT_OSCCTLA_EXTAL_CAP_SEL_MASK | VBAT_OSCCTLA_XTAL_CAP_SEL_MASK); - tmp32 |= VBAT_OSCCTLA_EXTAL_CAP_SEL(config->extalCap) | VBAT_OSCCTLA_XTAL_CAP_SEL(config->xtalCap); - tmp32 |= VBAT_OSCCTLA_CAP_SEL_EN_MASK; - } - else - { - /* Disable the internal capacitance bank. */ - tmp32 &= ~VBAT_OSCCTLA_CAP_SEL_EN_MASK; - } - - tmp32 &= ~(VBAT_OSCCTLA_COARSE_AMP_GAIN_MASK); - tmp32 |= VBAT_OSCCTLA_COARSE_AMP_GAIN(config->coarseAdjustment); - } - base->OSCCTLA = tmp32; - while ((VBAT0->STATUSA & VBAT_STATUSA_OSC_RDY_MASK) == 0U) - { - } - } -} - -/* Clock Selection for IP */ -/** - * brief Configure the clock selection muxes. - * param connection : Clock to be configured. - * return Nothing - */ -void CLOCK_AttachClk(clock_attach_id_t connection) -{ - uint16_t mux; - uint8_t sel; - uint16_t item; - uint32_t tmp32 = (uint32_t)connection; - uint32_t i; - volatile uint32_t *pClkSel; - - pClkSel = &(SYSCON->SYSTICKCLKSEL0); - - if (kNONE_to_NONE != connection) - { - for (i = 0U; i < 2U; i++) - { - if (tmp32 == 0U) - { - break; - } - item = (uint16_t)GET_ID_ITEM(tmp32); - if (item != 0U) - { - mux = (uint16_t)GET_ID_ITEM_MUX(item); - sel = (uint8_t)GET_ID_ITEM_SEL(item); - if (mux == CM_SCGRCCRSCSCLKSEL) - { - SCG0->RCCR = (SCG0->RCCR & ~(SCG_RCCR_SCS_MASK)) | SCG_RCCR_SCS(sel); - while ((SCG0->CSR & SCG_CSR_SCS_MASK) != SCG_CSR_SCS(sel)) - { - } - } - else - { - ((volatile uint32_t *)pClkSel)[mux] = sel; - } - } - tmp32 = GET_ID_NEXT_ITEM(tmp32); /* pick up next descriptor */ - } - } -} - -/* Return the actual clock attach id */ -/** - * brief Get the actual clock attach id. - * This fuction uses the offset in input attach id, then it reads the actual source value in - * the register and combine the offset to obtain an actual attach id. - * param attachId : Clock attach id to get. - * return Clock source value. - */ -clock_attach_id_t CLOCK_GetClockAttachId(clock_attach_id_t attachId) -{ - uint16_t mux; - uint32_t actualSel; - uint32_t tmp32 = (uint32_t)attachId; - uint32_t i; - uint32_t actualAttachId = 0U; - uint32_t selector = GET_ID_SELECTOR(tmp32); - volatile uint32_t *pClkSel; - - pClkSel = &(SYSCON->SYSTICKCLKSEL0); - - if (kNONE_to_NONE == attachId) - { - return kNONE_to_NONE; - } - - for (i = 0U; i < 2U; i++) - { - mux = (uint16_t)GET_ID_ITEM_MUX(tmp32); - if (tmp32 != 0UL) - { - if (mux == CM_SCGRCCRSCSCLKSEL) - { - actualSel = (uint32_t)((SCG0->RCCR & SCG_RCCR_SCS_MASK) >> SCG_RCCR_SCS_SHIFT); - } - else - { - actualSel = (uint32_t)((volatile uint32_t *)pClkSel)[mux]; - } - - /* Consider the combination of two registers */ - actualAttachId |= CLK_ATTACH_ID(mux, actualSel, i); - } - tmp32 = GET_ID_NEXT_ITEM(tmp32); /*!< pick up next descriptor */ - } - - actualAttachId |= selector; - - return (clock_attach_id_t)actualAttachId; -} - -/* Set IP Clock Divider */ -/** - * brief Setup peripheral clock dividers. - * param div_name : Clock divider name - * param divided_by_value: Value to be divided - * return Nothing - */ -void CLOCK_SetClkDiv(clock_div_name_t div_name, uint32_t divided_by_value) -{ - volatile uint32_t *pClkDiv; - - pClkDiv = &(SYSCON->SYSTICKCLKDIV[0]); - /* halt and reset clock dividers */ - ((volatile uint32_t *)pClkDiv)[(uint32_t)div_name] = 0x3UL << 29U; - - if (divided_by_value == 0U) /*!< halt */ - { - ((volatile uint32_t *)pClkDiv)[(uint32_t)div_name] = 1UL << 30U; - } - else - { - ((volatile uint32_t *)pClkDiv)[(uint32_t)div_name] = (divided_by_value - 1U); - } -} - -/* Get IP clock dividers */ -/** - * brief Get peripheral clock dividers. - * param div_name : Clock divider name - * return peripheral clock dividers - */ -uint32_t CLOCK_GetClkDiv(clock_div_name_t div_name) -{ - uint32_t div; - volatile uint32_t *pClkDiv; - - pClkDiv = &(SYSCON->SYSTICKCLKDIV[0]); - - if ((uint32_t)(((volatile uint32_t *)pClkDiv)[(uint32_t)div_name] & (0x3UL << 29U)) != 0UL) - { - div = 0U; - } - else - { - div = (uint32_t)((((volatile uint32_t *)pClkDiv)[(uint32_t)div_name] & 0xFFU) + 1U); - } - - return div; -} - -/* Halt IP Clock Divider */ -/** - * brief Setup peripheral clock dividers. - * param Halt : Clock divider name - * return Nothing - */ -void CLOCK_HaltClkDiv(clock_div_name_t div_name) -{ - volatile uint32_t *pClkDiv; - - pClkDiv = &(SYSCON->SYSTICKCLKDIV[0]); - - /* halt clock dividers */ - ((volatile uint32_t *)pClkDiv)[(uint32_t)div_name] = 1UL << 30U; - - return; -} - -/* enable system clocks */ -/** - * brief system clocks enable controls. - * param mask : system clocks enable value - * return Nothing - */ -void CLOCK_SetupClockCtrl(uint32_t mask) -{ - SYSCON->CLOCK_CTRL |= mask; - - return; -} - -/* Get IP Clk */ -/*! brief Return Frequency of selected clock - * return Frequency of selected clock - */ -uint32_t CLOCK_GetFreq(clock_name_t clockName) -{ - uint32_t freq = 0U; - - switch (clockName) - { - case kCLOCK_MainClk: - freq = CLOCK_GetMainClkFreq(); - break; - case kCLOCK_CoreSysClk: - freq = CLOCK_GetCoreSysClkFreq(); - break; - case kCLOCK_BusClk: - freq = CLOCK_GetCoreSysClkFreq(); - break; - case kCLOCK_SystickClk0: - freq = CLOCK_GetSystickClkFreq(0U); - break; - case kCLOCK_SystickClk1: - freq = CLOCK_GetSystickClkFreq(1U); - break; - case kCLOCK_ClockOut: - freq = CLOCK_GetClockOutClkFreq(); - break; - case kCLOCK_Clk1M: - freq = CLOCK_GetClk1MFreq(); - break; - case kCLOCK_Fro12M: - freq = CLOCK_GetFro12MFreq(); - break; - case kCLOCK_FroHf: - freq = CLOCK_GetFroHfFreq(); - break; - case kCLOCK_Clk48M: - freq = CLOCK_GetClk48MFreq(); - break; - case kCLOCK_Clk144M: - freq = CLOCK_GetClk144MFreq(); - break; - case kCLOCK_Clk16K0: - freq = CLOCK_GetClk16KFreq((uint32_t)kCLOCK_Clk16KToVbat); - break; - case kCLOCK_Clk16K1: - freq = CLOCK_GetClk16KFreq((uint32_t)kCLOCK_Clk16KToVsys); - break; - case kCLOCK_Clk16K2: - freq = CLOCK_GetClk16KFreq((uint32_t)kCLOCK_Clk16KToWake); - break; - case kCLOCK_Clk16K3: - freq = CLOCK_GetClk16KFreq((uint32_t)kCLOCK_Clk16KToMain); - break; - case kCLOCK_ExtClk: - freq = CLOCK_GetExtClkFreq(); - break; - case kCLOCK_Osc32K0: - freq = CLOCK_GetOsc32KFreq((uint32_t)kCLOCK_Osc32kToVbat); - break; - case kCLOCK_Osc32K1: - freq = CLOCK_GetOsc32KFreq((uint32_t)kCLOCK_Osc32kToVsys); - break; - case kCLOCK_Osc32K2: - freq = CLOCK_GetOsc32KFreq((uint32_t)kCLOCK_Osc32kToWake); - break; - case kCLOCK_Osc32K3: - freq = CLOCK_GetOsc32KFreq((uint32_t)kCLOCK_Osc32kToMain); - break; - case kCLOCK_Pll0Out: - freq = CLOCK_GetPll0OutFreq(); - break; - case kCLOCK_Pll1Out: - freq = CLOCK_GetPll1OutFreq(); - break; - case kCLOCK_UsbPllOut: - // freq = CLOCK_GetPll0OutFreq(); - break; - case kCLOCK_LpOsc: - freq = CLOCK_GetLposcFreq(); - break; - default: - freq = 0U; - break; - } - return freq; -} - -/* Get CTimer Clk */ -/*! brief Return Frequency of CTimer functional Clock - * return Frequency of CTimer functional Clock - */ -uint32_t CLOCK_GetCTimerClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - - switch (SYSCON->CTIMERCLKSEL[id]) - { - case 0U: - freq = CLOCK_GetClk1MFreq(); - break; - case 1U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 2U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK0DIV) & 0xffU) + 1U); - break; - case 3U: - freq = CLOCK_GetFroHfFreq(); - break; - case 4U: - freq = CLOCK_GetFro12MFreq(); - break; - case 5U: - freq = CLOCK_GetSaiMclkFreq(0U); - break; - case 6U: - freq = CLOCK_GetLposcFreq(); - break; - case 8U: - freq = CLOCK_GetSaiMclkFreq(1U); - break; - case 9U: - freq = CLOCK_GetSaiTxBclkFreq(0U); - break; - case 10U: - freq = CLOCK_GetSaiRxBclkFreq(0U); - break; - case 11U: - freq = CLOCK_GetSaiTxBclkFreq(1U); - break; - case 12U: - freq = CLOCK_GetSaiRxBclkFreq(1U); - break; - default: - freq = 0U; - break; - } - - return freq / ((SYSCON->CTIMERCLKDIV[id] & 0xffU) + 1U); -} - -/* Get ADC Clk */ -/*! brief Return Frequency of Adc Clock - * return Frequency of Adc. - */ -uint32_t CLOCK_GetAdcClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - uint32_t div = 0U; - - switch ((id == 0U) ? (SYSCON->ADC0CLKSEL) : (SYSCON->ADC1CLKSEL)) - { - case 1U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 2U: - freq = CLOCK_GetFroHfFreq(); - break; - case 3U: - freq = CLOCK_GetFro12MFreq(); - break; - case 4U: - freq = CLOCK_GetExtClkFreq(); - break; - case 5U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK0DIV) & 0xffU) + 1U); - break; - case 6U: - // freq = CLOCK_GetUPllOutFreq(); - break; - default: - freq = 0U; - break; - } - - div = ((id == 0U) ? ((SYSCON->ADC0CLKDIV & SYSCON_ADC0CLKDIV_DIV_MASK) + 1U) : - ((SYSCON->ADC1CLKDIV & SYSCON_ADC1CLKDIV_DIV_MASK) + 1U)); - - return freq / div; -} - -/* Get USB0 Clk */ -/*! brief Return Frequency of Usb0 Clock - * return Frequency of Usb0 Clock. - */ -uint32_t CLOCK_GetUsb0ClkFreq(void) -{ - uint32_t freq = 0U; - - switch (SYSCON->USB0CLKSEL) - { - case 1U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 3U: - freq = CLOCK_GetFroHfFreq(); - break; - case 4U: - freq = CLOCK_GetExtClkFreq(); - break; - case 5U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK0DIV) & 0xffU) + 1U); - break; - case 6U: - // freq = CLOCK_GetUPllOutFreq(); - break; - case 7U: - freq = 0U; - break; - - default: - freq = 0U; - break; - } - - return freq / ((SYSCON->USB0CLKDIV & 0xffU) + 1U); -} - -/* Get LPFLEXCOMM Clk */ -/*! brief Return Frequency of LPFLEXCOMM Clock - * return Frequency of LPFLEXCOMM Clock. - */ -uint32_t CLOCK_GetLPFlexCommClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - - switch (SYSCON->FCCLKSEL[id]) - { - case 1U: - freq = CLOCK_GetPllClkDivFreq(); - break; - case 2U: - freq = CLOCK_GetFro12MFreq(); - break; - case 3U: - freq = CLOCK_GetFroHfFreq() / ((SYSCON->FROHFDIV & 0xffU) + 1U); - break; - case 4U: - freq = CLOCK_GetClk1MFreq(); - break; - case 5U: - // freq = CLOCK_GetUPllOutFreq(); - break; - case 6U: - freq = CLOCK_GetLposcFreq(); - break; - default: - freq = 0U; - break; - } - - return freq / ((SYSCON->FLEXCOMMCLKDIV[id] & 0xffU) + 1U); -} - -/* Get SCTIMER Clk */ -/*! brief Return Frequency of SCTimer Clock - * return Frequency of SCTimer Clock. - */ -uint32_t CLOCK_GetSctClkFreq(void) -{ - uint32_t freq = 0U; - - switch (SYSCON->SCTCLKSEL) - { - case 1U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 2U: - freq = CLOCK_GetExtClkFreq(); - break; - case 3U: - freq = CLOCK_GetFroHfFreq(); - break; - case 4U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK0DIV) & 0xffU) + 1U); - break; - case 5U: - freq = CLOCK_GetSaiMclkFreq(0U); - break; - case 6U: - // freq = CLOCK_GetUPllOutFreq(); - break; - case 8U: - freq = CLOCK_GetSaiMclkFreq(1U); - break; - default: - freq = 0U; - break; - } - - return freq / ((SYSCON->SCTCLKDIV & 0xffU) + 1U); -} - -/* Get TSI Clk */ -/*! brief Return Frequency of TSI Clock - * return Frequency of TSI Clock. - */ -uint32_t CLOCK_GetTsiClkFreq(void) -{ - uint32_t freq = 0U; - - switch (SYSCON->TSICLKSEL) - { - case 2U: - freq = CLOCK_GetExtClkFreq(); - break; - case 4U: - freq = CLOCK_GetFro12MFreq(); - break; - default: - freq = 0U; - break; - } - - return freq / ((SYSCON->TSICLKDIV & 0xffU) + 1U); -} - -/* Get SINC FILTER Clk */ -/*! brief Return Frequency of SINC FILTER Clock - * return Frequency of SINC FILTER Clock. - */ -uint32_t CLOCK_GetSincFilterClkFreq(void) -{ - uint32_t freq = 0U; - - switch (SYSCON->SINCFILTCLKSEL) - { - case 1U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 2U: - freq = CLOCK_GetExtClkFreq(); - break; - case 3U: - freq = CLOCK_GetFroHfFreq(); - break; - case 4U: - freq = CLOCK_GetFro12MFreq(); - break; - case 5U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK0DIV) & 0xffU) + 1U); - break; - case 6U: - // freq = CLOCK_GetUPllOutFreq(); - default: - freq = 0U; - break; - } - - return freq; -} - -/* Get DAC Clk */ -/*! brief Return Frequency of DAC Clock - * return Frequency of DAC. - */ -uint32_t CLOCK_GetDacClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - - switch (SYSCON->DAC[id].CLKSEL) - { - case 1U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 2U: - freq = CLOCK_GetExtClkFreq(); - break; - case 3U: - freq = CLOCK_GetFroHfFreq(); - break; - case 4U: - freq = CLOCK_GetFro12MFreq(); - break; - case 5U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK0DIV) & 0xffU) + 1U); - break; - default: - freq = 0U; - break; - } - - return freq / ((SYSCON->DAC[id].CLKDIV & SYSCON_DAC_CLKDIV_DIV_MASK) + 1U); -} - -/* Get FlexSpi Clk */ -/*! brief Return Frequency of FlexSpi clock - * return Frequency of FlexSpi Clock - */ -uint32_t CLOCK_GetFlexspiClkFreq(void) -{ - uint32_t freq = 0U; - - switch (SYSCON->FLEXSPICLKSEL) - { - case 1U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 3U: - freq = CLOCK_GetFroHfFreq(); - break; - case 5U: - freq = CLOCK_GetPll1OutFreq(); - break; - case 6U: - // freq = CLOCK_GetUPllOutFreq(); - default: - freq = 0U; - break; - } - - return freq / ((SYSCON->FLEXSPICLKDIV & SYSCON_FLEXSPICLKDIV_DIV_MASK) + 1U); -} - -/* Get SYSTEM PLL0 Clk */ -/*! brief Return Frequency of PLL0 - * return Frequency of PLL0 - */ -uint32_t CLOCK_GetPll0OutFreq(void) -{ - uint32_t clkRate = 0; - uint32_t prediv, postdiv; - float workRate = 0.0F; - - /* Get the input clock frequency of PLL. */ - clkRate = CLOCK_GetPLL0InClockRate(); - - /* If PLL0 is work */ - if (CLOCK_IsPLL0Locked() == true) - { - prediv = findPll0PreDiv(); - postdiv = findPll0PostDiv(); - /* Adjust input clock */ - clkRate = clkRate / prediv; - /* MDEC used for rate */ - workRate = (float)clkRate * (float)findPll0MMult(); - workRate /= (float)postdiv; - } - - return (uint32_t)workRate; -} - -/* Get SYSTEM PLL1 Clk */ -/*! brief Return Frequency of PLL1 - * return Frequency of PLL1 - */ -uint32_t CLOCK_GetPll1OutFreq(void) -{ - uint32_t clkRate = 0; - uint32_t prediv, postdiv; - float workRate = 0.0F; - - /* Get the input clock frequency of PLL. */ - clkRate = CLOCK_GetPLL1InClockRate(); - - /* If PLL1 is work */ - if (CLOCK_IsPLL1Locked() == true) - { - prediv = findPll1PreDiv(); - postdiv = findPll1PostDiv(); - /* Adjust input clock */ - clkRate = clkRate / prediv; - /* MDEC used for rate */ - workRate = (float)clkRate * (float)findPll1MMult(); - workRate /= (float)postdiv; - } - - return (uint32_t)workRate; -} - -/* Get PLLClkDiv Clk */ -/*! brief Return Frequency of PLLClkDiv - * return Frequency of PLLClkDiv - */ -uint32_t CLOCK_GetPllClkDivFreq(void) -{ - uint32_t freq = 0U; - - switch (SYSCON->PLLCLKDIVSEL) - { - case 0U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 1U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK0DIV) & 0xffU) + 1U); - break; - default: - freq = 0U; - break; - } - - return freq / ((SYSCON->PLLCLKDIV & SYSCON_PLLCLKDIV_DIV_MASK) + 1U); -} - -/*! - * brief Gets the external UPLL frequency. - * - * This function gets the external UPLL frequency in Hz. - * - * return The frequency of the external UPLL. - */ -uint32_t CLOCK_GetExtUpllFreq(void) -{ - return s_extUpllFreq; -} - -/*! - * brief Sets the external UPLL frequency. - * - * This function sets the external UPLL frequency in Hz. - * Call this function after the external PLL frequency is changed. - * Otherwise, the APIs, which are used to get the frequency, may return an incorrect value. - * - * param The frequency of external UPLL. - */ -void CLOCK_SetExtUpllFreq(uint32_t freq) -{ - s_extUpllFreq = freq; -} - -/* Get I3C function Clk */ -/*! brief Return Frequency of I3C function clock - * return Frequency of I3C function Clock - */ -uint32_t CLOCK_GetI3cClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - uint32_t div = 0U; - - switch ((id == 0U) ? (SYSCON->I3C0FCLKSEL) : (SYSCON->I3C1FCLKSEL)) - { - case 1U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 2U: - freq = CLOCK_GetExtClkFreq(); - break; - case 3U: - freq = CLOCK_GetFroHfFreq(); - break; - case 5U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK0DIV) & 0xffU) + 1U); - break; - case 6U: - // freq = CLOCK_GetUPllOutFreq(); - default: - freq = 0U; - break; - } - - div = ((id == 0U) ? ((SYSCON->I3C0FCLKDIV & SYSCON_I3C0FCLKDIV_DIV_MASK) + 1U) : - ((SYSCON->I3C1FCLKDIV & SYSCON_I3C1FCLKDIV_DIV_MASK) + 1U)); - - return freq / div; -} - -/* Get I3C function slow TC Clk */ -/*! brief Return Frequency of I3C function Slow TC clock - * return Frequency of I3C function slow TC Clock - */ -uint32_t CLOCK_GetI3cSTCClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - uint32_t div = 0U; - - switch ((id == 0U) ? (SYSCON->I3C0FCLKSTCSEL) : (SYSCON->I3C1FCLKSTCSEL)) - { - case 0U: - switch ((id == 0U) ? (SYSCON->I3C0FCLKSEL) : (SYSCON->I3C1FCLKSEL)) - { - case 1U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 2U: - freq = CLOCK_GetExtClkFreq(); - break; - case 3U: - freq = CLOCK_GetFroHfFreq(); - break; - case 5U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK0DIV) & 0xffU) + 1U); - break; - case 6U: - // freq = CLOCK_GetUPllOutFreq(); - default: - freq = 0U; - break; - } - break; - case 1U: - freq = CLOCK_GetClk1MFreq(); - break; - default: - freq = 0U; - break; - } - - div = ((id == 0U) ? ((SYSCON->I3C0FCLKSTCDIV & SYSCON_I3C0FCLKSTCDIV_DIV_MASK) + 1U) : - ((SYSCON->I3C1FCLKSTCDIV & SYSCON_I3C1FCLKSTCDIV_DIV_MASK) + 1U)); - - return freq / div; -} - -/* Get I3C function slow Clk */ -/*! brief Return Frequency of I3C function Slow clock - * return Frequency of I3C function slow Clock - */ -uint32_t CLOCK_GetI3cSClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - uint32_t div = 0U; - - switch ((id == 0U) ? (SYSCON->I3C0FCLKSSEL) : (SYSCON->I3C1FCLKSSEL)) - { - case 0U: - freq = CLOCK_GetClk1MFreq(); - break; - default: - freq = 0U; - break; - } - - div = ((id == 0U) ? ((SYSCON->I3C0FCLKSDIV & SYSCON_I3C0FCLKSDIV_DIV_MASK) + 1U) : - ((SYSCON->I3C1FCLKSDIV & SYSCON_I3C1FCLKSDIV_DIV_MASK) + 1U)); - - return freq / div; -} - -/* Get MICFIL Clk */ -/*! brief Return Frequency of MICFIL - * return Frequency of MICFIL - */ -uint32_t CLOCK_GetMicfilClkFreq(void) -{ - uint32_t freq = 0U; - - switch (SYSCON->MICFILFCLKSEL) - { - case 0U: - freq = CLOCK_GetFro12MFreq(); - break; - case 1U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 2U: - freq = CLOCK_GetExtClkFreq(); - break; - case 3U: - freq = CLOCK_GetFroHfFreq(); - break; - case 4U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK0DIV) & 0xffU) + 1U); - break; - case 5U: - freq = CLOCK_GetSaiMclkFreq(0U); - break; - case 6U: - // freq = CLOCK_GetUPllOutFreq(); - case 8U: - freq = CLOCK_GetSaiMclkFreq(1U); - break; - default: - freq = 0U; - break; - } - - return freq / ((SYSCON->MICFILFCLKDIV & SYSCON_MICFILFCLKDIV_DIV_MASK) + 1U); -} - -/* Get uSDHC Clk */ -/*! brief Return Frequency of uSDHC - * return Frequency of uSDHC - */ -uint32_t CLOCK_GetUsdhcClkFreq(void) -{ - uint32_t freq = 0U; - - switch (SYSCON->USDHCCLKSEL) - { - case 1U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 2U: - freq = CLOCK_GetExtClkFreq(); - break; - case 3U: - freq = CLOCK_GetFroHfFreq(); - break; - case 4U: - freq = CLOCK_GetFro12MFreq(); - break; - case 5U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK1DIV) & 0xffU) + 1U); - break; - case 6U: - // freq = CLOCK_GetUPllOutFreq(); - default: - freq = 0U; - break; - } - - return freq / ((SYSCON->USDHCCLKDIV & SYSCON_USDHCCLKDIV_DIV_MASK) + 1U); -} - -/* Get FLEXIO Clk */ -/*! brief Return Frequency of FLEXIO - * return Frequency of FLEXIO - */ -uint32_t CLOCK_GetFlexioClkFreq(void) -{ - uint32_t freq = 0U; - - switch (SYSCON->FLEXIOCLKSEL) - { - case 1U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 2U: - freq = CLOCK_GetExtClkFreq(); - break; - case 3U: - freq = CLOCK_GetFroHfFreq(); - break; - case 4U: - freq = CLOCK_GetFro12MFreq(); - break; - case 5U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK0DIV) & 0xffU) + 1U); - break; - case 6U: - // freq = CLOCK_GetUPllOutFreq(); - default: - freq = 0U; - break; - } - - return freq / ((SYSCON->FLEXIOCLKDIV & SYSCON_FLEXIOCLKDIV_DIV_MASK) + 1U); -} - -/* Get FLEXCAN Clk */ -/*! brief Return Frequency of FLEXCAN - * return Frequency of FLEXCAN - */ -uint32_t CLOCK_GetFlexcanClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - uint32_t div = 0U; - - switch ((id == 0U) ? (SYSCON->FLEXCAN0CLKSEL) : (SYSCON->FLEXCAN1CLKSEL)) - { - case 1U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 2U: - freq = CLOCK_GetExtClkFreq(); - break; - case 3U: - freq = CLOCK_GetFroHfFreq(); - break; - case 5U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK0DIV) & 0xffU) + 1U); - break; - case 6U: - // freq = CLOCK_GetUPllOutFreq(); - default: - freq = 0U; - break; - } - - div = ((id == 0U) ? ((SYSCON->FLEXCAN0CLKDIV & SYSCON_FLEXCAN0CLKDIV_DIV_MASK) + 1U) : - ((SYSCON->FLEXCAN1CLKDIV & SYSCON_FLEXCAN1CLKDIV_DIV_MASK) + 1U)); - - return freq / div; -} - -/* Get Ethernet RMII Clk */ -/*! brief Return Frequency of Ethernet RMII - * return Frequency of Ethernet RMII - */ -uint32_t CLOCK_GetEnetRmiiClkFreq(void) -{ - uint32_t freq = 0U; - - switch (SYSCON->ENETRMIICLKSEL) - { - case 1U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 2U: - freq = CLOCK_GetExtClkFreq(); - break; - case 5U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK0DIV) & 0xffU) + 1U); - break; - default: - freq = 0U; - break; - } - - return freq / ((SYSCON->ENETRMIICLKDIV & SYSCON_ENETRMIICLKDIV_DIV_MASK) + 1U); -} - -/* Get Ethernet PTP REF Clk */ -/*! brief Return Frequency of Ethernet PTP REF - * return Frequency of Ethernet PTP REF - */ -uint32_t CLOCK_GetEnetPtpRefClkFreq(void) -{ - uint32_t freq = 0U; - - switch (SYSCON->ENETPTPREFCLKSEL) - { - case 1U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 2U: - freq = CLOCK_GetExtClkFreq(); - break; - case 4U: // Todo enet0_tx_clk clock - freq = 0U; - break; - case 5U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK0DIV) & 0xffU) + 1U); - break; - default: - freq = 0U; - break; - } - - return freq / ((SYSCON->ENETPTPREFCLKDIV & SYSCON_ENETPTPREFCLKDIV_DIV_MASK) + 1U); -} - -/* Get ENET TX CLK */ -/*! brief Initialize the ENET TX CLK to given frequency. - * return Nothing - */ -void CLOCK_SetupEnetTxClk(uint32_t iFreq) -{ - s_Enet_Tx_Clk_Freq = iFreq; - - return; -} - -/* Get ENET TX CLK */ -/*! brief Return Frequency of ENET TX CLK - * return Frequency of ENET TX CLK - */ -uint32_t CLOCK_GetEnetTxClkFreq(void) -{ - return s_Enet_Tx_Clk_Freq; -} - -/* Get EWM0 Clk */ -/*! brief Return Frequency of EWM0 - * return Frequency of EWM0 - */ -uint32_t CLOCK_GetEwm0ClkFreq(void) -{ - uint32_t freq = 0U; - - switch (SYSCON->EWM0CLKSEL) - { - case 1U: - freq = CLOCK_GetClk16KFreq((uint32_t)kCLOCK_Clk16KToWake); - break; - case 2U: - freq = CLOCK_GetOsc32KFreq((uint32_t)kCLOCK_Osc32kToWake); - break; - default: - freq = 0U; - break; - } - - return freq; -} - -/* Get Watchdog Clk */ -/*! brief Return Frequency of Watchdog - * return Frequency of Watchdog - */ -uint32_t CLOCK_GetWdtClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - uint32_t div = 0U; - - if (id == 0U) - { - freq = CLOCK_GetClk1MFreq(); - } - else - { - switch (SYSCON->WDT1CLKSEL) - { - case 0U: - freq = CLOCK_GetClk16KFreq((uint32_t)kCLOCK_Clk16KToWake); - break; - case 1U: - freq = CLOCK_GetFroHfFreq() / ((SYSCON->FROHFDIV & 0xffU) + 1U); - break; - case 2U: - freq = CLOCK_GetClk1MFreq(); - break; - case 3U: - freq = CLOCK_GetClk1MFreq(); - break; - default: - freq = 0U; - break; - } - } - - div = ((id == 0U) ? ((SYSCON->WDT0CLKDIV & SYSCON_WDT0CLKDIV_DIV_MASK) + 1U) : - ((SYSCON->WDT1CLKDIV & SYSCON_WDT1CLKDIV_DIV_MASK) + 1U)); - - return freq / div; -} - -/* Get OSTIMER Clk */ -/*! brief Return Frequency of OSTIMER - * return Frequency of OSTIMER - */ -uint32_t CLOCK_GetOstimerClkFreq(void) -{ - uint32_t freq = 0U; - - switch (SYSCON->OSTIMERCLKSEL) - { - case 0U: - freq = CLOCK_GetClk16KFreq((uint32_t)kCLOCK_Clk16KToWake); - break; - case 1U: - freq = CLOCK_GetOsc32KFreq((uint32_t)kCLOCK_Osc32kToWake); - break; - case 2U: - freq = CLOCK_GetClk1MFreq(); - break; - default: - freq = 0U; - break; - } - - return freq; -} - -/* Get CMP Function Clk */ -/*! brief Return Frequency of CMP Function - * return Frequency of CMP Function - */ -uint32_t CLOCK_GetCmpFClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - uint32_t div = 0U; - - switch ((id == 0U) ? (SYSCON->CMP0FCLKSEL) : ((id == 1U) ? (SYSCON->CMP1FCLKSEL) : (SYSCON->CMP2FCLKSEL))) - { - case 1U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 2U: - freq = CLOCK_GetFroHfFreq(); - break; - case 3U: - freq = CLOCK_GetFro12MFreq(); - break; - case 4U: - freq = CLOCK_GetExtClkFreq(); - break; - case 5U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK0DIV) & 0xffU) + 1U); - break; - case 6U: - // freq = CLOCK_GetUPllOutFreq(); - default: - freq = 0U; - break; - } - - div = ((id == 0U) ? ((SYSCON->CMP0FCLKDIV & SYSCON_CMP0FCLKDIV_DIV_MASK) + 1U) : - ((id == 1U) ? ((SYSCON->CMP1FCLKDIV & SYSCON_CMP1FCLKDIV_DIV_MASK) + 1U) : - ((SYSCON->CMP2FCLKDIV & SYSCON_CMP2FCLKDIV_DIV_MASK) + 1U))); - - return freq / div; -} - -/* Get CMP Round Robin Clk */ -/*! brief Return Frequency of CMP Round Robin - * return Frequency of CMP Round Robin - */ -uint32_t CLOCK_GetCmpRRClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - uint32_t div = 0U; - - switch ((id == 0U) ? (SYSCON->CMP0RRCLKSEL) : ((id == 1U) ? (SYSCON->CMP1RRCLKSEL) : (SYSCON->CMP2RRCLKSEL))) - { - case 1U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 2U: - freq = CLOCK_GetFroHfFreq(); - break; - case 3U: - freq = CLOCK_GetFro12MFreq(); - break; - case 4U: - freq = CLOCK_GetExtClkFreq(); - break; - case 5U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK0DIV) & 0xffU) + 1U); - break; - case 6U: - // freq = CLOCK_GetUPllOutFreq(); - default: - freq = 0U; - break; - } - - div = ((id == 0U) ? ((SYSCON->CMP0RRCLKDIV & SYSCON_CMP0RRCLKDIV_DIV_MASK) + 1U) : - ((id == 1U) ? ((SYSCON->CMP1RRCLKDIV & SYSCON_CMP1RRCLKDIV_DIV_MASK) + 1U) : - ((SYSCON->CMP2RRCLKDIV & SYSCON_CMP2RRCLKDIV_DIV_MASK) + 1U))); - - return freq / div; -} - -/* Get SAI Clk */ -/*! brief Return Frequency of SAI - * return Frequency of SAI - */ -uint32_t CLOCK_GetSaiClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - uint32_t div = 0U; - - switch ((id == 0U) ? (SYSCON->SAI0CLKSEL) : (SYSCON->SAI1CLKSEL)) - { - case 1U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 2U: - freq = CLOCK_GetExtClkFreq(); - break; - case 3U: - freq = CLOCK_GetFroHfFreq(); - break; - case 4U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK0DIV) & 0xffU) + 1U); - break; - case 6U: - // freq = CLOCK_GetUPllOutFreq(); - default: - freq = 0U; - break; - } - - div = ((id == 0U) ? ((SYSCON->SAI0CLKDIV & SYSCON_SAI0CLKDIV_DIV_MASK) + 1U) : - ((SYSCON->SAI1CLKDIV & SYSCON_SAI1CLKDIV_DIV_MASK) + 1U)); - - return freq / div; -} - -/* Get SAI MCLK */ -/*! brief Initialize the SAI MCLK to given frequency. - * return Nothing - */ -void CLOCK_SetupSaiMclk(uint32_t id, uint32_t iFreq) -{ - s_Sai_Mclk_Freq[id] = iFreq; - - return; -} - -/* Get SAI TX BCLK */ -/*! brief Initialize the SAI TX BCLK to given frequency. - * return Nothing - */ -void CLOCK_SetupSaiTxBclk(uint32_t id, uint32_t iFreq) -{ - s_Sai_Tx_Bclk_Freq[id] = iFreq; - - return; -} - -/* Get SAI RX BCLK */ -/*! brief Initialize the SAI RX BCLK to given frequency. - * return Nothing - */ -void CLOCK_SetupSaiRxBclk(uint32_t id, uint32_t iFreq) -{ - s_Sai_Rx_Bclk_Freq[id] = iFreq; - - return; -} - -/* Get SAI MCLK */ -/*! brief Return Frequency of SAI MCLK - * return Frequency of SAI MCLK - */ -uint32_t CLOCK_GetSaiMclkFreq(uint32_t id) -{ - return s_Sai_Mclk_Freq[id]; -} - -/* Get SAI TX BCLK */ -/*! brief Return Frequency of SAI TX BCLK - * return Frequency of SAI TX BCLK - */ -uint32_t CLOCK_GetSaiTxBclkFreq(uint32_t id) -{ - return s_Sai_Tx_Bclk_Freq[id]; -} - -/* Get SAI RX BCLK */ -/*! brief Return Frequency of SAI RX BCLK - * return Frequency of SAI RX BCLK - */ -uint32_t CLOCK_GetSaiRxBclkFreq(uint32_t id) -{ - return s_Sai_Rx_Bclk_Freq[id]; -} - -/* Get EMVSIM Clk */ -/*! brief Return Frequency of EMVSIM - * return Frequency of EMVSIM - */ -uint32_t CLOCK_GetEmvsimClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - uint32_t div = 0U; - - switch ((id == 0U) ? (SYSCON->EMVSIM0CLKSEL) : (SYSCON->EMVSIM1CLKSEL)) - { - case 1U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 2U: - freq = CLOCK_GetExtClkFreq(); - break; - case 3U: - freq = CLOCK_GetFroHfFreq(); - break; - case 4U: - freq = CLOCK_GetFro12MFreq(); - break; - case 5U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK0DIV) & 0xffU) + 1U); - break; - default: - freq = 0U; - break; - } - - div = ((id == 0U) ? ((SYSCON->EMVSIM0CLKDIV & SYSCON_EMVSIM0CLKDIV_DIV_MASK) + 1U) : - ((SYSCON->EMVSIM1CLKDIV & SYSCON_EMVSIM1CLKDIV_DIV_MASK) + 1U)); - - return freq / div; -} - -/* Return System PLL input clock rate */ -/*! brief Return PLL0 input clock rate - * return PLL0 input clock rate - */ -uint32_t CLOCK_GetPLL0InClockRate(void) -{ - uint32_t clkRate = 0U; - - switch ((SCG0->APLLCTRL & SCG_APLLCTRL_SOURCE_MASK) >> SCG_APLLCTRL_SOURCE_SHIFT) - { - case 0x00U: - clkRate = CLOCK_GetExtClkFreq(); - break; - case 0x01U: - clkRate = CLOCK_GetClk48MFreq(); - break; - case 0x02U: - clkRate = CLOCK_GetOsc32KFreq((uint32_t)kCLOCK_Osc32kToVbat); - break; - default: - clkRate = 0U; - break; - } - - return clkRate; -} - -/* Return PLL1 input clock rate */ -uint32_t CLOCK_GetPLL1InClockRate(void) -{ - uint32_t clkRate = 0U; - - switch ((SCG0->SPLLCTRL & SCG_SPLLCTRL_SOURCE_MASK) >> SCG_SPLLCTRL_SOURCE_SHIFT) - { - case 0x00U: - clkRate = CLOCK_GetExtClkFreq(); - break; - case 0x01U: - clkRate = CLOCK_GetClk48MFreq(); - break; - case 0x02U: - clkRate = CLOCK_GetOsc32KFreq((uint32_t)kCLOCK_Osc32kToVbat); - break; - default: - clkRate = 0U; - break; - } - - return clkRate; -} - -/* Return PLL output clock rate from setup structure */ -/*! brief Return PLL0 output clock rate from setup structure - * param pSetup : Pointer to a PLL setup structure - * return PLL0 output clock rate the setup structure will generate - */ -uint32_t CLOCK_GetPLLOutFromSetup(pll_setup_t *pSetup) -{ - uint32_t clkRate = 0; - uint32_t prediv, postdiv; - float workRate = 0.0F; - - /* Get the input clock frequency of PLL. */ - clkRate = CLOCK_GetPLLInClockRateFromSetup(pSetup); - - prediv = findPllPreDivFromSetup(pSetup); - postdiv = findPllPostDivFromSetup(pSetup); - /* Adjust input clock */ - clkRate = clkRate / prediv; - /* MDEC used for rate */ - workRate = (float)clkRate * (float)findPllMMultFromSetup(pSetup); - workRate /= (float)postdiv; - - return (uint32_t)workRate; -} - -/* Set PLL output based on the passed PLL setup data */ -/*! brief Set PLL output based on the passed PLL setup data - * param pControl : Pointer to populated PLL control structure to generate setup with - * param pSetup : Pointer to PLL setup structure to be filled - * return PLL_ERROR_SUCCESS on success, or PLL setup error code - * note Actual frequency for setup may vary from the desired frequency based on the - * accuracy of input clocks, rounding, non-fractional PLL mode, etc. - */ -pll_error_t CLOCK_SetupPLLData(pll_config_t *pControl, pll_setup_t *pSetup) -{ - uint32_t inRate; - bool useSS = (bool)((pControl->flags & PLL_CONFIGFLAG_FORCENOFRACT) == 0UL); - - pll_error_t pllError; - - /* Get PLL Input Clock Rate */ - switch (pControl->inputSource) - { - case (uint32_t)kPll_ClkSrcSysOsc: - inRate = CLOCK_GetExtClkFreq(); - break; - case (uint32_t)kPll_ClkSrcFirc: - inRate = CLOCK_GetClk48MFreq(); - break; - case (uint32_t)kPll_ClkSrcRosc: - inRate = CLOCK_GetOsc32KFreq((uint32_t)kCLOCK_Osc32kToVbat); - break; - default: - inRate = 0U; - break; - } - - /* PLL flag options */ - pllError = CLOCK_GetPllConfig(inRate, pControl->desiredRate, pSetup, useSS); - pSetup->pllctrl |= (uint32_t)pControl->inputSource; - if ((useSS) && (pllError == kStatus_PLL_Success)) - { - /* If using SS mode, then some tweaks are made to the generated setup */ - pSetup->pllsscg[1] |= (uint32_t)pControl->ss_mf | (uint32_t)pControl->ss_mr | (uint32_t)pControl->ss_mc; - if (pControl->mfDither) - { - pSetup->pllsscg[1] |= (1UL << SCG_APLLSSCG1_DITHER_SHIFT); - } - } - - return pllError; -} - -/* Setup PLL Frequency from pre-calculated value */ -/** - * brief Set PLL0 output from PLL setup structure (precise frequency) - * param pSetup : Pointer to populated PLL setup structure - * return kStatus_PLL_Success on success, or PLL setup error code - * note This function will power off the PLL, setup the PLL with the - * new setup data, and then optionally powerup the PLL, wait for PLL lock, - * and adjust system voltages to the new PLL rate. The function will not - * alter any source clocks (ie, main systen clock) that may use the PLL, - * so these should be setup prior to and after exiting the function. - */ -pll_error_t CLOCK_SetPLL0Freq(const pll_setup_t *pSetup) -{ - uint32_t inRate, clkRate, prediv; - - /* Enable LDO */ - SCG0->LDOCSR |= SCG_LDOCSR_LDOEN_MASK; - - /* Power off PLL0 and disable PLL0 clock during setup changes */ - SCG0->APLLCSR &= ~(SCG_APLLCSR_APLLPWREN_MASK | SCG_APLLCSR_APLLCLKEN_MASK); - - /* Write PLL setup data */ - SCG0->APLLCTRL = pSetup->pllctrl; - SCG0->APLLNDIV = pSetup->pllndiv; - SCG0->APLLNDIV = pSetup->pllndiv | (1UL << SCG_APLLNDIV_NREQ_SHIFT); /* latch */ - SCG0->APLLPDIV = pSetup->pllpdiv; - SCG0->APLLPDIV = pSetup->pllpdiv | (1UL << SCG_APLLPDIV_PREQ_SHIFT); /* latch */ - SCG0->APLLMDIV = pSetup->pllmdiv; - SCG0->APLLMDIV = pSetup->pllmdiv | (1UL << SCG_APLLMDIV_MREQ_SHIFT); /* latch */ - SCG0->APLLSSCG0 = pSetup->pllsscg[0]; - SCG0->APLLSSCG1 = pSetup->pllsscg[1]; - - /* Unlock APLLLOCK_CNFG register */ - SCG0->TRIM_LOCK = 0x5a5a0001; - - /* Configure lock time of APLL stable, value = 500us/x+300, where x is the period of clk_ref (clk_in/N). */ - inRate = CLOCK_GetPLL0InClockRate(); - prediv = findPll0PreDiv(); - /* Adjust input clock */ - clkRate = inRate / prediv; - SCG0->APLLLOCK_CNFG = SCG_APLLLOCK_CNFG_LOCK_TIME(clkRate / 2000U + 300U); - - /* Power on PLL0 and enable PLL0 clock */ - SCG0->APLLCSR |= (SCG_APLLCSR_APLLPWREN_MASK | SCG_APLLCSR_APLLCLKEN_MASK); - - /* Wait for APLL lock */ - while (CLOCK_IsPLL0Locked() == false) - { - } - - if (pSetup->pllRate != CLOCK_GetPll0OutFreq()) - { - return kStatus_PLL_OutputError; - } - - return kStatus_PLL_Success; -} - -/* Setup PLL1 Frequency from pre-calculated value */ -/** - * brief Set PLL1 output from PLL setup structure (precise frequency) - * param pSetup : Pointer to populated PLL setup structure - * return kStatus_PLL_Success on success, or PLL setup error code - * note This function will power off the PLL, setup the PLL with the - * new setup data, and then optionally powerup the PLL, wait for PLL lock, - * and adjust system voltages to the new PLL rate. The function will not - * alter any source clocks (ie, main systen clock) that may use the PLL, - * so these should be setup prior to and after exiting the function. - */ -pll_error_t CLOCK_SetPLL1Freq(const pll_setup_t *pSetup) -{ - uint32_t inRate, clkRate, prediv; - - /* Enable LDO */ - SCG0->LDOCSR |= SCG_LDOCSR_LDOEN_MASK; - - /* Power off PLL1 and disable PLL1 clock during setup changes */ - SCG0->SPLLCSR &= ~(SCG_SPLLCSR_SPLLPWREN_MASK | SCG_SPLLCSR_SPLLCLKEN_MASK); - - /* Write PLL setup data */ - SCG0->SPLLCTRL = pSetup->pllctrl; - SCG0->SPLLNDIV = pSetup->pllndiv; - SCG0->SPLLNDIV = pSetup->pllndiv | (1UL << SCG_SPLLNDIV_NREQ_SHIFT); /* latch */ - SCG0->SPLLPDIV = pSetup->pllpdiv; - SCG0->SPLLPDIV = pSetup->pllpdiv | (1UL << SCG_SPLLPDIV_PREQ_SHIFT); /* latch */ - SCG0->SPLLMDIV = pSetup->pllmdiv; - SCG0->SPLLMDIV = pSetup->pllmdiv | (1UL << SCG_SPLLMDIV_MREQ_SHIFT); /* latch */ - SCG0->SPLLSSCG0 = pSetup->pllsscg[0]; - SCG0->SPLLSSCG1 = pSetup->pllsscg[1]; - - /* Unlock SPLLLOCK_CNFG register */ - SCG0->TRIM_LOCK = 0x5a5a0001; - - /* Configure lock time of APLL stable, value = 500μs/x+300, where x is the period of clk_ref (clk_in/N). */ - inRate = CLOCK_GetPLL1InClockRate(); - prediv = findPll1PreDiv(); - /* Adjust input clock */ - clkRate = inRate / prediv; - SCG0->SPLLLOCK_CNFG = SCG_SPLLLOCK_CNFG_LOCK_TIME(clkRate / 2000U + 300U); - - /* Power on PLL1 and enable PLL1 clock */ - SCG0->SPLLCSR |= (SCG_SPLLCSR_SPLLPWREN_MASK | SCG_SPLLCSR_SPLLCLKEN_MASK); - - /* Wait for APLL lock */ - while (CLOCK_IsPLL1Locked() == false) - { - } - - if (pSetup->pllRate != CLOCK_GetPll1OutFreq()) - { - return kStatus_PLL_OutputError; - } - - return kStatus_PLL_Success; -} - -/*! @brief Enable the OSTIMER 32k clock. - * @return Nothing - */ -void CLOCK_EnableOstimer32kClock(void) -{ - // PMC->OSEVENTTIMER |= PMC_OSEVENTTIMER_CLOCKENABLE_MASK; -} - -/* Get FRO 12M Clk */ -/*! brief Return Frequency of FRO 12MHz - * return Frequency of FRO 12MHz - */ -static uint32_t CLOCK_GetFro12MFreq(void) -{ - return ((SCG0->SIRCCSR & SCG_SIRCCSR_SIRC_CLK_PERIPH_EN_MASK) != 0UL) ? 12000000U : 0U; -} - -/* Get CLK 1M Clk */ -/*! brief Return Frequency of CLK 1MHz - * return Frequency of CLK 1MHz - */ -static uint32_t CLOCK_GetClk1MFreq(void) -{ - return 1000000U; -} - -/* Get HF FRO Clk */ -/*! brief Return Frequency of High-Freq output of FRO - * return Frequency of High-Freq output of FRO - */ -static uint32_t CLOCK_GetFroHfFreq(void) -{ - uint32_t freq; - - if ((SCG0->FIRCCSR & SCG_FIRCCSR_FIRCEN_MASK) == 0UL) - { - freq = 0; - } - else if ((SCG0->FIRCCFG & SCG_FIRCCFG_RANGE_MASK) != 0UL) - { - freq = 144000000U; - } - else - { - freq = 48000000U; - } - - return freq; -} - -/* Get CLK 48M Clk */ -/*! brief Return Frequency of CLK 48MHz - * return Frequency of CLK 48MHz - */ -static uint32_t CLOCK_GetClk48MFreq(void) -{ - return ((SCG0->FIRCCSR & SCG_FIRCCSR_FIRC_SCLK_PERIPH_EN_MASK) != 0U) ? 48000000U : 0U; -} - -/* Get CLK 144M Clk */ -/*! brief Return Frequency of CLK 144MHz - * return Frequency of CLK 144MHz - */ -static uint32_t CLOCK_GetClk144MFreq(void) -{ - return ((SCG0->FIRCCSR & SCG_FIRCCSR_FIRC_FCLK_PERIPH_EN_MASK) != 0U) ? 144000000U : 0U; -} - -/* Get CLK 16K Clk */ -/*! brief Return Frequency of CLK 16KHz - * return Frequency of CLK 16KHz - */ -static uint32_t CLOCK_GetClk16KFreq(uint32_t id) -{ - return ((VBAT0->FROCTLA & VBAT_FROCTLA_FRO_EN_MASK) != 0U) ? - (((VBAT0->FROCLKE & VBAT_FROCLKE_CLKE(id)) != 0UL) ? 16000U : 0U) : - 0U; -} - -/* Get EXT OSC Clk */ -/*! brief Return Frequency of External Clock - * return Frequency of External Clock. If no external clock is used returns 0. - */ -static uint32_t CLOCK_GetExtClkFreq(void) -{ - return ((SCG0->SOSCCSR & SCG_SOSCCSR_SOSCVLD_MASK) != 0UL) ? s_Ext_Clk_Freq : 0U; -} - -/* Get RTC OSC Clk */ -/*! brief Return Frequency of 32kHz osc - * return Frequency of 32kHz osc - */ -static uint32_t CLOCK_GetOsc32KFreq(uint32_t id) -{ - return ((SCG0->ROSCCSR & SCG_ROSCCSR_ROSCVLD_MASK) != 0UL) ? - (((VBAT0->OSCCLKE & VBAT_OSCCLKE_CLKE(id)) != 0UL) ? s_Xtal32_Freq : 0U) : - 0U; -} - -/* Get MAIN Clk */ -/*! @brief Return Frequency of main - * @return Frequency of the main - */ -uint32_t CLOCK_GetMainClkFreq(void) -{ - uint32_t freq = 0U; - - switch ((SCG0->CSR & SCG_CSR_SCS_MASK) >> SCG_CSR_SCS_SHIFT) - { - case 1U: - freq = CLOCK_GetExtClkFreq(); - break; - case 2U: - freq = CLOCK_GetFro12MFreq(); - break; - case 3U: - freq = CLOCK_GetFroHfFreq(); - break; - case 4U: - freq = CLOCK_GetOsc32KFreq((uint32_t)kCLOCK_Osc32kToWake); - break; - case 5U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 6U: - freq = CLOCK_GetPll1OutFreq(); - break; - case 7U: - // freq = CLOCK_GetUPllOutFreq(); - break; - default: - freq = 0U; - break; - } - - return freq; -} - -/* Get cpu Clk */ -/*! brief Return Frequency of Core System - * return Frequency of Core System - */ -uint32_t CLOCK_GetCoreSysClkFreq(void) -{ - uint32_t freq = 0U; - - freq = CLOCK_GetMainClkFreq() / ((SYSCON->AHBCLKDIV & 0xffU) + 1U); - - return freq; -} - -/* Get Systick Clk */ -/*! brief Return Frequency of SystickClock - * return Frequency of Systick Clock - */ -static uint32_t CLOCK_GetSystickClkFreq(uint32_t id) -{ - uint32_t freq = 0U; - - switch ((id == 0U) ? SYSCON->SYSTICKCLKSEL0 : SYSCON->SYSTICKCLKSEL1) - { - case 0U: - freq = CLOCK_GetMainClkFreq() / (((SYSCON->SYSTICKCLKDIV[id]) & 0xffU) + 1U); - break; - case 1U: - freq = CLOCK_GetClk1MFreq(); - break; - case 2U: - freq = CLOCK_GetLposcFreq(); - break; - default: - freq = 0U; - break; - } - - return freq; -} - -/* Get CLOCK OUT Clk */ -/*! brief Return Frequency of ClockOut - * return Frequency of ClockOut - */ -static uint32_t CLOCK_GetClockOutClkFreq(void) -{ - uint32_t freq = 0U; - - switch (SYSCON->CLKOUTSEL) - { - case 0U: - freq = CLOCK_GetMainClkFreq(); - break; - case 1U: - freq = CLOCK_GetPll0OutFreq(); - break; - case 2U: - freq = CLOCK_GetExtClkFreq(); - break; - case 3U: - freq = CLOCK_GetFroHfFreq(); - break; - case 4U: - freq = CLOCK_GetFro12MFreq(); - break; - case 5U: - freq = CLOCK_GetPll1OutFreq() / (((SYSCON->PLL1CLK0DIV) & 0xffU) + 1U); - break; - case 6U: - freq = CLOCK_GetLposcFreq(); - break; - case 7U: - // freq = CLOCK_GetUPllOutFreq(); - break; - default: - freq = 0U; - break; - } - return freq / ((SYSCON->CLKOUTDIV & 0xffU) + 1U); -} - -/* Get LP_OSC Clk */ -/*! brief Return Frequency of LP_OSC - * return Frequency of LP_OSC - */ -static uint32_t CLOCK_GetLposcFreq(void) -{ - uint32_t freq = 0U; - - switch ((RTC0->CTRL & RTC_CTRL_CLK_SEL_MASK) >> RTC_CTRL_CLK_SEL_SHIFT) - { - case 0U: - freq = CLOCK_GetClk16KFreq((uint32_t)kCLOCK_Clk16KToVbat); - break; - case 1U: - freq = CLOCK_GetOsc32KFreq((uint32_t)kCLOCK_Osc32kToVbat); - break; - default: - freq = 0U; - break; - } - - return freq; -} - -/* Find SELP, SELI, and SELR values for raw M value, max M = MVALMAX */ -static void pllFindSel(uint32_t M, uint32_t *pSelP, uint32_t *pSelI, uint32_t *pSelR) -{ - uint32_t seli, selp; - /* bandwidth: compute selP from Multiplier */ - if ((SCG0->APLLCTRL & SCG_APLLCTRL_LIMUPOFF_MASK) == 0UL) /* normal mode */ - { - selp = (M >> 2U) + 1U; - if (selp >= 31U) - { - selp = 31U; - } - *pSelP = selp; - - if (M >= 8000UL) - { - seli = 1UL; - } - else if (M >= 122UL) - { - seli = (uint32_t)(8000UL / M); /*floor(8000/M) */ - } - else - { - seli = 2UL * ((uint32_t)(M / 4UL)) + 3UL; /* 2*floor(M/4) + 3 */ - } - - if (seli >= 63UL) - { - seli = 63UL; - } - *pSelI = seli; - - *pSelR = 0U; - } - else - { - /* Note: If the spread spectrum and fractional mode, choose N to ensure 3 MHz < Fin/N < 5 MHz */ - *pSelP = 3U; - *pSelI = 4U; - *pSelR = 4U; - } -} - -/* Get predivider (N) from PLL0 NDIV setting */ -static uint32_t findPll0PreDiv(void) -{ - uint32_t preDiv = 1UL; - - /* Direct input is not used? */ - if ((SCG0->APLLCTRL & SCG_APLLCTRL_BYPASSPREDIV_MASK) == 0UL) - { - preDiv = SCG0->APLLNDIV & SCG_APLLNDIV_NDIV_MASK; - if (preDiv == 0UL) - { - preDiv = 1UL; - } - } - return preDiv; -} - -/* Get predivider (N) from PLL1 NDIV setting */ -static uint32_t findPll1PreDiv(void) -{ - uint32_t preDiv = 1UL; - - /* Direct input is not used? */ - if ((SCG0->SPLLCTRL & SCG_SPLLCTRL_BYPASSPREDIV_MASK) == 0UL) - { - preDiv = SCG0->SPLLNDIV & SCG_SPLLNDIV_NDIV_MASK; - if (preDiv == 0UL) - { - preDiv = 1UL; - } - } - return preDiv; -} - -/* Get postdivider (P) from PLL0 PDIV setting */ -static uint32_t findPll0PostDiv(void) -{ - uint32_t postDiv = 1UL; - - if ((SCG0->APLLCTRL & SCG_APLLCTRL_BYPASSPOSTDIV_MASK) == 0UL) - { - if ((SCG0->APLLCTRL & SCG_APLLCTRL_BYPASSPOSTDIV2_MASK) != 0UL) - { - postDiv = SCG0->APLLPDIV & SCG_APLLPDIV_PDIV_MASK; - } - else - { - postDiv = 2UL * (SCG0->APLLPDIV & SCG_APLLPDIV_PDIV_MASK); - } - if (postDiv == 0UL) - { - postDiv = 2UL; - } - } - - return postDiv; -} - -/* Get postdivider (P) from PLL1 PDIV setting. */ -static uint32_t findPll1PostDiv(void) -{ - uint32_t postDiv = 1UL; - - if ((SCG0->SPLLCTRL & SCG_SPLLCTRL_BYPASSPOSTDIV_MASK) == 0UL) - { - if ((SCG0->SPLLCTRL & SCG_SPLLCTRL_BYPASSPOSTDIV2_MASK) != 0UL) - { - postDiv = SCG0->SPLLPDIV & SCG_SPLLPDIV_PDIV_MASK; - } - else - { - postDiv = 2UL * (SCG0->SPLLPDIV & SCG_SPLLPDIV_PDIV_MASK); - } - if (postDiv == 0UL) - { - postDiv = 2UL; - } - } - - return postDiv; -} - -/* Get multiplier (M) from PLL0 SSCG and SEL_EXT settings */ -static float findPll0MMult(void) -{ - float mMult = 1.0F; - float mMult_fract; - uint32_t mMult_int; - - if ((SCG0->APLLSSCG1 & SCG_APLLSSCG1_SEL_SS_MDIV_MASK) == 0UL) - { - mMult = (float)(uint32_t)(SCG0->APLLMDIV & SCG_APLLMDIV_MDIV_MASK); - } - else - { - mMult_int = ((SCG0->APLLSSCG1 & SCG_APLLSSCG1_SS_MDIV_MSB_MASK) << 7U); - mMult_int = mMult_int | ((SCG0->APLLSSCG0) >> PLL_SSCG_MD_INT_P); - mMult_fract = - ((float)(uint32_t)((SCG0->APLLSSCG0) & PLL_SSCG_MD_FRACT_M) / (float)(uint32_t)(1UL << PLL_SSCG_MD_INT_P)); - mMult = (float)mMult_int + mMult_fract; - } - if (0ULL == ((uint64_t)mMult)) - { - mMult = 1.0F; - } - return mMult; -} - -/* Get multiplier (M) from PLL1 MDEC. */ -static float findPll1MMult(void) -{ - float mMult = 1.0F; - float mMult_fract; - uint32_t mMult_int; - - if ((SCG0->SPLLSSCG1 & SCG_SPLLSSCG1_SEL_SS_MDIV_MASK) == 0UL) - { - mMult = (float)(uint32_t)(SCG0->SPLLMDIV & SCG_SPLLMDIV_MDIV_MASK); - } - else - { - mMult_int = ((SCG0->SPLLSSCG1 & SCG_SPLLSSCG1_SS_MDIV_MSB_MASK) << 7U); - mMult_int = mMult_int | ((SCG0->SPLLSSCG0) >> PLL_SSCG_MD_INT_P); - mMult_fract = - ((float)(uint32_t)((SCG0->SPLLSSCG0) & PLL_SSCG_MD_FRACT_M) / (float)(uint32_t)(1UL << PLL_SSCG_MD_INT_P)); - mMult = (float)mMult_int + mMult_fract; - } - if (0ULL == ((uint64_t)mMult)) - { - mMult = 1.0F; - } - return mMult; -} - -/* Find greatest common divisor between m and n */ -static uint32_t FindGreatestCommonDivisor(uint32_t m, uint32_t n) -{ - uint32_t tmp; - - while (n != 0U) - { - tmp = n; - n = m % n; - m = tmp; - } - - return m; -} - -#if (defined(CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT) && CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT) -/* Alloct the static buffer for cache. */ -static pll_setup_t s_PllSetupCacheStruct[CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT]; -static uint32_t s_FinHzCache[CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT] = {0}; -static uint32_t s_FoutHzCache[CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT] = {0}; -static bool s_UseSSCache[CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT] = {false}; -static uint32_t s_PllSetupCacheIdx = 0U; -#endif /* CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT */ - -/* - * Calculate the PLL setting values from input clock freq to output freq. - */ -static pll_error_t CLOCK_GetPllConfig(uint32_t finHz, uint32_t foutHz, pll_setup_t *pSetup, bool useSS) -{ - pll_error_t retErr; -#if (defined(CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT) && CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT) - uint32_t i; - - for (i = 0U; i < CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT; i++) - { - if ((finHz == s_FinHzCache[i]) && (foutHz == s_FoutHzCache[i]) && (useSS == s_UseSSCache[i])) - { - /* Hit the target in cache buffer. */ - pSetup->pllctrl = s_PllSetupCacheStruct[i].pllctrl; - pSetup->pllndiv = s_PllSetupCacheStruct[i].pllndiv; - pSetup->pllmdiv = s_PllSetupCacheStruct[i].pllmdiv; - pSetup->pllpdiv = s_PllSetupCacheStruct[i].pllpdiv; - pSetup->pllsscg[0] = s_PllSetupCacheStruct[i].pllsscg[0]; - pSetup->pllsscg[1] = s_PllSetupCacheStruct[i].pllsscg[1]; - retErr = kStatus_PLL_Success; - break; - } - } - - if (i < CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT) - { - return retErr; - } -#endif /* CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT */ - - retErr = CLOCK_GetPllConfigInternal(finHz, foutHz, pSetup, useSS); - -#if (defined(CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT) && CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT) - /* Cache the most recent calulation result into buffer. */ - s_FinHzCache[s_PllSetupCacheIdx] = finHz; - s_FoutHzCache[s_PllSetupCacheIdx] = foutHz; - s_UseSSCache[s_PllSetupCacheIdx] = useSS; - - s_PllSetupCacheStruct[s_PllSetupCacheIdx].pllctrl = pSetup->pllctrl; - s_PllSetupCacheStruct[s_PllSetupCacheIdx].pllndiv = pSetup->pllndiv; - s_PllSetupCacheStruct[s_PllSetupCacheIdx].pllmdiv = pSetup->pllmdiv; - s_PllSetupCacheStruct[s_PllSetupCacheIdx].pllpdiv = pSetup->pllpdiv; - s_PllSetupCacheStruct[s_PllSetupCacheIdx].pllsscg[0] = pSetup->pllsscg[0]; - s_PllSetupCacheStruct[s_PllSetupCacheIdx].pllsscg[1] = pSetup->pllsscg[1]; - /* Update the index for next available buffer. */ - s_PllSetupCacheIdx = (s_PllSetupCacheIdx + 1U) % CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT; -#endif /* CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT */ - - return retErr; -} - -/* - * Set PLL output based on desired output rate. - * In this function, the it calculates the PLL0 setting for output frequency from input clock - * frequency. The calculation would cost a few time. So it is not recommaned to use it frequently. - * the "pllctrl", "pllndiv", "pllpdiv", "pllmdiv" would updated in this function. - */ -static pll_error_t CLOCK_GetPllConfigInternal(uint32_t finHz, uint32_t foutHz, pll_setup_t *pSetup, bool useSS) -{ - uint32_t nDivOutHz, fccoHz; - uint32_t pllPreDivider, pllMultiplier, pllPostDivider; - uint32_t pllDirectInput, pllDirectOutput; - uint32_t pllSelP, pllSelI, pllSelR, uplimoff; - - /* Baseline parameters (no input or output dividers) */ - pllPreDivider = 1U; /* 1 implies pre-divider will be disabled */ - pllPostDivider = 1U; /* 1 implies post-divider will be disabled */ - pllDirectOutput = 1U; - - /* Verify output rate parameter */ - if (foutHz > PLL_MAX_CCO_FREQ_MHZ) - { - /* Maximum PLL output with post divider=1 cannot go above this frequency */ - return kStatus_PLL_OutputTooHigh; - } - if (foutHz < (PLL_MIN_CCO_FREQ_MHZ / (PVALMAX << 1U))) - { - /* Minmum PLL output with maximum post divider cannot go below this frequency */ - return kStatus_PLL_OutputTooLow; - } - - /* If using SS mode, input clock needs to be between 3MHz and 20MHz */ - if (useSS) - { - /* Verify input rate parameter */ - if (finHz < PLL_MIN_IN_SSMODE) - { - /* Input clock into the PLL cannot be lower than this */ - return kStatus_PLL_InputTooLow; - } - /* PLL input in SS mode must be under 20MHz */ - if (finHz > (PLL_MAX_IN_SSMODE * NVALMAX)) - { - return kStatus_PLL_InputTooHigh; - } - } - else - { - /* Verify input rate parameter */ - if (finHz < PLL_LOWER_IN_LIMIT) - { - /* Input clock into the PLL cannot be lower than this */ - return kStatus_PLL_InputTooLow; - } - if (finHz > PLL_HIGHER_IN_LIMIT) - { - /* Input clock into the PLL cannot be higher than this */ - return kStatus_PLL_InputTooHigh; - } - } - - /* Find the optimal CCO frequency for the output and input that - will keep it inside the PLL CCO range. This may require - tweaking the post-divider for the PLL. */ - fccoHz = foutHz; - while (fccoHz < PLL_MIN_CCO_FREQ_MHZ) - { - /* CCO output is less than minimum CCO range, so the CCO output - needs to be bumped up and the post-divider is used to bring - the PLL output back down. */ - pllPostDivider++; - if (pllPostDivider > PVALMAX) - { - return kStatus_PLL_OutsideIntLimit; - } - - /* Target CCO goes up, PLL output goes down */ - /* divide-by-2 divider in the post-divider is always work*/ - fccoHz = foutHz * (pllPostDivider * 2U); - pllDirectOutput = 0U; - } - - /* Determine if a pre-divider is needed to get the best frequency */ - if ((finHz > PLL_LOWER_IN_LIMIT) && (fccoHz >= finHz) && (useSS == false)) - { - uint32_t a = FindGreatestCommonDivisor(fccoHz, finHz); - - if (a > PLL_LOWER_IN_LIMIT) - { - a = finHz / a; - if ((a != 0U) && (a < PLL_MAX_N_DIV)) - { - pllPreDivider = a; - } - } - } - - /* Bypass pre-divider hardware if pre-divider is 1 */ - if (pllPreDivider > 1U) - { - pllDirectInput = 0U; - } - else - { - pllDirectInput = 1U; - } - - /* Determine PLL multipler */ - nDivOutHz = (finHz / pllPreDivider); - pllMultiplier = (fccoHz / nDivOutHz); - - /* Find optimal values for filter */ - if (useSS == false) - { - /* Will bumping up M by 1 get us closer to the desired CCO frequency? */ - if ((nDivOutHz * ((pllMultiplier * 2U) + 1U)) < (fccoHz * 2U)) - { - pllMultiplier++; - } - - /* Setup filtering */ - pllFindSel(pllMultiplier, &pllSelP, &pllSelI, &pllSelR); - uplimoff = 0U; - - /* Get encoded value for M (mult) and use manual filter, disable SS mode */ - pSetup->pllmdiv = (uint32_t)PLL_MDIV_VAL_SET(pllMultiplier); - pSetup->pllsscg[1] &= ~SCG_APLLSSCG1_SEL_SS_MDIV_MASK; - } - else - { - uint64_t fc; - - /* Filtering will be handled by SSC */ - pllSelR = 0UL; - pllSelI = 0UL; - pllSelP = 0UL; - uplimoff = 1U; - - /* The PLL multiplier will get very close and slightly under the - desired target frequency. A small fractional component can be - added to fine tune the frequency upwards to the target. */ - fc = ((uint64_t)(uint32_t)(fccoHz % nDivOutHz) << 25UL) / nDivOutHz; - - /* Set multiplier */ - pSetup->pllsscg[0] = (uint32_t)(PLL_SSCG_MD_INT_SET(pllMultiplier) | PLL_SSCG_MD_FRACT_SET((uint32_t)fc)); - pSetup->pllsscg[1] = (uint32_t)(PLL_SSCG_MD_INT_SET(pllMultiplier) >> 32U) | SCG_APLLSSCG1_SEL_SS_MDIV_MASK; - } - - /* Get encoded values for N (prediv) and P (postdiv) */ - pSetup->pllndiv = PLL_NDIV_VAL_SET(pllPreDivider); - pSetup->pllpdiv = PLL_PDIV_VAL_SET(pllPostDivider); - - /* PLL control */ - pSetup->pllctrl = (pllSelR << SCG_APLLCTRL_SELR_SHIFT) | /* Filter coefficient */ - (pllSelI << SCG_APLLCTRL_SELI_SHIFT) | /* Filter coefficient */ - (pllSelP << SCG_APLLCTRL_SELP_SHIFT) | /* Filter coefficient */ - (uplimoff << SCG_APLLCTRL_LIMUPOFF_SHIFT) | /* SS/fractional mode disabled */ - (pllDirectInput << SCG_APLLCTRL_BYPASSPREDIV_SHIFT) | /* Bypass pre-divider? */ - (pllDirectOutput << SCG_APLLCTRL_BYPASSPOSTDIV_SHIFT); /* Bypass post-divider? */ - - return kStatus_PLL_Success; -} - -/* Get PLL input clock rate from setup structure */ -static uint32_t CLOCK_GetPLLInClockRateFromSetup(pll_setup_t *pSetup) -{ - uint32_t clkRate = 0U; - - switch ((pSetup->pllctrl & SCG_APLLCTRL_SOURCE_MASK) >> SCG_APLLCTRL_SOURCE_SHIFT) - { - case 0x00U: - clkRate = CLOCK_GetExtClkFreq(); - break; - case 0x01U: - clkRate = CLOCK_GetClk48MFreq(); - break; - case 0x02U: - clkRate = CLOCK_GetOsc32KFreq((uint32_t)kCLOCK_Osc32kToVbat); - break; - default: - clkRate = 0U; - break; - } - - return clkRate; -} - -/* Get predivider (N) from from setup structure */ -static uint32_t findPllPreDivFromSetup(pll_setup_t *pSetup) -{ - uint32_t preDiv = 1UL; - - /* Direct input is not used? */ - if ((pSetup->pllctrl & SCG_APLLCTRL_BYPASSPREDIV_MASK) == 0UL) - { - preDiv = pSetup->pllndiv & SCG_APLLNDIV_NDIV_MASK; - if (preDiv == 0UL) - { - preDiv = 1UL; - } - } - return preDiv; -} - -/* Get postdivider (P) from from setup structure */ -static uint32_t findPllPostDivFromSetup(pll_setup_t *pSetup) -{ - uint32_t postDiv = 1UL; - - if ((pSetup->pllctrl & SCG_APLLCTRL_BYPASSPOSTDIV_MASK) == 0UL) - { - if ((pSetup->pllctrl & SCG_APLLCTRL_BYPASSPOSTDIV2_MASK) != 0UL) - { - postDiv = pSetup->pllpdiv & SCG_APLLPDIV_PDIV_MASK; - } - else - { - postDiv = 2UL * (pSetup->pllpdiv & SCG_APLLPDIV_PDIV_MASK); - } - if (postDiv == 0UL) - { - postDiv = 2UL; - } - } - - return postDiv; -} - -/* Get multiplier (M) from from setup structure */ -static float findPllMMultFromSetup(pll_setup_t *pSetup) -{ - float mMult = 1.0F; - float mMult_fract; - uint32_t mMult_int; - - if ((pSetup->pllsscg[1] & SCG_APLLSSCG1_SEL_SS_MDIV_MASK) == 0UL) - { - mMult = (float)(uint32_t)(pSetup->pllmdiv & SCG_APLLMDIV_MDIV_MASK); - } - else - { - mMult_int = ((pSetup->pllsscg[1] & SCG_APLLSSCG1_SS_MDIV_MSB_MASK) << 7U); - mMult_int = mMult_int | ((pSetup->pllsscg[0]) >> PLL_SSCG_MD_INT_P); - mMult_fract = ((float)(uint32_t)((pSetup->pllsscg[0]) & PLL_SSCG_MD_FRACT_M) / - (float)(uint32_t)(1UL << PLL_SSCG_MD_INT_P)); - mMult = (float)mMult_int + mMult_fract; - } - if (0ULL == ((uint64_t)mMult)) - { - mMult = 1.0F; - } - return mMult; -} - -/*! brief Enable USB FS clock. - * Enable USB Full Speed clock. - */ -bool CLOCK_EnableUsbfsClock(void) -{ - SYSCON->USB0CLKSEL = 0x3U; /* Clk 48 MHz clock */ - CLOCK_SetClkDiv(kCLOCK_DivUsb0Clk, 1); - SYSCON->USB0CLKDIV &= (uint32_t) ~(SYSCON_USB0CLKDIV_HALT_MASK | SYSCON_USB0CLKDIV_RESET_MASK); - /* Wait until clock change completes */ - while ((SYSCON->USB0CLKDIV & SYSCON_SYSTICKCLKDIV_UNSTAB_MASK) != 0U) - { - } - return true; -} - -/*! brief Enable USB HS PHY PLL clock. - * - * This function enables the internal 480MHz USB PHY PLL clock. - * - * param src USB HS PHY PLL clock source. - * param freq The frequency specified by src. - * retval true The clock is set successfully. - * retval false The clock source is invalid to get proper USB HS clock. - */ -bool CLOCK_EnableUsbhsPhyPllClock(clock_usb_phy_src_t src, uint32_t freq) -{ - uint32_t phyPllDiv = 0U; - uint16_t multiplier = 0U; - bool err = false; - - USBPHY->CTRL_CLR = USBPHY_CTRL_SFTRST_MASK; - USBPHY->ANACTRL_SET = USBPHY_ANACTRL_LVI_EN_MASK; - USBPHY->PLL_SIC_SET = (USBPHY_PLL_SIC_PLL_POWER(1) | USBPHY_PLL_SIC_PLL_REG_ENABLE_MASK); - if ((480000000UL % freq) != 0UL) - { - return false; - } - multiplier = (uint16_t)(480000000UL / freq); - - switch (multiplier) - { - case 15: - { - phyPllDiv = USBPHY_PLL_SIC_PLL_DIV_SEL(0U); - break; - } - case 16: - { - phyPllDiv = USBPHY_PLL_SIC_PLL_DIV_SEL(1U); - break; - } - case 20: - { - phyPllDiv = USBPHY_PLL_SIC_PLL_DIV_SEL(2U); - break; - } - case 22: - { - phyPllDiv = USBPHY_PLL_SIC_PLL_DIV_SEL(3U); - break; - } - case 24: - { - phyPllDiv = USBPHY_PLL_SIC_PLL_DIV_SEL(4U); - break; - } - case 25: - { - phyPllDiv = USBPHY_PLL_SIC_PLL_DIV_SEL(5U); - break; - } - case 30: - { - phyPllDiv = USBPHY_PLL_SIC_PLL_DIV_SEL(6U); - break; - } - case 40: - { - phyPllDiv = USBPHY_PLL_SIC_PLL_DIV_SEL(7U); - break; - } - default: - { - err = true; - break; - } - } - - if (err) - { - return false; - } - - USBPHY->PLL_SIC = (USBPHY->PLL_SIC & ~(USBPHY_PLL_SIC_PLL_DIV_SEL_MASK)) | phyPllDiv; - - USBPHY->PLL_SIC_CLR = USBPHY_PLL_SIC_PLL_BYPASS_MASK; - USBPHY->PLL_SIC_SET = (USBPHY_PLL_SIC_PLL_EN_USB_CLKS_MASK); - - USBPHY->CTRL_CLR = USBPHY_CTRL_CLR_CLKGATE_MASK; - USBPHY->PWD = 0x0U; - - while (0UL == (USBPHY->PLL_SIC & USBPHY_PLL_SIC_PLL_LOCK_MASK)) - { - } - - return true; -} - -/*! brief Disable USB HS PHY PLL clock. - * - * This function disables USB HS PHY PLL clock. - */ -void CLOCK_DisableUsbhsPhyPllClock(void) -{ - USBPHY->CTRL |= USBPHY_CTRL_CLKGATE_MASK; /* Set to 1U to gate clocks */ -} - -/*! brief Enable USB HS clock. - * retval true The clock is set successfully. - * retval false The clock source is invalid to get proper USB HS clock. - */ -bool CLOCK_EnableUsbhsClock(void) -{ - USBHS1__USBC->USBCMD |= USBHS_USBCMD_RST_MASK; - /* Add a delay between RST and RS so make sure there is a DP pullup sequence*/ - for (uint32_t i = 0; i < 400000U; i++) - { - __ASM("nop"); - } - return true; -} - -/** - * @brief FIRC Auto Trim With SOF. - * @return returns success or fail status. - */ -status_t CLOCK_FIRCAutoTrimWithSOF(void) -{ - /* System OSC Clock Monitor is disabled */ - CLOCK_SetSysOscMonitorMode(kSCG_SysOscMonitorDisable); - - firc_trim_config_t fircAutoTrimConfig = { - .trimMode = kSCG_FircTrimUpdate, /* FIRC trim is enabled and trim value update is enabled */ - .trimSrc = kSCG_FircTrimSrcUsb0, /* Trim source is USB0 start of frame (1kHz) */ - .trimDiv = 1U, /* Divided value */ - .trimCoar = 0U, /* Trim value, see Reference Manual for more information */ - .trimFine = 0U, /* Trim value, see Reference Manual for more information */ - }; - - return CLOCK_FROHFTrimConfig(fircAutoTrimConfig); -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_clock.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_clock.h deleted file mode 100644 index 9e0ea282e3c..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_clock.h +++ /dev/null @@ -1,2052 +0,0 @@ -/* - * Copyright 2022-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _FSL_CLOCK_H_ -#define _FSL_CLOCK_H_ - -#include "fsl_common.h" - -/*! @addtogroup clock */ -/*! @{ */ - -/*! @file */ - -/******************************************************************************* - * Definitions - *****************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief CLOCK driver version 1.0.1. */ -#define FSL_CLOCK_DRIVER_VERSION (MAKE_VERSION(1, 0, 1)) -/*@}*/ - -/*! @brief Configure whether driver controls clock - * - * When set to 0, peripheral drivers will enable clock in initialize function - * and disable clock in de-initialize function. When set to 1, peripheral - * driver will not control the clock, application could control the clock out of - * the driver. - * - * @note All drivers share this feature switcher. If it is set to 1, application - * should handle clock enable and disable for all drivers. - */ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)) -#define FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL 0 -#endif - -/*! - * @brief User-defined the size of cache for CLOCK_PllGetConfig() function. - * - * Once define this MACRO to be non-zero value, CLOCK_PllGetConfig() function - * would cache the recent calulation and accelerate the execution to get the - * right settings. - */ -#ifndef CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT -#define CLOCK_USR_CFG_PLL_CONFIG_CACHE_COUNT 2U -#endif - -/* Definition for delay API in clock driver, users can redefine it to the real application. */ -#ifndef SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY -#define SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY (150000000UL) -#endif - -/*! @brief Clock ip name array for ROM. */ -#define ROM_CLOCKS \ - { \ - kCLOCK_Rom \ - } -/*! @brief Clock ip name array for SRAM. */ -#define SRAM_CLOCKS \ - { \ - kCLOCK_Sram1, kCLOCK_Sram2, kCLOCK_Sram3, kCLOCK_Sram4, kCLOCK_Sram5, kCLOCK_Sram6, kCLOCK_Sram7 \ - } -/*! @brief Clock ip name array for FMC. */ -#define FMC_CLOCKS \ - { \ - kCLOCK_Fmc \ - } -/*! @brief Clock ip name array for INPUTMUX. */ -#define INPUTMUX_CLOCKS \ - { \ - kCLOCK_InputMux0 \ - } -/*! @brief Clock ip name array for ENET. */ -#define ETH_CLOCKS \ - { \ - kCLOCK_Enet \ - } -/*! @brief Clock ip name array for GPIO. */ -#define GPIO_CLOCKS \ - { \ - kCLOCK_Gpio0, kCLOCK_Gpio1, kCLOCK_Gpio2, kCLOCK_Gpio3, kCLOCK_Gpio4 \ - } -/*! @brief Clock ip name array for PINT. */ -#define PINT_CLOCKS \ - { \ - kCLOCK_Pint \ - } -/*! @brief Clock ip name array for DMA. */ -#define DMA_CLOCKS \ - { \ - kCLOCK_Dma0, kCLOCK_Dma1 \ - } -/*! @brief Clock gate name array for EDMA. */ -#define EDMA_CLOCKS \ - { \ - kCLOCK_Dma0, kCLOCK_Dma1 \ - } -/*! @brief Clock ip name array for CRC. */ -#define CRC_CLOCKS \ - { \ - kCLOCK_Crc0 \ - } -/*! @brief Clock ip name array for WWDT. */ -#define WWDT_CLOCKS \ - { \ - kCLOCK_Wwdt0, kCLOCK_Wwdt1 \ - } -/*! @brief Clock ip name array for Mailbox. */ -#define MAILBOX_CLOCKS \ - { \ - kCLOCK_Mailbox \ - } -/*! @brief Clock ip name array for LPADC. */ -#define LPADC_CLOCKS \ - { \ - kCLOCK_Adc0, kCLOCK_Adc1 \ - } -/*! @brief Clock ip name array for MRT. */ -#define MRT_CLOCKS \ - { \ - kCLOCK_Mrt \ - } -/*! @brief Clock ip name array for OSTIMER. */ -#define OSTIMER_CLOCKS \ - { \ - kCLOCK_OsTimer \ - } -/*! @brief Clock ip name array for SCT0. */ -#define SCT_CLOCKS \ - { \ - kCLOCK_Sct \ - } -/*! @brief Clock ip name array for UTICK. */ -#define UTICK_CLOCKS \ - { \ - kCLOCK_Utick \ - } -/*! @brief Clock ip name array for LP_FLEXCOMM. */ -#define LP_FLEXCOMM_CLOCKS \ - { \ - kCLOCK_LPFlexComm0, kCLOCK_LPFlexComm1, kCLOCK_LPFlexComm2, kCLOCK_LPFlexComm3, kCLOCK_LPFlexComm4, \ - kCLOCK_LPFlexComm5, kCLOCK_LPFlexComm6, kCLOCK_LPFlexComm7, kCLOCK_LPFlexComm8, kCLOCK_LPFlexComm9 \ - } -/*! @brief Clock ip name array for LPUART. */ -#define LPUART_CLOCKS \ - { \ - kCLOCK_LPUart0, kCLOCK_LPUart1, kCLOCK_LPUart2, kCLOCK_LPUart3, kCLOCK_LPUart4, kCLOCK_LPUart5, \ - kCLOCK_LPUart6, kCLOCK_LPUart7, kCLOCK_LPUart8, kCLOCK_LPUart9 \ - } -/*! @brief Clock ip name array for LPI2C. */ -#define LPI2C_CLOCKS \ - { \ - kCLOCK_LPI2c0, kCLOCK_LPI2c1, kCLOCK_LPI2c2, kCLOCK_LPI2c3, kCLOCK_LPI2c4, kCLOCK_LPI2c5, kCLOCK_LPI2c6, \ - kCLOCK_LPI2c7, kCLOCK_LPI2c8, kCLOCK_LPI2c9 \ - } -/*! @brief Clock ip name array for LSPI. */ -#define LPSPI_CLOCKS \ - { \ - kCLOCK_LPSpi0, kCLOCK_LPSpi1, kCLOCK_LPSpi2, kCLOCK_LPSpi3, kCLOCK_LPSpi4, kCLOCK_LPSpi5, kCLOCK_LPSpi6, \ - kCLOCK_LPSpi7, kCLOCK_LPSpi8, kCLOCK_LPSpi9 \ - } -/*! @brief Clock ip name array for CTIMER. */ -#define CTIMER_CLOCKS \ - { \ - kCLOCK_Timer0, kCLOCK_Timer1, kCLOCK_Timer2, kCLOCK_Timer3, kCLOCK_Timer4 \ - } -/*! @brief Clock ip name array for FREQME. */ -#define FREQME_CLOCKS \ - { \ - kCLOCK_Freqme \ - } -/*! @brief Clock ip name array for PowerQuad. */ -#define POWERQUAD_CLOCKS \ - { \ - kCLOCK_PowerQuad \ - } -/*! @brief Clock ip name array for PLU. */ -#define PLU_CLOCKS \ - { \ - kCLOCK_PluLut \ - } -/*! @brief Clock ip name array for PUF. */ -#define PUF_CLOCKS \ - { \ - kCLOCK_Puf \ - } -/*! @brief Clock ip name array for VREF. */ -#define VREF_CLOCKS \ - { \ - kCLOCK_Vref \ - } -/*! @brief Clock ip name array for LPDAC. */ -#define LPDAC_CLOCKS \ - { \ - kCLOCK_Dac0, kCLOCK_Dac1 \ - } -/*! @brief Clock ip name array for HPDAC. */ -#define HPDAC_CLOCKS \ - { \ - kCLOCK_Dac2 \ - } -/*! @brief Clock ip name array for PWM. */ -#define PWM_CLOCKS \ - { \ - {kCLOCK_Pwm0_Sm0, kCLOCK_Pwm0_Sm1, kCLOCK_Pwm0_Sm2, kCLOCK_Pwm0_Sm3}, \ - { \ - kCLOCK_Pwm1_Sm0, kCLOCK_Pwm1_Sm1, kCLOCK_Pwm1_Sm2, kCLOCK_Pwm1_Sm3 \ - } \ - } -/*! @brief Clock ip name array for QDC. */ -#define QDC_CLOCKS \ - { \ - kCLOCK_Qdc0, kCLOCK_Qdc1 \ - } -/*! @brief Clock ip name array for FLEXIO. */ -#define FLEXIO_CLOCKS \ - { \ - kCLOCK_Flexio \ - } -/*! @brief Clock ip name array for FLEXCAN. */ -#define FLEXCAN_CLOCKS \ - { \ - kCLOCK_Flexcan0, kCLOCK_Flexcan1 \ - } -/*! @brief Clock ip name array for EMVSIM. */ -#define EMVSIM_CLOCKS \ - { \ - kCLOCK_Evsim0, kCLOCK_Evsim1 \ - } -/*! @brief Clock ip name array for I3C */ -#define I3C_CLOCKS \ - { \ - kCLOCK_I3c0, kCLOCK_I3c1 \ - } -/*! @brief Clock ip name array for USDHC. */ -#define USDHC_CLOCKS \ - { \ - kCLOCK_uSdhc \ - } -/*! @brief Clock ip name array for FLEXSPI */ -#define FLEXSPI_CLOCKS \ - { \ - kCLOCK_Flexspi \ - } -/*! @brief Clock ip name array for SAI. */ -#define SAI_CLOCKS \ - { \ - kCLOCK_Sai0, kCLOCK_Sai1 \ - } -/*! @brief Clock ip name array for RTC. */ -#define RTC_CLOCKS \ - { \ - kCLOCK_Rtc0 \ - } -/*! @brief Clock ip name array for PDM. */ -#define PDM_CLOCKS \ - { \ - kCLOCK_Micfil \ - } -/*! @brief Clock ip name array for ERM. */ -#define ERM_CLOCKS \ - { \ - kCLOCK_Erm \ - } -/*! @brief Clock ip name array for EIM. */ -#define EIM_CLOCKS \ - { \ - kCLOCK_Eim \ - } -/*! @brief Clock ip name array for OPAMP. */ -#define OPAMP_CLOCKS \ - { \ - kCLOCK_Opamp0, kCLOCK_Opamp1, kCLOCK_Opamp2 \ - } -/*! @brief Clock ip name array for TSI. */ -#define TSI_CLOCKS \ - { \ - kCLOCK_Tsi \ - } -/*! @brief Clock ip name array for TRNG. */ -#define TRNG_CLOCKS \ - { \ - kCLOCK_Trng \ - } -/*! @brief Clock ip name array for LPCMP. */ -#define LPCMP_CLOCKS \ - { \ - kCLOCK_None, kCLOCK_None, kCLOCK_Cmp2 \ - } -/*! @brief Clock ip name array for SINC */ -#define SINC_CLOCKS \ - { \ - kCLOCK_Sinc \ - } -/*! @brief Clock ip name array for SEMA42 */ -#define SEMA42_CLOCKS \ - { \ - kCLOCK_Sema42 \ - } -/*! @brief Clock gate name used for CLOCK_EnableClock/CLOCK_DisableClock. */ -/*------------------------------------------------------------------------------ - clock_ip_name_t definition: -------------------------------------------------------------------------------*/ - -#define CLK_GATE_REG_OFFSET_SHIFT 8U -#define CLK_GATE_REG_OFFSET_MASK 0xFFFFFF00U -#define CLK_GATE_BIT_SHIFT_SHIFT 0U -#define CLK_GATE_BIT_SHIFT_MASK 0x000000FFU - -#define CLK_GATE_DEFINE(reg_offset, bit_shift) \ - ((((reg_offset) << CLK_GATE_REG_OFFSET_SHIFT) & CLK_GATE_REG_OFFSET_MASK) | \ - (((bit_shift) << CLK_GATE_BIT_SHIFT_SHIFT) & CLK_GATE_BIT_SHIFT_MASK)) - -#define CLK_GATE_ABSTRACT_REG_OFFSET(x) (((uint32_t)(x)&CLK_GATE_REG_OFFSET_MASK) >> CLK_GATE_REG_OFFSET_SHIFT) -#define CLK_GATE_ABSTRACT_BITS_SHIFT(x) (((uint32_t)(x)&CLK_GATE_BIT_SHIFT_MASK) >> CLK_GATE_BIT_SHIFT_SHIFT) - -#define AHB_CLK_CTRL0 0 -#define AHB_CLK_CTRL1 1 -#define AHB_CLK_CTRL2 2 -#define AHB_CLK_CTRL3 3 -#define REG_PWM0SUBCTL 250 -#define REG_PWM1SUBCTL 251 - -/*! @brief Clock gate name used for CLOCK_EnableClock/CLOCK_DisableClock. */ -typedef enum _clock_ip_name -{ - kCLOCK_IpInvalid = 0U, /*!< Invalid Ip Name. */ - kCLOCK_None = 0U, /*!< None clock gate. */ - - kCLOCK_Rom = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 1), /*!< Clock gate name: Rom. */ - kCLOCK_Sram1 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 2), /*!< Clock gate name: Sram1. */ - kCLOCK_Sram2 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 3), /*!< Clock gate name: Sram2. */ - kCLOCK_Sram3 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 4), /*!< Clock gate name: Sram3. */ - kCLOCK_Sram4 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 5), /*!< Clock gate name: Sram4. */ - kCLOCK_Sram5 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 6), /*!< Clock gate name: Sram5. */ - kCLOCK_Sram6 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 7), /*!< Clock gate name: Sram6. */ - kCLOCK_Sram7 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 8), /*!< Clock gate name: Sram7. */ - kCLOCK_Fmu = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 9), /*!< Clock gate name: Fmu. */ - kCLOCK_Fmc = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 10), /*!< Clock gate name: Fmc. */ - kCLOCK_Flexspi = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 11), /*!< Clock gate name: Flexspi. */ - kCLOCK_InputMux0 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 12), /*!< Clock gate name: InputMux0. */ - kCLOCK_InputMux = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 12), /*!< Clock gate name: InputMux0. */ - kCLOCK_Port0 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 13), /*!< Clock gate name: Port0. */ - kCLOCK_Port1 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 14), /*!< Clock gate name: Port1. */ - kCLOCK_Port2 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 15), /*!< Clock gate name: Port2. */ - kCLOCK_Port3 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 16), /*!< Clock gate name: Port3. */ - kCLOCK_Port4 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 17), /*!< Clock gate name: Port4. */ - kCLOCK_Gpio0 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 19), /*!< Clock gate name: Gpio0. */ - kCLOCK_Gpio1 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 20), /*!< Clock gate name: Gpio1. */ - kCLOCK_Gpio2 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 21), /*!< Clock gate name: Gpio2. */ - kCLOCK_Gpio3 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 22), /*!< Clock gate name: Gpio3. */ - kCLOCK_Gpio4 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 23), /*!< Clock gate name: Gpio4. */ - kCLOCK_Pint = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 25), /*!< Clock gate name: Pint. */ - kCLOCK_Dma0 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 26), /*!< Clock gate name: Dma0. */ - kCLOCK_Crc0 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 27), /*!< Clock gate name: Crc. */ - kCLOCK_Wwdt0 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 28), /*!< Clock gate name: Wwdt0. */ - kCLOCK_Wwdt1 = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 29), /*!< Clock gate name: Wwdt1. */ - kCLOCK_Mailbox = CLK_GATE_DEFINE(AHB_CLK_CTRL0, 31), /*!< Clock gate name: Mailbox. */ - - kCLOCK_Mrt = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 0), /*!< Clock gate name: Mrt. */ - kCLOCK_OsTimer = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 1), /*!< Clock gate name: OsTimer. */ - kCLOCK_Sct = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 2), /*!< Clock gate name: Sct. */ - kCLOCK_Adc0 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 3), /*!< Clock gate name: Adc0. */ - kCLOCK_Adc1 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 4), /*!< Clock gate name: Adc1. */ - kCLOCK_Dac0 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 5), /*!< Clock gate name: Dac0. */ - kCLOCK_Rtc0 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 6), /*!< Clock gate name: Rtc. */ - kCLOCK_Evsim0 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 8), /*!< Clock gate name: Evsim0. */ - kCLOCK_Evsim1 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 9), /*!< Clock gate name: Evsim1. */ - kCLOCK_Utick = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 10), /*!< Clock gate name: Utick. */ - kCLOCK_LPFlexComm0 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 11), /*!< Clock gate name: LPFlexComm0. */ - kCLOCK_LPFlexComm1 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 12), /*!< Clock gate name: LPFlexComm1. */ - kCLOCK_LPFlexComm2 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 13), /*!< Clock gate name: LPFlexComm2. */ - kCLOCK_LPFlexComm3 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 14), /*!< Clock gate name: LPFlexComm3. */ - kCLOCK_LPFlexComm4 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 15), /*!< Clock gate name: LPFlexComm4. */ - kCLOCK_LPFlexComm5 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 16), /*!< Clock gate name: LPFlexComm5. */ - kCLOCK_LPFlexComm6 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 17), /*!< Clock gate name: LPFlexComm6. */ - kCLOCK_LPFlexComm7 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 18), /*!< Clock gate name: LPFlexComm7. */ - kCLOCK_LPFlexComm8 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 19), /*!< Clock gate name: LPFlexComm8. */ - kCLOCK_LPFlexComm9 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 20), /*!< Clock gate name: LPFlexComm9. */ - kCLOCK_LPUart0 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 11), /*!< Clock gate name: LPUart0. */ - kCLOCK_LPUart1 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 12), /*!< Clock gate name: LPUart1. */ - kCLOCK_LPUart2 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 13), /*!< Clock gate name: LPUart2. */ - kCLOCK_LPUart3 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 14), /*!< Clock gate name: LPUart3. */ - kCLOCK_LPUart4 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 15), /*!< Clock gate name: LPUart4. */ - kCLOCK_LPUart5 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 16), /*!< Clock gate name: LPUart5. */ - kCLOCK_LPUart6 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 17), /*!< Clock gate name: LPUart6. */ - kCLOCK_LPUart7 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 18), /*!< Clock gate name: LPUart7. */ - kCLOCK_LPUart8 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 19), /*!< Clock gate name: LPUart8. */ - kCLOCK_LPUart9 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 20), /*!< Clock gate name: LPUart9. */ - kCLOCK_LPSpi0 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 11), /*!< Clock gate name: LPSpi0. */ - kCLOCK_LPSpi1 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 12), /*!< Clock gate name: LPSpi1. */ - kCLOCK_LPSpi2 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 13), /*!< Clock gate name: LPSpi2. */ - kCLOCK_LPSpi3 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 14), /*!< Clock gate name: LPSpi3. */ - kCLOCK_LPSpi4 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 15), /*!< Clock gate name: LPSpi4. */ - kCLOCK_LPSpi5 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 16), /*!< Clock gate name: LPSpi5. */ - kCLOCK_LPSpi6 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 17), /*!< Clock gate name: LPSpi6. */ - kCLOCK_LPSpi7 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 18), /*!< Clock gate name: LPSpi7. */ - kCLOCK_LPSpi8 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 19), /*!< Clock gate name: LPSpi8. */ - kCLOCK_LPSpi9 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 20), /*!< Clock gate name: LSpi9. */ - kCLOCK_LPI2c0 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 11), /*!< Clock gate name: LPI2c0. */ - kCLOCK_LPI2c1 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 12), /*!< Clock gate name: LPI2c1. */ - kCLOCK_LPI2c2 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 13), /*!< Clock gate name: LPI2c2. */ - kCLOCK_LPI2c3 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 14), /*!< Clock gate name: LPI2c3. */ - kCLOCK_LPI2c4 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 15), /*!< Clock gate name: LPI2c4. */ - kCLOCK_LPI2c5 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 16), /*!< Clock gate name: LPI2c5. */ - kCLOCK_LPI2c6 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 17), /*!< Clock gate name: LPI2c6. */ - kCLOCK_LPI2c7 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 18), /*!< Clock gate name: LPI2c7. */ - kCLOCK_LPI2c8 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 19), /*!< Clock gate name: LPI2c8. */ - kCLOCK_LPI2c9 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 20), /*!< Clock gate name: LPI2c9. */ - kCLOCK_Micfil = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 21), /*!< Clock gate name: Micfil. */ - kCLOCK_Timer2 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 22), /*!< Clock gate name: Timer2. */ - kCLOCK_Usb0Ram = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 23), /*!< Clock gate name: Usb0Ram. */ - kCLOCK_Usb0FsDcd = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 24), /*!< Clock gate name: Usb0FsDcd. */ - kCLOCK_Usb0Fs = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 25), /*!< Clock gate name: Usb0Fs. */ - kCLOCK_Timer0 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 26), /*!< Clock gate name: Timer0. */ - kCLOCK_Timer1 = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 27), /*!< Clock gate name: Timer1. */ - kCLOCK_PkcRam = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 29), /*!< Clock gate name: PkcRam. */ - kCLOCK_Smartdma = CLK_GATE_DEFINE(AHB_CLK_CTRL1, 31), /*!< Clock gate name: SmartDma. */ - - kCLOCK_Espi = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 0), /*!< Clock gate name: Espi. */ - kCLOCK_Dma1 = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 1), /*!< Clock gate name: Dma1. */ - kCLOCK_Enet = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 2), /*!< Clock gate name: Enet. */ - kCLOCK_uSdhc = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 3), /*!< Clock gate name: uSdhc. */ - kCLOCK_Flexio = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 4), /*!< Clock gate name: Flexio. */ - kCLOCK_Sai0 = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 5), /*!< Clock gate name: Sai0. */ - kCLOCK_Sai1 = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 6), /*!< Clock gate name: Sai1. */ - kCLOCK_Tro = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 7), /*!< Clock gate name: Tro. */ - kCLOCK_Freqme = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 8), /*!< Clock gate name: Freqme. */ - kCLOCK_Trng = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 13), /*!< Clock gate name: Trng. */ - kCLOCK_Flexcan0 = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 14), /*!< Clock gate name: Flexcan0. */ - kCLOCK_Flexcan1 = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 15), /*!< Clock gate name: Flexcan1. */ - kCLOCK_UsbHs = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 16), /*!< Clock gate name: UsbHs. */ - kCLOCK_UsbHsPhy = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 17), /*!< Clock gate name: UsbHsPhy. */ - kCLOCK_Css = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 18), /*!< Clock gate name: Css. */ - kCLOCK_PowerQuad = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 19), /*!< Clock gate name: PowerQuad. */ - kCLOCK_PluLut = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 20), /*!< Clock gate name: PluLut. */ - kCLOCK_Timer3 = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 21), /*!< Clock gate name: Timer3. */ - kCLOCK_Timer4 = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 22), /*!< Clock gate name: Timer4. */ - kCLOCK_Puf = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 23), /*!< Clock gate name: Puf. */ - kCLOCK_Pkc = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 24), /*!< Clock gate name: Pkc. */ - kCLOCK_Scg = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 26), /*!< Clock gate name: Scg. */ - kCLOCK_Gdet = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 29), /*!< Clock gate name: Gdet. */ - kCLOCK_Sm3 = CLK_GATE_DEFINE(AHB_CLK_CTRL2, 30), /*!< Clock gate name: Sm3. */ - - kCLOCK_I3c0 = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 0), /*!< Clock gate name: I3c0. */ - kCLOCK_I3c1 = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 1), /*!< Clock gate name: I3c1. */ - kCLOCK_Sinc = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 2), /*!< Clock gate name: Sinc. */ - kCLOCK_CoolFlux = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 3), /*!< Clock gate name: CoolFlux. */ - kCLOCK_Qdc0 = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 4), /*!< Clock gate name: Qdc0. */ - kCLOCK_Qdc1 = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 5), /*!< Clock gate name: Qdc1. */ - kCLOCK_Pwm0 = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 6), /*!< Clock gate name: Pwm0. */ - kCLOCK_Pwm1 = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 7), /*!< Clock gate name: Pwm1. */ - kCLOCK_Evtg = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 8), /*!< Clock gate name: Evtg. */ - kCLOCK_Dac1 = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 11), /*!< Clock gate name: Dac1. */ - kCLOCK_Dac2 = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 12), /*!< Clock gate name: Dac2. */ - kCLOCK_Opamp0 = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 13), /*!< Clock gate name: Opamp0. */ - kCLOCK_Opamp1 = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 14), /*!< Clock gate name: Opamp1. */ - kCLOCK_Opamp2 = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 15), /*!< Clock gate name: Opamp2. */ - kCLOCK_Cmp2 = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 18), /*!< Clock gate name: Cmp2. */ - kCLOCK_Vref = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 19), /*!< Clock gate name: Vref. */ - kCLOCK_CoolFluxApb = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 20), /*!< Clock gate name: CoolFluxApb. */ - kCLOCK_Neutron = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 21), /*!< Clock gate name: Neutron. */ - kCLOCK_Tsi = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 22), /*!< Clock gate name: Tsi. */ - kCLOCK_Ewm = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 23), /*!< Clock gate name: Ewm. */ - kCLOCK_Ewm0 = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 23), /*!< Clock gate name: Ewm. */ - kCLOCK_Eim = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 24), /*!< Clock gate name: Eim. */ - kCLOCK_Erm = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 25), /*!< Clock gate name: Erm. */ - kCLOCK_Intm = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 26), /*!< Clock gate name: Intm. */ - kCLOCK_Sema42 = CLK_GATE_DEFINE(AHB_CLK_CTRL3, 27), /*!< Clock gate name: Sema42. */ - - kCLOCK_Pwm0_Sm0 = CLK_GATE_DEFINE(REG_PWM0SUBCTL, 0U), /*!< Clock gate name: PWM0 SM0. */ - kCLOCK_Pwm0_Sm1 = CLK_GATE_DEFINE(REG_PWM0SUBCTL, 1U), /*!< Clock gate name: PWM0 SM1. */ - kCLOCK_Pwm0_Sm2 = CLK_GATE_DEFINE(REG_PWM0SUBCTL, 2U), /*!< Clock gate name: PWM0 SM2. */ - kCLOCK_Pwm0_Sm3 = CLK_GATE_DEFINE(REG_PWM0SUBCTL, 3U), /*!< Clock gate name: PWM0 SM3. */ - - kCLOCK_Pwm1_Sm0 = CLK_GATE_DEFINE(REG_PWM1SUBCTL, 0U), /*!< Clock gate name: PWM1 SM0. */ - kCLOCK_Pwm1_Sm1 = CLK_GATE_DEFINE(REG_PWM1SUBCTL, 1U), /*!< Clock gate name: PWM1 SM1. */ - kCLOCK_Pwm1_Sm2 = CLK_GATE_DEFINE(REG_PWM1SUBCTL, 2U), /*!< Clock gate name: PWM1 SM2. */ - kCLOCK_Pwm1_Sm3 = CLK_GATE_DEFINE(REG_PWM1SUBCTL, 3U) /*!< Clock gate name: PWM1 SM3. */ - -} clock_ip_name_t; - -/*! @brief Peripherals clock source definition. */ -#define BUS_CLK kCLOCK_BusClk - -#define I2C0_CLK_SRC BUS_CLK - -/*! @brief Clock name used to get clock frequency. */ -typedef enum _clock_name -{ - kCLOCK_MainClk, /*!< Main clock */ - kCLOCK_CoreSysClk, /*!< Core/system clock */ - kCLOCK_BusClk, /*!< Bus clock (AHB clock) */ - kCLOCK_SystickClk0, /*!< Systick clock0 */ - kCLOCK_SystickClk1, /*!< Systick clock1 */ - kCLOCK_ClockOut, /*!< CLOCKOUT */ - kCLOCK_Fro12M, /*!< FRO12M */ - kCLOCK_Clk1M, /*!< CLK1M */ - kCLOCK_FroHf, /*!< FRO48/144 */ - kCLOCK_Clk48M, /*!< CLK48M */ - kCLOCK_Clk144M, /*!< CLK144M */ - kCLOCK_Clk16K0, /*!< CLK16K[0] */ - kCLOCK_Clk16K1, /*!< CLK16K[1] */ - kCLOCK_Clk16K2, /*!< CLK16K[2] */ - kCLOCK_Clk16K3, /*!< CLK16K[3] */ - kCLOCK_ExtClk, /*!< External Clock */ - kCLOCK_Osc32K0, /*!< OSC32K[0] */ - kCLOCK_Osc32K1, /*!< OSC32K[1] */ - kCLOCK_Osc32K2, /*!< OSC32K[2] */ - kCLOCK_Osc32K3, /*!< OSC32K[3] */ - kCLOCK_Pll0Out, /*!< PLL0 Output */ - kCLOCK_Pll1Out, /*!< PLL1 Output */ - kCLOCK_UsbPllOut, /*!< USB PLL Output */ - kCLOCK_LpOsc, /*!< lp_osc */ -} clock_name_t; - -/*! @brief Clock Mux Switches - * The encoding is as follows each connection identified is 32bits wide while 24bits are valuable - * starting from LSB upwards - * - * [4 bits for choice, 0 means invalid choice] [8 bits mux ID]* - * - */ - -#define CLK_ATTACH_ID(mux, sel, pos) \ - ((((uint32_t)(mux) << 0U) | (((uint32_t)(sel) + 1U) & 0xFU) << 12U) << ((uint32_t)(pos)*16U)) -#define MUX_A(mux, sel) CLK_ATTACH_ID((mux), (sel), 0U) -#define MUX_B(mux, sel, selector) (CLK_ATTACH_ID((mux), (sel), 1U) | ((selector) << 24U)) - -#define GET_ID_ITEM(connection) ((connection)&0xFFFFU) -#define GET_ID_NEXT_ITEM(connection) ((connection) >> 16U) -#define GET_ID_ITEM_MUX(connection) (((uint16_t)connection) & 0xFFFU) -#define GET_ID_ITEM_SEL(connection) ((uint8_t)((((uint32_t)(connection)&0xF000U) >> 12U) - 1U)) -#define GET_ID_SELECTOR(connection) ((connection)&0xF000000U) - -#define CM_SYSTICKCLKSEL0 0U -#define CM_SYSTICKCLKSEL1 ((0x264 - 0x260) / 4) -#define CM_TRACECLKSEL ((0x268 - 0x260) / 4) -#define CM_CTIMERCLKSEL0 ((0x26C - 0x260) / 4) -#define CM_CTIMERCLKSEL1 ((0x270 - 0x260) / 4) -#define CM_CTIMERCLKSEL2 ((0x274 - 0x260) / 4) -#define CM_CTIMERCLKSEL3 ((0x278 - 0x260) / 4) -#define CM_CTIMERCLKSEL4 ((0x27C - 0x260) / 4) -#define CM_CLKOUTCLKSEL ((0x288 - 0x260) / 4) -#define CM_ADC0CLKSEL ((0x2A4 - 0x260) / 4) -#define CM_USB0CLKSEL ((0x2A8 - 0x260) / 4) -#define CM_FCCLKSEL0 ((0x2B0 - 0x260) / 4) -#define CM_FCCLKSEL1 ((0x2B4 - 0x260) / 4) -#define CM_FCCLKSEL2 ((0x2B8 - 0x260) / 4) -#define CM_FCCLKSEL3 ((0x2BC - 0x260) / 4) -#define CM_FCCLKSEL4 ((0x2C0 - 0x260) / 4) -#define CM_FCCLKSEL5 ((0x2C4 - 0x260) / 4) -#define CM_FCCLKSEL6 ((0x2C8 - 0x260) / 4) -#define CM_FCCLKSEL7 ((0x2CC - 0x260) / 4) -#define CM_FCCLKSEL8 ((0x2D0 - 0x260) / 4) -#define CM_FCCLKSEL9 ((0x2D4 - 0x260) / 4) -#define CM_SCTCLKSEL ((0x2F0 - 0x260) / 4) -#define CM_TSICLKSEL ((0x350 - 0x260) / 4) -#define CM_SINCFILTCLKSEL ((0x360 - 0x260) / 4) -#define CM_ADC1CLKSEL ((0x464 - 0x260) / 4) -#define CM_DAC0CLKSEL ((0x490 - 0x260) / 4) -#define CM_DAC1CLKSEL ((0x498 - 0x260) / 4) -#define CM_DAC2CLKSEL ((0x4A0 - 0x260) / 4) -#define CM_FLEXSPICLKSEL ((0x4A8 - 0x260) / 4) -#define CM_PLLCLKDIVSEL ((0x52C - 0x260) / 4) -#define CM_I3C0FCLKSEL ((0x530 - 0x260) / 4) -#define CM_I3C0FCLKSTCSEL ((0x534 - 0x260) / 4) -#define CM_I3C0FCLKSSEL ((0x544 - 0x260) / 4) -#define CM_MICFILFCLKSEL ((0x548 - 0x260) / 4) -#define CM_ESPICLKSEL ((0x550 - 0x260) / 4) -#define CM_USDHCCLKSEL ((0x558 - 0x260) / 4) -#define CM_FLEXIOCLKSEL ((0x560 - 0x260) / 4) -#define CM_FLEXCAN0CLKSEL ((0x5A0 - 0x260) / 4) -#define CM_FLEXCAN1CLKSEL ((0x5A8 - 0x260) / 4) -#define CM_ENETRMIICLKSEL ((0x5B0 - 0x260) / 4) -#define CM_ENETPTPREFCLKSEL ((0x5B8 - 0x260) / 4) -#define CM_EWM0CLKSEL ((0x5D4 - 0x260) / 4) -#define CM_WDT1CLKSEL ((0x5D8 - 0x260) / 4) -#define CM_OSTIMERCLKSEL ((0x5E0 - 0x260) / 4) -#define CM_CMP0FCLKSEL ((0x5F0 - 0x260) / 4) -#define CM_CMP0RRCLKSEL ((0x5F8 - 0x260) / 4) -#define CM_CMP1FCLKSEL ((0x600 - 0x260) / 4) -#define CM_CMP1RRCLKSEL ((0x608 - 0x260) / 4) -#define CM_CMP2FCLKSEL ((0x610 - 0x260) / 4) -#define CM_CMP2RRCLKSEL ((0x618 - 0x260) / 4) -#define CM_SAI0CLKSEL ((0x880 - 0x260) / 4) -#define CM_SAI1CLKSEL ((0x884 - 0x260) / 4) -#define CM_EMVSIM0CLKSEL ((0x890 - 0x260) / 4) -#define CM_EMVSIM1CLKSEL ((0x894 - 0x260) / 4) -#define CM_I3C1FCLKSEL ((0xB30 - 0x260) / 4) -#define CM_I3C1FCLKSTCSEL ((0xB34 - 0x260) / 4) -#define CM_I3C1FCLKSSEL ((0xB44 - 0x260) / 4) - -#define CM_SCGRCCRSCSCLKSEL 0x3FEU - -/*! - * @brief The enumerator of clock attach Id. - */ -typedef enum _clock_attach_id -{ - kCLK_IN_to_MAIN_CLK = MUX_A(CM_SCGRCCRSCSCLKSEL, 1), /*!< Attach clk_in to MAIN_CLK. */ - kFRO12M_to_MAIN_CLK = MUX_A(CM_SCGRCCRSCSCLKSEL, 2), /*!< Attach FRO_12M to MAIN_CLK. */ - kFRO_HF_to_MAIN_CLK = MUX_A(CM_SCGRCCRSCSCLKSEL, 3), /*!< Attach FRO_HF to MAIN_CLK. */ - kXTAL32K2_to_MAIN_CLK = MUX_A(CM_SCGRCCRSCSCLKSEL, 4), /*!< Attach xtal32k[2] to MAIN_CLK. */ - kPLL0_to_MAIN_CLK = MUX_A(CM_SCGRCCRSCSCLKSEL, 5), /*!< Attach PLL0 to MAIN_CLK. */ - kPLL1_to_MAIN_CLK = MUX_A(CM_SCGRCCRSCSCLKSEL, 6), /*!< Attach PLL1 to MAIN_CLK. */ - kUSB_PLL_to_MAIN_CLK = MUX_A(CM_SCGRCCRSCSCLKSEL, 7), /*!< Attach USB PLL to MAIN_CLK. */ - kNONE_to_MAIN_CLK = MUX_A(CM_SCGRCCRSCSCLKSEL, 15), /*!< Attach NONE to MAIN_CLK. */ - - kSYSTICK_DIV0_to_SYSTICK0 = MUX_A(CM_SYSTICKCLKSEL0, 0), /*!< Attach SYSTICK_DIV0 to SYSTICK0. */ - kCLK_1M_to_SYSTICK0 = MUX_A(CM_SYSTICKCLKSEL0, 1), /*!< Attach Clk 1 MHz to SYSTICK0. */ - kLPOSC_to_SYSTICK0 = MUX_A(CM_SYSTICKCLKSEL0, 2), /*!< Attach LP Oscillator to SYSTICK0. */ - kNONE_to_SYSTICK0 = MUX_A(CM_SYSTICKCLKSEL0, 7), /*!< Attach NONE to SYSTICK0. */ - - kSYSTICK_DIV1_to_SYSTICK1 = MUX_A(CM_SYSTICKCLKSEL1, 0), /*!< Attach SYSTICK_DIV1 to SYSTICK1. */ - kCLK_1M_to_SYSTICK1 = MUX_A(CM_SYSTICKCLKSEL1, 1), /*!< Attach Clk 1 MHz to SYSTICK1. */ - kLPOSC_to_SYSTICK1 = MUX_A(CM_SYSTICKCLKSEL1, 2), /*!< Attach LP Oscillator to SYSTICK1. */ - kNONE_to_SYSTICK1 = MUX_A(CM_SYSTICKCLKSEL1, 7), /*!< Attach NONE to SYSTICK1. */ - - kTRACE_DIV_to_TRACE = MUX_A(CM_TRACECLKSEL, 0), /*!< Attach TRACE_DIV to TRACE. */ - kCLK_1M_to_TRACE = MUX_A(CM_TRACECLKSEL, 1), /*!< Attach Clk 1 MHz to TRACE. */ - kLPOSC_to_TRACE = MUX_A(CM_TRACECLKSEL, 2), /*!< Attach LP Oscillator to TRACE. */ - kNONE_to_TRACE = MUX_A(CM_TRACECLKSEL, 7), /*!< Attach NONE to TRACE. */ - - kCLK_1M_to_CTIMER0 = MUX_A(CM_CTIMERCLKSEL0, 0), /*!< Attach CLK_1M to CTIMER0. */ - kPLL0_to_CTIMER0 = MUX_A(CM_CTIMERCLKSEL0, 1), /*!< Attach PLL0 to CTIMER0. */ - kPLL1_CLK0_to_CTIMER0 = MUX_A(CM_CTIMERCLKSEL0, 2), /*!< Attach PLL1_clk0 to CTIMER0. */ - kFRO_HF_to_CTIMER0 = MUX_A(CM_CTIMERCLKSEL0, 3), /*!< Attach FRO_HF to CTIMER0. */ - kFRO12M_to_CTIMER0 = MUX_A(CM_CTIMERCLKSEL0, 4), /*!< Attach FRO 12MHz to CTIMER0. */ - kSAI0_MCLK_IN_to_CTIMER0 = MUX_A(CM_CTIMERCLKSEL0, 5), /*!< Attach SAI0 MCLK IN to CTIMER0. */ - kLPOSC_to_CTIMER0 = MUX_A(CM_CTIMERCLKSEL0, 6), /*!< Attach LP Oscillator to CTIMER0. */ - kSAI1_MCLK_IN_to_CTIMER0 = MUX_A(CM_CTIMERCLKSEL0, 8), /*!< Attach SAI1 MCLK IN to CTIMER0. */ - kSAI0_TX_BCLK_to_CTIMER0 = MUX_A(CM_CTIMERCLKSEL0, 9), /*!< Attach SAI0 TX_BCLK to CTIMER0. */ - kSAI0_RX_BCLK_to_CTIMER0 = MUX_A(CM_CTIMERCLKSEL0, 10), /*!< Attach SAI0 RX_BCLK to CTIMER0. */ - kSAI1_TX_BCLK_to_CTIMER0 = MUX_A(CM_CTIMERCLKSEL0, 11), /*!< Attach SAI1 TX_BCLK to CTIMER0. */ - kSAI1_RX_BCLK_to_CTIMER0 = MUX_A(CM_CTIMERCLKSEL0, 12), /*!< Attach SAI1 RX_BCLK to CTIMER0. */ - kNONE_to_CTIMER0 = MUX_A(CM_CTIMERCLKSEL0, 15), /*!< Attach NONE to CTIMER0. */ - - kCLK_1M_to_CTIMER1 = MUX_A(CM_CTIMERCLKSEL1, 0), /*!< Attach CLK_1M to CTIMER1. */ - kPLL0_to_CTIMER1 = MUX_A(CM_CTIMERCLKSEL1, 1), /*!< Attach PLL0 to CTIMER1. */ - kPLL1_CLK0_to_CTIMER1 = MUX_A(CM_CTIMERCLKSEL1, 2), /*!< Attach PLL1_clk0 to CTIMER1. */ - kFRO_HF_to_CTIMER1 = MUX_A(CM_CTIMERCLKSEL1, 3), /*!< Attach FRO_HF to CTIMER1. */ - kFRO12M_to_CTIMER1 = MUX_A(CM_CTIMERCLKSEL1, 4), /*!< Attach FRO 12MHz to CTIMER1. */ - kSAI0_MCLK_IN_to_CTIMER1 = MUX_A(CM_CTIMERCLKSEL1, 5), /*!< Attach SAI0 MCLK IN to CTIMER1. */ - kLPOSC_to_CTIMER1 = MUX_A(CM_CTIMERCLKSEL1, 6), /*!< Attach LP Oscillator to CTIMER1. */ - kSAI1_MCLK_IN_to_CTIMER1 = MUX_A(CM_CTIMERCLKSEL1, 8), /*!< Attach SAI1 MCLK IN to CTIMER1. */ - kSAI0_TX_BCLK_to_CTIMER1 = MUX_A(CM_CTIMERCLKSEL1, 9), /*!< Attach SAI0 TX_BCLK to CTIMER1. */ - kSAI0_RX_BCLK_to_CTIMER1 = MUX_A(CM_CTIMERCLKSEL1, 10), /*!< Attach SAI0 RX_BCLK to CTIMER1. */ - kSAI1_TX_BCLK_to_CTIMER1 = MUX_A(CM_CTIMERCLKSEL1, 11), /*!< Attach SAI1 TX_BCLK to CTIMER1. */ - kSAI1_RX_BCLK_to_CTIMER1 = MUX_A(CM_CTIMERCLKSEL1, 12), /*!< Attach SAI1 RX_BCLK to CTIMER1. */ - kNONE_to_CTIMER1 = MUX_A(CM_CTIMERCLKSEL1, 15), /*!< Attach NONE to CTIMER1. */ - - kCLK_1M_to_CTIMER2 = MUX_A(CM_CTIMERCLKSEL2, 0), /*!< Attach CLK_1M to CTIMER2. */ - kPLL0_to_CTIMER2 = MUX_A(CM_CTIMERCLKSEL2, 1), /*!< Attach PLL0 to CTIMER2. */ - kPLL1_CLK0_to_CTIMER2 = MUX_A(CM_CTIMERCLKSEL2, 2), /*!< Attach PLL1_clk0 to CTIMER2. */ - kFRO_HF_to_CTIMER2 = MUX_A(CM_CTIMERCLKSEL2, 3), /*!< Attach FRO_HF to CTIMER2. */ - kFRO12M_to_CTIMER2 = MUX_A(CM_CTIMERCLKSEL2, 4), /*!< Attach FRO 12MHz to CTIMER2. */ - kSAI0_MCLK_IN_to_CTIMER2 = MUX_A(CM_CTIMERCLKSEL2, 5), /*!< Attach SAI0 MCLK IN to CTIMER2. */ - kLPOSC_to_CTIMER2 = MUX_A(CM_CTIMERCLKSEL2, 6), /*!< Attach LP Oscillator to CTIMER2. */ - kSAI1_MCLK_IN_to_CTIMER2 = MUX_A(CM_CTIMERCLKSEL2, 8), /*!< Attach SAI1 MCLK IN to CTIMER2. */ - kSAI0_TX_BCLK_to_CTIMER2 = MUX_A(CM_CTIMERCLKSEL2, 9), /*!< Attach SAI0 TX_BCLK to CTIMER2. */ - kSAI0_RX_BCLK_to_CTIMER2 = MUX_A(CM_CTIMERCLKSEL2, 10), /*!< Attach SAI0 RX_BCLK to CTIMER2. */ - kSAI1_TX_BCLK_to_CTIMER2 = MUX_A(CM_CTIMERCLKSEL2, 11), /*!< Attach SAI1 TX_BCLK to CTIMER2. */ - kSAI1_RX_BCLK_to_CTIMER2 = MUX_A(CM_CTIMERCLKSEL2, 12), /*!< Attach SAI1 RX_BCLK to CTIMER2. */ - kNONE_to_CTIMER2 = MUX_A(CM_CTIMERCLKSEL2, 15), /*!< Attach NONE to CTIMER2. */ - - kCLK_1M_to_CTIMER3 = MUX_A(CM_CTIMERCLKSEL3, 0), /*!< Attach CLK_1M to CTIMER3. */ - kPLL0_to_CTIMER3 = MUX_A(CM_CTIMERCLKSEL3, 1), /*!< Attach PLL0 to CTIMER3. */ - kPLL1_CLK0_to_CTIMER3 = MUX_A(CM_CTIMERCLKSEL3, 2), /*!< Attach PLL1_clk0 to CTIMER3. */ - kFRO_HF_to_CTIMER3 = MUX_A(CM_CTIMERCLKSEL3, 3), /*!< Attach FRO_HF to CTIMER3. */ - kFRO12M_to_CTIMER3 = MUX_A(CM_CTIMERCLKSEL3, 4), /*!< Attach FRO 12MHz to CTIMER3. */ - kSAI0_MCLK_IN_to_CTIMER3 = MUX_A(CM_CTIMERCLKSEL3, 5), /*!< Attach SAI0 MCLK IN to CTIMER3. */ - kLPOSC_to_CTIMER3 = MUX_A(CM_CTIMERCLKSEL3, 6), /*!< Attach LP Oscillator to CTIMER3. */ - kSAI1_MCLK_IN_to_CTIMER3 = MUX_A(CM_CTIMERCLKSEL3, 8), /*!< Attach SAI1 MCLK IN to CTIMER3. */ - kSAI0_TX_BCLK_to_CTIMER3 = MUX_A(CM_CTIMERCLKSEL3, 9), /*!< Attach SAI0 TX_BCLK to CTIMER3. */ - kSAI0_RX_BCLK_to_CTIMER3 = MUX_A(CM_CTIMERCLKSEL3, 10), /*!< Attach SAI0 RX_BCLK to CTIMER3. */ - kSAI1_TX_BCLK_to_CTIMER3 = MUX_A(CM_CTIMERCLKSEL3, 11), /*!< Attach SAI1 TX_BCLK to CTIMER3. */ - kSAI1_RX_BCLK_to_CTIMER3 = MUX_A(CM_CTIMERCLKSEL3, 12), /*!< Attach SAI1 RX_BCLK to CTIMER3. */ - kNONE_to_CTIMER3 = MUX_A(CM_CTIMERCLKSEL3, 15), /*!< Attach NONE to CTIMER3. */ - - kCLK_1M_to_CTIMER4 = MUX_A(CM_CTIMERCLKSEL4, 0), /*!< Attach CLK_1M to CTIMER4. */ - kPLL0_to_CTIMER4 = MUX_A(CM_CTIMERCLKSEL4, 1), /*!< Attach PLL0 to CTIMER4. */ - kPLL1_CLK0_to_CTIMER4 = MUX_A(CM_CTIMERCLKSEL4, 2), /*!< Attach PLL1_clk0 to CTIMER4. */ - kFRO_HF_to_CTIMER4 = MUX_A(CM_CTIMERCLKSEL4, 3), /*!< Attach FRO_HF to CTIMER4. */ - kFRO12M_to_CTIMER4 = MUX_A(CM_CTIMERCLKSEL4, 4), /*!< Attach FRO 12MHz to CTIMER4. */ - kSAI0_MCLK_IN_to_CTIMER4 = MUX_A(CM_CTIMERCLKSEL4, 5), /*!< Attach SAI0 MCLK IN to CTIMER4. */ - kLPOSC_to_CTIMER4 = MUX_A(CM_CTIMERCLKSEL4, 6), /*!< Attach LP Oscillator to CTIMER4. */ - kSAI1_MCLK_IN_to_CTIMER4 = MUX_A(CM_CTIMERCLKSEL4, 8), /*!< Attach SAI1 MCLK IN to CTIMER4. */ - kSAI0_TX_BCLK_to_CTIMER4 = MUX_A(CM_CTIMERCLKSEL4, 9), /*!< Attach SAI0 TX_BCLK to CTIMER4. */ - kSAI0_RX_BCLK_to_CTIMER4 = MUX_A(CM_CTIMERCLKSEL4, 10), /*!< Attach SAI0 RX_BCLK to CTIMER4. */ - kSAI1_TX_BCLK_to_CTIMER4 = MUX_A(CM_CTIMERCLKSEL4, 11), /*!< Attach SAI1 TX_BCLK to CTIMER4. */ - kSAI1_RX_BCLK_to_CTIMER4 = MUX_A(CM_CTIMERCLKSEL4, 12), /*!< Attach SAI1 RX_BCLK to CTIMER4. */ - kNONE_to_CTIMER4 = MUX_A(CM_CTIMERCLKSEL4, 15), /*!< Attach NONE to CTIMER4. */ - - kMAIN_CLK_to_CLKOUT = MUX_A(CM_CLKOUTCLKSEL, 0), /*!< Attach MAIN_CLK to CLKOUT. */ - kPLL0_to_CLKOUT = MUX_A(CM_CLKOUTCLKSEL, 1), /*!< Attach PLL0 to CLKOUT. */ - kCLK_IN_to_CLKOUT = MUX_A(CM_CLKOUTCLKSEL, 2), /*!< Attach Clk_in to CLKOUT. */ - kFRO_HF_to_CLKOUT = MUX_A(CM_CLKOUTCLKSEL, 3), /*!< Attach FRO_HF to CLKOUT. */ - kFRO12M_to_CLKOUT = MUX_A(CM_CLKOUTCLKSEL, 4), /*!< Attach FRO 12 MHz to CLKOUT. */ - kPLL1_CLK0_to_CLKOUT = MUX_A(CM_CLKOUTCLKSEL, 5), /*!< Attach PLL1_clk0 to CLKOUT. */ - kLPOSC_to_CLKOUT = MUX_A(CM_CLKOUTCLKSEL, 6), /*!< Attach LP Oscillator to CLKOUT. */ - kUSB_PLL_to_CLKOUT = MUX_A(CM_CLKOUTCLKSEL, 7), /*!< Attach USB_PLL to CLKOUT. */ - kNONE_to_CLKOUT = MUX_A(CM_CLKOUTCLKSEL, 15), /*!< Attach NONE to CLKOUT. */ - - kPLL0_to_ADC0 = MUX_A(CM_ADC0CLKSEL, 1), /*!< Attach PLL0 to ADC0. */ - kFRO_HF_to_ADC0 = MUX_A(CM_ADC0CLKSEL, 2), /*!< Attach FRO_HF to ADC0. */ - kFRO12M_to_ADC0 = MUX_A(CM_ADC0CLKSEL, 3), /*!< Attach FRO 12 MHz to ADC0. */ - kCLK_IN_to_ADC0 = MUX_A(CM_ADC0CLKSEL, 4), /*!< Attach Clk_in to ADC0. */ - kPLL1_CLK0_to_ADC0 = MUX_A(CM_ADC0CLKSEL, 5), /*!< Attach PLL1_clk0 to ADC0. */ - kUSB_PLL_to_ADC0 = MUX_A(CM_ADC0CLKSEL, 6), /*!< Attach USB PLL to ADC0. */ - kNONE_to_ADC0 = MUX_A(CM_ADC0CLKSEL, 7), /*!< Attach NONE to ADC0. */ - - kPLL0_to_USB0 = MUX_A(CM_USB0CLKSEL, 1), /*!< Attach PLL0 to USB0. */ - kCLK_48M_to_USB0 = MUX_A(CM_USB0CLKSEL, 3), /*!< Attach Clk 48 MHz to USB0. */ - kCLK_IN_to_USB0 = MUX_A(CM_USB0CLKSEL, 4), /*!< Attach Clk_in to USB0. */ - kPLL1_CLK0_to_USB0 = MUX_A(CM_USB0CLKSEL, 5), /*!< Attach PLL1_clk0 to USB0. */ - kUSB_PLL_to_USB0 = MUX_A(CM_USB0CLKSEL, 6), /*!< Attach USB PLL to USB0. */ - kNONE_to_USB0 = MUX_A(CM_USB0CLKSEL, 7), /*!< Attach NONE to USB0. */ - - kPLL_DIV_to_FLEXCOMM0 = MUX_A(CM_FCCLKSEL0, 1), /*!< Attach PLL_DIV to FLEXCOMM0. */ - kFRO12M_to_FLEXCOMM0 = MUX_A(CM_FCCLKSEL0, 2), /*!< Attach FRO12M to FLEXCOMM0. */ - kFRO_HF_DIV_to_FLEXCOMM0 = MUX_A(CM_FCCLKSEL0, 3), /*!< Attach FRO_HF_DIV to FLEXCOMM0. */ - kCLK_1M_to_FLEXCOMM0 = MUX_A(CM_FCCLKSEL0, 4), /*!< Attach CLK_1MHz to FLEXCOMM0. */ - kUSB_PLL_to_FLEXCOMM0 = MUX_A(CM_FCCLKSEL0, 5), /*!< Attach USB_PLL to FLEXCOMM0. */ - kLPOSC_to_FLEXCOMM0 = MUX_A(CM_FCCLKSEL0, 6), /*!< Attach LP Oscillator to FLEXCOMM0. */ - kNONE_to_FLEXCOMM0 = MUX_A(CM_FCCLKSEL0, 7), /*!< Attach NONE to FLEXCOMM0. */ - - kPLL_DIV_to_FLEXCOMM1 = MUX_A(CM_FCCLKSEL1, 1), /*!< Attach PLL_DIV to FLEXCOMM1. */ - kFRO12M_to_FLEXCOMM1 = MUX_A(CM_FCCLKSEL1, 2), /*!< Attach FRO12M to FLEXCOMM1. */ - kFRO_HF_DIV_to_FLEXCOMM1 = MUX_A(CM_FCCLKSEL1, 3), /*!< Attach FRO_HF_DIV to FLEXCOMM1. */ - kCLK_1M_to_FLEXCOMM1 = MUX_A(CM_FCCLKSEL1, 4), /*!< Attach CLK_1MHz to FLEXCOMM1. */ - kUSB_PLL_to_FLEXCOMM1 = MUX_A(CM_FCCLKSEL1, 5), /*!< Attach USB_PLL to FLEXCOMM1. */ - kLPOSC_to_FLEXCOMM1 = MUX_A(CM_FCCLKSEL1, 6), /*!< Attach LP Oscillator to FLEXCOMM1. */ - kNONE_to_FLEXCOMM1 = MUX_A(CM_FCCLKSEL1, 7), /*!< Attach NONE to FLEXCOMM1. */ - - kPLL_DIV_to_FLEXCOMM2 = MUX_A(CM_FCCLKSEL2, 1), /*!< Attach PLL_DIV to FLEXCOMM2. */ - kFRO12M_to_FLEXCOMM2 = MUX_A(CM_FCCLKSEL2, 2), /*!< Attach FRO12M to FLEXCOMM2. */ - kFRO_HF_DIV_to_FLEXCOMM2 = MUX_A(CM_FCCLKSEL2, 3), /*!< Attach FRO_HF_DIV to FLEXCOMM2. */ - kCLK_1M_to_FLEXCOMM2 = MUX_A(CM_FCCLKSEL2, 4), /*!< Attach CLK_1MHz to FLEXCOMM2. */ - kUSB_PLL_to_FLEXCOMM2 = MUX_A(CM_FCCLKSEL2, 5), /*!< Attach USB_PLL to FLEXCOMM2. */ - kLPOSC_to_FLEXCOMM2 = MUX_A(CM_FCCLKSEL2, 6), /*!< Attach LP Oscillator to FLEXCOMM2. */ - kNONE_to_FLEXCOMM2 = MUX_A(CM_FCCLKSEL2, 7), /*!< Attach NONE to FLEXCOMM2. */ - - kPLL_DIV_to_FLEXCOMM3 = MUX_A(CM_FCCLKSEL3, 1), /*!< Attach PLL_DIV to FLEXCOMM3. */ - kFRO12M_to_FLEXCOMM3 = MUX_A(CM_FCCLKSEL3, 2), /*!< Attach FRO12M to FLEXCOMM3. */ - kFRO_HF_DIV_to_FLEXCOMM3 = MUX_A(CM_FCCLKSEL3, 3), /*!< Attach FRO_HF_DIV to FLEXCOMM3. */ - kCLK_1M_to_FLEXCOMM3 = MUX_A(CM_FCCLKSEL3, 4), /*!< Attach CLK_1MHz to FLEXCOMM3. */ - kUSB_PLL_to_FLEXCOMM3 = MUX_A(CM_FCCLKSEL3, 5), /*!< Attach USB_PLL to FLEXCOMM3. */ - kLPOSC_to_FLEXCOMM3 = MUX_A(CM_FCCLKSEL3, 6), /*!< Attach LP Oscillator to FLEXCOMM3. */ - kNONE_to_FLEXCOMM3 = MUX_A(CM_FCCLKSEL3, 7), /*!< Attach NONE to FLEXCOMM3. */ - - kPLL_DIV_to_FLEXCOMM4 = MUX_A(CM_FCCLKSEL4, 1), /*!< Attach PLL_DIV to FLEXCOMM4. */ - kFRO12M_to_FLEXCOMM4 = MUX_A(CM_FCCLKSEL4, 2), /*!< Attach FRO12M to FLEXCOMM4. */ - kFRO_HF_DIV_to_FLEXCOMM4 = MUX_A(CM_FCCLKSEL4, 3), /*!< Attach FRO_HF_DIV to FLEXCOMM4. */ - kCLK_1M_to_FLEXCOMM4 = MUX_A(CM_FCCLKSEL4, 4), /*!< Attach CLK_1MHz to FLEXCOMM4. */ - kUSB_PLL_to_FLEXCOMM4 = MUX_A(CM_FCCLKSEL4, 5), /*!< Attach USB_PLL to FLEXCOMM4. */ - kLPOSC_to_FLEXCOMM4 = MUX_A(CM_FCCLKSEL4, 6), /*!< Attach LP Oscillator to FLEXCOMM4. */ - kNONE_to_FLEXCOMM4 = MUX_A(CM_FCCLKSEL4, 7), /*!< Attach NONE to FLEXCOMM4. */ - - kPLL_DIV_to_FLEXCOMM5 = MUX_A(CM_FCCLKSEL5, 1), /*!< Attach PLL_DIV to FLEXCOMM5. */ - kFRO12M_to_FLEXCOMM5 = MUX_A(CM_FCCLKSEL5, 2), /*!< Attach FRO12M to FLEXCOMM5. */ - kFRO_HF_DIV_to_FLEXCOMM5 = MUX_A(CM_FCCLKSEL5, 3), /*!< Attach FRO_HF_DIV to FLEXCOMM5. */ - kCLK_1M_to_FLEXCOMM5 = MUX_A(CM_FCCLKSEL5, 4), /*!< Attach CLK_1MHz to FLEXCOMM5. */ - kUSB_PLL_to_FLEXCOMM5 = MUX_A(CM_FCCLKSEL5, 5), /*!< Attach USB_PLL to FLEXCOMM5. */ - kLPOSC_to_FLEXCOMM5 = MUX_A(CM_FCCLKSEL5, 6), /*!< Attach LP Oscillator to FLEXCOMM5. */ - kNONE_to_FLEXCOMM5 = MUX_A(CM_FCCLKSEL5, 7), /*!< Attach NONE to FLEXCOMM5. */ - - kPLL_DIV_to_FLEXCOMM6 = MUX_A(CM_FCCLKSEL6, 1), /*!< Attach PLL_DIV to FLEXCOMM6. */ - kFRO12M_to_FLEXCOMM6 = MUX_A(CM_FCCLKSEL6, 2), /*!< Attach FRO12M to FLEXCOMM6. */ - kFRO_HF_DIV_to_FLEXCOMM6 = MUX_A(CM_FCCLKSEL6, 3), /*!< Attach FRO_HF_DIV to FLEXCOMM6. */ - kCLK_1M_to_FLEXCOMM6 = MUX_A(CM_FCCLKSEL6, 4), /*!< Attach CLK_1MHz to FLEXCOMM6. */ - kUSB_PLL_to_FLEXCOMM6 = MUX_A(CM_FCCLKSEL6, 5), /*!< Attach USB_PLL to FLEXCOMM6. */ - kLPOSC_to_FLEXCOMM6 = MUX_A(CM_FCCLKSEL6, 6), /*!< Attach LP Oscillator to FLEXCOMM6. */ - kNONE_to_FLEXCOMM6 = MUX_A(CM_FCCLKSEL6, 7), /*!< Attach NONE to FLEXCOMM6. */ - - kPLL_DIV_to_FLEXCOMM7 = MUX_A(CM_FCCLKSEL7, 1), /*!< Attach PLL_DIV to FLEXCOMM7. */ - kFRO12M_to_FLEXCOMM7 = MUX_A(CM_FCCLKSEL7, 2), /*!< Attach FRO12M to FLEXCOMM7. */ - kFRO_HF_DIV_to_FLEXCOMM7 = MUX_A(CM_FCCLKSEL7, 3), /*!< Attach FRO_HF_DIV to FLEXCOMM7. */ - kCLK_1M_to_FLEXCOMM7 = MUX_A(CM_FCCLKSEL7, 4), /*!< Attach CLK_1MHz to FLEXCOMM7. */ - kUSB_PLL_to_FLEXCOMM7 = MUX_A(CM_FCCLKSEL7, 5), /*!< Attach USB_PLL to FLEXCOMM7. */ - kLPOSC_to_FLEXCOMM7 = MUX_A(CM_FCCLKSEL7, 6), /*!< Attach LP Oscillator to FLEXCOMM7. */ - kNONE_to_FLEXCOMM7 = MUX_A(CM_FCCLKSEL7, 7), /*!< Attach NONE to FLEXCOMM7. */ - - kPLL_DIV_to_FLEXCOMM8 = MUX_A(CM_FCCLKSEL8, 1), /*!< Attach PLL_DIV to FLEXCOMM8. */ - kFRO12M_to_FLEXCOMM8 = MUX_A(CM_FCCLKSEL8, 2), /*!< Attach FRO12M to FLEXCOMM8. */ - kFRO_HF_DIV_to_FLEXCOMM8 = MUX_A(CM_FCCLKSEL8, 3), /*!< Attach FRO_HF_DIV to FLEXCOMM8. */ - kCLK_1M_to_FLEXCOMM8 = MUX_A(CM_FCCLKSEL8, 4), /*!< Attach CLK_1MHz to FLEXCOMM8. */ - kUSB_PLL_to_FLEXCOMM8 = MUX_A(CM_FCCLKSEL8, 5), /*!< Attach USB_PLL to FLEXCOMM8. */ - kLPOSC_to_FLEXCOMM8 = MUX_A(CM_FCCLKSEL8, 6), /*!< Attach LP Oscillator to FLEXCOMM8. */ - kNONE_to_FLEXCOMM8 = MUX_A(CM_FCCLKSEL8, 7), /*!< Attach NONE to FLEXCOMM8. */ - - kPLL_DIV_to_FLEXCOMM9 = MUX_A(CM_FCCLKSEL9, 1), /*!< Attach PLL_DIV to FLEXCOMM9. */ - kFRO12M_to_FLEXCOMM9 = MUX_A(CM_FCCLKSEL9, 2), /*!< Attach FRO12M to FLEXCOMM9. */ - kFRO_HF_DIV_to_FLEXCOMM9 = MUX_A(CM_FCCLKSEL9, 3), /*!< Attach FRO_HF_DIV to FLEXCOMM9. */ - kCLK_1M_to_FLEXCOMM9 = MUX_A(CM_FCCLKSEL9, 4), /*!< Attach CLK_1MHz to FLEXCOMM9. */ - kUSB_PLL_to_FLEXCOMM9 = MUX_A(CM_FCCLKSEL9, 5), /*!< Attach USB_PLL to FLEXCOMM9. */ - kLPOSC_to_FLEXCOMM9 = MUX_A(CM_FCCLKSEL9, 6), /*!< Attach LP Oscillator to FLEXCOMM9. */ - kNONE_to_FLEXCOMM9 = MUX_A(CM_FCCLKSEL9, 7), /*!< Attach NONE to FLEXCOMM9. */ - - kPLL0_to_SCT = MUX_A(CM_SCTCLKSEL, 1), /*!< Attach NONE to SCT. */ - kCLK_IN_to_SCT = MUX_A(CM_SCTCLKSEL, 2), /*!< Attach CLK_in to SCT. */ - kFRO_HF_to_SCT = MUX_A(CM_SCTCLKSEL, 3), /*!< Attach FRO_HF to SCT. */ - kPLL1_CLK0_to_SCT = MUX_A(CM_SCTCLKSEL, 4), /*!< Attach PLL1_clk0 to SCT. */ - kSAI0_MCLK_IN_to_SCT = MUX_A(CM_SCTCLKSEL, 5), /*!< Attach SAI0 MCLK_IN to SCT. */ - kUSB_PLL_to_SCT = MUX_A(CM_SCTCLKSEL, 6), /*!< Attach USB PLL to SCT. */ - kSAI1_MCLK_IN_to_SCT = MUX_A(CM_SCTCLKSEL, 8), /*!< Attach SAI1 MCLK_IN to SCT. */ - kNONE_to_SCT = MUX_A(CM_SCTCLKSEL, 15), /*!< Attach NONE to SCT. */ - - kCLK_IN_to_TSI = MUX_A(CM_TSICLKSEL, 2), /*!< Attach clk_in to TSI. */ - kFRO12M_to_TSI = MUX_A(CM_TSICLKSEL, 4), /*!< Attach FRO_12Mhz to TSI. */ - kNONE_to_TSI = MUX_A(CM_TSICLKSEL, 7), /*!< Attach NONE to TSI. */ - - kPLL0_to_SINCFILT = MUX_A(CM_SINCFILTCLKSEL, 1), /*!< Attach PLL0 to SINCFILT. */ - kCLK_IN_to_SINCFILT = MUX_A(CM_SINCFILTCLKSEL, 2), /*!< Attach clk_in to SINCFILT. */ - kFRO_HF_to_SINCFILT = MUX_A(CM_SINCFILTCLKSEL, 3), /*!< Attach FRO_HF to SINCFILT. */ - kFRO12M_to_SINCFILT = MUX_A(CM_SINCFILTCLKSEL, 4), /*!< Attach FRO_12Mhz to SINCFILT. */ - kPLL1_CLK0_to_SINCFILT = MUX_A(CM_SINCFILTCLKSEL, 5), /*!< Attach PLL1_clk0 to SINCFILT. */ - kUSB_PLL_to_SINCFILT = MUX_A(CM_SINCFILTCLKSEL, 6), /*!< Attach USB PLL to SINCFILT. */ - kNONE_to_SINCFILT = MUX_A(CM_SINCFILTCLKSEL, 7), /*!< Attach NONE to SINCFILT. */ - - kPLL0_to_ADC1 = MUX_A(CM_ADC1CLKSEL, 1), /*!< Attach PLL0 to ADC1. */ - kFRO_HF_to_ADC1 = MUX_A(CM_ADC1CLKSEL, 2), /*!< Attach FRO_HF to ADC1. */ - kFRO12M_to_ADC1 = MUX_A(CM_ADC1CLKSEL, 3), /*!< Attach FRO12M to ADC1. */ - kCLK_IN_to_ADC1 = MUX_A(CM_ADC1CLKSEL, 4), /*!< Attach clk_in to ADC1. */ - kPLL1_CLK0_to_ADC1 = MUX_A(CM_ADC1CLKSEL, 5), /*!< Attach PLL1_clk0 to ADC1. */ - kUSB_PLL_to_ADC1 = MUX_A(CM_ADC1CLKSEL, 6), /*!< Attach USB PLL to ADC1. */ - kNONE_to_ADC1 = MUX_A(CM_ADC1CLKSEL, 7), /*!< Attach NONE to ADC1. */ - - kPLL0_to_DAC0 = MUX_A(CM_DAC0CLKSEL, 1), /*!< Attach PLL0 to DAC0. */ - kCLK_IN_to_DAC0 = MUX_A(CM_DAC0CLKSEL, 2), /*!< Attach Clk_in to DAC0. */ - kFRO_HF_to_DAC0 = MUX_A(CM_DAC0CLKSEL, 3), /*!< Attach FRO_HF to DAC0. */ - kFRO12M_to_DAC0 = MUX_A(CM_DAC0CLKSEL, 4), /*!< Attach FRO_12M to DAC0. */ - kPLL1_CLK0_to_DAC0 = MUX_A(CM_DAC0CLKSEL, 5), /*!< Attach PLL1_clk0 to DAC0. */ - kNONE_to_DAC0 = MUX_A(CM_DAC0CLKSEL, 7), /*!< Attach NONE to DAC0. */ - - kPLL0_to_DAC1 = MUX_A(CM_DAC1CLKSEL, 1), /*!< Attach PLL0 to DAC1. */ - kCLK_IN_to_DAC1 = MUX_A(CM_DAC1CLKSEL, 2), /*!< Attach Clk_in to DAC1. */ - kFRO_HF_to_DAC1 = MUX_A(CM_DAC1CLKSEL, 3), /*!< Attach FRO_HF to DAC1. */ - kFRO12M_to_DAC1 = MUX_A(CM_DAC1CLKSEL, 4), /*!< Attach FRO_12M to DAC1. */ - kPLL1_CLK0_to_DAC1 = MUX_A(CM_DAC1CLKSEL, 5), /*!< Attach PLL1_clk0 to DAC1. */ - kNONE_to_DAC1 = MUX_A(CM_DAC1CLKSEL, 7), /*!< Attach NONE to DAC1. */ - - kPLL0_to_DAC2 = MUX_A(CM_DAC2CLKSEL, 1), /*!< Attach PLL0 to DAC2. */ - kCLK_IN_to_DAC2 = MUX_A(CM_DAC2CLKSEL, 2), /*!< Attach Clk_in to DAC2. */ - kFRO_HF_to_DAC2 = MUX_A(CM_DAC2CLKSEL, 3), /*!< Attach FRO_HF to DAC2. */ - kFRO12M_to_DAC2 = MUX_A(CM_DAC2CLKSEL, 4), /*!< Attach FRO_12M to DAC2. */ - kPLL1_CLK0_to_DAC2 = MUX_A(CM_DAC2CLKSEL, 5), /*!< Attach PLL1_clk0 to DAC2. */ - kNONE_to_DAC2 = MUX_A(CM_DAC2CLKSEL, 7), /*!< Attach NONE to DAC2. */ - - kPLL0_to_FLEXSPI = MUX_A(CM_FLEXSPICLKSEL, 1), /*!< Attach PLL0 to FLEXSPI. */ - kFRO_HF_to_FLEXSPI = MUX_A(CM_FLEXSPICLKSEL, 3), /*!< Attach FRO_HF to FLEXSPI. */ - kPLL1_to_FLEXSPI = MUX_A(CM_FLEXSPICLKSEL, 5), /*!< Attach PLL1 to FLEXSPI. */ - kUSB_PLL_to_FLEXSPI = MUX_A(CM_FLEXSPICLKSEL, 6), /*!< Attach USB PLL to FLEXSPI. */ - kNONE_to_FLEXSPI = MUX_A(CM_FLEXSPICLKSEL, 15), /*!< Attach NONE to FLEXSPI. */ - - kPLL0_to_PLLCLKDIV = MUX_A(CM_PLLCLKDIVSEL, 0), /*!< Attach PLL0 to PLLCLKDIV. */ - kPLL1_CLK0_to_PLLCLKDIV = MUX_A(CM_PLLCLKDIVSEL, 1), /*!< Attach pll1_clk0 to PLLCLKDIV. */ - kNONE_to_PLLCLKDIV = MUX_A(CM_PLLCLKDIVSEL, 1), /*!< Attach NONE to PLLCLKDIV. */ - - kPLL0_to_I3C0FCLK = MUX_A(CM_I3C0FCLKSEL, 1), /*!< Attach PLL0 to I3C0FCLK. */ - kCLK_IN_to_I3C0FCLK = MUX_A(CM_I3C0FCLKSEL, 2), /*!< Attach Clk_in to I3C0FCLK. */ - kFRO_HF_to_I3C0FCLK = MUX_A(CM_I3C0FCLKSEL, 3), /*!< Attach FRO_HF to I3C0FCLK. */ - kPLL1_CLK0_to_I3C0FCLK = MUX_A(CM_I3C0FCLKSEL, 5), /*!< Attach PLL1_clk0 to I3C0FCLK. */ - kUSB_PLL_to_I3C0FCLK = MUX_A(CM_I3C0FCLKSEL, 6), /*!< Attach USB PLL to I3C0FCLK. */ - kNONE_to_I3C0FCLK = MUX_A(CM_I3C0FCLKSEL, 7), /*!< Attach NONE to I3C0FCLK. */ - - kI3C0FCLK_to_I3C0FCLKSTC = MUX_A(CM_I3C0FCLKSTCSEL, 0), /*!< Attach I3C0FCLK to I3C0FCLKSTC. */ - kCLK_1M_to_I3C0FCLKSTC = MUX_A(CM_I3C0FCLKSTCSEL, 1), /*!< Attach CLK_1M to I3C0FCLKSTC. */ - kNONE_to_I3C0FCLKSTC = MUX_A(CM_I3C0FCLKSTCSEL, 7), /*!< Attach NONE to I3C0FCLKSTC. */ - - kCLK_1M_to_I3C0FCLKS = MUX_A(CM_I3C0FCLKSSEL, 0), /*!< Attach CLK_1M to I3C0FCLKS. */ - kNONE_to_I3C0FCLKS = MUX_A(CM_I3C0FCLKSSEL, 7), /*!< Attach NONE to I3C0FCLKS. */ - - kFRO12M_to_MICFILF = MUX_A(CM_MICFILFCLKSEL, 0), /*!< Attach FRO_12M to MICFILF. */ - kPLL0_to_MICFILF = MUX_A(CM_MICFILFCLKSEL, 1), /*!< Attach PLL0 to MICFILF. */ - kCLK_IN_to_MICFILF = MUX_A(CM_MICFILFCLKSEL, 2), /*!< Attach Clk_in to MICFILF. */ - kFRO_HF_to_MICFILF = MUX_A(CM_MICFILFCLKSEL, 3), /*!< Attach FRO_HF to MICFILF. */ - kPLL1_CLK0_to_MICFILF = MUX_A(CM_MICFILFCLKSEL, 4), /*!< Attach PLL1_clk0 to MICFILF. */ - kSAI0_MCLK_IN_to_MICFILF = MUX_A(CM_MICFILFCLKSEL, 5), /*!< Attach SAI0_MCLK to MICFILF. */ - kUSB_PLL_to_MICFILF = MUX_A(CM_MICFILFCLKSEL, 6), /*!< Attach USB PLL to MICFILF. */ - kSAI1_MCLK_IN_to_MICFILF = MUX_A(CM_MICFILFCLKSEL, 8), /*!< Attach SAI1_MCLK to MICFILF. */ - kNONE_to_MICFILF = MUX_A(CM_MICFILFCLKSEL, 15), /*!< Attach NONE to MICFILF. */ - - kPLL0_to_ESPI = MUX_A(CM_ESPICLKSEL, 1), /*!< Attach PLL0 to ESPI. */ - kCLK_48M_to_ESPI = MUX_A(CM_ESPICLKSEL, 3), /*!< Attach CLK_48M to ESPI. */ - kPLL1_CLK0_to_ESPI = MUX_A(CM_ESPICLKSEL, 5), /*!< Attach PLL1_clk0 to ESPI. */ - kUSB_PLL_to_ESPI = MUX_A(CM_ESPICLKSEL, 6), /*!< Attach USB PLL to ESPI. */ - kNONE_to_ESPI = MUX_A(CM_ESPICLKSEL, 7), /*!< Attach NONE to ESPI. */ - - kPLL0_to_USDHC = MUX_A(CM_USDHCCLKSEL, 1), /*!< Attach PLL0 to uSDHC. */ - kCLK_IN_to_USDHC = MUX_A(CM_USDHCCLKSEL, 2), /*!< Attach Clk_in to uSDHC. */ - kFRO_HF_to_USDHC = MUX_A(CM_USDHCCLKSEL, 3), /*!< Attach FRO_HF to uSDHC. */ - kFRO12M_to_USDHC = MUX_A(CM_USDHCCLKSEL, 4), /*!< Attach FRO_12M to uSDHC. */ - kPLL1_CLK1_to_USDHC = MUX_A(CM_USDHCCLKSEL, 5), /*!< Attach pll1_clk1 to uSDHC. */ - kUSB_PLL_to_USDHC = MUX_A(CM_USDHCCLKSEL, 6), /*!< Attach USB PLL to uSDHC. */ - kNONE_to_USDHC = MUX_A(CM_USDHCCLKSEL, 7), /*!< Attach NONE to uSDHC. */ - - kPLL0_to_FLEXIO = MUX_A(CM_FLEXIOCLKSEL, 1), /*!< Attach PLL0 to FLEXIO. */ - kCLK_IN_to_FLEXIO = MUX_A(CM_FLEXIOCLKSEL, 2), /*!< Attach Clk_in to FLEXIO. */ - kFRO_HF_to_FLEXIO = MUX_A(CM_FLEXIOCLKSEL, 3), /*!< Attach FRO_HF to FLEXIO. */ - kFRO12M_to_FLEXIO = MUX_A(CM_FLEXIOCLKSEL, 4), /*!< Attach FRO_12M to FLEXIO. */ - kPLL1_CLK0_to_FLEXIO = MUX_A(CM_FLEXIOCLKSEL, 5), /*!< Attach pll1_clk0 to FLEXIO. */ - kUSB_PLL_to_FLEXIO = MUX_A(CM_FLEXIOCLKSEL, 6), /*!< Attach USB PLL to FLEXIO. */ - kNONE_to_FLEXIO = MUX_A(CM_FLEXIOCLKSEL, 7), /*!< Attach NONE to FLEXIO. */ - - kPLL0_to_FLEXCAN0 = MUX_A(CM_FLEXCAN0CLKSEL, 1), /*!< Attach PLL0 to FLEXCAN0. */ - kCLK_IN_to_FLEXCAN0 = MUX_A(CM_FLEXCAN0CLKSEL, 2), /*!< Attach Clk_in to FLEXCAN0. */ - kFRO_HF_to_FLEXCAN0 = MUX_A(CM_FLEXCAN0CLKSEL, 3), /*!< Attach FRO_HF to FLEXCAN0. */ - kPLL1_CLK0_to_FLEXCAN0 = MUX_A(CM_FLEXCAN0CLKSEL, 5), /*!< Attach pll1_clk0 to FLEXCAN0. */ - kUSB_PLL_to_FLEXCAN0 = MUX_A(CM_FLEXCAN0CLKSEL, 6), /*!< Attach USB PLL to FLEXCAN0. */ - kNONE_to_FLEXCAN0 = MUX_A(CM_FLEXCAN0CLKSEL, 7), /*!< Attach NONE to FLEXCAN0. */ - - kPLL0_to_FLEXCAN1 = MUX_A(CM_FLEXCAN1CLKSEL, 1), /*!< Attach PLL0 to FLEXCAN1. */ - kCLK_IN_to_FLEXCAN1 = MUX_A(CM_FLEXCAN1CLKSEL, 2), /*!< Attach Clk_in to FLEXCAN1. */ - kFRO_HF_to_FLEXCAN1 = MUX_A(CM_FLEXCAN1CLKSEL, 3), /*!< Attach FRO_HF to FLEXCAN1. */ - kPLL1_CLK0_to_FLEXCAN1 = MUX_A(CM_FLEXCAN1CLKSEL, 5), /*!< Attach pll1_clk0 to FLEXCAN1. */ - kUSB_PLL_to_FLEXCAN1 = MUX_A(CM_FLEXCAN1CLKSEL, 6), /*!< Attach USB PLL to FLEXCAN1. */ - kNONE_to_FLEXCAN1 = MUX_A(CM_FLEXCAN1CLKSEL, 7), /*!< Attach NONE to FLEXCAN1. */ - - kNONE_to_ENETRMII = MUX_A(CM_ENETRMIICLKSEL, 0), /*!< Attach NONE to ENETRMII. */ - kPLL0_to_ENETRMII = MUX_A(CM_ENETRMIICLKSEL, 1), /*!< Attach PLL0 to ENETRMII. */ - kCLK_IN_to_ENETRMII = MUX_A(CM_ENETRMIICLKSEL, 2), /*!< Attach Clk_in to ENETRMII. */ - kPLL1_CLK0_to_ENETRMII = MUX_A(CM_ENETRMIICLKSEL, 5), /*!< Attach pll1_clk0 to ENETRMII. */ - - kPLL0_to_ENETPTPREF = MUX_A(CM_ENETPTPREFCLKSEL, 1), /*!< Attach PLL0 to ENETPTPREF. */ - kCLK_IN_to_ENETPTPREF = MUX_A(CM_ENETPTPREFCLKSEL, 2), /*!< Attach Clk_in to ENETPTPREF. */ - kENET0_TX_CLK_to_ENETPTPREF = MUX_A(CM_ENETPTPREFCLKSEL, 4), /*!< Attach enet0_tx_clk to ENETPTPREF. */ - kPLL1_CLK1_to_ENETPTPREF = MUX_A(CM_ENETPTPREFCLKSEL, 5), /*!< Attach pll1_clk1 to ENETPTPREF. */ - kNONE_to_ENETPTPREF = MUX_A(CM_ENETPTPREFCLKSEL, 7), /*!< Attach NONE to ENETPTPREF. */ - - kCLK_16K2_to_EWM0 = MUX_A(CM_EWM0CLKSEL, 0), /*!< Attach clk_16k[2] to EWM0. */ - kXTAL32K2_to_EWM0 = MUX_A(CM_EWM0CLKSEL, 1), /*!< Attach xtal32k[2] to EWM0. */ - - kCLK_16K2_to_WDT1 = MUX_A(CM_WDT1CLKSEL, 0), /*!< Attach FRO16K clock 2 to WDT1. */ - kFRO_HF_DIV_to_WDT1 = MUX_A(CM_WDT1CLKSEL, 1), /*!< Attach FRO_HF_DIV to WDT1. */ - kCLK_1M_to_WDT1 = MUX_A(CM_WDT1CLKSEL, 2), /*!< Attach clk_1m to WDT1. */ - kCLK_1M_2_to_WDT1 = MUX_A(CM_WDT1CLKSEL, 3), /*!< Attach clk_1m to WDT1. */ - - kCLK_16K2_to_OSTIMER = MUX_A(CM_OSTIMERCLKSEL, 0), /*!< Attach clk_16k[2] to OSTIMER. */ - kXTAL32K2_to_OSTIMER = MUX_A(CM_OSTIMERCLKSEL, 1), /*!< Attach xtal32k[2] to OSTIMER. */ - kCLK_1M_to_OSTIMER = MUX_A(CM_OSTIMERCLKSEL, 2), /*!< Attach clk_1m to OSTIMER. */ - kNONE_to_OSTIMER = MUX_A(CM_OSTIMERCLKSEL, 3), /*!< Attach NONE to OSTIMER. */ - - kPLL0_to_CMP0F = MUX_A(CM_CMP0FCLKSEL, 1), /*!< Attach PLL0 to CMP0F. */ - kFRO_HF_to_CMP0F = MUX_A(CM_CMP0FCLKSEL, 2), /*!< Attach FRO_HF to CMP0F. */ - kFRO12M_to_CMP0F = MUX_A(CM_CMP0FCLKSEL, 3), /*!< Attach FRO_12M to CMP0F. */ - kCLK_IN_to_CMP0F = MUX_A(CM_CMP0FCLKSEL, 4), /*!< Attach Clk_in to CMP0F. */ - kPLL1_CLK0_to_CMP0F = MUX_A(CM_CMP0FCLKSEL, 5), /*!< Attach PLL1_clk0 to CMP0F. */ - kUSB_PLL_to_CMP0F = MUX_A(CM_CMP0FCLKSEL, 6), /*!< Attach USB PLL to CMP0F. */ - kNONE_to_CMP0F = MUX_A(CM_CMP0FCLKSEL, 7), /*!< Attach NONE to CMP0F. */ - - kPLL0_to_CMP0RR = MUX_A(CM_CMP0RRCLKSEL, 1), /*!< Attach PLL0 to CMP0RR. */ - kFRO_HF_to_CMP0RR = MUX_A(CM_CMP0RRCLKSEL, 2), /*!< Attach FRO_HF to CMP0RR. */ - kFRO12M_to_CMP0RR = MUX_A(CM_CMP0RRCLKSEL, 3), /*!< Attach FRO_12M to CMP0RR. */ - kCLK_IN_to_CMP0RR = MUX_A(CM_CMP0RRCLKSEL, 4), /*!< Attach Clk_in to CMP0RR. */ - kPLL1_CLK0_to_CMP0RR = MUX_A(CM_CMP0RRCLKSEL, 5), /*!< Attach PLL1_clk0 to CMP0RR. */ - kUSB_PLL_to_CMP0RR = MUX_A(CM_CMP0RRCLKSEL, 6), /*!< Attach USB PLL to CMP0RR. */ - kNONE_to_CMP0RR = MUX_A(CM_CMP0RRCLKSEL, 7), /*!< Attach NONE to CMP0RR. */ - - kPLL0_to_CMP1F = MUX_A(CM_CMP1FCLKSEL, 1), /*!< Attach PLL0 to CMP1F. */ - kFRO_HF_to_CMP1F = MUX_A(CM_CMP1FCLKSEL, 2), /*!< Attach FRO_HF to CMP1F. */ - kFRO12M_to_CMP1F = MUX_A(CM_CMP1FCLKSEL, 3), /*!< Attach FRO_12M to CMP1F. */ - kCLK_IN_to_CMP1F = MUX_A(CM_CMP1FCLKSEL, 4), /*!< Attach Clk_in to CMP1F. */ - kPLL1_CLK0_to_CMP1F = MUX_A(CM_CMP1FCLKSEL, 5), /*!< Attach PLL1_clk0 to CMP1F. */ - kUSB_PLL_to_CMP1F = MUX_A(CM_CMP1FCLKSEL, 6), /*!< Attach USB PLL to CMP1F. */ - kNONE_to_CMP1F = MUX_A(CM_CMP1FCLKSEL, 7), /*!< Attach NONE to CMP1F. */ - - kPLL0_to_CMP1RR = MUX_A(CM_CMP1RRCLKSEL, 1), /*!< Attach PLL0 to CMP1RR. */ - kFRO_HF_to_CMP1RR = MUX_A(CM_CMP1RRCLKSEL, 2), /*!< Attach FRO_HF to CMP1RR. */ - kFRO12M_to_CMP1RR = MUX_A(CM_CMP1RRCLKSEL, 3), /*!< Attach FRO_12M to CMP1RR. */ - kCLK_IN_to_CMP1RR = MUX_A(CM_CMP1RRCLKSEL, 4), /*!< Attach Clk_in to CMP1RR. */ - kPLL1_CLK0_to_CMP1RR = MUX_A(CM_CMP1RRCLKSEL, 5), /*!< Attach PLL1_clk0 to CMP1RR. */ - kUSB_PLL_to_CMP1RR = MUX_A(CM_CMP1RRCLKSEL, 6), /*!< Attach USB PLL to CMP1RR. */ - kNONE_to_CMP1RR = MUX_A(CM_CMP1RRCLKSEL, 7), /*!< Attach NONE to CMP1RR. */ - - kPLL0_to_CMP2F = MUX_A(CM_CMP2FCLKSEL, 1), /*!< Attach PLL0 to CMP2F. */ - kFRO_HF_to_CMP2F = MUX_A(CM_CMP2FCLKSEL, 2), /*!< Attach FRO_HF to CMP2F. */ - kFRO12M_to_CMP2F = MUX_A(CM_CMP2FCLKSEL, 3), /*!< Attach FRO_12M to CMP2F. */ - kCLK_IN_to_CMP2F = MUX_A(CM_CMP2FCLKSEL, 4), /*!< Attach Clk_in to CMP2F. */ - kPLL1_CLK0_to_CMP2F = MUX_A(CM_CMP2FCLKSEL, 5), /*!< Attach PLL1_clk0 to CMP2F. */ - kUSB_PLL_to_CMP2F = MUX_A(CM_CMP2FCLKSEL, 6), /*!< Attach USB PLL to CMP2F. */ - kNONE_to_CMP2F = MUX_A(CM_CMP2FCLKSEL, 7), /*!< Attach NONE to CMP2F. */ - - kPLL0_to_CMP2RR = MUX_A(CM_CMP2RRCLKSEL, 1), /*!< Attach PLL0 to CMP2RR. */ - kFRO_HF_to_CMP2RR = MUX_A(CM_CMP2RRCLKSEL, 2), /*!< Attach FRO_HF to CMP2RR. */ - kFRO12M_to_CMP2RR = MUX_A(CM_CMP2RRCLKSEL, 3), /*!< Attach FRO_12M to CMP2RR. */ - kCLK_IN_to_CMP2RR = MUX_A(CM_CMP2RRCLKSEL, 4), /*!< Attach Clk_in to CMP2RR. */ - kPLL1_CLK0_to_CMP2RR = MUX_A(CM_CMP2RRCLKSEL, 5), /*!< Attach PLL1_clk0 to CMP2RR. */ - kUSB_PLL_to_CMP2RR = MUX_A(CM_CMP2RRCLKSEL, 6), /*!< Attach USB PLL to CMP2RR. */ - kNONE_to_CMP2RR = MUX_A(CM_CMP2RRCLKSEL, 7), /*!< Attach NONE to CMP2RR. */ - - kPLL0_to_SAI0 = MUX_A(CM_SAI0CLKSEL, 1), /*!< Attach PLL0 to SAI0. */ - kCLK_IN_to_SAI0 = MUX_A(CM_SAI0CLKSEL, 2), /*!< Attach Clk_in to SAI0. */ - kFRO_HF_to_SAI0 = MUX_A(CM_SAI0CLKSEL, 3), /*!< Attach FRO_HF to SAI0. */ - kPLL1_CLK0_to_SAI0 = MUX_A(CM_SAI0CLKSEL, 4), /*!< Attach PLL1_clk0 to SAI0. */ - kUSB_PLL_to_SAI0 = MUX_A(CM_SAI0CLKSEL, 6), /*!< Attach USB PLL to SAI0. */ - kNONE_to_SAI0 = MUX_A(CM_SAI0CLKSEL, 7), /*!< Attach NONE to SAI0. */ - - kPLL0_to_SAI1 = MUX_A(CM_SAI1CLKSEL, 1), /*!< Attach PLL0 to SAI1. */ - kCLK_IN_to_SAI1 = MUX_A(CM_SAI1CLKSEL, 2), /*!< Attach Clk_in to SAI1. */ - kFRO_HF_to_SAI1 = MUX_A(CM_SAI1CLKSEL, 3), /*!< Attach FRO_HF to SAI1. */ - kPLL1_CLK0_to_SAI1 = MUX_A(CM_SAI1CLKSEL, 4), /*!< Attach PLL1_clk0 to SAI1. */ - kUSB_PLL_to_SAI1 = MUX_A(CM_SAI1CLKSEL, 6), /*!< Attach USB PLL to SAI1. */ - kNONE_to_SAI1 = MUX_A(CM_SAI1CLKSEL, 7), /*!< Attach NONE to SAI1. */ - - kPLL0_to_EMVSIM0 = MUX_A(CM_EMVSIM0CLKSEL, 1), /*!< Attach PLL0 to EMVSIM0. */ - kCLK_IN_to_EMVSIM0 = MUX_A(CM_EMVSIM0CLKSEL, 2), /*!< Attach Clk_in to EMVSIM0. */ - kFRO_HF_to_EMVSIM0 = MUX_A(CM_EMVSIM0CLKSEL, 3), /*!< Attach FRO_HF to EMVSIM0. */ - kFRO12M_to_EMVSIM0 = MUX_A(CM_EMVSIM0CLKSEL, 4), /*!< Attach FRO_12M to EMVSIM0. */ - kPLL1_CLK0_to_EMVSIM0 = MUX_A(CM_EMVSIM0CLKSEL, 5), /*!< Attach PLL1_clk0 to EMVSIM0. */ - kNONE_to_EMVSIM0 = MUX_A(CM_EMVSIM0CLKSEL, 7), /*!< Attach NONE to EMVSIM0. */ - - kPLL0_to_EMVSIM1 = MUX_A(CM_EMVSIM1CLKSEL, 1), /*!< Attach PLL0 to EMVSIM1. */ - kCLK_IN_to_EMVSIM1 = MUX_A(CM_EMVSIM1CLKSEL, 2), /*!< Attach Clk_in to EMVSIM1. */ - kFRO_HF_to_EMVSIM1 = MUX_A(CM_EMVSIM1CLKSEL, 3), /*!< Attach FRO_HF to EMVSIM1. */ - kFRO12M_to_EMVSIM1 = MUX_A(CM_EMVSIM1CLKSEL, 4), /*!< Attach FRO_12M to EMVSIM1. */ - kPLL1_CLK0_to_EMVSIM1 = MUX_A(CM_EMVSIM1CLKSEL, 5), /*!< Attach PLL1_clk0 to EMVSIM1. */ - kNONE_to_EMVSIM1 = MUX_A(CM_EMVSIM1CLKSEL, 7), /*!< Attach NONE to EMVSIM1. */ - - kPLL0_to_I3C1FCLK = MUX_A(CM_I3C1FCLKSEL, 1), /*!< Attach PLL0 to I3C1FCLK. */ - kCLK_IN_to_I3C1FCLK = MUX_A(CM_I3C1FCLKSEL, 2), /*!< Attach Clk_in to I3C1FCLK. */ - kFRO_HF_to_I3C1FCLK = MUX_A(CM_I3C1FCLKSEL, 3), /*!< Attach FRO_HF to I3C1FCLK. */ - kPLL1_CLK0_to_I3C1FCLK = MUX_A(CM_I3C1FCLKSEL, 5), /*!< Attach PLL1_clk0 to I3C1FCLK. */ - kUSB_PLL_to_I3C1FCLK = MUX_A(CM_I3C1FCLKSEL, 6), /*!< Attach USB PLL to I3C1FCLK. */ - kNONE_to_I3C1FCLK = MUX_A(CM_I3C1FCLKSEL, 7), /*!< Attach NONE to I3C1FCLK. */ - - kI3C1FCLK_to_I3C1FCLKSTC = MUX_A(CM_I3C1FCLKSTCSEL, 0), /*!< Attach I3C1FCLK to I3C1FCLKSTC. */ - kCLK_1M_to_I3C1FCLKSTC = MUX_A(CM_I3C1FCLKSTCSEL, 1), /*!< Attach CLK_1M to I3C1FCLKSTC. */ - kNONE_to_I3C1FCLKSTC = MUX_A(CM_I3C1FCLKSTCSEL, 7), /*!< Attach NONE to I3C1FCLKSTC. */ - - kCLK_1M_to_I3C1FCLKS = MUX_A(CM_I3C1FCLKSSEL, 0), /*!< Attach CLK_1M to I3C1FCLKS. */ - kNONE_to_I3C1FCLKS = MUX_A(CM_I3C1FCLKSSEL, 7), /*!< Attach NONE to I3C1FCLKS. */ - - kNONE_to_NONE = (int)0x80000000U, /*!< Attach NONE to NONE. */ - -} clock_attach_id_t; - -/*! @brief Clock dividers */ -typedef enum _clock_div_name -{ - kCLOCK_DivSystickClk0 = 0, /*!< Systick Clk0 Divider. */ - kCLOCK_DivSystickClk1 = ((0x304 - 0x300) / 4), /*!< Systick Clk1 Divider. */ - kCLOCK_DivTraceClk = ((0x308 - 0x300) / 4), /*!< Trace Clk Divider. */ - kCLOCK_DivSlowClk = ((0x378 - 0x300) / 4), /*!< SLOW CLK Divider. */ - kCLOCK_DivTsiClk = ((0x37C - 0x300) / 4), /*!< Tsi Clk Divider. */ - kCLOCK_DivAhbClk = ((0x380 - 0x300) / 4), /*!< Ahb Clk Divider. */ - kCLOCK_DivClkOut = ((0x384 - 0x300) / 4), /*!< ClkOut Clk Divider. */ - kCLOCK_DivFrohfClk = ((0x388 - 0x300) / 4), /*!< Frohf Clk Divider. */ - kCLOCK_DivWdt0Clk = ((0x38C - 0x300) / 4), /*!< Wdt0 Clk Divider. */ - kCLOCK_DivAdc0Clk = ((0x394 - 0x300) / 4), /*!< Adc0 Clk Divider. */ - kCLOCK_DivUsb0Clk = ((0x398 - 0x300) / 4), /*!< Usb0 Clk Divider. */ - kCLOCK_DivSctClk = ((0x3B4 - 0x300) / 4), /*!< Sct Clk Divider. */ - kCLOCK_DivPllClk = ((0x3C4 - 0x300) / 4), /*!< Pll Clk Divider. */ - kCLOCK_DivCtimer0Clk = ((0x3D0 - 0x300) / 4), /*!< Ctimer0 Clk Divider. */ - kCLOCK_DivCtimer1Clk = ((0x3D4 - 0x300) / 4), /*!< Ctimer1 Clk Divider. */ - kCLOCK_DivCtimer2Clk = ((0x3D8 - 0x300) / 4), /*!< Ctimer2 Clk Divider. */ - kCLOCK_DivCtimer3Clk = ((0x3DC - 0x300) / 4), /*!< Ctimer3 Clk Divider. */ - kCLOCK_DivCtimer4Clk = ((0x3E0 - 0x300) / 4), /*!< Ctimer4 Clk Divider. */ - kCLOCK_DivPLL1Clk0 = ((0x3E4 - 0x300) / 4), /*!< PLL1 Clk0 Divider. */ - kCLOCK_DivPLL1Clk1 = ((0x3E8 - 0x300) / 4), /*!< Pll1 Clk1 Divider. */ - kCLOCK_DivAdc1Clk = ((0x468 - 0x300) / 4), /*!< Adc1 Clk Divider. */ - kCLOCK_DivDac0Clk = ((0x494 - 0x300) / 4), /*!< Dac0 Clk Divider. */ - kCLOCK_DivDac1Clk = ((0x49C - 0x300) / 4), /*!< Dac1 Clk Divider. */ - kCLOCK_DivDac2Clk = ((0x4A4 - 0x300) / 4), /*!< Dac2 Clk Divider. */ - kCLOCK_DivFlexspiClk = ((0x4AC - 0x300) / 4), /*!< Flexspi Clk Divider. */ - kCLOCK_DivI3c0FClkStc = ((0x538 - 0x300) / 4), /*!< I3C0 FCLK STC Divider. */ - kCLOCK_DivI3c0FClkS = ((0x53C - 0x300) / 4), /*!< I3C0 FCLK S Divider. */ - kCLOCK_DivI3c0FClk = ((0x540 - 0x300) / 4), /*!< I3C0 FClk Divider. */ - kCLOCK_DivMicfilFClk = ((0x54C - 0x300) / 4), /*!< MICFILFCLK Divider. */ - kCLOCK_DivEspiClk = ((0x554 - 0x300) / 4), /*!< Espi Clk Divider. */ - kCLOCK_DivUSdhcClk = ((0x55C - 0x300) / 4), /*!< USdhc Clk Divider. */ - kCLOCK_DivFlexioClk = ((0x564 - 0x300) / 4), /*!< Flexio Clk Divider. */ - kCLOCK_DivFlexcan0Clk = ((0x5A4 - 0x300) / 4), /*!< Flexcan0 Clk Divider. */ - kCLOCK_DivFlexcan1Clk = ((0x5AC - 0x300) / 4), /*!< Flexcan1 Clk Divider. */ - kCLOCK_DivEnetrmiiClk = ((0x5B4 - 0x300) / 4), /*!< Enetrmii Clk Divider. */ - kCLOCK_DivEnetptprefClk = ((0x5BC - 0x300) / 4), /*!< Enetptpref Clk Divider. */ - kCLOCK_DivWdt1Clk = ((0x5DC - 0x300) / 4), /*!< Wdt1 Clk Divider. */ - kCLOCK_DivCmp0FClk = ((0x5F4 - 0x300) / 4), /*!< Cmp0 FClk Divider. */ - kCLOCK_DivCmp0rrClk = ((0x5FC - 0x300) / 4), /*!< Cmp0rr Clk Divider. */ - kCLOCK_DivCmp1FClk = ((0x604 - 0x300) / 4), /*!< Cmp1 FClk Divider. */ - kCLOCK_DivCmp1rrClk = ((0x60C - 0x300) / 4), /*!< Cmp1rr Clk Divider. */ - kCLOCK_DivCmp2FClk = ((0x614 - 0x300) / 4), /*!< Cmp2 FClk Divider. */ - kCLOCK_DivCmp2rrClk = ((0x61C - 0x300) / 4), /*!< Cmp2rr Clk Divider. */ - kCLOCK_DivFlexcom0Clk = ((0x850 - 0x300) / 4), /*!< Flexcom0 Clk Divider. */ - kCLOCK_DivFlexcom1Clk = ((0x854 - 0x300) / 4), /*!< Flexcom1 Clk Divider. */ - kCLOCK_DivFlexcom2Clk = ((0x858 - 0x300) / 4), /*!< Flexcom2 Clk Divider. */ - kCLOCK_DivFlexcom3Clk = ((0x85C - 0x300) / 4), /*!< Flexcom3 Clk Divider. */ - kCLOCK_DivFlexcom4Clk = ((0x860 - 0x300) / 4), /*!< Flexcom4 Clk Divider. */ - kCLOCK_DivFlexcom5Clk = ((0x864 - 0x300) / 4), /*!< Flexcom5 Clk Divider. */ - kCLOCK_DivFlexcom6Clk = ((0x868 - 0x300) / 4), /*!< Flexcom6 Clk Divider. */ - kCLOCK_DivFlexcom7Clk = ((0x86C - 0x300) / 4), /*!< Flexcom7 Clk Divider. */ - kCLOCK_DivFlexcom8Clk = ((0x870 - 0x300) / 4), /*!< Flexcom8 Clk Divider. */ - kCLOCK_DivFlexcom9Clk = ((0x874 - 0x300) / 4), /*!< Flexcom9 Clk Divider. */ - kCLOCK_DivSai0Clk = ((0x888 - 0x300) / 4), /*!< Sai0 Clk Divider. */ - kCLOCK_DivSai1Clk = ((0x88C - 0x300) / 4), /*!< Sai1 Clk Divider. */ - kCLOCK_DivEmvsim0Clk = ((0x898 - 0x300) / 4), /*!< Emvsim0 Clk Divider. */ - kCLOCK_DivEmvsim1Clk = ((0x89C - 0x300) / 4), /*!< Emvsim1 Clk Divider. */ - kCLOCK_DivI3c1FClkStc = ((0xB38 - 0x300) / 4), /*!< I3C1 FCLK STC Divider. */ - kCLOCK_DivI3c1FClkS = ((0xB3C - 0x300) / 4), /*!< I3C1 FCLK S Divider. */ - kCLOCK_DivI3c1FClk = ((0xB40 - 0x300) / 4), /*!< I3C1 FClk Divider. */ -} clock_div_name_t; - -/*! @brief OSC32K clock gate */ -typedef enum _osc32k_clk_gate_id -{ - kCLOCK_Osc32kToVbat = 0x1, /*!< OSC32K[0] to VBAT domain. */ - kCLOCK_Osc32kToVsys = 0x2, /*!< OSC32K[1] to VSYS domain. */ - kCLOCK_Osc32kToWake = 0x4, /*!< OSC32K[2] to WAKE domain. */ - kCLOCK_Osc32kToMain = 0x8, /*!< OSC32K[3] to MAIN domain. */ - kCLOCK_Osc32kToAll = 0xF, /*!< OSC32K to VBAT,VSYS,WAKE,MAIN domain. */ -} osc32k_clk_gate_id_t; - -/*! @brief CLK16K clock gate */ -typedef enum _clk16k_clk_gate_id -{ - kCLOCK_Clk16KToVbat = 0x1, /*!< Clk16k[0] to VBAT domain. */ - kCLOCK_Clk16KToVsys = 0x2, /*!< Clk16k[1] to VSYS domain. */ - kCLOCK_Clk16KToWake = 0x4, /*!< Clk16k[2] to WAKE domain. */ - kCLOCK_Clk16KToMain = 0x8, /*!< Clk16k[3] to MAIN domain. */ - kCLOCK_Clk16KToAll = 0xF, /*!< Clk16k to VBAT,VSYS,WAKE,MAIN domain. */ -} clk16k_clk_gate_id_t; - -/*! @brief system clocks enable controls */ -typedef enum _clock_ctrl_enable -{ - kCLOCK_PLU_DEGLITCH_CLK_ENA = - SYSCON_CLOCK_CTRL_PLU_DEGLITCH_CLK_ENA_MASK, /*!< Enables clocks FRO_1MHz and FRO_12MHz for PLU deglitching. */ - kCLOCK_FRO1MHZ_CLK_ENA = - SYSCON_CLOCK_CTRL_FRO1MHZ_CLK_ENA_MASK, /*!< Enables FRO_1MHz clock for clock muxing in clock gen. */ - kCLOCK_CLKIN_ENA = - SYSCON_CLOCK_CTRL_CLKIN_ENA_MASK, /*!< Enables clk_in clock for MICD, EMVSIM0/1, CAN0/1, I3C0/1, SAI0/1, SINC - Filter (SINC), TSI, USBFS, SCT, uSDHC, clkout.. */ - kCLOCK_FRO_HF_ENA = - SYSCON_CLOCK_CTRL_FRO_HF_ENA_MASK, /*!< Enables FRO HF clock for the Frequency Measure module. */ - kCLOCK_FRO12MHZ_ENA = SYSCON_CLOCK_CTRL_FRO12MHZ_ENA_MASK, /*!< Enables the FRO_12MHz clock for the Flash, - LPTIMER0/1, and Frequency Measurement modules. */ - kCLOCK_FRO1MHZ_ENA = - SYSCON_CLOCK_CTRL_FRO1MHZ_ENA_MASK, /*!< Enables the FRO_1MHz clock for RTC module and for UTICK. */ - kCLOCK_CLKIN_ENA_FM_USBH_LPT = - SYSCON_CLOCK_CTRL_CLKIN_ENA_FM_USBH_LPT_MASK, /*!< Enables the clk_in clock for the Frequency Measurement, USB - HS and LPTIMER0/1 modules. */ -} clock_ctrl_enable_t; - -/*! @brief Source of the USB HS PHY. */ -typedef enum _clock_usb_phy_src -{ - kCLOCK_Usbphy480M = 0, /*!< Use 480M. */ -} clock_usb_phy_src_t; - -/*! - * @brief SCG status return codes. - */ -enum _scg_status -{ - kStatus_SCG_Busy = MAKE_STATUS(kStatusGroup_SCG, 1), /*!< Clock is busy. */ - kStatus_SCG_InvalidSrc = MAKE_STATUS(kStatusGroup_SCG, 2) /*!< Invalid source. */ -}; - -/*! - * @brief firc trim mode. - */ -typedef enum _firc_trim_mode -{ - kSCG_FircTrimNonUpdate = SCG_FIRCCSR_FIRCTREN_MASK, - /*!< Trim enable but not enable trim value update. In this mode, the - trim value is fixed to the initialized value which is defined by - trimCoar and trimFine in configure structure \ref trim_config_t.*/ - - kSCG_FircTrimUpdate = SCG_FIRCCSR_FIRCTREN_MASK | SCG_FIRCCSR_FIRCTRUP_MASK - /*!< Trim enable and trim value update enable. In this mode, the trim - value is auto update. */ - -} firc_trim_mode_t; - -/*! - * @brief firc trim source. - */ -typedef enum _firc_trim_src -{ - kSCG_FircTrimSrcUsb0 = 0U, /*!< USB0 start of frame (1kHz). */ - kSCG_FircTrimSrcSysOsc = 2U, /*!< System OSC. */ - kSCG_FircTrimSrcRtcOsc = 3U, /*!< RTC OSC (32.768 kHz). */ -} firc_trim_src_t; - -/*! - * @brief firc trim configuration. - */ -typedef struct _firc_trim_config -{ - firc_trim_mode_t trimMode; /*!< Trim mode. */ - firc_trim_src_t trimSrc; /*!< Trim source. */ - uint16_t trimDiv; /*!< Divider of SOSC. */ - - uint8_t trimCoar; /*!< Trim coarse value; Irrelevant if trimMode is kSCG_TrimUpdate. */ - uint8_t trimFine; /*!< Trim fine value; Irrelevant if trimMode is kSCG_TrimUpdate. */ -} firc_trim_config_t; - -/*! - * @brief sirc trim mode. - */ -typedef enum _sirc_trim_mode -{ - kSCG_SircTrimNonUpdate = SCG_SIRCCSR_SIRCTREN_MASK, - /*!< Trim enable but not enable trim value update. In this mode, the - trim value is fixed to the initialized value which is defined by - trimCoar and trimFine in configure structure \ref trim_config_t.*/ - - kSCG_SircTrimUpdate = SCG_SIRCCSR_SIRCTREN_MASK | SCG_SIRCCSR_SIRCTRUP_MASK - /*!< Trim enable and trim value update enable. In this mode, the trim - value is auto update. */ - -} sirc_trim_mode_t; - -/*! - * @brief sirc trim source. - */ -typedef enum _sirc_trim_src -{ - kSCG_SircTrimSrcSysOsc = 2U, /*!< System OSC. */ - kSCG_SircTrimSrcRtcOsc = 3U, /*!< RTC OSC (32.768 kHz). */ -} sirc_trim_src_t; - -/*! - * @brief sirc trim configuration. - */ -typedef struct _sirc_trim_config -{ - sirc_trim_mode_t trimMode; /*!< Trim mode. */ - sirc_trim_src_t trimSrc; /*!< Trim source. */ - uint16_t trimDiv; /*!< Divider of SOSC. */ - - uint8_t cltrim; /*!< Trim coarse value; Irrelevant if trimMode is kSCG_TrimUpdate. */ - uint8_t ccotrim; /*!< Trim fine value; Irrelevant if trimMode is kSCG_TrimUpdate. */ -} sirc_trim_config_t; - -/*! - * @brief SCG system OSC monitor mode. - */ -typedef enum _scg_sosc_monitor_mode -{ - kSCG_SysOscMonitorDisable = 0U, /*!< Monitor disabled. */ - kSCG_SysOscMonitorInt = SCG_SOSCCSR_SOSCCM_MASK, /*!< Interrupt when the SOSC error is detected. */ - kSCG_SysOscMonitorReset = - SCG_SOSCCSR_SOSCCM_MASK | SCG_SOSCCSR_SOSCCMRE_MASK /*!< Reset when the SOSC error is detected. */ -} scg_sosc_monitor_mode_t; - -/*! - * @brief SCG ROSC monitor mode. - */ -typedef enum _scg_rosc_monitor_mode -{ - kSCG_RoscMonitorDisable = 0U, /*!< Monitor disabled. */ - kSCG_RoscMonitorInt = SCG_ROSCCSR_ROSCCM_MASK, /*!< Interrupt when the RTC OSC error is detected. */ - kSCG_RoscMonitorReset = - SCG_ROSCCSR_ROSCCM_MASK | SCG_ROSCCSR_ROSCCMRE_MASK /*!< Reset when the RTC OSC error is detected. */ -} scg_rosc_monitor_mode_t; - -/*! - * @brief SCG UPLL monitor mode. - */ -typedef enum _scg_upll_monitor_mode -{ - kSCG_UpllMonitorDisable = 0U, /*!< Monitor disabled. */ - kSCG_UpllMonitorInt = SCG_UPLLCSR_UPLLCM_MASK, /*!< Interrupt when the UPLL error is detected. */ - kSCG_UpllMonitorReset = - SCG_UPLLCSR_UPLLCM_MASK | SCG_UPLLCSR_UPLLCMRE_MASK /*!< Reset when the UPLL error is detected. */ -} scg_upll_monitor_mode_t; - -/*! - * @brief SCG PLL0 monitor mode. - */ -typedef enum _scg_pll0_monitor_mode -{ - kSCG_Pll0MonitorDisable = 0U, /*!< Monitor disabled. */ - kSCG_Pll0MonitorInt = SCG_APLLCSR_APLLCM_MASK, /*!< Interrupt when the PLL0 Clock error is detected. */ - kSCG_Pll0MonitorReset = - SCG_APLLCSR_APLLCM_MASK | SCG_APLLCSR_APLLCMRE_MASK /*!< Reset when the PLL0 Clock error is detected. */ -} scg_pll0_monitor_mode_t; - -/*! - * @brief SCG PLL1 monitor mode. - */ -typedef enum _scg_pll1_monitor_mode -{ - kSCG_Pll1MonitorDisable = 0U, /*!< Monitor disabled. */ - kSCG_Pll1MonitorInt = SCG_SPLLCSR_SPLLCM_MASK, /*!< Interrupt when the PLL1 Clock error is detected. */ - kSCG_Pll1MonitorReset = - SCG_SPLLCSR_SPLLCM_MASK | SCG_SPLLCSR_SPLLCMRE_MASK /*!< Reset when the PLL1 Clock error is detected. */ -} scg_pll1_monitor_mode_t; - -/*! - * @brief The enumerator of internal capacitance of OSC's XTAL pin. - */ -typedef enum _vbat_osc_xtal_cap -{ - kVBAT_OscXtal0pFCap = 0x0U, /*!< The internal capacitance for XTAL pin is 0pF. */ - kVBAT_OscXtal2pFCap = 0x1U, /*!< The internal capacitance for XTAL pin is 2pF. */ - kVBAT_OscXtal4pFCap = 0x2U, /*!< The internal capacitance for XTAL pin is 4pF. */ - kVBAT_OscXtal6pFCap = 0x3U, /*!< The internal capacitance for XTAL pin is 6pF. */ - kVBAT_OscXtal8pFCap = 0x4U, /*!< The internal capacitance for XTAL pin is 8pF. */ - kVBAT_OscXtal10pFCap = 0x5U, /*!< The internal capacitance for XTAL pin is 10pF. */ - kVBAT_OscXtal12pFCap = 0x6U, /*!< The internal capacitance for XTAL pin is 12pF. */ - kVBAT_OscXtal14pFCap = 0x7U, /*!< The internal capacitance for XTAL pin is 14pF. */ - kVBAT_OscXtal16pFCap = 0x8U, /*!< The internal capacitance for XTAL pin is 16pF. */ - kVBAT_OscXtal18pFCap = 0x9U, /*!< The internal capacitance for XTAL pin is 18pF. */ - kVBAT_OscXtal20pFCap = 0xAU, /*!< The internal capacitance for XTAL pin is 20pF. */ - kVBAT_OscXtal22pFCap = 0xBU, /*!< The internal capacitance for XTAL pin is 22pF. */ - kVBAT_OscXtal24pFCap = 0xCU, /*!< The internal capacitance for XTAL pin is 24pF. */ - kVBAT_OscXtal26pFCap = 0xDU, /*!< The internal capacitance for XTAL pin is 26pF. */ - kVBAT_OscXtal28pFCap = 0xEU, /*!< The internal capacitance for XTAL pin is 28pF. */ - kVBAT_OscXtal30pFCap = 0xFU, /*!< The internal capacitance for XTAL pin is 30pF. */ -} vbat_osc_xtal_cap_t; - -/*! - * @brief The enumerator of internal capacitance of OSC's EXTAL pin. - */ -typedef enum _vbat_osc_extal_cap -{ - kVBAT_OscExtal0pFCap = 0x0U, /*!< The internal capacitance for EXTAL pin is 0pF. */ - kVBAT_OscExtal2pFCap = 0x1U, /*!< The internal capacitance for EXTAL pin is 2pF. */ - kVBAT_OscExtal4pFCap = 0x2U, /*!< The internal capacitance for EXTAL pin is 4pF. */ - kVBAT_OscExtal6pFCap = 0x3U, /*!< The internal capacitance for EXTAL pin is 6pF. */ - kVBAT_OscExtal8pFCap = 0x4U, /*!< The internal capacitance for EXTAL pin is 8pF. */ - kVBAT_OscExtal10pFCap = 0x5U, /*!< The internal capacitance for EXTAL pin is 10pF. */ - kVBAT_OscExtal12pFCap = 0x6U, /*!< The internal capacitance for EXTAL pin is 12pF. */ - kVBAT_OscExtal14pFCap = 0x7U, /*!< The internal capacitance for EXTAL pin is 14pF. */ - kVBAT_OscExtal16pFCap = 0x8U, /*!< The internal capacitance for EXTAL pin is 16pF. */ - kVBAT_OscExtal18pFCap = 0x9U, /*!< The internal capacitance for EXTAL pin is 18pF. */ - kVBAT_OscExtal20pFCap = 0xAU, /*!< The internal capacitance for EXTAL pin is 20pF. */ - kVBAT_OscExtal22pFCap = 0xBU, /*!< The internal capacitance for EXTAL pin is 22pF. */ - kVBAT_OscExtal24pFCap = 0xCU, /*!< The internal capacitance for EXTAL pin is 24pF. */ - kVBAT_OscExtal26pFCap = 0xDU, /*!< The internal capacitance for EXTAL pin is 26pF. */ - kVBAT_OscExtal28pFCap = 0xEU, /*!< The internal capacitance for EXTAL pin is 28pF. */ - kVBAT_OscExtal30pFCap = 0xFU, /*!< The internal capacitance for EXTAL pin is 30pF. */ -} vbat_osc_extal_cap_t; - -/*! - * @brief The enumerator of osc amplifier gain fine adjustment. - * Changes the oscillator amplitude by modifying the automatic gain control (AGC). - */ -typedef enum _vbat_osc_fine_adjustment_value -{ - kVBAT_OscCoarseAdjustment05 = 0U, - kVBAT_OscCoarseAdjustment10 = 1U, - kVBAT_OscCoarseAdjustment18 = 2U, - kVBAT_OscCoarseAdjustment33 = 3U, -} vbat_osc_coarse_adjustment_value_t; - -/*! - * @brief The structure of oscillator configuration. - */ -typedef struct _vbat_osc_config -{ - bool enableInternalCapBank; /*!< enable/disable the internal capacitance bank. */ - - bool enableCrystalOscillatorBypass; /*!< enable/disable the crystal oscillator bypass. */ - - vbat_osc_xtal_cap_t xtalCap; /*!< The internal capacitance for the OSC XTAL pin from the capacitor bank, - only useful when the internal capacitance bank is enabled. */ - vbat_osc_extal_cap_t extalCap; /*!< The internal capacitance for the OSC EXTAL pin from the capacitor bank, only - useful when the internal capacitance bank is enabled. */ - vbat_osc_coarse_adjustment_value_t - coarseAdjustment; /*!< 32kHz crystal oscillator amplifier coarse adjustment value. */ -} vbat_osc_config_t; - -/*! - * @brief The active run mode (voltage level). - */ -typedef enum _run_mode -{ - kMD_Mode, /*!< Midvoltage (1.0 V). */ - kSD_Mode, /*!< Normal voltage (1.1 V). */ - kOD_Mode, /*!< Overdrive voltage (1.2 V). */ -} run_mode_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/** - * @brief Enable the clock for specific IP. - * @param clk : Clock to be enabled. - * @return Nothing - */ -static inline void CLOCK_EnableClock(clock_ip_name_t clk) -{ - uint32_t index = CLK_GATE_ABSTRACT_REG_OFFSET(clk); - uint32_t bit = CLK_GATE_ABSTRACT_BITS_SHIFT(clk); - - if (index == (uint32_t)REG_PWM0SUBCTL) - { - SYSCON->PWM0SUBCTL |= (1UL << bit); - SYSCON->AHBCLKCTRLSET[3] = 0x40U; - } - else if (index == (uint32_t)REG_PWM1SUBCTL) - { - SYSCON->PWM1SUBCTL |= (1UL << bit); - SYSCON->AHBCLKCTRLSET[3] = 0x80U; - } - else - { - SYSCON->AHBCLKCTRLSET[index] = (1UL << bit); - } -} - -/** - * @brief Disable the clock for specific IP. - * @param clk : Clock to be Disabled. - * @return Nothing - */ -static inline void CLOCK_DisableClock(clock_ip_name_t clk) -{ - uint32_t index = CLK_GATE_ABSTRACT_REG_OFFSET(clk); - uint32_t bit = CLK_GATE_ABSTRACT_BITS_SHIFT(clk); - - if (index == (uint32_t)REG_PWM0SUBCTL) - { - SYSCON->PWM0SUBCTL &= ~(1UL << bit); - if (0U == (SYSCON->PWM0SUBCTL & 0xFU)) - { - SYSCON->AHBCLKCTRLCLR[3] = 0x20U; - } - } - else if (index == (uint32_t)REG_PWM1SUBCTL) - { - SYSCON->PWM1SUBCTL &= ~(1UL << bit); - if (0U == (SYSCON->PWM1SUBCTL & 0xFU)) - { - SYSCON->AHBCLKCTRLCLR[3] = 0x40U; - } - } - else - { - SYSCON->AHBCLKCTRLCLR[index] = (1UL << bit); - } -} - -/** - * @brief Initialize the Core clock to given frequency (48 or 144 MHz). - * This function turns on FIRC and select the given frequency as the source of fro_hf - * @param iFreq : Desired frequency (must be one of CLK_FRO_44MHZ or CLK_FRO_144MHZ) - * @return returns success or fail status. - */ -status_t CLOCK_SetupFROHFClocking(uint32_t iFreq); - -/** - * @brief Initialize the external osc clock to given frequency. - * @param iFreq : Desired frequency (must be equal to exact rate in Hz) - * @return returns success or fail status. - */ -status_t CLOCK_SetupExtClocking(uint32_t iFreq); - -/** - * @brief Initialize the external reference clock to given frequency. - * @param iFreq : Desired frequency (must be equal to exact rate in Hz) - * @return returns success or fail status. - */ -status_t CLOCK_SetupExtRefClocking(uint32_t iFreq); - -/** - * @brief Initialize the XTAL32/EXTAL32 input clock to given frequency. - * @param id : OSC 32 kHz output clock to specified modules, it should use osc32k_clk_gate_id_t value - * @return returns success or fail status. - */ -status_t CLOCK_SetupOsc32KClocking(uint32_t id); - -/** - * @brief Initialize the FRO16K input clock to given frequency. - * @param id : FRO 16 kHz output clock to specified modules, it should use clk16k_clk_gate_id_t value - * @return returns success or fail status. - */ -status_t CLOCK_SetupClk16KClocking(uint32_t id); - -/** - * @brief Setup FROHF trim. - * @param config : FROHF trim value - * @return returns success or fail status. - */ -status_t CLOCK_FROHFTrimConfig(firc_trim_config_t config); - -/** - * @brief Setup FRO 12M trim. - * @param config : FRO 12M trim value - * @return returns success or fail status. - */ -status_t CLOCK_FRO12MTrimConfig(sirc_trim_config_t config); - -/*! - * @brief Sets the system OSC monitor mode. - * - * This function sets the system OSC monitor mode. The mode can be disabled, - * it can generate an interrupt when the error is disabled, or reset when the error is detected. - * - * @param mode Monitor mode to set. - */ -void CLOCK_SetSysOscMonitorMode(scg_sosc_monitor_mode_t mode); - -/*! - * @brief Sets the ROSC monitor mode. - * - * This function sets the ROSC monitor mode. The mode can be disabled, - * it can generate an interrupt when the error is disabled, or reset when the error is detected. - * - * @param mode Monitor mode to set. - */ -void CLOCK_SetRoscMonitorMode(scg_rosc_monitor_mode_t mode); - -/*! - * @brief Sets the UPLL monitor mode. - * - * This function sets the UPLL monitor mode. The mode can be disabled, - * it can generate an interrupt when the error is disabled, or reset when the error is detected. - * - * @param mode Monitor mode to set. - */ -void CLOCK_SetUpllMonitorMode(scg_upll_monitor_mode_t mode); - -/*! - * @brief Sets the PLL0 monitor mode. - * - * This function sets the PLL0 monitor mode. The mode can be disabled, - * it can generate an interrupt when the error is disabled, or reset when the error is detected. - * - * @param mode Monitor mode to set. - */ -void CLOCK_SetPll0MonitorMode(scg_pll0_monitor_mode_t mode); - -/*! - * @brief Sets the PLL1 monitor mode. - * - * This function sets the PLL1 monitor mode. The mode can be disabled, - * it can generate an interrupt when the error is disabled, or reset when the error is detected. - * - * @param mode Monitor mode to set. - */ -void CLOCK_SetPll1MonitorMode(scg_pll1_monitor_mode_t mode); - -/*! - * @brief Config 32k Crystal Oscillator. - * - * @param base VBAT peripheral base address. - * @param config The pointer to the structure \ref vbat_osc_config_t. - */ -void VBAT_SetOscConfig(VBAT_Type *base, const vbat_osc_config_t *config); - -/*! - * @brief Set the additional number of wait-states added to account for the ratio of system clock period to flash access - * time during full speed power mode. - * @param system_freq_hz : Input frequency - * @param mode : Active run mode (voltage level). - * @return success or fail status - */ -status_t CLOCK_SetFLASHAccessCyclesForFreq(uint32_t system_freq_hz, run_mode_t mode); - -/** - * @brief Configure the clock selection muxes. - * @param connection : Clock to be configured. - * @return Nothing - */ -void CLOCK_AttachClk(clock_attach_id_t connection); - -/** - * @brief Get the actual clock attach id. - * This fuction uses the offset in input attach id, then it reads the actual source value in - * the register and combine the offset to obtain an actual attach id. - * @param attachId : Clock attach id to get. - * @return Clock source value. - */ -clock_attach_id_t CLOCK_GetClockAttachId(clock_attach_id_t attachId); - -/** - * @brief Setup peripheral clock dividers. - * @param div_name : Clock divider name - * @param divided_by_value: Value to be divided - * @return Nothing - */ -void CLOCK_SetClkDiv(clock_div_name_t div_name, uint32_t divided_by_value); - -/** - * @brief Get peripheral clock dividers. - * @param div_name : Clock divider name - * @return peripheral clock dividers - */ -uint32_t CLOCK_GetClkDiv(clock_div_name_t div_name); - -/** - * @brief Halt peripheral clock dividers. - * @param div_name : Clock divider name - * @return Nothing - */ -void CLOCK_HaltClkDiv(clock_div_name_t div_name); - -/** - * @brief system clocks enable controls. - * @param mask : system clocks enable value, it should use clock_ctrl_enable_t value - * @return Nothing - */ -void CLOCK_SetupClockCtrl(uint32_t mask); - -/*! @brief Return Frequency of selected clock - * @return Frequency of selected clock - */ -uint32_t CLOCK_GetFreq(clock_name_t clockName); - -/*! @brief Return Frequency of main - * @return Frequency of the main - */ -uint32_t CLOCK_GetMainClkFreq(void); - -/*! @brief Return Frequency of core - * @return Frequency of the core - */ -uint32_t CLOCK_GetCoreSysClkFreq(void); - -/*! @brief Return Frequency of CTimer functional Clock - * @return Frequency of CTimer functional Clock - */ -uint32_t CLOCK_GetCTimerClkFreq(uint32_t id); - -/*! @brief Return Frequency of Adc Clock - * @return Frequency of Adc. - */ -uint32_t CLOCK_GetAdcClkFreq(uint32_t id); - -/*! @brief Return Frequency of Usb Clock - * @return Frequency of Adc. - */ -uint32_t CLOCK_GetUsb0ClkFreq(void); - -/*! @brief Return Frequency of LPFlexComm Clock - * @return Frequency of LPFlexComm Clock - */ -uint32_t CLOCK_GetLPFlexCommClkFreq(uint32_t id); - -/*! @brief Return Frequency of SCTimer Clock - * @return Frequency of SCTimer Clock. - */ -uint32_t CLOCK_GetSctClkFreq(void); - -/*! @brief Return Frequency of TSI Clock - * @return Frequency of TSI Clock. - */ -uint32_t CLOCK_GetTsiClkFreq(void); - -/*! @brief Return Frequency of SINC FILTER Clock - * @return Frequency of SINC FILTER Clock. - */ -uint32_t CLOCK_GetSincFilterClkFreq(void); - -/*! @brief Return Frequency of DAC Clock - * @return Frequency of DAC Clock - */ -uint32_t CLOCK_GetDacClkFreq(uint32_t id); - -/*! @brief Return Frequency of FlexSPI - * @return Frequency of FlexSPI Clock - */ -uint32_t CLOCK_GetFlexspiClkFreq(void); - -/*! @brief Return Frequency of PLL - * @return Frequency of PLL - */ -uint32_t CLOCK_GetPll0OutFreq(void); -/*! @brief Return Frequency of USB PLL - * @return Frequency of PLL - */ -uint32_t CLOCK_GetPll1OutFreq(void); - -/*! @brief Return Frequency of PLLCLKDIV - * @return Frequency of PLLCLKDIV Clock - */ -uint32_t CLOCK_GetPllClkDivFreq(void); - -/*! @brief Return Frequency of I3C function Clock - * @return Frequency of I3C function Clock - */ -uint32_t CLOCK_GetI3cClkFreq(uint32_t id); - -/*! @brief Return Frequency of I3C function slow TC Clock - * @return Frequency of I3C function slow TC Clock - */ -uint32_t CLOCK_GetI3cSTCClkFreq(uint32_t id); - -/*! @brief Return Frequency of I3C function slow Clock - * @return Frequency of I3C function slow Clock - */ -uint32_t CLOCK_GetI3cSClkFreq(uint32_t id); - -/*! @brief Return Frequency of MICFIL Clock - * @return Frequency of MICFIL. - */ -uint32_t CLOCK_GetMicfilClkFreq(void); - -/*! @brief Return Frequency of uSDHC - * @return Frequency of uSDHC Clock - */ -uint32_t CLOCK_GetUsdhcClkFreq(void); - -/*! @brief Return Frequency of FLEXIO - * @return Frequency of FLEXIO Clock - */ -uint32_t CLOCK_GetFlexioClkFreq(void); - -/*! @brief Return Frequency of FLEXCAN - * @return Frequency of FLEXCAN Clock - */ -uint32_t CLOCK_GetFlexcanClkFreq(uint32_t id); - -/*! @brief Return Frequency of Ethernet RMII Clock - * @return Frequency of Ethernet RMII. - */ -uint32_t CLOCK_GetEnetRmiiClkFreq(void); - -/*! @brief Return Frequency of Ethernet PTP REF Clock - * @return Frequency of Ethernet PTP REF. - */ -uint32_t CLOCK_GetEnetPtpRefClkFreq(void); - -/** - * @brief Initialize the ENET TX CLK to given frequency. - * @param iFreq : Desired frequency - * @return Nothing - */ -void CLOCK_SetupEnetTxClk(uint32_t iFreq); - -/** - * @brief Return Frequency of ENET TX CLK - * @return Frequency of ENET TX CLK - */ -uint32_t CLOCK_GetEnetTxClkFreq(void); - -/*! @brief Return Frequency of EWM0 Clock - * @return Frequency of EWM0. - */ -uint32_t CLOCK_GetEwm0ClkFreq(void); - -/*! @brief Return Frequency of Watchdog - * @return Frequency of Watchdog - */ -uint32_t CLOCK_GetWdtClkFreq(uint32_t id); - -/*! @brief Return Frequency of OSTIMER - * @return Frequency of OSTIMER Clock - */ -uint32_t CLOCK_GetOstimerClkFreq(void); - -/*! @brief Return Frequency of CMP Function Clock - * @return Frequency of CMP Function. - */ -uint32_t CLOCK_GetCmpFClkFreq(uint32_t id); - -/*! @brief Return Frequency of CMP Round Robin Clock - * @return Frequency of CMP Round Robin. - */ -uint32_t CLOCK_GetCmpRRClkFreq(uint32_t id); - -/*! @brief Return Frequency of SAI Clock - * @return Frequency of SAI Clock. - */ -uint32_t CLOCK_GetSaiClkFreq(uint32_t id); - -/** - * @brief Initialize the SAI MCLK to given frequency. - * @param iFreq : Desired frequency - * @return Nothing - */ -void CLOCK_SetupSaiMclk(uint32_t id, uint32_t iFreq); - -/** - * @brief Initialize the SAI TX BCLK to given frequency. - * @param iFreq : Desired frequency - * @return Nothing - */ -void CLOCK_SetupSaiTxBclk(uint32_t id, uint32_t iFreq); - -/** - * @brief Initialize the SAI RX BCLK to given frequency. - * @param iFreq : Desired frequency - * @return Nothing - */ -void CLOCK_SetupSaiRxBclk(uint32_t id, uint32_t iFreq); - -/** - * @brief Return Frequency of SAI MCLK - * @return Frequency of SAI MCLK - */ -uint32_t CLOCK_GetSaiMclkFreq(uint32_t id); - -/** - * @brief Return Frequency of SAI TX BCLK - * @return Frequency of SAI TX BCLK - */ -uint32_t CLOCK_GetSaiTxBclkFreq(uint32_t id); - -/** - * @brief Return Frequency of SAI RX BCLK - * @return Frequency of SAI RX BCLK - */ -uint32_t CLOCK_GetSaiRxBclkFreq(uint32_t id); - -/*! @brief Return Frequency of EMVSIM Clock - * @return Frequency of EMVSIM Clock. - */ -uint32_t CLOCK_GetEmvsimClkFreq(uint32_t id); - -/*! @brief Return PLL0 input clock rate - * @return PLL0 input clock rate - */ -uint32_t CLOCK_GetPLL0InClockRate(void); - -/*! @brief Return PLL1 input clock rate - * @return PLL1 input clock rate - */ -uint32_t CLOCK_GetPLL1InClockRate(void); - -/*! @brief Gets the external UPLL frequency. - * @return The frequency of the external UPLL. - */ -uint32_t CLOCK_GetExtUpllFreq(void); - -/*! @brief Sets the external UPLL frequency. - * @param The frequency of external UPLL. - */ -void CLOCK_SetExtUpllFreq(uint32_t freq); - -/*! @brief Check if PLL is locked or not - * @return true if the PLL is locked, false if not locked - */ -__STATIC_INLINE bool CLOCK_IsPLL0Locked(void) -{ - return (bool)((SCG0->APLLCSR & SCG_APLLCSR_APLL_LOCK_MASK) != 0UL); -} - -/*! @brief Check if PLL1 is locked or not - * @return true if the PLL1 is locked, false if not locked - */ -__STATIC_INLINE bool CLOCK_IsPLL1Locked(void) -{ - return (bool)((SCG0->SPLLCSR & SCG_SPLLCSR_SPLL_LOCK_MASK) != 0UL); -} - -/*! @brief PLL configuration structure flags for 'flags' field - * These flags control how the PLL configuration function sets up the PLL setup structure.
- * - * When the PLL_CONFIGFLAG_FORCENOFRACT flag is selected, the PLL hardware for the - * automatic bandwidth selection, Spread Spectrum (SS) support, and fractional M-divider - * are not used.
- */ -#define PLL_CONFIGFLAG_FORCENOFRACT (1U << 2U) -/*!< Force non-fractional output mode, PLL output will not use the fractional, automatic bandwidth, or SS hardware */ - -/*! - * @brief PLL clock source. - */ -typedef enum _pll_clk_src -{ - kPll_ClkSrcSysOsc = (0 << 25), /*!< System OSC. */ - kPll_ClkSrcFirc = (1 << 25), /*!< Fast IRC. */ - kPll_ClkSrcRosc = (2 << 25), /*!< RTC OSC. */ -} pll_clk_src_t; - -/*! @brief PLL Spread Spectrum (SS) Programmable modulation frequency - * See (MF) field in the PLL0SSCG1 register in the UM. - */ -typedef enum _ss_progmodfm -{ - kSS_MF_512 = (0 << 2), /*!< Nss = 512 (fm ~= 3.9 - 7.8 kHz) */ - kSS_MF_384 = (1 << 2), /*!< Nss ~= 384 (fm ~= 5.2 - 10.4 kHz) */ - kSS_MF_256 = (2 << 2), /*!< Nss = 256 (fm ~= 7.8 - 15.6 kHz) */ - kSS_MF_128 = (3 << 2), /*!< Nss = 128 (fm ~= 15.6 - 31.3 kHz) */ - kSS_MF_64 = (4 << 2), /*!< Nss = 64 (fm ~= 32.3 - 64.5 kHz) */ - kSS_MF_32 = (5 << 2), /*!< Nss = 32 (fm ~= 62.5 - 125 kHz) */ - kSS_MF_24 = (6 << 2), /*!< Nss ~= 24 (fm ~= 83.3 - 166.6 kHz) */ - kSS_MF_16 = (7 << 2) /*!< Nss = 16 (fm ~= 125 - 250 kHz) */ -} ss_progmodfm_t; - -/*! @brief PLL Spread Spectrum (SS) Programmable frequency modulation depth - * See (MR) field in the PLL0SSCG1 register in the UM. - */ -typedef enum _ss_progmoddp -{ - kSS_MR_K0 = (0 << 5), /*!< k = 0 (no spread spectrum) */ - kSS_MR_K1 = (1 << 5), /*!< k ~= 1 */ - kSS_MR_K1_5 = (2 << 5), /*!< k ~= 1.5 */ - kSS_MR_K2 = (3 << 5), /*!< k ~= 2 */ - kSS_MR_K3 = (4 << 5), /*!< k ~= 3 */ - kSS_MR_K4 = (5 << 5), /*!< k ~= 4 */ - kSS_MR_K6 = (6 << 5), /*!< k ~= 6 */ - kSS_MR_K8 = (7 << 5) /*!< k ~= 8 */ -} ss_progmoddp_t; - -/*! @brief PLL Spread Spectrum (SS) Modulation waveform control - * See (MC) field in the PLL0SSCG1 register in the UM.
- * Compensation for low pass filtering of the PLL to get a triangular - * modulation at the output of the PLL, giving a flat frequency spectrum. - */ -typedef enum _ss_modwvctrl -{ - kSS_MC_NOC = (0 << 8), /*!< no compensation */ - kSS_MC_RECC = (2 << 8), /*!< recommended setting */ - kSS_MC_MAXC = (3 << 8), /*!< max. compensation */ -} ss_modwvctrl_t; - -/*! @brief PLL configuration structure - * - * This structure can be used to configure the settings for a PLL - * setup structure. Fill in the desired configuration for the PLL - * and call the PLL setup function to fill in a PLL setup structure. - */ -typedef struct _pll_config -{ - uint32_t desiredRate; /*!< Desired PLL rate in Hz */ - uint32_t inputSource; /*!< PLL input source */ - uint32_t flags; /*!< PLL configuration flags, Or'ed value of PLL_CONFIGFLAG_* definitions */ - ss_progmodfm_t ss_mf; /*!< SS Programmable modulation frequency, only applicable when not using - PLL_CONFIGFLAG_FORCENOFRACT flag */ - ss_progmoddp_t ss_mr; /*!< SS Programmable frequency modulation depth, only applicable when not using - PLL_CONFIGFLAG_FORCENOFRACT flag */ - ss_modwvctrl_t - ss_mc; /*!< SS Modulation waveform control, only applicable when not using PLL_CONFIGFLAG_FORCENOFRACT flag - */ - bool mfDither; /*!< false for fixed modulation frequency or true for dithering, only applicable when not using - PLL_CONFIGFLAG_FORCENOFRACT flag */ - -} pll_config_t; - -/*! @brief PLL0 setup structure - * This structure can be used to pre-build a PLL setup configuration - * at run-time and quickly set the PLL to the configuration. It can be - * populated with the PLL setup function. If powering up or waiting - * for PLL lock, the PLL input clock source should be configured prior - * to PLL setup. - */ -typedef struct _pll_setup -{ - uint32_t pllctrl; /*!< PLL Control register APLLCTRL */ - uint32_t pllndiv; /*!< PLL N Divider register APLLNDIV */ - uint32_t pllpdiv; /*!< PLL P Divider register APLLPDIV */ - uint32_t pllmdiv; /*!< PLL M Divider register APLLMDIV */ - uint32_t pllsscg[2]; /*!< PLL Spread Spectrum Control registers APLLSSCG*/ - uint32_t pllRate; /*!< Acutal PLL rate */ -} pll_setup_t; - -/*! @brief PLL status definitions - */ -typedef enum _pll_error -{ - kStatus_PLL_Success = MAKE_STATUS(kStatusGroup_Generic, 0), /*!< PLL operation was successful */ - kStatus_PLL_OutputTooLow = MAKE_STATUS(kStatusGroup_Generic, 1), /*!< PLL output rate request was too low */ - kStatus_PLL_OutputTooHigh = MAKE_STATUS(kStatusGroup_Generic, 2), /*!< PLL output rate request was too high */ - kStatus_PLL_OutputError = MAKE_STATUS(kStatusGroup_Generic, 3), /*!< PLL output rate error */ - kStatus_PLL_InputTooLow = MAKE_STATUS(kStatusGroup_Generic, 4), /*!< PLL input rate is too low */ - kStatus_PLL_InputTooHigh = MAKE_STATUS(kStatusGroup_Generic, 5), /*!< PLL input rate is too high */ - kStatus_PLL_OutsideIntLimit = MAKE_STATUS(kStatusGroup_Generic, 6), /*!< Requested output rate isn't possible */ - kStatus_PLL_CCOTooLow = MAKE_STATUS(kStatusGroup_Generic, 7), /*!< Requested CCO rate isn't possible */ - kStatus_PLL_CCOTooHigh = MAKE_STATUS(kStatusGroup_Generic, 8) /*!< Requested CCO rate isn't possible */ -} pll_error_t; - -/*! @brief Return PLL0 output clock rate from setup structure - * @param pSetup : Pointer to a PLL setup structure - * @return System PLL output clock rate the setup structure will generate - */ -uint32_t CLOCK_GetPLLOutFromSetup(pll_setup_t *pSetup); - -/*! @brief Set PLL output based on the passed PLL setup data - * @param pControl : Pointer to populated PLL control structure to generate setup with - * @param pSetup : Pointer to PLL setup structure to be filled - * @return PLL_ERROR_SUCCESS on success, or PLL setup error code - * @note Actual frequency for setup may vary from the desired frequency based on the - * accuracy of input clocks, rounding, non-fractional PLL mode, etc. - */ -pll_error_t CLOCK_SetupPLLData(pll_config_t *pControl, pll_setup_t *pSetup); - -/** - * @brief Set PLL output from PLL setup structure (precise frequency) - * @param pSetup : Pointer to populated PLL setup structure - * @return kStatus_PLL_Success on success, or PLL setup error code - * @note This function will power off the PLL, setup the PLL with the - * new setup data, and then optionally powerup the PLL, wait for PLL lock, - * and adjust system voltages to the new PLL rate. The function will not - * alter any source clocks (ie, main systen clock) that may use the PLL, - * so these should be setup prior to and after exiting the function. - */ -pll_error_t CLOCK_SetPLL0Freq(const pll_setup_t *pSetup); - -/** - * @brief Set PLL output from PLL setup structure (precise frequency) - * @param pSetup : Pointer to populated PLL setup structure - * @return kStatus_PLL_Success on success, or PLL setup error code - * @note This function will power off the PLL, setup the PLL with the - * new setup data, and then optionally powerup the PLL, wait for PLL lock, - * and adjust system voltages to the new PLL rate. The function will not - * alter any source clocks (ie, main systen clock) that may use the PLL, - * so these should be setup prior to and after exiting the function. - */ -pll_error_t CLOCK_SetPLL1Freq(const pll_setup_t *pSetup); - -/*! @brief Enable the OSTIMER 32k clock. - * @return Nothing - */ -void CLOCK_EnableOstimer32kClock(void); - -/*! brief Enable USB FS clock. - * Enable USB Full Speed clock. - */ -bool CLOCK_EnableUsbfsClock(void); - -/*! brief Enable USB HS PHY PLL clock. - * - * This function enables the internal 480MHz USB PHY PLL clock. - * - * param src USB HS PHY PLL clock source. - * param freq The frequency specified by src. - * retval true The clock is set successfully. - * retval false The clock source is invalid to get proper USB HS clock. - */ -bool CLOCK_EnableUsbhsPhyPllClock(clock_usb_phy_src_t src, uint32_t freq); - -/*! brief Disable USB HS PHY PLL clock. - * - * This function disables USB HS PHY PLL clock. - */ -void CLOCK_DisableUsbhsPhyPllClock(void); - -/*! brief Enable USB HS clock. - * retval true The clock is set successfully. - * retval false The clock source is invalid to get proper USB HS clock. - */ -bool CLOCK_EnableUsbhsClock(void); - -/** - * @brief FIRC Auto Trim With SOF. - * @return returns success or fail status. - */ -status_t CLOCK_FIRCAutoTrimWithSOF(void); - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @} */ - -#endif /* _FSL_CLOCK_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_cmc.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_cmc.c deleted file mode 100644 index 4e388d9e73a..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_cmc.c +++ /dev/null @@ -1,310 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#include "fsl_cmc.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.mcx_cmc" -#endif - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ -static uint32_t g_savedPrimask; - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Sets clock mode. - * - * This function configs the amount of clock gating when the core asserts - * Sleeping due to WFI, WFE or SLEEPONEXIT. - * - * param base CMC peripheral base address. - * param mode System clock mode. - */ -void CMC_SetClockMode(CMC_Type *base, cmc_clock_mode_t mode) -{ - uint32_t reg; - - reg = base->CKCTRL; - reg &= ~CMC_CKCTRL_CKMODE_MASK; - reg |= CMC_CKCTRL_CKMODE((mode)); - base->CKCTRL = reg; -} - -/*! - * brief Configures all power mode protection settings. - * - * This function configures the power mode protection settings for - * supported power modes. This should be done before setting the lowPower mode - * for each power doamin. - * - * The allowed lowpower modes are passed as bit map. For example, to allow - * Sleep and DeepSleep, use CMC_SetPowerModeProtection(CMC_base, kCMC_AllowSleepMode|kCMC_AllowDeepSleepMode). - * To allow all low power modes, use CMC_SetPowerModeProtection(CMC_base, kCMC_AllowAllLowPowerModes). - * - * param base CMC peripheral base address. - * param allowedModes Bitmaps of the allowed power modes. - */ -void CMC_SetPowerModeProtection(CMC_Type *base, uint32_t allowedModes) -{ - uint32_t reg; - - reg = base->PMPROT; - reg &= ~0xFUL; - reg |= allowedModes; - - base->PMPROT = reg; -} - -/*! - * brief Configure reset pin. - * - * This function configures reset pin. When enabled, the low power filter is enabled in both - * Active and Low power modes, the reset filter is only enabled in Active mode. When both filers - * are enabled, they operate in series. - * - * param base CMC peripheral base address. - * param config Pointer to the reset pin config structure. - */ -void CMC_ConfigResetPin(CMC_Type *base, const cmc_reset_pin_config_t *config) -{ - assert(config != NULL); - - uint32_t reg = base->RPC; - - if (config->lowpowerFilterEnable) - { - reg |= CMC_RPC_LPFEN_MASK; - } - else - { - reg &= ~CMC_RPC_LPFEN_MASK; - } - if (config->resetFilterEnable) - { - reg |= (CMC_RPC_FILTEN_MASK | CMC_RPC_FILTCFG(config->resetFilterWidth)); - } - else - { - reg &= ~(CMC_RPC_FILTEN_MASK | CMC_RPC_FILTCFG_MASK); - } - base->RPC = reg; -} - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG) && FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG) -/*! - * brief Power off the selected system SRAM always. - * - * This function powers off the selected system SRAM always. The SRAM arrays should - * not be accessed while they are shut down. SRAM array contents are not retained - * if they are powered off. - * - * param base CMC peripheral base address. - * param mask Bitmap of the SRAM arrays to be powered off all modes. - */ -void CMC_PowerOffSRAMAllMode(CMC_Type *base, uint32_t mask) -{ - uint32_t reg = base->SRAMDIS[0]; - uint32_t maskToSet = mask & ((uint32_t)kCMC_AllSramArrays); - - reg &= ~((uint32_t)kCMC_AllSramArrays); - reg |= CMC_SRAMDIS_DIS(maskToSet); - base->SRAMDIS[0] = reg; -} - -/*! - * brief Power off the selected system SRAm during low power mode only. - * - * This function powers off the selected system SRAM only during low power mode. - * SRAM array contents are not retained if they are power off. - * - * param base CMC peripheral base address. - * param mask Bitmap of the SRAM arrays to be power off during low power mode only. - */ -void CMC_PowerOffSRAMLowPowerOnly(CMC_Type *base, uint32_t mask) -{ - uint32_t reg = base->SRAMRET[0]; - uint32_t maskToSet = mask & ((uint32_t)kCMC_AllSramArrays); - - reg &= ~((uint32_t)kCMC_AllSramArrays); - reg |= CMC_SRAMRET_RET(maskToSet); - base->SRAMRET[0] = reg; -} -#endif /* FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG */ - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_NO_FLASHCR_WAKE) && FSL_FEATURE_MCX_CMC_HAS_NO_FLASHCR_WAKE) -/*! - * brief Configs the low power mode of the on-chip flash memory. - * - * This function configs the low power mode of the on-chip flash memory. - * - * param base CMC peripheral base address. - * param doze true: Flash is disabled while core is sleeping - * false: No effect. - * param disable true: Flash memory is placed in low power state. - * false: No effect. - */ -void CMC_ConfigFlashMode(CMC_Type *base, bool doze, bool disable) -{ - uint32_t reg = 0UL; - - reg |= (disable ? CMC_FLASHCR_FLASHDIS(1U) : CMC_FLASHCR_FLASHDIS(0U)) | - (doze ? CMC_FLASHCR_FLASHDOZE(1U) : CMC_FLASHCR_FLASHDOZE(0U)); - base->FLASHCR = reg; -} -#else -/*! - * brief Configs the low power mode of the on-chip flash memory. - * - * This function config the low power mode of the on-chip flash memory. - * - * param base CMC peripheral base address. - * param wake - * true - Flash will exit low power state during the flash memory accesses. - * false - No effect. - * param doze - * true - Flash is disabled while core is sleeping - * false - No effect. - * param disable - * true - Flash memory is placed in low power state. - * false - No effect. - */ -void CMC_ConfigFlashMode(CMC_Type *base, bool wake, bool doze, bool disable) -{ - uint32_t reg = 0UL; - - reg |= (disable ? CMC_FLASHCR_FLASHDIS(1U) : CMC_FLASHCR_FLASHDIS(0U)) | - (doze ? CMC_FLASHCR_FLASHDOZE(1U) : CMC_FLASHCR_FLASHDOZE(0U)) | - (wake ? CMC_FLASHCR_FLASHWAKE(1U) : CMC_FLASHCR_FLASHWAKE(0U)); - base->FLASHCR = reg; -} -#endif /* FSL_FEATURE_MCX_CMC_HAS_NO_FLASHCR_WAKE */ - -/*! - * brief Prepares to enter stop modes. - * - * This function should be called before entering low power modes. - * - */ -void CMC_PreEnterLowPowerMode(void) -{ - g_savedPrimask = DisableGlobalIRQ(); - __ISB(); -} - -/*! - * brief Recovers after wake up from stop modes. - * - * This function should be called after waking up from low power modes. - * This function should be used with CMC_PreEnterLowPowerMode() - * - */ -void CMC_PostExitLowPowerMode(void) -{ - EnableGlobalIRQ(g_savedPrimask); - __ISB(); -} - -/*! - * brief Configs the entry into the same low power mode for each power domains. - * - * This function provides the feature to entry into the same low power mode for each power - * domains. Before invoking this function, please ensure the selected power mode have been allowed. - * - * param base CMC peripheral base address. - * param lowPowerMode The low power mode to be entered. See @ref cmc_low_power_mode_t for the details. - * - */ -void CMC_GlobalEnterLowPowerMode(CMC_Type *base, cmc_low_power_mode_t lowPowerMode) -{ - /* Note: unlock the CKCTRL register if this API will be reinvoked later. */ - CMC_SetClockMode(base, kCMC_GateAllSystemClocksEnterLowPowerMode); - CMC_SetGlobalPowerMode(base, lowPowerMode); - /* Before executing WFI instruction read back the last register to - * ensure all registers writes have completed. */ - (void)base->GPMCTRL; - /* Set the core into DeepSleep mode. */ - SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; - __DSB(); - __WFI(); - __ISB(); -} - -/*! - * brief Configs the entry into different low power modes for each of the power domains. - * - * This function provides the feature to entry into different low power modes for - * each power domains. Before invoking this function please ensure the selected - * modes are allowed. - * - * param base CMC peripheral base address. - * param base config Pointer to the cmc_power_domain_config_t structure. - */ -void CMC_EnterLowPowerMode(CMC_Type *base, const cmc_power_domain_config_t *config) -{ - assert(config != NULL); - -#if (CMC_PMCTRL_COUNT > 1U) - /* The WAKE domain must never be configured to a lower power mode compared with main power mode. */ - assert(config->wake_domain <= config->main_domain); -#endif /* (CMC_PMCTRL_COUNT > 1U) */ - - if (config->clock_mode < kCMC_GateAllSystemClocksEnterLowPowerMode) - { - /* In This case the power domain doesn't need to be placed in low power state. */ - /* Note: unlock the register if this API will be reinvoked later. */ - CMC_SetClockMode(base, config->clock_mode); - - CMC_SetMAINPowerMode(base, kCMC_ActiveOrSleepMode); -#if (CMC_PMCTRL_COUNT > 1U) - CMC_SetWAKEPowerMode(base, kCMC_ActiveOrSleepMode); -#endif /* (CMC_PMCTRL_COUNT > 1U) */ - - /* Before executing WFI instruction read back the last register to - * ensure all registers writes have completed. */ - (void)base->CKCTRL; - SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; - __DSB(); - __WFI(); - __ISB(); - } - else - { - /* Note: unlock the register if this API will be reinvoked later. */ - CMC_SetClockMode(base, kCMC_GateAllSystemClocksEnterLowPowerMode); - CMC_SetMAINPowerMode(base, config->main_domain); -#if (CMC_PMCTRL_COUNT > 1U) - CMC_SetWAKEPowerMode(base, config->wake_domain); -#endif /* (CMC_PMCTRL_COUNT > 1U) */ - - /* Before execute WFI instruction read back the last register to - * ensure all registers writes have completed. */ -#if (CMC_PMCTRL_COUNT > 1U) - if ((CMC_GetWAKEPowerMode(base) == config->wake_domain) && (CMC_GetMAINPowerMode(base) == config->main_domain)) - { -#endif /* (CMC_PMCTRL_COUNT > 1U) */ - SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; - __DSB(); - __WFI(); - __ISB(); -#if (CMC_PMCTRL_COUNT > 1U) - } -#endif /* (CMC_PMCTRL_COUNT > 1U) */ - } -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_cmc.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_cmc.h deleted file mode 100644 index 6dbe8e974bd..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_cmc.h +++ /dev/null @@ -1,929 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_CMC_H_ -#define FSL_CMC_H_ -#include "fsl_common.h" - -/*! - * @addtogroup mcx_cmc - * @{ - */ -/******************************************************************************* - * Definitions - ******************************************************************************/ -/*! @name Driver version */ -/*@{*/ -/*! @brief CMC driver version 2.2.2. */ -#define FSL_CMC_DRIVER_VERSION (MAKE_VERSION(2, 2, 2)) -/* @} */ - -/*! - * @brief CMC power mode Protection enumeration. - */ -enum _cmc_power_mode_protection -{ - kCMC_AllowDeepSleepMode = 0x1UL, /*!< Allow Deep Sleep mode. */ - kCMC_AllowPowerDownMode = 0x2UL, /*!< Allow Power Down mode. */ - kCMC_AllowDeepPowerDownMode = 0x8UL, /*!< Allow Deep Power Down mode. */ - kCMC_AllowAllLowPowerModes = 0xFUL, /*!< Allow Deep Sleep, Power Down, Deep Power Down modes. */ -}; - -/*! - * @brief Wake up sources from the previous low power mode entry. - * - * @note #kCMC_WakeupFromUsbFs, #kCMC_WakeupFromITRC, #kCMC_WakeupFromCpu1 are not supported in MCXA family. - */ -enum _cmc_wakeup_sources -{ - kCMC_WakeupFromResetInterruptOrPowerDown = - CMC_CKSTAT_WAKEUP(1U << 0U), /*!< Wakeup source is reset interrupt, or wake up from Deep Power Down. */ - kCMC_WakeupFromDebugReuqest = CMC_CKSTAT_WAKEUP(1U << 1U), /*!< Wakeup source is debug request. */ - kCMC_WakeupFromInterrupt = CMC_CKSTAT_WAKEUP(1U << 2U), /*!< Wakeup source is interrupt. */ - kCMC_WakeupFromDMAWakeup = CMC_CKSTAT_WAKEUP(1U << 3U), /*!< Wakeup source is DMA Wakeup. */ - kCMC_WakeupFromWUURequest = CMC_CKSTAT_WAKEUP(1U << 4U), /*!< Wakeup source is WUU request. */ - kCMC_WakeupFromUsbFs = CMC_CKSTAT_WAKEUP(1U << 5U), /*!< Wakeup source is USBFS(USB0). */ - kCMC_WakeupFromITRC = CMC_CKSTAT_WAKEUP(1U << 6U), /*!< Wakeup source is ITRC. */ - kCMC_WakeupFromCpu1 = CMC_CKSTAT_WAKEUP(1U << 7U), /*!< Wakeup source is CPU1. */ -}; - -/*! - * @brief System Reset Interrupt enable enumeration. - */ -enum _cmc_system_reset_interrupt_enable -{ - kCMC_PinResetInterruptEnable = CMC_SRIE_PIN_MASK, /*!< Pin Reset interrupt enable. */ - kCMC_DAPResetInterruptEnable = CMC_SRIE_DAP_MASK, /*!< DAP Reset interrupt enable. */ - kCMC_LowPowerAcknowledgeTimeoutResetInterruptEnable = CMC_SRIE_LPACK_MASK, /*!< Low Power Acknowledge Timeout - Reset interrupt enable. */ - kCMC_WindowedWatchdog0ResetInterruptEnable = CMC_SRIE_WWDT0_MASK, /*!< Windowed Watchdog 0 reset - interrupt enable. */ - kCMC_SoftwareResetInterruptEnable = CMC_SRIE_SW_MASK, /*!< Software Reset interrupt enable. */ - kCMC_LockupResetInterruptEnable = CMC_SRIE_LOCKUP_MASK, /*!< Lockup Reset interrupt enable. */ -#if defined(CMC_SRIE_CPU1_MASK) - kCMC_Cpu1ResetInterruptEnable = CMC_SRIE_CPU1_MASK, /*!< CPU1 Reset interrupt enable. */ -#endif /* CMC_SRIE_CPU1_MASK */ -#if defined(CMC_SRIE_ADVC_MASK) - kCMC_AdvcResetInterruptEnable = CMC_SRIE_ADVC_MASK, /*!< ADVC Reset interrupt enable. */ -#endif /* CMC_SRIE_ADVC_MASK */ -#if defined(CMC_SRIE_VBAT_MASK) - kCMC_VBATResetInterruptEnable = CMC_SRIE_VBAT_MASK, /*!< VBAT reset interrupt enable. */ -#endif /* CMC_SRIE_VBAT_MASK */ -#if defined(CMC_SRIE_WWDT1_MASK) - kCMC_WindowedWatchdog1ResetInterruptEnable = CMC_SRIE_WWDT1_MASK, /*!< Windowed Watchdog 1 reset - interrupt enable. */ -#endif /* CMC_SRIE_WWDT1_MASK */ - kCMC_CodeWatchDog0ResetInterruptEnable = CMC_SRIE_CDOG0_MASK, /*!< Code watchdog 0 reset interrupt enable. */ -#if defined(CMC_SRIE_CDOG1_MASK) - kCMC_CodeWatchDog1ResetInterruptEnable = CMC_SRIE_CDOG1_MASK, /*!< Code watchdog 1 reset interrupt enable. */ -#endif /* CMC_SRIE_CDOG1_MASK */ -}; - -/*! - * @brief CMC System Reset Interrupt Status flag. - */ -enum _cmc_system_reset_interrupt_flag -{ - kCMC_PinResetInterruptFlag = CMC_SRIF_PIN_MASK, /*!< Pin Reset interrupt flag. */ - kCMC_DAPResetInterruptFlag = CMC_SRIF_DAP_MASK, /*!< DAP Reset interrupt flag. */ - kCMC_LowPowerAcknowledgeTimeoutResetFlag = CMC_SRIF_LPACK_MASK, /*!< Low Power Acknowledge - Timeout Reset interrupt flag. */ - kCMC_WindowedWatchdog0ResetInterruptFlag = CMC_SRIF_WWDT0_MASK, /*!< Windowned Watchdog 0 Reset interrupt flag. */ - kCMC_SoftwareResetInterruptFlag = CMC_SRIF_SW_MASK, /*!< Software Reset interrupt flag. */ - kCMC_LockupResetInterruptFlag = CMC_SRIF_LOCKUP_MASK, /*!< Lock up Reset interrupt flag. */ -#if defined(CMC_SRIF_CPU1_MASK) - kCMC_Cpu1ResetInterruptFlag = CMC_SRIF_CPU1_MASK, /*!< CPU1 Reset interrupt flag. */ -#endif /* CMC_SRIF_CPU1_MASK */ -#if defined(CMC_SRIF_ADVC_MASK) - kCMC_AdvcResetInterruptFlag = CMC_SRIF_ADVC_MASK, /*!< ADVC Reset interrupt flag. */ -#endif /* CMC_SRIF_ADVC_MASK */ -#if defined(CMC_SRIF_VBAT_MASK) - kCMC_VbatResetInterruptFlag = CMC_SRIF_VBAT_MASK, /*!< VBAT system reset interrupt flag. */ -#endif /* CMC_SRIF_VBAT_MASK */ -#if defined(CMC_SRIF_WWDT1_MASK) - kCMC_WindowedWatchdog1ResetInterruptFlag = CMC_SRIF_WWDT1_MASK, /*!< Windowned Watchdog 1 Reset interrupt flag. */ -#endif /* CMC_SRIF_WWDT1_MASK */ - kCMC_CodeWatchdog0ResetInterruptFlag = CMC_SRIF_CDOG0_MASK, /*!< Code watchdog0 reset interrupt flag. */ -#if defined(CMC_SRIF_CDOG1_MASK) - kCMC_CodeWatchdog1ResetInterruptFlag = CMC_SRIF_CDOG1_MASK, /*!< Code watchdog1 reset interrupt flag. */ -#endif /* CMC_SRIF_CDOG1_MASK */ -}; - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG) && FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG) -/*! - * @brief CMC System SRAM arrays low power mode enable enumeration. - */ -enum _cmc_system_sram_arrays -{ - kCMC_RAMX0 = 1UL << 0UL, /*!< Used to control RAMX0. */ - kCMC_RAMX1 = 1UL << 1UL, /*!< Used to control RAMX1. */ - kCMC_RAMX2 = 1UL << 2UL, /*!< Used to control RAMX2. */ - kCMC_RAMB = 1UL << 3UL, /*!< Used to control RAMB. */ - kCMC_RAMC0 = 1UL << 4UL, /*!< Used to control RAMC0. */ - kCMC_RAMC1 = 1UL << 5UL, /*!< Used to control RAMC1. */ - kCMC_RAMD0 = 1UL << 6UL, /*!< Used to control RAMD0. */ - kCMC_RAMD1 = 1UL << 7UL, /*!< Used to control RAMD1. */ - kCMC_RAME0 = 1UL << 8UL, /*!< Used to control RAME0. */ - kCMC_RAME1 = 1UL << 9UL, /*!< Used to control RAME1. */ - kCMC_RAMF0 = 1UL << 10UL, /*!< Used to control RAMF0. */ - kCMC_RAMF1 = 1UL << 11UL, /*!< Used to control RAMF1. */ - kCMC_RAMG0_RAMG1 = 1UL << 12UL, /*!< Used to control RAMG0 and RAMG1. */ - kCMC_RAMG2_RAMG3 = 1UL << 13UL, /*!< Used to control RAMG2 and RAMG3. */ - kCMC_RAMH0_RAMH1 = 1UL << 14UL, /*!< Used to control RAMH0 and RAMH1. */ - kCMC_LPCAC = 1UL << 24UL, /*!< Used to control LPCAC. */ - kCMC_DMA0_DMA1_PKC = 1UL << 25UL, /*!< Used to control DMA0, DMA1 and PKC. */ - kCMC_USB0 = 1UL << 26UL, /*!< Used to control USB0. */ - kCMC_PQ = 1UL << 27UL, /*!< Used to control PQ. */ - kCMC_CAN0_CAN1_ENET_USB1 = 1UL << 28UL, /*!< Used to control CAN0, CAN1, ENET, USB1. */ - kCMC_FlexSPI = 1UL << 29UL, /*!< Used to control FlexSPI. */ - - kCMC_AllSramArrays = (kCMC_RAMX0 | kCMC_RAMX1 | kCMC_RAMX2 | kCMC_RAMB | kCMC_RAMC0 | kCMC_RAMC1 | kCMC_RAMD0 | - kCMC_RAMD1 | kCMC_RAME0 | kCMC_RAME1 | kCMC_RAMF0 | kCMC_RAMF1 | kCMC_RAMG0_RAMG1 | - kCMC_RAMG2_RAMG3 | kCMC_RAMH0_RAMH1 | kCMC_LPCAC | kCMC_DMA0_DMA1_PKC | kCMC_USB0 | kCMC_PQ | - kCMC_CAN0_CAN1_ENET_USB1 | kCMC_FlexSPI), /*!< Mask of all System SRAM arrays. */ -}; -#endif /* FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG */ - -/*! - * @brief System reset sources enumeration. - */ -enum _cmc_system_reset_sources -{ - kCMC_WakeUpReset = CMC_SRS_WAKEUP_MASK, /*!< The reset caused by a wakeup from Power Down or - Deep Power Down mode. */ - kCMC_PORReset = CMC_SRS_POR_MASK, /*!< The reset caused by power on reset detection logic. */ - kCMC_VDReset = CMC_SRS_VD_MASK, /*!< The reset caused by an LVD or HVD. */ - kCMC_WarmReset = CMC_SRS_WARM_MASK, /*!< The last reset source is a warm reset source. */ - kCMC_FatalReset = CMC_SRS_FATAL_MASK, /*!< The last reset source is a fatal reset source. */ - kCMC_PinReset = CMC_SRS_PIN_MASK, /*!< The reset caused by the RESET_b pin. */ - kCMC_DAPReset = CMC_SRS_DAP_MASK, /*!< The reset caused by a reset request from the Debug Access port. */ - kCMC_ResetTimeout = CMC_SRS_RSTACK_MASK, /*!< The reset caused by a timeout or other error condition in the system - reset generation. */ - kCMC_LowPowerAcknowledgeTimeoutReset = CMC_SRS_LPACK_MASK, /*!< The reset caused by a timeout in - low power mode entry logic. */ - kCMC_SCGReset = CMC_SRS_SCG_MASK, /*!< The reset caused by a loss of clock or loss of lock event in the SCG. */ - kCMC_WindowedWatchdog0Reset = CMC_SRS_WWDT0_MASK, /*!< The reset caused by the Windowed WatchDog 0 timeout. */ - kCMC_SoftwareReset = CMC_SRS_SW_MASK, /*!< The reset caused by a software reset request. */ - kCMC_LockUoReset = CMC_SRS_LOCKUP_MASK, /*!< The reset caused by the ARM core indication of a LOCKUP event. */ -#if defined(CMC_SRS_CPU1_MASK) - kCMC_Cpu1Reset = CMC_SRS_CPU1_MASK, /*!< The reset caused by a CPU1 system reset. */ -#endif /* CMC_SRS_CPU1_MASK */ -#if defined(CMC_SRS_ADVC_MASK) - kCMC_AdvcReset = CMC_SRS_ADVC_MASK, /*!< The reset caused by ADVC critical reset. */ -#endif /* CMC_SRS_ADVC_MASK */ -#if defined(CMC_SRS_VBAT_MASK) - kCMC_VbatReset = CMC_SRS_VBAT_MASK, /*!< The reset caused by a VBAT POR. */ -#endif /* CMC_SRS_VBAT_MASK */ -#if defined(CMC_SRS_WWDT1_MASK) - kCMC_WindowedWatchdog1Reset = CMC_SRS_WWDT1_MASK, /*!< The reset caused by the Windowed WatchDog 1 timeout. */ -#endif /* CMC_SRS_WWDT1_MASK */ - kCMC_CodeWatchDog0Reset = CMC_SRS_CDOG0_MASK, /*!< The reset caused by the code watchdog0 fault. */ -#if defined(CMC_SRS_CDOG1_MASK) - kCMC_CodeWatchDog1Reset = CMC_SRS_CDOG1_MASK, /*!< The reset caused by the code watchdog1 fault. */ -#endif /* CMC_SRS_CDOG1_MASK */ - kCMC_JTAGSystemReset = CMC_SRS_JTAG_MASK, /*!< The reset caused by a JTAG system reset request. */ -#if defined(CMC_SRS_SECVIO_MASK) - kCMC_SecurityViolationReset = CMC_SRS_SECVIO_MASK, /*!< The reset caused by a Security Violation logic. */ -#endif /* CMC_SRS_SECVIO_MASK */ -#if defined(CMC_SRS_TAMPER_MASK) - kCMC_TapmerReset = CMC_SRS_TAMPER_MASK, /*!< The reset caused by the tamper detection logic. */ -#endif /* CMC_SRS_TAMPER_MASK */ -}; - -/*! - * @brief Indicate the core clock was gated. - */ -typedef enum _cmc_core_clock_gate_status -{ - kCMC_CoreClockNotGated = 0U, /*!< Core clock not gated. */ - kCMC_CoreClockGated = 1U /*!< Core clock was gated due to low power mode entry. */ -} cmc_core_clock_gate_status_t; - -/*! - * @brief CMC clock mode enumeration. - */ -typedef enum _cmc_clock_mode -{ - kCMC_GateNoneClock = 0x00U, /*!< No clock gating. */ - kCMC_GateCoreClock = 0x01U, /*!< Gate Core clock. */ - kCMC_GateCorePlatformClock = 0x03U, /*!< Gate Core clock and platform clock. */ - kCMC_GateAllSystemClocks = 0x07U, /*!< Gate all System clocks, without getting core entering into low power mode. */ - kCMC_GateAllSystemClocksEnterLowPowerMode = 0x0FU /*!< Gate all System clocks, with core - entering into low power mode. */ -} cmc_clock_mode_t; - -/*! - * @brief CMC power mode enumeration. - */ -typedef enum _cmc_low_power_mode -{ - kCMC_ActiveOrSleepMode = 0x0U, /*!< Select Active/Sleep mode. */ - kCMC_DeepSleepMode = 0x1U, /*!< Select Deep Sleep mode when a core executes WFI or WFE instruction. */ - kCMC_PowerDownMode = 0x3U, /*!< Select Power Down mode when a core executes WFI or WFE instruction. */ - kCMC_DeepPowerDown = 0xFU, /*!< Select Deep Power Down mode when a core executes WFI or WFE instruction. */ -} cmc_low_power_mode_t; - -/*! - * @brief CMC reset pin configuration. - */ -typedef struct _cmc_reset_pin_config -{ - bool lowpowerFilterEnable; /*!< Low Power Filter enable. */ - bool resetFilterEnable; /*!< Reset Filter enable. */ - uint8_t resetFilterWidth; /*!< Width of the Reset Filter. */ -} cmc_reset_pin_config_t; - -/*! - * @brief power mode configuration for each power domain. - */ -typedef struct _cmc_power_domain_config -{ - cmc_clock_mode_t clock_mode; /*!< Clock mode for each power domain. */ - cmc_low_power_mode_t main_domain; /*!< The low power mode of the MAIN power domain. */ -#if (CMC_PMCTRL_COUNT > 1U) - cmc_low_power_mode_t wake_domain; /*!< The low power mode of the WAKE power domain. */ -#endif /* (CMC_PMCTRL_COUNT > 1U) */ -} cmc_power_domain_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name CLOCK mode configuration. - * @{ - */ - -/*! - * @brief Sets clock mode. - * - * This function configs the amount of clock gating when the core asserts - * Sleeping due to WFI, WFE or SLEEPONEXIT. - * - * @param base CMC peripheral base address. - * @param mode System clock mode. - */ -void CMC_SetClockMode(CMC_Type *base, cmc_clock_mode_t mode); - -/*! - * @brief Locks the clock mode setting. - * - * After invoking this function, any clock mode setting will be blocked. - * - * @param base CMC peripheral base address. - */ -static inline void CMC_LockClockModeSetting(CMC_Type *base) -{ - base->CKCTRL |= CMC_CKCTRL_LOCK_MASK; -} - -/* @} */ - -/*! - * @name Gets/Clears the Clock Mode, the wake up source, the Reset source. - * @{ - */ - -/*! - * @brief Gets the core clock gated status. - * - * This function get the status to indicate whether the core clock is gated. - * The core clock gated status can be cleared by software. - * - * @param base CMC peripheral base address. - * @return The status to indicate whether the core clock is gated. - */ -static inline cmc_core_clock_gate_status_t CMC_GetCoreClockGatedStatus(CMC_Type *base) -{ - return (cmc_core_clock_gate_status_t)(uint32_t)((base->CKSTAT & CMC_CKSTAT_VALID_MASK) >> CMC_CKSTAT_VALID_SHIFT); -} - -/*! - * @brief Clears the core clock gated status. - * - * This function clear clock status flag by software. - * - * @param base CMC peripheral base address. - */ -static inline void CMC_ClearCoreClockGatedStatus(CMC_Type *base) -{ - base->CKSTAT |= CMC_CKSTAT_VALID_MASK; -} - -/*! - * @brief Gets the Wakeup Source. - * - * This function gets the Wakeup sources from the previous low power mode entry. - * - * @param base CMC peripheral base address. - * @return The Wakeup sources from the previous low power mode entry. See @ref _cmc_wakeup_sources for details. - */ -static inline uint8_t CMC_GetWakeupSource(CMC_Type *base) -{ - return ((uint8_t)((base->CKSTAT & CMC_CKSTAT_WAKEUP_MASK) >> CMC_CKSTAT_WAKEUP_SHIFT)); -} - -/*! - * @brief Gets the Clock mode. - * - * This function gets the clock mode of the previous low power mode entry. - * - * @param base CMC peripheral base address. - * @return The Low Power status. - */ -static inline cmc_clock_mode_t CMC_GetClockMode(CMC_Type *base) -{ - return (cmc_clock_mode_t)(uint32_t)((base->CKSTAT & CMC_CKSTAT_CKMODE_MASK) >> CMC_CKSTAT_CKMODE_SHIFT); -} - -/*! - * @brief Gets the System reset status. - * - * This function returns the system reset status. Those status - * updates on every MAIN Warm Reset to indicate the type/source - * of the most recent reset. - * - * @param base CMC peripheral base address. - * @return The most recent system reset status. See @ref _cmc_system_reset_sources for details. - */ -static inline uint32_t CMC_GetSystemResetStatus(CMC_Type *base) -{ - return base->SRS; -} - -/*! - * @brief Gets the sticky system reset status since the last WAKE Cold Reset. - * - * This function gets all source of system reset that have generated a - * system reset since the last WAKE Cold Reset, and that have not been - * cleared by software. - * - * @param base CMC peripheral base address. - * @return System reset status that have not been cleared by software. See @ref _cmc_system_reset_sources for details. - */ -static inline uint32_t CMC_GetStickySystemResetStatus(CMC_Type *base) -{ - return base->SSRS; -} - -/*! - * @brief Clears the sticky system reset status flags. - * - * @param base CMC peripheral base address. - * @param mask Bitmap of the sticky system reset status to be cleared. - */ -static inline void CMC_ClearStickySystemResetStatus(CMC_Type *base, uint32_t mask) -{ - base->SSRS = mask; -} - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_RSTCNT_REG) && FSL_FEATURE_MCX_CMC_HAS_RSTCNT_REG) -/*! - * @brief Gets the number of reset sequences completed since the last Cold Reset. - * - * @param base CMC peripheral base address. - * @return The number of reset sequences. - */ -static inline uint8_t CMC_GetResetCount(CMC_Type *base) -{ - return (uint8_t)(base->RSTCNT & CMC_RSTCNT_COUNT_MASK); -} -#endif /* FSL_FEATURE_MCX_CMC_HAS_RSTCNT_REG */ - -/* @} */ - -/*! - * @name Power mode configuration. - * @{ - */ - -/*! - * @brief Configures all power mode protection settings. - * - * This function configures the power mode protection settings for - * supported power modes. This should be done before set the lowPower mode - * for each power doamin. - * - * The allowed lowpower modes are passed as bit map. For example, to allow - * Sleep and DeepSleep, use CMC_SetPowerModeProtection(CMC_base, kCMC_AllowSleepMode|kCMC_AllowDeepSleepMode). - * To allow all low power modes, use CMC_SetPowerModeProtection(CMC_base, kCMC_AllowAllLowPowerModes). - * - * @param base CMC peripheral base address. - * @param allowedModes Bitmaps of the allowed power modes. See @ref _cmc_power_mode_protection for details. - */ -void CMC_SetPowerModeProtection(CMC_Type *base, uint32_t allowedModes); - -/*! - * @brief Locks the power mode protection. - * - * This function locks the power mode protection. After invoking this function, - * any power mode protection setting will be ignored. - * - * @param base CMC peripheral base address. - */ -static inline void CMC_LockPowerModeProtectionSetting(CMC_Type *base) -{ - base->PMPROT |= CMC_PMPROT_LOCK_MASK; -} - -/*! - * @brief Config the same lowPower mode for all power domain. - * - * This function configures the same low power mode for MAIN power domian and WAKE power domain. - * - * @param base CMC peripheral base address. - * @param lowPowerMode The desired lowPower mode. See @ref cmc_low_power_mode_t for details. - */ -static inline void CMC_SetGlobalPowerMode(CMC_Type *base, cmc_low_power_mode_t lowPowerMode) -{ - base->GPMCTRL = CMC_GPMCTRL_LPMODE((uint8_t)lowPowerMode); -} - -/*! - * @brief Configures entry into low power mode for the MAIN Power domain. - * - * This function configures the low power mode for the MAIN power domian, - * when the core executes WFI/WFE instruction. The available lowPower modes - * are defined in the @ref cmc_low_power_mode_t. - * - * @param base CMC peripheral base address. - * @param lowPowerMode The desired lowPower mode. See @ref cmc_low_power_mode_t for details. - * - */ -static inline void CMC_SetMAINPowerMode(CMC_Type *base, cmc_low_power_mode_t lowPowerMode) -{ - base->PMCTRL[0] = CMC_PMCTRL_LPMODE((uint8_t)lowPowerMode); -} - -/*! - * @brief Gets the power mode of the MAIN Power domain. - * - * @param base CMC peripheral base address. - * @return The power mode of MAIN Power domain. See @ref cmc_low_power_mode_t for details. - */ -static inline cmc_low_power_mode_t CMC_GetMAINPowerMode(CMC_Type *base) -{ - return (cmc_low_power_mode_t)(uint32_t)(base->PMCTRL[0] & CMC_PMCTRL_LPMODE_MASK); -} - -#if (CMC_PMCTRL_COUNT > 1U) -/*! - * @brief Configure entry into low power mode for the WAKE Power domain. - * - * This function configures the low power mode for the WAKE power domian, - * when the core executes WFI/WFE instruction. The available lowPower mode - * are defined in the @ref cmc_low_power_mode_t. - * - * @note The lowPower Mode for the WAKE domain must not be configured to a - * lower power mode than any other power domain. - * - * @param base CMC peripheral base address. - * @param lowPowerMode The desired lowPower mode. See @ref cmc_low_power_mode_t for details. - * - */ -static inline void CMC_SetWAKEPowerMode(CMC_Type *base, cmc_low_power_mode_t lowPowerMode) -{ - base->PMCTRL[1] = CMC_PMCTRL_LPMODE((uint8_t)lowPowerMode); -} - -/*! - * @brief Gets the power mode of the WAKE Power domain. - * - * @param base CMC peripheral base address. - * @return The power mode of WAKE Power domain. See @ref cmc_low_power_mode_t for details. - */ -static inline cmc_low_power_mode_t CMC_GetWAKEPowerMode(CMC_Type *base) -{ - return (cmc_low_power_mode_t)(uint32_t)(base->PMCTRL[1] & CMC_PMCTRL_LPMODE_MASK); -} -#endif /* CMC_PMCTRL_COUNT > 1U */ - -/* @} */ - -/*! - * @name Reset Pin configuration. - * @{ - */ - -/*! - * @brief Configure reset pin. - * - * This function configures reset pin. When enabled, the low power filter is enabled in both - * Active and Low power modes, the reset filter is only enabled in Active mode. When both filers - * are enabled, they operate in series. - * - * @param base CMC peripheral base address. - * @param config Pointer to the reset pin config structure. - */ -void CMC_ConfigResetPin(CMC_Type *base, const cmc_reset_pin_config_t *config); - -/* @} */ - -/*! - * @name System Reset Interrupts. - * @{ - */ - -/*! - * @brief Enable system reset interrupts. - * - * This function enables the system reset interrupts. The assertion of - * non-fatal warm reset can be delayed for 258 cycles of the 32K_CLK clock - * while an enabled interrupt is generated. Then Software can perform a graceful - * shutdown or abort the non-fatal warm reset provided the pending reset source is cleared - * by resetting the reset source and then clearing the pending flag. - * - * @param base CMC peripheral base address. - * @param mask System reset interrupts. See @ref _cmc_system_reset_interrupt_enable for details. - * - */ -static inline void CMC_EnableSystemResetInterrupt(CMC_Type *base, uint32_t mask) -{ - base->SRIE |= mask; -} - -/*! - * @brief Disable system reset interrupts. - * - * This function disables the system reset interrupts. - * - * @param base CMC peripheral base address. - * @param mask System reset interrupts. See @ref _cmc_system_reset_interrupt_enable for details. - */ -static inline void CMC_DisableSystemResetInterrupt(CMC_Type *base, uint32_t mask) -{ - base->SRIE &= (uint32_t)(~mask); -} - -/*! - * @brief Gets System Reset interrupt flags. - * - * This function returns the System reset interrupt flags. - * - * @param base CMC peripheral base address. - * @return System reset interrupt flags. See @ref _cmc_system_reset_interrupt_flag for details. - */ -static inline uint32_t CMC_GetSystemResetInterruptFlags(CMC_Type *base) -{ - return base->SRIF; -} - -/*! - * @brief Clears System Reset interrupt flags. - * - * This function clears system reset interrupt flags. The pending reset source - * can be cleared by resetting the source of the reset and then clearing the pending - * flags. - * - * @param base CMC peripheral base address. - * @param mask System Reset interrupt flags. See @ref _cmc_system_reset_interrupt_flag for details. - * - */ -static inline void CMC_ClearSystemResetInterruptFlags(CMC_Type *base, uint32_t mask) -{ - base->SRIF = mask; -} - -/* @} */ - -/*! - * @name Non Maskable Pin interrupt. - * @{ - */ - -/*! - * @brief Enable/Disable Non maskable Pin interrupt. - * - * @param base CMC peripheral base address. - * @param enable Enable or disable Non maskable pin interrupt. - * true - enable Non-maskable pin interrupt. - * false - disable Non-maskable pin interupt. - */ -static inline void CMC_EnableNonMaskablePinInterrupt(CMC_Type *base, bool enable) -{ - if (enable) - { - base->CORECTL |= CMC_CORECTL_NPIE_MASK; - } - else - { - base->CORECTL &= ~CMC_CORECTL_NPIE_MASK; - } -} - -/* @} */ - -/*! - * @name Boot Configuration. - * @{ - */ - -/*! - * @brief Gets the logic state of the ISPMODE_n pin. - * - * This function returns the logic state of the ISPMODE_n pin - * on the last negation of RESET_b pin. - * - * @param base CMC peripheral base address. - * @return The logic state of the ISPMODE_n pin on the last negation of RESET_b pin. - */ -static inline uint8_t CMC_GetISPMODEPinLogic(CMC_Type *base) -{ - return (uint8_t)((base->MR[0] & CMC_MR_ISPMODE_n_MASK) >> CMC_MR_ISPMODE_n_SHIFT); -} - -/*! - * @brief Clears ISPMODE_n pin state. - * - * @param base CMC peripheral base address. - */ -static inline void CMC_ClearISPMODEPinLogic(CMC_Type *base) -{ - base->MR[0] = CMC_MR_ISPMODE_n_MASK; -} - -/*! - * @brief Set the logic state of the BOOT_CONFIGn pin. - * - * This function force the logic state of the Boot_Confign pin to assert - * on next system reset. - * - * @param base CMC peripheral base address. - * @param assert Assert the corresponding pin or not. - * true - Assert corresponding pin on next system reset. - * false - No effect. - */ -static inline void CMC_ForceBootConfiguration(CMC_Type *base, bool assert) -{ - if (assert) - { - base->FM[0] |= CMC_FM_FORCECFG_MASK; - } - else - { - base->FM[0] &= ~CMC_FM_FORCECFG_MASK; - } -} - -/* @} */ - -/*! - * @name BootROM Status. - * @{ - */ - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_BSR_REG) && FSL_FEATURE_MCX_CMC_HAS_BSR_REG) -/*! - * @brief Gets the status information written by the BootROM. - * - * @param base CMC peripheral base address. - * @return The status information written by the BootROM. - */ -static inline uint32_t CMC_GetBootRomStatus(CMC_Type *base) -{ - return base->BSR; -} - -/*! - * @brief Sets the bootROM status value. - * - * @note This function is useful when result of CMC_CheckBootRomRegisterWrittable() is true. - * - * @param base CMC peripheral base address. - * @param stat The state value to set. - */ -static inline void CMC_SetBootRomStatus(CMC_Type *base, uint32_t statValue) -{ - base->BSR = CMC_BSR_STAT(statValue); -} -#endif /* FSL_FEATURE_MCX_CMC_HAS_BSR_REG */ - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_BLR_REG) && FSL_FEATURE_MCX_CMC_HAS_BLR_REG) -/*! - * @brief Check if BootROM status and lock registers is writtable. - * - * @param base CMC peripheral base address. - * @return The result of whether BootROM status and lock register is writtable. - * - \b true BootROM status and lock registers are writtable; - * - \b false BootROM status and lock registers are not writtable. - */ -static inline bool CMC_CheckBootRomRegisterWrittable(CMC_Type *base) -{ - return (base->BLR == 0x2UL); -} - -/*! - * @brief After invoking this function, BootROM status and lock registers cannot be written. - * - * @param base CMC peripheral base address. - */ -static inline void CMC_LockBootRomStatusWritten(CMC_Type *base) -{ - base->BLR = CMC_BLR_LOCK(0x5U); -} - -/*! - * @brief After invoking this function, BootROM status and lock register can be written.s - * - * @param base - */ -static inline void CMC_UnlockBootRomStatusWritten(CMC_Type *base) -{ - base->BLR = CMC_BLR_LOCK(0x2U); -} -#endif /* FSL_FEATURE_MCX_CMC_HAS_BLR_REG */ - -/* @} */ - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG) && FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG) -/*! - * @name System SRAM Configuration. - * @{ - */ - -/*! - * @brief Power off the selected system SRAM always. - * - * @note This function power off the selected system SRAM always. The SRAM arrays should - * not be accessed while they are shut down. SRAM array contents are not retained - * if they are powered off. - * - * @note Once invoked, the previous settings will be overwritten. - * - * @param base CMC peripheral base address. - * @param mask Bitmap of the SRAM arrays to be powered off all modes. - * See @ref _cmc_system_sram_arrays for details. - * Check Reference Manual for the SRAM region and mask bit relationship. - */ -void CMC_PowerOffSRAMAllMode(CMC_Type *base, uint32_t mask); - -/*! - * @brief Power on SRAM during all mode. - * - * @note Once invoked, the previous settings will be overwritten. - * - * @param base CMC peripheral base address. - * @param mask Bitmap of the SRAM arrays to be powered on all modes. - * See @ref _cmc_system_sram_arrays for details. - * Check Reference Manual for the SRAM region and mask bit relationship. - */ -static inline void CMC_PowerOnSRAMAllMode(CMC_Type *base, uint32_t mask) -{ - base->SRAMDIS[0] &= CMC_SRAMDIS_DIS((uint32_t)(~mask)); -} - -/*! - * @brief Power off the selected system SRAM during low power modes only. - * - * This function power off the selected system SRAM only during low power mode. - * SRAM array contents are not retained if they are power off. - * - * @param base CMC peripheral base address. - * @param mask Bitmap of the SRAM arrays to be power off during low power mode only. - * See @ref _cmc_system_sram_arrays for details. - * Check Reference Manual for the SRAM region and mask bit relationship. - */ -void CMC_PowerOffSRAMLowPowerOnly(CMC_Type *base, uint32_t mask); - -/*! - * @brief Power on the selected system SRAM during low power modes only. - * - * This function power on the selected system SRAM. The SRAM arrray contents are - * retained in low power modes. - * - * @param base CMC peripheral base address. - * @param mask Bitmap of the SRAM arrays to be power on during low power mode only. - * See @ref _cmc_system_sram_arrays for details. - * Check Reference Manual for the SRAM region and mask bit relationship. - */ -static inline void CMC_PowerOnSRAMLowPowerOnly(CMC_Type *base, uint32_t mask) -{ - base->SRAMRET[0] &= CMC_SRAMRET_RET((uint32_t)(~mask)); -} - -/* @} */ -#endif /* FSL_FEATURE_MCX_CMC_HAS_SRAM_DIS_REG */ - -/*! - * @name Flash Low Power Mode configuration. - * @{ - */ - -#if (defined(FSL_FEATURE_MCX_CMC_HAS_NO_FLASHCR_WAKE) && FSL_FEATURE_MCX_CMC_HAS_NO_FLASHCR_WAKE) -/*! - * @brief Configs the low power mode of the on-chip flash memory. - * - * This function configs the low power mode of the on-chip flash memory. - * - * @param base CMC peripheral base address. - * @param doze true: Flash is disabled while core is sleeping - * false: No effect. - * @param disable true: Flash memory is placed in low power state. - * false: No effect. - */ -void CMC_ConfigFlashMode(CMC_Type *base, bool doze, bool disable); -#else -/*! - * @brief Configs the low power mode of the on-chip flash memory. - * - * This function configs the low power mode of the on-chip flash memory. - * - * @param base CMC peripheral base address. - * @param wake true: Flash will exit low power state during the flash memory accesses. - * false: No effect. - * @param doze true: Flash is disabled while core is sleeping - * false: No effect. - * @param disable true: Flash memory is placed in low power state. - * false: No effect. - */ -void CMC_ConfigFlashMode(CMC_Type *base, bool wake, bool doze, bool disable); -#endif /* FSL_FEATURE_MCX_CMC_HAS_NO_FLASHCR_WAKE */ -/* @} */ - -/*! - * @name Debug Configuration. - */ - -/*! - * @brief Enables/Disables debug Operation when the core sleep. - * - * This function configs what happens to debug when core sleeps. - * - * @param base CMC peripheral base address. - * @param enable Enable or disable Debug when Core is sleeping. - * true - Debug remains enabled when the core is sleeping. - * false - Debug is disabled when the core is sleeping. - */ -static inline void CMC_EnableDebugOperation(CMC_Type *base, bool enable) -{ - if (enable) - { - base->DBGCTL &= ~CMC_DBGCTL_SOD_MASK; - } - else - { - base->DBGCTL |= CMC_DBGCTL_SOD_MASK; - } -} - -/* @} */ - -/*! - * @name Low Power modes enter. - * @{ - */ -/*! - * @brief Prepares to enter low power modes. - * - * This function should be called before entering low power modes. - * - */ -void CMC_PreEnterLowPowerMode(void); - -/*! - * @brief Recovers after wake up from low power modes. - * - * This function should be called after wake up from low power modes. - * This function should be used with CMC_PreEnterLowPowerMode() - * - */ -void CMC_PostExitLowPowerMode(void); - -/*! - * @brief Configs the entry into the same low power mode for each power domains. - * - * This function provides the feature to entry into the same low power mode for each power - * domains. Before invoking this function, please ensure the selected power mode have been allowed. - * - * @param base CMC peripheral base address. - * @param lowPowerMode The low power mode to be entered. See @ref cmc_low_power_mode_t for the details. - * - */ -void CMC_GlobalEnterLowPowerMode(CMC_Type *base, cmc_low_power_mode_t lowPowerMode); - -/*! - * @brief Configs the entry into different low power modes for each power domains. - * - * This function provides the feature to entry into different low power modes for - * each power domains. Before invoking this function please ensure the selected - * modes are allowed. - * - * @param base CMC peripheral base address. - * @param config Pointer to the cmc_power_domain_config_t structure. - */ -void CMC_EnterLowPowerMode(CMC_Type *base, const cmc_power_domain_config_t *config); - -/* @} */ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @}*/ -#endif /* FSL_CMC_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_common.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_common.c deleted file mode 100644 index d3af9fdfc67..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_common.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_common.h" - -#define SDK_MEM_MAGIC_NUMBER 12345U - -typedef struct _mem_align_control_block -{ - uint16_t identifier; /*!< Identifier for the memory control block. */ - uint16_t offset; /*!< offset from aligned address to real address */ -} mem_align_cb_t; - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.common" -#endif - -#if !((defined(__DSC__) && defined(__CW__))) -void *SDK_Malloc(size_t size, size_t alignbytes) -{ - mem_align_cb_t *p_cb = NULL; - uint32_t alignedsize; - - /* Check overflow. */ - alignedsize = (uint32_t)(unsigned int)SDK_SIZEALIGN(size, alignbytes); - if (alignedsize < size) - { - return NULL; - } - - if (alignedsize > SIZE_MAX - alignbytes - sizeof(mem_align_cb_t)) - { - return NULL; - } - - alignedsize += alignbytes + (uint32_t)sizeof(mem_align_cb_t); - - union - { - void *pointer_value; - uintptr_t unsigned_value; - } p_align_addr, p_addr; - - p_addr.pointer_value = malloc((size_t)alignedsize); - - if (p_addr.pointer_value == NULL) - { - return NULL; - } - - p_align_addr.unsigned_value = SDK_SIZEALIGN(p_addr.unsigned_value + sizeof(mem_align_cb_t), alignbytes); - - p_cb = (mem_align_cb_t *)(p_align_addr.unsigned_value - 4U); - p_cb->identifier = SDK_MEM_MAGIC_NUMBER; - p_cb->offset = (uint16_t)(p_align_addr.unsigned_value - p_addr.unsigned_value); - - return p_align_addr.pointer_value; -} - -void SDK_Free(void *ptr) -{ - union - { - void *pointer_value; - uintptr_t unsigned_value; - } p_free; - p_free.pointer_value = ptr; - mem_align_cb_t *p_cb = (mem_align_cb_t *)(p_free.unsigned_value - 4U); - - if (p_cb->identifier != SDK_MEM_MAGIC_NUMBER) - { - return; - } - - p_free.unsigned_value = p_free.unsigned_value - p_cb->offset; - - free(p_free.pointer_value); -} -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_common.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_common.h deleted file mode 100644 index e6d5cce7190..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_common.h +++ /dev/null @@ -1,345 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_COMMON_H_ -#define FSL_COMMON_H_ - -#include -#include -#include -#include -#include - -#if defined(__ICCARM__) || (defined(__CC_ARM) || defined(__ARMCC_VERSION)) || defined(__GNUC__) -#include -#endif - -#include "fsl_device_registers.h" - -/*! - * @addtogroup ksdk_common - * @{ - */ - -/******************************************************************************* - * Configurations - ******************************************************************************/ - -/*! @brief Macro to use the default weak IRQ handler in drivers. */ -#ifndef FSL_DRIVER_TRANSFER_DOUBLE_WEAK_IRQ -#define FSL_DRIVER_TRANSFER_DOUBLE_WEAK_IRQ 1 -#endif - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @brief Construct a status code value from a group and code number. */ -#define MAKE_STATUS(group, code) ((((group)*100L) + (code))) - -/*! @brief Construct the version number for drivers. - * - * The driver version is a 32-bit number, for both 32-bit platforms(such as Cortex M) - * and 16-bit platforms(such as DSC). - * - * @verbatim - - | Unused || Major Version || Minor Version || Bug Fix | - 31 25 24 17 16 9 8 0 - - @endverbatim - */ -#define MAKE_VERSION(major, minor, bugfix) (((major)*65536L) + ((minor)*256L) + (bugfix)) - -/*! @name Driver version */ -/*! @{ */ -/*! @brief common driver version. */ -#define FSL_COMMON_DRIVER_VERSION (MAKE_VERSION(2, 4, 1)) -/*! @} */ - -/*! @name Debug console type definition. */ -/*! @{ */ -#define DEBUG_CONSOLE_DEVICE_TYPE_NONE 0U /*!< No debug console. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_UART 1U /*!< Debug console based on UART. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_LPUART 2U /*!< Debug console based on LPUART. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_LPSCI 3U /*!< Debug console based on LPSCI. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_USBCDC 4U /*!< Debug console based on USBCDC. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_FLEXCOMM 5U /*!< Debug console based on FLEXCOMM. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_IUART 6U /*!< Debug console based on i.MX UART. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_VUSART 7U /*!< Debug console based on LPC_VUSART. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_MINI_USART 8U /*!< Debug console based on LPC_USART. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_SWO 9U /*!< Debug console based on SWO. */ -#define DEBUG_CONSOLE_DEVICE_TYPE_QSCI 10U /*!< Debug console based on QSCI. */ -/*! @} */ - -/*! @brief Status group numbers. */ -enum _status_groups -{ - kStatusGroup_Generic = 0, /*!< Group number for generic status codes. */ - kStatusGroup_FLASH = 1, /*!< Group number for FLASH status codes. */ - kStatusGroup_LPSPI = 4, /*!< Group number for LPSPI status codes. */ - kStatusGroup_FLEXIO_SPI = 5, /*!< Group number for FLEXIO SPI status codes. */ - kStatusGroup_DSPI = 6, /*!< Group number for DSPI status codes. */ - kStatusGroup_FLEXIO_UART = 7, /*!< Group number for FLEXIO UART status codes. */ - kStatusGroup_FLEXIO_I2C = 8, /*!< Group number for FLEXIO I2C status codes. */ - kStatusGroup_LPI2C = 9, /*!< Group number for LPI2C status codes. */ - kStatusGroup_UART = 10, /*!< Group number for UART status codes. */ - kStatusGroup_I2C = 11, /*!< Group number for UART status codes. */ - kStatusGroup_LPSCI = 12, /*!< Group number for LPSCI status codes. */ - kStatusGroup_LPUART = 13, /*!< Group number for LPUART status codes. */ - kStatusGroup_SPI = 14, /*!< Group number for SPI status code.*/ - kStatusGroup_XRDC = 15, /*!< Group number for XRDC status code.*/ - kStatusGroup_SEMA42 = 16, /*!< Group number for SEMA42 status code.*/ - kStatusGroup_SDHC = 17, /*!< Group number for SDHC status code */ - kStatusGroup_SDMMC = 18, /*!< Group number for SDMMC status code */ - kStatusGroup_SAI = 19, /*!< Group number for SAI status code */ - kStatusGroup_MCG = 20, /*!< Group number for MCG status codes. */ - kStatusGroup_SCG = 21, /*!< Group number for SCG status codes. */ - kStatusGroup_SDSPI = 22, /*!< Group number for SDSPI status codes. */ - kStatusGroup_FLEXIO_I2S = 23, /*!< Group number for FLEXIO I2S status codes */ - kStatusGroup_FLEXIO_MCULCD = 24, /*!< Group number for FLEXIO LCD status codes */ - kStatusGroup_FLASHIAP = 25, /*!< Group number for FLASHIAP status codes */ - kStatusGroup_FLEXCOMM_I2C = 26, /*!< Group number for FLEXCOMM I2C status codes */ - kStatusGroup_I2S = 27, /*!< Group number for I2S status codes */ - kStatusGroup_IUART = 28, /*!< Group number for IUART status codes */ - kStatusGroup_CSI = 29, /*!< Group number for CSI status codes */ - kStatusGroup_MIPI_DSI = 30, /*!< Group number for MIPI DSI status codes */ - kStatusGroup_SDRAMC = 35, /*!< Group number for SDRAMC status codes. */ - kStatusGroup_POWER = 39, /*!< Group number for POWER status codes. */ - kStatusGroup_ENET = 40, /*!< Group number for ENET status codes. */ - kStatusGroup_PHY = 41, /*!< Group number for PHY status codes. */ - kStatusGroup_TRGMUX = 42, /*!< Group number for TRGMUX status codes. */ - kStatusGroup_SMARTCARD = 43, /*!< Group number for SMARTCARD status codes. */ - kStatusGroup_LMEM = 44, /*!< Group number for LMEM status codes. */ - kStatusGroup_QSPI = 45, /*!< Group number for QSPI status codes. */ - kStatusGroup_DMA = 50, /*!< Group number for DMA status codes. */ - kStatusGroup_EDMA = 51, /*!< Group number for EDMA status codes. */ - kStatusGroup_DMAMGR = 52, /*!< Group number for DMAMGR status codes. */ - kStatusGroup_FLEXCAN = 53, /*!< Group number for FlexCAN status codes. */ - kStatusGroup_LTC = 54, /*!< Group number for LTC status codes. */ - kStatusGroup_FLEXIO_CAMERA = 55, /*!< Group number for FLEXIO CAMERA status codes. */ - kStatusGroup_LPC_SPI = 56, /*!< Group number for LPC_SPI status codes. */ - kStatusGroup_LPC_USART = 57, /*!< Group number for LPC_USART status codes. */ - kStatusGroup_DMIC = 58, /*!< Group number for DMIC status codes. */ - kStatusGroup_SDIF = 59, /*!< Group number for SDIF status codes.*/ - kStatusGroup_SPIFI = 60, /*!< Group number for SPIFI status codes. */ - kStatusGroup_OTP = 61, /*!< Group number for OTP status codes. */ - kStatusGroup_MCAN = 62, /*!< Group number for MCAN status codes. */ - kStatusGroup_CAAM = 63, /*!< Group number for CAAM status codes. */ - kStatusGroup_ECSPI = 64, /*!< Group number for ECSPI status codes. */ - kStatusGroup_USDHC = 65, /*!< Group number for USDHC status codes.*/ - kStatusGroup_LPC_I2C = 66, /*!< Group number for LPC_I2C status codes.*/ - kStatusGroup_DCP = 67, /*!< Group number for DCP status codes.*/ - kStatusGroup_MSCAN = 68, /*!< Group number for MSCAN status codes.*/ - kStatusGroup_ESAI = 69, /*!< Group number for ESAI status codes. */ - kStatusGroup_FLEXSPI = 70, /*!< Group number for FLEXSPI status codes. */ - kStatusGroup_MMDC = 71, /*!< Group number for MMDC status codes. */ - kStatusGroup_PDM = 72, /*!< Group number for MIC status codes. */ - kStatusGroup_SDMA = 73, /*!< Group number for SDMA status codes. */ - kStatusGroup_ICS = 74, /*!< Group number for ICS status codes. */ - kStatusGroup_SPDIF = 75, /*!< Group number for SPDIF status codes. */ - kStatusGroup_LPC_MINISPI = 76, /*!< Group number for LPC_MINISPI status codes. */ - kStatusGroup_HASHCRYPT = 77, /*!< Group number for Hashcrypt status codes */ - kStatusGroup_LPC_SPI_SSP = 78, /*!< Group number for LPC_SPI_SSP status codes. */ - kStatusGroup_I3C = 79, /*!< Group number for I3C status codes */ - kStatusGroup_LPC_I2C_1 = 97, /*!< Group number for LPC_I2C_1 status codes. */ - kStatusGroup_NOTIFIER = 98, /*!< Group number for NOTIFIER status codes. */ - kStatusGroup_DebugConsole = 99, /*!< Group number for debug console status codes. */ - kStatusGroup_SEMC = 100, /*!< Group number for SEMC status codes. */ - kStatusGroup_ApplicationRangeStart = 101, /*!< Starting number for application groups. */ - kStatusGroup_IAP = 102, /*!< Group number for IAP status codes */ - kStatusGroup_SFA = 103, /*!< Group number for SFA status codes*/ - kStatusGroup_SPC = 104, /*!< Group number for SPC status codes. */ - kStatusGroup_PUF = 105, /*!< Group number for PUF status codes. */ - kStatusGroup_TOUCH_PANEL = 106, /*!< Group number for touch panel status codes */ - kStatusGroup_VBAT = 107, /*!< Group number for VBAT status codes */ - kStatusGroup_XSPI = 108, /*!< Group number for XSPI status codes */ - kStatusGroup_PNGDEC = 109, /*!< Group number for PNGDEC status codes */ - kStatusGroup_JPEGDEC = 110, /*!< Group number for JPEGDEC status codes */ - - kStatusGroup_HAL_GPIO = 121, /*!< Group number for HAL GPIO status codes. */ - kStatusGroup_HAL_UART = 122, /*!< Group number for HAL UART status codes. */ - kStatusGroup_HAL_TIMER = 123, /*!< Group number for HAL TIMER status codes. */ - kStatusGroup_HAL_SPI = 124, /*!< Group number for HAL SPI status codes. */ - kStatusGroup_HAL_I2C = 125, /*!< Group number for HAL I2C status codes. */ - kStatusGroup_HAL_FLASH = 126, /*!< Group number for HAL FLASH status codes. */ - kStatusGroup_HAL_PWM = 127, /*!< Group number for HAL PWM status codes. */ - kStatusGroup_HAL_RNG = 128, /*!< Group number for HAL RNG status codes. */ - kStatusGroup_HAL_I2S = 129, /*!< Group number for HAL I2S status codes. */ - kStatusGroup_HAL_ADC_SENSOR = 130, /*!< Group number for HAL ADC SENSOR status codes. */ - kStatusGroup_TIMERMANAGER = 135, /*!< Group number for TiMER MANAGER status codes. */ - kStatusGroup_SERIALMANAGER = 136, /*!< Group number for SERIAL MANAGER status codes. */ - kStatusGroup_LED = 137, /*!< Group number for LED status codes. */ - kStatusGroup_BUTTON = 138, /*!< Group number for BUTTON status codes. */ - kStatusGroup_EXTERN_EEPROM = 139, /*!< Group number for EXTERN EEPROM status codes. */ - kStatusGroup_SHELL = 140, /*!< Group number for SHELL status codes. */ - kStatusGroup_MEM_MANAGER = 141, /*!< Group number for MEM MANAGER status codes. */ - kStatusGroup_LIST = 142, /*!< Group number for List status codes. */ - kStatusGroup_OSA = 143, /*!< Group number for OSA status codes. */ - kStatusGroup_COMMON_TASK = 144, /*!< Group number for Common task status codes. */ - kStatusGroup_MSG = 145, /*!< Group number for messaging status codes. */ - kStatusGroup_SDK_OCOTP = 146, /*!< Group number for OCOTP status codes. */ - kStatusGroup_SDK_FLEXSPINOR = 147, /*!< Group number for FLEXSPINOR status codes.*/ - kStatusGroup_CODEC = 148, /*!< Group number for codec status codes. */ - kStatusGroup_ASRC = 149, /*!< Group number for codec status ASRC. */ - kStatusGroup_OTFAD = 150, /*!< Group number for codec status codes. */ - kStatusGroup_SDIOSLV = 151, /*!< Group number for SDIOSLV status codes. */ - kStatusGroup_MECC = 152, /*!< Group number for MECC status codes. */ - kStatusGroup_ENET_QOS = 153, /*!< Group number for ENET_QOS status codes. */ - kStatusGroup_LOG = 154, /*!< Group number for LOG status codes. */ - kStatusGroup_I3CBUS = 155, /*!< Group number for I3CBUS status codes. */ - kStatusGroup_QSCI = 156, /*!< Group number for QSCI status codes. */ - kStatusGroup_ELEMU = 157, /*!< Group number for ELEMU status codes. */ - kStatusGroup_QUEUEDSPI = 158, /*!< Group number for QSPI status codes. */ - kStatusGroup_POWER_MANAGER = 159, /*!< Group number for POWER_MANAGER status codes. */ - kStatusGroup_IPED = 160, /*!< Group number for IPED status codes. */ - kStatusGroup_ELS_PKC = 161, /*!< Group number for ELS PKC status codes. */ - kStatusGroup_CSS_PKC = 162, /*!< Group number for CSS PKC status codes. */ - kStatusGroup_HOSTIF = 163, /*!< Group number for HOSTIF status codes. */ - kStatusGroup_CLIF = 164, /*!< Group number for CLIF status codes. */ - kStatusGroup_BMA = 165, /*!< Group number for BMA status codes. */ - kStatusGroup_NETC = 166, /*!< Group number for NETC status codes. */ - kStatusGroup_ELE = 167, /*!< Group number for ELE status codes. */ - kStatusGroup_GLIKEY = 168, /*!< Group number for GLIKEY status codes. */ -}; - -/*! \public - * @brief Generic status return codes. - */ -enum -{ - kStatus_Success = MAKE_STATUS(kStatusGroup_Generic, 0), /*!< Generic status for Success. */ - kStatus_Fail = MAKE_STATUS(kStatusGroup_Generic, 1), /*!< Generic status for Fail. */ - kStatus_ReadOnly = MAKE_STATUS(kStatusGroup_Generic, 2), /*!< Generic status for read only failure. */ - kStatus_OutOfRange = MAKE_STATUS(kStatusGroup_Generic, 3), /*!< Generic status for out of range access. */ - kStatus_InvalidArgument = MAKE_STATUS(kStatusGroup_Generic, 4), /*!< Generic status for invalid argument check. */ - kStatus_Timeout = MAKE_STATUS(kStatusGroup_Generic, 5), /*!< Generic status for timeout. */ - kStatus_NoTransferInProgress = - MAKE_STATUS(kStatusGroup_Generic, 6), /*!< Generic status for no transfer in progress. */ - kStatus_Busy = MAKE_STATUS(kStatusGroup_Generic, 7), /*!< Generic status for module is busy. */ - kStatus_NoData = - MAKE_STATUS(kStatusGroup_Generic, 8), /*!< Generic status for no data is found for the operation. */ -}; - -/*! @brief Type used for all status and error return values. */ -typedef int32_t status_t; - -#ifdef __ZEPHYR__ -#include -#else -/*! - * @name Min/max macros - * @{ - */ -#if !defined(MIN) -/*! Computes the minimum of \a a and \a b. */ -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - -#if !defined(MAX) -/*! Computes the maximum of \a a and \a b. */ -#define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif -/*! @} */ - -/*! @brief Computes the number of elements in an array. */ -#if !defined(ARRAY_SIZE) -#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) -#endif -#endif /* __ZEPHYR__ */ - -/*! @name UINT16_MAX/UINT32_MAX value */ -/*! @{ */ -#if !defined(UINT16_MAX) -/*! Max value of uint16_t type. */ -#define UINT16_MAX ((uint16_t)-1) -#endif - -#if !defined(UINT32_MAX) -/*! Max value of uint32_t type. */ -#define UINT32_MAX ((uint32_t)-1) -#endif -/*! @} */ - -/*! Macro to get upper 32 bits of a 64-bit value */ -#if !defined(UINT64_H) -#define UINT64_H(X) ((uint32_t)((((uint64_t) (X)) >> 32U) & 0x0FFFFFFFFULL)) -#endif - -/*! Macro to get lower 32 bits of a 64-bit value */ -#if !defined(UINT64_L) -#define UINT64_L(X) ((uint32_t)(((uint64_t) (X)) & 0x0FFFFFFFFULL)) -#endif - -/*! - * @def SUPPRESS_FALL_THROUGH_WARNING() - * - * For switch case code block, if case section ends without "break;" statement, there wil be - * fallthrough warning with compiler flag -Wextra or -Wimplicit-fallthrough=n when using armgcc. - * To suppress this warning, "SUPPRESS_FALL_THROUGH_WARNING();" need to be added at the end of each - * case section which misses "break;"statement. - */ -#if defined(__GNUC__) && !defined(__ARMCC_VERSION) -#define SUPPRESS_FALL_THROUGH_WARNING() __attribute__((fallthrough)) -#else -#define SUPPRESS_FALL_THROUGH_WARNING() -#endif - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -#if !((defined(__DSC__) && defined(__CW__))) -/*! - * @brief Allocate memory with given alignment and aligned size. - * - * This is provided to support the dynamically allocated memory - * used in cache-able region. - * @param size The length required to malloc. - * @param alignbytes The alignment size. - * @retval The allocated memory. - */ -void *SDK_Malloc(size_t size, size_t alignbytes); - -/*! - * @brief Free memory. - * - * @param ptr The memory to be release. - */ -void SDK_Free(void *ptr); -#endif - -/*! - * @brief Delay at least for some time. - * Please note that, this API uses while loop for delay, different run-time environments make the time not precise, - * if precise delay count was needed, please implement a new delay function with hardware timer. - * - * @param delayTime_us Delay time in unit of microsecond. - * @param coreClock_Hz Core clock frequency with Hz. - */ -void SDK_DelayAtLeastUs(uint32_t delayTime_us, uint32_t coreClock_Hz); - -#if defined(__cplusplus) -} -#endif - -/*! @} */ - -#if (defined(__DSC__) && defined(__CW__)) -#include "fsl_common_dsc.h" -#elif defined(__XTENSA__) -#include "fsl_common_dsp.h" -#else -#include "fsl_common_arm.h" -#endif - -#endif /* FSL_COMMON_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_common_arm.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_common_arm.c deleted file mode 100644 index e9f32aadf4a..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_common_arm.c +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_common.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.common_arm" -#endif - -#ifndef __GIC_PRIO_BITS -#if defined(ENABLE_RAM_VECTOR_TABLE) -uint32_t InstallIRQHandler(IRQn_Type irq, uint32_t irqHandler) -{ -#ifdef __VECTOR_TABLE -#undef __VECTOR_TABLE -#endif - -/* Addresses for VECTOR_TABLE and VECTOR_RAM come from the linker file */ -#if defined(__CC_ARM) || defined(__ARMCC_VERSION) - extern uint32_t Image$$VECTOR_ROM$$Base[]; - extern uint32_t Image$$VECTOR_RAM$$Base[]; - extern uint32_t Image$$VECTOR_RAM$$ZI$$Limit[]; - -#define __VECTOR_TABLE Image$$VECTOR_ROM$$Base -#define __VECTOR_RAM Image$$VECTOR_RAM$$Base -#define __RAM_VECTOR_TABLE_SIZE (((uint32_t)Image$$VECTOR_RAM$$ZI$$Limit - (uint32_t)Image$$VECTOR_RAM$$Base)) -#elif defined(__ICCARM__) - extern uint32_t __RAM_VECTOR_TABLE_SIZE[]; - extern uint32_t __VECTOR_TABLE[]; - extern uint32_t __VECTOR_RAM[]; -#elif defined(__GNUC__) - extern uint32_t __VECTOR_TABLE[]; - extern uint32_t __VECTOR_RAM[]; - extern uint32_t __RAM_VECTOR_TABLE_SIZE_BYTES[]; - uint32_t __RAM_VECTOR_TABLE_SIZE = (uint32_t)(__RAM_VECTOR_TABLE_SIZE_BYTES); -#endif /* defined(__CC_ARM) || defined(__ARMCC_VERSION) */ - uint32_t n; - uint32_t ret; - uint32_t irqMaskValue; - - irqMaskValue = DisableGlobalIRQ(); - if (SCB->VTOR != (uint32_t)__VECTOR_RAM) - { - /* Copy the vector table from ROM to RAM */ - for (n = 0; n < ((uint32_t)__RAM_VECTOR_TABLE_SIZE) / sizeof(uint32_t); n++) - { - __VECTOR_RAM[n] = __VECTOR_TABLE[n]; - } - /* Point the VTOR to the position of vector table */ - SCB->VTOR = (uint32_t)__VECTOR_RAM; - } - - ret = __VECTOR_RAM[(int32_t)irq + 16]; - /* make sure the __VECTOR_RAM is noncachable */ - __VECTOR_RAM[(int32_t)irq + 16] = irqHandler; - - EnableGlobalIRQ(irqMaskValue); - - return ret; -} -#endif /* ENABLE_RAM_VECTOR_TABLE. */ -#endif /* __GIC_PRIO_BITS. */ - -#if (defined(FSL_FEATURE_SOC_SYSCON_COUNT) && (FSL_FEATURE_SOC_SYSCON_COUNT > 0)) - -/* - * When FSL_FEATURE_POWERLIB_EXTEND is defined to non-zero value, - * powerlib should be used instead of these functions. - */ -#if !(defined(FSL_FEATURE_POWERLIB_EXTEND) && (FSL_FEATURE_POWERLIB_EXTEND != 0)) - -/* - * When the SYSCON STARTER registers are discontinuous, these functions are - * implemented in fsl_power.c. - */ -#if !(defined(FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS) && FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS) - -void EnableDeepSleepIRQ(IRQn_Type interrupt) -{ - uint32_t intNumber = (uint32_t)interrupt; - - uint32_t index = 0; - - while (intNumber >= 32u) - { - index++; - intNumber -= 32u; - } - - SYSCON->STARTERSET[index] = 1UL << intNumber; - (void)EnableIRQ(interrupt); /* also enable interrupt at NVIC */ -} - -void DisableDeepSleepIRQ(IRQn_Type interrupt) -{ - uint32_t intNumber = (uint32_t)interrupt; - - (void)DisableIRQ(interrupt); /* also disable interrupt at NVIC */ - uint32_t index = 0; - - while (intNumber >= 32u) - { - index++; - intNumber -= 32u; - } - - SYSCON->STARTERCLR[index] = 1UL << intNumber; -} -#endif /* FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS */ -#endif /* FSL_FEATURE_POWERLIB_EXTEND */ -#endif /* FSL_FEATURE_SOC_SYSCON_COUNT */ - -#if defined(DWT) -/* Use WDT. */ -void MSDK_EnableCpuCycleCounter(void) -{ - /* Make sure the DWT trace fucntion is enabled. */ - if (CoreDebug_DEMCR_TRCENA_Msk != (CoreDebug_DEMCR_TRCENA_Msk & CoreDebug->DEMCR)) - { - CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; - } - - /* CYCCNT not supported on this device. */ - assert(DWT_CTRL_NOCYCCNT_Msk != (DWT->CTRL & DWT_CTRL_NOCYCCNT_Msk)); - - /* Read CYCCNT directly if CYCCENT has already been enabled, otherwise enable CYCCENT first. */ - if (DWT_CTRL_CYCCNTENA_Msk != (DWT_CTRL_CYCCNTENA_Msk & DWT->CTRL)) - { - DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk; - } -} - -uint32_t MSDK_GetCpuCycleCount(void) -{ - return DWT->CYCCNT; -} -#endif /* defined(DWT) */ - -#if !(defined(SDK_DELAY_USE_DWT) && defined(DWT)) -/* Use software loop. */ -#if defined(__CC_ARM) /* This macro is arm v5 specific */ -/* clang-format off */ -__ASM static void DelayLoop(uint32_t count) -{ -loop - SUBS R0, R0, #1 - CMP R0, #0 - BNE loop - BX LR -} -#elif defined(__ARM_ARCH_8A__) /* This macro is ARMv8-A specific */ -static void DelayLoop(uint32_t count) -{ - __ASM volatile(" MOV X0, %0" : : "r"(count)); - __ASM volatile( - "loop%=: \n" - " SUB X0, X0, #1 \n" - " CMP X0, #0 \n" - - " BNE loop%= \n" - : - : - : "r0"); -} -/* clang-format on */ -#elif defined(__ARMCC_VERSION) || defined(__ICCARM__) || defined(__GNUC__) -/* Cortex-M0 has a smaller instruction set, SUBS isn't supported in thumb-16 mode reported from __GNUC__ compiler, - * use SUB and CMP here for compatibility */ -static void DelayLoop(uint32_t count) -{ - __ASM volatile(" MOV R0, %0" : : "r"(count)); - __ASM volatile( - "loop%=: \n" -#if defined(__GNUC__) && !defined(__ARMCC_VERSION) - " SUB R0, R0, #1 \n" -#else - " SUBS R0, R0, #1 \n" -#endif - " CMP R0, #0 \n" - - " BNE loop%= \n" - : - : - : "r0"); -} -#endif /* defined(__CC_ARM) */ -#endif /* defined(SDK_DELAY_USE_DWT) && defined(DWT) */ - -/*! - * @brief Delay at least for some time. - * Please note that, if not uses DWT, this API will use while loop for delay, different run-time environments have - * effect on the delay time. If precise delay is needed, please enable DWT delay. The two parmeters delayTime_us and - * coreClock_Hz have limitation. For example, in the platform with 1GHz coreClock_Hz, the delayTime_us only supports - * up to 4294967 in current code. If long time delay is needed, please implement a new delay function. - * - * @param delayTime_us Delay time in unit of microsecond. - * @param coreClock_Hz Core clock frequency with Hz. - */ -void SDK_DelayAtLeastUs(uint32_t delayTime_us, uint32_t coreClock_Hz) -{ - uint64_t count; - - if (delayTime_us > 0U) - { - count = USEC_TO_COUNT(delayTime_us, coreClock_Hz); - - assert(count <= UINT32_MAX); - -#if defined(SDK_DELAY_USE_DWT) && defined(DWT) /* Use DWT for better accuracy */ - - MSDK_EnableCpuCycleCounter(); - /* Calculate the count ticks. */ - count += MSDK_GetCpuCycleCount(); - - if (count > UINT32_MAX) - { - count -= UINT32_MAX; - /* Wait for cyccnt overflow. */ - while (count < MSDK_GetCpuCycleCount()) - { - } - } - - /* Wait for cyccnt reach count value. */ - while (count > MSDK_GetCpuCycleCount()) - { - } -#else -#if defined(__CORTEX_Axx) && ((__CORTEX_Axx == 53) || (__CORTEX_Axx == 55)) - /* - * Cortex-A53/A55 execution throughput: - * - SUB/CMP: 2 instructions per cycle - * - BNE: 1 instruction per cycle - * So, each loop takes 2 CPU cycles. - */ - count = count / 2U; -#elif (__CORTEX_M == 7) - /* Divide value may be different in various environment to ensure delay is precise. - * Every loop count includes three instructions, due to Cortex-M7 sometimes executes - * two instructions in one period, through test here set divide 1.5. Other M cores use - * divide 4. By the way, divide 1.5 or 4 could let the count lose precision, but it does - * not matter because other instructions outside while loop is enough to fill the time. - */ - count = count / 3U * 2U; -#else - count = count / 4U; -#endif - DelayLoop((uint32_t)count); -#endif /* defined(SDK_DELAY_USE_DWT) && defined(DWT) */ - } -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_common_arm.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_common_arm.h deleted file mode 100644 index 3d35d76f812..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_common_arm.h +++ /dev/null @@ -1,898 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_COMMON_ARM_H_ -#define FSL_COMMON_ARM_H_ - -/* - * For CMSIS pack RTE. - * CMSIS pack RTE generates "RTC_Components.h" which contains the statements - * of the related element for all selected software components. - */ -#ifdef _RTE_ -#include "RTE_Components.h" -#endif - -/*! - * @addtogroup ksdk_common - * @{ - */ - -/*! @name Atomic modification - * - * These macros are used for atomic access, such as read-modify-write - * to the peripheral registers. - * - * Take @ref SDK_ATOMIC_LOCAL_CLEAR_AND_SET as an example: the parameter @c addr - * means the address of the peripheral register or variable you want to modify - * atomically, the parameter @c clearBits is the bits to clear, the parameter - * @c setBits it the bits to set. - * For example, to set a 32-bit register bit1:bit0 to 0b10, use like this: - * - * @code - volatile uint32_t * reg = (volatile uint32_t *)REG_ADDR; - - SDK_ATOMIC_LOCAL_CLEAR_AND_SET(reg, 0x03, 0x02); - @endcode - * - * In this example, the register bit1:bit0 are cleared and bit1 is set, as a result, - * register bit1:bit0 = 0b10. - * - * @note For the platforms don't support exclusive load and store, these macros - * disable the global interrupt to pretect the modification. - * - * @note These macros only guarantee the local processor atomic operations. For - * the multi-processor devices, use hardware semaphore such as SEMA42 to - * guarantee exclusive access if necessary. - * - * @{ - */ - -/*! - * @def SDK_ATOMIC_LOCAL_ADD(addr, val) - * Add value \a val from the variable at address \a address. - * - * @def SDK_ATOMIC_LOCAL_SUB(addr, val) - * Subtract value \a val to the variable at address \a address. - * - * @def SDK_ATOMIC_LOCAL_SET(addr, bits) - * Set the bits specifiled by \a bits to the variable at address \a address. - * - * @def SDK_ATOMIC_LOCAL_CLEAR(addr, bits) - * Clear the bits specifiled by \a bits to the variable at address \a address. - * - * @def SDK_ATOMIC_LOCAL_TOGGLE(addr, bits) - * Toggle the bits specifiled by \a bits to the variable at address \a address. - * - * @def SDK_ATOMIC_LOCAL_CLEAR_AND_SET(addr, clearBits, setBits) - * For the variable at address \a address, clear the bits specifiled by \a clearBits - * and set the bits specifiled by \a setBits. - */ - -/* clang-format off */ -#if ((defined(__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined(__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined(__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined(__ARM_ARCH_8M_BASE__) && (__ARM_ARCH_8M_BASE__ == 1))) -/* clang-format on */ - -/* If the LDREX and STREX are supported, use them. */ -#define _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, val, ops) \ - do \ - { \ - (val) = __LDREXB(addr); \ - (ops); \ - } while (0UL != __STREXB((val), (addr))) - -#define _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, val, ops) \ - do \ - { \ - (val) = __LDREXH(addr); \ - (ops); \ - } while (0UL != __STREXH((val), (addr))) - -#define _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, val, ops) \ - do \ - { \ - (val) = __LDREXW(addr); \ - (ops); \ - } while (0UL != __STREXW((val), (addr))) - -static inline void _SDK_AtomicLocalAdd1Byte(volatile uint8_t *addr, uint8_t val) -{ - uint8_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, s_val, s_val += val); -} - -static inline void _SDK_AtomicLocalAdd2Byte(volatile uint16_t *addr, uint16_t val) -{ - uint16_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, s_val, s_val += val); -} - -static inline void _SDK_AtomicLocalAdd4Byte(volatile uint32_t *addr, uint32_t val) -{ - uint32_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, s_val, s_val += val); -} - -static inline void _SDK_AtomicLocalSub1Byte(volatile uint8_t *addr, uint8_t val) -{ - uint8_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, s_val, s_val -= val); -} - -static inline void _SDK_AtomicLocalSub2Byte(volatile uint16_t *addr, uint16_t val) -{ - uint16_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, s_val, s_val -= val); -} - -static inline void _SDK_AtomicLocalSub4Byte(volatile uint32_t *addr, uint32_t val) -{ - uint32_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, s_val, s_val -= val); -} - -static inline void _SDK_AtomicLocalSet1Byte(volatile uint8_t *addr, uint8_t bits) -{ - uint8_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, s_val, s_val |= bits); -} - -static inline void _SDK_AtomicLocalSet2Byte(volatile uint16_t *addr, uint16_t bits) -{ - uint16_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, s_val, s_val |= bits); -} - -static inline void _SDK_AtomicLocalSet4Byte(volatile uint32_t *addr, uint32_t bits) -{ - uint32_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, s_val, s_val |= bits); -} - -static inline void _SDK_AtomicLocalClear1Byte(volatile uint8_t *addr, uint8_t bits) -{ - uint8_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, s_val, s_val &= ~bits); -} - -static inline void _SDK_AtomicLocalClear2Byte(volatile uint16_t *addr, uint16_t bits) -{ - uint16_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, s_val, s_val &= ~bits); -} - -static inline void _SDK_AtomicLocalClear4Byte(volatile uint32_t *addr, uint32_t bits) -{ - uint32_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, s_val, s_val &= ~bits); -} - -static inline void _SDK_AtomicLocalToggle1Byte(volatile uint8_t *addr, uint8_t bits) -{ - uint8_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, s_val, s_val ^= bits); -} - -static inline void _SDK_AtomicLocalToggle2Byte(volatile uint16_t *addr, uint16_t bits) -{ - uint16_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, s_val, s_val ^= bits); -} - -static inline void _SDK_AtomicLocalToggle4Byte(volatile uint32_t *addr, uint32_t bits) -{ - uint32_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, s_val, s_val ^= bits); -} - -static inline void _SDK_AtomicLocalClearAndSet1Byte(volatile uint8_t *addr, uint8_t clearBits, uint8_t setBits) -{ - uint8_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_1BYTE(addr, s_val, s_val = (s_val & ~clearBits) | setBits); -} - -static inline void _SDK_AtomicLocalClearAndSet2Byte(volatile uint16_t *addr, uint16_t clearBits, uint16_t setBits) -{ - uint16_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_2BYTE(addr, s_val, s_val = (s_val & ~clearBits) | setBits); -} - -static inline void _SDK_AtomicLocalClearAndSet4Byte(volatile uint32_t *addr, uint32_t clearBits, uint32_t setBits) -{ - uint32_t s_val; - - _SDK_ATOMIC_LOCAL_OPS_4BYTE(addr, s_val, s_val = (s_val & ~clearBits) | setBits); -} - -#define SDK_ATOMIC_LOCAL_ADD(addr, val) \ - ((1UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalAdd1Byte((volatile uint8_t *)(volatile void *)(addr), (uint8_t)(val)) : \ - ((2UL == sizeof(*(addr))) ? _SDK_AtomicLocalAdd2Byte((volatile uint16_t *)(volatile void *)(addr), (uint16_t)(val)) : \ - _SDK_AtomicLocalAdd4Byte((volatile uint32_t *)(volatile void *)(addr), (uint32_t)(val)))) - -#define SDK_ATOMIC_LOCAL_SUB(addr, val) \ - ((1UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalSub1Byte((volatile uint8_t *)(volatile void *)(addr), (uint8_t)(val)) : \ - ((2UL == sizeof(*(addr))) ? _SDK_AtomicLocalSub2Byte((volatile uint16_t *)(volatile void *)(addr), (uint16_t)(val)) : \ - _SDK_AtomicLocalSub4Byte((volatile uint32_t *)(volatile void *)(addr), (uint32_t)(val)))) - -#define SDK_ATOMIC_LOCAL_SET(addr, bits) \ - ((1UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalSet1Byte((volatile uint8_t *)(volatile void *)(addr), (uint8_t)(bits)) : \ - ((2UL == sizeof(*(addr))) ? _SDK_AtomicLocalSet2Byte((volatile uint16_t *)(volatile void *)(addr), (uint16_t)(bits)) : \ - _SDK_AtomicLocalSet4Byte((volatile uint32_t *)(volatile void *)(addr), (uint32_t)(bits)))) - -#define SDK_ATOMIC_LOCAL_CLEAR(addr, bits) \ - ((1UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalClear1Byte((volatile uint8_t *)(volatile void *)(addr), (uint8_t)(bits)) : \ - ((2UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalClear2Byte((volatile uint16_t *)(volatile void *)(addr), (uint16_t)(bits)) : \ - _SDK_AtomicLocalClear4Byte((volatile uint32_t *)(volatile void *)(addr), (uint32_t)(bits)))) - -#define SDK_ATOMIC_LOCAL_TOGGLE(addr, bits) \ - ((1UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalToggle1Byte((volatile uint8_t *)(volatile void *)(addr), (uint8_t)(bits)) : \ - ((2UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalToggle2Byte((volatile uint16_t *)(volatile void *)(addr), (uint16_t)(bits)) : \ - _SDK_AtomicLocalToggle4Byte((volatile uint32_t *)(volatile void *)(addr), (uint32_t)(bits)))) - -#define SDK_ATOMIC_LOCAL_CLEAR_AND_SET(addr, clearBits, setBits) \ - ((1UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalClearAndSet1Byte((volatile uint8_t *)(volatile void *)(addr), (uint8_t)(clearBits), (uint8_t)(setBits)) : \ - ((2UL == sizeof(*(addr))) ? \ - _SDK_AtomicLocalClearAndSet2Byte((volatile uint16_t *)(volatile void *)(addr), (uint16_t)(clearBits), (uint16_t)(setBits)) : \ - _SDK_AtomicLocalClearAndSet4Byte((volatile uint32_t *)(volatile void *)(addr), (uint32_t)(clearBits), (uint32_t)(setBits)))) -#else - -#define SDK_ATOMIC_LOCAL_ADD(addr, val) \ - do \ - { \ - uint32_t s_atomicOldInt; \ - s_atomicOldInt = DisableGlobalIRQ(); \ - *(addr) += (val); \ - EnableGlobalIRQ(s_atomicOldInt); \ - } while (false) - -#define SDK_ATOMIC_LOCAL_SUB(addr, val) \ - do \ - { \ - uint32_t s_atomicOldInt; \ - s_atomicOldInt = DisableGlobalIRQ(); \ - *(addr) -= (val); \ - EnableGlobalIRQ(s_atomicOldInt); \ - } while (false) - -#define SDK_ATOMIC_LOCAL_SET(addr, bits) \ - do \ - { \ - uint32_t s_atomicOldInt; \ - s_atomicOldInt = DisableGlobalIRQ(); \ - *(addr) |= (bits); \ - EnableGlobalIRQ(s_atomicOldInt); \ - } while (false) - -#define SDK_ATOMIC_LOCAL_CLEAR(addr, bits) \ - do \ - { \ - uint32_t s_atomicOldInt; \ - s_atomicOldInt = DisableGlobalIRQ(); \ - *(addr) &= ~(bits); \ - EnableGlobalIRQ(s_atomicOldInt); \ - } while (false) - -#define SDK_ATOMIC_LOCAL_TOGGLE(addr, bits) \ - do \ - { \ - uint32_t s_atomicOldInt; \ - s_atomicOldInt = DisableGlobalIRQ(); \ - *(addr) ^= (bits); \ - EnableGlobalIRQ(s_atomicOldInt); \ - } while (false) - -#define SDK_ATOMIC_LOCAL_CLEAR_AND_SET(addr, clearBits, setBits) \ - do \ - { \ - uint32_t s_atomicOldInt; \ - s_atomicOldInt = DisableGlobalIRQ(); \ - *(addr) = (*(addr) & ~(clearBits)) | (setBits); \ - EnableGlobalIRQ(s_atomicOldInt); \ - } while (false) - -#endif -/*! @} */ - -/*! @name Timer utilities */ -/*! @{ */ -/*! Macro to convert a microsecond period to raw count value */ -#define USEC_TO_COUNT(us, clockFreqInHz) (uint64_t)(((uint64_t)(us) * (clockFreqInHz)) / 1000000U) -/*! Macro to convert a raw count value to microsecond */ -#define COUNT_TO_USEC(count, clockFreqInHz) (uint64_t)((uint64_t)(count)*1000000U / (clockFreqInHz)) - -/*! Macro to convert a millisecond period to raw count value */ -#define MSEC_TO_COUNT(ms, clockFreqInHz) (uint64_t)((uint64_t)(ms) * (clockFreqInHz) / 1000U) -/*! Macro to convert a raw count value to millisecond */ -#define COUNT_TO_MSEC(count, clockFreqInHz) (uint64_t)((uint64_t)(count)*1000U / (clockFreqInHz)) -/*! @} */ - -/*! @name ISR exit barrier - * @{ - * - * ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping - * exception return operation might vector to incorrect interrupt. - * For Cortex-M7, if core speed much faster than peripheral register write speed, - * the peripheral interrupt flags may be still set after exiting ISR, this results to - * the same error similar with errata 83869. - */ -#if (defined __CORTEX_M) && ((__CORTEX_M == 4U) || (__CORTEX_M == 7U)) -#define SDK_ISR_EXIT_BARRIER __DSB() -#else -#define SDK_ISR_EXIT_BARRIER -#endif - -/*! @} */ - -/*! @name Alignment variable definition macros */ -/*! @{ */ -#if (defined(__ICCARM__)) -/* - * Workaround to disable MISRA C message suppress warnings for IAR compiler. - * http:/ /supp.iar.com/Support/?note=24725 - */ -_Pragma("diag_suppress=Pm120") -#define SDK_PRAGMA(x) _Pragma(#x) - _Pragma("diag_error=Pm120") -/*! Macro to define a variable with alignbytes alignment */ -#define SDK_ALIGN(var, alignbytes) SDK_PRAGMA(data_alignment = alignbytes) var -#elif defined(__CC_ARM) || defined(__ARMCC_VERSION) -/*! Macro to define a variable with alignbytes alignment */ -#define SDK_ALIGN(var, alignbytes) __attribute__((aligned(alignbytes))) var -#elif defined(__GNUC__) || defined(DOXYGEN_OUTPUT) -/*! Macro to define a variable with alignbytes alignment */ -#define SDK_ALIGN(var, alignbytes) var __attribute__((aligned(alignbytes))) -#else -#error Toolchain not supported -#endif - -/*! Macro to define a variable with L1 d-cache line size alignment */ -#if defined(FSL_FEATURE_L1DCACHE_LINESIZE_BYTE) -#define SDK_L1DCACHE_ALIGN(var) SDK_ALIGN(var, FSL_FEATURE_L1DCACHE_LINESIZE_BYTE) -#endif -/*! Macro to define a variable with L2 cache line size alignment */ -#if defined(FSL_FEATURE_L2CACHE_LINESIZE_BYTE) -#define SDK_L2CACHE_ALIGN(var) SDK_ALIGN(var, FSL_FEATURE_L2CACHE_LINESIZE_BYTE) -#endif - -/*! Macro to change a value to a given size aligned value */ -#define SDK_SIZEALIGN(var, alignbytes) \ - ((unsigned int)((var) + ((alignbytes)-1U)) & (unsigned int)(~(unsigned int)((alignbytes)-1U))) -/*! @} */ - -/*! - * @name Non-cacheable region definition macros - * - * For initialized non-zero non-cacheable variables, please use "AT_NONCACHEABLE_SECTION_INIT(var) ={xx};" or - * "AT_NONCACHEABLE_SECTION_ALIGN_INIT(var) ={xx};" in your projects to define them. For zero-inited non-cacheable - * variables, please use "AT_NONCACHEABLE_SECTION(var);" or "AT_NONCACHEABLE_SECTION_ALIGN(var);" to define them, - * these zero-inited variables will be initialized to zero in system startup. - * - * @note For GCC, when the non-cacheable section is required, please define "__STARTUP_INITIALIZE_NONCACHEDATA" - * in your projects to make sure the non-cacheable section variables will be initialized in system startup. - * - * @{ - */ - -/*! - * @def AT_NONCACHEABLE_SECTION(var) - * Define a variable \a var, and place it in non-cacheable section. - * - * @def AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) - * Define a variable \a var, and place it in non-cacheable section, the start address - * of the variable is aligned to \a alignbytes. - * - * @def AT_NONCACHEABLE_SECTION_INIT(var) - * Define a variable \a var with initial value, and place it in non-cacheable section. - * - * @def AT_NONCACHEABLE_SECTION_ALIGN_INIT(var, alignbytes) - * Define a variable \a var with initial value, and place it in non-cacheable section, - * the start address of the variable is aligned to \a alignbytes. - */ - -#if ((!(defined(FSL_FEATURE_HAS_NO_NONCACHEABLE_SECTION) && FSL_FEATURE_HAS_NO_NONCACHEABLE_SECTION)) && \ - defined(FSL_FEATURE_L1ICACHE_LINESIZE_BYTE)) - -#if (defined(__ICCARM__)) -#define AT_NONCACHEABLE_SECTION(var) var @"NonCacheable" -#define AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) SDK_PRAGMA(data_alignment = alignbytes) var @"NonCacheable" -#define AT_NONCACHEABLE_SECTION_INIT(var) var @"NonCacheable.init" -#define AT_NONCACHEABLE_SECTION_ALIGN_INIT(var, alignbytes) \ - SDK_PRAGMA(data_alignment = alignbytes) var @"NonCacheable.init" - -#elif (defined(__CC_ARM) || defined(__ARMCC_VERSION)) -#define AT_NONCACHEABLE_SECTION_INIT(var) __attribute__((section("NonCacheable.init"))) var -#define AT_NONCACHEABLE_SECTION_ALIGN_INIT(var, alignbytes) \ - __attribute__((section("NonCacheable.init"))) __attribute__((aligned(alignbytes))) var -#if (defined(__CC_ARM)) -#define AT_NONCACHEABLE_SECTION(var) __attribute__((section("NonCacheable"), zero_init)) var -#define AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) \ - __attribute__((section("NonCacheable"), zero_init)) __attribute__((aligned(alignbytes))) var -#else -#define AT_NONCACHEABLE_SECTION(var) __attribute__((section(".bss.NonCacheable"))) var -#define AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) \ - __attribute__((section(".bss.NonCacheable"))) __attribute__((aligned(alignbytes))) var -#endif - -#elif (defined(__GNUC__)) || defined(DOXYGEN_OUTPUT) -/* For GCC, when the non-cacheable section is required, please define "__STARTUP_INITIALIZE_NONCACHEDATA" - * in your projects to make sure the non-cacheable section variables will be initialized in system startup. - */ -#define AT_NONCACHEABLE_SECTION_INIT(var) __attribute__((section("NonCacheable.init"))) var -#define AT_NONCACHEABLE_SECTION_ALIGN_INIT(var, alignbytes) \ - __attribute__((section("NonCacheable.init"))) var __attribute__((aligned(alignbytes))) -#define AT_NONCACHEABLE_SECTION(var) __attribute__((section("NonCacheable,\"aw\",%nobits @"))) var -#define AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) \ - __attribute__((section("NonCacheable,\"aw\",%nobits @"))) var __attribute__((aligned(alignbytes))) -#else -#error Toolchain not supported. -#endif - -#else - -#define AT_NONCACHEABLE_SECTION(var) var -#define AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) SDK_ALIGN(var, alignbytes) -#define AT_NONCACHEABLE_SECTION_INIT(var) var -#define AT_NONCACHEABLE_SECTION_ALIGN_INIT(var, alignbytes) SDK_ALIGN(var, alignbytes) - -#endif - -/*! @} */ - -/*! - * @name Time sensitive region - * @{ - */ - -/*! - * @def AT_QUICKACCESS_SECTION_CODE(func) - * Place function in a section which can be accessed quickly by core. - * - * @def AT_QUICKACCESS_SECTION_DATA(var) - * Place data in a section which can be accessed quickly by core. - * - * @def AT_QUICKACCESS_SECTION_DATA_ALIGN(var, alignbytes) - * Place data in a section which can be accessed quickly by core, and the variable - * address is set to align with \a alignbytes. - */ -#if (defined(__ICCARM__)) -#define AT_QUICKACCESS_SECTION_CODE(func) func @"CodeQuickAccess" -#define AT_QUICKACCESS_SECTION_DATA(var) var @"DataQuickAccess" -#define AT_QUICKACCESS_SECTION_DATA_ALIGN(var, alignbytes) \ - SDK_PRAGMA(data_alignment = alignbytes) var @"DataQuickAccess" -#elif (defined(__CC_ARM) || defined(__ARMCC_VERSION)) -#define AT_QUICKACCESS_SECTION_CODE(func) __attribute__((section("CodeQuickAccess"), __noinline__)) func -#define AT_QUICKACCESS_SECTION_DATA(var) __attribute__((section("DataQuickAccess"))) var -#define AT_QUICKACCESS_SECTION_DATA_ALIGN(var, alignbytes) \ - __attribute__((section("DataQuickAccess"))) __attribute__((aligned(alignbytes))) var -#elif (defined(__GNUC__)) || defined(DOXYGEN_OUTPUT) -#define AT_QUICKACCESS_SECTION_CODE(func) __attribute__((section("CodeQuickAccess"), __noinline__)) func -#define AT_QUICKACCESS_SECTION_DATA(var) __attribute__((section("DataQuickAccess"))) var -#define AT_QUICKACCESS_SECTION_DATA_ALIGN(var, alignbytes) \ - __attribute__((section("DataQuickAccess"))) var __attribute__((aligned(alignbytes))) -#else -#error Toolchain not supported. -#endif /* defined(__ICCARM__) */ -/*! @} */ - -/*! - * @name Ram Function - * @{ - * - * @def RAMFUNCTION_SECTION_CODE(func) - * Place function in ram. - */ -#if (defined(__ICCARM__)) -#define RAMFUNCTION_SECTION_CODE(func) func @"RamFunction" -#elif (defined(__CC_ARM) || defined(__ARMCC_VERSION)) -#define RAMFUNCTION_SECTION_CODE(func) __attribute__((section("RamFunction"))) func -#elif (defined(__GNUC__)) || defined(DOXYGEN_OUTPUT) -#define RAMFUNCTION_SECTION_CODE(func) __attribute__((section("RamFunction"))) func -#else -#error Toolchain not supported. -#endif /* defined(__ICCARM__) */ -/*! @} */ - -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - void DefaultISR(void); -#endif - -/* - * The fsl_clock.h is included here because it needs MAKE_VERSION/MAKE_STATUS/status_t - * defined in previous of this file. - */ -#include "fsl_clock.h" - -/* - * Chip level peripheral reset API, for MCUs that implement peripheral reset control external to a peripheral - */ -#if ((defined(FSL_FEATURE_SOC_SYSCON_COUNT) && (FSL_FEATURE_SOC_SYSCON_COUNT > 0)) || \ - (defined(FSL_FEATURE_SOC_ASYNC_SYSCON_COUNT) && (FSL_FEATURE_SOC_ASYNC_SYSCON_COUNT > 0))) -#include "fsl_reset.h" -#endif - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus*/ - -/*! - * @brief Enable specific interrupt. - * - * Enable LEVEL1 interrupt. For some devices, there might be multiple interrupt - * levels. For example, there are NVIC and intmux. Here the interrupts connected - * to NVIC are the LEVEL1 interrupts, because they are routed to the core directly. - * The interrupts connected to intmux are the LEVEL2 interrupts, they are routed - * to NVIC first then routed to core. - * - * This function only enables the LEVEL1 interrupts. The number of LEVEL1 interrupts - * is indicated by the feature macro FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS. - * - * @param interrupt The IRQ number. - * @retval kStatus_Success Interrupt enabled successfully - * @retval kStatus_Fail Failed to enable the interrupt - */ -static inline status_t EnableIRQ(IRQn_Type interrupt) -{ - status_t status = kStatus_Success; - - if (NotAvail_IRQn == interrupt) - { - status = kStatus_Fail; - } - -#if defined(FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) && (FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS > 0) - else if ((int32_t)interrupt >= (int32_t)FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) - { - status = kStatus_Fail; - } -#endif - - else - { -#if defined(__GIC_PRIO_BITS) - GIC_EnableIRQ(interrupt); -#else - NVIC_EnableIRQ(interrupt); -#endif - } - - return status; -} - -/*! - * @brief Disable specific interrupt. - * - * Disable LEVEL1 interrupt. For some devices, there might be multiple interrupt - * levels. For example, there are NVIC and intmux. Here the interrupts connected - * to NVIC are the LEVEL1 interrupts, because they are routed to the core directly. - * The interrupts connected to intmux are the LEVEL2 interrupts, they are routed - * to NVIC first then routed to core. - * - * This function only disables the LEVEL1 interrupts. The number of LEVEL1 interrupts - * is indicated by the feature macro FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS. - * - * @param interrupt The IRQ number. - * @retval kStatus_Success Interrupt disabled successfully - * @retval kStatus_Fail Failed to disable the interrupt - */ -static inline status_t DisableIRQ(IRQn_Type interrupt) -{ - status_t status = kStatus_Success; - - if (NotAvail_IRQn == interrupt) - { - status = kStatus_Fail; - } - -#if defined(FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) && (FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS > 0) - else if ((int32_t)interrupt >= (int32_t)FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) - { - status = kStatus_Fail; - } -#endif - - else - { -#if defined(__GIC_PRIO_BITS) - GIC_DisableIRQ(interrupt); -#else - NVIC_DisableIRQ(interrupt); -#endif - } - - return status; -} - -/*! - * @brief Enable the IRQ, and also set the interrupt priority. - * - * Only handle LEVEL1 interrupt. For some devices, there might be multiple interrupt - * levels. For example, there are NVIC and intmux. Here the interrupts connected - * to NVIC are the LEVEL1 interrupts, because they are routed to the core directly. - * The interrupts connected to intmux are the LEVEL2 interrupts, they are routed - * to NVIC first then routed to core. - * - * This function only handles the LEVEL1 interrupts. The number of LEVEL1 interrupts - * is indicated by the feature macro FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS. - * - * @param interrupt The IRQ to Enable. - * @param priNum Priority number set to interrupt controller register. - * @retval kStatus_Success Interrupt priority set successfully - * @retval kStatus_Fail Failed to set the interrupt priority. - */ -static inline status_t EnableIRQWithPriority(IRQn_Type interrupt, uint8_t priNum) -{ - status_t status = kStatus_Success; - - if (NotAvail_IRQn == interrupt) - { - status = kStatus_Fail; - } - -#if defined(FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) && (FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS > 0) - else if ((int32_t)interrupt >= (int32_t)FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) - { - status = kStatus_Fail; - } -#endif - - else - { -#if defined(__GIC_PRIO_BITS) - GIC_SetPriority(interrupt, priNum); - GIC_EnableIRQ(interrupt); -#else - NVIC_SetPriority(interrupt, priNum); - NVIC_EnableIRQ(interrupt); -#endif - } - - return status; -} - -/*! - * @brief Set the IRQ priority. - * - * Only handle LEVEL1 interrupt. For some devices, there might be multiple interrupt - * levels. For example, there are NVIC and intmux. Here the interrupts connected - * to NVIC are the LEVEL1 interrupts, because they are routed to the core directly. - * The interrupts connected to intmux are the LEVEL2 interrupts, they are routed - * to NVIC first then routed to core. - * - * This function only handles the LEVEL1 interrupts. The number of LEVEL1 interrupts - * is indicated by the feature macro FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS. - * - * @param interrupt The IRQ to set. - * @param priNum Priority number set to interrupt controller register. - * - * @retval kStatus_Success Interrupt priority set successfully - * @retval kStatus_Fail Failed to set the interrupt priority. - */ -static inline status_t IRQ_SetPriority(IRQn_Type interrupt, uint8_t priNum) -{ - status_t status = kStatus_Success; - - if (NotAvail_IRQn == interrupt) - { - status = kStatus_Fail; - } - -#if defined(FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) && (FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS > 0) - else if ((int32_t)interrupt >= (int32_t)FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) - { - status = kStatus_Fail; - } -#endif - - else - { -#if defined(__GIC_PRIO_BITS) - GIC_SetPriority(interrupt, priNum); -#else - NVIC_SetPriority(interrupt, priNum); -#endif - } - - return status; -} - -/*! - * @brief Clear the pending IRQ flag. - * - * Only handle LEVEL1 interrupt. For some devices, there might be multiple interrupt - * levels. For example, there are NVIC and intmux. Here the interrupts connected - * to NVIC are the LEVEL1 interrupts, because they are routed to the core directly. - * The interrupts connected to intmux are the LEVEL2 interrupts, they are routed - * to NVIC first then routed to core. - * - * This function only handles the LEVEL1 interrupts. The number of LEVEL1 interrupts - * is indicated by the feature macro FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS. - * - * @param interrupt The flag which IRQ to clear. - * - * @retval kStatus_Success Interrupt priority set successfully - * @retval kStatus_Fail Failed to set the interrupt priority. - */ -static inline status_t IRQ_ClearPendingIRQ(IRQn_Type interrupt) -{ - status_t status = kStatus_Success; - - if (NotAvail_IRQn == interrupt) - { - status = kStatus_Fail; - } - -#if defined(FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) && (FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS > 0) - else if ((int32_t)interrupt >= (int32_t)FSL_FEATURE_NUMBER_OF_LEVEL1_INT_VECTORS) - { - status = kStatus_Fail; - } -#endif - - else - { -#if defined(__GIC_PRIO_BITS) - GIC_ClearPendingIRQ(interrupt); -#else - NVIC_ClearPendingIRQ(interrupt); -#endif - } - - return status; -} - -/*! - * @brief Disable the global IRQ - * - * Disable the global interrupt and return the current primask register. User is required to provided the primask - * register for the EnableGlobalIRQ(). - * - * @return Current primask value. - */ -static inline uint32_t DisableGlobalIRQ(void) -{ - uint32_t mask; - -#if defined(CPSR_I_Msk) - mask = __get_CPSR() & CPSR_I_Msk; -#elif defined(DAIF_I_BIT) - mask = __get_DAIF() & DAIF_I_BIT; -#else - mask = __get_PRIMASK(); -#endif - __disable_irq(); - - return mask; -} - -/*! - * @brief Enable the global IRQ - * - * Set the primask register with the provided primask value but not just enable the primask. The idea is for the - * convenience of integration of RTOS. some RTOS get its own management mechanism of primask. User is required to - * use the EnableGlobalIRQ() and DisableGlobalIRQ() in pair. - * - * @param primask value of primask register to be restored. The primask value is supposed to be provided by the - * DisableGlobalIRQ(). - */ -static inline void EnableGlobalIRQ(uint32_t primask) -{ -#if defined(CPSR_I_Msk) - __set_CPSR((__get_CPSR() & ~CPSR_I_Msk) | primask); -#elif defined(DAIF_I_BIT) - if (0UL == primask) - { - __enable_irq(); - } -#else - __set_PRIMASK(primask); -#endif -} - -#if defined(ENABLE_RAM_VECTOR_TABLE) -/*! - * @brief install IRQ handler - * - * @param irq IRQ number - * @param irqHandler IRQ handler address - * @return The old IRQ handler address - */ -uint32_t InstallIRQHandler(IRQn_Type irq, uint32_t irqHandler); -#endif /* ENABLE_RAM_VECTOR_TABLE. */ - -#if (defined(FSL_FEATURE_SOC_SYSCON_COUNT) && (FSL_FEATURE_SOC_SYSCON_COUNT > 0)) - -/* - * When FSL_FEATURE_POWERLIB_EXTEND is defined to non-zero value, - * powerlib should be used instead of these functions. - */ -#if !(defined(FSL_FEATURE_POWERLIB_EXTEND) && (FSL_FEATURE_POWERLIB_EXTEND != 0)) -/*! - * @brief Enable specific interrupt for wake-up from deep-sleep mode. - * - * Enable the interrupt for wake-up from deep sleep mode. - * Some interrupts are typically used in sleep mode only and will not occur during - * deep-sleep mode because relevant clocks are stopped. However, it is possible to enable - * those clocks (significantly increasing power consumption in the reduced power mode), - * making these wake-ups possible. - * - * @note This function also enables the interrupt in the NVIC (EnableIRQ() is called internaly). - * - * @param interrupt The IRQ number. - */ -void EnableDeepSleepIRQ(IRQn_Type interrupt); - -/*! - * @brief Disable specific interrupt for wake-up from deep-sleep mode. - * - * Disable the interrupt for wake-up from deep sleep mode. - * Some interrupts are typically used in sleep mode only and will not occur during - * deep-sleep mode because relevant clocks are stopped. However, it is possible to enable - * those clocks (significantly increasing power consumption in the reduced power mode), - * making these wake-ups possible. - * - * @note This function also disables the interrupt in the NVIC (DisableIRQ() is called internaly). - * - * @param interrupt The IRQ number. - */ -void DisableDeepSleepIRQ(IRQn_Type interrupt); -#endif /* FSL_FEATURE_POWERLIB_EXTEND */ -#endif /* FSL_FEATURE_SOC_SYSCON_COUNT */ - -#if defined(DWT) -/*! - * @brief Enable the counter to get CPU cycles. - */ -void MSDK_EnableCpuCycleCounter(void); - -/*! - * @brief Get the current CPU cycle count. - * - * @return Current CPU cycle count. - */ -uint32_t MSDK_GetCpuCycleCount(void); -#endif - -#if defined(__cplusplus) -} -#endif /* __cplusplus*/ - -/*! @} */ - -#endif /* FSL_COMMON_ARM_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_crc.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_crc.c deleted file mode 100644 index f4e303be95e..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_crc.c +++ /dev/null @@ -1,371 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2017, 2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#include "fsl_crc.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.crc" -#endif - -/*! @internal @brief Has data register with name CRC. */ -#if defined(FSL_FEATURE_CRC_HAS_CRC_REG) && FSL_FEATURE_CRC_HAS_CRC_REG -#define DATA CRC -#define DATALL CRCLL -#endif - -#if defined(CRC_DRIVER_USE_CRC16_CCIT_FALSE_AS_DEFAULT) && CRC_DRIVER_USE_CRC16_CCIT_FALSE_AS_DEFAULT -/* @brief Default user configuration structure for CRC-16-CCITT */ -#define CRC_DRIVER_DEFAULT_POLYNOMIAL 0x1021U -/*< CRC-16-CCIT polynomial x**16 + x**12 + x**5 + x**0 */ -#define CRC_DRIVER_DEFAULT_SEED 0xFFFFU -/*< Default initial checksum */ -#define CRC_DRIVER_DEFAULT_REFLECT_IN false -/*< Default is no transpose */ -#define CRC_DRIVER_DEFAULT_REFLECT_OUT false -/*< Default is transpose bytes */ -#define CRC_DRIVER_DEFAULT_COMPLEMENT_CHECKSUM false -/*< Default is without complement of CRC data register read data */ -#define CRC_DRIVER_DEFAULT_CRC_BITS kCrcBits16 -/*< Default is 16-bit CRC protocol */ -#define CRC_DRIVER_DEFAULT_CRC_RESULT kCrcFinalChecksum -/*< Default is resutl type is final checksum */ -#endif /* CRC_DRIVER_USE_CRC16_CCIT_FALSE_AS_DEFAULT */ - -#if defined(CRC_RSTS) -#define CRC_RESETS_ARRAY CRC_RSTS -#endif - -/*! @brief CRC type of transpose of read write data */ -typedef enum _crc_transpose_type -{ - kCrcTransposeNone = 0U, /*! No transpose */ - kCrcTransposeBits = 1U, /*! Tranpose bits in bytes */ - kCrcTransposeBitsAndBytes = 2U, /*! Transpose bytes and bits in bytes */ - kCrcTransposeBytes = 3U, /*! Transpose bytes */ -} crc_transpose_type_t; - -/*! - * @brief CRC module configuration. - * - * This structure holds the configuration for the CRC module. - */ -typedef struct _crc_module_config -{ - uint32_t polynomial; /*!< CRC Polynomial, MSBit first.@n - Example polynomial: 0x1021 = 1_0000_0010_0001 = x^12+x^5+1 */ - uint32_t seed; /*!< Starting checksum value */ - crc_transpose_type_t readTranspose; /*!< Type of transpose when reading CRC result. */ - crc_transpose_type_t writeTranspose; /*!< Type of transpose when writing CRC input data. */ - bool complementChecksum; /*!< True if the result shall be complement of the actual checksum. */ - crc_bits_t crcBits; /*!< Selects 16- or 32- bit CRC protocol. */ -} crc_module_config_t; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#if defined(CRC_RESETS_ARRAY) -/*! - * @brief Get instance number for CRC module. - * - * @param base CRC peripheral base address - */ -static uint32_t CRC_GetInstance(CRC_Type *base); -#endif -/******************************************************************************* - * Variables - ******************************************************************************/ -#if defined(CRC_RESETS_ARRAY) -static CRC_Type *const s_crcBases[] = CRC_BASE_PTRS; - -/* Reset array */ -static const reset_ip_name_t s_crcResets[] = CRC_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -#if defined(CRC_RESETS_ARRAY) -static uint32_t CRC_GetInstance(CRC_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_crcBases); instance++) - { - if (s_crcBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_crcBases)); - - return instance; -} -#endif - -/*! - * @brief Returns transpose type for CRC protocol reflect in parameter. - * - * This functions helps to set writeTranspose member of crc_config_t structure. Reflect in is CRC protocol parameter. - * - * @param enable True or false for the selected CRC protocol Reflect In (refin) parameter. - */ -static inline crc_transpose_type_t CRC_GetTransposeTypeFromReflectIn(bool enable) -{ - return ((enable) ? kCrcTransposeBitsAndBytes : kCrcTransposeBytes); -} - -/*! - * @brief Returns transpose type for CRC protocol reflect out parameter. - * - * This functions helps to set readTranspose member of crc_config_t structure. Reflect out is CRC protocol parameter. - * - * @param enable True or false for the selected CRC protocol Reflect Out (refout) parameter. - */ -static inline crc_transpose_type_t CRC_GetTransposeTypeFromReflectOut(bool enable) -{ - return ((enable) ? kCrcTransposeBitsAndBytes : kCrcTransposeNone); -} - -/*! - * @brief Starts checksum computation. - * - * Configures the CRC module for the specified CRC protocol. @n - * Starts the checksum computation by writing the seed value - * - * @param base CRC peripheral address. - * @param config Pointer to protocol configuration structure. - */ -static void CRC_ConfigureAndStart(CRC_Type *base, const crc_module_config_t *config) -{ - uint32_t crcControl; - - /* pre-compute value for CRC control registger based on user configuraton without WAS field */ - crcControl = 0U | CRC_CTRL_TOT(config->writeTranspose) | CRC_CTRL_TOTR(config->readTranspose) | - CRC_CTRL_FXOR(config->complementChecksum) | CRC_CTRL_TCRC(config->crcBits); - - /* make sure the control register is clear - WAS is deasserted, and protocol is set */ - base->CTRL = crcControl; - - /* write polynomial register */ - base->GPOLY = config->polynomial; - - /* write pre-computed control register value along with WAS to start checksum computation */ - base->CTRL = crcControl | CRC_CTRL_WAS(true); - - /* write seed (initial checksum) */ - base->DATA = config->seed; - - /* deassert WAS by writing pre-computed CRC control register value */ - base->CTRL = crcControl; -} - -/*! - * @brief Starts final checksum computation. - * - * Configures the CRC module for the specified CRC protocol. @n - * Starts final checksum computation by writing the seed value. - * @note CRC_Get16bitResult() or CRC_Get32bitResult() return final checksum - * (output reflection and xor functions are applied). - * - * @param base CRC peripheral address. - * @param protocolConfig Pointer to protocol configuration structure. - */ -static void CRC_SetProtocolConfig(CRC_Type *base, const crc_config_t *protocolConfig) -{ - crc_module_config_t moduleConfig; - /* convert protocol to CRC peripheral module configuration, prepare for final checksum */ - moduleConfig.polynomial = protocolConfig->polynomial; - moduleConfig.seed = protocolConfig->seed; - moduleConfig.readTranspose = CRC_GetTransposeTypeFromReflectOut(protocolConfig->reflectOut); - moduleConfig.writeTranspose = CRC_GetTransposeTypeFromReflectIn(protocolConfig->reflectIn); - moduleConfig.complementChecksum = protocolConfig->complementChecksum; - moduleConfig.crcBits = protocolConfig->crcBits; - - CRC_ConfigureAndStart(base, &moduleConfig); -} - -/*! - * @brief Starts intermediate checksum computation. - * - * Configures the CRC module for the specified CRC protocol. @n - * Starts intermediate checksum computation by writing the seed value. - * @note CRC_Get16bitResult() or CRC_Get32bitResult() return intermediate checksum (raw data register value). - * - * @param base CRC peripheral address. - * @param protocolConfig Pointer to protocol configuration structure. - */ -static void CRC_SetRawProtocolConfig(CRC_Type *base, const crc_config_t *protocolConfig) -{ - crc_module_config_t moduleConfig; - /* convert protocol to CRC peripheral module configuration, prepare for intermediate checksum */ - moduleConfig.polynomial = protocolConfig->polynomial; - moduleConfig.seed = protocolConfig->seed; - moduleConfig.readTranspose = - kCrcTransposeNone; /* intermediate checksum does no transpose of data register read value */ - moduleConfig.writeTranspose = CRC_GetTransposeTypeFromReflectIn(protocolConfig->reflectIn); - moduleConfig.complementChecksum = false; /* intermediate checksum does no xor of data register read value */ - moduleConfig.crcBits = protocolConfig->crcBits; - - CRC_ConfigureAndStart(base, &moduleConfig); -} - -/*! - * brief Enables and configures the CRC peripheral module. - * - * This function enables the clock gate in the SIM module for the CRC peripheral. - * It also configures the CRC module and starts a checksum computation by writing the seed. - * - * param base CRC peripheral address. - * param config CRC module configuration structure. - */ -void CRC_Init(CRC_Type *base, const crc_config_t *config) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* ungate clock */ - CLOCK_EnableClock(kCLOCK_Crc0); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(CRC_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_crcResets[CRC_GetInstance(base)]); -#endif - - /* configure CRC module and write the seed */ - if (config->crcResult == kCrcFinalChecksum) - { - CRC_SetProtocolConfig(base, config); - } - else - { - CRC_SetRawProtocolConfig(base, config); - } -} - -/*! - * brief Loads default values to the CRC protocol configuration structure. - * - * Loads default values to the CRC protocol configuration structure. The default values are as follows. - * code - * config->polynomial = 0x1021; - * config->seed = 0xFFFF; - * config->reflectIn = false; - * config->reflectOut = false; - * config->complementChecksum = false; - * config->crcBits = kCrcBits16; - * config->crcResult = kCrcFinalChecksum; - * endcode - * - * param config CRC protocol configuration structure. - */ -void CRC_GetDefaultConfig(crc_config_t *config) -{ - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - static const crc_config_t crc16ccit = { - CRC_DRIVER_DEFAULT_POLYNOMIAL, CRC_DRIVER_DEFAULT_SEED, - CRC_DRIVER_DEFAULT_REFLECT_IN, CRC_DRIVER_DEFAULT_REFLECT_OUT, - CRC_DRIVER_DEFAULT_COMPLEMENT_CHECKSUM, CRC_DRIVER_DEFAULT_CRC_BITS, - CRC_DRIVER_DEFAULT_CRC_RESULT, - }; - - *config = crc16ccit; -} - -/*! - * brief Writes data to the CRC module. - * - * Writes input data buffer bytes to the CRC data register. - * The configured type of transpose is applied. - * - * param base CRC peripheral address. - * param data Input data stream, MSByte in data[0]. - * param dataSize Size in bytes of the input data buffer. - */ -void CRC_WriteData(CRC_Type *base, const uint8_t *data, size_t dataSize) -{ - const uint32_t *data32; - - /* 8-bit reads and writes till source address is aligned 4 bytes */ - while ((0U != dataSize) && (0U != ((uint32_t)data & 3U))) - { - base->ACCESS8BIT.DATALL = *data; - data++; - dataSize--; - } - - /* use 32-bit reads and writes as long as possible */ - data32 = (const uint32_t *)(uint32_t)data; - while (dataSize >= sizeof(uint32_t)) - { - base->DATA = *data32; - data32++; - dataSize -= sizeof(uint32_t); - } - - data = (const uint8_t *)data32; - - /* 8-bit reads and writes till end of data buffer */ - while (dataSize != 0U) - { - base->ACCESS8BIT.DATALL = *data; - data++; - dataSize--; - } -} - -/*! - * brief Reads the 32-bit checksum from the CRC module. - * - * Reads the CRC data register (either an intermediate or the final checksum). - * The configured type of transpose and complement is applied. - * - * param base CRC peripheral address. - * return An intermediate or the final 32-bit checksum, after configured transpose and complement operations. - */ -uint32_t CRC_Get32bitResult(CRC_Type *base) -{ - return base->DATA; -} - -/*! - * brief Reads a 16-bit checksum from the CRC module. - * - * Reads the CRC data register (either an intermediate or the final checksum). - * The configured type of transpose and complement is applied. - * - * param base CRC peripheral address. - * return An intermediate or the final 16-bit checksum, after configured transpose and complement operations. - */ -uint16_t CRC_Get16bitResult(CRC_Type *base) -{ - uint32_t retval; - uint32_t totr; /* type of transpose read bitfield */ - - retval = base->DATA; - totr = (base->CTRL & CRC_CTRL_TOTR_MASK) >> CRC_CTRL_TOTR_SHIFT; - - /* check transpose type to get 16-bit out of 32-bit register */ - if (totr >= 2U) - { - /* transpose of bytes for read is set, the result CRC is in CRC_DATA[HU:HL] */ - retval &= 0xFFFF0000U; - retval = retval >> 16U; - } - else - { - /* no transpose of bytes for read, the result CRC is in CRC_DATA[LU:LL] */ - retval &= 0x0000FFFFU; - } - return (uint16_t)retval; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_crc.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_crc.h deleted file mode 100644 index 487e9f1095f..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_crc.h +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2017, 2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_CRC_H_ -#define FSL_CRC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup crc - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief CRC driver version. Version 2.0.4. - * - * Current version: 2.0.4 - * - * Change log: - * - * - Version 2.0.4 - * - Release peripheral from reset if necessary in init function. - * - * - Version 2.0.3 - * - Fix MISRA issues - * - * - Version 2.0.2 - * - Fix MISRA issues - * - * - Version 2.0.1 - * - move DATA and DATALL macro definition from header file to source file - */ -#define FSL_CRC_DRIVER_VERSION (MAKE_VERSION(2, 0, 4)) -/*! @} */ - -#ifndef CRC_DRIVER_CUSTOM_DEFAULTS -/*! @brief Default configuration structure filled by CRC_GetDefaultConfig(). Use CRC16-CCIT-FALSE as defeault. */ -#define CRC_DRIVER_USE_CRC16_CCIT_FALSE_AS_DEFAULT 1 -#endif - -/*! @brief CRC bit width */ -typedef enum _crc_bits -{ - kCrcBits16 = 0U, /*!< Generate 16-bit CRC code */ - kCrcBits32 = 1U /*!< Generate 32-bit CRC code */ -} crc_bits_t; - -/*! @brief CRC result type */ -typedef enum _crc_result -{ - kCrcFinalChecksum = 0U, /*!< CRC data register read value is the final checksum. - Reflect out and final xor protocol features are applied. */ - kCrcIntermediateChecksum = 1U /*!< CRC data register read value is intermediate checksum (raw value). - Reflect out and final xor protocol feature are not applied. - Intermediate checksum can be used as a seed for CRC_Init() - to continue adding data to this checksum. */ -} crc_result_t; - -/*! - * @brief CRC protocol configuration. - * - * This structure holds the configuration for the CRC protocol. - * - */ -typedef struct _crc_config -{ - uint32_t polynomial; /*!< CRC Polynomial, MSBit first. - Example polynomial: 0x1021 = 1_0000_0010_0001 = x^12+x^5+1 */ - uint32_t seed; /*!< Starting checksum value */ - bool reflectIn; /*!< Reflect bits on input. */ - bool reflectOut; /*!< Reflect bits on output. */ - bool complementChecksum; /*!< True if the result shall be complement of the actual checksum. */ - crc_bits_t crcBits; /*!< Selects 16- or 32- bit CRC protocol. */ - crc_result_t crcResult; /*!< Selects final or intermediate checksum return from CRC_Get16bitResult() or - CRC_Get32bitResult() */ -} crc_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @brief Enables and configures the CRC peripheral module. - * - * This function enables the clock gate in the SIM module for the CRC peripheral. - * It also configures the CRC module and starts a checksum computation by writing the seed. - * - * @param base CRC peripheral address. - * @param config CRC module configuration structure. - */ -void CRC_Init(CRC_Type *base, const crc_config_t *config); - -/*! - * @brief Disables the CRC peripheral module. - * - * This function disables the clock gate in the SIM module for the CRC peripheral. - * - * @param base CRC peripheral address. - */ -static inline void CRC_Deinit(CRC_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* gate clock */ - CLOCK_DisableClock(kCLOCK_Crc0); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * @brief Loads default values to the CRC protocol configuration structure. - * - * Loads default values to the CRC protocol configuration structure. The default values are as follows. - * @code - * config->polynomial = 0x1021; - * config->seed = 0xFFFF; - * config->reflectIn = false; - * config->reflectOut = false; - * config->complementChecksum = false; - * config->crcBits = kCrcBits16; - * config->crcResult = kCrcFinalChecksum; - * @endcode - * - * @param config CRC protocol configuration structure. - */ -void CRC_GetDefaultConfig(crc_config_t *config); - -/*! - * @brief Writes data to the CRC module. - * - * Writes input data buffer bytes to the CRC data register. - * The configured type of transpose is applied. - * - * @param base CRC peripheral address. - * @param data Input data stream, MSByte in data[0]. - * @param dataSize Size in bytes of the input data buffer. - */ -void CRC_WriteData(CRC_Type *base, const uint8_t *data, size_t dataSize); - -/*! - * @brief Reads the 32-bit checksum from the CRC module. - * - * Reads the CRC data register (either an intermediate or the final checksum). - * The configured type of transpose and complement is applied. - * - * @param base CRC peripheral address. - * @return An intermediate or the final 32-bit checksum, after configured transpose and complement operations. - */ -uint32_t CRC_Get32bitResult(CRC_Type *base); - -/*! - * @brief Reads a 16-bit checksum from the CRC module. - * - * Reads the CRC data register (either an intermediate or the final checksum). - * The configured type of transpose and complement is applied. - * - * @param base CRC peripheral address. - * @return An intermediate or the final 16-bit checksum, after configured transpose and complement operations. - */ -uint16_t CRC_Get16bitResult(CRC_Type *base); - -#if defined(__cplusplus) -} -#endif - -/*! - *@} - */ - -#endif /* FSL_CRC_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_ctimer.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_ctimer.c deleted file mode 100644 index 3317157fdeb..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_ctimer.c +++ /dev/null @@ -1,604 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_ctimer.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.ctimer" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Gets the instance from the base address - * - * @param base Ctimer peripheral base address - * - * @return The Timer instance - */ -static uint32_t CTIMER_GetInstance(CTIMER_Type *base); - -/*! - * @brief CTIMER generic IRQ handle function. - * - * @param index FlexCAN peripheral instance index. - */ -static void CTIMER_GenericIRQHandler(uint32_t index); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to Timer bases for each instance. */ -static CTIMER_Type *const s_ctimerBases[] = CTIMER_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to Timer clocks for each instance. */ -static const clock_ip_name_t s_ctimerClocks[] = CTIMER_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_RESET) && (FSL_FEATURE_CTIMER_HAS_NO_RESET)) -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) -#if defined(FSL_FEATURE_CTIMER_WRITE_ZERO_ASSERT_RESET) && FSL_FEATURE_CTIMER_WRITE_ZERO_ASSERT_RESET -/*! @brief Pointers to Timer resets for each instance, writing a zero asserts the reset */ -static const reset_ip_name_t s_ctimerResets[] = CTIMER_RSTS_N; -#else -/*! @brief Pointers to Timer resets for each instance, writing a one asserts the reset */ -static const reset_ip_name_t s_ctimerResets[] = CTIMER_RSTS; -#endif -#endif -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ - -/*! @brief Pointers real ISRs installed by drivers for each instance. */ -static ctimer_callback_t *s_ctimerCallback[sizeof(s_ctimerBases) / sizeof(s_ctimerBases[0])] = {0}; - -/*! @brief Callback type installed by drivers for each instance. */ -static ctimer_callback_type_t ctimerCallbackType[sizeof(s_ctimerBases) / sizeof(s_ctimerBases[0])] = { - kCTIMER_SingleCallback}; - -/*! @brief Array to map timer instance to IRQ number. */ -static const IRQn_Type s_ctimerIRQ[] = CTIMER_IRQS; - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t CTIMER_GetInstance(CTIMER_Type *base) -{ - uint32_t instance; - uint32_t ctimerArrayCount = (sizeof(s_ctimerBases) / sizeof(s_ctimerBases[0])); - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ctimerArrayCount; instance++) - { - if (s_ctimerBases[instance] == base) - { - break; - } - } - - assert(instance < ctimerArrayCount); - - return instance; -} - -/*! - * brief Ungates the clock and configures the peripheral for basic operation. - * - * note This API should be called at the beginning of the application before using the driver. - * - * param base Ctimer peripheral base address - * param config Pointer to the user configuration structure. - */ -void CTIMER_Init(CTIMER_Type *base, const ctimer_config_t *config) -{ - assert(config != NULL); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the timer clock*/ - CLOCK_EnableClock(s_ctimerClocks[CTIMER_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) -/* Reset the module. */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_RESET) && (FSL_FEATURE_CTIMER_HAS_NO_RESET)) - RESET_PeripheralReset(s_ctimerResets[CTIMER_GetInstance(base)]); -#endif -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ - -/* Setup the cimer mode and count select */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && (FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE)) - base->CTCR = CTIMER_CTCR_CTMODE(config->mode) | CTIMER_CTCR_CINSEL(config->input); -#endif - /* Setup the timer prescale value */ - base->PR = CTIMER_PR_PRVAL(config->prescale); -} - -/*! - * brief Gates the timer clock. - * - * param base Ctimer peripheral base address - */ -void CTIMER_Deinit(CTIMER_Type *base) -{ - uint32_t index = CTIMER_GetInstance(base); - /* Stop the timer */ - base->TCR &= ~CTIMER_TCR_CEN_MASK; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable the timer clock*/ - CLOCK_DisableClock(s_ctimerClocks[index]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Disable IRQ at NVIC Level */ - (void)DisableIRQ(s_ctimerIRQ[index]); -} - -/*! - * brief Fills in the timers configuration structure with the default settings. - * - * The default values are: - * code - * config->mode = kCTIMER_TimerMode; - * config->input = kCTIMER_Capture_0; - * config->prescale = 0; - * endcode - * param config Pointer to the user configuration structure. - */ -void CTIMER_GetDefaultConfig(ctimer_config_t *config) -{ - assert(config != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - /* Run as a timer */ - config->mode = kCTIMER_TimerMode; - /* This field is ignored when mode is timer */ - config->input = kCTIMER_Capture_0; - /* Timer counter is incremented on every APB bus clock */ - config->prescale = 0; -} - -/*! - * brief Configures the PWM signal parameters. - * - * Enables PWM mode on the match channel passed in and will then setup the match value - * and other match parameters to generate a PWM signal. - * This function can manually assign the specified channel to set the PWM cycle. - * - * note When setting PWM output from multiple output pins, all should use the same PWM - * frequency. Please use CTIMER_SetupPwmPeriod to set up the PWM with high resolution. - * - * param base Ctimer peripheral base address - * param pwmPeriodChannel Specify the channel to control the PWM period - * param matchChannel Match pin to be used to output the PWM signal - * param dutyCyclePercent PWM pulse width; the value should be between 0 to 100 - * param pwmFreq_Hz PWM signal frequency in Hz - * param srcClock_Hz Timer counter clock in Hz - * param enableInt Enable interrupt when the timer value reaches the match value of the PWM pulse, - * if it is 0 then no interrupt will be generated. - * - * return kStatus_Success on success - * kStatus_Fail If matchChannel is equal to pwmPeriodChannel; this channel is reserved to set the PWM cycle - */ -status_t CTIMER_SetupPwm(CTIMER_Type *base, - const ctimer_match_t pwmPeriodChannel, - ctimer_match_t matchChannel, - uint8_t dutyCyclePercent, - uint32_t pwmFreq_Hz, - uint32_t srcClock_Hz, - bool enableInt) -{ - assert(pwmFreq_Hz > 0U); - - uint32_t reg; - uint32_t period, pulsePeriod = 0; - uint32_t timerClock = srcClock_Hz / (base->PR + 1U); - uint32_t index = CTIMER_GetInstance(base); - - if (matchChannel == pwmPeriodChannel) - { - return kStatus_Fail; - } - - /* Enable PWM mode on the match channel */ - base->PWMC |= (1UL << (uint32_t)matchChannel); - - /* Clear the stop, reset and interrupt bits for this channel */ - reg = base->MCR; - reg &= - ~(((uint32_t)((uint32_t)CTIMER_MCR_MR0R_MASK | (uint32_t)CTIMER_MCR_MR0S_MASK | (uint32_t)CTIMER_MCR_MR0I_MASK)) - << ((uint32_t)matchChannel * 3U)); - - /* If call back function is valid then enable match interrupt for the channel */ - if (enableInt) - { - reg |= (((uint32_t)CTIMER_MCR_MR0I_MASK) << (CTIMER_MCR_MR0I_SHIFT + ((uint32_t)matchChannel * 3U))); - } - - /* Reset the counter when match on PWM period channel (pwmPeriodChannel) */ - reg |= ((uint32_t)((uint32_t)CTIMER_MCR_MR0R_MASK) << ((uint32_t)pwmPeriodChannel * 3U)); - - base->MCR = reg; - - /* Calculate PWM period match value */ - period = (timerClock / pwmFreq_Hz) - 1U; - - /* Calculate pulse width match value */ - if (dutyCyclePercent == 0U) - { - pulsePeriod = period + 1U; - } - else - { - pulsePeriod = (period * (100U - (uint32_t)dutyCyclePercent)) / 100U; - } - - /* Specified channel pwmPeriodChannel will define the PWM period */ - base->MR[pwmPeriodChannel] = period; - - /* This will define the PWM pulse period */ - base->MR[matchChannel] = pulsePeriod; - /* Clear status flags */ - CTIMER_ClearStatusFlags(base, ((uint32_t)CTIMER_IR_MR0INT_MASK) << (uint32_t)matchChannel); - /* If call back function is valid then enable interrupt and update the call back function */ - if (enableInt) - { - (void)EnableIRQ(s_ctimerIRQ[index]); - } - - return kStatus_Success; -} - -/*! - * brief Configures the PWM signal parameters. - * - * Enables PWM mode on the match channel passed in and will then setup the match value - * and other match parameters to generate a PWM signal. - * This function can manually assign the specified channel to set the PWM cycle. - * - * note When setting PWM output from multiple output pins, all should use the same PWM - * period - * - * param base Ctimer peripheral base address - * param pwmPeriodChannel Specify the channel to control the PWM period - * param matchChannel Match pin to be used to output the PWM signal - * param pwmPeriod PWM period match value - * param pulsePeriod Pulse width match value - * param enableInt Enable interrupt when the timer value reaches the match value of the PWM pulse, - * if it is 0 then no interrupt will be generated. - * - * return kStatus_Success on success - * kStatus_Fail If matchChannel is equal to pwmPeriodChannel; this channel is reserved to set the PWM period - */ -status_t CTIMER_SetupPwmPeriod(CTIMER_Type *base, - const ctimer_match_t pwmPeriodChannel, - ctimer_match_t matchChannel, - uint32_t pwmPeriod, - uint32_t pulsePeriod, - bool enableInt) -{ -/* Some CTimers only have 16bits , so the value is limited*/ -#if defined(FSL_FEATURE_SOC_CTIMER16B) && FSL_FEATURE_SOC_CTIMER16B - assert(!((FSL_FEATURE_CTIMER_BIT_SIZEn(base) < 32) && (pulsePeriod > 0xFFFFU))); -#endif - - uint32_t reg; - uint32_t index = CTIMER_GetInstance(base); - - if (matchChannel == pwmPeriodChannel) - { - return kStatus_Fail; - } - - /* Enable PWM mode on PWM pulse channel */ - base->PWMC |= (1UL << (uint32_t)matchChannel); - - /* Clear the stop, reset and interrupt bits for PWM pulse channel */ - reg = base->MCR; - reg &= - ~((uint32_t)((uint32_t)CTIMER_MCR_MR0R_MASK | (uint32_t)CTIMER_MCR_MR0S_MASK | (uint32_t)CTIMER_MCR_MR0I_MASK) - << ((uint32_t)matchChannel * 3U)); - - /* If call back function is valid then enable match interrupt for PWM pulse channel */ - if (enableInt) - { - reg |= (((uint32_t)CTIMER_MCR_MR0I_MASK) << (CTIMER_MCR_MR0I_SHIFT + ((uint32_t)matchChannel * 3U))); - } - - /* Reset the counter when match on PWM period channel (pwmPeriodChannel) */ - reg |= ((uint32_t)((uint32_t)CTIMER_MCR_MR0R_MASK) << ((uint32_t)pwmPeriodChannel * 3U)); - - base->MCR = reg; - - /* Specified channel pwmPeriodChannel will define the PWM period */ - base->MR[pwmPeriodChannel] = pwmPeriod; - - /* This will define the PWM pulse period */ - base->MR[matchChannel] = pulsePeriod; - /* Clear status flags */ - CTIMER_ClearStatusFlags(base, ((uint32_t)CTIMER_IR_MR0INT_MASK) << (uint32_t)matchChannel); - /* If call back function is valid then enable interrupt and update the call back function */ - if (enableInt) - { - (void)EnableIRQ(s_ctimerIRQ[index]); - } - - return kStatus_Success; -} - -/*! - * brief Updates the duty cycle of an active PWM signal. - * - * note Please use CTIMER_SetupPwmPeriod to update the PWM with high resolution. - * This function can manually assign the specified channel to set the PWM cycle. - * - * param base Ctimer peripheral base address - * param pwmPeriodChannel Specify the channel to control the PWM period - * param matchChannel Match pin to be used to output the PWM signal - * param dutyCyclePercent New PWM pulse width; the value should be between 0 to 100 - */ -void CTIMER_UpdatePwmDutycycle(CTIMER_Type *base, - const ctimer_match_t pwmPeriodChannel, - ctimer_match_t matchChannel, - uint8_t dutyCyclePercent) -{ - uint32_t pulsePeriod = 0, period; - - /* Specified channel pwmPeriodChannel defines the PWM period */ - period = base->MR[pwmPeriodChannel]; - - /* For 0% dutycyle, make pulse period greater than period so the event will never occur */ - if (dutyCyclePercent == 0U) - { - pulsePeriod = period + 1U; - } - else - { - pulsePeriod = (period * (100U - (uint32_t)dutyCyclePercent)) / 100U; - } - - /* Update dutycycle */ - base->MR[matchChannel] = pulsePeriod; -} - -/*! - * brief Setup the match register. - * - * User configuration is used to setup the match value and action to be taken when a match occurs. - * - * param base Ctimer peripheral base address - * param matchChannel Match register to configure - * param config Pointer to the match configuration structure - */ -void CTIMER_SetupMatch(CTIMER_Type *base, ctimer_match_t matchChannel, const ctimer_match_config_t *config) -{ -/* Some CTimers only have 16bits , so the value is limited*/ -#if defined(FSL_FEATURE_SOC_CTIMER16B) && FSL_FEATURE_SOC_CTIMER16B - assert(!(FSL_FEATURE_CTIMER_BIT_SIZEn(base) < 32 && config->matchValue > 0xFFFFU)); -#endif - uint32_t reg; - uint32_t index = CTIMER_GetInstance(base); - - /* Set the counter operation when a match on this channel occurs */ - reg = base->MCR; - reg &= - ~((uint32_t)((uint32_t)CTIMER_MCR_MR0R_MASK | (uint32_t)CTIMER_MCR_MR0S_MASK | (uint32_t)CTIMER_MCR_MR0I_MASK) - << ((uint32_t)matchChannel * 3U)); - reg |= ((uint32_t)(config->enableCounterReset) << (CTIMER_MCR_MR0R_SHIFT + ((uint32_t)matchChannel * 3U))); - reg |= ((uint32_t)(config->enableCounterStop) << (CTIMER_MCR_MR0S_SHIFT + ((uint32_t)matchChannel * 3U))); - reg |= ((uint32_t)(config->enableInterrupt) << (CTIMER_MCR_MR0I_SHIFT + ((uint32_t)matchChannel * 3U))); - base->MCR = reg; - - reg = base->EMR; - /* Set the match output operation when a match on this channel occurs */ - reg &= ~(((uint32_t)CTIMER_EMR_EMC0_MASK) << ((uint32_t)matchChannel * 2U)); - reg |= ((uint32_t)config->outControl) << (CTIMER_EMR_EMC0_SHIFT + ((uint32_t)matchChannel * 2U)); - - /* Set the initial state of the EM bit/output */ - reg &= ~(((uint32_t)CTIMER_EMR_EM0_MASK) << (uint32_t)matchChannel); - reg |= ((uint32_t)config->outPinInitState) << (uint32_t)matchChannel; - base->EMR = reg; - - /* Set the match value */ - base->MR[matchChannel] = config->matchValue; - /* Clear status flags */ - CTIMER_ClearStatusFlags(base, ((uint32_t)CTIMER_IR_MR0INT_MASK) << (uint32_t)matchChannel); - /* If interrupt is enabled then enable interrupt and update the call back function */ - if (config->enableInterrupt) - { - (void)EnableIRQ(s_ctimerIRQ[index]); - } -} - -/*! - * brief Get the status of output match. - * - * This function gets the status of output MAT, whether or not this output is connected to a pin. - * This status is driven to the MAT pins if the match function is selected via IOCON. 0 = LOW. 1 = HIGH. - * - * param base Ctimer peripheral base address - * param matchChannel External match channel, user can obtain the status of multiple match channels - * at the same time by using the logic of "|" - * enumeration ::ctimer_external_match_t - * return The mask of external match channel status flags. Users need to use the - * _ctimer_external_match type to decode the return variables. - */ -uint32_t CTIMER_GetOutputMatchStatus(CTIMER_Type *base, uint32_t matchChannel) -{ - return (base->EMR & matchChannel); -} - -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && (FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE)) -/*! - * brief Setup the capture. - * - * param base Ctimer peripheral base address - * param capture Capture channel to configure - * param edge Edge on the channel that will trigger a capture - * param enableInt Flag to enable channel interrupts, if enabled then the registered call back - * is called upon capture - */ -void CTIMER_SetupCapture(CTIMER_Type *base, - ctimer_capture_channel_t capture, - ctimer_capture_edge_t edge, - bool enableInt) -{ - uint32_t reg = base->CCR; - uint32_t index = CTIMER_GetInstance(base); - - /* Set the capture edge */ - reg &= ~((uint32_t)((uint32_t)CTIMER_CCR_CAP0RE_MASK | (uint32_t)CTIMER_CCR_CAP0FE_MASK | - (uint32_t)CTIMER_CCR_CAP0I_MASK) - << ((uint32_t)capture * 3U)); - reg |= ((uint32_t)edge) << (CTIMER_CCR_CAP0RE_SHIFT + ((uint32_t)capture * 3U)); - /* Clear status flags */ - CTIMER_ClearStatusFlags(base, (((uint32_t)kCTIMER_Capture0Flag) << (uint32_t)capture)); - /* If call back function is valid then enable capture interrupt for the channel and update the call back function */ - if (enableInt) - { - reg |= ((uint32_t)CTIMER_CCR_CAP0I_MASK) << ((uint32_t)capture * 3U); - (void)EnableIRQ(s_ctimerIRQ[index]); - } - base->CCR = reg; -} -#endif - -/*! - * brief Register callback. - * - * param base Ctimer peripheral base address - * param cb_func callback function - * param cb_type callback function type, singular or multiple - */ -void CTIMER_RegisterCallBack(CTIMER_Type *base, ctimer_callback_t *cb_func, ctimer_callback_type_t cb_type) -{ - uint32_t index = CTIMER_GetInstance(base); - s_ctimerCallback[index] = cb_func; - ctimerCallbackType[index] = cb_type; -} - -/*! - * brief CTIMER generic IRQ handle function. - * - * param index FlexCAN peripheral instance index. - */ -static void CTIMER_GenericIRQHandler(uint32_t index) -{ - uint32_t int_stat, i, mask; - /* Get Interrupt status flags */ - int_stat = CTIMER_GetStatusFlags(s_ctimerBases[index]); - /* Clear the status flags that were set */ - CTIMER_ClearStatusFlags(s_ctimerBases[index], int_stat); - if (ctimerCallbackType[index] == kCTIMER_SingleCallback) - { - if (s_ctimerCallback[index][0] != NULL) - { - s_ctimerCallback[index][0](int_stat); - } - } - else - { -#if defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE - for (i = 0; i <= CTIMER_IR_MR3INT_SHIFT; i++) -#else -#if defined(FSL_FEATURE_CTIMER_HAS_IR_CR3INT) && FSL_FEATURE_CTIMER_HAS_IR_CR3INT - for (i = 0; i <= CTIMER_IR_CR3INT_SHIFT; i++) -#else -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_IR_CR2INT) && FSL_FEATURE_CTIMER_HAS_NO_IR_CR2INT) - for (i = 0; i <= CTIMER_IR_CR2INT_SHIFT; i++) -#else - for (i = 0; i <= CTIMER_IR_CR1INT_SHIFT; i++) -#endif /* FSL_FEATURE_CTIMER_HAS_NO_IR_CR2INT */ -#endif /* FSL_FEATURE_CTIMER_HAS_IR_CR3INT */ -#endif - { - mask = 0x01UL << i; - /* For each status flag bit that was set call the callback function if it is valid */ - if (((int_stat & mask) != 0U) && (s_ctimerCallback[index][i] != NULL)) - { - s_ctimerCallback[index][i](int_stat); - } - } - } - SDK_ISR_EXIT_BARRIER; -} - -/* IRQ handler functions overloading weak symbols in the startup */ -#if defined(CTIMER0) -void CTIMER0_DriverIRQHandler(void); -void CTIMER0_DriverIRQHandler(void) -{ - CTIMER_GenericIRQHandler(0); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CTIMER1) -void CTIMER1_DriverIRQHandler(void); -void CTIMER1_DriverIRQHandler(void) -{ - CTIMER_GenericIRQHandler(1); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CTIMER2) -void CTIMER2_DriverIRQHandler(void); -void CTIMER2_DriverIRQHandler(void) -{ - CTIMER_GenericIRQHandler(2); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CTIMER3) -void CTIMER3_DriverIRQHandler(void); -void CTIMER3_DriverIRQHandler(void) -{ - CTIMER_GenericIRQHandler(3); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CTIMER4) -void CTIMER4_DriverIRQHandler(void); -void CTIMER4_DriverIRQHandler(void) -{ - CTIMER_GenericIRQHandler(4); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CTIMER5) -void CTIMER5_DriverIRQHandler(void); -void CTIMER5_DriverIRQHandler(void) -{ - CTIMER_GenericIRQHandler(5); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CTIMER6) -void CTIMER6_DriverIRQHandler(void); -void CTIMER6_DriverIRQHandler(void) -{ - CTIMER_GenericIRQHandler(6); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CTIMER7) -void CTIMER7_DriverIRQHandler(void); -void CTIMER7_DriverIRQHandler(void) -{ - CTIMER_GenericIRQHandler(7); - SDK_ISR_EXIT_BARRIER; -} -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_ctimer.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_ctimer.h deleted file mode 100644 index 0ec7286e6c6..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_ctimer.h +++ /dev/null @@ -1,682 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_CTIMER_H_ -#define FSL_CTIMER_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup ctimer - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -#define FSL_CTIMER_DRIVER_VERSION (MAKE_VERSION(2, 3, 1)) /*!< Version 2.3.1 */ -/*! @} */ - -/*! @brief List of Timer capture channels */ -typedef enum _ctimer_capture_channel -{ - kCTIMER_Capture_0 = 0U, /*!< Timer capture channel 0 */ - kCTIMER_Capture_1, /*!< Timer capture channel 1 */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) && FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) - kCTIMER_Capture_2, /*!< Timer capture channel 2 */ -#endif /* FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2 */ -#if defined(FSL_FEATURE_CTIMER_HAS_CCR_CAP3) && FSL_FEATURE_CTIMER_HAS_CCR_CAP3 - kCTIMER_Capture_3 /*!< Timer capture channel 3 */ -#endif /* FSL_FEATURE_CTIMER_HAS_CCR_CAP3 */ -} ctimer_capture_channel_t; - -/*! @brief List of capture edge options */ -typedef enum _ctimer_capture_edge -{ - kCTIMER_Capture_RiseEdge = 1U, /*!< Capture on rising edge */ - kCTIMER_Capture_FallEdge = 2U, /*!< Capture on falling edge */ - kCTIMER_Capture_BothEdge = 3U, /*!< Capture on rising and falling edge */ -} ctimer_capture_edge_t; - -/*! @brief List of Timer match registers */ -typedef enum _ctimer_match -{ - kCTIMER_Match_0 = 0U, /*!< Timer match register 0 */ - kCTIMER_Match_1, /*!< Timer match register 1 */ - kCTIMER_Match_2, /*!< Timer match register 2 */ - kCTIMER_Match_3 /*!< Timer match register 3 */ -} ctimer_match_t; - -/*! @brief List of external match */ -typedef enum _ctimer_external_match -{ - kCTIMER_External_Match_0 = (1UL << 0), /*!< External match 0 */ - kCTIMER_External_Match_1 = (1UL << 1), /*!< External match 1 */ - kCTIMER_External_Match_2 = (1UL << 2), /*!< External match 2 */ - kCTIMER_External_Match_3 = (1UL << 3) /*!< External match 3 */ -} ctimer_external_match_t; - -/*! @brief List of output control options */ -typedef enum _ctimer_match_output_control -{ - kCTIMER_Output_NoAction = 0U, /*!< No action is taken */ - kCTIMER_Output_Clear, /*!< Clear the EM bit/output to 0 */ - kCTIMER_Output_Set, /*!< Set the EM bit/output to 1 */ - kCTIMER_Output_Toggle /*!< Toggle the EM bit/output */ -} ctimer_match_output_control_t; - -/*! @brief List of Timer modes */ -typedef enum _ctimer_timer_mode -{ - kCTIMER_TimerMode = 0U, /* TC is incremented every rising APB bus clock edge */ - kCTIMER_IncreaseOnRiseEdge, /* TC is incremented on rising edge of input signal */ - kCTIMER_IncreaseOnFallEdge, /* TC is incremented on falling edge of input signal */ - kCTIMER_IncreaseOnBothEdge /* TC is incremented on both edges of input signal */ -} ctimer_timer_mode_t; - -/*! @brief List of Timer interrupts */ -typedef enum _ctimer_interrupt_enable -{ - kCTIMER_Match0InterruptEnable = CTIMER_MCR_MR0I_MASK, /*!< Match 0 interrupt */ - kCTIMER_Match1InterruptEnable = CTIMER_MCR_MR1I_MASK, /*!< Match 1 interrupt */ - kCTIMER_Match2InterruptEnable = CTIMER_MCR_MR2I_MASK, /*!< Match 2 interrupt */ - kCTIMER_Match3InterruptEnable = CTIMER_MCR_MR3I_MASK, /*!< Match 3 interrupt */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && (FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE)) - kCTIMER_Capture0InterruptEnable = CTIMER_CCR_CAP0I_MASK, /*!< Capture 0 interrupt */ - kCTIMER_Capture1InterruptEnable = CTIMER_CCR_CAP1I_MASK, /*!< Capture 1 interrupt */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) && FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) - kCTIMER_Capture2InterruptEnable = CTIMER_CCR_CAP2I_MASK, /*!< Capture 2 interrupt */ -#endif /* FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2 */ -#if defined(FSL_FEATURE_CTIMER_HAS_CCR_CAP3) && FSL_FEATURE_CTIMER_HAS_CCR_CAP3 - kCTIMER_Capture3InterruptEnable = CTIMER_CCR_CAP3I_MASK, /*!< Capture 3 interrupt */ -#endif /* FSL_FEATURE_CTIMER_HAS_CCR_CAP3 */ -#endif -} ctimer_interrupt_enable_t; - -/*! @brief List of Timer flags */ -typedef enum _ctimer_status_flags -{ - kCTIMER_Match0Flag = CTIMER_IR_MR0INT_MASK, /*!< Match 0 interrupt flag */ - kCTIMER_Match1Flag = CTIMER_IR_MR1INT_MASK, /*!< Match 1 interrupt flag */ - kCTIMER_Match2Flag = CTIMER_IR_MR2INT_MASK, /*!< Match 2 interrupt flag */ - kCTIMER_Match3Flag = CTIMER_IR_MR3INT_MASK, /*!< Match 3 interrupt flag */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && (FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE)) - kCTIMER_Capture0Flag = CTIMER_IR_CR0INT_MASK, /*!< Capture 0 interrupt flag */ - kCTIMER_Capture1Flag = CTIMER_IR_CR1INT_MASK, /*!< Capture 1 interrupt flag */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_IR_CR2INT) && FSL_FEATURE_CTIMER_HAS_NO_IR_CR2INT) - kCTIMER_Capture2Flag = CTIMER_IR_CR2INT_MASK, /*!< Capture 2 interrupt flag */ -#endif /* FSL_FEATURE_CTIMER_HAS_NO_IR_CR2INT */ -#if defined(FSL_FEATURE_CTIMER_HAS_IR_CR3INT) && FSL_FEATURE_CTIMER_HAS_IR_CR3INT - kCTIMER_Capture3Flag = CTIMER_IR_CR3INT_MASK, /*!< Capture 3 interrupt flag */ -#endif /* FSL_FEATURE_CTIMER_HAS_IR_CR3INT */ -#endif -} ctimer_status_flags_t; - -typedef void (*ctimer_callback_t)(uint32_t flags); - -/*! @brief Callback type when registering for a callback. When registering a callback - * an array of function pointers is passed the size could be 1 or 8, the callback - * type will tell that. - */ -typedef enum -{ - kCTIMER_SingleCallback, /*!< Single Callback type where there is only one callback for the timer. - based on the status flags different channels needs to be handled differently */ - kCTIMER_MultipleCallback /*!< Multiple Callback type where there can be 8 valid callbacks, one per channel. - for both match/capture */ -} ctimer_callback_type_t; - -/*! - * @brief Match configuration - * - * This structure holds the configuration settings for each match register. - */ -typedef struct _ctimer_match_config -{ - uint32_t matchValue; /*!< This is stored in the match register */ - bool enableCounterReset; /*!< true: Match will reset the counter - false: Match will not reser the counter */ - bool enableCounterStop; /*!< true: Match will stop the counter - false: Match will not stop the counter */ - ctimer_match_output_control_t outControl; /*!< Action to be taken on a match on the EM bit/output */ - bool outPinInitState; /*!< Initial value of the EM bit/output */ - bool enableInterrupt; /*!< true: Generate interrupt upon match - false: Do not generate interrupt on match */ - -} ctimer_match_config_t; - -/*! - * @brief Timer configuration structure - * - * This structure holds the configuration settings for the Timer peripheral. To initialize this - * structure to reasonable defaults, call the CTIMER_GetDefaultConfig() function and pass a - * pointer to the configuration structure instance. - * - * The configuration structure can be made constant so as to reside in flash. - */ -typedef struct _ctimer_config -{ - ctimer_timer_mode_t mode; /*!< Timer mode */ - ctimer_capture_channel_t input; /*!< Input channel to increment the timer, used only in timer - modes that rely on this input signal to increment TC */ - uint32_t prescale; /*!< Prescale value */ -} ctimer_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Ungates the clock and configures the peripheral for basic operation. - * - * @note This API should be called at the beginning of the application before using the driver. - * - * @param base Ctimer peripheral base address - * @param config Pointer to the user configuration structure. - */ -void CTIMER_Init(CTIMER_Type *base, const ctimer_config_t *config); - -/*! - * @brief Gates the timer clock. - * - * @param base Ctimer peripheral base address - */ -void CTIMER_Deinit(CTIMER_Type *base); - -/*! - * @brief Fills in the timers configuration structure with the default settings. - * - * The default values are: - * @code - * config->mode = kCTIMER_TimerMode; - * config->input = kCTIMER_Capture_0; - * config->prescale = 0; - * @endcode - * @param config Pointer to the user configuration structure. - */ -void CTIMER_GetDefaultConfig(ctimer_config_t *config); - -/*! @}*/ - -/*! - * @name PWM setup operations - * @{ - */ - -/*! - * @brief Configures the PWM signal parameters. - * - * Enables PWM mode on the match channel passed in and will then setup the match value - * and other match parameters to generate a PWM signal. - * This function can manually assign the specified channel to set the PWM cycle. - * - * @note When setting PWM output from multiple output pins, all should use the same PWM - * period - * - * @param base Ctimer peripheral base address - * @param pwmPeriodChannel Specify the channel to control the PWM period - * @param matchChannel Match pin to be used to output the PWM signal - * @param pwmPeriod PWM period match value - * @param pulsePeriod Pulse width match value - * @param enableInt Enable interrupt when the timer value reaches the match value of the PWM pulse, - * if it is 0 then no interrupt will be generated. - */ -status_t CTIMER_SetupPwmPeriod(CTIMER_Type *base, - const ctimer_match_t pwmPeriodChannel, - ctimer_match_t matchChannel, - uint32_t pwmPeriod, - uint32_t pulsePeriod, - bool enableInt); - -/*! - * @brief Configures the PWM signal parameters. - * - * Enables PWM mode on the match channel passed in and will then setup the match value - * and other match parameters to generate a PWM signal. - * This function can manually assign the specified channel to set the PWM cycle. - * - * @note When setting PWM output from multiple output pins, all should use the same PWM - * frequency. Please use CTIMER_SetupPwmPeriod to set up the PWM with high resolution. - * - * @param base Ctimer peripheral base address - * @param pwmPeriodChannel Specify the channel to control the PWM period - * @param matchChannel Match pin to be used to output the PWM signal - * @param dutyCyclePercent PWM pulse width; the value should be between 0 to 100 - * @param pwmFreq_Hz PWM signal frequency in Hz - * @param srcClock_Hz Timer counter clock in Hz - * @param enableInt Enable interrupt when the timer value reaches the match value of the PWM pulse, - * if it is 0 then no interrupt will be generated. - */ -status_t CTIMER_SetupPwm(CTIMER_Type *base, - const ctimer_match_t pwmPeriodChannel, - ctimer_match_t matchChannel, - uint8_t dutyCyclePercent, - uint32_t pwmFreq_Hz, - uint32_t srcClock_Hz, - bool enableInt); - -/*! - * @brief Updates the pulse period of an active PWM signal. - * - * @param base Ctimer peripheral base address - * @param matchChannel Match pin to be used to output the PWM signal - * @param pulsePeriod New PWM pulse width match value - */ -static inline void CTIMER_UpdatePwmPulsePeriod(CTIMER_Type *base, ctimer_match_t matchChannel, uint32_t pulsePeriod) -{ - /* Update PWM pulse period match value */ - base->MR[matchChannel] = pulsePeriod; -} - -/*! - * @brief Updates the duty cycle of an active PWM signal. - * - * @note Please use CTIMER_SetupPwmPeriod to update the PWM with high resolution. - * This function can manually assign the specified channel to set the PWM cycle. - * - * @param base Ctimer peripheral base address - * @param pwmPeriodChannel Specify the channel to control the PWM period - * @param matchChannel Match pin to be used to output the PWM signal - * @param dutyCyclePercent New PWM pulse width; the value should be between 0 to 100 - */ -void CTIMER_UpdatePwmDutycycle(CTIMER_Type *base, - const ctimer_match_t pwmPeriodChannel, - ctimer_match_t matchChannel, - uint8_t dutyCyclePercent); - -/*! @}*/ - -/*! - * @brief Setup the match register. - * - * User configuration is used to setup the match value and action to be taken when a match occurs. - * - * @param base Ctimer peripheral base address - * @param matchChannel Match register to configure - * @param config Pointer to the match configuration structure - */ -void CTIMER_SetupMatch(CTIMER_Type *base, ctimer_match_t matchChannel, const ctimer_match_config_t *config); - -/*! - * @brief Get the status of output match. - * - * This function gets the status of output MAT, whether or not this output is connected to a pin. - * This status is driven to the MAT pins if the match function is selected via IOCON. 0 = LOW. 1 = HIGH. - * - * @param base Ctimer peripheral base address - * @param matchChannel External match channel, user can obtain the status of multiple match channels - * at the same time by using the logic of "|" - * enumeration ::ctimer_external_match_t - * @return The mask of external match channel status flags. Users need to use the - * _ctimer_external_match type to decode the return variables. - */ -uint32_t CTIMER_GetOutputMatchStatus(CTIMER_Type *base, uint32_t matchChannel); - -/*! - * @brief Setup the capture. - * - * @param base Ctimer peripheral base address - * @param capture Capture channel to configure - * @param edge Edge on the channel that will trigger a capture - * @param enableInt Flag to enable channel interrupts, if enabled then the registered call back - * is called upon capture - */ -void CTIMER_SetupCapture(CTIMER_Type *base, - ctimer_capture_channel_t capture, - ctimer_capture_edge_t edge, - bool enableInt); - -/*! - * @brief Get the timer count value from TC register. - * - * @param base Ctimer peripheral base address. - * @return return the timer count value. - */ -static inline uint32_t CTIMER_GetTimerCountValue(CTIMER_Type *base) -{ - return (base->TC); -} - -/*! - * @brief Register callback. - * - * @param base Ctimer peripheral base address - * @param cb_func callback function - * @param cb_type callback function type, singular or multiple - */ -void CTIMER_RegisterCallBack(CTIMER_Type *base, ctimer_callback_t *cb_func, ctimer_callback_type_t cb_type); - -/*! - * @name Interrupt Interface - * @{ - */ - -/*! - * @brief Enables the selected Timer interrupts. - * - * @param base Ctimer peripheral base address - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::ctimer_interrupt_enable_t - */ -static inline void CTIMER_EnableInterrupts(CTIMER_Type *base, uint32_t mask) -{ - /* Enable match interrupts */ - base->MCR |= mask & (CTIMER_MCR_MR0I_MASK | CTIMER_MCR_MR1I_MASK | CTIMER_MCR_MR2I_MASK | CTIMER_MCR_MR3I_MASK); - -/* Enable capture interrupts */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && (FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE)) - base->CCR |= mask & (CTIMER_CCR_CAP0I_MASK | CTIMER_CCR_CAP1I_MASK -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) && FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) - | CTIMER_CCR_CAP2I_MASK -#endif /* FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2 */ -#if defined(FSL_FEATURE_CTIMER_HAS_CCR_CAP3) && FSL_FEATURE_CTIMER_HAS_CCR_CAP3 - | CTIMER_CCR_CAP3I_MASK -#endif /* FSL_FEATURE_CTIMER_HAS_CCR_CAP3 */ - ); -#endif -} - -/*! - * @brief Disables the selected Timer interrupts. - * - * @param base Ctimer peripheral base address - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::ctimer_interrupt_enable_t - */ -static inline void CTIMER_DisableInterrupts(CTIMER_Type *base, uint32_t mask) -{ - /* Disable match interrupts */ - base->MCR &= ~(mask & (CTIMER_MCR_MR0I_MASK | CTIMER_MCR_MR1I_MASK | CTIMER_MCR_MR2I_MASK | CTIMER_MCR_MR3I_MASK)); - -/* Disable capture interrupts */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && (FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE)) - base->CCR &= ~(mask & (CTIMER_CCR_CAP0I_MASK | CTIMER_CCR_CAP1I_MASK -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) && FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) - | CTIMER_CCR_CAP2I_MASK -#endif /* FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2 */ -#if defined(FSL_FEATURE_CTIMER_HAS_CCR_CAP3) && FSL_FEATURE_CTIMER_HAS_CCR_CAP3 - | CTIMER_CCR_CAP3I_MASK -#endif /* FSL_FEATURE_CTIMER_HAS_CCR_CAP3 */ - )); -#endif -} - -/*! - * @brief Gets the enabled Timer interrupts. - * - * @param base Ctimer peripheral base address - * - * @return The enabled interrupts. This is the logical OR of members of the - * enumeration ::ctimer_interrupt_enable_t - */ -static inline uint32_t CTIMER_GetEnabledInterrupts(CTIMER_Type *base) -{ - uint32_t enabledIntrs = 0; - - /* Get all the match interrupts enabled */ - enabledIntrs = - base->MCR & (CTIMER_MCR_MR0I_MASK | CTIMER_MCR_MR1I_MASK | CTIMER_MCR_MR2I_MASK | CTIMER_MCR_MR3I_MASK); - -/* Get all the capture interrupts enabled */ -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE) && (FSL_FEATURE_CTIMER_HAS_NO_INPUT_CAPTURE)) - enabledIntrs |= base->CCR & (CTIMER_CCR_CAP0I_MASK | CTIMER_CCR_CAP1I_MASK -#if !(defined(FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) && FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2) - | CTIMER_CCR_CAP2I_MASK -#endif /* FSL_FEATURE_CTIMER_HAS_NO_CCR_CAP2 */ -#if defined(FSL_FEATURE_CTIMER_HAS_CCR_CAP3) && FSL_FEATURE_CTIMER_HAS_CCR_CAP3 - | CTIMER_CCR_CAP3I_MASK -#endif /* FSL_FEATURE_CTIMER_HAS_CCR_CAP3 */ - ); -#endif - - return enabledIntrs; -} - -/*! @}*/ - -/*! - * @name Status Interface - * @{ - */ - -/*! - * @brief Gets the Timer status flags. - * - * @param base Ctimer peripheral base address - * - * @return The status flags. This is the logical OR of members of the - * enumeration ::ctimer_status_flags_t - */ -static inline uint32_t CTIMER_GetStatusFlags(CTIMER_Type *base) -{ - return base->IR; -} - -/*! - * @brief Clears the Timer status flags. - * - * @param base Ctimer peripheral base address - * @param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::ctimer_status_flags_t - */ -static inline void CTIMER_ClearStatusFlags(CTIMER_Type *base, uint32_t mask) -{ - base->IR = mask; -} - -/*! @}*/ - -/*! - * @name Counter Start and Stop - * @{ - */ - -/*! - * @brief Starts the Timer counter. - * - * @param base Ctimer peripheral base address - */ -static inline void CTIMER_StartTimer(CTIMER_Type *base) -{ - base->TCR |= CTIMER_TCR_CEN_MASK; -} - -/*! - * @brief Stops the Timer counter. - * - * @param base Ctimer peripheral base address - */ -static inline void CTIMER_StopTimer(CTIMER_Type *base) -{ - base->TCR &= ~CTIMER_TCR_CEN_MASK; -} - -/*! @}*/ - -/*! - * @brief Reset the counter. - * - * The timer counter and prescale counter are reset on the next positive edge of the APB clock. - * - * @param base Ctimer peripheral base address - */ -static inline void CTIMER_Reset(CTIMER_Type *base) -{ - base->TCR |= CTIMER_TCR_CRST_MASK; - base->TCR &= ~CTIMER_TCR_CRST_MASK; -} - -/*! - * @brief Setup the timer prescale value. - * - * Specifies the maximum value for the Prescale Counter. - * - * @param base Ctimer peripheral base address - * @param prescale Prescale value - */ -static inline void CTIMER_SetPrescale(CTIMER_Type *base, uint32_t prescale) -{ - base->PR = CTIMER_PR_PRVAL(prescale); -} - -/*! - * @brief Get capture channel value. - * - * Get the counter/timer value on the corresponding capture channel. - * - * @param base Ctimer peripheral base address - * @param capture Select capture channel - * - * @return The timer count capture value. - */ -static inline uint32_t CTIMER_GetCaptureValue(CTIMER_Type *base, ctimer_capture_channel_t capture) -{ - return base->CR[capture]; -} - -/*! - * @brief Enable reset match channel. - * - * Set the specified match channel reset operation. - * - * @param base Ctimer peripheral base address - * @param match match channel used - * @param enable Enable match channel reset operation. - */ -static inline void CTIMER_EnableResetMatchChannel(CTIMER_Type *base, ctimer_match_t match, bool enable) -{ - if (enable) - { - base->MCR |= (1UL << (CTIMER_MCR_MR0R_SHIFT + ((uint32_t)match * 3U))); - } - else - { - base->MCR &= ~(1UL << (CTIMER_MCR_MR0R_SHIFT + ((uint32_t)match * 3U))); - } -} - -/*! - * @brief Enable stop match channel. - * - * Set the specified match channel stop operation. - * - * @param base Ctimer peripheral base address. - * @param match match channel used. - * @param enable Enable match channel stop operation. - */ -static inline void CTIMER_EnableStopMatchChannel(CTIMER_Type *base, ctimer_match_t match, bool enable) -{ - if (enable) - { - base->MCR |= (1UL << (CTIMER_MCR_MR0S_SHIFT + ((uint32_t)match * 3U))); - } - else - { - base->MCR &= ~(1UL << (CTIMER_MCR_MR0S_SHIFT + ((uint32_t)match * 3U))); - } -} - -#if (defined(FSL_FEATURE_CTIMER_HAS_MSR) && (FSL_FEATURE_CTIMER_HAS_MSR)) -/*! - * @brief Enable reload channel falling edge. - * - * Enable the specified match channel reload match shadow value. - * - * @param base Ctimer peripheral base address. - * @param match match channel used. - * @param enable Enable . - */ -static inline void CTIMER_EnableMatchChannelReload(CTIMER_Type *base, ctimer_match_t match, bool enable) -{ - if (enable) - { - base->MCR |= (1UL << (CTIMER_MCR_MR0RL_SHIFT + (uint32_t)match)); - } - else - { - base->MCR &= ~(1UL << (CTIMER_MCR_MR0RL_SHIFT + (uint32_t)match)); - } -} -#endif /* FSL_FEATURE_CTIMER_HAS_MSR */ - -/*! - * @brief Enable capture channel rising edge. - * - * Sets the specified capture channel for rising edge capture. - * - * @param base Ctimer peripheral base address. - * @param capture capture channel used. - * @param enable Enable rising edge capture. - */ -static inline void CTIMER_EnableRisingEdgeCapture(CTIMER_Type *base, ctimer_capture_channel_t capture, bool enable) -{ - if (enable) - { - base->CCR |= (1UL << (CTIMER_CCR_CAP0RE_SHIFT + ((uint32_t)capture * 3U))); - } - else - { - base->CCR &= ~(1UL << (CTIMER_CCR_CAP0RE_SHIFT + ((uint32_t)capture * 3U))); - } -} - -/*! - * @brief Enable capture channel falling edge. - * - * Sets the specified capture channel for falling edge capture. - * - * @param base Ctimer peripheral base address. - * @param capture capture channel used. - * @param enable Enable falling edge capture. - */ -static inline void CTIMER_EnableFallingEdgeCapture(CTIMER_Type *base, ctimer_capture_channel_t capture, bool enable) -{ - if (enable) - { - base->CCR |= (1UL << (CTIMER_CCR_CAP0FE_SHIFT + ((uint32_t)capture * 3U))); - } - else - { - base->CCR &= ~(1UL << (CTIMER_CCR_CAP0FE_SHIFT + ((uint32_t)capture * 3U))); - } -} - -#if (defined(FSL_FEATURE_CTIMER_HAS_MSR) && (FSL_FEATURE_CTIMER_HAS_MSR)) -/*! - * @brief Set the specified match shadow channel. - * - * @param base Ctimer peripheral base address. - * @param match match channel used. - * @param matchvalue Reload the value of the corresponding match register. - */ -static inline void CTIMER_SetShadowValue(CTIMER_Type *base, ctimer_match_t match, uint32_t matchvalue) -{ - base->MSR[match] = matchvalue; -} -#endif /* FSL_FEATURE_CTIMER_HAS_MSR */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_CTIMER_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_dac.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_dac.c deleted file mode 100644 index 09845018deb..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_dac.c +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2019, 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_dac.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.dac_1" -#endif - -#if defined(DAC_RSTS) -#define DAC_RESETS_ARRAY DAC_RSTS -#elif defined(DAC_RSTS_N) -#define DAC_RESETS_ARRAY DAC_RSTS_N -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Get instance number for DAC module. - * - * @param base DAC peripheral base address - */ -static uint32_t DAC_GetInstance(LPDAC_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to DAC bases for each instance. */ -static LPDAC_Type *const s_dacBases[] = LPDAC_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to DAC clocks for each instance. */ -static const clock_ip_name_t s_dacClocks[] = LPDAC_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(DAC_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_dacResets[] = DAC_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t DAC_GetInstance(LPDAC_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_dacBases); instance++) - { - if (s_dacBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_dacBases)); - - return instance; -} - -/*! - * brief Initialize the DAC module with common configuartion. - * - * The clock will be enabled in this function. - * - * param base DAC peripheral base address. - * param config Pointer to configuration structure. - */ -void DAC_Init(LPDAC_Type *base, const dac_config_t *config) -{ - assert(NULL != config); - - uint32_t tmp32 = 0U; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock. */ - CLOCK_EnableClock(s_dacClocks[DAC_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(DAC_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_dacResets[DAC_GetInstance(base)]); -#endif - - /* Reset the logic. */ - DAC_SetReset(base, kDAC_ResetLogic); - DAC_ClearReset(base, kDAC_ResetLogic); - - /* Reset the FIFO. */ - DAC_SetReset(base, kDAC_ResetFIFO); - DAC_ClearReset(base, kDAC_ResetFIFO); - - /* Configuration. */ - if (kDAC_FIFOTriggerBySoftwareMode == config->fifoTriggerMode) - { - tmp32 |= LPDAC_GCR_TRGSEL_MASK; /* Software trigger. */ - } - switch (config->fifoWorkMode) - { - case kDAC_FIFOWorkAsNormalMode: /* Normal FIFO. */ - tmp32 |= LPDAC_GCR_FIFOEN_MASK; - break; - case kDAC_FIFOWorkAsSwingMode: - tmp32 |= LPDAC_GCR_FIFOEN_MASK | LPDAC_GCR_SWMD_MASK; /* Enable swing mode. */ - break; -#if defined(FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE) && FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE - case kDAC_FIFOWorkAsPeriodTriggerMode: - tmp32 |= LPDAC_GCR_FIFOEN_MASK | LPDAC_GCR_PTGEN_MASK; /* Enable period trigger mode. */ - /* Set trigger number and width. */ - base->PCR = - LPDAC_PCR_PTG_NUM(config->periodicTriggerNumber) | LPDAC_PCR_PTG_PERIOD(config->periodicTriggerWidth); - break; - case kDAC_FIFOWorkAsPeriodTriggerAndSwingMode: - tmp32 |= LPDAC_GCR_FIFOEN_MASK | LPDAC_GCR_PTGEN_MASK | LPDAC_GCR_SWMD_MASK; - /* Set trigger number and width. */ - base->PCR = - LPDAC_PCR_PTG_NUM(config->periodicTriggerNumber) | LPDAC_PCR_PTG_PERIOD(config->periodicTriggerWidth); - break; -#endif /* FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE */ - default: /* kDAC_FIFODisabled. */ - break; - } - -#if defined(FSL_FEATURE_LPDAC_HAS_GCR_RCV_TRG) && FSL_FEATURE_LPDAC_HAS_GCR_RCV_TRG - if (config->enableExternalTriggerSource) - { - tmp32 |= LPDAC_GCR_RCV_TRG_MASK; /* Use trigger source from another DAC. */ - } -#endif /* FSL_FEATURE_LPDAC_HAS_GCR_RCV_TRG */ -#if defined(FSL_FEATURE_LPDAC_HAS_GCR_BUF_SPD_CTRL) && FSL_FEATURE_LPDAC_HAS_GCR_BUF_SPD_CTRL - if (false == config->enableLowerLowPowerMode) - { - tmp32 |= LPDAC_GCR_BUF_SPD_CTRL_MASK; /* Enable low power. */ - } -#else - if (config->enableLowPowerMode) - { - tmp32 |= LPDAC_GCR_LPEN_MASK; /* Enable low power. */ - } -#endif /* LPDAC_GCR_BUF_SPD_CTRL_MASK */ - -#if defined(FSL_FEATURE_LPDAC_HAS_GCR_BUF_EN) && FSL_FEATURE_LPDAC_HAS_GCR_BUF_EN - tmp32 |= LPDAC_GCR_BUF_EN_MASK; /* Opamp is used as buffer. */ -#endif /* FSL_FEATURE_LPDAC_HAS_GCR_BUF_EN */ -#if defined(FSL_FEATURE_LPDAC_HAS_GCR_LATCH_CYC) && FSL_FEATURE_LPDAC_HAS_GCR_LATCH_CYC - /* Configure DAC sync cycles. */ - tmp32 |= LPDAC_GCR_LATCH_CYC(config->syncTime); -#endif /* FSL_FEATURE_LPDAC_HAS_GCR_LATCH_CYC */ -#if defined(FSL_FEATURE_LPDAC_HAS_INTERNAL_REFERENCE_CURRENT) && FSL_FEATURE_LPDAC_HAS_INTERNAL_REFERENCE_CURRENT - tmp32 |= (uint32_t)config->referenceCurrentSource; -#endif /* FSL_FEATURE_LPDAC_HAS_INTERNAL_REFERENCE_CURRENT */ - /* Set reference voltage source. */ - tmp32 |= LPDAC_GCR_DACRFS(config->referenceVoltageSource); - - base->GCR = tmp32; - base->FCR = LPDAC_FCR_WML(config->fifoWatermarkLevel); - - /* Now, the DAC is disabled. It needs to be enabled in application. */ -} - -/*! - * brief Get the default settings for initialization's configuration. - * - * This function initializes the user configuration structure to a default value. The default values are: - * code - * config->fifoWatermarkLevel = 0U; - * config->fifoTriggerMode = kDAC_FIFOTriggerByHardwareMode; - * config->fifoWorkMode = kDAC_FIFODisabled; - * config->enableLowPowerMode = false; - * config->referenceVoltageSource = kDAC_ReferenceVoltageSourceAlt1; - * endcode - * - * param config Pointer to configuration structure. - * param - */ -void DAC_GetDefaultConfig(dac_config_t *config) -{ - assert(config != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->fifoWatermarkLevel = 0U; - config->fifoTriggerMode = kDAC_FIFOTriggerByHardwareMode; - config->fifoWorkMode = kDAC_FIFODisabled; - -#if defined(FSL_FEATURE_LPDAC_HAS_GCR_RCV_TRG) && FSL_FEATURE_LPDAC_HAS_GCR_RCV_TRG - config->enableExternalTriggerSource = false; -#endif /* FSL_FEATURE_LPDAC_HAS_GCR_RCV_TRG */ -#if defined(FSL_FEATURE_LPDAC_HAS_GCR_BUF_SPD_CTRL) && FSL_FEATURE_LPDAC_HAS_GCR_BUF_SPD_CTRL - config->enableLowerLowPowerMode = true; -#else - config->enableLowPowerMode = false; -#endif /* FSL_FEATURE_LPDAC_HAS_GCR_BUF_SPD_CTRL */ -#if defined(FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE) && FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE - config->periodicTriggerNumber = 0UL; - config->periodicTriggerWidth = 0UL; -#endif /* FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE */ -#if defined(FSL_FEATURE_LPDAC_HAS_GCR_LATCH_CYC) && FSL_FEATURE_LPDAC_HAS_GCR_LATCH_CYC - /* Configure DAC sync cycles. */ - config->syncTime = 1U; -#endif /* FSL_FEATURE_LPDAC_HAS_GCR_LATCH_CYC */ -#if defined(FSL_FEATURE_LPDAC_HAS_INTERNAL_REFERENCE_CURRENT) && FSL_FEATURE_LPDAC_HAS_INTERNAL_REFERENCE_CURRENT - config->referenceCurrentSource = kDAC_ReferenceCurrentSourcePtat; -#endif /* FSL_FEATURE_LPDAC_HAS_INTERNAL_REFERENCE_CURRENT */ - config->referenceVoltageSource = kDAC_ReferenceVoltageSourceAlt1; -} - -/*! - * brief De-initialize the DAC module. - * - * The clock will be disabled in this function. - * - * param base DAC peripheral base address. - * param - */ -void DAC_Deinit(LPDAC_Type *base) -{ - /* Disable the module. */ - DAC_Enable(base, false); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable the clock. */ - CLOCK_DisableClock(s_dacClocks[DAC_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_dac.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_dac.h deleted file mode 100644 index 5dcecf2db57..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_dac.h +++ /dev/null @@ -1,442 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2020, 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_DAC_H_ -#define FSL_DAC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup dac - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief DAC driver version 2.1.2. */ -#define FSL_DAC_DRIVER_VERSION (MAKE_VERSION(2, 1, 2)) -/*! @} */ - -/*! - * @brief DAC reset control. - */ -enum -{ - kDAC_ResetFIFO = LPDAC_RCR_FIFORST_MASK, /*!< Resets the FIFO pointers and flags. */ - kDAC_ResetLogic = LPDAC_RCR_SWRST_MASK, /*!< Resets all DAC registers and internal logic. */ -}; - -/*! - * @brief DAC interrupts. - */ -enum -{ - kDAC_FIFOFullInterruptEnable = LPDAC_IER_FULL_IE_MASK, /*!< FIFO full interrupt enable. */ - kDAC_FIFOEmptyInterruptEnable = LPDAC_IER_EMPTY_IE_MASK, /*!< FIFO empty interrupt enable. */ - kDAC_FIFOWatermarkInterruptEnable = LPDAC_IER_WM_IE_MASK, /*!< FIFO watermark interrupt enable. */ - kDAC_SwingBackInterruptEnable = LPDAC_IER_SWBK_IE_MASK, /*!< Swing back one cycle complete interrupt enable. */ - kDAC_FIFOOverflowInterruptEnable = LPDAC_IER_OF_IE_MASK, /*!< FIFO overflow interrupt enable. */ - kDAC_FIFOUnderflowInterruptEnable = LPDAC_IER_UF_IE_MASK, /*!< FIFO underflow interrupt enable. */ -#if defined(FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE) && FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE - kDAC_PeriodTriggerCompleteInterruptEnable = - LPDAC_IER_PTGCOCO_IE_MASK, /*!< Period trigger mode conversion complete interrupt enable */ -#endif /* FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE */ -}; - -/*! - * @brief DAC DMA switchers. - */ -enum -{ - kDAC_FIFOEmptyDMAEnable = LPDAC_DER_EMPTY_DMAEN_MASK, /*!< FIFO empty DMA enable. */ - kDAC_FIFOWatermarkDMAEnable = LPDAC_DER_WM_DMAEN_MASK, /*!< FIFO watermark DMA enable. */ -}; - -/*! - * @brief DAC status flags. - */ -enum -{ - kDAC_FIFOUnderflowFlag = LPDAC_FSR_UF_MASK, /*!< This flag means that there is a new trigger after the buffer is -empty. The FIFO read pointer will not -increase in this case and the data sent to DAC analog conversion will not changed. This flag is cleared by writing a 1 -to it. */ - - kDAC_FIFOOverflowFlag = - LPDAC_FSR_OF_MASK, /*!< This flag indicates that data is intended to write into FIFO after the -buffer is full. The writer pointer will -not increase in this case. The extra data will not be written into the FIFO. This flag is cleared by writing a 1 to it. -*/ - - kDAC_FIFOSwingBackFlag = LPDAC_FSR_SWBK_MASK, /*!< This flag indicates that the DAC has completed one period of -conversion in swing back mode. It means -that the read pointer has increased to the top (write pointer) once and then decreased to zero once. For -example, after three data is written to FIFO, the writer pointer is now 3. Then, if continually triggered, the -read pointer will swing like: 0-1-2-1-0-1-2-, and so on. After the fourth trigger, the flag is set. This flag is -cleared by writing a 1 to it. */ - - kDAC_FIFOWatermarkFlag = LPDAC_FSR_WM_MASK, /*!< This field is set if the remaining data in FIFO is less than or - equal to the setting value of wartermark. By writing data into FIFO by DMA or CPU, this flag is - cleared automatically when the data in FIFO is more than the setting value of watermark. */ - - kDAC_FIFOEmptyFlag = LPDAC_FSR_EMPTY_MASK, /*!< FIFO empty flag. */ - kDAC_FIFOFullFlag = LPDAC_FSR_FULL_MASK, /*!< FIFO full flag. */ -#if defined(FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE) && FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE - kDAC_PeriodTriggerCompleteFlag = LPDAC_FSR_PTGCOCO_MASK, /*!< Period trigger mode conversion complete flag. */ -#endif /* FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE */ -}; - -/*! - * @brief DAC FIFO trigger mode. - */ -typedef enum _dac_fifo_trigger_mode -{ - kDAC_FIFOTriggerByHardwareMode = 0U, /*!< Buffer would be triggered by hardware. */ - kDAC_FIFOTriggerBySoftwareMode = 1U, /*!< Buffer would be triggered by software. */ -} dac_fifo_trigger_mode_t; - -/*! - * @brief DAC FIFO work mode. - */ -typedef enum _dac_fifo_work_mode -{ - kDAC_FIFODisabled = 0U, /*!< FIFO mode is disabled and buffer mode is enabled. Any data written to DATA[DATA] goes - to buffer then goes to conversion. */ - kDAC_FIFOWorkAsNormalMode = 1U, /*!< FIFO mode is enabled. Data will be first read from FIFO to buffer then goes to - conversion. */ - kDAC_FIFOWorkAsSwingMode = 2U, /*!< In swing mode, the read pointer swings between the writer pointer and zero. That - is, the trigger increases the read pointer till reach the writer pointer and - decreases the read pointer till zero, and so on. The FIFO empty/full/watermark - flag will not update during swing back mode. */ -#if defined(FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE) && FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE - kDAC_FIFOWorkAsPeriodTriggerMode = - 3U, /*!< In periodic trigger mode, user only needs to send the first trigger. Then after every [PTG_PERIOD+1] - RCLK cycles, DAC will be automatically triggered by internal trigger. There will be [PTG_NUM] internal - triggers, thus in total [PTG_NUM+1] conversions including the first trigger sent by user. User can - terminate the current conversion queue by clearing the GCR[PTGEN] bit. Then, after the current conversion - is completed, the conversion is terminated and the PTGCOCO flag is set. If PCR[PTG_NUM] is set to zero, - there will be infinite triggers following the first hardware/software trigger, until the GCR[PTGEN] is - cleared by software. In any case, the conversion can be terminated by FIFORST/SWRST. */ - kDAC_FIFOWorkAsPeriodTriggerAndSwingMode = 4U, /*!< Periodically trigger DAC and swing back. */ -#endif /* FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE */ -} dac_fifo_work_mode_t; - -/*! - * @brief DAC reference voltage source. - */ -typedef enum _dac_reference_voltage_source -{ -#if defined(FSL_FEATURE_ANALOG_NUM_OF_VREF_SRC) && (FSL_FEATURE_ANALOG_NUM_OF_VREF_SRC == 3) - kDAC_ReferenceVoltageSourceAlt1 = 0U, /*!< The DAC selects VDD_ANA as the reference voltage. */ - kDAC_ReferenceVoltageSourceAlt2 = 1U, /*!< The DAC selects VREF_OUT as the reference voltage. */ - kDAC_ReferenceVoltageSourceAlt3 = 2U, /*!< THe DAC selects VREFH as the reference voltage. */ -#else - kDAC_ReferenceVoltageSourceAlt1 = 0U, /*!< The DAC selects VREFH_INT as the reference voltage. */ - kDAC_ReferenceVoltageSourceAlt2 = 1U, /*!< The DAC selects VREFH_EXT as the reference voltage. */ -#endif /* FSL_FEATURE_ANALOG_NUM_OF_VREF_SRC */ -} dac_reference_voltage_source_t; - -#if defined(FSL_FEATURE_LPDAC_HAS_INTERNAL_REFERENCE_CURRENT) && FSL_FEATURE_LPDAC_HAS_INTERNAL_REFERENCE_CURRENT -/* - * @brief DAC internal reference current source - */ -typedef enum _dac_reference_current_source -{ - kDAC_ReferenceCurrentSourcePtat = LPDAC_GCR_IREF_PTAT_EXT_SEL_MASK, /* Internal PTAT Current Reference selected */ - kDAC_ReferenceCurrentSourceZtc = LPDAC_GCR_IREF_ZTC_EXT_SEL_MASK, /* Internal ZTC Current Reference selected */ -} dac_reference_current_source_t; -#endif /* FSL_FEATURE_LPDAC_HAS_INTERNAL_REFERENCE_CURRENT */ - -/*! - * @brief DAC configuration structure. - */ -typedef struct _dac_config -{ - uint32_t fifoWatermarkLevel; /*!< FIFO's watermark, the max value can be the hardware FIFO size. */ - dac_fifo_trigger_mode_t fifoTriggerMode; /*!< Select the trigger mode for FIFO. */ - dac_fifo_work_mode_t fifoWorkMode; /*!< Select the work mode for FIFO. */ -#if defined(FSL_FEATURE_LPDAC_HAS_GCR_BUF_EN) && FSL_FEATURE_LPDAC_HAS_GCR_BUF_EN - bool enableOpampBuffer; /*!< Opamp is used as buffer. */ -#endif /* FSL_FEATURE_LPDAC_HAS_GCR_BUF_EN */ -#if defined(FSL_FEATURE_LPDAC_HAS_GCR_RCV_TRG) && FSL_FEATURE_LPDAC_HAS_GCR_RCV_TRG - bool enableExternalTriggerSource; /* DAC uses another DAC's hardware/software trigger as its trigger source. */ -#endif /* FSL_FEATURE_LPDAC_HAS_GCR_RCV_TRG */ -#if defined(FSL_FEATURE_LPDAC_HAS_GCR_BUF_SPD_CTRL) && FSL_FEATURE_LPDAC_HAS_GCR_BUF_SPD_CTRL - bool enableLowerLowPowerMode; /*!< Enable the lower low power mode. */ -#else - bool enableLowPowerMode; /*!< Enable the low power mode. */ -#endif /* FSL_FEATURE_LPDAC_HAS_GCR_BUF_SPD_CTRL */ -#if defined(FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE) && FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE - uint32_t periodicTriggerNumber; /*!< There will be 'periodicTriggerNumber' internal triggers following the first - hardware/software trigger. So there will be 'periodicTriggerNumber + 1' - conversions in total. If set to zero, there will be infinite triggers following - the first hw/sw trigger, until the GCR[PTGEN] is cleared. */ - uint32_t periodicTriggerWidth; /*!< Control the periodic trigger frequency. There will be 'periodicTriggerWidth + 1' - RCLK cycles between each periodic trigger. The periodic trigger frequency should - be configured to not larger than the analog conversion speed. */ -#endif /* FSL_FEATURE_LPDAC_HAS_PERIODIC_TRIGGER_MODE */ -#if defined(FSL_FEATURE_LPDAC_HAS_GCR_LATCH_CYC) && FSL_FEATURE_LPDAC_HAS_GCR_LATCH_CYC - uint32_t syncTime; /*!< RCLK cycles before data latch. accessible range is 0-15. It is used to configure the DAC - sync cycles which is helpful to reduce glitch on the output. The sync time is (LATCH_CYC+1) - RCLK cycles. User should configure this register according to the RCLK frequency. The - recommended sync time is at least 40ns.*/ -#endif /* FSL_FEATURE_LPDAC_HAS_GCR_LATCH_CYC */ -#if defined(FSL_FEATURE_LPDAC_HAS_INTERNAL_REFERENCE_CURRENT) && FSL_FEATURE_LPDAC_HAS_INTERNAL_REFERENCE_CURRENT - dac_reference_current_source_t referenceCurrentSource; /*!< Select the internal reference current source. */ -#endif /* FSL_FEATURE_LPDAC_HAS_INTERNAL_REFERENCE_CURRENT */ - dac_reference_voltage_source_t referenceVoltageSource; /*!< Select the reference voltage source. */ -} dac_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and de-initialization - * @{ - */ - -/*! - * @brief Initialize the DAC module with common configuartion. - * - * The clock will be enabled in this function. - * - * @param base DAC peripheral base address. - * @param config Pointer to configuration structure. - */ -void DAC_Init(LPDAC_Type *base, const dac_config_t *config); - -/*! - * @brief Get the default settings for initialization's configuration. - * - * This function initializes the user configuration structure to a default value. The default values are: - * @code - * config->fifoWatermarkLevel = 0U; - * config->fifoTriggerMode = kDAC_FIFOTriggerByHardwareMode; - * config->fifoWorkMode = kDAC_FIFODisabled; - * config->enableLowPowerMode = false; - * config->referenceVoltageSource = kDAC_ReferenceVoltageSourceAlt1; - * @endcode - * - * @param config Pointer to configuration structure. - */ -void DAC_GetDefaultConfig(dac_config_t *config); - -/*! - * @brief De-initialize the DAC module. - * - * The clock will be disabled in this function. - * - * @param base DAC peripheral base address. - */ -void DAC_Deinit(LPDAC_Type *base); - -/*! - * @brief Assert the reset control to part hardware. - * - * This function is to assert the reset control to part hardware. Responding part hardware would remain reset untill - * cleared by software. - * - * @param base DAC peripheral base address. - * @param mask The reset control mask, see to _dac_reset_control_t. - */ -static inline void DAC_SetReset(LPDAC_Type *base, uint32_t mask) -{ - base->RCR |= mask; -} - -/*! - * @brief Clear the reset control to part hardware. - * - * This function is to clear the reset control to part hardware. Responding part hardware would work after the reset - * control is cleared by software. - * - * @param base DAC peripheral base address. - * @param mask The reset control mask, see to _dac_reset_control_t. - */ -static inline void DAC_ClearReset(LPDAC_Type *base, uint32_t mask) -{ - base->RCR &= ~mask; -} - -/*! - * @brief Enable the DAC hardware system or not. - * - * This function is to start the Programmable Reference Generator operation or not. - * - * @param base DAC peripheral base address. - * @param enable Assertion of indicated event. - */ -static inline void DAC_Enable(LPDAC_Type *base, bool enable) -{ - if (enable) - { - base->GCR |= LPDAC_GCR_DACEN_MASK; - } - else - { - base->GCR &= ~LPDAC_GCR_DACEN_MASK; - } -} - -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enable the interrupts. - * - * @param base DAC peripheral base address. - * @param mask Mask value of indicated interrupt events. See to _dac_interrupt_enable. - */ -static inline void DAC_EnableInterrupts(LPDAC_Type *base, uint32_t mask) -{ - base->IER |= mask; -} - -/*! - * @brief Disable the interrupts. - * - * @param base DAC peripheral base address. - * @param mask Mask value of indicated interrupt events. See to _dac_interrupt_enable. - */ -static inline void DAC_DisableInterrupts(LPDAC_Type *base, uint32_t mask) -{ - base->IER &= ~mask; -} - -/*! @} */ - -/*! - * @name DMA control - * @{ - */ - -/*! - * @brief Enable the DMA switchers or not. - * - * @param base DAC peripheral base address. - * @param mask Mask value of indicated DMA requeset. See to _dac_dma_enable. - * @param enable Enable the DMA or not. - */ -static inline void DAC_EnableDMA(LPDAC_Type *base, uint32_t mask, bool enable) -{ - if (enable) - { - base->DER |= mask; - } - else - { - base->DER &= ~mask; - } -} - -/*! @} */ - -/*! - * @name Status flags - * @{ - */ - -/*! - * @brief Get status flags of DAC module. - * - * @param base DAC peripheral base address. - * @return Mask value of status flags. See to _dac_status_flags. - */ -static inline uint32_t DAC_GetStatusFlags(LPDAC_Type *base) -{ - return base->FSR; -} - -/*! - * @brief Clear status flags of DAC module. - * - * @param base DAC peripheral base address. - * @param flags Mask value of status flags to be cleared. See to _dac_status_flags. - */ -static inline void DAC_ClearStatusFlags(LPDAC_Type *base, uint32_t flags) -{ - base->FSR = flags; -} - -/*! @} */ - -/*! - * @name Functional feature - * @{ - */ - -/*! - * @brief Set data into the entry of FIFO buffer. - * - * @param base DAC peripheral base address. - * @param value Setting value into FIFO buffer. - */ -static inline void DAC_SetData(LPDAC_Type *base, uint32_t value) -{ - base->DATA = LPDAC_DATA_DATA(value); -} - -/*! - * @brief Get the value of the FIFO write pointer. - * - * @param base DAC peripheral base address. - * @return Current value of the FIFO write pointer. - */ - -static inline uint32_t DAC_GetFIFOWritePointer(LPDAC_Type *base) -{ - return (LPDAC_FPR_FIFO_WPT_MASK & base->FPR) >> LPDAC_FPR_FIFO_WPT_SHIFT; -} - -/*! - * @brief Get the value of the FIFO read pointer. - * - * @param base DAC peripheral base address. - * @return Current value of the FIFO read pointer. - */ - -static inline uint32_t DAC_GetFIFOReadPointer(LPDAC_Type *base) -{ - return (LPDAC_FPR_FIFO_RPT_MASK & base->FPR) >> LPDAC_FPR_FIFO_RPT_SHIFT; -} - -/*! - * @brief Do software trigger to FIFO when in software mode. - * - * @param base DAC peripheral base address. - */ - -static inline void DAC_DoSoftwareTriggerFIFO(LPDAC_Type *base) -{ - base->TCR = LPDAC_TCR_SWTRG_MASK; -} - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ -#endif /* FSL_DAC12_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_dac14.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_dac14.c deleted file mode 100644 index cf3de2c06c3..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_dac14.c +++ /dev/null @@ -1,182 +0,0 @@ -/*! - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_dac14.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.dac14" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Get instance number for DAC14 module. - * - * @param base DAC14 peripheral base address - */ -static uint32_t DAC14_GetInstance(HPDAC_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to DAC14 bases for each instance. */ -static HPDAC_Type *const s_dac14Bases[] = HPDAC_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to DAC14 clocks for each instance. */ -static const clock_ip_name_t s_dac14Clocks[] = HPDAC_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t DAC14_GetInstance(HPDAC_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_dac14Bases); instance++) - { - if (s_dac14Bases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_dac14Bases)); - - return instance; -} - -/*! - * brief Initialize the DAC14 module with common configuartion. - * - * The clock will be enabled in this function. - * - * param base DAC14 peripheral base address. - * param config Pointer to configuration structure. - */ -void DAC14_Init(HPDAC_Type *base, const dac14_config_t *config) -{ - assert(NULL != config); - - uint32_t tmp32 = 0U; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock. */ - CLOCK_EnableClock(s_dac14Clocks[DAC14_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Software reset and FIFO reset. */ - DAC14_DoSoftwareReset(base); - DAC14_DoFIFOReset(base); - - /* Opamp is used as buffer. */ - if (config->enableOpampBuffer) - { - tmp32 |= HPDAC_GCR_BUF_EN_MASK; - } - /*Enable the DAC system.*/ - if (config->enableDAC) - { - tmp32 |= HPDAC_GCR_DACEN_MASK; - } - - if (config->WorkMode != kDAC14_BufferWorkMode) - { - /*Use software trigger source.*/ - if (kDAC14_SoftwareTriggerSource == config->TriggerSource) - { - tmp32 |= HPDAC_GCR_TRGSEL_MASK; - } - - if (config->WorkMode != kDAC14_SwingBackWorkMode) - { - if (config->WorkMode != kDAC14_PeriodTriggerAndSwingBackWorkMode) - { - /*Configurtion FIFO watermarklevel.*/ - base->FCR = HPDAC_FCR_WML(config->fifoWatermarkLevel); - - if (config->WorkMode == kDAC14_PeriodTriggerWorkMode) - { - tmp32 |= HPDAC_GCR_FIFOEN_MASK | HPDAC_GCR_PTGEN_MASK; /* Enable period trigger mode. */ - /* Set trigger number and width. */ - base->PCR = HPDAC_PCR_PTG_NUM(config->periodicTriggerNumber) | - HPDAC_PCR_PTG_PERIOD(config->periodicTriggerWidth); - } - else - { - tmp32 |= HPDAC_GCR_FIFOEN_MASK; /* Enable FIFO mode.*/ - } - } - else - { - /* Enable period trigger mode and swing back mode. */ - tmp32 |= HPDAC_GCR_FIFOEN_MASK | HPDAC_GCR_PTGEN_MASK | HPDAC_GCR_SWMD_MASK; - /* Set trigger number and width. */ - base->PCR = HPDAC_PCR_PTG_NUM(config->periodicTriggerNumber) | - HPDAC_PCR_PTG_PERIOD(config->periodicTriggerWidth); - } - } - else - { - tmp32 |= HPDAC_GCR_FIFOEN_MASK | HPDAC_GCR_SWMD_MASK; /* Enable swing mode. */ - } - } - base->GCR = tmp32; -} - -/*! - * brief Get the default settings for initialization's configuration. - * - * This function initializes the user configuration structure to a default value. The default values are: - * code - config->fifoWatermarkLevel = 0U; - config->TriggerSource = kDAC14_HardwareTriggerSource; - config->WorkMode = kDAC14_BufferWorkMode; - config->enableOpampBuffer = false; - config->enableADC = false; - config->periodicTriggerNumber = 0U; - config->periodicTriggerWidth = 0U; - * endcode - * - * param config Pointer to configuration structure. - */ -void DAC14_GetDefaultConfig(dac14_config_t *config) -{ - assert(config != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->fifoWatermarkLevel = 0U; - config->TriggerSource = kDAC14_HardwareTriggerSource; - config->WorkMode = kDAC14_BufferWorkMode; - config->enableOpampBuffer = false; - config->enableDAC = false; - config->periodicTriggerNumber = 0U; - config->periodicTriggerWidth = 0U; -} -/*! - * brief De-initialize the DAC14 module. - * - * The clock will be disabled in this function. - * - * param base DAC14 peripheral base address. - */ -void DAC14_Deinit(HPDAC_Type *base) -{ - /* Disable the module. */ - DAC14_Enable(base, false); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable the clock. */ - CLOCK_DisableClock(s_dac14Clocks[DAC14_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_dac14.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_dac14.h deleted file mode 100644 index a50fad8d1a5..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_dac14.h +++ /dev/null @@ -1,419 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_DAC14_H_ -#define FSL_DAC14_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup dac14 - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief DAC14 driver version 2.0.0. */ -#define FSL_DAC14_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) -/*! @} */ - -/*! - * @brief DAC14 interrupts enumeration. - */ -enum _dac14_interrupt_enable -{ - kDAC14_PeriodTriggerCompleteInterruptEnable = HPDAC_IER_PTGCOCO_IE_MASK, /*!< Period trigger mode conversion complete interrupt enable */ - kDAC14_FIFOUnderflowInterruptEnable = HPDAC_IER_UF_IE_MASK, /*!< FIFO underflow interrupt enable. */ - kDAC14_FIFOOverflowInterruptEnable = HPDAC_IER_OF_IE_MASK, /*!< FIFO overflow interrupt enable. */ - kDAC14_SwingBackInterruptEnable = HPDAC_IER_SWBK_IE_MASK, /*!< Swing back one cycle complete interrupt enable. */ - kDAC14_FIFOWatermarkInterruptEnable = HPDAC_IER_WM_IE_MASK, /*!< FIFO watermark interrupt enable. */ - kDAC14_FIFOEmptyInterruptEnable = HPDAC_IER_EMPTY_IE_MASK, /*!< FIFO empty interrupt enable. */ - kDAC14_FIFOFullInterruptEnable = HPDAC_IER_FULL_IE_MASK, /*!< FIFO full interrupt enable. */ -}; - -/*! - * @brief DAC14 DMA switchers. - */ -enum _dac14_dma_enable -{ - kDAC14_FIFOWatermarkDMAEnable = HPDAC_DER_WM_DMAEN_MASK, /*!< FIFO watermark DMA enable. */ - kDAC14_FIFOEmptyDMAEnable = HPDAC_DER_EMPTY_DMAEN_MASK, /*!< FIFO empty DMA enable. */ -}; - -/*! - * @brief DAC14 status flags. - */ -enum _dac14_status_flags -{ - kDAC14_PeriodTriggerCompleteFlag = HPDAC_FSR_PTGCOCO_MASK, /*!< Period trigger mode conversion complete flag. */ - kDAC14_FIFOUnderflowFlag = HPDAC_FSR_UF_MASK, /*!< This flag means that there is a new trigger after the buffer is empty. The FIFO read pointer will not increase in this case and the data sent to DAC analog conversion will not changed. This flag is cleared by writing a 1 - to it. */ - kDAC14_FIFOOverflowFlag = HPDAC_FSR_OF_MASK, /*!< This flag indicates that data is intended to write into FIFO after the buffer is full. The writer pointer will - not increase in this case. The extra data will not be written into the FIFO. This flag is cleared by writing a 1 to it. - */ - kDAC14_SwingBackCompleteFlag = HPDAC_FSR_SWBK_MASK, /*!< This flag indicates that the DAC has completed one period of conversion in swing back mode. It means that the read pointer has increased to the top (write pointer) once and then decreased to zero once. For - example, after three data is written to FIFO, the writer pointer is now 3. Then, if continually triggered, the - read pointer will swing like: 0-1-2-1-0-1-2-, and so on. After the fourth trigger, the flag is set. This flag is - cleared by writing a 1 to it. */ - kDAC14_FIFOWaterMarkFlag = HPDAC_FSR_WM_MASK, /*!< This field is set if the remaining data in FIFO is less than or - equal to the setting value of wartermark. By writing data into FIFO by DMA or CPU, this flag is - cleared automatically when the data in FIFO is more than the setting value of watermark. */ - kDAC14_FIFOEmptyFlag = HPDAC_FSR_EMPTY_MASK, /*!< FIFO empty flag, when CPU or DMA writes data to FIFO, this bit will automatically clear.*/ - kDAC14_FIFOFullFlag = HPDAC_FSR_FULL_MASK, /*!< FIFO full flag, when software trigger and hardware trigger read FIFO automatically clears this flag.*/ -}; - -/*! - * @brief DAC14 trigger source, include software and hardware. - */ -typedef enum _dac14_trigger_source -{ - kDAC14_HardwareTriggerSource = 0U, /*!< Trigger source selection hardware . */ - kDAC14_SoftwareTriggerSource = 1U, /*!< Trigger source selection software . */ -} dac14_trigger_source_t; - -/*! - * @brief DAC14 work mode. - */ -typedef enum _dac14_work_mode -{ - kDAC14_BufferWorkMode = 0U, /*!< FIFO mode is disabled and buffer mode is enabled. Any data written to DATA[DATA] goes - to buffer then goes to conversion. */ - kDAC14_FIFOWorkMode = 1U, /*!< FIFO mode is enabled. Data will be first read from FIFO to buffer then goes to - conversion. */ - kDAC14_SwingBackWorkMode = 2U, /*!< In swing mode, the read pointer swings between the writer pointer and zero. That - is, the trigger increases the read pointer till reach the writer pointer and - decreases the read pointer till zero, and so on. The FIFO empty/full/watermark - flag will not update during swing back mode. */ - kDAC14_PeriodTriggerWorkMode = 3U, /*!< In periodic trigger mode, user only needs to send the first trigger. Then after every [PTG_PERIOD+1] - RCLK cycles, DAC will be automatically triggered by internal trigger. There will be [PTG_NUM] internal - triggers, thus in total [PTG_NUM+1] conversions including the first trigger sent by user. User can - terminate the current conversion queue by clearing the GCR[PTGEN] bit. Then, after the current conversion - is completed, the conversion is terminated and the PTGCOCO flag is set. If PCR[PTG_NUM] is set to zero, - there will be infinite triggers following the first hardware/software trigger, until the GCR[PTGEN] is - cleared by software. In any case, the conversion can be terminated by FIFORST/SWRST. */ - kDAC14_PeriodTriggerAndSwingBackWorkMode = 4U, /*!< Periodically trigger DAC and swing back. */ -} dac14_work_mode_t; - -/*! - * @brief DAC14 configuration structure. - */ -typedef struct _dac14_config -{ - uint16_t periodicTriggerNumber; /*!< There will be 'periodicTriggerNumber' internal triggers following the first - hardware/software trigger. So there will be 'periodicTriggerNumber + 1' - conversions in total. If set to zero, there will be infinite triggers following - the first hw/sw trigger, until the GCR[PTGEN] is cleared. */ - uint16_t periodicTriggerWidth; /*!< Control the periodic trigger frequency. There will be 'periodicTriggerWidth + 1' - RCLK cycles between each periodic trigger. The periodic trigger frequency should - be configured to not larger than the analog conversion speed. */ - uint8_t fifoWatermarkLevel :5; /*!< FIFO's watermark, the max value can be the hardware FIFO size. */ - bool enableOpampBuffer :1; /*!< Opamp is used as buffer.*/ - bool enableDAC :1; /*!< Enable the DAC system.*/ - dac14_work_mode_t WorkMode; /*!< Select DAC work mode.*/ - dac14_trigger_source_t TriggerSource; /*!< Select DAC trigger source. */ -} dac14_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization And De-initialization - * @{ - */ - -/*! - * @brief Initialize the DAC14 module with common configuartion. - * - * The clock will be enabled in this function. - * - * @param base DAC14 peripheral base address. - * @param config Pointer to configuration structure. - */ -void DAC14_Init(HPDAC_Type *base, const dac14_config_t *config); - -/*! - * @brief Get the default settings for initialization's configuration. - * - * This function initializes the user configuration structure to a default value. The default values are: - * @code - config->fifoWatermarkLevel = 0U; - config->TriggerSource = kDAC14_HardwareTriggerSource; - config->WorkMode = kDAC14_BufferWorkMode; - config->enableOpampBuffer = false; - config->enableADC = false; - config->periodicTriggerNumber = 0U; - config->periodicTriggerWidth = 0U; - * @endcode - * - * @param config Pointer to configuration structure. - */ -void DAC14_GetDefaultConfig(dac14_config_t *config); - -/*! - * @brief De-initialize the DAC14 module. - * - * The clock will be disabled in this function. - * - * @param base DAC14 peripheral base address. - */ -void DAC14_Deinit(HPDAC_Type *base); - -/*! - * @brief Do software reset . - * - * This function is resets all DAC registers and internal logic. - * - * @param base DAC14 peripheral base address. - */ -static inline void DAC14_DoSoftwareReset(HPDAC_Type *base) -{ - base->RCR |= HPDAC_RCR_SWRST_MASK; - base->RCR &= ~HPDAC_RCR_SWRST_MASK; -} - -/*! - * @brief Do FIFO reset. - * - * This function is resets the FIFO pointers and flags in FIFO Status. - * - * @param base DAC14 peripheral base address. - */ -static inline void DAC14_DoFIFOReset(HPDAC_Type *base) -{ - base->RCR |= HPDAC_RCR_FIFORST_MASK; - base->RCR &= ~HPDAC_RCR_FIFORST_MASK; -} - -/*! - * @brief Abort DAC14 period trigger conversion sequence. - * - * This function is write 0 to PTGEN to terminate the current conversion sequence. - * - * @param base DAC14 peripheral base address. - */ -static inline void DAC14_AbortPeriodTriggerConvSequence(HPDAC_Type *base) -{ - base->GCR &= ~HPDAC_GCR_PTGEN_MASK; -} -/*! @} */ - -/*! - * @name DAC Control Interface - * @{ - */ - -/*! - * @brief Enable the DAC14 system. - * - * @param base DAC14 peripheral base address. - * @param enable true to enable and false to disable. - */ -static inline void DAC14_Enable(HPDAC_Type *base, bool enable) -{ - if (enable) - { - base->GCR |= HPDAC_GCR_DACEN_MASK; - } - else - { - base->GCR &= ~HPDAC_GCR_DACEN_MASK; - } -} -/*! @} */ - -/*! - * @name Swing Back Mode Control Interface - * @{ - */ - /*! - * @brief Enable swing back mode. - * - * @param base DAC14 peripheral base address. - * @param enable true to enable and false to disable. - */ -static inline void DAC14_EnableSwingBackMode(HPDAC_Type *base, bool enable) -{ - if (enable) - { - base->GCR |= HPDAC_GCR_SWMD_MASK; - } - else - { - base->GCR &= ~HPDAC_GCR_SWMD_MASK; - } -} -/*! @} */ - -/*! - * @name FIFO Mode Control Interface - * @{ - */ - /*! - * @brief Enable FIFO mode. - * - * @param base DAC14 peripheral base address. - * @param enable true to enable and false to disable. - */ -static inline void DAC14_EnableFIFOMode(HPDAC_Type *base, bool enable) -{ - if (enable) - { - base->GCR |= HPDAC_GCR_FIFOEN_MASK; - } - else - { - base->GCR &= ~HPDAC_GCR_FIFOEN_MASK; - } -} -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ -/*! - * @brief Enable the interrupts. - * - * @param base DAC14 peripheral base address. - * @param mask Mask value of indicated interrupt events, please see @ref _dac14_interrupt_enable for details. - */ -static inline void DAC14_EnableInterrupts(HPDAC_Type *base, uint32_t mask) -{ - base->IER |= mask; -} - -/*! - * @brief Disable the interrupts. - * - * @param base DAC14 peripheral base address. - * @param mask Mask value of indicated interrupt events, please see @ref _dac14_interrupt_enable for details. - */ -static inline void DAC14_DisableInterrupts(HPDAC_Type *base, uint32_t mask) -{ - base->IER &= ~mask; -} -/*! @} */ - -/*! - * @name DMA Control Interface - * @{ - */ -/*! - * @brief Enable the DMA switchers or not. - * - * @param base DAC14 peripheral base address. - * @param mask Mask value of indicated DMA requeset, please see @ref _dac14_dma_enable for details. - * @param enable true to enable and false to disable. - */ -static inline void DAC14_EnableDMA(HPDAC_Type *base, uint32_t mask, bool enable) -{ - if (enable) - { - base->DER |= mask; - } - else - { - base->DER &= ~mask; - } -} -/*! @} */ - -/*! - * @name Status - * @{ - */ -/*! - * @brief Get status flags of DAC14 module. - * - * @param base DAC14 peripheral base address. - * @return Current DAC status flags. - */ -static inline uint32_t DAC14_GetStatusFlags(HPDAC_Type *base) -{ - return base->FSR; -} - -/*! - * @brief Clear status flags of DAC14 module. - * - * @param base DAC14 peripheral base address. - * @param flags Mask value of status flags to be cleared, please see @ref _dac14_status_flags for details. - */ -static inline void DAC14_ClearStatusFlags(HPDAC_Type *base, uint32_t flags) -{ - base->FSR = flags; -} -/*! @} */ - -/*! - * @name Functional Feature - * @{ - */ -/*! - * @brief Set data into the entry of FIFO buffer. - * - * @param base DAC14 peripheral base address. - * @param value Setting value into FIFO buffer. - */ -static inline void DAC14_SetData(HPDAC_Type *base, uint32_t value) -{ - base->DATA = HPDAC_DATA_DATA(value); -} - -/*! - * @brief Get the value of the FIFO write pointer. - * - * @param base DAC14 peripheral base address. - * @return Current value of the FIFO write pointer. - */ - -static inline uint32_t DAC14_GetFIFOWritePointer(HPDAC_Type *base) -{ - return (HPDAC_FPR_FIFO_WPT_MASK & base->FPR) >> HPDAC_FPR_FIFO_WPT_SHIFT; -} - -/*! - * @brief Get the value of the FIFO read pointer. - * - * @param base DAC14 peripheral base address. - * @return Current value of the FIFO read pointer. - */ - -static inline uint32_t DAC14_GetFIFOReadPointer(HPDAC_Type *base) -{ - return (HPDAC_FPR_FIFO_RPT_MASK & base->FPR) >> HPDAC_FPR_FIFO_RPT_SHIFT; -} - -/*! - * @brief Do software trigger. - * - * @param base DAC14 peripheral base address. - */ -static inline void DAC14_DoSoftwareTrigger(HPDAC_Type *base) -{ - base->TCR = HPDAC_TCR_SWTRG_MASK; -} -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ -#endif /* FSL_DAC14_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_edma.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_edma.c deleted file mode 100644 index b444faac9be..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_edma.c +++ /dev/null @@ -1,2654 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_edma.h" -#if defined FSL_FEATURE_MEMORY_HAS_ADDRESS_OFFSET && FSL_FEATURE_MEMORY_HAS_ADDRESS_OFFSET -#include "fsl_memory.h" -#endif - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.edma4" -#endif -#if defined FSL_FEATURE_MEMORY_HAS_ADDRESS_OFFSET && FSL_FEATURE_MEMORY_HAS_ADDRESS_OFFSET -#define CONVERT_TO_DMA_ADDRESS(addr) (MEMORY_ConvertMemoryMapAddress((uint32_t)(addr), kMEMORY_Local2DMA)) -#else -#define CONVERT_TO_DMA_ADDRESS(addr) ((uint32_t)(addr)) -#endif -#if defined(DMA_RSTS_N) -#define EDMA_RESETS_ARRAY DMA_RSTS_N -#endif -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Map transfer width. - * - * @param width transfer width. - */ -static edma_transfer_size_t EDMA_TransferWidthMapping(uint32_t width); - -/*! - * @brief validate edma errata. - * - * @param base edma base address. - * @param tcd edma transfer content descriptor. - */ -#if defined FSL_FEATURE_EDMA_HAS_ERRATA_51327 -static inline status_t EDMA_CheckErrata(EDMA_Type *base, edma_tcd_t *tcd); -#endif -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Array to map EDMA instance number to base pointer. */ -static EDMA_Type *const s_edmaBases[] = EDMA_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Array to map EDMA instance number to clock name. */ -static const clock_ip_name_t s_edmaClockName[] = EDMA_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(EDMA_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_edmaResets[] = EDMA_RESETS_ARRAY; -#endif - -/*! @brief Array to map EDMA instance number to IRQ number. */ -static const IRQn_Type s_edmaIRQNumber[][FSL_FEATURE_EDMA_MODULE_CHANNEL] = EDMA_CHN_IRQS; - -/*! @brief Pointers to transfer handle for each EDMA channel. */ -static edma_handle_t *s_EDMAHandle[FSL_FEATURE_SOC_EDMA_COUNT][FSL_FEATURE_EDMA_MODULE_CHANNEL]; -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t EDMA_GetInstance(EDMA_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_edmaBases); instance++) - { - if (s_edmaBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_edmaBases)); - - return instance; -} - -#if defined FSL_FEATURE_EDMA_HAS_ERRATA_51327 -static inline status_t EDMA_CheckErrata(EDMA_Type *base, edma_tcd_t *tcd) -{ - status_t status = kStatus_Success; - /* errata 51327: to use scatter gather feature, NBYTES must be multiple of 8 */ - if ((uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_ERRATA_51327n(base) == 1U) - { - if ((EDMA_TCD_NBYTES(tcd, EDMA_TCD_TYPE(base)) % 8U) != 0U) - { - assert(false); - status = kStatus_InvalidArgument; - } - } - - return status; -} -#endif - -/*! - * brief Push content of TCD structure into hardware TCD register. - * - * param base EDMA peripheral base address. - * param channel EDMA channel number. - * param tcd Point to TCD structure. - */ -void EDMA_InstallTCD(EDMA_Type *base, uint32_t channel, edma_tcd_t *tcd) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - assert(tcd != NULL); - - edma_tcd_t *tcdRegs = EDMA_TCD_BASE(base, channel); - -#if defined FSL_FEATURE_EDMA_HAS_ERRATA_51327 - if ((EDMA_TCD_DLAST_SGA(tcd, EDMA_TCD_TYPE(base)) != 0U) && - ((EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) & (uint16_t)DMA_CSR_ESG_MASK) != 0U) && - (EDMA_CheckErrata(base, tcd) != kStatus_Success)) - { - assert(false); - } -#endif - - /* Clear DONE bit first, otherwise ESG cannot be set */ - DMA_CLEAR_DONE_STATUS(base, channel); - /* Push tcd into hardware TCD register */ - EDMA_TCD_SADDR(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_SADDR(tcd, EDMA_TCD_TYPE(base)); - EDMA_TCD_SOFF(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_SOFF(tcd, EDMA_TCD_TYPE(base)); - EDMA_TCD_ATTR(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_ATTR(tcd, EDMA_TCD_TYPE(base)); - EDMA_TCD_NBYTES(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_NBYTES(tcd, EDMA_TCD_TYPE(base)); - EDMA_TCD_SLAST(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_SLAST(tcd, EDMA_TCD_TYPE(base)); - EDMA_TCD_DADDR(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_DADDR(tcd, EDMA_TCD_TYPE(base)); - EDMA_TCD_DOFF(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_DOFF(tcd, EDMA_TCD_TYPE(base)); - EDMA_TCD_CITER(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)); - EDMA_TCD_DLAST_SGA(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_DLAST_SGA(tcd, EDMA_TCD_TYPE(base)); - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)); - EDMA_TCD_BITER(tcdRegs, EDMA_TCD_TYPE(base)) = EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)); -} - -/*! - * brief Initializes the eDMA peripheral. - * - * This function ungates the eDMA clock and configures the eDMA peripheral according - * to the configuration structure. - * - * param base eDMA peripheral base address. - * param config A pointer to the configuration structure, see "edma_config_t". - * note This function enables the minor loop map feature. - */ -void EDMA_Init(EDMA_Type *base, const edma_config_t *config) -{ - assert(config != NULL); - assert(FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base) != -1); - - uint32_t tmpreg, i = 0U; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate EDMA peripheral clock */ - CLOCK_EnableClock(s_edmaClockName[EDMA_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(EDMA_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_edmaResets[EDMA_GetInstance(base)]); -#endif - -#if defined(FSL_EDMA_SOC_IP_EDMA) && FSL_EDMA_SOC_IP_EDMA - /* clear all the enabled request, status to make sure EDMA status is in normal condition */ - EDMA_BASE(base)->ERQ = 0U; - EDMA_BASE(base)->INT = 0xFFFFFFFFU; - EDMA_BASE(base)->ERR = 0xFFFFFFFFU; - /* Configure EDMA peripheral according to the configuration structure. */ - tmpreg = EDMA_BASE(base)->CR; - tmpreg &= ~(DMA_CR_ERCA_MASK | DMA_CR_HOE_MASK | DMA_CR_CLM_MASK | DMA_CR_EDBG_MASK); - tmpreg |= (DMA_CR_ERCA(config->enableRoundRobinArbitration) | DMA_CR_HOE(config->enableHaltOnError) | - DMA_CR_CLM(config->enableContinuousLinkMode) | DMA_CR_EDBG(config->enableDebugMode) | DMA_CR_EMLM(1U)); - EDMA_BASE(base)->CR = tmpreg; -#else - tmpreg = EDMA_MP_BASE(base)->MP_CSR; -#if defined FSL_FEATURE_EDMA_HAS_GLOBAL_MASTER_ID_REPLICATION && FSL_FEATURE_EDMA_HAS_GLOBAL_MASTER_ID_REPLICATION - tmpreg = (tmpreg & ~(DMA_MP_CSR_HAE_MASK | DMA_MP_CSR_ERCA_MASK | DMA_MP_CSR_EDBG_MASK | DMA_MP_CSR_GCLC_MASK | - DMA_MP_CSR_GMRC_MASK | DMA_MP_CSR_HALT_MASK)) | - DMA_MP_CSR_GMRC(config->enableMasterIdReplication) | DMA_MP_CSR_HAE(config->enableHaltOnError) | - DMA_MP_CSR_ERCA(config->enableRoundRobinArbitration) | DMA_MP_CSR_EDBG(config->enableDebugMode) | - DMA_MP_CSR_GCLC(config->enableGlobalChannelLink); -#else - tmpreg = (tmpreg & ~(DMA_MP_CSR_HAE_MASK | DMA_MP_CSR_ERCA_MASK | DMA_MP_CSR_EDBG_MASK | DMA_MP_CSR_GCLC_MASK | - DMA_MP_CSR_HALT_MASK)) | - DMA_MP_CSR_HAE(config->enableHaltOnError) | DMA_MP_CSR_ERCA(config->enableRoundRobinArbitration) | - DMA_MP_CSR_EDBG(config->enableDebugMode) | DMA_MP_CSR_GCLC(config->enableGlobalChannelLink); -#endif - EDMA_MP_BASE(base)->MP_CSR = tmpreg; - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG && FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG - /* channel transfer configuration */ - for (i = 0U; i < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base); i++) - { - if (config->channelConfig[i] != NULL) - { - EDMA_InitChannel(base, i, config->channelConfig[i]); - } - } -#endif -#endif -} - -/*! - * brief Deinitializes the eDMA peripheral. - * - * This function gates the eDMA clock. - * - * param base eDMA peripheral base address. - */ -void EDMA_Deinit(EDMA_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate EDMA peripheral clock */ - CLOCK_DisableClock(s_edmaClockName[EDMA_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG && FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG -/*! - * brief EDMA Channel initialization - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param channelConfig pointer to user's eDMA channel config structure, see edma_channel_config_t for detail. - */ -void EDMA_InitChannel(EDMA_Type *base, uint32_t channel, edma_channel_config_t *channelConfig) -{ - assert(channelConfig != NULL); - - EDMA_SetChannelPreemptionConfig(base, channel, &channelConfig->channelPreemptionConfig); - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE && FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE - EDMA_SetChannelSwapSize(base, channel, channelConfig->channelSwapSize); -#endif - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE && FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE - EDMA_SetChannelMemoryAttribute(base, channel, channelConfig->channelWriteMemoryAttribute, - channelConfig->channelReadMemoryAttribute); -#endif -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_SIGN_EXTENSION && FSL_FEATURE_EDMA_HAS_CHANNEL_SIGN_EXTENSION - EDMA_SetChannelSignExtension(base, channel, channelConfig->channelDataSignExtensionBitPosition); -#endif -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE && FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE - EDMA_SetChannelAccessType(base, channel, channelConfig->channelAccessType); -#endif - -#if (defined FSL_FEATURE_EDMA_HAS_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_CHANNEL_MUX) || \ - (defined FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX) - if (0U != (uint32_t)channelConfig->channelRequestSource) - { - /* dma request source */ - EDMA_SetChannelMux(base, channel, (int32_t)channelConfig->channelRequestSource); - } -#endif - - /* master ID replication */ - EDMA_EnableChannelMasterIDReplication(base, channel, channelConfig->enableMasterIDReplication); -#if !(defined(FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) && FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) - /* dma transfer security level */ - EDMA_SetChannelSecurityLevel(base, channel, channelConfig->securityLevel); -#endif - /* dma transfer protection level */ - EDMA_SetChannelProtectionLevel(base, channel, channelConfig->protectionLevel); -} -#endif - -/*! - * brief Gets the eDMA default configuration structure. - * - * This function sets the configuration structure to default values. - * The default configuration is set to the following values. - * code - * config.enableContinuousLinkMode = false; - * config.enableHaltOnError = true; - * config.enableRoundRobinArbitration = false; - * config.enableDebugMode = false; - * endcode - * - * param config A pointer to the eDMA configuration structure. - */ -void EDMA_GetDefaultConfig(edma_config_t *config) -{ - assert(config != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->enableRoundRobinArbitration = false; - - config->enableHaltOnError = true; - -#if defined FSL_FEATURE_EDMA_HAS_CONTINUOUS_LINK_MODE && FSL_FEATURE_EDMA_HAS_CONTINUOUS_LINK_MODE - config->enableContinuousLinkMode = false; -#endif - -#if defined FSL_FEATURE_EDMA_HAS_GLOBAL_MASTER_ID_REPLICATION && FSL_FEATURE_EDMA_HAS_GLOBAL_MASTER_ID_REPLICATION - config->enableMasterIdReplication = false; -#endif - - config->enableDebugMode = false; - - config->enableGlobalChannelLink = true; -} - -/*! - * brief Sets all TCD registers to default values. - * - * This function sets TCD registers for this channel to default values. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * note This function must not be called while the channel transfer is ongoing - * or it causes unpredictable results. - * note This function enables the auto stop request feature. - */ -void EDMA_ResetChannel(EDMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - /* reset channel CSR */ - EDMA_ClearChannelStatusFlags(base, channel, (uint32_t)kEDMA_DoneFlag | (uint32_t)kEDMA_ErrorFlag); - /* reset channel TCD */ - EDMA_TcdResetExt(base, EDMA_TCD_BASE(base, channel)); -} - -/*! - * brief Configures the eDMA transfer attribute. - * - * This function configures the transfer attribute, including source address, destination address, - * transfer size, address offset, and so on. It also configures the scatter gather feature if the - * user supplies the TCD address. - * Example: - * code - * edma_transfer_t config; - * edma_tcd_t tcd; - * config.srcAddr = ..; - * config.destAddr = ..; - * ... - * EDMA_SetTransferConfig(DMA0, channel, &config, &stcd); - * endcode - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param config Pointer to eDMA transfer configuration structure. - * param nextTcd Point to TCD structure. It can be NULL if users - * do not want to enable scatter/gather feature. - * note If nextTcd is not NULL, it means scatter gather feature is enabled - * and DREQ bit is cleared in the previous transfer configuration, which - * is set in the eDMA_ResetChannel. - */ -void EDMA_SetTransferConfig(EDMA_Type *base, - uint32_t channel, - const edma_transfer_config_t *config, - edma_tcd_t *nextTcd) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - assert(config != NULL); - - EDMA_TcdSetTransferConfigExt(base, EDMA_TCD_BASE(base, channel), config, - (edma_tcd_t *)CONVERT_TO_DMA_ADDRESS(nextTcd)); -} - -/*! - * brief Configures the eDMA minor offset feature. - * - * The minor offset means that the signed-extended value is added to the source address or destination - * address after each minor loop. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param config A pointer to the minor offset configuration structure. - */ -void EDMA_SetMinorOffsetConfig(EDMA_Type *base, uint32_t channel, const edma_minor_offset_config_t *config) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - assert(config != NULL); - - uint32_t tmpreg; - - tmpreg = EDMA_TCD_NBYTES(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)); - tmpreg &= ~(DMA_NBYTES_MLOFFYES_SMLOE_MASK | DMA_NBYTES_MLOFFYES_DMLOE_MASK | DMA_NBYTES_MLOFFYES_MLOFF_MASK); - tmpreg |= - (DMA_NBYTES_MLOFFYES_SMLOE(config->enableSrcMinorOffset) | - DMA_NBYTES_MLOFFYES_DMLOE(config->enableDestMinorOffset) | DMA_NBYTES_MLOFFYES_MLOFF(config->minorOffset)); - EDMA_TCD_NBYTES(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) = tmpreg; -} - -/*! - * brief Configures the eDMA channel TCD major offset feature. - * - * Adjustment value added to the source address at the completion of the major iteration count - * - * param base eDMA peripheral base address. - * param channel edma channel number. - * param sourceOffset source address offset. - * param destOffset destination address offset. - */ -void EDMA_SetMajorOffsetConfig(EDMA_Type *base, uint32_t channel, int32_t sourceOffset, int32_t destOffset) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - EDMA_TCD_SLAST(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) = (uint32_t)sourceOffset; - EDMA_TCD_DLAST_SGA(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) = (uint32_t)destOffset; -} - -/*! - * brief Configures the eDMA channel preemption feature. - * - * This function configures the channel preemption attribute and the priority of the channel. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number - * param config A pointer to the channel preemption configuration structure. - */ -void EDMA_SetChannelPreemptionConfig(EDMA_Type *base, uint32_t channel, const edma_channel_Preemption_config_t *config) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - assert(config != NULL); - - bool tmpEnablePreemptAbility = config->enablePreemptAbility; - bool tmpEnablchannelPreemption = config->enableChannelPreemption; - uint8_t tmpChannelPriority = config->channelPriority; - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - - volatile uint8_t *tmpReg = &EDMA_BASE(base)->DCHPRI3; - - ((volatile uint8_t *)tmpReg)[DMA_DCHPRI_INDEX(channel)] = - (DMA_DCHPRI0_DPA((true == tmpEnablePreemptAbility ? 0U : 1U)) | - DMA_DCHPRI0_ECP((true == tmpEnablchannelPreemption ? 1U : 0U)) | DMA_DCHPRI0_CHPRI(tmpChannelPriority)); -#else - EDMA_CHANNEL_BASE(base, channel)->CH_PRI = DMA_CH_PRI_ECP(tmpEnablchannelPreemption) | - DMA_CH_PRI_DPA(tmpEnablePreemptAbility) | - DMA_CH_PRI_APL(tmpChannelPriority); -#endif -} - -/*! - * brief Sets the channel link for the eDMA transfer. - * - * This function configures either the minor link or the major link mode. The minor link means that the channel link is - * triggered every time CITER decreases by 1. The major link means that the channel link is triggered when the CITER is - * exhausted. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param type A channel link type, which can be one of the following: - * arg kEDMA_LinkNone - * arg kEDMA_MinorLink - * arg kEDMA_MajorLink - * param linkedChannel The linked channel number. - * note Users should ensure that DONE flag is cleared before calling this interface, or the configuration is invalid. - */ -void EDMA_SetChannelLink(EDMA_Type *base, uint32_t channel, edma_channel_link_type_t type, uint32_t linkedChannel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - assert(linkedChannel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - EDMA_TcdSetChannelLinkExt(base, EDMA_TCD_BASE(base, channel), type, linkedChannel); -} - -#if defined FSL_FEATURE_EDMA_HAS_BANDWIDTH && FSL_FEATURE_EDMA_HAS_BANDWIDTH -/*! - * brief Sets the bandwidth for the eDMA transfer. - * - * Because the eDMA processes the minor loop, it continuously generates read/write sequences - * until the minor count is exhausted. The bandwidth forces the eDMA to stall after the completion of - * each read/write access to control the bus request bandwidth seen by the crossbar switch. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param bandWidth A bandwidth setting, which can be one of the following: - * arg kEDMABandwidthStallNone - * arg kEDMABandwidthStall4Cycle - * arg kEDMABandwidthStall8Cycle - */ -void EDMA_SetBandWidth(EDMA_Type *base, uint32_t channel, edma_bandwidth_t bandWidth) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - EDMA_TCD_CSR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) = - (uint16_t)((EDMA_TCD_CSR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) & (~DMA_CSR_BWC_MASK)) | - DMA_CSR_BWC(bandWidth)); -} -#endif - -/*! - * brief Sets the source modulo and the destination modulo for the eDMA transfer. - * - * This function defines a specific address range specified to be the value after (SADDR + SOFF)/(DADDR + DOFF) - * calculation is performed or the original register value. It provides the ability to implement a circular data - * queue easily. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param srcModulo A source modulo value. - * param destModulo A destination modulo value. - */ -void EDMA_SetModulo(EDMA_Type *base, uint32_t channel, edma_modulo_t srcModulo, edma_modulo_t destModulo) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - uint16_t tmpreg = EDMA_TCD_ATTR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) & - (~(uint16_t)(DMA_ATTR_SMOD_MASK | DMA_ATTR_DMOD_MASK)); - EDMA_TCD_ATTR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) = - tmpreg | DMA_ATTR_DMOD(destModulo) | DMA_ATTR_SMOD(srcModulo); -} - -/*! - * brief Sets all fields to default values for the TCD structure. - * - * This function sets all fields for this TCD structure to default value. - * - * param base eDMA peripheral base address. - * param tcd Pointer to the TCD structure. - * note This function enables the auto stop request feature. - */ -void EDMA_TcdResetExt(EDMA_Type *base, edma_tcd_t *tcd) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - - /* Reset channel TCD */ - EDMA_TCD_SADDR(tcd, EDMA_TCD_TYPE(base)) = 0U; - EDMA_TCD_SOFF(tcd, EDMA_TCD_TYPE(base)) = 0U; - EDMA_TCD_ATTR(tcd, EDMA_TCD_TYPE(base)) = 0U; - EDMA_TCD_NBYTES(tcd, EDMA_TCD_TYPE(base)) = 0U; - EDMA_TCD_SLAST(tcd, EDMA_TCD_TYPE(base)) = 0U; - EDMA_TCD_DADDR(tcd, EDMA_TCD_TYPE(base)) = 0U; - EDMA_TCD_DOFF(tcd, EDMA_TCD_TYPE(base)) = 0U; - EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)) = 0U; - EDMA_TCD_DLAST_SGA(tcd, EDMA_TCD_TYPE(base)) = 0U; - /* Enable auto disable request feature */ - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) = DMA_CSR_DREQ(1U); - EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)) = 0U; -} - -/*! - * brief Configures the eDMA TCD transfer attribute. - * - * The TCD is a transfer control descriptor. The content of the TCD is the same as the hardware TCD registers. - * The TCD is used in the scatter-gather mode. - * This function configures the TCD transfer attribute, including source address, destination address, - * transfer size, address offset, and so on. It also configures the scatter gather feature if the - * user supplies the next TCD address. - * Example: - * code - * edma_transfer_t config = { - * ... - * } - * edma_tcd_t tcd __aligned(32); - * edma_tcd_t nextTcd __aligned(32); - * EDMA_TcdSetTransferConfig(&tcd, &config, &nextTcd); - * endcode - * - * param base eDMA peripheral base address. - * param tcd Pointer to the TCD structure. - * param config Pointer to eDMA transfer configuration structure. - * param nextTcd Pointer to the next TCD structure. It can be NULL if users - * do not want to enable scatter/gather feature. - * note TCD address should be 32 bytes aligned or it causes an eDMA error. - * note If the nextTcd is not NULL, the scatter gather feature is enabled - * and DREQ bit is cleared in the previous transfer configuration, which - * is set in the EDMA_TcdReset. - */ -void EDMA_TcdSetTransferConfigExt(EDMA_Type *base, - edma_tcd_t *tcd, - const edma_transfer_config_t *config, - edma_tcd_t *nextTcd) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - assert(config != NULL); - - EDMA_ConfigChannelSoftwareTCDExt(base, tcd, config); - - if (nextTcd != NULL) - { - EDMA_TCD_DLAST_SGA(tcd, EDMA_TCD_TYPE(base)) = CONVERT_TO_DMA_ADDRESS(nextTcd); - /* - Before call EDMA_TcdSetTransferConfig or EDMA_SetTransferConfig, - user must call EDMA_TcdReset or EDMA_ResetChannel which will set - DREQ, so must use "|" or "&" rather than "=". - - Clear the DREQ bit because scatter gather has been enabled, so the - previous transfer is not the last transfer, and channel request should - be enabled at the next transfer(the next TCD). - */ - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) = - (EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) | (uint16_t)DMA_CSR_ESG_MASK) & ~(uint16_t)DMA_CSR_DREQ_MASK; - } -} - -/*! - * brief Sets TCD fields according to the user's channel transfer configuration structure, see - * edma_transfer_config_t. - * - * Application should be careful about the TCD pool buffer storage class, - * - For the platform has cache, the software TCD should be put in non cache section - * - The TCD pool buffer should have a consistent storage class. - * - * param base eDMA peripheral base address. - * param tcd Pointer to the TCD structure. - * param transfer channel transfer configuration pointer. - * - */ -void EDMA_ConfigChannelSoftwareTCDExt(EDMA_Type *base, edma_tcd_t *tcd, const edma_transfer_config_t *transfer) -{ - assert(transfer != NULL); - assert((transfer->minorLoopBytes % (1UL << ((uint32_t)transfer->srcTransferSize))) == 0U); - assert((transfer->minorLoopBytes % (1UL << ((uint32_t)transfer->destTransferSize))) == 0U); - assert(((uint32_t)transfer->srcOffset % (1UL << ((uint32_t)transfer->srcTransferSize))) == 0U); - assert(((uint32_t)transfer->destOffset % (1UL << ((uint32_t)transfer->destTransferSize))) == 0U); - assert((transfer->srcAddr % (1UL << ((uint32_t)transfer->srcTransferSize))) == 0U); - assert((transfer->destAddr % (1UL << ((uint32_t)transfer->destTransferSize))) == 0U); - assert((transfer->srcAddr % (1UL << ((uint32_t)transfer->srcAddrModulo))) == 0U); - assert((transfer->destAddr % (1UL << ((uint32_t)transfer->dstAddrModulo))) == 0U); - - uint16_t tmpreg; - - EDMA_TCD_SADDR(tcd, EDMA_TCD_TYPE(base)) = CONVERT_TO_DMA_ADDRESS(transfer->srcAddr); - /* destination address */ - EDMA_TCD_DADDR(tcd, EDMA_TCD_TYPE(base)) = CONVERT_TO_DMA_ADDRESS(transfer->destAddr); - /* Source data and destination data transfer size */ - EDMA_TCD_ATTR(tcd, EDMA_TCD_TYPE(base)) = - DMA_ATTR_SSIZE(transfer->srcTransferSize) | DMA_ATTR_DSIZE(transfer->destTransferSize); - - /* Source address signed offset */ - EDMA_TCD_SOFF(tcd, EDMA_TCD_TYPE(base)) = (uint16_t)(transfer->srcOffset); - /* Destination address signed offset */ - EDMA_TCD_DOFF(tcd, EDMA_TCD_TYPE(base)) = (uint16_t)(transfer->destOffset); - - if (((transfer->enableSrcMinorLoopOffset) || (transfer->enableDstMinorLoopOffset))) - { - EDMA_TCD_NBYTES(tcd, EDMA_TCD_TYPE(base)) = DMA_NBYTES_MLOFFYES_NBYTES(transfer->minorLoopBytes) | - DMA_NBYTES_MLOFFYES_MLOFF(transfer->minorLoopOffset) | - DMA_NBYTES_MLOFFYES_DMLOE(transfer->enableDstMinorLoopOffset) | - DMA_NBYTES_MLOFFYES_SMLOE(transfer->enableSrcMinorLoopOffset); - } - else - { - EDMA_TCD_NBYTES(tcd, EDMA_TCD_TYPE(base)) = DMA_NBYTES_MLOFFNO_NBYTES(transfer->minorLoopBytes); - } - - /* Current major iteration count */ - EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)) = (uint16_t)(transfer->majorLoopCounts); - /* Starting major iteration count */ - EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)) = (uint16_t)(transfer->majorLoopCounts); - /* reset CSR firstly */ - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) = DMA_CSR_DREQ(1U); - /* Enable scatter/gather processing */ - if (transfer->linkTCD != NULL) - { - EDMA_TCD_DLAST_SGA(tcd, EDMA_TCD_TYPE(base)) = CONVERT_TO_DMA_ADDRESS((uint32_t)((uint8_t *)transfer->linkTCD)); - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) = - (EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) | (uint16_t)DMA_CSR_ESG_MASK) & ~(uint16_t)DMA_CSR_DREQ_MASK; - } - else - { - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_CSR_ESG_MASK; - EDMA_TCD_DLAST_SGA(tcd, EDMA_TCD_TYPE(base)) = (uint32_t)transfer->dstMajorLoopOffset; - } - - /* configure interrupt/auto disable channel request */ - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) |= (transfer->enabledInterruptMask & (~(uint16_t)kEDMA_ErrorInterruptEnable)); - - /* Minor link config */ - if (transfer->enableChannelMinorLoopLink) - { - /* Enable minor link */ - EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)) |= DMA_CITER_ELINKYES_ELINK_MASK; - EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)) |= DMA_BITER_ELINKYES_ELINK_MASK; - /* Set linked channel */ - tmpreg = EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)) & (~(uint16_t)DMA_CITER_ELINKYES_LINKCH_MASK); - tmpreg |= DMA_CITER_ELINKYES_LINKCH(transfer->minorLoopLinkChannel); - EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)) = tmpreg; - tmpreg = EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)) & (~(uint16_t)DMA_BITER_ELINKYES_LINKCH_MASK); - tmpreg |= DMA_BITER_ELINKYES_LINKCH(transfer->minorLoopLinkChannel); - EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)) = tmpreg; - } - /* Major link config */ - if (transfer->enableChannelMajorLoopLink) - { - /* Enable major link */ - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) |= DMA_CSR_MAJORELINK_MASK; - /* Set major linked channel */ - tmpreg = EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) & (~(uint16_t)DMA_CSR_MAJORLINKCH_MASK); - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) = tmpreg | DMA_CSR_MAJORLINKCH(transfer->majorLoopLinkChannel); - } - - /* clear link relate field if no channel link enabled */ - if ((!transfer->enableChannelMajorLoopLink) && (!transfer->enableChannelMinorLoopLink)) - { - EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_CITER_ELINKYES_ELINK_MASK; - EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_BITER_ELINKYES_ELINK_MASK; - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_CSR_MAJORELINK_MASK; - } - - /* major loop offset */ - EDMA_TCD_SLAST(tcd, EDMA_TCD_TYPE(base)) = (uint32_t)transfer->srcMajorLoopOffset; - /* modulo feature */ - tmpreg = EDMA_TCD_ATTR(tcd, EDMA_TCD_TYPE(base)) & (~(uint16_t)(DMA_ATTR_SMOD_MASK | DMA_ATTR_DMOD_MASK)); - EDMA_TCD_ATTR(tcd, EDMA_TCD_TYPE(base)) = - tmpreg | DMA_ATTR_DMOD(transfer->dstAddrModulo) | DMA_ATTR_SMOD(transfer->srcAddrModulo); -} - -/*! - * brief Configures the eDMA TCD minor offset feature. - * - * A minor offset is a signed-extended value added to the source address or a destination - * address after each minor loop. - * - * param base eDMA peripheral base address. - * param tcd A point to the TCD structure. - * param config A pointer to the minor offset configuration structure. - */ -void EDMA_TcdSetMinorOffsetConfigExt(EDMA_Type *base, edma_tcd_t *tcd, const edma_minor_offset_config_t *config) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - - uint32_t tmpreg; - - tmpreg = EDMA_TCD_NBYTES(tcd, EDMA_TCD_TYPE(base)) & - ~(DMA_NBYTES_MLOFFYES_SMLOE_MASK | DMA_NBYTES_MLOFFYES_DMLOE_MASK | DMA_NBYTES_MLOFFYES_MLOFF_MASK); - tmpreg |= - (DMA_NBYTES_MLOFFYES_SMLOE(config->enableSrcMinorOffset) | - DMA_NBYTES_MLOFFYES_DMLOE(config->enableDestMinorOffset) | DMA_NBYTES_MLOFFYES_MLOFF(config->minorOffset)); - EDMA_TCD_NBYTES(tcd, EDMA_TCD_TYPE(base)) = tmpreg; -} - -/*! - * brief Configures the eDMA TCD major offset feature. - * - * Adjustment value added to the source address at the completion of the major iteration count - * - * param base eDMA peripheral base address. - * param tcd A point to the TCD structure. - * param sourceOffset source address offset. - * param destOffset destination address offset. - */ -void EDMA_TcdSetMajorOffsetConfigExt(EDMA_Type *base, edma_tcd_t *tcd, int32_t sourceOffset, int32_t destOffset) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - - EDMA_TCD_SLAST(tcd, EDMA_TCD_TYPE(base)) = (uint32_t)sourceOffset; - EDMA_TCD_DLAST_SGA(tcd, EDMA_TCD_TYPE(base)) = (uint32_t)destOffset; -} - -/*! - * brief Sets the channel link for the eDMA TCD. - * - * This function configures either a minor link or a major link. The minor link means the channel link is - * triggered every time CITER decreases by 1. The major link means that the channel link is triggered when the CITER is - * exhausted. - * - * note Users should ensure that DONE flag is cleared before calling this interface, or the configuration is invalid. - * param base eDMA peripheral base address. - * param tcd Point to the TCD structure. - * param type Channel link type, it can be one of: - * arg kEDMA_LinkNone - * arg kEDMA_MinorLink - * arg kEDMA_MajorLink - * param linkedChannel The linked channel number. - */ -void EDMA_TcdSetChannelLinkExt(EDMA_Type *base, edma_tcd_t *tcd, edma_channel_link_type_t type, uint32_t linkedChannel) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - assert(linkedChannel < (uint32_t)FSL_FEATURE_EDMA_MODULE_CHANNEL); - - if (type == kEDMA_MinorLink) /* Minor link config */ - { - uint16_t tmpreg; - - /* Enable minor link */ - EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)) |= DMA_CITER_ELINKYES_ELINK_MASK; - EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)) |= DMA_BITER_ELINKYES_ELINK_MASK; - /* Set linked channel */ - tmpreg = EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)) & (~(uint16_t)DMA_CITER_ELINKYES_LINKCH_MASK); - tmpreg |= DMA_CITER_ELINKYES_LINKCH(linkedChannel); - EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)) = tmpreg; - tmpreg = EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)) & (~(uint16_t)DMA_BITER_ELINKYES_LINKCH_MASK); - tmpreg |= DMA_BITER_ELINKYES_LINKCH(linkedChannel); - EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)) = tmpreg; - } - else if (type == kEDMA_MajorLink) /* Major link config */ - { - uint16_t tmpreg; - - /* Enable major link */ - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) |= DMA_CSR_MAJORELINK_MASK; - /* Set major linked channel */ - tmpreg = EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) & (~(uint16_t)DMA_CSR_MAJORLINKCH_MASK); - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) = tmpreg | DMA_CSR_MAJORLINKCH(linkedChannel); - } - else /* Link none */ - { - EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_CITER_ELINKYES_ELINK_MASK; - EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_BITER_ELINKYES_ELINK_MASK; - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_CSR_MAJORELINK_MASK; - } -} - -/*! - * brief Sets the source modulo and the destination modulo for the eDMA TCD. - * - * This function defines a specific address range specified to be the value after (SADDR + SOFF)/(DADDR + DOFF) - * calculation is performed or the original register value. It provides the ability to implement a circular data - * queue easily. - * - * param base eDMA peripheral base address. - * param tcd A pointer to the TCD structure. - * param srcModulo A source modulo value. - * param destModulo A destination modulo value. - */ -void EDMA_TcdSetModuloExt(EDMA_Type *base, edma_tcd_t *tcd, edma_modulo_t srcModulo, edma_modulo_t destModulo) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - - uint16_t tmpreg; - - tmpreg = EDMA_TCD_ATTR(tcd, EDMA_TCD_TYPE(base)) & (~(uint16_t)(DMA_ATTR_SMOD_MASK | DMA_ATTR_DMOD_MASK)); - EDMA_TCD_ATTR(tcd, EDMA_TCD_TYPE(base)) = tmpreg | DMA_ATTR_DMOD(destModulo) | DMA_ATTR_SMOD(srcModulo); -} - -/*! - * brief Enables the interrupt source for the eDMA TCD. - * - * param base eDMA peripheral base address. - * param tcd Point to the TCD structure. - * param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_TcdEnableInterruptsExt(EDMA_Type *base, edma_tcd_t *tcd, uint32_t mask) -{ - assert(tcd != NULL); - - /* Enable Major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_MajorInterruptEnable)) - { - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) |= DMA_CSR_INTMAJOR_MASK; - } - - /* Enable Half major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_HalfInterruptEnable)) - { - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) |= DMA_CSR_INTHALF_MASK; - } -} - -/*! - * brief Disables the interrupt source for the eDMA TCD. - * - * param base eDMA peripheral base address. - * param tcd Point to the TCD structure. - * param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_TcdDisableInterruptsExt(EDMA_Type *base, edma_tcd_t *tcd, uint32_t mask) -{ - assert(tcd != NULL); - - /* Disable Major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_MajorInterruptEnable)) - { - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_CSR_INTMAJOR_MASK; - } - - /* Disable Half major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_HalfInterruptEnable)) - { - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_CSR_INTHALF_MASK; - } -} - -/*! - * brief Sets all fields to default values for the TCD structure. - * - * Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API ref - * EDMA_TcdResetExt - * - * This function sets all fields for this TCD structure to default value. - * - * param tcd Pointer to the TCD structure. - * note This function enables the auto stop request feature. - */ -void EDMA_TcdReset(edma_tcd_t *tcd) -{ - assert(tcd != NULL); - - /* Reset channel TCD */ - EDMA_TCD_SADDR(tcd, kEDMA_EDMA4Flag) = 0U; - EDMA_TCD_SOFF(tcd, kEDMA_EDMA4Flag) = 0U; - EDMA_TCD_ATTR(tcd, kEDMA_EDMA4Flag) = 0U; - EDMA_TCD_NBYTES(tcd, kEDMA_EDMA4Flag) = 0U; - EDMA_TCD_SLAST(tcd, kEDMA_EDMA4Flag) = 0U; - EDMA_TCD_DADDR(tcd, kEDMA_EDMA4Flag) = 0U; - EDMA_TCD_DOFF(tcd, kEDMA_EDMA4Flag) = 0U; - EDMA_TCD_CITER(tcd, kEDMA_EDMA4Flag) = 0U; - EDMA_TCD_DLAST_SGA(tcd, kEDMA_EDMA4Flag) = 0U; - /* Enable auto disable request feature */ - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) = DMA_CSR_DREQ(1U); - EDMA_TCD_BITER(tcd, kEDMA_EDMA4Flag) = 0U; -} - -/*! - * brief Configures the eDMA TCD transfer attribute. - * - * Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API ref - * EDMA_TcdSetTransferConfigExt - * - * The TCD is a transfer control descriptor. The content of the TCD is the same as the hardware TCD registers. - * The TCD is used in the scatter-gather mode. - * This function configures the TCD transfer attribute, including source address, destination address, - * transfer size, address offset, and so on. It also configures the scatter gather feature if the - * user supplies the next TCD address. - * Example: - * code - * edma_transfer_t config = { - * ... - * } - * edma_tcd_t tcd __aligned(32); - * edma_tcd_t nextTcd __aligned(32); - * EDMA_TcdSetTransferConfig(&tcd, &config, &nextTcd); - * endcode - * - * param tcd Pointer to the TCD structure. - * param config Pointer to eDMA transfer configuration structure. - * param nextTcd Pointer to the next TCD structure. It can be NULL if users - * do not want to enable scatter/gather feature. - * note TCD address should be 32 bytes aligned or it causes an eDMA error. - * note If the nextTcd is not NULL, the scatter gather feature is enabled - * and DREQ bit is cleared in the previous transfer configuration, which - * is set in the EDMA_TcdReset. - */ -void EDMA_TcdSetTransferConfig(edma_tcd_t *tcd, const edma_transfer_config_t *config, edma_tcd_t *nextTcd) -{ - assert(tcd != NULL); - assert(config != NULL); - - EDMA_ConfigChannelSoftwareTCD(tcd, config); - - if (nextTcd != NULL) - { - EDMA_TCD_DLAST_SGA(tcd, kEDMA_EDMA4Flag) = CONVERT_TO_DMA_ADDRESS(nextTcd); - /* - Before call EDMA_TcdSetTransferConfig or EDMA_SetTransferConfig, - user must call EDMA_TcdReset or EDMA_ResetChannel which will set - DREQ, so must use "|" or "&" rather than "=". - - Clear the DREQ bit because scatter gather has been enabled, so the - previous transfer is not the last transfer, and channel request should - be enabled at the next transfer(the next TCD). - */ - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) = - (EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) | (uint16_t)DMA_CSR_ESG_MASK) & ~(uint16_t)DMA_CSR_DREQ_MASK; - } -} - -/*! - * brief Sets TCD fields according to the user's channel transfer configuration structure, see - * edma_transfer_config_t. - * - * Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API ref - * EDMA_ConfigChannelSoftwareTCDExt - * - * Application should be careful about the TCD pool buffer storage class, - * - For the platform has cache, the software TCD should be put in non cache section - * - The TCD pool buffer should have a consistent storage class. - * - * param tcd Pointer to the TCD structure. - * param transfer channel transfer configuration pointer. - * - */ -void EDMA_ConfigChannelSoftwareTCD(edma_tcd_t *tcd, const edma_transfer_config_t *transfer) -{ - assert(transfer != NULL); - assert((transfer->minorLoopBytes % (1UL << ((uint32_t)transfer->srcTransferSize))) == 0U); - assert((transfer->minorLoopBytes % (1UL << ((uint32_t)transfer->destTransferSize))) == 0U); - assert(((uint32_t)transfer->srcOffset % (1UL << ((uint32_t)transfer->srcTransferSize))) == 0U); - assert(((uint32_t)transfer->destOffset % (1UL << ((uint32_t)transfer->destTransferSize))) == 0U); - assert((transfer->srcAddr % (1UL << ((uint32_t)transfer->srcTransferSize))) == 0U); - assert((transfer->destAddr % (1UL << ((uint32_t)transfer->destTransferSize))) == 0U); - assert((transfer->srcAddr % (1UL << ((uint32_t)transfer->srcAddrModulo))) == 0U); - assert((transfer->destAddr % (1UL << ((uint32_t)transfer->dstAddrModulo))) == 0U); - - uint16_t tmpreg; - - EDMA_TCD_SADDR(tcd, kEDMA_EDMA4Flag) = CONVERT_TO_DMA_ADDRESS(transfer->srcAddr); - /* destination address */ - EDMA_TCD_DADDR(tcd, kEDMA_EDMA4Flag) = CONVERT_TO_DMA_ADDRESS(transfer->destAddr); - /* Source data and destination data transfer size */ - EDMA_TCD_ATTR(tcd, kEDMA_EDMA4Flag) = - DMA_ATTR_SSIZE(transfer->srcTransferSize) | DMA_ATTR_DSIZE(transfer->destTransferSize); - - /* Source address signed offset */ - EDMA_TCD_SOFF(tcd, kEDMA_EDMA4Flag) = (uint16_t)(transfer->srcOffset); - /* Destination address signed offset */ - EDMA_TCD_DOFF(tcd, kEDMA_EDMA4Flag) = (uint16_t)(transfer->destOffset); - - if (((transfer->enableSrcMinorLoopOffset) || (transfer->enableDstMinorLoopOffset))) - { - EDMA_TCD_NBYTES(tcd, kEDMA_EDMA4Flag) = DMA_NBYTES_MLOFFYES_NBYTES(transfer->minorLoopBytes) | - DMA_NBYTES_MLOFFYES_MLOFF(transfer->minorLoopOffset) | - DMA_NBYTES_MLOFFYES_DMLOE(transfer->enableDstMinorLoopOffset) | - DMA_NBYTES_MLOFFYES_SMLOE(transfer->enableSrcMinorLoopOffset); - } - else - { - EDMA_TCD_NBYTES(tcd, kEDMA_EDMA4Flag) = DMA_NBYTES_MLOFFNO_NBYTES(transfer->minorLoopBytes); - } - - /* Current major iteration count */ - EDMA_TCD_CITER(tcd, kEDMA_EDMA4Flag) = (uint16_t)(transfer->majorLoopCounts); - /* Starting major iteration count */ - EDMA_TCD_BITER(tcd, kEDMA_EDMA4Flag) = (uint16_t)(transfer->majorLoopCounts); - /* reset CSR firstly */ - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) = DMA_CSR_DREQ(1U); - /* Enable scatter/gather processing */ - if (transfer->linkTCD != NULL) - { - EDMA_TCD_DLAST_SGA(tcd, kEDMA_EDMA4Flag) = CONVERT_TO_DMA_ADDRESS((uint32_t)((uint8_t *)transfer->linkTCD)); - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) = - (EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) | (uint16_t)DMA_CSR_ESG_MASK) & ~(uint16_t)DMA_CSR_DREQ_MASK; - } - else - { - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) &= ~(uint16_t)DMA_CSR_ESG_MASK; - EDMA_TCD_DLAST_SGA(tcd, kEDMA_EDMA4Flag) = (uint32_t)transfer->dstMajorLoopOffset; - } - - /* configure interrupt/auto disable channel request */ - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) |= (transfer->enabledInterruptMask & (~(uint16_t)kEDMA_ErrorInterruptEnable)); - - /* Minor link config */ - if (transfer->enableChannelMinorLoopLink) - { - /* Enable minor link */ - EDMA_TCD_CITER(tcd, kEDMA_EDMA4Flag) |= DMA_CITER_ELINKYES_ELINK_MASK; - EDMA_TCD_BITER(tcd, kEDMA_EDMA4Flag) |= DMA_BITER_ELINKYES_ELINK_MASK; - /* Set linked channel */ - tmpreg = EDMA_TCD_CITER(tcd, kEDMA_EDMA4Flag) & (~(uint16_t)DMA_CITER_ELINKYES_LINKCH_MASK); - tmpreg |= DMA_CITER_ELINKYES_LINKCH(transfer->minorLoopLinkChannel); - EDMA_TCD_CITER(tcd, kEDMA_EDMA4Flag) = tmpreg; - tmpreg = EDMA_TCD_BITER(tcd, kEDMA_EDMA4Flag) & (~(uint16_t)DMA_BITER_ELINKYES_LINKCH_MASK); - tmpreg |= DMA_BITER_ELINKYES_LINKCH(transfer->minorLoopLinkChannel); - EDMA_TCD_BITER(tcd, kEDMA_EDMA4Flag) = tmpreg; - } - /* Major link config */ - if (transfer->enableChannelMajorLoopLink) - { - /* Enable major link */ - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) |= DMA_CSR_MAJORELINK_MASK; - /* Set major linked channel */ - tmpreg = EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) & (~(uint16_t)DMA_CSR_MAJORLINKCH_MASK); - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) = tmpreg | DMA_CSR_MAJORLINKCH(transfer->majorLoopLinkChannel); - } - - /* clear link relate field if no channel link enabled */ - if ((!transfer->enableChannelMajorLoopLink) && (!transfer->enableChannelMinorLoopLink)) - { - EDMA_TCD_CITER(tcd, kEDMA_EDMA4Flag) &= ~(uint16_t)DMA_CITER_ELINKYES_ELINK_MASK; - EDMA_TCD_BITER(tcd, kEDMA_EDMA4Flag) &= ~(uint16_t)DMA_BITER_ELINKYES_ELINK_MASK; - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) &= ~(uint16_t)DMA_CSR_MAJORELINK_MASK; - } - - /* major loop offset */ - EDMA_TCD_SLAST(tcd, kEDMA_EDMA4Flag) = (uint32_t)transfer->srcMajorLoopOffset; - /* modulo feature */ - tmpreg = EDMA_TCD_ATTR(tcd, kEDMA_EDMA4Flag) & (~(uint16_t)(DMA_ATTR_SMOD_MASK | DMA_ATTR_DMOD_MASK)); - EDMA_TCD_ATTR(tcd, kEDMA_EDMA4Flag) = - tmpreg | DMA_ATTR_DMOD(transfer->dstAddrModulo) | DMA_ATTR_SMOD(transfer->srcAddrModulo); -} - -/*! - * brief Configures the eDMA TCD minor offset feature. - * - * Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API ref - * EDMA_TcdSetMinorOffsetConfigExt - * - * A minor offset is a signed-extended value added to the source address or a destination - * address after each minor loop. - * - * param tcd A point to the TCD structure. - * param config A pointer to the minor offset configuration structure. - */ -void EDMA_TcdSetMinorOffsetConfig(edma_tcd_t *tcd, const edma_minor_offset_config_t *config) -{ - assert(tcd != NULL); - - uint32_t tmpreg; - - tmpreg = EDMA_TCD_NBYTES(tcd, kEDMA_EDMA4Flag) & - ~(DMA_NBYTES_MLOFFYES_SMLOE_MASK | DMA_NBYTES_MLOFFYES_DMLOE_MASK | DMA_NBYTES_MLOFFYES_MLOFF_MASK); - tmpreg |= - (DMA_NBYTES_MLOFFYES_SMLOE(config->enableSrcMinorOffset) | - DMA_NBYTES_MLOFFYES_DMLOE(config->enableDestMinorOffset) | DMA_NBYTES_MLOFFYES_MLOFF(config->minorOffset)); - EDMA_TCD_NBYTES(tcd, kEDMA_EDMA4Flag) = tmpreg; -} - -/*! - * brief Configures the eDMA TCD major offset feature. - * - * Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API ref - * EDMA_TcdSetMajorOffsetConfigExt - * - * Adjustment value added to the source address at the completion of the major iteration count - * - * param tcd A point to the TCD structure. - * param sourceOffset source address offset. - * param destOffset destination address offset. - */ -void EDMA_TcdSetMajorOffsetConfig(edma_tcd_t *tcd, int32_t sourceOffset, int32_t destOffset) -{ - assert(tcd != NULL); - - EDMA_TCD_SLAST(tcd, kEDMA_EDMA4Flag) = (uint32_t)sourceOffset; - EDMA_TCD_DLAST_SGA(tcd, kEDMA_EDMA4Flag) = (uint32_t)destOffset; -} - -/*! - * brief Sets the channel link for the eDMA TCD. - * - * Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API ref - * EDMA_TcdSetChannelLinkExt - * - * This function configures either a minor link or a major link. The minor link means the channel link is - * triggered every time CITER decreases by 1. The major link means that the channel link is triggered when the CITER is - * exhausted. - * - * note Users should ensure that DONE flag is cleared before calling this interface, or the configuration is invalid. - * param tcd Point to the TCD structure. - * param type Channel link type, it can be one of: - * arg kEDMA_LinkNone - * arg kEDMA_MinorLink - * arg kEDMA_MajorLink - * param linkedChannel The linked channel number. - */ -void EDMA_TcdSetChannelLink(edma_tcd_t *tcd, edma_channel_link_type_t type, uint32_t linkedChannel) -{ - assert(tcd != NULL); - assert(linkedChannel < (uint32_t)FSL_FEATURE_EDMA_MODULE_CHANNEL); - - if (type == kEDMA_MinorLink) /* Minor link config */ - { - uint16_t tmpreg; - - /* Enable minor link */ - EDMA_TCD_CITER(tcd, kEDMA_EDMA4Flag) |= DMA_CITER_ELINKYES_ELINK_MASK; - EDMA_TCD_BITER(tcd, kEDMA_EDMA4Flag) |= DMA_BITER_ELINKYES_ELINK_MASK; - /* Set linked channel */ - tmpreg = EDMA_TCD_CITER(tcd, kEDMA_EDMA4Flag) & (~(uint16_t)DMA_CITER_ELINKYES_LINKCH_MASK); - tmpreg |= DMA_CITER_ELINKYES_LINKCH(linkedChannel); - EDMA_TCD_CITER(tcd, kEDMA_EDMA4Flag) = tmpreg; - tmpreg = EDMA_TCD_BITER(tcd, kEDMA_EDMA4Flag) & (~(uint16_t)DMA_BITER_ELINKYES_LINKCH_MASK); - tmpreg |= DMA_BITER_ELINKYES_LINKCH(linkedChannel); - EDMA_TCD_BITER(tcd, kEDMA_EDMA4Flag) = tmpreg; - } - else if (type == kEDMA_MajorLink) /* Major link config */ - { - uint16_t tmpreg; - - /* Enable major link */ - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) |= DMA_CSR_MAJORELINK_MASK; - /* Set major linked channel */ - tmpreg = EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) & (~(uint16_t)DMA_CSR_MAJORLINKCH_MASK); - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) = tmpreg | DMA_CSR_MAJORLINKCH(linkedChannel); - } - else /* Link none */ - { - EDMA_TCD_CITER(tcd, kEDMA_EDMA4Flag) &= ~(uint16_t)DMA_CITER_ELINKYES_ELINK_MASK; - EDMA_TCD_BITER(tcd, kEDMA_EDMA4Flag) &= ~(uint16_t)DMA_BITER_ELINKYES_ELINK_MASK; - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) &= ~(uint16_t)DMA_CSR_MAJORELINK_MASK; - } -} - -/*! - * brief Sets the source modulo and the destination modulo for the eDMA TCD. - * - * Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API ref - * EDMA_TcdSetModuloExt - * - * This function defines a specific address range specified to be the value after (SADDR + SOFF)/(DADDR + DOFF) - * calculation is performed or the original register value. It provides the ability to implement a circular data - * queue easily. - * - * param tcd A pointer to the TCD structure. - * param srcModulo A source modulo value. - * param destModulo A destination modulo value. - */ -void EDMA_TcdSetModulo(edma_tcd_t *tcd, edma_modulo_t srcModulo, edma_modulo_t destModulo) -{ - assert(tcd != NULL); - - uint16_t tmpreg; - - tmpreg = EDMA_TCD_ATTR(tcd, kEDMA_EDMA4Flag) & (~(uint16_t)(DMA_ATTR_SMOD_MASK | DMA_ATTR_DMOD_MASK)); - EDMA_TCD_ATTR(tcd, kEDMA_EDMA4Flag) = tmpreg | DMA_ATTR_DMOD(destModulo) | DMA_ATTR_SMOD(srcModulo); -} - -/*! - * brief Enables the interrupt source for the eDMA TCD. - * - * Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API ref - * EDMA_TcdEnableInterruptsExt - * - * param tcd Point to the TCD structure. - * param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_TcdEnableInterrupts(edma_tcd_t *tcd, uint32_t mask) -{ - assert(tcd != NULL); - - /* Enable Major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_MajorInterruptEnable)) - { - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) |= DMA_CSR_INTMAJOR_MASK; - } - - /* Enable Half major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_HalfInterruptEnable)) - { - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) |= DMA_CSR_INTHALF_MASK; - } -} - -/*! - * brief Disables the interrupt source for the eDMA TCD. - * - * Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API ref - * EDMA_TcdDisableInterruptsExt - * - * param tcd Point to the TCD structure. - * param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_TcdDisableInterrupts(edma_tcd_t *tcd, uint32_t mask) -{ - assert(tcd != NULL); - - /* Disable Major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_MajorInterruptEnable)) - { - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) &= ~(uint16_t)DMA_CSR_INTMAJOR_MASK; - } - - /* Disable Half major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_HalfInterruptEnable)) - { - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) &= ~(uint16_t)DMA_CSR_INTHALF_MASK; - } -} - -/*! - * brief Gets the remaining major loop count from the eDMA current channel TCD. - * - * This function checks the TCD (Task Control Descriptor) status for a specified - * eDMA channel and returns the number of major loop count that has not finished. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * return Major loop count which has not been transferred yet for the current TCD. - * note 1. This function can only be used to get unfinished major loop count of transfer without - * the next TCD, or it might be inaccuracy. - * 2. The unfinished/remaining transfer bytes cannot be obtained directly from registers while - * the channel is running. - * Because to calculate the remaining bytes, the initial NBYTES configured in DMA_TCDn_NBYTES_MLNO - * register is needed while the eDMA IP does not support getting it while a channel is active. - * In another word, the NBYTES value reading is always the actual (decrementing) NBYTES value the dma_engine - * is working with while a channel is running. - * Consequently, to get the remaining transfer bytes, a software-saved initial value of NBYTES (for example - * copied before enabling the channel) is needed. The formula to calculate it is shown below: - * RemainingBytes = RemainingMajorLoopCount * NBYTES(initially configured) - */ -uint32_t EDMA_GetRemainingMajorLoopCount(EDMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - uint32_t remainingCount = 0; - - if (0U != DMA_GET_DONE_STATUS(base, channel)) - { - remainingCount = 0; - } - else - { - /* Calculate the unfinished bytes */ - if (0U != (EDMA_TCD_CITER(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) & DMA_CITER_ELINKNO_ELINK_MASK)) - { - remainingCount = (((uint32_t)EDMA_TCD_CITER(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) & - DMA_CITER_ELINKYES_CITER_MASK) >> - DMA_CITER_ELINKYES_CITER_SHIFT); - } - else - { - remainingCount = (((uint32_t)EDMA_TCD_CITER(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) & - DMA_CITER_ELINKNO_CITER_MASK) >> - DMA_CITER_ELINKNO_CITER_SHIFT); - } - } - - return remainingCount; -} - -/*! - * brief Enables the interrupt source for the eDMA transfer. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_EnableChannelInterrupts(EDMA_Type *base, uint32_t channel, uint32_t mask) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - /* Enable error interrupt */ - if (0U != (mask & (uint32_t)kEDMA_ErrorInterruptEnable)) - { - DMA_ENABLE_ERROR_INT(base, channel); - } - - /* Enable Major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_MajorInterruptEnable)) - { - DMA_ENABLE_MAJOR_INT(base, channel); - } - - /* Enable Half major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_HalfInterruptEnable)) - { - DMA_ENABLE_HALF_INT(base, channel); - } -} - -/*! - * brief Disables the interrupt source for the eDMA transfer. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param mask The mask of the interrupt source to be set. Use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_DisableChannelInterrupts(EDMA_Type *base, uint32_t channel, uint32_t mask) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - /* Disable error interrupt */ - if (0U != (mask & (uint32_t)kEDMA_ErrorInterruptEnable)) - { - DMA_DISABLE_ERROR_INT(base, channel); - } - - /* Disable Major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_MajorInterruptEnable)) - { - DMA_DISABLE_MAJOR_INT(base, channel); - } - - /* Disable Half major interrupt */ - if (0U != (mask & (uint32_t)kEDMA_HalfInterruptEnable)) - { - DMA_DISABLE_HALF_INT(base, channel); - } -} - -/*! - * brief Gets the eDMA channel status flags. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * return The mask of channel status flags. Users need to use the - * _edma_channel_status_flags type to decode the return variables. - */ -uint32_t EDMA_GetChannelStatusFlags(EDMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - uint32_t retval = 0; - - /* Get DONE bit flag */ - retval |= DMA_GET_DONE_STATUS(base, channel); - /* Get ERROR bit flag */ - retval |= (DMA_GET_ERROR_STATUS(base, channel) << 1U); - /* Get INT bit flag */ - retval |= (DMA_GET_INT_STATUS(base, channel) << 2U); - - return retval; -} - -/*! - * brief Clears the eDMA channel status flags. - * - * param base eDMA peripheral base address. - * param channel eDMA channel number. - * param mask The mask of channel status to be cleared. Users need to use - * the defined _edma_channel_status_flags type. - */ -void EDMA_ClearChannelStatusFlags(EDMA_Type *base, uint32_t channel, uint32_t mask) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - /* Clear DONE bit flag */ - if (0U != (mask & (uint32_t)kEDMA_DoneFlag)) - { - DMA_CLEAR_DONE_STATUS(base, channel); - } - /* Clear ERROR bit flag */ - if (0U != (mask & (uint32_t)kEDMA_ErrorFlag)) - { - DMA_CLEAR_ERROR_STATUS(base, channel); - } - /* Clear INT bit flag */ - if (0U != (mask & (uint32_t)kEDMA_InterruptFlag)) - { - DMA_CLEAR_INT_STATUS(base, channel); - } -} - -/*! - * brief Creates the eDMA handle. - * - * This function is called if using the transactional API for eDMA. This function - * initializes the internal state of the eDMA handle. - * - * param handle eDMA handle pointer. The eDMA handle stores callback function and - * parameters. - * param base eDMA peripheral base address. - * param channel eDMA channel number. - */ -void EDMA_CreateHandle(edma_handle_t *handle, EDMA_Type *base, uint32_t channel) -{ - assert(handle != NULL); - assert(FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base) != -1); - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - uint32_t edmaInstance; - edma_tcd_t *tcdRegs; - - /* Zero the handle */ - (void)memset(handle, 0, sizeof(*handle)); - - handle->channel = channel; - - /* Get the DMA instance number */ - edmaInstance = EDMA_GetInstance(base); - s_EDMAHandle[edmaInstance][channel] = handle; - /* Enable NVIC interrupt */ - (void)EnableIRQ(s_edmaIRQNumber[edmaInstance][channel]); - - handle->tcdBase = EDMA_TCD_BASE(base, channel); - handle->channelBase = EDMA_CHANNEL_BASE(base, channel); - handle->base = base; - /* - Reset TCD registers to zero. Unlike the EDMA_TcdReset(DREQ will be set), - CSR will be 0. Because in order to suit EDMA busy check mechanism in - EDMA_SubmitTransfer, CSR must be set 0. - */ - tcdRegs = handle->tcdBase; - EDMA_TCD_SADDR(tcdRegs, EDMA_TCD_TYPE(base)) = 0; - EDMA_TCD_SOFF(tcdRegs, EDMA_TCD_TYPE(base)) = 0; - EDMA_TCD_ATTR(tcdRegs, EDMA_TCD_TYPE(base)) = 0; - EDMA_TCD_NBYTES(tcdRegs, EDMA_TCD_TYPE(base)) = 0; - EDMA_TCD_SLAST(tcdRegs, EDMA_TCD_TYPE(base)) = 0; - EDMA_TCD_DADDR(tcdRegs, EDMA_TCD_TYPE(base)) = 0; - EDMA_TCD_DOFF(tcdRegs, EDMA_TCD_TYPE(base)) = 0; - EDMA_TCD_CITER(tcdRegs, EDMA_TCD_TYPE(base)) = 0; - EDMA_TCD_DLAST_SGA(tcdRegs, EDMA_TCD_TYPE(base)) = 0; - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(base)) = 0; - EDMA_TCD_BITER(tcdRegs, EDMA_TCD_TYPE(base)) = 0; -} - -/*! - * brief Installs the TCDs memory pool into the eDMA handle. - * - * This function is called after the EDMA_CreateHandle to use scatter/gather feature. This function shall only be used - * while users need to use scatter gather mode. Scatter gather mode enables EDMA to load a new transfer control block - * (tcd) in hardware, and automatically reconfigure that DMA channel for a new transfer. - * Users need to prepare tcd memory and also configure tcds using interface EDMA_SubmitTransfer. - * - * param handle eDMA handle pointer. - * param tcdPool A memory pool to store TCDs. It must be 32 bytes aligned. - * param tcdSize The number of TCD slots. - */ -void EDMA_InstallTCDMemory(edma_handle_t *handle, edma_tcd_t *tcdPool, uint32_t tcdSize) -{ - assert(handle != NULL); - assert(((uint32_t)tcdPool & 0x1FU) == 0U); - - /* Initialize tcd queue attribute. */ - /* header should initial as 1, since that it is used to point to the next TCD to be loaded into TCD memory, - * In EDMA driver IRQ handler, header will be used to calculate how many tcd has done, for example, - * If application submit 4 transfer request, A->B->C->D, - * when A finshed, the header is 0, C is the next TCD to be load, since B is already loaded, - * according to EDMA driver IRQ handler, tcdDone = C - A - header = 2 - header = 2, but actually only 1 TCD done, - * so the issue will be the wrong TCD done count will pass to application in first TCD interrupt. - * During first submit, the header should be assigned to 1, since 0 is current one and 1 is next TCD to be loaded, - * but software cannot know which submission is the first one, so assign 1 to header here. - */ - handle->header = 1; - handle->tcdUsed = 0; - handle->tcdSize = (int8_t)tcdSize; - handle->tcdPool = tcdPool; -} - -/*! - * brief Installs a callback function for the eDMA transfer. - * - * This callback is called in the eDMA IRQ handler. Use the callback to do something after - * the current major loop transfer completes. This function will be called every time one tcd finished transfer. - * - * param handle eDMA handle pointer. - * param callback eDMA callback function pointer. - * param userData A parameter for the callback function. - */ -void EDMA_SetCallback(edma_handle_t *handle, edma_callback callback, void *userData) -{ - assert(handle != NULL); - - handle->callback = callback; - handle->userData = userData; -} - -static edma_transfer_size_t EDMA_TransferWidthMapping(uint32_t width) -{ - edma_transfer_size_t transferSize = kEDMA_TransferSize1Bytes; - - /* map width to register value */ - switch (width) - { - /* width 8bit */ - case 1U: - transferSize = kEDMA_TransferSize1Bytes; - break; - /* width 16bit */ - case 2U: - transferSize = kEDMA_TransferSize2Bytes; - break; - /* width 32bit */ - case 4U: - transferSize = kEDMA_TransferSize4Bytes; - break; -#if (defined(FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) - /* width 64bit */ - case 8U: - transferSize = kEDMA_TransferSize8Bytes; - break; -#endif -#if (defined(FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) - /* width 128bit */ - case 16U: - transferSize = kEDMA_TransferSize16Bytes; - break; -#endif - /* width 256bit */ - case 32U: - transferSize = kEDMA_TransferSize32Bytes; - break; -#if (defined(FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) - /* width 512bit */ - case 64U: - transferSize = kEDMA_TransferSize64Bytes; - break; -#endif -#if (defined(FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) - /* width 1024bit */ - case 128U: - transferSize = kEDMA_TransferSize128Bytes; - break; -#endif - default: - /* All the cases have been listed above, the default clause should not be reached. */ - assert(false); - break; - } - - return transferSize; -} - -/*! - * brief Prepares the eDMA transfer structure configurations. - * - * This function prepares the transfer configuration structure according to the user input. - * - * param config The user configuration structure of type edma_transfer_t. - * param srcAddr eDMA transfer source address. - * param srcWidth eDMA transfer source address width(bytes). - * param srcOffset source address offset. - * param destAddr eDMA transfer destination address. - * param destWidth eDMA transfer destination address width(bytes). - * param destOffset destination address offset. - * param bytesEachRequest eDMA transfer bytes per channel request. - * param transferBytes eDMA transfer bytes to be transferred. - * note The data address and the data width must be consistent. For example, if the SRC - * is 4 bytes, the source address must be 4 bytes aligned, or it results in - * source address error (SAE). - * User can check if 128 bytes support is available for specific instance by - * FSL_FEATURE_EDMA_INSTANCE_SUPPORT_128_BYTES_TRANSFERn. - */ -void EDMA_PrepareTransferConfig(edma_transfer_config_t *config, - void *srcAddr, - uint32_t srcWidth, - int16_t srcOffset, - void *destAddr, - uint32_t destWidth, - int16_t destOffset, - uint32_t bytesEachRequest, - uint32_t transferBytes) -{ - assert(config != NULL); - assert(srcAddr != NULL); - assert(destAddr != NULL); -#if (defined(FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) - assert((srcWidth != 0U) && (srcWidth <= 128U) && ((srcWidth & (srcWidth - 1U)) == 0U)); - assert((destWidth != 0U) && (destWidth <= 128U) && ((destWidth & (destWidth - 1U)) == 0U)); -#elif (defined(FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) - assert((srcWidth != 0U) && (srcWidth <= 64U) && ((srcWidth & (srcWidth - 1U)) == 0U)); - assert((destWidth != 0U) && (destWidth <= 64U) && ((destWidth & (destWidth - 1U)) == 0U)); -#else - assert((srcWidth != 0U) && (srcWidth <= 32U) && ((srcWidth & (srcWidth - 1U)) == 0U)); - assert((destWidth != 0U) && (destWidth <= 32U) && ((destWidth & (destWidth - 1U)) == 0U)); -#endif -#if (!defined(FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) || !FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) - assert(srcWidth != 8U); - assert(srcWidth != 8U); -#endif -#if (!defined(FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) || !FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) - assert(srcWidth != 16U); - assert(srcWidth != 16U); -#endif -#if (!defined(FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) || !FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) - assert(srcWidth != 64U); - assert(srcWidth != 64U); -#endif - assert((transferBytes % bytesEachRequest) == 0U); - assert((((uint32_t)(uint8_t *)srcAddr) % srcWidth) == 0U); - assert((((uint32_t)(uint8_t *)destAddr) % destWidth) == 0U); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->destAddr = CONVERT_TO_DMA_ADDRESS((uint32_t)(uint32_t *)destAddr); - config->srcAddr = CONVERT_TO_DMA_ADDRESS((uint32_t)(uint32_t *)srcAddr); - config->minorLoopBytes = bytesEachRequest; - config->majorLoopCounts = transferBytes / bytesEachRequest; - config->srcTransferSize = EDMA_TransferWidthMapping(srcWidth); - config->destTransferSize = EDMA_TransferWidthMapping(destWidth); - config->destOffset = destOffset; - config->srcOffset = srcOffset; - /* enable major interrupt by default */ - config->enabledInterruptMask = (uint16_t)kEDMA_MajorInterruptEnable; -} - -/*! - * brief Prepares the eDMA transfer structure. - * - * This function prepares the transfer configuration structure according to the user input. - * - * param config The user configuration structure of type edma_transfer_t. - * param srcAddr eDMA transfer source address. - * param srcWidth eDMA transfer source address width(bytes). - * param destAddr eDMA transfer destination address. - * param destWidth eDMA transfer destination address width(bytes). - * param bytesEachRequest eDMA transfer bytes per channel request. - * param transferBytes eDMA transfer bytes to be transferred. - * param type eDMA transfer type. - * note The data address and the data width must be consistent. For example, if the SRC - * is 4 bytes, the source address must be 4 bytes aligned, or it results in - * source address error (SAE). - */ -void EDMA_PrepareTransfer(edma_transfer_config_t *config, - void *srcAddr, - uint32_t srcWidth, - void *destAddr, - uint32_t destWidth, - uint32_t bytesEachRequest, - uint32_t transferBytes, - edma_transfer_type_t type) -{ - assert(config != NULL); - - int16_t srcOffset = 0, destOffset = 0; - - switch (type) - { - case kEDMA_MemoryToMemory: - destOffset = (int16_t)destWidth; - srcOffset = (int16_t)srcWidth; - break; - case kEDMA_MemoryToPeripheral: - destOffset = 0; - srcOffset = (int16_t)srcWidth; - break; - case kEDMA_PeripheralToMemory: - destOffset = (int16_t)destWidth; - srcOffset = 0; - break; - case kEDMA_PeripheralToPeripheral: - destOffset = 0; - srcOffset = 0; - break; - default: - /* All the cases have been listed above, the default clause should not be reached. */ - assert(false); - break; - } - - EDMA_PrepareTransferConfig(config, srcAddr, srcWidth, srcOffset, destAddr, destWidth, destOffset, bytesEachRequest, - transferBytes); -} - -/*! - * brief Prepares the eDMA transfer content descriptor. - * - * This function prepares the transfer content descriptor structure according to the user input. - * - * param handle eDMA handle pointer. - * param tcd Pointer to eDMA transfer content descriptor structure. - * param srcAddr eDMA transfer source address. - * param srcWidth eDMA transfer source address width(bytes). - * param srcOffset source address offset. - * param destAddr eDMA transfer destination address. - * param destWidth eDMA transfer destination address width(bytes). - * param destOffset destination address offset. - * param bytesEachRequest eDMA transfer bytes per channel request. - * param transferBytes eDMA transfer bytes to be transferred. - * param nextTcd eDMA transfer linked TCD address. - * - * note The data address and the data width must be consistent. For example, if the SRC - * is 4 bytes, the source address must be 4 bytes aligned, or it results in - * source address error (SAE). - */ -void EDMA_PrepareTransferTCD(edma_handle_t *handle, - edma_tcd_t *tcd, - void *srcAddr, - uint32_t srcWidth, - int16_t srcOffset, - void *destAddr, - uint32_t destWidth, - int16_t destOffset, - uint32_t bytesEachRequest, - uint32_t transferBytes, - edma_tcd_t *nextTcd) -{ - assert(tcd != NULL); - assert(srcAddr != NULL); - assert(destAddr != NULL); -#if (defined(FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) - assert((srcWidth != 0U) && (srcWidth <= 128U) && ((srcWidth & (srcWidth - 1U)) == 0U) && - (FSL_FEATURE_EDMA_INSTANCE_SUPPORT_128_BYTES_TRANSFERn(handle->base) == 1)); - assert((destWidth != 0U) && (destWidth <= 128U) && ((destWidth & (destWidth - 1U)) == 0U) && - (FSL_FEATURE_EDMA_INSTANCE_SUPPORT_128_BYTES_TRANSFERn(handle->base) == 1)); -#elif (defined(FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) - assert((srcWidth != 0U) && (srcWidth <= 64U) && ((srcWidth & (srcWidth - 1U)) == 0U)); - assert((destWidth != 0U) && (destWidth <= 64U) && ((destWidth & (destWidth - 1U)) == 0U)); -#else - assert((srcWidth != 0U) && (srcWidth <= 32U) && ((srcWidth & (srcWidth - 1U)) == 0U)); - assert((destWidth != 0U) && (destWidth <= 32U) && ((destWidth & (destWidth - 1U)) == 0U)); -#endif -#if (!defined(FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) || !FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) - assert(srcWidth != 8U); - assert(srcWidth != 8U); -#endif -#if (!defined(FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) || !FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) - assert(srcWidth != 16U); - assert(srcWidth != 16U); -#endif -#if (!defined(FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) || !FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) - assert(srcWidth != 64U); - assert(srcWidth != 64U); -#endif - assert((transferBytes % bytesEachRequest) == 0U); - assert((((uint32_t)(uint32_t *)srcAddr) % srcWidth) == 0U); - assert((((uint32_t)(uint32_t *)destAddr) % destWidth) == 0U); - - edma_transfer_size_t srcTransferSize = EDMA_TransferWidthMapping(srcWidth), - destTransferSize = EDMA_TransferWidthMapping(srcWidth); - - /* Initializes the configure structure to zero. */ - EDMA_TcdResetExt(handle->base, tcd); - assert((bytesEachRequest % (1UL << ((uint32_t)srcTransferSize))) == 0U); - assert((bytesEachRequest % (1UL << ((uint32_t)destTransferSize))) == 0U); - assert(((uint32_t)srcOffset % (1UL << ((uint32_t)srcTransferSize))) == 0U); - assert(((uint32_t)destOffset % (1UL << ((uint32_t)destTransferSize))) == 0U); - assert(((uint32_t)(uint32_t *)srcAddr % (1UL << ((uint32_t)srcTransferSize))) == 0U); - assert(((uint32_t)(uint32_t *)destAddr % (1UL << ((uint32_t)destTransferSize))) == 0U); - - EDMA_TCD_SADDR(tcd, EDMA_TCD_TYPE(handle->base)) = CONVERT_TO_DMA_ADDRESS((uint32_t *)srcAddr); - /* destination address */ - EDMA_TCD_DADDR(tcd, EDMA_TCD_TYPE(handle->base)) = CONVERT_TO_DMA_ADDRESS((uint32_t *)destAddr); - /* Source data and destination data transfer size */ - EDMA_TCD_ATTR(tcd, EDMA_TCD_TYPE(handle->base)) = DMA_ATTR_SSIZE(srcTransferSize) | DMA_ATTR_DSIZE(destTransferSize); - - /* Source address signed offset */ - EDMA_TCD_SOFF(tcd, EDMA_TCD_TYPE(handle->base)) = (uint16_t)(srcOffset); - /* Destination address signed offset */ - EDMA_TCD_DOFF(tcd, EDMA_TCD_TYPE(handle->base)) = (uint16_t)(destOffset); - - EDMA_TCD_NBYTES(tcd, EDMA_TCD_TYPE(handle->base)) = DMA_NBYTES_MLOFFNO_NBYTES(bytesEachRequest); - - /* Current major iteration count */ - EDMA_TCD_CITER(tcd, EDMA_TCD_TYPE(handle->base)) = (uint16_t)(transferBytes / bytesEachRequest); - /* Starting major iteration count */ - EDMA_TCD_BITER(tcd, EDMA_TCD_TYPE(handle->base)) = (uint16_t)(transferBytes / bytesEachRequest); - /* reset CSR firstly */ - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(handle->base)) = DMA_CSR_DREQ(1U); - /* Enable scatter/gather processing */ - if (nextTcd != NULL) - { - EDMA_TCD_DLAST_SGA(tcd, EDMA_TCD_TYPE(handle->base)) = CONVERT_TO_DMA_ADDRESS(nextTcd); - /* - Before call EDMA_TcdSetTransferConfig or EDMA_SetTransferConfig, - user must call EDMA_TcdReset or EDMA_ResetChannel which will set - DREQ, so must use "|" or "&" rather than "=". - - Clear the DREQ bit because scatter gather has been enabled, so the - previous transfer is not the last transfer, and channel request should - be enabled at the next transfer(the next TCD). - */ - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(handle->base)) = - (EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(handle->base)) | (uint16_t)DMA_CSR_ESG_MASK) & ~(uint16_t)DMA_CSR_DREQ_MASK; - } - - /* configure interrupt/auto disable channel request, enable major interrupt by default */ - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(handle->base)) |= - (EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(handle->base)) & (~(uint16_t)kEDMA_ErrorInterruptEnable)) | - (uint16_t)kEDMA_MajorInterruptEnable; -} - -/*! - * brief Submits the eDMA transfer content descriptor. - * - * This function submits the eDMA transfer request according to the transfer content descriptor. - * In scatter gather mode, call this function will add a configured tcd to the circular list of tcd pool. - * The tcd pools is setup by call function EDMA_InstallTCDMemory before. - * - * Typical user case: - * 1. submit single transfer - * code - * edma_tcd_t tcd; - * EDMA_PrepareTransferTCD(handle, tcd, ....) - * EDMA_SubmitTransferTCD(handle, tcd) - * EDMA_StartTransfer(handle) - * endcode - * - * 2. submit static link transfer, - * code - * edma_tcd_t tcd[2]; - * EDMA_PrepareTransferTCD(handle, &tcd[0], ....) - * EDMA_PrepareTransferTCD(handle, &tcd[1], ....) - * EDMA_SubmitTransferTCD(handle, &tcd[0]) - * EDMA_StartTransfer(handle) - * endcode - * - * 3. submit dynamic link transfer - * code - * edma_tcd_t tcdpool[2]; - * EDMA_InstallTCDMemory(&g_DMA_Handle, tcdpool, 2); - * edma_tcd_t tcd; - * EDMA_PrepareTransferTCD(handle, tcd, ....) - * EDMA_SubmitTransferTCD(handle, tcd) - * EDMA_PrepareTransferTCD(handle, tcd, ....) - * EDMA_SubmitTransferTCD(handle, tcd) - * EDMA_StartTransfer(handle) - * endcode - * - * 4. submit loop transfer - * code - * edma_tcd_t tcd[2]; - * EDMA_PrepareTransferTCD(handle, &tcd[0], ...,&tcd[1]) - * EDMA_PrepareTransferTCD(handle, &tcd[1], ..., &tcd[0]) - * EDMA_SubmitTransferTCD(handle, &tcd[0]) - * EDMA_StartTransfer(handle) - * endcode - * - * param handle eDMA handle pointer. - * param tcd Pointer to eDMA transfer content descriptor structure. - * - * retval kStatus_EDMA_Success It means submit transfer request succeed. - * retval kStatus_EDMA_QueueFull It means TCD queue is full. Submit transfer request is not allowed. - * retval kStatus_EDMA_Busy It means the given channel is busy, need to submit request later. - */ -status_t EDMA_SubmitTransferTCD(edma_handle_t *handle, edma_tcd_t *tcd) -{ - assert(handle != NULL); - assert(handle->tcdBase != NULL); - - edma_tcd_t *tcdRegs = handle->tcdBase; - - if (handle->tcdPool == NULL) - { - /* - * Check if EDMA channel is busy: - * 1. if channel active bit is set, it implies that minor loop is executing, then channel is busy - * 2. if channel active bit is not set and BITER not equal to CITER, it implies that major loop is executing, - * then channel is busy - * - * There is one case can not be covered in below condition: - * When transfer request is submitted, but no request from peripheral, that is to say channel sevice doesn't - * begin, if application would like to submit another transfer , then the TCD will be overwritten, since the - * ACTIVE is 0 and BITER = CITER, for such case, it is a scatter gather(link TCD) case actually, so - * application should enabled TCD pool for dynamic scatter gather mode by calling EDMA_InstallTCDMemory. - */ -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - if (((tcdRegs->CSR & DMA_CSR_ACTIVE_MASK) != 0U) || -#else - if (((handle->channelBase->CH_CSR & DMA_CH_CSR_ACTIVE_MASK) != 0U) || -#endif - (((EDMA_TCD_CITER(tcdRegs, EDMA_TCD_TYPE(handle->base)) & DMA_CITER_ELINKNO_CITER_MASK) != - (EDMA_TCD_BITER(tcdRegs, EDMA_TCD_TYPE(handle->base)) & DMA_BITER_ELINKNO_BITER_MASK)))) - { - return kStatus_EDMA_Busy; - } - else - { - EDMA_InstallTCD(handle->base, handle->channel, tcd); - /* Enable auto disable request feature */ - EDMA_EnableAutoStopRequest(handle->base, handle->channel, true); - /* Enable major interrupt */ - EDMA_EnableChannelInterrupts(handle->base, handle->channel, kEDMA_MajorInterruptEnable); - - return kStatus_Success; - } - } - else /* Use the TCD queue. */ - { - uint32_t primask; - uint16_t csr; - int8_t currentTcd; - int8_t previousTcd; - int8_t nextTcd; - int8_t tmpTcdUsed; - int8_t tmpTcdSize; - - /* Check if tcd pool is full. */ - primask = DisableGlobalIRQ(); - tmpTcdUsed = handle->tcdUsed; - tmpTcdSize = handle->tcdSize; - if (tmpTcdUsed >= tmpTcdSize) - { - EnableGlobalIRQ(primask); - - return kStatus_EDMA_QueueFull; - } - currentTcd = handle->tail; - handle->tcdUsed++; - /* Calculate index of next TCD */ - nextTcd = currentTcd + 1; - if (nextTcd == handle->tcdSize) - { - nextTcd = 0; - } - /* Advance queue tail index */ - handle->tail = nextTcd; - EnableGlobalIRQ(primask); - /* Calculate index of previous TCD */ - previousTcd = currentTcd != 0 ? currentTcd - 1 : (handle->tcdSize - 1); - - /* Configure current TCD block. */ - EDMA_TcdResetExt(handle->base, &handle->tcdPool[currentTcd]); - (void)memcpy(&handle->tcdPool[currentTcd], tcd, sizeof(edma_tcd_t)); - - /* Enable major interrupt */ - EDMA_TCD_CSR((&handle->tcdPool[currentTcd]), EDMA_TCD_TYPE(handle->base)) |= DMA_CSR_INTMAJOR_MASK; - - if ((EDMA_TCD_DLAST_SGA(tcd, EDMA_TCD_TYPE(handle->base)) == 0U) || - ((EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(handle->base)) & DMA_CSR_ESG_MASK) == 0U)) - { - /* Link current TCD with next TCD for identification of current TCD */ - EDMA_TCD_DLAST_SGA((&handle->tcdPool[currentTcd]), EDMA_TCD_TYPE(handle->base)) = - CONVERT_TO_DMA_ADDRESS((uint32_t)&handle->tcdPool[nextTcd]); - } - - /* Chain from previous descriptor unless tcd pool size is 1(this descriptor is its own predecessor). */ - if (currentTcd != previousTcd) - { -#if defined FSL_FEATURE_EDMA_HAS_ERRATA_51327 - if (EDMA_CheckErrata(handle->base, &handle->tcdPool[previousTcd]) != kStatus_Success) - { - return kStatus_InvalidArgument; - } -#endif - /* Enable scatter/gather feature in the previous TCD block. */ - csr = EDMA_TCD_CSR((&handle->tcdPool[previousTcd]), EDMA_TCD_TYPE(handle->base)) | - ((uint16_t)DMA_CSR_ESG_MASK); - csr &= ~((uint16_t)DMA_CSR_DREQ_MASK); - EDMA_TCD_CSR((&handle->tcdPool[previousTcd]), EDMA_TCD_TYPE(handle->base)) = csr; - /* - Check if the TCD block in the registers is the previous one (points to current TCD block). It - is used to check if the previous TCD linked has been loaded in TCD register. If so, it need to - link the TCD register in case link the current TCD with the dead chain when TCD loading occurs - before link the previous TCD block. - */ - if (EDMA_TCD_DLAST_SGA(tcdRegs, EDMA_TCD_TYPE(handle->base)) == - CONVERT_TO_DMA_ADDRESS((uint32_t)&handle->tcdPool[currentTcd])) - { - /* Clear the DREQ bits for the dynamic scatter gather */ - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) |= DMA_CSR_DREQ_MASK; - /* Enable scatter/gather also in the TCD registers. */ - csr = EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) | DMA_CSR_ESG_MASK; - /* Must write the CSR register one-time, because the transfer maybe finished anytime. */ - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) = csr; - /* - It is very important to check the ESG bit! - Because this hardware design: if DONE bit is set, the ESG bit can not be set. So it can - be used to check if the dynamic TCD link operation is successful. If ESG bit is not set - and the DLAST_SGA is not the next TCD address(it means the dynamic TCD link succeed and - the current TCD block has been loaded into TCD registers), it means transfer finished - and TCD link operation fail, so must install TCD content into TCD registers and enable - transfer again. And if ESG is set, it means transfer has not finished, so TCD dynamic - link succeed. - */ - if (0U != (EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) & DMA_CSR_ESG_MASK)) - { - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) &= ~(uint16_t)DMA_CSR_DREQ_MASK; - return kStatus_Success; - } - /* - Check whether the current TCD block is already loaded in the TCD registers. It is another - condition when ESG bit is not set: it means the dynamic TCD link succeed and the current - TCD block has been loaded into TCD registers. - */ - if (EDMA_TCD_DLAST_SGA(tcdRegs, EDMA_TCD_TYPE(handle->base)) == - CONVERT_TO_DMA_ADDRESS((uint32_t)&handle->tcdPool[nextTcd])) - { - return kStatus_Success; - } - /* - If go to this, means the previous transfer finished, and the DONE bit is set. - So shall configure TCD registers. - */ - } - else if (EDMA_TCD_DLAST_SGA(tcdRegs, EDMA_TCD_TYPE(handle->base)) != 0UL) - { - /* The current TCD block has been linked successfully. */ - return kStatus_Success; - } - else - { - /* - DLAST_SGA is 0 and it means the first submit transfer, so shall configure - TCD registers. - */ - } - } - /* There is no live chain, TCD block need to be installed in TCD registers. */ - EDMA_InstallTCD(handle->base, handle->channel, &handle->tcdPool[currentTcd]); - - return kStatus_Success; - } -} - -/*! - * brief Submits the eDMA transfer request. - * - * This function submits the eDMA transfer request according to the transfer configuration structure. - * In scatter gather mode, call this function will add a configured tcd to the circular list of tcd pool. - * The tcd pools is setup by call function EDMA_InstallTCDMemory before. - * - * param handle eDMA handle pointer. - * param config Pointer to eDMA transfer configuration structure. - * retval kStatus_EDMA_Success It means submit transfer request succeed. - * retval kStatus_EDMA_QueueFull It means TCD queue is full. Submit transfer request is not allowed. - * retval kStatus_EDMA_Busy It means the given channel is busy, need to submit request later. - */ -status_t EDMA_SubmitTransfer(edma_handle_t *handle, const edma_transfer_config_t *config) -{ - assert(handle != NULL); - assert(config != NULL); - assert(handle->tcdBase != NULL); -#if (defined(FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) - assert(((config->srcTransferSize != kEDMA_TransferSize128Bytes) && - (config->destTransferSize != kEDMA_TransferSize128Bytes)) || - (FSL_FEATURE_EDMA_INSTANCE_SUPPORT_128_BYTES_TRANSFERn(handle->base) == 1)); -#endif - edma_tcd_t *tcdRegs = handle->tcdBase; - - if (handle->tcdPool == NULL) - { - /* - * Check if EDMA channel is busy: - * 1. if channel active bit is set, it implies that minor loop is executing, then channel is busy - * 2. if channel active bit is not set and BITER not equal to CITER, it implies that major loop is executing, - * then channel is busy - * - * There is one case can not be covered in below condition: - * When transfer request is submitted, but no request from peripheral, that is to say channel sevice doesn't - * begin, if application would like to submit another transfer , then the TCD will be overwritten, since the - * ACTIVE is 0 and BITER = CITER, for such case, it is a scatter gather(link TCD) case actually, so - * application should enabled TCD pool for dynamic scatter gather mode by calling EDMA_InstallTCDMemory. - */ -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - if (((tcdRegs->CSR & DMA_CSR_ACTIVE_MASK) != 0U) || -#else - if (((handle->channelBase->CH_CSR & DMA_CH_CSR_ACTIVE_MASK) != 0U) || -#endif - (((EDMA_TCD_CITER(tcdRegs, EDMA_TCD_TYPE(handle->base)) & DMA_CITER_ELINKNO_CITER_MASK) != - (EDMA_TCD_BITER(tcdRegs, EDMA_TCD_TYPE(handle->base)) & DMA_BITER_ELINKNO_BITER_MASK)))) - { - return kStatus_EDMA_Busy; - } - else - { - EDMA_TcdSetTransferConfigExt(handle->base, tcdRegs, config, NULL); - /* Enable auto disable request feature */ - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) |= DMA_CSR_DREQ_MASK; - /* Enable major interrupt */ - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) |= DMA_CSR_INTMAJOR_MASK; - - return kStatus_Success; - } - } - else /* Use the TCD queue. */ - { - uint32_t primask; - uint16_t csr; - int8_t currentTcd; - int8_t previousTcd; - int8_t nextTcd; - int8_t tmpTcdUsed; - int8_t tmpTcdSize; - - /* Check if tcd pool is full. */ - primask = DisableGlobalIRQ(); - tmpTcdUsed = handle->tcdUsed; - tmpTcdSize = handle->tcdSize; - if (tmpTcdUsed >= tmpTcdSize) - { - EnableGlobalIRQ(primask); - - return kStatus_EDMA_QueueFull; - } - currentTcd = handle->tail; - handle->tcdUsed++; - /* Calculate index of next TCD */ - nextTcd = currentTcd + 1; - if (nextTcd == handle->tcdSize) - { - nextTcd = 0; - } - /* Advance queue tail index */ - handle->tail = nextTcd; - EnableGlobalIRQ(primask); - /* Calculate index of previous TCD */ - previousTcd = currentTcd != 0 ? currentTcd - 1 : (handle->tcdSize - 1); - /* Configure current TCD block. */ - EDMA_TcdResetExt(handle->base, &handle->tcdPool[currentTcd]); - EDMA_TcdSetTransferConfigExt(handle->base, &handle->tcdPool[currentTcd], config, NULL); - /* Enable major interrupt */ - EDMA_TCD_CSR((&handle->tcdPool[currentTcd]), EDMA_TCD_TYPE(handle->base)) |= DMA_CSR_INTMAJOR_MASK; - /* Link current TCD with next TCD for identification of current TCD */ - EDMA_TCD_DLAST_SGA((&handle->tcdPool[currentTcd]), EDMA_TCD_TYPE(handle->base)) = - CONVERT_TO_DMA_ADDRESS((uint32_t)&handle->tcdPool[nextTcd]); - /* Chain from previous descriptor unless tcd pool size is 1(this descriptor is its own predecessor). */ - if (currentTcd != previousTcd) - { -#if defined FSL_FEATURE_EDMA_HAS_ERRATA_51327 - if (EDMA_CheckErrata(handle->base, &handle->tcdPool[previousTcd]) != kStatus_Success) - { - return kStatus_InvalidArgument; - } -#endif - /* Enable scatter/gather feature in the previous TCD block. */ - csr = EDMA_TCD_CSR((&handle->tcdPool[previousTcd]), EDMA_TCD_TYPE(handle->base)) | - ((uint16_t)DMA_CSR_ESG_MASK); - csr &= ~((uint16_t)DMA_CSR_DREQ_MASK); - EDMA_TCD_CSR((&handle->tcdPool[previousTcd]), EDMA_TCD_TYPE(handle->base)) = csr; - /* - Check if the TCD block in the registers is the previous one (points to current TCD block). It - is used to check if the previous TCD linked has been loaded in TCD register. If so, it need to - link the TCD register in case link the current TCD with the dead chain when TCD loading occurs - before link the previous TCD block. - */ - if (EDMA_TCD_DLAST_SGA(handle->tcdBase, EDMA_TCD_TYPE(handle->base)) == - CONVERT_TO_DMA_ADDRESS((uint32_t)&handle->tcdPool[currentTcd])) - { - /* Clear the DREQ bits for the dynamic scatter gather */ - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) |= DMA_CSR_DREQ_MASK; - /* Enable scatter/gather also in the TCD registers. */ - csr = EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) | DMA_CSR_ESG_MASK; - /* Must write the CSR register one-time, because the transfer maybe finished anytime. */ - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) = csr; - /* - It is very important to check the ESG bit! - Because this hardware design: if DONE bit is set, the ESG bit can not be set. So it can - be used to check if the dynamic TCD link operation is successful. If ESG bit is not set - and the DLAST_SGA is not the next TCD address(it means the dynamic TCD link succeed and - the current TCD block has been loaded into TCD registers), it means transfer finished - and TCD link operation fail, so must install TCD content into TCD registers and enable - transfer again. And if ESG is set, it means transfer has not finished, so TCD dynamic - link succeed. - */ - if (0U != (EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) & DMA_CSR_ESG_MASK)) - { - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) &= ~(uint16_t)DMA_CSR_DREQ_MASK; - return kStatus_Success; - } - /* - Check whether the current TCD block is already loaded in the TCD registers. It is another - condition when ESG bit is not set: it means the dynamic TCD link succeed and the current - TCD block has been loaded into TCD registers. - */ - if (EDMA_TCD_DLAST_SGA(handle->tcdBase, EDMA_TCD_TYPE(handle->base)) == - CONVERT_TO_DMA_ADDRESS((uint32_t)&handle->tcdPool[nextTcd])) - { - return kStatus_Success; - } - /* - If go to this, means the previous transfer finished, and the DONE bit is set. - So shall configure TCD registers. - */ - } - else if (EDMA_TCD_DLAST_SGA(handle->tcdBase, EDMA_TCD_TYPE(handle->base)) != 0UL) - { - /* The current TCD block has been linked successfully. */ - return kStatus_Success; - } - else - { - /* - DLAST_SGA is 0 and it means the first submit transfer, so shall configure - TCD registers. - */ - } - } - /* There is no live chain, TCD block need to be installed in TCD registers. */ - EDMA_InstallTCD(handle->base, handle->channel, &handle->tcdPool[currentTcd]); - - return kStatus_Success; - } -} - -/*! - * brief Submits the eDMA scatter gather transfer configurations. - * - * The function is target for submit loop transfer request, - * the ring transfer request means that the transfer request TAIL is link to HEAD, such as, - * A->B->C->D->A, or A->A - * - * To use the ring transfer feature, the application should allocate several transfer object, such as - * @code - * edma_channel_transfer_config_t transfer[2]; - * EDMA_TransferSubmitLoopTransfer(handle, &transfer, 2U); - * @endcode - * Then eDMA driver will link transfer[0] and transfer[1] to each other - * - * note Application should check the return value of this function to avoid transfer request - * submit failed - * - * param handle eDMA handle pointer - * param transfer pointer to user's eDMA channel configure structure, see edma_channel_transfer_config_t for detail - * param transferLoopCount the count of the transfer ring, if loop count is 1, that means that the one will link to - * itself. - * - * retval #kStatus_Success It means submit transfer request succeed - * retval #kStatus_EDMA_Busy channel is in busy status - * retval #kStatus_InvalidArgument Invalid Argument - */ -status_t EDMA_SubmitLoopTransfer(edma_handle_t *handle, edma_transfer_config_t *transfer, uint32_t transferLoopCount) -{ - assert(transfer != NULL); - assert(handle != NULL); - assert(handle->tcdPool != NULL); - - uint32_t i = 0U; - - if (handle->tcdSize < (int8_t)transferLoopCount) - { - return kStatus_InvalidArgument; - } - - /* - * Check if EDMA channel is busy: - * 1. if channel active bit is set, it implies that minor loop is executing, then channel is busy - * 2. if channel active bit is not set and BITER not equal to CITER, it implies that major loop is executing, - * then channel is busy - * - * There is one case can not be covered in below condition: - * When transfer request is submitted, but no request from peripheral, that is to say channel service doesn't - * begin, if application would like to submit another transfer , then the TCD will be overwritten, since the - * ACTIVE is 0 and BITER = CITER, for such case, it is a scatter gather(link TCD) case actually, so - * application should enabled TCD pool for dynamic scatter gather mode by calling EDMA_InstallTCDMemory. - */ -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - if (((handle->tcdBase->CSR & DMA_CSR_ACTIVE_MASK) != 0U) || -#else - if (((handle->channelBase->CH_CSR & DMA_CH_CSR_ACTIVE_MASK) != 0U) || -#endif - (((EDMA_TCD_CITER(handle->tcdBase, EDMA_TCD_TYPE(handle->base)) & DMA_CITER_ELINKNO_CITER_MASK) != - (EDMA_TCD_BITER(handle->tcdBase, EDMA_TCD_TYPE(handle->base)) & DMA_BITER_ELINKNO_BITER_MASK)))) - { - return kStatus_EDMA_Busy; - } - - (void)memset(handle->tcdPool, 0, (uint32_t)handle->tcdSize * sizeof(edma_tcd_t)); - for (i = 0U; i < transferLoopCount - 1UL; i++) - { - transfer[i].linkTCD = &handle->tcdPool[i + 1UL]; - EDMA_ConfigChannelSoftwareTCDExt(handle->base, &(handle->tcdPool[i]), &transfer[i]); -#if defined FSL_FEATURE_EDMA_HAS_ERRATA_51327 - if (EDMA_CheckErrata(handle->base, &(handle->tcdPool[i])) != kStatus_Success) - { - return kStatus_InvalidArgument; - } -#endif - } - - /* prepare last one in the ring and link it to the HEAD of the ring */ - transfer[i].linkTCD = &handle->tcdPool[0]; - EDMA_ConfigChannelSoftwareTCDExt(handle->base, &(handle->tcdPool[i]), &transfer[i]); - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - if (((transfer->enableSrcMinorLoopOffset) || (transfer->enableDstMinorLoopOffset))) - { - EDMA_EnableMinorLoopMapping(handle->psBase, true); - } -#endif - /* There is no live chain, TCD block need to be installed in TCD registers. */ - EDMA_InstallTCD(handle->base, handle->channel, &handle->tcdPool[0U]); - - /* enable interrupt */ - EDMA_EnableChannelInterrupts(handle->base, handle->channel, - ((uint32_t)transfer->enabledInterruptMask & ~((uint32_t)kEDMA_ErrorInterruptEnable))); - - return kStatus_Success; -} - -/*! - * brief eDMA starts transfer. - * - * This function enables the channel request. Users can call this function after submitting the transfer request - * or before submitting the transfer request. - * - * param handle eDMA handle pointer. - */ -void EDMA_StartTransfer(edma_handle_t *handle) -{ - assert(handle != NULL); - - edma_tcd_t *tcdRegs = handle->tcdBase; - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - if (handle->tcdPool == NULL) - { - handle->base->SERQ = DMA_SERQ_SERQ(handle->channel); - } - else /* Use the TCD queue. */ - { - uint32_t primask; - - /* Check if there was at least one descriptor submitted since reset (TCD in registers is valid) */ - if (tcdRegs->DLAST_SGA != 0U) - { - primask = DisableGlobalIRQ(); - /* Check if channel request is actually disable. */ - if ((handle->base->ERQ & ((uint32_t)1U << handle->channel)) == 0U) - { - /* Check if transfer is paused. */ - tmpCSR = tcdRegs->CSR; - if ((0U == (tmpCSR & DMA_CSR_DONE_MASK)) || (0U != (tmpCSR & DMA_CSR_ESG_MASK))) - { - /* - Re-enable channel request must be as soon as possible, so must put it into - critical section to avoid task switching or interrupt service routine. - */ - handle->base->SERQ = DMA_SERQ_SERQ(handle->channel); - } - } - EnableGlobalIRQ(primask); - } - } -#else -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_CHANNEL_MUX -#if defined FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX - if (((uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_MUXn(handle->base) == 1U) && - (EDMA_MP_BASE(handle->base)->MP_REGS.EDMA5_REG.CH_MUX[handle->channel] == 0U) && - (FSL_FEATURE_EDMA_INSTANCE_HAS_MP_CHANNEL_MUXn(handle->base) == 1U)) - { - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) |= DMA_CSR_START_MASK; - } - else if (((uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_MUXn(handle->base) == 1U) && - handle->channelBase->CH_REGS.EDMA4_REG.CH_MUX == 0U && - !(FSL_FEATURE_EDMA_INSTANCE_HAS_MP_CHANNEL_MUXn(handle->base) == 1U)) - { - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) |= DMA_CSR_START_MASK; - } - else -#else - if (((uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_MUXn(handle->base) == 1U) && - handle->channelBase->CH_REGS.EDMA4_REG.CH_MUX == 0U) - { - EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) |= DMA_CSR_START_MASK; - } - else -#endif -#endif - if (handle->tcdPool == NULL) - { - handle->channelBase->CH_CSR |= DMA_CH_CSR_ERQ_MASK; - } - else - { - /* Check if channel request is actually disable. */ - if ((handle->channelBase->CH_CSR & DMA_CH_CSR_ERQ_MASK) == 0U) - { - /* Check if transfer is paused. */ - if ((!((handle->channelBase->CH_CSR & DMA_CH_CSR_DONE_MASK) != 0U)) || - ((EDMA_TCD_CSR(tcdRegs, EDMA_TCD_TYPE(handle->base)) & DMA_CSR_ESG_MASK) != 0U)) - { - /* - Re-enable channel request must be as soon as possible, so must put it into - critical section to avoid task switching or interrupt service routine. - */ - handle->channelBase->CH_CSR |= DMA_CH_CSR_ERQ_MASK; - } - } - } -#endif -} - -/*! - * brief eDMA stops transfer. - * - * This function disables the channel request to pause the transfer. Users can call EDMA_StartTransfer() - * again to resume the transfer. - * - * param handle eDMA handle pointer. - */ -void EDMA_StopTransfer(edma_handle_t *handle) -{ - assert(handle != NULL); -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - handle->base->CERQ = DMA_CERQ_CERQ(handle->channel); -#else - handle->channelBase->CH_CSR = handle->channelBase->CH_CSR & (~(DMA_CH_CSR_DONE_MASK | DMA_CH_CSR_ERQ_MASK)); -#endif -} - -/*! - * brief eDMA aborts transfer. - * - * This function disables the channel request and clear transfer status bits. - * Users can submit another transfer after calling this API. - * - * param handle DMA handle pointer. - */ -void EDMA_AbortTransfer(edma_handle_t *handle) -{ - EDMA_StopTransfer(handle); - /* - Clear CSR to release channel. Because if the given channel started transfer, - CSR will be not zero. Because if it is the last transfer, DREQ will be set. - If not, ESG will be set. - */ - EDMA_TcdResetExt(handle->base, handle->tcdBase); - - /* Handle the tcd */ - if (handle->tcdPool != NULL) - { - handle->header = 1; - handle->tail = 0; - handle->tcdUsed = 0; - } -} - -/*! - * brief eDMA IRQ handler for the current major loop transfer completion. - * - * This function clears the channel major interrupt flag and calls - * the callback function if it is not NULL. - * - * Note: - * For the case using TCD queue, when the major iteration count is exhausted, additional operations are performed. - * These include the final address adjustments and reloading of the BITER field into the CITER. - * Assertion of an optional interrupt request also occurs at this time, as does a possible fetch of a new TCD from - * memory using the scatter/gather address pointer included in the descriptor (if scatter/gather is enabled). - * - * For instance, when the time interrupt of TCD[0] happens, the TCD[1] has already been loaded into the eDMA engine. - * As sga and sga_index are calculated based on the DLAST_SGA bitfield lies in the TCD_CSR register, the sga_index - * in this case should be 2 (DLAST_SGA of TCD[1] stores the address of TCD[2]). Thus, the "tcdUsed" updated should be - * (tcdUsed - 2U) which indicates the number of TCDs can be loaded in the memory pool (because TCD[0] and TCD[1] have - * been loaded into the eDMA engine at this point already.). - * - * For the last two continuous ISRs in a scatter/gather process, they both load the last TCD (The last ISR does not - * load a new TCD) from the memory pool to the eDMA engine when major loop completes. - * Therefore, ensure that the header and tcdUsed updated are identical for them. - * tcdUsed are both 0 in this case as no TCD to be loaded. - * - * See the "eDMA basic data flow" in the eDMA Functional description section of the Reference Manual for - * further details. - * - * param handle eDMA handle pointer. - */ -void EDMA_HandleIRQ(edma_handle_t *handle) -{ - assert(handle != NULL); - - bool transfer_done; - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - /* Check if transfer is already finished. */ - transfer_done = ((handle->tcdBase->CSR & DMA_CSR_DONE_MASK) != 0U); -#else - transfer_done = (bool)(handle->channelBase->CH_CSR & DMA_CH_CSR_DONE_MASK); -#endif - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - if ((handle->base->INT >> channel) != 0U) - { - handle->base->CINT = channel; - } -#else - if ((handle->channelBase->CH_INT & DMA_CH_INT_INT_MASK) != 0U) - { - handle->channelBase->CH_INT |= DMA_CH_INT_INT_MASK; - } -#endif - - if (handle->tcdPool == NULL) - { - if (handle->callback != NULL) - { - (handle->callback)(handle, handle->userData, transfer_done, 0); - } - } - else /* Use the TCD queue. Please refer to the API descriptions in the eDMA header file for detailed information. */ - { - uint32_t sga = (uint32_t)EDMA_TCD_DLAST_SGA(handle->tcdBase, EDMA_TCD_TYPE(handle->base)); - uint32_t sga_index; - int32_t tcds_done; - uint8_t new_header; - bool esg = ((EDMA_TCD_CSR(handle->tcdBase, EDMA_TCD_TYPE(handle->base)) & DMA_CSR_ESG_MASK) != 0U); - - /* Get the offset of the next transfer TCD blocks to be loaded into the eDMA engine. */ - sga -= CONVERT_TO_DMA_ADDRESS((uint32_t)handle->tcdPool); - /* Get the index of the next transfer TCD blocks to be loaded into the eDMA engine. */ - sga_index = sga / sizeof(edma_tcd_t); - /* Adjust header positions. */ - if (transfer_done) - { - /* New header shall point to the next TCD to be loaded (current one is already finished) */ - new_header = (uint8_t)sga_index; - } - else - { - /* New header shall point to this descriptor currently loaded (not finished yet) */ - new_header = sga_index != 0U ? (uint8_t)sga_index - 1U : (uint8_t)handle->tcdSize - 1U; - } - /* Calculate the number of finished TCDs */ - if (new_header == (uint8_t)handle->header) - { - int8_t tmpTcdUsed = handle->tcdUsed; - int8_t tmpTcdSize = handle->tcdSize; - - /* check esg here for the case that application submit only one request, once the request complete: - * new_header(1) = handle->header(1) - * tcdUsed(1) != tcdSize(>1) - * As the application submit only once, so scatter gather must not enabled, then tcds_done should be 1 - */ - if ((tmpTcdUsed == tmpTcdSize) || (!esg)) - { - tcds_done = handle->tcdUsed; - } - else - { - /* No TCD in the memory are going to be loaded or internal error occurs. */ - tcds_done = 0; - } - } - else - { - tcds_done = (int32_t)new_header - (int32_t)handle->header; - if (tcds_done < 0) - { - tcds_done += handle->tcdSize; - } - /* - * While code run to here, it means a TCD transfer Done and a new TCD has loaded to the hardware - * so clear DONE here to allow submit scatter gather transfer request in the callback to avoid TCD - * overwritten. - */ - if (transfer_done) - { -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - handle->base->CDNE = handle->channel; -#else - handle->channelBase->CH_CSR |= DMA_CH_CSR_DONE_MASK; -#endif - } - } - /* Advance header which points to the TCD to be loaded into the eDMA engine from memory. */ - handle->header = (int8_t)new_header; - /* Release TCD blocks. tcdUsed is the TCD number which can be used/loaded in the memory pool. */ - handle->tcdUsed -= (int8_t)tcds_done; - /* Invoke callback function. */ - if (NULL != handle->callback) - { - (handle->callback)(handle, handle->userData, transfer_done, tcds_done); - } - - /* - * 1.clear the DONE bit here is meaningful for below cases: - * A new TCD has been loaded to EDMA already: - * need to clear the DONE bit in the IRQ handler to avoid TCD in EDMA been overwritten - * if peripheral request isn't coming before next transfer request. - * 2. Don't clear DONE bit for below case, - * for the case that transfer request submitted in the privious edma callback, this is a case that doesn't - * need scatter gather, so keep DONE bit during the next transfer request submission will re-install the TCD and - * the DONE bit will be cleared together with TCD re-installation. - */ - if (transfer_done) - { - if ((EDMA_TCD_CSR(handle->tcdBase, EDMA_TCD_TYPE(handle->base)) & DMA_CSR_ESG_MASK) != 0U) - { -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - handle->base->CDNE = handle->channel; -#else - handle->channelBase->CH_CSR |= DMA_CH_CSR_DONE_MASK; -#endif - } - } - } -} - -void EDMA_DriverIRQHandler(uint32_t instance, uint32_t channel); -void EDMA_DriverIRQHandler(uint32_t instance, uint32_t channel) -{ -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - if ((s_edmaBases[instance]->INT >> channel) != 0U) - { - EDMA_HandleIRQ(s_EDMAHandle[instance][channel]); - } -#else - if ((EDMA_CHANNEL_BASE(s_edmaBases[instance], channel)->CH_INT & DMA_CH_INT_INT_MASK) != 0U) - { - EDMA_HandleIRQ(s_EDMAHandle[instance][channel]); - } -#endif - SDK_ISR_EXIT_BARRIER; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_edma.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_edma.h deleted file mode 100644 index aafd8603ee1..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_edma.h +++ /dev/null @@ -1,1893 +0,0 @@ -/* - * Copyright 2022-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_EDMA_H_ -#define FSL_EDMA_H_ - -#include "fsl_common.h" -#include "fsl_edma_core.h" -/*! - * @addtogroup edma - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief eDMA driver version */ -#define FSL_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 10, 0)) /*!< Version 2.10.0. */ -/*! @} */ - -/*! @brief eDMA driver name */ -#ifndef FSL_EDMA_DRIVER_EDMA4 -#define FSL_EDMA_DRIVER_EDMA4 (1) -#endif - -/*!@brief Macro used for allocate edma TCD */ -#define EDMA_ALLOCATE_TCD(name, number) AT_NONCACHEABLE_SECTION_ALIGN(edma_tcd_t name[number], EDMA_TCD_ALIGN_SIZE) - -/*! @brief _edma_transfer_status eDMA transfer status */ -enum -{ - kStatus_EDMA_QueueFull = MAKE_STATUS(kStatusGroup_EDMA, 0), /*!< TCD queue is full. */ - kStatus_EDMA_Busy = MAKE_STATUS(kStatusGroup_EDMA, 1), /*!< Channel is busy and can't handle the - transfer request. */ -}; - -/*! @brief Compute the offset unit from DCHPRI3 */ -#define DMA_DCHPRI_INDEX(channel) (((channel) & ~0x03U) | (3U - ((channel)&0x03U))) - -/*! @brief eDMA transfer configuration */ -typedef enum _edma_transfer_size -{ - kEDMA_TransferSize1Bytes = 0x0U, /*!< Source/Destination data transfer size is 1 byte every time */ - kEDMA_TransferSize2Bytes = 0x1U, /*!< Source/Destination data transfer size is 2 bytes every time */ - kEDMA_TransferSize4Bytes = 0x2U, /*!< Source/Destination data transfer size is 4 bytes every time */ -#if (defined(FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_8_BYTES_TRANSFER) - kEDMA_TransferSize8Bytes = 0x3U, /*!< Source/Destination data transfer size is 8 bytes every time */ -#endif -#if (defined(FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) - kEDMA_TransferSize16Bytes = 0x4U, /*!< Source/Destination data transfer size is 16 bytes every time */ -#endif - kEDMA_TransferSize32Bytes = 0x5U, /*!< Source/Destination data transfer size is 32 bytes every time */ -#if (defined(FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_64_BYTES_TRANSFER) - kEDMA_TransferSize64Bytes = 0x6U, /*!< Source/Destination data transfer size is 64 bytes every time */ -#endif -#if (defined(FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_128_BYTES_TRANSFER) - kEDMA_TransferSize128Bytes = 0x7U, /*!< Source/Destination data transfer size is 128 bytes every time */ -#endif -} edma_transfer_size_t; - -/*! @brief eDMA modulo configuration */ -typedef enum _edma_modulo -{ - kEDMA_ModuloDisable = 0x0U, /*!< Disable modulo */ - kEDMA_Modulo2bytes, /*!< Circular buffer size is 2 bytes. */ - kEDMA_Modulo4bytes, /*!< Circular buffer size is 4 bytes. */ - kEDMA_Modulo8bytes, /*!< Circular buffer size is 8 bytes. */ - kEDMA_Modulo16bytes, /*!< Circular buffer size is 16 bytes. */ - kEDMA_Modulo32bytes, /*!< Circular buffer size is 32 bytes. */ - kEDMA_Modulo64bytes, /*!< Circular buffer size is 64 bytes. */ - kEDMA_Modulo128bytes, /*!< Circular buffer size is 128 bytes. */ - kEDMA_Modulo256bytes, /*!< Circular buffer size is 256 bytes. */ - kEDMA_Modulo512bytes, /*!< Circular buffer size is 512 bytes. */ - kEDMA_Modulo1Kbytes, /*!< Circular buffer size is 1 K bytes. */ - kEDMA_Modulo2Kbytes, /*!< Circular buffer size is 2 K bytes. */ - kEDMA_Modulo4Kbytes, /*!< Circular buffer size is 4 K bytes. */ - kEDMA_Modulo8Kbytes, /*!< Circular buffer size is 8 K bytes. */ - kEDMA_Modulo16Kbytes, /*!< Circular buffer size is 16 K bytes. */ - kEDMA_Modulo32Kbytes, /*!< Circular buffer size is 32 K bytes. */ - kEDMA_Modulo64Kbytes, /*!< Circular buffer size is 64 K bytes. */ - kEDMA_Modulo128Kbytes, /*!< Circular buffer size is 128 K bytes. */ - kEDMA_Modulo256Kbytes, /*!< Circular buffer size is 256 K bytes. */ - kEDMA_Modulo512Kbytes, /*!< Circular buffer size is 512 K bytes. */ - kEDMA_Modulo1Mbytes, /*!< Circular buffer size is 1 M bytes. */ - kEDMA_Modulo2Mbytes, /*!< Circular buffer size is 2 M bytes. */ - kEDMA_Modulo4Mbytes, /*!< Circular buffer size is 4 M bytes. */ - kEDMA_Modulo8Mbytes, /*!< Circular buffer size is 8 M bytes. */ - kEDMA_Modulo16Mbytes, /*!< Circular buffer size is 16 M bytes. */ - kEDMA_Modulo32Mbytes, /*!< Circular buffer size is 32 M bytes. */ - kEDMA_Modulo64Mbytes, /*!< Circular buffer size is 64 M bytes. */ - kEDMA_Modulo128Mbytes, /*!< Circular buffer size is 128 M bytes. */ - kEDMA_Modulo256Mbytes, /*!< Circular buffer size is 256 M bytes. */ - kEDMA_Modulo512Mbytes, /*!< Circular buffer size is 512 M bytes. */ - kEDMA_Modulo1Gbytes, /*!< Circular buffer size is 1 G bytes. */ - kEDMA_Modulo2Gbytes, /*!< Circular buffer size is 2 G bytes. */ -} edma_modulo_t; - -#if defined FSL_FEATURE_EDMA_HAS_BANDWIDTH && FSL_FEATURE_EDMA_HAS_BANDWIDTH -/*! @brief Bandwidth control */ -typedef enum _edma_bandwidth -{ - kEDMA_BandwidthStallNone = 0x0U, /*!< No eDMA engine stalls. */ - kEDMA_BandwidthStall4Cycle = 0x2U, /*!< eDMA engine stalls for 4 cycles after each read/write. */ - kEDMA_BandwidthStall8Cycle = 0x3U, /*!< eDMA engine stalls for 8 cycles after each read/write. */ -} edma_bandwidth_t; -#endif - -/*! @brief Channel link type */ -typedef enum _edma_channel_link_type -{ - kEDMA_LinkNone = 0x0U, /*!< No channel link */ - kEDMA_MinorLink, /*!< Channel link after each minor loop */ - kEDMA_MajorLink, /*!< Channel link while major loop count exhausted */ -} edma_channel_link_type_t; - -/*!@brief _edma_channel_status_flags eDMA channel status flags. */ -enum -{ - kEDMA_DoneFlag = 0x1U, /*!< DONE flag, set while transfer finished, CITER value exhausted*/ - kEDMA_ErrorFlag = 0x2U, /*!< eDMA error flag, an error occurred in a transfer */ - kEDMA_InterruptFlag = 0x4U, /*!< eDMA interrupt flag, set while an interrupt occurred of this channel */ -}; - -/*! @brief _edma_error_status_flags eDMA channel error status flags. */ -enum -{ - kEDMA_DestinationBusErrorFlag = DMA_ERR_DBE_FLAG, /*!< Bus error on destination address */ - kEDMA_SourceBusErrorFlag = DMA_ERR_SBE_FLAG, /*!< Bus error on the source address */ - kEDMA_ScatterGatherErrorFlag = DMA_ERR_SGE_FLAG, /*!< Error on the Scatter/Gather address, not 32byte aligned. */ - kEDMA_NbytesErrorFlag = DMA_ERR_NCE_FLAG, /*!< NBYTES/CITER configuration error */ - kEDMA_DestinationOffsetErrorFlag = DMA_ERR_DOE_FLAG, /*!< Destination offset not aligned with destination size */ - kEDMA_DestinationAddressErrorFlag = DMA_ERR_DAE_FLAG, /*!< Destination address not aligned with destination size */ - kEDMA_SourceOffsetErrorFlag = DMA_ERR_SOE_FLAG, /*!< Source offset not aligned with source size */ - kEDMA_SourceAddressErrorFlag = DMA_ERR_SAE_FLAG, /*!< Source address not aligned with source size*/ - kEDMA_ErrorChannelFlag = DMA_ERR_ERRCHAN_FLAG, /*!< Error channel number of the cancelled channel number */ -#if defined(FSL_FEATURE_EDMA_HAS_PRIORITY_ERROR) && (FSL_FEATURE_EDMA_HAS_PRIORITY_ERROR > 1) - kEDMA_ChannelPriorityErrorFlag = DMA_ERR_CPE_FLAG, /*!< Channel priority is not unique. */ -#endif - kEDMA_TransferCanceledFlag = DMA_ERR_ECX_FLAG, /*!< Transfer cancelled */ -#if defined(FSL_FEATURE_EDMA_CHANNEL_GROUP_COUNT) && (FSL_FEATURE_EDMA_CHANNEL_GROUP_COUNT > 1) - kEDMA_GroupPriorityErrorFlag = DMA_ERR_GPE_FLAG, /*!< Group priority is not unique. */ -#endif - kEDMA_ValidFlag = (int)DMA_ERR_FLAG, /*!< No error occurred, this bit is 0. Otherwise, it is 1. */ -}; - -/*! @brief _edma_interrupt_enable eDMA interrupt source */ -enum -{ - kEDMA_ErrorInterruptEnable = 0x1U, /*!< Enable interrupt while channel error occurs. */ - kEDMA_MajorInterruptEnable = DMA_CSR_INTMAJOR_MASK, /*!< Enable interrupt while major count exhausted. */ - kEDMA_HalfInterruptEnable = DMA_CSR_INTHALF_MASK, /*!< Enable interrupt while major count to half value. */ -}; - -/*! @brief eDMA transfer type */ -typedef enum _edma_transfer_type -{ - kEDMA_MemoryToMemory = 0x0U, /*!< Transfer from memory to memory */ - kEDMA_PeripheralToMemory, /*!< Transfer from peripheral to memory */ - kEDMA_MemoryToPeripheral, /*!< Transfer from memory to peripheral */ - kEDMA_PeripheralToPeripheral, /*!< Transfer from Peripheral to peripheral */ -} edma_transfer_type_t; - -/*! @brief eDMA channel priority configuration */ -typedef struct _edma_channel_Preemption_config -{ - bool enableChannelPreemption; /*!< If true: a channel can be suspended by other channel with higher priority */ - bool enablePreemptAbility; /*!< If true: a channel can suspend other channel with low priority */ - uint8_t channelPriority; /*!< Channel priority */ -} edma_channel_Preemption_config_t; - -/*! @brief eDMA minor offset configuration */ -typedef struct _edma_minor_offset_config -{ - bool enableSrcMinorOffset; /*!< Enable(true) or Disable(false) source minor loop offset. */ - bool enableDestMinorOffset; /*!< Enable(true) or Disable(false) destination minor loop offset. */ - uint32_t minorOffset; /*!< Offset for a minor loop mapping. */ -} edma_minor_offset_config_t; - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG && FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE && FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE -/*! @brief eDMA channel memory attribute */ -typedef enum edma_channel_memory_attribute -{ - kEDMA_ChannelNoWriteNoReadNoCacheNoBuffer = - 0x0U, /*!< No write allocate, no read allocate, non-cacheable, non-bufferable. */ - kEDMA_ChannelNoWriteNoReadNoCacheBufferable, /*!< No write allocate, no read allocate, non-cacheable, bufferable. - */ - kEDMA_ChannelNoWriteNoReadCacheableNoBuffer, /*!< No write allocate, no read allocate, cacheable, non-bufferable. - */ - kEDMA_ChannelNoWriteNoReadCacheableBufferable, /*!< No write allocate, no read allocate, cacheable, bufferable. */ - kEDMA_ChannelNoWriteReadNoCacheNoBuffer, /*!< No write allocate, read allocate, non-cacheable, non-bufferable. */ - kEDMA_ChannelNoWriteReadNoCacheBufferable, /*!< No write allocate, read allocate, non-cacheable, bufferable. */ - kEDMA_ChannelNoWriteReadCacheableNoBuffer, /*!< No write allocate, read allocate, cacheable, non-bufferable. */ - kEDMA_ChannelNoWriteReadCacheableBufferable, /*!< No write allocate, read allocate, cacheable, bufferable. */ - kEDMA_ChannelWriteNoReadNoCacheNoBuffer, /*!< write allocate, no read allocate, non-cacheable, non-bufferable. */ - kEDMA_ChannelWriteNoReadNoCacheBufferable, /*!< write allocate, no read allocate, non-cacheable, bufferable. */ - kEDMA_ChannelWriteNoReadCacheableNoBuffer, /*!< write allocate, no read allocate, cacheable, non-bufferable. */ - kEDMA_ChannelWriteNoReadCacheableBufferable, /*!< write allocate, no read allocate, cacheable, bufferable. */ - kEDMA_ChannelWriteReadNoCacheNoBuffer, /*!< write allocate, read allocate, non-cacheable, non-bufferable. */ - kEDMA_ChannelWriteReadNoCacheBufferable, /*!< write allocate, read allocate, non-cacheable, bufferable. */ - kEDMA_ChannelWriteReadCacheableNoBuffer, /*!< write allocate, read allocate, cacheable, non-bufferable. */ - kEDMA_ChannelWriteReadCacheableBufferable, /*!< write allocate, read allocate, cacheable, bufferable. */ -} edma_channel_memory_attribute_t; -#endif - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE && FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE -/*! @brief eDMA4 channel swap size */ -typedef enum _edma_channel_swap_size -{ - kEDMA_ChannelSwapDisabled = 0x0U, /*!< Swap is disabled. */ - kEDMA_ChannelReadWith8bitSwap = 0x1U, /*!< Swap occurs with respect to the read 8bit. */ - kEDMA_ChannelReadWith16bitSwap = 0x2U, /*!< Swap occurs with respect to the read 16bit. */ - kEDMA_ChannelReadWith32bitSwap = 0x3U, /*!< Swap occurs with respect to the read 32bit. */ - kEDMA_ChannelWriteWith8bitSwap = 0x9U, /*!< Swap occurs with respect to the write 8bit. */ - kEDMA_ChannelWriteWith16bitSwap = 0x10U, /*!< Swap occurs with respect to the write 16bit. */ - kEDMA_ChannelWriteWith32bitSwap = 0x11U, /*!< Swap occurs with respect to the write 32bit. */ -} edma_channel_swap_size_t; -#endif - -/*! @brief eDMA channel system bus information, _edma_channel_sys_bus_info*/ -enum -{ -#if !(defined(FSL_FEATURE_EDMA_HAS_NO_CH_SBR_ATTR) && FSL_FEATURE_EDMA_HAS_NO_CH_SBR_ATTR) - kEDMA_AttributeOutput = DMA_CH_SBR_ATTR_MASK, /*!< DMA's AHB system bus attribute output value. */ -#endif - - kEDMA_PrivilegedAccessLevel = DMA_CH_SBR_PAL_MASK, /*!< Privileged Access Level for DMA transfers. 0b - User - protection level; 1b - Privileged protection level. */ - kEDMA_MasterId = - DMA_CH_SBR_MID_MASK, /*!< DMA's master ID when channel is active and master ID replication is enabled. */ -}; - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE && FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE -/*! @brief eDMA4 channel access type */ -typedef enum _edma_channel_access_type -{ - kEDMA_ChannelDataAccess = 0x0U, /*!< Data access for eDMA4 transfers. */ - kEDMA_ChannelInstructionAccess = 0x1U, /*!< Instruction access for eDMA4 transfers. */ -} edma_channel_access_type_t; -#endif - -/*! @brief eDMA4 channel protection level */ -typedef enum _edma_channel_protection_level -{ - kEDMA_ChannelProtectionLevelUser = 0x0U, /*!< user protection level for eDMA transfers. */ - kEDMA_ChannelProtectionLevelPrivileged = 0x1U, /*!< Privileged protection level eDMA transfers. */ -} edma_channel_protection_level_t; - -#if !(defined(FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) && FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) - -/*! @brief eDMA4 channel security level */ -typedef enum _edma_channel_security_level -{ - kEDMA_ChannelSecurityLevelNonSecure = 0x0U, /*!< non secure level for eDMA transfers. */ - kEDMA_ChannelSecurityLevelSecure = 0x1U, /*!< secure level for eDMA transfers. */ -} edma_channel_security_level_t; -#endif - -/*! @brief eDMA4 channel configuration*/ -typedef struct _edma_channel_config -{ - edma_channel_Preemption_config_t channelPreemptionConfig; /*!< channel preemption configuration */ - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE && FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE - edma_channel_memory_attribute_t channelReadMemoryAttribute; /*!< channel memory read attribute configuration */ - edma_channel_memory_attribute_t channelWriteMemoryAttribute; /*!< channel memory write attribute configuration */ -#endif - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE && FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE - edma_channel_swap_size_t channelSwapSize; /*!< channel swap size configuration */ -#endif - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE && FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE - edma_channel_access_type_t channelAccessType; /*!< channel access type configuration */ -#endif - - uint8_t channelDataSignExtensionBitPosition; /*!< channel data sign extension bit psition configuration */ - -#if (defined FSL_FEATURE_EDMA_HAS_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_CHANNEL_MUX) || (defined FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX) - int channelRequestSource; /*!< hardware service request source for the channel */ -#endif - - bool enableMasterIDReplication; /*!< enable master ID replication */ -#if !(defined(FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) && FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) - edma_channel_security_level_t securityLevel; /*!< security level */ -#endif - edma_channel_protection_level_t protectionLevel; /*!< protection level */ - -} edma_channel_config_t; -#endif - -/*! - * @brief eDMA TCD. - * - * This structure is same as TCD register which is described in reference manual, - * and is used to configure the scatter/gather feature as a next hardware TCD. - */ -typedef edma_core_tcd_t edma_tcd_t; - -/*! @brief edma4 channel transfer configuration - * - * The transfer configuration structure support full feature configuration of the transfer control descriptor. - * - * @note User should pay attention to the transfer size alignment limitation - * 1. the bytesEachRequest should align with the srcWidthOfEachTransfer and the dstWidthOfEachTransfer - * that is to say bytesEachRequest % srcWidthOfEachTransfer should be 0 - * 2. the srcOffsetOfEachTransfer and dstOffsetOfEachTransfer must be aligne with transfer width - * 3. the totalBytes should align with the bytesEachRequest - * 4. the srcAddr should align with the srcWidthOfEachTransfer - * 5. the dstAddr should align with the dstWidthOfEachTransfer - * 6. the srcAddr should align with srcAddrModulo if modulo feature is enabled - * 7. the dstAddr should align with dstAddrModulo if modulo feature is enabled - * If anyone of above condition can not be satisfied, the edma4 interfaces will generate assert error. - * - * 1.To perform a simple transfer, below members should be initialized at least - * .srcAddr - source address - * .dstAddr - destination address - * .srcWidthOfEachTransfer - data width of source address - * .dstWidthOfEachTransfer - data width of destination address, normally it should be as same as - * srcWidthOfEachTransfer .bytesEachRequest - bytes to be transferred in each DMA request .totalBytes - total - * bytes to be transferred .srcOffsetOfEachTransfer - offset value in bytes unit to be applied to source address as - * each source read is completed .dstOffsetOfEachTransfer - offset value in bytes unit to be applied to destination - * address as each destination write is completed enablchannelRequest - channel request can be enabled together with - * transfer configure submission - * - * 2.The transfer configuration structure also support advance feature: - * Programmable source/destination address range(MODULO) - * Programmable minor loop offset - * Programmable major loop offset - * Programmable channel chain feature - * Programmable channel transfer control descriptor link feature - * - */ -typedef struct _edma_transfer_config -{ - uint32_t srcAddr; /*!< Source data address. */ - uint32_t destAddr; /*!< Destination data address. */ - edma_transfer_size_t srcTransferSize; /*!< Source data transfer size. */ - edma_transfer_size_t destTransferSize; /*!< Destination data transfer size. */ - int16_t srcOffset; /*!< Sign-extended offset value in byte unit applied to the current source - address to form the next-state value as each source read is completed */ - int16_t destOffset; /*!< Sign-extended offset value in byte unit applied to the current destination - address to form the next-state value as each destination write is completed. */ - uint32_t minorLoopBytes; /*!< bytes in each minor loop or each request - * range: 1 - (2^30 -1) when minor loop mapping is enabled - * range: 1 - (2^10 - 1) when minor loop mapping is enabled and source or dest minor - * loop offset is enabled - * range: 1 - (2^32 - 1) when minor loop mapping is disabled - */ - uint32_t majorLoopCounts; /*!< minor loop counts in each major loop, should be 1 at least for each - * transfer range: (0 - (2^15 - 1)) when minor loop channel link is - * disabled range: (0 - (2^9 - 1)) when minor loop channel link is enabled - * total bytes in a transfer = minorLoopCountsEachMajorLoop * - * bytesEachMinorLoop - */ - - uint16_t enabledInterruptMask; /*!< channel interrupt to enable, can be OR'ed value of _edma_interrupt_enable */ - - edma_modulo_t srcAddrModulo; /*!< source circular data queue range */ - int32_t srcMajorLoopOffset; /*!< source major loop offset */ - - edma_modulo_t dstAddrModulo; /*!< destination circular data queue range */ - int32_t dstMajorLoopOffset; /*!< destination major loop offset */ - - bool enableSrcMinorLoopOffset; /*!< enable source minor loop offset */ - bool enableDstMinorLoopOffset; /*!< enable dest minor loop offset */ - int32_t minorLoopOffset; /*!< burst offset, the offset will be applied after minor loop update */ - - bool enableChannelMajorLoopLink; /*!< channel link when major loop complete */ - uint32_t majorLoopLinkChannel; /*!< major loop link channel number */ - - bool enableChannelMinorLoopLink; /*!< channel link when minor loop complete */ - uint32_t minorLoopLinkChannel; /*!< minor loop link channel number */ - - edma_tcd_t *linkTCD; /*!< pointer to the link transfer control descriptor */ -} edma_transfer_config_t; - -/*! @brief eDMA global configuration structure.*/ -typedef struct _edma_config -{ -#if defined FSL_FEATURE_EDMA_HAS_CONTINUOUS_LINK_MODE && FSL_FEATURE_EDMA_HAS_CONTINUOUS_LINK_MODE - bool enableContinuousLinkMode; /*!< Enable (true) continuous link mode. Upon minor loop completion, the channel - activates again if that channel has a minor loop channel link enabled and - the link channel is itself. */ -#endif - -#if defined FSL_FEATURE_EDMA_HAS_GLOBAL_MASTER_ID_REPLICATION && FSL_FEATURE_EDMA_HAS_GLOBAL_MASTER_ID_REPLICATION - bool enableMasterIdReplication; /*!< Enable (true) master ID replication. If Master ID replication is disabled, the - privileged protection level (supervisor mode) for eDMA4 transfers is used. */ -#endif - - bool enableGlobalChannelLink; /*!< Enable(true) channel linking is available and controlled by each channel's link - settings. */ - - bool enableHaltOnError; /*!< Enable (true) transfer halt on error. Any error causes the HALT bit to set. - Subsequently, all service requests are ignored until the HALT bit is cleared.*/ - - bool enableDebugMode; /*!< Enable(true) eDMA4 debug mode. When in debug mode, the eDMA4 stalls the start of - a new channel. Executing channels are allowed to complete. */ - - bool enableRoundRobinArbitration; /*!< Enable(true) channel linking is available and controlled by each channel's - link settings. */ -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG && FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG - edma_channel_config_t *channelConfig[FSL_FEATURE_EDMA_MODULE_CHANNEL]; /*!< channel preemption configuration */ -#endif -} edma_config_t; - -/*! @brief Callback for eDMA */ -struct _edma_handle; - -/*! @brief Define callback function for eDMA. - * - * This callback function is called in the EDMA interrupt handle. - * In normal mode, run into callback function means the transfer users need is done. - * In scatter gather mode, run into callback function means a transfer control block (tcd) is finished. Not - * all transfer finished, users can get the finished tcd numbers using interface EDMA_GetUnusedTCDNumber. - * - * @param handle EDMA handle pointer, users shall not touch the values inside. - * @param userData The callback user parameter pointer. Users can use this parameter to involve things users need to - * change in EDMA callback function. - * @param transferDone If the current loaded transfer done. In normal mode it means if all transfer done. In scatter - * gather mode, this parameter shows is the current transfer block in EDMA register is done. As the - * load of core is different, it will be different if the new tcd loaded into EDMA registers while - * this callback called. If true, it always means new tcd still not loaded into registers, while - * false means new tcd already loaded into registers. - * @param tcds How many tcds are done from the last callback. This parameter only used in scatter gather mode. It - * tells user how many tcds are finished between the last callback and this. - */ -typedef void (*edma_callback)(struct _edma_handle *handle, void *userData, bool transferDone, uint32_t tcds); - -/*! @brief eDMA transfer handle structure */ -typedef struct _edma_handle -{ - edma_callback callback; /*!< Callback function for major count exhausted. */ - void *userData; /*!< Callback function parameter. */ - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG && FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG - EDMA_ChannelType *channelBase; /*!< eDMA peripheral channel base address. */ -#endif - EDMA_Type *base; /*!< eDMA peripheral base address*/ - EDMA_TCDType *tcdBase; /*!< eDMA peripheral tcd base address. */ - - edma_tcd_t *tcdPool; /*!< Pointer to memory stored TCDs. */ - uint32_t channel; /*!< eDMA channel number. */ - - volatile int8_t header; /*!< The first TCD index. Should point to the next TCD to be loaded into the eDMA engine. */ - volatile int8_t tail; /*!< The last TCD index. Should point to the next TCD to be stored into the memory pool. */ - volatile int8_t tcdUsed; /*!< The number of used TCD slots. Should reflect the number of TCDs can be used/loaded in - the memory. */ - volatile int8_t tcdSize; /*!< The total number of TCD slots in the queue. */ -} edma_handle_t; -/******************************************************************************* - * APIs - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name eDMA initialization and de-initialization - * @{ - */ - -/*! - * @brief Initializes the eDMA peripheral. - * - * This function ungates the eDMA clock and configures the eDMA peripheral according - * to the configuration structure. - * - * @param base eDMA peripheral base address. - * @param config A pointer to the configuration structure, see "edma_config_t". - * @note This function enables the minor loop map feature. - */ -void EDMA_Init(EDMA_Type *base, const edma_config_t *config); - -/*! - * @brief Deinitializes the eDMA peripheral. - * - * This function gates the eDMA clock. - * - * @param base eDMA peripheral base address. - */ -void EDMA_Deinit(EDMA_Type *base); - -/*! - * @brief Push content of TCD structure into hardware TCD register. - * - * @param base EDMA peripheral base address. - * @param channel EDMA channel number. - * @param tcd Point to TCD structure. - */ -void EDMA_InstallTCD(EDMA_Type *base, uint32_t channel, edma_tcd_t *tcd); - -/*! - * @brief Gets the eDMA default configuration structure. - * - * This function sets the configuration structure to default values. - * The default configuration is set to the following values. - * @code - * config.enableContinuousLinkMode = false; - * config.enableHaltOnError = true; - * config.enableRoundRobinArbitration = false; - * config.enableDebugMode = false; - * @endcode - * - * @param config A pointer to the eDMA configuration structure. - */ -void EDMA_GetDefaultConfig(edma_config_t *config); - -#if defined(FSL_FEATURE_DMA_HAS_CONTINUOUS_CHANNEL_LINK) && FSL_FEATURE_DMA_HAS_CONTINUOUS_CHANNEL_LINK -/*! - * @brief Enable/Disable continuous channel link mode. - * - * @note Do not use continuous link mode with a channel linking to itself if there is only one minor loop - * iteration per service request, for example, if the channel's NBYTES value is the same as either - * the source or destination size. The same data transfer profile can be achieved by simply - * increasing the NBYTES value, which provides more efficient, faster processing. - * - * @param base EDMA peripheral base address. - * @param enable true is enable, false is disable. - */ -static inline void EDMA_EnableContinuousChannelLinkMode(EDMA_Type *base, bool enable) -{ - if (enable) - { - EDMA_BASE(base)->CR |= DMA_CR_CLM_MASK; - } - else - { - EDMA_BASE(base)->CR &= ~DMA_CR_CLM_MASK; - } -} -#endif - -#if defined(FSL_FEATURE_DMA_HAS_MINOR_LOOP_MAPPING) && FSL_FEATURE_DMA_HAS_MINOR_LOOP_MAPPING -/*! - * @brief Enable/Disable minor loop mapping. - * - * The TCDn.word2 is redefined to include individual enable fields, an offset field, and the - * NBYTES field. - * - * @param base EDMA peripheral base address. - * @param enable true is enable, false is disable. - */ -static inline void EDMA_EnableMinorLoopMapping(EDMA_Type *base, bool enable) -{ - if (enable) - { - EDMA_BASE(base)->CR |= DMA_CR_EMLM_MASK; - } - else - { - EDMA_BASE(base)->CR &= ~DMA_CR_EMLM_MASK; - } -} -#endif - -/*! @} */ -/*! - * @name eDMA Channel Operation - * @{ - */ - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG && FSL_FEATURE_EDMA_HAS_CHANNEL_CONFIG -/*! - * @brief EDMA Channel initialization - * - * @param base eDMA4 peripheral base address. - * @param channel eDMA4 channel number. - * @param channelConfig pointer to user's eDMA4 channel config structure, see edma_channel_config_t for detail. - */ -void EDMA_InitChannel(EDMA_Type *base, uint32_t channel, edma_channel_config_t *channelConfig); - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE && FSL_FEATURE_EDMA_HAS_CHANNEL_MEMORY_ATTRIBUTE -/*! - * @brief Set channel memory attribute. - * - * @param base eDMA4 peripheral base address. - * @param channel eDMA4 channel number. - * @param writeAttribute Attributes associated with a write transaction. - * @param readAttribute Attributes associated with a read transaction. - */ -static inline void EDMA_SetChannelMemoryAttribute(EDMA_Type *base, - uint32_t channel, - edma_channel_memory_attribute_t writeAttribute, - edma_channel_memory_attribute_t readAttribute) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - if (0U != (uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_MEMORY_ATTRIBUTEn(base)) - { -#if defined FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX - if ((uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_MP_CHANNEL_MUXn(base) == 1U) - { - EDMA_CHANNEL_BASE(base, channel)->CH_REGS.EDMA5_REG.CH_MATTR = - DMA_CH_MATTR_WCACHE(writeAttribute) | DMA_CH_MATTR_RCACHE(readAttribute); - } - else -#endif - { - EDMA_CHANNEL_BASE(base, channel)->CH_REGS.EDMA4_REG.CH_MATTR = - DMA_CH_MATTR_WCACHE(writeAttribute) | DMA_CH_MATTR_RCACHE(readAttribute); - } - } -} -#endif - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_SIGN_EXTENSION && FSL_FEATURE_EDMA_HAS_CHANNEL_SIGN_EXTENSION -/*! - * @brief Set channel sign extension. - * - * @param base eDMA4 peripheral base address. - * @param channel eDMA4 channel number. - * @param position A non-zero value specifing the sign extend bit position. - * If 0, sign extension is disabled. - */ -static inline void EDMA_SetChannelSignExtension(EDMA_Type *base, uint32_t channel, uint8_t position) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - if (0U != (uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_SIGN_EXTENSIONn(base)) - { - EDMA_CHANNEL_BASE(base, channel)->CH_CSR = - (EDMA_CHANNEL_BASE(base, channel)->CH_CSR & (~DMA_CH_CSR_SIGNEXT_MASK)) | - ((uint32_t)position << DMA_CH_CSR_SIGNEXT_SHIFT); - } -} -#endif - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE && FSL_FEATURE_EDMA_HAS_CHANNEL_SWAP_SIZE -/*! - * @brief Set channel swap size. - * - * @param base eDMA4 peripheral base address. - * @param channel eDMA4 channel number. - * @param swapSize Swap occurs with respect to the specified transfer size. - * If 0, swap is disabled. - */ -static inline void EDMA_SetChannelSwapSize(EDMA_Type *base, uint32_t channel, edma_channel_swap_size_t swapSize) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - if (0U != (uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_SWAP_SIZEn(base)) - { - EDMA_CHANNEL_BASE(base, channel)->CH_CSR = - (EDMA_CHANNEL_BASE(base, channel)->CH_CSR & (~DMA_CH_CSR_SWAP_MASK)) | - ((uint32_t)swapSize << DMA_CH_CSR_SWAP_SHIFT); - } -} -#endif - -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE && FSL_FEATURE_EDMA_HAS_CHANNEL_ACCESS_TYPE -/*! - * @brief Set channel access type. - * - * @param base eDMA4 peripheral base address. - * @param channel eDMA4 channel number. - * @param channelAccessType eDMA4's transactions type on the system bus when the channel is active. - */ -static inline void EDMA_SetChannelAccessType(EDMA_Type *base, - uint32_t channel, - edma_channel_access_type_t channelAccessType) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - if (0U != (uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_ACCESS_TYPEn(base)) - { -#if defined FSL_FEATURE_EDMA_HAS_PROT_REGISTER && FSL_FEATURE_EDMA_HAS_PROT_REGISTER - if (FSL_FEATURE_EDMA_INSTANCE_HAS_PROT_REGISTERn(base) == 1) - { - EDMA_MP_BASE(base)->MP_REGS.EDMA5_REG.CH_PROT[channel] = - (EDMA_MP_BASE(base)->MP_REGS.EDMA5_REG.CH_PROT[channel] & (~DMA_CH_SBR_INSTR_MASK)) | - ((uint32_t)channelAccessType << DMA_CH_SBR_INSTR_SHIFT); - } - else -#endif - { - EDMA_CHANNEL_BASE(base, channel)->CH_SBR = - (EDMA_CHANNEL_BASE(base, channel)->CH_SBR & (~DMA_CH_SBR_INSTR_MASK)) | - ((uint32_t)channelAccessType << DMA_CH_SBR_INSTR_SHIFT); - } - } -} -#endif - -#if (defined FSL_FEATURE_EDMA_HAS_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_CHANNEL_MUX) || \ - (defined FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX) -/*! - * @brief Set channel request source. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param channelRequestSource eDMA hardware service request source for the channel. User need to use - * the dma_request_source_t type as the input parameter. Note that devices - * may use other enum type to express dma request source and User can fined it in - * SOC header or fsl_edma_soc.h. - */ -static inline void EDMA_SetChannelMux(EDMA_Type *base, uint32_t channel, int32_t channelRequestSource) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - if ((uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_CHANNEL_MUXn(base) == 1U) - { - /* Reset channel mux */ -#if defined FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_MP_CHANNEL_MUX - if ((uint32_t)FSL_FEATURE_EDMA_INSTANCE_HAS_MP_CHANNEL_MUXn(base) == 1U) - { - EDMA_MP_BASE(base)->MP_REGS.EDMA5_REG.CH_MUX[channel] = DMA_CH_MUX_SOURCE(0); - EDMA_MP_BASE(base)->MP_REGS.EDMA5_REG.CH_MUX[channel] = DMA_CH_MUX_SOURCE(channelRequestSource); - } - else -#endif - { -#if defined FSL_FEATURE_EDMA_HAS_CHANNEL_MUX && FSL_FEATURE_EDMA_HAS_CHANNEL_MUX - EDMA_CHANNEL_BASE(base, channel)->CH_REGS.EDMA4_REG.CH_MUX = DMA_CH_MUX_SOURCE(0); - EDMA_CHANNEL_BASE(base, channel)->CH_REGS.EDMA4_REG.CH_MUX = DMA_CH_MUX_SOURCE(channelRequestSource); -#endif - } - } -} -#endif - -/*! - * @brief Gets the channel identification and attribute information on the system bus interface. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @return The mask of the channel system bus information. Users need to use the - * _edma_channel_sys_bus_info type to decode the return variables. - */ -static inline uint32_t EDMA_GetChannelSystemBusInformation(EDMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - return EDMA_CHANNEL_BASE(base, channel)->CH_SBR; -} - -/*! - * @brief Set channel master ID replication. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param enable true is enable, false is disable. - */ -static inline void EDMA_EnableChannelMasterIDReplication(EDMA_Type *base, uint32_t channel, bool enable) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - -#if defined FSL_FEATURE_EDMA_HAS_PROT_REGISTER && FSL_FEATURE_EDMA_HAS_PROT_REGISTER - if (FSL_FEATURE_EDMA_INSTANCE_HAS_PROT_REGISTERn(base) == 1) - { - if (enable) - { - EDMA_MP_BASE(base)->MP_REGS.EDMA5_REG.CH_PROT[channel] |= DMA_CH_SBR_EMI_MASK; - } - else - { - EDMA_MP_BASE(base)->MP_REGS.EDMA5_REG.CH_PROT[channel] &= ~DMA_CH_SBR_EMI_MASK; - } - } - else -#endif - { - if (enable) - { - EDMA_CHANNEL_BASE(base, channel)->CH_SBR |= DMA_CH_SBR_EMI_MASK; - } - else - { - EDMA_CHANNEL_BASE(base, channel)->CH_SBR &= ~DMA_CH_SBR_EMI_MASK; - } - } -} - -#if !(defined(FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) && FSL_FEATURE_EDMA_HAS_NO_CH_SBR_SEC) -/*! - * @brief Set channel security level. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param level security level. - */ -static inline void EDMA_SetChannelSecurityLevel(EDMA_Type *base, uint32_t channel, edma_channel_security_level_t level) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - -#if defined FSL_FEATURE_EDMA_HAS_PROT_REGISTER && FSL_FEATURE_EDMA_HAS_PROT_REGISTER - if (FSL_FEATURE_EDMA_INSTANCE_HAS_PROT_REGISTERn(base) == 1) - { - if (level == kEDMA_ChannelSecurityLevelSecure) - { - EDMA_MP_BASE(base)->MP_REGS.EDMA5_REG.CH_PROT[channel] |= DMA_CH_SBR_SEC_MASK; - } - else - { - EDMA_MP_BASE(base)->MP_REGS.EDMA5_REG.CH_PROT[channel] &= ~DMA_CH_SBR_SEC_MASK; - } - } - else -#endif - { - if (level == kEDMA_ChannelSecurityLevelSecure) - { - EDMA_CHANNEL_BASE(base, channel)->CH_SBR |= DMA_CH_SBR_SEC_MASK; - } - else - { - EDMA_CHANNEL_BASE(base, channel)->CH_SBR &= ~DMA_CH_SBR_SEC_MASK; - } - } -} -#endif - -/*! - * @brief Set channel security level. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param level security level. - */ -static inline void EDMA_SetChannelProtectionLevel(EDMA_Type *base, - uint32_t channel, - edma_channel_protection_level_t level) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - -#if defined FSL_FEATURE_EDMA_HAS_PROT_REGISTER && FSL_FEATURE_EDMA_HAS_PROT_REGISTER - if (FSL_FEATURE_EDMA_INSTANCE_HAS_PROT_REGISTERn(base) == 1) - { - if (level == kEDMA_ChannelProtectionLevelPrivileged) - { - EDMA_MP_BASE(base)->MP_REGS.EDMA5_REG.CH_PROT[channel] |= DMA_CH_SBR_PAL_MASK; - } - else - { - EDMA_MP_BASE(base)->MP_REGS.EDMA5_REG.CH_PROT[channel] &= ~DMA_CH_SBR_PAL_MASK; - } - } - else -#endif - { - if (level == kEDMA_ChannelProtectionLevelPrivileged) - { - EDMA_CHANNEL_BASE(base, channel)->CH_SBR |= DMA_CH_SBR_PAL_MASK; - } - else - { - EDMA_CHANNEL_BASE(base, channel)->CH_SBR &= ~DMA_CH_SBR_PAL_MASK; - } - } -} - -#endif -/*! - * @brief Sets all TCD registers to default values. - * - * This function sets TCD registers for this channel to default values. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @note This function must not be called while the channel transfer is ongoing - * or it causes unpredictable results. - * @note This function enables the auto stop request feature. - */ -void EDMA_ResetChannel(EDMA_Type *base, uint32_t channel); - -/*! - * @brief Configures the eDMA transfer attribute. - * - * This function configures the transfer attribute, including source address, destination address, - * transfer size, address offset, and so on. It also configures the scatter gather feature if the - * user supplies the TCD address. - * Example: - * @code - * edma_transfer_t config; - * edma_tcd_t tcd; - * config.srcAddr = ..; - * config.destAddr = ..; - * ... - * EDMA_SetTransferConfig(DMA0, channel, &config, &stcd); - * @endcode - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param config Pointer to eDMA transfer configuration structure. - * @param nextTcd Point to TCD structure. It can be NULL if users - * do not want to enable scatter/gather feature. - * @note If nextTcd is not NULL, it means scatter gather feature is enabled - * and DREQ bit is cleared in the previous transfer configuration, which - * is set in the eDMA_ResetChannel. - */ -void EDMA_SetTransferConfig(EDMA_Type *base, - uint32_t channel, - const edma_transfer_config_t *config, - edma_tcd_t *nextTcd); - -/*! - * @brief Configures the eDMA minor offset feature. - * - * The minor offset means that the signed-extended value is added to the source address or destination - * address after each minor loop. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param config A pointer to the minor offset configuration structure. - */ -void EDMA_SetMinorOffsetConfig(EDMA_Type *base, uint32_t channel, const edma_minor_offset_config_t *config); - -/*! - * @brief Configures the eDMA channel preemption feature. - * - * This function configures the channel preemption attribute and the priority of the channel. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number - * @param config A pointer to the channel preemption configuration structure. - */ -void EDMA_SetChannelPreemptionConfig(EDMA_Type *base, uint32_t channel, const edma_channel_Preemption_config_t *config); - -/*! - * @brief Sets the channel link for the eDMA transfer. - * - * This function configures either the minor link or the major link mode. The minor link means that the channel link is - * triggered every time CITER decreases by 1. The major link means that the channel link is triggered when the CITER is - * exhausted. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param type A channel link type, which can be one of the following: - * @arg kEDMA_LinkNone - * @arg kEDMA_MinorLink - * @arg kEDMA_MajorLink - * @param linkedChannel The linked channel number. - * @note Users should ensure that DONE flag is cleared before calling this interface, or the configuration is invalid. - */ -void EDMA_SetChannelLink(EDMA_Type *base, uint32_t channel, edma_channel_link_type_t type, uint32_t linkedChannel); - -#if defined FSL_FEATURE_EDMA_HAS_BANDWIDTH && FSL_FEATURE_EDMA_HAS_BANDWIDTH -/*! - * @brief Sets the bandwidth for the eDMA transfer. - * - * Because the eDMA processes the minor loop, it continuously generates read/write sequences - * until the minor count is exhausted. The bandwidth forces the eDMA to stall after the completion of - * each read/write access to control the bus request bandwidth seen by the crossbar switch. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param bandWidth A bandwidth setting, which can be one of the following: - * @arg kEDMABandwidthStallNone - * @arg kEDMABandwidthStall4Cycle - * @arg kEDMABandwidthStall8Cycle - */ -void EDMA_SetBandWidth(EDMA_Type *base, uint32_t channel, edma_bandwidth_t bandWidth); -#endif - -/*! - * @brief Sets the source modulo and the destination modulo for the eDMA transfer. - * - * This function defines a specific address range specified to be the value after (SADDR + SOFF)/(DADDR + DOFF) - * calculation is performed or the original register value. It provides the ability to implement a circular data - * queue easily. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param srcModulo A source modulo value. - * @param destModulo A destination modulo value. - */ -void EDMA_SetModulo(EDMA_Type *base, uint32_t channel, edma_modulo_t srcModulo, edma_modulo_t destModulo); - -#if defined(FSL_FEATURE_EDMA_ASYNCHRO_REQUEST_CHANNEL_COUNT) && FSL_FEATURE_EDMA_ASYNCHRO_REQUEST_CHANNEL_COUNT -/*! - * @brief Enables an async request for the eDMA transfer. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param enable The command to enable (true) or disable (false). - */ -static inline void EDMA_EnableAsyncRequest(EDMA_Type *base, uint32_t channel, bool enable) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - EDMA_BASE(base)->EARS &= ~((uint32_t)1U << channel); - EDMA_BASE(base)->EARS |= ((uint32_t)(true == enable ? 1U : 0U) << channel); -#else - if (enable) - { - EDMA_CHANNEL_BASE(base, channel)->CH_CSR |= DMA_CH_CSR_EARQ_MASK; - } - else - { - EDMA_CHANNEL_BASE(base, channel)->CH_CSR &= ~DMA_CH_CSR_EARQ_MASK; - } -#endif -} -#endif - -/*! - * @brief Enables an auto stop request for the eDMA transfer. - * - * If enabling the auto stop request, the eDMA hardware automatically disables the hardware channel request. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param enable The command to enable (true) or disable (false). - */ -static inline void EDMA_EnableAutoStopRequest(EDMA_Type *base, uint32_t channel, bool enable) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - - if (enable) - { - EDMA_TCD_CSR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) |= DMA_CSR_DREQ_MASK; - } - else - { - EDMA_TCD_CSR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_CSR_DREQ_MASK; - } -} - -/*! - * @brief Enables the interrupt source for the eDMA transfer. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_EnableChannelInterrupts(EDMA_Type *base, uint32_t channel, uint32_t mask); - -/*! - * @brief Disables the interrupt source for the eDMA transfer. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param mask The mask of the interrupt source to be set. Use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_DisableChannelInterrupts(EDMA_Type *base, uint32_t channel, uint32_t mask); - -/*! - * @brief Configures the eDMA channel TCD major offset feature. - * - * Adjustment value added to the source address at the completion of the major iteration count - * - * @param base eDMA peripheral base address. - * @param channel edma channel number. - * @param sourceOffset source address offset will be applied to source address after major loop done. - * @param destOffset destination address offset will be applied to source address after major loop done. - */ -void EDMA_SetMajorOffsetConfig(EDMA_Type *base, uint32_t channel, int32_t sourceOffset, int32_t destOffset); - -/*! @} */ -/*! - * @name eDMA TCD Operation - * @{ - */ -/*! - * @brief Sets TCD fields according to the user's channel transfer configuration structure, @ref - * edma_transfer_config_t. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_ConfigChannelSoftwareTCDExt - * - * Application should be careful about the TCD pool buffer storage class, - * - For the platform has cache, the software TCD should be put in non cache section - * - The TCD pool buffer should have a consistent storage class. - * - * @param tcd Pointer to the TCD structure. - * @param transfer channel transfer configuration pointer. - * - * @note This function enables the auto stop request feature. - */ -void EDMA_ConfigChannelSoftwareTCD(edma_tcd_t *tcd, const edma_transfer_config_t *transfer); - -/*! - * @brief Sets all fields to default values for the TCD structure. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_TcdResetExt - * - * This function sets all fields for this TCD structure to default value. - * - * @param tcd Pointer to the TCD structure. - * @note This function enables the auto stop request feature. - */ -void EDMA_TcdReset(edma_tcd_t *tcd); - -/*! - * @brief Configures the eDMA TCD transfer attribute. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_TcdSetTransferConfigExt - * - * The TCD is a transfer control descriptor. The content of the TCD is the same as the hardware TCD registers. - * The TCD is used in the scatter-gather mode. - * This function configures the TCD transfer attribute, including source address, destination address, - * transfer size, address offset, and so on. It also configures the scatter gather feature if the - * user supplies the next TCD address. - * Example: - * @code - * edma_transfer_t config = { - * ... - * } - * edma_tcd_t tcd __aligned(32); - * edma_tcd_t nextTcd __aligned(32); - * EDMA_TcdSetTransferConfig(&tcd, &config, &nextTcd); - * @endcode - * - * @param tcd Pointer to the TCD structure. - * @param config Pointer to eDMA transfer configuration structure. - * @param nextTcd Pointer to the next TCD structure. It can be NULL if users - * do not want to enable scatter/gather feature. - * @note TCD address should be 32 bytes aligned or it causes an eDMA error. - * @note If the nextTcd is not NULL, the scatter gather feature is enabled - * and DREQ bit is cleared in the previous transfer configuration, which - * is set in the EDMA_TcdReset. - */ -void EDMA_TcdSetTransferConfig(edma_tcd_t *tcd, const edma_transfer_config_t *config, edma_tcd_t *nextTcd); - -/*! - * @brief Configures the eDMA TCD minor offset feature. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_TcdSetMinorOffsetConfigExt - * - * A minor offset is a signed-extended value added to the source address or a destination - * address after each minor loop. - * - * @param tcd A point to the TCD structure. - * @param config A pointer to the minor offset configuration structure. - */ -void EDMA_TcdSetMinorOffsetConfig(edma_tcd_t *tcd, const edma_minor_offset_config_t *config); - -/*! - * @brief Sets the channel link for the eDMA TCD. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_TcdSetChannelLinkExt - * - * This function configures either a minor link or a major link. The minor link means the channel link is - * triggered every time CITER decreases by 1. The major link means that the channel link is triggered when the CITER is - * exhausted. - * - * @note Users should ensure that DONE flag is cleared before calling this interface, or the configuration is invalid. - * @param tcd Point to the TCD structure. - * @param type Channel link type, it can be one of: - * @arg kEDMA_LinkNone - * @arg kEDMA_MinorLink - * @arg kEDMA_MajorLink - * @param linkedChannel The linked channel number. - */ -void EDMA_TcdSetChannelLink(edma_tcd_t *tcd, edma_channel_link_type_t type, uint32_t linkedChannel); - -#if defined FSL_FEATURE_EDMA_HAS_BANDWIDTH && FSL_FEATURE_EDMA_HAS_BANDWIDTH -/*! - * @brief Sets the bandwidth for the eDMA TCD. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_TcdSetBandWidthExt - * - * Because the eDMA processes the minor loop, it continuously generates read/write sequences - * until the minor count is exhausted. The bandwidth forces the eDMA to stall after the completion of - * each read/write access to control the bus request bandwidth seen by the crossbar switch. - * @param tcd A pointer to the TCD structure. - * @param bandWidth A bandwidth setting, which can be one of the following: - * @arg kEDMABandwidthStallNone - * @arg kEDMABandwidthStall4Cycle - * @arg kEDMABandwidthStall8Cycle - */ -static inline void EDMA_TcdSetBandWidth(edma_tcd_t *tcd, edma_bandwidth_t bandWidth) -{ - assert(tcd != NULL); - - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) = - (uint16_t)((EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) & (~DMA_CSR_BWC_MASK)) | DMA_CSR_BWC(bandWidth)); -} -#endif - -/*! - * @brief Sets the source modulo and the destination modulo for the eDMA TCD. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_TcdSetModuloExt - * - * This function defines a specific address range specified to be the value after (SADDR + SOFF)/(DADDR + DOFF) - * calculation is performed or the original register value. It provides the ability to implement a circular data - * queue easily. - * - * @param tcd A pointer to the TCD structure. - * @param srcModulo A source modulo value. - * @param destModulo A destination modulo value. - */ -void EDMA_TcdSetModulo(edma_tcd_t *tcd, edma_modulo_t srcModulo, edma_modulo_t destModulo); - -/*! - * @brief Sets the auto stop request for the eDMA TCD. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_TcdEnableAutoStopRequestExt - * - * If enabling the auto stop request, the eDMA hardware automatically disables the hardware channel request. - * - * @param tcd A pointer to the TCD structure. - * @param enable The command to enable (true) or disable (false). - */ -static inline void EDMA_TcdEnableAutoStopRequest(edma_tcd_t *tcd, bool enable) -{ - assert(tcd != NULL); - - EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) = (uint16_t)((EDMA_TCD_CSR(tcd, kEDMA_EDMA4Flag) & (~DMA_CSR_DREQ_MASK)) | - DMA_CSR_DREQ((true == enable ? 1U : 0U))); -} - -/*! - * @brief Enables the interrupt source for the eDMA TCD. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_TcdEnableInterruptsExt - * - * @param tcd Point to the TCD structure. - * @param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_TcdEnableInterrupts(edma_tcd_t *tcd, uint32_t mask); - -/*! - * @brief Disables the interrupt source for the eDMA TCD. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_TcdDisableInterruptsExt - * - * @param tcd Point to the TCD structure. - * @param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_TcdDisableInterrupts(edma_tcd_t *tcd, uint32_t mask); - -/*! - * @brief Configures the eDMA TCD major offset feature. - * - * @Note This API only supports EDMA4 TCD type. It can be used to support all types with extension API @ref - * EDMA_TcdSetMajorOffsetConfigExt - * - * Adjustment value added to the source address at the completion of the major iteration count - * - * @param tcd A point to the TCD structure. - * @param sourceOffset source address offset wiil be applied to source address after major loop done. - * @param destOffset destination address offset will be applied to source address after major loop done. - */ -void EDMA_TcdSetMajorOffsetConfig(edma_tcd_t *tcd, int32_t sourceOffset, int32_t destOffset); - -/*! - * @brief Sets TCD fields according to the user's channel transfer configuration structure, @ref - * edma_transfer_config_t. - * - * Application should be careful about the TCD pool buffer storage class, - * - For the platform has cache, the software TCD should be put in non cache section - * - The TCD pool buffer should have a consistent storage class. - * - * @param base eDMA peripheral base address. - * @param tcd Pointer to the TCD structure. - * @param transfer channel transfer configuration pointer. - * - * @note This function enables the auto stop request feature. - */ -void EDMA_ConfigChannelSoftwareTCDExt(EDMA_Type *base, edma_tcd_t *tcd, const edma_transfer_config_t *transfer); - -/*! - * @brief Sets all fields to default values for the TCD structure. - * - * This function sets all fields for this TCD structure to default value. - * - * @param base eDMA peripheral base address. - * @param tcd Pointer to the TCD structure. - * @note This function enables the auto stop request feature. - */ -void EDMA_TcdResetExt(EDMA_Type *base, edma_tcd_t *tcd); - -/*! - * @brief Configures the eDMA TCD transfer attribute. - * - * The TCD is a transfer control descriptor. The content of the TCD is the same as the hardware TCD registers. - * The TCD is used in the scatter-gather mode. - * This function configures the TCD transfer attribute, including source address, destination address, - * transfer size, address offset, and so on. It also configures the scatter gather feature if the - * user supplies the next TCD address. - * Example: - * @code - * edma_transfer_t config = { - * ... - * } - * edma_tcd_t tcd __aligned(32); - * edma_tcd_t nextTcd __aligned(32); - * EDMA_TcdSetTransferConfig(&tcd, &config, &nextTcd); - * @endcode - * - * @param base eDMA peripheral base address. - * @param tcd Pointer to the TCD structure. - * @param config Pointer to eDMA transfer configuration structure. - * @param nextTcd Pointer to the next TCD structure. It can be NULL if users - * do not want to enable scatter/gather feature. - * @note TCD address should be 32 bytes aligned or it causes an eDMA error. - * @note If the nextTcd is not NULL, the scatter gather feature is enabled - * and DREQ bit is cleared in the previous transfer configuration, which - * is set in the EDMA_TcdReset. - */ -void EDMA_TcdSetTransferConfigExt(EDMA_Type *base, - edma_tcd_t *tcd, - const edma_transfer_config_t *config, - edma_tcd_t *nextTcd); - -/*! - * @brief Configures the eDMA TCD minor offset feature. - * - * A minor offset is a signed-extended value added to the source address or a destination - * address after each minor loop. - * - * @param base eDMA peripheral base address. - * @param tcd A point to the TCD structure. - * @param config A pointer to the minor offset configuration structure. - */ -void EDMA_TcdSetMinorOffsetConfigExt(EDMA_Type *base, edma_tcd_t *tcd, const edma_minor_offset_config_t *config); - -/*! - * @brief Sets the channel link for the eDMA TCD. - * - * This function configures either a minor link or a major link. The minor link means the channel link is - * triggered every time CITER decreases by 1. The major link means that the channel link is triggered when the CITER is - * exhausted. - * - * @note Users should ensure that DONE flag is cleared before calling this interface, or the configuration is invalid. - * @param base eDMA peripheral base address. - * @param tcd Point to the TCD structure. - * @param type Channel link type, it can be one of: - * @arg kEDMA_LinkNone - * @arg kEDMA_MinorLink - * @arg kEDMA_MajorLink - * @param linkedChannel The linked channel number. - */ -void EDMA_TcdSetChannelLinkExt(EDMA_Type *base, edma_tcd_t *tcd, edma_channel_link_type_t type, uint32_t linkedChannel); - -#if defined FSL_FEATURE_EDMA_HAS_BANDWIDTH && FSL_FEATURE_EDMA_HAS_BANDWIDTH -/*! - * @brief Sets the bandwidth for the eDMA TCD. - * - * Because the eDMA processes the minor loop, it continuously generates read/write sequences - * until the minor count is exhausted. The bandwidth forces the eDMA to stall after the completion of - * each read/write access to control the bus request bandwidth seen by the crossbar switch. - * @param base eDMA peripheral base address. - * @param tcd A pointer to the TCD structure. - * @param bandWidth A bandwidth setting, which can be one of the following: - * @arg kEDMABandwidthStallNone - * @arg kEDMABandwidthStall4Cycle - * @arg kEDMABandwidthStall8Cycle - */ -static inline void EDMA_TcdSetBandWidthExt(EDMA_Type *base, edma_tcd_t *tcd, edma_bandwidth_t bandWidth) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) = - (uint16_t)((EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) & (~DMA_CSR_BWC_MASK)) | DMA_CSR_BWC(bandWidth)); -} -#endif - -/*! - * @brief Sets the source modulo and the destination modulo for the eDMA TCD. - * - * This function defines a specific address range specified to be the value after (SADDR + SOFF)/(DADDR + DOFF) - * calculation is performed or the original register value. It provides the ability to implement a circular data - * queue easily. - * - * @param base eDMA peripheral base address. - * @param tcd A pointer to the TCD structure. - * @param srcModulo A source modulo value. - * @param destModulo A destination modulo value. - */ -void EDMA_TcdSetModuloExt(EDMA_Type *base, edma_tcd_t *tcd, edma_modulo_t srcModulo, edma_modulo_t destModulo); - -/*! - * @brief Sets the auto stop request for the eDMA TCD. - * - * If enabling the auto stop request, the eDMA hardware automatically disables the hardware channel request. - * - * @param base eDMA peripheral base address. - * @param tcd A pointer to the TCD structure. - * @param enable The command to enable (true) or disable (false). - */ -static inline void EDMA_TcdEnableAutoStopRequestExt(EDMA_Type *base, edma_tcd_t *tcd, bool enable) -{ - assert(tcd != NULL); - assert(((uint32_t)tcd & 0x1FU) == 0U); - - EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) = (uint16_t)((EDMA_TCD_CSR(tcd, EDMA_TCD_TYPE(base)) & (~DMA_CSR_DREQ_MASK)) | - DMA_CSR_DREQ((true == enable ? 1U : 0U))); -} - -/*! - * @brief Enables the interrupt source for the eDMA TCD. - * - * @param base eDMA peripheral base address. - * @param tcd Point to the TCD structure. - * @param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_TcdEnableInterruptsExt(EDMA_Type *base, edma_tcd_t *tcd, uint32_t mask); - -/*! - * @brief Disables the interrupt source for the eDMA TCD. - * - * @param base eDMA peripheral base address. - * @param tcd Point to the TCD structure. - * @param mask The mask of interrupt source to be set. Users need to use - * the defined edma_interrupt_enable_t type. - */ -void EDMA_TcdDisableInterruptsExt(EDMA_Type *base, edma_tcd_t *tcd, uint32_t mask); - -/*! - * @brief Configures the eDMA TCD major offset feature. - * - * Adjustment value added to the source address at the completion of the major iteration count - * - * @param base eDMA peripheral base address. - * @param tcd A point to the TCD structure. - * @param sourceOffset source address offset wiil be applied to source address after major loop done. - * @param destOffset destination address offset will be applied to source address after major loop done. - */ -void EDMA_TcdSetMajorOffsetConfigExt(EDMA_Type *base, edma_tcd_t *tcd, int32_t sourceOffset, int32_t destOffset); - -/*! @} */ -/*! - * @name eDMA Channel Transfer Operation - * @{ - */ - -/*! - * @brief Enables the eDMA hardware channel request. - * - * This function enables the hardware channel request. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - */ -static inline void EDMA_EnableChannelRequest(EDMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - EDMA_BASE(base)->SERQ = DMA_SERQ_SERQ(channel); -#else - EDMA_CHANNEL_BASE(base, channel)->CH_CSR |= DMA_CH_CSR_ERQ_MASK; -#endif -} - -/*! - * @brief Disables the eDMA hardware channel request. - * - * This function disables the hardware channel request. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - */ -static inline void EDMA_DisableChannelRequest(EDMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - EDMA_BASE(base)->CERQ = DMA_CERQ_CERQ(channel); -#else - EDMA_CHANNEL_BASE(base, channel)->CH_CSR &= ~DMA_CH_CSR_ERQ_MASK; -#endif -} - -/*! - * @brief Starts the eDMA transfer by using the software trigger. - * - * This function starts a minor loop transfer. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - */ -static inline void EDMA_TriggerChannelStart(EDMA_Type *base, uint32_t channel) -{ - assert(channel < (uint32_t)FSL_FEATURE_EDMA_INSTANCE_CHANNELn(base)); - -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - EDMA_BASE(base)->SSRT = DMA_SSRT_SSRT(channel); -#else - EDMA_TCD_CSR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) |= DMA_CSR_START_MASK; -#endif -} - -/*! @} */ -/*! - * @name eDMA Channel Status Operation - * @{ - */ - -/*! - * @brief Gets the remaining major loop count from the eDMA current channel TCD. - * - * This function checks the TCD (Task Control Descriptor) status for a specified - * eDMA channel and returns the number of major loop count that has not finished. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @return Major loop count which has not been transferred yet for the current TCD. - * @note 1. This function can only be used to get unfinished major loop count of transfer without - * the next TCD, or it might be inaccuracy. - * 2. The unfinished/remaining transfer bytes cannot be obtained directly from registers while - * the channel is running. - * Because to calculate the remaining bytes, the initial NBYTES configured in DMA_TCDn_NBYTES_MLNO - * register is needed while the eDMA IP does not support getting it while a channel is active. - * In another word, the NBYTES value reading is always the actual (decrementing) NBYTES value the dma_engine - * is working with while a channel is running. - * Consequently, to get the remaining transfer bytes, a software-saved initial value of NBYTES (for example - * copied before enabling the channel) is needed. The formula to calculate it is shown below: - * RemainingBytes = RemainingMajorLoopCount * NBYTES(initially configured) - */ -uint32_t EDMA_GetRemainingMajorLoopCount(EDMA_Type *base, uint32_t channel); - -/*! - * @brief Gets the eDMA channel error status flags. - * - * @param base eDMA peripheral base address. - * @return The mask of error status flags. Users need to use the - * _edma_error_status_flags type to decode the return variables. - */ -static inline uint32_t EDMA_GetErrorStatusFlags(EDMA_Type *base) -{ -#if defined FSL_EDMA_SOC_IP_EDMA && FSL_EDMA_SOC_IP_EDMA - return EDMA_BASE(base)->ES; -#else - return EDMA_MP_BASE(base)->MP_ES; -#endif -} - -/*! - * @brief Gets the eDMA channel status flags. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @return The mask of channel status flags. Users need to use the - * _edma_channel_status_flags type to decode the return variables. - */ -uint32_t EDMA_GetChannelStatusFlags(EDMA_Type *base, uint32_t channel); - -/*! - * @brief Clears the eDMA channel status flags. - * - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - * @param mask The mask of channel status to be cleared. Users need to use - * the defined _edma_channel_status_flags type. - */ -void EDMA_ClearChannelStatusFlags(EDMA_Type *base, uint32_t channel, uint32_t mask); - -/*! @} */ -/*! - * @name eDMA Transactional Operation - */ - -/*! - * @brief Creates the eDMA handle. - * - * This function is called if using the transactional API for eDMA. This function - * initializes the internal state of the eDMA handle. - * - * @param handle eDMA handle pointer. The eDMA handle stores callback function and - * parameters. - * @param base eDMA peripheral base address. - * @param channel eDMA channel number. - */ -void EDMA_CreateHandle(edma_handle_t *handle, EDMA_Type *base, uint32_t channel); - -/*! - * @brief Installs the TCDs memory pool into the eDMA handle. - * - * This function is called after the EDMA_CreateHandle to use scatter/gather feature. This function shall only be used - * while users need to use scatter gather mode. Scatter gather mode enables EDMA to load a new transfer control block - * (tcd) in hardware, and automatically reconfigure that DMA channel for a new transfer. - * Users need to prepare tcd memory and also configure tcds using interface EDMA_SubmitTransfer. - * - * @param handle eDMA handle pointer. - * @param tcdPool A memory pool to store TCDs. It must be 32 bytes aligned. - * @param tcdSize The number of TCD slots. - */ -void EDMA_InstallTCDMemory(edma_handle_t *handle, edma_tcd_t *tcdPool, uint32_t tcdSize); - -/*! - * @brief Installs a callback function for the eDMA transfer. - * - * This callback is called in the eDMA IRQ handler. Use the callback to do something after - * the current major loop transfer completes. This function will be called every time one tcd finished transfer. - * - * @param handle eDMA handle pointer. - * @param callback eDMA callback function pointer. - * @param userData A parameter for the callback function. - */ -void EDMA_SetCallback(edma_handle_t *handle, edma_callback callback, void *userData); - -/*! - * @brief Prepares the eDMA transfer structure configurations. - * - * This function prepares the transfer configuration structure according to the user input. - * - * @param config The user configuration structure of type edma_transfer_t. - * @param srcAddr eDMA transfer source address. - * @param srcWidth eDMA transfer source address width(bytes). - * @param srcOffset source address offset. - * @param destAddr eDMA transfer destination address. - * @param destWidth eDMA transfer destination address width(bytes). - * @param destOffset destination address offset. - * @param bytesEachRequest eDMA transfer bytes per channel request. - * @param transferBytes eDMA transfer bytes to be transferred. - * @note The data address and the data width must be consistent. For example, if the SRC - * is 4 bytes, the source address must be 4 bytes aligned, or it results in - * source address error (SAE). - * User can check if 128 bytes support is available for specific instance by - * FSL_FEATURE_EDMA_INSTANCE_SUPPORT_128_BYTES_TRANSFERn. - */ -void EDMA_PrepareTransferConfig(edma_transfer_config_t *config, - void *srcAddr, - uint32_t srcWidth, - int16_t srcOffset, - void *destAddr, - uint32_t destWidth, - int16_t destOffset, - uint32_t bytesEachRequest, - uint32_t transferBytes); - -/*! - * @brief Prepares the eDMA transfer structure. - * - * This function prepares the transfer configuration structure according to the user input. - * - * @param config The user configuration structure of type edma_transfer_t. - * @param srcAddr eDMA transfer source address. - * @param srcWidth eDMA transfer source address width(bytes). - * @param destAddr eDMA transfer destination address. - * @param destWidth eDMA transfer destination address width(bytes). - * @param bytesEachRequest eDMA transfer bytes per channel request. - * @param transferBytes eDMA transfer bytes to be transferred. - * @param type eDMA transfer type. - * @note The data address and the data width must be consistent. For example, if the SRC - * is 4 bytes, the source address must be 4 bytes aligned, or it results in - * source address error (SAE). - */ -void EDMA_PrepareTransfer(edma_transfer_config_t *config, - void *srcAddr, - uint32_t srcWidth, - void *destAddr, - uint32_t destWidth, - uint32_t bytesEachRequest, - uint32_t transferBytes, - edma_transfer_type_t type); - -/*! - * @brief Prepares the eDMA transfer content descriptor. - * - * This function prepares the transfer content descriptor structure according to the user input. - * - * @param handle eDMA handle pointer. - * @param tcd Pointer to eDMA transfer content descriptor structure. - * @param srcAddr eDMA transfer source address. - * @param srcWidth eDMA transfer source address width(bytes). - * @param srcOffset source address offset. - * @param destAddr eDMA transfer destination address. - * @param destWidth eDMA transfer destination address width(bytes). - * @param destOffset destination address offset. - * @param bytesEachRequest eDMA transfer bytes per channel request. - * @param transferBytes eDMA transfer bytes to be transferred. - * @param nextTcd eDMA transfer linked TCD address. - * - * @note The data address and the data width must be consistent. For example, if the SRC - * is 4 bytes, the source address must be 4 bytes aligned, or it results in - * source address error (SAE). - */ -void EDMA_PrepareTransferTCD(edma_handle_t *handle, - edma_tcd_t *tcd, - void *srcAddr, - uint32_t srcWidth, - int16_t srcOffset, - void *destAddr, - uint32_t destWidth, - int16_t destOffset, - uint32_t bytesEachRequest, - uint32_t transferBytes, - edma_tcd_t *nextTcd); - -/*! - * @brief Submits the eDMA transfer content descriptor. - * - * This function submits the eDMA transfer request according to the transfer content descriptor. - * In scatter gather mode, call this function will add a configured tcd to the circular list of tcd pool. - * The tcd pools is setup by call function EDMA_InstallTCDMemory before. - * - * Typical user case: - * 1. submit single transfer - * @code - * edma_tcd_t tcd; - * EDMA_PrepareTransferTCD(handle, tcd, ....) - * EDMA_SubmitTransferTCD(handle, tcd) - * EDMA_StartTransfer(handle) - * @endcode - * - * 2. submit static link transfer, - * @code - * edma_tcd_t tcd[2]; - * EDMA_PrepareTransferTCD(handle, &tcd[0], ....) - * EDMA_PrepareTransferTCD(handle, &tcd[1], ....) - * EDMA_SubmitTransferTCD(handle, &tcd[0]) - * EDMA_StartTransfer(handle) - * @endcode - * - * 3. submit dynamic link transfer - * @code - * edma_tcd_t tcdpool[2]; - * EDMA_InstallTCDMemory(&g_DMA_Handle, tcdpool, 2); - * edma_tcd_t tcd; - * EDMA_PrepareTransferTCD(handle, tcd, ....) - * EDMA_SubmitTransferTCD(handle, tcd) - * EDMA_PrepareTransferTCD(handle, tcd, ....) - * EDMA_SubmitTransferTCD(handle, tcd) - * EDMA_StartTransfer(handle) - * @endcode - * - * 4. submit loop transfer - * @code - * edma_tcd_t tcd[2]; - * EDMA_PrepareTransferTCD(handle, &tcd[0], ...,&tcd[1]) - * EDMA_PrepareTransferTCD(handle, &tcd[1], ..., &tcd[0]) - * EDMA_SubmitTransferTCD(handle, &tcd[0]) - * EDMA_StartTransfer(handle) - * @endcode - * - * @param handle eDMA handle pointer. - * @param tcd Pointer to eDMA transfer content descriptor structure. - * - * @retval kStatus_EDMA_Success It means submit transfer request succeed. - * @retval kStatus_EDMA_QueueFull It means TCD queue is full. Submit transfer request is not allowed. - * @retval kStatus_EDMA_Busy It means the given channel is busy, need to submit request later. - */ -status_t EDMA_SubmitTransferTCD(edma_handle_t *handle, edma_tcd_t *tcd); - -/*! - * @brief Submits the eDMA transfer request. - * - * This function submits the eDMA transfer request according to the transfer configuration structure. - * In scatter gather mode, call this function will add a configured tcd to the circular list of tcd pool. - * The tcd pools is setup by call function EDMA_InstallTCDMemory before. - * - * @param handle eDMA handle pointer. - * @param config Pointer to eDMA transfer configuration structure. - * @retval kStatus_EDMA_Success It means submit transfer request succeed. - * @retval kStatus_EDMA_QueueFull It means TCD queue is full. Submit transfer request is not allowed. - * @retval kStatus_EDMA_Busy It means the given channel is busy, need to submit request later. - */ -status_t EDMA_SubmitTransfer(edma_handle_t *handle, const edma_transfer_config_t *config); - -/*! - * @brief Submits the eDMA scatter gather transfer configurations. - * - * The function is target for submit loop transfer request, - * the ring transfer request means that the transfer request TAIL is link to HEAD, such as, - * A->B->C->D->A, or A->A - * - * To use the ring transfer feature, the application should allocate several transfer object, such as - * @code - * edma_channel_transfer_config_t transfer[2]; - * EDMA_TransferSubmitLoopTransfer(psHandle, &transfer, 2U); - * @endcode - * Then eDMA driver will link transfer[0] and transfer[1] to each other - * - * @note Application should check the return value of this function to avoid transfer request - * submit failed - * - * @param handle eDMA handle pointer - * @param transfer pointer to user's eDMA channel configure structure, see edma_channel_transfer_config_t for detail - * @param transferLoopCount the count of the transfer ring, if loop count is 1, that means that the one will link to - * itself. - * - * @retval #kStatus_Success It means submit transfer request succeed - * @retval #kStatus_EDMA_Busy channel is in busy status - * @retval #kStatus_InvalidArgument Invalid Argument - */ -status_t EDMA_SubmitLoopTransfer(edma_handle_t *handle, edma_transfer_config_t *transfer, uint32_t transferLoopCount); - -/*! - * @brief eDMA starts transfer. - * - * This function enables the channel request. Users can call this function after submitting the transfer request - * or before submitting the transfer request. - * - * @param handle eDMA handle pointer. - */ -void EDMA_StartTransfer(edma_handle_t *handle); - -/*! - * @brief eDMA stops transfer. - * - * This function disables the channel request to pause the transfer. Users can call EDMA_StartTransfer() - * again to resume the transfer. - * - * @param handle eDMA handle pointer. - */ -void EDMA_StopTransfer(edma_handle_t *handle); - -/*! - * @brief eDMA aborts transfer. - * - * This function disables the channel request and clear transfer status bits. - * Users can submit another transfer after calling this API. - * - * @param handle DMA handle pointer. - */ -void EDMA_AbortTransfer(edma_handle_t *handle); - -/*! - * @brief Get unused TCD slot number. - * - * This function gets current tcd index which is run. If the TCD pool pointer is NULL, it will return 0. - * - * @param handle DMA handle pointer. - * @return The unused tcd slot number. - */ -static inline uint32_t EDMA_GetUnusedTCDNumber(edma_handle_t *handle) -{ - int8_t tmpTcdSize = handle->tcdSize; - int8_t tmpTcdUsed = handle->tcdUsed; - return ((uint32_t)tmpTcdSize - (uint32_t)tmpTcdUsed); -} - -/*! - * @brief Get the next tcd address. - * - * This function gets the next tcd address. If this is last TCD, return 0. - * - * @param handle DMA handle pointer. - * @return The next TCD address. - */ -static inline uint32_t EDMA_GetNextTCDAddress(edma_handle_t *handle) -{ - return (uint32_t)(EDMA_TCD_DLAST_SGA(handle->tcdBase, EDMA_TCD_TYPE(handle->base))); -} - -/*! - * @brief eDMA IRQ handler for the current major loop transfer completion. - * - * This function clears the channel major interrupt flag and calls - * the callback function if it is not NULL. - * - * Note: - * For the case using TCD queue, when the major iteration count is exhausted, additional operations are performed. - * These include the final address adjustments and reloading of the BITER field into the CITER. - * Assertion of an optional interrupt request also occurs at this time, as does a possible fetch of a new TCD from - * memory using the scatter/gather address pointer included in the descriptor (if scatter/gather is enabled). - * - * For instance, when the time interrupt of TCD[0] happens, the TCD[1] has already been loaded into the eDMA engine. - * As sga and sga_index are calculated based on the DLAST_SGA bitfield lies in the TCD_CSR register, the sga_index - * in this case should be 2 (DLAST_SGA of TCD[1] stores the address of TCD[2]). Thus, the "tcdUsed" updated should be - * (tcdUsed - 2U) which indicates the number of TCDs can be loaded in the memory pool (because TCD[0] and TCD[1] have - * been loaded into the eDMA engine at this point already.). - * - * For the last two continuous ISRs in a scatter/gather process, they both load the last TCD (The last ISR does not - * load a new TCD) from the memory pool to the eDMA engine when major loop completes. - * Therefore, ensure that the header and tcdUsed updated are identical for them. - * tcdUsed are both 0 in this case as no TCD to be loaded. - * - * See the "eDMA basic data flow" in the eDMA Functional description section of the Reference Manual for - * further details. - * - * @param handle eDMA handle pointer. - */ -void EDMA_HandleIRQ(edma_handle_t *handle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @} */ - -#endif /*FSL_EDMA_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_edma_core.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_edma_core.h deleted file mode 100644 index 482f4e19883..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_edma_core.h +++ /dev/null @@ -1,357 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_EDMA_CORE_H_ -#define FSL_EDMA_CORE_H_ - -#include "fsl_edma_soc.h" - -/*! - * @addtogroup edma_core - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -#define DMA_CSR_INTMAJOR_MASK (0x2U) -#define DMA_CSR_INTHALF_MASK (0x4U) -#define DMA_CSR_DREQ_MASK (0x8U) -#define DMA_CSR_ESG_MASK (0x10U) -#define DMA_CSR_BWC_MASK (0xC000U) -#define DMA_CSR_BWC(x) (((uint16_t)(((uint16_t)(x)) << (14U))) & (0xC000U)) -#define DMA_CSR_START_MASK (0x1U) -#define DMA_CITER_ELINKNO_CITER_MASK (0x7FFFU) -#define DMA_BITER_ELINKNO_BITER_MASK (0x7FFFU) -#define DMA_CITER_ELINKNO_CITER_SHIFT (0U) -#define DMA_CITER_ELINKYES_CITER_MASK (0x1FFU) -#define DMA_CITER_ELINKYES_CITER_SHIFT (0U) -#define DMA_ATTR_SMOD_MASK (0xF800U) -#define DMA_ATTR_DMOD_MASK (0xF8U) -#define DMA_CITER_ELINKNO_ELINK_MASK (0x8000U) -#define DMA_CSR_MAJORELINK_MASK (0x20U) -#define DMA_BITER_ELINKYES_ELINK_MASK (0x8000U) -#define DMA_CITER_ELINKYES_ELINK_MASK (0x8000U) -#define DMA_CSR_MAJORLINKCH_MASK (0x1F00U) -#define DMA_BITER_ELINKYES_LINKCH_MASK (0x3E00U) -#define DMA_CITER_ELINKYES_LINKCH_MASK (0x3E00U) -#define DMA_NBYTES_MLOFFYES_MLOFF_MASK (0x3FFFFC00U) -#define DMA_NBYTES_MLOFFYES_DMLOE_MASK (0x40000000U) -#define DMA_NBYTES_MLOFFYES_SMLOE_MASK (0x80000000U) -#define DMA_NBYTES_MLOFFNO_NBYTES_MASK (0x3FFFFFFFU) -#define DMA_ATTR_DMOD(x) (((uint16_t)(((uint16_t)(x)) << (3U))) & (0xF8U)) -#define DMA_ATTR_SMOD(x) (((uint16_t)(((uint16_t)(x)) << (11U))) & (0xF800U)) -#define DMA_BITER_ELINKYES_LINKCH(x) (((uint16_t)(((uint16_t)(x)) << (9U))) & (0x3E00U)) -#define DMA_CITER_ELINKYES_LINKCH(x) (((uint16_t)(((uint16_t)(x)) << (9U))) & (0x3E00U)) -#define DMA_NBYTES_MLOFFYES_MLOFF(x) (((uint32_t)(((uint32_t)(x)) << (10U))) & (0x3FFFFC00U)) -#define DMA_NBYTES_MLOFFYES_DMLOE(x) (((uint32_t)(((uint32_t)(x)) << (30U))) & (0x40000000U)) -#define DMA_NBYTES_MLOFFYES_SMLOE(x) (((uint32_t)(((uint32_t)(x)) << (31U))) & (0x80000000U)) -#define DMA_NBYTES_MLOFFNO_NBYTES(x) (((uint32_t)(((uint32_t)(x)) << (0U))) & (0x3FFFFFFFU)) -#define DMA_NBYTES_MLOFFYES_NBYTES(x) (((uint32_t)(((uint32_t)(x)) << (0U))) & (0x3FFU)) -#define DMA_ATTR_DSIZE(x) (((uint16_t)(((uint16_t)(x)) << (0U))) & (0x7U)) -#define DMA_ATTR_SSIZE(x) (((uint16_t)(((uint16_t)(x)) << (8U))) & (0x700U)) -#define DMA_CSR_DREQ(x) (((uint16_t)(((uint16_t)(x)) << (3U))) & (0x8U)) -#define DMA_CSR_MAJORLINKCH(x) (((uint16_t)(((uint16_t)(x)) << (8U))) & (0x1F00U)) -#define DMA_CH_MATTR_WCACHE(x) (((uint16_t)(((uint16_t)(x)) << (4U))) & (0xF0U)) -#define DMA_CH_MATTR_RCACHE(x) (((uint16_t)(((uint16_t)(x)) << (0U))) & (0xFU)) -#define DMA_CH_CSR_SIGNEXT_MASK (0x3F0000U) -#define DMA_CH_CSR_SIGNEXT_SHIFT (16U) -#define DMA_CH_CSR_SWAP_MASK (0xF000U) -#define DMA_CH_CSR_SWAP_SHIFT (12U) -#define DMA_CH_SBR_INSTR_MASK (0x2000U) -#define DMA_CH_SBR_INSTR_SHIFT (13U) -#define DMA_CH_MUX_SOURCE(x) (((uint32_t)(((uint32_t)(x)) << (0U))) & (0xFFU)) - -/*! @brief DMA error flag */ -#if defined(FSL_EDMA_SOC_IP_EDMA) && FSL_EDMA_SOC_IP_EDMA -#define DMA_ERR_DBE_FLAG DMA_ES_DBE_MASK -#define DMA_ERR_SBE_FLAG DMA_ES_SBE_MASK -#define DMA_ERR_SGE_FLAG DMA_ES_SGE_MASK -#define DMA_ERR_NCE_FLAG DMA_ES_NCE_MASK -#define DMA_ERR_DOE_FLAG DMA_ES_DOE_MASK -#define DMA_ERR_DAE_FLAG DMA_ES_DAE_MASK -#define DMA_ERR_SOE_FLAG DMA_ES_SOE_MASK -#define DMA_ERR_SAE_FLAG DMA_ES_SAE_MASK -#define DMA_ERR_ERRCHAN_FLAG DMA_ES_ERRCHN_MASK -#define DMA_ERR_CPE_FLAG DMA_ES_CPE_MASK -#define DMA_ERR_ECX_FLAG DMA_ES_ECX_MASK -#if defined(FSL_FEATURE_EDMA_CHANNEL_GROUP_COUNT) && (FSL_FEATURE_EDMA_CHANNEL_GROUP_COUNT > 1) -#define DMA_ERR_GPE_FLAG DMA_ES_GPE_MASK -#endif -#define DMA_ERR_FLAG DMA_ES_VLD_MASK - -/*! @brief get/clear DONE status*/ -#define DMA_CLEAR_DONE_STATUS(base, channel) (EDMA_BASE(base)->CDNE = (uint8_t)channel) -#define DMA_GET_DONE_STATUS(base, channel) \ - ((EDMA_TCD_BASE(base, channel)->CSR & DMA_CSR_DONE_MASK) >> DMA_CSR_DONE_SHIFT) -/*! @brief enable/disable error interrupt*/ -#define DMA_ENABLE_ERROR_INT(base, channel) (base->EEI |= ((uint32_t)0x1U << channel)) -#define DMA_DISABLE_ERROR_INT(base, channel) (base->EEI &= (~((uint32_t)0x1U << channel))) -/*! @brief get/clear error status*/ -#define DMA_GET_ERROR_STATUS(base, channel) (((uint32_t)EDMA_BASE(base)->ERR >> channel) & 0x1U) -#define DMA_CLEAR_ERROR_STATUS(base, channel) ((uint32_t)EDMA_BASE(base)->CERR = (uint8_t)channel) -/*! @brief get/clear int status*/ -#define DMA_GET_INT_STATUS(base, channel) ((((uint32_t)EDMA_BASE(base)->INT >> channel) & 0x1U)) -#define DMA_CLEAR_INT_STATUS(base, channel) ((uint32_t)EDMA_BASE(base)->CINT = (uint8_t)channel) - -#else - -#define DMA_ERR_DBE_FLAG DMA_MP_ES_DBE_MASK -#define DMA_ERR_SBE_FLAG DMA_MP_ES_SBE_MASK -#define DMA_ERR_SGE_FLAG DMA_MP_ES_SGE_MASK -#define DMA_ERR_NCE_FLAG DMA_MP_ES_NCE_MASK -#define DMA_ERR_DOE_FLAG DMA_MP_ES_DOE_MASK -#define DMA_ERR_DAE_FLAG DMA_MP_ES_DAE_MASK -#define DMA_ERR_SOE_FLAG DMA_MP_ES_SOE_MASK -#define DMA_ERR_SAE_FLAG DMA_MP_ES_SAE_MASK -#define DMA_ERR_ERRCHAN_FLAG DMA_MP_ES_ERRCHN_MASK -#define DMA_ERR_ECX_FLAG DMA_MP_ES_ECX_MASK -#define DMA_ERR_FLAG DMA_MP_ES_VLD_MASK - -/*! @brief get/clear DONE bit*/ -#define DMA_CLEAR_DONE_STATUS(base, channel) (EDMA_CHANNEL_BASE(base, channel)->CH_CSR |= DMA_CH_CSR_DONE_MASK) -#define DMA_GET_DONE_STATUS(base, channel) \ - ((EDMA_CHANNEL_BASE(base, channel)->CH_CSR & DMA_CH_CSR_DONE_MASK) >> DMA_CH_CSR_DONE_SHIFT) -/*! @brief enable/disable error interupt*/ -#define DMA_ENABLE_ERROR_INT(base, channel) (EDMA_CHANNEL_BASE(base, channel)->CH_CSR |= DMA_CH_CSR_EEI_MASK) -#define DMA_DISABLE_ERROR_INT(base, channel) (EDMA_CHANNEL_BASE(base, channel)->CH_CSR &= ~DMA_CH_CSR_EEI_MASK) -/*! @brief get/clear error status*/ -#define DMA_CLEAR_ERROR_STATUS(base, channel) (EDMA_CHANNEL_BASE(base, channel)->CH_ES |= DMA_CH_ES_ERR_MASK) -#define DMA_GET_ERROR_STATUS(base, channel) \ - (((uint32_t)EDMA_CHANNEL_BASE(base, channel)->CH_ES >> DMA_CH_ES_ERR_SHIFT) & 0x1U) -/*! @brief get/clear INT status*/ -#define DMA_CLEAR_INT_STATUS(base, channel) (EDMA_CHANNEL_BASE(base, channel)->CH_INT = DMA_CH_INT_INT_MASK) -#define DMA_GET_INT_STATUS(base, channel) ((((uint32_t)EDMA_CHANNEL_BASE(base, channel)->CH_INT) & 0x1U)) -#endif /*FSL_EDMA_SOC_IP_EDMA*/ - -/*! @brief enable/dsiable MAJOR/HALF INT*/ -#define DMA_ENABLE_MAJOR_INT(base, channel) \ - (EDMA_TCD_CSR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) |= DMA_CSR_INTMAJOR_MASK) -#define DMA_ENABLE_HALF_INT(base, channel) \ - (EDMA_TCD_CSR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) |= DMA_CSR_INTHALF_MASK) -#define DMA_DISABLE_MAJOR_INT(base, channel) \ - (EDMA_TCD_CSR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_CSR_INTMAJOR_MASK) -#define DMA_DISABLE_HALF_INT(base, channel) \ - (EDMA_TCD_CSR(EDMA_TCD_BASE(base, channel), EDMA_TCD_TYPE(base)) &= ~(uint16_t)DMA_CSR_INTHALF_MASK) - -/*!@brief EDMA tcd align size */ -#define EDMA_TCD_ALIGN_SIZE (32U) - -/*!@brief edma core channel struture definition */ -typedef struct _edma_core_mp -{ - __IO uint32_t MP_CSR; /**< Channel Control and Status, array offset: 0x10000, array step: 0x10000 */ - __IO uint32_t MP_ES; /**< Channel Error Status, array offset: 0x10004, array step: 0x10000 */ - union - { - struct - { - __IO uint32_t MP_INT_LOW; /**< Channel Control and Status, array offset: 0x10008, array step: 0x10000 */ - __I uint32_t MP_INT_HIGH; /**< Channel Control and Status, array offset: 0x1000C, array step: 0x10000 */ - __I uint32_t MP_HRS_LOW; /**< Channel Control and Status, array offset: 0x10010, array step: 0x10000 */ - __I uint32_t MP_HRS_HIGH; /**< Channel Control and Status, array offset: 0x10014, array step: 0x10000 */ - uint8_t RESERVED_0[8]; - __IO uint32_t MP_STOPCH; /**< Channel Control and Status, array offset: 0x10020, array step: 0x10000 */ - uint8_t RESERVED_1[12]; - __I uint32_t MP_SSR_LOW; /**< Channel Control and Status, array offset: 0x10030, array step: 0x10000 */ - __I uint32_t MP_SSR_HIGH; /**< Channel Control and Status, array offset: 0x10034, array step: 0x10000 */ - uint8_t RESERVED_2[200]; - __IO uint32_t CH_GRPRI[64]; /**< Channel Control and Status, array offset: 0x10100, array step: 0x10000 */ - __IO uint32_t CH_MUX[64]; /**< Channel Control and Status, array offset: 0x10200, array step: 0x10000 */ - uint8_t RESERVED_3[256]; - __IO uint32_t CH_PROT[64]; /**< Channel Control and Status, array offset: 0x10400, array step: 0x10000 */ - } EDMA5_REG; - } MP_REGS; -} edma_core_mp_t; - -/*!@brief edma core channel struture definition */ -typedef struct _edma_core_channel -{ - __IO uint32_t CH_CSR; /**< Channel Control and Status, array offset: 0x10000, array step: 0x10000 */ - __IO uint32_t CH_ES; /**< Channel Error Status, array offset: 0x10004, array step: 0x10000 */ - __IO uint32_t CH_INT; /**< Channel Interrupt Status, array offset: 0x10008, array step: 0x10000 */ - __IO uint32_t CH_SBR; /**< Channel System Bus, array offset: 0x1000C, array step: 0x10000 */ - __IO uint32_t CH_PRI; /**< Channel Priority, array offset: 0x10010, array step: 0x10000 */ - union - { - struct - { - __IO uint8_t RESERVED_1[4]; - __IO uint32_t CH_MATTR; /**< Memory Attributes Register, array offset: 0x10018, array step: 0x8000 */ - } EDMA5_REG; - struct - { - __IO uint32_t CH_MUX; /**< Channel Multiplexor Configuration, array offset: 0x10014, array step: 0x10000 */ - __IO uint16_t CH_MATTR; /**< Memory Attributes Register, array offset: 0x10018, array step: 0x8000 */ - } EDMA4_REG; - } CH_REGS; -} edma_core_channel_t; - -/*! @brief eDMA tcd flag type */ -typedef enum _edma_tcd_type -{ - kEDMA_EDMA4Flag = 0x0U, /*!< Data access for eDMA4 transfers. */ - kEDMA_EDMA5Flag = 0x1U, /*!< Instruction access for eDMA4 transfers. */ -} edma_tcd_type_t; - -/*!@brief edma5 core TCD struture definition */ -typedef struct _edma5_core_tcd -{ - __IO uint32_t SADDR; /*!< SADDR register, used to save source address */ - __IO uint32_t SADDR_HIGH; /*!< SADDR HIGH register, used to save source address */ - __IO uint16_t SOFF; /*!< SOFF register, save offset bytes every transfer */ - __IO uint16_t ATTR; /*!< ATTR register, source/destination transfer size and modulo */ - __IO uint32_t NBYTES; /*!< Nbytes register, minor loop length in bytes */ - __IO uint32_t SLAST; /*!< SLAST register */ - __IO uint32_t SLAST_SDA_HIGH; /*!< SLAST SDA HIGH register */ - __IO uint32_t DADDR; /*!< DADDR register, used for destination address */ - __IO uint32_t DADDR_HIGH; /*!< DADDR HIGH register, used for destination address */ - __IO uint32_t DLAST_SGA; /*!< DLASTSGA register, next tcd address used in scatter-gather mode */ - __IO uint32_t DLAST_SGA_HIGH; /*!< DLASTSGA HIGH register, next tcd address used in scatter-gather mode */ - __IO uint16_t DOFF; /*!< DOFF register, used for destination offset */ - __IO uint16_t CITER; /*!< CITER register, current minor loop numbers, for unfinished minor loop.*/ - __IO uint16_t CSR; /*!< CSR register, for TCD control status */ - __IO uint16_t BITER; /*!< BITER register, begin minor loop count. */ - uint8_t RESERVED[16]; /*!< Aligned 64 bytes */ -} edma5_core_tcd_t; - -/*!@brief edma4 core TCD struture definition */ -typedef struct _edma4_core_tcd -{ - __IO uint32_t SADDR; /*!< SADDR register, used to save source address */ - __IO uint16_t SOFF; /*!< SOFF register, save offset bytes every transfer */ - __IO uint16_t ATTR; /*!< ATTR register, source/destination transfer size and modulo */ - __IO uint32_t NBYTES; /*!< Nbytes register, minor loop length in bytes */ - __IO uint32_t SLAST; /*!< SLAST register */ - __IO uint32_t DADDR; /*!< DADDR register, used for destination address */ - __IO uint16_t DOFF; /*!< DOFF register, used for destination offset */ - __IO uint16_t CITER; /*!< CITER register, current minor loop numbers, for unfinished minor loop.*/ - __IO uint32_t DLAST_SGA; /*!< DLASTSGA register, next tcd address used in scatter-gather mode */ - __IO uint16_t CSR; /*!< CSR register, for TCD control status */ - __IO uint16_t BITER; /*!< BITER register, begin minor loop count. */ -} edma4_core_tcd_t; - -/*!@brief edma core TCD struture definition */ -typedef struct _edma_core_tcd -{ - union - { - edma4_core_tcd_t edma4_tcd; -#if defined FSL_EDMA_SOC_IP_DMA5 && FSL_EDMA_SOC_IP_DMA5 - edma5_core_tcd_t edma5_tcd; -#endif /* FSL_EDMA_SOC_IP_DMA5 */ - } TCD_REGS; -} edma_core_tcd_t; - -/*!@brief EDMA typedef */ -typedef edma_core_channel_t EDMA_ChannelType; -typedef edma_core_tcd_t EDMA_TCDType; -typedef void EDMA_Type; - -/*!@brief EDMA base address convert macro */ -#define EDMA_BASE(base) -#define EDMA_CHANNEL_BASE(base, channel) \ - ((edma_core_channel_t *)((uint32_t)(uint32_t *)(base) + EDMA_CHANNEL_OFFSET + \ - (channel)*EDMA_CHANNEL_ARRAY_STEP(base))) -#define EDMA_TCD_BASE(base, channel) \ - ((edma_core_tcd_t *)((uint32_t)(uint32_t *)(base) + EDMA_CHANNEL_OFFSET + \ - (channel)*EDMA_CHANNEL_ARRAY_STEP(base) + 0x20U)) -#define EDMA_MP_BASE(base) ((edma_core_mp_t *)((uint32_t)(uint32_t *)(base))) - -/*!@brief EDMA TCD type macro */ -#if defined FSL_FEATURE_EDMA_TCD_TYPEn -#define EDMA_TCD_TYPE(x) FSL_FEATURE_EDMA_TCD_TYPEn(x) -#else -#define EDMA_TCD_TYPE(x) (0) -#endif - -#if defined FSL_EDMA_SOC_IP_DMA5 && FSL_EDMA_SOC_IP_DMA5 -/*!@brief EDMA TCD address convert macro */ -#define EDMA_TCD_SADDR(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->SADDR)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->SADDR)))) - -#define EDMA_TCD_SOFF(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->SOFF)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->SOFF)))) - -#define EDMA_TCD_ATTR(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->ATTR)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->ATTR)))) - -#define EDMA_TCD_NBYTES(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->NBYTES)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->NBYTES)))) - -#define EDMA_TCD_SLAST(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->SLAST)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->SLAST)))) - -#define EDMA_TCD_DADDR(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->DADDR)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->DADDR)))) - -#define EDMA_TCD_DOFF(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->DOFF)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->DOFF)))) - -#define EDMA_TCD_CITER(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->CITER)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->CITER)))) - -#define EDMA_TCD_DLAST_SGA(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? \ - (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->DLAST_SGA)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->DLAST_SGA)))) - -#define EDMA_TCD_CSR(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->CSR)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->CSR)))) - -#define EDMA_TCD_BITER(tcd, flag) \ - (*(((edma_tcd_type_t)(flag) == kEDMA_EDMA4Flag) ? (&(((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->BITER)) : \ - (&(((edma5_core_tcd_t *)(&(tcd)->TCD_REGS.edma5_tcd))->BITER)))) -#else -/*!@brief EDMA TCD address convert macro */ -#define EDMA_TCD_SADDR(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->SADDR) - -#define EDMA_TCD_SOFF(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->SOFF) - -#define EDMA_TCD_ATTR(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->ATTR) - -#define EDMA_TCD_NBYTES(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->NBYTES) - -#define EDMA_TCD_SLAST(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->SLAST) - -#define EDMA_TCD_DADDR(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->DADDR) - -#define EDMA_TCD_DOFF(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->DOFF) - -#define EDMA_TCD_CITER(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->CITER) - -#define EDMA_TCD_DLAST_SGA(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->DLAST_SGA) - -#define EDMA_TCD_CSR(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->CSR) - -#define EDMA_TCD_BITER(tcd, flag) (((edma4_core_tcd_t *)(&(tcd)->TCD_REGS.edma4_tcd))->BITER) -#endif /* FSL_EDMA_SOC_IP_DMA5 */ -/******************************************************************************* - * API - ******************************************************************************/ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif - -/*! - * @} - */ - -#endif /* FSL_EDMA_CORE_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_edma_soc.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_edma_soc.c deleted file mode 100644 index e492631f473..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_edma_soc.c +++ /dev/null @@ -1,377 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_edma_soc.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.edma_soc" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -extern void EDMA_0_CH0_DriverIRQHandler(void); -extern void EDMA_0_CH1_DriverIRQHandler(void); -extern void EDMA_0_CH2_DriverIRQHandler(void); -extern void EDMA_0_CH3_DriverIRQHandler(void); -extern void EDMA_0_CH4_DriverIRQHandler(void); -extern void EDMA_0_CH5_DriverIRQHandler(void); -extern void EDMA_0_CH6_DriverIRQHandler(void); -extern void EDMA_0_CH7_DriverIRQHandler(void); -extern void EDMA_0_CH8_DriverIRQHandler(void); -extern void EDMA_0_CH9_DriverIRQHandler(void); -extern void EDMA_0_CH10_DriverIRQHandler(void); -extern void EDMA_0_CH11_DriverIRQHandler(void); -extern void EDMA_0_CH12_DriverIRQHandler(void); -extern void EDMA_0_CH13_DriverIRQHandler(void); -extern void EDMA_0_CH14_DriverIRQHandler(void); -extern void EDMA_0_CH15_DriverIRQHandler(void); -extern void EDMA_1_CH0_DriverIRQHandler(void); -extern void EDMA_1_CH1_DriverIRQHandler(void); -extern void EDMA_1_CH2_DriverIRQHandler(void); -extern void EDMA_1_CH3_DriverIRQHandler(void); -extern void EDMA_1_CH4_DriverIRQHandler(void); -extern void EDMA_1_CH5_DriverIRQHandler(void); -extern void EDMA_1_CH6_DriverIRQHandler(void); -extern void EDMA_1_CH7_DriverIRQHandler(void); -extern void EDMA_1_CH8_DriverIRQHandler(void); -extern void EDMA_1_CH9_DriverIRQHandler(void); -extern void EDMA_1_CH10_DriverIRQHandler(void); -extern void EDMA_1_CH11_DriverIRQHandler(void); -extern void EDMA_1_CH12_DriverIRQHandler(void); -extern void EDMA_1_CH13_DriverIRQHandler(void); -extern void EDMA_1_CH14_DriverIRQHandler(void); -extern void EDMA_1_CH15_DriverIRQHandler(void); -extern void EDMA_DriverIRQHandler(uint32_t instance, uint32_t channel); -/******************************************************************************* - * Code - ******************************************************************************/ -/*! - * brief DMA instance 0, channel 0 IRQ handler. - * - */ -void EDMA_0_CH0_DriverIRQHandler(void) -{ - /* Instance 0 channel 0 */ - EDMA_DriverIRQHandler(0U, 0U); -} - -/*! - * brief DMA instance 0, channel 1 IRQ handler. - * - */ -void EDMA_0_CH1_DriverIRQHandler(void) -{ - /* Instance 0 channel 1 */ - EDMA_DriverIRQHandler(0U, 1U); -} - -/*! - * brief DMA instance 0, channel 2 IRQ handler. - * - */ -void EDMA_0_CH2_DriverIRQHandler(void) -{ - /* Instance 0 channel 2 */ - EDMA_DriverIRQHandler(0U, 2U); -} - -/*! - * brief DMA instance 0, channel 3 IRQ handler. - * - */ -void EDMA_0_CH3_DriverIRQHandler(void) -{ - /* Instance 0 channel 3 */ - EDMA_DriverIRQHandler(0U, 3U); -} - -/*! - * brief DMA instance 0, channel 4 IRQ handler. - * - */ -void EDMA_0_CH4_DriverIRQHandler(void) -{ - /* Instance 0 channel 4 */ - EDMA_DriverIRQHandler(0U, 4U); -} - -/*! - * brief DMA instance 0, channel 5 IRQ handler. - * - */ -void EDMA_0_CH5_DriverIRQHandler(void) -{ - /* Instance 0 channel 5 */ - EDMA_DriverIRQHandler(0U, 5U); -} - -/*! - * brief DMA instance 0, channel 6 IRQ handler. - * - */ -void EDMA_0_CH6_DriverIRQHandler(void) -{ - /* Instance 0 channel 6 */ - EDMA_DriverIRQHandler(0U, 6U); -} - -/*! - * brief DMA instance 0, channel 7 IRQ handler. - * - */ -void EDMA_0_CH7_DriverIRQHandler(void) -{ - /* Instance 0 channel 7 */ - EDMA_DriverIRQHandler(0U, 7U); -} - -/*! - * brief DMA instance 0, channel 8 IRQ handler. - * - */ -void EDMA_0_CH8_DriverIRQHandler(void) -{ - /* Instance 0 channel 8 */ - EDMA_DriverIRQHandler(0U, 8U); -} - -/*! - * brief DMA instance 0, channel 9 IRQ handler. - * - */ -void EDMA_0_CH9_DriverIRQHandler(void) -{ - /* Instance 0 channel 9 */ - EDMA_DriverIRQHandler(0U, 9U); -} - -/*! - * brief DMA instance 0, channel 10 IRQ handler. - * - */ -void EDMA_0_CH10_DriverIRQHandler(void) -{ - /* Instance 0 channel 10 */ - EDMA_DriverIRQHandler(0U, 10U); -} - -/*! - * brief DMA instance 0, channel 11 IRQ handler. - * - */ -void EDMA_0_CH11_DriverIRQHandler(void) -{ - /* Instance 0 channel 11 */ - EDMA_DriverIRQHandler(0U, 11U); -} - -/*! - * brief DMA instance 0, channel 12 IRQ handler. - * - */ -void EDMA_0_CH12_DriverIRQHandler(void) -{ - /* Instance 0 channel 12 */ - EDMA_DriverIRQHandler(0U, 12U); -} - -/*! - * brief DMA instance 0, channel 13 IRQ handler. - * - */ -void EDMA_0_CH13_DriverIRQHandler(void) -{ - /* Instance 0 channel 13 */ - EDMA_DriverIRQHandler(0U, 13U); -} - -/*! - * brief DMA instance 0, channel 14 IRQ handler. - * - */ -void EDMA_0_CH14_DriverIRQHandler(void) -{ - /* Instance 0 channel 14 */ - EDMA_DriverIRQHandler(0U, 14U); -} - -/*! - * brief DMA instance 0, channel 15 IRQ handler. - * - */ -void EDMA_0_CH15_DriverIRQHandler(void) -{ - /* Instance 0 channel 15 */ - EDMA_DriverIRQHandler(0U, 15U); -} - -/*! - * brief DMA instance 1, channel 0 IRQ handler. - * - */ -void EDMA_1_CH0_DriverIRQHandler(void) -{ - /* Instance 1 channel 0 */ - EDMA_DriverIRQHandler(1U, 0U); -} - -/*! - * brief DMA instance 1, channel 1 IRQ handler. - * - */ -void EDMA_1_CH1_DriverIRQHandler(void) -{ - /* Instance 1 channel 1 */ - EDMA_DriverIRQHandler(1U, 1U); -} - -/*! - * brief DMA instance 1, channel 2 IRQ handler. - * - */ -void EDMA_1_CH2_DriverIRQHandler(void) -{ - /* Instance 1 channel 2 */ - EDMA_DriverIRQHandler(1U, 2U); -} - -/*! - * brief DMA instance 1, channel 3 IRQ handler. - * - */ -void EDMA_1_CH3_DriverIRQHandler(void) -{ - /* Instance 1 channel 3 */ - EDMA_DriverIRQHandler(1U, 3U); -} - -/*! - * brief DMA instance 1, channel 4 IRQ handler. - * - */ -void EDMA_1_CH4_DriverIRQHandler(void) -{ - /* Instance 1 channel 4 */ - EDMA_DriverIRQHandler(1U, 4U); -} - -/*! - * brief DMA instance 1, channel 5 IRQ handler. - * - */ -void EDMA_1_CH5_DriverIRQHandler(void) -{ - /* Instance 1 channel 5 */ - EDMA_DriverIRQHandler(1U, 5U); -} - -/*! - * brief DMA instance 1, channel 6 IRQ handler. - * - */ -void EDMA_1_CH6_DriverIRQHandler(void) -{ - /* Instance 1 channel 6 */ - EDMA_DriverIRQHandler(1U, 6U); -} - -/*! - * brief DMA instance 1, channel 7 IRQ handler. - * - */ -void EDMA_1_CH7_DriverIRQHandler(void) -{ - /* Instance 1 channel 7 */ - EDMA_DriverIRQHandler(1U, 7U); -} - -/*! - * brief DMA instance 1, channel 8 IRQ handler. - * - */ -void EDMA_1_CH8_DriverIRQHandler(void) -{ - /* Instance 1 channel 8 */ - EDMA_DriverIRQHandler(1U, 8U); -} - -/*! - * brief DMA instance 1, channel 9 IRQ handler. - * - */ -void EDMA_1_CH9_DriverIRQHandler(void) -{ - /* Instance 1 channel 9 */ - EDMA_DriverIRQHandler(1U, 9U); -} - -/*! - * brief DMA instance 1, channel 10 IRQ handler. - * - */ -void EDMA_1_CH10_DriverIRQHandler(void) -{ - /* Instance 1 channel 10 */ - EDMA_DriverIRQHandler(1U, 10U); -} - -/*! - * brief DMA instance 1, channel 11 IRQ handler. - * - */ -void EDMA_1_CH11_DriverIRQHandler(void) -{ - /* Instance 1 channel 11 */ - EDMA_DriverIRQHandler(1U, 11U); -} - -/*! - * brief DMA instance 1, channel 12 IRQ handler. - * - */ -void EDMA_1_CH12_DriverIRQHandler(void) -{ - /* Instance 1 channel 12 */ - EDMA_DriverIRQHandler(1U, 12U); -} - -/*! - * brief DMA instance 1, channel 13 IRQ handler. - * - */ -void EDMA_1_CH13_DriverIRQHandler(void) -{ - /* Instance 1 channel 13 */ - EDMA_DriverIRQHandler(1U, 13U); -} - -/*! - * brief DMA instance 1, channel 14 IRQ handler. - * - */ -void EDMA_1_CH14_DriverIRQHandler(void) -{ - /* Instance 1 channel 14 */ - EDMA_DriverIRQHandler(1U, 14U); -} - -/*! - * brief DMA instance 1, channel 15 IRQ handler. - * - */ -void EDMA_1_CH15_DriverIRQHandler(void) -{ - /* Instance 1 channel 15 */ - EDMA_DriverIRQHandler(1U, 15U); -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_edma_soc.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_edma_soc.h deleted file mode 100644 index f955260e7a3..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_edma_soc.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef _FSL_EDMA_SOC_H_ -#define _FSL_EDMA_SOC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup edma_soc - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/*! @name Driver version */ -/*@{*/ -/*! @brief Driver version 1.0.0. */ -#define FSL_EDMA_SOC_DRIVER_VERSION (MAKE_VERSION(1, 0, 0)) -/*@}*/ - -/*!@brief DMA IP version */ -#define FSL_EDMA_SOC_IP_DMA3 (1) -#define FSL_EDMA_SOC_IP_DMA4 (0) - -/*!@brief DMA base table */ -#define EDMA_BASE_PTRS \ - { \ - DMA0, DMA1 \ - } - -#define EDMA_CHN_IRQS \ - { \ - {EDMA_0_CH0_IRQn, EDMA_0_CH1_IRQn, EDMA_0_CH2_IRQn, EDMA_0_CH3_IRQn, EDMA_0_CH4_IRQn, EDMA_0_CH5_IRQn, \ - EDMA_0_CH6_IRQn, EDMA_0_CH7_IRQn, EDMA_0_CH8_IRQn, EDMA_0_CH9_IRQn, EDMA_0_CH10_IRQn, EDMA_0_CH11_IRQn, \ - EDMA_0_CH12_IRQn, EDMA_0_CH13_IRQn, EDMA_0_CH14_IRQn, EDMA_0_CH15_IRQn}, \ - { \ - EDMA_1_CH0_IRQn, EDMA_1_CH1_IRQn, EDMA_1_CH2_IRQn, EDMA_1_CH3_IRQn, EDMA_1_CH4_IRQn, EDMA_1_CH5_IRQn, \ - EDMA_1_CH6_IRQn, EDMA_1_CH7_IRQn, EDMA_1_CH8_IRQn, EDMA_1_CH9_IRQn, EDMA_1_CH10_IRQn, \ - EDMA_1_CH11_IRQn, EDMA_1_CH12_IRQn, EDMA_1_CH13_IRQn, EDMA_1_CH14_IRQn, EDMA_1_CH15_IRQn \ - } \ - } - -/*!@brief EDMA base address convert macro */ -#define EDMA_CHANNEL_OFFSET 0x1000U -#define EDMA_CHANNEL_ARRAY_STEP(base) (0x1000U) - -/******************************************************************************* - * API - ******************************************************************************/ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif - -/*! - * @} - */ - -#endif /* _FSL_EDMA_SOC_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_eim.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_eim.c deleted file mode 100644 index bae11683f40..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_eim.c +++ /dev/null @@ -1,312 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_eim.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.eim" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to EIM bases for each instance. */ -static EIM_Type *const s_eimBases[] = EIM_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to EIM clocks for each instance. */ -static const clock_ip_name_t s_eimClocks[] = EIM_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t EIM_GetInstance(EIM_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_eimBases); instance++) - { - if (s_eimBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_eimBases)); - - return instance; -} - -/*! - * brief EIM module initialization function. - * - * param base EIM base address. - */ -void EIM_Init(EIM_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate EIM clock. */ - CLOCK_EnableClock(s_eimClocks[EIM_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - base->EIMCR = 0x00U; - base->EICHEN = 0x00U; -} - -/*! - * brief Deinitializes the EIM. - * - */ -void EIM_Deinit(EIM_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate EIM clock. */ - CLOCK_DisableClock(s_eimClocks[EIM_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -void EIM_InjectCheckBitError(EIM_Type *base, eim_memory_channel_t channel, uint8_t mask) -{ - switch ((uint8_t)channel) - { - case 0U: - base->EICHD0_WORD0 = EIM_EICHD0_WORD0_CHKBIT_MASK(mask); - break; -#ifdef EIM_EICHEN_EICH1EN_MASK - case 1U: - base->EICHD1_WORD0 = EIM_EICHD1_WORD0_CHKBIT_MASK(mask); - break; -#endif - -#ifdef EIM_EICHEN_EICH2EN_MASK - case 2U: - base->EICHD2_WORD0 = EIM_EICHD2_WORD0_CHKBIT_MASK(mask); - break; -#endif -#ifdef EIM_EICHEN_EICH3EN_MASK - case 3U: - base->EICHD3_WORD0 = EIM_EICHD3_WORD0_CHKBIT_MASK(mask); - break; -#endif -#ifdef EIM_EICHEN_EICH4EN_MASK - case 4U: - base->EICHD4_WORD0 = EIM_EICHD4_WORD0_CHKBIT_MASK(mask); - break; -#endif -#ifdef EIM_EICHEN_EICH5EN_MASK - case 5U: - base->EICHD5_WORD0 = EIM_EICHD5_WORD0_CHKBIT_MASK(mask); - break; -#endif -#ifdef EIM_EICHEN_EICH6EN_MASK - case 6U: - base->EICHD6_WORD0 = EIM_EICHD6_WORD0_CHKBIT_MASK(mask); - break; -#endif -#ifdef EIM_EICHEN_EICH7EN_MASK - case 7U: - base->EICHD7_WORD0 = EIM_EICHD7_WORD0_CHKBIT_MASK(mask); - break; -#endif -#ifdef EIM_EICHEN_EICH8EN_MASK - case 8U: - base->EICHD8_WORD0 = EIM_EICHD8_WORD0_CHKBIT_MASK(mask); - break; -#endif - default: - assert(NULL); - break; - } -} - -uint8_t EIM_GetCheckBitMask(EIM_Type *base, eim_memory_channel_t channel) -{ - uint8_t mask = 0x00U; - - switch ((uint8_t)channel) - { - case 0U: - mask = (uint8_t)((base->EICHD0_WORD0 & EIM_EICHD0_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD0_WORD0_CHKBIT_MASK_SHIFT); - break; -#ifdef EIM_EICHEN_EICH1EN_MASK - case 1U: - mask = (uint8_t)((base->EICHD1_WORD0 & EIM_EICHD1_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD1_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif -#ifdef EIM_EICHEN_EICH2EN_MASK - case 2U: - mask = (uint8_t)((base->EICHD2_WORD0 & EIM_EICHD2_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD2_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif -#ifdef EIM_EICHEN_EICH3EN_MASK - case 3U: - mask = (uint8_t)((base->EICHD3_WORD0 & EIM_EICHD3_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD3_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif -#ifdef EIM_EICHEN_EICH4EN_MASK - case 4U: - mask = (uint8_t)((base->EICHD4_WORD0 & EIM_EICHD4_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD4_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif -#ifdef EIM_EICHEN_EICH5EN_MASK - case 5U: - mask = (uint8_t)((base->EICHD5_WORD0 & EIM_EICHD5_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD5_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif -#ifdef EIM_EICHEN_EICH6EN_MASK - case 6U: - mask = (uint8_t)((base->EICHD6_WORD0 & EIM_EICHD6_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD6_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif -#ifdef EIM_EICHEN_EICH7EN_MASK - case 7U: - mask = (uint8_t)((base->EICHD7_WORD0 & EIM_EICHD7_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD7_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif -#ifdef EIM_EICHEN_EICH8EN_MASK - case 8U: - mask = (uint8_t)((base->EICHD8_WORD0 & EIM_EICHD8_WORD0_CHKBIT_MASK_MASK) >> - EIM_EICHD8_WORD0_CHKBIT_MASK_SHIFT); - break; -#endif - default: - assert(NULL); - break; - } - - return mask; -} - -void EIM_InjectDataBitError(EIM_Type *base, eim_memory_channel_t channel, uint8_t mask) -{ - switch ((uint8_t)channel) - { - case 0U: - base->EICHD0_WORD1 = mask; - break; -#ifdef EIM_EICHEN_EICH1EN_MASK - case 1U: - base->EICHD1_WORD1 = mask; - break; -#endif -#ifdef EIM_EICHEN_EICH2EN_MASK - case 2U: - base->EICHD2_WORD1 = mask; - break; -#endif -#ifdef EIM_EICHEN_EICH3EN_MASK - case kEIM_MemoryChannelRAMC: - base->EICHD3_WORD1 = mask; - break; -#endif -#ifdef EIM_EICHEN_EICH4EN_MASK - case kEIM_MemoryChannelRAMD: - base->EICHD4_WORD1 = mask; - break; -#endif -#ifdef EIM_EICHEN_EICH5EN_MASK - case kEIM_MemoryChannelRAME: - base->EICHD5_WORD1 = mask; - break; -#endif -#ifdef EIM_EICHEN_EICH6EN_MASK - case kEIM_MemoryChannelRAMF: - base->EICHD6_WORD1 = mask; - break; -#endif -#ifdef EIM_EICHEN_EICH7EN_MASK - case kEIM_MemoryChannelLPCACRAM: - base->EICHD7_WORD1 = mask; - break; -#endif -#ifdef EIM_EICHEN_EICH8EN_MASK - case kEIM_MemoryChannelPKCRAM: - base->EICHD8_WORD1 = mask; - break; -#endif - default: - assert(NULL); - break; - } -} - -uint32_t EIM_GetDataBitMask(EIM_Type *base, eim_memory_channel_t channel) -{ - uint32_t mask = 0x00U; - - switch ((uint8_t)channel) - { - case 0U: - mask = (base->EICHD0_WORD0 & EIM_EICHD0_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD0_WORD1_B0_3DATA_MASK_SHIFT; - break; - -#ifdef EIM_EICHEN_EICH1EN_MASK - case 1U: - mask = (base->EICHD1_WORD0 & EIM_EICHD1_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD1_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif -#ifdef EIM_EICHEN_EICH2EN_MASK - case 2U: - mask = (base->EICHD2_WORD0 & EIM_EICHD2_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD2_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif -#ifdef EIM_EICHEN_EICH3EN_MASK - case 3U: - mask = (base->EICHD3_WORD0 & EIM_EICHD3_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD3_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif -#ifdef EIM_EICHEN_EICH4EN_MASK - case 4U: - mask = (base->EICHD4_WORD0 & EIM_EICHD4_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD4_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif -#ifdef EIM_EICHEN_EICH5EN_MASK - case 5U: - mask = (base->EICHD5_WORD0 & EIM_EICHD5_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD5_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif -#ifdef EIM_EICHEN_EICH6EN_MASK - case 6U: - mask = (base->EICHD6_WORD0 & EIM_EICHD6_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD6_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif -#ifdef EIM_EICHEN_EICH7EN_MASK - case 7U: - mask = (base->EICHD7_WORD0 & EIM_EICHD7_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD7_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif -#ifdef EIM_EICHEN_EICH8EN_MASK - case 8U: - mask = (base->EICHD8_WORD1 & EIM_EICHD8_WORD1_B0_3DATA_MASK_MASK) >> EIM_EICHD8_WORD1_B0_3DATA_MASK_SHIFT; - break; -#endif - default: - assert(NULL); - break; - } - - return mask; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_eim.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_eim.h deleted file mode 100644 index 799ff3f20a5..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_eim.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_EIM_H_ -#define FSL_EIM_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup eim - * @{ - */ - -/****************************************************************************** - * Definitions. - *****************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief Driver version. */ -#define FSL_ERM_DRIVER_VERSION (MAKE_VERSION(2U, 0U, 1U)) -/*! @} */ - -/******************************************************************************* - * APIs - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @brief EIM module initialization function. - * - * @param base EIM base address. - */ -void EIM_Init(EIM_Type *base); - -/*! - * @brief De-initializes the EIM. - * - */ -void EIM_Deinit(EIM_Type *base); - -/*! @} */ - -/*! - * @name functional - * @{ - */ - -/*! - * @brief EIM module enable global error injection. - * - * @param base EIM base address. - * @param mask The interrupts to enable. - */ -static inline void EIM_EnableGlobalErrorInjection(EIM_Type *base, bool enable) -{ - if (enable) - { - base->EIMCR = EIM_EIMCR_GEIEN_MASK; - } - else - { - base->EIMCR = ~EIM_EIMCR_GEIEN_MASK; - } -} - -/*! - * @brief EIM module enable error injection for memory channel n, this function enables the corresponding error - * injection channel. The Global Error Injection Enable function must also be called to enable error injection. - * - * @param base EIM base address. - * @param mask The interrupts to enable. Refer to "_eim_error_injection_channel_enable" enumeration. - */ -static inline void EIM_EnableErrorInjectionChannels(EIM_Type *base, uint32_t mask) -{ - base->EICHEN |= mask; -} - -/*! - * @brief EIM module disable error injection for memory channel n. - * - * @param base EIM base address. - * @param mask The interrupts to enable. Refer to "_eim_error_injection_channel_enable" enumeration. - */ -static inline void EIM_DisableErrorInjectionChannels(EIM_Type *base, uint32_t mask) -{ - base->EICHEN &= ~mask; -} - -/*! - * @brief EIM module inject checkbit error for memory channel n, an attempt to invert more than 2 bits in one operation - * might result in undefined behavior. - * - * @param base EIM base address. - * @param channel memory channel. - * @param mask The interrupts to enable. - */ -void EIM_InjectCheckBitError(EIM_Type *base, eim_memory_channel_t channel, uint8_t mask); - -/*! - * @brief EIM module get checkbit mask for memory channel n. - * - * @param base EIM base address. - * @param channel memory channel. - * @retval return checkbit mask. - */ -uint8_t EIM_GetCheckBitMask(EIM_Type *base, eim_memory_channel_t channel); - -/*! - * @brief EIM module inject databit error for memory channel n, an attempt to invert more than 2 bits in one operation - * might result in undefined behavior. - * - * @param base EIM base address. - * @param channel memory channel. - * @param mask The interrupts to enable. - */ -void EIM_InjectDataBitError(EIM_Type *base, eim_memory_channel_t channel, uint8_t mask); - -/*! - * @brief EIM module get databit mask for memory channel n. - * - * @param base EIM base address. - * @param channel memory channel. - * @retval return checkbit mask. - */ -uint32_t EIM_GetDataBitMask(EIM_Type *base, eim_memory_channel_t channel); - -/*! @}*/ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_enet.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_enet.c deleted file mode 100644 index 03b479913a0..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_enet.c +++ /dev/null @@ -1,2559 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include -#include "fsl_enet.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.mcx_enet" -#endif - -/*! @brief Defines 10^9 nanosecond. */ -#define ENET_NANOSECS_ONESECOND (1000000000U) -/*! @brief Defines 10^6 microsecond.*/ -#define ENET_MICRSECS_ONESECOND (1000000U) - -/*! @brief Rx buffer LSB ignore bits. */ -#define ENET_RXBUFF_IGNORELSB_BITS (2U) -/*! @brief ENET FIFO size unit. */ -#define ENET_FIFOSIZE_UNIT (256U) -/*! @brief ENET half-dulpex default IPG. */ -#define ENET_HALFDUPLEX_DEFAULTIPG (4U) -/*! @brief ENET miminum ring length. */ -#define ENET_MIN_RINGLEN (4U) -/*! @brief ENET wakeup filter numbers. */ -#define ENET_WAKEUPFILTER_NUM (8U) -/*! @brief Requried systime timer frequency. */ -#define ENET_SYSTIME_REQUIRED_CLK_MHZ (50U) -/*! @brief Ethernet VLAN tag length. */ -#define ENET_FRAME_VLAN_TAGLEN 4U - -/*! @brief AVB TYPE */ -#define ENET_AVBTYPE 0x22F0U -#define ENET_HEAD_TYPE_OFFSET (12) -#define ENET_HEAD_AVBTYPE_OFFSET (16) - -/*! @brief Binary rollover mode count convert */ -#define ENET_BINARY_ROLLOVER_SCALE(x) (uint32_t)((uint64_t)(x) * 46566U / 100000U) - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Increase the index in the ring. - * - * @param index The current index. - * @param max The size. - * @return the increased index. - */ -static uint16_t ENET_IncreaseIndex(uint16_t index, uint16_t max); - -/*! - * @brief Set ENET system configuration. - * This function reset the ethernet module and set the phy selection. - * It should be called before any other ethernet operation. - * - * @param miiMode The MII/RMII mode for interface between the phy and ethernet. - */ -static void ENET_SetSYSControl(enet_mii_mode_t miiMode); - -/*! - * @brief Set ENET DMA controller with the configuration. - * - * @param base ENET peripheral base address. - * @param config ENET Mac configuration. - */ -static void ENET_SetDMAControl(ENET_Type *base, const enet_config_t *config); - -/*! - * @brief Set ENET MAC controller with the configuration. - * - * @param base ENET peripheral base address. - * @param config ENET Mac configuration. - * @param macAddr ENET six-byte mac address. - * @param clkSrcHz ENET input reference clock. - */ -static void ENET_SetMacControl(ENET_Type *base, const enet_config_t *config, uint8_t *macAddr, uint32_t clkSrcHz); - -/*! - * @brief Set ENET MTL with the configuration. - * - * @param base ENET peripheral base address. - * @param config ENET Mac configuration. - */ -static void ENET_SetMTL(ENET_Type *base, const enet_config_t *config); - -/*! - * @brief Set ENET DMA transmit buffer descriptors for one channel. - * - * @param base ENET peripheral base address. - * @param bufferConfig ENET buffer configuration. - * @param channel The channel number, 0 , 1. - */ -static status_t ENET_TxDescriptorsInit(ENET_Type *base, const enet_buffer_config_t *bufferConfig, uint8_t channel); - -/*! - * @brief Set ENET DMA receive buffer descriptors for one channel. - * - * @param base ENET peripheral base address. - * @param config The ENET configuration. - * @param bufferConfig ENET buffer configuration. - * @param channel The channel number, 0 , 1. - */ -static status_t ENET_RxDescriptorsInit(ENET_Type *base, - enet_config_t *config, - const enet_buffer_config_t *bufferConfig, - uint8_t channel); - -/*! - * @brief Drop one frame in specified BD channel. - * - * @param base ENET peripheral base address. - * @param handle ENET handler. - * @param channel The channel number, 0 , 1. - */ -static void ENET_DropFrame(ENET_Type *base, enet_handle_t *handle, uint8_t channel); - -#ifdef ENET_PTP1588FEATURE_REQUIRED -/*! - * @brief Sets the ENET 1588 feature. - * - * Enable the enhacement 1588 buffer descriptor mode and start - * the 1588 timer. - * - * @param base ENET peripheral base address. - * @param config The ENET configuration. - * @param ptpClkHz The reference clock for ptp 1588. - */ -static void ENET_SetPtp1588(ENET_Type *base, const enet_config_t *config, uint32_t ptpClkHz); -#endif /* ENET_PTP1588FEATURE_REQUIRED */ - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/*! @brief Pointers to enet handles for each instance. */ -static enet_handle_t *s_ENETHandle[FSL_FEATURE_SOC_MCX_ENET_COUNT] = {NULL}; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to enet clocks for each instance. */ -const clock_ip_name_t s_enetClock[FSL_FEATURE_SOC_MCX_ENET_COUNT] = ETH_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/*! @brief Pointers to enet bases for each instance. */ -static ENET_Type *const s_enetBases[] = ENET_BASE_PTRS; - -/*! @brief Pointers to enet IRQ number for each instance. */ -static const IRQn_Type s_enetIrqId[] = ENET_IRQS; - -/* ENET ISR for transactional APIs. */ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -static enet_isr_t s_enetIsr = (enet_isr_t)DefaultISR; -#else -static enet_isr_t s_enetIsr; -#endif -/******************************************************************************* - * Code - ******************************************************************************/ -static uint16_t ENET_IncreaseIndex(uint16_t index, uint16_t max) -{ - /* Increase the index. */ - index++; - if (index >= max) - { - index = 0; - } - return index; -} - -static void ENET_SetSYSControl(enet_mii_mode_t miiMode) -{ -#ifdef SYSCON_ETHPHYSEL_PHY_SEL_MASK - /* Reset first. */ - SYSCON->PRESETCTRL[2] = SYSCON_PRESETCTRL_ETH_RST_MASK; - SYSCON->PRESETCTRL[2] &= ~SYSCON_PRESETCTRL_ETH_RST_MASK; - /* Set MII/RMII before the peripheral ethernet dma reset. */ - SYSCON->ETHPHYSEL = (SYSCON->ETHPHYSEL & ~SYSCON_ETHPHYSEL_PHY_SEL_MASK) | SYSCON_ETHPHYSEL_PHY_SEL(miiMode); -#else - /* Reset first. */ - SYSCON0->PRESETCTRL2 = SYSCON_PRESETCTRL2_ENET_RST_MASK; - SYSCON0->PRESETCTRL2 &= ~SYSCON_PRESETCTRL2_ENET_RST_MASK; - /* Set MII/RMII before the peripheral ethernet dma reset. */ - SYSCON0->ENET_PHY_INTF_SEL = (SYSCON0->ENET_PHY_INTF_SEL & ~SYSCON_ENET_PHY_INTF_SEL_PHY_SEL_MASK) | - SYSCON_ENET_PHY_INTF_SEL_PHY_SEL(miiMode); -#endif -} - -static void ENET_SetDMAControl(ENET_Type *base, const enet_config_t *config) -{ - assert(config); - - uint8_t index; - uint32_t reg; - uint32_t burstLen; - - /* Reset first and wait for the complete - * The reset bit will automatically be cleared after complete. */ - base->DMA_MODE |= ENET_DMA_MODE_SWR_MASK; - while ((base->DMA_MODE & ENET_DMA_MODE_SWR_MASK) != 0U) - { - } - - /* Set the burst length. */ - for (index = 0; index < ENET_RING_NUM_MAX; index++) - { - burstLen = (uint32_t)kENET_BurstLen1; - if (config->multiqueueCfg != NULL) - { - burstLen = (uint32_t)config->multiqueueCfg->burstLen; - } - base->DMA_CH[index].DMA_CHX_CTRL = burstLen & ENET_DMA_CH_DMA_CHX_CTRL_PBLx8_MASK; - - reg = base->DMA_CH[index].DMA_CHX_TX_CTRL & ~ENET_DMA_CH_DMA_CHX_TX_CTRL_TxPBL_MASK; - base->DMA_CH[index].DMA_CHX_TX_CTRL = reg | ENET_DMA_CH_DMA_CHX_TX_CTRL_TxPBL(burstLen & 0x3FU); - - reg = base->DMA_CH[index].DMA_CHX_RX_CTRL & ~ENET_DMA_CH_DMA_CHX_RX_CTRL_RxPBL_MASK; - base->DMA_CH[index].DMA_CHX_RX_CTRL = reg | ENET_DMA_CH_DMA_CHX_RX_CTRL_RxPBL(burstLen & 0x3FU); - } -} - -static void ENET_SetMTL(ENET_Type *base, const enet_config_t *config) -{ - assert(config); - - uint32_t txqOpreg = 0; - uint32_t rxqOpReg = 0; - enet_multiqueue_config_t *multiqCfg = config->multiqueueCfg; - uint8_t index; - - /* Set transmit operation mode. */ - if ((config->specialControl & (uint16_t)kENET_StoreAndForward) != 0U) - { - txqOpreg = ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TSF_MASK; - rxqOpReg = ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RSF_MASK; - } - txqOpreg |= ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_FTQ_MASK | - ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TQS(ENET_MTL_TXFIFOSIZE / ENET_FIFOSIZE_UNIT - 1UL); - base->MTL_QUEUE[0].MTL_TXQX_OP_MODE = txqOpreg | ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TXQEN(2); - base->MTL_QUEUE[1].MTL_TXQX_OP_MODE = txqOpreg; - - /* Set receive operation mode. */ - rxqOpReg |= ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_FUP_MASK | - ENET_MTL_QUEUE_MTL_RXQX_OP_MODE_RQS(ENET_MTL_RXFIFOSIZE / ENET_FIFOSIZE_UNIT - 1UL); - base->MTL_QUEUE[0].MTL_RXQX_OP_MODE = rxqOpReg; - - /* Set the schedule/arbitration(set for multiple queues). */ - if (multiqCfg != NULL) - { - base->MTL_OPERATION_MODE = - ENET_MTL_OPERATION_MODE_SCHALG(multiqCfg->mtltxSche) | ENET_MTL_OPERATION_MODE_RAA(multiqCfg->mtlrxSche); - /* Set the Rx queue mapping to dma channel. */ - base->MTL_RXQ_DMA_MAP0 = (uint32_t)multiqCfg->mtlrxQuemap; - /* Set the Tx/Rx queue operation mode for multi-queue. */ - base->MTL_QUEUE[1].MTL_TXQX_OP_MODE |= ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TXQEN(2); - base->MTL_QUEUE[1].MTL_RXQX_OP_MODE = rxqOpReg; - - /* Set the Tx/Rx queue weight. */ - for (index = 0; index < ENET_RING_NUM_MAX; index++) - { - base->MTL_QUEUE[index].MTL_TXQX_QNTM_WGHT = multiqCfg->txqueweight[index]; - base->MTL_QUEUE[index].MTL_RXQX_CTRL = ENET_MTL_QUEUE_MTL_RXQX_CTRL_RXQ_WEGT(multiqCfg->rxqueweight[index]); - } - } -} - -static void ENET_SetMacControl(ENET_Type *base, const enet_config_t *config, uint8_t *macAddr, uint32_t clkSrcHz) -{ - assert(config); - - uint32_t reg = 0; - - /* Set Macaddr */ - /* The dma channel 0 is set as to which the Rx packet - * whose DA matches the MAC address content is routed. */ - if (macAddr != NULL) - { - ENET_SetMacAddr(base, macAddr); - } - - /* Set the receive filter. */ - reg = ENET_MAC_PACKET_FILTER_PR(!((config->specialControl & (uint16_t)kENET_PromiscuousEnable) == 0U)) | - ENET_MAC_PACKET_FILTER_DBF(!((config->specialControl & (uint16_t)kENET_BroadCastRxDisable) == 0U)) | - ENET_MAC_PACKET_FILTER_PM(!((config->specialControl & (uint16_t)kENET_MulticastAllEnable) == 0U)); - base->MAC_PACKET_FILTER = reg; - /* Flow control. */ - if ((config->specialControl & (uint16_t)kENET_FlowControlEnable) != 0U) - { - base->MAC_RX_FLOW_CTRL = ENET_MAC_RX_FLOW_CTRL_RFE_MASK | ENET_MAC_RX_FLOW_CTRL_UP_MASK; - base->MAC_TX_FLOW_CTRL_Q[0] = ENET_MAC_TX_FLOW_CTRL_Q_PT(config->pauseDuration); - } - - /* Set the 1us ticket. */ - reg = clkSrcHz / ENET_MICRSECS_ONESECOND - 1U; - base->MAC_ONEUS_TIC_COUNTER = ENET_MAC_ONEUS_TIC_COUNTER_TIC_1US_CNTR(reg); - - /* Set the speed and duplex. */ - reg = ENET_MAC_CONFIGURATION_ECRSFD_MASK | ENET_MAC_CONFIGURATION_PS_MASK | - ENET_MAC_CONFIGURATION_DM(config->miiDuplex) | ENET_MAC_CONFIGURATION_FES(config->miiSpeed) | - ENET_MAC_CONFIGURATION_S2KP((config->specialControl & (uint16_t)kENET_8023AS2KPacket) != 0U) | - ENET_MAC_CONFIGURATION_IPC((config->specialControl & (uint16_t)kENET_RxChecksumOffloadEnable) != 0U); - if (config->miiDuplex == kENET_MiiHalfDuplex) - { - reg |= ENET_MAC_CONFIGURATION_IPG(ENET_HALFDUPLEX_DEFAULTIPG); - } - base->MAC_CONFIGURATION = reg; - - /* Enable channel. */ - base->MAC_RXQ_CTRL[0] = ENET_MAC_RXQ_CTRL_RXQ0EN(1) | ENET_MAC_RXQ_CTRL_RXQ1EN(1); -} - -static status_t ENET_TxDescriptorsInit(ENET_Type *base, const enet_buffer_config_t *bufferConfig, uint8_t channel) -{ - uint16_t j; - enet_tx_bd_struct_t *txbdPtr; - const enet_buffer_config_t *buffCfg = bufferConfig; - - if (buffCfg == NULL) - { - return kStatus_InvalidArgument; - } - - /* Check the ring length. */ - if (buffCfg->txRingLen < ENET_MIN_RINGLEN) - { - return kStatus_InvalidArgument; - } - /* Set the Tx descriptor start/tail pointer, shall be word aligned. */ - base->DMA_CH[channel].DMA_CHX_TXDESC_LIST_ADDR = - (uint32_t)buffCfg->txDescStartAddrAlign & ENET_DMA_CH_DMA_CHX_TXDESC_LIST_ADDR_TDESLA_MASK; - base->DMA_CH[channel].DMA_CHX_TXDESC_TAIL_PTR = - (uint32_t)buffCfg->txDescTailAddrAlign & ENET_DMA_CH_DMA_CHX_TXDESC_TAIL_PTR_TDTP_MASK; - /* Set the Tx ring length. */ - base->DMA_CH[channel].DMA_CHX_TXDESC_RING_LENGTH = - ((uint32_t)buffCfg->txRingLen - 1U) & ENET_DMA_CH_DMA_CHX_TXDESC_RING_LENGTH_TDRL_MASK; - - /* Init the txbdPtr to the transmit descriptor start address. */ - txbdPtr = (enet_tx_bd_struct_t *)(buffCfg->txDescStartAddrAlign); - for (j = 0; j < buffCfg->txRingLen; j++) - { - txbdPtr->tdes0 = 0; - txbdPtr->tdes1 = 0; - txbdPtr->tdes2 = 0; - txbdPtr->tdes3 = 0; - txbdPtr++; - } - - return kStatus_Success; -} - -static status_t ENET_RxDescriptorsInit(ENET_Type *base, - enet_config_t *config, - const enet_buffer_config_t *bufferConfig, - uint8_t channel) -{ - uint16_t j; - uint32_t reg; - enet_rx_bd_struct_t *rxbdPtr; - uint16_t index; - bool doubleBuffEnable = ((config->specialControl & (uint16_t)kENET_DescDoubleBuffer) != 0U) ? true : false; - const enet_buffer_config_t *buffCfg = bufferConfig; - uint32_t control = ENET_RXDESCRIP_RD_BUFF1VALID_MASK; - - if (buffCfg == NULL) - { - return kStatus_InvalidArgument; - } - - if (0U != (config->interrupt & (uint32_t)kENET_DmaRx)) - { - control |= ENET_RXDESCRIP_RD_IOC_MASK; - } - - if (doubleBuffEnable) - { - control |= ENET_RXDESCRIP_RD_BUFF2VALID_MASK; - } - - /* Not give ownership to DMA before Rx buffer is ready */ - if ((config->rxBuffAlloc == NULL) || (config->rxBuffFree == NULL)) - { - control |= ENET_RXDESCRIP_WR_OWN_MASK; - } - - /* Check the ring length. */ - if (buffCfg->rxRingLen < ENET_MIN_RINGLEN) - { - return kStatus_InvalidArgument; - } - - /* Set the Rx descriptor start/tail pointer, shall be word aligned. */ - base->DMA_CH[channel].DMA_CHX_RXDESC_LIST_ADDR = - (uint32_t)buffCfg->rxDescStartAddrAlign & ENET_DMA_CH_DMA_CHX_RXDESC_LIST_ADDR_RDESLA_MASK; - base->DMA_CH[channel].DMA_CHX_RXDESC_TAIL_PTR = - (uint32_t)buffCfg->rxDescTailAddrAlign & ENET_DMA_CH_DMA_CHX_RXDESC_LIST_ADDR_RDESLA_MASK; - base->DMA_CH[channel].DMA_CHX_RX_CONTROL2 = - ((uint32_t)buffCfg->rxRingLen - 1U) & ENET_DMA_CH_DMA_CHX_RX_CONTROL2_RDRL_MASK; - reg = base->DMA_CH[channel].DMA_CHX_RX_CTRL & ~ENET_DMA_CH_DMA_CHX_RX_CTRL_RBSZ_13_Y_MASK; - reg |= ENET_DMA_CH_DMA_CHX_RX_CTRL_RBSZ_13_Y(buffCfg->rxBuffSizeAlign >> ENET_RXBUFF_IGNORELSB_BITS); - base->DMA_CH[channel].DMA_CHX_RX_CTRL = reg; - - /* Init the rxbdPtr to the receive descriptor start address. */ - rxbdPtr = (enet_rx_bd_struct_t *)(buffCfg->rxDescStartAddrAlign); - - for (j = 0; j < buffCfg->rxRingLen; j++) - { - if ((config->rxBuffAlloc == NULL) || (config->rxBuffFree == NULL)) - { - if (doubleBuffEnable) - { - index = 2U * j; - } - else - { - index = j; - } - rxbdPtr->rdes0 = buffCfg->rxBufferStartAddr[index]; - /* The second buffer is set with 0 because it is not required for normal case. */ - if (doubleBuffEnable) - { - rxbdPtr->rdes2 = buffCfg->rxBufferStartAddr[index + 1U]; - } - else - { - rxbdPtr->rdes2 = 0; - } - } - - /* Set the valid and DMA own flag.*/ - rxbdPtr->rdes3 = control; - rxbdPtr++; - } - - return kStatus_Success; -} - -#ifdef ENET_PTP1588FEATURE_REQUIRED -static void ENET_SetPtp1588(ENET_Type *base, const enet_config_t *config, uint32_t ptpClkHz) -{ - assert(config); - assert(config->ptpConfig); - assert(ptpClkHz); - - uint32_t control; - enet_ptp_config_t *ptpConfig = config->ptpConfig; - - /* Clear the timestamp interrupt first. */ - base->MAC_INTERRUPT_ENABLE &= ~ENET_MAC_INTERRUPT_ENABLE_TSIE_MASK; - - if (ptpConfig->fineUpdateEnable) - { - base->MAC_TIMESTAMP_CONTROL |= ENET_MAC_TIMESTAMP_CONTROL_TSCFUPDT_MASK; - /* Set the initial added value for the fine update. */ - control = 100000000U / (ptpClkHz / ENET_MICRSECS_ONESECOND / ENET_SYSTIME_REQUIRED_CLK_MHZ); - base->MAC_TIMESTAMP_ADDEND = control; - base->MAC_TIMESTAMP_CONTROL |= ENET_MAC_TIMESTAMP_CONTROL_TSADDREG_MASK; - while ((base->MAC_TIMESTAMP_CONTROL & ENET_MAC_TIMESTAMP_CONTROL_TSADDREG_MASK) != 0U) - { - } - } - - /* Enable the IEEE 1588 timestamping and snapshot for event message. */ - control = ENET_MAC_TIMESTAMP_CONTROL_TSENA_MASK | ENET_MAC_TIMESTAMP_CONTROL_TSIPV4ENA_MASK | - ENET_MAC_TIMESTAMP_CONTROL_TSIPV6ENA_MASK | ENET_MAC_TIMESTAMP_CONTROL_TSENALL_MASK | - ENET_MAC_TIMESTAMP_CONTROL_TSEVNTENA_MASK | ENET_MAC_TIMESTAMP_CONTROL_SNAPTYPSEL_MASK | - ENET_MAC_TIMESTAMP_CONTROL_TSCTRLSSR(ptpConfig->tsRollover); - - if (ptpConfig->ptp1588V2Enable) - { - control |= ENET_MAC_TIMESTAMP_CONTROL_TSVER2ENA_MASK | ENET_MAC_TIMESTAMP_CONTROL_TSIPENA_MASK; - } - - /* Initialize the sub-second increment register. */ - if (ptpConfig->tsRollover != kENET_BinaryRollover) - { - base->MAC_SUB_SECOND_INCREMENT = ENET_MAC_SUB_SECOND_INCREMENT_SNSINC(ENET_NANOSECS_ONESECOND / ptpClkHz); - base->MAC_SYSTEM_TIME_NANOSECONDS_UPDATE = 0; - } - else - { - /* Round up. */ - uint32_t data = ENET_MAC_SYSTEM_TIME_NANOSECONDS_TSSS_MASK / ptpClkHz; - base->MAC_SUB_SECOND_INCREMENT = ENET_MAC_SUB_SECOND_INCREMENT_SNSINC(data); - base->MAC_SYSTEM_TIME_NANOSECONDS_UPDATE = 0; - } - /* Set the second.*/ - base->MAC_SYSTEM_TIME_SECONDS_UPDATE = 0; - - /* Initialize the system timer. */ - base->MAC_TIMESTAMP_CONTROL = control | ENET_MAC_TIMESTAMP_CONTROL_TSINIT_MASK; -} -#endif /* ENET_PTP1588FEATURE_REQUIRED */ - -uint32_t ENET_GetInstance(ENET_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0U; instance < (uint32_t)FSL_FEATURE_SOC_MCX_ENET_COUNT; instance++) - { - if (s_enetBases[instance] == base) - { - break; - } - } - - assert(instance < (uint32_t)FSL_FEATURE_SOC_MCX_ENET_COUNT); - - return instance; -} - -/*! - * brief Gets the ENET default configuration structure. - * - * The purpose of this API is to get the default ENET configure - * structure for ENET_Init(). User may use the initialized - * structure unchanged in ENET_Init(), or modify some fields of the - * structure before calling ENET_Init(). - * Example: - code - enet_config_t config; - ENET_GetDefaultConfig(&config); - endcode - * param config The ENET mac controller configuration structure pointer. - */ -void ENET_GetDefaultConfig(enet_config_t *config) -{ - /* Checks input parameter. */ - assert(config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - /* Sets MII mode, full duplex, 100Mbps for MAC and PHY data interface. */ - config->miiMode = kENET_RmiiMode; - config->miiSpeed = kENET_MiiSpeed100M; - config->miiDuplex = kENET_MiiFullDuplex; - - /* Sets default configuration for other options. */ - config->specialControl = 0U; - config->multiqueueCfg = NULL; - config->pauseDuration = 0; - -#ifdef ENET_PTP1588FEATURE_REQUIRED - config->ptpConfig = NULL; -#endif /* ENET_PTP1588FEATURE_REQUIRED */ -} - -/*! - * brief Initializes the ENET module. - * - * This function ungates the module clock and initializes it with the ENET basic - * configuration. - * note As our transactional transmit API use the zero-copy transmit buffer. - * So there are two thing we emphasize here: - * 1. Tx buffer free/requeue for application should be done in the Tx - * interrupt handler. Please set callback: kENET_TxIntEvent with Tx buffer free/requeue - * process APIs. - * 2. The Tx interrupt is forced to open. - * - * param base ENET peripheral base address. - * param config ENET mac configuration structure pointer. - * The "enet_config_t" type mac configuration return from ENET_GetDefaultConfig - * can be used directly. It is also possible to verify the Mac configuration using other methods. - * param macAddr ENET mac address of Ethernet device. This MAC address should be - * provided. - * param clkSrcHz ENET input reference clock. - */ -void ENET_Init(ENET_Type *base, const enet_config_t *config, uint8_t *macAddr, uint32_t clkSrcHz) -{ - assert(config); - - uint32_t instance = ENET_GetInstance(base); -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate ENET clock. */ - CLOCK_EnableClock(s_enetClock[instance]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - /* System configure fistly. */ - ENET_SetSYSControl(config->miiMode); - - /* Initializes the ENET DMA with basic function. */ - ENET_SetDMAControl(base, config); - - /* Initializes the ENET MTL with basic function. */ - ENET_SetMTL(base, config); - - /* Initializes the ENET MAC with basic function. */ - ENET_SetMacControl(base, config, macAddr, clkSrcHz); - -#ifdef ENET_PTP1588FEATURE_REQUIRED - ENET_SetPtp1588(base, config, config->ptpClkHz); -#endif /* ENET_PTP1588FEATURE_REQUIRED */ - - /* Force to enable Tx interrupt for use transactional API to do Tx buffer free/requeue. */ - ENET_EnableInterrupts(base, (config->interrupt | (uint32_t)kENET_DmaTx)); -} - -/*! - * brief Deinitializes the ENET module. - - * This function gates the module clock and disables the ENET module. - * - * param base ENET peripheral base address. - */ -void ENET_Deinit(ENET_Type *base) -{ - /* Reset first and wait for the complete - * The reset bit will automatically be cleared after complete. */ - base->DMA_MODE |= ENET_DMA_MODE_SWR_MASK; - while ((base->DMA_MODE & ENET_DMA_MODE_SWR_MASK) != 0U) - { - } - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disables the clock source. */ - CLOCK_DisableClock(s_enetClock[ENET_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Initialize for all ENET descriptors. - * - * note This function finishes all Tx/Rx descriptors initialization. The descriptor initialization - * should be called after ENET_Init(). - * - * param base ENET peripheral base address. - * param config The configuration for ENET. - * param bufferConfig All buffers configuration. - */ -status_t ENET_DescriptorInit(ENET_Type *base, enet_config_t *config, enet_buffer_config_t *bufferConfig) -{ - assert(config); - assert(bufferConfig); - - uint8_t ringNum = config->multiqueueCfg == NULL ? 1U : 2U; - uint8_t channel; - - for (channel = 0; channel < ringNum; channel++) - { - if (ENET_TxDescriptorsInit(base, bufferConfig, channel) != kStatus_Success) - { - return kStatus_Fail; - } - - if (ENET_RxDescriptorsInit(base, config, bufferConfig, channel) != kStatus_Success) - { - return kStatus_Fail; - } - - bufferConfig++; - } - return kStatus_Success; -} - -/*! - * brief Starts the ENET Tx/Rx. - * This function enable the Tx/Rx and starts the Tx/Rx DMA. - * This shall be set after ENET initialization and before - * starting to receive the data. - * - * param base ENET peripheral base address. - * param rxRingNum The number of the used Rx rings. It shall not be - * larger than the ENET_RING_NUM_MAX(2). If the ringNum is set with - * 1, the ring 0 will be used. - * param txRingNum The number of the used Tx rings. It shall not be - * larger than the ENET_RING_NUM_MAX(2). If the ringNum is set with - * 1, the ring 0 will be used. - * - * note This must be called after all the ENET initilization. - * And should be called when the ENET receive/transmit is required. - */ -void ENET_StartRxTx(ENET_Type *base, uint8_t txRingNum, uint8_t rxRingNum) -{ - assert(txRingNum); - assert(rxRingNum); - - uint8_t index; - - if (txRingNum > ENET_RING_NUM_MAX) - { - txRingNum = ENET_RING_NUM_MAX; - } - if (rxRingNum > ENET_RING_NUM_MAX) - { - rxRingNum = ENET_RING_NUM_MAX; - } - /* Start/Acive the DMA first. */ - for (index = 0; index < rxRingNum; index++) - { - base->DMA_CH[index].DMA_CHX_RX_CTRL |= ENET_DMA_CH_DMA_CHX_RX_CTRL_SR_MASK; - } - for (index = 0; index < txRingNum; index++) - { - base->DMA_CH[index].DMA_CHX_TX_CTRL |= ENET_DMA_CH_DMA_CHX_TX_CTRL_ST_MASK; - } - - /* Enable the RX and TX at same time. */ - base->MAC_CONFIGURATION |= (ENET_MAC_CONFIGURATION_TE_MASK | ENET_MAC_CONFIGURATION_RE_MASK); -} - -/*! - * brief Set the second level IRQ handler - * - * param base ENET peripheral base address. - * param ISRHandler The handler to install. - */ -void ENET_SetISRHandler(ENET_Type *base, enet_isr_t ISRHandler) -{ - s_enetIsr = ISRHandler; - (void)EnableIRQ(s_enetIrqId[ENET_GetInstance(base)]); -} - -/*! - * brief Enables the ENET DMA and MAC interrupts. - * - * This function enables the ENET interrupt according to the provided mask. The mask - * is a logical OR of enet_dma_interrupt_enable_t and enet_mac_interrupt_enable_t. - * For example, to enable the dma and mac interrupt, do the following. - * code - * ENET_EnableInterrupts(ENET, kENET_DmaRx | kENET_DmaTx | kENET_MacPmt); - * endcode - * - * param base ENET peripheral base address. - * param mask ENET interrupts to enable. This is a logical OR of both - * enumeration :: enet_dma_interrupt_enable_t and enet_mac_interrupt_enable_t. - */ -void ENET_EnableInterrupts(ENET_Type *base, uint32_t mask) -{ - uint32_t interrupt = mask & 0xFFFFU; - uint8_t index; - - /* For dma interrupt. */ - if (interrupt != 0U) - { - for (index = 0; index < ENET_RING_NUM_MAX; index++) - { - /* Set for all abnormal interrupts. */ - if ((ENET_ABNORM_INT_MASK & interrupt) != 0U) - { - interrupt |= ENET_DMA_CH_DMA_CHX_INT_EN_AIE_MASK; - } - /* Set for all normal interrupts. */ - if ((ENET_NORM_INT_MASK & interrupt) != 0U) - { - interrupt |= ENET_DMA_CH_DMA_CHX_INT_EN_NIE_MASK; - } - base->DMA_CH[index].DMA_CHX_INT_EN = interrupt; - } - } - interrupt = mask >> ENET_MACINT_ENUM_OFFSET; - if (interrupt != 0U) - { - /* MAC interrupt */ - base->MAC_INTERRUPT_ENABLE |= interrupt; - } -} - -/*! - * brief Clears the ENET mac interrupt events status flag. - * - * This function clears enabled ENET interrupts according to the provided mask. The mask - * is a logical OR of enumeration members. See the ref enet_mac_interrupt_enable_t. - * For example, to clear the TX frame interrupt and RX frame interrupt, do the following. - * code - * ENET_ClearMacInterruptStatus(ENET, kENET_MacPmt); - * endcode - * - * param base ENET peripheral base address. - * param mask ENET interrupt source to be cleared. - * This is the logical OR of members of the enumeration :: enet_mac_interrupt_enable_t. - */ -void ENET_ClearMacInterruptStatus(ENET_Type *base, uint32_t mask) -{ - volatile uint32_t dummy; - - if ((mask & (uint32_t)kENET_MacTimestamp) != 0U) - { - dummy = base->MAC_TIMESTAMP_STATUS; - } - else if ((mask & (uint32_t)kENET_MacPmt) != 0U) - { - dummy = base->MAC_PMT_CONTROL_STATUS; - } - else - { - /* Add for avoid the misra 2004 rule 14.10 */ - } - (void)dummy; -} - -/*! - * brief Disables the ENET DMA and MAC interrupts. - * - * This function disables the ENET interrupt according to the provided mask. The mask - * is a logical OR of enet_dma_interrupt_enable_t and enet_mac_interrupt_enable_t. - * For example, to disable the dma and mac interrupt, do the following. - * code - * ENET_DisableInterrupts(ENET, kENET_DmaRx | kENET_DmaTx | kENET_MacPmt); - * endcode - * - * param base ENET peripheral base address. - * param mask ENET interrupts to disables. This is a logical OR of both - * enumeration :: enet_dma_interrupt_enable_t and enet_mac_interrupt_enable_t. - */ -void ENET_DisableInterrupts(ENET_Type *base, uint32_t mask) -{ - uint32_t interrupt = mask & 0xFFFFU; - uint8_t index; - - /* For dma interrupt. */ - if (interrupt != 0U) - { - for (index = 0; index < ENET_RING_NUM_MAX; index++) - { - /* Set for all abnormal interrupts. */ - if ((ENET_ABNORM_INT_MASK & interrupt) != 0U) - { - interrupt |= ENET_DMA_CH_DMA_CHX_INT_EN_AIE_MASK; - } - /* Set for all normal interrupts. */ - if ((ENET_NORM_INT_MASK & interrupt) != 0U) - { - interrupt |= ENET_DMA_CH_DMA_CHX_INT_EN_NIE_MASK; - } - base->DMA_CH[index].DMA_CHX_INT_EN &= ~interrupt; - } - } - interrupt = mask >> ENET_MACINT_ENUM_OFFSET; - if (interrupt != 0U) - { - /* MAC interrupt */ - base->MAC_INTERRUPT_ENABLE &= ~interrupt; - } -} - -/*! - * brief Create ENET Handler - * - * This is a transactional API and it's provided to store all datas which are needed - * during the whole transactional process. This API should not be used when you use - * functional APIs to do data Tx/Rx. This is funtion will store many data/flag for - * transactional use. - * - * param base ENET peripheral base address. - * param handle ENET handler. - * param config ENET configuration. - * param bufferConfig ENET buffer configuration. - * param callback The callback function. - * param userData The application data. - */ -void ENET_CreateHandler(ENET_Type *base, - enet_handle_t *handle, - enet_config_t *config, - enet_buffer_config_t *bufferConfig, - enet_callback_t callback, - void *userData) -{ - assert(config); - assert(bufferConfig); - assert(callback); - - uint8_t ringNum = 1; - uint8_t count = 0; - uint8_t rxIntEnable = 0; - enet_buffer_config_t *buffConfig = bufferConfig; - uint32_t txFifoSize; - uint32_t pbl; - - /* Store transfer parameters in handle pointer. */ - (void)memset(handle, 0, sizeof(enet_handle_t)); - if ((config->specialControl & (uint32_t)kENET_DescDoubleBuffer) != 0U) - { - handle->doubleBuffEnable = true; - } - if (config->multiqueueCfg != NULL) - { - ringNum = 2; - handle->multiQueEnable = true; - } - for (count = 0; count < ringNum; count++) - { - handle->rxBdRing[count].rxBdBase = buffConfig->rxDescStartAddrAlign; - handle->rxBdRing[count].rxGenIdx = 0; - handle->rxBdRing[count].rxRingLen = buffConfig->rxRingLen; - handle->rxBdRing[count].rxBuffSizeAlign = buffConfig->rxBuffSizeAlign; - - handle->txBdRing[count].txBdBase = buffConfig->txDescStartAddrAlign; - handle->txBdRing[count].txRingLen = buffConfig->txRingLen; - handle->txBdRing[count].txGenIdx = 0; - handle->txBdRing[count].txConsumIdx = 0; - handle->txBdRing[count].txDescUsed = 0; - - handle->txDirtyRing[count].txDirtyBase = buffConfig->txDirtyStartAddr; - handle->txDirtyRing[count].txRingLen = buffConfig->txRingLen; - handle->txDirtyRing[count].txGenIdx = 0; - handle->txDirtyRing[count].txConsumIdx = 0; - - handle->rxBufferStartAddr[count] = buffConfig->rxBufferStartAddr; - - /* Check if the Rx interrrupt is enabled. */ - rxIntEnable |= (uint8_t)(uint32_t)(base->DMA_CH[count].DMA_CHX_INT_EN & ENET_DMA_CH_DMA_CHX_INT_EN_RIE_MASK); - - /* Calculate the reserved space for Tx in certain cases. */ - if (0U != (base->MTL_QUEUE[count].MTL_TXQX_OP_MODE & ENET_MTL_QUEUE_MTL_TXQX_OP_MODE_TSF_MASK)) - { - pbl = (base->DMA_CH[count].DMA_CHX_TX_CTRL & ENET_DMA_CH_DMA_CHX_TX_CTRL_TxPBL_MASK) >> - ENET_DMA_CH_DMA_CHX_TX_CTRL_TxPBL_SHIFT; - pbl = ((base->DMA_CH[count].DMA_CHX_CTRL & ENET_DMA_CH_DMA_CHX_CTRL_PBLx8_MASK) != 0U) ? (8U * pbl) : pbl; - txFifoSize = (uint32_t)pow((double)2, - (double)(uint32_t)(((base->MAC_HW_FEAT[1] & ENET_MAC_HW_FEAT_TXFIFOSIZE_MASK) >> - ENET_MAC_HW_FEAT_TXFIFOSIZE_SHIFT) + - 7U)); - handle->txLenLimitation[count] = txFifoSize - (pbl + 6U) * (32U / 8U); - } - - buffConfig++; - } - - handle->rxintEnable = (rxIntEnable != 0U); - - /* Save the handle pointer in the global variables. */ - s_ENETHandle[ENET_GetInstance(base)] = handle; - - /* Set Rx alloc/free callback. */ - handle->rxBuffAlloc = config->rxBuffAlloc; - handle->rxBuffFree = config->rxBuffFree; - - /* Set callback and userData. */ - handle->callback = callback; - handle->userData = userData; - - /* Set up interrupt and its handler. */ - ENET_SetISRHandler(base, ENET_IRQHandler); -} - -/*! - * brief Gets the ENET module Mac address. - * - * param base ENET peripheral base address. - * param macAddr The six-byte Mac address pointer. - * The pointer is allocated by application and input into the API. - */ -void ENET_GetMacAddr(ENET_Type *base, uint8_t *macAddr) -{ - assert(macAddr); - - uint32_t address = base->MAC_ADDRESS0_LOW; - - /* Get from physical address lower register. */ - macAddr[2] = (uint8_t)(0xFFU & (address >> 24U)); - macAddr[3] = (uint8_t)(0xFFU & (address >> 16U)); - macAddr[4] = (uint8_t)(0xFFU & (address >> 8U)); - macAddr[5] = (uint8_t)(0xFFU & address); - - /* Get from physical address high register. */ - address = base->MAC_ADDRESS0_HIGH; - macAddr[0] = (uint8_t)(0xFFU & (address >> 8U)); - macAddr[1] = (uint8_t)(0xFFU & address); -} - -/*! - * brief Sets the ENET SMI(serial management interface)- MII management interface. - * - * param base ENET peripheral base address. - */ -void ENET_SetSMI(ENET_Type *base, uint32_t clkSrcHz) -{ - uint32_t crDiv = 0; - uint32_t clkMhz = clkSrcHz / 1000000U; - - assert((clkMhz >= 20U) && (clkMhz < 250U)); - - if (clkMhz < 35U) - { - crDiv = 2; - } - else if (clkMhz < 60U) - { - crDiv = 3; - } - else if (clkMhz < 100U) - { - crDiv = 0; - } - else if (clkMhz < 150U) - { - crDiv = 1; - } - else if (clkMhz < 250U) - { - crDiv = 4; - } - else - { - /* Intentional empty */ - } - - base->MAC_MDIO_ADDRESS = ENET_MAC_MDIO_ADDRESS_CR(crDiv); -} - -/*! - * brief Starts a SMI write command. - * support both MDIO IEEE802.3 Clause 22 and clause 45. - * - * param base ENET peripheral base address. - * param phyAddr The PHY address. - * param regAddr The PHY register. - * param data The data written to PHY. - */ -void ENET_StartSMIWrite(ENET_Type *base, uint8_t phyAddr, uint8_t regAddr, uint16_t data) -{ - uint32_t reg = base->MAC_MDIO_ADDRESS & ENET_MAC_MDIO_ADDRESS_CR_MASK; - - /* Build MII write command. */ - base->MAC_MDIO_ADDRESS = - reg | ENET_MAC_MDIO_ADDRESS_GOC_0(1) | ENET_MAC_MDIO_ADDRESS_PA(phyAddr) | ENET_MAC_MDIO_ADDRESS_RDA(regAddr); - base->MAC_MDIO_DATA = data; - base->MAC_MDIO_ADDRESS |= ENET_MAC_MDIO_ADDRESS_GB_MASK; -} - -/*! - * brief Starts an SMI read command. - * support both MDIO IEEE802.3 Clause 22 and clause 45. - * - * param base ENET peripheral base address. - * param phyAddr The PHY address. - * param regAddr The PHY register. - */ -void ENET_StartSMIRead(ENET_Type *base, uint8_t phyAddr, uint8_t regAddr) -{ - uint32_t reg = base->MAC_MDIO_ADDRESS & ENET_MAC_MDIO_ADDRESS_CR_MASK; - - /* Build MII read command. */ - base->MAC_MDIO_ADDRESS = reg | ENET_MAC_MDIO_ADDRESS_GOC_0(1) | ENET_MAC_MDIO_ADDRESS_GOC_1(1) | - ENET_MAC_MDIO_ADDRESS_PA(phyAddr) | ENET_MAC_MDIO_ADDRESS_RDA(regAddr); - base->MAC_MDIO_ADDRESS |= ENET_MAC_MDIO_ADDRESS_GB_MASK; -} - -static status_t ENET_QOS_MDIOWaitTransferOver(ENET_Type *base) -{ - status_t result = kStatus_Success; -#ifdef ENET_MDIO_TIMEOUT_COUNT - uint32_t counter; -#endif - -#ifdef ENET_QOS_MDIO_TIMEOUT_COUNT - for (counter = ENET_MDIO_TIMEOUT_COUNT; counter > 0U; counter--) - { - if (!ENET_IsSMIBusy(base)) - { - break; - } - } - /* Check for timeout. */ - if (0U == counter) - { - result = kStatus_Timeout; - } -#else - while (ENET_IsSMIBusy(base)) - { - } -#endif - return result; -} - -/*! - * @brief MDIO write. - * - * @param base ENET peripheral base address. - * @param phyAddr The PHY address. - * @param regAddr The PHY register. - * @param data The data written to PHY. - * @return kStatus_Success MDIO access succeeds. - * @return kStatus_Timeout MDIO access timeout. - */ -status_t ENET_MDIOWrite(ENET_Type *base, uint8_t phyAddr, uint8_t regAddr, uint16_t data) -{ - ENET_StartSMIWrite(base, phyAddr, regAddr, data); - - return ENET_QOS_MDIOWaitTransferOver(base); -} - -/*! - * @brief MDIO read. - * - * @param base ENET peripheral base address. - * @param phyAddr The PHY address. - * @param regAddr The PHY register. - * @param pData The data read from PHY. - * @return kStatus_Success MDIO access succeeds. - * @return kStatus_Timeout MDIO access timeout. - */ -status_t ENET_MDIORead(ENET_Type *base, uint8_t phyAddr, uint8_t regAddr, uint16_t *pData) -{ - assert(pData); - - status_t result; - - ENET_StartSMIRead(base, phyAddr, regAddr); - - result = ENET_QOS_MDIOWaitTransferOver(base); - if (result != kStatus_Success) - { - return result; - } - *pData = ENET_ReadSMIData(base); - - return result; -} - -/*! - * brief Set the MAC to enter into power down mode. - * the remote power wake up frame and magic frame can wake up - * the ENET from the power down mode. - * - * param base ENET peripheral base address. - * param wakeFilter The wakeFilter provided to configure the wake up frame fitlter. - * Set the wakeFilter to NULL is not required. But if you have the filter requirement, - * please make sure the wakeFilter pointer shall be eight continous - * 32-bits configuration. - */ -void ENET_EnterPowerDown(ENET_Type *base, uint32_t *wakeFilter) -{ - uint8_t index; - uint32_t *reg = wakeFilter; - - /* Disable the Tx dma. */ - base->DMA_CH[0].DMA_CHX_TX_CTRL &= ~ENET_DMA_CH_DMA_CHX_TX_CTRL_ST_MASK; - base->DMA_CH[1].DMA_CHX_TX_CTRL &= ~ENET_DMA_CH_DMA_CHX_TX_CTRL_ST_MASK; - - /* Disable the mac Tx/Rx. */ - base->MAC_CONFIGURATION &= ~(ENET_MAC_CONFIGURATION_RE_MASK | ENET_MAC_CONFIGURATION_TE_MASK); - /* Enable the remote wakeup packet and enable the power down mode. */ - if (wakeFilter != NULL) - { - for (index = 0; index < ENET_WAKEUPFILTER_NUM; index++) - { - base->MAC_RWK_PACKET_FILTER = *reg; - reg++; - } - } - base->MAC_PMT_CONTROL_STATUS = ENET_MAC_PMT_CONTROL_STATUS_MGKPKTEN_MASK | - ENET_MAC_PMT_CONTROL_STATUS_RWKPKTEN_MASK | ENET_MAC_PMT_CONTROL_STATUS_PWRDWN_MASK; - - /* Enable the MAC Rx. */ - base->MAC_CONFIGURATION |= ENET_MAC_CONFIGURATION_RE_MASK; -} - -/*! - * brief Set VLAN control. - * - * param base ENET peripheral base address. - * param control VLAN control configuration. - */ -status_t ENET_SetVlanCtrl(ENET_Type *base, enet_vlan_ctrl_t *control) -{ - uint32_t vl = (((uint32_t)control->rxVlanTag.pcp) << 13U) | (((uint32_t)control->rxVlanTag.dei) << 12U) | - (uint32_t)control->rxVlanTag.vid; - uint32_t vlanCtrl; - - if ((control->innerVlanFilterMatch) && (!control->doubleVlanEnable)) - { - return kStatus_Fail; - } - - vlanCtrl = ENET_MAC_VLAN_TAG_CTRL_VL(vl) | ENET_MAC_VLAN_TAG_CTRL_ETV(control->vidComparison) | - ENET_MAC_VLAN_TAG_CTRL_VTIM(control->vlanInverseMatch) | - ENET_MAC_VLAN_TAG_CTRL_ESVL(control->svlanEnable) | - ENET_MAC_VLAN_TAG_CTRL_DOVLTC(control->disableVlanTypeCheck) | - ENET_MAC_VLAN_TAG_CTRL_EVLS(control->rxOuterVlanStrip) | - ENET_MAC_VLAN_TAG_CTRL_EIVLS(control->rxInnerVlanStrip) | - ENET_MAC_VLAN_TAG_CTRL_EDVLP(control->doubleVlanEnable) | - ENET_MAC_VLAN_TAG_CTRL_ERIVLT(control->innerVlanFilterMatch) | - ENET_MAC_VLAN_TAG_CTRL_EVLRXS(control->outerTagInRxStatus) | - ENET_MAC_VLAN_TAG_CTRL_EIVLRXS(control->innerTagInRxStatus); - - if (control->rxVlanTag.tpid == kENET_StanSvlan) - { - vlanCtrl |= ENET_MAC_VLAN_TAG_CTRL_ERSVLM_MASK; - } - base->MAC_VLAN_TAG_CTRL = vlanCtrl; - - return kStatus_Success; -} - -/*! - * brief Set Tx outer VLAN configuration. - * - * param base ENET peripheral base address. - * param config Tx VLAN operation configuration. - * param channel The channel to apply this configuration. - */ -status_t ENET_SetTxOuterVlan(ENET_Type *base, enet_vlan_tx_config_t *config, enet_vlan_tx_channel_t channel) -{ - uint32_t vlt = - (((uint32_t)config->tag.pcp) << 13U) | (((uint32_t)config->tag.dei) << 12U) | (uint32_t)config->tag.vid; - uint32_t vlanConfig = ENET_MAC_VLAN_INCL_VLTI(config->txDescVlan) | ENET_MAC_VLAN_INCL_CSVL(config->tag.tpid) | - ENET_MAC_VLAN_INCL_VLC(config->ops) | ENET_MAC_VLAN_INCL_VLT(vlt); - - if ((config->tag.tpid == kENET_StanSvlan) && ((base->MAC_VLAN_TAG_CTRL & ENET_MAC_VLAN_TAG_CTRL_ESVL_MASK) == 0U)) - { - return kStatus_Fail; - } - - if (config->ops != kENET_NoOps) - { - vlanConfig |= ENET_MAC_VLAN_INCL_VLP(1); - } - - if (channel != kENET_VlanTagAllChannels) - { - while ((base->MAC_VLAN_INCL & ENET_MAC_VLAN_INCL_BUSY_MASK) != 0U) - { - } - - /* Clear and status ans reset the power down. */ - base->MAC_VLAN_INCL |= - ENET_MAC_VLAN_INCL_CBTI_MASK | ENET_MAC_VLAN_INCL_RDWR_MASK | ENET_MAC_VLAN_INCL_ADDR(channel) | vlanConfig; - - while ((base->MAC_VLAN_INCL & ENET_MAC_VLAN_INCL_BUSY_MASK) != 0U) - { - } - - /* Clear set channel bits. */ - base->MAC_VLAN_INCL &= ~(ENET_MAC_VLAN_INCL_RDWR_MASK | ENET_MAC_VLAN_INCL_CBTI_MASK); - } - else - { - base->MAC_VLAN_INCL = vlanConfig; - } - - return kStatus_Success; -} - -/*! - * brief Set Tx inner VLAN configuration. - * - * param base ENET peripheral base address. - * param config Tx VLAN operation configuration. - */ -status_t ENET_SetTxInnerVlan(ENET_Type *base, enet_vlan_tx_config_t *config) -{ - uint32_t vlt = - (((uint32_t)config->tag.pcp) << 13U) | (((uint32_t)config->tag.dei) << 12U) | (uint32_t)config->tag.vid; - uint32_t vlanConfig = ENET_MAC_INNER_VLAN_INCL_VLTI(config->txDescVlan) | - ENET_MAC_INNER_VLAN_INCL_CSVL(config->tag.tpid) | ENET_MAC_INNER_VLAN_INCL_VLC(config->ops) | - ENET_MAC_INNER_VLAN_INCL_VLT(vlt); - - /* S-VLAN should be enabled first. */ - if ((config->tag.tpid == kENET_StanSvlan) && ((base->MAC_VLAN_TAG_CTRL & ENET_MAC_VLAN_TAG_CTRL_ESVL_MASK) == 0U)) - { - return kStatus_Fail; - } - - /* Double VLAN should be enabled first for inner VLAN. */ - if ((base->MAC_VLAN_TAG_CTRL & ENET_MAC_VLAN_TAG_CTRL_EDVLP_MASK) == 0U) - { - return kStatus_Fail; - } - - if (config->ops != kENET_NoOps) - { - vlanConfig |= ENET_MAC_INNER_VLAN_INCL_VLP(1); - } - base->MAC_INNER_VLAN_INCL = vlanConfig; - - return kStatus_Success; -} - -/*! - * brief Gets the size of the read frame. - * This function gets a received frame size from the ENET buffer descriptors. - * note The FCS of the frame is automatically removed by MAC and the size is the length without the FCS. - * After calling ENET_GetRxFrameSize, ENET_ReadFrame() should be called to update the - * receive buffers If the result is not "kStatus_ENET_RxFrameEmpty". - * - * param handle The ENET handler structure. This is the same handler pointer used in the ENET_Init. - * param length The length of the valid frame received. - * param channel The DMAC channel for the Rx. - * retval kStatus_ENET_RxFrameEmpty No frame received. Should not call ENET_ReadFrame to read frame. - * retval kStatus_ENET_RxFrameError Data error happens. ENET_ReadFrame should be called with NULL data - * and NULL length to update the receive buffers. - * retval kStatus_Success Receive a frame Successfully then the ENET_ReadFrame - * should be called with the right data buffer and the captured data length input. - */ -status_t ENET_GetRxFrameSize(ENET_Type *base, enet_handle_t *handle, uint32_t *length, uint8_t channel) -{ - assert(handle); - assert(length); - - enet_rx_bd_ring_t *rxBdRing = (enet_rx_bd_ring_t *)&handle->rxBdRing[channel]; - enet_rx_bd_struct_t *rxDesc = rxBdRing->rxBdBase + rxBdRing->rxGenIdx; - uint16_t index = rxBdRing->rxGenIdx; - - /* Reset the length to zero. */ - *length = 0; - - if ((rxDesc->rdes3 & ENET_RXDESCRIP_WR_OWN_MASK) != 0U) - { - return kStatus_ENET_RxFrameEmpty; - } - else - { - do - { - /* Application owns the buffer descriptor, get the length. */ - if ((rxDesc->rdes3 & ENET_RXDESCRIP_WR_LD_MASK) != 0U) - { - if ((rxDesc->rdes3 & ENET_RXDESCRIP_WR_ERRSUM_MASK) != 0U) - { - return kStatus_ENET_RxFrameError; - } - *length = (rxDesc->rdes3 & ENET_RXDESCRIP_WR_PACKETLEN_MASK) - ENET_FCS_LEN; - return kStatus_Success; - } - - index = ENET_IncreaseIndex(index, rxBdRing->rxRingLen); - rxDesc = rxBdRing->rxBdBase + index; - } while (index != rxBdRing->rxGenIdx); - - return kStatus_ENET_RxFrameError; - } -} - -/*! - * brief Reads a frame from the ENET device. - * This function reads a frame from the ENET DMA descriptors. - * The ENET_GetRxFrameSize should be used to get the size of the prepared data buffer. - * For example use Rx dma channel 0: - * code - * uint32_t length; - * enet_handle_t g_handle; - * Comment: Get the received frame size firstly. - * status = ENET_GetRxFrameSize(&g_handle, &length, 0); - * if (length != 0) - * { - * Comment: Allocate memory here with the size of "length" - * uint8_t *data = memory allocate interface; - * if (!data) - * { - * ENET_ReadFrame(ENET, &g_handle, NULL, 0, 0); - * } - * else - * { - * status = ENET_ReadFrame(ENET, &g_handle, data, length, 0); - * } - * } - * else if (status == kStatus_ENET_RxFrameError) - * { - * Comment: Update the received buffer when a error frame is received. - * ENET_ReadFrame(ENET, &g_handle, NULL, 0, 0); - * } - * endcode - * param base ENET peripheral base address. - * param handle The ENET handler structure. This is the same handler pointer used in the ENET_Init. - * param data The data buffer provided by user to store the frame which memory size should be at least "length". - * param length The size of the data buffer which is still the length of the received frame. - * param channel The Rx DMA channel. shall not be larger than 2. - * param timestamp The timestamp address to store received timestamp. - * return The execute status, successful or failure. - */ -status_t ENET_ReadFrame( - ENET_Type *base, enet_handle_t *handle, uint8_t *data, uint32_t length, uint8_t channel, enet_ptp_time_t *timestamp) -{ - assert(handle); - - enet_rx_bd_ring_t *rxBdRing = (enet_rx_bd_ring_t *)&handle->rxBdRing[channel]; - uint32_t len = 0; - uint32_t offset = 0; - bool isLastBuff = false; - status_t result = kStatus_Fail; - bool suspend = false; - enet_rx_bd_struct_t *rxDesc; -#ifdef ENET_PTP1588FEATURE_REQUIRED - uint32_t buffer; - uint32_t bufferAdd; -#endif /* ENET_PTP1588FEATURE_REQUIRED */ - - /* Suspend and command for Rx. */ - if ((base->DMA_CH[channel].DMA_CHX_STAT & ENET_DMA_CH_DMA_CHX_STAT_RBU_MASK) != 0U) - { - suspend = true; - } - - /* For data-NULL input, only update the buffer descriptor. */ - if (data == NULL) - { - ENET_DropFrame(base, handle, channel); - result = kStatus_Success; - } - else - { - while (!isLastBuff) - { - /* The last buffer descriptor of a frame. */ - rxDesc = rxBdRing->rxBdBase + rxBdRing->rxGenIdx; - rxBdRing->rxGenIdx = ENET_IncreaseIndex(rxBdRing->rxGenIdx, rxBdRing->rxRingLen); - - if ((rxDesc->rdes3 & ENET_RXDESCRIP_WR_LD_MASK) != 0U) - { - /* This is a valid frame. */ - isLastBuff = true; - if (length == ((rxDesc->rdes3 & ENET_RXDESCRIP_WR_PACKETLEN_MASK) - ENET_FCS_LEN)) - { - /* Copy the frame to user's buffer. */ - len = length - offset; - if (len > rxBdRing->rxBuffSizeAlign) - { - (void)memcpy((void *)(uint32_t *)(uint32_t)(data + offset), (void *)(uint32_t *)rxDesc->rdes0, - rxBdRing->rxBuffSizeAlign); - offset += rxBdRing->rxBuffSizeAlign; - (void)memcpy((void *)(uint32_t *)(uint32_t)(data + offset), (void *)(uint32_t *)rxDesc->rdes2, - len - rxBdRing->rxBuffSizeAlign); - } - else - { - (void)memcpy((void *)(uint32_t *)(uint32_t)(data + offset), (void *)(uint32_t *)rxDesc->rdes0, - len); - } - - result = kStatus_Success; - } - - /* Updates the receive buffer descriptors. */ - ENET_UpdateRxDescriptor(rxDesc, NULL, NULL, handle->rxintEnable, handle->doubleBuffEnable); -#ifdef ENET_PTP1588FEATURE_REQUIRED - /* Store the Rx timestamp which is in the next buffer descriptor of the last - * descriptor of a frame. */ - rxDesc = rxBdRing->rxBdBase + rxBdRing->rxGenIdx; - - /* Reinit for the context descritor which has been updated by DMA. */ - if ((rxDesc->rdes3 & ENET_RXDESCRIP_WR_CTXT_MASK) != 0U) - { - if (timestamp != NULL) - { - uint32_t timerCount; - - /* Get receive frame timestamp. */ - timestamp->second = rxDesc->rdes1; - timerCount = rxDesc->rdes0; - if ((base->MAC_TIMESTAMP_CONTROL & ENET_MAC_TIMESTAMP_CONTROL_TSCTRLSSR_MASK) == 0U) - { - /* Binary rollover. */ - timestamp->nanosecond = ENET_BINARY_ROLLOVER_SCALE(timerCount); - } - else - { - timestamp->nanosecond = timerCount; - } - } - - if (!handle->doubleBuffEnable) - { - buffer = handle->rxBufferStartAddr[channel][rxBdRing->rxGenIdx]; - ENET_UpdateRxDescriptor(rxDesc, (void *)(uint32_t *)buffer, NULL, handle->rxintEnable, - handle->doubleBuffEnable); - } - else - { - buffer = handle->rxBufferStartAddr[channel][2U * rxBdRing->rxGenIdx]; - bufferAdd = handle->rxBufferStartAddr[channel][2U * rxBdRing->rxGenIdx + 1U]; - ENET_UpdateRxDescriptor(rxDesc, (void *)(uint32_t *)buffer, (void *)(uint32_t *)bufferAdd, - handle->rxintEnable, handle->doubleBuffEnable); - } - rxBdRing->rxGenIdx = ENET_IncreaseIndex(rxBdRing->rxGenIdx, rxBdRing->rxRingLen); - } - base->DMA_CH[channel].DMA_CHX_RXDESC_TAIL_PTR = base->DMA_CH[channel].DMA_CHX_RXDESC_TAIL_PTR; -#endif /* ENET_PTP1588FEATURE_REQUIRED */ - } - else - { - /* Store a frame on several buffer descriptors. */ - isLastBuff = false; - /* Length check. */ - if (offset >= length) - { - /* Updates the receive buffer descriptors. */ - ENET_UpdateRxDescriptor(rxDesc, NULL, NULL, handle->rxintEnable, handle->doubleBuffEnable); - break; - } - - (void)memcpy((void *)(uint32_t *)(uint32_t)(data + offset), (void *)(uint32_t *)rxDesc->rdes0, - rxBdRing->rxBuffSizeAlign); - offset += rxBdRing->rxBuffSizeAlign; - if (((rxDesc->rdes2) != 0U) && (handle->doubleBuffEnable)) - { - (void)memcpy((void *)(uint32_t *)(uint32_t)(data + offset), (void *)(uint32_t *)rxDesc->rdes2, - rxBdRing->rxBuffSizeAlign); - offset += rxBdRing->rxBuffSizeAlign; - } - - /* Updates the receive buffer descriptors. */ - ENET_UpdateRxDescriptor(rxDesc, NULL, NULL, handle->rxintEnable, handle->doubleBuffEnable); - } - } - } - - /* Set command for Rx when it is suspend. */ - if (suspend) - { - base->DMA_CH[channel].DMA_CHX_RXDESC_TAIL_PTR = base->DMA_CH[channel].DMA_CHX_RXDESC_TAIL_PTR; - } - - return result; -} - -/*! - * brief Updates the buffers and the own status for a given Rx descriptor. - * This function is a low level functional API to Updates the - * buffers and the own status for a given Rx descriptor. - * - * param rxDesc The given Rx descriptor. - * param buffer1 The first buffer address in the descriptor. - * param buffer2 The second buffer address in the descriptor. - * param intEnable Interrupt enable flag. - * param doubleBuffEnable The double buffer enable flag. - * - * note This must be called after all the ENET initilization. - * And should be called when the ENET receive/transmit is required. - */ -void ENET_UpdateRxDescriptor( - enet_rx_bd_struct_t *rxDesc, void *buffer1, void *buffer2, bool intEnable, bool doubleBuffEnable) -{ - assert(rxDesc); - uint32_t control = ENET_RXDESCRIP_RD_OWN_MASK | ENET_RXDESCRIP_RD_BUFF1VALID_MASK; - - if (intEnable) - { - control |= ENET_RXDESCRIP_RD_IOC_MASK; - } - - if (doubleBuffEnable) - { - control |= ENET_RXDESCRIP_RD_BUFF2VALID_MASK; - } - - /* Update the buffer if needed. */ - if (buffer1 != NULL) - { - rxDesc->rdes0 = (uint32_t)(uint32_t *)buffer1; - } - if (buffer2 != NULL) - { - rxDesc->rdes2 = (uint32_t)(uint32_t *)buffer2; - } - else - { - rxDesc->rdes2 = 0; - } - - rxDesc->rdes1 = 0; - rxDesc->rdes3 = control; -} - -/*! - * brief Allocates Rx buffers for all BDs. - * It's used for zero copy Rx. In zero copy Rx case, Rx buffers are dynamic. This function - * will populate initial buffers in all BDs for receiving. Then ENET_GetRxFrame() is used - * to get Rx frame with zero copy, it will allocate new buffer to replace the buffer in BD taken - * by application, application should free those buffers after they're used. - * - * note This function should be called after ENET_CreateHandler() and buffer allocating callback - * function should be ready. - * - * param base ENET peripheral base address. - * param handle The ENET handler structure. This is the same handler pointer used in the ENET_Init. - */ -status_t ENET_RxBufferAllocAll(ENET_Type *base, enet_handle_t *handle) -{ - status_t result = kStatus_Success; - enet_rx_bd_struct_t *rxbdPtr; - uint32_t buffAddr; - uint8_t channel; - uint16_t index; - uint16_t j; - uint8_t ringNum = (handle->multiQueEnable) ? 2U : 1U; - - if ((handle->rxBuffAlloc == NULL) || (handle->rxBuffFree == NULL)) - { - return kStatus_ENET_InitMemoryFail; - } - - for (channel = 0; channel < ringNum; channel++) - { - /* Init the rxbdPtr to the receive descriptor start address. */ - rxbdPtr = handle->rxBdRing[channel].rxBdBase; - for (j = 0U; j < handle->rxBdRing[channel].rxRingLen; j++) - { - if (handle->doubleBuffEnable) - { - index = 2U * j; - } - else - { - index = j; - } - - buffAddr = (uint32_t)(uint32_t *)handle->rxBuffAlloc(base, handle->userData, channel); - if (buffAddr == 0U) - { - result = kStatus_ENET_InitMemoryFail; - break; - } - - rxbdPtr->rdes0 = buffAddr; - handle->rxBufferStartAddr[channel][index] = buffAddr; - - /* The second buffer is set with 0 because it is not required for normal case. */ - if (handle->doubleBuffEnable) - { - buffAddr = (uint32_t)(uint32_t *)handle->rxBuffAlloc(base, handle->userData, channel); - if (buffAddr == 0U) - { - result = kStatus_ENET_InitMemoryFail; - break; - } - - rxbdPtr->rdes2 = buffAddr; - handle->rxBufferStartAddr[channel][index + 1U] = buffAddr; - } - else - { - rxbdPtr->rdes2 = 0; - } - - /* Set the valid and DMA own flag.*/ - rxbdPtr->rdes3 |= ENET_RXDESCRIP_WR_OWN_MASK; - rxbdPtr++; - } - } - - if (result == kStatus_ENET_InitMemoryFail) - { - ENET_RxBufferFreeAll(base, handle); - } - - return result; -} - -/*! - * brief Frees Rx buffers in all BDs. - * It's used for zero copy Rx. In zero copy Rx case, Rx buffers are dynamic. This function - * frees left buffers in all BDs. - * - * param base ENET peripheral base address. - * param handle The ENET handler structure. This is the same handler pointer used in the ENET_Init. - */ -void ENET_RxBufferFreeAll(ENET_Type *base, enet_handle_t *handle) -{ - uint8_t ringNum = (handle->multiQueEnable) ? 2U : 1U; - uint8_t channel; - uint32_t buffAddr; - uint16_t index; - uint16_t j; - - if (handle->rxBuffFree != NULL) - { - for (channel = 0; channel < ringNum; channel++) - { - for (j = 0U; j < handle->rxBdRing[channel].rxRingLen; j++) - { - index = (handle->doubleBuffEnable) ? (2U * j) : j; - - buffAddr = (uint32_t)handle->rxBufferStartAddr[channel][index]; - if (buffAddr != 0U) - { - handle->rxBuffFree(base, (void *)(uint32_t *)buffAddr, handle->userData, channel); - } - - /* The second buffer is set with 0 because it is not required for normal case. */ - if (handle->doubleBuffEnable) - { - buffAddr = (uint32_t)handle->rxBufferStartAddr[channel][index + 1U]; - if (buffAddr != 0U) - { - handle->rxBuffFree(base, (void *)(uint32_t *)buffAddr, handle->userData, channel); - } - } - } - } - } -} - -static inline void ENET_GetRxFrameErr(enet_rx_bd_struct_t *rxDesc, enet_rx_frame_error_t *rxFrameError) -{ - union _frame_error - { - uint32_t data; - enet_rx_frame_error_t frameError; - }; - union _frame_error error; - - error.data = ENET_FRAME_RX_ERROR_BITS(rxDesc->rdes3); - *rxFrameError = error.frameError; -} - -static void ENET_DropFrame(ENET_Type *base, enet_handle_t *handle, uint8_t channel) -{ - enet_rx_bd_ring_t *rxBdRing = (enet_rx_bd_ring_t *)&handle->rxBdRing[channel]; - enet_rx_bd_struct_t *rxDesc; - uint16_t index = rxBdRing->rxGenIdx; -#ifdef ENET_PTP1588FEATURE_REQUIRED - bool tsAvailable = false; - uint32_t buff1Addr = 0; - uint32_t buff2Addr = 0; - uint32_t rdes1; -#endif /* ENET_PTP1588FEATURE_REQUIRED */ - uint32_t rdes3; - - /* Not check DMA ownership here, assume there's at least one valid frame left in BD ring */ - do - { - /* Update the BD to idle status. */ - rxDesc = &rxBdRing->rxBdBase[rxBdRing->rxGenIdx]; -#ifdef ENET_PTP1588FEATURE_REQUIRED - rdes1 = rxDesc->rdes1; -#endif - rdes3 = rxDesc->rdes3; - ENET_UpdateRxDescriptor(rxDesc, NULL, NULL, handle->rxintEnable, handle->doubleBuffEnable); - rxBdRing->rxGenIdx = ENET_IncreaseIndex(rxBdRing->rxGenIdx, rxBdRing->rxRingLen); - - /* Find the last buffer descriptor for the frame. */ - if ((rdes3 & ENET_RXDESCRIP_WR_LD_MASK) != 0U) - { -#ifdef ENET_PTP1588FEATURE_REQUIRED - if ((rdes3 & ENET_RXDESCRIP_WR_RS1V_MASK) != 0U) - { - if ((rdes1 & ENET_RXDESCRIP_WR_PTPTSA_MASK) != 0U) - { - tsAvailable = true; - } - } - - /* Reinit for the context descriptor which has been updated by DMA. */ - rxDesc = &rxBdRing->rxBdBase[rxBdRing->rxGenIdx]; - - if (tsAvailable && ((rxDesc->rdes3 & ENET_RXDESCRIP_WR_CTXT_MASK) != 0U)) - { - if (!handle->doubleBuffEnable) - { - buff1Addr = handle->rxBufferStartAddr[channel][rxBdRing->rxGenIdx]; - ENET_UpdateRxDescriptor(rxDesc, (void *)(uint8_t *)buff1Addr, NULL, handle->rxintEnable, - handle->doubleBuffEnable); - } - else - { - buff1Addr = handle->rxBufferStartAddr[channel][2U * rxBdRing->rxGenIdx]; - buff2Addr = handle->rxBufferStartAddr[channel][2U * rxBdRing->rxGenIdx + 1U]; - ENET_UpdateRxDescriptor(rxDesc, (void *)(uint8_t *)buff1Addr, (void *)(uint8_t *)buff2Addr, - handle->rxintEnable, handle->doubleBuffEnable); - } - rxBdRing->rxGenIdx = ENET_IncreaseIndex(rxBdRing->rxGenIdx, rxBdRing->rxRingLen); - } -#endif /* ENET_PTP1588FEATURE_REQUIRED */ - break; - } - } while (rxBdRing->rxGenIdx != index); - - /* Always try to start receive, in case it had stopped */ - base->DMA_CH[channel].DMA_CHX_RXDESC_TAIL_PTR = (uint32_t)(uint8_t *)&rxBdRing->rxBdBase[rxBdRing->rxRingLen]; -} - -/*! - * brief Receives one frame in specified BD ring with zero copy. - * - * This function will use the user-defined allocate and free callback. Every time application gets one frame through - * this function, driver will allocate new buffers for the BDs whose buffers have been taken by application. - * note This function will drop current frame and update related BDs as available for DMA if new buffers allocating - * fails. Application must provide a memory pool including at least BD number + 1 buffers(+2 if enable double buffer) - * to make this function work normally. - * - * param base ENET peripheral base address. - * param handle The ENET handler pointer. This is the same handler pointer used in the ENET_Init. - * param rxFrame The received frame information structure provided by user. - * param channel The Rx DMA channel. Shall not be larger than 2. - * retval kStatus_Success Succeed to get one frame and allocate new memory for Rx buffer. - * retval kStatus_ENET_RxFrameEmpty There's no Rx frame in the BD. - * retval kStatus_ENET_RxFrameError There's issue in this receiving. In this function, issue frame will be dropped. - * retval kStatus_ENET_RxFrameDrop There's no new buffer memory for BD, dropped this frame. - */ -status_t ENET_GetRxFrame(ENET_Type *base, enet_handle_t *handle, enet_rx_frame_struct_t *rxFrame, uint8_t channel) -{ - assert(handle != NULL); - assert(channel < ENET_RING_NUM_MAX); - - enet_rx_bd_ring_t *rxBdRing = (enet_rx_bd_ring_t *)&handle->rxBdRing[channel]; - enet_rx_bd_struct_t *rxDesc = &rxBdRing->rxBdBase[rxBdRing->rxGenIdx]; - uint16_t index = rxBdRing->rxGenIdx; - status_t result = kStatus_Success; - uint32_t buff1Addr = 0; - uint32_t buff2Addr = 0; - uint16_t buff1Len = 0; - uint16_t buff2Len = 0; - uint16_t offset = 0; - void *newBuff1 = NULL; - void *newBuff2 = NULL; - bool isDrop = false; - bool isLastBuff = false; -#ifdef ENET_PTP1588FEATURE_REQUIRED - bool tsAvailable = false; -#endif /* ENET_PTP1588FEATURE_REQUIRED */ - - /* Check the frame status. */ - do - { - if ((rxDesc->rdes3 & ENET_RXDESCRIP_WR_OWN_MASK) != 0U) - { - result = kStatus_ENET_RxFrameEmpty; - break; - } - - /* Check timestamp and error. */ - if ((rxDesc->rdes3 & ENET_RXDESCRIP_WR_LD_MASK) != 0U) - { -#ifdef ENET_PTP1588FEATURE_REQUIRED - if ((rxDesc->rdes3 & ENET_RXDESCRIP_WR_RS1V_MASK) != 0U) - { - if ((rxDesc->rdes1 & ENET_RXDESCRIP_WR_PTPTSA_MASK) != 0U) - { - tsAvailable = true; - } - } -#endif /* ENET_PTP1588FEATURE_REQUIRED */ - - /* Get the frame error if there is. */ - if ((rxDesc->rdes3 & ENET_RXDESCRIP_WR_ERRSUM_MASK) != 0U) - { - ENET_GetRxFrameErr(rxDesc, &rxFrame->rxFrameError); - result = kStatus_ENET_RxFrameError; - } - else if ((rxDesc->rdes3 & ENET_RXDESCRIP_WR_PACKETLEN_MASK) == 0U) - { - result = kStatus_ENET_RxFrameEmpty; - } - else - { - /* Intentional empty */ - } - break; - } - - index = ENET_IncreaseIndex(index, rxBdRing->rxRingLen); - if (index == rxBdRing->rxGenIdx) - { - result = kStatus_ENET_RxFrameEmpty; - break; - } - rxDesc = &rxBdRing->rxBdBase[index]; - } while (index != rxBdRing->rxGenIdx); - - /* Drop the error frame and return error. */ - if (result != kStatus_Success) - { - if (result == kStatus_ENET_RxFrameError) - { - ENET_DropFrame(base, handle, channel); - } - return result; - } - - /* Get the valid frame */ - index = 0; - do - { - rxDesc = &rxBdRing->rxBdBase[rxBdRing->rxGenIdx]; - - /* Calculate the buffer and frame length. */ - if ((rxDesc->rdes3 & ENET_RXDESCRIP_WR_LD_MASK) != 0U) - { - isLastBuff = true; - rxFrame->totLen = (uint16_t)(rxDesc->rdes3 & ENET_RXDESCRIP_WR_PACKETLEN_MASK); - - if (rxFrame->totLen - offset > (uint16_t)rxBdRing->rxBuffSizeAlign) - { - /* Here must be double buffer. */ - assert(handle->doubleBuffEnable); - - buff1Len = (uint16_t)rxBdRing->rxBuffSizeAlign; - buff2Len = rxFrame->totLen - offset - (uint16_t)rxBdRing->rxBuffSizeAlign; - } - else - { - buff1Len = rxFrame->totLen - offset; - } - } - else - { - if (!handle->doubleBuffEnable) - { - buff1Len = (uint16_t)rxBdRing->rxBuffSizeAlign; - offset += buff1Len; - } - else - { - buff1Len = (uint16_t)rxBdRing->rxBuffSizeAlign; - buff2Len = (uint16_t)rxBdRing->rxBuffSizeAlign; - offset += buff1Len + buff2Len; - } - } - - /* Allocate new buffer to replace the buffer taken by application */ - newBuff1 = handle->rxBuffAlloc(base, handle->userData, channel); - if (newBuff1 == NULL) - { - isDrop = true; - } - else if (handle->doubleBuffEnable && (buff2Len != 0U)) - { - newBuff2 = handle->rxBuffAlloc(base, handle->userData, channel); - if (newBuff2 == NULL) - { - handle->rxBuffFree(base, newBuff1, handle->userData, channel); - isDrop = true; - } - } - else - { - /* Intentional empty */ - } - - if (!isDrop) - { - /* Get the frame data information into Rx frame structure. */ - if (!handle->doubleBuffEnable) - { - buff1Addr = handle->rxBufferStartAddr[channel][rxBdRing->rxGenIdx]; - rxFrame->rxBuffArray[index].buffer = (void *)(uint32_t *)buff1Addr; - rxFrame->rxBuffArray[index].length = buff1Len; - index++; - } - else - { - buff1Addr = handle->rxBufferStartAddr[channel][2U * rxBdRing->rxGenIdx]; - rxFrame->rxBuffArray[index].buffer = (void *)(uint32_t *)buff1Addr; - rxFrame->rxBuffArray[index].length = buff1Len; - index++; - - /* If there's no data in buffer2, not add it into rxFrame */ - if (buff2Len != 0U) - { - buff2Addr = handle->rxBufferStartAddr[channel][2U * rxBdRing->rxGenIdx + 1U]; - rxFrame->rxBuffArray[index].buffer = (void *)(uint32_t *)buff2Addr; - rxFrame->rxBuffArray[index].length = buff2Len; - index++; - } - } - - /* Give new buffer from application to BD */ - if (!handle->doubleBuffEnable) - { - buff1Addr = (uint32_t)(uint32_t *)newBuff1; - handle->rxBufferStartAddr[channel][rxBdRing->rxGenIdx] = buff1Addr; - ENET_UpdateRxDescriptor(rxDesc, (void *)(uint32_t *)buff1Addr, NULL, handle->rxintEnable, - handle->doubleBuffEnable); - } - else - { - buff1Addr = (uint32_t)(uint32_t *)newBuff1; - handle->rxBufferStartAddr[channel][2U * rxBdRing->rxGenIdx] = buff1Addr; - - if (buff2Len != 0U) - { - buff2Addr = (uint32_t)(uint32_t *)newBuff2; - handle->rxBufferStartAddr[channel][2U * rxBdRing->rxGenIdx + 1U] = buff2Addr; - } - else - { - /* If there's no data in buffer2, keep it */ - buff2Addr = handle->rxBufferStartAddr[channel][2U * rxBdRing->rxGenIdx + 1U]; - } - - ENET_UpdateRxDescriptor(rxDesc, (void *)(uint32_t *)buff1Addr, (void *)(uint32_t *)buff2Addr, - handle->rxintEnable, handle->doubleBuffEnable); - } - rxBdRing->rxGenIdx = ENET_IncreaseIndex(rxBdRing->rxGenIdx, rxBdRing->rxRingLen); - -#ifdef ENET_PTP1588FEATURE_REQUIRED - /* Update context BD if there is */ - if (isLastBuff && tsAvailable) - { - rxDesc = &rxBdRing->rxBdBase[rxBdRing->rxGenIdx]; - if ((rxDesc->rdes3 & ENET_RXDESCRIP_WR_CTXT_MASK) != 0U) - { - uint32_t timerCount; - - /* Get receive frame timestamp. */ - rxFrame->rxAttribute.timestamp.second = rxDesc->rdes1; - timerCount = rxDesc->rdes0; - if ((base->MAC_TIMESTAMP_CONTROL & ENET_MAC_TIMESTAMP_CONTROL_TSCTRLSSR_MASK) == 0U) - { - /* Binary rollover. */ - rxFrame->rxAttribute.timestamp.nanosecond = ENET_BINARY_ROLLOVER_SCALE(timerCount); - } - else - { - rxFrame->rxAttribute.timestamp.nanosecond = timerCount; - } - rxFrame->rxAttribute.isTsAvail = true; - - if (!handle->doubleBuffEnable) - { - buff1Addr = handle->rxBufferStartAddr[channel][rxBdRing->rxGenIdx]; - ENET_UpdateRxDescriptor(rxDesc, (void *)(uint8_t *)buff1Addr, NULL, handle->rxintEnable, - handle->doubleBuffEnable); - } - else - { - buff1Addr = handle->rxBufferStartAddr[channel][2U * rxBdRing->rxGenIdx]; - buff2Addr = handle->rxBufferStartAddr[channel][2U * rxBdRing->rxGenIdx + 1U]; - ENET_UpdateRxDescriptor(rxDesc, (void *)(uint8_t *)buff1Addr, (void *)(uint8_t *)buff2Addr, - handle->rxintEnable, handle->doubleBuffEnable); - } - rxBdRing->rxGenIdx = ENET_IncreaseIndex(rxBdRing->rxGenIdx, rxBdRing->rxRingLen); - } - } -#else - rxFrame->rxAttribute.isTsAvail = false; -#endif /* ENET_PTP1588FEATURE_REQUIRED */ - - /* Always try to start receive, in case it had stopped */ - base->DMA_CH[channel].DMA_CHX_RXDESC_TAIL_PTR = - (uint32_t)(uint8_t *)&rxBdRing->rxBdBase[rxBdRing->rxRingLen]; - } - else - { - /* Drop frame if there's no new buffer memory */ - - /* Free the incomplete frame buffers. */ - while (index-- != 0U) - { - handle->rxBuffFree(base, rxFrame->rxBuffArray[index].buffer, handle->userData, channel); - } - - /* Update all left BDs of this frame from current index. */ - ENET_DropFrame(base, handle, channel); - - result = kStatus_ENET_RxFrameDrop; - break; - } - } while (!isLastBuff); - - /* Remove 4 bytes FCS. */ - if (result == kStatus_Success) - { - /* Find the last 4 bytes in the linked buffers and remove these FCS data. */ - buff1Len = rxFrame->rxBuffArray[--index].length; - if (buff1Len > ENET_FCS_LEN) - { - rxFrame->rxBuffArray[index].length -= ENET_FCS_LEN; - } - else - { - rxFrame->rxBuffArray[index].length = 0; - handle->rxBuffFree(base, rxFrame->rxBuffArray[index].buffer, handle->userData, channel); - if (buff1Len < ENET_FCS_LEN) - { - rxFrame->rxBuffArray[--index].length -= (ENET_FCS_LEN - buff1Len); - } - } - rxFrame->totLen -= ENET_FCS_LEN; - } - - return result; -} - -/*! - * brief Setup a given Tx descriptor. - * This function is a low level functional API to setup or prepare - * a given Tx descriptor. - * - * param txDesc The given Tx descriptor. - * param buffer1 The first buffer address in the descriptor. - * param bytes1 The bytes in the fist buffer. - * param buffer2 The second buffer address in the descriptor. - * param bytes2 The bytes in the second buffer. - * param framelen The length of the frame to be transmitted. - * param intEnable Interrupt enable flag. - * param tsEnable The timestamp enable. - * param flag The flag of this Tx desciriptor, see "enet_desc_flag_t" . - * param slotNum The slot num used for AV mode only. - * - * note This must be called after all the ENET initilization. - * And should be called when the ENET receive/transmit is required. - * Transmit buffers are 'zero-copy' buffers, so the buffer must remain in - * memory until the packet has been fully transmitted. The buffers - * should be free or requeued in the transmit interrupt irq handler. - */ -void ENET_SetupTxDescriptor(enet_tx_bd_struct_t *txDesc, - void *buffer1, - uint32_t bytes1, - void *buffer2, - uint32_t bytes2, - uint32_t framelen, - bool intEnable, - bool tsEnable, - enet_desc_flag_t flag, - uint8_t slotNum) -{ - uint32_t control = ENET_TXDESCRIP_RD_BL1(bytes1) | ENET_TXDESCRIP_RD_BL2(bytes2); - - if ((flag == kENET_FirstFlagOnly) || (flag == kENET_FirstLastFlag)) - { - if (tsEnable) - { - control |= ENET_TXDESCRIP_RD_TTSE_MASK; - } - else - { - control &= ~ENET_TXDESCRIP_RD_TTSE_MASK; - } - } - - if (intEnable) - { - control |= ENET_TXDESCRIP_RD_IOC_MASK; - } - else - { - control &= ~ENET_TXDESCRIP_RD_IOC_MASK; - } - - /* Preare the descriptor for transmit. */ - txDesc->tdes0 = (uint32_t)(uint32_t *)buffer1; - txDesc->tdes1 = (uint32_t)(uint32_t *)buffer2; - txDesc->tdes2 = control; - - control = ENET_TXDESCRIP_RD_SLOT(slotNum) | ENET_TXDESCRIP_RD_FL(framelen) | ENET_TXDESCRIP_RD_LDFD(flag) | - ENET_TXDESCRIP_RD_OWN_MASK; - - txDesc->tdes3 = control; -} - -/*! - * brief Configure a given Tx descriptor. - * This function is a low level functional API to setup or prepare - * a given Tx descriptor. - * - * param txDesc The given Tx descriptor. - * param config The Tx descriptor configuration. - * - * note This must be called after all the ENET initilization. - * And should be called when the ENET receive/transmit is required. - * Transmit buffers are 'zero-copy' buffers, so the buffer must remain in - * memory until the packet has been fully transmitted. The buffers - * should be free or requeued in the transmit interrupt irq handler. - */ -static void ENET_ConfigTxDescriptor(enet_tx_bd_struct_t *txDesc, enet_tx_bd_config_struct_t *config) -{ - uint32_t control = ENET_TXDESCRIP_RD_BL1(config->bytes1) | ENET_TXDESCRIP_RD_BL2(config->bytes2); - enet_tx_offload_t txOffloadMode = kENET_TxOffloadDisable; - - if ((config->flag == kENET_FirstFlagOnly) || (config->flag == kENET_FirstLastFlag)) - { - if (config->tsEnable) - { - control |= ENET_TXDESCRIP_RD_TTSE_MASK; - } - else - { - control &= ~ENET_TXDESCRIP_RD_TTSE_MASK; - } - txOffloadMode = config->txOffloadOps; - } - - if (config->intEnable) - { - control |= ENET_TXDESCRIP_RD_IOC_MASK; - } - else - { - control &= ~ENET_TXDESCRIP_RD_IOC_MASK; - } - - /* Preare the descriptor for transmit. */ - txDesc->tdes0 = (uint32_t)(uint32_t *)config->buffer1; - txDesc->tdes1 = (uint32_t)(uint32_t *)config->buffer2; - txDesc->tdes2 = control; - - control = ENET_TXDESCRIP_RD_SLOT(config->slotNum) | ENET_TXDESCRIP_RD_FL(config->framelen) | - ENET_TXDESCRIP_RD_CIC(txOffloadMode) | ENET_TXDESCRIP_RD_LDFD(config->flag) | ENET_TXDESCRIP_RD_OWN_MASK; - - txDesc->tdes3 = control; -} - -/*! - * brief Reclaim Tx descriptors. - * This function is used to update the Tx descriptor status and - * store the Tx timestamp when the 1588 feature is enabled. - * This is called by the transmit interupt IRQ handler after the - * complete of a frame transmission. - * - * param base ENET peripheral base address. - * param handle The ENET handler pointer. This is the same handler pointer used in the ENET_Init. - * param channel The Tx DMA channnel. - * - */ -void ENET_ReclaimTxDescriptor(ENET_Type *base, enet_handle_t *handle, uint8_t channel) -{ - enet_tx_bd_ring_t *txBdRing = &handle->txBdRing[channel]; - enet_tx_bd_struct_t *txDesc = txBdRing->txBdBase + txBdRing->txConsumIdx; - enet_tx_dirty_ring_t *txDirtyRing = (enet_tx_dirty_ring_t *)&handle->txDirtyRing[channel]; - enet_tx_reclaim_info_t *txDirty = NULL; - - /* Need to update the first index for transmit buffer free. */ - while ((txBdRing->txDescUsed > 0U) && ((txDesc->tdes3 & ENET_TXDESCRIP_RD_OWN_MASK) == 0U)) - { - if ((txDesc->tdes3 & ENET_TXDESCRIP_RD_LD_MASK) != 0U) - { - txDirty = &txDirtyRing->txDirtyBase[txDirtyRing->txConsumIdx]; - txDirtyRing->txConsumIdx = ENET_IncreaseIndex(txDirtyRing->txConsumIdx, txDirtyRing->txRingLen); - txDirty->isTsAvail = false; - -#ifdef ENET_PTP1588FEATURE_REQUIRED - uint32_t nanosecond = 0; - - if ((txDesc->tdes3 & ENET_TXDESCRIP_WB_TTSS_MASK) != 0U) - { - /* Get transmit time stamp second. */ - nanosecond = txDesc->tdes0; - if ((base->MAC_TIMESTAMP_CONTROL & ENET_MAC_TIMESTAMP_CONTROL_TSCTRLSSR_MASK) == 0U) - { - /* Binary rollover. */ - txDirty->timeStamp.nanosecond = ENET_BINARY_ROLLOVER_SCALE(nanosecond); - } - else - { - txDirty->timeStamp.nanosecond = nanosecond; - } - txDirty->timeStamp.second = txDesc->tdes1; - txDirty->isTsAvail = true; - } -#endif /* ENET_PTP1588FEATURE_REQUIRED */ - /* For Tx buffer free or requeue for each descriptor. - * The Tx interrupt callback should free/requeue the Tx buffer. */ - if (handle->callback != NULL) - { - handle->callback(base, handle, kENET_TxIntEvent, channel, txDirty, handle->userData); - } - } - - /* Update the used Tx descriptor count. */ - txBdRing->txDescUsed--; - - /* Update the txConsumIdx/txDesc. */ - txBdRing->txConsumIdx = ENET_IncreaseIndex(txBdRing->txConsumIdx, txBdRing->txRingLen); - txDesc = txBdRing->txBdBase + txBdRing->txConsumIdx; - } -} - -/*! - * brief Transmits an ENET frame. - * note The CRC is automatically appended to the data. Input the data - * to send without the CRC. This API uses input buffer for Tx, application - * should reclaim the buffer after Tx is over. - * - * param base ENET peripheral base address. - * param handle The ENET handler pointer. This is the same handler pointer used in the ENET_Init. - * param txFrame The Tx frame structure. - * param channel Channel to send the frame, same with queue index. - * retval kStatus_Success Send frame succeed. - * retval kStatus_ENET_TxFrameBusy Transmit buffer descriptor is busy under transmission. - * The transmit busy happens when the data send rate is over the MAC capacity. - * The waiting mechanism is recommended to be added after each call return with kStatus_ENET_TxFrameBusy. - * Also need to pay attention to reclaim Tx frame after Tx is over. - * retval kStatus_ENET_TxFrameOverLen Transmit frme length exceeds the 0x3FFF limit defined by the driver. - */ -status_t ENET_SendFrame(ENET_Type *base, enet_handle_t *handle, enet_tx_frame_struct_t *txFrame, uint8_t channel) -{ - assert(handle); - assert(handle->txDirtyRing[channel].txDirtyBase != NULL); - assert(txFrame); - assert(txFrame->txBuffNum != 0U); - assert(txFrame->txBuffArray != NULL); - - enet_tx_bd_ring_t *txBdRing = (enet_tx_bd_ring_t *)&handle->txBdRing[channel]; - enet_tx_dirty_ring_t *txDirtyRing = (enet_tx_dirty_ring_t *)&handle->txDirtyRing[channel]; - enet_tx_reclaim_info_t *txDirty = &txDirtyRing->txDirtyBase[txDirtyRing->txGenIdx]; - enet_buffer_struct_t *txBuff = txFrame->txBuffArray; - uint32_t frameLen = 0; - uint32_t index = 0; - enet_tx_bd_struct_t *txDesc; - enet_desc_flag_t descFlag; - uint32_t leftBuffNum; - - /* Calculate total frame length and the Tx buffer number if it's scattered. */ - for (index = 0; index < txFrame->txBuffNum; index++) - { - frameLen += txBuff[index].length; - } - - /* Here use maximum length of single buffer in hardware as transmit length limitation, cause it's long enough. - * And it simplifies the check of buffer length. There's no need to check each buffer length. */ - if (frameLen > ENET_FRAME_TX_LEN_LIMITATION) - { - return kStatus_ENET_TxFrameOverLen; - } - - /* Check Tx FIFO whether can store enough frame data. */ - if (0U != handle->txLenLimitation[channel]) - { - if (frameLen > handle->txLenLimitation[channel]) - { - return kStatus_ENET_TxFrameOverLen; - } - } - - /* Check whether the available BD number is enough for Tx data buffer. */ - if (txFrame->txBuffNum > (((uint32_t)txBdRing->txRingLen - (uint32_t)txBdRing->txDescUsed) * 2U)) - { - return kStatus_ENET_TxFrameBusy; - } - - /* Update the context in Tx dirty ring for reclaim */ - txDirty->context = txFrame->context; - txDirtyRing->txGenIdx = ENET_IncreaseIndex(txDirtyRing->txGenIdx, txDirtyRing->txRingLen); - - index = 0; - leftBuffNum = txFrame->txBuffNum; - do - { - txDesc = &txBdRing->txBdBase[txBdRing->txGenIdx]; - - /* Get the right flag for current BD */ - if (leftBuffNum == txFrame->txBuffNum) - { - descFlag = (leftBuffNum > 2U) ? kENET_FirstFlagOnly : kENET_FirstLastFlag; - } - else - { - descFlag = (leftBuffNum > 2U) ? kENET_MiddleFlag : kENET_LastFlagOnly; - } - - enet_tx_bd_config_struct_t txDescConfig = {0}; - - txDescConfig.framelen = frameLen; - txDescConfig.intEnable = (bool)txFrame->txConfig.intEnable; - txDescConfig.tsEnable = (bool)txFrame->txConfig.tsEnable; - txDescConfig.txOffloadOps = txFrame->txConfig.txOffloadOps; - txDescConfig.flag = descFlag; - txDescConfig.slotNum = txFrame->txConfig.slotNum; - - /* Fill the descriptor. */ - txDescConfig.buffer1 = txBuff[index].buffer; - txDescConfig.bytes1 = txBuff[index].length; - if (leftBuffNum < 2U) - { - txDescConfig.buffer2 = NULL; - txDescConfig.bytes2 = 0; - leftBuffNum--; - } - else - { - txDescConfig.buffer2 = txBuff[index + 1U].buffer; - txDescConfig.bytes2 = txBuff[index + 1U].length; - index += 2U; - leftBuffNum -= 2U; - } - ENET_ConfigTxDescriptor(txDesc, &txDescConfig); - - /* Increase the index. */ - txBdRing->txGenIdx = ENET_IncreaseIndex(txBdRing->txGenIdx, txBdRing->txRingLen); - - /* Disable interrupt first and then enable interrupt to avoid the race condition. */ - (void)DisableIRQ(s_enetIrqId[ENET_GetInstance(base)]); - txBdRing->txDescUsed++; - (void)EnableIRQ(s_enetIrqId[ENET_GetInstance(base)]); - } while (leftBuffNum != 0U); - - /* Update the transmit tail address. */ - txDesc = (txBdRing->txGenIdx == 0U) ? (&txBdRing->txBdBase[txBdRing->txRingLen]) : - (&txBdRing->txBdBase[txBdRing->txGenIdx]); - base->DMA_CH[channel].DMA_CHX_TXDESC_TAIL_PTR = (uint32_t)txDesc & ~ENET_ADDR_ALIGNMENT; - - return kStatus_Success; -} - -#ifdef ENET_PTP1588FEATURE_REQUIRED -/*! - * brief Gets the current ENET time from the PTP 1588 timer. - * Interrupts are not disabled. - * - * param base ENET peripheral base address. - * param second The PTP 1588 system timer second. - * param nanosecond The PTP 1588 system timer nanosecond. - */ -void ENET_Ptp1588GetTimerNoIrqDisable(ENET_Type *base, uint64_t *second, uint32_t *nanosecond) -{ - assert(second); - assert(nanosecond); - - /* Get the current PTP time. */ - *second = base->MAC_SYSTEM_TIME_SECONDS; - *nanosecond = base->MAC_SYSTEM_TIME_NANOSECONDS & ENET_MAC_SYSTEM_TIME_NANOSECONDS_TSSS_MASK; - if (!((base->MAC_TIMESTAMP_CONTROL & ENET_MAC_TIMESTAMP_CONTROL_TSCTRLSSR_MASK) != 0U)) - { - /* Binary rollover, the unit of the increment is ~ 0.466 ns. */ - *nanosecond = ENET_BINARY_ROLLOVER_SCALE(*nanosecond); - } -} - -/*! - * brief Gets the current ENET time from the PTP 1588 timer. - * - * param base ENET peripheral base address. - * param second The PTP 1588 system timer second. - * param nanosecond The PTP 1588 system timer nanosecond. - * For the unit of the nanosecond is 1ns. So the nanosecond is the real nanosecond. - */ -void ENET_Ptp1588GetTimer(ENET_Type *base, uint64_t *second, uint32_t *nanosecond) -{ - assert(second); - assert(nanosecond); - - uint32_t primask; - - /* Disables the interrupt. */ - primask = DisableGlobalIRQ(); - - ENET_Ptp1588GetTimerNoIrqDisable(base, second, nanosecond); - - /* Enables the interrupt. */ - EnableGlobalIRQ(primask); -} - -/*! - * brief Correct the ENET PTP 1588 timer in coarse method. - * - * param base ENET peripheral base address. - * param operation The system time operation, refer to "enet_systime_op_t" - * param second The correction second. - * param nanosecond The correction nanosecond. - */ -void ENET_Ptp1588CorrectTimerInCoarse(ENET_Type *base, - enet_systime_op_t operation, - uint32_t second, - uint32_t nanosecond) -{ - uint32_t corrSecond = second; - uint32_t corrNanosecond; - - /* Set the system timer. */ - if ((base->MAC_TIMESTAMP_CONTROL & ENET_MAC_TIMESTAMP_CONTROL_TSCTRLSSR_MASK) != 0U) - { - if (operation == kENET_SystimeSubtract) - { - /* Set with the complement of the sub-second. */ - corrSecond = ENET_MAC_SYSTEM_TIME_SECONDS_UPDATE_TSS_MASK - (second - 1U); - corrNanosecond = ENET_MAC_SYSTEM_TIME_NANOSECONDS_UPDATE_ADDSUB_MASK | - ENET_MAC_SYSTEM_TIME_NANOSECONDS_UPDATE_TSSS(ENET_NANOSECS_ONESECOND - nanosecond); - } - else - { - corrNanosecond = ENET_MAC_SYSTEM_TIME_NANOSECONDS_UPDATE_TSSS(nanosecond); - } - } - else - { - nanosecond = ENET_MAC_SYSTEM_TIME_NANOSECONDS_UPDATE_TSSS_MASK / ENET_NANOSECS_ONESECOND * nanosecond; - if (operation == kENET_SystimeSubtract) - { - /* Set with the complement of the sub-second. */ - corrSecond = ENET_MAC_SYSTEM_TIME_SECONDS_UPDATE_TSS_MASK - (second - 1U); - corrNanosecond = ENET_MAC_SYSTEM_TIME_NANOSECONDS_UPDATE_ADDSUB_MASK | - ENET_MAC_SYSTEM_TIME_NANOSECONDS_UPDATE_TSSS( - ENET_MAC_SYSTEM_TIME_NANOSECONDS_UPDATE_TSSS_MASK + 1U - nanosecond); - } - else - { - corrNanosecond = ENET_MAC_SYSTEM_TIME_NANOSECONDS_UPDATE_TSSS(nanosecond); - } - } - - base->MAC_SYSTEM_TIME_SECONDS_UPDATE = corrSecond; - base->MAC_SYSTEM_TIME_NANOSECONDS_UPDATE = corrNanosecond; - - /* Update the timer. */ - base->MAC_TIMESTAMP_CONTROL |= ENET_MAC_TIMESTAMP_CONTROL_TSUPDT_MASK; - while ((base->MAC_TIMESTAMP_CONTROL & ENET_MAC_TIMESTAMP_CONTROL_TSUPDT_MASK) != 0U) - { - } -} -#endif /* ENET_PTP1588FEATURE_REQUIRED */ - -/*! - * brief The ENET IRQ handler. - * - * param base ENET peripheral base address. - * param handle The ENET handler pointer. - */ -void ENET_IRQHandler(ENET_Type *base, enet_handle_t *handle) -{ - /* Check for the interrupt source type. */ - /* DMA CHANNEL 0. */ - if ((base->DMA_INTERRUPT_STATUS & ENET_DMA_INTERRUPT_STATUS_DC0IS_MASK) != 0U) - { - uint32_t flag = base->DMA_CH[0].DMA_CHX_STAT; - if ((flag & ENET_DMA_CH_DMA_CHX_STAT_RI_MASK) != 0U) - { - base->DMA_CH[0].DMA_CHX_STAT = ENET_DMA_CH_DMA_CHX_STAT_RI_MASK | ENET_DMA_CH_DMA_CHX_STAT_NIS_MASK; - if (handle->callback != NULL) - { - handle->callback(base, handle, kENET_RxIntEvent, 0, NULL, handle->userData); - } - } - if ((flag & ENET_DMA_CH_DMA_CHX_STAT_TI_MASK) != 0U) - { - base->DMA_CH[0].DMA_CHX_STAT = ENET_DMA_CH_DMA_CHX_STAT_TI_MASK | ENET_DMA_CH_DMA_CHX_STAT_NIS_MASK; - ENET_ReclaimTxDescriptor(base, handle, 0); - } - } - - /* DMA CHANNEL 1. */ - if ((base->DMA_INTERRUPT_STATUS & ENET_DMA_INTERRUPT_STATUS_DC1IS_MASK) != 0U) - { - uint32_t flag = base->DMA_CH[1].DMA_CHX_STAT; - if ((flag & ENET_DMA_CH_DMA_CHX_STAT_RI_MASK) != 0U) - { - base->DMA_CH[1].DMA_CHX_STAT = ENET_DMA_CH_DMA_CHX_STAT_RI_MASK | ENET_DMA_CH_DMA_CHX_STAT_NIS_MASK; - if (handle->callback != NULL) - { - handle->callback(base, handle, kENET_RxIntEvent, 1, NULL, handle->userData); - } - } - if ((flag & ENET_DMA_CH_DMA_CHX_STAT_TI_MASK) != 0U) - { - base->DMA_CH[1].DMA_CHX_STAT = ENET_DMA_CH_DMA_CHX_STAT_TI_MASK | ENET_DMA_CH_DMA_CHX_STAT_NIS_MASK; - ENET_ReclaimTxDescriptor(base, handle, 1); - } - } - -#ifdef ENET_PTP1588FEATURE_REQUIRED - /* MAC TIMESTAMP. */ - if ((base->DMA_INTERRUPT_STATUS & ENET_DMA_INTERRUPT_STATUS_MACIS_MASK) != 0U) - { - if ((base->MAC_INTERRUPT_STATUS & ENET_MAC_INTERRUPT_STATUS_TSIS_MASK) != 0U) - { - if (handle->callback != NULL) - { - handle->callback(base, handle, kENET_TimeStampIntEvent, 0, NULL, handle->userData); - } - } - } -#endif /* ENET_PTP1588FEATURE_REQUIRED */ - SDK_ISR_EXIT_BARRIER; -} - -void ETHERNET_DriverIRQHandler(void); -void ETHERNET_DriverIRQHandler(void) -{ - s_enetIsr(ENET0, s_ENETHandle[0]); - SDK_ISR_EXIT_BARRIER; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_enet.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_enet.h deleted file mode 100644 index 1514e6479ce..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_enet.h +++ /dev/null @@ -1,1420 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_ENET_H_ -#define FSL_ENET_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup Mcx_enet - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief Defines the driver version. */ -#define FSL_ENET_DRIVER_VERSION (MAKE_VERSION(2, 1, 3)) -/*@}*/ - -/*! @name Control and status region bit masks of the receive buffer descriptor. */ -/*@{*/ -/*! @brief Defines for read format. */ -#define ENET_RXDESCRIP_RD_BUFF1VALID_MASK (1UL << 24) /*!< Buffer1 address valid. */ -#define ENET_RXDESCRIP_RD_BUFF2VALID_MASK (1UL << 25) /*!< Buffer2 address valid. */ -#define ENET_RXDESCRIP_RD_IOC_MASK (1UL << 30) /*!< Interrupt enable on complete. */ -#define ENET_RXDESCRIP_RD_OWN_MASK (1UL << 31) /*!< Own bit. */ - -/*! @brief Defines for write back format. */ -#define ENET_RXDESCRIP_WR_ERR_MASK ((1UL << 3) | (1UL << 7)) -#define ENET_RXDESCRIP_WR_PYLOAD_MASK (0x7U) -#define ENET_RXDESCRIP_WR_PTPMSGTYPE_MASK (0xF00U) -#define ENET_RXDESCRIP_WR_PTPTYPE_MASK (1UL << 12) -#define ENET_RXDESCRIP_WR_PTPVERSION_MASK (1UL << 13) -#define ENET_RXDESCRIP_WR_PTPTSA_MASK (1UL << 14) -#define ENET_RXDESCRIP_WR_PACKETLEN_MASK (0x7FFFU) -#define ENET_RXDESCRIP_WR_ERRSUM_MASK (1UL << 15) -#define ENET_RXDESCRIP_WR_TYPE_MASK (0x30000U) -#define ENET_RXDESCRIP_WR_DE_MASK (1UL << 19) -#define ENET_RXDESCRIP_WR_RE_MASK (1UL << 20) -#define ENET_RXDESCRIP_WR_OE_MASK (1UL << 21) -#define ENET_RXDESCRIP_WR_RS0V_MASK (1UL << 25) -#define ENET_RXDESCRIP_WR_RS1V_MASK (1UL << 26) -#define ENET_RXDESCRIP_WR_RS2V_MASK (1UL << 27) -#define ENET_RXDESCRIP_WR_LD_MASK (1UL << 28) -#define ENET_RXDESCRIP_WR_FD_MASK (1UL << 29) -#define ENET_RXDESCRIP_WR_CTXT_MASK (1UL << 30) -#define ENET_RXDESCRIP_WR_OWN_MASK (1UL << 31) -/*@}*/ - -/*! @name Control and status bit masks of the transmit buffer descriptor. */ -/*@{*/ -/*! @brief Defines for read format. */ -#define ENET_TXDESCRIP_RD_BL1_MASK (0x3fffU) -#define ENET_TXDESCRIP_RD_BL2_MASK (ENET_TXDESCRIP_RD_BL1_MASK << 16) -#define ENET_TXDESCRIP_RD_BL1(n) ((uint32_t)(n) & ENET_TXDESCRIP_RD_BL1_MASK) -#define ENET_TXDESCRIP_RD_BL2(n) (((uint32_t)(n) & ENET_TXDESCRIP_RD_BL1_MASK) << 16) -#define ENET_TXDESCRIP_RD_TTSE_MASK (1UL << 30) -#define ENET_TXDESCRIP_RD_IOC_MASK (1UL << 31) - -#define ENET_TXDESCRIP_RD_FL_MASK (0x7FFFU) -#define ENET_TXDESCRIP_RD_FL(n) ((uint32_t)(n) & ENET_TXDESCRIP_RD_FL_MASK) -#define ENET_TXDESCRIP_RD_CIC(n) (((uint32_t)(n) & 0x3U) << 16) -#define ENET_TXDESCRIP_RD_TSE_MASK (1UL << 18) -#define ENET_TXDESCRIP_RD_SLOT(n) (((uint32_t)(n) & 0x0fU) << 19) -#define ENET_TXDESCRIP_RD_SAIC(n) (((uint32_t)(n) & 0x07U) << 23) -#define ENET_TXDESCRIP_RD_CPC(n) (((uint32_t)(n) & 0x03U) << 26) -#define ENET_TXDESCRIP_RD_LDFD(n) (((uint32_t)(n) & 0x03U) << 28) -#define ENET_TXDESCRIP_RD_LD_MASK (1UL << 28) -#define ENET_TXDESCRIP_RD_FD_MASK (1UL << 29) -#define ENET_TXDESCRIP_RD_CTXT_MASK (1UL << 30) -#define ENET_TXDESCRIP_RD_OWN_MASK (1UL << 31) - -/*! @brief Defines for write back format. */ -#define ENET_TXDESCRIP_WB_TTSS_MASK (1UL << 17) -/*@}*/ - -/*! @name Bit mask for interrupt enable type. */ -/*@{*/ -#define ENET_ABNORM_INT_MASK \ - (ENET_DMA_CH_DMA_CHX_INT_EN_TXSE_MASK | ENET_DMA_CH_DMA_CHX_INT_EN_RBUE_MASK | \ - ENET_DMA_CH_DMA_CHX_INT_EN_RSE_MASK | ENET_DMA_CH_DMA_CHX_INT_EN_RWTE_MASK | \ - ENET_DMA_CH_DMA_CHX_INT_EN_FBEE_MASK | ENET_DMA_CH_DMA_CHX_INT_EN_ETIE_MASK) -#define ENET_NORM_INT_MASK \ - (ENET_DMA_CH_DMA_CHX_INT_EN_TIE_MASK | ENET_DMA_CH_DMA_CHX_INT_EN_TBUE_MASK | \ - ENET_DMA_CH_DMA_CHX_INT_EN_RIE_MASK | ENET_DMA_CH_DMA_CHX_INT_EN_ERIE_MASK) -/*@}*/ - -/*! @name Defines some Ethernet parameters. */ -/*@{*/ -#define ENET_FRAME_MAX_FRAMELEN (1518U) /*!< Default maximum ethernet frame size. */ -#define ENET_FCS_LEN (4U) /*!< Ethernet Rx frame FCS length. */ -#define ENET_ADDR_ALIGNMENT (0x3U) /*!< Recommended ethernet buffer alignment. */ -#define ENET_BUFF_ALIGNMENT (4U) /*!< Receive buffer alignment shall be 4bytes-aligned. */ -#define ENET_RING_NUM_MAX (2U) /*!< The maximum number of Tx/Rx descriptor rings. */ -#define ENET_MTL_RXFIFOSIZE (2048U) /*!< The Rx fifo size. */ -#define ENET_MTL_TXFIFOSIZE (2048U) /*!< The Tx fifo size. */ -#define ENET_MACINT_ENUM_OFFSET (16U) /*!< The offset for mac interrupt in enum type. */ -#define ENET_FRAME_TX_LEN_LIMITATION (ENET_TXDESCRIP_RD_BL1_MASK) /*!< The Tx frame length software limitation. */ -#define ENET_FRAME_RX_ERROR_BITS(x) (((x) >> 19U) & 0x3FU) /*!< The Rx frame error bits field. */ -/*@}*/ - -/*! @brief Defines the status return codes for transaction. */ -enum -{ - kStatus_ENET_InitMemoryFail = - MAKE_STATUS(kStatusGroup_ENET, 0U), /*!< Status code 4000. Init failed since buffer memory was not enough. */ - kStatus_ENET_RxFrameError = - MAKE_STATUS(kStatusGroup_ENET, 1U), /*!< Status code 4001. A frame received but data error occurred. */ - kStatus_ENET_RxFrameFail = MAKE_STATUS(kStatusGroup_ENET, 2U), /*!< Status code 4002. Failed to receive a frame. */ - kStatus_ENET_RxFrameEmpty = MAKE_STATUS(kStatusGroup_ENET, 3U), /*!< Status code 4003. No frame arrived. */ - kStatus_ENET_RxFrameDrop = MAKE_STATUS( - kStatusGroup_ENET, 4U), /*!< Status code 4004. Rx frame was dropped since there's no buffer memory. */ - kStatus_ENET_TxFrameBusy = - MAKE_STATUS(kStatusGroup_ENET, 5U), /*!< Status code 4005. There were no resources for Tx operation. */ - kStatus_ENET_TxFrameFail = MAKE_STATUS(kStatusGroup_ENET, 6U), /*!< Status code 4006. Transmit frame failed. */ - kStatus_ENET_TxFrameOverLen = - MAKE_STATUS(kStatusGroup_ENET, 7U) /*!< Status code 4007. Failed to send an oversize frame. */ -}; - -/*! @brief Defines the MII/RMII mode for data interface between the MAC and the PHY. */ -typedef enum _enet_mii_mode -{ - kENET_MiiMode = 0U, /*!< MII mode for data interface. */ - kENET_RmiiMode = 1U /*!< RMII mode for data interface. */ -} enet_mii_mode_t; - -/*! @brief Defines the 10/100 Mbps speed for the MII data interface. */ -typedef enum _enet_mii_speed -{ - kENET_MiiSpeed10M = 0U, /*!< Speed 10 Mbps. */ - kENET_MiiSpeed100M = 1U, /*!< Speed 100 Mbps. */ -} enet_mii_speed_t; - -/*! @brief Defines the half or full duplex for the MII data interface. */ -typedef enum _enet_mii_duplex -{ - kENET_MiiHalfDuplex = 0U, /*!< Half duplex mode. */ - kENET_MiiFullDuplex /*!< Full duplex mode. */ -} enet_mii_duplex_t; - -/*! @brief Define the DMA maximum transmit burst length. */ -typedef enum _enet_dma_burstlen -{ - kENET_BurstLen1 = 0x00001U, /*!< DMA burst length 1. */ - kENET_BurstLen2 = 0x00002U, /*!< DMA burst length 2. */ - kENET_BurstLen4 = 0x00004U, /*!< DMA burst length 4. */ - kENET_BurstLen8 = 0x00008U, /*!< DMA burst length 8. */ - kENET_BurstLen16 = 0x00010U, /*!< DMA burst length 16. */ - kENET_BurstLen32 = 0x00020U, /*!< DMA burst length 32. */ - kENET_BurstLen64 = 0x10008U, /*!< DMA burst length 64. eight times enabled. */ - kENET_BurstLen128 = 0x10010U, /*!< DMA burst length 128. eight times enabled. */ - kENET_BurstLen256 = 0x10020U, /*!< DMA burst length 256. eight times enabled. */ -} enet_dma_burstlen_t; - -/*! @brief Define the flag for the descriptor. */ -typedef enum _enet_desc_flag -{ - kENET_MiddleFlag = 0, /*!< It's a middle descriptor of the frame. */ - kENET_LastFlagOnly, /*!< It's the last descriptor of the frame. */ - kENET_FirstFlagOnly, /*!< It's the first descriptor of the frame. */ - kENET_FirstLastFlag /*!< It's the first and last descriptor of the frame. */ -} enet_desc_flag_t; - -/*! @brief Define the system time adjust operation control. */ -typedef enum _enet_systime_op -{ - kENET_SystimeAdd = 0U, /*!< System time add to. */ - kENET_SystimeSubtract = 1U /*!< System time subtract. */ -} enet_systime_op_t; - -/*! @brief Define the system time rollover control. */ -typedef enum _enet_ts_rollover_type -{ - kENET_BinaryRollover = 0, /*!< System time binary rollover.*/ - kENET_DigitalRollover = 1 /*!< System time digital rollover.*/ -} enet_ts_rollover_type_t; - -/*! @brief Defines some special configuration for ENET. - * - * These control flags are provided for special user requirements. - * Normally, these is no need to set this control flags for ENET initialization. - * But if you have some special requirements, set the flags to specialControl - * in the enet_config_t. - * @note "kENET_StoreAndForward" is recommended to be set when the - * ENET_PTP1588FEATURE_REQUIRED is defined or else the timestamp will be mess-up - * when the overflow happens. - */ -typedef enum _enet_special_config -{ - /***********************DMA CONFGI**********************************************/ - kENET_DescDoubleBuffer = 0x0001U, /*!< The double buffer is used in the Tx/Rx descriptor. */ - /**************************MTL************************************/ - kENET_StoreAndForward = 0x0002U, /*!< The Rx/Tx store and forward enable. */ - /***********************MAC****************************************/ - kENET_PromiscuousEnable = 0x0004U, /*!< The promiscuous enabled. */ - kENET_FlowControlEnable = 0x0008U, /*!< The flow control enabled. */ - kENET_BroadCastRxDisable = 0x0010U, /*!< The broadcast disabled. */ - kENET_MulticastAllEnable = 0x0020U, /*!< All multicast are passed. */ - kENET_8023AS2KPacket = 0x0040U, /*!< 8023as support for 2K packets. */ - kENET_RxChecksumOffloadEnable = 0x0080U, /*!< The Rx checksum offload enabled. */ -} enet_special_config_t; - -/*! @brief List of DMA interrupts supported by the ENET interrupt. This - * enumeration uses one-hot encoding to allow a logical OR of multiple - * members. - */ -typedef enum _enet_dma_interrupt_enable -{ - kENET_DmaTx = ENET_DMA_CH_DMA_CHX_INT_EN_TIE_MASK, /*!< Tx interrupt. */ - kENET_DmaTxStop = ENET_DMA_CH_DMA_CHX_INT_EN_TXSE_MASK, /*!< Tx stop interrupt. */ - kENET_DmaTxBuffUnavail = ENET_DMA_CH_DMA_CHX_INT_EN_TBUE_MASK, /*!< Tx buffer unavailable. */ - kENET_DmaRx = ENET_DMA_CH_DMA_CHX_INT_EN_RIE_MASK, /*!< Rx interrupt. */ - kENET_DmaRxBuffUnavail = ENET_DMA_CH_DMA_CHX_INT_EN_RBUE_MASK, /*!< Rx buffer unavailable. */ - kENET_DmaRxStop = ENET_DMA_CH_DMA_CHX_INT_EN_RSE_MASK, /*!< Rx stop. */ - kENET_DmaRxWatchdogTimeout = ENET_DMA_CH_DMA_CHX_INT_EN_RWTE_MASK, /*!< Rx watchdog timeout. */ - kENET_DmaEarlyTx = ENET_DMA_CH_DMA_CHX_INT_EN_ETIE_MASK, /*!< Early transmit. */ - kENET_DmaEarlyRx = ENET_DMA_CH_DMA_CHX_INT_EN_ERIE_MASK, /*!< Early receive. */ - kENET_DmaBusErr = ENET_DMA_CH_DMA_CHX_INT_EN_FBEE_MASK, /*!< Fatal bus error. */ -} enet_dma_interrupt_enable_t; - -/*! @brief List of mac interrupts supported by the ENET interrupt. This - * enumeration uses one-hot encoding to allow a logical OR of multiple - * members. - */ -typedef enum _enet_mac_interrupt_enable -{ - kENET_MacPmt = (ENET_MAC_INTERRUPT_ENABLE_PMTIE_MASK << ENET_MACINT_ENUM_OFFSET), - kENET_MacTimestamp = (ENET_MAC_INTERRUPT_ENABLE_TSIE_MASK << ENET_MACINT_ENUM_OFFSET), -} enet_mac_interrupt_enable_t; - -/*! @brief Defines the common interrupt event for callback use. */ -typedef enum _enet_event -{ - kENET_RxIntEvent, /*!< Receive interrupt event. */ - kENET_TxIntEvent, /*!< Transmit interrupt event. */ - kENET_WakeUpIntEvent, /*!< Wake up interrupt event. */ - kENET_TimeStampIntEvent, /*!< Time stamp interrupt event. */ -} enet_event_t; - -/*! @brief Define the DMA transmit arbitration for multi-queue. */ -typedef enum _enet_dma_tx_sche -{ - kENET_FixPri = 0, /*!< Fixed priority. channel 0 has lower priority than channel 1. */ - kENET_WeightStrPri, /*!< Weighted(burst length) strict priority. */ - kENET_WeightRoundRobin /*!< Weighted (weight factor) round robin. */ -} enet_dma_tx_sche_t; - -/*! @brief Define the MTL Tx scheduling algorithm for multiple queues/rings. */ -typedef enum _enet_mtl_multiqueue_txsche -{ - kENET_txWeightRR = 0U, /*!< Tx weight round-robin. */ - kENET_txStrPrio = 3U, /*!< Tx strict priority. */ -} enet_mtl_multiqueue_txsche_t; - -/*! @brief Define the MTL Rx scheduling algorithm for multiple queues/rings. */ -typedef enum _enet_mtl_multiqueue_rxsche -{ - kENET_rxStrPrio = 0U, /*!< Tx weight round-robin, Rx strict priority. */ - kENET_rxWeightStrPrio, /*!< Tx strict priority, Rx weight strict priority. */ -} enet_mtl_multiqueue_rxsche_t; - -/*! @brief Define the MTL Rx queue and DMA channel mapping. */ -typedef enum _enet_mtl_rxqueuemap -{ - kENET_StaticDirctMap = 0x100U, /*!< The received fame in Rx Qn(n = 0,1) direclty map to dma channel n. */ - kENET_DynamicMap = - 0x1010U, /*!< The received frame in Rx Qn(n = 0,1) map to the dma channel m(m = 0,1) related with the same Mac. - */ -} enet_mtl_rxqueuemap_t; - -/*! @brief Defines the ENET PTP message related constant. */ -typedef enum _enet_ptp_event_type -{ - kENET_PtpEventMsgType = 3U, /*!< PTP event message type. */ - kENET_PtpSrcPortIdLen = 10U, /*!< PTP message sequence id length. */ - kENET_PtpEventPort = 319U, /*!< PTP event port number. */ - kENET_PtpGnrlPort = 320U /*!< PTP general port number. */ -} enet_ptp_event_type_t; - -/*! @brief Define the Tx checksum offload options. */ -typedef enum _enet_tx_offload -{ - kENET_TxOffloadDisable = 0U, /*!< Disable Tx checksum offload. */ - kENET_TxOffloadIPHeader = 1U, /*!< Enable IP header checksum calculation and insertion. */ - kENET_TxOffloadIPHeaderPlusPayload = 2U, /*!< Enable IP header and payload checksum calculation and insertion. */ - kENET_TxOffloadAll = 3U, /*!< Enable IP header, payload and pseudo header checksum calculation and insertion. */ -} enet_tx_offload_t; - -/*! @brief Ethernet VLAN Tag protocol identifiers. */ -typedef enum _enet_vlan_tpid -{ - kENET_StanCvlan = 0x0U, /*!< C-VLAN 0x8100. */ - kENET_StanSvlan, /*!< S-VLAN 0x88A8. */ -} enet_vlan_tpid_t; - -/*! @brief Ethernet VLAN operations. */ -typedef enum _enet_vlan_ops -{ - kENET_NoOps = 0x0U, /*!< Not do anything. */ - kENET_VlanRemove, /*!< Remove VLAN Tag. */ - kENET_VlanInsert, /*!< Insert VLAN Tag. */ - kENET_VlanReplace, /*!< Replace VLAN Tag. */ -} enet_vlan_ops_t; - -/*! @brief Ethernet VLAN strip setting. */ -typedef enum _enet_vlan_strip -{ - kENET_VlanNotStrip = 0x0U, /*!< Not strip frame. */ - kENET_VlanFilterPassStrip, /*!< Strip if VLAN filter passes. */ - kENET_VlanFilterFailStrip, /*!< Strip if VLAN filter fails. */ - kENET_VlanAlwaysStrip, /*!< Always strip. */ -} enet_vlan_strip_t; - -/*! @brief Ethernet VLAN Tx channels. */ -typedef enum _enet_vlan_tx_channel -{ - kENET_VlanTagAllChannels = 0xFFU, /*!< VLAN tag is inserted for every packets transmitted by the MAC. */ - kENET_VlanTagChannel0 = 0x0U, /*!< VLAN tag is inserted for the frames transmitted by channel 0. */ - kENET_VlanTagChannel1, /*!< VLAN tag is inserted for the frames transmitted by channel 1. */ -} enet_vlan_tx_channel_t; - -/*! @brief Defines the receive descriptor structure - * It has the read-format and write-back format structures. They both - * have the same size with different region definition. So we define - * common name as the recive descriptor structure. When initialize - * the buffer descriptors, read-format region mask bits should be used. - * When Rx frame has been in the buffer descriptors, write-back format - * region store the Rx result information. - */ -typedef struct _enet_rx_bd_struct -{ - __IO uint32_t rdes0; /*!< Receive descriptor 0 */ - __IO uint32_t rdes1; /*!< Receive descriptor 1 */ - __IO uint32_t rdes2; /*!< Receive descriptor 2 */ - __IO uint32_t rdes3; /*!< Receive descriptor 3 */ -} enet_rx_bd_struct_t; - -/*! @brief Defines the transmit descriptor structure - * It has the read-format and write-back format structure. They both - * has the same size with different region definition. So we define - * common name as the transmit descriptor structure. When initialize - * the buffer descriptors for Tx, read-format region mask bits should - * be used. When frame has been transmitted, write-back format region - * store the Tx result information. - */ -typedef struct _enet_tx_bd_struct -{ - __IO uint32_t tdes0; /*!< Transmit descriptor 0 */ - __IO uint32_t tdes1; /*!< Transmit descriptor 1 */ - __IO uint32_t tdes2; /*!< Transmit descriptor 2 */ - __IO uint32_t tdes3; /*!< Transmit descriptor 3 */ -} enet_tx_bd_struct_t; - -/*! @brief Defines the Tx BD configuration structure. */ -typedef struct _enet_tx_bd_config_struct -{ - void *buffer1; /*!< The first buffer address in the descriptor. */ - uint32_t bytes1; /*!< The bytes in the fist buffer. */ - void *buffer2; /*!< The second buffer address in the descriptor. */ - uint32_t bytes2; /*!< The bytes in the second buffer. */ - uint32_t framelen; /*!< The length of the frame to be transmitted. */ - bool intEnable; /*!< Interrupt enable flag. */ - bool tsEnable; /*!< The timestamp enable. */ - enet_tx_offload_t txOffloadOps; /*!< The Tx checksum offload option, only vaild for Queue 0. */ - enet_desc_flag_t flag; /*!< The flag of this tx desciriptor, see "enet_qos_desc_flag". */ - uint8_t slotNum; /*!< The slot number used for AV mode only. */ -} enet_tx_bd_config_struct_t; - -#ifdef ENET_PTP1588FEATURE_REQUIRED -/*! @brief Defines the ENET PTP configuration structure. */ -typedef struct _enet_ptp_config -{ - bool fineUpdateEnable; /*!< Use the fine update. */ - bool ptp1588V2Enable; /*!< ptp 1588 version 2 is used. */ - enet_ts_rollover_type_t tsRollover; /*!< 1588 time nanosecond rollover. */ -} enet_ptp_config_t; -#endif /* ENET_PTP1588FEATURE_REQUIRED */ - -/*! @brief Defines the ENET PTP time stamp structure. */ -typedef struct _enet_ptp_time -{ - uint64_t second; /*!< Second. */ - uint32_t nanosecond; /*!< Nanosecond. */ -} enet_ptp_time_t; - -/*! @brief Defines the Tx reclaim information structure. */ -typedef struct enet_tx_reclaim_info -{ - void *context; /*!< User specified data, could be buffer address for free */ - bool isTsAvail; /*!< Flag indicates timestamp available status */ - enet_ptp_time_t timeStamp; /*!< Timestamp of frame */ -} enet_tx_reclaim_info_t; - -/*! @brief Defines the ENET transmit dirty addresses ring/queue structure. */ -typedef struct _enet_tx_dirty_ring -{ - enet_tx_reclaim_info_t *txDirtyBase; /*!< Dirty buffer descriptor base address pointer. */ - uint16_t txGenIdx; /*!< Tx generate index. */ - uint16_t txConsumIdx; /*!< Tx consume index. */ - uint16_t txRingLen; /*!< Tx ring length. */ - bool isFull; /*!< Tx ring is full flag, add this parameter to avoid waste one element. */ -} enet_tx_dirty_ring_t; - -/*! @brief Defines the buffer descriptor configure structure. - * - * Notes: - * 1. The receive and transmit descriptor start address pointer and tail pointer must be word-aligned. - * 2. The recommended minimum Tx/Rx ring length is 4. - * 3. The Tx/Rx descriptor tail address shall be the address pointer to the address just after the end - * of the last last descriptor. because only the descriptors between the start address and the - * tail address will be used by DMA. - * 4. The decriptor address is the start address of all used contiguous memory. - * for example, the rxDescStartAddrAlign is the start address of rxRingLen contiguous descriptor memorise - * for Rx descriptor ring 0. - * 5. The "*rxBufferstartAddr" is the first element of rxRingLen (2*rxRingLen for double buffers) - * Rx buffers. It means the *rxBufferStartAddr is the Rx buffer for the first descriptor - * the *rxBufferStartAddr + 1 is the Rx buffer for the second descriptor or the Rx buffer for - * the second buffer in the first descriptor. So please make sure the rxBufferStartAddr is the - * address of a rxRingLen or 2*rxRingLen array. - */ -typedef struct _enet_buffer_config -{ - uint8_t rxRingLen; /*!< The length of receive buffer descriptor ring. */ - uint8_t txRingLen; /*!< The length of transmit buffer descriptor ring. */ - enet_tx_bd_struct_t *txDescStartAddrAlign; /*!< Aligned transmit descriptor start address. */ - enet_tx_bd_struct_t *txDescTailAddrAlign; /*!< Aligned transmit descriptor tail address. */ - enet_tx_reclaim_info_t *txDirtyStartAddr; /*!< Start address of the dirty Tx frame information. */ - enet_rx_bd_struct_t *rxDescStartAddrAlign; /*!< Aligned receive descriptor start address. */ - enet_rx_bd_struct_t *rxDescTailAddrAlign; /*!< Aligned receive descriptor tail address. */ - uint32_t *rxBufferStartAddr; /*!< Start address of the Rx buffers. */ - uint32_t rxBuffSizeAlign; /*!< Aligned receive data buffer size. */ -} enet_buffer_config_t; - -/*! @brief Defines the configuration when multi-queue is used. */ -typedef struct enet_multiqueue_config -{ - /***********************DMA block*******************************/ - enet_dma_tx_sche_t dmaTxSche; /*!< Transmit arbitation. */ - enet_dma_burstlen_t burstLen; /*!< Burset len for the queue 1. */ - uint8_t txdmaChnWeight[ENET_RING_NUM_MAX]; /*!< Transmit channel weight. */ - /***********************MTL block*******************************/ - enet_mtl_multiqueue_txsche_t mtltxSche; /*!< Transmit schedule for multi-queue. */ - enet_mtl_multiqueue_rxsche_t mtlrxSche; /*!< Receive schedule for multi-queue. */ - uint8_t rxqueweight[ENET_RING_NUM_MAX]; /*!< Refer to the MTL RxQ Control register. */ - uint32_t txqueweight[ENET_RING_NUM_MAX]; /*!< Refer to the MTL TxQ Quantum Weight register. */ - uint8_t rxqueuePrio[ENET_RING_NUM_MAX]; /*!< Receive queue priority. */ - uint8_t txqueuePrio[ENET_RING_NUM_MAX]; /*!< Refer to Transmit Queue Priority Mapping register. */ - enet_mtl_rxqueuemap_t mtlrxQuemap; /*!< Rx queue DMA Channel mapping. */ -} enet_multiqueue_config_t; - -/*! @brief Defines the Rx memory buffer alloc function pointer. */ -typedef void *(*enet_rx_alloc_callback_t)(ENET_Type *base, void *userData, uint8_t channel); - -/*! @brief Defines the Rx memory buffer free function pointer. */ -typedef void (*enet_rx_free_callback_t)(ENET_Type *base, void *buffer, void *userData, uint8_t channel); - -/*! @brief Defines the basic configuration structure for the ENET device. - * - * Note: - * 1. Default the signal queue is used so the "multiqueueCfg" is set default - * with NULL. Set the pointer with a valid configration pointer if the multiple - * queues are required. If multiple queue is enabled, please make sure the - * buffer configuration for all are prepared also. - */ -typedef struct _enet_config -{ - uint16_t specialControl; /*!< The logicl or of enet_special_config_t */ - uint32_t ptpClkHz; /*!< The PTP module source clock. */ - enet_multiqueue_config_t *multiqueueCfg; /*!< Use both Tx/Rx queue(dma channel) 0 and 1. */ - uint32_t interrupt; /*!< MAC interrupt source. A logical OR of enet_dma_interrupt_enable_t and - enet_mac_interrupt_enable_t. */ - /* -----------------MAC block-------------------------------*/ - enet_mii_mode_t miiMode; /*!< MII mode. */ - enet_mii_speed_t miiSpeed; /*!< MII Speed. */ - enet_mii_duplex_t miiDuplex; /*!< MII duplex. */ - uint16_t pauseDuration; /*!< Used in the Tx flow control frame, only valid when kENET_FlowControlEnable is set. */ - /* -----------------Timestamp-------------------------------*/ -#ifdef ENET_PTP1588FEATURE_REQUIRED - enet_ptp_config_t *ptpConfig; /*!< PTP 1588 feature configuration */ -#endif - /* -----------Rx zero copy buffer management----------------*/ - enet_rx_alloc_callback_t rxBuffAlloc; /*!< Callback to alloc memory, must be provided for zero-copy Rx. */ - enet_rx_free_callback_t rxBuffFree; /*!< Callback to free memory, must be provided for zero-copy Rx. */ -} enet_config_t; - -/* Forward declaration of the handle typedef. */ -typedef struct _enet_handle enet_handle_t; - -/*! @brief ENET callback function. */ -typedef void (*enet_callback_t)(ENET_Type *base, - enet_handle_t *handle, - enet_event_t event, - uint8_t channel, - enet_tx_reclaim_info_t *txReclaimInfo, - void *userData); - -/*! @brief Defines the ENET transmit buffer descriptor ring/queue structure. */ -typedef struct _enet_tx_bd_ring -{ - enet_tx_bd_struct_t *txBdBase; /*!< Buffer descriptor base address pointer. */ - uint16_t txGenIdx; /*!< Tx generate index. */ - uint16_t txConsumIdx; /*!< Tx consum index. */ - volatile uint16_t txDescUsed; /*!< Tx descriptor used number. */ - uint16_t txRingLen; /*!< Tx ring length. */ -} enet_tx_bd_ring_t; - -/*! @brief Defines the ENET receive buffer descriptor ring/queue structure. */ -typedef struct _enet_rx_bd_ring -{ - enet_rx_bd_struct_t *rxBdBase; /*!< Buffer descriptor base address pointer. */ - uint16_t rxGenIdx; /*!< The current available receive buffer descriptor pointer. */ - uint16_t rxRingLen; /*!< Receive ring length. */ - uint32_t rxBuffSizeAlign; /*!< Receive buffer size. */ -} enet_rx_bd_ring_t; - -/*! @brief Defines the ENET handler structure. */ -struct _enet_handle -{ - bool multiQueEnable; /*!< Multi-queue enable status. */ - bool doubleBuffEnable; /*!< The double buffer enable status. */ - bool rxintEnable; /*!< Rx interrupt enable status. */ - enet_rx_bd_ring_t rxBdRing[ENET_RING_NUM_MAX]; /*!< Receive buffer descriptor. */ - enet_tx_bd_ring_t txBdRing[ENET_RING_NUM_MAX]; /*!< Transmit buffer descriptor. */ - enet_tx_dirty_ring_t txDirtyRing[ENET_RING_NUM_MAX]; /*!< Transmit dirty buffers addresses. */ - uint32_t *rxBufferStartAddr[ENET_RING_NUM_MAX]; /*!< The Init-Rx buffers used for reinit corrupted BD due to - write-back operation. */ - uint32_t txLenLimitation[ENET_RING_NUM_MAX]; /*!< Tx frame length limitation. */ - enet_callback_t callback; /*!< Callback function. */ - void *userData; /*!< Callback function parameter.*/ - enet_rx_alloc_callback_t rxBuffAlloc; /*!< Callback to alloc memory, must be provided for zero-copy Rx. */ - enet_rx_free_callback_t rxBuffFree; /*!< Callback to free memory, must be provided for zero-copy Rx. */ -}; - -typedef struct _enet_buffer_struct -{ - void *buffer; /*!< The buffer stores the whole or partial frame. */ - uint16_t length; /*!< The byte length of this buffer. */ -} enet_buffer_struct_t; - -/*! @brief Rx frame attribute structure. */ -typedef struct _enet_rx_frame_attribute_struct -{ - bool isTsAvail; /*!< Rx frame timestamp is available or not. */ - enet_ptp_time_t timestamp; /*!< The nanosecond part timestamp of this Rx frame. */ -} enet_rx_frame_attribute_t; - -/*! @brief Defines the Rx frame error structure. */ -typedef struct _enet_rx_frame_error -{ - bool statsDribbleErr : 1; /*!< The received packet has a non-integer multiple of bytes (odd nibbles). */ - bool statsRxErr : 1; /*!< Receive error. */ - bool statsOverflowErr : 1; /*!< Rx FIFO overflow error. */ - bool statsWatchdogTimeoutErr : 1; /*!< Receive watchdog timeout. */ - bool statsGaintPacketErr : 1; /*!< Receive error. */ - bool statsRxFcsErr : 1; /*!< Receive CRC error. */ -} enet_rx_frame_error_t; - -/*! @brief Defines the Rx frame data structure. */ -typedef struct _enet_rx_frame_struct -{ - enet_buffer_struct_t *rxBuffArray; /*!< Rx frame buffer structure. */ - uint16_t totLen; /*!< Rx frame total length. */ - enet_rx_frame_attribute_t rxAttribute; /*!< Rx frame attribute structure. */ - enet_rx_frame_error_t rxFrameError; /*!< Rx frame error. */ -} enet_rx_frame_struct_t; - -typedef struct _enet_tx_config_struct -{ - uint8_t intEnable : 1; /*!< Enable interrupt every time one BD is completed. */ - uint8_t tsEnable : 1; /*!< Transmit timestamp enable. */ - uint8_t slotNum : 4; /*!< Slot number control bits in AV mode. */ - enet_tx_offload_t txOffloadOps; /*!< Tx checksum offload option. */ -} enet_tx_config_struct_t; - -typedef struct _enet_tx_frame_struct -{ - enet_buffer_struct_t *txBuffArray; /*!< Tx frame buffer structure. */ - uint32_t txBuffNum; /*!< Buffer number of this Tx frame. */ - enet_tx_config_struct_t txConfig; /*!< Tx extra configuation. */ - void *context; /*!< Driver reclaims and gives it in Tx over callback. */ -} enet_tx_frame_struct_t; - -/*! @brief Ethernet VLAN Tag. */ -typedef struct _enet_vlan_tag -{ - enet_vlan_tpid_t tpid; /*!< VLAN TPID. */ - uint16_t pcp : 3; /*!< VLAN Priority. */ - uint16_t dei : 1; /*!< Drop Eligible indicator. */ - uint16_t vid : 12; /*!< VLAN Identifier. */ -} enet_vlan_tag_t; - -/*! @brief Ethernet VLAN configuration for Tx. */ -typedef struct _enet_vlan_tx_config -{ - bool txDescVlan; /*!< Use VLAN configuration in Tx descriptor. */ - enet_vlan_tag_t tag; /*!< VLAN Tag. */ - enet_vlan_ops_t ops; /*!< VLAN operations. */ -} enet_vlan_tx_config_t; - -/*! @brief Ethernet VLAN control. */ -typedef struct _enet_vlan_ctrl -{ - bool svlanEnable : 1; /*!< The MAC transmitter and receiver consider the S-VLAN packets. */ - bool vlanInverseMatch : 1; /*!< True: Marks frames without matching as match, False: Marks matched frames. */ - bool vidComparison : 1; /*!< Only takes VLAN VID as match. */ - bool disableVlanTypeCheck : 1; /*!< Not check C-VLAN and S-VLAN. */ - bool doubleVlanEnable : 1; /*!< Enable the inner VLAN operations. */ - bool innerVlanFilterMatch : 1; /*!< Takes Inner VLAN as match. */ - bool outerTagInRxStatus : 1; /*!< Set outer VLAN in Rx Status. */ - bool innerTagInRxStatus : 1; /*!< Set inner VLAN in Rx Status. */ - enet_vlan_tag_t rxVlanTag; /*!< VLAN tag for Rx match. */ - enet_vlan_strip_t rxOuterVlanStrip; /*!< Outer VLAN Rx strip operation. */ - enet_vlan_strip_t rxInnerVlanStrip; /*!< Inner VLAN Rx strip operation. */ -} enet_vlan_ctrl_t; - -/* Typedef for interrupt handler. */ -typedef void (*enet_isr_t)(ENET_Type *base, enet_handle_t *handle); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to enet clocks for each instance. */ -extern const clock_ip_name_t s_enetClock[]; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and De-initialization - * @{ - */ - -/*! - * @brief Gets the ENET default configuration structure. - * - * The purpose of this API is to get the default ENET configure - * structure for ENET_Init(). User may use the initialized - * structure unchanged in ENET_Init(), or modify some fields of the - * structure before calling ENET_Init(). - * Example: - @code - enet_config_t config; - ENET_GetDefaultConfig(&config); - @endcode - * @param config The ENET mac controller configuration structure pointer. - */ -void ENET_GetDefaultConfig(enet_config_t *config); - -/*! - * @brief Initializes the ENET module. - * - * This function ungates the module clock and initializes it with the ENET basic - * configuration. - * @note As our transactional transmit API use the zero-copy transmit buffer. - * So there are two thing we emphasize here: - * 1. Tx buffer free/requeue for application should be done in the Tx - * interrupt handler. Please set callback: kENET_TxIntEvent with Tx buffer free/requeue - * process APIs. - * 2. The Tx interrupt is forced to open. - * - * @param base ENET peripheral base address. - * @param config ENET mac configuration structure pointer. - * The "enet_config_t" type mac configuration return from ENET_GetDefaultConfig - * can be used directly. It is also possible to verify the Mac configuration using other methods. - * @param macAddr ENET mac address of Ethernet device. This MAC address should be - * provided. - * @param clkSrcHz ENET input reference clock. - */ -void ENET_Init(ENET_Type *base, const enet_config_t *config, uint8_t *macAddr, uint32_t clkSrcHz); - -/*! - * @brief Deinitializes the ENET module. - - * This function gates the module clock and disables the ENET module. - * - * @param base ENET peripheral base address. - */ -void ENET_Deinit(ENET_Type *base); - -/*! - * @brief Initialize for all ENET descriptors. - * - * @note This function finishes all Tx/Rx descriptors initialization. The descriptor initialization - * should be called after ENET_Init(). - * - * @param base ENET peripheral base address. - * @param config The configuration for ENET. - * @param bufferConfig All buffers configuration. - */ -status_t ENET_DescriptorInit(ENET_Type *base, enet_config_t *config, enet_buffer_config_t *bufferConfig); - -/*! - * @brief Allocates Rx buffers for all BDs. - * It's used for zero copy Rx. In zero copy Rx case, Rx buffers are dynamic. This function - * will populate initial buffers in all BDs for receiving. Then ENET_GetRxFrame() is used - * to get Rx frame with zero copy, it will allocate new buffer to replace the buffer in BD taken - * by application, application should free those buffers after they're used. - * - * @note This function should be called after ENET_CreateHandler() and buffer allocating callback - * function should be ready. - * - * @param base ENET peripheral base address. - * @param handle The ENET handler structure. This is the same handler pointer used in the ENET_Init. - */ -status_t ENET_RxBufferAllocAll(ENET_Type *base, enet_handle_t *handle); - -/*! - * @brief Frees Rx buffers in all BDs. - * It's used for zero copy Rx. In zero copy Rx case, Rx buffers are dynamic. This function - * will free left buffers in all BDs. - * - * @param base ENET peripheral base address. - * @param handle The ENET handler structure. This is the same handler pointer used in the ENET_Init. - */ -void ENET_RxBufferFreeAll(ENET_Type *base, enet_handle_t *handle); - -/*! - * @brief Starts the ENET Tx/Rx. - * This function enable the Tx/Rx and starts the Tx/Rx DMA. - * This shall be set after ENET initialization and before - * starting to receive the data. - * - * @param base ENET peripheral base address. - * @param rxRingNum The number of the used Rx rings. It shall not be - * larger than the ENET_RING_NUM_MAX(2). If the ringNum is set with - * 1, the ring 0 will be used. - * @param txRingNum The number of the used Tx rings. It shall not be - * larger than the ENET_RING_NUM_MAX(2). If the ringNum is set with - * 1, the ring 0 will be used. - * - * @note This must be called after all the ENET initilization. - * And should be called when the ENET receive/transmit is required. - */ -void ENET_StartRxTx(ENET_Type *base, uint8_t txRingNum, uint8_t rxRingNum); - -/*! - * @brief Set the second level IRQ handler - * - * @param base ENET peripheral base address. - * @param ISRHandler The handler to install. - */ -void ENET_SetISRHandler(ENET_Type *base, enet_isr_t ISRHandler); - -/* @} */ - -/*! - * @name MII interface operation - * @{ - */ - -/*! - * @brief Sets the ENET MII speed and duplex. - * - * This API is provided to dynamically change the speed and dulpex for MAC. - * - * @param base ENET peripheral base address. - * @param speed The speed of the RMII mode. - * @param duplex The duplex of the RMII mode. - */ -static inline void ENET_SetMII(ENET_Type *base, enet_mii_speed_t speed, enet_mii_duplex_t duplex) -{ - uint32_t reg = base->MAC_CONFIGURATION & ~(ENET_MAC_CONFIGURATION_DM_MASK | ENET_MAC_CONFIGURATION_FES_MASK); - reg |= ENET_MAC_CONFIGURATION_DM(duplex) | ENET_MAC_CONFIGURATION_FES(speed); - - base->MAC_CONFIGURATION = reg; -} - -/*! - * @brief Sets the ENET SMI(serial management interface)- MII management interface. - * - * @param base ENET peripheral base address. - * @param clkSrcHz ENET peripheral clock source. - */ -void ENET_SetSMI(ENET_Type *base, uint32_t clkSrcHz); - -/*! - * @brief Checks if the SMI is busy. - * - * @param base ENET peripheral base address. - * @return The status of MII Busy status. - */ -static inline bool ENET_IsSMIBusy(ENET_Type *base) -{ - return ((base->MAC_MDIO_ADDRESS & ENET_MAC_MDIO_ADDRESS_GB_MASK) != 0U) ? true : false; -} - -/*! - * @brief Reads data from the PHY register through SMI interface. - * - * @param base ENET peripheral base address. - * @return The data read from PHY - */ -static inline uint16_t ENET_ReadSMIData(ENET_Type *base) -{ - return (uint16_t)(base->MAC_MDIO_DATA & ENET_MAC_MDIO_DATA_GD_MASK); -} - -/*! - * @brief Sends the MDIO IEEE802.3 Clause 22 format write command. - * - * @param base ENET peripheral base address. - * @param phyAddr The PHY address. - * @param regAddr The PHY register. - * @param data The data written to PHY. - */ -void ENET_StartSMIWrite(ENET_Type *base, uint8_t phyAddr, uint8_t regAddr, uint16_t data); - -/*! - * @brief Sends the MDIO IEEE802.3 Clause 22 format read command. - * - * @param base ENET peripheral base address. - * @param phyAddr The PHY address. - * @param regAddr The PHY register. - */ -void ENET_StartSMIRead(ENET_Type *base, uint8_t phyAddr, uint8_t regAddr); - -/*! - * @brief MDIO write with IEEE802.3 Clause 22 format. - * - * @param base ENET peripheral base address. - * @param phyAddr The PHY address. - * @param regAddr The PHY register. - * @param data The data written to PHY. - * @return kStatus_Success MDIO access succeeds. - * @return kStatus_Timeout MDIO access timeout. - */ -status_t ENET_MDIOWrite(ENET_Type *base, uint8_t phyAddr, uint8_t regAddr, uint16_t data); - -/*! - * @brief MDIO read with IEEE802.3 Clause 22 format. - * - * @param base ENET peripheral base address. - * @param phyAddr The PHY address. - * @param regAddr The PHY register. - * @param pData The data read from PHY. - * @return kStatus_Success MDIO access succeeds. - * @return kStatus_Timeout MDIO access timeout. - */ -status_t ENET_MDIORead(ENET_Type *base, uint8_t phyAddr, uint8_t regAddr, uint16_t *pData); -/* @} */ - -/*! - * @name Other basic operation - * @{ - */ - -/*! - * @brief Get the ENET instance from peripheral base address. - * - * @param base ENET peripheral base address. - * @return ENET instance. - */ -uint32_t ENET_GetInstance(ENET_Type *base); - -/*! - * @brief Sets the ENET module Mac address. - * - * @param base ENET peripheral base address. - * @param macAddr The six-byte Mac address pointer. - * The pointer is allocated by application and input into the API. - */ -static inline void ENET_SetMacAddr(ENET_Type *base, uint8_t *macAddr) -{ - assert(macAddr); - - uint32_t lowAddress = ((uint32_t)macAddr[3] << 24) | ((uint32_t)macAddr[2] << 16) | ((uint32_t)macAddr[1] << 8) | - ((uint32_t)macAddr[0]); - uint32_t highAddress = ((uint32_t)macAddr[5] << 8) | ((uint32_t)macAddr[4]); - /* Set Macaddr, the MAC address registers are configured to be double-synchronized to the MII clock - domains, then the synchronization is triggered only when bits 31:24 (in little-endian mode) - or bits 7:0 (in Big-Endian mode) of the MAC address low register are written to.*/ - base->MAC_ADDRESS0_HIGH = highAddress; - base->MAC_ADDRESS0_LOW = lowAddress; -} - -/*! - * @brief Gets the ENET module Mac address. - * - * @param base ENET peripheral base address. - * @param macAddr The six-byte Mac address pointer. - * The pointer is allocated by application and input into the API. - */ -void ENET_GetMacAddr(ENET_Type *base, uint8_t *macAddr); - -/*! - * @brief Enable ENET device to accept all multicast frames. - * - * @param base ENET peripheral base address. - */ -static inline void ENET_AcceptAllMulticast(ENET_Type *base) -{ - uint32_t reg = base->MAC_PACKET_FILTER; - - base->MAC_PACKET_FILTER = reg | ENET_MAC_PACKET_FILTER_PM_MASK; -} - -/*! - * @brief ENET device reject to accept all multicast frames. - * - * @param base ENET peripheral base address. - */ -static inline void ENET_RejectAllMulticast(ENET_Type *base) -{ - uint32_t reg = base->MAC_PACKET_FILTER; - - base->MAC_PACKET_FILTER = reg & ~ENET_MAC_PACKET_FILTER_PM_MASK; -} - -/*! - * @brief Set the MAC to enter into power down mode. - * the remote power wake up frame and magic frame can wake up - * the ENET from the power down mode. - * - * @param base ENET peripheral base address. - * @param wakeFilter The wakeFilter provided to configure the wake up frame fitlter. - * Set the wakeFilter to NULL is not required. But if you have the filter requirement, - * please make sure the wakeFilter pointer shall be eight continous - * 32-bits configuration. - */ -void ENET_EnterPowerDown(ENET_Type *base, uint32_t *wakeFilter); - -/*! - * @brief Set the MAC to exit power down mode. - * Eixt from the power down mode and recover to normal work mode. - * - * @param base ENET peripheral base address. - */ -static inline void ENET_ExitPowerDown(ENET_Type *base) -{ - /* Clear and status ans reset the power down. */ - base->MAC_PMT_CONTROL_STATUS &= ~ENET_MAC_PMT_CONTROL_STATUS_PWRDWN_MASK; - - /* Restore the Tx which is disabled when enter power down mode. */ - base->DMA_CH[0].DMA_CHX_TX_CTRL |= ENET_DMA_CH_DMA_CHX_TX_CTRL_ST_MASK; - base->DMA_CH[1].DMA_CHX_TX_CTRL |= ENET_DMA_CH_DMA_CHX_TX_CTRL_ST_MASK; - base->MAC_CONFIGURATION |= ENET_MAC_CONFIGURATION_TE_MASK; -} - -/*! - * @brief Set VLAN control. - * - * @param base ENET peripheral base address. - * @param control VLAN control configuration. - */ -status_t ENET_SetVlanCtrl(ENET_Type *base, enet_vlan_ctrl_t *control); - -/*! - * @brief Set Tx outer VLAN configuration. - * - * @param base ENET peripheral base address. - * @param config Tx VLAN operation configuration. - * @param channel The channel to apply this configuration. - */ -status_t ENET_SetTxOuterVlan(ENET_Type *base, enet_vlan_tx_config_t *config, enet_vlan_tx_channel_t channel); - -/*! - * @brief Set Tx inner VLAN configuration. - * - * @param base ENET peripheral base address. - * @param config Tx VLAN operation configuration. - */ -status_t ENET_SetTxInnerVlan(ENET_Type *base, enet_vlan_tx_config_t *config); - -/* @} */ - -/*! - * @name Interrupts. - * @{ - */ - -/*! - * @brief Enables the ENET DMA and MAC interrupts. - * - * This function enables the ENET interrupt according to the provided mask. The mask - * is a logical OR of enet_dma_interrupt_enable_t and enet_mac_interrupt_enable_t. - * For example, to enable the dma and mac interrupt, do the following. - * @code - * ENET_EnableInterrupts(ENET, kENET_DmaRx | kENET_DmaTx | kENET_MacPmt); - * @endcode - * - * @param base ENET peripheral base address. - * @param mask ENET interrupts to enable. This is a logical OR of both - * enumeration :: enet_dma_interrupt_enable_t and enet_mac_interrupt_enable_t. - */ -void ENET_EnableInterrupts(ENET_Type *base, uint32_t mask); - -/*! - * @brief Disables the ENET DMA and MAC interrupts. - * - * This function disables the ENET interrupt according to the provided mask. The mask - * is a logical OR of enet_dma_interrupt_enable_t and enet_mac_interrupt_enable_t. - * For example, to disable the dma and mac interrupt, do the following. - * @code - * ENET_DisableInterrupts(ENET, kENET_DmaRx | kENET_DmaTx | kENET_MacPmt); - * @endcode - * - * @param base ENET peripheral base address. - * @param mask ENET interrupts to disables. This is a logical OR of both - * enumeration :: enet_dma_interrupt_enable_t and enet_mac_interrupt_enable_t. - */ -void ENET_DisableInterrupts(ENET_Type *base, uint32_t mask); - -/*! - * @brief Gets the ENET DMA interrupt status flag. - * - * @param base ENET peripheral base address. - * @param channel The DMA Channel. Shall not be larger than ENET_RING_NUM_MAX. - * @return The event status of the interrupt source. This is the logical OR of members - * of the enumeration :: enet_dma_interrupt_enable_t. - */ -static inline uint32_t ENET_GetDmaInterruptStatus(ENET_Type *base, uint8_t channel) -{ - return base->DMA_CH[channel].DMA_CHX_STAT; -} - -/*! - * @brief Clear the ENET DMA interrupt status flag. - * - * @param base ENET peripheral base address. - * @param channel The DMA Channel. Shall not be larger than ENET_RING_NUM_MAX. - * @param mask The event status of the interrupt source. This is the logical OR of members - * of the enumeration :: enet_dma_interrupt_enable_t. - */ -static inline void ENET_ClearDmaInterruptStatus(ENET_Type *base, uint8_t channel, uint32_t mask) -{ - /* Clear the dam interrupt status bit in dma channel interrupt status register. */ - base->DMA_CH[channel].DMA_CHX_STAT = mask; -} - -/*! - * @brief Gets the ENET MAC interrupt status flag. - * - * @param base ENET peripheral base address. - * @return The event status of the interrupt source. - * Use the enum in enet_mac_interrupt_enable_t and right shift - * ENET_MACINT_ENUM_OFFSET to mask the returned value to get the - * exact interrupt status. - */ -static inline uint32_t ENET_GetMacInterruptStatus(ENET_Type *base) -{ - return base->MAC_INTERRUPT_STATUS; -} - -/*! - * @brief Clears the ENET mac interrupt events status flag. - * - * This function clears enabled ENET interrupts according to the provided mask. The mask - * is a logical OR of enumeration members. See the @ref enet_mac_interrupt_enable_t. - * For example, to clear the TX frame interrupt and RX frame interrupt, do the following. - * @code - * ENET_ClearMacInterruptStatus(ENET, kENET_MacPmt); - * @endcode - * - * @param base ENET peripheral base address. - * @param mask ENET interrupt source to be cleared. - * This is the logical OR of members of the enumeration :: enet_mac_interrupt_enable_t. - */ -void ENET_ClearMacInterruptStatus(ENET_Type *base, uint32_t mask); - -/* @} */ - -/*! - * @name Functional operation. - * @{ - */ - -/*! - * @brief Get the Tx descriptor DMA Own flag. - * - * @param txDesc The given Tx descriptor. - * @retval True the dma own Tx descriptor, false application own Tx descriptor. - * - */ -static inline bool ENET_IsTxDescriptorDmaOwn(enet_tx_bd_struct_t *txDesc) -{ - return ((txDesc->tdes3 & ENET_TXDESCRIP_RD_OWN_MASK) != 0U) ? true : false; -} - -/*! - * @brief Setup a given Tx descriptor. - * This function is a low level functional API to setup or prepare - * a given Tx descriptor. - * - * @param txDesc The given Tx descriptor. - * @param buffer1 The first buffer address in the descriptor. - * @param bytes1 The bytes in the fist buffer. - * @param buffer2 The second buffer address in the descriptor. - * @param bytes2 The bytes in the second buffer. - * @param framelen The length of the frame to be transmitted. - * @param intEnable Interrupt enable flag. - * @param tsEnable The timestamp enable. - * @param flag The flag of this Tx desciriptor, see "enet_desc_flag_t" . - * @param slotNum The slot num used for AV mode only. - * - * @note This must be called after all the ENET initilization. - * And should be called when the ENET receive/transmit is required. - * Transmit buffers are 'zero-copy' buffers, so the buffer must remain in - * memory until the packet has been fully transmitted. The buffers - * should be free or requeued in the transmit interrupt irq handler. - */ -void ENET_SetupTxDescriptor(enet_tx_bd_struct_t *txDesc, - void *buffer1, - uint32_t bytes1, - void *buffer2, - uint32_t bytes2, - uint32_t framelen, - bool intEnable, - bool tsEnable, - enet_desc_flag_t flag, - uint8_t slotNum); - -/*! - * @brief Update the Tx descriptor tail pointer. - * This function is a low level functional API to update the - * the Tx descriptor tail. - * This is called after you setup a new Tx descriptor to update - * the tail pointer to make the new descritor accessable by DMA. - * - * @param base ENET peripheral base address. - * @param channel The Tx DMA channel. - * @param txDescTailAddrAlign The new Tx tail pointer address. - * - */ -static inline void ENET_UpdateTxDescriptorTail(ENET_Type *base, uint8_t channel, uint32_t txDescTailAddrAlign) -{ - base->DMA_CH[channel].DMA_CHX_TXDESC_TAIL_PTR = txDescTailAddrAlign & ~ENET_ADDR_ALIGNMENT; -} - -/*! - * @brief Update the Rx descriptor tail pointer. - * This function is a low level functional API to update the - * the Rx descriptor tail. - * This is called after you setup a new Rx descriptor to update - * the tail pointer to make the new descritor accessable by DMA - * and to anouse the Rx poll command for DMA. - * - * @param base ENET peripheral base address. - * @param channel The Rx DMA channel. - * @param rxDescTailAddrAlign The new Rx tail pointer address. - * - */ -static inline void ENET_UpdateRxDescriptorTail(ENET_Type *base, uint8_t channel, uint32_t rxDescTailAddrAlign) -{ - base->DMA_CH[channel].DMA_CHX_RXDESC_TAIL_PTR = rxDescTailAddrAlign & ~ENET_ADDR_ALIGNMENT; -} - -/*! - * @brief Gets the context in the ENET Rx descriptor. - * This function is a low level functional API to get the - * the status flag from a given Rx descriptor. - * - * @param rxDesc The given Rx descriptor. - * @retval The RDES3 regions for write-back format Rx buffer descriptor. - * - * @note This must be called after all the ENET initilization. - * And should be called when the ENET receive/transmit is required. - */ -static inline uint32_t ENET_GetRxDescriptor(enet_rx_bd_struct_t *rxDesc) -{ - assert(rxDesc); - - return rxDesc->rdes3; -} -/*! - * @brief Updates the buffers and the own status for a given Rx descriptor. - * This function is a low level functional API to Updates the - * buffers and the own status for a given Rx descriptor. - * - * @param rxDesc The given Rx descriptor. - * @param buffer1 The first buffer address in the descriptor. - * @param buffer2 The second buffer address in the descriptor. - * @param intEnable Interrupt enable flag. - * @param doubleBuffEnable The double buffer enable flag. - * - * @note This must be called after all the ENET initilization. - * And should be called when the ENET receive/transmit is required. - */ -void ENET_UpdateRxDescriptor( - enet_rx_bd_struct_t *rxDesc, void *buffer1, void *buffer2, bool intEnable, bool doubleBuffEnable); - -/* @} */ - -/*! - * @name Transactional operation - * @{ - */ - -/*! - * @brief Create ENET Handler - * - * This is a transactional API and it's provided to store all datas which are needed - * during the whole transactional process. This API should not be used when you use - * functional APIs to do data Tx/Rx. This is funtion will store many data/flag for - * transactional use. - * - * @param base ENET peripheral base address. - * @param handle ENET handler. - * @param config ENET configuration. - * @param bufferConfig ENET buffer configuration. - * @param callback The callback function. - * @param userData The application data. - */ -void ENET_CreateHandler(ENET_Type *base, - enet_handle_t *handle, - enet_config_t *config, - enet_buffer_config_t *bufferConfig, - enet_callback_t callback, - void *userData); - -/*! - * @brief Gets the size of the read frame. - * This function gets a received frame size from the ENET buffer descriptors. - * @note The FCS of the frame is automatically removed by MAC and the size is the length without the FCS. - * After calling ENET_GetRxFrameSize, ENET_ReadFrame() should be called to update the - * receive buffers If the result is not "kStatus_ENET_RxFrameEmpty". - * - * @param base ENET peripheral base address. - * @param handle The ENET handler structure. This is the same handler pointer used in the ENET_Init. - * @param length The length of the valid frame received. - * @param channel The DMAC channel for the Rx. - * @retval kStatus_ENET_RxFrameEmpty No frame received. Should not call ENET_ReadFrame to read frame. - * @retval kStatus_ENET_RxFrameError Data error happens. ENET_ReadFrame should be called with NULL data - * and NULL length to update the receive buffers. - * @retval kStatus_Success Receive a frame Successfully then the ENET_ReadFrame - * should be called with the right data buffer and the captured data length input. - */ -status_t ENET_GetRxFrameSize(ENET_Type *base, enet_handle_t *handle, uint32_t *length, uint8_t channel); - -/*! - * @brief Reads a frame from the ENET device. - * This function reads a frame from the ENET DMA descriptors. - * The ENET_GetRxFrameSize should be used to get the size of the prepared data buffer. - * For example use Rx dma channel 0: - * @code - * uint32_t length; - * enet_handle_t g_handle; - * Comment: Get the received frame size firstly. - * status = ENET_GetRxFrameSize(&g_handle, &length, 0); - * if (length != 0) - * { - * Comment: Allocate memory here with the size of "length" - * uint8_t *data = memory allocate interface; - * if (!data) - * { - * ENET_ReadFrame(ENET, &g_handle, NULL, 0, 0); - * } - * else - * { - * status = ENET_ReadFrame(ENET, &g_handle, data, length, 0); - * } - * } - * else if (status == kStatus_ENET_RxFrameError) - * { - * Comment: Update the received buffer when a error frame is received. - * ENET_ReadFrame(ENET, &g_handle, NULL, 0, 0); - * } - * @endcode - * @param base ENET peripheral base address. - * @param handle The ENET handler structure. This is the same handler pointer used in the ENET_Init. - * @param data The data buffer provided by user to store the frame which memory size should be at least "length". - * @param length The size of the data buffer which is still the length of the received frame. - * @param channel The Rx DMA channel. Shall not be larger than 2. - * @param timestamp The timestamp address to store received timestamp. - * @return The execute status, successful or failure. - */ -status_t ENET_ReadFrame(ENET_Type *base, - enet_handle_t *handle, - uint8_t *data, - uint32_t length, - uint8_t channel, - enet_ptp_time_t *timestamp); - -/*! - * @brief Receives one frame in specified BD ring with zero copy. - * - * This function will use the user-defined allocate and free callback. Every time application gets one frame through - * this function, driver will allocate new buffers for the BDs whose buffers have been taken by application. - * @note This function will drop current frame and update related BDs as available for DMA if new buffers allocating - * fails. Application must provide a memory pool including at least BD number + 1 buffers(+2 if enable double buffer) - * to make this function work normally. - * - * @param base ENET peripheral base address. - * @param handle The ENET handler pointer. This is the same handler pointer used in the ENET_Init. - * @param rxFrame The received frame information structure provided by user. - * @param channel The Rx DMA channel. Shall not be larger than 2. - * @retval kStatus_Success Succeed to get one frame and allocate new memory for Rx buffer. - * @retval kStatus_ENET_RxFrameEmpty There's no Rx frame in the BD. - * @retval kStatus_ENET_RxFrameError There's issue in this receiving. In this function, issue frame will be dropped. - * @retval kStatus_ENET_RxFrameDrop There's no new buffer memory for BD, dropped this frame. - */ -status_t ENET_GetRxFrame(ENET_Type *base, enet_handle_t *handle, enet_rx_frame_struct_t *rxFrame, uint8_t channel); - -/*! - * @brief Transmits an ENET frame. - * @note The CRC is automatically appended to the data. Input the data - * to send without the CRC. This API uses input buffer for Tx, application - * should reclaim the buffer after Tx is over. - * - * @param base ENET peripheral base address. - * @param handle The ENET handler pointer. This is the same handler pointer used in the ENET_Init. - * @param txFrame The Tx frame structure. - * @param channel Channel to send the frame, same with queue index. - * @retval kStatus_Success Send frame succeed. - * @retval kStatus_ENET_TxFrameBusy Transmit buffer descriptor is busy under transmission. - * The transmit busy happens when the data send rate is over the MAC capacity. - * The waiting mechanism is recommended to be added after each call return with kStatus_ENET_TxFrameBusy. - * Also need to pay attention to reclaim Tx frame after Tx is over. - * @retval kStatus_ENET_TxFrameOverLen Transmit frme length exceeds the 0x3FFF limit defined by the driver. - */ -status_t ENET_SendFrame(ENET_Type *base, enet_handle_t *handle, enet_tx_frame_struct_t *txFrame, uint8_t channel); - -/*! - * @brief Reclaim Tx descriptors. - * This function is used to update the Tx descriptor status and - * store the Tx timestamp when the 1588 feature is enabled. - * This is called by the transmit interupt IRQ handler after the - * complete of a frame transmission. - * - * @param base ENET peripheral base address. - * @param handle The ENET handler pointer. This is the same handler pointer used in the ENET_Init. - * @param channel The Tx DMA channnel. - * - */ -void ENET_ReclaimTxDescriptor(ENET_Type *base, enet_handle_t *handle, uint8_t channel); - -/*! - * @brief The ENET IRQ handler. - * - * @param base ENET peripheral base address. - * @param handle The ENET handler pointer. - */ -void ENET_IRQHandler(ENET_Type *base, enet_handle_t *handle); - -/* @} */ - -#ifdef ENET_PTP1588FEATURE_REQUIRED -/*! - * @name ENET Enhanced function operation - * @{ - */ - -/*! - * @brief Coreect the ENET PTP 1588 timer in coarse method. - * - * @param base ENET peripheral base address. - * @param operation The system time operation, refer to "enet_systime_op_t" - * @param second The correction second. - * @param nanosecond The correction nanosecond. - */ -void ENET_Ptp1588CorrectTimerInCoarse(ENET_Type *base, - enet_systime_op_t operation, - uint32_t second, - uint32_t nanosecond); - -/*! - * @brief Coreect the ENET PTP 1588 timer in fine method. - * - * - * @param base ENET peripheral base address. - * @param addend The addend value to be set in the fine method - * @note Should take refer to the chapter "System time corretion" and - * see the description for the "fine correction method". - */ -static inline void ENET_Ptp1588CorrectTimerInFine(ENET_Type *base, uint32_t addend) -{ - /* Set the freqCompensation value. */ - base->MAC_TIMESTAMP_ADDEND = addend; - base->MAC_TIMESTAMP_CONTROL |= ENET_MAC_TIMESTAMP_CONTROL_TSADDREG_MASK; -} - -/*! - * @brief Get the ENET Time stamp current addend value. - * - * @param base ENET peripheral base address. - * @return The addend value. - */ -static inline uint32_t ENET_Ptp1588GetAddend(ENET_Type *base) -{ - return base->MAC_TIMESTAMP_ADDEND; -} - -/*! - * @brief Gets the current ENET time from the PTP 1588 timer. - * Interrupts are not disabled. - * - * @param base ENET peripheral base address. - * @param second The PTP 1588 system timer second. - * @param nanosecond The PTP 1588 system timer nanosecond. - */ -void ENET_Ptp1588GetTimerNoIrqDisable(ENET_Type *base, uint64_t *second, uint32_t *nanosecond); - -/*! - * @brief Gets the current ENET time from the PTP 1588 timer. - * - * @param base ENET peripheral base address. - * @param second The PTP 1588 system timer second. - * @param nanosecond The PTP 1588 system timer nanosecond. - * For the unit of the nanosecond is 1ns. So the nanosecond is the real nanosecond. - */ -void ENET_Ptp1588GetTimer(ENET_Type *base, uint64_t *second, uint32_t *nanosecond); -#endif /* ENET_PTP1588FEATURE_REQUIRED */ -/* @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_ENET_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_erm.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_erm.c deleted file mode 100644 index cdd35b56b09..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_erm.c +++ /dev/null @@ -1,317 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_erm.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.erm" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to ERM bases for each instance. */ -static ERM_Type *const s_ermBases[] = ERM_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to ERM clocks for each instance. */ -static const clock_ip_name_t s_ermClocks[] = ERM_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t ERM_GetInstance(ERM_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_ermBases); instance++) - { - if (s_ermBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_ermBases)); - - return instance; -} - -/*! - * brief ERM module initialization function. - * - * param base ERM base address. - */ -void ERM_Init(ERM_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate ERM clock. */ - CLOCK_EnableClock(s_ermClocks[ERM_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - base->CR0 = 0x00U; -#ifdef ERM_CR1_ENCIE8_MASK - base->CR1 = 0x00U; -#endif - base->SR0 = 0xFFFFFFFFU; -#ifdef ERM_SR1_SBC8_MASK - base->SR1 = 0xFFFFFFFFU; -#endif -} - -/*! - * brief Deinitializes the ERM. - * - */ -void ERM_Deinit(ERM_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate ERM clock. */ - CLOCK_DisableClock(s_ermClocks[ERM_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -uint32_t ERM_GetMemoryErrorAddr(ERM_Type *base, erm_memory_channel_t channel) -{ - uint32_t absoluteErrorAddress = 0x00U; - - switch ((uint8_t)channel) - { - case 0U: - absoluteErrorAddress = base->EAR0; - break; -#ifdef ERM_EAR1_EAR_MASK - case 1U: - absoluteErrorAddress = base->EAR1; - break; -#endif -#ifdef ERM_EAR2_EAR_MASK - case 2U: - absoluteErrorAddress = base->EAR2; - break; -#endif -#ifdef ERM_EAR3_EAR_MASK - case 3U: - absoluteErrorAddress = base->EAR3; - break; -#endif -#ifdef ERM_EAR4_EAR_MASK - case 4U: - absoluteErrorAddress = base->EAR4; - break; -#endif -#ifdef ERM_EAR5_EAR_MASK - case 5U: - absoluteErrorAddress = base->EAR5; - break; -#endif -#ifdef ERM_EAR6_EAR_MASK - case 6U: - absoluteErrorAddress = base->EAR6; - break; -#endif - default: - assert(NULL); - break; - } - - return absoluteErrorAddress; -} - -uint32_t ERM_GetSyndrome(ERM_Type *base, erm_memory_channel_t channel) -{ - uint32_t syndrome = 0x00U; - - switch ((uint8_t)channel) - { - case 0U: - syndrome = (base->SYN0 & ERM_SYN0_SYNDROME_MASK) >> ERM_SYN0_SYNDROME_SHIFT; - break; -#ifdef ERM_SYN1_SYNDROME_MASK - case 1U: - syndrome = (base->SYN1 & ERM_SYN1_SYNDROME_MASK) >> ERM_SYN1_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN2_SYNDROME_MASK - case 2U: - syndrome = (base->SYN2 & ERM_SYN2_SYNDROME_MASK) >> ERM_SYN2_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN3_SYNDROME_MASK - case 3U: - syndrome = (base->SYN3 & ERM_SYN3_SYNDROME_MASK) >> ERM_SYN3_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN4_SYNDROME_MASK - case 4U: - syndrome = (base->SYN4 & ERM_SYN4_SYNDROME_MASK) >> ERM_SYN4_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN5_SYNDROME_MASK - case 5U: - syndrome = (base->SYN5 & ERM_SYN5_SYNDROME_MASK) >> ERM_SYN5_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN6_SYNDROME_MASK - case 6U: - syndrome = (base->SYN6 & ERM_SYN6_SYNDROME_MASK) >> ERM_SYN6_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN7_SYNDROME_MASK - case 7U: - syndrome = (base->SYN7 & ERM_SYN6_SYNDROME_MASK) >> ERM_SYN7_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN8_SYNDROME_MASK - case 8U: - syndrome = (base->SYN8 & ERM_SYN8_SYNDROME_MASK) >> ERM_SYN8_SYNDROME_SHIFT; - break; -#endif -#ifdef ERM_SYN9_SYNDROME_MASK - case 8U: - syndrome = (base->SYN9 & ERM_SYN9_SYNDROME_MASK) >> ERM_SYN9_SYNDROME_SHIFT; - break; -#endif - default: - assert(NULL); - break; - } - - return syndrome; -} - -uint32_t ERM_GetErrorCount(ERM_Type *base, erm_memory_channel_t channel) -{ - uint32_t count = 0x00U; - - switch ((uint8_t)channel) - { - case 0U: - count = (base->CORR_ERR_CNT0 & ERM_CORR_ERR_CNT0_COUNT_MASK) >> ERM_CORR_ERR_CNT0_COUNT_SHIFT; - break; -#ifdef ERM_CORR_ERR_CNT1_COUNT_MASK - case 1U: - count = (base->CORR_ERR_CNT1 & ERM_CORR_ERR_CNT1_COUNT_MASK) >> ERM_CORR_ERR_CNT1_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT2_COUNT_MASK - case 2U: - count = (base->CORR_ERR_CNT2 & ERM_CORR_ERR_CNT2_COUNT_MASK) >> ERM_CORR_ERR_CNT2_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT3_COUNT_MASK - case 3U: - count = (base->CORR_ERR_CNT3 & ERM_CORR_ERR_CNT3_COUNT_MASK) >> ERM_CORR_ERR_CNT3_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT4_COUNT_MASK - case 4U: - count = (base->CORR_ERR_CNT4 & ERM_CORR_ERR_CNT4_COUNT_MASK) >> ERM_CORR_ERR_CNT4_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT5_COUNT_MASK - case 5U: - count = (base->CORR_ERR_CNT5 & ERM_CORR_ERR_CNT5_COUNT_MASK) >> ERM_CORR_ERR_CNT5_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT6_COUNT_MASK - case 6U: - count = (base->CORR_ERR_CNT6 & ERM_CORR_ERR_CNT6_COUNT_MASK) >> ERM_CORR_ERR_CNT6_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT7_COUNT_MASK - case 7U: - count = (base->CORR_ERR_CNT7 & ERM_CORR_ERR_CNT7_COUNT_MASK) >> ERM_CORR_ERR_CNT7_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT8_COUNT_MASK - case 8U: - count = (base->CORR_ERR_CNT8 & ERM_CORR_ERR_CNT8_COUNT_MASK) >> ERM_CORR_ERR_CNT8_COUNT_SHIFT; - break; -#endif -#ifdef ERM_CORR_ERR_CNT9_COUNT_MASK - case 9U: - count = (base->CORR_ERR_CNT9 & ERM_CORR_ERR_CNT9_COUNT_MASK) >> ERM_CORR_ERR_CNT9_COUNT_SHIFT; - break; -#endif - default: - assert(NULL); - break; - } - - return count; -} - -void ERM_ResetErrorCount(ERM_Type *base, erm_memory_channel_t channel) -{ - switch ((uint8_t)channel) - { - case 0U: - base->CORR_ERR_CNT0 = 0x00U; - break; - -#ifdef ERM_CORR_ERR_CNT1_COUNT_MASK - case 1U: - base->CORR_ERR_CNT1 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT2_COUNT_MASK - case 2U: - base->CORR_ERR_CNT2 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT3_COUNT_MASK - case 3U: - base->CORR_ERR_CNT3 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT4_COUNT_MASK - case 4U: - base->CORR_ERR_CNT4 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT5_COUNT_MASK - case 5U: - base->CORR_ERR_CNT5 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT6_COUNT_MASK - case 6U: - base->CORR_ERR_CNT6 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT6_COUNT_MASK - case 7U: - base->CORR_ERR_CNT7 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT8_COUNT_MASK - case 8U: - base->CORR_ERR_CNT8 = 0x00U; - break; -#endif -#ifdef ERM_CORR_ERR_CNT9_COUNT_MASK - case 9U: - base->CORR_ERR_CNT9 = 0x00U; - break; -#endif - default: - assert(NULL); - break; - } -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_erm.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_erm.h deleted file mode 100644 index 45303523e76..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_erm.h +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_ERM_H_ -#define FSL_ERM_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup erm - * @{ - */ - -/****************************************************************************** - * Definitions. - *****************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief Driver version. */ -#define FSL_ERM_DRIVER_VERSION (MAKE_VERSION(2U, 0U, 1U)) -/*! @} */ - -/*! - * @brief ERM interrupt configuration structure, default settings all disabled, _erm_interrupt_enable. - * - * This structure contains the settings for all of the ERM interrupt configurations. - */ -enum -{ - kERM_SingleCorrectionIntEnable = 0x08U, /*!< Single Correction Interrupt Notification enable.*/ - kERM_NonCorrectableIntEnable = 0x04U, /*!< Non-Correction Interrupt Notification enable.*/ - - kERM_AllInterruptsEnable = 0xFFFFFFFFUL, /*!< All Interrupts enable */ -}; - -/*! - * @brief ERM interrupt status, _erm_interrupt_flag. - * - * This provides constants for the ERM event status for use in the ERM functions. - */ -enum -{ - kERM_SingleBitCorrectionIntFlag = 0x08U, /*!< Single-Bit Correction Event.*/ - kERM_NonCorrectableErrorIntFlag = 0x04U, /*!< Non-Correctable Error Event.*/ - - kERM_AllIntsFlag = 0xFFFFFFFFUL, /*!< All Events. */ -}; - -/******************************************************************************* - * APIs - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and de-initialization - * @{ - */ - -/*! - * @brief ERM module initialization function. - * - * @param base ERM base address. - */ -void ERM_Init(ERM_Type *base); - -/*! - * @brief De-initializes the ERM. - * - */ -void ERM_Deinit(ERM_Type *base); - -/*! @} */ - -/*! - * @name Interrupt - * @{ - */ -/*! - * @brief ERM enable interrupts. - * - * @param base ERM peripheral base address. - * @param channel memory channel. - * @param mask single correction interrupt or non-correction interrupt enable to disable for one specific memory region. - * Refer to "_erm_interrupt_enable" enumeration. - */ -static inline void ERM_EnableInterrupts(ERM_Type *base, erm_memory_channel_t channel, uint32_t mask) -{ - uint32_t temp = 0x00U; - if ((uint32_t)channel <= 0x07U) - { - temp = base->CR0; - base->CR0 = - (temp & ~(0x0CUL << ((0x07U - (uint32_t)channel) * 4U))) | (mask << ((0x07U - (uint32_t)channel) * 4U)); - } -#ifdef ERM_CR1_ESCIE8_MASK - else - { - temp = base->CR1; - base->CR1 = (temp & ~(0x0CUL << ((0x07U + 0x08U - (uint32_t)channel) * 4U))) | - (mask << ((0x07U + 0x08U - (uint32_t)channel) * 4U)); - } -#endif -} - -/*! - * @brief ERM module disable interrupts. - * - * @param base ERM base address. - * @param channel memory channel. - * @param mask single correction interrupt or non-correction interrupt enable to disable for one specific memory region. - * Refer to "_erm_interrupt_enable" enumeration. - */ -static inline void ERM_DisableInterrupts(ERM_Type *base, erm_memory_channel_t channel, uint32_t mask) -{ - if ((uint32_t)channel <= 0x07U) - { - base->CR0 &= ~(mask << ((0x07U - (uint32_t)channel) * 4U)); - } -#ifdef ERM_CR1_ESCIE8_MASK - else - { - base->CR1 &= ~(mask << ((0x07U + 0x08U - (uint32_t)channel) * 4U)); - } -#endif -} - -/*! - * @brief Gets ERM interrupt flags. - * - * @param base ERM peripheral base address. - * @return ERM event flags. - */ -static inline uint32_t ERM_GetInterruptStatus(ERM_Type *base, erm_memory_channel_t channel) -{ - if ((uint32_t)channel <= 0x07U) - { - return ((base->SR0 & (uint32_t)kERM_AllIntsFlag) >> (0x07U - (uint32_t)channel) * 4U); - } -#ifdef ERM_SR1_SBC8_MASK - else - { - return ((base->SR1 & (uint32_t)kERM_AllIntsFlag) >> ((0x07U + 0x08U - (uint32_t)channel) * 4U)); - } -#else - { - return 0; - } -#endif -} - -/*! - * @brief ERM module clear interrupt status flag. - * - * @param base ERM base address. - * @param mask event flag to clear. Refer to "_erm_interrupt_flag" enumeration. - */ -static inline void ERM_ClearInterruptStatus(ERM_Type *base, erm_memory_channel_t channel, uint32_t mask) -{ - if ((uint32_t)channel <= 0x07U) - { - base->SR0 = mask << ((0x07U - (uint32_t)channel) * 4U); - } -#ifdef ERM_SR1_SBC8_MASK - else - { - base->SR1 = mask << ((0x07U + 0x08U - (uint32_t)channel) * 4U); - } -#endif -} - -/*! @} */ - -/*! - * @name functional - * @{ - */ - -/*! - * @brief ERM get memory error absolute address, which capturing the address of the last ECC event in Memory n. - * - * @param base ERM base address. - * @param channel memory channel. - * @retval memory error absolute address. - */ - -uint32_t ERM_GetMemoryErrorAddr(ERM_Type *base, erm_memory_channel_t channel); - -/*! - * @brief ERM get syndrome, which identifies the pertinent bit position on a correctable, single-bit data inversion or a - * non-correctable, single-bit address inversion. The syndrome value does not provide any additional diagnostic - * information on non-correctable, multi-bit inversions. - * - * @param base ERM base address. - * @param channel memory channel. - * @retval syndrome value. - */ -uint32_t ERM_GetSyndrome(ERM_Type *base, erm_memory_channel_t channel); - -/*! - * @brief ERM get error count, which records the count value of the number of correctable ECC error events for Memory - * n. Non-correctable errors are considered a serious fault, so the ERM does not provide any mechanism to count - * non-correctable errors. Only correctable errors are counted. - * - * @param base ERM base address. - * @param channel memory channel. - * @retval error count. - */ -uint32_t ERM_GetErrorCount(ERM_Type *base, erm_memory_channel_t channel); - -/*! - * @brief ERM reset error count. - * - * @param base ERM base address. - * @param channel memory channel. - */ -void ERM_ResetErrorCount(ERM_Type *base, erm_memory_channel_t channel); - -/*! @}*/ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_evtg.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_evtg.c deleted file mode 100644 index 7402c428d39..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_evtg.c +++ /dev/null @@ -1,418 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_evtg.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.evtg" -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Initialize EVTG with a user configuration structure. - * - * param base EVTG base address. - * param evtgIndex EVTG instance index. - * param psConfig EVTG initial configuration structure pointer. - */ -void EVTG_Init(EVTG_Type *base, evtg_index_t evtgIndex, evtg_config_t *psConfig) -{ - /* Configure Flip-Flop as expected mode. */ - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_CTRL = EVTG_EVTG_INST_EVTG_CTRL_MODE_SEL((uint16_t)psConfig->flipflopMode); - - if (kEVTG_FFModeJKFF == psConfig->flipflopMode) - { - /* When FF Mode is configured as JK-FF mode, need EVTG_OUTA feedback to EVTG input and replace one of the four - * inputs.*/ - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_CTRL |= - EVTG_EVTG_INST_EVTG_CTRL_FB_OVRD((uint16_t)psConfig->outfdbkOverideinput); - } - - if (psConfig->enableFlipflopInitOutput == true) - { - EVTG_ForceFlipflopInitOutput(base, evtgIndex, psConfig->flipflopInitOutputValue); - } - -#if defined(FSL_FEATURE_EVTG_HAS_FORCE_BYPASS_FLIPFLOP) && FSL_FEATURE_EVTG_HAS_FORCE_BYPASS_FLIPFLOP - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_CTRL |= EVTG_EVTG_INST_EVTG_CTRL_FORCE_BYPASS( - ((uint16_t)psConfig->enableForceBypassFlipFlopAOI1 << 1U) | (uint16_t)psConfig->enableForceBypassFlipFlopAOI0); -#endif - - /* Configure EVTG input sync. */ - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_CTRL |= EVTG_EVTG_INST_EVTG_CTRL_SYNC_CTRL( - (((uint16_t)psConfig->enableInputDSync << 3U) | ((uint16_t)psConfig->enableInputCSync << 2U) | - ((uint16_t)psConfig->enableInputBSync << 1U) | ((uint16_t)psConfig->enableInputASync))); - - /* Configure AOI0. */ - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI0_BFT01 = - (EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_AC((uint8_t)psConfig->aoi0Config.productTerm0.aInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_BC((uint8_t)psConfig->aoi0Config.productTerm0.bInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_CC((uint8_t)psConfig->aoi0Config.productTerm0.cInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_DC((uint8_t)psConfig->aoi0Config.productTerm0.dInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_AC((uint8_t)psConfig->aoi0Config.productTerm1.aInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_BC((uint8_t)psConfig->aoi0Config.productTerm1.bInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_CC((uint8_t)psConfig->aoi0Config.productTerm1.cInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_DC((uint8_t)psConfig->aoi0Config.productTerm1.dInput)); - - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI0_BFT23 = - (EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_AC((uint8_t)psConfig->aoi0Config.productTerm2.aInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_BC((uint8_t)psConfig->aoi0Config.productTerm2.bInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_CC((uint8_t)psConfig->aoi0Config.productTerm2.cInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_DC((uint8_t)psConfig->aoi0Config.productTerm2.dInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_AC((uint8_t)psConfig->aoi0Config.productTerm3.aInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_BC((uint8_t)psConfig->aoi0Config.productTerm3.bInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_CC((uint8_t)psConfig->aoi0Config.productTerm3.cInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_DC((uint8_t)psConfig->aoi0Config.productTerm3.dInput)); - - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI0_FILT |= - (EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_CNT((uint16_t)psConfig->aoi0Config.aoiOutFilterConfig.sampleCount) | - EVTG_EVTG_INST_EVTG_AOI0_FILT_FILT_PER(psConfig->aoi0Config.aoiOutFilterConfig.samplePeriod)); - - /* Configure AOI1. */ - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI1_BFT01 = - (EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_AC((uint8_t)psConfig->aoi1Config.productTerm0.aInput) | - EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_BC((uint8_t)psConfig->aoi1Config.productTerm0.bInput) | - EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_CC((uint8_t)psConfig->aoi1Config.productTerm0.cInput) | - EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT0_DC((uint8_t)psConfig->aoi1Config.productTerm0.dInput) | - EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_AC((uint8_t)psConfig->aoi1Config.productTerm1.aInput) | - EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_BC((uint8_t)psConfig->aoi1Config.productTerm1.bInput) | - EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_CC((uint8_t)psConfig->aoi1Config.productTerm1.cInput) | - EVTG_EVTG_INST_EVTG_AOI1_BFT01_PT1_DC((uint8_t)psConfig->aoi1Config.productTerm1.dInput)); - - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI1_BFT23 = - (EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_AC((uint8_t)psConfig->aoi1Config.productTerm2.aInput) | - EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_BC((uint8_t)psConfig->aoi1Config.productTerm2.bInput) | - EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_CC((uint8_t)psConfig->aoi1Config.productTerm2.cInput) | - EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT2_DC((uint8_t)psConfig->aoi1Config.productTerm2.dInput) | - EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_AC((uint8_t)psConfig->aoi1Config.productTerm3.aInput) | - EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_BC((uint8_t)psConfig->aoi1Config.productTerm3.bInput) | - EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_CC((uint8_t)psConfig->aoi1Config.productTerm3.cInput) | - EVTG_EVTG_INST_EVTG_AOI1_BFT23_PT3_DC((uint8_t)psConfig->aoi1Config.productTerm3.dInput)); - - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI1_FILT |= - (EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_CNT((uint16_t)psConfig->aoi1Config.aoiOutFilterConfig.sampleCount) | - EVTG_EVTG_INST_EVTG_AOI1_FILT_FILT_PER(psConfig->aoi1Config.aoiOutFilterConfig.samplePeriod)); -} - -/*! - * brief Configure AOI product term by initializing the product term - * configuration structure. - * - * param base EVTG base address. - * param evtgIndex EVTG instance index. - * param aoiIndex EVTG AOI index. see enum ref evtg_aoi_index_t - * param productTerm EVTG AOI product term index. - * param psProductTermConfig Pointer to EVTG product term configuration structure. - * see ref _evtg_product_term_config - */ -void EVTG_ConfigAOIProductTerm(EVTG_Type *base, - evtg_index_t evtgIndex, - evtg_aoi_index_t aoiIndex, - evtg_aoi_product_term_t productTerm, - evtg_aoi_product_term_config_t *psProductTermConfig) -{ - volatile uint16_t *pu16AOIPT01Config; - volatile uint16_t *pu16AOIPT23Config; - - if (kEVTG_AOI0 == aoiIndex) - { - pu16AOIPT01Config = &base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI0_BFT01; - pu16AOIPT23Config = &base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI0_BFT23; - } - else - { - pu16AOIPT01Config = &base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI1_BFT01; - pu16AOIPT23Config = &base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI1_BFT23; - } - - if (kEVTG_ProductTerm0 == productTerm) - { - *pu16AOIPT01Config &= - ~(uint16_t)(EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_AC_MASK | EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_BC_MASK | - EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_CC_MASK | EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_DC_MASK); - *pu16AOIPT01Config |= (EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_AC((uint8_t)psProductTermConfig->aInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_BC((uint8_t)psProductTermConfig->bInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_CC((uint8_t)psProductTermConfig->cInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT0_DC((uint8_t)psProductTermConfig->dInput)); - } - else if (kEVTG_ProductTerm1 == productTerm) - { - *pu16AOIPT01Config &= - ~(uint16_t)(EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_AC_MASK | EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_BC_MASK | - EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_CC_MASK | EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_DC_MASK); - *pu16AOIPT01Config |= (EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_AC((uint8_t)psProductTermConfig->aInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_BC((uint8_t)psProductTermConfig->bInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_CC((uint8_t)psProductTermConfig->cInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT01_PT1_DC((uint8_t)psProductTermConfig->dInput)); - } - else if (kEVTG_ProductTerm2 == productTerm) - { - *pu16AOIPT23Config &= - ~(uint16_t)(EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_AC_MASK | EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_BC_MASK | - EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_CC_MASK | EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_DC_MASK); - *pu16AOIPT23Config |= (EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_AC((uint8_t)psProductTermConfig->aInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_BC((uint8_t)psProductTermConfig->bInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_CC((uint8_t)psProductTermConfig->cInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT2_DC((uint8_t)psProductTermConfig->dInput)); - } - else - { - *pu16AOIPT23Config &= - ~(uint16_t)(EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_AC_MASK | EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_BC_MASK | - EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_CC_MASK | EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_DC_MASK); - *pu16AOIPT23Config |= (EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_AC((uint8_t)psProductTermConfig->aInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_BC((uint8_t)psProductTermConfig->bInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_CC((uint8_t)psProductTermConfig->cInput) | - EVTG_EVTG_INST_EVTG_AOI0_BFT23_PT3_DC((uint8_t)psProductTermConfig->dInput)); - } -} - -/*! - * @brief Loads default values to the EVTG configuration structure. - * - * The purpose of this API is to initialize the configuration structure to default value for @ref EVTG_Init() - * to use. - * The Flip-Flop can be configured as Bypass mode, RS trigger mode, T-FF mode, D-FF mode, JK-FF mode, Latch mode. - * Please check RM INTC chapter for more details. - * - * @param psConfig EVTG initial configuration structure pointer. - * @param flipflopMode EVTG flip flop mode. see @ ref _evtg_flipflop_mode - */ -void EVTG_GetDefaultConfig(evtg_config_t *psConfig, evtg_flipflop_mode_t flipflopMode) -{ - /* Initializes the configure structure to zero. */ - (void)memset(psConfig, 0, sizeof(evtg_config_t)); - - switch (flipflopMode) - { - case kEVTG_FFModeBypass: - - /* - * In this mode, filp-flop will be passed, The two AOI expressions "AOI_0" and "AOI_1" - * will be directly assigned to EVTG outputs(EVTG_OUTA and EVTG_OUTB). - * - * In this mode, user can choose to enable or disable input sync logic and filter function. - * Here disable both input sync logic and filter function. - */ - psConfig->flipflopMode = kEVTG_FFModeBypass; - - psConfig->enableInputASync = false; - psConfig->enableInputBSync = false; - psConfig->enableInputCSync = false; - psConfig->enableInputDSync = false; - - break; - - case kEVTG_FFModeRSTrigger: - - /* - * In this mode, AOI_0 expression is Reset port, and AOI_1 is Set port. Both are active - * high. When "R"(Reset) is high, whatever "S"(Set) is, EVTG_OUTA will be "0". When "R" is - * low and "S" is high, EVTG_OUTA will be "1". If both "R" and "S" are low, EVTG output - * will be kept. EVTG_OUTB is always the complement of EVTG_OUTA. - * - * In this mode, user can choose to enable or disable input sync logic and filter function. - * Here disable both input sync logic and filter function. - */ - psConfig->flipflopMode = kEVTG_FFModeRSTrigger; - - psConfig->enableInputASync = false; - psConfig->enableInputBSync = false; - psConfig->enableInputCSync = false; - psConfig->enableInputDSync = false; - - break; - - case kEVTG_FFModeTFF: - - /* - * In this mode, AOI_0 expression is T port of T-FF, AOI_1 is CLK port. When T assert, - * the Q port (EVTG_OUTA) will turnover at the rising edge of "CLK". When T dis-assert, - * Q(EVTG_OUTA) will be kept. EVTG_OUTB is always the complement of EVTG_OUTA. - * - * In this mode, input sync or filter has to be enabled to remove the possible glitch. - * Here input sync is enabled, filter is disabled. User could override corresponding fields - * depends on the actual user case to choose to enable or disable input sync logic and filter - * function. - */ - psConfig->flipflopMode = kEVTG_FFModeTFF; - - psConfig->enableInputASync = true; - psConfig->enableInputBSync = true; - psConfig->enableInputCSync = true; - psConfig->enableInputDSync = true; - - break; - - case kEVTG_FFModeJKFF: - - /* - * In general, JK Flip-Flop have four input ports: J, K , Q and CLK(Q is output of Flip-Flop). - * And the logical expression is J&~Q | ~K&Q; Here we implement the logic expression by AOI - * so that we can reuse the D-FF to implement JK-FF. Suppose we set EVTG input "An" as "J" port, - * "Cn" as "K" port, "Dn" as "CLK" port, and "Q" port of FF feed back and override "Bn". - * According to the JK logic expression, the AOI_0 expression will be "An&~Bn | Bn&~Cn", - * AOI_1 expression will be "Dn". - * - * In this mode, input sync or filter has to be enabled to remove the possible glitch. - * Here input sync is enabled, filter is disabled. User could override corresponding fields - * depends on the actual user case to choose to enable or disable input sync logic and filter - * function. - * - * When FF Mode is configured as JK-FF mode, need EVTG_OUTA feedback to EVTG input and replace - * one of the four inputs. Here input Bn is replaced, represents which EVTG input(EVTG_OUTA) - * is replaced by FF output. - */ - psConfig->flipflopMode = kEVTG_FFModeJKFF; - psConfig->outfdbkOverideinput = kEVTG_OutputOverrideInputB; - - psConfig->enableInputASync = true; - psConfig->enableInputBSync = true; - psConfig->enableInputCSync = true; - psConfig->enableInputDSync = true; - - break; - - case kEVTG_FFModeLatch: - - /* - * In this mode, AOI_0 expression is D port, AOI_1 is CLK port. Different from D-FF - * mode, in Latch mode, D port will be passed only when CLK is high, and output will be - * kept when CLK is low. EVTG_OUTB is always the complement of EVTG_OUTA. - * - * In this mode, input sync or filter has to be enabled to remove the possible glitch. - * Here input sync is enabled, filter is disabled. User could override corresponding fields - * depends on the actual user case to choose to enable or disable input sync logic and filter - * function. - */ - psConfig->flipflopMode = kEVTG_FFModeLatch; - - psConfig->enableInputASync = true; - psConfig->enableInputBSync = true; - psConfig->enableInputCSync = true; - psConfig->enableInputDSync = true; - - break; - - default: - assert(false); - break; - } - /* User could choose to enable or disable Flip-flop initial output value. */ - psConfig->enableFlipflopInitOutput = false; - psConfig->flipflopInitOutputValue = kEVTG_FFInitOut0; - - /* User could choose to override this fields to enable filter function. */ - psConfig->aoi0Config.aoiOutFilterConfig.sampleCount = kEVTG_AOIOutFilterSampleCount3; - psConfig->aoi0Config.aoiOutFilterConfig.samplePeriod = 0U; - - psConfig->aoi1Config.aoiOutFilterConfig.sampleCount = kEVTG_AOIOutFilterSampleCount3; - psConfig->aoi1Config.aoiOutFilterConfig.samplePeriod = 0U; - -#if defined(FSL_FEATURE_EVTG_HAS_FORCE_BYPASS_FLIPFLOP) && FSL_FEATURE_EVTG_HAS_FORCE_BYPASS_FLIPFLOP - psConfig->enableForceBypassFlipFlopAOI0 = false; - psConfig->enableForceBypassFlipFlopAOI1 = false; -#endif - - /* - * For JK-FF Mode, Here we implement the logic expression by AOI so that we can reuse the - * D-FF to implement JK-FF. Suppose we set EVTG input "An" as "J" port, "Cn" as "K" port, "Dn" - * as "CLK" port, and "Q" port of FF feed back and override "Bn". According to the JK logic - * expression, the AOI_0 expression will be "An&~Bn | Bn&~Cn", AOI_1 expression will be "Dn". - * - * For other FF Mode, the default input here is logical 0. User can configure to produce a logical 0 - * or 1 or pass the true or complement of the selected event input according to their requirement. - */ - if (kEVTG_FFModeJKFF == flipflopMode) - { - psConfig->aoi0Config.productTerm0.aInput = kEVTG_InputDirectPass; - psConfig->aoi0Config.productTerm0.bInput = kEVTG_InputComplement; - psConfig->aoi0Config.productTerm0.cInput = kEVTG_InputLogicOne; - psConfig->aoi0Config.productTerm0.dInput = kEVTG_InputLogicOne; - - psConfig->aoi0Config.productTerm1.aInput = kEVTG_InputLogicOne; - psConfig->aoi0Config.productTerm1.bInput = kEVTG_InputDirectPass; - psConfig->aoi0Config.productTerm1.cInput = kEVTG_InputComplement; - psConfig->aoi0Config.productTerm1.dInput = kEVTG_InputLogicOne; - - psConfig->aoi0Config.productTerm2.aInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm2.bInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm2.cInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm2.dInput = kEVTG_InputLogicZero; - - psConfig->aoi0Config.productTerm3.aInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm3.bInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm3.cInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm3.dInput = kEVTG_InputLogicZero; - - psConfig->aoi1Config.productTerm0.aInput = kEVTG_InputLogicOne; - psConfig->aoi1Config.productTerm0.bInput = kEVTG_InputLogicOne; - psConfig->aoi1Config.productTerm0.cInput = kEVTG_InputLogicOne; - psConfig->aoi1Config.productTerm0.dInput = kEVTG_InputDirectPass; - - psConfig->aoi1Config.productTerm1.aInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm1.bInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm1.cInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm1.dInput = kEVTG_InputLogicZero; - - psConfig->aoi1Config.productTerm2.aInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm2.bInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm2.cInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm2.dInput = kEVTG_InputLogicZero; - - psConfig->aoi1Config.productTerm3.aInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm3.bInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm3.cInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm3.dInput = kEVTG_InputLogicZero; - } - else - { - psConfig->aoi0Config.productTerm0.aInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm0.bInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm0.cInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm0.dInput = kEVTG_InputLogicZero; - - psConfig->aoi0Config.productTerm1.aInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm1.bInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm1.cInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm1.dInput = kEVTG_InputLogicZero; - - psConfig->aoi0Config.productTerm2.aInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm2.bInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm2.cInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm2.dInput = kEVTG_InputLogicZero; - - psConfig->aoi0Config.productTerm3.aInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm3.bInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm3.cInput = kEVTG_InputLogicZero; - psConfig->aoi0Config.productTerm3.dInput = kEVTG_InputLogicZero; - - psConfig->aoi1Config.productTerm0.aInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm0.bInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm0.cInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm0.dInput = kEVTG_InputLogicZero; - - psConfig->aoi1Config.productTerm1.aInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm1.bInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm1.cInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm1.dInput = kEVTG_InputLogicZero; - - psConfig->aoi1Config.productTerm2.aInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm2.bInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm2.cInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm2.dInput = kEVTG_InputLogicZero; - - psConfig->aoi1Config.productTerm3.aInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm3.bInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm3.cInput = kEVTG_InputLogicZero; - psConfig->aoi1Config.productTerm3.dInput = kEVTG_InputLogicZero; - } -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_evtg.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_evtg.h deleted file mode 100644 index 106cd53bab2..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_evtg.h +++ /dev/null @@ -1,355 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_EVTG_H_ -#define FSL_EVTG_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup evtg - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief EVTG driver version. */ -#define FSL_EVTG_DRIVER_VERSION (MAKE_VERSION(2, 0, 1)) /*!< Version 2.0.1. */ -/*! @} */ - -/*! @brief EVTG instance index. */ -typedef enum _evtg_index -{ - kEVTG_Index0 = 0x0U, /*!< EVTG instance index 0. */ - kEVTG_Index1, /*!< EVTG instance index 1. */ - kEVTG_Index2, /*!< EVTG instance index 2. */ - kEVTG_Index3, /*!< EVTG instance index 3. */ -} evtg_index_t; - -/*! @brief EVTG input index. */ -typedef enum _evtg_input_index -{ - kEVTG_InputA = 0x0U, /*!< EVTG input A. */ - kEVTG_InputB, /*!< EVTG input B. */ - kEVTG_InputC, /*!< EVTG input C. */ - kEVTG_InputD, /*!< EVTG input D. */ -} evtg_input_index_t; - -/*! @brief EVTG AOI index. */ -typedef enum _evtg_aoi_index -{ - kEVTG_AOI0 = 0x0U, /*!< EVTG AOI index 0. */ - kEVTG_AOI1 = 0x1U, /*!< EVTG AOI index 1. */ -} evtg_aoi_index_t; - -/*! @brief EVTG AOI product term index. */ -typedef enum _evtg_aoi_product_term -{ - kEVTG_ProductTerm0 = 0x0U, /*!< EVTG AOI product term index 0. */ - kEVTG_ProductTerm1, /*!< EVTG AOI product term index 1. */ - kEVTG_ProductTerm2, /*!< EVTG AOI product term index 2. */ - kEVTG_ProductTerm3, /*!< EVTG AOI product term index 3. */ -} evtg_aoi_product_term_t; - -/*! @brief EVTG input configuration. */ -typedef enum _evtg_aoi_input_config -{ - kEVTG_InputLogicZero = 0x0U, /*!< Force input in product term to a logical zero. */ - kEVTG_InputDirectPass, /*!< Pass input in product term. */ - kEVTG_InputComplement, /*!< Complement input in product term. */ - kEVTG_InputLogicOne, /*!< Force input in product term to a logical one. */ -} evtg_aoi_input_config_t; - -/*! @brief EVTG AOI Output Filter Sample Count. */ -typedef enum _evtg_aoi_outfilter_count -{ - kEVTG_AOIOutFilterSampleCount3 = 0x0U, /*!< EVTG AOI output filter sample count is 3. */ - kEVTG_AOIOutFilterSampleCount4, /*!< EVTG AOI output filter sample count is 4. */ - kEVTG_AOIOutFilterSampleCount5, /*!< EVTG AOI output filter sample count is 5. */ - kEVTG_AOIOutFilterSampleCount6, /*!< EVTG AOI output filter sample count is 6. */ - kEVTG_AOIOutFilterSampleCount7, /*!< EVTG AOI output filter sample count is 7. */ - kEVTG_AOIOutFilterSampleCount8, /*!< EVTG AOI output filter sample count is 8. */ - kEVTG_AOIOutFilterSampleCount9, /*!< EVTG AOI output filter sample count is 9. */ - kEVTG_AOIOutFilterSampleCount10, /*!< EVTG AOI output filter sample count is 10. */ -} evtg_aoi_outfilter_count_t; - -/*! - * @brief EVTG output feedback override control mode. When FF is configured as JK-FF mode, - * need EVTG_OUTA feedback to EVTG input and replace one of the four inputs. - */ -typedef enum _evtg_outfdbk_override_input -{ - kEVTG_OutputOverrideInputA = 0x0U, /*!< Replace input A. */ - kEVTG_OutputOverrideInputB, /*!< Replace input B. */ - kEVTG_OutputOverrideInputC, /*!< Replace input C. */ - kEVTG_OutputOverrideInputD, /*!< Replace input D. */ -} evtg_outfdbk_override_input_t; - -/*! @brief EVTG flip flop mode configuration. */ -typedef enum _evtg_flipflop_mode -{ - kEVTG_FFModeBypass = 0x0U, /*!< Bypass mode (default).In this mode, user can choose to enable - or disable input sync logic and filter function. */ - kEVTG_FFModeRSTrigger, /*!< RS trigger mode. In this mode, user can choose to enable - or disable input sync logic and filter function. */ - kEVTG_FFModeTFF, /*!< T-FF mode. In this mode, input sync or filter has to be enabled - to remove the possible glitch.*/ - kEVTG_FFModeDFF, /*!< D-FF mode. In this mode, input sync or filter has to be enabled - to remove the possible glitch.*/ - kEVTG_FFModeJKFF, /*!< JK-FF mode. In this mode, input sync or filter has to be enabled - to remove the possible glitch.*/ - kEVTG_FFModeLatch, /*!< Latch mode. In this mode, input sync or filter has to be enabled - to remove the possible glitch.*/ -} evtg_flipflop_mode_t; - -/*! @brief EVTG flip-flop initial value. */ -typedef enum _evtg_flipflop_init_output -{ - kEVTG_FFInitOut0 = 0x0U, /*!< Configure the positive output of flip-flop as 0. */ - kEVTG_FFInitOut1 = 0x1U, /*!< Configure the positive output of flip-flop as 1. */ -} evtg_flipflop_init_output_t; - -/*! @brief The structure for configuring an AOI output filter sample. - * - * AOI output filter sample count represent the number of consecutive samples that must agree prior to the AOI output - * filter accepting an transition. - * AOI output filter sample period represent the sampling period (in IP bus clock cycles) of the AOI output signals. - * Each AOI output is sampled multiple times at the rate specified by this period. - * - * For the modes with Filter function enabled, filter delay is "(FILT_CNT + 3) x FILT_PER + 2". - * - */ -typedef struct _evtg_aoi_outfilter_config -{ - evtg_aoi_outfilter_count_t sampleCount; /*!< EVTG AOI output filter sample count. - refer to @ref evtg_aoi_outfilter_count_t. */ - uint8_t samplePeriod; /*!< EVTG AOI output filter sample period, within 0~255. If sample period - value is 0x00 (default), then the input filter is bypassed. */ -} evtg_aoi_outfilter_config_t; - -/*! @brief The structure for configuring an AOI product term. */ -typedef struct _evtg_aoi_product_term_config -{ - evtg_aoi_input_config_t aInput; /*!< Input A configuration. */ - evtg_aoi_input_config_t bInput; /*!< Input B configuration. */ - evtg_aoi_input_config_t cInput; /*!< Input C configuration. */ - evtg_aoi_input_config_t dInput; /*!< Input D configuration. */ -} evtg_aoi_product_term_config_t; - -/*! @brief EVTG AOI configuration structure. */ -typedef struct _evtg_aoi_config -{ - /* AOI Output Filter configuration. */ - evtg_aoi_outfilter_config_t aoiOutFilterConfig; /*!< EVTG AOI output filter sample - configuration structure. */ - - /* Product term configuration. */ - evtg_aoi_product_term_config_t productTerm0; /*!< Configure AOI product term0. */ - evtg_aoi_product_term_config_t productTerm1; /*!< Configure AOI product term1. */ - evtg_aoi_product_term_config_t productTerm2; /*!< Configure AOI product term2. */ - evtg_aoi_product_term_config_t productTerm3; /*!< Configure AOI product term3. */ -} evtg_aoi_config_t; - -/*! @brief EVTG configuration covering all configurable fields. */ -typedef struct _evtg_config -{ - /* Input configuration. */ - bool enableInputASync; /*!< Enable/Disable EVTG A input synchronous with bus clk. */ - bool enableInputBSync; /*!< Enable/Disable EVTG B input synchronous with bus clk. */ - bool enableInputCSync; /*!< Enable/Disable EVTG C input synchronous with bus clk. */ - bool enableInputDSync; /*!< Enable/Disable EVTG D input synchronous with bus clk. */ - evtg_outfdbk_override_input_t outfdbkOverideinput; /*!< EVTG output feedback to EVTG input - and replace one of the four inputs. */ - - /* Flip-flop configuration. */ - evtg_flipflop_mode_t flipflopMode; /*!< Flip-Flop can be configured as one of Bypass mode, RS trigger mode, - T-FF mode, D-FF mode, JK-FF mode, Latch mode. */ - bool enableFlipflopInitOutput; /*!< Flip-flop initial output value enable/disable. */ - evtg_flipflop_init_output_t flipflopInitOutputValue; /*!< Flip-flop initial output value configuration. */ - -#if defined(FSL_FEATURE_EVTG_HAS_FORCE_BYPASS_FLIPFLOP) && FSL_FEATURE_EVTG_HAS_FORCE_BYPASS_FLIPFLOP - bool enableForceBypassFlipFlopAOI0; /*!< Enable/Disable force bypass Flip-Flop and route the AOI_0(Filter_0) - value directly to EVTG_OUTA */ - bool enableForceBypassFlipFlopAOI1; /*!< Enable/Disable force bypass Flip-Flop and route the AOI_1(Filter_1) - value directly to EVTG_OUTB */ -#endif - - /* AOI configuration. */ - evtg_aoi_config_t aoi0Config; /*!< Configure EVTG AOI0. */ - evtg_aoi_config_t aoi1Config; /*!< Configure EVTG AOI1. */ -} evtg_config_t; - -/*! @} */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @addtogroup evtg_driver - * @{ - */ - -/*! - * @name Initialization Interfaces - * @{ - */ - -/*! - * @brief Initialize EVTG with a user configuration structure. - * - * @param base EVTG base address. - * @param evtgIndex EVTG instance index. - * @param psConfig EVTG initial configuration structure pointer. - */ -void EVTG_Init(EVTG_Type *base, evtg_index_t evtgIndex, evtg_config_t *psConfig); - -/*! - * @brief Loads default values to the EVTG configuration structure. - * - * The purpose of this API is to initialize the configuration structure to default value for @ref EVTG_Init() - * to use. - * The Flip-Flop can be configured as Bypass mode, RS trigger mode, T-FF mode, D-FF mode, JK-FF mode, Latch mode. - * Please check RM INTC chapter for more details. - * - * @param psConfig EVTG initial configuration structure pointer. - * @param flipflopMode EVTG flip flop mode. see @ ref _evtg_flipflop_mode - */ -void EVTG_GetDefaultConfig(evtg_config_t *psConfig, evtg_flipflop_mode_t flipflopMode); -/*! @} */ - -/*! - * @name Force Init Flipflop Interfaces - * @{ - */ - -/*! - * @brief Force Flip-flop initial output value to be presented on flip-flop positive output. - * - * @param base EVTG base address. - * @param evtgIndex EVTG instance index. - * @param flipflopInitOutputValue EVTG flip-flop initial output control. - * see @ref evtg_flipflop_init_output_t - */ -static inline void EVTG_ForceFlipflopInitOutput(EVTG_Type *base, - evtg_index_t evtgIndex, - evtg_flipflop_init_output_t flipflopInitOutputValue) -{ - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_CTRL &= (~(uint16_t)EVTG_EVTG_INST_EVTG_CTRL_FF_INIT_MASK); - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_CTRL |= - EVTG_EVTG_INST_EVTG_CTRL_FF_INIT((uint16_t)flipflopInitOutputValue); - /* INIT_EN bit should be set after FF_INIT is set. */ - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_CTRL |= EVTG_EVTG_INST_EVTG_CTRL_INIT_EN_MASK; -} -/*! @} */ - -/*! - * @name Input Interfaces - * @{ - */ -/*! - * @brief Configure each input value of AOI product term. Each selected input term in - * each product term can be configured to produce a logical 0 or 1 or pass the - * true or complement of the selected event input. Adapt to some simple aoi - * expressions. - * - * @param base EVTG base address. - * @param evtgIndex EVTG instance index. - * @param aoiIndex EVTG AOI index. see enum ref evtg_aoi_index_t - * @param productTerm EVTG product term index. - * @param inputIndex EVTG input index. - * @param input EVTG input configuration with enum @ref evtg_aoi_input_config_t. - */ -static inline void EVTG_SetProductTermInput(EVTG_Type *base, - evtg_index_t evtgIndex, - evtg_aoi_index_t aoiIndex, - evtg_aoi_product_term_t productTerm, - evtg_input_index_t inputIndex, - evtg_aoi_input_config_t input) -{ - if (kEVTG_AOI0 == aoiIndex) - { - if ((productTerm == kEVTG_ProductTerm0) || (productTerm == kEVTG_ProductTerm1)) - { - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI0_BFT01 &= - (uint16_t)(~(3UL << ((3U - ((uint8_t)inputIndex)) * 2U + (((3U - (uint8_t)productTerm) % 2U) * 8U)))); - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI0_BFT01 |= - ((((uint16_t)(input)) << ((3U - ((uint8_t)inputIndex)) * 2U + - (((3U - (uint8_t)productTerm) % 2U) * 8U))) & - (uint16_t)(3UL << ((3U - ((uint8_t)inputIndex)) * 2U + (((3U - (uint8_t)productTerm) % 2U) * 8U)))); - } - else - { - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI0_BFT23 &= - (uint16_t)(~(3UL << ((3U - ((uint8_t)inputIndex)) * 2U + (((3U - (uint8_t)productTerm) % 2U) * 8U)))); - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI0_BFT23 |= - ((((uint16_t)(input)) << ((3U - ((uint8_t)inputIndex)) * 2U + - (((3U - (uint8_t)productTerm) % 2U) * 8U))) & - (uint16_t)(3UL << ((3U - ((uint8_t)inputIndex)) * 2U + (((3U - (uint8_t)productTerm) % 2U) * 8U)))); - } - } - else if (kEVTG_AOI1 == aoiIndex) - { - if ((productTerm == kEVTG_ProductTerm0) || (productTerm == kEVTG_ProductTerm1)) - { - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI1_BFT01 &= - (uint16_t)(~(3UL << ((3U - ((uint8_t)inputIndex)) * 2U + (((3U - (uint8_t)productTerm) % 2U) * 8U)))); - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI1_BFT01 |= - ((((uint16_t)(input)) << ((3U - ((uint8_t)inputIndex)) * 2U + - (((3U - (uint8_t)productTerm) % 2U) * 8U))) & - (uint16_t)(3UL << ((3U - ((uint8_t)inputIndex)) * 2U + (((3U - (uint8_t)productTerm) % 2U) * 8U)))); - } - else - { - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI1_BFT23 &= - (uint16_t)(~(3UL << ((3U - ((uint8_t)inputIndex)) * 2U + (((3U - (uint8_t)productTerm) % 2U) * 8U)))); - base->EVTG_INST[(uint8_t)evtgIndex].EVTG_AOI1_BFT23 |= - ((((uint16_t)(input)) << ((3U - ((uint8_t)inputIndex)) * 2U + - (((3U - (uint8_t)productTerm) % 2U) * 8U))) & - (uint16_t)(3UL << ((3U - ((uint8_t)inputIndex)) * 2U + (((3U - (uint8_t)productTerm) % 2U) * 8U)))); - } - } - else - { - ; /* No action*/ - } -} - -/*! - * @brief Configure AOI product term by initializing the product term - * configuration structure. - * - * @param base EVTG base address. - * @param evtgIndex EVTG instance index. - * @param aoiIndex EVTG AOI index. see enum @ref evtg_aoi_index_t - * @param productTerm EVTG AOI product term index. - * @param psProductTermConfig Pointer to EVTG product term configuration structure. - * see ref _evtg_aoi_product_term_config - */ -void EVTG_ConfigAOIProductTerm(EVTG_Type *base, - evtg_index_t evtgIndex, - evtg_aoi_index_t aoiIndex, - evtg_aoi_product_term_t productTerm, - evtg_aoi_product_term_config_t *psProductTermConfig); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @} */ - -#endif /* FSL_EVTG_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_ewm.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_ewm.c deleted file mode 100644 index 593cf87a50b..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_ewm.c +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2017, 2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_ewm.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.ewm" -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Initializes the EWM peripheral. - * - * This function is used to initialize the EWM. After calling, the EWM - * runs immediately according to the configuration. - * Note that, except for the interrupt enable control bit, other control bits and registers are write once after a - * CPU reset. Modifying them more than once generates a bus transfer error. - * - * This is an example. - * code - * ewm_config_t config; - * EWM_GetDefaultConfig(&config); - * config.compareHighValue = 0xAAU; - * EWM_Init(ewm_base,&config); - * endcode - * - * param base EWM peripheral base address - * param config The configuration of the EWM - */ -void EWM_Init(EWM_Type *base, const ewm_config_t *config) -{ - assert(NULL != config); - - uint8_t value = 0U; - -#if !((defined(FSL_FEATURE_SOC_PCC_COUNT) && FSL_FEATURE_SOC_PCC_COUNT) && \ - (defined(FSL_FEATURE_PCC_SUPPORT_EWM_CLOCK_REMOVE) && FSL_FEATURE_PCC_SUPPORT_EWM_CLOCK_REMOVE)) -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_EnableClock(kCLOCK_Ewm0); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif - value = EWM_CTRL_EWMEN(config->enableEwm) | EWM_CTRL_ASSIN(config->setInputAssertLogic) | - EWM_CTRL_INEN(config->enableEwmInput) | EWM_CTRL_INTEN(config->enableInterrupt); -#if defined(FSL_FEATURE_EWM_HAS_PRESCALER) && FSL_FEATURE_EWM_HAS_PRESCALER - base->CLKPRESCALER = config->prescaler; -#endif /* FSL_FEATURE_EWM_HAS_PRESCALER */ - -#if defined(FSL_FEATURE_EWM_HAS_CLOCK_SELECT) && FSL_FEATURE_EWM_HAS_CLOCK_SELECT - base->CLKCTRL = (uint8_t)config->clockSource; -#endif /* FSL_FEATURE_EWM_HAS_CLOCK_SELECT*/ - - base->CMPL = config->compareLowValue; - base->CMPH = config->compareHighValue; - base->CTRL = value; -} - -/*! - * brief Deinitializes the EWM peripheral. - * - * This function is used to shut down the EWM. - * - * param base EWM peripheral base address - */ -void EWM_Deinit(EWM_Type *base) -{ - EWM_DisableInterrupts(base, (uint32_t)kEWM_InterruptEnable); -#if !((defined(FSL_FEATURE_SOC_PCC_COUNT) && FSL_FEATURE_SOC_PCC_COUNT) && \ - (defined(FSL_FEATURE_PCC_SUPPORT_EWM_CLOCK_REMOVE) && FSL_FEATURE_PCC_SUPPORT_EWM_CLOCK_REMOVE)) -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_DisableClock(kCLOCK_Ewm0); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* FSL_FEATURE_PCC_SUPPORT_EWM_CLOCK_REMOVE */ -} - -/*! - * brief Initializes the EWM configuration structure. - * - * This function initializes the EWM configuration structure to default values. The default - * values are as follows. - * code - * ewmConfig->enableEwm = true; - * ewmConfig->enableEwmInput = false; - * ewmConfig->setInputAssertLogic = false; - * ewmConfig->enableInterrupt = false; - * ewmConfig->ewm_lpo_clock_source_t = kEWM_LpoClockSource0; - * ewmConfig->prescaler = 0; - * ewmConfig->compareLowValue = 0; - * ewmConfig->compareHighValue = 0xFEU; - * endcode - * - * param config Pointer to the EWM configuration structure. - * see ewm_config_t - */ -void EWM_GetDefaultConfig(ewm_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->enableEwm = true; - config->enableEwmInput = false; - config->setInputAssertLogic = false; - config->enableInterrupt = false; -#if defined(FSL_FEATURE_EWM_HAS_CLOCK_SELECT) && FSL_FEATURE_EWM_HAS_CLOCK_SELECT - config->clockSource = kEWM_LpoClockSource0; -#endif /* FSL_FEATURE_EWM_HAS_CLOCK_SELECT*/ -#if defined(FSL_FEATURE_EWM_HAS_PRESCALER) && FSL_FEATURE_EWM_HAS_PRESCALER - config->prescaler = 0U; -#endif /* FSL_FEATURE_EWM_HAS_PRESCALER */ - config->compareLowValue = 0U; - config->compareHighValue = 0xFEU; -} - -/*! - * brief Services the EWM. - * - * This function resets the EWM counter to zero. - * - * param base EWM peripheral base address - */ -void EWM_Refresh(EWM_Type *base) -{ - uint32_t primaskValue = 0U; - - /* Disable the global interrupt to protect refresh sequence */ - primaskValue = DisableGlobalIRQ(); - base->SERV = (uint8_t)0xB4U; - base->SERV = (uint8_t)0x2CU; - EnableGlobalIRQ(primaskValue); -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_ewm.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_ewm.h deleted file mode 100644 index 2d62fcdda35..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_ewm.h +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2017, 2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_EWM_H_ -#define FSL_EWM_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup ewm - * @{ - */ - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief EWM driver version 2.0.3. */ -#define FSL_EWM_DRIVER_VERSION (MAKE_VERSION(2, 0, 3)) -/*! @} */ - -/*! @brief Describes EWM clock source. */ -#if defined(FSL_FEATURE_EWM_HAS_CLOCK_SELECT) && FSL_FEATURE_EWM_HAS_CLOCK_SELECT -typedef enum _ewm_lpo_clock_source -{ - kEWM_LpoClockSource0 = 0U, /*!< EWM clock sourced from lpo_clk[0]*/ - kEWM_LpoClockSource1 = 1U, /*!< EWM clock sourced from lpo_clk[1]*/ - kEWM_LpoClockSource2 = 2U, /*!< EWM clock sourced from lpo_clk[2]*/ - kEWM_LpoClockSource3 = 3U, /*!< EWM clock sourced from lpo_clk[3]*/ -} ewm_lpo_clock_source_t; -#endif /* FSL_FEATURE_EWM_HAS_CLOCK_SELECT */ - -/*! - * @brief Data structure for EWM configuration. - * - * This structure is used to configure the EWM. - */ -typedef struct _ewm_config -{ - bool enableEwm; /*!< Enable EWM module */ - bool enableEwmInput; /*!< Enable EWM_in input */ - bool setInputAssertLogic; /*!< EWM_in signal assertion state */ - bool enableInterrupt; /*!< Enable EWM interrupt */ -#if defined(FSL_FEATURE_EWM_HAS_CLOCK_SELECT) && FSL_FEATURE_EWM_HAS_CLOCK_SELECT - ewm_lpo_clock_source_t clockSource; /*!< Clock source select */ -#endif /* FSL_FEATURE_EWM_HAS_CLOCK_SELECT */ -#if defined(FSL_FEATURE_EWM_HAS_PRESCALER) && FSL_FEATURE_EWM_HAS_PRESCALER - uint8_t prescaler; /*!< Clock prescaler value */ -#endif /* FSL_FEATURE_EWM_HAS_PRESCALER */ - uint8_t compareLowValue; /*!< Compare low-register value */ - uint8_t compareHighValue; /*!< Compare high-register value */ -} ewm_config_t; - -/*! - * @brief EWM interrupt configuration structure with default settings all disabled. - * - * This structure contains the settings for all of EWM interrupt configurations. - */ -enum _ewm_interrupt_enable_t -{ - kEWM_InterruptEnable = EWM_CTRL_INTEN_MASK, /*!< Enable the EWM to generate an interrupt*/ -}; - -/*! - * @brief EWM status flags. - * - * This structure contains the constants for the EWM status flags for use in the EWM functions. - */ -enum _ewm_status_flags_t -{ - kEWM_RunningFlag = EWM_CTRL_EWMEN_MASK, /*!< Running flag, set when EWM is enabled*/ -}; - -/******************************************************************************* - * API - *******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name EWM initialization and de-initialization - * @{ - */ - -/*! - * @brief Initializes the EWM peripheral. - * - * This function is used to initialize the EWM. After calling, the EWM - * runs immediately according to the configuration. - * Note that, except for the interrupt enable control bit, other control bits and registers are write once after a - * CPU reset. Modifying them more than once generates a bus transfer error. - * - * This is an example. - * @code - * ewm_config_t config; - * EWM_GetDefaultConfig(&config); - * config.compareHighValue = 0xAAU; - * EWM_Init(ewm_base,&config); - * @endcode - * - * @param base EWM peripheral base address - * @param config The configuration of the EWM - */ -void EWM_Init(EWM_Type *base, const ewm_config_t *config); - -/*! - * @brief Deinitializes the EWM peripheral. - * - * This function is used to shut down the EWM. - * - * @param base EWM peripheral base address - */ -void EWM_Deinit(EWM_Type *base); - -/*! - * @brief Initializes the EWM configuration structure. - * - * This function initializes the EWM configuration structure to default values. The default - * values are as follows. - * @code - * ewmConfig->enableEwm = true; - * ewmConfig->enableEwmInput = false; - * ewmConfig->setInputAssertLogic = false; - * ewmConfig->enableInterrupt = false; - * ewmConfig->ewm_lpo_clock_source_t = kEWM_LpoClockSource0; - * ewmConfig->prescaler = 0; - * ewmConfig->compareLowValue = 0; - * ewmConfig->compareHighValue = 0xFEU; - * @endcode - * - * @param config Pointer to the EWM configuration structure. - * @see ewm_config_t - */ -void EWM_GetDefaultConfig(ewm_config_t *config); - -/*! @} */ - -/*! - * @name EWM functional Operation - * @{ - */ - -/*! - * @brief Enables the EWM interrupt. - * - * This function enables the EWM interrupt. - * - * @param base EWM peripheral base address - * @param mask The interrupts to enable - * The parameter can be combination of the following source if defined - * @arg kEWM_InterruptEnable - */ -static inline void EWM_EnableInterrupts(EWM_Type *base, uint32_t mask) -{ - base->CTRL |= (uint8_t)mask; -} - -/*! - * @brief Disables the EWM interrupt. - * - * This function enables the EWM interrupt. - * - * @param base EWM peripheral base address - * @param mask The interrupts to disable - * The parameter can be combination of the following source if defined - * @arg kEWM_InterruptEnable - */ -static inline void EWM_DisableInterrupts(EWM_Type *base, uint32_t mask) -{ - base->CTRL &= (uint8_t)(~mask); -} - -/*! - * @brief Gets all status flags. - * - * This function gets all status flags. - * - * This is an example for getting the running flag. - * @code - * uint32_t status; - * status = EWM_GetStatusFlags(ewm_base) & kEWM_RunningFlag; - * @endcode - * @param base EWM peripheral base address - * @return State of the status flag: asserted (true) or not-asserted (false).@see _ewm_status_flags_t - * - True: a related status flag has been set. - * - False: a related status flag is not set. - */ -static inline uint32_t EWM_GetStatusFlags(EWM_Type *base) -{ - return ((uint32_t)base->CTRL & EWM_CTRL_EWMEN_MASK); -} - -/*! - * @brief Services the EWM. - * - * This function resets the EWM counter to zero. - * - * @param base EWM peripheral base address - */ -void EWM_Refresh(EWM_Type *base); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @}*/ - -#endif /* FSL_EWM_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexcan.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexcan.c deleted file mode 100644 index 8717791e182..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexcan.c +++ /dev/null @@ -1,4927 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexcan.h" - -/* - * $Coverage Justification Reference$ - * - * $Justification flexcan_c_ref_1$ - * The FLEXCAN_ReadRxFifo() return fail only when Rx FIFO is diabled. But in IRQ handler, will first check whether the - * FIFO is enabled, and only call FLEXCAN_ReadRxFifo if the FIFO is enabled. So to cover this line/branch, need to - * interrupt the current execution by a high priority IRQ after confirming that the FIFO is enabled, and disabled the - * FIFO in the high priority interrupt. It is difficult to simulate this situation in unit test, so add Justification. - * - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexcan" -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_6032) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_6032) -#define RXINTERMISSION (CAN_DBG1_CFSM(0x2f)) -#define TXINTERMISSION (CAN_DBG1_CFSM(0x14)) -#define BUSIDLE (CAN_DBG1_CFSM(0x02)) -#define CBN_VALUE3 (CAN_DBG1_CBN(0x03)) -#define DELAY_BUSIDLE (200) -#endif - -/* According to CiA doc 1301 v1.0.0, specified data/nominal phase sample point postion for CAN FD at 80 MHz. */ -#define IDEAL_DATA_SP_1 (800U) -#define IDEAL_DATA_SP_2 (750U) -#define IDEAL_DATA_SP_3 (700U) -#define IDEAL_DATA_SP_4 (625U) -#define IDEAL_NOMINAL_SP (800U) - -/* According to CiA doc 301 v4.2.0 and previous version. */ -#define IDEAL_SP_LOW (750U) -#define IDEAL_SP_MID (800U) -#define IDEAL_SP_HIGH (875U) - -#define IDEAL_SP_FACTOR (1000U) - -/* Define the max value of bit timing segments when use different timing register. */ -#define MAX_PROPSEG (CAN_CTRL1_PROPSEG_MASK >> CAN_CTRL1_PROPSEG_SHIFT) -#define MAX_PSEG1 (CAN_CTRL1_PSEG1_MASK >> CAN_CTRL1_PSEG1_SHIFT) -#define MAX_PSEG2 (CAN_CTRL1_PSEG2_MASK >> CAN_CTRL1_PSEG2_SHIFT) -#define MAX_RJW (CAN_CTRL1_RJW_MASK >> CAN_CTRL1_RJW_SHIFT) -#define MAX_PRESDIV (CAN_CTRL1_PRESDIV_MASK >> CAN_CTRL1_PRESDIV_SHIFT) -#define CTRL1_MAX_TIME_QUANTA (1U + MAX_PROPSEG + 1U + MAX_PSEG1 + 1U + MAX_PSEG2 + 1U) -#define CTRL1_MIN_TIME_QUANTA (8U) - -#define MAX_EPROPSEG (CAN_CBT_EPROPSEG_MASK >> CAN_CBT_EPROPSEG_SHIFT) -#define MAX_EPSEG1 (CAN_CBT_EPSEG1_MASK >> CAN_CBT_EPSEG1_SHIFT) -#define MAX_EPSEG2 (CAN_CBT_EPSEG2_MASK >> CAN_CBT_EPSEG2_SHIFT) -#define MAX_ERJW (CAN_CBT_ERJW_MASK >> CAN_CBT_ERJW_SHIFT) -#define MAX_EPRESDIV (CAN_CBT_EPRESDIV_MASK >> CAN_CBT_EPRESDIV_SHIFT) -#define CBT_MAX_TIME_QUANTA (1U + MAX_EPROPSEG + 1U + MAX_EPSEG1 + 1U + MAX_EPSEG2 + 1U) -#define CBT_MIN_TIME_QUANTA (8U) - -#define MAX_FPROPSEG (CAN_FDCBT_FPROPSEG_MASK >> CAN_FDCBT_FPROPSEG_SHIFT) -#define MAX_FPSEG1 (CAN_FDCBT_FPSEG1_MASK >> CAN_FDCBT_FPSEG1_SHIFT) -#define MAX_FPSEG2 (CAN_FDCBT_FPSEG2_MASK >> CAN_FDCBT_FPSEG2_SHIFT) -#define MAX_FRJW (CAN_FDCBT_FRJW_MASK >> CAN_FDCBT_FRJW_SHIFT) -#define MAX_FPRESDIV (CAN_FDCBT_FPRESDIV_MASK >> CAN_FDCBT_FPRESDIV_SHIFT) -#define FDCBT_MAX_TIME_QUANTA (1U + MAX_FPROPSEG + 0U + MAX_FPSEG1 + 1U + MAX_FPSEG2 + 1U) -#define FDCBT_MIN_TIME_QUANTA (5U) - -#define MAX_TDCOFF ((uint32_t)CAN_FDCTRL_TDCOFF_MASK >> CAN_FDCTRL_TDCOFF_SHIFT) - -#define MAX_NTSEG1 (CAN_ENCBT_NTSEG1_MASK >> CAN_ENCBT_NTSEG1_SHIFT) -#define MAX_NTSEG2 (CAN_ENCBT_NTSEG2_MASK >> CAN_ENCBT_NTSEG2_SHIFT) -#define MAX_NRJW (CAN_ENCBT_NRJW_MASK >> CAN_ENCBT_NRJW_SHIFT) -#define MAX_ENPRESDIV (CAN_EPRS_ENPRESDIV_MASK >> CAN_EPRS_ENPRESDIV_SHIFT) -#define ENCBT_MAX_TIME_QUANTA (1U + MAX_NTSEG1 + 1U + MAX_NTSEG2 + 1U) -#define ENCBT_MIN_TIME_QUANTA (8U) - -#define MAX_DTSEG1 (CAN_EDCBT_DTSEG1_MASK >> CAN_EDCBT_DTSEG1_SHIFT) -#define MAX_DTSEG2 (CAN_EDCBT_DTSEG2_MASK >> CAN_EDCBT_DTSEG2_SHIFT) -#define MAX_DRJW (CAN_EDCBT_DRJW_MASK >> CAN_EDCBT_DRJW_SHIFT) -#define MAX_EDPRESDIV (CAN_EPRS_EDPRESDIV_MASK >> CAN_EPRS_EDPRESDIV_SHIFT) -#define EDCBT_MAX_TIME_QUANTA (1U + MAX_DTSEG1 + 1U + MAX_DTSEG2 + 1U) -#define EDCBT_MIN_TIME_QUANTA (5U) - -#define MAX_ETDCOFF ((uint32_t)CAN_ETDC_ETDCOFF_MASK >> CAN_ETDC_ETDCOFF_SHIFT) - -/* TSEG1 corresponds to the sum of xPROPSEG and xPSEG1, TSEG2 corresponds to the xPSEG2 value. */ -#define MIN_TIME_SEGMENT1 (2U) -#define MIN_TIME_SEGMENT2 (2U) - -/* Define maximum CAN and CAN FD bit rate supported by FLEXCAN. */ -#if (defined(FSL_FEATURE_FLEXCAN_MAX_CANFD_BITRATE)) -#define MAX_CANFD_BITRATE ((uint32_t)(FSL_FEATURE_FLEXCAN_MAX_CANFD_BITRATE)) -#else -#define MAX_CANFD_BITRATE (8000000U) -#endif -#define MAX_CAN_BITRATE (1000000U) - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_9595) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_9595) -#define CAN_ESR1_FLTCONF_BUSOFF CAN_ESR1_FLTCONF(2U) -#endif - -/* Define the range of memory that needs to be initialized when the device has memory error detection feature. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -#define CAN_INIT_RXFIR ((uintptr_t)base + 0x4Cu) -#define CAN_INIT_MEMORY_BASE_1 (uint32_t *)((uintptr_t)base + (uintptr_t)FSL_FEATURE_FLEXCAN_INIT_MEMORY_BASE_1) -#define CAN_INIT_MEMORY_SIZE_1 FSL_FEATURE_FLEXCAN_INIT_MEMORY_SIZE_1 -#define CAN_INIT_MEMORY_BASE_2 (uint32_t *)((uintptr_t)base + (uintptr_t)FSL_FEATURE_FLEXCAN_INIT_MEMORY_BASE_2) -#define CAN_INIT_MEMORY_SIZE_2 FSL_FEATURE_FLEXCAN_INIT_MEMORY_SIZE_2 -#endif - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#ifndef CAN_CLOCK_CHECK_NO_AFFECTS -/* If no define such MACRO, it mean that the CAN in current device have no clock affect issue. */ -#define CAN_CLOCK_CHECK_NO_AFFECTS (true) -#endif /* CAN_CLOCK_CHECK_NO_AFFECTS */ -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(FLEXCAN_RSTS) -#define FLEXCAN_RESETS_ARRAY FLEXCAN_RSTS -#elif defined(FLEXCAN_RSTS_N) -#define FLEXCAN_RESETS_ARRAY FLEXCAN_RSTS_N -#endif - -/*! @brief FlexCAN Internal State. */ -enum _flexcan_state -{ - kFLEXCAN_StateIdle = 0x0, /*!< MB/RxFIFO idle.*/ - kFLEXCAN_StateRxData = 0x1, /*!< MB receiving.*/ - kFLEXCAN_StateRxRemote = 0x2, /*!< MB receiving remote reply.*/ - kFLEXCAN_StateTxData = 0x3, /*!< MB transmitting.*/ - kFLEXCAN_StateTxRemote = 0x4, /*!< MB transmitting remote request.*/ - kFLEXCAN_StateRxFifo = 0x5, /*!< RxFIFO receiving.*/ -}; - -/*! @brief FlexCAN message buffer CODE for Rx buffers. */ -enum _flexcan_mb_code_rx -{ - kFLEXCAN_RxMbInactive = 0x0, /*!< MB is not active.*/ - kFLEXCAN_RxMbFull = 0x2, /*!< MB is full.*/ - kFLEXCAN_RxMbEmpty = 0x4, /*!< MB is active and empty.*/ - kFLEXCAN_RxMbOverrun = 0x6, /*!< MB is overwritten into a full buffer.*/ - kFLEXCAN_RxMbBusy = 0x8, /*!< FlexCAN is updating the contents of the MB, The CPU must not access the MB.*/ - kFLEXCAN_RxMbRanswer = 0xA, /*!< A frame was configured to recognize a Remote Request Frame and transmit a - Response Frame in return.*/ - kFLEXCAN_RxMbNotUsed = 0xF, /*!< Not used.*/ -}; - -/*! @brief FlexCAN message buffer CODE FOR Tx buffers. */ -enum _flexcan_mb_code_tx -{ - kFLEXCAN_TxMbInactive = 0x8, /*!< MB is not active.*/ - kFLEXCAN_TxMbAbort = 0x9, /*!< MB is aborted.*/ - kFLEXCAN_TxMbDataOrRemote = 0xC, /*!< MB is a TX Data Frame(when MB RTR = 0) or MB is a TX Remote Request - Frame (when MB RTR = 1).*/ - kFLEXCAN_TxMbTanswer = 0xE, /*!< MB is a TX Response Request Frame from an incoming Remote Request Frame.*/ - kFLEXCAN_TxMbNotUsed = 0xF, /*!< Not used.*/ -}; - -/* Typedef for interrupt handler. */ -typedef void (*flexcan_isr_t)(CAN_Type *base, flexcan_handle_t *handle); - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -#if !defined(NDEBUG) -/*! - * @brief Check if Message Buffer is occupied by Rx FIFO. - * - * This function check if Message Buffer is occupied by Rx FIFO. - * - * @param base FlexCAN peripheral base address. - * @param mbIdx The FlexCAN Message Buffer index. - * @return TRUE if the index MB is occupied by Rx FIFO, FALSE if the index MB not occupied by Rx FIFO. - */ -static bool FLEXCAN_IsMbOccupied(CAN_Type *base, uint8_t mbIdx); -#endif - -#if ((defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829)) -/*! - * @brief Get the first valid Message buffer ID of give FlexCAN instance. - * - * This function is a helper function for Errata 5641 workaround. - * - * @param base FlexCAN peripheral base address. - * @return The first valid Message Buffer Number. - */ -static uint8_t FLEXCAN_GetFirstValidMb(CAN_Type *base); -#endif - -/*! - * @brief Reset the FlexCAN Instance. - * - * Restores the FlexCAN module to reset state, notice that this function - * will set all the registers to reset state so the FlexCAN module can not work - * after calling this API. - * - * @param base FlexCAN peripheral base address. - */ -static void FLEXCAN_Reset(CAN_Type *base); - -/*! - * @brief Calculates the segment values for a single bit time for classical CAN. - * - * This function use to calculates the Classical CAN segment values which will be set in CTRL1/CBT/ENCBT register. - * - * @param base FlexCAN peripheral base address. - * @param tqNum Number of time quantas per bit, range in 8 ~ 25 when use CTRL1, range in 8 ~ 129 when use CBT, range in - * 8 ~ 385 when use ENCBT. param pTimingConfig Pointer to the FlexCAN timing configuration structure. - */ -static void FLEXCAN_GetSegments(CAN_Type *base, - uint32_t bitRate, - uint32_t tqNum, - flexcan_timing_config_t *pTimingConfig); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * @brief Get Mailbox offset number by dword. - * - * This function gets the offset number of the specified mailbox. - * Mailbox is not consecutive between memory regions when payload is not 8 bytes - * so need to calculate the specified mailbox address. - * For example, in the first memory region, MB[0].CS address is 0x4002_4080. For 32 bytes - * payload frame, the second mailbox is ((1/12)*512 + 1%12*40)/4 = 10, meaning 10 dword - * after the 0x4002_4080, which is actually the address of mailbox MB[1].CS. - * - * @param base FlexCAN peripheral base address. - * @param mbIdx Mailbox index. - */ -static uint32_t FLEXCAN_GetFDMailboxOffset(CAN_Type *base, uint8_t mbIdx); - -/*! - * @brief Calculates the segment values for a single bit time for CAN FD data phase. - * - * This function use to calculates the CAN FD data phase segment values which will be set in CFDCBT/EDCBT - * register. - * - * @param bitRateFD Data phase bit rate - * @param tqNum Number of time quanta per bit - * @param pTimingConfig Pointer to the FlexCAN timing configuration structure. - */ -static void FLEXCAN_FDGetSegments(uint32_t bitRateFD, uint32_t tqNum, flexcan_timing_config_t *pTimingConfig); - -/*! - * @brief Calculates the improved timing values by specific bit rate for CAN FD nominal phase. - * - * This function use to calculates the CAN FD nominal phase timing values according to the given nominal phase bit rate. - * The Calculated timing values will be set in CBT/ENCBT registers. The calculation is based on the recommendation of - * the CiA 1301 v1.0.0 document. - * - * @param bitRate The CAN FD nominal phase speed in bps defined by user, should be less than or equal to 1Mbps. - * @param sourceClock_Hz The Source clock frequency in Hz. - * @param pTimingConfig Pointer to the FlexCAN timing configuration structure. - * - * @return TRUE if timing configuration found, FALSE if failed to find configuration. - */ -static bool FLEXCAN_CalculateImprovedNominalTimingValues(uint32_t bitRate, - uint32_t sourceClock_Hz, - flexcan_timing_config_t *pTimingConfig); - -#endif - -/*! - * @brief Check unhandle interrupt events - * - * @param base FlexCAN peripheral base address. - * @return TRUE if unhandled interrupt action exist, FALSE if no unhandlered interrupt action exist. - */ -static bool FLEXCAN_CheckUnhandleInterruptEvents(CAN_Type *base); - -/*! - * @brief Sub Handler Data Trasfered Events - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param pResult Pointer to the Handle result. - * - * @return the status after handle each data transfered event. - */ -static status_t FLEXCAN_SubHandlerForDataTransfered(CAN_Type *base, flexcan_handle_t *handle, uint32_t *pResult); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * @brief Sub Handler Ehanced Rx FIFO event - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param flags FlexCAN interrupt flags. - * - * @return the status after handle Ehanced Rx FIFO event. - */ -static status_t FLEXCAN_SubHandlerForEhancedRxFifo(CAN_Type *base, flexcan_handle_t *handle, uint64_t flags); -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/* Array of FlexCAN peripheral base address. */ -static CAN_Type *const s_flexcanBases[] = CAN_BASE_PTRS; - -/* Array of FlexCAN IRQ number. */ -static const IRQn_Type s_flexcanRxWarningIRQ[] = CAN_Rx_Warning_IRQS; -static const IRQn_Type s_flexcanTxWarningIRQ[] = CAN_Tx_Warning_IRQS; -static const IRQn_Type s_flexcanWakeUpIRQ[] = CAN_Wake_Up_IRQS; -static const IRQn_Type s_flexcanErrorIRQ[] = CAN_Error_IRQS; -static const IRQn_Type s_flexcanBusOffIRQ[] = CAN_Bus_Off_IRQS; -static const IRQn_Type s_flexcanMbIRQ[] = CAN_ORed_Message_buffer_IRQS; - -/* Array of FlexCAN handle. */ -static flexcan_handle_t *s_flexcanHandle[ARRAY_SIZE(s_flexcanBases)]; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/* Array of FlexCAN clock name. */ -static const clock_ip_name_t s_flexcanClock[] = FLEXCAN_CLOCKS; -#if defined(FLEXCAN_PERIPH_CLOCKS) -/* Array of FlexCAN serial clock name. */ -static const clock_ip_name_t s_flexcanPeriphClock[] = FLEXCAN_PERIPH_CLOCKS; -#endif /* FLEXCAN_PERIPH_CLOCKS */ -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(FLEXCAN_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_flexcanResets[] = FLEXCAN_RESETS_ARRAY; -#endif - -/* FlexCAN ISR for transactional APIs. */ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -static flexcan_isr_t s_flexcanIsr = (flexcan_isr_t)DefaultISR; -#else -static flexcan_isr_t s_flexcanIsr; -#endif - -/******************************************************************************* - * Implementation of 32-bit memset - ******************************************************************************/ - -static void flexcan_memset(void *s, uint32_t c, size_t n) -{ - size_t m; - volatile uint32_t *ptr = s; - - m = n / sizeof(*ptr); - - while ((m--) != (size_t)0) - { - *ptr++ = c; - } -} - -/******************************************************************************* - * Code - ******************************************************************************/ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * brief Determine whether the FlexCAN instance support CAN FD mode at run time. - * - * note Use this API only if different soc parts share the SOC part name macro define. Otherwise, a different SOC part - * name can be used to determine at compile time whether the FlexCAN instance supports CAN FD mode or not. - * If need use this API to determine if CAN FD mode is supported, the FLEXCAN_Init function needs to be - * executed first, and then call this API and use the return to value determines whether to supports CAN FD mode, - * if return true, continue calling FLEXCAN_FDInit to enable CAN FD mode. - * - * param base FlexCAN peripheral base address. - * return return TRUE if instance support CAN FD mode, FALSE if instance only support classic CAN (2.0) mode. - */ -bool FLEXCAN_IsInstanceHasFDMode(CAN_Type *base) -{ - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - /* Enable CAN FD operation. */ - base->MCR |= CAN_MCR_FDEN_MASK; - - /* There are some SoC parts that don't support CAN FD. - * Checking if FDEN bit is really set to 1 is a way to ensure that CAN FD is supported. - * When SoC parts don't support CAN FD, FDEN bit stuck at 0 and can't be set to 1. */ - if (0U == (base->MCR & CAN_MCR_FDEN_MASK)) - { - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); - return false; - } - else - { - /* Clear CAN FD operation. */ - base->MCR &= ~CAN_MCR_FDEN_MASK; - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); - return true; - } -} -#endif - -/*! - * brief Get the FlexCAN instance from peripheral base address. - * - * param base FlexCAN peripheral base address. - * return FlexCAN instance. - */ -uint32_t FLEXCAN_GetInstance(CAN_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_flexcanBases); instance++) - { - if (s_flexcanBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_flexcanBases)); - - return instance; -} - -/*! - * brief Enter FlexCAN Freeze Mode. - * - * This function makes the FlexCAN work under Freeze Mode. - * - * param base FlexCAN peripheral base address. - */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_9595) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_9595) -void FLEXCAN_EnterFreezeMode(CAN_Type *base) -{ - uint32_t u32TimeoutCount = 0U; - uint32_t u32TempMCR = 0U; - uint32_t u32TempIMASK1 = 0U; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - uint32_t u32TempIMASK2 = 0U; -#endif - - /* Step1: set FRZ enable in MCR. */ - base->MCR |= CAN_MCR_FRZ_MASK; - - /* Step2: to check if MDIS bit set in MCR. if yes, clear it. */ - if (0U != (base->MCR & CAN_MCR_MDIS_MASK)) - { - base->MCR &= ~CAN_MCR_MDIS_MASK; - } - - /* Step3: polling LPMACK. */ - u32TimeoutCount = (uint32_t)FLEXCAN_WAIT_TIMEOUT; - while ((0U == (base->MCR & CAN_MCR_LPMACK_MASK)) && (u32TimeoutCount > 0U)) - { - u32TimeoutCount--; - } - - /* Step4: to check FLTCONF in ESR1 register */ - if (0U == (base->ESR1 & CAN_ESR1_FLTCONF_BUSOFF)) - { - /* Error Active and Error Passive state */ - /* Step5B: Set Halt bits. */ - base->MCR |= CAN_MCR_HALT_MASK; - - /* Step6B: Poll the MCR register until the Freeze Acknowledge (FRZACK) bit is set, timeout need more than 178 - * CAN bit length, so 20 multiply timeout is enough. */ - u32TimeoutCount = (uint32_t)FLEXCAN_WAIT_TIMEOUT * 20U; - while ((0U == (base->MCR & CAN_MCR_FRZACK_MASK)) && (u32TimeoutCount > 0U)) - { - u32TimeoutCount--; - } - - /* Merge ERRATA_9595 and ERRATA_8341 because both errata exist on some platform. */ - if (0U == u32TimeoutCount) - { - /* backup MCR and IMASK register. */ - u32TempMCR = base->MCR; - u32TempIMASK1 = base->IMASK1; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - u32TempIMASK2 = base->IMASK2; -#endif - /* Set the Soft Reset bit ((SOFTRST) in the MCR.*/ - base->MCR |= CAN_MCR_SOFTRST_MASK; - - /* Poll the MCR register until the Soft Reset (SOFTRST) bit is cleared, timeout need more than 178 - * CAN bit length, so 20 multiply timeout is enough. */ - u32TimeoutCount = (uint32_t)FLEXCAN_WAIT_TIMEOUT * 20U; - while ((CAN_MCR_SOFTRST_MASK == (base->MCR & CAN_MCR_SOFTRST_MASK)) && (u32TimeoutCount > 0U)) - { - u32TimeoutCount--; - } - - /* Reconfig MCR. */ - base->MCR = u32TempMCR; - - /* Reconfig IMASK. */ - base->IMASK1 = u32TempIMASK1; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - base->IMASK2 = u32TempIMASK2; -#endif - } - } - else - { - /* Bus Off state */ - /* backup MCR and IMASK register. Errata document not descript it, but we need backup for step 8A and 9A. */ - u32TempMCR = base->MCR; - u32TempIMASK1 = base->IMASK1; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - u32TempIMASK2 = base->IMASK2; -#endif - - /* Step5A: Set the Soft Reset bit ((SOFTRST) in the MCR.*/ - base->MCR |= CAN_MCR_SOFTRST_MASK; - - /* Step6A: Poll the MCR register until the Soft Reset (SOFTRST) bit is cleared. */ - u32TimeoutCount = (uint32_t)FLEXCAN_WAIT_TIMEOUT; - while ((CAN_MCR_SOFTRST_MASK == (base->MCR & CAN_MCR_SOFTRST_MASK)) && (u32TimeoutCount > 0U)) - { - u32TimeoutCount--; - } - - /* Step7A: Poll the MCR register until the Freeze Acknowledge (FRZACK) bit is set. */ - u32TimeoutCount = (uint32_t)FLEXCAN_WAIT_TIMEOUT; - while ((0U == (base->MCR & CAN_MCR_FRZACK_MASK)) && (u32TimeoutCount > 0U)) - { - u32TimeoutCount--; - } - - /* Step8A: reconfig MCR. */ - base->MCR = u32TempMCR; - - /* Step9A: reconfig IMASK. */ - base->IMASK1 = u32TempIMASK1; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - base->IMASK2 = u32TempIMASK2; -#endif - } -} -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_8341) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_8341) -void FLEXCAN_EnterFreezeMode(CAN_Type *base) -{ - uint32_t u32TimeoutCount = 0U; - uint32_t u32TempMCR = 0U; - uint32_t u32TempIMASK1 = 0U; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - uint32_t u32TempIMASK2 = 0U; -#endif - - /* Step1: set FRZ and HALT bit enable in MCR. */ - base->MCR |= CAN_MCR_FRZ_MASK; - base->MCR |= CAN_MCR_HALT_MASK; - - /* Step2: to check if MDIS bit set in MCR. if yes, clear it. */ - if (0U != (base->MCR & CAN_MCR_MDIS_MASK)) - { - base->MCR &= ~CAN_MCR_MDIS_MASK; - } - - /* Step3: Poll the MCR register until the Freeze Acknowledge (FRZACK) bit is set. */ - u32TimeoutCount = (uint32_t)FLEXCAN_WAIT_TIMEOUT * 100U; - while ((0U == (base->MCR & CAN_MCR_FRZACK_MASK)) && (u32TimeoutCount > 0U)) - { - u32TimeoutCount--; - } - - /* Step4: check whether the timeout reached. if no skip step5 to step8. */ - if (0U == u32TimeoutCount) - { - /* backup MCR and IMASK register. Errata document not descript it, but we need backup for step 8A and 9A. */ - u32TempMCR = base->MCR; - u32TempIMASK1 = base->IMASK1; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - u32TempIMASK2 = base->IMASK2; -#endif - /* Step5: Set the Soft Reset bit ((SOFTRST) in the MCR.*/ - base->MCR |= CAN_MCR_SOFTRST_MASK; - - /* Step6: Poll the MCR register until the Soft Reset (SOFTRST) bit is cleared. */ - while (CAN_MCR_SOFTRST_MASK == (base->MCR & CAN_MCR_SOFTRST_MASK)) - { - } - - /* Step7: reconfig MCR. */ - base->MCR = u32TempMCR; - - /* Step8: reconfig IMASK. */ - base->IMASK1 = u32TempIMASK1; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - base->IMASK2 = u32TempIMASK2; -#endif - } -} -#else -void FLEXCAN_EnterFreezeMode(CAN_Type *base) -{ - /* Set Freeze, Halt bits. */ - base->MCR |= CAN_MCR_FRZ_MASK; - base->MCR |= CAN_MCR_HALT_MASK; - while (0U == (base->MCR & CAN_MCR_FRZACK_MASK)) - { - } -} -#endif - -/*! - * brief Exit FlexCAN Freeze Mode. - * - * This function makes the FlexCAN leave Freeze Mode. - * - * param base FlexCAN peripheral base address. - */ -void FLEXCAN_ExitFreezeMode(CAN_Type *base) -{ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - /* Clean FlexCAN Access With Non-Correctable Error Interrupt Flag to avoid be put in freeze mode. */ - FLEXCAN_ClearStatusFlags(base, (uint64_t)kFLEXCAN_FlexCanAccessNonCorrectableErrorIntFlag | - (uint64_t)kFLEXCAN_FlexCanAccessNonCorrectableErrorOverrunFlag); -#endif - - /* Clear Freeze, Halt bits. */ - base->MCR &= ~CAN_MCR_HALT_MASK; - base->MCR &= ~CAN_MCR_FRZ_MASK; - - /* Wait until the FlexCAN Module exit freeze mode. */ - while (0U != (base->MCR & CAN_MCR_FRZACK_MASK)) - { - } -} - -#if !defined(NDEBUG) -/*! - * brief Check if Message Buffer is occupied by Rx FIFO. - * - * This function check if Message Buffer is occupied by Rx FIFO. - * - * param base FlexCAN peripheral base address. - * param mbIdx The FlexCAN Message Buffer index. - * return TRUE if the index MB is occupied by Rx FIFO, FALSE if the index MB not occupied by Rx FIFO. - */ -static bool FLEXCAN_IsMbOccupied(CAN_Type *base, uint8_t mbIdx) -{ - uint8_t lastOccupiedMb; - bool fgRet; - - /* Is Rx FIFO enabled? */ - if (0U != (base->MCR & CAN_MCR_RFEN_MASK)) - { - /* Get RFFN value. */ - lastOccupiedMb = (uint8_t)((base->CTRL2 & CAN_CTRL2_RFFN_MASK) >> CAN_CTRL2_RFFN_SHIFT); - /* Calculate the number of last Message Buffer occupied by Rx FIFO. */ - lastOccupiedMb = ((lastOccupiedMb + 1U) * 2U) + 5U; - -#if ((defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829)) - /* the first valid MB should be occupied by ERRATA 5461 or 5829. */ - lastOccupiedMb += 1U; -#endif - fgRet = (mbIdx <= lastOccupiedMb); - } - else - { -#if ((defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829)) - if (0U == mbIdx) - { - fgRet = true; - } - else -#endif - { - fgRet = false; - } - } - - return fgRet; -} -#endif - -#if ((defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829)) -/*! - * brief Get the first valid Message buffer ID of give FlexCAN instance. - * - * This function is a helper function for Errata 5641 workaround. - * - * param base FlexCAN peripheral base address. - * return The first valid Message Buffer Number. - */ -static uint8_t FLEXCAN_GetFirstValidMb(CAN_Type *base) -{ - uint8_t firstValidMbNum; - - if (0U != (base->MCR & CAN_MCR_RFEN_MASK)) - { - firstValidMbNum = (uint8_t)((base->CTRL2 & CAN_CTRL2_RFFN_MASK) >> CAN_CTRL2_RFFN_SHIFT); - firstValidMbNum = ((firstValidMbNum + 1U) * 2U) + 6U; - } - else - { - firstValidMbNum = 0U; - } - - return firstValidMbNum; -} -#endif - -/*! - * brief Reset the FlexCAN Instance. - * - * Restores the FlexCAN module to reset state, notice that this function - * will set all the registers to reset state so the FlexCAN module can not work - * after calling this API. - * - * param base FlexCAN peripheral base address. - */ -static void FLEXCAN_Reset(CAN_Type *base) -{ - /* The module must should be first exit from low power - * mode, and then soft reset can be applied. - */ - assert(0U == (base->MCR & CAN_MCR_MDIS_MASK)); - - uint8_t i; - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_DOZE_MODE_SUPPORT) && FSL_FEATURE_FLEXCAN_HAS_DOZE_MODE_SUPPORT) - if (0 != (FSL_FEATURE_FLEXCAN_INSTANCE_HAS_DOZE_MODE_SUPPORTn(base))) - { - /* De-assert DOZE Enable Bit. */ - base->MCR &= ~CAN_MCR_DOZE_MASK; - } -#endif - - /* Wait until FlexCAN exit from any Low Power Mode. */ - while (0U != (base->MCR & CAN_MCR_LPMACK_MASK)) - { - } - - /* Assert Soft Reset Signal. */ - base->MCR |= CAN_MCR_SOFTRST_MASK; - /* Wait until FlexCAN reset completes. */ - while (0U != (base->MCR & CAN_MCR_SOFTRST_MASK)) - { - } - -/* Reset MCR register. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_GLITCH_FILTER) && FSL_FEATURE_FLEXCAN_HAS_GLITCH_FILTER) - base->MCR |= CAN_MCR_WRNEN_MASK | CAN_MCR_WAKSRC_MASK | - CAN_MCR_MAXMB((uint32_t)FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(base) - 1U); -#else - base->MCR |= - CAN_MCR_WRNEN_MASK | CAN_MCR_MAXMB((uint32_t)FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(base) - 1U); -#endif - - /* Reset CTRL1 and CTRL2 register, default to eanble SMP feature which enable three sample point to determine the - * received bit's value of the. */ - base->CTRL1 = CAN_CTRL1_SMP_MASK; - base->CTRL2 = CAN_CTRL2_TASD(0x16) | CAN_CTRL2_RRS_MASK | CAN_CTRL2_EACEN_MASK; - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - /* Enable unrestricted write access to FlexCAN memory. */ - base->CTRL2 |= CAN_CTRL2_WRMFRZ_MASK; - /* Do memory initialization for all FlexCAN RAM in order to have the parity bits in memory properly - updated. */ - *(volatile uint32_t *)CAN_INIT_RXFIR = 0x0U; - flexcan_memset(CAN_INIT_MEMORY_BASE_1, 0, CAN_INIT_MEMORY_SIZE_1); - flexcan_memset(CAN_INIT_MEMORY_BASE_2, 0, CAN_INIT_MEMORY_SIZE_2); - /* Disable unrestricted write access to FlexCAN memory. */ - base->CTRL2 &= ~CAN_CTRL2_WRMFRZ_MASK; - - /* Clean all memory error flags. */ - FLEXCAN_ClearStatusFlags(base, (uint64_t)kFLEXCAN_AllMemoryErrorFlag); -#else - /* Only need clean all Message Buffer memory. */ - flexcan_memset((void *)&base->MB[0], 0, sizeof(base->MB)); -#endif - - /* Clean all individual Rx Mask of Message Buffers. */ - for (i = 0; i < (uint32_t)FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(base); i++) - { - base->RXIMR[i] = 0x3FFFFFFF; - } - - /* Clean Global Mask of Message Buffers. */ - base->RXMGMASK = 0x3FFFFFFF; - /* Clean Global Mask of Message Buffer 14. */ - base->RX14MASK = 0x3FFFFFFF; - /* Clean Global Mask of Message Buffer 15. */ - base->RX15MASK = 0x3FFFFFFF; - /* Clean Global Mask of Rx FIFO. */ - base->RXFGMASK = 0x3FFFFFFF; -} - -/*! - * brief Set bit rate of FlexCAN classical CAN frame or CAN FD frame nominal phase. - * - * This function set the bit rate of classical CAN frame or CAN FD frame nominal phase base on - * FLEXCAN_CalculateImprovedTimingValues() API calculated timing values. - * - * note Calling FLEXCAN_SetBitRate() overrides the bit rate set in FLEXCAN_Init(). - * - * param base FlexCAN peripheral base address. - * param sourceClock_Hz Source Clock in Hz. - * param bitRate_Bps Bit rate in Bps. - * return kStatus_Success - Set CAN baud rate (only Nominal phase) successfully. - */ -status_t FLEXCAN_SetBitRate(CAN_Type *base, uint32_t sourceClock_Hz, uint32_t bitRate_Bps) -{ - flexcan_timing_config_t timingCfg; - status_t result = kStatus_Fail; - - if (FLEXCAN_CalculateImprovedTimingValues(base, bitRate_Bps, sourceClock_Hz, &timingCfg)) - { - FLEXCAN_SetTimingConfig(base, &timingCfg); - result = kStatus_Success; - } - - return result; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * @brief Set bit rate of FlexCAN FD frame. - * - * This function set the baud rate of FLEXCAN FD base on FLEXCAN_FDCalculateImprovedTimingValues() API calculated timing - * values. - * - * @param base FlexCAN peripheral base address. - * @param sourceClock_Hz Source Clock in Hz. - * @param bitRateN_Bps Nominal bit Rate in Bps. - * @param bitRateD_Bps Data bit Rate in Bps. - * @return kStatus_Success - Set CAN FD bit rate (include Nominal and Data phase) successfully. - */ -status_t FLEXCAN_SetFDBitRate(CAN_Type *base, uint32_t sourceClock_Hz, uint32_t bitRateN_Bps, uint32_t bitRateD_Bps) -{ - flexcan_timing_config_t timingCfg; - status_t result = kStatus_Fail; - - if (FLEXCAN_FDCalculateImprovedTimingValues(base, bitRateN_Bps, bitRateD_Bps, sourceClock_Hz, &timingCfg)) - { - FLEXCAN_SetFDTimingConfig(base, &timingCfg); - result = kStatus_Success; - } - - return result; -} -#endif - -/*! - * brief Initializes a FlexCAN instance. - * - * This function initializes the FlexCAN module with user-defined settings. - * This example shows how to set up the flexcan_config_t parameters and how - * to call the FLEXCAN_Init function by passing in these parameters. - * code - * flexcan_config_t flexcanConfig; - * flexcanConfig.clkSrc = kFLEXCAN_ClkSrc0; - * flexcanConfig.bitRate = 1000000U; - * flexcanConfig.maxMbNum = 16; - * flexcanConfig.enableLoopBack = false; - * flexcanConfig.enableSelfWakeup = false; - * flexcanConfig.enableIndividMask = false; - * flexcanConfig.disableSelfReception = false; - * flexcanConfig.enableListenOnlyMode = false; - * flexcanConfig.enableDoze = false; - * flexcanConfig.timingConfig = timingConfig; - * FLEXCAN_Init(CAN0, &flexcanConfig, 40000000UL); - * endcode - * - * param base FlexCAN peripheral base address. - * param pConfig Pointer to the user-defined configuration structure. - * param sourceClock_Hz FlexCAN Protocol Engine clock source frequency in Hz. - */ -void FLEXCAN_Init(CAN_Type *base, const flexcan_config_t *pConfig, uint32_t sourceClock_Hz) -{ - /* Assertion. */ - assert(NULL != pConfig); - assert((pConfig->maxMbNum > 0U) && - (pConfig->maxMbNum <= (uint8_t)FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(base))); - - uint32_t mcrTemp; - uint32_t ctrl1Temp; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - uint32_t instance; -#endif - flexcan_timing_config_t timingCfg = pConfig->timingConfig; - /* FlexCAN classical CAN frame or CAN FD frame nominal phase timing setting formula: - * quantum = 1 + (phaseSeg1 + 1) + (phaseSeg2 + 1) + (propSeg + 1); - */ - uint32_t quantum = (1U + ((uint32_t)timingCfg.phaseSeg1 + 1U) + ((uint32_t)timingCfg.phaseSeg2 + 1U) + - ((uint32_t)timingCfg.propSeg + 1U)); - uint32_t tqFre = pConfig->bitRate * quantum; - uint16_t maxDivider; - - /* Assertion: Check bit rate value. */ - assert((pConfig->bitRate != 0U) && (pConfig->bitRate <= 1000000U) && (tqFre <= sourceClock_Hz)); -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0 != FSL_FEATURE_FLEXCAN_INSTANCE_HAS_FLEXIBLE_DATA_RATEn(base)) - { -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - assert((tqFre * MAX_ENPRESDIV) >= sourceClock_Hz); - maxDivider = MAX_ENPRESDIV; -#else - assert((tqFre * MAX_EPRESDIV) >= sourceClock_Hz); - maxDivider = MAX_EPRESDIV; -#endif - } - else - { - assert((tqFre * MAX_PRESDIV) >= sourceClock_Hz); - maxDivider = MAX_PRESDIV; - } -#else - assert((tqFre * MAX_PRESDIV) >= sourceClock_Hz); - maxDivider = MAX_PRESDIV; -#endif - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - instance = FLEXCAN_GetInstance(base); - /* Enable FlexCAN clock. */ - (void)CLOCK_EnableClock(s_flexcanClock[instance]); - /* - * Check the CAN clock in this device whether affected by Other clock gate - * If it affected, we'd better to change other clock source, - * If user insist on using that clock source, user need open these gate at same time, - * In this scene, User need to care the power consumption. - */ - assert(CAN_CLOCK_CHECK_NO_AFFECTS); -#if defined(FLEXCAN_PERIPH_CLOCKS) - /* Enable FlexCAN serial clock. */ - (void)CLOCK_EnableClock(s_flexcanPeriphClock[instance]); -#endif /* FLEXCAN_PERIPH_CLOCKS */ -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(FLEXCAN_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_flexcanResets[FLEXCAN_GetInstance(base)]); -#endif - -#if defined(CAN_CTRL1_CLKSRC_MASK) -#if (defined(FSL_FEATURE_FLEXCAN_SUPPORT_ENGINE_CLK_SEL_REMOVE) && FSL_FEATURE_FLEXCAN_SUPPORT_ENGINE_CLK_SEL_REMOVE) - if (0 == FSL_FEATURE_FLEXCAN_INSTANCE_SUPPORT_ENGINE_CLK_SEL_REMOVEn(base)) -#endif /* FSL_FEATURE_FLEXCAN_SUPPORT_ENGINE_CLK_SEL_REMOVE */ - { - /* Disable FlexCAN Module. */ - FLEXCAN_Enable(base, false); - - /* Protocol-Engine clock source selection, This bit must be set - * when FlexCAN Module in Disable Mode. - */ - base->CTRL1 = (kFLEXCAN_ClkSrc0 == pConfig->clkSrc) ? (base->CTRL1 & ~CAN_CTRL1_CLKSRC_MASK) : - (base->CTRL1 | CAN_CTRL1_CLKSRC_MASK); - } -#endif /* CAN_CTRL1_CLKSRC_MASK */ - - /* Enable FlexCAN Module for configuration. */ - FLEXCAN_Enable(base, true); - - /* Reset to known status. */ - FLEXCAN_Reset(base); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - /* Enable to update in MCER. */ - base->CTRL2 |= CAN_CTRL2_ECRWRE_MASK; - base->MECR &= ~CAN_MECR_ECRWRDIS_MASK; - - /* Enable/Disable Memory Error Detection and Correction.*/ - base->MECR = (pConfig->enableMemoryErrorControl) ? (base->MECR & ~CAN_MECR_ECCDIS_MASK) : - (base->MECR | CAN_MECR_ECCDIS_MASK); - - /* Enable/Disable Non-Correctable Errors In FlexCAN Access Put Device In Freeze Mode. */ - base->MECR = (pConfig->enableNonCorrectableErrorEnterFreeze) ? (base->MECR | CAN_MECR_NCEFAFRZ_MASK) : - (base->MECR & ~CAN_MECR_NCEFAFRZ_MASK); - /* Lock MCER register. */ - base->CTRL2 &= ~CAN_CTRL2_ECRWRE_MASK; -#endif - - /* Save current CTRL1 value and enable to enter Freeze mode(enabled by default). */ - ctrl1Temp = base->CTRL1; - - /* Save current MCR value and enable to enter Freeze mode(enabled by default). */ - mcrTemp = base->MCR; - - /* Enable Loop Back Mode? */ - ctrl1Temp = (pConfig->enableLoopBack) ? (ctrl1Temp | CAN_CTRL1_LPB_MASK) : (ctrl1Temp & ~CAN_CTRL1_LPB_MASK); - - /* Enable Timer Sync? */ - ctrl1Temp = (pConfig->enableTimerSync) ? (ctrl1Temp | CAN_CTRL1_TSYN_MASK) : (ctrl1Temp & ~CAN_CTRL1_TSYN_MASK); - - /* Enable Listen Only Mode? */ - ctrl1Temp = (pConfig->enableListenOnlyMode) ? ctrl1Temp | CAN_CTRL1_LOM_MASK : ctrl1Temp & ~CAN_CTRL1_LOM_MASK; - -#if !(defined(FSL_FEATURE_FLEXCAN_HAS_NO_SUPV_SUPPORT) && FSL_FEATURE_FLEXCAN_HAS_NO_SUPV_SUPPORT) - /* Enable Supervisor Mode? */ - mcrTemp = (pConfig->enableSupervisorMode) ? mcrTemp | CAN_MCR_SUPV_MASK : mcrTemp & ~CAN_MCR_SUPV_MASK; -#endif - - /* Set the maximum number of Message Buffers */ - mcrTemp = (mcrTemp & ~CAN_MCR_MAXMB_MASK) | CAN_MCR_MAXMB((uint32_t)pConfig->maxMbNum - 1U); - - /* Enable Self Wake Up Mode and configure the wake up source. */ - mcrTemp = (pConfig->enableSelfWakeup) ? (mcrTemp | CAN_MCR_SLFWAK_MASK) : (mcrTemp & ~CAN_MCR_SLFWAK_MASK); - mcrTemp = (kFLEXCAN_WakeupSrcFiltered == pConfig->wakeupSrc) ? (mcrTemp | CAN_MCR_WAKSRC_MASK) : - (mcrTemp & ~CAN_MCR_WAKSRC_MASK); -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - /* Enable Pretended Networking Mode? When Pretended Networking mode is set, Self Wake Up feature must be disabled.*/ - mcrTemp = (pConfig->enablePretendedeNetworking) ? ((mcrTemp & ~CAN_MCR_SLFWAK_MASK) | CAN_MCR_PNET_EN_MASK) : - (mcrTemp & ~CAN_MCR_PNET_EN_MASK); -#endif - - /* Enable Individual Rx Masking and Queue feature? */ - mcrTemp = (pConfig->enableIndividMask) ? (mcrTemp | CAN_MCR_IRMQ_MASK) : (mcrTemp & ~CAN_MCR_IRMQ_MASK); - - /* Disable Self Reception? */ - mcrTemp = (pConfig->disableSelfReception) ? mcrTemp | CAN_MCR_SRXDIS_MASK : mcrTemp & ~CAN_MCR_SRXDIS_MASK; - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_DOZE_MODE_SUPPORT) && FSL_FEATURE_FLEXCAN_HAS_DOZE_MODE_SUPPORT) - if (0 != FSL_FEATURE_FLEXCAN_INSTANCE_HAS_DOZE_MODE_SUPPORTn(base)) - { - /* Enable Doze Mode? */ - mcrTemp = (pConfig->enableDoze) ? (mcrTemp | CAN_MCR_DOZE_MASK) : (mcrTemp & ~CAN_MCR_DOZE_MASK); - } -#endif - - /* Write back CTRL1 Configuration to register. */ - base->CTRL1 = ctrl1Temp; - - /* Write back MCR Configuration to register. */ - base->MCR = mcrTemp; - - /* Check whether Nominal Bit Rate Prescaler is overflow. */ - if ((sourceClock_Hz / tqFre - 1U) > maxDivider) - { - timingCfg.preDivider = maxDivider; - } - else - { - timingCfg.preDivider = (uint16_t)(sourceClock_Hz / tqFre) - 1U; - } - - /* Update actual timing characteristic. */ - FLEXCAN_SetTimingConfig(base, &timingCfg); -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * brief Initializes a FlexCAN instance. - * - * This function initializes the FlexCAN module with user-defined settings. - * This example shows how to set up the flexcan_config_t parameters and how - * to call the FLEXCAN_FDInit function by passing in these parameters. - * code - * flexcan_config_t flexcanConfig; - * flexcanConfig.clkSrc = kFLEXCAN_ClkSrc0; - * flexcanConfig.bitRate = 1000000U; - * flexcanConfig.bitRateFD = 2000000U; - * flexcanConfig.maxMbNum = 16; - * flexcanConfig.enableLoopBack = false; - * flexcanConfig.enableSelfWakeup = false; - * flexcanConfig.enableIndividMask = false; - * flexcanConfig.disableSelfReception = false; - * flexcanConfig.enableListenOnlyMode = false; - * flexcanConfig.enableDoze = false; - * flexcanConfig.timingConfig = timingConfig; - * FLEXCAN_FDInit(CAN0, &flexcanConfig, 80000000UL, kFLEXCAN_16BperMB, true); - * endcode - * - * param base FlexCAN peripheral base address. - * param pConfig Pointer to the user-defined configuration structure. - * param sourceClock_Hz FlexCAN Protocol Engine clock source frequency in Hz. - * param dataSize FlexCAN Message Buffer payload size. The actual transmitted or received CAN FD frame data size needs - * to be less than or equal to this value. - * param brs True if bit rate switch is enabled in FD mode. - */ -void FLEXCAN_FDInit( - CAN_Type *base, const flexcan_config_t *pConfig, uint32_t sourceClock_Hz, flexcan_mb_size_t dataSize, bool brs) -{ - assert((uint32_t)dataSize <= 3U); - assert(((pConfig->bitRate < pConfig->bitRateFD) && brs) || ((pConfig->bitRate == pConfig->bitRateFD) && (!brs))); - - uint32_t fdctrl = 0U; - flexcan_timing_config_t timingCfg = pConfig->timingConfig; - /* FlexCAN FD frame data phase timing setting formula: - * quantum = 1 + (fphaseSeg1 + 1) + (fphaseSeg2 + 1) + fpropSeg; - */ - uint32_t quantum = (1U + ((uint32_t)timingCfg.fphaseSeg1 + 1U) + ((uint32_t)timingCfg.fphaseSeg2 + 1U) + - (uint32_t)timingCfg.fpropSeg); - uint32_t tqFre = pConfig->bitRateFD * quantum; - uint16_t maxDivider; - - /* Check bit rate value. */ - assert((pConfig->bitRateFD <= MAX_CANFD_BITRATE) && (tqFre <= sourceClock_Hz)); -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - assert((tqFre * MAX_EDPRESDIV) >= sourceClock_Hz); - maxDivider = MAX_EDPRESDIV; -#else - assert((tqFre * MAX_FPRESDIV) >= sourceClock_Hz); - maxDivider = MAX_FPRESDIV; -#endif - - /* Initialization of classical CAN. */ - FLEXCAN_Init(base, pConfig, sourceClock_Hz); - - /* Check whether Data Bit Rate Prescaler is overflow. */ - if ((sourceClock_Hz / tqFre - 1U) > maxDivider) - { - timingCfg.fpreDivider = maxDivider; - } - else - { - timingCfg.fpreDivider = (uint16_t)(sourceClock_Hz / tqFre) - 1U; - } - - /* Update actual timing characteristic. */ - FLEXCAN_SetFDTimingConfig(base, &timingCfg); - - /* read FDCTRL register. */ - fdctrl = base->FDCTRL; - - /* Enable FD operation and set bit rate switch. */ - if (brs) - { - fdctrl |= CAN_FDCTRL_FDRATE_MASK; - } - else - { - fdctrl &= ~CAN_FDCTRL_FDRATE_MASK; - } - - /* Before use "|=" operation for multi-bits field, CPU should clean previous Setting. */ - fdctrl = (fdctrl & ~CAN_FDCTRL_MBDSR0_MASK) | CAN_FDCTRL_MBDSR0(dataSize); -#if defined(CAN_FDCTRL_MBDSR1_MASK) - fdctrl = (fdctrl & ~CAN_FDCTRL_MBDSR1_MASK) | CAN_FDCTRL_MBDSR1(dataSize); -#endif -#if defined(CAN_FDCTRL_MBDSR2_MASK) - fdctrl = (fdctrl & ~CAN_FDCTRL_MBDSR2_MASK) | CAN_FDCTRL_MBDSR2(dataSize); -#endif -#if defined(CAN_FDCTRL_MBDSR3_MASK) - fdctrl = (fdctrl & ~CAN_FDCTRL_MBDSR3_MASK) | CAN_FDCTRL_MBDSR3(dataSize); -#endif - - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - /* Enable CAN FD operation. */ - base->MCR |= CAN_MCR_FDEN_MASK; - /* Clear SMP bit when CAN FD is enabled (CAN FD only can use one regular sample point plus one optional secondary - * sampling point). */ - base->CTRL1 &= ~CAN_CTRL1_SMP_MASK; - - if (brs && !(pConfig->enableLoopBack)) - { -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - /* The TDC offset should be configured as shown in this equation : offset = DTSEG1 + 2 */ - if (((uint32_t)pConfig->timingConfig.fphaseSeg1 + pConfig->timingConfig.fpropSeg + 2U) * - (pConfig->timingConfig.fpreDivider + 1U) < - MAX_ETDCOFF) - { - base->ETDC = - CAN_ETDC_ETDCEN_MASK | CAN_ETDC_TDMDIS(!pConfig->enableTransceiverDelayMeasure) | - CAN_ETDC_ETDCOFF(((uint32_t)pConfig->timingConfig.fphaseSeg1 + pConfig->timingConfig.fpropSeg + 2U) * - (pConfig->timingConfig.fpreDivider + 1U)); - } - else - { - /* Enable the Transceiver Delay Compensation */ - base->ETDC = CAN_ETDC_ETDCEN_MASK | CAN_ETDC_TDMDIS(!pConfig->enableTransceiverDelayMeasure) | - CAN_ETDC_ETDCOFF(MAX_ETDCOFF); - } -#else - /* The TDC offset should be configured as shown in this equation : offset = PSEG1 + PROPSEG + 2 */ - if (((uint32_t)pConfig->timingConfig.fphaseSeg1 + pConfig->timingConfig.fpropSeg + 2U) * - (pConfig->timingConfig.fpreDivider + 1U) < - MAX_TDCOFF) - { - fdctrl = - (fdctrl & ~CAN_FDCTRL_TDCOFF_MASK) | - CAN_FDCTRL_TDCOFF(((uint32_t)pConfig->timingConfig.fphaseSeg1 + pConfig->timingConfig.fpropSeg + 2U) * - (pConfig->timingConfig.fpreDivider + 1U)); - } - else - { - fdctrl = (fdctrl & ~CAN_FDCTRL_TDCOFF_MASK) | CAN_FDCTRL_TDCOFF(MAX_TDCOFF); - } - /* Enable the Transceiver Delay Compensation */ - fdctrl = (fdctrl & ~CAN_FDCTRL_TDCEN_MASK) | CAN_FDCTRL_TDCEN_MASK; -#endif - } - - /* update the FDCTL register. */ - base->FDCTRL = fdctrl; - - /* Enable CAN FD ISO mode by default. */ - base->CTRL2 |= CAN_CTRL2_ISOCANFDEN_MASK; - - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); -} -#endif - -/*! - * brief De-initializes a FlexCAN instance. - * - * This function disables the FlexCAN module clock and sets all register values - * to the reset value. - * - * param base FlexCAN peripheral base address. - */ -void FLEXCAN_Deinit(CAN_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - uint32_t instance; -#endif - /* Reset all Register Contents. */ - FLEXCAN_Reset(base); - - /* Disable FlexCAN module. */ - FLEXCAN_Enable(base, false); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - instance = FLEXCAN_GetInstance(base); -#if defined(FLEXCAN_PERIPH_CLOCKS) - /* Disable FlexCAN serial clock. */ - (void)CLOCK_DisableClock(s_flexcanPeriphClock[instance]); -#endif /* FLEXCAN_PERIPH_CLOCKS */ - /* Disable FlexCAN clock. */ - (void)CLOCK_DisableClock(s_flexcanClock[instance]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Gets the default configuration structure. - * - * This function initializes the FlexCAN configuration structure to default values. The default - * values are as follows. - * flexcanConfig->clkSrc = kFLEXCAN_ClkSrc0; - * flexcanConfig->bitRate = 1000000U; - * flexcanConfig->bitRateFD = 2000000U; - * flexcanConfig->maxMbNum = 16; - * flexcanConfig->enableLoopBack = false; - * flexcanConfig->enableSelfWakeup = false; - * flexcanConfig->enableIndividMask = false; - * flexcanConfig->disableSelfReception = false; - * flexcanConfig->enableListenOnlyMode = false; - * flexcanConfig->enableDoze = false; - * flexcanConfig->enablePretendedeNetworking = false; - * flexcanConfig->enableMemoryErrorControl = true; - * flexcanConfig->enableNonCorrectableErrorEnterFreeze = true; - * flexcanConfig->enableTransceiverDelayMeasure = true; - * flexcanConfig.timingConfig = timingConfig; - * - * param pConfig Pointer to the FlexCAN configuration structure. - */ -void FLEXCAN_GetDefaultConfig(flexcan_config_t *pConfig) -{ - /* Assertion. */ - assert(NULL != pConfig); - - /* Initializes the configure structure to zero. */ - (void)memset(pConfig, 0, sizeof(*pConfig)); - - /* Initialize FlexCAN Module config struct with default value. */ - pConfig->clkSrc = kFLEXCAN_ClkSrc0; - pConfig->bitRate = 1000000U; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - pConfig->bitRateFD = 2000000U; -#endif - pConfig->maxMbNum = 16; - pConfig->enableLoopBack = false; - pConfig->enableTimerSync = true; - pConfig->enableSelfWakeup = false; - pConfig->wakeupSrc = kFLEXCAN_WakeupSrcUnfiltered; - pConfig->enableIndividMask = false; - pConfig->disableSelfReception = false; - pConfig->enableListenOnlyMode = false; -#if !(defined(FSL_FEATURE_FLEXCAN_HAS_NO_SUPV_SUPPORT) && FSL_FEATURE_FLEXCAN_HAS_NO_SUPV_SUPPORT) - pConfig->enableSupervisorMode = true; -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_DOZE_MODE_SUPPORT) && FSL_FEATURE_FLEXCAN_HAS_DOZE_MODE_SUPPORT) - pConfig->enableDoze = false; -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - pConfig->enablePretendedeNetworking = false; -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - pConfig->enableMemoryErrorControl = true; - pConfig->enableNonCorrectableErrorEnterFreeze = true; -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - pConfig->enableTransceiverDelayMeasure = true; -#endif - - /* Default protocol timing configuration, nominal bit time quantum is 10 (80% SP), data bit time quantum is 5 - * (60%). Suggest use FLEXCAN_CalculateImprovedTimingValues/FLEXCAN_FDCalculateImprovedTimingValues to get the - * improved timing configuration.*/ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - pConfig->timingConfig.phaseSeg1 = 1; - pConfig->timingConfig.phaseSeg2 = 1; - pConfig->timingConfig.propSeg = 4; - pConfig->timingConfig.rJumpwidth = 1; - pConfig->timingConfig.fphaseSeg1 = 1; - pConfig->timingConfig.fphaseSeg2 = 1; - pConfig->timingConfig.fpropSeg = 0; - pConfig->timingConfig.frJumpwidth = 1; -#else - pConfig->timingConfig.phaseSeg1 = 1; - pConfig->timingConfig.phaseSeg2 = 1; - pConfig->timingConfig.propSeg = 4; - pConfig->timingConfig.rJumpwidth = 1; -#endif -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) -/*! - * brief Configures the FlexCAN Pretended Networking mode. - * - * This function configures the FlexCAN Pretended Networking mode with given configuration. - * - * param base FlexCAN peripheral base address. - * param pConfig Pointer to the FlexCAN Rx FIFO configuration structure. - */ -void FLEXCAN_SetPNConfig(CAN_Type *base, const flexcan_pn_config_t *pConfig) -{ - /* Assertion. */ - assert(NULL != pConfig); - assert(0U != pConfig->matchNum); - uint32_t pnctrl; - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - pnctrl = (pConfig->matchNum > 1U) ? CAN_CTRL1_PN_FCS(0x2U | (uint32_t)pConfig->matchSrc) : - CAN_CTRL1_PN_FCS(pConfig->matchSrc); - pnctrl |= (pConfig->enableMatch) ? (CAN_CTRL1_PN_WUMF_MSK_MASK) : 0U; - pnctrl |= (pConfig->enableTimeout) ? (CAN_CTRL1_PN_WTOF_MSK_MASK) : 0U; - pnctrl |= CAN_CTRL1_PN_NMATCH(pConfig->matchNum) | CAN_CTRL1_PN_IDFS(pConfig->idMatchMode) | - CAN_CTRL1_PN_PLFS(pConfig->dataMatchMode); - base->CTRL1_PN = pnctrl; - base->CTRL2_PN = CAN_CTRL2_PN_MATCHTO(pConfig->timeoutValue); - base->FLT_ID1 = pConfig->idLower; - base->FLT_ID2_IDMASK = pConfig->idUpper; - base->FLT_DLC = CAN_FLT_DLC_FLT_DLC_LO(pConfig->lengthLower) | CAN_FLT_DLC_FLT_DLC_HI(pConfig->lengthUpper); - base->PL1_LO = pConfig->lowerWord0; - base->PL1_HI = pConfig->lowerWord1; - base->PL2_PLMASK_LO = pConfig->upperWord0; - base->PL2_PLMASK_HI = pConfig->upperWord1; - - FLEXCAN_ClearStatusFlags(base, (uint64_t)kFLEXCAN_PNMatchIntFlag | (uint64_t)kFLEXCAN_PNTimeoutIntFlag); - - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); -} - -/*! - * brief Reads a FlexCAN Message from Wake Up MB. - * - * This function reads a CAN message from the FlexCAN Wake up Message Buffers. There are four Wake up Message Buffers - * (WMBs) used to store incoming messages in Pretended Networking mode. The WMB index indicates the arrival order. The - * last message is stored in WMB3. - * - * param base FlexCAN peripheral base address. - * param pRxFrame Pointer to CAN message frame structure for reception. - * param mbIdx The FlexCAN Wake up Message Buffer index. Range in 0x0 ~ 0x3. - * retval kStatus_Success - Read Message from Wake up Message Buffer successfully. - * retval kStatus_Fail - Wake up Message Buffer has no valid content. - */ -status_t FLEXCAN_ReadPNWakeUpMB(CAN_Type *base, uint8_t mbIdx, flexcan_frame_t *pRxFrame) -{ - /* Assertion. */ - assert(NULL != pRxFrame); - assert(mbIdx <= 0x3U); - - uint32_t cs_temp; - status_t status; - - /* Check if Wake Up MB has valid content. */ - if (CAN_WU_MTC_MCOUNTER(mbIdx) < (base->WU_MTC & CAN_WU_MTC_MCOUNTER_MASK)) - { - /* Read CS field of wake up Message Buffer. */ - cs_temp = base->WMB[mbIdx].CS; - - /* Store Message ID. */ - pRxFrame->id = base->WMB[mbIdx].ID & (CAN_ID_EXT_MASK | CAN_ID_STD_MASK); - - /* Get the message ID and format. */ - pRxFrame->format = (cs_temp & CAN_CS_IDE_MASK) != 0U ? (uint8_t)kFLEXCAN_FrameFormatExtend : - (uint8_t)kFLEXCAN_FrameFormatStandard; - - /* Get the message type. */ - pRxFrame->type = - (cs_temp & CAN_CS_RTR_MASK) != 0U ? (uint8_t)kFLEXCAN_FrameTypeRemote : (uint8_t)kFLEXCAN_FrameTypeData; - - /* Get the message length. */ - pRxFrame->length = (uint8_t)((cs_temp & CAN_CS_DLC_MASK) >> CAN_CS_DLC_SHIFT); - - /* Messages received during Pretended Networking mode don't have time stamps, and the respective field in the - WMB structure must be ignored. */ - pRxFrame->timestamp = 0x0; - - /* Store Message Payload. */ - pRxFrame->dataWord0 = base->WMB[mbIdx].D03; - pRxFrame->dataWord1 = base->WMB[mbIdx].D47; - - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} -#endif - -/*! - * brief Sets the FlexCAN classical protocol timing characteristic. - * - * This function gives user settings to classical CAN or CAN FD nominal phase timing characteristic. - * The function is for an experienced user. For less experienced users, call the FLEXCAN_GetDefaultConfig() - * and get the default timing characteristicsthe, then call FLEXCAN_Init() and fill the - * bit rate field. - * - * note Calling FLEXCAN_SetTimingConfig() overrides the bit rate set - * in FLEXCAN_Init(). - * - * param base FlexCAN peripheral base address. - * param pConfig Pointer to the timing configuration structure. - */ -void FLEXCAN_SetTimingConfig(CAN_Type *base, const flexcan_timing_config_t *pConfig) -{ - /* Assertion. */ - assert(NULL != pConfig); - - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0 != FSL_FEATURE_FLEXCAN_INSTANCE_HAS_FLEXIBLE_DATA_RATEn(base)) - { -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - /* Enable extended Bit Timing register ENCBT. */ - base->CTRL2 |= CAN_CTRL2_BTE_MASK; - - /* Updating Timing Setting according to configuration structure. */ - base->EPRS = (base->EPRS & (~CAN_EPRS_ENPRESDIV_MASK)) | CAN_EPRS_ENPRESDIV(pConfig->preDivider); - base->ENCBT = CAN_ENCBT_NRJW(pConfig->rJumpwidth) | - CAN_ENCBT_NTSEG1((uint32_t)pConfig->phaseSeg1 + pConfig->propSeg + 1U) | - CAN_ENCBT_NTSEG2(pConfig->phaseSeg2); -#else - /* On RT106x devices, a single write may be ignored, so it is necessary to read back the register value to - * determine whether the value is written successfully. */ - - do - { - /* Enable Bit Timing register CBT, updating Timing Setting according to configuration structure. */ - base->CBT = CAN_CBT_BTF_MASK | CAN_CBT_EPRESDIV(pConfig->preDivider) | CAN_CBT_ERJW(pConfig->rJumpwidth) | - CAN_CBT_EPSEG1(pConfig->phaseSeg1) | CAN_CBT_EPSEG2(pConfig->phaseSeg2) | - CAN_CBT_EPROPSEG(pConfig->propSeg); - - } while ((CAN_CBT_EPRESDIV(pConfig->preDivider) | CAN_CBT_ERJW(pConfig->rJumpwidth) | - CAN_CBT_EPSEG1(pConfig->phaseSeg1) | CAN_CBT_EPSEG2(pConfig->phaseSeg2) | - CAN_CBT_EPROPSEG(pConfig->propSeg)) != - (base->CBT & (CAN_CBT_EPRESDIV_MASK | CAN_CBT_ERJW_MASK | CAN_CBT_EPSEG1_MASK | CAN_CBT_EPSEG2_MASK | - CAN_CBT_EPROPSEG_MASK))); -#endif - } - else - { - /* Cleaning previous Timing Setting. */ - base->CTRL1 &= ~(CAN_CTRL1_PRESDIV_MASK | CAN_CTRL1_RJW_MASK | CAN_CTRL1_PSEG1_MASK | CAN_CTRL1_PSEG2_MASK | - CAN_CTRL1_PROPSEG_MASK); - - /* Updating Timing Setting according to configuration structure. */ - base->CTRL1 |= (CAN_CTRL1_PRESDIV(pConfig->preDivider) | CAN_CTRL1_RJW(pConfig->rJumpwidth) | - CAN_CTRL1_PSEG1(pConfig->phaseSeg1) | CAN_CTRL1_PSEG2(pConfig->phaseSeg2) | - CAN_CTRL1_PROPSEG(pConfig->propSeg)); - } -#else - /* Cleaning previous Timing Setting. */ - base->CTRL1 &= ~(CAN_CTRL1_PRESDIV_MASK | CAN_CTRL1_RJW_MASK | CAN_CTRL1_PSEG1_MASK | CAN_CTRL1_PSEG2_MASK | - CAN_CTRL1_PROPSEG_MASK); - - /* Updating Timing Setting according to configuration structure. */ - base->CTRL1 |= (CAN_CTRL1_PRESDIV(pConfig->preDivider) | CAN_CTRL1_RJW(pConfig->rJumpwidth) | - CAN_CTRL1_PSEG1(pConfig->phaseSeg1) | CAN_CTRL1_PSEG2(pConfig->phaseSeg2) | - CAN_CTRL1_PROPSEG(pConfig->propSeg)); -#endif - - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * brief Sets the FlexCAN FD data phase timing characteristic. - * - * This function gives user settings to CAN FD data phase timing characteristic. - * The function is for an experienced user. For less experienced users, call the FLEXCAN_GetDefaultConfig() - * and get the default timing characteristicsthe, then call FLEXCAN_FDInit() and fill the - * data phase bit rate field. - * - * note Calling FLEXCAN_SetFDTimingConfig() overrides the bit rate set - * in FLEXCAN_FDInit(). - * - * param base FlexCAN peripheral base address. - * param pConfig Pointer to the timing configuration structure. - */ -void FLEXCAN_SetFDTimingConfig(CAN_Type *base, const flexcan_timing_config_t *pConfig) -{ - /* Assertion. */ - assert(NULL != pConfig); - - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - /* Enable extended Bit Timing register EDCBT. */ - base->CTRL2 |= CAN_CTRL2_BTE_MASK; - - base->EPRS = (base->EPRS & (~CAN_EPRS_EDPRESDIV_MASK)) | CAN_EPRS_EDPRESDIV(pConfig->fpreDivider); - base->EDCBT = CAN_EDCBT_DRJW(pConfig->frJumpwidth) | CAN_EDCBT_DTSEG2(pConfig->fphaseSeg2) | - CAN_EDCBT_DTSEG1((uint32_t)pConfig->fphaseSeg1 + pConfig->fpropSeg); -#else - /* Enable Bit Timing register FDCBT,*/ - base->CBT |= CAN_CBT_BTF_MASK; - - /* On RT106x devices, a single write may be ignored, so it is necessary to read back the register value to determine - * whether the value is written successfully. */ - do - { - /* Updating Timing Setting according to configuration structure. */ - base->FDCBT = (CAN_FDCBT_FPRESDIV(pConfig->fpreDivider) | CAN_FDCBT_FRJW(pConfig->frJumpwidth) | - CAN_FDCBT_FPSEG1(pConfig->fphaseSeg1) | CAN_FDCBT_FPSEG2(pConfig->fphaseSeg2) | - CAN_FDCBT_FPROPSEG(pConfig->fpropSeg)); - } while ((CAN_FDCBT_FPRESDIV(pConfig->fpreDivider) | CAN_FDCBT_FRJW(pConfig->frJumpwidth) | - CAN_FDCBT_FPSEG1(pConfig->fphaseSeg1) | CAN_FDCBT_FPSEG2(pConfig->fphaseSeg2) | - CAN_FDCBT_FPROPSEG(pConfig->fpropSeg)) != - (base->FDCBT & (CAN_FDCBT_FPRESDIV_MASK | CAN_FDCBT_FRJW_MASK | CAN_FDCBT_FPSEG1_MASK | - CAN_FDCBT_FPSEG2_MASK | CAN_FDCBT_FPROPSEG_MASK))); -#endif - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); -} -#endif - -/*! - * brief Sets the FlexCAN receive message buffer global mask. - * - * This function sets the global mask for the FlexCAN message buffer in a matching process. - * The configuration is only effective when the Rx individual mask is disabled in the FLEXCAN_Init(). - * - * param base FlexCAN peripheral base address. - * param mask Rx Message Buffer Global Mask value. - */ -void FLEXCAN_SetRxMbGlobalMask(CAN_Type *base, uint32_t mask) -{ - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - - /* Setting Rx Message Buffer Global Mask value. */ - base->RXMGMASK = mask; - base->RX14MASK = mask; - base->RX15MASK = mask; - - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); -} - -/*! - * brief Sets the FlexCAN receive FIFO global mask. - * - * This function sets the global mask for FlexCAN FIFO in a matching process. - * - * param base FlexCAN peripheral base address. - * param mask Rx Fifo Global Mask value. - */ -void FLEXCAN_SetRxFifoGlobalMask(CAN_Type *base, uint32_t mask) -{ - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - - /* Setting Rx FIFO Global Mask value. */ - base->RXFGMASK = mask; - - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); -} - -/*! - * brief Sets the FlexCAN receive individual mask. - * - * This function sets the individual mask for the FlexCAN matching process. - * The configuration is only effective when the Rx individual mask is enabled in the FLEXCAN_Init(). - * If the Rx FIFO is disabled, the individual mask is applied to the corresponding Message Buffer. - * If the Rx FIFO is enabled, the individual mask for Rx FIFO occupied Message Buffer is applied to - * the Rx Filter with the same index. Note that only the first 32 - * individual masks can be used as the Rx FIFO filter mask. - * - * param base FlexCAN peripheral base address. - * param maskIdx The Index of individual Mask. - * param mask Rx Individual Mask value. - */ -void FLEXCAN_SetRxIndividualMask(CAN_Type *base, uint8_t maskIdx, uint32_t mask) -{ - assert(maskIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); - - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - - /* Setting Rx Individual Mask value. */ - base->RXIMR[maskIdx] = mask; - - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); -} - -/*! - * brief Configures a FlexCAN transmit message buffer. - * - * This function aborts the previous transmission, cleans the Message Buffer, and - * configures it as a Transmit Message Buffer. - * - * param base FlexCAN peripheral base address. - * param mbIdx The Message Buffer index. - * param enable Enable/disable Tx Message Buffer. - * - true: Enable Tx Message Buffer. - * - false: Disable Tx Message Buffer. - */ -void FLEXCAN_SetTxMbConfig(CAN_Type *base, uint8_t mbIdx, bool enable) -{ - /* Assertion. */ - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - /* Inactivate Message Buffer. */ - if (enable) - { - base->MB[mbIdx].CS = CAN_CS_CODE(kFLEXCAN_TxMbInactive); - } - else - { - base->MB[mbIdx].CS = 0; - } - - /* Clean Message Buffer content. */ - base->MB[mbIdx].ID = 0x0; - base->MB[mbIdx].WORD0 = 0x0; - base->MB[mbIdx].WORD1 = 0x0; -} - -/*! - * brief Calculates the segment values for a single bit time for classical CAN. - * - * This function use to calculates the Classical CAN segment values which will be set in CTRL1/CBT/ENCBT register. - * - * param bitRate The classical CAN bit rate in bps. - * param base FlexCAN peripheral base address. - * param tqNum Number of time quantas per bit, range in 8 ~ 25 when use CTRL1, range in 8 ~ 129 when use CBT, range in - * 8 ~ 385 when use ENCBT. param pTimingConfig Pointer to the FlexCAN timing configuration structure. - */ -static void FLEXCAN_GetSegments(CAN_Type *base, - uint32_t bitRate, - uint32_t tqNum, - flexcan_timing_config_t *pTimingConfig) -{ - uint32_t ideal_sp; - uint32_t seg1Max, proSegMax; - uint32_t seg1Temp; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0 != FSL_FEATURE_FLEXCAN_INSTANCE_HAS_FLEXIBLE_DATA_RATEn(base)) - { -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - /* Maximum value allowed in ENCBT register. */ - seg1Max = MAX_NTSEG2 + 1U; - proSegMax = MAX_NTSEG1 - MAX_NTSEG2; -#else - /* Maximum value allowed in CBT register. */ - seg1Max = MAX_EPSEG1 + 1U; - proSegMax = MAX_EPROPSEG + 1U; -#endif - } - else - { - /* Maximum value allowed in CTRL1 register. */ - seg1Max = MAX_PSEG1 + 1U; - proSegMax = MAX_PROPSEG + 1U; - } -#else - /* Maximum value allowed in CTRL1 register. */ - seg1Max = MAX_PSEG1 + 1U; - proSegMax = MAX_PROPSEG + 1U; -#endif - - /* Try to find the ideal sample point, according to CiA 301 doc.*/ - if (bitRate == 1000000U) - { - ideal_sp = IDEAL_SP_LOW; - } - else if (bitRate >= 800000U) - { - ideal_sp = IDEAL_SP_MID; - } - else - { - ideal_sp = IDEAL_SP_HIGH; - } - /* Calculates phaseSeg2. */ - pTimingConfig->phaseSeg2 = (uint8_t)(tqNum - (tqNum * ideal_sp) / (uint32_t)IDEAL_SP_FACTOR); - if (pTimingConfig->phaseSeg2 < MIN_TIME_SEGMENT2) - { - pTimingConfig->phaseSeg2 = MIN_TIME_SEGMENT2; - } - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0 != FSL_FEATURE_FLEXCAN_INSTANCE_HAS_FLEXIBLE_DATA_RATEn(base)) - { -#if !(defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - if (pTimingConfig->phaseSeg2 > (uint8_t)(MAX_EPSEG2 + 1U)) - { - pTimingConfig->phaseSeg2 = (uint8_t)(MAX_EPSEG2 + 1U); - } -#endif - } -#endif - - /* Calculates phaseSeg1 and propSeg and try to make phaseSeg1 equal to phaseSeg2. */ - if ((tqNum - pTimingConfig->phaseSeg2 - 1U) > (seg1Max + proSegMax)) - { - seg1Temp = seg1Max + proSegMax; - pTimingConfig->phaseSeg2 = (uint8_t)(tqNum - 1U - seg1Temp); - } - else - { - seg1Temp = tqNum - pTimingConfig->phaseSeg2 - 1U; - } - if (seg1Temp > (pTimingConfig->phaseSeg2 + proSegMax)) - { - pTimingConfig->propSeg = (uint8_t)proSegMax; - pTimingConfig->phaseSeg1 = (uint8_t)(seg1Temp - proSegMax); - } - else - { - pTimingConfig->propSeg = (uint8_t)(seg1Temp - pTimingConfig->phaseSeg2); - pTimingConfig->phaseSeg1 = pTimingConfig->phaseSeg2; - } - - /* rJumpwidth (sjw) is the minimum value of phaseSeg1 and phaseSeg2. */ - pTimingConfig->rJumpwidth = - (pTimingConfig->phaseSeg1 > pTimingConfig->phaseSeg2) ? pTimingConfig->phaseSeg2 : pTimingConfig->phaseSeg1; -#if !(defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (pTimingConfig->rJumpwidth > (MAX_RJW + 1U)) - { - pTimingConfig->rJumpwidth = (uint8_t)(MAX_RJW + 1U); - } -#else - if (0 == FSL_FEATURE_FLEXCAN_INSTANCE_HAS_FLEXIBLE_DATA_RATEn(base)) - { - if (pTimingConfig->rJumpwidth > (MAX_RJW + 1U)) - { - pTimingConfig->rJumpwidth = (uint8_t)(MAX_RJW + 1U); - } - } -#endif - - pTimingConfig->phaseSeg1 -= 1U; - pTimingConfig->phaseSeg2 -= 1U; - pTimingConfig->propSeg -= 1U; - pTimingConfig->rJumpwidth -= 1U; -} - -/*! - * brief Calculates the improved timing values by specific bit Rates for classical CAN. - * - * This function use to calculates the Classical CAN timing values according to the given bit rate. The Calculated - * timing values will be set in CTRL1/CBT/ENCBT register. The calculation is based on the recommendation of the CiA 301 - * v4.2.0 and previous version document. - * - * param base FlexCAN peripheral base address. - * param bitRate The classical CAN speed in bps defined by user, should be less than or equal to 1Mbps. - * param sourceClock_Hz The Source clock frequency in Hz. - * param pTimingConfig Pointer to the FlexCAN timing configuration structure. - * - * return TRUE if timing configuration found, FALSE if failed to find configuration. - */ -bool FLEXCAN_CalculateImprovedTimingValues(CAN_Type *base, - uint32_t bitRate, - uint32_t sourceClock_Hz, - flexcan_timing_config_t *pTimingConfig) -{ - /* Observe bit rate maximums. */ - assert(bitRate <= MAX_CAN_BITRATE); - - uint32_t clk; - uint32_t tqNum, tqMin, pdivMAX; - uint32_t spTemp = 1000U; - flexcan_timing_config_t configTemp = {0}; - bool fgRet = false; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0 != FSL_FEATURE_FLEXCAN_INSTANCE_HAS_FLEXIBLE_DATA_RATEn(base)) - { -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - /* Auto Improved Protocal timing for ENCBT. */ - tqNum = ENCBT_MAX_TIME_QUANTA; - tqMin = ENCBT_MIN_TIME_QUANTA; - pdivMAX = MAX_ENPRESDIV; -#else - /* Auto Improved Protocal timing for CBT. */ - tqNum = CBT_MAX_TIME_QUANTA; - tqMin = CBT_MIN_TIME_QUANTA; - pdivMAX = MAX_PRESDIV; -#endif - } - else - { - /* Auto Improved Protocal timing for CTRL1. */ - tqNum = CTRL1_MAX_TIME_QUANTA; - tqMin = CTRL1_MIN_TIME_QUANTA; - pdivMAX = MAX_PRESDIV; - } -#else - /* Auto Improved Protocal timing for CTRL1. */ - tqNum = CTRL1_MAX_TIME_QUANTA; - tqMin = CTRL1_MIN_TIME_QUANTA; - pdivMAX = MAX_PRESDIV; -#endif - do - { - clk = bitRate * tqNum; - if (clk > sourceClock_Hz) - { - continue; /* tqNum too large, clk has been exceed sourceClock_Hz. */ - } - - if ((sourceClock_Hz / clk * clk) != sourceClock_Hz) - { - continue; /* Non-supporting: the frequency of clock source is not divisible by target bit rate, the user - should change a divisible bit rate. */ - } - - configTemp.preDivider = (uint16_t)(sourceClock_Hz / clk) - 1U; - if (configTemp.preDivider > pdivMAX) - { - break; /* The frequency of source clock is too large or the bit rate is too small, the pre-divider could - not handle it. */ - } - - /* Calculates the best timing configuration under current tqNum. */ - FLEXCAN_GetSegments(base, bitRate, tqNum, &configTemp); - /* Determine whether the calculated timing configuration can get the optimal sampling point. */ - if (((((uint32_t)configTemp.phaseSeg2 + 1U) * 1000U) / tqNum) < spTemp) - { - spTemp = (((uint32_t)configTemp.phaseSeg2 + 1U) * 1000U) / tqNum; - pTimingConfig->preDivider = configTemp.preDivider; - pTimingConfig->rJumpwidth = configTemp.rJumpwidth; - pTimingConfig->phaseSeg1 = configTemp.phaseSeg1; - pTimingConfig->phaseSeg2 = configTemp.phaseSeg2; - pTimingConfig->propSeg = configTemp.propSeg; - } - fgRet = true; - } while (--tqNum >= tqMin); - - return fgRet; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * brief Get Mailbox offset number by dword. - * - * This function gets the offset number of the specified mailbox. - * Mailbox is not consecutive between memory regions when payload is not 8 bytes - * so need to calculate the specified mailbox address. - * For example, in the first memory region, MB[0].CS address is 0x4002_4080. For 32 bytes - * payload frame, the second mailbox is ((1/12)*512 + 1%12*40)/4 = 10, meaning 10 dword - * after the 0x4002_4080, which is actually the address of mailbox MB[1].CS. - * - * param base FlexCAN peripheral base address. - * param mbIdx Mailbox index. - */ -static uint32_t FLEXCAN_GetFDMailboxOffset(CAN_Type *base, uint8_t mbIdx) -{ - uint32_t offset = 0; - uint32_t dataSize = (base->FDCTRL & CAN_FDCTRL_MBDSR0_MASK) >> CAN_FDCTRL_MBDSR0_SHIFT; - if (dataSize == (uint32_t)kFLEXCAN_8BperMB) - { - offset = (((uint32_t)mbIdx / 32U) * 512U + ((uint32_t)mbIdx % 32U) * 16U); - } - else if (dataSize == (uint32_t)kFLEXCAN_16BperMB) - { - offset = (((uint32_t)mbIdx / 21U) * 512U + ((uint32_t)mbIdx % 21U) * 24U); - } - else if (dataSize == (uint32_t)kFLEXCAN_32BperMB) - { - offset = (((uint32_t)mbIdx / 12U) * 512U + ((uint32_t)mbIdx % 12U) * 40U); - } - else - { - offset = (((uint32_t)mbIdx / 7U) * 512U + ((uint32_t)mbIdx % 7U) * 72U); - } - - /* To get the dword aligned offset, need to divide by 4. */ - offset = offset / 4U; - return offset; -} - -/*! - * brief Calculates the segment values for a single bit time for CAN FD data phase. - * - * This function use to calculates the CAN FD data phase segment values which will be set in CFDCBT/EDCBT - * register. - * - * param bitRateFD CAN FD data phase bit rate. - * param tqNum Number of time quanta per bit - * param pTimingConfig Pointer to the FlexCAN timing configuration structure. - */ -static void FLEXCAN_FDGetSegments(uint32_t bitRateFD, uint32_t tqNum, flexcan_timing_config_t *pTimingConfig) -{ - uint32_t ideal_sp; - uint32_t seg1Max, proSegMax, seg2Max; - uint32_t seg1Temp; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - /* Maximum value allowed in EDCBT register. */ - seg1Max = MAX_DTSEG2 + 1U; - proSegMax = MAX_DTSEG1 - MAX_DTSEG2; - seg2Max = MAX_DTSEG2 + 1U; -#else - /* Maximum value allowed in FDCBT register. */ - seg1Max = MAX_FPSEG1 + 1U; - proSegMax = MAX_FPROPSEG; - seg2Max = MAX_FPSEG2 + 1U; -#endif - - /* According to CiA doc 1301 v1.0.0, which specified data phase sample point postion for CAN FD at 80 MHz. */ - if (bitRateFD <= 1000000U) - { - ideal_sp = IDEAL_DATA_SP_1; - } - else if (bitRateFD <= 2000000U) - { - ideal_sp = IDEAL_DATA_SP_2; - } - else if (bitRateFD <= 4000000U) - { - ideal_sp = IDEAL_DATA_SP_3; - } - else - { - ideal_sp = IDEAL_DATA_SP_4; - } - - /* Calculates fphaseSeg2. */ - pTimingConfig->fphaseSeg2 = (uint8_t)(tqNum - (tqNum * ideal_sp) / (uint32_t)IDEAL_SP_FACTOR); - if (pTimingConfig->fphaseSeg2 < MIN_TIME_SEGMENT2) - { - pTimingConfig->fphaseSeg2 = MIN_TIME_SEGMENT2; - } - else if (pTimingConfig->fphaseSeg2 > seg2Max) - { - pTimingConfig->fphaseSeg2 = (uint8_t)seg2Max; - } - else - { - ; /* Intentional empty */ - } - - /* Calculates fphaseSeg1 and fpropSeg and try to make phaseSeg1 equal to phaseSeg2 */ - if ((tqNum - pTimingConfig->fphaseSeg2 - 1U) > (seg1Max + proSegMax)) - { - seg1Temp = seg1Max + proSegMax; - pTimingConfig->fphaseSeg2 = (uint8_t)(tqNum - 1U - seg1Temp); - } - else - { - seg1Temp = tqNum - pTimingConfig->fphaseSeg2 - 1U; - } - if (seg1Temp > (pTimingConfig->fphaseSeg2 + proSegMax)) - { - pTimingConfig->fpropSeg = (uint8_t)proSegMax; - pTimingConfig->fphaseSeg1 = (uint8_t)(seg1Temp - proSegMax); - } - else if (seg1Temp > pTimingConfig->fphaseSeg2) - { - pTimingConfig->fpropSeg = (uint8_t)(seg1Temp - pTimingConfig->fphaseSeg2); - pTimingConfig->fphaseSeg1 = pTimingConfig->fphaseSeg2; - } - else - { - pTimingConfig->fpropSeg = 0U; - pTimingConfig->fphaseSeg1 = (uint8_t)seg1Temp; - } - - /* rJumpwidth (sjw) is the minimum value of phaseSeg1 and phaseSeg2. */ - pTimingConfig->frJumpwidth = - (pTimingConfig->fphaseSeg1 > pTimingConfig->fphaseSeg2) ? pTimingConfig->fphaseSeg2 : pTimingConfig->fphaseSeg1; - - pTimingConfig->fphaseSeg1 -= 1U; - pTimingConfig->fphaseSeg2 -= 1U; - pTimingConfig->frJumpwidth -= 1U; -} - -/*! - * brief Calculates the improved timing values by specific bit rate for CAN FD nominal phase. - * - * This function use to calculates the CAN FD nominal phase timing values according to the given nominal phase bit rate. - * The Calculated timing values will be set in CBT/ENCBT registers. The calculation is based on the recommendation of - * the CiA 1301 v1.0.0 document. - * - * param bitRate The CAN FD nominal phase speed in bps defined by user, should be less than or equal to 1Mbps. - * param sourceClock_Hz The Source clock frequency in Hz. - * param pTimingConfig Pointer to the FlexCAN timing configuration structure. - * - * return TRUE if timing configuration found, FALSE if failed to find configuration. - */ -static bool FLEXCAN_CalculateImprovedNominalTimingValues(uint32_t bitRate, - uint32_t sourceClock_Hz, - flexcan_timing_config_t *pTimingConfig) -{ - /* Observe bit rate maximums. */ - assert(bitRate <= MAX_CAN_BITRATE); - - uint32_t clk; - uint32_t tqNum, tqMin, pdivMAX, seg1Max, proSegMax, seg1Temp; - uint32_t spTemp = 1000U; - flexcan_timing_config_t configTemp = {0}; - bool fgRet = false; - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - /* Auto Improved Protocal timing for ENCBT. */ - tqNum = ENCBT_MAX_TIME_QUANTA; - tqMin = ENCBT_MIN_TIME_QUANTA; - pdivMAX = MAX_ENPRESDIV; - seg1Max = MAX_NTSEG2 + 1U; - proSegMax = MAX_NTSEG1 - MAX_NTSEG2; -#else - /* Auto Improved Protocal timing for CBT. */ - tqNum = CBT_MAX_TIME_QUANTA; - tqMin = CBT_MIN_TIME_QUANTA; - pdivMAX = MAX_PRESDIV; - seg1Max = MAX_EPSEG1 + 1U; - proSegMax = MAX_EPROPSEG + 1U; -#endif - - do - { - clk = bitRate * tqNum; - if (clk > sourceClock_Hz) - { - continue; /* tqNum too large, clk has been exceed sourceClock_Hz. */ - } - - if ((sourceClock_Hz / clk * clk) != sourceClock_Hz) - { - continue; /* Non-supporting: the frequency of clock source is not divisible by target bit rate, the user - should change a divisible bit rate. */ - } - - configTemp.preDivider = (uint16_t)(sourceClock_Hz / clk) - 1U; - if (configTemp.preDivider > pdivMAX) - { - break; /* The frequency of source clock is too large or the bit rate is too small, the pre-divider could - not handle it. */ - } - - /* Calculates the best timing configuration under current tqNum. */ - configTemp.phaseSeg2 = (uint8_t)(tqNum - (tqNum * IDEAL_NOMINAL_SP) / (uint32_t)IDEAL_SP_FACTOR); - - /* Calculates phaseSeg1 and propSeg and try to make phaseSeg1 equal to phaseSeg2. */ - if ((tqNum - configTemp.phaseSeg2 - 1U) > (seg1Max + proSegMax)) - { - seg1Temp = seg1Max + proSegMax; - configTemp.phaseSeg2 = (uint8_t)(tqNum - 1U - seg1Temp); - } - else - { - seg1Temp = tqNum - configTemp.phaseSeg2 - 1U; - } - if (seg1Temp > (configTemp.phaseSeg2 + proSegMax)) - { - configTemp.propSeg = (uint8_t)proSegMax; - configTemp.phaseSeg1 = (uint8_t)(seg1Temp - proSegMax); - } - else - { - configTemp.propSeg = (uint8_t)(seg1Temp - configTemp.phaseSeg2); - configTemp.phaseSeg1 = configTemp.phaseSeg2; - } - - /* rJumpwidth (sjw) is the minimum value of phaseSeg1 and phaseSeg2. */ - configTemp.rJumpwidth = - (configTemp.phaseSeg1 > configTemp.phaseSeg2) ? configTemp.phaseSeg2 : configTemp.phaseSeg1; - configTemp.phaseSeg1 -= 1U; - configTemp.phaseSeg2 -= 1U; - configTemp.propSeg -= 1U; - configTemp.rJumpwidth -= 1U; - - if (((((uint32_t)configTemp.phaseSeg2 + 1U) * 1000U) / tqNum) < spTemp) - { - spTemp = (((uint32_t)configTemp.phaseSeg2 + 1U) * 1000U) / tqNum; - pTimingConfig->preDivider = configTemp.preDivider; - pTimingConfig->rJumpwidth = configTemp.rJumpwidth; - pTimingConfig->phaseSeg1 = configTemp.phaseSeg1; - pTimingConfig->phaseSeg2 = configTemp.phaseSeg2; - pTimingConfig->propSeg = configTemp.propSeg; - } - fgRet = true; - } while (--tqNum >= tqMin); - - return fgRet; -} - -/*! - * brief Calculates the improved timing values by specific bit rates for CAN FD. - * - * This function use to calculates the CAN FD timing values according to the given nominal phase bit rate and data phase - * bit rate. The Calculated timing values will be set in CBT/ENCBT and FDCBT/EDCBT registers. The calculation is based - * on the recommendation of the CiA 1301 v1.0.0 document. - * - * param bitRate The CAN FD nominal phase speed in bps defined by user. - * param bitRateFD The CAN FD data phase speed in bps defined by user. Equal to bitRate means disable bit rate - * switching. param sourceClock_Hz The Source clock frequency in Hz. param pTimingConfig Pointer to the FlexCAN timing - * configuration structure. - * - * return TRUE if timing configuration found, FALSE if failed to find configuration - */ -bool FLEXCAN_FDCalculateImprovedTimingValues(CAN_Type *base, - uint32_t bitRate, - uint32_t bitRateFD, - uint32_t sourceClock_Hz, - flexcan_timing_config_t *pTimingConfig) -{ - /* Observe bit rate maximums */ - assert(bitRate <= MAX_CANFD_BITRATE); - assert(bitRateFD <= MAX_CANFD_BITRATE); - /* Data phase bit rate need greater or equal to nominal phase bit rate. */ - assert(bitRate <= bitRateFD); - - uint32_t clk; - uint32_t tqMin, pdivMAX, tqTemp; - bool fgRet = false; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - /* Auto Improved Protocal timing for EDCBT. */ - tqTemp = EDCBT_MAX_TIME_QUANTA; - tqMin = EDCBT_MIN_TIME_QUANTA; - pdivMAX = MAX_EDPRESDIV; -#else - /* Auto Improved Protocal timing for FDCBT. */ - tqTemp = FDCBT_MAX_TIME_QUANTA; - tqMin = FDCBT_MIN_TIME_QUANTA; - pdivMAX = MAX_FPRESDIV; -#endif - - if (bitRate != bitRateFD) - { - /* To minimize errors when processing FD frames, try to get the same bit rate prescaler value for nominal phase - and data phase. */ - do - { - clk = bitRateFD * tqTemp; - if (clk > sourceClock_Hz) - { - continue; /* tqTemp too large, clk x tqTemp has been exceed sourceClock_Hz. */ - } - - if ((sourceClock_Hz / clk * clk) != sourceClock_Hz) - { - continue; /* the frequency of clock source is not divisible by target bit rate. */ - } - - pTimingConfig->fpreDivider = (uint16_t)(sourceClock_Hz / clk) - 1U; - - if (pTimingConfig->fpreDivider > pdivMAX) - { - break; /* The frequency of source clock is too large or the bit rate is too small, the pre-divider - could not handle it. */ - } - - /* Calculates the best data phase timing configuration. */ - FLEXCAN_FDGetSegments(bitRateFD, tqTemp, pTimingConfig); - - if (FLEXCAN_CalculateImprovedNominalTimingValues( - bitRate, sourceClock_Hz / ((uint32_t)pTimingConfig->fpreDivider + 1U), pTimingConfig)) - { - fgRet = true; - if (pTimingConfig->preDivider == 0U) - { - pTimingConfig->preDivider = pTimingConfig->fpreDivider; - break; - } - else - { - pTimingConfig->preDivider = - (pTimingConfig->preDivider + 1U) * (pTimingConfig->fpreDivider + 1U) - 1U; - continue; - } - } - } while (--tqTemp >= tqMin); - } - else - { - if (FLEXCAN_CalculateImprovedNominalTimingValues(bitRate, sourceClock_Hz, pTimingConfig)) - { - /* No need data phase timing configuration, data phase rate equal to nominal phase rate, user don't use Brs - feature. */ - pTimingConfig->fpreDivider = 0U; - pTimingConfig->frJumpwidth = 0U; - pTimingConfig->fphaseSeg1 = 0U; - pTimingConfig->fphaseSeg2 = 0U; - pTimingConfig->fpropSeg = 0U; - fgRet = true; - } - } - return fgRet; -} - -/*! - * brief Configures a FlexCAN transmit message buffer. - * - * This function aborts the previous transmission, cleans the Message Buffer, and - * configures it as a Transmit Message Buffer. - * - * param base FlexCAN peripheral base address. - * param mbIdx The Message Buffer index. - * param enable Enable/disable Tx Message Buffer. - * - true: Enable Tx Message Buffer. - * - false: Disable Tx Message Buffer. - */ -void FLEXCAN_SetFDTxMbConfig(CAN_Type *base, uint8_t mbIdx, bool enable) -{ - /* Assertion. */ - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - uint8_t cnt = 0; - uint8_t payload_dword = 1; - uint32_t dataSize; - dataSize = (base->FDCTRL & CAN_FDCTRL_MBDSR0_MASK) >> CAN_FDCTRL_MBDSR0_SHIFT; - volatile uint32_t *mbAddr = &(base->MB[0].CS); - uint32_t offset = FLEXCAN_GetFDMailboxOffset(base, mbIdx); -#if ((defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829)) - uint32_t availoffset = FLEXCAN_GetFDMailboxOffset(base, FLEXCAN_GetFirstValidMb(base)); -#endif - - /* Inactivate Message Buffer. */ - if (enable) - { - /* Inactivate by writing CS. */ - mbAddr[offset] = CAN_CS_CODE(kFLEXCAN_TxMbInactive); - } - else - { - mbAddr[offset] = 0x0; - } - - /* Calculate the DWORD number, dataSize 0/1/2/3 corresponds to 8/16/32/64 - Bytes payload. */ - for (cnt = 0; cnt < (dataSize + 1U); cnt++) - { - payload_dword *= 2U; - } - - /* Clean ID. */ - mbAddr[offset + 1U] = 0x0U; - /* Clean Message Buffer content, DWORD by DWORD. */ - for (cnt = 0; cnt < payload_dword; cnt++) - { - mbAddr[offset + 2U + cnt] = 0x0U; - } - -#if ((defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829)) - mbAddr[availoffset] = CAN_CS_CODE(kFLEXCAN_TxMbInactive); -#endif -} -#endif /* FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE */ - -/*! - * brief Configures a FlexCAN Receive Message Buffer. - * - * This function cleans a FlexCAN build-in Message Buffer and configures it - * as a Receive Message Buffer. - * - * param base FlexCAN peripheral base address. - * param mbIdx The Message Buffer index. - * param pRxMbConfig Pointer to the FlexCAN Message Buffer configuration structure. - * param enable Enable/disable Rx Message Buffer. - * - true: Enable Rx Message Buffer. - * - false: Disable Rx Message Buffer. - */ -void FLEXCAN_SetRxMbConfig(CAN_Type *base, uint8_t mbIdx, const flexcan_rx_mb_config_t *pRxMbConfig, bool enable) -{ - /* Assertion. */ - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); - assert(((NULL != pRxMbConfig) || (false == enable))); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - uint32_t cs_temp = 0; - - /* Inactivate Message Buffer. */ - base->MB[mbIdx].CS = 0; - - /* Clean Message Buffer content. */ - base->MB[mbIdx].ID = 0x0; - base->MB[mbIdx].WORD0 = 0x0; - base->MB[mbIdx].WORD1 = 0x0; - - if (enable) - { - /* Setup Message Buffer ID. */ - base->MB[mbIdx].ID = pRxMbConfig->id; - - /* Setup Message Buffer format. */ - if (kFLEXCAN_FrameFormatExtend == pRxMbConfig->format) - { - cs_temp |= CAN_CS_IDE_MASK; - } - - /* Setup Message Buffer type. */ - if (kFLEXCAN_FrameTypeRemote == pRxMbConfig->type) - { - cs_temp |= CAN_CS_RTR_MASK; - } - - /* Activate Rx Message Buffer. */ - cs_temp |= CAN_CS_CODE(kFLEXCAN_RxMbEmpty); - base->MB[mbIdx].CS = cs_temp; - } -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * brief Configures a FlexCAN Receive Message Buffer. - * - * This function cleans a FlexCAN build-in Message Buffer and configures it - * as a Receive Message Buffer. - * - * param base FlexCAN peripheral base address. - * param mbIdx The Message Buffer index. - * param pRxMbConfig Pointer to the FlexCAN Message Buffer configuration structure. - * param enable Enable/disable Rx Message Buffer. - * - true: Enable Rx Message Buffer. - * - false: Disable Rx Message Buffer. - */ -void FLEXCAN_SetFDRxMbConfig(CAN_Type *base, uint8_t mbIdx, const flexcan_rx_mb_config_t *pRxMbConfig, bool enable) -{ - /* Assertion. */ - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); - assert(((NULL != pRxMbConfig) || (false == enable))); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - uint32_t cs_temp = 0; - uint8_t cnt = 0; - volatile uint32_t *mbAddr = &(base->MB[0].CS); - uint32_t offset = FLEXCAN_GetFDMailboxOffset(base, mbIdx); - uint8_t payload_dword; - uint32_t dataSize = (base->FDCTRL & CAN_FDCTRL_MBDSR0_MASK) >> CAN_FDCTRL_MBDSR0_SHIFT; - - /* Inactivate Message Buffer. */ - mbAddr[offset] = 0U; - - /* Clean Message Buffer content. */ - mbAddr[offset + 1U] = 0U; - /* Calculate the DWORD number, dataSize 0/1/2/3 corresponds to 8/16/32/64 - Bytes payload. */ - payload_dword = (2U << dataSize); - for (cnt = 0; cnt < payload_dword; cnt++) - { - mbAddr[offset + 2U + cnt] = 0x0; - } - - if (enable) - { - /* Setup Message Buffer ID. */ - mbAddr[offset + 1U] = pRxMbConfig->id; - - /* Setup Message Buffer format. */ - if (kFLEXCAN_FrameFormatExtend == pRxMbConfig->format) - { - cs_temp |= CAN_CS_IDE_MASK; - } - - /* Setup Message Buffer type. */ - if (kFLEXCAN_FrameTypeRemote == pRxMbConfig->type) - { - cs_temp |= CAN_CS_RTR_MASK; - } - - /* Activate Rx Message Buffer. */ - cs_temp |= CAN_CS_CODE(kFLEXCAN_RxMbEmpty); - mbAddr[offset] = cs_temp; - } -} -#endif - -/*! - * brief Configures the FlexCAN Legacy Rx FIFO. - * - * This function configures the FlexCAN Rx FIFO with given configuration. - * note Legacy Rx FIFO only can receive classic CAN message. - * - * param base FlexCAN peripheral base address. - * param pRxFifoConfig Pointer to the FlexCAN Legacy Rx FIFO configuration structure. Can be NULL when enable parameter - * is false. - * param enable Enable/disable Legacy Rx FIFO. - * - true: Enable Legacy Rx FIFO. - * - false: Disable Legacy Rx FIFO. - */ -void FLEXCAN_SetRxFifoConfig(CAN_Type *base, const flexcan_rx_fifo_config_t *pRxFifoConfig, bool enable) -{ - /* Assertion. */ - assert((NULL != pRxFifoConfig) || (false == enable)); - - volatile uint32_t *mbAddr; - uint8_t i, j, k, rffn = 0, numMbOccupy; - uint32_t setup_mb = 0; - - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - - if (enable) - { - assert(pRxFifoConfig->idFilterNum <= 128U); -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - /* Legacy Rx FIFO and Enhanced Rx FIFO cannot be enabled at the same time. */ - assert((base->ERFCR & CAN_ERFCR_ERFEN_MASK) == 0U); -#endif - - /* Get the setup_mb value. */ - setup_mb = (uint8_t)((base->MCR & CAN_MCR_MAXMB_MASK) >> CAN_MCR_MAXMB_SHIFT); - setup_mb = (setup_mb < (uint32_t)FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(base)) ? - setup_mb : - (uint32_t)FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(base); - - /* Determine RFFN value. */ - for (i = 0; i <= 0xFU; i++) - { - if ((8U * (i + 1U)) >= pRxFifoConfig->idFilterNum) - { - rffn = i; - assert(((setup_mb - 8U) - (2U * rffn)) > 0U); - - base->CTRL2 = (base->CTRL2 & ~CAN_CTRL2_RFFN_MASK) | CAN_CTRL2_RFFN(rffn); - break; - } - } - - /* caculate the Number of Mailboxes occupied by RX Legacy FIFO and the filter. */ - numMbOccupy = 6U + (rffn + 1U) * 2U; - - /* Copy ID filter table to Message Buffer Region (Fix MISRA_C-2012 Rule 18.1). */ - j = 0U; - for (i = 6U; i < numMbOccupy; i++) - { - /* Get address for current mail box. */ - mbAddr = &(base->MB[i].CS); - - /* One Mail box contain 4U DWORD registers. */ - for (k = 0; k < 4U; k++) - { - /* Fill all valid filter in the mail box occupied by filter. - * Disable unused Rx FIFO Filter, the other rest of register in the last Mail box occupied by fiter set - * as 0xffffffff. - */ - mbAddr[k] = (j < pRxFifoConfig->idFilterNum) ? (pRxFifoConfig->idFilterTable[j]) : 0xFFFFFFFFU; - - /* Try to fill next filter in current Mail Box. */ - j++; - } - } - - /* Setup ID Fitlter Type. */ - switch (pRxFifoConfig->idFilterType) - { - case kFLEXCAN_RxFifoFilterTypeA: - base->MCR = (base->MCR & ~CAN_MCR_IDAM_MASK) | CAN_MCR_IDAM(0x0); - break; - case kFLEXCAN_RxFifoFilterTypeB: - base->MCR = (base->MCR & ~CAN_MCR_IDAM_MASK) | CAN_MCR_IDAM(0x1); - break; - case kFLEXCAN_RxFifoFilterTypeC: - base->MCR = (base->MCR & ~CAN_MCR_IDAM_MASK) | CAN_MCR_IDAM(0x2); - break; - case kFLEXCAN_RxFifoFilterTypeD: - /* All frames rejected. */ - base->MCR = (base->MCR & ~CAN_MCR_IDAM_MASK) | CAN_MCR_IDAM(0x3); - break; - default: - /* All the cases have been listed above, the default clause should not be reached. */ - assert(false); - break; - } - - /* Setting Message Reception Priority. */ - base->CTRL2 = (pRxFifoConfig->priority == kFLEXCAN_RxFifoPrioHigh) ? (base->CTRL2 & ~CAN_CTRL2_MRP_MASK) : - (base->CTRL2 | CAN_CTRL2_MRP_MASK); - - /* Enable Rx Message FIFO. */ - base->MCR |= CAN_MCR_RFEN_MASK; - } - else - { - rffn = (uint8_t)((base->CTRL2 & CAN_CTRL2_RFFN_MASK) >> CAN_CTRL2_RFFN_SHIFT); - /* caculate the Number of Mailboxes occupied by RX Legacy FIFO and the filter. */ - numMbOccupy = 6U + (rffn + 1U) * 2U; - - /* Disable Rx Message FIFO. */ - base->MCR &= ~CAN_MCR_RFEN_MASK; - - /* Clean MB0 ~ MB5 and all MB occupied by ID filters (Fix MISRA_C-2012 Rule 18.1). */ - - for (i = 0; i < numMbOccupy; i++) - { - FLEXCAN_SetRxMbConfig(base, i, NULL, false); - } - } - - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * brief Configures the FlexCAN Enhanced Rx FIFO. - * - * This function configures the Enhanced Rx FIFO with given configuration. - * note Enhanced Rx FIFO support receive classic CAN or CAN FD messages, Legacy Rx FIFO and Enhanced Rx FIFO - * cannot be enabled at the same time. - * - * param base FlexCAN peripheral base address. - * param pConfig Pointer to the FlexCAN Enhanced Rx FIFO configuration structure. Can be NULL when enable parameter - * is false. - * param enable Enable/disable Enhanced Rx FIFO. - * - true: Enable Enhanced Rx FIFO. - * - false: Disable Enhanced Rx FIFO. - */ -void FLEXCAN_SetEnhancedRxFifoConfig(CAN_Type *base, const flexcan_enhanced_rx_fifo_config_t *pConfig, bool enable) -{ - /* Assertion. */ - assert((NULL != pConfig) || (false == enable)); - uint32_t i; - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - - if (enable) - { - /* Each pair of filter elements occupies 2 words and can consist of one extended ID filter element or two - * standard ID filter elements. */ - assert((((uint32_t)pConfig->idFilterPairNum * 2UL) < - (uint32_t)FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO_FILTER_MAX_NUMBER) && - (pConfig->extendIdFilterNum <= pConfig->idFilterPairNum) && (0UL != pConfig->idFilterPairNum)); - - /* The Enhanced Rx FIFO Watermark cannot be greater than the enhanced Rx FIFO size. */ - assert(pConfig->fifoWatermark < (uint32_t)FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO_SIZE); - - /* Legacy Rx FIFO and Enhanced Rx FIFO cannot be enabled at the same time. */ - assert((base->MCR & CAN_MCR_RFEN_MASK) == 0U); - - /* Reset Enhanced Rx FIFO engine and clear flags. */ - base->ERFSR |= CAN_ERFSR_ERFCLR_MASK | CAN_ERFSR_ERFUFW_MASK | CAN_ERFSR_ERFOVF_MASK | CAN_ERFSR_ERFWMI_MASK | - CAN_ERFSR_ERFDA_MASK; - /* Setting Enhanced Rx FIFO. */ - base->ERFCR = CAN_ERFCR_DMALW(pConfig->dmaPerReadLength) | CAN_ERFCR_NEXIF(pConfig->extendIdFilterNum) | - CAN_ERFCR_NFE((uint32_t)pConfig->idFilterPairNum - 1UL) | CAN_ERFCR_ERFWM(pConfig->fifoWatermark); - /* Copy ID filter table to Enhanced Rx FIFO Filter Element registers. */ - for (i = 0; i < (uint32_t)FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO_FILTER_MAX_NUMBER; i++) - { - base->ERFFEL[i] = (i < ((uint32_t)pConfig->idFilterPairNum * 2U)) ? pConfig->idFilterTable[i] : 0xFFFFFFFFU; - } - - /* Setting Message Reception Priority. */ - base->CTRL2 = (pConfig->priority == kFLEXCAN_RxFifoPrioHigh) ? (base->CTRL2 & ~CAN_CTRL2_MRP_MASK) : - (base->CTRL2 | CAN_CTRL2_MRP_MASK); - /* Enable Enhanced Rx FIFO. */ - base->ERFCR |= CAN_ERFCR_ERFEN_MASK; - } - else - { - /* Disable Enhanced Rx FIFO. */ - base->ERFCR = 0U; - /* Reset Enhanced Rx FIFO engine and clear flags. */ - base->ERFSR |= CAN_ERFSR_ERFCLR_MASK | CAN_ERFSR_ERFUFW_MASK | CAN_ERFSR_ERFOVF_MASK | CAN_ERFSR_ERFWMI_MASK | - CAN_ERFSR_ERFDA_MASK; - /* Clean all Enhanced Rx FIFO Filter Element registers. */ - for (i = 0; i < (uint32_t)FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO_FILTER_MAX_NUMBER; i++) - { - base->ERFFEL[i] = 0xFFFFFFFFU; - } - } - - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); -} -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_RX_FIFO_DMA) && FSL_FEATURE_FLEXCAN_HAS_RX_FIFO_DMA) -/*! - * brief Enables or disables the FlexCAN Legacy/Enhanced Rx FIFO DMA request. - * - * This function enables or disables the DMA feature of FlexCAN build-in Rx FIFO. - * - * param base FlexCAN peripheral base address. - * param enable true to enable, false to disable. - */ -void FLEXCAN_EnableRxFifoDMA(CAN_Type *base, bool enable) -{ - if (enable) - { - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - - /* Enable FlexCAN DMA. */ - base->MCR |= CAN_MCR_DMA_MASK; - - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); - } - else - { - /* Enter Freeze Mode. */ - FLEXCAN_EnterFreezeMode(base); - - /* Disable FlexCAN DMA. */ - base->MCR &= ~CAN_MCR_DMA_MASK; - - /* Exit Freeze Mode. */ - FLEXCAN_ExitFreezeMode(base); - } -} -#endif /* FSL_FEATURE_FLEXCAN_HAS_RX_FIFO_DMA */ - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -/*! - * brief Gets the FlexCAN Memory Error Report registers status. - * - * This function gets the FlexCAN Memory Error Report registers status. - * - * param base FlexCAN peripheral base address. - * param errorStatus Pointer to FlexCAN Memory Error Report registers status structure. - */ -void FLEXCAN_GetMemoryErrorReportStatus(CAN_Type *base, flexcan_memory_error_report_status_t *errorStatus) -{ - uint32_t temp; - /* Disable updates of the error report registers. */ - base->MECR |= CAN_MECR_RERRDIS_MASK; - - errorStatus->accessAddress = (uint16_t)(base->RERRAR & CAN_RERRAR_ERRADDR_MASK); - errorStatus->errorData = base->RERRDR; - errorStatus->errorType = - (base->RERRAR & CAN_RERRAR_NCE_MASK) == 0U ? kFLEXCAN_CorrectableError : kFLEXCAN_NonCorrectableError; - - temp = (base->RERRAR & CAN_RERRAR_SAID_MASK) >> CAN_RERRAR_SAID_SHIFT; - switch (temp) - { - case (uint32_t)kFLEXCAN_MoveOutFlexCanAccess: - case (uint32_t)kFLEXCAN_MoveInAccess: - case (uint32_t)kFLEXCAN_TxArbitrationAccess: - case (uint32_t)kFLEXCAN_RxMatchingAccess: - case (uint32_t)kFLEXCAN_MoveOutHostAccess: - errorStatus->accessType = (flexcan_memory_access_type_t)temp; - break; - default: - assert(false); - break; - } - - for (uint32_t i = 0; i < 4U; i++) - { - temp = (base->RERRSYNR & ((uint32_t)CAN_RERRSYNR_SYND0_MASK << (i * 8U))) >> (i * 8U); - errorStatus->byteStatus[i].byteIsRead = (base->RERRSYNR & ((uint32_t)CAN_RERRSYNR_BE0_MASK << (i * 8U))) != 0U; - switch (temp) - { - case CAN_RERRSYNR_SYND0(kFLEXCAN_NoError): - case CAN_RERRSYNR_SYND0(kFLEXCAN_ParityBits0Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_ParityBits1Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_ParityBits2Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_ParityBits3Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_ParityBits4Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_DataBits0Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_DataBits1Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_DataBits2Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_DataBits3Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_DataBits4Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_DataBits5Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_DataBits6Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_DataBits7Error): - case CAN_RERRSYNR_SYND0(kFLEXCAN_AllZeroError): - case CAN_RERRSYNR_SYND0(kFLEXCAN_AllOneError): - errorStatus->byteStatus[i].bitAffected = (flexcan_byte_error_syndrome_t)temp; - break; - default: - errorStatus->byteStatus[i].bitAffected = kFLEXCAN_NonCorrectableErrors; - break; - } - } - - /* Re-enable updates of the error report registers. */ - base->MECR &= CAN_MECR_RERRDIS_MASK; -} -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_6032) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_6032) -/*! - * FlexCAN: A frame with wrong ID or payload is transmitted into - * the CAN bus when the Message Buffer under transmission is - * either aborted or deactivated while the CAN bus is in the Bus Idle state - * - * This function to do workaround for ERR006032 - * - * param base FlexCAN peripheral base address. - * param mbIdx The FlexCAN Message Buffer index. - */ -static void FLEXCAN_ERRATA_6032(CAN_Type *base, volatile uint32_t *mbCSAddr) -{ - uint32_t dbg_temp = 0U; - uint32_t u32TempCS = 0U; - uint32_t u32Timeout = DELAY_BUSIDLE; - /*disable ALL interrupts to prevent any context switching*/ - uint32_t irqMask = DisableGlobalIRQ(); - dbg_temp = (uint32_t)(base->DBG1); - switch (dbg_temp & CAN_DBG1_CFSM_MASK) - { - case RXINTERMISSION: - if (CBN_VALUE3 == (dbg_temp & CAN_DBG1_CBN_MASK)) - { - /*wait until CFSM is different from RXINTERMISSION */ - while (RXINTERMISSION == (base->DBG1 & CAN_DBG1_CFSM_MASK)) - { - __NOP(); - } - } - break; - case TXINTERMISSION: - if (CBN_VALUE3 == (dbg_temp & CAN_DBG1_CBN_MASK)) - { - /*wait until CFSM is different from TXINTERMISSION*/ - while (TXINTERMISSION == (base->DBG1 & CAN_DBG1_CFSM_MASK)) - { - __NOP(); - } - } - break; - default: - /* To avoid MISRA-C 2012 rule 16.4 issue. */ - break; - } - /*Anyway, BUSIDLE need to delay*/ - if (BUSIDLE == (base->DBG1 & CAN_DBG1_CFSM_MASK)) - { - while (u32Timeout-- > 0U) - { - __NOP(); - } - - /*Write 0x0 into Code field of CS word.*/ - u32TempCS = (uint32_t)(*mbCSAddr); - u32TempCS &= ~CAN_CS_CODE_MASK; - *mbCSAddr = u32TempCS; - } - /*restore interruption*/ - EnableGlobalIRQ(irqMask); -} -#endif - -/*! - * brief Writes a FlexCAN Message to the Transmit Message Buffer. - * - * This function writes a CAN Message to the specified Transmit Message Buffer - * and changes the Message Buffer state to start CAN Message transmit. After - * that the function returns immediately. - * - * param base FlexCAN peripheral base address. - * param mbIdx The FlexCAN Message Buffer index. - * param pTxFrame Pointer to CAN message frame to be sent. - * retval kStatus_Success - Write Tx Message Buffer Successfully. - * retval kStatus_Fail - Tx Message Buffer is currently in use. - */ -status_t FLEXCAN_WriteTxMb(CAN_Type *base, uint8_t mbIdx, const flexcan_frame_t *pTxFrame) -{ - /* Assertion. */ - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); - assert(NULL != pTxFrame); - assert(pTxFrame->length <= 8U); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - uint32_t cs_temp = 0; - status_t status; - - /* Check if Message Buffer is available. */ - if (CAN_CS_CODE(kFLEXCAN_TxMbDataOrRemote) != (base->MB[mbIdx].CS & CAN_CS_CODE_MASK)) - { -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_6032) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_6032) - FLEXCAN_ERRATA_6032(base, &(base->MB[mbIdx].CS)); -#endif - /* Inactive Tx Message Buffer. */ - base->MB[mbIdx].CS = (base->MB[mbIdx].CS & ~CAN_CS_CODE_MASK) | CAN_CS_CODE(kFLEXCAN_TxMbInactive); - - /* Fill Message ID field. */ - base->MB[mbIdx].ID = pTxFrame->id; - - /* Fill Message Format field. */ - if ((uint32_t)kFLEXCAN_FrameFormatExtend == pTxFrame->format) - { - cs_temp |= CAN_CS_SRR_MASK | CAN_CS_IDE_MASK; - } - - /* Fill Message Type field. */ - if ((uint32_t)kFLEXCAN_FrameTypeRemote == pTxFrame->type) - { - cs_temp |= CAN_CS_RTR_MASK; - } - - cs_temp |= CAN_CS_CODE(kFLEXCAN_TxMbDataOrRemote) | CAN_CS_DLC(pTxFrame->length); - - /* Load Message Payload. */ - base->MB[mbIdx].WORD0 = pTxFrame->dataWord0; - base->MB[mbIdx].WORD1 = pTxFrame->dataWord1; - - /* Activate Tx Message Buffer. */ - base->MB[mbIdx].CS = cs_temp; - -#if ((defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829)) - base->MB[FLEXCAN_GetFirstValidMb(base)].CS = CAN_CS_CODE(kFLEXCAN_TxMbInactive); - base->MB[FLEXCAN_GetFirstValidMb(base)].CS = CAN_CS_CODE(kFLEXCAN_TxMbInactive); -#endif - - status = kStatus_Success; - } - else - { - /* Tx Message Buffer is activated, return immediately. */ - status = kStatus_Fail; - } - - return status; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * brief Writes a FlexCAN FD Message to the Transmit Message Buffer. - * - * This function writes a CAN FD Message to the specified Transmit Message Buffer - * and changes the Message Buffer state to start CAN FD Message transmit. After - * that the function returns immediately. - * - * param base FlexCAN peripheral base address. - * param mbIdx The FlexCAN FD Message Buffer index. - * param pTxFrame Pointer to CAN FD message frame to be sent. - * retval kStatus_Success - Write Tx Message Buffer Successfully. - * retval kStatus_Fail - Tx Message Buffer is currently in use. - */ -status_t FLEXCAN_WriteFDTxMb(CAN_Type *base, uint8_t mbIdx, const flexcan_fd_frame_t *pTxFrame) -{ - /* Assertion. */ - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); - assert(NULL != pTxFrame); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - status_t status; - uint32_t cs_temp = 0; - uint8_t cnt = 0; - uint32_t can_cs = 0; - uint8_t payload_dword = 1; - uint32_t dataSize = (base->FDCTRL & CAN_FDCTRL_MBDSR0_MASK) >> CAN_FDCTRL_MBDSR0_SHIFT; -#if ((defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829)) - uint32_t availoffset = FLEXCAN_GetFDMailboxOffset(base, FLEXCAN_GetFirstValidMb(base)); -#endif - volatile uint32_t *mbAddr = &(base->MB[0].CS); - uint32_t offset = FLEXCAN_GetFDMailboxOffset(base, mbIdx); - - can_cs = mbAddr[offset]; - /* Check if Message Buffer is available. */ - if (CAN_CS_CODE(kFLEXCAN_TxMbDataOrRemote) != (can_cs & CAN_CS_CODE_MASK)) - { -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_6032) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_6032) - FLEXCAN_ERRATA_6032(base, &(mbAddr[offset])); -#endif - /* Inactive Tx Message Buffer and Fill Message ID field. */ - mbAddr[offset] = (can_cs & ~CAN_CS_CODE_MASK) | CAN_CS_CODE(kFLEXCAN_TxMbInactive); - mbAddr[offset + 1U] = pTxFrame->id; - - /* Fill Message Format field. */ - if ((uint32_t)kFLEXCAN_FrameFormatExtend == pTxFrame->format) - { - cs_temp |= CAN_CS_SRR_MASK | CAN_CS_IDE_MASK; - } - - /* Fill Message Type field. */ - if ((uint32_t)kFLEXCAN_FrameTypeRemote == pTxFrame->type) - { - cs_temp |= CAN_CS_RTR_MASK; - } - - cs_temp |= CAN_CS_CODE(kFLEXCAN_TxMbDataOrRemote) | CAN_CS_DLC(pTxFrame->length) | CAN_CS_EDL(pTxFrame->edl) | - CAN_CS_BRS(pTxFrame->brs); - - /* Calculate the DWORD number, dataSize 0/1/2/3 corresponds to 8/16/32/64 - Bytes payload. */ - for (cnt = 0; cnt < (dataSize + 1U); cnt++) - { - payload_dword *= 2U; - } - - /* Load Message Payload and Activate Tx Message Buffer. */ - for (cnt = 0; cnt < payload_dword; cnt++) - { - mbAddr[offset + 2U + cnt] = pTxFrame->dataWord[cnt]; - } - mbAddr[offset] = cs_temp; - -#if ((defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5641) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829) && FSL_FEATURE_FLEXCAN_HAS_ERRATA_5829)) - mbAddr[availoffset] = CAN_CS_CODE(kFLEXCAN_TxMbInactive); - mbAddr[availoffset] = CAN_CS_CODE(kFLEXCAN_TxMbInactive); -#endif - - status = kStatus_Success; - } - else - { - /* Tx Message Buffer is activated, return immediately. */ - status = kStatus_Fail; - } - - return status; -} -#endif - -/*! - * brief Reads a FlexCAN Message from Receive Message Buffer. - * - * This function reads a CAN message from a specified Receive Message Buffer. - * The function fills a receive CAN message frame structure with - * just received data and activates the Message Buffer again. - * The function returns immediately. - * - * param base FlexCAN peripheral base address. - * param mbIdx The FlexCAN Message Buffer index. - * param pRxFrame Pointer to CAN message frame structure for reception. - * retval kStatus_Success - Rx Message Buffer is full and has been read successfully. - * retval kStatus_FLEXCAN_RxOverflow - Rx Message Buffer is already overflowed and has been read successfully. - * retval kStatus_Fail - Rx Message Buffer is empty. - */ -status_t FLEXCAN_ReadRxMb(CAN_Type *base, uint8_t mbIdx, flexcan_frame_t *pRxFrame) -{ - /* Assertion. */ - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); - assert(NULL != pRxFrame); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - uint32_t cs_temp; - uint32_t rx_code; - status_t status; - - /* Read CS field of Rx Message Buffer to lock Message Buffer. */ - cs_temp = base->MB[mbIdx].CS; - /* Get Rx Message Buffer Code field. */ - rx_code = (cs_temp & CAN_CS_CODE_MASK) >> CAN_CS_CODE_SHIFT; - - /* Check to see if Rx Message Buffer is full. */ - if (((uint32_t)kFLEXCAN_RxMbFull == rx_code) || ((uint32_t)kFLEXCAN_RxMbOverrun == rx_code)) - { - /* Store Message ID. */ - pRxFrame->id = base->MB[mbIdx].ID & (CAN_ID_EXT_MASK | CAN_ID_STD_MASK); - - /* Get the message ID and format. */ - pRxFrame->format = (cs_temp & CAN_CS_IDE_MASK) != 0U ? (uint8_t)kFLEXCAN_FrameFormatExtend : - (uint8_t)kFLEXCAN_FrameFormatStandard; - - /* Get the message type. */ - pRxFrame->type = - (cs_temp & CAN_CS_RTR_MASK) != 0U ? (uint8_t)kFLEXCAN_FrameTypeRemote : (uint8_t)kFLEXCAN_FrameTypeData; - - /* Get the message length. */ - pRxFrame->length = (uint8_t)((cs_temp & CAN_CS_DLC_MASK) >> CAN_CS_DLC_SHIFT); - - /* Get the time stamp. */ - pRxFrame->timestamp = (uint16_t)((cs_temp & CAN_CS_TIME_STAMP_MASK) >> CAN_CS_TIME_STAMP_SHIFT); - - /* Store Message Payload. */ - pRxFrame->dataWord0 = base->MB[mbIdx].WORD0; - pRxFrame->dataWord1 = base->MB[mbIdx].WORD1; - - /* Read free-running timer to unlock Rx Message Buffer. */ - (void)base->TIMER; - - if ((uint32_t)kFLEXCAN_RxMbFull == rx_code) - { - status = kStatus_Success; - } - else - { - status = kStatus_FLEXCAN_RxOverflow; - } - } - else - { - /* Read free-running timer to unlock Rx Message Buffer. */ - (void)base->TIMER; - - status = kStatus_Fail; - } - - return status; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * brief Reads a FlexCAN FD Message from Receive Message Buffer. - * - * This function reads a CAN FD message from a specified Receive Message Buffer. - * The function fills a receive CAN FD message frame structure with - * just received data and activates the Message Buffer again. - * The function returns immediately. - * - * param base FlexCAN peripheral base address. - * param mbIdx The FlexCAN FD Message Buffer index. - * param pRxFrame Pointer to CAN FD message frame structure for reception. - * retval kStatus_Success - Rx Message Buffer is full and has been read successfully. - * retval kStatus_FLEXCAN_RxOverflow - Rx Message Buffer is already overflowed and has been read successfully. - * retval kStatus_Fail - Rx Message Buffer is empty. - */ -status_t FLEXCAN_ReadFDRxMb(CAN_Type *base, uint8_t mbIdx, flexcan_fd_frame_t *pRxFrame) -{ - /* Assertion. */ - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); - assert(NULL != pRxFrame); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - status_t status; - uint32_t cs_temp; - uint8_t rx_code; - uint8_t cnt = 0; - uint32_t can_id = 0; - uint32_t dataSize; - dataSize = (base->FDCTRL & CAN_FDCTRL_MBDSR0_MASK) >> CAN_FDCTRL_MBDSR0_SHIFT; - uint8_t payload_dword = 1; - volatile uint32_t *mbAddr = &(base->MB[0].CS); - uint32_t offset = FLEXCAN_GetFDMailboxOffset(base, mbIdx); - - /* Read CS field of Rx Message Buffer to lock Message Buffer. */ - cs_temp = mbAddr[offset]; - can_id = mbAddr[offset + 1U]; - - /* Get Rx Message Buffer Code field. */ - rx_code = (uint8_t)((cs_temp & CAN_CS_CODE_MASK) >> CAN_CS_CODE_SHIFT); - - /* Check to see if Rx Message Buffer is full. */ - if (((uint8_t)kFLEXCAN_RxMbFull == rx_code) || ((uint8_t)kFLEXCAN_RxMbOverrun == rx_code)) - { - /* Store Message ID. */ - pRxFrame->id = can_id & (CAN_ID_EXT_MASK | CAN_ID_STD_MASK); - - /* Get the message ID and format. */ - pRxFrame->format = (cs_temp & CAN_CS_IDE_MASK) != 0U ? (uint8_t)kFLEXCAN_FrameFormatExtend : - (uint8_t)kFLEXCAN_FrameFormatStandard; - - /* Get Bit Rate Switch flag. */ - pRxFrame->brs = (cs_temp & CAN_CS_BRS_MASK) != 0U ? 1U : 0U; - - /* Get Extended Data Length flag. */ - pRxFrame->edl = (cs_temp & CAN_CS_EDL_MASK) != 0U ? 1U : 0U; - - /* Get the message type. */ - pRxFrame->type = - (cs_temp & CAN_CS_RTR_MASK) != 0U ? (uint8_t)kFLEXCAN_FrameTypeRemote : (uint8_t)kFLEXCAN_FrameTypeData; - - /* Get the message length. */ - pRxFrame->length = (uint8_t)((cs_temp & CAN_CS_DLC_MASK) >> CAN_CS_DLC_SHIFT); - - /* Get the time stamp. */ - pRxFrame->timestamp = (uint16_t)((cs_temp & CAN_CS_TIME_STAMP_MASK) >> CAN_CS_TIME_STAMP_SHIFT); - - /* Calculate the DWORD number, dataSize 0/1/2/3 corresponds to 8/16/32/64 - Bytes payload. */ - for (cnt = 0; cnt < (dataSize + 1U); cnt++) - { - payload_dword *= 2U; - } - - /* Store Message Payload. */ - for (cnt = 0; cnt < payload_dword; cnt++) - { - pRxFrame->dataWord[cnt] = mbAddr[offset + 2U + cnt]; - } - - /* Read free-running timer to unlock Rx Message Buffer. */ - (void)base->TIMER; - - if ((uint32_t)kFLEXCAN_RxMbFull == rx_code) - { - status = kStatus_Success; - } - else - { - status = kStatus_FLEXCAN_RxOverflow; - } - } - else - { - /* Read free-running timer to unlock Rx Message Buffer. */ - (void)base->TIMER; - - status = kStatus_Fail; - } - - return status; -} -#endif - -/*! - * brief Reads a FlexCAN Message from Legacy Rx FIFO. - * - * This function reads a CAN message from the FlexCAN Legacy Rx FIFO. - * - * param base FlexCAN peripheral base address. - * param pRxFrame Pointer to CAN message frame structure for reception. - * retval kStatus_Success - Read Message from Rx FIFO successfully. - * retval kStatus_Fail - Rx FIFO is not enabled. - */ -status_t FLEXCAN_ReadRxFifo(CAN_Type *base, flexcan_frame_t *pRxFrame) -{ - /* Assertion. */ - assert(NULL != pRxFrame); - - uint32_t cs_temp; - status_t status; - - /* Check if Legacy Rx FIFO is Enabled. */ - if (0U != (base->MCR & CAN_MCR_RFEN_MASK)) - { - /* Read CS field of Rx Message Buffer to lock Message Buffer. */ - cs_temp = base->MB[0].CS; - - /* Read data from Rx FIFO output port. */ - /* Store Message ID. */ - pRxFrame->id = base->MB[0].ID & (CAN_ID_EXT_MASK | CAN_ID_STD_MASK); - - /* Get the message ID and format. */ - pRxFrame->format = (cs_temp & CAN_CS_IDE_MASK) != 0U ? (uint8_t)kFLEXCAN_FrameFormatExtend : - (uint8_t)kFLEXCAN_FrameFormatStandard; - - /* Get the message type. */ - pRxFrame->type = - (cs_temp & CAN_CS_RTR_MASK) != 0U ? (uint8_t)kFLEXCAN_FrameTypeRemote : (uint8_t)kFLEXCAN_FrameTypeData; - - /* Get the message length. */ - pRxFrame->length = (uint8_t)((cs_temp & CAN_CS_DLC_MASK) >> CAN_CS_DLC_SHIFT); - - /* Get the time stamp. */ - pRxFrame->timestamp = (uint16_t)((cs_temp & CAN_CS_TIME_STAMP_MASK) >> CAN_CS_TIME_STAMP_SHIFT); - - /* Store Message Payload. */ - pRxFrame->dataWord0 = base->MB[0].WORD0; - pRxFrame->dataWord1 = base->MB[0].WORD1; - - /* Store ID Filter Hit Index. */ - pRxFrame->idhit = (uint16_t)(base->RXFIR & CAN_RXFIR_IDHIT_MASK); - - /* Read free-running timer to unlock Rx Message Buffer. */ - (void)base->TIMER; - - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * brief Reads a FlexCAN Message from Enhanced Rx FIFO. - * - * This function reads a CAN or CAN FD message from the FlexCAN Enhanced Rx FIFO. - * - * param base FlexCAN peripheral base address. - * param pRxFrame Pointer to CAN FD message frame structure for reception. - * retval kStatus_Success - Read Message from Rx FIFO successfully. - * retval kStatus_Fail - Rx FIFO is not enabled. - */ -status_t FLEXCAN_ReadEnhancedRxFifo(CAN_Type *base, flexcan_fd_frame_t *pRxFrame) -{ - /* Assertion. */ - assert(NULL != pRxFrame); - - status_t status; - uint32_t idHitOff; - - /* Check if Enhanced Rx FIFO is Enabled. */ - if (0U != (base->ERFCR & CAN_ERFCR_ERFEN_MASK)) - { - /* Enhanced Rx FIFO ID HIT offset is changed dynamically according to data length code (DLC) . */ - idHitOff = (DLC_LENGTH_DECODE(((flexcan_fd_frame_t *)E_RX_FIFO(base))->length) + 3U) / 4U + 3U; - /* Copy CAN FD Message from Enhanced Rx FIFO, should use the DLC value to identify the bytes that belong to the - * message which is being read. */ - (void)memcpy((void *)pRxFrame, (void *)(uint32_t *)E_RX_FIFO(base), sizeof(uint32_t) * idHitOff); - pRxFrame->idhit = pRxFrame->dataWord[idHitOff - 3U]; - /* Clear the unused frame data. */ - for (uint32_t i = (idHitOff - 3U); i < 16U; i++) - { - pRxFrame->dataWord[i] = 0x0; - } - - /* Clear data available flag to let FlexCAN know one frame has been read from the Enhanced Rx FIFO. */ - base->ERFSR = CAN_ERFSR_ERFDA_MASK; - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} -#endif - -/*! - * brief Performs a polling send transaction on the CAN bus. - * - * note A transfer handle does not need to be created before calling this API. - * - * param base FlexCAN peripheral base pointer. - * param mbIdx The FlexCAN Message Buffer index. - * param pTxFrame Pointer to CAN message frame to be sent. - * retval kStatus_Success - Write Tx Message Buffer Successfully. - * retval kStatus_Fail - Tx Message Buffer is currently in use. - */ -status_t FLEXCAN_TransferSendBlocking(CAN_Type *base, uint8_t mbIdx, flexcan_frame_t *pTxFrame) -{ - status_t status; - - /* Write Tx Message Buffer to initiate a data sending. */ - if (kStatus_Success == FLEXCAN_WriteTxMb(base, mbIdx, (const flexcan_frame_t *)(uintptr_t)pTxFrame)) - { - /* Wait until CAN Message send out. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (mbIdx >= 64U) - { - while (0U == FLEXCAN_GetHigh64MbStatusFlags(base, (uint64_t)1U << (mbIdx - 64U))) - { - } - FLEXCAN_ClearHigh64MbStatusFlags(base, (uint64_t)1U << (mbIdx - 64U)); - } - else - { - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint64_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint64_t)1U << mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER) && FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER) - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint64_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint64_t)1U << mbIdx); -#else - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint32_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint32_t)1U << mbIdx); -#endif - - /*After TX MB tranfered success, update the Timestamp from MB[mbIdx].CS register*/ - pTxFrame->timestamp = (uint16_t)((base->MB[mbIdx].CS & CAN_CS_TIME_STAMP_MASK) >> CAN_CS_TIME_STAMP_SHIFT); - - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -/*! - * brief Performs a polling receive transaction on the CAN bus. - * - * note A transfer handle does not need to be created before calling this API. - * - * param base FlexCAN peripheral base pointer. - * param mbIdx The FlexCAN Message Buffer index. - * param pRxFrame Pointer to CAN message frame structure for reception. - * retval kStatus_Success - Rx Message Buffer is full and has been read successfully. - * retval kStatus_FLEXCAN_RxOverflow - Rx Message Buffer is already overflowed and has been read successfully. - * retval kStatus_Fail - Rx Message Buffer is empty. - */ -status_t FLEXCAN_TransferReceiveBlocking(CAN_Type *base, uint8_t mbIdx, flexcan_frame_t *pRxFrame) -{ -/* Wait until Rx Message Buffer non-empty. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (mbIdx >= 64U) - { - while (0U == FLEXCAN_GetHigh64MbStatusFlags(base, (uint64_t)1U << (mbIdx - 64U))) - { - } - FLEXCAN_ClearHigh64MbStatusFlags(base, (uint64_t)1U << (mbIdx - 64U)); - } - else - { - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint64_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint64_t)1U << mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER) && FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER) - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint64_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint64_t)1U << mbIdx); -#else - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint32_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint32_t)1U << mbIdx); -#endif - - /* Read Received CAN Message. */ - return FLEXCAN_ReadRxMb(base, mbIdx, pRxFrame); -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * brief Performs a polling send transaction on the CAN bus. - * - * note A transfer handle does not need to be created before calling this API. - * - * param base FlexCAN peripheral base pointer. - * param mbIdx The FlexCAN FD Message Buffer index. - * param pTxFrame Pointer to CAN FD message frame to be sent. - * retval kStatus_Success - Write Tx Message Buffer Successfully. - * retval kStatus_Fail - Tx Message Buffer is currently in use. - */ -status_t FLEXCAN_TransferFDSendBlocking(CAN_Type *base, uint8_t mbIdx, flexcan_fd_frame_t *pTxFrame) -{ - status_t status; - - /* Write Tx Message Buffer to initiate a data sending. */ - if (kStatus_Success == FLEXCAN_WriteFDTxMb(base, mbIdx, (const flexcan_fd_frame_t *)(uintptr_t)pTxFrame)) - { - /* Wait until CAN Message send out. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (mbIdx >= 64U) - { - while (0U == FLEXCAN_GetHigh64MbStatusFlags(base, (uint64_t)1U << (mbIdx - 64U))) - { - } - FLEXCAN_ClearHigh64MbStatusFlags(base, (uint64_t)1U << (mbIdx - 64U)); - } - else - { - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint64_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint64_t)1U << mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER) && FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER) - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint64_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint64_t)1U << mbIdx); -#else - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint32_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint32_t)1U << mbIdx); -#endif - /*After TX MB tranfered success, update the Timestamp from base->MB[offset for CAN FD].CS register*/ - volatile uint32_t *mbAddr = &(base->MB[0].CS); - uint32_t offset = FLEXCAN_GetFDMailboxOffset(base, mbIdx); - pTxFrame->timestamp = (uint16_t)((mbAddr[offset] & CAN_CS_TIME_STAMP_MASK) >> CAN_CS_TIME_STAMP_SHIFT); - - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -/*! - * brief Performs a polling receive transaction on the CAN bus. - * - * note A transfer handle does not need to be created before calling this API. - * - * param base FlexCAN peripheral base pointer. - * param mbIdx The FlexCAN FD Message Buffer index. - * param pRxFrame Pointer to CAN FD message frame structure for reception. - * retval kStatus_Success - Rx Message Buffer is full and has been read successfully. - * retval kStatus_FLEXCAN_RxOverflow - Rx Message Buffer is already overflowed and has been read successfully. - * retval kStatus_Fail - Rx Message Buffer is empty. - */ -status_t FLEXCAN_TransferFDReceiveBlocking(CAN_Type *base, uint8_t mbIdx, flexcan_fd_frame_t *pRxFrame) -{ -/* Wait until Rx Message Buffer non-empty. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (mbIdx >= 64U) - { - while (0U == FLEXCAN_GetHigh64MbStatusFlags(base, (uint64_t)1U << (mbIdx - 64U))) - { - } - FLEXCAN_ClearHigh64MbStatusFlags(base, (uint64_t)1U << (mbIdx - 64U)); - } - else - { - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint64_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint64_t)1U << mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER) && FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER) - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint64_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint64_t)1U << mbIdx); -#else - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint32_t)1U << mbIdx)) - { - } - FLEXCAN_ClearMbStatusFlags(base, (uint32_t)1U << mbIdx); -#endif - - /* Read Received CAN Message. */ - return FLEXCAN_ReadFDRxMb(base, mbIdx, pRxFrame); -} -#endif - -/*! - * brief Performs a polling receive transaction from Legacy Rx FIFO on the CAN bus. - * - * note A transfer handle does not need to be created before calling this API. - * - * param base FlexCAN peripheral base pointer. - * param pRxFrame Pointer to CAN message frame structure for reception. - * retval kStatus_Success - Read Message from Rx FIFO successfully. - * retval kStatus_Fail - Rx FIFO is not enabled. - */ -status_t FLEXCAN_TransferReceiveFifoBlocking(CAN_Type *base, flexcan_frame_t *pRxFrame) -{ - status_t rxFifoStatus; - - /* Wait until Legacy Rx FIFO non-empty. */ - while (0U == FLEXCAN_GetMbStatusFlags(base, (uint32_t)kFLEXCAN_RxFifoFrameAvlFlag)) - { - } - - /* Read data from Legacy Rx FIFO. */ - rxFifoStatus = FLEXCAN_ReadRxFifo(base, pRxFrame); - - /* Clean Rx Fifo available flag. */ - FLEXCAN_ClearMbStatusFlags(base, (uint32_t)kFLEXCAN_RxFifoFrameAvlFlag); - - return rxFifoStatus; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * brief Performs a polling receive transaction from Enhanced Rx FIFO on the CAN bus. - * - * note A transfer handle does not need to be created before calling this API. - * - * param base FlexCAN peripheral base pointer. - * param pRxFrame Pointer to CAN FD message frame structure for reception. - * retval kStatus_Success - Read Message from Rx FIFO successfully. - * retval kStatus_Fail - Rx FIFO is not enabled. - */ -status_t FLEXCAN_TransferReceiveEnhancedFifoBlocking(CAN_Type *base, flexcan_fd_frame_t *pRxFrame) -{ - status_t rxFifoStatus; - - /* Wait until Enhanced Rx FIFO non-empty. */ - while (0U == (FLEXCAN_GetStatusFlags(base) & (uint64_t)kFLEXCAN_ERxFifoDataAvlIntFlag)) - { - } - - /* Read data from Enhanced Rx FIFO */ - rxFifoStatus = FLEXCAN_ReadEnhancedRxFifo(base, pRxFrame); - - return rxFifoStatus; -} -#endif - -/*! - * brief Initializes the FlexCAN handle. - * - * This function initializes the FlexCAN handle, which can be used for other FlexCAN - * transactional APIs. Usually, for a specified FlexCAN instance, - * call this API once to get the initialized handle. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param callback The callback function. - * param userData The parameter of the callback function. - */ -void FLEXCAN_TransferCreateHandle(CAN_Type *base, - flexcan_handle_t *handle, - flexcan_transfer_callback_t callback, - void *userData) -{ - assert(NULL != handle); - - uint8_t instance; - - /* Clean FlexCAN transfer handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Get instance from peripheral base address. */ - instance = (uint8_t)FLEXCAN_GetInstance(base); - - /* Save the context in global variables to support the double weak mechanism. */ - s_flexcanHandle[instance] = handle; - - /* Register Callback function. */ - handle->callback = callback; - handle->userData = userData; - - s_flexcanIsr = FLEXCAN_TransferHandleIRQ; - - /* We Enable Error & Status interrupt here, because this interrupt just - * report current status of FlexCAN module through Callback function. - * It is insignificance without a available callback function. - */ - if (handle->callback != NULL) - { - FLEXCAN_EnableInterrupts( - base, (uint32_t)kFLEXCAN_BusOffInterruptEnable | (uint32_t)kFLEXCAN_ErrorInterruptEnable | - (uint32_t)kFLEXCAN_RxWarningInterruptEnable | (uint32_t)kFLEXCAN_TxWarningInterruptEnable | - (uint32_t)kFLEXCAN_WakeUpInterruptEnable -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - | (uint64_t)kFLEXCAN_PNMatchWakeUpInterruptEnable | - (uint64_t)kFLEXCAN_PNTimeoutWakeUpInterruptEnable -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - | (uint64_t)kFLEXCAN_HostAccessNCErrorInterruptEnable | - (uint64_t)kFLEXCAN_FlexCanAccessNCErrorInterruptEnable | - (uint64_t)kFLEXCAN_HostOrFlexCanCErrorInterruptEnable -#endif - ); - } - else - { - FLEXCAN_DisableInterrupts( - base, (uint32_t)kFLEXCAN_BusOffInterruptEnable | (uint32_t)kFLEXCAN_ErrorInterruptEnable | - (uint32_t)kFLEXCAN_RxWarningInterruptEnable | (uint32_t)kFLEXCAN_TxWarningInterruptEnable | - (uint32_t)kFLEXCAN_WakeUpInterruptEnable -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - | (uint64_t)kFLEXCAN_PNMatchWakeUpInterruptEnable | - (uint64_t)kFLEXCAN_PNTimeoutWakeUpInterruptEnable -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - | (uint64_t)kFLEXCAN_HostAccessNCErrorInterruptEnable | - (uint64_t)kFLEXCAN_FlexCanAccessNCErrorInterruptEnable | - (uint64_t)kFLEXCAN_HostOrFlexCanCErrorInterruptEnable -#endif - ); - } - - /* Enable interrupts in NVIC. */ - (void)EnableIRQ((IRQn_Type)(s_flexcanRxWarningIRQ[instance])); - (void)EnableIRQ((IRQn_Type)(s_flexcanTxWarningIRQ[instance])); - (void)EnableIRQ((IRQn_Type)(s_flexcanWakeUpIRQ[instance])); - (void)EnableIRQ((IRQn_Type)(s_flexcanErrorIRQ[instance])); - (void)EnableIRQ((IRQn_Type)(s_flexcanBusOffIRQ[instance])); - (void)EnableIRQ((IRQn_Type)(s_flexcanMbIRQ[instance])); -} - -/*! - * brief Sends a message using IRQ. - * - * This function sends a message using IRQ. This is a non-blocking function, which returns - * right away. When messages have been sent out, the send callback function is called. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param pMbXfer FlexCAN Message Buffer transfer structure. See the #flexcan_mb_transfer_t. - * retval kStatus_Success Start Tx Message Buffer sending process successfully. - * retval kStatus_Fail Write Tx Message Buffer failed. - * retval kStatus_FLEXCAN_TxBusy Tx Message Buffer is in use. - */ -status_t FLEXCAN_TransferSendNonBlocking(CAN_Type *base, flexcan_handle_t *handle, flexcan_mb_transfer_t *pMbXfer) -{ - /* Assertion. */ - assert(NULL != handle); - assert(NULL != pMbXfer); - assert(pMbXfer->mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, pMbXfer->mbIdx)); -#endif - - status_t status; - - /* Check if Message Buffer is idle. */ - if ((uint8_t)kFLEXCAN_StateIdle == handle->mbState[pMbXfer->mbIdx]) - { - /* Distinguish transmit type. */ - if ((uint32_t)kFLEXCAN_FrameTypeRemote == pMbXfer->frame->type) - { - handle->mbState[pMbXfer->mbIdx] = (uint8_t)kFLEXCAN_StateTxRemote; - } - else - { - handle->mbState[pMbXfer->mbIdx] = (uint8_t)kFLEXCAN_StateTxData; - } - - if (kStatus_Success == - FLEXCAN_WriteTxMb(base, pMbXfer->mbIdx, (const flexcan_frame_t *)(uintptr_t)pMbXfer->frame)) - { - /* Enable Message Buffer Interrupt. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (pMbXfer->mbIdx >= 64U) - { - FLEXCAN_EnableHigh64MbInterrupts(base, (uint64_t)1U << (pMbXfer->mbIdx - 64U)); - } - else - { - FLEXCAN_EnableMbInterrupts(base, (uint64_t)1U << pMbXfer->mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - FLEXCAN_EnableMbInterrupts(base, (uint64_t)1U << pMbXfer->mbIdx); -#else - FLEXCAN_EnableMbInterrupts(base, (uint32_t)1U << pMbXfer->mbIdx); -#endif - status = kStatus_Success; - } - else - { - handle->mbState[pMbXfer->mbIdx] = (uint8_t)kFLEXCAN_StateIdle; - status = kStatus_Fail; - } - } - else - { - status = kStatus_FLEXCAN_TxBusy; - } - - return status; -} - -/*! - * brief Receives a message using IRQ. - * - * This function receives a message using IRQ. This is non-blocking function, which returns - * right away. When the message has been received, the receive callback function is called. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param pMbXfer FlexCAN Message Buffer transfer structure. See the #flexcan_mb_transfer_t. - * retval kStatus_Success - Start Rx Message Buffer receiving process successfully. - * retval kStatus_FLEXCAN_RxBusy - Rx Message Buffer is in use. - */ -status_t FLEXCAN_TransferReceiveNonBlocking(CAN_Type *base, flexcan_handle_t *handle, flexcan_mb_transfer_t *pMbXfer) -{ - status_t status; - - /* Assertion. */ - assert(NULL != handle); - assert(NULL != pMbXfer); - assert(pMbXfer->mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, pMbXfer->mbIdx)); -#endif - - /* Check if Message Buffer is idle. */ - if ((uint8_t)kFLEXCAN_StateIdle == handle->mbState[pMbXfer->mbIdx]) - { - handle->mbState[pMbXfer->mbIdx] = (uint8_t)kFLEXCAN_StateRxData; - - /* Register Message Buffer. */ - handle->mbFrameBuf[pMbXfer->mbIdx] = pMbXfer->frame; - - /* Enable Message Buffer Interrupt. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (pMbXfer->mbIdx >= 64U) - { - FLEXCAN_EnableHigh64MbInterrupts(base, (uint64_t)1U << (pMbXfer->mbIdx - 64U)); - } - else - { - FLEXCAN_EnableMbInterrupts(base, (uint64_t)1U << pMbXfer->mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - FLEXCAN_EnableMbInterrupts(base, (uint64_t)1U << pMbXfer->mbIdx); -#else - FLEXCAN_EnableMbInterrupts(base, (uint32_t)1U << pMbXfer->mbIdx); -#endif - - status = kStatus_Success; - } - else - { - status = kStatus_FLEXCAN_RxBusy; - } - - return status; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * brief Sends a message using IRQ. - * - * This function sends a message using IRQ. This is a non-blocking function, which returns - * right away. When messages have been sent out, the send callback function is called. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param pMbXfer FlexCAN FD Message Buffer transfer structure. See the #flexcan_mb_transfer_t. - * retval kStatus_Success Start Tx Message Buffer sending process successfully. - * retval kStatus_Fail Write Tx Message Buffer failed. - * retval kStatus_FLEXCAN_TxBusy Tx Message Buffer is in use. - */ -status_t FLEXCAN_TransferFDSendNonBlocking(CAN_Type *base, flexcan_handle_t *handle, flexcan_mb_transfer_t *pMbXfer) -{ - /* Assertion. */ - assert(NULL != handle); - assert(NULL != pMbXfer); - assert(pMbXfer->mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, pMbXfer->mbIdx)); -#endif - - status_t status; - - /* Check if Message Buffer is idle. */ - if ((uint8_t)kFLEXCAN_StateIdle == handle->mbState[pMbXfer->mbIdx]) - { - /* Distinguish transmit type. */ - if ((uint32_t)kFLEXCAN_FrameTypeRemote == pMbXfer->framefd->type) - { - handle->mbState[pMbXfer->mbIdx] = (uint8_t)kFLEXCAN_StateTxRemote; - } - else - { - handle->mbState[pMbXfer->mbIdx] = (uint8_t)kFLEXCAN_StateTxData; - } - - if (kStatus_Success == - FLEXCAN_WriteFDTxMb(base, pMbXfer->mbIdx, (const flexcan_fd_frame_t *)(uintptr_t)pMbXfer->framefd)) - { - /* Enable Message Buffer Interrupt. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (pMbXfer->mbIdx >= 64U) - { - FLEXCAN_EnableHigh64MbInterrupts(base, (uint64_t)1U << (pMbXfer->mbIdx - 64U)); - } - else - { - FLEXCAN_EnableMbInterrupts(base, (uint64_t)1U << pMbXfer->mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - FLEXCAN_EnableMbInterrupts(base, (uint64_t)1U << pMbXfer->mbIdx); -#else - FLEXCAN_EnableMbInterrupts(base, (uint32_t)1U << pMbXfer->mbIdx); -#endif - - status = kStatus_Success; - } - else - { - handle->mbState[pMbXfer->mbIdx] = (uint8_t)kFLEXCAN_StateIdle; - status = kStatus_Fail; - } - } - else - { - status = kStatus_FLEXCAN_TxBusy; - } - - return status; -} - -/*! - * brief Receives a message using IRQ. - * - * This function receives a message using IRQ. This is non-blocking function, which returns - * right away. When the message has been received, the receive callback function is called. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param pMbXfer FlexCAN FD Message Buffer transfer structure. See the #flexcan_mb_transfer_t. - * retval kStatus_Success - Start Rx Message Buffer receiving process successfully. - * retval kStatus_FLEXCAN_RxBusy - Rx Message Buffer is in use. - */ -status_t FLEXCAN_TransferFDReceiveNonBlocking(CAN_Type *base, flexcan_handle_t *handle, flexcan_mb_transfer_t *pMbXfer) -{ - /* Assertion. */ - assert(NULL != handle); - assert(NULL != pMbXfer); - assert(pMbXfer->mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, pMbXfer->mbIdx)); -#endif - - status_t status; - - /* Check if Message Buffer is idle. */ - if ((uint8_t)kFLEXCAN_StateIdle == handle->mbState[pMbXfer->mbIdx]) - { - handle->mbState[pMbXfer->mbIdx] = (uint8_t)kFLEXCAN_StateRxData; - - /* Register Message Buffer. */ - handle->mbFDFrameBuf[pMbXfer->mbIdx] = pMbXfer->framefd; - - /* Enable Message Buffer Interrupt. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (pMbXfer->mbIdx >= 64U) - { - FLEXCAN_EnableHigh64MbInterrupts(base, (uint64_t)1U << (pMbXfer->mbIdx - 64U)); - } - else - { - FLEXCAN_EnableMbInterrupts(base, (uint64_t)1U << pMbXfer->mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - FLEXCAN_EnableMbInterrupts(base, (uint64_t)1U << pMbXfer->mbIdx); -#else - FLEXCAN_EnableMbInterrupts(base, (uint32_t)1U << pMbXfer->mbIdx); -#endif - - status = kStatus_Success; - } - else - { - status = kStatus_FLEXCAN_RxBusy; - } - - return status; -} -#endif - -/*! - * brief Receives a message from Legacy Rx FIFO using IRQ. - * - * This function receives a message using IRQ. This is a non-blocking function, which returns - * right away. When all messages have been received, the receive callback function is called. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param pFifoXfer FlexCAN Rx FIFO transfer structure. See the ref flexcan_fifo_transfer_t. - * retval kStatus_Success - Start Rx FIFO receiving process successfully. - * retval kStatus_FLEXCAN_RxFifoBusy - Rx FIFO is currently in use. - */ -status_t FLEXCAN_TransferReceiveFifoNonBlocking(CAN_Type *base, - flexcan_handle_t *handle, - flexcan_fifo_transfer_t *pFifoXfer) -{ - /* Assertion. */ - assert(NULL != handle); - assert(NULL != pFifoXfer); - - status_t status; - uint32_t irqMask = (uint32_t)kFLEXCAN_RxFifoOverflowFlag | (uint32_t)kFLEXCAN_RxFifoWarningFlag; - - /* Check if Message Buffer is idle. */ - if ((uint8_t)kFLEXCAN_StateIdle == handle->rxFifoState) - { - handle->rxFifoState = (uint8_t)kFLEXCAN_StateRxFifo; - - /* Register Message Buffer. */ - handle->rxFifoFrameBuf = pFifoXfer->frame; - handle->rxFifoFrameNum = pFifoXfer->frameNum; - handle->rxFifoTransferTotalNum = pFifoXfer->frameNum; - - if (handle->rxFifoTransferTotalNum < 5U) - { - /* Enable data available interrupt. */ - irqMask |= (uint32_t)kFLEXCAN_RxFifoFrameAvlFlag; - } - - /* Enable Message Buffer Interrupt. */ - FLEXCAN_EnableMbInterrupts(base, irqMask); - - status = kStatus_Success; - } - else - { - status = kStatus_FLEXCAN_RxFifoBusy; - } - - return status; -} - -/*! - * brief Gets the Legacy Rx Fifo transfer status during a interrupt non-blocking receive. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param count Number of CAN messages receive so far by the non-blocking transaction. - * retval kStatus_InvalidArgument count is Invalid. - * retval kStatus_Success Successfully return the count. - */ - -status_t FLEXCAN_TransferGetReceiveFifoCount(CAN_Type *base, flexcan_handle_t *handle, size_t *count) -{ - assert(NULL != handle); - - status_t result = kStatus_Success; - - if (handle->rxFifoState == (uint32_t)kFLEXCAN_StateIdle) - { - result = kStatus_NoTransferInProgress; - } - else - { - *count = handle->rxFifoTransferTotalNum - handle->rxFifoFrameNum; - } - - return result; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * brief Receives a message from Enhanced Rx FIFO using IRQ. - * - * This function receives a message using IRQ. This is a non-blocking function, which returns - * right away. When all messages have been received, the receive callback function is called. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param pFifoXfer FlexCAN Rx FIFO transfer structure. See the ref flexcan_fifo_transfer_t. - * retval kStatus_Success - Start Rx FIFO receiving process successfully. - * retval kStatus_FLEXCAN_RxFifoBusy - Rx FIFO is currently in use. - */ -status_t FLEXCAN_TransferReceiveEnhancedFifoNonBlocking(CAN_Type *base, - flexcan_handle_t *handle, - flexcan_fifo_transfer_t *pFifoXfer) -{ - /* Assertion. */ - assert(NULL != handle); - assert(NULL != pFifoXfer); - - status_t status; - uint32_t watermark = ((base->ERFCR & CAN_ERFCR_ERFWM_MASK) >> CAN_ERFCR_ERFWM_SHIFT) + 1U; - uint64_t irqMask = - (uint64_t)kFLEXCAN_ERxFifoUnderflowInterruptEnable | (uint64_t)kFLEXCAN_ERxFifoOverflowInterruptEnable; - - /* Check if Enhanced Rx FIFO is idle. */ - if ((uint8_t)kFLEXCAN_StateIdle == handle->rxFifoState) - { - handle->rxFifoState = (uint8_t)kFLEXCAN_StateRxFifo; - - /* Register Message Buffer. */ - handle->rxFifoFDFrameBuf = pFifoXfer->framefd; - handle->rxFifoFrameNum = pFifoXfer->frameNum; - handle->rxFifoTransferTotalNum = pFifoXfer->frameNum; - - if (handle->rxFifoTransferTotalNum >= watermark) - { - /* Enable watermark interrupt. */ - irqMask |= (uint64_t)kFLEXCAN_ERxFifoWatermarkInterruptEnable; - } - else - { - /* Enable data available interrupt. */ - irqMask |= (uint64_t)kFLEXCAN_ERxFifoDataAvlInterruptEnable; - } - /* Enable Enhanced Rx FIFO Interrupt. */ - FLEXCAN_EnableInterrupts(base, irqMask); - - status = kStatus_Success; - } - else - { - status = kStatus_FLEXCAN_RxFifoBusy; - } - - return status; -} -#endif - -/*! - * brief Aborts the interrupt driven message send process. - * - * This function aborts the interrupt driven message send process. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param mbIdx The FlexCAN Message Buffer index. - */ -void FLEXCAN_TransferAbortSend(CAN_Type *base, flexcan_handle_t *handle, uint8_t mbIdx) -{ - uint16_t timestamp; - - /* Assertion. */ - assert(NULL != handle); - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - /* Disable Message Buffer Interrupt. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (mbIdx >= 64U) - { - FLEXCAN_DisableHigh64MbInterrupts(base, (uint64_t)1U << (mbIdx - 64U)); - } - else - { - FLEXCAN_DisableMbInterrupts(base, (uint64_t)1U << mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - FLEXCAN_DisableMbInterrupts(base, (uint64_t)1U << mbIdx); -#else - FLEXCAN_DisableMbInterrupts(base, (uint32_t)1U << mbIdx); -#endif - - /* Update the TX frame 's time stamp by MB[mbIdx].cs. */ - timestamp = (uint16_t)((base->MB[mbIdx].CS & CAN_CS_TIME_STAMP_MASK) >> CAN_CS_TIME_STAMP_SHIFT); - handle->timestamp[mbIdx] = timestamp; - - /* Clean Message Buffer. */ - FLEXCAN_SetTxMbConfig(base, mbIdx, true); - - handle->mbState[mbIdx] = (uint8_t)kFLEXCAN_StateIdle; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * brief Aborts the interrupt driven message send process. - * - * This function aborts the interrupt driven message send process. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param mbIdx The FlexCAN FD Message Buffer index. - */ -void FLEXCAN_TransferFDAbortSend(CAN_Type *base, flexcan_handle_t *handle, uint8_t mbIdx) -{ - volatile uint32_t *mbAddr; - uint32_t offset; - uint16_t timestamp; - - /* Assertion. */ - assert(NULL != handle); - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - /* Disable Message Buffer Interrupt. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (mbIdx >= 64U) - { - FLEXCAN_DisableHigh64MbInterrupts(base, (uint64_t)1U << (mbIdx - 64U)); - } - else - { - FLEXCAN_DisableMbInterrupts(base, (uint64_t)1U << mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - FLEXCAN_DisableMbInterrupts(base, (uint64_t)1U << mbIdx); -#else - FLEXCAN_DisableMbInterrupts(base, (uint32_t)1U << mbIdx); -#endif - - /* Update the TX frame 's time stamp by base->MB[offset for CAN FD].CS. */ - mbAddr = &(base->MB[0].CS); - offset = FLEXCAN_GetFDMailboxOffset(base, mbIdx); - timestamp = (uint16_t)((mbAddr[offset] & CAN_CS_TIME_STAMP_MASK) >> CAN_CS_TIME_STAMP_SHIFT); - handle->timestamp[mbIdx] = timestamp; - - /* Clean Message Buffer. */ - FLEXCAN_SetFDTxMbConfig(base, mbIdx, true); - - handle->mbState[mbIdx] = (uint8_t)kFLEXCAN_StateIdle; -} - -/*! - * brief Aborts the interrupt driven message receive process. - * - * This function aborts the interrupt driven message receive process. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param mbIdx The FlexCAN FD Message Buffer index. - */ -void FLEXCAN_TransferFDAbortReceive(CAN_Type *base, flexcan_handle_t *handle, uint8_t mbIdx) -{ - /* Assertion. */ - assert(NULL != handle); - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - /* Disable Message Buffer Interrupt. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (mbIdx >= 64U) - { - FLEXCAN_DisableHigh64MbInterrupts(base, (uint64_t)1U << (mbIdx - 64U)); - } - else - { - FLEXCAN_DisableMbInterrupts(base, (uint64_t)1U << mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - FLEXCAN_DisableMbInterrupts(base, (uint64_t)1U << mbIdx); -#else - FLEXCAN_DisableMbInterrupts(base, (uint32_t)1U << mbIdx); -#endif - - /* Un-register handle. */ - handle->mbFDFrameBuf[mbIdx] = NULL; - handle->mbState[mbIdx] = (uint8_t)kFLEXCAN_StateIdle; -} -#endif - -/*! - * brief Aborts the interrupt driven message receive process. - * - * This function aborts the interrupt driven message receive process. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param mbIdx The FlexCAN Message Buffer index. - */ -void FLEXCAN_TransferAbortReceive(CAN_Type *base, flexcan_handle_t *handle, uint8_t mbIdx) -{ - /* Assertion. */ - assert(NULL != handle); - assert(mbIdx <= (base->MCR & CAN_MCR_MAXMB_MASK)); -#if !defined(NDEBUG) - assert(!FLEXCAN_IsMbOccupied(base, mbIdx)); -#endif - - /* Disable Message Buffer Interrupt. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (mbIdx >= 64U) - { - FLEXCAN_DisableHigh64MbInterrupts(base, (uint64_t)1U << (mbIdx - 64U)); - } - else - { - FLEXCAN_DisableMbInterrupts(base, (uint64_t)1U << mbIdx); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - FLEXCAN_DisableMbInterrupts(base, (uint64_t)1U << mbIdx); -#else - FLEXCAN_DisableMbInterrupts(base, (uint32_t)1U << mbIdx); -#endif - - /* Un-register handle. */ - handle->mbFrameBuf[mbIdx] = NULL; - handle->mbState[mbIdx] = (uint8_t)kFLEXCAN_StateIdle; -} - -/*! - * brief Aborts the interrupt driven message receive from Legacy Rx FIFO process. - * - * This function aborts the interrupt driven message receive from Legacy Rx FIFO process. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - */ -void FLEXCAN_TransferAbortReceiveFifo(CAN_Type *base, flexcan_handle_t *handle) -{ - /* Assertion. */ - assert(NULL != handle); - - /* Check if Rx FIFO is enabled. */ - if (0U != (base->MCR & CAN_MCR_RFEN_MASK)) - { - /* Disable Rx Message FIFO Interrupts. */ - FLEXCAN_DisableMbInterrupts(base, (uint32_t)kFLEXCAN_RxFifoOverflowFlag | (uint32_t)kFLEXCAN_RxFifoWarningFlag | - (uint32_t)kFLEXCAN_RxFifoFrameAvlFlag); - - /* Un-register handle. */ - handle->rxFifoFrameBuf = NULL; - /* Clear transfer count. */ - handle->rxFifoFrameNum = 0U; - handle->rxFifoTransferTotalNum = 0U; - } - - handle->rxFifoState = (uint8_t)kFLEXCAN_StateIdle; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * brief Aborts the interrupt driven message receive from Enhanced Rx FIFO process. - * - * This function aborts the interrupt driven message receive from Rx FIFO process. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - */ -void FLEXCAN_TransferAbortReceiveEnhancedFifo(CAN_Type *base, flexcan_handle_t *handle) -{ - /* Assertion. */ - assert(NULL != handle); - - /* Check if Enhanced Rx FIFO is enabled. */ - if (0U != (base->ERFCR & CAN_ERFCR_ERFEN_MASK)) - { - /* Disable all Rx Message FIFO interrupts. */ - FLEXCAN_DisableInterrupts(base, (uint64_t)kFLEXCAN_ERxFifoUnderflowInterruptEnable | - (uint64_t)kFLEXCAN_ERxFifoOverflowInterruptEnable | - (uint64_t)kFLEXCAN_ERxFifoWatermarkInterruptEnable | - (uint64_t)kFLEXCAN_ERxFifoDataAvlInterruptEnable); - - /* Un-register handle. */ - handle->rxFifoFDFrameBuf = NULL; - /* Clear transfer count. */ - handle->rxFifoFrameNum = 0U; - handle->rxFifoTransferTotalNum = 0U; - } - - handle->rxFifoState = (uint8_t)kFLEXCAN_StateIdle; -} -#endif - -/*! - * brief Gets the detail index of Mailbox's Timestamp by handle. - * - * Then function can only be used when calling non-blocking Data transfer (TX/RX) API, - * After TX/RX data transfer done (User can get the status by handler's callback function), - * we can get the detail index of Mailbox's timestamp by handle, - * Detail non-blocking data transfer API (TX/RX) contain. - * -FLEXCAN_TransferSendNonBlocking - * -FLEXCAN_TransferFDSendNonBlocking - * -FLEXCAN_TransferReceiveNonBlocking - * -FLEXCAN_TransferFDReceiveNonBlocking - * -FLEXCAN_TransferReceiveFifoNonBlocking - * - * param handle FlexCAN handle pointer. - * param mbIdx The FlexCAN FD Message Buffer index. - * return the index of mailbox 's timestamp stored in the handle. - * - */ -uint32_t FLEXCAN_GetTimeStamp(flexcan_handle_t *handle, uint8_t mbIdx) -{ - /* Assertion. */ - assert(NULL != handle); - - return (uint32_t)(handle->timestamp[mbIdx]); -} - -/*! - * brief Check unhandle interrupt events - * - * param base FlexCAN peripheral base address. - * return TRUE if unhandled interrupt action exist, FALSE if no unhandlered interrupt action exist. - */ -static bool FLEXCAN_CheckUnhandleInterruptEvents(CAN_Type *base) -{ - uint64_t tempmask; - uint64_t tempflag; - bool fgRet = false; - - if (0U == (FLEXCAN_GetStatusFlags(base) & - (FLEXCAN_ERROR_AND_STATUS_INIT_FLAG | FLEXCAN_WAKE_UP_FLAG | FLEXCAN_MEMORY_ENHANCED_RX_FIFO_INIT_FLAG))) - { - /* If no error, wake_up or enhanced RX FIFO status, Checking whether exist MB interrupt status and legacy RX - * FIFO interrupt status */ - tempmask = (uint64_t)base->IMASK1; - tempflag = (uint64_t)base->IFLAG1; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - tempmask |= ((uint64_t)base->IMASK2) << 32; - tempflag |= ((uint64_t)base->IFLAG2) << 32; -#endif - fgRet = (0U != (tempmask & tempflag)); -#if defined(CAN_IMASK3_BUF95TO64M_MASK) - if (0U != (base->IMASK3 & base->IFLAG3)) - { - fgRet = true; - } -#endif -#if defined(CAN_IMASK4_BUF127TO96M_MASK) - if (0U != (base->IMASK4 & base->IFLAG4)) - { - fgRet = true; - } -#endif - } -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - else if (0U != (FLEXCAN_GetStatusFlags(base) & FLEXCAN_MEMORY_ENHANCED_RX_FIFO_INIT_FLAG)) - { - /* Checking whether exist enhanced RX FIFO interrupt status. */ - tempmask = (uint64_t)base->ERFIER; - tempflag = (uint64_t)base->ERFSR; - fgRet = (0U != (tempmask & tempflag)); - } -#endif - else - { - /* Exist error or wake up flag. */ - fgRet = true; - } - - return fgRet; -} - -/*! - * brief Sub Handler Legacy Rx FIFO Trasfered Events - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param result The MB flag number. - * - * return the status after handle transfered event. - */ -static status_t FLEXCAN_SubHandlerForLegacyRxFIFO(CAN_Type *base, flexcan_handle_t *handle, uint32_t result) -{ - uint32_t u32mask = 1; - status_t status = kStatus_FLEXCAN_UnHandled; - - switch (u32mask << result) - { - case kFLEXCAN_RxFifoOverflowFlag: - status = kStatus_FLEXCAN_RxFifoOverflow; - break; - - case kFLEXCAN_RxFifoWarningFlag: - if ((handle->rxFifoFrameNum > 5U) && (0U != (base->IFLAG1 & (uint32_t)kFLEXCAN_RxFifoFrameAvlFlag))) - { - for (uint32_t i = 0; i < 5UL; i++) - { - status = FLEXCAN_ReadRxFifo(base, handle->rxFifoFrameBuf); - /* - * $Branch Coverage Justification$ - * (kStatus_Success != status) not covered. $ref flexcan_c_ref_1$. - */ - if (kStatus_Success == status) - { - /* Align the current rxfifo timestamp to the timestamp array by handle. */ - handle->timestamp[i] = handle->rxFifoFrameBuf->timestamp; - handle->rxFifoFrameBuf++; - handle->rxFifoFrameNum--; - /* Clean Rx Fifo available flag to discard the frame that has been read. */ - FLEXCAN_ClearMbStatusFlags(base, (uint32_t)kFLEXCAN_RxFifoFrameAvlFlag); - } - else - { - /* - * $Line Coverage Justification$ - * $ref flexcan_c_ref_1$. - */ - return kStatus_FLEXCAN_RxFifoDisabled; - } - } - if (handle->rxFifoFrameNum < 5UL) - { - /* Enable data avaliable interrupt. */ - FLEXCAN_EnableMbInterrupts(base, (uint32_t)kFLEXCAN_RxFifoFrameAvlFlag); - } - status = kStatus_FLEXCAN_RxFifoBusy; - } - else - { - /* Should enter case kFLEXCAN_RxFifoFrameAvlFlag but not, means previous transfer may have - * overflow*/ - status = kStatus_FLEXCAN_RxFifoWarning; - } - break; - - case kFLEXCAN_RxFifoFrameAvlFlag: - /* Whether still has CAN messages remaining to be received. */ - if (handle->rxFifoFrameNum > 0U) - { - status = FLEXCAN_ReadRxFifo(base, handle->rxFifoFrameBuf); - /* - * $Branch Coverage Justification$ - * (kStatus_Success != status) not covered. $ref flexcan_c_ref_1$. - */ - if (kStatus_Success == status) - { - /* Align the current (index 0) rxfifo timestamp to the timestamp array by handle. */ - handle->timestamp[0] = handle->rxFifoFrameBuf->timestamp; - handle->rxFifoFrameBuf++; - handle->rxFifoFrameNum--; - } - else - { - /* - * $Line Coverage Justification$ - * $ref flexcan_c_ref_1$. - */ - return kStatus_FLEXCAN_RxFifoDisabled; - } - } - if (handle->rxFifoFrameNum == 0U) - { - /* Stop receiving Ehanced Rx FIFO when the transmission is over. */ - FLEXCAN_TransferAbortReceiveFifo(base, handle); - status = kStatus_FLEXCAN_RxFifoIdle; - } - else - { - /* Continue use data avaliable interrupt. */ - status = kStatus_FLEXCAN_RxFifoBusy; - } - break; - - default: - status = kStatus_FLEXCAN_UnHandled; - break; - } - - return status; -} - -/*! - * brief Sub Handler Message Buffer Trasfered Events - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param result The MB flag number. - * - * return the status after handle transfered event. - */ -static status_t FLEXCAN_SubHandlerForMB(CAN_Type *base, flexcan_handle_t *handle, uint32_t result) -{ - status_t status = kStatus_FLEXCAN_UnHandled; - - /* Get current State of Message Buffer. */ - switch (handle->mbState[result]) - { - /* Solve Rx Data Frame. */ - case (uint8_t)kFLEXCAN_StateRxData: -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0U != (base->MCR & CAN_MCR_FDEN_MASK)) - { - status = FLEXCAN_ReadFDRxMb(base, (uint8_t)result, handle->mbFDFrameBuf[result]); - if ((kStatus_Success == status) || (kStatus_FLEXCAN_RxOverflow == status)) - { - /* Align the current index of RX MB timestamp to the timestamp array by handle. */ - handle->timestamp[result] = handle->mbFDFrameBuf[result]->timestamp; - - if (kStatus_Success == status) - { - status = kStatus_FLEXCAN_RxIdle; - } - } - } - else -#endif - { - status = FLEXCAN_ReadRxMb(base, (uint8_t)result, handle->mbFrameBuf[result]); - if ((kStatus_Success == status) || (kStatus_FLEXCAN_RxOverflow == status)) - { - /* Align the current index of RX MB timestamp to the timestamp array by handle. */ - handle->timestamp[result] = handle->mbFrameBuf[result]->timestamp; - - if (kStatus_Success == status) - { - status = kStatus_FLEXCAN_RxIdle; - } - } - } -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0U != (base->MCR & CAN_MCR_FDEN_MASK)) - { - FLEXCAN_TransferFDAbortReceive(base, handle, (uint8_t)result); - } - else -#endif - { - FLEXCAN_TransferAbortReceive(base, handle, (uint8_t)result); - } - break; - - /* Sove Rx Remote Frame. User need to Read the frame in Mail box in time by Read from MB API. */ - case (uint8_t)kFLEXCAN_StateRxRemote: - status = kStatus_FLEXCAN_RxRemote; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0U != (base->MCR & CAN_MCR_FDEN_MASK)) - { - FLEXCAN_TransferFDAbortReceive(base, handle, (uint8_t)result); - } - else -#endif - { - FLEXCAN_TransferAbortReceive(base, handle, (uint8_t)result); - } - break; - - /* Solve Tx Data Frame. */ - case (uint8_t)kFLEXCAN_StateTxData: - status = kStatus_FLEXCAN_TxIdle; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0U != (base->MCR & CAN_MCR_FDEN_MASK)) - { - FLEXCAN_TransferFDAbortSend(base, handle, (uint8_t)result); - } - else -#endif - { - FLEXCAN_TransferAbortSend(base, handle, (uint8_t)result); - } - break; - - /* Solve Tx Remote Frame. */ - case (uint8_t)kFLEXCAN_StateTxRemote: - handle->mbState[result] = (uint8_t)kFLEXCAN_StateRxRemote; - status = kStatus_FLEXCAN_TxSwitchToRx; - break; - - default: - status = kStatus_FLEXCAN_UnHandled; - break; - } - - return status; -} - -/*! - * brief Sub Handler Data Trasfered Events - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param pResult Pointer to the Handle result. - * - * return the status after handle each data transfered event. - */ -static status_t FLEXCAN_SubHandlerForDataTransfered(CAN_Type *base, flexcan_handle_t *handle, uint32_t *pResult) -{ - status_t status = kStatus_FLEXCAN_UnHandled; - uint32_t result = 0xFFU; - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - uint32_t intflag[4] = {(base->IMASK1 & base->IFLAG1), (base->IMASK2 & base->IFLAG2), 0U, 0U}; -#if defined(CAN_IMASK3_BUF95TO64M_MASK) - intflag[2] = base->IMASK3 & base->IFLAG3; -#endif -#if defined(CAN_IMASK4_BUF127TO96M_MASK) - intflag[3] = base->IMASK4 & base->IFLAG4; -#endif -#else - uint32_t intflag = base->IMASK1 & base->IFLAG1; -#endif - - /* For this implementation, we solve the Message with lowest MB index first. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - for (uint32_t i = 0U; i < 4U; i++) - { - if (intflag[i] != 0U) - { - for (uint32_t j = 0U; j < 32U; j++) - { - if (0UL != (intflag[i] & ((uint32_t)1UL << j))) - { - result = i * 32U + j; - break; - } - } - break; - } - } -#else - for (result = 0U; result < (uint32_t)FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(base); result++) - { - if (0UL != (intflag & ((uint32_t)1UL << result))) - { - break; - } - } -#endif - - /* find Message to deal with. */ - if (result < (uint32_t)FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(base)) - { - /* Solve Legacy Rx FIFO interrupt. */ - if (((uint8_t)kFLEXCAN_StateIdle != handle->rxFifoState) && (result <= (uint32_t)CAN_IFLAG1_BUF7I_SHIFT) && - ((base->MCR & CAN_MCR_RFEN_MASK) != 0U)) - { - status = FLEXCAN_SubHandlerForLegacyRxFIFO(base, handle, result); - /* - * $Branch Coverage Justification$ - * (status == kStatus_FLEXCAN_RxFifoDisabled) not covered. $ref flexcan_c_ref_1$. - */ - if (status == kStatus_FLEXCAN_RxFifoDisabled) - { - /* - * $Line Coverage Justification$ - * $ref flexcan_c_ref_1$. - */ - return status; - } - } - else - { - status = FLEXCAN_SubHandlerForMB(base, handle, result); - } - - /* Clear resolved Message Buffer IRQ. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) - if (result >= 64U) - { - FLEXCAN_ClearHigh64MbStatusFlags(base, (uint64_t)1U << (result - 64U)); - } - else - { - FLEXCAN_ClearMbStatusFlags(base, (uint64_t)1U << result); - } -#elif (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - FLEXCAN_ClearMbStatusFlags(base, (uint64_t)1U << result); -#else - FLEXCAN_ClearMbStatusFlags(base, (uint32_t)1U << result); -#endif - } - - *pResult = result; - - return status; -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * brief Sub Handler Ehanced Rx FIFO event - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param flags FlexCAN interrupt flags. - * - * return the status after handle Ehanced Rx FIFO event. - */ -static status_t FLEXCAN_SubHandlerForEhancedRxFifo(CAN_Type *base, flexcan_handle_t *handle, uint64_t flags) -{ - uint32_t watermark = ((base->ERFCR & CAN_ERFCR_ERFWM_MASK) >> CAN_ERFCR_ERFWM_SHIFT) + 1U; - uint32_t transferFrames; - - status_t status; - /* Solve Ehanced Rx FIFO interrupt. */ - if ((0u != (flags & (uint64_t)kFLEXCAN_ERxFifoUnderflowIntFlag)) && - (0u != (base->ERFIER & CAN_ERFIER_ERFUFWIE_MASK))) - { - status = kStatus_FLEXCAN_RxFifoUnderflow; - FLEXCAN_ClearStatusFlags(base, (uint64_t)kFLEXCAN_ERxFifoUnderflowIntFlag); - } - else if ((0u != (flags & (uint64_t)kFLEXCAN_ERxFifoOverflowIntFlag)) && - (0u != (base->ERFIER & CAN_ERFIER_ERFOVFIE_MASK))) - { - status = kStatus_FLEXCAN_RxFifoOverflow; - FLEXCAN_ClearStatusFlags(base, (uint64_t)kFLEXCAN_ERxFifoOverflowIntFlag); - } - else if ((0u != (flags & (uint64_t)kFLEXCAN_ERxFifoWatermarkIntFlag)) && - (0u != (base->ERFIER & CAN_ERFIER_ERFWMIIE_MASK))) - { - /* Whether the number of CAN messages remaining to be received is greater than the watermark. */ - transferFrames = (handle->rxFifoFrameNum > watermark) ? watermark : handle->rxFifoFrameNum; - - for (uint32_t i = 0; i < transferFrames; i++) - { - status = FLEXCAN_ReadEnhancedRxFifo(base, handle->rxFifoFDFrameBuf); - - if (kStatus_Success == status) - { - handle->rxFifoFDFrameBuf++; - handle->rxFifoFrameNum--; - /* Clear data Watermark flag due to has read back one frame. */ - base->ERFSR = CAN_ERFSR_ERFWMI_MASK; - } - else - { - return kStatus_FLEXCAN_RxFifoDisabled; - } - } - if (handle->rxFifoFrameNum == 0U) - { - /* Stop receiving Ehanced Rx FIFO when the transmission is over. */ - FLEXCAN_TransferAbortReceiveEnhancedFifo(base, handle); - status = kStatus_FLEXCAN_RxFifoIdle; - } - else if (handle->rxFifoFrameNum < watermark) - { - /* Disable watermark interrupt and enable data avaliable interrupt. */ - FLEXCAN_DisableInterrupts(base, (uint64_t)kFLEXCAN_ERxFifoWatermarkInterruptEnable); - FLEXCAN_EnableInterrupts(base, (uint64_t)kFLEXCAN_ERxFifoDataAvlInterruptEnable); - status = kStatus_FLEXCAN_RxFifoBusy; - } - else - { - /* Continue use watermark interrupt. */ - status = kStatus_FLEXCAN_RxFifoBusy; - } - } - else - { - /* Data available status, check Whether still has CAN messages remaining to be received. */ - if (handle->rxFifoFrameNum > 0U) - { - status = FLEXCAN_ReadEnhancedRxFifo(base, handle->rxFifoFDFrameBuf); - - if (kStatus_Success == status) - { - handle->rxFifoFDFrameBuf++; - handle->rxFifoFrameNum--; - } - else - { - return kStatus_FLEXCAN_RxFifoDisabled; - } - } - if (handle->rxFifoFrameNum == 0U) - { - /* Stop receiving Ehanced Rx FIFO when the transmission is over. */ - FLEXCAN_TransferAbortReceiveEnhancedFifo(base, handle); - status = kStatus_FLEXCAN_RxFifoIdle; - } - else - { - /* Continue use data avaliable interrupt. */ - status = kStatus_FLEXCAN_RxFifoBusy; - } - } - return status; -} -#endif - -/*! - * brief FlexCAN IRQ handle function. - * - * This function handles the FlexCAN Error, the Message Buffer, and the Rx FIFO IRQ request. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - */ -void FLEXCAN_TransferHandleIRQ(CAN_Type *base, flexcan_handle_t *handle) -{ - /* Assertion. */ - assert(NULL != handle); - - status_t status; - uint32_t mbNum = 0xFFU; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - uint64_t result = 0U; -#else - uint32_t result = 0U; -#endif - do - { - /* Get Current FlexCAN Module Error and Status. */ - result = FLEXCAN_GetStatusFlags(base); - - /* To handle FlexCAN Error and Status Interrupt first. */ - if (0U != (result & FLEXCAN_ERROR_AND_STATUS_INIT_FLAG)) - { - status = kStatus_FLEXCAN_ErrorStatus; - /* Clear FlexCAN Error and Status Interrupt. */ - FLEXCAN_ClearStatusFlags(base, FLEXCAN_ERROR_AND_STATUS_INIT_FLAG); - } - else if (0U != (result & FLEXCAN_WAKE_UP_FLAG)) - { - status = kStatus_FLEXCAN_WakeUp; - FLEXCAN_ClearStatusFlags(base, FLEXCAN_WAKE_UP_FLAG); - } -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - else if (0U != (FLEXCAN_EFIFO_STATUS_UNMASK(result & FLEXCAN_MEMORY_ENHANCED_RX_FIFO_INIT_FLAG) & base->ERFIER)) - { - status = FLEXCAN_SubHandlerForEhancedRxFifo(base, handle, result); - } -#endif - else - { - /* To handle Message Buffer or Legacy Rx FIFO transfer. */ - status = FLEXCAN_SubHandlerForDataTransfered(base, handle, &mbNum); - result = mbNum; - } - - /* Calling Callback Function if has one. */ - if (handle->callback != NULL) - { - handle->callback(base, handle, status, result, handle->userData); - } - } while (FLEXCAN_CheckUnhandleInterruptEvents(base)); -} - -#if defined(CAN0) -void CAN0_DriverIRQHandler(void); -void CAN0_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[0]); - - s_flexcanIsr(CAN0, s_flexcanHandle[0]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CAN1) -void CAN1_DriverIRQHandler(void); -void CAN1_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[1]); - - s_flexcanIsr(CAN1, s_flexcanHandle[1]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CAN2) -void CAN2_DriverIRQHandler(void); -void CAN2_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[2]); - - s_flexcanIsr(CAN2, s_flexcanHandle[2]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CAN3) -void CAN3_DriverIRQHandler(void); -void CAN3_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[3]); - - s_flexcanIsr(CAN3, s_flexcanHandle[3]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(CAN4) -void CAN4_DriverIRQHandler(void); -void CAN4_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[4]); - - s_flexcanIsr(CAN4, s_flexcanHandle[4]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(DMA__CAN0) -void DMA_FLEXCAN0_INT_DriverIRQHandler(void); -void DMA_FLEXCAN0_INT_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[FLEXCAN_GetInstance(DMA__CAN0)]); - - s_flexcanIsr(DMA__CAN0, s_flexcanHandle[FLEXCAN_GetInstance(DMA__CAN0)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(DMA__CAN1) -void DMA_FLEXCAN1_INT_DriverIRQHandler(void); -void DMA_FLEXCAN1_INT_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[FLEXCAN_GetInstance(DMA__CAN1)]); - - s_flexcanIsr(DMA__CAN1, s_flexcanHandle[FLEXCAN_GetInstance(DMA__CAN1)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(DMA__CAN2) -void DMA_FLEXCAN2_INT_DriverIRQHandler(void); -void DMA_FLEXCAN2_INT_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[FLEXCAN_GetInstance(DMA__CAN2)]); - - s_flexcanIsr(DMA__CAN2, s_flexcanHandle[FLEXCAN_GetInstance(DMA__CAN2)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(ADMA__CAN0) -void ADMA_FLEXCAN0_INT_DriverIRQHandler(void); -void ADMA_FLEXCAN0_INT_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[FLEXCAN_GetInstance(ADMA__CAN0)]); - - s_flexcanIsr(ADMA__CAN0, s_flexcanHandle[FLEXCAN_GetInstance(ADMA__CAN0)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(ADMA__CAN1) -void ADMA_FLEXCAN1_INT_DriverIRQHandler(void); -void ADMA_FLEXCAN1_INT_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[FLEXCAN_GetInstance(ADMA__CAN1)]); - - s_flexcanIsr(ADMA__CAN1, s_flexcanHandle[FLEXCAN_GetInstance(ADMA__CAN1)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(ADMA__CAN2) -void ADMA_FLEXCAN2_INT_DriverIRQHandler(void); -void ADMA_FLEXCAN2_INT_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[FLEXCAN_GetInstance(ADMA__CAN2)]); - - s_flexcanIsr(ADMA__CAN2, s_flexcanHandle[FLEXCAN_GetInstance(ADMA__CAN2)]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(FLEXCAN1) -void CAN_FD1_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[1]); - - s_flexcanIsr(FLEXCAN1, s_flexcanHandle[1]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(FLEXCAN2) -void CAN_FD2_DriverIRQHandler(void) -{ - assert(NULL != s_flexcanHandle[2]); - - s_flexcanIsr(FLEXCAN2, s_flexcanHandle[2]); - SDK_ISR_EXIT_BARRIER; -} -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexcan.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexcan.h deleted file mode 100644 index 9170938afe5..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexcan.h +++ /dev/null @@ -1,2360 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_FLEXCAN_H_ -#define FSL_FLEXCAN_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup flexcan_driver - * @{ - */ - -/****************************************************************************** - * Definitions - *****************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief FlexCAN driver version. */ -#define FSL_FLEXCAN_DRIVER_VERSION (MAKE_VERSION(2, 11, 6)) -/*! @} */ - -#if !(defined(FLEXCAN_WAIT_TIMEOUT) && FLEXCAN_WAIT_TIMEOUT) -/* Define to 1000 means keep waiting 1000 times until the flag is assert/deassert. */ -#define FLEXCAN_WAIT_TIMEOUT (1000U) -#endif - -/*! @brief FlexCAN frame length helper macro. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -#define DLC_LENGTH_DECODE(dlc) (((dlc) <= 8U) ? (dlc) : (((dlc) <= 12U) ? (((dlc)-6U) * 4U) : (((dlc)-11U) * 16U))) -#endif - -/*! @brief FlexCAN Frame ID helper macro. */ -#define FLEXCAN_ID_STD(id) \ - (((uint32_t)(((uint32_t)(id)) << CAN_ID_STD_SHIFT)) & CAN_ID_STD_MASK) /*!< Standard Frame ID helper macro. */ -#define FLEXCAN_ID_EXT(id) \ - (((uint32_t)(((uint32_t)(id)) << CAN_ID_EXT_SHIFT)) & \ - (CAN_ID_EXT_MASK | CAN_ID_STD_MASK)) /*!< Extend Frame ID helper macro. */ - -/*! @brief FlexCAN Rx Message Buffer Mask helper macro. */ -#define FLEXCAN_RX_MB_STD_MASK(id, rtr, ide) \ - (((uint32_t)((uint32_t)(rtr) << 31) | (uint32_t)((uint32_t)(ide) << 30)) | \ - FLEXCAN_ID_STD(id)) /*!< Standard Rx Message Buffer Mask helper macro. */ -#define FLEXCAN_RX_MB_EXT_MASK(id, rtr, ide) \ - (((uint32_t)((uint32_t)(rtr) << 31) | (uint32_t)((uint32_t)(ide) << 30)) | \ - FLEXCAN_ID_EXT(id)) /*!< Extend Rx Message Buffer Mask helper macro. */ - -/*! @brief FlexCAN Legacy Rx FIFO Mask helper macro. */ -#define FLEXCAN_RX_FIFO_STD_MASK_TYPE_A(id, rtr, ide) \ - (((uint32_t)((uint32_t)(rtr) << 31) | (uint32_t)((uint32_t)(ide) << 30)) | \ - (FLEXCAN_ID_STD(id) << 1)) /*!< Standard Rx FIFO Mask helper macro Type A helper macro. */ -#define FLEXCAN_RX_FIFO_STD_MASK_TYPE_B_HIGH(id, rtr, ide) \ - (((uint32_t)((uint32_t)(rtr) << 31) | (uint32_t)((uint32_t)(ide) << 30)) | \ - (((uint32_t)(id)&0x7FF) << 19)) /*!< Standard Rx FIFO Mask helper macro Type B upper part helper macro. */ -#define FLEXCAN_RX_FIFO_STD_MASK_TYPE_B_LOW(id, rtr, ide) \ - (((uint32_t)((uint32_t)(rtr) << 15) | (uint32_t)((uint32_t)(ide) << 14)) | \ - (((uint32_t)(id)&0x7FF) << 3)) /*!< Standard Rx FIFO Mask helper macro Type B lower part helper macro. */ -#define FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_HIGH(id) \ - (((uint32_t)(id)&0x7F8) << 21) /*!< Standard Rx FIFO Mask helper macro Type C upper part helper macro. */ -#define FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_MID_HIGH(id) \ - (((uint32_t)(id)&0x7F8) << 13) /*!< Standard Rx FIFO Mask helper macro Type C mid-upper part helper macro. */ -#define FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_MID_LOW(id) \ - (((uint32_t)(id)&0x7F8) << 5) /*!< Standard Rx FIFO Mask helper macro Type C mid-lower part helper macro. */ -#define FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_LOW(id) \ - (((uint32_t)(id)&0x7F8) >> 3) /*!< Standard Rx FIFO Mask helper macro Type C lower part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_MASK_TYPE_A(id, rtr, ide) \ - (((uint32_t)((uint32_t)(rtr) << 31) | (uint32_t)((uint32_t)(ide) << 30)) | \ - (FLEXCAN_ID_EXT(id) << 1)) /*!< Extend Rx FIFO Mask helper macro Type A helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_MASK_TYPE_B_HIGH(id, rtr, ide) \ - ( \ - ((uint32_t)((uint32_t)(rtr) << 31) | (uint32_t)((uint32_t)(ide) << 30)) | \ - ((FLEXCAN_ID_EXT(id) & 0x1FFF8000) \ - << 1)) /*!< Extend Rx FIFO Mask helper macro Type B upper part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_MASK_TYPE_B_LOW(id, rtr, ide) \ - (((uint32_t)((uint32_t)(rtr) << 15) | (uint32_t)((uint32_t)(ide) << 14)) | \ - ((FLEXCAN_ID_EXT(id) & 0x1FFF8000) >> \ - 15)) /*!< Extend Rx FIFO Mask helper macro Type B lower part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_HIGH(id) \ - ((FLEXCAN_ID_EXT(id) & 0x1FE00000) << 3) /*!< Extend Rx FIFO Mask helper macro Type C upper part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_MID_HIGH(id) \ - ((FLEXCAN_ID_EXT(id) & 0x1FE00000) >> \ - 5) /*!< Extend Rx FIFO Mask helper macro Type C mid-upper part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_MID_LOW(id) \ - ((FLEXCAN_ID_EXT(id) & 0x1FE00000) >> \ - 13) /*!< Extend Rx FIFO Mask helper macro Type C mid-lower part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_LOW(id) \ - ((FLEXCAN_ID_EXT(id) & 0x1FE00000) >> 21) /*!< Extend Rx FIFO Mask helper macro Type C lower part helper macro. */ - -/*! @brief FlexCAN Rx FIFO Filter helper macro. */ -#define FLEXCAN_RX_FIFO_STD_FILTER_TYPE_A(id, rtr, ide) \ - FLEXCAN_RX_FIFO_STD_MASK_TYPE_A(id, rtr, ide) /*!< Standard Rx FIFO Filter helper macro Type A helper macro. */ -#define FLEXCAN_RX_FIFO_STD_FILTER_TYPE_B_HIGH(id, rtr, ide) \ - FLEXCAN_RX_FIFO_STD_MASK_TYPE_B_HIGH( \ - id, rtr, ide) /*!< Standard Rx FIFO Filter helper macro Type B upper part helper macro. */ -#define FLEXCAN_RX_FIFO_STD_FILTER_TYPE_B_LOW(id, rtr, ide) \ - FLEXCAN_RX_FIFO_STD_MASK_TYPE_B_LOW( \ - id, rtr, ide) /*!< Standard Rx FIFO Filter helper macro Type B lower part helper macro. */ -#define FLEXCAN_RX_FIFO_STD_FILTER_TYPE_C_HIGH(id) \ - FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_HIGH( \ - id) /*!< Standard Rx FIFO Filter helper macro Type C upper part helper macro. */ -#define FLEXCAN_RX_FIFO_STD_FILTER_TYPE_C_MID_HIGH(id) \ - FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_MID_HIGH( \ - id) /*!< Standard Rx FIFO Filter helper macro Type C mid-upper part helper macro. */ -#define FLEXCAN_RX_FIFO_STD_FILTER_TYPE_C_MID_LOW(id) \ - FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_MID_LOW( \ - id) /*!< Standard Rx FIFO Filter helper macro Type C mid-lower part helper macro. */ -#define FLEXCAN_RX_FIFO_STD_FILTER_TYPE_C_LOW(id) \ - FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_LOW( \ - id) /*!< Standard Rx FIFO Filter helper macro Type C lower part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_A(id, rtr, ide) \ - FLEXCAN_RX_FIFO_EXT_MASK_TYPE_A(id, rtr, ide) /*!< Extend Rx FIFO Filter helper macro Type A helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_B_HIGH(id, rtr, ide) \ - FLEXCAN_RX_FIFO_EXT_MASK_TYPE_B_HIGH( \ - id, rtr, ide) /*!< Extend Rx FIFO Filter helper macro Type B upper part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_B_LOW(id, rtr, ide) \ - FLEXCAN_RX_FIFO_EXT_MASK_TYPE_B_LOW( \ - id, rtr, ide) /*!< Extend Rx FIFO Filter helper macro Type B lower part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_C_HIGH(id) \ - FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_HIGH( \ - id) /*!< Extend Rx FIFO Filter helper macro Type C upper part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_C_MID_HIGH(id) \ - FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_MID_HIGH( \ - id) /*!< Extend Rx FIFO Filter helper macro Type C mid-upper part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_C_MID_LOW(id) \ - FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_MID_LOW( \ - id) /*!< Extend Rx FIFO Filter helper macro Type C mid-lower part helper macro. */ -#define FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_C_LOW(id) \ - FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_LOW(id) /*!< Extend Rx FIFO Filter helper macro Type C lower part helper macro. */ - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! @brief FlexCAN Enhanced Rx FIFO Filter and Mask helper macro. */ -#define ENHANCED_RX_FIFO_FSCH(x) (((uint32_t)(((uint32_t)(x)) << 30)) & 0xC0000000U) -#define RTR_STD_HIGH(x) (((uint32_t)(((uint32_t)(x)) << 27)) & 0x08000000U) -#define RTR_STD_LOW(x) (((uint32_t)(((uint32_t)(x)) << 11)) & 0x00000800U) -#define RTR_EXT(x) (((uint32_t)(((uint32_t)(x)) << 29)) & 0x40000000U) -#define ID_STD_LOW(id) (((uint32_t)id) & 0x7FFU) -#define ID_STD_HIGH(id) (((uint32_t)(((uint32_t)(id)) << 16)) & 0x07FF0000U) -#define ID_EXT(id) (((uint32_t)id) & 0x1FFFFFFFU) - -/*! Standard ID filter element with filter + mask scheme. */ -#define FLEXCAN_ENHANCED_RX_FIFO_STD_MASK_AND_FILTER(id, rtr, id_mask, rtr_mask) \ - (ENHANCED_RX_FIFO_FSCH(0x0) | RTR_STD_HIGH(rtr) | ID_STD_HIGH(id) | RTR_STD_LOW(rtr_mask) | ID_STD_LOW(id_mask)) -/*! Standard ID filter element with filter range. */ -#define FLEXCAN_ENHANCED_RX_FIFO_STD_FILTER_WITH_RANGE(id_upper, rtr, id_lower, rtr_mask) \ - (ENHANCED_RX_FIFO_FSCH(0x1) | RTR_STD_HIGH(rtr) | ID_STD_HIGH(id_upper) | RTR_STD_LOW(rtr_mask) | \ - ID_STD_LOW(id_lower)) -/*! Standard ID filter element with two filters without masks. */ -#define FLEXCAN_ENHANCED_RX_FIFO_STD_TWO_FILTERS(id1, rtr1, id2, rtr2) \ - (ENHANCED_RX_FIFO_FSCH(0x2) | RTR_STD_HIGH(rtr1) | ID_STD_HIGH(id1) | RTR_STD_LOW(rtr2) | ID_STD_LOW(id2)) -/*! Extended ID filter element with filter + mask scheme low word. */ -#define FLEXCAN_ENHANCED_RX_FIFO_EXT_MASK_AND_FILTER_LOW(id, rtr) \ - (ENHANCED_RX_FIFO_FSCH(0x0) | RTR_EXT(rtr) | ID_EXT(id)) -/*! Extended ID filter element with filter + mask scheme high word. */ -#define FLEXCAN_ENHANCED_RX_FIFO_EXT_MASK_AND_FILTER_HIGH(id_mask, rtr_mask) \ - (ENHANCED_RX_FIFO_FSCH(0x0) | RTR_EXT(rtr_mask) | ID_EXT(id_mask)) -/*! Extended ID filter element with range scheme low word. */ -#define FLEXCAN_ENHANCED_RX_FIFO_EXT_FILTER_WITH_RANGE_LOW(id_upper, rtr) \ - (ENHANCED_RX_FIFO_FSCH(0x1) | RTR_EXT(rtr) | ID_EXT(id_upper)) -/*! Extended ID filter element with range scheme high word. */ -#define FLEXCAN_ENHANCED_RX_FIFO_EXT_FILTER_WITH_RANGE_HIGH(id_lower, rtr_mask) \ - (ENHANCED_RX_FIFO_FSCH(0x1) | RTR_EXT(rtr_mask) | ID_EXT(id_lower)) -/*! Extended ID filter element with two filters without masks low word. */ -#define FLEXCAN_ENHANCED_RX_FIFO_EXT_TWO_FILTERS_LOW(id2, rtr2) \ - (ENHANCED_RX_FIFO_FSCH(0x2) | RTR_EXT(rtr2) | ID_EXT(id2)) -/*! Extended ID filter element with two filters without masks high word. */ -#define FLEXCAN_ENHANCED_RX_FIFO_EXT_TWO_FILTERS_HIGH(id1, rtr1) \ - (ENHANCED_RX_FIFO_FSCH(0x2) | RTR_EXT(rtr1) | ID_EXT(id1)) -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) -/*! @brief FlexCAN Pretended Networking ID Mask helper macro. */ -#define FLEXCAN_PN_STD_MASK(id, rtr) \ - ((uint32_t)((uint32_t)(rtr) << CAN_FLT_ID1_FLT_RTR_SHIFT) | \ - FLEXCAN_ID_STD(id)) /*!< Standard Rx Message Buffer Mask helper macro. */ -#define FLEXCAN_PN_EXT_MASK(id, rtr) \ - ((uint32_t)CAN_FLT_ID1_FLT_IDE_MASK | (uint32_t)((uint32_t)(rtr) << CAN_FLT_ID1_FLT_RTR_SHIFT) | \ - FLEXCAN_ID_EXT(id)) /*!< Extend Rx Message Buffer Mask helper macro. */ -#endif - -/*! @brief FlexCAN interrupt/status flag helper macro. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) -#define FLEXCAN_PN_INT_MASK(x) (((uint64_t)(((uint64_t)(x)) << 32)) & 0x3000000000000U) -#define FLEXCAN_PN_INT_UNMASK(x) (((uint32_t)(((uint64_t)(x)) >> 32)) & 0x00030000U) -#define FLEXCAN_PN_STATUS_MASK(x) (((uint64_t)(((uint64_t)(x)) << 16)) & 0x300000000U) -#define FLEXCAN_PN_STATUS_UNMASK(x) (((uint32_t)(((uint64_t)(x)) >> 16)) & 0x00030000U) -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -#define FLEXCAN_EFIFO_INT_MASK(x) (((uint64_t)(((uint64_t)(x)) << 32)) & 0xF000000000000000U) -#define FLEXCAN_EFIFO_INT_UNMASK(x) (((uint32_t)(((uint64_t)(x)) >> 32)) & 0xF0000000U) -#define FLEXCAN_EFIFO_STATUS_MASK(x) (((uint64_t)(((uint64_t)(x)) << 32)) & 0xF003000000000000U) -#define FLEXCAN_EFIFO_STATUS_UNMASK(x) (((uint32_t)(((uint64_t)(x)) >> 32)) & 0xF0030000U) -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -#define FLEXCAN_MECR_INT_MASK(x) (((uint64_t)(((uint64_t)(x)) << 16)) & 0xD00000000U) -#define FLEXCAN_MECR_INT_UNMASK(x) (((uint32_t)(((uint64_t)(x)) >> 16)) & 0x000D0000U) -#define FLEXCAN_MECR_STATUS_MASK(x) (((uint64_t)(((uint64_t)(x)) << 34)) & 0x34003400000000U) -#define FLEXCAN_MECR_STATUS_UNMASK(x) (((uint32_t)(((uint64_t)(x)) >> 34)) & 0x000D000DU) -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -#define FLEXCAN_ERROR_AND_STATUS_INIT_FLAG \ - ((uint32_t)kFLEXCAN_ErrorOverrunFlag | (uint32_t)kFLEXCAN_FDErrorIntFlag | (uint32_t)kFLEXCAN_BusoffDoneIntFlag | \ - (uint32_t)kFLEXCAN_TxWarningIntFlag | (uint32_t)kFLEXCAN_RxWarningIntFlag | (uint32_t)kFLEXCAN_BusOffIntFlag | \ - (uint32_t)kFLEXCAN_ErrorIntFlag | FLEXCAN_MEMORY_ERROR_INIT_FLAG) -#else -#define FLEXCAN_ERROR_AND_STATUS_INIT_FLAG \ - ((uint32_t)kFLEXCAN_TxWarningIntFlag | (uint32_t)kFLEXCAN_RxWarningIntFlag | (uint32_t)kFLEXCAN_BusOffIntFlag | \ - (uint32_t)kFLEXCAN_ErrorIntFlag | FLEXCAN_MEMORY_ERROR_INIT_FLAG) -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) -#define FLEXCAN_WAKE_UP_FLAG \ - ((uint32_t)kFLEXCAN_WakeUpIntFlag | (uint64_t)kFLEXCAN_PNMatchIntFlag | (uint64_t)kFLEXCAN_PNTimeoutIntFlag) -#else -#define FLEXCAN_WAKE_UP_FLAG ((uint32_t)kFLEXCAN_WakeUpIntFlag) -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -#define FLEXCAN_MEMORY_ERROR_INIT_FLAG ((uint64_t)kFLEXCAN_AllMemoryErrorFlag) -#else -#define FLEXCAN_MEMORY_ERROR_INIT_FLAG (0U) -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -#define FLEXCAN_MEMORY_ENHANCED_RX_FIFO_INIT_FLAG \ - ((uint64_t)kFLEXCAN_ERxFifoUnderflowIntFlag | (uint64_t)kFLEXCAN_ERxFifoOverflowIntFlag | \ - (uint64_t)kFLEXCAN_ERxFifoWatermarkIntFlag | (uint64_t)kFLEXCAN_ERxFifoDataAvlIntFlag) -#endif -/*! @brief FlexCAN Enhanced Rx FIFO base address helper macro. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -#define E_RX_FIFO(base) ((uintptr_t)(base) + 0x2000U) -#else -#define FLEXCAN_MEMORY_ENHANCED_RX_FIFO_INIT_FLAG (0U) -#endif -/*! @brief FlexCAN transfer status. */ -enum -{ - kStatus_FLEXCAN_TxBusy = MAKE_STATUS(kStatusGroup_FLEXCAN, 0), /*!< Tx Message Buffer is Busy. */ - kStatus_FLEXCAN_TxIdle = MAKE_STATUS(kStatusGroup_FLEXCAN, 1), /*!< Tx Message Buffer is Idle. */ - kStatus_FLEXCAN_TxSwitchToRx = MAKE_STATUS( - kStatusGroup_FLEXCAN, 2), /*!< Remote Message is send out and Message buffer changed to Receive one. */ - kStatus_FLEXCAN_RxBusy = MAKE_STATUS(kStatusGroup_FLEXCAN, 3), /*!< Rx Message Buffer is Busy. */ - kStatus_FLEXCAN_RxIdle = MAKE_STATUS(kStatusGroup_FLEXCAN, 4), /*!< Rx Message Buffer is Idle. */ - kStatus_FLEXCAN_RxOverflow = MAKE_STATUS(kStatusGroup_FLEXCAN, 5), /*!< Rx Message Buffer is Overflowed. */ - kStatus_FLEXCAN_RxFifoBusy = MAKE_STATUS(kStatusGroup_FLEXCAN, 6), /*!< Rx Message FIFO is Busy. */ - kStatus_FLEXCAN_RxFifoIdle = MAKE_STATUS(kStatusGroup_FLEXCAN, 7), /*!< Rx Message FIFO is Idle. */ - kStatus_FLEXCAN_RxFifoOverflow = MAKE_STATUS(kStatusGroup_FLEXCAN, 8), /*!< Rx Message FIFO is overflowed. */ - kStatus_FLEXCAN_RxFifoWarning = MAKE_STATUS(kStatusGroup_FLEXCAN, 9), /*!< Rx Message FIFO is almost overflowed. */ - kStatus_FLEXCAN_RxFifoDisabled = - MAKE_STATUS(kStatusGroup_FLEXCAN, 10), /*!< Rx Message FIFO is disabled during reading. */ - kStatus_FLEXCAN_ErrorStatus = MAKE_STATUS(kStatusGroup_FLEXCAN, 11), /*!< FlexCAN Module Error and Status. */ - kStatus_FLEXCAN_WakeUp = MAKE_STATUS(kStatusGroup_FLEXCAN, 12), /*!< FlexCAN is waken up from STOP mode. */ - kStatus_FLEXCAN_UnHandled = MAKE_STATUS(kStatusGroup_FLEXCAN, 13), /*!< UnHadled Interrupt asserted. */ - kStatus_FLEXCAN_RxRemote = MAKE_STATUS(kStatusGroup_FLEXCAN, 14), /*!< Rx Remote Message Received in Mail box. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - kStatus_FLEXCAN_RxFifoUnderflow = - MAKE_STATUS(kStatusGroup_FLEXCAN, 15), /*!< Enhanced Rx Message FIFO is underflow. */ -#endif -}; - -/*! @brief FlexCAN frame format. */ -typedef enum _flexcan_frame_format -{ - kFLEXCAN_FrameFormatStandard = 0x0U, /*!< Standard frame format attribute. */ - kFLEXCAN_FrameFormatExtend = 0x1U, /*!< Extend frame format attribute. */ -} flexcan_frame_format_t; - -/*! @brief FlexCAN frame type. */ -typedef enum _flexcan_frame_type -{ - kFLEXCAN_FrameTypeData = 0x0U, /*!< Data frame type attribute. */ - kFLEXCAN_FrameTypeRemote = 0x1U, /*!< Remote frame type attribute. */ -} flexcan_frame_type_t; - -/*! @brief FlexCAN clock source. - * @deprecated Do not use the kFLEXCAN_ClkSrcOs. It has been superceded kFLEXCAN_ClkSrc0 - * @deprecated Do not use the kFLEXCAN_ClkSrcPeri. It has been superceded kFLEXCAN_ClkSrc1 - */ -typedef enum _flexcan_clock_source -{ - kFLEXCAN_ClkSrcOsc = 0x0U, /*!< FlexCAN Protocol Engine clock from Oscillator. */ - kFLEXCAN_ClkSrcPeri = 0x1U, /*!< FlexCAN Protocol Engine clock from Peripheral Clock. */ - kFLEXCAN_ClkSrc0 = 0x0U, /*!< FlexCAN Protocol Engine clock selected by user as SRC == 0. */ - kFLEXCAN_ClkSrc1 = 0x1U, /*!< FlexCAN Protocol Engine clock selected by user as SRC == 1. */ -} flexcan_clock_source_t; - -/*! @brief FlexCAN wake up source. */ -typedef enum _flexcan_wake_up_source -{ - kFLEXCAN_WakeupSrcUnfiltered = 0x0U, /*!< FlexCAN uses unfiltered Rx input to detect edge. */ - kFLEXCAN_WakeupSrcFiltered = 0x1U, /*!< FlexCAN uses filtered Rx input to detect edge. */ -} flexcan_wake_up_source_t; - -/*! @brief FlexCAN Rx Fifo Filter type. */ -typedef enum _flexcan_rx_fifo_filter_type -{ - kFLEXCAN_RxFifoFilterTypeA = 0x0U, /*!< One full ID (standard and extended) per ID Filter element. */ - kFLEXCAN_RxFifoFilterTypeB = - 0x1U, /*!< Two full standard IDs or two partial 14-bit ID slices per ID Filter Table element. */ - kFLEXCAN_RxFifoFilterTypeC = - 0x2U, /*!< Four partial 8-bit Standard or extended ID slices per ID Filter Table element. */ - kFLEXCAN_RxFifoFilterTypeD = 0x3U, /*!< All frames rejected. */ -} flexcan_rx_fifo_filter_type_t; - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * @brief FlexCAN Message Buffer Payload size. - */ -typedef enum _flexcan_mb_size -{ - kFLEXCAN_8BperMB = 0x0U, /*!< Selects 8 bytes per Message Buffer. */ - kFLEXCAN_16BperMB = 0x1U, /*!< Selects 16 bytes per Message Buffer. */ - kFLEXCAN_32BperMB = 0x2U, /*!< Selects 32 bytes per Message Buffer. */ - kFLEXCAN_64BperMB = 0x3U, /*!< Selects 64 bytes per Message Buffer. */ -} flexcan_mb_size_t; - -/*! - * @brief FlexCAN CAN FD frame supporting data length (available DLC values). - * - * For Tx, when the Data size corresponding to DLC value stored in the MB selected for transmission is larger than the - * MB Payload size, FlexCAN adds the necessary number of bytes with constant 0xCC pattern to complete the expected DLC. - * For Rx, when the Data size corresponding to DLC value received from the CAN bus is larger than the MB Payload size, - * the high order bytes that do not fit the Payload size will lose. - */ -enum _flexcan_fd_frame_length -{ - kFLEXCAN_0BperFrame = 0x0U, /*!< Frame contains 0 valid data bytes. */ - kFLEXCAN_1BperFrame, /*!< Frame contains 1 valid data bytes. */ - kFLEXCAN_2BperFrame, /*!< Frame contains 2 valid data bytes. */ - kFLEXCAN_3BperFrame, /*!< Frame contains 3 valid data bytes. */ - kFLEXCAN_4BperFrame, /*!< Frame contains 4 valid data bytes. */ - kFLEXCAN_5BperFrame, /*!< Frame contains 5 valid data bytes. */ - kFLEXCAN_6BperFrame, /*!< Frame contains 6 valid data bytes. */ - kFLEXCAN_7BperFrame, /*!< Frame contains 7 valid data bytes. */ - kFLEXCAN_8BperFrame, /*!< Frame contains 8 valid data bytes. */ - kFLEXCAN_12BperFrame, /*!< Frame contains 12 valid data bytes. */ - kFLEXCAN_16BperFrame, /*!< Frame contains 16 valid data bytes. */ - kFLEXCAN_20BperFrame, /*!< Frame contains 20 valid data bytes. */ - kFLEXCAN_24BperFrame, /*!< Frame contains 24 valid data bytes. */ - kFLEXCAN_32BperFrame, /*!< Frame contains 32 valid data bytes. */ - kFLEXCAN_48BperFrame, /*!< Frame contains 48 valid data bytes. */ - kFLEXCAN_64BperFrame, /*!< Frame contains 64 valid data bytes. */ -}; -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! @brief FlexCAN Enhanced Rx Fifo DMA transfer per read length enumerations. */ -typedef enum _flexcan_efifo_dma_per_read_length -{ - kFLEXCAN_1WordPerRead = 0x0U, /*!< Transfer 1 32-bit words (CS).*/ - kFLEXCAN_2WordPerRead, /*!< Transfer 2 32-bit words (CS + ID).*/ - kFLEXCAN_3WordPerRead, /*!< Transfer 3 32-bit words (CS + ID + 1~4 bytes data).*/ - kFLEXCAN_4WordPerRead, /*!< Transfer 4 32-bit words (CS + ID + 5~8 bytes data).*/ - kFLEXCAN_5WordPerRead, /*!< Transfer 5 32-bit words (CS + ID + 9~12 bytes data).*/ - kFLEXCAN_6WordPerRead, /*!< Transfer 6 32-bit words (CS + ID + 13~16 bytes data).*/ - kFLEXCAN_7WordPerRead, /*!< Transfer 7 32-bit words (CS + ID + 17~20 bytes data).*/ - kFLEXCAN_8WordPerRead, /*!< Transfer 8 32-bit words (CS + ID + 21~24 bytes data).*/ - kFLEXCAN_9WordPerRead, /*!< Transfer 9 32-bit words (CS + ID + 25~28 bytes data).*/ - kFLEXCAN_10WordPerRead, /*!< Transfer 10 32-bit words (CS + ID + 29~32 bytes data).*/ - kFLEXCAN_11WordPerRead, /*!< Transfer 11 32-bit words (CS + ID + 33~36 bytes data).*/ - kFLEXCAN_12WordPerRead, /*!< Transfer 12 32-bit words (CS + ID + 37~40 bytes data).*/ - kFLEXCAN_13WordPerRead, /*!< Transfer 13 32-bit words (CS + ID + 41~44 bytes data).*/ - kFLEXCAN_14WordPerRead, /*!< Transfer 14 32-bit words (CS + ID + 45~48 bytes data).*/ - kFLEXCAN_15WordPerRead, /*!< Transfer 15 32-bit words (CS + ID + 49~52 bytes data).*/ - kFLEXCAN_16WordPerRead, /*!< Transfer 16 32-bit words (CS + ID + 53~56 bytes data).*/ - kFLEXCAN_17WordPerRead, /*!< Transfer 17 32-bit words (CS + ID + 57~60 bytes data).*/ - kFLEXCAN_18WordPerRead, /*!< Transfer 18 32-bit words (CS + ID + 61~64 bytes data).*/ - kFLEXCAN_19WordPerRead /*!< Transfer 19 32-bit words (CS + ID + 64 bytes data + ID HIT).*/ -} flexcan_efifo_dma_per_read_length_t; -#endif - -/*! - * @brief FlexCAN Enhanced/Legacy Rx FIFO priority. - * - * The matching process starts from the Rx MB(or Enhanced/Legacy Rx FIFO) with higher priority. - * If no MB(or Enhanced/Legacy Rx FIFO filter) is satisfied, the matching process goes on with - * the Enhanced/Legacy Rx FIFO(or Rx MB) with lower priority. - */ -typedef enum _flexcan_rx_fifo_priority -{ - kFLEXCAN_RxFifoPrioLow = 0x0U, /*!< Matching process start from Rx Message Buffer first. */ - kFLEXCAN_RxFifoPrioHigh = 0x1U, /*!< Matching process start from Enhanced/Legacy Rx FIFO first. */ -} flexcan_rx_fifo_priority_t; - -/*! - * @brief FlexCAN interrupt enable enumerations. - * - * This provides constants for the FlexCAN interrupt enable enumerations for use in the FlexCAN functions. - * @note FlexCAN Message Buffers and Legacy Rx FIFO interrupts not included in. - */ -enum _flexcan_interrupt_enable -{ - kFLEXCAN_BusOffInterruptEnable = CAN_CTRL1_BOFFMSK_MASK, /*!< Bus Off interrupt, use bit 15. */ - kFLEXCAN_ErrorInterruptEnable = CAN_CTRL1_ERRMSK_MASK, /*!< CAN Error interrupt, use bit 14. */ - kFLEXCAN_TxWarningInterruptEnable = CAN_CTRL1_TWRNMSK_MASK, /*!< Tx Warning interrupt, use bit 11. */ - kFLEXCAN_RxWarningInterruptEnable = CAN_CTRL1_RWRNMSK_MASK, /*!< Rx Warning interrupt, use bit 10. */ - kFLEXCAN_WakeUpInterruptEnable = CAN_MCR_WAKMSK_MASK, /*!< Self Wake Up interrupt, use bit 26. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - kFLEXCAN_FDErrorInterruptEnable = CAN_CTRL2_ERRMSK_FAST_MASK, /*!< CAN FD Error interrupt, use bit 31. */ -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - /*! PN Match Wake Up interrupt, use high word bit 17. */ - kFLEXCAN_PNMatchWakeUpInterruptEnable = FLEXCAN_PN_INT_MASK(CAN_CTRL1_PN_WTOF_MSK_MASK), - /*! PN Timeout Wake Up interrupt, use high word bit 16. */ - kFLEXCAN_PNTimeoutWakeUpInterruptEnable = FLEXCAN_PN_INT_MASK(CAN_CTRL1_PN_WUMF_MSK_MASK), -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - /*!< Enhanced Rx FIFO Underflow interrupt, use high word bit 31. */ - kFLEXCAN_ERxFifoUnderflowInterruptEnable = FLEXCAN_EFIFO_INT_MASK(CAN_ERFIER_ERFUFWIE_MASK), - /*!< Enhanced Rx FIFO Overflow interrupt, use high word bit 30. */ - kFLEXCAN_ERxFifoOverflowInterruptEnable = FLEXCAN_EFIFO_INT_MASK(CAN_ERFIER_ERFOVFIE_MASK), - /*!< Enhanced Rx FIFO Watermark interrupt, use high word bit 29. */ - kFLEXCAN_ERxFifoWatermarkInterruptEnable = FLEXCAN_EFIFO_INT_MASK(CAN_ERFIER_ERFWMIIE_MASK), - /*!< Enhanced Rx FIFO Data Avilable interrupt, use high word bit 28. */ - kFLEXCAN_ERxFifoDataAvlInterruptEnable = FLEXCAN_EFIFO_INT_MASK(CAN_ERFIER_ERFDAIE_MASK), -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - /*! Host Access With Non-Correctable Errors interrupt, use high word bit 0. */ - kFLEXCAN_HostAccessNCErrorInterruptEnable = FLEXCAN_MECR_INT_MASK(CAN_MECR_HANCEI_MSK_MASK), - /*! FlexCAN Access With Non-Correctable Errors interrupt, use high word bit 2. */ - kFLEXCAN_FlexCanAccessNCErrorInterruptEnable = FLEXCAN_MECR_INT_MASK(CAN_MECR_FANCEI_MSK_MASK), - /*! Host or FlexCAN Access With Correctable Errors interrupt, use high word bit 3. */ - kFLEXCAN_HostOrFlexCanCErrorInterruptEnable = FLEXCAN_MECR_INT_MASK(CAN_MECR_CEI_MSK_MASK), -#endif -}; - -/*! - * @brief FlexCAN status flags. - * - * This provides constants for the FlexCAN status flags for use in the FlexCAN functions. - * @note The CPU read action clears the bits corresponding to the FlEXCAN_ErrorFlag macro, therefore user need to - * read status flags and distinguish which error is occur using @ref _flexcan_error_flags enumerations. - */ -enum _flexcan_flags -{ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - kFLEXCAN_ErrorOverrunFlag = CAN_ESR1_ERROVR_MASK, /*!< Error Overrun Status. */ - kFLEXCAN_FDErrorIntFlag = CAN_ESR1_ERRINT_FAST_MASK, /*!< CAN FD Error Interrupt Flag. */ - kFLEXCAN_BusoffDoneIntFlag = CAN_ESR1_BOFFDONEINT_MASK, /*!< Bus Off process completed Interrupt Flag. */ -#endif - kFLEXCAN_SynchFlag = CAN_ESR1_SYNCH_MASK, /*!< CAN Synchronization Status. */ - kFLEXCAN_TxWarningIntFlag = CAN_ESR1_TWRNINT_MASK, /*!< Tx Warning Interrupt Flag. */ - kFLEXCAN_RxWarningIntFlag = CAN_ESR1_RWRNINT_MASK, /*!< Rx Warning Interrupt Flag. */ - kFLEXCAN_IdleFlag = CAN_ESR1_IDLE_MASK, /*!< FlexCAN In IDLE Status. */ - kFLEXCAN_FaultConfinementFlag = CAN_ESR1_FLTCONF_MASK, /*!< FlexCAN Fault Confinement State. */ - kFLEXCAN_TransmittingFlag = CAN_ESR1_TX_MASK, /*!< FlexCAN In Transmission Status. */ - kFLEXCAN_ReceivingFlag = CAN_ESR1_RX_MASK, /*!< FlexCAN In Reception Status. */ - kFLEXCAN_BusOffIntFlag = CAN_ESR1_BOFFINT_MASK, /*!< Bus Off Interrupt Flag. */ - kFLEXCAN_ErrorIntFlag = CAN_ESR1_ERRINT_MASK, /*!< CAN Error Interrupt Flag. */ - kFLEXCAN_WakeUpIntFlag = CAN_ESR1_WAKINT_MASK, /*!< Self Wake-Up Interrupt Flag. */ - kFLEXCAN_ErrorFlag = - (uint32_t)(/*!< All FlexCAN Read Clear Error Status. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - CAN_ESR1_STFERR_FAST_MASK | CAN_ESR1_FRMERR_FAST_MASK | CAN_ESR1_CRCERR_FAST_MASK | - CAN_ESR1_BIT0ERR_FAST_MASK | CAN_ESR1_BIT1ERR_FAST_MASK | CAN_ESR1_ERROVR_MASK | -#endif - CAN_ESR1_TXWRN_MASK | CAN_ESR1_RXWRN_MASK | CAN_ESR1_BIT1ERR_MASK | CAN_ESR1_BIT0ERR_MASK | - CAN_ESR1_ACKERR_MASK | CAN_ESR1_CRCERR_MASK | CAN_ESR1_FRMERR_MASK | CAN_ESR1_STFERR_MASK), -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - kFLEXCAN_PNMatchIntFlag = FLEXCAN_PN_STATUS_MASK(CAN_WU_MTC_WUMF_MASK), /*!< PN Matching Event Interrupt Flag. */ - kFLEXCAN_PNTimeoutIntFlag = FLEXCAN_PN_STATUS_MASK(CAN_WU_MTC_WTOF_MASK), /*!< PN Timeout Event Interrupt Flag. */ -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - kFLEXCAN_ERxFifoUnderflowIntFlag = - FLEXCAN_EFIFO_STATUS_MASK(CAN_ERFSR_ERFUFW_MASK), /*!< Enhanced Rx FIFO underflow Interrupt Flag. */ - kFLEXCAN_ERxFifoOverflowIntFlag = - FLEXCAN_EFIFO_STATUS_MASK(CAN_ERFSR_ERFOVF_MASK), /*!< Enhanced Rx FIFO overflow Interrupt Flag. */ - kFLEXCAN_ERxFifoWatermarkIntFlag = - FLEXCAN_EFIFO_STATUS_MASK(CAN_ERFSR_ERFWMI_MASK), /*!< Enhanced Rx FIFO watermark Interrupt Flag. */ - kFLEXCAN_ERxFifoDataAvlIntFlag = - FLEXCAN_EFIFO_STATUS_MASK(CAN_ERFSR_ERFDA_MASK), /*!< Enhanced Rx FIFO data available Interrupt Flag. */ - kFLEXCAN_ERxFifoEmptyFlag = FLEXCAN_EFIFO_STATUS_MASK(CAN_ERFSR_ERFE_MASK), /*!< Enhanced Rx FIFO empty status. */ - kFLEXCAN_ERxFifoFullFlag = FLEXCAN_EFIFO_STATUS_MASK(CAN_ERFSR_ERFF_MASK), /*!< Enhanced Rx FIFO full status. */ -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - /*! Host Access With Non-Correctable Error Interrupt Flag. */ - kFLEXCAN_HostAccessNonCorrectableErrorIntFlag = FLEXCAN_MECR_INT_MASK(CAN_ERRSR_HANCEIF_MASK), - /*! FlexCAN Access With Non-Correctable Error Interrupt Flag. */ - kFLEXCAN_FlexCanAccessNonCorrectableErrorIntFlag = FLEXCAN_MECR_INT_MASK(CAN_ERRSR_FANCEIF_MASK), - /*! Correctable Error Interrupt Flag. */ - kFLEXCAN_CorrectableErrorIntFlag = FLEXCAN_MECR_INT_MASK(CAN_ERRSR_CEIF_MASK), - /*! Host Access With Non-Correctable Error Interrupt Overrun Flag. */ - kFLEXCAN_HostAccessNonCorrectableErrorOverrunFlag = FLEXCAN_MECR_INT_MASK(CAN_ERRSR_HANCEIOF_MASK), - /*! FlexCAN Access With Non-Correctable Error Interrupt Overrun Flag. */ - kFLEXCAN_FlexCanAccessNonCorrectableErrorOverrunFlag = FLEXCAN_MECR_INT_MASK(CAN_ERRSR_FANCEIOF_MASK), - /*! Correctable Error Interrupt Overrun Flag. */ - kFLEXCAN_CorrectableErrorOverrunFlag = FLEXCAN_MECR_INT_MASK(CAN_ERRSR_CEIOF_MASK), - /*! All Memory Error Flags. */ - kFLEXCAN_AllMemoryErrorFlag = - (kFLEXCAN_HostAccessNonCorrectableErrorIntFlag | kFLEXCAN_FlexCanAccessNonCorrectableErrorIntFlag | - kFLEXCAN_CorrectableErrorIntFlag | kFLEXCAN_HostAccessNonCorrectableErrorOverrunFlag | - kFLEXCAN_FlexCanAccessNonCorrectableErrorOverrunFlag | kFLEXCAN_CorrectableErrorOverrunFlag) -#endif -}; - -/*! - * @brief FlexCAN error status flags. - * - * The FlexCAN Error Status enumerations is used to report current error of the FlexCAN bus. - * This enumerations should be used with KFLEXCAN_ErrorFlag in @ref _flexcan_flags enumerations - * to ditermine which error is generated. - */ -enum _flexcan_error_flags -{ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - kFLEXCAN_FDStuffingError = CAN_ESR1_STFERR_FAST_MASK, /*!< Stuffing Error. */ - kFLEXCAN_FDFormError = CAN_ESR1_FRMERR_FAST_MASK, /*!< Form Error. */ - kFLEXCAN_FDCrcError = CAN_ESR1_CRCERR_FAST_MASK, /*!< Cyclic Redundancy Check Error. */ - kFLEXCAN_FDBit0Error = CAN_ESR1_BIT0ERR_FAST_MASK, /*!< Unable to send dominant bit. */ - kFLEXCAN_FDBit1Error = (int)CAN_ESR1_BIT1ERR_FAST_MASK, /*!< Unable to send recessive bit. */ -#endif - kFLEXCAN_TxErrorWarningFlag = CAN_ESR1_TXWRN_MASK, /*!< Tx Error Warning Status. */ - kFLEXCAN_RxErrorWarningFlag = CAN_ESR1_RXWRN_MASK, /*!< Rx Error Warning Status. */ - kFLEXCAN_StuffingError = CAN_ESR1_STFERR_MASK, /*!< Stuffing Error. */ - kFLEXCAN_FormError = CAN_ESR1_FRMERR_MASK, /*!< Form Error. */ - kFLEXCAN_CrcError = CAN_ESR1_CRCERR_MASK, /*!< Cyclic Redundancy Check Error. */ - kFLEXCAN_AckError = CAN_ESR1_ACKERR_MASK, /*!< Received no ACK on transmission. */ - kFLEXCAN_Bit0Error = CAN_ESR1_BIT0ERR_MASK, /*!< Unable to send dominant bit. */ - kFLEXCAN_Bit1Error = CAN_ESR1_BIT1ERR_MASK, /*!< Unable to send recessive bit. */ -}; - -/*! - * @brief FlexCAN Legacy Rx FIFO status flags. - * - * The FlexCAN Legacy Rx FIFO Status enumerations are used to determine the status of the - * Rx FIFO. Because Rx FIFO occupy the MB0 ~ MB7 (Rx Fifo filter also occupies - * more Message Buffer space), Rx FIFO status flags are mapped to the corresponding - * Message Buffer status flags. - */ -enum -{ - kFLEXCAN_RxFifoOverflowFlag = CAN_IFLAG1_BUF7I_MASK, /*!< Rx FIFO overflow flag. */ - kFLEXCAN_RxFifoWarningFlag = CAN_IFLAG1_BUF6I_MASK, /*!< Rx FIFO almost full flag. */ - kFLEXCAN_RxFifoFrameAvlFlag = CAN_IFLAG1_BUF5I_MASK, /*!< Frames available in Rx FIFO flag. */ -}; - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -/*! - * @brief FlexCAN Memory Error Type. - */ -typedef enum _flexcan_memory_error_type -{ - kFLEXCAN_CorrectableError = 0U, /*!< The memory error is correctable which means on bit error. */ - kFLEXCAN_NonCorrectableError /*!< The memory error is non-correctable which means two bit errors. */ -} flexcan_memory_error_type_t; - -/*! - * @brief FlexCAN Memory Access Type. - */ -typedef enum _flexcan_memory_access_type -{ - kFLEXCAN_MoveOutFlexCanAccess = 0U, /*!< The memory error was detected during move-out FlexCAN access. */ - kFLEXCAN_MoveInAccess, /*!< The memory error was detected during move-in FlexCAN access. */ - kFLEXCAN_TxArbitrationAccess, /*!< The memory error was detected during Tx Arbitration FlexCAN access. */ - kFLEXCAN_RxMatchingAccess, /*!< The memory error was detected during Rx Matching FlexCAN access. */ - kFLEXCAN_MoveOutHostAccess /*!< The memory error was detected during Rx Matching Host (CPU) access. */ -} flexcan_memory_access_type_t; - -/*! - * @brief FlexCAN Memory Error Byte Syndrome. - */ -typedef enum _flexcan_byte_error_syndrome -{ - kFLEXCAN_NoError = 0U, /*!< No bit error in this byte. */ - kFLEXCAN_ParityBits0Error = 1U, /*!< Parity bit 0 error in this byte. */ - kFLEXCAN_ParityBits1Error = 2U, /*!< Parity bit 1 error in this byte. */ - kFLEXCAN_ParityBits2Error = 4U, /*!< Parity bit 2 error in this byte. */ - kFLEXCAN_ParityBits3Error = 8U, /*!< Parity bit 3 error in this byte. */ - kFLEXCAN_ParityBits4Error = 16U, /*!< Parity bit 4 error in this byte. */ - kFLEXCAN_DataBits0Error = 28U, /*!< Data bit 0 error in this byte. */ - kFLEXCAN_DataBits1Error = 22U, /*!< Data bit 1 error in this byte. */ - kFLEXCAN_DataBits2Error = 19U, /*!< Data bit 2 error in this byte. */ - kFLEXCAN_DataBits3Error = 25U, /*!< Data bit 3 error in this byte. */ - kFLEXCAN_DataBits4Error = 26U, /*!< Data bit 4 error in this byte. */ - kFLEXCAN_DataBits5Error = 7U, /*!< Data bit 5 error in this byte. */ - kFLEXCAN_DataBits6Error = 21U, /*!< Data bit 6 error in this byte. */ - kFLEXCAN_DataBits7Error = 14U, /*!< Data bit 7 error in this byte. */ - kFLEXCAN_AllZeroError = 6U, /*!< All-zeros non-correctable error in this byte. */ - kFLEXCAN_AllOneError = 31U, /*!< All-ones non-correctable error in this byte. */ - kFLEXCAN_NonCorrectableErrors /*!< Non-correctable error in this byte. */ -} flexcan_byte_error_syndrome_t; - -/*! - * @brief FlexCAN memory error register status structure - * - * This structure contains the memory access properties that caused a memory error access. - * It is used as the parameter of FLEXCAN_GetMemoryErrorReportStatus() function. And user can - * use FLEXCAN_GetMemoryErrorReportStatus to get the status of the last memory error access. - */ -typedef struct _flexcan_memory_error_report_status -{ - flexcan_memory_error_type_t errorType; /*!< The type of memory error that giving rise to the report. */ - flexcan_memory_access_type_t accessType; /*!< The type of memory access that giving rise to the memory error. */ - uint16_t accessAddress; /*!< The address where memory error detected. */ - uint32_t errorData; /*!< The raw data word read from memory with error. */ - struct - { - bool byteIsRead; /*!< The byte n (0~3) was read or not. */ - /*!< The type of error and which bit in byte (n) is affected by the error. */ - flexcan_byte_error_syndrome_t bitAffected; - } byteStatus[4]; -} flexcan_memory_error_report_status_t; -#endif - -#if defined(__CC_ARM) -#pragma anon_unions -#endif -/*! @brief FlexCAN message frame structure. */ -typedef struct _flexcan_frame -{ - struct - { - uint32_t timestamp : 16; /*!< FlexCAN internal Free-Running Counter Time Stamp. */ - uint32_t length : 4; /*!< CAN frame data length in bytes (Range: 0~8). */ - uint32_t type : 1; /*!< CAN Frame Type(DATA or REMOTE). */ - uint32_t format : 1; /*!< CAN Frame Identifier(STD or EXT format). */ - uint32_t : 1; /*!< Reserved. */ - uint32_t idhit : 9; /*!< CAN Rx FIFO filter hit id(This value is only used in Rx FIFO receive mode). */ - }; - struct - { - uint32_t id : 29; /*!< CAN Frame Identifier, should be set using FLEXCAN_ID_EXT() or FLEXCAN_ID_STD() macro. */ - uint32_t : 3; /*!< Reserved. */ - }; - union - { - struct - { - uint32_t dataWord0; /*!< CAN Frame payload word0. */ - uint32_t dataWord1; /*!< CAN Frame payload word1. */ - }; - struct - { - uint8_t dataByte3; /*!< CAN Frame payload byte3. */ - uint8_t dataByte2; /*!< CAN Frame payload byte2. */ - uint8_t dataByte1; /*!< CAN Frame payload byte1. */ - uint8_t dataByte0; /*!< CAN Frame payload byte0. */ - uint8_t dataByte7; /*!< CAN Frame payload byte7. */ - uint8_t dataByte6; /*!< CAN Frame payload byte6. */ - uint8_t dataByte5; /*!< CAN Frame payload byte5. */ - uint8_t dataByte4; /*!< CAN Frame payload byte4. */ - }; - }; -} flexcan_frame_t; - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! @brief CAN FD message frame structure. - * - * The CAN FD message supporting up to sixty four bytes can be used for a data frame, depending on the length - * selected for the message buffers. The length should be a enumeration member, see @ref _flexcan_fd_frame_length. - */ -typedef struct _flexcan_fd_frame -{ - struct - { - uint32_t timestamp : 16; /*!< FlexCAN internal Free-Running Counter Time Stamp. */ - uint32_t length : 4; /*!< CAN FD frame data length code (DLC), range see @ref _flexcan_fd_frame_length, When the - length <= 8, it equal to the data length, otherwise the number of valid frame data is - not equal to the length value. user can - use DLC_LENGTH_DECODE(length) macro to get the number of valid data bytes. */ - uint32_t type : 1; /*!< CAN Frame Type(DATA or REMOTE). */ - uint32_t format : 1; /*!< CAN Frame Identifier(STD or EXT format). */ - uint32_t srr : 1; /*!< Substitute Remote request. */ - uint32_t : 6; - uint32_t esi : 1; /*!< Error State Indicator. */ - uint32_t brs : 1; /*!< Bit Rate Switch. */ - uint32_t edl : 1; /*!< Extended Data Length. */ - }; - struct - { - uint32_t id : 29; /*!< CAN Frame Identifier, should be set using FLEXCAN_ID_EXT() or FLEXCAN_ID_STD() macro. */ - uint32_t : 3; /*!< Reserved. */ - }; - union - { - struct - { - uint32_t dataWord[16]; /*!< CAN FD Frame payload, 16 double word maximum. */ - }; - /* Note: the maximum databyte* below is actually 64, user can add them if needed, - or just use dataWord[*] instead. */ - struct - { - uint8_t dataByte3; /*!< CAN Frame payload byte3. */ - uint8_t dataByte2; /*!< CAN Frame payload byte2. */ - uint8_t dataByte1; /*!< CAN Frame payload byte1. */ - uint8_t dataByte0; /*!< CAN Frame payload byte0. */ - uint8_t dataByte7; /*!< CAN Frame payload byte7. */ - uint8_t dataByte6; /*!< CAN Frame payload byte6. */ - uint8_t dataByte5; /*!< CAN Frame payload byte5. */ - uint8_t dataByte4; /*!< CAN Frame payload byte4. */ - }; - }; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - /*! @note ID HIT offset is changed dynamically according to data length code (DLC), when DLC is 15, they will be - * located below. Using FLEXCAN_FixEnhancedRxFifoFrameIdHit API is recommended to ensure this idhit value is - * correct.*/ - uint32_t idhit; /*!< CAN Enhanced Rx FIFO filter hit id (This value is only used in Enhanced Rx FIFO receive - mode). */ -#endif -} flexcan_fd_frame_t; -#endif - -/*! @brief FlexCAN protocol timing characteristic configuration structure. */ -typedef struct _flexcan_timing_config -{ - uint16_t preDivider; /*!< Classic CAN or CAN FD nominal phase bit rate prescaler. */ - uint8_t rJumpwidth; /*!< Classic CAN or CAN FD nominal phase Re-sync Jump Width. */ - uint8_t phaseSeg1; /*!< Classic CAN or CAN FD nominal phase Segment 1. */ - uint8_t phaseSeg2; /*!< Classic CAN or CAN FD nominal phase Segment 2. */ - uint8_t propSeg; /*!< Classic CAN or CAN FD nominal phase Propagation Segment. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - uint16_t fpreDivider; /*!< CAN FD data phase bit rate prescaler. */ - uint8_t frJumpwidth; /*!< CAN FD data phase Re-sync Jump Width. */ - uint8_t fphaseSeg1; /*!< CAN FD data phase Phase Segment 1. */ - uint8_t fphaseSeg2; /*!< CAN FD data phase Phase Segment 2. */ - uint8_t fpropSeg; /*!< CAN FD data phase Propagation Segment. */ -#endif -} flexcan_timing_config_t; - -/*! @brief FlexCAN module configuration structure. - * @deprecated Do not use the baudRate. It has been superceded bitRate - * @deprecated Do not use the baudRateFD. It has been superceded bitRateFD - */ -typedef struct _flexcan_config -{ - union - { - struct - { - uint32_t baudRate; /*!< FlexCAN bit rate in bps, for classical CAN or CANFD nominal phase. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - uint32_t baudRateFD; /*!< FlexCAN FD bit rate in bps, for CANFD data phase. */ -#endif - }; - struct - { - uint32_t bitRate; /*!< FlexCAN bit rate in bps, for classical CAN or CANFD nominal phase. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - uint32_t bitRateFD; /*!< FlexCAN FD bit rate in bps, for CANFD data phase. */ -#endif - }; - }; - flexcan_clock_source_t clkSrc; /*!< Clock source for FlexCAN Protocol Engine. */ - flexcan_wake_up_source_t wakeupSrc; /*!< Wake up source selection. */ - uint8_t maxMbNum; /*!< The maximum number of Message Buffers used by user. */ - bool enableLoopBack; /*!< Enable or Disable Loop Back Self Test Mode. */ - bool enableTimerSync; /*!< Enable or Disable Timer Synchronization. */ - bool enableSelfWakeup; /*!< Enable or Disable Self Wakeup Mode. */ - bool enableIndividMask; /*!< Enable or Disable Rx Individual Mask and Queue feature. */ - bool disableSelfReception; /*!< Enable or Disable Self Reflection. */ - bool enableListenOnlyMode; /*!< Enable or Disable Listen Only Mode. */ -#if !(defined(FSL_FEATURE_FLEXCAN_HAS_NO_SUPV_SUPPORT) && FSL_FEATURE_FLEXCAN_HAS_NO_SUPV_SUPPORT) - bool enableSupervisorMode; /*!< Enable or Disable Supervisor Mode, enable this mode will make registers allow only - Supervisor access. */ -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_DOZE_MODE_SUPPORT) && FSL_FEATURE_FLEXCAN_HAS_DOZE_MODE_SUPPORT) - bool enableDoze; /*!< Enable or Disable Doze Mode. */ -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - bool enablePretendedeNetworking; /*!< Enable or Disable the Pretended Networking mode. */ -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - bool enableMemoryErrorControl; /*!< Enable or Disable the memory errors detection and correction mechanism. */ - bool enableNonCorrectableErrorEnterFreeze; /*!< Enable or Disable Non-Correctable Errors In FlexCAN Access Put - Device In Freeze Mode. */ -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG) - bool enableTransceiverDelayMeasure; /*!< Enable or Disable the transceiver delay measurement, when it is enabled, - then the secondary sample point position is determined by the sum of the - transceiver delay measurement plus the enhanced TDC offset. */ -#endif - flexcan_timing_config_t timingConfig; /* Protocol timing . */ -} flexcan_config_t; - -/*! - * @brief FlexCAN Receive Message Buffer configuration structure - * - * This structure is used as the parameter of FLEXCAN_SetRxMbConfig() function. - * The FLEXCAN_SetRxMbConfig() function is used to configure FlexCAN Receive - * Message Buffer. The function abort previous receiving process, clean the - * Message Buffer and activate the Rx Message Buffer using given Message Buffer - * setting. - */ -typedef struct _flexcan_rx_mb_config -{ - uint32_t id; /*!< CAN Message Buffer Frame Identifier, should be set using - FLEXCAN_ID_EXT() or FLEXCAN_ID_STD() macro. */ - flexcan_frame_format_t format; /*!< CAN Frame Identifier format(Standard of Extend). */ - flexcan_frame_type_t type; /*!< CAN Frame Type(Data or Remote). */ -} flexcan_rx_mb_config_t; - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) -/*! @brief FlexCAN Pretended Networking match source selection. */ -typedef enum _flexcan_pn_match_source -{ - kFLEXCAN_PNMatSrcID = 0U, /*!< Message match with ID filtering. */ - kFLEXCAN_PNMatSrcIDAndData, /*!< Message match with ID filtering and payload filtering. */ -} flexcan_pn_match_source_t; - -/*! @brief FlexCAN Pretended Networking mode match type. */ -typedef enum _flexcan_pn_match_mode -{ - kFLEXCAN_PNMatModeEqual = 0x0U, /*!< Match upon ID/Payload contents against an exact target value. */ - kFLEXCAN_PNMatModeGreater, /*!< Match upon an ID/Payload value greater than or equal to a specified target value. - */ - kFLEXCAN_PNMatModeSmaller, /*!< Match upon an ID/Payload value smaller than or equal to a specified target value. - */ - kFLEXCAN_PNMatModeRange, /*!< Match upon an ID/Payload value inside a range, greater than or equal to a specified - lower limit, and smaller than or equal to a specified upper limit */ -} flexcan_pn_match_mode_t; - -/*! - * @brief FlexCAN Pretended Networking configuration structure - * - * This structure is used as the parameter of FLEXCAN_SetPNConfig() function. - * The FLEXCAN_SetPNConfig() function is used to configure FlexCAN Networking work mode. - */ -typedef struct _flexcan_pn_config -{ - bool enableTimeout; /*!< Enable or Disable timeout event trigger wakeup.*/ - uint16_t timeoutValue; /*!< The timeout value that generates a wakeup event, the counter timer is incremented based - on 64 times the CAN Bit Time unit. */ - bool enableMatch; /*!< Enable or Disable match event trigger wakeup.*/ - flexcan_pn_match_source_t matchSrc; /*!< Selects the match source (ID and/or data match) to trigger wakeup. */ - uint8_t matchNum; /*!< The number of times a given message must match the predefined ID and/or data before - generating a wakeup event, range in 0x1 ~ 0xFF. */ - flexcan_pn_match_mode_t idMatchMode; /*!< The ID match type. */ - flexcan_pn_match_mode_t dataMatchMode; /*!< The data match type. */ - uint32_t idLower; /*!< The ID target values 1 which used either for ID match "equal to", "smaller than", - "greater than" comparisons, or as the lower limit value in ID match "range detection". */ - uint32_t idUpper; /*!< The ID target values 2 which used only as the upper limit value in ID match "range - detection" or used to store the ID mask in "equal to". */ - uint8_t lengthLower; /*!< The lower limit for length of data bytes which used only in data match "range - detection". Range in 0x0 ~ 0x8.*/ - uint8_t lengthUpper; /*!< The upper limit for length of data bytes which used only in data match "range - detection". Range in 0x0 ~ 0x8.*/ - union - { - /*!< The data target values 1 which used either for data match "equal to", "smaller than", - "greater than" comparisons, or as the lower limit value in data match "range - detection". */ - struct - { - uint32_t lowerWord0; /*!< CAN Frame payload word0. */ - uint32_t lowerWord1; /*!< CAN Frame payload word1. */ - }; - struct - { - uint8_t lowerByte3; /*!< CAN Frame payload byte3. */ - uint8_t lowerByte2; /*!< CAN Frame payload byte2. */ - uint8_t lowerByte1; /*!< CAN Frame payload byte1. */ - uint8_t lowerByte0; /*!< CAN Frame payload byte0. */ - uint8_t lowerByte7; /*!< CAN Frame payload byte7. */ - uint8_t lowerByte6; /*!< CAN Frame payload byte6. */ - uint8_t lowerByte5; /*!< CAN Frame payload byte5. */ - uint8_t lowerByte4; /*!< CAN Frame payload byte4. */ - }; - }; - union - { - /*!< The data target values 2 which used only as the upper limit value in data match "range - detection" or used to store the data mask in "equal to". */ - struct - { - uint32_t upperWord0; /*!< CAN Frame payload word0. */ - uint32_t upperWord1; /*!< CAN Frame payload word1. */ - }; - struct - { - uint8_t upperByte3; /*!< CAN Frame payload byte3. */ - uint8_t upperByte2; /*!< CAN Frame payload byte2. */ - uint8_t upperByte1; /*!< CAN Frame payload byte1. */ - uint8_t upperByte0; /*!< CAN Frame payload byte0. */ - uint8_t upperByte7; /*!< CAN Frame payload byte7. */ - uint8_t upperByte6; /*!< CAN Frame payload byte6. */ - uint8_t upperByte5; /*!< CAN Frame payload byte5. */ - uint8_t upperByte4; /*!< CAN Frame payload byte4. */ - }; - }; -} flexcan_pn_config_t; -#endif - -/*! @brief FlexCAN Legacy Rx FIFO configuration structure. */ -typedef struct _flexcan_rx_fifo_config -{ - uint32_t *idFilterTable; /*!< Pointer to the FlexCAN Legacy Rx FIFO identifier filter table. */ - uint8_t idFilterNum; /*!< The FlexCAN Legacy Rx FIFO Filter elements quantity. */ - flexcan_rx_fifo_filter_type_t idFilterType; /*!< The FlexCAN Legacy Rx FIFO Filter type. */ - flexcan_rx_fifo_priority_t priority; /*!< The FlexCAN Legacy Rx FIFO receive priority. */ -} flexcan_rx_fifo_config_t; - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! @brief FlexCAN Enhanced Rx FIFO Standard ID filter element structure. */ -typedef struct _flexcan_enhanced_rx_fifo_std_id_filter -{ - uint32_t filterType : 2; /*!< FlexCAN internal Free-Running Counter Time Stamp. */ - uint32_t : 2; - uint32_t rtr1 : 1; /*!< CAN FD frame data length code (DLC), range see @ref _flexcan_fd_frame_length, When the - length <= 8, it equal to the data length, otherwise the number of valid frame data is - not equal to the length value. user can - use DLC_LENGTH_DECODE(length) macro to get the number of valid data bytes. */ - uint32_t std1 : 11; /*!< CAN Frame Type(DATA or REMOTE). */ - uint32_t : 4; - uint32_t rtr2 : 1; /*!< CAN Frame Identifier(STD or EXT format). */ - uint32_t std2 : 11; /*!< Substitute Remote request. */ -} flexcan_enhanced_rx_fifo_std_id_filter_t; - -/*! @brief FlexCAN Enhanced Rx FIFO Extended ID filter element structure. */ -typedef struct _flexcan_enhanced_rx_fifo_ext_id_filter -{ - uint32_t filterType : 2; /*!< FlexCAN internal Free-Running Counter Time Stamp. */ - uint32_t rtr1 : 1; /*!< CAN FD frame data length code (DLC), range see @ref _flexcan_fd_frame_length, When the - length <= 8, it equal to the data length, otherwise the number of valid frame data is - not equal to the length value. user can - use DLC_LENGTH_DECODE(length) macro to get the number of valid data bytes. */ - uint32_t std1 : 29; /*!< CAN Frame Type(DATA or REMOTE). */ - uint32_t : 2; - uint32_t rtr2 : 1; /*!< CAN Frame Identifier(STD or EXT format). */ - uint32_t std2 : 29; /*!< Substitute Remote request. */ -} flexcan_enhanced_rx_fifo_ext_id_filter_t; -/*! @brief FlexCAN Enhanced Rx FIFO configuration structure. */ -typedef struct _flexcan_enhanced_rx_fifo_config -{ - uint32_t *idFilterTable; /*!< Pointer to the FlexCAN Enhanced Rx FIFO identifier filter table, each table member - occupies 32 bit word, table size should be equal to idFilterNum. There are two types of - Enhanced Rx FIFO filter elements that can be stored in table : extended-ID filter element - (1 word, occupie 1 table members) and standard-ID filter element (2 words, occupies 2 table - members), the extended-ID filter element needs to be placed in front of the table. */ - uint8_t idFilterPairNum; /*!< idFilterPairNum is the Enhanced Rx FIFO identifier filter element pair numbers, - each pair of filter elements occupies 2 words and can consist of one extended ID filter - element or two standard ID filter elements. */ - uint8_t extendIdFilterNum; /*!< The number of extended ID filter element items in the FlexCAN enhanced Rx FIFO - identifier filter table, each extended-ID filter element occupies 2 words, - extendIdFilterNum need less than or equal to idFilterPairNum. */ - uint8_t fifoWatermark; /*!< (fifoWatermark + 1) is the minimum number of CAN messages stored in the Enhanced RX FIFO - which can trigger FIFO watermark interrupt or a DMA request. */ - flexcan_efifo_dma_per_read_length_t dmaPerReadLength; /*!< Define the length of each read of the Enhanced RX FIFO - element by the DAM, see @ref _flexcan_fd_frame_length. */ - flexcan_rx_fifo_priority_t priority; /*!< The FlexCAN Enhanced Rx FIFO receive priority. */ -} flexcan_enhanced_rx_fifo_config_t; -#endif - -/*! @brief FlexCAN Message Buffer transfer. */ -typedef struct _flexcan_mb_transfer -{ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - flexcan_fd_frame_t *framefd; -#endif - flexcan_frame_t *frame; /*!< The buffer of CAN Message to be transfer. */ - uint8_t mbIdx; /*!< The index of Message buffer used to transfer Message. */ -} flexcan_mb_transfer_t; - -/*! @brief FlexCAN Rx FIFO transfer. */ -typedef struct _flexcan_fifo_transfer -{ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - flexcan_fd_frame_t *framefd; /*!< The buffer of CAN Message to be received from Enhanced Rx FIFO. */ -#endif - flexcan_frame_t *frame; /*!< The buffer of CAN Message to be received from Legacy Rx FIFO. */ - size_t frameNum; /*!< Number of CAN Message need to be received from Legacy or Ehanced Rx FIFO. */ -} flexcan_fifo_transfer_t; - -/*! @brief FlexCAN handle structure definition. */ -typedef struct _flexcan_handle flexcan_handle_t; - -/*! @brief FlexCAN transfer callback function. - * - * The FlexCAN transfer callback returns a value from the underlying layer. - * If the status equals to kStatus_FLEXCAN_ErrorStatus, the result parameter is the Content of - * FlexCAN status register which can be used to get the working status(or error status) of FlexCAN module. - * If the status equals to other FlexCAN Message Buffer transfer status, the result is the index of - * Message Buffer that generate transfer event. - * If the status equals to other FlexCAN Message Buffer transfer status, the result is meaningless and should be - * Ignored. - */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -#define FLEXCAN_CALLBACK(x) \ - void(x)(CAN_Type * base, flexcan_handle_t * handle, status_t status, uint64_t result, void *userData) -typedef void (*flexcan_transfer_callback_t)( - CAN_Type *base, flexcan_handle_t *handle, status_t status, uint64_t result, void *userData); -#else -#define FLEXCAN_CALLBACK(x) \ - void(x)(CAN_Type * base, flexcan_handle_t * handle, status_t status, uint32_t result, void *userData) -typedef void (*flexcan_transfer_callback_t)( - CAN_Type *base, flexcan_handle_t *handle, status_t status, uint32_t result, void *userData); -#endif - -/*! @brief FlexCAN handle structure. */ -struct _flexcan_handle -{ - flexcan_transfer_callback_t callback; /*!< Callback function. */ - void *userData; /*!< FlexCAN callback function parameter.*/ - flexcan_frame_t - *volatile mbFrameBuf[CAN_WORD1_COUNT]; /*!< The buffer for received CAN data from Message Buffers. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - flexcan_fd_frame_t - *volatile mbFDFrameBuf[CAN_WORD1_COUNT]; /*!< The buffer for received CAN FD data from Message Buffers. */ -#endif - flexcan_frame_t *volatile rxFifoFrameBuf; /*!< The buffer for received CAN data from Legacy Rx FIFO. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - flexcan_fd_frame_t *volatile rxFifoFDFrameBuf; /*!< The buffer for received CAN FD data from Ehanced Rx FIFO. */ -#endif - size_t rxFifoFrameNum; /*!< The number of CAN messages remaining to be received from Legacy or Ehanced Rx FIFO. */ - size_t rxFifoTransferTotalNum; /*!< Total CAN Message number need to be received from Legacy or Ehanced Rx FIFO. */ - volatile uint8_t mbState[CAN_WORD1_COUNT]; /*!< Message Buffer transfer state. */ - volatile uint8_t rxFifoState; /*!< Rx FIFO transfer state. */ - volatile uint32_t timestamp[CAN_WORD1_COUNT]; /*!< Mailbox transfer timestamp. */ -}; - -/****************************************************************************** - * API - *****************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * @brief Determine whether the FlexCAN instance support CAN FD mode at run time. - * - * @note Use this API only if different soc parts share the SOC part name macro define. Otherwise, a different SOC part - * name can be used to determine at compile time whether the FlexCAN instance supports CAN FD mode or not. - * If need use this API to determine if CAN FD mode is supported, the FLEXCAN_Init function needs to be - * executed first, and then call this API and use the return to value determines whether to supports CAN FD mode, - * if return true, continue calling FLEXCAN_FDInit to enable CAN FD mode. - * - * @param base FlexCAN peripheral base address. - * @return return TRUE if instance support CAN FD mode, FALSE if instance only support classic CAN (2.0) mode. - */ -bool FLEXCAN_IsInstanceHasFDMode(CAN_Type *base); -#endif - -/*! - * @brief Enter FlexCAN Freeze Mode. - * - * This function makes the FlexCAN work under Freeze Mode. - * - * @param base FlexCAN peripheral base address. - */ -void FLEXCAN_EnterFreezeMode(CAN_Type *base); - -/*! - * @brief Exit FlexCAN Freeze Mode. - * - * This function makes the FlexCAN leave Freeze Mode. - * - * @param base FlexCAN peripheral base address. - */ -void FLEXCAN_ExitFreezeMode(CAN_Type *base); - -/*! - * @brief Get the FlexCAN instance from peripheral base address. - * - * @param base FlexCAN peripheral base address. - * @return FlexCAN instance. - */ -uint32_t FLEXCAN_GetInstance(CAN_Type *base); - -/*! - * @brief Calculates the improved timing values by specific bit Rates for classical CAN. - * - * This function use to calculates the Classical CAN timing values according to the given bit rate. The Calculated - * timing values will be set in CTRL1/CBT/ENCBT register. The calculation is based on the recommendation of the CiA 301 - * v4.2.0 and previous version document. - * - * @param base FlexCAN peripheral base address. - * @param bitRate The classical CAN speed in bps defined by user, should be less than or equal to 1Mbps. - * @param sourceClock_Hz The Source clock frequency in Hz. - * @param pTimingConfig Pointer to the FlexCAN timing configuration structure. - * - * @return TRUE if timing configuration found, FALSE if failed to find configuration. - */ -bool FLEXCAN_CalculateImprovedTimingValues(CAN_Type *base, - uint32_t bitRate, - uint32_t sourceClock_Hz, - flexcan_timing_config_t *pTimingConfig); - -/*! - * @brief Initializes a FlexCAN instance. - * - * This function initializes the FlexCAN module with user-defined settings. - * This example shows how to set up the flexcan_config_t parameters and how - * to call the FLEXCAN_Init function by passing in these parameters. - * @code - * flexcan_config_t flexcanConfig; - * flexcanConfig.clkSrc = kFLEXCAN_ClkSrc0; - * flexcanConfig.bitRate = 1000000U; - * flexcanConfig.maxMbNum = 16; - * flexcanConfig.enableLoopBack = false; - * flexcanConfig.enableSelfWakeup = false; - * flexcanConfig.enableIndividMask = false; - * flexcanConfig.enableDoze = false; - * flexcanConfig.disableSelfReception = false; - * flexcanConfig.enableListenOnlyMode = false; - * flexcanConfig.timingConfig = timingConfig; - * FLEXCAN_Init(CAN0, &flexcanConfig, 40000000UL); - * @endcode - * - * @param base FlexCAN peripheral base address. - * @param pConfig Pointer to the user-defined configuration structure. - * @param sourceClock_Hz FlexCAN Protocol Engine clock source frequency in Hz. - */ -void FLEXCAN_Init(CAN_Type *base, const flexcan_config_t *pConfig, uint32_t sourceClock_Hz); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * @brief Calculates the improved timing values by specific bit rates for CANFD. - * - * This function use to calculates the CANFD timing values according to the given nominal phase bit rate and data phase - * bit rate. The Calculated timing values will be set in CBT/ENCBT and FDCBT/EDCBT registers. The calculation is based - * on the recommendation of the CiA 1301 v1.0.0 document. - * - * @param base FlexCAN peripheral base address. - * @param bitRate The CANFD bus control speed in bps defined by user. - * @param bitRateFD The CAN FD data phase speed in bps defined by user. Equal to bitRate means disable bit rate - * switching. - * @param sourceClock_Hz The Source clock frequency in Hz. - * @param pTimingConfig Pointer to the FlexCAN timing configuration structure. - * - * @return TRUE if timing configuration found, FALSE if failed to find configuration - */ -bool FLEXCAN_FDCalculateImprovedTimingValues(CAN_Type *base, - uint32_t bitRate, - uint32_t bitRateFD, - uint32_t sourceClock_Hz, - flexcan_timing_config_t *pTimingConfig); -/*! - * @brief Initializes a FlexCAN instance. - * - * This function initializes the FlexCAN module with user-defined settings. - * This example shows how to set up the flexcan_config_t parameters and how - * to call the FLEXCAN_FDInit function by passing in these parameters. - * @code - * flexcan_config_t flexcanConfig; - * flexcanConfig.clkSrc = kFLEXCAN_ClkSrc0; - * flexcanConfig.bitRate = 1000000U; - * flexcanConfig.bitRateFD = 2000000U; - * flexcanConfig.maxMbNum = 16; - * flexcanConfig.enableLoopBack = false; - * flexcanConfig.enableSelfWakeup = false; - * flexcanConfig.enableIndividMask = false; - * flexcanConfig.disableSelfReception = false; - * flexcanConfig.enableListenOnlyMode = false; - * flexcanConfig.enableDoze = false; - * flexcanConfig.timingConfig = timingConfig; - * FLEXCAN_FDInit(CAN0, &flexcanConfig, 80000000UL, kFLEXCAN_16BperMB, true); - * @endcode - * - * @param base FlexCAN peripheral base address. - * @param pConfig Pointer to the user-defined configuration structure. - * @param sourceClock_Hz FlexCAN Protocol Engine clock source frequency in Hz. - * @param dataSize FlexCAN Message Buffer payload size. The actual transmitted or received CAN FD frame data size needs - * to be less than or equal to this value. - * @param brs True if bit rate switch is enabled in FD mode. - */ -void FLEXCAN_FDInit( - CAN_Type *base, const flexcan_config_t *pConfig, uint32_t sourceClock_Hz, flexcan_mb_size_t dataSize, bool brs); -#endif - -/*! - * @brief De-initializes a FlexCAN instance. - * - * This function disables the FlexCAN module clock and sets all register values - * to the reset value. - * - * @param base FlexCAN peripheral base address. - */ -void FLEXCAN_Deinit(CAN_Type *base); - -/*! - * @brief Gets the default configuration structure. - * - * This function initializes the FlexCAN configuration structure to default values. The default - * values are as follows. - * flexcanConfig->clkSrc = kFLEXCAN_ClkSrc0; - * flexcanConfig->bitRate = 1000000U; - * flexcanConfig->bitRateFD = 2000000U; - * flexcanConfig->maxMbNum = 16; - * flexcanConfig->enableLoopBack = false; - * flexcanConfig->enableSelfWakeup = false; - * flexcanConfig->enableIndividMask = false; - * flexcanConfig->disableSelfReception = false; - * flexcanConfig->enableListenOnlyMode = false; - * flexcanConfig->enableDoze = false; - * flexcanConfig->enableMemoryErrorControl = true; - * flexcanConfig->enableNonCorrectableErrorEnterFreeze = true; - * flexcanConfig.timingConfig = timingConfig; - * - * @param pConfig Pointer to the FlexCAN configuration structure. - */ -void FLEXCAN_GetDefaultConfig(flexcan_config_t *pConfig); - -/*! @} */ - -/*! - * @name Configuration. - * @{ - */ - -/*! - * @brief Sets the FlexCAN classical CAN protocol timing characteristic. - * - * This function gives user settings to classical CAN or CAN FD nominal phase timing characteristic. - * The function is for an experienced user. For less experienced users, call the FLEXCAN_SetBitRate() instead. - * - * @note Calling FLEXCAN_SetTimingConfig() overrides the bit rate set in FLEXCAN_Init() or FLEXCAN_SetBitRate(). - * - * @param base FlexCAN peripheral base address. - * @param pConfig Pointer to the timing configuration structure. - */ -void FLEXCAN_SetTimingConfig(CAN_Type *base, const flexcan_timing_config_t *pConfig); - -/*! - * @brief Set bit rate of FlexCAN classical CAN frame or CAN FD frame nominal phase. - * - * This function set the bit rate of classical CAN frame or CAN FD frame nominal phase base on - * FLEXCAN_CalculateImprovedTimingValues() API calculated timing values. - * - * @note Calling FLEXCAN_SetBitRate() overrides the bit rate set in FLEXCAN_Init(). - * - * @param base FlexCAN peripheral base address. - * @param sourceClock_Hz Source Clock in Hz. - * @param bitRate_Bps Bit rate in Bps. - * @return kStatus_Success - Set CAN baud rate (only Nominal phase) successfully. - */ -status_t FLEXCAN_SetBitRate(CAN_Type *base, uint32_t sourceClock_Hz, uint32_t bitRate_Bps); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * @brief Sets the FlexCAN CANFD data phase timing characteristic. - * - * This function gives user settings to CANFD data phase timing characteristic. - * The function is for an experienced user. For less experienced users, call the FLEXCAN_SetFDBitRate() - * to set both Nominal/Data bit Rate instead. - * - * @note Calling FLEXCAN_SetFDTimingConfig() overrides the data phase bit rate set in - * FLEXCAN_FDInit()/FLEXCAN_SetFDBitRate(). - * - * @param base FlexCAN peripheral base address. - * @param pConfig Pointer to the timing configuration structure. - */ -void FLEXCAN_SetFDTimingConfig(CAN_Type *base, const flexcan_timing_config_t *pConfig); - -/*! - * @brief Set bit rate of FlexCAN FD frame. - * - * This function set the baud rate of FLEXCAN FD base on FLEXCAN_FDCalculateImprovedTimingValues() API calculated timing - * values. - * - * @param base FlexCAN peripheral base address. - * @param sourceClock_Hz Source Clock in Hz. - * @param bitRateN_Bps Nominal bit Rate in Bps. - * @param bitRateD_Bps Data bit Rate in Bps. - * @return kStatus_Success - Set CAN FD bit rate (include Nominal and Data phase) successfully. - */ -status_t FLEXCAN_SetFDBitRate(CAN_Type *base, uint32_t sourceClock_Hz, uint32_t bitRateN_Bps, uint32_t bitRateD_Bps); -#endif - -/*! - * @brief Sets the FlexCAN receive message buffer global mask. - * - * This function sets the global mask for the FlexCAN message buffer in a matching process. - * The configuration is only effective when the Rx individual mask is disabled in the FLEXCAN_Init(). - * - * @param base FlexCAN peripheral base address. - * @param mask Rx Message Buffer Global Mask value. - */ -void FLEXCAN_SetRxMbGlobalMask(CAN_Type *base, uint32_t mask); - -/*! - * @brief Sets the FlexCAN receive FIFO global mask. - * - * This function sets the global mask for FlexCAN FIFO in a matching process. - * - * @param base FlexCAN peripheral base address. - * @param mask Rx Fifo Global Mask value. - */ -void FLEXCAN_SetRxFifoGlobalMask(CAN_Type *base, uint32_t mask); - -/*! - * @brief Sets the FlexCAN receive individual mask. - * - * This function sets the individual mask for the FlexCAN matching process. - * The configuration is only effective when the Rx individual mask is enabled in the FLEXCAN_Init(). - * If the Rx FIFO is disabled, the individual mask is applied to the corresponding Message Buffer. - * If the Rx FIFO is enabled, the individual mask for Rx FIFO occupied Message Buffer is applied to - * the Rx Filter with the same index. Note that only the first 32 - * individual masks can be used as the Rx FIFO filter mask. - * - * @param base FlexCAN peripheral base address. - * @param maskIdx The Index of individual Mask. - * @param mask Rx Individual Mask value. - */ -void FLEXCAN_SetRxIndividualMask(CAN_Type *base, uint8_t maskIdx, uint32_t mask); - -/*! - * @brief Configures a FlexCAN transmit message buffer. - * - * This function aborts the previous transmission, cleans the Message Buffer, and - * configures it as a Transmit Message Buffer. - * - * @param base FlexCAN peripheral base address. - * @param mbIdx The Message Buffer index. - * @param enable Enable/disable Tx Message Buffer. - * - true: Enable Tx Message Buffer. - * - false: Disable Tx Message Buffer. - */ -void FLEXCAN_SetTxMbConfig(CAN_Type *base, uint8_t mbIdx, bool enable); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * @brief Configures a FlexCAN transmit message buffer. - * - * This function aborts the previous transmission, cleans the Message Buffer, and - * configures it as a Transmit Message Buffer. - * - * @param base FlexCAN peripheral base address. - * @param mbIdx The Message Buffer index. - * @param enable Enable/disable Tx Message Buffer. - * - true: Enable Tx Message Buffer. - * - false: Disable Tx Message Buffer. - */ -void FLEXCAN_SetFDTxMbConfig(CAN_Type *base, uint8_t mbIdx, bool enable); -#endif - -/*! - * @brief Configures a FlexCAN Receive Message Buffer. - * - * This function cleans a FlexCAN build-in Message Buffer and configures it - * as a Receive Message Buffer. - * - * @param base FlexCAN peripheral base address. - * @param mbIdx The Message Buffer index. - * @param pRxMbConfig Pointer to the FlexCAN Message Buffer configuration structure. - * @param enable Enable/disable Rx Message Buffer. - * - true: Enable Rx Message Buffer. - * - false: Disable Rx Message Buffer. - */ -void FLEXCAN_SetRxMbConfig(CAN_Type *base, uint8_t mbIdx, const flexcan_rx_mb_config_t *pRxMbConfig, bool enable); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * @brief Configures a FlexCAN Receive Message Buffer. - * - * This function cleans a FlexCAN build-in Message Buffer and configures it - * as a Receive Message Buffer. - * - * @param base FlexCAN peripheral base address. - * @param mbIdx The Message Buffer index. - * @param pRxMbConfig Pointer to the FlexCAN Message Buffer configuration structure. - * @param enable Enable/disable Rx Message Buffer. - * - true: Enable Rx Message Buffer. - * - false: Disable Rx Message Buffer. - */ -void FLEXCAN_SetFDRxMbConfig(CAN_Type *base, uint8_t mbIdx, const flexcan_rx_mb_config_t *pRxMbConfig, bool enable); -#endif - -/*! - * @brief Configures the FlexCAN Legacy Rx FIFO. - * - * This function configures the FlexCAN Rx FIFO with given configuration. - * @note Legacy Rx FIFO only can receive classic CAN message. - * - * @param base FlexCAN peripheral base address. - * @param pRxFifoConfig Pointer to the FlexCAN Legacy Rx FIFO configuration structure. Can be NULL when enable parameter - * is false. - * @param enable Enable/disable Legacy Rx FIFO. - * - true: Enable Legacy Rx FIFO. - * - false: Disable Legacy Rx FIFO. - */ -void FLEXCAN_SetRxFifoConfig(CAN_Type *base, const flexcan_rx_fifo_config_t *pRxFifoConfig, bool enable); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * @brief Configures the FlexCAN Enhanced Rx FIFO. - * - * This function configures the Enhanced Rx FIFO with given configuration. - * @note Enhanced Rx FIFO support receive classic CAN or CAN FD messages, Legacy Rx FIFO and Enhanced Rx FIFO - * cannot be enabled at the same time. - * - * @param base FlexCAN peripheral base address. - * @param pConfig Pointer to the FlexCAN Enhanced Rx FIFO configuration structure. Can be NULL when enable parameter - * is false. - * @param enable Enable/disable Enhanced Rx FIFO. - * - true: Enable Enhanced Rx FIFO. - * - false: Disable Enhanced Rx FIFO. - */ -void FLEXCAN_SetEnhancedRxFifoConfig(CAN_Type *base, const flexcan_enhanced_rx_fifo_config_t *pConfig, bool enable); -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) -/*! - * @brief Configures the FlexCAN Pretended Networking mode. - * - * This function configures the FlexCAN Pretended Networking mode with given configuration. - * - * @param base FlexCAN peripheral base address. - * @param pConfig Pointer to the FlexCAN Rx FIFO configuration structure. - */ -void FLEXCAN_SetPNConfig(CAN_Type *base, const flexcan_pn_config_t *pConfig); -#endif -/*! @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets the FlexCAN module interrupt flags. - * - * This function gets all FlexCAN status flags. The flags are returned as the logical - * OR value of the enumerators @ref _flexcan_flags. To check the specific status, - * compare the return value with enumerators in @ref _flexcan_flags. - * - * @param base FlexCAN peripheral base address. - * @return FlexCAN status flags which are ORed by the enumerators in the _flexcan_flags. - */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -static inline uint64_t FLEXCAN_GetStatusFlags(CAN_Type *base) -{ - uint64_t tempflag = (uint64_t)base->ESR1; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - /* Get PN Wake Up status. */ - tempflag |= FLEXCAN_PN_STATUS_MASK(base->WU_MTC); -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - /* Get Enhanced Rx FIFO status. */ - tempflag |= FLEXCAN_EFIFO_STATUS_MASK(base->ERFSR); -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - /* Get Memory Error status. */ - tempflag |= FLEXCAN_MECR_STATUS_MASK(base->ERRSR); -#endif - return tempflag; -} -#else -static inline uint32_t FLEXCAN_GetStatusFlags(CAN_Type *base) -{ - return base->ESR1; -} -#endif -/*! - * @brief Clears status flags with the provided mask. - * - * This function clears the FlexCAN status flags with a provided mask. An automatically cleared flag - * can't be cleared by this function. - * - * @param base FlexCAN peripheral base address. - * @param mask The status flags to be cleared, it is logical OR value of @ref _flexcan_flags. - */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -static inline void FLEXCAN_ClearStatusFlags(CAN_Type *base, uint64_t mask) -{ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - /* Clear PN Wake Up status. */ - base->WU_MTC = FLEXCAN_PN_STATUS_UNMASK(mask); -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - /* Clear Enhanced Rx FIFO status. */ - base->ERFSR = FLEXCAN_EFIFO_STATUS_UNMASK(mask); -#endif -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - /* Clear Memory Error status. */ - base->ERRSR = FLEXCAN_MECR_STATUS_UNMASK(mask); -#endif - base->ESR1 = (uint32_t)(mask & 0xFFFFFFFFU); -} -#else -static inline void FLEXCAN_ClearStatusFlags(CAN_Type *base, uint32_t mask) -{ - /* Write 1 to clear status flag. */ - base->ESR1 = mask; -} -#endif -/*! - * @brief Gets the FlexCAN Bus Error Counter value. - * - * This function gets the FlexCAN Bus Error Counter value for both Tx and - * Rx direction. These values may be needed in the upper layer error handling. - * - * @param base FlexCAN peripheral base address. - * @param txErrBuf Buffer to store Tx Error Counter value. - * @param rxErrBuf Buffer to store Rx Error Counter value. - */ -static inline void FLEXCAN_GetBusErrCount(CAN_Type *base, uint8_t *txErrBuf, uint8_t *rxErrBuf) -{ - if (NULL != txErrBuf) - { - *txErrBuf = (uint8_t)((base->ECR & CAN_ECR_TXERRCNT_MASK) >> CAN_ECR_TXERRCNT_SHIFT); - } - - if (NULL != rxErrBuf) - { - *rxErrBuf = (uint8_t)((base->ECR & CAN_ECR_RXERRCNT_MASK) >> CAN_ECR_RXERRCNT_SHIFT); - } -} - -/*! - * @brief Gets the FlexCAN Message Buffer interrupt flags. - * - * This function gets the interrupt flags of a given Message Buffers. - * - * @param base FlexCAN peripheral base address. - * @param mask The ORed FlexCAN Message Buffer mask. - * @return The status of given Message Buffers. - */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) -static inline uint64_t FLEXCAN_GetMbStatusFlags(CAN_Type *base, uint64_t mask) -#else -static inline uint32_t FLEXCAN_GetMbStatusFlags(CAN_Type *base, uint32_t mask) -#endif -{ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - uint64_t tempflag = (uint64_t)base->IFLAG1; - return (tempflag | (((uint64_t)base->IFLAG2) << 32)) & mask; -#else - return (base->IFLAG1 & mask); -#endif -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) -/*! - * @brief Gets the FlexCAN High 64 Message Buffer interrupt flags. - * - * Valid only if the number of available MBs exceeds 64. - * - * @param base FlexCAN peripheral base address. - * @param mask The ORed FlexCAN Message Buffer mask. - * @return The status of given Message Buffers. - */ -static inline uint64_t FLEXCAN_GetHigh64MbStatusFlags(CAN_Type *base, uint64_t mask) -{ - uint64_t tempflag = 0U; -#if defined(CAN_IFLAG3_BUF95TO64_MASK) - tempflag |= (uint64_t)base->IFLAG3; -#endif -#if defined(CAN_IFLAG4_BUF127TO96_MASK) - tempflag |= (uint64_t)base->IFLAG4; -#endif - return (tempflag & mask); -} -#endif - -/*! - * @brief Clears the FlexCAN Message Buffer interrupt flags. - * - * This function clears the interrupt flags of a given Message Buffers. - * - * @param base FlexCAN peripheral base address. - * @param mask The ORed FlexCAN Message Buffer mask. - */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) -static inline void FLEXCAN_ClearMbStatusFlags(CAN_Type *base, uint64_t mask) -#else -static inline void FLEXCAN_ClearMbStatusFlags(CAN_Type *base, uint32_t mask) -#endif -{ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - base->IFLAG1 = (uint32_t)(mask & 0xFFFFFFFFU); - base->IFLAG2 = (uint32_t)(mask >> 32); -#else - base->IFLAG1 = mask; -#endif -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) -/*! - * @brief Clears the FlexCAN High 64 Message Buffer interrupt flags. - * - * Valid only if the number of available MBs exceeds 64. - * - * @param base FlexCAN peripheral base address. - * @param mask The ORed FlexCAN Message Buffer mask. - */ -static inline void FLEXCAN_ClearHigh64MbStatusFlags(CAN_Type *base, uint64_t mask) -{ -#if defined(CAN_IFLAG3_BUF95TO64_MASK) - base->IFLAG3 = (uint32_t)(mask & 0xFFFFFFFFU); -#endif -#if defined(CAN_IFLAG4_BUF127TO96_MASK) - base->IFLAG4 = (uint32_t)(mask >> 32U); -#endif -} -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -/*! - * @brief Gets the FlexCAN Memory Error Report registers status. - * - * This function gets the FlexCAN Memory Error Report registers status. - * - * @param base FlexCAN peripheral base address. - * @param errorStatus Pointer to FlexCAN Memory Error Report registers status structure. - */ -void FLEXCAN_GetMemoryErrorReportStatus(CAN_Type *base, flexcan_memory_error_report_status_t *errorStatus); -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) -/*! - * @brief Gets the FlexCAN Number of Matches when in Pretended Networking. - * - * This function gets the number of times a given message has matched the predefined filtering criteria for ID and/or PL - * before a wakeup event. - * - * @param base FlexCAN peripheral base address. - * @return The number of received wake up msessages. - */ -static inline uint8_t FLEXCAN_GetPNMatchCount(CAN_Type *base) -{ - return (uint8_t)((base->WU_MTC & CAN_WU_MTC_MCOUNTER_MASK) >> CAN_WU_MTC_MCOUNTER_SHIFT); -} -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * @brief Gets the number of FlexCAN Enhanced Rx FIFO available frames. - * - * This function gets the number of CAN messages stored in the Enhanced Rx FIFO. - * - * @param base FlexCAN peripheral base address. - * @return The number of available CAN messages stored in the Enhanced Rx FIFO. - */ -static inline uint32_t FLEXCAN_GetEnhancedFifoDataCount(CAN_Type *base) -{ - return (base->ERFSR & CAN_ERFSR_ERFEL_MASK); -} -#endif -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables FlexCAN interrupts according to the provided mask. - * - * This function enables the FlexCAN interrupts according to the provided mask. The mask - * is a logical OR of enumeration members, see @ref _flexcan_interrupt_enable. - * - * @param base FlexCAN peripheral base address. - * @param mask The interrupts to enable. Logical OR of @ref _flexcan_interrupt_enable. - */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -static inline void FLEXCAN_EnableInterrupts(CAN_Type *base, uint64_t mask) -#else -static inline void FLEXCAN_EnableInterrupts(CAN_Type *base, uint32_t mask) -#endif -{ - uint32_t primask = DisableGlobalIRQ(); - - /* Solve Self Wake Up interrupt. */ - base->MCR |= (uint32_t)(mask & (uint32_t)kFLEXCAN_WakeUpInterruptEnable); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0 != FSL_FEATURE_FLEXCAN_INSTANCE_HAS_FLEXIBLE_DATA_RATEn(base)) - { - /* Solve CAN FD frames data phase error interrupt. */ - base->CTRL2 |= (uint32_t)(mask & (uint32_t)kFLEXCAN_FDErrorInterruptEnable); - } -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - /* Solve PN Wake Up interrupt. */ - base->CTRL1_PN |= FLEXCAN_PN_INT_UNMASK(mask); -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - /* Solve Enhanced Rx FIFO interrupt. */ - base->ERFIER |= FLEXCAN_EFIFO_INT_UNMASK(mask); -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - /* Solve Memory Error interrupt. */ - base->MECR |= FLEXCAN_MECR_INT_UNMASK(mask); -#endif - - /* Solve interrupt enable bits in CTRL1 register. */ - base->CTRL1 |= - (uint32_t)(mask & ((uint32_t)kFLEXCAN_BusOffInterruptEnable | (uint32_t)kFLEXCAN_ErrorInterruptEnable | - (uint32_t)kFLEXCAN_RxWarningInterruptEnable | (uint32_t)kFLEXCAN_TxWarningInterruptEnable)); - - EnableGlobalIRQ(primask); -} - -/*! - * @brief Disables FlexCAN interrupts according to the provided mask. - * - * This function disables the FlexCAN interrupts according to the provided mask. The mask - * is a logical OR of enumeration members, see @ref _flexcan_interrupt_enable. - * - * @param base FlexCAN peripheral base address. - * @param mask The interrupts to disable. Logical OR of @ref _flexcan_interrupt_enable. - */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) || \ - (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) -static inline void FLEXCAN_DisableInterrupts(CAN_Type *base, uint64_t mask) -#else -static inline void FLEXCAN_DisableInterrupts(CAN_Type *base, uint32_t mask) -#endif -{ - uint32_t primask = DisableGlobalIRQ(); - - /* Solve Wake Up Interrupt. */ - base->MCR &= ~(uint32_t)(mask & (uint32_t)kFLEXCAN_WakeUpInterruptEnable); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) - if (0 != FSL_FEATURE_FLEXCAN_INSTANCE_HAS_FLEXIBLE_DATA_RATEn(base)) - { - /* Solve CAN FD frames data phase error interrupt. */ - base->CTRL2 &= ~(uint32_t)(mask & (uint32_t)kFLEXCAN_FDErrorInterruptEnable); - } -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) - /* Solve PN Wake Up Interrupt. */ - base->CTRL1_PN &= ~FLEXCAN_PN_STATUS_UNMASK(mask); -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - /* Solve Enhanced Rx FIFO interrupt. */ - base->ERFIER &= ~FLEXCAN_EFIFO_INT_UNMASK(mask); -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) && FSL_FEATURE_FLEXCAN_HAS_MEMORY_ERROR_CONTROL) - /* Solve Memory Error Interrupt. */ - base->MECR &= ~FLEXCAN_MECR_STATUS_UNMASK(mask); -#endif - - /* Solve interrupt enable bits in CTRL1 register. */ - base->CTRL1 &= - ~(uint32_t)(mask & ((uint32_t)kFLEXCAN_BusOffInterruptEnable | (uint32_t)kFLEXCAN_ErrorInterruptEnable | - (uint32_t)kFLEXCAN_RxWarningInterruptEnable | (uint32_t)kFLEXCAN_TxWarningInterruptEnable)); - - EnableGlobalIRQ(primask); -} - -/*! - * @brief Enables FlexCAN Message Buffer interrupts. - * - * This function enables the interrupts of given Message Buffers. - * - * @param base FlexCAN peripheral base address. - * @param mask The ORed FlexCAN Message Buffer mask. - */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) -static inline void FLEXCAN_EnableMbInterrupts(CAN_Type *base, uint64_t mask) -#else -static inline void FLEXCAN_EnableMbInterrupts(CAN_Type *base, uint32_t mask) -#endif -{ - uint32_t primask = DisableGlobalIRQ(); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - base->IMASK1 |= (uint32_t)(mask & 0xFFFFFFFFU); - base->IMASK2 |= (uint32_t)(mask >> 32); -#else - base->IMASK1 |= mask; -#endif - EnableGlobalIRQ(primask); -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) -/*! - * @brief Enables FlexCAN high 64 Message Buffer interrupts. - * - * Valid only if the number of available MBs exceeds 64. - * - * @param base FlexCAN peripheral base address. - * @param mask The ORed FlexCAN Message Buffer mask. - */ -static inline void FLEXCAN_EnableHigh64MbInterrupts(CAN_Type *base, uint64_t mask) -{ - uint32_t primask = DisableGlobalIRQ(); - -#if defined(CAN_IMASK3_BUF95TO64M_MASK) - base->IMASK3 |= (uint32_t)(mask & 0xFFFFFFFFU); -#endif -#if defined(CAN_IMASK4_BUF127TO96_MASK) - base->IMASK4 |= (uint32_t)(mask >> 32U); -#endif - EnableGlobalIRQ(primask); -} -#endif - -/*! - * @brief Disables FlexCAN Message Buffer interrupts. - * - * This function disables the interrupts of given Message Buffers. - * - * @param base FlexCAN peripheral base address. - * @param mask The ORed FlexCAN Message Buffer mask. - */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) -static inline void FLEXCAN_DisableMbInterrupts(CAN_Type *base, uint64_t mask) -#else -static inline void FLEXCAN_DisableMbInterrupts(CAN_Type *base, uint32_t mask) -#endif -{ - uint32_t primask = DisableGlobalIRQ(); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER)) && (FSL_FEATURE_FLEXCAN_HAS_EXTENDED_FLAG_REGISTER > 0) - base->IMASK1 &= ~((uint32_t)(mask & 0xFFFFFFFFU)); - base->IMASK2 &= ~((uint32_t)(mask >> 32)); -#else - base->IMASK1 &= ~mask; -#endif - EnableGlobalIRQ(primask); -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) && FSL_FEATURE_FLEXCAN_HAS_MORE_THAN_64_MB) -/*! - * @brief Disables FlexCAN high 64 Message Buffer interrupts. - * - * Valid only if the number of available MBs exceeds 64. - * - * @param base FlexCAN peripheral base address. - * @param mask The ORed FlexCAN Message Buffer mask. - */ -static inline void FLEXCAN_DisableHigh64MbInterrupts(CAN_Type *base, uint64_t mask) -{ - uint32_t primask = DisableGlobalIRQ(); - -#if defined(CAN_IMASK3_BUF95TO64M_MASK) - base->IMASK3 &= ~((uint32_t)(mask & 0xFFFFFFFFU)); -#endif -#if defined(CAN_IMASK4_BUF127TO96_MASK) - base->IMASK4 &= ~((uint32_t)(mask >> 32U)); -#endif - EnableGlobalIRQ(primask); -} -#endif - -/*! @} */ - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_RX_FIFO_DMA) && FSL_FEATURE_FLEXCAN_HAS_RX_FIFO_DMA) -/*! - * @name DMA Control - * @{ - */ - -/*! - * @brief Enables or disables the FlexCAN Rx FIFO DMA request. - * - * This function enables or disables the DMA feature of FlexCAN build-in Rx FIFO. - * - * @param base FlexCAN peripheral base address. - * @param enable true to enable, false to disable. - */ -void FLEXCAN_EnableRxFifoDMA(CAN_Type *base, bool enable); - -/*! - * @brief Gets the Rx FIFO Head address. - * - * This function returns the FlexCAN Rx FIFO Head address, which is mainly used for the DMA/eDMA use case. - * - * @param base FlexCAN peripheral base address. - * @return FlexCAN Rx FIFO Head address. - */ -static inline uintptr_t FLEXCAN_GetRxFifoHeadAddr(CAN_Type *base) -{ - return (uintptr_t) & (base->MB[0].CS); -} - -/*! @} */ -#endif /* FSL_FEATURE_FLEXCAN_HAS_RX_FIFO_DMA */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Enables or disables the FlexCAN module operation. - * - * This function enables or disables the FlexCAN module. - * - * @param base FlexCAN base pointer. - * @param enable true to enable, false to disable. - */ -static inline void FLEXCAN_Enable(CAN_Type *base, bool enable) -{ - if (enable) - { - base->MCR &= ~CAN_MCR_MDIS_MASK; - - /* Wait FlexCAN exit from low-power mode. */ - while (0U != (base->MCR & CAN_MCR_LPMACK_MASK)) - { - } - } - else - { - base->MCR |= CAN_MCR_MDIS_MASK; - - /* Wait FlexCAN enter low-power mode. */ - while (0U == (base->MCR & CAN_MCR_LPMACK_MASK)) - { - } - } -} - -/*! - * @brief Writes a FlexCAN Message to the Transmit Message Buffer. - * - * This function writes a CAN Message to the specified Transmit Message Buffer - * and changes the Message Buffer state to start CAN Message transmit. After - * that the function returns immediately. - * - * @param base FlexCAN peripheral base address. - * @param mbIdx The FlexCAN Message Buffer index. - * @param pTxFrame Pointer to CAN message frame to be sent. - * @retval kStatus_Success - Write Tx Message Buffer Successfully. - * @retval kStatus_Fail - Tx Message Buffer is currently in use. - */ -status_t FLEXCAN_WriteTxMb(CAN_Type *base, uint8_t mbIdx, const flexcan_frame_t *pTxFrame); - -/*! - * @brief Reads a FlexCAN Message from Receive Message Buffer. - * - * This function reads a CAN message from a specified Receive Message Buffer. - * The function fills a receive CAN message frame structure with - * just received data and activates the Message Buffer again. - * The function returns immediately. - * - * @param base FlexCAN peripheral base address. - * @param mbIdx The FlexCAN Message Buffer index. - * @param pRxFrame Pointer to CAN message frame structure for reception. - * @retval kStatus_Success - Rx Message Buffer is full and has been read successfully. - * @retval kStatus_FLEXCAN_RxOverflow - Rx Message Buffer is already overflowed and has been read successfully. - * @retval kStatus_Fail - Rx Message Buffer is empty. - */ -status_t FLEXCAN_ReadRxMb(CAN_Type *base, uint8_t mbIdx, flexcan_frame_t *pRxFrame); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * @brief Writes a FlexCAN FD Message to the Transmit Message Buffer. - * - * This function writes a CAN FD Message to the specified Transmit Message Buffer - * and changes the Message Buffer state to start CAN FD Message transmit. After - * that the function returns immediately. - * - * @param base FlexCAN peripheral base address. - * @param mbIdx The FlexCAN FD Message Buffer index. - * @param pTxFrame Pointer to CAN FD message frame to be sent. - * @retval kStatus_Success - Write Tx Message Buffer Successfully. - * @retval kStatus_Fail - Tx Message Buffer is currently in use. - */ -status_t FLEXCAN_WriteFDTxMb(CAN_Type *base, uint8_t mbIdx, const flexcan_fd_frame_t *pTxFrame); - -/*! - * @brief Reads a FlexCAN FD Message from Receive Message Buffer. - * - * This function reads a CAN FD message from a specified Receive Message Buffer. - * The function fills a receive CAN FD message frame structure with - * just received data and activates the Message Buffer again. - * The function returns immediately. - * - * @param base FlexCAN peripheral base address. - * @param mbIdx The FlexCAN FD Message Buffer index. - * @param pRxFrame Pointer to CAN FD message frame structure for reception. - * @retval kStatus_Success - Rx Message Buffer is full and has been read successfully. - * @retval kStatus_FLEXCAN_RxOverflow - Rx Message Buffer is already overflowed and has been read successfully. - * @retval kStatus_Fail - Rx Message Buffer is empty. - */ -status_t FLEXCAN_ReadFDRxMb(CAN_Type *base, uint8_t mbIdx, flexcan_fd_frame_t *pRxFrame); -#endif - -/*! - * @brief Reads a FlexCAN Message from Legacy Rx FIFO. - * - * This function reads a CAN message from the FlexCAN Legacy Rx FIFO. - * - * @param base FlexCAN peripheral base address. - * @param pRxFrame Pointer to CAN message frame structure for reception. - * @retval kStatus_Success - Read Message from Rx FIFO successfully. - * @retval kStatus_Fail - Rx FIFO is not enabled. - */ -status_t FLEXCAN_ReadRxFifo(CAN_Type *base, flexcan_frame_t *pRxFrame); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * @brief Reads a FlexCAN Message from Enhanced Rx FIFO. - * - * This function reads a CAN or CAN FD message from the FlexCAN Enhanced Rx FIFO. - * - * @param base FlexCAN peripheral base address. - * @param pRxFrame Pointer to CAN FD message frame structure for reception. - * @retval kStatus_Success - Read Message from Rx FIFO successfully. - * @retval kStatus_Fail - Rx FIFO is not enabled. - */ -status_t FLEXCAN_ReadEnhancedRxFifo(CAN_Type *base, flexcan_fd_frame_t *pRxFrame); -#endif - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_PN_MODE) && FSL_FEATURE_FLEXCAN_HAS_PN_MODE) -/*! - * @brief Reads a FlexCAN Message from Wake Up MB. - * - * This function reads a CAN message from the FlexCAN Wake up Message Buffers. There are four Wake up Message Buffers - * (WMBs) used to store incoming messages in Pretended Networking mode. The WMB index indicates the arrival order. The - * last message is stored in WMB3. - * - * @param base FlexCAN peripheral base address. - * @param pRxFrame Pointer to CAN message frame structure for reception. - * @param mbIdx The FlexCAN Wake up Message Buffer index. Range in 0x0 ~ 0x3. - * @retval kStatus_Success - Read Message from Wake up Message Buffer successfully. - * @retval kStatus_Fail - Wake up Message Buffer has no valid content. - */ -status_t FLEXCAN_ReadPNWakeUpMB(CAN_Type *base, uint8_t mbIdx, flexcan_frame_t *pRxFrame); -#endif -/*! @} */ - -/*! - * @name Transactional - * @{ - */ - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) && FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) -/*! - * @brief Performs a polling send transaction on the CAN bus. - * - * @note A transfer handle does not need to be created before calling this API. - * - * @param base FlexCAN peripheral base pointer. - * @param mbIdx The FlexCAN FD Message Buffer index. - * @param pTxFrame Pointer to CAN FD message frame to be sent. - * @retval kStatus_Success - Write Tx Message Buffer Successfully. - * @retval kStatus_Fail - Tx Message Buffer is currently in use. - */ -status_t FLEXCAN_TransferFDSendBlocking(CAN_Type *base, uint8_t mbIdx, flexcan_fd_frame_t *pTxFrame); - -/*! - * @brief Performs a polling receive transaction on the CAN bus. - * - * @note A transfer handle does not need to be created before calling this API. - * - * @param base FlexCAN peripheral base pointer. - * @param mbIdx The FlexCAN FD Message Buffer index. - * @param pRxFrame Pointer to CAN FD message frame structure for reception. - * @retval kStatus_Success - Rx Message Buffer is full and has been read successfully. - * @retval kStatus_FLEXCAN_RxOverflow - Rx Message Buffer is already overflowed and has been read successfully. - * @retval kStatus_Fail - Rx Message Buffer is empty. - */ -status_t FLEXCAN_TransferFDReceiveBlocking(CAN_Type *base, uint8_t mbIdx, flexcan_fd_frame_t *pRxFrame); - -/*! - * @brief Sends a message using IRQ. - * - * This function sends a message using IRQ. This is a non-blocking function, which returns - * right away. When messages have been sent out, the send callback function is called. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param pMbXfer FlexCAN FD Message Buffer transfer structure. See the #flexcan_mb_transfer_t. - * @retval kStatus_Success Start Tx Message Buffer sending process successfully. - * @retval kStatus_Fail Write Tx Message Buffer failed. - * @retval kStatus_FLEXCAN_TxBusy Tx Message Buffer is in use. - */ -status_t FLEXCAN_TransferFDSendNonBlocking(CAN_Type *base, flexcan_handle_t *handle, flexcan_mb_transfer_t *pMbXfer); - -/*! - * @brief Receives a message using IRQ. - * - * This function receives a message using IRQ. This is non-blocking function, which returns - * right away. When the message has been received, the receive callback function is called. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param pMbXfer FlexCAN FD Message Buffer transfer structure. See the #flexcan_mb_transfer_t. - * @retval kStatus_Success - Start Rx Message Buffer receiving process successfully. - * @retval kStatus_FLEXCAN_RxBusy - Rx Message Buffer is in use. - */ -status_t FLEXCAN_TransferFDReceiveNonBlocking(CAN_Type *base, flexcan_handle_t *handle, flexcan_mb_transfer_t *pMbXfer); - -/*! - * @brief Aborts the interrupt driven message send process. - * - * This function aborts the interrupt driven message send process. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param mbIdx The FlexCAN FD Message Buffer index. - */ -void FLEXCAN_TransferFDAbortSend(CAN_Type *base, flexcan_handle_t *handle, uint8_t mbIdx); - -/*! - * @brief Aborts the interrupt driven message receive process. - * - * This function aborts the interrupt driven message receive process. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param mbIdx The FlexCAN FD Message Buffer index. - */ -void FLEXCAN_TransferFDAbortReceive(CAN_Type *base, flexcan_handle_t *handle, uint8_t mbIdx); -#endif - -/*! - * @brief Performs a polling send transaction on the CAN bus. - * - * @note A transfer handle does not need to be created before calling this API. - * - * @param base FlexCAN peripheral base pointer. - * @param mbIdx The FlexCAN Message Buffer index. - * @param pTxFrame Pointer to CAN message frame to be sent. - * @retval kStatus_Success - Write Tx Message Buffer Successfully. - * @retval kStatus_Fail - Tx Message Buffer is currently in use. - */ -status_t FLEXCAN_TransferSendBlocking(CAN_Type *base, uint8_t mbIdx, flexcan_frame_t *pTxFrame); - -/*! - * @brief Performs a polling receive transaction on the CAN bus. - * - * @note A transfer handle does not need to be created before calling this API. - * - * @param base FlexCAN peripheral base pointer. - * @param mbIdx The FlexCAN Message Buffer index. - * @param pRxFrame Pointer to CAN message frame structure for reception. - * @retval kStatus_Success - Rx Message Buffer is full and has been read successfully. - * @retval kStatus_FLEXCAN_RxOverflow - Rx Message Buffer is already overflowed and has been read successfully. - * @retval kStatus_Fail - Rx Message Buffer is empty. - */ -status_t FLEXCAN_TransferReceiveBlocking(CAN_Type *base, uint8_t mbIdx, flexcan_frame_t *pRxFrame); - -/*! - * @brief Performs a polling receive transaction from Legacy Rx FIFO on the CAN bus. - * - * @note A transfer handle does not need to be created before calling this API. - * - * @param base FlexCAN peripheral base pointer. - * @param pRxFrame Pointer to CAN message frame structure for reception. - * @retval kStatus_Success - Read Message from Rx FIFO successfully. - * @retval kStatus_Fail - Rx FIFO is not enabled. - */ -status_t FLEXCAN_TransferReceiveFifoBlocking(CAN_Type *base, flexcan_frame_t *pRxFrame); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * @brief Performs a polling receive transaction from Enhanced Rx FIFO on the CAN bus. - * - * @note A transfer handle does not need to be created before calling this API. - * - * @param base FlexCAN peripheral base pointer. - * @param pRxFrame Pointer to CAN FD message frame structure for reception. - * @retval kStatus_Success - Read Message from Rx FIFO successfully. - * @retval kStatus_Fail - Rx FIFO is not enabled. - */ -status_t FLEXCAN_TransferReceiveEnhancedFifoBlocking(CAN_Type *base, flexcan_fd_frame_t *pRxFrame); -#endif - -/*! - * @brief Initializes the FlexCAN handle. - * - * This function initializes the FlexCAN handle, which can be used for other FlexCAN - * transactional APIs. Usually, for a specified FlexCAN instance, - * call this API once to get the initialized handle. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param callback The callback function. - * @param userData The parameter of the callback function. - */ -void FLEXCAN_TransferCreateHandle(CAN_Type *base, - flexcan_handle_t *handle, - flexcan_transfer_callback_t callback, - void *userData); - -/*! - * @brief Sends a message using IRQ. - * - * This function sends a message using IRQ. This is a non-blocking function, which returns - * right away. When messages have been sent out, the send callback function is called. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param pMbXfer FlexCAN Message Buffer transfer structure. See the #flexcan_mb_transfer_t. - * @retval kStatus_Success Start Tx Message Buffer sending process successfully. - * @retval kStatus_Fail Write Tx Message Buffer failed. - * @retval kStatus_FLEXCAN_TxBusy Tx Message Buffer is in use. - */ -status_t FLEXCAN_TransferSendNonBlocking(CAN_Type *base, flexcan_handle_t *handle, flexcan_mb_transfer_t *pMbXfer); - -/*! - * @brief Receives a message using IRQ. - * - * This function receives a message using IRQ. This is non-blocking function, which returns - * right away. When the message has been received, the receive callback function is called. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param pMbXfer FlexCAN Message Buffer transfer structure. See the #flexcan_mb_transfer_t. - * @retval kStatus_Success - Start Rx Message Buffer receiving process successfully. - * @retval kStatus_FLEXCAN_RxBusy - Rx Message Buffer is in use. - */ -status_t FLEXCAN_TransferReceiveNonBlocking(CAN_Type *base, flexcan_handle_t *handle, flexcan_mb_transfer_t *pMbXfer); - -/*! - * @brief Receives a message from Rx FIFO using IRQ. - * - * This function receives a message using IRQ. This is a non-blocking function, which returns - * right away. When all messages have been received, the receive callback function is called. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param pFifoXfer FlexCAN Rx FIFO transfer structure. See the @ref flexcan_fifo_transfer_t. - * @retval kStatus_Success - Start Rx FIFO receiving process successfully. - * @retval kStatus_FLEXCAN_RxFifoBusy - Rx FIFO is currently in use. - */ -status_t FLEXCAN_TransferReceiveFifoNonBlocking(CAN_Type *base, - flexcan_handle_t *handle, - flexcan_fifo_transfer_t *pFifoXfer); - -/*! - * @brief Gets the Legacy Rx Fifo transfer status during a interrupt non-blocking receive. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param count Number of CAN messages receive so far by the non-blocking transaction. - * @retval kStatus_InvalidArgument count is Invalid. - * @retval kStatus_Success Successfully return the count. - */ - -status_t FLEXCAN_TransferGetReceiveFifoCount(CAN_Type *base, flexcan_handle_t *handle, size_t *count); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * @brief Receives a message from Enhanced Rx FIFO using IRQ. - * - * This function receives a message using IRQ. This is a non-blocking function, which returns - * right away. When all messages have been received, the receive callback function is called. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param pFifoXfer FlexCAN Rx FIFO transfer structure. See the ref flexcan_fifo_transfer_t.@ - * @retval kStatus_Success - Start Rx FIFO receiving process successfully. - * @retval kStatus_FLEXCAN_RxFifoBusy - Rx FIFO is currently in use. - */ -status_t FLEXCAN_TransferReceiveEnhancedFifoNonBlocking(CAN_Type *base, - flexcan_handle_t *handle, - flexcan_fifo_transfer_t *pFifoXfer); - -/*! - * @brief Gets the Enhanced Rx Fifo transfer status during a interrupt non-blocking receive. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param count Number of CAN messages receive so far by the non-blocking transaction. - * @retval kStatus_InvalidArgument count is Invalid. - * @retval kStatus_Success Successfully return the count. - */ - -static inline status_t FLEXCAN_TransferGetReceiveEnhancedFifoCount(CAN_Type *base, - flexcan_handle_t *handle, - size_t *count) -{ - return FLEXCAN_TransferGetReceiveFifoCount(base, handle, count); -} -#endif - -/*! - * @brief Gets the detail index of Mailbox's Timestamp by handle. - * - * Then function can only be used when calling non-blocking Data transfer (TX/RX) API, - * After TX/RX data transfer done (User can get the status by handler's callback function), - * we can get the detail index of Mailbox's timestamp by handle, - * Detail non-blocking data transfer API (TX/RX) contain. - * -FLEXCAN_TransferSendNonBlocking - * -FLEXCAN_TransferFDSendNonBlocking - * -FLEXCAN_TransferReceiveNonBlocking - * -FLEXCAN_TransferFDReceiveNonBlocking - * -FLEXCAN_TransferReceiveFifoNonBlocking - * - * @param handle FlexCAN handle pointer. - * @param mbIdx The FlexCAN Message Buffer index. - * @retval the index of mailbox 's timestamp stored in the handle. - * - */ -uint32_t FLEXCAN_GetTimeStamp(flexcan_handle_t *handle, uint8_t mbIdx); - -/*! - * @brief Aborts the interrupt driven message send process. - * - * This function aborts the interrupt driven message send process. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param mbIdx The FlexCAN Message Buffer index. - */ -void FLEXCAN_TransferAbortSend(CAN_Type *base, flexcan_handle_t *handle, uint8_t mbIdx); - -/*! - * @brief Aborts the interrupt driven message receive process. - * - * This function aborts the interrupt driven message receive process. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param mbIdx The FlexCAN Message Buffer index. - */ -void FLEXCAN_TransferAbortReceive(CAN_Type *base, flexcan_handle_t *handle, uint8_t mbIdx); - -/*! - * @brief Aborts the interrupt driven message receive from Rx FIFO process. - * - * This function aborts the interrupt driven message receive from Rx FIFO process. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - */ -void FLEXCAN_TransferAbortReceiveFifo(CAN_Type *base, flexcan_handle_t *handle); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * @brief Aborts the interrupt driven message receive from Enhanced Rx FIFO process. - * - * This function aborts the interrupt driven message receive from Enhanced Rx FIFO process. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - */ -void FLEXCAN_TransferAbortReceiveEnhancedFifo(CAN_Type *base, flexcan_handle_t *handle); -#endif - -/*! - * @brief FlexCAN IRQ handle function. - * - * This function handles the FlexCAN Error, the Message Buffer, and the Rx FIFO IRQ request. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - */ -void FLEXCAN_TransferHandleIRQ(CAN_Type *base, flexcan_handle_t *handle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_FLEXCAN_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexcan_edma.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexcan_edma.c deleted file mode 100644 index a5f68487f31..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexcan_edma.c +++ /dev/null @@ -1,381 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexcan_edma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexcan_edma" -#endif - -/*base->ERFCR & CAN_ERFCR_ERFEN_MASK)) - { - framefd = flexcanPrivateHandle->handle->framefd; - for (uint32_t i = 0; i < flexcanPrivateHandle->handle->frameNum; i++) - { - /* Enhanced Rx FIFO ID HIT offset is changed dynamically according to data length code (DLC) . */ - idHitIndex = (DLC_LENGTH_DECODE(framefd->length) + 3U) / 4U; - framefd->idhit = framefd->dataWord[idHitIndex]; - /* Clear the unused frame data. */ - for (uint32_t j = idHitIndex; j < 16U; j++) - { - framefd->dataWord[j] = 0x0U; - } - framefd++; - } - } -#endif - /* Disable transfer. */ - FLEXCAN_TransferAbortReceiveFifoEDMA(flexcanPrivateHandle->base, flexcanPrivateHandle->handle); - - if (NULL != flexcanPrivateHandle->handle->callback) - { - flexcanPrivateHandle->handle->callback(flexcanPrivateHandle->base, flexcanPrivateHandle->handle, - kStatus_FLEXCAN_RxFifoIdle, flexcanPrivateHandle->handle->userData); - } - } -} - -/*! - * brief Initializes the FlexCAN handle, which is used in transactional functions. - * - * param base FlexCAN peripheral base address. - * param handle Pointer to flexcan_edma_handle_t structure. - * param callback The callback function. - * param userData The parameter of the callback function. - * param rxFifoEdmaHandle User-requested DMA handle for Rx FIFO DMA transfer. - */ -void FLEXCAN_TransferCreateHandleEDMA(CAN_Type *base, - flexcan_edma_handle_t *handle, - flexcan_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *rxFifoEdmaHandle) -{ - assert(NULL != handle); - - uint32_t instance = FLEXCAN_GetInstance(base); - s_flexcanEdmaPrivateHandle[instance].base = base; - s_flexcanEdmaPrivateHandle[instance].handle = handle; - - (void)memset(handle, 0, sizeof(flexcan_edma_handle_t)); - - handle->rxFifoState = (uint8_t)KFLEXCAN_RxFifoIdle; - handle->rxFifoEdmaHandle = rxFifoEdmaHandle; - - /* Register Callback. */ - handle->callback = callback; - handle->userData = userData; - - /* Configure Legacy/Enhanced Rx FIFO DMA callback. */ - EDMA_SetCallback(handle->rxFifoEdmaHandle, FLEXCAN_ReceiveFifoEDMACallback, &s_flexcanEdmaPrivateHandle[instance]); -} - -/*! - * brief Prepares the eDMA transfer configuration for FLEXCAN Legacy RX FIFO. - * - * This function prepares the eDMA transfer configuration structure according to FLEXCAN Legacy RX FIFO. - * - * param base FlexCAN peripheral base address. - * param pFifoXfer FlexCAN Rx FIFO EDMA transfer structure, see #flexcan_fifo_transfer_t. - * param pEdmaConfig The user configuration structure of type edma_transfer_t. - * - */ -void FLEXCAN_PrepareTransfConfiguration(CAN_Type *base, - flexcan_fifo_transfer_t *pFifoXfer, - edma_transfer_config_t *pEdmaConfig) -{ - assert(NULL != pFifoXfer); - assert(NULL != pFifoXfer->frame); - assert(NULL != pEdmaConfig); - - flexcan_frame_t *fifoAddr = (flexcan_frame_t *)FLEXCAN_GetRxFifoHeadAddr(base); - -#if (defined(FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) && FSL_FEATURE_EDMA_SUPPORT_16_BYTES_TRANSFER) - EDMA_PrepareTransfer(pEdmaConfig, (void *)fifoAddr, sizeof(flexcan_frame_t), (void *)pFifoXfer->frame, - sizeof(uint32_t), sizeof(flexcan_frame_t), sizeof(flexcan_frame_t) * pFifoXfer->frameNum, - kEDMA_PeripheralToMemory); -#else - /* The Data Size of FLEXCAN Legacy RX FIFO output port is 16 Bytes, but lots of chips not support 16Bytes width DMA - * transfer. These chips always support 4Byte width memory transfer, so we need prepare Memory to Memory mode by 4 - * Bytes width mode. - */ - EDMA_PrepareTransfer(pEdmaConfig, (void *)fifoAddr, 4U, (void *)pFifoXfer->frame, sizeof(uint32_t), - sizeof(flexcan_frame_t), sizeof(flexcan_frame_t) * pFifoXfer->frameNum, kEDMA_MemoryToMemory); -#endif -} - -/*! - * brief Start Transfer Data from the FLEXCAN Legacy Rx FIFO using eDMA. - * - * This function to Update edma transfer confiugration and Start eDMA transfer - * - * param base FlexCAN peripheral base address. - * param handle Pointer to flexcan_edma_handle_t structure. - * param pEdmaConfig The user configuration structure of type edma_transfer_t. - * retval kStatus_Success if succeed, others failed. - * retval kStatus_FLEXCAN_RxFifoBusy Previous transfer ongoing. - */ -status_t FLEXCAN_StartTransferDatafromRxFIFO(CAN_Type *base, - flexcan_edma_handle_t *handle, - edma_transfer_config_t *pEdmaConfig) -{ - assert(NULL != handle->rxFifoEdmaHandle); - assert(NULL != pEdmaConfig); - status_t status; - - /* If previous Rx FIFO receive not finished. */ - if ((uint8_t)KFLEXCAN_RxFifoBusy == handle->rxFifoState) - { - status = kStatus_FLEXCAN_RxFifoBusy; - } - else - { - handle->rxFifoState = (uint8_t)KFLEXCAN_RxFifoBusy; - - /* Enable FlexCAN Rx FIFO EDMA. */ - FLEXCAN_EnableRxFifoDMA(base, true); - - /* Submit configuration. */ - (void)EDMA_SubmitTransfer(handle->rxFifoEdmaHandle, (const edma_transfer_config_t *)pEdmaConfig); - EDMA_SetModulo(handle->rxFifoEdmaHandle->base, handle->rxFifoEdmaHandle->channel, kEDMA_Modulo16bytes, - kEDMA_ModuloDisable); - /* Start transfer. */ - EDMA_StartTransfer(handle->rxFifoEdmaHandle); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Receives the CAN Messages from the Legacy Rx FIFO using eDMA. - * - * This function receives the CAN Message using eDMA. This is a non-blocking function, which returns - * right away. After the CAN Message is received, the receive callback function is called. - * - * param base FlexCAN peripheral base address. - * param handle Pointer to flexcan_edma_handle_t structure. - * param pFifoXfer FlexCAN Rx FIFO EDMA transfer structure, see #flexcan_fifo_transfer_t. - * retval kStatus_Success if succeed, others failed. - * retval kStatus_FLEXCAN_RxFifoBusy Previous transfer ongoing. - */ -status_t FLEXCAN_TransferReceiveFifoEDMA(CAN_Type *base, - flexcan_edma_handle_t *handle, - flexcan_fifo_transfer_t *pFifoXfer) -{ - assert(NULL != handle->rxFifoEdmaHandle); - assert(NULL != pFifoXfer->frame); - - edma_transfer_config_t dmaXferConfig = {0}; - status_t status; - - handle->frameNum = pFifoXfer->frameNum; - /* Prepare transfer. */ - FLEXCAN_PrepareTransfConfiguration(base, pFifoXfer, &dmaXferConfig); - - /* Submit configuration and start edma transfer. */ - status = FLEXCAN_StartTransferDatafromRxFIFO(base, handle, &dmaXferConfig); - - return status; -} - -/*! - * brief Gets the Legacy Rx Fifo transfer status during a interrupt non-blocking receive. - * - * param base FlexCAN peripheral base address. - * param handle FlexCAN handle pointer. - * param count Number of CAN messages receive so far by the non-blocking transaction. - * retval kStatus_InvalidArgument count is Invalid. - * retval kStatus_Success Successfully return the count. - */ - -status_t FLEXCAN_TransferGetReceiveFifoCountEMDA(CAN_Type *base, flexcan_edma_handle_t *handle, size_t *count) -{ - assert(NULL != handle); - - status_t result = kStatus_Success; - - if (handle->rxFifoState == (uint32_t)KFLEXCAN_RxFifoIdle) - { - result = kStatus_NoTransferInProgress; - } - else - { - *count = handle->frameNum - - EDMA_GetRemainingMajorLoopCount(handle->rxFifoEdmaHandle->base, handle->rxFifoEdmaHandle->channel); - } - - return result; -} - -/*! - * brief Aborts the receive Legacy/Enhanced Rx FIFO process which used eDMA. - * - * This function aborts the receive Legacy/Enhanced Rx FIFO process which used eDMA. - * - * param base FlexCAN peripheral base address. - * param handle Pointer to flexcan_edma_handle_t structure. - */ -void FLEXCAN_TransferAbortReceiveFifoEDMA(CAN_Type *base, flexcan_edma_handle_t *handle) -{ - assert(NULL != handle->rxFifoEdmaHandle); - - /* Stop transfer. */ - EDMA_AbortTransfer(handle->rxFifoEdmaHandle); - - handle->rxFifoState = (uint8_t)KFLEXCAN_RxFifoIdle; -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - handle->framefd = NULL; -#endif - handle->frameNum = 0U; - /* Disable FlexCAN Legacy/Enhanced Rx FIFO EDMA. */ - FLEXCAN_EnableRxFifoDMA(base, false); -} - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * brief Receives the CAN FD Message from the Enhanced Rx FIFO using eDMA. - * - * This function receives the CAN FD Message using eDMA. This is a non-blocking function, which returns - * right away. After the CAN Message is received, the receive callback function is called. - * - * param base FlexCAN peripheral base address. - * param handle Pointer to flexcan_edma_handle_t structure. - * param pFifoXfer FlexCAN Rx FIFO EDMA transfer structure, see #flexcan_fifo_transfer_t. - * retval kStatus_Success if succeed, others failed. - * retval kStatus_FLEXCAN_RxFifoBusy Previous transfer ongoing. - * retval kStatus_InvalidArgument The watermark configuration is invalid, the watermark need be set to - 1 to do successfully EDMA transfer with this API. - */ -status_t FLEXCAN_TransferReceiveEnhancedFifoEDMA(CAN_Type *base, - flexcan_edma_handle_t *handle, - flexcan_fifo_transfer_t *pFifoXfer) -{ - assert(NULL != handle->rxFifoEdmaHandle); - assert(NULL != pFifoXfer->framefd); - - edma_transfer_config_t dmaXferConfig; - edma_minor_offset_config_t dmaMinorOffsetConfig; - status_t status; - flexcan_fd_frame_t *fifoAddr = (flexcan_fd_frame_t *)E_RX_FIFO(base); - uint32_t perReadWords = ((base->ERFCR & CAN_ERFCR_DMALW_MASK) >> CAN_ERFCR_DMALW_SHIFT) + 1U; - uint32_t watermark = ((base->ERFCR & CAN_ERFCR_ERFWM_MASK) >> CAN_ERFCR_ERFWM_SHIFT) + 1U; - - /* If previous Rx FIFO receive not finished. */ - if ((uint8_t)KFLEXCAN_RxFifoBusy == handle->rxFifoState) - { - status = kStatus_FLEXCAN_RxFifoBusy; - } - else - { - handle->frameNum = pFifoXfer->frameNum; - handle->framefd = pFifoXfer->framefd; - /*!< To reduce the complexity of DMA software configuration, need to set watermark to 1 to make that each DMA - request read once Rx FIFO. Because a DMA transfer cannot be dynamically changed, Number of words read per - transfer (ERFCR[DMALW] + 1) should be programmed so that the Enhanced Rx FIFO element can store the largest - CAN message present on the CAN bus. */ - if ((watermark != 1U) || ((sizeof(uint32_t) * perReadWords) != sizeof(flexcan_fd_frame_t))) - { - return kStatus_InvalidArgument; - } - - /* Prepare transfer. */ - EDMA_PrepareTransfer( - &dmaXferConfig, (void *)fifoAddr, sizeof(uint32_t), (void *)pFifoXfer->framefd, sizeof(uint32_t), - sizeof(uint32_t) * perReadWords, /* minor loop bytes : 4* perReadWords */ - sizeof(uint32_t) * perReadWords * handle->frameNum, /* major loop counts : handle->frameNum */ - kEDMA_MemoryToMemory); - /* Submit configuration. */ - (void)EDMA_SubmitTransfer(handle->rxFifoEdmaHandle, &dmaXferConfig); - - dmaMinorOffsetConfig.enableDestMinorOffset = false; - dmaMinorOffsetConfig.enableSrcMinorOffset = true; - dmaMinorOffsetConfig.minorOffset = 128U - sizeof(uint32_t) * perReadWords; - EDMA_SetMinorOffsetConfig(handle->rxFifoEdmaHandle->base, handle->rxFifoEdmaHandle->channel, - &dmaMinorOffsetConfig); - - EDMA_SetModulo(handle->rxFifoEdmaHandle->base, handle->rxFifoEdmaHandle->channel, kEDMA_Modulo128bytes, - kEDMA_ModuloDisable); - - handle->rxFifoState = (uint8_t)KFLEXCAN_RxFifoBusy; - - /* Enable FlexCAN Rx FIFO EDMA. */ - FLEXCAN_EnableRxFifoDMA(base, true); - /* Start transfer. */ - EDMA_StartTransfer(handle->rxFifoEdmaHandle); - - status = kStatus_Success; - } - - return status; -} -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexcan_edma.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexcan_edma.h deleted file mode 100644 index 90d78ef6690..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexcan_edma.h +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_FLEXCAN_EDMA_H_ -#define FSL_FLEXCAN_EDMA_H_ - -#include "fsl_flexcan.h" -#include "fsl_edma.h" - -/*! - * @addtogroup flexcan_edma_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief FlexCAN EDMA driver version. */ -#define FSL_FLEXCAN_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 11, 3)) -/*! @} */ - -/* Forward declaration of the handle typedef. */ -typedef struct _flexcan_edma_handle flexcan_edma_handle_t; - -/*! @brief FlexCAN transfer callback function. */ -typedef void (*flexcan_edma_transfer_callback_t)(CAN_Type *base, - flexcan_edma_handle_t *handle, - status_t status, - void *userData); - -/*! - * @brief FlexCAN eDMA handle - */ -struct _flexcan_edma_handle -{ - flexcan_edma_transfer_callback_t callback; /*!< Callback function. */ - void *userData; /*!< FlexCAN callback function parameter.*/ - edma_handle_t *rxFifoEdmaHandle; /*!< The EDMA handler for Rx FIFO. */ - volatile uint8_t rxFifoState; /*!< Rx FIFO transfer state. */ - size_t frameNum; /*!< The number of messages that need to be received. */ -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) - flexcan_fd_frame_t *framefd; /*!< Point to the buffer of CAN Message to be received from Enhanced Rx FIFO. */ -#endif -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name eDMA transactional - * @{ - */ - -/*! - * @brief Initializes the FlexCAN handle, which is used in transactional functions. - * - * @param base FlexCAN peripheral base address. - * @param handle Pointer to flexcan_edma_handle_t structure. - * @param callback The callback function. - * @param userData The parameter of the callback function. - * @param rxFifoEdmaHandle User-requested DMA handle for Rx FIFO DMA transfer. - */ -void FLEXCAN_TransferCreateHandleEDMA(CAN_Type *base, - flexcan_edma_handle_t *handle, - flexcan_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *rxFifoEdmaHandle); - -/*! - * @brief Prepares the eDMA transfer configuration for FLEXCAN Legacy RX FIFO. - * - * This function prepares the eDMA transfer configuration structure according to FLEXCAN Legacy RX FIFO. - * - * @param base FlexCAN peripheral base address. - * @param pFifoXfer FlexCAN Rx FIFO EDMA transfer structure, see #flexcan_fifo_transfer_t. - * @param pEdmaConfig The user configuration structure of type edma_transfer_t. - * - */ -void FLEXCAN_PrepareTransfConfiguration(CAN_Type *base, - flexcan_fifo_transfer_t *pFifoXfer, - edma_transfer_config_t *pEdmaConfig); - -/*! - * @brief Start Transfer Data from the FLEXCAN Legacy Rx FIFO using eDMA. - * - * This function to Update edma transfer confiugration and Start eDMA transfer - * - * @param base FlexCAN peripheral base address. - * @param handle Pointer to flexcan_edma_handle_t structure. - * @param pEdmaConfig The user configuration structure of type edma_transfer_t. - * @retval kStatus_Success if succeed, others failed. - * @retval kStatus_FLEXCAN_RxFifoBusy Previous transfer ongoing. - */ -status_t FLEXCAN_StartTransferDatafromRxFIFO(CAN_Type *base, - flexcan_edma_handle_t *handle, - edma_transfer_config_t *pEdmaConfig); - -/*! - * @brief Receives the CAN Message from the Legacy Rx FIFO using eDMA. - * - * This function receives the CAN Message using eDMA. This is a non-blocking function, which returns - * right away. After the CAN Message is received, the receive callback function is called. - * - * @param base FlexCAN peripheral base address. - * @param handle Pointer to flexcan_edma_handle_t structure. - * @param pFifoXfer FlexCAN Rx FIFO EDMA transfer structure, see #flexcan_fifo_transfer_t. - * @retval kStatus_Success if succeed, others failed. - * @retval kStatus_FLEXCAN_RxFifoBusy Previous transfer ongoing. - */ -status_t FLEXCAN_TransferReceiveFifoEDMA(CAN_Type *base, - flexcan_edma_handle_t *handle, - flexcan_fifo_transfer_t *pFifoXfer); -/*! - * @brief Gets the Legacy Rx Fifo transfer status during a interrupt non-blocking receive. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param count Number of CAN messages receive so far by the non-blocking transaction. - * @retval kStatus_InvalidArgument count is Invalid. - * @retval kStatus_Success Successfully return the count. - */ - -status_t FLEXCAN_TransferGetReceiveFifoCountEMDA(CAN_Type *base, flexcan_edma_handle_t *handle, size_t *count); -/*! - * @brief Aborts the receive Legacy/Enhanced Rx FIFO process which used eDMA. - * - * This function aborts the receive Legacy/Enhanced Rx FIFO process which used eDMA. - * - * @param base FlexCAN peripheral base address. - * @param handle Pointer to flexcan_edma_handle_t structure. - */ -void FLEXCAN_TransferAbortReceiveFifoEDMA(CAN_Type *base, flexcan_edma_handle_t *handle); - -#if (defined(FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) && FSL_FEATURE_FLEXCAN_HAS_ENHANCED_RX_FIFO) -/*! - * @brief Receives the CAN FD Message from the Enhanced Rx FIFO using eDMA. - * - * This function receives the CAN FD Message using eDMA. This is a non-blocking function, which returns - * right away. After the CAN Message is received, the receive callback function is called. - * - * @param base FlexCAN peripheral base address. - * @param handle Pointer to flexcan_edma_handle_t structure. - * @param pFifoXfer FlexCAN Rx FIFO EDMA transfer structure, see #flexcan_fifo_transfer_t. - * @retval kStatus_Success if succeed, others failed. - * @retval kStatus_FLEXCAN_RxFifoBusy Previous transfer ongoing. - */ -status_t FLEXCAN_TransferReceiveEnhancedFifoEDMA(CAN_Type *base, - flexcan_edma_handle_t *handle, - flexcan_fifo_transfer_t *pFifoXfer); -/*! - * @brief Gets the Enhanced Rx Fifo transfer status during a interrupt non-blocking receive. - * - * @param base FlexCAN peripheral base address. - * @param handle FlexCAN handle pointer. - * @param count Number of CAN messages receive so far by the non-blocking transaction. - * @retval kStatus_InvalidArgument count is Invalid. - * @retval kStatus_Success Successfully return the count. - */ - -static inline status_t FLEXCAN_TransferGetReceiveEnhancedFifoCountEMDA(CAN_Type *base, - flexcan_edma_handle_t *handle, - size_t *count) -{ - return FLEXCAN_TransferGetReceiveFifoCountEMDA(base, handle, count); -} -#endif - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_FLEXCAN_EDMA_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio.c deleted file mode 100644 index 52741f2a4de..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio.c +++ /dev/null @@ -1,511 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio" -#endif - -/*< @brief user configurable flexio handle count. */ -#define FLEXIO_HANDLE_COUNT 2 - -#if defined(FLEXIO_RSTS) -#define FLEXIO_RESETS_ARRAY FLEXIO_RSTS -#elif defined(FLEXIO_RSTS_N) -#define FLEXIO_RESETS_ARRAY FLEXIO_RSTS_N -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to flexio bases for each instance. */ -FLEXIO_Type *const s_flexioBases[] = FLEXIO_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to flexio clocks for each instance. */ -const clock_ip_name_t s_flexioClocks[] = FLEXIO_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/*< @brief pointer to array of FLEXIO handle. */ -static void *s_flexioHandle[FLEXIO_HANDLE_COUNT]; - -/*< @brief pointer to array of FLEXIO IP types. */ -static void *s_flexioType[FLEXIO_HANDLE_COUNT]; - -/*< @brief pointer to array of FLEXIO Isr. */ -static flexio_isr_t s_flexioIsr[FLEXIO_HANDLE_COUNT]; - -/* FlexIO common IRQ Handler. */ -static void FLEXIO_CommonIRQHandler(void); - -#if defined(FLEXIO_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_flexioResets[] = FLEXIO_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Codes - ******************************************************************************/ - -/*! - * brief Get instance number for FLEXIO module. - * - * param base FLEXIO peripheral base address. - */ -uint32_t FLEXIO_GetInstance(FLEXIO_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_flexioBases); instance++) - { - if (s_flexioBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_flexioBases)); - - return instance; -} - -/*! - * brief Configures the FlexIO with a FlexIO configuration. The configuration structure - * can be filled by the user or be set with default values by FLEXIO_GetDefaultConfig(). - * - * Example - code - flexio_config_t config = { - .enableFlexio = true, - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false - }; - FLEXIO_Configure(base, &config); - endcode - * - * param base FlexIO peripheral base address - * param userConfig pointer to flexio_config_t structure -*/ -void FLEXIO_Init(FLEXIO_Type *base, const flexio_config_t *userConfig) -{ - uint32_t ctrlReg = 0; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_EnableClock(s_flexioClocks[FLEXIO_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(FLEXIO_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_flexioResets[FLEXIO_GetInstance(base)]); -#endif - - FLEXIO_Reset(base); - - ctrlReg = base->CTRL; - ctrlReg &= ~(FLEXIO_CTRL_DOZEN_MASK | FLEXIO_CTRL_DBGE_MASK | FLEXIO_CTRL_FASTACC_MASK | FLEXIO_CTRL_FLEXEN_MASK); - ctrlReg |= (FLEXIO_CTRL_DBGE(userConfig->enableInDebug) | FLEXIO_CTRL_FASTACC(userConfig->enableFastAccess) | - FLEXIO_CTRL_FLEXEN(userConfig->enableFlexio)); - if (!userConfig->enableInDoze) - { - ctrlReg |= FLEXIO_CTRL_DOZEN_MASK; - } - - base->CTRL = ctrlReg; -} - -/*! - * brief Gates the FlexIO clock. Call this API to stop the FlexIO clock. - * - * note After calling this API, call the FLEXO_Init to use the FlexIO module. - * - * param base FlexIO peripheral base address - */ -void FLEXIO_Deinit(FLEXIO_Type *base) -{ - FLEXIO_Enable(base, false); -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_DisableClock(s_flexioClocks[FLEXIO_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Gets the default configuration to configure the FlexIO module. The configuration - * can used directly to call the FLEXIO_Configure(). - * - * Example: - code - flexio_config_t config; - FLEXIO_GetDefaultConfig(&config); - endcode - * - * param userConfig pointer to flexio_config_t structure -*/ -void FLEXIO_GetDefaultConfig(flexio_config_t *userConfig) -{ - assert(userConfig != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(userConfig, 0, sizeof(*userConfig)); - - userConfig->enableFlexio = true; - userConfig->enableInDoze = false; - userConfig->enableInDebug = true; - userConfig->enableFastAccess = false; -} - -/*! - * brief Resets the FlexIO module. - * - * param base FlexIO peripheral base address - */ -void FLEXIO_Reset(FLEXIO_Type *base) -{ - /*do software reset, software reset operation affect all other FLEXIO registers except CTRL*/ - base->CTRL |= FLEXIO_CTRL_SWRST_MASK; - base->CTRL = 0; -} - -/*! - * brief Gets the shifter buffer address for the DMA transfer usage. - * - * param base FlexIO peripheral base address - * param type Shifter type of flexio_shifter_buffer_type_t - * param index Shifter index - * return Corresponding shifter buffer index - */ -uint32_t FLEXIO_GetShifterBufferAddress(FLEXIO_Type *base, flexio_shifter_buffer_type_t type, uint8_t index) -{ - assert(index < FLEXIO_SHIFTBUF_COUNT); - - uint32_t address = 0; - - switch (type) - { - case kFLEXIO_ShifterBuffer: - address = (uint32_t) & (base->SHIFTBUF[index]); - break; - - case kFLEXIO_ShifterBufferBitSwapped: - address = (uint32_t) & (base->SHIFTBUFBIS[index]); - break; - - case kFLEXIO_ShifterBufferByteSwapped: - address = (uint32_t) & (base->SHIFTBUFBYS[index]); - break; - - case kFLEXIO_ShifterBufferBitByteSwapped: - address = (uint32_t) & (base->SHIFTBUFBBS[index]); - break; - -#if defined(FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_BYTE_SWAP) && FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_BYTE_SWAP - case kFLEXIO_ShifterBufferNibbleByteSwapped: - address = (uint32_t) & (base->SHIFTBUFNBS[index]); - break; - -#endif -#if defined(FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_HALF_WORD_SWAP) && FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_HALF_WORD_SWAP - case kFLEXIO_ShifterBufferHalfWordSwapped: - address = (uint32_t) & (base->SHIFTBUFHWS[index]); - break; - -#endif -#if defined(FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_SWAP) && FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_SWAP - case kFLEXIO_ShifterBufferNibbleSwapped: - address = (uint32_t) & (base->SHIFTBUFNIS[index]); - break; - -#endif - default: - address = (uint32_t) & (base->SHIFTBUF[index]); - break; - } - return address; -} - -/*! - * brief Configures the shifter with the shifter configuration. The configuration structure - * covers both the SHIFTCTL and SHIFTCFG registers. To configure the shifter to the proper - * mode, select which timer controls the shifter to shift, whether to generate start bit/stop - * bit, and the polarity of start bit and stop bit. - * - * Example - code - flexio_shifter_config_t config = { - .timerSelect = 0, - .timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive, - .pinConfig = kFLEXIO_PinConfigOpenDrainOrBidirection, - .pinPolarity = kFLEXIO_PinActiveLow, - .shifterMode = kFLEXIO_ShifterModeTransmit, - .inputSource = kFLEXIO_ShifterInputFromPin, - .shifterStop = kFLEXIO_ShifterStopBitHigh, - .shifterStart = kFLEXIO_ShifterStartBitLow - }; - FLEXIO_SetShifterConfig(base, &config); - endcode - * - * param base FlexIO peripheral base address - * param index Shifter index - * param shifterConfig Pointer to flexio_shifter_config_t structure -*/ -void FLEXIO_SetShifterConfig(FLEXIO_Type *base, uint8_t index, const flexio_shifter_config_t *shifterConfig) -{ - base->SHIFTCFG[index] = FLEXIO_SHIFTCFG_INSRC(shifterConfig->inputSource) -#if FSL_FEATURE_FLEXIO_HAS_PARALLEL_WIDTH - | FLEXIO_SHIFTCFG_PWIDTH(shifterConfig->parallelWidth) -#endif /* FSL_FEATURE_FLEXIO_HAS_PARALLEL_WIDTH */ - | FLEXIO_SHIFTCFG_SSTOP(shifterConfig->shifterStop) | - FLEXIO_SHIFTCFG_SSTART(shifterConfig->shifterStart); - - base->SHIFTCTL[index] = - FLEXIO_SHIFTCTL_TIMSEL(shifterConfig->timerSelect) | FLEXIO_SHIFTCTL_TIMPOL(shifterConfig->timerPolarity) | - FLEXIO_SHIFTCTL_PINCFG(shifterConfig->pinConfig) | FLEXIO_SHIFTCTL_PINSEL(shifterConfig->pinSelect) | - FLEXIO_SHIFTCTL_PINPOL(shifterConfig->pinPolarity) | FLEXIO_SHIFTCTL_SMOD(shifterConfig->shifterMode); -} - -/*! - * brief Configures the timer with the timer configuration. The configuration structure - * covers both the TIMCTL and TIMCFG registers. To configure the timer to the proper - * mode, select trigger source for timer and the timer pin output and the timing for timer. - * - * Example - code - flexio_timer_config_t config = { - .triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(0), - .triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow, - .triggerSource = kFLEXIO_TimerTriggerSourceInternal, - .pinConfig = kFLEXIO_PinConfigOpenDrainOrBidirection, - .pinSelect = 0, - .pinPolarity = kFLEXIO_PinActiveHigh, - .timerMode = kFLEXIO_TimerModeDual8BitBaudBit, - .timerOutput = kFLEXIO_TimerOutputZeroNotAffectedByReset, - .timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput, - .timerReset = kFLEXIO_TimerResetOnTimerPinEqualToTimerOutput, - .timerDisable = kFLEXIO_TimerDisableOnTimerCompare, - .timerEnable = kFLEXIO_TimerEnableOnTriggerHigh, - .timerStop = kFLEXIO_TimerStopBitEnableOnTimerDisable, - .timerStart = kFLEXIO_TimerStartBitEnabled - }; - FLEXIO_SetTimerConfig(base, &config); - endcode - * - * param base FlexIO peripheral base address - * param index Timer index - * param timerConfig Pointer to the flexio_timer_config_t structure -*/ -void FLEXIO_SetTimerConfig(FLEXIO_Type *base, uint8_t index, const flexio_timer_config_t *timerConfig) -{ - base->TIMCFG[index] = - FLEXIO_TIMCFG_TIMOUT(timerConfig->timerOutput) | FLEXIO_TIMCFG_TIMDEC(timerConfig->timerDecrement) | - FLEXIO_TIMCFG_TIMRST(timerConfig->timerReset) | FLEXIO_TIMCFG_TIMDIS(timerConfig->timerDisable) | - FLEXIO_TIMCFG_TIMENA(timerConfig->timerEnable) | FLEXIO_TIMCFG_TSTOP(timerConfig->timerStop) | - FLEXIO_TIMCFG_TSTART(timerConfig->timerStart); - - base->TIMCMP[index] = FLEXIO_TIMCMP_CMP(timerConfig->timerCompare); - - base->TIMCTL[index] = FLEXIO_TIMCTL_TRGSEL(timerConfig->triggerSelect) | - FLEXIO_TIMCTL_TRGPOL(timerConfig->triggerPolarity) | - FLEXIO_TIMCTL_TRGSRC(timerConfig->triggerSource) | - FLEXIO_TIMCTL_PINCFG(timerConfig->pinConfig) | FLEXIO_TIMCTL_PINSEL(timerConfig->pinSelect) | - FLEXIO_TIMCTL_PINPOL(timerConfig->pinPolarity) | FLEXIO_TIMCTL_TIMOD(timerConfig->timerMode); -} - -/*! - * brief Registers the handle and the interrupt handler for the FlexIO-simulated peripheral. - * - * param base Pointer to the FlexIO simulated peripheral type. - * param handle Pointer to the handler for FlexIO simulated peripheral. - * param isr FlexIO simulated peripheral interrupt handler. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_RegisterHandleIRQ(void *base, void *handle, flexio_isr_t isr) -{ - assert(base != NULL); - assert(handle != NULL); - assert(isr != NULL); - - uint8_t index; - - /* Find the an empty handle pointer to store the handle. */ - for (index = 0U; index < (uint8_t)FLEXIO_HANDLE_COUNT; index++) - { - if (s_flexioHandle[index] == NULL) - { - /* Register FLEXIO simulated driver base, handle and isr. */ - s_flexioType[index] = base; - s_flexioHandle[index] = handle; - s_flexioIsr[index] = isr; - break; - } - } - - if (index == (uint8_t)FLEXIO_HANDLE_COUNT) - { - return kStatus_OutOfRange; - } - else - { - return kStatus_Success; - } -} - -/*! - * brief Unregisters the handle and the interrupt handler for the FlexIO-simulated peripheral. - * - * param base Pointer to the FlexIO simulated peripheral type. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_UnregisterHandleIRQ(void *base) -{ - assert(base != NULL); - - uint8_t index; - - /* Find the index from base address mappings. */ - for (index = 0U; index < (uint8_t)FLEXIO_HANDLE_COUNT; index++) - { - if (s_flexioType[index] == base) - { - /* Unregister FLEXIO simulated driver handle and isr. */ - s_flexioType[index] = NULL; - s_flexioHandle[index] = NULL; - s_flexioIsr[index] = NULL; - break; - } - } - - if (index == (uint8_t)FLEXIO_HANDLE_COUNT) - { - return kStatus_OutOfRange; - } - else - { - return kStatus_Success; - } -} - -static void FLEXIO_CommonIRQHandler(void) -{ - uint8_t index; - - for (index = 0U; index < (uint8_t)FLEXIO_HANDLE_COUNT; index++) - { - if (s_flexioHandle[index] != NULL) - { - s_flexioIsr[index](s_flexioType[index], s_flexioHandle[index]); - } - } - SDK_ISR_EXIT_BARRIER; -} - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER) && FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER -/*! - * brief Configure a FLEXIO pin used by the board. - * - * To Config the FLEXIO PIN, define a pin configuration, as either input or output, in the user file. - * Then, call the FLEXIO_SetPinConfig() function. - * - * This is an example to define an input pin or an output pin configuration. - * code - * Define a digital input pin configuration, - * flexio_gpio_config_t config = - * { - * kFLEXIO_DigitalInput, - * 0U, - * kFLEXIO_FlagRisingEdgeEnable | kFLEXIO_InputInterruptEnable, - * } - * Define a digital output pin configuration, - * flexio_gpio_config_t config = - * { - * kFLEXIO_DigitalOutput, - * 0U, - * 0U - * } - * endcode - * param base FlexIO peripheral base address - * param pin FLEXIO pin number. - * param config FLEXIO pin configuration pointer. - */ -void FLEXIO_SetPinConfig(FLEXIO_Type *base, uint32_t pin, flexio_gpio_config_t *config) -{ - assert(NULL != config); - IRQn_Type flexio_irqs[] = FLEXIO_IRQS; - - if (config->pinDirection == kFLEXIO_DigitalInput) - { - base->PINOUTE &= ~(1UL << pin); - if (0U != (config->inputConfig & (uint8_t)kFLEXIO_InputInterruptEnable)) - { - base->PINIEN = 1UL << pin; - /* Clear pending NVIC IRQ before enable NVIC IRQ. */ - NVIC_ClearPendingIRQ(flexio_irqs[FLEXIO_GetInstance(base)]); - /* Enable interrupt in NVIC. */ - (void)EnableIRQ(flexio_irqs[FLEXIO_GetInstance(base)]); - } - - if (0U != (config->inputConfig & (uint8_t)kFLEXIO_FlagRisingEdgeEnable)) - { - base->PINREN = 1UL << pin; - } - - if (0U != (config->inputConfig & (uint8_t)kFLEXIO_FlagFallingEdgeEnable)) - { - base->PINFEN = 1UL << pin; - } - } - else - { - FLEXIO_EnablePinOutput(base, pin); - FLEXIO_PinWrite(base, pin, config->outputLogic); - } -} -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER*/ - -void FLEXIO_DriverIRQHandler(void); -void FLEXIO_DriverIRQHandler(void) -{ - FLEXIO_CommonIRQHandler(); -} - -void FLEXIO0_DriverIRQHandler(void); -void FLEXIO0_DriverIRQHandler(void) -{ - FLEXIO_CommonIRQHandler(); -} - -void FLEXIO1_DriverIRQHandler(void); -void FLEXIO1_DriverIRQHandler(void) -{ - FLEXIO_CommonIRQHandler(); -} - -void UART2_FLEXIO_DriverIRQHandler(void); -void UART2_FLEXIO_DriverIRQHandler(void) -{ - FLEXIO_CommonIRQHandler(); -} - -void FLEXIO2_DriverIRQHandler(void); -void FLEXIO2_DriverIRQHandler(void) -{ - FLEXIO_CommonIRQHandler(); -} - -void FLEXIO3_DriverIRQHandler(void); -void FLEXIO3_DriverIRQHandler(void) -{ - FLEXIO_CommonIRQHandler(); -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio.h deleted file mode 100644 index 1e1bc6278d0..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio.h +++ /dev/null @@ -1,917 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020, 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_FLEXIO_H_ -#define FSL_FLEXIO_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup flexio_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief FlexIO driver version. */ -#define FSL_FLEXIO_DRIVER_VERSION (MAKE_VERSION(2, 2, 2)) -/*! @} */ - -/*! @brief Calculate FlexIO timer trigger.*/ -#define FLEXIO_TIMER_TRIGGER_SEL_PININPUT(x) ((uint32_t)(x) << 1U) -#define FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(x) (((uint32_t)(x) << 2U) | 0x1U) -#define FLEXIO_TIMER_TRIGGER_SEL_TIMn(x) (((uint32_t)(x) << 2U) | 0x3U) - -/*! @brief Define time of timer trigger polarity.*/ -typedef enum _flexio_timer_trigger_polarity -{ - kFLEXIO_TimerTriggerPolarityActiveHigh = 0x0U, /*!< Active high. */ - kFLEXIO_TimerTriggerPolarityActiveLow = 0x1U, /*!< Active low. */ -} flexio_timer_trigger_polarity_t; - -/*! @brief Define type of timer trigger source.*/ -typedef enum _flexio_timer_trigger_source -{ - kFLEXIO_TimerTriggerSourceExternal = 0x0U, /*!< External trigger selected. */ - kFLEXIO_TimerTriggerSourceInternal = 0x1U, /*!< Internal trigger selected. */ -} flexio_timer_trigger_source_t; - -/*! @brief Define type of timer/shifter pin configuration.*/ -typedef enum _flexio_pin_config -{ - kFLEXIO_PinConfigOutputDisabled = 0x0U, /*!< Pin output disabled. */ - kFLEXIO_PinConfigOpenDrainOrBidirection = 0x1U, /*!< Pin open drain or bidirectional output enable. */ - kFLEXIO_PinConfigBidirectionOutputData = 0x2U, /*!< Pin bidirectional output data. */ - kFLEXIO_PinConfigOutput = 0x3U, /*!< Pin output. */ -} flexio_pin_config_t; - -/*! @brief Definition of pin polarity.*/ -typedef enum _flexio_pin_polarity -{ - kFLEXIO_PinActiveHigh = 0x0U, /*!< Active high. */ - kFLEXIO_PinActiveLow = 0x1U, /*!< Active low. */ -} flexio_pin_polarity_t; - -/*! @brief Define type of timer work mode.*/ -typedef enum _flexio_timer_mode -{ - kFLEXIO_TimerModeDisabled = 0x0U, /*!< Timer Disabled. */ - kFLEXIO_TimerModeDual8BitBaudBit = 0x1U, /*!< Dual 8-bit counters baud/bit mode. */ - kFLEXIO_TimerModeDual8BitPWM = 0x2U, /*!< Dual 8-bit counters PWM mode. */ - kFLEXIO_TimerModeSingle16Bit = 0x3U, /*!< Single 16-bit counter mode. */ -} flexio_timer_mode_t; - -/*! @brief Define type of timer initial output or timer reset condition.*/ -typedef enum _flexio_timer_output -{ - kFLEXIO_TimerOutputOneNotAffectedByReset = 0x0U, /*!< Logic one when enabled and is not affected by timer - reset. */ - kFLEXIO_TimerOutputZeroNotAffectedByReset = 0x1U, /*!< Logic zero when enabled and is not affected by timer - reset. */ - kFLEXIO_TimerOutputOneAffectedByReset = 0x2U, /*!< Logic one when enabled and on timer reset. */ - kFLEXIO_TimerOutputZeroAffectedByReset = 0x3U, /*!< Logic zero when enabled and on timer reset. */ -} flexio_timer_output_t; - -/*! @brief Define type of timer decrement.*/ -typedef enum _flexio_timer_decrement_source -{ - kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput = 0x0U, /*!< Decrement counter on FlexIO clock, Shift clock - equals Timer output. */ - kFLEXIO_TimerDecSrcOnTriggerInputShiftTimerOutput, /*!< Decrement counter on Trigger input (both edges), - Shift clock equals Timer output. */ - kFLEXIO_TimerDecSrcOnPinInputShiftPinInput, /*!< Decrement counter on Pin input (both edges), - Shift clock equals Pin input. */ - kFLEXIO_TimerDecSrcOnTriggerInputShiftTriggerInput /*!< Decrement counter on Trigger input (both edges), - Shift clock equals Trigger input. */ -#if (defined(FSL_FEATURE_FLEXIO_TIMCFG_TIMDCE_FIELD_WIDTH) && (FSL_FEATURE_FLEXIO_TIMCFG_TIMDCE_FIELD_WIDTH == 3)) - , - kFLEXIO_TimerDecSrcDiv16OnFlexIOClockShiftTimerOutput, /*!< Decrement counter on FlexIO clock divided by 16, - Shift clock equals Timer output. */ - kFLEXIO_TimerDecSrcDiv256OnFlexIOClockShiftTimerOutput, /*!< Decrement counter on FlexIO clock divided by 256, - Shift clock equals Timer output. */ - kFLEXIO_TimerRisSrcOnPinInputShiftPinInput, /*!< Decrement counter on Pin input (rising edges), - Shift clock equals Pin input. */ - kFLEXIO_TimerRisSrcOnTriggerInputShiftTriggerInput /*!< Decrement counter on Trigger input (rising edges), Shift - clock equals Trigger input. */ -#endif /* FSL_FEATURE_FLEXIO_TIMCFG_TIMDCE_FIELD_WIDTH */ -} flexio_timer_decrement_source_t; - -/*! @brief Define type of timer reset condition.*/ -typedef enum _flexio_timer_reset_condition -{ - kFLEXIO_TimerResetNever = 0x0U, /*!< Timer never reset. */ - kFLEXIO_TimerResetOnTimerPinEqualToTimerOutput = 0x2U, /*!< Timer reset on Timer Pin equal to Timer Output. */ - kFLEXIO_TimerResetOnTimerTriggerEqualToTimerOutput = 0x3U, /*!< Timer reset on Timer Trigger equal to - Timer Output. */ - kFLEXIO_TimerResetOnTimerPinRisingEdge = 0x4U, /*!< Timer reset on Timer Pin rising edge. */ - kFLEXIO_TimerResetOnTimerTriggerRisingEdge = 0x6U, /*!< Timer reset on Trigger rising edge. */ - kFLEXIO_TimerResetOnTimerTriggerBothEdge = 0x7U, /*!< Timer reset on Trigger rising or falling edge. */ -} flexio_timer_reset_condition_t; - -/*! @brief Define type of timer disable condition.*/ -typedef enum _flexio_timer_disable_condition -{ - kFLEXIO_TimerDisableNever = 0x0U, /*!< Timer never disabled. */ - kFLEXIO_TimerDisableOnPreTimerDisable = 0x1U, /*!< Timer disabled on Timer N-1 disable. */ - kFLEXIO_TimerDisableOnTimerCompare = 0x2U, /*!< Timer disabled on Timer compare. */ - kFLEXIO_TimerDisableOnTimerCompareTriggerLow = 0x3U, /*!< Timer disabled on Timer compare and Trigger Low. */ - kFLEXIO_TimerDisableOnPinBothEdge = 0x4U, /*!< Timer disabled on Pin rising or falling edge. */ - kFLEXIO_TimerDisableOnPinBothEdgeTriggerHigh = 0x5U, /*!< Timer disabled on Pin rising or falling edge provided - Trigger is high. */ - kFLEXIO_TimerDisableOnTriggerFallingEdge = 0x6U, /*!< Timer disabled on Trigger falling edge. */ -} flexio_timer_disable_condition_t; - -/*! @brief Define type of timer enable condition.*/ -typedef enum _flexio_timer_enable_condition -{ - kFLEXIO_TimerEnabledAlways = 0x0U, /*!< Timer always enabled. */ - kFLEXIO_TimerEnableOnPrevTimerEnable = 0x1U, /*!< Timer enabled on Timer N-1 enable. */ - kFLEXIO_TimerEnableOnTriggerHigh = 0x2U, /*!< Timer enabled on Trigger high. */ - kFLEXIO_TimerEnableOnTriggerHighPinHigh = 0x3U, /*!< Timer enabled on Trigger high and Pin high. */ - kFLEXIO_TimerEnableOnPinRisingEdge = 0x4U, /*!< Timer enabled on Pin rising edge. */ - kFLEXIO_TimerEnableOnPinRisingEdgeTriggerHigh = 0x5U, /*!< Timer enabled on Pin rising edge and Trigger high. */ - kFLEXIO_TimerEnableOnTriggerRisingEdge = 0x6U, /*!< Timer enabled on Trigger rising edge. */ - kFLEXIO_TimerEnableOnTriggerBothEdge = 0x7U, /*!< Timer enabled on Trigger rising or falling edge. */ -} flexio_timer_enable_condition_t; - -/*! @brief Define type of timer stop bit generate condition.*/ -typedef enum _flexio_timer_stop_bit_condition -{ - kFLEXIO_TimerStopBitDisabled = 0x0U, /*!< Stop bit disabled. */ - kFLEXIO_TimerStopBitEnableOnTimerCompare = 0x1U, /*!< Stop bit is enabled on timer compare. */ - kFLEXIO_TimerStopBitEnableOnTimerDisable = 0x2U, /*!< Stop bit is enabled on timer disable. */ - kFLEXIO_TimerStopBitEnableOnTimerCompareDisable = 0x3U, /*!< Stop bit is enabled on timer compare and timer - disable. */ -} flexio_timer_stop_bit_condition_t; - -/*! @brief Define type of timer start bit generate condition.*/ -typedef enum _flexio_timer_start_bit_condition -{ - kFLEXIO_TimerStartBitDisabled = 0x0U, /*!< Start bit disabled. */ - kFLEXIO_TimerStartBitEnabled = 0x1U, /*!< Start bit enabled. */ -} flexio_timer_start_bit_condition_t; - -/*! @brief FlexIO as PWM channel output state */ -typedef enum _flexio_timer_output_state -{ - kFLEXIO_PwmLow = 0, /*!< The output state of PWM channel is low */ - kFLEXIO_PwmHigh, /*!< The output state of PWM channel is high */ -} flexio_timer_output_state_t; - -/*! @brief Define type of timer polarity for shifter control. */ -typedef enum _flexio_shifter_timer_polarity -{ - kFLEXIO_ShifterTimerPolarityOnPositive = 0x0U, /*!< Shift on positive edge of shift clock. */ - kFLEXIO_ShifterTimerPolarityOnNegitive = 0x1U, /*!< Shift on negative edge of shift clock. */ -} flexio_shifter_timer_polarity_t; - -/*! @brief Define type of shifter working mode.*/ -typedef enum _flexio_shifter_mode -{ - kFLEXIO_ShifterDisabled = 0x0U, /*!< Shifter is disabled. */ - kFLEXIO_ShifterModeReceive = 0x1U, /*!< Receive mode. */ - kFLEXIO_ShifterModeTransmit = 0x2U, /*!< Transmit mode. */ - kFLEXIO_ShifterModeMatchStore = 0x4U, /*!< Match store mode. */ - kFLEXIO_ShifterModeMatchContinuous = 0x5U, /*!< Match continuous mode. */ -#if FSL_FEATURE_FLEXIO_HAS_STATE_MODE - kFLEXIO_ShifterModeState = 0x6U, /*!< SHIFTBUF contents are used for storing - programmable state attributes. */ -#endif /* FSL_FEATURE_FLEXIO_HAS_STATE_MODE */ -#if FSL_FEATURE_FLEXIO_HAS_LOGIC_MODE - kFLEXIO_ShifterModeLogic = 0x7U, /*!< SHIFTBUF contents are used for implementing - programmable logic look up table. */ -#endif /* FSL_FEATURE_FLEXIO_HAS_LOGIC_MODE */ -} flexio_shifter_mode_t; - -/*! @brief Define type of shifter input source.*/ -typedef enum _flexio_shifter_input_source -{ - kFLEXIO_ShifterInputFromPin = 0x0U, /*!< Shifter input from pin. */ - kFLEXIO_ShifterInputFromNextShifterOutput = 0x1U, /*!< Shifter input from Shifter N+1. */ -} flexio_shifter_input_source_t; - -/*! @brief Define of STOP bit configuration.*/ -typedef enum _flexio_shifter_stop_bit -{ - kFLEXIO_ShifterStopBitDisable = 0x0U, /*!< Disable shifter stop bit. */ - kFLEXIO_ShifterStopBitLow = 0x2U, /*!< Set shifter stop bit to logic low level. */ - kFLEXIO_ShifterStopBitHigh = 0x3U, /*!< Set shifter stop bit to logic high level. */ -} flexio_shifter_stop_bit_t; - -/*! @brief Define type of START bit configuration.*/ -typedef enum _flexio_shifter_start_bit -{ - kFLEXIO_ShifterStartBitDisabledLoadDataOnEnable = 0x0U, /*!< Disable shifter start bit, transmitter loads - data on enable. */ - kFLEXIO_ShifterStartBitDisabledLoadDataOnShift = 0x1U, /*!< Disable shifter start bit, transmitter loads - data on first shift. */ - kFLEXIO_ShifterStartBitLow = 0x2U, /*!< Set shifter start bit to logic low level. */ - kFLEXIO_ShifterStartBitHigh = 0x3U, /*!< Set shifter start bit to logic high level. */ -} flexio_shifter_start_bit_t; - -/*! @brief Define FlexIO shifter buffer type*/ -typedef enum _flexio_shifter_buffer_type -{ - kFLEXIO_ShifterBuffer = 0x0U, /*!< Shifter Buffer N Register. */ - kFLEXIO_ShifterBufferBitSwapped = 0x1U, /*!< Shifter Buffer N Bit Byte Swapped Register. */ - kFLEXIO_ShifterBufferByteSwapped = 0x2U, /*!< Shifter Buffer N Byte Swapped Register. */ - kFLEXIO_ShifterBufferBitByteSwapped = 0x3U, /*!< Shifter Buffer N Bit Swapped Register. */ -#if defined(FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_BYTE_SWAP) && FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_BYTE_SWAP - kFLEXIO_ShifterBufferNibbleByteSwapped = 0x4U, /*!< Shifter Buffer N Nibble Byte Swapped Register. */ -#endif /*FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_BYTE_SWAP*/ -#if defined(FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_HALF_WORD_SWAP) && FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_HALF_WORD_SWAP - kFLEXIO_ShifterBufferHalfWordSwapped = 0x5U, /*!< Shifter Buffer N Half Word Swapped Register. */ -#endif -#if defined(FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_SWAP) && FSL_FEATURE_FLEXIO_HAS_SHFT_BUFFER_NIBBLE_SWAP - kFLEXIO_ShifterBufferNibbleSwapped = 0x6U, /*!< Shifter Buffer N Nibble Swapped Register. */ -#endif -} flexio_shifter_buffer_type_t; - -/*! @brief Define FlexIO user configuration structure. */ -typedef struct _flexio_config_ -{ - bool enableFlexio; /*!< Enable/disable FlexIO module */ - bool enableInDoze; /*!< Enable/disable FlexIO operation in doze mode */ - bool enableInDebug; /*!< Enable/disable FlexIO operation in debug mode */ - bool enableFastAccess; /*!< Enable/disable fast access to FlexIO registers, fast access requires - the FlexIO clock to be at least twice the frequency of the bus clock. */ -} flexio_config_t; - -/*! @brief Define FlexIO timer configuration structure. */ -typedef struct _flexio_timer_config -{ - /* Trigger. */ - uint32_t triggerSelect; /*!< The internal trigger selection number using MACROs. */ - flexio_timer_trigger_polarity_t triggerPolarity; /*!< Trigger Polarity. */ - flexio_timer_trigger_source_t triggerSource; /*!< Trigger Source, internal (see 'trgsel') or external. */ - /* Pin. */ - flexio_pin_config_t pinConfig; /*!< Timer Pin Configuration. */ - uint32_t pinSelect; /*!< Timer Pin number Select. */ - flexio_pin_polarity_t pinPolarity; /*!< Timer Pin Polarity. */ - /* Timer. */ - flexio_timer_mode_t timerMode; /*!< Timer work Mode. */ - flexio_timer_output_t timerOutput; /*!< Configures the initial state of the Timer Output and - whether it is affected by the Timer reset. */ - flexio_timer_decrement_source_t timerDecrement; /*!< Configures the source of the Timer decrement and the - source of the Shift clock. */ - flexio_timer_reset_condition_t timerReset; /*!< Configures the condition that causes the timer counter - (and optionally the timer output) to be reset. */ - flexio_timer_disable_condition_t timerDisable; /*!< Configures the condition that causes the Timer to be - disabled and stop decrementing. */ - flexio_timer_enable_condition_t timerEnable; /*!< Configures the condition that causes the Timer to be - enabled and start decrementing. */ - flexio_timer_stop_bit_condition_t timerStop; /*!< Timer STOP Bit generation. */ - flexio_timer_start_bit_condition_t timerStart; /*!< Timer STRAT Bit generation. */ - uint32_t timerCompare; /*!< Value for Timer Compare N Register. */ -} flexio_timer_config_t; - -/*! @brief Define FlexIO shifter configuration structure. */ -typedef struct _flexio_shifter_config -{ - /* Timer. */ - uint32_t timerSelect; /*!< Selects which Timer is used for controlling the - logic/shift register and generating the Shift clock. */ - flexio_shifter_timer_polarity_t timerPolarity; /*!< Timer Polarity. */ - /* Pin. */ - flexio_pin_config_t pinConfig; /*!< Shifter Pin Configuration. */ - uint32_t pinSelect; /*!< Shifter Pin number Select. */ - flexio_pin_polarity_t pinPolarity; /*!< Shifter Pin Polarity. */ - /* Shifter. */ - flexio_shifter_mode_t shifterMode; /*!< Configures the mode of the Shifter. */ -#if FSL_FEATURE_FLEXIO_HAS_PARALLEL_WIDTH - uint32_t parallelWidth; /*!< Configures the parallel width when using parallel mode.*/ -#endif /* FSL_FEATURE_FLEXIO_HAS_PARALLEL_WIDTH */ - flexio_shifter_input_source_t inputSource; /*!< Selects the input source for the shifter. */ - flexio_shifter_stop_bit_t shifterStop; /*!< Shifter STOP bit. */ - flexio_shifter_start_bit_t shifterStart; /*!< Shifter START bit. */ -} flexio_shifter_config_t; - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER) && FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER -/*! @brief FLEXIO gpio direction definition */ -typedef enum _flexio_gpio_direction -{ - kFLEXIO_DigitalInput = 0U, /*!< Set current pin as digital input*/ - kFLEXIO_DigitalOutput = 1U, /*!< Set current pin as digital output*/ -} flexio_gpio_direction_t; - -/*! @brief FLEXIO gpio input config */ -typedef enum _flexio_pin_input_config -{ - kFLEXIO_InputInterruptDisabled = 0x0U, /*!< Interrupt request is disabled. */ - kFLEXIO_InputInterruptEnable = 0x1U, /*!< Interrupt request is enable. */ - kFLEXIO_FlagRisingEdgeEnable = 0x2U, /*!< Input pin flag on rising edge. */ - kFLEXIO_FlagFallingEdgeEnable = 0x4U, /*!< Input pin flag on falling edge. */ -} flexio_pin_input_config_t; - -/*! - * @brief The FLEXIO pin configuration structure. - * - * Each pin can only be configured as either an output pin or an input pin at a time. - * If configured as an input pin, use inputConfig param. - * If configured as an output pin, use outputLogic. - */ -typedef struct _flexio_gpio_config -{ - flexio_gpio_direction_t pinDirection; /*!< FLEXIO pin direction, input or output */ - uint8_t outputLogic; /*!< Set a default output logic, which has no use in input */ - uint8_t inputConfig; /*!< Set an input config */ -} flexio_gpio_config_t; -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER*/ - -/*! @brief typedef for FlexIO simulated driver interrupt handler.*/ -typedef void (*flexio_isr_t)(void *base, void *handle); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to flexio bases for each instance. */ -extern FLEXIO_Type *const s_flexioBases[]; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to flexio clocks for each instance. */ -extern const clock_ip_name_t s_flexioClocks[]; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus*/ - -/*! - * @name FlexIO Initialization and De-initialization - * @{ - */ - -/*! - * @brief Gets the default configuration to configure the FlexIO module. The configuration - * can used directly to call the FLEXIO_Configure(). - * - * Example: - @code - flexio_config_t config; - FLEXIO_GetDefaultConfig(&config); - @endcode - * - * @param userConfig pointer to flexio_config_t structure -*/ -void FLEXIO_GetDefaultConfig(flexio_config_t *userConfig); - -/*! - * @brief Configures the FlexIO with a FlexIO configuration. The configuration structure - * can be filled by the user or be set with default values by FLEXIO_GetDefaultConfig(). - * - * Example - @code - flexio_config_t config = { - .enableFlexio = true, - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false - }; - FLEXIO_Configure(base, &config); - @endcode - * - * @param base FlexIO peripheral base address - * @param userConfig pointer to flexio_config_t structure -*/ -void FLEXIO_Init(FLEXIO_Type *base, const flexio_config_t *userConfig); - -/*! - * @brief Gates the FlexIO clock. Call this API to stop the FlexIO clock. - * - * @note After calling this API, call the FLEXO_Init to use the FlexIO module. - * - * @param base FlexIO peripheral base address - */ -void FLEXIO_Deinit(FLEXIO_Type *base); - -/*! - * @brief Get instance number for FLEXIO module. - * - * @param base FLEXIO peripheral base address. - */ -uint32_t FLEXIO_GetInstance(FLEXIO_Type *base); - -/*! @} */ - -/*! - * @name FlexIO Basic Operation - * @{ - */ - -/*! - * @brief Resets the FlexIO module. - * - * @param base FlexIO peripheral base address - */ -void FLEXIO_Reset(FLEXIO_Type *base); - -/*! - * @brief Enables the FlexIO module operation. - * - * @param base FlexIO peripheral base address - * @param enable true to enable, false to disable. - */ -static inline void FLEXIO_Enable(FLEXIO_Type *base, bool enable) -{ - if (enable) - { - base->CTRL |= FLEXIO_CTRL_FLEXEN_MASK; - } - else - { - base->CTRL &= ~FLEXIO_CTRL_FLEXEN_MASK; - } -} - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_STATUS) && FSL_FEATURE_FLEXIO_HAS_PIN_STATUS -/*! - * @brief Reads the input data on each of the FlexIO pins. - * - * @param base FlexIO peripheral base address - * @return FlexIO pin input data - */ -static inline uint32_t FLEXIO_ReadPinInput(FLEXIO_Type *base) -{ - return base->PIN; -} -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_STATUS*/ - -#if defined(FSL_FEATURE_FLEXIO_HAS_STATE_MODE) && FSL_FEATURE_FLEXIO_HAS_STATE_MODE -/*! - * @brief Gets the current state pointer for state mode use. - * - * @param base FlexIO peripheral base address - * @return current State pointer - */ -static inline uint8_t FLEXIO_GetShifterState(FLEXIO_Type *base) -{ - return ((uint8_t)(base->SHIFTSTATE) & FLEXIO_SHIFTSTATE_STATE_MASK); -} -#endif /*FSL_FEATURE_FLEXIO_HAS_STATE_MODE*/ - -/*! - * @brief Configures the shifter with the shifter configuration. The configuration structure - * covers both the SHIFTCTL and SHIFTCFG registers. To configure the shifter to the proper - * mode, select which timer controls the shifter to shift, whether to generate start bit/stop - * bit, and the polarity of start bit and stop bit. - * - * Example - @code - flexio_shifter_config_t config = { - .timerSelect = 0, - .timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive, - .pinConfig = kFLEXIO_PinConfigOpenDrainOrBidirection, - .pinPolarity = kFLEXIO_PinActiveLow, - .shifterMode = kFLEXIO_ShifterModeTransmit, - .inputSource = kFLEXIO_ShifterInputFromPin, - .shifterStop = kFLEXIO_ShifterStopBitHigh, - .shifterStart = kFLEXIO_ShifterStartBitLow - }; - FLEXIO_SetShifterConfig(base, &config); - @endcode - * - * @param base FlexIO peripheral base address - * @param index Shifter index - * @param shifterConfig Pointer to flexio_shifter_config_t structure -*/ -void FLEXIO_SetShifterConfig(FLEXIO_Type *base, uint8_t index, const flexio_shifter_config_t *shifterConfig); -/*! - * @brief Configures the timer with the timer configuration. The configuration structure - * covers both the TIMCTL and TIMCFG registers. To configure the timer to the proper - * mode, select trigger source for timer and the timer pin output and the timing for timer. - * - * Example - @code - flexio_timer_config_t config = { - .triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(0), - .triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow, - .triggerSource = kFLEXIO_TimerTriggerSourceInternal, - .pinConfig = kFLEXIO_PinConfigOpenDrainOrBidirection, - .pinSelect = 0, - .pinPolarity = kFLEXIO_PinActiveHigh, - .timerMode = kFLEXIO_TimerModeDual8BitBaudBit, - .timerOutput = kFLEXIO_TimerOutputZeroNotAffectedByReset, - .timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput, - .timerReset = kFLEXIO_TimerResetOnTimerPinEqualToTimerOutput, - .timerDisable = kFLEXIO_TimerDisableOnTimerCompare, - .timerEnable = kFLEXIO_TimerEnableOnTriggerHigh, - .timerStop = kFLEXIO_TimerStopBitEnableOnTimerDisable, - .timerStart = kFLEXIO_TimerStartBitEnabled - }; - FLEXIO_SetTimerConfig(base, &config); - @endcode - * - * @param base FlexIO peripheral base address - * @param index Timer index - * @param timerConfig Pointer to the flexio_timer_config_t structure -*/ -void FLEXIO_SetTimerConfig(FLEXIO_Type *base, uint8_t index, const flexio_timer_config_t *timerConfig); - -/*! - * @brief This function set the value of the prescaler on flexio channels - * - * @param base Pointer to the FlexIO simulated peripheral type. - * @param index Timer index - * @param clocksource Set clock value - */ -static inline void FLEXIO_SetClockMode(FLEXIO_Type *base, uint8_t index, flexio_timer_decrement_source_t clocksource) -{ - uint32_t reg = base->TIMCFG[index]; - - reg &= ~FLEXIO_TIMCFG_TIMDEC_MASK; - - reg |= FLEXIO_TIMCFG_TIMDEC(clocksource); - - base->TIMCFG[index] = reg; -} - -/*! @} */ - -/*! - * @name FlexIO Interrupt Operation - * @{ - */ - -/*! - * @brief Enables the shifter status interrupt. The interrupt generates when the corresponding SSF is set. - * - * @param base FlexIO peripheral base address - * @param mask The shifter status mask which can be calculated by (1 << shifter index) - * @note For multiple shifter status interrupt enable, for example, two shifter status enable, can calculate - * the mask by using ((1 << shifter index0) | (1 << shifter index1)) - */ -static inline void FLEXIO_EnableShifterStatusInterrupts(FLEXIO_Type *base, uint32_t mask) -{ - base->SHIFTSIEN |= mask; -} - -/*! - * @brief Disables the shifter status interrupt. The interrupt won't generate when the corresponding SSF is set. - * - * @param base FlexIO peripheral base address - * @param mask The shifter status mask which can be calculated by (1 << shifter index) - * @note For multiple shifter status interrupt enable, for example, two shifter status enable, can calculate - * the mask by using ((1 << shifter index0) | (1 << shifter index1)) - */ -static inline void FLEXIO_DisableShifterStatusInterrupts(FLEXIO_Type *base, uint32_t mask) -{ - base->SHIFTSIEN &= ~mask; -} - -/*! - * @brief Enables the shifter error interrupt. The interrupt generates when the corresponding SEF is set. - * - * @param base FlexIO peripheral base address - * @param mask The shifter error mask which can be calculated by (1 << shifter index) - * @note For multiple shifter error interrupt enable, for example, two shifter error enable, can calculate - * the mask by using ((1 << shifter index0) | (1 << shifter index1)) - */ -static inline void FLEXIO_EnableShifterErrorInterrupts(FLEXIO_Type *base, uint32_t mask) -{ - base->SHIFTEIEN |= mask; -} - -/*! - * @brief Disables the shifter error interrupt. The interrupt won't generate when the corresponding SEF is set. - * - * @param base FlexIO peripheral base address - * @param mask The shifter error mask which can be calculated by (1 << shifter index) - * @note For multiple shifter error interrupt enable, for example, two shifter error enable, can calculate - * the mask by using ((1 << shifter index0) | (1 << shifter index1)) - */ -static inline void FLEXIO_DisableShifterErrorInterrupts(FLEXIO_Type *base, uint32_t mask) -{ - base->SHIFTEIEN &= ~mask; -} - -/*! - * @brief Enables the timer status interrupt. The interrupt generates when the corresponding SSF is set. - * - * @param base FlexIO peripheral base address - * @param mask The timer status mask which can be calculated by (1 << timer index) - * @note For multiple timer status interrupt enable, for example, two timer status enable, can calculate - * the mask by using ((1 << timer index0) | (1 << timer index1)) - */ -static inline void FLEXIO_EnableTimerStatusInterrupts(FLEXIO_Type *base, uint32_t mask) -{ - base->TIMIEN |= mask; -} - -/*! - * @brief Disables the timer status interrupt. The interrupt won't generate when the corresponding SSF is set. - * - * @param base FlexIO peripheral base address - * @param mask The timer status mask which can be calculated by (1 << timer index) - * @note For multiple timer status interrupt enable, for example, two timer status enable, can calculate - * the mask by using ((1 << timer index0) | (1 << timer index1)) - */ -static inline void FLEXIO_DisableTimerStatusInterrupts(FLEXIO_Type *base, uint32_t mask) -{ - base->TIMIEN &= ~mask; -} - -/*! @} */ - -/*! - * @name FlexIO Status Operation - * @{ - */ - -/*! - * @brief Gets the shifter status flags. - * - * @param base FlexIO peripheral base address - * @return Shifter status flags - */ -static inline uint32_t FLEXIO_GetShifterStatusFlags(FLEXIO_Type *base) -{ - return ((base->SHIFTSTAT) & FLEXIO_SHIFTSTAT_SSF_MASK); -} - -/*! - * @brief Clears the shifter status flags. - * - * @param base FlexIO peripheral base address - * @param mask The shifter status mask which can be calculated by (1 << shifter index) - * @note For clearing multiple shifter status flags, for example, two shifter status flags, can calculate - * the mask by using ((1 << shifter index0) | (1 << shifter index1)) - */ -static inline void FLEXIO_ClearShifterStatusFlags(FLEXIO_Type *base, uint32_t mask) -{ - base->SHIFTSTAT = mask; -} - -/*! - * @brief Gets the shifter error flags. - * - * @param base FlexIO peripheral base address - * @return Shifter error flags - */ -static inline uint32_t FLEXIO_GetShifterErrorFlags(FLEXIO_Type *base) -{ - return ((base->SHIFTERR) & FLEXIO_SHIFTERR_SEF_MASK); -} - -/*! - * @brief Clears the shifter error flags. - * - * @param base FlexIO peripheral base address - * @param mask The shifter error mask which can be calculated by (1 << shifter index) - * @note For clearing multiple shifter error flags, for example, two shifter error flags, can calculate - * the mask by using ((1 << shifter index0) | (1 << shifter index1)) - */ -static inline void FLEXIO_ClearShifterErrorFlags(FLEXIO_Type *base, uint32_t mask) -{ - base->SHIFTERR = mask; -} - -/*! - * @brief Gets the timer status flags. - * - * @param base FlexIO peripheral base address - * @return Timer status flags - */ -static inline uint32_t FLEXIO_GetTimerStatusFlags(FLEXIO_Type *base) -{ - return ((base->TIMSTAT) & FLEXIO_TIMSTAT_TSF_MASK); -} - -/*! - * @brief Clears the timer status flags. - * - * @param base FlexIO peripheral base address - * @param mask The timer status mask which can be calculated by (1 << timer index) - * @note For clearing multiple timer status flags, for example, two timer status flags, can calculate - * the mask by using ((1 << timer index0) | (1 << timer index1)) - */ -static inline void FLEXIO_ClearTimerStatusFlags(FLEXIO_Type *base, uint32_t mask) -{ - base->TIMSTAT = mask; -} - -/*! @} */ - -/*! - * @name FlexIO DMA Operation - * @{ - */ - -/*! - * @brief Enables/disables the shifter status DMA. The DMA request generates when the corresponding SSF is set. - * - * @note For multiple shifter status DMA enables, for example, calculate - * the mask by using ((1 << shifter index0) | (1 << shifter index1)) - * - * @param base FlexIO peripheral base address - * @param mask The shifter status mask which can be calculated by (1 << shifter index) - * @param enable True to enable, false to disable. - */ -static inline void FLEXIO_EnableShifterStatusDMA(FLEXIO_Type *base, uint32_t mask, bool enable) -{ - if (enable) - { - base->SHIFTSDEN |= mask; - } - else - { - base->SHIFTSDEN &= ~mask; - } -} - -/*! - * @brief Gets the shifter buffer address for the DMA transfer usage. - * - * @param base FlexIO peripheral base address - * @param type Shifter type of flexio_shifter_buffer_type_t - * @param index Shifter index - * @return Corresponding shifter buffer index - */ -uint32_t FLEXIO_GetShifterBufferAddress(FLEXIO_Type *base, flexio_shifter_buffer_type_t type, uint8_t index); - -/*! - * @brief Registers the handle and the interrupt handler for the FlexIO-simulated peripheral. - * - * @param base Pointer to the FlexIO simulated peripheral type. - * @param handle Pointer to the handler for FlexIO simulated peripheral. - * @param isr FlexIO simulated peripheral interrupt handler. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_RegisterHandleIRQ(void *base, void *handle, flexio_isr_t isr); - -/*! - * @brief Unregisters the handle and the interrupt handler for the FlexIO-simulated peripheral. - * - * @param base Pointer to the FlexIO simulated peripheral type. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_UnregisterHandleIRQ(void *base); -/*! @} */ - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER) && FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER - -/*! - * @brief Configure a FLEXIO pin used by the board. - * - * To Config the FLEXIO PIN, define a pin configuration, as either input or output, in the user file. - * Then, call the FLEXIO_SetPinConfig() function. - * - * This is an example to define an input pin or an output pin configuration. - * @code - * Define a digital input pin configuration, - * flexio_gpio_config_t config = - * { - * kFLEXIO_DigitalInput, - * 0U, - * kFLEXIO_FlagRisingEdgeEnable | kFLEXIO_InputInterruptEnable, - * } - * Define a digital output pin configuration, - * flexio_gpio_config_t config = - * { - * kFLEXIO_DigitalOutput, - * 0U, - * 0U - * } - * @endcode - * @param base FlexIO peripheral base address - * @param pin FLEXIO pin number. - * @param config FLEXIO pin configuration pointer. - */ -void FLEXIO_SetPinConfig(FLEXIO_Type *base, uint32_t pin, flexio_gpio_config_t *config); - -/*! - * @name GPIO Output Operations - * @{ - */ - -/*! - * @brief Sets the output level of the multiple FLEXIO pins to the logic 0. - * - * @param base FlexIO peripheral base address - * @param mask FLEXIO pin number mask - */ -static inline void FLEXIO_ClearPortOutput(FLEXIO_Type *base, uint32_t mask) -{ - base->PINOUTCLR = mask; -} - -/*! - * @brief Sets the output level of the multiple FLEXIO pins to the logic 1. - * - * @param base FlexIO peripheral base address - * @param mask FLEXIO pin number mask - */ -static inline void FLEXIO_SetPortOutput(FLEXIO_Type *base, uint32_t mask) -{ - base->PINOUTSET = mask; -} - -/*! - * @brief Reverses the current output logic of the multiple FLEXIO pins. - * - * @param base FlexIO peripheral base address - * @param mask FLEXIO pin number mask - */ -static inline void FLEXIO_TogglePortOutput(FLEXIO_Type *base, uint32_t mask) -{ - base->PINOUTTOG = mask; -} - -/*! - * @brief Sets the output level of the FLEXIO pins to the logic 1 or 0. - * - * @param base FlexIO peripheral base address - * @param pin FLEXIO pin number. - * @param output FLEXIO pin output logic level. - * - 0: corresponding pin output low-logic level. - * - 1: corresponding pin output high-logic level. - */ -static inline void FLEXIO_PinWrite(FLEXIO_Type *base, uint32_t pin, uint8_t output) -{ - if (output == 0U) - { - FLEXIO_ClearPortOutput(base, 1UL << pin); - } - else - { - FLEXIO_SetPortOutput(base, 1UL << pin); - } -} - -/*! - * @brief Enables the FLEXIO output pin function. - * - * @param base FlexIO peripheral base address - * @param pin FLEXIO pin number. - */ -static inline void FLEXIO_EnablePinOutput(FLEXIO_Type *base, uint32_t pin) -{ - base->PINOUTE |= (1UL << pin); -} -/*! @} */ - -/*! - * @name FLEXIO PIN Input Operations - * @{ - */ - -/*! - * @brief Reads the current input value of the FLEXIO pin. - * - * @param base FlexIO peripheral base address - * @param pin FLEXIO pin number. - * @retval FLEXIO port input value - * - 0: corresponding pin input low-logic level. - * - 1: corresponding pin input high-logic level. - */ -static inline uint32_t FLEXIO_PinRead(FLEXIO_Type *base, uint32_t pin) -{ - return (((base->PIN) >> pin) & 0x01U); -} - -/*! - * @brief Gets the FLEXIO input pin status. - * - * @param base FlexIO peripheral base address - * @param pin FLEXIO pin number. - * @retval FLEXIO port input status - * - 0: corresponding pin input capture no status. - * - 1: corresponding pin input capture rising or falling edge. - */ -static inline uint32_t FLEXIO_GetPinStatus(FLEXIO_Type *base, uint32_t pin) -{ - return (((base->PINSTAT) >> pin) & 0x01U); -} - -/*! - * @brief Clears the multiple FLEXIO input pins status. - * - * @param base FlexIO peripheral base address - * @param mask FLEXIO pin number mask - */ -static inline void FLEXIO_ClearPortStatus(FLEXIO_Type *base, uint32_t mask) -{ - base->PINSTAT = mask; -} -/*! @} */ - -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_REGISTER*/ - -#if defined(__cplusplus) -} -#endif /*_cplusplus*/ -/*! @} */ - -#endif /*FSL_FLEXIO_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_i2c_master.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_i2c_master.c deleted file mode 100644 index 9239527c6fa..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_i2c_master.c +++ /dev/null @@ -1,1377 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio_i2c_master.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio_i2c_master" -#endif - -/*! @brief FLEXIO I2C transfer state */ -enum _flexio_i2c_master_transfer_states -{ - kFLEXIO_I2C_Idle = 0x0U, /*!< I2C bus idle */ - kFLEXIO_I2C_Start = 0x1U, /*!< I2C start phase */ - kFLEXIO_I2C_SendCommand = 0x2U, /*!< Send command byte phase */ - kFLEXIO_I2C_SendData = 0x3U, /*!< Send data transfer phase*/ - kFLEXIO_I2C_ReceiveDataBegin = 0x4U, /*!< Receive data begin transfer phase*/ - kFLEXIO_I2C_ReceiveData = 0x5U, /*!< Receive data transfer phase*/ -}; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Set up master transfer, send slave address and decide the initial - * transfer state. - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param transfer pointer to flexio_i2c_master_transfer_t structure - */ -static status_t FLEXIO_I2C_MasterTransferInitStateMachine(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - flexio_i2c_master_transfer_t *xfer); - -/*! - * @brief Master run transfer state machine to perform a byte of transfer. - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param statusFlags flexio i2c hardware status - * @retval kStatus_Success Successfully run state machine - * @retval kStatus_FLEXIO_I2C_Nak Receive Nak during transfer - */ -static status_t FLEXIO_I2C_MasterTransferRunStateMachine(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags); - -/*! - * @brief Complete transfer, disable interrupt and call callback. - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param status flexio transfer status - */ -static void FLEXIO_I2C_MasterTransferComplete(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - status_t status); - -/*! - * @brief introduce function FLEXIO_I2C_MasterTransferStateMachineStart. - * This function was deal with Initial state, i2c start state. - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - */ -static void FLEXIO_I2C_MasterTransferStateMachineStart(FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle); - -/*! - * @brief introduce function FLEXIO_I2C_MasterTransferStateMachineSendCommand. - * This function was deal with Check address only needed for transfer with subaddress . - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param statusFlags flexio i2c hardware status - * - * @return default is true when No abnormality. - * @return false when time out. - */ -static bool FLEXIO_I2C_MasterTransferStateMachineSendCommand(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags); - -/*! - * @brief introduce function FLEXIO_I2C_MasterTransferStateMachineSendData. - * This function was deal with Send command byte. - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param statusFlags flexio i2c hardware status - * - * @return default is true when No abnormality. - * @return false when time out. - */ -static bool FLEXIO_I2C_MasterTransferStateMachineSendData(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags); - -/*! - * @brief introduce function FLEXIO_I2C_MasterTransferStateMachineReceiveDataBegin. - * This function was deal with Receive Data Begin. - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param statusFlags flexio i2c hardware status - * - * @return default is true when No abnormality. - * @return false when time out. - */ -static bool FLEXIO_I2C_MasterTransferStateMachineReceiveDataBegin(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags); - -/*! - * @brief introduce function Case_kFLEXIO_I2C_ReceiveDataBegin. - * This function was deal with Receive Data. - * - * @param base pointer to FLEXIO_I2C_Type structure - * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param statusFlags flexio i2c hardware status - * - * @return default is kStatus_Success when No abnormality. - * @return kStatus_FLEXIO_I2C_Nak when ReceiveNakFlag is not set. - * @return kStatus_FLEXIO_I2C_Timeout when time out. - */ -static status_t FLEXIO_I2C_MasterTransferStateMachineReceiveData(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags); - -/******************************************************************************* - * Codes - ******************************************************************************/ - -static uint32_t FLEXIO_I2C_GetInstance(FLEXIO_I2C_Type *base) -{ - return FLEXIO_GetInstance(base->flexioBase); -} - -static status_t FLEXIO_I2C_MasterTransferInitStateMachine(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - flexio_i2c_master_transfer_t *xfer) -{ - bool needRestart; - uint32_t byteCount; - - /* Init the handle member. */ - handle->transfer.slaveAddress = xfer->slaveAddress; - handle->transfer.direction = xfer->direction; - handle->transfer.subaddress = xfer->subaddress; - handle->transfer.subaddressSize = xfer->subaddressSize; - handle->transfer.data = xfer->data; - handle->transfer.dataSize = xfer->dataSize; - handle->transfer.flags = xfer->flags; - handle->transferSize = xfer->dataSize; - - /* Initial state, i2c start state. */ - handle->state = (uint8_t)kFLEXIO_I2C_Start; - - /* Clear all status before transfer. */ - FLEXIO_I2C_MasterClearStatusFlags(base, (uint32_t)kFLEXIO_I2C_ReceiveNakFlag); - - /* Calculate whether need to send re-start. */ - needRestart = (handle->transfer.subaddressSize != 0U) && (handle->transfer.direction == kFLEXIO_I2C_Read); - handle->needRestart = needRestart; - - /* Calculate total byte count in a frame. */ - byteCount = 1U; - - if (!needRestart) - { - byteCount += handle->transfer.dataSize; - } - - if (handle->transfer.subaddressSize != 0U) - { - byteCount += handle->transfer.subaddressSize; - } - - /* Configure data count. */ - if (FLEXIO_I2C_MasterSetTransferCount(base, (uint16_t)byteCount) != kStatus_Success) - { - return kStatus_InvalidArgument; - } - - /* Configure timer1 disable condition. */ - uint32_t tmpConfig = base->flexioBase->TIMCFG[base->timerIndex[1]]; - tmpConfig &= ~FLEXIO_TIMCFG_TIMDIS_MASK; - tmpConfig |= FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnPreTimerDisable); - base->flexioBase->TIMCFG[base->timerIndex[1]] = tmpConfig; - -#if I2C_RETRY_TIMES - uint32_t waitTimes = I2C_RETRY_TIMES; - while ((0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return kStatus_FLEXIO_I2C_Timeout; - } -#else - while (0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) - { - } -#endif - - return kStatus_Success; -} - -static void FLEXIO_I2C_MasterTransferStateMachineStart(FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle) -{ - if (handle->needRestart) - { - FLEXIO_I2C_MasterStart(base, handle->transfer.slaveAddress, kFLEXIO_I2C_Write); - } - else - { - FLEXIO_I2C_MasterStart(base, handle->transfer.slaveAddress, handle->transfer.direction); - } - if (handle->transfer.subaddressSize == 0U) - { - if (handle->transfer.direction == kFLEXIO_I2C_Write) - { - /* Next state, send data. */ - handle->state = (uint8_t)kFLEXIO_I2C_SendData; - } - else - { - /* Next state, receive data begin. */ - handle->state = (uint8_t)kFLEXIO_I2C_ReceiveDataBegin; - } - } - else - { - /* Next state, send command byte. */ - handle->state = (uint8_t)kFLEXIO_I2C_SendCommand; - } -} - -static bool FLEXIO_I2C_MasterTransferStateMachineSendCommand(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags) -{ - if ((statusFlags & (uint32_t)kFLEXIO_I2C_TxEmptyFlag) != 0U) - { - if (handle->transfer.subaddressSize > 0U) - { - handle->transfer.subaddressSize--; - FLEXIO_I2C_MasterWriteByte(base, ((handle->transfer.subaddress) >> (8U * handle->transfer.subaddressSize))); - - if (handle->transfer.subaddressSize == 0U) - { - /* Load re-start in advance. */ - if (handle->transfer.direction == kFLEXIO_I2C_Read) - { -#if I2C_RETRY_TIMES - while ((0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return false; - } -#else - while (0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) - { - } -#endif - FLEXIO_I2C_MasterRepeatedStart(base); - } - } - } - else - { - if (handle->transfer.direction == kFLEXIO_I2C_Write) - { - /* Send first byte of data. */ - if (handle->transfer.dataSize > 0U) - { - /* Next state, send data. */ - handle->state = (uint8_t)kFLEXIO_I2C_SendData; - - FLEXIO_I2C_MasterWriteByte(base, *handle->transfer.data); - handle->transfer.data++; - handle->transfer.dataSize--; - } - else - { - FLEXIO_I2C_MasterStop(base); - -#if I2C_RETRY_TIMES - while ((0U == (FLEXIO_I2C_MasterGetStatusFlags(base) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return false; - } -#else - while (0U == (FLEXIO_I2C_MasterGetStatusFlags(base) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) - { - } -#endif - (void)FLEXIO_I2C_MasterReadByte(base); - - handle->state = (uint8_t)kFLEXIO_I2C_Idle; - } - } - else - { - (void)FLEXIO_I2C_MasterSetTransferCount(base, (uint16_t)(handle->transfer.dataSize + 1U)); - /* Delay at least one clock cycle so that the restart setup time is up to spec standard. */ - SDK_DelayAtLeastUs(1000000UL / base->baudrate, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY); - FLEXIO_I2C_MasterStart(base, handle->transfer.slaveAddress, kFLEXIO_I2C_Read); - - /* Next state, receive data begin. */ - handle->state = (uint8_t)kFLEXIO_I2C_ReceiveDataBegin; - } - } - } - return true; -} - -static bool FLEXIO_I2C_MasterTransferStateMachineSendData(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags) -{ - if ((statusFlags & (uint32_t)kFLEXIO_I2C_TxEmptyFlag) != 0U) - { - /* Send one byte of data. */ - if (handle->transfer.dataSize > 0U) - { - FLEXIO_I2C_MasterWriteByte(base, *handle->transfer.data); - - handle->transfer.data++; - handle->transfer.dataSize--; - } - else - { - FLEXIO_I2C_MasterStop(base); - -#if I2C_RETRY_TIMES - while ((0U == (FLEXIO_I2C_MasterGetStatusFlags(base) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return false; - } -#else - while (0U == (FLEXIO_I2C_MasterGetStatusFlags(base) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) - { - } -#endif - (void)FLEXIO_I2C_MasterReadByte(base); - - handle->state = (uint8_t)kFLEXIO_I2C_Idle; - } - } - return true; -} - -static bool FLEXIO_I2C_MasterTransferStateMachineReceiveDataBegin(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags) -{ - if ((statusFlags & (uint32_t)kFLEXIO_I2C_RxFullFlag) != 0U) - { - handle->state = (uint8_t)kFLEXIO_I2C_ReceiveData; - /* Send nak at the last receive byte. */ - if (handle->transfer.dataSize == 1U) - { - FLEXIO_I2C_MasterEnableAck(base, false); -#if I2C_RETRY_TIMES - while ((0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return false; - } -#else - while (0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) - { - } -#endif - FLEXIO_I2C_MasterStop(base); - } - else - { - FLEXIO_I2C_MasterEnableAck(base, true); - } - } - else if ((statusFlags & (uint32_t)kFLEXIO_I2C_TxEmptyFlag) != 0U) - { - /* Read one byte of data. */ - FLEXIO_I2C_MasterWriteByte(base, 0xFFFFFFFFU); - } - else - { - ; /* Avoid MISRA 2012 rule 15.7 */ - } - return true; -} - -static status_t FLEXIO_I2C_MasterTransferStateMachineReceiveData(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags) -{ - if ((statusFlags & (uint32_t)kFLEXIO_I2C_RxFullFlag) != 0U) - { - *handle->transfer.data = FLEXIO_I2C_MasterReadByte(base); - handle->transfer.data++; - if (0U != handle->transfer.dataSize--) - { - if (handle->transfer.dataSize == 0U) - { - FLEXIO_I2C_MasterDisableInterrupts(base, (uint32_t)kFLEXIO_I2C_RxFullInterruptEnable); - handle->state = (uint8_t)kFLEXIO_I2C_Idle; - /* Return nak if ReceiveNakFlag is not set */ - if ((statusFlags & (uint32_t)kFLEXIO_I2C_ReceiveNakFlag) == 0U) - { - return kStatus_FLEXIO_I2C_Nak; - } - } - - /* Send nak at the last receive byte. */ - if (handle->transfer.dataSize == 1U) - { - FLEXIO_I2C_MasterEnableAck(base, false); -#if I2C_RETRY_TIMES - while ((0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return kStatus_FLEXIO_I2C_Timeout; - } -#else - while (0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) - { - } -#endif - FLEXIO_I2C_MasterStop(base); - } - } - } - else if ((statusFlags & (uint32_t)kFLEXIO_I2C_TxEmptyFlag) != 0U) - { - if (handle->transfer.dataSize > 1U) - { - FLEXIO_I2C_MasterWriteByte(base, 0xFFFFFFFFU); - } - } - else - { - ; /* Avoid MISRA 2012 rule 15.7 */ - } - return kStatus_Success; -} - -static status_t FLEXIO_I2C_MasterTransferRunStateMachine(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - uint32_t statusFlags) -{ - status_t status; -#if I2C_RETRY_TIMES - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - - if ((statusFlags & (uint32_t)kFLEXIO_I2C_ReceiveNakFlag) != 0U) - { - /* Clear receive nak flag. */ - FLEXIO_ClearShifterErrorFlags(base->flexioBase, 1UL << base->shifterIndex[1]); - - if ((!((handle->state == (uint8_t)kFLEXIO_I2C_SendData) && (handle->transfer.dataSize == 0U))) && - (!(((handle->state == (uint8_t)kFLEXIO_I2C_ReceiveData) || - (handle->state == (uint8_t)kFLEXIO_I2C_ReceiveDataBegin)) && - (handle->transfer.dataSize == 1U)))) - { - (void)FLEXIO_I2C_MasterReadByte(base); - - FLEXIO_I2C_MasterAbortStop(base); - - /* Delay one clk cycle to ensure the bus is idle. */ - SDK_DelayAtLeastUs(1000000UL / base->baudrate, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY); - - handle->state = (uint8_t)kFLEXIO_I2C_Idle; - - return kStatus_FLEXIO_I2C_Nak; - } - } - - if (((statusFlags & (uint8_t)kFLEXIO_I2C_RxFullFlag) != 0U) && (handle->state != (uint8_t)kFLEXIO_I2C_ReceiveData)) - { - (void)FLEXIO_I2C_MasterReadByte(base); - } - - switch (handle->state) - { - /* Initial state, i2c start state. */ - case (uint8_t)kFLEXIO_I2C_Start: - /* Send address byte first. */ - FLEXIO_I2C_MasterTransferStateMachineStart(base, handle); - break; - - /* Check address only needed for transfer with subaddress */ - case (uint8_t)kFLEXIO_I2C_SendCommand: - if (false == FLEXIO_I2C_MasterTransferStateMachineSendCommand(base, handle, statusFlags)) - { - return kStatus_FLEXIO_I2C_Timeout; - } - break; - - /* Send command byte. */ - case (uint8_t)kFLEXIO_I2C_SendData: - if (false == FLEXIO_I2C_MasterTransferStateMachineSendData(base, handle, statusFlags)) - { - return kStatus_FLEXIO_I2C_Timeout; - } - break; - - case (uint8_t)kFLEXIO_I2C_ReceiveDataBegin: - if (false == FLEXIO_I2C_MasterTransferStateMachineReceiveDataBegin(base, handle, statusFlags)) - { - return kStatus_FLEXIO_I2C_Timeout; - } - break; - - case (uint8_t)kFLEXIO_I2C_ReceiveData: - status = FLEXIO_I2C_MasterTransferStateMachineReceiveData(base, handle, statusFlags); - if (kStatus_Success != status) - { - return status; - } - break; - - default: - /* Add comment to avoid MISRA violation */ - break; - } - - return kStatus_Success; -} - -static void FLEXIO_I2C_MasterTransferComplete(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - status_t status) -{ - FLEXIO_I2C_MasterDisableInterrupts( - base, (uint32_t)kFLEXIO_I2C_TxEmptyInterruptEnable | (uint32_t)kFLEXIO_I2C_RxFullInterruptEnable); - - if (handle->completionCallback != NULL) - { - handle->completionCallback(base, handle, status, handle->userData); - } -} - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_STATUS) && FSL_FEATURE_FLEXIO_HAS_PIN_STATUS -/*! - * brief Make sure the bus isn't already pulled down. - * - * Check the FLEXIO pin status to see whether either of SDA and SCL pin is pulled down. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * retval kStatus_Success - * retval kStatus_FLEXIO_I2C_Busy - */ -status_t FLEXIO_I2C_CheckForBusyBus(FLEXIO_I2C_Type *base) -{ - uint32_t mask; - /* If in certain loops the SDA/SCL is continuously pulled down, then return bus busy status. */ - /* The loop count is determined by maximum CPU clock frequency */ - for (uint32_t i = 0U; i < SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY / 600000U; ++i) - { - mask = 1UL << base->SDAPinIndex | 1UL << base->SCLPinIndex; - if ((FLEXIO_ReadPinInput(base->flexioBase) & mask) == mask) - { - return kStatus_Success; - } - } - return kStatus_FLEXIO_I2C_Busy; -} -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_STATUS*/ - -/*! - * brief Ungates the FlexIO clock, resets the FlexIO module, and configures the FlexIO I2C - * hardware configuration. - * - * Example - code - FLEXIO_I2C_Type base = { - .flexioBase = FLEXIO, - .SDAPinIndex = 0, - .SCLPinIndex = 1, - .shifterIndex = {0,1}, - .timerIndex = {0,1} - }; - flexio_i2c_master_config_t config = { - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .baudRate_Bps = 100000 - }; - FLEXIO_I2C_MasterInit(base, &config, srcClock_Hz); - endcode - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param masterConfig Pointer to flexio_i2c_master_config_t structure. - * param srcClock_Hz FlexIO source clock in Hz. - * retval kStatus_Success Initialization successful - * retval kStatus_InvalidArgument The source clock exceed upper range limitation -*/ -status_t FLEXIO_I2C_MasterInit(FLEXIO_I2C_Type *base, flexio_i2c_master_config_t *masterConfig, uint32_t srcClock_Hz) -{ - assert((base != NULL) && (masterConfig != NULL)); - - flexio_shifter_config_t shifterConfig; - flexio_timer_config_t timerConfig; - uint32_t controlVal = 0; - uint16_t timerDiv = 0; - status_t result = kStatus_Success; - - (void)memset(&shifterConfig, 0, sizeof(shifterConfig)); - (void)memset(&timerConfig, 0, sizeof(timerConfig)); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate flexio clock. */ - CLOCK_EnableClock(s_flexioClocks[FLEXIO_I2C_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Do hardware configuration. */ - /* 1. Configure the shifter 0 for tx. */ - shifterConfig.timerSelect = base->timerIndex[2]; - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive; - shifterConfig.pinConfig = kFLEXIO_PinConfigOpenDrainOrBidirection; - shifterConfig.pinSelect = base->SDAPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveLow; - shifterConfig.shifterMode = kFLEXIO_ShifterModeTransmit; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitHigh; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitLow; - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[0], &shifterConfig); - - /* 2. Configure the shifter 1 for rx. */ - shifterConfig.timerSelect = base->timerIndex[2]; - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnNegitive; - shifterConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - shifterConfig.pinSelect = base->SDAPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveHigh; - shifterConfig.shifterMode = kFLEXIO_ShifterModeReceive; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitLow; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnEnable; - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[1], &shifterConfig); - - /*3. Configure the timer 0 and timer 1 for generating bit clock. */ - /* timer 1 is used to config baudrate */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->shifterIndex[0]); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOpenDrainOrBidirection; - timerConfig.pinSelect = base->SCLPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveHigh; - timerConfig.timerMode = kFLEXIO_TimerModeSingle16Bit; - timerConfig.timerOutput = kFLEXIO_TimerOutputZeroNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput; - timerConfig.timerReset = kFLEXIO_TimerResetOnTimerPinEqualToTimerOutput; - timerConfig.timerDisable = kFLEXIO_TimerDisableOnPreTimerDisable; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnTriggerHigh; - timerConfig.timerStop = kFLEXIO_TimerStopBitDisabled; - timerConfig.timerStart = kFLEXIO_TimerStartBitDisabled; - - /* Set TIMCMP = (baud rate divider / 2) - 1. */ - timerDiv = (uint16_t)(srcClock_Hz / masterConfig->baudRate_Bps) / 2U - 1U; - /* Calculate and assign the actual baudrate. */ - base->baudrate = srcClock_Hz / (2U * ((uint32_t)timerDiv + 1U)); - - timerConfig.timerCompare = timerDiv; - - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[1], &timerConfig); - - /* timer 0 is used to config total shift clock edges */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->shifterIndex[0]); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - timerConfig.pinSelect = base->SCLPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveHigh; - timerConfig.timerMode = kFLEXIO_TimerModeSingle16Bit; - timerConfig.timerOutput = kFLEXIO_TimerOutputOneNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnPinInputShiftPinInput; - timerConfig.timerReset = kFLEXIO_TimerResetNever; - timerConfig.timerDisable = kFLEXIO_TimerDisableOnTimerCompare; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnTriggerHigh; - timerConfig.timerStop = kFLEXIO_TimerStopBitDisabled; - timerConfig.timerStart = kFLEXIO_TimerStartBitDisabled; - - /* Set TIMCMP when confinguring transfer bytes. */ - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[0], &timerConfig); - - /* 4. Configure the timer 2 for controlling shifters. */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->shifterIndex[0]); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - timerConfig.pinSelect = base->SCLPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveLow; - timerConfig.timerMode = kFLEXIO_TimerModeSingle16Bit; - timerConfig.timerOutput = kFLEXIO_TimerOutputOneNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnPinInputShiftPinInput; - timerConfig.timerReset = kFLEXIO_TimerResetNever; - timerConfig.timerDisable = kFLEXIO_TimerDisableOnPreTimerDisable; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnPrevTimerEnable; - timerConfig.timerStop = kFLEXIO_TimerStopBitEnableOnTimerCompare; - timerConfig.timerStart = kFLEXIO_TimerStartBitEnabled; - - /* Set TIMCMP[15:0] = (number of bits x 2) - 1. */ - timerConfig.timerCompare = 8U * 2U - 1U; - - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[2], &timerConfig); - - /* Configure FLEXIO I2C Master. */ - controlVal = base->flexioBase->CTRL; - controlVal &= - ~(FLEXIO_CTRL_DOZEN_MASK | FLEXIO_CTRL_DBGE_MASK | FLEXIO_CTRL_FASTACC_MASK | FLEXIO_CTRL_FLEXEN_MASK); - controlVal |= (FLEXIO_CTRL_DBGE(masterConfig->enableInDebug) | FLEXIO_CTRL_FASTACC(masterConfig->enableFastAccess) | - FLEXIO_CTRL_FLEXEN(masterConfig->enableMaster)); - if (!masterConfig->enableInDoze) - { - controlVal |= FLEXIO_CTRL_DOZEN_MASK; - } - - base->flexioBase->CTRL = controlVal; - /* Disable internal IRQs. */ - FLEXIO_I2C_MasterDisableInterrupts( - base, (uint32_t)kFLEXIO_I2C_TxEmptyInterruptEnable | (uint32_t)kFLEXIO_I2C_RxFullInterruptEnable); - return result; -} - -/*! - * brief De-initializes the FlexIO I2C master peripheral. Calling this API Resets the FlexIO I2C master - * shifer and timer config, module can't work unless the FLEXIO_I2C_MasterInit is called. - * - * param base pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterDeinit(FLEXIO_I2C_Type *base) -{ - base->flexioBase->SHIFTCFG[base->shifterIndex[0]] = 0; - base->flexioBase->SHIFTCTL[base->shifterIndex[0]] = 0; - base->flexioBase->SHIFTCFG[base->shifterIndex[1]] = 0; - base->flexioBase->SHIFTCTL[base->shifterIndex[1]] = 0; - base->flexioBase->TIMCFG[base->timerIndex[0]] = 0; - base->flexioBase->TIMCMP[base->timerIndex[0]] = 0; - base->flexioBase->TIMCTL[base->timerIndex[0]] = 0; - base->flexioBase->TIMCFG[base->timerIndex[1]] = 0; - base->flexioBase->TIMCMP[base->timerIndex[1]] = 0; - base->flexioBase->TIMCTL[base->timerIndex[1]] = 0; - base->flexioBase->TIMCFG[base->timerIndex[2]] = 0; - base->flexioBase->TIMCMP[base->timerIndex[2]] = 0; - base->flexioBase->TIMCTL[base->timerIndex[2]] = 0; - /* Clear the shifter flag. */ - base->flexioBase->SHIFTSTAT = (1UL << base->shifterIndex[0]); - base->flexioBase->SHIFTSTAT = (1UL << base->shifterIndex[1]); - /* Clear the timer flag. */ - base->flexioBase->TIMSTAT = (1UL << base->timerIndex[0]); - base->flexioBase->TIMSTAT = (1UL << base->timerIndex[1]); - base->flexioBase->TIMSTAT = (1UL << base->timerIndex[2]); -} - -/*! - * brief Gets the default configuration to configure the FlexIO module. The configuration - * can be used directly for calling the FLEXIO_I2C_MasterInit(). - * - * Example: - code - flexio_i2c_master_config_t config; - FLEXIO_I2C_MasterGetDefaultConfig(&config); - endcode - * param masterConfig Pointer to flexio_i2c_master_config_t structure. -*/ -void FLEXIO_I2C_MasterGetDefaultConfig(flexio_i2c_master_config_t *masterConfig) -{ - assert(masterConfig != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(masterConfig, 0, sizeof(*masterConfig)); - - masterConfig->enableMaster = true; - masterConfig->enableInDoze = false; - masterConfig->enableInDebug = true; - masterConfig->enableFastAccess = false; - - /* Default baud rate at 100kbps. */ - masterConfig->baudRate_Bps = 100000U; -} - -/*! - * brief Gets the FlexIO I2C master status flags. - * - * param base Pointer to FLEXIO_I2C_Type structure - * return Status flag, use status flag to AND #_flexio_i2c_master_status_flags can get the related status. - */ - -uint32_t FLEXIO_I2C_MasterGetStatusFlags(FLEXIO_I2C_Type *base) -{ - uint32_t status = 0; - - status = - ((FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0])) >> base->shifterIndex[0]); - status |= - (((FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[1])) >> (base->shifterIndex[1])) - << 1U); - status |= - (((FLEXIO_GetShifterErrorFlags(base->flexioBase) & (1UL << base->shifterIndex[1])) >> (base->shifterIndex[1])) - << 2U); - - return status; -} - -/*! - * brief Clears the FlexIO I2C master status flags. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param mask Status flag. - * The parameter can be any combination of the following values: - * arg kFLEXIO_I2C_RxFullFlag - * arg kFLEXIO_I2C_ReceiveNakFlag - */ - -void FLEXIO_I2C_MasterClearStatusFlags(FLEXIO_I2C_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_I2C_TxEmptyFlag) != 0U) - { - FLEXIO_ClearShifterStatusFlags(base->flexioBase, 1UL << base->shifterIndex[0]); - } - - if ((mask & (uint32_t)kFLEXIO_I2C_RxFullFlag) != 0U) - { - FLEXIO_ClearShifterStatusFlags(base->flexioBase, 1UL << base->shifterIndex[1]); - } - - if ((mask & (uint32_t)kFLEXIO_I2C_ReceiveNakFlag) != 0U) - { - FLEXIO_ClearShifterErrorFlags(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Enables the FlexIO i2c master interrupt requests. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param mask Interrupt source. - * Currently only one interrupt request source: - * arg kFLEXIO_I2C_TransferCompleteInterruptEnable - */ -void FLEXIO_I2C_MasterEnableInterrupts(FLEXIO_I2C_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_I2C_TxEmptyInterruptEnable) != 0U) - { - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_I2C_RxFullInterruptEnable) != 0U) - { - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Disables the FlexIO I2C master interrupt requests. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param mask Interrupt source. - */ -void FLEXIO_I2C_MasterDisableInterrupts(FLEXIO_I2C_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_I2C_TxEmptyInterruptEnable) != 0U) - { - FLEXIO_DisableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_I2C_RxFullInterruptEnable) != 0U) - { - FLEXIO_DisableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Sets the FlexIO I2C master transfer baudrate. - * - * param base Pointer to FLEXIO_I2C_Type structure - * param baudRate_Bps the baud rate value in HZ - * param srcClock_Hz source clock in HZ - */ -void FLEXIO_I2C_MasterSetBaudRate(FLEXIO_I2C_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz) -{ - uint16_t timerDiv = 0; - FLEXIO_Type *flexioBase = base->flexioBase; - - /* Set TIMCMP = (baud rate divider / 2) - 1.*/ - timerDiv = (uint16_t)((srcClock_Hz / baudRate_Bps) / 2U - 1U); - - flexioBase->TIMCMP[base->timerIndex[1]] = timerDiv; - - /* Calculate and assign the actual baudrate. */ - base->baudrate = srcClock_Hz / (2U * ((uint32_t)timerDiv + 1U)); -} - -/*! - * brief Sets the number of bytes to be transferred from a start signal to a stop signal. - * - * note Call this API before a transfer begins because the timer generates a number of clocks according - * to the number of bytes that need to be transferred. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param count Number of bytes need to be transferred from a start signal to a re-start/stop signal - * retval kStatus_Success Successfully configured the count. - * retval kStatus_InvalidArgument Input argument is invalid. - */ -status_t FLEXIO_I2C_MasterSetTransferCount(FLEXIO_I2C_Type *base, uint16_t count) -{ - /* Calculate whether the transfer count is larger than the max value compare register can achieve */ - if (count > ((0xFFFFUL - 1UL) / (16UL + 1UL + 1UL))) - { - return kStatus_InvalidArgument; - } - - uint32_t timerConfig = 0U; - FLEXIO_Type *flexioBase = base->flexioBase; - - flexioBase->TIMCMP[base->timerIndex[0]] = (uint32_t)count * 18U + 1U; - timerConfig = flexioBase->TIMCFG[base->timerIndex[0]]; - timerConfig &= ~FLEXIO_TIMCFG_TIMDIS_MASK; - timerConfig |= FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTimerCompare); - flexioBase->TIMCFG[base->timerIndex[0]] = timerConfig; - - return kStatus_Success; -} - -/*! - * brief Sends START + 7-bit address to the bus. - * - * note This API should be called when the transfer configuration is ready to send a START signal - * and 7-bit address to the bus. This is a non-blocking API, which returns directly after the address - * is put into the data register but the address transfer is not finished on the bus. Ensure that - * the kFLEXIO_I2C_RxFullFlag status is asserted before calling this API. - * param base Pointer to FLEXIO_I2C_Type structure. - * param address 7-bit address. - * param direction transfer direction. - * This parameter is one of the values in flexio_i2c_direction_t: - * arg kFLEXIO_I2C_Write: Transmit - * arg kFLEXIO_I2C_Read: Receive - */ - -void FLEXIO_I2C_MasterStart(FLEXIO_I2C_Type *base, uint8_t address, flexio_i2c_direction_t direction) -{ - uint32_t data; - - data = ((uint32_t)address) << 1U | ((direction == kFLEXIO_I2C_Read) ? 1U : 0U); - - FLEXIO_I2C_MasterWriteByte(base, data); -} - -/*! - * brief Sends the repeated start signal on the bus. - * - * param base Pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterRepeatedStart(FLEXIO_I2C_Type *base) -{ - /* Prepare for RESTART condition, no stop.*/ - FLEXIO_I2C_MasterWriteByte(base, 0xFFFFFFFFU); -} - -/*! - * brief Sends the stop signal on the bus. - * - * param base Pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterStop(FLEXIO_I2C_Type *base) -{ - /* Prepare normal stop. */ - (void)FLEXIO_I2C_MasterSetTransferCount(base, 0x0U); - FLEXIO_I2C_MasterWriteByte(base, 0x0U); -} - -/*! - * brief Sends the stop signal when transfer is still on-going. - * - * param base Pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterAbortStop(FLEXIO_I2C_Type *base) -{ - uint32_t tmpConfig; - - /* Prepare abort stop. */ - /* Disable timer 0. */ - tmpConfig = base->flexioBase->TIMCFG[base->timerIndex[0]]; - tmpConfig &= ~FLEXIO_TIMCFG_TIMDIS_MASK; - tmpConfig |= FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnPinBothEdge); - base->flexioBase->TIMCFG[base->timerIndex[0]] = tmpConfig; - - /* Disable timer 1. */ - tmpConfig = base->flexioBase->TIMCFG[base->timerIndex[1]]; - tmpConfig &= ~FLEXIO_TIMCFG_TIMDIS_MASK; - tmpConfig |= FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnPinBothEdge); - base->flexioBase->TIMCFG[base->timerIndex[1]] = tmpConfig; -} - -/*! - * brief Configures the sent ACK/NAK for the following byte. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param enable True to configure send ACK, false configure to send NAK. - */ -void FLEXIO_I2C_MasterEnableAck(FLEXIO_I2C_Type *base, bool enable) -{ - uint32_t tmpConfig = 0; - - tmpConfig = base->flexioBase->SHIFTCFG[base->shifterIndex[0]]; - tmpConfig &= ~FLEXIO_SHIFTCFG_SSTOP_MASK; - if (enable) - { - tmpConfig |= FLEXIO_SHIFTCFG_SSTOP(kFLEXIO_ShifterStopBitLow); - } - else - { - tmpConfig |= FLEXIO_SHIFTCFG_SSTOP(kFLEXIO_ShifterStopBitHigh); - } - base->flexioBase->SHIFTCFG[base->shifterIndex[0]] = tmpConfig; -} - -/*! - * brief Sends a buffer of data in bytes. - * - * note This function blocks via polling until all bytes have been sent. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param txBuff The data bytes to send. - * param txSize The number of data bytes to send. - * retval kStatus_Success Successfully write data. - * retval kStatus_FLEXIO_I2C_Nak Receive NAK during writing data. - * retval kStatus_FLEXIO_I2C_Timeout Timeout polling status flags. - */ -status_t FLEXIO_I2C_MasterWriteBlocking(FLEXIO_I2C_Type *base, const uint8_t *txBuff, uint8_t txSize) -{ - assert(txBuff != NULL); - assert(txSize != 0U); - - uint32_t status; -#if I2C_RETRY_TIMES - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - - while (0U != txSize--) - { - FLEXIO_I2C_MasterWriteByte(base, *txBuff++); - - /* Wait until data transfer complete. */ -#if I2C_RETRY_TIMES - waitTimes = I2C_RETRY_TIMES; - while ((0U == ((status = FLEXIO_I2C_MasterGetStatusFlags(base)) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return kStatus_FLEXIO_I2C_Timeout; - } -#else - while (0U == ((status = FLEXIO_I2C_MasterGetStatusFlags(base)) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) - { - } -#endif - - if ((status & (uint32_t)kFLEXIO_I2C_ReceiveNakFlag) != 0U) - { - FLEXIO_ClearShifterErrorFlags(base->flexioBase, 1UL << base->shifterIndex[1]); - return kStatus_FLEXIO_I2C_Nak; - } - } - return kStatus_Success; -} - -/*! - * brief Receives a buffer of bytes. - * - * note This function blocks via polling until all bytes have been received. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param rxBuff The buffer to store the received bytes. - * param rxSize The number of data bytes to be received. - * retval kStatus_Success Successfully read data. - * retval kStatus_FLEXIO_I2C_Timeout Timeout polling status flags. - */ -status_t FLEXIO_I2C_MasterReadBlocking(FLEXIO_I2C_Type *base, uint8_t *rxBuff, uint8_t rxSize) -{ - assert(rxBuff != NULL); - assert(rxSize != 0U); - -#if I2C_RETRY_TIMES - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - - while (0U != rxSize--) - { - /* Wait until data transfer complete. */ -#if I2C_RETRY_TIMES - waitTimes = I2C_RETRY_TIMES; - while ((0U == (FLEXIO_I2C_MasterGetStatusFlags(base) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return kStatus_FLEXIO_I2C_Timeout; - } -#else - while (0U == (FLEXIO_I2C_MasterGetStatusFlags(base) & (uint32_t)kFLEXIO_I2C_RxFullFlag)) - { - } -#endif - *rxBuff++ = FLEXIO_I2C_MasterReadByte(base); - } - return kStatus_Success; -} - -/*! - * brief Performs a master polling transfer on the I2C bus. - * - * note The API does not return until the transfer succeeds or fails due - * to receiving NAK. - * - * param base pointer to FLEXIO_I2C_Type structure. - * param xfer pointer to flexio_i2c_master_transfer_t structure. - * return status of status_t. - */ -status_t FLEXIO_I2C_MasterTransferBlocking(FLEXIO_I2C_Type *base, flexio_i2c_master_transfer_t *xfer) -{ - assert(xfer != NULL); - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_STATUS) && FSL_FEATURE_FLEXIO_HAS_PIN_STATUS - /* Return an error if the bus is already in use not by us.*/ - status_t status = FLEXIO_I2C_CheckForBusyBus(base); - if (status != kStatus_Success) - { - return status; - } -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_STATUS*/ - - flexio_i2c_master_handle_t tmpHandle; - uint32_t statusFlags; - status_t result = kStatus_Success; -#if I2C_RETRY_TIMES - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - - /* Zero the handle. */ - (void)memset(&tmpHandle, 0, sizeof(tmpHandle)); - - /* Set up transfer machine. */ - result = FLEXIO_I2C_MasterTransferInitStateMachine(base, &tmpHandle, xfer); - if (result != kStatus_Success) - { - return result; - } - - do - { - /* Wait either tx empty or rx full flag is asserted. */ -#if I2C_RETRY_TIMES - waitTimes = I2C_RETRY_TIMES; - while ((0U == ((statusFlags = FLEXIO_I2C_MasterGetStatusFlags(base)) & - ((uint32_t)kFLEXIO_I2C_TxEmptyFlag | (uint32_t)kFLEXIO_I2C_RxFullFlag))) && - (0U != --waitTimes)) - { - } - if (0U == waitTimes) - { - return kStatus_FLEXIO_I2C_Timeout; - } -#else - while (0U == ((statusFlags = FLEXIO_I2C_MasterGetStatusFlags(base)) & - ((uint32_t)kFLEXIO_I2C_TxEmptyFlag | (uint32_t)kFLEXIO_I2C_RxFullFlag))) - { - } -#endif - FLEXIO_ClearTimerStatusFlags(base->flexioBase, ((1UL << base->timerIndex[0]) | (1UL << base->timerIndex[1]))); - result = FLEXIO_I2C_MasterTransferRunStateMachine(base, &tmpHandle, statusFlags); - - } while ((tmpHandle.state != (uint8_t)kFLEXIO_I2C_Idle) && (result == kStatus_Success)); - - /* Timer disable on timer compare, wait until bit clock TSF set, which means timer disable and stop has been sent. - */ - while (0U == (FLEXIO_GetTimerStatusFlags(base->flexioBase) & (1UL << base->timerIndex[1]))) - { - } - - return result; -} - -/*! - * brief Initializes the I2C handle which is used in transactional functions. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param handle Pointer to flexio_i2c_master_handle_t structure to store the transfer state. - * param callback Pointer to user callback function. - * param userData User param passed to the callback function. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO type/handle/isr table out of range. - */ -status_t FLEXIO_I2C_MasterTransferCreateHandle(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - flexio_i2c_master_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - IRQn_Type flexio_irqs[] = FLEXIO_IRQS; - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Register callback and userData. */ - handle->completionCallback = callback; - handle->userData = userData; - - /* Clear pending NVIC IRQ before enable NVIC IRQ. */ - NVIC_ClearPendingIRQ(flexio_irqs[FLEXIO_I2C_GetInstance(base)]); - (void)EnableIRQ(flexio_irqs[FLEXIO_I2C_GetInstance(base)]); - - /* Save the context in global variables to support the double weak mechanism. */ - return FLEXIO_RegisterHandleIRQ(base, handle, FLEXIO_I2C_MasterTransferHandleIRQ); -} - -/*! - * brief Performs a master interrupt non-blocking transfer on the I2C bus. - * - * note The API returns immediately after the transfer initiates. - * Call FLEXIO_I2C_MasterTransferGetCount to poll the transfer status to check whether - * the transfer is finished. If the return status is not kStatus_FLEXIO_I2C_Busy, the transfer - * is finished. - * - * param base Pointer to FLEXIO_I2C_Type structure - * param handle Pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * param xfer pointer to flexio_i2c_master_transfer_t structure - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_FLEXIO_I2C_Busy FlexIO I2C is not idle, is running another transfer. - */ -status_t FLEXIO_I2C_MasterTransferNonBlocking(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - flexio_i2c_master_transfer_t *xfer) -{ - assert(handle != NULL); - assert(xfer != NULL); - - status_t result = kStatus_Success; - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_STATUS) && FSL_FEATURE_FLEXIO_HAS_PIN_STATUS - /* Return an error if the bus is already in use not by us.*/ - result = FLEXIO_I2C_CheckForBusyBus(base); - if (result != kStatus_Success) - { - return result; - } -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_STATUS*/ - - if (handle->state != (uint8_t)kFLEXIO_I2C_Idle) - { - return kStatus_FLEXIO_I2C_Busy; - } - else - { - /* Set up transfer machine. */ - result = FLEXIO_I2C_MasterTransferInitStateMachine(base, handle, xfer); - if (result != kStatus_Success) - { - return result; - } - - /* Enable both tx empty and rxfull interrupt. */ - FLEXIO_I2C_MasterEnableInterrupts( - base, (uint32_t)kFLEXIO_I2C_TxEmptyInterruptEnable | (uint32_t)kFLEXIO_I2C_RxFullInterruptEnable); - - return kStatus_Success; - } -} - -/*! - * brief Aborts an interrupt non-blocking transfer early. - * - * note This API can be called at any time when an interrupt non-blocking transfer initiates - * to abort the transfer early. - * - * param base Pointer to FLEXIO_I2C_Type structure - * param handle Pointer to flexio_i2c_master_handle_t structure which stores the transfer state - */ -void FLEXIO_I2C_MasterTransferAbort(FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable interrupts. */ - FLEXIO_I2C_MasterDisableInterrupts( - base, (uint32_t)kFLEXIO_I2C_TxEmptyInterruptEnable | (uint32_t)kFLEXIO_I2C_RxFullInterruptEnable); - - /* Reset to idle state. */ - handle->state = (uint8_t)kFLEXIO_I2C_Idle; -} - -/*! - * brief Gets the master transfer status during a interrupt non-blocking transfer. - * - * param base Pointer to FLEXIO_I2C_Type structure. - * param handle Pointer to flexio_i2c_master_handle_t structure which stores the transfer state. - * param count Number of bytes transferred so far by the non-blocking transaction. - * retval kStatus_InvalidArgument count is Invalid. - * retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - * retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_I2C_MasterTransferGetCount(FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle, size_t *count) -{ - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (handle->state == (uint8_t)kFLEXIO_I2C_Idle) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - *count = handle->transferSize - handle->transfer.dataSize; - - return kStatus_Success; -} - -/*! - * brief Master interrupt handler. - * - * param i2cType Pointer to FLEXIO_I2C_Type structure - * param i2cHandle Pointer to flexio_i2c_master_transfer_t structure - */ -void FLEXIO_I2C_MasterTransferHandleIRQ(void *i2cType, void *i2cHandle) -{ - FLEXIO_I2C_Type *base = (FLEXIO_I2C_Type *)i2cType; - flexio_i2c_master_handle_t *handle = (flexio_i2c_master_handle_t *)i2cHandle; - uint32_t statusFlags; - status_t result; - - statusFlags = FLEXIO_I2C_MasterGetStatusFlags(base); - - result = FLEXIO_I2C_MasterTransferRunStateMachine(base, handle, statusFlags); - - if (handle->state == (uint8_t)kFLEXIO_I2C_Idle) - { - FLEXIO_I2C_MasterTransferComplete(base, handle, result); - } -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_i2c_master.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_i2c_master.h deleted file mode 100644 index 6b33abe22ca..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_i2c_master.h +++ /dev/null @@ -1,485 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_FLEXIO_I2C_MASTER_H_ -#define FSL_FLEXIO_I2C_MASTER_H_ - -#include "fsl_common.h" -#include "fsl_flexio.h" - -/*! - * @addtogroup flexio_i2c_master - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -#define FSL_FLEXIO_I2C_MASTER_DRIVER_VERSION (MAKE_VERSION(2, 5, 0)) -/*! @} */ - -/*! @brief Retry times for waiting flag. */ -#ifndef I2C_RETRY_TIMES -#define I2C_RETRY_TIMES 0U /* Define to zero means keep waiting until the flag is assert/deassert. */ -#endif - -/*! @brief FlexIO I2C transfer status*/ -enum -{ - kStatus_FLEXIO_I2C_Busy = MAKE_STATUS(kStatusGroup_FLEXIO_I2C, 0), /*!< I2C is busy doing transfer. */ - kStatus_FLEXIO_I2C_Idle = MAKE_STATUS(kStatusGroup_FLEXIO_I2C, 1), /*!< I2C is busy doing transfer. */ - kStatus_FLEXIO_I2C_Nak = MAKE_STATUS(kStatusGroup_FLEXIO_I2C, 2), /*!< NAK received during transfer. */ - kStatus_FLEXIO_I2C_Timeout = MAKE_STATUS(kStatusGroup_FLEXIO_I2C, 3), /*!< Timeout polling status flags. */ -}; - -/*! @brief Define FlexIO I2C master interrupt mask. */ -enum _flexio_i2c_master_interrupt -{ - kFLEXIO_I2C_TxEmptyInterruptEnable = 0x1U, /*!< Tx buffer empty interrupt enable. */ - kFLEXIO_I2C_RxFullInterruptEnable = 0x2U, /*!< Rx buffer full interrupt enable. */ -}; - -/*! @brief Define FlexIO I2C master status mask. */ -enum _flexio_i2c_master_status_flags -{ - kFLEXIO_I2C_TxEmptyFlag = 0x1U, /*!< Tx shifter empty flag. */ - kFLEXIO_I2C_RxFullFlag = 0x2U, /*!< Rx shifter full/Transfer complete flag. */ - kFLEXIO_I2C_ReceiveNakFlag = 0x4U, /*!< Receive NAK flag. */ -}; - -/*! @brief Direction of master transfer.*/ -typedef enum _flexio_i2c_direction -{ - kFLEXIO_I2C_Write = 0x0U, /*!< Master send to slave. */ - kFLEXIO_I2C_Read = 0x1U, /*!< Master receive from slave. */ -} flexio_i2c_direction_t; - -/*! @brief Define FlexIO I2C master access structure typedef. */ -typedef struct _flexio_i2c_type -{ - FLEXIO_Type *flexioBase; /*!< FlexIO base pointer. */ - uint8_t SDAPinIndex; /*!< Pin select for I2C SDA. */ - uint8_t SCLPinIndex; /*!< Pin select for I2C SCL. */ - uint8_t shifterIndex[2]; /*!< Shifter index used in FlexIO I2C. */ - uint8_t timerIndex[3]; /*!< Timer index used in FlexIO I2C. */ - uint32_t baudrate; /*!< Master transfer baudrate, used to calculate delay time. */ -} FLEXIO_I2C_Type; - -/*! @brief Define FlexIO I2C master user configuration structure. */ -typedef struct _flexio_i2c_master_config -{ - bool enableMaster; /*!< Enables the FlexIO I2C peripheral at initialization time. */ - bool enableInDoze; /*!< Enable/disable FlexIO operation in doze mode. */ - bool enableInDebug; /*!< Enable/disable FlexIO operation in debug mode. */ - bool enableFastAccess; /*!< Enable/disable fast access to FlexIO registers, fast access requires - the FlexIO clock to be at least twice the frequency of the bus clock. */ - uint32_t baudRate_Bps; /*!< Baud rate in Bps. */ -} flexio_i2c_master_config_t; - -/*! @brief Define FlexIO I2C master transfer structure. */ -typedef struct _flexio_i2c_master_transfer -{ - uint32_t flags; /*!< Transfer flag which controls the transfer, reserved for FlexIO I2C. */ - uint8_t slaveAddress; /*!< 7-bit slave address. */ - flexio_i2c_direction_t direction; /*!< Transfer direction, read or write. */ - uint32_t subaddress; /*!< Sub address. Transferred MSB first. */ - uint8_t subaddressSize; /*!< Size of command buffer. */ - uint8_t volatile *data; /*!< Transfer buffer. */ - volatile size_t dataSize; /*!< Transfer size. */ -} flexio_i2c_master_transfer_t; - -/*! @brief FlexIO I2C master handle typedef. */ -typedef struct _flexio_i2c_master_handle flexio_i2c_master_handle_t; - -/*! @brief FlexIO I2C master transfer callback typedef. */ -typedef void (*flexio_i2c_master_transfer_callback_t)(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - status_t status, - void *userData); - -/*! @brief Define FlexIO I2C master handle structure. */ -struct _flexio_i2c_master_handle -{ - flexio_i2c_master_transfer_t transfer; /*!< FlexIO I2C master transfer copy. */ - size_t transferSize; /*!< Total bytes to be transferred. */ - uint8_t state; /*!< Transfer state maintained during transfer. */ - flexio_i2c_master_transfer_callback_t completionCallback; /*!< Callback function called at transfer event. */ - /*!< Callback function called at transfer event. */ - void *userData; /*!< Callback parameter passed to callback function. */ - bool needRestart; /*!< Whether master needs to send re-start signal. */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus*/ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -#if defined(FSL_FEATURE_FLEXIO_HAS_PIN_STATUS) && FSL_FEATURE_FLEXIO_HAS_PIN_STATUS -/*! - * @brief Make sure the bus isn't already pulled down. - * - * Check the FLEXIO pin status to see whether either of SDA and SCL pin is pulled down. - * - * @param base Pointer to FLEXIO_I2C_Type structure.. - * @retval kStatus_Success - * @retval kStatus_FLEXIO_I2C_Busy - */ -status_t FLEXIO_I2C_CheckForBusyBus(FLEXIO_I2C_Type *base); -#endif /*FSL_FEATURE_FLEXIO_HAS_PIN_STATUS*/ - -/*! - * @brief Ungates the FlexIO clock, resets the FlexIO module, and configures the FlexIO I2C - * hardware configuration. - * - * Example - @code - FLEXIO_I2C_Type base = { - .flexioBase = FLEXIO, - .SDAPinIndex = 0, - .SCLPinIndex = 1, - .shifterIndex = {0,1}, - .timerIndex = {0,1} - }; - flexio_i2c_master_config_t config = { - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .baudRate_Bps = 100000 - }; - FLEXIO_I2C_MasterInit(base, &config, srcClock_Hz); - @endcode - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param masterConfig Pointer to flexio_i2c_master_config_t structure. - * @param srcClock_Hz FlexIO source clock in Hz. - * @retval kStatus_Success Initialization successful - * @retval kStatus_InvalidArgument The source clock exceed upper range limitation -*/ -status_t FLEXIO_I2C_MasterInit(FLEXIO_I2C_Type *base, flexio_i2c_master_config_t *masterConfig, uint32_t srcClock_Hz); - -/*! - * @brief De-initializes the FlexIO I2C master peripheral. Calling this API Resets the FlexIO I2C master - * shifer and timer config, module can't work unless the FLEXIO_I2C_MasterInit is called. - * - * @param base pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterDeinit(FLEXIO_I2C_Type *base); - -/*! - * @brief Gets the default configuration to configure the FlexIO module. The configuration - * can be used directly for calling the FLEXIO_I2C_MasterInit(). - * - * Example: - @code - flexio_i2c_master_config_t config; - FLEXIO_I2C_MasterGetDefaultConfig(&config); - @endcode - * @param masterConfig Pointer to flexio_i2c_master_config_t structure. -*/ -void FLEXIO_I2C_MasterGetDefaultConfig(flexio_i2c_master_config_t *masterConfig); - -/*! - * @brief Enables/disables the FlexIO module operation. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param enable Pass true to enable module, false does not have any effect. - */ -static inline void FLEXIO_I2C_MasterEnable(FLEXIO_I2C_Type *base, bool enable) -{ - if (enable) - { - base->flexioBase->CTRL |= FLEXIO_CTRL_FLEXEN_MASK; - } -} - -/*! @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets the FlexIO I2C master status flags. - * - * @param base Pointer to FLEXIO_I2C_Type structure - * @return Status flag, use status flag to AND #_flexio_i2c_master_status_flags can get the related status. - */ - -uint32_t FLEXIO_I2C_MasterGetStatusFlags(FLEXIO_I2C_Type *base); - -/*! - * @brief Clears the FlexIO I2C master status flags. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param mask Status flag. - * The parameter can be any combination of the following values: - * @arg kFLEXIO_I2C_RxFullFlag - * @arg kFLEXIO_I2C_ReceiveNakFlag - */ - -void FLEXIO_I2C_MasterClearStatusFlags(FLEXIO_I2C_Type *base, uint32_t mask); - -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables the FlexIO i2c master interrupt requests. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param mask Interrupt source. - * Currently only one interrupt request source: - * @arg kFLEXIO_I2C_TransferCompleteInterruptEnable - */ -void FLEXIO_I2C_MasterEnableInterrupts(FLEXIO_I2C_Type *base, uint32_t mask); - -/*! - * @brief Disables the FlexIO I2C master interrupt requests. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param mask Interrupt source. - */ -void FLEXIO_I2C_MasterDisableInterrupts(FLEXIO_I2C_Type *base, uint32_t mask); - -/*! @} */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Sets the FlexIO I2C master transfer baudrate. - * - * @param base Pointer to FLEXIO_I2C_Type structure - * @param baudRate_Bps the baud rate value in HZ - * @param srcClock_Hz source clock in HZ - */ -void FLEXIO_I2C_MasterSetBaudRate(FLEXIO_I2C_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz); - -/*! - * @brief Sends START + 7-bit address to the bus. - * - * @note This API should be called when the transfer configuration is ready to send a START signal - * and 7-bit address to the bus. This is a non-blocking API, which returns directly after the address - * is put into the data register but the address transfer is not finished on the bus. Ensure that - * the kFLEXIO_I2C_RxFullFlag status is asserted before calling this API. - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param address 7-bit address. - * @param direction transfer direction. - * This parameter is one of the values in flexio_i2c_direction_t: - * @arg kFLEXIO_I2C_Write: Transmit - * @arg kFLEXIO_I2C_Read: Receive - */ - -void FLEXIO_I2C_MasterStart(FLEXIO_I2C_Type *base, uint8_t address, flexio_i2c_direction_t direction); - -/*! - * @brief Sends the stop signal on the bus. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterStop(FLEXIO_I2C_Type *base); - -/*! - * @brief Sends the repeated start signal on the bus. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterRepeatedStart(FLEXIO_I2C_Type *base); - -/*! - * @brief Sends the stop signal when transfer is still on-going. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - */ -void FLEXIO_I2C_MasterAbortStop(FLEXIO_I2C_Type *base); - -/*! - * @brief Configures the sent ACK/NAK for the following byte. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param enable True to configure send ACK, false configure to send NAK. - */ -void FLEXIO_I2C_MasterEnableAck(FLEXIO_I2C_Type *base, bool enable); - -/*! - * @brief Sets the number of bytes to be transferred from a start signal to a stop signal. - * - * @note Call this API before a transfer begins because the timer generates a number of clocks according - * to the number of bytes that need to be transferred. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param count Number of bytes need to be transferred from a start signal to a re-start/stop signal - * @retval kStatus_Success Successfully configured the count. - * @retval kStatus_InvalidArgument Input argument is invalid. - */ -status_t FLEXIO_I2C_MasterSetTransferCount(FLEXIO_I2C_Type *base, uint16_t count); - -/*! - * @brief Writes one byte of data to the I2C bus. - * - * @note This is a non-blocking API, which returns directly after the data is put into the - * data register but the data transfer is not finished on the bus. Ensure that - * the TxEmptyFlag is asserted before calling this API. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param data a byte of data. - */ -static inline void FLEXIO_I2C_MasterWriteByte(FLEXIO_I2C_Type *base, uint32_t data) -{ - base->flexioBase->SHIFTBUFBBS[base->shifterIndex[0]] = data; -} - -/*! - * @brief Reads one byte of data from the I2C bus. - * - * @note This is a non-blocking API, which returns directly after the data is read from the - * data register. Ensure that the data is ready in the register. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @return data byte read. - */ -static inline uint8_t FLEXIO_I2C_MasterReadByte(FLEXIO_I2C_Type *base) -{ - return (uint8_t)(base->flexioBase->SHIFTBUFBIS[base->shifterIndex[1]]); -} - -/*! - * @brief Sends a buffer of data in bytes. - * - * @note This function blocks via polling until all bytes have been sent. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param txBuff The data bytes to send. - * @param txSize The number of data bytes to send. - * @retval kStatus_Success Successfully write data. - * @retval kStatus_FLEXIO_I2C_Nak Receive NAK during writing data. - * @retval kStatus_FLEXIO_I2C_Timeout Timeout polling status flags. - */ -status_t FLEXIO_I2C_MasterWriteBlocking(FLEXIO_I2C_Type *base, const uint8_t *txBuff, uint8_t txSize); - -/*! - * @brief Receives a buffer of bytes. - * - * @note This function blocks via polling until all bytes have been received. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param rxBuff The buffer to store the received bytes. - * @param rxSize The number of data bytes to be received. - * @retval kStatus_Success Successfully read data. - * @retval kStatus_FLEXIO_I2C_Timeout Timeout polling status flags. - */ -status_t FLEXIO_I2C_MasterReadBlocking(FLEXIO_I2C_Type *base, uint8_t *rxBuff, uint8_t rxSize); - -/*! - * @brief Performs a master polling transfer on the I2C bus. - * - * @note The API does not return until the transfer succeeds or fails due - * to receiving NAK. - * - * @param base pointer to FLEXIO_I2C_Type structure. - * @param xfer pointer to flexio_i2c_master_transfer_t structure. - * @return status of status_t. - */ -status_t FLEXIO_I2C_MasterTransferBlocking(FLEXIO_I2C_Type *base, flexio_i2c_master_transfer_t *xfer); -/*! @} */ - -/*Transactional APIs*/ - -/*! - * @name Transactional - * @{ - */ - -/*! - * @brief Initializes the I2C handle which is used in transactional functions. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param handle Pointer to flexio_i2c_master_handle_t structure to store the transfer state. - * @param callback Pointer to user callback function. - * @param userData User param passed to the callback function. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO type/handle/isr table out of range. - */ -status_t FLEXIO_I2C_MasterTransferCreateHandle(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - flexio_i2c_master_transfer_callback_t callback, - void *userData); - -/*! - * @brief Performs a master interrupt non-blocking transfer on the I2C bus. - * - * @note The API returns immediately after the transfer initiates. - * Call FLEXIO_I2C_MasterTransferGetCount to poll the transfer status to check whether - * the transfer is finished. If the return status is not kStatus_FLEXIO_I2C_Busy, the transfer - * is finished. - * - * @param base Pointer to FLEXIO_I2C_Type structure - * @param handle Pointer to flexio_i2c_master_handle_t structure which stores the transfer state - * @param xfer pointer to flexio_i2c_master_transfer_t structure - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_FLEXIO_I2C_Busy FlexIO I2C is not idle, is running another transfer. - */ -status_t FLEXIO_I2C_MasterTransferNonBlocking(FLEXIO_I2C_Type *base, - flexio_i2c_master_handle_t *handle, - flexio_i2c_master_transfer_t *xfer); - -/*! - * @brief Gets the master transfer status during a interrupt non-blocking transfer. - * - * @param base Pointer to FLEXIO_I2C_Type structure. - * @param handle Pointer to flexio_i2c_master_handle_t structure which stores the transfer state. - * @param count Number of bytes transferred so far by the non-blocking transaction. - * @retval kStatus_InvalidArgument count is Invalid. - * @retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - * @retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_I2C_MasterTransferGetCount(FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle, size_t *count); - -/*! - * @brief Aborts an interrupt non-blocking transfer early. - * - * @note This API can be called at any time when an interrupt non-blocking transfer initiates - * to abort the transfer early. - * - * @param base Pointer to FLEXIO_I2C_Type structure - * @param handle Pointer to flexio_i2c_master_handle_t structure which stores the transfer state - */ -void FLEXIO_I2C_MasterTransferAbort(FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle); - -/*! - * @brief Master interrupt handler. - * - * @param i2cType Pointer to FLEXIO_I2C_Type structure - * @param i2cHandle Pointer to flexio_i2c_master_transfer_t structure - */ -void FLEXIO_I2C_MasterTransferHandleIRQ(void *i2cType, void *i2cHandle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /*_cplusplus*/ -/*! @} */ - -#endif /*FSL_FLEXIO_I2C_MASTER_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_mculcd.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_mculcd.c deleted file mode 100644 index 217b6595a32..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_mculcd.c +++ /dev/null @@ -1,1334 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio_mculcd.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio_mculcd" -#endif - -/******************************************************************************* - * Definitations - ******************************************************************************/ - -enum _mculcd_transfer_state -{ - kFLEXIO_MCULCD_StateIdle, /*!< No transfer in progress. */ - kFLEXIO_MCULCD_StateReadArray, /*!< Reading array in progress. */ - kFLEXIO_MCULCD_StateWriteArray, /*!< Writing array in progress. */ - kFLEXIO_MCULCD_StateWriteSameValue, /*!< Writing the same value in progress. */ -}; - -/* The TIMCFG[0:7] is used for baud rate divider in dual 8-bit counters baud/bit mode. */ -#define FLEXIO_BAUDRATE_DIV_MASK 0xFFU - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ -/*! - * brief Ungates the FlexIO clock, resets the FlexIO module, configures the - * FlexIO MCULCD hardware, and configures the FlexIO MCULCD with FlexIO MCULCD - * configuration. - * The configuration structure can be filled by the user, or be set with default - * values - * by the ref FLEXIO_MCULCD_GetDefaultConfig. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param config Pointer to the flexio_mculcd_config_t structure. - * param srcClock_Hz FlexIO source clock in Hz. - * retval kStatus_Success Initialization success. - * retval kStatus_InvalidArgument Initialization failed because of invalid - * argument. - */ -status_t FLEXIO_MCULCD_Init(FLEXIO_MCULCD_Type *base, flexio_mculcd_config_t *config, uint32_t srcClock_Hz) -{ - assert(NULL != config); - status_t status; - - flexio_config_t flexioConfig = {config->enable, config->enableInDoze, config->enableInDebug, - config->enableFastAccess}; - - FLEXIO_Init(base->flexioBase, &flexioConfig); - - status = FLEXIO_MCULCD_SetBaudRate(base, config->baudRate_Bps, srcClock_Hz); - - if (kStatus_Success == status) - { - base->setCSPin(true); - base->setRSPin(true); - } - - return status; -} - -/*! - * brief Resets the FLEXIO_MCULCD timer and shifter configuration. - * - * param base Pointer to the FLEXIO_MCULCD_Type. - */ -void FLEXIO_MCULCD_Deinit(FLEXIO_MCULCD_Type *base) -{ - FLEXIO_MCULCD_ClearSingleBeatWriteConfig(base); - FLEXIO_MCULCD_ClearSingleBeatReadConfig(base); -} - -/*! - * brief Gets the default configuration to configure the FlexIO MCULCD. - * - * The default configuration value is: - * code - * config->enable = true; - * config->enableInDoze = false; - * config->enableInDebug = true; - * config->enableFastAccess = true; - * config->baudRate_Bps = 96000000U; - * endcode - * param Config Pointer to the flexio_mculcd_config_t structure. - */ -void FLEXIO_MCULCD_GetDefaultConfig(flexio_mculcd_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->enable = true; - config->enableInDoze = false; - config->enableInDebug = true; - config->enableFastAccess = true; - config->baudRate_Bps = 96000000U; -} - -/*! - * brief Set desired baud rate. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param baudRate_Bps Desired baud rate in bit-per-second for all data lines combined. - * param srcClock_Hz FLEXIO clock frequency in Hz. - * retval kStatus_Success Set successfully. - * retval kStatus_InvalidArgument Could not set the baud rate. - */ -status_t FLEXIO_MCULCD_SetBaudRate(FLEXIO_MCULCD_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz) -{ - uint32_t baudRateDiv; - uint32_t baudRatePerDataLine; - uint32_t timerCompare; - status_t status; - - baudRatePerDataLine = baudRate_Bps / (uint32_t)FLEXIO_MCULCD_DATA_BUS_WIDTH; - - baudRateDiv = (srcClock_Hz + baudRatePerDataLine) / (baudRatePerDataLine * 2U); - - if ((0U == baudRateDiv) || (baudRateDiv > (FLEXIO_BAUDRATE_DIV_MASK + 1U))) - { - status = kStatus_InvalidArgument; - } - else - { - baudRateDiv--; - - timerCompare = base->flexioBase->TIMCMP[base->timerIndex]; - - timerCompare = (timerCompare & ~FLEXIO_BAUDRATE_DIV_MASK) | baudRateDiv; - - base->flexioBase->TIMCMP[base->timerIndex] = timerCompare; - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Gets FlexIO MCULCD status flags. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * return status flag; OR'ed value or the ref _flexio_mculcd_status_flags. - * - * note Don't use this function with DMA APIs. - */ -uint32_t FLEXIO_MCULCD_GetStatusFlags(FLEXIO_MCULCD_Type *base) -{ - uint32_t ret = 0U; - uint32_t flags; - - /* Get shifter status. */ - flags = FLEXIO_GetShifterStatusFlags(base->flexioBase); - - if (0U != (flags & (1UL << base->rxShifterEndIndex))) - { - ret |= (uint32_t)kFLEXIO_MCULCD_RxFullFlag; - } - - if (0U != (flags & (1UL << base->txShifterStartIndex))) - { - ret |= (uint32_t)kFLEXIO_MCULCD_TxEmptyFlag; - } - - return ret; -} - -/*! - * brief Clears FlexIO MCULCD status flags. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param mask Status to clear, it is the OR'ed value of ref - * _flexio_mculcd_status_flags. - * - * note Don't use this function with DMA APIs. - */ -void FLEXIO_MCULCD_ClearStatusFlags(FLEXIO_MCULCD_Type *base, uint32_t mask) -{ - uint32_t flags = 0U; - - /* Clear the shifter flags. */ - if (0U != (mask & (uint32_t)kFLEXIO_MCULCD_RxFullFlag)) - { - flags |= (1UL << base->rxShifterEndIndex); - } - - if (0U != (mask & (uint32_t)kFLEXIO_MCULCD_TxEmptyFlag)) - { - flags |= (1UL << base->txShifterStartIndex); - } - - FLEXIO_ClearShifterStatusFlags(base->flexioBase, flags); -} - -/*! - * brief Enables the FlexIO MCULCD interrupt. - * - * This function enables the FlexIO MCULCD interrupt. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param mask Interrupts to enable, it is the OR'ed value of ref - * _flexio_mculcd_interrupt_enable. - */ -void FLEXIO_MCULCD_EnableInterrupts(FLEXIO_MCULCD_Type *base, uint32_t mask) -{ - uint32_t interrupts = 0U; - - /* Enable shifter interrupts. */ - if (0U != (mask & (uint32_t)kFLEXIO_MCULCD_RxFullFlag)) - { - interrupts |= (1UL << base->rxShifterEndIndex); - } - - if (0U != (mask & (uint32_t)kFLEXIO_MCULCD_TxEmptyFlag)) - { - interrupts |= (1UL << base->txShifterStartIndex); - } - - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, interrupts); -} - -/*! - * brief Disables the FlexIO MCULCD interrupt. - * - * This function disables the FlexIO MCULCD interrupt. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param mask Interrupts to disable, it is the OR'ed value of ref - * _flexio_mculcd_interrupt_enable. - */ -void FLEXIO_MCULCD_DisableInterrupts(FLEXIO_MCULCD_Type *base, uint32_t mask) -{ - uint32_t interrupts = 0U; - - /* Disable shifter interrupts. */ - if (0U != (mask & (uint32_t)kFLEXIO_MCULCD_RxFullFlag)) - { - interrupts |= (1UL << base->rxShifterEndIndex); - } - - if (0U != (mask & (uint32_t)kFLEXIO_MCULCD_TxEmptyFlag)) - { - interrupts |= (1UL << base->txShifterStartIndex); - } - - FLEXIO_DisableShifterStatusInterrupts(base->flexioBase, interrupts); -} - -/*! - * brief Read data from the FLEXIO MCULCD RX shifter buffer. - * - * Read data from the RX shift buffer directly, it does no check whether the - * buffer is empty or not. - * - * If the data bus width is 8-bit: - * code - * uint8_t value; - * value = (uint8_t)FLEXIO_MCULCD_ReadData(base); - * endcode - * - * If the data bus width is 16-bit: - * code - * uint16_t value; - * value = (uint16_t)FLEXIO_MCULCD_ReadData(base); - * endcode - * - * note This function returns the RX shifter buffer value (32-bit) directly. - * The return value should be converted according to data bus width. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * return The data read out. - * - * note Don't use this function with DMA APIs. - */ -uint32_t FLEXIO_MCULCD_ReadData(FLEXIO_MCULCD_Type *base) -{ -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - return base->flexioBase->SHIFTBUFBYS[base->rxShifterEndIndex]; -#else - return base->flexioBase->SHIFTBUFHWS[base->rxShifterEndIndex]; -#endif -} - -/*! - * brief Configures the FLEXIO MCULCD to single beats write mode. - * - * At the begining multiple beats write operation, the FLEXIO MCULCD is configured to - * multiple beats write mode using this function. After write operation, the configuration - * is cleared by ref FLEXIO_MCULCD_ClearSingleBeatWriteConfig. - * - * param base Pointer to the FLEXIO_MCULCD_Type. - * - * note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_SetSingleBeatWriteConfig(FLEXIO_MCULCD_Type *base) -{ - /* - * This function will be called at the beginning of every data writing. For - * performance consideration, it access the FlexIO registers directly, but not - * call FlexIO driver APIs. - */ - - uint32_t timerCompare; - uint32_t timerControl; - - /* Enable the TX Shifter output. */ - base->flexioBase->SHIFTCFG[base->txShifterStartIndex] = - FLEXIO_SHIFTCFG_PWIDTH((uint32_t)FLEXIO_MCULCD_DATA_BUS_WIDTH - 1U) | - FLEXIO_SHIFTCFG_INSRC(kFLEXIO_ShifterInputFromNextShifterOutput); - - base->flexioBase->SHIFTCTL[base->txShifterStartIndex] = - FLEXIO_SHIFTCTL_TIMSEL(base->timerIndex) | FLEXIO_SHIFTCTL_TIMPOL(kFLEXIO_ShifterTimerPolarityOnPositive) | - FLEXIO_SHIFTCTL_PINCFG(kFLEXIO_PinConfigOutput) | FLEXIO_SHIFTCTL_PINSEL(base->dataPinStartIndex) | - FLEXIO_SHIFTCTL_PINPOL(kFLEXIO_PinActiveHigh) | FLEXIO_SHIFTCTL_SMOD(kFLEXIO_ShifterModeTransmit); - - timerCompare = base->flexioBase->TIMCMP[base->timerIndex] & 0xFFU; - - /* - * TIMCMP[15:8] = (number of beats x 2) - 1. Because the number of beat is 1, - * so the TIMCMP[15:8] is 1. - */ - base->flexioBase->TIMCMP[base->timerIndex] = (1UL << 8U) | timerCompare; - - /* Use TX shifter flag as the inverted timer trigger. Timer output to WR/EN pin. */ - base->flexioBase->TIMCFG[base->timerIndex] = - FLEXIO_TIMCFG_TIMOUT(kFLEXIO_TimerOutputOneNotAffectedByReset) | - FLEXIO_TIMCFG_TIMDEC(kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput) | - FLEXIO_TIMCFG_TIMRST(kFLEXIO_TimerResetNever) | FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTimerCompare) | - FLEXIO_TIMCFG_TIMENA(kFLEXIO_TimerEnableOnTriggerHigh) | FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitDisabled) | - FLEXIO_TIMCFG_TSTART(kFLEXIO_TimerStartBitDisabled); - - /* When initially configure the timer pin as output, the pin may be driven low causing glitch on bus. - Configure the pin as bidirection output first then perform a subsequent write to change to output to avoid the - issue. */ - timerControl = FLEXIO_TIMCTL_TRGSEL(FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->txShifterStartIndex)) | - FLEXIO_TIMCTL_TRGPOL(kFLEXIO_TimerTriggerPolarityActiveLow) | - FLEXIO_TIMCTL_TRGSRC(kFLEXIO_TimerTriggerSourceInternal) | - FLEXIO_TIMCTL_PINCFG(kFLEXIO_PinConfigBidirectionOutputData) | - FLEXIO_TIMCTL_PINSEL(base->ENWRPinIndex) | FLEXIO_TIMCTL_PINPOL(kFLEXIO_PinActiveLow) | - FLEXIO_TIMCTL_TIMOD(kFLEXIO_TimerModeDual8BitBaudBit); - - base->flexioBase->TIMCTL[base->timerIndex] = timerControl; - timerControl = (timerControl & ~FLEXIO_TIMCTL_PINCFG_MASK) | FLEXIO_TIMCTL_PINCFG(kFLEXIO_PinConfigOutput); - base->flexioBase->TIMCTL[base->timerIndex] = timerControl; -} - -/*! - * brief Clear the FLEXIO MCULCD single beats write mode configuration. - * - * Clear the write configuration set by ref FLEXIO_MCULCD_SetSingleBeatWriteConfig. - * - * param base Pointer to the FLEXIO_MCULCD_Type. - * - * note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_ClearSingleBeatWriteConfig(FLEXIO_MCULCD_Type *base) -{ - /* Disable the timer. */ - /* Set to bidirection output first then set to disable to avoid glitch on bus. */ - base->flexioBase->TIMCTL[base->timerIndex] = - (base->flexioBase->TIMCTL[base->timerIndex] & ~FLEXIO_TIMCTL_PINCFG_MASK) | - FLEXIO_TIMCTL_PINCFG(kFLEXIO_PinConfigBidirectionOutputData); - base->flexioBase->TIMCTL[base->timerIndex] = 0U; - base->flexioBase->TIMCFG[base->timerIndex] = 0U; - /* Clear the timer flag. */ - base->flexioBase->TIMSTAT = (1UL << base->timerIndex); - /* Stop the TX shifter. */ - base->flexioBase->SHIFTCTL[base->txShifterStartIndex] = 0U; - base->flexioBase->SHIFTCFG[base->txShifterStartIndex] = 0U; - /* Clear the shifter flag. */ - base->flexioBase->SHIFTSTAT = (1UL << base->txShifterStartIndex); -} - -/*! - * brief Configures the FLEXIO MCULCD to single beats read mode. - * - * At the begining or multiple beats read operation, the FLEXIO MCULCD is configured - * to multiple beats read mode using this function. After read operation, the configuration - * is cleared by ref FLEXIO_MCULCD_ClearSingleBeatReadConfig. - * - * param base Pointer to the FLEXIO_MCULCD_Type. - * - * note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_SetSingleBeatReadConfig(FLEXIO_MCULCD_Type *base) -{ - /* - * This function will be called at the beginning of every data reading. For - * performance consideration, it access the FlexIO registers directly, but not - * call FlexIO driver APIs. - */ - - uint8_t timerPin; - uint32_t timerCompare; - flexio_pin_polarity_t timerPinPolarity; - - /* Timer output to RD pin (8080 mode), to WR/EN pin in 6800 mode. */ - if (kFLEXIO_MCULCD_8080 == base->busType) - { - timerPin = base->RDPinIndex; - timerPinPolarity = kFLEXIO_PinActiveLow; - } - else - { - timerPin = base->ENWRPinIndex; - timerPinPolarity = kFLEXIO_PinActiveHigh; - } - - /* Enable the RX Shifter input. */ - base->flexioBase->SHIFTCFG[base->rxShifterEndIndex] = - FLEXIO_SHIFTCFG_PWIDTH((uint32_t)FLEXIO_MCULCD_DATA_BUS_WIDTH - 1U); - - base->flexioBase->SHIFTCTL[base->rxShifterEndIndex] = - FLEXIO_SHIFTCTL_TIMSEL(base->timerIndex) | FLEXIO_SHIFTCTL_TIMPOL(kFLEXIO_ShifterTimerPolarityOnNegitive) | - FLEXIO_SHIFTCTL_PINCFG(kFLEXIO_PinConfigOutputDisabled) | FLEXIO_SHIFTCTL_PINSEL(base->dataPinStartIndex) | - FLEXIO_SHIFTCTL_PINPOL(kFLEXIO_PinActiveHigh) | FLEXIO_SHIFTCTL_SMOD(kFLEXIO_ShifterModeReceive); - - /* Use RX shifter flag as the inverted timer trigger. */ - base->flexioBase->TIMCFG[base->timerIndex] = - FLEXIO_TIMCFG_TIMOUT(kFLEXIO_TimerOutputOneNotAffectedByReset) | - FLEXIO_TIMCFG_TIMDEC(kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput) | - FLEXIO_TIMCFG_TIMRST(kFLEXIO_TimerResetNever) | FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTimerCompare) | - FLEXIO_TIMCFG_TIMENA(kFLEXIO_TimerEnableOnTriggerHigh) | - FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitEnableOnTimerDisable) | - FLEXIO_TIMCFG_TSTART(kFLEXIO_TimerStartBitDisabled); - - timerCompare = base->flexioBase->TIMCMP[base->timerIndex] & 0xFFU; - - /* - * TIMCMP[15:8] = (number of beats x 2) - 1. Because the number of beat is 1, - * so the TIMCMP[15:8] is 1. - */ - base->flexioBase->TIMCMP[base->timerIndex] = (1UL << 8U) | timerCompare; - - base->flexioBase->TIMCTL[base->timerIndex] |= - FLEXIO_TIMCTL_TRGSEL(FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->rxShifterEndIndex)) | - FLEXIO_TIMCTL_TRGPOL(kFLEXIO_TimerTriggerPolarityActiveLow) | - FLEXIO_TIMCTL_TRGSRC(kFLEXIO_TimerTriggerSourceInternal) | FLEXIO_TIMCTL_PINCFG(kFLEXIO_PinConfigOutput) | - FLEXIO_TIMCTL_PINSEL(timerPin) | FLEXIO_TIMCTL_PINPOL(timerPinPolarity) | - FLEXIO_TIMCTL_TIMOD(kFLEXIO_TimerModeDual8BitBaudBit); -} - -/*! - * brief Clear the FLEXIO MCULCD single beats read mode configuration. - * - * Clear the read configuration set by ref FLEXIO_MCULCD_SetSingleBeatReadConfig. - * - * param base Pointer to the FLEXIO_MCULCD_Type. - * - * note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_ClearSingleBeatReadConfig(FLEXIO_MCULCD_Type *base) -{ - /* Disable the timer. */ - /* Set to bidirection output first then set to disable to avoid glitch on bus. */ - base->flexioBase->TIMCTL[base->timerIndex] = - (base->flexioBase->TIMCTL[base->timerIndex] & ~FLEXIO_TIMCTL_PINCFG_MASK) | - FLEXIO_TIMCTL_PINCFG(kFLEXIO_PinConfigBidirectionOutputData); - base->flexioBase->TIMCTL[base->timerIndex] = 0U; - base->flexioBase->TIMCFG[base->timerIndex] = 0U; - /* Clear the timer flag. */ - base->flexioBase->TIMSTAT = (1UL << base->timerIndex); - /* Stop the RX shifter. */ - base->flexioBase->SHIFTCTL[base->rxShifterEndIndex] = 0U; - base->flexioBase->SHIFTCFG[base->rxShifterEndIndex] = 0U; - /* Clear the shifter flag. */ - base->flexioBase->SHIFTSTAT = (1UL << base->rxShifterEndIndex); -} - -/*! - * brief Configures the FLEXIO MCULCD to multiple beats write mode. - * - * At the begining multiple beats write operation, the FLEXIO MCULCD is configured to - * multiple beats write mode using this function. After write operation, the configuration - * is cleared by ref FLEXIO_MCULCD_ClearMultBeatsWriteConfig. - * - * param base Pointer to the FLEXIO_MCULCD_Type. - * - * note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_SetMultiBeatsWriteConfig(FLEXIO_MCULCD_Type *base) -{ - /* - * This function will be called at the beginning of every data writing. For - * performance consideration, it access the FlexIO registers directly, but not - * call FlexIO driver APIs. - */ - - uint32_t timerCompare; - uint32_t timerControl; - uint8_t beats; - uint8_t i; - - /* Enable the TX Shifter output. */ - base->flexioBase->SHIFTCFG[base->txShifterStartIndex] = - FLEXIO_SHIFTCFG_PWIDTH((uint32_t)FLEXIO_MCULCD_DATA_BUS_WIDTH - 1U) | - FLEXIO_SHIFTCFG_INSRC(kFLEXIO_ShifterInputFromNextShifterOutput); - - base->flexioBase->SHIFTCTL[base->txShifterStartIndex] = - FLEXIO_SHIFTCTL_TIMSEL(base->timerIndex) | FLEXIO_SHIFTCTL_TIMPOL(kFLEXIO_ShifterTimerPolarityOnPositive) | - FLEXIO_SHIFTCTL_PINCFG(kFLEXIO_PinConfigOutput) | FLEXIO_SHIFTCTL_PINSEL(base->dataPinStartIndex) | - FLEXIO_SHIFTCTL_PINPOL(kFLEXIO_PinActiveHigh) | FLEXIO_SHIFTCTL_SMOD(kFLEXIO_ShifterModeTransmit); - - for (i = base->txShifterStartIndex + 1U; i <= base->txShifterEndIndex; i++) - { - base->flexioBase->SHIFTCFG[i] = FLEXIO_SHIFTCFG_PWIDTH((uint32_t)FLEXIO_MCULCD_DATA_BUS_WIDTH - 1U) | - FLEXIO_SHIFTCFG_INSRC(kFLEXIO_ShifterInputFromNextShifterOutput); - - base->flexioBase->SHIFTCTL[i] = - FLEXIO_SHIFTCTL_TIMSEL(base->timerIndex) | FLEXIO_SHIFTCTL_TIMPOL(kFLEXIO_ShifterTimerPolarityOnPositive) | - FLEXIO_SHIFTCTL_PINCFG(kFLEXIO_PinConfigOutputDisabled) | FLEXIO_SHIFTCTL_PINSEL(0) | - FLEXIO_SHIFTCTL_PINPOL(kFLEXIO_PinActiveHigh) | FLEXIO_SHIFTCTL_SMOD(kFLEXIO_ShifterModeTransmit); - } - - timerCompare = base->flexioBase->TIMCMP[base->timerIndex] & 0xFFU; - -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - beats = 4U * (base->txShifterEndIndex - base->txShifterStartIndex + 1U); -#else - beats = 2U * (base->txShifterEndIndex - base->txShifterStartIndex + 1U); -#endif - - /* - * TIMCMP[15:8] = (number of beats x 2) - 1. - */ - base->flexioBase->TIMCMP[base->timerIndex] = ((beats * 2UL - 1UL) << 8U) | timerCompare; - - /* Use TX shifter flag as the inverted timer trigger. Timer output to WR/EN pin. */ - base->flexioBase->TIMCFG[base->timerIndex] = - FLEXIO_TIMCFG_TIMOUT(kFLEXIO_TimerOutputOneNotAffectedByReset) | - FLEXIO_TIMCFG_TIMDEC(kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput) | - FLEXIO_TIMCFG_TIMRST(kFLEXIO_TimerResetNever) | FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTimerCompare) | - FLEXIO_TIMCFG_TIMENA(kFLEXIO_TimerEnableOnTriggerHigh) | FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitDisabled) | - FLEXIO_TIMCFG_TSTART(kFLEXIO_TimerStartBitDisabled); - - /* When initially configure the timer pin as output, the pin may be driven low causing glitch on bus. - Configure the pin as bidirection output first then perform a subsequent write to change to output to avoid the - issue. */ - timerControl = FLEXIO_TIMCTL_TRGSEL(FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->txShifterEndIndex)) | - FLEXIO_TIMCTL_TRGPOL(kFLEXIO_TimerTriggerPolarityActiveLow) | - FLEXIO_TIMCTL_TRGSRC(kFLEXIO_TimerTriggerSourceInternal) | - FLEXIO_TIMCTL_PINCFG(kFLEXIO_PinConfigBidirectionOutputData) | - FLEXIO_TIMCTL_PINSEL(base->ENWRPinIndex) | FLEXIO_TIMCTL_PINPOL(kFLEXIO_PinActiveLow) | - FLEXIO_TIMCTL_TIMOD(kFLEXIO_TimerModeDual8BitBaudBit); - - base->flexioBase->TIMCTL[base->timerIndex] = timerControl; - timerControl = (timerControl & ~FLEXIO_TIMCTL_PINCFG_MASK) | FLEXIO_TIMCTL_PINCFG(kFLEXIO_PinConfigOutput); - base->flexioBase->TIMCTL[base->timerIndex] = timerControl; -} - -/*! - * brief Clear the FLEXIO MCULCD multiple beats write mode configuration. - * - * Clear the write configuration set by ref FLEXIO_MCULCD_SetMultBeatsWriteConfig. - * - * param base Pointer to the FLEXIO_MCULCD_Type. - * - * note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_ClearMultiBeatsWriteConfig(FLEXIO_MCULCD_Type *base) -{ - uint8_t i; - uint32_t statusFlags = 0U; - - /* Disable the timer. */ - /* Set to bidirection output first then set to disable to avoid glitch on bus. */ - base->flexioBase->TIMCTL[base->timerIndex] = - (base->flexioBase->TIMCTL[base->timerIndex] & ~FLEXIO_TIMCTL_PINCFG_MASK) | - FLEXIO_TIMCTL_PINCFG(kFLEXIO_PinConfigBidirectionOutputData); - base->flexioBase->TIMCTL[base->timerIndex] = 0U; - base->flexioBase->TIMCFG[base->timerIndex] = 0U; - /* Clear the timer flag. */ - base->flexioBase->TIMSTAT = (1UL << base->timerIndex); - - /* Stop the TX shifter. */ - for (i = base->txShifterStartIndex; i <= base->txShifterEndIndex; i++) - { - base->flexioBase->SHIFTCFG[i] = 0U; - base->flexioBase->SHIFTCTL[i] = 0U; - statusFlags |= (1UL << i); - } - /* Clear the shifter flag. */ - base->flexioBase->SHIFTSTAT = statusFlags; -} - -/*! - * brief Configures the FLEXIO MCULCD to multiple beats read mode. - * - * At the begining or multiple beats read operation, the FLEXIO MCULCD is configured - * to multiple beats read mode using this function. After read operation, the configuration - * is cleared by ref FLEXIO_MCULCD_ClearMultBeatsReadConfig. - * - * param base Pointer to the FLEXIO_MCULCD_Type. - * - * note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_SetMultiBeatsReadConfig(FLEXIO_MCULCD_Type *base) -{ - /* - * This function will be called at the beginning of every data reading. For - * performance consideration, it access the FlexIO registers directly, but not - * call FlexIO driver APIs. - */ - - uint8_t timerPin; - uint8_t beats; - uint8_t i; - uint32_t timerCompare; - flexio_pin_polarity_t timerPinPolarity; - - /* Timer output to RD pin (8080 mode), to WR/EN pin in 6800 mode. */ - if (kFLEXIO_MCULCD_8080 == base->busType) - { - timerPin = base->RDPinIndex; - timerPinPolarity = kFLEXIO_PinActiveLow; - } - else - { - timerPin = base->ENWRPinIndex; - timerPinPolarity = kFLEXIO_PinActiveHigh; - } - - /* Enable the RX Shifter input. */ - for (i = base->rxShifterStartIndex; i < base->rxShifterEndIndex; i++) - { - base->flexioBase->SHIFTCFG[i] = FLEXIO_SHIFTCFG_PWIDTH((uint32_t)FLEXIO_MCULCD_DATA_BUS_WIDTH - 1U) | - FLEXIO_SHIFTCFG_INSRC(kFLEXIO_ShifterInputFromNextShifterOutput); - - base->flexioBase->SHIFTCTL[i] = - FLEXIO_SHIFTCTL_TIMSEL(base->timerIndex) | FLEXIO_SHIFTCTL_TIMPOL(kFLEXIO_ShifterTimerPolarityOnNegitive) | - FLEXIO_SHIFTCTL_PINCFG(kFLEXIO_PinConfigOutputDisabled) | FLEXIO_SHIFTCTL_PINSEL(base->dataPinStartIndex) | - FLEXIO_SHIFTCTL_PINPOL(kFLEXIO_PinActiveHigh) | FLEXIO_SHIFTCTL_SMOD(kFLEXIO_ShifterModeReceive); - } - - base->flexioBase->SHIFTCFG[base->rxShifterEndIndex] = - FLEXIO_SHIFTCFG_PWIDTH((uint32_t)FLEXIO_MCULCD_DATA_BUS_WIDTH - 1U); - base->flexioBase->SHIFTCTL[base->rxShifterEndIndex] = - FLEXIO_SHIFTCTL_TIMSEL(base->timerIndex) | FLEXIO_SHIFTCTL_TIMPOL(kFLEXIO_ShifterTimerPolarityOnNegitive) | - FLEXIO_SHIFTCTL_PINCFG(kFLEXIO_PinConfigOutputDisabled) | FLEXIO_SHIFTCTL_PINSEL(base->dataPinStartIndex) | - FLEXIO_SHIFTCTL_PINPOL(kFLEXIO_PinActiveHigh) | FLEXIO_SHIFTCTL_SMOD(kFLEXIO_ShifterModeReceive); - - timerCompare = base->flexioBase->TIMCMP[base->timerIndex] & 0xFFU; - -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - beats = 4U * (base->rxShifterEndIndex - base->rxShifterStartIndex + 1U); -#else - beats = 2U * (base->rxShifterEndIndex - base->rxShifterStartIndex + 1U); -#endif - - /* - * TIMCMP[15:8] = (number of beats x 2) - 1. - */ - base->flexioBase->TIMCMP[base->timerIndex] = ((beats * 2UL - 1UL) << 8U) | timerCompare; - - /* Use RX shifter flag as the inverted timer trigger. */ - base->flexioBase->TIMCFG[base->timerIndex] = - FLEXIO_TIMCFG_TIMOUT(kFLEXIO_TimerOutputOneNotAffectedByReset) | - FLEXIO_TIMCFG_TIMDEC(kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput) | - FLEXIO_TIMCFG_TIMRST(kFLEXIO_TimerResetNever) | FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTimerCompare) | - FLEXIO_TIMCFG_TIMENA(kFLEXIO_TimerEnableOnTriggerHigh) | - FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitEnableOnTimerDisable) | - FLEXIO_TIMCFG_TSTART(kFLEXIO_TimerStartBitDisabled); - - base->flexioBase->TIMCTL[base->timerIndex] |= - FLEXIO_TIMCTL_TRGSEL(FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->rxShifterEndIndex)) | - FLEXIO_TIMCTL_TRGPOL(kFLEXIO_TimerTriggerPolarityActiveLow) | - FLEXIO_TIMCTL_TRGSRC(kFLEXIO_TimerTriggerSourceInternal) | FLEXIO_TIMCTL_PINCFG(kFLEXIO_PinConfigOutput) | - FLEXIO_TIMCTL_PINSEL(timerPin) | FLEXIO_TIMCTL_PINPOL(timerPinPolarity) | - FLEXIO_TIMCTL_TIMOD(kFLEXIO_TimerModeDual8BitBaudBit); -} - -/*! - * brief Clear the FLEXIO MCULCD multiple beats read mode configuration. - * - * Clear the read configuration set by ref FLEXIO_MCULCD_SetMultBeatsReadConfig. - * - * param base Pointer to the FLEXIO_MCULCD_Type. - * - * note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_ClearMultiBeatsReadConfig(FLEXIO_MCULCD_Type *base) -{ - uint8_t i; - uint32_t statusFlags = 0U; - - /* Disable the timer. */ - /* Set to bidirection output first then set to disable to avoid glitch on bus. */ - base->flexioBase->TIMCTL[base->timerIndex] = - (base->flexioBase->TIMCTL[base->timerIndex] & ~FLEXIO_TIMCTL_PINCFG_MASK) | - FLEXIO_TIMCTL_PINCFG(kFLEXIO_PinConfigBidirectionOutputData); - base->flexioBase->TIMCTL[base->timerIndex] = 0U; - base->flexioBase->TIMCFG[base->timerIndex] = 0U; - /* Clear the timer flag. */ - base->flexioBase->TIMSTAT = (1UL << base->timerIndex); - /* Stop the RX shifter. */ - for (i = base->rxShifterStartIndex; i <= base->rxShifterEndIndex; i++) - { - base->flexioBase->SHIFTCTL[i] = 0U; - base->flexioBase->SHIFTCFG[i] = 0U; - statusFlags |= (1UL << i); - } - /* Clear the shifter flag. */ - base->flexioBase->SHIFTSTAT = statusFlags; -} - -/*! - * brief Wait for transmit data send out finished. - * - * Currently there is no effective method to wait for the data send out - * from the shiter, so here use a while loop to wait. - * - * note This is an internal used function. - */ -void FLEXIO_MCULCD_WaitTransmitComplete(void) -{ - uint32_t i = FLEXIO_MCULCD_WAIT_COMPLETE_TIME; - - while (0U != (i--)) - { - __NOP(); - } -} - -/*! - * brief Send command in blocking way. - * - * This function sends the command and returns when the command has been sent - * out. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param command The command to send. - */ -void FLEXIO_MCULCD_WriteCommandBlocking(FLEXIO_MCULCD_Type *base, uint32_t command) -{ - FLEXIO_Type *flexioBase = base->flexioBase; - - /* De-assert the RS pin. */ - base->setRSPin(false); - - /* For 6800, de-assert the RDWR pin. */ - if (kFLEXIO_MCULCD_6800 == base->busType) - { - base->setRDWRPin(false); - } - - /* Configure the timer and TX shifter. */ - FLEXIO_MCULCD_SetSingleBeatWriteConfig(base); - - /* Write command to shifter buffer. */ - flexioBase->SHIFTBUF[base->txShifterStartIndex] = command; - - /* Wait for command send out. */ - while (0U == ((1UL << base->timerIndex) & FLEXIO_GetTimerStatusFlags(flexioBase))) - { - } - - /* Stop the timer and TX shifter. */ - FLEXIO_MCULCD_ClearSingleBeatWriteConfig(base); - - /* Assert the RS pin. */ - base->setRSPin(true); - /* For 6800, assert the RDWR pin. */ - if (kFLEXIO_MCULCD_6800 == base->busType) - { - base->setRDWRPin(true); - } -} - -/*! - * brief Send data array in blocking way. - * - * This function sends the data array and returns when the data sent out. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param data The data array to send. - * param size How many bytes to write. - */ -void FLEXIO_MCULCD_WriteDataArrayBlocking(FLEXIO_MCULCD_Type *base, const void *data, size_t size) -{ - assert(size > 0U); - - uint32_t i; -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - const uint8_t *data8Bit; -#else - const uint16_t *data16Bit; -#endif - FLEXIO_Type *flexioBase = base->flexioBase; - - /* Assert the RS pin. */ - base->setRSPin(true); - /* For 6800, de-assert the RDWR pin. */ - if (kFLEXIO_MCULCD_6800 == base->busType) - { - base->setRDWRPin(false); - } - - /* Configure the timer and TX shifter. */ - FLEXIO_MCULCD_SetSingleBeatWriteConfig(base); - -/* If data bus width is 8. */ -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - data8Bit = (const uint8_t *)data; - - for (i = 0; i < size; i++) - { - flexioBase->SHIFTBUF[base->txShifterStartIndex] = data8Bit[i]; - - /* Wait for the data send out. */ - while (0U == ((1UL << base->timerIndex) & flexioBase->TIMSTAT)) - { - } - - /* Clear the timer stat. */ - flexioBase->TIMSTAT = 1UL << base->timerIndex; - } -#else - data16Bit = (const uint16_t *)data; - size /= 2U; - - for (i = 0; i < size; i++) - { - flexioBase->SHIFTBUF[base->txShifterStartIndex] = data16Bit[i]; - - /* Wait for the data send out. */ - while (0U == ((1UL << base->timerIndex) & flexioBase->TIMSTAT)) - { - } - - /* Clear the timer stat. */ - flexioBase->TIMSTAT = 1UL << base->timerIndex; - } -#endif - - /* Stop the timer and TX shifter. */ - FLEXIO_MCULCD_ClearSingleBeatWriteConfig(base); -} - -/*! - * brief Read data into array in blocking way. - * - * This function reads the data into array and returns when the data read - * finished. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param data The array to save the data. - * param size How many bytes to read. - */ -void FLEXIO_MCULCD_ReadDataArrayBlocking(FLEXIO_MCULCD_Type *base, void *data, size_t size) -{ - assert(size > 0U); - - uint32_t i; - -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - uint8_t *data8Bit = (uint8_t *)data; -#else - uint16_t *data16Bit = (uint16_t *)data; -#endif - FLEXIO_Type *flexioBase = base->flexioBase; - - /* Assert the RS pin. */ - base->setRSPin(true); - /* For 6800, de-assert the RDWR pin. */ - if (kFLEXIO_MCULCD_6800 == base->busType) - { - base->setRDWRPin(false); - } - - /* Enable the timer and RX shifter. */ - FLEXIO_MCULCD_SetSingleBeatReadConfig(base); - -/* If data bus width is 8. */ -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - for (i = 0; i < (size - 1U); i++) - { - /* Wait for shifter buffer full. */ - while (0U == ((1UL << base->rxShifterEndIndex) & FLEXIO_GetShifterStatusFlags(flexioBase))) - { - } - - data8Bit[i] = (uint8_t)flexioBase->SHIFTBUFBYS[base->rxShifterEndIndex]; - } -#else - /* Data bus width is 16. */ - size /= 2U; - - for (i = 0; i < (size - 1U); i++) - { - /* Wait for shifter buffer full. */ - while (0U == ((1UL << base->rxShifterEndIndex) & FLEXIO_GetShifterStatusFlags(flexioBase))) - { - } - - data16Bit[i] = (uint16_t)flexioBase->SHIFTBUFHWS[base->rxShifterEndIndex]; - } -#endif - - /* Wait for shifter buffer full. */ - while (0U == ((1UL << base->rxShifterEndIndex) & FLEXIO_GetShifterStatusFlags(flexioBase))) - { - } - - /* Stop the timer and disable the RX shifter. */ - FLEXIO_MCULCD_ClearSingleBeatReadConfig(base); - -/* Read out the last data. */ -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - data8Bit[i] = (uint8_t)flexioBase->SHIFTBUFBYS[base->rxShifterEndIndex]; -#else - data16Bit[i] = (uint16_t)flexioBase->SHIFTBUFHWS[base->rxShifterEndIndex]; -#endif -} - -/*! - * brief Send the same value many times in blocking way. - * - * This function sends the same value many times. It could be used to clear the - * LCD screen. If the data bus width is 8, this function will send LSB 8 bits of - * p sameValue for p size times. If the data bus is 16, this function will send - * LSB 16 bits of p sameValue for p size / 2 times. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param sameValue The same value to send. - * param size How many bytes to send. - */ -void FLEXIO_MCULCD_WriteSameValueBlocking(FLEXIO_MCULCD_Type *base, uint32_t sameValue, size_t size) -{ - assert(size > 0U); - - uint32_t i; - FLEXIO_Type *flexioBase = base->flexioBase; - -#if (16 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - size /= 2U; -#endif - - /* Assert the RS pin. */ - base->setRSPin(true); - /* For 6800, de-assert the RDWR pin. */ - if (kFLEXIO_MCULCD_6800 == base->busType) - { - base->setRDWRPin(false); - } - - /* Configure the timer and TX shifter. */ - FLEXIO_MCULCD_SetSingleBeatWriteConfig(base); - - for (i = 0; i < size; i++) - { - flexioBase->SHIFTBUF[base->txShifterStartIndex] = sameValue; - - /* Wait for the data send out. */ - while (0U == ((1UL << base->timerIndex) & flexioBase->TIMSTAT)) - { - } - - /* Clear the timer stat. */ - flexioBase->TIMSTAT = 1UL << base->timerIndex; - } - - /* Stop the timer and TX shifter. */ - FLEXIO_MCULCD_ClearSingleBeatWriteConfig(base); -} - -/*! - * brief Performs a polling transfer. - * - * note The API does not return until the transfer finished. - * - * param base pointer to FLEXIO_MCULCD_Type structure. - * param xfer pointer to flexio_mculcd_transfer_t structure. - */ -void FLEXIO_MCULCD_TransferBlocking(FLEXIO_MCULCD_Type *base, flexio_mculcd_transfer_t *xfer) -{ - FLEXIO_MCULCD_StartTransfer(base); - - if (!xfer->dataOnly) - { - FLEXIO_MCULCD_WriteCommandBlocking(base, xfer->command); - } - - if (xfer->dataSize > 0U) - { - if (kFLEXIO_MCULCD_ReadArray == xfer->mode) - { - FLEXIO_MCULCD_ReadDataArrayBlocking(base, (uint8_t *)(xfer->dataAddrOrSameValue), xfer->dataSize); - } - else if (kFLEXIO_MCULCD_WriteArray == xfer->mode) - { - FLEXIO_MCULCD_WriteDataArrayBlocking(base, (uint8_t *)(xfer->dataAddrOrSameValue), xfer->dataSize); - } - else - { - FLEXIO_MCULCD_WriteSameValueBlocking(base, xfer->dataAddrOrSameValue, xfer->dataSize); - } - } - - FLEXIO_MCULCD_StopTransfer(base); -} - -/*! - * brief Initializes the FlexIO MCULCD handle, which is used in transactional - * functions. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param handle Pointer to the flexio_mculcd_handle_t structure to store the - * transfer state. - * param callback The callback function. - * param userData The parameter of the callback function. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_MCULCD_TransferCreateHandle(FLEXIO_MCULCD_Type *base, - flexio_mculcd_handle_t *handle, - flexio_mculcd_transfer_callback_t callback, - void *userData) -{ - assert(NULL != handle); - - IRQn_Type flexio_irqs[] = FLEXIO_IRQS; - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - handle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - - /* Register callback and userData. */ - handle->completionCallback = callback; - handle->userData = userData; - - /* Enable interrupt in NVIC. */ - (void)EnableIRQ(flexio_irqs[FLEXIO_GetInstance(base->flexioBase)]); - - /* Save the context in global variables to support the double weak mechanism. - */ - return FLEXIO_RegisterHandleIRQ(base, handle, FLEXIO_MCULCD_TransferHandleIRQ); -} - -/*! - * brief Transfer data using IRQ. - * - * This function sends data using IRQ. This is a non-blocking function, which - * returns right away. When all data is sent out/received, the callback - * function is called. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param handle Pointer to the flexio_mculcd_handle_t structure to store the - * transfer state. - * param xfer FlexIO MCULCD transfer structure. See #flexio_mculcd_transfer_t. - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_InvalidArgument Input argument is invalid. - * retval kStatus_FLEXIO_MCULCD_Busy MCULCD is busy with another transfer. - */ -status_t FLEXIO_MCULCD_TransferNonBlocking(FLEXIO_MCULCD_Type *base, - flexio_mculcd_handle_t *handle, - flexio_mculcd_transfer_t *xfer) -{ - /* If previous transfer is in progress. */ - if ((uint32_t)kFLEXIO_MCULCD_StateIdle != handle->state) - { - return kStatus_FLEXIO_MCULCD_Busy; - } - - /* Set the state in handle. */ - if (kFLEXIO_MCULCD_ReadArray == xfer->mode) - { - handle->state = (uint32_t)kFLEXIO_MCULCD_StateReadArray; - } - else if (kFLEXIO_MCULCD_WriteArray == xfer->mode) - { - handle->state = (uint32_t)kFLEXIO_MCULCD_StateWriteArray; - } - else - { - handle->state = (uint32_t)kFLEXIO_MCULCD_StateWriteSameValue; - } - - /* Assert the nCS. */ - FLEXIO_MCULCD_StartTransfer(base); - - if (!xfer->dataOnly) - { - /* Send the command. */ - FLEXIO_MCULCD_WriteCommandBlocking(base, xfer->command); - } - - /* If transfer count is 0 (only to send command), return directly. */ - if (0U == xfer->dataSize) - { - handle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - - /* De-assert the nCS. */ - FLEXIO_MCULCD_StopTransfer(base); - - if (NULL != handle->completionCallback) - { - handle->completionCallback(base, handle, kStatus_FLEXIO_MCULCD_Idle, handle->userData); - } - } - else - { -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - handle->dataCount = xfer->dataSize; -#else - handle->dataCount = xfer->dataSize / 2U; -#endif - - handle->remainingCount = handle->dataCount; - - handle->dataAddrOrSameValue = xfer->dataAddrOrSameValue; - - /* Enable interrupt. */ - if (kFLEXIO_MCULCD_ReadArray == xfer->mode) - { - /* For 6800, assert the RDWR pin. */ - if (kFLEXIO_MCULCD_6800 == base->busType) - { - base->setRDWRPin(true); - } - FLEXIO_MCULCD_SetSingleBeatReadConfig(base); - FLEXIO_MCULCD_EnableInterrupts(base, (uint32_t)kFLEXIO_MCULCD_RxFullInterruptEnable); - } - else - { - /* For 6800, de-assert the RDWR pin. */ - if (kFLEXIO_MCULCD_6800 == base->busType) - { - base->setRDWRPin(false); - } - FLEXIO_MCULCD_SetSingleBeatWriteConfig(base); - FLEXIO_MCULCD_EnableInterrupts(base, (uint32_t)kFLEXIO_MCULCD_TxEmptyInterruptEnable); - } - } - - return kStatus_Success; -} - -/*! - * brief Aborts the data transfer, which used IRQ. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param handle Pointer to the flexio_mculcd_handle_t structure to store the - * transfer state. - */ -void FLEXIO_MCULCD_TransferAbort(FLEXIO_MCULCD_Type *base, flexio_mculcd_handle_t *handle) -{ - /* If no transfer in process, return directly. */ - if ((uint32_t)kFLEXIO_MCULCD_StateIdle == handle->state) - { - return; - } - - /* Disable the interrupt. */ - FLEXIO_MCULCD_DisableInterrupts( - base, (uint32_t)kFLEXIO_MCULCD_RxFullInterruptEnable | (uint32_t)kFLEXIO_MCULCD_TxEmptyInterruptEnable); - - if ((uint32_t)kFLEXIO_MCULCD_StateReadArray == handle->state) - { - /* Stop the timer and disable the RX shifter. */ - FLEXIO_MCULCD_ClearSingleBeatReadConfig(base); - } - else - { - /* Stop the timer and disable the TX shifter. */ - FLEXIO_MCULCD_ClearSingleBeatWriteConfig(base); - } - - /* Clean the flags. */ - FLEXIO_MCULCD_ClearStatusFlags(base, (uint32_t)kFLEXIO_MCULCD_TxEmptyFlag | (uint32_t)kFLEXIO_MCULCD_RxFullFlag); - - /* De-assert the nCS. */ - FLEXIO_MCULCD_StopTransfer(base); - - handle->dataCount = 0; - handle->remainingCount = 0; - handle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; -} - -/*! - * brief Gets the data transfer status which used IRQ. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param handle Pointer to the flexio_mculcd_handle_t structure to store the - * transfer state. - * param count How many bytes transferred so far by the non-blocking transaction. - * retval kStatus_Success Get the transferred count Successfully. - * retval kStatus_NoTransferInProgress No transfer in process. - */ -status_t FLEXIO_MCULCD_TransferGetCount(FLEXIO_MCULCD_Type *base, flexio_mculcd_handle_t *handle, size_t *count) -{ - assert(NULL != count); - - if ((uint32_t)kFLEXIO_MCULCD_StateIdle == handle->state) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->dataCount - handle->remainingCount; - -#if (16 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - *count *= 2U; -#endif - - return kStatus_Success; -} - -/*! - * brief FlexIO MCULCD IRQ handler function. - * - * param base Pointer to the FLEXIO_MCULCD_Type structure. - * param handle Pointer to the flexio_mculcd_handle_t structure to store the - * transfer state. - */ -void FLEXIO_MCULCD_TransferHandleIRQ(void *base, void *handle) -{ - FLEXIO_MCULCD_Type *flexioLcdMcuBase = (FLEXIO_MCULCD_Type *)base; - flexio_mculcd_handle_t *flexioLcdMcuHandle = (flexio_mculcd_handle_t *)handle; - uint32_t statusFlags = FLEXIO_MCULCD_GetStatusFlags(flexioLcdMcuBase); - uint32_t data; - - if ((uint32_t)kFLEXIO_MCULCD_StateReadArray == flexioLcdMcuHandle->state) - { - /* Handle the reading process. */ - while ((0U != ((uint32_t)kFLEXIO_MCULCD_RxFullFlag & statusFlags)) && (flexioLcdMcuHandle->remainingCount > 0U)) - { - if (1U == flexioLcdMcuHandle->remainingCount) - { - /* If this is the last data, stop the RX shifter and timer. */ - FLEXIO_MCULCD_DisableInterrupts(flexioLcdMcuBase, (uint32_t)kFLEXIO_MCULCD_RxFullInterruptEnable); - FLEXIO_MCULCD_ClearSingleBeatReadConfig(flexioLcdMcuBase); - FLEXIO_MCULCD_StopTransfer(flexioLcdMcuBase); - } - - /* Read out the data. */ - data = FLEXIO_MCULCD_ReadData(flexioLcdMcuBase); - -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - *(uint8_t *)(flexioLcdMcuHandle->dataAddrOrSameValue) = (uint8_t)data; - flexioLcdMcuHandle->dataAddrOrSameValue++; -#else - *(uint16_t *)(flexioLcdMcuHandle->dataAddrOrSameValue) = (uint16_t)data; - flexioLcdMcuHandle->dataAddrOrSameValue += 2U; -#endif - - flexioLcdMcuHandle->remainingCount--; - - /* Transfer finished, call the callback. */ - if (0U == flexioLcdMcuHandle->remainingCount) - { - flexioLcdMcuHandle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - - if (NULL != flexioLcdMcuHandle->completionCallback) - { - flexioLcdMcuHandle->completionCallback(flexioLcdMcuBase, flexioLcdMcuHandle, - kStatus_FLEXIO_MCULCD_Idle, flexioLcdMcuHandle->userData); - } - } - - /* Is the shifter buffer ready to send the next data? */ - statusFlags = FLEXIO_MCULCD_GetStatusFlags(flexioLcdMcuBase); - } - } - else - { - /* Handle the writing process. */ - while ((0U != ((uint32_t)kFLEXIO_MCULCD_TxEmptyFlag & statusFlags)) && - (flexioLcdMcuHandle->remainingCount > 0U)) - { - /* Send the data. */ - if ((uint32_t)kFLEXIO_MCULCD_StateWriteSameValue == flexioLcdMcuHandle->state) - { - data = flexioLcdMcuHandle->dataAddrOrSameValue; - } - else - { -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - data = *(uint8_t *)(flexioLcdMcuHandle->dataAddrOrSameValue); - flexioLcdMcuHandle->dataAddrOrSameValue++; -#else - data = *(uint16_t *)(flexioLcdMcuHandle->dataAddrOrSameValue); - flexioLcdMcuHandle->dataAddrOrSameValue += 2U; -#endif - } - - /* If this is the last data to send, delay to wait for the data shift out. */ - if (1U == flexioLcdMcuHandle->remainingCount) - { - FLEXIO_MCULCD_DisableInterrupts(flexioLcdMcuBase, (uint32_t)kFLEXIO_MCULCD_TxEmptyInterruptEnable); - - /* Write the last data. */ - FLEXIO_MCULCD_WriteData(flexioLcdMcuBase, data); - - /* Wait for the last data send finished. */ - FLEXIO_MCULCD_WaitTransmitComplete(); - flexioLcdMcuHandle->remainingCount = 0; - - FLEXIO_MCULCD_ClearSingleBeatWriteConfig(flexioLcdMcuBase); - FLEXIO_MCULCD_StopTransfer(flexioLcdMcuBase); - flexioLcdMcuHandle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - - if (NULL != flexioLcdMcuHandle->completionCallback) - { - flexioLcdMcuHandle->completionCallback(flexioLcdMcuBase, flexioLcdMcuHandle, - kStatus_FLEXIO_MCULCD_Idle, flexioLcdMcuHandle->userData); - } - } - else - { - FLEXIO_MCULCD_WriteData(flexioLcdMcuBase, data); - flexioLcdMcuHandle->remainingCount--; - } - /* Is the shifter buffer ready to send the next data? */ - statusFlags = FLEXIO_MCULCD_GetStatusFlags(flexioLcdMcuBase); - } - } -} \ No newline at end of file diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_mculcd.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_mculcd.h deleted file mode 100644 index 298287b48da..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_mculcd.h +++ /dev/null @@ -1,686 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_FLEXIO_MCULCD_H_ -#define FSL_FLEXIO_MCULCD_H_ - -#include "fsl_common.h" -#include "fsl_flexio.h" - -/*! - * @addtogroup flexio_mculcd - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief FlexIO MCULCD driver version. */ -#define FSL_FLEXIO_MCULCD_DRIVER_VERSION (MAKE_VERSION(2, 1, 0)) -/*! @} */ - -#ifndef FLEXIO_MCULCD_WAIT_COMPLETE_TIME -/*! - * @brief The delay time to wait for FLEXIO transmit complete. - * - * Currently there is no method to detect whether the data has been - * sent out from the shifter, so the driver use a software delay for this. When - * the data is written to shifter buffer, the driver call the delay - * function to wait for the data shift out. - * If this value is too small, then the last few bytes might be lost when writing - * data using interrupt method or DMA method. - */ -#define FLEXIO_MCULCD_WAIT_COMPLETE_TIME 512 -#endif - -#ifndef FLEXIO_MCULCD_DATA_BUS_WIDTH -/*! - * @brief The data bus width, must be 8 or 16. - */ -#define FLEXIO_MCULCD_DATA_BUS_WIDTH 16UL -#endif - -#if (16UL != FLEXIO_MCULCD_DATA_BUS_WIDTH) && (8UL != FLEXIO_MCULCD_DATA_BUS_WIDTH) -#error Only support data bus 8-bit or 16-bit -#endif - -/*! @brief FlexIO LCD transfer status */ -enum -{ - kStatus_FLEXIO_MCULCD_Idle = MAKE_STATUS(kStatusGroup_FLEXIO_MCULCD, 0), /*!< FlexIO LCD is idle. */ - kStatus_FLEXIO_MCULCD_Busy = MAKE_STATUS(kStatusGroup_FLEXIO_MCULCD, 1), /*!< FlexIO LCD is busy */ - kStatus_FLEXIO_MCULCD_Error = MAKE_STATUS(kStatusGroup_FLEXIO_MCULCD, 2), /*!< FlexIO LCD error occurred */ -}; - -/*! @brief Define FlexIO MCULCD pixel format. */ -typedef enum _flexio_mculcd_pixel_format -{ - kFLEXIO_MCULCD_RGB565 = 0, /*!< RGB565, 16-bit. */ - kFLEXIO_MCULCD_BGR565, /*!< BGR565, 16-bit. */ - kFLEXIO_MCULCD_RGB888, /*!< RGB888, 24-bit. */ - kFLEXIO_MCULCD_BGR888, /*!< BGR888, 24-bit. */ -} flexio_mculcd_pixel_format_t; - -/*! @brief Define FlexIO MCULCD bus type. */ -typedef enum _flexio_mculcd_bus -{ - kFLEXIO_MCULCD_8080, /*!< Using Intel 8080 bus. */ - kFLEXIO_MCULCD_6800, /*!< Using Motorola 6800 bus. */ -} flexio_mculcd_bus_t; - -/*! @brief Define FlexIO MCULCD interrupt mask. */ -enum _flexio_mculcd_interrupt_enable -{ - kFLEXIO_MCULCD_TxEmptyInterruptEnable = (1U << 0U), /*!< Transmit buffer empty interrupt enable. */ - kFLEXIO_MCULCD_RxFullInterruptEnable = (1U << 1U), /*!< Receive buffer full interrupt enable. */ -}; - -/*! @brief Define FlexIO MCULCD status mask. */ -enum _flexio_mculcd_status_flags -{ - kFLEXIO_MCULCD_TxEmptyFlag = (1U << 0U), /*!< Transmit buffer empty flag. */ - kFLEXIO_MCULCD_RxFullFlag = (1U << 1U), /*!< Receive buffer full flag. */ -}; - -/*! @brief Define FlexIO MCULCD DMA mask. */ -enum _flexio_mculcd_dma_enable -{ - kFLEXIO_MCULCD_TxDmaEnable = 0x1U, /*!< Tx DMA request source */ - kFLEXIO_MCULCD_RxDmaEnable = 0x2U, /*!< Rx DMA request source */ -}; - -/*! @brief Function to set or clear the CS and RS pin. */ -typedef void (*flexio_mculcd_pin_func_t)(bool set); - -/*! @brief Define FlexIO MCULCD access structure typedef. */ -typedef struct _flexio_mculcd_type -{ - FLEXIO_Type *flexioBase; /*!< FlexIO base pointer. */ - flexio_mculcd_bus_t busType; /*!< The bus type, 8080 or 6800. */ - uint8_t dataPinStartIndex; /*!< Start index of the data pin, the FlexIO pin dataPinStartIndex - to (dataPinStartIndex + FLEXIO_MCULCD_DATA_BUS_WIDTH -1) - will be used for data transfer. Only support data bus width 8 and 16. */ - uint8_t ENWRPinIndex; /*!< Pin select for WR(8080 mode), EN(6800 mode). */ - uint8_t RDPinIndex; /*!< Pin select for RD(8080 mode), not used in 6800 mode. */ - uint8_t txShifterStartIndex; /*!< Start index of shifters used for data write, it must be 0 or 4. */ - uint8_t txShifterEndIndex; /*!< End index of shifters used for data write. */ - uint8_t rxShifterStartIndex; /*!< Start index of shifters used for data read. */ - uint8_t rxShifterEndIndex; /*!< End index of shifters used for data read, it must be 3 or 7. */ - uint8_t timerIndex; /*!< Timer index used in FlexIO MCULCD. */ - flexio_mculcd_pin_func_t setCSPin; /*!< Function to set or clear the CS pin. */ - flexio_mculcd_pin_func_t setRSPin; /*!< Function to set or clear the RS pin. */ - flexio_mculcd_pin_func_t setRDWRPin; /*!< Function to set or clear the RD/WR pin, only used in 6800 mode. */ -} FLEXIO_MCULCD_Type; - -/*! @brief Define FlexIO MCULCD configuration structure. */ -typedef struct _flexio_mculcd_config -{ - bool enable; /*!< Enable/disable FlexIO MCULCD after configuration. */ - bool enableInDoze; /*!< Enable/disable FlexIO operation in doze mode. */ - bool enableInDebug; /*!< Enable/disable FlexIO operation in debug mode. */ - bool enableFastAccess; /*!< Enable/disable fast access to FlexIO registers, - fast access requires the FlexIO clock to be at least - twice the frequency of the bus clock. */ - uint32_t baudRate_Bps; /*!< Baud rate in bit-per-second for all data lines combined. */ -} flexio_mculcd_config_t; - -/*! @brief Transfer mode.*/ -typedef enum _flexio_mculcd_transfer_mode -{ - kFLEXIO_MCULCD_ReadArray, /*!< Read data into an array. */ - kFLEXIO_MCULCD_WriteArray, /*!< Write data from an array. */ - kFLEXIO_MCULCD_WriteSameValue, /*!< Write the same value many times. */ -} flexio_mculcd_transfer_mode_t; - -/*! @brief Define FlexIO MCULCD transfer structure. */ -typedef struct _flexio_mculcd_transfer -{ - uint32_t command; /*!< Command to send. */ - uint32_t dataAddrOrSameValue; /*!< When sending the same value for many times, - this is the value to send. When writing or reading array, - this is the address of the data array. */ - size_t dataSize; /*!< How many bytes to transfer. */ - flexio_mculcd_transfer_mode_t mode; /*!< Transfer mode. */ - bool dataOnly; /*!< Send data only when tx without the command. */ -} flexio_mculcd_transfer_t; - -/*! @brief typedef for flexio_mculcd_handle_t in advance. */ -typedef struct _flexio_mculcd_handle flexio_mculcd_handle_t; - -/*! @brief FlexIO MCULCD callback for finished transfer. - * - * When transfer finished, the callback function is called and returns the - * @p status as kStatus_FLEXIO_MCULCD_Idle. - */ -typedef void (*flexio_mculcd_transfer_callback_t)(FLEXIO_MCULCD_Type *base, - flexio_mculcd_handle_t *handle, - status_t status, - void *userData); - -/*! @brief Define FlexIO MCULCD handle structure. */ -struct _flexio_mculcd_handle -{ - uint32_t dataAddrOrSameValue; /*!< When sending the same value for many times, - this is the value to send. When writing or reading array, - this is the address of the data array. */ - size_t dataCount; /*!< Total count to be transferred. */ - volatile size_t remainingCount; /*!< Remaining count to transfer. */ - volatile uint32_t state; /*!< FlexIO MCULCD internal state. */ - flexio_mculcd_transfer_callback_t completionCallback; /*!< FlexIO MCULCD transfer completed callback. */ - void *userData; /*!< Callback parameter. */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus*/ - -/*! - * @name FlexIO MCULCD Configuration - * @{ - */ - -/*! - * @brief Ungates the FlexIO clock, resets the FlexIO module, configures the - * FlexIO MCULCD hardware, and configures the FlexIO MCULCD with FlexIO MCULCD - * configuration. - * The configuration structure can be filled by the user, or be set with default - * values - * by the @ref FLEXIO_MCULCD_GetDefaultConfig. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param config Pointer to the flexio_mculcd_config_t structure. - * @param srcClock_Hz FlexIO source clock in Hz. - * @retval kStatus_Success Initialization success. - * @retval kStatus_InvalidArgument Initialization failed because of invalid - * argument. - */ -status_t FLEXIO_MCULCD_Init(FLEXIO_MCULCD_Type *base, flexio_mculcd_config_t *config, uint32_t srcClock_Hz); - -/*! - * @brief Resets the FLEXIO_MCULCD timer and shifter configuration. - * - * @param base Pointer to the FLEXIO_MCULCD_Type. - */ -void FLEXIO_MCULCD_Deinit(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Gets the default configuration to configure the FlexIO MCULCD. - * - * The default configuration value is: - * @code - * config->enable = true; - * config->enableInDoze = false; - * config->enableInDebug = true; - * config->enableFastAccess = true; - * config->baudRate_Bps = 96000000U; - * @endcode - * @param config Pointer to the flexio_mculcd_config_t structure. - */ -void FLEXIO_MCULCD_GetDefaultConfig(flexio_mculcd_config_t *config); - -/*! @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets FlexIO MCULCD status flags. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @return status flag; OR'ed value or the @ref _flexio_mculcd_status_flags. - * - * @note Don't use this function with DMA APIs. - */ -uint32_t FLEXIO_MCULCD_GetStatusFlags(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Clears FlexIO MCULCD status flags. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param mask Status to clear, it is the OR'ed value of @ref - * _flexio_mculcd_status_flags. - * - * @note Don't use this function with DMA APIs. - */ -void FLEXIO_MCULCD_ClearStatusFlags(FLEXIO_MCULCD_Type *base, uint32_t mask); - -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables the FlexIO MCULCD interrupt. - * - * This function enables the FlexIO MCULCD interrupt. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param mask Interrupts to enable, it is the OR'ed value of @ref - * _flexio_mculcd_interrupt_enable. - */ -void FLEXIO_MCULCD_EnableInterrupts(FLEXIO_MCULCD_Type *base, uint32_t mask); - -/*! - * @brief Disables the FlexIO MCULCD interrupt. - * - * This function disables the FlexIO MCULCD interrupt. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param mask Interrupts to disable, it is the OR'ed value of @ref - * _flexio_mculcd_interrupt_enable. - */ -void FLEXIO_MCULCD_DisableInterrupts(FLEXIO_MCULCD_Type *base, uint32_t mask); - -/*! @} */ - -/*! - * @name DMA Control - * @{ - */ - -/*! - * @brief Enables/disables the FlexIO MCULCD transmit DMA. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param enable True means enable DMA, false means disable DMA. - */ -static inline void FLEXIO_MCULCD_EnableTxDMA(FLEXIO_MCULCD_Type *base, bool enable) -{ - FLEXIO_EnableShifterStatusDMA(base->flexioBase, (1UL << base->txShifterStartIndex), enable); -} - -/*! - * @brief Enables/disables the FlexIO MCULCD receive DMA. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param enable True means enable DMA, false means disable DMA. - */ -static inline void FLEXIO_MCULCD_EnableRxDMA(FLEXIO_MCULCD_Type *base, bool enable) -{ - FLEXIO_EnableShifterStatusDMA(base->flexioBase, (1UL << base->rxShifterEndIndex), enable); -} - -/*! - * @brief Gets the FlexIO MCULCD transmit data register address. - * - * This function returns the MCULCD data register address, which is mainly used - * by DMA/eDMA. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @return FlexIO MCULCD transmit data register address. - */ -static inline uint32_t FLEXIO_MCULCD_GetTxDataRegisterAddress(FLEXIO_MCULCD_Type *base) -{ - return (uint32_t) & (base->flexioBase->SHIFTBUF[base->txShifterStartIndex]); -} - -/*! - * @brief Gets the FlexIO MCULCD receive data register address. - * - * This function returns the MCULCD data register address, which is mainly used - * by DMA/eDMA. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @return FlexIO MCULCD receive data register address. - */ -static inline uint32_t FLEXIO_MCULCD_GetRxDataRegisterAddress(FLEXIO_MCULCD_Type *base) -{ - return (uint32_t) & (base->flexioBase->SHIFTBUF[base->rxShifterStartIndex]); -} - -/*! @} */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Set desired baud rate. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param baudRate_Bps Desired baud rate in bit-per-second for all data lines combined. - * @param srcClock_Hz FLEXIO clock frequency in Hz. - * @retval kStatus_Success Set successfully. - * @retval kStatus_InvalidArgument Could not set the baud rate. - */ -status_t FLEXIO_MCULCD_SetBaudRate(FLEXIO_MCULCD_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz); - -/*! - * @brief Configures the FLEXIO MCULCD to multiple beats write mode. - * - * At the begining multiple beats write operation, the FLEXIO MCULCD is configured to - * multiple beats write mode using this function. After write operation, the configuration - * is cleared by @ref FLEXIO_MCULCD_ClearSingleBeatWriteConfig. - * - * @param base Pointer to the FLEXIO_MCULCD_Type. - * - * @note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_SetSingleBeatWriteConfig(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Clear the FLEXIO MCULCD multiple beats write mode configuration. - * - * Clear the write configuration set by @ref FLEXIO_MCULCD_SetSingleBeatWriteConfig. - * - * @param base Pointer to the FLEXIO_MCULCD_Type. - * - * @note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_ClearSingleBeatWriteConfig(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Configures the FLEXIO MCULCD to multiple beats read mode. - * - * At the begining or multiple beats read operation, the FLEXIO MCULCD is configured - * to multiple beats read mode using this function. After read operation, the configuration - * is cleared by @ref FLEXIO_MCULCD_ClearSingleBeatReadConfig. - * - * @param base Pointer to the FLEXIO_MCULCD_Type. - * - * @note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_SetSingleBeatReadConfig(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Clear the FLEXIO MCULCD multiple beats read mode configuration. - * - * Clear the read configuration set by @ref FLEXIO_MCULCD_SetSingleBeatReadConfig. - * - * @param base Pointer to the FLEXIO_MCULCD_Type. - * - * @note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_ClearSingleBeatReadConfig(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Configures the FLEXIO MCULCD to multiple beats write mode. - * - * At the begining multiple beats write operation, the FLEXIO MCULCD is configured to - * multiple beats write mode using this function. After write operation, the configuration - * is cleared by FLEXIO_MCULCD_ClearMultBeatsWriteConfig. - * - * @param base Pointer to the FLEXIO_MCULCD_Type. - * - * @note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_SetMultiBeatsWriteConfig(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Clear the FLEXIO MCULCD multiple beats write mode configuration. - * - * Clear the write configuration set by FLEXIO_MCULCD_SetMultBeatsWriteConfig. - * - * @param base Pointer to the FLEXIO_MCULCD_Type. - * - * @note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_ClearMultiBeatsWriteConfig(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Configures the FLEXIO MCULCD to multiple beats read mode. - * - * At the begining or multiple beats read operation, the FLEXIO MCULCD is configured - * to multiple beats read mode using this function. After read operation, the configuration - * is cleared by FLEXIO_MCULCD_ClearMultBeatsReadConfig. - * - * @param base Pointer to the FLEXIO_MCULCD_Type. - * - * @note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_SetMultiBeatsReadConfig(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Clear the FLEXIO MCULCD multiple beats read mode configuration. - * - * Clear the read configuration set by FLEXIO_MCULCD_SetMultBeatsReadConfig. - * - * @param base Pointer to the FLEXIO_MCULCD_Type. - * - * @note This is an internal used function, upper layer should not use. - */ -void FLEXIO_MCULCD_ClearMultiBeatsReadConfig(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Enables/disables the FlexIO MCULCD module operation. - * - * @param base Pointer to the FLEXIO_MCULCD_Type. - * @param enable True to enable, false does not have any effect. - */ -static inline void FLEXIO_MCULCD_Enable(FLEXIO_MCULCD_Type *base, bool enable) -{ - if (enable) - { - FLEXIO_Enable(base->flexioBase, enable); - } -} - -/*! - * @brief Read data from the FLEXIO MCULCD RX shifter buffer. - * - * Read data from the RX shift buffer directly, it does no check whether the - * buffer is empty or not. - * - * If the data bus width is 8-bit: - * @code - * uint8_t value; - * value = (uint8_t)FLEXIO_MCULCD_ReadData(base); - * @endcode - * - * If the data bus width is 16-bit: - * @code - * uint16_t value; - * value = (uint16_t)FLEXIO_MCULCD_ReadData(base); - * @endcode - * - * @note This function returns the RX shifter buffer value (32-bit) directly. - * The return value should be converted according to data bus width. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @return The data read out. - * - * @note Don't use this function with DMA APIs. - */ -uint32_t FLEXIO_MCULCD_ReadData(FLEXIO_MCULCD_Type *base); - -/*! - * @brief Write data into the FLEXIO MCULCD TX shifter buffer. - * - * Write data into the TX shift buffer directly, it does no check whether the - * buffer is full or not. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param data The data to write. - * - * @note Don't use this function with DMA APIs. - */ -static inline void FLEXIO_MCULCD_WriteData(FLEXIO_MCULCD_Type *base, uint32_t data) -{ - base->flexioBase->SHIFTBUF[base->txShifterStartIndex] = data; -} - -/*! - * @brief Assert the nCS to start transfer. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - */ -static inline void FLEXIO_MCULCD_StartTransfer(FLEXIO_MCULCD_Type *base) -{ - base->setCSPin(false); -} - -/*! - * @brief De-assert the nCS to stop transfer. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - */ -static inline void FLEXIO_MCULCD_StopTransfer(FLEXIO_MCULCD_Type *base) -{ - base->setCSPin(true); -} - -/*! - * @brief Wait for transmit data send out finished. - * - * Currently there is no effective method to wait for the data send out - * from the shiter, so here use a while loop to wait. - * - * @note This is an internal used function. - */ -void FLEXIO_MCULCD_WaitTransmitComplete(void); - -/*! - * @brief Send command in blocking way. - * - * This function sends the command and returns when the command has been sent - * out. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param command The command to send. - */ -void FLEXIO_MCULCD_WriteCommandBlocking(FLEXIO_MCULCD_Type *base, uint32_t command); - -/*! - * @brief Send data array in blocking way. - * - * This function sends the data array and returns when the data sent out. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param data The data array to send. - * @param size How many bytes to write. - */ -void FLEXIO_MCULCD_WriteDataArrayBlocking(FLEXIO_MCULCD_Type *base, const void *data, size_t size); - -/*! - * @brief Read data into array in blocking way. - * - * This function reads the data into array and returns when the data read - * finished. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param data The array to save the data. - * @param size How many bytes to read. - */ -void FLEXIO_MCULCD_ReadDataArrayBlocking(FLEXIO_MCULCD_Type *base, void *data, size_t size); - -/*! - * @brief Send the same value many times in blocking way. - * - * This function sends the same value many times. It could be used to clear the - * LCD screen. If the data bus width is 8, this function will send LSB 8 bits of - * @p sameValue for @p size times. If the data bus is 16, this function will send - * LSB 16 bits of @p sameValue for @p size / 2 times. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param sameValue The same value to send. - * @param size How many bytes to send. - */ -void FLEXIO_MCULCD_WriteSameValueBlocking(FLEXIO_MCULCD_Type *base, uint32_t sameValue, size_t size); - -/*! - * @brief Performs a polling transfer. - * - * @note The API does not return until the transfer finished. - * - * @param base pointer to FLEXIO_MCULCD_Type structure. - * @param xfer pointer to flexio_mculcd_transfer_t structure. - */ -void FLEXIO_MCULCD_TransferBlocking(FLEXIO_MCULCD_Type *base, flexio_mculcd_transfer_t *xfer); -/*! @} */ - -/*! - * @name Transactional - * @{ - */ - -/*! - * @brief Initializes the FlexIO MCULCD handle, which is used in transactional - * functions. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param handle Pointer to the flexio_mculcd_handle_t structure to store the - * transfer state. - * @param callback The callback function. - * @param userData The parameter of the callback function. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_MCULCD_TransferCreateHandle(FLEXIO_MCULCD_Type *base, - flexio_mculcd_handle_t *handle, - flexio_mculcd_transfer_callback_t callback, - void *userData); - -/*! - * @brief Transfer data using IRQ. - * - * This function sends data using IRQ. This is a non-blocking function, which - * returns right away. When all data is sent out/received, the callback - * function is called. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param handle Pointer to the flexio_mculcd_handle_t structure to store the - * transfer state. - * @param xfer FlexIO MCULCD transfer structure. See #flexio_mculcd_transfer_t. - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_InvalidArgument Input argument is invalid. - * @retval kStatus_FLEXIO_MCULCD_Busy MCULCD is busy with another transfer. - */ -status_t FLEXIO_MCULCD_TransferNonBlocking(FLEXIO_MCULCD_Type *base, - flexio_mculcd_handle_t *handle, - flexio_mculcd_transfer_t *xfer); - -/*! - * @brief Aborts the data transfer, which used IRQ. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param handle Pointer to the flexio_mculcd_handle_t structure to store the - * transfer state. - */ -void FLEXIO_MCULCD_TransferAbort(FLEXIO_MCULCD_Type *base, flexio_mculcd_handle_t *handle); - -/*! - * @brief Gets the data transfer status which used IRQ. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param handle Pointer to the flexio_mculcd_handle_t structure to store the - * transfer state. - * @param count How many bytes transferred so far by the non-blocking transaction. - * @retval kStatus_Success Get the transferred count Successfully. - * @retval kStatus_NoTransferInProgress No transfer in process. - */ -status_t FLEXIO_MCULCD_TransferGetCount(FLEXIO_MCULCD_Type *base, flexio_mculcd_handle_t *handle, size_t *count); - -/*! - * @brief FlexIO MCULCD IRQ handler function. - * - * @param base Pointer to the FLEXIO_MCULCD_Type structure. - * @param handle Pointer to the flexio_mculcd_handle_t structure to store the - * transfer state. - */ -void FLEXIO_MCULCD_TransferHandleIRQ(void *base, void *handle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /*_cplusplus*/ -/*! @} */ - -#endif /*FSL_FLEXIO_MCULCD_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_mculcd_edma.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_mculcd_edma.c deleted file mode 100644 index 0c52c4e8c08..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_mculcd_edma.c +++ /dev/null @@ -1,568 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2019,2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio_mculcd_edma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio_mculcd_edma" -#endif - -#define EDMA_MAX_MAJOR_COUNT (DMA_CITER_ELINKNO_CITER_MASK >> DMA_CITER_ELINKNO_CITER_SHIFT) - -enum -{ - kFLEXIO_MCULCD_StateIdle, /*!< No transfer in progress. */ - kFLEXIO_MCULCD_StateReadArray, /*!< Reading array in progress. */ - kFLEXIO_MCULCD_StateWriteArray, /*!< Writing array in progress. */ - kFLEXIO_MCULCD_StateWriteSameValue, /*!< Writing the same value in progress. - */ -}; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief EDMA callback function for FLEXIO MCULCD TX. - * - * For details, see @ref edma_callback. - */ -static void FLEXIO_MCULCD_TxEDMACallback(edma_handle_t *DmaHandle, void *param, bool transferDone, uint32_t tcds); - -/*! - * @brief EDMA callback function for FLEXIO MCULCD RX. - * - * For details, see @ref edma_callback. - */ -static void FLEXIO_MCULCD_RxEDMACallback(edma_handle_t *DmaHandle, void *param, bool transferDone, uint32_t tcds); - -/*! - * @brief Set EDMA config for FLEXIO MCULCD transfer. - * - * @param base pointer to FLEXIO_MCULCD_Type structure. - * @param handle pointer to flexio_mculcd_edma_handle_t structure to store the - * transfer state. - */ -static void FLEXIO_MCULCD_EDMAConfig(FLEXIO_MCULCD_Type *base, flexio_mculcd_edma_handle_t *handle); - -/*! - * @brief Convert the FlexIO shifter number to eDMA modulo. - * - * @param shifterNum The FlexIO shifter number. - * @param modulo The modulo number. - * @retval Get the modulo successfully. - * @retval Could not get the modulo for the shifter number. - */ -static bool FLEXIO_MCULCD_GetEDMAModulo(uint8_t shifterNum, edma_modulo_t *modulo); - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -static void FLEXIO_MCULCD_TxEDMACallback(edma_handle_t *DmaHandle, void *param, bool transferDone, uint32_t tcds) -{ - tcds = tcds; - flexio_mculcd_edma_handle_t *flexioLcdMcuHandle = (flexio_mculcd_edma_handle_t *)param; - FLEXIO_MCULCD_Type *flexioLcdMcuBase = flexioLcdMcuHandle->base; - - if (transferDone) - { - if (flexioLcdMcuHandle->remainingCount >= flexioLcdMcuHandle->minorLoopBytes) - { - FLEXIO_MCULCD_EDMAConfig(flexioLcdMcuBase, flexioLcdMcuHandle); - EDMA_StartTransfer(flexioLcdMcuHandle->txDmaHandle); - } - else - { - FLEXIO_MCULCD_EnableTxDMA(flexioLcdMcuBase, false); - - /* Now the data are in shifter, wait for the data send out from the shifter. */ - FLEXIO_MCULCD_WaitTransmitComplete(); - - /* Disable the TX shifter and the timer. */ - FLEXIO_MCULCD_ClearMultiBeatsWriteConfig(flexioLcdMcuBase); - - /* Send the remaining data. */ - if (0U != flexioLcdMcuHandle->remainingCount) - { - if ((uint32_t)kFLEXIO_MCULCD_StateWriteSameValue == flexioLcdMcuHandle->state) - { - FLEXIO_MCULCD_WriteSameValueBlocking(flexioLcdMcuBase, flexioLcdMcuHandle->dataAddrOrSameValue, - flexioLcdMcuHandle->remainingCount); - } - else - { - FLEXIO_MCULCD_WriteDataArrayBlocking(flexioLcdMcuBase, - (uint8_t *)flexioLcdMcuHandle->dataAddrOrSameValue, - flexioLcdMcuHandle->remainingCount); - } - } - - /* De-assert nCS. */ - FLEXIO_MCULCD_StopTransfer(flexioLcdMcuBase); - - /* Change the state. */ - flexioLcdMcuHandle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - flexioLcdMcuHandle->dataCount = 0; - flexioLcdMcuHandle->remainingCount = 0; - - /* Callback to inform upper layer. */ - if (NULL != flexioLcdMcuHandle->completionCallback) - { - flexioLcdMcuHandle->completionCallback(flexioLcdMcuBase, flexioLcdMcuHandle, kStatus_FLEXIO_MCULCD_Idle, - flexioLcdMcuHandle->userData); - } - } - } -} - -static void FLEXIO_MCULCD_RxEDMACallback(edma_handle_t *DmaHandle, void *param, bool transferDone, uint32_t tcds) -{ - tcds = tcds; - uint32_t i; - uint32_t rxBufAddr; - flexio_mculcd_edma_handle_t *flexioLcdMcuHandle = (flexio_mculcd_edma_handle_t *)param; - FLEXIO_MCULCD_Type *flexioLcdMcuBase = flexioLcdMcuHandle->base; - FLEXIO_Type *flexioBase = flexioLcdMcuBase->flexioBase; - - if (transferDone) - { - if (flexioLcdMcuHandle->remainingCount >= (2U * flexioLcdMcuHandle->minorLoopBytes)) - { - FLEXIO_MCULCD_EDMAConfig(flexioLcdMcuBase, flexioLcdMcuHandle); - EDMA_StartTransfer(flexioLcdMcuHandle->rxDmaHandle); - } - else - { - FLEXIO_MCULCD_EnableRxDMA(flexioLcdMcuBase, false); - - /* Wait the data saved to the shifter buffer. */ - while (0U == ((1UL << flexioLcdMcuBase->rxShifterEndIndex) & FLEXIO_GetShifterStatusFlags(flexioBase))) - { - } - - /* Disable the RX shifter and the timer. */ - FLEXIO_MCULCD_ClearMultiBeatsReadConfig(flexioLcdMcuBase); - - rxBufAddr = FLEXIO_MCULCD_GetRxDataRegisterAddress(flexioLcdMcuBase); - -/* Read out the data. */ -#if (defined(__CORTEX_M) && (__CORTEX_M == 0)) - /* Cortex M0 and M0+ only support aligned access. */ - for (i = 0; i < flexioLcdMcuHandle->rxShifterNum * 4; i++) - { - ((uint8_t *)(flexioLcdMcuHandle->dataAddrOrSameValue))[i] = ((volatile uint8_t *)rxBufAddr)[i]; - } -#else - for (i = 0; i < flexioLcdMcuHandle->rxShifterNum; i++) - { - ((uint32_t *)(flexioLcdMcuHandle->dataAddrOrSameValue))[i] = ((volatile uint32_t *)rxBufAddr)[i]; - } -#endif - flexioLcdMcuHandle->remainingCount -= flexioLcdMcuHandle->minorLoopBytes; - - if (0U != flexioLcdMcuHandle->remainingCount) - { - FLEXIO_MCULCD_ReadDataArrayBlocking( - flexioLcdMcuBase, - (uint8_t *)(flexioLcdMcuHandle->dataAddrOrSameValue + flexioLcdMcuHandle->minorLoopBytes), - flexioLcdMcuHandle->remainingCount); - } - - /* De-assert nCS. */ - FLEXIO_MCULCD_StopTransfer(flexioLcdMcuBase); - - /* Change the state. */ - flexioLcdMcuHandle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - flexioLcdMcuHandle->dataCount = 0; - flexioLcdMcuHandle->remainingCount = 0; - - /* Callback to inform upper layer. */ - if (NULL != flexioLcdMcuHandle->completionCallback) - { - flexioLcdMcuHandle->completionCallback(flexioLcdMcuBase, flexioLcdMcuHandle, kStatus_FLEXIO_MCULCD_Idle, - flexioLcdMcuHandle->userData); - } - } - } -} - -static void FLEXIO_MCULCD_EDMAConfig(FLEXIO_MCULCD_Type *base, flexio_mculcd_edma_handle_t *handle) -{ - edma_transfer_config_t xferConfig = {0}; - edma_transfer_size_t transferSize = kEDMA_TransferSize1Bytes; - int16_t offset; - uint32_t majorLoopCounts; - uint32_t transferCount; - -#if (8 == FLEXIO_MCULCD_DATA_BUS_WIDTH) - transferSize = kEDMA_TransferSize1Bytes; - offset = 1; -#else - transferSize = kEDMA_TransferSize2Bytes; - offset = 2; -#endif - - majorLoopCounts = handle->remainingCount / handle->minorLoopBytes; - - /* For reading, the last minor loop data is not tranfered by DMA. */ - if ((uint32_t)kFLEXIO_MCULCD_StateReadArray == handle->state) - { - majorLoopCounts--; - } - - if (majorLoopCounts > EDMA_MAX_MAJOR_COUNT) - { - majorLoopCounts = EDMA_MAX_MAJOR_COUNT; - } - - transferCount = majorLoopCounts * handle->minorLoopBytes; - - if ((uint32_t)kFLEXIO_MCULCD_StateReadArray == handle->state) - { - xferConfig.srcAddr = FLEXIO_MCULCD_GetRxDataRegisterAddress(base); - xferConfig.destAddr = handle->dataAddrOrSameValue; - xferConfig.srcTransferSize = kEDMA_TransferSize4Bytes; - xferConfig.destTransferSize = transferSize; - xferConfig.srcOffset = 4; - xferConfig.destOffset = offset; - xferConfig.minorLoopBytes = handle->minorLoopBytes; - xferConfig.majorLoopCounts = majorLoopCounts; - handle->remainingCount -= transferCount; - handle->dataAddrOrSameValue += transferCount; - (void)EDMA_SubmitTransfer(handle->rxDmaHandle, &xferConfig); - EDMA_SetModulo(handle->rxDmaHandle->base, handle->rxDmaHandle->channel, handle->rxEdmaModulo, - kEDMA_ModuloDisable); - } - else - { - if ((uint32_t)kFLEXIO_MCULCD_StateWriteArray == handle->state) - { - xferConfig.srcAddr = handle->dataAddrOrSameValue; - xferConfig.srcOffset = offset; - handle->dataAddrOrSameValue += transferCount; - } - else - { - xferConfig.srcAddr = (uint32_t)(&(handle->dataAddrOrSameValue)); - xferConfig.srcOffset = 0; - } - xferConfig.destAddr = FLEXIO_MCULCD_GetTxDataRegisterAddress(base); - xferConfig.srcTransferSize = transferSize; - xferConfig.destTransferSize = kEDMA_TransferSize4Bytes; - xferConfig.destOffset = 4; - xferConfig.minorLoopBytes = handle->minorLoopBytes; - xferConfig.majorLoopCounts = majorLoopCounts; - handle->remainingCount -= transferCount; - (void)EDMA_SubmitTransfer(handle->txDmaHandle, &xferConfig); - EDMA_SetModulo(handle->txDmaHandle->base, handle->txDmaHandle->channel, kEDMA_ModuloDisable, - handle->txEdmaModulo); - } -} - -static bool FLEXIO_MCULCD_GetEDMAModulo(uint8_t shifterNum, edma_modulo_t *modulo) -{ - bool ret = true; - - switch (shifterNum) - { - case 1U: - *modulo = kEDMA_Modulo4bytes; - break; - case 2U: - *modulo = kEDMA_Modulo8bytes; - break; - case 4U: - *modulo = kEDMA_Modulo16bytes; - break; - case 8U: - *modulo = kEDMA_Modulo32bytes; - break; - default: - ret = false; - break; - } - - return ret; -} - -/*! - * brief Initializes the FLEXO MCULCD master eDMA handle. - * - * This function initializes the FLEXO MCULCD master eDMA handle which can be - * used for other FLEXO MCULCD transactional APIs. For a specified FLEXO MCULCD - * instance, call this API once to get the initialized handle. - * - * param base Pointer to FLEXIO_MCULCD_Type structure. - * param handle Pointer to flexio_mculcd_edma_handle_t structure to store the - * transfer state. - * param callback MCULCD transfer complete callback, NULL means no callback. - * param userData callback function parameter. - * param txDmaHandle User requested eDMA handle for FlexIO MCULCD eDMA TX, - * the DMA request source of this handle should be the first of TX shifters. - * param rxDmaHandle User requested eDMA handle for FlexIO MCULCD eDMA RX, - * the DMA request source of this handle should be the last of RX shifters. - * retval kStatus_Success Successfully create the handle. - */ -status_t FLEXIO_MCULCD_TransferCreateHandleEDMA(FLEXIO_MCULCD_Type *base, - flexio_mculcd_edma_handle_t *handle, - flexio_mculcd_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *txDmaHandle, - edma_handle_t *rxDmaHandle) -{ - assert(NULL != handle); - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Initialize the state. */ - handle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - - /* Register callback and userData. */ - handle->completionCallback = callback; - handle->userData = userData; - - handle->base = base; - handle->txShifterNum = base->txShifterEndIndex - base->txShifterStartIndex + 1U; - handle->rxShifterNum = base->rxShifterEndIndex - base->rxShifterStartIndex + 1U; - - if (NULL != rxDmaHandle) - { - if (!FLEXIO_MCULCD_GetEDMAModulo(handle->rxShifterNum, &handle->rxEdmaModulo)) - { - return kStatus_InvalidArgument; - } - - handle->rxDmaHandle = rxDmaHandle; - EDMA_SetCallback(rxDmaHandle, FLEXIO_MCULCD_RxEDMACallback, handle); - } - - if (NULL != txDmaHandle) - { - if (!FLEXIO_MCULCD_GetEDMAModulo(handle->txShifterNum, &handle->txEdmaModulo)) - { - return kStatus_InvalidArgument; - } - - handle->txDmaHandle = txDmaHandle; - EDMA_SetCallback(txDmaHandle, FLEXIO_MCULCD_TxEDMACallback, handle); - } - - return kStatus_Success; -} - -/*! - * brief Performs a non-blocking FlexIO MCULCD transfer using eDMA. - * - * This function returns immediately after transfer initiates. To check whether - * the transfer is completed, user could: - * 1. Use the transfer completed callback; - * 2. Polling function ref FLEXIO_MCULCD_GetTransferCountEDMA - * - * param base pointer to FLEXIO_MCULCD_Type structure. - * param handle pointer to flexio_mculcd_edma_handle_t structure to store the - * transfer state. - * param xfer Pointer to FlexIO MCULCD transfer structure. - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_InvalidArgument Input argument is invalid. - * retval kStatus_FLEXIO_MCULCD_Busy FlexIO MCULCD is not idle, it is running another - * transfer. - */ -status_t FLEXIO_MCULCD_TransferEDMA(FLEXIO_MCULCD_Type *base, - flexio_mculcd_edma_handle_t *handle, - flexio_mculcd_transfer_t *xfer) -{ - assert(NULL != handle); - assert(NULL != xfer); - - /* - * The data transfer mechanism: - * - * Read: - * Assume the data length is Lr = (n1 * minorLoopBytes + n2), where - * n2 < minorLoopBytes. - * If (n1 <= 1), then all data are sent using blocking method. - * If (n1 > 1), then the beginning ((n1-1) * minorLoopBytes) are read - * using DMA, the left (minorLoopBytes + n2) are read using blocking method. - * - * Write: - * Assume the data length is Lw = (n1 * minorLoopBytes + n2), where - * n2 < minorLoopBytes. - * If (n1 = 0), then all data are sent using blocking method. - * If (n1 >= 1), then the beginning (n1 * minorLoopBytes) are sent - * using DMA, the left n2 are sent using blocking method. - */ - - /* Check if the device is busy. */ - if ((uint32_t)kFLEXIO_MCULCD_StateIdle != handle->state) - { - return kStatus_FLEXIO_MCULCD_Busy; - } - - /* Set the state in handle. */ - if (kFLEXIO_MCULCD_ReadArray == xfer->mode) - { - handle->state = (uint32_t)kFLEXIO_MCULCD_StateReadArray; - handle->minorLoopBytes = handle->rxShifterNum * 4UL; - } - else - { - handle->minorLoopBytes = handle->txShifterNum * 4UL; - - if (kFLEXIO_MCULCD_WriteArray == xfer->mode) - { - handle->state = (uint32_t)kFLEXIO_MCULCD_StateWriteArray; - } - else - { - handle->state = (uint32_t)kFLEXIO_MCULCD_StateWriteSameValue; - } - } - - /* - * For TX, if data is less than one minor loop, then use polling method. - * For RX, if data is less than two minor loop, then use polling method. - */ - if ((xfer->dataSize < handle->minorLoopBytes) || - ((kFLEXIO_MCULCD_ReadArray == xfer->mode) && (xfer->dataSize < 2U * (handle->minorLoopBytes)))) - { - FLEXIO_MCULCD_TransferBlocking(base, xfer); - - handle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - - /* Callback to inform upper layer. */ - if (NULL != handle->completionCallback) - { - handle->completionCallback(base, handle, kStatus_FLEXIO_MCULCD_Idle, handle->userData); - } - } - else - { - handle->dataCount = xfer->dataSize; - handle->remainingCount = xfer->dataSize; - handle->dataAddrOrSameValue = xfer->dataAddrOrSameValue; - - /* Setup DMA to transfer data. */ - /* Assert the nCS. */ - FLEXIO_MCULCD_StartTransfer(base); - - if (!xfer->dataOnly) - { - /* Send the command. */ - FLEXIO_MCULCD_WriteCommandBlocking(base, xfer->command); - } - - /* Setup the DMA configuration. */ - FLEXIO_MCULCD_EDMAConfig(base, handle); - - /* Start the transfer. */ - if (kFLEXIO_MCULCD_ReadArray == xfer->mode) - { - /* For 6800, assert the RDWR pin. */ - if (kFLEXIO_MCULCD_6800 == base->busType) - { - base->setRDWRPin(true); - } - FLEXIO_MCULCD_SetMultiBeatsReadConfig(base); - FLEXIO_MCULCD_EnableRxDMA(base, true); - EDMA_StartTransfer(handle->rxDmaHandle); - } - else - { - /* For 6800, de-assert the RDWR pin. */ - if (kFLEXIO_MCULCD_6800 == base->busType) - { - base->setRDWRPin(false); - } - FLEXIO_MCULCD_SetMultiBeatsWriteConfig(base); - FLEXIO_MCULCD_EnableTxDMA(base, true); - EDMA_StartTransfer(handle->txDmaHandle); - } - } - - return kStatus_Success; -} - -/*! - * brief Aborts a FlexIO MCULCD transfer using eDMA. - * - * param base pointer to FLEXIO_MCULCD_Type structure. - * param handle FlexIO MCULCD eDMA handle pointer. - */ -void FLEXIO_MCULCD_TransferAbortEDMA(FLEXIO_MCULCD_Type *base, flexio_mculcd_edma_handle_t *handle) -{ - assert(NULL != handle); - - /* Disable dma. */ - if (NULL != handle->txDmaHandle) - { - EDMA_AbortTransfer(handle->txDmaHandle); - } - if (NULL != handle->rxDmaHandle) - { - EDMA_AbortTransfer(handle->rxDmaHandle); - } - - /* Disable DMA enable bit. */ - FLEXIO_MCULCD_EnableTxDMA(handle->base, false); - FLEXIO_MCULCD_EnableRxDMA(handle->base, false); - - /* Set the handle state. */ - handle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - handle->dataCount = 0; -} - -/*! - * brief Gets the remaining bytes for FlexIO MCULCD eDMA transfer. - * - * param base pointer to FLEXIO_MCULCD_Type structure. - * param handle FlexIO MCULCD eDMA handle pointer. - * param count Number of count transferred so far by the eDMA transaction. - * retval kStatus_Success Get the transferred count Successfully. - * retval kStatus_NoTransferInProgress No transfer in process. - */ -status_t FLEXIO_MCULCD_TransferGetCountEDMA(FLEXIO_MCULCD_Type *base, - flexio_mculcd_edma_handle_t *handle, - size_t *count) -{ - assert(NULL != handle); - assert(NULL != count); - uint32_t state = handle->state; - - if ((uint32_t)kFLEXIO_MCULCD_StateIdle == state) - { - return kStatus_NoTransferInProgress; - } - else - { - *count = handle->dataCount - handle->remainingCount; - - if ((uint32_t)kFLEXIO_MCULCD_StateReadArray == state) - { - *count -= handle->minorLoopBytes * - EDMA_GetRemainingMajorLoopCount(handle->rxDmaHandle->base, handle->rxDmaHandle->channel); - } - else - { - *count -= handle->minorLoopBytes * - EDMA_GetRemainingMajorLoopCount(handle->txDmaHandle->base, handle->txDmaHandle->channel); - } - } - - return kStatus_Success; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_mculcd_edma.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_mculcd_edma.h deleted file mode 100644 index 98da16eef92..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_mculcd_edma.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2020,2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_FLEXIO_MCULCD_EDMA_H_ -#define FSL_FLEXIO_MCULCD_EDMA_H_ - -#include "fsl_edma.h" -#include "fsl_flexio_mculcd.h" - -/*! - * @addtogroup flexio_edma_mculcd - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @{ */ -/*! @brief FlexIO MCULCD EDMA driver version. */ -#define FSL_FLEXIO_MCULCD_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 0, 5)) -/*! @} */ - -/*! @brief typedef for flexio_mculcd_edma_handle_t in advance. */ -typedef struct _flexio_mculcd_edma_handle flexio_mculcd_edma_handle_t; - -/*! @brief FlexIO MCULCD master callback for transfer complete. - * - * When transfer finished, the callback function is called and returns the - * @p status as kStatus_FLEXIO_MCULCD_Idle. - */ -typedef void (*flexio_mculcd_edma_transfer_callback_t)(FLEXIO_MCULCD_Type *base, - flexio_mculcd_edma_handle_t *handle, - status_t status, - void *userData); - -/*! @brief FlexIO MCULCD eDMA transfer handle, users should not touch the - * content of the handle.*/ -struct _flexio_mculcd_edma_handle -{ - FLEXIO_MCULCD_Type *base; /*!< Pointer to the FLEXIO_MCULCD_Type. */ - uint8_t txShifterNum; /*!< Number of shifters used for TX. */ - uint8_t rxShifterNum; /*!< Number of shifters used for RX. */ - uint32_t minorLoopBytes; /*!< eDMA transfer minor loop bytes. */ - edma_modulo_t txEdmaModulo; /*!< Modulo value for the FlexIO shifter buffer access. */ - edma_modulo_t rxEdmaModulo; /*!< Modulo value for the FlexIO shifter buffer access. */ - uint32_t dataAddrOrSameValue; /*!< When sending the same value for many times, - this is the value to send. When writing or - reading array, this is the address of the - data array. */ - size_t dataCount; /*!< Total count to be transferred. */ - volatile size_t remainingCount; /*!< Remaining count still not transfered. */ - volatile uint32_t state; /*!< FlexIO MCULCD driver internal state. */ - edma_handle_t *txDmaHandle; /*!< DMA handle for MCULCD TX */ - edma_handle_t *rxDmaHandle; /*!< DMA handle for MCULCD RX */ - flexio_mculcd_edma_transfer_callback_t completionCallback; /*!< Callback for MCULCD DMA transfer */ - void *userData; /*!< User Data for MCULCD DMA callback */ -}; - -/******************************************************************************* - * APIs - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name eDMA Transactional - * @{ - */ - -/*! - * @brief Initializes the FLEXO MCULCD master eDMA handle. - * - * This function initializes the FLEXO MCULCD master eDMA handle which can be - * used for other FLEXO MCULCD transactional APIs. For a specified FLEXO MCULCD - * instance, call this API once to get the initialized handle. - * - * @param base Pointer to FLEXIO_MCULCD_Type structure. - * @param handle Pointer to flexio_mculcd_edma_handle_t structure to store the - * transfer state. - * @param callback MCULCD transfer complete callback, NULL means no callback. - * @param userData callback function parameter. - * @param txDmaHandle User requested eDMA handle for FlexIO MCULCD eDMA TX, - * the DMA request source of this handle should be the first of TX shifters. - * @param rxDmaHandle User requested eDMA handle for FlexIO MCULCD eDMA RX, - * the DMA request source of this handle should be the last of RX shifters. - * @retval kStatus_Success Successfully create the handle. - */ -status_t FLEXIO_MCULCD_TransferCreateHandleEDMA(FLEXIO_MCULCD_Type *base, - flexio_mculcd_edma_handle_t *handle, - flexio_mculcd_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *txDmaHandle, - edma_handle_t *rxDmaHandle); - -/*! - * @brief Performs a non-blocking FlexIO MCULCD transfer using eDMA. - * - * This function returns immediately after transfer initiates. To check whether - * the transfer is completed, user could: - * 1. Use the transfer completed callback; - * 2. Polling function FLEXIO_MCULCD_GetTransferCountEDMA - * - * @param base pointer to FLEXIO_MCULCD_Type structure. - * @param handle pointer to flexio_mculcd_edma_handle_t structure to store the - * transfer state. - * @param xfer Pointer to FlexIO MCULCD transfer structure. - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_InvalidArgument Input argument is invalid. - * @retval kStatus_FLEXIO_MCULCD_Busy FlexIO MCULCD is not idle, it is running another - * transfer. - */ -status_t FLEXIO_MCULCD_TransferEDMA(FLEXIO_MCULCD_Type *base, - flexio_mculcd_edma_handle_t *handle, - flexio_mculcd_transfer_t *xfer); - -/*! - * @brief Aborts a FlexIO MCULCD transfer using eDMA. - * - * @param base pointer to FLEXIO_MCULCD_Type structure. - * @param handle FlexIO MCULCD eDMA handle pointer. - */ -void FLEXIO_MCULCD_TransferAbortEDMA(FLEXIO_MCULCD_Type *base, flexio_mculcd_edma_handle_t *handle); - -/*! - * @brief Gets the remaining bytes for FlexIO MCULCD eDMA transfer. - * - * @param base pointer to FLEXIO_MCULCD_Type structure. - * @param handle FlexIO MCULCD eDMA handle pointer. - * @param count Number of count transferred so far by the eDMA transaction. - * @retval kStatus_Success Get the transferred count Successfully. - * @retval kStatus_NoTransferInProgress No transfer in process. - */ -status_t FLEXIO_MCULCD_TransferGetCountEDMA(FLEXIO_MCULCD_Type *base, - flexio_mculcd_edma_handle_t *handle, - size_t *count); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ -#endif /* FSL_FLEXIO_MCULCD_EDMA_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_mculcd_smartdma.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_mculcd_smartdma.c deleted file mode 100644 index 3ca53150525..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_mculcd_smartdma.c +++ /dev/null @@ -1,407 +0,0 @@ -/* - * Copyright 2019-2021,2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio_mculcd_smartdma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio_mculcd_smartdma" -#endif - -#define FLEXIO_MCULCD_SMARTDMA_TX_START_SHIFTER 0U -#define FLEXIO_MCULCD_SMARTDMA_TX_END_SHIFTER 7U -#define FLEXIO_MCULCD_SMARTDMA_TX_SHIFTER_NUM \ - (FLEXIO_MCULCD_SMARTDMA_TX_END_SHIFTER - FLEXIO_MCULCD_SMARTDMA_TX_START_SHIFTER + 1) - -enum _MCULCD_transfer_state -{ - kFLEXIO_MCULCD_StateIdle, /*!< No transfer in progress. */ - kFLEXIO_MCULCD_StateReadArray, /*!< Reading array in progress. */ - kFLEXIO_MCULCD_StateWriteArray, /*!< Writing array in progress. */ - kFLEXIO_MCULCD_StateWriteSameValue, /*!< Writing the same value in progress. - */ -}; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Get the TX chunk size. - * - * The SMARTDMA TX transfer memory must be 4Byte aligned, the transfer size must - * be multiple of 64Byte. So the transfer data is devided in to three part: - * part1 + part2 + part3. - * The part2 is transfered using SMARTDMA, it should be 4Byte aligned, multiple - * of 64Byte. - * The part1 and part3 are transfered using blocking method, each of them is - * less than 64Byte, and total of them is less than (64 + 4) bytes. - * - * This function gets the size of each part. - * - * @param totalLen The total TX size in byte. - * @param startAddr The start address of the TX data. - * @param part1Len Length of the part 1 in byte. - * @param part2Len Length of the part 2 in byte. - * @param part3Len Length of the part 3 in byte. - */ -static void FLEXIO_MCULCD_SMARTDMA_GetTxChunkLen( - uint32_t totalLen, uint32_t startAddr, uint32_t *part1Len, uint32_t *part2Len, uint32_t *part3Len); - -/*! - * @brief Convert RGB565 to RGB888. - * - * @param rgb565 Input RGB565. - * @param pixelCount Pixel count. - * @param rgb888 Output RGB888. - */ -static void FLEXIO_MCULCD_RGB656ToRGB888(const uint16_t *rgb565, uint32_t pixelCount, uint8_t *rgb888); - -/*! - * @brief Callback function registered to SMARTDMA driver. - */ -static void FLEXIO_MCULCD_SMARTDMA_Callback(void *param); - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ -static void FLEXIO_MCULCD_SMARTDMA_GetTxChunkLen( - uint32_t totalLen, uint32_t startAddr, uint32_t *part1Len, uint32_t *part2Len, uint32_t *part3Len) -{ - if (totalLen < FLEXIO_MCULCD_SMARTDMA_TX_LEN_ALIGN) - { - *part1Len = totalLen; - *part2Len = 0; - *part3Len = 0; - } - else - { - *part3Len = (startAddr + totalLen) & (FLEXIO_MCULCD_SMARTDMA_TX_ADDR_ALIGN - 1U); - *part2Len = ((uint32_t)(totalLen - *part3Len)) & (~(FLEXIO_MCULCD_SMARTDMA_TX_LEN_ALIGN - 1U)); - - if (FLEXIO_MCULCD_SMARTDMA_TX_LEN_ALIGN > *part2Len) - { - *part1Len = totalLen; - *part2Len = 0; - *part3Len = 0; - } - else - { - *part1Len = totalLen - *part2Len - *part3Len; - } - } -} - -static void FLEXIO_MCULCD_RGB656ToRGB888(const uint16_t *rgb565, uint32_t pixelCount, uint8_t *rgb888) -{ - while ((pixelCount--) != 0U) - { - *rgb888 = (uint8_t)(((*rgb565) & 0x001FU) << 3U); - rgb888++; - *rgb888 = (uint8_t)(((*rgb565) & 0x07E0U) >> 3U); - rgb888++; - *rgb888 = (uint8_t)(((*rgb565) & 0xF800U) >> 8U); - rgb888++; - - rgb565++; - } -} - -/*! - * brief Initializes the FLEXO MCULCD master SMARTDMA handle. - * - * This function initializes the FLEXO MCULCD master SMARTDMA handle which can be - * used for other FLEXO MCULCD transactional APIs. For a specified FLEXO MCULCD - * instance, call this API once to get the initialized handle. - * - * param base Pointer to FLEXIO_MCULCD_Type structure. - * param handle Pointer to flexio_mculcd_smartdma_handle_t structure to store the - * transfer state. - * param config Pointer to the configuration. - * param callback MCULCD transfer complete callback, NULL means no callback. - * param userData callback function parameter. - * retval kStatus_Success Successfully create the handle. - */ -status_t FLEXIO_MCULCD_TransferCreateHandleSMARTDMA(FLEXIO_MCULCD_Type *base, - flexio_mculcd_smartdma_handle_t *handle, - const flexio_mculcd_smartdma_config_t *config, - flexio_mculcd_smartdma_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - /* The SMARTDMA firmware only support TX using shifter 0 to shifter 7 */ - if (base->txShifterStartIndex != FLEXIO_MCULCD_SMARTDMA_TX_START_SHIFTER) - { - return kStatus_InvalidArgument; - } - - if (base->txShifterEndIndex != FLEXIO_MCULCD_SMARTDMA_TX_END_SHIFTER) - { - return kStatus_InvalidArgument; - } - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - if (NULL == config) - { - handle->smartdmaApi = (uint8_t)kSMARTDMA_FlexIO_DMA; - } - else - { - if (config->inputPixelFormat == config->outputPixelFormat) - { - handle->smartdmaApi = (uint8_t)kSMARTDMA_FlexIO_DMA; - } - else if (((config->inputPixelFormat == kFLEXIO_MCULCD_RGB565) && - (config->outputPixelFormat == kFLEXIO_MCULCD_RGB888)) || - ((config->inputPixelFormat == kFLEXIO_MCULCD_BGR565) && - (config->outputPixelFormat == kFLEXIO_MCULCD_BGR888))) - { - handle->smartdmaApi = (uint8_t)kSMARTDMA_FlexIO_DMA_RGB565To888; - handle->needColorConvert = true; - } - else - { - return kStatus_InvalidArgument; - } - } - - /* Initialize the state. */ - handle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - - /* Register callback and userData. */ - handle->completionCallback = callback; - handle->userData = userData; - handle->base = base; - - SMARTDMA_InstallFirmware(SMARTDMA_DISPLAY_MEM_ADDR, s_smartdmaDisplayFirmware, SMARTDMA_DISPLAY_FIRMWARE_SIZE); - - SMARTDMA_InstallCallback(FLEXIO_MCULCD_SMARTDMA_Callback, handle); - - /* The shifter interrupt is used by the SMARTDMA. */ - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, (1UL << FLEXIO_MCULCD_SMARTDMA_TX_END_SHIFTER)); - -#if (defined(SMARTDMA_USE_FLEXIO_SHIFTER_DMA) && SMARTDMA_USE_FLEXIO_SHIFTER_DMA) - FLEXIO_EnableShifterStatusDMA(base->flexioBase, 1UL, true); -#endif - - return kStatus_Success; -} - -/*! - * brief Performs a non-blocking FlexIO MCULCD transfer using SMARTDMA. - * - * This function returns immediately after transfer initiates. Use the callback - * function to check whether the transfer is completed. - * - * param base pointer to FLEXIO_MCULCD_Type structure. - * param handle pointer to flexio_mculcd_smartdma_handle_t structure to store the - * transfer state. - * param xfer Pointer to FlexIO MCULCD transfer structure. - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_InvalidArgument Input argument is invalid. - * retval kStatus_FLEXIO_MCULCD_Busy FlexIO MCULCD is not idle, it is running another - * transfer. - */ -status_t FLEXIO_MCULCD_TransferSMARTDMA(FLEXIO_MCULCD_Type *base, - flexio_mculcd_smartdma_handle_t *handle, - flexio_mculcd_transfer_t *xfer) -{ - assert(handle != NULL); - assert(xfer != NULL); - - uint32_t part1Len, part2Len, part3Len; - - /* Check if the device is busy. */ - if ((uint32_t)kFLEXIO_MCULCD_StateIdle != handle->state) - { - return kStatus_FLEXIO_MCULCD_Busy; - } - - /* Only support write array. */ - if (kFLEXIO_MCULCD_WriteArray != xfer->mode) - { - return kStatus_InvalidArgument; - } - - FLEXIO_MCULCD_SMARTDMA_GetTxChunkLen(xfer->dataSize, xfer->dataAddrOrSameValue, &part1Len, &part2Len, &part3Len); - - handle->state = (uint32_t)kFLEXIO_MCULCD_StateWriteArray; - - /* Start transfer. */ - handle->remainingCount = xfer->dataSize; - handle->dataCount = xfer->dataSize; - handle->dataAddrOrSameValue = xfer->dataAddrOrSameValue; - - /* Assert the nCS. */ - FLEXIO_MCULCD_StartTransfer(base); - - if (!xfer->dataOnly) - { - /* Send the command. */ - FLEXIO_MCULCD_WriteCommandBlocking(base, xfer->command); - } - - if (part1Len > 0U) - { - if (handle->needColorConvert) - { - FLEXIO_MCULCD_RGB656ToRGB888((uint16_t *)xfer->dataAddrOrSameValue, part1Len >> 1U, - handle->blockingXferBuffer); - FLEXIO_MCULCD_WriteDataArrayBlocking(base, handle->blockingXferBuffer, (part1Len >> 1U) * 3U); - } - else - { - FLEXIO_MCULCD_WriteDataArrayBlocking(base, (void *)(uint8_t *)xfer->dataAddrOrSameValue, (size_t)part1Len); - } - handle->remainingCount -= part1Len; - handle->dataAddrOrSameValue += part1Len; - } - - if (0U == part2Len) - { - /* In this case, all data are sent out as part 1. Only notify upper layer here. */ - FLEXIO_MCULCD_StopTransfer(base); - handle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - - /* Callback to inform upper layer. */ - if (NULL != handle->completionCallback) - { - handle->completionCallback(base, handle, kStatus_FLEXIO_MCULCD_Idle, handle->userData); - } - } - else - { - /* For 6800, de-assert the RDWR pin. */ - if (kFLEXIO_MCULCD_6800 == base->busType) - { - base->setRDWRPin(false); - } - - FLEXIO_MCULCD_SetMultiBeatsWriteConfig(base); - - /* Save the part 3 information. */ - handle->dataCountUsingEzh = part2Len; - handle->dataAddrOrSameValue += part2Len; - - /* The part 3 is transfered using blocking method in ISR, convert the color - to save time in ISR. */ - if ((0U != part3Len) && (handle->needColorConvert)) - { - FLEXIO_MCULCD_RGB656ToRGB888((uint16_t *)xfer->dataAddrOrSameValue, part3Len >> 1U, - handle->blockingXferBuffer); - } - - handle->smartdmaParam.p_buffer = (uint32_t *)(xfer->dataAddrOrSameValue + part1Len); - handle->smartdmaParam.buffersize = part2Len; - handle->smartdmaParam.smartdma_stack = handle->smartdmaStack; - - SMARTDMA_Reset(); - SMARTDMA_Boot(handle->smartdmaApi, &(handle->smartdmaParam), 0); - } - - return kStatus_Success; -} - -/*! - * brief Aborts a FlexIO MCULCD transfer using SMARTDMA. - * - * param base pointer to FLEXIO_MCULCD_Type structure. - * param handle FlexIO MCULCD SMARTDMA handle pointer. - */ -void FLEXIO_MCULCD_TransferAbortSMARTDMA(FLEXIO_MCULCD_Type *base, flexio_mculcd_smartdma_handle_t *handle) -{ - assert(handle != NULL); - - SMARTDMA_Reset(); - - /* Set the handle state. */ - handle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - handle->dataCount = 0; -} - -/*! - * brief Gets the remaining bytes for FlexIO MCULCD SMARTDMA transfer. - * - * param base pointer to FLEXIO_MCULCD_Type structure. - * param handle FlexIO MCULCD SMARTDMA handle pointer. - * param count Number of count transferred so far by the SMARTDMA transaction. - * retval kStatus_Success Get the transferred count Successfully. - * retval kStatus_NoTransferInProgress No transfer in process. - */ -status_t FLEXIO_MCULCD_TransferGetCountSMARTDMA(FLEXIO_MCULCD_Type *base, - flexio_mculcd_smartdma_handle_t *handle, - size_t *count) -{ - assert(handle != NULL); - assert(count != NULL); - - uint32_t state = handle->state; - - if ((uint32_t)kFLEXIO_MCULCD_StateIdle == state) - { - return kStatus_NoTransferInProgress; - } - else - { - *count = handle->dataCount - handle->remainingCount; - } - - return kStatus_Success; -} - -static void FLEXIO_MCULCD_SMARTDMA_Callback(void *param) -{ - flexio_mculcd_smartdma_handle_t *flexioMculcdSmartDmaHandle = (flexio_mculcd_smartdma_handle_t *)param; - - FLEXIO_MCULCD_Type *flexioLcdMcuBase = flexioMculcdSmartDmaHandle->base; - - FLEXIO_MCULCD_WaitTransmitComplete(); - - /* Disable the TX shifter and the timer. */ - FLEXIO_MCULCD_ClearMultiBeatsWriteConfig(flexioLcdMcuBase); - - flexioMculcdSmartDmaHandle->remainingCount -= flexioMculcdSmartDmaHandle->dataCountUsingEzh; - - /* Send the part 3 */ - if (0U != flexioMculcdSmartDmaHandle->remainingCount) - { - if (flexioMculcdSmartDmaHandle->needColorConvert) - { - FLEXIO_MCULCD_WriteDataArrayBlocking(flexioLcdMcuBase, flexioMculcdSmartDmaHandle->blockingXferBuffer, - (flexioMculcdSmartDmaHandle->remainingCount >> 1U) * 3U); - } - else - { - FLEXIO_MCULCD_WriteDataArrayBlocking(flexioLcdMcuBase, - (void *)(uint8_t *)flexioMculcdSmartDmaHandle->dataAddrOrSameValue, - flexioMculcdSmartDmaHandle->remainingCount); - } - } - - flexioMculcdSmartDmaHandle->remainingCount = 0; - FLEXIO_MCULCD_StopTransfer(flexioLcdMcuBase); - flexioMculcdSmartDmaHandle->state = (uint32_t)kFLEXIO_MCULCD_StateIdle; - - /* Callback to inform upper layer. */ - if (NULL != flexioMculcdSmartDmaHandle->completionCallback) - { - flexioMculcdSmartDmaHandle->completionCallback(flexioLcdMcuBase, flexioMculcdSmartDmaHandle, - kStatus_FLEXIO_MCULCD_Idle, - flexioMculcdSmartDmaHandle->userData); - } -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_mculcd_smartdma.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_mculcd_smartdma.h deleted file mode 100644 index 3500aaaed0e..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_mculcd_smartdma.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright 2019,2021,2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_FLEXIO_MCULCD_SMARTDMA_H_ -#define FSL_FLEXIO_MCULCD_SMARTDMA_H_ - -#include "fsl_smartdma.h" -#include "fsl_flexio_mculcd.h" - -/*! - * @addtogroup flexio_smartdma_mculcd - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*@{*/ -/*! @brief FlexIO MCULCD SMARTDMA driver version. */ -#define FSL_FLEXIO_MCULCD_SMARTDMA_DRIVER_VERSION (MAKE_VERSION(2, 0, 4)) -/*@}*/ - -/*! @brief SMARTDMA transfer size should be multiple of 64 bytes. */ -#define FLEXIO_MCULCD_SMARTDMA_TX_LEN_ALIGN 64U - -/*! @brief SMARTDMA transfer memory address should be 4 byte aligned. */ -#define FLEXIO_MCULCD_SMARTDMA_TX_ADDR_ALIGN 4U - -/*! @brief typedef for flexio_mculcd_smartdma_handle_t in advance. */ -typedef struct _flexio_mculcd_smartdma_handle flexio_mculcd_smartdma_handle_t; - -/*! @brief FlexIO MCULCD master callback for transfer complete. - * - * When transfer finished, the callback function is called and returns the - * @p status as kStatus_FLEXIO_MCULCD_Idle. - */ -typedef void (*flexio_mculcd_smartdma_transfer_callback_t)(FLEXIO_MCULCD_Type *base, - flexio_mculcd_smartdma_handle_t *handle, - status_t status, - void *userData); - -/*! @brief FlexIO MCULCD SMARTDMA transfer handle, users should not touch the - * content of the handle.*/ -struct _flexio_mculcd_smartdma_handle -{ - FLEXIO_MCULCD_Type *base; /*!< Pointer to the FLEXIO_MCULCD_Type. */ - size_t dataCount; /*!< Total count to be transferred. */ - uint32_t dataAddrOrSameValue; /*!< When sending the same value for many times, - this is the value to send. When writing or reading array, - this is the address of the data array. */ - size_t dataCountUsingEzh; /*!< Data transfered using SMARTDMA. */ - volatile size_t remainingCount; /*!< Remaining count to transfer. */ - volatile uint32_t state; /*!< FlexIO MCULCD driver internal state. */ - uint8_t smartdmaApi; /*!< The SMARTDMA API used during transfer. */ - bool needColorConvert; /*!< Need color convert or not. */ - uint8_t blockingXferBuffer[FLEXIO_MCULCD_SMARTDMA_TX_LEN_ALIGN * 3 / - 2]; /*!< Used for blocking method color space convet. */ - flexio_mculcd_smartdma_transfer_callback_t completionCallback; /*!< Callback for MCULCD SMARTDMA transfer */ - void *userData; /*!< User Data for MCULCD SMARTDMA callback */ - smartdma_flexio_mculcd_param_t smartdmaParam; /*!< SMARTDMA function parameters. */ - uint32_t smartdmaStack[1]; /*!< SMARTDMA function stack. */ -}; - -/*! @brief FlexIO MCULCD SMARTDMA configuration. */ -typedef struct _flexio_mculcd_smartdma_config -{ - flexio_mculcd_pixel_format_t inputPixelFormat; /*!< The pixel format in the frame buffer. */ - flexio_mculcd_pixel_format_t outputPixelFormat; /*!< The pixel format on the 8080/68k bus. */ -} flexio_mculcd_smartdma_config_t; - -/******************************************************************************* - * APIs - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name SMARTDMA Transactional - * @{ - */ - -/*! - * @brief Initializes the FLEXO MCULCD master SMARTDMA handle. - * - * This function initializes the FLEXO MCULCD master SMARTDMA handle which can be - * used for other FLEXO MCULCD transactional APIs. For a specified FLEXO MCULCD - * instance, call this API once to get the initialized handle. - * - * @param base Pointer to FLEXIO_MCULCD_Type structure. - * @param handle Pointer to flexio_mculcd_smartdma_handle_t structure to store the - * transfer state. - * @param config Pointer to the configuration. - * @param callback MCULCD transfer complete callback, NULL means no callback. - * @param userData callback function parameter. - * @retval kStatus_Success Successfully create the handle. - */ -status_t FLEXIO_MCULCD_TransferCreateHandleSMARTDMA(FLEXIO_MCULCD_Type *base, - flexio_mculcd_smartdma_handle_t *handle, - const flexio_mculcd_smartdma_config_t *config, - flexio_mculcd_smartdma_transfer_callback_t callback, - void *userData); - -/*! - * @brief Performs a non-blocking FlexIO MCULCD transfer using SMARTDMA. - * - * This function returns immediately after transfer initiates. Use the callback - * function to check whether the transfer is completed. - * - * @param base pointer to FLEXIO_MCULCD_Type structure. - * @param handle pointer to flexio_mculcd_smartdma_handle_t structure to store the - * transfer state. - * @param xfer Pointer to FlexIO MCULCD transfer structure. - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_InvalidArgument Input argument is invalid. - * @retval kStatus_FLEXIO_MCULCD_Busy FlexIO MCULCD is not idle, it is running another - * transfer. - */ -status_t FLEXIO_MCULCD_TransferSMARTDMA(FLEXIO_MCULCD_Type *base, - flexio_mculcd_smartdma_handle_t *handle, - flexio_mculcd_transfer_t *xfer); - -/*! - * @brief Aborts a FlexIO MCULCD transfer using SMARTDMA. - * - * @param base pointer to FLEXIO_MCULCD_Type structure. - * @param handle FlexIO MCULCD SMARTDMA handle pointer. - */ -void FLEXIO_MCULCD_TransferAbortSMARTDMA(FLEXIO_MCULCD_Type *base, flexio_mculcd_smartdma_handle_t *handle); - -/*! - * @brief Gets the remaining bytes for FlexIO MCULCD SMARTDMA transfer. - * - * @param base pointer to FLEXIO_MCULCD_Type structure. - * @param handle FlexIO MCULCD SMARTDMA handle pointer. - * @param count Number of count transferred so far by the SMARTDMA transaction. - * @retval kStatus_Success Get the transferred count Successfully. - * @retval kStatus_NoTransferInProgress No transfer in process. - */ -status_t FLEXIO_MCULCD_TransferGetCountSMARTDMA(FLEXIO_MCULCD_Type *base, - flexio_mculcd_smartdma_handle_t *handle, - size_t *count); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ -#endif /* FSL_FLEXIO_MCULCD_SMARTDMA_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_spi.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_spi.c deleted file mode 100644 index 96c9a7c0acc..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_spi.c +++ /dev/null @@ -1,1565 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020, 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio_spi.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio_spi" -#endif - -/*! @brief FLEXIO SPI transfer state, which is used for SPI transactiaonl APIs' internal state. */ -enum _flexio_spi_transfer_states -{ - kFLEXIO_SPI_Idle = 0x0U, /*!< Nothing in the transmitter/receiver's queue. */ - kFLEXIO_SPI_Busy, /*!< Transmiter/Receive's queue is not finished. */ -}; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Send a piece of data for SPI. - * - * This function computes the number of data to be written into D register or Tx FIFO, - * and write the data into it. At the same time, this function updates the values in - * master handle structure. - * - * @param base pointer to FLEXIO_SPI_Type structure - * @param handle Pointer to SPI master handle structure. - */ -static void FLEXIO_SPI_TransferSendTransaction(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle); - -/*! - * @brief Receive a piece of data for SPI master. - * - * This function computes the number of data to receive from D register or Rx FIFO, - * and write the data to destination address. At the same time, this function updates - * the values in master handle structure. - * - * @param base pointer to FLEXIO_SPI_Type structure - * @param handle Pointer to SPI master handle structure. - */ -static void FLEXIO_SPI_TransferReceiveTransaction(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle); - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Codes - ******************************************************************************/ - -static uint32_t FLEXIO_SPI_GetInstance(FLEXIO_SPI_Type *base) -{ - return FLEXIO_GetInstance(base->flexioBase); -} - -static void FLEXIO_SPI_TransferSendTransaction(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle) -{ - uint32_t tmpData = FLEXIO_SPI_DUMMYDATA; - - if (handle->txData != NULL) - { - /* Transmit data and update tx size/buff. */ - if (handle->bytePerFrame == 1U) - { - tmpData = (uint32_t) * (handle->txData); - handle->txData++; - } - else if (handle->bytePerFrame == 2U) - { - if (handle->direction == kFLEXIO_SPI_MsbFirst) - { - tmpData = (uint32_t)(handle->txData[0]) << 8U; - tmpData += (uint32_t)handle->txData[1]; - } - else - { - tmpData = (uint32_t)(handle->txData[1]) << 8U; - tmpData += (uint32_t)handle->txData[0]; - } - handle->txData += 2U; - } - else - { - if (handle->direction == kFLEXIO_SPI_MsbFirst) - { - tmpData = (uint32_t)(handle->txData[0]) << 24U; - tmpData += (uint32_t)(handle->txData[1]) << 16U; - tmpData += (uint32_t)(handle->txData[2]) << 8U; - tmpData += (uint32_t)handle->txData[3]; - } - else - { - tmpData = (uint32_t)(handle->txData[3]) << 24U; - tmpData += (uint32_t)(handle->txData[2]) << 16U; - tmpData += (uint32_t)(handle->txData[1]) << 8U; - tmpData += (uint32_t)handle->txData[0]; - } - handle->txData += 4U; - } - } - else - { - tmpData = FLEXIO_SPI_DUMMYDATA; - } - - handle->txRemainingBytes -= handle->bytePerFrame; - - FLEXIO_SPI_WriteData(base, handle->direction, tmpData); - - if (0U == handle->txRemainingBytes) - { - FLEXIO_SPI_DisableInterrupts(base, (uint32_t)kFLEXIO_SPI_TxEmptyInterruptEnable); - } -} - -static void FLEXIO_SPI_TransferReceiveTransaction(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle) -{ - uint32_t tmpData; - - tmpData = FLEXIO_SPI_ReadData(base, handle->direction); - - if (handle->rxData != NULL) - { - if (handle->bytePerFrame == 1U) - { - *handle->rxData = (uint8_t)tmpData; - } - else if (handle->bytePerFrame == 2U) - { - if (handle->direction == kFLEXIO_SPI_LsbFirst) - { - *handle->rxData = (uint8_t)(tmpData >> 8); - handle->rxData++; - *handle->rxData = (uint8_t)tmpData; - } - else - { - *handle->rxData = (uint8_t)tmpData; - handle->rxData++; - *handle->rxData = (uint8_t)(tmpData >> 8); - } - } - else - { - if (handle->direction == kFLEXIO_SPI_LsbFirst) - { - *handle->rxData = (uint8_t)(tmpData >> 24U); - handle->rxData++; - *handle->rxData = (uint8_t)(tmpData >> 16U); - handle->rxData++; - *handle->rxData = (uint8_t)(tmpData >> 8U); - handle->rxData++; - *handle->rxData = (uint8_t)tmpData; - } - else - { - *handle->rxData = (uint8_t)tmpData; - handle->rxData++; - *handle->rxData = (uint8_t)(tmpData >> 8U); - handle->rxData++; - *handle->rxData = (uint8_t)(tmpData >> 16U); - handle->rxData++; - *handle->rxData = (uint8_t)(tmpData >> 24U); - } - } - handle->rxData++; - } - handle->rxRemainingBytes -= handle->bytePerFrame; -} - -/*! - * brief Ungates the FlexIO clock, resets the FlexIO module, configures the FlexIO SPI master hardware, - * and configures the FlexIO SPI with FlexIO SPI master configuration. The - * configuration structure can be filled by the user, or be set with default values - * by the FLEXIO_SPI_MasterGetDefaultConfig(). - * - * note 1.FlexIO SPI master only support CPOL = 0, which means clock inactive low. - * 2.For FlexIO SPI master, the input valid time is 1.5 clock cycles, for slave the output valid time - * is 2.5 clock cycles. So if FlexIO SPI master communicates with other spi IPs, the maximum baud - * rate is FlexIO clock frequency divided by 2*2=4. If FlexIO SPI master communicates with FlexIO - * SPI slave, the maximum baud rate is FlexIO clock frequency divided by (1.5+2.5)*2=8. - * - * Example - code - FLEXIO_SPI_Type spiDev = { - .flexioBase = FLEXIO, - .SDOPinIndex = 0, - .SDIPinIndex = 1, - .SCKPinIndex = 2, - .CSnPinIndex = 3, - .shifterIndex = {0,1}, - .timerIndex = {0,1} - }; - flexio_spi_master_config_t config = { - .enableMaster = true, - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .baudRate_Bps = 500000, - .phase = kFLEXIO_SPI_ClockPhaseFirstEdge, - .direction = kFLEXIO_SPI_MsbFirst, - .dataMode = kFLEXIO_SPI_8BitMode - }; - FLEXIO_SPI_MasterInit(&spiDev, &config, srcClock_Hz); - endcode - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param masterConfig Pointer to the flexio_spi_master_config_t structure. - * param srcClock_Hz FlexIO source clock in Hz. -*/ -void FLEXIO_SPI_MasterInit(FLEXIO_SPI_Type *base, flexio_spi_master_config_t *masterConfig, uint32_t srcClock_Hz) -{ - assert(base != NULL); - assert(masterConfig != NULL); - - flexio_shifter_config_t shifterConfig; - flexio_timer_config_t timerConfig; - uint32_t ctrlReg = 0; - uint16_t timerDiv = 0; - uint16_t timerCmp = 0; - - /* Clear the shifterConfig & timerConfig struct. */ - (void)memset(&shifterConfig, 0, sizeof(shifterConfig)); - (void)memset(&timerConfig, 0, sizeof(timerConfig)); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate flexio clock. */ - CLOCK_EnableClock(s_flexioClocks[FLEXIO_SPI_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Configure FLEXIO SPI Master */ - ctrlReg = base->flexioBase->CTRL; - ctrlReg &= ~(FLEXIO_CTRL_DOZEN_MASK | FLEXIO_CTRL_DBGE_MASK | FLEXIO_CTRL_FASTACC_MASK | FLEXIO_CTRL_FLEXEN_MASK); - ctrlReg |= (FLEXIO_CTRL_DBGE(masterConfig->enableInDebug) | FLEXIO_CTRL_FASTACC(masterConfig->enableFastAccess) | - FLEXIO_CTRL_FLEXEN(masterConfig->enableMaster)); - if (!masterConfig->enableInDoze) - { - ctrlReg |= FLEXIO_CTRL_DOZEN_MASK; - } - - base->flexioBase->CTRL = ctrlReg; - - /* Do hardware configuration. */ - /* 1. Configure the shifter 0 for tx. */ - shifterConfig.timerSelect = base->timerIndex[0]; - shifterConfig.pinConfig = kFLEXIO_PinConfigOutput; - shifterConfig.pinSelect = base->SDOPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveHigh; - shifterConfig.shifterMode = kFLEXIO_ShifterModeTransmit; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - if (masterConfig->phase == kFLEXIO_SPI_ClockPhaseFirstEdge) - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnNegitive; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitDisable; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnEnable; - } - else - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitLow; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnShift; - } - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[0], &shifterConfig); - - /* 2. Configure the shifter 1 for rx. */ - shifterConfig.timerSelect = base->timerIndex[0]; - shifterConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - shifterConfig.pinSelect = base->SDIPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveHigh; - shifterConfig.shifterMode = kFLEXIO_ShifterModeReceive; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitDisable; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnEnable; - if (masterConfig->phase == kFLEXIO_SPI_ClockPhaseFirstEdge) - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive; - } - else - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnNegitive; - } - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[1], &shifterConfig); - - /*3. Configure the timer 0 for SCK. */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->shifterIndex[0]); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOutput; - timerConfig.pinSelect = base->SCKPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveHigh; - timerConfig.timerMode = kFLEXIO_TimerModeDual8BitBaudBit; - timerConfig.timerOutput = kFLEXIO_TimerOutputZeroNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput; - timerConfig.timerReset = kFLEXIO_TimerResetNever; - timerConfig.timerDisable = kFLEXIO_TimerDisableOnTimerCompare; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnTriggerHigh; - timerConfig.timerStop = kFLEXIO_TimerStopBitEnableOnTimerDisable; - timerConfig.timerStart = kFLEXIO_TimerStartBitEnabled; - /* Low 8-bits are used to configure baudrate. */ - timerDiv = (uint16_t)(srcClock_Hz / masterConfig->baudRate_Bps); - timerDiv = timerDiv / 2U - 1U; - /* High 8-bits are used to configure shift clock edges(transfer width). */ - timerCmp = ((uint16_t)masterConfig->dataMode * 2U - 1U) << 8U; - timerCmp |= timerDiv; - - timerConfig.timerCompare = timerCmp; - - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[0], &timerConfig); - - /* 4. Configure the timer 1 for CSn. */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_TIMn(base->timerIndex[0]); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveHigh; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOutput; - timerConfig.pinSelect = base->CSnPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveLow; - timerConfig.timerMode = kFLEXIO_TimerModeSingle16Bit; - timerConfig.timerOutput = kFLEXIO_TimerOutputOneNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput; - timerConfig.timerReset = kFLEXIO_TimerResetNever; - timerConfig.timerDisable = kFLEXIO_TimerDisableOnPreTimerDisable; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnPrevTimerEnable; - timerConfig.timerStop = kFLEXIO_TimerStopBitDisabled; - timerConfig.timerStart = kFLEXIO_TimerStartBitDisabled; - - timerConfig.timerCompare = 0xFFFFU; /* Never compare. */ - - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[1], &timerConfig); -} - -/*! - * brief Resets the FlexIO SPI timer and shifter config. - * - * param base Pointer to the FLEXIO_SPI_Type. - */ -void FLEXIO_SPI_MasterDeinit(FLEXIO_SPI_Type *base) -{ - base->flexioBase->SHIFTCFG[base->shifterIndex[0]] = 0; - base->flexioBase->SHIFTCTL[base->shifterIndex[0]] = 0; - base->flexioBase->SHIFTCFG[base->shifterIndex[1]] = 0; - base->flexioBase->SHIFTCTL[base->shifterIndex[1]] = 0; - base->flexioBase->TIMCFG[base->timerIndex[0]] = 0; - base->flexioBase->TIMCMP[base->timerIndex[0]] = 0; - base->flexioBase->TIMCTL[base->timerIndex[0]] = 0; - base->flexioBase->TIMCFG[base->timerIndex[1]] = 0; - base->flexioBase->TIMCMP[base->timerIndex[1]] = 0; - base->flexioBase->TIMCTL[base->timerIndex[1]] = 0; -} - -/*! - * brief Gets the default configuration to configure the FlexIO SPI master. The configuration - * can be used directly by calling the FLEXIO_SPI_MasterConfigure(). - * Example: - code - flexio_spi_master_config_t masterConfig; - FLEXIO_SPI_MasterGetDefaultConfig(&masterConfig); - endcode - * param masterConfig Pointer to the flexio_spi_master_config_t structure. -*/ -void FLEXIO_SPI_MasterGetDefaultConfig(flexio_spi_master_config_t *masterConfig) -{ - assert(masterConfig != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(masterConfig, 0, sizeof(*masterConfig)); - - masterConfig->enableMaster = true; - masterConfig->enableInDoze = false; - masterConfig->enableInDebug = true; - masterConfig->enableFastAccess = false; - /* Default baud rate 500kbps. */ - masterConfig->baudRate_Bps = 500000U; - /* Default CPHA = 0. */ - masterConfig->phase = kFLEXIO_SPI_ClockPhaseFirstEdge; - /* Default bit count at 8. */ - masterConfig->dataMode = kFLEXIO_SPI_8BitMode; -} - -/*! - * brief Ungates the FlexIO clock, resets the FlexIO module, configures the FlexIO SPI slave hardware - * configuration, and configures the FlexIO SPI with FlexIO SPI slave configuration. The - * configuration structure can be filled by the user, or be set with default values - * by the FLEXIO_SPI_SlaveGetDefaultConfig(). - * - * note 1.Only one timer is needed in the FlexIO SPI slave. As a result, the second timer index is ignored. - * 2.FlexIO SPI slave only support CPOL = 0, which means clock inactive low. - * 3.For FlexIO SPI master, the input valid time is 1.5 clock cycles, for slave the output valid time - * is 2.5 clock cycles. So if FlexIO SPI slave communicates with other spi IPs, the maximum baud - * rate is FlexIO clock frequency divided by 3*2=6. If FlexIO SPI slave communicates with FlexIO - * SPI master, the maximum baud rate is FlexIO clock frequency divided by (1.5+2.5)*2=8. - * Example - code - FLEXIO_SPI_Type spiDev = { - .flexioBase = FLEXIO, - .SDOPinIndex = 0, - .SDIPinIndex = 1, - .SCKPinIndex = 2, - .CSnPinIndex = 3, - .shifterIndex = {0,1}, - .timerIndex = {0} - }; - flexio_spi_slave_config_t config = { - .enableSlave = true, - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .phase = kFLEXIO_SPI_ClockPhaseFirstEdge, - .direction = kFLEXIO_SPI_MsbFirst, - .dataMode = kFLEXIO_SPI_8BitMode - }; - FLEXIO_SPI_SlaveInit(&spiDev, &config); - endcode - * param base Pointer to the FLEXIO_SPI_Type structure. - * param slaveConfig Pointer to the flexio_spi_slave_config_t structure. -*/ -void FLEXIO_SPI_SlaveInit(FLEXIO_SPI_Type *base, flexio_spi_slave_config_t *slaveConfig) -{ - assert((base != NULL) && (slaveConfig != NULL)); - - flexio_shifter_config_t shifterConfig; - flexio_timer_config_t timerConfig; - uint32_t ctrlReg = 0; - - /* Clear the shifterConfig & timerConfig struct. */ - (void)memset(&shifterConfig, 0, sizeof(shifterConfig)); - (void)memset(&timerConfig, 0, sizeof(timerConfig)); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate flexio clock. */ - CLOCK_EnableClock(s_flexioClocks[FLEXIO_SPI_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Configure FLEXIO SPI Slave */ - ctrlReg = base->flexioBase->CTRL; - ctrlReg &= ~(FLEXIO_CTRL_DOZEN_MASK | FLEXIO_CTRL_DBGE_MASK | FLEXIO_CTRL_FASTACC_MASK | FLEXIO_CTRL_FLEXEN_MASK); - ctrlReg |= (FLEXIO_CTRL_DBGE(slaveConfig->enableInDebug) | FLEXIO_CTRL_FASTACC(slaveConfig->enableFastAccess) | - FLEXIO_CTRL_FLEXEN(slaveConfig->enableSlave)); - if (!slaveConfig->enableInDoze) - { - ctrlReg |= FLEXIO_CTRL_DOZEN_MASK; - } - - base->flexioBase->CTRL = ctrlReg; - - /* Do hardware configuration. */ - /* 1. Configure the shifter 0 for tx. */ - shifterConfig.timerSelect = base->timerIndex[0]; - shifterConfig.pinConfig = kFLEXIO_PinConfigOutput; - shifterConfig.pinSelect = base->SDOPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveHigh; - shifterConfig.shifterMode = kFLEXIO_ShifterModeTransmit; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitDisable; - if (slaveConfig->phase == kFLEXIO_SPI_ClockPhaseFirstEdge) - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnNegitive; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnEnable; - } - else - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnShift; - } - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[0], &shifterConfig); - - /* 2. Configure the shifter 1 for rx. */ - shifterConfig.timerSelect = base->timerIndex[0]; - shifterConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - shifterConfig.pinSelect = base->SDIPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveHigh; - shifterConfig.shifterMode = kFLEXIO_ShifterModeReceive; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitDisable; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitDisabledLoadDataOnEnable; - if (slaveConfig->phase == kFLEXIO_SPI_ClockPhaseFirstEdge) - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive; - } - else - { - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnNegitive; - } - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[1], &shifterConfig); - - /*3. Configure the timer 0 for shift clock. */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_PININPUT(base->CSnPinIndex); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - timerConfig.pinSelect = base->SCKPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveHigh; - timerConfig.timerMode = kFLEXIO_TimerModeSingle16Bit; - timerConfig.timerOutput = kFLEXIO_TimerOutputZeroNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnPinInputShiftPinInput; - timerConfig.timerReset = kFLEXIO_TimerResetNever; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnTriggerRisingEdge; - timerConfig.timerStop = kFLEXIO_TimerStopBitDisabled; - if (slaveConfig->phase == kFLEXIO_SPI_ClockPhaseFirstEdge) - { - timerConfig.timerDisable = kFLEXIO_TimerDisableOnTimerCompare; - timerConfig.timerStart = kFLEXIO_TimerStartBitDisabled; - } - else - { - timerConfig.timerDisable = kFLEXIO_TimerDisableOnTriggerFallingEdge; - timerConfig.timerStart = kFLEXIO_TimerStartBitEnabled; - } - - timerConfig.timerCompare = (uint32_t)slaveConfig->dataMode * 2U - 1U; - - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[0], &timerConfig); -} - -/*! - * brief Gates the FlexIO clock. - * - * param base Pointer to the FLEXIO_SPI_Type. - */ -void FLEXIO_SPI_SlaveDeinit(FLEXIO_SPI_Type *base) -{ - FLEXIO_SPI_MasterDeinit(base); -} - -/*! - * brief Gets the default configuration to configure the FlexIO SPI slave. The configuration - * can be used directly for calling the FLEXIO_SPI_SlaveConfigure(). - * Example: - code - flexio_spi_slave_config_t slaveConfig; - FLEXIO_SPI_SlaveGetDefaultConfig(&slaveConfig); - endcode - * param slaveConfig Pointer to the flexio_spi_slave_config_t structure. -*/ -void FLEXIO_SPI_SlaveGetDefaultConfig(flexio_spi_slave_config_t *slaveConfig) -{ - assert(slaveConfig != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(slaveConfig, 0, sizeof(*slaveConfig)); - - slaveConfig->enableSlave = true; - slaveConfig->enableInDoze = false; - slaveConfig->enableInDebug = true; - slaveConfig->enableFastAccess = false; - /* Default CPHA = 0. */ - slaveConfig->phase = kFLEXIO_SPI_ClockPhaseFirstEdge; - /* Default bit count at 8. */ - slaveConfig->dataMode = kFLEXIO_SPI_8BitMode; -} - -/*! - * brief Enables the FlexIO SPI interrupt. - * - * This function enables the FlexIO SPI interrupt. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param mask interrupt source. The parameter can be any combination of the following values: - * arg kFLEXIO_SPI_RxFullInterruptEnable - * arg kFLEXIO_SPI_TxEmptyInterruptEnable - */ -void FLEXIO_SPI_EnableInterrupts(FLEXIO_SPI_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_SPI_TxEmptyInterruptEnable) != 0U) - { - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_SPI_RxFullInterruptEnable) != 0U) - { - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Disables the FlexIO SPI interrupt. - * - * This function disables the FlexIO SPI interrupt. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param mask interrupt source The parameter can be any combination of the following values: - * arg kFLEXIO_SPI_RxFullInterruptEnable - * arg kFLEXIO_SPI_TxEmptyInterruptEnable - */ -void FLEXIO_SPI_DisableInterrupts(FLEXIO_SPI_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_SPI_TxEmptyInterruptEnable) != 0U) - { - FLEXIO_DisableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_SPI_RxFullInterruptEnable) != 0U) - { - FLEXIO_DisableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Enables/disables the FlexIO SPI transmit DMA. This function enables/disables the FlexIO SPI Tx DMA, - * which means that asserting the kFLEXIO_SPI_TxEmptyFlag does/doesn't trigger the DMA request. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param mask SPI DMA source. - * param enable True means enable DMA, false means disable DMA. - */ -void FLEXIO_SPI_EnableDMA(FLEXIO_SPI_Type *base, uint32_t mask, bool enable) -{ - if ((mask & (uint32_t)kFLEXIO_SPI_TxDmaEnable) != 0U) - { - FLEXIO_EnableShifterStatusDMA(base->flexioBase, 1UL << base->shifterIndex[0], enable); - } - - if ((mask & (uint32_t)kFLEXIO_SPI_RxDmaEnable) != 0U) - { - FLEXIO_EnableShifterStatusDMA(base->flexioBase, 1UL << base->shifterIndex[1], enable); - } -} - -/*! - * brief Gets FlexIO SPI status flags. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * return status flag; Use the status flag to AND the following flag mask and get the status. - * arg kFLEXIO_SPI_TxEmptyFlag - * arg kFLEXIO_SPI_RxEmptyFlag - */ - -uint32_t FLEXIO_SPI_GetStatusFlags(FLEXIO_SPI_Type *base) -{ - uint32_t shifterStatus = FLEXIO_GetShifterStatusFlags(base->flexioBase); - uint32_t status = 0; - - status = ((shifterStatus & (1UL << base->shifterIndex[0])) >> base->shifterIndex[0]); - status |= (((shifterStatus & (1UL << base->shifterIndex[1])) >> (base->shifterIndex[1])) << 1U); - - return status; -} - -/*! - * brief Clears FlexIO SPI status flags. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param mask status flag - * The parameter can be any combination of the following values: - * arg kFLEXIO_SPI_TxEmptyFlag - * arg kFLEXIO_SPI_RxEmptyFlag - */ - -void FLEXIO_SPI_ClearStatusFlags(FLEXIO_SPI_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag) != 0U) - { - FLEXIO_ClearShifterStatusFlags(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_SPI_RxBufferFullFlag) != 0U) - { - FLEXIO_ClearShifterStatusFlags(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Sets baud rate for the FlexIO SPI transfer, which is only used for the master. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param baudRate_Bps Baud Rate needed in Hz. - * param srcClockHz SPI source clock frequency in Hz. - */ -void FLEXIO_SPI_MasterSetBaudRate(FLEXIO_SPI_Type *base, uint32_t baudRate_Bps, uint32_t srcClockHz) -{ - uint16_t timerDiv = 0; - uint16_t timerCmp = 0; - FLEXIO_Type *flexioBase = base->flexioBase; - - /* Set TIMCMP[7:0] = (baud rate divider / 2) - 1.*/ - timerDiv = (uint16_t)(srcClockHz / baudRate_Bps); - timerDiv = timerDiv / 2U - 1U; - - timerCmp = (uint16_t)(flexioBase->TIMCMP[base->timerIndex[0]]); - timerCmp &= 0xFF00U; - timerCmp |= timerDiv; - - flexioBase->TIMCMP[base->timerIndex[0]] = timerCmp; -} - -/*! - * brief Sends a buffer of data bytes. - * - * note This function blocks using the polling method until all bytes have been sent. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param direction Shift direction of MSB first or LSB first. - * param buffer The data bytes to send. - * param size The number of data bytes to send. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_FLEXIO_SPI_Timeout The transfer timed out and was aborted. - */ -status_t FLEXIO_SPI_WriteBlocking(FLEXIO_SPI_Type *base, - flexio_spi_shift_direction_t direction, - const uint8_t *buffer, - size_t size) -{ - assert(buffer != NULL); - assert(size != 0U); - -#if SPI_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != size--) - { - /* Wait until data transfer complete. */ -#if SPI_RETRY_TIMES - waitTimes = SPI_RETRY_TIMES; - while ((0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag)) && - (0U != --waitTimes)) -#else - while (0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag)) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return kStatus_FLEXIO_SPI_Timeout; - } -#endif - FLEXIO_SPI_WriteData(base, direction, *buffer++); - } - - return kStatus_Success; -} - -/*! - * brief Receives a buffer of bytes. - * - * note This function blocks using the polling method until all bytes have been received. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param direction Shift direction of MSB first or LSB first. - * param buffer The buffer to store the received bytes. - * param size The number of data bytes to be received. - * param direction Shift direction of MSB first or LSB first. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_FLEXIO_SPI_Timeout The transfer timed out and was aborted. - */ -status_t FLEXIO_SPI_ReadBlocking(FLEXIO_SPI_Type *base, - flexio_spi_shift_direction_t direction, - uint8_t *buffer, - size_t size) -{ - assert(buffer != NULL); - assert(size != 0U); - -#if SPI_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != size--) - { - /* Wait until data transfer complete. */ -#if SPI_RETRY_TIMES - waitTimes = SPI_RETRY_TIMES; - while ((0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_RxBufferFullFlag)) && - (0U != --waitTimes)) -#else - while (0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_RxBufferFullFlag)) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return kStatus_FLEXIO_SPI_Timeout; - } -#endif - *buffer++ = (uint8_t)FLEXIO_SPI_ReadData(base, direction); - } - - return kStatus_Success; -} - -/*! - * brief Receives a buffer of bytes. - * - * note This function blocks via polling until all bytes have been received. - * - * param base pointer to FLEXIO_SPI_Type structure - * param xfer FlexIO SPI transfer structure, see #flexio_spi_transfer_t. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_FLEXIO_SPI_Timeout The transfer timed out and was aborted. - */ -status_t FLEXIO_SPI_MasterTransferBlocking(FLEXIO_SPI_Type *base, flexio_spi_transfer_t *xfer) -{ - flexio_spi_shift_direction_t direction; - uint8_t bytesPerFrame; - uint32_t dataMode = 0; - uint16_t timerCmp = (uint16_t)(base->flexioBase->TIMCMP[base->timerIndex[0]]); - uint32_t tmpData = FLEXIO_SPI_DUMMYDATA; - uint8_t dataFormat = FLEXIO_SPI_XFER_DATA_FORMAT(xfer->flags); -#if SPI_RETRY_TIMES - uint32_t waitTimes; -#endif - - timerCmp &= 0x00FFU; - - if ((xfer->flags & (uint8_t)kFLEXIO_SPI_csContinuous) != 0U) - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TSTOP_MASK) | - FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitDisabled); - } - else - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TSTOP_MASK) | - FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitEnableOnTimerDisable); - } - - /* Configure the values in handle. */ - switch (dataFormat) - { - case (uint8_t)kFLEXIO_SPI_8bitMsb: - dataMode = (8UL * 2UL - 1UL) << 8U; - bytesPerFrame = 1U; - direction = kFLEXIO_SPI_MsbFirst; - break; - - case (uint8_t)kFLEXIO_SPI_8bitLsb: - dataMode = (8UL * 2UL - 1UL) << 8U; - bytesPerFrame = 1U; - direction = kFLEXIO_SPI_LsbFirst; - break; - - case (uint8_t)kFLEXIO_SPI_16bitMsb: - dataMode = (16UL * 2UL - 1UL) << 8U; - bytesPerFrame = 2U; - direction = kFLEXIO_SPI_MsbFirst; - break; - - case (uint8_t)kFLEXIO_SPI_16bitLsb: - dataMode = (16UL * 2UL - 1UL) << 8U; - bytesPerFrame = 2U; - direction = kFLEXIO_SPI_LsbFirst; - break; - - case (uint8_t)kFLEXIO_SPI_32bitMsb: - dataMode = (32UL * 2UL - 1UL) << 8U; - bytesPerFrame = 4U; - direction = kFLEXIO_SPI_MsbFirst; - break; - - case (uint8_t)kFLEXIO_SPI_32bitLsb: - dataMode = (32UL * 2UL - 1UL) << 8U; - bytesPerFrame = 4U; - direction = kFLEXIO_SPI_LsbFirst; - break; - - default: - dataMode = (8UL * 2UL - 1UL) << 8U; - bytesPerFrame = 1U; - direction = kFLEXIO_SPI_MsbFirst; - assert(true); - break; - } - - dataMode |= timerCmp; - - /* Transfer size should be bytesPerFrame divisible. */ - if ((xfer->dataSize % bytesPerFrame) != 0U) - { - return kStatus_InvalidArgument; - } - - /* Configure transfer size. */ - base->flexioBase->TIMCMP[base->timerIndex[0]] = dataMode; - - while (xfer->dataSize != 0U) - { - /* Wait until data transfer complete. */ -#if SPI_RETRY_TIMES - waitTimes = SPI_RETRY_TIMES; - while ((0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag)) && - (0U != --waitTimes)) -#else - while (0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag)) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return kStatus_FLEXIO_SPI_Timeout; - } -#endif - if (xfer->txData != NULL) - { - /* Transmit data and update tx size/buff. */ - if (bytesPerFrame == 1U) - { - tmpData = (uint32_t) * (xfer->txData); - xfer->txData++; - } - else if (bytesPerFrame == 2U) - { - if (direction == kFLEXIO_SPI_MsbFirst) - { - tmpData = (uint32_t)(xfer->txData[0]) << 8U; - tmpData += (uint32_t)xfer->txData[1]; - } - else - { - tmpData = (uint32_t)(xfer->txData[1]) << 8U; - tmpData += (uint32_t)xfer->txData[0]; - } - xfer->txData += 2U; - } - else - { - if (direction == kFLEXIO_SPI_MsbFirst) - { - tmpData = (uint32_t)(xfer->txData[0]) << 24U; - tmpData += (uint32_t)(xfer->txData[1]) << 16U; - tmpData += (uint32_t)(xfer->txData[2]) << 8U; - tmpData += (uint32_t)xfer->txData[3]; - } - else - { - tmpData = (uint32_t)(xfer->txData[3]) << 24U; - tmpData += (uint32_t)(xfer->txData[2]) << 16U; - tmpData += (uint32_t)(xfer->txData[1]) << 8U; - tmpData += (uint32_t)xfer->txData[0]; - } - xfer->txData += 4U; - } - } - else - { - tmpData = FLEXIO_SPI_DUMMYDATA; - } - - xfer->dataSize -= bytesPerFrame; - - FLEXIO_SPI_WriteData(base, direction, tmpData); - -#if SPI_RETRY_TIMES - waitTimes = SPI_RETRY_TIMES; - while ((0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_RxBufferFullFlag)) && - (0U != --waitTimes)) -#else - while (0U == (FLEXIO_SPI_GetStatusFlags(base) & (uint32_t)kFLEXIO_SPI_RxBufferFullFlag)) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return kStatus_FLEXIO_SPI_Timeout; - } -#endif - tmpData = FLEXIO_SPI_ReadData(base, direction); - - if (xfer->rxData != NULL) - { - if (bytesPerFrame == 1U) - { - *xfer->rxData = (uint8_t)tmpData; - } - else if (bytesPerFrame == 2U) - { - if (direction == kFLEXIO_SPI_LsbFirst) - { - *xfer->rxData = (uint8_t)(tmpData >> 8); - xfer->rxData++; - *xfer->rxData = (uint8_t)tmpData; - } - else - { - *xfer->rxData = (uint8_t)tmpData; - xfer->rxData++; - *xfer->rxData = (uint8_t)(tmpData >> 8); - } - } - else - { - if (direction == kFLEXIO_SPI_LsbFirst) - { - *xfer->rxData = (uint8_t)(tmpData >> 24U); - xfer->rxData++; - *xfer->rxData = (uint8_t)(tmpData >> 16U); - xfer->rxData++; - *xfer->rxData = (uint8_t)(tmpData >> 8U); - xfer->rxData++; - *xfer->rxData = (uint8_t)tmpData; - } - else - { - *xfer->rxData = (uint8_t)tmpData; - xfer->rxData++; - *xfer->rxData = (uint8_t)(tmpData >> 8U); - xfer->rxData++; - *xfer->rxData = (uint8_t)(tmpData >> 16U); - xfer->rxData++; - *xfer->rxData = (uint8_t)(tmpData >> 24U); - } - } - xfer->rxData++; - } - } - - return kStatus_Success; -} - -/*! - * brief Initializes the FlexIO SPI Master handle, which is used in transactional functions. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - * param callback The callback function. - * param userData The parameter of the callback function. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_SPI_MasterTransferCreateHandle(FLEXIO_SPI_Type *base, - flexio_spi_master_handle_t *handle, - flexio_spi_master_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - IRQn_Type flexio_irqs[] = FLEXIO_IRQS; - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Register callback and userData. */ - handle->callback = callback; - handle->userData = userData; - - /* Clear pending NVIC IRQ before enable NVIC IRQ. */ - NVIC_ClearPendingIRQ(flexio_irqs[FLEXIO_SPI_GetInstance(base)]); - /* Enable interrupt in NVIC. */ - (void)EnableIRQ(flexio_irqs[FLEXIO_SPI_GetInstance(base)]); - - /* Save the context in global variables to support the double weak mechanism. */ - return FLEXIO_RegisterHandleIRQ(base, handle, FLEXIO_SPI_MasterTransferHandleIRQ); -} - -/*! - * brief Master transfer data using IRQ. - * - * This function sends data using IRQ. This is a non-blocking function, which returns - * right away. When all data is sent out/received, the callback function is called. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - * param xfer FlexIO SPI transfer structure. See #flexio_spi_transfer_t. - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_InvalidArgument Input argument is invalid. - * retval kStatus_FLEXIO_SPI_Busy SPI is not idle, is running another transfer. - */ -status_t FLEXIO_SPI_MasterTransferNonBlocking(FLEXIO_SPI_Type *base, - flexio_spi_master_handle_t *handle, - flexio_spi_transfer_t *xfer) -{ - assert(handle != NULL); - assert(xfer != NULL); - - uint32_t dataMode = 0; - uint16_t timerCmp = (uint16_t)base->flexioBase->TIMCMP[base->timerIndex[0]]; - uint32_t tmpData = FLEXIO_SPI_DUMMYDATA; - uint8_t dataFormat = FLEXIO_SPI_XFER_DATA_FORMAT(xfer->flags); - - timerCmp &= 0x00FFU; - - /* Check if SPI is busy. */ - if (handle->state == (uint32_t)kFLEXIO_SPI_Busy) - { - return kStatus_FLEXIO_SPI_Busy; - } - - /* Check if the argument is legal. */ - if ((xfer->txData == NULL) && (xfer->rxData == NULL)) - { - return kStatus_InvalidArgument; - } - - /* Timer1 controls the CS signal which enables/disables(asserts/deasserts) when timer0 enable/disable. Timer0 - enables when tx shifter is written and disables when timer compare. The timer compare event causes the - transmit shift registers to load which generates a tx register empty event. Since when timer stop bit is - disabled, a timer enable condition can be detected in the same cycle as a timer disable condition, so if - software writes the tx register upon the detection of tx register empty event, the timer enable condition - is triggered again, then the CS signal can remain low until software no longer writes the tx register. */ - if ((xfer->flags & (uint8_t)kFLEXIO_SPI_csContinuous) != 0U) - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TSTOP_MASK) | - FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitDisabled); - } - else - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TSTOP_MASK) | - FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitEnableOnTimerDisable); - } - - /* Configure the values in handle */ - switch (dataFormat) - { - case (uint8_t)kFLEXIO_SPI_8bitMsb: - dataMode = (8UL * 2UL - 1UL) << 8U; - handle->bytePerFrame = 1U; - handle->direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_8bitLsb: - dataMode = (8UL * 2UL - 1UL) << 8U; - handle->bytePerFrame = 1U; - handle->direction = kFLEXIO_SPI_LsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_16bitMsb: - dataMode = (16UL * 2UL - 1UL) << 8U; - handle->bytePerFrame = 2U; - handle->direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_16bitLsb: - dataMode = (16UL * 2UL - 1UL) << 8U; - handle->bytePerFrame = 2U; - handle->direction = kFLEXIO_SPI_LsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_32bitMsb: - dataMode = (32UL * 2UL - 1UL) << 8U; - handle->bytePerFrame = 4U; - handle->direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_32bitLsb: - dataMode = (32UL * 2UL - 1UL) << 8U; - handle->bytePerFrame = 4U; - handle->direction = kFLEXIO_SPI_LsbFirst; - break; - default: - dataMode = (8UL * 2UL - 1UL) << 8U; - handle->bytePerFrame = 1U; - handle->direction = kFLEXIO_SPI_MsbFirst; - assert(true); - break; - } - - dataMode |= timerCmp; - - /* Transfer size should be bytesPerFrame divisible. */ - if ((xfer->dataSize % handle->bytePerFrame) != 0U) - { - return kStatus_InvalidArgument; - } - - /* Configure transfer size. */ - base->flexioBase->TIMCMP[base->timerIndex[0]] = dataMode; - - handle->state = (uint32_t)kFLEXIO_SPI_Busy; - handle->txData = xfer->txData; - handle->rxData = xfer->rxData; - handle->rxRemainingBytes = xfer->dataSize; - - /* Save total transfer size. */ - handle->transferSize = xfer->dataSize; - - /* Send first byte of data to trigger the rx interrupt. */ - if (handle->txData != NULL) - { - /* Transmit data and update tx size/buff. */ - if (handle->bytePerFrame == 1U) - { - tmpData = (uint32_t) * (handle->txData); - handle->txData++; - } - else if (handle->bytePerFrame == 2U) - { - if (handle->direction == kFLEXIO_SPI_MsbFirst) - { - tmpData = (uint32_t)(handle->txData[0]) << 8U; - tmpData += (uint32_t)handle->txData[1]; - } - else - { - tmpData = (uint32_t)(handle->txData[1]) << 8U; - tmpData += (uint32_t)handle->txData[0]; - } - handle->txData += 2U; - } - else - { - if (handle->direction == kFLEXIO_SPI_MsbFirst) - { - tmpData = (uint32_t)(handle->txData[0]) << 24U; - tmpData += (uint32_t)(handle->txData[1]) << 16U; - tmpData += (uint32_t)(handle->txData[2]) << 8U; - tmpData += (uint32_t)handle->txData[3]; - } - else - { - tmpData = (uint32_t)(handle->txData[3]) << 24U; - tmpData += (uint32_t)(handle->txData[2]) << 16U; - tmpData += (uint32_t)(handle->txData[1]) << 8U; - tmpData += (uint32_t)handle->txData[0]; - } - handle->txData += 4U; - } - } - else - { - tmpData = FLEXIO_SPI_DUMMYDATA; - } - - handle->txRemainingBytes = xfer->dataSize - handle->bytePerFrame; - - FLEXIO_SPI_WriteData(base, handle->direction, tmpData); - - /* Enable transmit and receive interrupt to handle rx. */ - FLEXIO_SPI_EnableInterrupts(base, (uint32_t)kFLEXIO_SPI_RxFullInterruptEnable); - - if ((xfer->flags & (uint8_t)kFLEXIO_SPI_csContinuous) != 0U) - { - FLEXIO_SPI_EnableInterrupts(base, (uint32_t)kFLEXIO_SPI_TxEmptyInterruptEnable); - } - - return kStatus_Success; -} - -/*! - * brief Gets the data transfer status which used IRQ. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - * param count Number of bytes transferred so far by the non-blocking transaction. - * retval kStatus_InvalidArgument count is Invalid. - * retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_SPI_MasterTransferGetCount(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Return remaing bytes in different cases. */ - if (handle->rxData != NULL) - { - *count = handle->transferSize - handle->rxRemainingBytes; - } - else - { - *count = handle->transferSize - handle->txRemainingBytes; - } - - return kStatus_Success; -} - -/*! - * brief Aborts the master data transfer, which used IRQ. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - */ -void FLEXIO_SPI_MasterTransferAbort(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle) -{ - assert(handle != NULL); - - FLEXIO_SPI_DisableInterrupts(base, (uint32_t)kFLEXIO_SPI_RxFullInterruptEnable); - FLEXIO_SPI_DisableInterrupts(base, (uint32_t)kFLEXIO_SPI_TxEmptyInterruptEnable); - - /* Transfer finished, set the state to idle. */ - handle->state = (uint32_t)kFLEXIO_SPI_Idle; - - /* Clear the internal state. */ - handle->rxRemainingBytes = 0; - handle->txRemainingBytes = 0; -} - -/*! - * brief FlexIO SPI master IRQ handler function. - * - * param spiType Pointer to the FLEXIO_SPI_Type structure. - * param spiHandle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - */ -void FLEXIO_SPI_MasterTransferHandleIRQ(void *spiType, void *spiHandle) -{ - assert(spiHandle != NULL); - - flexio_spi_master_handle_t *handle = (flexio_spi_master_handle_t *)spiHandle; - FLEXIO_SPI_Type *base; - uint32_t status; - - if (handle->state == (uint32_t)kFLEXIO_SPI_Idle) - { - return; - } - - base = (FLEXIO_SPI_Type *)spiType; - status = FLEXIO_SPI_GetStatusFlags(base); - - /* Receive interrupt. */ - if ((status & (uint32_t)kFLEXIO_SPI_RxBufferFullFlag) == 0U) - { - FLEXIO_SPI_TransferSendTransaction(base, handle); - return; - } - - /* Handle rx. */ - if (handle->rxRemainingBytes != 0U) - { - FLEXIO_SPI_TransferReceiveTransaction(base, handle); - } - - /* Handle tx. */ - if (((status & (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag) != 0U) && (handle->txRemainingBytes != 0U)) - { - FLEXIO_SPI_TransferSendTransaction(base, handle); - } - - /* All the transfer finished. */ - if ((handle->txRemainingBytes == 0U) && (handle->rxRemainingBytes == 0U)) - { - FLEXIO_SPI_MasterTransferAbort(base, handle); - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_FLEXIO_SPI_Idle, handle->userData); - } - } -} - -/*! - * brief Initializes the FlexIO SPI Slave handle, which is used in transactional functions. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param handle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - * param callback The callback function. - * param userData The parameter of the callback function. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_SPI_SlaveTransferCreateHandle(FLEXIO_SPI_Type *base, - flexio_spi_slave_handle_t *handle, - flexio_spi_slave_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - IRQn_Type flexio_irqs[] = FLEXIO_IRQS; - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Register callback and userData. */ - handle->callback = callback; - handle->userData = userData; - - /* Clear pending NVIC IRQ before enable NVIC IRQ. */ - NVIC_ClearPendingIRQ(flexio_irqs[FLEXIO_SPI_GetInstance(base)]); - /* Enable interrupt in NVIC. */ - (void)EnableIRQ(flexio_irqs[FLEXIO_SPI_GetInstance(base)]); - - /* Save the context in global variables to support the double weak mechanism. */ - return FLEXIO_RegisterHandleIRQ(base, handle, FLEXIO_SPI_SlaveTransferHandleIRQ); -} - -/*! - * brief Slave transfer data using IRQ. - * - * This function sends data using IRQ. This is a non-blocking function, which returns - * right away. When all data is sent out/received, the callback function is called. - * param handle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - * param xfer FlexIO SPI transfer structure. See #flexio_spi_transfer_t. - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_InvalidArgument Input argument is invalid. - * retval kStatus_FLEXIO_SPI_Busy SPI is not idle; it is running another transfer. - */ -status_t FLEXIO_SPI_SlaveTransferNonBlocking(FLEXIO_SPI_Type *base, - flexio_spi_slave_handle_t *handle, - flexio_spi_transfer_t *xfer) -{ - assert(handle != NULL); - assert(xfer != NULL); - - uint32_t dataMode = 0; - uint8_t dataFormat = FLEXIO_SPI_XFER_DATA_FORMAT(xfer->flags); - - /* Check if SPI is busy. */ - if (handle->state == (uint32_t)kFLEXIO_SPI_Busy) - { - return kStatus_FLEXIO_SPI_Busy; - } - - /* Check if the argument is legal. */ - if ((xfer->txData == NULL) && (xfer->rxData == NULL)) - { - return kStatus_InvalidArgument; - } - - /* SCK timer use CS pin as inverted trigger so timer should be disbaled on trigger falling edge(CS re-asserts). */ - /* However if CPHA is first edge mode, timer will restart each time right after timer compare event occur and - before CS pin re-asserts, which triggers another shifter load. To avoid this, when in CS dis-continuous mode, - timer should disable in timer compare rather than trigger falling edge(CS re-asserts), and in CS continuous mode, - tx/rx shifters should be flushed after transfer finishes and before next transfer starts. */ - FLEXIO_SPI_FlushShifters(base); - if ((xfer->flags & (uint8_t)kFLEXIO_SPI_csContinuous) != 0U) - { - base->flexioBase->TIMCFG[base->timerIndex[0]] |= FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTriggerFallingEdge); - } - else - { - if ((base->flexioBase->SHIFTCTL[base->shifterIndex[0]] & FLEXIO_SHIFTCTL_TIMPOL_MASK) == - FLEXIO_SHIFTCTL_TIMPOL(kFLEXIO_ShifterTimerPolarityOnNegitive)) - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TIMDIS_MASK) | - FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTimerCompare); - } - else - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TIMDIS_MASK) | - FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTriggerFallingEdge); - } - } - - /* Configure the values in handle */ - switch (dataFormat) - { - case (uint8_t)kFLEXIO_SPI_8bitMsb: - dataMode = 8U * 2U - 1U; - handle->bytePerFrame = 1U; - handle->direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_8bitLsb: - dataMode = 8U * 2U - 1U; - handle->bytePerFrame = 1U; - handle->direction = kFLEXIO_SPI_LsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_16bitMsb: - dataMode = 16U * 2U - 1U; - handle->bytePerFrame = 2U; - handle->direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_16bitLsb: - dataMode = 16U * 2U - 1U; - handle->bytePerFrame = 2U; - handle->direction = kFLEXIO_SPI_LsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_32bitMsb: - dataMode = 32UL * 2UL - 1UL; - handle->bytePerFrame = 4U; - handle->direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_32bitLsb: - dataMode = 32UL * 2UL - 1UL; - handle->bytePerFrame = 4U; - handle->direction = kFLEXIO_SPI_LsbFirst; - break; - default: - dataMode = 8UL * 2UL - 1UL; - handle->bytePerFrame = 1U; - handle->direction = kFLEXIO_SPI_MsbFirst; - assert(true); - break; - } - - /* Transfer size should be bytesPerFrame divisible. */ - if ((xfer->dataSize % handle->bytePerFrame) != 0U) - { - return kStatus_InvalidArgument; - } - - /* Configure transfer size. */ - base->flexioBase->TIMCMP[base->timerIndex[0]] = dataMode; - - handle->state = (uint32_t)kFLEXIO_SPI_Busy; - handle->txData = xfer->txData; - handle->rxData = xfer->rxData; - handle->txRemainingBytes = xfer->dataSize; - handle->rxRemainingBytes = xfer->dataSize; - - /* Save total transfer size. */ - handle->transferSize = xfer->dataSize; - - /* Enable transmit and receive interrupt to handle tx and rx. */ - FLEXIO_SPI_EnableInterrupts(base, (uint32_t)kFLEXIO_SPI_TxEmptyInterruptEnable); - FLEXIO_SPI_EnableInterrupts(base, (uint32_t)kFLEXIO_SPI_RxFullInterruptEnable); - - return kStatus_Success; -} - -/*! - * brief FlexIO SPI slave IRQ handler function. - * - * param spiType Pointer to the FLEXIO_SPI_Type structure. - * param spiHandle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - */ -void FLEXIO_SPI_SlaveTransferHandleIRQ(void *spiType, void *spiHandle) -{ - assert(spiHandle != NULL); - - flexio_spi_master_handle_t *handle = (flexio_spi_master_handle_t *)spiHandle; - FLEXIO_SPI_Type *base; - uint32_t status; - - if (handle->state == (uint32_t)kFLEXIO_SPI_Idle) - { - return; - } - - base = (FLEXIO_SPI_Type *)spiType; - status = FLEXIO_SPI_GetStatusFlags(base); - - /* Handle tx. */ - if (((status & (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag) != 0U) && (handle->txRemainingBytes != 0U)) - { - FLEXIO_SPI_TransferSendTransaction(base, handle); - } - - /* Handle rx. */ - if (((status & (uint32_t)kFLEXIO_SPI_RxBufferFullFlag) != 0U) && (handle->rxRemainingBytes != 0U)) - { - FLEXIO_SPI_TransferReceiveTransaction(base, handle); - } - - /* All the transfer finished. */ - if ((handle->txRemainingBytes == 0U) && (handle->rxRemainingBytes == 0U)) - { - FLEXIO_SPI_SlaveTransferAbort(base, handle); - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_FLEXIO_SPI_Idle, handle->userData); - } - } -} - -/*! - * brief Flush tx/rx shifters. - * - * param base Pointer to the FLEXIO_SPI_Type structure. - */ -void FLEXIO_SPI_FlushShifters(FLEXIO_SPI_Type *base) -{ - /* Disable then re-enable to flush the tx shifter. */ - base->flexioBase->SHIFTCTL[base->shifterIndex[0]] &= ~FLEXIO_SHIFTCTL_SMOD_MASK; - base->flexioBase->SHIFTCTL[base->shifterIndex[0]] |= FLEXIO_SHIFTCTL_SMOD(kFLEXIO_ShifterModeTransmit); - /* Read to flush the rx shifter. */ - (void)base->flexioBase->SHIFTBUF[base->shifterIndex[1]]; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_spi.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_spi.h deleted file mode 100644 index cae17a802c9..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_spi.h +++ /dev/null @@ -1,718 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020, 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_FLEXIO_SPI_H_ -#define FSL_FLEXIO_SPI_H_ - -#include "fsl_common.h" -#include "fsl_flexio.h" - -/*! - * @addtogroup flexio_spi - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief FlexIO SPI driver version. */ -#define FSL_FLEXIO_SPI_DRIVER_VERSION (MAKE_VERSION(2, 3, 4)) -/*! @} */ - -#ifndef FLEXIO_SPI_DUMMYDATA -/*! @brief FlexIO SPI dummy transfer data, the data is sent while txData is NULL. */ -#define FLEXIO_SPI_DUMMYDATA (0x00U) -#endif - -/*! @brief Retry times for waiting flag. */ -#ifndef SPI_RETRY_TIMES -#define SPI_RETRY_TIMES 0U /* Define to zero means keep waiting until the flag is assert/deassert. */ -#endif - -/*! @brief Get the transfer data format of width and bit order. */ -#define FLEXIO_SPI_XFER_DATA_FORMAT(flag) ((flag) & (0x7U)) - -/*! @brief Error codes for the FlexIO SPI driver. */ -enum -{ - kStatus_FLEXIO_SPI_Busy = MAKE_STATUS(kStatusGroup_FLEXIO_SPI, 1), /*!< FlexIO SPI is busy. */ - kStatus_FLEXIO_SPI_Idle = MAKE_STATUS(kStatusGroup_FLEXIO_SPI, 2), /*!< SPI is idle */ - kStatus_FLEXIO_SPI_Error = MAKE_STATUS(kStatusGroup_FLEXIO_SPI, 3), /*!< FlexIO SPI error. */ - kStatus_FLEXIO_SPI_Timeout = - MAKE_STATUS(kStatusGroup_FLEXIO_SPI, 4), /*!< FlexIO SPI timeout polling status flags. */ -}; - -/*! @brief FlexIO SPI clock phase configuration. */ -typedef enum _flexio_spi_clock_phase -{ - kFLEXIO_SPI_ClockPhaseFirstEdge = 0x0U, /*!< First edge on SPSCK occurs at the middle of the first - * cycle of a data transfer. */ - kFLEXIO_SPI_ClockPhaseSecondEdge = 0x1U, /*!< First edge on SPSCK occurs at the start of the - * first cycle of a data transfer. */ -} flexio_spi_clock_phase_t; - -/*! @brief FlexIO SPI data shifter direction options. */ -typedef enum _flexio_spi_shift_direction -{ - kFLEXIO_SPI_MsbFirst = 0, /*!< Data transfers start with most significant bit. */ - kFLEXIO_SPI_LsbFirst = 1, /*!< Data transfers start with least significant bit. */ -} flexio_spi_shift_direction_t; - -/*! @brief FlexIO SPI data length mode options. */ -typedef enum _flexio_spi_data_bitcount_mode -{ - kFLEXIO_SPI_8BitMode = 0x08U, /*!< 8-bit data transmission mode. */ - kFLEXIO_SPI_16BitMode = 0x10U, /*!< 16-bit data transmission mode. */ - kFLEXIO_SPI_32BitMode = 0x20U, /*!< 32-bit data transmission mode. */ -} flexio_spi_data_bitcount_mode_t; - -/*! @brief Define FlexIO SPI interrupt mask. */ -enum _flexio_spi_interrupt_enable -{ - kFLEXIO_SPI_TxEmptyInterruptEnable = 0x1U, /*!< Transmit buffer empty interrupt enable. */ - kFLEXIO_SPI_RxFullInterruptEnable = 0x2U, /*!< Receive buffer full interrupt enable. */ -}; - -/*! @brief Define FlexIO SPI status mask. */ -enum _flexio_spi_status_flags -{ - kFLEXIO_SPI_TxBufferEmptyFlag = 0x1U, /*!< Transmit buffer empty flag. */ - kFLEXIO_SPI_RxBufferFullFlag = 0x2U, /*!< Receive buffer full flag. */ -}; - -/*! @brief Define FlexIO SPI DMA mask. */ -enum _flexio_spi_dma_enable -{ - kFLEXIO_SPI_TxDmaEnable = 0x1U, /*!< Tx DMA request source */ - kFLEXIO_SPI_RxDmaEnable = 0x2U, /*!< Rx DMA request source */ - kFLEXIO_SPI_DmaAllEnable = 0x3U, /*!< All DMA request source*/ -}; - -/*! @brief Define FlexIO SPI transfer flags. - * @note Use kFLEXIO_SPI_csContinuous and one of the other flags to OR together to form the transfer flag. */ -enum _flexio_spi_transfer_flags -{ - kFLEXIO_SPI_8bitMsb = 0x0U, /*!< FlexIO SPI 8-bit MSB first */ - kFLEXIO_SPI_8bitLsb = 0x1U, /*!< FlexIO SPI 8-bit LSB first */ - kFLEXIO_SPI_16bitMsb = 0x2U, /*!< FlexIO SPI 16-bit MSB first */ - kFLEXIO_SPI_16bitLsb = 0x3U, /*!< FlexIO SPI 16-bit LSB first */ - kFLEXIO_SPI_32bitMsb = 0x4U, /*!< FlexIO SPI 32-bit MSB first */ - kFLEXIO_SPI_32bitLsb = 0x5U, /*!< FlexIO SPI 32-bit LSB first */ - kFLEXIO_SPI_csContinuous = 0x8U, /*!< Enable the CS signal continuous mode */ -}; - -/*! @brief Define FlexIO SPI access structure typedef. */ -typedef struct _flexio_spi_type -{ - FLEXIO_Type *flexioBase; /*!< FlexIO base pointer. */ - uint8_t SDOPinIndex; /*!< Pin select for data output. To set SDO pin in Hi-Z state, user needs to mux the pin as - GPIO input and disable all pull up/down in application. */ - uint8_t SDIPinIndex; /*!< Pin select for data input. */ - uint8_t SCKPinIndex; /*!< Pin select for clock. */ - uint8_t CSnPinIndex; /*!< Pin select for enable. */ - uint8_t shifterIndex[2]; /*!< Shifter index used in FlexIO SPI. */ - uint8_t timerIndex[2]; /*!< Timer index used in FlexIO SPI. */ -} FLEXIO_SPI_Type; - -/*! @brief Define FlexIO SPI master configuration structure. */ -typedef struct _flexio_spi_master_config -{ - bool enableMaster; /*!< Enable/disable FlexIO SPI master after configuration. */ - bool enableInDoze; /*!< Enable/disable FlexIO operation in doze mode. */ - bool enableInDebug; /*!< Enable/disable FlexIO operation in debug mode. */ - bool enableFastAccess; /*!< Enable/disable fast access to FlexIO registers, - fast access requires the FlexIO clock to be at least - twice the frequency of the bus clock. */ - uint32_t baudRate_Bps; /*!< Baud rate in Bps. */ - flexio_spi_clock_phase_t phase; /*!< Clock phase. */ - flexio_spi_data_bitcount_mode_t dataMode; /*!< 8bit or 16bit mode. */ -} flexio_spi_master_config_t; - -/*! @brief Define FlexIO SPI slave configuration structure. */ -typedef struct _flexio_spi_slave_config -{ - bool enableSlave; /*!< Enable/disable FlexIO SPI slave after configuration. */ - bool enableInDoze; /*!< Enable/disable FlexIO operation in doze mode. */ - bool enableInDebug; /*!< Enable/disable FlexIO operation in debug mode. */ - bool enableFastAccess; /*!< Enable/disable fast access to FlexIO registers, - fast access requires the FlexIO clock to be at least - twice the frequency of the bus clock. */ - flexio_spi_clock_phase_t phase; /*!< Clock phase. */ - flexio_spi_data_bitcount_mode_t dataMode; /*!< 8bit or 16bit mode. */ -} flexio_spi_slave_config_t; - -/*! @brief Define FlexIO SPI transfer structure. */ -typedef struct _flexio_spi_transfer -{ - const uint8_t *txData; /*!< Send buffer. */ - uint8_t *rxData; /*!< Receive buffer. */ - size_t dataSize; /*!< Transfer bytes. */ - uint8_t flags; /*!< FlexIO SPI control flag, MSB first or LSB first. */ -} flexio_spi_transfer_t; - -/*! @brief typedef for flexio_spi_master_handle_t in advance. */ -typedef struct _flexio_spi_master_handle flexio_spi_master_handle_t; - -/*! @brief Slave handle is the same with master handle. */ -typedef flexio_spi_master_handle_t flexio_spi_slave_handle_t; - -/*! @brief FlexIO SPI master callback for finished transmit */ -typedef void (*flexio_spi_master_transfer_callback_t)(FLEXIO_SPI_Type *base, - flexio_spi_master_handle_t *handle, - status_t status, - void *userData); - -/*! @brief FlexIO SPI slave callback for finished transmit */ -typedef void (*flexio_spi_slave_transfer_callback_t)(FLEXIO_SPI_Type *base, - flexio_spi_slave_handle_t *handle, - status_t status, - void *userData); - -/*! @brief Define FlexIO SPI handle structure. */ -struct _flexio_spi_master_handle -{ - const uint8_t *txData; /*!< Transfer buffer. */ - uint8_t *rxData; /*!< Receive buffer. */ - size_t transferSize; /*!< Total bytes to be transferred. */ - volatile size_t txRemainingBytes; /*!< Send data remaining in bytes. */ - volatile size_t rxRemainingBytes; /*!< Receive data remaining in bytes. */ - volatile uint32_t state; /*!< FlexIO SPI internal state. */ - uint8_t bytePerFrame; /*!< SPI mode, 2bytes or 1byte in a frame */ - flexio_spi_shift_direction_t direction; /*!< Shift direction. */ - flexio_spi_master_transfer_callback_t callback; /*!< FlexIO SPI callback. */ - void *userData; /*!< Callback parameter. */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus*/ - -/*! - * @name FlexIO SPI Configuration - * @{ - */ - -/*! - * @brief Ungates the FlexIO clock, resets the FlexIO module, configures the FlexIO SPI master hardware, - * and configures the FlexIO SPI with FlexIO SPI master configuration. The - * configuration structure can be filled by the user, or be set with default values - * by the FLEXIO_SPI_MasterGetDefaultConfig(). - * - * @note 1.FlexIO SPI master only support CPOL = 0, which means clock inactive low. - * 2.For FlexIO SPI master, the input valid time is 1.5 clock cycles, for slave the output valid time - * is 2.5 clock cycles. So if FlexIO SPI master communicates with other spi IPs, the maximum baud - * rate is FlexIO clock frequency divided by 2*2=4. If FlexIO SPI master communicates with FlexIO - * SPI slave, the maximum baud rate is FlexIO clock frequency divided by (1.5+2.5)*2=8. - * - * Example - @code - FLEXIO_SPI_Type spiDev = { - .flexioBase = FLEXIO, - .SDOPinIndex = 0, - .SDIPinIndex = 1, - .SCKPinIndex = 2, - .CSnPinIndex = 3, - .shifterIndex = {0,1}, - .timerIndex = {0,1} - }; - flexio_spi_master_config_t config = { - .enableMaster = true, - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .baudRate_Bps = 500000, - .phase = kFLEXIO_SPI_ClockPhaseFirstEdge, - .direction = kFLEXIO_SPI_MsbFirst, - .dataMode = kFLEXIO_SPI_8BitMode - }; - FLEXIO_SPI_MasterInit(&spiDev, &config, srcClock_Hz); - @endcode - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param masterConfig Pointer to the flexio_spi_master_config_t structure. - * @param srcClock_Hz FlexIO source clock in Hz. -*/ -void FLEXIO_SPI_MasterInit(FLEXIO_SPI_Type *base, flexio_spi_master_config_t *masterConfig, uint32_t srcClock_Hz); - -/*! - * @brief Resets the FlexIO SPI timer and shifter config. - * - * @param base Pointer to the FLEXIO_SPI_Type. - */ -void FLEXIO_SPI_MasterDeinit(FLEXIO_SPI_Type *base); - -/*! - * @brief Gets the default configuration to configure the FlexIO SPI master. The configuration - * can be used directly by calling the FLEXIO_SPI_MasterConfigure(). - * Example: - @code - flexio_spi_master_config_t masterConfig; - FLEXIO_SPI_MasterGetDefaultConfig(&masterConfig); - @endcode - * @param masterConfig Pointer to the flexio_spi_master_config_t structure. -*/ -void FLEXIO_SPI_MasterGetDefaultConfig(flexio_spi_master_config_t *masterConfig); - -/*! - * @brief Ungates the FlexIO clock, resets the FlexIO module, configures the FlexIO SPI slave hardware - * configuration, and configures the FlexIO SPI with FlexIO SPI slave configuration. The - * configuration structure can be filled by the user, or be set with default values - * by the FLEXIO_SPI_SlaveGetDefaultConfig(). - * - * @note 1.Only one timer is needed in the FlexIO SPI slave. As a result, the second timer index is ignored. - * 2.FlexIO SPI slave only support CPOL = 0, which means clock inactive low. - * 3.For FlexIO SPI master, the input valid time is 1.5 clock cycles, for slave the output valid time - * is 2.5 clock cycles. So if FlexIO SPI slave communicates with other spi IPs, the maximum baud - * rate is FlexIO clock frequency divided by 3*2=6. If FlexIO SPI slave communicates with FlexIO - * SPI master, the maximum baud rate is FlexIO clock frequency divided by (1.5+2.5)*2=8. - * Example - @code - FLEXIO_SPI_Type spiDev = { - .flexioBase = FLEXIO, - .SDOPinIndex = 0, - .SDIPinIndex = 1, - .SCKPinIndex = 2, - .CSnPinIndex = 3, - .shifterIndex = {0,1}, - .timerIndex = {0} - }; - flexio_spi_slave_config_t config = { - .enableSlave = true, - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .phase = kFLEXIO_SPI_ClockPhaseFirstEdge, - .direction = kFLEXIO_SPI_MsbFirst, - .dataMode = kFLEXIO_SPI_8BitMode - }; - FLEXIO_SPI_SlaveInit(&spiDev, &config); - @endcode - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param slaveConfig Pointer to the flexio_spi_slave_config_t structure. -*/ -void FLEXIO_SPI_SlaveInit(FLEXIO_SPI_Type *base, flexio_spi_slave_config_t *slaveConfig); - -/*! - * @brief Gates the FlexIO clock. - * - * @param base Pointer to the FLEXIO_SPI_Type. - */ -void FLEXIO_SPI_SlaveDeinit(FLEXIO_SPI_Type *base); - -/*! - * @brief Gets the default configuration to configure the FlexIO SPI slave. The configuration - * can be used directly for calling the FLEXIO_SPI_SlaveConfigure(). - * Example: - @code - flexio_spi_slave_config_t slaveConfig; - FLEXIO_SPI_SlaveGetDefaultConfig(&slaveConfig); - @endcode - * @param slaveConfig Pointer to the flexio_spi_slave_config_t structure. -*/ -void FLEXIO_SPI_SlaveGetDefaultConfig(flexio_spi_slave_config_t *slaveConfig); - -/*! @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets FlexIO SPI status flags. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @return status flag; Use the status flag to AND the following flag mask and get the status. - * @arg kFLEXIO_SPI_TxEmptyFlag - * @arg kFLEXIO_SPI_RxEmptyFlag - */ - -uint32_t FLEXIO_SPI_GetStatusFlags(FLEXIO_SPI_Type *base); - -/*! - * @brief Clears FlexIO SPI status flags. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param mask status flag - * The parameter can be any combination of the following values: - * @arg kFLEXIO_SPI_TxEmptyFlag - * @arg kFLEXIO_SPI_RxEmptyFlag - */ - -void FLEXIO_SPI_ClearStatusFlags(FLEXIO_SPI_Type *base, uint32_t mask); - -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables the FlexIO SPI interrupt. - * - * This function enables the FlexIO SPI interrupt. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param mask interrupt source. The parameter can be any combination of the following values: - * @arg kFLEXIO_SPI_RxFullInterruptEnable - * @arg kFLEXIO_SPI_TxEmptyInterruptEnable - */ -void FLEXIO_SPI_EnableInterrupts(FLEXIO_SPI_Type *base, uint32_t mask); - -/*! - * @brief Disables the FlexIO SPI interrupt. - * - * This function disables the FlexIO SPI interrupt. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param mask interrupt source The parameter can be any combination of the following values: - * @arg kFLEXIO_SPI_RxFullInterruptEnable - * @arg kFLEXIO_SPI_TxEmptyInterruptEnable - */ -void FLEXIO_SPI_DisableInterrupts(FLEXIO_SPI_Type *base, uint32_t mask); - -/*! @} */ - -/*! - * @name DMA Control - * @{ - */ - -/*! - * @brief Enables/disables the FlexIO SPI transmit DMA. This function enables/disables the FlexIO SPI Tx DMA, - * which means that asserting the kFLEXIO_SPI_TxEmptyFlag does/doesn't trigger the DMA request. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param mask SPI DMA source. - * @param enable True means enable DMA, false means disable DMA. - */ -void FLEXIO_SPI_EnableDMA(FLEXIO_SPI_Type *base, uint32_t mask, bool enable); - -/*! - * @brief Gets the FlexIO SPI transmit data register address for MSB first transfer. - * - * This function returns the SPI data register address, which is mainly used by DMA/eDMA. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param direction Shift direction of MSB first or LSB first. - * @return FlexIO SPI transmit data register address. - */ -static inline uint32_t FLEXIO_SPI_GetTxDataRegisterAddress(FLEXIO_SPI_Type *base, - flexio_spi_shift_direction_t direction) -{ - if (direction == kFLEXIO_SPI_MsbFirst) - { - return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBufferBitSwapped, - base->shifterIndex[0]) + - 3U; - } - else - { - return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBuffer, base->shifterIndex[0]); - } -} - -/*! - * @brief Gets the FlexIO SPI receive data register address for the MSB first transfer. - * - * This function returns the SPI data register address, which is mainly used by DMA/eDMA. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param direction Shift direction of MSB first or LSB first. - * @return FlexIO SPI receive data register address. - */ -static inline uint32_t FLEXIO_SPI_GetRxDataRegisterAddress(FLEXIO_SPI_Type *base, - flexio_spi_shift_direction_t direction) -{ - if (direction == kFLEXIO_SPI_MsbFirst) - { - return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBufferBitSwapped, base->shifterIndex[1]); - } - else - { - return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBuffer, base->shifterIndex[1]) + 3U; - } -} - -/*! @} */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Enables/disables the FlexIO SPI module operation. - * - * @param base Pointer to the FLEXIO_SPI_Type. - * @param enable True to enable, false does not have any effect. - */ -static inline void FLEXIO_SPI_Enable(FLEXIO_SPI_Type *base, bool enable) -{ - if (enable) - { - base->flexioBase->CTRL |= FLEXIO_CTRL_FLEXEN_MASK; - } -} - -/*! - * @brief Sets baud rate for the FlexIO SPI transfer, which is only used for the master. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param baudRate_Bps Baud Rate needed in Hz. - * @param srcClockHz SPI source clock frequency in Hz. - */ -void FLEXIO_SPI_MasterSetBaudRate(FLEXIO_SPI_Type *base, uint32_t baudRate_Bps, uint32_t srcClockHz); - -/*! - * @brief Writes one byte of data, which is sent using the MSB method. - * - * @note This is a non-blocking API, which returns directly after the data is put into the - * data register but the data transfer is not finished on the bus. Ensure that - * the TxEmptyFlag is asserted before calling this API. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param direction Shift direction of MSB first or LSB first. - * @param data 8/16/32 bit data. - */ -static inline void FLEXIO_SPI_WriteData(FLEXIO_SPI_Type *base, flexio_spi_shift_direction_t direction, uint32_t data) -{ - if (direction == kFLEXIO_SPI_MsbFirst) - { - base->flexioBase->SHIFTBUFBBS[base->shifterIndex[0]] = data; - } - else - { - base->flexioBase->SHIFTBUF[base->shifterIndex[0]] = data; - } -} - -/*! - * @brief Reads 8 bit/16 bit data. - * - * @note This is a non-blocking API, which returns directly after the data is read from the - * data register. Ensure that the RxFullFlag is asserted before calling this API. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param direction Shift direction of MSB first or LSB first. - * @return 8 bit/16 bit data received. - */ -static inline uint32_t FLEXIO_SPI_ReadData(FLEXIO_SPI_Type *base, flexio_spi_shift_direction_t direction) -{ - if (direction == kFLEXIO_SPI_MsbFirst) - { - return (uint32_t)(base->flexioBase->SHIFTBUFBIS[base->shifterIndex[1]]); - } - else - { - return (uint32_t)(base->flexioBase->SHIFTBUFBYS[base->shifterIndex[1]]); - } -} - -/*! - * @brief Sends a buffer of data bytes. - * - * @note This function blocks using the polling method until all bytes have been sent. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param direction Shift direction of MSB first or LSB first. - * @param buffer The data bytes to send. - * @param size The number of data bytes to send. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_FLEXIO_SPI_Timeout The transfer timed out and was aborted. - */ -status_t FLEXIO_SPI_WriteBlocking(FLEXIO_SPI_Type *base, - flexio_spi_shift_direction_t direction, - const uint8_t *buffer, - size_t size); - -/*! - * @brief Receives a buffer of bytes. - * - * @note This function blocks using the polling method until all bytes have been received. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param direction Shift direction of MSB first or LSB first. - * @param buffer The buffer to store the received bytes. - * @param size The number of data bytes to be received. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_FLEXIO_SPI_Timeout The transfer timed out and was aborted. - */ -status_t FLEXIO_SPI_ReadBlocking(FLEXIO_SPI_Type *base, - flexio_spi_shift_direction_t direction, - uint8_t *buffer, - size_t size); - -/*! - * @brief Receives a buffer of bytes. - * - * @note This function blocks via polling until all bytes have been received. - * - * @param base pointer to FLEXIO_SPI_Type structure - * @param xfer FlexIO SPI transfer structure, see #flexio_spi_transfer_t. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_FLEXIO_SPI_Timeout The transfer timed out and was aborted. - */ -status_t FLEXIO_SPI_MasterTransferBlocking(FLEXIO_SPI_Type *base, flexio_spi_transfer_t *xfer); - -/*! - * @brief Flush tx/rx shifters. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - */ -void FLEXIO_SPI_FlushShifters(FLEXIO_SPI_Type *base); -/*! @} */ - -/*Transactional APIs*/ - -/*! - * @name Transactional - * @{ - */ - -/*! - * @brief Initializes the FlexIO SPI Master handle, which is used in transactional functions. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - * @param callback The callback function. - * @param userData The parameter of the callback function. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_SPI_MasterTransferCreateHandle(FLEXIO_SPI_Type *base, - flexio_spi_master_handle_t *handle, - flexio_spi_master_transfer_callback_t callback, - void *userData); - -/*! - * @brief Master transfer data using IRQ. - * - * This function sends data using IRQ. This is a non-blocking function, which returns - * right away. When all data is sent out/received, the callback function is called. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - * @param xfer FlexIO SPI transfer structure. See #flexio_spi_transfer_t. - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_InvalidArgument Input argument is invalid. - * @retval kStatus_FLEXIO_SPI_Busy SPI is not idle, is running another transfer. - */ -status_t FLEXIO_SPI_MasterTransferNonBlocking(FLEXIO_SPI_Type *base, - flexio_spi_master_handle_t *handle, - flexio_spi_transfer_t *xfer); - -/*! - * @brief Aborts the master data transfer, which used IRQ. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - */ -void FLEXIO_SPI_MasterTransferAbort(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle); - -/*! - * @brief Gets the data transfer status which used IRQ. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - * @param count Number of bytes transferred so far by the non-blocking transaction. - * @retval kStatus_InvalidArgument count is Invalid. - * @retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_SPI_MasterTransferGetCount(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle, size_t *count); - -/*! - * @brief FlexIO SPI master IRQ handler function. - * - * @param spiType Pointer to the FLEXIO_SPI_Type structure. - * @param spiHandle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. - */ -void FLEXIO_SPI_MasterTransferHandleIRQ(void *spiType, void *spiHandle); - -/*! - * @brief Initializes the FlexIO SPI Slave handle, which is used in transactional functions. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param handle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - * @param callback The callback function. - * @param userData The parameter of the callback function. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_SPI_SlaveTransferCreateHandle(FLEXIO_SPI_Type *base, - flexio_spi_slave_handle_t *handle, - flexio_spi_slave_transfer_callback_t callback, - void *userData); - -/*! - * @brief Slave transfer data using IRQ. - * - * This function sends data using IRQ. This is a non-blocking function, which returns - * right away. When all data is sent out/received, the callback function is called. - * @param handle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param xfer FlexIO SPI transfer structure. See #flexio_spi_transfer_t. - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_InvalidArgument Input argument is invalid. - * @retval kStatus_FLEXIO_SPI_Busy SPI is not idle; it is running another transfer. - */ -status_t FLEXIO_SPI_SlaveTransferNonBlocking(FLEXIO_SPI_Type *base, - flexio_spi_slave_handle_t *handle, - flexio_spi_transfer_t *xfer); - -/*! - * @brief Aborts the slave data transfer which used IRQ, share same API with master. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param handle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - */ -static inline void FLEXIO_SPI_SlaveTransferAbort(FLEXIO_SPI_Type *base, flexio_spi_slave_handle_t *handle) -{ - FLEXIO_SPI_MasterTransferAbort(base, handle); -} -/*! - * @brief Gets the data transfer status which used IRQ, share same API with master. - * - * @param base Pointer to the FLEXIO_SPI_Type structure. - * @param handle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - * @param count Number of bytes transferred so far by the non-blocking transaction. - * @retval kStatus_InvalidArgument count is Invalid. - * @retval kStatus_Success Successfully return the count. - */ -static inline status_t FLEXIO_SPI_SlaveTransferGetCount(FLEXIO_SPI_Type *base, - flexio_spi_slave_handle_t *handle, - size_t *count) -{ - return FLEXIO_SPI_MasterTransferGetCount(base, handle, count); -} - -/*! - * @brief FlexIO SPI slave IRQ handler function. - * - * @param spiType Pointer to the FLEXIO_SPI_Type structure. - * @param spiHandle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. - */ -void FLEXIO_SPI_SlaveTransferHandleIRQ(void *spiType, void *spiHandle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /*_cplusplus*/ -/*! @} */ - -#endif /*FSL_FLEXIO_SPI_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_spi_edma.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_spi_edma.c deleted file mode 100644 index c1feba0f001..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_spi_edma.c +++ /dev/null @@ -1,565 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020, 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio_spi_edma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio_spi_edma" -#endif - -/*base, (uint32_t)kFLEXIO_SPI_TxDmaEnable, false); - - /* change the state */ - spiPrivateHandle->handle->txInProgress = false; - - /* All finished, call the callback */ - if ((spiPrivateHandle->handle->txInProgress == false) && (spiPrivateHandle->handle->rxInProgress == false)) - { - if (spiPrivateHandle->handle->callback != NULL) - { - (spiPrivateHandle->handle->callback)(spiPrivateHandle->base, spiPrivateHandle->handle, kStatus_Success, - spiPrivateHandle->handle->userData); - } - } - } -} - -static void FLEXIO_SPI_RxEDMACallback(edma_handle_t *handle, void *param, bool transferDone, uint32_t tcds) -{ - tcds = tcds; - flexio_spi_master_edma_private_handle_t *spiPrivateHandle = (flexio_spi_master_edma_private_handle_t *)param; - - if (transferDone) - { - /* Disable Rx dma */ - FLEXIO_SPI_EnableDMA(spiPrivateHandle->base, (uint32_t)kFLEXIO_SPI_RxDmaEnable, false); - - /* change the state */ - spiPrivateHandle->handle->rxInProgress = false; - - /* All finished, call the callback */ - if ((spiPrivateHandle->handle->txInProgress == false) && (spiPrivateHandle->handle->rxInProgress == false)) - { - if (spiPrivateHandle->handle->callback != NULL) - { - (spiPrivateHandle->handle->callback)(spiPrivateHandle->base, spiPrivateHandle->handle, kStatus_Success, - spiPrivateHandle->handle->userData); - } - } - } -} - -static status_t FLEXIO_SPI_EDMAConfig(FLEXIO_SPI_Type *base, - flexio_spi_master_edma_handle_t *handle, - flexio_spi_transfer_t *xfer) -{ - edma_transfer_config_t xferConfig = {0}; - flexio_spi_shift_direction_t direction = kFLEXIO_SPI_MsbFirst; - uint8_t bytesPerFrame; - uint8_t dataFormat = FLEXIO_SPI_XFER_DATA_FORMAT(xfer->flags); - - /* Configure the values in handle. */ - switch (dataFormat) - { - case (uint8_t)kFLEXIO_SPI_8bitMsb: - bytesPerFrame = 1U; - direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_8bitLsb: - bytesPerFrame = 1U; - direction = kFLEXIO_SPI_LsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_16bitMsb: - bytesPerFrame = 2U; - direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_16bitLsb: - bytesPerFrame = 2U; - direction = kFLEXIO_SPI_LsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_32bitMsb: - bytesPerFrame = 4U; - direction = kFLEXIO_SPI_MsbFirst; - break; - case (uint8_t)kFLEXIO_SPI_32bitLsb: - bytesPerFrame = 4U; - direction = kFLEXIO_SPI_LsbFirst; - break; - default: - bytesPerFrame = 1U; - direction = kFLEXIO_SPI_MsbFirst; - assert(true); - break; - } - - /* Transfer size should be bytesPerFrame divisible. */ - if ((xfer->dataSize % bytesPerFrame) != 0U) - { - return kStatus_InvalidArgument; - } - - /* Save total transfer size. */ - handle->transferSize = xfer->dataSize; - - /* Configure tx transfer EDMA. */ - xferConfig.destAddr = FLEXIO_SPI_GetTxDataRegisterAddress(base, direction); - xferConfig.destOffset = 0; - if (bytesPerFrame == 1U) - { - xferConfig.srcTransferSize = kEDMA_TransferSize1Bytes; - xferConfig.destTransferSize = kEDMA_TransferSize1Bytes; - xferConfig.minorLoopBytes = 1U; - } - else if (bytesPerFrame == 2U) - { - if (direction == kFLEXIO_SPI_MsbFirst) - { - xferConfig.destAddr -= 1U; - } - xferConfig.srcTransferSize = kEDMA_TransferSize2Bytes; - xferConfig.destTransferSize = kEDMA_TransferSize2Bytes; - xferConfig.minorLoopBytes = 2U; - } - else - { - if (direction == kFLEXIO_SPI_MsbFirst) - { - xferConfig.destAddr -= 3U; - } - xferConfig.srcTransferSize = kEDMA_TransferSize4Bytes; - xferConfig.destTransferSize = kEDMA_TransferSize4Bytes; - xferConfig.minorLoopBytes = 4U; - } - - /* Configure DMA channel. */ - if (xfer->txData != NULL) - { - xferConfig.srcOffset = (int16_t)bytesPerFrame; - xferConfig.srcAddr = (uint32_t)(xfer->txData); - } - else - { - /* Disable the source increasement and source set to dummyData. */ - xferConfig.srcOffset = 0; - xferConfig.srcAddr = (uint32_t)(&s_dummyData); - } - - xferConfig.majorLoopCounts = (xfer->dataSize / xferConfig.minorLoopBytes); - - /* Store the initially configured eDMA minor byte transfer count into the FLEXIO SPI handle */ - handle->nbytes = (uint8_t)xferConfig.minorLoopBytes; - - if (handle->txHandle != NULL) - { - (void)EDMA_SubmitTransfer(handle->txHandle, &xferConfig); - } - - /* Configure rx transfer EDMA. */ - if (xfer->rxData != NULL) - { - xferConfig.srcAddr = FLEXIO_SPI_GetRxDataRegisterAddress(base, direction); - if (bytesPerFrame == 2U) - { - if (direction == kFLEXIO_SPI_LsbFirst) - { - xferConfig.srcAddr -= 1U; - } - } - else if (bytesPerFrame == 4U) - { - if (direction == kFLEXIO_SPI_LsbFirst) - { - xferConfig.srcAddr -= 3U; - } - } - else - { - } - xferConfig.srcOffset = 0; - xferConfig.destAddr = (uint32_t)(xfer->rxData); - xferConfig.destOffset = (int16_t)bytesPerFrame; - (void)EDMA_SubmitTransfer(handle->rxHandle, &xferConfig); - handle->rxInProgress = true; - FLEXIO_SPI_EnableDMA(base, (uint32_t)kFLEXIO_SPI_RxDmaEnable, true); - EDMA_StartTransfer(handle->rxHandle); - } - - /* Always start tx transfer. */ - if (handle->txHandle != NULL) - { - handle->txInProgress = true; - FLEXIO_SPI_EnableDMA(base, (uint32_t)kFLEXIO_SPI_TxDmaEnable, true); - EDMA_StartTransfer(handle->txHandle); - } - - return kStatus_Success; -} - -/*! - * brief Initializes the FlexIO SPI master eDMA handle. - * - * This function initializes the FlexIO SPI master eDMA handle which can be used for other FlexIO SPI master - * transactional - * APIs. - * For a specified FlexIO SPI instance, call this API once to get the initialized handle. - * - * param base Pointer to FLEXIO_SPI_Type structure. - * param handle Pointer to flexio_spi_master_edma_handle_t structure to store the transfer state. - * param callback SPI callback, NULL means no callback. - * param userData callback function parameter. - * param txHandle User requested eDMA handle for FlexIO SPI RX eDMA transfer. - * param rxHandle User requested eDMA handle for FlexIO SPI TX eDMA transfer. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO SPI eDMA type/handle table out of range. - */ -status_t FLEXIO_SPI_MasterTransferCreateHandleEDMA(FLEXIO_SPI_Type *base, - flexio_spi_master_edma_handle_t *handle, - flexio_spi_master_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *txHandle, - edma_handle_t *rxHandle) -{ - assert(handle != NULL); - - uint8_t index = 0; - - /* Find the an empty handle pointer to store the handle. */ - for (index = 0U; index < (uint8_t)FLEXIO_SPI_HANDLE_COUNT; index++) - { - if (s_edmaPrivateHandle[index].base == NULL) - { - s_edmaPrivateHandle[index].base = base; - s_edmaPrivateHandle[index].handle = handle; - break; - } - } - - if (index == (uint16_t)FLEXIO_SPI_HANDLE_COUNT) - { - return kStatus_OutOfRange; - } - - /* Set spi base to handle. */ - handle->txHandle = txHandle; - handle->rxHandle = rxHandle; - - /* Register callback and userData. */ - handle->callback = callback; - handle->userData = userData; - - /* Set SPI state to idle. */ - handle->txInProgress = false; - handle->rxInProgress = false; - - /* Install callback for Tx/Rx dma channel. */ - if (handle->txHandle != NULL) - { - EDMA_SetCallback(handle->txHandle, FLEXIO_SPI_TxEDMACallback, &s_edmaPrivateHandle[index]); - } - if (handle->rxHandle != NULL) - { - EDMA_SetCallback(handle->rxHandle, FLEXIO_SPI_RxEDMACallback, &s_edmaPrivateHandle[index]); - } - - return kStatus_Success; -} - -/*! - * brief Performs a non-blocking FlexIO SPI transfer using eDMA. - * - * note This interface returns immediately after transfer initiates. Call - * FLEXIO_SPI_MasterGetTransferCountEDMA to poll the transfer status and check - * whether the FlexIO SPI transfer is finished. - * - * param base Pointer to FLEXIO_SPI_Type structure. - * param handle Pointer to flexio_spi_master_edma_handle_t structure to store the transfer state. - * param xfer Pointer to FlexIO SPI transfer structure. - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_InvalidArgument Input argument is invalid. - * retval kStatus_FLEXIO_SPI_Busy FlexIO SPI is not idle, is running another transfer. - */ -status_t FLEXIO_SPI_MasterTransferEDMA(FLEXIO_SPI_Type *base, - flexio_spi_master_edma_handle_t *handle, - flexio_spi_transfer_t *xfer) -{ - assert(handle != NULL); - assert(xfer != NULL); - - uint32_t dataMode = 0; - uint16_t timerCmp = (uint16_t)base->flexioBase->TIMCMP[base->timerIndex[0]]; - uint8_t dataFormat = FLEXIO_SPI_XFER_DATA_FORMAT(xfer->flags); - - timerCmp &= 0x00FFU; - - /* Check if the device is busy. */ - if ((handle->txInProgress) || (handle->rxInProgress)) - { - return kStatus_FLEXIO_SPI_Busy; - } - - /* Check if input parameter invalid. */ - if (((xfer->txData == NULL) && (xfer->rxData == NULL)) || (xfer->dataSize == 0U)) - { - return kStatus_InvalidArgument; - } - - /* Timer1 controls the CS signal which enables/disables(asserts/deasserts) when timer0 enable/disable. Timer0 - enables when tx shifter is written and disables when timer compare. The timer compare event causes the - transmit shift registers to load which generates a tx register empty event. Since when timer stop bit is - disabled, a timer enable condition can be detected in the same cycle as a timer disable condition, so if - software writes the tx register upon the detection of tx register empty event, the timer enable condition - is triggered again, then the CS signal can remain low until software no longer writes the tx register. */ - if ((xfer->flags & (uint8_t)kFLEXIO_SPI_csContinuous) != 0U) - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TSTOP_MASK) | - FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitDisabled); - } - else - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TSTOP_MASK) | - FLEXIO_TIMCFG_TSTOP(kFLEXIO_TimerStopBitEnableOnTimerDisable); - } - - /* configure data mode. */ - if ((dataFormat == (uint8_t)kFLEXIO_SPI_8bitMsb) || (dataFormat == (uint8_t)kFLEXIO_SPI_8bitLsb)) - { - dataMode = (8UL * 2UL - 1UL) << 8U; - } - else if ((dataFormat == (uint8_t)kFLEXIO_SPI_16bitMsb) || (dataFormat == (uint8_t)kFLEXIO_SPI_16bitLsb)) - { - dataMode = (16UL * 2UL - 1UL) << 8U; - } - else if ((dataFormat == (uint8_t)kFLEXIO_SPI_32bitMsb) || (dataFormat == (uint8_t)kFLEXIO_SPI_32bitLsb)) - { - dataMode = (32UL * 2UL - 1UL) << 8U; - } - else - { - dataMode = (8UL * 2UL - 1UL) << 8U; - } - - dataMode |= timerCmp; - - base->flexioBase->TIMCMP[base->timerIndex[0]] = dataMode; - - return FLEXIO_SPI_EDMAConfig(base, handle, xfer); -} - -/*! - * brief Gets the remaining bytes for FlexIO SPI eDMA transfer. - * - * param base Pointer to FLEXIO_SPI_Type structure. - * param handle FlexIO SPI eDMA handle pointer. - * param count Number of bytes transferred so far by the non-blocking transaction. - */ -status_t FLEXIO_SPI_MasterTransferGetCountEDMA(FLEXIO_SPI_Type *base, - flexio_spi_master_edma_handle_t *handle, - size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - if (handle->rxInProgress) - { - *count = - (handle->transferSize - (uint32_t)handle->nbytes * EDMA_GetRemainingMajorLoopCount( - handle->rxHandle->base, handle->rxHandle->channel)); - } - else - { - *count = - (handle->transferSize - (uint32_t)handle->nbytes * EDMA_GetRemainingMajorLoopCount( - handle->txHandle->base, handle->txHandle->channel)); - } - - return kStatus_Success; -} - -/*! - * brief Aborts a FlexIO SPI transfer using eDMA. - * - * param base Pointer to FLEXIO_SPI_Type structure. - * param handle FlexIO SPI eDMA handle pointer. - */ -void FLEXIO_SPI_MasterTransferAbortEDMA(FLEXIO_SPI_Type *base, flexio_spi_master_edma_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable dma. */ - EDMA_AbortTransfer(handle->txHandle); - EDMA_AbortTransfer(handle->rxHandle); - - /* Disable DMA enable bit. */ - FLEXIO_SPI_EnableDMA(base, (uint32_t)kFLEXIO_SPI_DmaAllEnable, false); - - /* Set the handle state. */ - handle->txInProgress = false; - handle->rxInProgress = false; -} - -/*! - * brief Performs a non-blocking FlexIO SPI transfer using eDMA. - * - * note This interface returns immediately after transfer initiates. Call - * FLEXIO_SPI_SlaveGetTransferCountEDMA to poll the transfer status and - * check whether the FlexIO SPI transfer is finished. - * - * param base Pointer to FLEXIO_SPI_Type structure. - * param handle Pointer to flexio_spi_slave_edma_handle_t structure to store the transfer state. - * param xfer Pointer to FlexIO SPI transfer structure. - * retval kStatus_Success Successfully start a transfer. - * retval kStatus_InvalidArgument Input argument is invalid. - * retval kStatus_FLEXIO_SPI_Busy FlexIO SPI is not idle, is running another transfer. - */ -status_t FLEXIO_SPI_SlaveTransferEDMA(FLEXIO_SPI_Type *base, - flexio_spi_slave_edma_handle_t *handle, - flexio_spi_transfer_t *xfer) -{ - assert(handle != NULL); - assert(xfer != NULL); - - uint32_t dataMode = 0U; - uint8_t dataFormat = FLEXIO_SPI_XFER_DATA_FORMAT(xfer->flags); - - /* Check if the device is busy. */ - if ((handle->txInProgress) || (handle->rxInProgress)) - { - return kStatus_FLEXIO_SPI_Busy; - } - - /* SCK timer use CS pin as inverted trigger so timer should be disbaled on trigger falling edge(CS re-asserts). */ - /* However if CPHA is first edge mode, timer will restart each time right after timer compare event occur and - before CS pin re-asserts, which triggers another shifter load. To avoid this, when in CS dis-continuous mode, - timer should disable in timer compare rather than trigger falling edge(CS re-asserts), and in CS continuous mode, - tx/rx shifters should be flushed after transfer finishes and before next transfer starts. */ - FLEXIO_SPI_FlushShifters(base); - if ((xfer->flags & (uint8_t)kFLEXIO_SPI_csContinuous) != 0U) - { - base->flexioBase->TIMCFG[base->timerIndex[0]] |= FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTriggerFallingEdge); - } - else - { - if ((base->flexioBase->SHIFTCTL[base->shifterIndex[0]] & FLEXIO_SHIFTCTL_TIMPOL_MASK) == - FLEXIO_SHIFTCTL_TIMPOL(kFLEXIO_ShifterTimerPolarityOnNegitive)) - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TIMDIS_MASK) | - FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTimerCompare); - } - else - { - base->flexioBase->TIMCFG[base->timerIndex[0]] = - (base->flexioBase->TIMCFG[base->timerIndex[0]] & ~FLEXIO_TIMCFG_TIMDIS_MASK) | - FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTriggerFallingEdge); - } - } - - /* Check if input parameter invalid. */ - if (((xfer->txData == NULL) && (xfer->rxData == NULL)) || (xfer->dataSize == 0U)) - { - return kStatus_InvalidArgument; - } - - /* configure data mode. */ - if ((dataFormat == (uint8_t)kFLEXIO_SPI_8bitMsb) || (dataFormat == (uint8_t)kFLEXIO_SPI_8bitLsb)) - { - dataMode = 8U * 2U - 1U; - } - else if ((dataFormat == (uint8_t)kFLEXIO_SPI_16bitMsb) || (dataFormat == (uint8_t)kFLEXIO_SPI_16bitLsb)) - { - dataMode = 16U * 2U - 1U; - } - else if ((dataFormat == (uint8_t)kFLEXIO_SPI_32bitMsb) || (dataFormat == (uint8_t)kFLEXIO_SPI_32bitLsb)) - { - dataMode = 32UL * 2UL - 1UL; - } - else - { - dataMode = 8U * 2U - 1U; - } - - base->flexioBase->TIMCMP[base->timerIndex[0]] = dataMode; - - return FLEXIO_SPI_EDMAConfig(base, handle, xfer); -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_spi_edma.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_spi_edma.h deleted file mode 100644 index 7e98f199105..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_spi_edma.h +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020, 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_FLEXIO_SPI_EDMA_H_ -#define FSL_FLEXIO_SPI_EDMA_H_ - -#include "fsl_flexio_spi.h" -#include "fsl_edma.h" - -/*! - * @addtogroup flexio_edma_spi - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief FlexIO SPI EDMA driver version. */ -#define FSL_FLEXIO_SPI_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 3, 0)) -/*! @} */ - -/*! @brief typedef for flexio_spi_master_edma_handle_t in advance. */ -typedef struct _flexio_spi_master_edma_handle flexio_spi_master_edma_handle_t; - -/*! @brief Slave handle is the same with master handle. */ -typedef flexio_spi_master_edma_handle_t flexio_spi_slave_edma_handle_t; - -/*! @brief FlexIO SPI master callback for finished transmit */ -typedef void (*flexio_spi_master_edma_transfer_callback_t)(FLEXIO_SPI_Type *base, - flexio_spi_master_edma_handle_t *handle, - status_t status, - void *userData); - -/*! @brief FlexIO SPI slave callback for finished transmit */ -typedef void (*flexio_spi_slave_edma_transfer_callback_t)(FLEXIO_SPI_Type *base, - flexio_spi_slave_edma_handle_t *handle, - status_t status, - void *userData); - -/*! @brief FlexIO SPI eDMA transfer handle, users should not touch the content of the handle.*/ -struct _flexio_spi_master_edma_handle -{ - size_t transferSize; /*!< Total bytes to be transferred. */ - uint8_t nbytes; /*!< eDMA minor byte transfer count initially configured. */ - bool txInProgress; /*!< Send transfer in progress */ - bool rxInProgress; /*!< Receive transfer in progress */ - edma_handle_t *txHandle; /*!< DMA handler for SPI send */ - edma_handle_t *rxHandle; /*!< DMA handler for SPI receive */ - flexio_spi_master_edma_transfer_callback_t callback; /*!< Callback for SPI DMA transfer */ - void *userData; /*!< User Data for SPI DMA callback */ -}; - -/******************************************************************************* - * APIs - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name eDMA Transactional - * @{ - */ - -/*! - * @brief Initializes the FlexIO SPI master eDMA handle. - * - * This function initializes the FlexIO SPI master eDMA handle which can be used for other FlexIO SPI master - * transactional - * APIs. - * For a specified FlexIO SPI instance, call this API once to get the initialized handle. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle Pointer to flexio_spi_master_edma_handle_t structure to store the transfer state. - * @param callback SPI callback, NULL means no callback. - * @param userData callback function parameter. - * @param txHandle User requested eDMA handle for FlexIO SPI RX eDMA transfer. - * @param rxHandle User requested eDMA handle for FlexIO SPI TX eDMA transfer. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO SPI eDMA type/handle table out of range. - */ -status_t FLEXIO_SPI_MasterTransferCreateHandleEDMA(FLEXIO_SPI_Type *base, - flexio_spi_master_edma_handle_t *handle, - flexio_spi_master_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *txHandle, - edma_handle_t *rxHandle); - -/*! - * @brief Performs a non-blocking FlexIO SPI transfer using eDMA. - * - * @note This interface returns immediately after transfer initiates. Call - * FLEXIO_SPI_MasterGetTransferCountEDMA to poll the transfer status and check - * whether the FlexIO SPI transfer is finished. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle Pointer to flexio_spi_master_edma_handle_t structure to store the transfer state. - * @param xfer Pointer to FlexIO SPI transfer structure. - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_InvalidArgument Input argument is invalid. - * @retval kStatus_FLEXIO_SPI_Busy FlexIO SPI is not idle, is running another transfer. - */ -status_t FLEXIO_SPI_MasterTransferEDMA(FLEXIO_SPI_Type *base, - flexio_spi_master_edma_handle_t *handle, - flexio_spi_transfer_t *xfer); - -/*! - * @brief Aborts a FlexIO SPI transfer using eDMA. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle FlexIO SPI eDMA handle pointer. - */ -void FLEXIO_SPI_MasterTransferAbortEDMA(FLEXIO_SPI_Type *base, flexio_spi_master_edma_handle_t *handle); - -/*! - * @brief Gets the number of bytes transferred so far using FlexIO SPI master eDMA. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle FlexIO SPI eDMA handle pointer. - * @param count Number of bytes transferred so far by the non-blocking transaction. - */ -status_t FLEXIO_SPI_MasterTransferGetCountEDMA(FLEXIO_SPI_Type *base, - flexio_spi_master_edma_handle_t *handle, - size_t *count); - -/*! - * @brief Initializes the FlexIO SPI slave eDMA handle. - * - * This function initializes the FlexIO SPI slave eDMA handle. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle Pointer to flexio_spi_slave_edma_handle_t structure to store the transfer state. - * @param callback SPI callback, NULL means no callback. - * @param userData callback function parameter. - * @param txHandle User requested eDMA handle for FlexIO SPI TX eDMA transfer. - * @param rxHandle User requested eDMA handle for FlexIO SPI RX eDMA transfer. - */ -static inline void FLEXIO_SPI_SlaveTransferCreateHandleEDMA(FLEXIO_SPI_Type *base, - flexio_spi_slave_edma_handle_t *handle, - flexio_spi_slave_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *txHandle, - edma_handle_t *rxHandle) -{ - (void)FLEXIO_SPI_MasterTransferCreateHandleEDMA(base, handle, callback, userData, txHandle, rxHandle); -} - -/*! - * @brief Performs a non-blocking FlexIO SPI transfer using eDMA. - * - * @note This interface returns immediately after transfer initiates. Call - * FLEXIO_SPI_SlaveGetTransferCountEDMA to poll the transfer status and - * check whether the FlexIO SPI transfer is finished. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle Pointer to flexio_spi_slave_edma_handle_t structure to store the transfer state. - * @param xfer Pointer to FlexIO SPI transfer structure. - * @retval kStatus_Success Successfully start a transfer. - * @retval kStatus_InvalidArgument Input argument is invalid. - * @retval kStatus_FLEXIO_SPI_Busy FlexIO SPI is not idle, is running another transfer. - */ -status_t FLEXIO_SPI_SlaveTransferEDMA(FLEXIO_SPI_Type *base, - flexio_spi_slave_edma_handle_t *handle, - flexio_spi_transfer_t *xfer); - -/*! - * @brief Aborts a FlexIO SPI transfer using eDMA. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle Pointer to flexio_spi_slave_edma_handle_t structure to store the transfer state. - */ -static inline void FLEXIO_SPI_SlaveTransferAbortEDMA(FLEXIO_SPI_Type *base, flexio_spi_slave_edma_handle_t *handle) -{ - FLEXIO_SPI_MasterTransferAbortEDMA(base, handle); -} - -/*! - * @brief Gets the number of bytes transferred so far using FlexIO SPI slave eDMA. - * - * @param base Pointer to FLEXIO_SPI_Type structure. - * @param handle FlexIO SPI eDMA handle pointer. - * @param count Number of bytes transferred so far by the non-blocking transaction. - */ -static inline status_t FLEXIO_SPI_SlaveTransferGetCountEDMA(FLEXIO_SPI_Type *base, - flexio_spi_slave_edma_handle_t *handle, - size_t *count) -{ - return FLEXIO_SPI_MasterTransferGetCountEDMA(base, handle, count); -} - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_uart.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_uart.c deleted file mode 100644 index 13890caee7d..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_uart.c +++ /dev/null @@ -1,1023 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio_uart.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio_uart" -#endif - -/*flexioBase); -} - -static size_t FLEXIO_UART_TransferGetRxRingBufferLength(flexio_uart_handle_t *handle) -{ - size_t size; - uint16_t rxRingBufferHead = handle->rxRingBufferHead; - uint16_t rxRingBufferTail = handle->rxRingBufferTail; - - if (rxRingBufferTail > rxRingBufferHead) - { - size = (size_t)rxRingBufferHead + handle->rxRingBufferSize - (size_t)rxRingBufferTail; - } - else - { - size = (size_t)rxRingBufferHead - (size_t)rxRingBufferTail; - } - - return size; -} - -static bool FLEXIO_UART_TransferIsRxRingBufferFull(flexio_uart_handle_t *handle) -{ - bool full; - - if (FLEXIO_UART_TransferGetRxRingBufferLength(handle) == (handle->rxRingBufferSize - 1U)) - { - full = true; - } - else - { - full = false; - } - - return full; -} - -/*! - * brief Ungates the FlexIO clock, resets the FlexIO module, configures FlexIO UART - * hardware, and configures the FlexIO UART with FlexIO UART configuration. - * The configuration structure can be filled by the user or be set with - * default values by FLEXIO_UART_GetDefaultConfig(). - * - * Example - code - FLEXIO_UART_Type base = { - .flexioBase = FLEXIO, - .TxPinIndex = 0, - .RxPinIndex = 1, - .shifterIndex = {0,1}, - .timerIndex = {0,1} - }; - flexio_uart_config_t config = { - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .baudRate_Bps = 115200U, - .bitCountPerChar = 8 - }; - FLEXIO_UART_Init(base, &config, srcClock_Hz); - endcode - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param userConfig Pointer to the flexio_uart_config_t structure. - * param srcClock_Hz FlexIO source clock in Hz. - * retval kStatus_Success Configuration success. - * retval kStatus_FLEXIO_UART_BaudrateNotSupport Baudrate is not supported for current clock source frequency. -*/ -status_t FLEXIO_UART_Init(FLEXIO_UART_Type *base, const flexio_uart_config_t *userConfig, uint32_t srcClock_Hz) -{ - assert((base != NULL) && (userConfig != NULL)); - - flexio_shifter_config_t shifterConfig; - flexio_timer_config_t timerConfig; - uint32_t ctrlReg = 0; - uint16_t timerDiv = 0; - uint16_t timerCmp = 0; - uint32_t calculatedBaud; - uint32_t diff; - status_t result = kStatus_Success; - - /* Clear the shifterConfig & timerConfig struct. */ - (void)memset(&shifterConfig, 0, sizeof(shifterConfig)); - (void)memset(&timerConfig, 0, sizeof(timerConfig)); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate flexio clock. */ - CLOCK_EnableClock(s_flexioClocks[FLEXIO_UART_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Configure FLEXIO UART */ - ctrlReg = base->flexioBase->CTRL; - ctrlReg &= ~(FLEXIO_CTRL_DOZEN_MASK | FLEXIO_CTRL_DBGE_MASK | FLEXIO_CTRL_FASTACC_MASK | FLEXIO_CTRL_FLEXEN_MASK); - ctrlReg |= (FLEXIO_CTRL_DBGE(userConfig->enableInDebug) | FLEXIO_CTRL_FASTACC(userConfig->enableFastAccess) | - FLEXIO_CTRL_FLEXEN(userConfig->enableUart)); - if (!userConfig->enableInDoze) - { - ctrlReg |= FLEXIO_CTRL_DOZEN_MASK; - } - - base->flexioBase->CTRL = ctrlReg; - - /* Do hardware configuration. */ - /* 1. Configure the shifter 0 for tx. */ - shifterConfig.timerSelect = base->timerIndex[0]; - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnPositive; - shifterConfig.pinConfig = kFLEXIO_PinConfigOutput; - shifterConfig.pinSelect = base->TxPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveHigh; - shifterConfig.shifterMode = kFLEXIO_ShifterModeTransmit; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitHigh; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitLow; - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[0], &shifterConfig); - - /*2. Configure the timer 0 for tx. */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->shifterIndex[0]); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - timerConfig.pinSelect = base->TxPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveHigh; - timerConfig.timerMode = kFLEXIO_TimerModeDual8BitBaudBit; - timerConfig.timerOutput = kFLEXIO_TimerOutputOneNotAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput; - timerConfig.timerReset = kFLEXIO_TimerResetNever; - timerConfig.timerDisable = kFLEXIO_TimerDisableOnTimerCompare; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnTriggerHigh; - timerConfig.timerStop = kFLEXIO_TimerStopBitEnableOnTimerDisable; - timerConfig.timerStart = kFLEXIO_TimerStartBitEnabled; - - timerDiv = (uint16_t)(srcClock_Hz / userConfig->baudRate_Bps); - timerDiv = timerDiv / 2U - 1U; - - if (timerDiv > 0xFFU) - { - /* Check whether the calculated timerDiv is within allowed range. */ - return kStatus_FLEXIO_UART_BaudrateNotSupport; - } - else - { - /* Check to see if actual baud rate is within 3% of desired baud rate - * based on the best calculated timerDiv value */ - calculatedBaud = srcClock_Hz / (((uint32_t)timerDiv + 1U) * 2U); - /* timerDiv cannot be larger than the ideal divider, so calculatedBaud is definitely larger - than configured baud */ - diff = calculatedBaud - userConfig->baudRate_Bps; - if (diff > ((userConfig->baudRate_Bps / 100U) * 3U)) - { - return kStatus_FLEXIO_UART_BaudrateNotSupport; - } - } - - timerCmp = ((uint16_t)userConfig->bitCountPerChar * 2U - 1U) << 8U; - timerCmp |= timerDiv; - - timerConfig.timerCompare = timerCmp; - - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[0], &timerConfig); - - /* 3. Configure the shifter 1 for rx. */ - shifterConfig.timerSelect = base->timerIndex[1]; - shifterConfig.timerPolarity = kFLEXIO_ShifterTimerPolarityOnNegitive; - shifterConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - shifterConfig.pinSelect = base->RxPinIndex; - shifterConfig.pinPolarity = kFLEXIO_PinActiveHigh; - shifterConfig.shifterMode = kFLEXIO_ShifterModeReceive; - shifterConfig.inputSource = kFLEXIO_ShifterInputFromPin; - shifterConfig.shifterStop = kFLEXIO_ShifterStopBitHigh; - shifterConfig.shifterStart = kFLEXIO_ShifterStartBitLow; - - FLEXIO_SetShifterConfig(base->flexioBase, base->shifterIndex[1], &shifterConfig); - - /* 4. Configure the timer 1 for rx. */ - timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_PININPUT(base->RxPinIndex); - timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveHigh; - timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceExternal; - timerConfig.pinConfig = kFLEXIO_PinConfigOutputDisabled; - timerConfig.pinSelect = base->RxPinIndex; - timerConfig.pinPolarity = kFLEXIO_PinActiveLow; - timerConfig.timerMode = kFLEXIO_TimerModeDual8BitBaudBit; - timerConfig.timerOutput = kFLEXIO_TimerOutputOneAffectedByReset; - timerConfig.timerDecrement = kFLEXIO_TimerDecSrcOnFlexIOClockShiftTimerOutput; - timerConfig.timerReset = kFLEXIO_TimerResetOnTimerPinRisingEdge; - timerConfig.timerDisable = kFLEXIO_TimerDisableOnTimerCompare; - timerConfig.timerEnable = kFLEXIO_TimerEnableOnPinRisingEdge; - timerConfig.timerStop = kFLEXIO_TimerStopBitEnableOnTimerDisable; - timerConfig.timerStart = kFLEXIO_TimerStartBitEnabled; - - timerConfig.timerCompare = timerCmp; - - FLEXIO_SetTimerConfig(base->flexioBase, base->timerIndex[1], &timerConfig); - - return result; -} - -/*! - * brief Resets the FlexIO UART shifter and timer config. - * - * note After calling this API, call the FLEXO_UART_Init to use the FlexIO UART module. - * - * param base Pointer to FLEXIO_UART_Type structure - */ -void FLEXIO_UART_Deinit(FLEXIO_UART_Type *base) -{ - base->flexioBase->SHIFTCFG[base->shifterIndex[0]] = 0; - base->flexioBase->SHIFTCTL[base->shifterIndex[0]] = 0; - base->flexioBase->SHIFTCFG[base->shifterIndex[1]] = 0; - base->flexioBase->SHIFTCTL[base->shifterIndex[1]] = 0; - base->flexioBase->TIMCFG[base->timerIndex[0]] = 0; - base->flexioBase->TIMCMP[base->timerIndex[0]] = 0; - base->flexioBase->TIMCTL[base->timerIndex[0]] = 0; - base->flexioBase->TIMCFG[base->timerIndex[1]] = 0; - base->flexioBase->TIMCMP[base->timerIndex[1]] = 0; - base->flexioBase->TIMCTL[base->timerIndex[1]] = 0; - /* Clear the shifter flag. */ - base->flexioBase->SHIFTSTAT = (1UL << base->shifterIndex[0]); - base->flexioBase->SHIFTSTAT = (1UL << base->shifterIndex[1]); - /* Clear the timer flag. */ - base->flexioBase->TIMSTAT = (1UL << base->timerIndex[0]); - base->flexioBase->TIMSTAT = (1UL << base->timerIndex[1]); -} - -/*! - * brief Gets the default configuration to configure the FlexIO UART. The configuration - * can be used directly for calling the FLEXIO_UART_Init(). - * Example: - code - flexio_uart_config_t config; - FLEXIO_UART_GetDefaultConfig(&userConfig); - endcode - * param userConfig Pointer to the flexio_uart_config_t structure. -*/ -void FLEXIO_UART_GetDefaultConfig(flexio_uart_config_t *userConfig) -{ - assert(userConfig != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(userConfig, 0, sizeof(*userConfig)); - - userConfig->enableUart = true; - userConfig->enableInDoze = false; - userConfig->enableInDebug = true; - userConfig->enableFastAccess = false; - /* Default baud rate 115200. */ - userConfig->baudRate_Bps = 115200U; - /* Default bit count at 8. */ - userConfig->bitCountPerChar = kFLEXIO_UART_8BitsPerChar; -} - -/*! - * brief Enables the FlexIO UART interrupt. - * - * This function enables the FlexIO UART interrupt. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param mask Interrupt source. - */ -void FLEXIO_UART_EnableInterrupts(FLEXIO_UART_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_UART_TxDataRegEmptyInterruptEnable) != 0U) - { - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable) != 0U) - { - FLEXIO_EnableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Disables the FlexIO UART interrupt. - * - * This function disables the FlexIO UART interrupt. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param mask Interrupt source. - */ -void FLEXIO_UART_DisableInterrupts(FLEXIO_UART_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_UART_TxDataRegEmptyInterruptEnable) != 0U) - { - FLEXIO_DisableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable) != 0U) - { - FLEXIO_DisableShifterStatusInterrupts(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Gets the FlexIO UART status flags. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * return FlexIO UART status flags. - */ - -uint32_t FLEXIO_UART_GetStatusFlags(FLEXIO_UART_Type *base) -{ - uint32_t status = 0U; - status = - ((FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0])) >> base->shifterIndex[0]); - status |= - (((FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[1])) >> (base->shifterIndex[1])) - << 1U); - status |= - (((FLEXIO_GetShifterErrorFlags(base->flexioBase) & (1UL << base->shifterIndex[1])) >> (base->shifterIndex[1])) - << 2U); - return status; -} - -/*! - * brief Gets the FlexIO UART status flags. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param mask Status flag. - * The parameter can be any combination of the following values: - * arg kFLEXIO_UART_TxDataRegEmptyFlag - * arg kFLEXIO_UART_RxEmptyFlag - * arg kFLEXIO_UART_RxOverRunFlag - */ - -void FLEXIO_UART_ClearStatusFlags(FLEXIO_UART_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kFLEXIO_UART_TxDataRegEmptyFlag) != 0U) - { - FLEXIO_ClearShifterStatusFlags(base->flexioBase, 1UL << base->shifterIndex[0]); - } - if ((mask & (uint32_t)kFLEXIO_UART_RxDataRegFullFlag) != 0U) - { - FLEXIO_ClearShifterStatusFlags(base->flexioBase, 1UL << base->shifterIndex[1]); - } - if ((mask & (uint32_t)kFLEXIO_UART_RxOverRunFlag) != 0U) - { - FLEXIO_ClearShifterErrorFlags(base->flexioBase, 1UL << base->shifterIndex[1]); - } -} - -/*! - * brief Sends a buffer of data bytes. - * - * note This function blocks using the polling method until all bytes have been sent. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param txData The data bytes to send. - * param txSize The number of data bytes to send. - * retval kStatus_FLEXIO_UART_Timeout Transmission timed out and was aborted. - * retval kStatus_Success Successfully wrote all data. - */ -status_t FLEXIO_UART_WriteBlocking(FLEXIO_UART_Type *base, const uint8_t *txData, size_t txSize) -{ - assert(txData != NULL); - assert(txSize != 0U); -#if UART_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != txSize--) - { - /* Wait until data transfer complete. */ -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; - while ((0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) && - (0U != --waitTimes)) -#else - while (0U == (FLEXIO_GetShifterStatusFlags(base->flexioBase) & (1UL << base->shifterIndex[0]))) -#endif - { - } -#if UART_RETRY_TIMES - if (0U == waitTimes) - { - return kStatus_FLEXIO_UART_Timeout; - } -#endif - - base->flexioBase->SHIFTBUF[base->shifterIndex[0]] = *txData++; - } - return kStatus_Success; -} - -/*! - * brief Receives a buffer of bytes. - * - * note This function blocks using the polling method until all bytes have been received. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param rxData The buffer to store the received bytes. - * param rxSize The number of data bytes to be received. - * retval kStatus_FLEXIO_UART_Timeout Transmission timed out and was aborted. - * retval kStatus_Success Successfully received all data. - */ -status_t FLEXIO_UART_ReadBlocking(FLEXIO_UART_Type *base, uint8_t *rxData, size_t rxSize) -{ - assert(rxData != NULL); - assert(rxSize != 0U); -#if UART_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != rxSize--) - { - /* Wait until data transfer complete. */ -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; - while ((0U == (FLEXIO_UART_GetStatusFlags(base) & (uint32_t)kFLEXIO_UART_RxDataRegFullFlag)) && - (0U != --waitTimes)) -#else - while (0U == (FLEXIO_UART_GetStatusFlags(base) & (uint32_t)kFLEXIO_UART_RxDataRegFullFlag)) -#endif - { - } -#if UART_RETRY_TIMES - if (0U == waitTimes) - { - return kStatus_FLEXIO_UART_Timeout; - } -#endif - - *rxData++ = (uint8_t)(base->flexioBase->SHIFTBUFBYS[base->shifterIndex[1]]); - } - return kStatus_Success; -} - -/*! - * brief Initializes the UART handle. - * - * This function initializes the FlexIO UART handle, which can be used for other FlexIO - * UART transactional APIs. Call this API once to get the - * initialized handle. - * - * The UART driver supports the "background" receiving, which means that users can set up - * a RX ring buffer optionally. Data received is stored into the ring buffer even when - * the user doesn't call the FLEXIO_UART_TransferReceiveNonBlocking() API. If there is already data - * received in the ring buffer, users can get the received data from the ring buffer - * directly. The ring buffer is disabled if passing NULL as p ringBuffer. - * - * param base to FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * param callback The callback function. - * param userData The parameter of the callback function. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_UART_TransferCreateHandle(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - flexio_uart_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - IRQn_Type flexio_irqs[] = FLEXIO_IRQS; - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Set the TX/RX state. */ - handle->rxState = (uint8_t)kFLEXIO_UART_RxIdle; - handle->txState = (uint8_t)kFLEXIO_UART_TxIdle; - - /* Set the callback and user data. */ - handle->callback = callback; - handle->userData = userData; - - /* Clear pending NVIC IRQ before enable NVIC IRQ. */ - NVIC_ClearPendingIRQ(flexio_irqs[FLEXIO_UART_GetInstance(base)]); - /* Enable interrupt in NVIC. */ - (void)EnableIRQ(flexio_irqs[FLEXIO_UART_GetInstance(base)]); - - /* Save the context in global variables to support the double weak mechanism. */ - return FLEXIO_RegisterHandleIRQ(base, handle, FLEXIO_UART_TransferHandleIRQ); -} - -/*! - * brief Sets up the RX ring buffer. - * - * This function sets up the RX ring buffer to a specific UART handle. - * - * When the RX ring buffer is used, data received is stored into the ring buffer even when - * the user doesn't call the UART_ReceiveNonBlocking() API. If there is already data received - * in the ring buffer, users can get the received data from the ring buffer directly. - * - * note When using the RX ring buffer, one byte is reserved for internal use. In other - * words, if p ringBufferSize is 32, only 31 bytes are used for saving data. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * param ringBuffer Start address of ring buffer for background receiving. Pass NULL to disable the ring buffer. - * param ringBufferSize Size of the ring buffer. - */ -void FLEXIO_UART_TransferStartRingBuffer(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - uint8_t *ringBuffer, - size_t ringBufferSize) -{ - assert(handle != NULL); - - /* Setup the ringbuffer address */ - if (ringBuffer != NULL) - { - handle->rxRingBuffer = ringBuffer; - handle->rxRingBufferSize = ringBufferSize; - handle->rxRingBufferHead = 0U; - handle->rxRingBufferTail = 0U; - - /* Enable the interrupt to accept the data when user need the ring buffer. */ - FLEXIO_UART_EnableInterrupts(base, (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable); - } -} - -/*! - * brief Aborts the background transfer and uninstalls the ring buffer. - * - * This function aborts the background transfer and uninstalls the ring buffer. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferStopRingBuffer(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle) -{ - assert(handle != NULL); - - if (handle->rxState == (uint8_t)kFLEXIO_UART_RxIdle) - { - FLEXIO_UART_DisableInterrupts(base, (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable); - } - - handle->rxRingBuffer = NULL; - handle->rxRingBufferSize = 0U; - handle->rxRingBufferHead = 0U; - handle->rxRingBufferTail = 0U; -} - -/*! - * brief Transmits a buffer of data using the interrupt method. - * - * This function sends data using an interrupt method. This is a non-blocking function, - * which returns directly without waiting for all data to be written to the TX register. When - * all data is written to the TX register in ISR, the FlexIO UART driver calls the callback - * function and passes the ref kStatus_FLEXIO_UART_TxIdle as status parameter. - * - * note The kStatus_FLEXIO_UART_TxIdle is passed to the upper layer when all data is written - * to the TX register. However, it does not ensure that all data is sent out. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * param xfer FlexIO UART transfer structure. See #flexio_uart_transfer_t. - * retval kStatus_Success Successfully starts the data transmission. - * retval kStatus_UART_TxBusy Previous transmission still not finished, data not written to the TX register. - */ -status_t FLEXIO_UART_TransferSendNonBlocking(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - flexio_uart_transfer_t *xfer) -{ - status_t status; - - /* Return error if xfer invalid. */ - if ((0U == xfer->dataSize) || (NULL == xfer->txData)) - { - return kStatus_InvalidArgument; - } - - /* Return error if current TX busy. */ - if ((uint8_t)kFLEXIO_UART_TxBusy == handle->txState) - { - status = kStatus_FLEXIO_UART_TxBusy; - } - else - { - handle->txData = xfer->txData; - handle->txDataSize = xfer->dataSize; - handle->txDataSizeAll = xfer->dataSize; - handle->txState = (uint8_t)kFLEXIO_UART_TxBusy; - - /* Enable transmiter interrupt. */ - FLEXIO_UART_EnableInterrupts(base, (uint32_t)kFLEXIO_UART_TxDataRegEmptyInterruptEnable); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Aborts the interrupt-driven data transmit. - * - * This function aborts the interrupt-driven data sending. Get the remainBytes to find out - * how many bytes are still not sent out. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferAbortSend(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle) -{ - /* Disable the transmitter and disable the interrupt. */ - FLEXIO_UART_DisableInterrupts(base, (uint32_t)kFLEXIO_UART_TxDataRegEmptyInterruptEnable); - - handle->txDataSize = 0U; - handle->txState = (uint8_t)kFLEXIO_UART_TxIdle; -} - -/*! - * brief Gets the number of bytes sent. - * - * This function gets the number of bytes sent driven by interrupt. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * param count Number of bytes sent so far by the non-blocking transaction. - * retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetSendCount(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - assert(count != NULL); - - if ((uint8_t)kFLEXIO_UART_TxIdle == handle->txState) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->txDataSizeAll - handle->txDataSize; - - return kStatus_Success; -} - -/*! - * brief Receives a buffer of data using the interrupt method. - * - * This function receives data using the interrupt method. This is a non-blocking function, - * which returns without waiting for all data to be received. - * If the RX ring buffer is used and not empty, the data in ring buffer is copied and - * the parameter p receivedBytes shows how many bytes are copied from the ring buffer. - * After copying, if the data in ring buffer is not enough to read, the receive - * request is saved by the UART driver. When new data arrives, the receive request - * is serviced first. When all data is received, the UART driver notifies the upper layer - * through a callback function and passes the status parameter ref kStatus_UART_RxIdle. - * For example, if the upper layer needs 10 bytes but there are only 5 bytes in the ring buffer, - * the 5 bytes are copied to xfer->data. This function returns with the - * parameter p receivedBytes set to 5. For the last 5 bytes, newly arrived data is - * saved from the xfer->data[5]. When 5 bytes are received, the UART driver notifies upper layer. - * If the RX ring buffer is not enabled, this function enables the RX and RX interrupt - * to receive data to xfer->data. When all data is received, the upper layer is notified. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * param xfer UART transfer structure. See #flexio_uart_transfer_t. - * param receivedBytes Bytes received from the ring buffer directly. - * retval kStatus_Success Successfully queue the transfer into the transmit queue. - * retval kStatus_FLEXIO_UART_RxBusy Previous receive request is not finished. - */ -status_t FLEXIO_UART_TransferReceiveNonBlocking(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - flexio_uart_transfer_t *xfer, - size_t *receivedBytes) -{ - uint32_t i; - status_t status; - /* How many bytes to copy from ring buffer to user memory. */ - size_t bytesToCopy = 0U; - /* How many bytes to receive. */ - size_t bytesToReceive; - /* How many bytes currently have received. */ - size_t bytesCurrentReceived; - - /* Return error if xfer invalid. */ - if ((0U == xfer->dataSize) || (NULL == xfer->rxData)) - { - return kStatus_InvalidArgument; - } - - /* How to get data: - 1. If RX ring buffer is not enabled, then save xfer->data and xfer->dataSize - to uart handle, enable interrupt to store received data to xfer->data. When - all data received, trigger callback. - 2. If RX ring buffer is enabled and not empty, get data from ring buffer first. - If there are enough data in ring buffer, copy them to xfer->data and return. - If there are not enough data in ring buffer, copy all of them to xfer->data, - save the xfer->data remained empty space to uart handle, receive data - to this empty space and trigger callback when finished. */ - - if ((uint8_t)kFLEXIO_UART_RxBusy == handle->rxState) - { - status = kStatus_FLEXIO_UART_RxBusy; - } - else - { - bytesToReceive = xfer->dataSize; - bytesCurrentReceived = 0U; - - /* If RX ring buffer is used. */ - if (handle->rxRingBuffer != NULL) - { - /* Disable FLEXIO_UART RX IRQ, protect ring buffer. */ - FLEXIO_UART_DisableInterrupts(base, (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable); - - /* How many bytes in RX ring buffer currently. */ - bytesToCopy = FLEXIO_UART_TransferGetRxRingBufferLength(handle); - - if (bytesToCopy != 0U) - { - bytesToCopy = MIN(bytesToReceive, bytesToCopy); - - bytesToReceive -= bytesToCopy; - - /* Copy data from ring buffer to user memory. */ - for (i = 0U; i < bytesToCopy; i++) - { - xfer->rxData[bytesCurrentReceived++] = handle->rxRingBuffer[handle->rxRingBufferTail]; - - /* Wrap to 0. Not use modulo (%) because it might be large and slow. */ - if ((uint32_t)handle->rxRingBufferTail + 1U == handle->rxRingBufferSize) - { - handle->rxRingBufferTail = 0U; - } - else - { - handle->rxRingBufferTail++; - } - } - } - - /* If ring buffer does not have enough data, still need to read more data. */ - if (bytesToReceive != 0U) - { - /* No data in ring buffer, save the request to UART handle. */ - handle->rxData = xfer->rxData + bytesCurrentReceived; - handle->rxDataSize = bytesToReceive; - handle->rxDataSizeAll = xfer->dataSize; - handle->rxState = (uint8_t)kFLEXIO_UART_RxBusy; - } - - /* Enable FLEXIO_UART RX IRQ if previously enabled. */ - FLEXIO_UART_EnableInterrupts(base, (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable); - - /* Call user callback since all data are received. */ - if (0U == bytesToReceive) - { - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_FLEXIO_UART_RxIdle, handle->userData); - } - } - } - /* Ring buffer not used. */ - else - { - handle->rxData = xfer->rxData + bytesCurrentReceived; - handle->rxDataSize = bytesToReceive; - handle->rxDataSizeAll = bytesToReceive; - handle->rxState = (uint8_t)kFLEXIO_UART_RxBusy; - - /* Enable RX interrupt. */ - FLEXIO_UART_EnableInterrupts(base, (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable); - } - - /* Return the how many bytes have read. */ - if (receivedBytes != NULL) - { - *receivedBytes = bytesCurrentReceived; - } - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Aborts the receive data which was using IRQ. - * - * This function aborts the receive data which was using IRQ. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferAbortReceive(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle) -{ - /* Only abort the receive to handle->rxData, the RX ring buffer is still working. */ - if (NULL == handle->rxRingBuffer) - { - /* Disable RX interrupt. */ - FLEXIO_UART_DisableInterrupts(base, (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable); - } - - handle->rxDataSize = 0U; - handle->rxState = (uint8_t)kFLEXIO_UART_RxIdle; -} - -/*! - * brief Gets the number of bytes received. - * - * This function gets the number of bytes received driven by interrupt. - * - * param base Pointer to the FLEXIO_UART_Type structure. - * param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * param count Number of bytes received so far by the non-blocking transaction. - * retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetReceiveCount(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - assert(count != NULL); - - if ((uint8_t)kFLEXIO_UART_RxIdle == handle->rxState) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->rxDataSizeAll - handle->rxDataSize; - - return kStatus_Success; -} - -/*! - * brief FlexIO UART IRQ handler function. - * - * This function processes the FlexIO UART transmit and receives the IRQ request. - * - * param uartType Pointer to the FLEXIO_UART_Type structure. - * param uartHandle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferHandleIRQ(void *uartType, void *uartHandle) -{ - uint8_t count = 1; - FLEXIO_UART_Type *base = (FLEXIO_UART_Type *)uartType; - flexio_uart_handle_t *handle = (flexio_uart_handle_t *)uartHandle; - uint16_t rxRingBufferHead; - - /* Read the status back. */ - uint32_t status = FLEXIO_UART_GetStatusFlags(base); - - /* If RX overrun. */ - if (((uint32_t)kFLEXIO_UART_RxOverRunFlag & status) != 0U) - { - /* Clear Overrun flag. */ - FLEXIO_UART_ClearStatusFlags(base, (uint32_t)kFLEXIO_UART_RxOverRunFlag); - - /* Trigger callback. */ - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_FLEXIO_UART_RxHardwareOverrun, handle->userData); - } - } - - /* Receive data register full */ - if ((((uint32_t)kFLEXIO_UART_RxDataRegFullFlag & status) != 0U) && - ((base->flexioBase->SHIFTSIEN & (1UL << base->shifterIndex[1])) != 0U)) - { - /* If handle->rxDataSize is not 0, first save data to handle->rxData. */ - if (handle->rxDataSize != 0U) - { - /* Using non block API to read the data from the registers. */ - FLEXIO_UART_ReadByte(base, handle->rxData); - handle->rxDataSize--; - handle->rxData++; - count--; - - /* If all the data required for upper layer is ready, trigger callback. */ - if (0U == handle->rxDataSize) - { - handle->rxState = (uint8_t)kFLEXIO_UART_RxIdle; - - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_FLEXIO_UART_RxIdle, handle->userData); - } - } - } - - if (handle->rxRingBuffer != NULL) - { - if (count != 0U) - { - /* If RX ring buffer is full, trigger callback to notify over run. */ - if (FLEXIO_UART_TransferIsRxRingBufferFull(handle)) - { - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_FLEXIO_UART_RxRingBufferOverrun, handle->userData); - } - } - - /* If ring buffer is still full after callback function, the oldest data is overridden. */ - if (FLEXIO_UART_TransferIsRxRingBufferFull(handle)) - { - /* Increase handle->rxRingBufferTail to make room for new data. */ - if ((uint32_t)handle->rxRingBufferTail + 1U == handle->rxRingBufferSize) - { - handle->rxRingBufferTail = 0U; - } - else - { - handle->rxRingBufferTail++; - } - } - - /* Read data. */ - rxRingBufferHead = handle->rxRingBufferHead; - handle->rxRingBuffer[rxRingBufferHead] = - (uint8_t)(base->flexioBase->SHIFTBUFBYS[base->shifterIndex[1]]); - - /* Increase handle->rxRingBufferHead. */ - if ((uint32_t)handle->rxRingBufferHead + 1U == handle->rxRingBufferSize) - { - handle->rxRingBufferHead = 0U; - } - else - { - handle->rxRingBufferHead++; - } - } - } - /* If no receive requst pending, stop RX interrupt. */ - else if (0U == handle->rxDataSize) - { - FLEXIO_UART_DisableInterrupts(base, (uint32_t)kFLEXIO_UART_RxDataRegFullInterruptEnable); - } - else - { - } - } - - /* Send data register empty and the interrupt is enabled. */ - if ((((uint32_t)kFLEXIO_UART_TxDataRegEmptyFlag & status) != 0U) && - ((base->flexioBase->SHIFTSIEN & (1UL << base->shifterIndex[0])) != 0U)) - { - if (handle->txDataSize != 0U) - { - /* Using non block API to write the data to the registers. */ - FLEXIO_UART_WriteByte(base, handle->txData); - handle->txData++; - handle->txDataSize--; - - /* If all the data are written to data register, TX finished. */ - if (0U == handle->txDataSize) - { - handle->txState = (uint8_t)kFLEXIO_UART_TxIdle; - - /* Disable TX register empty interrupt. */ - FLEXIO_UART_DisableInterrupts(base, (uint32_t)kFLEXIO_UART_TxDataRegEmptyInterruptEnable); - - /* Trigger callback. */ - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_FLEXIO_UART_TxIdle, handle->userData); - } - } - } - } -} - -/*! - * brief Flush tx/rx shifters. - * - * param base Pointer to the FLEXIO_UART_Type structure. - */ -void FLEXIO_UART_FlushShifters(FLEXIO_UART_Type *base) -{ - /* Disable then re-enable to flush the tx shifter. */ - base->flexioBase->SHIFTCTL[base->shifterIndex[0]] &= ~FLEXIO_SHIFTCTL_SMOD_MASK; - base->flexioBase->SHIFTCTL[base->shifterIndex[0]] |= FLEXIO_SHIFTCTL_SMOD(kFLEXIO_ShifterModeTransmit); - /* Read to flush the rx shifter. */ - (void)base->flexioBase->SHIFTBUF[base->shifterIndex[1]]; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_uart.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_uart.h deleted file mode 100644 index d6f36bf3235..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_uart.h +++ /dev/null @@ -1,588 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_FLEXIO_UART_H_ -#define FSL_FLEXIO_UART_H_ - -#include "fsl_common.h" -#include "fsl_flexio.h" - -/*! - * @addtogroup flexio_uart - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief FlexIO UART driver version. */ -#define FSL_FLEXIO_UART_DRIVER_VERSION (MAKE_VERSION(2, 5, 0)) -/*! @} */ - -/*! @brief Retry times for waiting flag. */ -#ifndef UART_RETRY_TIMES -#define UART_RETRY_TIMES 0U /* Defining to zero means to keep waiting for the flag until it is assert/deassert. */ -#endif - -/*! @brief Error codes for the UART driver. */ -enum -{ - kStatus_FLEXIO_UART_TxBusy = MAKE_STATUS(kStatusGroup_FLEXIO_UART, 0), /*!< Transmitter is busy. */ - kStatus_FLEXIO_UART_RxBusy = MAKE_STATUS(kStatusGroup_FLEXIO_UART, 1), /*!< Receiver is busy. */ - kStatus_FLEXIO_UART_TxIdle = MAKE_STATUS(kStatusGroup_FLEXIO_UART, 2), /*!< UART transmitter is idle. */ - kStatus_FLEXIO_UART_RxIdle = MAKE_STATUS(kStatusGroup_FLEXIO_UART, 3), /*!< UART receiver is idle. */ - kStatus_FLEXIO_UART_ERROR = MAKE_STATUS(kStatusGroup_FLEXIO_UART, 4), /*!< ERROR happens on UART. */ - kStatus_FLEXIO_UART_RxRingBufferOverrun = - MAKE_STATUS(kStatusGroup_FLEXIO_UART, 5), /*!< UART RX software ring buffer overrun. */ - kStatus_FLEXIO_UART_RxHardwareOverrun = MAKE_STATUS(kStatusGroup_FLEXIO_UART, 6), /*!< UART RX receiver overrun. */ - kStatus_FLEXIO_UART_Timeout = MAKE_STATUS(kStatusGroup_FLEXIO_UART, 7), /*!< UART times out. */ - kStatus_FLEXIO_UART_BaudrateNotSupport = - MAKE_STATUS(kStatusGroup_FLEXIO_UART, 8) /*!< Baudrate is not supported in current clock source */ -}; - -/*! @brief FlexIO UART bit count per char. */ -typedef enum _flexio_uart_bit_count_per_char -{ - kFLEXIO_UART_7BitsPerChar = 7U, /*!< 7-bit data characters */ - kFLEXIO_UART_8BitsPerChar = 8U, /*!< 8-bit data characters */ - kFLEXIO_UART_9BitsPerChar = 9U, /*!< 9-bit data characters */ -} flexio_uart_bit_count_per_char_t; - -/*! @brief Define FlexIO UART interrupt mask. */ -enum _flexio_uart_interrupt_enable -{ - kFLEXIO_UART_TxDataRegEmptyInterruptEnable = 0x1U, /*!< Transmit buffer empty interrupt enable. */ - kFLEXIO_UART_RxDataRegFullInterruptEnable = 0x2U, /*!< Receive buffer full interrupt enable. */ -}; - -/*! @brief Define FlexIO UART status mask. */ -enum _flexio_uart_status_flags -{ - kFLEXIO_UART_TxDataRegEmptyFlag = 0x1U, /*!< Transmit buffer empty flag. */ - kFLEXIO_UART_RxDataRegFullFlag = 0x2U, /*!< Receive buffer full flag. */ - kFLEXIO_UART_RxOverRunFlag = 0x4U, /*!< Receive buffer over run flag. */ -}; - -/*! @brief Define FlexIO UART access structure typedef. */ -typedef struct _flexio_uart_type -{ - FLEXIO_Type *flexioBase; /*!< FlexIO base pointer. */ - uint8_t TxPinIndex; /*!< Pin select for UART_Tx. */ - uint8_t RxPinIndex; /*!< Pin select for UART_Rx. */ - uint8_t shifterIndex[2]; /*!< Shifter index used in FlexIO UART. */ - uint8_t timerIndex[2]; /*!< Timer index used in FlexIO UART. */ -} FLEXIO_UART_Type; - -/*! @brief Define FlexIO UART user configuration structure. */ -typedef struct _flexio_uart_config -{ - bool enableUart; /*!< Enable/disable FlexIO UART TX & RX. */ - bool enableInDoze; /*!< Enable/disable FlexIO operation in doze mode*/ - bool enableInDebug; /*!< Enable/disable FlexIO operation in debug mode*/ - bool enableFastAccess; /*!< Enable/disable fast access to FlexIO registers, - fast access requires the FlexIO clock to be at least - twice the frequency of the bus clock. */ - uint32_t baudRate_Bps; /*!< Baud rate in Bps. */ - flexio_uart_bit_count_per_char_t bitCountPerChar; /*!< number of bits, 7/8/9 -bit */ -} flexio_uart_config_t; - -/*! @brief Define FlexIO UART transfer structure. */ -typedef struct _flexio_uart_transfer -{ - /* - * Use separate TX and RX data pointer, because TX data is const data. - * The member data is kept for backward compatibility. - */ - union - { - uint8_t *data; /*!< The buffer of data to be transfer.*/ - uint8_t *rxData; /*!< The buffer to receive data. */ - const uint8_t *txData; /*!< The buffer of data to be sent. */ - }; - size_t dataSize; /*!< Transfer size*/ -} flexio_uart_transfer_t; - -/* Forward declaration of the handle typedef. */ -typedef struct _flexio_uart_handle flexio_uart_handle_t; - -/*! @brief FlexIO UART transfer callback function. */ -typedef void (*flexio_uart_transfer_callback_t)(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - status_t status, - void *userData); - -/*! @brief Define FLEXIO UART handle structure*/ -struct _flexio_uart_handle -{ - const uint8_t *volatile txData; /*!< Address of remaining data to send. */ - volatile size_t txDataSize; /*!< Size of the remaining data to send. */ - uint8_t *volatile rxData; /*!< Address of remaining data to receive. */ - volatile size_t rxDataSize; /*!< Size of the remaining data to receive. */ - size_t txDataSizeAll; /*!< Total bytes to be sent. */ - size_t rxDataSizeAll; /*!< Total bytes to be received. */ - - uint8_t *rxRingBuffer; /*!< Start address of the receiver ring buffer. */ - size_t rxRingBufferSize; /*!< Size of the ring buffer. */ - volatile uint16_t rxRingBufferHead; /*!< Index for the driver to store received data into ring buffer. */ - volatile uint16_t rxRingBufferTail; /*!< Index for the user to get data from the ring buffer. */ - - flexio_uart_transfer_callback_t callback; /*!< Callback function. */ - void *userData; /*!< UART callback function parameter.*/ - - volatile uint8_t txState; /*!< TX transfer state. */ - volatile uint8_t rxState; /*!< RX transfer state */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus*/ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Ungates the FlexIO clock, resets the FlexIO module, configures FlexIO UART - * hardware, and configures the FlexIO UART with FlexIO UART configuration. - * The configuration structure can be filled by the user or be set with - * default values by FLEXIO_UART_GetDefaultConfig(). - * - * Example - @code - FLEXIO_UART_Type base = { - .flexioBase = FLEXIO, - .TxPinIndex = 0, - .RxPinIndex = 1, - .shifterIndex = {0,1}, - .timerIndex = {0,1} - }; - flexio_uart_config_t config = { - .enableInDoze = false, - .enableInDebug = true, - .enableFastAccess = false, - .baudRate_Bps = 115200U, - .bitCountPerChar = 8 - }; - FLEXIO_UART_Init(base, &config, srcClock_Hz); - @endcode - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param userConfig Pointer to the flexio_uart_config_t structure. - * @param srcClock_Hz FlexIO source clock in Hz. - * @retval kStatus_Success Configuration success. - * @retval kStatus_FLEXIO_UART_BaudrateNotSupport Baudrate is not supported for current clock source frequency. -*/ -status_t FLEXIO_UART_Init(FLEXIO_UART_Type *base, const flexio_uart_config_t *userConfig, uint32_t srcClock_Hz); - -/*! - * @brief Resets the FlexIO UART shifter and timer config. - * - * @note After calling this API, call the FLEXO_UART_Init to use the FlexIO UART module. - * - * @param base Pointer to FLEXIO_UART_Type structure - */ -void FLEXIO_UART_Deinit(FLEXIO_UART_Type *base); - -/*! - * @brief Gets the default configuration to configure the FlexIO UART. The configuration - * can be used directly for calling the FLEXIO_UART_Init(). - * Example: - @code - flexio_uart_config_t config; - FLEXIO_UART_GetDefaultConfig(&userConfig); - @endcode - * @param userConfig Pointer to the flexio_uart_config_t structure. -*/ -void FLEXIO_UART_GetDefaultConfig(flexio_uart_config_t *userConfig); - -/*! @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets the FlexIO UART status flags. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @return FlexIO UART status flags. - */ - -uint32_t FLEXIO_UART_GetStatusFlags(FLEXIO_UART_Type *base); - -/*! - * @brief Gets the FlexIO UART status flags. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param mask Status flag. - * The parameter can be any combination of the following values: - * @arg kFLEXIO_UART_TxDataRegEmptyFlag - * @arg kFLEXIO_UART_RxEmptyFlag - * @arg kFLEXIO_UART_RxOverRunFlag - */ - -void FLEXIO_UART_ClearStatusFlags(FLEXIO_UART_Type *base, uint32_t mask); - -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables the FlexIO UART interrupt. - * - * This function enables the FlexIO UART interrupt. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param mask Interrupt source. - */ -void FLEXIO_UART_EnableInterrupts(FLEXIO_UART_Type *base, uint32_t mask); - -/*! - * @brief Disables the FlexIO UART interrupt. - * - * This function disables the FlexIO UART interrupt. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param mask Interrupt source. - */ -void FLEXIO_UART_DisableInterrupts(FLEXIO_UART_Type *base, uint32_t mask); - -/*! @} */ - -/*! - * @name DMA Control - * @{ - */ - -/*! - * @brief Gets the FlexIO UARt transmit data register address. - * - * This function returns the UART data register address, which is mainly used by DMA/eDMA. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @return FlexIO UART transmit data register address. - */ -static inline uint32_t FLEXIO_UART_GetTxDataRegisterAddress(FLEXIO_UART_Type *base) -{ - return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBuffer, base->shifterIndex[0]); -} - -/*! - * @brief Gets the FlexIO UART receive data register address. - * - * This function returns the UART data register address, which is mainly used by DMA/eDMA. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @return FlexIO UART receive data register address. - */ -static inline uint32_t FLEXIO_UART_GetRxDataRegisterAddress(FLEXIO_UART_Type *base) -{ - return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBufferByteSwapped, base->shifterIndex[1]); -} - -/*! - * @brief Enables/disables the FlexIO UART transmit DMA. - * This function enables/disables the FlexIO UART Tx DMA, - * which means asserting the kFLEXIO_UART_TxDataRegEmptyFlag does/doesn't trigger the DMA request. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param enable True to enable, false to disable. - */ -static inline void FLEXIO_UART_EnableTxDMA(FLEXIO_UART_Type *base, bool enable) -{ - FLEXIO_EnableShifterStatusDMA(base->flexioBase, 1UL << base->shifterIndex[0], enable); -} - -/*! - * @brief Enables/disables the FlexIO UART receive DMA. - * This function enables/disables the FlexIO UART Rx DMA, - * which means asserting kFLEXIO_UART_RxDataRegFullFlag does/doesn't trigger the DMA request. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param enable True to enable, false to disable. - */ -static inline void FLEXIO_UART_EnableRxDMA(FLEXIO_UART_Type *base, bool enable) -{ - FLEXIO_EnableShifterStatusDMA(base->flexioBase, 1UL << base->shifterIndex[1], enable); -} - -/*! @} */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Enables/disables the FlexIO UART module operation. - * - * @param base Pointer to the FLEXIO_UART_Type. - * @param enable True to enable, false does not have any effect. - */ -static inline void FLEXIO_UART_Enable(FLEXIO_UART_Type *base, bool enable) -{ - if (enable) - { - base->flexioBase->CTRL |= FLEXIO_CTRL_FLEXEN_MASK; - } -} - -/*! - * @brief Writes one byte of data. - * - * @note This is a non-blocking API, which returns directly after the data is put into the - * data register. Ensure that the TxEmptyFlag is asserted before calling - * this API. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param buffer The data bytes to send. - */ -static inline void FLEXIO_UART_WriteByte(FLEXIO_UART_Type *base, const uint8_t *buffer) -{ - base->flexioBase->SHIFTBUF[base->shifterIndex[0]] = *buffer; -} - -/*! - * @brief Reads one byte of data. - * - * @note This is a non-blocking API, which returns directly after the data is read from the - * data register. Ensure that the RxFullFlag is asserted before calling this API. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param buffer The buffer to store the received bytes. - */ -static inline void FLEXIO_UART_ReadByte(FLEXIO_UART_Type *base, uint8_t *buffer) -{ - *buffer = (uint8_t)(base->flexioBase->SHIFTBUFBYS[base->shifterIndex[1]]); -} - -/*! - * @brief Sends a buffer of data bytes. - * - * @note This function blocks using the polling method until all bytes have been sent. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param txData The data bytes to send. - * @param txSize The number of data bytes to send. - * @retval kStatus_FLEXIO_UART_Timeout Transmission timed out and was aborted. - * @retval kStatus_Success Successfully wrote all data. - */ -status_t FLEXIO_UART_WriteBlocking(FLEXIO_UART_Type *base, const uint8_t *txData, size_t txSize); - -/*! - * @brief Receives a buffer of bytes. - * - * @note This function blocks using the polling method until all bytes have been received. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param rxData The buffer to store the received bytes. - * @param rxSize The number of data bytes to be received. - * @retval kStatus_FLEXIO_UART_Timeout Transmission timed out and was aborted. - * @retval kStatus_Success Successfully received all data. - */ -status_t FLEXIO_UART_ReadBlocking(FLEXIO_UART_Type *base, uint8_t *rxData, size_t rxSize); - -/*! @} */ - -/*! - * @name Transactional - * @{ - */ - -/*! - * @brief Initializes the UART handle. - * - * This function initializes the FlexIO UART handle, which can be used for other FlexIO - * UART transactional APIs. Call this API once to get the - * initialized handle. - * - * The UART driver supports the "background" receiving, which means that users can set up - * a RX ring buffer optionally. Data received is stored into the ring buffer even when - * the user doesn't call the FLEXIO_UART_TransferReceiveNonBlocking() API. If there is already data - * received in the ring buffer, users can get the received data from the ring buffer - * directly. The ring buffer is disabled if passing NULL as @p ringBuffer. - * - * @param base to FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * @param callback The callback function. - * @param userData The parameter of the callback function. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. - */ -status_t FLEXIO_UART_TransferCreateHandle(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - flexio_uart_transfer_callback_t callback, - void *userData); - -/*! - * @brief Sets up the RX ring buffer. - * - * This function sets up the RX ring buffer to a specific UART handle. - * - * When the RX ring buffer is used, data received is stored into the ring buffer even when - * the user doesn't call the UART_ReceiveNonBlocking() API. If there is already data received - * in the ring buffer, users can get the received data from the ring buffer directly. - * - * @note When using the RX ring buffer, one byte is reserved for internal use. In other - * words, if @p ringBufferSize is 32, only 31 bytes are used for saving data. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * @param ringBuffer Start address of ring buffer for background receiving. Pass NULL to disable the ring buffer. - * @param ringBufferSize Size of the ring buffer. - */ -void FLEXIO_UART_TransferStartRingBuffer(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - uint8_t *ringBuffer, - size_t ringBufferSize); - -/*! - * @brief Aborts the background transfer and uninstalls the ring buffer. - * - * This function aborts the background transfer and uninstalls the ring buffer. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferStopRingBuffer(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle); - -/*! - * @brief Transmits a buffer of data using the interrupt method. - * - * This function sends data using an interrupt method. This is a non-blocking function, - * which returns directly without waiting for all data to be written to the TX register. When - * all data is written to the TX register in ISR, the FlexIO UART driver calls the callback - * function and passes the @ref kStatus_FLEXIO_UART_TxIdle as status parameter. - * - * @note The kStatus_FLEXIO_UART_TxIdle is passed to the upper layer when all data is written - * to the TX register. However, it does not ensure that all data is sent out. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * @param xfer FlexIO UART transfer structure. See #flexio_uart_transfer_t. - * @retval kStatus_Success Successfully starts the data transmission. - * @retval kStatus_UART_TxBusy Previous transmission still not finished, data not written to the TX register. - */ -status_t FLEXIO_UART_TransferSendNonBlocking(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - flexio_uart_transfer_t *xfer); - -/*! - * @brief Aborts the interrupt-driven data transmit. - * - * This function aborts the interrupt-driven data sending. Get the remainBytes to find out - * how many bytes are still not sent out. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferAbortSend(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle); - -/*! - * @brief Gets the number of bytes sent. - * - * This function gets the number of bytes sent driven by interrupt. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * @param count Number of bytes sent so far by the non-blocking transaction. - * @retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * @retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetSendCount(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle, size_t *count); - -/*! - * @brief Receives a buffer of data using the interrupt method. - * - * This function receives data using the interrupt method. This is a non-blocking function, - * which returns without waiting for all data to be received. - * If the RX ring buffer is used and not empty, the data in ring buffer is copied and - * the parameter @p receivedBytes shows how many bytes are copied from the ring buffer. - * After copying, if the data in ring buffer is not enough to read, the receive - * request is saved by the UART driver. When new data arrives, the receive request - * is serviced first. When all data is received, the UART driver notifies the upper layer - * through a callback function and passes the status parameter kStatus_UART_RxIdle. - * For example, if the upper layer needs 10 bytes but there are only 5 bytes in the ring buffer, - * the 5 bytes are copied to xfer->data. This function returns with the - * parameter @p receivedBytes set to 5. For the last 5 bytes, newly arrived data is - * saved from the xfer->data[5]. When 5 bytes are received, the UART driver notifies upper layer. - * If the RX ring buffer is not enabled, this function enables the RX and RX interrupt - * to receive data to xfer->data. When all data is received, the upper layer is notified. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * @param xfer UART transfer structure. See #flexio_uart_transfer_t. - * @param receivedBytes Bytes received from the ring buffer directly. - * @retval kStatus_Success Successfully queue the transfer into the transmit queue. - * @retval kStatus_FLEXIO_UART_RxBusy Previous receive request is not finished. - */ -status_t FLEXIO_UART_TransferReceiveNonBlocking(FLEXIO_UART_Type *base, - flexio_uart_handle_t *handle, - flexio_uart_transfer_t *xfer, - size_t *receivedBytes); - -/*! - * @brief Aborts the receive data which was using IRQ. - * - * This function aborts the receive data which was using IRQ. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferAbortReceive(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle); - -/*! - * @brief Gets the number of bytes received. - * - * This function gets the number of bytes received driven by interrupt. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - * @param handle Pointer to the flexio_uart_handle_t structure to store the transfer state. - * @param count Number of bytes received so far by the non-blocking transaction. - * @retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * @retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetReceiveCount(FLEXIO_UART_Type *base, flexio_uart_handle_t *handle, size_t *count); - -/*! - * @brief FlexIO UART IRQ handler function. - * - * This function processes the FlexIO UART transmit and receives the IRQ request. - * - * @param uartType Pointer to the FLEXIO_UART_Type structure. - * @param uartHandle Pointer to the flexio_uart_handle_t structure to store the transfer state. - */ -void FLEXIO_UART_TransferHandleIRQ(void *uartType, void *uartHandle); - -/*! - * @brief Flush tx/rx shifters. - * - * @param base Pointer to the FLEXIO_UART_Type structure. - */ -void FLEXIO_UART_FlushShifters(FLEXIO_UART_Type *base); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /*_cplusplus*/ -/*! @} */ - -#endif /*FSL_FLEXIO_UART_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_uart_edma.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_uart_edma.c deleted file mode 100644 index f2502c9df20..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_uart_edma.c +++ /dev/null @@ -1,407 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexio_uart_edma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexio_uart_edma" -#endif - -/*handle != NULL); - - /* Avoid the warning for unused variables. */ - handle = handle; - tcds = tcds; - - if (transferDone) - { - FLEXIO_UART_TransferAbortSendEDMA(uartPrivateHandle->base, uartPrivateHandle->handle); - - if (uartPrivateHandle->handle->callback != NULL) - { - uartPrivateHandle->handle->callback(uartPrivateHandle->base, uartPrivateHandle->handle, - kStatus_FLEXIO_UART_TxIdle, uartPrivateHandle->handle->userData); - } - } -} - -static void FLEXIO_UART_TransferReceiveEDMACallback(edma_handle_t *handle, - void *param, - bool transferDone, - uint32_t tcds) -{ - flexio_uart_edma_private_handle_t *uartPrivateHandle = (flexio_uart_edma_private_handle_t *)param; - - assert(uartPrivateHandle->handle != NULL); - - /* Avoid the warning for unused variables. */ - handle = handle; - tcds = tcds; - - if (transferDone) - { - /* Disable transfer. */ - FLEXIO_UART_TransferAbortReceiveEDMA(uartPrivateHandle->base, uartPrivateHandle->handle); - - if (uartPrivateHandle->handle->callback != NULL) - { - uartPrivateHandle->handle->callback(uartPrivateHandle->base, uartPrivateHandle->handle, - kStatus_FLEXIO_UART_RxIdle, uartPrivateHandle->handle->userData); - } - } -} - -/*! - * brief Initializes the UART handle which is used in transactional functions. - * - * param base Pointer to FLEXIO_UART_Type. - * param handle Pointer to flexio_uart_edma_handle_t structure. - * param callback The callback function. - * param userData The parameter of the callback function. - * param rxEdmaHandle User requested DMA handle for RX DMA transfer. - * param txEdmaHandle User requested DMA handle for TX DMA transfer. - * retval kStatus_Success Successfully create the handle. - * retval kStatus_OutOfRange The FlexIO SPI eDMA type/handle table out of range. - */ -status_t FLEXIO_UART_TransferCreateHandleEDMA(FLEXIO_UART_Type *base, - flexio_uart_edma_handle_t *handle, - flexio_uart_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *txEdmaHandle, - edma_handle_t *rxEdmaHandle) -{ - assert(handle != NULL); - - uint8_t index = 0U; - - /* Find the an empty handle pointer to store the handle. */ - for (index = 0U; index < (uint8_t)FLEXIO_UART_HANDLE_COUNT; index++) - { - if (s_edmaPrivateHandle[index].base == NULL) - { - s_edmaPrivateHandle[index].base = base; - s_edmaPrivateHandle[index].handle = handle; - break; - } - } - - if (index == (uint8_t)FLEXIO_UART_HANDLE_COUNT) - { - return kStatus_OutOfRange; - } - - (void)memset(handle, 0, sizeof(*handle)); - - handle->rxState = (uint8_t)kFLEXIO_UART_RxIdle; - handle->txState = (uint8_t)kFLEXIO_UART_TxIdle; - - handle->rxEdmaHandle = rxEdmaHandle; - handle->txEdmaHandle = txEdmaHandle; - - handle->callback = callback; - handle->userData = userData; - - /* Configure TX. */ - if (txEdmaHandle != NULL) - { - EDMA_SetCallback(handle->txEdmaHandle, FLEXIO_UART_TransferSendEDMACallback, &s_edmaPrivateHandle); - } - - /* Configure RX. */ - if (rxEdmaHandle != NULL) - { - EDMA_SetCallback(handle->rxEdmaHandle, FLEXIO_UART_TransferReceiveEDMACallback, &s_edmaPrivateHandle); - } - - return kStatus_Success; -} - -/*! - * brief Sends data using eDMA. - * - * This function sends data using eDMA. This is a non-blocking function, which returns - * right away. When all data is sent out, the send callback function is called. - * - * param base Pointer to FLEXIO_UART_Type - * param handle UART handle pointer. - * param xfer UART eDMA transfer structure, see #flexio_uart_transfer_t. - * retval kStatus_Success if succeed, others failed. - * retval kStatus_FLEXIO_UART_TxBusy Previous transfer on going. - */ -status_t FLEXIO_UART_TransferSendEDMA(FLEXIO_UART_Type *base, - flexio_uart_edma_handle_t *handle, - flexio_uart_transfer_t *xfer) -{ - assert(handle->txEdmaHandle != NULL); - - edma_transfer_config_t xferConfig; - status_t status; - - /* Return error if xfer invalid. */ - if ((0U == xfer->dataSize) || (NULL == xfer->data)) - { - return kStatus_InvalidArgument; - } - - /* If previous TX not finished. */ - if ((uint8_t)kFLEXIO_UART_TxBusy == handle->txState) - { - status = kStatus_FLEXIO_UART_TxBusy; - } - else - { - handle->txState = (uint8_t)kFLEXIO_UART_TxBusy; - handle->txDataSizeAll = xfer->dataSize; - - /* Prepare transfer. */ - EDMA_PrepareTransfer(&xferConfig, xfer->data, sizeof(uint8_t), - (uint32_t *)FLEXIO_UART_GetTxDataRegisterAddress(base), sizeof(uint8_t), sizeof(uint8_t), - xfer->dataSize, kEDMA_MemoryToPeripheral); - - /* Store the initially configured eDMA minor byte transfer count into the FLEXIO UART handle */ - handle->nbytes = 1U; - - /* Submit transfer. */ - (void)EDMA_SubmitTransfer(handle->txEdmaHandle, &xferConfig); - EDMA_StartTransfer(handle->txEdmaHandle); - - /* Enable UART TX EDMA. */ - FLEXIO_UART_EnableTxDMA(base, true); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Receives data using eDMA. - * - * This function receives data using eDMA. This is a non-blocking function, which returns - * right away. When all data is received, the receive callback function is called. - * - * param base Pointer to FLEXIO_UART_Type - * param handle Pointer to flexio_uart_edma_handle_t structure - * param xfer UART eDMA transfer structure, see #flexio_uart_transfer_t. - * retval kStatus_Success if succeed, others failed. - * retval kStatus_UART_RxBusy Previous transfer on going. - */ -status_t FLEXIO_UART_TransferReceiveEDMA(FLEXIO_UART_Type *base, - flexio_uart_edma_handle_t *handle, - flexio_uart_transfer_t *xfer) -{ - assert(handle->rxEdmaHandle != NULL); - - edma_transfer_config_t xferConfig; - status_t status; - - /* Return error if xfer invalid. */ - if ((0U == xfer->dataSize) || (NULL == xfer->data)) - { - return kStatus_InvalidArgument; - } - - /* If previous RX not finished. */ - if ((uint8_t)kFLEXIO_UART_RxBusy == handle->rxState) - { - status = kStatus_FLEXIO_UART_RxBusy; - } - else - { - handle->rxState = (uint8_t)kFLEXIO_UART_RxBusy; - handle->rxDataSizeAll = xfer->dataSize; - - /* Prepare transfer. */ - EDMA_PrepareTransfer(&xferConfig, (uint32_t *)FLEXIO_UART_GetRxDataRegisterAddress(base), sizeof(uint8_t), - xfer->data, sizeof(uint8_t), sizeof(uint8_t), xfer->dataSize, kEDMA_PeripheralToMemory); - - /* Store the initially configured eDMA minor byte transfer count into the FLEXIO UART handle */ - handle->nbytes = (uint8_t)sizeof(uint8_t); - - /* Submit transfer. */ - (void)EDMA_SubmitTransfer(handle->rxEdmaHandle, &xferConfig); - EDMA_StartTransfer(handle->rxEdmaHandle); - - /* Enable UART RX EDMA. */ - FLEXIO_UART_EnableRxDMA(base, true); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Aborts the sent data which using eDMA. - * - * This function aborts sent data which using eDMA. - * - * param base Pointer to FLEXIO_UART_Type - * param handle Pointer to flexio_uart_edma_handle_t structure - */ -void FLEXIO_UART_TransferAbortSendEDMA(FLEXIO_UART_Type *base, flexio_uart_edma_handle_t *handle) -{ - assert(handle->txEdmaHandle != NULL); - - /* Disable UART TX EDMA. */ - FLEXIO_UART_EnableTxDMA(base, false); - - /* Stop transfer. */ - EDMA_StopTransfer(handle->txEdmaHandle); - - handle->txState = (uint8_t)kFLEXIO_UART_TxIdle; -} - -/*! - * brief Aborts the receive data which using eDMA. - * - * This function aborts the receive data which using eDMA. - * - * param base Pointer to FLEXIO_UART_Type - * param handle Pointer to flexio_uart_edma_handle_t structure - */ -void FLEXIO_UART_TransferAbortReceiveEDMA(FLEXIO_UART_Type *base, flexio_uart_edma_handle_t *handle) -{ - assert(handle->rxEdmaHandle != NULL); - - /* Disable UART RX EDMA. */ - FLEXIO_UART_EnableRxDMA(base, false); - - /* Stop transfer. */ - EDMA_StopTransfer(handle->rxEdmaHandle); - - handle->rxState = (uint8_t)kFLEXIO_UART_RxIdle; -} - -/*! - * brief Gets the number of bytes received. - * - * This function gets the number of bytes received. - * - * param base Pointer to FLEXIO_UART_Type - * param handle Pointer to flexio_uart_edma_handle_t structure - * param count Number of bytes received so far by the non-blocking transaction. - * retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetReceiveCountEDMA(FLEXIO_UART_Type *base, - flexio_uart_edma_handle_t *handle, - size_t *count) -{ - assert(handle != NULL); - assert(handle->rxEdmaHandle != NULL); - assert(count != NULL); - - if ((uint8_t)kFLEXIO_UART_RxIdle == handle->rxState) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->rxDataSizeAll - - (uint32_t)handle->nbytes * - EDMA_GetRemainingMajorLoopCount(handle->rxEdmaHandle->base, handle->rxEdmaHandle->channel); - - return kStatus_Success; -} - -/*! - * brief Gets the number of bytes sent out. - * - * This function gets the number of bytes sent out. - * - * param base Pointer to FLEXIO_UART_Type - * param handle Pointer to flexio_uart_edma_handle_t structure - * param count Number of bytes sent so far by the non-blocking transaction. - * retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetSendCountEDMA(FLEXIO_UART_Type *base, flexio_uart_edma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - assert(handle->txEdmaHandle != NULL); - assert(count != NULL); - - if ((uint8_t)kFLEXIO_UART_TxIdle == handle->txState) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->txDataSizeAll - - (uint32_t)handle->nbytes * - EDMA_GetRemainingMajorLoopCount(handle->txEdmaHandle->base, handle->txEdmaHandle->channel); - - return kStatus_Success; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_uart_edma.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_uart_edma.h deleted file mode 100644 index c8d0a04369b..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexio_uart_edma.h +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_FLEXIO_UART_EDMA_H_ -#define FSL_FLEXIO_UART_EDMA_H_ - -#include "fsl_flexio_uart.h" -#include "fsl_edma.h" - -/*! - * @addtogroup flexio_edma_uart - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief FlexIO UART EDMA driver version. */ -#define FSL_FLEXIO_UART_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 4, 1)) -/*! @} */ - -/* Forward declaration of the handle typedef. */ -typedef struct _flexio_uart_edma_handle flexio_uart_edma_handle_t; - -/*! @brief UART transfer callback function. */ -typedef void (*flexio_uart_edma_transfer_callback_t)(FLEXIO_UART_Type *base, - flexio_uart_edma_handle_t *handle, - status_t status, - void *userData); - -/*! - * @brief UART eDMA handle - */ -struct _flexio_uart_edma_handle -{ - flexio_uart_edma_transfer_callback_t callback; /*!< Callback function. */ - void *userData; /*!< UART callback function parameter.*/ - - size_t txDataSizeAll; /*!< Total bytes to be sent. */ - size_t rxDataSizeAll; /*!< Total bytes to be received. */ - - edma_handle_t *txEdmaHandle; /*!< The eDMA TX channel used. */ - edma_handle_t *rxEdmaHandle; /*!< The eDMA RX channel used. */ - - uint8_t nbytes; /*!< eDMA minor byte transfer count initially configured. */ - - volatile uint8_t txState; /*!< TX transfer state. */ - volatile uint8_t rxState; /*!< RX transfer state */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name eDMA transactional - * @{ - */ - -/*! - * @brief Initializes the UART handle which is used in transactional functions. - * - * @param base Pointer to FLEXIO_UART_Type. - * @param handle Pointer to flexio_uart_edma_handle_t structure. - * @param callback The callback function. - * @param userData The parameter of the callback function. - * @param rxEdmaHandle User requested DMA handle for RX DMA transfer. - * @param txEdmaHandle User requested DMA handle for TX DMA transfer. - * @retval kStatus_Success Successfully create the handle. - * @retval kStatus_OutOfRange The FlexIO SPI eDMA type/handle table out of range. - */ -status_t FLEXIO_UART_TransferCreateHandleEDMA(FLEXIO_UART_Type *base, - flexio_uart_edma_handle_t *handle, - flexio_uart_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *txEdmaHandle, - edma_handle_t *rxEdmaHandle); - -/*! - * @brief Sends data using eDMA. - * - * This function sends data using eDMA. This is a non-blocking function, which returns - * right away. When all data is sent out, the send callback function is called. - * - * @param base Pointer to FLEXIO_UART_Type - * @param handle UART handle pointer. - * @param xfer UART eDMA transfer structure, see #flexio_uart_transfer_t. - * @retval kStatus_Success if succeed, others failed. - * @retval kStatus_FLEXIO_UART_TxBusy Previous transfer on going. - */ -status_t FLEXIO_UART_TransferSendEDMA(FLEXIO_UART_Type *base, - flexio_uart_edma_handle_t *handle, - flexio_uart_transfer_t *xfer); - -/*! - * @brief Receives data using eDMA. - * - * This function receives data using eDMA. This is a non-blocking function, which returns - * right away. When all data is received, the receive callback function is called. - * - * @param base Pointer to FLEXIO_UART_Type - * @param handle Pointer to flexio_uart_edma_handle_t structure - * @param xfer UART eDMA transfer structure, see #flexio_uart_transfer_t. - * @retval kStatus_Success if succeed, others failed. - * @retval kStatus_UART_RxBusy Previous transfer on going. - */ -status_t FLEXIO_UART_TransferReceiveEDMA(FLEXIO_UART_Type *base, - flexio_uart_edma_handle_t *handle, - flexio_uart_transfer_t *xfer); - -/*! - * @brief Aborts the sent data which using eDMA. - * - * This function aborts sent data which using eDMA. - * - * @param base Pointer to FLEXIO_UART_Type - * @param handle Pointer to flexio_uart_edma_handle_t structure - */ -void FLEXIO_UART_TransferAbortSendEDMA(FLEXIO_UART_Type *base, flexio_uart_edma_handle_t *handle); - -/*! - * @brief Aborts the receive data which using eDMA. - * - * This function aborts the receive data which using eDMA. - * - * @param base Pointer to FLEXIO_UART_Type - * @param handle Pointer to flexio_uart_edma_handle_t structure - */ -void FLEXIO_UART_TransferAbortReceiveEDMA(FLEXIO_UART_Type *base, flexio_uart_edma_handle_t *handle); - -/*! - * @brief Gets the number of bytes sent out. - * - * This function gets the number of bytes sent out. - * - * @param base Pointer to FLEXIO_UART_Type - * @param handle Pointer to flexio_uart_edma_handle_t structure - * @param count Number of bytes sent so far by the non-blocking transaction. - * @retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * @retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetSendCountEDMA(FLEXIO_UART_Type *base, flexio_uart_edma_handle_t *handle, size_t *count); - -/*! - * @brief Gets the number of bytes received. - * - * This function gets the number of bytes received. - * - * @param base Pointer to FLEXIO_UART_Type - * @param handle Pointer to flexio_uart_edma_handle_t structure - * @param count Number of bytes received so far by the non-blocking transaction. - * @retval kStatus_NoTransferInProgress transfer has finished or no transfer in progress. - * @retval kStatus_Success Successfully return the count. - */ -status_t FLEXIO_UART_TransferGetReceiveCountEDMA(FLEXIO_UART_Type *base, - flexio_uart_edma_handle_t *handle, - size_t *count); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_UART_EDMA_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexspi.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexspi.c deleted file mode 100644 index a4266b8c535..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexspi.c +++ /dev/null @@ -1,1279 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2022, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexspi.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexspi" -#endif - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -#define FREQ_1MHz (1000000UL) -#define FLEXSPI_DLLCR_DEFAULT (0x100UL) -#define FLEXSPI_LUT_KEY_VAL (0x5AF05AF0UL) - -enum -{ - kFLEXSPI_DelayCellUnitMin = 75, /* 75ps. */ - kFLEXSPI_DelayCellUnitMax = 225, /* 225ps. */ -}; - -enum -{ - kFLEXSPI_FlashASampleClockSlaveDelayLocked = - FLEXSPI_STS2_ASLVLOCK_MASK, /* Flash A sample clock slave delay line locked. */ - kFLEXSPI_FlashASampleClockRefDelayLocked = - FLEXSPI_STS2_AREFLOCK_MASK, /* Flash A sample clock reference delay line locked. */ -#if !((defined(FSL_FEATURE_FLEXSPI_HAS_NO_STS2_BSLVLOCK)) && (FSL_FEATURE_FLEXSPI_HAS_NO_STS2_BSLVLOCK)) - kFLEXSPI_FlashBSampleClockSlaveDelayLocked = - FLEXSPI_STS2_BSLVLOCK_MASK, /* Flash B sample clock slave delay line locked. */ -#endif -#if !((defined(FSL_FEATURE_FLEXSPI_HAS_NO_STS2_BREFLOCK)) && (FSL_FEATURE_FLEXSPI_HAS_NO_STS2_BREFLOCK)) - kFLEXSPI_FlashBSampleClockRefDelayLocked = - FLEXSPI_STS2_BREFLOCK_MASK, /* Flash B sample clock reference delay line locked. */ -#endif -}; - -/*! @brief Common sets of flags used by the driver, _flexspi_flag_constants. */ -enum -{ - /*! IRQ sources enabled by the non-blocking transactional API. */ - kIrqFlags = kFLEXSPI_IpTxFifoWatermarkEmptyFlag | kFLEXSPI_IpRxFifoWatermarkAvailableFlag | - kFLEXSPI_SequenceExecutionTimeoutFlag | kFLEXSPI_IpCommandSequenceErrorFlag | - kFLEXSPI_IpCommandGrantTimeoutFlag | kFLEXSPI_IpCommandExecutionDoneFlag, - - /*! Errors to check for. */ - kErrorFlags = kFLEXSPI_SequenceExecutionTimeoutFlag | kFLEXSPI_IpCommandSequenceErrorFlag | - kFLEXSPI_IpCommandGrantTimeoutFlag, -}; - -/* FLEXSPI transfer state, _flexspi_transfer_state. */ -enum -{ - kFLEXSPI_Idle = 0x0U, /*!< Transfer is done. */ - kFLEXSPI_BusyWrite = 0x1U, /*!< FLEXSPI is busy write transfer. */ - kFLEXSPI_BusyRead = 0x2U, /*!< FLEXSPI is busy write transfer. */ -}; - -/*! @brief Typedef for interrupt handler. */ -typedef void (*flexspi_isr_t)(FLEXSPI_Type *base, flexspi_handle_t *handle); - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -static void FLEXSPI_Memset(void *src, uint8_t value, size_t length); - -/*! - * @brief Calculate flash A/B sample clock DLL. - * - * @param base FLEXSPI base pointer. - * @param config Flash configuration parameters. - */ -static uint32_t FLEXSPI_CalculateDll(FLEXSPI_Type *base, flexspi_device_config_t *config); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to flexspi bases for each instance. */ -static FLEXSPI_Type *const s_flexspiBases[] = FLEXSPI_BASE_PTRS; - -/*! @brief Pointers to flexspi IRQ number for each instance. */ -static const IRQn_Type s_flexspiIrqs[] = FLEXSPI_IRQS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/* Clock name array */ -static const clock_ip_name_t s_flexspiClock[] = FLEXSPI_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(FSL_DRIVER_TRANSFER_DOUBLE_WEAK_IRQ) && FSL_DRIVER_TRANSFER_DOUBLE_WEAK_IRQ -/*! @brief Pointers to flexspi handles for each instance. */ -static flexspi_handle_t *s_flexspiHandle[ARRAY_SIZE(s_flexspiBases)]; -#endif - -#if defined(FSL_FEATURE_FLEXSPI_HAS_RESET) && FSL_FEATURE_FLEXSPI_HAS_RESET -/*! @brief Pointers to FLEXSPI resets for each instance. */ -static const reset_ip_name_t s_flexspiResets[] = FLEXSPI_RSTS; -#endif - -#if defined(FSL_DRIVER_TRANSFER_DOUBLE_WEAK_IRQ) && FSL_DRIVER_TRANSFER_DOUBLE_WEAK_IRQ -/*! @brief Pointer to flexspi IRQ handler. */ -static flexspi_isr_t s_flexspiIsr; -#endif -/******************************************************************************* - * Code - ******************************************************************************/ -/* To avoid compiler opitimizing this API into memset() in library. */ -#if defined(__ICCARM__) -#pragma optimize = none -#endif /* defined(__ICCARM__) */ -static void FLEXSPI_Memset(void *src, uint8_t value, size_t length) -{ - assert(src != NULL); - uint8_t *p = (uint8_t *)src; - - for (uint32_t i = 0U; i < length; i++) - { - *p = value; - p++; - } -} - -uint32_t FLEXSPI_GetInstance(FLEXSPI_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_flexspiBases); instance++) - { - if (s_flexspiBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_flexspiBases)); - - return instance; -} - -static uint32_t FLEXSPI_CalculateDll(FLEXSPI_Type *base, flexspi_device_config_t *config) -{ - bool isUnifiedConfig = true; - uint32_t flexspiDllValue; - uint32_t dllValue; - uint32_t temp; -#if defined(FSL_FEATURE_FLEXSPI_DQS_DELAY_PS) && FSL_FEATURE_FLEXSPI_DQS_DELAY_PS - uint32_t internalDqsDelayPs = FSL_FEATURE_FLEXSPI_DQS_DELAY_PS; -#endif - uint32_t rxSampleClock = (base->MCR0 & FLEXSPI_MCR0_RXCLKSRC_MASK) >> FLEXSPI_MCR0_RXCLKSRC_SHIFT; - switch (rxSampleClock) - { - case (uint32_t)kFLEXSPI_ReadSampleClkLoopbackInternally: - case (uint32_t)kFLEXSPI_ReadSampleClkLoopbackFromDqsPad: - case (uint32_t)kFLEXSPI_ReadSampleClkLoopbackFromSckPad: - isUnifiedConfig = true; - break; - case (uint32_t)kFLEXSPI_ReadSampleClkExternalInputFromDqsPad: - if (config->isSck2Enabled) - { - isUnifiedConfig = true; - } - else - { - isUnifiedConfig = false; - } - break; - default: - assert(false); - break; - } - - if (isUnifiedConfig) - { - flexspiDllValue = FLEXSPI_DLLCR_DEFAULT; /* 1 fixed delay cells in DLL delay chain) */ - } - else - { - if (config->flexspiRootClk >= 100U * FREQ_1MHz) - { -#if defined(FSL_FEATURE_FLEXSPI_DQS_DELAY_MIN) && FSL_FEATURE_FLEXSPI_DQS_DELAY_MIN - /* DLLEN = 1, SLVDLYTARGET = 0x0, */ - flexspiDllValue = FLEXSPI_DLLCR_DLLEN(1) | FLEXSPI_DLLCR_SLVDLYTARGET(0x00); -#else - /* DLLEN = 1, SLVDLYTARGET = 0xF, */ - flexspiDllValue = FLEXSPI_DLLCR_DLLEN(1) | FLEXSPI_DLLCR_SLVDLYTARGET(0x0F); -#endif -#if (defined(FSL_FEATURE_FLEXSPI_HAS_REFPHASEGAP) && FSL_FEATURE_FLEXSPI_HAS_REFPHASEGAP) - flexspiDllValue |= FLEXSPI_DLLCR_REFPHASEGAP(2U); -#endif /* FSL_FEATURE_FLEXSPI_HAS_REFPHASEGAP */ - } - else - { - temp = (uint32_t)config->dataValidTime * 1000U; /* Convert data valid time in ns to ps. */ - dllValue = temp / (uint32_t)kFLEXSPI_DelayCellUnitMin; - if (dllValue * (uint32_t)kFLEXSPI_DelayCellUnitMin < temp) - { - dllValue++; - } - flexspiDllValue = FLEXSPI_DLLCR_OVRDEN(1) | FLEXSPI_DLLCR_OVRDVAL(dllValue); - } - } - return flexspiDllValue; -} - -status_t FLEXSPI_CheckAndClearError(FLEXSPI_Type *base, uint32_t status) -{ - status_t result = kStatus_Success; - - /* Check for error. */ - status &= (uint32_t)kErrorFlags; - if (0U != status) - { - /* Select the correct error code.. */ - if (0U != (status & (uint32_t)kFLEXSPI_SequenceExecutionTimeoutFlag)) - { - result = kStatus_FLEXSPI_SequenceExecutionTimeout; - } - else if (0U != (status & (uint32_t)kFLEXSPI_IpCommandSequenceErrorFlag)) - { - result = kStatus_FLEXSPI_IpCommandSequenceError; - } - else if (0U != (status & (uint32_t)kFLEXSPI_IpCommandGrantTimeoutFlag)) - { - result = kStatus_FLEXSPI_IpCommandGrantTimeout; - } - else - { - assert(false); - } - - /* Clear the flags. */ - FLEXSPI_ClearInterruptStatusFlags(base, status); - } - - return result; -} - -/*! - * brief Initializes the FLEXSPI module and internal state. - * - * This function enables the clock for FLEXSPI and also configures the FLEXSPI with the - * input configure parameters. Users should call this function before any FLEXSPI operations. - * - * param base FLEXSPI peripheral base address. - * param config FLEXSPI configure structure. - */ -void FLEXSPI_Init(FLEXSPI_Type *base, const flexspi_config_t *config) -{ - uint32_t configValue = 0; - uint8_t i = 0; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the flexspi clock */ - (void)CLOCK_EnableClock(s_flexspiClock[FLEXSPI_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(FSL_FEATURE_FLEXSPI_HAS_RESET) && FSL_FEATURE_FLEXSPI_HAS_RESET - /* Reset the FLEXSPI module */ - RESET_PeripheralReset(s_flexspiResets[FLEXSPI_GetInstance(base)]); -#endif - - /* Reset peripheral before configuring it. */ - base->MCR0 &= ~FLEXSPI_MCR0_MDIS_MASK; - FLEXSPI_SoftwareReset(base); - - /* Configure MCR0 configuration items. */ - configValue = FLEXSPI_MCR0_RXCLKSRC(config->rxSampleClock) | FLEXSPI_MCR0_DOZEEN(config->enableDoze) | - FLEXSPI_MCR0_IPGRANTWAIT(config->ipGrantTimeoutCycle) | - FLEXSPI_MCR0_AHBGRANTWAIT(config->ahbConfig.ahbGrantTimeoutCycle) | - FLEXSPI_MCR0_SCKFREERUNEN(config->enableSckFreeRunning) | - FLEXSPI_MCR0_HSEN(config->enableHalfSpeedAccess) | -#if !(defined(FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_COMBINATIONEN) && FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_COMBINATIONEN) - FLEXSPI_MCR0_COMBINATIONEN(config->enableCombination) | -#endif -#if !(defined(FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_ATDFEN) && FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_ATDFEN) - FLEXSPI_MCR0_ATDFEN(config->ahbConfig.enableAHBWriteIpTxFifo) | -#endif -#if !(defined(FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_ARDFEN) && FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_ARDFEN) - FLEXSPI_MCR0_ARDFEN(config->ahbConfig.enableAHBWriteIpRxFifo) | -#endif - FLEXSPI_MCR0_MDIS_MASK; - base->MCR0 = configValue; - - /* Configure MCR1 configurations. */ - configValue = - FLEXSPI_MCR1_SEQWAIT(config->seqTimeoutCycle) | FLEXSPI_MCR1_AHBBUSWAIT(config->ahbConfig.ahbBusTimeoutCycle); - base->MCR1 = configValue; - - /* Configure MCR2 configurations. */ - configValue = base->MCR2; - configValue &= ~(FLEXSPI_MCR2_RESUMEWAIT_MASK | -#if !(defined(FSL_FEATURE_FLEXSPI_HAS_NO_MCR2_SCKBDIFFOPT) && FSL_FEATURE_FLEXSPI_HAS_NO_MCR2_SCKBDIFFOPT) - FLEXSPI_MCR2_SCKBDIFFOPT_MASK | -#endif - FLEXSPI_MCR2_SAMEDEVICEEN_MASK | FLEXSPI_MCR2_CLRAHBBUFOPT_MASK); - configValue |= FLEXSPI_MCR2_RESUMEWAIT(config->ahbConfig.resumeWaitCycle) | -#if defined(FSL_FEATURE_FLEXSPI_SUPPORT_SEPERATE_RXCLKSRC_PORTB) && FSL_FEATURE_FLEXSPI_SUPPORT_SEPERATE_RXCLKSRC_PORTB - FLEXSPI_MCR2_RXCLKSRC_B(config->rxSampleClockPortB) | -#endif -#if defined(FSL_FEATURE_FLEXSPI_SUPPORT_RXCLKSRC_DIFF) && FSL_FEATURE_FLEXSPI_SUPPORT_RXCLKSRC_DIFF - FLEXSPI_MCR2_RX_CLK_SRC_DIFF(config->rxSampleClockDiff) | -#endif -#if !(defined(FSL_FEATURE_FLEXSPI_HAS_NO_MCR2_SCKBDIFFOPT) && FSL_FEATURE_FLEXSPI_HAS_NO_MCR2_SCKBDIFFOPT) - FLEXSPI_MCR2_SCKBDIFFOPT(config->enableSckBDiffOpt) | -#endif - FLEXSPI_MCR2_SAMEDEVICEEN(config->enableSameConfigForAll) | - FLEXSPI_MCR2_CLRAHBBUFOPT(config->ahbConfig.enableClearAHBBufferOpt); - - base->MCR2 = configValue; - - /* Configure AHB control items. */ - configValue = base->AHBCR; - configValue &= ~(FLEXSPI_AHBCR_READADDROPT_MASK | FLEXSPI_AHBCR_PREFETCHEN_MASK | FLEXSPI_AHBCR_BUFFERABLEEN_MASK | - FLEXSPI_AHBCR_CACHABLEEN_MASK); - configValue |= FLEXSPI_AHBCR_READADDROPT(config->ahbConfig.enableReadAddressOpt) | - FLEXSPI_AHBCR_PREFETCHEN(config->ahbConfig.enableAHBPrefetch) | - FLEXSPI_AHBCR_BUFFERABLEEN(config->ahbConfig.enableAHBBufferable) | - FLEXSPI_AHBCR_CACHABLEEN(config->ahbConfig.enableAHBCachable); - base->AHBCR = configValue; - - /* Configure AHB rx buffers. */ - for (i = 0; i < (uint32_t)FSL_FEATURE_FLEXSPI_AHB_BUFFER_COUNT; i++) - { - configValue = base->AHBRXBUFCR0[i]; - - configValue &= ~(FLEXSPI_AHBRXBUFCR0_PREFETCHEN_MASK | FLEXSPI_AHBRXBUFCR0_PRIORITY_MASK | - FLEXSPI_AHBRXBUFCR0_MSTRID_MASK | FLEXSPI_AHBRXBUFCR0_BUFSZ_MASK); - configValue |= FLEXSPI_AHBRXBUFCR0_PREFETCHEN(config->ahbConfig.buffer[i].enablePrefetch) | - FLEXSPI_AHBRXBUFCR0_PRIORITY(config->ahbConfig.buffer[i].priority) | - FLEXSPI_AHBRXBUFCR0_MSTRID(config->ahbConfig.buffer[i].masterIndex) | - FLEXSPI_AHBRXBUFCR0_BUFSZ((uint32_t)config->ahbConfig.buffer[i].bufferSize / 8U); - base->AHBRXBUFCR0[i] = configValue; - } - - /* Configure IP Fifo watermarks. */ - base->IPRXFCR &= ~FLEXSPI_IPRXFCR_RXWMRK_MASK; - base->IPRXFCR |= FLEXSPI_IPRXFCR_RXWMRK((uint32_t)config->rxWatermark / 8U - 1U); - base->IPTXFCR &= ~FLEXSPI_IPTXFCR_TXWMRK_MASK; - base->IPTXFCR |= FLEXSPI_IPTXFCR_TXWMRK((uint32_t)config->txWatermark / 8U - 1U); - - /* Reset flash size on all ports */ - for (i = 0; i < (uint32_t)kFLEXSPI_PortCount; i++) - { - base->FLSHCR0[i] = 0; - } -} - -/*! - * brief Gets default settings for FLEXSPI. - * - * param config FLEXSPI configuration structure. - */ -void FLEXSPI_GetDefaultConfig(flexspi_config_t *config) -{ - /* Initializes the configure structure to zero. */ - FLEXSPI_Memset(config, 0, sizeof(*config)); - - config->rxSampleClock = kFLEXSPI_ReadSampleClkLoopbackInternally; - config->enableSckFreeRunning = false; -#if !(defined(FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_COMBINATIONEN) && FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_COMBINATIONEN) - config->enableCombination = false; -#endif - config->enableDoze = true; - config->enableHalfSpeedAccess = false; -#if !(defined(FSL_FEATURE_FLEXSPI_HAS_NO_MCR2_SCKBDIFFOPT) && FSL_FEATURE_FLEXSPI_HAS_NO_MCR2_SCKBDIFFOPT) - config->enableSckBDiffOpt = false; -#endif - config->enableSameConfigForAll = false; - config->seqTimeoutCycle = 0xFFFFU; - config->ipGrantTimeoutCycle = 0xFFU; - config->txWatermark = 8; - config->rxWatermark = 8; -#if !(defined(FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_ATDFEN) && FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_ATDFEN) - config->ahbConfig.enableAHBWriteIpTxFifo = false; -#endif -#if !(defined(FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_ARDFEN) && FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_ARDFEN) - config->ahbConfig.enableAHBWriteIpRxFifo = false; -#endif - config->ahbConfig.ahbGrantTimeoutCycle = 0xFFU; - config->ahbConfig.ahbBusTimeoutCycle = 0xFFFFU; - config->ahbConfig.resumeWaitCycle = 0x20U; - FLEXSPI_Memset(config->ahbConfig.buffer, 0, sizeof(config->ahbConfig.buffer)); - /* Use invalid master ID 0xF and buffer size 0 for the first several buffers. */ - for (uint8_t i = 0; i < ((uint8_t)FSL_FEATURE_FLEXSPI_AHB_BUFFER_COUNT - 2U); i++) - { - config->ahbConfig.buffer[i].enablePrefetch = true; /* Default enable AHB prefetch. */ - config->ahbConfig.buffer[i].masterIndex = 0xFU; /* Invalid master index which is not used, so will never hit. */ - config->ahbConfig.buffer[i].bufferSize = - 0; /* Default buffer size 0 for buffer0 to buffer(FSL_FEATURE_FLEXSPI_AHB_BUFFER_COUNT - 3U)*/ - } - - for (uint8_t i = ((uint8_t)FSL_FEATURE_FLEXSPI_AHB_BUFFER_COUNT - 2U); - i < (uint8_t)FSL_FEATURE_FLEXSPI_AHB_BUFFER_COUNT; i++) - { - config->ahbConfig.buffer[i].enablePrefetch = true; /* Default enable AHB prefetch. */ - config->ahbConfig.buffer[i].bufferSize = 256U; /* Default buffer size 256 bytes. */ - } - config->ahbConfig.enableClearAHBBufferOpt = false; - config->ahbConfig.enableReadAddressOpt = false; - config->ahbConfig.enableAHBPrefetch = false; - config->ahbConfig.enableAHBBufferable = false; - config->ahbConfig.enableAHBCachable = false; -} - -/*! - * brief Deinitializes the FLEXSPI module. - * - * Clears the FLEXSPI state and FLEXSPI module registers. - * param base FLEXSPI peripheral base address. - */ -void FLEXSPI_Deinit(FLEXSPI_Type *base) -{ - /* Reset peripheral. */ - FLEXSPI_SoftwareReset(base); -} - -/*! - * brief Update FLEXSPI DLL value depending on currently flexspi root clock. - * - * param base FLEXSPI peripheral base address. - * param config Flash configuration parameters. - * param port FLEXSPI Operation port. - */ -void FLEXSPI_UpdateDllValue(FLEXSPI_Type *base, flexspi_device_config_t *config, flexspi_port_t port) -{ - uint32_t configValue = 0; - uint32_t statusValue = 0; - uint8_t index = (uint8_t)port >> 1U; /* PortA with index 0, PortB with index 1. */ - - /* Wait for bus to be idle before changing flash configuration. */ - while (!FLEXSPI_GetBusIdleStatus(base)) - { - } - - /* Configure DLL. */ - configValue = FLEXSPI_CalculateDll(base, config); - base->DLLCR[index] = configValue; - - /* Exit stop mode. */ - base->MCR0 &= ~FLEXSPI_MCR0_MDIS_MASK; - - /* According to ERR011377, need to delay at least 100 NOPs to ensure the DLL is locked. */ - if (index == 0U) - { - statusValue = - ((uint32_t)kFLEXSPI_FlashASampleClockSlaveDelayLocked | (uint32_t)kFLEXSPI_FlashASampleClockRefDelayLocked); - } -#if !((defined(FSL_FEATURE_FLEXSPI_HAS_NO_STS2_BSLVLOCK)) && (FSL_FEATURE_FLEXSPI_HAS_NO_STS2_BSLVLOCK)) - else - { - statusValue = - ((uint32_t)kFLEXSPI_FlashBSampleClockSlaveDelayLocked | (uint32_t)kFLEXSPI_FlashBSampleClockRefDelayLocked); - } -#endif - if (0U != (configValue & FLEXSPI_DLLCR_DLLEN_MASK)) - { -#if defined(FSL_FEATURE_FLEXSPI_HAS_ERRATA_051426) && (FSL_FEATURE_FLEXSPI_HAS_ERRATA_051426) - if (config->isFroClockSource == false) -#endif - { - /* Wait slave delay line locked and slave reference delay line locked. */ - while ((base->STS2 & statusValue) != statusValue) - { - } - } - - /* Wait at least 100 NOPs*/ - for (uint8_t delay = 100U; delay > 0U; delay--) - { - __NOP(); - } - } -} - -/*! - * brief Configures the connected device parameter. - * - * This function configures the connected device relevant parameters, such as the size, command, and so on. - * The flash configuration value cannot have a default value. The user needs to configure it according to the - * connected device. - * - * param base FLEXSPI peripheral base address. - * param config Flash configuration parameters. - * param port FLEXSPI Operation port. - */ -void FLEXSPI_SetFlashConfig(FLEXSPI_Type *base, flexspi_device_config_t *config, flexspi_port_t port) -{ - uint32_t configValue = 0; - uint8_t index = (uint8_t)port >> 1U; /* PortA with index 0, PortB with index 1. */ - - /* Wait for bus to be idle before changing flash configuration. */ - while (!FLEXSPI_GetBusIdleStatus(base)) - { - } - - /* Configure flash size and address shift. */ -#if defined(FSL_FEATURE_FLEXSPI_SUPPORT_ADDRESS_SHIFT) && (FSL_FEATURE_FLEXSPI_SUPPORT_ADDRESS_SHIFT) - base->FLSHCR0[port] = config->flashSize | FLEXSPI_FLSHCR0_ADDRSHIFT(config->addressShift); -#else - base->FLSHCR0[port] = config->flashSize; -#endif /* FSL_FEATURE_FLEXSPI_SUPPORT_ADDRESS_SHIFT */ - - /* Configure flash parameters. */ - base->FLSHCR1[port] = FLEXSPI_FLSHCR1_CSINTERVAL(config->CSInterval) | - FLEXSPI_FLSHCR1_CSINTERVALUNIT(config->CSIntervalUnit) | - FLEXSPI_FLSHCR1_TCSH(config->CSHoldTime) | FLEXSPI_FLSHCR1_TCSS(config->CSSetupTime) | - FLEXSPI_FLSHCR1_CAS(config->columnspace) | FLEXSPI_FLSHCR1_WA(config->enableWordAddress); - - /* Configure AHB operation items. */ - configValue = base->FLSHCR2[port]; - - configValue &= ~(FLEXSPI_FLSHCR2_AWRWAITUNIT_MASK | FLEXSPI_FLSHCR2_AWRWAIT_MASK | FLEXSPI_FLSHCR2_AWRSEQNUM_MASK | - FLEXSPI_FLSHCR2_AWRSEQID_MASK | FLEXSPI_FLSHCR2_ARDSEQNUM_MASK | FLEXSPI_FLSHCR2_ARDSEQID_MASK); - - configValue |= - FLEXSPI_FLSHCR2_AWRWAITUNIT(config->AHBWriteWaitUnit) | FLEXSPI_FLSHCR2_AWRWAIT(config->AHBWriteWaitInterval); - - if (config->AWRSeqNumber > 0U) - { - configValue |= FLEXSPI_FLSHCR2_AWRSEQID((uint32_t)config->AWRSeqIndex) | - FLEXSPI_FLSHCR2_AWRSEQNUM((uint32_t)config->AWRSeqNumber - 1U); - } - - if (config->ARDSeqNumber > 0U) - { - configValue |= FLEXSPI_FLSHCR2_ARDSEQID((uint32_t)config->ARDSeqIndex) | - FLEXSPI_FLSHCR2_ARDSEQNUM((uint32_t)config->ARDSeqNumber - 1U); - } - - base->FLSHCR2[port] = configValue; - - /* Configure DLL. */ - FLEXSPI_UpdateDllValue(base, config, port); - - /* Step into stop mode. */ - base->MCR0 |= FLEXSPI_MCR0_MDIS_MASK; - - /* Configure write mask. */ - if (config->enableWriteMask) - { - base->FLSHCR4 &= ~FLEXSPI_FLSHCR4_WMOPT1_MASK; - } - else - { - base->FLSHCR4 |= FLEXSPI_FLSHCR4_WMOPT1_MASK; - } - - if (index == 0U) /*PortA*/ - { - base->FLSHCR4 &= ~FLEXSPI_FLSHCR4_WMENA_MASK; - base->FLSHCR4 |= FLEXSPI_FLSHCR4_WMENA(config->enableWriteMask); - } -#if !((defined(FSL_FEATURE_FLEXSPI_HAS_NO_FLSHCR4_WMENB)) && (FSL_FEATURE_FLEXSPI_HAS_NO_FLSHCR4_WMENB)) - else - { - base->FLSHCR4 &= ~FLEXSPI_FLSHCR4_WMENB_MASK; - base->FLSHCR4 |= FLEXSPI_FLSHCR4_WMENB(config->enableWriteMask); - } -#endif - - /* Exit stop mode. */ - base->MCR0 &= ~FLEXSPI_MCR0_MDIS_MASK; - - /* Wait for bus to be idle before use it access to external flash. */ - while (!FLEXSPI_GetBusIdleStatus(base)) - { - } -} - -/*! brief Updates the LUT table. - * - * param base FLEXSPI peripheral base address. - * param index From which index start to update. It could be any index of the LUT table, which - * also allows user to update command content inside a command. Each command consists of up to - * 8 instructions and occupy 4*32-bit memory. - * param cmd Command sequence array. - * param count Number of sequences. - */ -void FLEXSPI_UpdateLUT(FLEXSPI_Type *base, uint32_t index, const uint32_t *cmd, uint32_t count) -{ - assert(index < 64U); - - uint32_t i = 0; - volatile uint32_t *lutBase; - - /* Wait for bus to be idle before changing flash configuration. */ - while (!FLEXSPI_GetBusIdleStatus(base)) - { - } - - /* Unlock LUT for update. */ -#if !((defined(FSL_FEATURE_FLEXSPI_LUTKEY_IS_RO)) && (FSL_FEATURE_FLEXSPI_LUTKEY_IS_RO)) - base->LUTKEY = FLEXSPI_LUT_KEY_VAL; -#endif - base->LUTCR = 0x02; - - lutBase = &base->LUT[index]; - for (i = 0; i < count; i++) - { - *lutBase++ = *cmd++; - } - - /* Lock LUT. */ -#if !((defined(FSL_FEATURE_FLEXSPI_LUTKEY_IS_RO)) && (FSL_FEATURE_FLEXSPI_LUTKEY_IS_RO)) - base->LUTKEY = FLEXSPI_LUT_KEY_VAL; -#endif - base->LUTCR = 0x01; -} - -/*! brief Update read sample clock source - * - * param base FLEXSPI peripheral base address. - * param clockSource clockSource of type #flexspi_read_sample_clock_t - */ -void FLEXSPI_UpdateRxSampleClock(FLEXSPI_Type *base, flexspi_read_sample_clock_t clockSource) -{ - uint32_t mcr0Val; - - /* Wait for bus to be idle before changing flash configuration. */ - while (!FLEXSPI_GetBusIdleStatus(base)) - { - } - - mcr0Val = base->MCR0; - mcr0Val &= ~FLEXSPI_MCR0_RXCLKSRC_MASK; - mcr0Val |= FLEXSPI_MCR0_RXCLKSRC(clockSource); - base->MCR0 = mcr0Val; - - /* Reset peripheral. */ - FLEXSPI_SoftwareReset(base); -} - -/*! - * brief Sends a buffer of data bytes using blocking method. - * note This function blocks via polling until all bytes have been sent. - * param base FLEXSPI peripheral base address - * param buffer The data bytes to send - * param size The number of data bytes to send - * retval kStatus_Success write success without error - * retval kStatus_FLEXSPI_SequenceExecutionTimeout sequence execution timeout - * retval kStatus_FLEXSPI_IpCommandSequenceError IP command sequence error detected - * retval kStatus_FLEXSPI_IpCommandGrantTimeout IP command grant timeout detected - */ -status_t FLEXSPI_WriteBlocking(FLEXSPI_Type *base, uint8_t *buffer, size_t size) -{ - uint32_t txWatermark = ((base->IPTXFCR & FLEXSPI_IPTXFCR_TXWMRK_MASK) >> FLEXSPI_IPTXFCR_TXWMRK_SHIFT) + 1U; - uint32_t status; - status_t result = kStatus_Success; - uint32_t i = 0; - - /* Send data buffer */ - while (0U != size) - { - /* Wait until there is room in the fifo. This also checks for errors. */ - while (0U == ((status = base->INTR) & (uint32_t)kFLEXSPI_IpTxFifoWatermarkEmptyFlag)) - { - } - - result = FLEXSPI_CheckAndClearError(base, status); - - if (kStatus_Success != result) - { - return result; - } - - /* Write watermark level data into tx fifo . */ - if (size >= 8U * txWatermark) - { - for (i = 0U; i < 2U * txWatermark; i++) - { - base->TFDR[i] = *(uint32_t *)(void *)buffer; - buffer += 4U; - } - - size = size - 8U * txWatermark; - } - else - { - /* Write word aligned data into tx fifo. */ - for (i = 0U; i < (size / 4U); i++) - { - base->TFDR[i] = *(uint32_t *)(void *)buffer; - buffer += 4U; - } - - /* Adjust size by the amount processed. */ - size -= 4U * i; - - /* Write word un-aligned data into tx fifo. */ - if (0x00U != size) - { - uint32_t tempVal = 0x00U; - - for (uint32_t j = 0U; j < size; j++) - { - tempVal |= ((uint32_t)*buffer++ << (8U * j)); - } - - base->TFDR[i] = tempVal; - } - - size = 0U; - } - - /* Push a watermark level data into IP TX FIFO. */ - base->INTR = (uint32_t)kFLEXSPI_IpTxFifoWatermarkEmptyFlag; - } - - return result; -} - -/*! - * brief Receives a buffer of data bytes using a blocking method. - * note This function blocks via polling until all bytes have been sent. - * param base FLEXSPI peripheral base address - * param buffer The data bytes to send - * param size The number of data bytes to receive - * retval kStatus_Success read success without error - * retval kStatus_FLEXSPI_SequenceExecutionTimeout sequence execution timeout - * retval kStatus_FLEXSPI_IpCommandSequenceError IP command sequence error detected - * retval kStatus_FLEXSPI_IpCommandGrantTimeout IP command grant timeout detected - */ -status_t FLEXSPI_ReadBlocking(FLEXSPI_Type *base, uint8_t *buffer, size_t size) -{ - uint32_t rxWatermark = ((base->IPRXFCR & FLEXSPI_IPRXFCR_RXWMRK_MASK) >> FLEXSPI_IPRXFCR_RXWMRK_SHIFT) + 1U; - uint32_t status; - status_t result = kStatus_Success; - uint32_t i = 0; - bool isReturn = false; - - /* Send data buffer */ - while (0U != size) - { - if (size >= 8U * rxWatermark) - { - /* Wait until there is room in the fifo. This also checks for errors. */ - while (0U == ((status = base->INTR) & (uint32_t)kFLEXSPI_IpRxFifoWatermarkAvailableFlag)) - { - result = FLEXSPI_CheckAndClearError(base, status); - - if (kStatus_Success != result) - { - isReturn = true; - break; - } - } - } - else - { - /* Wait fill level. This also checks for errors. */ - while (size > ((((base->IPRXFSTS) & FLEXSPI_IPRXFSTS_FILL_MASK) >> FLEXSPI_IPRXFSTS_FILL_SHIFT) * 8U)) - { - result = FLEXSPI_CheckAndClearError(base, base->INTR); - - if (kStatus_Success != result) - { - isReturn = true; - break; - } - } - } - - if (isReturn) - { - break; - } - - result = FLEXSPI_CheckAndClearError(base, base->INTR); - - if (kStatus_Success != result) - { - break; - } - - /* Read watermark level data from rx fifo. */ - if (size >= 8U * rxWatermark) - { - for (i = 0U; i < 2U * rxWatermark; i++) - { - *(uint32_t *)(void *)buffer = base->RFDR[i]; - buffer += 4U; - } - - size = size - 8U * rxWatermark; - } - else - { - /* Read word aligned data from rx fifo. */ - for (i = 0U; i < (size / 4U); i++) - { - *(uint32_t *)(void *)buffer = base->RFDR[i]; - buffer += 4U; - } - - /* Adjust size by the amount processed. */ - size -= 4U * i; - - /* Read word un-aligned data from rx fifo. */ - if (0x00U != size) - { - uint32_t tempVal = base->RFDR[i]; - - for (i = 0U; i < size; i++) - { - *buffer++ = ((uint8_t)(tempVal >> (8U * i)) & 0xFFU); - } - } - - size = 0; - } - - /* Pop out a watermark level datas from IP RX FIFO. */ - base->INTR = (uint32_t)kFLEXSPI_IpRxFifoWatermarkAvailableFlag; - } - - return result; -} - -/*! - * brief Execute command to transfer a buffer data bytes using a blocking method. - * param base FLEXSPI peripheral base address - * param xfer pointer to the transfer structure. - * retval kStatus_Success command transfer success without error - * retval kStatus_FLEXSPI_SequenceExecutionTimeout sequence execution timeout - * retval kStatus_FLEXSPI_IpCommandSequenceError IP command sequence error detected - * retval kStatus_FLEXSPI_IpCommandGrantTimeout IP command grant timeout detected - */ -status_t FLEXSPI_TransferBlocking(FLEXSPI_Type *base, flexspi_transfer_t *xfer) -{ - uint32_t configValue = 0; - status_t result = kStatus_Success; - - /* Clear sequence pointer before sending data to external devices. */ - base->FLSHCR2[xfer->port] |= FLEXSPI_FLSHCR2_CLRINSTRPTR_MASK; - - /* Clear former pending status before start this transfer. */ - base->INTR = FLEXSPI_INTR_AHBCMDERR_MASK | FLEXSPI_INTR_IPCMDERR_MASK | FLEXSPI_INTR_AHBCMDGE_MASK | - FLEXSPI_INTR_IPCMDGE_MASK | FLEXSPI_INTR_IPCMDDONE_MASK; - - /* Configure base address. */ - base->IPCR0 = xfer->deviceAddress; - - /* Reset fifos. */ - base->IPTXFCR |= FLEXSPI_IPTXFCR_CLRIPTXF_MASK; - base->IPRXFCR |= FLEXSPI_IPRXFCR_CLRIPRXF_MASK; - - /* Configure data size. */ - if ((xfer->cmdType == kFLEXSPI_Read) || (xfer->cmdType == kFLEXSPI_Write) || (xfer->cmdType == kFLEXSPI_Config)) - { - configValue = FLEXSPI_IPCR1_IDATSZ(xfer->dataSize); - } - - /* Configure sequence ID. */ - configValue |= - FLEXSPI_IPCR1_ISEQID((uint32_t)xfer->seqIndex) | FLEXSPI_IPCR1_ISEQNUM((uint32_t)xfer->SeqNumber - 1U); - base->IPCR1 = configValue; - - /* Start Transfer. */ - base->IPCMD |= FLEXSPI_IPCMD_TRG_MASK; - - if ((xfer->cmdType == kFLEXSPI_Write) || (xfer->cmdType == kFLEXSPI_Config)) - { - result = FLEXSPI_WriteBlocking(base, (uint8_t *)xfer->data, xfer->dataSize); - } - else if (xfer->cmdType == kFLEXSPI_Read) - { - result = FLEXSPI_ReadBlocking(base, (uint8_t *)xfer->data, xfer->dataSize); - } - else - { - /* Empty else. */ - } - - /* Wait until the IP command execution finishes */ - while (0UL == (base->INTR & FLEXSPI_INTR_IPCMDDONE_MASK)) - { - } - - /* Unless there is an error status already set, capture the latest one */ - if (result == kStatus_Success) - { - result = FLEXSPI_CheckAndClearError(base, base->INTR); - } - - return result; -} - -/*! - * brief Initializes the FLEXSPI handle which is used in transactional functions. - * - * param base FLEXSPI peripheral base address. - * param handle pointer to flexspi_handle_t structure to store the transfer state. - * param callback pointer to user callback function. - * param userData user parameter passed to the callback function. - */ -void FLEXSPI_TransferCreateHandle(FLEXSPI_Type *base, - flexspi_handle_t *handle, - flexspi_transfer_callback_t callback, - void *userData) -{ - assert(NULL != handle); - - uint32_t instance = FLEXSPI_GetInstance(base); - - /* Zero handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Set callback and userData. */ - handle->completionCallback = callback; - handle->userData = userData; - -#if defined(FSL_DRIVER_TRANSFER_DOUBLE_WEAK_IRQ) && FSL_DRIVER_TRANSFER_DOUBLE_WEAK_IRQ - /* Save the context in global variables to support the double weak mechanism. */ - s_flexspiHandle[instance] = handle; - s_flexspiIsr = FLEXSPI_TransferHandleIRQ; -#endif - - /* Enable NVIC interrupt. */ - (void)EnableIRQ(s_flexspiIrqs[instance]); -} - -/*! - * brief Performs a interrupt non-blocking transfer on the FLEXSPI bus. - * - * note Calling the API returns immediately after transfer initiates. The user needs - * to call FLEXSPI_GetTransferCount to poll the transfer status to check whether - * the transfer is finished. If the return status is not kStatus_FLEXSPI_Busy, the transfer - * is finished. For FLEXSPI_Read, the dataSize should be multiple of rx watermark level, or - * FLEXSPI could not read data properly. - * - * param base FLEXSPI peripheral base address. - * param handle pointer to flexspi_handle_t structure which stores the transfer state. - * param xfer pointer to flexspi_transfer_t structure. - * retval kStatus_Success Successfully start the data transmission. - * retval kStatus_FLEXSPI_Busy Previous transmission still not finished. - */ -status_t FLEXSPI_TransferNonBlocking(FLEXSPI_Type *base, flexspi_handle_t *handle, flexspi_transfer_t *xfer) -{ - uint32_t configValue = 0; - status_t result = kStatus_Success; - - assert(NULL != handle); - assert(NULL != xfer); - - /* Check if the I2C bus is idle - if not return busy status. */ - if (handle->state != (uint32_t)kFLEXSPI_Idle) - { - result = kStatus_FLEXSPI_Busy; - } - else - { - handle->data = (uint8_t *)xfer->data; - handle->dataSize = xfer->dataSize; - handle->transferTotalSize = xfer->dataSize; - handle->state = (xfer->cmdType == kFLEXSPI_Read) ? (uint32_t)kFLEXSPI_BusyRead : (uint32_t)kFLEXSPI_BusyWrite; - - /* Clear sequence pointer before sending data to external devices. */ - base->FLSHCR2[xfer->port] |= FLEXSPI_FLSHCR2_CLRINSTRPTR_MASK; - - /* Clear former pending status before start this transfer. */ - base->INTR = FLEXSPI_INTR_AHBCMDERR_MASK | FLEXSPI_INTR_IPCMDERR_MASK | FLEXSPI_INTR_AHBCMDGE_MASK | - FLEXSPI_INTR_IPCMDGE_MASK | FLEXSPI_INTR_IPCMDDONE_MASK; - - /* Configure base address. */ - base->IPCR0 = xfer->deviceAddress; - - /* Reset fifos. */ - base->IPTXFCR |= FLEXSPI_IPTXFCR_CLRIPTXF_MASK; - base->IPRXFCR |= FLEXSPI_IPRXFCR_CLRIPRXF_MASK; - - /* Configure data size. */ - if ((xfer->cmdType == kFLEXSPI_Read) || (xfer->cmdType == kFLEXSPI_Write)) - { - configValue = FLEXSPI_IPCR1_IDATSZ(xfer->dataSize); - } - - /* Configure sequence ID. */ - configValue |= - FLEXSPI_IPCR1_ISEQID((uint32_t)xfer->seqIndex) | FLEXSPI_IPCR1_ISEQNUM((uint32_t)xfer->SeqNumber - 1U); - base->IPCR1 = configValue; - - /* Start Transfer. */ - base->IPCMD |= FLEXSPI_IPCMD_TRG_MASK; - - if (handle->state == (uint32_t)kFLEXSPI_BusyRead) - { - FLEXSPI_EnableInterrupts(base, (uint32_t)kFLEXSPI_IpRxFifoWatermarkAvailableFlag | - (uint32_t)kFLEXSPI_SequenceExecutionTimeoutFlag | - (uint32_t)kFLEXSPI_IpCommandSequenceErrorFlag | - (uint32_t)kFLEXSPI_IpCommandGrantTimeoutFlag | - (uint32_t)kFLEXSPI_IpCommandExecutionDoneFlag); - } - else - { - FLEXSPI_EnableInterrupts( - base, (uint32_t)kFLEXSPI_IpTxFifoWatermarkEmptyFlag | (uint32_t)kFLEXSPI_SequenceExecutionTimeoutFlag | - (uint32_t)kFLEXSPI_IpCommandSequenceErrorFlag | (uint32_t)kFLEXSPI_IpCommandGrantTimeoutFlag | - (uint32_t)kFLEXSPI_IpCommandExecutionDoneFlag); - } - } - - return result; -} - -/*! - * brief Gets the master transfer status during a interrupt non-blocking transfer. - * - * param base FLEXSPI peripheral base address. - * param handle pointer to flexspi_handle_t structure which stores the transfer state. - * param count Number of bytes transferred so far by the non-blocking transaction. - * retval kStatus_InvalidArgument count is Invalid. - * retval kStatus_Success Successfully return the count. - */ -status_t FLEXSPI_TransferGetCount(FLEXSPI_Type *base, flexspi_handle_t *handle, size_t *count) -{ - assert(NULL != handle); - - status_t result = kStatus_Success; - - if (handle->state == (uint32_t)kFLEXSPI_Idle) - { - result = kStatus_NoTransferInProgress; - } - else - { - *count = handle->transferTotalSize - handle->dataSize; - } - - return result; -} - -/*! - * brief Aborts an interrupt non-blocking transfer early. - * - * note This API can be called at any time when an interrupt non-blocking transfer initiates - * to abort the transfer early. - * - * param base FLEXSPI peripheral base address. - * param handle pointer to flexspi_handle_t structure which stores the transfer state - */ -void FLEXSPI_TransferAbort(FLEXSPI_Type *base, flexspi_handle_t *handle) -{ - assert(NULL != handle); - - FLEXSPI_DisableInterrupts(base, (uint32_t)kIrqFlags); - handle->state = (uint32_t)kFLEXSPI_Idle; -} - -/*! - * brief Master interrupt handler. - * - * param base FLEXSPI peripheral base address. - * param handle pointer to flexspi_handle_t structure. - */ -void FLEXSPI_TransferHandleIRQ(FLEXSPI_Type *base, flexspi_handle_t *handle) -{ - uint32_t status; - status_t result; - uint32_t intEnableStatus; - uint32_t txWatermark; - uint32_t rxWatermark; - uint32_t i = 0; - - status = base->INTR; - intEnableStatus = base->INTEN; - - /* Check if interrupt is enabled and status is alerted. */ - if ((status & intEnableStatus) != 0U) - { - result = FLEXSPI_CheckAndClearError(base, status); - - if ((result != kStatus_Success) && (handle->completionCallback != NULL)) - { - FLEXSPI_TransferAbort(base, handle); - if (NULL != handle->completionCallback) - { - handle->completionCallback(base, handle, result, handle->userData); - } - } - else - { - if ((0U != (status & (uint32_t)kFLEXSPI_IpRxFifoWatermarkAvailableFlag)) && - (handle->state == (uint32_t)kFLEXSPI_BusyRead)) - { - rxWatermark = ((base->IPRXFCR & FLEXSPI_IPRXFCR_RXWMRK_MASK) >> FLEXSPI_IPRXFCR_RXWMRK_SHIFT) + 1U; - - /* Read watermark level data from rx fifo . */ - if (handle->dataSize >= 8U * rxWatermark) - { - /* Read watermark level data from rx fifo . */ - for (i = 0U; i < 2U * rxWatermark; i++) - { - *(uint32_t *)(void *)handle->data = base->RFDR[i]; - handle->data += 4U; - } - - handle->dataSize = handle->dataSize - 8U * rxWatermark; - } - else - { - /* Read word aligned data from rx fifo. */ - for (i = 0U; i < (handle->dataSize / 4U); i++) - { - *(uint32_t *)(void *)handle->data = base->RFDR[i]; - handle->data += 4U; - } - - /* Adjust size by the amount processed. */ - handle->dataSize -= (size_t)4U * i; - - /* Read word un-aligned data from rx fifo. */ - if (0x00U != handle->dataSize) - { - uint32_t tempVal = base->RFDR[i]; - - for (i = 0U; i < handle->dataSize; i++) - { - *handle->data++ = ((uint8_t)(tempVal >> (8U * i)) & 0xFFU); - } - } - - handle->dataSize = 0; - } - /* Pop out a watermark level data from IP RX FIFO. */ - base->INTR = (uint32_t)kFLEXSPI_IpRxFifoWatermarkAvailableFlag; - } - - if (0U != (status & (uint32_t)kFLEXSPI_IpCommandExecutionDoneFlag)) - { - base->INTR = (uint32_t)kFLEXSPI_IpCommandExecutionDoneFlag; - - FLEXSPI_TransferAbort(base, handle); - - if (NULL != handle->completionCallback) - { - handle->completionCallback(base, handle, kStatus_Success, handle->userData); - } - } - - /* TX FIFO empty interrupt, push watermark level data into tx FIFO. */ - if ((0U != (status & (uint32_t)kFLEXSPI_IpTxFifoWatermarkEmptyFlag)) && - (handle->state == (uint32_t)kFLEXSPI_BusyWrite)) - { - if (0U != handle->dataSize) - { - txWatermark = ((base->IPTXFCR & FLEXSPI_IPTXFCR_TXWMRK_MASK) >> FLEXSPI_IPTXFCR_TXWMRK_SHIFT) + 1U; - /* Write watermark level data into tx fifo . */ - if (handle->dataSize >= 8U * txWatermark) - { - for (i = 0; i < 2U * txWatermark; i++) - { - base->TFDR[i] = *(uint32_t *)(void *)handle->data; - handle->data += 4U; - } - - handle->dataSize = handle->dataSize - 8U * txWatermark; - } - else - { - /* Write word aligned data into tx fifo. */ - for (i = 0U; i < (handle->dataSize / 4U); i++) - { - base->TFDR[i] = *(uint32_t *)(void *)handle->data; - handle->data += 4U; - } - - /* Adjust size by the amount processed. */ - handle->dataSize -= (size_t)4U * i; - - /* Write word un-aligned data into tx fifo. */ - if (0x00U != handle->dataSize) - { - uint32_t tempVal = 0x00U; - - for (uint32_t j = 0U; j < handle->dataSize; j++) - { - tempVal |= ((uint32_t)*handle->data++ << (8U * j)); - } - - base->TFDR[i] = tempVal; - } - - handle->dataSize = 0; - } - - /* Push a watermark level data into IP TX FIFO. */ - base->INTR = (uint32_t)kFLEXSPI_IpTxFifoWatermarkEmptyFlag; - } - } - else - { - /* Empty else */ - } - } - } - else - { - /* Empty else */ - } -} - -#if defined(FSL_DRIVER_TRANSFER_DOUBLE_WEAK_IRQ) && FSL_DRIVER_TRANSFER_DOUBLE_WEAK_IRQ -#if defined(FLEXSPI) -void FLEXSPI_DriverIRQHandler(void); -void FLEXSPI_DriverIRQHandler(void) -{ - s_flexspiIsr(FLEXSPI, s_flexspiHandle[0]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(FLEXSPI0) -void FLEXSPI0_DriverIRQHandler(void); -void FLEXSPI0_DriverIRQHandler(void) -{ - s_flexspiIsr(FLEXSPI0, s_flexspiHandle[0]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#if defined(FLEXSPI1) -void FLEXSPI1_DriverIRQHandler(void); -void FLEXSPI1_DriverIRQHandler(void) -{ - s_flexspiIsr(FLEXSPI1, s_flexspiHandle[1]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#if defined(FLEXSPI2) -void FLEXSPI2_DriverIRQHandler(void); -void FLEXSPI2_DriverIRQHandler(void) -{ - s_flexspiIsr(FLEXSPI2, s_flexspiHandle[2]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(LSIO__FLEXSPI0) -void LSIO_OCTASPI0_INT_DriverIRQHandler(void); -void LSIO_OCTASPI0_INT_DriverIRQHandler(void) -{ - s_flexspiIsr(LSIO__FLEXSPI0, s_flexspiHandle[0]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#if defined(LSIO__FLEXSPI1) -void LSIO_OCTASPI1_INT_DriverIRQHandler(void); -void LSIO_OCTASPI1_INT_DriverIRQHandler(void) -{ - s_flexspiIsr(LSIO__FLEXSPI1, s_flexspiHandle[1]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(FSL_FEATURE_FLEXSPI_HAS_SHARED_IRQ0_IRQ1) && FSL_FEATURE_FLEXSPI_HAS_SHARED_IRQ0_IRQ1 - -void FLEXSPI0_FLEXSPI1_DriverIRQHandler(void); -void FLEXSPI0_FLEXSPI1_DriverIRQHandler(void) -{ - /* If handle is registered, treat the transfer function is enabled. */ - if (NULL != s_flexspiHandle[0]) - { - s_flexspiIsr(FLEXSPI0, s_flexspiHandle[0]); - } - if (NULL != s_flexspiHandle[1]) - { - s_flexspiIsr(FLEXSPI1, s_flexspiHandle[1]); - } -} -#endif - -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexspi.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexspi.h deleted file mode 100644 index 5d65cd41aed..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexspi.h +++ /dev/null @@ -1,902 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_FLEXSPI_H_ -#define FSL_FLEXSPI_H_ - -#include -#include "fsl_device_registers.h" -#include "fsl_common.h" - -/*! - * @addtogroup flexspi - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief FLEXSPI driver version. */ -#define FSL_FLEXSPI_DRIVER_VERSION (MAKE_VERSION(2, 6, 0)) -/*! @} */ - -#define FSL_FEATURE_FLEXSPI_AHB_BUFFER_COUNT FSL_FEATURE_FLEXSPI_AHB_BUFFER_COUNTn(0) - -/*! @brief Formula to form FLEXSPI instructions in LUT table. */ -#define FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) \ - (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | \ - FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1)) - -/*! @brief Status structure of FLEXSPI.*/ -enum -{ - kStatus_FLEXSPI_Busy = MAKE_STATUS(kStatusGroup_FLEXSPI, 0), /*!< FLEXSPI is busy */ - kStatus_FLEXSPI_SequenceExecutionTimeout = MAKE_STATUS(kStatusGroup_FLEXSPI, 1), /*!< Sequence execution timeout - error occurred during FLEXSPI transfer. */ - kStatus_FLEXSPI_IpCommandSequenceError = MAKE_STATUS(kStatusGroup_FLEXSPI, 2), /*!< IP command Sequence execution - timeout error occurred during FLEXSPI transfer. */ - kStatus_FLEXSPI_IpCommandGrantTimeout = MAKE_STATUS(kStatusGroup_FLEXSPI, 3), /*!< IP command grant timeout error - occurred during FLEXSPI transfer. */ -}; - -/*! @brief CMD definition of FLEXSPI, use to form LUT instruction, _flexspi_command. */ -enum -{ - kFLEXSPI_Command_STOP = 0x00U, /*!< Stop execution, deassert CS. */ - kFLEXSPI_Command_SDR = 0x01U, /*!< Transmit Command code to Flash, using SDR mode. */ - kFLEXSPI_Command_RADDR_SDR = 0x02U, /*!< Transmit Row Address to Flash, using SDR mode. */ - kFLEXSPI_Command_CADDR_SDR = 0x03U, /*!< Transmit Column Address to Flash, using SDR mode. */ - kFLEXSPI_Command_MODE1_SDR = 0x04U, /*!< Transmit 1-bit Mode bits to Flash, using SDR mode. */ - kFLEXSPI_Command_MODE2_SDR = 0x05U, /*!< Transmit 2-bit Mode bits to Flash, using SDR mode. */ - kFLEXSPI_Command_MODE4_SDR = 0x06U, /*!< Transmit 4-bit Mode bits to Flash, using SDR mode. */ - kFLEXSPI_Command_MODE8_SDR = 0x07U, /*!< Transmit 8-bit Mode bits to Flash, using SDR mode. */ - kFLEXSPI_Command_WRITE_SDR = 0x08U, /*!< Transmit Programming Data to Flash, using SDR mode. */ - kFLEXSPI_Command_READ_SDR = 0x09U, /*!< Receive Read Data from Flash, using SDR mode. */ - kFLEXSPI_Command_LEARN_SDR = 0x0AU, /*!< Receive Read Data or Preamble bit from Flash, SDR mode. */ - kFLEXSPI_Command_DATSZ_SDR = 0x0BU, /*!< Transmit Read/Program Data size (byte) to Flash, SDR mode. */ - kFLEXSPI_Command_DUMMY_SDR = 0x0CU, /*!< Leave data lines undriven by FlexSPI controller.*/ - kFLEXSPI_Command_DUMMY_RWDS_SDR = 0x0DU, /*!< Leave data lines undriven by FlexSPI controller, - dummy cycles decided by RWDS. */ - kFLEXSPI_Command_DDR = 0x21U, /*!< Transmit Command code to Flash, using DDR mode. */ - kFLEXSPI_Command_RADDR_DDR = 0x22U, /*!< Transmit Row Address to Flash, using DDR mode. */ - kFLEXSPI_Command_CADDR_DDR = 0x23U, /*!< Transmit Column Address to Flash, using DDR mode. */ - kFLEXSPI_Command_MODE1_DDR = 0x24U, /*!< Transmit 1-bit Mode bits to Flash, using DDR mode. */ - kFLEXSPI_Command_MODE2_DDR = 0x25U, /*!< Transmit 2-bit Mode bits to Flash, using DDR mode. */ - kFLEXSPI_Command_MODE4_DDR = 0x26U, /*!< Transmit 4-bit Mode bits to Flash, using DDR mode. */ - kFLEXSPI_Command_MODE8_DDR = 0x27U, /*!< Transmit 8-bit Mode bits to Flash, using DDR mode. */ - kFLEXSPI_Command_WRITE_DDR = 0x28U, /*!< Transmit Programming Data to Flash, using DDR mode. */ - kFLEXSPI_Command_READ_DDR = 0x29U, /*!< Receive Read Data from Flash, using DDR mode. */ - kFLEXSPI_Command_LEARN_DDR = 0x2AU, /*!< Receive Read Data or Preamble bit from Flash, DDR mode. */ - kFLEXSPI_Command_DATSZ_DDR = 0x2BU, /*!< Transmit Read/Program Data size (byte) to Flash, DDR mode. */ - kFLEXSPI_Command_DUMMY_DDR = 0x2CU, /*!< Leave data lines undriven by FlexSPI controller.*/ - kFLEXSPI_Command_DUMMY_RWDS_DDR = 0x2DU, /*!< Leave data lines undriven by FlexSPI controller, - dummy cycles decided by RWDS. */ - kFLEXSPI_Command_JUMP_ON_CS = 0x1FU, /*!< Stop execution, deassert CS and save operand[7:0] as the - instruction start pointer for next sequence */ -}; - -/*! @brief pad definition of FLEXSPI, use to form LUT instruction. */ -typedef enum _flexspi_pad -{ - kFLEXSPI_1PAD = 0x00U, /*!< Transmit command/address and transmit/receive data only through DATA0/DATA1. */ - kFLEXSPI_2PAD = 0x01U, /*!< Transmit command/address and transmit/receive data only through DATA[1:0]. */ - kFLEXSPI_4PAD = 0x02U, /*!< Transmit command/address and transmit/receive data only through DATA[3:0]. */ - kFLEXSPI_8PAD = 0x03U, /*!< Transmit command/address and transmit/receive data only through DATA[7:0]. */ -} flexspi_pad_t; - -/*! @brief FLEXSPI interrupt status flags.*/ -typedef enum _flexspi_flags -{ - kFLEXSPI_SequenceExecutionTimeoutFlag = FLEXSPI_INTEN_SEQTIMEOUTEN_MASK, /*!< Sequence execution timeout. */ -#if defined(FSL_FEATURE_FLEXSPI_HAS_INTEN_AHBBUSERROREN) && FSL_FEATURE_FLEXSPI_HAS_INTEN_AHBBUSERROREN - kFLEXSPI_AhbBusErrorFlag = FLEXSPI_INTEN_AHBBUSERROREN_MASK, /*!< AHB Bus error flag. */ -#else - kFLEXSPI_AhbBusTimeoutFlag = FLEXSPI_INTEN_AHBBUSTIMEOUTEN_MASK, /*!< AHB Bus timeout. */ -#endif - kFLEXSPI_SckStoppedBecauseTxEmptyFlag = - FLEXSPI_INTEN_SCKSTOPBYWREN_MASK, /*!< SCK is stopped during command - sequence because Async TX FIFO empty. */ - kFLEXSPI_SckStoppedBecauseRxFullFlag = - FLEXSPI_INTEN_SCKSTOPBYRDEN_MASK, /*!< SCK is stopped during command - sequence because Async RX FIFO full. */ -#if !((defined(FSL_FEATURE_FLEXSPI_HAS_NO_DATA_LEARN)) && (FSL_FEATURE_FLEXSPI_HAS_NO_DATA_LEARN)) - kFLEXSPI_DataLearningFailedFlag = FLEXSPI_INTEN_DATALEARNFAILEN_MASK, /*!< Data learning failed. */ -#endif - kFLEXSPI_IpTxFifoWatermarkEmptyFlag = FLEXSPI_INTEN_IPTXWEEN_MASK, /*!< IP TX FIFO WaterMark empty. */ - kFLEXSPI_IpRxFifoWatermarkAvailableFlag = FLEXSPI_INTEN_IPRXWAEN_MASK, /*!< IP RX FIFO WaterMark available. */ - kFLEXSPI_AhbCommandSequenceErrorFlag = - FLEXSPI_INTEN_AHBCMDERREN_MASK, /*!< AHB triggered Command Sequences Error. */ - kFLEXSPI_IpCommandSequenceErrorFlag = FLEXSPI_INTEN_IPCMDERREN_MASK, /*!< IP triggered Command Sequences Error. */ - kFLEXSPI_AhbCommandGrantTimeoutFlag = - FLEXSPI_INTEN_AHBCMDGEEN_MASK, /*!< AHB triggered Command Sequences Grant Timeout. */ - kFLEXSPI_IpCommandGrantTimeoutFlag = - FLEXSPI_INTEN_IPCMDGEEN_MASK, /*!< IP triggered Command Sequences Grant Timeout. */ - kFLEXSPI_IpCommandExecutionDoneFlag = - FLEXSPI_INTEN_IPCMDDONEEN_MASK, /*!< IP triggered Command Sequences Execution finished. */ - kFLEXSPI_AllInterruptFlags = 0xFFFU, /*!< All flags. */ -} flexspi_flags_t; - -/*! @brief FLEXSPI sample clock source selection for Flash Reading.*/ -typedef enum _flexspi_read_sample_clock -{ - kFLEXSPI_ReadSampleClkLoopbackInternally = 0x0U, /*!< Dummy Read strobe generated by FlexSPI Controller - and loopback internally. */ - kFLEXSPI_ReadSampleClkLoopbackFromDqsPad = 0x1U, /*!< Dummy Read strobe generated by FlexSPI Controller - and loopback from DQS pad. */ - kFLEXSPI_ReadSampleClkLoopbackFromSckPad = 0x2U, /*!< SCK output clock and loopback from SCK pad. */ - kFLEXSPI_ReadSampleClkExternalInputFromDqsPad = 0x3U, /*!< Flash provided Read strobe and input from DQS pad. */ -} flexspi_read_sample_clock_t; - -/*! @brief FLEXSPI interval unit for flash device select.*/ -typedef enum _flexspi_cs_interval_cycle_unit -{ - kFLEXSPI_CsIntervalUnit1SckCycle = 0x0U, /*!< Chip selection interval: CSINTERVAL * 1 serial clock cycle. */ - kFLEXSPI_CsIntervalUnit256SckCycle = 0x1U, /*!< Chip selection interval: CSINTERVAL * 256 serial clock cycle. */ -} flexspi_cs_interval_cycle_unit_t; - -/*! @brief FLEXSPI AHB wait interval unit for writing.*/ -typedef enum _flexspi_ahb_write_wait_unit -{ - kFLEXSPI_AhbWriteWaitUnit2AhbCycle = 0x0U, /*!< AWRWAIT unit is 2 ahb clock cycle. */ - kFLEXSPI_AhbWriteWaitUnit8AhbCycle = 0x1U, /*!< AWRWAIT unit is 8 ahb clock cycle. */ - kFLEXSPI_AhbWriteWaitUnit32AhbCycle = 0x2U, /*!< AWRWAIT unit is 32 ahb clock cycle. */ - kFLEXSPI_AhbWriteWaitUnit128AhbCycle = 0x3U, /*!< AWRWAIT unit is 128 ahb clock cycle. */ - kFLEXSPI_AhbWriteWaitUnit512AhbCycle = 0x4U, /*!< AWRWAIT unit is 512 ahb clock cycle. */ - kFLEXSPI_AhbWriteWaitUnit2048AhbCycle = 0x5U, /*!< AWRWAIT unit is 2048 ahb clock cycle. */ - kFLEXSPI_AhbWriteWaitUnit8192AhbCycle = 0x6U, /*!< AWRWAIT unit is 8192 ahb clock cycle. */ - kFLEXSPI_AhbWriteWaitUnit32768AhbCycle = 0x7U, /*!< AWRWAIT unit is 32768 ahb clock cycle. */ -} flexspi_ahb_write_wait_unit_t; - -/*! @brief Error Code when IP command Error detected.*/ -typedef enum _flexspi_ip_error_code -{ - kFLEXSPI_IpCmdErrorNoError = 0x0U, /*!< No error. */ - kFLEXSPI_IpCmdErrorJumpOnCsInIpCmd = 0x2U, /*!< IP command with JMP_ON_CS instruction used. */ - kFLEXSPI_IpCmdErrorUnknownOpCode = 0x3U, /*!< Unknown instruction opcode in the sequence. */ - kFLEXSPI_IpCmdErrorSdrDummyInDdrSequence = 0x4U, /*!< Instruction DUMMY_SDR/DUMMY_RWDS_SDR - used in DDR sequence. */ - kFLEXSPI_IpCmdErrorDdrDummyInSdrSequence = 0x5U, /*!< Instruction DUMMY_DDR/DUMMY_RWDS_DDR - used in SDR sequence. */ - kFLEXSPI_IpCmdErrorInvalidAddress = 0x6U, /*!< Flash access start address exceed the whole - flash address range (A1/A2/B1/B2). */ - kFLEXSPI_IpCmdErrorSequenceExecutionTimeout = 0xEU, /*!< Sequence execution timeout. */ - kFLEXSPI_IpCmdErrorFlashBoundaryAcrosss = 0xFU, /*!< Flash boundary crossed. */ -} flexspi_ip_error_code_t; - -/*! @brief Error Code when AHB command Error detected.*/ -typedef enum _flexspi_ahb_error_code -{ - kFLEXSPI_AhbCmdErrorNoError = 0x0U, /*!< No error. */ - kFLEXSPI_AhbCmdErrorJumpOnCsInWriteCmd = 0x2U, /*!< AHB Write command with JMP_ON_CS instruction - used in the sequence. */ - kFLEXSPI_AhbCmdErrorUnknownOpCode = 0x3U, /*!< Unknown instruction opcode in the sequence. */ - kFLEXSPI_AhbCmdErrorSdrDummyInDdrSequence = 0x4U, /*!< Instruction DUMMY_SDR/DUMMY_RWDS_SDR used - in DDR sequence. */ - kFLEXSPI_AhbCmdErrorDdrDummyInSdrSequence = 0x5U, /*!< Instruction DUMMY_DDR/DUMMY_RWDS_DDR - used in SDR sequence. */ - kFLEXSPI_AhbCmdSequenceExecutionTimeout = 0x6U, /*!< Sequence execution timeout. */ -} flexspi_ahb_error_code_t; - -/*! @brief FLEXSPI operation port select.*/ -typedef enum _flexspi_port -{ - kFLEXSPI_PortA1 = 0x0U, /*!< Access flash on A1 port. */ - kFLEXSPI_PortA2, /*!< Access flash on A2 port. */ -#if !((defined(FSL_FEATURE_FLEXSPI_NO_SUPPORT_PORTB)) && (FSL_FEATURE_FLEXSPI_NO_SUPPORT_PORTB)) - kFLEXSPI_PortB1, /*!< Access flash on B1 port. */ - kFLEXSPI_PortB2, /*!< Access flash on B2 port. */ -#endif - kFLEXSPI_PortCount -} flexspi_port_t; - -/*! @brief Trigger source of current command sequence granted by arbitrator.*/ -typedef enum _flexspi_arb_command_source -{ - kFLEXSPI_AhbReadCommand = 0x0U, - kFLEXSPI_AhbWriteCommand = 0x1U, - kFLEXSPI_IpCommand = 0x2U, - kFLEXSPI_SuspendedCommand = 0x3U, -} flexspi_arb_command_source_t; - -/*! @brief Command type. */ -typedef enum _flexspi_command_type -{ - kFLEXSPI_Command, /*!< FlexSPI operation: Only command, both TX and Rx buffer are ignored. */ - kFLEXSPI_Config, /*!< FlexSPI operation: Configure device mode, the TX fifo size is fixed in LUT. */ - kFLEXSPI_Read, /* /!< FlexSPI operation: Read, only Rx Buffer is effective. */ - kFLEXSPI_Write, /* /!< FlexSPI operation: Read, only Tx Buffer is effective. */ -} flexspi_command_type_t; - -typedef struct _flexspi_ahbBuffer_config -{ - uint8_t priority; /*!< This priority for AHB Master Read which this AHB RX Buffer is assigned. */ - uint8_t masterIndex; /*!< AHB Master ID the AHB RX Buffer is assigned. */ - uint16_t bufferSize; /*!< AHB buffer size in byte. */ - bool enablePrefetch; /*!< AHB Read Prefetch Enable for current AHB RX Buffer corresponding Master, allows - prefetch disable/enable separately for each master. */ -} flexspi_ahbBuffer_config_t; - -/*! @brief FLEXSPI configuration structure. */ -typedef struct _flexspi_config -{ - flexspi_read_sample_clock_t rxSampleClock; /*!< Sample Clock source selection for Flash Reading. */ - bool enableSckFreeRunning; /*!< Enable/disable SCK output free-running. */ -#if !(defined(FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_COMBINATIONEN) && FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_COMBINATIONEN) - bool enableCombination; /*!< Enable/disable combining PORT A and B Data Pins - (SIOA[3:0] and SIOB[3:0]) to support Flash Octal mode. */ -#endif - bool enableDoze; /*!< Enable/disable doze mode support. */ - bool enableHalfSpeedAccess; /*!< Enable/disable divide by 2 of the clock for half - speed commands. */ -#if defined(FSL_FEATURE_FLEXSPI_SUPPORT_SEPERATE_RXCLKSRC_PORTB) && FSL_FEATURE_FLEXSPI_SUPPORT_SEPERATE_RXCLKSRC_PORTB - flexspi_read_sample_clock_t rxSampleClockPortB; /*!< Sample Clock source_b selection for Flash Reading. */ -#endif -#if defined(FSL_FEATURE_FLEXSPI_SUPPORT_RXCLKSRC_DIFF) && FSL_FEATURE_FLEXSPI_SUPPORT_RXCLKSRC_DIFF - bool rxSampleClockDiff; /*!< Sample Clock source or source_b selection for Flash Reading. */ -#endif -#if !(defined(FSL_FEATURE_FLEXSPI_HAS_NO_MCR2_SCKBDIFFOPT) && FSL_FEATURE_FLEXSPI_HAS_NO_MCR2_SCKBDIFFOPT) - bool enableSckBDiffOpt; /*!< Enable/disable SCKB pad use as SCKA differential clock - output, when enable, Port B flash access is not available. */ -#endif - bool enableSameConfigForAll; /*!< Enable/disable same configuration for all connected devices - when enabled, same configuration in FLASHA1CRx is applied to all. */ - uint16_t seqTimeoutCycle; /*!< Timeout wait cycle for command sequence execution, - timeout after ahbGrantTimeoutCyle*1024 serial root clock cycles. */ - uint8_t ipGrantTimeoutCycle; /*!< Timeout wait cycle for IP command grant, timeout after - ipGrantTimeoutCycle*1024 AHB clock cycles. */ - uint8_t txWatermark; /*!< FLEXSPI IP transmit watermark value. */ - uint8_t rxWatermark; /*!< FLEXSPI receive watermark value. */ - struct - { -#if !(defined(FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_ATDFEN) && FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_ATDFEN) - bool enableAHBWriteIpTxFifo; /*!< Enable AHB bus write access to IP TX FIFO. */ -#endif -#if !(defined(FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_ARDFEN) && FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_ARDFEN) - bool enableAHBWriteIpRxFifo; /*!< Enable AHB bus write access to IP RX FIFO. */ -#endif - uint8_t ahbGrantTimeoutCycle; /*!< Timeout wait cycle for AHB command grant, - timeout after ahbGrantTimeoutCyle*1024 AHB clock cycles. */ - uint16_t ahbBusTimeoutCycle; /*!< Timeout wait cycle for AHB read/write access, - timeout after ahbBusTimeoutCycle*1024 AHB clock cycles. */ - uint8_t resumeWaitCycle; /*!< Wait cycle for idle state before suspended command sequence - resume, timeout after ahbBusTimeoutCycle AHB clock cycles. */ - flexspi_ahbBuffer_config_t buffer[FSL_FEATURE_FLEXSPI_AHB_BUFFER_COUNT]; /*!< AHB buffer size. */ - bool enableClearAHBBufferOpt; /*!< Enable/disable automatically clean AHB RX Buffer and TX Buffer - when FLEXSPI returns STOP mode ACK. */ - bool enableReadAddressOpt; /*!< Enable/disable remove AHB read burst start address alignment limitation. - when enable, there is no AHB read burst start address alignment limitation. */ - bool enableAHBPrefetch; /*!< Enable/disable AHB read prefetch feature, when enabled, FLEXSPI - will fetch more data than current AHB burst. */ - bool enableAHBBufferable; /*!< Enable/disable AHB bufferable write access support, when enabled, - FLEXSPI return before waiting for command execution finished. */ - bool enableAHBCachable; /*!< Enable AHB bus cachable read access support. */ - } ahbConfig; -} flexspi_config_t; - -/*! @brief External device configuration items. */ -typedef struct _flexspi_device_config -{ - uint32_t flexspiRootClk; /*!< FLEXSPI serial root clock. */ - bool isSck2Enabled; /*!< FLEXSPI use SCK2. */ - uint32_t flashSize; /*!< Flash size in KByte. */ -#if defined(FSL_FEATURE_FLEXSPI_SUPPORT_ADDRESS_SHIFT) && (FSL_FEATURE_FLEXSPI_SUPPORT_ADDRESS_SHIFT) - bool addressShift; /*!< Address shift. */ -#endif /* FSL_FEATURE_FLEXSPI_SUPPORT_ADDRESS_SHIFT */ - flexspi_cs_interval_cycle_unit_t CSIntervalUnit; /*!< CS interval unit, 1 or 256 cycle. */ - uint16_t CSInterval; /*!< CS line assert interval, multiply CS interval unit to - get the CS line assert interval cycles. */ - uint8_t CSHoldTime; /*!< CS line hold time. */ - uint8_t CSSetupTime; /*!< CS line setup time. */ - uint8_t dataValidTime; /*!< Data valid time for external device. */ - uint8_t columnspace; /*!< Column space size. */ - bool enableWordAddress; /*!< If enable word address.*/ - uint8_t AWRSeqIndex; /*!< Sequence ID for AHB write command. */ - uint8_t AWRSeqNumber; /*!< Sequence number for AHB write command. */ - uint8_t ARDSeqIndex; /*!< Sequence ID for AHB read command. */ - uint8_t ARDSeqNumber; /*!< Sequence number for AHB read command. */ - flexspi_ahb_write_wait_unit_t AHBWriteWaitUnit; /*!< AHB write wait unit. */ - uint16_t AHBWriteWaitInterval; /*!< AHB write wait interval, multiply AHB write interval - unit to get the AHB write wait cycles. */ - bool enableWriteMask; /*!< Enable/Disable FLEXSPI drive DQS pin as write mask - when writing to external device. */ -#if defined(FSL_FEATURE_FLEXSPI_HAS_ERRATA_051426) && (FSL_FEATURE_FLEXSPI_HAS_ERRATA_051426) - bool isFroClockSource; /*!< Is FRO clock source or not. */ -#endif -} flexspi_device_config_t; - -/*! @brief Transfer structure for FLEXSPI. */ -typedef struct _flexspi_transfer -{ - uint32_t deviceAddress; /*!< Operation device address. */ - flexspi_port_t port; /*!< Operation port. */ - flexspi_command_type_t cmdType; /*!< Execution command type. */ - uint8_t seqIndex; /*!< Sequence ID for command. */ - uint8_t SeqNumber; /*!< Sequence number for command. */ - uint32_t *data; /*!< Data buffer. */ - size_t dataSize; /*!< Data size in bytes. */ -} flexspi_transfer_t; - -/* Forward declaration of the handle typedef. */ -typedef struct _flexspi_handle flexspi_handle_t; - -/*! @brief FLEXSPI transfer callback function. */ -typedef void (*flexspi_transfer_callback_t)(FLEXSPI_Type *base, - flexspi_handle_t *handle, - status_t status, - void *userData); - -/*! @brief Transfer handle structure for FLEXSPI. */ -struct _flexspi_handle -{ - uint32_t state; /*!< Internal state for FLEXSPI transfer */ - uint8_t *data; /*!< Data buffer. */ - size_t dataSize; /*!< Remaining Data size in bytes. */ - size_t transferTotalSize; /*!< Total Data size in bytes. */ - flexspi_transfer_callback_t completionCallback; /*!< Callback for users while transfer finish or error occurred */ - void *userData; /*!< FLEXSPI callback function parameter.*/ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus. */ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Get the instance number for FLEXSPI. - * - * @param base FLEXSPI base pointer. - */ -uint32_t FLEXSPI_GetInstance(FLEXSPI_Type *base); - -/*! - * @brief Check and clear IP command execution errors. - * - * @param base FLEXSPI base pointer. - * @param status interrupt status. - */ -status_t FLEXSPI_CheckAndClearError(FLEXSPI_Type *base, uint32_t status); - -/*! - * @brief Initializes the FLEXSPI module and internal state. - * - * This function enables the clock for FLEXSPI and also configures the FLEXSPI with the - * input configure parameters. Users should call this function before any FLEXSPI operations. - * - * @param base FLEXSPI peripheral base address. - * @param config FLEXSPI configure structure. - */ -void FLEXSPI_Init(FLEXSPI_Type *base, const flexspi_config_t *config); - -/*! - * @brief Gets default settings for FLEXSPI. - * - * @param config FLEXSPI configuration structure. - */ -void FLEXSPI_GetDefaultConfig(flexspi_config_t *config); - -/*! - * @brief Deinitializes the FLEXSPI module. - * - * Clears the FLEXSPI state and FLEXSPI module registers. - * @param base FLEXSPI peripheral base address. - */ -void FLEXSPI_Deinit(FLEXSPI_Type *base); - -/*! - * @brief Update FLEXSPI DLL value depending on currently flexspi root clock. - * - * @param base FLEXSPI peripheral base address. - * @param config Flash configuration parameters. - * @param port FLEXSPI Operation port. - */ -void FLEXSPI_UpdateDllValue(FLEXSPI_Type *base, flexspi_device_config_t *config, flexspi_port_t port); - -/*! - * @brief Configures the connected device parameter. - * - * This function configures the connected device relevant parameters, such as the size, command, and so on. - * The flash configuration value cannot have a default value. The user needs to configure it according to the - * connected device. - * - * @param base FLEXSPI peripheral base address. - * @param config Flash configuration parameters. - * @param port FLEXSPI Operation port. - */ -void FLEXSPI_SetFlashConfig(FLEXSPI_Type *base, flexspi_device_config_t *config, flexspi_port_t port); - -/*! - * @brief Software reset for the FLEXSPI logic. - * - * This function sets the software reset flags for both AHB and buffer domain and - * resets both AHB buffer and also IP FIFOs. - * - * @param base FLEXSPI peripheral base address. - */ -static inline void FLEXSPI_SoftwareReset(FLEXSPI_Type *base) -{ - base->MCR0 |= FLEXSPI_MCR0_SWRESET_MASK; - while (0U != (base->MCR0 & FLEXSPI_MCR0_SWRESET_MASK)) - { - } -} - -/*! - * @brief Enables or disables the FLEXSPI module. - * - * @param base FLEXSPI peripheral base address. - * @param enable True means enable FLEXSPI, false means disable. - */ -static inline void FLEXSPI_Enable(FLEXSPI_Type *base, bool enable) -{ - if (enable) - { - base->MCR0 &= ~FLEXSPI_MCR0_MDIS_MASK; - } - else - { - base->MCR0 |= FLEXSPI_MCR0_MDIS_MASK; - } -} - -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ -/*! - * @brief Enables the FLEXSPI interrupts. - * - * @param base FLEXSPI peripheral base address. - * @param mask FLEXSPI interrupt source. - */ -static inline void FLEXSPI_EnableInterrupts(FLEXSPI_Type *base, uint32_t mask) -{ - base->INTEN |= mask; -} - -/*! - * @brief Disable the FLEXSPI interrupts. - * - * @param base FLEXSPI peripheral base address. - * @param mask FLEXSPI interrupt source. - */ -static inline void FLEXSPI_DisableInterrupts(FLEXSPI_Type *base, uint32_t mask) -{ - base->INTEN &= ~mask; -} - -/*! @} */ - -/*! @name DMA control */ -/*! @{ */ - -/*! - * @brief Enables or disables FLEXSPI IP Tx FIFO DMA requests. - * - * @param base FLEXSPI peripheral base address. - * @param enable Enable flag for transmit DMA request. Pass true for enable, false for disable. - */ -static inline void FLEXSPI_EnableTxDMA(FLEXSPI_Type *base, bool enable) -{ - if (enable) - { - base->IPTXFCR |= FLEXSPI_IPTXFCR_TXDMAEN_MASK; - } - else - { - base->IPTXFCR &= ~FLEXSPI_IPTXFCR_TXDMAEN_MASK; - } -} - -/*! - * @brief Enables or disables FLEXSPI IP Rx FIFO DMA requests. - * - * @param base FLEXSPI peripheral base address. - * @param enable Enable flag for receive DMA request. Pass true for enable, false for disable. - */ -static inline void FLEXSPI_EnableRxDMA(FLEXSPI_Type *base, bool enable) -{ - if (enable) - { - base->IPRXFCR |= FLEXSPI_IPRXFCR_RXDMAEN_MASK; - } - else - { - base->IPRXFCR &= ~FLEXSPI_IPRXFCR_RXDMAEN_MASK; - } -} - -/*! - * @brief Gets FLEXSPI IP tx fifo address for DMA transfer. - * - * @param base FLEXSPI peripheral base address. - * @retval The tx fifo address. - */ -static inline uint32_t FLEXSPI_GetTxFifoAddress(FLEXSPI_Type *base) -{ - return (uint32_t)&base->TFDR[0]; -} - -/*! - * @brief Gets FLEXSPI IP rx fifo address for DMA transfer. - * - * @param base FLEXSPI peripheral base address. - * @retval The rx fifo address. - */ -static inline uint32_t FLEXSPI_GetRxFifoAddress(FLEXSPI_Type *base) -{ - return (uint32_t)&base->RFDR[0]; -} - -/*! @} */ - -/*! @name FIFO control */ -/*! @{ */ - -/*! @brief Clears the FLEXSPI IP FIFO logic. - * - * @param base FLEXSPI peripheral base address. - * @param txFifo Pass true to reset TX FIFO. - * @param rxFifo Pass true to reset RX FIFO. - */ -static inline void FLEXSPI_ResetFifos(FLEXSPI_Type *base, bool txFifo, bool rxFifo) -{ - if (txFifo) - { - base->IPTXFCR |= FLEXSPI_IPTXFCR_CLRIPTXF_MASK; - } - if (rxFifo) - { - base->IPRXFCR |= FLEXSPI_IPRXFCR_CLRIPRXF_MASK; - } -} - -/*! - * @brief Gets the valid data entries in the FLEXSPI FIFOs. - * - * @param base FLEXSPI peripheral base address. - * @param[out] txCount Pointer through which the current number of bytes in the transmit FIFO is returned. - * Pass NULL if this value is not required. - * @param[out] rxCount Pointer through which the current number of bytes in the receive FIFO is returned. - * Pass NULL if this value is not required. - */ -static inline void FLEXSPI_GetFifoCounts(FLEXSPI_Type *base, size_t *txCount, size_t *rxCount) -{ - if (NULL != txCount) - { - *txCount = (((base->IPTXFSTS) & FLEXSPI_IPTXFSTS_FILL_MASK) >> FLEXSPI_IPTXFSTS_FILL_SHIFT) * 8U; - } - if (NULL != rxCount) - { - *rxCount = (((base->IPRXFSTS) & FLEXSPI_IPRXFSTS_FILL_MASK) >> FLEXSPI_IPRXFSTS_FILL_SHIFT) * 8U; - } -} - -/*! @} */ - -/*! - * @name Status - * @{ - */ -/*! - * @brief Get the FLEXSPI interrupt status flags. - * - * @param base FLEXSPI peripheral base address. - * @retval interrupt status flag, use status flag to AND #flexspi_flags_t could get the related status. - */ -static inline uint32_t FLEXSPI_GetInterruptStatusFlags(FLEXSPI_Type *base) -{ - return base->INTR; -} - -/*! - * @brief Get the FLEXSPI interrupt status flags. - * - * @param base FLEXSPI peripheral base address. - * @param mask FLEXSPI interrupt source. - */ -static inline void FLEXSPI_ClearInterruptStatusFlags(FLEXSPI_Type *base, uint32_t mask) -{ - base->INTR = mask; -} - -#if !((defined(FSL_FEATURE_FLEXSPI_HAS_NO_DATA_LEARN)) && (FSL_FEATURE_FLEXSPI_HAS_NO_DATA_LEARN)) -/*! @brief Gets the sampling clock phase selection after Data Learning. - * - * @param base FLEXSPI peripheral base address. - * @param portAPhase Pointer to a uint8_t type variable to receive the selected clock phase on PORTA. - * @param portBPhase Pointer to a uint8_t type variable to receive the selected clock phase on PORTB. - */ -static inline void FLEXSPI_GetDataLearningPhase(FLEXSPI_Type *base, uint8_t *portAPhase, uint8_t *portBPhase) -{ - if (portAPhase != NULL) - { - *portAPhase = (uint8_t)((base->STS0 & FLEXSPI_STS0_DATALEARNPHASEA_MASK) >> FLEXSPI_STS0_DATALEARNPHASEA_SHIFT); - } - -#if !((defined(FSL_FEATURE_FLEXSPI_HAS_NO_STS0_DATALEARNPHASEB)) && (FSL_FEATURE_FLEXSPI_HAS_NO_STS0_DATALEARNPHASEB)) - if (portBPhase != NULL) - { - *portBPhase = (uint8_t)((base->STS0 & FLEXSPI_STS0_DATALEARNPHASEB_MASK) >> FLEXSPI_STS0_DATALEARNPHASEB_SHIFT); - } -#endif -} -#endif - -/*! @brief Gets the trigger source of current command sequence granted by arbitrator. - * - * @param base FLEXSPI peripheral base address. - * @retval trigger source of current command sequence. - */ -static inline flexspi_arb_command_source_t FLEXSPI_GetArbitratorCommandSource(FLEXSPI_Type *base) -{ - return (flexspi_arb_command_source_t)( - (uint32_t)((base->STS0 & FLEXSPI_STS0_ARBCMDSRC_MASK) >> FLEXSPI_STS0_ARBCMDSRC_SHIFT)); -} - -/*! @brief Gets the error code when IP command error detected. - * - * @param base FLEXSPI peripheral base address. - * @param index Pointer to a uint8_t type variable to receive the sequence index when error detected. - * @retval error code when IP command error detected. - */ -static inline flexspi_ip_error_code_t FLEXSPI_GetIPCommandErrorCode(FLEXSPI_Type *base, uint8_t *index) -{ - *index = (uint8_t)((base->STS1 & FLEXSPI_STS1_IPCMDERRID_MASK) >> FLEXSPI_STS1_IPCMDERRID_SHIFT); - return (flexspi_ip_error_code_t)( - (uint32_t)((base->STS1 & FLEXSPI_STS1_IPCMDERRCODE_MASK) >> FLEXSPI_STS1_IPCMDERRCODE_SHIFT)); -} - -/*! @brief Gets the error code when AHB command error detected. - * - * @param base FLEXSPI peripheral base address. - * @param index Pointer to a uint8_t type variable to receive the sequence index when error detected. - * @retval error code when AHB command error detected. - */ -static inline flexspi_ahb_error_code_t FLEXSPI_GetAHBCommandErrorCode(FLEXSPI_Type *base, uint8_t *index) -{ - *index = (uint8_t)(base->STS1 & FLEXSPI_STS1_AHBCMDERRID_MASK) >> FLEXSPI_STS1_AHBCMDERRID_SHIFT; - return (flexspi_ahb_error_code_t)( - (uint32_t)((base->STS1 & FLEXSPI_STS1_AHBCMDERRCODE_MASK) >> FLEXSPI_STS1_AHBCMDERRCODE_SHIFT)); -} - -/*! @brief Returns whether the bus is idle. - * - * @param base FLEXSPI peripheral base address. - * @retval true Bus is idle. - * @retval false Bus is busy. - */ -static inline bool FLEXSPI_GetBusIdleStatus(FLEXSPI_Type *base) -{ - return (0U != (base->STS0 & FLEXSPI_STS0_ARBIDLE_MASK)) && (0U != (base->STS0 & FLEXSPI_STS0_SEQIDLE_MASK)); -} -/*! @} */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! @brief Update read sample clock source - * - * @param base FLEXSPI peripheral base address. - * @param clockSource clockSource of type #flexspi_read_sample_clock_t - */ -void FLEXSPI_UpdateRxSampleClock(FLEXSPI_Type *base, flexspi_read_sample_clock_t clockSource); - -#if !(defined(FSL_FEATURE_FLEXSPI_HAS_NO_IP_PARALLEL_MODE) && FSL_FEATURE_FLEXSPI_HAS_NO_IP_PARALLEL_MODE) -/*! @brief Enables/disables the FLEXSPI IP command parallel mode. - * - * @param base FLEXSPI peripheral base address. - * @param enable True means enable parallel mode, false means disable parallel mode. - */ -static inline void FLEXSPI_EnableIPParallelMode(FLEXSPI_Type *base, bool enable) -{ - if (enable) - { - base->IPCR1 |= FLEXSPI_IPCR1_IPAREN_MASK; - } - else - { - base->IPCR1 &= ~FLEXSPI_IPCR1_IPAREN_MASK; - } -} -#endif - -#if !(defined(FSL_FEATURE_FLEXSPI_HAS_NO_AHB_PARALLEL_MODE) && FSL_FEATURE_FLEXSPI_HAS_NO_AHB_PARALLEL_MODE) -/*! @brief Enables/disables the FLEXSPI AHB command parallel mode. - * - * @param base FLEXSPI peripheral base address. - * @param enable True means enable parallel mode, false means disable parallel mode. - */ -static inline void FLEXSPI_EnableAHBParallelMode(FLEXSPI_Type *base, bool enable) -{ - if (enable) - { - base->AHBCR |= FLEXSPI_AHBCR_APAREN_MASK; - } - else - { - base->AHBCR &= ~FLEXSPI_AHBCR_APAREN_MASK; - } -} -#endif - -#if (defined(FSL_FEATURE_FLEXSPI_HAS_AHBCR_AFLASHBASE_BIT) && FSL_FEATURE_FLEXSPI_HAS_AHBCR_AFLASHBASE_BIT) -/*! - * @brief Set AHB Memory-Mapped Flash base address. - * - * @note The length of base address may be different for differnt instance, please refer to the reference manual. - * @note This function should be called when FLEXSPI is in stop mode. - * - * @param base FLEXSPI peripheral base address. - * @param address AHB Memory-Mapped Flash base address. - */ -static inline void FLEXSPI_SetAHBFlashBaseAddress(FLEXSPI_Type *base, uint8_t address) -{ - base->AHBCR = (base->AHBCR & (~FLEXSPI_AHBCR_AFLASHBASE_MASK)) | FLEXSPI_AHBCR_AFLASHBASE(address); -} -#endif /* (defined(FSL_FEATURE_FLEXSPI_HAS_AHBCR_AFLASHBASE_BIT) && FSL_FEATURE_FLEXSPI_HAS_AHBCR_AFLASHBASE_BIT) */ - -/*! @brief Updates the LUT table. - * - * @param base FLEXSPI peripheral base address. - * @param index From which index start to update. It could be any index of the LUT table, which - * also allows user to update command content inside a command. Each command consists of up to - * 8 instructions and occupy 4*32-bit memory. - * @param cmd Command sequence array. - * @param count Number of sequences. - */ -void FLEXSPI_UpdateLUT(FLEXSPI_Type *base, uint32_t index, const uint32_t *cmd, uint32_t count); - -/*! - * @brief Writes data into FIFO. - * - * @param base FLEXSPI peripheral base address - * @param data The data bytes to send - * @param fifoIndex Destination fifo index. - */ -static inline void FLEXSPI_WriteData(FLEXSPI_Type *base, uint32_t data, uint8_t fifoIndex) -{ - base->TFDR[fifoIndex] = data; -} - -/*! - * @brief Receives data from data FIFO. - * - * @param base FLEXSPI peripheral base address - * @param fifoIndex Source fifo index. - * @return The data in the FIFO. - */ -static inline uint32_t FLEXSPI_ReadData(FLEXSPI_Type *base, uint8_t fifoIndex) -{ - return base->RFDR[fifoIndex]; -} - -/*! - * @brief Sends a buffer of data bytes using blocking method. - * @note This function blocks via polling until all bytes have been sent. - * @param base FLEXSPI peripheral base address - * @param buffer The data bytes to send - * @param size The number of data bytes to send - * @retval kStatus_Success write success without error - * @retval kStatus_FLEXSPI_SequenceExecutionTimeout sequence execution timeout - * @retval kStatus_FLEXSPI_IpCommandSequenceError IP command sequence error detected - * @retval kStatus_FLEXSPI_IpCommandGrantTimeout IP command grant timeout detected - */ -status_t FLEXSPI_WriteBlocking(FLEXSPI_Type *base, uint8_t *buffer, size_t size); - -/*! - * @brief Receives a buffer of data bytes using a blocking method. - * @note This function blocks via polling until all bytes have been sent. - * @param base FLEXSPI peripheral base address - * @param buffer The data bytes to send - * @param size The number of data bytes to receive - * @retval kStatus_Success read success without error - * @retval kStatus_FLEXSPI_SequenceExecutionTimeout sequence execution timeout - * @retval kStatus_FLEXSPI_IpCommandSequenceError IP command sequencen error detected - * @retval kStatus_FLEXSPI_IpCommandGrantTimeout IP command grant timeout detected - */ -status_t FLEXSPI_ReadBlocking(FLEXSPI_Type *base, uint8_t *buffer, size_t size); - -/*! - * @brief Execute command to transfer a buffer data bytes using a blocking method. - * @param base FLEXSPI peripheral base address - * @param xfer pointer to the transfer structure. - * @retval kStatus_Success command transfer success without error - * @retval kStatus_FLEXSPI_SequenceExecutionTimeout sequence execution timeout - * @retval kStatus_FLEXSPI_IpCommandSequenceError IP command sequence error detected - * @retval kStatus_FLEXSPI_IpCommandGrantTimeout IP command grant timeout detected - */ -status_t FLEXSPI_TransferBlocking(FLEXSPI_Type *base, flexspi_transfer_t *xfer); -/*! @} */ - -/*! - * @name Transactional - * @{ - */ - -/*! - * @brief Initializes the FLEXSPI handle which is used in transactional functions. - * - * @param base FLEXSPI peripheral base address. - * @param handle pointer to flexspi_handle_t structure to store the transfer state. - * @param callback pointer to user callback function. - * @param userData user parameter passed to the callback function. - */ -void FLEXSPI_TransferCreateHandle(FLEXSPI_Type *base, - flexspi_handle_t *handle, - flexspi_transfer_callback_t callback, - void *userData); - -/*! - * @brief Performs a interrupt non-blocking transfer on the FLEXSPI bus. - * - * @note Calling the API returns immediately after transfer initiates. The user needs - * to call FLEXSPI_GetTransferCount to poll the transfer status to check whether - * the transfer is finished. If the return status is not kStatus_FLEXSPI_Busy, the transfer - * is finished. For FLEXSPI_Read, the dataSize should be multiple of rx watermark level, or - * FLEXSPI could not read data properly. - * - * @param base FLEXSPI peripheral base address. - * @param handle pointer to flexspi_handle_t structure which stores the transfer state. - * @param xfer pointer to flexspi_transfer_t structure. - * @retval kStatus_Success Successfully start the data transmission. - * @retval kStatus_FLEXSPI_Busy Previous transmission still not finished. - */ -status_t FLEXSPI_TransferNonBlocking(FLEXSPI_Type *base, flexspi_handle_t *handle, flexspi_transfer_t *xfer); - -/*! - * @brief Gets the master transfer status during a interrupt non-blocking transfer. - * - * @param base FLEXSPI peripheral base address. - * @param handle pointer to flexspi_handle_t structure which stores the transfer state. - * @param count Number of bytes transferred so far by the non-blocking transaction. - * @retval kStatus_InvalidArgument count is Invalid. - * @retval kStatus_Success Successfully return the count. - */ -status_t FLEXSPI_TransferGetCount(FLEXSPI_Type *base, flexspi_handle_t *handle, size_t *count); - -/*! - * @brief Aborts an interrupt non-blocking transfer early. - * - * @note This API can be called at any time when an interrupt non-blocking transfer initiates - * to abort the transfer early. - * - * @param base FLEXSPI peripheral base address. - * @param handle pointer to flexspi_handle_t structure which stores the transfer state - */ -void FLEXSPI_TransferAbort(FLEXSPI_Type *base, flexspi_handle_t *handle); - -/*! - * @brief Master interrupt handler. - * - * @param base FLEXSPI peripheral base address. - * @param handle pointer to flexspi_handle_t structure. - */ -void FLEXSPI_TransferHandleIRQ(FLEXSPI_Type *base, flexspi_handle_t *handle); -/*! @} */ - -#if defined(__cplusplus) -} -#endif /*_cplusplus. */ -/*! @} */ - -#endif /* FSL_FLEXSPI_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexspi_edma.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexspi_edma.c deleted file mode 100644 index ece9ed47285..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexspi_edma.c +++ /dev/null @@ -1,382 +0,0 @@ -/* - * Copyright 2021-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_flexspi_edma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flexspi_dma3" -#endif - -/*> 1 != 0U) - { - power++; - value = value >> 1; - } - - return power; -} -static void FLEXSPI_TransferEDMACallback(edma_handle_t *handle, void *param, bool transferDone, uint32_t tcds) -{ - flexspi_edma_private_handle_t *flexspiPrivateHandle = (flexspi_edma_private_handle_t *)param; - - /* Avoid warning for unused parameters. */ - handle = handle; - tcds = tcds; - - if (transferDone) - { - /* Wait for bus idle. */ - while (!FLEXSPI_GetBusIdleStatus(flexspiPrivateHandle->base)) - { - } - /* Disable transfer. */ - FLEXSPI_TransferAbortEDMA(flexspiPrivateHandle->base, flexspiPrivateHandle->handle); - - if (flexspiPrivateHandle->handle->completionCallback != NULL) - { - flexspiPrivateHandle->handle->completionCallback(flexspiPrivateHandle->base, flexspiPrivateHandle->handle, - kStatus_Success, flexspiPrivateHandle->handle->userData); - } - } -} - -/*! - * brief Initializes the FLEXSPI handle for transfer which is used in transactional functions and set the callback. - * - * param base FLEXSPI peripheral base address - * param handle Pointer to flexspi_edma_handle_t structure - * param callback FLEXSPI callback, NULL means no callback. - * param userData User callback function data. - * param txDmaHandle User requested DMA handle for TX DMA transfer. - * param rxDmaHandle User requested DMA handle for RX DMA transfer. - */ -void FLEXSPI_TransferCreateHandleEDMA(FLEXSPI_Type *base, - flexspi_edma_handle_t *handle, - flexspi_edma_callback_t callback, - void *userData, - edma_handle_t *txDmaHandle, - edma_handle_t *rxDmaHandle) -{ - assert(handle); - - uint32_t instance = FLEXSPI_GetInstance(base); - - s_edmaPrivateHandle[instance].base = base; - s_edmaPrivateHandle[instance].handle = handle; - - (void)FLEXSPI_EDMAMemset(handle, 0, sizeof(*handle)); - - handle->state = kFLEXSPI_Idle; - handle->txDmaHandle = txDmaHandle; - handle->rxDmaHandle = rxDmaHandle; - handle->nsize = kFLEXPSI_EDMAnSize1Bytes; - - handle->completionCallback = callback; - handle->userData = userData; -} - -/*! - * brief Update FLEXSPI EDMA transfer source data transfer size(SSIZE) and destination data transfer size(DSIZE). - * - * param base FLEXSPI peripheral base address - * param handle Pointer to flexspi_edma_handle_t structure - * param nsize FLEXSPI DMA transfer data transfer size(SSIZE/DSIZE), by default the size is - * kFLEXPSI_EDMAnSize1Bytes(one byte). - * see flexspi_edma_transfer_nsize_t . - */ -void FLEXSPI_TransferUpdateSizeEDMA(FLEXSPI_Type *base, - flexspi_edma_handle_t *handle, - flexspi_edma_transfer_nsize_t nsize) -{ - handle->nsize = nsize; -} - -/*! - * brief Transfers FLEXSPI data using an eDMA non-blocking method. - * - * This function writes/receives data to/from the FLEXSPI transmit/receive FIFO. This function is non-blocking. - * param base FLEXSPI peripheral base address. - * param handle Pointer to flexspi_edma_handle_t structure - * param xfer FLEXSPI transfer structure. - * retval kStatus_FLEXSPI_Busy FLEXSPI is busy transfer. - * retval kStatus_InvalidArgument The watermark configuration is invalid, the watermark should be power of - 2 to do successfully EDMA transfer. - * retval kStatus_Success FLEXSPI successfully start edma transfer. - */ -status_t FLEXSPI_TransferEDMA(FLEXSPI_Type *base, flexspi_edma_handle_t *handle, flexspi_transfer_t *xfer) -{ - uint32_t configValue = 0; - status_t result = kStatus_Success; - edma_transfer_config_t xferConfig; - uint32_t instance = FLEXSPI_GetInstance(base); - uint8_t power = 0; - - assert(handle); - assert(xfer); - - /* Check if the FLEXSPI bus is idle - if not return busy status. */ - if (handle->state != (uint32_t)kFLEXSPI_Idle) - { - result = kStatus_FLEXSPI_Busy; - } - else - { - handle->transferSize = xfer->dataSize; - handle->state = kFLEXSPI_Busy; - - /* Clear sequence pointer before sending data to external devices. */ - base->FLSHCR2[xfer->port] |= FLEXSPI_FLSHCR2_CLRINSTRPTR_MASK; - - /* Clear former pending status before start this transfer. */ - base->INTR |= FLEXSPI_INTR_AHBCMDERR_MASK | FLEXSPI_INTR_IPCMDERR_MASK | FLEXSPI_INTR_AHBCMDGE_MASK | - FLEXSPI_INTR_IPCMDGE_MASK; - - /* Configure base address. */ - base->IPCR0 = xfer->deviceAddress; - - /* Reset fifos. */ - base->IPTXFCR |= FLEXSPI_IPTXFCR_CLRIPTXF_MASK; - base->IPRXFCR |= FLEXSPI_IPRXFCR_CLRIPRXF_MASK; - - /* Configure data size. */ - if ((xfer->cmdType == kFLEXSPI_Read) || (xfer->cmdType == kFLEXSPI_Write)) - { - configValue = FLEXSPI_IPCR1_IDATSZ(xfer->dataSize); - } - - /* Configure sequence ID. */ - configValue |= FLEXSPI_IPCR1_ISEQID(xfer->seqIndex) | FLEXSPI_IPCR1_ISEQNUM((uint32_t)xfer->SeqNumber - 1U); - base->IPCR1 = configValue; - } - - if ((xfer->cmdType == kFLEXSPI_Write) || (xfer->cmdType == kFLEXSPI_Config)) - { - handle->count = (uint8_t)((base->IPTXFCR & FLEXSPI_IPTXFCR_TXWMRK_MASK) >> FLEXSPI_IPTXFCR_TXWMRK_SHIFT) + 1U; - - if (xfer->dataSize < 8U * (uint32_t)handle->count) - { - handle->nbytes = (uint8_t)xfer->dataSize; - } - else - { - /* Check the handle->count is power of 2 */ - if (((handle->count) & (handle->count - 1U)) != 0U) - { - return kStatus_InvalidArgument; - } - /* Store the initially configured eDMA minor byte transfer count into the FLEXSPI handle */ - handle->nbytes = (8U * handle->count); - } - - power = FLEXSPI_CalculatePower(8U * handle->count); - - /* Prepare transfer. */ - EDMA_PrepareTransfer(&xferConfig, xfer->data, (uint32_t)handle->nsize, - (void *)(uint32_t *)FLEXSPI_GetTxFifoAddress(base), (uint32_t)handle->nsize, - (uint32_t)handle->nbytes, xfer->dataSize, kEDMA_MemoryToMemory); - - /* Submit transfer. */ - (void)EDMA_SubmitTransfer(handle->txDmaHandle, &xferConfig); - EDMA_SetModulo(handle->txDmaHandle->base, handle->txDmaHandle->channel, kEDMA_ModuloDisable, - (edma_modulo_t)power); - EDMA_SetCallback(handle->txDmaHandle, FLEXSPI_TransferEDMACallback, - &s_edmaPrivateHandle[FLEXSPI_GetInstance(base)]); - EDMA_StartTransfer(handle->txDmaHandle); - - /* Enable FLEXSPI TX EDMA. */ - FLEXSPI_EnableTxDMA(base, true); - - /* Start Transfer. */ - base->IPCMD |= FLEXSPI_IPCMD_TRG_MASK; - } - else if (xfer->cmdType == kFLEXSPI_Read) - { - handle->count = (uint8_t)((base->IPRXFCR & FLEXSPI_IPRXFCR_RXWMRK_MASK) >> FLEXSPI_IPRXFCR_RXWMRK_SHIFT) + 1U; - - if (xfer->dataSize < 8U * (uint32_t)handle->count) - { - handle->nbytes = (uint8_t)xfer->dataSize; - } - else - { - /* Check the handle->count is power of 2 */ - if (((handle->count) & (handle->count - 1U)) != 0U) - { - return kStatus_InvalidArgument; - } - /* Store the initially configured eDMA minor byte transfer count into the FLEXSPI handle */ - handle->nbytes = (8U * handle->count); - } - - power = FLEXSPI_CalculatePower(8U * handle->count); - - /* Prepare transfer. */ - EDMA_PrepareTransfer(&xferConfig, (void *)(uint32_t *)FLEXSPI_GetRxFifoAddress(base), (uint32_t)handle->nsize, - xfer->data, (uint32_t)handle->nsize, (uint32_t)handle->nbytes, xfer->dataSize, - kEDMA_MemoryToMemory); - - /* Submit transfer. */ - (void)EDMA_SubmitTransfer(handle->rxDmaHandle, &xferConfig); - EDMA_SetModulo(handle->rxDmaHandle->base, handle->rxDmaHandle->channel, (edma_modulo_t)power, - kEDMA_ModuloDisable); - EDMA_SetCallback(handle->rxDmaHandle, FLEXSPI_TransferEDMACallback, &s_edmaPrivateHandle[instance]); - EDMA_StartTransfer(handle->rxDmaHandle); - - /* Enable FLEXSPI RX EDMA. */ - FLEXSPI_EnableRxDMA(base, true); - - /* Start Transfer. */ - base->IPCMD |= FLEXSPI_IPCMD_TRG_MASK; - } - else - { - /* Start Transfer. */ - base->IPCMD |= FLEXSPI_IPCMD_TRG_MASK; - /* Wait for bus idle. */ - while (!FLEXSPI_GetBusIdleStatus(base)) - { - } - result = FLEXSPI_CheckAndClearError(base, base->INTR); - - handle->state = kFLEXSPI_Idle; - - if (handle->completionCallback != NULL) - { - handle->completionCallback(base, handle, result, handle->userData); - } - } - - return result; -} - -/*! - * brief Aborts the transfer data using eDMA. - * - * This function aborts the transfer data using eDMA. - * - * param base FLEXSPI peripheral base address. - * param handle Pointer to flexspi_edma_handle_t structure - */ -void FLEXSPI_TransferAbortEDMA(FLEXSPI_Type *base, flexspi_edma_handle_t *handle) -{ - assert(handle); - - if ((base->IPTXFCR & FLEXSPI_IPTXFCR_TXDMAEN_MASK) != 0x00U) - { - FLEXSPI_EnableTxDMA(base, false); - EDMA_AbortTransfer(handle->txDmaHandle); - } - - if ((base->IPRXFCR & FLEXSPI_IPRXFCR_RXDMAEN_MASK) != 0x00U) - { - FLEXSPI_EnableRxDMA(base, false); - EDMA_AbortTransfer(handle->rxDmaHandle); - } - - handle->state = kFLEXSPI_Idle; -} - -status_t FLEXSPI_TransferGetTransferCountEDMA(FLEXSPI_Type *base, flexspi_edma_handle_t *handle, size_t *count) -{ - assert(handle); - assert(count); - - status_t result = kStatus_Success; - - if (handle->state != (uint32_t)kFLEXSPI_Busy) - { - result = kStatus_NoTransferInProgress; - } - else - { - if ((base->IPRXFCR & FLEXSPI_IPRXFCR_RXDMAEN_MASK) != 0x00U) - { - *count = (handle->transferSize - - (uint32_t)handle->nbytes * - EDMA_GetRemainingMajorLoopCount(handle->rxDmaHandle->base, handle->rxDmaHandle->channel)); - } - else if ((base->IPTXFCR & FLEXSPI_IPTXFCR_TXDMAEN_MASK) != 0x00U) - { - *count = (handle->transferSize - - (uint32_t)handle->nbytes * - EDMA_GetRemainingMajorLoopCount(handle->txDmaHandle->base, handle->txDmaHandle->channel)); - } - else - { - ; /* Intentional empty for MISRA C-2012 rule 15.7. */ - } - } - - return result; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexspi_edma.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexspi_edma.h deleted file mode 100644 index 3782d9aed1a..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_flexspi_edma.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright 2021-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_FLEXSPI_EDMA_H_ -#define FSL_FLEXSPI_EDMA_H_ - -#include "fsl_flexspi.h" -#include "fsl_edma.h" - -/*! - * @addtogroup flexspi_edma - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief FLEXSPI EDMA driver. */ -#define FSL_FLEXSPI_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 0, 1)) -/*! @} */ - -typedef struct _flexspi_edma_handle flexspi_edma_handle_t; - -/*! @brief FLEXSPI eDMA transfer callback function for finish and error */ -typedef void (*flexspi_edma_callback_t)(FLEXSPI_Type *base, - flexspi_edma_handle_t *handle, - status_t status, - void *userData); - -/*! @brief eDMA transfer configuration */ -typedef enum _flexspi_edma_ntransfer_size -{ - kFLEXPSI_EDMAnSize1Bytes = 0x1U, /*!< Source/Destination data transfer size is 1 byte every time */ - kFLEXPSI_EDMAnSize2Bytes = 0x2U, /*!< Source/Destination data transfer size is 2 bytes every time */ - kFLEXPSI_EDMAnSize4Bytes = 0x4U, /*!< Source/Destination data transfer size is 4 bytes every time */ - kFLEXPSI_EDMAnSize8Bytes = 0x8U, /*!< Source/Destination data transfer size is 8 bytes every time */ - kFLEXPSI_EDMAnSize32Bytes = 0x20U, /*!< Source/Destination data transfer size is 32 bytes every time */ -} flexspi_edma_transfer_nsize_t; - -/*! @brief FLEXSPI DMA transfer handle, users should not touch the content of the handle.*/ -struct _flexspi_edma_handle -{ - edma_handle_t *txDmaHandle; /*!< eDMA handler for FLEXSPI Tx. */ - edma_handle_t *rxDmaHandle; /*!< eDMA handler for FLEXSPI Rx. */ - size_t transferSize; /*!< Bytes need to transfer. */ - flexspi_edma_transfer_nsize_t nsize; /*!< eDMA SSIZE/DSIZE in each transfer. */ - uint8_t nbytes; /*!< eDMA minor byte transfer count initially configured. */ - uint8_t count; /*!< The transfer data count in a DMA request. */ - uint32_t state; /*!< Internal state for FLEXSPI eDMA transfer. */ - flexspi_edma_callback_t completionCallback; /*!< A callback function called after the eDMA transfer is finished. */ - void *userData; /*!< User callback parameter */ -}; - -/******************************************************************************* - * APIs - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name FLEXSPI eDMA Transactional - * @{ - */ - -/*! - * @brief Initializes the FLEXSPI handle for transfer which is used in transactional functions and set the callback. - * - * @param base FLEXSPI peripheral base address - * @param handle Pointer to flexspi_edma_handle_t structure - * @param callback FLEXSPI callback, NULL means no callback. - * @param userData User callback function data. - * @param txDmaHandle User requested DMA handle for TX DMA transfer. - * @param rxDmaHandle User requested DMA handle for RX DMA transfer. - */ -void FLEXSPI_TransferCreateHandleEDMA(FLEXSPI_Type *base, - flexspi_edma_handle_t *handle, - flexspi_edma_callback_t callback, - void *userData, - edma_handle_t *txDmaHandle, - edma_handle_t *rxDmaHandle); - -/*! - * @brief Update FLEXSPI EDMA transfer source data transfer size(SSIZE) and destination data transfer size(DSIZE). - * - * @param base FLEXSPI peripheral base address - * @param handle Pointer to flexspi_edma_handle_t structure - * @param nsize FLEXSPI DMA transfer data transfer size(SSIZE/DSIZE), by default the size is - * kFLEXPSI_EDMAnSize1Bytes(one byte). - * @see flexspi_edma_transfer_nsize_t . - */ -void FLEXSPI_TransferUpdateSizeEDMA(FLEXSPI_Type *base, - flexspi_edma_handle_t *handle, - flexspi_edma_transfer_nsize_t nsize); - -/*! - * @brief Transfers FLEXSPI data using an eDMA non-blocking method. - * - * This function writes/receives data to/from the FLEXSPI transmit/receive FIFO. This function is non-blocking. - * @param base FLEXSPI peripheral base address. - * @param handle Pointer to flexspi_edma_handle_t structure - * @param xfer FLEXSPI transfer structure. - * @retval kStatus_FLEXSPI_Busy FLEXSPI is busy transfer. - * @retval kStatus_InvalidArgument The watermark configuration is invalid, the watermark should be power of - 2 to do successfully EDMA transfer. - * @retval kStatus_Success FLEXSPI successfully start edma transfer. - */ -status_t FLEXSPI_TransferEDMA(FLEXSPI_Type *base, flexspi_edma_handle_t *handle, flexspi_transfer_t *xfer); - -/*! - * @brief Aborts the transfer data using eDMA. - * - * This function aborts the transfer data using eDMA. - * - * @param base FLEXSPI peripheral base address. - * @param handle Pointer to flexspi_edma_handle_t structure - */ -void FLEXSPI_TransferAbortEDMA(FLEXSPI_Type *base, flexspi_edma_handle_t *handle); - -/*! - * @brief Gets the transferred counts of transfer. - * - * @param base FLEXSPI peripheral base address. - * @param handle Pointer to flexspi_edma_handle_t structure. - * @param count Bytes transfer. - * @retval kStatus_Success Succeed get the transfer count. - * @retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t FLEXSPI_TransferGetTransferCountEDMA(FLEXSPI_Type *base, flexspi_edma_handle_t *handle, size_t *count); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @} */ - -#endif /* FSL_FLEXSPI_EDMA_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_freqme.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_freqme.c deleted file mode 100644 index 459bbb6f3a0..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_freqme.c +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright 2021-2022 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_freqme.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpc_freqme" -#endif - -#if defined(FREQME_RSTS_N) -#define FREQME_RESETS_ARRAY FREQME_RSTS_N -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -static uint32_t FREQME_GetInstance(FREQME_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Array to map freqme instance number to base address. */ -static FREQME_Type *const s_freqmeBases[] = FREQME_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to FREQME clocks for each instance. */ -static const clock_ip_name_t s_freqmeClocks[] = FREQME_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(FREQME_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_freqmeResets[] = FREQME_RESETS_ARRAY; -#endif -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t FREQME_GetInstance(FREQME_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0U; instance < ARRAY_SIZE(s_freqmeBases); instance++) - { - if (s_freqmeBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_freqmeBases)); - - return instance; -} - -/*! - * brief Initialize freqme module, set operate mode, operate mode attribute and initialize measurement cycle. - * - * param base FREQME peripheral base address. - * param config The pointer to module basic configuration, please refer to freq_measure_config_t. - */ -void FREQME_Init(FREQME_Type *base, const freq_measure_config_t *config) -{ - assert(config); - - uint32_t tmp32 = 0UL; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable FREQME clock. */ - CLOCK_EnableClock(s_freqmeClocks[FREQME_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(FREQME_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_freqmeResets[FREQME_GetInstance(base)]); -#endif - - if (config->startMeasurement) - { - tmp32 |= FREQME_CTRL_W_MEASURE_IN_PROGRESS_MASK; - } - tmp32 |= FREQME_CTRL_W_CONTINUOUS_MODE_EN(config->enableContinuousMode) | - FREQME_CTRL_W_PULSE_MODE(config->operateMode); - if (config->operateMode == kFREQME_FreqMeasurementMode) - { - tmp32 |= FREQME_CTRL_W_REF_SCALE(config->operateModeAttribute.refClkScaleFactor); - } - else - { - tmp32 |= FREQME_CTRL_W_PULSE_POL(config->operateModeAttribute.pulsePolarity); - } - - base->CTRL_W = tmp32; -} - -/*! - * brief Get default configuration. - * - * code - * config->operateMode = kFREQME_FreqMeasurementMode; - * config->operateModeAttribute.refClkScaleFactor = 0U; - * config->enableContinuousMode = false; - * config->startMeasurement = false; - * endcode - * - * param config The pointer to module basic configuration, please refer to freq_measure_config_t. - */ -void FREQME_GetDefaultConfig(freq_measure_config_t *config) -{ - assert(config); - - (void)memset(config, 0, sizeof(*config)); - - config->operateMode = kFREQME_FreqMeasurementMode; - config->operateModeAttribute.refClkScaleFactor = 0U; - config->enableContinuousMode = false; - config->startMeasurement = false; -} - -/*! - * brief Calculate the frequency of selected target clock. - * - * note The formula: Ftarget = (RESULT - 2) * Freference / 2 ^ REF_SCALE. - * - * note This function only useful when the operate mode is selected as frequency measurement mode. - * - * param base FREQME peripheral base address. - * param refClkFrequency The frequency of reference clock. - * return The frequency of target clock, if the output result is 0, please check the module's operate mode. - */ -uint32_t FREQME_CalculateTargetClkFreq(FREQME_Type *base, uint32_t refClkFrequency) -{ - uint32_t measureResult = 0UL; - uint32_t targetFreq = 0UL; - uint64_t tmp64 = 0ULL; - - while ((base->CTRL_R & FREQME_CTRL_R_MEASURE_IN_PROGRESS_MASK) != 0UL) - { - } - - if (!FREQME_CheckOperateMode(base)) - { - measureResult = base->CTRL_R & FREQME_CTRL_R_RESULT_MASK; - tmp64 = ((uint64_t)measureResult - 2ULL) * (uint64_t)refClkFrequency; - targetFreq = (uint32_t)(tmp64 / (1ULL << (uint64_t)FREQME_GetReferenceClkScaleValue(base))); - } - - return targetFreq; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_freqme.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_freqme.h deleted file mode 100644 index dd1ee29d668..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_freqme.h +++ /dev/null @@ -1,441 +0,0 @@ -/* - * Copyright 2021-2022 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_FREQME_H_ -#define FSL_FREQME_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup lpc_freqme - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief FREQME driver version 2.1.2. */ -#define FSL_FREQME_DRIVER_VERSION (MAKE_VERSION(2, 1, 2)) -/*! @} */ - -/*! - * @brief The enumeration of interrupt status flags. - * @anchor _freqme_interrupt_status_flags - */ -enum _freqme_interrupt_status_flags -{ - kFREQME_UnderflowInterruptStatusFlag = FREQME_CTRLSTAT_LT_MIN_STAT_MASK, /*!< Indicate the measurement is - just done and the result is less - than minimun value. */ - kFREQME_OverflowInterruptStatusFlag = FREQME_CTRLSTAT_GT_MAX_STAT_MASK, /*!< Indicate the measurement is - just done and the result is greater - than maximum value. */ - kFREQME_ReadyInterruptStatusFlag = FREQME_CTRLSTAT_RESULT_READY_STAT_MASK, /*!< Indicate the measurement is - just done and the result is ready to - read. */ - kFREQME_AllInterruptStatusFlags = FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_GT_MAX_STAT_MASK | - FREQME_CTRLSTAT_RESULT_READY_STAT_MASK, /*!< All interrupt - status flags. */ -}; - -/*! - * @brief The enumeration of interrupts, including underflow interrupt, overflow interrupt, - * and result ready interrupt. - * @anchor _freqme_interrupt_enable - */ -enum _freqme_interrupt_enable -{ - kFREQME_UnderflowInterruptEnable = FREQME_CTRL_W_LT_MIN_INT_EN_MASK, /*!< Enable interrupt when the result is - less than minimum value. */ - kFREQME_OverflowInterruptEnable = FREQME_CTRL_W_GT_MAX_INT_EN_MASK, /*!< Enable interrupt when the result is - greater than maximum value. */ - kFREQME_ReadyInterruptEnable = FREQME_CTRL_W_RESULT_READY_INT_EN_MASK, /*!< Enable interrupt when a - measurement completes and the result - is ready. */ -}; - -/*! - * @brief FREQME module operate mode enumeration, including frequency measurement mode - * and pulse width measurement mode. - */ -typedef enum _freqme_operate_mode -{ - kFREQME_FreqMeasurementMode = 0U, /*!< The module works in the frequency measurement mode. */ - kFREOME_PulseWidthMeasurementMode, /*!< The module works in the pulse width measurement mode. */ -} freqme_operate_mode_t; - -/*! - * @brief The enumeration of pulse polarity. - */ -typedef enum _freqme_pulse_polarity -{ - kFREQME_PulseHighPeriod = 0U, /*!< Select high period of the reference clock. */ - kFREQME_PulseLowPeriod, /*!< Select low period of the reference clock. */ -} freqme_pulse_polarity_t; - -/*! - * @brief The union of operate mode attribute. - * @note If the operate mode is selected as frequency measurement mode the member \b refClkScaleFactor should be used, - * if the operate mode is selected as pulse width measurement mode the member \b pulsePolarity should be used. - */ -typedef union _freqme_mode_attribute -{ - uint8_t refClkScaleFactor; /*!< Only useful in frequency measurement operate mode, - used to set the reference clock counter scaling factor. */ - freqme_pulse_polarity_t pulsePolarity; /*!< Only Useful in pulse width measurement operate mode, - used to set period polarity. */ -} freqme_mode_attribute_t; - -/*! - * @brief The structure of freqme module basic configuration, - * including operate mode, operate mode attribute and so on. - */ -typedef struct _freq_measure_config -{ - freqme_operate_mode_t operateMode; /*!< Select operate mode, please refer to @ref freqme_operate_mode_t. */ - freqme_mode_attribute_t operateModeAttribute; /*!< Used to set the attribute of the selected operate mode, if - the operate mode is selected as @ref kFREQME_FreqMeasurementMode - set freqme_mode_attribute_t::refClkScaleFactor, if operate mode is - selected as @ref kFREOME_PulseWidthMeasurementMode, please set - freqme_mode_attribute_t::pulsePolarity. */ - - bool enableContinuousMode; /*!< Enable/disable continuous mode, if continuous mode is enable, - the measurement is performed continuously and the result for the - last completed measurement is available in the result register. */ - bool startMeasurement; -} freq_measure_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Basic Control APIs - * @{ - */ -/*! - * @brief Initialize freqme module, set operate mode, operate mode attribute and initialize measurement cycle. - * - * @param base FREQME peripheral base address. - * @param config The pointer to module basic configuration, please refer to @ref freq_measure_config_t. - */ -void FREQME_Init(FREQME_Type *base, const freq_measure_config_t *config); - -/*! - * @brief Get default configuration. - * - * @code - * config->operateMode = kFREQME_FreqMeasurementMode; - * config->operateModeAttribute.refClkScaleFactor = 0U; - * config->enableContinuousMode = false; - * config->startMeasurement = false; - * @endcode - * - * @param config The pointer to module basic configuration, please refer to @ref freq_measure_config_t. - */ -void FREQME_GetDefaultConfig(freq_measure_config_t *config); - -/*! - * @brief Start frequency or pulse width measurement process. - * - * @param base FREQME peripheral base address. - */ -static inline void FREQME_StartMeasurementCycle(FREQME_Type *base) -{ - uint32_t tmp32; - - tmp32 = base->CTRLSTAT; - tmp32 &= ~(FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_MEASURE_IN_PROGRESS_MASK | - FREQME_CTRLSTAT_GT_MAX_STAT_MASK | FREQME_CTRLSTAT_RESULT_READY_STAT_MASK); - tmp32 |= FREQME_CTRL_W_MEASURE_IN_PROGRESS_MASK; - base->CTRL_W = tmp32; -} - -/*! - * @brief Force the termination of any measurement cycle currently in progress and resets RESULT or just reset - * RESULT if the module in idle state. - * - * @param base FREQME peripheral base address. - */ -static inline void FREQME_TerminateMeasurementCycle(FREQME_Type *base) -{ - uint32_t tmp32; - - tmp32 = base->CTRLSTAT; - tmp32 &= ~(FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_MEASURE_IN_PROGRESS_MASK | - FREQME_CTRLSTAT_GT_MAX_STAT_MASK | FREQME_CTRLSTAT_RESULT_READY_STAT_MASK); - base->CTRL_W = tmp32; -} - -/*! - * @brief Enable/disable Continuous mode. - * - * @param base FREQME peripheral base address. - * @param enable Used to enable/disable continuous mode, - * - \b true Enable Continuous mode. - * - \b false Disable Continuous mode. - */ -static inline void FREQME_EnableContinuousMode(FREQME_Type *base, bool enable) -{ - uint32_t tmp32; - - tmp32 = base->CTRLSTAT; - tmp32 &= ~(FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_CONTINUOUS_MODE_EN_MASK | - FREQME_CTRLSTAT_GT_MAX_STAT_MASK | FREQME_CTRLSTAT_RESULT_READY_STAT_MASK); - if (enable) - { - tmp32 |= FREQME_CTRL_W_CONTINUOUS_MODE_EN_MASK; - } - - base->CTRL_W = tmp32; -} - -/*! - * @brief Check whether continuous mode is enabled. - * - * @param base FREQME peripheral base address. - * @retval True Continuous mode is enabled, the measurement is performed continuously. - * @retval False Continuous mode is disabled. - */ -static inline bool FREQME_CheckContinuousMode(FREQME_Type *base) -{ - return (bool)((base->CTRLSTAT & FREQME_CTRLSTAT_CONTINUOUS_MODE_EN_MASK) != 0UL); -} - -/*! - * @brief Set operate mode of freqme module. - * - * @param base FREQME peripheral base address. - * @param operateMode The operate mode to be set, please refer to @ref freqme_operate_mode_t. - */ -static inline void FREQME_SetOperateMode(FREQME_Type *base, freqme_operate_mode_t operateMode) -{ - uint32_t tmp32; - - tmp32 = base->CTRLSTAT; - tmp32 &= ~(FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_PULSE_MODE_MASK | - FREQME_CTRLSTAT_GT_MAX_STAT_MASK | FREQME_CTRLSTAT_RESULT_READY_STAT_MASK); - if (operateMode == kFREOME_PulseWidthMeasurementMode) - { - tmp32 |= FREQME_CTRL_W_PULSE_MODE_MASK; - } - - base->CTRL_W = tmp32; -} - -/*! - * @brief Check module's operate mode. - * - * @param base FREQME peripheral base address. - * @retval True Pulse width measurement mode. - * @retval False Frequency measurement mode. - */ -static inline bool FREQME_CheckOperateMode(FREQME_Type *base) -{ - return (bool)((base->CTRLSTAT & FREQME_CTRLSTAT_PULSE_MODE_MASK) != 0UL); - -} - -/*! - * @brief Set the minimum expected value for the measurement result. - * - * @param base FREQME peripheral base address. - * @param minValue The minimum value to set, please note that this value is 31 bits width. - */ -static inline void FREQME_SetMinExpectedValue(FREQME_Type *base, uint32_t minValue) -{ - base->MIN = minValue; -} - -/*! - * @brief Set the maximum expected value for the measurement result. - * - * @param base FREQME peripheral base address. - * @param maxValue The maximum value to set, please note that this value is 31 bits width. - */ -static inline void FREQME_SetMaxExpectedValue(FREQME_Type *base, uint32_t maxValue) -{ - base->MAX = maxValue; -} - -/*! @} */ - -/*! - * @name Frequency Measurement Mode Control APIs - * @{ - */ - -/*! - * @brief Calculate the frequency of selected target clock。 - * - * @note The formula: Ftarget = (RESULT - 2) * Freference / 2 ^ REF_SCALE. - * - * @note This function only useful when the operate mode is selected as frequency measurement mode. - * - * @param base FREQME peripheral base address. - * @param refClkFrequency The frequency of reference clock. - * @return The frequency of target clock the unit is Hz, if the output result is 0, please check the module's - * operate mode. - */ -uint32_t FREQME_CalculateTargetClkFreq(FREQME_Type *base, uint32_t refClkFrequency); - -/*! - * @brief Get reference clock scaling factor. - * - * @param base FREQME peripheral base address. - * @return Reference clock scaling factor, the reference count cycle is 2 ^ ref_scale. - */ -static inline uint8_t FREQME_GetReferenceClkScaleValue(FREQME_Type *base) -{ - return (uint8_t)(base->CTRLSTAT & FREQME_CTRLSTAT_REF_SCALE_MASK); -} - -/*! @} */ - -/*! - * @name Pulse Width Measurement Mode Control APIs - * @{ - */ - -/*! - * @brief Set pulse polarity when operate mode is selected as Pulse Width Measurement mode. - * - * @param base FREQME peripheral base address. - * @param pulsePolarity The pulse polarity to be set, please refer to @ref freqme_pulse_polarity_t. - */ -static inline void FREQME_SetPulsePolarity(FREQME_Type *base, freqme_pulse_polarity_t pulsePolarity) -{ - uint32_t tmp32; - - tmp32 = base->CTRLSTAT; - tmp32 &= ~(FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_PULSE_POL_MASK | - FREQME_CTRLSTAT_GT_MAX_STAT_MASK | FREQME_CTRLSTAT_RESULT_READY_STAT_MASK); - - if (pulsePolarity != kFREQME_PulseHighPeriod) - { - tmp32 |= FREQME_CTRL_W_PULSE_POL_MASK; - } - - base->CTRL_W = tmp32; -} - -/*! - * @brief Check pulse polarity when the operate mode is selected as pulse width measurement mode. - * - * @param base FREQME peripheral base address. - * @retval True Low period. - * @retval False High period. - */ -static inline bool FREQME_CheckPulsePolarity(FREQME_Type *base) -{ - return (bool)((base->CTRLSTAT & FREQME_CTRLSTAT_PULSE_POL_MASK) != 0UL); -} - -/*! - * @brief Get measurement result, if operate mode is selected as pulse width measurement mode this function can - * be used to calculate pulse width. - * - * @note Pulse width = counter result / Frequency of target clock. - * - * @param base FREQME peripheral base address. - * @return Measurement result. - */ -static inline uint32_t FREQME_GetMeasurementResult(FREQME_Type *base) -{ - return base->CTRL_R & FREQME_CTRL_R_RESULT_MASK; -} - -/*! @} */ - -/*! - * @name Status Control APIs - * @{ - */ - -/*! - * @brief Get interrupt status flags, such as overflow interrupt status flag, - * underflow interrupt status flag, and so on. - * - * @param base FREQME peripheral base address. - * @return Current interrupt status flags, should be the OR'ed value of @ref _freqme_interrupt_status_flags. - */ -static inline uint32_t FREQME_GetInterruptStatusFlags(FREQME_Type *base) -{ - return (base->CTRLSTAT & (uint32_t)kFREQME_AllInterruptStatusFlags); -} - -/*! - * @brief Clear interrupt status flags. - * - * @param base FREQME peripheral base address. - * @param statusFlags The combination of interrupt status flags to clear, - * should be the OR'ed value of @ref _freqme_interrupt_status_flags. - */ -static inline void FREQME_ClearInterruptStatusFlags(FREQME_Type *base, uint32_t statusFlags) -{ - base->CTRLSTAT |= statusFlags; -} - -/*! @} */ - -/*! - * @name Interrupt Control APIs - * @{ - */ - -/*! - * @brief Enable interrupts, such as result ready interrupt, overflow interrupt and so on. - * - * @param base FREQME peripheral base address. - * @param masks The mask of interrupts to enable, should be the OR'ed value of @ref _freqme_interrupt_enable. - */ -static inline void FREQME_EnableInterrupts(FREQME_Type *base, uint32_t masks) -{ - uint32_t tmp32; - - tmp32 = base->CTRLSTAT; - tmp32 &= ~(FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_LT_MIN_INT_EN_MASK | - FREQME_CTRLSTAT_GT_MAX_STAT_MASK | FREQME_CTRLSTAT_GT_MAX_INT_EN_MASK | - FREQME_CTRLSTAT_RESULT_READY_INT_EN_MASK | FREQME_CTRLSTAT_RESULT_READY_STAT_MASK); - - tmp32 |= masks; - base->CTRL_W = tmp32; -} - -/*! - * @brief Disable interrupts, such as result ready interrupt, overflow interrupt and so on. - * - * @param base FREQME peripheral base address. - * @param masks The mask of interrupts to disable, should be the OR'ed value of @ref _freqme_interrupt_enable. - */ -static inline void FREQME_DisableInterrupts(FREQME_Type *base, uint32_t masks) -{ - uint32_t tmp32; - - tmp32 = base->CTRLSTAT; - tmp32 &= ~(FREQME_CTRLSTAT_LT_MIN_STAT_MASK | FREQME_CTRLSTAT_GT_MAX_STAT_MASK | - FREQME_CTRLSTAT_RESULT_READY_STAT_MASK | masks); - - base->CTRL_W = tmp32; -} - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ -#endif /* FSL_FREQME_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_gdet.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_gdet.c deleted file mode 100644 index 25a44ee9189..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_gdet.c +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_gdet.h" - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.gdet" -#endif - -#define ISOLATE_ON (0x2u << 2) -#define ISOLATE_OFF (0x0u << 2) - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * Weak implementation of GDET IRQ, should be re-defined by user when using GDET IRQ - */ -__WEAK void GDET_DriverIRQHandler(void) -{ - /* GDET generates IRQ if voltage glitching is detected - */ -} - -/*! - * brief Initialize GDET - * - * This function initializes GDET setting and enable interrupts. - * - * param base GDET peripheral base address - * return Status of the init operation - */ -status_t GDET_Init(GDET_Type *base) -{ - /* Ungate clock to GDET engine and reset it */ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_EnableClock(kCLOCK_Gdet); -#endif /* !FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - NVIC_EnableIRQ(GDET_IRQn); - - return kStatus_Success; -} - -/*! - * brief Deinitialize GDET - * - * This function stops GDET glitch detector. - * - * param base GDET peripheral base address - */ -void GDET_Deinit(GDET_Type *base) -{ - NVIC_DisableIRQ(GDET_IRQn); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - - CLOCK_DisableClock(kCLOCK_Gdet); -#endif /* !FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/* Array of GDET peripheral base address. */ -static GDET_Type *const s_gdetBases[] = GDET_BASE_PTRS; - -/*! - * brief Get the GDET instance from peripheral base address. - * - * param base GDET peripheral base address. - * return GDET instance. - */ -static uint32_t GDET_GetInstance(GDET_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0U; instance < ARRAY_SIZE(s_gdetBases); instance++) - { - if (s_gdetBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_gdetBases)); - - return instance; -} - -status_t GDET_IsolateOn(GDET_Type *base) -{ - status_t status = kStatus_Fail; - uint32_t instance; - - instance = GDET_GetInstance(base); - - SYSCON->GDET_CTRL[instance] = ISOLATE_ON; - - if (ISOLATE_ON != SYSCON->GDET_CTRL[instance]) - { - return kStatus_Fail; - } - status = kStatus_Success; - - return status; -} - -status_t GDET_IsolateOff(GDET_Type *base) -{ - status_t status = kStatus_Fail; - uint32_t instance; - - instance = GDET_GetInstance(base); - - SYSCON->GDET_CTRL[instance] = ISOLATE_ON; - - if (ISOLATE_ON != SYSCON->GDET_CTRL[instance]) - { - return kStatus_Fail; - } - status = kStatus_Success; - - return status; -} - -status_t GDET_ReconfigureVoltageMode(GDET_Type *base, gdet_core_voltage_t voltage) -{ - uint32_t tmp0 = 0; - status_t status = kStatus_Fail; - - if ((voltage != kGDET_MidVoltage) && (voltage != kGDET_NormalVoltage) && (voltage != kGDET_OverDriveVoltage)) - { - return kStatus_InvalidArgument; - } - - /*Change the GDET_DLY_CTRL to select the new drive mode (and set high also GDET_DLY_CTRL[SW_VOL_CTRL] for a SW - * control)*/ - tmp0 = (((uint32_t)voltage) << GDET_GDET_DLY_CTRL_VOL_SEL_SHIFT); - tmp0 |= GDET_GDET_DLY_CTRL_SW_VOL_CTRL_MASK; - base->GDET_DLY_CTRL = tmp0; - - /*Write high the GDET_RESET[SFT_RST] to issue a fast update of the detector to the new voltage level.*/ - base->GDET_RESET = GDET_GDET_RESET_SFT_RST(1u); - - /* according to the GDET module documentation, the GDET_CFG[SFT_RST] reads as 0 */ - if (0u == (GDET_GDET_RESET_SFT_RST_MASK & base->GDET_RESET)) - { - status = kStatus_Success; - } - - return status; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_gdet.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_gdet.h deleted file mode 100644 index ec206454316..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_gdet.h +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_GDET_H_ -#define FSL_GDET_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup GDET - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief Defines GDET driver version 2.0.0. - * - * Change log: - * - Version 2.0.0 - * - initial version - */ -#define FSL_GDET_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) -/*! @} */ - -/*! - * @brief GDET Core Voltage. - * - * These constants are used to define core voltage argument to be used with - * GDET_ReconfigureVoltageMode(). - */ - -typedef uint32_t gdet_core_voltage_t; -#define kGDET_MidVoltage ((gdet_core_voltage_t)0x0u) /*!< Mid Voltage (1.0V) */ -#define kGDET_NormalVoltage ((gdet_core_voltage_t)0x1u) /*!< Normal Voltage (1.1V) */ -#define kGDET_OverDriveVoltage ((gdet_core_voltage_t)0x2u) /*!< Over Drive Voltage (1.2V) */ - -/******************************************************************************* - * API - *******************************************************************************/ - -extern void GDET_DriverIRQHandler(void); - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name GDET Functional Operation - * @{ - */ - -/*! - * @brief Initialize GDET - * - * This function initializes GDET block and setting. - * - * @param base GDET peripheral base address - * @return Status of the init operation - */ -status_t GDET_Init(GDET_Type *base); - -/*! - * @brief Deinitialize GDET - * - * This function deinitializes GDET secure counter. - * - * @param base GDET peripheral base address - */ -void GDET_Deinit(GDET_Type *base); -/*! - * @brief Turn on GDET isolation - * - * This function turns on isolation of GDET peripheral - * - * @param base GDET peripheral base address - */ -status_t GDET_IsolateOn(GDET_Type *base); - -/*! - * @brief Turn off GDET isolation - * - * This function turns off isolation of GDET peripheral - * - * @param base GDET peripheral base address - */ -status_t GDET_IsolateOff(GDET_Type *base); - -/*! - * @brief Change expected core voltage - * - * This function changes core voltage which Glitch detector expect. - * - * @param base GDET peripheral base address - * @param voltage Expected core voltage - * @return Status of the GDET reconfiguration operation - */ -status_t GDET_ReconfigureVoltageMode(GDET_Type *base, gdet_core_voltage_t voltage); - -/*! @}*/ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @}*/ /* end of group gdet */ - -#endif /* FSL_GDET_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_gpio.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_gpio.c deleted file mode 100644 index 3e32730d1cd..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_gpio.c +++ /dev/null @@ -1,444 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2019, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_gpio.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.gpio" -#endif - -#if defined(GPIO_RSTS) -#define GPIO_RESETS_ARRAY GPIO_RSTS -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ - -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -static PORT_Type *const s_portBases[] = PORT_BASE_PTRS; -static GPIO_Type *const s_gpioBases[] = GPIO_BASE_PTRS; -#else -#if defined(GPIO_RESETS_ARRAY) -static GPIO_Type *const s_gpioBases[] = GPIO_BASE_PTRS; -#endif -#endif - -#if defined(FSL_FEATURE_SOC_FGPIO_COUNT) && FSL_FEATURE_SOC_FGPIO_COUNT - -#if defined(FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL) && FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Array to map FGPIO instance number to clock name. */ -static const clock_ip_name_t s_fgpioClockName[] = FGPIO_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#endif /* FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL */ - -#endif /* FSL_FEATURE_SOC_FGPIO_COUNT */ - -#if defined(GPIO_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_gpioResets[] = GPIO_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -/*! - * @brief Gets the GPIO instance according to the GPIO base - * - * @param base GPIO peripheral base pointer(PTA, PTB, PTC, etc.) - * @retval GPIO instance - */ -static uint32_t GPIO_GetInstance(GPIO_Type *base); -#endif -/******************************************************************************* - * Code - ******************************************************************************/ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) || defined(GPIO_RESETS_ARRAY) -static uint32_t GPIO_GetInstance(GPIO_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_gpioBases); instance++) - { - if (s_gpioBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_gpioBases)); - - return instance; -} -#endif -/*! - * brief Initializes a GPIO pin used by the board. - * - * To initialize the GPIO, define a pin configuration, as either input or output, in the user file. - * Then, call the GPIO_PinInit() function. - * - * This is an example to define an input pin or an output pin configuration. - * code - * Define a digital input pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalInput, - * 0, - * } - * Define a digital output pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalOutput, - * 0, - * } - * endcode - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * param pin GPIO port pin number - * param config GPIO pin configuration pointer - */ -void GPIO_PinInit(GPIO_Type *base, uint32_t pin, const gpio_pin_config_t *config) -{ - assert(NULL != config); - -#if defined(GPIO_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_gpioResets[GPIO_GetInstance(base)]); -#endif - - if (config->pinDirection == kGPIO_DigitalInput) - { - base->PDDR &= GPIO_FIT_REG(~(1UL << pin)); - } - else - { - GPIO_PinWrite(base, pin, config->outputLogic); - base->PDDR |= GPIO_FIT_REG((1UL << pin)); - } -} - -#if defined(FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER) && FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER -void GPIO_GetVersionInfo(GPIO_Type *base, gpio_version_info_t *info) -{ - info->feature = (uint16_t)base->VERID; - info->minor = (uint8_t)(base->VERID >> GPIO_VERID_MINOR_SHIFT); - info->major = (uint8_t)(base->VERID >> GPIO_VERID_MAJOR_SHIFT); -} -#endif /* FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER */ - -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -/*! - * brief Reads the GPIO port interrupt status flag. - * - * If a pin is configured to generate the DMA request, the corresponding flag - * is cleared automatically at the completion of the requested DMA transfer. - * Otherwise, the flag remains set until a logic one is written to that flag. - * If configured for a level sensitive interrupt that remains asserted, the flag - * is set again immediately. - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * retval The current GPIO port interrupt status flag, for example, 0x00010001 means the - * pin 0 and 17 have the interrupt. - */ -uint32_t GPIO_PortGetInterruptFlags(GPIO_Type *base) -{ - uint8_t instance; - PORT_Type *portBase; - instance = (uint8_t)GPIO_GetInstance(base); - portBase = s_portBases[instance]; - return portBase->ISFR; -} -#else -/*! - * brief Read the GPIO interrupt status flags. - * - * param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on.) - * return The current GPIO's interrupt status flag. - * '1' means the related pin's flag is set, '0' means the related pin's flag not set. - * For example, the return value 0x00010001 means the pin 0 and 17 have the interrupt pending. - */ -uint32_t GPIO_GpioGetInterruptFlags(GPIO_Type *base) -{ - return base->ISFR[0]; -} -#if (defined(FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) && FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) -/*! - * brief Read the GPIO interrupt status flags based on selected interrupt channel(IRQS). - * param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on.) - * param channel '0' means selete interrupt channel 0, '1' means selete interrupt channel 1. - * - * return The current GPIO's interrupt status flag based on the selected interrupt channel. - * '1' means the related pin's flag is set, '0' means the related pin's flag not set. - * For example, the return value 0x00010001 means the pin 0 and 17 have the interrupt pending. - */ -uint32_t GPIO_GpioGetInterruptChannelFlags(GPIO_Type *base, uint32_t channel) -{ - assert(channel < 2U); - return base->ISFR[channel]; -} -#endif /* FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT */ -/*! - * brief Read individual pin's interrupt status flag. - * - * param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on) - * param pin GPIO specific pin number. - * return The current selected pin's interrupt status flag. - */ -uint8_t GPIO_PinGetInterruptFlag(GPIO_Type *base, uint32_t pin) -{ - return (uint8_t)((base->ICR[pin] & GPIO_ICR_ISF_MASK) >> GPIO_ICR_ISF_SHIFT); -} -#endif /* FSL_FEATURE_PORT_HAS_NO_INTERRUPT */ - -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -/*! - * brief Clears multiple GPIO pin interrupt status flags. - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * param mask GPIO pin number macro - */ -void GPIO_PortClearInterruptFlags(GPIO_Type *base, uint32_t mask) -{ - uint8_t instance; - PORT_Type *portBase; - instance = (uint8_t)GPIO_GetInstance(base); - portBase = s_portBases[instance]; - portBase->ISFR = mask; -} -#else -/*! - * brief Clears GPIO pin interrupt status flags. - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * param mask GPIO pin number macro - */ -void GPIO_GpioClearInterruptFlags(GPIO_Type *base, uint32_t mask) -{ - base->ISFR[0] = GPIO_FIT_REG(mask); -} -#if (defined(FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) && FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) -/*! - * brief Clears GPIO pin interrupt status flags based on selected interrupt channel(IRQS). - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * param mask GPIO pin number macro - * param channel '0' means selete interrupt channel 0, '1' means selete interrupt channel 1. - */ -void GPIO_GpioClearInterruptChannelFlags(GPIO_Type *base, uint32_t mask, uint32_t channel) -{ - assert(channel < 2U); - base->ISFR[channel] = GPIO_FIT_REG(mask); -} -#endif /* FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT */ -/*! - * brief Clear GPIO individual pin's interrupt status flag. - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on). - * param pin GPIO specific pin number. - */ -void GPIO_PinClearInterruptFlag(GPIO_Type *base, uint32_t pin) -{ - base->ICR[pin] |= GPIO_FIT_REG(GPIO_ICR_ISF(1U)); -} -#endif /* FSL_FEATURE_PORT_HAS_NO_INTERRUPT */ - -#if defined(FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER) && FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER -/*! - * brief The GPIO module supports a device-specific number of data ports, organized as 32-bit - * words/8-bit Bytes. Each 32-bit/8-bit data port includes a GACR register, which defines the byte-level - * attributes required for a successful access to the GPIO programming model. If the GPIO module's GACR register - * organized as 32-bit words, the attribute controls for the 4 data bytes in the GACR follow a standard little - * endian data convention. - * - * param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * param attribute GPIO checker attribute - */ -void GPIO_CheckAttributeBytes(GPIO_Type *base, gpio_checker_attribute_t attribute) -{ -#if defined(FSL_FEATURE_GPIO_REGISTERS_WIDTH) && (FSL_FEATURE_GPIO_REGISTERS_WIDTH == 8U) - base->GACR = ((uint8_t)attribute << GPIO_GACR_ACB_SHIFT); -#else - base->GACR = ((uint32_t)attribute << GPIO_GACR_ACB0_SHIFT) | ((uint32_t)attribute << GPIO_GACR_ACB1_SHIFT) | - ((uint32_t)attribute << GPIO_GACR_ACB2_SHIFT) | ((uint32_t)attribute << GPIO_GACR_ACB3_SHIFT); -#endif /* FSL_FEATURE_GPIO_REGISTERS_WIDTH */ -} -#endif - -#if defined(FSL_FEATURE_SOC_FGPIO_COUNT) && FSL_FEATURE_SOC_FGPIO_COUNT - -/******************************************************************************* - * Variables - ******************************************************************************/ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -static FGPIO_Type *const s_fgpioBases[] = FGPIO_BASE_PTRS; -#endif -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -/*! - * @brief Gets the FGPIO instance according to the GPIO base - * - * @param base FGPIO peripheral base pointer(PTA, PTB, PTC, etc.) - * @retval FGPIO instance - */ -static uint32_t FGPIO_GetInstance(FGPIO_Type *base); -#endif -/******************************************************************************* - * Code - ******************************************************************************/ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -static uint32_t FGPIO_GetInstance(FGPIO_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_fgpioBases); instance++) - { - if (s_fgpioBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_fgpioBases)); - - return instance; -} -#endif -#if defined(FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL) && FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL -/*! - * brief Initializes the FGPIO peripheral. - * - * This function ungates the FGPIO clock. - * - * param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - */ -void FGPIO_PortInit(FGPIO_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate FGPIO periphral clock */ - CLOCK_EnableClock(s_fgpioClockName[FGPIO_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} -#endif /* FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL */ - -/*! - * brief Initializes a FGPIO pin used by the board. - * - * To initialize the FGPIO driver, define a pin configuration, as either input or output, in the user file. - * Then, call the FGPIO_PinInit() function. - * - * This is an example to define an input pin or an output pin configuration: - * code - * Define a digital input pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalInput, - * 0, - * } - * Define a digital output pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalOutput, - * 0, - * } - * endcode - * - * param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * param pin FGPIO port pin number - * param config FGPIO pin configuration pointer - */ -void FGPIO_PinInit(FGPIO_Type *base, uint32_t pin, const gpio_pin_config_t *config) -{ - assert(NULL != config); - - if (config->pinDirection == kGPIO_DigitalInput) - { - base->PDDR &= ~(1UL << pin); - } - else - { - FGPIO_PinWrite(base, pin, config->outputLogic); - base->PDDR |= (1UL << pin); - } -} -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -/*! - * brief Reads the FGPIO port interrupt status flag. - * - * If a pin is configured to generate the DMA request, the corresponding flag - * is cleared automatically at the completion of the requested DMA transfer. - * Otherwise, the flag remains set until a logic one is written to that flag. - * If configured for a level-sensitive interrupt that remains asserted, the flag - * is set again immediately. - * - * param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * retval The current FGPIO port interrupt status flags, for example, 0x00010001 means the - * pin 0 and 17 have the interrupt. - */ -uint32_t FGPIO_PortGetInterruptFlags(FGPIO_Type *base) -{ - uint8_t instance; - instance = (uint8_t)FGPIO_GetInstance(base); - PORT_Type *portBase; - portBase = s_portBases[instance]; - return portBase->ISFR; -} - -/*! - * brief Clears the multiple FGPIO pin interrupt status flag. - * - * param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * param mask FGPIO pin number macro - */ -void FGPIO_PortClearInterruptFlags(FGPIO_Type *base, uint32_t mask) -{ - uint8_t instance; - instance = (uint8_t)FGPIO_GetInstance(base); - PORT_Type *portBase; - portBase = s_portBases[instance]; - portBase->ISFR = mask; -} -#endif -#if defined(FSL_FEATURE_FGPIO_HAS_ATTRIBUTE_CHECKER) && FSL_FEATURE_FGPIO_HAS_ATTRIBUTE_CHECKER -/*! - * brief The FGPIO module supports a device-specific number of data ports, organized as 32-bit - * words. Each 32-bit data port includes a GACR register, which defines the byte-level - * attributes required for a successful access to the GPIO programming model. The attribute controls for the 4 data - * bytes in the GACR follow a standard little endian - * data convention. - * - * param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * param attribute FGPIO checker attribute - */ -void FGPIO_CheckAttributeBytes(FGPIO_Type *base, gpio_checker_attribute_t attribute) -{ - base->GACR = ((uint32_t)attribute << FGPIO_GACR_ACB0_SHIFT) | ((uint32_t)attribute << FGPIO_GACR_ACB1_SHIFT) | - ((uint32_t)attribute << FGPIO_GACR_ACB2_SHIFT) | ((uint32_t)attribute << FGPIO_GACR_ACB3_SHIFT); -} -#endif - -#endif /* FSL_FEATURE_SOC_FGPIO_COUNT */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_gpio.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_gpio.h deleted file mode 100644 index a91fa403efd..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_gpio.h +++ /dev/null @@ -1,799 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_GPIO_H_ -#define FSL_GPIO_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup gpio - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief GPIO driver version. */ -#define FSL_GPIO_DRIVER_VERSION (MAKE_VERSION(2, 7, 3)) -/*! @} */ - -#if defined(FSL_FEATURE_GPIO_REGISTERS_WIDTH) && (FSL_FEATURE_GPIO_REGISTERS_WIDTH == 8U) -#define GPIO_FIT_REG(value) \ - ((uint8_t)(value)) /*!< For some platforms with 8-bit register width, cast the type to uint8_t */ -#else -#define GPIO_FIT_REG(value) ((uint32_t)(value)) -#endif /*FSL_FEATURE_GPIO_REGISTERS_WIDTH*/ - -/*! @brief GPIO direction definition */ -typedef enum _gpio_pin_direction -{ - kGPIO_DigitalInput = 0U, /*!< Set current pin as digital input*/ - kGPIO_DigitalOutput = 1U, /*!< Set current pin as digital output*/ -} gpio_pin_direction_t; - -#if defined(FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER) && FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER -/*! @brief GPIO checker attribute */ -typedef enum _gpio_checker_attribute -{ - kGPIO_UsernonsecureRWUsersecureRWPrivilegedsecureRW = - 0x00U, /*!< User nonsecure:Read+Write; User Secure:Read+Write; Privileged Secure:Read+Write */ - kGPIO_UsernonsecureRUsersecureRWPrivilegedsecureRW = - 0x01U, /*!< User nonsecure:Read; User Secure:Read+Write; Privileged Secure:Read+Write */ - kGPIO_UsernonsecureNUsersecureRWPrivilegedsecureRW = - 0x02U, /*!< User nonsecure:None; User Secure:Read+Write; Privileged Secure:Read+Write */ - kGPIO_UsernonsecureRUsersecureRPrivilegedsecureRW = - 0x03U, /*!< User nonsecure:Read; User Secure:Read; Privileged Secure:Read+Write */ - kGPIO_UsernonsecureNUsersecureRPrivilegedsecureRW = - 0x04U, /*!< User nonsecure:None; User Secure:Read; Privileged Secure:Read+Write */ - kGPIO_UsernonsecureNUsersecureNPrivilegedsecureRW = - 0x05U, /*!< User nonsecure:None; User Secure:None; Privileged Secure:Read+Write */ - kGPIO_UsernonsecureNUsersecureNPrivilegedsecureR = - 0x06U, /*!< User nonsecure:None; User Secure:None; Privileged Secure:Read */ - kGPIO_UsernonsecureNUsersecureNPrivilegedsecureN = - 0x07U, /*!< User nonsecure:None; User Secure:None; Privileged Secure:None */ - kGPIO_IgnoreAttributeCheck = 0x80U, /*!< Ignores the attribute check */ -} gpio_checker_attribute_t; -#endif - -/*! - * @brief The GPIO pin configuration structure. - * - * Each pin can only be configured as either an output pin or an input pin at a time. - * If configured as an input pin, leave the outputConfig unused. - * Note that in some use cases, the corresponding port property should be configured in advance - * with the PORT_SetPinConfig(). - */ -typedef struct _gpio_pin_config -{ - gpio_pin_direction_t pinDirection; /*!< GPIO direction, input or output */ - /* Output configurations; ignore if configured as an input pin */ - uint8_t outputLogic; /*!< Set a default output logic, which has no use in input */ -} gpio_pin_config_t; - -#if (defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) || \ - !(defined(FSL_FEATURE_SOC_PORT_COUNT)) -/*! @brief Configures the interrupt generation condition. */ -typedef enum _gpio_interrupt_config -{ - kGPIO_InterruptStatusFlagDisabled = 0x0U, /*!< Interrupt status flag is disabled. */ - kGPIO_DMARisingEdge = 0x1U, /*!< ISF flag and DMA request on rising edge. */ - kGPIO_DMAFallingEdge = 0x2U, /*!< ISF flag and DMA request on falling edge. */ - kGPIO_DMAEitherEdge = 0x3U, /*!< ISF flag and DMA request on either edge. */ - kGPIO_FlagRisingEdge = 0x05U, /*!< Flag sets on rising edge. */ - kGPIO_FlagFallingEdge = 0x06U, /*!< Flag sets on falling edge. */ - kGPIO_FlagEitherEdge = 0x07U, /*!< Flag sets on either edge. */ - kGPIO_InterruptLogicZero = 0x8U, /*!< Interrupt when logic zero. */ - kGPIO_InterruptRisingEdge = 0x9U, /*!< Interrupt on rising edge. */ - kGPIO_InterruptFallingEdge = 0xAU, /*!< Interrupt on falling edge. */ - kGPIO_InterruptEitherEdge = 0xBU, /*!< Interrupt on either edge. */ - kGPIO_InterruptLogicOne = 0xCU, /*!< Interrupt when logic one. */ - kGPIO_ActiveHighTriggerOutputEnable = 0xDU, /*!< Enable active high-trigger output. */ - kGPIO_ActiveLowTriggerOutputEnable = 0xEU, /*!< Enable active low-trigger output. */ -} gpio_interrupt_config_t; -#endif - -#if (defined(FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) && FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) -/*! @brief Configures the selection of interrupt/DMA request/trigger output. */ -typedef enum _gpio_interrupt_selection -{ - kGPIO_InterruptOutput0 = 0x0U, /*!< Interrupt/DMA request/trigger output 0. */ - kGPIO_InterruptOutput1 = 0x1U, /*!< Interrupt/DMA request/trigger output 1. */ -} gpio_interrupt_selection_t; -#endif /* FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT */ - -#if defined(FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER) && FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER -/*! @brief GPIO version information. */ -typedef struct _gpio_version_info -{ - uint16_t feature; /*!< Feature Specification Number. */ - uint8_t minor; /*!< Minor Version Number. */ - uint8_t major; /*!< Major Version Number. */ -} gpio_version_info_t; -#endif /* FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER */ - -#if defined(FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL) && FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL -/*! @brief GPIO pin and interrupt control. */ -typedef enum -{ - kGPIO_PinControlNonSecure = 0x01U, /*!< Pin Control Non-Secure. */ - kGPIO_InterruptControlNonSecure = 0x02U, /*!< Interrupt Control Non-Secure. */ - kGPIO_PinControlNonPrivilege = 0x04U, /*!< Pin Control Non-Privilege. */ - kGPIO_InterruptControlNonPrivilege = 0x08U, /*!< Interrupt Control Non-Privilege. */ -} gpio_pin_interrupt_control_t; -#endif /* FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL */ - -/*! @} */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @addtogroup gpio_driver - * @{ - */ - -/*! @name GPIO Configuration */ -/*! @{ */ - -/*! - * @brief Initializes a GPIO pin used by the board. - * - * To initialize the GPIO, define a pin configuration, as either input or output, in the user file. - * Then, call the GPIO_PinInit() function. - * - * This is an example to define an input pin or an output pin configuration. - * @code - * Define a digital input pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalInput, - * 0, - * } - * Define a digital output pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalOutput, - * 0, - * } - * @endcode - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param pin GPIO port pin number - * @param config GPIO pin configuration pointer - */ -void GPIO_PinInit(GPIO_Type *base, uint32_t pin, const gpio_pin_config_t *config); - -#if defined(FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER) && FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER -/*! - * @brief Get GPIO version information. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param info GPIO version information - */ -void GPIO_GetVersionInfo(GPIO_Type *base, gpio_version_info_t *info); -#endif /* FSL_FEATURE_GPIO_HAS_VERSION_INFO_REGISTER */ - -#if defined(FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL) && FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL -/*! - * @brief lock or unlock secure privilege. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask pin or interrupt macro - */ -static inline void GPIO_SecurePrivilegeLock(GPIO_Type *base, gpio_pin_interrupt_control_t mask) -{ - base->LOCK |= GPIO_FIT_REG(mask); -} - -/*! - * @brief Enable Pin Control Non-Secure. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_EnablePinControlNonSecure(GPIO_Type *base, uint32_t mask) -{ - base->PCNS |= GPIO_FIT_REG(mask); -} - -/*! - * @brief Disable Pin Control Non-Secure. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_DisablePinControlNonSecure(GPIO_Type *base, uint32_t mask) -{ - base->PCNS &= GPIO_FIT_REG(~mask); -} - -/*! - * @brief Enable Pin Control Non-Privilege. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_EnablePinControlNonPrivilege(GPIO_Type *base, uint32_t mask) -{ - base->PCNP |= GPIO_FIT_REG(mask); -} - -/*! - * @brief Disable Pin Control Non-Privilege. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_DisablePinControlNonPrivilege(GPIO_Type *base, uint32_t mask) -{ - base->PCNP &= GPIO_FIT_REG(~mask); -} - -/*! - * @brief Enable Interrupt Control Non-Secure. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_EnableInterruptControlNonSecure(GPIO_Type *base, uint32_t mask) -{ - base->ICNS |= GPIO_FIT_REG(mask); -} - -/*! - * @brief Disable Interrupt Control Non-Secure. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_DisableInterruptControlNonSecure(GPIO_Type *base, uint32_t mask) -{ - base->ICNS &= GPIO_FIT_REG(~mask); -} - -/*! - * @brief Enable Interrupt Control Non-Privilege. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_EnableInterruptControlNonPrivilege(GPIO_Type *base, uint32_t mask) -{ - base->ICNP |= GPIO_FIT_REG(mask); -} - -/*! - * @brief Disable Interrupt Control Non-Privilege. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_DisableInterruptControlNonPrivilege(GPIO_Type *base, uint32_t mask) -{ - base->ICNP &= GPIO_FIT_REG(~mask); -} -#endif /* FSL_FEATURE_GPIO_HAS_SECURE_PRIVILEGE_CONTROL */ - -#if defined(FSL_FEATURE_GPIO_HAS_PORT_INPUT_CONTROL) && FSL_FEATURE_GPIO_HAS_PORT_INPUT_CONTROL -/*! - * @brief Enable port input. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_PortInputEnable(GPIO_Type *base, uint32_t mask) -{ - base->PIDR &= GPIO_FIT_REG(~mask); -} - -/*! - * @brief Disable port input. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_PortInputDisable(GPIO_Type *base, uint32_t mask) -{ - base->PIDR |= GPIO_FIT_REG(mask); -} -#endif /* FSL_FEATURE_GPIO_HAS_PORT_INPUT_CONTROL */ - -/*! @} */ - -/*! @name GPIO Output Operations */ -/*! @{ */ - -/*! - * @brief Sets the output level of the multiple GPIO pins to the logic 1 or 0. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param pin GPIO pin number - * @param output GPIO pin output logic level. - * - 0: corresponding pin output low-logic level. - * - 1: corresponding pin output high-logic level. - */ -static inline void GPIO_PinWrite(GPIO_Type *base, uint32_t pin, uint8_t output) -{ -#if !(defined(FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) && FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) - if (output == 0U) - { - base->PCOR = GPIO_FIT_REG(1UL << pin); - } - else - { - base->PSOR = GPIO_FIT_REG(1UL << pin); - } -#else - if (output == 0U) - { - base->PDOR |= GPIO_FIT_REG(1UL << pin); - } - else - { - base->PDOR &= ~GPIO_FIT_REG(1UL << pin); - } -#endif -} - -/*! - * @brief Sets the output level of the multiple GPIO pins to the logic 1. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_PortSet(GPIO_Type *base, uint32_t mask) -{ -#if !(defined(FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) && FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) - base->PSOR = GPIO_FIT_REG(mask); -#else - base->PDOR |= GPIO_FIT_REG(mask); -#endif -} - -/*! - * @brief Sets the output level of the multiple GPIO pins to the logic 0. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_PortClear(GPIO_Type *base, uint32_t mask) -{ -#if !(defined(FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) && FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) - base->PCOR = GPIO_FIT_REG(mask); -#else - base->PDOR &= ~GPIO_FIT_REG(mask); -#endif -} - -/*! - * @brief Reverses the current output logic of the multiple GPIO pins. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -static inline void GPIO_PortToggle(GPIO_Type *base, uint32_t mask) -{ -#if !(defined(FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) && FSL_FEATURE_GPIO_HAS_NO_INDEP_OUTPUT_CONTROL) - base->PTOR = GPIO_FIT_REG(mask); -#else - base->PDOR ^= GPIO_FIT_REG(mask); -#endif -} - -/*! @} */ - -/*! @name GPIO Input Operations */ -/*! @{ */ - -/*! - * @brief Reads the current input value of the GPIO port. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param pin GPIO pin number - * @retval GPIO port input value - * - 0: corresponding pin input low-logic level. - * - 1: corresponding pin input high-logic level. - */ -static inline uint32_t GPIO_PinRead(GPIO_Type *base, uint32_t pin) -{ - return (((uint32_t)(base->PDIR) >> pin) & 0x01UL); -} - -/*! @} */ - -/*! @name GPIO Interrupt */ -/*! @{ */ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) -/*! - * @brief Reads the GPIO port interrupt status flag. - * - * If a pin is configured to generate the DMA request, the corresponding flag - * is cleared automatically at the completion of the requested DMA transfer. - * Otherwise, the flag remains set until a logic one is written to that flag. - * If configured for a level sensitive interrupt that remains asserted, the flag - * is set again immediately. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @retval The current GPIO port interrupt status flag, for example, 0x00010001 means the - * pin 0 and 17 have the interrupt. - */ -uint32_t GPIO_PortGetInterruptFlags(GPIO_Type *base); - -/*! - * @brief Clears multiple GPIO pin interrupt status flags. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -void GPIO_PortClearInterruptFlags(GPIO_Type *base, uint32_t mask); -#else -/*! - * @brief Configures the gpio pin interrupt/DMA request. - * - * @param base GPIO peripheral base pointer. - * @param pin GPIO pin number. - * @param config GPIO pin interrupt configuration. - * - #kGPIO_InterruptStatusFlagDisabled: Interrupt/DMA request disabled. - * - #kGPIO_DMARisingEdge : DMA request on rising edge(if the DMA requests exit). - * - #kGPIO_DMAFallingEdge: DMA request on falling edge(if the DMA requests exit). - * - #kGPIO_DMAEitherEdge : DMA request on either edge(if the DMA requests exit). - * - #kGPIO_FlagRisingEdge : Flag sets on rising edge(if the Flag states exit). - * - #kGPIO_FlagFallingEdge : Flag sets on falling edge(if the Flag states exit). - * - #kGPIO_FlagEitherEdge : Flag sets on either edge(if the Flag states exit). - * - #kGPIO_InterruptLogicZero : Interrupt when logic zero. - * - #kGPIO_InterruptRisingEdge : Interrupt on rising edge. - * - #kGPIO_InterruptFallingEdge: Interrupt on falling edge. - * - #kGPIO_InterruptEitherEdge : Interrupt on either edge. - * - #kGPIO_InterruptLogicOne : Interrupt when logic one. - * - #kGPIO_ActiveHighTriggerOutputEnable : Enable active high-trigger output (if the trigger states exit). - * - #kGPIO_ActiveLowTriggerOutputEnable : Enable active low-trigger output (if the trigger states exit). - */ -static inline void GPIO_SetPinInterruptConfig(GPIO_Type *base, uint32_t pin, gpio_interrupt_config_t config) -{ - assert(base); - - base->ICR[pin] = GPIO_FIT_REG((base->ICR[pin] & ~GPIO_ICR_IRQC_MASK) | GPIO_ICR_IRQC(config)); -} - -#if (defined(FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) && FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) -/*! - * @brief Configures the gpio pin interrupt/DMA request/trigger output channel selection. - * - * @param base GPIO peripheral base pointer. - * @param pin GPIO pin number. - * @param selection GPIO pin interrupt output selection. - * - #kGPIO_InterruptOutput0: Interrupt/DMA request/trigger output 0. - * - #kGPIO_InterruptOutput1 : Interrupt/DMA request/trigger output 1. - */ -static inline void GPIO_SetPinInterruptChannel(GPIO_Type *base, uint32_t pin, gpio_interrupt_selection_t selection) -{ - assert(base); - - base->ICR[pin] = GPIO_FIT_REG((base->ICR[pin] & ~GPIO_ICR_IRQS_MASK) | GPIO_ICR_IRQS(selection)); -} -#endif -/*! - * @brief Read the GPIO interrupt status flags. - * - * @param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on.) - * @return The current GPIO's interrupt status flag. - * '1' means the related pin's flag is set, '0' means the related pin's flag not set. - * For example, the return value 0x00010001 means the pin 0 and 17 have the interrupt pending. - */ -uint32_t GPIO_GpioGetInterruptFlags(GPIO_Type *base); -#if (defined(FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) && FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) -/*! - * @brief Read the GPIO interrupt status flags based on selected interrupt channel(IRQS). - * - * @param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on.) - * @param channel '0' means selete interrupt channel 0, '1' means selete interrupt channel 1. - * @return The current GPIO's interrupt status flag based on the selected interrupt channel. - * '1' means the related pin's flag is set, '0' means the related pin's flag not set. - * For example, the return value 0x00010001 means the pin 0 and 17 have the interrupt pending. - */ -uint32_t GPIO_GpioGetInterruptChannelFlags(GPIO_Type *base, uint32_t channel); -#endif -/*! - * @brief Read individual pin's interrupt status flag. - * - * @param base GPIO peripheral base pointer. (GPIOA, GPIOB, GPIOC, and so on) - * @param pin GPIO specific pin number. - * @return The current selected pin's interrupt status flag. - */ -uint8_t GPIO_PinGetInterruptFlag(GPIO_Type *base, uint32_t pin); - -/*! - * @brief Clears GPIO pin interrupt status flags. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - */ -void GPIO_GpioClearInterruptFlags(GPIO_Type *base, uint32_t mask); -#if (defined(FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) && FSL_FEATURE_GPIO_HAS_INTERRUPT_CHANNEL_SELECT) -/*! - * @brief Clears GPIO pin interrupt status flags based on selected interrupt channel(IRQS). - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param mask GPIO pin number macro - * @param channel '0' means selete interrupt channel 0, '1' means selete interrupt channel 1. - */ -void GPIO_GpioClearInterruptChannelFlags(GPIO_Type *base, uint32_t mask, uint32_t channel); -#endif -/*! - * @brief Clear GPIO individual pin's interrupt status flag. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on). - * @param pin GPIO specific pin number. - */ -void GPIO_PinClearInterruptFlag(GPIO_Type *base, uint32_t pin); - -/*! - * @brief Reads the GPIO DMA request flags. - * The corresponding flag will be cleared automatically at the completion of the requested - * DMA transfer - */ -static inline uint32_t GPIO_GetPinsDMARequestFlags(GPIO_Type *base) -{ - assert(base); - return (base->ISFR[1]); -} - -/*! - * @brief Sets the GPIO interrupt configuration in PCR register for multiple pins. - * - * @param base GPIO peripheral base pointer. - * @param mask GPIO pin number macro. - * @param config GPIO pin interrupt configuration. - * - #kGPIO_InterruptStatusFlagDisabled: Interrupt disabled. - * - #kGPIO_DMARisingEdge : DMA request on rising edge(if the DMA requests exit). - * - #kGPIO_DMAFallingEdge: DMA request on falling edge(if the DMA requests exit). - * - #kGPIO_DMAEitherEdge : DMA request on either edge(if the DMA requests exit). - * - #kGPIO_FlagRisingEdge : Flag sets on rising edge(if the Flag states exit). - * - #kGPIO_FlagFallingEdge : Flag sets on falling edge(if the Flag states exit). - * - #kGPIO_FlagEitherEdge : Flag sets on either edge(if the Flag states exit). - * - #kGPIO_InterruptLogicZero : Interrupt when logic zero. - * - #kGPIO_InterruptRisingEdge : Interrupt on rising edge. - * - #kGPIO_InterruptFallingEdge: Interrupt on falling edge. - * - #kGPIO_InterruptEitherEdge : Interrupt on either edge. - * - #kGPIO_InterruptLogicOne : Interrupt when logic one. - * - #kGPIO_ActiveHighTriggerOutputEnable : Enable active high-trigger output (if the trigger states exit). - * - #kGPIO_ActiveLowTriggerOutputEnable : Enable active low-trigger output (if the trigger states exit).. - */ -static inline void GPIO_SetMultipleInterruptPinsConfig(GPIO_Type *base, uint32_t mask, gpio_interrupt_config_t config) -{ - assert(base); - - if (0UL != (mask & 0xffffUL)) - { - base->GICLR = GPIO_FIT_REG((GPIO_ICR_IRQC(config)) | (mask & 0xffffU)); - } - mask = mask >> 16U; - if (mask != 0UL) - { - base->GICHR = GPIO_FIT_REG((GPIO_ICR_IRQC(config)) | (mask & 0xffffU)); - } -} -#endif - -#if defined(FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER) && FSL_FEATURE_GPIO_HAS_ATTRIBUTE_CHECKER -/*! - * brief The GPIO module supports a device-specific number of data ports, organized as 32-bit - * words/8-bit Bytes. Each 32-bit/8-bit data port includes a GACR register, which defines the byte-level - * attributes required for a successful access to the GPIO programming model. If the GPIO module's GACR register - * organized as 32-bit words, the attribute controls for the 4 data bytes in the GACR follow a standard little - * endian data convention. - * - * @param base GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) - * @param attribute GPIO checker attribute - */ -void GPIO_CheckAttributeBytes(GPIO_Type *base, gpio_checker_attribute_t attribute); -#endif - -/*! @} */ -/*! @} */ - -/*! - * @addtogroup fgpio_driver - * @{ - */ - -/* - * Introduces the FGPIO feature. - * - * The FGPIO features are only support on some Kinetis MCUs. The FGPIO registers are aliased to the IOPORT - * interface. Accesses via the IOPORT interface occur in parallel with any instruction fetches and - * complete in a single cycle. This aliased Fast GPIO memory map is called FGPIO. - */ - -#if defined(FSL_FEATURE_SOC_FGPIO_COUNT) && FSL_FEATURE_SOC_FGPIO_COUNT - -/*! @name FGPIO Configuration */ -/*! @{ */ - -#if defined(FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL) && FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL -/*! - * @brief Initializes the FGPIO peripheral. - * - * This function ungates the FGPIO clock. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - */ -void FGPIO_PortInit(FGPIO_Type *base); -#endif /* FSL_FEATURE_PCC_HAS_FGPIO_CLOCK_GATE_CONTROL */ - -/*! - * @brief Initializes a FGPIO pin used by the board. - * - * To initialize the FGPIO driver, define a pin configuration, as either input or output, in the user file. - * Then, call the FGPIO_PinInit() function. - * - * This is an example to define an input pin or an output pin configuration: - * @code - * Define a digital input pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalInput, - * 0, - * } - * Define a digital output pin configuration, - * gpio_pin_config_t config = - * { - * kGPIO_DigitalOutput, - * 0, - * } - * @endcode - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param pin FGPIO port pin number - * @param config FGPIO pin configuration pointer - */ -void FGPIO_PinInit(FGPIO_Type *base, uint32_t pin, const gpio_pin_config_t *config); - -/*! @} */ - -/*! @name FGPIO Output Operations */ -/*! @{ */ - -/*! - * @brief Sets the output level of the multiple FGPIO pins to the logic 1 or 0. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param pin FGPIO pin number - * @param output FGPIOpin output logic level. - * - 0: corresponding pin output low-logic level. - * - 1: corresponding pin output high-logic level. - */ -static inline void FGPIO_PinWrite(FGPIO_Type *base, uint32_t pin, uint8_t output) -{ - if (output == 0U) - { - base->PCOR = 1UL << pin; - } - else - { - base->PSOR = 1UL << pin; - } -} - -/*! - * @brief Sets the output level of the multiple FGPIO pins to the logic 1. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param mask FGPIO pin number macro - */ -static inline void FGPIO_PortSet(FGPIO_Type *base, uint32_t mask) -{ - base->PSOR = mask; -} - -/*! - * @brief Sets the output level of the multiple FGPIO pins to the logic 0. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param mask FGPIO pin number macro - */ -static inline void FGPIO_PortClear(FGPIO_Type *base, uint32_t mask) -{ - base->PCOR = mask; -} - -/*! - * @brief Reverses the current output logic of the multiple FGPIO pins. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param mask FGPIO pin number macro - */ -static inline void FGPIO_PortToggle(FGPIO_Type *base, uint32_t mask) -{ - base->PTOR = mask; -} -/*! @} */ - -/*! @name FGPIO Input Operations */ -/*! @{ */ - -/*! - * @brief Reads the current input value of the FGPIO port. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param pin FGPIO pin number - * @retval FGPIO port input value - * - 0: corresponding pin input low-logic level. - * - 1: corresponding pin input high-logic level. - */ -static inline uint32_t FGPIO_PinRead(FGPIO_Type *base, uint32_t pin) -{ - return (((base->PDIR) >> pin) & 0x01U); -} -/*! @} */ - -/*! @name FGPIO Interrupt */ -/*! @{ */ -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && \ - defined(FSL_FEATURE_SOC_PORT_COUNT) - -/*! - * @brief Reads the FGPIO port interrupt status flag. - * - * If a pin is configured to generate the DMA request, the corresponding flag - * is cleared automatically at the completion of the requested DMA transfer. - * Otherwise, the flag remains set until a logic one is written to that flag. - * If configured for a level-sensitive interrupt that remains asserted, the flag - * is set again immediately. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @retval The current FGPIO port interrupt status flags, for example, 0x00010001 means the - * pin 0 and 17 have the interrupt. - */ -uint32_t FGPIO_PortGetInterruptFlags(FGPIO_Type *base); - -/*! - * @brief Clears the multiple FGPIO pin interrupt status flag. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param mask FGPIO pin number macro - */ -void FGPIO_PortClearInterruptFlags(FGPIO_Type *base, uint32_t mask); -#endif -#if defined(FSL_FEATURE_FGPIO_HAS_ATTRIBUTE_CHECKER) && FSL_FEATURE_FGPIO_HAS_ATTRIBUTE_CHECKER -/*! - * @brief The FGPIO module supports a device-specific number of data ports, organized as 32-bit - * words. Each 32-bit data port includes a GACR register, which defines the byte-level - * attributes required for a successful access to the GPIO programming model. The attribute controls for the 4 data - * bytes in the GACR follow a standard little endian - * data convention. - * - * @param base FGPIO peripheral base pointer (FGPIOA, FGPIOB, FGPIOC, and so on.) - * @param attribute FGPIO checker attribute - */ -void FGPIO_CheckAttributeBytes(FGPIO_Type *base, gpio_checker_attribute_t attribute); -#endif /* FSL_FEATURE_FGPIO_HAS_ATTRIBUTE_CHECKER */ - -/*! @} */ - -#endif /* FSL_FEATURE_SOC_FGPIO_COUNT */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ - -#endif /* FSL_GPIO_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_i3c.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_i3c.c deleted file mode 100644 index dc10970b5af..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_i3c.c +++ /dev/null @@ -1,3572 +0,0 @@ -/* - * Copyright 2018-2024 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_i3c.h" -#if !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) -#include "fsl_reset.h" -#endif -#include -#include - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.i3c" -#endif - -#define I3C_BROADCASE_ADDR (0x7EU) - -#define NSEC_PER_SEC (1000000000UL) -#define FSL_I3C_ERROR_RATE_MAX (10U) -#define FSL_I3C_PPBAUD_DIV_MAX ((I3C_MCONFIG_PPBAUD_MASK >> I3C_MCONFIG_PPBAUD_SHIFT) + 1U) -#define FSL_I3C_ODBAUD_DIV_MAX ((I3C_MCONFIG_ODBAUD_MASK >> I3C_MCONFIG_ODBAUD_SHIFT) + 1U) -#define FSL_I3C_I2CBAUD_DIV_MAX (((I3C_MCONFIG_I2CBAUD_MASK >> I3C_MCONFIG_I2CBAUD_SHIFT) + 1U) / 2U) - -/*! @brief Common sets of flags used by the driver. */ -enum _i3c_flag_constants -{ - /*! All flags which are cleared by the driver upon starting a transfer. */ - kMasterClearFlags = kI3C_MasterSlaveStartFlag | kI3C_MasterControlDoneFlag | kI3C_MasterCompleteFlag | - kI3C_MasterArbitrationWonFlag | kI3C_MasterSlave2MasterFlag | kI3C_MasterErrorFlag, - - /*! IRQ sources enabled by the non-blocking transactional API. */ - kMasterIrqFlags = kI3C_MasterSlaveStartFlag | kI3C_MasterControlDoneFlag | kI3C_MasterCompleteFlag | - kI3C_MasterRxReadyFlag /* | kI3C_MasterTxReadyFlag */ | kI3C_MasterArbitrationWonFlag | - kI3C_MasterErrorFlag | kI3C_MasterSlave2MasterFlag, - - /*! Errors to check for. */ - kMasterErrorFlags = kI3C_MasterErrorNackFlag | kI3C_MasterErrorWriteAbortFlag | -#if !defined(FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) || (!FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) - kI3C_MasterErrorTermFlag | -#endif - kI3C_MasterErrorParityFlag | kI3C_MasterErrorCrcFlag | kI3C_MasterErrorReadFlag | - kI3C_MasterErrorWriteFlag | kI3C_MasterErrorMsgFlag | kI3C_MasterErrorInvalidReqFlag | - kI3C_MasterErrorTimeoutFlag, - /*! All flags which are cleared by the driver upon starting a transfer. */ - kSlaveClearFlags = kI3C_SlaveBusStartFlag | kI3C_SlaveMatchedFlag | kI3C_SlaveBusStopFlag, - - /*! IRQ sources enabled by the non-blocking transactional API. */ - kSlaveIrqFlags = kI3C_SlaveBusStartFlag | kI3C_SlaveMatchedFlag | kI3C_SlaveBusStopFlag | kI3C_SlaveRxReadyFlag | - kI3C_SlaveDynamicAddrChangedFlag | kI3C_SlaveReceivedCCCFlag | kI3C_SlaveErrorFlag | - kI3C_SlaveHDRCommandMatchFlag | kI3C_SlaveCCCHandledFlag | kI3C_SlaveEventSentFlag, - - /*! Errors to check for. */ - kSlaveErrorFlags = kI3C_SlaveErrorOverrunFlag | kI3C_SlaveErrorUnderrunFlag | kI3C_SlaveErrorUnderrunNakFlag | - kI3C_SlaveErrorTermFlag | kI3C_SlaveErrorInvalidStartFlag | kI3C_SlaveErrorSdrParityFlag | - kI3C_SlaveErrorHdrParityFlag | kI3C_SlaveErrorHdrCRCFlag | kI3C_SlaveErrorS0S1Flag | - kI3C_SlaveErrorOverreadFlag | kI3C_SlaveErrorOverwriteFlag, -}; - -/*! @brief States for the state machine used by transactional APIs. */ -enum _i3c_transfer_states -{ - kIdleState = 0, - kIBIWonState, - kSlaveStartState, - kSendCommandState, - kWaitRepeatedStartCompleteState, - kTransferDataState, - kStopState, - kWaitForCompletionState, -}; - -/*! - * @brief Used for conversion between `uint8_t*` and `uint32_t`. - */ -typedef union i3c_puint8_to_u32 -{ - uint8_t *puint8; - uint32_t u32; - const uint8_t *cpuint8; -} i3c_puint8_to_u32_t; - -/* - * MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - } - - return result; -} - -status_t I3C_MasterWaitForCtrlDone(I3C_Type *base, bool waitIdle) -{ - status_t result = kStatus_Success; - uint32_t status, errStatus; -#if I3C_RETRY_TIMES - uint32_t waitTimes = I3C_RETRY_TIMES; -#endif - -#if I3C_RETRY_TIMES - while ((result == kStatus_Success) && (--waitTimes)) -#else - while (result == kStatus_Success) -#endif - { - status = I3C_MasterGetStatusFlags(base); - errStatus = I3C_MasterGetErrorStatusFlags(base); - /* Check for error flags. */ - result = I3C_MasterCheckAndClearError(base, errStatus); - /* Check if the control finishes. */ - if (0UL != (status & (uint32_t)kI3C_MasterControlDoneFlag)) - { - I3C_MasterClearStatusFlags(base, (uint32_t)kI3C_MasterControlDoneFlag); - if (!waitIdle) - { - break; - } - } - /* kI3C_MasterControlDoneFlag only indicates ACK got, need to wait for SDA high. */ - if (waitIdle && I3C_MasterGetState(base) == kI3C_MasterStateIdle) - { - break; - } - } - -#if I3C_RETRY_TIMES - if (waitTimes == 0) - { - return kStatus_I3C_Timeout; - } -#endif - - return result; -} - -static status_t I3C_MasterWaitForTxReady(I3C_Type *base, uint8_t byteCounts) -{ - uint32_t errStatus; - status_t result; - size_t txCount; - size_t txFifoSize = - 2UL << ((base->SCAPABILITIES & I3C_SCAPABILITIES_FIFOTX_MASK) >> I3C_SCAPABILITIES_FIFOTX_SHIFT); - -#if I3C_RETRY_TIMES - uint32_t waitTimes = I3C_RETRY_TIMES; -#endif - do - { - /* Get the number of words in the tx fifo and compute empty slots. */ - I3C_MasterGetFifoCounts(base, NULL, &txCount); - txCount = txFifoSize - txCount; - - /* Check for error flags. */ - errStatus = I3C_MasterGetErrorStatusFlags(base); - result = I3C_MasterCheckAndClearError(base, errStatus); - if (kStatus_Success != result) - { - return result; - } -#if I3C_RETRY_TIMES - } while ((txCount < byteCounts) && (--waitTimes)); - - if (waitTimes == 0) - { - return kStatus_I3C_Timeout; - } -#else - } while (txCount < byteCounts); -#endif - - return kStatus_Success; -} - -static status_t I3C_MasterWaitForComplete(I3C_Type *base, bool waitIdle) -{ - uint32_t status, errStatus; - status_t result = kStatus_Success; -#if I3C_RETRY_TIMES - uint32_t waitTimes = I3C_RETRY_TIMES; -#endif - do - { - status = I3C_MasterGetStatusFlags(base); - errStatus = I3C_MasterGetErrorStatusFlags(base); - result = I3C_MasterCheckAndClearError(base, errStatus); -#if I3C_RETRY_TIMES - } while (((status & (uint32_t)kI3C_MasterCompleteFlag) != (uint32_t)kI3C_MasterCompleteFlag) && - (result == kStatus_Success) && --waitTimes); -#else - } while (((status & (uint32_t)kI3C_MasterCompleteFlag) != (uint32_t)kI3C_MasterCompleteFlag) && - (result == kStatus_Success)); -#endif - - I3C_MasterClearStatusFlags(base, (uint32_t)kI3C_MasterCompleteFlag); - -#if I3C_RETRY_TIMES - if (waitTimes == 0UL) - { - return kStatus_I3C_Timeout; - } -#endif - - if (waitIdle) - { -#if I3C_RETRY_TIMES - while ((I3C_MasterGetState(base) != kI3C_MasterStateIdle) && --waitTimes) -#else - while (I3C_MasterGetState(base) != kI3C_MasterStateIdle) -#endif - { - } - } - - return result; -} - -/*! - * @brief Convert provided flags to status code, and clear any errors if present. - * @param base The I3C peripheral base address. - * @param status Current status flags value that will be checked. - * @retval #kStatus_Success - * @retval #kStatus_I3C_OverrunError - * @retval #kStatus_I3C_UnderrunError - * @retval #kStatus_I3C_UnderrunNak - * @retval #kStatus_I3C_Term - * @retval #kStatus_I3C_InvalidStart - * @retval #kStatus_I3C_SdrParityError - * @retval #kStatus_I3C_HdrParityError - * @retval #kStatus_I3C_CrcError - * @retval #kStatus_I3C_S0S1Error - * @retval #kStatus_I3C_ReadFifoError - * @retval #kStatus_I3C_WriteFifoError - */ -status_t I3C_SlaveCheckAndClearError(I3C_Type *base, uint32_t status) -{ - status_t result = kStatus_Success; - - /* Check for error. These errors cause a stop to automatically be sent. We must */ - /* clear the errors before a new transfer can start. */ - status &= (uint32_t)kSlaveErrorFlags; - -#if defined(I3C_DMA_IGNORE_FIFO_ERROR) - status &= ~((uint32_t)kI3C_SlaveErrorUnderrunFlag | (uint32_t)kI3C_SlaveErrorOverwriteFlag); - I3C_SlaveClearErrorStatusFlags(base, - ((uint32_t)kI3C_SlaveErrorUnderrunFlag | (uint32_t)kI3C_SlaveErrorOverwriteFlag)); -#endif - - if (0UL != status) - { - /* Select the correct error code. Ordered by severity, with bus issues first. */ - if (0UL != (status & (uint32_t)kI3C_SlaveErrorOverrunFlag)) - { - result = kStatus_I3C_OverrunError; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorUnderrunFlag)) - { - result = kStatus_I3C_UnderrunError; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorUnderrunNakFlag)) - { - result = kStatus_I3C_UnderrunNak; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorTermFlag)) - { - result = kStatus_I3C_Term; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorInvalidStartFlag)) - { - result = kStatus_I3C_InvalidStart; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorSdrParityFlag)) - { - result = kStatus_I3C_SdrParityError; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorHdrParityFlag)) - { - result = kStatus_I3C_HdrParityError; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorHdrCRCFlag)) - { - result = kStatus_I3C_CrcError; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorS0S1Flag)) - { - result = kStatus_I3C_S0S1Error; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorOverreadFlag)) - { - result = kStatus_I3C_ReadFifoError; - } - else if (0UL != (status & (uint32_t)kI3C_SlaveErrorOverwriteFlag)) - { - result = kStatus_I3C_WriteFifoError; - } - else - { - assert(false); - } - - /* Clear the flags. */ - I3C_SlaveClearErrorStatusFlags(base, status); - - /* Reset fifos. These flags clear automatically. */ - base->SDATACTRL |= I3C_SDATACTRL_FLUSHTB_MASK | I3C_SDATACTRL_FLUSHFB_MASK; - } - - return result; -} - -static status_t I3C_SlaveWaitForTxReady(I3C_Type *base) -{ - uint32_t errStatus; - status_t result; - size_t txCount; - size_t txFifoSize = - 2UL << ((base->SCAPABILITIES & I3C_SCAPABILITIES_FIFOTX_MASK) >> I3C_SCAPABILITIES_FIFOTX_SHIFT); - -#if I3C_RETRY_TIMES - uint32_t waitTimes = I3C_RETRY_TIMES; -#endif - do - { - /* Get the number of words in the tx fifo and compute empty slots. */ - I3C_SlaveGetFifoCounts(base, NULL, &txCount); - txCount = txFifoSize - txCount; - - /* Check for error flags. */ - errStatus = I3C_SlaveGetErrorStatusFlags(base); - result = I3C_SlaveCheckAndClearError(base, errStatus); - if (kStatus_Success != result) - { - return result; - } -#if I3C_RETRY_TIMES - } while ((txCount == 0UL) && (--waitTimes)); - - if (waitTimes == 0) - { - return kStatus_I3C_Timeout; - } -#else - } while (txCount == 0UL); -#endif - - return kStatus_Success; -} - -static status_t I3C_MasterEmitStop(I3C_Type *base, bool waitIdle) -{ - status_t result = kStatus_Success; - - /* Return an error if the bus is not in transaction. */ - if (I3C_MasterGetState(base) != kI3C_MasterStateNormAct) - { - return kStatus_I3C_InvalidReq; - } - - /* Send the STOP signal */ - base->MCTRL = (base->MCTRL & ~(I3C_MCTRL_REQUEST_MASK | I3C_MCTRL_DIR_MASK | I3C_MCTRL_RDTERM_MASK)) | - I3C_MCTRL_REQUEST(kI3C_RequestEmitStop); - - /* Wait for the stop operation finishes. */ - /* Also check for errors while waiting. */ - result = I3C_MasterWaitForCtrlDone(base, waitIdle); - - return result; -} - -/*! - * brief I3C master get IBI Type. - * - * param base The I3C peripheral base address. - * param i3c_ibi_type_t Type of #i3c_ibi_type_t. - */ -i3c_ibi_type_t I3C_GetIBIType(I3C_Type *base) -{ - uint32_t ibiValue = (base->MSTATUS & I3C_MSTATUS_IBITYPE_MASK) >> I3C_MSTATUS_IBITYPE_SHIFT; - i3c_ibi_type_t ibiType = kI3C_IbiNormal; - - switch (ibiValue) - { - case 3L: - ibiType = kI3C_IbiHotJoin; - break; - case 2L: - ibiType = kI3C_IbiMasterRequest; - break; - default: - ibiType = kI3C_IbiNormal; - break; - } - - return ibiType; -} - -/*! - * @brief Make sure the bus isn't already busy. - * - * A busy bus is allowed if we are the one driving it. - * - * @param base The I3C peripheral base address. - * @retval #kStatus_Success - * @retval #kStatus_I3C_Busy - */ -/* Not static so it can be used from fsl_i3c_edma.c. */ -status_t I3C_CheckForBusyBus(I3C_Type *base) -{ - return (I3C_MasterGetBusIdleState(base) == true) ? kStatus_Success : kStatus_I3C_Busy; -} - -/* brief Provides a default configuration for the I3C peripheral. - * - */ -void I3C_GetDefaultConfig(i3c_config_t *config) -{ - assert(NULL != config); - - (void)memset(config, 0, sizeof(*config)); - - config->enableMaster = kI3C_MasterCapable; - config->disableTimeout = false; - config->hKeep = kI3C_MasterHighKeeperNone; - config->enableOpenDrainStop = true; - config->enableOpenDrainHigh = true; - config->baudRate_Hz.i2cBaud = 400000U; - config->baudRate_Hz.i3cPushPullBaud = 12500000U; - config->baudRate_Hz.i3cOpenDrainBaud = 2500000U; - config->masterDynamicAddress = 0x0AU; /* Default master dynamic address. */ -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - config->slowClock_Hz = 0; /* Not update the Soc default setting. */ -#endif - config->enableSlave = true; - config->vendorID = 0x11BU; -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) - config->enableRandomPart = false; -#endif - config->partNumber = 0; - config->dcr = 0; /* Generic device. */ - config->bcr = 0; /* BCR[7:6]: device role, I3C slave(2b'00), BCR[5]: SDR Only / SDR and HDR Capable, SDR and HDR - Capable(1b'1), BCR[4]: Bridge Identifier, Not a bridge device(1b'0), BCR[3]: Offline Capable, - device is offline capable(1b'1), BCR[2]: IBI Payload, No data byte following(1b'0), BCR[1]: IBI - Request Capable, capable(1b'1), BCR[0]: Max Data Speed Limitation, has limitation(1b'1). */ - config->hdrMode = (uint8_t)kI3C_HDRModeDDR; - config->nakAllRequest = false; - config->ignoreS0S1Error = false; - config->offline = false; - config->matchSlaveStartStop = false; - config->maxWriteLength = 256U; - config->maxReadLength = 256U; -} - -/*! - * @brief Initializes the I3C peripheral. - * - */ -void I3C_Init(I3C_Type *base, const i3c_config_t *config, uint32_t sourceClock_Hz) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) || \ - !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) - uint32_t instance = I3C_GetInstance(base); -#endif - uint32_t configValue; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate the clock. */ - CLOCK_EnableClock(kI3cClocks[instance]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) - /* Reset the I3C module */ - RESET_PeripheralReset(kI3cResets[instance]); -#endif - - if ((config->masterDynamicAddress != 0U) && (config->enableMaster == kI3C_MasterOn)) - { - base->MDYNADDR &= ~I3C_MDYNADDR_DADDR_MASK; - base->MDYNADDR |= I3C_MDYNADDR_DADDR(config->masterDynamicAddress) | I3C_MDYNADDR_DAVALID_MASK; - } - - base->MCONFIG = I3C_MCONFIG_MSTENA(config->enableMaster) | I3C_MCONFIG_DISTO(config->disableTimeout) | - I3C_MCONFIG_HKEEP(config->hKeep) | I3C_MCONFIG_ODSTOP(config->enableOpenDrainStop) | - I3C_MCONFIG_ODHPP(config->enableOpenDrainHigh); - -#if defined(FSL_FEATURE_I3C_HAS_START_SCL_DELAY) && FSL_FEATURE_I3C_HAS_START_SCL_DELAY - base->MCONFIG_EXT = I3C_MCONFIG_EXT_I3C_CAS_DEL(config->startSclDelay) | I3C_MCONFIG_EXT_I3C_CASR_DEL(config->restartSclDelay); -#endif - - I3C_MasterSetWatermarks(base, kI3C_TxTriggerUntilOneLessThanFull, kI3C_RxTriggerOnNotEmpty, true, true); - - I3C_MasterSetBaudRate(base, &config->baudRate_Hz, sourceClock_Hz); - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - assert((config->slowClock_Hz >= 1000000U) || (config->slowClock_Hz == 0U)); - - uint8_t matchCount; - /* Set as (slowClk(MHz) - 1) to generate 1us clock cycle. Controller uses it to count 100us timeout. Target uses it as IBI request to drive SDA low. - Note: Use BAMATCH = 1 to generate 1us clock cycle if slow clock is 1MHz. The value of 0 would not give a correct match indication. */ - if (config->slowClock_Hz != 0U) - { - matchCount = (uint8_t)(config->slowClock_Hz / 1000000UL) - 1U; - matchCount = (matchCount == 0U) ? 1U : matchCount; - } - else - { - /* BAMATCH has default value based on Soc default slow clock after reset, using this default value when slowClock_Hz is 0. */ - matchCount = (uint8_t)((base->SCONFIG & I3C_SCONFIG_BAMATCH_MASK) >> I3C_SCONFIG_BAMATCH_SHIFT); - } -#endif - - configValue = base->SCONFIG; - - configValue &= - ~(I3C_SCONFIG_SADDR_MASK | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - I3C_SCONFIG_BAMATCH_MASK | -#endif - I3C_SCONFIG_OFFLINE_MASK | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) - I3C_SCONFIG_IDRAND_MASK | -#endif -#if defined(FSL_FEATURE_I3C_HAS_HDROK) && FSL_FEATURE_I3C_HAS_HDROK - I3C_SCONFIG_HDROK_MASK | -#else - I3C_SCONFIG_DDROK_MASK | -#endif - I3C_SCONFIG_S0IGNORE_MASK | I3C_SCONFIG_MATCHSS_MASK | I3C_SCONFIG_NACK_MASK | I3C_SCONFIG_SLVENA_MASK); - - configValue |= I3C_SCONFIG_SADDR(config->staticAddr) | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - I3C_SCONFIG_BAMATCH(matchCount) | -#endif - I3C_SCONFIG_OFFLINE(config->offline) | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) - I3C_SCONFIG_IDRAND(config->enableRandomPart) | -#endif -#if defined(FSL_FEATURE_I3C_HAS_HDROK) && FSL_FEATURE_I3C_HAS_HDROK - I3C_SCONFIG_HDROK((0U != (config->hdrMode & (uint8_t)kI3C_HDRModeDDR)) ? 1U : 0U) | -#else - I3C_SCONFIG_DDROK((0U != (config->hdrMode & (uint8_t)kI3C_HDRModeDDR)) ? 1U : 0U) | -#endif - I3C_SCONFIG_S0IGNORE(config->ignoreS0S1Error) | I3C_SCONFIG_MATCHSS(config->matchSlaveStartStop) | - I3C_SCONFIG_NACK(config->nakAllRequest) | I3C_SCONFIG_SLVENA(config->enableSlave); - - base->SVENDORID &= ~I3C_SVENDORID_VID_MASK; - base->SVENDORID |= I3C_SVENDORID_VID(config->vendorID); - -#if defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND - base->SIDPARTNO = config->partNumber; -#else - if (!config->enableRandomPart) - { - base->SIDPARTNO = config->partNumber; - } -#endif - - base->SIDEXT &= ~(I3C_SIDEXT_BCR_MASK | I3C_SIDEXT_DCR_MASK); - base->SIDEXT |= I3C_SIDEXT_BCR(config->bcr) | I3C_SIDEXT_DCR(config->dcr); - - base->SMAXLIMITS &= ~(I3C_SMAXLIMITS_MAXRD_MASK | I3C_SMAXLIMITS_MAXWR_MASK); - base->SMAXLIMITS |= (I3C_SMAXLIMITS_MAXRD(config->maxReadLength) | I3C_SMAXLIMITS_MAXWR(config->maxWriteLength)); - - base->SCONFIG = configValue; -} - -/*! - * brief Provides a default configuration for the I3C master peripheral. - * - * This function provides the following default configuration for the I3C master peripheral: - * code - * masterConfig->enableMaster = kI3C_MasterOn; - * masterConfig->disableTimeout = false; - * masterConfig->hKeep = kI3C_MasterHighKeeperNone; - * masterConfig->enableOpenDrainStop = true; - * masterConfig->enableOpenDrainHigh = true; - * masterConfig->baudRate_Hz = 100000U; - * masterConfig->busType = kI3C_TypeI2C; - * endcode - * - * After calling this function, you can override any settings in order to customize the configuration, - * prior to initializing the master driver with I3C_MasterInit(). - * - * param[out] masterConfig User provided configuration structure for default values. Refer to #i3c_master_config_t. - */ -void I3C_MasterGetDefaultConfig(i3c_master_config_t *masterConfig) -{ - (void)memset(masterConfig, 0, sizeof(*masterConfig)); - - masterConfig->enableMaster = kI3C_MasterOn; - masterConfig->disableTimeout = false; - masterConfig->hKeep = kI3C_MasterHighKeeperNone; - masterConfig->enableOpenDrainStop = true; - masterConfig->enableOpenDrainHigh = true; - masterConfig->baudRate_Hz.i2cBaud = 400000U; - masterConfig->baudRate_Hz.i3cPushPullBaud = 12500000U; - masterConfig->baudRate_Hz.i3cOpenDrainBaud = 2500000U; -} - -/*! - * brief Initializes the I3C master peripheral. - * - * This function enables the peripheral clock and initializes the I3C master peripheral as described by the user - * provided configuration. A software reset is performed prior to configuration. - * - * param base The I3C peripheral base address. - * param masterConfig User provided peripheral configuration. Use I3C_MasterGetDefaultConfig() to get a set of - * defaults that you can override. - * param sourceClock_Hz Frequency in Hertz of the I3C functional clock. Used to calculate the baud rate divisors, - * filter widths, and timeout periods. - */ -void I3C_MasterInit(I3C_Type *base, const i3c_master_config_t *masterConfig, uint32_t sourceClock_Hz) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) || \ - !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) - uint32_t instance = I3C_GetInstance(base); -#endif - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate the clock. */ - CLOCK_EnableClock(kI3cClocks[instance]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) - /* Reset the I3C module */ - RESET_PeripheralReset(kI3cResets[instance]); -#endif - base->MCONFIG = I3C_MCONFIG_MSTENA(masterConfig->enableMaster) | I3C_MCONFIG_DISTO(masterConfig->disableTimeout) | - I3C_MCONFIG_HKEEP(masterConfig->hKeep) | I3C_MCONFIG_ODSTOP(masterConfig->enableOpenDrainStop) | - I3C_MCONFIG_ODHPP(masterConfig->enableOpenDrainHigh); - -#if defined(FSL_FEATURE_I3C_HAS_START_SCL_DELAY) && FSL_FEATURE_I3C_HAS_START_SCL_DELAY - base->MCONFIG_EXT = I3C_MCONFIG_EXT_I3C_CAS_DEL(masterConfig->startSclDelay) | I3C_MCONFIG_EXT_I3C_CASR_DEL(masterConfig->restartSclDelay); -#endif - - I3C_MasterSetWatermarks(base, kI3C_TxTriggerUntilOneLessThanFull, kI3C_RxTriggerOnNotEmpty, true, true); - - I3C_MasterSetBaudRate(base, &masterConfig->baudRate_Hz, sourceClock_Hz); - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - assert((masterConfig->slowClock_Hz >= 1000000U) || (masterConfig->slowClock_Hz == 0U)); - - uint32_t configValue; - uint8_t matchCount; - - /* BAMATCH has default value based on Soc default slow clock after reset, using this default value when slowClock_Hz is 0. */ - if (masterConfig->slowClock_Hz != 0U) - { - /* Set as (slowClk(MHz) - 1) to generate 1us clock cycle for 100us timeout. Note: Use BAMATCH = 1 to generate 1us clock cycle - if slow clock is 1MHz. The value of 0 would not give a correct match indication. */ - matchCount = (uint8_t)(masterConfig->slowClock_Hz / 1000000UL) - 1U; - matchCount = (matchCount == 0U) ? 1U : matchCount; - - configValue = base->SCONFIG & I3C_SCONFIG_BAMATCH_MASK; - configValue |= I3C_SCONFIG_BAMATCH(matchCount); - base->SCONFIG = configValue; - } -#endif -} - -/*! - * @brief Gets the I3C master state. - * - * @param base The I3C peripheral base address. - * @return I3C master state. - */ -i3c_master_state_t I3C_MasterGetState(I3C_Type *base) -{ - uint32_t masterState = (base->MSTATUS & I3C_MSTATUS_STATE_MASK) >> I3C_MSTATUS_STATE_SHIFT; - i3c_master_state_t returnCode; - - switch (masterState) - { - case (uint32_t)kI3C_MasterStateIdle: - returnCode = kI3C_MasterStateIdle; - break; - case (uint32_t)kI3C_MasterStateSlvReq: - returnCode = kI3C_MasterStateSlvReq; - break; - case (uint32_t)kI3C_MasterStateMsgSdr: - returnCode = kI3C_MasterStateMsgSdr; - break; - case (uint32_t)kI3C_MasterStateNormAct: - returnCode = kI3C_MasterStateNormAct; - break; - case (uint32_t)kI3C_MasterStateDdr: - returnCode = kI3C_MasterStateDdr; - break; - case (uint32_t)kI3C_MasterStateDaa: - returnCode = kI3C_MasterStateDaa; - break; - case (uint32_t)kI3C_MasterStateIbiAck: - returnCode = kI3C_MasterStateIbiAck; - break; - case (uint32_t)kI3C_MasterStateIbiRcv: - returnCode = kI3C_MasterStateIbiRcv; - break; - default: - returnCode = kI3C_MasterStateIdle; - break; - } - - return returnCode; -} - -/*! - * brief Deinitializes the I3C master peripheral. - * - * This function disables the I3C master peripheral and gates the clock. It also performs a software - * reset to restore the peripheral to reset conditions. - * - * param base The I3C peripheral base address. - */ -void I3C_MasterDeinit(I3C_Type *base) -{ - uint32_t idx = I3C_GetInstance(base); - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) - /* Reset the I3C module */ - RESET_PeripheralReset(kI3cResets[idx]); -#endif - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate clock. */ - CLOCK_DisableClock(kI3cClocks[idx]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Reset handle pointer. */ - s_i3cMasterHandle[idx] = NULL; -} - -static uint32_t I3C_CalcErrorRatio(uint32_t curFreq, uint32_t desiredFreq) -{ - if (curFreq > desiredFreq) - { - return (curFreq - desiredFreq) * 100UL / desiredFreq; - } - else - { - return (desiredFreq - curFreq) * 100UL / desiredFreq; - } -} - -/*! - * brief Sets the I3C bus frequency for master transactions. - * - * The I3C master is automatically disabled and re-enabled as necessary to configure the baud - * rate. Do not call this function during a transfer, or the transfer is aborted. - * - * param base The I3C peripheral base address. - * param baudRate_Hz Pointer to structure of requested bus frequency in Hertz. - * param sourceClock_Hz I3C functional clock frequency in Hertz. - */ -void I3C_MasterSetBaudRate(I3C_Type *base, const i3c_baudrate_hz_t *baudRate_Hz, uint32_t sourceClock_Hz) -{ - uint32_t div, freq; - uint32_t divEven, divOdd; - uint32_t ppBaud, odBaud, i2cBaud; - uint32_t errRate0, errRate1; - uint32_t i3cPPBaud_HZ = baudRate_Hz->i3cPushPullBaud; - uint32_t i3cPPBaudMax_HZ = i3cPPBaud_HZ / 10U + i3cPPBaud_HZ; /* max is 1.1*i3cPPBaud_HZ */ - uint32_t i3cODBaud_HZ = baudRate_Hz->i3cOpenDrainBaud; - uint32_t i3cODBaudMax_HZ = i3cODBaud_HZ / 10U + i3cODBaud_HZ; /* max is 1.1*i3cODBaud_HZ */ - uint32_t i2cBaud_HZ = baudRate_Hz->i2cBaud; - uint32_t i3cPPLow_Ns, i3cOdLow_Ns; - bool isODHigh = (0U != (base->MCONFIG & I3C_MCONFIG_ODHPP_MASK)) ? true : false; - - /* Find out the div to generate target freq */ - freq = sourceClock_Hz / 2UL; - /* ppFreq = FCLK / 2 / (PPBAUD + 1)), 0 <= PPBAUD <= 15 */ - /* We need PPBAUD generate 12.5MHz or so. */ - div = freq / i3cPPBaud_HZ; - div = (div == 0UL) ? 1UL : div; - if (freq / div > i3cPPBaudMax_HZ) - { - div++; - } - assert(div <= FSL_I3C_PPBAUD_DIV_MAX); - ppBaud = div - 1UL; - freq /= div; - - i3cPPLow_Ns = (uint32_t)(NSEC_PER_SEC / (2UL * freq)); - - /* We need ODBAUD generate 2.5MHz or so. */ - if (isODHigh) - { - /* odFreq = (2*freq) / (ODBAUD + 2), 1 <= ODBAUD <= 255 */ - div = (2UL * freq) / i3cODBaud_HZ; - div = div < 2UL ? 2UL : div; - if ((2UL * freq / div) > i3cODBaudMax_HZ) - { - div++; - } - odBaud = div - 2UL; - freq = (2UL * freq) / div; - } - else - { - /* odFreq = ppFreq / (ODBAUD + 1), 1 <= ODBAUD <= 255 */ - div = freq / i3cODBaud_HZ; - div = div < 1UL ? 1UL : div; - if (freq / div > i3cODBaudMax_HZ) - { - div++; - } - odBaud = div - 1UL; - freq /= div; - } - - i3cOdLow_Ns = (odBaud + 1UL) * i3cPPLow_Ns; - - /* i2cFreq = odFreq / (I2CBAUD + 1), 0 <= I2CBAUD <= 7 (I2CBAUD need << 1 in register) */ - /* i2cFreq = NSEC_PER_SEC / (I2CBAUD + 1)*i3cOdLow_Ns */ - divEven = (sourceClock_Hz / i2cBaud_HZ) / (2UL * (ppBaud + 1UL) * (odBaud + 1UL)); - divEven = divEven == 0UL ? 1UL : divEven; - errRate0 = I3C_CalcErrorRatio((uint32_t)(NSEC_PER_SEC / (2UL * divEven * i3cOdLow_Ns)), i2cBaud_HZ); - - divOdd = ((sourceClock_Hz / i2cBaud_HZ) / ((ppBaud + 1UL) * (odBaud + 1UL) - 1UL)) / 2UL; - divOdd = divOdd == 0UL ? 1UL : divOdd; - errRate1 = I3C_CalcErrorRatio((uint32_t)(NSEC_PER_SEC / ((2UL * divOdd + 1UL) * i3cOdLow_Ns)), i2cBaud_HZ); - - if (errRate0 < FSL_I3C_ERROR_RATE_MAX || errRate1 < FSL_I3C_ERROR_RATE_MAX) - { - /* Use this div */ - i2cBaud = errRate0 < errRate1 ? (divEven - 1UL) * 2UL : (divOdd - 1UL) * 2UL + 1UL; - } - else - { - /* Use div + 1, unless current freq is already lower than desired. */ - i2cBaud = freq / divEven < i2cBaud_HZ ? (divEven - 1UL) * 2UL : divEven * 2UL; - } - - base->MCONFIG = (base->MCONFIG & ~(I3C_MCONFIG_PPBAUD_MASK | I3C_MCONFIG_PPLOW_MASK | I3C_MCONFIG_ODBAUD_MASK | - I3C_MCONFIG_I2CBAUD_MASK)) | - I3C_MCONFIG_PPBAUD(ppBaud) | I3C_MCONFIG_ODBAUD(odBaud) | I3C_MCONFIG_I2CBAUD(i2cBaud); -} - -/*! - * brief Sends a START signal and slave address on the I2C/I3C bus, receive size is also specified - * in the call. - * This function is used to initiate a new master mode transfer. First, the bus state is checked to ensure - * that another master is not occupying the bus. Then a START signal is transmitted, followed by the - * 7-bit address specified in the a address parameter. Note that this function does not actually wait - * until the START and address are successfully sent on the bus before returning. - * - * param base The I3C peripheral base address. - * param type The bus type to use in this transaction. - * param address 7-bit slave device address, in bits [6:0]. - * param dir Master transfer direction, either #kI3C_Read or #kI3C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * param rxSize Read terminate size for the followed read transfer, limit to 255 bytes. - * retval #kStatus_Success START signal and address were successfully enqueued in the transmit FIFO. - * retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - */ -status_t I3C_MasterStartWithRxSize( - I3C_Type *base, i3c_bus_type_t type, uint8_t address, i3c_direction_t dir, uint8_t rxSize) -{ - i3c_master_state_t masterState = I3C_MasterGetState(base); - bool checkDdrState = (type == kI3C_TypeI3CDdr) ? (masterState != kI3C_MasterStateDdr) : true; - if ((masterState != kI3C_MasterStateIdle) && (masterState != kI3C_MasterStateNormAct) && checkDdrState) - { - return kStatus_I3C_Busy; - } - - return I3C_MasterRepeatedStartWithRxSize(base, type, address, dir, rxSize); -} - -/*! - * brief Sends a START signal and slave address on the I2C/I3C bus. - * - * This function is used to initiate a new master mode transfer. First, the bus state is checked to ensure - * that another master is not occupying the bus. Then a START signal is transmitted, followed by the - * 7-bit address specified in the a address parameter. Note that this function does not actually wait - * until the START and address are successfully sent on the bus before returning. - * - * param base The I3C peripheral base address. - * param type The bus type to use in this transaction. - * param address 7-bit slave device address, in bits [6:0]. - * param dir Master transfer direction, either #kI3C_Read or #kI3C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * retval #kStatus_Success START signal and address were successfully enqueued in the transmit FIFO. - * retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - */ -status_t I3C_MasterStart(I3C_Type *base, i3c_bus_type_t type, uint8_t address, i3c_direction_t dir) -{ - i3c_master_state_t masterState = I3C_MasterGetState(base); - bool checkDdrState = (type == kI3C_TypeI3CDdr) ? (masterState != kI3C_MasterStateDdr) : true; - if ((masterState != kI3C_MasterStateIdle) && (masterState != kI3C_MasterStateNormAct) && checkDdrState) - { - return kStatus_I3C_Busy; - } - - return I3C_MasterStartWithRxSize(base, type, address, dir, 0); -} - -/*! - * brief Sends a repeated START signal and slave address on the I2C/I3C bus, receive size is also specified - * in the call. - * - * This function is used to send a Repeated START signal when a transfer is already in progress. Like - * I3C_MasterStart(), it also sends the specified 7-bit address. Call this API also configures the read - * terminate size for the following read transfer. For example, set the rxSize = 2, the following read transfer - * will be terminated after two bytes of data received. Write transfer will not be affected by the rxSize - * configuration. - * - * note This function exists primarily to maintain compatible APIs between I3C and I2C drivers, - * as well as to better document the intent of code that uses these APIs. - * - * param base The I3C peripheral base address. - * param type The bus type to use in this transaction. - * param address 7-bit slave device address, in bits [6:0]. - * param dir Master transfer direction, either #kI3C_Read or #kI3C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * param rxSize Read terminate size for the followed read transfer, limit to 255 bytes. - * retval #kStatus_Success Repeated START signal and address were successfully enqueued in the transmit FIFO. - */ -status_t I3C_MasterRepeatedStartWithRxSize( - I3C_Type *base, i3c_bus_type_t type, uint8_t address, i3c_direction_t dir, uint8_t rxSize) -{ - uint32_t mctrlVal; - - /* Clear all flags. */ - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - -#if defined(FSL_FEATURE_I3C_HAS_ERRATA_051617) && (FSL_FEATURE_I3C_HAS_ERRATA_051617) - /* ERRATA051617: When used as I2C controller generates repeated START randomly before the STOP under PVT condition. - This issue is caused by a glitch at the output of an internal clock MUX. The glitch when generates acts as a clock - pulse which causes the SDA line to fall early during SCL high period and creates the unintended Repeated START before - actual STOP. */ - if (type == kI3C_TypeI2C) - { - base->MCONFIG |= I3C_MCONFIG_SKEW(1); - } - else - { - base->MCONFIG &= ~I3C_MCONFIG_SKEW_MASK; - } -#endif - - /* Issue start command. */ - mctrlVal = base->MCTRL; - mctrlVal &= ~(I3C_MCTRL_TYPE_MASK | I3C_MCTRL_REQUEST_MASK | I3C_MCTRL_DIR_MASK | I3C_MCTRL_ADDR_MASK | - I3C_MCTRL_RDTERM_MASK); - mctrlVal |= I3C_MCTRL_TYPE(type) | I3C_MCTRL_REQUEST(kI3C_RequestEmitStartAddr) | I3C_MCTRL_DIR(dir) | - I3C_MCTRL_ADDR(address) | I3C_MCTRL_RDTERM(rxSize); - - base->MCTRL = mctrlVal; - - return kStatus_Success; -} -/*! - * brief Sends a STOP signal on the I2C/I3C bus. - * - * This function does not return until the STOP signal is seen on the bus, or an error occurs. - * - * param base The I3C peripheral base address. - * retval #kStatus_Success The STOP signal was successfully sent on the bus and the transaction terminated. - * retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * retval #kStatus_I3C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_I3C_FifoError FIFO under run or overrun. - * retval #kStatus_I3C_ArbitrationLost Arbitration lost error. - * retval #kStatus_I3C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t I3C_MasterStop(I3C_Type *base) -{ - return I3C_MasterEmitStop(base, true); -} - -/*! - * brief I3C master emit request. - * - * param base The I3C peripheral base address. - * param masterReq I3C master request of type #i3c_bus_request_t - */ -void I3C_MasterEmitRequest(I3C_Type *base, i3c_bus_request_t masterReq) -{ - uint32_t mctrlReg = base->MCTRL; - - mctrlReg &= ~I3C_MCTRL_REQUEST_MASK; - - if (masterReq == kI3C_RequestProcessDAA) - { - mctrlReg &= ~I3C_MCTRL_TYPE_MASK; - } - - mctrlReg |= I3C_MCTRL_REQUEST(masterReq); - - base->MCTRL = mctrlReg; -} - -/*! - * brief I3C master register IBI rule. - * - * param base The I3C peripheral base address. - * param ibiRule Pointer to ibi rule description of type #i3c_register_ibi_addr_t - */ -void I3C_MasterRegisterIBI(I3C_Type *base, i3c_register_ibi_addr_t *ibiRule) -{ - assert(NULL != ibiRule); - uint32_t ruleValue = I3C_MIBIRULES_MSB0_MASK; - - for (uint32_t count = 0; count < ARRAY_SIZE(ibiRule->address); count++) - { - ruleValue |= ((uint32_t)ibiRule->address[count]) << (count * I3C_MIBIRULES_ADDR1_SHIFT); - } - - ruleValue &= ~I3C_MIBIRULES_NOBYTE_MASK; - - if (!ibiRule->ibiHasPayload) - { - ruleValue |= I3C_MIBIRULES_NOBYTE_MASK; - } - - base->MIBIRULES = ruleValue; -} - -/*! - * brief I3C master get IBI rule. - * - * param base The I3C peripheral base address. - * param ibiRule Pointer to store the read out ibi rule description. - */ -void I3C_MasterGetIBIRules(I3C_Type *base, i3c_register_ibi_addr_t *ibiRule) -{ - assert(NULL != ibiRule); - - uint32_t ruleValue = base->MIBIRULES; - - for (uint32_t count = 0; count < ARRAY_SIZE(ibiRule->address); count++) - { - ibiRule->address[count] = - (uint8_t)(ruleValue >> (count * I3C_MIBIRULES_ADDR1_SHIFT)) & I3C_MIBIRULES_ADDR0_MASK; - } - - ibiRule->ibiHasPayload = (0U == (ruleValue & I3C_MIBIRULES_NOBYTE_MASK)); -} - -/*! - * brief Performs a polling receive transfer on the I2C/I3C bus. - * - * param base The I3C peripheral base address. - * param rxBuff The pointer to the data to be transferred. - * param rxSize The length in bytes of the data to be transferred. - * param flags Bit mask of options for the transfer. See enumeration #_i3c_master_transfer_flags for available options. - * retval #kStatus_Success Data was received successfully. - * retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * retval #kStatus_I3C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_I3C_FifoError FIFO under run or overrun. - * retval #kStatus_I3C_ArbitrationLost Arbitration lost error. - * retval #kStatus_I3C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t I3C_MasterReceive(I3C_Type *base, void *rxBuff, size_t rxSize, uint32_t flags) -{ - status_t result = kStatus_Success; - bool isRxAutoTerm = ((flags & (uint32_t)kI3C_TransferRxAutoTermFlag) != 0UL); - bool completed = false; - uint32_t status; - uint8_t *buf; - - assert(NULL != rxBuff); - - /* Handle empty read. */ - if (rxSize == 0UL) - { - return kStatus_Success; - } - -#if I3C_RETRY_TIMES - uint32_t waitTimes = I3C_RETRY_TIMES; -#endif - - /* Receive data */ - buf = (uint8_t *)rxBuff; - - while ((rxSize != 0UL) || !completed) - { -#if I3C_RETRY_TIMES - if (--waitTimes == 0) - { - return kStatus_I3C_Timeout; - } -#endif - /* Check for errors. */ - result = I3C_MasterCheckAndClearError(base, I3C_MasterGetErrorStatusFlags(base)); - if (kStatus_Success != result) - { - return result; - } - - /* Check complete flag */ - if (!completed) - { - status = I3C_MasterGetStatusFlags(base) & (uint32_t)kI3C_MasterCompleteFlag; - if (0UL != status) - { - completed = true; - /* Clear complete flag */ - I3C_MasterClearStatusFlags(base, (uint32_t)kI3C_MasterCompleteFlag); - /* Send stop if needed */ - if ((flags & (uint32_t)kI3C_TransferNoStopFlag) == 0UL) - { - if (I3C_MasterGetState(base) == kI3C_MasterStateDdr) - { - I3C_MasterEmitRequest(base, kI3C_RequestForceExit); - result = I3C_MasterWaitForCtrlDone(base, false); - } - else - { - result = I3C_MasterEmitStop(base, false); - } - if (kStatus_Success != result) - { - return result; - } - } - } - } - - /* Check RX data */ - if ((0UL != rxSize) && (0UL != (base->MDATACTRL & I3C_MDATACTRL_RXCOUNT_MASK))) - { - *buf++ = (uint8_t)(base->MRDATAB & I3C_MRDATAB_VALUE_MASK); - rxSize--; - if ((flags & (uint32_t)kI3C_TransferDisableRxTermFlag) == 0UL) - { - if ((!isRxAutoTerm) && (rxSize == 1U)) - { - base->MCTRL |= I3C_MCTRL_RDTERM(1U); - } - } - } - } - - /* Wait idle if stop is sent. */ - if ((flags & (uint32_t)kI3C_TransferNoStopFlag) == 0UL) - { -#if I3C_RETRY_TIMES - while ((I3C_MasterGetState(base) != kI3C_MasterStateIdle) && --waitTimes) -#else - while (I3C_MasterGetState(base) != kI3C_MasterStateIdle) -#endif - { - } - } - return result; -} - -/*! - * brief Performs a polling send transfer on the I2C/I3C bus. - * - * Sends up to a txSize number of bytes to the previously addressed slave device. The slave may - * reply with a NAK to any byte in order to terminate the transfer early. If this happens, this - * function returns #kStatus_I3C_Nak. - * - * param base The I3C peripheral base address. - * param txBuff The pointer to the data to be transferred. - * param txSize The length in bytes of the data to be transferred. - * param flags Bit mask of options for the transfer. See enumeration #_i3c_master_transfer_flags for available options. - * retval #kStatus_Success Data was sent successfully. - * retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * retval #kStatus_I3C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_I3C_FifoError FIFO under run or over run. - * retval #kStatus_I3C_ArbitrationLost Arbitration lost error. - * retval #kStatus_I3C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t I3C_MasterSend(I3C_Type *base, const void *txBuff, size_t txSize, uint32_t flags) -{ - i3c_puint8_to_u32_t buf; - buf.cpuint8 = (const uint8_t *)((const void *)txBuff); - status_t result = kStatus_Success; - bool enableWord = ((flags & (uint32_t)kI3C_TransferWordsFlag) == (uint32_t)kI3C_TransferWordsFlag) ? true : false; - uint8_t byteCounts = enableWord ? 2U : 1U; - - assert(NULL != txBuff); - if (enableWord) - { - assert(txSize % 2UL == 0UL); - } - - /* Send data buffer */ - while (0UL != txSize) - { - /* Wait until there is room in the fifo. This also checks for errors. */ - result = I3C_MasterWaitForTxReady(base, byteCounts); - if (kStatus_Success != result) - { - return result; - } - - /* Write byte into I3C master data register. */ - if (txSize > byteCounts) - { - if (enableWord) - { - base->MWDATAH = (uint32_t)buf.cpuint8[1] << 8UL | (uint32_t)buf.cpuint8[0]; - } - else - { - base->MWDATAB = *buf.cpuint8; - } - } - else - { - if (enableWord) - { - base->MWDATAHE = (uint32_t)buf.cpuint8[1] << 8UL | (uint32_t)buf.cpuint8[0]; - } - else - { - base->MWDATABE = *buf.cpuint8; - } - } - - buf.u32 = buf.u32 + byteCounts; - txSize = txSize - byteCounts; - } - - result = I3C_MasterWaitForComplete(base, false); - if ((result == kStatus_Success) && ((flags & (uint32_t)kI3C_TransferNoStopFlag) == 0UL)) - { - if (I3C_MasterGetState(base) == kI3C_MasterStateDdr) - { - I3C_MasterEmitRequest(base, kI3C_RequestForceExit); - result = I3C_MasterWaitForCtrlDone(base, false); - } - else - { - result = I3C_MasterEmitStop(base, true); - } - } - - return result; -} - -/*! - * brief Performs a DAA in the i3c bus with specified temporary baud rate. - * - * param base The I3C peripheral base address. - * param addressList The pointer for address list which is used to do DAA. - * param count The address count in the address list. - * param daaBaudRate The temporary baud rate in DAA process, NULL for using initial setting. - * The initial setting is set back between the completion of the DAA and the return of this function. - * retval #kStatus_Success The transaction was started successfully. - * retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - * retval #kStatus_I3C_SlaveCountExceed The I3C slave count has exceed the definition in I3C_MAX_DEVCNT. - */ -status_t I3C_MasterProcessDAASpecifiedBaudrate(I3C_Type *base, - uint8_t *addressList, - uint32_t count, - i3c_master_daa_baudrate_t *daaBaudRate) -{ - assert(addressList != NULL); - assert(count != 0U); - - status_t result = kStatus_Success; - uint8_t rxBuffer[8] = {0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU}; - uint32_t masterConfig = 0; - uint32_t devCount = 0; - uint8_t rxSize = 0; - bool mctrlDone = false; - i3c_baudrate_hz_t baudRate_Hz; - uint32_t errStatus; - uint32_t status; - size_t rxCount; - - /* Return an error if the bus is already in use not by us. */ - result = I3C_CheckForBusyBus(base); - if (kStatus_Success != result) - { - return result; - } - - /* Clear all flags. */ - I3C_MasterClearErrorStatusFlags(base, (uint32_t)kMasterErrorFlags); - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - - /* Disable I3C IRQ sources while we configure stuff. */ - uint32_t enabledInts = I3C_MasterGetEnabledInterrupts(base); - I3C_MasterDisableInterrupts(base, enabledInts); - - /* Temporarily adjust baud rate before DAA. */ - if (daaBaudRate != NULL) - { - masterConfig = base->MCONFIG; - /* Set non-zero value for I2C baud rate which is useless here. */ - baudRate_Hz.i2cBaud = 1; - baudRate_Hz.i3cOpenDrainBaud = daaBaudRate->i3cOpenDrainBaud; - baudRate_Hz.i3cPushPullBaud = daaBaudRate->i3cPushPullBaud; - I3C_MasterSetBaudRate(base, &baudRate_Hz, daaBaudRate->sourceClock_Hz); - } - - /* Emit process DAA */ - I3C_MasterEmitRequest(base, kI3C_RequestProcessDAA); - - do - { - status = I3C_MasterGetStatusFlags(base); - - /* Check for error flags. */ - errStatus = I3C_MasterGetErrorStatusFlags(base); - result = I3C_MasterCheckAndClearError(base, errStatus); - if (kStatus_Success != result) - { - break; - } - - if ((!mctrlDone) || (rxSize < 8U)) - { - I3C_MasterGetFifoCounts(base, &rxCount, NULL); - - if (rxCount != 0U) - { - rxBuffer[rxSize++] = (uint8_t)(base->MRDATAB & I3C_MRDATAB_VALUE_MASK); - } - - if ((status & (uint32_t)kI3C_MasterControlDoneFlag) != 0U) - { - I3C_MasterClearStatusFlags(base, (uint32_t)kI3C_MasterControlDoneFlag); - mctrlDone = true; - } - } - else if ((I3C_MasterGetState(base) == kI3C_MasterStateDaa) && - (0UL != (I3C_MasterGetStatusFlags(base) & (uint32_t)kI3C_MasterBetweenFlag))) - { - if (((devCount + 1UL) > count) || ((devCount + 1UL) > I3C_MAX_DEVCNT)) - { - result = kStatus_I3C_SlaveCountExceed; - break; - } - - /* Assign the dynamic address from address list. */ - devList[devCount].dynamicAddr = *addressList++; - base->MWDATAB = devList[devCount].dynamicAddr; - - /* Emit process DAA again. */ - I3C_MasterEmitRequest(base, kI3C_RequestProcessDAA); - - devList[devCount].vendorID = (((uint16_t)rxBuffer[0] << 8U | (uint16_t)rxBuffer[1]) & 0xFFFEU) >> 1U; - devList[devCount].partNumber = ((uint32_t)rxBuffer[2] << 24U | (uint32_t)rxBuffer[3] << 16U | - (uint32_t)rxBuffer[4] << 8U | (uint32_t)rxBuffer[5]); - devList[devCount].bcr = rxBuffer[6]; - devList[devCount].dcr = rxBuffer[7]; - devCount++; - usedDevCount++; - - /* Ready to handle next device. */ - mctrlDone = false; - rxSize = 0; - } - else - { - /* Intentional empty */ - } - } while ((status & (uint32_t)kI3C_MasterCompleteFlag) != (uint32_t)kI3C_MasterCompleteFlag); - - /* Master stops DAA if slave device number exceeds the prepared address number. */ - if (result == kStatus_I3C_SlaveCountExceed) - { - /* Send the STOP signal */ - base->MCTRL = (base->MCTRL & ~(I3C_MCTRL_REQUEST_MASK | I3C_MCTRL_DIR_MASK | I3C_MCTRL_RDTERM_MASK)) | - I3C_MCTRL_REQUEST(kI3C_RequestEmitStop); - } - - /* Set back initial baud rate after DAA is over. */ - if (daaBaudRate != NULL) - { - base->MCONFIG = masterConfig; - } - - /* Clear all flags. */ - I3C_MasterClearErrorStatusFlags(base, (uint32_t)kMasterErrorFlags); - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - - /* Enable I3C IRQ sources while we configure stuff. */ - I3C_MasterEnableInterrupts(base, enabledInts); - - return result; -} - -/*! - * brief Get device information list after DAA process is done. - * - * param base The I3C peripheral base address. - * param[out] count The pointer to store the available device count. - * return Pointer to the i3c_device_info_t array. - */ -i3c_device_info_t *I3C_MasterGetDeviceListAfterDAA(I3C_Type *base, uint8_t *count) -{ - assert(NULL != count); - - *count = usedDevCount; - - return devList; -} - -/*! - * @brief introduce function I3C_MasterClearFlagsAndEnableIRQ. - * - * This function was used of Clear all flags and Enable I3C IRQ sources for @param *base. - * - * @param base The I3C peripheral base address. - */ -static void I3C_MasterClearFlagsAndEnableIRQ(I3C_Type *base) -{ - /* Clear all flags. */ - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - /* Enable I3C IRQ sources. */ - I3C_MasterEnableInterrupts(base, (uint32_t)kMasterIrqFlags); -} - -/*! - * @brief introduce function I3C_MasterTransferNoStartFlag. - * - * This function was used of Check if device request wins arbitration. - * - * @param base The I3C peripheral base address. - * @param transfer Pointer to the transfer structure. - * @retval #true if the device wins arbitration. - * @retval #false if the device not wins arbitration. - */ -static bool I3C_MasterTransferNoStartFlag(I3C_Type *base, i3c_master_transfer_t *transfer) -{ - /* Wait tx fifo empty. */ - size_t txCount = 0xFFUL; - - while (txCount != 0U) - { - I3C_MasterGetFifoCounts(base, NULL, &txCount); - } - - /* Check if device request wins arbitration. */ - if (0UL != (I3C_MasterGetStatusFlags(base) & (uint32_t)kI3C_MasterArbitrationWonFlag)) - { - I3C_MasterClearFlagsAndEnableIRQ(base); - return true; - } - return false; -} - -/*! - * brief Performs a master polling transfer on the I2C/I3C bus. - * - * note The API does not return until the transfer succeeds or fails due - * to error happens during transfer. - * - * param base The I3C peripheral base address. - * param transfer Pointer to the transfer structure. - * retval #kStatus_Success Data was received successfully. - * retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * retval #kStatus_I3C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_I3C_FifoError FIFO under run or overrun. - * retval #kStatus_I3C_ArbitrationLost Arbitration lost error. - * retval #kStatus_I3C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t I3C_MasterTransferBlocking(I3C_Type *base, i3c_master_transfer_t *transfer) -{ - assert(NULL != transfer); - assert(transfer->subaddressSize <= sizeof(transfer->subaddress)); - - status_t result = kStatus_Success; - i3c_direction_t direction = transfer->direction; - i3c_master_state_t masterState = I3C_MasterGetState(base); - bool checkDdrState = false; - i3c_rx_term_ops_t rxTermOps; - - /* Return an error if the bus is already in use not by us. */ - checkDdrState = (transfer->busType == kI3C_TypeI3CDdr) ? (masterState != kI3C_MasterStateDdr) : true; - - if ((masterState != kI3C_MasterStateIdle) && (masterState != kI3C_MasterStateNormAct) && checkDdrState) - { - return kStatus_I3C_Busy; - } - - /* Clear all flags. */ - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - /* Reset fifos. These flags clear automatically. */ - base->MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - - /* Disable I3C IRQ sources while we configure stuff. */ - I3C_MasterDisableInterrupts(base, (uint32_t)kMasterIrqFlags); - - if (transfer->busType != kI3C_TypeI3CDdr) - { - direction = (0UL != transfer->subaddressSize) ? kI3C_Write : transfer->direction; - } - - /* True: Set Rx termination bytes at start point, False: Set Rx termination one bytes in advance. */ - if ((transfer->flags & (uint32_t)kI3C_TransferDisableRxTermFlag) != 0U) - { - rxTermOps = kI3C_RxTermDisable; - } - else if (transfer->dataSize <= 255U) - { - rxTermOps = kI3C_RxAutoTerm; - } - else - { - rxTermOps = kI3C_RxTermLastByte; - } - - if (0UL != (transfer->flags & (uint32_t)kI3C_TransferStartWithBroadcastAddr)) - { - if (0UL != (transfer->flags & (uint32_t)kI3C_TransferNoStartFlag)) - { - return kStatus_InvalidArgument; - } - - if (0UL != (transfer->flags & (uint32_t)kI3C_TransferRepeatedStartFlag)) - { - return kStatus_InvalidArgument; - } - - /* Issue 0x7E as start. */ - result = I3C_MasterStart(base, transfer->busType, 0x7E, kI3C_Write); - if (result != kStatus_Success) - { - return result; - } - - result = I3C_MasterWaitForCtrlDone(base, false); - if (result != kStatus_Success) - { - return result; - } - } - - if (0UL == (transfer->flags & (uint32_t)kI3C_TransferNoStartFlag)) - { - if ((direction == kI3C_Read) && (rxTermOps == kI3C_RxAutoTerm)) - { - result = I3C_MasterStartWithRxSize(base, transfer->busType, transfer->slaveAddress, direction, - (uint8_t)transfer->dataSize); - } - else - { - result = I3C_MasterStart(base, transfer->busType, transfer->slaveAddress, direction); - } - if (result != kStatus_Success) - { - return result; - } - - result = I3C_MasterWaitForCtrlDone(base, false); - if (result != kStatus_Success) - { - return result; - } - - if (true == I3C_MasterTransferNoStartFlag(base, transfer)) - { - return kStatus_I3C_IBIWon; - } - } - else - { - if ((direction == kI3C_Read) && (rxTermOps != kI3C_RxTermDisable)) - { - /* Can't set Rx termination more than one bytes in advance without START. */ - rxTermOps = kI3C_RxTermLastByte; - } - } - - /* Subaddress, MSB first. */ - if (0U != transfer->subaddressSize) - { - uint32_t subaddressRemaining = transfer->subaddressSize; - while (0UL != subaddressRemaining--) - { - uint8_t subaddressByte = (uint8_t)((transfer->subaddress >> (8UL * subaddressRemaining)) & 0xFFUL); - - result = I3C_MasterWaitForTxReady(base, 1U); - - if ((0UL == subaddressRemaining) && ((transfer->direction == kI3C_Read) || (0UL == transfer->dataSize)) && - (transfer->busType != kI3C_TypeI3CDdr)) - { - base->MWDATABE = subaddressByte; - result = I3C_MasterWaitForComplete(base, false); - if (kStatus_Success != result) - { - if (result == kStatus_I3C_Nak) - { - (void)I3C_MasterEmitStop(base, true); - } - I3C_MasterClearFlagsAndEnableIRQ(base); - return result; - } - } - else - { - base->MWDATAB = subaddressByte; - } - } - /* Need to send repeated start if switching directions to read. */ - if ((transfer->busType != kI3C_TypeI3CDdr) && (0UL != transfer->dataSize) && (transfer->direction == kI3C_Read)) - { - if (rxTermOps == kI3C_RxAutoTerm) - { - result = I3C_MasterRepeatedStartWithRxSize(base, transfer->busType, transfer->slaveAddress, kI3C_Read, - (uint8_t)transfer->dataSize); - } - else - { - result = I3C_MasterRepeatedStart(base, transfer->busType, transfer->slaveAddress, kI3C_Read); - } - - if (kStatus_Success != result) - { - I3C_MasterClearFlagsAndEnableIRQ(base); - return result; - } - - result = I3C_MasterWaitForCtrlDone(base, false); - if (result != kStatus_Success) - { - return result; - } - } - } - - if (rxTermOps == kI3C_RxAutoTerm) - { - transfer->flags |= (uint32_t)kI3C_TransferRxAutoTermFlag; - } - else - { - transfer->flags &= ~(uint32_t)kI3C_TransferRxAutoTermFlag; - } - - /* Transmit data. */ - if ((transfer->direction == kI3C_Write) && (transfer->dataSize > 0UL)) - { - /* Send Data. */ - result = I3C_MasterSend(base, transfer->data, transfer->dataSize, transfer->flags); - } - /* Receive Data. */ - else if ((transfer->direction == kI3C_Read) && (transfer->dataSize > 0UL)) - { - result = I3C_MasterReceive(base, transfer->data, transfer->dataSize, transfer->flags); - } - else - { - if ((transfer->flags & (uint32_t)kI3C_TransferNoStopFlag) == 0UL) - { - result = I3C_MasterEmitStop(base, true); - } - } - - if (result == kStatus_I3C_Nak) - { - (void)I3C_MasterEmitStop(base, true); - } - - I3C_MasterClearFlagsAndEnableIRQ(base); - - return result; -} - -/*! - * brief Creates a new handle for the I3C master non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the I3C_MasterTransferAbort() API shall be called. - * - * - * note The function also enables the NVIC IRQ for the input I3C. Need to notice - * that on some SoCs the I3C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - * - * param base The I3C peripheral base address. - * param[out] handle Pointer to the I3C master driver handle. - * param callback User provided pointer to the asynchronous callback function. - * param userData User provided pointer to the application callback data. - */ -void I3C_MasterTransferCreateHandle(I3C_Type *base, - i3c_master_handle_t *handle, - const i3c_master_transfer_callback_t *callback, - void *userData) -{ - uint32_t instance; - - assert(NULL != handle); - - /* Clear out the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Look up instance number */ - instance = I3C_GetInstance(base); - - /* Save base and instance. */ - handle->callback = *callback; - handle->userData = userData; - - /* Save this handle for IRQ use. */ - s_i3cMasterHandle[instance] = handle; - - /* Set irq handler. */ - s_i3cMasterIsr = I3C_MasterTransferHandleIRQ; - - /* Clear all flags. */ - I3C_MasterClearErrorStatusFlags(base, (uint32_t)kMasterErrorFlags); - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - /* Reset fifos. These flags clear automatically. */ - base->MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - - /* Enable NVIC IRQ, this only enables the IRQ directly connected to the NVIC. - In some cases the I3C IRQ is configured through INTMUX, user needs to enable - INTMUX IRQ in application code. */ - (void)EnableIRQ(kI3cIrqs[instance]); - - /* Clear internal IRQ enables and enable NVIC IRQ. */ - I3C_MasterEnableInterrupts(base, (uint32_t)kMasterIrqFlags); -} - -static void I3C_TransferStateMachineIBIWonState(I3C_Type *base, - i3c_master_handle_t *handle, - i3c_master_state_machine_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - if (stateParams->masterState == kI3C_MasterStateIbiAck) - { - handle->ibiType = I3C_GetIBIType(base); - if (handle->callback.ibiCallback != NULL) - { - handle->callback.ibiCallback(base, handle, handle->ibiType, kI3C_IbiAckNackPending); - } - else - { - I3C_MasterEmitIBIResponse(base, kI3C_IbiRespNack); - } - } - - /* Make sure there is data in the rx fifo. */ - if (0UL != stateParams->rxCount) - { - if ((handle->ibiBuff == NULL) && (handle->callback.ibiCallback != NULL)) - { - handle->callback.ibiCallback(base, handle, kI3C_IbiNormal, kI3C_IbiDataBuffNeed); - } - uint8_t tempData = (uint8_t)base->MRDATAB; - if (handle->ibiBuff != NULL) - { - handle->ibiBuff[handle->ibiPayloadSize++] = tempData; - } - (stateParams->rxCount)--; - return; - } - else if (0UL != (stateParams->status & (uint32_t)kI3C_MasterCompleteFlag)) - { - handle->ibiType = I3C_GetIBIType(base); - handle->ibiAddress = I3C_GetIBIAddress(base); - stateParams->state_complete = true; - stateParams->result = kStatus_I3C_IBIWon; - } - else - { - stateParams->state_complete = true; - } -} - -static void I3C_TransferStateMachineSendCommandState(I3C_Type *base, - i3c_master_handle_t *handle, - i3c_master_state_machine_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - I3C_MasterEnableInterrupts(base, (uint32_t)kI3C_MasterTxReadyFlag); - /* Make sure there is room in the tx fifo for the next command. */ - if (0UL == (stateParams->txCount)--) - { - stateParams->state_complete = true; - return; - } - if (handle->transfer.subaddressSize > 1U) - { - handle->transfer.subaddressSize--; - base->MWDATAB = (uint8_t)((handle->transfer.subaddress) >> (8U * handle->transfer.subaddressSize)); - } - else if (handle->transfer.subaddressSize == 1U) - { - handle->transfer.subaddressSize--; - - if ((handle->transfer.direction == kI3C_Read) || (0UL == handle->transfer.dataSize)) - { - base->MWDATABE = (uint8_t)((handle->transfer.subaddress) >> (8U * handle->transfer.subaddressSize)); - - if (handle->transfer.busType != kI3C_TypeI3CDdr) - { - if (0UL == handle->transfer.dataSize) - { - handle->state = (uint8_t)kWaitForCompletionState; - } - else - { - /* xfer->dataSize != 0U, xfer->direction = kI3C_Read */ - handle->state = (uint8_t)kWaitRepeatedStartCompleteState; - } - } - else - { - handle->state = (uint8_t)kTransferDataState; - } - } - else - { - /* Next state, transfer data. */ - handle->state = (uint8_t)kTransferDataState; - base->MWDATAB = (uint8_t)((handle->transfer.subaddress) >> (8U * handle->transfer.subaddressSize)); - } - } - else - { - /* Eliminate misra 15.7*/ - } -} - -static void I3C_TransferStateMachineWaitRepeatedStartCompleteState(I3C_Type *base, - i3c_master_handle_t *handle, - i3c_master_state_machine_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - /* We stay in this state until the master complete. */ - if (0UL != (stateParams->status & (uint32_t)kI3C_MasterCompleteFlag)) - { - handle->state = (uint8_t)kTransferDataState; - I3C_MasterDisableInterrupts(base, (uint32_t)kI3C_MasterTxReadyFlag); - - if (handle->remainingBytes < 256U) - { - handle->rxTermOps = (handle->rxTermOps == kI3C_RxTermDisable) ? handle->rxTermOps : kI3C_RxAutoTerm; - stateParams->result = - I3C_MasterRepeatedStartWithRxSize(base, handle->transfer.busType, handle->transfer.slaveAddress, - kI3C_Read, (uint8_t)handle->remainingBytes); - } - else - { - stateParams->result = - I3C_MasterRepeatedStart(base, handle->transfer.busType, handle->transfer.slaveAddress, kI3C_Read); - } - } - - stateParams->state_complete = true; -} - -static void I3C_TransferStateMachineTransferDataState(I3C_Type *base, - i3c_master_handle_t *handle, - i3c_master_state_machine_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - - i3c_puint8_to_u32_t dataBuff; - if (handle->transfer.direction == kI3C_Write) - { - /* Make sure there is room in the tx fifo. */ - if (0UL == (stateParams->txCount)--) - { - stateParams->state_complete = true; - return; - } - - /* Put byte to send in fifo. */ - dataBuff.puint8 = (uint8_t *)handle->transfer.data; - if (handle->transfer.dataSize > 1U) - { - base->MWDATAB = *dataBuff.puint8; - } - else - { - base->MWDATABE = *dataBuff.puint8; - } - dataBuff.u32 = dataBuff.u32 + 1U; - (handle->transfer.dataSize)--; - handle->transfer.data = (void *)(dataBuff.puint8); - - /* Move to stop when the transfer is done. */ - if (--handle->remainingBytes == 0UL) - { - handle->state = (uint8_t)kWaitForCompletionState; - } - } - else - { - /* Make sure there is data in the rx fifo. */ - if (0UL == (stateParams->rxCount)--) - { - stateParams->state_complete = true; - return; - } - - /* Read byte from fifo. */ - dataBuff.puint8 = (uint8_t *)handle->transfer.data; - *dataBuff.puint8 = (uint8_t)base->MRDATAB; - dataBuff.u32 = dataBuff.u32 + 1U; - handle->transfer.data = (void *)(dataBuff.puint8); - - /* Move to stop when the transfer is done. */ - if (--handle->remainingBytes == 0UL) - { - handle->state = (uint8_t)kWaitForCompletionState; - } - - if ((handle->rxTermOps == kI3C_RxTermLastByte) && (handle->remainingBytes == 1UL)) - { - base->MCTRL |= I3C_MCTRL_RDTERM(1UL); - } - } -} - -static void I3C_TransferStateMachineWaitForCompletionState(i3c_master_handle_t *handle, - i3c_master_state_machine_param_t *stateParams) -{ - /* We stay in this state until the maste complete. */ - if (0UL != (stateParams->status & (uint32_t)kI3C_MasterCompleteFlag)) - { - handle->state = (uint8_t)kStopState; - } - else - { - stateParams->state_complete = true; - } -} - -static void I3C_TransferStateMachineStopState(I3C_Type *base, - i3c_master_handle_t *handle, - i3c_master_state_machine_param_t *stateParams) -{ - /* Only issue a stop transition if the caller requested it. */ - if (0UL == (handle->transfer.flags & (uint32_t)kI3C_TransferNoStopFlag)) - { - /* Make sure there is room in the tx fifo for the stop command. */ - if (0UL == (stateParams->txCount)--) - { - stateParams->state_complete = true; - return; - } - if (handle->transfer.busType == kI3C_TypeI3CDdr) - { - I3C_MasterEmitRequest(base, kI3C_RequestForceExit); - } - else - { - (void)I3C_MasterEmitStop(base, false); - } - } - stateParams->state_complete = true; -} - -static status_t I3C_RunTransferStateMachine(I3C_Type *base, i3c_master_handle_t *handle, bool *isDone) -{ - i3c_master_state_machine_param_t stateParams; - (void)memset(&stateParams, 0, sizeof(stateParams)); - - stateParams.result = kStatus_Success; - stateParams.state_complete = false; - - /* Set default isDone return value. */ - *isDone = false; - - uint32_t errStatus; - size_t txFifoSize = - 2UL << ((base->SCAPABILITIES & I3C_SCAPABILITIES_FIFOTX_MASK) >> I3C_SCAPABILITIES_FIFOTX_SHIFT); - - /* Check for errors. */ - stateParams.status = (uint32_t)I3C_MasterGetPendingInterrupts(base); - I3C_MasterClearStatusFlags(base, stateParams.status); - - stateParams.masterState = I3C_MasterGetState(base); - errStatus = I3C_MasterGetErrorStatusFlags(base); - stateParams.result = I3C_MasterCheckAndClearError(base, errStatus); - if (kStatus_Success != stateParams.result) - { - return stateParams.result; - } - - if (0UL != (stateParams.status & (uint32_t)kI3C_MasterSlave2MasterFlag)) - { - if (handle->callback.slave2Master != NULL) - { - handle->callback.slave2Master(base, handle->userData); - } - } - - if ((0UL != (stateParams.status & (uint32_t)kI3C_MasterSlaveStartFlag)) && - (handle->transfer.busType != kI3C_TypeI2C)) - { - handle->state = (uint8_t)kSlaveStartState; - } - - if ((stateParams.masterState == kI3C_MasterStateIbiRcv) || (stateParams.masterState == kI3C_MasterStateIbiAck)) - { - handle->state = (uint8_t)kIBIWonState; - } - - if (handle->state == (uint8_t)kIdleState) - { - return stateParams.result; - } - - /* Get fifo counts and compute room in tx fifo. */ - I3C_MasterGetFifoCounts(base, &stateParams.rxCount, &stateParams.txCount); - stateParams.txCount = txFifoSize - stateParams.txCount; - - while (!stateParams.state_complete) - { - /* Execute the state. */ - switch (handle->state) - { - case (uint8_t)kSlaveStartState: - /* Emit start + 0x7E */ - I3C_MasterEmitRequest(base, kI3C_RequestAutoIbi); - handle->state = (uint8_t)kIBIWonState; - stateParams.state_complete = true; - break; - - case (uint8_t)kIBIWonState: - I3C_TransferStateMachineIBIWonState(base, handle, &stateParams); - break; - - case (uint8_t)kSendCommandState: - I3C_TransferStateMachineSendCommandState(base, handle, &stateParams); - break; - - case (uint8_t)kWaitRepeatedStartCompleteState: - I3C_TransferStateMachineWaitRepeatedStartCompleteState(base, handle, &stateParams); - break; - - case (uint8_t)kTransferDataState: - I3C_TransferStateMachineTransferDataState(base, handle, &stateParams); - break; - - case (uint8_t)kWaitForCompletionState: - I3C_TransferStateMachineWaitForCompletionState(handle, &stateParams); - break; - - case (uint8_t)kStopState: - I3C_TransferStateMachineStopState(base, handle, &stateParams); - *isDone = true; - break; - - default: - assert(false); - break; - } - } - return stateParams.result; -} - -static status_t I3C_InitTransferStateMachine(I3C_Type *base, i3c_master_handle_t *handle) -{ - i3c_master_transfer_t *xfer = &handle->transfer; - status_t result = kStatus_Success; - i3c_direction_t direction = xfer->direction; - - if (xfer->busType != kI3C_TypeI3CDdr) - { - direction = (0UL != xfer->subaddressSize) ? kI3C_Write : xfer->direction; - } - - if (0UL != (xfer->flags & (uint32_t)kI3C_TransferStartWithBroadcastAddr)) - { - if (0UL != (xfer->flags & (uint32_t)kI3C_TransferNoStartFlag)) - { - return kStatus_InvalidArgument; - } - - if (0UL != (xfer->flags & (uint32_t)kI3C_TransferRepeatedStartFlag)) - { - return kStatus_InvalidArgument; - } - - /* Issue 0x7E as start. */ - result = I3C_MasterStart(base, xfer->busType, 0x7E, kI3C_Write); - if (result != kStatus_Success) - { - return result; - } - - result = I3C_MasterWaitForCtrlDone(base, false); - if (result != kStatus_Success) - { - return result; - } - } - - /* Handle no start option. */ - if (0U != (xfer->flags & (uint32_t)kI3C_TransferNoStartFlag)) - { - /* No need to send start flag, directly go to send command or data */ - if (xfer->subaddressSize > 0UL) - { - handle->state = (uint8_t)kSendCommandState; - } - else - { - if (direction == kI3C_Write) - { - /* Next state, send data. */ - handle->state = (uint8_t)kTransferDataState; - } - else - { - /* Only support write with no stop signal. */ - return kStatus_InvalidArgument; - } - } - I3C_MasterTransferHandleIRQ(base, handle); - return result; - } - /* If repeated start is requested, send repeated start. */ - else if (0U != (xfer->flags & (uint32_t)kI3C_TransferRepeatedStartFlag)) - { - result = I3C_MasterRepeatedStart(base, xfer->busType, xfer->slaveAddress, direction); - } - else /* For normal transfer, send start. */ - { - result = I3C_MasterStart(base, xfer->busType, xfer->slaveAddress, direction); - } - - if (xfer->subaddressSize > 0U) - { - handle->state = (uint8_t)kSendCommandState; - } - else if (xfer->dataSize != 0U) - { - handle->state = (uint8_t)kTransferDataState; - } - else - { - handle->state = (uint8_t)kStopState; - } - - if ((handle->remainingBytes < 256U) && (direction == kI3C_Read)) - { - handle->rxTermOps = (handle->rxTermOps == kI3C_RxTermDisable) ? handle->rxTermOps : kI3C_RxAutoTerm; - base->MCTRL |= I3C_MCTRL_RDTERM(handle->remainingBytes); - } - - return result; -} - -/*! - * brief Performs a non-blocking transaction on the I2C/I3C bus. - * - * param base The I3C peripheral base address. - * param handle Pointer to the I3C master driver handle. - * param transfer The pointer to the transfer descriptor. - * retval #kStatus_Success The transaction was started successfully. - * retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - */ -status_t I3C_MasterTransferNonBlocking(I3C_Type *base, i3c_master_handle_t *handle, i3c_master_transfer_t *transfer) -{ - assert(NULL != handle); - assert(NULL != transfer); - assert(transfer->subaddressSize <= sizeof(transfer->subaddress)); - i3c_master_state_t masterState = I3C_MasterGetState(base); - bool checkDdrState = false; - - /* Return busy if another transaction is in progress. */ - if (handle->state != (uint8_t)kIdleState) - { - return kStatus_I3C_Busy; - } - - /* Return an error if the bus is already in use not by us. */ - checkDdrState = (transfer->busType == kI3C_TypeI3CDdr) ? (masterState != kI3C_MasterStateDdr) : true; - if ((masterState != kI3C_MasterStateIdle) && (masterState != kI3C_MasterStateNormAct) && checkDdrState) - { - return kStatus_I3C_Busy; - } - - /* Disable I3C IRQ sources while we configure stuff. */ - I3C_MasterDisableInterrupts(base, (uint32_t)kMasterIrqFlags); - - /* Save transfer into handle. */ - handle->transfer = *transfer; - handle->remainingBytes = transfer->dataSize; - - /* Configure IBI response type. */ - base->MCTRL &= ~I3C_MCTRL_IBIRESP_MASK; - base->MCTRL |= I3C_MCTRL_IBIRESP(transfer->ibiResponse); - - /* Clear all flags. */ - I3C_MasterClearErrorStatusFlags(base, (uint32_t)kMasterErrorFlags); - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - /* Reset fifos. These flags clear automatically. */ - base->MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - - if ((transfer->flags & (uint32_t)kI3C_TransferDisableRxTermFlag) != 0U) - { - handle->rxTermOps = kI3C_RxTermDisable; - } - else if (transfer->dataSize <= 255U) - { - handle->rxTermOps = kI3C_RxAutoTerm; - } - else - { - handle->rxTermOps = kI3C_RxTermLastByte; - } - - /* Generate commands to send. */ - (void)I3C_InitTransferStateMachine(base, handle); - - /* Enable I3C internal IRQ sources. NVIC IRQ was enabled in CreateHandle() */ - I3C_MasterEnableInterrupts(base, (uint32_t)kMasterIrqFlags); - - if (transfer->direction == kI3C_Write) - { - I3C_MasterEnableInterrupts(base, (uint32_t)kI3C_MasterTxReadyFlag); - } - - return kStatus_Success; -} - -/*! - * brief Returns number of bytes transferred so far. - * param base The I3C peripheral base address. - * param handle Pointer to the I3C master driver handle. - * param[out] count Number of bytes transferred so far by the non-blocking transaction. - * retval #kStatus_Success - * retval #kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t I3C_MasterTransferGetCount(I3C_Type *base, i3c_master_handle_t *handle, size_t *count) -{ - assert(NULL != handle); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (handle->state == (uint8_t)kIdleState) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - uint8_t state; - uint32_t remainingBytes; - uint32_t dataSize; - - /* Cache some fields with IRQs disabled. This ensures all field values */ - /* are synchronized with each other during an ongoing transfer. */ - uint32_t irqs = I3C_MasterGetEnabledInterrupts(base); - I3C_MasterDisableInterrupts(base, irqs); - state = handle->state; - remainingBytes = handle->remainingBytes; - dataSize = handle->transfer.dataSize; - I3C_MasterEnableInterrupts(base, irqs); - - /* Get transfer count based on current transfer state. */ - switch (state) - { - case (uint8_t)kIdleState: - case (uint8_t)kSendCommandState: - *count = 0; - break; - - case (uint8_t)kTransferDataState: - *count = dataSize - remainingBytes; - break; - - case (uint8_t)kStopState: - case (uint8_t)kWaitForCompletionState: - default: - *count = dataSize; - break; - } - - return kStatus_Success; -} - -/*! - * brief Terminates a non-blocking I3C master transmission early. - * - * note It is not safe to call this function from an IRQ handler that has a higher priority than the - * I3C peripheral's IRQ priority. - * - * param base The I3C peripheral base address. - * param handle Pointer to the I3C master driver handle. - * retval #kStatus_Success A transaction was successfully aborted. - * retval #kStatus_I3C_Idle There is not a non-blocking transaction currently in progress. - */ -void I3C_MasterTransferAbort(I3C_Type *base, i3c_master_handle_t *handle) -{ - if (handle->state != (uint8_t)kIdleState) - { - /* Disable internal IRQ enables. */ - I3C_MasterDisableInterrupts(base, (uint32_t)kMasterIrqFlags); - - /* Reset fifos. These flags clear automatically. */ - base->MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - - /* Send a stop command to finalize the transfer. */ - (void)I3C_MasterStop(base); - - /* Reset handle. */ - handle->state = (uint8_t)kIdleState; - } -} - -/*! - * brief Reusable routine to handle master interrupts. - * note This function does not need to be called unless you are reimplementing the - * nonblocking API's interrupt handler routines to add special functionality. - * param base The I3C peripheral base address. - * param intHandle Pointer to the I3C master driver handle. - */ -void I3C_MasterTransferHandleIRQ(I3C_Type *base, void *intHandle) -{ - i3c_master_handle_t *handle = (i3c_master_handle_t *)intHandle; - status_t result; - bool isDone; - - /* Don't do anything if we don't have a valid handle. */ - if (NULL == handle) - { - return; - } - - result = I3C_RunTransferStateMachine(base, handle, &isDone); - - if (handle->state == (uint8_t)kIdleState) - { - I3C_MasterDisableInterrupts(base, (uint32_t)kI3C_MasterTxReadyFlag); - return; - } - - if (isDone || (result != kStatus_Success)) - { - /* XXX need to handle data that may be in rx fifo below watermark level? */ - - /* XXX handle error, terminate xfer */ - if ((result == kStatus_I3C_Nak) || (result == kStatus_I3C_IBIWon)) - { - (void)I3C_MasterEmitStop(base, false); - } - - /* Disable internal IRQ enables. */ - I3C_MasterDisableInterrupts(base, (uint32_t)kI3C_MasterTxReadyFlag); - - /* Set handle to idle state. */ - handle->state = (uint8_t)kIdleState; - - /* Invoke IBI user callback. */ - if ((result == kStatus_I3C_IBIWon) && (handle->callback.ibiCallback != NULL)) - { - handle->callback.ibiCallback(base, handle, handle->ibiType, kI3C_IbiReady); - handle->ibiPayloadSize = 0; - } - - /* Invoke callback. */ - if (NULL != handle->callback.transferComplete) - { - handle->callback.transferComplete(base, handle, result, handle->userData); - } - } -} - -/*! - * brief Provides a default configuration for the I3C slave peripheral. - * - * This function provides the following default configuration for the I3C slave peripheral: - * code - * slaveConfig->enableslave = true; - * endcode - * - * After calling this function, you can override any settings in order to customize the configuration, - * prior to initializing the slave driver with I3C_SlaveInit(). - * - * param[out] slaveConfig User provided configuration structure for default values. Refer to #i3c_slave_config_t. - */ -void I3C_SlaveGetDefaultConfig(i3c_slave_config_t *slaveConfig) -{ - assert(NULL != slaveConfig); - - (void)memset(slaveConfig, 0, sizeof(*slaveConfig)); - - slaveConfig->enableSlave = true; -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) && FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) - slaveConfig->isHotJoin = false; -#endif - slaveConfig->vendorID = 0x11BU; -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) - slaveConfig->enableRandomPart = false; -#endif - slaveConfig->partNumber = 0; - slaveConfig->dcr = 0; /* Generic device. */ - slaveConfig->bcr = - 0; /* BCR[7:6]: device role, I3C slave(2b'00), BCR[5]: SDR Only / SDR and HDR Capable, SDR and HDR - Capable(1b'1), BCR[4]: Bridge Identifier, Not a bridge device(1b'0), BCR[3]: Offline Capable, device is - offline capable(1b'1), BCR[2]: IBI Payload, No data byte following(1b'0), BCR[1]: IBI Request Capable, - capable(1b'1), BCR[0]: Max Data Speed Limitation, has limitation(1b'1). */ - slaveConfig->hdrMode = (uint8_t)kI3C_HDRModeDDR; - slaveConfig->nakAllRequest = false; - slaveConfig->ignoreS0S1Error = true; - slaveConfig->offline = false; - slaveConfig->matchSlaveStartStop = false; - slaveConfig->maxWriteLength = 256U; - slaveConfig->maxReadLength = 256U; -} - -/*! - * brief Initializes the I3C slave peripheral. - * - * This function enables the peripheral clock and initializes the I3C slave peripheral as described by the user - * provided configuration. - * - * param base The I3C peripheral base address. - * param slaveConfig User provided peripheral configuration. Use I3C_SlaveGetDefaultConfig() to get a set of - * defaults that you can override. - * param slowClock_Hz Frequency in Hertz of the I3C slow clock. Used to calculate the bus match condition values. - * If FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH defines as 1, this parameter is useless. - */ -void I3C_SlaveInit(I3C_Type *base, const i3c_slave_config_t *slaveConfig, uint32_t slowClock_Hz) -{ - assert(NULL != slaveConfig); - assert((slowClock_Hz >= 1000000U) || (slowClock_Hz == 0U)); - - uint32_t configValue; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) || \ - !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) - uint32_t instance = I3C_GetInstance(base); -#endif - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate the clock. */ - CLOCK_EnableClock(kI3cClocks[instance]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) - /* Reset the I3C module */ - RESET_PeripheralReset(kI3cResets[instance]); -#endif - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - uint8_t matchCount; - /* Set as (slowClk(MHz) - 1) to generate 1us clock cycle for IBI request to drive SDA low. Note: Use BAMATCH = 1 to - generate 1us clock cycle if slow clock is 1MHz. The value of 0 would not give a correct match indication. */ - if (slowClock_Hz != 0U) - { - matchCount = (uint8_t)(slowClock_Hz / 1000000UL) - 1U; - matchCount = (matchCount == 0U) ? 1U : matchCount; - } - else - { - /* BAMATCH has default value based on Soc default slow clock after reset, using this default value when slowClock_Hz is 0. */ - matchCount = (uint8_t)((base->SCONFIG & I3C_SCONFIG_BAMATCH_MASK) >> I3C_SCONFIG_BAMATCH_SHIFT); - } -#endif - - configValue = base->SCONFIG; - configValue &= - ~(I3C_SCONFIG_SADDR_MASK | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - I3C_SCONFIG_BAMATCH_MASK | -#endif - I3C_SCONFIG_OFFLINE_MASK | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) - I3C_SCONFIG_IDRAND_MASK | -#endif -#if defined(FSL_FEATURE_I3C_HAS_HDROK) && FSL_FEATURE_I3C_HAS_HDROK - I3C_SCONFIG_HDROK_MASK | -#else - I3C_SCONFIG_DDROK_MASK | -#endif - I3C_SCONFIG_S0IGNORE_MASK | I3C_SCONFIG_MATCHSS_MASK | I3C_SCONFIG_NACK_MASK | I3C_SCONFIG_SLVENA_MASK); - configValue |= I3C_SCONFIG_SADDR(slaveConfig->staticAddr) | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - I3C_SCONFIG_BAMATCH(matchCount) | -#endif - I3C_SCONFIG_OFFLINE(slaveConfig->offline) | -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) - I3C_SCONFIG_IDRAND(slaveConfig->enableRandomPart) | -#endif -#if defined(FSL_FEATURE_I3C_HAS_HDROK) && FSL_FEATURE_I3C_HAS_HDROK - I3C_SCONFIG_HDROK((0U != (slaveConfig->hdrMode & (uint8_t)kI3C_HDRModeDDR)) ? 1U : 0U) | -#else - I3C_SCONFIG_DDROK((0U != (slaveConfig->hdrMode & (uint8_t)kI3C_HDRModeDDR)) ? 1U : 0U) | -#endif - I3C_SCONFIG_S0IGNORE(slaveConfig->ignoreS0S1Error) | - I3C_SCONFIG_MATCHSS(slaveConfig->matchSlaveStartStop) | - I3C_SCONFIG_NACK(slaveConfig->nakAllRequest) | I3C_SCONFIG_SLVENA(slaveConfig->enableSlave); - - base->SVENDORID &= ~I3C_SVENDORID_VID_MASK; - base->SVENDORID |= I3C_SVENDORID_VID(slaveConfig->vendorID); - -#if defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_IDRAND - base->SIDPARTNO = slaveConfig->partNumber; -#else - if (!slaveConfig->enableRandomPart) - { - base->SIDPARTNO = slaveConfig->partNumber; - } -#endif - - base->SIDEXT &= ~(I3C_SIDEXT_BCR_MASK | I3C_SIDEXT_DCR_MASK); - base->SIDEXT |= I3C_SIDEXT_BCR(slaveConfig->bcr) | I3C_SIDEXT_DCR(slaveConfig->dcr); - - base->SMAXLIMITS &= ~(I3C_SMAXLIMITS_MAXRD_MASK | I3C_SMAXLIMITS_MAXWR_MASK); - base->SMAXLIMITS |= - (I3C_SMAXLIMITS_MAXRD(slaveConfig->maxReadLength) | I3C_SMAXLIMITS_MAXWR(slaveConfig->maxWriteLength)); - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) && FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) - if (slaveConfig->isHotJoin) - { - I3C_SlaveRequestEvent(base, kI3C_SlaveEventHotJoinReq); - } -#endif - base->SCONFIG = configValue; -} - -/*! - * brief Deinitializes the I3C master peripheral. - * - * This function disables the I3C master peripheral and gates the clock. It also performs a software - * reset to restore the peripheral to reset conditions. - * - * param base The I3C peripheral base address. - */ -void I3C_SlaveDeinit(I3C_Type *base) -{ - uint32_t idx = I3C_GetInstance(base); - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_RESET) && FSL_FEATURE_I3C_HAS_NO_RESET) - /* Reset the I3C module */ - RESET_PeripheralReset(kI3cResets[idx]); -#endif - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate clock. */ - CLOCK_DisableClock(kI3cClocks[idx]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Reset handle pointer */ - s_i3cSlaveHandle[idx] = NULL; -} - -/*! - * @brief Gets the I3C slave state. - * - * @param base The I3C peripheral base address. - * @return I3C slave activity state, refer #i3c_slave_activity_state_t. - */ -i3c_slave_activity_state_t I3C_SlaveGetActivityState(I3C_Type *base) -{ - uint8_t activeState = (uint8_t)((base->SSTATUS & I3C_SSTATUS_ACTSTATE_MASK) >> I3C_SSTATUS_ACTSTATE_SHIFT); - i3c_slave_activity_state_t returnCode; - switch (activeState) - { - case (uint8_t)kI3C_SlaveNoLatency: - returnCode = kI3C_SlaveNoLatency; - break; - case (uint8_t)kI3C_SlaveLatency1Ms: - returnCode = kI3C_SlaveLatency1Ms; - break; - case (uint8_t)kI3C_SlaveLatency100Ms: - returnCode = kI3C_SlaveLatency100Ms; - break; - case (uint8_t)kI3C_SlaveLatency10S: - returnCode = kI3C_SlaveLatency10S; - break; - default: - returnCode = kI3C_SlaveNoLatency; - break; - } - - return returnCode; -} - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) && FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) -/*! - * brief I3C slave request event. - * - * param base The I3C peripheral base address. - * param event I3C slave event of type #i3c_slave_event_t - * param data IBI data if In-band interrupt has data, only applicable for event type #kI3C_SlaveEventIBI - */ -void I3C_SlaveRequestEvent(I3C_Type *base, i3c_slave_event_t event) -{ - uint32_t ctrlValue = base->SCTRL; - - ctrlValue &= ~I3C_SCTRL_EVENT_MASK; - ctrlValue |= I3C_SCTRL_EVENT(event); - - base->SCTRL = ctrlValue; -} - -/*! - * brief I3C slave request event. - * deprecated Do not use this function. It has been superseded by @ref I3C_SlaveRequestIBIWithData. - * - * param base The I3C peripheral base address. - * param data IBI data - * param dataSize IBI data size. - */ -void I3C_SlaveRequestIBIWithSingleData(I3C_Type *base, uint8_t data, size_t dataSize) -{ - uint32_t ctrlValue = base->SCTRL; - - ctrlValue &= ~(I3C_SCTRL_EVENT_MASK | I3C_SCTRL_IBIDATA_MASK); - ctrlValue |= I3C_SCTRL_EVENT(1U) | I3C_SCTRL_IBIDATA(data); - - base->SCTRL = ctrlValue; -} - -/*! - * brief I3C slave request IBI event with data payload(mandatory and extended). - * - * param base The I3C peripheral base address. - * param data Pointer to IBI data to be sent in the request. - * param dataSize IBI data size. - */ -void I3C_SlaveRequestIBIWithData(I3C_Type *base, uint8_t *data, size_t dataSize) -{ - assert((dataSize > 0U) && (dataSize <= 8U)); - - uint32_t ctrlValue; - -#if (defined(I3C_IBIEXT1_MAX_MASK) && I3C_IBIEXT1_MAX_MASK) - if (dataSize > 1U) - { - ctrlValue = I3C_IBIEXT1_EXT1(data[1]); - if (dataSize > 2U) - { - ctrlValue |= I3C_IBIEXT1_EXT2(data[2]); - } - if (dataSize > 3U) - { - ctrlValue |= I3C_IBIEXT1_EXT3(data[3]); - } - ctrlValue |= I3C_IBIEXT1_CNT(dataSize - 1U); - base->IBIEXT1 = ctrlValue; - } - - if (dataSize > 4U) - { - ctrlValue = I3C_IBIEXT2_EXT4(data[4]); - if (dataSize > 5U) - { - ctrlValue |= I3C_IBIEXT2_EXT5(data[5]); - } - if (dataSize > 6U) - { - ctrlValue |= I3C_IBIEXT2_EXT6(data[6]); - } - if (dataSize > 7U) - { - ctrlValue |= I3C_IBIEXT2_EXT7(data[7]); - } - base->IBIEXT2 = ctrlValue; - } -#endif - - ctrlValue = base->SCTRL; -#if (defined(I3C_IBIEXT1_MAX_MASK) && I3C_IBIEXT1_MAX_MASK) - ctrlValue &= ~(I3C_SCTRL_EVENT_MASK | I3C_SCTRL_IBIDATA_MASK | I3C_SCTRL_EXTDATA_MASK); - ctrlValue |= I3C_SCTRL_EVENT(1U) | I3C_SCTRL_IBIDATA(data[0]) | I3C_SCTRL_EXTDATA(dataSize > 1U); -#else - ctrlValue &= ~(I3C_SCTRL_EVENT_MASK | I3C_SCTRL_IBIDATA_MASK); - ctrlValue |= I3C_SCTRL_EVENT(1U) | I3C_SCTRL_IBIDATA(data[0]); -#endif - base->SCTRL = ctrlValue; -} -#endif /* !(defined(FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) && FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) */ - -/*! - * brief Performs a polling send transfer on the I3C bus. - * - * param base The I3C peripheral base address. - * param txBuff The pointer to the data to be transferred. - * param txSize The length in bytes of the data to be transferred. - * return Error or success status returned by API. - */ -status_t I3C_SlaveSend(I3C_Type *base, const void *txBuff, size_t txSize) -{ - const uint8_t *buf = (const uint8_t *)((const void *)txBuff); - status_t result = kStatus_Success; - - assert(NULL != txBuff); - - /* Send data buffer */ - while (0UL != txSize--) - { - /* Wait until there is room in the fifo. This also checks for errors. */ - result = I3C_SlaveWaitForTxReady(base); - if (kStatus_Success != result) - { - return result; - } - - /* Write byte into I3C slave data register. */ - if (0UL != txSize) - { - base->SWDATAB = *buf++; - } - else - { - base->SWDATABE = *buf++; - } - } - - return result; -} - -/*! - * brief Performs a polling receive transfer on the I3C bus. - * - * param base The I3C peripheral base address. - * param rxBuff The pointer to the data to be transferred. - * param rxSize The length in bytes of the data to be transferred. - * return Error or success status returned by API. - */ -status_t I3C_SlaveReceive(I3C_Type *base, void *rxBuff, size_t rxSize) -{ - status_t result = kStatus_Success; - uint8_t *buf; - - assert(NULL != rxBuff); - - /* Handle empty read. */ - if (0UL == rxSize) - { - return kStatus_Success; - } - -#if I3C_RETRY_TIMES - uint32_t waitTimes = I3C_RETRY_TIMES; -#endif - - /* Receive data */ - buf = (uint8_t *)rxBuff; - while (0UL != rxSize) - { -#if I3C_RETRY_TIMES - if (--waitTimes == 0) - { - return kStatus_I3C_Timeout; - } -#endif - /* Check for errors. */ - result = I3C_SlaveCheckAndClearError(base, I3C_SlaveGetErrorStatusFlags(base)); - if (kStatus_Success != result) - { - return result; - } - - /* Check RX data */ - if (0UL != (base->SDATACTRL & I3C_SDATACTRL_RXCOUNT_MASK)) - { - *buf++ = (uint8_t)(base->SRDATAB & I3C_SRDATAB_DATA0_MASK); - rxSize--; - } - } - - return result; -} - -/*! - * brief Creates a new handle for the I3C slave non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the I3C_SlaveTransferAbort() API shall be called. - * - * note The function also enables the NVIC IRQ for the input I3C. Need to notice - * that on some SoCs the I3C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - - * param base The I3C peripheral base address. - * param[out] handle Pointer to the I3C slave driver handle. - * param callback User provided pointer to the asynchronous callback function. - * param userData User provided pointer to the application callback data. - */ -void I3C_SlaveTransferCreateHandle(I3C_Type *base, - i3c_slave_handle_t *handle, - i3c_slave_transfer_callback_t callback, - void *userData) -{ - uint32_t instance; - - assert(NULL != handle); - - /* Clear out the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Look up instance number */ - instance = I3C_GetInstance(base); - - /* Save base and instance. */ - handle->callback = callback; - handle->userData = userData; - - /* Save Tx FIFO Size. */ - handle->txFifoSize = - 2U << ((base->SCAPABILITIES & I3C_SCAPABILITIES_FIFOTX_MASK) >> I3C_SCAPABILITIES_FIFOTX_SHIFT); - - /* Save this handle for IRQ use. */ - s_i3cSlaveHandle[instance] = handle; - - /* Set irq handler. */ - s_i3cSlaveIsr = I3C_SlaveTransferHandleIRQ; - - /* Clear internal IRQ enables and enable NVIC IRQ. */ - I3C_SlaveDisableInterrupts(base, (uint32_t)kSlaveIrqFlags); - (void)EnableIRQ(kI3cIrqs[instance]); -} - -/*! - * brief Starts accepting slave transfers. - * - * Call this API after calling I2C_SlaveInit() and I3C_SlaveTransferCreateHandle() to start processing - * transactions driven by an I2C master. The slave monitors the I2C bus and pass events to the - * callback that was passed into the call to I3C_SlaveTransferCreateHandle(). The callback is always invoked - * from the interrupt context. - * - * The set of events received by the callback is customizable. To do so, set the a eventMask parameter to - * the OR'd combination of #i3c_slave_transfer_event_t enumerators for the events you wish to receive. - * The #kI3C_SlaveTransmitEvent and #kI3C_SlaveReceiveEvent events are always enabled and do not need - * to be included in the mask. Alternatively, you can pass 0 to get a default set of only the transmit and - * receive events that are always enabled. In addition, the #kI3C_SlaveAllEvents constant is provided as - * a convenient way to enable all events. - * - * param base The I3C peripheral base address. - * param handle Pointer to #i3c_slave_handle_t structure which stores the transfer state. - * param eventMask Bit mask formed by OR'ing together #i3c_slave_transfer_event_t enumerators to specify - * which events to send to the callback. Other accepted values are 0 to get a default set of - * only the transmit and receive events, and #kI3C_SlaveAllEvents to enable all events. - * - * retval #kStatus_Success Slave transfers were successfully started. - * retval #kStatus_I3C_Busy Slave transfers have already been started on this handle. - */ -status_t I3C_SlaveTransferNonBlocking(I3C_Type *base, i3c_slave_handle_t *handle, uint32_t eventMask) -{ - assert(NULL != handle); - - /* Return busy if another transaction is in progress. */ - if (handle->isBusy) - { - return kStatus_I3C_Busy; - } - - /* Disable I3C IRQ sources while we configure stuff. */ - I3C_SlaveDisableInterrupts(base, (uint32_t)kSlaveIrqFlags); - - /* Clear transfer in handle. */ - (void)memset(&handle->transfer, 0, sizeof(handle->transfer)); - - /* Set up event mask. tx and rx are always enabled. */ - handle->eventMask = eventMask | (uint32_t)kI3C_SlaveTransmitEvent | (uint32_t)kI3C_SlaveReceiveEvent; - - /* Clear all flags. */ - I3C_SlaveClearStatusFlags(base, (uint32_t)kSlaveClearFlags); - - /* Enable I3C internal IRQ sources. NVIC IRQ was enabled in CreateHandle() */ - I3C_SlaveEnableInterrupts(base, (uint32_t)kSlaveIrqFlags); - - return kStatus_Success; -} - -/*! - * brief Gets the slave transfer status during a non-blocking transfer. - * param base The I3C peripheral base address. - * param handle Pointer to i2c_slave_handle_t structure. - * param[out] count Pointer to a value to hold the number of bytes transferred. May be NULL if the count is not - * required. - * retval #kStatus_Success - * retval #kStatus_NoTransferInProgress - */ -status_t I3C_SlaveTransferGetCount(I3C_Type *base, i3c_slave_handle_t *handle, size_t *count) -{ - assert(NULL != handle); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (!handle->isBusy) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - /* For an active transfer, just return the count from the handle. */ - *count = handle->transferredCount; - - return kStatus_Success; -} - -/*! - * brief Aborts the slave non-blocking transfers. - * note This API could be called at any time to stop slave for handling the bus events. - * param base The I3C peripheral base address. - * param handle Pointer to #i3c_slave_handle_t structure which stores the transfer state. - * retval #kStatus_Success - * retval #kStatus_I3C_Idle - */ -void I3C_SlaveTransferAbort(I3C_Type *base, i3c_slave_handle_t *handle) -{ - assert(NULL != handle); - - /* Return idle if no transaction is in progress. */ - if (handle->isBusy) - { - /* Disable I3C IRQ sources. */ - I3C_SlaveDisableInterrupts(base, (uint32_t)kSlaveIrqFlags); - - /* Reset transfer info. */ - (void)memset(&handle->transfer, 0, sizeof(handle->transfer)); - - /* We're no longer busy. */ - handle->isBusy = false; - } -} - -static bool I3C_SlaveTransferHandleGetStatusFlags(I3C_Type *base, - i3c_slave_handle_t *handle, - i3c_slave_handleIrq_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - /* Check for a valid handle in case of a spurious interrupt. */ - uint32_t errFlags; - stateParams->flags = I3C_SlaveGetStatusFlags(base); - errFlags = I3C_SlaveGetErrorStatusFlags(base); - - stateParams->pendingInts = I3C_SlaveGetPendingInterrupts(base); - stateParams->enabledInts = I3C_SlaveGetEnabledInterrupts(base); - - if (0UL != (errFlags & (uint32_t)kSlaveErrorFlags)) - { - handle->transfer.event = (uint32_t)kI3C_SlaveCompletionEvent; - handle->transfer.completionStatus = I3C_SlaveCheckAndClearError(base, errFlags); - - if ((0UL != (handle->eventMask & (uint32_t)kI3C_SlaveCompletionEvent)) && (NULL != handle->callback)) - { - handle->callback(base, &handle->transfer, handle->userData); - } - return false; - } - return true; -} - -static void I3C_SlaveTransferHandleBusStart(I3C_Type *base, i3c_slave_transfer_t *xfer, uint32_t *pendingInts) -{ - base->SDATACTRL |= I3C_SDATACTRL_FLUSHTB_MASK; - xfer->txDataSize = 0; - I3C_SlaveEnableInterrupts(base, (uint32_t)kI3C_SlaveTxReadyFlag); - (*pendingInts) |= (uint32_t)kI3C_SlaveTxReadyFlag; -} - -static void I3C_SlaveTransferHandleEventSent(I3C_Type *base, i3c_slave_handle_t *handle, i3c_slave_transfer_t *xfer) -{ - xfer->event = (uint32_t)kI3C_SlaveRequestSentEvent; - if ((0UL != (handle->eventMask & xfer->event)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } -} - -static void I3C_SlaveTransferHandleReceivedCCC(I3C_Type *base, i3c_slave_handle_t *handle, i3c_slave_transfer_t *xfer) -{ - handle->isBusy = true; - xfer->event = (uint32_t)kI3C_SlaveReceivedCCCEvent; - if ((0UL != (handle->eventMask & xfer->event)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } -} - -static void I3C_SlaveTransferHandleBusStop(I3C_Type *base, - i3c_slave_handle_t *handle, - i3c_slave_handleIrq_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - I3C_SlaveDisableInterrupts(base, (uint32_t)kI3C_SlaveTxReadyFlag); - stateParams->pendingInts &= ~(uint32_t)kI3C_SlaveTxReadyFlag; - base->SDATACTRL |= I3C_SDATACTRL_FLUSHTB_MASK | I3C_SDATACTRL_FLUSHFB_MASK; - if (handle->isBusy) - { - handle->transfer.event = (uint32_t)kI3C_SlaveCompletionEvent; - handle->transfer.completionStatus = kStatus_Success; - handle->transfer.transferredCount = handle->transferredCount; - handle->isBusy = false; - - if (handle->wasTransmit) - { - /* Subtract one from the transmit count to offset the fact that I3C asserts the */ - /* tx flag before it sees the nack from the master-receiver, thus causing one more */ - /* count that the master actually receives. */ - --handle->transfer.transferredCount; - handle->wasTransmit = false; - } - - if ((0UL != (handle->eventMask & handle->transfer.event)) && (NULL != handle->callback)) - { - handle->callback(base, &handle->transfer, handle->userData); - } - - /* Clean up transfer info on completion, after the callback has been invoked. */ - (void)memset(&handle->transfer, 0, sizeof(handle->transfer)); - } -} - -static void I3C_SlaveTransferHandleMatched(I3C_Type *base, i3c_slave_handle_t *handle, i3c_slave_transfer_t *xfer) -{ - assert(NULL != base && NULL != handle && NULL != xfer); - xfer->event = (uint32_t)kI3C_SlaveAddressMatchEvent; - handle->isBusy = true; - if ((0UL != (handle->eventMask & (uint32_t)kI3C_SlaveAddressMatchEvent)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } -} - -static void I3C_SlaveTransferHandleTxReady(I3C_Type *base, - i3c_slave_handle_t *handle, - i3c_slave_handleIrq_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - handle->wasTransmit = true; - - /* If we're out of data, invoke callback to get more. */ - if ((NULL == handle->transfer.txData) || (0UL == handle->transfer.txDataSize)) - { - handle->transfer.event = (uint32_t)kI3C_SlaveTransmitEvent; - if (0UL != (stateParams->flags & (uint32_t)kI3C_SlaveBusHDRModeFlag)) - { - handle->transfer.event |= (uint32_t)kI3C_SlaveHDRCommandMatchEvent; - handle->isBusy = true; - } - if (NULL != handle->callback) - { - handle->callback(base, &handle->transfer, handle->userData); - } - - /* Clear the transferred count now that we have a new buffer. */ - handle->transferredCount = 0; - } - - if ((NULL == handle->transfer.txData) || (0UL == handle->transfer.txDataSize)) - { - I3C_SlaveDisableInterrupts(base, (uint32_t)kI3C_SlaveTxReadyFlag); - (stateParams->pendingInts) &= ~(uint32_t)kI3C_SlaveTxReadyFlag; - } - - /* Transmit a byte. */ - while ((handle->transfer.txDataSize != 0UL) && ((stateParams->txCount) != 0U)) - { - if (handle->transfer.txDataSize > 1UL) - { - base->SWDATAB = *handle->transfer.txData++; - } - else - { - base->SWDATABE = *handle->transfer.txData++; - I3C_SlaveDisableInterrupts(base, (uint32_t)kI3C_SlaveTxReadyFlag); - } - --(handle->transfer.txDataSize); - ++(handle->transferredCount); - (stateParams->txCount)--; - } -} - -static void I3C_SlaveTransferHandleRxReady(I3C_Type *base, - i3c_slave_handle_t *handle, - i3c_slave_handleIrq_param_t *stateParams) -{ - assert(NULL != base && NULL != handle && NULL != stateParams); - /* If we're out of room in the buffer, invoke callback to get another. */ - if ((NULL == handle->transfer.rxData) || (0UL == handle->transfer.rxDataSize)) - { - handle->transfer.event = (uint32_t)kI3C_SlaveReceiveEvent; - if (0UL != (stateParams->flags & (uint32_t)kI3C_SlaveBusHDRModeFlag)) - { - handle->transfer.event |= (uint32_t)kI3C_SlaveHDRCommandMatchEvent; - handle->isBusy = true; - } - if (NULL != handle->callback) - { - handle->callback(base, &handle->transfer, handle->userData); - } - handle->transferredCount = 0; - } - /* Receive a byte. */ - while ((stateParams->rxCount != 0U) && ((handle->transfer.rxData != NULL) && (handle->transfer.rxDataSize != 0UL))) - { - *(handle->transfer.rxData++) = (uint8_t)base->SRDATAB; - --(handle->transfer.rxDataSize); - ++(handle->transferredCount); - (stateParams->rxCount)--; - } -} - -/*! - * brief Reusable routine to handle slave interrupts. - * note This function does not need to be called unless you are reimplementing the - * non blocking API's interrupt handler routines to add special functionality. - * param base The I3C peripheral base address. - * param intHandle Pointer to #i3c_slave_handle_t structure which stores the transfer state. - */ -void I3C_SlaveTransferHandleIRQ(I3C_Type *base, void *intHandle) -{ - i3c_slave_handleIrq_param_t stateParams; - - (void)memset(&stateParams, 0, sizeof(stateParams)); - i3c_slave_handle_t *handle = (i3c_slave_handle_t *)intHandle; - - /* Check for a valid handle in case of a spurious interrupt. */ - if (NULL == handle) - { - return; - } - - /* Get status flags. */ - if (false == I3C_SlaveTransferHandleGetStatusFlags(base, handle, &stateParams)) - { - return; - } - - /* Clear status flags. */ - I3C_SlaveClearStatusFlags(base, stateParams.flags); - - if (0UL != (stateParams.flags & (uint32_t)kI3C_SlaveBusStartFlag)) - { - I3C_SlaveTransferHandleBusStart(base, &handle->transfer, &stateParams.pendingInts); - } - - if (0UL != (stateParams.flags & (uint32_t)kI3C_SlaveEventSentFlag)) - { - I3C_SlaveTransferHandleEventSent(base, handle, &handle->transfer); - } - - if (0UL != (stateParams.flags & (uint32_t)kI3C_SlaveReceivedCCCFlag)) - { - I3C_SlaveTransferHandleReceivedCCC(base, handle, &handle->transfer); - } - - if (0UL != (stateParams.flags & (uint32_t)kI3C_SlaveMatchedFlag)) - { - I3C_SlaveTransferHandleMatched(base, handle, &handle->transfer); - } - - /* Get fifo counts and compute room in tx fifo. */ - I3C_SlaveGetFifoCounts(base, &stateParams.rxCount, &stateParams.txCount); - stateParams.txCount = handle->txFifoSize - stateParams.txCount; - - /* Handle transmit and receive. */ - if ((0UL != (stateParams.flags & (uint32_t)kI3C_SlaveTxReadyFlag)) && - (0UL != (stateParams.pendingInts & (uint32_t)kI3C_SlaveTxReadyFlag))) - { - I3C_SlaveTransferHandleTxReady(base, handle, &stateParams); - } - - if ((0UL != (stateParams.flags & (uint32_t)kI3C_SlaveRxReadyFlag)) && - (0UL != (stateParams.enabledInts & (uint32_t)kI3C_SlaveRxReadyFlag))) - { - I3C_SlaveTransferHandleRxReady(base, handle, &stateParams); - } - - /* Handle stop event. */ - if (0UL != (stateParams.flags & (uint32_t)kI3C_SlaveBusStopFlag)) - { - I3C_SlaveTransferHandleBusStop(base, handle, &stateParams); - } -} - -static void I3C_CommonIRQHandler(I3C_Type *base, uint32_t instance) -{ - /* Check for master IRQ. */ - if (((uint32_t)kI3C_MasterOn == (base->MCONFIG & I3C_MCONFIG_MSTENA_MASK)) && (NULL != s_i3cMasterIsr)) - { - /* Master mode. */ - s_i3cMasterIsr(base, s_i3cMasterHandle[instance]); - } - - /* Check for slave IRQ. */ - if ((I3C_SCONFIG_SLVENA_MASK == (base->SCONFIG & I3C_SCONFIG_SLVENA_MASK)) && (NULL != s_i3cSlaveIsr)) - { - /* Slave mode. */ - s_i3cSlaveIsr(base, s_i3cSlaveHandle[instance]); - } - SDK_ISR_EXIT_BARRIER; -} - -#if defined(I3C) -/* Implementation of I3C handler named in startup code. */ -void I3C0_DriverIRQHandler(void); -void I3C0_DriverIRQHandler(void) -{ - I3C_CommonIRQHandler(I3C, 0); -} -#endif - -#if defined(I3C0) -/* Implementation of I3C0 handler named in startup code. */ -void I3C0_DriverIRQHandler(void); -void I3C0_DriverIRQHandler(void) -{ - I3C_CommonIRQHandler(I3C0, 0); -} -#endif - -#if defined(I3C1) -/* Implementation of I3C1 handler named in startup code. */ -void I3C1_DriverIRQHandler(void); -void I3C1_DriverIRQHandler(void) -{ - I3C_CommonIRQHandler(I3C1, 1); -} -#endif - -#if defined(I3C2) -/* Implementation of I3C2 handler named in startup code. */ -void I3C2_DriverIRQHandler(void); -void I3C2_DriverIRQHandler(void) -{ - I3C_CommonIRQHandler(I3C2, 2); -} -#endif - -#if defined(I3C3) -/* Implementation of I3C3 handler named in startup code. */ -void I3C3_DriverIRQHandler(void); -void I3C3_DriverIRQHandler(void) -{ - I3C_CommonIRQHandler(I3C3, 3); -} -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_i3c.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_i3c.h deleted file mode 100644 index 2a3b5dae82f..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_i3c.h +++ /dev/null @@ -1,1899 +0,0 @@ -/* - * Copyright 2018-2024 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_I3C_H_ -#define FSL_I3C_H_ - -#include "fsl_common.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @addtogroup i3c - * @{ - */ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief I3C driver version */ -#define FSL_I3C_DRIVER_VERSION (MAKE_VERSION(2, 12, 0)) -/*! @} */ - -/*! @brief Timeout times for waiting flag. */ -#ifndef I3C_RETRY_TIMES -#define I3C_RETRY_TIMES 0U /* Define to zero means keep waiting until the flag is assert/deassert. */ -#endif - -#define I3C_MAX_DEVCNT 10U - -#ifndef I3C_IBI_BUFF_SIZE -#define I3C_IBI_BUFF_SIZE 10U -#endif - -/*! @brief I3C status return codes. */ -enum -{ - kStatus_I3C_Busy = MAKE_STATUS(kStatusGroup_I3C, 0), /*!< The master is already performing a transfer. */ - kStatus_I3C_Idle = MAKE_STATUS(kStatusGroup_I3C, 1), /*!< The slave driver is idle. */ - kStatus_I3C_Nak = MAKE_STATUS(kStatusGroup_I3C, 2), /*!< The slave device sent a NAK in response to an address. */ - kStatus_I3C_WriteAbort = - MAKE_STATUS(kStatusGroup_I3C, 3), /*!< The slave device sent a NAK in response to a write. */ - kStatus_I3C_Term = MAKE_STATUS(kStatusGroup_I3C, 4), /*!< The master terminates slave read. */ - kStatus_I3C_HdrParityError = MAKE_STATUS(kStatusGroup_I3C, 5), /*!< Parity error from DDR read. */ - kStatus_I3C_CrcError = MAKE_STATUS(kStatusGroup_I3C, 6), /*!< CRC error from DDR read. */ - kStatus_I3C_ReadFifoError = MAKE_STATUS(kStatusGroup_I3C, 7), /*!< Read from M/SRDATAB register when FIFO empty. */ - kStatus_I3C_WriteFifoError = MAKE_STATUS(kStatusGroup_I3C, 8), /*!< Write to M/SWDATAB register when FIFO full. */ - kStatus_I3C_MsgError = - MAKE_STATUS(kStatusGroup_I3C, 9), /*!< Message SDR/DDR mismatch or read/write message in wrong state */ - kStatus_I3C_InvalidReq = MAKE_STATUS(kStatusGroup_I3C, 10), /*!< Invalid use of request. */ - kStatus_I3C_Timeout = MAKE_STATUS(kStatusGroup_I3C, 11), /*!< The module has stalled too long in a frame. */ - kStatus_I3C_SlaveCountExceed = - MAKE_STATUS(kStatusGroup_I3C, 12), /*!< The I3C slave count has exceed the definition in I3C_MAX_DEVCNT. */ - kStatus_I3C_IBIWon = MAKE_STATUS( - kStatusGroup_I3C, 13), /*!< The I3C slave event IBI or MR or HJ won the arbitration on a header address. */ - kStatus_I3C_OverrunError = MAKE_STATUS(kStatusGroup_I3C, 14), /*!< Slave internal from-bus buffer/FIFO overrun. */ - kStatus_I3C_UnderrunError = MAKE_STATUS(kStatusGroup_I3C, 15), /*!< Slave internal to-bus buffer/FIFO underrun */ - kStatus_I3C_UnderrunNak = - MAKE_STATUS(kStatusGroup_I3C, 16), /*!< Slave internal from-bus buffer/FIFO underrun and NACK error */ - kStatus_I3C_InvalidStart = MAKE_STATUS(kStatusGroup_I3C, 17), /*!< Slave invalid start flag */ - kStatus_I3C_SdrParityError = MAKE_STATUS(kStatusGroup_I3C, 18), /*!< SDR parity error */ - kStatus_I3C_S0S1Error = MAKE_STATUS(kStatusGroup_I3C, 19), /*!< S0 or S1 error */ -}; - -/*! @brief I3C HDR modes. */ -typedef enum _i3c_hdr_mode -{ - kI3C_HDRModeNone = 0x00U, /* Do not support HDR mode. */ - kI3C_HDRModeDDR = 0x01U, /* HDR-DDR Mode. */ - kI3C_HDRModeTSP = 0x02U, /* HDR-TSP Mode. */ - kI3C_HDRModeTSL = 0x04U, /* HDR-TSL Mode. */ -} i3c_hdr_mode_t; - -/*! @brief I3C device information. */ -typedef struct _i3c_device_info -{ - uint8_t dynamicAddr; /*!< Device dynamic address. */ - uint8_t staticAddr; /*!< Static address. */ - uint8_t dcr; /*!< Device characteristics register information. */ - uint8_t bcr; /*!< Bus characteristics register information. */ - uint16_t vendorID; /*!< Device vendor ID(manufacture ID). */ - uint32_t partNumber; /*!< Device part number info */ - uint16_t maxReadLength; /*!< Maximum read length. */ - uint16_t maxWriteLength; /*!< Maximum write length. */ - uint8_t hdrMode; /*!< Support hdr mode, could be OR logic in i3c_hdr_mode. */ -} i3c_device_info_t; - -/*! @} */ - -/*! - * @addtogroup i3c_master_driver - * @{ - */ - -/*! - * @brief I3C master peripheral flags. - * - * The following status register flags can be cleared: - * - #kI3C_MasterSlaveStartFlag - * - #kI3C_MasterControlDoneFlag - * - #kI3C_MasterCompleteFlag - * - #kI3C_MasterArbitrationWonFlag - * - #kI3C_MasterSlave2MasterFlag - * - * All flags except #kI3C_MasterBetweenFlag and #kI3C_MasterNackDetectFlag can be enabled as - * interrupts. - * - * @note These enums are meant to be OR'd together to form a bit mask. - */ -enum _i3c_master_flags -{ - kI3C_MasterBetweenFlag = I3C_MSTATUS_BETWEEN_MASK, /*!< Between messages/DAAs flag */ - kI3C_MasterNackDetectFlag = I3C_MSTATUS_NACKED_MASK, /*!< NACK detected flag */ - kI3C_MasterSlaveStartFlag = I3C_MSTATUS_SLVSTART_MASK, /*!< Slave request start flag */ - kI3C_MasterControlDoneFlag = I3C_MSTATUS_MCTRLDONE_MASK, /*!< Master request complete flag */ - kI3C_MasterCompleteFlag = I3C_MSTATUS_COMPLETE_MASK, /*!< Transfer complete flag */ - kI3C_MasterRxReadyFlag = I3C_MSTATUS_RXPEND_MASK, /*!< Rx data ready in Rx buffer flag */ - kI3C_MasterTxReadyFlag = I3C_MSTATUS_TXNOTFULL_MASK, /*!< Tx buffer ready for Tx data flag */ - kI3C_MasterArbitrationWonFlag = I3C_MSTATUS_IBIWON_MASK, /*!< Header address won arbitration flag */ - kI3C_MasterErrorFlag = I3C_MSTATUS_ERRWARN_MASK, /*!< Error occurred flag */ - kI3C_MasterSlave2MasterFlag = I3C_MSTATUS_NOWMASTER_MASK, /*!< Switch from slave to master flag */ - kI3C_MasterClearFlags = kI3C_MasterSlaveStartFlag | kI3C_MasterControlDoneFlag | kI3C_MasterCompleteFlag | - kI3C_MasterArbitrationWonFlag | kI3C_MasterSlave2MasterFlag | kI3C_MasterErrorFlag, -}; - -/*! - * @brief I3C master error flags to indicate the causes. - * - * @note These enums are meant to be OR'd together to form a bit mask. - */ -enum _i3c_master_error_flags -{ - kI3C_MasterErrorNackFlag = I3C_MERRWARN_NACK_MASK, /*!< Slave NACKed the last address */ - kI3C_MasterErrorWriteAbortFlag = I3C_MERRWARN_WRABT_MASK, /*!< Slave NACKed the write data */ -#if !defined(FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) || (!FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) - kI3C_MasterErrorTermFlag = I3C_MERRWARN_TERM_MASK, /*!< Master terminates slave read */ -#endif - kI3C_MasterErrorParityFlag = I3C_MERRWARN_HPAR_MASK, /*!< Parity error from DDR read */ - kI3C_MasterErrorCrcFlag = I3C_MERRWARN_HCRC_MASK, /*!< CRC error from DDR read */ - kI3C_MasterErrorReadFlag = I3C_MERRWARN_OREAD_MASK, /*!< Read from MRDATAB register when FIFO empty */ - kI3C_MasterErrorWriteFlag = I3C_MERRWARN_OWRITE_MASK, /*!< Write to MWDATAB register when FIFO full */ - kI3C_MasterErrorMsgFlag = I3C_MERRWARN_MSGERR_MASK, /*!< Message SDR/DDR mismatch or - read/write message in wrong state */ - kI3C_MasterErrorInvalidReqFlag = I3C_MERRWARN_INVREQ_MASK, /*!< Invalid use of request */ - kI3C_MasterErrorTimeoutFlag = I3C_MERRWARN_TIMEOUT_MASK, /*!< The module has stalled too long in a frame */ - kI3C_MasterAllErrorFlags = kI3C_MasterErrorNackFlag | kI3C_MasterErrorWriteAbortFlag | -#if !defined(FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) || (!FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) - kI3C_MasterErrorTermFlag | -#endif - kI3C_MasterErrorParityFlag | kI3C_MasterErrorCrcFlag | kI3C_MasterErrorReadFlag | - kI3C_MasterErrorWriteFlag | kI3C_MasterErrorMsgFlag | kI3C_MasterErrorInvalidReqFlag | - kI3C_MasterErrorTimeoutFlag, /*!< All error flags */ -}; - -/*! @brief I3C working master state. */ -typedef enum _i3c_master_state -{ - kI3C_MasterStateIdle = 0U, /*!< Bus stopped. */ - kI3C_MasterStateSlvReq = 1U, /*!< Bus stopped but slave holding SDA low. */ - kI3C_MasterStateMsgSdr = 2U, /*!< In SDR Message mode from using MWMSG_SDR. */ - kI3C_MasterStateNormAct = 3U, /*!< In normal active SDR mode. */ - kI3C_MasterStateDdr = 4U, /*!< In DDR Message mode. */ - kI3C_MasterStateDaa = 5U, /*!< In ENTDAA mode. */ - kI3C_MasterStateIbiAck = 6U, /*!< Waiting on IBI ACK/NACK decision. */ - kI3C_MasterStateIbiRcv = 7U, /*!< receiving IBI. */ -} i3c_master_state_t; - -/*! @brief I3C master enable configuration. */ -typedef enum _i3c_master_enable -{ - kI3C_MasterOff = 0U, /*!< Master off. */ - kI3C_MasterOn = 1U, /*!< Master on. */ - kI3C_MasterCapable = 2U /*!< Master capable. */ -} i3c_master_enable_t; - -/*! @brief I3C high keeper configuration. */ -typedef enum _i3c_master_hkeep -{ - kI3C_MasterHighKeeperNone = 0U, /*!< Use PUR to hold SCL high. */ - kI3C_MasterHighKeeperWiredIn = 1U, /*!< Use pin_HK controls. */ - kI3C_MasterPassiveSDA = 2U, /*!< Hi-Z for Bus Free and hold SDA. */ - kI3C_MasterPassiveSDASCL = 3U /*!< Hi-Z both for Bus Free, and can Hi-Z SDA for hold. */ -} i3c_master_hkeep_t; - -/*! @brief Emits the requested operation when doing in pieces vs. by message. */ -typedef enum _i3c_bus_request -{ - kI3C_RequestNone = 0U, /*!< No request. */ - kI3C_RequestEmitStartAddr = 1U, /*!< Request to emit start and address on bus. */ - kI3C_RequestEmitStop = 2U, /*!< Request to emit stop on bus. */ - kI3C_RequestIbiAckNack = 3U, /*!< Manual IBI ACK or NACK. */ - kI3C_RequestProcessDAA = 4U, /*!< Process DAA. */ - kI3C_RequestForceExit = 6U, /*!< Request to force exit. */ - kI3C_RequestAutoIbi = 7U, /*!< Hold in stopped state, but Auto-emit START,7E. */ -} i3c_bus_request_t; - -/*! @brief Bus type with EmitStartAddr. */ -typedef enum _i3c_bus_type -{ - kI3C_TypeI3CSdr = 0U, /*!< SDR mode of I3C. */ - kI3C_TypeI2C = 1U, /*!< Standard i2c protocol. */ - kI3C_TypeI3CDdr = 2U, /*!< HDR-DDR mode of I3C. */ -} i3c_bus_type_t; - -/*! @brief IBI response. */ -typedef enum _i3c_ibi_response -{ - kI3C_IbiRespAck = 0U, /*!< ACK with no mandatory byte. */ - kI3C_IbiRespNack = 1U, /*!< NACK. */ - kI3C_IbiRespAckMandatory = 2U, /*!< ACK with mandatory byte. */ - kI3C_IbiRespManual = 3U, /*!< Reserved. */ -} i3c_ibi_response_t; - -/*! @brief IBI type. */ -typedef enum _i3c_ibi_type -{ - kI3C_IbiNormal = 0U, /*!< In-band interrupt. */ - kI3C_IbiHotJoin = 1U, /*!< slave hot join. */ - kI3C_IbiMasterRequest = 2U, /*!< slave master ship request. */ -} i3c_ibi_type_t; - -/*! @brief IBI state. */ -typedef enum _i3c_ibi_state -{ - kI3C_IbiReady = 0U, /*!< In-band interrupt ready state, ready for user to handle. */ - kI3C_IbiDataBuffNeed = 1U, /*!< In-band interrupt need data buffer for data receive. */ - kI3C_IbiAckNackPending = 2U, /*!< In-band interrupt Ack/Nack pending for decision. */ -} i3c_ibi_state_t; - -/*! @brief Direction of master and slave transfers. */ -typedef enum _i3c_direction -{ - kI3C_Write = 0U, /*!< Master transmit. */ - kI3C_Read = 1U /*!< Master receive. */ -} i3c_direction_t; - -/*! @brief Watermark of TX int/dma trigger level. */ -typedef enum _i3c_tx_trigger_level -{ - kI3C_TxTriggerOnEmpty = 0U, /*!< Trigger on empty. */ - kI3C_TxTriggerUntilOneQuarterOrLess = 1U, /*!< Trigger on 1/4 full or less. */ - kI3C_TxTriggerUntilOneHalfOrLess = 2U, /*!< Trigger on 1/2 full or less. */ - kI3C_TxTriggerUntilOneLessThanFull = 3U, /*!< Trigger on 1 less than full or less. */ -} i3c_tx_trigger_level_t; - -/*! @brief Watermark of RX int/dma trigger level. */ -typedef enum _i3c_rx_trigger_level -{ - kI3C_RxTriggerOnNotEmpty = 0U, /*!< Trigger on not empty. */ - kI3C_RxTriggerUntilOneQuarterOrMore = 1U, /*!< Trigger on 1/4 full or more. */ - kI3C_RxTriggerUntilOneHalfOrMore = 2U, /*!< Trigger on 1/2 full or more. */ - kI3C_RxTriggerUntilThreeQuarterOrMore = 3U, /*!< Trigger on 3/4 full or more. */ -} i3c_rx_trigger_level_t; - -/*! @brief I3C master read termination operations. */ -typedef enum _i3c_rx_term_ops -{ - kI3C_RxTermDisable = 0U, /*!< Master doesn't terminate read, used for CCC transfer. */ - kI3C_RxAutoTerm = 1U, /*!< Master auto terminate read after receiving specified bytes(<=255). */ - kI3C_RxTermLastByte = 2U, /*!< Master terminates read at any time after START, no length limitation. */ -} i3c_rx_term_ops_t; - -/*! @brief I3C start SCL delay options. */ -typedef enum _i3c_start_scl_delay -{ - kI3C_NoDelay = 0U, /*!< No delay. */ - kI3C_IncreaseSclHalfPeriod = 1U, /*!< Increases SCL clock period by 1/2. */ - kI3C_IncreaseSclOnePeriod = 2U, /*!< Increases SCL clock period by 1. */ - kI3C_IncreaseSclOneAndHalfPeriod = 3U, /*!< Increases SCL clock period by 1 1/2 */ -} i3c_start_scl_delay_t; - -/*! @brief Structure with setting master IBI rules and slave registry. */ -typedef struct _i3c_register_ibi_addr -{ - uint8_t address[5]; /*!< Address array for registry. */ - bool ibiHasPayload; /*!< Whether the address array has mandatory IBI byte. */ -} i3c_register_ibi_addr_t; - -/*! @brief Structure with I3C baudrate settings. */ -typedef struct _i3c_baudrate -{ - uint32_t i2cBaud; /*!< Desired I2C baud rate in Hertz. */ - uint32_t i3cPushPullBaud; /*!< Desired I3C push-pull baud rate in Hertz. */ - uint32_t i3cOpenDrainBaud; /*!< Desired I3C open-drain baud rate in Hertz. */ -} i3c_baudrate_hz_t; - -/*! @brief I3C DAA baud rate configuration. */ -typedef struct _i3c_master_daa_baudrate -{ - uint32_t sourceClock_Hz; /*!< FCLK, function clock in Hertz. */ - uint32_t i3cPushPullBaud; /*!< Desired I3C push-pull baud rate in Hertz. */ - uint32_t i3cOpenDrainBaud; /*!< Desired I3C open-drain baud rate in Hertz. */ -} i3c_master_daa_baudrate_t; - -/*! - * @brief Structure with settings to initialize the I3C master module. - * - * This structure holds configuration settings for the I3C peripheral. To initialize this - * structure to reasonable defaults, call the I3C_MasterGetDefaultConfig() function and - * pass a pointer to your configuration structure instance. - * - * The configuration structure can be made constant so it resides in flash. - */ -typedef struct _i3c_master_config -{ - i3c_master_enable_t enableMaster; /*!< Enable master mode. */ - bool disableTimeout; /*!< Whether to disable timeout to prevent the ERRWARN. */ - i3c_master_hkeep_t hKeep; /*!< High keeper mode setting. */ - bool enableOpenDrainStop; /*!< Whether to emit open-drain speed STOP. */ - bool enableOpenDrainHigh; /*!< Enable Open-Drain High to be 1 PPBAUD count for i3c messages, or 1 ODBAUD. */ - i3c_baudrate_hz_t baudRate_Hz; /*!< Desired baud rate settings. */ -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) && FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH) - uint32_t slowClock_Hz; /*!< Slow clock frequency. */ -#endif -#if defined(FSL_FEATURE_I3C_HAS_START_SCL_DELAY) && FSL_FEATURE_I3C_HAS_START_SCL_DELAY - i3c_start_scl_delay_t startSclDelay; /*!< I3C SCL delay after START. */ - i3c_start_scl_delay_t restartSclDelay; /*!< I3C SCL delay after Repeated START. */ -#endif -} i3c_master_config_t; - -/* Forward declaration of the transfer descriptor and handle typedefs. */ -typedef struct _i3c_master_transfer i3c_master_transfer_t; -typedef struct _i3c_master_handle i3c_master_handle_t; - -/*! @brief i3c master callback functions. */ -typedef struct _i3c_master_transfer_callback -{ - void (*slave2Master)(I3C_Type *base, void *userData); /*!< Transfer complete callback */ - void (*ibiCallback)(I3C_Type *base, - i3c_master_handle_t *handle, - i3c_ibi_type_t ibiType, - i3c_ibi_state_t ibiState); /*!< IBI event callback */ - void (*transferComplete)(I3C_Type *base, - i3c_master_handle_t *handle, - status_t completionStatus, - void *userData); /*!< Transfer complete callback */ -} i3c_master_transfer_callback_t; -/*! - * @brief Transfer option flags. - * - * @note These enumerations are intended to be OR'd together to form a bit mask of options for - * the #_i3c_master_transfer::flags field. - */ -enum _i3c_master_transfer_flags -{ - kI3C_TransferDefaultFlag = 0x00U, /*!< Transfer starts with a start signal, stops with a stop signal. */ - kI3C_TransferNoStartFlag = 0x01U, /*!< Don't send a start condition, address, and sub address */ - kI3C_TransferRepeatedStartFlag = 0x02U, /*!< Send a repeated start condition */ - kI3C_TransferNoStopFlag = 0x04U, /*!< Don't send a stop condition. */ - kI3C_TransferWordsFlag = 0x08U, /*!< Transfer in words, else transfer in bytes. */ - kI3C_TransferDisableRxTermFlag = 0x10U, /*!< Disable Rx termination. Note: It's for I3C CCC transfer. */ - kI3C_TransferRxAutoTermFlag = - 0x20U, /*!< Set Rx auto-termination. Note: It's adaptive based on Rx size(<=255 bytes) except in I3C_MasterReceive. */ - kI3C_TransferStartWithBroadcastAddr = 0x40U, /*!< Start transfer with 0x7E, then read/write data with device address. */ -}; - -/*! - * @brief Non-blocking transfer descriptor structure. - * - * This structure is used to pass transaction parameters to the I3C_MasterTransferNonBlocking() API. - */ -struct _i3c_master_transfer -{ - uint32_t flags; /*!< Bit mask of options for the transfer. See enumeration #_i3c_master_transfer_flags for available - options. Set to 0 or #kI3C_TransferDefaultFlag for normal transfers. */ - uint8_t slaveAddress; /*!< The 7-bit slave address. */ - i3c_direction_t direction; /*!< Either #kI3C_Read or #kI3C_Write. */ - uint32_t subaddress; /*!< Sub address. Transferred MSB first. */ - size_t subaddressSize; /*!< Length of sub address to send in bytes. Maximum size is 4 bytes. */ - void *data; /*!< Pointer to data to transfer. */ - size_t dataSize; /*!< Number of bytes to transfer. */ - i3c_bus_type_t busType; /*!< bus type. */ - i3c_ibi_response_t ibiResponse; /*!< ibi response during transfer. */ -}; - -/*! - * @brief Driver handle for master non-blocking APIs. - * @note The contents of this structure are private and subject to change. - */ -struct _i3c_master_handle -{ - uint8_t state; /*!< Transfer state machine current state. */ - uint32_t remainingBytes; /*!< Remaining byte count in current state. */ - i3c_rx_term_ops_t rxTermOps; /*!< Read termination operation. */ - i3c_master_transfer_t transfer; /*!< Copy of the current transfer info. */ - uint8_t ibiAddress; /*!< Slave address which request IBI. */ - uint8_t *ibiBuff; /*!< Pointer to IBI buffer to keep ibi bytes. */ - size_t ibiPayloadSize; /*!< IBI payload size. */ - i3c_ibi_type_t ibiType; /*!< IBI type. */ - i3c_master_transfer_callback_t callback; /*!< Callback functions pointer. */ - void *userData; /*!< Application data passed to callback. */ -}; - -/*! @brief Typedef for master interrupt handler. */ -typedef void (*i3c_master_isr_t)(I3C_Type *base, void *handle); - -/*! @} */ - -/*! - * @addtogroup i3c_slave_driver - * @{ - */ - -/*! - * @brief I3C slave peripheral flags. - * - * The following status register flags can be cleared: - * - #kI3C_SlaveBusStartFlag - * - #kI3C_SlaveMatchedFlag - * - #kI3C_SlaveBusStopFlag - * - * Only below flags can be enabled as interrupts. - * - #kI3C_SlaveBusStartFlag - * - #kI3C_SlaveMatchedFlag - * - #kI3C_SlaveBusStopFlag - * - #kI3C_SlaveRxReadyFlag - * - #kI3C_SlaveTxReadyFlag - * - #kI3C_SlaveDynamicAddrChangedFlag - * - #kI3C_SlaveReceivedCCCFlag - * - #kI3C_SlaveErrorFlag - * - #kI3C_SlaveHDRCommandMatchFlag - * - #kI3C_SlaveCCCHandledFlag - * - #kI3C_SlaveEventSentFlag - - * @note These enums are meant to be OR'd together to form a bit mask. - */ -enum _i3c_slave_flags -{ - kI3C_SlaveNotStopFlag = I3C_SSTATUS_STNOTSTOP_MASK, /*!< Slave status not stop flag */ - kI3C_SlaveMessageFlag = I3C_SSTATUS_STMSG_MASK, /*!< Slave status message, indicating slave is - listening to the bus traffic or responding */ - kI3C_SlaveRequiredReadFlag = I3C_SSTATUS_STREQRD_MASK, /*!< Slave status required, either is master doing SDR - read from slave, or is IBI pushing out. */ - kI3C_SlaveRequiredWriteFlag = I3C_SSTATUS_STREQWR_MASK, /*!< Slave status request write, master is doing SDR - write to slave, except slave in ENTDAA mode */ - kI3C_SlaveBusDAAFlag = I3C_SSTATUS_STDAA_MASK, /*!< I3C bus is in ENTDAA mode */ - kI3C_SlaveBusHDRModeFlag = I3C_SSTATUS_STHDR_MASK, /*!< I3C bus is in HDR mode */ - kI3C_SlaveBusStartFlag = I3C_SSTATUS_START_MASK, /*!< Start/Re-start event is seen since the bus was last cleared */ - kI3C_SlaveMatchedFlag = I3C_SSTATUS_MATCHED_MASK, /*!< Slave address(dynamic/static) matched since last cleared */ - kI3C_SlaveBusStopFlag = I3C_SSTATUS_STOP_MASK, /*!enableMaster = kI3C_MasterCapable; - * config->disableTimeout = false; - * config->hKeep = kI3C_MasterHighKeeperNone; - * config->enableOpenDrainStop = true; - * config->enableOpenDrainHigh = true; - * config->baudRate_Hz.i2cBaud = 400000U; - * config->baudRate_Hz.i3cPushPullBaud = 12500000U; - * config->baudRate_Hz.i3cOpenDrainBaud = 2500000U; - * config->masterDynamicAddress = 0x0AU; - * config->slowClock_Hz = 1000000U; - * config->enableSlave = true; - * config->vendorID = 0x11BU; - * config->enableRandomPart = false; - * config->partNumber = 0; - * config->dcr = 0; - * config->bcr = 0; - * config->hdrMode = (uint8_t)kI3C_HDRModeDDR; - * config->nakAllRequest = false; - * config->ignoreS0S1Error = false; - * config->offline = false; - * config->matchSlaveStartStop = false; - * @endcode - * - * After calling this function, you can override any settings in order to customize the configuration, - * prior to initializing the common I3C driver with I3C_Init(). - * - * @param[out] config User provided configuration structure for default values. Refer to #i3c_config_t. - */ -void I3C_GetDefaultConfig(i3c_config_t *config); - -/*! - * @brief Initializes the I3C peripheral. - * This function enables the peripheral clock and initializes the I3C peripheral as described by the user - * provided configuration. This will initialize both the master peripheral and slave peripheral so that I3C - * module could work as pure master, pure slave or secondary master, etc. - * A software reset is performed prior to configuration. - * - * @param base The I3C peripheral base address. - * @param config User provided peripheral configuration. Use I3C_GetDefaultConfig() to get a set of - * defaults that you can override. - * @param sourceClock_Hz Frequency in Hertz of the I3C functional clock. Used to calculate the baud rate divisors, - * filter widths, and timeout periods. - */ -void I3C_Init(I3C_Type *base, const i3c_config_t *config, uint32_t sourceClock_Hz); - -/*! @} */ - -/*! - * @addtogroup i3c_master_driver - * @{ - */ - -/*! @name Initialization and deinitialization */ -/*! @{ */ - -/*! - * @brief Provides a default configuration for the I3C master peripheral. - * - * This function provides the following default configuration for the I3C master peripheral: - * @code - * masterConfig->enableMaster = kI3C_MasterOn; - * masterConfig->disableTimeout = false; - * masterConfig->hKeep = kI3C_MasterHighKeeperNone; - * masterConfig->enableOpenDrainStop = true; - * masterConfig->enableOpenDrainHigh = true; - * masterConfig->baudRate_Hz = 100000U; - * masterConfig->busType = kI3C_TypeI2C; - * @endcode - * - * After calling this function, you can override any settings in order to customize the configuration, - * prior to initializing the master driver with I3C_MasterInit(). - * - * @param[out] masterConfig User provided configuration structure for default values. Refer to #i3c_master_config_t. - */ -void I3C_MasterGetDefaultConfig(i3c_master_config_t *masterConfig); - -/*! - * @brief Initializes the I3C master peripheral. - * - * This function enables the peripheral clock and initializes the I3C master peripheral as described by the user - * provided configuration. A software reset is performed prior to configuration. - * - * @param base The I3C peripheral base address. - * @param masterConfig User provided peripheral configuration. Use I3C_MasterGetDefaultConfig() to get a set of - * defaults that you can override. - * @param sourceClock_Hz Frequency in Hertz of the I3C functional clock. Used to calculate the baud rate divisors, - * filter widths, and timeout periods. - */ -void I3C_MasterInit(I3C_Type *base, const i3c_master_config_t *masterConfig, uint32_t sourceClock_Hz); - -/*! - * @brief Deinitializes the I3C master peripheral. - * - * This function disables the I3C master peripheral and gates the clock. It also performs a software - * reset to restore the peripheral to reset conditions. - * - * @param base The I3C peripheral base address. - */ -void I3C_MasterDeinit(I3C_Type *base); - -/* Not static so it can be used from fsl_i3c_dma.c. */ -status_t I3C_MasterCheckAndClearError(I3C_Type *base, uint32_t status); - -/* Not static so it can be used from fsl_i3c_dma.c. */ -status_t I3C_MasterWaitForCtrlDone(I3C_Type *base, bool waitIdle); - -/* Not static so it can be used from fsl_i3c_dma.c. */ -status_t I3C_CheckForBusyBus(I3C_Type *base); - -/*! - * @brief Set I3C module master mode. - * - * @param base The I3C peripheral base address. - * @param enable Enable master mode. - */ -static inline void I3C_MasterEnable(I3C_Type *base, i3c_master_enable_t enable) -{ - base->MCONFIG = (base->MCONFIG & ~I3C_MCONFIG_MSTENA_MASK) | I3C_MCONFIG_MSTENA(enable); -} - -/*! @} */ - -/*! @name Status */ -/*! @{ */ - -/*! - * @brief Gets the I3C master status flags. - * - * A bit mask with the state of all I3C master status flags is returned. For each flag, the corresponding bit - * in the return value is set if the flag is asserted. - * - * @param base The I3C peripheral base address. - * @return State of the status flags: - * - 1: related status flag is set. - * - 0: related status flag is not set. - * @see _i3c_master_flags - */ -static inline uint32_t I3C_MasterGetStatusFlags(I3C_Type *base) -{ - return base->MSTATUS & ~(I3C_MSTATUS_STATE_MASK | I3C_MSTATUS_IBITYPE_MASK); -} - -/*! - * @brief Clears the I3C master status flag state. - * - * The following status register flags can be cleared: - * - #kI3C_MasterSlaveStartFlag - * - #kI3C_MasterControlDoneFlag - * - #kI3C_MasterCompleteFlag - * - #kI3C_MasterArbitrationWonFlag - * - #kI3C_MasterSlave2MasterFlag - * - * Attempts to clear other flags has no effect. - * - * @param base The I3C peripheral base address. - * @param statusMask A bitmask of status flags that are to be cleared. The mask is composed of - * #_i3c_master_flags enumerators OR'd together. You may pass the result of a previous call to - * I3C_MasterGetStatusFlags(). - * @see _i3c_master_flags. - */ -static inline void I3C_MasterClearStatusFlags(I3C_Type *base, uint32_t statusMask) -{ - base->MSTATUS = statusMask; -} - -/*! - * @brief Gets the I3C master error status flags. - * - * A bit mask with the state of all I3C master error status flags is returned. For each flag, the corresponding bit - * in the return value is set if the flag is asserted. - * - * @param base The I3C peripheral base address. - * @return State of the error status flags: - * - 1: related status flag is set. - * - 0: related status flag is not set. - * @see _i3c_master_error_flags - */ -static inline uint32_t I3C_MasterGetErrorStatusFlags(I3C_Type *base) -{ - return base->MERRWARN; -} - -/*! - * @brief Clears the I3C master error status flag state. - * - * @param base The I3C peripheral base address. - * @param statusMask A bitmask of error status flags that are to be cleared. The mask is composed of - * #_i3c_master_error_flags enumerators OR'd together. You may pass the result of a previous call to - * I3C_MasterGetStatusFlags(). - * @see _i3c_master_error_flags. - */ -static inline void I3C_MasterClearErrorStatusFlags(I3C_Type *base, uint32_t statusMask) -{ - while ((base->MERRWARN & statusMask) != 0U) - { - base->MERRWARN = statusMask; - } -} - -/*! - * @brief Gets the I3C master state. - * - * @param base The I3C peripheral base address. - * @return I3C master state. - */ -i3c_master_state_t I3C_MasterGetState(I3C_Type *base); - -/*! @} */ - -/*! @name Interrupts */ -/*! @{ */ - -/*! - * @brief Enables the I3C master interrupt requests. - * - * All flags except #kI3C_MasterBetweenFlag and #kI3C_MasterNackDetectFlag can be enabled as - * interrupts. - * - * @param base The I3C peripheral base address. - * @param interruptMask Bit mask of interrupts to enable. See #_i3c_master_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void I3C_MasterEnableInterrupts(I3C_Type *base, uint32_t interruptMask) -{ - base->MINTSET |= interruptMask; -} - -/*! - * @brief Disables the I3C master interrupt requests. - * - * All flags except #kI3C_MasterBetweenFlag and #kI3C_MasterNackDetectFlag can be enabled as - * interrupts. - * - * @param base The I3C peripheral base address. - * @param interruptMask Bit mask of interrupts to disable. See #_i3c_master_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void I3C_MasterDisableInterrupts(I3C_Type *base, uint32_t interruptMask) -{ - base->MINTCLR = interruptMask; -} - -/*! - * @brief Returns the set of currently enabled I3C master interrupt requests. - * - * @param base The I3C peripheral base address. - * @return A bitmask composed of #_i3c_master_flags enumerators OR'd together to indicate the - * set of enabled interrupts. - */ -static inline uint32_t I3C_MasterGetEnabledInterrupts(I3C_Type *base) -{ - return base->MINTSET; -} - -/*! - * @brief Returns the set of pending I3C master interrupt requests. - * - * @param base The I3C peripheral base address. - * @return A bitmask composed of #_i3c_master_flags enumerators OR'd together to indicate the - * set of pending interrupts. - */ -static inline uint32_t I3C_MasterGetPendingInterrupts(I3C_Type *base) -{ - return base->MINTMASKED; -} - -/*! @} */ - -/*! @name DMA control */ -/*! @{ */ - -/*! - * @brief Enables or disables I3C master DMA requests. - * - * @param base The I3C peripheral base address. - * @param enableTx Enable flag for transmit DMA request. Pass true for enable, false for disable. - * @param enableRx Enable flag for receive DMA request. Pass true for enable, false for disable. - * @param width DMA read/write unit in bytes. - */ -static inline void I3C_MasterEnableDMA(I3C_Type *base, bool enableTx, bool enableRx, uint32_t width) -{ - assert(width <= 2U); - base->MDMACTRL = - I3C_MDMACTRL_DMAFB(enableRx ? 2U : 0U) | I3C_MDMACTRL_DMATB(enableTx ? 2U : 0U) | I3C_MDMACTRL_DMAWIDTH(width); -} - -/*! - * @brief Gets I3C master transmit data register address for DMA transfer. - * - * @param base The I3C peripheral base address. - * @param width DMA read/write unit in bytes. - * @return The I3C Master Transmit Data Register address. - */ -static inline uint32_t I3C_MasterGetTxFifoAddress(I3C_Type *base, uint32_t width) -{ - assert(width <= 2U); - return (uint32_t)((width == 2U) ? &base->MWDATAH : &base->MWDATAB); -} - -/*! - * @brief Gets I3C master receive data register address for DMA transfer. - * - * @param base The I3C peripheral base address. - * @param width DMA read/write unit in bytes. - * @return The I3C Master Receive Data Register address. - */ -static inline uint32_t I3C_MasterGetRxFifoAddress(I3C_Type *base, uint32_t width) -{ - assert(width <= 2U); - return (uint32_t)((width == 2U) ? &base->MRDATAH : &base->MRDATAB); -} - -/*! @} */ - -/*! @name FIFO control */ -/*! @{ */ - -/*! - * @brief Sets the watermarks for I3C master FIFOs. - * - * @param base The I3C peripheral base address. - * @param txLvl Transmit FIFO watermark level. The #kI3C_MasterTxReadyFlag flag is set whenever - * the number of words in the transmit FIFO reaches @a txLvl. - * @param rxLvl Receive FIFO watermark level. The #kI3C_MasterRxReadyFlag flag is set whenever - * the number of words in the receive FIFO reaches @a rxLvl. - * @param flushTx true if TX FIFO is to be cleared, otherwise TX FIFO remains unchanged. - * @param flushRx true if RX FIFO is to be cleared, otherwise RX FIFO remains unchanged. - */ -static inline void I3C_MasterSetWatermarks( - I3C_Type *base, i3c_tx_trigger_level_t txLvl, i3c_rx_trigger_level_t rxLvl, bool flushTx, bool flushRx) -{ - base->MDATACTRL = I3C_MDATACTRL_UNLOCK_MASK | I3C_MDATACTRL_TXTRIG(txLvl) | I3C_MDATACTRL_RXTRIG(rxLvl) | - (flushTx ? I3C_MDATACTRL_FLUSHTB_MASK : 0U) | (flushRx ? I3C_MDATACTRL_FLUSHFB_MASK : 0U); -} - -/*! - * @brief Gets the current number of bytes in the I3C master FIFOs. - * - * @param base The I3C peripheral base address. - * @param[out] txCount Pointer through which the current number of bytes in the transmit FIFO is returned. - * Pass NULL if this value is not required. - * @param[out] rxCount Pointer through which the current number of bytes in the receive FIFO is returned. - * Pass NULL if this value is not required. - */ -static inline void I3C_MasterGetFifoCounts(I3C_Type *base, size_t *rxCount, size_t *txCount) -{ - if (NULL != txCount) - { - *txCount = (base->MDATACTRL & I3C_MDATACTRL_TXCOUNT_MASK) >> I3C_MDATACTRL_TXCOUNT_SHIFT; - } - if (NULL != rxCount) - { - *rxCount = (base->MDATACTRL & I3C_MDATACTRL_RXCOUNT_MASK) >> I3C_MDATACTRL_RXCOUNT_SHIFT; - } -} - -/*! @} */ - -/*! @name Bus operations */ -/*! @{ */ - -/*! - * @brief Sets the I3C bus frequency for master transactions. - * - * The I3C master is automatically disabled and re-enabled as necessary to configure the baud - * rate. Do not call this function during a transfer, or the transfer is aborted. - * - * @param base The I3C peripheral base address. - * @param baudRate_Hz Pointer to structure of requested bus frequency in Hertz. - * @param sourceClock_Hz I3C functional clock frequency in Hertz. - */ -void I3C_MasterSetBaudRate(I3C_Type *base, const i3c_baudrate_hz_t *baudRate_Hz, uint32_t sourceClock_Hz); - -/*! - * @brief Returns whether the bus is idle. - * - * Requires the master mode to be enabled. - * - * @param base The I3C peripheral base address. - * @retval true Bus is busy. - * @retval false Bus is idle. - */ -static inline bool I3C_MasterGetBusIdleState(I3C_Type *base) -{ - return ((base->MSTATUS & I3C_MSTATUS_STATE_MASK) == (uint32_t)kI3C_MasterStateIdle ? true : false); -} - -/*! - * @brief Sends a START signal and slave address on the I2C/I3C bus, receive size is also specified - * in the call. - * - * This function is used to initiate a new master mode transfer. First, the bus state is checked to ensure - * that another master is not occupying the bus. Then a START signal is transmitted, followed by the - * 7-bit address specified in the a address parameter. Note that this function does not actually wait - * until the START and address are successfully sent on the bus before returning. - * - * @param base The I3C peripheral base address. - * @param type The bus type to use in this transaction. - * @param address 7-bit slave device address, in bits [6:0]. - * @param dir Master transfer direction, either #kI3C_Read or #kI3C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * @param rxSize Read terminate size for the followed read transfer, limit to 255 bytes. - * @retval #kStatus_Success START signal and address were successfully enqueued in the transmit FIFO. - * @retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - */ -status_t I3C_MasterStartWithRxSize( - I3C_Type *base, i3c_bus_type_t type, uint8_t address, i3c_direction_t dir, uint8_t rxSize); - -/*! - * @brief Sends a START signal and slave address on the I2C/I3C bus. - * - * This function is used to initiate a new master mode transfer. First, the bus state is checked to ensure - * that another master is not occupying the bus. Then a START signal is transmitted, followed by the - * 7-bit address specified in the @a address parameter. Note that this function does not actually wait - * until the START and address are successfully sent on the bus before returning. - * - * @param base The I3C peripheral base address. - * @param type The bus type to use in this transaction. - * @param address 7-bit slave device address, in bits [6:0]. - * @param dir Master transfer direction, either #kI3C_Read or #kI3C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * @retval #kStatus_Success START signal and address were successfully enqueued in the transmit FIFO. - * @retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - */ -status_t I3C_MasterStart(I3C_Type *base, i3c_bus_type_t type, uint8_t address, i3c_direction_t dir); - -/*! - * @brief Sends a repeated START signal and slave address on the I2C/I3C bus, receive size is also specified - * in the call. - * - * This function is used to send a Repeated START signal when a transfer is already in progress. Like - * I3C_MasterStart(), it also sends the specified 7-bit address. Call this API also configures the read - * terminate size for the following read transfer. For example, set the rxSize = 2, the following read transfer - * will be terminated after two bytes of data received. Write transfer will not be affected by the rxSize - * configuration. - * - * @note This function exists primarily to maintain compatible APIs between I3C and I2C drivers, - * as well as to better document the intent of code that uses these APIs. - * - * @param base The I3C peripheral base address. - * @param type The bus type to use in this transaction. - * @param address 7-bit slave device address, in bits [6:0]. - * @param dir Master transfer direction, either #kI3C_Read or #kI3C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * @param rxSize Read terminate size for the followed read transfer, limit to 255 bytes. - * @retval #kStatus_Success Repeated START signal and address were successfully enqueued in the transmit FIFO. - */ -status_t I3C_MasterRepeatedStartWithRxSize( - I3C_Type *base, i3c_bus_type_t type, uint8_t address, i3c_direction_t dir, uint8_t rxSize); - -/*! - * @brief Sends a repeated START signal and slave address on the I2C/I3C bus. - * - * This function is used to send a Repeated START signal when a transfer is already in progress. Like - * I3C_MasterStart(), it also sends the specified 7-bit address. - * - * @note This function exists primarily to maintain compatible APIs between I3C and I2C drivers, - * as well as to better document the intent of code that uses these APIs. - * - * @param base The I3C peripheral base address. - * @param type The bus type to use in this transaction. - * @param address 7-bit slave device address, in bits [6:0]. - * @param dir Master transfer direction, either #kI3C_Read or #kI3C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * @retval #kStatus_Success Repeated START signal and address were successfully enqueued in the transmit FIFO. - */ -static inline status_t I3C_MasterRepeatedStart(I3C_Type *base, - i3c_bus_type_t type, - uint8_t address, - i3c_direction_t dir) -{ - return I3C_MasterRepeatedStartWithRxSize(base, type, address, dir, 0); -} - -/*! - * @brief Performs a polling send transfer on the I2C/I3C bus. - * - * Sends up to @a txSize number of bytes to the previously addressed slave device. The slave may - * reply with a NAK to any byte in order to terminate the transfer early. If this happens, this - * function returns #kStatus_I3C_Nak. - * - * @param base The I3C peripheral base address. - * @param txBuff The pointer to the data to be transferred. - * @param txSize The length in bytes of the data to be transferred. - * @param flags Bit mask of options for the transfer. See enumeration #_i3c_master_transfer_flags for available options. - * @retval #kStatus_Success Data was sent successfully. - * @retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_I3C_Timeout The module has stalled too long in a frame. - * @retval #kStatus_I3C_Nak The slave device sent a NAK in response to an address. - * @retval #kStatus_I3C_WriteAbort The slave device sent a NAK in response to a write. - * @retval #kStatus_I3C_MsgError Message SDR/DDR mismatch or read/write message in wrong state. - * @retval #kStatus_I3C_WriteFifoError Write to M/SWDATAB register when FIFO full. - * @retval #kStatus_I3C_InvalidReq Invalid use of request. - */ -status_t I3C_MasterSend(I3C_Type *base, const void *txBuff, size_t txSize, uint32_t flags); - -/*! - * @brief Performs a polling receive transfer on the I2C/I3C bus. - * - * @param base The I3C peripheral base address. - * @param rxBuff The pointer to the data to be transferred. - * @param rxSize The length in bytes of the data to be transferred. - * @param flags Bit mask of options for the transfer. See enumeration #_i3c_master_transfer_flags for available options. - * @retval #kStatus_Success Data was received successfully. - * @retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_I3C_Timeout The module has stalled too long in a frame. - * @retval #kStatus_I3C_Term The master terminates slave read. - * @retval #kStatus_I3C_HdrParityError Parity error from DDR read. - * @retval #kStatus_I3C_CrcError CRC error from DDR read. - * @retval #kStatus_I3C_MsgError Message SDR/DDR mismatch or read/write message in wrong state. - * @retval #kStatus_I3C_ReadFifoError Read from M/SRDATAB register when FIFO empty. - * @retval #kStatus_I3C_InvalidReq Invalid use of request. - */ -status_t I3C_MasterReceive(I3C_Type *base, void *rxBuff, size_t rxSize, uint32_t flags); - -/*! - * @brief Sends a STOP signal on the I2C/I3C bus. - * - * This function does not return until the STOP signal is seen on the bus, or an error occurs. - * - * @param base The I3C peripheral base address. - * @retval #kStatus_Success The STOP signal was successfully sent on the bus and the transaction terminated. - * @retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_I3C_Timeout The module has stalled too long in a frame. - * @retval #kStatus_I3C_InvalidReq Invalid use of request. - */ -status_t I3C_MasterStop(I3C_Type *base); - -/*! - * @brief I3C master emit request. - * - * @param base The I3C peripheral base address. - * @param masterReq I3C master request of type #i3c_bus_request_t - */ -void I3C_MasterEmitRequest(I3C_Type *base, i3c_bus_request_t masterReq); - -/*! - * @brief I3C master emit request. - * - * @param base The I3C peripheral base address. - * @param ibiResponse I3C master emit IBI response of type #i3c_ibi_response_t - */ -static inline void I3C_MasterEmitIBIResponse(I3C_Type *base, i3c_ibi_response_t ibiResponse) -{ - uint32_t ctrlVal = base->MCTRL; - ctrlVal &= ~(I3C_MCTRL_IBIRESP_MASK | I3C_MCTRL_REQUEST_MASK); - ctrlVal |= I3C_MCTRL_IBIRESP((uint32_t)ibiResponse) | I3C_MCTRL_REQUEST(kI3C_RequestIbiAckNack); - base->MCTRL = ctrlVal; -} - -/*! - * @brief I3C master register IBI rule. - * - * @param base The I3C peripheral base address. - * @param ibiRule Pointer to ibi rule description of type #i3c_register_ibi_addr_t - */ -void I3C_MasterRegisterIBI(I3C_Type *base, i3c_register_ibi_addr_t *ibiRule); - -/*! - * @brief I3C master get IBI rule. - * - * @param base The I3C peripheral base address. - * @param ibiRule Pointer to store the read out ibi rule description. - */ -void I3C_MasterGetIBIRules(I3C_Type *base, i3c_register_ibi_addr_t *ibiRule); - -/*! - * @brief I3C master get IBI Type. - * - * @param base The I3C peripheral base address. - * @retval i3c_ibi_type_t Type of #i3c_ibi_type_t. - */ -i3c_ibi_type_t I3C_GetIBIType(I3C_Type *base); - -/*! - * @brief I3C master get IBI Address. - * - * @param base The I3C peripheral base address. - * @retval The 8-bit IBI address. - */ -static inline uint8_t I3C_GetIBIAddress(I3C_Type *base) -{ - return (uint8_t)((base->MSTATUS & I3C_MSTATUS_IBIADDR_MASK) >> I3C_MSTATUS_IBIADDR_SHIFT); -} - -/*! - * @brief Performs a DAA in the i3c bus with specified temporary baud rate. - * - * @param base The I3C peripheral base address. - * @param addressList The pointer for address list which is used to do DAA. - * @param count The address count in the address list. - * @param daaBaudRate The temporary baud rate in DAA process, NULL for using initial setting. - * The initial setting is set back between the completion of the DAA and the return of this function. - * @retval #kStatus_Success The transaction was started successfully. - * @retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - * @retval #kStatus_I3C_SlaveCountExceed The I3C slave count has exceed the definition in I3C_MAX_DEVCNT. - */ -status_t I3C_MasterProcessDAASpecifiedBaudrate(I3C_Type *base, - uint8_t *addressList, - uint32_t count, - i3c_master_daa_baudrate_t *daaBaudRate); - -/*! - * @brief Performs a DAA in the i3c bus. - * - * @param base The I3C peripheral base address. - * @param addressList The pointer for address list which is used to do DAA. - * @param count The address count in the address list. - * The initial setting is set back between the completion of the DAA and the return of this function. - * @retval #kStatus_Success The transaction was started successfully. - * @retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - * @retval #kStatus_I3C_SlaveCountExceed The I3C slave count has exceed the definition in I3C_MAX_DEVCNT. - */ -static inline status_t I3C_MasterProcessDAA(I3C_Type *base, uint8_t *addressList, uint32_t count) -{ - return I3C_MasterProcessDAASpecifiedBaudrate(base, addressList, count, NULL); -} - -/*! - * @brief Get device information list after DAA process is done. - * - * @param base The I3C peripheral base address. - * @param[out] count The pointer to store the available device count. - * @return Pointer to the i3c_device_info_t array. - */ -i3c_device_info_t *I3C_MasterGetDeviceListAfterDAA(I3C_Type *base, uint8_t *count); -/*! - * @brief Performs a master polling transfer on the I2C/I3C bus. - * - * @note The API does not return until the transfer succeeds or fails due - * to error happens during transfer. - * - * @param base The I3C peripheral base address. - * @param transfer Pointer to the transfer structure. - * @retval #kStatus_Success Data was received successfully. - * @retval #kStatus_I3C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_I3C_IBIWon The I3C slave event IBI or MR or HJ won the arbitration on a header address. - * @retval #kStatus_I3C_Timeout The module has stalled too long in a frame. - * @retval #kStatus_I3C_Nak The slave device sent a NAK in response to an address. - * @retval #kStatus_I3C_WriteAbort The slave device sent a NAK in response to a write. - * @retval #kStatus_I3C_Term The master terminates slave read. - * @retval #kStatus_I3C_HdrParityError Parity error from DDR read. - * @retval #kStatus_I3C_CrcError CRC error from DDR read. - * @retval #kStatus_I3C_MsgError Message SDR/DDR mismatch or read/write message in wrong state. - * @retval #kStatus_I3C_ReadFifoError Read from M/SRDATAB register when FIFO empty. - * @retval #kStatus_I3C_WriteFifoError Write to M/SWDATAB register when FIFO full. - * @retval #kStatus_I3C_InvalidReq Invalid use of request. - */ -status_t I3C_MasterTransferBlocking(I3C_Type *base, i3c_master_transfer_t *transfer); - -/*! @} */ - -/*! @name Non-blocking */ -/*! @{ */ - -/*! - * @brief Creates a new handle for the I3C master non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the I3C_MasterTransferAbort() API shall be called. - * - * - * @note The function also enables the NVIC IRQ for the input I3C. Need to notice - * that on some SoCs the I3C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - * - * @param base The I3C peripheral base address. - * @param[out] handle Pointer to the I3C master driver handle. - * @param callback User provided pointer to the asynchronous callback function. - * @param userData User provided pointer to the application callback data. - */ -void I3C_MasterTransferCreateHandle(I3C_Type *base, - i3c_master_handle_t *handle, - const i3c_master_transfer_callback_t *callback, - void *userData); - -/*! - * @brief Performs a non-blocking transaction on the I2C/I3C bus. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C master driver handle. - * @param transfer The pointer to the transfer descriptor. - * @retval #kStatus_Success The transaction was started successfully. - * @retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - */ -status_t I3C_MasterTransferNonBlocking(I3C_Type *base, i3c_master_handle_t *handle, i3c_master_transfer_t *transfer); - -/*! - * @brief Returns number of bytes transferred so far. - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C master driver handle. - * @param[out] count Number of bytes transferred so far by the non-blocking transaction. - * @retval #kStatus_Success - * @retval #kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t I3C_MasterTransferGetCount(I3C_Type *base, i3c_master_handle_t *handle, size_t *count); - -/*! - * @brief Terminates a non-blocking I3C master transmission early. - * - * @note It is not safe to call this function from an IRQ handler that has a higher priority than the - * I3C peripheral's IRQ priority. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C master driver handle. - * @retval #kStatus_Success A transaction was successfully aborted. - * @retval #kStatus_I3C_Idle There is not a non-blocking transaction currently in progress. - */ -void I3C_MasterTransferAbort(I3C_Type *base, i3c_master_handle_t *handle); - -/*! @} */ - -/*! @name IRQ handler */ -/*! @{ */ - -/*! - * @brief Reusable routine to handle master interrupts. - * @note This function does not need to be called unless you are reimplementing the - * nonblocking API's interrupt handler routines to add special functionality. - * @param base The I3C peripheral base address. - * @param intHandle Pointer to the I3C master driver handle. - */ -void I3C_MasterTransferHandleIRQ(I3C_Type *base, void *intHandle); - -/*! @} */ - -/*! @} */ - -/*! - * @addtogroup i3c_slave_driver - * @{ - */ - -/*! @name Initialization and deinitialization */ -/*! @{ */ - -/*! - * @brief Provides a default configuration for the I3C slave peripheral. - * - * This function provides the following default configuration for the I3C slave peripheral: - * @code - * slaveConfig->enableslave = true; - * @endcode - * - * After calling this function, you can override any settings in order to customize the configuration, - * prior to initializing the slave driver with I3C_SlaveInit(). - * - * @param[out] slaveConfig User provided configuration structure for default values. Refer to #i3c_slave_config_t. - */ -void I3C_SlaveGetDefaultConfig(i3c_slave_config_t *slaveConfig); - -/*! - * @brief Initializes the I3C slave peripheral. - * - * This function enables the peripheral clock and initializes the I3C slave peripheral as described by the user - * provided configuration. - * - * @param base The I3C peripheral base address. - * @param slaveConfig User provided peripheral configuration. Use I3C_SlaveGetDefaultConfig() to get a set of - * defaults that you can override. - * @param slowClock_Hz Frequency in Hertz of the I3C slow clock. Used to calculate the bus match condition values. - * If FSL_FEATURE_I3C_HAS_NO_SCONFIG_BAMATCH defines as 1, this parameter is useless. - */ -void I3C_SlaveInit(I3C_Type *base, const i3c_slave_config_t *slaveConfig, uint32_t slowClock_Hz); - -/*! - * @brief Deinitializes the I3C slave peripheral. - * - * This function disables the I3C slave peripheral and gates the clock. - * - * @param base The I3C peripheral base address. - */ -void I3C_SlaveDeinit(I3C_Type *base); - -/*! - * @brief Enable/Disable Slave. - * - * @param base The I3C peripheral base address. - * @param isEnable Enable or disable. - */ -static inline void I3C_SlaveEnable(I3C_Type *base, bool isEnable) -{ - base->SCONFIG = (base->SCONFIG & ~I3C_SCONFIG_SLVENA_MASK) | I3C_SCONFIG_SLVENA(isEnable); -} - -/*! @} */ - -/*! @name Status */ -/*! @{ */ - -/*! - * @brief Gets the I3C slave status flags. - * - * A bit mask with the state of all I3C slave status flags is returned. For each flag, the corresponding bit - * in the return value is set if the flag is asserted. - * - * @param base The I3C peripheral base address. - * @return State of the status flags: - * - 1: related status flag is set. - * - 0: related status flag is not set. - * @see _i3c_slave_flags - */ -static inline uint32_t I3C_SlaveGetStatusFlags(I3C_Type *base) -{ - return base->SSTATUS & ~(I3C_SSTATUS_EVDET_MASK | I3C_SSTATUS_ACTSTATE_MASK | I3C_SSTATUS_TIMECTRL_MASK); -} - -/*! - * @brief Clears the I3C slave status flag state. - * - * The following status register flags can be cleared: - * - #kI3C_SlaveBusStartFlag - * - #kI3C_SlaveMatchedFlag - * - #kI3C_SlaveBusStopFlag - * - * Attempts to clear other flags has no effect. - * - * @param base The I3C peripheral base address. - * @param statusMask A bitmask of status flags that are to be cleared. The mask is composed of - * #_i3c_slave_flags enumerators OR'd together. You may pass the result of a previous call to - * I3C_SlaveGetStatusFlags(). - * @see _i3c_slave_flags. - */ -static inline void I3C_SlaveClearStatusFlags(I3C_Type *base, uint32_t statusMask) -{ - base->SSTATUS = statusMask; -} - -/*! - * @brief Gets the I3C slave error status flags. - * - * A bit mask with the state of all I3C slave error status flags is returned. For each flag, the corresponding bit - * in the return value is set if the flag is asserted. - * - * @param base The I3C peripheral base address. - * @return State of the error status flags: - * - 1: related status flag is set. - * - 0: related status flag is not set. - * @see _i3c_slave_error_flags - */ -static inline uint32_t I3C_SlaveGetErrorStatusFlags(I3C_Type *base) -{ - return base->SERRWARN; -} - -/*! - * @brief Clears the I3C slave error status flag state. - * - * @param base The I3C peripheral base address. - * @param statusMask A bitmask of error status flags that are to be cleared. The mask is composed of - * #_i3c_slave_error_flags enumerators OR'd together. You may pass the result of a previous call to - * I3C_SlaveGetErrorStatusFlags(). - * @see _i3c_slave_error_flags. - */ -static inline void I3C_SlaveClearErrorStatusFlags(I3C_Type *base, uint32_t statusMask) -{ - base->SERRWARN = statusMask; -} - -/*! - * @brief Gets the I3C slave state. - * - * @param base The I3C peripheral base address. - * @return I3C slave activity state, refer #i3c_slave_activity_state_t. - */ -i3c_slave_activity_state_t I3C_SlaveGetActivityState(I3C_Type *base); - -/* Not static so it can be used from fsl_i3c_dma.c. */ -status_t I3C_SlaveCheckAndClearError(I3C_Type *base, uint32_t status); -/*! @} */ - -/*! @name Interrupts */ -/*! @{ */ - -/*! - * @brief Enables the I3C slave interrupt requests. - * - * Only below flags can be enabled as interrupts. - * - #kI3C_SlaveBusStartFlag - * - #kI3C_SlaveMatchedFlag - * - #kI3C_SlaveBusStopFlag - * - #kI3C_SlaveRxReadyFlag - * - #kI3C_SlaveTxReadyFlag - * - #kI3C_SlaveDynamicAddrChangedFlag - * - #kI3C_SlaveReceivedCCCFlag - * - #kI3C_SlaveErrorFlag - * - #kI3C_SlaveHDRCommandMatchFlag - * - #kI3C_SlaveCCCHandledFlag - * - #kI3C_SlaveEventSentFlag - * - * @param base The I3C peripheral base address. - * @param interruptMask Bit mask of interrupts to enable. See #_i3c_slave_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void I3C_SlaveEnableInterrupts(I3C_Type *base, uint32_t interruptMask) -{ - base->SINTSET |= interruptMask; -} - -/*! - * @brief Disables the I3C slave interrupt requests. - * - * Only below flags can be disabled as interrupts. - * - #kI3C_SlaveBusStartFlag - * - #kI3C_SlaveMatchedFlag - * - #kI3C_SlaveBusStopFlag - * - #kI3C_SlaveRxReadyFlag - * - #kI3C_SlaveTxReadyFlag - * - #kI3C_SlaveDynamicAddrChangedFlag - * - #kI3C_SlaveReceivedCCCFlag - * - #kI3C_SlaveErrorFlag - * - #kI3C_SlaveHDRCommandMatchFlag - * - #kI3C_SlaveCCCHandledFlag - * - #kI3C_SlaveEventSentFlag - * - * @param base The I3C peripheral base address. - * @param interruptMask Bit mask of interrupts to disable. See #_i3c_slave_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void I3C_SlaveDisableInterrupts(I3C_Type *base, uint32_t interruptMask) -{ - base->SINTCLR = interruptMask; -} - -/*! - * @brief Returns the set of currently enabled I3C slave interrupt requests. - * - * @param base The I3C peripheral base address. - * @return A bitmask composed of #_i3c_slave_flags enumerators OR'd together to indicate the - * set of enabled interrupts. - */ -static inline uint32_t I3C_SlaveGetEnabledInterrupts(I3C_Type *base) -{ - return base->SINTSET; -} - -/*! - * @brief Returns the set of pending I3C slave interrupt requests. - * - * @param base The I3C peripheral base address. - * @return A bitmask composed of #_i3c_slave_flags enumerators OR'd together to indicate the - * set of pending interrupts. - */ -static inline uint32_t I3C_SlaveGetPendingInterrupts(I3C_Type *base) -{ - return base->SINTMASKED; -} - -/*! @} */ - -/*! @name DMA control */ -/*! @{ */ - -/*! - * @brief Enables or disables I3C slave DMA requests. - * - * @param base The I3C peripheral base address. - * @param enableTx Enable flag for transmit DMA request. Pass true for enable, false for disable. - * @param enableRx Enable flag for receive DMA request. Pass true for enable, false for disable. - * @param width DMA read/write unit in bytes. - */ -static inline void I3C_SlaveEnableDMA(I3C_Type *base, bool enableTx, bool enableRx, uint32_t width) -{ - assert(width <= 2U); - base->SDMACTRL = - I3C_SDMACTRL_DMAFB(enableRx ? 2U : 0U) | I3C_SDMACTRL_DMATB(enableTx ? 2U : 0U) | I3C_SDMACTRL_DMAWIDTH(width); -} - -/*! - * @brief Gets I3C slave transmit data register address for DMA transfer. - * - * @param base The I3C peripheral base address. - * @param width DMA read/write unit in bytes. - * @return The I3C Slave Transmit Data Register address. - */ -static inline uint32_t I3C_SlaveGetTxFifoAddress(I3C_Type *base, uint32_t width) -{ - assert(width <= 2U); - return (uint32_t)((width == 2U) ? &base->SWDATAH : &base->SWDATAB); -} - -/*! - * @brief Gets I3C slave receive data register address for DMA transfer. - * - * @param base The I3C peripheral base address. - * @param width DMA read/write unit in bytes. - * @return The I3C Slave Receive Data Register address. - */ -static inline uint32_t I3C_SlaveGetRxFifoAddress(I3C_Type *base, uint32_t width) -{ - assert(width <= 2U); - return (uint32_t)((width == 2U) ? &base->SRDATAH : &base->SRDATAB); -} - -/*! @} */ - -/*! @name FIFO control */ -/*! @{ */ - -/*! - * @brief Sets the watermarks for I3C slave FIFOs. - * - * @param base The I3C peripheral base address. - * @param txLvl Transmit FIFO watermark level. The #kI3C_SlaveTxReadyFlag flag is set whenever - * the number of words in the transmit FIFO reaches @a txLvl. - * @param rxLvl Receive FIFO watermark level. The #kI3C_SlaveRxReadyFlag flag is set whenever - * the number of words in the receive FIFO reaches @a rxLvl. - * @param flushTx true if TX FIFO is to be cleared, otherwise TX FIFO remains unchanged. - * @param flushRx true if RX FIFO is to be cleared, otherwise RX FIFO remains unchanged. - */ -static inline void I3C_SlaveSetWatermarks( - I3C_Type *base, i3c_tx_trigger_level_t txLvl, i3c_rx_trigger_level_t rxLvl, bool flushTx, bool flushRx) -{ - base->SDATACTRL = I3C_SDATACTRL_UNLOCK_MASK | I3C_SDATACTRL_TXTRIG(txLvl) | I3C_SDATACTRL_RXTRIG(rxLvl) | - (flushTx ? I3C_SDATACTRL_FLUSHTB_MASK : 0U) | (flushRx ? I3C_SDATACTRL_FLUSHFB_MASK : 0U); -} - -/*! - * @brief Gets the current number of bytes in the I3C slave FIFOs. - * - * @param base The I3C peripheral base address. - * @param[out] txCount Pointer through which the current number of bytes in the transmit FIFO is returned. - * Pass NULL if this value is not required. - * @param[out] rxCount Pointer through which the current number of bytes in the receive FIFO is returned. - * Pass NULL if this value is not required. - */ -static inline void I3C_SlaveGetFifoCounts(I3C_Type *base, size_t *rxCount, size_t *txCount) -{ - if (NULL != txCount) - { - *txCount = (base->SDATACTRL & I3C_SDATACTRL_TXCOUNT_MASK) >> I3C_SDATACTRL_TXCOUNT_SHIFT; - } - if (NULL != rxCount) - { - *rxCount = (base->SDATACTRL & I3C_SDATACTRL_RXCOUNT_MASK) >> I3C_SDATACTRL_RXCOUNT_SHIFT; - } -} - -/*! @} */ - -/*! @name Bus operations */ -/*! @{ */ - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) && FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) -/*! - * @brief I3C slave request event. - * - * @param base The I3C peripheral base address. - * @param event I3C slave event of type #i3c_slave_event_t - */ -void I3C_SlaveRequestEvent(I3C_Type *base, i3c_slave_event_t event); -#endif - -/*! - * @brief Performs a polling send transfer on the I3C bus. - * - * @param base The I3C peripheral base address. - * @param txBuff The pointer to the data to be transferred. - * @param txSize The length in bytes of the data to be transferred. - * @return Error or success status returned by API. - */ -status_t I3C_SlaveSend(I3C_Type *base, const void *txBuff, size_t txSize); - -/*! - * @brief Performs a polling receive transfer on the I3C bus. - * - * @param base The I3C peripheral base address. - * @param rxBuff The pointer to the data to be transferred. - * @param rxSize The length in bytes of the data to be transferred. - * @return Error or success status returned by API. - */ -status_t I3C_SlaveReceive(I3C_Type *base, void *rxBuff, size_t rxSize); - -/*! @} */ - -/*! @name Slave non-blocking */ -/*! @{ */ - -/*! - * @brief Creates a new handle for the I3C slave non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the I3C_SlaveTransferAbort() API shall be called. - * - * @note The function also enables the NVIC IRQ for the input I3C. Need to notice - * that on some SoCs the I3C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - - * @param base The I3C peripheral base address. - * @param[out] handle Pointer to the I3C slave driver handle. - * @param callback User provided pointer to the asynchronous callback function. - * @param userData User provided pointer to the application callback data. - */ -void I3C_SlaveTransferCreateHandle(I3C_Type *base, - i3c_slave_handle_t *handle, - i3c_slave_transfer_callback_t callback, - void *userData); - -/*! - * @brief Starts accepting slave transfers. - * - * Call this API after calling I2C_SlaveInit() and I3C_SlaveTransferCreateHandle() to start processing - * transactions driven by an I2C master. The slave monitors the I2C bus and pass events to the - * callback that was passed into the call to I3C_SlaveTransferCreateHandle(). The callback is always invoked - * from the interrupt context. - * - * The set of events received by the callback is customizable. To do so, set the @a eventMask parameter to - * the OR'd combination of #i3c_slave_transfer_event_t enumerators for the events you wish to receive. - * The #kI3C_SlaveTransmitEvent and #kI3C_SlaveReceiveEvent events are always enabled and do not need - * to be included in the mask. Alternatively, you can pass 0 to get a default set of only the transmit and - * receive events that are always enabled. In addition, the #kI3C_SlaveAllEvents constant is provided as - * a convenient way to enable all events. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to struct: _i3c_slave_handle structure which stores the transfer state. - * @param eventMask Bit mask formed by OR'ing together #i3c_slave_transfer_event_t enumerators to specify - * which events to send to the callback. Other accepted values are 0 to get a default set of - * only the transmit and receive events, and #kI3C_SlaveAllEvents to enable all events. - * - * @retval #kStatus_Success Slave transfers were successfully started. - * @retval #kStatus_I3C_Busy Slave transfers have already been started on this handle. - */ -status_t I3C_SlaveTransferNonBlocking(I3C_Type *base, i3c_slave_handle_t *handle, uint32_t eventMask); - -/*! - * @brief Gets the slave transfer status during a non-blocking transfer. - * @param base The I3C peripheral base address. - * @param handle Pointer to i2c_slave_handle_t structure. - * @param[out] count Pointer to a value to hold the number of bytes transferred. May be NULL if the count is not - * required. - * @retval #kStatus_Success - * @retval #kStatus_NoTransferInProgress - */ -status_t I3C_SlaveTransferGetCount(I3C_Type *base, i3c_slave_handle_t *handle, size_t *count); - -/*! - * @brief Aborts the slave non-blocking transfers. - * @note This API could be called at any time to stop slave for handling the bus events. - * @param base The I3C peripheral base address. - * @param handle Pointer to struct: _i3c_slave_handle structure which stores the transfer state. - * @retval #kStatus_Success - * @retval #kStatus_I3C_Idle - */ -void I3C_SlaveTransferAbort(I3C_Type *base, i3c_slave_handle_t *handle); - -/*! @} */ - -/*! @name Slave IRQ handler */ -/*! @{ */ - -/*! - * @brief Reusable routine to handle slave interrupts. - * @note This function does not need to be called unless you are reimplementing the - * non blocking API's interrupt handler routines to add special functionality. - * @param base The I3C peripheral base address. - * @param intHandle Pointer to struct: _i3c_slave_handle structure which stores the transfer state. - */ -void I3C_SlaveTransferHandleIRQ(I3C_Type *base, void *intHandle); - -#if !(defined(FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) && FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) -/*! - * @brief I3C slave request IBI event with data payload(mandatory and extended). - * - * @param base The I3C peripheral base address. - * @param data Pointer to IBI data to be sent in the request. - * @param dataSize IBI data size. - */ -void I3C_SlaveRequestIBIWithData(I3C_Type *base, uint8_t *data, size_t dataSize); - -/*! - * @brief I3C slave request IBI event with single data. - * @deprecated Do not use this function. It has been superseded by @ref I3C_SlaveRequestIBIWithData. - * - * @param base The I3C peripheral base address. - * @param data IBI data to be sent in the request. - * @param dataSize IBI data size. - */ -void I3C_SlaveRequestIBIWithSingleData(I3C_Type *base, uint8_t data, size_t dataSize); -#endif /* !(defined(FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) && FSL_FEATURE_I3C_HAS_NO_SLAVE_IBI_MR_HJ) */ - -/*! @} */ -/*! @} */ -#if defined(__cplusplus) -} -#endif - -#endif /* FSL_I3C_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_i3c_edma.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_i3c_edma.c deleted file mode 100644 index 7ff5e8a6d04..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_i3c_edma.c +++ /dev/null @@ -1,1057 +0,0 @@ -/* - * Copyright 2022-2023 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_i3c_edma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.i3c_edma" -#endif - -/*! @brief States for the state machine used by transactional APIs. */ -enum _i3c_edma_transfer_states -{ - kIdleState = 0, - kIBIWonState, - kSlaveStartState, - kSendCommandState, - kWaitRepeatedStartCompleteState, - kTransmitDataState, - kReceiveDataState, - kStopState, - kWaitForCompletionState, - kAddressMatchState, -}; - -/*! @brief Common sets of flags used by the driver. */ -enum _i3c_edma_flag_constants -{ - /*! All flags which are cleared by the driver upon starting a transfer. */ - kMasterClearFlags = kI3C_MasterSlaveStartFlag | kI3C_MasterControlDoneFlag | kI3C_MasterCompleteFlag | - kI3C_MasterArbitrationWonFlag | kI3C_MasterSlave2MasterFlag | kI3C_MasterErrorFlag, - - /*! IRQ sources enabled by the non-blocking transactional API. */ - kMasterDMAIrqFlags = kI3C_MasterSlaveStartFlag | kI3C_MasterControlDoneFlag | kI3C_MasterCompleteFlag | - kI3C_MasterArbitrationWonFlag | kI3C_MasterErrorFlag | kI3C_MasterSlave2MasterFlag, - - /*! Errors to check for. */ - kMasterErrorFlags = kI3C_MasterErrorNackFlag | kI3C_MasterErrorWriteAbortFlag | -#if !defined(FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) || (!FSL_FEATURE_I3C_HAS_NO_MERRWARN_TERM) - kI3C_MasterErrorTermFlag | -#endif - kI3C_MasterErrorParityFlag | kI3C_MasterErrorCrcFlag | kI3C_MasterErrorReadFlag | - kI3C_MasterErrorWriteFlag | kI3C_MasterErrorMsgFlag | kI3C_MasterErrorInvalidReqFlag | - kI3C_MasterErrorTimeoutFlag, - /*! All flags which are cleared by the driver upon starting a transfer. */ - kSlaveClearFlags = kI3C_SlaveBusStartFlag | kI3C_SlaveMatchedFlag | kI3C_SlaveBusStopFlag, - - /*! IRQ sources enabled by the non-blocking transactional API. */ - kSlaveDMAIrqFlags = kI3C_SlaveBusStartFlag | kI3C_SlaveMatchedFlag | - kI3C_SlaveBusStopFlag | /*kI3C_SlaveRxReadyFlag |*/ - kI3C_SlaveDynamicAddrChangedFlag | kI3C_SlaveReceivedCCCFlag | kI3C_SlaveErrorFlag | - kI3C_SlaveHDRCommandMatchFlag | kI3C_SlaveCCCHandledFlag | kI3C_SlaveEventSentFlag, - - /*! Errors to check for. */ - kSlaveErrorFlags = kI3C_SlaveErrorOverrunFlag | kI3C_SlaveErrorUnderrunFlag | kI3C_SlaveErrorUnderrunNakFlag | - kI3C_SlaveErrorTermFlag | kI3C_SlaveErrorInvalidStartFlag | kI3C_SlaveErrorSdrParityFlag | - kI3C_SlaveErrorHdrParityFlag | kI3C_SlaveErrorHdrCRCFlag | kI3C_SlaveErrorS0S1Flag | - kI3C_SlaveErrorOverreadFlag | kI3C_SlaveErrorOverwriteFlag, -}; -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Array to map I3C instance number to base pointer. */ -static I3C_Type *const kI3cBases[] = I3C_BASE_PTRS; - -/*! @brief Array to store the END byte of I3C teransfer. */ -static uint8_t i3cEndByte[ARRAY_SIZE(kI3cBases)] = {0}; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -static void I3C_MasterRunEDMATransfer( - I3C_Type *base, i3c_master_edma_handle_t *handle, void *data, size_t dataSize, i3c_direction_t direction); - -/******************************************************************************* - * Code - ******************************************************************************/ -static void I3C_MasterTransferEDMACallbackRx(edma_handle_t *dmaHandle, void *param, bool transferDone, uint32_t tcds) -{ - i3c_master_edma_handle_t *i3cHandle = (i3c_master_edma_handle_t *)param; - - if (transferDone) - { - /* Terminate following data if present. */ - i3cHandle->base->MCTRL |= I3C_MCTRL_RDTERM(1U); - -#if defined(FSL_FEATURE_I3C_HAS_ERRATA_052086) && (FSL_FEATURE_I3C_HAS_ERRATA_052086) - if (i3cHandle->transfer.dataSize > 1U) - { - size_t rxCount; - /* Read out the last byte data. */ - do - { - I3C_MasterGetFifoCounts(i3cHandle->base, &rxCount, NULL); - } while (rxCount == 0U); - *(uint8_t *)((uint32_t)(uint32_t *)i3cHandle->transfer.data + i3cHandle->transfer.dataSize - 1U) = - (uint8_t)i3cHandle->base->MRDATAB; - } -#endif - - /* Disable I3C Rx DMA. */ - i3cHandle->base->MDATACTRL &= ~I3C_MDMACTRL_DMAFB_MASK; - } -} - -static void I3C_MasterTransferEDMACallbackTx(edma_handle_t *dmaHandle, void *param, bool transferDone, uint32_t tcds) -{ - i3c_master_edma_handle_t *i3cHandle = (i3c_master_edma_handle_t *)param; - uint32_t instance; - - if (transferDone) - { - /* Disable I3C Tx DMA. */ - i3cHandle->base->MDATACTRL &= ~I3C_MDMACTRL_DMATB_MASK; - - if (i3cHandle->transferCount != 1U) - { - instance = I3C_GetInstance(i3cHandle->base); - /* Ensure there's space in the Tx FIFO. */ - while ((i3cHandle->base->MDATACTRL & I3C_MDATACTRL_TXFULL_MASK) != 0U) - { - } - i3cHandle->base->MWDATABE = i3cEndByte[instance]; - } - } -} -/*! - * brief Prepares the transfer state machine and fills in the command buffer. - * param handle Master nonblocking driver handle. - */ -static status_t I3C_MasterInitTransferStateMachineEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle) -{ - i3c_master_transfer_t *xfer = &handle->transfer; - status_t result = kStatus_Success; - i3c_direction_t direction = xfer->direction; - - /* Calculate command count and put into command buffer. */ - handle->subaddressCount = 0U; - if (xfer->subaddressSize != 0U) - { - for (uint32_t i = xfer->subaddressSize; i > 0U; i--) - { - handle->subaddressBuffer[handle->subaddressCount++] = (uint8_t)((xfer->subaddress) >> (8U * (i - 1U))); - } - } - - /* Start condition shall be ommited, switch directly to next phase */ - if (xfer->dataSize == 0U) - { - handle->state = (uint8_t)kStopState; - } - - if (0UL != (xfer->flags & (uint32_t)kI3C_TransferStartWithBroadcastAddr)) - { - if (0UL != (xfer->flags & (uint32_t)kI3C_TransferNoStartFlag)) - { - return kStatus_InvalidArgument; - } - - if (0UL != (xfer->flags & (uint32_t)kI3C_TransferRepeatedStartFlag)) - { - return kStatus_InvalidArgument; - } - - /* Issue 0x7E as start. */ - result = I3C_MasterStart(base, xfer->busType, 0x7E, kI3C_Write); - if (result != kStatus_Success) - { - return result; - } - - result = I3C_MasterWaitForCtrlDone(base, false); - if (result != kStatus_Success) - { - return result; - } - } - - /* Handle no start option. */ - if (0U != (xfer->flags & (uint32_t)kI3C_TransferNoStartFlag)) - { - /* No need to send start flag, directly go to send command or data */ - if (xfer->subaddressSize > 0UL) - { - handle->state = (uint8_t)kSendCommandState; - } - else - { - if (direction == kI3C_Write) - { - /* Next state, send data. */ - handle->state = (uint8_t)kTransmitDataState; - } - else - { - /* Only support write with no stop signal. */ - return kStatus_InvalidArgument; - } - } - } - else - { - if (xfer->subaddressSize != 0U) - { - handle->state = (uint8_t)kSendCommandState; - } - else - { - if (handle->transfer.direction == kI3C_Write) - { - handle->state = (uint8_t)kTransmitDataState; - } - else if (handle->transfer.direction == kI3C_Read) - { - handle->state = (uint8_t)kReceiveDataState; - } - else - { - return kStatus_InvalidArgument; - } - } - - if (handle->transfer.direction == kI3C_Read) - { - I3C_MasterRunEDMATransfer(base, handle, xfer->data, xfer->dataSize, kI3C_Read); - } - - if (handle->state != (uint8_t)kStopState) - { - /* If repeated start is requested, send repeated start. */ - if (0U != (xfer->flags & (uint32_t)kI3C_TransferRepeatedStartFlag)) - { - result = I3C_MasterRepeatedStart(base, xfer->busType, xfer->slaveAddress, direction); - } - else /* For normal transfer, send start. */ - { - result = I3C_MasterStart(base, xfer->busType, xfer->slaveAddress, direction); - } - } - } - - I3C_MasterTransferEDMAHandleIRQ(base, handle); - return result; -} - -static void I3C_MasterRunEDMATransfer( - I3C_Type *base, i3c_master_edma_handle_t *handle, void *data, size_t dataSize, i3c_direction_t direction) -{ - bool isEnableTxDMA = false; - bool isEnableRxDMA = false; - edma_transfer_config_t xferConfig; - uint32_t instance; - uint32_t address; - uint32_t width; - - handle->transferCount = dataSize; - - switch (direction) - { - case kI3C_Write: - if (dataSize != 1U) - { - address = (uint32_t)&base->MWDATAB1; - /* Cause controller sends command and data with same interface, need special buffer to store the END byte. */ - instance = I3C_GetInstance(base); - i3cEndByte[instance] = *(uint8_t *)((uint32_t)(uint32_t *)data + dataSize - 1U); - dataSize--; - } - else - { - address = (uint32_t)&base->MWDATABE; - } - EDMA_PrepareTransfer(&xferConfig, data, sizeof(uint8_t), (uint32_t *)address, sizeof(uint8_t), 1, dataSize, - kEDMA_MemoryToPeripheral); - (void)EDMA_SubmitTransfer(handle->txDmaHandle, &xferConfig); - EDMA_StartTransfer(handle->txDmaHandle); - isEnableTxDMA = true; - width = 1U; - break; - - case kI3C_Read: -#if defined(FSL_FEATURE_I3C_HAS_ERRATA_052086) && (FSL_FEATURE_I3C_HAS_ERRATA_052086) - /* ERRATA052086: Soc integration issue results in target misses the last DMA request to copy the - last one byte from controler when transmission data size is > 1 byte. Resolution: Triggering DMA - interrupt one byte in advance, then receive the last one byte data after DMA transmission finishes. */ - if (dataSize > 1U) - { - dataSize--; - } -#endif - address = (uint32_t)&base->MRDATAB; - EDMA_PrepareTransfer(&xferConfig, (uint32_t *)address, sizeof(uint8_t), data, sizeof(uint8_t), 1, dataSize, - kEDMA_PeripheralToMemory); - (void)EDMA_SubmitTransfer(handle->rxDmaHandle, &xferConfig); - EDMA_StartTransfer(handle->rxDmaHandle); - isEnableRxDMA = true; - width = 1U; - break; - - default: - /* This should never happen */ - assert(false); - break; - } - - I3C_MasterEnableDMA(base, isEnableTxDMA, isEnableRxDMA, width); -} - -static status_t I3C_MasterRunTransferStateMachineEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle, bool *isDone) -{ - uint32_t status; - uint32_t errStatus; - status_t result = kStatus_Success; - i3c_master_transfer_t *xfer; - size_t rxCount = 0; - bool state_complete = false; - - /* Set default isDone return value. */ - *isDone = false; - - /* Check for errors. */ - status = (uint32_t)I3C_MasterGetPendingInterrupts(base); - I3C_MasterClearStatusFlags(base, status); - - i3c_master_state_t masterState = I3C_MasterGetState(base); - errStatus = I3C_MasterGetErrorStatusFlags(base); - result = I3C_MasterCheckAndClearError(base, errStatus); - if (kStatus_Success != result) - { - return result; - } - - if (0UL != (status & (uint32_t)kI3C_MasterSlave2MasterFlag)) - { - if (handle->callback.slave2Master != NULL) - { - handle->callback.slave2Master(base, handle->userData); - } - } - - if ((0UL != (status & (uint32_t)kI3C_MasterSlaveStartFlag)) && (handle->transfer.busType != kI3C_TypeI2C)) - { - handle->state = (uint8_t)kSlaveStartState; - } - - if ((masterState == kI3C_MasterStateIbiRcv) || (masterState == kI3C_MasterStateIbiAck)) - { - handle->state = (uint8_t)kIBIWonState; - } - - if (handle->state == (uint8_t)kIdleState) - { - return result; - } - - if (handle->state == (uint8_t)kIBIWonState) - { - /* Get fifo counts and compute room in tx fifo. */ - rxCount = (base->MDATACTRL & I3C_MDATACTRL_RXCOUNT_MASK) >> I3C_MDATACTRL_RXCOUNT_SHIFT; - } - - /* Get pointer to private data. */ - xfer = &handle->transfer; - - while (!state_complete) - { - /* Execute the state. */ - switch (handle->state) - { - case (uint8_t)kSlaveStartState: - /* Emit start + 0x7E */ - I3C_MasterEmitRequest(base, kI3C_RequestAutoIbi); - handle->state = (uint8_t)kIBIWonState; - state_complete = true; - break; - - case (uint8_t)kIBIWonState: - if (masterState == kI3C_MasterStateIbiAck) - { - handle->ibiType = I3C_GetIBIType(base); - if (handle->callback.ibiCallback != NULL) - { - handle->callback.ibiCallback(base, handle, handle->ibiType, kI3C_IbiAckNackPending); - } - else - { - I3C_MasterEmitIBIResponse(base, kI3C_IbiRespNack); - } - } - - /* Make sure there is data in the rx fifo. */ - if (0UL != rxCount) - { - if ((handle->ibiBuff == NULL) && (handle->callback.ibiCallback != NULL)) - { - handle->callback.ibiCallback(base, handle, kI3C_IbiNormal, kI3C_IbiDataBuffNeed); - } - uint8_t tempData = (uint8_t)base->MRDATAB; - if (handle->ibiBuff != NULL) - { - handle->ibiBuff[handle->ibiPayloadSize++] = tempData; - } - rxCount--; - break; - } - else if (0UL != (status & (uint32_t)kI3C_MasterCompleteFlag)) - { - handle->ibiType = I3C_GetIBIType(base); - handle->ibiAddress = I3C_GetIBIAddress(base); - state_complete = true; - result = kStatus_I3C_IBIWon; - } - else - { - state_complete = true; - } - break; - - case (uint8_t)kSendCommandState: - I3C_MasterRunEDMATransfer(base, handle, handle->subaddressBuffer, handle->subaddressCount, kI3C_Write); - - if ((xfer->direction == kI3C_Read) || (0UL == xfer->dataSize)) - { - if (0UL == xfer->dataSize) - { - handle->state = (uint8_t)kWaitForCompletionState; - } - else - { - /* xfer->dataSize != 0U, xfer->direction = kI3C_Read */ - handle->state = (uint8_t)kWaitRepeatedStartCompleteState; - } - } - else - { - /* Next state, transfer data. */ - handle->state = (uint8_t)kTransmitDataState; - } - - state_complete = true; - break; - - case (uint8_t)kWaitRepeatedStartCompleteState: - /* We stay in this state until the maste complete. */ - if (0UL != (status & (uint32_t)kI3C_MasterCompleteFlag)) - { - handle->state = (uint8_t)kReceiveDataState; - /* Send repeated start and slave address. */ - result = I3C_MasterRepeatedStart(base, xfer->busType, xfer->slaveAddress, kI3C_Read); - } - - state_complete = true; - break; - - case (uint8_t)kTransmitDataState: - I3C_MasterRunEDMATransfer(base, handle, xfer->data, xfer->dataSize, kI3C_Write); - handle->state = (uint8_t)kWaitForCompletionState; - - state_complete = true; - break; - - case (uint8_t)kReceiveDataState: - /* Do DMA read. */ - handle->state = (uint8_t)kWaitForCompletionState; - - state_complete = true; - break; - - case (uint8_t)kWaitForCompletionState: - /* We stay in this state until the maste complete. */ - if (0UL != (status & (uint32_t)kI3C_MasterCompleteFlag)) - { - handle->state = (uint8_t)kStopState; - } - else - { - state_complete = true; - } - break; - - case (uint8_t)kStopState: - /* Only issue a stop transition if the caller requested it. */ - if (0UL == (xfer->flags & (uint32_t)kI3C_TransferNoStopFlag)) - { - if (xfer->busType == kI3C_TypeI3CDdr) - { - I3C_MasterEmitRequest(base, kI3C_RequestForceExit); - } - else - { - I3C_MasterEmitRequest(base, kI3C_RequestEmitStop); - result = I3C_MasterWaitForCtrlDone(base, false); - } - } - *isDone = true; - state_complete = true; - break; - - default: - assert(false); - break; - } - } - return result; -} - -void I3C_MasterTransferCreateHandleEDMA(I3C_Type *base, - i3c_master_edma_handle_t *handle, - const i3c_master_edma_callback_t *callback, - void *userData, - edma_handle_t *rxDmaHandle, - edma_handle_t *txDmaHandle) -{ - uint32_t instance; - - assert(NULL != handle); - - /* Clear out the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Look up instance number */ - instance = I3C_GetInstance(base); - - handle->base = base; - handle->txDmaHandle = txDmaHandle; - handle->rxDmaHandle = rxDmaHandle; - handle->callback = *callback; - handle->userData = userData; - - /* Save this handle for IRQ use. */ - s_i3cMasterHandle[instance] = handle; - - /* Set irq handler. */ - s_i3cMasterIsr = I3C_MasterTransferEDMAHandleIRQ; - - EDMA_SetCallback(handle->rxDmaHandle, I3C_MasterTransferEDMACallbackRx, handle); - EDMA_SetCallback(handle->txDmaHandle, I3C_MasterTransferEDMACallbackTx, handle); - - /* Clear all flags. */ - I3C_MasterClearErrorStatusFlags(base, (uint32_t)kMasterErrorFlags); - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - /* Reset fifos. These flags clear automatically. */ - base->MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - - /* Enable NVIC IRQ, this only enables the IRQ directly connected to the NVIC. - In some cases the I3C IRQ is configured through INTMUX, user needs to enable - INTMUX IRQ in application code. */ - (void)EnableIRQ(kI3cIrqs[instance]); - - /* Clear internal IRQ enables and enable NVIC IRQ. */ - I3C_MasterEnableInterrupts(base, (uint32_t)kMasterDMAIrqFlags); -} - -/*! - * brief Performs a non-blocking DMA transaction on the I2C/I3C bus. - * - * param base The I3C peripheral base address. - * param handle Pointer to the I3C master driver handle. - * param transfer The pointer to the transfer descriptor. - * retval #kStatus_Success The transaction was started successfully. - * retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - */ -status_t I3C_MasterTransferEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle, i3c_master_transfer_t *transfer) -{ - assert(NULL != handle); - assert(NULL != transfer); - assert(transfer->subaddressSize <= sizeof(transfer->subaddress)); - i3c_master_state_t masterState = I3C_MasterGetState(base); - bool checkDdrState = false; - - /* Return busy if another transaction is in progress. */ - if (handle->state != (uint8_t)kIdleState) - { - return kStatus_I3C_Busy; - } - - /* Return an error if the bus is already in use not by us. */ - checkDdrState = (transfer->busType == kI3C_TypeI3CDdr) ? (masterState != kI3C_MasterStateDdr) : true; - if ((masterState != kI3C_MasterStateIdle) && (masterState != kI3C_MasterStateNormAct) && checkDdrState) - { - return kStatus_I3C_Busy; - } - - /* Disable I3C IRQ sources while we configure stuff. */ - I3C_MasterDisableInterrupts( - base, ((uint32_t)kMasterDMAIrqFlags | (uint32_t)kI3C_MasterRxReadyFlag | (uint32_t)kI3C_MasterTxReadyFlag)); - - /* Save transfer into handle. */ - handle->transfer = *transfer; - - /* Configure IBI response type. */ - base->MCTRL &= ~I3C_MCTRL_IBIRESP_MASK; - base->MCTRL |= I3C_MCTRL_IBIRESP(transfer->ibiResponse); - - /* Clear all flags. */ - I3C_MasterClearErrorStatusFlags(base, (uint32_t)kMasterErrorFlags); - I3C_MasterClearStatusFlags(base, (uint32_t)kMasterClearFlags); - /* Reset fifos. These flags clear automatically. */ - base->MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - - /* Generate commands to send. */ - (void)I3C_MasterInitTransferStateMachineEDMA(base, handle); - - /* Enable I3C internal IRQ sources. NVIC IRQ was enabled in CreateHandle() */ - I3C_MasterEnableInterrupts(base, (uint32_t)(kMasterDMAIrqFlags)); - - if (transfer->busType == kI3C_TypeI2C) - { - I3C_MasterDisableInterrupts(base, (uint32_t)kI3C_MasterSlaveStartFlag); - } - - return kStatus_Success; -} - -void I3C_MasterTransferEDMAHandleIRQ(I3C_Type *base, void *i3cHandle) -{ - i3c_master_edma_handle_t *handle = (i3c_master_edma_handle_t *)i3cHandle; - - bool isDone; - status_t result; - - /* Don't do anything if we don't have a valid handle. */ - if (NULL == handle) - { - return; - } - - result = I3C_MasterRunTransferStateMachineEDMA(base, handle, &isDone); - - if (handle->state == (uint8_t)kIdleState) - { - return; - } - - if (isDone || (result != kStatus_Success)) - { - /* XXX need to handle data that may be in rx fifo below watermark level? */ - - /* XXX handle error, terminate xfer */ - if ((result == kStatus_I3C_Nak) || (result == kStatus_I3C_IBIWon)) - { - I3C_MasterEmitRequest(base, kI3C_RequestEmitStop); - (void)I3C_MasterWaitForCtrlDone(base, false); - } - - /* Set handle to idle state. */ - handle->state = (uint8_t)kIdleState; - - /* Invoke IBI user callback. */ - if ((result == kStatus_I3C_IBIWon) && (handle->callback.ibiCallback != NULL)) - { - handle->callback.ibiCallback(base, handle, handle->ibiType, kI3C_IbiReady); - handle->ibiPayloadSize = 0; - } - - /* Invoke callback. */ - if (NULL != handle->callback.transferComplete) - { - handle->callback.transferComplete(base, handle, result, handle->userData); - } - } -} - -/*! - * brief Get master transfer status during a dma non-blocking transfer - * - * param base I3C peripheral base address - * param handle pointer to i2c_master_edma_handle_t structure - * param count Number of bytes transferred so far by the non-blocking transaction. - */ -status_t I3C_MasterTransferGetCountEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (handle->state == (uint8_t)kIdleState) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - /* There is no necessity to disable interrupts as we read a single integer value */ - i3c_direction_t dir = handle->transfer.direction; - - if (dir == kI3C_Read) - { - *count = handle->transferCount - - 1U * EDMA_GetRemainingMajorLoopCount(handle->rxDmaHandle->base, handle->rxDmaHandle->channel); - } - else - { - *count = handle->transferCount - - 1U * EDMA_GetRemainingMajorLoopCount(handle->txDmaHandle->base, handle->txDmaHandle->channel); - } - - return kStatus_Success; -} - -/*! - * brief Abort a master edma non-blocking transfer in a early time - * - * param base I3C peripheral base address - * param handle pointer to i2c_master_edma_handle_t structure - */ -void I3C_MasterTransferAbortEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle) -{ - if (handle->state != (uint8_t)kIdleState) - { - EDMA_AbortTransfer(handle->txDmaHandle); - EDMA_AbortTransfer(handle->rxDmaHandle); - - I3C_MasterEnableDMA(base, false, false, 0); - - /* Reset fifos. These flags clear automatically. */ - base->MDATACTRL |= I3C_MDATACTRL_FLUSHTB_MASK | I3C_MDATACTRL_FLUSHFB_MASK; - - /* Send a stop command to finalize the transfer. */ - (void)I3C_MasterStop(base); - - /* Reset handle. */ - handle->state = (uint8_t)kIdleState; - } -} - -static void I3C_SlaveTransferEDMACallback(edma_handle_t *dmaHandle, void *param, bool transferDone, uint32_t tcds) -{ - i3c_slave_edma_handle_t *i3cHandle = (i3c_slave_edma_handle_t *)param; - - if (transferDone) - { - /* Simply disable dma enablement */ - if (i3cHandle->txDmaHandle == dmaHandle) - { - i3cHandle->base->SDMACTRL &= ~I3C_SDMACTRL_DMATB_MASK; - - if (i3cHandle->transfer.txDataSize > 1U) - { - /* Ensure there's space in the Tx FIFO. */ - while ((i3cHandle->base->SDATACTRL & I3C_SDATACTRL_TXFULL_MASK) != 0U) - { - } - /* Send the last byte. */ - i3cHandle->base->SWDATABE = *(uint8_t *)((uintptr_t)i3cHandle->transfer.txData + i3cHandle->transfer.txDataSize - 1U); - } - } - else - { -#if defined(FSL_FEATURE_I3C_HAS_ERRATA_052086) && (FSL_FEATURE_I3C_HAS_ERRATA_052086) - if (i3cHandle->transfer.rxDataSize > 1U) - { - size_t rxCount; - /* Read out the last byte data. */ - do - { - I3C_SlaveGetFifoCounts(i3cHandle->base, &rxCount, NULL); - } while (rxCount == 0U); - *(uint8_t *)((uintptr_t)i3cHandle->transfer.rxData + i3cHandle->transfer.rxDataSize - 1U) = - (uint8_t)i3cHandle->base->SRDATAB; - } -#endif - i3cHandle->base->SDMACTRL &= ~I3C_SDMACTRL_DMAFB_MASK; - } - } -} - -/*! - * brief Create a new handle for the I3C slave DMA APIs. - * - * The creation of a handle is for use with the DMA APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the I3C_SlaveTransferAbortDMA() API shall be called. - * - * For devices where the I3C send and receive DMA requests are OR'd together, the @a txDmaHandle - * parameter is ignored and may be set to NULL. - * - * param base The I3C peripheral base address. - * param handle Pointer to the I3C slave driver handle. - * param callback User provided pointer to the asynchronous callback function. - * param userData User provided pointer to the application callback data. - * param rxDmaHandle Handle for the DMA receive channel. Created by the user prior to calling this function. - * param txDmaHandle Handle for the DMA transmit channel. Created by the user prior to calling this function. - */ -void I3C_SlaveTransferCreateHandleEDMA(I3C_Type *base, - i3c_slave_edma_handle_t *handle, - i3c_slave_edma_callback_t callback, - void *userData, - edma_handle_t *rxDmaHandle, - edma_handle_t *txDmaHandle) -{ - uint32_t instance; - - assert(NULL != handle); - - /* Clear out the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Look up instance number */ - instance = I3C_GetInstance(base); - - handle->base = base; - handle->txDmaHandle = txDmaHandle; - handle->rxDmaHandle = rxDmaHandle; - handle->callback = callback; - handle->userData = userData; - - /* Save this handle for IRQ use. */ - s_i3cSlaveHandle[instance] = handle; - - /* Set irq handler. */ - s_i3cSlaveIsr = I3C_SlaveTransferEDMAHandleIRQ; - - EDMA_SetCallback(handle->rxDmaHandle, I3C_SlaveTransferEDMACallback, handle); - EDMA_SetCallback(handle->txDmaHandle, I3C_SlaveTransferEDMACallback, handle); - - /* Clear internal IRQ enables and enable NVIC IRQ. */ - I3C_SlaveDisableInterrupts(base, (uint32_t)kSlaveDMAIrqFlags); - - /* Enable NVIC IRQ, this only enables the IRQ directly connected to the NVIC. - In some cases the I3C IRQ is configured through INTMUX, user needs to enable - INTMUX IRQ in application code. */ - (void)EnableIRQ(kI3cIrqs[instance]); - - /* Enable IRQ. */ - I3C_SlaveEnableInterrupts(base, (uint32_t)kSlaveDMAIrqFlags); -} - -static void I3C_SlavePrepareTxEDMA(I3C_Type *base, i3c_slave_edma_handle_t *handle) -{ - edma_transfer_config_t txConfig; - uint32_t *txFifoBase; - i3c_slave_edma_transfer_t *xfer = &handle->transfer; - - if (xfer->txDataSize == 1U) - { - txFifoBase = (uint32_t *)(uintptr_t)&base->SWDATABE; - EDMA_PrepareTransfer(&txConfig, xfer->txData, 1, (void *)txFifoBase, 1, 1, xfer->txDataSize, - kEDMA_MemoryToPeripheral); - } - else - { - txFifoBase = (uint32_t *)(uintptr_t)&base->SWDATAB1; - EDMA_PrepareTransfer(&txConfig, xfer->txData, 1, (void *)txFifoBase, 1, 1, xfer->txDataSize - 1U, - kEDMA_MemoryToPeripheral); - } - - (void)EDMA_SubmitTransfer(handle->txDmaHandle, &txConfig); - EDMA_StartTransfer(handle->txDmaHandle); -} - -static void I3C_SlavePrepareRxEDMA(I3C_Type *base, i3c_slave_edma_handle_t *handle) -{ - uint32_t *rxFifoBase = (uint32_t *)(uintptr_t)&base->SRDATAB; - i3c_slave_edma_transfer_t *xfer = &handle->transfer; - size_t dataSize = xfer->rxDataSize; - edma_transfer_config_t rxConfig; - -#if defined(FSL_FEATURE_I3C_HAS_ERRATA_052086) && (FSL_FEATURE_I3C_HAS_ERRATA_052086) - /* ERRATA052086: Soc integration issue results in target misses the last DMA request to copy the - last one byte from controler when transmission data size is > 1 byte. Resolution: Triggering DMA - interrupt one byte in advance, then receive the last one byte data after DMA transmission finishes. */ - if (dataSize > 1U) - { - dataSize--; - } -#endif - - EDMA_PrepareTransfer(&rxConfig, (void *)rxFifoBase, 1, xfer->rxData, 1, 1, dataSize, - kEDMA_PeripheralToMemory); - (void)EDMA_SubmitTransfer(handle->rxDmaHandle, &rxConfig); - EDMA_StartTransfer(handle->rxDmaHandle); -} - -/*! - * brief Prepares for a non-blocking DMA-based transaction on the I3C bus. - * - * The API will do DMA configuration according to the input transfer descriptor, and the data will be transferred when - * there's bus master requesting transfer from/to this slave. So the timing of call to this API need be aligned - * with master application to ensure the transfer is executed as expected. - * Callback specified when the @a handle was created is invoked when the transaction has completed. - * - * param base The I3C peripheral base address. - * param handle Pointer to the I3C slave driver handle. - * param transfer The pointer to the transfer descriptor. - * param eventMask Bit mask formed by OR'ing together #i3c_slave_transfer_event_t enumerators to specify - * which events to send to the callback. The transmit and receive events is not allowed to be enabled. - * retval kStatus_Success The transaction was started successfully. - * retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or another DMA - * transaction is already in progress. - * retval #kStatus_Fail The transaction can't be set. - */ -status_t I3C_SlaveTransferEDMA(I3C_Type *base, - i3c_slave_edma_handle_t *handle, - i3c_slave_edma_transfer_t *transfer, - uint32_t eventMask) -{ - assert(NULL != handle); - assert(NULL != transfer); - - bool txDmaEn = false, rxDmaEn = false; - uint32_t width; - - if (handle->isBusy) - { - return kStatus_I3C_Busy; - } - /* Clear all flags. */ - I3C_SlaveClearErrorStatusFlags(base, (uint32_t)kSlaveErrorFlags); - I3C_SlaveClearStatusFlags(base, (uint32_t)kSlaveClearFlags); - /* Reset fifos. These flags clear automatically. */ - base->SDATACTRL |= I3C_SDATACTRL_FLUSHTB_MASK | I3C_SDATACTRL_FLUSHFB_MASK; - - handle->transfer = *transfer; - - /* Set up event mask. */ - handle->eventMask = eventMask; - - if ((transfer->txData != NULL) && (transfer->txDataSize != 0U)) - { - I3C_SlavePrepareTxEDMA(base, handle); - txDmaEn = true; - width = 1U; - } - - if ((transfer->rxData != NULL) && (transfer->rxDataSize != 0U)) - { - I3C_SlavePrepareRxEDMA(base, handle); - rxDmaEn = true; - width = 1U; - } - - if (txDmaEn || rxDmaEn) - { - I3C_SlaveEnableDMA(base, txDmaEn, rxDmaEn, width); - return kStatus_Success; - } - else - { - return kStatus_Fail; - } -} - -void I3C_SlaveTransferEDMAHandleIRQ(I3C_Type *base, void *i3cHandle) -{ - uint32_t flags; - uint32_t errFlags; - i3c_slave_edma_transfer_t *xfer; - - i3c_slave_edma_handle_t *handle = (i3c_slave_edma_handle_t *)i3cHandle; - /* Check for a valid handle in case of a spurious interrupt. */ - if (NULL == handle) - { - return; - } - - xfer = &handle->transfer; - - /* Get status flags. */ - flags = I3C_SlaveGetStatusFlags(base); - errFlags = I3C_SlaveGetErrorStatusFlags(base); - - /* Clear status flags. */ - I3C_SlaveClearStatusFlags(base, flags); - - if (0UL != (errFlags & (uint32_t)kSlaveErrorFlags)) - { - xfer->event = (uint32_t)kI3C_SlaveCompletionEvent; - xfer->completionStatus = I3C_SlaveCheckAndClearError(base, errFlags); - - if ((0UL != (handle->eventMask & (uint32_t)kI3C_SlaveCompletionEvent)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - return; - } - - if (0UL != (flags & (uint32_t)kI3C_SlaveEventSentFlag)) - { - xfer->event = (uint32_t)kI3C_SlaveRequestSentEvent; - if ((0UL != (handle->eventMask & xfer->event)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - } - - if (0UL != (flags & (uint32_t)kI3C_SlaveReceivedCCCFlag)) - { - handle->isBusy = true; - xfer->event = (uint32_t)kI3C_SlaveReceivedCCCEvent; - if ((0UL != (handle->eventMask & xfer->event)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - } - - if (0UL != (flags & (uint32_t)kI3C_SlaveBusStopFlag)) - { - if (handle->isBusy == true) - { - xfer->event = (uint32_t)kI3C_SlaveCompletionEvent; - xfer->completionStatus = kStatus_Success; - handle->isBusy = false; - - if ((0UL != (handle->eventMask & xfer->event)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - I3C_SlaveTransferAbortEDMA(base, handle); - } - else - { - return; - } - } - - if (0UL != (flags & (uint32_t)kI3C_SlaveMatchedFlag)) - { - xfer->event = (uint32_t)kI3C_SlaveAddressMatchEvent; - handle->isBusy = true; - if ((0UL != (handle->eventMask & (uint32_t)kI3C_SlaveAddressMatchEvent)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - } -} - -/*! - * brief Abort a slave dma non-blocking transfer in a early time - * - * param base I3C peripheral base address - * param handle pointer to i3c_slave_edma_handle_t structure - */ -void I3C_SlaveTransferAbortEDMA(I3C_Type *base, i3c_slave_edma_handle_t *handle) -{ - if (handle->isBusy != false) - { - EDMA_AbortTransfer(handle->txDmaHandle); - EDMA_AbortTransfer(handle->rxDmaHandle); - - I3C_SlaveEnableDMA(base, false, false, 0); - - /* Reset fifos. These flags clear automatically. */ - base->SDATACTRL |= I3C_SDATACTRL_FLUSHTB_MASK | I3C_SDATACTRL_FLUSHFB_MASK; - } -} \ No newline at end of file diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_i3c_edma.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_i3c_edma.h deleted file mode 100644 index 8396e350d35..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_i3c_edma.h +++ /dev/null @@ -1,279 +0,0 @@ -/* - * Copyright 2022-2023 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_I3C_EDMA_H_ -#define FSL_I3C_EDMA_H_ - -#include "fsl_i3c.h" -#include "fsl_edma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief I3C EDMA driver version. */ -#define FSL_I3C_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 2, 9)) -/*! @} */ - -/*! - * @addtogroup i3c_master_edma_driver - * @{ - */ - -/* Forward declaration of the transfer descriptor and handle typedefs. */ -typedef struct _i3c_master_edma_handle i3c_master_edma_handle_t; - -/*! @brief i3c master callback functions. */ -typedef struct _i3c_master_edma_callback -{ - void (*slave2Master)(I3C_Type *base, void *userData); /*!< Transfer complete callback */ - void (*ibiCallback)(I3C_Type *base, - i3c_master_edma_handle_t *handle, - i3c_ibi_type_t ibiType, - i3c_ibi_state_t ibiState); /*!< IBI event callback */ - void (*transferComplete)(I3C_Type *base, - i3c_master_edma_handle_t *handle, - status_t status, - void *userData); /*!< Transfer complete callback */ -} i3c_master_edma_callback_t; -/*! - * @brief Driver handle for master EDMA APIs. - * @note The contents of this structure are private and subject to change. - */ -struct _i3c_master_edma_handle -{ - I3C_Type *base; /*!< I3C base pointer. */ - uint8_t state; /*!< Transfer state machine current state. */ - uint32_t transferCount; /*!< Indicates progress of the transfer */ - uint8_t subaddressBuffer[4]; /*!< Saving subaddress command. */ - uint8_t subaddressCount; /*!< Saving command count. */ - i3c_master_transfer_t transfer; /*!< Copy of the current transfer info. */ - i3c_master_edma_callback_t callback; /*!< Callback function pointer. */ - void *userData; /*!< Application data passed to callback. */ - edma_handle_t *rxDmaHandle; /*!< Handle for receive DMA channel. */ - edma_handle_t *txDmaHandle; /*!< Handle for transmit DMA channel. */ - uint8_t ibiAddress; /*!< Slave address which request IBI. */ - uint8_t *ibiBuff; /*!< Pointer to IBI buffer to keep ibi bytes. */ - size_t ibiPayloadSize; /*!< IBI payload size. */ - i3c_ibi_type_t ibiType; /*!< IBI type. */ -}; - -/*! @} */ - -/*! - * @addtogroup i3c_slave_edma_driver - * @{ - */ -/* Forward declaration of the transfer descriptor and handle typedefs. */ -typedef struct _i3c_slave_edma_handle i3c_slave_edma_handle_t; - -/*! @brief I3C slave transfer structure */ -typedef struct _i3c_slave_edma_transfer -{ - uint32_t event; /*!< Reason the callback is being invoked. */ - uint8_t *txData; /*!< Transfer buffer */ - size_t txDataSize; /*!< Transfer size */ - uint8_t *rxData; /*!< Transfer buffer */ - size_t rxDataSize; /*!< Transfer size */ - status_t completionStatus; /*!< Success or error code describing how the transfer completed. Only applies for - #kI3C_SlaveCompletionEvent. */ -} i3c_slave_edma_transfer_t; - -/*! - * @brief Slave event callback function pointer type. - * - * This callback is used only for the slave DMA transfer API. - * - * @param base Base address for the I3C instance on which the event occurred. - * @param handle Pointer to slave DMA transfer handle. - * @param transfer Pointer to transfer descriptor containing values passed to and/or from the callback. - * @param userData Arbitrary pointer-sized value passed from the application. - */ -typedef void (*i3c_slave_edma_callback_t)(I3C_Type *base, i3c_slave_edma_transfer_t *transfer, void *userData); -/*! - * @brief I3C slave edma handle structure. - * @note The contents of this structure are private and subject to change. - */ -struct _i3c_slave_edma_handle -{ - I3C_Type *base; /*!< I3C base pointer. */ - i3c_slave_edma_transfer_t transfer; /*!< I3C slave transfer copy. */ - bool isBusy; /*!< Whether transfer is busy. */ - bool wasTransmit; /*!< Whether the last transfer was a transmit. */ - uint32_t eventMask; /*!< Mask of enabled events. */ - i3c_slave_edma_callback_t callback; /*!< Callback function called at transfer event. */ - edma_handle_t *rxDmaHandle; /*!< Handle for receive DMA channel. */ - edma_handle_t *txDmaHandle; /*!< Handle for transmit DMA channel. */ - void *userData; /*!< Callback parameter passed to callback. */ -}; -/*! @} */ -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @addtogroup i3c_master_edma_driver - * @{ - */ - -/*! @name Master DMA */ -/*! @{ */ - -/*! - * @brief Create a new handle for the I3C master DMA APIs. - * - * The creation of a handle is for use with the DMA APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the I3C_MasterTransferAbortDMA() API shall be called. - * - * For devices where the I3C send and receive DMA requests are OR'd together, the @a txDmaHandle - * parameter is ignored and may be set to NULL. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C master driver handle. - * @param callback User provided pointer to the asynchronous callback function. - * @param userData User provided pointer to the application callback data. - * @param rxDmaHandle Handle for the DMA receive channel. Created by the user prior to calling this function. - * @param txDmaHandle Handle for the DMA transmit channel. Created by the user prior to calling this function. - */ -void I3C_MasterTransferCreateHandleEDMA(I3C_Type *base, - i3c_master_edma_handle_t *handle, - const i3c_master_edma_callback_t *callback, - void *userData, - edma_handle_t *rxDmaHandle, - edma_handle_t *txDmaHandle); - -/*! - * @brief Performs a non-blocking DMA-based transaction on the I3C bus. - * - * The callback specified when the @a handle was created is invoked when the transaction has - * completed. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C master driver handle. - * @param transfer The pointer to the transfer descriptor. - * @retval kStatus_Success The transaction was started successfully. - * @retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or another DMA - * transaction is already in progress. - */ -status_t I3C_MasterTransferEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle, i3c_master_transfer_t *transfer); - -/*! - * @brief Returns number of bytes transferred so far. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C master driver handle. - * @param[out] count Number of bytes transferred so far by the non-blocking transaction. - * @retval kStatus_Success - * @retval kStatus_NoTransferInProgress There is not a DMA transaction currently in progress. - */ -status_t I3C_MasterTransferGetCountEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle, size_t *count); - -/*! - * @brief Terminates a non-blocking I3C master transmission early. - * - * @note It is not safe to call this function from an IRQ handler that has a higher priority than the - * DMA peripheral's IRQ priority. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C master driver handle. - */ -void I3C_MasterTransferAbortEDMA(I3C_Type *base, i3c_master_edma_handle_t *handle); - -/*! - * @brief Reusable routine to handle master interrupts. - * @note This function does not need to be called unless you are reimplementing the - * nonblocking API's interrupt handler routines to add special functionality. - * @param base The I3C peripheral base address. - * @param i3cHandle Pointer to the I3C master DMA driver handle. - */ -void I3C_MasterTransferEDMAHandleIRQ(I3C_Type *base, void *i3cHandle); -/*! @} */ - -/*! @} */ - -/*! - * @addtogroup i3c_slave_edma_driver - * @{ - */ - -/*! @name Slave DMA */ -/*! @{ */ -/*! - * @brief Create a new handle for the I3C slave DMA APIs. - * - * The creation of a handle is for use with the DMA APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the I3C_SlaveTransferAbortDMA() API shall be called. - * - * For devices where the I3C send and receive DMA requests are OR'd together, the @a txDmaHandle - * parameter is ignored and may be set to NULL. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C slave driver handle. - * @param callback User provided pointer to the asynchronous callback function. - * @param userData User provided pointer to the application callback data. - * @param rxDmaHandle Handle for the DMA receive channel. Created by the user prior to calling this function. - * @param txDmaHandle Handle for the DMA transmit channel. Created by the user prior to calling this function. - */ -void I3C_SlaveTransferCreateHandleEDMA(I3C_Type *base, - i3c_slave_edma_handle_t *handle, - i3c_slave_edma_callback_t callback, - void *userData, - edma_handle_t *rxDmaHandle, - edma_handle_t *txDmaHandle); - -/*! - * @brief Prepares for a non-blocking DMA-based transaction on the I3C bus. - * - * The API will do DMA configuration according to the input transfer descriptor, and the data will be transferred when - * there's bus master requesting transfer from/to this slave. So the timing of call to this API need be aligned - * with master application to ensure the transfer is executed as expected. - * Callback specified when the @a handle was created is invoked when the transaction has completed. - * - * @param base The I3C peripheral base address. - * @param handle Pointer to the I3C slave driver handle. - * @param transfer The pointer to the transfer descriptor. - * @param eventMask Bit mask formed by OR'ing together #i3c_slave_transfer_event_t enumerators to specify - * which events to send to the callback. The transmit and receive events is not allowed to be enabled. - * @retval kStatus_Success The transaction was started successfully. - * @retval #kStatus_I3C_Busy Either another master is currently utilizing the bus, or another DMA - * transaction is already in progress. - * @retval #kStatus_Fail The transaction can't be set. - */ -status_t I3C_SlaveTransferEDMA(I3C_Type *base, - i3c_slave_edma_handle_t *handle, - i3c_slave_edma_transfer_t *transfer, - uint32_t eventMask); -/*! - * @brief Abort a slave edma non-blocking transfer in a early time - * - * @param base I3C peripheral base address - * @param handle pointer to i3c_slave_edma_handle_t structure - */ -void I3C_SlaveTransferAbortEDMA(I3C_Type *base, i3c_slave_edma_handle_t *handle); - -/*! - * @brief Reusable routine to handle slave interrupts. - * @note This function does not need to be called unless you are reimplementing the - * nonblocking API's interrupt handler routines to add special functionality. - * @param base The I3C peripheral base address. - * @param i3cHandle Pointer to the I3C slave DMA driver handle. - */ -void I3C_SlaveTransferEDMAHandleIRQ(I3C_Type *base, void *i3cHandle); -/*! @} */ - -/*! @} */ -#if defined(__cplusplus) -} -#endif - -#endif /* FSL_I3C_EDMA_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_inputmux.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_inputmux.c deleted file mode 100644 index 1f2ce0bcd26..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_inputmux.c +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_inputmux.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.inputmux" -#endif - -#if defined(INPUTMUX_RSTS) -#define INPUTMUX_RESETS_ARRAY INPUTMUX_RSTS -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#if defined(INPUTMUX_RESETS_ARRAY) -/*! - * @brief Get instance number for INPUTMUX module. - * - * @param base INPUTMUX peripheral base address - */ -static uint32_t INPUTMUX_GetInstance(INPUTMUX_Type *base); -#endif -/******************************************************************************* - * Variables - ******************************************************************************/ -#if defined(INPUTMUX_RESETS_ARRAY) -/*! @brief Pointers to INPUTMUX bases for each instance. */ -static INPUTMUX_Type *const s_inputmuxBases[] = INPUTMUX_BASE_PTRS; - -/* Reset array */ -static const reset_ip_name_t s_inputmuxResets[] = INPUTMUX_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -#if defined(INPUTMUX_RESETS_ARRAY) -static uint32_t INPUTMUX_GetInstance(INPUTMUX_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_inputmuxBases); instance++) - { - if (s_inputmuxBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_inputmuxBases)); - - return instance; -} -#endif - -/*! - * brief Initialize INPUTMUX peripheral. - - * This function enables the INPUTMUX clock. - * - * param base Base address of the INPUTMUX peripheral. - * - * retval None. - */ -void INPUTMUX_Init(INPUTMUX_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#if defined(FSL_FEATURE_INPUTMUX_HAS_NO_INPUTMUX_CLOCK_SOURCE) && FSL_FEATURE_INPUTMUX_HAS_NO_INPUTMUX_CLOCK_SOURCE -#if (defined(FSL_FEATURE_SOC_SCT_COUNT) && (FSL_FEATURE_SOC_SCT_COUNT > 0)) - CLOCK_EnableClock(kCLOCK_Sct); -#endif /* FSL_FEATURE_SOC_SCT_COUNT */ - CLOCK_EnableClock(kCLOCK_Dma); -#else - CLOCK_EnableClock(kCLOCK_InputMux); -#endif /* FSL_FEATURE_INPUTMUX_HAS_NO_INPUTMUX_CLOCK_SOURCE */ -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(INPUTMUX_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_inputmuxResets[INPUTMUX_GetInstance(base)]); -#endif -} - -/*! - * brief Attaches a signal - * - * This function attaches multiplexed signals from INPUTMUX to target signals. - * For example, to attach GPIO PORT0 Pin 5 to PINT peripheral, do the following: - * code - * INPUTMUX_AttachSignal(INPUTMUX, 2, kINPUTMUX_GpioPort0Pin5ToPintsel); - * endcode - * In this example, INTMUX has 8 registers for PINT, PINT_SEL0~PINT_SEL7. - * With parameter p index specified as 2, this function configures register PINT_SEL2. - * - * param base Base address of the INPUTMUX peripheral. - * param index The serial number of destination register in the group of INPUTMUX registers with same name. - * param connection Applies signal from source signals collection to target signal. - * - * retval None. - */ -void INPUTMUX_AttachSignal(INPUTMUX_Type *base, uint32_t index, inputmux_connection_t connection) -{ - uint32_t pmux_id; - uint32_t output_id; - - /* extract pmux to be used */ - pmux_id = ((uint32_t)(connection)) >> PMUX_SHIFT; - /* extract function number */ - output_id = ((uint32_t)(connection)) & ((1UL << PMUX_SHIFT) - 1U); - /* programm signal */ - *(volatile uint32_t *)(((uint32_t)base) + pmux_id + (index * 4U)) = output_id; -} - -#if defined(FSL_FEATURE_INPUTMUX_HAS_SIGNAL_ENA) -/*! - * brief Enable/disable a signal - * - * This function gates the INPUTPMUX clock. - * - * param base Base address of the INPUTMUX peripheral. - * param signal Enable signal register id and bit offset. - * param enable Selects enable or disable. - * - * retval None. - */ -void INPUTMUX_EnableSignal(INPUTMUX_Type *base, inputmux_signal_t signal, bool enable) -{ - uint32_t ena_id; - uint32_t ena_id_mask = (1UL << (32U - ENA_SHIFT)) - 1U; - uint32_t bit_offset; - -#if defined(FSL_FEATURE_INPUTMUX_HAS_CHANNEL_MUX) && FSL_FEATURE_INPUTMUX_HAS_CHANNEL_MUX - uint32_t chmux_offset; - uint32_t chmux_value; - - /* Only enable need to update channel mux */ - if (enable && ((((uint32_t)signal) & (1UL << CHMUX_AVL_SHIFT)) != 0U)) - { - chmux_offset = (((uint32_t)signal) >> CHMUX_OFF_SHIFT) & ((1UL << (CHMUX_AVL_SHIFT - CHMUX_OFF_SHIFT)) - 1UL); - chmux_value = (((uint32_t)signal) >> CHMUX_VAL_SHIFT) & ((1UL << (CHMUX_OFF_SHIFT - CHMUX_VAL_SHIFT)) - 1UL); - *(volatile uint32_t *)(((uint32_t)base) + chmux_offset) = chmux_value; - } - ena_id_mask = (1UL << (CHMUX_VAL_SHIFT - ENA_SHIFT)) - 1U; -#endif - /* extract enable register to be used */ - ena_id = (((uint32_t)signal) >> ENA_SHIFT) & ena_id_mask; - /* extract enable bit offset */ - bit_offset = ((uint32_t)signal) & ((1UL << ENA_SHIFT) - 1U); - /* set signal */ - if (enable) - { - *(volatile uint32_t *)(((uint32_t)base) + ena_id) |= (1UL << bit_offset); - } - else - { - *(volatile uint32_t *)(((uint32_t)base) + ena_id) &= ~(1UL << bit_offset); - } -} -#endif - -/*! - * brief Deinitialize INPUTMUX peripheral. - - * This function disables the INPUTMUX clock. - * - * param base Base address of the INPUTMUX peripheral. - * - * retval None. - */ -void INPUTMUX_Deinit(INPUTMUX_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#if defined(FSL_FEATURE_INPUTMUX_HAS_NO_INPUTMUX_CLOCK_SOURCE) && FSL_FEATURE_INPUTMUX_HAS_NO_INPUTMUX_CLOCK_SOURCE -#if (defined(FSL_FEATURE_SOC_SCT_COUNT) && (FSL_FEATURE_SOC_SCT_COUNT > 0)) - CLOCK_DisableClock(kCLOCK_Sct); -#endif /* FSL_FEATURE_SOC_SCT_COUNT */ - CLOCK_DisableClock(kCLOCK_Dma); -#else - CLOCK_DisableClock(kCLOCK_InputMux); -#endif /* FSL_FEATURE_INPUTMUX_HAS_NO_INPUTMUX_CLOCK_SOURCE */ -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_inputmux.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_inputmux.h deleted file mode 100644 index a8d5db82ec7..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_inputmux.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_INPUTMUX_H_ -#define FSL_INPUTMUX_H_ - -#include "fsl_inputmux_connections.h" -#include "fsl_common.h" - -/*! - * @addtogroup inputmux_driver - * @{ - */ - -/*! @file */ -/*! @file fsl_inputmux_connections.h */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief Group interrupt driver version for SDK */ -#define FSL_INPUTMUX_DRIVER_VERSION (MAKE_VERSION(2, 0, 7)) -/*! @} */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#ifdef __cplusplus -extern "C" { -#endif - -/*! - * @brief Initialize INPUTMUX peripheral. - - * This function enables the INPUTMUX clock. - * - * @param base Base address of the INPUTMUX peripheral. - * - * @retval None. - */ -void INPUTMUX_Init(INPUTMUX_Type *base); - -/*! - * @brief Attaches a signal - * - * This function attaches multiplexed signals from INPUTMUX to target signals. - * For example, to attach GPIO PORT0 Pin 5 to PINT peripheral, do the following: - * @code - * INPUTMUX_AttachSignal(INPUTMUX, 2, kINPUTMUX_GpioPort0Pin5ToPintsel); - * @endcode - * In this example, INTMUX has 8 registers for PINT, PINT_SEL0~PINT_SEL7. - * With parameter @p index specified as 2, this function configures register PINT_SEL2. - * - * @param base Base address of the INPUTMUX peripheral. - * @param index The serial number of destination register in the group of INPUTMUX registers with same name. - * @param connection Applies signal from source signals collection to target signal. - * - * @retval None. - */ -void INPUTMUX_AttachSignal(INPUTMUX_Type *base, uint32_t index, inputmux_connection_t connection); - -#if defined(FSL_FEATURE_INPUTMUX_HAS_SIGNAL_ENA) -/*! - * @brief Enable/disable a signal - * - * This function gates the INPUTPMUX clock. - * - * @param base Base address of the INPUTMUX peripheral. - * @param signal Enable signal register id and bit offset. - * @param enable Selects enable or disable. - * - * @retval None. - */ -void INPUTMUX_EnableSignal(INPUTMUX_Type *base, inputmux_signal_t signal, bool enable); -#endif - -/*! - * @brief Deinitialize INPUTMUX peripheral. - - * This function disables the INPUTMUX clock. - * - * @param base Base address of the INPUTMUX peripheral. - * - * @retval None. - */ -void INPUTMUX_Deinit(INPUTMUX_Type *base); - -#ifdef __cplusplus -} -#endif - -/*! @} */ - -#endif /* FSL_INPUTMUX_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_inputmux_connections.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_inputmux_connections.h deleted file mode 100644 index 5ee2d9b2751..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_inputmux_connections.h +++ /dev/null @@ -1,4661 +0,0 @@ -/* - * Copyright 2022 , NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _FSL_INPUTMUX_CONNECTIONS_ -#define _FSL_INPUTMUX_CONNECTIONS_ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.inputmux_connections" -#endif - -/*! - * @addtogroup inputmux_driver - * @{ - */ - -/*! - * @name Input multiplexing connections - * @{ - */ - -/*! @brief Periphinmux IDs */ -#define SCT0_INMUX0 0x00U -#define TIMER0CAPTSEL0 0x20U -#define TIMER0TRIGIN 0x30U -#define TIMER1CAPTSEL0 0x40U -#define TIMER1TRIGIN 0x50U -#define TIMER2CAPTSEL0 0x60U -#define TIMER2TRIGIN 0x70U -#define SMARTDMAARCHB_INMUX0 0xA0U -#define PINTSEL0 0xC0U -#define FREQMEAS_REF_REG 0x180U -#define FREQMEAS_TAR_REG 0x184U -#define TIMER3CAPTSEL0 0x1A0U -#define TIMER3TRIGIN 0x1B0U -#define TIMER4CAPTSEL0 0x1C0U -#define TIMER4TRIGIN 0x1D0U -#define CMP0_TRIG_REG 0x260U -#define ADC0_TRIG0 0x280U -#define ADC1_TRIG0 0x2C0U -#define DAC0_TRIG_REG 0x300U -#define DAC1_TRIG_REG 0x320U -#define DAC2_TRIG_REG 0x340U -#define QDC0_TRIG_REG 0x360U -#define QDC0_HOME_REG 0x364U -#define QDC0_INDEX_REG 0x368U -#define QDC0_PHASEB_REG 0x36CU -#define QDC0_PHASEA_REG 0x370U -#define QDC1_TRIG_REG 0x380U -#define QDC1_HOME_REG 0x384U -#define QDC1_INDEX_REG 0x388U -#define QDC1_PHASEB_REG 0x38CU -#define QDC1_PHASEA_REG 0x390U -#define FlexPWM0_SM0_EXTSYNC_REG 0x3A0U -#define FlexPWM0_SM1_EXTSYNC_REG 0x3A4U -#define FlexPWM0_SM2_EXTSYNC_REG 0x3A8U -#define FlexPWM0_SM3_EXTSYNC_REG 0x3ACU -#define FlexPWM0_SM0_EXTA_REG 0x3B0U -#define FlexPWM0_SM1_EXTA_REG 0x3B4U -#define FlexPWM0_SM2_EXTA_REG 0x3B8U -#define FlexPWM0_SM3_EXTA_REG 0x3BCU -#define FlexPWM0_EXTFORCE_REG 0x3C0U -#define FlexPWM0_FAULT0_REG 0x3C4U -#define FlexPWM0_FAULT1_REG 0x3C8U -#define FlexPWM0_FAULT2_REG 0x3CCU -#define FlexPWM0_FAULT3_REG 0x3D0U -#define FlexPWM1_SM0_EXTSYNC_REG 0x3E0U -#define FlexPWM1_SM1_EXTSYNC_REG 0x3E4U -#define FlexPWM1_SM2_EXTSYNC_REG 0x3E8U -#define FlexPWM1_SM3_EXTSYNC_REG 0x3ECU -#define FlexPWM1_SM0_EXTA_REG 0x3F0U -#define FlexPWM1_SM1_EXTA_REG 0x3F4U -#define FlexPWM1_SM2_EXTA_REG 0x3F8U -#define FlexPWM1_SM3_EXTA_REG 0x3FCU -#define FlexPWM1_EXTFORCE_REG 0x400U -#define FlexPWM1_FAULT0_REG 0x404U -#define FlexPWM1_FAULT1_REG 0x408U -#define FlexPWM1_FAULT2_REG 0x40CU -#define FlexPWM1_FAULT3_REG 0x410U -#define PWM0_EXT_CLK_REG 0x420U -#define PWM1_EXT_CLK_REG 0x424U -#define EVTG_TRIG0_REG 0x440U -#define USBFS_TRIG_REG 0x480U -#define TSI_TRIG_REG 0x4A0U -#define EXT_TRIG0_REG 0x4C0U -#define CMP1_TRIG_REG 0x4E0U -#define CMP2_TRIG_REG 0x500U -#define SINC_FILTER_CH0_REG 0x520U -#define OPAMP0_TRIG_REG 0x580U -#define OPAMP1_TRIG_REG 0x584U -#define OPAMP2_TRIG_REG 0x588U -#define FLEXCOMM0_TRIG_REG 0x5A0U -#define FLEXCOMM1_TRIG_REG 0x5C0U -#define FLEXCOMM2_TRIG_REG 0x5E0U -#define FLEXCOMM3_TRIG_REG 0x600U -#define FLEXCOMM4_TRIG_REG 0x620U -#define FLEXCOMM5_TRIG_REG 0x640U -#define FLEXCOMM6_TRIG_REG 0x660U -#define FLEXCOMM7_TRIG_REG 0x680U -#define FLEXCOMM8_TRIG_REG 0x6A0U -#define FLEXCOMM9_TRIG_REG 0x6C0U -#define FLEXIO_TRIG0_REG 0x6E0U - -#define DMA0_REQ_ENABLE0_REG 0x700U -#define DMA0_REQ_ENABLE1_REG 0x710U -#define DMA0_REQ_ENABLE2_REG 0x720U -#define DMA0_REQ_ENABLE3_REG 0x730U -#define DMA1_REQ_ENABLE0_REG 0x780U -#define DMA1_REQ_ENABLE1_REG 0x790U -#define DMA1_REQ_ENABLE2_REG 0x7A0U -#define DMA1_REQ_ENABLE3_REG 0x7B0U - -#define ENA_SHIFT 8U -#define PMUX_SHIFT 20U - -/*! @brief INPUTMUX connections type */ -typedef enum _inputmux_connection_t -{ - /*!< SCT0 INMUX. */ - kINPUTMUX_Sct0In0ToSct0 = 0U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Sct0In1ToSct0 = 1U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Sct0In2ToSct0 = 2U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Sct0In3ToSct0 = 3U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Sct0In4ToSct0 = 4U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Sct0In5ToSct0 = 5U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Sct0In6ToSct0 = 6U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Sct0In7ToSct0 = 7U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Ctimer0M0ToSct0 = 8U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToSct0 = 9U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToSct0 = 10U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToSct0 = 11U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToSct0 = 12U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Adc0IrqToSct0 = 13U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatToSct0 = 14U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToggleToSct0 = 15U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Usb1StartOfFrameToggleToSct0 = 16U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToSct0 = 17U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToSct0 = 18U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToSct0 = 19U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToSct0 = 20U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToSct0 = 21U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_ArmTxevToSct0 = 22U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_DebugHaltedToSct0 = 23U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Adc1IrqToSct0 = 24U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Adc0tcomp0ToSct0 = 25U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Adc0tcomp1ToSct0 = 26U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Adc0tcomp2ToSct0 = 27U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Adc0tcomp3ToSct0 = 28U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Adc1tcomp0ToSct0 = 29U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Adc1tcomp1ToSct0 = 30U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Adc1tcomp2ToSct0 = 31U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Adc1tcomp3ToSct0 = 32U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToSct0 = 33U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToSct0 = 34U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToSct0 = 35U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig01ToSct0 = 36U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig01ToSct0 = 37U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig01ToSct0 = 38U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig01ToSct0 = 39U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig01ToSct0 = 40U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig01ToSct0 = 41U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig01ToSct0 = 42U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig01ToSct0 = 43U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToSct0 = 44U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToSct0 = 45U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToSct0 = 46U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToSct0 = 47U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToSct0 = 48U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToSct0 = 49U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToSct0 = 50U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToSct0 = 51U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToSct0 = 52U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToSct0 = 53U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Fc3P0ToSct0 = 54U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Fc3P1ToSct0 = 55U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Fc3P2ToSct0 = 56U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Fc3P3ToSct0 = 57U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm0Trig0ToSct0 = 60U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm0Trig1ToSct0 = 61U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm0Trig2ToSct0 = 62U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm1Trig0ToSct0 = 63U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm1Trig1ToSct0 = 64U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm1Trig2ToSct0 = 65U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm2Trig0ToSct0 = 66U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm2Trig1ToSct0 = 67U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm2Trig2ToSct0 = 68U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm3Trig0ToSct0 = 69U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm3Trig1ToSct0 = 70U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm3Trig2ToSct0 = 71U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm3Trig3ToSct0 = 72U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Sai0TxBclkToSct0 = 73U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Sai0RxBclkToSct0 = 74U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Sai1TxBclkToSct0 = 75U + (SCT0_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Sai1RxBclkToSct0 = 76U + (SCT0_INMUX0 << PMUX_SHIFT), - - /*!< TIMER0 CAPTSEL. */ - kINPUTMUX_CtimerInp0ToTimer0Captsel = 0U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer0Captsel = 1U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer0Captsel = 2U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer0Captsel = 3U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer0Captsel = 4U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer0Captsel = 5U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer0Captsel = 6U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer0Captsel = 7U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer0Captsel = 8U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer0Captsel = 9U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp10ToTimer0Captsel = 10U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp11ToTimer0Captsel = 11U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer0Captsel = 12U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer0Captsel = 13U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer0Captsel = 14U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer0Captsel = 15U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer0Captsel = 16U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer0Captsel = 17U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer0Captsel = 18U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer0Captsel = 19U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer0Captsel = 20U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Usb1StartOfFrameToTimer0Captsel = 21U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_DcdcBurstActiveToTimer0Captsel = 22U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai0TxSyncOutToTimer0Captsel = 23U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai0RxSyncOutToTimer0Captsel = 24U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0IrqToTimer0Captsel = 25U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc1IrqToTimer0Captsel = 26U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer0Captsel = 27U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer0Captsel = 28U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToTimer0Captsel = 29U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig01ToTimer0Captsel = 30U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig01ToTimer0Captsel = 31U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig01ToTimer0Captsel = 32U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig01ToTimer0Captsel = 33U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig01ToTimer0Captsel = 34U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig01ToTimer0Captsel = 35U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig01ToTimer0Captsel = 36U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig01ToTimer0Captsel = 37U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToTimer0Captsel = 38U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToTimer0Captsel = 39U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToTimer0Captsel = 40U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToTimer0Captsel = 41U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToTimer0Captsel = 42U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToTimer0Captsel = 43U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToTimer0Captsel = 44U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToTimer0Captsel = 45U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToTimer0Captsel = 46U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToTimer0Captsel = 47U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig0ToTimer0Captsel = 50U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig1ToTimer0Captsel = 51U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig2ToTimer0Captsel = 52U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig0ToTimer0Captsel = 53U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig1ToTimer0Captsel = 54U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig2ToTimer0Captsel = 55U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig0ToTimer0Captsel = 56U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig1ToTimer0Captsel = 57U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig2ToTimer0Captsel = 58U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig0ToTimer0Captsel = 59U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig1ToTimer0Captsel = 60U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig2ToTimer0Captsel = 61U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig3ToTimer0Captsel = 62U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai1TxSyncOutToTimer0Captsel = 63U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai1RxSyncOutToTimer0Captsel = 64U + (TIMER0CAPTSEL0 << PMUX_SHIFT), - - /*!< TIMER1 CAPTSEL. */ - kINPUTMUX_CtimerInp0ToTimer1Captsel = 0U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer1Captsel = 1U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer1Captsel = 2U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer1Captsel = 3U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer1Captsel = 4U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer1Captsel = 5U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer1Captsel = 6U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer1Captsel = 7U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer1Captsel = 8U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer1Captsel = 9U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp10ToTimer1Captsel = 10U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp11ToTimer1Captsel = 11U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer1Captsel = 12U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer1Captsel = 13U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer1Captsel = 14U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer1Captsel = 15U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer1Captsel = 16U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer1Captsel = 17U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer1Captsel = 18U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer1Captsel = 19U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer1Captsel = 20U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Usb1StartOfFrameToTimer1Captsel = 21U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_DcdcBurstActiveToTimer1Captsel = 22U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai0TxSyncOutToTimer1Captsel = 23U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai0RxSyncOutToTimer1Captsel = 24U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0IrqToTimer1Captsel = 25U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc1IrqToTimer1Captsel = 26U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer1Captsel = 27U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer1Captsel = 28U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToTimer1Captsel = 29U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig01ToTimer1Captsel = 30U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig01ToTimer1Captsel = 31U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig01ToTimer1Captsel = 32U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig01ToTimer1Captsel = 33U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig01ToTimer1Captsel = 34U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig01ToTimer1Captsel = 35U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig01ToTimer1Captsel = 36U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig01ToTimer1Captsel = 37U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToTimer1Captsel = 38U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToTimer1Captsel = 39U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToTimer1Captsel = 40U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToTimer1Captsel = 41U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToTimer1Captsel = 42U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToTimer1Captsel = 43U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToTimer1Captsel = 44U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToTimer1Captsel = 45U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToTimer1Captsel = 46U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToTimer1Captsel = 47U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig0ToTimer1Captsel = 50U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig1ToTimer1Captsel = 51U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig2ToTimer1Captsel = 52U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig0ToTimer1Captsel = 53U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig1ToTimer1Captsel = 54U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig2ToTimer1Captsel = 55U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig0ToTimer1Captsel = 56U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig1ToTimer1Captsel = 57U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig2ToTimer1Captsel = 58U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig0ToTimer1Captsel = 59U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig1ToTimer1Captsel = 60U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig2ToTimer1Captsel = 61U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig3ToTimer1Captsel = 62U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai1TxSyncOutToTimer1Captsel = 63U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai1RxSyncOutToTimer1Captsel = 64U + (TIMER1CAPTSEL0 << PMUX_SHIFT), - - /*!< TIMER2 CAPTSEL. */ - kINPUTMUX_CtimerInp0ToTimer2Captsel = 0U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer2Captsel = 1U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer2Captsel = 2U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer2Captsel = 3U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer2Captsel = 4U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer2Captsel = 5U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer2Captsel = 6U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer2Captsel = 7U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer2Captsel = 8U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer2Captsel = 9U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp10ToTimer2Captsel = 10U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp11ToTimer2Captsel = 11U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer2Captsel = 12U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer2Captsel = 13U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer2Captsel = 14U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer2Captsel = 15U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer2Captsel = 16U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer2Captsel = 17U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer2Captsel = 18U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer2Captsel = 19U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer2Captsel = 20U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Usb1StartOfFrameToTimer2Captsel = 21U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_DcdcBurstActiveToTimer2Captsel = 22U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai0TxSyncOutToTimer2Captsel = 23U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai0RxSyncOutToTimer2Captsel = 24U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0IrqToTimer2Captsel = 25U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc1IrqToTimer2Captsel = 26U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer2Captsel = 27U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer2Captsel = 28U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToTimer2Captsel = 29U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig01ToTimer2Captsel = 30U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig01ToTimer2Captsel = 31U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig01ToTimer2Captsel = 32U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig01ToTimer2Captsel = 33U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig01ToTimer2Captsel = 34U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig01ToTimer2Captsel = 35U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig01ToTimer2Captsel = 36U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig01ToTimer2Captsel = 37U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToTimer2Captsel = 38U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToTimer2Captsel = 39U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToTimer2Captsel = 40U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToTimer2Captsel = 41U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToTimer2Captsel = 42U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToTimer2Captsel = 43U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToTimer2Captsel = 44U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToTimer2Captsel = 45U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToTimer2Captsel = 46U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToTimer2Captsel = 47U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig0ToTimer2Captsel = 50U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig1ToTimer2Captsel = 51U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig2ToTimer2Captsel = 52U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig0ToTimer2Captsel = 53U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig1ToTimer2Captsel = 54U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig2ToTimer2Captsel = 55U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig0ToTimer2Captsel = 56U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig1ToTimer2Captsel = 57U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig2ToTimer2Captsel = 58U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig0ToTimer2Captsel = 59U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig1ToTimer2Captsel = 60U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig2ToTimer2Captsel = 61U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig3ToTimer2Captsel = 62U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai1TxSyncOutToTimer2Captsel = 63U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai1RxSyncOutToTimer2Captsel = 64U + (TIMER2CAPTSEL0 << PMUX_SHIFT), - - /*!< TIMER3 CAPTSEL. */ - kINPUTMUX_CtimerInp0ToTimer3Captsel = 0U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer3Captsel = 1U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer3Captsel = 2U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer3Captsel = 3U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer3Captsel = 4U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer3Captsel = 5U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer3Captsel = 6U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer3Captsel = 7U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer3Captsel = 8U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer3Captsel = 9U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp10ToTimer3Captsel = 10U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp11ToTimer3Captsel = 11U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer3Captsel = 12U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer3Captsel = 13U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer3Captsel = 14U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer3Captsel = 15U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer3Captsel = 16U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer3Captsel = 17U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer3Captsel = 18U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer3Captsel = 19U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer3Captsel = 20U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Usb1StartOfFrameToTimer3Captsel = 21U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_DcdcBurstActiveToTimer3Captsel = 22U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai0TxSyncOutToTimer3Captsel = 23U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai0RxSyncOutToTimer3Captsel = 24U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0IrqToTimer3Captsel = 25U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc1IrqToTimer3Captsel = 26U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer3Captsel = 27U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer3Captsel = 28U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToTimer3Captsel = 29U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig01ToTimer3Captsel = 30U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig01ToTimer3Captsel = 31U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig01ToTimer3Captsel = 32U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig01ToTimer3Captsel = 33U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig01ToTimer3Captsel = 34U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig01ToTimer3Captsel = 35U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig01ToTimer3Captsel = 36U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig01ToTimer3Captsel = 37U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToTimer3Captsel = 38U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToTimer3Captsel = 39U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToTimer3Captsel = 40U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToTimer3Captsel = 41U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToTimer3Captsel = 42U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToTimer3Captsel = 43U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToTimer3Captsel = 44U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToTimer3Captsel = 45U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToTimer3Captsel = 46U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToTimer3Captsel = 47U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig0ToTimer3Captsel = 50U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig1ToTimer3Captsel = 51U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig2ToTimer3Captsel = 52U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig0ToTimer3Captsel = 53U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig1ToTimer3Captsel = 54U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig2ToTimer3Captsel = 55U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig0ToTimer3Captsel = 56U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig1ToTimer3Captsel = 57U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig2ToTimer3Captsel = 58U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig0ToTimer3Captsel = 59U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig1ToTimer3Captsel = 60U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig2ToTimer3Captsel = 61U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig3ToTimer3Captsel = 62U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai1TxSyncOutToTimer3Captsel = 63U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai1RxSyncOutToTimer3Captsel = 64U + (TIMER3CAPTSEL0 << PMUX_SHIFT), - - /*!< Timer4 CAPTSEL. */ - kINPUTMUX_CtimerInp0ToTimer4Captsel = 0U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer4Captsel = 1U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer4Captsel = 2U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer4Captsel = 3U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer4Captsel = 4U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer4Captsel = 5U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer4Captsel = 6U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer4Captsel = 7U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer4Captsel = 8U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer4Captsel = 9U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp10ToTimer4Captsel = 10U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp11ToTimer4Captsel = 11U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer4Captsel = 12U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer4Captsel = 13U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer4Captsel = 14U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer4Captsel = 15U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer4Captsel = 16U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer4Captsel = 17U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer4Captsel = 18U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer4Captsel = 19U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer4Captsel = 20U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Usb1StartOfFrameToTimer4Captsel = 21U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_DcdcBurstActiveToTimer4Captsel = 22U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai0TxSyncOutToTimer4Captsel = 23U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai0RxSyncOutToTimer4Captsel = 24U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc0IrqToTimer4Captsel = 25U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Adc1IrqToTimer4Captsel = 26U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer4Captsel = 27U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer4Captsel = 28U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToTimer4Captsel = 29U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig01ToTimer4Captsel = 30U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig01ToTimer4Captsel = 31U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig01ToTimer4Captsel = 32U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig01ToTimer4Captsel = 33U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig01ToTimer4Captsel = 34U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig01ToTimer4Captsel = 35U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig01ToTimer4Captsel = 36U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig01ToTimer4Captsel = 37U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToTimer4Captsel = 38U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToTimer4Captsel = 39U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToTimer4Captsel = 40U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToTimer4Captsel = 41U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToTimer4Captsel = 42U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToTimer4Captsel = 43U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToTimer4Captsel = 44U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToTimer4Captsel = 45U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToTimer4Captsel = 46U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToTimer4Captsel = 47U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig0ToTimer4Captsel = 50U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig1ToTimer4Captsel = 51U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig2ToTimer4Captsel = 52U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig0ToTimer4Captsel = 53U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig1ToTimer4Captsel = 54U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig2ToTimer4Captsel = 55U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig0ToTimer4Captsel = 56U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig1ToTimer4Captsel = 57U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig2ToTimer4Captsel = 58U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig0ToTimer4Captsel = 59U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig1ToTimer4Captsel = 60U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig2ToTimer4Captsel = 61U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig3ToTimer4Captsel = 62U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai1TxSyncOutToTimer4Captsel = 63U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - kINPUTMUX_Sai1RxSyncOutToTimer4Captsel = 64U + (TIMER4CAPTSEL0 << PMUX_SHIFT), - - /*!< TIMER0 Trigger. */ - kINPUTMUX_CtimerInp0ToTimer0Trigger = 0U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer0Trigger = 1U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer0Trigger = 2U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer0Trigger = 3U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer0Trigger = 4U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer0Trigger = 5U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer0Trigger = 6U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer0Trigger = 7U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer0Trigger = 8U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer0Trigger = 9U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp10ToTimer0Trigger = 10U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp11ToTimer0Trigger = 11U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer0Trigger = 12U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer0Trigger = 13U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer0Trigger = 14U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer0Trigger = 15U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer0Trigger = 16U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer0Trigger = 17U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer0Trigger = 18U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer0Trigger = 19U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer0Trigger = 20U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Usb1StartOfFrameToTimer0Trigger = 21U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_DcdcBurstActiveToTimer0Trigger = 22U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai0TxSyncOutToTimer0Trigger = 23U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai0RxSyncOutToTimer0Trigger = 24U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0IrqToTimer0Trigger = 25U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc1IrqToTimer0Trigger = 26U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer0Trigger = 27U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer0Trigger = 28U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToTimer0Trigger = 29U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig01ToTimer0Trigger = 30U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig01ToTimer0Trigger = 31U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig01ToTimer0Trigger = 32U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig01ToTimer0Trigger = 33U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig01ToTimer0Trigger = 34U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig01ToTimer0Trigger = 35U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig01ToTimer0Trigger = 36U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig01ToTimer0Trigger = 37U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToTimer0Trigger = 38U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToTimer0Trigger = 39U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToTimer0Trigger = 40U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToTimer0Trigger = 41U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToTimer0Trigger = 42U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToTimer0Trigger = 43U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToTimer0Trigger = 44U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToTimer0Trigger = 45U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToTimer0Trigger = 46U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToTimer0Trigger = 47U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig0ToTimer0Trigger = 50U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig1ToTimer0Trigger = 51U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig2ToTimer0Trigger = 52U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig0ToTimer0Trigger = 53U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig1ToTimer0Trigger = 54U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig2ToTimer0Trigger = 55U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig0ToTimer0Trigger = 56U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig1ToTimer0Trigger = 57U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig2ToTimer0Trigger = 58U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig0ToTimer0Trigger = 59U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig1ToTimer0Trigger = 60U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig2ToTimer0Trigger = 61U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig3ToTimer0Trigger = 62U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai1TxSyncOutToTimer0Trigger = 63U + (TIMER0TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai1RxSyncOutToTimer0Trigger = 64U + (TIMER0TRIGIN << PMUX_SHIFT), - - /*!< TIMER1 Trigger. */ - kINPUTMUX_CtimerInp0ToTimer1Trigger = 0U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer1Trigger = 1U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer1Trigger = 2U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer1Trigger = 3U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer1Trigger = 4U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer1Trigger = 5U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer1Trigger = 6U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer1Trigger = 7U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer1Trigger = 8U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer1Trigger = 9U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp10ToTimer1Trigger = 10U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp11ToTimer1Trigger = 11U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer1Trigger = 12U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer1Trigger = 13U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer1Trigger = 14U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer1Trigger = 15U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer1Trigger = 16U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer1Trigger = 17U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer1Trigger = 18U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer1Trigger = 19U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer1Trigger = 20U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Usb1StartOfFrameToTimer1Trigger = 21U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_DcdcBurstActiveToTimer1Trigger = 22U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai0TxSyncOutToTimer1Trigger = 23U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai0RxSyncOutToTimer1Trigger = 24U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0IrqToTimer1Trigger = 25U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc1IrqToTimer1Trigger = 26U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer1Trigger = 27U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer1Trigger = 28U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToTimer1Trigger = 29U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig01ToTimer1Trigger = 30U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig01ToTimer1Trigger = 31U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig01ToTimer1Trigger = 32U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig01ToTimer1Trigger = 33U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig01ToTimer1Trigger = 34U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig01ToTimer1Trigger = 35U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig01ToTimer1Trigger = 36U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig01ToTimer1Trigger = 37U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToTimer1Trigger = 38U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToTimer1Trigger = 39U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToTimer1Trigger = 40U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToTimer1Trigger = 41U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToTimer1Trigger = 42U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToTimer1Trigger = 43U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToTimer1Trigger = 44U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToTimer1Trigger = 45U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToTimer1Trigger = 46U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToTimer1Trigger = 47U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig0ToTimer1Trigger = 50U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig1ToTimer1Trigger = 51U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig2ToTimer1Trigger = 52U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig0ToTimer1Trigger = 53U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig1ToTimer1Trigger = 54U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig2ToTimer1Trigger = 55U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig0ToTimer1Trigger = 56U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig1ToTimer1Trigger = 57U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig2ToTimer1Trigger = 58U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig0ToTimer1Trigger = 59U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig1ToTimer1Trigger = 60U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig2ToTimer1Trigger = 61U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig3ToTimer1Trigger = 62U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai1TxSyncOutToTimer1Trigger = 63U + (TIMER1TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai1RxSyncOutToTimer1Trigger = 64U + (TIMER1TRIGIN << PMUX_SHIFT), - - /*!< TIMER2 Trigger. */ - kINPUTMUX_CtimerInp0ToTimer2Trigger = 0U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer2Trigger = 1U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer2Trigger = 2U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer2Trigger = 3U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer2Trigger = 4U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer2Trigger = 5U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer2Trigger = 6U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer2Trigger = 7U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer2Trigger = 8U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer2Trigger = 9U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp10ToTimer2Trigger = 10U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp11ToTimer2Trigger = 11U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer2Trigger = 12U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer2Trigger = 13U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer2Trigger = 14U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer2Trigger = 15U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer2Trigger = 16U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer2Trigger = 17U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer2Trigger = 18U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer2Trigger = 19U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer2Trigger = 20U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Usb1StartOfFrameToTimer2Trigger = 21U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_DcdcBurstActiveToTimer2Trigger = 22U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai0TxSyncOutToTimer2Trigger = 23U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai0RxSyncOutToTimer2Trigger = 24U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0IrqToTimer2Trigger = 25U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc1IrqToTimer2Trigger = 26U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer2Trigger = 27U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer2Trigger = 28U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToTimer2Trigger = 29U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig01ToTimer2Trigger = 30U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig01ToTimer2Trigger = 31U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig01ToTimer2Trigger = 32U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig01ToTimer2Trigger = 33U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig01ToTimer2Trigger = 34U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig01ToTimer2Trigger = 35U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig01ToTimer2Trigger = 36U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig01ToTimer2Trigger = 37U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToTimer2Trigger = 38U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToTimer2Trigger = 39U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToTimer2Trigger = 40U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToTimer2Trigger = 41U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToTimer2Trigger = 42U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToTimer2Trigger = 43U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToTimer2Trigger = 44U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToTimer2Trigger = 45U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToTimer2Trigger = 46U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToTimer2Trigger = 47U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig0ToTimer2Trigger = 50U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig1ToTimer2Trigger = 51U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig2ToTimer2Trigger = 52U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig0ToTimer2Trigger = 53U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig1ToTimer2Trigger = 54U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig2ToTimer2Trigger = 55U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig0ToTimer2Trigger = 56U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig1ToTimer2Trigger = 57U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig2ToTimer2Trigger = 58U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig0ToTimer2Trigger = 59U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig1ToTimer2Trigger = 60U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig2ToTimer2Trigger = 61U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig3ToTimer2Trigger = 62U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai1TxSyncOutToTimer2Trigger = 63U + (TIMER2TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai1RxSyncOutToTimer2Trigger = 64U + (TIMER2TRIGIN << PMUX_SHIFT), - - /*!< TIMER3 Trigger. */ - kINPUTMUX_CtimerInp0ToTimer3Trigger = 0U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer3Trigger = 1U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer3Trigger = 2U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer3Trigger = 3U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer3Trigger = 4U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer3Trigger = 5U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer3Trigger = 6U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer3Trigger = 7U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer3Trigger = 8U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer3Trigger = 9U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp10ToTimer3Trigger = 10U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp11ToTimer3Trigger = 11U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer3Trigger = 12U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer3Trigger = 13U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer3Trigger = 14U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer3Trigger = 15U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer3Trigger = 16U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer3Trigger = 17U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer3Trigger = 18U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer3Trigger = 19U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer3Trigger = 20U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Usb1StartOfFrameToTimer3Trigger = 21U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_DcdcBurstActiveToTimer3Trigger = 22U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai0TxSyncOutToTimer3Trigger = 23U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai0RxSyncOutToTimer3Trigger = 24U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0IrqToTimer3Trigger = 25U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc1IrqToTimer3Trigger = 26U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer3Trigger = 27U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer3Trigger = 28U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToTimer3Trigger = 29U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig01ToTimer3Trigger = 30U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig01ToTimer3Trigger = 31U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig01ToTimer3Trigger = 32U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig01ToTimer3Trigger = 33U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig01ToTimer3Trigger = 34U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig01ToTimer3Trigger = 35U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig01ToTimer3Trigger = 36U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig01ToTimer3Trigger = 37U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToTimer3Trigger = 38U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToTimer3Trigger = 39U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToTimer3Trigger = 40U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToTimer3Trigger = 41U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToTimer3Trigger = 42U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToTimer3Trigger = 43U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToTimer3Trigger = 44U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToTimer3Trigger = 45U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToTimer3Trigger = 46U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToTimer3Trigger = 47U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig0ToTimer3Trigger = 50U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig1ToTimer3Trigger = 51U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig2ToTimer3Trigger = 52U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig0ToTimer3Trigger = 53U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig1ToTimer3Trigger = 54U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig2ToTimer3Trigger = 55U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig0ToTimer3Trigger = 56U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig1ToTimer3Trigger = 57U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig2ToTimer3Trigger = 58U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig0ToTimer3Trigger = 59U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig1ToTimer3Trigger = 60U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig2ToTimer3Trigger = 61U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig3ToTimer3Trigger = 62U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai1TxSyncOutToTimer3Trigger = 63U + (TIMER3TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai1RxSyncOutToTimer3Trigger = 64U + (TIMER3TRIGIN << PMUX_SHIFT), - - /*!< TIMER4 Trigger. */ - kINPUTMUX_CtimerInp0ToTimer4Trigger = 0U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp1ToTimer4Trigger = 1U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp2ToTimer4Trigger = 2U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp3ToTimer4Trigger = 3U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp4ToTimer4Trigger = 4U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp5ToTimer4Trigger = 5U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp6ToTimer4Trigger = 6U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp7ToTimer4Trigger = 7U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp8ToTimer4Trigger = 8U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp9ToTimer4Trigger = 9U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp10ToTimer4Trigger = 10U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp11ToTimer4Trigger = 11U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp12ToTimer4Trigger = 12U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp13ToTimer4Trigger = 13U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp14ToTimer4Trigger = 14U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp15ToTimer4Trigger = 15U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp16ToTimer4Trigger = 16U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp17ToTimer4Trigger = 17U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp18ToTimer4Trigger = 18U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_CtimerInp19ToTimer4Trigger = 19U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameToTimer4Trigger = 20U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Usb1StartOfFrameToTimer4Trigger = 21U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_DcdcBurstActiveToTimer4Trigger = 22U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai0TxSyncOutToTimer4Trigger = 23U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai0RxSyncOutToTimer4Trigger = 24U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc0IrqToTimer4Trigger = 25U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Adc1IrqToTimer4Trigger = 26U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToTimer4Trigger = 27U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToTimer4Trigger = 28U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToTimer4Trigger = 29U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig01ToTimer4Trigger = 30U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig01ToTimer4Trigger = 31U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig01ToTimer4Trigger = 32U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig01ToTimer4Trigger = 33U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig01ToTimer4Trigger = 34U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig01ToTimer4Trigger = 35U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig01ToTimer4Trigger = 36U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig01ToTimer4Trigger = 37U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToTimer4Trigger = 38U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToTimer4Trigger = 39U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToTimer4Trigger = 40U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToTimer4Trigger = 41U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToTimer4Trigger = 42U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToTimer4Trigger = 43U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToTimer4Trigger = 44U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToTimer4Trigger = 45U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToTimer4Trigger = 46U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToTimer4Trigger = 47U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig0ToTimer4Trigger = 50U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig1ToTimer4Trigger = 51U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0Trig2ToTimer4Trigger = 52U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig0ToTimer4Trigger = 53U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig1ToTimer4Trigger = 54U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1Trig2ToTimer4Trigger = 55U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig0ToTimer4Trigger = 56U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig1ToTimer4Trigger = 57U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2Trig2ToTimer4Trigger = 58U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig0ToTimer4Trigger = 59U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig1ToTimer4Trigger = 60U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig2ToTimer4Trigger = 61U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3Trig3ToTimer4Trigger = 62U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai1TxSyncOutToTimer4Trigger = 63U + (TIMER4TRIGIN << PMUX_SHIFT), - kINPUTMUX_Sai1RxSyncOutToTimer4Trigger = 64U + (TIMER4TRIGIN << PMUX_SHIFT), - - /*!< SMARTDMA arch B inputs. */ - kINPUTMUX_FlexioToSmartDma = 0U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin0ToSmartDma = 0U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin1ToSmartDma = 1U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin2ToSmartDma = 2U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin3ToSmartDma = 3U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin4ToSmartDma = 4U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin5ToSmartDma = 5U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin6ToSmartDma = 6U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin7ToSmartDma = 7U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin8ToSmartDma = 8U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin9ToSmartDma = 9U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin10ToSmartDma = 10U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin11ToSmartDma = 11U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin12ToSmartDma = 12U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin13ToSmartDma = 13U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin14ToSmartDma = 14U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin15ToSmartDma = 15U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_SctOut8ToSmartDma = 16U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_SctOut9ToSmartDma = 17U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_MrtCh0IrqToSmartDma = 20U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_MrtCh1IrqToSmartDma = 21U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToSmartDma = 22U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToSmartDma = 23U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToSmartDma = 24U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToSmartDma = 25U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToSmartDma = 26U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Ctimer1M2ToSmartDma = 27U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_UtickIrqToSmartDma = 28U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Wdt0IrqToSmartDma = 29U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Adc0IrqToSmartDma = 30U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Cmp0IrqToSmartDma = 31U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm7IrqToSmartDma = 33U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm6IrqToSmartDma = 34U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm5IrqToSmartDma = 35U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm4IrqToSmartDma = 36U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm3IrqToSmartDma = 37U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm2IrqToSmartDma = 38U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm1IrqToSmartDma = 39U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_LpFlexcomm0IrqToSmartDma = 40U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Dma0IrqToSmartDma = 41U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Dma1IrqToSmartDma = 42U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_SysIrqToSmartDma = 43U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_RtcComboIrqToSmartDma = 44U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_ArmTxevToSmartDma = 45U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToSmartDma = 46U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToSmartDma = 49U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Usb0StartOfFrameIrqToSmartDma = 50U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Usb1StartOfFrameIrqToSmartDma = 51U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_OsEventTimerIrqToSmartDma = 52U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Adc1IrqToSmartDma = 53U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Cmp012IrqToSmartDma = 54U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Dac0IrqToSmartDma = 55U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Dac12IrqToSmartDma = 56U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Pwm0IrqToSmartDma = 57U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Pwm1IrqToSmartDma = 58U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Qdc0IrqToSmartDma = 59U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Qdc1IrqToSmartDma = 60U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToSmartDma = 61U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToSmartDma = 62U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig0ToSmartDma = 65U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Gpio1PinEventTrig1ToSmartDma = 66U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToSmartDma = 67U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToSmartDma = 68U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToSmartDma = 69U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToSmartDma = 70U + (SMARTDMAARCHB_INMUX0 << PMUX_SHIFT), - - /*!< Pin interrupt select. */ - kINPUTMUX_GpioPort0Pin0ToPintsel = 0U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin1ToPintsel = 1U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin2ToPintsel = 2U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin3ToPintsel = 3U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin4ToPintsel = 4U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin5ToPintsel = 5U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin6ToPintsel = 6U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin7ToPintsel = 7U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin8ToPintsel = 8U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin9ToPintsel = 9U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin10ToPintsel = 10U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin11ToPintsel = 11U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin12ToPintsel = 12U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin13ToPintsel = 13U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin14ToPintsel = 14U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin15ToPintsel = 15U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin16ToPintsel = 16U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin17ToPintsel = 17U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin18ToPintsel = 18U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin19ToPintsel = 19U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin20ToPintsel = 20U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin21ToPintsel = 21U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin22ToPintsel = 22U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin23ToPintsel = 23U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin24ToPintsel = 24U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin25ToPintsel = 25U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin26ToPintsel = 26U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin27ToPintsel = 27U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin28ToPintsel = 28U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin29ToPintsel = 29U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin30ToPintsel = 30U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort0Pin31ToPintsel = 31U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin0ToPintsel = 32U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin1ToPintsel = 33U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin2ToPintsel = 34U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin3ToPintsel = 35U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin4ToPintsel = 36U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin5ToPintsel = 37U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin6ToPintsel = 38U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin7ToPintsel = 39U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin8ToPintsel = 40U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin9ToPintsel = 41U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin10ToPintsel = 42U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin11ToPintsel = 43U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin12ToPintsel = 44U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin13ToPintsel = 45U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin14ToPintsel = 46U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin15ToPintsel = 47U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin16ToPintsel = 48U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin17ToPintsel = 49U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin18ToPintsel = 50U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin19ToPintsel = 51U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin20ToPintsel = 52U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin21ToPintsel = 53U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin22ToPintsel = 54U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin23ToPintsel = 55U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin30ToPintsel = 62U + (PINTSEL0 << PMUX_SHIFT), - kINPUTMUX_GpioPort1Pin31ToPintsel = 63U + (PINTSEL0 << PMUX_SHIFT), - - /*!< Selection for frequency measurement reference clock. */ - kINPUTMUX_ClkInToFreqmeasRef = 0U + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_Fro12MToFreqmeasRef = 1u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_Fro144MToFreqmeasRef = 2u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_Osc32KToFreqmeasRef = 4u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_CpuAhbClkToFreqmeasRef = 5u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_FreqmeClkIn0ToFreqmeasRef = 6u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_FreqmeClkIn1ToFreqmeasRef = 7u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFreqmeasRef = 8u + (FREQMEAS_REF_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFreqmeasRef = 9u + (FREQMEAS_REF_REG << PMUX_SHIFT), - - /*!< Selection for frequency measurement target clock. */ - kINPUTMUX_ClkInToFreqmeasTar = 0U + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_Fro12MToFreqmeasTar = 1u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_Fro144MToFreqmeasTar = 2u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_Osc32KToFreqmeasTar = 4u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_CpuAhbClkToFreqmeasTar = 5u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_FreqmeClkIn0ToFreqmeasTar = 6u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_FreqmeClkIn1ToFreqmeasTar = 7u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFreqmeasTar = 8u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFreqmeasTar = 9u + (FREQMEAS_TAR_REG << PMUX_SHIFT), - - /*!< Cmp0 Trigger. */ - kINPUTMUX_PinInt0ToCmp0Trigger = 0U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt6ToCmp0Trigger = 1U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToCmp0Trigger = 2U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToCmp0Trigger = 3U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut6ToCmp0Trigger = 4U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToCmp0Trigger = 5U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToCmp0Trigger = 6U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToCmp0Trigger = 7U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M0ToCmp0Trigger = 8U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToCmp0Trigger = 9U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToCmp0Trigger = 11U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToCmp0Trigger = 12U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToCmp0Trigger = 13U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToCmp0Trigger = 14U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig01ToCmp0Trigger = 17U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig01ToCmp0Trigger = 18U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig01ToCmp0Trigger = 19U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig01ToCmp0Trigger = 20U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig01ToCmp0Trigger = 21U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig01ToCmp0Trigger = 22U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig01ToCmp0Trigger = 23U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig01ToCmp0Trigger = 24U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToCmp0Trigger = 25U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToCmp0Trigger = 26U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToCmp0Trigger = 27U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToCmp0Trigger = 28U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToCmp0Trigger = 29U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToCmp0Trigger = 30U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToCmp0Trigger = 31U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToCmp0Trigger = 32U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToCmp0Trigger = 33U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToCmp0Trigger = 34U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToCmp0Trigger = 35U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToCmp0Trigger = 36U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToCmp0Trigger = 37U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToCmp0Trigger = 38U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToCmp0Trigger = 39U + (CMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToCmp0Trigger = 40U + (CMP0_TRIG_REG << PMUX_SHIFT), - - /*!< Cmp1 Trigger. */ - kINPUTMUX_PinInt0ToCmp1Trigger = 0U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt7ToCmp1Trigger = 1U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToCmp1Trigger = 2U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToCmp1Trigger = 3U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut7ToCmp1Trigger = 4U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToCmp1Trigger = 5U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToCmp1Trigger = 6U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToCmp1Trigger = 7U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M1ToCmp1Trigger = 8U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToCmp1Trigger = 9U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToCmp1Trigger = 11U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToCmp1Trigger = 12U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToCmp1Trigger = 13U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToCmp1Trigger = 14U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig01ToCmp1Trigger = 17U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig01ToCmp1Trigger = 18U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig01ToCmp1Trigger = 19U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig01ToCmp1Trigger = 20U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig01ToCmp1Trigger = 21U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig01ToCmp1Trigger = 22U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig01ToCmp1Trigger = 23U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig01ToCmp1Trigger = 24U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToCmp1Trigger = 25U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToCmp1Trigger = 26U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToCmp1Trigger = 27U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToCmp1Trigger = 28U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToCmp1Trigger = 29U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToCmp1Trigger = 30U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToCmp1Trigger = 31U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToCmp1Trigger = 32U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToCmp1Trigger = 33U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToCmp1Trigger = 34U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToCmp1Trigger = 35U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToCmp1Trigger = 36U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToCmp1Trigger = 37U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToCmp1Trigger = 38U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToCmp1Trigger = 39U + (CMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToCmp1Trigger = 40U + (CMP1_TRIG_REG << PMUX_SHIFT), - - /*!< Cmp2 Trigger. */ - kINPUTMUX_PinInt0ToCmp2Trigger = 0U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt4ToCmp2Trigger = 1U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToCmp2Trigger = 2U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToCmp2Trigger = 3U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut8ToCmp2Trigger = 4U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToCmp2Trigger = 5U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToCmp2Trigger = 6U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToCmp2Trigger = 7U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToCmp2Trigger = 8U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToCmp2Trigger = 9U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToCmp2Trigger = 11U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToCmp2Trigger = 12U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToCmp2Trigger = 13U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToCmp2Trigger = 14U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig01ToCmp2Trigger = 17U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig01ToCmp2Trigger = 18U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig01ToCmp2Trigger = 19U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig01ToCmp2Trigger = 20U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig01ToCmp2Trigger = 21U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig01ToCmp2Trigger = 22U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig01ToCmp2Trigger = 23U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig01ToCmp2Trigger = 24U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToCmp2Trigger = 25U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToCmp2Trigger = 26U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToCmp2Trigger = 27U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToCmp2Trigger = 28U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToCmp2Trigger = 29U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToCmp2Trigger = 30U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToCmp2Trigger = 31U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToCmp2Trigger = 32U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToCmp2Trigger = 33U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToCmp2Trigger = 34U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToCmp2Trigger = 35U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToCmp2Trigger = 36U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToCmp2Trigger = 37U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToCmp2Trigger = 38U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToCmp2Trigger = 39U + (CMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToCmp2Trigger = 40U + (CMP2_TRIG_REG << PMUX_SHIFT), - - /*!< Adc0 Trigger. */ - kINPUTMUX_PinInt0ToAdc0Trigger = 0U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_PinInt1ToAdc0Trigger = 1U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_SctOut4ToAdc0Trigger = 2U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_SctOut5ToAdc0Trigger = 3U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_SctOut9ToAdc0Trigger = 4U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToAdc0Trigger = 5U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToAdc0Trigger = 6U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToAdc0Trigger = 7U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToAdc0Trigger = 8U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToAdc0Trigger = 9U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_DcdcBurstDoneTrigToAdc0Trigger = 10U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_ArmTxevToAdc0Trigger = 11U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToAdc0Trigger = 12U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToAdc0Trigger = 13U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToAdc0Trigger = 14U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToAdc0Trigger = 15U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToAdc0Trigger = 16U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToAdc0Trigger = 17U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToAdc0Trigger = 18U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToAdc0Trigger = 19U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToAdc0Trigger = 20U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToAdc0Trigger = 21U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToAdc0Trigger = 22U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToAdc0Trigger = 23U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToAdc0Trigger = 24U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToAdc0Trigger = 25U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToAdc0Trigger = 26U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToAdc0Trigger = 27U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToAdc0Trigger = 28U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToAdc0Trigger = 29U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToAdc0Trigger = 30U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToAdc0Trigger = 31U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToAdc0Trigger = 32U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToAdc0Trigger = 33U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToAdc0Trigger = 34U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToAdc0Trigger = 35U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToAdc0Trigger = 36U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToAdc0Trigger = 37U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToAdc0Trigger = 38U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToAdc0Trigger = 39U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToAdc0Trigger = 40U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToAdc0Trigger = 41U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToAdc0Trigger = 42U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToAdc0Trigger = 43U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToAdc0Trigger = 44U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToAdc0Trigger = 45U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToAdc0Trigger = 46U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToAdc0Trigger = 47U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToAdc0Trigger = 48U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToAdc0Trigger = 49U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToAdc0Trigger = 50U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToAdc0Trigger = 51U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_FlexioCh0ToAdc0Trigger = 52U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_FlexioCh1ToAdc0Trigger = 53U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_FlexioCh2ToAdc0Trigger = 54U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_FlexioCh3ToAdc0Trigger = 55U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToAdc0Trigger = 56U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToAdc0Trigger = 57U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToAdc0Trigger = 58U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToAdc0Trigger = 59U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToAdc0Trigger = 60U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToAdc0Trigger = 61U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToAdc0Trigger = 62U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToAdc0Trigger = 63U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToAdc0Trigger = 64U + (ADC0_TRIG0 << PMUX_SHIFT), - kINPUTMUX_WuuToAdc0Trigger = 65U + (ADC0_TRIG0 << PMUX_SHIFT), - - /*!< Adc1 Trigger. */ - kINPUTMUX_PinInt0ToAdc1Trigger = 0U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_PinInt2ToAdc1Trigger = 1U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_SctOut4ToAdc1Trigger = 2U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_SctOut5ToAdc1Trigger = 3U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_SctOut3ToAdc1Trigger = 4U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToAdc1Trigger = 5U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToAdc1Trigger = 6U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToAdc1Trigger = 7U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToAdc1Trigger = 8U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToAdc1Trigger = 9U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_DcdcBurstDoneTrigToAdc1Trigger = 10U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_ArmTxevToAdc1Trigger = 11U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToAdc1Trigger = 12U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToAdc1Trigger = 13U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToAdc1Trigger = 14U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToAdc1Trigger = 15U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToAdc1Trigger = 16U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToAdc1Trigger = 17U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToAdc1Trigger = 18U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToAdc1Trigger = 19U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToAdc1Trigger = 20U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToAdc1Trigger = 21U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToAdc1Trigger = 22U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToAdc1Trigger = 23U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToAdc1Trigger = 24U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToAdc1Trigger = 25U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToAdc1Trigger = 26U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToAdc1Trigger = 27U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToAdc1Trigger = 28U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToAdc1Trigger = 29U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToAdc1Trigger = 30U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToAdc1Trigger = 31U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToAdc1Trigger = 32U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToAdc1Trigger = 33U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToAdc1Trigger = 34U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToAdc1Trigger = 35U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToAdc1Trigger = 36U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToAdc1Trigger = 37U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToAdc1Trigger = 38U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToAdc1Trigger = 39U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToAdc1Trigger = 40U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToAdc1Trigger = 41U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToAdc1Trigger = 42U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToAdc1Trigger = 43U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToAdc1Trigger = 44U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToAdc1Trigger = 45U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToAdc1Trigger = 46U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToAdc1Trigger = 47U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToAdc1Trigger = 48U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToAdc1Trigger = 49U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToAdc1Trigger = 50U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToAdc1Trigger = 51U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_FlexioCh0ToAdc1Trigger = 52U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_FlexioCh1ToAdc1Trigger = 53U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_FlexioCh2ToAdc1Trigger = 54U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_FlexioCh3ToAdc1Trigger = 55U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToAdc1Trigger = 56U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToAdc1Trigger = 57U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToAdc1Trigger = 58U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToAdc1Trigger = 59U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToAdc1Trigger = 60U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToAdc1Trigger = 61U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToAdc1Trigger = 62U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToAdc1Trigger = 63U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToAdc1Trigger = 64U + (ADC1_TRIG0 << PMUX_SHIFT), - kINPUTMUX_WuuToAdc1Trigger = 65U + (ADC1_TRIG0 << PMUX_SHIFT), - - /*!< Dac0 Trigger. */ - kINPUTMUX_PinInt0ToDac0Trigger = 0U + (DAC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt3ToDac0Trigger = 1U + (DAC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToDac0Trigger = 2U + (DAC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToDac0Trigger = 3U + (DAC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut0ToDac0Trigger = 4U + (DAC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToDac0Trigger = 5U + (DAC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToDac0Trigger = 6U + (DAC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToDac0Trigger = 7U + (DAC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToDac0Trigger = 8U + (DAC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToDac0Trigger = 9U + (DAC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToDac0Trigger = 11U + (DAC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToDac0Trigger = 12U + (DAC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToDac0Trigger = 13U + (DAC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToDac0Trigger = 14U + (DAC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToDac0Trigger = 15U + (DAC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToDac0Trigger = 16U + (DAC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToDac0Trigger = 17U + (DAC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToDac0Trigger = 18U + (DAC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToDac0Trigger = 19U + (DAC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToDac0Trigger = 20U + (DAC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToDac0Trigger = 21U + (DAC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToDac0Trigger = 22U + (DAC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToDac0Trigger = 23U + (DAC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToDac0Trigger = 24U + (DAC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToDac0Trigger = 25U + (DAC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToDac0Trigger = 26U + (DAC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToDac0Trigger = 27U + (DAC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToDac0Trigger = 28U + (DAC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToDac0Trigger = 29U + (DAC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToDac0Trigger = 30U + (DAC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToDac0Trigger = 31U + (DAC0_TRIG_REG << PMUX_SHIFT), - - /*!< Dac1 Trigger. */ - kINPUTMUX_PinInt0ToDac1Trigger = 0U + (DAC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt4ToDac1Trigger = 1U + (DAC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToDac1Trigger = 2U + (DAC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToDac1Trigger = 3U + (DAC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut1ToDac1Trigger = 4U + (DAC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToDac1Trigger = 5U + (DAC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToDac1Trigger = 6U + (DAC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToDac1Trigger = 7U + (DAC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToDac1Trigger = 8U + (DAC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M1ToDac1Trigger = 9U + (DAC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToDac1Trigger = 11U + (DAC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToDac1Trigger = 12U + (DAC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToDac1Trigger = 13U + (DAC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToDac1Trigger = 14U + (DAC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToDac1Trigger = 15U + (DAC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToDac1Trigger = 16U + (DAC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToDac1Trigger = 17U + (DAC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToDac1Trigger = 18U + (DAC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToDac1Trigger = 19U + (DAC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToDac1Trigger = 20U + (DAC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToDac1Trigger = 21U + (DAC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToDac1Trigger = 22U + (DAC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToDac1Trigger = 23U + (DAC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToDac1Trigger = 24U + (DAC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToDac1Trigger = 25U + (DAC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToDac1Trigger = 26U + (DAC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToDac1Trigger = 27U + (DAC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToDac1Trigger = 28U + (DAC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToDac1Trigger = 29U + (DAC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToDac1Trigger = 30U + (DAC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToDac1Trigger = 31U + (DAC1_TRIG_REG << PMUX_SHIFT), - - /*!< Dac2 Trigger. */ - kINPUTMUX_PinInt0ToDac2Trigger = 0U + (DAC2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToDac2Trigger = 1U + (DAC2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToDac2Trigger = 2U + (DAC2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToDac2Trigger = 3U + (DAC2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut2ToDac2Trigger = 4U + (DAC2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToDac2Trigger = 5U + (DAC2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToDac2Trigger = 6U + (DAC2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToDac2Trigger = 7U + (DAC2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToDac2Trigger = 8U + (DAC2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToDac2Trigger = 9U + (DAC2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToDac2Trigger = 11U + (DAC2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToDac2Trigger = 12U + (DAC2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToDac2Trigger = 13U + (DAC2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToDac2Trigger = 14U + (DAC2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToDac2Trigger = 15U + (DAC2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToDac2Trigger = 16U + (DAC2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToDac2Trigger = 17U + (DAC2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToDac2Trigger = 18U + (DAC2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToDac2Trigger = 19U + (DAC2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToDac2Trigger = 20U + (DAC2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToDac2Trigger = 21U + (DAC2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToDac2Trigger = 22U + (DAC2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToDac2Trigger = 23U + (DAC2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToDac2Trigger = 24U + (DAC2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToDac2Trigger = 25U + (DAC2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToDac2Trigger = 26U + (DAC2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToDac2Trigger = 27U + (DAC2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToDac2Trigger = 28U + (DAC2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToDac2Trigger = 29U + (DAC2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToDac2Trigger = 30U + (DAC2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToDac2Trigger = 31U + (DAC2_TRIG_REG << PMUX_SHIFT), - - /*!< QDC0 Trigger Input Connections. */ - kINPUTMUX_PinInt0ToQdc0Trigger = 0U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt4ToQdc0Trigger = 1U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToQdc0Trigger = 2U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToQdc0Trigger = 3U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut1ToQdc0Trigger = 4U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc0Trigger = 5U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc0Trigger = 6U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc0Trigger = 7U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToQdc0Trigger = 8U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToQdc0Trigger = 9U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToQdc0Trigger = 11U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToQdc0Trigger = 12U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToQdc0Trigger = 13U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToQdc0Trigger = 14U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToQdc0Trigger = 15U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToQdc0Trigger = 16U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToQdc0Trigger = 17U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToQdc0Trigger = 18U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToQdc0Trigger = 19U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToQdc0Trigger = 20U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc0Trigger = 21U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc0Trigger = 22U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToQdc0Trigger = 23U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToQdc0Trigger = 24U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToQdc0Trigger = 25U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToQdc0Trigger = 26U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToQdc0Trigger = 27U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToQdc0Trigger = 28U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToQdc0Trigger = 29U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToQdc0Trigger = 30U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToQdc0Trigger = 31U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToQdc0Trigger = 32U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToQdc0Trigger = 33U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToQdc0Trigger = 34U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToQdc0Trigger = 35U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToQdc0Trigger = 36U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToQdc0Trigger = 37U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToQdc0Trigger = 38U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToQdc0Trigger = 39U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToQdc0Trigger = 40U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToQdc0Trigger = 41U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc0Trigger = 42U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc0Trigger = 43U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc0Trigger = 44U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc0Trigger = 45U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc0Trigger = 46U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc0Trigger = 47U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc0Trigger = 48U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc0Trigger = 49U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc0Trigger = 50U + (QDC0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc0Trigger = 51U + (QDC0_TRIG_REG << PMUX_SHIFT), - - /*!< QDC0 Home Input Connections. */ - kINPUTMUX_PinInt0ToQdc0Home = 0U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_PinInt4ToQdc0Home = 1U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToQdc0Home = 2U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToQdc0Home = 3U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_SctOut1ToQdc0Home = 4U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc0Home = 5U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc0Home = 6U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc0Home = 7U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToQdc0Home = 8U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToQdc0Home = 9U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToQdc0Home = 11U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToQdc0Home = 12U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToQdc0Home = 13U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToQdc0Home = 14U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToQdc0Home = 15U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToQdc0Home = 16U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToQdc0Home = 17U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToQdc0Home = 18U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToQdc0Home = 19U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToQdc0Home = 20U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc0Home = 21U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc0Home = 22U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToQdc0Home = 23U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToQdc0Home = 24U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToQdc0Home = 25U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToQdc0Home = 26U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToQdc0Home = 27U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToQdc0Home = 28U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToQdc0Home = 29U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToQdc0Home = 30U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToQdc0Home = 31U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToQdc0Home = 32U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToQdc0Home = 33U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToQdc0Home = 34U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToQdc0Home = 35U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToQdc0Home = 36U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToQdc0Home = 37U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToQdc0Home = 38U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToQdc0Home = 39U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToQdc0Home = 40U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToQdc0Home = 41U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc0Home = 42U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc0Home = 43U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc0Home = 44U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc0Home = 45U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc0Home = 46U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc0Home = 47U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc0Home = 48U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc0Home = 49U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc0Home = 50U + (QDC0_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc0Home = 51U + (QDC0_HOME_REG << PMUX_SHIFT), - - /*!< QDC0 Index Input Connections. */ - kINPUTMUX_PinInt0ToQdc0Index = 0U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_PinInt4ToQdc0Index = 1U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToQdc0Index = 2U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToQdc0Index = 3U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_SctOut1ToQdc0Index = 4U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc0Index = 5U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc0Index = 6U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc0Index = 7U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToQdc0Index = 8U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToQdc0Index = 9U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToQdc0Index = 11U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToQdc0Index = 12U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToQdc0Index = 13U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToQdc0Index = 14U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToQdc0Index = 15U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToQdc0Index = 16U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToQdc0Index = 17U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToQdc0Index = 18U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToQdc0Index = 19U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToQdc0Index = 20U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc0Index = 21U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc0Index = 22U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToQdc0Index = 23U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToQdc0Index = 24U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToQdc0Index = 25U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToQdc0Index = 26U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToQdc0Index = 27U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToQdc0Index = 28U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToQdc0Index = 29U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToQdc0Index = 30U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToQdc0Index = 31U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToQdc0Index = 32U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToQdc0Index = 33U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToQdc0Index = 34U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToQdc0Index = 35U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToQdc0Index = 36U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToQdc0Index = 37U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToQdc0Index = 38U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToQdc0Index = 39U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToQdc0Index = 40U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToQdc0Index = 41U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc0Index = 42U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc0Index = 43U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc0Index = 44U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc0Index = 45U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc0Index = 46U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc0Index = 47U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc0Index = 48U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc0Index = 49U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc0Index = 50U + (QDC0_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc0Index = 51U + (QDC0_INDEX_REG << PMUX_SHIFT), - - /*!< QDC0 Phaseb Input Connections. */ - kINPUTMUX_PinInt0ToQdc0Phaseb = 0U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_PinInt4ToQdc0Phaseb = 1U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToQdc0Phaseb = 2U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToQdc0Phaseb = 3U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_SctOut1ToQdc0Phaseb = 4U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc0Phaseb = 5U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc0Phaseb = 6U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc0Phaseb = 7U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToQdc0Phaseb = 8U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToQdc0Phaseb = 9U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToQdc0Phaseb = 11U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToQdc0Phaseb = 12U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToQdc0Phaseb = 13U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToQdc0Phaseb = 14U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToQdc0Phaseb = 15U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToQdc0Phaseb = 16U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToQdc0Phaseb = 17U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToQdc0Phaseb = 18U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToQdc0Phaseb = 19U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToQdc0Phaseb = 20U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc0Phaseb = 21U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc0Phaseb = 22U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToQdc0Phaseb = 23U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToQdc0Phaseb = 24U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToQdc0Phaseb = 25U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToQdc0Phaseb = 26U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToQdc0Phaseb = 27U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToQdc0Phaseb = 28U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToQdc0Phaseb = 29U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToQdc0Phaseb = 30U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToQdc0Phaseb = 31U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToQdc0Phaseb = 32U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToQdc0Phaseb = 33U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToQdc0Phaseb = 34U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToQdc0Phaseb = 35U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToQdc0Phaseb = 36U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToQdc0Phaseb = 37U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToQdc0Phaseb = 38U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToQdc0Phaseb = 39U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToQdc0Phaseb = 40U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToQdc0Phaseb = 41U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc0Phaseb = 42U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc0Phaseb = 43U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc0Phaseb = 44U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc0Phaseb = 45U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc0Phaseb = 46U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc0Phaseb = 47U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc0Phaseb = 48U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc0Phaseb = 49U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc0Phaseb = 50U + (QDC0_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc0Phaseb = 51U + (QDC0_PHASEB_REG << PMUX_SHIFT), - - /*!< QDC0 Phasea Input Connections. */ - kINPUTMUX_PinInt0ToQdc0Phasea = 0U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_PinInt4ToQdc0Phasea = 1U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToQdc0Phasea = 2U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToQdc0Phasea = 3U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_SctOut1ToQdc0Phasea = 4U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc0Phasea = 5U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc0Phasea = 6U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc0Phasea = 7U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToQdc0Phasea = 8U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToQdc0Phasea = 9U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToQdc0Phasea = 11U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToQdc0Phasea = 12U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToQdc0Phasea = 13U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToQdc0Phasea = 14U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToQdc0Phasea = 15U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToQdc0Phasea = 16U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToQdc0Phasea = 17U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToQdc0Phasea = 18U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToQdc0Phasea = 19U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToQdc0Phasea = 20U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc0Phasea = 21U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc0Phasea = 22U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToQdc0Phasea = 23U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToQdc0Phasea = 24U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToQdc0Phasea = 25U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToQdc0Phasea = 26U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToQdc0Phasea = 27U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToQdc0Phasea = 28U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToQdc0Phasea = 29U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToQdc0Phasea = 30U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToQdc0Phasea = 31U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToQdc0Phasea = 32U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToQdc0Phasea = 33U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToQdc0Phasea = 34U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToQdc0Phasea = 35U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToQdc0Phasea = 36U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToQdc0Phasea = 37U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToQdc0Phasea = 38U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToQdc0Phasea = 39U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToQdc0Phasea = 40U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToQdc0Phasea = 41U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc0Phasea = 42U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc0Phasea = 43U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc0Phasea = 44U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc0Phasea = 45U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc0Phasea = 46U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc0Phasea = 47U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc0Phasea = 48U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc0Phasea = 49U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc0Phasea = 50U + (QDC0_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc0Phasea = 51U + (QDC0_PHASEA_REG << PMUX_SHIFT), - - /*!< QDC1 Trigger Input Connections. */ - kINPUTMUX_PinInt0ToQdc1Trigger = 0U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt4ToQdc1Trigger = 1U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToQdc1Trigger = 2U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToQdc1Trigger = 3U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut1ToQdc1Trigger = 4U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc1Trigger = 5U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc1Trigger = 6U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc1Trigger = 7U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToQdc1Trigger = 8U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToQdc1Trigger = 9U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToQdc1Trigger = 11U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToQdc1Trigger = 12U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToQdc1Trigger = 13U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToQdc1Trigger = 14U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToQdc1Trigger = 15U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToQdc1Trigger = 16U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToQdc1Trigger = 17U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToQdc1Trigger = 18U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToQdc1Trigger = 19U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToQdc1Trigger = 20U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc1Trigger = 21U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc1Trigger = 22U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToQdc1Trigger = 23U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToQdc1Trigger = 24U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToQdc1Trigger = 25U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToQdc1Trigger = 26U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToQdc1Trigger = 27U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToQdc1Trigger = 28U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToQdc1Trigger = 29U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToQdc1Trigger = 30U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToQdc1Trigger = 31U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToQdc1Trigger = 32U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToQdc1Trigger = 33U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToQdc1Trigger = 34U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToQdc1Trigger = 35U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToQdc1Trigger = 36U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToQdc1Trigger = 37U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToQdc1Trigger = 38U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToQdc1Trigger = 39U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToQdc1Trigger = 40U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToQdc1Trigger = 41U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc1Trigger = 42U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc1Trigger = 43U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc1Trigger = 44U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc1Trigger = 45U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc1Trigger = 46U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc1Trigger = 47U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc1Trigger = 48U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc1Trigger = 49U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc1Trigger = 50U + (QDC1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc1Trigger = 51U + (QDC1_TRIG_REG << PMUX_SHIFT), - - /*!< QDC1 Home Input Connections. */ - kINPUTMUX_PinInt0ToQdc1Home = 0U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_PinInt4ToQdc1Home = 1U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToQdc1Home = 2U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToQdc1Home = 3U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_SctOut1ToQdc1Home = 4U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc1Home = 5U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc1Home = 6U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc1Home = 7U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToQdc1Home = 8U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToQdc1Home = 9U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToQdc1Home = 11U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToQdc1Home = 12U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToQdc1Home = 13U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToQdc1Home = 14U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToQdc1Home = 15U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToQdc1Home = 16U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToQdc1Home = 17U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToQdc1Home = 18U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToQdc1Home = 19U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToQdc1Home = 20U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc1Home = 21U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc1Home = 22U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToQdc1Home = 23U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToQdc1Home = 24U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToQdc1Home = 25U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToQdc1Home = 26U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToQdc1Home = 27U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToQdc1Home = 28U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToQdc1Home = 29U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToQdc1Home = 30U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToQdc1Home = 31U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToQdc1Home = 32U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToQdc1Home = 33U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToQdc1Home = 34U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToQdc1Home = 35U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToQdc1Home = 36U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToQdc1Home = 37U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToQdc1Home = 38U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToQdc1Home = 39U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToQdc1Home = 40U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToQdc1Home = 41U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc1Home = 42U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc1Home = 43U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc1Home = 44U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc1Home = 45U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc1Home = 46U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc1Home = 47U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc1Home = 48U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc1Home = 49U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc1Home = 50U + (QDC1_HOME_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc1Home = 51U + (QDC1_HOME_REG << PMUX_SHIFT), - - /*!< QDC1 Index Input Connections. */ - kINPUTMUX_PinInt0ToQdc1Index = 0U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_PinInt4ToQdc1Index = 1U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToQdc1Index = 2U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToQdc1Index = 3U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_SctOut1ToQdc1Index = 4U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc1Index = 5U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc1Index = 6U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc1Index = 7U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToQdc1Index = 8U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToQdc1Index = 9U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToQdc1Index = 11U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToQdc1Index = 12U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToQdc1Index = 13U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToQdc1Index = 14U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToQdc1Index = 15U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToQdc1Index = 16U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToQdc1Index = 17U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToQdc1Index = 18U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToQdc1Index = 19U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToQdc1Index = 20U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc1Index = 21U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc1Index = 22U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToQdc1Index = 23U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToQdc1Index = 24U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToQdc1Index = 25U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToQdc1Index = 26U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToQdc1Index = 27U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToQdc1Index = 28U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToQdc1Index = 29U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToQdc1Index = 30U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToQdc1Index = 31U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToQdc1Index = 32U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToQdc1Index = 33U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToQdc1Index = 34U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToQdc1Index = 35U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToQdc1Index = 36U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToQdc1Index = 37U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToQdc1Index = 38U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToQdc1Index = 39U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToQdc1Index = 40U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToQdc1Index = 41U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc1Index = 42U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc1Index = 43U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc1Index = 44U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc1Index = 45U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc1Index = 46U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc1Index = 47U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc1Index = 48U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc1Index = 49U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc1Index = 50U + (QDC1_INDEX_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc1Index = 51U + (QDC1_INDEX_REG << PMUX_SHIFT), - - /*!< QDC1 Phaseb Input Connections. */ - kINPUTMUX_PinInt0ToQdc1Phaseb = 0U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_PinInt4ToQdc1Phaseb = 1U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToQdc1Phaseb = 2U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToQdc1Phaseb = 3U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_SctOut1ToQdc1Phaseb = 4U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc1Phaseb = 5U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc1Phaseb = 6U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc1Phaseb = 7U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToQdc1Phaseb = 8U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToQdc1Phaseb = 9U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToQdc1Phaseb = 11U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToQdc1Phaseb = 12U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToQdc1Phaseb = 13U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToQdc1Phaseb = 14U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToQdc1Phaseb = 15U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToQdc1Phaseb = 16U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToQdc1Phaseb = 17U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToQdc1Phaseb = 18U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToQdc1Phaseb = 19U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToQdc1Phaseb = 20U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc1Phaseb = 21U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc1Phaseb = 22U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToQdc1Phaseb = 23U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToQdc1Phaseb = 24U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToQdc1Phaseb = 25U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToQdc1Phaseb = 26U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToQdc1Phaseb = 27U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToQdc1Phaseb = 28U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToQdc1Phaseb = 29U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToQdc1Phaseb = 30U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToQdc1Phaseb = 31U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToQdc1Phaseb = 32U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToQdc1Phaseb = 33U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToQdc1Phaseb = 34U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToQdc1Phaseb = 35U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToQdc1Phaseb = 36U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToQdc1Phaseb = 37U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToQdc1Phaseb = 38U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToQdc1Phaseb = 39U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToQdc1Phaseb = 40U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToQdc1Phaseb = 41U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc1Phaseb = 42U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc1Phaseb = 43U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc1Phaseb = 44U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc1Phaseb = 45U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc1Phaseb = 46U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc1Phaseb = 47U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc1Phaseb = 48U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc1Phaseb = 49U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc1Phaseb = 50U + (QDC1_PHASEB_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc1Phaseb = 51U + (QDC1_PHASEB_REG << PMUX_SHIFT), - - /*!< QDC1 Phasea Input Connections. */ - kINPUTMUX_PinInt0ToQdc1Phasea = 0U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_PinInt4ToQdc1Phasea = 1U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToQdc1Phasea = 2U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToQdc1Phasea = 3U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_SctOut1ToQdc1Phasea = 4U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToQdc1Phasea = 5U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToQdc1Phasea = 6U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToQdc1Phasea = 7U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M0ToQdc1Phasea = 8U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToQdc1Phasea = 9U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToQdc1Phasea = 11U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToQdc1Phasea = 12U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToQdc1Phasea = 13U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToQdc1Phasea = 14U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToQdc1Phasea = 15U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToQdc1Phasea = 16U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToQdc1Phasea = 17U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToQdc1Phasea = 18U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToQdc1Phasea = 19U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToQdc1Phasea = 20U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToQdc1Phasea = 21U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToQdc1Phasea = 22U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToQdc1Phasea = 23U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToQdc1Phasea = 24U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToQdc1Phasea = 25U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToQdc1Phasea = 26U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToQdc1Phasea = 27U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToQdc1Phasea = 28U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToQdc1Phasea = 29U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToQdc1Phasea = 30U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToQdc1Phasea = 31U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToQdc1Phasea = 32U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToQdc1Phasea = 33U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToQdc1Phasea = 34U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToQdc1Phasea = 35U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToQdc1Phasea = 36U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToQdc1Phasea = 37U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToQdc1Phasea = 38U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToQdc1Phasea = 39U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToQdc1Phasea = 40U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToQdc1Phasea = 41U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToQdc1Phasea = 42U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToQdc1Phasea = 43U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToQdc1Phasea = 44U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToQdc1Phasea = 45U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToQdc1Phasea = 46U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToQdc1Phasea = 47U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToQdc1Phasea = 48U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToQdc1Phasea = 49U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToQdc1Phasea = 50U + (QDC1_PHASEA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToQdc1Phasea = 51U + (QDC1_PHASEA_REG << PMUX_SHIFT), - - /*!< FlexPWM0_SM0_EXTSYNC input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm0Sm0ExtSync = 0U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexPwm0Sm0ExtSync = 1U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToFlexPwm0Sm0ExtSync = 2U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexPwm0Sm0ExtSync = 3U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SctOut2ToFlexPwm0Sm0ExtSync = 4U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Sm0ExtSync = 5U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Sm0ExtSync = 6U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Sm0ExtSync = 7U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexPwm0Sm0ExtSync = 8U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexPwm0Sm0ExtSync = 9U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm0Sm0ExtSync = 11U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm0Sm0ExtSync = 12U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm0Sm0ExtSync = 13U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm0Sm0ExtSync = 14U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm0Sm0ExtSync = 15U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm0Sm0ExtSync = 16U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm0Sm0ExtSync = 17U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm0Sm0ExtSync = 18U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm0Sm0ExtSync = 19U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm0Sm0ExtSync = 20U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Sm0ExtSync = 21U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Sm0ExtSync = 22U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexPwm0Sm0ExtSync = 23U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToFlexPwm0Sm0ExtSync = 24U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToFlexPwm0Sm0ExtSync = 25U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToFlexPwm0Sm0ExtSync = 26U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToFlexPwm0Sm0ExtSync = 27U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToFlexPwm0Sm0ExtSync = 28U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToFlexPwm0Sm0ExtSync = 29U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToFlexPwm0Sm0ExtSync = 30U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToFlexPwm0Sm0ExtSync = 31U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm0Sm0ExtSync = 32U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm0Sm0ExtSync = 33U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm0Sm0ExtSync = 34U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm0Sm0ExtSync = 35U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm0Sm0ExtSync = 36U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm0Sm0ExtSync = 37U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm0Sm0ExtSync = 38U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm0Sm0ExtSync = 39U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm0Sm0ExtSync = 40U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm0Sm0ExtSync = 41U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Sm0ExtSync = 42U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Sm0ExtSync = 43U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Sm0ExtSync = 44U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Sm0ExtSync = 45U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Sm0ExtSync = 46U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Sm0ExtSync = 47U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Sm0ExtSync = 48U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Sm0ExtSync = 49U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Sm0ExtSync = 50U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Sm0ExtSync = 51U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToFlexPwm0Sm0ExtSync = 52U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToFlexPwm0Sm0ExtSync = 53U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToFlexPwm0Sm0ExtSync = 54U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToFlexPwm0Sm0ExtSync = 55U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToFlexPwm0Sm0ExtSync = 56U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Sm0ExtSync = 57U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm0Sm0ExtSync = 58U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Sm0ExtSync = 59U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm0Sm0ExtSync = 60U + (FlexPWM0_SM0_EXTSYNC_REG << PMUX_SHIFT), - - /*!< FlexPWM0_SM1_EXTSYNC input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm0Sm1ExtSync = 0U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexPwm0Sm1ExtSync = 1U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToFlexPwm0Sm1ExtSync = 2U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexPwm0Sm1ExtSync = 3U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SctOut2ToFlexPwm0Sm1ExtSync = 4U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Sm1ExtSync = 5U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Sm1ExtSync = 6U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Sm1ExtSync = 7U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexPwm0Sm1ExtSync = 8U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexPwm0Sm1ExtSync = 9U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm0Sm1ExtSync = 11U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm0Sm1ExtSync = 12U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm0Sm1ExtSync = 13U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm0Sm1ExtSync = 14U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm0Sm1ExtSync = 15U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm0Sm1ExtSync = 16U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm0Sm1ExtSync = 17U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm0Sm1ExtSync = 18U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm0Sm1ExtSync = 19U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm0Sm1ExtSync = 20U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Sm1ExtSync = 21U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Sm1ExtSync = 22U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexPwm0Sm1ExtSync = 23U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToFlexPwm0Sm1ExtSync = 24U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToFlexPwm0Sm1ExtSync = 25U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToFlexPwm0Sm1ExtSync = 26U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToFlexPwm0Sm1ExtSync = 27U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToFlexPwm0Sm1ExtSync = 28U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToFlexPwm0Sm1ExtSync = 29U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToFlexPwm0Sm1ExtSync = 30U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToFlexPwm0Sm1ExtSync = 31U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm0Sm1ExtSync = 32U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm0Sm1ExtSync = 33U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm0Sm1ExtSync = 34U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm0Sm1ExtSync = 35U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm0Sm1ExtSync = 36U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm0Sm1ExtSync = 37U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm0Sm1ExtSync = 38U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm0Sm1ExtSync = 39U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm0Sm1ExtSync = 40U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm0Sm1ExtSync = 41U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Sm1ExtSync = 42U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Sm1ExtSync = 43U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Sm1ExtSync = 44U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Sm1ExtSync = 45U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Sm1ExtSync = 46U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Sm1ExtSync = 47U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Sm1ExtSync = 48U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Sm1ExtSync = 49U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Sm1ExtSync = 50U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Sm1ExtSync = 51U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToFlexPwm0Sm1ExtSync = 52U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToFlexPwm0Sm1ExtSync = 53U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToFlexPwm0Sm1ExtSync = 54U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToFlexPwm0Sm1ExtSync = 55U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToFlexPwm0Sm1ExtSync = 56U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Sm1ExtSync = 57U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm0Sm1ExtSync = 58U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Sm1ExtSync = 59U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm0Sm1ExtSync = 60U + (FlexPWM0_SM1_EXTSYNC_REG << PMUX_SHIFT), - - /*!< FlexPWM0_SM2_EXTSYNC2 input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm0Sm2ExtSync = 0U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexPwm0Sm2ExtSync = 1U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToFlexPwm0Sm2ExtSync = 2U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexPwm0Sm2ExtSync = 3U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SctOut2ToFlexPwm0Sm2ExtSync = 4U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Sm2ExtSync = 5U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Sm2ExtSync = 6U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Sm2ExtSync = 7U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexPwm0Sm2ExtSync = 8U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexPwm0Sm2ExtSync = 9U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm0Sm2ExtSync = 11U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm0Sm2ExtSync = 12U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm0Sm2ExtSync = 13U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm0Sm2ExtSync = 14U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm0Sm2ExtSync = 15U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm0Sm2ExtSync = 16U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm0Sm2ExtSync = 17U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm0Sm2ExtSync = 18U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm0Sm2ExtSync = 19U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm0Sm2ExtSync = 20U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Sm2ExtSync = 21U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Sm2ExtSync = 22U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexPwm0Sm2ExtSync = 23U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToFlexPwm0Sm2ExtSync = 24U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToFlexPwm0Sm2ExtSync = 25U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToFlexPwm0Sm2ExtSync = 26U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToFlexPwm0Sm2ExtSync = 27U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToFlexPwm0Sm2ExtSync = 28U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToFlexPwm0Sm2ExtSync = 29U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToFlexPwm0Sm2ExtSync = 30U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToFlexPwm0Sm2ExtSync = 31U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm0Sm2ExtSync = 32U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm0Sm2ExtSync = 33U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm0Sm2ExtSync = 34U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm0Sm2ExtSync = 35U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm0Sm2ExtSync = 36U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm0Sm2ExtSync = 37U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm0Sm2ExtSync = 38U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm0Sm2ExtSync = 39U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm0Sm2ExtSync = 40U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm0Sm2ExtSync = 41U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Sm2ExtSync = 42U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Sm2ExtSync = 43U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Sm2ExtSync = 44U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Sm2ExtSync = 45U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Sm2ExtSync = 46U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Sm2ExtSync = 47U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Sm2ExtSync = 48U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Sm2ExtSync = 49U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Sm2ExtSync = 50U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Sm2ExtSync = 51U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToFlexPwm0Sm2ExtSync = 52U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToFlexPwm0Sm2ExtSync = 53U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToFlexPwm0Sm2ExtSync = 54U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToFlexPwm0Sm2ExtSync = 55U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToFlexPwm0Sm2ExtSync = 56U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Sm2ExtSync = 57U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm0Sm2ExtSync = 58U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Sm2ExtSync = 59U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm0Sm2ExtSync = 60U + (FlexPWM0_SM2_EXTSYNC_REG << PMUX_SHIFT), - - /*!< FlexPWM0_SM3_EXTSYNC input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm0Sm3ExtSync = 0U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexPwm0Sm3ExtSync = 1U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToFlexPwm0Sm3ExtSync = 2U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexPwm0Sm3ExtSync = 3U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SctOut2ToFlexPwm0Sm3ExtSync = 4U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Sm3ExtSync = 5U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Sm3ExtSync = 6U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Sm3ExtSync = 7U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexPwm0Sm3ExtSync = 8U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexPwm0Sm3ExtSync = 9U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm0Sm3ExtSync = 11U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm0Sm3ExtSync = 12U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm0Sm3ExtSync = 13U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm0Sm3ExtSync = 14U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm0Sm3ExtSync = 15U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm0Sm3ExtSync = 16U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm0Sm3ExtSync = 17U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm0Sm3ExtSync = 18U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm0Sm3ExtSync = 19U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm0Sm3ExtSync = 20U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Sm3ExtSync = 21U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Sm3ExtSync = 22U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexPwm0Sm3ExtSync = 23U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToFlexPwm0Sm3ExtSync = 24U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToFlexPwm0Sm3ExtSync = 25U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToFlexPwm0Sm3ExtSync = 26U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToFlexPwm0Sm3ExtSync = 27U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToFlexPwm0Sm3ExtSync = 28U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToFlexPwm0Sm3ExtSync = 29U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToFlexPwm0Sm3ExtSync = 30U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToFlexPwm0Sm3ExtSync = 31U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm0Sm3ExtSync = 32U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm0Sm3ExtSync = 33U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm0Sm3ExtSync = 34U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm0Sm3ExtSync = 35U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm0Sm3ExtSync = 36U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm0Sm3ExtSync = 37U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm0Sm3ExtSync = 38U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm0Sm3ExtSync = 39U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm0Sm3ExtSync = 40U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm0Sm3ExtSync = 41U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Sm3ExtSync = 42U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Sm3ExtSync = 43U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Sm3ExtSync = 44U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Sm3ExtSync = 45U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Sm3ExtSync = 46U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Sm3ExtSync = 47U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Sm3ExtSync = 48U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Sm3ExtSync = 49U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Sm3ExtSync = 50U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Sm3ExtSync = 51U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToFlexPwm0Sm3ExtSync = 52U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToFlexPwm0Sm3ExtSync = 53U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToFlexPwm0Sm3ExtSync = 54U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToFlexPwm0Sm3ExtSync = 55U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToFlexPwm0Sm3ExtSync = 56U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Sm3ExtSync = 57U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm0Sm3ExtSync = 58U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Sm3ExtSync = 59U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm0Sm3ExtSync = 60U + (FlexPWM0_SM3_EXTSYNC_REG << PMUX_SHIFT), - - /*!< FlexPWM0_SM0_EXTA input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm0Sm0Exta = 0U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexPwm0Sm0Exta = 1U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToFlexPwm0Sm0Exta = 2U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexPwm0Sm0Exta = 3U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SctOut2ToFlexPwm0Sm0Exta = 4U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Sm0Exta = 5U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Sm0Exta = 6U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Sm0Exta = 7U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexPwm0Sm0Exta = 8U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexPwm0Sm0Exta = 9U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm0Sm0Exta = 11U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm0Sm0Exta = 12U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm0Sm0Exta = 13U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm0Sm0Exta = 14U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm0Sm0Exta = 15U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm0Sm0Exta = 16U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm0Sm0Exta = 17U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm0Sm0Exta = 18U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm0Sm0Exta = 19U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm0Sm0Exta = 20U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Sm0Exta = 21U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Sm0Exta = 22U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexPwm0Sm0Exta = 23U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToFlexPwm0Sm0Exta = 24U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToFlexPwm0Sm0Exta = 25U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToFlexPwm0Sm0Exta = 26U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToFlexPwm0Sm0Exta = 27U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToFlexPwm0Sm0Exta = 28U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToFlexPwm0Sm0Exta = 29U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToFlexPwm0Sm0Exta = 30U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToFlexPwm0Sm0Exta = 31U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm0Sm0Exta = 32U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm0Sm0Exta = 33U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm0Sm0Exta = 34U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm0Sm0Exta = 35U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm0Sm0Exta = 36U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm0Sm0Exta = 37U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm0Sm0Exta = 38U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm0Sm0Exta = 39U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm0Sm0Exta = 40U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm0Sm0Exta = 41U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Sm0Exta = 42U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Sm0Exta = 43U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Sm0Exta = 44U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Sm0Exta = 45U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Sm0Exta = 46U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Sm0Exta = 47U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Sm0Exta = 48U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Sm0Exta = 49U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Sm0Exta = 50U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Sm0Exta = 51U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToFlexPwm0Sm0Exta = 52U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToFlexPwm0Sm0Exta = 53U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToFlexPwm0Sm0Exta = 54U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToFlexPwm0Sm0Exta = 55U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToFlexPwm0Sm0Exta = 56U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Sm0Exta = 57U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm0Sm0Exta = 58U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Sm0Exta = 59U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm0Sm0Exta = 60U + (FlexPWM0_SM0_EXTA_REG << PMUX_SHIFT), - - /*!< FlexPWM0_SM1_EXTA input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm0Sm1Exta = 0U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexPwm0Sm1Exta = 1U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToFlexPwm0Sm1Exta = 2U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexPwm0Sm1Exta = 3U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SctOut2ToFlexPwm0Sm1Exta = 4U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Sm1Exta = 5U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Sm1Exta = 6U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Sm1Exta = 7U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexPwm0Sm1Exta = 8U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexPwm0Sm1Exta = 9U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm0Sm1Exta = 11U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm0Sm1Exta = 12U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm0Sm1Exta = 13U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm0Sm1Exta = 14U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm0Sm1Exta = 15U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm0Sm1Exta = 16U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm0Sm1Exta = 17U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm0Sm1Exta = 18U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm0Sm1Exta = 19U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm0Sm1Exta = 20U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Sm1Exta = 21U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Sm1Exta = 22U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexPwm0Sm1Exta = 23U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToFlexPwm0Sm1Exta = 24U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToFlexPwm0Sm1Exta = 25U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToFlexPwm0Sm1Exta = 26U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToFlexPwm0Sm1Exta = 27U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToFlexPwm0Sm1Exta = 28U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToFlexPwm0Sm1Exta = 29U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToFlexPwm0Sm1Exta = 30U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToFlexPwm0Sm1Exta = 31U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm0Sm1Exta = 32U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm0Sm1Exta = 33U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm0Sm1Exta = 34U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm0Sm1Exta = 35U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm0Sm1Exta = 36U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm0Sm1Exta = 37U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm0Sm1Exta = 38U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm0Sm1Exta = 39U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm0Sm1Exta = 40U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm0Sm1Exta = 41U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Sm1Exta = 42U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Sm1Exta = 43U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Sm1Exta = 44U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Sm1Exta = 45U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Sm1Exta = 46U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Sm1Exta = 47U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Sm1Exta = 48U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Sm1Exta = 49U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Sm1Exta = 50U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Sm1Exta = 51U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToFlexPwm0Sm1Exta = 52U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToFlexPwm0Sm1Exta = 53U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToFlexPwm0Sm1Exta = 54U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToFlexPwm0Sm1Exta = 55U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToFlexPwm0Sm1Exta = 56U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Sm1Exta = 57U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm0Sm1Exta = 58U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Sm1Exta = 59U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm0Sm1Exta = 60U + (FlexPWM0_SM1_EXTA_REG << PMUX_SHIFT), - - /*!< FlexPWM0_SM2_EXTA input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm0Sm2Exta = 0U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexPwm0Sm2Exta = 1U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToFlexPwm0Sm2Exta = 2U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexPwm0Sm2Exta = 3U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SctOut2ToFlexPwm0Sm2Exta = 4U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Sm2Exta = 5U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Sm2Exta = 6U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Sm2Exta = 7U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexPwm0Sm2Exta = 8U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexPwm0Sm2Exta = 9U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm0Sm2Exta = 11U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm0Sm2Exta = 12U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm0Sm2Exta = 13U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm0Sm2Exta = 14U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm0Sm2Exta = 15U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm0Sm2Exta = 16U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm0Sm2Exta = 17U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm0Sm2Exta = 18U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm0Sm2Exta = 19U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm0Sm2Exta = 20U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Sm2Exta = 21U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Sm2Exta = 22U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexPwm0Sm2Exta = 23U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToFlexPwm0Sm2Exta = 24U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToFlexPwm0Sm2Exta = 25U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToFlexPwm0Sm2Exta = 26U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToFlexPwm0Sm2Exta = 27U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToFlexPwm0Sm2Exta = 28U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToFlexPwm0Sm2Exta = 29U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToFlexPwm0Sm2Exta = 30U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToFlexPwm0Sm2Exta = 31U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm0Sm2Exta = 32U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm0Sm2Exta = 33U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm0Sm2Exta = 34U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm0Sm2Exta = 35U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm0Sm2Exta = 36U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm0Sm2Exta = 37U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm0Sm2Exta = 38U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm0Sm2Exta = 39U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm0Sm2Exta = 40U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm0Sm2Exta = 41U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Sm2Exta = 42U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Sm2Exta = 43U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Sm2Exta = 44U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Sm2Exta = 45U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Sm2Exta = 46U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Sm2Exta = 47U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Sm2Exta = 48U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Sm2Exta = 49U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Sm2Exta = 50U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Sm2Exta = 51U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToFlexPwm0Sm2Exta = 52U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToFlexPwm0Sm2Exta = 53U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToFlexPwm0Sm2Exta = 54U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToFlexPwm0Sm2Exta = 55U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToFlexPwm0Sm2Exta = 56U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Sm2Exta = 57U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm0Sm2Exta = 58U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Sm2Exta = 59U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm0Sm2Exta = 60U + (FlexPWM0_SM2_EXTA_REG << PMUX_SHIFT), - - /*!< FlexPWM0_SM3_EXTA input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm0Sm3Exta = 0U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexPwm0Sm3Exta = 1U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToFlexPwm0Sm3Exta = 2U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexPwm0Sm3Exta = 3U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SctOut2ToFlexPwm0Sm3Exta = 4U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Sm3Exta = 5U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Sm3Exta = 6U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Sm3Exta = 7U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexPwm0Sm3Exta = 8U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexPwm0Sm3Exta = 9U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm0Sm3Exta = 11U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm0Sm3Exta = 12U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm0Sm3Exta = 13U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm0Sm3Exta = 14U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm0Sm3Exta = 15U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm0Sm3Exta = 16U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm0Sm3Exta = 17U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm0Sm3Exta = 18U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm0Sm3Exta = 19U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm0Sm3Exta = 20U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Sm3Exta = 21U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Sm3Exta = 22U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexPwm0Sm3Exta = 23U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToFlexPwm0Sm3Exta = 24U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToFlexPwm0Sm3Exta = 25U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToFlexPwm0Sm3Exta = 26U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToFlexPwm0Sm3Exta = 27U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToFlexPwm0Sm3Exta = 28U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToFlexPwm0Sm3Exta = 29U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToFlexPwm0Sm3Exta = 30U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToFlexPwm0Sm3Exta = 31U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm0Sm3Exta = 32U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm0Sm3Exta = 33U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm0Sm3Exta = 34U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm0Sm3Exta = 35U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm0Sm3Exta = 36U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm0Sm3Exta = 37U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm0Sm3Exta = 38U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm0Sm3Exta = 39U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm0Sm3Exta = 40U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm0Sm3Exta = 41U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Sm3Exta = 42U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Sm3Exta = 43U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Sm3Exta = 44U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Sm3Exta = 45U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Sm3Exta = 46U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Sm3Exta = 47U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Sm3Exta = 48U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Sm3Exta = 49U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Sm3Exta = 50U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Sm3Exta = 51U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToFlexPwm0Sm3Exta = 52U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToFlexPwm0Sm3Exta = 53U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToFlexPwm0Sm3Exta = 54U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToFlexPwm0Sm3Exta = 55U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToFlexPwm0Sm3Exta = 56U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Sm3Exta = 57U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm0Sm3Exta = 58U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Sm3Exta = 59U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm0Sm3Exta = 60U + (FlexPWM0_SM3_EXTA_REG << PMUX_SHIFT), - - /*!< FlexPWM0_EXTFORCE input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm0ExtForce = 0U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexPwm0ExtForce = 1U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToFlexPwm0ExtForce = 2U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexPwm0ExtForce = 3U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_SctOut2ToFlexPwm0ExtForce = 4U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0ExtForce = 5U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0ExtForce = 6U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0ExtForce = 7U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexPwm0ExtForce = 8U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexPwm0ExtForce = 9U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm0ExtForce = 11U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm0ExtForce = 12U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm0ExtForce = 13U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm0ExtForce = 14U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm0ExtForce = 15U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm0ExtForce = 16U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm0ExtForce = 17U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm0ExtForce = 18U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm0ExtForce = 19U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm0ExtForce = 20U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0ExtForce = 21U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0ExtForce = 22U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexPwm0ExtForce = 23U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToFlexPwm0ExtForce = 24U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToFlexPwm0ExtForce = 25U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToFlexPwm0ExtForce = 26U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToFlexPwm0ExtForce = 27U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToFlexPwm0ExtForce = 28U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToFlexPwm0ExtForce = 29U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToFlexPwm0ExtForce = 30U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToFlexPwm0ExtForce = 31U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm0ExtForce = 32U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm0ExtForce = 33U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm0ExtForce = 34U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm0ExtForce = 35U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm0ExtForce = 36U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm0ExtForce = 37U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm0ExtForce = 38U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm0ExtForce = 39U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm0ExtForce = 40U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm0ExtForce = 41U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0ExtForce = 42U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0ExtForce = 43U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0ExtForce = 44U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0ExtForce = 45U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0ExtForce = 46U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0ExtForce = 47U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0ExtForce = 48U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0ExtForce = 49U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0ExtForce = 50U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0ExtForce = 51U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToFlexPwm0ExtForce = 52U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToFlexPwm0ExtForce = 53U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToFlexPwm0ExtForce = 54U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToFlexPwm0ExtForce = 55U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToFlexPwm0ExtForce = 56U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0ExtForce = 57U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm0ExtForce = 58U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0ExtForce = 59U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm0ExtForce = 60U + (FlexPWM0_EXTFORCE_REG << PMUX_SHIFT), - - /*!< FlexPWM0_FAULT0 input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm0Fault0 = 0U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexPwm0Fault0 = 1U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToFlexPwm0Fault0 = 2U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexPwm0Fault0 = 3U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_SctOut2ToFlexPwm0Fault0 = 4U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Fault0 = 5U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Fault0 = 6U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Fault0 = 7U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexPwm0Fault0 = 8U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexPwm0Fault0 = 9U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm0Fault0 = 11U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm0Fault0 = 12U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm0Fault0 = 13U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm0Fault0 = 14U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm0Fault0 = 15U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm0Fault0 = 16U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm0Fault0 = 17U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm0Fault0 = 18U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm0Fault0 = 19U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm0Fault0 = 20U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Fault0 = 21U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Fault0 = 22U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexPwm0Fault0 = 23U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToFlexPwm0Fault0 = 24U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToFlexPwm0Fault0 = 25U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToFlexPwm0Fault0 = 26U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToFlexPwm0Fault0 = 27U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToFlexPwm0Fault0 = 28U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToFlexPwm0Fault0 = 29U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToFlexPwm0Fault0 = 30U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToFlexPwm0Fault0 = 31U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm0Fault0 = 32U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm0Fault0 = 33U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm0Fault0 = 34U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm0Fault0 = 35U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm0Fault0 = 36U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm0Fault0 = 37U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm0Fault0 = 38U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm0Fault0 = 39U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm0Fault0 = 40U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm0Fault0 = 41U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Fault0 = 42U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Fault0 = 43U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Fault0 = 44U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Fault0 = 45U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Fault0 = 46U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Fault0 = 47U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Fault0 = 48U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Fault0 = 49U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Fault0 = 50U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Fault0 = 51U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToFlexPwm0Fault0 = 52U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToFlexPwm0Fault0 = 53U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToFlexPwm0Fault0 = 54U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToFlexPwm0Fault0 = 55U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToFlexPwm0Fault0 = 56U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Fault0 = 57U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm0Fault0 = 58U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Fault0 = 59U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm0Fault0 = 60U + (FlexPWM0_FAULT0_REG << PMUX_SHIFT), - - /*!< FlexPWM0_FAULT1 input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm0Fault1 = 0U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexPwm0Fault1 = 1U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToFlexPwm0Fault1 = 2U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexPwm0Fault1 = 3U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_SctOut2ToFlexPwm0Fault1 = 4U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Fault1 = 5U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Fault1 = 6U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Fault1 = 7U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexPwm0Fault1 = 8U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexPwm0Fault1 = 9U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm0Fault1 = 11U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm0Fault1 = 12U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm0Fault1 = 13U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm0Fault1 = 14U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm0Fault1 = 15U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm0Fault1 = 16U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm0Fault1 = 17U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm0Fault1 = 18U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm0Fault1 = 19U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm0Fault1 = 20U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Fault1 = 21U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Fault1 = 22U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexPwm0Fault1 = 23U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToFlexPwm0Fault1 = 24U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToFlexPwm0Fault1 = 25U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToFlexPwm0Fault1 = 26U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToFlexPwm0Fault1 = 27U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToFlexPwm0Fault1 = 28U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToFlexPwm0Fault1 = 29U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToFlexPwm0Fault1 = 30U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToFlexPwm0Fault1 = 31U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm0Fault1 = 32U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm0Fault1 = 33U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm0Fault1 = 34U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm0Fault1 = 35U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm0Fault1 = 36U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm0Fault1 = 37U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm0Fault1 = 38U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm0Fault1 = 39U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm0Fault1 = 40U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm0Fault1 = 41U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Fault1 = 42U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Fault1 = 43U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Fault1 = 44U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Fault1 = 45U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Fault1 = 46U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Fault1 = 47U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Fault1 = 48U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Fault1 = 49U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Fault1 = 50U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Fault1 = 51U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToFlexPwm0Fault1 = 52U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToFlexPwm0Fault1 = 53U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToFlexPwm0Fault1 = 54U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToFlexPwm0Fault1 = 55U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToFlexPwm0Fault1 = 56U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Fault1 = 57U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm0Fault1 = 58U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Fault1 = 59U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm0Fault1 = 60U + (FlexPWM0_FAULT1_REG << PMUX_SHIFT), - - /*!< FlexPWM0_FAULT2 input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm0Fault2 = 0U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexPwm0Fault2 = 1U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToFlexPwm0Fault2 = 2U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexPwm0Fault2 = 3U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_SctOut2ToFlexPwm0Fault2 = 4U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Fault2 = 5U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Fault2 = 6U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Fault2 = 7U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexPwm0Fault2 = 8U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexPwm0Fault2 = 9U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm0Fault2 = 11U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm0Fault2 = 12U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm0Fault2 = 13U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm0Fault2 = 14U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm0Fault2 = 15U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm0Fault2 = 16U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm0Fault2 = 17U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm0Fault2 = 18U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm0Fault2 = 19U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm0Fault2 = 20U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Fault2 = 21U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Fault2 = 22U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexPwm0Fault2 = 23U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToFlexPwm0Fault2 = 24U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToFlexPwm0Fault2 = 25U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToFlexPwm0Fault2 = 26U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToFlexPwm0Fault2 = 27U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToFlexPwm0Fault2 = 28U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToFlexPwm0Fault2 = 29U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToFlexPwm0Fault2 = 30U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToFlexPwm0Fault2 = 31U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm0Fault2 = 32U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm0Fault2 = 33U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm0Fault2 = 34U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm0Fault2 = 35U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm0Fault2 = 36U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm0Fault2 = 37U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm0Fault2 = 38U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm0Fault2 = 39U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm0Fault2 = 40U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm0Fault2 = 41U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Fault2 = 42U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Fault2 = 43U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Fault2 = 44U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Fault2 = 45U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Fault2 = 46U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Fault2 = 47U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Fault2 = 48U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Fault2 = 49U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Fault2 = 50U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Fault2 = 51U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToFlexPwm0Fault2 = 52U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToFlexPwm0Fault2 = 53U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToFlexPwm0Fault2 = 54U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToFlexPwm0Fault2 = 55U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToFlexPwm0Fault2 = 56U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Fault2 = 57U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm0Fault2 = 58U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Fault2 = 59U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm0Fault2 = 60U + (FlexPWM0_FAULT2_REG << PMUX_SHIFT), - - /*!< FlexPWM0_FAULT3 input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm0Fault3 = 0U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexPwm0Fault3 = 1U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToFlexPwm0Fault3 = 2U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexPwm0Fault3 = 3U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_SctOut2ToFlexPwm0Fault3 = 4U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm0Fault3 = 5U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm0Fault3 = 6U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm0Fault3 = 7U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexPwm0Fault3 = 8U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexPwm0Fault3 = 9U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm0Fault3 = 11U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm0Fault3 = 12U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm0Fault3 = 13U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm0Fault3 = 14U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm0Fault3 = 15U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm0Fault3 = 16U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm0Fault3 = 17U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm0Fault3 = 18U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm0Fault3 = 19U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm0Fault3 = 20U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm0Fault3 = 21U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm0Fault3 = 22U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexPwm0Fault3 = 23U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToFlexPwm0Fault3 = 24U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToFlexPwm0Fault3 = 25U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToFlexPwm0Fault3 = 26U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToFlexPwm0Fault3 = 27U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToFlexPwm0Fault3 = 28U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToFlexPwm0Fault3 = 29U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToFlexPwm0Fault3 = 30U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToFlexPwm0Fault3 = 31U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm0Fault3 = 32U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm0Fault3 = 33U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm0Fault3 = 34U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm0Fault3 = 35U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm0Fault3 = 36U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm0Fault3 = 37U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm0Fault3 = 38U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm0Fault3 = 39U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm0Fault3 = 40U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm0Fault3 = 41U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm0Fault3 = 42U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm0Fault3 = 43U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm0Fault3 = 44U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm0Fault3 = 45U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm0Fault3 = 46U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm0Fault3 = 47U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm0Fault3 = 48U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm0Fault3 = 49U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm0Fault3 = 50U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm0Fault3 = 51U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToFlexPwm0Fault3 = 52U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToFlexPwm0Fault3 = 53U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToFlexPwm0Fault3 = 54U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToFlexPwm0Fault3 = 55U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToFlexPwm0Fault3 = 56U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm0Fault3 = 57U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm0Fault3 = 58U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm0Fault3 = 59U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm0Fault3 = 60U + (FlexPWM0_FAULT3_REG << PMUX_SHIFT), - - /*!< FlexPWM1_SM0_EXTSYNC input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm1Sm0ExtSync = 0U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_PinInt2ToFlexPwm1Sm0ExtSync = 1U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToFlexPwm1Sm0ExtSync = 2U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexPwm1Sm0ExtSync = 3U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SctOut3ToFlexPwm1Sm0ExtSync = 4U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Sm0ExtSync = 5U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Sm0ExtSync = 6U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Sm0ExtSync = 7U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexPwm1Sm0ExtSync = 8U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexPwm1Sm0ExtSync = 9U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm1Sm0ExtSync = 11U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm1Sm0ExtSync = 12U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm1Sm0ExtSync = 13U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm1Sm0ExtSync = 14U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm1Sm0ExtSync = 15U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm1Sm0ExtSync = 16U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm1Sm0ExtSync = 17U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm1Sm0ExtSync = 18U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm1Sm0ExtSync = 19U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm1Sm0ExtSync = 20U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Sm0ExtSync = 21U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Sm0ExtSync = 22U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexPwm1Sm0ExtSync = 23U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToFlexPwm1Sm0ExtSync = 24U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToFlexPwm1Sm0ExtSync = 25U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToFlexPwm1Sm0ExtSync = 26U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToFlexPwm1Sm0ExtSync = 27U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToFlexPwm1Sm0ExtSync = 28U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToFlexPwm1Sm0ExtSync = 29U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToFlexPwm1Sm0ExtSync = 30U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToFlexPwm1Sm0ExtSync = 31U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm1Sm0ExtSync = 32U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm1Sm0ExtSync = 33U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm1Sm0ExtSync = 34U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm1Sm0ExtSync = 35U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm1Sm0ExtSync = 36U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm1Sm0ExtSync = 37U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm1Sm0ExtSync = 38U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm1Sm0ExtSync = 39U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm1Sm0ExtSync = 40U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm1Sm0ExtSync = 41U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Sm0ExtSync = 42U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Sm0ExtSync = 43U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Sm0ExtSync = 44U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Sm0ExtSync = 45U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Sm0ExtSync = 46U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Sm0ExtSync = 47U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Sm0ExtSync = 48U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Sm0ExtSync = 49U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Sm0ExtSync = 50U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Sm0ExtSync = 51U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToFlexPwm1Sm0ExtSync = 52U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToFlexPwm1Sm0ExtSync = 53U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToFlexPwm1Sm0ExtSync = 54U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToFlexPwm1Sm0ExtSync = 55U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToFlexPwm1Sm0ExtSync = 56U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Sm0ExtSync = 57U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm1Sm0ExtSync = 58U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Sm0ExtSync = 59U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm1Sm0ExtSync = 60U + (FlexPWM1_SM0_EXTSYNC_REG << PMUX_SHIFT), - - /*!< FlexPWM1_SM1_EXTSYNC input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm1Sm1ExtSync = 0U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_PinInt2ToFlexPwm1Sm1ExtSync = 1U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToFlexPwm1Sm1ExtSync = 2U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexPwm1Sm1ExtSync = 3U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SctOut3ToFlexPwm1Sm1ExtSync = 4U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Sm1ExtSync = 5U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Sm1ExtSync = 6U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Sm1ExtSync = 7U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexPwm1Sm1ExtSync = 8U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexPwm1Sm1ExtSync = 9U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm1Sm1ExtSync = 11U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm1Sm1ExtSync = 12U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm1Sm1ExtSync = 13U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm1Sm1ExtSync = 14U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm1Sm1ExtSync = 15U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm1Sm1ExtSync = 16U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm1Sm1ExtSync = 17U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm1Sm1ExtSync = 18U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm1Sm1ExtSync = 19U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm1Sm1ExtSync = 20U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Sm1ExtSync = 21U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Sm1ExtSync = 22U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexPwm1Sm1ExtSync = 23U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToFlexPwm1Sm1ExtSync = 24U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToFlexPwm1Sm1ExtSync = 25U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToFlexPwm1Sm1ExtSync = 26U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToFlexPwm1Sm1ExtSync = 27U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToFlexPwm1Sm1ExtSync = 28U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToFlexPwm1Sm1ExtSync = 29U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToFlexPwm1Sm1ExtSync = 30U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToFlexPwm1Sm1ExtSync = 31U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm1Sm1ExtSync = 32U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm1Sm1ExtSync = 33U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm1Sm1ExtSync = 34U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm1Sm1ExtSync = 35U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm1Sm1ExtSync = 36U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm1Sm1ExtSync = 37U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm1Sm1ExtSync = 38U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm1Sm1ExtSync = 39U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm1Sm1ExtSync = 40U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm1Sm1ExtSync = 41U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Sm1ExtSync = 42U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Sm1ExtSync = 43U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Sm1ExtSync = 44U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Sm1ExtSync = 45U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Sm1ExtSync = 46U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Sm1ExtSync = 47U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Sm1ExtSync = 48U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Sm1ExtSync = 49U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Sm1ExtSync = 50U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Sm1ExtSync = 51U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToFlexPwm1Sm1ExtSync = 52U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToFlexPwm1Sm1ExtSync = 53U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToFlexPwm1Sm1ExtSync = 54U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToFlexPwm1Sm1ExtSync = 55U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToFlexPwm1Sm1ExtSync = 56U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Sm1ExtSync = 57U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm1Sm1ExtSync = 58U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Sm1ExtSync = 59U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm1Sm1ExtSync = 60U + (FlexPWM1_SM1_EXTSYNC_REG << PMUX_SHIFT), - - /*!< FlexPWM1_SM2_EXTSYNC2 input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm1Sm2ExtSync = 0U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_PinInt2ToFlexPwm1Sm2ExtSync = 1U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToFlexPwm1Sm2ExtSync = 2U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexPwm1Sm2ExtSync = 3U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SctOut3ToFlexPwm1Sm2ExtSync = 4U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Sm2ExtSync = 5U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Sm2ExtSync = 6U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Sm2ExtSync = 7U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexPwm1Sm2ExtSync = 8U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexPwm1Sm2ExtSync = 9U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm1Sm2ExtSync = 11U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm1Sm2ExtSync = 12U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm1Sm2ExtSync = 13U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm1Sm2ExtSync = 14U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm1Sm2ExtSync = 15U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm1Sm2ExtSync = 16U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm1Sm2ExtSync = 17U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm1Sm2ExtSync = 18U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm1Sm2ExtSync = 19U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm1Sm2ExtSync = 20U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Sm2ExtSync = 21U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Sm2ExtSync = 22U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexPwm1Sm2ExtSync = 23U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToFlexPwm1Sm2ExtSync = 24U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToFlexPwm1Sm2ExtSync = 25U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToFlexPwm1Sm2ExtSync = 26U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToFlexPwm1Sm2ExtSync = 27U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToFlexPwm1Sm2ExtSync = 28U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToFlexPwm1Sm2ExtSync = 29U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToFlexPwm1Sm2ExtSync = 30U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToFlexPwm1Sm2ExtSync = 31U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm1Sm2ExtSync = 32U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm1Sm2ExtSync = 33U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm1Sm2ExtSync = 34U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm1Sm2ExtSync = 35U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm1Sm2ExtSync = 36U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm1Sm2ExtSync = 37U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm1Sm2ExtSync = 38U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm1Sm2ExtSync = 39U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm1Sm2ExtSync = 40U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm1Sm2ExtSync = 41U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Sm2ExtSync = 42U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Sm2ExtSync = 43U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Sm2ExtSync = 44U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Sm2ExtSync = 45U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Sm2ExtSync = 46U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Sm2ExtSync = 47U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Sm2ExtSync = 48U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Sm2ExtSync = 49U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Sm2ExtSync = 50U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Sm2ExtSync = 51U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToFlexPwm1Sm2ExtSync = 52U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToFlexPwm1Sm2ExtSync = 53U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToFlexPwm1Sm2ExtSync = 54U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToFlexPwm1Sm2ExtSync = 55U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToFlexPwm1Sm2ExtSync = 56U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Sm2ExtSync = 57U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm1Sm2ExtSync = 58U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Sm2ExtSync = 59U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm1Sm2ExtSync = 60U + (FlexPWM1_SM2_EXTSYNC_REG << PMUX_SHIFT), - - /*!< FlexPWM1_SM3_EXTSYNC input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm1Sm3ExtSync = 0U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_PinInt2ToFlexPwm1Sm3ExtSync = 1U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToFlexPwm1Sm3ExtSync = 2U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexPwm1Sm3ExtSync = 3U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SctOut3ToFlexPwm1Sm3ExtSync = 4U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Sm3ExtSync = 5U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Sm3ExtSync = 6U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Sm3ExtSync = 7U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexPwm1Sm3ExtSync = 8U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexPwm1Sm3ExtSync = 9U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm1Sm3ExtSync = 11U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm1Sm3ExtSync = 12U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm1Sm3ExtSync = 13U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm1Sm3ExtSync = 14U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm1Sm3ExtSync = 15U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm1Sm3ExtSync = 16U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm1Sm3ExtSync = 17U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm1Sm3ExtSync = 18U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm1Sm3ExtSync = 19U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm1Sm3ExtSync = 20U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Sm3ExtSync = 21U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Sm3ExtSync = 22U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexPwm1Sm3ExtSync = 23U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToFlexPwm1Sm3ExtSync = 24U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToFlexPwm1Sm3ExtSync = 25U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToFlexPwm1Sm3ExtSync = 26U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToFlexPwm1Sm3ExtSync = 27U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToFlexPwm1Sm3ExtSync = 28U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToFlexPwm1Sm3ExtSync = 29U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToFlexPwm1Sm3ExtSync = 30U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToFlexPwm1Sm3ExtSync = 31U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm1Sm3ExtSync = 32U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm1Sm3ExtSync = 33U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm1Sm3ExtSync = 34U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm1Sm3ExtSync = 35U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm1Sm3ExtSync = 36U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm1Sm3ExtSync = 37U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm1Sm3ExtSync = 38U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm1Sm3ExtSync = 39U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm1Sm3ExtSync = 40U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm1Sm3ExtSync = 41U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Sm3ExtSync = 42U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Sm3ExtSync = 43U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Sm3ExtSync = 44U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Sm3ExtSync = 45U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Sm3ExtSync = 46U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Sm3ExtSync = 47U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Sm3ExtSync = 48U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Sm3ExtSync = 49U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Sm3ExtSync = 50U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Sm3ExtSync = 51U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToFlexPwm1Sm3ExtSync = 52U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToFlexPwm1Sm3ExtSync = 53U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToFlexPwm1Sm3ExtSync = 54U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToFlexPwm1Sm3ExtSync = 55U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToFlexPwm1Sm3ExtSync = 56U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Sm3ExtSync = 57U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm1Sm3ExtSync = 58U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Sm3ExtSync = 59U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm1Sm3ExtSync = 60U + (FlexPWM1_SM3_EXTSYNC_REG << PMUX_SHIFT), - - /*!< FlexPWM1_SM0_EXTA input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm1Sm0Exta = 0U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_PinInt2ToFlexPwm1Sm0Exta = 1U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToFlexPwm1Sm0Exta = 2U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexPwm1Sm0Exta = 3U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SctOut3ToFlexPwm1Sm0Exta = 4U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Sm0Exta = 5U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Sm0Exta = 6U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Sm0Exta = 7U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexPwm1Sm0Exta = 8U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexPwm1Sm0Exta = 9U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm1Sm0Exta = 11U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm1Sm0Exta = 12U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm1Sm0Exta = 13U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm1Sm0Exta = 14U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm1Sm0Exta = 15U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm1Sm0Exta = 16U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm1Sm0Exta = 17U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm1Sm0Exta = 18U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm1Sm0Exta = 19U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm1Sm0Exta = 20U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Sm0Exta = 21U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Sm0Exta = 22U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexPwm1Sm0Exta = 23U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToFlexPwm1Sm0Exta = 24U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToFlexPwm1Sm0Exta = 25U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToFlexPwm1Sm0Exta = 26U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToFlexPwm1Sm0Exta = 27U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToFlexPwm1Sm0Exta = 28U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToFlexPwm1Sm0Exta = 29U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToFlexPwm1Sm0Exta = 30U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToFlexPwm1Sm0Exta = 31U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm1Sm0Exta = 32U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm1Sm0Exta = 33U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm1Sm0Exta = 34U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm1Sm0Exta = 35U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm1Sm0Exta = 36U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm1Sm0Exta = 37U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm1Sm0Exta = 38U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm1Sm0Exta = 39U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm1Sm0Exta = 40U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm1Sm0Exta = 41U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Sm0Exta = 42U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Sm0Exta = 43U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Sm0Exta = 44U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Sm0Exta = 45U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Sm0Exta = 46U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Sm0Exta = 47U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Sm0Exta = 48U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Sm0Exta = 49U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Sm0Exta = 50U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Sm0Exta = 51U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToFlexPwm1Sm0Exta = 52U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToFlexPwm1Sm0Exta = 53U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToFlexPwm1Sm0Exta = 54U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToFlexPwm1Sm0Exta = 55U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToFlexPwm1Sm0Exta = 56U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Sm0Exta = 57U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm1Sm0Exta = 58U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Sm0Exta = 59U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm1Sm0Exta = 60U + (FlexPWM1_SM0_EXTA_REG << PMUX_SHIFT), - - /*!< FlexPWM1_SM1_EXTA input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm1Sm1Exta = 0U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_PinInt2ToFlexPwm1Sm1Exta = 1U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToFlexPwm1Sm1Exta = 2U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexPwm1Sm1Exta = 3U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SctOut3ToFlexPwm1Sm1Exta = 4U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Sm1Exta = 5U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Sm1Exta = 6U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Sm1Exta = 7U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexPwm1Sm1Exta = 8U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexPwm1Sm1Exta = 9U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm1Sm1Exta = 11U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm1Sm1Exta = 12U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm1Sm1Exta = 13U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm1Sm1Exta = 14U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm1Sm1Exta = 15U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm1Sm1Exta = 16U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm1Sm1Exta = 17U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm1Sm1Exta = 18U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm1Sm1Exta = 19U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm1Sm1Exta = 20U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Sm1Exta = 21U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Sm1Exta = 22U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexPwm1Sm1Exta = 23U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToFlexPwm1Sm1Exta = 24U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToFlexPwm1Sm1Exta = 25U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToFlexPwm1Sm1Exta = 26U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToFlexPwm1Sm1Exta = 27U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToFlexPwm1Sm1Exta = 28U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToFlexPwm1Sm1Exta = 29U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToFlexPwm1Sm1Exta = 30U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToFlexPwm1Sm1Exta = 31U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm1Sm1Exta = 32U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm1Sm1Exta = 33U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm1Sm1Exta = 34U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm1Sm1Exta = 35U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm1Sm1Exta = 36U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm1Sm1Exta = 37U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm1Sm1Exta = 38U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm1Sm1Exta = 39U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm1Sm1Exta = 40U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm1Sm1Exta = 41U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Sm1Exta = 42U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Sm1Exta = 43U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Sm1Exta = 44U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Sm1Exta = 45U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Sm1Exta = 46U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Sm1Exta = 47U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Sm1Exta = 48U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Sm1Exta = 49U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Sm1Exta = 50U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Sm1Exta = 51U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToFlexPwm1Sm1Exta = 52U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToFlexPwm1Sm1Exta = 53U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToFlexPwm1Sm1Exta = 54U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToFlexPwm1Sm1Exta = 55U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToFlexPwm1Sm1Exta = 56U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Sm1Exta = 57U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm1Sm1Exta = 58U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Sm1Exta = 59U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm1Sm1Exta = 60U + (FlexPWM1_SM1_EXTA_REG << PMUX_SHIFT), - - /*!< FlexPWM1_SM2_EXTA input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm1Sm2Exta = 0U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_PinInt2ToFlexPwm1Sm2Exta = 1U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToFlexPwm1Sm2Exta = 2U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexPwm1Sm2Exta = 3U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SctOut3ToFlexPwm1Sm2Exta = 4U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Sm2Exta = 5U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Sm2Exta = 6U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Sm2Exta = 7U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexPwm1Sm2Exta = 8U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexPwm1Sm2Exta = 9U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm1Sm2Exta = 11U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm1Sm2Exta = 12U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm1Sm2Exta = 13U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm1Sm2Exta = 14U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm1Sm2Exta = 15U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm1Sm2Exta = 16U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm1Sm2Exta = 17U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm1Sm2Exta = 18U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm1Sm2Exta = 19U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm1Sm2Exta = 20U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Sm2Exta = 21U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Sm2Exta = 22U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexPwm1Sm2Exta = 23U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToFlexPwm1Sm2Exta = 24U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToFlexPwm1Sm2Exta = 25U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToFlexPwm1Sm2Exta = 26U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToFlexPwm1Sm2Exta = 27U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToFlexPwm1Sm2Exta = 28U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToFlexPwm1Sm2Exta = 29U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToFlexPwm1Sm2Exta = 30U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToFlexPwm1Sm2Exta = 31U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm1Sm2Exta = 32U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm1Sm2Exta = 33U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm1Sm2Exta = 34U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm1Sm2Exta = 35U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm1Sm2Exta = 36U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm1Sm2Exta = 37U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm1Sm2Exta = 38U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm1Sm2Exta = 39U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm1Sm2Exta = 40U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm1Sm2Exta = 41U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Sm2Exta = 42U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Sm2Exta = 43U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Sm2Exta = 44U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Sm2Exta = 45U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Sm2Exta = 46U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Sm2Exta = 47U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Sm2Exta = 48U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Sm2Exta = 49U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Sm2Exta = 50U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Sm2Exta = 51U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToFlexPwm1Sm2Exta = 52U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToFlexPwm1Sm2Exta = 53U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToFlexPwm1Sm2Exta = 54U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToFlexPwm1Sm2Exta = 55U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToFlexPwm1Sm2Exta = 56U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Sm2Exta = 57U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm1Sm2Exta = 58U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Sm2Exta = 59U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm1Sm2Exta = 60U + (FlexPWM1_SM2_EXTA_REG << PMUX_SHIFT), - - /*!< FlexPWM1_SM3_EXTA input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm1Sm3Exta = 0U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_PinInt2ToFlexPwm1Sm3Exta = 1U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToFlexPwm1Sm3Exta = 2U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexPwm1Sm3Exta = 3U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SctOut3ToFlexPwm1Sm3Exta = 4U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Sm3Exta = 5U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Sm3Exta = 6U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Sm3Exta = 7U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexPwm1Sm3Exta = 8U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexPwm1Sm3Exta = 9U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm1Sm3Exta = 11U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm1Sm3Exta = 12U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm1Sm3Exta = 13U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm1Sm3Exta = 14U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm1Sm3Exta = 15U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm1Sm3Exta = 16U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm1Sm3Exta = 17U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm1Sm3Exta = 18U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm1Sm3Exta = 19U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm1Sm3Exta = 20U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Sm3Exta = 21U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Sm3Exta = 22U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexPwm1Sm3Exta = 23U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToFlexPwm1Sm3Exta = 24U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToFlexPwm1Sm3Exta = 25U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToFlexPwm1Sm3Exta = 26U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToFlexPwm1Sm3Exta = 27U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToFlexPwm1Sm3Exta = 28U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToFlexPwm1Sm3Exta = 29U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToFlexPwm1Sm3Exta = 30U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToFlexPwm1Sm3Exta = 31U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm1Sm3Exta = 32U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm1Sm3Exta = 33U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm1Sm3Exta = 34U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm1Sm3Exta = 35U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm1Sm3Exta = 36U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm1Sm3Exta = 37U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm1Sm3Exta = 38U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm1Sm3Exta = 39U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm1Sm3Exta = 40U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm1Sm3Exta = 41U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Sm3Exta = 42U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Sm3Exta = 43U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Sm3Exta = 44U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Sm3Exta = 45U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Sm3Exta = 46U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Sm3Exta = 47U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Sm3Exta = 48U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Sm3Exta = 49U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Sm3Exta = 50U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Sm3Exta = 51U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToFlexPwm1Sm3Exta = 52U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToFlexPwm1Sm3Exta = 53U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToFlexPwm1Sm3Exta = 54U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToFlexPwm1Sm3Exta = 55U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToFlexPwm1Sm3Exta = 56U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Sm3Exta = 57U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm1Sm3Exta = 58U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Sm3Exta = 59U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm1Sm3Exta = 60U + (FlexPWM1_SM3_EXTA_REG << PMUX_SHIFT), - - /*!< FlexPWM1_EXTFORCE input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm1ExtForce = 0U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_PinInt2ToFlexPwm1ExtForce = 1U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToFlexPwm1ExtForce = 2U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexPwm1ExtForce = 3U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_SctOut3ToFlexPwm1ExtForce = 4U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1ExtForce = 5U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1ExtForce = 6U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1ExtForce = 7U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexPwm1ExtForce = 8U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexPwm1ExtForce = 9U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm1ExtForce = 11U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm1ExtForce = 12U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm1ExtForce = 13U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm1ExtForce = 14U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm1ExtForce = 15U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm1ExtForce = 16U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm1ExtForce = 17U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm1ExtForce = 18U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm1ExtForce = 19U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm1ExtForce = 20U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1ExtForce = 21U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1ExtForce = 22U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexPwm1ExtForce = 23U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToFlexPwm1ExtForce = 24U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToFlexPwm1ExtForce = 25U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToFlexPwm1ExtForce = 26U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToFlexPwm1ExtForce = 27U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToFlexPwm1ExtForce = 28U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToFlexPwm1ExtForce = 29U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToFlexPwm1ExtForce = 30U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToFlexPwm1ExtForce = 31U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm1ExtForce = 32U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm1ExtForce = 33U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm1ExtForce = 34U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm1ExtForce = 35U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm1ExtForce = 36U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm1ExtForce = 37U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm1ExtForce = 38U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm1ExtForce = 39U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm1ExtForce = 40U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm1ExtForce = 41U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1ExtForce = 42U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1ExtForce = 43U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1ExtForce = 44U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1ExtForce = 45U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1ExtForce = 46U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1ExtForce = 47U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1ExtForce = 48U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1ExtForce = 49U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1ExtForce = 50U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1ExtForce = 51U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToFlexPwm1ExtForce = 52U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToFlexPwm1ExtForce = 53U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToFlexPwm1ExtForce = 54U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToFlexPwm1ExtForce = 55U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToFlexPwm1ExtForce = 56U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1ExtForce = 57U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm1ExtForce = 58U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1ExtForce = 59U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm1ExtForce = 60U + (FlexPWM1_EXTFORCE_REG << PMUX_SHIFT), - - /*!< FlexPWM1_FAULT0 input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm1Fault0 = 0U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_PinInt2ToFlexPwm1Fault0 = 1U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToFlexPwm1Fault0 = 2U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexPwm1Fault0 = 3U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_SctOut3ToFlexPwm1Fault0 = 4U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Fault0 = 5U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Fault0 = 6U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Fault0 = 7U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexPwm1Fault0 = 8U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexPwm1Fault0 = 9U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm1Fault0 = 11U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm1Fault0 = 12U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm1Fault0 = 13U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm1Fault0 = 14U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm1Fault0 = 15U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm1Fault0 = 16U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm1Fault0 = 17U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm1Fault0 = 18U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm1Fault0 = 19U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm1Fault0 = 20U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Fault0 = 21U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Fault0 = 22U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexPwm1Fault0 = 23U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToFlexPwm1Fault0 = 24U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToFlexPwm1Fault0 = 25U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToFlexPwm1Fault0 = 26U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToFlexPwm1Fault0 = 27U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToFlexPwm1Fault0 = 28U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToFlexPwm1Fault0 = 29U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToFlexPwm1Fault0 = 30U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToFlexPwm1Fault0 = 31U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm1Fault0 = 32U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm1Fault0 = 33U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm1Fault0 = 34U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm1Fault0 = 35U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm1Fault0 = 36U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm1Fault0 = 37U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm1Fault0 = 38U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm1Fault0 = 39U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm1Fault0 = 40U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm1Fault0 = 41U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Fault0 = 42U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Fault0 = 43U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Fault0 = 44U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Fault0 = 45U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Fault0 = 46U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Fault0 = 47U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Fault0 = 48U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Fault0 = 49U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Fault0 = 50U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Fault0 = 51U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToFlexPwm1Fault0 = 52U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToFlexPwm1Fault0 = 53U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToFlexPwm1Fault0 = 54U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToFlexPwm1Fault0 = 55U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToFlexPwm1Fault0 = 56U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Fault0 = 57U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm1Fault0 = 58U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Fault0 = 59U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm1Fault0 = 60U + (FlexPWM1_FAULT0_REG << PMUX_SHIFT), - - /*!< FlexPWM1_FAULT1 input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm1Fault1 = 0U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_PinInt2ToFlexPwm1Fault1 = 1U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToFlexPwm1Fault1 = 2U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexPwm1Fault1 = 3U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_SctOut3ToFlexPwm1Fault1 = 4U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Fault1 = 5U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Fault1 = 6U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Fault1 = 7U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexPwm1Fault1 = 8U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexPwm1Fault1 = 9U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm1Fault1 = 11U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm1Fault1 = 12U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm1Fault1 = 13U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm1Fault1 = 14U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm1Fault1 = 15U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm1Fault1 = 16U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm1Fault1 = 17U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm1Fault1 = 18U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm1Fault1 = 19U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm1Fault1 = 20U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Fault1 = 21U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Fault1 = 22U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexPwm1Fault1 = 23U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToFlexPwm1Fault1 = 24U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToFlexPwm1Fault1 = 25U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToFlexPwm1Fault1 = 26U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToFlexPwm1Fault1 = 27U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToFlexPwm1Fault1 = 28U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToFlexPwm1Fault1 = 29U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToFlexPwm1Fault1 = 30U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToFlexPwm1Fault1 = 31U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm1Fault1 = 32U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm1Fault1 = 33U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm1Fault1 = 34U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm1Fault1 = 35U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm1Fault1 = 36U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm1Fault1 = 37U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm1Fault1 = 38U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm1Fault1 = 39U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm1Fault1 = 40U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm1Fault1 = 41U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Fault1 = 42U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Fault1 = 43U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Fault1 = 44U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Fault1 = 45U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Fault1 = 46U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Fault1 = 47U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Fault1 = 48U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Fault1 = 49U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Fault1 = 50U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Fault1 = 51U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToFlexPwm1Fault1 = 52U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToFlexPwm1Fault1 = 53U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToFlexPwm1Fault1 = 54U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToFlexPwm1Fault1 = 55U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToFlexPwm1Fault1 = 56U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Fault1 = 57U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm1Fault1 = 58U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Fault1 = 59U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm1Fault1 = 60U + (FlexPWM1_FAULT1_REG << PMUX_SHIFT), - - /*!< FlexPWM1_FAULT2 input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm1Fault2 = 0U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_PinInt2ToFlexPwm1Fault2 = 1U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToFlexPwm1Fault2 = 2U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexPwm1Fault2 = 3U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_SctOut3ToFlexPwm1Fault2 = 4U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Fault2 = 5U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Fault2 = 6U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Fault2 = 7U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexPwm1Fault2 = 8U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexPwm1Fault2 = 9U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm1Fault2 = 11U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm1Fault2 = 12U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm1Fault2 = 13U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm1Fault2 = 14U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm1Fault2 = 15U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm1Fault2 = 16U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm1Fault2 = 17U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm1Fault2 = 18U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm1Fault2 = 19U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm1Fault2 = 20U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Fault2 = 21U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Fault2 = 22U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexPwm1Fault2 = 23U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToFlexPwm1Fault2 = 24U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToFlexPwm1Fault2 = 25U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToFlexPwm1Fault2 = 26U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToFlexPwm1Fault2 = 27U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToFlexPwm1Fault2 = 28U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToFlexPwm1Fault2 = 29U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToFlexPwm1Fault2 = 30U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToFlexPwm1Fault2 = 31U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm1Fault2 = 32U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm1Fault2 = 33U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm1Fault2 = 34U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm1Fault2 = 35U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm1Fault2 = 36U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm1Fault2 = 37U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm1Fault2 = 38U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm1Fault2 = 39U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm1Fault2 = 40U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm1Fault2 = 41U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Fault2 = 42U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Fault2 = 43U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Fault2 = 44U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Fault2 = 45U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Fault2 = 46U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Fault2 = 47U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Fault2 = 48U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Fault2 = 49U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Fault2 = 50U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Fault2 = 51U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToFlexPwm1Fault2 = 52U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToFlexPwm1Fault2 = 53U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToFlexPwm1Fault2 = 54U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToFlexPwm1Fault2 = 55U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToFlexPwm1Fault2 = 56U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Fault2 = 57U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm1Fault2 = 58U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Fault2 = 59U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm1Fault2 = 60U + (FlexPWM1_FAULT2_REG << PMUX_SHIFT), - - /*!< FlexPWM1_FAULT3 input trigger connections. */ - kINPUTMUX_PinInt0ToFlexPwm1Fault3 = 0U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_PinInt2ToFlexPwm1Fault3 = 1U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToFlexPwm1Fault3 = 2U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexPwm1Fault3 = 3U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_SctOut3ToFlexPwm1Fault3 = 4U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToFlexPwm1Fault3 = 5U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToFlexPwm1Fault3 = 6U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexPwm1Fault3 = 7U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexPwm1Fault3 = 8U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexPwm1Fault3 = 9U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexPwm1Fault3 = 11U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexPwm1Fault3 = 12U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexPwm1Fault3 = 13U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexPwm1Fault3 = 14U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexPwm1Fault3 = 15U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexPwm1Fault3 = 16U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexPwm1Fault3 = 17U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexPwm1Fault3 = 18U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexPwm1Fault3 = 19U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexPwm1Fault3 = 20U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexPwm1Fault3 = 21U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexPwm1Fault3 = 22U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexPwm1Fault3 = 23U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToFlexPwm1Fault3 = 24U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToFlexPwm1Fault3 = 25U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToFlexPwm1Fault3 = 26U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToFlexPwm1Fault3 = 27U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToFlexPwm1Fault3 = 28U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToFlexPwm1Fault3 = 29U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToFlexPwm1Fault3 = 30U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToFlexPwm1Fault3 = 31U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToFlexPwm1Fault3 = 32U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToFlexPwm1Fault3 = 33U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexPwm1Fault3 = 34U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexPwm1Fault3 = 35U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexPwm1Fault3 = 36U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexPwm1Fault3 = 37U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexPwm1Fault3 = 38U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexPwm1Fault3 = 39U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexPwm1Fault3 = 40U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexPwm1Fault3 = 41U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexPwm1Fault3 = 42U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexPwm1Fault3 = 43U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexPwm1Fault3 = 44U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexPwm1Fault3 = 45U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexPwm1Fault3 = 46U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn5ToFlexPwm1Fault3 = 47U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn6ToFlexPwm1Fault3 = 48U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn7ToFlexPwm1Fault3 = 49U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn8ToFlexPwm1Fault3 = 50U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn9ToFlexPwm1Fault3 = 51U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToFlexPwm1Fault3 = 52U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToFlexPwm1Fault3 = 53U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToFlexPwm1Fault3 = 54U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToFlexPwm1Fault3 = 55U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToFlexPwm1Fault3 = 56U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexPwm1Fault3 = 57U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexPwm1Fault3 = 58U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexPwm1Fault3 = 59U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexPwm1Fault3 = 60U + (FlexPWM1_FAULT3_REG << PMUX_SHIFT), - - /*!< PWM0 external clock trigger. */ - kINPUTMUX_Fro16KToPwm0ExtClk = 0U + (PWM0_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_Osc32KToPwm0ExtClk = 1U + (PWM0_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToPwm0ExtClk = 2U + (PWM0_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToPwm0ExtClk = 3U + (PWM0_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_ExttrigIn0ToPwm0ExtClk = 4U + (PWM0_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_ExttrigIn1ToPwm0ExtClk = 5U + (PWM0_EXT_CLK_REG << PMUX_SHIFT), - - /*!< PWM1 external clock trigger. */ - kINPUTMUX_Fro16KToPwm1ExtClk = 0U + (PWM1_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_Osc32KToPwm1ExtClk = 1U + (PWM1_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToPwm1ExtClk = 2U + (PWM1_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToPwm1ExtClk = 3U + (PWM1_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_ExttrigIn0ToPwm1ExtClk = 4U + (PWM1_EXT_CLK_REG << PMUX_SHIFT), - kINPUTMUX_ExttrigIn1ToPwm1ExtClk = 5U + (PWM1_EXT_CLK_REG << PMUX_SHIFT), - - /*!< EVTG trigger input connections. */ - kINPUTMUX_PinInt0ToEvtgTrigger = 0U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_PinInt1ToEvtgTrigger = 1U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_SctOut0ToEvtgTrigger = 2U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_SctOut1ToEvtgTrigger = 3U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_SctOut2ToEvtgTrigger = 4U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_SctOut3ToEvtgTrigger = 5U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToEvtgTrigger = 6U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToEvtgTrigger = 7U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToEvtgTrigger = 8U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToEvtgTrigger = 9U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToEvtgTrigger = 10U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToEvtgTrigger = 11U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToEvtgTrigger = 13U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0IrqToEvtgTrigger = 14U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1IrqToEvtgTrigger = 15U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToEvtgTrigger = 16U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToEvtgTrigger = 17U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToEvtgTrigger = 18U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToEvtgTrigger = 19U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToEvtgTrigger = 20U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToEvtgTrigger = 21U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToEvtgTrigger = 22U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToEvtgTrigger = 23U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToEvtgTrigger = 24U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToEvtgTrigger = 25U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToEvtgTrigger = 26U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToEvtgTrigger = 27U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToEvtgTrigger = 28U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToEvtgTrigger = 29U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToEvtgTrigger = 30U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToEvtgTrigger = 31U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToEvtgTrigger = 32U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToEvtgTrigger = 33U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToEvtgTrigger = 34U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToEvtgTrigger = 35U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToEvtgTrigger = 36U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToEvtgTrigger = 37U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToEvtgTrigger = 38U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToEvtgTrigger = 39U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToEvtgTrigger = 40U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToEvtgTrigger = 41U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToEvtgTrigger = 42U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToEvtgTrigger = 43U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToEvtgTrigger = 44U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToEvtgTrigger = 45U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToEvtgTrigger = 46U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToEvtgTrigger = 47U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToEvtgTrigger = 48U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToEvtgTrigger = 49U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToEvtgTrigger = 50U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToEvtgTrigger = 51U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToEvtgTrigger = 52U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToEvtgTrigger = 53U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToEvtgTrigger = 54U + (EVTG_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToEvtgTrigger = 55U + (EVTG_TRIG0_REG << PMUX_SHIFT), - - /*!< USB-FS trigger input connections. */ - kINPUTMUX_Lpflexcomm0Trig3ToUsbfsTrigger = 0U + (USBFS_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm1Trig3ToUsbfsTrigger = 1U + (USBFS_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm2Trig3ToUsbfsTrigger = 2U + (USBFS_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm3Trig3ToUsbfsTrigger = 3U + (USBFS_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm4Trig3ToUsbfsTrigger = 4U + (USBFS_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm5Trig3ToUsbfsTrigger = 5U + (USBFS_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm6Trig3ToUsbfsTrigger = 6U + (USBFS_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm7Trig3ToUsbfsTrigger = 7U + (USBFS_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm8Trig3ToUsbfsTrigger = 8U + (USBFS_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm9Trig3ToUsbfsTrigger = 9U + (USBFS_TRIG_REG << PMUX_SHIFT), - - /*!< TSI trigger input connections. */ - kINPUTMUX_Lptmr0ToTsiTrigger = 0U + (TSI_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToTsiTrigger = 1U + (TSI_TRIG_REG << PMUX_SHIFT), - - /*!< EXT trigger connections. */ - kINPUTMUX_PinInt0ToExtTrigger = 0U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_PinInt1ToExtTrigger = 1U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0IrqToExtTrigger = 2U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1IrqToExtTrigger = 3U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToExtTrigger = 4U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToExtTrigger = 5U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig01ToExtTrigger = 6U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig01ToExtTrigger = 7U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig01ToExtTrigger = 8U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig01ToExtTrigger = 9U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig01ToExtTrigger = 10U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig01ToExtTrigger = 11U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig01ToExtTrigger = 12U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig01ToExtTrigger = 13U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToExtTrigger = 14U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToExtTrigger = 15U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToExtTrigger = 16U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToExtTrigger = 17U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToExtTrigger = 18U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToExtTrigger = 19U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToExtTrigger = 20U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToExtTrigger = 21U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToExtTrigger = 22U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToExtTrigger = 23U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToExtTrigger = 26U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToExtTrigger = 27U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_SctOut0ToExtTrigger = 28U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_SctOut1ToExtTrigger = 29U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_SctOut2ToExtTrigger = 30U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_SctOut3ToExtTrigger = 31U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToExtTrigger = 32U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToExtTrigger = 33U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm0Trig3ToExtTrigger = 34U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm1Trig3ToExtTrigger = 35U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm2Trig3ToExtTrigger = 36U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm3Trig3ToExtTrigger = 37U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm4Trig3ToExtTrigger = 38U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm5Trig3ToExtTrigger = 39U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm6Trig3ToExtTrigger = 40U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm7Trig3ToExtTrigger = 41U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm8Trig3ToExtTrigger = 42U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm9Trig3ToExtTrigger = 43U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToExtTrigger = 44U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToExtTrigger = 45U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToExtTrigger = 46U + (EXT_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EnetPpsOut0ToExtTrigger = 47U + (EXT_TRIG0_REG << PMUX_SHIFT), - - /*!< SINC Filter channel trigger input connections. */ - kINPUTMUX_PinInt0ToSincFilterChTrigger = 0U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_PinInt1ToSincFilterChTrigger = 1U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToSincFilterChTrigger = 2U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToSincFilterChTrigger = 3U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_SctOut9ToSincFilterChTrigger = 4U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToSincFilterChTrigger = 5U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToSincFilterChTrigger = 6U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToSincFilterChTrigger = 7U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToSincFilterChTrigger = 8U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToSincFilterChTrigger = 9U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToSincFilterChTrigger = 11U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToSincFilterChTrigger = 12U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToSincFilterChTrigger = 13U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToSincFilterChTrigger = 14U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToSincFilterChTrigger = 15U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToSincFilterChTrigger = 16U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToSincFilterChTrigger = 17U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToSincFilterChTrigger = 18U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToSincFilterChTrigger = 19U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToSincFilterChTrigger = 20U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToSincFilterChTrigger = 21U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToSincFilterChTrigger = 22U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToSincFilterChTrigger = 23U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToSincFilterChTrigger = 24U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToSincFilterChTrigger = 25U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToSincFilterChTrigger = 26U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToSincFilterChTrigger = 27U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToSincFilterChTrigger = 28U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToSincFilterChTrigger = 29U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToSincFilterChTrigger = 30U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToSincFilterChTrigger = 31U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToSincFilterChTrigger = 32U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToSincFilterChTrigger = 33U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToSincFilterChTrigger = 34U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToSincFilterChTrigger = 35U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToSincFilterChTrigger = 36U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToSincFilterChTrigger = 37U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToSincFilterChTrigger = 38U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToSincFilterChTrigger = 39U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc0CmpPosMatchToSincFilterChTrigger = 40U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Qdc1CmpPosMatchToSincFilterChTrigger = 41U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToSincFilterChTrigger = 42U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToSincFilterChTrigger = 43U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToSincFilterChTrigger = 44U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToSincFilterChTrigger = 45U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToSincFilterChTrigger = 46U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToSincFilterChTrigger = 47U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToSincFilterChTrigger = 48U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToSincFilterChTrigger = 49U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToSincFilterChTrigger = 50U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToSincFilterChTrigger = 51U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh0ToSincFilterChTrigger = 52U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh1ToSincFilterChTrigger = 53U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh2ToSincFilterChTrigger = 54U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh3ToSincFilterChTrigger = 55U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - kINPUTMUX_WuuToSincFilterChTrigger = 56U + (SINC_FILTER_CH0_REG << PMUX_SHIFT), - - /*!< OPAMP0 trigger input connections. */ - kINPUTMUX_PinInt0ToOpamp0Trigger = 0U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt1ToOpamp0Trigger = 1U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt2ToOpamp0Trigger = 2U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt3ToOpamp0Trigger = 3U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToOpamp0Trigger = 4U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToOpamp0Trigger = 5U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut6ToOpamp0Trigger = 6U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut7ToOpamp0Trigger = 7U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut8ToOpamp0Trigger = 8U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToOpamp0Trigger = 9U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToOpamp0Trigger = 10U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToOpamp0Trigger = 11U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToOpamp0Trigger = 12U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToOpamp0Trigger = 13U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToOpamp0Trigger = 14U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToOpamp0Trigger = 15U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToOpamp0Trigger = 16U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToOpamp0Trigger = 17U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToOpamp0Trigger = 18U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToOpamp0Trigger = 19U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToOpamp0Trigger = 20U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToOpamp0Trigger = 21U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToOpamp0Trigger = 22U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToOpamp0Trigger = 23U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToOpamp0Trigger = 24U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToOpamp0Trigger = 25U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToOpamp0Trigger = 26U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToOpamp0Trigger = 27U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToOpamp0Trigger = 28U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToOpamp0Trigger = 29U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToOpamp0Trigger = 30U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToOpamp0Trigger = 31U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToOpamp0Trigger = 32U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToOpamp0Trigger = 33U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToOpamp0Trigger = 34U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToOpamp0Trigger = 35U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToOpamp0Trigger = 36U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToOpamp0Trigger = 37U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToOpamp0Trigger = 38U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToOpamp0Trigger = 39U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToOpamp0Trigger = 40U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToOpamp0Trigger = 41U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToOpamp0Trigger = 42U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToOpamp0Trigger = 43U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToOpamp0Trigger = 44U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToOpamp0Trigger = 45U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToOpamp0Trigger = 46U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToOpamp0Trigger = 47U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToOpamp0Trigger = 48U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToOpamp0Trigger = 49U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToOpamp0Trigger = 50U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh4ToOpamp0Trigger = 51U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh5ToOpamp0Trigger = 52U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh6ToOpamp0Trigger = 53U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh7ToOpamp0Trigger = 54U + (OPAMP0_TRIG_REG << PMUX_SHIFT), - - /*!< OPAMP1 trigger input connections. */ - kINPUTMUX_PinInt0ToOpamp1Trigger = 0U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt1ToOpamp1Trigger = 1U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt2ToOpamp1Trigger = 2U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt3ToOpamp1Trigger = 3U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToOpamp1Trigger = 4U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToOpamp1Trigger = 5U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut6ToOpamp1Trigger = 6U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut7ToOpamp1Trigger = 7U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut8ToOpamp1Trigger = 8U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToOpamp1Trigger = 9U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToOpamp1Trigger = 10U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToOpamp1Trigger = 11U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToOpamp1Trigger = 12U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToOpamp1Trigger = 13U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToOpamp1Trigger = 14U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToOpamp1Trigger = 15U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToOpamp1Trigger = 16U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToOpamp1Trigger = 17U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToOpamp1Trigger = 18U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToOpamp1Trigger = 19U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToOpamp1Trigger = 20U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToOpamp1Trigger = 21U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToOpamp1Trigger = 22U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToOpamp1Trigger = 23U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToOpamp1Trigger = 24U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToOpamp1Trigger = 25U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToOpamp1Trigger = 26U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToOpamp1Trigger = 27U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToOpamp1Trigger = 28U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToOpamp1Trigger = 29U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToOpamp1Trigger = 30U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToOpamp1Trigger = 31U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToOpamp1Trigger = 32U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToOpamp1Trigger = 33U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToOpamp1Trigger = 34U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToOpamp1Trigger = 35U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToOpamp1Trigger = 36U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToOpamp1Trigger = 37U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToOpamp1Trigger = 38U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToOpamp1Trigger = 39U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToOpamp1Trigger = 40U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToOpamp1Trigger = 41U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToOpamp1Trigger = 42U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToOpamp1Trigger = 43U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToOpamp1Trigger = 44U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToOpamp1Trigger = 45U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToOpamp1Trigger = 46U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToOpamp1Trigger = 47U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToOpamp1Trigger = 48U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToOpamp1Trigger = 49U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToOpamp1Trigger = 50U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh4ToOpamp1Trigger = 51U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh5ToOpamp1Trigger = 52U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh6ToOpamp1Trigger = 53U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh7ToOpamp1Trigger = 54U + (OPAMP1_TRIG_REG << PMUX_SHIFT), - - /*!< OPAMP2 trigger input connections. */ - kINPUTMUX_PinInt0ToOpamp2Trigger = 0U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt1ToOpamp2Trigger = 1U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt2ToOpamp2Trigger = 2U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt3ToOpamp2Trigger = 3U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToOpamp2Trigger = 4U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToOpamp2Trigger = 5U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut6ToOpamp2Trigger = 6U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut7ToOpamp2Trigger = 7U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut8ToOpamp2Trigger = 8U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M3ToOpamp2Trigger = 9U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M3ToOpamp2Trigger = 10U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToOpamp2Trigger = 11U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToOpamp2Trigger = 12U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToOpamp2Trigger = 13U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToOpamp2Trigger = 14U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToOpamp2Trigger = 15U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToOpamp2Trigger = 16U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToOpamp2Trigger = 17U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToOpamp2Trigger = 18U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToOpamp2Trigger = 19U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToOpamp2Trigger = 20U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToOpamp2Trigger = 21U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToOpamp2Trigger = 22U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToOpamp2Trigger = 23U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToOpamp2Trigger = 24U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToOpamp2Trigger = 25U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToOpamp2Trigger = 26U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToOpamp2Trigger = 27U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToOpamp2Trigger = 28U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToOpamp2Trigger = 29U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToOpamp2Trigger = 30U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToOpamp2Trigger = 31U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToOpamp2Trigger = 32U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToOpamp2Trigger = 33U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToOpamp2Trigger = 34U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToOpamp2Trigger = 35U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToOpamp2Trigger = 36U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToOpamp2Trigger = 37U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToOpamp2Trigger = 38U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToOpamp2Trigger = 39U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToOpamp2Trigger = 40U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToOpamp2Trigger = 41U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToOpamp2Trigger = 42U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToOpamp2Trigger = 43U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToOpamp2Trigger = 44U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToOpamp2Trigger = 45U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToOpamp2Trigger = 46U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToOpamp2Trigger = 47U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToOpamp2Trigger = 48U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToOpamp2Trigger = 49U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToOpamp2Trigger = 50U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh4ToOpamp2Trigger = 51U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh5ToOpamp2Trigger = 52U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh6ToOpamp2Trigger = 53U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh7ToOpamp2Trigger = 54U + (OPAMP2_TRIG_REG << PMUX_SHIFT), - - /*!< FLEXCOMM0 trigger input connections. */ - kINPUTMUX_PinInt4ToFlexcomm0Trigger = 0U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexcomm0Trigger = 1U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt6ToFlexcomm0Trigger = 2U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexcomm0Trigger = 3U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut6ToFlexcomm0Trigger = 4U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut7ToFlexcomm0Trigger = 5U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToFlexcomm0Trigger = 6U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToFlexcomm0Trigger = 7U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexcomm0Trigger = 8U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToFlexcomm0Trigger = 9U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexcomm0Trigger = 10U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToFlexcomm0Trigger = 11U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToFlexcomm0Trigger = 12U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexcomm0Trigger = 13U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexcomm0Trigger = 14U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexcomm0Trigger = 15U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexcomm0Trigger = 16U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexcomm0Trigger = 17U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexcomm0Trigger = 18U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexcomm0Trigger = 19U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexcomm0Trigger = 20U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexcomm0Trigger = 21U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexcomm0Trigger = 22U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexcomm0Trigger = 23U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexcomm0Trigger = 24U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexcomm0Trigger = 25U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexcomm0Trigger = 26U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexcomm0Trigger = 27U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexcomm0Trigger = 28U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexcomm0Trigger = 29U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexcomm0Trigger = 30U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexcomm0Trigger = 31U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexcomm0Trigger = 32U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh4ToFlexcomm0Trigger = 33U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh5ToFlexcomm0Trigger = 34U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh6ToFlexcomm0Trigger = 35U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh7ToFlexcomm0Trigger = 36U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Usb0IppIndUartRxdUsbmuxToFlexcomm0Trigger = 37U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexcomm0Trigger = 38U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexcomm0Trigger = 39U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexcomm0Trigger = 40U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexcomm0Trigger = 41U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToFlexcomm0Trigger = 42U + (FLEXCOMM0_TRIG_REG << PMUX_SHIFT), - - /*!< FLEXCOMM1 trigger input connections. */ - kINPUTMUX_PinInt4ToFlexcomm1Trigger = 0U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexcomm1Trigger = 1U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt6ToFlexcomm1Trigger = 2U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexcomm1Trigger = 3U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut6ToFlexcomm1Trigger = 4U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut7ToFlexcomm1Trigger = 5U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToFlexcomm1Trigger = 6U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToFlexcomm1Trigger = 7U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexcomm1Trigger = 8U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToFlexcomm1Trigger = 9U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexcomm1Trigger = 10U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToFlexcomm1Trigger = 11U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToFlexcomm1Trigger = 12U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexcomm1Trigger = 13U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexcomm1Trigger = 14U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexcomm1Trigger = 15U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexcomm1Trigger = 16U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexcomm1Trigger = 17U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexcomm1Trigger = 18U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexcomm1Trigger = 19U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexcomm1Trigger = 20U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexcomm1Trigger = 21U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexcomm1Trigger = 22U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexcomm1Trigger = 23U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexcomm1Trigger = 24U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexcomm1Trigger = 25U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexcomm1Trigger = 26U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexcomm1Trigger = 27U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexcomm1Trigger = 28U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexcomm1Trigger = 29U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexcomm1Trigger = 30U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexcomm1Trigger = 31U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexcomm1Trigger = 32U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh4ToFlexcomm1Trigger = 33U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh5ToFlexcomm1Trigger = 34U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh6ToFlexcomm1Trigger = 35U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh7ToFlexcomm1Trigger = 36U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Usb0IppIndUartRxdUsbmuxToFlexcomm1Trigger = 37U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexcomm1Trigger = 38U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexcomm1Trigger = 39U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexcomm1Trigger = 40U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexcomm1Trigger = 41U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToFlexcomm1Trigger = 42U + (FLEXCOMM1_TRIG_REG << PMUX_SHIFT), - - /*!< FLEXCOMM2 trigger input connections. */ - kINPUTMUX_PinInt4ToFlexcomm2Trigger = 0U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt6ToFlexcomm2Trigger = 1U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt7ToFlexcomm2Trigger = 2U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexcomm2Trigger = 3U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut8ToFlexcomm2Trigger = 4U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut9ToFlexcomm2Trigger = 5U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToFlexcomm2Trigger = 6U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToFlexcomm2Trigger = 7U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexcomm2Trigger = 8U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M1ToFlexcomm2Trigger = 9U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexcomm2Trigger = 10U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToFlexcomm2Trigger = 11U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToFlexcomm2Trigger = 12U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexcomm2Trigger = 13U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexcomm2Trigger = 14U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexcomm2Trigger = 15U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexcomm2Trigger = 16U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexcomm2Trigger = 17U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexcomm2Trigger = 18U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexcomm2Trigger = 19U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexcomm2Trigger = 20U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexcomm2Trigger = 21U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexcomm2Trigger = 22U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexcomm2Trigger = 23U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexcomm2Trigger = 24U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexcomm2Trigger = 25U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexcomm2Trigger = 26U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexcomm2Trigger = 27U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexcomm2Trigger = 28U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexcomm2Trigger = 29U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexcomm2Trigger = 30U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexcomm2Trigger = 31U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexcomm2Trigger = 32U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh4ToFlexcomm2Trigger = 33U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh5ToFlexcomm2Trigger = 34U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh6ToFlexcomm2Trigger = 35U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh7ToFlexcomm2Trigger = 36U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Usb0IppIndUartRxdUsbmuxToFlexcomm2Trigger = 37U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexcomm2Trigger = 38U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexcomm2Trigger = 39U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexcomm2Trigger = 40U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexcomm2Trigger = 41U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToFlexcomm2Trigger = 42U + (FLEXCOMM2_TRIG_REG << PMUX_SHIFT), - - /*!< FLEXCOMM3 trigger input connections. */ - kINPUTMUX_PinInt4ToFlexcomm3Trigger = 0U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexcomm3Trigger = 1U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt7ToFlexcomm3Trigger = 2U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexcomm3Trigger = 3U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut8ToFlexcomm3Trigger = 4U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut9ToFlexcomm3Trigger = 5U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToFlexcomm3Trigger = 6U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToFlexcomm3Trigger = 7U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexcomm3Trigger = 8U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M1ToFlexcomm3Trigger = 9U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexcomm3Trigger = 10U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToFlexcomm3Trigger = 11U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToFlexcomm3Trigger = 12U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexcomm3Trigger = 13U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexcomm3Trigger = 14U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexcomm3Trigger = 15U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexcomm3Trigger = 16U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexcomm3Trigger = 17U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexcomm3Trigger = 18U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexcomm3Trigger = 19U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexcomm3Trigger = 20U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexcomm3Trigger = 21U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexcomm3Trigger = 22U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexcomm3Trigger = 23U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexcomm3Trigger = 24U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexcomm3Trigger = 25U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexcomm3Trigger = 26U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexcomm3Trigger = 27U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexcomm3Trigger = 28U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexcomm3Trigger = 29U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexcomm3Trigger = 30U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexcomm3Trigger = 31U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexcomm3Trigger = 32U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh4ToFlexcomm3Trigger = 33U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh5ToFlexcomm3Trigger = 34U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh6ToFlexcomm3Trigger = 35U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh7ToFlexcomm3Trigger = 36U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Usb0IppIndUartRxdUsbmuxToFlexcomm3Trigger = 37U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexcomm3Trigger = 38U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexcomm3Trigger = 39U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexcomm3Trigger = 40U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexcomm3Trigger = 41U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToFlexcomm3Trigger = 42U + (FLEXCOMM3_TRIG_REG << PMUX_SHIFT), - - /*!< FLEXCOMM4 trigger input connections. */ - kINPUTMUX_PinInt4ToFlexcomm4Trigger = 0U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexcomm4Trigger = 1U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt7ToFlexcomm4Trigger = 2U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut0ToFlexcomm4Trigger = 3U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut1ToFlexcomm4Trigger = 4U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut2ToFlexcomm4Trigger = 5U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToFlexcomm4Trigger = 6U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToFlexcomm4Trigger = 7U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToFlexcomm4Trigger = 8U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToFlexcomm4Trigger = 9U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToFlexcomm4Trigger = 10U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToFlexcomm4Trigger = 11U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToFlexcomm4Trigger = 12U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexcomm4Trigger = 13U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexcomm4Trigger = 14U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexcomm4Trigger = 15U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexcomm4Trigger = 16U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexcomm4Trigger = 17U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexcomm4Trigger = 18U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexcomm4Trigger = 19U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexcomm4Trigger = 20U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexcomm4Trigger = 21U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexcomm4Trigger = 22U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexcomm4Trigger = 23U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexcomm4Trigger = 24U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexcomm4Trigger = 25U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexcomm4Trigger = 26U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexcomm4Trigger = 27U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexcomm4Trigger = 28U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexcomm4Trigger = 29U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexcomm4Trigger = 30U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexcomm4Trigger = 31U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexcomm4Trigger = 32U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh4ToFlexcomm4Trigger = 33U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh5ToFlexcomm4Trigger = 34U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh6ToFlexcomm4Trigger = 35U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh7ToFlexcomm4Trigger = 36U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Usb0IppIndUartRxdUsbmuxToFlexcomm4Trigger = 37U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexcomm4Trigger = 38U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexcomm4Trigger = 39U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexcomm4Trigger = 40U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexcomm4Trigger = 41U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToFlexcomm4Trigger = 42U + (FLEXCOMM4_TRIG_REG << PMUX_SHIFT), - - /*!< FLEXCOMM5 trigger input connections. */ - kINPUTMUX_PinInt4ToFlexcomm5Trigger = 0U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexcomm5Trigger = 1U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt7ToFlexcomm5Trigger = 2U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut0ToFlexcomm5Trigger = 3U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut1ToFlexcomm5Trigger = 4U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut2ToFlexcomm5Trigger = 5U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToFlexcomm5Trigger = 6U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToFlexcomm5Trigger = 7U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M2ToFlexcomm5Trigger = 8U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M2ToFlexcomm5Trigger = 9U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M2ToFlexcomm5Trigger = 10U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToFlexcomm5Trigger = 11U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToFlexcomm5Trigger = 12U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexcomm5Trigger = 13U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexcomm5Trigger = 14U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexcomm5Trigger = 15U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexcomm5Trigger = 16U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexcomm5Trigger = 17U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexcomm5Trigger = 18U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexcomm5Trigger = 19U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexcomm5Trigger = 20U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexcomm5Trigger = 21U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexcomm5Trigger = 22U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexcomm5Trigger = 23U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexcomm5Trigger = 24U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexcomm5Trigger = 25U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexcomm5Trigger = 26U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexcomm5Trigger = 27U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexcomm5Trigger = 28U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexcomm5Trigger = 29U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexcomm5Trigger = 30U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexcomm5Trigger = 31U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexcomm5Trigger = 32U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh4ToFlexcomm5Trigger = 33U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh5ToFlexcomm5Trigger = 34U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh6ToFlexcomm5Trigger = 35U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh7ToFlexcomm5Trigger = 36U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Usb0IppIndUartRxdUsbmuxToFlexcomm5Trigger = 37U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexcomm5Trigger = 38U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexcomm5Trigger = 39U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexcomm5Trigger = 40U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexcomm5Trigger = 41U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToFlexcomm5Trigger = 42U + (FLEXCOMM5_TRIG_REG << PMUX_SHIFT), - - /*!< FLEXCOMM6 trigger input connections. */ - kINPUTMUX_PinInt4ToFlexcomm6Trigger = 0U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexcomm6Trigger = 1U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt7ToFlexcomm6Trigger = 2U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut0ToFlexcomm6Trigger = 3U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut3ToFlexcomm6Trigger = 4U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToFlexcomm6Trigger = 5U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToFlexcomm6Trigger = 6U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToFlexcomm6Trigger = 7U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexcomm6Trigger = 8U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToFlexcomm6Trigger = 9U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToFlexcomm6Trigger = 10U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToFlexcomm6Trigger = 11U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToFlexcomm6Trigger = 12U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexcomm6Trigger = 13U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexcomm6Trigger = 14U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexcomm6Trigger = 15U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexcomm6Trigger = 16U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexcomm6Trigger = 17U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexcomm6Trigger = 18U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexcomm6Trigger = 19U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexcomm6Trigger = 20U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexcomm6Trigger = 21U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexcomm6Trigger = 22U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexcomm6Trigger = 23U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexcomm6Trigger = 24U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexcomm6Trigger = 25U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexcomm6Trigger = 26U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexcomm6Trigger = 27U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexcomm6Trigger = 28U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexcomm6Trigger = 29U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexcomm6Trigger = 30U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexcomm6Trigger = 31U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexcomm6Trigger = 32U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh4ToFlexcomm6Trigger = 33U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh5ToFlexcomm6Trigger = 34U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh6ToFlexcomm6Trigger = 35U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh7ToFlexcomm6Trigger = 36U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Usb0IppIndUartRxdUsbmuxToFlexcomm6Trigger = 37U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexcomm6Trigger = 38U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexcomm6Trigger = 39U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexcomm6Trigger = 40U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexcomm6Trigger = 41U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToFlexcomm6Trigger = 42U + (FLEXCOMM6_TRIG_REG << PMUX_SHIFT), - - /*!< FLEXCOMM7 trigger input connections. */ - kINPUTMUX_PinInt4ToFlexcomm7Trigger = 0U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexcomm7Trigger = 1U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt7ToFlexcomm7Trigger = 2U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut0ToFlexcomm7Trigger = 3U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut3ToFlexcomm7Trigger = 4U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToFlexcomm7Trigger = 5U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToFlexcomm7Trigger = 6U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToFlexcomm7Trigger = 7U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexcomm7Trigger = 8U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToFlexcomm7Trigger = 9U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToFlexcomm7Trigger = 10U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToFlexcomm7Trigger = 11U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToFlexcomm7Trigger = 12U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexcomm7Trigger = 13U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexcomm7Trigger = 14U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexcomm7Trigger = 15U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexcomm7Trigger = 16U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexcomm7Trigger = 17U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexcomm7Trigger = 18U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexcomm7Trigger = 19U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexcomm7Trigger = 20U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexcomm7Trigger = 21U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexcomm7Trigger = 22U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexcomm7Trigger = 23U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexcomm7Trigger = 24U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexcomm7Trigger = 25U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexcomm7Trigger = 26U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexcomm7Trigger = 27U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexcomm7Trigger = 28U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexcomm7Trigger = 29U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexcomm7Trigger = 30U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexcomm7Trigger = 31U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexcomm7Trigger = 32U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh4ToFlexcomm7Trigger = 33U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh5ToFlexcomm7Trigger = 34U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh6ToFlexcomm7Trigger = 35U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh7ToFlexcomm7Trigger = 36U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Usb0IppIndUartRxdUsbmuxToFlexcomm7Trigger = 37U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexcomm7Trigger = 38U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexcomm7Trigger = 39U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexcomm7Trigger = 40U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexcomm7Trigger = 41U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToFlexcomm7Trigger = 42U + (FLEXCOMM7_TRIG_REG << PMUX_SHIFT), - - /*!< FLEXCOMM8 trigger input connections. */ - kINPUTMUX_PinInt4ToFlexcomm8Trigger = 0U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexcomm8Trigger = 1U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt7ToFlexcomm8Trigger = 2U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut0ToFlexcomm8Trigger = 3U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut3ToFlexcomm8Trigger = 4U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToFlexcomm8Trigger = 5U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToFlexcomm8Trigger = 6U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToFlexcomm8Trigger = 7U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M3ToFlexcomm8Trigger = 8U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M3ToFlexcomm8Trigger = 9U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M3ToFlexcomm8Trigger = 10U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToFlexcomm8Trigger = 11U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToFlexcomm8Trigger = 12U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexcomm8Trigger = 13U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexcomm8Trigger = 14U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexcomm8Trigger = 15U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexcomm8Trigger = 16U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexcomm8Trigger = 17U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexcomm8Trigger = 18U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexcomm8Trigger = 19U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexcomm8Trigger = 20U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexcomm8Trigger = 21U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexcomm8Trigger = 22U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexcomm8Trigger = 23U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexcomm8Trigger = 24U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexcomm8Trigger = 25U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexcomm8Trigger = 26U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexcomm8Trigger = 27U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexcomm8Trigger = 28U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexcomm8Trigger = 29U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexcomm8Trigger = 30U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexcomm8Trigger = 31U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexcomm8Trigger = 32U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh4ToFlexcomm8Trigger = 33U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh5ToFlexcomm8Trigger = 34U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh6ToFlexcomm8Trigger = 35U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh7ToFlexcomm8Trigger = 36U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Usb0IppIndUartRxdUsbmuxToFlexcomm8Trigger = 37U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexcomm8Trigger = 38U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexcomm8Trigger = 39U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexcomm8Trigger = 40U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexcomm8Trigger = 41U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToFlexcomm8Trigger = 42U + (FLEXCOMM8_TRIG_REG << PMUX_SHIFT), - - /*!< FLEXCOMM9 trigger input connections. */ - kINPUTMUX_PinInt4ToFlexcomm9Trigger = 0U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexcomm9Trigger = 1U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_PinInt7ToFlexcomm9Trigger = 2U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut0ToFlexcomm9Trigger = 3U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut3ToFlexcomm9Trigger = 4U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_SctOut4ToFlexcomm9Trigger = 5U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToFlexcomm9Trigger = 6U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToFlexcomm9Trigger = 7U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M0ToFlexcomm9Trigger = 8U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M0ToFlexcomm9Trigger = 9U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M0ToFlexcomm9Trigger = 10U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToFlexcomm9Trigger = 11U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToFlexcomm9Trigger = 12U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexcomm9Trigger = 13U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexcomm9Trigger = 14U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexcomm9Trigger = 15U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexcomm9Trigger = 16U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexcomm9Trigger = 17U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexcomm9Trigger = 18U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexcomm9Trigger = 19U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexcomm9Trigger = 20U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexcomm9Trigger = 21U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexcomm9Trigger = 22U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexcomm9Trigger = 23U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexcomm9Trigger = 24U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexcomm9Trigger = 25U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexcomm9Trigger = 26U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexcomm9Trigger = 27U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexcomm9Trigger = 28U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexcomm9Trigger = 29U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexcomm9Trigger = 30U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn10ToFlexcomm9Trigger = 31U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn11ToFlexcomm9Trigger = 32U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh4ToFlexcomm9Trigger = 33U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh5ToFlexcomm9Trigger = 34U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh6ToFlexcomm9Trigger = 35U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_FlexioCh7ToFlexcomm9Trigger = 36U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Usb0IppIndUartRxdUsbmuxToFlexcomm9Trigger = 37U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig0ToFlexcomm9Trigger = 38U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio2PinEventTrig1ToFlexcomm9Trigger = 39U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig0ToFlexcomm9Trigger = 40U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_Gpio3PinEventTrig1ToFlexcomm9Trigger = 41U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - kINPUTMUX_WuuToFlexcomm9Trigger = 42U + (FLEXCOMM9_TRIG_REG << PMUX_SHIFT), - - /*!< FlexIO trigger input connections. */ - kINPUTMUX_PinInt4ToFlexioTrigger = 0U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_PinInt5ToFlexioTrigger = 1U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_PinInt6ToFlexioTrigger = 2U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_PinInt7ToFlexioTrigger = 3U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_SctOut5ToFlexioTrigger = 4U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_SctOut6ToFlexioTrigger = 5U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_SctOut7ToFlexioTrigger = 6U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_SctOut8ToFlexioTrigger = 7U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_SctOut9ToFlexioTrigger = 8U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer0M1ToFlexioTrigger = 9U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer1M1ToFlexioTrigger = 10U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer2M1ToFlexioTrigger = 11U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer3M1ToFlexioTrigger = 12U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Ctimer4M1ToFlexioTrigger = 13U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr0ToFlexioTrigger = 14U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lptmr1ToFlexioTrigger = 15U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_ArmTxevToFlexioTrigger = 16U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_GpioIntBmatchToFlexioTrigger = 17U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp0ToFlexioTrigger = 18U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp1ToFlexioTrigger = 19U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp2ToFlexioTrigger = 20U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc0Tcomp3ToFlexioTrigger = 21U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp0ToFlexioTrigger = 22U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp1ToFlexioTrigger = 23U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp2ToFlexioTrigger = 24U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Adc1Tcomp3ToFlexioTrigger = 25U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp0OutToFlexioTrigger = 26U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp1OutToFlexioTrigger = 27U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Cmp2OutToFlexioTrigger = 28U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig0ToFlexioTrigger = 29U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A0Trig1ToFlexioTrigger = 30U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig0ToFlexioTrigger = 31U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A1Trig1ToFlexioTrigger = 32U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig0ToFlexioTrigger = 33U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A2Trig1ToFlexioTrigger = 34U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig0ToFlexioTrigger = 35U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm0A3Trig1ToFlexioTrigger = 36U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig0ToFlexioTrigger = 37U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A0Trig1ToFlexioTrigger = 38U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig0ToFlexioTrigger = 39U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A1Trig1ToFlexioTrigger = 40U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig0ToFlexioTrigger = 41U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A2Trig1ToFlexioTrigger = 42U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig0ToFlexioTrigger = 43U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Pwm1A3Trig1ToFlexioTrigger = 44U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0AToFlexioTrigger = 45U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut0BToFlexioTrigger = 46U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1AToFlexioTrigger = 47U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut1BToFlexioTrigger = 48U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2AToFlexioTrigger = 49U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut2BToFlexioTrigger = 50U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3AToFlexioTrigger = 51U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_EvtgOut3BToFlexioTrigger = 52U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn0ToFlexioTrigger = 53U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn1ToFlexioTrigger = 54U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn2ToFlexioTrigger = 55U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn3ToFlexioTrigger = 56U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_TrigIn4ToFlexioTrigger = 57U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh0ToFlexioTrigger = 58U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh1ToFlexioTrigger = 59U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh2ToFlexioTrigger = 60U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh3ToFlexioTrigger = 61U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_SincFilterCh4ToFlexioTrigger = 62U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm0Trig0ToFlexioTrigger = 63U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm0Trig1ToFlexioTrigger = 64U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm0Trig2ToFlexioTrigger = 65U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm1Trig0ToFlexioTrigger = 66U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm1Trig1ToFlexioTrigger = 67U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm1Trig2ToFlexioTrigger = 68U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm2Trig0ToFlexioTrigger = 69U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm2Trig1ToFlexioTrigger = 70U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm2Trig2ToFlexioTrigger = 71U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm3Trig0ToFlexioTrigger = 72U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm3Trig1ToFlexioTrigger = 73U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm3Trig2ToFlexioTrigger = 74U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_Lpflexcomm3Trig3ToFlexioTrigger = 75U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), - kINPUTMUX_WuuToFlexioTrigger = 76U + (FLEXIO_TRIG0_REG << PMUX_SHIFT), -} inputmux_connection_t; - -/*! @brief INPUTMUX signal enable/disable type */ -typedef enum _inputmux_signal_t -{ - /*!< DMA0 REQ ENABLE0 signal. */ - kINPUTMUX_FlexSpi0RxToDma0Ch1Ena = 1U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_FlexSpi0TxToDma0Ch2Ena = 2U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_PinInt0ToDma0Ch3Ena = 3U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_PinInt1ToDma0Ch4Ena = 4U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_PinInt2ToDma0Ch5Ena = 5U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_PinInt3ToDma0Ch6Ena = 6U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer0M0ToDma0Ch7Ena = 7U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer0M1ToDma0Ch8Ena = 8U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer1M0ToDma0Ch9Ena = 9U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer1M1ToDma0Ch10Ena = 10U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer2M0ToDma0Ch11Ena = 11U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer2M1ToDma0Ch12Ena = 12U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer3M0ToDma0Ch13Ena = 13U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer3M1ToDma0Ch14Ena = 14U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer4M0ToDma0Ch15Ena = 15U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer4M1ToDma0Ch16Ena = 16U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Wuu0ToDma0Ch17Ena = 17U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Micfil0FifoRequestToDma0Ch18Ena = 18U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Sct0Dma0ToDma0Ch19Ena = 19U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Sct0Dma1ToDma0Ch20Ena = 20U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Adc0FifoARequestToDma0Ch21Ena = 21U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Adc0FifoBRequestToDma0Ch22Ena = 22U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Adc1FifoARequestToDma0Ch23Ena = 23U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Adc1FifoBRequestoDma0Ch24Ena = 24U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Dac0FifoRequestToDma0Ch25Ena = 25U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Dac1FifoRequestToDma0Ch26Ena = 26U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_HpDac0FifoRequestToDma0Ch27Ena = 27U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_HsCmp0DmaRequestToDma0Ch28Ena = 28U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_HsCmp1DmaRequestToDma0Ch29Ena = 29U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_HsCmp2DmaRequestToDma0Ch30Ena = 30U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Evtg0Out0AToDma0Ch31Ena = 31U + (DMA0_REQ_ENABLE0_REG << ENA_SHIFT), - - /*!< DMA0 REQ ENABLE1 signal. */ - kINPUTMUX_Evtg0Out0BToDma0Ch32Ena = 0U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Evtg0Out1AToDma0Ch33Ena = 1U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Evtg0Out1BToDma0Ch34Ena = 2U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Evtg0Out2AToDma0Ch35Ena = 3U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Evtg0Out2BToDma0Ch36Ena = 4U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Evtg0Out3AToDma0Ch37Ena = 5U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Evtg0Out3BToDma0Ch38Ena = 6U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqCapt0ToDma0Ch39Ena = 7U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqCapt1ToDma0Ch40Ena = 8U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqCapt2ToDma0Ch41Ena = 9U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqCapt3ToDma0Ch42Ena = 10U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqVal0ToDma0Ch43Ena = 11U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqVal1ToDma0Ch44Ena = 12U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqVal2ToDma0Ch45Ena = 13U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqVal3ToDma0Ch46Ena = 14U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqCapt0ToDma0Ch47Ena = 15U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqCapt1ToDma0Ch48Ena = 16U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqCapt2ToDma0Ch49Ena = 17U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqCapt3ToDma0Ch50Ena = 18U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqVal0ToDma0Ch51Ena = 19U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqVal1ToDma0Ch52Ena = 20U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqVal2ToDma0Ch53Ena = 21U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqVal3ToDma0Ch54Ena = 22U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Itrc0TmprOut0ToDma0Ch55Ena = 23U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Itrc0TmprOut1ToDma0Ch56Ena = 24U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Lptmr0ToDma0Ch57Ena = 25U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Lptmr1ToDma0Ch58Ena = 26U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexCan0DmaRequestToDma0Ch59Ena = 27U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexCan1DmaRequestToDma0Ch60Ena = 28U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexIO0ShiftRegister0RequestToDma0Ch61Ena = 29U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexIO0ShiftRegister1RequestToDma0Ch62Ena = 30U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexIO0ShiftRegister2RequestToDma0Ch63Ena = 31U + (DMA0_REQ_ENABLE1_REG << ENA_SHIFT), - - /*!< DMA0 REQ ENABLE2 signal. */ - kINPUTMUX_FlexIO0ShiftRegister3RequestToDma0Ch64Ena = 0U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_FlexIO0ShiftRegister4RequestToDma0Ch65Ena = 1U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_FlexIO0ShiftRegister5RequestToDma0Ch66Ena = 2U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_FlexIO0ShiftRegister6RequestToDma0Ch67Ena = 3U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_FlexIO0ShiftRegister7RequestToDma0Ch68Ena = 4U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm0RxToDma0Ch69Ena = 5U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm0TxToDma0Ch70Ena = 6U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm1RxToDma0Ch71Ena = 7U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm1TxToDma0Ch72Ena = 8U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm2RxToDma0Ch73Ena = 9U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm2TxToDma0Ch74Ena = 10U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm3RxToDma0Ch75Ena = 11U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm3TxToDma0Ch76Ena = 12U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm4RxToDma0Ch77Ena = 13U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm4TxToDma0Ch78Ena = 14U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm5RxToDma0Ch79Ena = 15U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm5TxToDma0Ch80Ena = 16U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm6RxToDma0Ch81Ena = 17U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm6TxToDma0Ch82Ena = 18U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm7RxToDma0Ch83Ena = 19U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm7TxToDma0Ch84Ena = 20U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm8RxToDma0Ch85Ena = 21U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm8TxToDma0Ch86Ena = 22U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm9RxToDma0Ch87Ena = 23U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm9TxToDma0Ch88Ena = 24U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_ESpi0Ch0ToDma0Ch89Ena = 25U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_ESpi0Ch1ToDma0Ch90Ena = 26U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_EmvSim0RxToDma0Ch91Ena = 27U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_EmvSim0TxToDma0Ch92Ena = 28U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_EmvSim1RxToDma0Ch93Ena = 29U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_EmvSim1TxToDma0Ch94Ena = 30U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_I3c0RxToDma0Ch95Ena = 31U + (DMA0_REQ_ENABLE2_REG << ENA_SHIFT), - - /*!< DMA0 REQ ENABLE3 signal. */ - kINPUTMUX_I3c0TxToDma0Ch96Ena = 0U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_I3c1RxToDma0Ch97Ena = 1U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_I3c1TxToDma0Ch98Ena = 2U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Sai0RxToDma0Ch99Ena = 3U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Sai0TxToDma0Ch100Ena = 4U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Sai1RxToDma0Ch101Ena = 5U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Sai1TxToDma0Ch102Ena = 6U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Sinc0IpdReqSincAlt0ToDma0Ch103Ena = 7U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Sinc0IpdReqSincAlt1ToDma0Ch104Ena = 8U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Sinc0IpdReqSincAlt2ToDma0Ch105Ena = 9U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Sinc0IpdReqSincAlt3ToDma0Ch106Ena = 10U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Sinc0IpdReqSincAlt4ToDma0Ch107Ena = 11U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio0PinEventRequest0ToDma0Ch108Ena = 12U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio0PinEventRequest1ToDma0Ch109Ena = 13U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio1PinEventRequest0ToDma0Ch110Ena = 14U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio1PinEventRequest1ToDma0Ch111Ena = 15U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio2PinEventRequest0ToDma0Ch112Ena = 16U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio2PinEventRequest1ToDma0Ch113Ena = 17U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio3PinEventRequest0ToDma0Ch114Ena = 18U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio3PinEventRequest1ToDma0Ch115Ena = 19U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio4PinEventRequest0ToDma0Ch116Ena = 20U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio4PinEventRequest1ToDma0Ch117Ena = 21U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio5PinEventRequest0ToDma0Ch118Ena = 22U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio5PinEventRequest1ToDma0Ch119Ena = 23U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Tsi0EndOfScanToDma0Ch120Ena = 24U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Tsi0OutOfRangeToDma0Ch121Ena = 25U + (DMA0_REQ_ENABLE3_REG << ENA_SHIFT), - - /*!< DMA1 REQ ENABLE0 signal. */ - kINPUTMUX_FlexSpi0RxToDma1Ch1Ena = 1U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_FlexSpi0TxToDma1Ch2Ena = 2U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_PinInt0ToDma1Ch3Ena = 3U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_PinInt1ToDma1Ch4Ena = 4U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_PinInt2ToDma1Ch5Ena = 5U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_PinInt3ToDma1Ch6Ena = 6U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer0M0ToDma1Ch7Ena = 7U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer0M1ToDma1Ch8Ena = 8U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer1M0ToDma1Ch9Ena = 9U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer1M1ToDma1Ch10Ena = 10U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer2M0ToDma1Ch11Ena = 11U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer2M1ToDma1Ch12Ena = 12U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer3M0ToDma1Ch13Ena = 13U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer3M1ToDma1Ch14Ena = 14U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer4M0ToDma1Ch15Ena = 15U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Ctimer4M1ToDma1Ch16Ena = 16U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Wuu0ToDma1Ch17Ena = 17U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Micfil0FifoRequestToDma1Ch18Ena = 18U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Sct0Dma0ToDma1Ch19Ena = 19U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Sct0Dma1ToDma1Ch20Ena = 20U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Adc0FifoARequestToDma1Ch21Ena = 21U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Adc0FifoBRequestToDma1Ch22Ena = 22U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Adc1FifoARequestToDma1Ch23Ena = 23U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Adc1FifoBRequestToDma1Ch24Ena = 24U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Dac0FifoRequestToDma1Ch25Ena = 25U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Dac1FifoRequestToDma1Ch26Ena = 26U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_HpDac0FifoRequestToDma1Ch27Ena = 27U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_HsCmp0DmaRequestToDma1Ch28Ena = 28U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_HsCmp1DmaRequestToDma1Ch29Ena = 29U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_HsCmp2DmaRequestToDma1Ch30Ena = 30U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - kINPUTMUX_Evtg0Out0AToDma1Ch31Ena = 31U + (DMA1_REQ_ENABLE0_REG << ENA_SHIFT), - - /*!< DMA1 REQ ENABLE1 signal. */ - kINPUTMUX_Evtg0Out0BToDma1Ch32Ena = 0U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Evtg0Out1AToDma1Ch33Ena = 1U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Evtg0Out1BToDma1Ch34Ena = 2U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Evtg0Out2AToDma1Ch35Ena = 3U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Evtg0Out2BToDma1Ch36Ena = 4U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Evtg0Out3AToDma1Ch37Ena = 5U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Evtg0Out3BToDma1Ch38Ena = 6U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqCapt0ToDma1Ch39Ena = 7U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqCapt1ToDma1Ch40Ena = 8U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqCapt2ToDma1Ch41Ena = 9U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqCapt3ToDma1Ch42Ena = 10U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqVal0ToDma1Ch43Ena = 11U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqVal1ToDma1Ch44Ena = 12U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqVal2ToDma1Ch45Ena = 13U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm0ReqVal3ToDma1Ch46Ena = 14U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqCapt0ToDma1Ch47Ena = 15U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqCapt1ToDma1Ch48Ena = 16U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqCapt2ToDma1Ch49Ena = 17U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqCapt3ToDma1Ch50Ena = 18U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqVal0ToDma1Ch51Ena = 19U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqVal1ToDma1Ch52Ena = 20U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqVal2ToDma1Ch53Ena = 21U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexPwm1ReqVal3ToDma1Ch54Ena = 22U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Itrc0TmprOut0ToDma1Ch55Ena = 23U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Itrc0TmprOut1ToDma1Ch56Ena = 24U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Lptmr0ToDma1Ch57Ena = 25U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_Lptmr1ToDma1Ch58Ena = 26U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexCan0DmaRequestToDma1Ch59Ena = 27U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexCan1DmaRequestToDma1Ch60Ena = 28U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexIO0ShiftRegister0RequestToDma1Ch61Ena = 29U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexIO0ShiftRegister1RequestToDma1Ch62Ena = 30U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - kINPUTMUX_FlexIO0ShiftRegister2RequestToDma1Ch63Ena = 31U + (DMA1_REQ_ENABLE1_REG << ENA_SHIFT), - - /*!< DMA1 REQ ENABLE2 signal. */ - kINPUTMUX_FlexIO0ShiftRegister3RequestToDma1Ch64Ena = 0U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_FlexIO0ShiftRegister4RequestToDma1Ch65Ena = 1U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_FlexIO0ShiftRegister5RequestToDma1Ch66Ena = 2U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_FlexIO0ShiftRegister6RequestToDma1Ch67Ena = 3U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_FlexIO0ShiftRegister7RequestToDma1Ch68Ena = 4U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm0RxToDma1Ch69Ena = 5U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm0TxToDma1Ch70Ena = 6U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm1RxToDma1Ch71Ena = 7U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm1TxToDma1Ch72Ena = 8U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm2RxToDma1Ch73Ena = 9U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm2TxToDma1Ch74Ena = 10U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm3RxToDma1Ch75Ena = 11U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm3TxToDma1Ch76Ena = 12U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm4RxToDma1Ch77Ena = 13U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm4TxToDma1Ch78Ena = 14U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm5RxToDma1Ch79Ena = 15U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm5TxToDma1Ch80Ena = 16U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm6RxToDma1Ch81Ena = 17U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm6TxToDma1Ch82Ena = 18U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm7RxToDma1Ch83Ena = 19U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm7TxToDma1Ch84Ena = 20U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm8RxToDma1Ch85Ena = 21U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm8TxToDma1Ch86Ena = 22U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm9RxToDma1Ch87Ena = 23U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_LpFlexcomm9TxToDma1Ch88Ena = 24U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_ESpi0Ch0ToDma1Ch89Ena = 25U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_ESpi0Ch1ToDma1Ch90Ena = 26U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_EmvSim0RxToDma1Ch91Ena = 27U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_EmvSim0TxToDma1Ch92Ena = 28U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_EmvSim1RxToDma1Ch93Ena = 29U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_EmvSim1TxToDma1Ch94Ena = 30U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - kINPUTMUX_I3c0RxToDma1Ch95Ena = 31U + (DMA1_REQ_ENABLE2_REG << ENA_SHIFT), - - /*!< DMA1 REQ ENABLE3 signal. */ - kINPUTMUX_I3c0TxToDma1Ch96Ena = 0U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_I3c1RxToDma1Ch97Ena = 1U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_I3c1TxToDma1Ch98Ena = 2U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Sai0RxToDma1Ch99Ena = 3U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Sai0TxToDma1Ch100Ena = 4U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Sai1RxToDma1Ch101Ena = 5U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Sai1TxToDma1Ch102Ena = 6U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Sinc0IpdReqSincAlt0ToDma1Ch103Ena = 7U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Sinc0IpdReqSincAlt1ToDma1Ch104Ena = 8U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Sinc0IpdReqSincAlt2ToDma1Ch105Ena = 9U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Sinc0IpdReqSincAlt3ToDma1Ch106Ena = 10U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Sinc0IpdReqSincAlt4ToDma1Ch107Ena = 11U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio0PinEventRequest0ToDma1Ch108Ena = 12U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio0PinEventRequest1ToDma1Ch109Ena = 13U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio1PinEventRequest0ToDma1Ch110Ena = 14U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio1PinEventRequest1ToDma1Ch111Ena = 15U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio2PinEventRequest0ToDma1Ch112Ena = 16U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio2PinEventRequest1ToDma1Ch113Ena = 17U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio3PinEventRequest0ToDma1Ch114Ena = 18U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio3PinEventRequest1ToDma1Ch115Ena = 19U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio4PinEventRequest0ToDma1Ch116Ena = 20U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio4PinEventRequest1ToDma1Ch117Ena = 21U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio5PinEventRequest0ToDma1Ch118Ena = 22U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Gpio5PinEventRequest1ToDma1Ch119Ena = 23U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Tsi0EndOfScanToDma1Ch120Ena = 24U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), - kINPUTMUX_Tsi0OutOfRangeToDma1Ch121Ena = 25U + (DMA1_REQ_ENABLE3_REG << ENA_SHIFT), -} inputmux_signal_t; - -/*@}*/ - -/*@}*/ - -#endif /* _FSL_INPUTMUX_CONNECTIONS_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_intm.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_intm.c deleted file mode 100644 index b62eb585b34..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_intm.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_intm.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.intm" -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -/*! - * brief Fill in the INTM config struct with the default settings - * - * The default values are: - * code - * config[0].irqnumber = NotAvail_IRQn; - * config[0].maxtimer = 1000U; - * config[1].irqnumber = NotAvail_IRQn; - * config[1].maxtimer = 1000U; - * config[2].irqnumber = NotAvail_IRQn; - * config[2].maxtimer = 1000U; - * config[3].irqnumber = NotAvail_IRQn; - * config[3].maxtimer = 1000U; - * config->enable = false; - * endcode - * param config Pointer to user's INTM config structure. - */ -void INTM_GetDefaultConfig(intm_config_t *config) -{ - assert(config); - - for (uint32_t i = 0; i < (uint32_t)FSL_FEATURE_INTM_MONITOR_COUNT; i++) - { - config->intm[i].irqnumber = NotAvail_IRQn; - config->intm[i].maxtimer = 1000U; - } - - /* INTM cycle count timer mode disable*/ - config->enable = false; -} - -/*! - * brief Ungates the INTM clock and configures the peripheral for basic operation. - * - * note This API should be called at the beginning of the application using the INTM driver. - * - * param base INTM peripheral base address - * param config Pointer to user's INTM config structure. - */ -void INTM_Init(INTM_Type *base, const intm_config_t *config) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_EnableClock(kCLOCK_Intm); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - for (uint32_t i = 0U; i < (uint32_t)FSL_FEATURE_INTM_MONITOR_COUNT; i++) - { - base->MON[i].INTM_IRQSEL = INTM_MON_INTM_IRQSEL_IRQ(config->intm[i].irqnumber); - base->MON[i].INTM_LATENCY = INTM_MON_INTM_LATENCY_LAT(config->intm[i].maxtimer); - } - - INTM_EnableCycleCount(base, config->enable); -} - -/*! - * brief Disables the INTM module. - * - * param base INTM peripheral base address - */ -void INTM_Deinit(INTM_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate the INTM clock*/ - CLOCK_DisableClock(kCLOCK_Intm); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_intm.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_intm.h deleted file mode 100644 index 4aeb5bd4920..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_intm.h +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_INTM_H_ -#define FSL_INTM_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup intm - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief INTM driver version. */ -#define FSL_INTM_DRIVER_VERSION (MAKE_VERSION(2, 0, 1)) -/*! @} */ - -/*! @brief Interrupt monitors. */ -typedef enum _intm_monitor -{ - kINTM_Monitor1 = 0U, - kINTM_Monitor2, - kINTM_Monitor3, - kINTM_Monitor4 -} intm_monitor_t; - -/*! @brief INTM interrupt source configuration structure. */ -typedef struct _intm_monitor_config -{ - uint32_t maxtimer; /*!< Set the maximum timer */ - IRQn_Type irqnumber; /*!< Select the interrupt request number to monitor. */ -} intm_monitor_config_t; - -/*! @brief INTM configuration structure. */ -typedef struct _intm_config -{ - intm_monitor_config_t intm[FSL_FEATURE_INTM_MONITOR_COUNT]; /*! Interrupt source monitor config.*/ - bool enable; /*!< enables the cycle count timer on a monitored interrupt request for comparison to the latency - register. */ -} intm_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ -/*! - * @brief Fill in the INTM config struct with the default settings - * - * The default values are: - * @code - * config[0].irqnumber = NotAvail_IRQn; - * config[0].maxtimer = 1000U; - * config[1].irqnumber = NotAvail_IRQn; - * config[1].maxtimer = 1000U; - * config[2].irqnumber = NotAvail_IRQn; - * config[2].maxtimer = 1000U; - * config[3].irqnumber = NotAvail_IRQn; - * config[3].maxtimer = 1000U; - * config->enable = false; - * @endcode - * @param config Pointer to user's INTM config structure. - */ -void INTM_GetDefaultConfig(intm_config_t *config); - -/*! - * @brief Ungates the INTM clock and configures the peripheral for basic operation. - * - * @note This API should be called at the beginning of the application using the INTM driver. - * - * @param base INTM peripheral base address - * @param config Pointer to user's INTM config structure. - */ -void INTM_Init(INTM_Type *base, const intm_config_t *config); - -/*! - * @brief Disables the INTM module. - * - * @param base INTM peripheral base address - */ -void INTM_Deinit(INTM_Type *base); - -/*! - * @brief Enable the cycle count timer mode. - * - * Monitor mode enables the cycle count timer on a monitored interrupt request for comparison to the latency register. - * - * @param base INTM peripheral base address. - * @param enable Enable the cycle count or not. - */ -static inline void INTM_EnableCycleCount(INTM_Type *base, bool enable) -{ - if (enable) - { - base->INTM_MM |= INTM_INTM_MM_MM_MASK; - } - else - { - base->INTM_MM &= ~INTM_INTM_MM_MM_MASK; - } -} - -/*! - * @brief Interrupt Acknowledge. - * - * Call this function in ISR to acknowledge interrupt. - * - * @param base INTM peripheral base address. - * @param irq Handle interrupt number. - */ -static inline void INTM_AckIrq(INTM_Type *base, IRQn_Type irq) -{ - assert(((uint32_t)irq) < (uint32_t)NUMBER_OF_INT_VECTORS); - - base->INTM_IACK = (uint32_t)irq; -} - -/*! - * @brief Interrupt Request Select. - * - * This function is used to set the interrupt request number to monitor or check. - * - * @param base INTM peripheral base address. - * @param intms Programmable interrupt monitors. - * @param irq Interrupt request number to monitor. - * - * @return Select the interrupt request number to monitor. - */ -static inline void INTM_SetInterruptRequestNumber(INTM_Type *base, intm_monitor_t intms, IRQn_Type irq) -{ - assert(((uint32_t)irq) < (uint32_t)NUMBER_OF_INT_VECTORS); - - base->MON[intms].INTM_IRQSEL = INTM_MON_INTM_IRQSEL_IRQ(irq); -} - -/*! - * @brief Set the maximum count time. - * - * This function is to set the maximum time from interrupt generation to confirmation. - * - * @param base INTM peripheral base address. - * @param intms Programmable interrupt monitors. - * @param count Timer maximum count. - */ -static inline void INTM_SetMaxTime(INTM_Type *base, intm_monitor_t intms, uint32_t count) -{ - assert((count < 0xFFFFFDU) && (count > 0U)); - - base->MON[intms].INTM_LATENCY = INTM_MON_INTM_LATENCY_LAT(count); -} - -/*! - * @brief Clear the timer period in units of count. - * - * This function is used to clear the INTM_TIMERa register. - * - * @param base INTM peripheral base address. - * @param intms Programmable interrupt monitors. - */ -static inline void INTM_ClearTimeCount(INTM_Type *base, intm_monitor_t intms) -{ - base->MON[intms].INTM_TIMER &= ~INTM_MON_INTM_TIMER_TIMER_MASK; -} - -/*! - * @brief Gets the timer period in units of count. - * - * This function is used to get the number of INTM clock cycles from interrupt request to confirmation interrupt - * processing. If this number exceeds the set maximum time, will be an error signal. - * - * @param base INTM peripheral base address. - * @param intms Programmable interrupt monitors. - */ -static inline uint32_t INTM_GetTimeCount(INTM_Type *base, intm_monitor_t intms) -{ - return base->MON[intms].INTM_TIMER; -} - -/*! - * @brief Interrupt monitor status. - * - * This function indicates whether the INTM_TIMERa value has exceeded the INTM_LATENCYa value. - * If any interrupt source in INTM_TIMERa exceeds the programmed delay value, the monitor state - * can be cleared by calling the INTM_ClearTimeCount() API to clear the corresponding INTM_TIMERa register. - * - * @param base INTM peripheral base address. - * @param intms Programmable interrupt monitors. - * - * @return Whether INTM_TIMER value has exceeded INTM_LATENCY value. - * false:INTM_TIMER value has not exceeded the INTM_LATENCY value; - * true:INTM_TIMER value has exceeded the INTM_LATENCY value. - */ -static inline bool INTM_GetStatusFlags(INTM_Type *base, intm_monitor_t intms) -{ - return ((base->MON[intms].INTM_STATUS & INTM_MON_INTM_STATUS_STATUS_MASK) != 0U); -} - -/*! @} */ -#endif /* FSL_INTM_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_irtc.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_irtc.c deleted file mode 100644 index de5f292bfe4..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_irtc.c +++ /dev/null @@ -1,806 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2019, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_irtc.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.irtc" -#endif - -#define IRTC_BASE_YEAR (2112U) -#define YEAR_RANGE_START (1984U) /* Valid values for year range from -128 to 127; 2112 - 128 */ -#define YEAR_RANGE_END (2239U) /* Valid values for year range from -128 to 127; 2112 + 127 */ - -#if (!(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)) || \ - (defined(FSL_FEATURE_RTC_HAS_RESET) && FSL_FEATURE_RTC_HAS_RESET) -/*! @brief Array to map IRTC instance number to base pointer. */ -static RTC_Type *const kIrtcBases[] = RTC_BASE_PTRS; -#endif - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Array to map IRTC instance number to clock gate enum. */ -static clock_ip_name_t const kIrtcClocks[] = RTC_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(FSL_FEATURE_RTC_HAS_RESET) && FSL_FEATURE_RTC_HAS_RESET -/*! @brief Pointers to IRTC resets for each instance. */ -static const reset_ip_name_t kIrtcResets[] = RTC_RSTS; -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Checks whether the date and time passed in is valid - * - * @param datetime Pointer to structure where the date and time details are stored - * - * @return Returns false if the date & time details are out of range; true if in range - */ -static bool IRTC_CheckDatetimeFormat(const irtc_datetime_t *datetime); - -#if (!(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)) || \ - (defined(FSL_FEATURE_RTC_HAS_RESET) && FSL_FEATURE_RTC_HAS_RESET) -/*! - * @brief Returns an instance number given a base address. - * - * @param base The IRTC peripheral base address. - * @return IRTC instance number starting from 0. If cannot the base address is - * not a valid address, this function returns -1. - */ -static int32_t IRTC_GetInstance(RTC_Type *base); -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -static bool IRTC_CheckDatetimeFormat(const irtc_datetime_t *datetime) -{ - assert(NULL != datetime); - - bool fgRet = true; - - /* Table of days in a month for a non leap year */ - uint8_t daysPerMonth[] = {0U, 31U, 28U, 31U, 30U, 31U, 30U, 31U, 31U, 30U, 31U, 30U, 31U}; - - /* Check year, month, hour, minute, seconds */ - if ((datetime->year < YEAR_RANGE_START) || (datetime->year > YEAR_RANGE_END) || (datetime->month > 12U) || - (datetime->month < 1U) || (datetime->weekDay >= 7U) || (datetime->hour >= 24U) || (datetime->minute >= 60U) || - (datetime->second >= 60U)) - { - /* If not correct then error*/ - fgRet = false; - } - else - { - /* Adjust the days in February for a leap year */ - if (((0U == (datetime->year & 3U)) && (0U != (datetime->year % 100U))) || (0U == (datetime->year % 400U))) - { - daysPerMonth[2] = 29U; - } - - /* Check the validity of the day */ - if ((datetime->day > daysPerMonth[datetime->month]) || (datetime->day < 1U)) - { - fgRet = false; - } - } - return fgRet; -} - -#if (!(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)) || \ - (defined(FSL_FEATURE_RTC_HAS_RESET) && FSL_FEATURE_RTC_HAS_RESET) -static int32_t IRTC_GetInstance(RTC_Type *base) -{ - int32_t instance; - - for (instance = 0; instance < (int32_t)ARRAY_SIZE(kIrtcBases); ++instance) - { - if (kIrtcBases[instance] == base) - { - break; - } - } - - if (instance >= (int32_t)ARRAY_SIZE(kIrtcBases)) - { - instance = -1; - } - - return instance; -} -#endif - -/*! - * brief Ungates the IRTC clock and configures the peripheral for basic operation. - * - * This function initiates a soft-reset of the IRTC module, this has not effect on DST, - * calendaring, standby time and tamper detect registers. - * - * note This API should be called at the beginning of the application using the IRTC driver. - * - * param base IRTC peripheral base address - * param config Pointer to user's IRTC config structure. - * - * return kStatus_Fail if we cannot disable register write protection - */ -status_t IRTC_Init(RTC_Type *base, const irtc_config_t *config) -{ - assert(NULL != config); - - uint16_t reg; - status_t status = kStatus_Success; - -#if (!(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)) || \ - (defined(FSL_FEATURE_RTC_HAS_RESET) && FSL_FEATURE_RTC_HAS_RESET) - int32_t instance = IRTC_GetInstance(base); - if (instance < 0) - { - return kStatus_InvalidArgument; - } -#endif - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_EnableClock(kIrtcClocks[instance]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(FSL_FEATURE_RTC_HAS_RESET) && FSL_FEATURE_RTC_HAS_RESET - RESET_ReleasePeripheralReset(kIrtcResets[instance]); -#endif - - /* Unlock to allow register write operation */ - if (kStatus_Success == IRTC_SetWriteProtection(base, false)) - { - /* Issue a software reset */ - IRTC_Reset(base); - -#if !defined(FSL_FEATURE_RTC_HAS_NO_CTRL2_WAKEUP_MODE) || (!FSL_FEATURE_RTC_HAS_NO_CTRL2_WAKEUP_MODE) - /* Setup the wakeup pin select */ - if (config->wakeupSelect) - { - base->CTRL2 |= RTC_CTRL2_WAKEUP_MODE_MASK; - } - else - { - base->CTRL2 &= ~(uint16_t)RTC_CTRL2_WAKEUP_MODE_MASK; - } -#endif - /* Setup alarm match operation, sampling clock operation in standby mode, 16.384kHz RTC clock and selected clock outout to other peripherals */ - reg = base->CTRL; - reg &= ~( -#if !defined(FSL_FEATURE_RTC_HAS_NO_TIMER_STB_MASK) || (!FSL_FEATURE_RTC_HAS_NO_TIMER_STB_MASK) - (uint16_t)RTC_CTRL_TIMER_STB_MASK_MASK | -#endif -#if defined(FSL_FEATURE_RTC_HAS_CLOCK_SELECT) && FSL_FEATURE_RTC_HAS_CLOCK_SELECT - (uint16_t)RTC_CTRL_CLK_SEL_MASK | -#endif -#if defined(FSL_FEATURE_RTC_HAS_CLOCK_OUTPUT_DISABLE) && FSL_FEATURE_RTC_HAS_CLOCK_OUTPUT_DISABLE - (uint16_t)RTC_CTRL_CLKO_DIS_MASK | -#endif - (uint16_t)RTC_CTRL_ALM_MATCH_MASK); - reg |= ( -#if !defined(FSL_FEATURE_RTC_HAS_NO_TIMER_STB_MASK) || (!FSL_FEATURE_RTC_HAS_NO_TIMER_STB_MASK) - RTC_CTRL_TIMER_STB_MASK(config->timerStdMask) | -#endif -#if defined(FSL_FEATURE_RTC_HAS_CLOCK_SELECT) && FSL_FEATURE_RTC_HAS_CLOCK_SELECT - RTC_CTRL_CLK_SEL(config->clockSelect) | -#endif -#if defined(FSL_FEATURE_RTC_HAS_CLOCK_OUTPUT_DISABLE) && FSL_FEATURE_RTC_HAS_CLOCK_OUTPUT_DISABLE - RTC_CTRL_CLKO_DIS(config->disableClockOutput) | -#endif - RTC_CTRL_ALM_MATCH(config->alrmMatch)); - base->CTRL = reg; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -/* - * brief Gate the IRTC clock - * - * param base IRTC peripheral base address - */ -status_t IRTC_Deinit(RTC_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - int32_t instance = IRTC_GetInstance(base); - if (instance < 0) - { - return kStatus_InvalidArgument; - } - - CLOCK_DisableClock(kIrtcClocks[instance]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - return kStatus_Success; -} - -/*! - * brief Fill in the IRTC config struct with the default settings - * - * The default values are: - * code - * config->wakeupSelect = true; - * config->timerStdMask = false; - * config->alrmMatch = kRTC_MatchSecMinHr; - * endcode - * param config Pointer to user's IRTC config structure. - */ -void IRTC_GetDefaultConfig(irtc_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - -#if !defined(FSL_FEATURE_RTC_HAS_NO_CTRL2_WAKEUP_MODE) || (!FSL_FEATURE_RTC_HAS_NO_CTRL2_WAKEUP_MODE) - /* Tamper pin 0 is used as a wakeup/hibernation pin */ - config->wakeupSelect = true; -#endif - -#if !defined(FSL_FEATURE_RTC_HAS_NO_TIMER_STB_MASK) || (!FSL_FEATURE_RTC_HAS_NO_TIMER_STB_MASK) - /* Sampling clock are not gated when in standby mode */ - config->timerStdMask = false; -#endif - - /* Only seconds, minutes and hours are matched when generating an alarm */ - config->alrmMatch = kRTC_MatchSecMinHr; - -#if defined(FSL_FEATURE_RTC_HAS_CLOCK_SELECT) && FSL_FEATURE_RTC_HAS_CLOCK_SELECT - /* 16.384kHz clock is selected */ - config->clockSelect = kIRTC_Clk16K; -#endif - -#if defined(FSL_FEATURE_RTC_HAS_CLOCK_OUTPUT_DISABLE) && FSL_FEATURE_RTC_HAS_CLOCK_OUTPUT_DISABLE - /* The selected clock is not output to other peripherals */ - config->disableClockOutput = true; -#endif -} - -#if !(defined(FSL_FEATURE_RTC_IS_SLAVE) && (FSL_FEATURE_RTC_IS_SLAVE != 0U)) -/*! - * brief Sets the IRTC date and time according to the given time structure. - * - * The IRTC counter is started after the time is set. - * - * param base IRTC peripheral base address - * param datetime Pointer to structure where the date and time details to set are stored - * - * return kStatus_Success: success in setting the time and starting the IRTC - * kStatus_InvalidArgument: failure. An error occurs because the datetime format is incorrect. - */ -status_t IRTC_SetDatetime(RTC_Type *base, const irtc_datetime_t *datetime) -{ - assert(NULL != datetime); - - status_t status = kStatus_Success; - - /* Return error if the time provided is not valid */ - if (IRTC_CheckDatetimeFormat(datetime)) - { - /* The register stores the offset in years from the base year of 2112 */ - if (datetime->year < IRTC_BASE_YEAR) - { - /* Values for years less than the base year range from -128 to 1 */ - base->YEARMON = - RTC_YEARMON_YROFST(0x100U + datetime->year - IRTC_BASE_YEAR) | RTC_YEARMON_MON_CNT(datetime->month); - } - else - { - /* Values for years greater or equal to the base year range from 0 to 127 */ - base->YEARMON = RTC_YEARMON_YROFST(datetime->year - IRTC_BASE_YEAR) | RTC_YEARMON_MON_CNT(datetime->month); - } - /* Update the Day Count and Day of the week field */ - base->DAYS = RTC_DAYS_DOW(datetime->weekDay) | RTC_DAYS_DAY_CNT(datetime->day); - - /* Update hour and minute field */ - base->HOURMIN = RTC_HOURMIN_HOUR_CNT(datetime->hour) | RTC_HOURMIN_MIN_CNT(datetime->minute); - - /* Update the seconds register */ - base->SECONDS = RTC_SECONDS_SEC_CNT(datetime->second); - } - else - { - status = kStatus_InvalidArgument; - } - - return status; -} -#endif /* FSL_FEATURE_RTC_IS_SLAVE */ - -/*! - * brief Gets the IRTC time and stores it in the given time structure. - * - * param base IRTC peripheral base address - * param datetime Pointer to structure where the date and time details are stored. - */ -void IRTC_GetDatetime(RTC_Type *base, irtc_datetime_t *datetime) -{ - assert(NULL != datetime); - - uint16_t temp = base->YEARMON; - - datetime->year = - (uint16_t)IRTC_BASE_YEAR + (uint16_t)((int8_t)(uint8_t)((temp >> RTC_YEARMON_YROFST_SHIFT) & 0xFFU)); - datetime->month = (uint8_t)temp & RTC_YEARMON_MON_CNT_MASK; - - temp = base->DAYS; - datetime->weekDay = (uint8_t)((temp & RTC_DAYS_DOW_MASK) >> RTC_DAYS_DOW_SHIFT); - datetime->day = (uint8_t)temp & RTC_DAYS_DAY_CNT_MASK; - - temp = base->HOURMIN; - datetime->hour = (uint8_t)((temp & RTC_HOURMIN_HOUR_CNT_MASK) >> RTC_HOURMIN_HOUR_CNT_SHIFT); - datetime->minute = (uint8_t)temp & RTC_HOURMIN_MIN_CNT_MASK; - - datetime->second = (uint8_t)(base->SECONDS) & RTC_SECONDS_SEC_CNT_MASK; -} - -/*! - * brief Sets the IRTC alarm time - * - * param base RTC peripheral base address - * param alarmTime Pointer to structure where the alarm time is stored. - * - * note weekDay field of alarmTime is not used during alarm match and should be set to 0 - * - * return kStatus_Success: success in setting the alarm - * kStatus_InvalidArgument: error in setting the alarm. Error occurs because the alarm - * datetime format is incorrect. - */ -status_t IRTC_SetAlarm(RTC_Type *base, const irtc_datetime_t *alarmTime) -{ - assert(NULL != alarmTime); - - status_t status = kStatus_Success; - - /* Return error if the alarm time provided is not valid */ - if (IRTC_CheckDatetimeFormat(alarmTime)) - { - /* Set the alarm year */ - if (alarmTime->year < IRTC_BASE_YEAR) - { - base->ALM_YEARMON = RTC_ALM_YEARMON_ALM_YEAR(0x100U + alarmTime->year - IRTC_BASE_YEAR) | - RTC_ALM_YEARMON_ALM_MON(alarmTime->month); - } - else - { - base->ALM_YEARMON = - RTC_ALM_YEARMON_ALM_YEAR(alarmTime->year - IRTC_BASE_YEAR) | RTC_ALM_YEARMON_ALM_MON(alarmTime->month); - } - - /* Set the alarm day */ - base->ALM_DAYS = RTC_ALM_DAYS_ALM_DAY(alarmTime->day); - - /* Set the alarm hour and minute */ - base->ALM_HOURMIN = RTC_ALM_HOURMIN_ALM_HOUR(alarmTime->hour) | RTC_ALM_HOURMIN_ALM_MIN(alarmTime->minute); - - /* Set the alarm seconds */ - base->ALM_SECONDS = RTC_ALM_SECONDS_ALM_SEC(alarmTime->second); - } - else - { - status = kStatus_InvalidArgument; - } - - return status; -} - -/*! - * brief Returns the IRTC alarm time. - * - * param base RTC peripheral base address - * param datetime Pointer to structure where the alarm date and time details are stored. - */ -void IRTC_GetAlarm(RTC_Type *base, irtc_datetime_t *datetime) -{ - assert(NULL != datetime); - - uint16_t temp = base->ALM_YEARMON; - - datetime->year = - (uint16_t)IRTC_BASE_YEAR + (uint16_t)((int8_t)(uint8_t)((temp >> RTC_ALM_YEARMON_ALM_YEAR_SHIFT) & 0xFFU)); - datetime->month = (uint8_t)temp & RTC_ALM_YEARMON_ALM_MON_MASK; - - datetime->day = (uint8_t)(base->ALM_DAYS) & RTC_ALM_DAYS_ALM_DAY_MASK; - - temp = base->ALM_HOURMIN; - datetime->hour = (uint8_t)((temp & RTC_ALM_HOURMIN_ALM_HOUR_MASK) >> RTC_ALM_HOURMIN_ALM_HOUR_SHIFT); - datetime->minute = (uint8_t)temp & RTC_ALM_HOURMIN_ALM_MIN_MASK; - - datetime->second = (uint8_t)(base->ALM_SECONDS) & RTC_ALM_SECONDS_ALM_SEC_MASK; -} - -/*! - * brief Locks or unlocks IRTC registers for write access. - * - * note When the registers are unlocked, they remain in unlocked state for - * 2 seconds, after which they are locked automatically. After - * power-on-reset, the registers come out unlocked and they are locked - * automatically 15 seconds after power on. - * - * param base IRTC peripheral base address - * param lock true: Lock IRTC registers; false: Unlock IRTC registers. - * - * return kStatus_Success: if lock or unlock operation is successful - * kStatus_Fail: if lock or unlock operation fails even after multiple retry attempts - */ -status_t IRTC_SetWriteProtection(RTC_Type *base, bool lock) -{ - /* Retry before giving up */ - uint8_t repeatProtectSequence = 0xFFU; - status_t status = kStatus_Success; - - if (!lock) - { - /* Unlock IRTC registers */ - while ((0U != (base->STATUS & (uint16_t)RTC_STATUS_WRITE_PROT_EN_MASK)) && (0U != repeatProtectSequence)) - { - /* Access in 8-bit mode while storing the value */ - *(__IO uint8_t *)(&base->STATUS) = 0U; - *(__IO uint8_t *)(&base->STATUS) = 0x40U; - *(__IO uint8_t *)(&base->STATUS) = 0xC0U; - *(__IO uint8_t *)(&base->STATUS) = 0x80U; - repeatProtectSequence--; - } - } - else - { - /* Lock IRTC registers */ - while ((0U == ((base->STATUS & (uint16_t)RTC_STATUS_WRITE_PROT_EN_MASK) >> RTC_STATUS_WRITE_PROT_EN_SHIFT)) && - (0U != repeatProtectSequence)) - { - *(__IO uint8_t *)(&base->STATUS) = 0x80U; - repeatProtectSequence--; - } - } - - /* Lock/unlock was not successful even after trying 256 times */ - if (0U == repeatProtectSequence) - { - status = kStatus_Fail; - } - - return status; -} - -#if !(defined(FSL_FEATURE_RTC_IS_SLAVE) && (FSL_FEATURE_RTC_IS_SLAVE != 0U)) -/*! - * brief Sets the IRTC daylight savings start and stop date and time. - * - * It also enables the daylight saving bit in the IRTC control register - * - * param base IRTC peripheral base address - * param datetime Pointer to a structure where the date and time details are stored. - */ -void IRTC_SetDaylightTime(RTC_Type *base, const irtc_daylight_time_t *datetime) -{ - assert(NULL != datetime); - - /* Disable daylight saving time */ - base->CTRL &= ~(uint16_t)RTC_CTRL_DST_EN_MASK; - - /* Set the daylight saving time start month and end month value */ - base->DST_MONTH = - RTC_DST_MONTH_DST_START_MONTH(datetime->startMonth) | RTC_DST_MONTH_DST_END_MONTH(datetime->endMonth); - - /* Set the daylight saving time start day and end day value */ - base->DST_DAY = RTC_DST_DAY_DST_START_DAY(datetime->startDay) | RTC_DST_DAY_DST_END_DAY(datetime->endDay); - - /* Set the daylight saving time start hour and end hour value */ - base->DST_HOUR = RTC_DST_HOUR_DST_START_HOUR(datetime->startHour) | RTC_DST_HOUR_DST_END_HOUR(datetime->endHour); - - /* Enable daylight saving time */ - base->CTRL |= RTC_CTRL_DST_EN_MASK; -} -#endif /* FSL_FEATURE_RTC_IS_SLAVE */ - -/*! - * brief Gets the IRTC daylight savings time and stores it in the given time structure. - * - * param base IRTC peripheral base address - * param datetime Pointer to a structure where the date and time details are stored. - */ -void IRTC_GetDaylightTime(RTC_Type *base, irtc_daylight_time_t *datetime) -{ - assert(NULL != datetime); - - uint16_t temp = base->DST_MONTH; - - /* Get the daylight savings time start and end month value */ - datetime->startMonth = - (uint8_t)((temp & RTC_DST_MONTH_DST_START_MONTH_MASK) >> RTC_DST_MONTH_DST_START_MONTH_SHIFT); - datetime->endMonth = (uint8_t)((temp & RTC_DST_MONTH_DST_END_MONTH_MASK) >> RTC_DST_MONTH_DST_END_MONTH_SHIFT); - - /* Get the daylight savings time start and end day value */ - temp = base->DST_DAY; - datetime->startDay = (uint8_t)((temp & RTC_DST_DAY_DST_START_DAY_MASK) >> RTC_DST_DAY_DST_START_DAY_SHIFT); - datetime->endDay = (uint8_t)((temp & RTC_DST_DAY_DST_END_DAY_MASK) >> RTC_DST_DAY_DST_END_DAY_SHIFT); - - /* Get the daylight savings time start and end hour value */ - temp = base->DST_HOUR; - datetime->startHour = (uint8_t)((temp & RTC_DST_HOUR_DST_START_HOUR_MASK) >> RTC_DST_HOUR_DST_START_HOUR_SHIFT); - datetime->endHour = (uint8_t)((temp & RTC_DST_HOUR_DST_END_HOUR_MASK) >> RTC_DST_HOUR_DST_END_HOUR_SHIFT); -} - -#if !(defined(FSL_FEATURE_RTC_IS_SLAVE) && (FSL_FEATURE_RTC_IS_SLAVE != 0U)) -/*! - * brief Enables the coarse compensation and sets the value in the IRTC compensation register. - * - * param base IRTC peripheral base address - * param compensationValue Compensation value is a 2's complement value. - * param compensationInterval Compensation interval. - */ -void IRTC_SetCoarseCompensation(RTC_Type *base, uint8_t compensationValue, uint8_t compensationInterval) -{ - uint16_t reg; - - /* Set the compensation value and interval */ - base->COMPEN = (uint16_t)compensationValue | ((uint16_t)compensationInterval << 8U); - - /* Disable fine and enable coarse compensation */ - reg = base->CTRL; - reg &= ~(uint16_t)RTC_CTRL_FINEEN_MASK; - reg |= RTC_CTRL_COMP_EN_MASK; - base->CTRL = reg; -} - -/*! - * brief Enables the fine compensation and sets the value in the IRTC compensation register. - * - * param base The IRTC peripheral base address - * param integralValue Compensation integral value; twos complement value of the integer part - * param fractionValue Compensation fraction value expressed as number of clock cycles of a - * fixed 4.194304Mhz clock that have to be added. - * param accumulateFractional Flag indicating if we want to add to previous fractional part; - * true: Add to previously accumulated fractional part, - * false: Start afresh and overwrite current value - */ -void IRTC_SetFineCompensation(RTC_Type *base, uint8_t integralValue, uint8_t fractionValue, bool accumulateFractional) -{ - if (!accumulateFractional) - { - /* Disable compensation to clear previous accumulated fractional part */ - base->CTRL &= ~(((uint16_t)1U << RTC_CTRL_COMP_EN_SHIFT) | ((uint16_t)1U << RTC_CTRL_FINEEN_SHIFT)); - } - - /* Set the compensation fractional and integral parts */ - base->COMPEN = ((uint16_t)fractionValue & 0x7FU) | (((uint16_t)integralValue & 0xFU) << 12U); - /* Enable fine compensation */ - base->CTRL |= (RTC_CTRL_COMP_EN_MASK | RTC_CTRL_FINEEN_MASK); -} -#endif /* FSL_FEATURE_RTC_IS_SLAVE */ - -#if !defined(FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) || (!FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) - -/*! - * brief This function allows configuring the four tamper inputs. - * - * The function configures the filter properties for the three external tampers. - * It also sets up active/passive and direction of the tamper bits, which are not available - * on all platforms. - * note This function programs the tamper filter parameters. The user must gate the 32K clock to - * the RTC before calling this function. It is assumed that the time and date are set after this - * and the tamper parameters do not require to be changed again later. - * - * param base The IRTC peripheral base address - * param tamperNumber The IRTC tamper input to configure - * param tamperConfig The IRTC tamper properties - */ -void IRTC_SetTamperParams(RTC_Type *base, irtc_tamper_pins_t tamperNumber, const irtc_tamper_config_t *tamperConfig) -{ - assert(NULL != tamperConfig); - - uint16_t reg = 0; - -#if defined(FSL_FEATURE_RTC_HAS_TAMPER_DIRECTION) && (FSL_FEATURE_RTC_HAS_TAMPER_DIRECTION) - reg = base->TAMPER_DIRECTION; - /* Set whether tamper pin is active or passive */ - if (tamperConfig->activePassive) - { - /* In case of active tamper, set the direction */ - reg |= (1U << tamperNumber); - if (tamperConfig->direction) - { - /* Tamper direction is output */ - reg |= (1U << (RTC_TAMPER_DIRECTION_I_O_TAMP_SHIFT + tamperNumber)); - } - else - { - /* Tamper direction is input */ - reg &= ~(1U << (RTC_TAMPER_DIRECTION_I_O_TAMP_SHIFT + tamperNumber)); - } - } - else - { - /* Passive tampers are input only and the direction bit is read only in this case */ - reg &= ~(1U << tamperNumber); - } - base->TAMPER_DIRECTION = reg; -#endif /* FSL_FEATURE_RTC_HAS_TAMPER_DIRECTION */ - - /* Set the filter properties for the external tamper pins */ - switch (tamperNumber) - { - case kIRTC_Tamper_0: - /* Set the pin for Tamper 0 */ -#if !defined(FSL_FEATURE_RTC_HAS_NO_CTRL2_WAKEUP_MODE) || (!FSL_FEATURE_RTC_HAS_NO_CTRL2_WAKEUP_MODE) - base->CTRL2 &= ~(uint16_t)RTC_CTRL2_WAKEUP_MODE_MASK; -#endif - reg = base->FILTER01_CFG; - reg &= ~((uint16_t)RTC_FILTER01_CFG_POL0_MASK | (uint16_t)RTC_FILTER01_CFG_FIL_DUR0_MASK | - (uint16_t)RTC_FILTER01_CFG_CLK_SEL0_MASK); - reg |= (RTC_FILTER01_CFG_POL0(tamperConfig->pinPolarity) | - RTC_FILTER01_CFG_FIL_DUR0(tamperConfig->filterDuration) | - RTC_FILTER01_CFG_CLK_SEL0(tamperConfig->filterClk)); - base->FILTER01_CFG = reg; - break; - case kIRTC_Tamper_1: - reg = base->FILTER01_CFG; - reg &= ~((uint16_t)RTC_FILTER01_CFG_POL1_MASK | (uint16_t)RTC_FILTER01_CFG_FIL_DUR1_MASK | - (uint16_t)RTC_FILTER01_CFG_CLK_SEL1_MASK); - reg |= (RTC_FILTER01_CFG_POL1(tamperConfig->pinPolarity) | - RTC_FILTER01_CFG_FIL_DUR1(tamperConfig->filterDuration) | - RTC_FILTER01_CFG_CLK_SEL1(tamperConfig->filterClk)); - base->FILTER01_CFG = reg; - break; -#if defined(FSL_FEATURE_RTC_HAS_FILTER23_CFG) && FSL_FEATURE_RTC_HAS_FILTER23_CFG - case kIRTC_Tamper_2: - reg = base->FILTER23_CFG; - reg &= ~((uint16_t)RTC_FILTER23_CFG_POL2_MASK | (uint16_t)RTC_FILTER23_CFG_FIL_DUR2_MASK | - (uint16_t)RTC_FILTER23_CFG_CLK_SEL2_MASK); - reg |= (RTC_FILTER23_CFG_POL2(tamperConfig->pinPolarity) | - RTC_FILTER23_CFG_FIL_DUR2(tamperConfig->filterDuration) | - RTC_FILTER23_CFG_CLK_SEL2(tamperConfig->filterClk)); - base->FILTER23_CFG = reg; - break; - case kIRTC_Tamper_3: - reg = base->FILTER23_CFG; - reg &= ~((uint16_t)RTC_FILTER23_CFG_POL3_MASK | (uint16_t)RTC_FILTER23_CFG_FIL_DUR3_MASK | - (uint16_t)RTC_FILTER23_CFG_CLK_SEL3_MASK); - reg |= (RTC_FILTER23_CFG_POL3(tamperConfig->pinPolarity) | - RTC_FILTER23_CFG_FIL_DUR3(tamperConfig->filterDuration) | - RTC_FILTER23_CFG_CLK_SEL3(tamperConfig->filterClk)); - base->FILTER23_CFG = reg; - break; -#else - case kIRTC_Tamper_2: - reg = base->FILTER2_CFG; - reg &= ~((uint16_t)RTC_FILTER2_CFG_POL2_MASK | (uint16_t)RTC_FILTER2_CFG_FIL_DUR2_MASK | - (uint16_t)RTC_FILTER2_CFG_CLK_SEL2_MASK); - reg |= (RTC_FILTER2_CFG_POL2(tamperConfig->pinPolarity) | - RTC_FILTER2_CFG_FIL_DUR2(tamperConfig->filterDuration) | - RTC_FILTER2_CFG_CLK_SEL2(tamperConfig->filterClk)); - base->FILTER2_CFG = reg; - break; -#endif - - default: - /* Internal tamper, does not have filter configuration. */ - break; - } -} - -#endif - -#if !defined(FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) || (!FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) -#if defined(FSL_FEATURE_RTC_HAS_TAMPER_QUEUE) && (FSL_FEATURE_RTC_HAS_TAMPER_QUEUE) - -/*! - * brief This function reads the tamper timestamp and returns the associated tamper pin. - * - * The tamper timestamp has month, day, hour, minutes, and seconds. Ignore the year field as this - * information is not available in the tamper queue. The user should look at the RTC_YEARMON register - * for this because the expectation is that the queue is read at least once a year. - * Return the tamper pin number associated with the timestamp. - * - * param base The IRTC peripheral base address - * param tamperTimestamp The tamper timestamp - * - * return The tamper pin number - */ -uint8_t IRTC_ReadTamperQueue(RTC_Type *base, irtc_datetime_t *tamperTimestamp) -{ - assert(NULL != tamperTimestamp); - - /* Read the register 2 times to get a entry*/ - uint16_t temp1 = base->TAMPER_QUEUE; - uint16_t temp2 = base->TAMPER_QUEUE; - uint8_t tamperNum; - - /* - * Tamper queue does not store the year field as this value can be read from RTC_YEARMON. - * It is expected that the queue will be read at least once in a year. - */ - tamperTimestamp->year = 0; - /* From the first read; TAMPER_DATA[4:0] is the hour field */ - tamperTimestamp->hour = (uint8_t)temp1 & 0x1FU; - /* From the first read; TAMPER_DATA[9:5] is the day field */ - tamperTimestamp->day = (uint8_t)(temp1 >> 5U) & 0x1FU; - /* From the first read; TAMPER_DATA[13:10] is the month field */ - tamperTimestamp->month = (uint8_t)(temp1 >> 10U) & 0xFU; - - /* From the second read; TAMPER_DATA[5:0] is the seconds field */ - tamperTimestamp->second = (uint8_t)temp2 & 0x3FU; - /* From the second read; TAMPER_DATA[11:6] is the minutes field */ - tamperTimestamp->minute = (uint8_t)(temp2 >> 6U) & 0x3FU; - /* From the second read; TAMPER_DATA[14:12] is the tamper index */ - tamperNum = (uint8_t)(temp2 >> 12U) & 0x7U; - - return tamperNum; -} - -#endif /* FSL_FEATURE_RTC_HAS_TAMPER_QUEUE */ -#endif /* FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE */ - -/*! - * brief Select which clock to output from RTC. - * - * Select which clock to output from RTC for other modules to use inside SoC, for example, - * RTC subsystem needs RTC to output 1HZ clock for sub-second counter. - * - * param base IRTC peripheral base address - * param cloOut select clock to use for output - */ -void IRTC_ConfigClockOut(RTC_Type *base, irtc_clockout_sel_t clkOut) -{ - uint16_t ctrlVal = base->CTRL; - - ctrlVal &= (uint16_t)(~RTC_CTRL_CLKOUT_MASK); - - ctrlVal |= RTC_CTRL_CLKOUT((uint16_t)clkOut); - -#if !(defined(FSL_FEATURE_RTC_IS_SLAVE) && (FSL_FEATURE_RTC_IS_SLAVE != 0U)) - if (clkOut == kIRTC_ClkoutCoarse1Hz) - { - ctrlVal |= RTC_CTRL_COMP_EN_MASK; - } - else if (clkOut == kIRTC_ClkoutFine1Hz) - { - ctrlVal |= RTC_CTRL_FINEEN_MASK; - } - else - { - /* empty else */ - } -#endif /* FSL_FEATURE_RTC_IS_SLAVE */ - - base->CTRL = ctrlVal; -} - -#if defined(FSL_FEATURE_RTC_HAS_CLOCK_SELECT) && FSL_FEATURE_RTC_HAS_CLOCK_SELECT - -/*! - * brief Select which clock is used by RTC. - * - * Select which clock is used by RTC to output to the peripheral - * and divided to generate a 512 Hz clock and a 1 Hz clock. - * - * param base IRTC peripheral base address - * param clkSelect select clock used by RTC - */ -void IRTC_ConfigClockSelect(RTC_Type *base, irtc_clock_select_t clkSelect) -{ - uint16_t ctrlVal = base->CTRL; - - ctrlVal &= (uint16_t)(~RTC_CTRL_CLK_SEL_MASK); - - ctrlVal |= RTC_CTRL_CLK_SEL((uint16_t)clkSelect); - - base->CTRL = ctrlVal; -} - -#endif /* FSL_FEATURE_RTC_HAS_CLOCK_SELECT */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_irtc.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_irtc.h deleted file mode 100644 index da9ba42f0ff..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_irtc.h +++ /dev/null @@ -1,868 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2019, 2022-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_IRTC_H_ -#define FSL_IRTC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup irtc - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -#define FSL_IRTC_DRIVER_VERSION (MAKE_VERSION(2, 3, 1)) -/*! @} */ - -#if !(defined(FSL_FEATURE_RTC_IS_SLAVE) && (FSL_FEATURE_RTC_IS_SLAVE != 0U)) -#define IRTC_STATUS_W1C_BITS ((uint16_t)(RTC_STATUS_BUS_ERR_MASK) | (uint16_t)(RTC_STATUS_CMP_DONE_MASK)) -#else -#define IRTC_STATUS_W1C_BITS ((uint16_t)(RTC_STATUS_BUS_ERR_MASK)) -#endif - -#if defined(FSL_FEATURE_RTC_HAS_CLOCK_SELECT) && FSL_FEATURE_RTC_HAS_CLOCK_SELECT -/*! @brief IRTC clock select. */ -typedef enum _irtc_clock_select -{ - kIRTC_Clk16K = 0x0U, /*!< 16.384 kHz clock is selected.*/ - kIRTC_Clk32K = 0x1U, /*!< 32.768 kHz clock is selected.*/ -} irtc_clock_select_t; -#endif - -#if !defined(FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) || (!FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) -/*! @brief IRTC filter clock source options. */ -typedef enum _irtc_filter_clock_source -{ - kIRTC_32K = 0x0U, /*!< Use 32 kHz clock source for the tamper filter.*/ - kIRTC_512 = 0x1U, /*!< Use 512 Hz clock source for the tamper filter.*/ - kIRTC_128 = 0x2U, /*!< Use 128 Hz clock source for the tamper filter.*/ - kIRTC_64 = 0x3U, /*!< Use 64 Hz clock source for the tamper filter.*/ - kIRTC_16 = 0x4U, /*!< Use 16 Hz clock source for the tamper filter.*/ - kIRTC_8 = 0x5U, /*!< Use 8 Hz clock source for the tamper filter.*/ - kIRTC_4 = 0x6U, /*!< Use 4 Hz clock source for the tamper filter.*/ - kIRTC_2 = 0x7U /*!< Use 2 Hz clock source for the tamper filter.*/ -} irtc_filter_clock_source_t; - -/*! @brief IRTC Tamper pins. */ -typedef enum _irtc_tamper_pins -{ - kIRTC_Tamper_0 = 0U, /*!< External Tamper 0 */ - kIRTC_Tamper_1, /*!< External Tamper 1 */ - kIRTC_Tamper_2, /*!< External Tamper 2 */ - kIRTC_Tamper_3 /*!< Internal tamper, does not have filter configuration */ -} irtc_tamper_pins_t; -#endif - -/*! @brief List of IRTC interrupts */ -typedef enum _irtc_interrupt_enable -{ -#if !defined(FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) || (!FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) - kIRTC_TamperInterruptEnable = RTC_IER_TAMPER_IE_MASK, /*!< Tamper Interrupt Enable */ -#endif - kIRTC_AlarmInterruptEnable = RTC_IER_ALM_IE_MASK, /*!< Alarm Interrupt Enable */ - kIRTC_DayInterruptEnable = RTC_IER_DAY_IE_MASK, /*!< Days Interrupt Enable */ - kIRTC_HourInterruptEnable = RTC_IER_HOUR_IE_MASK, /*!< Hours Interrupt Enable */ - kIRTC_MinInterruptEnable = RTC_IER_MIN_IE_MASK, /*!< Minutes Interrupt Enable */ - kIRTC_1hzInterruptEnable = RTC_IER_IE_1HZ_MASK, /*!< 1 Hz interval Interrupt Enable */ - kIRTC_2hzInterruptEnable = RTC_IER_IE_2HZ_MASK, /*!< 2 Hz interval Interrupt Enable */ - kIRTC_4hzInterruptEnable = RTC_IER_IE_4HZ_MASK, /*!< 4 Hz interval Interrupt Enable */ - kIRTC_8hzInterruptEnable = RTC_IER_IE_8HZ_MASK, /*!< 8 Hz interval Interrupt Enable */ - kIRTC_16hzInterruptEnable = RTC_IER_IE_16HZ_MASK, /*!< 16 Hz interval Interrupt Enable */ - kIRTC_32hzInterruptEnable = RTC_IER_IE_32HZ_MASK, /*!< 32 Hz interval Interrupt Enable */ - kIRTC_64hzInterruptEnable = RTC_IER_IE_64HZ_MASK, /*!< 64 Hz interval Interrupt Enable */ - kIRTC_128hzInterruptEnable = RTC_IER_IE_128HZ_MASK, /*!< 128 Hz interval Interrupt Enable */ - kIRTC_256hzInterruptEnable = RTC_IER_IE_256HZ_MASK, /*!< 256 Hz interval Interrupt Enable */ - kIRTC_512hzInterruptEnable = RTC_IER_IE_512HZ_MASK, /*!< 512 Hz interval Interrupt Enable */ -#if defined(FSL_FEATURE_RTC_HAS_SUBSYSTEM) && FSL_FEATURE_RTC_HAS_SUBSYSTEM - kIRTC_WakeTimerInterruptEnable = (RTC_WAKE_TIMER_CTRL_INTR_EN_MASK << 16U), /*!< Wake timer Interrupt Enable */ -#endif -#if defined(FSL_FEATURE_RTC_HAS_TAMPER_QUEUE) && FSL_FEATURE_RTC_HAS_TAMPER_QUEUE - kIRTC_TamperQueueFullInterruptEnable = - (RTC_TAMPER_QSCR_Q_FULL_INT_EN_MASK << 24U), /*!< Tamper queue full Interrupt Enable */ -#endif -} irtc_interrupt_enable_t; - -/*! @brief List of IRTC flags */ -typedef enum _irtc_status_flags -{ -#if !defined(FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) || (!FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) - kIRTC_TamperFlag = RTC_ISR_TAMPER_IS_MASK, /*!< Tamper Status flag*/ -#endif - kIRTC_AlarmFlag = RTC_ISR_ALM_IS_MASK, /*!< Alarm Status flag */ - kIRTC_DayFlag = RTC_ISR_DAY_IS_MASK, /*!< Days Status flag */ - kIRTC_HourFlag = RTC_ISR_HOUR_IS_MASK, /*!< Hour Status flag */ - kIRTC_MinFlag = RTC_ISR_MIN_IS_MASK, /*!< Minutes Status flag */ - kIRTC_1hzFlag = RTC_ISR_IS_1HZ_MASK, /*!< 1 Hz interval status flag */ - kIRTC_2hzFlag = RTC_ISR_IS_2HZ_MASK, /*!< 2 Hz interval status flag*/ - kIRTC_4hzFlag = RTC_ISR_IS_4HZ_MASK, /*!< 4 Hz interval status flag*/ - kIRTC_8hzFlag = RTC_ISR_IS_8HZ_MASK, /*!< 8 Hz interval status flag*/ - kIRTC_16hzFlag = RTC_ISR_IS_16HZ_MASK, /*!< 16 Hz interval status flag*/ - kIRTC_32hzFlag = RTC_ISR_IS_32HZ_MASK, /*!< 32 Hz interval status flag*/ - kIRTC_64hzFlag = RTC_ISR_IS_64HZ_MASK, /*!< 64 Hz interval status flag*/ - kIRTC_128hzFlag = RTC_ISR_IS_128HZ_MASK, /*!< 128 Hz interval status flag*/ - kIRTC_256hzFlag = RTC_ISR_IS_256HZ_MASK, /*!< 256 Hz interval status flag*/ - kIRTC_512hzFlag = RTC_ISR_IS_512HZ_MASK, /*!< 512 Hz interval status flag*/ - kIRTC_InvalidFlag = (RTC_STATUS_INVAL_BIT_MASK << 16U), /*!< Indicates if time/date counters are invalid */ - kIRTC_WriteProtFlag = (RTC_STATUS_WRITE_PROT_EN_MASK << 16U), /*!< Write protect enable status flag */ -#if !defined(FSL_FEATURE_RTC_HAS_NO_CPU_LOW_VOLT_FLAG) || (!FSL_FEATURE_RTC_HAS_NO_CPU_LOW_VOLT_FLAG) - kIRTC_CpuLowVoltFlag = (RTC_STATUS_CPU_LOW_VOLT_MASK << 16U), /*!< CPU low voltage warning flag */ -#endif -#if !defined(FSL_FEATURE_RTC_HAS_NO_RST_SRC_FLAG) || (!FSL_FEATURE_RTC_HAS_NO_RST_SRC_FLAG) - kIRTC_ResetSrcFlag = (RTC_STATUS_RST_SRC_MASK << 16U), /*!< Reset source flag */ -#endif -#if !(defined(FSL_FEATURE_RTC_IS_SLAVE) && (FSL_FEATURE_RTC_IS_SLAVE != 0U)) - kIRTC_CmpIntFlag = (RTC_STATUS_CMP_INT_MASK << 16U), /*!< Compensation interval status flag */ - kIRTC_CmpDoneFlag = (RTC_STATUS_CMP_DONE_MASK << 16U), /*!< Compensation done flag */ -#endif - kIRTC_BusErrFlag = (RTC_STATUS_BUS_ERR_MASK << 16U), /*!< Bus error flag */ -#if defined(FSL_FEATURE_RTC_HAS_SUBSYSTEM) && FSL_FEATURE_RTC_HAS_SUBSYSTEM - kIRTC_WakeTimerFlag = (RTC_WAKE_TIMER_CTRL_WAKE_FLAG_MASK << 28U) /*!< Wake timer status flag */ -#endif -} irtc_status_flags_t; - -/*! @brief IRTC alarm match options */ -typedef enum _irtc_alarm_match -{ - kRTC_MatchSecMinHr = 0U, /*!< Only match second, minute and hour */ - kRTC_MatchSecMinHrDay = 1U, /*!< Only match second, minute, hour and day */ - kRTC_MatchSecMinHrDayMnth = 2U, /*!< Only match second, minute, hour, day and month */ - kRTC_MatchSecMinHrDayMnthYr = 3U /*!< Only match second, minute, hour, day, month and year */ -} irtc_alarm_match_t; - -#if !defined(FSL_FEATURE_RTC_HAS_NO_GP_DATA_REG) || (!FSL_FEATURE_RTC_HAS_NO_GP_DATA_REG) -/*! @brief List of RTC Oscillator capacitor load settings */ -typedef enum _irtc_osc_cap_load -{ - kIRTC_Capacitor2p = (1U << 1U), /*!< 2pF capacitor load */ - kIRTC_Capacitor4p = (1U << 2U), /*!< 4pF capacitor load */ - kIRTC_Capacitor8p = (1U << 3U), /*!< 8pF capacitor load */ - kIRTC_Capacitor16p = (1U << 4U) /*!< 16pF capacitor load */ -} irtc_osc_cap_load_t; -#endif - -/*! @brief IRTC clockout select. */ -typedef enum _irtc_clockout_sel -{ - kIRTC_ClkoutNo = 0U, /*!< No clock out */ - kIRTC_ClkoutFine1Hz, /*!< clock out fine 1Hz */ - kIRTC_Clkout32kHz, /*!< clock out 32.768kHz */ - kIRTC_ClkoutCoarse1Hz /*!< clock out coarse 1Hz */ -} irtc_clockout_sel_t; - -/*! @brief Structure is used to hold the date and time */ -typedef struct _irtc_datetime -{ - uint16_t year; /*!< Range from 1984 to 2239.*/ - uint8_t month; /*!< Range from 1 to 12.*/ - uint8_t day; /*!< Range from 1 to 31 (depending on month).*/ - uint8_t weekDay; /*!< Range from 0(Sunday) to 6(Saturday). */ - uint8_t hour; /*!< Range from 0 to 23.*/ - uint8_t minute; /*!< Range from 0 to 59.*/ - uint8_t second; /*!< Range from 0 to 59.*/ -} irtc_datetime_t; - -/*! @brief Structure is used to hold the daylight saving time */ -typedef struct _irtc_daylight_time -{ - uint8_t startMonth; /*!< Range from 1 to 12 */ - uint8_t endMonth; /*!< Range from 1 to 12 */ - uint8_t startDay; /*!< Range from 1 to 31 (depending on month) */ - uint8_t endDay; /*!< Range from 1 to 31 (depending on month) */ - uint8_t startHour; /*!< Range from 0 to 23 */ - uint8_t endHour; /*!< Range from 0 to 23 */ -} irtc_daylight_time_t; - -#if !defined(FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) || (!FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) -/*! @brief Structure is used to define the parameters to configure a RTC tamper event. */ -typedef struct _irtc_tamper_config -{ -#if FSL_FEATURE_RTC_HAS_TAMPER_DIRECTION - bool activePassive; /*!< true: configure tamper as active; false: passive tamper */ - bool direction; /*!< true: configure tamper direction as output; false: configure as input; - this is only used if a tamper pin is defined as active */ -#endif - bool pinPolarity; /*!< true: tamper has active low polarity; - false: active high polarity */ - irtc_filter_clock_source_t filterClk; /*!< Clock source for the tamper filter */ - uint8_t filterDuration; /*!< Tamper filter duration.*/ -} irtc_tamper_config_t; -#endif - -/*! - * @brief RTC config structure - * - * This structure holds the configuration settings for the RTC peripheral. To initialize this - * structure to reasonable defaults, call the IRTC_GetDefaultConfig() function and pass a - * pointer to your config structure instance. - * - * The config struct can be made const so it resides in flash - */ -typedef struct _irtc_config -{ -#if !defined(FSL_FEATURE_RTC_HAS_NO_CTRL2_WAKEUP_MODE) || (!FSL_FEATURE_RTC_HAS_NO_CTRL2_WAKEUP_MODE) - bool wakeupSelect; /*!< true: Tamper pin 0 is used to wakeup the chip; - false: Tamper pin 0 is used as the tamper pin */ -#endif -#if !defined(FSL_FEATURE_RTC_HAS_NO_TIMER_STB_MASK) || (!FSL_FEATURE_RTC_HAS_NO_TIMER_STB_MASK) - bool timerStdMask; /*!< true: Sampling clocks gated in standby mode; - false: Sampling clocks not gated */ -#endif - irtc_alarm_match_t alrmMatch; /*!< Pick one option from enumeration :: irtc_alarm_match_t */ -#if defined(FSL_FEATURE_RTC_HAS_CLOCK_SELECT) && FSL_FEATURE_RTC_HAS_CLOCK_SELECT - irtc_clock_select_t clockSelect; /*!< Pick one option from enumeration :: irtc_clock_select_t */ -#endif -#if defined(FSL_FEATURE_RTC_HAS_CLOCK_OUTPUT_DISABLE) && FSL_FEATURE_RTC_HAS_CLOCK_OUTPUT_DISABLE - bool disableClockOutput; /*!< true: The selected clock is not output to other peripherals; - false: The selected clock is output to other peripherals */ -#endif -} irtc_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Ungates the IRTC clock and configures the peripheral for basic operation. - * - * This function initiates a soft-reset of the IRTC module, this has not effect on DST, - * calendaring, standby time and tamper detect registers. - * - * @note This API should be called at the beginning of the application using the IRTC driver. - * - * @param base IRTC peripheral base address - * @param config Pointer to user's IRTC config structure. - * - * @return kStatus_Success If the driver is initialized successfully. - * @return kStatus_Fail if we cannot disable register write protection - * @return kStatus_InvalidArgument If the input parameters are wrong. - */ -status_t IRTC_Init(RTC_Type *base, const irtc_config_t *config); - -/*! - * @brief Gate the IRTC clock - * - * @param base IRTC peripheral base address - * @return kStatus_Success If the driver is initialized successfully. - * @return kStatus_InvalidArgument If the input parameters are wrong. - */ -status_t IRTC_Deinit(RTC_Type *base); - -/*! - * @brief Fill in the IRTC config struct with the default settings - * - * The default values are: - * @code - * config->wakeupSelect = true; - * config->timerStdMask = false; - * config->alrmMatch = kRTC_MatchSecMinHr; - * @endcode - * @param config Pointer to user's IRTC config structure. - */ -void IRTC_GetDefaultConfig(irtc_config_t *config); - -/*! @}*/ - -/*! - * @name Current Time & Alarm - * @{ - */ - -#if !(defined(FSL_FEATURE_RTC_IS_SLAVE) && (FSL_FEATURE_RTC_IS_SLAVE != 0U)) -/*! - * @brief Sets the IRTC date and time according to the given time structure. - * - * The IRTC counter is started after the time is set. - * - * @param base IRTC peripheral base address - * @param datetime Pointer to structure where the date and time details to set are stored - * - * @return kStatus_Success: success in setting the time and starting the IRTC - * kStatus_InvalidArgument: failure. An error occurs because the datetime format is incorrect. - */ -status_t IRTC_SetDatetime(RTC_Type *base, const irtc_datetime_t *datetime); -#endif /* FSL_FEATURE_RTC_IS_SLAVE */ - -/*! - * @brief Gets the IRTC time and stores it in the given time structure. - * - * @param base IRTC peripheral base address - * @param datetime Pointer to structure where the date and time details are stored. - */ -void IRTC_GetDatetime(RTC_Type *base, irtc_datetime_t *datetime); - -/*! - * @brief Sets the IRTC alarm time - * - * @param base RTC peripheral base address - * @param alarmTime Pointer to structure where the alarm time is stored. - * - * @note weekDay field of alarmTime is not used during alarm match and should be set to 0 - * - * @return kStatus_Success: success in setting the alarm - * kStatus_InvalidArgument: error in setting the alarm. Error occurs because the alarm - * datetime format is incorrect. - */ -status_t IRTC_SetAlarm(RTC_Type *base, const irtc_datetime_t *alarmTime); - -/*! - * @brief Returns the IRTC alarm time. - * - * @param base RTC peripheral base address - * @param datetime Pointer to structure where the alarm date and time details are stored. - */ -void IRTC_GetAlarm(RTC_Type *base, irtc_datetime_t *datetime); -/*! @}*/ - -/*! - * @name Interrupt Interface - * @{ - */ - -/*! - * @brief Enables the selected IRTC interrupts. - * - * @param base IRTC peripheral base address - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::irtc_interrupt_enable_t - */ -static inline void IRTC_EnableInterrupts(RTC_Type *base, uint32_t mask) -{ - base->IER |= (uint16_t)mask; -#if defined(FSL_FEATURE_RTC_HAS_SUBSYSTEM) && FSL_FEATURE_RTC_HAS_SUBSYSTEM - if (0U != (mask & (uint32_t)kIRTC_WakeTimerInterruptEnable)) - { - base->WAKE_TIMER_CTRL |= RTC_WAKE_TIMER_CTRL_INTR_EN_MASK; - } -#endif -#if !defined(FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) || (!FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) -#if defined(FSL_FEATURE_RTC_HAS_TAMPER_QUEUE) && (FSL_FEATURE_RTC_HAS_TAMPER_QUEUE) - if (0U != (mask & (uint32_t)kIRTC_TamperQueueFullInterruptEnable)) - { - base->TAMPER_QSCR |= RTC_TAMPER_QSCR_Q_FULL_INT_EN_MASK; - } -#endif -#endif -} - -/*! - * @brief Disables the selected IRTC interrupts. - * - * @param base IRTC peripheral base address - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::irtc_interrupt_enable_t - */ -static inline void IRTC_DisableInterrupts(RTC_Type *base, uint32_t mask) -{ - base->IER &= ~(uint16_t)mask; -#if defined(FSL_FEATURE_RTC_HAS_SUBSYSTEM) && FSL_FEATURE_RTC_HAS_SUBSYSTEM - if (0U != (mask & (uint32_t)kIRTC_WakeTimerInterruptEnable)) - { - base->WAKE_TIMER_CTRL &= ~(uint16_t)RTC_WAKE_TIMER_CTRL_INTR_EN_MASK; - } -#endif -#if !defined(FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) || (!FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) -#if defined(FSL_FEATURE_RTC_HAS_TAMPER_QUEUE) && (FSL_FEATURE_RTC_HAS_TAMPER_QUEUE) - if (0U != (mask & (uint32_t)kIRTC_TamperQueueFullInterruptEnable)) - { - base->TAMPER_QSCR &= ~(uint16_t)RTC_TAMPER_QSCR_Q_FULL_INT_EN_MASK; - } -#endif -#endif -} - -/*! - * @brief Gets the enabled IRTC interrupts. - * - * @param base IRTC peripheral base address - * - * @return The enabled interrupts. This is the logical OR of members of the - * enumeration ::irtc_interrupt_enable_t - */ -static inline uint32_t IRTC_GetEnabledInterrupts(RTC_Type *base) -{ - uint32_t intsEnabled = base->IER; -#if defined(FSL_FEATURE_RTC_HAS_SUBSYSTEM) && FSL_FEATURE_RTC_HAS_SUBSYSTEM - intsEnabled |= (base->WAKE_TIMER_CTRL & (uint32_t)RTC_WAKE_TIMER_CTRL_INTR_EN_MASK) << 16U; -#endif -#if !defined(FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) || (!FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) -#if defined(FSL_FEATURE_RTC_HAS_TAMPER_QUEUE) && (FSL_FEATURE_RTC_HAS_TAMPER_QUEUE) - intsEnabled |= (base->TAMPER_QSCR & (uint32_t)RTC_TAMPER_QSCR_Q_FULL_INT_EN_MASK) << 24U; -#endif -#endif - - return intsEnabled; -} - -/*! @}*/ - -/*! - * @name Status Interface - * @{ - */ - -/*! - * @brief Gets the IRTC status flags - * - * @param base IRTC peripheral base address - * - * @return The status flags. This is the logical OR of members of the - * enumeration ::irtc_status_flags_t - */ -static inline uint32_t IRTC_GetStatusFlags(RTC_Type *base) -{ -#if defined(FSL_FEATURE_RTC_HAS_SUBSYSTEM) && FSL_FEATURE_RTC_HAS_SUBSYSTEM - return (base->ISR | ((uint32_t)base->STATUS << 16U) | ((uint32_t)base->WAKE_TIMER_CTRL << 28U)); -#else - return (base->ISR | ((uint32_t)base->STATUS << 16U)); -#endif -} - -/*! - * @brief Clears the IRTC status flags. - * - * @param base IRTC peripheral base address - * @param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::irtc_status_flags_t - */ -static inline void IRTC_ClearStatusFlags(RTC_Type *base, uint32_t mask) -{ - base->ISR = (uint16_t)mask; - base->STATUS = (base->STATUS & ~IRTC_STATUS_W1C_BITS) | - ((uint16_t)(mask >> 16U)); -#if !defined(FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) || (!FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) - /* TAMPER flag need clear TAMPER_SCR[TMPR_STS] filed */ - if (0U != (mask & (uint32_t)kIRTC_TamperFlag)) - { - base->TAMPER_SCR |= RTC_TAMPER_SCR_TMPR_STS_MASK; - } -#endif -#if defined(FSL_FEATURE_RTC_HAS_SUBSYSTEM) && FSL_FEATURE_RTC_HAS_SUBSYSTEM - if (0U != (mask & (uint32_t)kIRTC_WakeTimerFlag)) - { - base->WAKE_TIMER_CTRL |= RTC_WAKE_TIMER_CTRL_WAKE_FLAG_MASK; - } -#endif -} - -/*! @}*/ - -#if !defined(FSL_FEATURE_RTC_HAS_NO_GP_DATA_REG) || (!FSL_FEATURE_RTC_HAS_NO_GP_DATA_REG) - -/*! - * @brief This function sets the specified capacitor configuration for the RTC oscillator. - * - * @param base IRTC peripheral base address - * @param capLoad Oscillator loads to enable. This is a logical OR of members of the - * enumeration ::irtc_osc_cap_load_t - */ -static inline void IRTC_SetOscCapLoad(RTC_Type *base, uint16_t capLoad) -{ - uint16_t reg = base->GP_DATA_REG; - - reg &= ~((uint16_t)kIRTC_Capacitor2p | (uint16_t)kIRTC_Capacitor4p | (uint16_t)kIRTC_Capacitor8p | - (uint16_t)kIRTC_Capacitor16p); - reg |= capLoad; - - base->GP_DATA_REG = reg; -} - -#endif - -/*! - * @brief Locks or unlocks IRTC registers for write access. - * - * @note When the registers are unlocked, they remain in unlocked state for - * 2 seconds, after which they are locked automatically. After - * power-on-reset, the registers come out unlocked and they are locked - * automatically 15 seconds after power on. - * - * @param base IRTC peripheral base address - * @param lock true: Lock IRTC registers; false: Unlock IRTC registers. - * - * @return kStatus_Success: if lock or unlock operation is successful - * kStatus_Fail: if lock or unlock operation fails even after multiple retry attempts - */ -status_t IRTC_SetWriteProtection(RTC_Type *base, bool lock); - -/*! - * @brief Performs a software reset on the IRTC module. - * - * Clears contents of alarm, interrupt (status and enable except tamper interrupt enable bit) - * registers, STATUS[CMP_DONE] and STATUS[BUS_ERR]. This has no effect on DST, calendaring, standby time - * and tamper detect registers. - * - * @param base IRTC peripheral base address - */ -static inline void IRTC_Reset(RTC_Type *base) -{ - base->CTRL |= RTC_CTRL_SWR_MASK; -} - -#if !defined(FSL_FEATURE_RTC_HAS_NO_GP_DATA_REG) || (!FSL_FEATURE_RTC_HAS_NO_GP_DATA_REG) - -/*! - * @brief Enable/disable 32 kHz RTC OSC clock during RTC register write - * - * @param base IRTC peripheral base address - * @param enable Enable/disable 32 kHz RTC OSC clock. - * - true: Enables the oscillator. - * - false: Disables the oscillator. - * - */ -static inline void IRTC_Enable32kClkDuringRegisterWrite(RTC_Type *base, bool enable) -{ - uint16_t mask = RTC_GP_DATA_REG_CFG0_MASK; - if (enable) - { - base->GP_DATA_REG &= ~mask; - } - else - { - base->GP_DATA_REG |= mask; - } -} - -#endif - -/*! - * @brief Select which clock to output from RTC. - * - * Select which clock to output from RTC for other modules to use inside SoC, for example, - * RTC subsystem needs RTC to output 1HZ clock for sub-second counter. - * - * @param base IRTC peripheral base address - * @param clkOut select clock to use for output, - */ -void IRTC_ConfigClockOut(RTC_Type *base, irtc_clockout_sel_t clkOut); - -#if defined(FSL_FEATURE_RTC_HAS_CLOCK_SELECT) && FSL_FEATURE_RTC_HAS_CLOCK_SELECT - -/*! - * @brief Select which clock is used by RTC. - * - * Select which clock is used by RTC to output to the peripheral - * and divided to generate a 512 Hz clock and a 1 Hz clock. - * - * @param base IRTC peripheral base address - * @param clkSelect select clock used by RTC - */ -void IRTC_ConfigClockSelect(RTC_Type *base, irtc_clock_select_t clkSelect); - -#endif /* FSL_FEATURE_RTC_HAS_CLOCK_SELECT */ - -#if defined(FSL_FEATURE_RTC_HAS_CLOCK_OUTPUT_DISABLE) && FSL_FEATURE_RTC_HAS_CLOCK_OUTPUT_DISABLE - -/*! - * @brief Determines whether the selected clock is output to other peripherals. - * - * Determines whether the selected clock is output to other peripherals. - * - * @param base IRTC peripheral base address - * @param enable determine whether the selected clock is output to other peripherals - */ -static inline void IRTC_EnableClockOutputToPeripheral(RTC_Type *base, bool enable) -{ - if (enable) - { - base->CTRL &= ~(uint16_t)RTC_CTRL_CLKO_DIS_MASK; - } - else - { - base->CTRL |= RTC_CTRL_CLKO_DIS_MASK; - } -} - -#endif /* FSL_FEATURE_RTC_HAS_CLOCK_OUTPUT_DISABLE */ - -#if !defined(FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) || (!FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) - -/*! - * @brief Gets the IRTC Tamper status flags - * - * @param base IRTC peripheral base address - * - * @return The Tamper status value. - */ -static inline uint8_t IRTC_GetTamperStatusFlag(RTC_Type *base) -{ - return (uint8_t)((base->TAMPER_SCR & RTC_TAMPER_SCR_TMPR_STS_MASK) >> RTC_TAMPER_SCR_TMPR_STS_SHIFT); -} - -/*! - * @brief Gets the IRTC Tamper status flags - * - * @param base IRTC peripheral base address - * - */ -static inline void IRTC_ClearTamperStatusFlag(RTC_Type *base) -{ - /* Writing '1' to this field clears the tamper status.*/ - base->TAMPER_SCR |= RTC_TAMPER_SCR_TMPR_STS_MASK; -} - -/*! - * @brief Set tamper configuration over - * - * Note that this API is neeeded after call IRTC_SetTamperParams to configure tamper events to - * notify IRTC module that tamper configuration process is over. - * - * @param base IRTC peripheral base address - * - */ -static inline void IRTC_SetTamperConfigurationOver(RTC_Type *base) -{ - /* Set tamper configuration over.*/ - base->CTRL2 |= RTC_CTRL2_TAMP_CFG_OVER_MASK; -} - -#endif - -/*! - * @name Daylight Savings Interface - * @{ - */ - -#if !(defined(FSL_FEATURE_RTC_IS_SLAVE) && (FSL_FEATURE_RTC_IS_SLAVE != 0U)) -/*! - * @brief Sets the IRTC daylight savings start and stop date and time. - * - * It also enables the daylight saving bit in the IRTC control register - * - * @param base IRTC peripheral base address - * @param datetime Pointer to a structure where the date and time details are stored. - */ -void IRTC_SetDaylightTime(RTC_Type *base, const irtc_daylight_time_t *datetime); -#endif /* FSL_FEATURE_RTC_IS_SLAVE */ - -/*! - * @brief Gets the IRTC daylight savings time and stores it in the given time structure. - * - * @param base IRTC peripheral base address - * @param datetime Pointer to a structure where the date and time details are stored. - */ -void IRTC_GetDaylightTime(RTC_Type *base, irtc_daylight_time_t *datetime); - -/*! @}*/ - -#if !(defined(FSL_FEATURE_RTC_IS_SLAVE) && (FSL_FEATURE_RTC_IS_SLAVE != 0U)) -/*! - * @name Time Compensation Interface - * @{ - */ - -/*! - * @brief Enables the coarse compensation and sets the value in the IRTC compensation register. - * - * @param base IRTC peripheral base address - * @param compensationValue Compensation value is a 2's complement value. - * @param compensationInterval Compensation interval. - */ -void IRTC_SetCoarseCompensation(RTC_Type *base, uint8_t compensationValue, uint8_t compensationInterval); - -/*! - * @brief Enables the fine compensation and sets the value in the IRTC compensation register. - * - * @param base The IRTC peripheral base address - * @param integralValue Compensation integral value; twos complement value of the integer part - * @param fractionValue Compensation fraction value expressed as number of clock cycles of a - * fixed 4.194304Mhz clock that have to be added. - * @param accumulateFractional Flag indicating if we want to add to previous fractional part; - * true: Add to previously accumulated fractional part, - * false: Start afresh and overwrite current value - */ -void IRTC_SetFineCompensation(RTC_Type *base, uint8_t integralValue, uint8_t fractionValue, bool accumulateFractional); - -/*! @}*/ -#endif /* FSL_FEATURE_RTC_IS_SLAVE */ - -#if !defined(FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) || (!FSL_FEATURE_RTC_HAS_NO_TAMPER_FEATURE) - -/*! - * @name Tamper Interface - * @{ - */ - -/*! - * @brief This function allows configuring the four tamper inputs. - * - * The function configures the filter properties for the three external tampers. - * It also sets up active/passive and direction of the tamper bits, which are not available - * on all platforms. - * @note This function programs the tamper filter parameters. The user must gate the 32K clock to - * the RTC before calling this function. It is assumed that the time and date are set after this - * and the tamper parameters do not require to be changed again later. - * - * @param base The IRTC peripheral base address - * @param tamperNumber The IRTC tamper input to configure - * @param tamperConfig The IRTC tamper properties - */ -void IRTC_SetTamperParams(RTC_Type *base, irtc_tamper_pins_t tamperNumber, const irtc_tamper_config_t *tamperConfig); - -#if defined(FSL_FEATURE_RTC_HAS_TAMPER_QUEUE) && (FSL_FEATURE_RTC_HAS_TAMPER_QUEUE) - -/*! - * @brief This function reads the tamper timestamp and returns the associated tamper pin. - * - * The tamper timestamp has month, day, hour, minutes, and seconds. Ignore the year field as this - * information is not available in the tamper queue. The user should look at the RTC_YEARMON register - * for this because the expectation is that the queue is read at least once a year. - * Return the tamper pin number associated with the timestamp. - * - * @param base The IRTC peripheral base address - * @param tamperTimestamp The tamper timestamp - * - * @return The tamper pin number - */ -uint8_t IRTC_ReadTamperQueue(RTC_Type *base, irtc_datetime_t *tamperTimestamp); - -/*! - * @brief Gets the IRTC Tamper queue full status - * - * @param base IRTC peripheral base address - * - * @retval true Tamper queue is full. - * @retval false Tamper queue is not full. - */ -static inline bool IRTC_GetTamperQueueFullStatus(RTC_Type *base) -{ - return ((0U != (base->TAMPER_SCR & RTC_TAMPER_QSCR_Q_FULL_MASK)) ? true : false); -} - -/*! - * @brief Clear the IRTC Tamper queue full status - * - * @param base IRTC peripheral base address - * - */ -static inline void IRTC_ClearTamperQueueFullStatus(RTC_Type *base) -{ - base->TAMPER_QSCR |= RTC_TAMPER_QSCR_Q_CLEAR_MASK; -} -#endif /* FSL_FEATURE_RTC_HAS_TAMPER_QUEUE */ - -/*! @}*/ - -#endif - -#if defined(FSL_FEATURE_RTC_HAS_SUBSYSTEM) && FSL_FEATURE_RTC_HAS_SUBSYSTEM -/*! - * @name RTC subsystem Interface - * @{ - */ - -#if !(defined(FSL_FEATURE_RTC_HAS_SUBSECOND) && (FSL_FEATURE_RTC_HAS_SUBSECOND == 0)) -/*! - * @brief Enable the RTC wake-up timer. - * - * 1HZ clock out selected via call to API IRTC_ConfigClockOut in order for the subsecond - * counter to synchronize with the RTC_SECONDS counter. - * - * @param base RTC peripheral base address - * @param enable Use/Un-use the sub-second counter. - * - true: Use RTC wake-up timer at the same time. - * - false: Un-use RTC wake-up timer, RTC only use the normal seconds timer by default. - */ -static inline void IRTC_EnableSubsecondCounter(RTC_Type *base, bool enable) -{ - if (enable) - { - base->SUBSECOND_CTRL |= RTC_SUBSECOND_CTRL_SUB_SECOND_CNT_EN_MASK; - } - else - { - base->SUBSECOND_CTRL &= ~RTC_SUBSECOND_CTRL_SUB_SECOND_CNT_EN_MASK; - } -} - -/*! - * @brief Read the actual RTC sub-second COUNT value. - * - * @param base RTC peripheral base address - * - * @return The actual RTC sub-second COUNT value. - */ -static inline uint32_t IRTC_GetSubsecondCount(RTC_Type *base) -{ - uint32_t a, b; - - /* Follow the RF document to read the RTC default seconds timer (1HZ) counter value. */ - do - { - a = base->SUBSECOND_CNT; - b = base->SUBSECOND_CNT; - } while (a != b); - - return b; -} -#endif /* FSL_FEATURE_RTC_HAS_SUBSECOND */ - -/*! - * @brief Set countdown value to the RTC wake timer counter register. - * - * @param base RTC peripheral base address - * @param enable1kHzClk Enable 1kHz clock source for the wake timer, else use the 32kHz clock. - * @param wakeupValue The value to be loaded into the WAKE register in wake timer counter. - */ -static inline void IRTC_SetWakeupCount(RTC_Type *base, bool enable1kHzClk, uint32_t wakeupValue) -{ - /* Config whether enable the wakeup counter */ - uint32_t writeVal; - writeVal = base->WAKE_TIMER_CTRL; - base->WAKE_TIMER_CTRL = RTC_WAKE_TIMER_CTRL_CLR_WAKE_TIMER_MASK; - - if (enable1kHzClk) - { - writeVal |= RTC_WAKE_TIMER_CTRL_OSC_DIV_ENA_MASK; - } - else - { - writeVal &= ~RTC_WAKE_TIMER_CTRL_OSC_DIV_ENA_MASK; - } - - base->WAKE_TIMER_CTRL = writeVal; - /* Set the start countdown value into the RTC WAKE register */ - base->WAKE_TIMER_CNT = wakeupValue; -} - -/*! - * @brief Read the actual value from the WAKE register value in RTC wake timer. - * - * @param base RTC peripheral base address - * - * @return The actual value of the WAKE register value in wake timer counter. - */ -static inline uint32_t IRTC_GetWakeupCount(RTC_Type *base) -{ - /* Read current wake-up countdown value */ - return base->WAKE_TIMER_CNT; -} - -/*! @}*/ -#endif - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_IRTC_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_itrc.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_itrc.c deleted file mode 100644 index 27120e076aa..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_itrc.c +++ /dev/null @@ -1,293 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_itrc.h" - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.itrc" -#endif - -#define b11 0x3UL -#define b10 0x2u -#define b01 0x1u - -#define OUT_SEL_0_COUNT (16u) -#define OUT_SEL_1_COUNT (32u) -#define OUT_SEL_2_COUNT (48u) - -/* Value used to trigger SW Events */ -#define SW_EVENT_VAL 0x5AA55AA5u - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * Weak implementation of ITRC IRQ, should be re-defined by user when using ITRC IRQ - */ -__WEAK void ITRC0_DriverIRQHandler(void) -{ - /* ITRC generates IRQ until corresponding bit in STATUS is cleared by calling - * ITRC_ClearStatus(ITRC,((uint32_t)kITRC_Irq) - */ -} - -/*! - * brief Clear ITRC status - * - * This function clears corresponding ITRC event or action in STATUS register. - * - * param base ITRC peripheral base address - * param word 32bit word represent corresponding event/action in STATUS register to be cleared (see - * ITRC_STATUS_INx/OUTx_STATUS) - * return kStatus_Success if success, kStatus_InvalidArgument otherwise - */ -status_t ITRC_ClearStatus(ITRC_Type *base, uint32_t word) -{ - /* If reserved/unused bits in STATUS register are set in 'word' parameter, return kStatus_InvalidArgument */ - if ((word & ~(IN_0_15_EVENTS_MASK | OUT_ACTIONS_MASK)) != 0u) - { - return kStatus_InvalidArgument; - } - - base->STATUS |= word; - - return kStatus_Success; -} - -/*! - * brief Get ITRC Status - * - * This function returns ITRC STATUS1 register value. - * - * param base ITRC peripheral base address - * return Value of ITRC STATUS register - */ -uint32_t ITRC_GetStatus(ITRC_Type *base) -{ - return base->STATUS; -} - -#if defined(ITRC_STATUS1_IN16_STATUS_MASK) -/*! - * brief Clear ITRC status 1 - * - * This function clears corresponding ITRC event or action in STATUS1 register. - * - * param base ITRC peripheral base address - * param word 32bit word represent corresponding event/action in STATUS1 register to be cleared (see - * ITRC_STATUS_INx/OUTx_STATUS) - * return kStatus_Success if success, kStatus_InvalidArgument otherwise - */ -status_t ITRC_ClearStatus1(ITRC_Type *base, uint32_t word) -{ - /* If reserved/unused bits in STATUS register are set in 'word' parameter, return kStatus_InvalidArgument */ - if ((word & ~(IN_16_47_EVENTS_MASK)) != 0u) - { - return kStatus_InvalidArgument; - } - - base->STATUS1 |= word; - - return kStatus_Success; -} - -/*! - * brief Get ITRC Status 1 - * - * This function returns ITRC STATUS1 register value. - * - * param base ITRC peripheral base address - * return Value of ITRC STATUS1 register - */ -uint32_t ITRC_GetStatus1(ITRC_Type *base) -{ - return base->STATUS1; -} - -#endif /* defined(ITRC_STATUS1_IN16_STATUS_MASK) */ - -/*! - * brief Clear all ITRC status - * - * This clears all event and action in STATUS and STATUS1 registers. - * - * param base ITRC peripheral base address - * return kStatus_Success - */ -status_t ITRC_ClearAllStatus(ITRC_Type *base) -{ - base->STATUS |= (IN_0_15_EVENTS_MASK | OUT_ACTIONS_MASK); -#if defined(ITRC_STATUS1_IN16_STATUS_MASK) - base->STATUS1 |= (IN_16_47_EVENTS_MASK); -#endif /* defined(ITRC_STATUS1_IN16_STATUS_MASK) */ - - return kStatus_Success; -} - -/*! - * brief Trigger ITRC SW Event 0 - * - * This funciton set SW_EVENT0 register with value !=0 which triggers ITRC SW Event 0. - * - * param base ITRC peripheral base address - */ -void ITRC_SetSWEvent0(ITRC_Type *base) -{ - base->SW_EVENT0 = SW_EVENT_VAL; -} - -/*! - * brief Trigger ITRC SW Event 1 - * - * This funciton set SW_EVENT1 register with value !=0 which triggers ITRC SW Event 1. - * - * param base ITRC peripheral base address - */ -void ITRC_SetSWEvent1(ITRC_Type *base) -{ - base->SW_EVENT1 = SW_EVENT_VAL; -} - -/*! - * brief Set ITRC Action to Event - * - * This function sets input Event signal to corresponding output Action response signal. - * - * param base ITRC peripheral base address - * param out ITRC OUT signal action - * param in ITRC IN signal event - * param lock if set locks INx_SEL configuration. This can be cleared only by PMC Core reset. - * param enable if set input Event will be selected for output Action, otherwise disable (if not already locked). - * return kStatus_Success if success, kStatus_InvalidArgument otherwise - */ -status_t ITRC_SetActionToEvent( - ITRC_Type *base, itrc_out_signals_t out, itrc_input_signals_t in, itrc_lock_t lock, itrc_enable_t enable) -{ - uint32_t sel0, sel1, index, select_AND_mask; - - /* prepare values for INx_SEL0/1 bit-field according to secure techniques and register behavior - * +------------+------------+------------------+---------------------------+ - * | INx_SEL0 | INx_SEL1 | Signal selected? | Writable field? | - * +------------+------------+------------------+---------------------------+ - * | 10 | 10 | No | Yes (default after reset) | - * | 01 | 10 | Yes | Yes | - * | don't care | !="10" | Yes | No | - * | 00 or 11 | don't care | Yes | No | - * +------------+------------+------------------+---------------------------+ - */ - if ((lock == kITRC_Unlock) && (enable == kITRC_Disable)) - { - sel0 = b10; - sel1 = b10; - } - else if ((lock == kITRC_Unlock) && (enable == kITRC_Enable)) - { - sel0 = b01; - sel1 = b10; - } - else - { - sel0 = b11; - sel1 = b11; - } - - /* Compute index for INx_SEL0/1 bit-field within OUTy_SEL0/1 registers */ - if ((uint32_t)in < OUT_SEL_0_COUNT) - { - index = 2u * (uint32_t)in; - } - else if (OUT_SEL_0_COUNT <= (uint32_t)in && (uint32_t)in < OUT_SEL_1_COUNT) - { - index = 2u * ((uint32_t)in - OUT_SEL_0_COUNT); - } - else if (OUT_SEL_1_COUNT <= (uint32_t)in && (uint32_t)in < OUT_SEL_2_COUNT) - { - index = 2u * ((uint32_t)in - OUT_SEL_1_COUNT); - } - else - { - return kStatus_InvalidArgument; - } - - /* Prepare AND mask to set INx_SEL0 accordingly */ - select_AND_mask = ~(uint32_t)(b11 << index); - - /* Configure OUT action for IN event */ - for (uint8_t i = (uint8_t)kITRC_Irq; i < ITRC_OUT_COUNT; i++) - { - /* Loop over all OUT actions, set only requested one */ - if (i == (uint8_t)out) - { - if ((uint32_t)in < OUT_SEL_0_COUNT) - { - base->OUT_SEL[i][0] = (base->OUT_SEL[i][0] & select_AND_mask) | (sel0 << index); - base->OUT_SEL[i][1] |= sel1 << index; - break; - } -#if defined(ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_COUNT) - else if (OUT_SEL_0_COUNT <= (uint32_t)in && (uint32_t)in < OUT_SEL_1_COUNT) - { - base->OUT_SEL_1[i][0] = (base->OUT_SEL[i][0] & select_AND_mask) | (sel0 << index); - base->OUT_SEL_1[i][1] |= sel1 << index; - break; - } -#endif /* defined(OUT_SEL_1) */ -#if defined(ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_COUNT) - else if (OUT_SEL_1_COUNT <= (uint32_t)in && (uint32_t)in < OUT_SEL_2_COUNT) - { - base->OUT_SEL_2[i][0] = (base->OUT_SEL[i][0] & select_AND_mask) | (sel0 << index); - base->OUT_SEL_2[i][1] |= sel1 << index; - break; - } - else - { - /* All the cases have been listed above, this branch should not be reached. */ - return kStatus_InvalidArgument; - } -#endif /* defined(OUT_SEL_2) */ - } - } - - return kStatus_Success; -} - -/*! - * brief Initialize ITRC - * - * This function initializes ITRC by enabling IRQ. - * - * param base ITRC peripheral base address - * return Status of the init operation - */ -status_t ITRC_Init(ITRC_Type *base) -{ - NVIC_EnableIRQ(ITRC0_IRQn); - - return kStatus_Success; -} - -/*! - * brief Deinitialize ITRC - * - * This function just disable ITRC IRQ. - * - * param base ITRC peripheral base address - */ -void ITRC_Deinit(ITRC_Type *base) -{ - NVIC_DisableIRQ(ITRC0_IRQn); -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_itrc.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_itrc.h deleted file mode 100644 index 53664bb3915..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_itrc.h +++ /dev/null @@ -1,322 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_ITRC_H_ -#define FSL_ITRC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup ITRC - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief Defines ITRC driver version 2.3.0. - * - * Change log: - * - Version 2.3.0 - * - Update names of kITRC_SwEvent1/2 to kITRC_SwEvent0/1 to align with RM - * - Version 2.2.0 - * - Update driver to new version and input events - * - Version 2.1.0 - * - Make SYSCON glitch platform dependent - * - Version 2.0.0 - * - initial version - */ -#define FSL_ITRC_DRIVER_VERSION (MAKE_VERSION(2, 3, 0)) -/*! @} */ - -typedef enum _itrc_input_signals -{ - kITRC_Glitch = 0U, - kITRC_Tamper = 1U, - kITRC_Cdog = 2U, - kITRC_BodVbat = 3u, - kITRC_BodVdd = 4u, - kITRC_Watchdog = 5u, - kITRC_FlashEcc = 6u, - kITRC_Ahb = 7u, - kITRC_ElsErr = 8u, -#if defined(FSL_FEATURE_ITRC_HAS_SYSCON_GLITCH) && (FSL_FEATURE_ITRC_HAS_SYSCON_GLITCH > 0) - kITRC_SysconGlitch = 9u, -#endif - kITRC_Pkc = 10u, -#if defined(ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN11_SELn_MASK) - kITRC_Cdog1 = 11u, -#endif /* ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN11_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN12_SELn_MASK) - kITRC_Watchdog1 = 12u, -#endif /* ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN12_SELn_MASK*/ -#if defined(ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN13_SELn_MASK) - kITRC_Freqme = 13u, -#endif /* ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN13_SELn_MASK */ - kITRC_SwEvent0 = 14u, - kITRC_SwEvent1 = 15u, -#if defined(ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN16_SELn_MASK) - kITRC_VddSysLow = 16u, -#endif /* ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN16_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN17_SELn_MASK) - kITRC_VddIoLow = 17u, -#endif /* ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN17_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN19_SELn_MASK) - kITRC_VddTemp = 19u, -#endif /* ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN19_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN20_SELn_MASK) - kITRC_VddClock = 20u, -#endif /* ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN20_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN21_SELn_MASK) - kITRC_INTM0 = 21u, -#endif /* ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN21_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN22_SELn_MASK) - kITRC_INTM1 = 22u, -#endif /* ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN22_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN23_SELn_MASK) - kITRC_INTM2 = 23u, -#endif /* ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN23_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN24_SELn_MASK) - kITRC_INTM3 = 24u, -#endif /* ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN24_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_1_OUTX_SELY_OUT_SEL_1_IN25_SELn_MASK) && \ - defined(ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN32_SELn_MASK) - kITRC_SoCTrim0 = 25u, - kITRC_SoCTrim1 = 26u, - kITRC_SoCTrim2 = 27u, - kITRC_SoCTrim3 = 28u, - kITRC_SoCTrim4 = 29u, - kITRC_SoCTrim5 = 30u, - kITRC_SoCTrim6 = 31u, - kITRC_SoCTrim7 = 32u, -#endif /* ITRC_OUTX_SEL_x_OUTX_SELY_OUT_SEL_INxx_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN33_SELn_MASK) - kITRC_GdetSfr = 33u, -#endif /* ITRC_OUTX_SEL_x_OUTX_SELY_OUT_SEL_INxx_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN34_SELn_MASK) - kITRC_VddCore = 34u, -#endif /* ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN34_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN35_SELn_MASK) - kITRC_VddSys = 35u, -#endif /* ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN35_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN36_SELn_MASK) - kITRC_VddIo = 36u, -#endif /* ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN36_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN37_SELn_MASK) - kITRC_FlexspiGcm = 37u, -#endif /* ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN37_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN46_SELn_MASK) - kITRC_Sm3Err = 46u, -#endif /* ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN46_SELn_MASK */ -#if defined(ITRC_OUTX_SEL_2_OUTX_SELY_OUT_SEL_2_IN47_SELn_MASK) - kITRC_TrngErr = 47u, -#endif /* */ -} itrc_input_signals_t; - -typedef enum _itrc_lock -{ - kITRC_Unlock = 0U, - kITRC_Lock = 1U, -} itrc_lock_t; - -typedef enum _itrc_enable -{ - kITRC_Enable = 0U, - kITRC_Disable = 1U, -} itrc_enable_t; - -typedef enum _itrc_out_signals -{ - kITRC_Irq = 0U, - kITRC_ElsReset = 1U, - kITRC_PufZeroize = 2U, - kITRC_RamZeroize = 3u, - kITRC_ChipReset = 4u, - kITRC_TamperOut = 5u, - kITRC_TamperOut1 = 6u, -} itrc_out_signals_t; - -/* Inputs 0 to 15 events mask */ -#if defined(FSL_FEATURE_ITRC_HAS_SYSCON_GLITCH) && (FSL_FEATURE_ITRC_HAS_SYSCON_GLITCH > 0) -#define IN_0_15_EVENTS_MASK \ - (ITRC_STATUS_IN0_STATUS_MASK | ITRC_STATUS_IN1_STATUS_MASK | ITRC_STATUS_IN2_STATUS_MASK | \ - ITRC_STATUS_IN3_STATUS_MASK | ITRC_STATUS_IN4_STATUS_MASK | ITRC_STATUS_IN5_STATUS_MASK | \ - ITRC_STATUS_IN6_STATUS_MASK | ITRC_STATUS_IN7_STATUS_MASK | ITRC_STATUS_IN8_STATUS_MASK | \ - ITRC_STATUS_IN9_STATUS_MASK | ITRC_STATUS_IN10_STATUS_MASK | ITRC_STATUS_IN14_STATUS_MASK | \ - ITRC_STATUS_IN15_STATUS_MASK) -#else -#define IN_0_15_EVENTS_MASK \ - (ITRC_STATUS_IN0_STATUS_MASK | ITRC_STATUS_IN1_STATUS_MASK | ITRC_STATUS_IN2_STATUS_MASK | \ - ITRC_STATUS_IN3_STATUS_MASK | ITRC_STATUS_IN4_STATUS_MASK | ITRC_STATUS_IN5_STATUS_MASK | \ - ITRC_STATUS_IN6_STATUS_MASK | ITRC_STATUS_IN7_STATUS_MASK | ITRC_STATUS_IN8_STATUS_MASK | \ - ITRC_STATUS_IN10_STATUS_MASK | ITRC_STATUS_IN14_STATUS_MASK | ITRC_STATUS_IN15_STATUS_MASK) -#endif /* FSL_FEATURE_ITRC_HAS_SYSCON_GLITCH */ - -/* Inputs 15 to 47 events mask */ -#if defined(ITRC_STATUS1_IN16_STATUS_MASK) && defined(ITRC_STATUS1_IN47_STATUS) -#define IN_16_47_EVENTS_MASK \ - (ITRC_STATUS1_IN16_STATUS_MASK | ITRC_STATUS1_IN17_STATUS_MASK | ITRC_STATUS1_IN18_STATUS_MASK | \ - ITRC_STATUS1_IN19_STATUS_MASK | ITRC_STATUS1_IN20_STATUS_MASK | ITRC_STATUS1_IN24_21_STATUS_MASK | \ - ITRC_STATUS1_IN24_21_STATUS_MASK | ITRC_STATUS1_IN32_25_STATUS_MASK | ITRC_STATUS1_IN33_STATUS_MASK | \ - ITRC_STATUS1_IN34_STATUS_MASK | ITRC_STATUS1_IN35_STATUS_MASK | ITRC_STATUS1_IN36_STATUS_MASK | \ - ITRC_STATUS1_IN37_STATUS_MASK | ITRC_STATUS1_IN46_STATUS_MASK | ITRC_STATUS1_IN47_STATUS_MASK) -#endif /* ITRC_STATUS1_IN16_STATUS_MASK && ITRC_STATUS1_IN47_STATUS */ - -/* Output actions mask */ -#if defined(ITRC_STATUS_OUT6_STATUS) -#define OUT_ACTIONS_MASK \ - (ITRC_STATUS_OUT0_STATUS_MASK | ITRC_STATUS_OUT1_STATUS_MASK | ITRC_STATUS_OUT2_STATUS_MASK | \ - ITRC_STATUS_OUT3_STATUS_MASK | ITRC_STATUS_OUT4_STATUS_MASK | ITRC_STATUS_OUT5_STATUS_MASK | \ - ITRC_STATUS_OUT6_STATUS_MASK) -#else -#define OUT_ACTIONS_MASK \ - (ITRC_STATUS_OUT0_STATUS_MASK | ITRC_STATUS_OUT1_STATUS_MASK | ITRC_STATUS_OUT2_STATUS_MASK | \ - ITRC_STATUS_OUT3_STATUS_MASK | ITRC_STATUS_OUT4_STATUS_MASK | ITRC_STATUS_OUT5_STATUS_MASK) -#endif /* ITRC_STATUS_OUT6_STATUS */ - -#define ITRC_OUT_COUNT (7u) -#ifndef ITRC -#define ITRC ITRC0 -#endif - -/******************************************************************************* - * API - *******************************************************************************/ - -extern void ITRC0_DriverIRQHandler(void); - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name ITRC Functional Operation - * @{ - */ - -/*! - * @brief Set ITRC Action to Event - * - * This function sets input Event signal to corresponding output Action response signal. - * - * @param base ITRC peripheral base address - * @param out ITRC OUT signal action - * @param in ITRC IN signal event - * @param lock if set locks INx_SEL configuration. This can be cleared only by PMC Core reset. - * @param enable if set input Event will be selected for output Action, otherwise disable (if not already locked). - * @return kStatus_Success if success, kStatus_InvalidArgument otherwise - */ -status_t ITRC_SetActionToEvent( - ITRC_Type *base, itrc_out_signals_t out, itrc_input_signals_t in, itrc_lock_t lock, itrc_enable_t enable); - -/*! - * @brief Trigger ITRC SW Event 0 - * - * This funciton set SW_EVENT0 register with value !=0 which triggers ITRC SW Event 0. - * - * @param base ITRC peripheral base address - */ -void ITRC_SetSWEvent0(ITRC_Type *base); - -/*! - * @brief Trigger ITRC SW Event 1 - * - * This funciton set SW_EVENT1 register with value !=0 which triggers ITRC SW Event 1. - * - * @param base ITRC peripheral base address - */ -void ITRC_SetSWEvent1(ITRC_Type *base); - -/*! - * @brief Get ITRC Status - * - * This function returns ITRC register status. - * - * @param base ITRC peripheral base address - * @return Value of ITRC STATUS register - */ -uint32_t ITRC_GetStatus(ITRC_Type *base); - -/*! - * @brief Clear ITRC status - * - * This function clears corresponding ITRC event or action in STATUS register. - * - * @param base ITRC peripheral base address - * @param word 32bit word represent corresponding event/action in STATUS register to be cleared (see - * ITRC_STATUS_INx/OUTx_STATUS) - * @return kStatus_Success if success, kStatus_InvalidArgument otherwise - */ -status_t ITRC_ClearStatus(ITRC_Type *base, uint32_t word); - -#if defined(ITRC_STATUS1_IN16_STATUS_MASK) -/*! - * @brief Get ITRC Status 1 - * - * This function returns ITRC STATUS1 register value. - * - * @param base ITRC peripheral base address - * @return Value of ITRC STATUS1 register - */ -uint32_t ITRC_GetStatus1(ITRC_Type *base); - -/*! - * brief Clear ITRC status 1 - * - * This function clears corresponding ITRC event or action in STATUS1 register. - * - * param base ITRC peripheral base address - * param word 32bit word represent corresponding event/action in STATUS1 register to be cleared (see - * ITRC_STATUS_INx/OUTx_STATUS) - * return kStatus_Success if success, kStatus_InvalidArgument otherwise - */ -status_t ITRC_ClearStatus1(ITRC_Type *base, uint32_t word); -#endif /* defined(ITRC_STATUS1_IN16_STATUS_MASK) */ - -/*! - * @brief Clear All ITRC status - * - * This function clears all event and action status. - * - * @param base ITRC peripheral base address - * @return kStatus_Success if success - */ -status_t ITRC_ClearAllStatus(ITRC_Type *base); - -/*! - * @brief Initialize ITRC - * - * This function initializes ITRC by enabling IRQ. - * - * @param base ITRC peripheral base address - * @param conf ITRC configuration structure - * @return Status of the init operation - */ -status_t ITRC_Init(ITRC_Type *base); - -/*! - * @brief Deinitialize ITRC - * - * This function deinitializes ITRC by disabling IRQ. - * - * @param base ITRC peripheral base address - */ -void ITRC_Deinit(ITRC_Type *base); - -/*! @}*/ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @}*/ /* end of group itrc */ - -#endif /* FSL_ITRC_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpadc.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpadc.c deleted file mode 100644 index c22741c4f58..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpadc.c +++ /dev/null @@ -1,977 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpadc.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpadc" -#endif - -#ifndef ADC_VERID_DIFFEN_MASK -#define ADC_VERID_DIFFEN_MASK (0x2U) -#endif /* ADC_VERID_DIFFEN_MASK */ - -#ifndef ADC_VERID_NUM_SEC_MASK -#define ADC_VERID_NUM_SEC_MASK (0x800U) -#endif /* ADC_VERID_NUM_SEC_MASK */ - -#define ADC_CMDL_CHANNEL_MODE_MASK (0x60U) -#define ADC_CMDL_CHANNEL_MODE_SHIFT (5U) -#define ADC_CMDL_CHANNEL_MODE(x) \ - (((uint32_t)(((uint32_t)(x)) << ADC_CMDL_CHANNEL_MODE_SHIFT)) & ADC_CMDL_CHANNEL_MODE_MASK) - -#define GET_ADC_CFG_TPRICTRL_VALUE(val) (((uint32_t)val) & 0x3U) - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES -#define GET_ADC_CFG_TRES_VALUE(val) ((((uint32_t)val) & 0x4U) >> 2U) -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES */ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES -#define GET_ADC_CFG_TCMDRES_VALUE(val) ((((uint32_t)val) & 0x8U) >> 3U) -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES */ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI) && FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI -#define GET_ADC_CFG_HPT_EXDI_VALUE(val) ((((uint32_t)val) & 0x10U) >> 4U) -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI) && FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI */ - -#if defined(LPADC_RSTS) -#define LPADC_RESETS_ARRAY LPADC_RSTS -#elif defined(ADC_RSTS) -#define LPADC_RESETS_ARRAY ADC_RSTS -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Get instance number for LPADC module. - * - * @param base LPADC peripheral base address - */ -static uint32_t LPADC_GetInstance(ADC_Type *base); - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ -/*! - * @brief Get gain conversion result . - * - * @param gainAdjustment gain adjustment value. - */ -static uint32_t LPADC_GetGainConvResult(float gainAdjustment); -#endif /* defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ */ - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to LPADC bases for each instance. */ -static ADC_Type *const s_lpadcBases[] = ADC_BASE_PTRS; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to LPADC clocks for each instance. */ -static const clock_ip_name_t s_lpadcClocks[] = LPADC_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#if defined(LPADC_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_lpadcResets[] = LPADC_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t LPADC_GetInstance(ADC_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - /* - * $Branch Coverage Justification$ - * (instance >= ARRAY_SIZE(s_lpadcBases)) not covered. The peripheral base - * address is always valid and checked by assert. - */ - for (instance = 0; instance < ARRAY_SIZE(s_lpadcBases); instance++) - { - /* - * $Branch Coverage Justification$ - * (s_lpadcBases[instance] != base) not covered. The peripheral base - * address is always valid and checked by assert. - */ - if (s_lpadcBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_lpadcBases)); - - return instance; -} - -#if (defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) -/*! - * brief Get gain conversion Result . - * - * param gainAdjustment gain adjustment value. - */ -static uint32_t LPADC_GetGainConvResult(float gainAdjustment) -{ - uint16_t i = 0U; - uint32_t tmp32 = 0U; - uint32_t GCRa[17] = {0}; - uint32_t GCALR = 0U; - - for (i = 0x11U; i > 0U; i--) - { - tmp32 = (uint32_t)((gainAdjustment) / ((float)(1.0 / (double)(1U << (0x10U - (i - 1U)))))); - GCRa[i - 1U] = tmp32; - gainAdjustment = gainAdjustment - ((float)tmp32) * ((float)(1.0 / (double)(1U << (0x10U - (i - 1U))))); - } - /* Get GCALR value calculated */ - for (i = 0x11U; i > 0U; i--) - { - GCALR += GCRa[i - 1U] * ((uint32_t)(1UL << (uint32_t)(i - 1UL))); - } - - /* to return GCALR value calculated */ - return GCALR; -} -#endif /* defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ */ - -/*! - * brief Initializes the LPADC module. - * - * param base LPADC peripheral base address. - * param config Pointer to configuration structure. See "lpadc_config_t". - */ -void LPADC_Init(ADC_Type *base, const lpadc_config_t *config) -{ - /* Check if the pointer is available. */ - assert(config != NULL); - - uint32_t tmp32 = 0U; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock for LPADC instance. */ - (void)CLOCK_EnableClock(s_lpadcClocks[LPADC_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(LPADC_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_lpadcResets[LPADC_GetInstance(base)]); -#endif - - /* Reset the module. */ - LPADC_DoResetConfig(base); -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - LPADC_DoResetFIFO0(base); - LPADC_DoResetFIFO1(base); -#else - LPADC_DoResetFIFO(base); -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ - - /* Disable the module before setting configuration. */ - LPADC_Enable(base, false); - - /* Configure the module generally. */ - if (config->enableInDozeMode) - { - base->CTRL &= ~ADC_CTRL_DOZEN_MASK; - } - else - { - base->CTRL |= ADC_CTRL_DOZEN_MASK; - } - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS - /* Set calibration average mode. */ - base->CTRL |= ADC_CTRL_CAL_AVGS(config->conversionAverageMode); -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS */ - -/* ADCx_CFG. */ -#if defined(FSL_FEATURE_LPADC_HAS_CFG_ADCKEN) && FSL_FEATURE_LPADC_HAS_CFG_ADCKEN - if (config->enableInternalClock) - { - tmp32 |= ADC_CFG_ADCKEN_MASK; - } -#endif /* FSL_FEATURE_LPADC_HAS_CFG_ADCKEN */ -#if defined(FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG) && FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG - if (config->enableVref1LowVoltage) - { - tmp32 |= ADC_CFG_VREF1RNG_MASK; - } -#endif /* FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG */ - if (config->enableAnalogPreliminary) - { - tmp32 |= ADC_CFG_PWREN_MASK; - } - tmp32 |= (ADC_CFG_PUDLY(config->powerUpDelay) /* Power up delay. */ - | ADC_CFG_REFSEL(config->referenceVoltageSource) /* Reference voltage. */ -#if defined(FSL_FEATURE_LPADC_HAS_CFG_PWRSEL) && (FSL_FEATURE_LPADC_HAS_CFG_PWRSEL == 1U) - | ADC_CFG_PWRSEL(config->powerLevelMode) /* Power configuration. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_PWRSEL) && (FSL_FEATURE_LPADC_HAS_CFG_PWRSEL == 1U) */ - ); - - tmp32 |= ADC_CFG_TPRICTRL(GET_ADC_CFG_TPRICTRL_VALUE(config->triggerPriorityPolicy)); - -#if (defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES) - tmp32 |= ADC_CFG_TRES(GET_ADC_CFG_TRES_VALUE(config->triggerPriorityPolicy)); -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES */ - -#if (defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) - tmp32 |= ADC_CFG_TCMDRES(GET_ADC_CFG_TCMDRES_VALUE(config->triggerPriorityPolicy)); -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES */ - -#if (defined(FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI) && FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI) - tmp32 |= ADC_CFG_HPT_EXDI(GET_ADC_CFG_HPT_EXDI_VALUE(config->triggerPriorityPolicy)); -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI) && FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI */ - - base->CFG = tmp32; - - /* ADCx_PAUSE. */ - if (config->enableConvPause) - { - base->PAUSE = ADC_PAUSE_PAUSEEN_MASK | ADC_PAUSE_PAUSEDLY(config->convPauseDelay); - } - else - { - base->PAUSE = 0U; - } - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - /* ADCx_FCTRL0. */ - base->FCTRL[0] = ADC_FCTRL_FWMARK(config->FIFO0Watermark); - /* ADCx_FCTRL1. */ - base->FCTRL[1] = ADC_FCTRL_FWMARK(config->FIFO1Watermark); -#else - /* ADCx_FCTRL. */ - base->FCTRL = ADC_FCTRL_FWMARK(config->FIFOWatermark); -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ - - /* Enable the module after setting configuration. */ - LPADC_Enable(base, true); -} - -/*! - * brief Gets an available pre-defined settings for initial configuration. - * - * This function initializes the converter configuration structure with an available settings. The default values are: - * code - * config->enableInDozeMode = true; - * config->conversionAverageMode = kLPADC_ConversionAverage1; - * config->enableAnalogPreliminary = false; - * config->powerUpDelay = 0x80; - * config->referenceVoltageSource = kLPADC_ReferenceVoltageAlt1; - * config->powerLevelMode = kLPADC_PowerLevelAlt1; - * config->triggerPriorityPolicy = kLPADC_TriggerPriorityPreemptImmediately; - * config->enableConvPause = false; - * config->convPauseDelay = 0U; - * config->FIFO0Watermark = 0U; - * config->FIFO1Watermark = 0U; - * config->FIFOWatermark = 0U; - * endcode - * param config Pointer to configuration structure. - */ -void LPADC_GetDefaultConfig(lpadc_config_t *config) -{ - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_ADCKEN) && FSL_FEATURE_LPADC_HAS_CFG_ADCKEN - config->enableInternalClock = false; -#endif /* FSL_FEATURE_LPADC_HAS_CFG_ADCKEN */ -#if defined(FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG) && FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG - config->enableVref1LowVoltage = false; -#endif /* FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG */ - config->enableInDozeMode = true; -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS - /* Set calibration average mode. */ - config->conversionAverageMode = kLPADC_ConversionAverage1; -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS */ - config->enableAnalogPreliminary = false; - config->powerUpDelay = 0x80; - config->referenceVoltageSource = kLPADC_ReferenceVoltageAlt1; -#if defined(FSL_FEATURE_LPADC_HAS_CFG_PWRSEL) && (FSL_FEATURE_LPADC_HAS_CFG_PWRSEL == 1U) - config->powerLevelMode = kLPADC_PowerLevelAlt1; -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_PWRSEL) && (FSL_FEATURE_LPADC_HAS_CFG_PWRSEL == 1U) */ - config->triggerPriorityPolicy = kLPADC_TriggerPriorityPreemptImmediately; - config->enableConvPause = false; - config->convPauseDelay = 0U; -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - config->FIFO0Watermark = 0U; - config->FIFO1Watermark = 0U; -#else - config->FIFOWatermark = 0U; -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ -} - -/*! - * brief De-initializes the LPADC module. - * - * param base LPADC peripheral base address. - */ -void LPADC_Deinit(ADC_Type *base) -{ - /* Disable the module. */ - LPADC_Enable(base, false); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate the clock. */ - (void)CLOCK_DisableClock(s_lpadcClocks[LPADC_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) -/*! - * brief Get the result in conversion FIFOn. - * - * param base LPADC peripheral base address. - * param result Pointer to structure variable that keeps the conversion result in conversion FIFOn. - * param index Result FIFO index. - * - * return Status whether FIFOn entry is valid. - */ -bool LPADC_GetConvResult(ADC_Type *base, lpadc_conv_result_t *result, uint8_t index) -{ - assert(result != NULL); /* Check if the input pointer is available. */ - - uint32_t tmp32 = 0U; - - tmp32 = base->RESFIFO[index]; - - if (ADC_RESFIFO_VALID_MASK != (tmp32 & ADC_RESFIFO_VALID_MASK)) - { - return false; /* FIFO is empty. Discard any read from RESFIFO. */ - } - - result->commandIdSource = (tmp32 & ADC_RESFIFO_CMDSRC_MASK) >> ADC_RESFIFO_CMDSRC_SHIFT; - result->loopCountIndex = (tmp32 & ADC_RESFIFO_LOOPCNT_MASK) >> ADC_RESFIFO_LOOPCNT_SHIFT; - result->triggerIdSource = (tmp32 & ADC_RESFIFO_TSRC_MASK) >> ADC_RESFIFO_TSRC_SHIFT; - result->convValue = (uint16_t)(tmp32 & ADC_RESFIFO_D_MASK); - - return true; -} -/*! - * brief Get the result in conversion FIFOn using blocking method. - * - * param base LPADC peripheral base address. - * param result Pointer to structure variable that keeps the conversion result in conversion FIFOn. - * param index Result FIFO index. - */ -void LPADC_GetConvResultBlocking(ADC_Type *base, lpadc_conv_result_t *result, uint8_t index) -{ - assert(result != NULL); /* Check if the input pointer is available. */ - - uint32_t tmp32 = 0U; - - tmp32 = base->RESFIFO[index]; - - while (ADC_RESFIFO_VALID_MASK != (tmp32 & ADC_RESFIFO_VALID_MASK)) - { - tmp32 = base->RESFIFO[index]; - } - - result->commandIdSource = (tmp32 & ADC_RESFIFO_CMDSRC_MASK) >> ADC_RESFIFO_CMDSRC_SHIFT; - result->loopCountIndex = (tmp32 & ADC_RESFIFO_LOOPCNT_MASK) >> ADC_RESFIFO_LOOPCNT_SHIFT; - result->triggerIdSource = (tmp32 & ADC_RESFIFO_TSRC_MASK) >> ADC_RESFIFO_TSRC_SHIFT; - result->convValue = (uint16_t)(tmp32 & ADC_RESFIFO_D_MASK); -} -#else -/*! - * brief Get the result in conversion FIFO. - * - * param base LPADC peripheral base address. - * param result Pointer to structure variable that keeps the conversion result in conversion FIFO. - * - * return Status whether FIFO entry is valid. - */ -bool LPADC_GetConvResult(ADC_Type *base, lpadc_conv_result_t *result) -{ - assert(result != NULL); /* Check if the input pointer is available. */ - - uint32_t tmp32 = 0U; - - tmp32 = base->RESFIFO; - - if (ADC_RESFIFO_VALID_MASK != (tmp32 & ADC_RESFIFO_VALID_MASK)) - { - return false; /* FIFO is empty. Discard any read from RESFIFO. */ - } - - result->commandIdSource = (tmp32 & ADC_RESFIFO_CMDSRC_MASK) >> ADC_RESFIFO_CMDSRC_SHIFT; - result->loopCountIndex = (tmp32 & ADC_RESFIFO_LOOPCNT_MASK) >> ADC_RESFIFO_LOOPCNT_SHIFT; - result->triggerIdSource = (tmp32 & ADC_RESFIFO_TSRC_MASK) >> ADC_RESFIFO_TSRC_SHIFT; - result->convValue = (uint16_t)(tmp32 & ADC_RESFIFO_D_MASK); - - return true; -} -/*! - * @brief Get the result in conversion FIFO using blocking method. - * - * @param base LPADC peripheral base address. - * @param result Pointer to structure variable that keeps the conversion result in conversion FIFO. - */ -void LPADC_GetConvResultBlocking(ADC_Type *base, lpadc_conv_result_t *result) -{ - assert(result != NULL); /* Check if the input pointer is available. */ - - uint32_t tmp32 = 0U; - - tmp32 = base->RESFIFO; - - while (ADC_RESFIFO_VALID_MASK != (tmp32 & ADC_RESFIFO_VALID_MASK)) - { - tmp32 = base->RESFIFO; - } - - result->commandIdSource = (tmp32 & ADC_RESFIFO_CMDSRC_MASK) >> ADC_RESFIFO_CMDSRC_SHIFT; - result->loopCountIndex = (tmp32 & ADC_RESFIFO_LOOPCNT_MASK) >> ADC_RESFIFO_LOOPCNT_SHIFT; - result->triggerIdSource = (tmp32 & ADC_RESFIFO_TSRC_MASK) >> ADC_RESFIFO_TSRC_SHIFT; - result->convValue = (uint16_t)(tmp32 & ADC_RESFIFO_D_MASK); -} -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ - -/*! - * brief Configure the conversion trigger source. - * - * Each programmable trigger can launch the conversion command in command buffer. - * - * param base LPADC peripheral base address. - * param triggerId ID for each trigger. Typically, the available value range is from 0 to 3. - * param config Pointer to configuration structure. See to #lpadc_conv_trigger_config_t. - */ -void LPADC_SetConvTriggerConfig(ADC_Type *base, uint32_t triggerId, const lpadc_conv_trigger_config_t *config) -{ - assert(triggerId < ADC_TCTRL_COUNT); /* Check if the triggerId is available in this device. */ - assert(config != NULL); /* Check if the input pointer is available. */ - - uint32_t tmp32; - - tmp32 = ADC_TCTRL_TCMD(config->targetCommandId) /* Trigger command select. */ - | ADC_TCTRL_TDLY(config->delayPower) /* Trigger delay select. */ - | ADC_TCTRL_TPRI(config->priority) /* Trigger priority setting. */ -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - | ADC_TCTRL_FIFO_SEL_A(config->channelAFIFOSelect) -#if !(defined(FSL_FEATURE_LPADC_HAS_NO_TCTRL_FIFO_SEL_B) && FSL_FEATURE_LPADC_HAS_NO_TCTRL_FIFO_SEL_B) - | ADC_TCTRL_FIFO_SEL_B(config->channelBFIFOSelect) -#endif /* FSL_FEATURE_LPADC_HAS_NO_TCTRL_FIFO_SEL_B */ -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ - ; - if (config->enableHardwareTrigger) - { - tmp32 |= ADC_TCTRL_HTEN_MASK; - } - - base->TCTRL[triggerId] = tmp32; -} - -/*! - * brief Gets an available pre-defined settings for trigger's configuration. - * - * This function initializes the trigger's configuration structure with an available settings. The default values are: - * code - * config->targetCommandId = 0U; - * config->delayPower = 0U; - * config->priority = 0U; - * config->channelAFIFOSelect = 0U; - * config->channelBFIFOSelect = 0U; - * config->enableHardwareTrigger = false; - * endcode - * param config Pointer to configuration structure. - */ -void LPADC_GetDefaultConvTriggerConfig(lpadc_conv_trigger_config_t *config) -{ - assert(config != NULL); /* Check if the input pointer is available. */ - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->targetCommandId = 0U; - config->delayPower = 0U; - config->priority = 0U; -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - config->channelAFIFOSelect = 0U; - config->channelBFIFOSelect = 0U; -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ - config->enableHardwareTrigger = false; -} - -/*! - * brief Configure conversion command. - * - * note The number of compare value register on different chips is different, that is mean in some chips, some - * command buffers do not have the compare functionality. - * - * param base LPADC peripheral base address. - * param commandId ID for command in command buffer. Typically, the available value range is 1 - 15. - * param config Pointer to configuration structure. See to #lpadc_conv_command_config_t. - */ -void LPADC_SetConvCommandConfig(ADC_Type *base, uint32_t commandId, const lpadc_conv_command_config_t *config) -{ - assert(commandId < (ADC_CMDL_COUNT + 1U)); /* Check if the commandId is available on this device. */ - assert(config != NULL); /* Check if the input pointer is available. */ - - uint32_t tmp32 = 0; - - commandId--; /* The available command number are 1-15, while the index of register group are 0-14. */ - - /* ADCx_CMDL. */ - tmp32 = ADC_CMDL_ADCH(config->channelNumber); /* Channel number. */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTB_ADCH) && FSL_FEATURE_LPADC_HAS_CMDL_ALTB_ADCH - tmp32 |= ADC_CMDL_ALTB_ADCH(config->channelBNumber); /* Alternate channel B number. */ -#endif -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_CSCALE) && FSL_FEATURE_LPADC_HAS_CMDL_CSCALE - tmp32 |= ADC_CMDL_CSCALE(config->sampleScaleMode); /* Full/Part scale input voltage. */ -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_CSCALE */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE) && FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE - tmp32 |= ADC_CMDL_ALTB_CSCALE(config->channelBScaleMode); /* Alternate channel B full/Part scale input voltage. */ -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE */ - -#if !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_DIFF) && FSL_FEATURE_LPADC_HAS_CMDL_DIFF - assert(((config->sampleChannelMode >= kLPADC_SampleChannelDiffBothSideAB) && - (((base->VERID) & ADC_VERID_DIFFEN_MASK) != 0U)) || - (config->sampleChannelMode < kLPADC_SampleChannelDiffBothSideAB)); -#endif /* defined(FSL_FEATURE_LPADC_HAS_CMDL_DIFF) && FSL_FEATURE_LPADC_HAS_CMDL_DIFF */ - -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_CTYPE) && FSL_FEATURE_LPADC_HAS_CMDL_CTYPE - assert(((config->sampleChannelMode == kLPADC_SampleChannelDiffBothSide) && - (((base->VERID) & ADC_VERID_DIFFEN_MASK) != 0U)) || - ((config->sampleChannelMode == kLPADC_SampleChannelDualSingleEndBothSide) && - (((base->VERID) & ADC_VERID_NUM_SEC_MASK) != 0U)) || - (config->sampleChannelMode < kLPADC_SampleChannelDualSingleEndBothSide)); -#endif /* defined(FSL_FEATURE_LPADC_HAS_CMDL_CTYPE) && FSL_FEATURE_LPADC_HAS_CMDL_CTYPE */ -#endif /* !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) */ - - tmp32 |= ADC_CMDL_CHANNEL_MODE(config->sampleChannelMode); - -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_MODE) && FSL_FEATURE_LPADC_HAS_CMDL_MODE - tmp32 |= ADC_CMDL_MODE(config->conversionResolutionMode); -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_MODE */ - -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN) && FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN - /* Enable alternate channel B.*/ - if (config->enableChannelB) - { - tmp32 |= ADC_CMDL_ALTBEN_MASK; - } -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN */ - - base->CMD[commandId].CMDL = tmp32; - - /* ADCx_CMDH. */ - tmp32 = ADC_CMDH_NEXT(config->chainedNextCommandNumber) /* Next Command Select. */ - | ADC_CMDH_LOOP(config->loopCount) /* Loop Count Select. */ - | ADC_CMDH_AVGS(config->hardwareAverageMode) /* Hardware Average Select. */ - | ADC_CMDH_STS(config->sampleTimeMode) /* Sample Time Select. */ - | ADC_CMDH_CMPEN(config->hardwareCompareMode); /* Hardware compare enable. */ -#if (defined(FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG) && FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG) - if (config->enableWaitTrigger) - { - tmp32 |= ADC_CMDH_WAIT_TRIG_MASK; /* Wait trigger enable. */ - } -#endif /* FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG */ - - if (config->enableAutoChannelIncrement) - { - tmp32 |= ADC_CMDH_LWI_MASK; - } - base->CMD[commandId].CMDH = tmp32; - - /* Hardware compare settings. - * Not all Command Buffers have an associated Compare Value register. The compare function is only available on - * Command Buffers that have a corresponding Compare Value register. Therefore, assertion judgment needs to be - * made before setting the CV register. - */ - - if ((kLPADC_HardwareCompareDisabled != config->hardwareCompareMode) && (commandId < ADC_CV_COUNT)) - { - /* Set CV register. */ - base->CV[commandId] = (ADC_CV_CVH(config->hardwareCompareValueHigh) /* Compare value high. */ - | ADC_CV_CVL(config->hardwareCompareValueLow)); /* Compare value low. */ - } -} - -/*! - * brief Gets an available pre-defined settings for conversion command's configuration. - * - * This function initializes the conversion command's configuration structure with an available settings. The default - * values are: - * code - * config->sampleScaleMode = kLPADC_SampleFullScale; - * config->channelBScaleMode = kLPADC_SampleFullScale; - * config->sampleChannelMode = kLPADC_SampleChannelSingleEndSideA; - * config->channelNumber = 0U; - * config->channelBNumber = 0U; - * config->chainedNextCommandNumber = 0U; - * config->enableAutoChannelIncrement = false; - * config->loopCount = 0U; - * config->hardwareAverageMode = kLPADC_HardwareAverageCount1; - * config->sampleTimeMode = kLPADC_SampleTimeADCK3; - * config->hardwareCompareMode = kLPADC_HardwareCompareDisabled; - * config->hardwareCompareValueHigh = 0U; - * config->hardwareCompareValueLow = 0U; - * config->conversionResolutionMode = kLPADC_ConversionResolutionStandard; - * config->enableWaitTrigger = false; - * config->enableChannelB = false; - * endcode - * param config Pointer to configuration structure. - */ -void LPADC_GetDefaultConvCommandConfig(lpadc_conv_command_config_t *config) -{ - assert(config != NULL); /* Check if the input pointer is available. */ - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_CSCALE) && FSL_FEATURE_LPADC_HAS_CMDL_CSCALE - config->sampleScaleMode = kLPADC_SampleFullScale; -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_CSCALE */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE) && FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE - config->channelBScaleMode = kLPADC_SampleFullScale; -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE */ - config->sampleChannelMode = kLPADC_SampleChannelSingleEndSideA; - config->channelNumber = 0U; -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTB_ADCH) && FSL_FEATURE_LPADC_HAS_CMDL_ALTB_ADCH - config->channelBNumber = 0U; -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE */ - config->chainedNextCommandNumber = 0U; /* No next command defined. */ - config->enableAutoChannelIncrement = false; - config->loopCount = 0U; - config->hardwareAverageMode = kLPADC_HardwareAverageCount1; - config->sampleTimeMode = kLPADC_SampleTimeADCK3; - config->hardwareCompareMode = kLPADC_HardwareCompareDisabled; - config->hardwareCompareValueHigh = 0U; /* No used. */ - config->hardwareCompareValueLow = 0U; /* No used. */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_MODE) && FSL_FEATURE_LPADC_HAS_CMDL_MODE - config->conversionResolutionMode = kLPADC_ConversionResolutionStandard; -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_MODE */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG) && FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG - config->enableWaitTrigger = false; -#endif /* FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN) && FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN - config->enableChannelB = false; /* Enable alternate channel B.*/ -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN */ -} - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_CALOFS) && FSL_FEATURE_LPADC_HAS_CFG_CALOFS -/*! - * brief Enable the calibration function. - * - * When CALOFS is set, the ADC is configured to perform a calibration function anytime the ADC executes - * a conversion. Any channel selected is ignored and the value returned in the RESFIFO is a signed value - * between -31 and 31. -32 is not a valid and is never a returned value. Software should copy the lower 6- - * bits of the conversion result stored in the RESFIFO after a completed calibration conversion to the - * OFSTRIM field. The OFSTRIM field is used in normal operation for offset correction. - * - * param base LPADC peripheral base address. - * param enable switcher to the calibration function. - */ -void LPADC_EnableCalibration(ADC_Type *base, bool enable) -{ - LPADC_Enable(base, false); - if (enable) - { - base->CFG |= ADC_CFG_CALOFS_MASK; - } - else - { - base->CFG &= ~ADC_CFG_CALOFS_MASK; - } - LPADC_Enable(base, true); -} - -#if defined(FSL_FEATURE_LPADC_HAS_OFSTRIM) && FSL_FEATURE_LPADC_HAS_OFSTRIM -/*! - * brief Do auto calibration. - * - * Calibration function should be executed before using converter in application. It used the software trigger and a - * dummy conversion, get the offset and write them into the OFSTRIM register. It called some of functional API - * including: -LPADC_EnableCalibration(...) -LPADC_LPADC_SetOffsetValue(...) -LPADC_SetConvCommandConfig(...) - * -LPADC_SetConvTriggerConfig(...) - * - * param base LPADC peripheral base address. - */ -void LPADC_DoAutoCalibration(ADC_Type *base) -{ - assert(0u == LPADC_GetConvResultCount(base)); - - uint32_t mLpadcCMDL; - uint32_t mLpadcCMDH; - uint32_t mLpadcTrigger; - lpadc_conv_trigger_config_t mLpadcTriggerConfigStruct; - lpadc_conv_command_config_t mLpadcCommandConfigStruct; - lpadc_conv_result_t mLpadcResultConfigStruct; - - /* Enable the calibration function. */ - LPADC_EnableCalibration(base, true); - - /* Keep the CMD and TRG state here and restore it later if the calibration completes.*/ - mLpadcCMDL = base->CMD[0].CMDL; /* CMD1L. */ - mLpadcCMDH = base->CMD[0].CMDH; /* CMD1H. */ - mLpadcTrigger = base->TCTRL[0]; /* Trigger0. */ - - /* Set trigger0 configuration - for software trigger. */ - LPADC_GetDefaultConvTriggerConfig(&mLpadcTriggerConfigStruct); - mLpadcTriggerConfigStruct.targetCommandId = 1U; /* CMD1 is executed. */ - LPADC_SetConvTriggerConfig(base, 0U, &mLpadcTriggerConfigStruct); /* Configurate the trigger0. */ - - /* Set conversion CMD configuration. */ - LPADC_GetDefaultConvCommandConfig(&mLpadcCommandConfigStruct); - mLpadcCommandConfigStruct.hardwareAverageMode = kLPADC_HardwareAverageCount128; - LPADC_SetConvCommandConfig(base, 1U, &mLpadcCommandConfigStruct); /* Set CMD1 configuration. */ - - /* Do calibration. */ - LPADC_DoSoftwareTrigger(base, 1U); /* 1U is trigger0 mask. */ - while (!LPADC_GetConvResult(base, &mLpadcResultConfigStruct)) - { - } - /* The valid bits of data are bits 14:3 in the RESFIFO register. */ - LPADC_SetOffsetValue(base, (uint32_t)(mLpadcResultConfigStruct.convValue) >> 3UL); - /* Disable the calibration function. */ - LPADC_EnableCalibration(base, false); - - /* restore CMD and TRG registers. */ - base->CMD[0].CMDL = mLpadcCMDL; /* CMD1L. */ - base->CMD[0].CMDH = mLpadcCMDH; /* CMD1H. */ - base->TCTRL[0] = mLpadcTrigger; /* Trigger0. */ -} -#endif /* FSL_FEATURE_LPADC_HAS_OFSTRIM */ -#endif /* FSL_FEATURE_LPADC_HAS_CFG_CALOFS */ - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFS) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFS -/*! - * brief Do offset calibration. - * - * param base LPADC peripheral base address. - */ -void LPADC_DoOffsetCalibration(ADC_Type *base) -{ - LPADC_EnableOffsetCalibration(base, true); - while (ADC_STAT_CAL_RDY_MASK != (base->STAT & ADC_STAT_CAL_RDY_MASK)) - { - } -} - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ -/*! - * brief Do auto calibration. - * - * param base LPADC peripheral base address. - */ -void LPADC_DoAutoCalibration(ADC_Type *base) -{ - LPADC_PrepareAutoCalibration(base); - LPADC_FinishAutoCalibration(base); -} - -/*! - * brief Prepare auto calibration, LPADC_FinishAutoCalibration has to be called before using the LPADC. - * LPADC_DoAutoCalibration has been split in two API to avoid to be stuck too long in the function. - * - * param base LPADC peripheral base address. - */ -void LPADC_PrepareAutoCalibration(ADC_Type *base) -{ -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - assert((0U == LPADC_GetConvResultCount(base, 0)) && (0U == LPADC_GetConvResultCount(base, 1))); -#else /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 1)) */ - assert(LPADC_GetConvResultCount(base) == 0U); -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) */ - - /* Request gain calibration. */ - base->CTRL |= ADC_CTRL_CAL_REQ_MASK; -} - -/*! - * brief Finish auto calibration start with LPADC_PrepareAutoCalibration. - * - * param base LPADC peripheral base address. - */ -void LPADC_FinishAutoCalibration(ADC_Type *base) -{ -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE - int32_t GCCa; - int32_t GCCb; - float GCRa; - float GCRb; -#else - uint32_t GCCa; - float GCRa; -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - uint32_t GCCb; - float GCRb; -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE */ - - while ((ADC_GCC_RDY_MASK != (base->GCC[0] & ADC_GCC_RDY_MASK)) -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - || (ADC_GCC_RDY_MASK != (base->GCC[1] & ADC_GCC_RDY_MASK)) -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ - ) - { - } - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE - GCCa = (int32_t)(base->GCC[0] & ADC_GCC_GAIN_CAL_MASK); - GCCb = (int32_t)(base->GCC[1] & ADC_GCC_GAIN_CAL_MASK); - if (0U != ((base->GCC[0]) & 0x8000U)) - { - GCCa = GCCa - 0x10000; - GCRa = (float)((131072.0) / - (131072.0 - (double)GCCa)); /* Gain_CalA = (131072.0 / (131072-(ADC_GCC_GAIN_CAL(ADC->GCC[0]))*/ - base->GCR[0] = LPADC_GetGainConvResult(GCRa); /* write A side GCALR. */ - } - - if (0U != ((base->GCC[1]) & 0x8000U)) - { - GCCb = GCCb - 0x10000; - GCRb = (float)((131072.0) / - (131072.0 - (double)GCCb)); /* Gain_CalB = (131072.0 / (131072-(ADC_GCC_GAIN_CAL(ADC->GCC[1]))*/ - base->GCR[1] = LPADC_GetGainConvResult(GCRb); /* write B side GCALR. */ - } -#else - /* Calculate gain offset. */ - GCCa = (base->GCC[0] & ADC_GCC_GAIN_CAL_MASK); - GCRa = (float)((131072.0) / - (131072.0 - (double)GCCa)); /* Gain_CalA = (131072.0 / (131072-(ADC_GCC_GAIN_CAL(ADC->GCC[0]))*/ - base->GCR[0] = LPADC_GetGainConvResult(GCRa); /* write A side GCALR. */ - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - GCCb = (base->GCC[1] & ADC_GCC_GAIN_CAL_MASK); - GCRb = (float)((131072.0) / - (131072.0 - (double)GCCb)); /* Gain_CalB = (131072.0 / (131072-(ADC_GCC_GAIN_CAL(ADC->GCC[1]))*/ - base->GCR[1] = LPADC_GetGainConvResult(GCRb); /* write B side GCALR. */ -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE */ - /* Indicate the values are valid. */ - base->GCR[0] |= ADC_GCR_RDY_MASK; -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - base->GCR[1] |= ADC_GCR_RDY_MASK; -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ - - while (ADC_STAT_CAL_RDY_MASK != (base->STAT & ADC_STAT_CAL_RDY_MASK)) - { - } -} -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ */ - -/*! - * brief Get calibration value into the memory which is defined by invoker. - * - * note Please note the ADC will be disabled temporary. - * note This function should be used after finish calibration. - * - * param base LPADC peripheral base address. - * param ptrCalibrationValue Pointer to lpadc_calibration_value_t structure, this memory block should be always powered - * on even in low power modes. - */ -void LPADC_GetCalibrationValue(ADC_Type *base, lpadc_calibration_value_t *ptrCalibrationValue) -{ - assert(ptrCalibrationValue != NULL); - - bool adcEnabled = false; - - /* Check if ADC is enabled. */ - if ((base->CTRL & ADC_CTRL_ADCEN_MASK) != 0UL) - { - LPADC_Enable(base, false); - adcEnabled = true; - } - -#if (defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) - uint32_t i; - for (i = 0UL; i < 33UL; i++) - { -#if defined(ADC_CAL_GAR0_CAL_GAR_VAL_MASK) - ptrCalibrationValue->generalCalibrationValueA[i] = - (uint16_t)((*(((volatile uint32_t *)(&(base->CAL_GAR0))) + i)) & 0xFFFFU); -#if !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) - ptrCalibrationValue->generalCalibrationValueB[i] = - (uint16_t)((*(((volatile uint32_t *)(&(base->CAL_GBR0))) + i)) & 0xFFFFU); -#endif /* (defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) */ -#else - ptrCalibrationValue->generalCalibrationValueA[i] = - (uint16_t)((*(((volatile uint32_t *)(&(base->CAL_GAR[0]))) + i)) & 0xFFFFU); -#if !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) - ptrCalibrationValue->generalCalibrationValueB[i] = - (uint16_t)((*(((volatile uint32_t *)(&(base->CAL_GBR[0]))) + i)) & 0xFFFFU); -#endif /* (defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) */ - -#endif /* defined(ADC_CAL_GAR0_CAL_GAR_VAL_MASK) */ - } -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ */ - - ptrCalibrationValue->gainCalibrationResultA = (uint16_t)(base->GCR[0] & ADC_GCR_GCALR_MASK); -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - ptrCalibrationValue->gainCalibrationResultB = (uint16_t)(base->GCR[1] & ADC_GCR_GCALR_MASK); -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ - - if (adcEnabled) - { - LPADC_Enable(base, true); - } -} - -/*! - * brief Set calibration value into ADC calibration registers. - * - * note Please note the ADC will be disabled temporary. - * - * param base LPADC peripheral base address. - * param ptrCalibrationValue Pointer to lpadc_calibration_value_t structure which contains ADC's calibration value. - */ -void LPADC_SetCalibrationValue(ADC_Type *base, const lpadc_calibration_value_t *ptrCalibrationValue) -{ - assert(ptrCalibrationValue != NULL); - - bool adcEnabled = false; - - /* Check if ADC is enabled. */ - if ((base->CTRL & ADC_CTRL_ADCEN_MASK) != 0UL) - { - LPADC_Enable(base, false); - adcEnabled = true; - } - -#if (defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) - for (uint32_t i = 0UL; i < 33UL; i++) - { -#if defined(ADC_CAL_GAR0_CAL_GAR_VAL_MASK) - *(((volatile uint32_t *)(&(base->CAL_GAR0))) + i) = ptrCalibrationValue->generalCalibrationValueA[i]; -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - *(((volatile uint32_t *)(&(base->CAL_GBR0))) + i) = ptrCalibrationValue->generalCalibrationValueB[i]; -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ -#else - *(((volatile uint32_t *)(&(base->CAL_GAR[0]))) + i) = ptrCalibrationValue->generalCalibrationValueA[i]; -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - *(((volatile uint32_t *)(&(base->CAL_GBR[0]))) + i) = ptrCalibrationValue->generalCalibrationValueB[i]; -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ -#endif /* defined(ADC_CAL_GAR0_CAL_GAR_VAL_MASK) */ - } -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ */ - - base->GCR[0] = ADC_GCR_GCALR(ptrCalibrationValue->gainCalibrationResultA) | ADC_GCR_RDY_MASK; -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - base->GCR[1] = ADC_GCR_GCALR(ptrCalibrationValue->gainCalibrationResultB) | ADC_GCR_RDY_MASK; -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ - /* - * $Branch Coverage Justification$ - * while ((base->STAT & ADC_STAT_CAL_RDY_MASK) == ADC_STAT_CAL_RDY_MASK) not covered. Test unfeasible, - * the calibration ready state is too short not to catch. - */ - while (ADC_STAT_CAL_RDY_MASK != (base->STAT & ADC_STAT_CAL_RDY_MASK)) - { - } - - if (adcEnabled) - { - LPADC_Enable(base, true); - } -} - -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CALOFS */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpadc.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpadc.h deleted file mode 100644 index e0d2f4b6ee4..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpadc.h +++ /dev/null @@ -1,1529 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LPADC_H_ -#define FSL_LPADC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup lpadc - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief LPADC driver version 2.8.4. */ -#define FSL_LPADC_DRIVER_VERSION (MAKE_VERSION(2, 8, 4)) -/*! @} */ - -#if (defined(FSL_FEATURE_LPADC_OFSTRIM_COUNT) && (FSL_FEATURE_LPADC_OFSTRIM_COUNT == 1)) -#define ADC_OFSTRIM_OFSTRIM_MAX (ADC_OFSTRIM_OFSTRIM_MASK >> ADC_OFSTRIM_OFSTRIM_SHIFT) -#define ADC_OFSTRIM_OFSTRIM_SIGN ((ADC_OFSTRIM_OFSTRIM_MAX + 1U) >> 1U) - -#elif (defined(FSL_FEATURE_LPADC_OFSTRIM_COUNT) && (FSL_FEATURE_LPADC_OFSTRIM_COUNT == 2)) -#define ADC_OFSTRIM_OFSTRIM_A_MAX (ADC_OFSTRIM_OFSTRIM_A_MASK >> ADC_OFSTRIM_OFSTRIM_A_SHIFT) -#define ADC_OFSTRIM_OFSTRIM_B_MAX (ADC_OFSTRIM_OFSTRIM_B_MASK >> ADC_OFSTRIM_OFSTRIM_B_SHIFT) -#define ADC_OFSTRIM_OFSTRIM_A_SIGN ((ADC_OFSTRIM_OFSTRIM_A_MAX + 1U) >> 1U) -#define ADC_OFSTRIM_OFSTRIM_B_SIGN ((ADC_OFSTRIM_OFSTRIM_B_MAX + 1U) >> 1U) -#endif /* defined(FSL_FEATURE_LPADC_OFSTRIM_COUNT) */ - -/*! - * @brief Define the MACRO function to get command status from status value. - * - * The statusVal is the return value from LPADC_GetStatusFlags(). - */ -#define LPADC_GET_ACTIVE_COMMAND_STATUS(statusVal) ((statusVal & ADC_STAT_CMDACT_MASK) >> ADC_STAT_CMDACT_SHIFT) - -/*! - * @brief Define the MACRO function to get trigger status from status value. - * - * The statusVal is the return value from LPADC_GetStatusFlags(). - */ -#define LPADC_GET_ACTIVE_TRIGGER_STATUE(statusVal) ((statusVal & ADC_STAT_TRGACT_MASK) >> ADC_STAT_TRGACT_SHIFT) - -/* Map macros to the unified name. */ -#if !defined(ADC_STAT_FOF0_MASK) -#ifdef ADC_STAT_FOF_MASK -#define ADC_STAT_FOF0_MASK ADC_STAT_FOF_MASK -#else -#error "ADC_STAT_FOF0_MASK not defined" -#endif /* ifdef(ADC_STAT_FOF_MASK) */ -#endif /* !defined(ADC_STAT_FOF0_MASK) */ - -#if !defined(ADC_STAT_RDY0_MASK) -#ifdef ADC_STAT_RDY_MASK -#define ADC_STAT_RDY0_MASK ADC_STAT_RDY_MASK -#else -#error "ADC_STAT_RDY0_MASK not defined" -#endif /* ifdef ADC_STAT_RDY_MASK */ -#endif /* !defined(ADC_STAT_RDY0_MASK) */ - -#if !defined(ADC_IE_FOFIE0_MASK) -#ifdef ADC_IE_FOFIE_MASK -#define ADC_IE_FOFIE0_MASK ADC_IE_FOFIE_MASK -#else -#error "ADC_IE_FOFIE0_MASK not defined" -#endif /* ifdef ADC_IE_FOFIE_MASK */ -#endif /* !defined(ADC_IE_FOFIE0_MASK) */ - -#if !defined(ADC_IE_FWMIE0_MASK) -#ifdef ADC_IE_FWMIE_MASK -#define ADC_IE_FWMIE0_MASK ADC_IE_FWMIE_MASK -#else -#error "ADC_IE_FWMIE0_MASK not defined" -#endif /* ifdef ADC_IE_FWMIE_MASK */ -#endif /* !defined(ADC_IE_FWMIE0_MASK) */ - -/*! - * @brief Define hardware flags of the module. - */ -enum _lpadc_status_flags -{ - kLPADC_ResultFIFO0OverflowFlag = ADC_STAT_FOF0_MASK, /*!< Indicates that more data has been written to the Result - FIFO 0 than it can hold. */ - kLPADC_ResultFIFO0ReadyFlag = ADC_STAT_RDY0_MASK, /*!< Indicates when the number of valid datawords in the result - FIFO 0 is greater than the setting watermark level. */ - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - kLPADC_ResultFIFO1OverflowFlag = ADC_STAT_FOF1_MASK, /*!< Indicates that more data has been written to the Result - FIFO 1 than it can hold. */ - kLPADC_ResultFIFO1ReadyFlag = ADC_STAT_RDY1_MASK, /*!< Indicates when the number of valid datawords in the result - FIFO 1 is greater than the setting watermark level. */ -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ - -#if (defined(FSL_FEATURE_LPADC_HAS_STAT_TEXC_INT) && (FSL_FEATURE_LPADC_HAS_STAT_TEXC_INT == 1U)) - kLPADC_TriggerExceptionFlag = ADC_STAT_TEXC_INT_MASK, /*!< Indicates that a trigger exception event has occurred. */ -#endif /* (defined(FSL_FEATURE_LPADC_HAS_STAT_TEXC_INT) && (FSL_FEATURE_LPADC_HAS_STAT_TEXC_INT == 1U)) */ - -#if (defined(FSL_FEATURE_LPADC_HAS_STAT_TCOMP_INT) && (FSL_FEATURE_LPADC_HAS_STAT_TCOMP_INT == 1U)) - kLPADC_TriggerCompletionFlag = ADC_STAT_TCOMP_INT_MASK, /*!< Indicates that a trigger completion event has occurred. - */ -#endif /* (defined(FSL_FEATURE_LPADC_HAS_STAT_TCOMP_INT) && (FSL_FEATURE_LPADC_HAS_STAT_TCOMP_INT == 1U)) */ - -#if (defined(FSL_FEATURE_LPADC_HAS_STAT_CAL_RDY) && (FSL_FEATURE_LPADC_HAS_STAT_CAL_RDY == 1U)) - kLPADC_CalibrationReadyFlag = ADC_STAT_CAL_RDY_MASK, /*!< Indicates that the calibration process is done. */ -#endif /* (defined(FSL_FEATURE_LPADC_HAS_STAT_CAL_RDY) && (FSL_FEATURE_LPADC_HAS_STAT_CAL_RDY == 1U)) */ - -#if (defined(FSL_FEATURE_LPADC_HAS_STAT_ADC_ACTIVE) && (FSL_FEATURE_LPADC_HAS_STAT_ADC_ACTIVE == 1U)) - kLPADC_ActiveFlag = ADC_STAT_ADC_ACTIVE_MASK, /*!< Indicates that the ADC is in active state. */ -#endif /* (defined(FSL_FEATURE_LPADC_HAS_STAT_ADC_ACTIVE) && (FSL_FEATURE_LPADC_HAS_STAT_ADC_ACTIVE == 1U)) */ - - kLPADC_ResultFIFOOverflowFlag = kLPADC_ResultFIFO0OverflowFlag, /*!< To compilitable with old version, do not - recommend using this, please use @ref - kLPADC_ResultFIFO0OverflowFlag as instead. */ - - kLPADC_ResultFIFOReadyFlag = kLPADC_ResultFIFO0ReadyFlag, /*!< To compilitable with old version, do not - recommend using this, please use @ref - kLPADC_ResultFIFO0ReadyFlag as instead. */ -}; - -/*! - * @brief Define interrupt switchers of the module. - * - * Note: LPADC of different chips supports different number of trigger sources, - * please check the Reference Manual for details. - */ -enum _lpadc_interrupt_enable -{ - kLPADC_ResultFIFO0OverflowInterruptEnable = ADC_IE_FOFIE0_MASK, /*!< Configures ADC to generate overflow interrupt - requests when FOF0 flag is asserted. */ - kLPADC_FIFO0WatermarkInterruptEnable = ADC_IE_FWMIE0_MASK, /*!< Configures ADC to generate watermark interrupt - requests when RDY0 flag is asserted. */ - kLPADC_ResultFIFOOverflowInterruptEnable = kLPADC_ResultFIFO0OverflowInterruptEnable, /*!< To compilitable with old - version, do not recommend using this, - please use - #kLPADC_ResultFIFO0OverflowInterruptEnable - as instead. */ - kLPADC_FIFOWatermarkInterruptEnable = kLPADC_FIFO0WatermarkInterruptEnable, /*!< To compilitable with old version, - do not recommend using this, please - use - #kLPADC_FIFO0WatermarkInterruptEnable - as instead. */ - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) - kLPADC_ResultFIFO1OverflowInterruptEnable = ADC_IE_FOFIE1_MASK, /*!< Configures ADC to generate overflow interrupt - requests when FOF1 flag is asserted. */ - kLPADC_FIFO1WatermarkInterruptEnable = ADC_IE_FWMIE1_MASK, /*!< Configures ADC to generate watermark interrupt - requests when RDY1 flag is asserted. */ -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2U)) */ - -#if (defined(FSL_FEATURE_LPADC_HAS_IE_TEXC_IE) && (FSL_FEATURE_LPADC_HAS_IE_TEXC_IE == 1U)) - kLPADC_TriggerExceptionInterruptEnable = ADC_IE_TEXC_IE_MASK, /*!< Configures ADC to generate trigger exception - interrupt. */ -#endif /* (defined(FSL_FEATURE_LPADC_HAS_IE_TEXC_IE) && (FSL_FEATURE_LPADC_HAS_IE_TEXC_IE == 1U)) */ - -#if (defined(FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE) && (FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE == 1U)) - kLPADC_Trigger0CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 0UL), /*!< Configures ADC to generate interrupt - when trigger 0 completion. */ - kLPADC_Trigger1CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 1UL), /*!< Configures ADC to generate interrupt - when trigger 1 completion. */ - kLPADC_Trigger2CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 2UL), /*!< Configures ADC to generate interrupt - when trigger 2 completion. */ - kLPADC_Trigger3CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 3UL), /*!< Configures ADC to generate interrupt - when trigger 3 completion. */ - kLPADC_Trigger4CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 4UL), /*!< Configures ADC to generate interrupt - when trigger 4 completion. */ - kLPADC_Trigger5CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 5UL), /*!< Configures ADC to generate interrupt - when trigger 5 completion. */ - kLPADC_Trigger6CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 6UL), /*!< Configures ADC to generate interrupt - when trigger 6 completion. */ - kLPADC_Trigger7CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 7UL), /*!< Configures ADC to generate interrupt - when trigger 7 completion. */ - kLPADC_Trigger8CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 8UL), /*!< Configures ADC to generate interrupt - when trigger 8 completion. */ - kLPADC_Trigger9CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 9UL), /*!< Configures ADC to generate interrupt - when trigger 9 completion. */ - kLPADC_Trigger10CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 10UL), /*!< Configures ADC to generate interrupt - when trigger 10 completion. */ - kLPADC_Trigger11CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 11UL), /*!< Configures ADC to generate interrupt - when trigger 11 completion. */ - kLPADC_Trigger12CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 12UL), /*!< Configures ADC to generate interrupt - when trigger 12 completion. */ - kLPADC_Trigger13CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 13UL), /*!< Configures ADC to generate interrupt - when trigger 13 completion. */ - kLPADC_Trigger14CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 14UL), /*!< Configures ADC to generate interrupt - when trigger 14 completion. */ - kLPADC_Trigger15CompletionInterruptEnable = ADC_IE_TCOMP_IE(1UL << 15UL), /*!< Configures ADC to generate interrupt - when trigger 15 completion. */ -#endif /* #if (defined(FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE) && (FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE == 1U)) */ -}; - -#if (defined(FSL_FEATURE_LPADC_HAS_TSTAT) && (FSL_FEATURE_LPADC_HAS_TSTAT)) -/*! - * @brief The enumerator of lpadc trigger status flags, including interrupted flags and completed flags. - * - * Note: LPADC of different chips supports different number of trigger sources, - * please check the Reference Manual for details. - */ -enum _lpadc_trigger_status_flags -{ - kLPADC_Trigger0InterruptedFlag = 1UL << 0UL, /*!< Trigger 0 is interrupted by a high priority exception. */ - kLPADC_Trigger1InterruptedFlag = 1UL << 1UL, /*!< Trigger 1 is interrupted by a high priority exception. */ - kLPADC_Trigger2InterruptedFlag = 1UL << 2UL, /*!< Trigger 2 is interrupted by a high priority exception. */ - kLPADC_Trigger3InterruptedFlag = 1UL << 3UL, /*!< Trigger 3 is interrupted by a high priority exception. */ - kLPADC_Trigger4InterruptedFlag = 1UL << 4UL, /*!< Trigger 4 is interrupted by a high priority exception. */ - kLPADC_Trigger5InterruptedFlag = 1UL << 5UL, /*!< Trigger 5 is interrupted by a high priority exception. */ - kLPADC_Trigger6InterruptedFlag = 1UL << 6UL, /*!< Trigger 6 is interrupted by a high priority exception. */ - kLPADC_Trigger7InterruptedFlag = 1UL << 7UL, /*!< Trigger 7 is interrupted by a high priority exception. */ - kLPADC_Trigger8InterruptedFlag = 1UL << 8UL, /*!< Trigger 8 is interrupted by a high priority exception. */ - kLPADC_Trigger9InterruptedFlag = 1UL << 9UL, /*!< Trigger 9 is interrupted by a high priority exception. */ - kLPADC_Trigger10InterruptedFlag = 1UL << 10UL, /*!< Trigger 10 is interrupted by a high priority exception. */ - kLPADC_Trigger11InterruptedFlag = 1UL << 11UL, /*!< Trigger 11 is interrupted by a high priority exception. */ - kLPADC_Trigger12InterruptedFlag = 1UL << 12UL, /*!< Trigger 12 is interrupted by a high priority exception. */ - kLPADC_Trigger13InterruptedFlag = 1UL << 13UL, /*!< Trigger 13 is interrupted by a high priority exception. */ - kLPADC_Trigger14InterruptedFlag = 1UL << 14UL, /*!< Trigger 14 is interrupted by a high priority exception. */ - kLPADC_Trigger15InterruptedFlag = 1UL << 15UL, /*!< Trigger 15 is interrupted by a high priority exception. */ - - kLPADC_Trigger0CompletedFlag = 1UL << 16UL, /*!< Trigger 0 is completed and - trigger 0 has enabled completion interrupts. */ - kLPADC_Trigger1CompletedFlag = 1UL << 17UL, /*!< Trigger 1 is completed and - trigger 1 has enabled completion interrupts. */ - kLPADC_Trigger2CompletedFlag = 1UL << 18UL, /*!< Trigger 2 is completed and - trigger 2 has enabled completion interrupts. */ - kLPADC_Trigger3CompletedFlag = 1UL << 19UL, /*!< Trigger 3 is completed and - trigger 3 has enabled completion interrupts. */ - kLPADC_Trigger4CompletedFlag = 1UL << 20UL, /*!< Trigger 4 is completed and - trigger 4 has enabled completion interrupts. */ - kLPADC_Trigger5CompletedFlag = 1UL << 21UL, /*!< Trigger 5 is completed and - trigger 5 has enabled completion interrupts. */ - kLPADC_Trigger6CompletedFlag = 1UL << 22UL, /*!< Trigger 6 is completed and - trigger 6 has enabled completion interrupts. */ - kLPADC_Trigger7CompletedFlag = 1UL << 23UL, /*!< Trigger 7 is completed and - trigger 7 has enabled completion interrupts. */ - kLPADC_Trigger8CompletedFlag = 1UL << 24UL, /*!< Trigger 8 is completed and - trigger 8 has enabled completion interrupts. */ - kLPADC_Trigger9CompletedFlag = 1UL << 25UL, /*!< Trigger 9 is completed and - trigger 9 has enabled completion interrupts. */ - kLPADC_Trigger10CompletedFlag = 1UL << 26UL, /*!< Trigger 10 is completed and - trigger 10 has enabled completion interrupts. */ - kLPADC_Trigger11CompletedFlag = 1UL << 27UL, /*!< Trigger 11 is completed and - trigger 11 has enabled completion interrupts. */ - kLPADC_Trigger12CompletedFlag = 1UL << 28UL, /*!< Trigger 12 is completed and - trigger 12 has enabled completion interrupts. */ - kLPADC_Trigger13CompletedFlag = 1UL << 29UL, /*!< Trigger 13 is completed and - trigger 13 has enabled completion interrupts. */ - kLPADC_Trigger14CompletedFlag = 1UL << 30UL, /*!< Trigger 14 is completed and - trigger 14 has enabled completion interrupts. */ - kLPADC_Trigger15CompletedFlag = 1UL << 31UL, /*!< Trigger 15 is completed and - trigger 15 has enabled completion interrupts. */ -}; -#endif /* (defined(FSL_FEATURE_LPADC_HAS_TSTAT) && (FSL_FEATURE_LPADC_HAS_TSTAT)) */ - -/*! - * @brief Define enumeration of sample scale mode. - * - * The sample scale mode is used to reduce the selected ADC analog channel input voltage level by a factor. The maximum - * possible voltage on the ADC channel input should be considered when selecting a scale mode to ensure that the - * reducing factor always results voltage level at or below the VREFH reference. This reducing capability allows - * conversion of analog inputs higher than VREFH. A-side and B-side channel inputs are both scaled using the scale mode. - */ -typedef enum _lpadc_sample_scale_mode -{ - kLPADC_SamplePartScale = 0U, /*!< Use divided input voltage signal. - (For scale select,please refer to the reference manual). */ - kLPADC_SampleFullScale = 1U, /*!< Full scale (Factor of 1). */ -} lpadc_sample_scale_mode_t; - -/*! - * @brief Define enumeration of channel sample mode. - * - * The channel sample mode configures the channel with single-end/differential/dual-single-end, side A/B. - */ -typedef enum _lpadc_sample_channel_mode -{ - kLPADC_SampleChannelSingleEndSideA = 0x0U, /*!< Single-end mode, only A-side channel is converted. */ -#if !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) - kLPADC_SampleChannelSingleEndSideB = 0x1U, /*!< Single-end mode, only B-side channel is converted. */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_DIFF) && FSL_FEATURE_LPADC_HAS_CMDL_DIFF - kLPADC_SampleChannelDiffBothSideAB = 0x2U, /*!< Differential mode, the ADC result is (CHnA-CHnB). */ - kLPADC_SampleChannelDiffBothSideBA = 0x3U, /*!< Differential mode, the ADC result is (CHnB-CHnA). */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CMDL_DIFF) && FSL_FEATURE_LPADC_HAS_CMDL_DIFF */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_CTYPE) && FSL_FEATURE_LPADC_HAS_CMDL_CTYPE - kLPADC_SampleChannelDiffBothSide = 0x02U, /*!< Differential mode, the ADC result is (CHnA-CHnB). */ - kLPADC_SampleChannelDualSingleEndBothSide = 0x03U, /*!< Dual-Single-Ended Mode. Both A side and B side - channels are converted independently. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CMDL_CTYPE) && FSL_FEATURE_LPADC_HAS_CMDL_CTYPE */ -#endif /* !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) */ -} lpadc_sample_channel_mode_t; - -/*! - * @brief Define enumeration of hardware average selection. - * - * It Selects how many ADC conversions are averaged to create the ADC result. An internal storage buffer is used to - * capture temporary results while the averaging iterations are executed. - * - * @note Some enumerator values are not available on some devices, mainly depends on the size of AVGS field in CMDH - * register. - */ -typedef enum _lpadc_hardware_average_mode -{ - kLPADC_HardwareAverageCount1 = 0U, /*!< Single conversion. */ - kLPADC_HardwareAverageCount2 = 1U, /*!< 2 conversions averaged. */ - kLPADC_HardwareAverageCount4 = 2U, /*!< 4 conversions averaged. */ - kLPADC_HardwareAverageCount8 = 3U, /*!< 8 conversions averaged. */ - kLPADC_HardwareAverageCount16 = 4U, /*!< 16 conversions averaged. */ - kLPADC_HardwareAverageCount32 = 5U, /*!< 32 conversions averaged. */ - kLPADC_HardwareAverageCount64 = 6U, /*!< 64 conversions averaged. */ - kLPADC_HardwareAverageCount128 = 7U, /*!< 128 conversions averaged. */ -#if (defined(FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH) && \ - (FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH == 4U)) - kLPADC_HardwareAverageCount256 = 8U, /*!< 256 conversions averaged. */ - kLPADC_HardwareAverageCount512 = 9U, /*!< 512 conversions averaged. */ - kLPADC_HardwareAverageCount1024 = 10U, /*!< 1024 conversions averaged. */ -#endif /* (defined(FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH) && \ - (FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH == 4U))*/ -} lpadc_hardware_average_mode_t; - -/*! - * @brief Define enumeration of sample time selection. - * - * The shortest sample time maximizes conversion speed for lower impedance inputs. Extending sample time allows higher - * impedance inputs to be accurately sampled. Longer sample times can also be used to lower overall power consumption - * when command looping and sequencing is configured and high conversion rates are not required. - */ -typedef enum _lpadc_sample_time_mode -{ - kLPADC_SampleTimeADCK3 = 0U, /*!< 3 ADCK cycles total sample time. */ - kLPADC_SampleTimeADCK5 = 1U, /*!< 5 ADCK cycles total sample time. */ - kLPADC_SampleTimeADCK7 = 2U, /*!< 7 ADCK cycles total sample time. */ - kLPADC_SampleTimeADCK11 = 3U, /*!< 11 ADCK cycles total sample time. */ - kLPADC_SampleTimeADCK19 = 4U, /*!< 19 ADCK cycles total sample time. */ - kLPADC_SampleTimeADCK35 = 5U, /*!< 35 ADCK cycles total sample time. */ - kLPADC_SampleTimeADCK67 = 6U, /*!< 69 ADCK cycles total sample time. */ - kLPADC_SampleTimeADCK131 = 7U, /*!< 131 ADCK cycles total sample time. */ -} lpadc_sample_time_mode_t; - -/*! - * @brief Define enumeration of hardware compare mode. - * - * After an ADC channel input is sampled and converted and any averaging iterations are performed, this mode setting - * guides operation of the automatic compare function to optionally only store when the compare operation is true. - * When compare is enabled, the conversion result is compared to the compare values. - */ -typedef enum _lpadc_hardware_compare_mode -{ - kLPADC_HardwareCompareDisabled = 0U, /*!< Compare disabled. */ - kLPADC_HardwareCompareStoreOnTrue = 2U, /*!< Compare enabled. Store on true. */ - kLPADC_HardwareCompareRepeatUntilTrue = 3U, /*!< Compare enabled. Repeat channel acquisition until true. */ -} lpadc_hardware_compare_mode_t; - -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_MODE) && FSL_FEATURE_LPADC_HAS_CMDL_MODE -/*! - * @brief Define enumeration of conversion resolution mode. - * - * Configure the resolution bit in specific conversion type. For detailed resolution accuracy, see to - * #lpadc_sample_channel_mode_t - */ -typedef enum _lpadc_conversion_resolution_mode -{ - kLPADC_ConversionResolutionStandard = 0U, /*!< Standard resolution. Single-ended 12-bit conversion, Differential - 13-bit conversion with 2's complement output. */ - kLPADC_ConversionResolutionHigh = 1U, /*!< High resolution. Single-ended 16-bit conversion; Differential 16-bit - conversion with 2's complement output. */ -} lpadc_conversion_resolution_mode_t; -#endif /* defined(FSL_FEATURE_LPADC_HAS_CMDL_MODE) && FSL_FEATURE_LPADC_HAS_CMDL_MODE */ - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS -/*! - * @brief Define enumeration of conversion averages mode. - * - * Configure the converion average number for auto-calibration. - * @note Some enumerator values are not available on some devices, mainly depends on the size of CAL_AVGS field in CTRL - * register. - */ -typedef enum _lpadc_conversion_average_mode -{ - kLPADC_ConversionAverage1 = 0U, /*!< Single conversion. */ - kLPADC_ConversionAverage2 = 1U, /*!< 2 conversions averaged. */ - kLPADC_ConversionAverage4 = 2U, /*!< 4 conversions averaged. */ - kLPADC_ConversionAverage8 = 3U, /*!< 8 conversions averaged. */ - kLPADC_ConversionAverage16 = 4U, /*!< 16 conversions averaged. */ - kLPADC_ConversionAverage32 = 5U, /*!< 32 conversions averaged. */ - kLPADC_ConversionAverage64 = 6U, /*!< 64 conversions averaged. */ - kLPADC_ConversionAverage128 = 7U, /*!< 128 conversions averaged. */ -#if (defined(FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH) && \ - (FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH == 4U)) - kLPADC_ConversionAverage256 = 8U, /*!< 256 conversions averaged. */ - kLPADC_ConversionAverage512 = 9U, /*!< 512 conversions averaged. */ - kLPADC_ConversionAverage1024 = 10U, /*!< 1024 conversions averaged. */ -#endif /* (defined(FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH) && \ - (FSL_FEATURE_LPADC_CONVERSIONS_AVERAGED_BITFIELD_WIDTH == 4U))*/ -} lpadc_conversion_average_mode_t; -#endif /* defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS */ - -/*! - * @brief Define enumeration of reference voltage source. - * - * For detail information, need to check the SoC's specification. - */ -typedef enum _lpadc_reference_voltage_mode -{ - kLPADC_ReferenceVoltageAlt1 = 0U, /*!< Option 1 setting. */ - kLPADC_ReferenceVoltageAlt2 = 1U, /*!< Option 2 setting. */ - kLPADC_ReferenceVoltageAlt3 = 2U, /*!< Option 3 setting. */ -} lpadc_reference_voltage_source_t; - -/*! - * @brief Define enumeration of power configuration. - * - * Configures the ADC for power and performance. In the highest power setting the highest conversion rates will be - * possible. Refer to the device data sheet for power and performance capabilities for each setting. - */ -typedef enum _lpadc_power_level_mode -{ - kLPADC_PowerLevelAlt1 = 0U, /*!< Lowest power setting. */ - kLPADC_PowerLevelAlt2 = 1U, /*!< Next lowest power setting. */ - kLPADC_PowerLevelAlt3 = 2U, /*!< ... */ - kLPADC_PowerLevelAlt4 = 3U, /*!< Highest power setting. */ -} lpadc_power_level_mode_t; - -#if (defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE) -/*! - * @brief Define enumeration of offset calibration mode. - * - */ -typedef enum _lpadc_offset_calibration_mode -{ - kLPADC_OffsetCalibration12bitMode = 0U, /*!< 12 bit offset calibration mode. */ - kLPADC_OffsetCalibration16bitMode = 1U, /*!< 16 bit offset calibration mode. */ -} lpadc_offset_calibration_mode_t; -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE */ - -/*! - * @brief Define enumeration of trigger priority policy. - * - * This selection controls how higher priority triggers are handled. - * @note \b kLPADC_TriggerPriorityPreemptSubsequently is not available on some devices, mainly depends on the size of - * TPRICTRL field in CFG register. - */ -typedef enum _lpadc_trigger_priority_policy -{ - kLPADC_ConvPreemptImmediatelyNotAutoResumed = 0x0U, /*!< If a higher priority trigger is detected during command - processing, the current conversion is aborted and the new - command specified by the trigger is started, when higher - priority conversion finishes, the preempted conversion is not - automatically resumed or restarted. */ - kLPADC_ConvPreemptSoftlyNotAutoResumed = 0x1U, /*!< If a higher priority trigger is received during command - processing, the current conversion is completed (including averaging - iterations and compare function if enabled) and stored to the result - FIFO before the higher priority trigger/command is initiated, when - higher priority conversion finishes, the preempted conversion is not - resumed or restarted. */ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES - kLPADC_ConvPreemptImmediatelyAutoRestarted = 0x4U, /*!< If a higher priority trigger is detected during command - processing, the current conversion is aborted and the new - command specified by the trigger is started, when higher - priority conversion finishes, the preempted conversion will - automatically be restarted. */ - kLPADC_ConvPreemptSoftlyAutoRestarted = 0x5U, /*!< If a higher priority trigger is received during command - processing, the current conversion is completed (including averaging - iterations and compare function if enabled) and stored to the result - FIFO before the higher priority trigger/command is initiated, when - higher priority conversion finishes, the preempted conversion will - automatically be restarted. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES */ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES - kLPADC_ConvPreemptImmediatelyAutoResumed = 0xCU, /*!< If a higher priority trigger is detected during command - processing, the current conversion is aborted and the new - command specified by the trigger is started, when higher - priority conversion finishes, the preempted conversion will - automatically be resumed. */ - kLPADC_ConvPreemptSoftlyAutoResumed = 0xDU, /*!< If a higher priority trigger is received during command - processing, the current conversion is completed (including averaging - iterations and compare function if enabled) and stored to the result - FIFO before the higher priority trigger/command is initiated, when - higher priority conversion finishes, the preempted conversion will - be automatically be resumed. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES */ - - kLPADC_TriggerPriorityPreemptImmediately = - kLPADC_ConvPreemptImmediatelyNotAutoResumed, /*!< Legacy support is not recommended as it only ensures - compatibility with older versions. */ - kLPADC_TriggerPriorityPreemptSoftly = - kLPADC_ConvPreemptSoftlyNotAutoResumed, /*!< Legacy support is not recommended as it only ensures compatibility - with older versions. */ - -#if (defined(FSL_FEATURE_LPADC_CFG_TPRICTRL_BITFIELD_WIDTH) && (FSL_FEATURE_LPADC_CFG_TPRICTRL_BITFIELD_WIDTH == 2U)) - kLPADC_ConvPreemptSubsequentlyNotAutoResumed = 0x2U, /*!< If a higher priority trigger is received during command - processing, the current command will be completed (averaging, - looping, compare) before servicing the higher priority trigger, when - higher priority conversion finishes, the preempted conversion will - not automatically be restarted or resumed. */ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES - kLPADC_ConvPreemptSubsequentlyAutoRestarted = 0x6U, /*!< If a higher priority trigger is received during command - processing, the current command will be completed (averaging, - looping, compare) before servicing the higher priority trigger, when - higher priority conversion finishes, the preempted conversion will - be automatically restarted. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TRES) && FSL_FEATURE_LPADC_HAS_CFG_TRES */ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES - kLPADC_ConvPreemptSubsequentlyAutoResumed = 0xEU, /*!< If a higher priority trigger is received during command - processing, the current command will be completed (averaging, - looping, compare) before servicing the higher priority trigger, when - higher priority conversion finishes, the preempted conversion will - be automatically resumed. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_TCMDRES) && FSL_FEATURE_LPADC_HAS_CFG_TCMDRES */ - - kLPADC_TriggerPriorityPreemptSubsequently = - kLPADC_ConvPreemptSubsequentlyNotAutoResumed, /*!< Legacy support is not recommended as it only ensures - compatibility with older versions. */ -#endif /* #if (defined(FSL_FEATURE_LPADC_CFG_TPRICTRL_BITFIELD_WIDTH) && \ - (FSL_FEATURE_LPADC_CFG_TPRICTRL_BITFIELD_WIDTH == 2U)) */ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI) && FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI - kLPADC_TriggerPriorityExceptionDisabled = 0x10U, /*!< High priority trigger exception disabled. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI) && FSL_FEATURE_LPADC_HAS_CFG_HPT_EXDI */ -} lpadc_trigger_priority_policy_t; - -#if ((defined(FSL_FEATURE_LPADC_HAS_CTRL_CALHS)) && FSL_FEATURE_LPADC_HAS_CTRL_CALHS) -/*! - * @brief Define enumeration of tune value. - */ -typedef enum _lpadc_tune_value -{ - kLPADC_TuneValue0 = 0U, /*!< Tune value 0. */ - kLPADC_TuneValue1 = 1U, /*!< Tune value 1. */ - kLPADC_TuneValue2 = 2U, /*!< Tune value 2. */ - kLPADC_TuneValue3 = 3U, /*!< Tune value 3. */ -} lpadc_tune_value_t; -#endif /* ((defined(FSL_FEATURE_LPADC_HAS_CTRL_CALHS)) && FSL_FEATURE_LPADC_HAS_CTRL_CALHS) */ - -/*! - * @brief LPADC global configuration. - * - * This structure would used to keep the settings for initialization. - */ -typedef struct -{ -#if defined(FSL_FEATURE_LPADC_HAS_CFG_ADCKEN) && FSL_FEATURE_LPADC_HAS_CFG_ADCKEN - bool enableInternalClock; /*!< Enables the internally generated clock source. The clock source is used in clock - selection logic at the chip level and is optionally used for the ADC clock source. */ -#endif /* FSL_FEATURE_LPADC_HAS_CFG_ADCKEN */ -#if defined(FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG) && FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG - bool enableVref1LowVoltage; /*!< If voltage reference option1 input is below 1.8V, it should be "true". - If voltage reference option1 input is above 1.8V, it should be "false". */ -#endif /* FSL_FEATURE_LPADC_HAS_CFG_VREF1RNG */ - bool enableInDozeMode; /*!< Control system transition to Stop and Wait power modes while ADC is converting. When - enabled in Doze mode, immediate entries to Wait or Stop are allowed. When disabled, the - ADC will wait for the current averaging iteration/FIFO storage to complete before - acknowledging stop or wait mode entry. */ -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS - lpadc_conversion_average_mode_t conversionAverageMode; /*!< Auto-Calibration Averages. */ -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CAL_AVGS */ - bool enableAnalogPreliminary; /*!< ADC analog circuits are pre-enabled and ready to execute conversions without - startup delays(at the cost of higher DC current consumption). */ - uint32_t powerUpDelay; /*!< When the analog circuits are not pre-enabled, the ADC analog circuits are only powered - while the ADC is active and there is a counted delay defined by this field after an - initial trigger transitions the ADC from its Idle state to allow time for the analog - circuits to stabilize. The startup delay count of (powerUpDelay * 4) ADCK cycles must - result in a longer delay than the analog startup time. */ - lpadc_reference_voltage_source_t referenceVoltageSource; /*!< Selects the voltage reference high used for - conversions.*/ - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_PWRSEL) && (FSL_FEATURE_LPADC_HAS_CFG_PWRSEL == 1U) - lpadc_power_level_mode_t powerLevelMode; /*!< Power Configuration Selection. */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_PWRSEL) && (FSL_FEATURE_LPADC_HAS_CFG_PWRSEL == 1U) */ - lpadc_trigger_priority_policy_t triggerPriorityPolicy; /*!< Control how higher priority triggers are handled, see to - lpadc_trigger_priority_policy_t. */ - bool enableConvPause; /*!< Enables the ADC pausing function. When enabled, a programmable delay is inserted during - command execution sequencing between LOOP iterations, between commands in a sequence, and - between conversions when command is executing in "Compare Until True" configuration. */ - uint32_t convPauseDelay; /*!< Controls the duration of pausing during command execution sequencing. The pause delay - is a count of (convPauseDelay*4) ADCK cycles. Only available when ADC pausing - function is enabled. The available value range is in 9-bit. */ -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - /* for FIFO0. */ - uint32_t FIFO0Watermark; /*!< FIFO0Watermark is a programmable threshold setting. When the number of datawords - stored in the ADC Result FIFO0 is greater than the value in this field, the ready flag - would be asserted to indicate stored data has reached the programmable threshold. */ - /* for FIFO1. */ - uint32_t FIFO1Watermark; /*!< FIFO1Watermark is a programmable threshold setting. When the number of datawords - stored in the ADC Result FIFO1 is greater than the value in this field, the ready flag - would be asserted to indicate stored data has reached the programmable threshold. */ -#else - /* for FIFO. */ - uint32_t FIFOWatermark; /*!< FIFOWatermark is a programmable threshold setting. When the number of datawords stored - in the ADC Result FIFO is greater than the value in this field, the ready flag would be - asserted to indicate stored data has reached the programmable threshold. */ -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ -#if (defined(FSL_FEATURE_LPADC_HAS_TSTAT) && (FSL_FEATURE_LPADC_HAS_TSTAT)) - -#endif /* FSL_FEATURE_LPADC_HAS_TSTAT */ -} lpadc_config_t; - -/*! - * @brief Define structure to keep the configuration for conversion command. - */ -typedef struct -{ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_CSCALE) && FSL_FEATURE_LPADC_HAS_CMDL_CSCALE - lpadc_sample_scale_mode_t sampleScaleMode; /*!< Sample scale mode. */ -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_CSCALE */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE) && FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE - lpadc_sample_scale_mode_t channelBScaleMode; /*!< Alternate channe B Scale mode. */ -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_ALTB_CSCALE */ - lpadc_sample_channel_mode_t sampleChannelMode; /*!< Channel sample mode. */ - uint32_t channelNumber; /*!< Channel number, select the channel or channel pair. */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTB_ADCH) && FSL_FEATURE_LPADC_HAS_CMDL_ALTB_ADCH - uint32_t channelBNumber; /*!< Alternate Channel B number, select the channel. */ -#endif - uint32_t chainedNextCommandNumber; /*!< Selects the next command to be executed after this command completes. - 1-15 is available, 0 is to terminate the chain after this command. */ - bool enableAutoChannelIncrement; /*!< Loop with increment: when disabled, the "loopCount" field selects the number - of times the selected channel is converted consecutively; when enabled, the - "loopCount" field defines how many consecutive channels are converted as part - of the command execution. */ - uint32_t loopCount; /*!< Selects how many times this command executes before finish and transition to the next - command or Idle state. Command executes LOOP+1 times. 0-15 is available. */ - lpadc_hardware_average_mode_t hardwareAverageMode; /*!< Hardware average selection. */ - lpadc_sample_time_mode_t sampleTimeMode; /*!< Sample time selection. */ - - lpadc_hardware_compare_mode_t hardwareCompareMode; /*!< Hardware compare selection. */ - uint32_t hardwareCompareValueHigh; /*!< Compare Value High. The available value range is in 16-bit. */ - uint32_t hardwareCompareValueLow; /*!< Compare Value Low. The available value range is in 16-bit. */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_MODE) && FSL_FEATURE_LPADC_HAS_CMDL_MODE - lpadc_conversion_resolution_mode_t conversionResolutionMode; /*!< Conversion resolution mode. */ -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_MODE */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG) && FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG - bool enableWaitTrigger; /*!< Wait for trigger assertion before execution: when disabled, this command will be - automatically executed; when enabled, the active trigger must be asserted again before - executing this command. */ -#endif /* FSL_FEATURE_LPADC_HAS_CMDH_WAIT_TRIG */ -#if defined(FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN) && FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN - bool enableChannelB; /*! Enable alternate Channel B */ -#endif /* FSL_FEATURE_LPADC_HAS_CMDL_ALTBEN */ -} lpadc_conv_command_config_t; - -/*! - * @brief Define structure to keep the configuration for conversion trigger. - */ -typedef struct -{ - uint32_t targetCommandId; /*!< Select the command from command buffer to execute upon detect of the associated - trigger event. */ - uint32_t delayPower; /*!< Select the trigger delay duration to wait at the start of servicing a trigger event. - When this field is clear, then no delay is incurred. When this field is set to a non-zero - value, the duration for the delay is 2^delayPower ADCK cycles. The available value range - is 4-bit. */ - uint32_t priority; /*!< Sets the priority of the associated trigger source. If two or more triggers have the same - priority level setting, the lower order trigger event has the higher priority. The lower - value for this field is for the higher priority, the available value range is 1-bit. */ -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) - uint8_t channelAFIFOSelect; /* SAR Result Destination For Channel A. */ - uint8_t channelBFIFOSelect; /* SAR Result Destination For Channel B. */ -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ - bool enableHardwareTrigger; /*!< Enable hardware trigger source to initiate conversion on the rising edge of the - input trigger source or not. THe software trigger is always available. */ -} lpadc_conv_trigger_config_t; - -/*! - * @brief Define the structure to keep the conversion result. - */ -typedef struct -{ - uint32_t commandIdSource; /*!< Indicate the command buffer being executed that generated this result. */ - uint32_t loopCountIndex; /*!< Indicate the loop count value during command execution that generated this result. */ - uint32_t triggerIdSource; /*!< Indicate the trigger source that initiated a conversion and generated this result. */ - uint16_t convValue; /*!< Data result. */ -} lpadc_conv_result_t; - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFS) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFS -/*! - * @brief A structure of calibration value. - */ -typedef struct _lpadc_calibration_value -{ - /* gain calibration result. */ - uint16_t gainCalibrationResultA; -#if !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) - uint16_t gainCalibrationResultB; -#endif /* !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) */ -#if (defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) - /* general calibration value. */ - uint16_t generalCalibrationValueA[33U]; -#if !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) - uint16_t generalCalibrationValueB[33U]; -#endif /* !(defined(FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS) && (FSL_FEATURE_LPADC_HAS_B_SIDE_CHANNELS == 0U)) */ -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ */ -} lpadc_calibration_value_t; -#endif /* FSL_FEATURE_LPADC_HAS_CTRL_CALOFS */ - -#if defined(__cplusplus) -extern "C" { -#endif - -/******************************************************************************* - * API - ******************************************************************************/ -/*! - * @name Initialization & de-initialization. - * @{ - */ - -/*! - * @brief Initializes the LPADC module. - * - * @param base LPADC peripheral base address. - * @param config Pointer to configuration structure. See "lpadc_config_t". - */ -void LPADC_Init(ADC_Type *base, const lpadc_config_t *config); - -/*! - * @brief Gets an available pre-defined settings for initial configuration. - * - * This function initializes the converter configuration structure with an available settings. The default values are: - * @code - * config->enableInDozeMode = true; - * config->enableAnalogPreliminary = false; - * config->powerUpDelay = 0x80; - * config->referenceVoltageSource = kLPADC_ReferenceVoltageAlt1; - * config->powerLevelMode = kLPADC_PowerLevelAlt1; - * config->triggerPriorityPolicy = kLPADC_TriggerPriorityPreemptImmediately; - * config->enableConvPause = false; - * config->convPauseDelay = 0U; - * config->FIFOWatermark = 0U; - * @endcode - * @param config Pointer to configuration structure. - */ -void LPADC_GetDefaultConfig(lpadc_config_t *config); - -/*! - * @brief De-initializes the LPADC module. - * - * @param base LPADC peripheral base address. - */ -void LPADC_Deinit(ADC_Type *base); - -/*! - * @brief Switch on/off the LPADC module. - * - * @param base LPADC peripheral base address. - * @param enable switcher to the module. - */ -static inline void LPADC_Enable(ADC_Type *base, bool enable) -{ - if (enable) - { - base->CTRL |= ADC_CTRL_ADCEN_MASK; - } - else - { - base->CTRL &= ~ADC_CTRL_ADCEN_MASK; - } -} - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) -/*! - * @brief Do reset the conversion FIFO0. - * - * @param base LPADC peripheral base address. - */ -static inline void LPADC_DoResetFIFO0(ADC_Type *base) -{ - base->CTRL |= ADC_CTRL_RSTFIFO0_MASK; -} - -/*! - * @brief Do reset the conversion FIFO1. - * - * @param base LPADC peripheral base address. - */ -static inline void LPADC_DoResetFIFO1(ADC_Type *base) -{ - base->CTRL |= ADC_CTRL_RSTFIFO1_MASK; -} -#else - -#if defined(ADC_CTRL_RSTFIFO0_MASK) -#define ADC_CTRL_RSTFIFO_MASK ADC_CTRL_RSTFIFO0_MASK -#endif /* defined(ADC_CTRL_RSTFIFO0_MASK) */ -/*! - * @brief Do reset the conversion FIFO. - * - * @param base LPADC peripheral base address. - */ -static inline void LPADC_DoResetFIFO(ADC_Type *base) -{ - base->CTRL |= ADC_CTRL_RSTFIFO_MASK; -} -#endif /* FSL_FEATURE_LPADC_FIFO_COUNT */ - -/*! - * @brief Do reset the module's configuration. - * - * Reset all ADC internal logic and registers, except the Control Register (ADCx_CTRL). - * - * @param base LPADC peripheral base address. - */ -static inline void LPADC_DoResetConfig(ADC_Type *base) -{ - base->CTRL |= ADC_CTRL_RST_MASK; - base->CTRL &= ~ADC_CTRL_RST_MASK; -} - -/*! @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Get status flags. - * - * @param base LPADC peripheral base address. - * @return status flags' mask. See to #_lpadc_status_flags. - */ -static inline uint32_t LPADC_GetStatusFlags(ADC_Type *base) -{ - return base->STAT; -} - -/*! - * @brief Clear status flags. - * - * Only the flags can be cleared by writing ADCx_STATUS register would be cleared by this API. - * - * @param base LPADC peripheral base address. - * @param mask Mask value for flags to be cleared. See to #_lpadc_status_flags. - */ -static inline void LPADC_ClearStatusFlags(ADC_Type *base, uint32_t mask) -{ - base->STAT = mask; -} - -#if (defined(FSL_FEATURE_LPADC_HAS_TSTAT) && FSL_FEATURE_LPADC_HAS_TSTAT) -/*! - * @brief Get trigger status flags to indicate which trigger sequences have been completed or interrupted by a high - * priority trigger exception. - * - * @param base LPADC peripheral base address. - * @return The OR'ed value of @ref _lpadc_trigger_status_flags. - */ -static inline uint32_t LPADC_GetTriggerStatusFlags(ADC_Type *base) -{ - return base->TSTAT; -} - -/*! - * @brief Clear trigger status flags. - * - * @param base LPADC peripheral base address. - * @param mask The mask of trigger status flags to be cleared, should be the - * OR'ed value of @ref _lpadc_trigger_status_flags. - */ -static inline void LPADC_ClearTriggerStatusFlags(ADC_Type *base, uint32_t mask) -{ - /* This assert used to avoid user use doesn't supported trigger sources. */ - assert(((mask & 0xFFFFU) == (mask & ADC_TSTAT_TEXC_NUM_MASK)) && - ((mask & 0xFFFF0000U) == (mask & ADC_TSTAT_TCOMP_FLAG_MASK))); - base->TSTAT = mask; -} -#endif /* (defined(FSL_FEATURE_LPADC_HAS_TSTAT) && FSL_FEATURE_LPADC_HAS_TSTAT) */ - -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enable interrupts. - * - * @param base LPADC peripheral base address. - * @param mask Mask value for interrupt events. See to #_lpadc_interrupt_enable. - */ -static inline void LPADC_EnableInterrupts(ADC_Type *base, uint32_t mask) -{ -#if (defined(FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE) && (FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE == 1U)) - /* This assert used to avoid user use doesn't supported trigger sources. */ - assert((mask <= 0xFFFFU) || ((mask & 0xFFFF0000U) == (mask & ADC_IE_TCOMP_IE_MASK))); -#endif /* #if (defined(FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE) && (FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE == 1U)) */ - base->IE |= mask; -} - -/*! - * @brief Disable interrupts. - * - * @param base LPADC peripheral base address. - * @param mask Mask value for interrupt events. See to #_lpadc_interrupt_enable. - */ -static inline void LPADC_DisableInterrupts(ADC_Type *base, uint32_t mask) -{ -#if (defined(FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE) && (FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE == 1U)) - /* This assert used to avoid user use doesn't supported trigger sources. */ - assert((mask <= 0xFFFFU) || ((mask & 0xFFFF0000U) == (mask & ADC_IE_TCOMP_IE_MASK))); -#endif /* #if (defined(FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE) && (FSL_FEATURE_LPADC_HAS_IE_TCOMP_IE == 1U)) */ - base->IE &= ~mask; -} - -/*! - * @name DMA Control - * @{ - */ - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) -/*! - * @brief Switch on/off the DMA trigger for FIFO0 watermark event. - * - * @param base LPADC peripheral base address. - * @param enable Switcher to the event. - */ -static inline void LPADC_EnableFIFO0WatermarkDMA(ADC_Type *base, bool enable) -{ - if (enable) - { - base->DE |= ADC_DE_FWMDE0_MASK; - } - else - { - base->DE &= ~ADC_DE_FWMDE0_MASK; - } -} - -/*! - * @brief Switch on/off the DMA trigger for FIFO1 watermark event. - * - * @param base LPADC peripheral base address. - * @param enable Switcher to the event. - */ -static inline void LPADC_EnableFIFO1WatermarkDMA(ADC_Type *base, bool enable) -{ - if (enable) - { - base->DE |= ADC_DE_FWMDE1_MASK; - } - else - { - base->DE &= ~ADC_DE_FWMDE1_MASK; - } -} -#else -#if defined(ADC_DE_FWMDE0_MASK) -#define ADC_DE_FWMDE_MASK ADC_DE_FWMDE0_MASK -#endif /* defined(ADC_DE_FWMDE0_MASK) */ -/*! - * @brief Switch on/off the DMA trigger for FIFO watermark event. - * - * @param base LPADC peripheral base address. - * @param enable Switcher to the event. - */ -static inline void LPADC_EnableFIFOWatermarkDMA(ADC_Type *base, bool enable) -{ - if (enable) - { - base->DE |= ADC_DE_FWMDE_MASK; - } - else - { - base->DE &= ~ADC_DE_FWMDE_MASK; - } -} -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) */ -/*! @} */ - -/*! - * @name Trigger and conversion with FIFO. - * @{ - */ - -#if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) -/*! - * @brief Get the count of result kept in conversion FIFOn. - * - * @param base LPADC peripheral base address. - * @param index Result FIFO index. - * @return The count of result kept in conversion FIFOn. - */ -static inline uint32_t LPADC_GetConvResultCount(ADC_Type *base, uint8_t index) -{ - return (ADC_FCTRL_FCOUNT_MASK & base->FCTRL[index]) >> ADC_FCTRL_FCOUNT_SHIFT; -} - -/*! - * @brief Get the result in conversion FIFOn. - * - * @param base LPADC peripheral base address. - * @param result Pointer to structure variable that keeps the conversion result in conversion FIFOn. - * @param index Result FIFO index. - * - * @return Status whether FIFOn entry is valid. - */ -bool LPADC_GetConvResult(ADC_Type *base, lpadc_conv_result_t *result, uint8_t index); - -/*! - * @brief Get the result in conversion FIFOn using blocking method. - * - * @param base LPADC peripheral base address. - * @param result Pointer to structure variable that keeps the conversion result in conversion FIFOn. - * @param index Result FIFO index. - */ -void LPADC_GetConvResultBlocking(ADC_Type *base, lpadc_conv_result_t *result, uint8_t index); -#else /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 1)) */ -/*! - * @brief Get the count of result kept in conversion FIFO. - * - * @param base LPADC peripheral base address. - * @return The count of result kept in conversion FIFO. - */ -static inline uint32_t LPADC_GetConvResultCount(ADC_Type *base) -{ - return (ADC_FCTRL_FCOUNT_MASK & base->FCTRL) >> ADC_FCTRL_FCOUNT_SHIFT; -} - -/*! - * @brief Get the result in conversion FIFO. - * - * @param base LPADC peripheral base address. - * @param result Pointer to structure variable that keeps the conversion result in conversion FIFO. - * - * @return Status whether FIFO entry is valid. - */ -bool LPADC_GetConvResult(ADC_Type *base, lpadc_conv_result_t *result); - -/*! - * @brief Get the result in conversion FIFO using blocking method. - * - * @param base LPADC peripheral base address. - * @param result Pointer to structure variable that keeps the conversion result in conversion FIFO. - */ -void LPADC_GetConvResultBlocking(ADC_Type *base, lpadc_conv_result_t *result); -#endif /* (defined(FSL_FEATURE_LPADC_FIFO_COUNT) && (FSL_FEATURE_LPADC_FIFO_COUNT == 2)) */ - -/*! - * @brief Configure the conversion trigger source. - * - * Each programmable trigger can launch the conversion command in command buffer. - * - * @param base LPADC peripheral base address. - * @param triggerId ID for each trigger. Typically, the available value range is from 0. - * @param config Pointer to configuration structure. See to #lpadc_conv_trigger_config_t. - */ -void LPADC_SetConvTriggerConfig(ADC_Type *base, uint32_t triggerId, const lpadc_conv_trigger_config_t *config); - -/*! - * @brief Gets an available pre-defined settings for trigger's configuration. - * - * This function initializes the trigger's configuration structure with an available settings. The default values are: - * @code - * config->targetCommandId = 0U; - * config->delayPower = 0U; - * config->priority = 0U; - * config->channelAFIFOSelect = 0U; - * config->channelBFIFOSelect = 0U; - * config->enableHardwareTrigger = false; - * @endcode - * @param config Pointer to configuration structure. - */ -void LPADC_GetDefaultConvTriggerConfig(lpadc_conv_trigger_config_t *config); - -/*! - * @brief Do software trigger to conversion command. - * - * @param base LPADC peripheral base address. - * @param triggerIdMask Mask value for software trigger indexes, which count from zero. - */ -static inline void LPADC_DoSoftwareTrigger(ADC_Type *base, uint32_t triggerIdMask) -{ - /* Writes to ADCx_SWTRIG register are ignored while ADCx_CTRL[ADCEN] is clear. */ - base->SWTRIG = triggerIdMask; -} - -#if defined(FSL_FEATURE_LPADC_HAS_TCTRL_CMD_SEL) && FSL_FEATURE_LPADC_HAS_TCTRL_CMD_SEL -/*! - * @brief Enable hardware trigger command selection. - * - * This function will use the hardware trigger command from ADC_ETC.The trigger command is then defined - * by ADC hardware trigger command selection field in ADC_ETC- >TRIGx_CHAINy_z_n[CSEL]. - * - * @param base LPADC peripheral base address. - * @param triggerId ID for each trigger. Typically, the available value range is from 0. - * @param enable True to enable or flase to disable. - */ -static inline void LPADC_EnableHardwareTriggerCommandSelection(ADC_Type *base, uint32_t triggerId, bool enable) -{ - if (enable) - { - base->TCTRL[triggerId] |= ADC_TCTRL_CMD_SEL_MASK; - } - else - { - base->TCTRL[triggerId] &= ~ADC_TCTRL_CMD_SEL_MASK; - } -} -#endif /* defined(FSL_FEATURE_LPADC_HAS_TCTRL_CMD_SEL) && FSL_FEATURE_LPADC_HAS_TCTRL_CMD_SEL*/ - -/*! - * @brief Configure conversion command. - - * @note The number of compare value register on different chips is different, that is mean in some chips, some - * command buffers do not have the compare functionality. - * - * @param base LPADC peripheral base address. - * @param commandId ID for command in command buffer. Typically, the available value range is 1 - 15. - * @param config Pointer to configuration structure. See to #lpadc_conv_command_config_t. - */ -void LPADC_SetConvCommandConfig(ADC_Type *base, uint32_t commandId, const lpadc_conv_command_config_t *config); - -/*! - * @brief Gets an available pre-defined settings for conversion command's configuration. - * - * This function initializes the conversion command's configuration structure with an available settings. The default - * values are: - * @code - * config->sampleScaleMode = kLPADC_SampleFullScale; - * config->channelBScaleMode = kLPADC_SampleFullScale; - * config->sampleChannelMode = kLPADC_SampleChannelSingleEndSideA; - * config->channelNumber = 0U; - * config->channelBNumber = 0U; - * config->chainedNextCommandNumber = 0U; - * config->enableAutoChannelIncrement = false; - * config->loopCount = 0U; - * config->hardwareAverageMode = kLPADC_HardwareAverageCount1; - * config->sampleTimeMode = kLPADC_SampleTimeADCK3; - * config->hardwareCompareMode = kLPADC_HardwareCompareDisabled; - * config->hardwareCompareValueHigh = 0U; - * config->hardwareCompareValueLow = 0U; - * config->conversionResolutionMode = kLPADC_ConversionResolutionStandard; - * config->enableWaitTrigger = false; - * config->enableChannelB = false; - * @endcode - * @param config Pointer to configuration structure. - */ -void LPADC_GetDefaultConvCommandConfig(lpadc_conv_command_config_t *config); - -#if defined(FSL_FEATURE_LPADC_HAS_CFG_CALOFS) && FSL_FEATURE_LPADC_HAS_CFG_CALOFS -/*! - * @brief Enable the calibration function. - * - * When CALOFS is set, the ADC is configured to perform a calibration function anytime the ADC executes - * a conversion. Any channel selected is ignored and the value returned in the RESFIFO is a signed value - * between -31 and 31. -32 is not a valid and is never a returned value. Software should copy the lower 6- - * bits of the conversion result stored in the RESFIFO after a completed calibration conversion to the - * OFSTRIM field. The OFSTRIM field is used in normal operation for offset correction. - * - * @param base LPADC peripheral base address. - * @param enable switcher to the calibration function. - */ -void LPADC_EnableCalibration(ADC_Type *base, bool enable); -#if defined(FSL_FEATURE_LPADC_HAS_OFSTRIM) && FSL_FEATURE_LPADC_HAS_OFSTRIM -/*! - * @brief Set proper offset value to trim ADC. - * - * To minimize the offset during normal operation, software should read the conversion result from - * the RESFIFO calibration operation and write the lower 6 bits to the OFSTRIM register. - * - * @param base LPADC peripheral base address. - * @param value Setting offset value. - */ -static inline void LPADC_SetOffsetValue(ADC_Type *base, uint32_t value) -{ - base->OFSTRIM = (value & ADC_OFSTRIM_OFSTRIM_MASK) >> ADC_OFSTRIM_OFSTRIM_SHIFT; -} - -/*! - * @brief Do auto calibration. - * - * Calibration function should be executed before using converter in application. It used the software trigger and a - * dummy conversion, get the offset and write them into the OFSTRIM register. It called some of functional API - * including: -LPADC_EnableCalibration(...) -LPADC_LPADC_SetOffsetValue(...) -LPADC_SetConvCommandConfig(...) - * -LPADC_SetConvTriggerConfig(...) - * - * @param base LPADC peripheral base address. - */ -void LPADC_DoAutoCalibration(ADC_Type *base); -#endif /* defined(FSL_FEATURE_LPADC_HAS_OFSTRIM) && FSL_FEATURE_LPADC_HAS_OFSTRIM */ -#endif /* defined(FSL_FEATURE_LPADC_HAS_CFG_CALOFS) && FSL_FEATURE_LPADC_HAS_CFG_CALOFS */ - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFS) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFS -#if defined(FSL_FEATURE_LPADC_HAS_OFSTRIM) && FSL_FEATURE_LPADC_HAS_OFSTRIM -#if defined(FSL_FEATURE_LPADC_OFSTRIM_COUNT) && (FSL_FEATURE_LPADC_OFSTRIM_COUNT == 1U) -/*! - * @brief Set trim value for offset. - * - * @note For 16-bit conversions, each increment is 1/2 LSB resulting in a programmable offset range of -256 LSB to 255.5 - * LSB; For 12-bit conversions, each increment is 1/32 LSB resulting in a programmable offset range of -16 LSB to - * 15.96875 LSB. - * - * @param base LPADC peripheral base address. - * @param value Offset trim value, is a 10-bit signed value between -512 and 511. - */ -static inline void LPADC_SetOffsetValue(ADC_Type *base, int16_t value) -{ - base->OFSTRIM = ADC_OFSTRIM_OFSTRIM(value); -} - -/*! - * @brief Get trim value of offset. - * - * @param base LPADC peripheral base address. - * @param pValue Pointer to the variable in type of int16_t to store offset value. - */ -static inline void LPADC_GetOffsetValue(ADC_Type *base, int16_t *pValue) -{ - assert(pValue != NULL); - - uint16_t ofstrim = (uint16_t)((base->OFSTRIM & (ADC_OFSTRIM_OFSTRIM_MASK)) >> ADC_OFSTRIM_OFSTRIM_SHIFT); - - if ((ofstrim & ADC_OFSTRIM_OFSTRIM_SIGN) != 0U) - { - /* If the sign bit is set, then set the other MSB. */ - ofstrim |= (uint16_t)(~ADC_OFSTRIM_OFSTRIM_MAX); - } - - *pValue = (int16_t)ofstrim; -} -#elif (defined(FSL_FEATURE_LPADC_OFSTRIM_COUNT) && (FSL_FEATURE_LPADC_OFSTRIM_COUNT == 2U)) -/*! - * @brief Set proper offset value to trim ADC. - * - * Set the offset trim value for offset calibration manually. - * - * @param base LPADC peripheral base address. - * @param valueA Setting offset value A. - * @param valueB Setting offset value B. - * @note In normal adc sequence, the values are automatically calculated by LPADC_EnableOffsetCalibration. - */ -static inline void LPADC_SetOffsetValue(ADC_Type *base, int32_t valueA, int32_t valueB) -{ - base->OFSTRIM = ADC_OFSTRIM_OFSTRIM_A(valueA) | ADC_OFSTRIM_OFSTRIM_B(valueB); -} - -/*! - * @brief Get trim value of offset. - * - * @param base LPADC peripheral base address. - * @param pValueA Pointer to the variable in type of int32_t to store offset A value. - * @param pValueB Pointer to the variable in type of int32_t to store offset B value. - */ -static inline void LPADC_GetOffsetValue(ADC_Type *base, int32_t *pValueA, int32_t *pValueB) -{ - assert(pValueA != NULL); - assert(pValueB != NULL); - - uint32_t ofstrimA = (base->OFSTRIM & (ADC_OFSTRIM_OFSTRIM_A_MASK)) >> ADC_OFSTRIM_OFSTRIM_A_SHIFT; - uint32_t ofstrimB = (base->OFSTRIM & (ADC_OFSTRIM_OFSTRIM_B_MASK)) >> ADC_OFSTRIM_OFSTRIM_B_SHIFT; - - if ((ofstrimA & ADC_OFSTRIM_OFSTRIM_A_SIGN) != 0U) - { - /* If the sign bit is set, then set the other MSB. */ - ofstrimA |= (~ADC_OFSTRIM_OFSTRIM_A_MAX); - } - if ((ofstrimB & ADC_OFSTRIM_OFSTRIM_B_SIGN) != 0U) - { - /* If the sign bit is set, then set the other MSB. */ - ofstrimB |= (~ADC_OFSTRIM_OFSTRIM_B_MAX); - } - - *pValueA = (int32_t)ofstrimA; - *pValueB = (int32_t)ofstrimB; -} -#endif /* defined(FSL_FEATURE_LPADC_OFSTRIM_COUNT) */ -#else /* !(defined(FSL_FEATURE_LPADC_HAS_OFSTRIM) && FSL_FEATURE_LPADC_HAS_OFSTRIM) */ -/*! - * @brief Set proper offset value to trim 12 bit ADC conversion. - * - * Set the offset trim value for offset calibration manually. - * - * @param base LPADC peripheral base address. - * @param valueA Setting offset value A. - * @param valueB Setting offset value B. - * @note In normal adc sequence, the values are automatically calculated by LPADC_EnableOffsetCalibration. - */ -static inline void LPADC_SetOffset12BitValue(ADC_Type *base, uint32_t valueA, uint32_t valueB) -{ - base->OFSTRIM12 = ADC_OFSTRIM12_OFSTRIM_A(valueA) | ADC_OFSTRIM12_OFSTRIM_A(valueB); -} - -/*! - * @brief Set proper offset value to trim 16 bit ADC conversion. - * - * Set the offset trim value for offset calibration manually. - * - * @param base LPADC peripheral base address. - * @param valueA Setting offset value A. - * @param valueB Setting offset value B. - * @note In normal adc sequence, the values are automatically calculated by LPADC_EnableOffsetCalibration. - */ -static inline void LPADC_SetOffset16BitValue(ADC_Type *base, uint32_t valueA, uint32_t valueB) -{ - base->OFSTRIM16 = ADC_OFSTRIM16_OFSTRIM_A(valueA) | ADC_OFSTRIM16_OFSTRIM_B(valueB); -} -#endif /* FSL_FEATURE_LPADC_HAS_OFSTRIM */ - -/*! - * @brief Enable the offset calibration function. - * - * @param base LPADC peripheral base address. - * @param enable switcher to the calibration function. - */ -static inline void LPADC_EnableOffsetCalibration(ADC_Type *base, bool enable) -{ - if (enable) - { - base->CTRL |= ADC_CTRL_CALOFS_MASK; - } - else - { - base->CTRL &= ~ADC_CTRL_CALOFS_MASK; - } -} -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE -/*! - * @brief Set offset calibration mode. - * - * @param base LPADC peripheral base address. - * @param mode set offset calibration mode.see to #lpadc_offset_calibration_mode_t . - */ -static inline void LPADC_SetOffsetCalibrationMode(ADC_Type *base, lpadc_offset_calibration_mode_t mode) -{ - base->CTRL = (base->CTRL & ~ADC_CTRL_CALOFSMODE_MASK) | ADC_CTRL_CALOFSMODE(mode); -} - -#endif /* defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFSMODE */ - -/*! - * @brief Do offset calibration. - * - * @param base LPADC peripheral base address. - */ -void LPADC_DoOffsetCalibration(ADC_Type *base); - -#if defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ -/*! - * @brief Do auto calibration. - * - * @param base LPADC peripheral base address. - */ -void LPADC_DoAutoCalibration(ADC_Type *base); - -/*! - * @brief Prepare auto calibration, LPADC_FinishAutoCalibration has to be called before using the LPADC. - * LPADC_DoAutoCalibration has been split in two API to avoid to be stuck too long in the function. - * - * @param base LPADC peripheral base address. - */ -void LPADC_PrepareAutoCalibration(ADC_Type *base); - -/*! - * @brief Finish auto calibration start with LPADC_PrepareAutoCalibration. - * - * @param base LPADC peripheral base address. - */ -void LPADC_FinishAutoCalibration(ADC_Type *base); - -#endif /* defined(FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ) && FSL_FEATURE_LPADC_HAS_CTRL_CAL_REQ */ - -/*! - * @brief Get calibration value into the memory which is defined by invoker. - * - * @note Please note the ADC will be disabled temporary. - * @note This function should be used after finish calibration. - * - * @param base LPADC peripheral base address. - * @param ptrCalibrationValue Pointer to @ref lpadc_calibration_value_t structure, this memory block should be always - * powered on even in low power modes. - */ -void LPADC_GetCalibrationValue(ADC_Type *base, lpadc_calibration_value_t *ptrCalibrationValue); - -/*! - * @brief Set calibration value into ADC calibration registers. - * - * @note Please note the ADC will be disabled temporary. - * - * @param base LPADC peripheral base address. - * @param ptrCalibrationValue Pointer to @ref lpadc_calibration_value_t structure which contains ADC's calibration - * value. - */ -void LPADC_SetCalibrationValue(ADC_Type *base, const lpadc_calibration_value_t *ptrCalibrationValue); - -#endif /* defined(FSL_FEATURE_LPADC_HAS_CTRL_CALOFS) && FSL_FEATURE_LPADC_HAS_CTRL_CALOFS */ - -#if ((defined(FSL_FEATURE_LPADC_HAS_CTRL_CALHS)) && FSL_FEATURE_LPADC_HAS_CTRL_CALHS) -/*! - * @brief Request high speed mode trim calculation. - * - * @param base LPADC peripheral base address. - */ -static inline void LPADC_RequestHighSpeedModeTrim(ADC_Type *base) -{ - base->CTRL |= ADC_CTRL_CALHS_MASK; -} - -/*! - * @brief Get high speed mode trim value, the result is a 5-bit signed value between -16 and 15. - * - * @note The high speed mode trim value is used to minimize offset for high speed conversion. - * - * @param base LPADC peripheral base address. - * @return The calculated high speed mode trim value. - */ -static inline int8_t LPADC_GetHighSpeedTrimValue(ADC_Type *base) -{ - return (int8_t)(base->HSTRIM); -} - -/*! - * @brief Set high speed mode trim value. - * - * @note If is possible to set the trim value manually, but it is recommended to use the LPADC_RequestHighSpeedModeTrim. - * - * @param base LPADC peripheral base address. - * @param trimValue The trim value to be set. - */ -static inline void LPADC_SetHighSpeedTrimValue(ADC_Type *base, int8_t trimValue) -{ - base->HSTRIM = ADC_HSTRIM_HSTRIM(trimValue); -} - -/*! - * @brief Enable/disable high speed conversion mode, if enabled conversions complete 2 or 3 ADCK cycles sooner compared - * to conversion cycle counts when high speed mode is disabled. - * - * @param base LPADC peripheral base address. - * @param enable Used to enable/disable high speed conversion mode: - * - \b true Enable high speed conversion mode; - * - \b false Disable high speed conversion mode. - */ -static inline void LPADC_EnableHighSpeedConversionMode(ADC_Type *base, bool enable) -{ - if (enable) - { - base->CFG2 |= ADC_CFG2_HS_MASK; - } - else - { - base->CFG2 &= ~ADC_CFG2_HS_MASK; - } -} - -/*! - * @brief Enable/disable an additional ADCK cycle to conversion. - * - * @param base LPADC peripheral base address. - * @param enable Used to enable/disable an additional ADCK cycle to conversion: - * - \b true Enable an additional ADCK cycle to conversion; - * - \b false Disable an additional ADCK cycle to conversion. - */ -static inline void LPADC_EnableExtraCycle(ADC_Type *base, bool enable) -{ - if (enable) - { - base->CFG2 |= ADC_CFG2_HSEXTRA_MASK; - } - else - { - base->CFG2 &= ~ADC_CFG2_HSEXTRA_MASK; - } -} - -/*! - * @brief Set tune value which provides some variability in how many cycles are needed to complete a conversion. - * - * @param base LPADC peripheral base address. - * @param tuneValue The tune value to be set, please refer to @ref lpadc_tune_value_t. - */ -static inline void LPADC_SetTuneValue(ADC_Type *base, lpadc_tune_value_t tuneValue) -{ - base->CFG2 = (base->CFG2 & ~ADC_CFG2_TUNE_MASK) | ADC_CFG2_TUNE(tuneValue); -} - -/*! - * @brief Get tune value which provides some variability in how many cycles are needed to complete a conversion. - * - * @param base LPADC peripheral base address. - * @return The tune value, please refer to @ref lpadc_tune_value_t. - */ -static inline lpadc_tune_value_t LPADC_GetTuneValue(ADC_Type *base) -{ - return (lpadc_tune_value_t)((base->CFG2 & ADC_CFG2_TUNE_MASK) >> ADC_CFG2_TUNE_SHIFT); -} -#endif /* ((defined(FSL_FEATURE_LPADC_HAS_CTRL_CALHS)) && FSL_FEATURE_LPADC_HAS_CTRL_CALHS) */ - -#if (defined(FSL_FEATURE_LPADC_HAS_CFG2_JLEFT) && FSL_FEATURE_LPADC_HAS_CFG2_JLEFT) -/*! - * @brief Enable/disable left-justify format in 12-bit single-end mode. - * - * @param base LPADC peripheral base address. - * @param enable Used to enable/disable left-justify format in 12-bit single-end mode: - * - \b true Enable left-justify format in 12-bit single-end mode; - * - \b false Disable left-justify format in 12-bit single-end mode. - */ -static inline void LPADC_EnableJustifiedLeft(ADC_Type *base, bool enable) -{ - if (enable) - { - base->CFG2 |= ADC_CFG2_JLEFT_MASK; - } - else - { - base->CFG2 &= ~ADC_CFG2_JLEFT_MASK; - } -} -#endif /* (defined(FSL_FEATURE_LPADC_HAS_CFG2_JLEFT) && FSL_FEATURE_LPADC_HAS_CFG2_JLEFT) */ - -/*! @} */ - -#if defined(__cplusplus) -} -#endif -/*! - * @} - */ -#endif /* FSL_LPADC_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpcmp.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpcmp.c deleted file mode 100644 index 4ed2d921db9..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpcmp.c +++ /dev/null @@ -1,372 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2019, 2023 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpcmp.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpcmp" -#endif - -#if defined(LPCMP_RSTS) -#define LPCMP_RESETS_ARRAY LPCMP_RSTS -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#if defined(LPCMP_CLOCKS) -/*! - * @brief Get instance number for LPCMP module. - * - * @param base LPCMP peripheral base address - */ -static uint32_t LPCMP_GetInstance(LPCMP_Type *base); -#endif /* LPCMP_CLOCKS */ - -/******************************************************************************* - * Variables - ******************************************************************************/ -#if defined(LPCMP_CLOCKS) -/*! @brief Pointers to LPCMP bases for each instance. */ -static LPCMP_Type *const s_lpcmpBases[] = LPCMP_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to LPCMP clocks for each instance. */ -static const clock_ip_name_t s_lpcmpClocks[] = LPCMP_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* LPCMP_CLOCKS */ - -#if defined(LPCMP_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_lpcmpResets[] = LPCMP_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Codes - ******************************************************************************/ -#if defined(LPCMP_CLOCKS) -static uint32_t LPCMP_GetInstance(LPCMP_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - /* - * $Branch Coverage Justification$ - * (instance >= ARRAY_SIZE(s_lpcmpBases)) not covered. The peripheral base - * address is always valid and checked by assert. - */ - for (instance = 0; instance < ARRAY_SIZE(s_lpcmpBases); instance++) - { - /* - * $Branch Coverage Justification$ - * (s_lpcmpBases[instance] != base) not covered. The peripheral base - * address is always valid and checked by assert. - */ - if (s_lpcmpBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_lpcmpBases)); - - return instance; -} -#endif /* LPCMP_CLOCKS */ - -/*! - * brief Initialize the LPCMP - * - * This function initializes the LPCMP module. The operations included are: - * - Enabling the clock for LPCMP module. - * - Configuring the comparator. - * - Enabling the LPCMP module. - * Note: For some devices, multiple LPCMP instance share the same clock gate. In this case, to enable the clock for - * any instance enables all the LPCMPs. Check the chip reference manual for the clock assignment of the LPCMP. - * - * param base LPCMP peripheral base address. - * param config Pointer to "lpcmp_config_t" structure. - */ -void LPCMP_Init(LPCMP_Type *base, const lpcmp_config_t *config) -{ - assert(config != NULL); - - uint32_t tmp32; - -#if defined(LPCMP_CLOCKS) -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock. */ - CLOCK_EnableClock(s_lpcmpClocks[LPCMP_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* LPCMP_CLOCKS */ - -#if defined(LPCMP_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_lpcmpResets[LPCMP_GetInstance(base)]); -#endif - - /* Configure. */ - LPCMP_Enable(base, false); - -#if !(defined(FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) && FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) - /* CCR0 register. */ -#if defined(FSL_FEATURE_LPCMP_INSTANCE_SUPPORT_CCR0_CMP_STOP_ENn) - if (1U == FSL_FEATURE_LPCMP_INSTANCE_SUPPORT_CCR0_CMP_STOP_ENn(base)) -#endif /* FSL_FEATURE_LPCMP_INSTANCE_SUPPORT_CCR0_CMP_STOP_ENn */ - { - if (config->enableStopMode) - { - base->CCR0 |= LPCMP_CCR0_CMP_STOP_EN_MASK; - } - else - { - base->CCR0 &= ~LPCMP_CCR0_CMP_STOP_EN_MASK; - } - } -#endif /* !(defined(FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) && FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) */ - - /* CCR1 register. */ - tmp32 = (base->CCR1 & (~(LPCMP_CCR1_COUT_PEN_MASK | LPCMP_CCR1_COUT_SEL_MASK | LPCMP_CCR1_COUT_INV_MASK -#if defined(FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL) && FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL - | LPCMP_CCR1_FUNC_CLK_SEL_MASK -#endif /* FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL */ - ))); - - if (config->enableOutputPin) - { - tmp32 |= LPCMP_CCR1_COUT_PEN_MASK; - } - if (config->useUnfilteredOutput) - { - tmp32 |= LPCMP_CCR1_COUT_SEL_MASK; - } - if (config->enableInvertOutput) - { - tmp32 |= LPCMP_CCR1_COUT_INV_MASK; - } -#if defined(FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL) && FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL - tmp32 |= LPCMP_CCR1_FUNC_CLK_SEL(config->functionalSourceClock); -#endif /* FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL */ - base->CCR1 = tmp32; - /* CCR2 register. */ - tmp32 = base->CCR2 & ~(LPCMP_CCR2_HYSTCTR_MASK | LPCMP_CCR2_CMP_NPMD_MASK | LPCMP_CCR2_CMP_HPMD_MASK); - tmp32 |= LPCMP_CCR2_HYSTCTR(config->hysteresisMode); - tmp32 |= ((uint32_t)(config->powerMode) << LPCMP_CCR2_CMP_HPMD_SHIFT); - base->CCR2 = tmp32; - - LPCMP_Enable(base, true); /* Enable the LPCMP module. */ -} - -/*! - * brief De-initializes the LPCMP module. - * - * This function de-initializes the LPCMP module. The operations included are: - * - Disabling the LPCMP module. - * - Disabling the clock for LPCMP module. - * - * This function disables the clock for the LPCMP. - * Note: For some devices, multiple LPCMP instance shares the same clock gate. In this case, before disabling the - * clock for the LPCMP, ensure that all the LPCMP instances are not used. - * - * param base LPCMP peripheral base address. - */ -void LPCMP_Deinit(LPCMP_Type *base) -{ - /* Disable the LPCMP module. */ - LPCMP_Enable(base, false); -#if defined(LPCMP_CLOCKS) -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable the clock. */ - CLOCK_DisableClock(s_lpcmpClocks[LPCMP_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* LPCMP_CLOCKS */ -} - -/*! - * brief Gets an available pre-defined settings for the comparator's configuration. - * - * This function initializes the comparator configuration structure to these default values: - * code - * config->enableStopMode = false; - * config->enableOutputPin = false; - * config->useUnfilteredOutput = false; - * config->enableInvertOutput = false; - * config->hysteresisMode = kLPCMP_HysteresisLevel0; - * config->powerMode = kLPCMP_LowSpeedPowerMode; - * config->functionalSourceClock = kLPCMP_FunctionalClockSource0; - * endcode - * param config Pointer to "lpcmp_config_t" structure. - */ -void LPCMP_GetDefaultConfig(lpcmp_config_t *config) -{ - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); -#if !(defined(FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) && FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) - config->enableStopMode = false; -#endif /* !(defined(FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) && FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) */ - config->enableOutputPin = false; - config->useUnfilteredOutput = false; - config->enableInvertOutput = false; - config->hysteresisMode = kLPCMP_HysteresisLevel0; - config->powerMode = kLPCMP_LowSpeedPowerMode; -#if defined(FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL) && FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL - config->functionalSourceClock = kLPCMP_FunctionalClockSource0; -#endif /* FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL */ -} - -/*! - * brief Select the input channels for LPCMP. This function determines which input - * is selected for the negative and positive mux. - * - * param base LPCMP peripheral base address. - * param positiveChannel Positive side input channel number. - * param negativeChannel Negative side input channel number. - */ -void LPCMP_SetInputChannels(LPCMP_Type *base, uint32_t positiveChannel, uint32_t negativeChannel) -{ - uint32_t tmp32; - - tmp32 = base->CCR2 & ~(LPCMP_CCR2_PSEL_MASK | LPCMP_CCR2_MSEL_MASK); - tmp32 |= LPCMP_CCR2_PSEL(positiveChannel) | LPCMP_CCR2_MSEL(negativeChannel); - base->CCR2 = tmp32; -} - -/*! - * brief Configures the filter. - * - * param base LPCMP peripheral base address. - * param config Pointer to "lpcmp_filter_config_t" structure. - */ -void LPCMP_SetFilterConfig(LPCMP_Type *base, const lpcmp_filter_config_t *config) -{ - assert(config != NULL); - - uint32_t tmp32; - - tmp32 = base->CCR1 & ~(LPCMP_CCR1_FILT_PER_MASK | LPCMP_CCR1_FILT_CNT_MASK | LPCMP_CCR1_SAMPLE_EN_MASK); - if (config->enableSample) - { - tmp32 |= LPCMP_CCR1_SAMPLE_EN_MASK; - } - tmp32 |= LPCMP_CCR1_FILT_PER(config->filterSamplePeriod) | LPCMP_CCR1_FILT_CNT(config->filterSampleCount); - base->CCR1 = tmp32; -} - -/*! - * brief Configure the internal DAC module. - * - * param base LPCMP peripheral base address. - * param config Pointer to "lpcmp_dac_config_t" structure. If config is "NULL", disable internal DAC. - */ -void LPCMP_SetDACConfig(LPCMP_Type *base, const lpcmp_dac_config_t *config) -{ - uint32_t tmp32; - if (config == NULL) - { - tmp32 = 0U; /* Disable internal DAC. */ - } - else - { - tmp32 = LPCMP_DCR_VRSEL(config->referenceVoltageSource) | LPCMP_DCR_DAC_DATA(config->DACValue); - if (config->enableLowPowerMode) - { - tmp32 |= LPCMP_DCR_DAC_HPMD_MASK; - } - tmp32 |= LPCMP_DCR_DAC_EN_MASK; - } - base->DCR = tmp32; -} - -#if defined(FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL) && FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL -/*! - * @brief Configure the window control, users can use this API to implement operations on the window, - * such as inverting the window signal, setting the window closing event(only valid in windowing mode), - * and setting the COUTA signal after the window is closed(only valid in windowing mode). - * - * @param base LPCMP peripheral base address. - * @param config Pointer "lpcmp_window_control_config_t" structure. - */ -void LPCMP_SetWindowControl(LPCMP_Type *base, const lpcmp_window_control_config_t *config) -{ - assert(config != NULL); - - uint32_t tmp32 = 0UL; - - tmp32 = (base->CCR1 & (~(LPCMP_CCR1_COUTA_CFG_MASK | LPCMP_CCR1_EVT_SEL_CFG_MASK | LPCMP_CCR1_WINDOW_INV_MASK))); - - if (config->enableInvertWindowSignal) - { - tmp32 |= LPCMP_CCR1_WINDOW_INV_MASK; - } - - /* Set COUT event, which can close the active window in window mode. */ - tmp32 |= LPCMP_CCR1_EVT_SEL_CFG(config->closeWindowEvent); - - /* Set the COUTA signal value when the window is closed. */ - tmp32 |= LPCMP_CCR1_COUTA_CFG(config->COUTASignal); - - base->CCR1 = tmp32; -} -#endif /* FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL */ - -#if defined(FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE) && FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE -/*! - * @brief Configure the roundrobin mode. - * - * @param base LPCMP peripheral base address. - * @param config Pointer "lpcmp_roundrobin_config_t" structure. - */ -void LPCMP_SetRoundRobinConfig(LPCMP_Type *base, const lpcmp_roundrobin_config_t *config) -{ - assert(config != NULL); - - uint32_t tmp32 = 0UL; - - /* LPCMPx_RRCR0 register, Configuration options for the round-robin operation. */ - tmp32 = (base->RRCR0 & - (~(LPCMP_RRCR0_RR_TRG_SEL_MASK | LPCMP_RRCR0_RR_NSAM_MASK | LPCMP_RRCR0_RR_CLK_SEL_MASK | - LPCMP_RRCR0_RR_INITMOD_MASK | LPCMP_RRCR0_RR_SAMPLE_CNT_MASK | LPCMP_RRCR0_RR_SAMPLE_THRESHOLD_MASK))); - - tmp32 |= - (LPCMP_RRCR0_RR_TRG_SEL(config->roundrobinTriggerSource) | LPCMP_RRCR0_RR_NSAM(config->sampleClockNumbers) | - LPCMP_RRCR0_RR_CLK_SEL(config->roundrobinClockSource) | LPCMP_RRCR0_RR_INITMOD(config->initDelayModules) | - LPCMP_RRCR0_RR_SAMPLE_CNT(config->channelSampleNumbers) | - LPCMP_RRCR0_RR_SAMPLE_THRESHOLD(config->sampleTimeThreshhold)); - - base->RRCR0 = tmp32; - - /* LPCMPx_RRCR1 register, Configure the fix port, fix channel and checker channel. */ - tmp32 = - (base->RRCR1 & (~(LPCMP_RRCR1_FIXP_MASK | LPCMP_RRCR1_FIXCH_MASK | (0xFFUL << LPCMP_RRCR1_RR_CH0EN_SHIFT)))); - tmp32 |= (LPCMP_RRCR1_FIXP(config->fixedMuxPort) | LPCMP_RRCR1_FIXCH(config->fixedChannel) | - ((uint32_t)(config->checkerChannelMask) << LPCMP_RRCR1_RR_CH0EN_SHIFT)); - - base->RRCR1 = tmp32; -} - -/*! - * brief Configure the roundrobin internal timer reload value. - * - * param base LPCMP peripheral base address. - * param value RoundRobin internal timer reload value, allowed range:0x0UL-0xFFFFFFFUL. - */ -void LPCMP_SetRoundRobinInternalTimer(LPCMP_Type *base, uint32_t value) -{ - uint32_t tmp32 = 0UL; - - tmp32 = (base->RRCR2 & (~LPCMP_RRCR2_RR_TIMER_RELOAD_MASK)); - tmp32 |= LPCMP_RRCR2_RR_TIMER_RELOAD(value); - - base->RRCR2 = tmp32; -} - -#endif /* FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpcmp.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpcmp.h deleted file mode 100644 index 5105c98fcc1..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpcmp.h +++ /dev/null @@ -1,585 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2020, 2023-2024 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_LPCMP_H_ -#define FSL_LPCMP_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup lpcmp - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/*! @name Driver version */ -/*! @{ */ -/*! @brief LPCMP driver version 2.1.3. */ -#define FSL_LPCMP_DRIVER_VERSION (MAKE_VERSION(2, 1, 3)) -/*! @} */ - -#define LPCMP_CCR1_COUTA_CFG_MASK (LPCMP_CCR1_COUTA_OWEN_MASK | LPCMP_CCR1_COUTA_OW_MASK) -#define LPCMP_CCR1_COUTA_CFG_SHIFT LPCMP_CCR1_COUTA_OWEN_SHIFT -#define LPCMP_CCR1_COUTA_CFG(x) \ - (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_COUTA_CFG_SHIFT)) & LPCMP_CCR1_COUTA_CFG_MASK) - -#define LPCMP_CCR1_EVT_SEL_CFG_MASK (LPCMP_CCR1_EVT_SEL_MASK | LPCMP_CCR1_WINDOW_CLS_MASK) -#define LPCMP_CCR1_EVT_SEL_CFG_SHIFT LPCMP_CCR1_WINDOW_CLS_SHIFT -#define LPCMP_CCR1_EVT_SEL_CFG(x) \ - (((uint32_t)(((uint32_t)(x)) << LPCMP_CCR1_EVT_SEL_CFG_SHIFT)) & LPCMP_CCR1_EVT_SEL_CFG_MASK) - -/*! - * @brief LPCMP status falgs mask. - */ -enum _lpcmp_status_flags -{ - kLPCMP_OutputRisingEventFlag = LPCMP_CSR_CFR_MASK, /*!< Rising-edge on the comparison output has occurred. */ - kLPCMP_OutputFallingEventFlag = LPCMP_CSR_CFF_MASK, /*!< Falling-edge on the comparison output has occurred. */ -#if defined(FSL_FEATURE_LPCMP_HAS_CSR_RRF) && FSL_FEATURE_LPCMP_HAS_CSR_RRF - kLPCMP_OutputRoundRobinEventFlag = LPCMP_CSR_RRF_MASK, /*!< Detects when any channel's last comparison result is - different from the pre-set value in trigger mode. */ -#endif /* FSL_FEATURE_LPCMP_HAS_CSR_RRF */ - kLPCMP_OutputAssertEventFlag = LPCMP_CSR_COUT_MASK, /*!< Return the current value of the analog comparator output. - The flag does not support W1C. */ -}; - -/*! - * @brief LPCMP interrupt enable/disable mask. - */ -enum _lpcmp_interrupt_enable -{ - kLPCMP_OutputRisingInterruptEnable = LPCMP_IER_CFR_IE_MASK, /*!< Comparator interrupt enable rising. */ - kLPCMP_OutputFallingInterruptEnable = LPCMP_IER_CFF_IE_MASK, /*!< Comparator interrupt enable falling. */ -#if defined(FSL_FEATURE_LPCMP_HAS_IER_RRF_IE) && FSL_FEATURE_LPCMP_HAS_IER_RRF_IE - kLPCMP_RoundRobinInterruptEnable = LPCMP_IER_RRF_IE_MASK, /*!< Comparator round robin mode interrupt - occurred when the comparison result changes for a given channel. */ -#endif /* FSL_FEATURE_LPCMP_HAS_IER_RRF_IE */ -}; - -/*! - * @brief LPCMP hysteresis mode. See chip data sheet to get the actual hystersis - * value with each level - */ -typedef enum _lpcmp_hysteresis_mode -{ - kLPCMP_HysteresisLevel0 = 0U, /*!< The hard block output has level 0 hysteresis internally. */ - kLPCMP_HysteresisLevel1 = 1U, /*!< The hard block output has level 1 hysteresis internally. */ - kLPCMP_HysteresisLevel2 = 2U, /*!< The hard block output has level 2 hysteresis internally. */ - kLPCMP_HysteresisLevel3 = 3U, /*!< The hard block output has level 3 hysteresis internally. */ -} lpcmp_hysteresis_mode_t; - -/*! - * @brief LPCMP nano mode. - */ -typedef enum _lpcmp_power_mode -{ - kLPCMP_LowSpeedPowerMode = 0U, /*!< Low speed comparison mode is selected. */ - kLPCMP_HighSpeedPowerMode = 1U, /*!< High speed comparison mode is selected. */ - kLPCMP_NanoPowerMode = 2U, /*!< Nano power comparator is enabled. */ -} lpcmp_power_mode_t; - -/*! - * @brief Internal DAC reference voltage source. - */ -typedef enum _lpcmp_dac_reference_voltage_source -{ - kLPCMP_VrefSourceVin1 = 0U, /*!< vrefh_int is selected as resistor ladder network supply reference Vin. */ - kLPCMP_VrefSourceVin2 = 1U, /*!< vrefh_ext is selected as resistor ladder network supply reference Vin. */ -} lpcmp_dac_reference_voltage_source_t; - -#if defined(FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL) && FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL -/*! - * @brief LPCMP functional mode clock source selection. - * - * Note: In different devices, the functional mode clock source selection is different, - * please refer to specific device Reference Manual for details. - */ -typedef enum _lpcmp_functional_source_clock -{ - kLPCMP_FunctionalClockSource0 = 0U, /*!< Select functional mode clock source0. */ - kLPCMP_FunctionalClockSource1 = 1U, /*!< Select functional mode clock source1. */ - kLPCMP_FunctionalClockSource2 = 2U, /*!< Select functional mode clock source2. */ - kLPCMP_FunctionalClockSource3 = 3U, /*!< Select functional mode clock source3. */ -} lpcmp_functional_source_clock_t; -#endif /* FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL */ - -#if defined(FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL) && FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL -/*! - * @brief Set the COUTA signal value when the window is closed. - */ -typedef enum _lpcmp_couta_signal -{ - kLPCMP_COUTASignalNoSet = 0U, /*!< NO set the COUTA signal value when the window is closed. */ - kLPCMP_COUTASignalLow = 1U, /*!< Set COUTA signal low(0) when the window is closed. */ - kLPCMP_COUTASignalHigh = 3U, /*!< Set COUTA signal high(1) when the window is closed. */ -} lpcmp_couta_signal_t; - -/*! - * @brief Set COUT event, which can close the active window in window mode. - */ -typedef enum _lpcmp_close_window_event -{ - kLPCMP_CLoseWindowEventNoSet = 0U, /*!< No Set COUT event, which can close the active window in window mode. */ - kLPCMP_CloseWindowEventRisingEdge = 1U, /*!< Set rising edge COUT signal as COUT event. */ - kLPCMP_CloseWindowEventFallingEdge = 3U, /*!< Set falling edge COUT signal as COUT event. */ - kLPCMP_CLoseWindowEventBothEdge = 5U, /*!< Set both rising and falling edge COUT signal as COUT event. */ -} lpcmp_close_window_event_t; -#endif /* FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL */ - -#if defined(FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE) && FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE -/*! - * @brief LPCMP round robin mode fixed mux port. - */ -typedef enum _lpcmp_roundrobin_fixedmuxport -{ - kLPCMP_FixedPlusMuxPort = 0U, /*!< Fixed plus mux port. */ - kLPCMP_FixedMinusMuxPort = 1U, /*!< Fixed minus mux port. */ -} lpcmp_roundrobin_fixedmuxport_t; - -/*! - * @brief LPCMP round robin mode clock source selection. - * - * Note: In different devices,the round robin mode clock source selection is different, - * please refer to the specific device Reference Manual for details. - */ -typedef enum _lpcmp_roundrobin_clock_source -{ - kLPCMP_RoundRobinClockSource0 = 0U, /*!< Select roundrobin mode clock source0. */ - kLPCMP_RoundRobinClockSource1 = 1U, /*!< Select roundrobin mode clock source1. */ - kLPCMP_RoundRobinClockSource2 = 2U, /*!< Select roundrobin mode clock source2. */ - kLPCMP_RoundRobinClockSource3 = 3U, /*!< Select roundrobin mode clock source3. */ -} lpcmp_roundrobin_clock_source_t; - -/*! - * @brief LPCMP round robin mode trigger source. - */ -typedef enum _lpcmp_roundrobin_trigger_source -{ - kLPCMP_TriggerSourceExternally = 0U, /*!< Select external trigger source. */ - kLPCMP_TriggerSourceInternally = 1U, /*!< Select internal trigger source. */ -} lpcmp_roundrobin_trigger_source_t; -#endif /* FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE */ - -/*! - * @brief Configure the filter. - */ -typedef struct _lpcmp_filter_config -{ - bool enableSample; /*!< Decide whether to use the external SAMPLE as a sampling clock input. */ - uint8_t filterSampleCount; /*!< Filter Sample Count. Available range is 1-7; 0 disables the filter. */ - uint8_t filterSamplePeriod; /*!< Filter Sample Period. The divider to the bus clock. Available range is 0-255. The - sampling clock must be at least 4 times slower than the system clock to the comparator. - So if enableSample is "false", filterSamplePeriod should be set greater than 4.*/ -} lpcmp_filter_config_t; - -/*! - * @brief configure the internal DAC. - */ -typedef struct _lpcmp_dac_config -{ - bool enableLowPowerMode; /*!< Decide whether to enable DAC low power mode. */ - lpcmp_dac_reference_voltage_source_t referenceVoltageSource; /*!< Internal DAC supply voltage reference source. */ - uint8_t DACValue; /*!< Value for the DAC Output Voltage. Different devices has different available range, - for specific values, please refer to the reference manual.*/ -} lpcmp_dac_config_t; - -/*! - * @brief Configures the comparator. - */ -typedef struct _lpcmp_config -{ -#if !(defined(FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) && FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) - bool enableStopMode; /*!< Decide whether to enable the comparator when in STOP modes. */ -#endif /* !(defined(FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) && FSL_FEATURE_LPCMP_HAS_NO_CCR0_CMP_STOP_EN) */ - - bool enableOutputPin; /*!< Decide whether to enable the comparator is available in selected pin. */ - bool useUnfilteredOutput; /*!< Decide whether to use unfiltered output. */ - bool enableInvertOutput; /*!< Decide whether to inverts the comparator output. */ - lpcmp_hysteresis_mode_t hysteresisMode; /*!< LPCMP hysteresis mode. */ - lpcmp_power_mode_t powerMode; /*!< LPCMP power mode. */ -#if defined(FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL) && FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL - lpcmp_functional_source_clock_t functionalSourceClock; /*!< Select LPCMP functional mode clock source. */ -#endif /* FSL_FEATURE_LPCMP_HAS_CCR1_FUNC_CLK_SEL */ -} lpcmp_config_t; - -#if defined(FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL) && FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL -/*! - * @brief Configure the window mode control. - */ -typedef struct _lpcmp_window_control_config -{ - bool enableInvertWindowSignal; /*!< True: enable invert window signal, False: disable invert window signal. */ - lpcmp_couta_signal_t COUTASignal; /*!< Decide whether to define the COUTA signal value when the window is closed. */ - lpcmp_close_window_event_t closeWindowEvent; /*!< Decide whether to select COUT event signal edge defines - a COUT event to close window. */ -} lpcmp_window_control_config_t; -#endif /* FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL */ - -#if defined(FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE) && FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE -/*! - * @brief Configure the round robin mode. - */ -typedef struct _lpcmp_roundrobin_config -{ - uint8_t initDelayModules; /*!< Comparator and DAC initialization delay modulus, See Reference Manual and DataSheet - for specific value. */ - uint8_t sampleClockNumbers; /*!< Specify the number of the round robin clock cycles(0~3) to wait after scanning the - active channel before sampling the channel's comparison result. */ - uint8_t channelSampleNumbers; /*!< Specify the number of samples for one channel, note that channelSampleNumbers - must not smaller than sampleTimeThreshhold. */ - uint8_t sampleTimeThreshhold; /*!< Specify that for one channel, when (sampleTimeThreshhold + 1) sample results are - "1",the final result is "1", otherwise the final result is "0", note that the - sampleTimeThreshhold must not be larger than channelSampleNumbers. */ - lpcmp_roundrobin_clock_source_t roundrobinClockSource; /*!< Decide which clock source to - choose in round robin mode. */ - lpcmp_roundrobin_trigger_source_t roundrobinTriggerSource; /*!< Decide which trigger source to - choose in round robin mode. */ - lpcmp_roundrobin_fixedmuxport_t fixedMuxPort; /*!< Decide which mux port to choose as - fixed channel in round robin mode. */ - uint8_t fixedChannel; /*!< Indicate which channel of the fixed mux port is used in round robin mode. */ - uint8_t checkerChannelMask; /*!< Indicate which channel of the non-fixed mux port to check its voltage value in - round robin mode, for example, if checkerChannelMask set to 0x11U means select - channel 0 and channel 4 as checker channel.*/ -} lpcmp_roundrobin_config_t; -#endif /* FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and configuration - * @{ - */ - -/*! - * @brief Initialize the LPCMP - * - * This function initializes the LPCMP module. The operations included are: - * - Enabling the clock for LPCMP module. - * - Configuring the comparator. - * - Enabling the LPCMP module. - * Note: For some devices, multiple LPCMP instance share the same clock gate. In this case, to enable the clock for - * any instance enables all the LPCMPs. Check the chip reference manual for the clock assignment of the LPCMP. - * - * @param base LPCMP peripheral base address. - * @param config Pointer to "lpcmp_config_t" structure. - */ -void LPCMP_Init(LPCMP_Type *base, const lpcmp_config_t *config); - -/*! - * @brief De-initializes the LPCMP module. - * - * This function de-initializes the LPCMP module. The operations included are: - * - Disabling the LPCMP module. - * - Disabling the clock for LPCMP module. - * - * This function disables the clock for the LPCMP. - * Note: For some devices, multiple LPCMP instance shares the same clock gate. In this case, before disabling the - * clock for the LPCMP, ensure that all the LPCMP instances are not used. - * - * @param base LPCMP peripheral base address. - */ -void LPCMP_Deinit(LPCMP_Type *base); - -/*! - * @brief Gets an available pre-defined settings for the comparator's configuration. - * - * This function initializes the comparator configuration structure to these default values: - * @code - * config->enableStopMode = false; - * config->enableOutputPin = false; - * config->useUnfilteredOutput = false; - * config->enableInvertOutput = false; - * config->hysteresisMode = kLPCMP_HysteresisLevel0; - * config->powerMode = kLPCMP_LowSpeedPowerMode; - * config->functionalSourceClock = kLPCMP_FunctionalClockSource0; - * @endcode - * @param config Pointer to "lpcmp_config_t" structure. - */ -void LPCMP_GetDefaultConfig(lpcmp_config_t *config); - -/*! - * @brief Enable/Disable LPCMP module. - * - * @param base LPCMP peripheral base address. - * @param enable "true" means enable the module, and "false" means disable the module. - */ -static inline void LPCMP_Enable(LPCMP_Type *base, bool enable) -{ - if (enable) - { - base->CCR0 |= LPCMP_CCR0_CMP_EN_MASK; - } - else - { - base->CCR0 &= ~LPCMP_CCR0_CMP_EN_MASK; - } -} - -/*! - * @brief Select the input channels for LPCMP. This function determines which input - * is selected for the negative and positive mux. - * - * @param base LPCMP peripheral base address. - * @param positiveChannel Positive side input channel number. Available range is 0-7. - * @param negativeChannel Negative side input channel number. Available range is 0-7. - */ -void LPCMP_SetInputChannels(LPCMP_Type *base, uint32_t positiveChannel, uint32_t negativeChannel); - -/*! - * @brief Enables/disables the DMA request for rising/falling events. - * Normally, the LPCMP generates a CPU interrupt if there is a rising/falling event. When - * DMA support is enabled and the rising/falling interrupt is enabled , the rising/falling - * event forces a DMA transfer request rather than a CPU interrupt instead. - * - * @param base LPCMP peripheral base address. - * @param enable "true" means enable DMA support, and "false" means disable DMA support. - */ -static inline void LPCMP_EnableDMA(LPCMP_Type *base, bool enable) -{ - if (enable) - { - base->CCR1 |= LPCMP_CCR1_DMA_EN_MASK; - } - else - { - base->CCR1 &= ~LPCMP_CCR1_DMA_EN_MASK; - } -} - -/*! - * @brief Configures the filter. - * - * @param base LPCMP peripheral base address. - * @param config Pointer to "lpcmp_filter_config_t" structure. - */ -void LPCMP_SetFilterConfig(LPCMP_Type *base, const lpcmp_filter_config_t *config); - -/*! - * @brief Configure the internal DAC module. - * - * @param base LPCMP peripheral base address. - * @param config Pointer to "lpcmp_dac_config_t" structure. If config is "NULL", disable internal DAC. - */ -void LPCMP_SetDACConfig(LPCMP_Type *base, const lpcmp_dac_config_t *config); - -/*! - * @brief Enable the interrupts. - * - * @param base LPCMP peripheral base address. - * @param mask Mask value for interrupts. See "_lpcmp_interrupt_enable". - */ -static inline void LPCMP_EnableInterrupts(LPCMP_Type *base, uint32_t mask) -{ - base->IER |= mask; -} - -/*! - * @brief Disable the interrupts. - * - * @param base LPCMP peripheral base address. - * @param mask Mask value for interrupts. See "_lpcmp_interrupt_enable". - */ -static inline void LPCMP_DisableInterrupts(LPCMP_Type *base, uint32_t mask) -{ - base->IER &= ~mask; -} - -/*! - * @brief Get the LPCMP status flags. - * - * @param base LPCMP peripheral base address. - * - * @return Mask value for the asserted flags. See "_lpcmp_status_flags". - */ -static inline uint32_t LPCMP_GetStatusFlags(LPCMP_Type *base) -{ - return base->CSR; -} - -/*! - * @brief Clear the LPCMP status flags - * - * @param base LPCMP peripheral base address. - * @param mask Mask value for the flags. See "_lpcmp_status_flags". - */ -static inline void LPCMP_ClearStatusFlags(LPCMP_Type *base, uint32_t mask) -{ - base->CSR = mask; -} - -/*! @} */ - -/*! - * @name Window mode - * @{ - */ - -/*! - * @brief Enable/Disable window mode.When any windowed mode is active, COUTA is clocked by - * the bus clock whenever WINDOW = 1. The last latched value is held when WINDOW = 0. - * The optionally inverted comparator output COUT_RAW is sampled on every bus clock - * when WINDOW=1 to generate COUTA. - * - * @param base LPCMP peripheral base address. - * @param enable "true" means enable window mode, and "false" means disable window mode. - */ -static inline void LPCMP_EnableWindowMode(LPCMP_Type *base, bool enable) -{ - if (enable) - { - base->CCR1 |= LPCMP_CCR1_WINDOW_EN_MASK; - } - else - { - base->CCR1 &= ~LPCMP_CCR1_WINDOW_EN_MASK; - } -} - -#if defined(FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL) && FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL -/*! - * @brief Configure the window control, users can use this API to implement operations on the window, - * such as inverting the window signal, setting the window closing event(only valid in windowing mode), - * and setting the COUTA signal after the window is closed(only valid in windowing mode). - * - * @param base LPCMP peripheral base address. - * @param config Pointer "lpcmp_window_control_config_t" structure. - */ -void LPCMP_SetWindowControl(LPCMP_Type *base, const lpcmp_window_control_config_t *config); -#endif /* FSL_FEATURE_LPCMP_HAS_WINDOW_CONTROL */ - -/*! @} */ - -#if defined(FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE) && FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE -/*! - * @name RoundRobin mode - * @{ - */ - -/*! - * @brief Configure the roundrobin mode. - * - * @param base LPCMP peripheral base address. - * @param config Pointer "lpcmp_roundrobin_config_t" structure. - */ -void LPCMP_SetRoundRobinConfig(LPCMP_Type *base, const lpcmp_roundrobin_config_t *config); - -/*! - * brief Configure the roundrobin internal timer reload value. - * - * param base LPCMP peripheral base address. - * param value RoundRobin internal timer reload value, allowed range:0x0UL-0xFFFFFFFUL. - */ -void LPCMP_SetRoundRobinInternalTimer(LPCMP_Type *base, uint32_t value); - -/*! - * @brief Enable/Disable roundrobin mode. - * - * @param base LPCMP peripheral base address. - * @param enable "true" means enable roundrobin mode, and "false" means disable roundrobin mode. - */ -static inline void LPCMP_EnableRoundRobinMode(LPCMP_Type *base, bool enable) -{ - if (enable) - { - base->RRCR0 |= LPCMP_RRCR0_RR_EN_MASK; - } - else - { - base->RRCR0 &= ~LPCMP_RRCR0_RR_EN_MASK; - } -} - -/*! - * @brief Enable/Disable roundrobin internal timer, note that this function is only valid - * when using the internal trigger source. - * - * @param base LPCMP peripheral base address. - * @param enable "true" means enable roundrobin internal timer, and "false" means disable roundrobin internal timer. - */ -static inline void LPCMP_EnableRoundRobinInternalTimer(LPCMP_Type *base, bool enable) -{ - if (enable) - { - base->RRCR2 |= LPCMP_RRCR2_RR_TIMER_EN_MASK; - } - else - { - base->RRCR2 &= ~LPCMP_RRCR2_RR_TIMER_EN_MASK; - } -} - -/*! - * @brief Set preset value for all channels, users can set all channels' preset vaule through this API, - * for example, if the mask set to 0x03U means channel0 and channel2's preset value set to 1U and other - * channels' preset value set to 0U. - * - * @param base LPCMP peripheral base address. - * @param mask Mask of channel index. - */ -static inline void LPCMP_SetPreSetValue(LPCMP_Type *base, uint8_t mask) -{ - base->RRCSR = (uint32_t)mask; -} - -/*! - * @brief Get comparison results for all channels, users can get all channels' comparison - * results through this API. - * - * @param base LPCMP peripheral base address. - * @return return All channels' comparison result. - */ -static inline uint8_t LPCMP_GetComparisonResult(LPCMP_Type *base) -{ - return (uint8_t)base->RRCSR; -} - -/*! - * @brief Clear input changed flags for single channel or multiple channels, users can clear - * input changed flag of a single channel or multiple channels through this API, for example, - * if the mask set to 0x03U means clear channel0 and channel2's input changed flags. - * - * @param base LPCMP peripheral base address. - * @param mask Mask of channel index. - */ -static inline void LPCMP_ClearInputChangedFlags(LPCMP_Type *base, uint8_t mask) -{ - base->RRSR = (uint32_t)mask; -} - -/*! - * @brief Get input changed flags for all channels, Users can get all channels' input changed - * flags through this API. - * - * @param base LPCMP peripheral base address. - * @return return All channels' changed flag. - */ -static inline uint8_t LPCMP_GetInputChangedFlags(LPCMP_Type *base) -{ - return (uint8_t)base->RRSR; -} - -/*! @} */ - -#endif /* FSL_FEATURE_LPCMP_HAS_ROUNDROBIN_MODE */ - -#if defined(__cplusplus) -} -#endif - -/*! @} */ - -#endif /* FSL_LPCMP_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpflexcomm.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpflexcomm.c deleted file mode 100644 index b494aa8d961..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpflexcomm.c +++ /dev/null @@ -1,380 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_common.h" -#include "fsl_lpflexcomm.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpflexcomm" -#endif - -/*! - * @brief Used for conversion between `void*` and `uint32_t`. - */ -typedef union pvoid_to_u32 -{ - void *pvoid; - uint32_t u32; -} pvoid_to_u32_t; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! @brief check whether lpflexcomm supports peripheral type */ -static bool LP_FLEXCOMM_PeripheralIsPresent(LP_FLEXCOMM_Type *base, LP_FLEXCOMM_PERIPH_T periph); - -/*! @brief Changes LP_FLEXCOMM mode. */ -static status_t LP_FLEXCOMM_SetPeriph(uint32_t instance, LP_FLEXCOMM_PERIPH_T periph, int lock); - -/*! @brief Common LPFLEXCOMM IRQhandle. */ -static void LP_FLEXCOMM_CommonIRQHandler(uint32_t instance); -/******************************************************************************* - * Variables - ******************************************************************************/ - -/*! @brief Array to map LP_FLEXCOMM instance number to base address. */ -static const uint32_t s_lpflexcommBaseAddrs[] = LP_FLEXCOMM_BASE_ADDRS; - -/*! @brief Array to map LP_FLEXCOMM instance PTRS. */ -static LP_FLEXCOMM_Type *const s_lpflexcommBase[] = LP_FLEXCOMM_BASE_PTRS; - -/*! @brief Pointers to real IRQ handlers installed by drivers for each instance. */ -static lpflexcomm_irq_handler_t s_lpflexcommIrqHandler[LP_FLEXCOMM_PERIPH_LPI2C + 1][ARRAY_SIZE(s_lpflexcommBaseAddrs)]; - -/*! @brief Pointers to handles for each instance to provide context to interrupt routines */ -static void *s_lpflexcommHandle[LP_FLEXCOMM_PERIPH_LPI2C + 1][ARRAY_SIZE(s_lpflexcommBaseAddrs)]; - -/*! @brief Array to map LP_FLEXCOMM instance number to IRQ number. */ -IRQn_Type const kFlexcommIrqs[] = LP_FLEXCOMM_IRQS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief IDs of clock for each LP_FLEXCOMM module */ -static const clock_ip_name_t s_lpflexcommClocks[] = LP_FLEXCOMM_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_FEATURE_LP_FLEXCOMM_HAS_NO_RESET) && FSL_FEATURE_LP_FLEXCOMM_HAS_NO_RESET) -/*! @brief Pointers to LP_FLEXCOMM resets for each instance. */ -static const reset_ip_name_t s_lpflexcommResets[] = LP_FLEXCOMM_RSTS; -#endif -/******************************************************************************* - * Code - ******************************************************************************/ - -/* check whether lpflexcomm supports peripheral type */ -static bool LP_FLEXCOMM_PeripheralIsPresent(LP_FLEXCOMM_Type *base, LP_FLEXCOMM_PERIPH_T periph) -{ - if (periph == LP_FLEXCOMM_PERIPH_NONE) - { - return true; - } - else if (periph <= LP_FLEXCOMM_PERIPH_LPI2C) - { - return (base->PSELID & (1UL << ((uint32_t)periph + 3U))) > 0UL ? true : false; - } - else if (periph == LP_FLEXCOMM_PERIPH_LPI2CAndLPUART) - { - return true; - } - else - { - return false; - } -} - -/*! @brief Returns for LP_FLEXCOMM base address. */ -uint32_t LP_FLEXCOMM_GetBaseAddress(uint32_t instance) -{ - if(instance < (uint32_t)ARRAY_SIZE(s_lpflexcommBaseAddrs)) - { - return s_lpflexcommBaseAddrs[instance]; - } - return 0U; -} - -/*! brief Returns for LP_FLEXCOMM interrupt source,see #_lpflexcomm_interrupt_flag. */ -uint32_t LP_FLEXCOMM_GetInterruptStatus(uint32_t instance) -{ - LP_FLEXCOMM_Type *base = s_lpflexcommBase[instance]; - return base->ISTAT; -} - -/* Get the index corresponding to the LP_FLEXCOMM */ -/*! brief Returns instance number for LP_FLEXCOMM module with given base address. */ -uint32_t LP_FLEXCOMM_GetInstance(void *base) -{ - uint32_t i; - pvoid_to_u32_t BaseAddr; - BaseAddr.pvoid = base; - - for (i = 0U; i < (uint32_t)ARRAY_SIZE(s_lpflexcommBaseAddrs); i++) - { - if (BaseAddr.u32 == s_lpflexcommBaseAddrs[i]) - { - break; - } - } - - assert(i < (uint32_t)ARRAY_SIZE(s_lpflexcommBaseAddrs)); - return i; -} - -/* Changes LP_FLEXCOMM mode */ -static status_t LP_FLEXCOMM_SetPeriph(uint32_t instance, LP_FLEXCOMM_PERIPH_T periph, int lock) -{ - assert(periph <= LP_FLEXCOMM_PERIPH_LPI2CAndLPUART); - LP_FLEXCOMM_Type *base = s_lpflexcommBase[instance]; - - /* Check whether peripheral type is present */ - if (!LP_FLEXCOMM_PeripheralIsPresent(base, periph)) - { - return kStatus_OutOfRange; - } - - /* Flexcomm is locked to different peripheral type than expected */ - if (((base->PSELID & LP_FLEXCOMM_PSELID_LOCK_MASK) != 0U) && - ((base->PSELID & LP_FLEXCOMM_PSELID_PERSEL_MASK) != (uint32_t)periph)) - { - return kStatus_Fail; - } - - /* Check if we are asked to lock */ - if (lock != 0) - { - base->PSELID = (uint32_t)periph | LP_FLEXCOMM_PSELID_LOCK_MASK; - } - else - { - base->PSELID = (uint32_t)periph; - } - - return kStatus_Success; -} - -/*! brief Initializes LP_FLEXCOMM and selects peripheral mode according to the second parameter. */ -status_t LP_FLEXCOMM_Init(uint32_t instance, LP_FLEXCOMM_PERIPH_T periph) -{ - assert(instance < (uint32_t)ARRAY_SIZE(s_lpflexcommBase)); -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the peripheral clock */ - CLOCK_EnableClock(s_lpflexcommClocks[instance]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_FEATURE_LP_FLEXCOMM_HAS_NO_RESET) && FSL_FEATURE_LP_FLEXCOMM_HAS_NO_RESET) - /* Reset the LP_FLEXCOMM module before configuring it.*/ - RESET_ClearPeripheralReset(s_lpflexcommResets[instance]); -#endif - /* Set the LP_FLEXCOMM to given peripheral */ - return LP_FLEXCOMM_SetPeriph(instance, periph, 0); -} - -/*! brief Deinitializes LP_FLEXCOMM. */ -void LP_FLEXCOMM_Deinit(uint32_t instance) -{ - assert(instance < (uint32_t)ARRAY_SIZE(s_lpflexcommBase)); -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable the peripheral clock */ - CLOCK_DisableClock(s_lpflexcommClocks[instance]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - RESET_SetPeripheralReset(s_lpflexcommResets[instance]); -} - -/*! brief Sets IRQ handler for given LP_FLEXCOMM module. It is used by drivers register IRQ handler according to - * LP_FLEXCOMM mode */ -void LP_FLEXCOMM_SetIRQHandler(uint32_t instance, - lpflexcomm_irq_handler_t handler, - void *lpflexcommHandle, - LP_FLEXCOMM_PERIPH_T periph) -{ - assert(instance < (uint32_t)ARRAY_SIZE(s_lpflexcommBase)); - /* Clear handler first to avoid execution of the handler with wrong handle */ - s_lpflexcommIrqHandler[periph][instance] = NULL; - s_lpflexcommHandle[periph][instance] = lpflexcommHandle; - s_lpflexcommIrqHandler[periph][instance] = handler; -} - -static void LP_FLEXCOMM_CommonIRQHandler(uint32_t instance) -{ - uint32_t interruptStat; - - interruptStat = LP_FLEXCOMM_GetInterruptStatus(instance); - if ((interruptStat & - ((uint32_t)kLPFLEXCOMM_I2cSlaveInterruptFlag | (uint32_t)kLPFLEXCOMM_I2cMasterInterruptFlag)) != 0U) - { - if (s_lpflexcommIrqHandler[LP_FLEXCOMM_PERIPH_LPI2C][instance] != NULL) - { - s_lpflexcommIrqHandler[LP_FLEXCOMM_PERIPH_LPI2C][instance]( - instance, s_lpflexcommHandle[LP_FLEXCOMM_PERIPH_LPI2C][instance]); - } - } - if ((interruptStat & ((uint32_t)kLPFLEXCOMM_UartRxInterruptFlag | (uint32_t)kLPFLEXCOMM_UartTxInterruptFlag)) != 0U) - { - if (s_lpflexcommIrqHandler[LP_FLEXCOMM_PERIPH_LPUART][instance] != NULL) - { - s_lpflexcommIrqHandler[LP_FLEXCOMM_PERIPH_LPUART][instance]( - instance, s_lpflexcommHandle[LP_FLEXCOMM_PERIPH_LPUART][instance]); - } - } - if (((interruptStat & (uint32_t)kLPFLEXCOMM_SpiInterruptFlag)) != 0U) - { - if (s_lpflexcommIrqHandler[LP_FLEXCOMM_PERIPH_LPSPI][instance] != NULL) - { - s_lpflexcommIrqHandler[LP_FLEXCOMM_PERIPH_LPSPI][instance]( - instance, s_lpflexcommHandle[LP_FLEXCOMM_PERIPH_LPSPI][instance]); - } - } - SDK_ISR_EXIT_BARRIER; -} - -/* IRQ handler functions overloading weak symbols in the startup */ -#if defined(LP_FLEXCOMM0) -void LP_FLEXCOMM0_DriverIRQHandler(void); -void LP_FLEXCOMM0_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(0U); -} -#endif - -#if defined(LP_FLEXCOMM1) -void LP_FLEXCOMM1_DriverIRQHandler(void); -void LP_FLEXCOMM1_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(1U); -} -#endif - -#if defined(LP_FLEXCOMM2) -void LP_FLEXCOMM2_DriverIRQHandler(void); -void LP_FLEXCOMM2_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(2U); -} -#endif - -#if defined(LP_FLEXCOMM3) -void LP_FLEXCOMM3_DriverIRQHandler(void); -void LP_FLEXCOMM3_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(3U); -} -#endif - -#if defined(LP_FLEXCOMM4) -void LP_FLEXCOMM4_DriverIRQHandler(void); -void LP_FLEXCOMM4_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(4U); -} -#endif - -#if defined(LP_FLEXCOMM5) -void LP_FLEXCOMM5_DriverIRQHandler(void); -void LP_FLEXCOMM5_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(5U); -} -#endif - -#if defined(LP_FLEXCOMM6) -void LP_FLEXCOMM6_DriverIRQHandler(void); -void LP_FLEXCOMM6_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(6U); -} -#endif - -#if defined(LP_FLEXCOMM7) -void LP_FLEXCOMM7_DriverIRQHandler(void); -void LP_FLEXCOMM7_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(7U); -} -#endif - -#if defined(LP_FLEXCOMM8) -void LP_FLEXCOMM8_DriverIRQHandler(void); -void LP_FLEXCOMM8_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(8U); -} -#endif - -#if defined(LP_FLEXCOMM9) -void LP_FLEXCOMM9_DriverIRQHandler(void); -void LP_FLEXCOMM9_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(9U); -} -#endif - -#if defined(LP_FLEXCOMM10) -void LP_FLEXCOMM10_DriverIRQHandler(void); -void LP_FLEXCOMM10_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(10U); -} -#endif - -#if defined(LP_FLEXCOMM11) -void LP_FLEXCOMM11_DriverIRQHandler(void); -void LP_FLEXCOMM11_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(11U); -} -#endif - -#if defined(LP_FLEXCOMM12) -void LP_FLEXCOMM12_DriverIRQHandler(void); -void LP_FLEXCOMM12_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(12U); -} -#endif - -#if defined(LP_FLEXCOMM13) -void LP_FLEXCOMM13_DriverIRQHandler(void); -void LP_FLEXCOMM13_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(13U); -} -#endif - -#if defined(LP_FLEXCOMM17) -void LP_FLEXCOMM17_DriverIRQHandler(void); -void LP_FLEXCOMM17_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(17U); -} -#endif - -#if defined(LP_FLEXCOMM18) -void LP_FLEXCOMM18_DriverIRQHandler(void); -void LP_FLEXCOMM18_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(18U); -} -#endif - -#if defined(LP_FLEXCOMM19) -void LP_FLEXCOMM19_DriverIRQHandler(void); -void LP_FLEXCOMM19_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(19U); -} -#endif - -#if defined(LP_FLEXCOMM20) -void LP_FLEXCOMM20_DriverIRQHandler(void); -void LP_FLEXCOMM20_DriverIRQHandler(void) -{ - LP_FLEXCOMM_CommonIRQHandler(20U); -} -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpflexcomm.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpflexcomm.h deleted file mode 100644 index 919f7206185..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpflexcomm.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LP_FLEXCOMM_H_ -#define FSL_LP_FLEXCOMM_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup lpflexcomm_driver - * @{ - */ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief FlexCOMM driver version. */ -#define FSL_LP_FLEXCOMM_DRIVER_VERSION (MAKE_VERSION(2, 2, 1)) -/*! @} */ - -/*! @brief LP_FLEXCOMM peripheral modes. */ -typedef enum -{ - LP_FLEXCOMM_PERIPH_NONE, /*!< No peripheral */ - LP_FLEXCOMM_PERIPH_LPUART, /*!< LPUART peripheral */ - LP_FLEXCOMM_PERIPH_LPSPI, /*!< LPSPI Peripheral */ - LP_FLEXCOMM_PERIPH_LPI2C, /*!< LPI2C Peripheral */ - LP_FLEXCOMM_PERIPH_LPI2CAndLPUART = 7, /*!< LPI2C and LPUART Peripheral */ -} LP_FLEXCOMM_PERIPH_T; - -/*! @brief LP_FLEXCOMM interrupt source flags. */ -enum _lpflexcomm_interrupt_flag -{ - kLPFLEXCOMM_I2cSlaveInterruptFlag = LP_FLEXCOMM_ISTAT_I2CS_MASK, /* LPI2C slave interrupt. */ - kLPFLEXCOMM_I2cMasterInterruptFlag = LP_FLEXCOMM_ISTAT_I2CM_MASK, /* LPI2C master interrupt. */ - kLPFLEXCOMM_SpiInterruptFlag = LP_FLEXCOMM_ISTAT_SPI_MASK, /* LPSPI interrupt. */ - kLPFLEXCOMM_UartRxInterruptFlag = LP_FLEXCOMM_ISTAT_UARTRX_MASK, /* LPUART RX interrupt. */ - kLPFLEXCOMM_UartTxInterruptFlag = LP_FLEXCOMM_ISTAT_UARTTX_MASK, /* LPUART TX interrupt. */ - - kLPFLEXCOMM_AllInterruptFlag = kLPFLEXCOMM_I2cSlaveInterruptFlag | kLPFLEXCOMM_I2cMasterInterruptFlag | - kLPFLEXCOMM_SpiInterruptFlag | kLPFLEXCOMM_UartRxInterruptFlag | - kLPFLEXCOMM_UartTxInterruptFlag, -}; - -/*! @brief Typedef for interrupt handler. */ -typedef void (*lpflexcomm_irq_handler_t)(uint32_t instance, void *handle); - -/*! @brief Array with IRQ number for each LP_FLEXCOMM module. */ -extern IRQn_Type const kFlexcommIrqs[]; - -/******************************************************************************* - * API - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! @brief Returns instance number for LP_FLEXCOMM module with given base address. */ -uint32_t LP_FLEXCOMM_GetInstance(void *base); - -/*! @brief Returns for LP_FLEXCOMM base address. */ -uint32_t LP_FLEXCOMM_GetBaseAddress(uint32_t instance); - -/*! brief Returns for LP_FLEXCOMM interrupt source,see #_lpflexcomm_interrupt_flag. */ -uint32_t LP_FLEXCOMM_GetInterruptStatus(uint32_t instance); - -/*! @brief Initializes LP_FLEXCOMM and selects peripheral mode according to the second parameter. */ -status_t LP_FLEXCOMM_Init(uint32_t instance, LP_FLEXCOMM_PERIPH_T periph); - -/*! @brief Deinitializes LP_FLEXCOMM. */ -void LP_FLEXCOMM_Deinit(uint32_t instance); - -/*! @brief Sets IRQ handler for given LP_FLEXCOMM module. It is used by drivers register IRQ handler according to - * LP_FLEXCOMM mode */ -void LP_FLEXCOMM_SetIRQHandler(uint32_t instance, - lpflexcomm_irq_handler_t handler, - void *lpflexcommHandle, - LP_FLEXCOMM_PERIPH_T periph); - -#if defined(__cplusplus) -} -#endif - -/*! @} */ - -#endif /* FSL_LP_FLEXCOMM_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpi2c.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpi2c.c deleted file mode 100644 index ccd881b21b5..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpi2c.c +++ /dev/null @@ -1,2417 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpi2c.h" -#include -#include - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpflexcomm_lpi2c" -#endif - -/*! @brief Typedef for slave interrupt handler. */ -typedef void (*lpi2c_slave_isr_t)(uint32_t instance, void *handle); - -/*! - * @brief Used for conversion from `lpflexcomm_irq_handler_t` to `lpi2c_master_isr_t` - */ -typedef union lpi2c_to_lpflexcomm -{ - lpi2c_master_isr_t lpi2c_master_handler; - lpi2c_slave_isr_t lpi2c_slave_handler; - lpflexcomm_irq_handler_t lpflexcomm_handler; -} lpi2c_to_lpflexcomm_t; - -/* ! @brief LPI2C master fifo commands. */ -enum -{ - kTxDataCmd = LPI2C_MTDR_CMD(0x0U), /*!< Transmit DATA[7:0] */ - kRxDataCmd = LPI2C_MTDR_CMD(0X1U), /*!< Receive (DATA[7:0] + 1) bytes */ - kStopCmd = LPI2C_MTDR_CMD(0x2U), /*!< Generate STOP condition */ - kStartCmd = LPI2C_MTDR_CMD(0x4U), /*!< Generate(repeated) START and transmit address in DATA[[7:0] */ -}; - -/*! - * @brief Default watermark values. - * - * The default watermarks are set to zero. - */ -enum -{ - kDefaultTxWatermark = 0, - kDefaultRxWatermark = 0, -}; - -/*! @brief States for the state machine used by transactional APIs. */ -enum -{ - kIdleState = 0, - kSendCommandState, - kIssueReadCommandState, - kTransferDataState, - kStopState, - kWaitForCompletionState, -}; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -static uint32_t LPI2C_GetCyclesForWidth( - uint32_t sourceClock_Hz, uint32_t width_ns, uint32_t minCycles, uint32_t maxCycles, uint32_t prescaler); - -static status_t LPI2C_MasterWaitForTxReady(LPI2C_Type *base); - -static status_t LPI2C_RunTransferStateMachine(LPI2C_Type *base, lpi2c_master_handle_t *handle, bool *isDone); - -static void LPI2C_InitTransferStateMachine(lpi2c_master_handle_t *handle); - -static status_t LPI2C_SlaveCheckAndClearError(LPI2C_Type *base, uint32_t flags); - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/*! @brief Array to map LPI2C instance number to base pointer. */ -static LPI2C_Type *const kLpi2cBases[] = LPI2C_BASE_PTRS; - -/*! @brief Array to map LPI2C instance number to IRQ number, used internally for LPI2C master interrupt and EDMA -transactional APIs. */ -IRQn_Type const kLpi2cIrqs[] = LPI2C_IRQS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Array to map LPI2C instance number to clock gate enum. */ -static clock_ip_name_t const kLpi2cClocks[] = LPI2C_CLOCKS; - -#if defined(LPI2C_PERIPH_CLOCKS) -/*! @brief Array to map LPI2C instance number to pheripheral clock gate enum. */ -static const clock_ip_name_t kLpi2cPeriphClocks[] = LPI2C_PERIPH_CLOCKS; -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/*! @brief Pointer to master IRQ handler for each instance, used internally for LPI2C master interrupt and EDMA -transactional APIs. */ -lpi2c_master_isr_t s_lpi2cMasterIsr; - -/*! @brief Pointer to slave IRQ handler for each instance. */ -static lpi2c_slave_isr_t s_lpi2cSlaveIsr; - -/*! @brief Pointers to master handles for each instance, used internally for LPI2C master interrupt and EDMA -transactional APIs. */ -void *s_lpi2cMasterHandle[ARRAY_SIZE(kLpi2cBases)]; - -/*! @brief Pointers to slave handles for each instance. */ -static lpi2c_slave_handle_t *s_lpi2cSlaveHandle[ARRAY_SIZE(kLpi2cBases)]; - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Returns an instance number given a base address. - * - * If an invalid base address is passed, debug builds will assert. Release builds will just return - * instance number 0. - * - * param base The LPI2C peripheral base address. - * return LPI2C instance number starting from 0. - */ -uint32_t LPI2C_GetInstance(LPI2C_Type *base) -{ - uint32_t instance; - for (instance = 0U; instance < ARRAY_SIZE(kLpi2cBases); ++instance) - { - if (kLpi2cBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(kLpi2cBases)); - return instance; -} - -/*! - * @brief Computes a cycle count for a given time in nanoseconds. - * @param sourceClock_Hz LPI2C functional clock frequency in Hertz. - * @param width_ns Desired with in nanoseconds. - * @param minCycles Minimum cycle count. - * @param maxCycles Maximum cycle count. - * @param prescaler LPI2C prescaler setting. If the cycle period is not affected by the prescaler value, set it to 0. - */ -static uint32_t LPI2C_GetCyclesForWidth( - uint32_t sourceClock_Hz, uint32_t width_ns, uint32_t minCycles, uint32_t maxCycles, uint32_t prescaler) -{ - assert(sourceClock_Hz > 0U); - - uint32_t divider = 1U; - - while (prescaler != 0U) - { - divider *= 2U; - prescaler--; - } - - uint32_t busCycle_ns = 1000000U / (sourceClock_Hz / divider / 1000U); - /* Calculate the cycle count, round up the calculated value. */ - uint32_t cycles = (width_ns * 10U / busCycle_ns + 5U) / 10U; - - /* If the calculated value is smaller than the minimum value, use the minimum value */ - if (cycles < minCycles) - { - cycles = minCycles; - } - /* If the calculated value is larger than the maximum value, use the maxmum value */ - if (cycles > maxCycles) - { - cycles = maxCycles; - } - - return cycles; -} - -/*! - * @brief Convert provided flags to status code, and clear any errors if present. - * @param base The LPI2C peripheral base address. - * @param status Current status flags value that will be checked. - * @retval #kStatus_Success - * @retval #kStatus_LPI2C_PinLowTimeout - * @retval #kStatus_LPI2C_ArbitrationLost - * @retval #kStatus_LPI2C_Nak - * @retval #kStatus_LPI2C_FifoError - */ -/* Not static so it can be used from fsl_lpi2c_edma.c. */ -status_t LPI2C_MasterCheckAndClearError(LPI2C_Type *base, uint32_t status) -{ - status_t result = kStatus_Success; - - /* Check for error. These errors cause a stop to automatically be sent. We must */ - /* clear the errors before a new transfer can start. */ - status &= (uint32_t)kLPI2C_MasterErrorFlags; - if (0U != status) - { - /* Select the correct error code. Ordered by severity, with bus issues first. */ - if (0U != (status & (uint32_t)kLPI2C_MasterPinLowTimeoutFlag)) - { - result = kStatus_LPI2C_PinLowTimeout; - } - else if (0U != (status & (uint32_t)kLPI2C_MasterArbitrationLostFlag)) - { - result = kStatus_LPI2C_ArbitrationLost; - } - else if (0U != (status & (uint32_t)kLPI2C_MasterNackDetectFlag)) - { - result = kStatus_LPI2C_Nak; - } - else if (0U != (status & (uint32_t)kLPI2C_MasterFifoErrFlag)) - { - result = kStatus_LPI2C_FifoError; - } - else - { - ; /* Intentional empty */ - } - - /* Clear the flags. */ - LPI2C_MasterClearStatusFlags(base, status); - - /* Reset fifos. These flags clear automatically. */ - base->MCR |= LPI2C_MCR_RRF_MASK | LPI2C_MCR_RTF_MASK; - } - else - { - ; /* Intentional empty */ - } - - return result; -} - -/*! - * @brief Wait until there is room in the tx fifo. - * @param base The LPI2C peripheral base address. - * @retval #kStatus_Success - * @retval #kStatus_LPI2C_PinLowTimeout - * @retval #kStatus_LPI2C_ArbitrationLost - * @retval #kStatus_LPI2C_Nak - * @retval #kStatus_LPI2C_FifoError - */ -static status_t LPI2C_MasterWaitForTxReady(LPI2C_Type *base) -{ - status_t result = kStatus_Success; - uint32_t status; - size_t txCount; - size_t txFifoSize = (size_t)FSL_FEATURE_LPI2C_FIFO_SIZEn(base); - -#if I2C_RETRY_TIMES != 0U - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - do - { - /* Get the number of words in the tx fifo and compute empty slots. */ - LPI2C_MasterGetFifoCounts(base, NULL, &txCount); - txCount = txFifoSize - txCount; - - /* Check for error flags. */ - status = LPI2C_MasterGetStatusFlags(base); - result = LPI2C_MasterCheckAndClearError(base, status); - if (kStatus_Success != result) - { - break; - } -#if I2C_RETRY_TIMES != 0U - waitTimes--; - } while ((0U == txCount) && (0U != waitTimes)); - - if (0U == waitTimes) - { - result = kStatus_LPI2C_Timeout; - } -#else - } while (0U == txCount); -#endif - - return result; -} - -/*! - * @brief Make sure the bus isn't already busy. - * - * A busy bus is allowed if we are the one driving it. - * - * @param base The LPI2C peripheral base address. - * @retval #kStatus_Success - * @retval #kStatus_LPI2C_Busy - */ -/* Not static so it can be used from fsl_lpi2c_edma.c. */ -status_t LPI2C_CheckForBusyBus(LPI2C_Type *base) -{ - status_t ret = kStatus_Success; - - uint32_t status = LPI2C_MasterGetStatusFlags(base); - if ((0U != (status & (uint32_t)kLPI2C_MasterBusBusyFlag)) && (0U == (status & (uint32_t)kLPI2C_MasterBusyFlag))) - { - ret = kStatus_LPI2C_Busy; - } - - return ret; -} - -/*! - * brief Provides a default configuration for the LPI2C master peripheral. - * - * This function provides the following default configuration for the LPI2C master peripheral: - * code - * masterConfig->enableMaster = true; - * masterConfig->debugEnable = false; - * masterConfig->ignoreAck = false; - * masterConfig->pinConfig = kLPI2C_2PinOpenDrain; - * masterConfig->baudRate_Hz = 100000U; - * masterConfig->busIdleTimeout_ns = 0U; - * masterConfig->pinLowTimeout_ns = 0U; - * masterConfig->sdaGlitchFilterWidth_ns = 0U; - * masterConfig->sclGlitchFilterWidth_ns = 0U; - * masterConfig->hostRequest.enable = false; - * masterConfig->hostRequest.source = kLPI2C_HostRequestExternalPin; - * masterConfig->hostRequest.polarity = kLPI2C_HostRequestPinActiveHigh; - * endcode - * - * After calling this function, you can override any settings in order to customize the configuration, - * prior to initializing the master driver with LPI2C_MasterInit(). - * - * param[out] masterConfig User provided configuration structure for default values. Refer to #lpi2c_master_config_t. - */ -void LPI2C_MasterGetDefaultConfig(lpi2c_master_config_t *masterConfig) -{ - /* Initializes the configure structure to zero. */ - (void)memset(masterConfig, 0, sizeof(*masterConfig)); - - masterConfig->enableMaster = true; - masterConfig->debugEnable = false; - masterConfig->enableDoze = true; - masterConfig->ignoreAck = false; - masterConfig->pinConfig = kLPI2C_2PinOpenDrain; - masterConfig->baudRate_Hz = 100000U; - masterConfig->busIdleTimeout_ns = 0U; /* Set to 0 to disable the function */ - masterConfig->pinLowTimeout_ns = 0U; /* Set to 0 to disable the function */ - masterConfig->sdaGlitchFilterWidth_ns = 0U; /* Set to 0 to disable the function */ - masterConfig->sclGlitchFilterWidth_ns = 0U; /* Set to 0 to disable the function */ - masterConfig->hostRequest.enable = false; - masterConfig->hostRequest.source = kLPI2C_HostRequestExternalPin; - masterConfig->hostRequest.polarity = kLPI2C_HostRequestPinActiveHigh; -} - -/*! - * brief Initializes the LPI2C master peripheral. - * - * This function enables the peripheral clock and initializes the LPI2C master peripheral as described by the user - * provided configuration. A software reset is performed prior to configuration. - * - * param base The LPI2C peripheral base address. - * param masterConfig User provided peripheral configuration. Use LPI2C_MasterGetDefaultConfig() to get a set of - * defaults - * that you can override. - * param sourceClock_Hz Frequency in Hertz of the LPI2C functional clock. Used to calculate the baud rate divisors, - * filter widths, and timeout periods. - */ -void LPI2C_MasterInit(LPI2C_Type *base, const lpi2c_master_config_t *masterConfig, uint32_t sourceClock_Hz) -{ - uint32_t prescaler; - uint32_t cycles; - uint32_t cfgr2; - uint32_t value; - uint32_t instance = LPI2C_GetInstance(base); - - if(LP_FLEXCOMM_GetBaseAddress(instance) != 0U) - { - -#if !(defined(LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) && LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) - /* initialize flexcomm to LPI2C mode */ - status_t status = LP_FLEXCOMM_Init(instance, LP_FLEXCOMM_PERIPH_LPI2C); - if (kStatus_Success != status) - { - assert(false); - } -#endif /* LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER */ - - } - else - { - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate the clock. */ - (void)CLOCK_EnableClock(kLpi2cClocks[instance]); -#if defined(LPI2C_PERIPH_CLOCKS) - /* Ungate the functional clock in initialize function. */ - CLOCK_EnableClock(kLpi2cPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - } - - /* Reset peripheral before configuring it. */ - LPI2C_MasterReset(base); - - /* Doze bit: 0 is enable, 1 is disable */ - base->MCR = LPI2C_MCR_DBGEN(masterConfig->debugEnable) | LPI2C_MCR_DOZEN(!(masterConfig->enableDoze)); - - /* host request */ - value = base->MCFGR0; - value &= (~(LPI2C_MCFGR0_HREN_MASK | LPI2C_MCFGR0_HRPOL_MASK | LPI2C_MCFGR0_HRSEL_MASK)); - value |= LPI2C_MCFGR0_HREN(masterConfig->hostRequest.enable) | - LPI2C_MCFGR0_HRPOL(masterConfig->hostRequest.polarity) | - LPI2C_MCFGR0_HRSEL(masterConfig->hostRequest.source); - base->MCFGR0 = value; - - /* pin config and ignore ack */ - value = base->MCFGR1; - value &= ~(LPI2C_MCFGR1_PINCFG_MASK | LPI2C_MCFGR1_IGNACK_MASK); - value |= LPI2C_MCFGR1_PINCFG(masterConfig->pinConfig); - value |= LPI2C_MCFGR1_IGNACK(masterConfig->ignoreAck); - base->MCFGR1 = value; - - LPI2C_MasterSetWatermarks(base, (size_t)kDefaultTxWatermark, (size_t)kDefaultRxWatermark); - - /* Configure glitch filters. */ - cfgr2 = base->MCFGR2; - if (0U != (masterConfig->sdaGlitchFilterWidth_ns)) - { - /* Calculate SDA filter width. The width is equal to FILTSDA cycles of functional clock. - And set FILTSDA to 0 disables the fileter, so the min value is 1. */ - cycles = LPI2C_GetCyclesForWidth(sourceClock_Hz, masterConfig->sdaGlitchFilterWidth_ns, 1U, - (LPI2C_MCFGR2_FILTSDA_MASK >> LPI2C_MCFGR2_FILTSDA_SHIFT), 0U); - cfgr2 &= ~LPI2C_MCFGR2_FILTSDA_MASK; - cfgr2 |= LPI2C_MCFGR2_FILTSDA(cycles); - } - if (0U != masterConfig->sclGlitchFilterWidth_ns) - { - /* Calculate SDL filter width. The width is equal to FILTSCL cycles of functional clock. - And set FILTSCL to 0 disables the fileter, so the min value is 1. */ - cycles = LPI2C_GetCyclesForWidth(sourceClock_Hz, masterConfig->sclGlitchFilterWidth_ns, 1U, - (LPI2C_MCFGR2_FILTSCL_MASK >> LPI2C_MCFGR2_FILTSCL_SHIFT), 0U); - cfgr2 &= ~LPI2C_MCFGR2_FILTSCL_MASK; - cfgr2 |= LPI2C_MCFGR2_FILTSCL(cycles); - } - base->MCFGR2 = cfgr2; - - /* Configure baudrate after the SDA/SCL glitch filter setting, - since the baudrate calculation needs them as parameter. */ - LPI2C_MasterSetBaudRate(base, sourceClock_Hz, masterConfig->baudRate_Hz); - - /* Configure bus idle and pin low timeouts after baudrate setting, - since the timeout calculation needs prescaler as parameter. */ - prescaler = (base->MCFGR1 & LPI2C_MCFGR1_PRESCALE_MASK) >> LPI2C_MCFGR1_PRESCALE_SHIFT; - - if (0U != (masterConfig->busIdleTimeout_ns)) - { - /* Calculate bus idle timeout value. The value is equal to BUSIDLE cycles of functional clock divided by - prescaler. And set BUSIDLE to 0 disables the fileter, so the min value is 1. */ - cycles = LPI2C_GetCyclesForWidth(sourceClock_Hz, masterConfig->busIdleTimeout_ns, 1U, - (LPI2C_MCFGR2_BUSIDLE_MASK >> LPI2C_MCFGR2_BUSIDLE_SHIFT), prescaler); - cfgr2 &= ~LPI2C_MCFGR2_BUSIDLE_MASK; - cfgr2 |= LPI2C_MCFGR2_BUSIDLE(cycles); - } - base->MCFGR2 = cfgr2; - if (0U != masterConfig->pinLowTimeout_ns) - { - /* Calculate bus pin low timeout value. The value is equal to PINLOW cycles of functional clock divided by - prescaler. And set PINLOW to 0 disables the fileter, so the min value is 1. */ - cycles = LPI2C_GetCyclesForWidth(sourceClock_Hz, masterConfig->pinLowTimeout_ns / 256U, 1U, - (LPI2C_MCFGR2_BUSIDLE_MASK >> LPI2C_MCFGR2_BUSIDLE_SHIFT), prescaler); - base->MCFGR3 = (base->MCFGR3 & ~LPI2C_MCFGR3_PINLOW_MASK) | LPI2C_MCFGR3_PINLOW(cycles); - } - - LPI2C_MasterEnable(base, masterConfig->enableMaster); -} - -/*! - * brief Deinitializes the LPI2C master peripheral. - * - * This function disables the LPI2C master peripheral and gates the clock. It also performs a software - * reset to restore the peripheral to reset conditions. - * - * param base The LPI2C peripheral base address. - */ -void LPI2C_MasterDeinit(LPI2C_Type *base) -{ - uint32_t instance = LPI2C_GetInstance(base); - - /* Restore to reset state. */ - LPI2C_MasterReset(base); - if(LP_FLEXCOMM_GetBaseAddress(instance) != 0U) - { -#if !(defined(LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) && LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) - LP_FLEXCOMM_Deinit(instance); -#endif - } - else - { -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate clock. */ - (void)CLOCK_DisableClock(kLpi2cClocks[instance]); -#if defined(LPI2C_PERIPH_CLOCKS) - /* Gate the functional clock. */ - CLOCK_DisableClock(kLpi2cPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - } -} - -/*! - * brief Configures LPI2C master data match feature. - * - * param base The LPI2C peripheral base address. - * param matchConfig Settings for the data match feature. - */ -void LPI2C_MasterConfigureDataMatch(LPI2C_Type *base, const lpi2c_data_match_config_t *matchConfig) -{ - /* Disable master mode. */ - bool wasEnabled = (0U != ((base->MCR & LPI2C_MCR_MEN_MASK) >> LPI2C_MCR_MEN_SHIFT)); - LPI2C_MasterEnable(base, false); - - base->MCFGR1 = (base->MCFGR1 & ~LPI2C_MCFGR1_MATCFG_MASK) | LPI2C_MCFGR1_MATCFG(matchConfig->matchMode); - base->MCFGR0 = (base->MCFGR0 & ~LPI2C_MCFGR0_RDMO_MASK) | LPI2C_MCFGR0_RDMO(matchConfig->rxDataMatchOnly); - base->MDMR = LPI2C_MDMR_MATCH0(matchConfig->match0) | LPI2C_MDMR_MATCH1(matchConfig->match1); - - /* Restore master mode. */ - if (wasEnabled) - { - LPI2C_MasterEnable(base, true); - } -} - -/*! - * brief Sets the I2C bus frequency for master transactions. - * - * The LPI2C master is automatically disabled and re-enabled as necessary to configure the baud - * rate. Do not call this function during a transfer, or the transfer is aborted. - * - * note Please note that the second parameter is the clock frequency of LPI2C module, the third - * parameter means user configured bus baudrate, this implementation is different from other I2C drivers - * which use baudrate configuration as second parameter and source clock frequency as third parameter. - * - * param base The LPI2C peripheral base address. - * param sourceClock_Hz LPI2C functional clock frequency in Hertz. - * param baudRate_Hz Requested bus frequency in Hertz. - */ -void LPI2C_MasterSetBaudRate(LPI2C_Type *base, uint32_t sourceClock_Hz, uint32_t baudRate_Hz) -{ - bool wasEnabled; - uint8_t filtScl = (uint8_t)((base->MCFGR2 & LPI2C_MCFGR2_FILTSCL_MASK) >> LPI2C_MCFGR2_FILTSCL_SHIFT); - - uint8_t divider = 1U; - uint8_t bestDivider = 1U; - uint8_t prescale = 0U; - uint8_t bestPre = 0U; - - uint8_t clkCycle; - uint8_t bestclkCycle = 0U; - - uint32_t absError = 0U; - uint32_t bestError = 0xffffffffu; - uint32_t computedRate; - - uint32_t tmpReg = 0U; - - /* Disable master mode. */ - wasEnabled = (0U != ((base->MCR & LPI2C_MCR_MEN_MASK) >> LPI2C_MCR_MEN_SHIFT)); - LPI2C_MasterEnable(base, false); - - /* Baud rate = (sourceClock_Hz / 2 ^ prescale) / (CLKLO + 1 + CLKHI + 1 + SCL_LATENCY) - * SCL_LATENCY = ROUNDDOWN((2 + FILTSCL) / (2 ^ prescale)) - */ - for (prescale = 0U; prescale <= 7U; prescale++) - { - /* Calculate the clkCycle, clkCycle = CLKLO + CLKHI, divider = 2 ^ prescale */ - clkCycle = (uint8_t)((10U * sourceClock_Hz / divider / baudRate_Hz + 5U) / 10U - (2U + filtScl) / divider - 2U); - /* According to register description, The max value for CLKLO and CLKHI is 63. - however to meet the I2C specification of tBUF, CLKHI should be less than - clkCycle - 0.52 x sourceClock_Hz / baudRate_Hz / divider + 1U. Refer to the comment of the tmpHigh's - calculation for details. So we have: - CLKHI < clkCycle - 0.52 x sourceClock_Hz / baudRate_Hz / divider + 1U, - clkCycle = CLKHI + CLKLO and - sourceClock_Hz / baudRate_Hz / divider = clkCycle + 2 + ROUNDDOWN((2 + FILTSCL) / divider), - we can come up with: CLKHI < 0.92 x CLKLO - ROUNDDOWN(2 + FILTSCL) / divider - so the max boundary of CLKHI should be 0.92 x 63 - ROUNDDOWN(2 + FILTSCL) / divider, - and the max boundary of clkCycle is 1.92 x 63 - ROUNDDOWN(2 + FILTSCL) / divider. */ - if (clkCycle > (120U - (2U + filtScl) / divider)) - { - divider *= 2U; - continue; - } - /* Calculate the computed baudrate and compare it with the desired baudrate */ - computedRate = (sourceClock_Hz / (uint32_t)divider) / - ((uint32_t)clkCycle + 2U + (2U + (uint32_t)filtScl) / (uint32_t)divider); - absError = baudRate_Hz > computedRate ? baudRate_Hz - computedRate : computedRate - baudRate_Hz; - if (absError < bestError) - { - bestPre = prescale; - bestDivider = divider; - bestclkCycle = clkCycle; - bestError = absError; - - /* If the error is 0, then we can stop searching because we won't find a better match. */ - if (absError == 0U) - { - break; - } - } - divider *= 2U; - } - - /* SCL low time tLO should be larger than or equal to SCL high time tHI: - tLO = ((CLKLO + 1) x (2 ^ PRESCALE)) >= tHI = ((CLKHI + 1 + SCL_LATENCY) x (2 ^ PRESCALE)), - which is CLKLO >= CLKHI + (2U + filtScl) / bestDivider. - Also since bestclkCycle = CLKLO + CLKHI, bestDivider = 2 ^ PRESCALE - which makes CLKHI <= (bestclkCycle - (2U + filtScl) / bestDivider) / 2U. - - The max tBUF should be at least 0.52 times of the SCL clock cycle: - tBUF = ((CLKLO + 1) x (2 ^ PRESCALE) / sourceClock_Hz) > (0.52 / baudRate_Hz), - plus bestDivider = 2 ^ PRESCALE, bestclkCycle = CLKLO + CLKHI we can come up with - CLKHI <= (bestclkCycle - 0.52 x sourceClock_Hz / baudRate_Hz / bestDivider + 1U). - In this case to get a safe CLKHI calculation, we can assume: - */ - uint8_t tmpHigh = (bestclkCycle - (2U + filtScl) / bestDivider) / 2U; - while (tmpHigh > (bestclkCycle - 52U * sourceClock_Hz / baudRate_Hz / bestDivider / 100U + 1U)) - { - tmpHigh = tmpHigh - 1U; - } - - /* Calculate DATAVD and SETHOLD. - To meet the timing requirement of I2C spec for standard mode, fast mode and fast mode plus: */ - /* The min tHD:STA/tSU:STA/tSU:STO should be at least 0.4 times of the SCL clock cycle, use 0.5 to be safe: - tHD:STA = ((SETHOLD + 1) x (2 ^ PRESCALE) / sourceClock_Hz) > (0.5 / baudRate_Hz), bestDivider = 2 ^ PRESCALE */ - uint8_t tmpHold = (uint8_t)(sourceClock_Hz / baudRate_Hz / bestDivider / 2U) - 1U; - - /* The max tVD:DAT/tVD:ACK/tHD:DAT should be at most 0.345 times of the SCL clock cycle, use 0.25 to be safe: - tVD:DAT = ((DATAVD + 1) x (2 ^ PRESCALE) / sourceClock_Hz) < (0.25 / baudRate_Hz), bestDivider = 2 ^ PRESCALE */ - uint8_t tmpDataVd = (uint8_t)(sourceClock_Hz / baudRate_Hz / bestDivider / 4U) - 1U; - - /* The min tSU:DAT should be at least 0.05 times of the SCL clock cycle: - tSU:DAT = ((2 + FILTSDA + 2 ^ PRESCALE) / sourceClock_Hz) >= (0.05 / baud), - plus bestDivider = 2 ^ PRESCALE, we can come up with: - FILTSDA >= (0.05 x sourceClock_Hz / baudRate_Hz - bestDivider - 2) */ - if ((sourceClock_Hz / baudRate_Hz / 20U) > (bestDivider + 2U)) - { - /* Read out the FILTSDA configuration, if it is smaller than expected, change the setting. */ - uint8_t filtSda = (uint8_t)((base->MCFGR2 & LPI2C_MCFGR2_FILTSDA_MASK) >> LPI2C_MCFGR2_FILTSDA_SHIFT); - if (filtSda < (sourceClock_Hz / baudRate_Hz / 20U - bestDivider - 2U)) - { - filtSda = (uint8_t)(sourceClock_Hz / baudRate_Hz / 20U) - bestDivider - 2U; - } - base->MCFGR2 = (base->MCFGR2 & ~LPI2C_MCFGR2_FILTSDA_MASK) | LPI2C_MCFGR2_FILTSDA(filtSda); - } - - /* Set CLKHI, CLKLO, SETHOLD, DATAVD value. */ - tmpReg = LPI2C_MCCR0_CLKHI((uint32_t)tmpHigh) | - LPI2C_MCCR0_CLKLO((uint32_t)((uint32_t)bestclkCycle - (uint32_t)tmpHigh)) | - LPI2C_MCCR0_SETHOLD((uint32_t)tmpHold) | LPI2C_MCCR0_DATAVD((uint32_t)tmpDataVd); - base->MCCR0 = tmpReg; - - /* Set PRESCALE value. */ - base->MCFGR1 = (base->MCFGR1 & ~LPI2C_MCFGR1_PRESCALE_MASK) | LPI2C_MCFGR1_PRESCALE(bestPre); - - /* Restore master mode. */ - if (wasEnabled) - { - LPI2C_MasterEnable(base, true); - } -} - -/*! - * brief Sends a START signal and slave address on the I2C bus. - * - * This function is used to initiate a new master mode transfer. First, the bus state is checked to ensure - * that another master is not occupying the bus. Then a START signal is transmitted, followed by the - * 7-bit address specified in the a address parameter. Note that this function does not actually wait - * until the START and address are successfully sent on the bus before returning. - * - * param base The LPI2C peripheral base address. - * param address 7-bit slave device address, in bits [6:0]. - * param dir Master transfer direction, either #kLPI2C_Read or #kLPI2C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * retval #kStatus_Success START signal and address were successfully enqueued in the transmit FIFO. - * retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - */ -status_t LPI2C_MasterStart(LPI2C_Type *base, uint8_t address, lpi2c_direction_t dir) -{ - /* Return an error if the bus is already in use not by us. */ - status_t result = LPI2C_CheckForBusyBus(base); - if (kStatus_Success == result) - { - /* Clear all flags. */ - LPI2C_MasterClearStatusFlags(base, (uint32_t)kLPI2C_MasterClearFlags); - - /* Turn off auto-stop option. */ - base->MCFGR1 &= ~LPI2C_MCFGR1_AUTOSTOP_MASK; - - /* Wait until there is room in the fifo. */ - result = LPI2C_MasterWaitForTxReady(base); - if (kStatus_Success == result) - { - /* Issue start command. */ - base->MTDR = (uint32_t)kStartCmd | (((uint32_t)address << 1U) | (uint32_t)dir); - } - } - - return result; -} - -/*! - * brief Sends a STOP signal on the I2C bus. - * - * This function does not return until the STOP signal is seen on the bus, or an error occurs. - * - * param base The LPI2C peripheral base address. - * retval #kStatus_Success The STOP signal was successfully sent on the bus and the transaction terminated. - * retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_LPI2C_FifoError FIFO under run or overrun. - * retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterStop(LPI2C_Type *base) -{ - /* Wait until there is room in the fifo. */ - status_t result = LPI2C_MasterWaitForTxReady(base); - if (kStatus_Success == result) - { - /* Send the STOP signal */ - base->MTDR = (uint32_t)kStopCmd; - - /* Wait for the stop detected flag to set, indicating the transfer has completed on the bus. */ - /* Also check for errors while waiting. */ -#if I2C_RETRY_TIMES != 0U - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - -#if I2C_RETRY_TIMES != 0U - while ((result == kStatus_Success) && (0U != waitTimes)) - { - waitTimes--; -#else - while (result == kStatus_Success) - { -#endif - uint32_t status = LPI2C_MasterGetStatusFlags(base); - - /* Check for error flags. */ - result = LPI2C_MasterCheckAndClearError(base, status); - - /* Check if the stop was sent successfully. */ - if ((0U != (status & (uint32_t)kLPI2C_MasterStopDetectFlag)) && - (0U != (status & (uint32_t)kLPI2C_MasterTxReadyFlag))) - { - LPI2C_MasterClearStatusFlags(base, (uint32_t)kLPI2C_MasterStopDetectFlag); - break; - } - } - -#if I2C_RETRY_TIMES != 0U - if (0U == waitTimes) - { - result = kStatus_LPI2C_Timeout; - } -#endif - } - - return result; -} - -/*! - * brief Performs a polling receive transfer on the I2C bus. - * - * param base The LPI2C peripheral base address. - * param rxBuff The pointer to the data to be transferred. - * param rxSize The length in bytes of the data to be transferred. - * retval #kStatus_Success Data was received successfully. - * retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_LPI2C_FifoError FIFO under run or overrun. - * retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterReceive(LPI2C_Type *base, void *rxBuff, size_t rxSize) -{ - assert(NULL != rxBuff); - - status_t result = kStatus_Success; - uint8_t *buf; - size_t tmpRxSize = rxSize; -#if I2C_RETRY_TIMES != 0U - uint32_t waitTimes; -#endif - - /* Check transfer data size. */ - if (rxSize > (256UL * (uint32_t)FSL_FEATURE_LPI2C_FIFO_SIZEn(base))) - { - return kStatus_InvalidArgument; - } - - /* Handle empty read. */ - if (rxSize != 0U) - { - /* Wait until there is room in the command fifo. */ - result = LPI2C_MasterWaitForTxReady(base); - if (kStatus_Success == result) - { - /* Issue command to receive data. A single write to MTDR can issue read operation of 0xFFU + 1 byte of data - at most, so when the rxSize is larger than 0x100U, push multiple read commands to MTDR until rxSize is - reached. */ - while (tmpRxSize != 0U) - { - if (tmpRxSize > 256U) - { - base->MTDR = (uint32_t)(kRxDataCmd) | (uint32_t)LPI2C_MTDR_DATA(0xFFU); - tmpRxSize -= 256U; - } - else - { - base->MTDR = (uint32_t)(kRxDataCmd) | (uint32_t)LPI2C_MTDR_DATA(tmpRxSize - 1U); - tmpRxSize = 0U; - } - } - - /* Receive data */ - buf = (uint8_t *)rxBuff; - while (0U != (rxSize--)) - { -#if I2C_RETRY_TIMES != 0U - waitTimes = I2C_RETRY_TIMES; -#endif - /* Read LPI2C receive fifo register. The register includes a flag to indicate whether */ - /* the FIFO is empty, so we can both get the data and check if we need to keep reading */ - /* using a single register read. */ - uint32_t value = 0U; - do - { - /* Check for errors. */ - result = LPI2C_MasterCheckAndClearError(base, LPI2C_MasterGetStatusFlags(base)); - if (kStatus_Success != result) - { - break; - } - - value = base->MRDR; -#if I2C_RETRY_TIMES != 0U - waitTimes--; - } while ((0U != (value & LPI2C_MRDR_RXEMPTY_MASK)) && (0U != waitTimes)); - if (0U == waitTimes) - { - result = kStatus_LPI2C_Timeout; - } -#else - } while (0U != (value & LPI2C_MRDR_RXEMPTY_MASK)); -#endif - if ((status_t)kStatus_Success != result) - { - break; - } - - *buf++ = (uint8_t)(value & LPI2C_MRDR_DATA_MASK); - } - } - } - - return result; -} - -/*! - * brief Performs a polling send transfer on the I2C bus. - * - * Sends up to a txSize number of bytes to the previously addressed slave device. The slave may - * reply with a NAK to any byte in order to terminate the transfer early. If this happens, this - * function returns #kStatus_LPI2C_Nak. - * - * param base The LPI2C peripheral base address. - * param txBuff The pointer to the data to be transferred. - * param txSize The length in bytes of the data to be transferred. - * retval #kStatus_Success Data was sent successfully. - * retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_LPI2C_FifoError FIFO under run or over run. - * retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterSend(LPI2C_Type *base, void *txBuff, size_t txSize) -{ - status_t result = kStatus_Success; - uint8_t *buf = (uint8_t *)txBuff; - - assert(NULL != txBuff); - - /* Send data buffer */ - while (0U != (txSize--)) - { - /* Wait until there is room in the fifo. This also checks for errors. */ - result = LPI2C_MasterWaitForTxReady(base); - if (kStatus_Success != result) - { - break; - } - - /* Write byte into LPI2C master data register. */ - base->MTDR = *buf++; - } - - return result; -} - -/*! - * brief Performs a master polling transfer on the I2C bus. - * - * note The API does not return until the transfer succeeds or fails due - * to error happens during transfer. - * - * param base The LPI2C peripheral base address. - * param transfer Pointer to the transfer structure. - * retval #kStatus_Success Data was received successfully. - * retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * retval #kStatus_LPI2C_FifoError FIFO under run or overrun. - * retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterTransferBlocking(LPI2C_Type *base, lpi2c_master_transfer_t *transfer) -{ - assert(NULL != transfer); - assert(transfer->subaddressSize <= sizeof(transfer->subaddress)); - - status_t result = kStatus_Success; - uint16_t commandBuffer[7]; - uint32_t cmdCount = 0U; - - /* Check transfer data size in read operation. */ - if ((transfer->direction == kLPI2C_Read) && - (transfer->dataSize > (256UL * (uint32_t)FSL_FEATURE_LPI2C_FIFO_SIZEn(base)))) - { - return kStatus_InvalidArgument; - } - - /* Return an error if the bus is already in use not by us. */ - result = LPI2C_CheckForBusyBus(base); - if (kStatus_Success == result) - { - /* Clear all flags. */ - LPI2C_MasterClearStatusFlags(base, (uint32_t)kLPI2C_MasterClearFlags); - - /* Turn off auto-stop option. */ - base->MCFGR1 &= ~LPI2C_MCFGR1_AUTOSTOP_MASK; - - lpi2c_direction_t direction = (0U != transfer->subaddressSize) ? kLPI2C_Write : transfer->direction; - if (0U == (transfer->flags & (uint32_t)kLPI2C_TransferNoStartFlag)) - { - commandBuffer[cmdCount++] = - (uint16_t)kStartCmd | - (uint16_t)((uint16_t)((uint16_t)transfer->slaveAddress << 1U) | (uint16_t)direction); - } - - /* Subaddress, MSB first. */ - if (0U != transfer->subaddressSize) - { - uint32_t subaddressRemaining = transfer->subaddressSize; - while (0U != subaddressRemaining--) - { - uint8_t subaddressByte = (uint8_t)((transfer->subaddress >> (8U * subaddressRemaining)) & 0xffU); - commandBuffer[cmdCount++] = subaddressByte; - } - } - - /* Reads need special handling. */ - if ((0U != transfer->dataSize) && (transfer->direction == kLPI2C_Read)) - { - /* Need to send repeated start if switching directions to read. */ - if (direction == kLPI2C_Write) - { - commandBuffer[cmdCount++] = - (uint16_t)kStartCmd | - (uint16_t)((uint16_t)((uint16_t)transfer->slaveAddress << 1U) | (uint16_t)kLPI2C_Read); - } - } - - /* Send command buffer */ - uint32_t index = 0U; - while (0U != cmdCount--) - { - /* Wait until there is room in the fifo. This also checks for errors. */ - result = LPI2C_MasterWaitForTxReady(base); - if (kStatus_Success != result) - { - break; - } - - /* Write byte into LPI2C master data register. */ - base->MTDR = commandBuffer[index]; - index++; - } - - if (kStatus_Success == result) - { - /* Transmit data. */ - if ((transfer->direction == kLPI2C_Write) && (transfer->dataSize > 0U)) - { - /* Send Data. */ - result = LPI2C_MasterSend(base, transfer->data, transfer->dataSize); - } - - /* Receive Data. */ - if ((transfer->direction == kLPI2C_Read) && (transfer->dataSize > 0U)) - { - result = LPI2C_MasterReceive(base, transfer->data, transfer->dataSize); - } - - if (kStatus_Success == result) - { - if ((transfer->flags & (uint32_t)kLPI2C_TransferNoStopFlag) == 0U) - { - result = LPI2C_MasterStop(base); - } - } - } - - /* Transmit fail */ - if (kStatus_Success != result) - { - if ((transfer->flags & (uint32_t)kLPI2C_TransferNoStopFlag) == 0U) - { - (void)LPI2C_MasterStop(base); - } - } - } - - return result; -} - -/*! - * brief Creates a new handle for the LPI2C master non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the LPI2C_MasterTransferAbort() API shall be called. - * - * - * note The function also enables the NVIC IRQ for the input LPI2C. Need to notice - * that on some SoCs the LPI2C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - * - * param base The LPI2C peripheral base address. - * param[out] handle Pointer to the LPI2C master driver handle. - * param callback User provided pointer to the asynchronous callback function. - * param userData User provided pointer to the application callback data. - */ -void LPI2C_MasterTransferCreateHandle(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_master_transfer_callback_t callback, - void *userData) -{ - uint32_t instance; - - assert(NULL != handle); - - /* Clear out the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Look up instance number */ - instance = LPI2C_GetInstance(base); - - /* Save base and instance. */ - handle->completionCallback = callback; - handle->userData = userData; - - if(LP_FLEXCOMM_GetBaseAddress(instance) != 0U) - { - lpi2c_to_lpflexcomm_t handler; - (void)memset(&handler, 0, sizeof(handler)); - - /* Save the handle in global variables to support the double weak mechanism. */ - handler.lpi2c_master_handler = LPI2C_MasterTransferHandleIRQ; - LP_FLEXCOMM_SetIRQHandler(LPI2C_GetInstance(base), handler.lpflexcomm_handler, handle, LP_FLEXCOMM_PERIPH_LPI2C); - } - else - { - /* Save this handle for IRQ use. */ - s_lpi2cMasterHandle[instance] = handle; - - /* Set irq handler. */ - s_lpi2cMasterIsr = LPI2C_MasterTransferHandleIRQ; - } - - /* Clear internal IRQ enables and enable NVIC IRQ. */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - - /* Enable NVIC IRQ, this only enables the IRQ directly connected to the NVIC. - In some cases the LPI2C IRQ is configured through INTMUX, user needs to enable - INTMUX IRQ in application code. */ - (void)EnableIRQ(kLpi2cIrqs[instance]); -} - -/*! - * @brief Execute states until FIFOs are exhausted. - * @param handle Master nonblocking driver handle. - * @param[out] isDone Set to true if the transfer has completed. - * @retval #kStatus_Success - * @retval #kStatus_LPI2C_PinLowTimeout - * @retval #kStatus_LPI2C_ArbitrationLost - * @retval #kStatus_LPI2C_Nak - * @retval #kStatus_LPI2C_FifoError - */ -static status_t LPI2C_RunTransferStateMachine(LPI2C_Type *base, lpi2c_master_handle_t *handle, bool *isDone) -{ - uint32_t status; - status_t result = kStatus_Success; - lpi2c_master_transfer_t *xfer; - size_t txCount; - size_t rxCount; - size_t txFifoSize = (size_t)FSL_FEATURE_LPI2C_FIFO_SIZEn(base); - bool state_complete = false; - uint16_t sendval; - - /* Set default isDone return value. */ - *isDone = false; - - /* Check for errors. */ - status = LPI2C_MasterGetStatusFlags(base); - - /* Get fifo counts. */ - LPI2C_MasterGetFifoCounts(base, &rxCount, &txCount); - - /* Get pointer to private data. */ - xfer = &handle->transfer; - - /* For the last byte, nack flag is expected. - Do not check and clear kLPI2C_MasterNackDetectFlag for the last byte, - in case FIFO is emptied when stop command has not been sent. */ - if (handle->remainingBytes == 0U) - { - /* When data size is not zero which means it is not only one byte of address is sent, and */ - /* when the txfifo is empty, or have one byte which is the stop command, then the nack status can be ignored. */ - if ((xfer->dataSize != 0U) && - ((txCount == 0U) || ((txCount == 1U) && (handle->state == (uint8_t)kWaitForCompletionState) && - ((xfer->flags & (uint32_t)kLPI2C_TransferNoStopFlag) == 0U)))) - { - status &= ~(uint32_t)kLPI2C_MasterNackDetectFlag; - } - } - - result = LPI2C_MasterCheckAndClearError(base, status); - - if (kStatus_Success == result) - { - /* Compute room in tx fifo */ - txCount = txFifoSize - txCount; - - while (!state_complete) - { - /* Execute the state. */ - switch (handle->state) - { - case (uint8_t)kSendCommandState: - /* Make sure there is room in the tx fifo for the next command. */ - if (0U == txCount--) - { - state_complete = true; - break; - } - - /* Issue command. buf is a uint8_t* pointing at the uint16 command array. */ - sendval = ((uint16_t)handle->buf[0]) | (((uint16_t)handle->buf[1]) << 8U); - base->MTDR = sendval; - handle->buf++; - handle->buf++; - - /* Count down until all commands are sent. */ - if (--handle->remainingBytes == 0U) - { - /* Choose next state and set up buffer pointer and count. */ - if (0U != xfer->dataSize) - { - /* Either a send or receive transfer is next. */ - handle->state = (uint8_t)kTransferDataState; - handle->buf = (uint8_t *)xfer->data; - handle->remainingBytes = (uint16_t)xfer->dataSize; - if (xfer->direction == kLPI2C_Read) - { - /* Disable TX interrupt */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterTxReadyFlag); - /* Issue command to receive data. A single write to MTDR can issue read operation of - 0xFFU + 1 byte of data at most, so when the dataSize is larger than 0x100U, push - multiple read commands to MTDR until dataSize is reached. */ - size_t tmpRxSize = xfer->dataSize; - while (tmpRxSize != 0U) - { - LPI2C_MasterGetFifoCounts(base, NULL, &txCount); - while (txFifoSize == txCount) - { - LPI2C_MasterGetFifoCounts(base, NULL, &txCount); - } - - if (tmpRxSize > 256U) - { - base->MTDR = (uint32_t)(kRxDataCmd) | (uint32_t)LPI2C_MTDR_DATA(0xFFU); - tmpRxSize -= 256U; - } - else - { - base->MTDR = (uint32_t)(kRxDataCmd) | (uint32_t)LPI2C_MTDR_DATA(tmpRxSize - 1U); - tmpRxSize = 0U; - } - } - } - } - else - { - /* No transfer, so move to stop state. */ - handle->state = (uint8_t)kStopState; - } - } - break; - - case (uint8_t)kIssueReadCommandState: - /* Make sure there is room in the tx fifo for the read command. */ - if (0U == txCount--) - { - state_complete = true; - break; - } - - base->MTDR = (uint32_t)kRxDataCmd | LPI2C_MTDR_DATA(xfer->dataSize - 1U); - - /* Move to transfer state. */ - handle->state = (uint8_t)kTransferDataState; - if (xfer->direction == kLPI2C_Read) - { - /* Disable TX interrupt */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterTxReadyFlag); - } - break; - - case (uint8_t)kTransferDataState: - if (xfer->direction == kLPI2C_Write) - { - /* Make sure there is room in the tx fifo. */ - if (0U == txCount--) - { - state_complete = true; - break; - } - - /* Put byte to send in fifo. */ - base->MTDR = *(handle->buf)++; - } - else - { - /* XXX handle receive sizes > 256, use kIssueReadCommandState */ - /* Make sure there is data in the rx fifo. */ - if (0U == rxCount--) - { - state_complete = true; - break; - } - - /* Read byte from fifo. */ - *(handle->buf)++ = (uint8_t)(base->MRDR & LPI2C_MRDR_DATA_MASK); - } - - /* Move to stop when the transfer is done. */ - if (--handle->remainingBytes == 0U) - { - if (xfer->direction == kLPI2C_Write) - { - state_complete = true; - } - handle->state = (uint8_t)kStopState; - } - break; - - case (uint8_t)kStopState: - /* Only issue a stop transition if the caller requested it. */ - if ((xfer->flags & (uint32_t)kLPI2C_TransferNoStopFlag) == 0U) - { - /* Make sure there is room in the tx fifo for the stop command. */ - if (0U == txCount--) - { - state_complete = true; - break; - } - - base->MTDR = (uint32_t)kStopCmd; - } - else - { - /* If all data is read and no stop flag is required to send, we are done. */ - if (xfer->direction == kLPI2C_Read) - { - *isDone = true; - } - state_complete = true; - } - handle->state = (uint8_t)kWaitForCompletionState; - break; - - case (uint8_t)kWaitForCompletionState: - if ((xfer->flags & (uint32_t)kLPI2C_TransferNoStopFlag) == 0U) - { - /* We stay in this state until the stop state is detected. */ - if (0U != (status & (uint32_t)kLPI2C_MasterStopDetectFlag)) - { - *isDone = true; - } - } - else - { - /* If all data is pushed to FIFO and no stop flag is required to send, we need to make sure they - are all send out to bus. */ - if ((xfer->direction == kLPI2C_Write) && ((base->MFSR & LPI2C_MFSR_TXCOUNT_MASK) == 0U)) - { - /* We stay in this state until the data is sent out to bus. */ - *isDone = true; - } - } - state_complete = true; - break; - default: - assert(false); - break; - } - } - } - return result; -} - -/*! - * @brief Prepares the transfer state machine and fills in the command buffer. - * @param handle Master nonblocking driver handle. - */ -static void LPI2C_InitTransferStateMachine(lpi2c_master_handle_t *handle) -{ - lpi2c_master_transfer_t *xfer = &handle->transfer; - - /* Handle no start option. */ - if (0U != (xfer->flags & (uint32_t)kLPI2C_TransferNoStartFlag)) - { - if (xfer->direction == kLPI2C_Read) - { - /* Need to issue read command first. */ - handle->state = (uint8_t)kIssueReadCommandState; - } - else - { - /* Start immediately in the data transfer state. */ - handle->state = (uint8_t)kTransferDataState; - } - - handle->buf = (uint8_t *)xfer->data; - handle->remainingBytes = (uint16_t)xfer->dataSize; - } - else - { - uint16_t *cmd = (uint16_t *)&handle->commandBuffer; - uint32_t cmdCount = 0U; - - /* Initial direction depends on whether a subaddress was provided, and of course the actual */ - /* data transfer direction. */ - lpi2c_direction_t direction = (0U != xfer->subaddressSize) ? kLPI2C_Write : xfer->direction; - - /* Start command. */ - cmd[cmdCount++] = - (uint16_t)kStartCmd | (uint16_t)((uint16_t)((uint16_t)xfer->slaveAddress << 1U) | (uint16_t)direction); - - /* Subaddress, MSB first. */ - if (0U != xfer->subaddressSize) - { - uint32_t subaddressRemaining = xfer->subaddressSize; - while (0U != (subaddressRemaining--)) - { - uint8_t subaddressByte = (uint8_t)((xfer->subaddress >> (8U * subaddressRemaining)) & 0xffU); - cmd[cmdCount++] = subaddressByte; - } - } - - /* Reads need special handling. */ - if ((0U != xfer->dataSize) && (xfer->direction == kLPI2C_Read)) - { - /* Need to send repeated start if switching directions to read. */ - if (direction == kLPI2C_Write) - { - cmd[cmdCount++] = (uint16_t)kStartCmd | - (uint16_t)((uint16_t)((uint16_t)xfer->slaveAddress << 1U) | (uint16_t)kLPI2C_Read); - } - } - - /* Set up state machine for transferring the commands. */ - handle->state = (uint8_t)kSendCommandState; - handle->remainingBytes = (uint16_t)cmdCount; - handle->buf = (uint8_t *)&handle->commandBuffer; - } -} - -/*! - * brief Performs a non-blocking transaction on the I2C bus. - * - * param base The LPI2C peripheral base address. - * param handle Pointer to the LPI2C master driver handle. - * param transfer The pointer to the transfer descriptor. - * retval #kStatus_Success The transaction was started successfully. - * retval #kStatus_LPI2C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - */ -status_t LPI2C_MasterTransferNonBlocking(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_master_transfer_t *transfer) -{ - assert(NULL != handle); - assert(NULL != transfer); - assert(transfer->subaddressSize <= sizeof(transfer->subaddress)); - - status_t result; - - /* Check transfer data size in read operation. */ - if ((transfer->direction == kLPI2C_Read) && - (transfer->dataSize > (256U * (uint32_t)FSL_FEATURE_LPI2C_FIFO_SIZEn(base)))) - { - return kStatus_InvalidArgument; - } - - /* Return busy if another transaction is in progress. */ - if (handle->state != (uint8_t)kIdleState) - { - result = kStatus_LPI2C_Busy; - } - else - { - result = LPI2C_CheckForBusyBus(base); - } - - if ((status_t)kStatus_Success == result) - { - /* Disable LPI2C IRQ sources while we configure stuff. */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - - /* Reset FIFO in case there are data. */ - base->MCR |= LPI2C_MCR_RRF_MASK | LPI2C_MCR_RTF_MASK; - - /* Save transfer into handle. */ - handle->transfer = *transfer; - - /* Generate commands to send. */ - LPI2C_InitTransferStateMachine(handle); - - /* Clear all flags. */ - LPI2C_MasterClearStatusFlags(base, (uint32_t)kLPI2C_MasterClearFlags); - - /* Turn off auto-stop option. */ - base->MCFGR1 &= ~LPI2C_MCFGR1_AUTOSTOP_MASK; - - /* Enable LPI2C internal IRQ sources. NVIC IRQ was enabled in CreateHandle() */ - LPI2C_MasterEnableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - } - - return result; -} - -/*! - * brief Returns number of bytes transferred so far. - * param base The LPI2C peripheral base address. - * param handle Pointer to the LPI2C master driver handle. - * param[out] count Number of bytes transferred so far by the non-blocking transaction. - * retval #kStatus_Success - * retval #kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t LPI2C_MasterTransferGetCount(LPI2C_Type *base, lpi2c_master_handle_t *handle, size_t *count) -{ - status_t result = kStatus_Success; - - assert(NULL != handle); - - if (NULL == count) - { - result = kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - else if (handle->state == (uint8_t)kIdleState) - { - *count = 0; - result = kStatus_NoTransferInProgress; - } - else - { - uint8_t state; - uint16_t remainingBytes; - uint32_t dataSize; - - /* Cache some fields with IRQs disabled. This ensures all field values */ - /* are synchronized with each other during an ongoing transfer. */ - uint32_t irqs = LPI2C_MasterGetEnabledInterrupts(base); - LPI2C_MasterDisableInterrupts(base, irqs); - state = handle->state; - remainingBytes = handle->remainingBytes; - dataSize = handle->transfer.dataSize; - LPI2C_MasterEnableInterrupts(base, irqs); - - /* Get transfer count based on current transfer state. */ - switch (state) - { - case (uint8_t)kIdleState: - case (uint8_t)kSendCommandState: - case (uint8_t) - kIssueReadCommandState: /* XXX return correct value for this state when >256 reads are supported */ - *count = 0; - break; - - case (uint8_t)kTransferDataState: - *count = dataSize - remainingBytes; - break; - - case (uint8_t)kStopState: - case (uint8_t)kWaitForCompletionState: - default: - *count = dataSize; - break; - } - } - - return result; -} - -/*! - * brief Terminates a non-blocking LPI2C master transmission early. - * - * note It is not safe to call this function from an IRQ handler that has a higher priority than the - * LPI2C peripheral's IRQ priority. - * - * param base The LPI2C peripheral base address. - * param handle Pointer to the LPI2C master driver handle. - * retval #kStatus_Success A transaction was successfully aborted. - * retval #kStatus_LPI2C_Idle There is not a non-blocking transaction currently in progress. - */ -void LPI2C_MasterTransferAbort(LPI2C_Type *base, lpi2c_master_handle_t *handle) -{ - if (handle->state != (uint8_t)kIdleState) - { - /* Disable internal IRQ enables. */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - - /* Reset fifos. */ - base->MCR |= LPI2C_MCR_RRF_MASK | LPI2C_MCR_RTF_MASK; - - /* If master is still busy and has not send out stop signal yet. */ - if ((LPI2C_MasterGetStatusFlags(base) & ((uint32_t)kLPI2C_MasterStopDetectFlag | - (uint32_t)kLPI2C_MasterBusyFlag)) == (uint32_t)kLPI2C_MasterBusyFlag) - { - /* Send a stop command to finalize the transfer. */ - base->MTDR = (uint32_t)kStopCmd; - } - - /* Reset handle. */ - handle->state = (uint8_t)kIdleState; - } -} - -/*! - * brief Reusable routine to handle master interrupts. - * note This function does not need to be called unless you are reimplementing the - * nonblocking API's interrupt handler routines to add special functionality. - * param instance The LPI2C instance. - * param lpi2cMasterHandle Pointer to the LPI2C master driver handle. - */ -void LPI2C_MasterTransferHandleIRQ(uint32_t instance, void *lpi2cMasterHandle) -{ - assert(lpi2cMasterHandle != NULL); - assert(instance < ARRAY_SIZE(kLpi2cBases)); - LPI2C_Type *base = kLpi2cBases[instance]; - lpi2c_master_handle_t *handle = (lpi2c_master_handle_t *)lpi2cMasterHandle; - bool isDone = false; - status_t result; - - /* Don't do anything if we don't have a valid handle. */ - if (NULL != handle) - { - if (handle->state != (uint8_t)kIdleState) - { - result = LPI2C_RunTransferStateMachine(base, handle, &isDone); - - if ((result != kStatus_Success) || isDone) - { - /* Handle error, terminate xfer */ - if (result != kStatus_Success) - { - LPI2C_MasterTransferAbort(base, handle); - } - - /* Disable internal IRQ enables. */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - - /* Set handle to idle state. */ - handle->state = (uint8_t)kIdleState; - - /* Invoke callback. */ - if (NULL != handle->completionCallback) - { - handle->completionCallback(base, handle, result, handle->userData); - } - } - } - } -} - -/*! - * brief Provides a default configuration for the LPI2C slave peripheral. - * - * This function provides the following default configuration for the LPI2C slave peripheral: - * code - * slaveConfig->enableSlave = true; - * slaveConfig->address0 = 0U; - * slaveConfig->address1 = 0U; - * slaveConfig->addressMatchMode = kLPI2C_MatchAddress0; - * slaveConfig->filterDozeEnable = true; - * slaveConfig->filterEnable = true; - * slaveConfig->enableGeneralCall = false; - * slaveConfig->sclStall.enableAck = false; - * slaveConfig->sclStall.enableTx = true; - * slaveConfig->sclStall.enableRx = true; - * slaveConfig->sclStall.enableAddress = true; - * slaveConfig->ignoreAck = false; - * slaveConfig->enableReceivedAddressRead = false; - * slaveConfig->sdaGlitchFilterWidth_ns = 0; - * slaveConfig->sclGlitchFilterWidth_ns = 0; - * slaveConfig->dataValidDelay_ns = 0; - * slaveConfig->clockHoldTime_ns = 0; - * endcode - * - * After calling this function, override any settings to customize the configuration, - * prior to initializing the master driver with LPI2C_SlaveInit(). Be sure to override at least the a - * address0 member of the configuration structure with the desired slave address. - * - * param[out] slaveConfig User provided configuration structure that is set to default values. Refer to - * #lpi2c_slave_config_t. - */ -void LPI2C_SlaveGetDefaultConfig(lpi2c_slave_config_t *slaveConfig) -{ - /* Initializes the configure structure to zero. */ - (void)memset(slaveConfig, 0, sizeof(*slaveConfig)); - - slaveConfig->enableSlave = true; - slaveConfig->address0 = 0U; - slaveConfig->address1 = 0U; - slaveConfig->addressMatchMode = kLPI2C_MatchAddress0; - slaveConfig->filterDozeEnable = true; - slaveConfig->filterEnable = true; - slaveConfig->enableGeneralCall = false; - slaveConfig->sclStall.enableAck = false; - slaveConfig->sclStall.enableTx = true; - slaveConfig->sclStall.enableRx = true; - slaveConfig->sclStall.enableAddress = false; - slaveConfig->ignoreAck = false; - slaveConfig->enableReceivedAddressRead = false; - slaveConfig->sdaGlitchFilterWidth_ns = 0U; /* Set to 0 to disable the function */ - slaveConfig->sclGlitchFilterWidth_ns = 0U; /* Set to 0 to disable the function */ - slaveConfig->dataValidDelay_ns = 0U; - /* When enabling the slave tx SCL stall, set the default clock hold time to 250ns according - to I2C spec for standard mode baudrate(100k). User can manually change it to 100ns or 50ns - for fast-mode(400k) or fast-mode+(1m). */ - slaveConfig->clockHoldTime_ns = 250U; -} - -/*! - * brief Initializes the LPI2C slave peripheral. - * - * This function enables the peripheral clock and initializes the LPI2C slave peripheral as described by the user - * provided configuration. - * - * param base The LPI2C peripheral base address. - * param slaveConfig User provided peripheral configuration. Use LPI2C_SlaveGetDefaultConfig() to get a set of defaults - * that you can override. - * param sourceClock_Hz Frequency in Hertz of the LPI2C functional clock. Used to calculate the filter widths, - * data valid delay, and clock hold time. - */ -void LPI2C_SlaveInit(LPI2C_Type *base, const lpi2c_slave_config_t *slaveConfig, uint32_t sourceClock_Hz) -{ - uint32_t tmpReg; - uint32_t tmpCycle; - uint32_t instance = LPI2C_GetInstance(base); - - if(LP_FLEXCOMM_GetBaseAddress(instance) != 0U) - { - -#if !(defined(LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) && LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) - /* initialize flexcomm to LPI2C mode */ - status_t status = LP_FLEXCOMM_Init(instance, LP_FLEXCOMM_PERIPH_LPI2C); - if (kStatus_Success != status) - { - assert(false); - } -#endif /* LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER */ - - } - else - { - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate the clock. */ - (void)CLOCK_EnableClock(kLpi2cClocks[instance]); -#if defined(LPI2C_PERIPH_CLOCKS) - /* Ungate the functional clock in initialize function. */ - CLOCK_EnableClock(kLpi2cPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - } - - /* Restore to reset conditions. */ - LPI2C_SlaveReset(base); - - /* Configure peripheral. */ - base->SAMR = LPI2C_SAMR_ADDR0(slaveConfig->address0) | LPI2C_SAMR_ADDR1(slaveConfig->address1); - - base->SCFGR1 = - LPI2C_SCFGR1_ADDRCFG(slaveConfig->addressMatchMode) | LPI2C_SCFGR1_IGNACK(slaveConfig->ignoreAck) | - LPI2C_SCFGR1_RXCFG(slaveConfig->enableReceivedAddressRead) | LPI2C_SCFGR1_GCEN(slaveConfig->enableGeneralCall) | - LPI2C_SCFGR1_ACKSTALL(slaveConfig->sclStall.enableAck) | LPI2C_SCFGR1_TXDSTALL(slaveConfig->sclStall.enableTx) | - LPI2C_SCFGR1_RXSTALL(slaveConfig->sclStall.enableRx) | - LPI2C_SCFGR1_ADRSTALL(slaveConfig->sclStall.enableAddress); - - /* Calculate SDA filter width. The width is equal to FILTSDA+3 cycles of functional clock. - And set FILTSDA to 0 disables the fileter, so the min value is 4. */ - tmpReg = LPI2C_SCFGR2_FILTSDA( - LPI2C_GetCyclesForWidth(sourceClock_Hz, slaveConfig->sdaGlitchFilterWidth_ns, 4U, - (LPI2C_SCFGR2_FILTSDA_MASK >> LPI2C_SCFGR2_FILTSDA_SHIFT) + 3U, 0U) - - 3U); - - /* Calculate SDL filter width. The width is equal to FILTSCL+3 cycles of functional clock. - And set FILTSCL to 0 disables the fileter, so the min value is 4. */ - tmpCycle = LPI2C_GetCyclesForWidth(sourceClock_Hz, slaveConfig->sclGlitchFilterWidth_ns, 4U, - (LPI2C_SCFGR2_FILTSCL_MASK >> LPI2C_SCFGR2_FILTSCL_SHIFT) + 3U, 0U); - tmpReg |= LPI2C_SCFGR2_FILTSCL(tmpCycle - 3U); - - /* Calculate data valid time. The time is equal to FILTSCL+DATAVD+3 cycles of functional clock. - So the min value is FILTSCL+3. */ - tmpReg |= LPI2C_SCFGR2_DATAVD( - LPI2C_GetCyclesForWidth(sourceClock_Hz, slaveConfig->dataValidDelay_ns, tmpCycle, - tmpCycle + (LPI2C_SCFGR2_DATAVD_MASK >> LPI2C_SCFGR2_DATAVD_SHIFT), 0U) - - tmpCycle); - - /* Calculate clock hold time. The time is equal to CLKHOLD+3 cycles of functional clock. - So the min value is 3. */ - base->SCFGR2 = - tmpReg | LPI2C_SCFGR2_CLKHOLD( - LPI2C_GetCyclesForWidth(sourceClock_Hz, slaveConfig->clockHoldTime_ns, 3U, - (LPI2C_SCFGR2_CLKHOLD_MASK >> LPI2C_SCFGR2_CLKHOLD_SHIFT) + 3U, 0U) - - 3U); - - /* Save SCR to last so we don't enable slave until it is configured */ - base->SCR = LPI2C_SCR_FILTDZ(!slaveConfig->filterDozeEnable) | LPI2C_SCR_FILTEN(slaveConfig->filterEnable) | - LPI2C_SCR_SEN(slaveConfig->enableSlave); -} - -/*! - * brief Deinitializes the LPI2C slave peripheral. - * - * This function disables the LPI2C slave peripheral and gates the clock. It also performs a software - * reset to restore the peripheral to reset conditions. - * - * param base The LPI2C peripheral base address. - */ -void LPI2C_SlaveDeinit(LPI2C_Type *base) -{ - uint32_t instance = LPI2C_GetInstance(base); - - /* Restore to reset state. */ - LPI2C_SlaveReset(base); - if(LP_FLEXCOMM_GetBaseAddress(instance) != 0U) - { -#if !(defined(LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) && LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) - LP_FLEXCOMM_Deinit(instance); -#endif - } - else - { -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate clock. */ - (void)CLOCK_DisableClock(kLpi2cClocks[instance]); -#if defined(LPI2C_PERIPH_CLOCKS) - /* Gate the functional clock. */ - CLOCK_DisableClock(kLpi2cPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - } -} - -/*! - * @brief Convert provided flags to status code, and clear any errors if present. - * @param base The LPI2C peripheral base address. - * @param status Current status flags value that will be checked. - * @retval #kStatus_Success - * @retval #kStatus_LPI2C_BitError - * @retval #kStatus_LPI2C_FifoError - */ -static status_t LPI2C_SlaveCheckAndClearError(LPI2C_Type *base, uint32_t flags) -{ - status_t result = kStatus_Success; - - flags &= (uint32_t)kLPI2C_SlaveErrorFlags; - if (0U != flags) - { - if (0U != (flags & (uint32_t)kLPI2C_SlaveBitErrFlag)) - { - result = kStatus_LPI2C_BitError; - } - else if (0U != (flags & (uint32_t)kLPI2C_SlaveFifoErrFlag)) - { - result = kStatus_LPI2C_FifoError; - } - else - { - ; /* Intentional empty */ - } - - /* Clear the errors. */ - LPI2C_SlaveClearStatusFlags(base, flags); - } - else - { - ; /* Intentional empty */ - } - - return result; -} - -/*! - * brief Performs a polling send transfer on the I2C bus. - * - * param base The LPI2C peripheral base address. - * param txBuff The pointer to the data to be transferred. - * param txSize The length in bytes of the data to be transferred. - * param[out] actualTxSize - * return Error or success status returned by API. - */ -status_t LPI2C_SlaveSend(LPI2C_Type *base, void *txBuff, size_t txSize, size_t *actualTxSize) -{ - status_t result = kStatus_Success; - uint8_t *buf = (uint8_t *)txBuff; - size_t remaining = txSize; - - assert(NULL != txBuff); - -#if I2C_RETRY_TIMES != 0U - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - - /* Clear stop flag. */ - LPI2C_SlaveClearStatusFlags(base, - (uint32_t)kLPI2C_SlaveStopDetectFlag | (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag); - - while (0U != remaining) - { - uint32_t flags; - - /* Wait until we can transmit. */ - do - { - /* Check for errors */ - flags = LPI2C_SlaveGetStatusFlags(base); - result = LPI2C_SlaveCheckAndClearError(base, flags); - if (kStatus_Success != result) - { - if (NULL != actualTxSize) - { - *actualTxSize = txSize - remaining; - } - break; - } -#if I2C_RETRY_TIMES != 0U - waitTimes--; - } while ((0U == (flags & ((uint32_t)kLPI2C_SlaveTxReadyFlag | (uint32_t)kLPI2C_SlaveStopDetectFlag | - (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag))) && - (0U != waitTimes)); - if (0U == waitTimes) - { - result = kStatus_LPI2C_Timeout; - } -#else - } while (0U == (flags & ((uint32_t)kLPI2C_SlaveTxReadyFlag | (uint32_t)kLPI2C_SlaveStopDetectFlag | - (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag))); -#endif - - if (kStatus_Success != result) - { - break; - } - - /* Send a byte. */ - if (0U != (flags & (uint32_t)kLPI2C_SlaveTxReadyFlag)) - { - base->STDR = *buf++; - --remaining; - } - - /* Exit loop if we see a stop or restart in transfer*/ - if ((0U != (flags & ((uint32_t)kLPI2C_SlaveStopDetectFlag | (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag))) && - (remaining != 0U)) - { - LPI2C_SlaveClearStatusFlags( - base, (uint32_t)kLPI2C_SlaveStopDetectFlag | (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag); - break; - } - } - - if (NULL != actualTxSize) - { - *actualTxSize = txSize - remaining; - } - - return result; -} - -/*! - * brief Performs a polling receive transfer on the I2C bus. - * - * param base The LPI2C peripheral base address. - * param rxBuff The pointer to the data to be transferred. - * param rxSize The length in bytes of the data to be transferred. - * param[out] actualRxSize - * return Error or success status returned by API. - */ -status_t LPI2C_SlaveReceive(LPI2C_Type *base, void *rxBuff, size_t rxSize, size_t *actualRxSize) -{ - status_t result = kStatus_Success; - uint8_t *buf = (uint8_t *)rxBuff; - size_t remaining = rxSize; - - assert(NULL != rxBuff); - -#if I2C_RETRY_TIMES != 0U - uint32_t waitTimes = I2C_RETRY_TIMES; -#endif - - /* Clear stop flag. */ - LPI2C_SlaveClearStatusFlags(base, - (uint32_t)kLPI2C_SlaveStopDetectFlag | (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag); - - while (0U != remaining) - { - uint32_t flags; - - /* Wait until we can receive. */ - do - { - /* Check for errors */ - flags = LPI2C_SlaveGetStatusFlags(base); - result = LPI2C_SlaveCheckAndClearError(base, flags); - if (kStatus_Success != result) - { - if (NULL != actualRxSize) - { - *actualRxSize = rxSize - remaining; - } - break; - } -#if I2C_RETRY_TIMES != 0U - waitTimes--; - } while ((0U == (flags & ((uint32_t)kLPI2C_SlaveRxReadyFlag | (uint32_t)kLPI2C_SlaveStopDetectFlag | - (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag))) && - (0U != waitTimes)); - if (0U == waitTimes) - { - result = kStatus_LPI2C_Timeout; - } -#else - } while (0U == (flags & ((uint32_t)kLPI2C_SlaveRxReadyFlag | (uint32_t)kLPI2C_SlaveStopDetectFlag | - (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag))); -#endif - - if ((status_t)kStatus_Success != result) - { - break; - } - - /* Receive a byte. */ - if (0U != (flags & (uint32_t)kLPI2C_SlaveRxReadyFlag)) - { - *buf++ = (uint8_t)(base->SRDR & LPI2C_SRDR_DATA_MASK); - --remaining; - } - - /* Exit loop if we see a stop or restart */ - if ((0U != (flags & ((uint32_t)kLPI2C_SlaveStopDetectFlag | (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag))) && - (remaining != 0U)) - { - LPI2C_SlaveClearStatusFlags( - base, (uint32_t)kLPI2C_SlaveStopDetectFlag | (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag); - break; - } - } - - if (NULL != actualRxSize) - { - *actualRxSize = rxSize - remaining; - } - - return result; -} - -/*! - * brief Creates a new handle for the LPI2C slave non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the LPI2C_SlaveTransferAbort() API shall be called. - * - * note The function also enables the NVIC IRQ for the input LPI2C. Need to notice - * that on some SoCs the LPI2C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - - * param base The LPI2C peripheral base address. - * param[out] handle Pointer to the LPI2C slave driver handle. - * param callback User provided pointer to the asynchronous callback function. - * param userData User provided pointer to the application callback data. - */ -void LPI2C_SlaveTransferCreateHandle(LPI2C_Type *base, - lpi2c_slave_handle_t *handle, - lpi2c_slave_transfer_callback_t callback, - void *userData) -{ - uint32_t instance; - - assert(NULL != handle); - - /* Clear out the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Look up instance number */ - instance = LPI2C_GetInstance(base); - - /* Save base and instance. */ - handle->callback = callback; - handle->userData = userData; - - if(LP_FLEXCOMM_GetBaseAddress(instance) != 0U) - { - lpi2c_to_lpflexcomm_t handler; - (void)memset(&handler, 0, sizeof(handler)); - - /* Save the handle in global variables to support the double weak mechanism. */ - handler.lpi2c_slave_handler = LPI2C_SlaveTransferHandleIRQ; - LP_FLEXCOMM_SetIRQHandler(LPI2C_GetInstance(base), handler.lpflexcomm_handler, handle, LP_FLEXCOMM_PERIPH_LPI2C); - } - else - { - /* Save this handle for IRQ use. */ - s_lpi2cSlaveHandle[instance] = handle; - - /* Set irq handler. */ - s_lpi2cSlaveIsr = LPI2C_SlaveTransferHandleIRQ; - } - - /* Clear internal IRQ enables and enable NVIC IRQ. */ - LPI2C_SlaveDisableInterrupts(base, (uint32_t)kLPI2C_SlaveIrqFlags); - (void)EnableIRQ(kLpi2cIrqs[instance]); - - /* Nack by default. */ - base->STAR = LPI2C_STAR_TXNACK_MASK; -} - -/*! - * brief Starts accepting slave transfers. - * - * Call this API after calling I2C_SlaveInit() and LPI2C_SlaveTransferCreateHandle() to start processing - * transactions driven by an I2C master. The slave monitors the I2C bus and pass events to the - * callback that was passed into the call to LPI2C_SlaveTransferCreateHandle(). The callback is always invoked - * from the interrupt context. - * - * The set of events received by the callback is customizable. To do so, set the a eventMask parameter to - * the OR'd combination of #lpi2c_slave_transfer_event_t enumerators for the events you wish to receive. - * The #kLPI2C_SlaveTransmitEvent and #kLPI2C_SlaveReceiveEvent events are always enabled and do not need - * to be included in the mask. Alternatively, you can pass 0 to get a default set of only the transmit and - * receive events that are always enabled. In addition, the #kLPI2C_SlaveAllEvents constant is provided as - * a convenient way to enable all events. - * - * param base The LPI2C peripheral base address. - * param handle Pointer to #lpi2c_slave_handle_t structure which stores the transfer state. - * param eventMask Bit mask formed by OR'ing together #lpi2c_slave_transfer_event_t enumerators to specify - * which events to send to the callback. Other accepted values are 0 to get a default set of - * only the transmit and receive events, and #kLPI2C_SlaveAllEvents to enable all events. - * - * retval #kStatus_Success Slave transfers were successfully started. - * retval #kStatus_LPI2C_Busy Slave transfers have already been started on this handle. - */ -status_t LPI2C_SlaveTransferNonBlocking(LPI2C_Type *base, lpi2c_slave_handle_t *handle, uint32_t eventMask) -{ - status_t result = kStatus_Success; - - assert(NULL != handle); - - /* Return busy if another transaction is in progress. */ - if (handle->isBusy) - { - result = kStatus_LPI2C_Busy; - } - else - { - /* Return an error if the bus is already in use not by us. */ - uint32_t status = LPI2C_SlaveGetStatusFlags(base); - if ((0U != (status & (uint32_t)kLPI2C_SlaveBusBusyFlag)) && (0U == (status & (uint32_t)kLPI2C_SlaveBusyFlag))) - { - result = kStatus_LPI2C_Busy; - } - } - - if ((status_t)kStatus_Success == result) - { - /* Disable LPI2C IRQ sources while we configure stuff. */ - LPI2C_SlaveDisableInterrupts(base, (uint32_t)kLPI2C_SlaveIrqFlags); - - /* Clear transfer in handle. */ - (void)memset(&handle->transfer, 0, sizeof(handle->transfer)); - - /* Record that we're busy. */ - handle->isBusy = true; - - /* Set up event mask. tx and rx are always enabled. */ - handle->eventMask = eventMask | (uint32_t)kLPI2C_SlaveTransmitEvent | (uint32_t)kLPI2C_SlaveReceiveEvent; - - /* Ack by default. */ - base->STAR = 0U; - - /* Clear all flags. */ - LPI2C_SlaveClearStatusFlags(base, (uint32_t)kLPI2C_SlaveClearFlags); - - /* Enable LPI2C internal IRQ sources. NVIC IRQ was enabled in CreateHandle() */ - LPI2C_SlaveEnableInterrupts(base, (uint32_t)kLPI2C_SlaveIrqFlags); - } - - return result; -} - -/*! - * brief Gets the slave transfer status during a non-blocking transfer. - * param base The LPI2C peripheral base address. - * param handle Pointer to i2c_slave_handle_t structure. - * param[out] count Pointer to a value to hold the number of bytes transferred. May be NULL if the count is not - * required. - * retval #kStatus_Success - * retval #kStatus_NoTransferInProgress - */ -status_t LPI2C_SlaveTransferGetCount(LPI2C_Type *base, lpi2c_slave_handle_t *handle, size_t *count) -{ - status_t status = kStatus_Success; - - assert(NULL != handle); - - if (count == NULL) - { - status = kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - else if (!handle->isBusy) - { - *count = 0; - status = kStatus_NoTransferInProgress; - } - - /* For an active transfer, just return the count from the handle. */ - else - { - *count = handle->transferredCount; - } - - return status; -} - -/*! - * brief Aborts the slave non-blocking transfers. - * note This API could be called at any time to stop slave for handling the bus events. - * param base The LPI2C peripheral base address. - * param handle Pointer to #lpi2c_slave_handle_t structure which stores the transfer state. - * retval #kStatus_Success - * retval #kStatus_LPI2C_Idle - */ -void LPI2C_SlaveTransferAbort(LPI2C_Type *base, lpi2c_slave_handle_t *handle) -{ - assert(NULL != handle); - - /* Return idle if no transaction is in progress. */ - if (handle->isBusy) - { - /* Disable LPI2C IRQ sources. */ - LPI2C_SlaveDisableInterrupts(base, (uint32_t)kLPI2C_SlaveIrqFlags); - - /* Nack by default. */ - base->STAR = LPI2C_STAR_TXNACK_MASK; - - /* Reset transfer info. */ - (void)memset(&handle->transfer, 0, sizeof(handle->transfer)); - - /* We're no longer busy. */ - handle->isBusy = false; - } -} - -/*! - * brief Reusable routine to handle slave interrupts. - * note This function does not need to be called unless you are reimplementing the - * non blocking API's interrupt handler routines to add special functionality. - * param instance The LPI2C instance. - * param lpi2cSlaveHandle Pointer to #lpi2c_slave_handle_t structure which stores the transfer state. - */ -void LPI2C_SlaveTransferHandleIRQ(uint32_t instance, void *lpi2cSlaveHandle) -{ - assert(instance < ARRAY_SIZE(kLpi2cBases)); - uint32_t flags; - lpi2c_slave_transfer_t *xfer; - LPI2C_Type *base = kLpi2cBases[instance]; - lpi2c_slave_handle_t *handle = (lpi2c_slave_handle_t *)lpi2cSlaveHandle; - - /* Check for a valid handle in case of a spurious interrupt. */ - if (NULL != handle) - { - xfer = &handle->transfer; - - /* Get status flags. */ - flags = LPI2C_SlaveGetStatusFlags(base); - - if (0U != (flags & ((uint32_t)kLPI2C_SlaveBitErrFlag | (uint32_t)kLPI2C_SlaveFifoErrFlag))) - { - xfer->event = kLPI2C_SlaveCompletionEvent; - xfer->completionStatus = LPI2C_SlaveCheckAndClearError(base, flags); - - if ((0U != (handle->eventMask & (uint32_t)kLPI2C_SlaveCompletionEvent)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - } - else - { - if (0U != - (flags & (((uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag) | ((uint32_t)kLPI2C_SlaveStopDetectFlag)))) - { - xfer->event = (0U != (flags & (uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag)) ? - kLPI2C_SlaveRepeatedStartEvent : - kLPI2C_SlaveCompletionEvent; - xfer->receivedAddress = 0U; - xfer->completionStatus = kStatus_Success; - xfer->transferredCount = handle->transferredCount; - - if (xfer->event == kLPI2C_SlaveCompletionEvent) - { - handle->isBusy = false; - } - - if (handle->wasTransmit) - { - /* Subtract one from the transmit count to offset the fact that LPI2C asserts the */ - /* tx flag before it sees the nack from the master-receiver, thus causing one more */ - /* count that the master actually receives. */ - --xfer->transferredCount; - handle->wasTransmit = false; - } - - /* Clear the flag. */ - LPI2C_SlaveClearStatusFlags(base, flags & ((uint32_t)kLPI2C_SlaveRepeatedStartDetectFlag | - (uint32_t)kLPI2C_SlaveStopDetectFlag)); - - /* Revert to sending an Ack by default, in case we sent a Nack for receive. */ - base->STAR = 0U; - - if ((0U != (handle->eventMask & (uint32_t)xfer->event)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - - if (0U != (flags & (uint32_t)kLPI2C_SlaveStopDetectFlag)) - { - /* Clean up transfer info on completion, after the callback has been invoked. */ - (void)memset(&handle->transfer, 0, sizeof(handle->transfer)); - } - } - if (0U != (flags & (uint32_t)kLPI2C_SlaveAddressValidFlag)) - { - xfer->event = kLPI2C_SlaveAddressMatchEvent; - xfer->receivedAddress = (uint8_t)(base->SASR & LPI2C_SASR_RADDR_MASK); - - /* Update handle status to busy because slave is addressed. */ - handle->isBusy = true; - if ((0U != (handle->eventMask & (uint32_t)kLPI2C_SlaveAddressMatchEvent)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - } - if (0U != (flags & (uint32_t)kLPI2C_SlaveTransmitAckFlag)) - { - xfer->event = kLPI2C_SlaveTransmitAckEvent; - - if ((0U != (handle->eventMask & (uint32_t)kLPI2C_SlaveTransmitAckEvent)) && (NULL != handle->callback)) - { - handle->callback(base, xfer, handle->userData); - } - else - { - LPI2C_SlaveTransmitAck(base, true); - } - } - - /* Handle transmit and receive. */ - if (0U != (flags & (uint32_t)kLPI2C_SlaveTxReadyFlag)) - { - handle->wasTransmit = true; - - /* If we're out of data, invoke callback to get more. */ - if ((NULL == xfer->data) || (0U == xfer->dataSize)) - { - xfer->event = kLPI2C_SlaveTransmitEvent; - if (NULL != handle->callback) - { - handle->callback(base, xfer, handle->userData); - } - - /* Clear the transferred count now that we have a new buffer. */ - handle->transferredCount = 0U; - } - - /* Transmit a byte. */ - if ((NULL != xfer->data) && (0U != xfer->dataSize)) - { - base->STDR = *xfer->data++; - --xfer->dataSize; - ++handle->transferredCount; - } - } - if (0U != (flags & (uint32_t)kLPI2C_SlaveRxReadyFlag)) - { - /* If we're out of room in the buffer, invoke callback to get another. */ - if ((NULL == xfer->data) || (0U == xfer->dataSize)) - { - xfer->event = kLPI2C_SlaveReceiveEvent; - if (NULL != handle->callback) - { - handle->callback(base, xfer, handle->userData); - } - - /* Clear the transferred count now that we have a new buffer. */ - handle->transferredCount = 0U; - } - - /* Receive a byte. */ - if ((NULL != xfer->data) && (0U != xfer->dataSize)) - { - *xfer->data++ = (uint8_t)base->SRDR; - --xfer->dataSize; - ++handle->transferredCount; - if (0U != (base->SCFGR1 & LPI2C_SCFGR1_ACKSTALL_MASK)) - { - if (((0U == (handle->eventMask & (uint32_t)kLPI2C_SlaveTransmitAckEvent)) || - (NULL == handle->callback))) - { - LPI2C_SlaveTransmitAck(base, true); - } - } - } - else - { - /* We don't have any room to receive more data, so send a nack. */ - if (0U != (base->SCFGR1 & LPI2C_SCFGR1_ACKSTALL_MASK)) - { - if (((0U == (handle->eventMask & (uint32_t)kLPI2C_SlaveTransmitAckEvent)) || - (NULL == handle->callback))) - { - LPI2C_SlaveTransmitAck(base, false); - } - } - } - } - } - } -} - -#if !(defined(FSL_FEATURE_I2C_HAS_NO_IRQ) && FSL_FEATURE_I2C_HAS_NO_IRQ) -/*! - * @brief Shared IRQ handler that can call both master and slave ISRs. - * - * The master and slave ISRs are called through function pointers in order to decouple - * this code from the ISR functions. Without this, the linker would always pull in both - * ISRs and every function they call, even if only the functional API was used. - * - * @param base The LPI2C peripheral base address. - * @param instance The LPI2C peripheral instance number. - */ -void LPI2C_CommonIRQHandler(LPI2C_Type *base, uint32_t instance); -void LPI2C_CommonIRQHandler(LPI2C_Type *base, uint32_t instance) -{ - /* Check for master IRQ. */ - if ((0U != (base->MCR & LPI2C_MCR_MEN_MASK)) && (NULL != s_lpi2cMasterIsr)) - { - /* Master mode. */ - s_lpi2cMasterIsr(instance, s_lpi2cMasterHandle[instance]); - } - - /* Check for slave IRQ. */ - if ((0U != (base->SCR & LPI2C_SCR_SEN_MASK)) && (NULL != s_lpi2cSlaveIsr)) - { - /* Slave mode. */ - s_lpi2cSlaveIsr(instance, s_lpi2cSlaveHandle[instance]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(LPI2C15) -/* Implementation of LPI2C15 handler named in startup code. */ -void LPI2C15_DriverIRQHandler(void); -void LPI2C15_DriverIRQHandler(void) -{ - LPI2C_CommonIRQHandler(LPI2C15, 15U); -} -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpi2c.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpi2c.h deleted file mode 100644 index 96afc6d4488..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpi2c.h +++ /dev/null @@ -1,1342 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LPI2C_H_ -#define FSL_LPI2C_H_ - -#include -#include "fsl_device_registers.h" -#include "fsl_common.h" -#include "fsl_lpflexcomm.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! - * @addtogroup lpi2c - * @{ - */ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief LPI2C driver version. */ -#define FSL_LPI2C_DRIVER_VERSION (MAKE_VERSION(2, 2, 4)) -/*! @} */ - -/*! @brief Retry times for waiting flag. */ -#ifndef I2C_RETRY_TIMES -#define I2C_RETRY_TIMES 0U /* Define to zero means keep waiting until the flag is assert/deassert. */ -#endif - -/*! @brief LPI2C status return codes. */ -enum -{ - kStatus_LPI2C_Busy = MAKE_STATUS(kStatusGroup_LPI2C, 0), /*!< The master is already performing a transfer. */ - kStatus_LPI2C_Idle = MAKE_STATUS(kStatusGroup_LPI2C, 1), /*!< The slave driver is idle. */ - kStatus_LPI2C_Nak = MAKE_STATUS(kStatusGroup_LPI2C, 2), /*!< The slave device sent a NAK in response to a byte. */ - kStatus_LPI2C_FifoError = MAKE_STATUS(kStatusGroup_LPI2C, 3), /*!< FIFO under run or overrun. */ - kStatus_LPI2C_BitError = MAKE_STATUS(kStatusGroup_LPI2C, 4), /*!< Transferred bit was not seen on the bus. */ - kStatus_LPI2C_ArbitrationLost = MAKE_STATUS(kStatusGroup_LPI2C, 5), /*!< Arbitration lost error. */ - kStatus_LPI2C_PinLowTimeout = - MAKE_STATUS(kStatusGroup_LPI2C, 6), /*!< SCL or SDA were held low longer than the timeout. */ - kStatus_LPI2C_NoTransferInProgress = - MAKE_STATUS(kStatusGroup_LPI2C, 7), /*!< Attempt to abort a transfer when one is not in progress. */ - kStatus_LPI2C_DmaRequestFail = MAKE_STATUS(kStatusGroup_LPI2C, 8), /*!< DMA request failed. */ - kStatus_LPI2C_Timeout = MAKE_STATUS(kStatusGroup_LPI2C, 9), /*!< Timeout polling status flags. */ -}; - -/*! @} */ - -/*! - * @addtogroup lpi2c_master_driver - * @{ - */ - -/*! - * @brief LPI2C master peripheral flags. - * - * The following status register flags can be cleared: - * - #kLPI2C_MasterEndOfPacketFlag - * - #kLPI2C_MasterStopDetectFlag - * - #kLPI2C_MasterNackDetectFlag - * - #kLPI2C_MasterArbitrationLostFlag - * - #kLPI2C_MasterFifoErrFlag - * - #kLPI2C_MasterPinLowTimeoutFlag - * - #kLPI2C_MasterDataMatchFlag - * - * All flags except #kLPI2C_MasterBusyFlag and #kLPI2C_MasterBusBusyFlag can be enabled as - * interrupts. - * - * @note These enums are meant to be OR'd together to form a bit mask. - */ -enum _lpi2c_master_flags -{ - kLPI2C_MasterTxReadyFlag = LPI2C_MSR_TDF_MASK, /*!< Transmit data flag */ - kLPI2C_MasterRxReadyFlag = LPI2C_MSR_RDF_MASK, /*!< Receive data flag */ - kLPI2C_MasterEndOfPacketFlag = LPI2C_MSR_EPF_MASK, /*!< End Packet flag */ - kLPI2C_MasterStopDetectFlag = LPI2C_MSR_SDF_MASK, /*!< Stop detect flag */ - kLPI2C_MasterNackDetectFlag = LPI2C_MSR_NDF_MASK, /*!< NACK detect flag */ - kLPI2C_MasterArbitrationLostFlag = LPI2C_MSR_ALF_MASK, /*!< Arbitration lost flag */ - kLPI2C_MasterFifoErrFlag = LPI2C_MSR_FEF_MASK, /*!< FIFO error flag */ - kLPI2C_MasterPinLowTimeoutFlag = LPI2C_MSR_PLTF_MASK, /*!< Pin low timeout flag */ - kLPI2C_MasterDataMatchFlag = LPI2C_MSR_DMF_MASK, /*!< Data match flag */ - kLPI2C_MasterBusyFlag = LPI2C_MSR_MBF_MASK, /*!< Master busy flag */ - kLPI2C_MasterBusBusyFlag = LPI2C_MSR_BBF_MASK, /*!< Bus busy flag */ - - /*! All flags which are cleared by the driver upon starting a transfer. */ - kLPI2C_MasterClearFlags = kLPI2C_MasterEndOfPacketFlag | kLPI2C_MasterStopDetectFlag | kLPI2C_MasterNackDetectFlag | - kLPI2C_MasterArbitrationLostFlag | kLPI2C_MasterFifoErrFlag | - kLPI2C_MasterPinLowTimeoutFlag | kLPI2C_MasterDataMatchFlag, - /*! IRQ sources enabled by the non-blocking transactional API. */ - kLPI2C_MasterIrqFlags = kLPI2C_MasterArbitrationLostFlag | kLPI2C_MasterTxReadyFlag | kLPI2C_MasterRxReadyFlag | - kLPI2C_MasterStopDetectFlag | kLPI2C_MasterNackDetectFlag | kLPI2C_MasterPinLowTimeoutFlag | - kLPI2C_MasterFifoErrFlag, - /*! Errors to check for. */ - kLPI2C_MasterErrorFlags = kLPI2C_MasterNackDetectFlag | kLPI2C_MasterArbitrationLostFlag | - kLPI2C_MasterFifoErrFlag | kLPI2C_MasterPinLowTimeoutFlag -}; - -/*! @brief Direction of master and slave transfers. */ -typedef enum _lpi2c_direction -{ - kLPI2C_Write = 0U, /*!< Master transmit. */ - kLPI2C_Read = 1U /*!< Master receive. */ -} lpi2c_direction_t; - -/*! @brief LPI2C pin configuration. */ -typedef enum _lpi2c_master_pin_config -{ - kLPI2C_2PinOpenDrain = 0x0U, /*!< LPI2C Configured for 2-pin open drain mode */ - kLPI2C_2PinOutputOnly = 0x1U, /*!< LPI2C Configured for 2-pin output only mode (ultra-fast mode) */ - kLPI2C_2PinPushPull = 0x2U, /*!< LPI2C Configured for 2-pin push-pull mode */ - kLPI2C_4PinPushPull = 0x3U, /*!< LPI2C Configured for 4-pin push-pull mode */ - kLPI2C_2PinOpenDrainWithSeparateSlave = - 0x4U, /*!< LPI2C Configured for 2-pin open drain mode with separate LPI2C slave */ - kLPI2C_2PinOutputOnlyWithSeparateSlave = - 0x5U, /*!< LPI2C Configured for 2-pin output only mode(ultra-fast mode) with separate LPI2C slave */ - kLPI2C_2PinPushPullWithSeparateSlave = - 0x6U, /*!< LPI2C Configured for 2-pin push-pull mode with separate LPI2C slave */ - kLPI2C_4PinPushPullWithInvertedOutput = 0x7U /*!< LPI2C Configured for 4-pin push-pull mode(inverted outputs) */ -} lpi2c_master_pin_config_t; - -/*! @brief LPI2C master host request selection. */ -typedef enum _lpi2c_host_request_source -{ - kLPI2C_HostRequestExternalPin = 0x0U, /*!< Select the LPI2C_HREQ pin as the host request input */ - kLPI2C_HostRequestInputTrigger = 0x1U, /*!< Select the input trigger as the host request input */ -} lpi2c_host_request_source_t; - -/*! @brief LPI2C master host request pin polarity configuration. */ -typedef enum _lpi2c_host_request_polarity -{ - kLPI2C_HostRequestPinActiveLow = 0x0U, /*!< Configure the LPI2C_HREQ pin active low */ - kLPI2C_HostRequestPinActiveHigh = 0x1U /*!< Configure the LPI2C_HREQ pin active high */ -} lpi2c_host_request_polarity_t; - -/*! - * @brief Structure with settings to initialize the LPI2C master module. - * - * This structure holds configuration settings for the LPI2C peripheral. To initialize this - * structure to reasonable defaults, call the LPI2C_MasterGetDefaultConfig() function and - * pass a pointer to your configuration structure instance. - * - * The configuration structure can be made constant so it resides in flash. - */ -typedef struct _lpi2c_master_config -{ - bool enableMaster; /*!< Whether to enable master mode. */ - bool enableDoze; /*!< Whether master is enabled in doze mode. */ - bool debugEnable; /*!< Enable transfers to continue when halted in debug mode. */ - bool ignoreAck; /*!< Whether to ignore ACK/NACK. */ - lpi2c_master_pin_config_t pinConfig; /*!< The pin configuration option. */ - uint32_t baudRate_Hz; /*!< Desired baud rate in Hertz. */ - uint32_t busIdleTimeout_ns; /*!< Bus idle timeout in nanoseconds. Set to 0 to disable. */ - uint32_t pinLowTimeout_ns; /*!< Pin low timeout in nanoseconds. Set to 0 to disable. */ - uint8_t sdaGlitchFilterWidth_ns; /*!< Width in nanoseconds of glitch filter on SDA pin. Set to 0 to disable. */ - uint8_t sclGlitchFilterWidth_ns; /*!< Width in nanoseconds of glitch filter on SCL pin. Set to 0 to disable. */ - struct - { - bool enable; /*!< Enable host request. */ - lpi2c_host_request_source_t source; /*!< Host request source. */ - lpi2c_host_request_polarity_t polarity; /*!< Host request pin polarity. */ - } hostRequest; /*!< Host request options. */ -} lpi2c_master_config_t; - -/*! @brief LPI2C master data match configuration modes. */ -typedef enum _lpi2c_data_match_config_mode -{ - kLPI2C_MatchDisabled = 0x0U, /*!< LPI2C Match Disabled */ - kLPI2C_1stWordEqualsM0OrM1 = 0x2U, /*!< LPI2C Match Enabled and 1st data word equals MATCH0 OR MATCH1 */ - kLPI2C_AnyWordEqualsM0OrM1 = 0x3U, /*!< LPI2C Match Enabled and any data word equals MATCH0 OR MATCH1 */ - kLPI2C_1stWordEqualsM0And2ndWordEqualsM1 = - 0x4U, /*!< LPI2C Match Enabled and 1st data word equals MATCH0, 2nd data equals MATCH1 */ - kLPI2C_AnyWordEqualsM0AndNextWordEqualsM1 = - 0x5U, /*!< LPI2C Match Enabled and any data word equals MATCH0, next data equals MATCH1 */ - kLPI2C_1stWordAndM1EqualsM0AndM1 = - 0x6U, /*!< LPI2C Match Enabled and 1st data word and MATCH0 equals MATCH0 and MATCH1 */ - kLPI2C_AnyWordAndM1EqualsM0AndM1 = - 0x7U /*!< LPI2C Match Enabled and any data word and MATCH0 equals MATCH0 and MATCH1 */ -} lpi2c_data_match_config_mode_t; - -/*! @brief LPI2C master data match configuration structure. */ -typedef struct _lpi2c_match_config -{ - lpi2c_data_match_config_mode_t matchMode; /*!< Data match configuration setting. */ - bool rxDataMatchOnly; /*!< When set to true, received data is ignored until a successful match. */ - uint32_t match0; /*!< Match value 0. */ - uint32_t match1; /*!< Match value 1. */ -} lpi2c_data_match_config_t; - -/* Forward declaration of the transfer descriptor and handle typedefs. */ -typedef struct _lpi2c_master_transfer lpi2c_master_transfer_t; -typedef struct _lpi2c_master_handle lpi2c_master_handle_t; - -/*! - * @brief Master completion callback function pointer type. - * - * This callback is used only for the non-blocking master transfer API. Specify the callback you wish to use - * in the call to LPI2C_MasterTransferCreateHandle(). - * - * @param base The LPI2C peripheral base address. - * @param completionStatus Either kStatus_Success or an error code describing how the transfer completed. - * @param userData Arbitrary pointer-sized value passed from the application. - */ -typedef void (*lpi2c_master_transfer_callback_t)(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - status_t completionStatus, - void *userData); - -/*! - * @brief Transfer option flags. - * - * @note These enumerations are intended to be OR'd together to form a bit mask of options for - * the #_lpi2c_master_transfer::flags field. - */ -enum _lpi2c_master_transfer_flags -{ - kLPI2C_TransferDefaultFlag = 0x00U, /*!< Transfer starts with a start signal, stops with a stop signal. */ - kLPI2C_TransferNoStartFlag = 0x01U, /*!< Don't send a start condition, address, and sub address */ - kLPI2C_TransferRepeatedStartFlag = 0x02U, /*!< Send a repeated start condition */ - kLPI2C_TransferNoStopFlag = 0x04U, /*!< Don't send a stop condition. */ -}; - -/*! - * @brief Non-blocking transfer descriptor structure. - * - * This structure is used to pass transaction parameters to the LPI2C_MasterTransferNonBlocking() API. - */ -struct _lpi2c_master_transfer -{ - uint32_t flags; /*!< Bit mask of options for the transfer. See enumeration #_lpi2c_master_transfer_flags for - available options. Set to 0 or #kLPI2C_TransferDefaultFlag for normal transfers. */ - uint16_t slaveAddress; /*!< The 7-bit slave address. */ - lpi2c_direction_t direction; /*!< Either #kLPI2C_Read or #kLPI2C_Write. */ - uint32_t subaddress; /*!< Sub address. Transferred MSB first. */ - size_t subaddressSize; /*!< Length of sub address to send in bytes. Maximum size is 4 bytes. */ - void *data; /*!< Pointer to data to transfer. */ - size_t dataSize; /*!< Number of bytes to transfer. */ -}; - -/*! - * @brief Driver handle for master non-blocking APIs. - * @note The contents of this structure are private and subject to change. - */ -struct _lpi2c_master_handle -{ - uint8_t state; /*!< Transfer state machine current state. */ - uint16_t remainingBytes; /*!< Remaining byte count in current state. */ - uint8_t *buf; /*!< Buffer pointer for current state. */ - uint16_t commandBuffer[6]; /*!< LPI2C command sequence. When all 6 command words are used: - Start&addr&write[1 word] + subaddr[4 words] + restart&addr&read[1 word] */ - lpi2c_master_transfer_t transfer; /*!< Copy of the current transfer info. */ - lpi2c_master_transfer_callback_t completionCallback; /*!< Callback function pointer. */ - void *userData; /*!< Application data passed to callback. */ -}; - -/*! @brief Typedef for master interrupt handler, used internally for LPI2C master interrupt and EDMA transactional APIs. - */ -typedef void (*lpi2c_master_isr_t)(uint32_t instance, void *handle); - -/*! @} */ - -/*! - * @addtogroup lpi2c_slave_driver - * @{ - */ - -/*! - * @brief LPI2C slave peripheral flags. - * - * The following status register flags can be cleared: - * - #kLPI2C_SlaveRepeatedStartDetectFlag - * - #kLPI2C_SlaveStopDetectFlag - * - #kLPI2C_SlaveBitErrFlag - * - #kLPI2C_SlaveFifoErrFlag - * - * All flags except #kLPI2C_SlaveBusyFlag and #kLPI2C_SlaveBusBusyFlag can be enabled as - * interrupts. - * - * @note These enumerations are meant to be OR'd together to form a bit mask. - */ -enum _lpi2c_slave_flags -{ - kLPI2C_SlaveTxReadyFlag = LPI2C_SSR_TDF_MASK, /*!< Transmit data flag */ - kLPI2C_SlaveRxReadyFlag = LPI2C_SSR_RDF_MASK, /*!< Receive data flag */ - kLPI2C_SlaveAddressValidFlag = LPI2C_SSR_AVF_MASK, /*!< Address valid flag */ - kLPI2C_SlaveTransmitAckFlag = LPI2C_SSR_TAF_MASK, /*!< Transmit ACK flag */ - kLPI2C_SlaveRepeatedStartDetectFlag = LPI2C_SSR_RSF_MASK, /*!< Repeated start detect flag */ - kLPI2C_SlaveStopDetectFlag = LPI2C_SSR_SDF_MASK, /*!< Stop detect flag */ - kLPI2C_SlaveBitErrFlag = LPI2C_SSR_BEF_MASK, /*!< Bit error flag */ - kLPI2C_SlaveFifoErrFlag = LPI2C_SSR_FEF_MASK, /*!< FIFO error flag */ - kLPI2C_SlaveAddressMatch0Flag = LPI2C_SSR_AM0F_MASK, /*!< Address match 0 flag */ - kLPI2C_SlaveAddressMatch1Flag = LPI2C_SSR_AM1F_MASK, /*!< Address match 1 flag */ - kLPI2C_SlaveGeneralCallFlag = LPI2C_SSR_GCF_MASK, /*!< General call flag */ - kLPI2C_SlaveBusyFlag = LPI2C_SSR_SBF_MASK, /*!< Master busy flag */ - kLPI2C_SlaveBusBusyFlag = LPI2C_SSR_BBF_MASK, /*!< Bus busy flag */ - /*! All flags which are cleared by the driver upon starting a transfer. */ - kLPI2C_SlaveClearFlags = kLPI2C_SlaveRepeatedStartDetectFlag | kLPI2C_SlaveStopDetectFlag | kLPI2C_SlaveBitErrFlag | - kLPI2C_SlaveFifoErrFlag, - /*! IRQ sources enabled by the non-blocking transactional API. */ - kLPI2C_SlaveIrqFlags = kLPI2C_SlaveTxReadyFlag | kLPI2C_SlaveRxReadyFlag | kLPI2C_SlaveStopDetectFlag | - kLPI2C_SlaveRepeatedStartDetectFlag | kLPI2C_SlaveFifoErrFlag | kLPI2C_SlaveBitErrFlag | - kLPI2C_SlaveTransmitAckFlag | kLPI2C_SlaveAddressValidFlag, - /*! Errors to check for. */ - kLPI2C_SlaveErrorFlags = kLPI2C_SlaveFifoErrFlag | kLPI2C_SlaveBitErrFlag -}; - -/*! @brief LPI2C slave address match options. */ -typedef enum _lpi2c_slave_address_match -{ - kLPI2C_MatchAddress0 = 0U, /*!< Match only address 0. */ - kLPI2C_MatchAddress0OrAddress1 = 2U, /*!< Match either address 0 or address 1. */ - kLPI2C_MatchAddress0ThroughAddress1 = 6U, /*!< Match a range of slave addresses from address 0 through address 1. */ -} lpi2c_slave_address_match_t; - -/*! - * @brief Structure with settings to initialize the LPI2C slave module. - * - * This structure holds configuration settings for the LPI2C slave peripheral. To initialize this - * structure to reasonable defaults, call the LPI2C_SlaveGetDefaultConfig() function and - * pass a pointer to your configuration structure instance. - * - * The configuration structure can be made constant so it resides in flash. - */ -typedef struct _lpi2c_slave_config -{ - bool enableSlave; /*!< Enable slave mode. */ - uint8_t address0; /*!< Slave's 7-bit address. */ - uint8_t address1; /*!< Alternate slave 7-bit address. */ - lpi2c_slave_address_match_t addressMatchMode; /*!< Address matching options. */ - bool filterDozeEnable; /*!< Enable digital glitch filter in doze mode. */ - bool filterEnable; /*!< Enable digital glitch filter. */ - bool enableGeneralCall; /*!< Enable general call address matching. */ - struct - { - bool enableAck; /*!< Enables SCL clock stretching during slave-transmit address byte(s) - and slave-receiver address and data byte(s) to allow software to - write the Transmit ACK Register before the ACK or NACK is transmitted. - Clock stretching occurs when transmitting the 9th bit. When - enableAckSCLStall is enabled, there is no need to set either - enableRxDataSCLStall or enableAddressSCLStall. */ - bool enableTx; /*!< Enables SCL clock stretching when the transmit data flag is set - during a slave-transmit transfer. */ - bool enableRx; /*!< Enables SCL clock stretching when receive data flag is set during - a slave-receive transfer. */ - bool enableAddress; /*!< Enables SCL clock stretching when the address valid flag is asserted. */ - } sclStall; - bool ignoreAck; /*!< Continue transfers after a NACK is detected. */ - bool enableReceivedAddressRead; /*!< Enable reading the address received address as the first byte of data. */ - uint32_t sdaGlitchFilterWidth_ns; /*!< Width in nanoseconds of the digital filter on the SDA signal. Set to 0 to - disable. */ - uint32_t sclGlitchFilterWidth_ns; /*!< Width in nanoseconds of the digital filter on the SCL signal. Set to 0 to - disable. */ - uint32_t dataValidDelay_ns; /*!< Width in nanoseconds of the data valid delay. */ - uint32_t clockHoldTime_ns; /*!< Width in nanoseconds of the clock hold time. */ -} lpi2c_slave_config_t; - -/*! - * @brief Set of events sent to the callback for non blocking slave transfers. - * - * These event enumerations are used for two related purposes. First, a bit mask created by OR'ing together - * events is passed to LPI2C_SlaveTransferNonBlocking() in order to specify which events to enable. - * Then, when the slave callback is invoked, it is passed the current event through its @a transfer - * parameter. - * - * @note These enumerations are meant to be OR'd together to form a bit mask of events. - */ -typedef enum _lpi2c_slave_transfer_event -{ - kLPI2C_SlaveAddressMatchEvent = 0x01U, /*!< Received the slave address after a start or repeated start. */ - kLPI2C_SlaveTransmitEvent = 0x02U, /*!< Callback is requested to provide data to transmit - (slave-transmitter role). */ - kLPI2C_SlaveReceiveEvent = 0x04U, /*!< Callback is requested to provide a buffer in which to place received - data (slave-receiver role). */ - kLPI2C_SlaveTransmitAckEvent = 0x08U, /*!< Callback needs to either transmit an ACK or NACK. - When this event is set, the driver will no longer decide to reply to ack/nack. */ - kLPI2C_SlaveRepeatedStartEvent = 0x10U, /*!< A repeated start was detected. */ - kLPI2C_SlaveCompletionEvent = 0x20U, /*!< A stop was detected, completing the transfer. */ - - /*! Bit mask of all available events. */ - kLPI2C_SlaveAllEvents = kLPI2C_SlaveAddressMatchEvent | kLPI2C_SlaveTransmitEvent | kLPI2C_SlaveReceiveEvent | - kLPI2C_SlaveTransmitAckEvent | kLPI2C_SlaveRepeatedStartEvent | kLPI2C_SlaveCompletionEvent, -} lpi2c_slave_transfer_event_t; - -/*! @brief LPI2C slave transfer structure */ -typedef struct _lpi2c_slave_transfer -{ - lpi2c_slave_transfer_event_t event; /*!< Reason the callback is being invoked. */ - uint8_t receivedAddress; /*!< Matching address send by master. */ - uint8_t *data; /*!< Transfer buffer */ - size_t dataSize; /*!< Transfer size */ - status_t completionStatus; /*!< Success or error code describing how the transfer completed. Only applies for - #kLPI2C_SlaveCompletionEvent. */ - size_t transferredCount; /*!< Number of bytes actually transferred since start or last repeated start. */ -} lpi2c_slave_transfer_t; - -/* Forward declaration. */ -typedef struct _lpi2c_slave_handle lpi2c_slave_handle_t; - -/*! - * @brief Slave event callback function pointer type. - * - * This callback is used only for the slave non-blocking transfer API. To install a callback, - * use the LPI2C_SlaveSetCallback() function after you have created a handle. - * - * @param base Base address for the LPI2C instance on which the event occurred. - * @param transfer Pointer to transfer descriptor containing values passed to and/or from the callback. - * @param userData Arbitrary pointer-sized value passed from the application. - */ -typedef void (*lpi2c_slave_transfer_callback_t)(LPI2C_Type *base, lpi2c_slave_transfer_t *transfer, void *userData); - -/*! - * @brief LPI2C slave handle structure. - * @note The contents of this structure are private and subject to change. - */ -struct _lpi2c_slave_handle -{ - lpi2c_slave_transfer_t transfer; /*!< LPI2C slave transfer copy. */ - bool isBusy; /*!< Whether transfer is busy. */ - bool wasTransmit; /*!< Whether the last transfer was a transmit. */ - uint32_t eventMask; /*!< Mask of enabled events. */ - uint32_t transferredCount; /*!< Count of bytes transferred. */ - lpi2c_slave_transfer_callback_t callback; /*!< Callback function called at transfer event. */ - void *userData; /*!< Callback parameter passed to callback. */ -}; - -/*! @} */ - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! Array to map LPI2C instance number to IRQ number, used internally for LPI2C master interrupt and EDMA transactional -APIs. */ -extern IRQn_Type const kLpi2cIrqs[]; - -/*! Pointer to master IRQ handler for each instance, used internally for LPI2C master interrupt and EDMA transactional -APIs. */ -extern lpi2c_master_isr_t s_lpi2cMasterIsr; - -/*! Pointers to master handles for each instance, used internally for LPI2C master interrupt and EDMA transactional -APIs. */ -extern void *s_lpi2cMasterHandle[]; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @brief Returns an instance number given a base address. - * - * If an invalid base address is passed, debug builds will assert. Release builds will just return - * instance number 0. - * - * @param base The LPI2C peripheral base address. - * @return LPI2C instance number starting from 0. - */ -uint32_t LPI2C_GetInstance(LPI2C_Type *base); - -/*! - * @addtogroup lpi2c_master_driver - * @{ - */ - -/*! @name Initialization and deinitialization */ -/*! @{ */ - -/*! - * @brief Provides a default configuration for the LPI2C master peripheral. - * - * This function provides the following default configuration for the LPI2C master peripheral: - * @code - * masterConfig->enableMaster = true; - * masterConfig->debugEnable = false; - * masterConfig->ignoreAck = false; - * masterConfig->pinConfig = kLPI2C_2PinOpenDrain; - * masterConfig->baudRate_Hz = 100000U; - * masterConfig->busIdleTimeout_ns = 0; - * masterConfig->pinLowTimeout_ns = 0; - * masterConfig->sdaGlitchFilterWidth_ns = 0; - * masterConfig->sclGlitchFilterWidth_ns = 0; - * masterConfig->hostRequest.enable = false; - * masterConfig->hostRequest.source = kLPI2C_HostRequestExternalPin; - * masterConfig->hostRequest.polarity = kLPI2C_HostRequestPinActiveHigh; - * @endcode - * - * After calling this function, you can override any settings in order to customize the configuration, - * prior to initializing the master driver with LPI2C_MasterInit(). - * - * @param[out] masterConfig User provided configuration structure for default values. Refer to #lpi2c_master_config_t. - */ -void LPI2C_MasterGetDefaultConfig(lpi2c_master_config_t *masterConfig); - -/*! - * @brief Initializes the LPI2C master peripheral. - * - * This function enables the peripheral clock and initializes the LPI2C master peripheral as described by the user - * provided configuration. A software reset is performed prior to configuration. - * - * @param base The LPI2C peripheral base address. - * @param masterConfig User provided peripheral configuration. Use LPI2C_MasterGetDefaultConfig() to get a set of - * defaults - * that you can override. - * @param sourceClock_Hz Frequency in Hertz of the LPI2C functional clock. Used to calculate the baud rate divisors, - * filter widths, and timeout periods. - */ -void LPI2C_MasterInit(LPI2C_Type *base, const lpi2c_master_config_t *masterConfig, uint32_t sourceClock_Hz); - -/*! - * @brief Deinitializes the LPI2C master peripheral. - * - * This function disables the LPI2C master peripheral and gates the clock. It also performs a software - * reset to restore the peripheral to reset conditions. - * - * @param base The LPI2C peripheral base address. - */ -void LPI2C_MasterDeinit(LPI2C_Type *base); - -/*! - * @brief Configures LPI2C master data match feature. - * - * @param base The LPI2C peripheral base address. - * @param matchConfig Settings for the data match feature. - */ -void LPI2C_MasterConfigureDataMatch(LPI2C_Type *base, const lpi2c_data_match_config_t *matchConfig); - -/* Not static so it can be used from fsl_lpi2c_edma.c. */ -status_t LPI2C_MasterCheckAndClearError(LPI2C_Type *base, uint32_t status); - -/* Not static so it can be used from fsl_lpi2c_edma.c. */ -status_t LPI2C_CheckForBusyBus(LPI2C_Type *base); - -/*! - * @brief Performs a software reset. - * - * Restores the LPI2C master peripheral to reset conditions. - * - * @param base The LPI2C peripheral base address. - */ -static inline void LPI2C_MasterReset(LPI2C_Type *base) -{ - base->MCR = LPI2C_MCR_RST_MASK; - base->MCR = 0; -} - -/*! - * @brief Enables or disables the LPI2C module as master. - * - * @param base The LPI2C peripheral base address. - * @param enable Pass true to enable or false to disable the specified LPI2C as master. - */ -static inline void LPI2C_MasterEnable(LPI2C_Type *base, bool enable) -{ - base->MCR = (base->MCR & ~LPI2C_MCR_MEN_MASK) | LPI2C_MCR_MEN(enable); -} - -/*! @} */ - -/*! @name Status */ -/*! @{ */ - -/*! - * @brief Gets the LPI2C master status flags. - * - * A bit mask with the state of all LPI2C master status flags is returned. For each flag, the corresponding bit - * in the return value is set if the flag is asserted. - * - * @param base The LPI2C peripheral base address. - * @return State of the status flags: - * - 1: related status flag is set. - * - 0: related status flag is not set. - * @see _lpi2c_master_flags - */ -static inline uint32_t LPI2C_MasterGetStatusFlags(LPI2C_Type *base) -{ - return base->MSR; -} - -/*! - * @brief Clears the LPI2C master status flag state. - * - * The following status register flags can be cleared: - * - #kLPI2C_MasterEndOfPacketFlag - * - #kLPI2C_MasterStopDetectFlag - * - #kLPI2C_MasterNackDetectFlag - * - #kLPI2C_MasterArbitrationLostFlag - * - #kLPI2C_MasterFifoErrFlag - * - #kLPI2C_MasterPinLowTimeoutFlag - * - #kLPI2C_MasterDataMatchFlag - * - * Attempts to clear other flags has no effect. - * - * @param base The LPI2C peripheral base address. - * @param statusMask A bitmask of status flags that are to be cleared. The mask is composed of - * _lpi2c_master_flags enumerators OR'd together. You may pass the result of a previous call to - * LPI2C_MasterGetStatusFlags(). - * @see _lpi2c_master_flags. - */ -static inline void LPI2C_MasterClearStatusFlags(LPI2C_Type *base, uint32_t statusMask) -{ - base->MSR = statusMask; -} - -/*! @} */ - -/*! @name Interrupts */ -/*! @{ */ - -/*! - * @brief Enables the LPI2C master interrupt requests. - * - * All flags except #kLPI2C_MasterBusyFlag and #kLPI2C_MasterBusBusyFlag can be enabled as - * interrupts. - * - * @param base The LPI2C peripheral base address. - * @param interruptMask Bit mask of interrupts to enable. See _lpi2c_master_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void LPI2C_MasterEnableInterrupts(LPI2C_Type *base, uint32_t interruptMask) -{ - base->MIER |= interruptMask; -} - -/*! - * @brief Disables the LPI2C master interrupt requests. - * - * All flags except #kLPI2C_MasterBusyFlag and #kLPI2C_MasterBusBusyFlag can be enabled as - * interrupts. - * - * @param base The LPI2C peripheral base address. - * @param interruptMask Bit mask of interrupts to disable. See _lpi2c_master_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void LPI2C_MasterDisableInterrupts(LPI2C_Type *base, uint32_t interruptMask) -{ - base->MIER &= ~interruptMask; -} - -/*! - * @brief Returns the set of currently enabled LPI2C master interrupt requests. - * - * @param base The LPI2C peripheral base address. - * @return A bitmask composed of _lpi2c_master_flags enumerators OR'd together to indicate the - * set of enabled interrupts. - */ -static inline uint32_t LPI2C_MasterGetEnabledInterrupts(LPI2C_Type *base) -{ - return base->MIER; -} - -/*! @} */ - -/*! @name DMA control */ -/*! @{ */ - -/*! - * @brief Enables or disables LPI2C master DMA requests. - * - * @param base The LPI2C peripheral base address. - * @param enableTx Enable flag for transmit DMA request. Pass true for enable, false for disable. - * @param enableRx Enable flag for receive DMA request. Pass true for enable, false for disable. - */ -static inline void LPI2C_MasterEnableDMA(LPI2C_Type *base, bool enableTx, bool enableRx) -{ - base->MDER = LPI2C_MDER_TDDE(enableTx) | LPI2C_MDER_RDDE(enableRx); -} - -/*! - * @brief Gets LPI2C master transmit data register address for DMA transfer. - * - * @param base The LPI2C peripheral base address. - * @return The LPI2C Master Transmit Data Register address. - */ -static inline uint32_t LPI2C_MasterGetTxFifoAddress(LPI2C_Type *base) -{ - return (uint32_t)&base->MTDR; -} - -/*! - * @brief Gets LPI2C master receive data register address for DMA transfer. - * - * @param base The LPI2C peripheral base address. - * @return The LPI2C Master Receive Data Register address. - */ -static inline uint32_t LPI2C_MasterGetRxFifoAddress(LPI2C_Type *base) -{ - return (uint32_t)&base->MRDR; -} - -/*! @} */ - -/*! @name FIFO control */ -/*! @{ */ - -/*! - * @brief Sets the watermarks for LPI2C master FIFOs. - * - * @param base The LPI2C peripheral base address. - * @param txWords Transmit FIFO watermark value in words. The #kLPI2C_MasterTxReadyFlag flag is set whenever - * the number of words in the transmit FIFO is equal or less than @a txWords. Writing a value equal or - * greater than the FIFO size is truncated. - * @param rxWords Receive FIFO watermark value in words. The #kLPI2C_MasterRxReadyFlag flag is set whenever - * the number of words in the receive FIFO is greater than @a rxWords. Writing a value equal or greater - * than the FIFO size is truncated. - */ -static inline void LPI2C_MasterSetWatermarks(LPI2C_Type *base, size_t txWords, size_t rxWords) -{ - base->MFCR = LPI2C_MFCR_TXWATER(txWords) | LPI2C_MFCR_RXWATER(rxWords); -} - -/*! - * @brief Gets the current number of words in the LPI2C master FIFOs. - * - * @param base The LPI2C peripheral base address. - * @param[out] txCount Pointer through which the current number of words in the transmit FIFO is returned. - * Pass NULL if this value is not required. - * @param[out] rxCount Pointer through which the current number of words in the receive FIFO is returned. - * Pass NULL if this value is not required. - */ -static inline void LPI2C_MasterGetFifoCounts(LPI2C_Type *base, size_t *rxCount, size_t *txCount) -{ - if (NULL != txCount) - { - *txCount = (base->MFSR & LPI2C_MFSR_TXCOUNT_MASK) >> LPI2C_MFSR_TXCOUNT_SHIFT; - } - if (NULL != rxCount) - { - *rxCount = (base->MFSR & LPI2C_MFSR_RXCOUNT_MASK) >> LPI2C_MFSR_RXCOUNT_SHIFT; - } -} - -/*! @} */ - -/*! @name Bus operations */ -/*! @{ */ - -/*! - * @brief Sets the I2C bus frequency for master transactions. - * - * The LPI2C master is automatically disabled and re-enabled as necessary to configure the baud - * rate. Do not call this function during a transfer, or the transfer is aborted. - * - * @note Please note that the second parameter is the clock frequency of LPI2C module, the third - * parameter means user configured bus baudrate, this implementation is different from other I2C drivers - * which use baudrate configuration as second parameter and source clock frequency as third parameter. - * - * @param base The LPI2C peripheral base address. - * @param sourceClock_Hz LPI2C functional clock frequency in Hertz. - * @param baudRate_Hz Requested bus frequency in Hertz. - */ -void LPI2C_MasterSetBaudRate(LPI2C_Type *base, uint32_t sourceClock_Hz, uint32_t baudRate_Hz); - -/*! - * @brief Returns whether the bus is idle. - * - * Requires the master mode to be enabled. - * - * @param base The LPI2C peripheral base address. - * @retval true Bus is busy. - * @retval false Bus is idle. - */ -static inline bool LPI2C_MasterGetBusIdleState(LPI2C_Type *base) -{ - return ((base->MSR & LPI2C_MSR_BBF_MASK) >> LPI2C_MSR_BBF_SHIFT) == 1U ? true : false; -} - -/*! - * @brief Sends a START signal and slave address on the I2C bus. - * - * This function is used to initiate a new master mode transfer. First, the bus state is checked to ensure - * that another master is not occupying the bus. Then a START signal is transmitted, followed by the - * 7-bit address specified in the @a address parameter. Note that this function does not actually wait - * until the START and address are successfully sent on the bus before returning. - * - * @param base The LPI2C peripheral base address. - * @param address 7-bit slave device address, in bits [6:0]. - * @param dir Master transfer direction, either #kLPI2C_Read or #kLPI2C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * @retval kStatus_Success START signal and address were successfully enqueued in the transmit FIFO. - * @retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - */ -status_t LPI2C_MasterStart(LPI2C_Type *base, uint8_t address, lpi2c_direction_t dir); - -/*! - * @brief Sends a repeated START signal and slave address on the I2C bus. - * - * This function is used to send a Repeated START signal when a transfer is already in progress. Like - * LPI2C_MasterStart(), it also sends the specified 7-bit address. - * - * @note This function exists primarily to maintain compatible APIs between LPI2C and I2C drivers, - * as well as to better document the intent of code that uses these APIs. - * - * @param base The LPI2C peripheral base address. - * @param address 7-bit slave device address, in bits [6:0]. - * @param dir Master transfer direction, either #kLPI2C_Read or #kLPI2C_Write. This parameter is used to set - * the R/w bit (bit 0) in the transmitted slave address. - * @retval kStatus_Success Repeated START signal and address were successfully enqueued in the transmit FIFO. - * @retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - */ -static inline status_t LPI2C_MasterRepeatedStart(LPI2C_Type *base, uint8_t address, lpi2c_direction_t dir) -{ - return LPI2C_MasterStart(base, address, dir); -} - -/*! - * @brief Performs a polling send transfer on the I2C bus. - * - * Sends up to @a txSize number of bytes to the previously addressed slave device. The slave may - * reply with a NAK to any byte in order to terminate the transfer early. If this happens, this - * function returns #kStatus_LPI2C_Nak. - * - * @param base The LPI2C peripheral base address. - * @param txBuff The pointer to the data to be transferred. - * @param txSize The length in bytes of the data to be transferred. - * @retval kStatus_Success Data was sent successfully. - * @retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * @retval #kStatus_LPI2C_FifoError FIFO under run or over run. - * @retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * @retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterSend(LPI2C_Type *base, void *txBuff, size_t txSize); - -/*! - * @brief Performs a polling receive transfer on the I2C bus. - * - * @param base The LPI2C peripheral base address. - * @param rxBuff The pointer to the data to be transferred. - * @param rxSize The length in bytes of the data to be transferred. - * @retval kStatus_Success Data was received successfully. - * @retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * @retval #kStatus_LPI2C_FifoError FIFO under run or overrun. - * @retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * @retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterReceive(LPI2C_Type *base, void *rxBuff, size_t rxSize); - -/*! - * @brief Sends a STOP signal on the I2C bus. - * - * This function does not return until the STOP signal is seen on the bus, or an error occurs. - * - * @param base The LPI2C peripheral base address. - * @retval kStatus_Success The STOP signal was successfully sent on the bus and the transaction terminated. - * @retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * @retval #kStatus_LPI2C_FifoError FIFO under run or overrun. - * @retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * @retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterStop(LPI2C_Type *base); - -/*! - * @brief Performs a master polling transfer on the I2C bus. - * - * @note The API does not return until the transfer succeeds or fails due - * to error happens during transfer. - * - * @param base The LPI2C peripheral base address. - * @param transfer Pointer to the transfer structure. - * @retval kStatus_Success Data was received successfully. - * @retval #kStatus_LPI2C_Busy Another master is currently utilizing the bus. - * @retval #kStatus_LPI2C_Nak The slave device sent a NAK in response to a byte. - * @retval #kStatus_LPI2C_FifoError FIFO under run or overrun. - * @retval #kStatus_LPI2C_ArbitrationLost Arbitration lost error. - * @retval #kStatus_LPI2C_PinLowTimeout SCL or SDA were held low longer than the timeout. - */ -status_t LPI2C_MasterTransferBlocking(LPI2C_Type *base, lpi2c_master_transfer_t *transfer); - -/*! @} */ - -/*! @name Non-blocking */ -/*! @{ */ - -/*! - * @brief Creates a new handle for the LPI2C master non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the LPI2C_MasterTransferAbort() API shall be called. - * - * - * @note The function also enables the NVIC IRQ for the input LPI2C. Need to notice - * that on some SoCs the LPI2C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - * - * @param base The LPI2C peripheral base address. - * @param[out] handle Pointer to the LPI2C master driver handle. - * @param callback User provided pointer to the asynchronous callback function. - * @param userData User provided pointer to the application callback data. - */ -void LPI2C_MasterTransferCreateHandle(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_master_transfer_callback_t callback, - void *userData); - -/*! - * @brief Performs a non-blocking transaction on the I2C bus. - * - * @param base The LPI2C peripheral base address. - * @param handle Pointer to the LPI2C master driver handle. - * @param transfer The pointer to the transfer descriptor. - * @retval kStatus_Success The transaction was started successfully. - * @retval #kStatus_LPI2C_Busy Either another master is currently utilizing the bus, or a non-blocking - * transaction is already in progress. - */ -status_t LPI2C_MasterTransferNonBlocking(LPI2C_Type *base, - lpi2c_master_handle_t *handle, - lpi2c_master_transfer_t *transfer); - -/*! - * @brief Returns number of bytes transferred so far. - * @param base The LPI2C peripheral base address. - * @param handle Pointer to the LPI2C master driver handle. - * @param[out] count Number of bytes transferred so far by the non-blocking transaction. - * @retval kStatus_Success - * @retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t LPI2C_MasterTransferGetCount(LPI2C_Type *base, lpi2c_master_handle_t *handle, size_t *count); - -/*! - * @brief Terminates a non-blocking LPI2C master transmission early. - * - * @note It is not safe to call this function from an IRQ handler that has a higher priority than the - * LPI2C peripheral's IRQ priority. - * - * @param base The LPI2C peripheral base address. - * @param handle Pointer to the LPI2C master driver handle. - * @retval kStatus_Success A transaction was successfully aborted. - * @retval #kStatus_LPI2C_Idle There is not a non-blocking transaction currently in progress. - */ -void LPI2C_MasterTransferAbort(LPI2C_Type *base, lpi2c_master_handle_t *handle); - -/*! @} */ - -/*! @name IRQ handler */ -/*! @{ */ - -/*! - * @brief Reusable routine to handle master interrupts. - * @note This function does not need to be called unless you are reimplementing the - * nonblocking API's interrupt handler routines to add special functionality. - * @param instance The LPI2C instance. - * @param lpi2cMasterHandle Pointer to the LPI2C master driver handle. - */ -void LPI2C_MasterTransferHandleIRQ(uint32_t instance, void *lpi2cMasterHandle); - -/*! @} */ - -/*! @} */ - -/*! - * @addtogroup lpi2c_slave_driver - * @{ - */ - -/*! @name Slave initialization and deinitialization */ -/*! @{ */ - -/*! - * @brief Provides a default configuration for the LPI2C slave peripheral. - * - * This function provides the following default configuration for the LPI2C slave peripheral: - * @code - * slaveConfig->enableSlave = true; - * slaveConfig->address0 = 0U; - * slaveConfig->address1 = 0U; - * slaveConfig->addressMatchMode = kLPI2C_MatchAddress0; - * slaveConfig->filterDozeEnable = true; - * slaveConfig->filterEnable = true; - * slaveConfig->enableGeneralCall = false; - * slaveConfig->sclStall.enableAck = false; - * slaveConfig->sclStall.enableTx = true; - * slaveConfig->sclStall.enableRx = true; - * slaveConfig->sclStall.enableAddress = true; - * slaveConfig->ignoreAck = false; - * slaveConfig->enableReceivedAddressRead = false; - * slaveConfig->sdaGlitchFilterWidth_ns = 0; - * slaveConfig->sclGlitchFilterWidth_ns = 0; - * slaveConfig->dataValidDelay_ns = 0; - * slaveConfig->clockHoldTime_ns = 0; - * @endcode - * - * After calling this function, override any settings to customize the configuration, - * prior to initializing the master driver with LPI2C_SlaveInit(). Be sure to override at least the @a - * address0 member of the configuration structure with the desired slave address. - * - * @param[out] slaveConfig User provided configuration structure that is set to default values. Refer to - * #lpi2c_slave_config_t. - */ -void LPI2C_SlaveGetDefaultConfig(lpi2c_slave_config_t *slaveConfig); - -/*! - * @brief Initializes the LPI2C slave peripheral. - * - * This function enables the peripheral clock and initializes the LPI2C slave peripheral as described by the user - * provided configuration. - * - * @param base The LPI2C peripheral base address. - * @param slaveConfig User provided peripheral configuration. Use LPI2C_SlaveGetDefaultConfig() to get a set of defaults - * that you can override. - * @param sourceClock_Hz Frequency in Hertz of the LPI2C functional clock. Used to calculate the filter widths, - * data valid delay, and clock hold time. - */ -void LPI2C_SlaveInit(LPI2C_Type *base, const lpi2c_slave_config_t *slaveConfig, uint32_t sourceClock_Hz); - -/*! - * @brief Deinitializes the LPI2C slave peripheral. - * - * This function disables the LPI2C slave peripheral and gates the clock. It also performs a software - * reset to restore the peripheral to reset conditions. - * - * @param base The LPI2C peripheral base address. - */ -void LPI2C_SlaveDeinit(LPI2C_Type *base); - -/*! - * @brief Performs a software reset of the LPI2C slave peripheral. - * - * @param base The LPI2C peripheral base address. - */ -static inline void LPI2C_SlaveReset(LPI2C_Type *base) -{ - base->SCR = LPI2C_SCR_RST_MASK; - base->SCR = 0; -} - -/*! - * @brief Enables or disables the LPI2C module as slave. - * - * @param base The LPI2C peripheral base address. - * @param enable Pass true to enable or false to disable the specified LPI2C as slave. - */ -static inline void LPI2C_SlaveEnable(LPI2C_Type *base, bool enable) -{ - base->SCR = (base->SCR & ~LPI2C_SCR_SEN_MASK) | LPI2C_SCR_SEN(enable); -} - -/*! @} */ - -/*! @name Slave status */ -/*! @{ */ - -/*! - * @brief Gets the LPI2C slave status flags. - * - * A bit mask with the state of all LPI2C slave status flags is returned. For each flag, the corresponding bit - * in the return value is set if the flag is asserted. - * - * @param base The LPI2C peripheral base address. - * @return State of the status flags: - * - 1: related status flag is set. - * - 0: related status flag is not set. - * @see _lpi2c_slave_flags - */ -static inline uint32_t LPI2C_SlaveGetStatusFlags(LPI2C_Type *base) -{ - return base->SSR; -} - -/*! - * @brief Clears the LPI2C status flag state. - * - * The following status register flags can be cleared: - * - #kLPI2C_SlaveRepeatedStartDetectFlag - * - #kLPI2C_SlaveStopDetectFlag - * - #kLPI2C_SlaveBitErrFlag - * - #kLPI2C_SlaveFifoErrFlag - * - * Attempts to clear other flags has no effect. - * - * @param base The LPI2C peripheral base address. - * @param statusMask A bitmask of status flags that are to be cleared. The mask is composed of - * #_lpi2c_slave_flags enumerators OR'd together. You may pass the result of a previous call to - * LPI2C_SlaveGetStatusFlags(). - * @see _lpi2c_slave_flags. - */ -static inline void LPI2C_SlaveClearStatusFlags(LPI2C_Type *base, uint32_t statusMask) -{ - base->SSR = statusMask; -} - -/*! @} */ - -/*! @name Slave interrupts */ -/*! @{ */ - -/*! - * @brief Enables the LPI2C slave interrupt requests. - * - * All flags except #kLPI2C_SlaveBusyFlag and #kLPI2C_SlaveBusBusyFlag can be enabled as - * interrupts. - * - * @param base The LPI2C peripheral base address. - * @param interruptMask Bit mask of interrupts to enable. See #_lpi2c_slave_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void LPI2C_SlaveEnableInterrupts(LPI2C_Type *base, uint32_t interruptMask) -{ - base->SIER |= interruptMask; -} - -/*! - * @brief Disables the LPI2C slave interrupt requests. - * - * All flags except #kLPI2C_SlaveBusyFlag and #kLPI2C_SlaveBusBusyFlag can be enabled as - * interrupts. - * - * @param base The LPI2C peripheral base address. - * @param interruptMask Bit mask of interrupts to disable. See #_lpi2c_slave_flags for the set - * of constants that should be OR'd together to form the bit mask. - */ -static inline void LPI2C_SlaveDisableInterrupts(LPI2C_Type *base, uint32_t interruptMask) -{ - base->SIER &= ~interruptMask; -} - -/*! - * @brief Returns the set of currently enabled LPI2C slave interrupt requests. - * @param base The LPI2C peripheral base address. - * @return A bitmask composed of #_lpi2c_slave_flags enumerators OR'd together to indicate the - * set of enabled interrupts. - */ -static inline uint32_t LPI2C_SlaveGetEnabledInterrupts(LPI2C_Type *base) -{ - return base->SIER; -} - -/*! @} */ - -/*! @name Slave DMA control */ -/*! @{ */ - -/*! - * @brief Enables or disables the LPI2C slave peripheral DMA requests. - * - * @param base The LPI2C peripheral base address. - * @param enableAddressValid Enable flag for the address valid DMA request. Pass true for enable, false for disable. - * The address valid DMA request is shared with the receive data DMA request. - * @param enableRx Enable flag for the receive data DMA request. Pass true for enable, false for disable. - * @param enableTx Enable flag for the transmit data DMA request. Pass true for enable, false for disable. - */ -static inline void LPI2C_SlaveEnableDMA(LPI2C_Type *base, bool enableAddressValid, bool enableRx, bool enableTx) -{ - base->SDER = (base->SDER & ~(LPI2C_SDER_AVDE_MASK | LPI2C_SDER_RDDE_MASK | LPI2C_SDER_TDDE_MASK)) | - LPI2C_SDER_AVDE(enableAddressValid) | LPI2C_SDER_RDDE(enableRx) | LPI2C_SDER_TDDE(enableTx); -} - -/*! @} */ - -/*! @name Slave bus operations */ -/*! @{ */ - -/*! - * @brief Returns whether the bus is idle. - * - * Requires the slave mode to be enabled. - * - * @param base The LPI2C peripheral base address. - * @retval true Bus is busy. - * @retval false Bus is idle. - */ -static inline bool LPI2C_SlaveGetBusIdleState(LPI2C_Type *base) -{ - return ((base->SSR & LPI2C_SSR_BBF_MASK) >> LPI2C_SSR_BBF_SHIFT) == 1U ? true : false; -} - -/*! - * @brief Transmits either an ACK or NAK on the I2C bus in response to a byte from the master. - * - * Use this function to send an ACK or NAK when the #kLPI2C_SlaveTransmitAckFlag is asserted. This - * only happens if you enable the sclStall.enableAck field of the ::lpi2c_slave_config_t configuration - * structure used to initialize the slave peripheral. - * - * @param base The LPI2C peripheral base address. - * @param ackOrNack Pass true for an ACK or false for a NAK. - */ -static inline void LPI2C_SlaveTransmitAck(LPI2C_Type *base, bool ackOrNack) -{ - base->STAR = LPI2C_STAR_TXNACK(!ackOrNack); -} - -/*! - * @brief Enables or disables ACKSTALL. - * - * When enables ACKSTALL, software can transmit either an ACK or NAK on the I2C bus in response to - * a byte from the master. - * - * @param base The LPI2C peripheral base address. - * @param enable True will enable ACKSTALL,false will disable ACKSTALL. - */ -static inline void LPI2C_SlaveEnableAckStall(LPI2C_Type *base, bool enable) -{ - if (enable) - { - base->SCFGR1 |= LPI2C_SCFGR1_ACKSTALL_MASK; - } - else - { - base->SCFGR1 &= ~LPI2C_SCFGR1_ACKSTALL_MASK; - } -} - -/*! - * @brief Returns the slave address sent by the I2C master. - * - * This function should only be called if the #kLPI2C_SlaveAddressValidFlag is asserted. - * - * @param base The LPI2C peripheral base address. - * @return The 8-bit address matched by the LPI2C slave. Bit 0 contains the R/w direction bit, and - * the 7-bit slave address is in the upper 7 bits. - */ -static inline uint32_t LPI2C_SlaveGetReceivedAddress(LPI2C_Type *base) -{ - return base->SASR & LPI2C_SASR_RADDR_MASK; -} - -/*! - * @brief Performs a polling send transfer on the I2C bus. - * - * @param base The LPI2C peripheral base address. - * @param txBuff The pointer to the data to be transferred. - * @param txSize The length in bytes of the data to be transferred. - * @param[out] actualTxSize - * @return Error or success status returned by API. - */ -status_t LPI2C_SlaveSend(LPI2C_Type *base, void *txBuff, size_t txSize, size_t *actualTxSize); - -/*! - * @brief Performs a polling receive transfer on the I2C bus. - * - * @param base The LPI2C peripheral base address. - * @param rxBuff The pointer to the data to be transferred. - * @param rxSize The length in bytes of the data to be transferred. - * @param[out] actualRxSize - * @return Error or success status returned by API. - */ -status_t LPI2C_SlaveReceive(LPI2C_Type *base, void *rxBuff, size_t rxSize, size_t *actualRxSize); - -/*! @} */ - -/*! @name Slave non-blocking */ -/*! @{ */ - -/*! - * @brief Creates a new handle for the LPI2C slave non-blocking APIs. - * - * The creation of a handle is for use with the non-blocking APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the LPI2C_SlaveTransferAbort() API shall be called. - * - * @note The function also enables the NVIC IRQ for the input LPI2C. Need to notice - * that on some SoCs the LPI2C IRQ is connected to INTMUX, in this case user needs to - * enable the associated INTMUX IRQ in application. - - * @param base The LPI2C peripheral base address. - * @param[out] handle Pointer to the LPI2C slave driver handle. - * @param callback User provided pointer to the asynchronous callback function. - * @param userData User provided pointer to the application callback data. - */ -void LPI2C_SlaveTransferCreateHandle(LPI2C_Type *base, - lpi2c_slave_handle_t *handle, - lpi2c_slave_transfer_callback_t callback, - void *userData); - -/*! - * @brief Starts accepting slave transfers. - * - * Call this API after calling I2C_SlaveInit() and LPI2C_SlaveTransferCreateHandle() to start processing - * transactions driven by an I2C master. The slave monitors the I2C bus and pass events to the - * callback that was passed into the call to LPI2C_SlaveTransferCreateHandle(). The callback is always invoked - * from the interrupt context. - * - * The set of events received by the callback is customizable. To do so, set the @a eventMask parameter to - * the OR'd combination of #lpi2c_slave_transfer_event_t enumerators for the events you wish to receive. - * The #kLPI2C_SlaveTransmitEvent and #kLPI2C_SlaveReceiveEvent events are always enabled and do not need - * to be included in the mask. Alternatively, you can pass 0 to get a default set of only the transmit and - * receive events that are always enabled. In addition, the #kLPI2C_SlaveAllEvents constant is provided as - * a convenient way to enable all events. - * - * @param base The LPI2C peripheral base address. - * @param handle Pointer to lpi2c_slave_handle_t structure which stores the transfer state. - * @param eventMask Bit mask formed by OR'ing together #lpi2c_slave_transfer_event_t enumerators to specify - * which events to send to the callback. Other accepted values are 0 to get a default set of - * only the transmit and receive events, and #kLPI2C_SlaveAllEvents to enable all events. - * - * @retval kStatus_Success Slave transfers were successfully started. - * @retval #kStatus_LPI2C_Busy Slave transfers have already been started on this handle. - */ -status_t LPI2C_SlaveTransferNonBlocking(LPI2C_Type *base, lpi2c_slave_handle_t *handle, uint32_t eventMask); - -/*! - * @brief Gets the slave transfer status during a non-blocking transfer. - * @param base The LPI2C peripheral base address. - * @param handle Pointer to i2c_slave_handle_t structure. - * @param[out] count Pointer to a value to hold the number of bytes transferred. May be NULL if the count is not - * required. - * @retval kStatus_Success - * @retval kStatus_NoTransferInProgress - */ -status_t LPI2C_SlaveTransferGetCount(LPI2C_Type *base, lpi2c_slave_handle_t *handle, size_t *count); - -/*! - * @brief Aborts the slave non-blocking transfers. - * @note This API could be called at any time to stop slave for handling the bus events. - * @param base The LPI2C peripheral base address. - * @param handle Pointer to lpi2c_slave_handle_t structure which stores the transfer state. - * @retval kStatus_Success - * @retval #kStatus_LPI2C_Idle - */ -void LPI2C_SlaveTransferAbort(LPI2C_Type *base, lpi2c_slave_handle_t *handle); - -/*! @} */ - -/*! @name Slave IRQ handler */ -/*! @{ */ - -/*! - * @brief Reusable routine to handle slave interrupts. - * @note This function does not need to be called unless you are reimplementing the - * non blocking API's interrupt handler routines to add special functionality. - * @param instance The LPI2C instance. - * @param lpi2cSlaveHandle Pointer to lpi2c_slave_handle_t structure which stores the transfer state. - */ -void LPI2C_SlaveTransferHandleIRQ(uint32_t instance, void *lpi2cSlaveHandle); - -/*! @} */ - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -#endif /* FSL_LPI2C_H_ */ \ No newline at end of file diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpi2c_edma.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpi2c_edma.c deleted file mode 100644 index eca6f9aac91..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpi2c_edma.c +++ /dev/null @@ -1,654 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpi2c_edma.h" -#include -#include - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpflexcomm_lpi2c_edma" -#endif - -/* @brief Mask to align an address to 32 bytes. */ -#define ALIGN_32_MASK (0x1fU) - -/* ! @brief LPI2C master fifo commands. */ -enum _lpi2c_master_fifo_cmd -{ - kTxDataCmd = LPI2C_MTDR_CMD(0x0U), /*!< Transmit DATA[7:0] */ - kRxDataCmd = LPI2C_MTDR_CMD(0X1U), /*!< Receive (DATA[7:0] + 1) bytes */ - kStopCmd = LPI2C_MTDR_CMD(0x2U), /*!< Generate STOP condition */ - kStartCmd = LPI2C_MTDR_CMD(0x4U), /*!< Generate(repeated) START and transmit address in DATA[[7:0] */ -}; - -/*! @brief States for the state machine used by transactional APIs. */ -enum _lpi2c_transfer_states -{ - kIdleState = 0, - kSendCommandState, - kIssueReadCommandState, - kTransferDataState, - kStopState, - kWaitForCompletionState, -}; - -/*! - * @brief Used for conversion from `lpflexcomm_irq_handler_t` to `lpi2c_master_isr_t` - */ -typedef union lpi2c_to_lpflexcomm_edma -{ - lpi2c_master_isr_t lpi2c_master_handler; - lpflexcomm_irq_handler_t lpflexcomm_handler; -} lpi2c_to_lpflexcomm_edma_t; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Prepares the command buffer with the sequence of commands needed to send the requested transaction. - * @param handle Master DMA driver handle. - * @return Number of command words. - */ -static uint32_t LPI2C_GenerateCommands(lpi2c_master_edma_handle_t *handle); - -/*! - * @brief DMA completion callback. - * @param dmaHandle DMA channel handle for the channel that completed. - * @param userData User data associated with the channel handle. For this callback, the user data is the - * LPI2C DMA driver handle. - * @param isTransferDone Whether the DMA transfer has completed. - * @param tcds Number of TCDs that completed. - */ -static void LPI2C_MasterEDMACallback(edma_handle_t *dmaHandle, void *userData, bool isTransferDone, uint32_t tcds); - -/*! - * @brief LPI2C master edma transfer IRQ handle routine. - * - * This API handles the LPI2C bus error status and invoke callback if needed. - * - * @param base The LPI2C peripheral base address. - * @param lpi2cMasterEdmaHandle Pointer to the LPI2C master edma handle. - */ -static void LPI2C_MasterTransferEdmaHandleIRQ(uint32_t instance, void *lpi2cMasterEdmaHandle); -/******************************************************************************* - * Variables - ******************************************************************************/ - -static uint32_t lpi2c_edma_RecSetting = 0x02; - -/*! @brief Array to map LPI2C instance number to base pointer. */ -static LPI2C_Type *const kLpi2cBases[] = LPI2C_BASE_PTRS; - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Create a new handle for the LPI2C master DMA APIs. - * - * The creation of a handle is for use with the DMA APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the LPI2C_MasterTransferAbortEDMA() API shall be called. - * - * For devices where the LPI2C send and receive DMA requests are OR'd together, the a txDmaHandle - * parameter is ignored and may be set to NULL. - * - * param base The LPI2C peripheral base address. - * param[out] handle Pointer to the LPI2C master driver handle. - * param rxDmaHandle Handle for the eDMA receive channel. Created by the user prior to calling this function. - * param txDmaHandle Handle for the eDMA transmit channel. Created by the user prior to calling this function. - * param callback User provided pointer to the asynchronous callback function. - * param userData User provided pointer to the application callback data. - */ -void LPI2C_MasterCreateEDMAHandle(LPI2C_Type *base, - lpi2c_master_edma_handle_t *handle, - edma_handle_t *rxDmaHandle, - edma_handle_t *txDmaHandle, - lpi2c_master_edma_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - assert(rxDmaHandle != NULL); - assert(txDmaHandle != NULL); - - /* Look up instance number */ - uint32_t instance = LPI2C_GetInstance(base); - - /* Clear out the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Set up the handle. For combined rx/tx DMA requests, the tx channel handle is set to the rx handle */ - /* in order to make the transfer API code simpler. */ - handle->base = base; - handle->completionCallback = callback; - handle->userData = userData; - handle->rx = rxDmaHandle; - handle->tx = (FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base) > 0) ? txDmaHandle : rxDmaHandle; - - if (LP_FLEXCOMM_GetBaseAddress(instance) != 0U) - { - lpi2c_to_lpflexcomm_edma_t handler; - handler.lpi2c_master_handler = LPI2C_MasterTransferEdmaHandleIRQ; - - LP_FLEXCOMM_SetIRQHandler(instance, handler.lpflexcomm_handler, handle, LP_FLEXCOMM_PERIPH_LPI2C); - } - else - { - /* Save the handle in global variables to support the double weak mechanism. */ - s_lpi2cMasterHandle[instance] = handle; - - /* Set LPI2C_MasterTransferEdmaHandleIRQ as LPI2C DMA IRQ handler */ - s_lpi2cMasterIsr = LPI2C_MasterTransferEdmaHandleIRQ; - } - - /* Enable interrupt in NVIC. */ - (void)EnableIRQ(kLpi2cIrqs[instance]); - - /* Set DMA channel completion callbacks. */ - EDMA_SetCallback(handle->rx, LPI2C_MasterEDMACallback, handle); - if (FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base) != 0) - { - EDMA_SetCallback(handle->tx, LPI2C_MasterEDMACallback, handle); - } -} - -static uint32_t LPI2C_GenerateCommands(lpi2c_master_edma_handle_t *handle) -{ - lpi2c_master_transfer_t *xfer = &handle->transfer; - uint16_t *cmd = (uint16_t *)&handle->commandBuffer; - uint32_t cmdCount = 0; - - /* Handle no start option. */ - if ((xfer->flags & (uint32_t)kLPI2C_TransferNoStartFlag) != 0U) - { - if (xfer->direction == kLPI2C_Read) - { - /* Need to issue read command first. */ - cmd[cmdCount++] = (uint16_t)kRxDataCmd | (uint16_t)LPI2C_MTDR_DATA(xfer->dataSize - 1U); - } - } - else - { - /* - * Initial direction depends on whether a subaddress was provided, and of course the actual - * data transfer direction. - */ - lpi2c_direction_t direction = (xfer->subaddressSize != 0U) ? kLPI2C_Write : xfer->direction; - - /* Start command. */ - cmd[cmdCount++] = - (uint16_t)kStartCmd | (uint16_t)((uint16_t)((uint16_t)xfer->slaveAddress << 1U) | (uint16_t)direction); - - /* Subaddress, MSB first. */ - if (xfer->subaddressSize != 0U) - { - uint32_t subaddressRemaining = xfer->subaddressSize; - while (0U != subaddressRemaining--) - { - uint8_t subaddressByte = (uint8_t)(xfer->subaddress >> (8U * subaddressRemaining)) & 0xffU; - cmd[cmdCount++] = subaddressByte; - } - } - - /* Reads need special handling because we have to issue a read command and maybe a repeated start. */ - if ((xfer->dataSize != 0U) && (xfer->direction == kLPI2C_Read)) - { - /* Need to send repeated start if switching directions to read. */ - if (direction == kLPI2C_Write) - { - cmd[cmdCount++] = (uint16_t)kStartCmd | - (uint16_t)((uint16_t)((uint16_t)xfer->slaveAddress << 1U) | (uint16_t)kLPI2C_Read); - } - - /* Read command. A single write to MTDR can issue read operation of 0xFFU + 1 byte of data at most, so when - the dataSize is larger than 0x100U, push multiple read commands to MTDR until dataSize is reached. */ - size_t tmpRxSize = xfer->dataSize; - while (tmpRxSize != 0U) - { - if (tmpRxSize > 256U) - { - cmd[cmdCount++] = (uint16_t)kRxDataCmd | (uint16_t)LPI2C_MTDR_DATA(0xFFU); - tmpRxSize -= 256U; - } - else - { - cmd[cmdCount++] = (uint16_t)kRxDataCmd | (uint16_t)LPI2C_MTDR_DATA(tmpRxSize - 1U); - tmpRxSize = 0U; - } - } - } - } - - return cmdCount; -} - -/*! - * brief Performs a non-blocking DMA-based transaction on the I2C bus. - * - * The callback specified when the a handle was created is invoked when the transaction has - * completed. - * - * param base The LPI2C peripheral base address. - * param handle Pointer to the LPI2C master driver handle. - * param transfer The pointer to the transfer descriptor. - * retval #kStatus_Success The transaction was started successfully. - * retval #kStatus_LPI2C_Busy Either another master is currently utilizing the bus, or another DMA - * transaction is already in progress. - */ -status_t LPI2C_MasterTransferEDMA(LPI2C_Type *base, - lpi2c_master_edma_handle_t *handle, - lpi2c_master_transfer_t *transfer) -{ - status_t result; - - assert(handle != NULL); - assert(transfer != NULL); - assert(transfer->subaddressSize <= sizeof(transfer->subaddress)); - - /* Check transfer data size in read operation. */ - /* A single write to MTDR can issue read operation of 0xFFU + 1 byte of data at most, so when the dataSize is larger - than 0x100U, push multiple read commands to MTDR until dataSize is reached. LPI2C edma transfer uses linked - descriptor to transfer command and data, the command buffer is stored in handle. Allocate 4 command words to - carry read command which can cover nearly all use cases. */ - if ((transfer->direction == kLPI2C_Read) && (transfer->dataSize > (256U * 4U))) - { - return kStatus_InvalidArgument; - } - - /* Return busy if another transaction is in progress. */ - if (handle->isBusy) - { - return kStatus_LPI2C_Busy; - } - - /* Return an error if the bus is already in use not by us. */ - result = LPI2C_CheckForBusyBus(base); - if (result != kStatus_Success) - { - return result; - } - - /* We're now busy. */ - handle->isBusy = true; - - /* Disable LPI2C IRQ and DMA sources while we configure stuff. */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - LPI2C_MasterEnableDMA(base, false, false); - - /* Clear all flags. */ - LPI2C_MasterClearStatusFlags(base, (uint32_t)kLPI2C_MasterClearFlags); - - /* Save transfer into handle. */ - handle->transfer = *transfer; - - /* Generate commands to send. */ - uint32_t commandCount = LPI2C_GenerateCommands(handle); - - /* If the user is transmitting no data with no start or stop, then just go ahead and invoke the callback. */ - if ((0U == commandCount) && (transfer->dataSize == 0U)) - { - if (handle->completionCallback != NULL) - { - handle->completionCallback(base, handle, kStatus_Success, handle->userData); - } - return kStatus_Success; - } - - /* Reset DMA channels. */ - EDMA_ResetChannel(handle->rx->base, handle->rx->channel); - if (FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base) != 0) - { - EDMA_ResetChannel(handle->tx->base, handle->tx->channel); - } - - /* Get a 32-byte aligned TCD pointer. */ - edma_tcd_t *tcd = (edma_tcd_t *)((uint32_t)(&handle->tcds[1]) & (~ALIGN_32_MASK)); - - bool hasSendData = (transfer->direction == kLPI2C_Write) && (transfer->dataSize != 0U); - bool hasReceiveData = (transfer->direction == kLPI2C_Read) && (transfer->dataSize != 0U); - - edma_transfer_config_t transferConfig = {0}; - edma_tcd_t *linkTcd = NULL; - - /* Set up data transmit. */ - if (hasSendData) - { - uint32_t *srcAddr = (uint32_t *)transfer->data; - transferConfig.srcAddr = (uint32_t)srcAddr; - transferConfig.destAddr = (uint32_t)LPI2C_MasterGetTxFifoAddress(base); - transferConfig.srcTransferSize = kEDMA_TransferSize1Bytes; - transferConfig.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfig.srcOffset = (int16_t)sizeof(uint8_t); - transferConfig.destOffset = 0; - transferConfig.minorLoopBytes = sizeof(uint8_t); /* TODO optimize to fill fifo */ - transferConfig.majorLoopCounts = transfer->dataSize; - - /* Store the initially configured eDMA minor byte transfer count into the LPI2C handle */ - handle->nbytes = (uint8_t)transferConfig.minorLoopBytes; - - if (commandCount != 0U) - { -#if defined FSL_EDMA_DRIVER_EDMA4 && FSL_EDMA_DRIVER_EDMA4 - /* Create a software TCD, which will be chained after the commands. */ - EDMA_TcdResetExt(handle->tx->base, tcd); - EDMA_TcdSetTransferConfigExt(handle->tx->base, tcd, &transferConfig, NULL); - EDMA_TcdEnableInterruptsExt(handle->tx->base, tcd, (uint32_t)kEDMA_MajorInterruptEnable); -#else - /* Create a software TCD, which will be chained after the commands. */ - EDMA_TcdReset(tcd); - EDMA_TcdSetTransferConfig(tcd, &transferConfig, NULL); - EDMA_TcdEnableInterrupts(tcd, (uint32_t)kEDMA_MajorInterruptEnable); -#endif - linkTcd = tcd; - } - else - { - /* User is only transmitting data with no required commands, so this transfer can stand alone. */ - EDMA_SetTransferConfig(handle->tx->base, handle->tx->channel, &transferConfig, NULL); - EDMA_EnableChannelInterrupts(handle->tx->base, handle->tx->channel, (uint32_t)kEDMA_MajorInterruptEnable); - } - } - else if (hasReceiveData) - { - uint32_t *srcAddr = (uint32_t *)transfer->data; - /* Set up data receive. */ - transferConfig.srcAddr = (uint32_t)LPI2C_MasterGetRxFifoAddress(base); - transferConfig.destAddr = (uint32_t)srcAddr; - transferConfig.srcTransferSize = kEDMA_TransferSize1Bytes; - transferConfig.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfig.srcOffset = 0; - transferConfig.destOffset = (int16_t)sizeof(uint8_t); - transferConfig.minorLoopBytes = sizeof(uint8_t); /* TODO optimize to empty fifo */ - transferConfig.majorLoopCounts = transfer->dataSize; - - /* Store the initially configured eDMA minor byte transfer count into the LPI2C handle */ - handle->nbytes = (uint8_t)transferConfig.minorLoopBytes; - - if ((FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base) != 0) || (0U == commandCount)) - { - /* We can put this receive transfer on its own DMA channel. */ - EDMA_SetTransferConfig(handle->rx->base, handle->rx->channel, &transferConfig, NULL); - EDMA_EnableChannelInterrupts(handle->rx->base, handle->rx->channel, (uint32_t)kEDMA_MajorInterruptEnable); - } - else - { - /* For shared rx/tx DMA requests, when there are commands, create a software TCD of - enabling rx dma and disabling tx dma, which will be chained onto the commands transfer, - and create another software TCD of transfering data and chain it onto the last TCD. - Notice that in this situation assume tx/rx uses same channel */ -#if defined FSL_EDMA_DRIVER_EDMA4 && FSL_EDMA_DRIVER_EDMA4 - EDMA_TcdResetExt(handle->rx->base, tcd); - EDMA_TcdSetTransferConfigExt(handle->rx->base, tcd, &transferConfig, NULL); - EDMA_TcdEnableInterruptsExt(handle->rx->base, tcd, (uint32_t)kEDMA_MajorInterruptEnable); -#else - EDMA_TcdReset(tcd); - EDMA_TcdSetTransferConfig(tcd, &transferConfig, NULL); - EDMA_TcdEnableInterrupts(tcd, (uint32_t)kEDMA_MajorInterruptEnable); -#endif - - transferConfig.srcAddr = (uint32_t)&lpi2c_edma_RecSetting; - transferConfig.destAddr = (uint32_t) & (base->MDER); - transferConfig.srcTransferSize = kEDMA_TransferSize1Bytes; - transferConfig.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfig.srcOffset = 0; - transferConfig.destOffset = (int16_t)sizeof(uint8_t); - transferConfig.minorLoopBytes = sizeof(uint8_t); - transferConfig.majorLoopCounts = 1; - - edma_tcd_t *tcdSetRxClearTxDMA = (edma_tcd_t *)((uint32_t)(&handle->tcds[2]) & (~ALIGN_32_MASK)); - -#if defined FSL_EDMA_DRIVER_EDMA4 && FSL_EDMA_DRIVER_EDMA4 - EDMA_TcdResetExt(handle->rx->base, tcdSetRxClearTxDMA); - EDMA_TcdSetTransferConfigExt(handle->rx->base, tcdSetRxClearTxDMA, &transferConfig, tcd); -#else - EDMA_TcdReset(tcdSetRxClearTxDMA); - EDMA_TcdSetTransferConfig(tcdSetRxClearTxDMA, &transferConfig, tcd); -#endif - linkTcd = tcdSetRxClearTxDMA; - } - } - else - { - /* No data to send */ - } - - if (hasSendData) - { - } - - /* Set up commands transfer. */ - if (commandCount != 0U) - { - transferConfig.srcAddr = (uint32_t)handle->commandBuffer; - transferConfig.destAddr = (uint32_t)LPI2C_MasterGetTxFifoAddress(base); - transferConfig.srcTransferSize = kEDMA_TransferSize2Bytes; - transferConfig.destTransferSize = kEDMA_TransferSize2Bytes; - transferConfig.srcOffset = (int16_t)sizeof(uint16_t); - transferConfig.destOffset = 0; - transferConfig.minorLoopBytes = sizeof(uint16_t); /* TODO optimize to fill fifo */ - transferConfig.majorLoopCounts = commandCount; - - EDMA_SetTransferConfig(handle->tx->base, handle->tx->channel, &transferConfig, linkTcd); - } - - /* Start DMA transfer. */ - if (hasReceiveData || (0 == FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base))) - { - EDMA_StartTransfer(handle->rx); - } - - if ((hasSendData || (commandCount != 0U)) && (FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base) != 0)) - { - EDMA_StartTransfer(handle->tx); - } - - /* Enable DMA in both directions. This actually kicks of the transfer. */ - LPI2C_MasterEnableDMA(base, true, true); - - /* Enable all LPI2C master interrupts */ - LPI2C_MasterEnableInterrupts(base, - (uint32_t)kLPI2C_MasterArbitrationLostFlag | (uint32_t)kLPI2C_MasterNackDetectFlag | - (uint32_t)kLPI2C_MasterPinLowTimeoutFlag | (uint32_t)kLPI2C_MasterFifoErrFlag); - - return result; -} - -/*! - * brief Returns number of bytes transferred so far. - * - * param base The LPI2C peripheral base address. - * param handle Pointer to the LPI2C master driver handle. - * param[out] count Number of bytes transferred so far by the non-blocking transaction. - * retval #kStatus_Success - * retval #kStatus_NoTransferInProgress There is not a DMA transaction currently in progress. - */ -status_t LPI2C_MasterTransferGetCountEDMA(LPI2C_Type *base, lpi2c_master_edma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (!handle->isBusy) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - uint32_t remaining = handle->transfer.dataSize; - - /* If the DMA is still on a commands transfer that chains to the actual data transfer, */ - /* we do nothing and return the number of transferred bytes as zero. */ - if (EDMA_GetNextTCDAddress(handle->tx) == 0U) - { - if (handle->transfer.direction == kLPI2C_Write) - { - remaining = - (uint32_t)handle->nbytes * EDMA_GetRemainingMajorLoopCount(handle->tx->base, handle->tx->channel); - } - else - { - remaining = - (uint32_t)handle->nbytes * EDMA_GetRemainingMajorLoopCount(handle->rx->base, handle->rx->channel); - } - } - - *count = handle->transfer.dataSize - remaining; - - return kStatus_Success; -} - -/*! - * brief Terminates a non-blocking LPI2C master transmission early. - * - * note It is not safe to call this function from an IRQ handler that has a higher priority than the - * eDMA peripheral's IRQ priority. - * - * param base The LPI2C peripheral base address. - * param handle Pointer to the LPI2C master driver handle. - * retval #kStatus_Success A transaction was successfully aborted. - * retval #kStatus_LPI2C_Idle There is not a DMA transaction currently in progress. - */ -status_t LPI2C_MasterTransferAbortEDMA(LPI2C_Type *base, lpi2c_master_edma_handle_t *handle) -{ - /* Catch when there is not an active transfer. */ - if (!handle->isBusy) - { - return kStatus_LPI2C_Idle; - } - - /* Terminate DMA transfers. */ - EDMA_AbortTransfer(handle->rx); - if (FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base) != 0) - { - EDMA_AbortTransfer(handle->tx); - } - - /* Reset fifos. */ - base->MCR |= LPI2C_MCR_RRF_MASK | LPI2C_MCR_RTF_MASK; - - /* Disable LPI2C interrupts. */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - - /* If master is still busy and has not send out stop signal yet. */ - if ((LPI2C_MasterGetStatusFlags(base) & - ((uint32_t)kLPI2C_MasterStopDetectFlag | (uint32_t)kLPI2C_MasterBusyFlag)) == (uint32_t)kLPI2C_MasterBusyFlag) - { - /* Send a stop command to finalize the transfer. */ - base->MTDR = (uint32_t)kStopCmd; - } - - /* Reset handle. */ - handle->isBusy = false; - - return kStatus_Success; -} - -static void LPI2C_MasterEDMACallback(edma_handle_t *dmaHandle, void *userData, bool isTransferDone, uint32_t tcds) -{ - lpi2c_master_edma_handle_t *handle = (lpi2c_master_edma_handle_t *)userData; - - if (NULL == handle) - { - return; - } - - /* Check for errors. */ - status_t result = LPI2C_MasterCheckAndClearError(handle->base, LPI2C_MasterGetStatusFlags(handle->base)); - - /* Done with this transaction. */ - handle->isBusy = false; - - if (0U == (handle->transfer.flags & (uint32_t)kLPI2C_TransferNoStopFlag)) - { - /* Send a stop command to finalize the transfer. */ - handle->base->MTDR = (uint32_t)kStopCmd; - } - - /* Invoke callback. */ - if (handle->completionCallback != NULL) - { - handle->completionCallback(handle->base, handle, result, handle->userData); - } -} - -static void LPI2C_MasterTransferEdmaHandleIRQ(uint32_t instance, void *lpi2cMasterEdmaHandle) -{ - assert(lpi2cMasterEdmaHandle != NULL); - assert(instance < ARRAY_SIZE(kLpi2cBases)); - LPI2C_Type *base = kLpi2cBases[instance]; - - lpi2c_master_edma_handle_t *handle = (lpi2c_master_edma_handle_t *)lpi2cMasterEdmaHandle; - uint32_t status = LPI2C_MasterGetStatusFlags(base); - status_t result = kStatus_Success; - - /* Terminate DMA transfers. */ - EDMA_AbortTransfer(handle->rx); - if (FSL_FEATURE_LPI2C_HAS_SEPARATE_DMA_RX_TX_REQn(base) != 0) - { - EDMA_AbortTransfer(handle->tx); - } - - /* Done with this transaction. */ - handle->isBusy = false; - - /* Disable LPI2C interrupts. */ - LPI2C_MasterDisableInterrupts(base, (uint32_t)kLPI2C_MasterIrqFlags); - - /* Check error status */ - if (0U != (status & (uint32_t)kLPI2C_MasterPinLowTimeoutFlag)) - { - result = kStatus_LPI2C_PinLowTimeout; - } - else if (0U != (status & (uint32_t)kLPI2C_MasterArbitrationLostFlag)) - { - result = kStatus_LPI2C_ArbitrationLost; - } - else if (0U != (status & (uint32_t)kLPI2C_MasterNackDetectFlag)) - { - result = kStatus_LPI2C_Nak; - } - else if (0U != (status & (uint32_t)kLPI2C_MasterFifoErrFlag)) - { - result = kStatus_LPI2C_FifoError; - } - else - { - ; /* Intentional empty */ - } - - /* Clear error status. */ - (void)LPI2C_MasterCheckAndClearError(base, status); - - /* Send stop flag if needed */ - if (0U == (handle->transfer.flags & (uint32_t)kLPI2C_TransferNoStopFlag)) - { - status = LPI2C_MasterGetStatusFlags(base); - /* If bus is still busy and the master has not generate stop flag */ - if ((status & ((uint32_t)kLPI2C_MasterBusBusyFlag | (uint32_t)kLPI2C_MasterStopDetectFlag)) == - (uint32_t)kLPI2C_MasterBusBusyFlag) - { - /* Send a stop command to finalize the transfer. */ - handle->base->MTDR = (uint32_t)kStopCmd; - } - } - - /* Invoke callback. */ - if (handle->completionCallback != NULL) - { - handle->completionCallback(base, handle, result, handle->userData); - } -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpi2c_edma.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpi2c_edma.h deleted file mode 100644 index 3c771447c1c..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpi2c_edma.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_LPI2C_EDMA_H_ -#define FSL_LPI2C_EDMA_H_ - -#include "fsl_lpi2c.h" -#include "fsl_edma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief LPI2C EDMA driver version. */ -#define FSL_LPI2C_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 0, 1)) -/*! @} */ - -/*! - * @addtogroup lpi2c_master_edma_driver - * @{ - */ - -/* Forward declaration of the transfer descriptor and handle typedefs. */ -typedef struct _lpi2c_master_edma_handle lpi2c_master_edma_handle_t; - -/*! - * @brief Master DMA completion callback function pointer type. - * - * This callback is used only for the non-blocking master transfer API. Specify the callback you wish to use - * in the call to LPI2C_MasterCreateEDMAHandle(). - * - * @param base The LPI2C peripheral base address. - * @param handle Handle associated with the completed transfer. - * @param completionStatus Either kStatus_Success or an error code describing how the transfer completed. - * @param userData Arbitrary pointer-sized value passed from the application. - */ -typedef void (*lpi2c_master_edma_transfer_callback_t)(LPI2C_Type *base, - lpi2c_master_edma_handle_t *handle, - status_t completionStatus, - void *userData); - -/*! - * @brief Driver handle for master DMA APIs. - * @note The contents of this structure are private and subject to change. - */ -struct _lpi2c_master_edma_handle -{ - LPI2C_Type *base; /*!< LPI2C base pointer. */ - bool isBusy; /*!< Transfer state machine current state. */ - uint8_t nbytes; /*!< eDMA minor byte transfer count initially configured. */ - uint16_t commandBuffer[10]; /*!< LPI2C command sequence. When all 10 command words are used: - Start&addr&write[1 word] + subaddr[4 words] + restart&addr&read[1 word] + receive&Size[4 words] */ - lpi2c_master_transfer_t transfer; /*!< Copy of the current transfer info. */ - lpi2c_master_edma_transfer_callback_t completionCallback; /*!< Callback function pointer. */ - void *userData; /*!< Application data passed to callback. */ - edma_handle_t *rx; /*!< Handle for receive DMA channel. */ - edma_handle_t *tx; /*!< Handle for transmit DMA channel. */ - edma_tcd_t tcds[3]; /*!< Software TCD. Three are allocated to provide enough room to align to 32-bytes. */ -}; - -/*! @} */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @addtogroup lpi2c_master_edma_driver - * @{ - */ - -/*! @name Master DMA */ -/*! @{ */ - -/*! - * @brief Create a new handle for the LPI2C master DMA APIs. - * - * The creation of a handle is for use with the DMA APIs. Once a handle - * is created, there is not a corresponding destroy handle. If the user wants to - * terminate a transfer, the LPI2C_MasterTransferAbortEDMA() API shall be called. - * - * For devices where the LPI2C send and receive DMA requests are OR'd together, the @a txDmaHandle - * parameter is ignored and may be set to NULL. - * - * @param base The LPI2C peripheral base address. - * @param[out] handle Pointer to the LPI2C master driver handle. - * @param rxDmaHandle Handle for the eDMA receive channel. Created by the user prior to calling this function. - * @param txDmaHandle Handle for the eDMA transmit channel. Created by the user prior to calling this function. - * @param callback User provided pointer to the asynchronous callback function. - * @param userData User provided pointer to the application callback data. - */ -void LPI2C_MasterCreateEDMAHandle(LPI2C_Type *base, - lpi2c_master_edma_handle_t *handle, - edma_handle_t *rxDmaHandle, - edma_handle_t *txDmaHandle, - lpi2c_master_edma_transfer_callback_t callback, - void *userData); - -/*! - * @brief Performs a non-blocking DMA-based transaction on the I2C bus. - * - * The callback specified when the @a handle was created is invoked when the transaction has - * completed. - * - * @param base The LPI2C peripheral base address. - * @param handle Pointer to the LPI2C master driver handle. - * @param transfer The pointer to the transfer descriptor. - * @retval kStatus_Success The transaction was started successfully. - * @retval #kStatus_LPI2C_Busy Either another master is currently utilizing the bus, or another DMA - * transaction is already in progress. - */ -status_t LPI2C_MasterTransferEDMA(LPI2C_Type *base, - lpi2c_master_edma_handle_t *handle, - lpi2c_master_transfer_t *transfer); - -/*! - * @brief Returns number of bytes transferred so far. - * - * @param base The LPI2C peripheral base address. - * @param handle Pointer to the LPI2C master driver handle. - * @param[out] count Number of bytes transferred so far by the non-blocking transaction. - * @retval kStatus_Success - * @retval kStatus_NoTransferInProgress There is not a DMA transaction currently in progress. - */ -status_t LPI2C_MasterTransferGetCountEDMA(LPI2C_Type *base, lpi2c_master_edma_handle_t *handle, size_t *count); - -/*! - * @brief Terminates a non-blocking LPI2C master transmission early. - * - * @note It is not safe to call this function from an IRQ handler that has a higher priority than the - * eDMA peripheral's IRQ priority. - * - * @param base The LPI2C peripheral base address. - * @param handle Pointer to the LPI2C master driver handle. - * @retval kStatus_Success A transaction was successfully aborted. - * @retval #kStatus_LPI2C_Idle There is not a DMA transaction currently in progress. - */ -status_t LPI2C_MasterTransferAbortEDMA(LPI2C_Type *base, lpi2c_master_edma_handle_t *handle); - -/*! @} */ - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -#endif /* FSL_LPI2C_EDMA_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpi2c_freertos.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpi2c_freertos.c deleted file mode 100644 index 818c23801b5..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpi2c_freertos.c +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpi2c_freertos.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpflexcomm_lpi2c_freertos" -#endif - -static void LPI2C_RTOS_Callback(LPI2C_Type *base, lpi2c_master_handle_t *drv_handle, status_t status, void *userData) -{ - lpi2c_rtos_handle_t *handle = (lpi2c_rtos_handle_t *)userData; - BaseType_t reschedule = pdFALSE; - handle->async_status = status; - (void)xSemaphoreGiveFromISR(handle->semaphore, &reschedule); - portYIELD_FROM_ISR(reschedule); -} - -/*! - * brief Initializes LPI2C. - * - * This function initializes the LPI2C module and the related RTOS context. - * - * param handle The RTOS LPI2C handle, the pointer to an allocated space for RTOS context. - * param base The pointer base address of the LPI2C instance to initialize. - * param masterConfig Configuration structure to set-up LPI2C in master mode. - * param srcClock_Hz Frequency of input clock of the LPI2C module. - * return status of the operation. - */ -status_t LPI2C_RTOS_Init(lpi2c_rtos_handle_t *handle, - LPI2C_Type *base, - const lpi2c_master_config_t *masterConfig, - uint32_t srcClock_Hz) -{ - if (handle == NULL) - { - return kStatus_InvalidArgument; - } - - if (base == NULL) - { - return kStatus_InvalidArgument; - } - - (void)memset(handle, 0, sizeof(lpi2c_rtos_handle_t)); - - handle->mutex = xSemaphoreCreateMutex(); - if (handle->mutex == NULL) - { - return kStatus_Fail; - } - - handle->semaphore = xSemaphoreCreateBinary(); - if (handle->semaphore == NULL) - { - vSemaphoreDelete(handle->mutex); - return kStatus_Fail; - } - - handle->base = base; - - LPI2C_MasterInit(handle->base, masterConfig, srcClock_Hz); - LPI2C_MasterTransferCreateHandle(base, &handle->drv_handle, LPI2C_RTOS_Callback, (void *)handle); - - return kStatus_Success; -} - -/*! - * brief Deinitializes the LPI2C. - * - * This function deinitializes the LPI2C module and the related RTOS context. - * - * param handle The RTOS LPI2C handle. - */ -status_t LPI2C_RTOS_Deinit(lpi2c_rtos_handle_t *handle) -{ - LPI2C_MasterDeinit(handle->base); - vSemaphoreDelete(handle->semaphore); - vSemaphoreDelete(handle->mutex); - return kStatus_Success; -} - -/*! - * brief Performs LPI2C transfer. - * - * This function performs an LPI2C transfer according to data given in the transfer structure. - * - * param handle The RTOS LPI2C handle. - * param transfer Structure specifying the transfer parameters. - * return status of the operation. - */ -status_t LPI2C_RTOS_Transfer(lpi2c_rtos_handle_t *handle, lpi2c_master_transfer_t *transfer) -{ - status_t status; - - /* Lock resource mutex */ - if (xSemaphoreTake(handle->mutex, portMAX_DELAY) != pdTRUE) - { - return kStatus_LPI2C_Busy; - } - - status = LPI2C_MasterTransferNonBlocking(handle->base, &handle->drv_handle, transfer); - if (status != kStatus_Success) - { - (void)xSemaphoreGive(handle->mutex); - return status; - } - - /* Wait for transfer to finish */ - (void)xSemaphoreTake(handle->semaphore, portMAX_DELAY); - - /* Unlock resource mutex */ - (void)xSemaphoreGive(handle->mutex); - - /* Return status captured by callback function */ - return handle->async_status; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpi2c_freertos.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpi2c_freertos.h deleted file mode 100644 index 029e16a351d..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpi2c_freertos.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef __FSL_LPI2C_FREERTOS_H__ -#define __FSL_LPI2C_FREERTOS_H__ - -#include "FreeRTOS.h" -#include "portable.h" -#include "semphr.h" - -#include "fsl_lpi2c.h" - -/*! - * @addtogroup lpi2c_freertos_driver LPI2C FreeRTOS Driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief LPI2C FreeRTOS driver version 2.0.0. */ -#define FSL_LPI2C_FREERTOS_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) -/*@}*/ - -/*! @brief LPI2C FreeRTOS handle */ -typedef struct _lpi2c_rtos_handle -{ - LPI2C_Type *base; /*!< LPI2C base address */ - lpi2c_master_handle_t drv_handle; /*!< A handle of the underlying driver, treated as opaque by the RTOS layer */ - status_t async_status; /*!< Transactional state of the underlying driver */ - SemaphoreHandle_t mutex; /*!< A mutex to lock the handle during a transfer */ - SemaphoreHandle_t semaphore; /*!< A semaphore to notify and unblock task when the transfer ends */ -#if (configSUPPORT_STATIC_ALLOCATION == 1) - StaticSemaphore_t mutexBuffer; /*!< Statically allocated memory for mutex */ - StaticSemaphore_t semaphoreBuffer; /*!< Statically allocated memory for semaphore */ -#endif -} lpi2c_rtos_handle_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name LPI2C RTOS Operation - * @{ - */ - -/*! - * @brief Initializes LPI2C. - * - * This function initializes the LPI2C module and the related RTOS context. - * - * @param handle The RTOS LPI2C handle, the pointer to an allocated space for RTOS context. - * @param base The pointer base address of the LPI2C instance to initialize. - * @param masterConfig Configuration structure to set-up LPI2C in master mode. - * @param srcClock_Hz Frequency of input clock of the LPI2C module. - * @return status of the operation. - */ -status_t LPI2C_RTOS_Init(lpi2c_rtos_handle_t *handle, - LPI2C_Type *base, - const lpi2c_master_config_t *masterConfig, - uint32_t srcClock_Hz); - -/*! - * @brief Deinitializes the LPI2C. - * - * This function deinitializes the LPI2C module and the related RTOS context. - * - * @param handle The RTOS LPI2C handle. - */ -status_t LPI2C_RTOS_Deinit(lpi2c_rtos_handle_t *handle); - -/*! - * @brief Performs LPI2C transfer. - * - * This function performs an LPI2C transfer according to data given in the transfer structure. - * - * @param handle The RTOS LPI2C handle. - * @param transfer Structure specifying the transfer parameters. - * @return status of the operation. - */ -status_t LPI2C_RTOS_Transfer(lpi2c_rtos_handle_t *handle, lpi2c_master_transfer_t *transfer); - -/*! - * @} - */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ - -#endif /* __FSL_LPI2C_FREERTOS_H__ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpspi.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpspi.c deleted file mode 100644 index 442a84c1578..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpspi.c +++ /dev/null @@ -1,2287 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpspi.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpflexcomm_lpspi" -#endif - -/*! - * @brief Default watermark values. - * - * The default watermarks are set to zero. - */ -enum _lpspi_default_watermarks -{ - kLpspiDefaultTxWatermark = 0, - kLpspiDefaultRxWatermark = 0, -}; - -/*! @brief Typedef for master interrupt handler. */ -typedef void (*lpspi_master_isr_t)(uint32_t instance, lpspi_master_handle_t *handle); - -/*! @brief Typedef for slave interrupt handler. */ -typedef void (*lpspi_slave_isr_t)(uint32_t instance, lpspi_slave_handle_t *handle); - -/*! - * @brief Used for conversion from `lpflexcomm_irq_handler_t` to `lpuart_irq_handler_t` - */ -typedef union lpspi_to_lpflexcomm -{ - lpspi_master_isr_t lpspi_master_handler; - lpspi_slave_isr_t lpspi_slave_handler; - lpflexcomm_irq_handler_t lpflexcomm_handler; -} lpspi_to_lpflexcomm_t; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Configures the LPSPI peripheral chip select polarity. - * - * This function takes in the desired peripheral chip select (Pcs) and it's corresponding desired polarity and - * configures the Pcs signal to operate with the desired characteristic. - * - * @param base LPSPI peripheral address. - * @param pcs The particular peripheral chip select (parameter value is of type lpspi_which_pcs_t) for which we wish to - * apply the active high or active low characteristic. - * @param activeLowOrHigh The setting for either "active high, inactive low (0)" or "active low, inactive high(1)" of - * type lpspi_pcs_polarity_config_t. - */ -static void LPSPI_SetOnePcsPolarity(LPSPI_Type *base, - lpspi_which_pcs_t pcs, - lpspi_pcs_polarity_config_t activeLowOrHigh); - -/*! - * @brief Combine the write data for 1 byte to 4 bytes. - * This is not a public API. - */ -static uint32_t LPSPI_CombineWriteData(const uint8_t *txData, uint8_t bytesEachWrite, bool isByteSwap); - -/*! - * @brief Separate the read data for 1 byte to 4 bytes. - * This is not a public API. - */ -static void LPSPI_SeparateReadData(uint8_t *rxData, uint32_t readData, uint8_t bytesEachRead, bool isByteSwap); - -/*! - * @brief Wait for tx FIFO to be empty. - * This is not a public API. - * @param base LPSPI peripheral address. - * @return true for the tx FIFO is ready, false is not. - */ -static bool LPSPI_TxFifoReady(LPSPI_Type *base); - -/*! - * @brief Master fill up the TX FIFO with data. - * This is not a public API. - */ -static void LPSPI_MasterTransferFillUpTxFifo(LPSPI_Type *base, lpspi_master_handle_t *handle); - -/*! - * @brief Master finish up a transfer. - * It would call back if there is callback function and set the state to idle. - * This is not a public API. - */ -static void LPSPI_MasterTransferComplete(LPSPI_Type *base, lpspi_master_handle_t *handle); - -/*! - * @brief Slave fill up the TX FIFO with data. - * This is not a public API. - */ -static void LPSPI_SlaveTransferFillUpTxFifo(LPSPI_Type *base, lpspi_slave_handle_t *handle); - -/*! - * @brief Slave finish up a transfer. - * It would call back if there is callback function and set the state to idle. - * This is not a public API. - */ -static void LPSPI_SlaveTransferComplete(LPSPI_Type *base, lpspi_slave_handle_t *handle); - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/* Defines constant value arrays for the baud rate pre-scalar and scalar divider values.*/ -static const uint8_t s_baudratePrescaler[] = {1, 2, 4, 8, 16, 32, 64, 128}; - -/*! @brief Pointers to lpspi bases for each instance. */ -static LPSPI_Type *const s_lpspiBases[] = LPSPI_BASE_PTRS; - -/*! @brief Pointers to lpspi IRQ number for each instance. */ -static const IRQn_Type s_lpspiIRQ[] = LPSPI_IRQS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to lpspi clocks for each instance. */ -static const clock_ip_name_t s_lpspiClocks[] = LPSPI_CLOCKS; - -#if defined(LPSPI_PERIPH_CLOCKS) -static const clock_ip_name_t s_LpspiPeriphClocks[] = LPSPI_PERIPH_CLOCKS; -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/*! @brief Pointers to lpspi handles for each instance. */ -static void *s_lpspiHandle[ARRAY_SIZE(s_lpspiBases)]; - -/* @brief Dummy data for each instance. This data is used when user's tx buffer is NULL*/ -volatile uint8_t g_lpspiDummyData[ARRAY_SIZE(s_lpspiBases)] = {0}; - -/*! @brief Pointer to master IRQ handler for each instance. */ -static lpspi_master_isr_t s_lpspiMasterIsr; -/*! @brief Pointer to slave IRQ handler for each instance. */ -static lpspi_slave_isr_t s_lpspiSlaveIsr; - -/********************************************************************************************************************** - * Code - *********************************************************************************************************************/ - -/*! - * brief Get the LPSPI instance from peripheral base address. - * - * param base LPSPI peripheral base address. - * return LPSPI instance. - */ -uint32_t LPSPI_GetInstance(LPSPI_Type *base) -{ - uint8_t instance = 0; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_lpspiBases); instance++) - { - if (s_lpspiBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_lpspiBases)); - - return instance; -} - -/*! - * brief Set up the dummy data. - * - * param base LPSPI peripheral address. - * param dummyData Data to be transferred when tx buffer is NULL. - * Note: - * This API has no effect when LPSPI in slave interrupt mode, because driver - * will set the TXMSK bit to 1 if txData is NULL, no data is loaded from transmit - * FIFO and output pin is tristated. - */ -void LPSPI_SetDummyData(LPSPI_Type *base, uint8_t dummyData) -{ - uint32_t instance = LPSPI_GetInstance(base); - g_lpspiDummyData[instance] = dummyData; -} - -/*! - * brief Initializes the LPSPI master. - * - * param base LPSPI peripheral address. - * param masterConfig Pointer to structure lpspi_master_config_t. - * param srcClock_Hz Module source input clock in Hertz - */ -void LPSPI_MasterInit(LPSPI_Type *base, const lpspi_master_config_t *masterConfig, uint32_t srcClock_Hz) -{ - assert(masterConfig != NULL); - - uint32_t tcrPrescaleValue = 0; - uint32_t instance = LPSPI_GetInstance(base); - - if(LP_FLEXCOMM_GetBaseAddress(instance) != 0U) - { -#if !(defined(LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) && LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) - /* initialize flexcomm to LPSPI mode */ - status_t status = LP_FLEXCOMM_Init(LPSPI_GetInstance(base), LP_FLEXCOMM_PERIPH_LPSPI); - if (kStatus_Success != status) - { - assert(false); - } -#endif /* LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER */ - } - else - { -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - - /* Enable LPSPI clock */ - (void)CLOCK_EnableClock(s_lpspiClocks[instance]); - -#if defined(LPSPI_PERIPH_CLOCKS) - (void)CLOCK_EnableClock(s_LpspiPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - } - - /* Disable LPSPI first */ - LPSPI_Enable(base, false); - - /* Set LPSPI to master */ - LPSPI_SetMasterSlaveMode(base, kLPSPI_Master); - - /* Set specific PCS to active high or low */ - LPSPI_SetOnePcsPolarity(base, masterConfig->whichPcs, masterConfig->pcsActiveHighOrLow); - - /* Set Configuration Register 1 related setting.*/ - base->CFGR1 = (base->CFGR1 & ~(LPSPI_CFGR1_OUTCFG_MASK | LPSPI_CFGR1_PINCFG_MASK | LPSPI_CFGR1_NOSTALL_MASK | - LPSPI_CFGR1_SAMPLE_MASK | LPSPI_CFGR1_PCSCFG_MASK )) | - LPSPI_CFGR1_OUTCFG(masterConfig->dataOutConfig) | LPSPI_CFGR1_PINCFG(masterConfig->pinCfg) | - LPSPI_CFGR1_NOSTALL(0) | LPSPI_CFGR1_SAMPLE((uint32_t)masterConfig->enableInputDelay )| - LPSPI_CFGR1_PCSCFG(masterConfig->pcsFunc); - - /* Set baudrate and delay times*/ - (void)LPSPI_MasterSetBaudRate(base, masterConfig->baudRate, srcClock_Hz, &tcrPrescaleValue); - - /* Set default watermarks */ - LPSPI_SetFifoWatermarks(base, (uint32_t)kLpspiDefaultTxWatermark, (uint32_t)kLpspiDefaultRxWatermark); - - /* Set Transmit Command Register*/ - base->TCR = LPSPI_TCR_CPOL(masterConfig->cpol) | LPSPI_TCR_CPHA(masterConfig->cpha) | - LPSPI_TCR_LSBF(masterConfig->direction) | LPSPI_TCR_FRAMESZ(masterConfig->bitsPerFrame - 1U) | - LPSPI_TCR_PRESCALE(tcrPrescaleValue) | LPSPI_TCR_PCS(masterConfig->whichPcs); - - LPSPI_Enable(base, true); - - (void)LPSPI_MasterSetDelayTimes(base, masterConfig->pcsToSckDelayInNanoSec, kLPSPI_PcsToSck, srcClock_Hz); - (void)LPSPI_MasterSetDelayTimes(base, masterConfig->lastSckToPcsDelayInNanoSec, kLPSPI_LastSckToPcs, srcClock_Hz); - (void)LPSPI_MasterSetDelayTimes(base, masterConfig->betweenTransferDelayInNanoSec, kLPSPI_BetweenTransfer, - srcClock_Hz); - - LPSPI_SetDummyData(base, LPSPI_DUMMY_DATA); -} - -/*! - * brief Sets the lpspi_master_config_t structure to default values. - * - * This API initializes the configuration structure for LPSPI_MasterInit(). - * The initialized structure can remain unchanged in LPSPI_MasterInit(), or can be modified - * before calling the LPSPI_MasterInit(). - * Example: - * code - * lpspi_master_config_t masterConfig; - * LPSPI_MasterGetDefaultConfig(&masterConfig); - * endcode - * param masterConfig pointer to lpspi_master_config_t structure - */ -void LPSPI_MasterGetDefaultConfig(lpspi_master_config_t *masterConfig) -{ - assert(masterConfig != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(masterConfig, 0, sizeof(*masterConfig)); - - masterConfig->baudRate = 500000; - masterConfig->bitsPerFrame = 8; - masterConfig->cpol = kLPSPI_ClockPolarityActiveHigh; - masterConfig->cpha = kLPSPI_ClockPhaseFirstEdge; - masterConfig->direction = kLPSPI_MsbFirst; - - masterConfig->pcsToSckDelayInNanoSec = (1000000000U / masterConfig->baudRate) / 2U; - masterConfig->lastSckToPcsDelayInNanoSec = (1000000000U / masterConfig->baudRate) / 2U; - masterConfig->betweenTransferDelayInNanoSec = (1000000000U / masterConfig->baudRate) / 2U; - - masterConfig->whichPcs = kLPSPI_Pcs0; - masterConfig->pcsActiveHighOrLow = kLPSPI_PcsActiveLow; - masterConfig->pcsFunc = kLPSPI_PcsAsCs; - - masterConfig->pinCfg = kLPSPI_SdiInSdoOut; - masterConfig->dataOutConfig = kLpspiDataOutRetained; - - masterConfig->enableInputDelay = false; -} - -/*! - * brief LPSPI slave configuration. - * - * param base LPSPI peripheral address. - * param slaveConfig Pointer to a structure lpspi_slave_config_t. - */ -void LPSPI_SlaveInit(LPSPI_Type *base, const lpspi_slave_config_t *slaveConfig) -{ - assert(slaveConfig != NULL); - - uint32_t instance = LPSPI_GetInstance(base); - - if(LP_FLEXCOMM_GetBaseAddress(instance) != 0U) - { -#if !(defined(LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) && LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) - /* initialize flexcomm to LPSPI mode */ - status_t status = LP_FLEXCOMM_Init(LPSPI_GetInstance(base), LP_FLEXCOMM_PERIPH_LPSPI); - if (kStatus_Success != status) - { - assert(false); - } -#endif /* LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER */ - } - else - { -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - - /* Enable LPSPI clock */ - (void)CLOCK_EnableClock(s_lpspiClocks[instance]); - -#if defined(LPSPI_PERIPH_CLOCKS) - (void)CLOCK_EnableClock(s_LpspiPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - } - - LPSPI_SetMasterSlaveMode(base, kLPSPI_Slave); - - LPSPI_SetOnePcsPolarity(base, slaveConfig->whichPcs, slaveConfig->pcsActiveHighOrLow); - - base->CFGR1 = (base->CFGR1 & ~(LPSPI_CFGR1_OUTCFG_MASK | LPSPI_CFGR1_PINCFG_MASK)) | - LPSPI_CFGR1_OUTCFG(slaveConfig->dataOutConfig) | LPSPI_CFGR1_PINCFG(slaveConfig->pinCfg); - - LPSPI_SetFifoWatermarks(base, (uint32_t)kLpspiDefaultTxWatermark, (uint32_t)kLpspiDefaultRxWatermark); - - base->TCR = LPSPI_TCR_CPOL(slaveConfig->cpol) | LPSPI_TCR_CPHA(slaveConfig->cpha) | - LPSPI_TCR_LSBF(slaveConfig->direction) | LPSPI_TCR_FRAMESZ(slaveConfig->bitsPerFrame - 1U); - - /* This operation will set the dummy data for edma transfer, no effect in interrupt way. */ - LPSPI_SetDummyData(base, LPSPI_DUMMY_DATA); - - LPSPI_Enable(base, true); -} - -/*! - * brief Sets the lpspi_slave_config_t structure to default values. - * - * This API initializes the configuration structure for LPSPI_SlaveInit(). - * The initialized structure can remain unchanged in LPSPI_SlaveInit() or can be modified - * before calling the LPSPI_SlaveInit(). - * Example: - * code - * lpspi_slave_config_t slaveConfig; - * LPSPI_SlaveGetDefaultConfig(&slaveConfig); - * endcode - * param slaveConfig pointer to lpspi_slave_config_t structure. - */ -void LPSPI_SlaveGetDefaultConfig(lpspi_slave_config_t *slaveConfig) -{ - assert(slaveConfig != NULL); - - /* Initializes the configure structure to zero. */ - (void)memset(slaveConfig, 0, sizeof(*slaveConfig)); - - slaveConfig->bitsPerFrame = 8; /*!< Bits per frame, minimum 8, maximum 4096.*/ - slaveConfig->cpol = kLPSPI_ClockPolarityActiveHigh; /*!< Clock polarity. */ - slaveConfig->cpha = kLPSPI_ClockPhaseFirstEdge; /*!< Clock phase. */ - slaveConfig->direction = kLPSPI_MsbFirst; /*!< MSB or LSB data shift direction. */ - - slaveConfig->whichPcs = kLPSPI_Pcs0; /*!< Desired Peripheral Chip Select (pcs) */ - slaveConfig->pcsActiveHighOrLow = kLPSPI_PcsActiveLow; /*!< Desired PCS active high or low */ - - slaveConfig->pinCfg = kLPSPI_SdiInSdoOut; - slaveConfig->dataOutConfig = kLpspiDataOutRetained; -} - -/*! - * brief Restores the LPSPI peripheral to reset state. Note that this function - * sets all registers to reset state. As a result, the LPSPI module can't work after calling - * this API. - * param base LPSPI peripheral address. - */ -void LPSPI_Reset(LPSPI_Type *base) -{ - /* Reset all internal logic and registers, except the Control Register. Remains set until cleared by software.*/ - base->CR |= LPSPI_CR_RST_MASK; - - /* Software reset doesn't reset the CR, so manual reset the FIFOs */ - base->CR |= LPSPI_CR_RRF_MASK | LPSPI_CR_RTF_MASK; - - /* Master logic is not reset and module is disabled.*/ - base->CR = 0x00U; -} - -/*! - * brief De-initializes the LPSPI peripheral. Call this API to disable the LPSPI clock. - * param base LPSPI peripheral address. - */ -void LPSPI_Deinit(LPSPI_Type *base) -{ - uint32_t instance = LPSPI_GetInstance(base); - - /* Reset to default value */ - LPSPI_Reset(base); - if(LP_FLEXCOMM_GetBaseAddress(instance) != 0U) - { -#if !(defined(LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) && LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) - LP_FLEXCOMM_Deinit(instance); -#endif - } - else - { -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable LPSPI clock */ - (void)CLOCK_DisableClock(s_lpspiClocks[instance]); - -#if defined(LPSPI_PERIPH_CLOCKS) - (void)CLOCK_DisableClock(s_LpspiPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - } -} - -static void LPSPI_SetOnePcsPolarity(LPSPI_Type *base, - lpspi_which_pcs_t pcs, - lpspi_pcs_polarity_config_t activeLowOrHigh) -{ - uint32_t cfgr1Value = 0; - /* Clear the PCS polarity bit */ - cfgr1Value = base->CFGR1 & ~(1UL << (LPSPI_CFGR1_PCSPOL_SHIFT + (uint32_t)pcs)); - - /* Configure the PCS polarity bit according to the activeLowOrHigh setting */ - base->CFGR1 = cfgr1Value | ((uint32_t)activeLowOrHigh << (LPSPI_CFGR1_PCSPOL_SHIFT + (uint32_t)pcs)); -} - -/*! - * brief Sets the LPSPI baud rate in bits per second. - * - * This function takes in the desired bitsPerSec (baud rate) and calculates the nearest - * possible baud rate without exceeding the desired baud rate and returns the - * calculated baud rate in bits-per-second. It requires the caller to provide - * the frequency of the module source clock (in Hertz). Note that the baud rate - * does not go into effect until the Transmit Control Register (TCR) is programmed - * with the prescale value. Hence, this function returns the prescale tcrPrescaleValue - * parameter for later programming in the TCR. The higher level - * peripheral driver should alert the user of an out of range baud rate input. - * - * Note that the LPSPI module must first be disabled before configuring this. - * Note that the LPSPI module must be configured for master mode before configuring this. - * - * param base LPSPI peripheral address. - * param baudRate_Bps The desired baud rate in bits per second. - * param srcClock_Hz Module source input clock in Hertz. - * param tcrPrescaleValue The TCR prescale value needed to program the TCR. - * return The actual calculated baud rate. This function may also return a "0" if the - * LPSPI is not configured for master mode or if the LPSPI module is not disabled. - */ - -uint32_t LPSPI_MasterSetBaudRate(LPSPI_Type *base, - uint32_t baudRate_Bps, - uint32_t srcClock_Hz, - uint32_t *tcrPrescaleValue) -{ - assert(tcrPrescaleValue != NULL); - - /* For master mode configuration only, if slave mode detected, return 0. - * Also, the LPSPI module needs to be disabled first, if enabled, return 0 - */ - if ((!LPSPI_IsMaster(base)) || ((base->CR & LPSPI_CR_MEN_MASK) != 0U)) - { - return 0U; - } - - uint32_t prescaler, bestPrescaler; - uint32_t scaler, bestScaler; - uint32_t realBaudrate, bestBaudrate; - uint32_t diff, min_diff; - uint32_t desiredBaudrate = baudRate_Bps; - - /* find combination of prescaler and scaler resulting in baudrate closest to the - * requested value - */ - min_diff = 0xFFFFFFFFU; - - /* Set to maximum divisor value bit settings so that if baud rate passed in is less - * than the minimum possible baud rate, then the SPI will be configured to the lowest - * possible baud rate - */ - bestPrescaler = 7; - bestScaler = 255; - - bestBaudrate = 0; /* required to avoid compilation warning */ - - /* In all for loops, if min_diff = 0, the exit for loop*/ - for (prescaler = 0U; prescaler < 8U; prescaler++) - { - if (min_diff == 0U) - { - break; - } - for (scaler = 0U; scaler < 256U; scaler++) - { - if (min_diff == 0U) - { - break; - } - realBaudrate = (srcClock_Hz / (s_baudratePrescaler[prescaler] * (scaler + 2U))); - - /* calculate the baud rate difference based on the conditional statement - * that states that the calculated baud rate must not exceed the desired baud rate - */ - if (desiredBaudrate >= realBaudrate) - { - diff = desiredBaudrate - realBaudrate; - if (min_diff > diff) - { - /* a better match found */ - min_diff = diff; - bestPrescaler = prescaler; - bestScaler = scaler; - bestBaudrate = realBaudrate; - } - } - } - } - - /* Write the best baud rate scalar to the CCR. - * Note, no need to check for error since we've already checked to make sure the module is - * disabled and in master mode. Also, there is a limit on the maximum divider so we will not - * exceed this. - */ -#if defined(FSL_FEATURE_LPSPI_HAS_CCR1) && FSL_FEATURE_LPSPI_HAS_CCR1 - /* When CCR1 is present, the CCR[DBT] and CCR[SCKDIV] is write only, all read will return 0 - The real DBT and SCKDIV can be obtained in CCR1, CCR[DBT]=CCR1[SCKSCK] and CCR[SCKDIV]=CCR1[SCKHLD]+CCR1[SCKSET] - So when changing either CCR[DBT] or CCR[SCKDIV] make sure the other value is not overwritten by 0 */ - base->CCR = base->CCR | LPSPI_CCR_DBT((base->CCR1 & LPSPI_CCR1_SCKSCK_MASK) >> LPSPI_CCR1_SCKSCK_SHIFT) | - LPSPI_CCR_SCKDIV(bestScaler); -#else - base->CCR = (base->CCR & ~LPSPI_CCR_SCKDIV_MASK) | LPSPI_CCR_SCKDIV(bestScaler); -#endif /* FSL_FEATURE_LPSPI_HAS_CCR1 */ - - /* return the best prescaler value for user to use later */ - *tcrPrescaleValue = bestPrescaler; - - /* return the actual calculated baud rate */ - return bestBaudrate; -} - -/*! - * brief Manually configures a specific LPSPI delay parameter (module must be disabled to - * change the delay values). - * - * This function configures the following: - * SCK to PCS delay, or - * PCS to SCK delay, or - * The configurations must occur between the transfer delay. - * - * The delay names are available in type lpspi_delay_type_t. - * - * The user passes the desired delay along with the delay value. - * This allows the user to directly set the delay values if they have - * pre-calculated them or if they simply wish to manually increment the value. - * - * Note that the LPSPI module must first be disabled before configuring this. - * Note that the LPSPI module must be configured for master mode before configuring this. - * - * param base LPSPI peripheral address. - * param scaler The 8-bit delay value 0x00 to 0xFF (255). - * param whichDelay The desired delay to configure, must be of type lpspi_delay_type_t. - */ -void LPSPI_MasterSetDelayScaler(LPSPI_Type *base, uint32_t scaler, lpspi_delay_type_t whichDelay) -{ - /*These settings are only relevant in master mode */ -#if defined(FSL_FEATURE_LPSPI_HAS_CCR1) && FSL_FEATURE_LPSPI_HAS_CCR1 - /* When CCR1 is present, the CCR[DBT] and CCR[SCKDIV] is write only, all read will return 0 - The real DBT and SCKDIV can be obtained in CCR1, CCR[DBT]=CCR1[SCKSCK] and CCR[SCKDIV]=CCR1[SCKHLD]+CCR1[SCKSET] - So when changing either CCR[DBT] or CCR[SCKDIV] make sure the other value is not overwritten by 0 */ - uint32_t dbt = (base->CCR1 & LPSPI_CCR1_SCKSCK_MASK) >> LPSPI_CCR1_SCKSCK_SHIFT; - uint32_t sckdiv = (base->CCR1 & LPSPI_CCR1_SCKHLD_MASK) >> LPSPI_CCR1_SCKHLD_SHIFT; - sckdiv += (base->CCR1 & LPSPI_CCR1_SCKSET_MASK) >> LPSPI_CCR1_SCKSET_SHIFT; - switch (whichDelay) - { - case kLPSPI_PcsToSck: - base->CCR = (base->CCR & (~LPSPI_CCR_PCSSCK_MASK)) | LPSPI_CCR_PCSSCK(scaler) | LPSPI_CCR_DBT(dbt) | - LPSPI_CCR_SCKDIV(sckdiv); - - break; - case kLPSPI_LastSckToPcs: - base->CCR = (base->CCR & (~LPSPI_CCR_SCKPCS_MASK)) | LPSPI_CCR_SCKPCS(scaler) | LPSPI_CCR_DBT(dbt) | - LPSPI_CCR_SCKDIV(sckdiv); - - break; - case kLPSPI_BetweenTransfer: - base->CCR = base->CCR | LPSPI_CCR_DBT(scaler) | LPSPI_CCR_SCKDIV(sckdiv); -#else - switch (whichDelay) - { - case kLPSPI_PcsToSck: - base->CCR = (base->CCR & (~LPSPI_CCR_PCSSCK_MASK)) | LPSPI_CCR_PCSSCK(scaler); - - break; - case kLPSPI_LastSckToPcs: - base->CCR = (base->CCR & (~LPSPI_CCR_SCKPCS_MASK)) | LPSPI_CCR_SCKPCS(scaler); - - break; - case kLPSPI_BetweenTransfer: - base->CCR = (base->CCR & (~LPSPI_CCR_DBT_MASK)) | LPSPI_CCR_DBT(scaler); -#endif /* FSL_FEATURE_LPSPI_HAS_CCR1 */ - break; - default: - assert(false); - break; - } -} - -/*! - * brief Calculates the delay based on the desired delay input in nanoseconds (module must be - * disabled to change the delay values). - * - * This function calculates the values for the following: - * SCK to PCS delay, or - * PCS to SCK delay, or - * The configurations must occur between the transfer delay. - * - * The delay names are available in type lpspi_delay_type_t. - * - * The user passes the desired delay and the desired delay value in - * nano-seconds. The function calculates the value needed for the desired delay parameter - * and returns the actual calculated delay because an exact delay match may not be possible. In this - * case, the closest match is calculated without going below the desired delay value input. - * It is possible to input a very large delay value that exceeds the capability of the part, in - * which case the maximum supported delay is returned. It is up to the higher level - * peripheral driver to alert the user of an out of range delay input. - * - * Note that the LPSPI module must be configured for master mode before configuring this. And note that - * the delayTime = LPSPI_clockSource / (PRESCALE * Delay_scaler). - * - * param base LPSPI peripheral address. - * param delayTimeInNanoSec The desired delay value in nano-seconds. - * param whichDelay The desired delay to configuration, which must be of type lpspi_delay_type_t. - * param srcClock_Hz Module source input clock in Hertz. - * return actual Calculated delay value in nano-seconds. - */ -uint32_t LPSPI_MasterSetDelayTimes(LPSPI_Type *base, - uint32_t delayTimeInNanoSec, - lpspi_delay_type_t whichDelay, - uint32_t srcClock_Hz) -{ - uint64_t realDelay, bestDelay; - uint32_t scaler, bestScaler; - uint32_t diff, min_diff; - uint64_t initialDelayNanoSec; - uint32_t clockDividedPrescaler; - - /* For delay between transfer, an additional scaler value is needed */ - uint32_t additionalScaler = 0; - - /*As the RM note, the LPSPI baud rate clock is itself divided by the PRESCALE setting, which can vary between - * transfers.*/ - clockDividedPrescaler = - srcClock_Hz / s_baudratePrescaler[(base->TCR & LPSPI_TCR_PRESCALE_MASK) >> LPSPI_TCR_PRESCALE_SHIFT]; - - /* Find combination of prescaler and scaler resulting in the delay closest to the requested value.*/ - min_diff = 0xFFFFFFFFU; - - /* Initialize scaler to max value to generate the max delay */ - bestScaler = 0xFFU; - - /* Calculate the initial (min) delay and maximum possible delay based on the specific delay as - * the delay divisors are slightly different based on which delay we are configuring. - */ - if (whichDelay == kLPSPI_BetweenTransfer) - { - /* First calculate the initial, default delay, note min delay is 2 clock cycles. Due to large size of - calculated values (uint64_t), we need to break up the calculation into several steps to ensure - accurate calculated results - */ - initialDelayNanoSec = 1000000000U; - initialDelayNanoSec *= 2U; - initialDelayNanoSec /= clockDividedPrescaler; - - /* Calculate the maximum delay */ - bestDelay = 1000000000U; - bestDelay *= 257U; /* based on DBT+2, or 255 + 2 */ - bestDelay /= clockDividedPrescaler; - - additionalScaler = 1U; - } - else - { - /* First calculate the initial, default delay, min delay is 1 clock cycle. Due to large size of calculated - values (uint64_t), we need to break up the calculation into several steps to ensure accurate calculated - results. - */ - initialDelayNanoSec = 1000000000U; - initialDelayNanoSec /= clockDividedPrescaler; - - /* Calculate the maximum delay */ - bestDelay = 1000000000U; - bestDelay *= 256U; /* based on SCKPCS+1 or PCSSCK+1, or 255 + 1 */ - bestDelay /= clockDividedPrescaler; - - additionalScaler = 0U; - } - - /* If the initial, default delay is already greater than the desired delay, then - * set the delay to their initial value (0) and return the delay. In other words, - * there is no way to decrease the delay value further. - */ - if (initialDelayNanoSec >= delayTimeInNanoSec) - { - LPSPI_MasterSetDelayScaler(base, 0, whichDelay); - return (uint32_t)initialDelayNanoSec; - } - - /* If min_diff = 0, the exit for loop */ - for (scaler = 0U; scaler < 256U; scaler++) - { - if (min_diff == 0U) - { - break; - } - /* Calculate the real delay value as we cycle through the scaler values. - Due to large size of calculated values (uint64_t), we need to break up the - calculation into several steps to ensure accurate calculated results - */ - realDelay = 1000000000U; - realDelay *= ((uint64_t)scaler + 1UL + (uint64_t)additionalScaler); - realDelay /= clockDividedPrescaler; - - /* calculate the delay difference based on the conditional statement - * that states that the calculated delay must not be less then the desired delay - */ - if (realDelay >= delayTimeInNanoSec) - { - diff = (uint32_t)(realDelay - (uint64_t)delayTimeInNanoSec); - if (min_diff > diff) - { - /* a better match found */ - min_diff = diff; - bestScaler = scaler; - bestDelay = realDelay; - } - } - } - - /* write the best scaler value for the delay */ - LPSPI_MasterSetDelayScaler(base, bestScaler, whichDelay); - - /* return the actual calculated delay value (in ns) */ - return (uint32_t)bestDelay; -} - -/*Transactional APIs -- Master*/ - -/*! - * brief Initializes the LPSPI master handle. - * - * This function initializes the LPSPI handle, which can be used for other LPSPI transactional APIs. Usually, for a - * specified LPSPI instance, call this API once to get the initialized handle. - - * param base LPSPI peripheral address. - * param handle LPSPI handle pointer to lpspi_master_handle_t. - * param callback DSPI callback. - * param userData callback function parameter. - */ -void LPSPI_MasterTransferCreateHandle(LPSPI_Type *base, - lpspi_master_handle_t *handle, - lpspi_master_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - uint32_t instance = LPSPI_GetInstance(base); - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - handle->callback = callback; - handle->userData = userData; - - if(LP_FLEXCOMM_GetBaseAddress(instance) != 0U) - { - lpspi_to_lpflexcomm_t handler; - handler.lpspi_master_handler = LPSPI_MasterTransferHandleIRQ; - - /* Save the handle in global variables to support the double weak mechanism. */ - LP_FLEXCOMM_SetIRQHandler(instance, handler.lpflexcomm_handler, handle, LP_FLEXCOMM_PERIPH_LPSPI); - } - else - { - s_lpspiHandle[instance] = handle; - - /* Set irq handler. */ - s_lpspiMasterIsr = LPSPI_MasterTransferHandleIRQ; - } -} - -/*! - * brief Check the argument for transfer . - * - * param base LPSPI peripheral address. - * param transfer the transfer struct to be used. - * param isEdma True to check for EDMA transfer, false to check interrupt non-blocking transfer - * return Return true for right and false for wrong. - */ -bool LPSPI_CheckTransferArgument(LPSPI_Type *base, lpspi_transfer_t *transfer, bool isEdma) -{ - assert(transfer != NULL); - uint32_t bitsPerFrame = ((base->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT) + 1U; - uint32_t bytesPerFrame = (bitsPerFrame + 7U) / 8U; - uint32_t temp = (base->CFGR1 & LPSPI_CFGR1_PINCFG_MASK); - /* If the transfer count is zero, then return immediately.*/ - if (transfer->dataSize == 0U) - { - return false; - } - - /* If both send buffer and receive buffer is null */ - if ((NULL == (transfer->txData)) && (NULL == (transfer->rxData))) - { - return false; - } - - /*The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4 . - *For bytesPerFrame greater than 4 situation: - *the transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not integer multiples of 4 , - *otherwise , the transfer data size can be integer multiples of bytesPerFrame. - */ - if (bytesPerFrame <= 4U) - { - if ((transfer->dataSize % bytesPerFrame) != 0U) - { - return false; - } - } - else - { - if ((bytesPerFrame % 4U) != 0U) - { - if (transfer->dataSize != bytesPerFrame) - { - return false; - } - } - else - { - if ((transfer->dataSize % bytesPerFrame) != 0U) - { - return false; - } - } - } - - /* Check if using 3-wire mode and the txData is NULL, set the output pin to tristated. */ - if ((temp == LPSPI_CFGR1_PINCFG(kLPSPI_SdiInSdiOut)) || (temp == LPSPI_CFGR1_PINCFG(kLPSPI_SdoInSdoOut))) - { - /* The 3-wire mode can't send and receive data at the same time. */ - if ((transfer->txData != NULL) && (transfer->rxData != NULL)) - { - return false; - } - if (NULL == transfer->txData) - { - base->CFGR1 |= LPSPI_CFGR1_OUTCFG_MASK; - } - } - - if (isEdma && ((bytesPerFrame % 4U) == 3U)) - { - return false; - } - - return true; -} - -/*! - * brief LPSPI master transfer data using a polling method. - * - * This function transfers data using a polling method. This is a blocking function, which does not return until all - * transfers have been completed. - * - * Note: - * The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not integer multiples of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * param base LPSPI peripheral address. - * param transfer pointer to lpspi_transfer_t structure. - * return status of status_t. - */ -status_t LPSPI_MasterTransferBlocking(LPSPI_Type *base, lpspi_transfer_t *transfer) -{ - assert(transfer != NULL); - - /* Check that LPSPI is not busy.*/ - if ((LPSPI_GetStatusFlags(base) & (uint32_t)kLPSPI_ModuleBusyFlag) != 0U) - { - return kStatus_LPSPI_Busy; - } - LPSPI_Enable(base, false); - /* Check arguements */ - if (!LPSPI_CheckTransferArgument(base, transfer, false)) - { - return kStatus_InvalidArgument; - } - - LPSPI_FlushFifo(base, true, true); - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_AllStatusFlag); - - /* Variables */ - bool isTxMask = false; - bool isByteSwap = ((transfer->configFlags & (uint32_t)kLPSPI_MasterByteSwap) != 0U); - uint8_t bytesEachWrite; - uint8_t bytesEachRead; - const uint8_t *txData = transfer->txData; - uint8_t *rxData = transfer->rxData; - uint8_t dummyData = g_lpspiDummyData[LPSPI_GetInstance(base)]; - uint32_t readData = 0U; - uint32_t txRemainingByteCount = transfer->dataSize; - uint32_t rxRemainingByteCount = transfer->dataSize; - uint32_t wordToSend = - ((uint32_t)dummyData) | ((uint32_t)dummyData << 8) | ((uint32_t)dummyData << 16) | ((uint32_t)dummyData << 24); - /*The TX and RX FIFO sizes are always the same*/ - uint32_t fifoSize = LPSPI_GetRxFifoSize(base); - uint32_t bytesPerFrame = ((base->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT) / 8U + 1U; - /* No need to configure PCS continous if the transfer byte count is smaller than frame size */ - bool isPcsContinuous = (((transfer->configFlags & (uint32_t)kLPSPI_MasterPcsContinuous) != 0U) && - (bytesPerFrame < transfer->dataSize)); - uint32_t rxFifoMaxBytes = MIN(bytesPerFrame, 4U) * fifoSize; - uint32_t whichPcs = (transfer->configFlags & LPSPI_MASTER_PCS_MASK) >> LPSPI_MASTER_PCS_SHIFT; - uint32_t width = (transfer->configFlags & LPSPI_MASTER_WIDTH_MASK) >> LPSPI_MASTER_WIDTH_SHIFT; - uint32_t temp = (base->CFGR1 & LPSPI_CFGR1_PINCFG_MASK); - -#if SPI_RETRY_TIMES - uint32_t waitTimes; -#endif - - /* Mask tx data in half duplex mode */ - if (((temp == LPSPI_CFGR1_PINCFG(kLPSPI_SdiInSdiOut)) || (temp == LPSPI_CFGR1_PINCFG(kLPSPI_SdoInSdoOut))) && - (txData == NULL)) - { - isTxMask = true; - } - - base->CFGR1 &= (~LPSPI_CFGR1_NOSTALL_MASK); - LPSPI_Enable(base, true); - - /* Configure transfer control register. */ - base->TCR = (base->TCR & ~(LPSPI_TCR_CONT_MASK | LPSPI_TCR_CONTC_MASK | LPSPI_TCR_RXMSK_MASK | - LPSPI_TCR_TXMSK_MASK | LPSPI_TCR_PCS_MASK)) | - LPSPI_TCR_PCS(whichPcs) | LPSPI_TCR_WIDTH(width); - - /*TCR is also shared the FIFO, so wait for TCR written.*/ - if (!LPSPI_TxFifoReady(base)) - { - return kStatus_LPSPI_Timeout; - } - - /* PCS should be configured separately from the other bits, otherwise it will not take effect. */ - base->TCR |= LPSPI_TCR_CONT(isPcsContinuous) | LPSPI_TCR_CONTC(isPcsContinuous) | LPSPI_TCR_RXMSK(NULL == rxData); - - /*TCR is also shared the FIFO, so wait for TCR written.*/ - if (!LPSPI_TxFifoReady(base)) - { - return kStatus_LPSPI_Timeout; - } - - if (bytesPerFrame <= 4U) - { - bytesEachWrite = (uint8_t)bytesPerFrame; - bytesEachRead = (uint8_t)bytesPerFrame; - } - else - { - bytesEachWrite = 4U; - bytesEachRead = 4U; - } - - /*Write the TX data until txRemainingByteCount is equal to 0 */ - while (txRemainingByteCount > 0U) - { - if (txRemainingByteCount < bytesEachWrite) - { - bytesEachWrite = (uint8_t)txRemainingByteCount; - } - - /*Wait until TX FIFO is not full*/ -#if SPI_RETRY_TIMES - waitTimes = SPI_RETRY_TIMES; - while ((LPSPI_GetTxFifoCount(base) == fifoSize) && (--waitTimes != 0U)) -#else - while (LPSPI_GetTxFifoCount(base) == fifoSize) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return kStatus_LPSPI_Timeout; - } -#endif - - /* To prevent rxfifo overflow, ensure transmitting and receiving are executed in parallel */ - if (((NULL == rxData) || (rxRemainingByteCount - txRemainingByteCount) < rxFifoMaxBytes)) - { - if (isTxMask) - { - /* When TCR[TXMSK]=1, transfer is initiate by writting a new command word to TCR. TCR[TXMSK] is cleared - by hardware every time when TCR[FRAMESZ] bit of data is transfered. - In this case TCR[TXMSK] should be set to initiate each transfer. */ - base->TCR |= LPSPI_TCR_TXMSK_MASK; - if (isPcsContinuous && (txRemainingByteCount == bytesPerFrame)) - { - /* For the last piece of frame size of data, if is PCS continous mode(TCR[CONT]), TCR[CONTC] should - * be cleared to de-assert the PCS. Be sure to clear the TXMSK as well otherwise another FRAMESZ - * of data will be received. */ - base->TCR &= ~(LPSPI_TCR_CONTC_MASK | LPSPI_TCR_CONT_MASK | LPSPI_TCR_TXMSK_MASK); - } - txRemainingByteCount -= bytesPerFrame; - } - else - { - if (txData != NULL) - { - wordToSend = LPSPI_CombineWriteData(txData, bytesEachWrite, isByteSwap); - txData += bytesEachWrite; - } - /* Otherwise push data to tx FIFO to initiate transfer */ - LPSPI_WriteData(base, wordToSend); - txRemainingByteCount -= bytesEachWrite; - } - } - - /* Check whether there is RX data in RX FIFO . Read out the RX data so that the RX FIFO would not overrun. */ - if ((rxData != NULL) && (rxRemainingByteCount != 0U)) - { - /* To ensure parallel execution in 3-wire mode, after writting 1 to TXMSK to generate clock of - bytesPerFrame's data wait until bytesPerFrame's data is received. */ - while (isTxMask && (LPSPI_GetRxFifoCount(base) == 0U)) - { - } -#if SPI_RETRY_TIMES - waitTimes = SPI_RETRY_TIMES; - while ((LPSPI_GetRxFifoCount(base) != 0U) && (--waitTimes != 0U)) -#else - while (LPSPI_GetRxFifoCount(base) != 0U) -#endif - { - readData = LPSPI_ReadData(base); - if (rxRemainingByteCount < bytesEachRead) - { - bytesEachRead = (uint8_t)rxRemainingByteCount; - } - - LPSPI_SeparateReadData(rxData, readData, bytesEachRead, isByteSwap); - rxData += bytesEachRead; - - rxRemainingByteCount -= bytesEachRead; - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return kStatus_LPSPI_Timeout; - } -#endif - } - } - - if (isPcsContinuous && !isTxMask) - { - /* In PCS continous mode(TCR[CONT]), after write all the data in TX FIFO, TCR[CONTC] and TCR[CONT] should be - cleared to de-assert the PCS. Note that TCR register also use the TX FIFO. Also CONTC should be cleared when - tx is not masked, otherwise written to TCR register with TXMSK bit wet will initiate a new transfer. */ -#if SPI_RETRY_TIMES - waitTimes = SPI_RETRY_TIMES; - while ((LPSPI_GetTxFifoCount(base) == fifoSize) && (--waitTimes != 0U)) -#else - while (LPSPI_GetTxFifoCount(base) == fifoSize) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return kStatus_LPSPI_Timeout; - } -#endif - base->TCR = (base->TCR & ~(LPSPI_TCR_CONTC_MASK | LPSPI_TCR_CONT_MASK)); - } - - /*Read out the RX data in FIFO*/ - if (rxData != NULL) - { - while (rxRemainingByteCount > 0U) - { -#if SPI_RETRY_TIMES - waitTimes = SPI_RETRY_TIMES; - while ((LPSPI_GetRxFifoCount(base) != 0U) && (--waitTimes != 0U)) -#else - while (LPSPI_GetRxFifoCount(base) != 0U) -#endif - { - readData = LPSPI_ReadData(base); - - if (rxRemainingByteCount < bytesEachRead) - { - bytesEachRead = (uint8_t)rxRemainingByteCount; - } - - LPSPI_SeparateReadData(rxData, readData, bytesEachRead, isByteSwap); - rxData += bytesEachRead; - - rxRemainingByteCount -= bytesEachRead; - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return kStatus_LPSPI_Timeout; - } -#endif - } - } - - /* Wait for transfer complete flag, that is the PCS is re-asserted. */ -#if SPI_RETRY_TIMES - waitTimes = SPI_RETRY_TIMES; - while (((LPSPI_GetStatusFlags(base) & (uint32_t)kLPSPI_TransferCompleteFlag) == 0U) && (--waitTimes != 0U)) -#else - while ((LPSPI_GetStatusFlags(base) & (uint32_t)kLPSPI_TransferCompleteFlag) == 0U) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return kStatus_LPSPI_Timeout; - } -#endif - - return kStatus_Success; -} - -/*! - * brief LPSPI master transfer data using an interrupt method. - * - * This function transfers data using an interrupt method. This is a non-blocking function, which returns right away. - * When all data is transferred, the callback function is called. - * - * Note: - * The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not integer multiples of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * param base LPSPI peripheral address. - * param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - * param transfer pointer to lpspi_transfer_t structure. - * return status of status_t. - */ -status_t LPSPI_MasterTransferNonBlocking(LPSPI_Type *base, lpspi_master_handle_t *handle, lpspi_transfer_t *transfer) -{ - assert(handle != NULL); - assert(transfer != NULL); - - /* Check that we're not busy.*/ - if (handle->state == (uint8_t)kLPSPI_Busy) - { - return kStatus_LPSPI_Busy; - } - - LPSPI_Enable(base, false); - /* Check arguements */ - if (!LPSPI_CheckTransferArgument(base, transfer, false)) - { - return kStatus_InvalidArgument; - } - - /* Flush FIFO, clear status, disable all the interrupts. */ - LPSPI_FlushFifo(base, true, true); - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_AllStatusFlag); - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_AllInterruptEnable); - - /* Variables */ - bool isRxMask = false; - handle->isTxMask = false; - uint8_t txWatermark; - uint8_t dummyData = g_lpspiDummyData[LPSPI_GetInstance(base)]; - uint32_t tmpTimes; - uint32_t whichPcs = (transfer->configFlags & LPSPI_MASTER_PCS_MASK) >> LPSPI_MASTER_PCS_SHIFT; - uint32_t temp = (base->CFGR1 & LPSPI_CFGR1_PINCFG_MASK); - - /* Assign the original value for members of transfer handle. */ - handle->state = (uint8_t)kLPSPI_Busy; - handle->txData = transfer->txData; - handle->rxData = transfer->rxData; - handle->txRemainingByteCount = transfer->dataSize; - handle->rxRemainingByteCount = transfer->dataSize; - handle->totalByteCount = transfer->dataSize; - handle->writeTcrInIsr = false; - handle->bytesPerFrame = (uint16_t)((base->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT) / 8U + 1U; - /* No need to configure PCS continous if the transfer byte count is smaller than frame size */ - bool isPcsContinuous = (((transfer->configFlags & (uint32_t)kLPSPI_MasterPcsContinuous) != 0U) && - (transfer->dataSize > handle->bytesPerFrame)); - handle->writeRegRemainingTimes = - (transfer->dataSize / (uint32_t)handle->bytesPerFrame) * (((uint32_t)handle->bytesPerFrame + 3U) / 4U); - handle->readRegRemainingTimes = handle->writeRegRemainingTimes; - handle->txBuffIfNull = - ((uint32_t)dummyData) | ((uint32_t)dummyData << 8) | ((uint32_t)dummyData << 16) | ((uint32_t)dummyData << 24); - /*The TX and RX FIFO sizes are always the same*/ - handle->fifoSize = LPSPI_GetRxFifoSize(base); - handle->isPcsContinuous = isPcsContinuous; - handle->isByteSwap = ((transfer->configFlags & (uint32_t)kLPSPI_MasterByteSwap) != 0U); - /*Calculate the bytes for write/read the TX/RX register each time*/ - if (handle->bytesPerFrame <= 4U) - { - handle->bytesEachWrite = (uint8_t)handle->bytesPerFrame; - handle->bytesEachRead = (uint8_t)handle->bytesPerFrame; - } - else - { - handle->bytesEachWrite = 4U; - handle->bytesEachRead = 4U; - } - - /*Set the RX and TX watermarks to reduce the ISR times.*/ - if (handle->fifoSize > 1U) - { - txWatermark = 1U; - handle->rxWatermark = handle->fifoSize - 2U; - } - else - { - txWatermark = 0U; - handle->rxWatermark = 0U; - } - LPSPI_SetFifoWatermarks(base, txWatermark, handle->rxWatermark); - - /* If there is no rxData, mask the receive data so that receive data is not stored in receive FIFO. */ - if (handle->rxData == NULL) - { - isRxMask = true; - handle->rxRemainingByteCount = 0; - } - - /* Mask tx data in half duplex mode since the tx/rx share the same pin, so that the data received from slave is not - * interfered. */ - if (((temp == LPSPI_CFGR1_PINCFG(kLPSPI_SdiInSdiOut)) || (temp == LPSPI_CFGR1_PINCFG(kLPSPI_SdoInSdoOut))) && - (handle->txData == NULL)) - { - handle->isTxMask = true; - } - - /*Transfers will stall when transmit FIFO is empty or receive FIFO is full. */ - base->CFGR1 &= (~LPSPI_CFGR1_NOSTALL_MASK); - - /* Enable module for following configuration of TCR to take effect. */ - LPSPI_Enable(base, true); - - /* Configure transfer control register. */ - base->TCR = (base->TCR & ~(LPSPI_TCR_CONT_MASK | LPSPI_TCR_CONTC_MASK | LPSPI_TCR_RXMSK_MASK | - LPSPI_TCR_TXMSK_MASK | LPSPI_TCR_PCS_MASK)) | - LPSPI_TCR_PCS(whichPcs); - - /*TCR is also shared the FIFO , so wait for TCR written.*/ - if (!LPSPI_TxFifoReady(base)) - { - return kStatus_LPSPI_Timeout; - } - - /* PCS should be configured separately from the other bits, otherwise it will not take effect. */ - base->TCR |= LPSPI_TCR_CONT(isPcsContinuous) | LPSPI_TCR_CONTC(isPcsContinuous) | LPSPI_TCR_RXMSK(isRxMask); - - /* Enable the NVIC for LPSPI peripheral. Note that below code is useless if the LPSPI interrupt is in INTMUX , - * and you should also enable the INTMUX interupt in your application. - */ - (void)EnableIRQ(s_lpspiIRQ[LPSPI_GetInstance(base)]); - - /*TCR is also shared the FIFO , so wait for TCR written.*/ - if (!LPSPI_TxFifoReady(base)) - { - return kStatus_LPSPI_Timeout; - } - - if (handle->isTxMask) - { - /* When TCR[TXMSK]=1, transfer is initiate by writting a new command word to TCR. TCR[TXMSK] is cleared by - hardware every time when TCR[FRAMESZ] bit of data is transfered. In this case TCR[TXMSK] should be set to - initiate each transfer. */ - - base->TCR |= LPSPI_TCR_TXMSK_MASK; - handle->txRemainingByteCount -= (uint32_t)handle->bytesPerFrame; - } - else - { - /* Fill up the TX data in FIFO to initiate transfer */ - LPSPI_MasterTransferFillUpTxFifo(base, handle); - } - - /* Since SPI is a synchronous interface, we only need to enable the RX interrupt if there is RX data. - * The IRQ handler will get the status of RX and TX interrupt flags. - */ - if (handle->rxData != NULL) - { - if (handle->isTxMask) - { - /* if tx data is masked, transfer is initiated by writing 1 to TCR[TXMSK] and TCR[FRMESZ] bits of data is - read. If rx water mark is set larger than TCR[FRMESZ], rx interrupt will not be generated. Lower the rx - water mark setting */ - if ((handle->bytesPerFrame / 4U) < (uint16_t)handle->rxWatermark) - { - handle->rxWatermark = - (uint8_t)(handle->bytesPerFrame / 4U) > 0U ? (uint8_t)(handle->bytesPerFrame / 4U - 1U) : 0U; - base->FCR = (base->FCR & (~LPSPI_FCR_RXWATER_MASK)) | LPSPI_FCR_RXWATER(handle->rxWatermark); - } - } - else - { - /*Set rxWatermark to (readRegRemainingTimes-1) if readRegRemainingTimes less than rxWatermark. Otherwise - *there is not RX interrupt for the last datas because the RX count is not greater than rxWatermark. - */ - tmpTimes = handle->readRegRemainingTimes; - if (tmpTimes <= handle->rxWatermark) - { - base->FCR = (base->FCR & (~LPSPI_FCR_RXWATER_MASK)) | LPSPI_FCR_RXWATER(tmpTimes - 1U); - } - } - - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_RxInterruptEnable); - } - else - { - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_TxInterruptEnable); - } - - return kStatus_Success; -} - -static void LPSPI_MasterTransferFillUpTxFifo(LPSPI_Type *base, lpspi_master_handle_t *handle) -{ - assert(handle != NULL); - - uint32_t wordToSend = 0; - uint8_t fifoSize = handle->fifoSize; - uint32_t writeRegRemainingTimes = handle->writeRegRemainingTimes; - uint32_t readRegRemainingTimes = handle->readRegRemainingTimes; - size_t txRemainingByteCount = handle->txRemainingByteCount; - uint8_t bytesEachWrite = handle->bytesEachWrite; - bool isByteSwap = handle->isByteSwap; - - /* Make sure the difference in remaining TX and RX byte counts does not exceed FIFO depth - * and that the number of TX FIFO entries does not exceed the FIFO depth. - * But no need to make the protection if there is no rxData. - */ - while ((LPSPI_GetTxFifoCount(base) < fifoSize) && - (((readRegRemainingTimes - writeRegRemainingTimes) < (uint32_t)fifoSize) || (handle->rxData == NULL))) - { - if (txRemainingByteCount < (size_t)bytesEachWrite) - { - handle->bytesEachWrite = (uint8_t)txRemainingByteCount; - bytesEachWrite = handle->bytesEachWrite; - } - - if (handle->txData != NULL) - { - wordToSend = LPSPI_CombineWriteData(handle->txData, bytesEachWrite, isByteSwap); - handle->txData += bytesEachWrite; - } - else - { - wordToSend = handle->txBuffIfNull; - } - - /*Write the word to TX register*/ - LPSPI_WriteData(base, wordToSend); - - /*Decrease the write TX register times.*/ - --handle->writeRegRemainingTimes; - writeRegRemainingTimes = handle->writeRegRemainingTimes; - - /*Decrease the remaining TX byte count.*/ - handle->txRemainingByteCount -= (size_t)bytesEachWrite; - txRemainingByteCount = handle->txRemainingByteCount; - - if (handle->txRemainingByteCount == 0U) - { - /* If PCS is continuous, update TCR to de-assert PCS */ - if (handle->isPcsContinuous) - { - /* Only write to the TCR if the FIFO has room */ - if (LPSPI_GetTxFifoCount(base) < fifoSize) - { - base->TCR = (base->TCR & ~(LPSPI_TCR_CONTC_MASK)); - handle->writeTcrInIsr = false; - } - /* Else, set a global flag to tell the ISR to do write to the TCR */ - else - { - handle->writeTcrInIsr = true; - } - } - break; - } - } -} - -static void LPSPI_MasterTransferComplete(LPSPI_Type *base, lpspi_master_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable interrupt requests*/ - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_AllInterruptEnable); - - handle->state = (uint8_t)kLPSPI_Idle; - - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_Success, handle->userData); - } -} - -/*! - * brief Gets the master transfer remaining bytes. - * - * This function gets the master transfer remaining bytes. - * - * param base LPSPI peripheral address. - * param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - * param count Number of bytes transferred so far by the non-blocking transaction. - * return status of status_t. - */ -status_t LPSPI_MasterTransferGetCount(LPSPI_Type *base, lpspi_master_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (handle->state != (uint8_t)kLPSPI_Busy) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - size_t remainingByte; - - if (handle->rxData != NULL) - { - remainingByte = handle->rxRemainingByteCount; - } - else - { - remainingByte = handle->txRemainingByteCount; - } - - *count = handle->totalByteCount - remainingByte; - - return kStatus_Success; -} - -/*! - * brief LPSPI master abort transfer which uses an interrupt method. - * - * This function aborts a transfer which uses an interrupt method. - * - * param base LPSPI peripheral address. - * param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - */ -void LPSPI_MasterTransferAbort(LPSPI_Type *base, lpspi_master_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable interrupt requests*/ - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_AllInterruptEnable); - - LPSPI_Reset(base); - - handle->state = (uint8_t)kLPSPI_Idle; - handle->txRemainingByteCount = 0; - handle->rxRemainingByteCount = 0; -} - -/*! - * brief LPSPI Master IRQ handler function. - * - * This function processes the LPSPI transmit and receive IRQ. - * - * param instance LPSPI instance. - * param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - */ -void LPSPI_MasterTransferHandleIRQ(uint32_t instance, lpspi_master_handle_t *handle) -{ - assert(handle != NULL); - assert(instance < ARRAY_SIZE(s_lpspiBases)); - LPSPI_Type *base = s_lpspiBases[instance]; - uint32_t readData; - uint8_t bytesEachRead = handle->bytesEachRead; - bool isByteSwap = handle->isByteSwap; - uint32_t readRegRemainingTimes = handle->readRegRemainingTimes; - - if (handle->rxData != NULL) - { - if (handle->rxRemainingByteCount != 0U) - { - /* First, disable the interrupts to avoid potentially triggering another interrupt - * while reading out the RX FIFO as more data may be coming into the RX FIFO. We'll - * re-enable the interrupts based on the LPSPI state after reading out the FIFO. - */ - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_RxInterruptEnable); - - while ((LPSPI_GetRxFifoCount(base) != 0U) && (handle->rxRemainingByteCount != 0U)) - { - /*Read out the data*/ - readData = LPSPI_ReadData(base); - - /*Decrease the read RX register times.*/ - --handle->readRegRemainingTimes; - readRegRemainingTimes = handle->readRegRemainingTimes; - - if (handle->rxRemainingByteCount < (size_t)bytesEachRead) - { - handle->bytesEachRead = (uint8_t)(handle->rxRemainingByteCount); - bytesEachRead = handle->bytesEachRead; - } - - LPSPI_SeparateReadData(handle->rxData, readData, bytesEachRead, isByteSwap); - handle->rxData += bytesEachRead; - - /*Decrease the remaining RX byte count.*/ - handle->rxRemainingByteCount -= (size_t)bytesEachRead; - } - - /* Re-enable the interrupts only if rxCount indicates there is more data to receive, - * else we may get a spurious interrupt. - * */ - if (handle->rxRemainingByteCount != 0U) - { - /* Set the TDF and RDF interrupt enables simultaneously to avoid race conditions */ - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_RxInterruptEnable); - } - } - - /*Set rxWatermark to (readRegRemainingTimes-1) if readRegRemainingTimes less than rxWatermark. Otherwise there - *is not RX interrupt for the last datas because the RX count is not greater than rxWatermark. - */ - if (readRegRemainingTimes <= (uint32_t)handle->rxWatermark) - { - base->FCR = (base->FCR & (~LPSPI_FCR_RXWATER_MASK)) | - LPSPI_FCR_RXWATER((readRegRemainingTimes > 1U) ? (readRegRemainingTimes - 1U) : (0U)); - } - } - - if (handle->txRemainingByteCount != 0U) - { - if (handle->isTxMask) - { - /* When TCR[TXMSK]=1, transfer is initiate by writting a new command word to TCR. TCR[TXMSK] is cleared by - hardware every time when TCR[FRAMESZ] bit of data is transfered. - In this case TCR[TXMSK] should be set to initiate each transfer. */ - base->TCR |= LPSPI_TCR_TXMSK_MASK; - if ((handle->txRemainingByteCount == (uint32_t)handle->bytesPerFrame) && (handle->isPcsContinuous)) - { - /* For the last piece of frame size of data, if is PCS continous mode(TCR[CONT]), TCR[CONTC] should - * be cleared to de-assert the PCS. Be sure to clear the TXMSK as well otherwise another FRAMESZ - * of data will be received. */ - base->TCR &= ~(LPSPI_TCR_CONTC_MASK | LPSPI_TCR_CONT_MASK | LPSPI_TCR_TXMSK_MASK); - } - handle->txRemainingByteCount -= (uint32_t)handle->bytesPerFrame; - } - else - { - LPSPI_MasterTransferFillUpTxFifo(base, handle); - } - } - else - { - if ((LPSPI_GetTxFifoCount(base) < (handle->fifoSize))) - { - if ((handle->isPcsContinuous) && (handle->writeTcrInIsr) && (!handle->isTxMask)) - { - base->TCR = (base->TCR & ~(LPSPI_TCR_CONTC_MASK)); - handle->writeTcrInIsr = false; - } - } - } - - if ((handle->txRemainingByteCount == 0U) && (handle->rxRemainingByteCount == 0U) && (!handle->writeTcrInIsr)) - { - /* If no RX buffer, then transfer is not complete until transfer complete flag sets */ - if (handle->rxData == NULL) - { - if ((LPSPI_GetStatusFlags(base) & (uint32_t)kLPSPI_TransferCompleteFlag) != 0U) - { - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_TransferCompleteFlag); - /* Complete the transfer and disable the interrupts */ - LPSPI_MasterTransferComplete(base, handle); - } - else - { - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_TransferCompleteInterruptEnable); - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_TxInterruptEnable | (uint32_t)kLPSPI_RxInterruptEnable); - } - } - else - { - /* Complete the transfer and disable the interrupts */ - LPSPI_MasterTransferComplete(base, handle); - } - } -} - -/*Transactional APIs -- Slave*/ -/*! - * brief Initializes the LPSPI slave handle. - * - * This function initializes the LPSPI handle, which can be used for other LPSPI transactional APIs. Usually, for a - * specified LPSPI instance, call this API once to get the initialized handle. - * - * param base LPSPI peripheral address. - * param handle LPSPI handle pointer to lpspi_slave_handle_t. - * param callback DSPI callback. - * param userData callback function parameter. - */ -void LPSPI_SlaveTransferCreateHandle(LPSPI_Type *base, - lpspi_slave_handle_t *handle, - lpspi_slave_transfer_callback_t callback, - void *userData) -{ - assert(handle != NULL); - - /* Get instance from peripheral base address. */ - uint32_t instance = LPSPI_GetInstance(base); - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - handle->callback = callback; - handle->userData = userData; - - if(LP_FLEXCOMM_GetBaseAddress(instance) != 0U) - { - lpspi_to_lpflexcomm_t handler; - handler.lpspi_slave_handler = LPSPI_SlaveTransferHandleIRQ; - - /* Save the handle in global variables to support the double weak mechanism. */ - LP_FLEXCOMM_SetIRQHandler(instance, handler.lpflexcomm_handler, handle, LP_FLEXCOMM_PERIPH_LPSPI); - } - else - { - s_lpspiHandle[instance] = handle; - - /* Set irq handler. */ - s_lpspiSlaveIsr = LPSPI_SlaveTransferHandleIRQ; - } -} - -/*! - * brief LPSPI slave transfer data using an interrupt method. - * - * This function transfer data using an interrupt method. This is a non-blocking function, which returns right away. - * When all data is transferred, the callback function is called. - * - * Note: - * The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not an integer multiple of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * param base LPSPI peripheral address. - * param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - * param transfer pointer to lpspi_transfer_t structure. - * return status of status_t. - */ -status_t LPSPI_SlaveTransferNonBlocking(LPSPI_Type *base, lpspi_slave_handle_t *handle, lpspi_transfer_t *transfer) -{ - assert(handle != NULL); - assert(transfer != NULL); - - /* Check that we're not busy.*/ - if (handle->state == (uint8_t)kLPSPI_Busy) - { - return kStatus_LPSPI_Busy; - } - LPSPI_Enable(base, false); - /* Check arguements */ - if (!LPSPI_CheckTransferArgument(base, transfer, false)) - { - return kStatus_InvalidArgument; - } - - /* Flush FIFO, clear status, disable all the inerrupts. */ - LPSPI_FlushFifo(base, true, true); - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_AllStatusFlag); - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_AllInterruptEnable); - - /* Variables */ - bool isRxMask = false; - bool isTxMask = false; - uint8_t txWatermark; - uint32_t readRegRemainingTimes; - uint32_t whichPcs = (transfer->configFlags & LPSPI_SLAVE_PCS_MASK) >> LPSPI_SLAVE_PCS_SHIFT; - uint32_t bytesPerFrame = ((base->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT) / 8U + 1U; - - /* Assign the original value for members of transfer handle. */ - handle->state = (uint8_t)kLPSPI_Busy; - handle->txData = transfer->txData; - handle->rxData = transfer->rxData; - handle->txRemainingByteCount = transfer->dataSize; - handle->rxRemainingByteCount = transfer->dataSize; - handle->totalByteCount = transfer->dataSize; - handle->writeRegRemainingTimes = (transfer->dataSize / bytesPerFrame) * ((bytesPerFrame + 3U) / 4U); - handle->readRegRemainingTimes = handle->writeRegRemainingTimes; - /*The TX and RX FIFO sizes are always the same*/ - handle->fifoSize = LPSPI_GetRxFifoSize(base); - handle->isByteSwap = ((transfer->configFlags & (uint32_t)kLPSPI_SlaveByteSwap) != 0U); - /*Calculate the bytes for write/read the TX/RX register each time*/ - if (bytesPerFrame <= 4U) - { - handle->bytesEachWrite = (uint8_t)bytesPerFrame; - handle->bytesEachRead = (uint8_t)bytesPerFrame; - } - else - { - handle->bytesEachWrite = 4U; - handle->bytesEachRead = 4U; - } - /* Set proper RX and TX watermarks to reduce the ISR response times. */ - if (handle->fifoSize > 1U) - { - txWatermark = 1U; - handle->rxWatermark = handle->fifoSize - 2U; - } - else - { - txWatermark = 0U; - handle->rxWatermark = 0U; - } - LPSPI_SetFifoWatermarks(base, txWatermark, handle->rxWatermark); - - /* If there is no rxData, mask the receive data so that receive data is not stored in receive FIFO. */ - if (handle->rxData == NULL) - { - isRxMask = true; - handle->rxRemainingByteCount = 0U; - } - /* If there is no txData, mask the transmit data so that no data is loaded from transmit FIFO and output pin - * is tristated. */ - if (handle->txData == NULL) - { - isTxMask = true; - handle->txRemainingByteCount = 0U; - } - - /* Enable module for following configuration of TCR to take effect. */ - LPSPI_Enable(base, true); - - base->TCR = (base->TCR & ~(LPSPI_TCR_CONT_MASK | LPSPI_TCR_CONTC_MASK | LPSPI_TCR_RXMSK_MASK | - LPSPI_TCR_TXMSK_MASK | LPSPI_TCR_PCS_MASK)) | - LPSPI_TCR_RXMSK(isRxMask) | LPSPI_TCR_TXMSK(isTxMask) | LPSPI_TCR_PCS(whichPcs); - - /* Enable the NVIC for LPSPI peripheral. Note that below code is useless if the LPSPI interrupt is in INTMUX , - * and you should also enable the INTMUX interupt in your application. - */ - (void)EnableIRQ(s_lpspiIRQ[LPSPI_GetInstance(base)]); - - /*TCR is also shared the FIFO, so wait for TCR written.*/ - if (!LPSPI_TxFifoReady(base)) - { - return kStatus_LPSPI_Timeout; - } - - /* Fill up the TX data in FIFO */ - if (handle->txData != NULL) - { - LPSPI_SlaveTransferFillUpTxFifo(base, handle); - } - - /* Since SPI is a synchronous interface, we only need to enable the RX interrupt if there is RX data. - * The IRQ handler will get the status of RX and TX interrupt flags. - */ - if (handle->rxData != NULL) - { - /*Set rxWatermark to (readRegRemainingTimes-1) if readRegRemainingTimes less than rxWatermark. Otherwise there - *is not RX interrupt for the last datas because the RX count is not greater than rxWatermark. - */ - readRegRemainingTimes = handle->readRegRemainingTimes; - if (readRegRemainingTimes <= (uint32_t)handle->rxWatermark) - { - base->FCR = (base->FCR & (~LPSPI_FCR_RXWATER_MASK)) | LPSPI_FCR_RXWATER(readRegRemainingTimes - 1U); - } - - /* RX request and FIFO overflow request enable */ - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_RxInterruptEnable | (uint32_t)kLPSPI_ReceiveErrorInterruptEnable); - } - else - { - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_TxInterruptEnable); - } - - if (handle->txData != NULL) - { - /* TX FIFO underflow request enable */ - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_TransmitErrorInterruptEnable); - } - - return kStatus_Success; -} - -static void LPSPI_SlaveTransferFillUpTxFifo(LPSPI_Type *base, lpspi_slave_handle_t *handle) -{ - assert(handle != NULL); - - uint32_t wordToSend = 0U; - uint8_t bytesEachWrite = handle->bytesEachWrite; - bool isByteSwap = handle->isByteSwap; - - while (LPSPI_GetTxFifoCount(base) < (handle->fifoSize)) - { - if (handle->txRemainingByteCount < (size_t)bytesEachWrite) - { - handle->bytesEachWrite = (uint8_t)handle->txRemainingByteCount; - bytesEachWrite = handle->bytesEachWrite; - } - - wordToSend = LPSPI_CombineWriteData(handle->txData, bytesEachWrite, isByteSwap); - handle->txData += bytesEachWrite; - - /*Decrease the remaining TX byte count.*/ - handle->txRemainingByteCount -= (size_t)bytesEachWrite; - - /*Write the word to TX register*/ - LPSPI_WriteData(base, wordToSend); - - if (handle->txRemainingByteCount == 0U) - { - break; - } - } -} - -static void LPSPI_SlaveTransferComplete(LPSPI_Type *base, lpspi_slave_handle_t *handle) -{ - assert(handle != NULL); - - status_t status = kStatus_Success; - - /* Disable interrupt requests*/ - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_AllInterruptEnable); - - if (handle->state == (uint8_t)kLPSPI_Error) - { - status = kStatus_LPSPI_Error; - } - else - { - status = kStatus_Success; - } - - handle->state = (uint8_t)kLPSPI_Idle; - - if (handle->callback != NULL) - { - handle->callback(base, handle, status, handle->userData); - } -} - -/*! - * brief Gets the slave transfer remaining bytes. - * - * This function gets the slave transfer remaining bytes. - * - * param base LPSPI peripheral address. - * param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - * param count Number of bytes transferred so far by the non-blocking transaction. - * return status of status_t. - */ -status_t LPSPI_SlaveTransferGetCount(LPSPI_Type *base, lpspi_slave_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (handle->state != (uint8_t)kLPSPI_Busy) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - size_t remainingByte; - - if (handle->rxData != NULL) - { - remainingByte = handle->rxRemainingByteCount; - } - else - { - remainingByte = handle->txRemainingByteCount; - } - - *count = handle->totalByteCount - remainingByte; - - return kStatus_Success; -} - -/*! - * brief LPSPI slave aborts a transfer which uses an interrupt method. - * - * This function aborts a transfer which uses an interrupt method. - * - * param base LPSPI peripheral address. - * param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - */ -void LPSPI_SlaveTransferAbort(LPSPI_Type *base, lpspi_slave_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable interrupt requests*/ - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_TxInterruptEnable | (uint32_t)kLPSPI_RxInterruptEnable); - - LPSPI_Reset(base); - - handle->state = (uint8_t)kLPSPI_Idle; - handle->txRemainingByteCount = 0U; - handle->rxRemainingByteCount = 0U; -} - -/*! - * brief LPSPI Slave IRQ handler function. - * - * This function processes the LPSPI transmit and receives an IRQ. - * - * param instance LPSPI instance index. - * param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - */ -void LPSPI_SlaveTransferHandleIRQ(uint32_t instance, lpspi_slave_handle_t *handle) -{ - assert(handle != NULL); - assert(instance < ARRAY_SIZE(s_lpspiBases)); - LPSPI_Type *base = s_lpspiBases[instance]; - uint32_t readData; /* variable to store word read from RX FIFO */ - uint8_t bytesEachRead = handle->bytesEachRead; - bool isByteSwap = handle->isByteSwap; - uint32_t readRegRemainingTimes; - - if (handle->rxData != NULL) - { - if (handle->rxRemainingByteCount > 0U) - { - while (LPSPI_GetRxFifoCount(base) != 0U) - { - /*Read out the data*/ - readData = LPSPI_ReadData(base); - - /*Decrease the read RX register times.*/ - --handle->readRegRemainingTimes; - - if (handle->rxRemainingByteCount < (size_t)bytesEachRead) - { - handle->bytesEachRead = (uint8_t)handle->rxRemainingByteCount; - bytesEachRead = handle->bytesEachRead; - } - - LPSPI_SeparateReadData(handle->rxData, readData, bytesEachRead, isByteSwap); - handle->rxData += bytesEachRead; - - /*Decrease the remaining RX byte count.*/ - handle->rxRemainingByteCount -= (size_t)bytesEachRead; - - if ((handle->txRemainingByteCount > 0U) && (handle->txData != NULL)) - { - LPSPI_SlaveTransferFillUpTxFifo(base, handle); - } - - if (handle->rxRemainingByteCount == 0U) - { - break; - } - } - } - - /*Set rxWatermark to (readRegRemainingTimes-1) if readRegRemainingTimes less than rxWatermark. Otherwise there - *is not RX interrupt for the last datas because the RX count is not greater than rxWatermark. - */ - readRegRemainingTimes = handle->readRegRemainingTimes; - if (readRegRemainingTimes <= (uint32_t)handle->rxWatermark) - { - base->FCR = (base->FCR & (~LPSPI_FCR_RXWATER_MASK)) | - LPSPI_FCR_RXWATER((readRegRemainingTimes > 1U) ? (readRegRemainingTimes - 1U) : (0U)); - } - } - if ((handle->rxData == NULL) && (handle->txRemainingByteCount != 0U) && (handle->txData != NULL)) - { - LPSPI_SlaveTransferFillUpTxFifo(base, handle); - } - - if ((handle->txRemainingByteCount == 0U) && (handle->rxRemainingByteCount == 0U)) - { - /* If no RX buffer, then transfer is not complete until transfer complete flag sets and the TX FIFO empty*/ - if (handle->rxData == NULL) - { - if (((LPSPI_GetStatusFlags(base) & (uint32_t)kLPSPI_FrameCompleteFlag) != 0U) && - (LPSPI_GetTxFifoCount(base) == 0U)) - { - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_FrameCompleteFlag); - /* Complete the transfer and disable the interrupts */ - LPSPI_SlaveTransferComplete(base, handle); - } - else - { - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_FrameCompleteFlag); - LPSPI_EnableInterrupts(base, (uint32_t)kLPSPI_FrameCompleteInterruptEnable); - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_TxInterruptEnable | (uint32_t)kLPSPI_RxInterruptEnable); - } - } - else - { - /* Complete the transfer and disable the interrupts */ - LPSPI_SlaveTransferComplete(base, handle); - } - } - - /* Catch tx fifo underflow conditions, service only if tx under flow interrupt enabled */ - if (((LPSPI_GetStatusFlags(base) & (uint32_t)kLPSPI_TransmitErrorFlag) != 0U) && - ((base->IER & LPSPI_IER_TEIE_MASK) != 0U)) - { - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_TransmitErrorFlag); - /* Change state to error and clear flag */ - if (handle->txData != NULL) - { - handle->state = (uint8_t)kLPSPI_Error; - } - handle->errorCount++; - /* ERR051588: Clear FIFO after underrun occurs */ - LPSPI_FlushFifo(base, true, false); - } - /* Catch rx fifo overflow conditions, service only if rx over flow interrupt enabled */ - if (((LPSPI_GetStatusFlags(base) & (uint32_t)kLPSPI_ReceiveErrorFlag) != 0U) && - ((base->IER & LPSPI_IER_REIE_MASK) != 0U)) - { - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_ReceiveErrorFlag); - /* Change state to error and clear flag */ - if (handle->txData != NULL) - { - handle->state = (uint8_t)kLPSPI_Error; - } - handle->errorCount++; - } -} - -static uint32_t LPSPI_CombineWriteData(const uint8_t *txData, uint8_t bytesEachWrite, bool isByteSwap) -{ - assert(txData != NULL); - - uint32_t wordToSend = 0U; - - switch (bytesEachWrite) - { - case 1: - wordToSend = *txData; - ++txData; - break; - - case 2: - if (!isByteSwap) - { - wordToSend = *txData; - ++txData; - wordToSend |= (unsigned)(*txData) << 8U; - ++txData; - } - else - { - wordToSend = (unsigned)(*txData) << 8U; - ++txData; - wordToSend |= *txData; - ++txData; - } - - break; - - case 3: - if (!isByteSwap) - { - wordToSend = *txData; - ++txData; - wordToSend |= (unsigned)(*txData) << 8U; - ++txData; - wordToSend |= (unsigned)(*txData) << 16U; - ++txData; - } - else - { - wordToSend = (unsigned)(*txData) << 16U; - ++txData; - wordToSend |= (unsigned)(*txData) << 8U; - ++txData; - wordToSend |= *txData; - ++txData; - } - break; - - case 4: - if (!isByteSwap) - { - wordToSend = *txData; - ++txData; - wordToSend |= (unsigned)(*txData) << 8U; - ++txData; - wordToSend |= (unsigned)(*txData) << 16U; - ++txData; - wordToSend |= (unsigned)(*txData) << 24U; - ++txData; - } - else - { - wordToSend = (unsigned)(*txData) << 24U; - ++txData; - wordToSend |= (unsigned)(*txData) << 16U; - ++txData; - wordToSend |= (unsigned)(*txData) << 8U; - ++txData; - wordToSend |= *txData; - ++txData; - } - break; - - default: - assert(false); - break; - } - return wordToSend; -} - -static void LPSPI_SeparateReadData(uint8_t *rxData, uint32_t readData, uint8_t bytesEachRead, bool isByteSwap) -{ - assert(rxData != NULL); - - switch (bytesEachRead) - { - case 1: - *rxData = (uint8_t)readData; - ++rxData; - break; - - case 2: - if (!isByteSwap) - { - *rxData = (uint8_t)readData; - ++rxData; - *rxData = (uint8_t)(readData >> 8); - ++rxData; - } - else - { - *rxData = (uint8_t)(readData >> 8); - ++rxData; - *rxData = (uint8_t)readData; - ++rxData; - } - break; - - case 3: - if (!isByteSwap) - { - *rxData = (uint8_t)readData; - ++rxData; - *rxData = (uint8_t)(readData >> 8); - ++rxData; - *rxData = (uint8_t)(readData >> 16); - ++rxData; - } - else - { - *rxData = (uint8_t)(readData >> 16); - ++rxData; - *rxData = (uint8_t)(readData >> 8); - ++rxData; - *rxData = (uint8_t)readData; - ++rxData; - } - break; - - case 4: - if (!isByteSwap) - { - *rxData = (uint8_t)readData; - ++rxData; - *rxData = (uint8_t)(readData >> 8); - ++rxData; - *rxData = (uint8_t)(readData >> 16); - ++rxData; - *rxData = (uint8_t)(readData >> 24); - ++rxData; - } - else - { - *rxData = (uint8_t)(readData >> 24); - ++rxData; - *rxData = (uint8_t)(readData >> 16); - ++rxData; - *rxData = (uint8_t)(readData >> 8); - ++rxData; - *rxData = (uint8_t)readData; - ++rxData; - } - break; - - default: - assert(false); - break; - } -} - -static bool LPSPI_TxFifoReady(LPSPI_Type *base) -{ -#if SPI_RETRY_TIMES - uint32_t waitTimes = SPI_RETRY_TIMES; - while (((uint8_t)LPSPI_GetTxFifoCount(base) != 0U) && (--waitTimes != 0U)) -#else - while ((uint8_t)LPSPI_GetTxFifoCount(base) != 0U) -#endif - { - } -#if SPI_RETRY_TIMES - if (waitTimes == 0U) - { - return false; - } -#endif - return true; -} - -void LPSPI_CommonIRQHandler(LPSPI_Type *base, uint32_t instance); -void LPSPI_CommonIRQHandler(LPSPI_Type *base, uint32_t instance) -{ - assert(s_lpspiHandle[instance] != NULL); - if (LPSPI_IsMaster(base)) - { - s_lpspiMasterIsr(instance, (lpspi_master_handle_t *)s_lpspiHandle[instance]); - } - else - { - s_lpspiSlaveIsr(instance, (lpspi_slave_handle_t *)s_lpspiHandle[instance]); - } - SDK_ISR_EXIT_BARRIER; -} - -#if defined(LPSPI14) -void LPSPI14_DriverIRQHandler(void); -void LPSPI14_DriverIRQHandler(void) -{ - LPSPI_CommonIRQHandler(LPSPI14, 14); -} -#endif - -#if defined(LPSPI16) -void LPSPI16_DriverIRQHandler(void); -void LPSPI16_DriverIRQHandler(void) -{ - LPSPI_CommonIRQHandler(LPSPI16, 16); -} -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpspi.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpspi.h deleted file mode 100644 index 877b7f65cd9..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpspi.h +++ /dev/null @@ -1,1175 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020,2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LPSPI_H_ -#define FSL_LPSPI_H_ - -#include "fsl_common.h" -#include "fsl_lpflexcomm.h" - -/*! - * @addtogroup lpspi_driver - * @{ - */ - -/********************************************************************************************************************** - * Definitions - *********************************************************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief LPSPI driver version. */ -#define FSL_LPSPI_DRIVER_VERSION (MAKE_VERSION(2, 2, 6)) -/*! @} */ - -#ifndef LPSPI_DUMMY_DATA -/*! @brief LPSPI dummy data if no Tx data.*/ -#define LPSPI_DUMMY_DATA (0x00U) /*!< Dummy data used for tx if there is not txData. */ -#endif - -/*! @brief Retry times for waiting flag. */ -#ifndef SPI_RETRY_TIMES -#define SPI_RETRY_TIMES 0U /* Define to zero means keep waiting until the flag is assert/deassert. */ -#endif - -/*! @brief Global variable for dummy data value setting. */ -extern volatile uint8_t g_lpspiDummyData[]; - -/*! @brief Status for the LPSPI driver.*/ -enum -{ - kStatus_LPSPI_Busy = MAKE_STATUS(kStatusGroup_LPSPI, 0), /*!< LPSPI transfer is busy.*/ - kStatus_LPSPI_Error = MAKE_STATUS(kStatusGroup_LPSPI, 1), /*!< LPSPI driver error. */ - kStatus_LPSPI_Idle = MAKE_STATUS(kStatusGroup_LPSPI, 2), /*!< LPSPI is idle.*/ - kStatus_LPSPI_OutOfRange = MAKE_STATUS(kStatusGroup_LPSPI, 3), /*!< LPSPI transfer out Of range. */ - kStatus_LPSPI_Timeout = MAKE_STATUS(kStatusGroup_LPSPI, 4) /*!< LPSPI timeout polling status flags. */ -}; - -/*! @brief LPSPI status flags in SPIx_SR register.*/ -enum _lpspi_flags -{ - kLPSPI_TxDataRequestFlag = LPSPI_SR_TDF_MASK, /*!< Transmit data flag */ - kLPSPI_RxDataReadyFlag = LPSPI_SR_RDF_MASK, /*!< Receive data flag */ - kLPSPI_WordCompleteFlag = LPSPI_SR_WCF_MASK, /*!< Word Complete flag */ - kLPSPI_FrameCompleteFlag = LPSPI_SR_FCF_MASK, /*!< Frame Complete flag */ - kLPSPI_TransferCompleteFlag = LPSPI_SR_TCF_MASK, /*!< Transfer Complete flag */ - kLPSPI_TransmitErrorFlag = LPSPI_SR_TEF_MASK, /*!< Transmit Error flag (FIFO underrun) */ - kLPSPI_ReceiveErrorFlag = LPSPI_SR_REF_MASK, /*!< Receive Error flag (FIFO overrun) */ - kLPSPI_DataMatchFlag = LPSPI_SR_DMF_MASK, /*!< Data Match flag */ - kLPSPI_ModuleBusyFlag = LPSPI_SR_MBF_MASK, /*!< Module Busy flag */ - kLPSPI_AllStatusFlag = (LPSPI_SR_TDF_MASK | LPSPI_SR_RDF_MASK | LPSPI_SR_WCF_MASK | LPSPI_SR_FCF_MASK | - LPSPI_SR_TCF_MASK | LPSPI_SR_TEF_MASK | LPSPI_SR_REF_MASK | LPSPI_SR_DMF_MASK | - LPSPI_SR_MBF_MASK) /*!< Used for clearing all w1c status flags */ -}; - -/*! @brief LPSPI interrupt source.*/ -enum _lpspi_interrupt_enable -{ - kLPSPI_TxInterruptEnable = LPSPI_IER_TDIE_MASK, /*!< Transmit data interrupt enable */ - kLPSPI_RxInterruptEnable = LPSPI_IER_RDIE_MASK, /*!< Receive data interrupt enable */ - kLPSPI_WordCompleteInterruptEnable = LPSPI_IER_WCIE_MASK, /*!< Word complete interrupt enable */ - kLPSPI_FrameCompleteInterruptEnable = LPSPI_IER_FCIE_MASK, /*!< Frame complete interrupt enable */ - kLPSPI_TransferCompleteInterruptEnable = LPSPI_IER_TCIE_MASK, /*!< Transfer complete interrupt enable */ - kLPSPI_TransmitErrorInterruptEnable = LPSPI_IER_TEIE_MASK, /*!< Transmit error interrupt enable(FIFO underrun)*/ - kLPSPI_ReceiveErrorInterruptEnable = LPSPI_IER_REIE_MASK, /*!< Receive Error interrupt enable (FIFO overrun) */ - kLPSPI_DataMatchInterruptEnable = LPSPI_IER_DMIE_MASK, /*!< Data Match interrupt enable */ - kLPSPI_AllInterruptEnable = - (LPSPI_IER_TDIE_MASK | LPSPI_IER_RDIE_MASK | LPSPI_IER_WCIE_MASK | LPSPI_IER_FCIE_MASK | LPSPI_IER_TCIE_MASK | - LPSPI_IER_TEIE_MASK | LPSPI_IER_REIE_MASK | LPSPI_IER_DMIE_MASK) /*!< All above interrupts enable.*/ -}; - -/*! @brief LPSPI DMA source.*/ -enum _lpspi_dma_enable -{ - kLPSPI_TxDmaEnable = LPSPI_DER_TDDE_MASK, /*!< Transmit data DMA enable */ - kLPSPI_RxDmaEnable = LPSPI_DER_RDDE_MASK /*!< Receive data DMA enable */ -}; - -/*! @brief LPSPI master or slave mode configuration.*/ -typedef enum _lpspi_master_slave_mode -{ - kLPSPI_Master = 1U, /*!< LPSPI peripheral operates in master mode.*/ - kLPSPI_Slave = 0U /*!< LPSPI peripheral operates in slave mode.*/ -} lpspi_master_slave_mode_t; - -/*! @brief LPSPI Peripheral Chip Select (PCS) configuration (which PCS to configure).*/ -typedef enum _lpspi_which_pcs_config -{ - kLPSPI_Pcs0 = 0U, /*!< PCS[0] */ - kLPSPI_Pcs1 = 1U, /*!< PCS[1] */ - kLPSPI_Pcs2 = 2U, /*!< PCS[2] */ - kLPSPI_Pcs3 = 3U /*!< PCS[3] */ -} lpspi_which_pcs_t; - -/*! @brief LPSPI Peripheral Chip Select (PCS) Polarity configuration.*/ -typedef enum _lpspi_pcs_polarity_config -{ - kLPSPI_PcsActiveHigh = 1U, /*!< PCS Active High (idles low) */ - kLPSPI_PcsActiveLow = 0U /*!< PCS Active Low (idles high) */ -} lpspi_pcs_polarity_config_t; - -/*! @brief LPSPI Peripheral Chip Select (PCS) Polarity.*/ -enum _lpspi_pcs_polarity -{ - kLPSPI_Pcs0ActiveLow = 1U << 0, /*!< Pcs0 Active Low (idles high). */ - kLPSPI_Pcs1ActiveLow = 1U << 1, /*!< Pcs1 Active Low (idles high). */ - kLPSPI_Pcs2ActiveLow = 1U << 2, /*!< Pcs2 Active Low (idles high). */ - kLPSPI_Pcs3ActiveLow = 1U << 3, /*!< Pcs3 Active Low (idles high). */ - kLPSPI_PcsAllActiveLow = 0xFU /*!< Pcs0 to Pcs5 Active Low (idles high). */ -}; - -/*! @brief LPSPI clock polarity configuration.*/ -typedef enum _lpspi_clock_polarity -{ - kLPSPI_ClockPolarityActiveHigh = 0U, /*!< CPOL=0. Active-high LPSPI clock (idles low)*/ - kLPSPI_ClockPolarityActiveLow = 1U /*!< CPOL=1. Active-low LPSPI clock (idles high)*/ -} lpspi_clock_polarity_t; - -/*! @brief LPSPI clock phase configuration.*/ -typedef enum _lpspi_clock_phase -{ - kLPSPI_ClockPhaseFirstEdge = 0U, /*!< CPHA=0. Data is captured on the leading edge of the SCK and changed on the - following edge.*/ - kLPSPI_ClockPhaseSecondEdge = 1U /*!< CPHA=1. Data is changed on the leading edge of the SCK and captured on the - following edge.*/ -} lpspi_clock_phase_t; - -/*! @brief LPSPI data shifter direction options.*/ -typedef enum _lpspi_shift_direction -{ - kLPSPI_MsbFirst = 0U, /*!< Data transfers start with most significant bit.*/ - kLPSPI_LsbFirst = 1U /*!< Data transfers start with least significant bit.*/ -} lpspi_shift_direction_t; - -/*! @brief LPSPI Host Request select configuration. */ -typedef enum _lpspi_host_request_select -{ - kLPSPI_HostReqExtPin = 0U, /*!< Host Request is an ext pin. */ - kLPSPI_HostReqInternalTrigger = 1U /*!< Host Request is an internal trigger. */ -} lpspi_host_request_select_t; - -/*! @brief LPSPI Match configuration options. */ -typedef enum _lpspi_match_config -{ - kLPSI_MatchDisabled = 0x0U, /*!< LPSPI Match Disabled. */ - kLPSI_1stWordEqualsM0orM1 = 0x2U, /*!< LPSPI Match Enabled. */ - kLPSI_AnyWordEqualsM0orM1 = 0x3U, /*!< LPSPI Match Enabled. */ - kLPSI_1stWordEqualsM0and2ndWordEqualsM1 = 0x4U, /*!< LPSPI Match Enabled. */ - kLPSI_AnyWordEqualsM0andNxtWordEqualsM1 = 0x5U, /*!< LPSPI Match Enabled. */ - kLPSI_1stWordAndM1EqualsM0andM1 = 0x6U, /*!< LPSPI Match Enabled. */ - kLPSI_AnyWordAndM1EqualsM0andM1 = 0x7U, /*!< LPSPI Match Enabled. */ -} lpspi_match_config_t; - -/*! @brief LPSPI pin (SDO and SDI) configuration. */ -typedef enum _lpspi_pin_config -{ - kLPSPI_SdiInSdoOut = 0U, /*!< LPSPI SDI input, SDO output. */ - kLPSPI_SdiInSdiOut = 1U, /*!< LPSPI SDI input, SDI output. */ - kLPSPI_SdoInSdoOut = 2U, /*!< LPSPI SDO input, SDO output. */ - kLPSPI_SdoInSdiOut = 3U /*!< LPSPI SDO input, SDI output. */ -} lpspi_pin_config_t; - -/*! @brief LPSPI data output configuration. */ -typedef enum _lpspi_data_out_config -{ - kLpspiDataOutRetained = 0U, /*!< Data out retains last value when chip select is de-asserted */ - kLpspiDataOutTristate = 1U /*!< Data out is tristated when chip select is de-asserted */ -} lpspi_data_out_config_t; - -/*! @brief LPSPI cs function configuration. */ -typedef enum _lpspi_pcs_function_config -{ - kLPSPI_PcsAsCs = 0U, /*!< PCS pin select as cs function */ - kLPSPI_PcsAsData = 1U, /*!< PCS pin select as date function */ -} lpspi_pcs_function_config_t; - -/*! @brief LPSPI transfer width configuration. */ -typedef enum _lpspi_transfer_width -{ - kLPSPI_SingleBitXfer = 0U, /*!< 1-bit shift at a time, data out on SDO, in on SDI (normal mode) */ - kLPSPI_TwoBitXfer = 1U, /*!< 2-bits shift out on SDO/SDI and in on SDO/SDI */ - kLPSPI_FourBitXfer = 2U /*!< 4-bits shift out on SDO/SDI/PCS[3:2] and in on SDO/SDI/PCS[3:2] */ -} lpspi_transfer_width_t; - -/*! @brief LPSPI delay type selection.*/ -typedef enum _lpspi_delay_type -{ - kLPSPI_PcsToSck = 1U, /*!< PCS-to-SCK delay. */ - kLPSPI_LastSckToPcs, /*!< Last SCK edge to PCS delay. */ - kLPSPI_BetweenTransfer /*!< Delay between transfers. */ -} lpspi_delay_type_t; - -#define LPSPI_MASTER_PCS_SHIFT (4U) /*!< LPSPI master PCS shift macro , internal used. */ -#define LPSPI_MASTER_PCS_MASK (0xF0U) /*!< LPSPI master PCS shift macro , internal used. */ - -#define LPSPI_MASTER_WIDTH_SHIFT (16U) /*!< LPSPI master width shift macro, internal used */ -#define LPSPI_MASTER_WIDTH_MASK (0x30000U) /*!< LPSPI master width shift mask, internal used */ - -/*! @brief Use this enumeration for LPSPI master transfer configFlags. */ -enum _lpspi_transfer_config_flag_for_master -{ - kLPSPI_MasterPcs0 = 0U << LPSPI_MASTER_PCS_SHIFT, /*!< LPSPI master transfer use PCS0 signal */ - kLPSPI_MasterPcs1 = 1U << LPSPI_MASTER_PCS_SHIFT, /*!< LPSPI master transfer use PCS1 signal */ - kLPSPI_MasterPcs2 = 2U << LPSPI_MASTER_PCS_SHIFT, /*!< LPSPI master transfer use PCS2 signal */ - kLPSPI_MasterPcs3 = 3U << LPSPI_MASTER_PCS_SHIFT, /*!< LPSPI master transfer use PCS3 signal */ - - kLPSPI_MasterWidth1 = 0U << LPSPI_MASTER_WIDTH_SHIFT, /*!< LPSPI master transfer 1bit */ - kLPSPI_MasterWidth2 = 1U << LPSPI_MASTER_WIDTH_SHIFT, /*!< LPSPI master transfer 2bit */ - kLPSPI_MasterWidth4 = 2U << LPSPI_MASTER_WIDTH_SHIFT, /*!< LPSPI master transfer 4bit */ - - kLPSPI_MasterPcsContinuous = 1U << 20, /*!< Is PCS signal continuous */ - - kLPSPI_MasterByteSwap = - 1U << 22 /*!< Is master swap the byte. - * For example, when want to send data 1 2 3 4 5 6 7 8 (suppose you set - * lpspi_shift_direction_t to MSB). - * 1. If you set bitPerFrame = 8 , no matter the kLPSPI_MasterByteSwapyou flag is used - * or not, the waveform is 1 2 3 4 5 6 7 8. - * 2. If you set bitPerFrame = 16 : - * (1) the waveform is 2 1 4 3 6 5 8 7 if you do not use the kLPSPI_MasterByteSwap flag. - * (2) the waveform is 1 2 3 4 5 6 7 8 if you use the kLPSPI_MasterByteSwap flag. - * 3. If you set bitPerFrame = 32 : - * (1) the waveform is 4 3 2 1 8 7 6 5 if you do not use the kLPSPI_MasterByteSwap flag. - * (2) the waveform is 1 2 3 4 5 6 7 8 if you use the kLPSPI_MasterByteSwap flag. - */ -}; - -#define LPSPI_SLAVE_PCS_SHIFT (4U) /*!< LPSPI slave PCS shift macro , internal used. */ -#define LPSPI_SLAVE_PCS_MASK (0xF0U) /*!< LPSPI slave PCS shift macro , internal used. */ - -/*! @brief Use this enumeration for LPSPI slave transfer configFlags. */ -enum _lpspi_transfer_config_flag_for_slave -{ - kLPSPI_SlavePcs0 = 0U << LPSPI_SLAVE_PCS_SHIFT, /*!< LPSPI slave transfer use PCS0 signal */ - kLPSPI_SlavePcs1 = 1U << LPSPI_SLAVE_PCS_SHIFT, /*!< LPSPI slave transfer use PCS1 signal */ - kLPSPI_SlavePcs2 = 2U << LPSPI_SLAVE_PCS_SHIFT, /*!< LPSPI slave transfer use PCS2 signal */ - kLPSPI_SlavePcs3 = 3U << LPSPI_SLAVE_PCS_SHIFT, /*!< LPSPI slave transfer use PCS3 signal */ - - kLPSPI_SlaveByteSwap = - 1U << 22 /*!< Is slave swap the byte. - * For example, when want to send data 1 2 3 4 5 6 7 8 (suppose you set - * lpspi_shift_direction_t to MSB). - * 1. If you set bitPerFrame = 8 , no matter the kLPSPI_SlaveByteSwap flag is used - * or not, the waveform is 1 2 3 4 5 6 7 8. - * 2. If you set bitPerFrame = 16 : - * (1) the waveform is 2 1 4 3 6 5 8 7 if you do not use the kLPSPI_SlaveByteSwap flag. - * (2) the waveform is 1 2 3 4 5 6 7 8 if you use the kLPSPI_SlaveByteSwap flag. - * 3. If you set bitPerFrame = 32 : - * (1) the waveform is 4 3 2 1 8 7 6 5 if you do not use the kLPSPI_SlaveByteSwap flag. - * (2) the waveform is 1 2 3 4 5 6 7 8 if you use the kLPSPI_SlaveByteSwap flag. - */ -}; - -/*! @brief LPSPI transfer state, which is used for LPSPI transactional API state machine. */ -enum _lpspi_transfer_state -{ - kLPSPI_Idle = 0x0U, /*!< Nothing in the transmitter/receiver. */ - kLPSPI_Busy, /*!< Transfer queue is not finished. */ - kLPSPI_Error /*!< Transfer error. */ -}; - -/*! @brief LPSPI master configuration structure.*/ -typedef struct _lpspi_master_config -{ - uint32_t baudRate; /*!< Baud Rate for LPSPI. */ - uint32_t bitsPerFrame; /*!< Bits per frame, minimum 8, maximum 4096.*/ - lpspi_clock_polarity_t cpol; /*!< Clock polarity. */ - lpspi_clock_phase_t cpha; /*!< Clock phase. */ - lpspi_shift_direction_t direction; /*!< MSB or LSB data shift direction. */ - - uint32_t pcsToSckDelayInNanoSec; /*!< PCS to SCK delay time in nanoseconds, setting to 0 sets the minimum delay. - It sets the boundary value if out of range.*/ - uint32_t lastSckToPcsDelayInNanoSec; /*!< Last SCK to PCS delay time in nanoseconds, setting to 0 sets the minimum - delay. It sets the boundary value if out of range.*/ - uint32_t betweenTransferDelayInNanoSec; /*!< After the SCK delay time with nanoseconds, setting to 0 sets the - minimum delay. It sets the boundary value if out of range.*/ - - lpspi_which_pcs_t whichPcs; /*!< Desired Peripheral Chip Select (PCS). */ - lpspi_pcs_polarity_config_t pcsActiveHighOrLow; /*!< Desired PCS active high or low */ - - lpspi_pin_config_t pinCfg; /*!< Configures which pins are used for input and output data - *during single bit transfers.*/ - - lpspi_pcs_function_config_t pcsFunc; /*!< Configures cs pins function.*/ - - lpspi_data_out_config_t dataOutConfig; /*!< Configures if the output data is tristated - * between accesses (LPSPI_PCS is negated). */ - bool enableInputDelay; /*!< Enable master to sample the input data on a delayed SCK. This can help improve slave - setup time. Refer to device data sheet for specific time length. */ -} lpspi_master_config_t; - -/*! @brief LPSPI slave configuration structure.*/ -typedef struct _lpspi_slave_config -{ - uint32_t bitsPerFrame; /*!< Bits per frame, minimum 8, maximum 4096.*/ - lpspi_clock_polarity_t cpol; /*!< Clock polarity. */ - lpspi_clock_phase_t cpha; /*!< Clock phase. */ - lpspi_shift_direction_t direction; /*!< MSB or LSB data shift direction. */ - - lpspi_which_pcs_t whichPcs; /*!< Desired Peripheral Chip Select (pcs) */ - lpspi_pcs_polarity_config_t pcsActiveHighOrLow; /*!< Desired PCS active high or low */ - - lpspi_pin_config_t pinCfg; /*!< Configures which pins are used for input and output data - *during single bit transfers.*/ - - lpspi_data_out_config_t dataOutConfig; /*!< Configures if the output data is tristated - * between accesses (LPSPI_PCS is negated). */ -} lpspi_slave_config_t; - -/*! - * @brief Forward declaration of the _lpspi_master_handle typedefs. - */ -typedef struct _lpspi_master_handle lpspi_master_handle_t; - -/*! - * @brief Forward declaration of the _lpspi_slave_handle typedefs. - */ -typedef struct _lpspi_slave_handle lpspi_slave_handle_t; - -/*! - * @brief Master completion callback function pointer type. - * - * @param base LPSPI peripheral address. - * @param handle Pointer to the handle for the LPSPI master. - * @param status Success or error code describing whether the transfer is completed. - * @param userData Arbitrary pointer-dataSized value passed from the application. - */ -typedef void (*lpspi_master_transfer_callback_t)(LPSPI_Type *base, - lpspi_master_handle_t *handle, - status_t status, - void *userData); - -/*! - * @brief Slave completion callback function pointer type. - * - * @param base LPSPI peripheral address. - * @param handle Pointer to the handle for the LPSPI slave. - * @param status Success or error code describing whether the transfer is completed. - * @param userData Arbitrary pointer-dataSized value passed from the application. - */ -typedef void (*lpspi_slave_transfer_callback_t)(LPSPI_Type *base, - lpspi_slave_handle_t *handle, - status_t status, - void *userData); - -/*! @brief LPSPI master/slave transfer structure.*/ -typedef struct _lpspi_transfer -{ - const uint8_t *txData; /*!< Send buffer. */ - uint8_t *rxData; /*!< Receive buffer. */ - volatile size_t dataSize; /*!< Transfer bytes. */ - - uint32_t configFlags; /*!< Transfer transfer configuration flags. Set from _lpspi_transfer_config_flag_for_master if - the transfer is used for master or _lpspi_transfer_config_flag_for_slave enumeration if the - transfer is used for slave.*/ -} lpspi_transfer_t; - -/*! @brief LPSPI master transfer handle structure used for transactional API. */ -struct _lpspi_master_handle -{ - volatile bool isPcsContinuous; /*!< Is PCS continuous in transfer. */ - volatile bool writeTcrInIsr; /*!< A flag that whether should write TCR in ISR. */ - - volatile bool isByteSwap; /*!< A flag that whether should byte swap. */ - volatile bool isTxMask; /*!< A flag that whether TCR[TXMSK] is set. */ - volatile uint16_t bytesPerFrame; /*!< Number of bytes in each frame */ - - volatile uint8_t fifoSize; /*!< FIFO dataSize. */ - - volatile uint8_t rxWatermark; /*!< Rx watermark. */ - - volatile uint8_t bytesEachWrite; /*!< Bytes for each write TDR. */ - volatile uint8_t bytesEachRead; /*!< Bytes for each read RDR. */ - - const uint8_t *volatile txData; /*!< Send buffer. */ - uint8_t *volatile rxData; /*!< Receive buffer. */ - volatile size_t txRemainingByteCount; /*!< Number of bytes remaining to send.*/ - volatile size_t rxRemainingByteCount; /*!< Number of bytes remaining to receive.*/ - - volatile uint32_t writeRegRemainingTimes; /*!< Write TDR register remaining times. */ - volatile uint32_t readRegRemainingTimes; /*!< Read RDR register remaining times. */ - - uint32_t totalByteCount; /*!< Number of transfer bytes*/ - - uint32_t txBuffIfNull; /*!< Used if the txData is NULL. */ - - volatile uint8_t state; /*!< LPSPI transfer state , _lpspi_transfer_state.*/ - - lpspi_master_transfer_callback_t callback; /*!< Completion callback. */ - void *userData; /*!< Callback user data. */ -}; - -/*! @brief LPSPI slave transfer handle structure used for transactional API. */ -struct _lpspi_slave_handle -{ - volatile bool isByteSwap; /*!< A flag that whether should byte swap. */ - - volatile uint8_t fifoSize; /*!< FIFO dataSize. */ - - volatile uint8_t rxWatermark; /*!< Rx watermark. */ - - volatile uint8_t bytesEachWrite; /*!< Bytes for each write TDR. */ - volatile uint8_t bytesEachRead; /*!< Bytes for each read RDR. */ - - const uint8_t *volatile txData; /*!< Send buffer. */ - uint8_t *volatile rxData; /*!< Receive buffer. */ - - volatile size_t txRemainingByteCount; /*!< Number of bytes remaining to send.*/ - volatile size_t rxRemainingByteCount; /*!< Number of bytes remaining to receive.*/ - - volatile uint32_t writeRegRemainingTimes; /*!< Write TDR register remaining times. */ - volatile uint32_t readRegRemainingTimes; /*!< Read RDR register remaining times. */ - - uint32_t totalByteCount; /*!< Number of transfer bytes*/ - - volatile uint8_t state; /*!< LPSPI transfer state , _lpspi_transfer_state.*/ - - volatile uint32_t errorCount; /*!< Error count for slave transfer.*/ - - lpspi_slave_transfer_callback_t callback; /*!< Completion callback. */ - void *userData; /*!< Callback user data. */ -}; - -/********************************************************************************************************************** - * API - *********************************************************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus*/ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Initializes the LPSPI master. - * - * @param base LPSPI peripheral address. - * @param masterConfig Pointer to structure lpspi_master_config_t. - * @param srcClock_Hz Module source input clock in Hertz - */ -void LPSPI_MasterInit(LPSPI_Type *base, const lpspi_master_config_t *masterConfig, uint32_t srcClock_Hz); - -/*! - * @brief Sets the lpspi_master_config_t structure to default values. - * - * This API initializes the configuration structure for LPSPI_MasterInit(). - * The initialized structure can remain unchanged in LPSPI_MasterInit(), or can be modified - * before calling the LPSPI_MasterInit(). - * Example: - * @code - * lpspi_master_config_t masterConfig; - * LPSPI_MasterGetDefaultConfig(&masterConfig); - * @endcode - * @param masterConfig pointer to lpspi_master_config_t structure - */ -void LPSPI_MasterGetDefaultConfig(lpspi_master_config_t *masterConfig); - -/*! - * @brief LPSPI slave configuration. - * - * @param base LPSPI peripheral address. - * @param slaveConfig Pointer to a structure lpspi_slave_config_t. - */ -void LPSPI_SlaveInit(LPSPI_Type *base, const lpspi_slave_config_t *slaveConfig); - -/*! - * @brief Sets the lpspi_slave_config_t structure to default values. - * - * This API initializes the configuration structure for LPSPI_SlaveInit(). - * The initialized structure can remain unchanged in LPSPI_SlaveInit() or can be modified - * before calling the LPSPI_SlaveInit(). - * Example: - * @code - * lpspi_slave_config_t slaveConfig; - * LPSPI_SlaveGetDefaultConfig(&slaveConfig); - * @endcode - * @param slaveConfig pointer to lpspi_slave_config_t structure. - */ -void LPSPI_SlaveGetDefaultConfig(lpspi_slave_config_t *slaveConfig); - -/*! - * @brief De-initializes the LPSPI peripheral. Call this API to disable the LPSPI clock. - * @param base LPSPI peripheral address. - */ -void LPSPI_Deinit(LPSPI_Type *base); - -/*! - * @brief Restores the LPSPI peripheral to reset state. Note that this function - * sets all registers to reset state. As a result, the LPSPI module can't work after calling - * this API. - * @param base LPSPI peripheral address. - */ -void LPSPI_Reset(LPSPI_Type *base); - -/*! - * @brief Get the LPSPI instance from peripheral base address. - * - * @param base LPSPI peripheral base address. - * @return LPSPI instance. - */ -uint32_t LPSPI_GetInstance(LPSPI_Type *base); - -/*! - * @brief Enables the LPSPI peripheral and sets the MCR MDIS to 0. - * - * @param base LPSPI peripheral address. - * @param enable Pass true to enable module, false to disable module. - */ -static inline void LPSPI_Enable(LPSPI_Type *base, bool enable) -{ - if (enable) - { - base->CR |= LPSPI_CR_MEN_MASK; - } - else - { - base->CR &= ~LPSPI_CR_MEN_MASK; - } -} - -/*! - *@} - */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets the LPSPI status flag state. - * @param base LPSPI peripheral address. - * @return The LPSPI status(in SR register). - */ -static inline uint32_t LPSPI_GetStatusFlags(LPSPI_Type *base) -{ - return (base->SR); -} - -/*! - * @brief Gets the LPSPI Tx FIFO size. - * @param base LPSPI peripheral address. - * @return The LPSPI Tx FIFO size. - */ -static inline uint8_t LPSPI_GetTxFifoSize(LPSPI_Type *base) -{ - return (1U << ((base->PARAM & LPSPI_PARAM_TXFIFO_MASK) >> LPSPI_PARAM_TXFIFO_SHIFT)); -} - -/*! - * @brief Gets the LPSPI Rx FIFO size. - * @param base LPSPI peripheral address. - * @return The LPSPI Rx FIFO size. - */ -static inline uint8_t LPSPI_GetRxFifoSize(LPSPI_Type *base) -{ - return (1U << ((base->PARAM & LPSPI_PARAM_RXFIFO_MASK) >> LPSPI_PARAM_RXFIFO_SHIFT)); -} - -/*! - * @brief Gets the LPSPI Tx FIFO count. - * @param base LPSPI peripheral address. - * @return The number of words in the transmit FIFO. - */ -static inline uint32_t LPSPI_GetTxFifoCount(LPSPI_Type *base) -{ - return ((base->FSR & LPSPI_FSR_TXCOUNT_MASK) >> LPSPI_FSR_TXCOUNT_SHIFT); -} - -/*! - * @brief Gets the LPSPI Rx FIFO count. - * @param base LPSPI peripheral address. - * @return The number of words in the receive FIFO. - */ -static inline uint32_t LPSPI_GetRxFifoCount(LPSPI_Type *base) -{ - return ((base->FSR & LPSPI_FSR_RXCOUNT_MASK) >> LPSPI_FSR_RXCOUNT_SHIFT); -} - -/*! - * @brief Clears the LPSPI status flag. - * - * This function clears the desired status bit by using a write-1-to-clear. The user passes in the base and the - * desired status flag bit to clear. The list of status flags is defined in the _lpspi_flags. - * Example usage: - * @code - * LPSPI_ClearStatusFlags(base, kLPSPI_TxDataRequestFlag|kLPSPI_RxDataReadyFlag); - * @endcode - * - * @param base LPSPI peripheral address. - * @param statusFlags The status flag used from type _lpspi_flags. - */ -static inline void LPSPI_ClearStatusFlags(LPSPI_Type *base, uint32_t statusFlags) -{ - base->SR = statusFlags; /*!< The status flags are cleared by writing 1 (w1c).*/ -} - -/*! - *@} - */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables the LPSPI interrupts. - * - * This function configures the various interrupt masks of the LPSPI. The parameters are base and an interrupt mask. - * Note that, for Tx fill and Rx FIFO drain requests, enabling the interrupt request disables the DMA request. - * - * @code - * LPSPI_EnableInterrupts(base, kLPSPI_TxInterruptEnable | kLPSPI_RxInterruptEnable ); - * @endcode - * - * @param base LPSPI peripheral address. - * @param mask The interrupt mask; Use the enum _lpspi_interrupt_enable. - */ -static inline void LPSPI_EnableInterrupts(LPSPI_Type *base, uint32_t mask) -{ - base->IER |= mask; -} - -/*! - * @brief Disables the LPSPI interrupts. - * - * @code - * LPSPI_DisableInterrupts(base, kLPSPI_TxInterruptEnable | kLPSPI_RxInterruptEnable ); - * @endcode - * - * @param base LPSPI peripheral address. - * @param mask The interrupt mask; Use the enum _lpspi_interrupt_enable. - */ -static inline void LPSPI_DisableInterrupts(LPSPI_Type *base, uint32_t mask) -{ - base->IER &= ~mask; -} - -/*! - *@} - */ - -/*! - * @name DMA Control - * @{ - */ - -/*! - * @brief Enables the LPSPI DMA request. - * - * This function configures the Rx and Tx DMA mask of the LPSPI. The parameters are base and a DMA mask. - * @code - * LPSPI_EnableDMA(base, kLPSPI_TxDmaEnable | kLPSPI_RxDmaEnable); - * @endcode - * - * @param base LPSPI peripheral address. - * @param mask The interrupt mask; Use the enum _lpspi_dma_enable. - */ -static inline void LPSPI_EnableDMA(LPSPI_Type *base, uint32_t mask) -{ - base->DER |= mask; -} - -/*! - * @brief Disables the LPSPI DMA request. - * - * This function configures the Rx and Tx DMA mask of the LPSPI. The parameters are base and a DMA mask. - * @code - * SPI_DisableDMA(base, kLPSPI_TxDmaEnable | kLPSPI_RxDmaEnable); - * @endcode - * - * @param base LPSPI peripheral address. - * @param mask The interrupt mask; Use the enum _lpspi_dma_enable. - */ -static inline void LPSPI_DisableDMA(LPSPI_Type *base, uint32_t mask) -{ - base->DER &= ~mask; -} - -/*! - * @brief Gets the LPSPI Transmit Data Register address for a DMA operation. - * - * This function gets the LPSPI Transmit Data Register address because this value is needed - * for the DMA operation. - * This function can be used for either master or slave mode. - * - * @param base LPSPI peripheral address. - * @return The LPSPI Transmit Data Register address. - */ -static inline uint32_t LPSPI_GetTxRegisterAddress(LPSPI_Type *base) -{ - return (uint32_t) & (base->TDR); -} - -/*! - * @brief Gets the LPSPI Receive Data Register address for a DMA operation. - * - * This function gets the LPSPI Receive Data Register address because this value is needed - * for the DMA operation. - * This function can be used for either master or slave mode. - * - * @param base LPSPI peripheral address. - * @return The LPSPI Receive Data Register address. - */ -static inline uint32_t LPSPI_GetRxRegisterAddress(LPSPI_Type *base) -{ - return (uint32_t) & (base->RDR); -} - -/*! - *@} - */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Check the argument for transfer . - * - * @param base LPSPI peripheral address. - * @param transfer the transfer struct to be used. - * @param isEdma True to check for EDMA transfer, false to check interrupt non-blocking transfer - * @return Return true for right and false for wrong. - */ -bool LPSPI_CheckTransferArgument(LPSPI_Type *base, lpspi_transfer_t *transfer, bool isEdma); - -/*! - * @brief Configures the LPSPI for either master or slave. - * - * Note that the CFGR1 should only be written when the LPSPI is disabled (LPSPIx_CR_MEN = 0). - * - * @param base LPSPI peripheral address. - * @param mode Mode setting (master or slave) of type lpspi_master_slave_mode_t. - */ -static inline void LPSPI_SetMasterSlaveMode(LPSPI_Type *base, lpspi_master_slave_mode_t mode) -{ - base->CFGR1 = (base->CFGR1 & (~LPSPI_CFGR1_MASTER_MASK)) | LPSPI_CFGR1_MASTER(mode); -} - -/*! - * @brief Configures the peripheral chip select used for the transfer. - * - * @param base LPSPI peripheral address. - * @param select LPSPI Peripheral Chip Select (PCS) configuration. - */ -static inline void LPSPI_SelectTransferPCS(LPSPI_Type *base, lpspi_which_pcs_t select) -{ - base->TCR = (base->TCR & (~LPSPI_TCR_PCS_MASK)) | LPSPI_TCR_PCS((uint8_t)select); -} - -/*! - * @brief Set the PCS signal to continuous or uncontinuous mode. - * - * @note In master mode, continuous transfer will keep the PCS asserted at the end of the frame size, until a command - * word is received that starts a new frame. So PCS must be set back to uncontinuous when transfer finishes. - * In slave mode, when continuous transfer is enabled, the LPSPI will only transmit the first frame size bits, after - * that the LPSPI will transmit received data back (assuming a 32-bit shift register). - * - * @param base LPSPI peripheral address. - * @param IsContinous True to set the transfer PCS to continuous mode, false to set to uncontinuous mode. - */ -static inline void LPSPI_SetPCSContinous(LPSPI_Type *base, bool IsContinous) -{ - if (IsContinous) - { - base->TCR |= LPSPI_TCR_CONT_MASK; - } - else - { - base->TCR &= ~LPSPI_TCR_CONT_MASK; - } -} - -/*! - * @brief Returns whether the LPSPI module is in master mode. - * - * @param base LPSPI peripheral address. - * @return Returns true if the module is in master mode or false if the module is in slave mode. - */ -static inline bool LPSPI_IsMaster(LPSPI_Type *base) -{ - return (bool)((base->CFGR1) & LPSPI_CFGR1_MASTER_MASK); -} - -/*! - * @brief Flushes the LPSPI FIFOs. - * - * @param base LPSPI peripheral address. - * @param flushTxFifo Flushes (true) the Tx FIFO, else do not flush (false) the Tx FIFO. - * @param flushRxFifo Flushes (true) the Rx FIFO, else do not flush (false) the Rx FIFO. - */ -static inline void LPSPI_FlushFifo(LPSPI_Type *base, bool flushTxFifo, bool flushRxFifo) -{ - base->CR |= ((uint32_t)flushTxFifo << LPSPI_CR_RTF_SHIFT) | ((uint32_t)flushRxFifo << LPSPI_CR_RRF_SHIFT); -} - -/*! - * @brief Sets the transmit and receive FIFO watermark values. - * - * This function allows the user to set the receive and transmit FIFO watermarks. The function - * does not compare the watermark settings to the FIFO size. The FIFO watermark should not be - * equal to or greater than the FIFO size. It is up to the higher level driver to make this check. - * - * @param base LPSPI peripheral address. - * @param txWater The TX FIFO watermark value. Writing a value equal or greater than the FIFO size is truncated. - * @param rxWater The RX FIFO watermark value. Writing a value equal or greater than the FIFO size is truncated. - */ -static inline void LPSPI_SetFifoWatermarks(LPSPI_Type *base, uint32_t txWater, uint32_t rxWater) -{ - base->FCR = LPSPI_FCR_TXWATER(txWater) | LPSPI_FCR_RXWATER(rxWater); -} - -/*! - * @brief Configures all LPSPI peripheral chip select polarities simultaneously. - * - * Note that the CFGR1 should only be written when the LPSPI is disabled (LPSPIx_CR_MEN = 0). - * - * This is an example: PCS0 and PCS1 set to active low and other PCSs set to active high. Note that the number of - * PCS is device-specific. - * @code - * LPSPI_SetAllPcsPolarity(base, kLPSPI_Pcs0ActiveLow | kLPSPI_Pcs1ActiveLow); - * @endcode - * - * @param base LPSPI peripheral address. - * @param mask The PCS polarity mask; Use the enum _lpspi_pcs_polarity. - */ -static inline void LPSPI_SetAllPcsPolarity(LPSPI_Type *base, uint32_t mask) -{ - base->CFGR1 = (base->CFGR1 & ~LPSPI_CFGR1_PCSPOL_MASK) | LPSPI_CFGR1_PCSPOL(~mask); -} - -/*! - * @brief Configures the frame size. - * - * The minimum frame size is 8-bits and the maximum frame size is 4096-bits. If the frame size is less than or equal - * to 32-bits, the word size and frame size are identical. If the frame size is greater than 32-bits, the word - * size is 32-bits for each word except the last (the last word contains the remainder bits if the frame size is not - * divisible by 32). The minimum word size is 2-bits. A frame size of 33-bits (or similar) is not supported. - * - * Note 1: The transmit command register should be initialized before enabling the LPSPI in slave mode, although - * the command register does not update until after the LPSPI is enabled. After it is enabled, the transmit command - * register - * should only be changed if the LPSPI is idle. - * - * Note 2: The transmit and command FIFO is a combined FIFO that includes both transmit data and command words. That - * means the TCR register should be written to when the Tx FIFO is not full. - * - * @param base LPSPI peripheral address. - * @param frameSize The frame size in number of bits. - */ -static inline void LPSPI_SetFrameSize(LPSPI_Type *base, uint32_t frameSize) -{ - base->TCR = (base->TCR & ~LPSPI_TCR_FRAMESZ_MASK) | LPSPI_TCR_FRAMESZ(frameSize - 1U); -} - -/*! - * @brief Sets the LPSPI baud rate in bits per second. - * - * This function takes in the desired bitsPerSec (baud rate) and calculates the nearest - * possible baud rate without exceeding the desired baud rate and returns the - * calculated baud rate in bits-per-second. It requires the caller to provide - * the frequency of the module source clock (in Hertz). Note that the baud rate - * does not go into effect until the Transmit Control Register (TCR) is programmed - * with the prescale value. Hence, this function returns the prescale tcrPrescaleValue - * parameter for later programming in the TCR. The higher level - * peripheral driver should alert the user of an out of range baud rate input. - * - * Note that the LPSPI module must first be disabled before configuring this. - * Note that the LPSPI module must be configured for master mode before configuring this. - * - * @param base LPSPI peripheral address. - * @param baudRate_Bps The desired baud rate in bits per second. - * @param srcClock_Hz Module source input clock in Hertz. - * @param tcrPrescaleValue The TCR prescale value needed to program the TCR. - * @return The actual calculated baud rate. This function may also return a "0" if the - * LPSPI is not configured for master mode or if the LPSPI module is not disabled. - */ - -uint32_t LPSPI_MasterSetBaudRate(LPSPI_Type *base, - uint32_t baudRate_Bps, - uint32_t srcClock_Hz, - uint32_t *tcrPrescaleValue); - -/*! - * @brief Manually configures a specific LPSPI delay parameter (module must be disabled to - * change the delay values). - * - * This function configures the following: - * SCK to PCS delay, or - * PCS to SCK delay, or - * The configurations must occur between the transfer delay. - * - * The delay names are available in type lpspi_delay_type_t. - * - * The user passes the desired delay along with the delay value. - * This allows the user to directly set the delay values if they have - * pre-calculated them or if they simply wish to manually increment the value. - * - * Note that the LPSPI module must first be disabled before configuring this. - * Note that the LPSPI module must be configured for master mode before configuring this. - * - * @param base LPSPI peripheral address. - * @param scaler The 8-bit delay value 0x00 to 0xFF (255). - * @param whichDelay The desired delay to configure, must be of type lpspi_delay_type_t. - */ -void LPSPI_MasterSetDelayScaler(LPSPI_Type *base, uint32_t scaler, lpspi_delay_type_t whichDelay); - -/*! - * @brief Calculates the delay based on the desired delay input in nanoseconds (module must be - * disabled to change the delay values). - * - * This function calculates the values for the following: - * SCK to PCS delay, or - * PCS to SCK delay, or - * The configurations must occur between the transfer delay. - * - * The delay names are available in type lpspi_delay_type_t. - * - * The user passes the desired delay and the desired delay value in - * nano-seconds. The function calculates the value needed for the desired delay parameter - * and returns the actual calculated delay because an exact delay match may not be possible. In this - * case, the closest match is calculated without going below the desired delay value input. - * It is possible to input a very large delay value that exceeds the capability of the part, in - * which case the maximum supported delay is returned. It is up to the higher level - * peripheral driver to alert the user of an out of range delay input. - * - * Note that the LPSPI module must be configured for master mode before configuring this. And note that - * the delayTime = LPSPI_clockSource / (PRESCALE * Delay_scaler). - * - * @param base LPSPI peripheral address. - * @param delayTimeInNanoSec The desired delay value in nano-seconds. - * @param whichDelay The desired delay to configuration, which must be of type lpspi_delay_type_t. - * @param srcClock_Hz Module source input clock in Hertz. - * @return actual Calculated delay value in nano-seconds. - */ -uint32_t LPSPI_MasterSetDelayTimes(LPSPI_Type *base, - uint32_t delayTimeInNanoSec, - lpspi_delay_type_t whichDelay, - uint32_t srcClock_Hz); - -/*! - * @brief Writes data into the transmit data buffer. - * - * This function writes data passed in by the user to the Transmit Data Register (TDR). - * The user can pass up to 32-bits of data to load into the TDR. If the frame size exceeds 32-bits, - * the user has to manage sending the data one 32-bit word at a time. - * Any writes to the TDR result in an immediate push to the transmit FIFO. - * This function can be used for either master or slave modes. - * - * @param base LPSPI peripheral address. - * @param data The data word to be sent. - */ -static inline void LPSPI_WriteData(LPSPI_Type *base, uint32_t data) -{ - base->TDR = data; -} - -/*! - * @brief Reads data from the data buffer. - * - * This function reads the data from the Receive Data Register (RDR). - * This function can be used for either master or slave mode. - * - * @param base LPSPI peripheral address. - * @return The data read from the data buffer. - */ -static inline uint32_t LPSPI_ReadData(LPSPI_Type *base) -{ - return (base->RDR); -} - -/*! - * @brief Set up the dummy data. - * - * @param base LPSPI peripheral address. - * @param dummyData Data to be transferred when tx buffer is NULL. - * Note: - * This API has no effect when LPSPI in slave interrupt mode, because driver - * will set the TXMSK bit to 1 if txData is NULL, no data is loaded from transmit - * FIFO and output pin is tristated. - */ -void LPSPI_SetDummyData(LPSPI_Type *base, uint8_t dummyData); - -/*! - *@} - */ - -/*! - * @name Transactional - * @{ - */ -/*Transactional APIs*/ - -/*! - * @brief Initializes the LPSPI master handle. - * - * This function initializes the LPSPI handle, which can be used for other LPSPI transactional APIs. Usually, for a - * specified LPSPI instance, call this API once to get the initialized handle. - - * @param base LPSPI peripheral address. - * @param handle LPSPI handle pointer to lpspi_master_handle_t. - * @param callback DSPI callback. - * @param userData callback function parameter. - */ -void LPSPI_MasterTransferCreateHandle(LPSPI_Type *base, - lpspi_master_handle_t *handle, - lpspi_master_transfer_callback_t callback, - void *userData); - -/*! - * @brief LPSPI master transfer data using a polling method. - * - * This function transfers data using a polling method. This is a blocking function, which does not return until all - * transfers have been - * completed. - * - * Note: - * The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not integer multiples of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * @param base LPSPI peripheral address. - * @param transfer pointer to lpspi_transfer_t structure. - * @return status of status_t. - */ -status_t LPSPI_MasterTransferBlocking(LPSPI_Type *base, lpspi_transfer_t *transfer); - -/*! - * @brief LPSPI master transfer data using an interrupt method. - * - * This function transfers data using an interrupt method. This is a non-blocking function, which returns right away. - * When all data is transferred, the callback function is called. - * - * Note: - * The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not integer multiples of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * @param base LPSPI peripheral address. - * @param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - * @param transfer pointer to lpspi_transfer_t structure. - * @return status of status_t. - */ -status_t LPSPI_MasterTransferNonBlocking(LPSPI_Type *base, lpspi_master_handle_t *handle, lpspi_transfer_t *transfer); - -/*! - * @brief Gets the master transfer remaining bytes. - * - * This function gets the master transfer remaining bytes. - * - * @param base LPSPI peripheral address. - * @param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - * @param count Number of bytes transferred so far by the non-blocking transaction. - * @return status of status_t. - */ -status_t LPSPI_MasterTransferGetCount(LPSPI_Type *base, lpspi_master_handle_t *handle, size_t *count); - -/*! - * @brief LPSPI master abort transfer which uses an interrupt method. - * - * This function aborts a transfer which uses an interrupt method. - * - * @param base LPSPI peripheral address. - * @param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - */ -void LPSPI_MasterTransferAbort(LPSPI_Type *base, lpspi_master_handle_t *handle); - -/*! - * @brief LPSPI Master IRQ handler function. - * - * This function processes the LPSPI transmit and receive IRQ. - * - * @param instance LPSPI instance. - * @param handle pointer to lpspi_master_handle_t structure which stores the transfer state. - */ -void LPSPI_MasterTransferHandleIRQ(uint32_t instance, lpspi_master_handle_t *handle); - -/*! - * @brief Initializes the LPSPI slave handle. - * - * This function initializes the LPSPI handle, which can be used for other LPSPI transactional APIs. Usually, for a - * specified LPSPI instance, call this API once to get the initialized handle. - * - * @param base LPSPI peripheral address. - * @param handle LPSPI handle pointer to lpspi_slave_handle_t. - * @param callback DSPI callback. - * @param userData callback function parameter. - */ -void LPSPI_SlaveTransferCreateHandle(LPSPI_Type *base, - lpspi_slave_handle_t *handle, - lpspi_slave_transfer_callback_t callback, - void *userData); - -/*! - * @brief LPSPI slave transfer data using an interrupt method. - * - * This function transfer data using an interrupt method. This is a non-blocking function, which returns right away. - * When all data is transferred, the callback function is called. - * - * Note: - * The transfer data size should be integer multiples of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not an integer multiple of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * @param base LPSPI peripheral address. - * @param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - * @param transfer pointer to lpspi_transfer_t structure. - * @return status of status_t. - */ -status_t LPSPI_SlaveTransferNonBlocking(LPSPI_Type *base, lpspi_slave_handle_t *handle, lpspi_transfer_t *transfer); - -/*! - * @brief Gets the slave transfer remaining bytes. - * - * This function gets the slave transfer remaining bytes. - * - * @param base LPSPI peripheral address. - * @param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - * @param count Number of bytes transferred so far by the non-blocking transaction. - * @return status of status_t. - */ -status_t LPSPI_SlaveTransferGetCount(LPSPI_Type *base, lpspi_slave_handle_t *handle, size_t *count); - -/*! - * @brief LPSPI slave aborts a transfer which uses an interrupt method. - * - * This function aborts a transfer which uses an interrupt method. - * - * @param base LPSPI peripheral address. - * @param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - */ -void LPSPI_SlaveTransferAbort(LPSPI_Type *base, lpspi_slave_handle_t *handle); - -/*! - * @brief LPSPI Slave IRQ handler function. - * - * This function processes the LPSPI transmit and receives an IRQ. - * - * @param instance LPSPI instance index. - * @param handle pointer to lpspi_slave_handle_t structure which stores the transfer state. - */ -void LPSPI_SlaveTransferHandleIRQ(uint32_t instance, lpspi_slave_handle_t *handle); - -/*! - *@} - */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /*FSL_LPSPI_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpspi_edma.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpspi_edma.c deleted file mode 100644 index dcfcd4d982d..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpspi_edma.c +++ /dev/null @@ -1,1143 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpspi_edma.h" - -/*********************************************************************************************************************** - * Definitions - ***********************************************************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpflexcomm_lpspi_edma" -#endif - -/*! - * @brief Structure definition for dspi_master_edma_private_handle_t. The structure is private. - */ -typedef struct _lpspi_master_edma_private_handle -{ - LPSPI_Type *base; /*!< LPSPI peripheral base address. */ - lpspi_master_edma_handle_t *handle; /*!< lpspi_master_edma_handle_t handle */ -} lpspi_master_edma_private_handle_t; - -/*! - * @brief Structure definition for dspi_slave_edma_private_handle_t. The structure is private. - */ -typedef struct _lpspi_slave_edma_private_handle -{ - LPSPI_Type *base; /*!< LPSPI peripheral base address. */ - lpspi_slave_edma_handle_t *handle; /*!< lpspi_slave_edma_handle_t handle */ -} lpspi_slave_edma_private_handle_t; - -/*********************************************************************************************************************** - * Prototypes - ***********************************************************************************************************************/ - -/*! - * @brief EDMA_LpspiMasterCallback after the LPSPI master transfer completed by using EDMA. - * This is not a public API. - */ -static void EDMA_LpspiMasterCallback(edma_handle_t *edmaHandle, - void *g_lpspiEdmaPrivateHandle, - bool transferDone, - uint32_t tcds); - -/*! - * @brief EDMA_LpspiSlaveCallback after the LPSPI slave transfer completed by using EDMA. - * This is not a public API. - */ -static void EDMA_LpspiSlaveCallback(edma_handle_t *edmaHandle, - void *g_lpspiEdmaPrivateHandle, - bool transferDone, - uint32_t tcds); - -static void LPSPI_SeparateEdmaReadData(uint8_t *rxData, uint32_t readData, uint32_t bytesEachRead, bool isByteSwap); - -/*********************************************************************************************************************** - * Variables - ***********************************************************************************************************************/ -/*! @brief Pointers to lpspi bases for each instance. */ -static LPSPI_Type *const s_lpspiBases[] = LPSPI_BASE_PTRS; - -/*! @brief Pointers to lpspi edma handles for each instance. */ -static lpspi_master_edma_private_handle_t s_lpspiMasterEdmaPrivateHandle[ARRAY_SIZE(s_lpspiBases)]; -static lpspi_slave_edma_private_handle_t s_lpspiSlaveEdmaPrivateHandle[ARRAY_SIZE(s_lpspiBases)]; - -/*********************************************************************************************************************** - * Code - ***********************************************************************************************************************/ -static void LPSPI_SeparateEdmaReadData(uint8_t *rxData, uint32_t readData, uint32_t bytesEachRead, bool isByteSwap) -{ - assert(rxData != NULL); - - switch (bytesEachRead) - { - case 1: - if (!isByteSwap) - { - *rxData = (uint8_t)readData; - ++rxData; - } - else - { - *rxData = (uint8_t)(readData >> 24); - ++rxData; - } - break; - - case 2: - if (!isByteSwap) - { - *rxData = (uint8_t)readData; - ++rxData; - *rxData = (uint8_t)(readData >> 8); - ++rxData; - } - else - { - *rxData = (uint8_t)(readData >> 16); - ++rxData; - *rxData = (uint8_t)(readData >> 24); - ++rxData; - } - break; - - case 4: - - *rxData = (uint8_t)readData; - ++rxData; - *rxData = (uint8_t)(readData >> 8); - ++rxData; - *rxData = (uint8_t)(readData >> 16); - ++rxData; - *rxData = (uint8_t)(readData >> 24); - ++rxData; - - break; - - default: - assert(false); - break; - } -} - -/*! - * brief Initializes the LPSPI master eDMA handle. - * - * This function initializes the LPSPI eDMA handle which can be used for other LPSPI transactional APIs. Usually, for a - * specified LPSPI instance, call this API once to get the initialized handle. - * - * Note that the LPSPI eDMA has a separated (Rx and Rx as two sources) or shared (Rx and Tx are the same source) DMA - * request source. - * (1) For a separated DMA request source, enable and set the Rx DMAMUX source for edmaRxRegToRxDataHandle and - * Tx DMAMUX source for edmaIntermediaryToTxRegHandle. - * (2) For a shared DMA request source, enable and set the Rx/Rx DMAMUX source for edmaRxRegToRxDataHandle. - * - * param base LPSPI peripheral base address. - * param handle LPSPI handle pointer to lpspi_master_edma_handle_t. - * param callback LPSPI callback. - * param userData callback function parameter. - * param edmaRxRegToRxDataHandle edmaRxRegToRxDataHandle pointer to edma_handle_t. - * param edmaTxDataToTxRegHandle edmaTxDataToTxRegHandle pointer to edma_handle_t. - */ -void LPSPI_MasterTransferCreateHandleEDMA(LPSPI_Type *base, - lpspi_master_edma_handle_t *handle, - lpspi_master_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *edmaRxRegToRxDataHandle, - edma_handle_t *edmaTxDataToTxRegHandle) -{ - assert(handle != NULL); - assert(edmaRxRegToRxDataHandle != NULL); - assert(edmaTxDataToTxRegHandle != NULL); - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - uint32_t instance = LPSPI_GetInstance(base); - - s_lpspiMasterEdmaPrivateHandle[instance].base = base; - s_lpspiMasterEdmaPrivateHandle[instance].handle = handle; - - handle->callback = callback; - handle->userData = userData; - - handle->edmaRxRegToRxDataHandle = edmaRxRegToRxDataHandle; - handle->edmaTxDataToTxRegHandle = edmaTxDataToTxRegHandle; -} - -static void LPSPI_PrepareTransferEDMA(LPSPI_Type *base) -{ - /* Flush FIFO, clear status, disable all the inerrupts and DMA requests. */ - LPSPI_FlushFifo(base, true, true); - LPSPI_ClearStatusFlags(base, (uint32_t)kLPSPI_AllStatusFlag); - LPSPI_DisableInterrupts(base, (uint32_t)kLPSPI_AllInterruptEnable); - LPSPI_DisableDMA(base, (uint32_t)kLPSPI_RxDmaEnable | (uint32_t)kLPSPI_TxDmaEnable); -} - -/*! - * brief LPSPI master config transfer parameter using eDMA. - * - * This function is preparing to transfers data using eDMA. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_master_edma_handle_t structure which stores the transfer state. - * param configFlags transfer configuration flags. ref _lpspi_transfer_config_flag_for_master. - * return Indicates whether LPSPI master transfer was successful or not. - * retval kStatus_Success Execution successfully. - * retval kStatus_LPSPI_Busy The LPSPI device is busy. - */ -status_t LPSPI_MasterTransferPrepareEDMALite(LPSPI_Type *base, lpspi_master_edma_handle_t *handle, uint32_t configFlags) -{ - assert(handle != NULL); - - /* Check that we're not busy.*/ - if (handle->state == (uint8_t)kLPSPI_Busy) - { - return kStatus_LPSPI_Busy; - } - - /* Disable module before configuration */ - LPSPI_Enable(base, false); - - LPSPI_PrepareTransferEDMA(base); - - bool isByteSwap = ((configFlags & (uint32_t)kLPSPI_MasterByteSwap) != 0U); - bool isPcsContinuous = ((configFlags & (uint32_t)kLPSPI_MasterPcsContinuous) != 0U); - uint32_t instance = LPSPI_GetInstance(base); - uint8_t dummyData = g_lpspiDummyData[instance]; - /*Used for byte swap*/ - uint32_t whichPcs = (configFlags & LPSPI_MASTER_PCS_MASK) >> LPSPI_MASTER_PCS_SHIFT; - uint32_t bytesPerFrame = ((base->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT) / 8U + 1U; - - handle->txBuffIfNull = - ((uint32_t)dummyData) | ((uint32_t)dummyData << 8) | ((uint32_t)dummyData << 16) | ((uint32_t)dummyData << 24); - /*The TX and RX FIFO sizes are always the same*/ - handle->fifoSize = LPSPI_GetRxFifoSize(base); - handle->isPcsContinuous = isPcsContinuous; - handle->isByteSwap = isByteSwap; - handle->isThereExtraRxBytes = false; - - /*Because DMA is fast enough , so set the RX and TX watermarks to 0 .*/ - LPSPI_SetFifoWatermarks(base, 0U, 0U); - - /* Transfers will stall when transmit FIFO is empty or receive FIFO is full. */ - base->CFGR1 &= (~LPSPI_CFGR1_NOSTALL_MASK); - - /* Enable module for following configuration of TCR to take effect. */ - LPSPI_Enable(base, true); - - /* For DMA transfer , we'd better not masked the transmit data and receive data in TCR since the transfer flow is - * hard to controlled by software. */ - base->TCR = (base->TCR & ~(LPSPI_TCR_CONT_MASK | LPSPI_TCR_CONTC_MASK | LPSPI_TCR_BYSW_MASK | LPSPI_TCR_PCS_MASK)) | - LPSPI_TCR_CONT(isPcsContinuous) | LPSPI_TCR_BYSW(isByteSwap) | LPSPI_TCR_PCS(whichPcs); - /*Calculate the bytes for write/read the TX/RX register each time*/ - if (bytesPerFrame <= 4U) - { - handle->bytesEachWrite = (uint8_t)bytesPerFrame; - handle->bytesEachRead = (uint8_t)bytesPerFrame; - handle->bytesLastRead = (uint8_t)bytesPerFrame; - } - else - { - handle->bytesEachWrite = 4U; - handle->bytesEachRead = 4U; - - handle->bytesLastRead = 4U; - } - return kStatus_Success; -} - -/*! - * brief LPSPI master transfer data using eDMA without configs. - * - * This function transfers data using eDMA. This is a non-blocking function, which returns right away. When all data - * is transferred, the callback function is called. - * - * Note: - * This API is only for transfer through DMA without configuration. - * Before calling this API, you must call LPSPI_MasterTransferPrepareEDMALite to configure it once. - * The transfer data size should be an integer multiple of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not an integer multiple of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_master_edma_handle_t structure which stores the transfer state. - * param transfer pointer to lpspi_transfer_t structure, config field is not working. - * return Indicates whether LPSPI master transfer was successful or not. - * retval kStatus_Success Execution successfully. - * retval kStatus_LPSPI_Busy The LPSPI device is busy. - * retval kStatus_InvalidArgument The transfer structure is invalid. - */ -status_t LPSPI_MasterTransferEDMALite(LPSPI_Type *base, lpspi_master_edma_handle_t *handle, lpspi_transfer_t *transfer) -{ - assert(handle != NULL); - assert(transfer != NULL); - - /* Check that we're not busy.*/ - if (handle->state == (uint8_t)kLPSPI_Busy) - { - return kStatus_LPSPI_Busy; - } - - /* Check arguements */ - if (!LPSPI_CheckTransferArgument(base, transfer, true)) - { - return kStatus_InvalidArgument; - } - - /* Variables */ - bool isThereExtraTxBytes = false; - uint8_t bytesLastWrite = 0; - uint32_t instance = LPSPI_GetInstance(base); - /*Used for byte swap*/ - uint32_t addrOffset = 0; - uint32_t rxAddr = LPSPI_GetRxRegisterAddress(base); - uint32_t txAddr = LPSPI_GetTxRegisterAddress(base); - uint32_t bytesPerFrame = ((base->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT) / 8U + 1U; - edma_transfer_config_t transferConfigRx = {0}; - edma_transfer_config_t transferConfigTx = {0}; - edma_tcd_t *softwareTCD_pcsContinuous = (edma_tcd_t *)((uint32_t)(&handle->lpspiSoftwareTCD[2]) & (~0x1FU)); - edma_tcd_t *softwareTCD_extraBytes = (edma_tcd_t *)((uint32_t)(&handle->lpspiSoftwareTCD[1]) & (~0x1FU)); - - handle->state = (uint8_t)kLPSPI_Busy; - handle->txData = transfer->txData; - handle->rxData = transfer->rxData; - handle->txRemainingByteCount = transfer->dataSize; - handle->rxRemainingByteCount = transfer->dataSize; - handle->totalByteCount = transfer->dataSize; - handle->writeRegRemainingTimes = (transfer->dataSize / bytesPerFrame) * ((bytesPerFrame + 3U) / 4U); - handle->readRegRemainingTimes = handle->writeRegRemainingTimes; - - handle->isThereExtraRxBytes = false; - - /*Calculate the bytes for write/read the TX/RX register each time*/ - if (bytesPerFrame > 4U) - { - if ((transfer->dataSize % 4U) != 0U) - { - bytesLastWrite = (uint8_t)(transfer->dataSize % 4U); - handle->bytesLastRead = bytesLastWrite; - - isThereExtraTxBytes = true; - - --handle->writeRegRemainingTimes; - - --handle->readRegRemainingTimes; - handle->isThereExtraRxBytes = true; - } - } - - EDMA_SetCallback(handle->edmaRxRegToRxDataHandle, EDMA_LpspiMasterCallback, - &s_lpspiMasterEdmaPrivateHandle[instance]); - - /* Configure rx EDMA transfer */ - EDMA_ResetChannel(handle->edmaRxRegToRxDataHandle->base, handle->edmaRxRegToRxDataHandle->channel); - - if (handle->rxData != NULL) - { - transferConfigRx.destAddr = (uint32_t) & (handle->rxData[0]); - transferConfigRx.destOffset = 1; - } - else - { - transferConfigRx.destAddr = (uint32_t) & (handle->rxBuffIfNull); - transferConfigRx.destOffset = 0; - } - transferConfigRx.destTransferSize = kEDMA_TransferSize1Bytes; - - addrOffset = 0; - switch (handle->bytesEachRead) - { - case (1U): - transferConfigRx.srcTransferSize = kEDMA_TransferSize1Bytes; - transferConfigRx.minorLoopBytes = 1; - if (handle->isByteSwap) - { - addrOffset = 3; - } - break; - - case (2U): - transferConfigRx.srcTransferSize = kEDMA_TransferSize2Bytes; - transferConfigRx.minorLoopBytes = 2; - if (handle->isByteSwap) - { - addrOffset = 2; - } - break; - - case (4U): - transferConfigRx.srcTransferSize = kEDMA_TransferSize4Bytes; - transferConfigRx.minorLoopBytes = 4; - break; - - default: - transferConfigRx.srcTransferSize = kEDMA_TransferSize1Bytes; - transferConfigRx.minorLoopBytes = 1; - assert(false); - break; - } - - transferConfigRx.srcAddr = (uint32_t)rxAddr + addrOffset; - transferConfigRx.srcOffset = 0; - - transferConfigRx.majorLoopCounts = handle->readRegRemainingTimes; - - /* Store the initially configured eDMA minor byte transfer count into the LPSPI handle */ - handle->nbytes = (uint8_t)transferConfigRx.minorLoopBytes; - - EDMA_SetTransferConfig(handle->edmaRxRegToRxDataHandle->base, handle->edmaRxRegToRxDataHandle->channel, - &transferConfigRx, NULL); - EDMA_EnableChannelInterrupts(handle->edmaRxRegToRxDataHandle->base, handle->edmaRxRegToRxDataHandle->channel, - (uint32_t)kEDMA_MajorInterruptEnable); - - /* Configure tx EDMA transfer */ - EDMA_ResetChannel(handle->edmaTxDataToTxRegHandle->base, handle->edmaTxDataToTxRegHandle->channel); - - if (isThereExtraTxBytes) - { - if (handle->txData != NULL) - { - transferConfigTx.srcAddr = (uint32_t) & (transfer->txData[transfer->dataSize - bytesLastWrite]); - transferConfigTx.srcOffset = 1; - } - else - { - transferConfigTx.srcAddr = (uint32_t)(&handle->txBuffIfNull); - transferConfigTx.srcOffset = 0; - } - - transferConfigTx.destOffset = 0; - - transferConfigTx.srcTransferSize = kEDMA_TransferSize1Bytes; - - addrOffset = 0; - switch (bytesLastWrite) - { - case (1U): - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - if (handle->isByteSwap) - { - addrOffset = 3; - } - break; - - case (2U): - transferConfigTx.destTransferSize = kEDMA_TransferSize2Bytes; - transferConfigTx.minorLoopBytes = 2; - if (handle->isByteSwap) - { - addrOffset = 2; - } - break; - - default: - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - assert(false); - break; - } - - transferConfigTx.destAddr = (uint32_t)txAddr + addrOffset; - transferConfigTx.majorLoopCounts = 1; - -#if defined FSL_EDMA_DRIVER_EDMA4 && FSL_EDMA_DRIVER_EDMA4 - EDMA_TcdResetExt(handle->edmaRxRegToRxDataHandle->base, softwareTCD_extraBytes); - if (handle->isPcsContinuous) - { - EDMA_TcdSetTransferConfigExt(handle->edmaRxRegToRxDataHandle->base, softwareTCD_extraBytes, - &transferConfigTx, softwareTCD_pcsContinuous); - } - else - { - EDMA_TcdSetTransferConfigExt(handle->edmaRxRegToRxDataHandle->base, softwareTCD_extraBytes, - &transferConfigTx, NULL); - } -#else - EDMA_TcdReset(softwareTCD_extraBytes); - if (handle->isPcsContinuous) - { - EDMA_TcdSetTransferConfig(softwareTCD_extraBytes, &transferConfigTx, softwareTCD_pcsContinuous); - } - else - { - EDMA_TcdSetTransferConfig(softwareTCD_extraBytes, &transferConfigTx, NULL); - } -#endif - } - - if (handle->isPcsContinuous) - { - handle->transmitCommand = base->TCR & ~(LPSPI_TCR_CONTC_MASK | LPSPI_TCR_CONT_MASK); - - transferConfigTx.srcAddr = (uint32_t) & (handle->transmitCommand); - transferConfigTx.srcOffset = 0; - - transferConfigTx.destAddr = (uint32_t) & (base->TCR); - transferConfigTx.destOffset = 0; - - transferConfigTx.srcTransferSize = kEDMA_TransferSize4Bytes; - transferConfigTx.destTransferSize = kEDMA_TransferSize4Bytes; - transferConfigTx.minorLoopBytes = 4; - transferConfigTx.majorLoopCounts = 1; - -#if defined FSL_EDMA_DRIVER_EDMA4 && FSL_EDMA_DRIVER_EDMA4 - EDMA_TcdResetExt(handle->edmaRxRegToRxDataHandle->base, softwareTCD_pcsContinuous); - EDMA_TcdSetTransferConfigExt(handle->edmaRxRegToRxDataHandle->base, softwareTCD_pcsContinuous, - &transferConfigTx, NULL); -#else - EDMA_TcdReset(softwareTCD_pcsContinuous); - EDMA_TcdSetTransferConfig(softwareTCD_pcsContinuous, &transferConfigTx, NULL); -#endif - } - - if (handle->txData != NULL) - { - transferConfigTx.srcAddr = (uint32_t)(handle->txData); - transferConfigTx.srcOffset = 1; - } - else - { - transferConfigTx.srcAddr = (uint32_t)(&handle->txBuffIfNull); - transferConfigTx.srcOffset = 0; - } - - transferConfigTx.destOffset = 0; - - transferConfigTx.srcTransferSize = kEDMA_TransferSize1Bytes; - - addrOffset = 0U; - switch (handle->bytesEachRead) - { - case (1U): - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - if (handle->isByteSwap) - { - addrOffset = 3; - } - break; - - case (2U): - transferConfigTx.destTransferSize = kEDMA_TransferSize2Bytes; - transferConfigTx.minorLoopBytes = 2; - - if (handle->isByteSwap) - { - addrOffset = 2; - } - break; - - case (4U): - transferConfigTx.destTransferSize = kEDMA_TransferSize4Bytes; - transferConfigTx.minorLoopBytes = 4; - break; - - default: - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - assert(false); - break; - } - - transferConfigTx.destAddr = (uint32_t)txAddr + addrOffset; - - transferConfigTx.majorLoopCounts = handle->writeRegRemainingTimes; - - if (isThereExtraTxBytes) - { - EDMA_SetTransferConfig(handle->edmaTxDataToTxRegHandle->base, handle->edmaTxDataToTxRegHandle->channel, - &transferConfigTx, softwareTCD_extraBytes); - } - else if (handle->isPcsContinuous) - { - EDMA_SetTransferConfig(handle->edmaTxDataToTxRegHandle->base, handle->edmaTxDataToTxRegHandle->channel, - &transferConfigTx, softwareTCD_pcsContinuous); - } - else - { - EDMA_SetTransferConfig(handle->edmaTxDataToTxRegHandle->base, handle->edmaTxDataToTxRegHandle->channel, - &transferConfigTx, NULL); - } - - EDMA_StartTransfer(handle->edmaTxDataToTxRegHandle); - EDMA_StartTransfer(handle->edmaRxRegToRxDataHandle); - LPSPI_EnableDMA(base, (uint32_t)kLPSPI_RxDmaEnable | (uint32_t)kLPSPI_TxDmaEnable); - - return kStatus_Success; -} - -/*! - * brief LPSPI master transfer data using eDMA. - * - * This function transfers data using eDMA. This is a non-blocking function, which returns right away. When all data - * is transferred, the callback function is called. - * - * Note: - * The transfer data size should be an integer multiple of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not an integer multiple of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_master_edma_handle_t structure which stores the transfer state. - * param transfer pointer to lpspi_transfer_t structure. - * return status of status_t. - */ -status_t LPSPI_MasterTransferEDMA(LPSPI_Type *base, lpspi_master_edma_handle_t *handle, lpspi_transfer_t *transfer) -{ - status_t status = kStatus_Fail; - status = LPSPI_MasterTransferPrepareEDMALite(base, handle, transfer->configFlags); - if (kStatus_Success != status) - { - return status; - } - return LPSPI_MasterTransferEDMALite(base, handle, transfer); -} - -static void EDMA_LpspiMasterCallback(edma_handle_t *edmaHandle, - void *g_lpspiEdmaPrivateHandle, - bool transferDone, - uint32_t tcds) -{ - assert(edmaHandle != NULL); - assert(g_lpspiEdmaPrivateHandle != NULL); - - uint32_t readData; - - lpspi_master_edma_private_handle_t *lpspiEdmaPrivateHandle; - - lpspiEdmaPrivateHandle = (lpspi_master_edma_private_handle_t *)g_lpspiEdmaPrivateHandle; - - size_t rxRemainingByteCount = lpspiEdmaPrivateHandle->handle->rxRemainingByteCount; - uint8_t bytesLastRead = lpspiEdmaPrivateHandle->handle->bytesLastRead; - bool isByteSwap = lpspiEdmaPrivateHandle->handle->isByteSwap; - - LPSPI_DisableDMA(lpspiEdmaPrivateHandle->base, (uint32_t)kLPSPI_TxDmaEnable | (uint32_t)kLPSPI_RxDmaEnable); - - if (lpspiEdmaPrivateHandle->handle->isThereExtraRxBytes) - { - while (LPSPI_GetRxFifoCount(lpspiEdmaPrivateHandle->base) == 0U) - { - } - readData = LPSPI_ReadData(lpspiEdmaPrivateHandle->base); - - if (lpspiEdmaPrivateHandle->handle->rxData != NULL) - { - LPSPI_SeparateEdmaReadData(&(lpspiEdmaPrivateHandle->handle->rxData[rxRemainingByteCount - bytesLastRead]), - readData, bytesLastRead, isByteSwap); - } - } - - lpspiEdmaPrivateHandle->handle->state = (uint8_t)kLPSPI_Idle; - - if (lpspiEdmaPrivateHandle->handle->callback != NULL) - { - lpspiEdmaPrivateHandle->handle->callback(lpspiEdmaPrivateHandle->base, lpspiEdmaPrivateHandle->handle, - kStatus_Success, lpspiEdmaPrivateHandle->handle->userData); - } -} - -/*! - * brief LPSPI master aborts a transfer which is using eDMA. - * - * This function aborts a transfer which is using eDMA. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_master_edma_handle_t structure which stores the transfer state. - */ -void LPSPI_MasterTransferAbortEDMA(LPSPI_Type *base, lpspi_master_edma_handle_t *handle) -{ - assert(handle != NULL); - - LPSPI_DisableDMA(base, (uint32_t)kLPSPI_RxDmaEnable | (uint32_t)kLPSPI_TxDmaEnable); - - EDMA_AbortTransfer(handle->edmaRxRegToRxDataHandle); - EDMA_AbortTransfer(handle->edmaTxDataToTxRegHandle); - - handle->state = (uint8_t)kLPSPI_Idle; -} - -/*! - * brief Gets the master eDMA transfer remaining bytes. - * - * This function gets the master eDMA transfer remaining bytes. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_master_edma_handle_t structure which stores the transfer state. - * param count Number of bytes transferred so far by the EDMA transaction. - * return status of status_t. - */ -status_t LPSPI_MasterTransferGetCountEDMA(LPSPI_Type *base, lpspi_master_edma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (handle->state != (uint8_t)kLPSPI_Busy) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - size_t remainingByte; - - remainingByte = - (uint32_t)handle->nbytes * EDMA_GetRemainingMajorLoopCount(handle->edmaRxRegToRxDataHandle->base, - handle->edmaRxRegToRxDataHandle->channel); - - *count = handle->totalByteCount - remainingByte; - - return kStatus_Success; -} - -/*! - * brief Initializes the LPSPI slave eDMA handle. - * - * This function initializes the LPSPI eDMA handle which can be used for other LPSPI transactional APIs. Usually, for a - * specified LPSPI instance, call this API once to get the initialized handle. - * - * Note that LPSPI eDMA has a separated (Rx and Tx as two sources) or shared (Rx and Tx as the same source) DMA request - * source. - * - * (1) For a separated DMA request source, enable and set the Rx DMAMUX source for edmaRxRegToRxDataHandle and - * Tx DMAMUX source for edmaTxDataToTxRegHandle. - * (2) For a shared DMA request source, enable and set the Rx/Rx DMAMUX source for edmaRxRegToRxDataHandle . - * - * param base LPSPI peripheral base address. - * param handle LPSPI handle pointer to lpspi_slave_edma_handle_t. - * param callback LPSPI callback. - * param userData callback function parameter. - * param edmaRxRegToRxDataHandle edmaRxRegToRxDataHandle pointer to edma_handle_t. - * param edmaTxDataToTxRegHandle edmaTxDataToTxRegHandle pointer to edma_handle_t. - */ -void LPSPI_SlaveTransferCreateHandleEDMA(LPSPI_Type *base, - lpspi_slave_edma_handle_t *handle, - lpspi_slave_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *edmaRxRegToRxDataHandle, - edma_handle_t *edmaTxDataToTxRegHandle) -{ - assert(handle != NULL); - assert(edmaRxRegToRxDataHandle != NULL); - assert(edmaTxDataToTxRegHandle != NULL); - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - uint32_t instance = LPSPI_GetInstance(base); - - s_lpspiSlaveEdmaPrivateHandle[instance].base = base; - s_lpspiSlaveEdmaPrivateHandle[instance].handle = handle; - - handle->callback = callback; - handle->userData = userData; - - handle->edmaRxRegToRxDataHandle = edmaRxRegToRxDataHandle; - handle->edmaTxDataToTxRegHandle = edmaTxDataToTxRegHandle; -} - -/*! - * brief LPSPI slave transfers data using eDMA. - * - * This function transfers data using eDMA. This is a non-blocking function, which return right away. When all data - * is transferred, the callback function is called. - * - * Note: - * The transfer data size should be an integer multiple of bytesPerFrame if bytesPerFrame is less than or equal to 4. - * For bytesPerFrame greater than 4: - * The transfer data size should be equal to bytesPerFrame if the bytesPerFrame is not an integer multiple of 4. - * Otherwise, the transfer data size can be an integer multiple of bytesPerFrame. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_slave_edma_handle_t structure which stores the transfer state. - * param transfer pointer to lpspi_transfer_t structure. - * return status of status_t. - */ -status_t LPSPI_SlaveTransferEDMA(LPSPI_Type *base, lpspi_slave_edma_handle_t *handle, lpspi_transfer_t *transfer) -{ - assert(handle != NULL); - assert(transfer != NULL); - - /* Check that we're not busy.*/ - if (handle->state == (uint8_t)kLPSPI_Busy) - { - return kStatus_LPSPI_Busy; - } - /* Disable module before configuration. */ - LPSPI_Enable(base, false); - /* Check arguements, also dma transfer can not support 3 bytes */ - if (!LPSPI_CheckTransferArgument(base, transfer, true)) - { - return kStatus_InvalidArgument; - } - - LPSPI_PrepareTransferEDMA(base); - - /* Variables */ - bool isThereExtraTxBytes = false; - bool isByteSwap = ((transfer->configFlags & (uint32_t)kLPSPI_MasterByteSwap) != 0U); - uint8_t bytesLastWrite = 0; - uint8_t dummyData = g_lpspiDummyData[LPSPI_GetInstance(base)]; - uint32_t mask = (uint32_t)kLPSPI_RxDmaEnable; - - /* Used for byte swap */ - uint32_t addrOffset = 0; - uint32_t instance = LPSPI_GetInstance(base); - uint32_t rxAddr = LPSPI_GetRxRegisterAddress(base); - uint32_t txAddr = LPSPI_GetTxRegisterAddress(base); - uint32_t whichPcs = (transfer->configFlags & LPSPI_MASTER_PCS_MASK) >> LPSPI_MASTER_PCS_SHIFT; - uint32_t bytesPerFrame = ((base->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT) / 8U + 1U; - edma_transfer_config_t transferConfigRx = {0}; - edma_transfer_config_t transferConfigTx = {0}; - edma_tcd_t *softwareTCD_extraBytes = (edma_tcd_t *)((uint32_t)(&handle->lpspiSoftwareTCD[1]) & (~0x1FU)); - - /* Assign the original value for members of transfer handle. */ - handle->state = (uint8_t)kLPSPI_Busy; - handle->txData = transfer->txData; - handle->rxData = transfer->rxData; - handle->txRemainingByteCount = transfer->dataSize; - handle->rxRemainingByteCount = transfer->dataSize; - handle->totalByteCount = transfer->dataSize; - handle->writeRegRemainingTimes = (transfer->dataSize / bytesPerFrame) * ((bytesPerFrame + 3U) / 4U); - handle->readRegRemainingTimes = handle->writeRegRemainingTimes; - handle->txBuffIfNull = - ((uint32_t)dummyData) | ((uint32_t)dummyData << 8) | ((uint32_t)dummyData << 16) | ((uint32_t)dummyData << 24); - /*The TX and RX FIFO sizes are always the same*/ - handle->fifoSize = LPSPI_GetRxFifoSize(base); - handle->isByteSwap = isByteSwap; - handle->isThereExtraRxBytes = false; - - /* Because DMA is fast enough, set the RX and TX watermarks to 0. */ - LPSPI_SetFifoWatermarks(base, 0U, 0U); - - /* Transfers will stall when transmit FIFO is empty or receive FIFO is full. */ - base->CFGR1 &= (~LPSPI_CFGR1_NOSTALL_MASK); - - /* Enable module for following configuration of TCR to take effect. */ - LPSPI_Enable(base, true); - - /* For DMA transfer, mask the transmit data if the tx data is null, for rx the receive data should not be masked at - any time since we use rx dma transfer finish cllback to indicate transfer finish. */ - base->TCR = - (base->TCR & ~(LPSPI_TCR_CONT_MASK | LPSPI_TCR_CONTC_MASK | LPSPI_TCR_BYSW_MASK | LPSPI_TCR_TXMSK_MASK)) | - LPSPI_TCR_TXMSK(transfer->txData == NULL) | LPSPI_TCR_BYSW(isByteSwap) | LPSPI_TCR_PCS(whichPcs); - - /*Calculate the bytes for write/read the TX/RX register each time*/ - if (bytesPerFrame <= 4U) - { - handle->bytesEachWrite = (uint8_t)bytesPerFrame; - handle->bytesEachRead = (uint8_t)bytesPerFrame; - - handle->bytesLastRead = (uint8_t)bytesPerFrame; - } - else - { - handle->bytesEachWrite = 4U; - handle->bytesEachRead = 4U; - - handle->bytesLastRead = 4U; - - if ((transfer->dataSize % 4U) != 0U) - { - bytesLastWrite = (uint8_t)(transfer->dataSize % 4U); - handle->bytesLastRead = bytesLastWrite; - - isThereExtraTxBytes = true; - --handle->writeRegRemainingTimes; - - handle->isThereExtraRxBytes = true; - --handle->readRegRemainingTimes; - } - } - - EDMA_SetCallback(handle->edmaRxRegToRxDataHandle, EDMA_LpspiSlaveCallback, - &s_lpspiSlaveEdmaPrivateHandle[instance]); - - /*Rx*/ - if (handle->readRegRemainingTimes > 0U) - { - EDMA_ResetChannel(handle->edmaRxRegToRxDataHandle->base, handle->edmaRxRegToRxDataHandle->channel); - - if (handle->rxData != NULL) - { - transferConfigRx.destAddr = (uint32_t) & (handle->rxData[0]); - transferConfigRx.destOffset = 1; - } - else - { - transferConfigRx.destAddr = (uint32_t) & (handle->rxBuffIfNull); - transferConfigRx.destOffset = 0; - } - transferConfigRx.destTransferSize = kEDMA_TransferSize1Bytes; - - addrOffset = 0; - switch (handle->bytesEachRead) - { - case (1U): - transferConfigRx.srcTransferSize = kEDMA_TransferSize1Bytes; - transferConfigRx.minorLoopBytes = 1; - if (handle->isByteSwap) - { - addrOffset = 3; - } - break; - - case (2U): - transferConfigRx.srcTransferSize = kEDMA_TransferSize2Bytes; - transferConfigRx.minorLoopBytes = 2; - if (handle->isByteSwap) - { - addrOffset = 2; - } - break; - - case (4U): - transferConfigRx.srcTransferSize = kEDMA_TransferSize4Bytes; - transferConfigRx.minorLoopBytes = 4; - break; - - default: - transferConfigRx.srcTransferSize = kEDMA_TransferSize1Bytes; - transferConfigRx.minorLoopBytes = 1; - assert(false); - break; - } - - transferConfigRx.srcAddr = (uint32_t)rxAddr + addrOffset; - transferConfigRx.srcOffset = 0; - - transferConfigRx.majorLoopCounts = handle->readRegRemainingTimes; - - /* Store the initially configured eDMA minor byte transfer count into the DSPI handle */ - handle->nbytes = (uint8_t)transferConfigRx.minorLoopBytes; - - EDMA_SetTransferConfig(handle->edmaRxRegToRxDataHandle->base, handle->edmaRxRegToRxDataHandle->channel, - &transferConfigRx, NULL); - EDMA_EnableChannelInterrupts(handle->edmaRxRegToRxDataHandle->base, handle->edmaRxRegToRxDataHandle->channel, - (uint32_t)kEDMA_MajorInterruptEnable); - EDMA_StartTransfer(handle->edmaRxRegToRxDataHandle); - } - - /*Tx*/ - if (handle->txData != NULL) - { - EDMA_ResetChannel(handle->edmaTxDataToTxRegHandle->base, handle->edmaTxDataToTxRegHandle->channel); - if (isThereExtraTxBytes) - { - transferConfigTx.srcAddr = (uint32_t) & (transfer->txData[transfer->dataSize - bytesLastWrite]); - transferConfigTx.srcOffset = 1; - transferConfigTx.destOffset = 0; - transferConfigTx.srcTransferSize = kEDMA_TransferSize1Bytes; - addrOffset = 0; - switch (bytesLastWrite) - { - case (1U): - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - if (handle->isByteSwap) - { - addrOffset = 3; - } - break; - - case (2U): - transferConfigTx.destTransferSize = kEDMA_TransferSize2Bytes; - transferConfigTx.minorLoopBytes = 2; - if (handle->isByteSwap) - { - addrOffset = 2; - } - break; - - default: - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - assert(false); - break; - } - - transferConfigTx.destAddr = (uint32_t)txAddr + addrOffset; - transferConfigTx.majorLoopCounts = 1; - -#if defined FSL_EDMA_DRIVER_EDMA4 && FSL_EDMA_DRIVER_EDMA4 - EDMA_TcdResetExt(handle->edmaTxDataToTxRegHandle->base, softwareTCD_extraBytes); - EDMA_TcdSetTransferConfigExt(handle->edmaTxDataToTxRegHandle->base, softwareTCD_extraBytes, - &transferConfigTx, NULL); -#else - EDMA_TcdReset(softwareTCD_extraBytes); - EDMA_TcdSetTransferConfig(softwareTCD_extraBytes, &transferConfigTx, NULL); -#endif - } - - transferConfigTx.srcAddr = (uint32_t)(handle->txData); - transferConfigTx.srcOffset = 1; - transferConfigTx.destOffset = 0; - transferConfigTx.srcTransferSize = kEDMA_TransferSize1Bytes; - addrOffset = 0; - switch (handle->bytesEachRead) - { - case (1U): - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - if (handle->isByteSwap) - { - addrOffset = 3; - } - break; - - case (2U): - transferConfigTx.destTransferSize = kEDMA_TransferSize2Bytes; - transferConfigTx.minorLoopBytes = 2; - - if (handle->isByteSwap) - { - addrOffset = 2; - } - break; - - case (4U): - transferConfigTx.destTransferSize = kEDMA_TransferSize4Bytes; - transferConfigTx.minorLoopBytes = 4; - break; - - default: - transferConfigTx.destTransferSize = kEDMA_TransferSize1Bytes; - transferConfigTx.minorLoopBytes = 1; - assert(false); - break; - } - - transferConfigTx.destAddr = (uint32_t)txAddr + addrOffset; - transferConfigTx.majorLoopCounts = handle->writeRegRemainingTimes; - - if (isThereExtraTxBytes) - { - EDMA_SetTransferConfig(handle->edmaTxDataToTxRegHandle->base, handle->edmaTxDataToTxRegHandle->channel, - &transferConfigTx, softwareTCD_extraBytes); - } - else - { - EDMA_SetTransferConfig(handle->edmaTxDataToTxRegHandle->base, handle->edmaTxDataToTxRegHandle->channel, - &transferConfigTx, NULL); - } - EDMA_StartTransfer(handle->edmaTxDataToTxRegHandle); - mask |= (uint32_t)kLPSPI_TxDmaEnable; - } - - LPSPI_EnableDMA(base, mask); - - return kStatus_Success; -} - -static void EDMA_LpspiSlaveCallback(edma_handle_t *edmaHandle, - void *g_lpspiEdmaPrivateHandle, - bool transferDone, - uint32_t tcds) -{ - assert(edmaHandle != NULL); - assert(g_lpspiEdmaPrivateHandle != NULL); - - uint32_t readData; - - lpspi_slave_edma_private_handle_t *lpspiEdmaPrivateHandle; - - lpspiEdmaPrivateHandle = (lpspi_slave_edma_private_handle_t *)g_lpspiEdmaPrivateHandle; - - size_t rxRemainingByteCount = lpspiEdmaPrivateHandle->handle->rxRemainingByteCount; - uint8_t bytesLastRead = lpspiEdmaPrivateHandle->handle->bytesLastRead; - bool isByteSwap = lpspiEdmaPrivateHandle->handle->isByteSwap; - - LPSPI_DisableDMA(lpspiEdmaPrivateHandle->base, (uint32_t)kLPSPI_TxDmaEnable | (uint32_t)kLPSPI_RxDmaEnable); - - if (lpspiEdmaPrivateHandle->handle->isThereExtraRxBytes) - { - while (LPSPI_GetRxFifoCount(lpspiEdmaPrivateHandle->base) == 0U) - { - } - readData = LPSPI_ReadData(lpspiEdmaPrivateHandle->base); - - if (lpspiEdmaPrivateHandle->handle->rxData != NULL) - { - LPSPI_SeparateEdmaReadData(&(lpspiEdmaPrivateHandle->handle->rxData[rxRemainingByteCount - bytesLastRead]), - readData, bytesLastRead, isByteSwap); - } - } - - lpspiEdmaPrivateHandle->handle->state = (uint8_t)kLPSPI_Idle; - - if (lpspiEdmaPrivateHandle->handle->callback != NULL) - { - lpspiEdmaPrivateHandle->handle->callback(lpspiEdmaPrivateHandle->base, lpspiEdmaPrivateHandle->handle, - kStatus_Success, lpspiEdmaPrivateHandle->handle->userData); - } -} - -/*! - * brief LPSPI slave aborts a transfer which is using eDMA. - * - * This function aborts a transfer which is using eDMA. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_slave_edma_handle_t structure which stores the transfer state. - */ -void LPSPI_SlaveTransferAbortEDMA(LPSPI_Type *base, lpspi_slave_edma_handle_t *handle) -{ - assert(handle != NULL); - - LPSPI_DisableDMA(base, (uint32_t)kLPSPI_RxDmaEnable | (uint32_t)kLPSPI_TxDmaEnable); - - EDMA_AbortTransfer(handle->edmaRxRegToRxDataHandle); - EDMA_AbortTransfer(handle->edmaTxDataToTxRegHandle); - - handle->state = (uint8_t)kLPSPI_Idle; -} - -/*! - * brief Gets the slave eDMA transfer remaining bytes. - * - * This function gets the slave eDMA transfer remaining bytes. - * - * param base LPSPI peripheral base address. - * param handle pointer to lpspi_slave_edma_handle_t structure which stores the transfer state. - * param count Number of bytes transferred so far by the eDMA transaction. - * return status of status_t. - */ -status_t LPSPI_SlaveTransferGetCountEDMA(LPSPI_Type *base, lpspi_slave_edma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - if (NULL == count) - { - return kStatus_InvalidArgument; - } - - /* Catch when there is not an active transfer. */ - if (handle->state != (uint8_t)kLPSPI_Busy) - { - *count = 0; - return kStatus_NoTransferInProgress; - } - - size_t remainingByte; - - remainingByte = - (uint32_t)handle->nbytes * EDMA_GetRemainingMajorLoopCount(handle->edmaRxRegToRxDataHandle->base, - handle->edmaRxRegToRxDataHandle->channel); - - *count = handle->totalByteCount - remainingByte; - - return kStatus_Success; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpspi_edma.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpspi_edma.h deleted file mode 100644 index 06a2dd4e71c..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpspi_edma.h +++ /dev/null @@ -1,341 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_LPSPI_EDMA_H_ -#define FSL_LPSPI_EDMA_H_ - -#include "fsl_lpspi.h" -#include "fsl_edma.h" - -/*! - * @addtogroup lpspi_edma_driver - * @{ - */ - -/*********************************************************************************************************************** - * Definitions - **********************************************************************************************************************/ -/*! @name Driver version */ -/*! @{ */ -/*! @brief LPSPI EDMA driver version. */ -#define FSL_LPSPI_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 1, 1)) -/*! @} */ - -/*! - * @brief Forward declaration of the _lpspi_master_edma_handle typedefs. - */ -typedef struct _lpspi_master_edma_handle lpspi_master_edma_handle_t; - -/*! - * @brief Forward declaration of the _lpspi_slave_edma_handle typedefs. - */ -typedef struct _lpspi_slave_edma_handle lpspi_slave_edma_handle_t; - -/*! - * @brief Completion callback function pointer type. - * - * @param base LPSPI peripheral base address. - * @param handle Pointer to the handle for the LPSPI master. - * @param status Success or error code describing whether the transfer completed. - * @param userData Arbitrary pointer-dataSized value passed from the application. - */ -typedef void (*lpspi_master_edma_transfer_callback_t)(LPSPI_Type *base, - lpspi_master_edma_handle_t *handle, - status_t status, - void *userData); -/*! - * @brief Completion callback function pointer type. - * - * @param base LPSPI peripheral base address. - * @param handle Pointer to the handle for the LPSPI slave. - * @param status Success or error code describing whether the transfer completed. - * @param userData Arbitrary pointer-dataSized value passed from the application. - */ -typedef void (*lpspi_slave_edma_transfer_callback_t)(LPSPI_Type *base, - lpspi_slave_edma_handle_t *handle, - status_t status, - void *userData); - -/*! @brief LPSPI master eDMA transfer handle structure used for transactional API. */ -struct _lpspi_master_edma_handle -{ - volatile bool isPcsContinuous; /*!< Is PCS continuous in transfer. */ - - volatile bool isByteSwap; /*!< A flag that whether should byte swap. */ - - volatile uint8_t fifoSize; /*!< FIFO dataSize. */ - - volatile uint8_t rxWatermark; /*!< Rx watermark. */ - - volatile uint8_t bytesEachWrite; /*!< Bytes for each write TDR. */ - volatile uint8_t bytesEachRead; /*!< Bytes for each read RDR. */ - - volatile uint8_t bytesLastRead; /*!< Bytes for last read RDR. */ - volatile bool isThereExtraRxBytes; /*!< Is there extra RX byte. */ - - const uint8_t *volatile txData; /*!< Send buffer. */ - uint8_t *volatile rxData; /*!< Receive buffer. */ - volatile size_t txRemainingByteCount; /*!< Number of bytes remaining to send.*/ - volatile size_t rxRemainingByteCount; /*!< Number of bytes remaining to receive.*/ - - volatile uint32_t writeRegRemainingTimes; /*!< Write TDR register remaining times. */ - volatile uint32_t readRegRemainingTimes; /*!< Read RDR register remaining times. */ - - uint32_t totalByteCount; /*!< Number of transfer bytes*/ - - uint32_t txBuffIfNull; /*!< Used if there is not txData for DMA purpose.*/ - uint32_t rxBuffIfNull; /*!< Used if there is not rxData for DMA purpose.*/ - - uint32_t transmitCommand; /*!< Used to write TCR for DMA purpose.*/ - - volatile uint8_t state; /*!< LPSPI transfer state , _lpspi_transfer_state.*/ - - uint8_t nbytes; /*!< eDMA minor byte transfer count initially configured. */ - - lpspi_master_edma_transfer_callback_t callback; /*!< Completion callback. */ - void *userData; /*!< Callback user data. */ - - edma_handle_t *edmaRxRegToRxDataHandle; /*!async_status = status; - (void)xSemaphoreGiveFromISR(handle->event, &reschedule); - portYIELD_FROM_ISR(reschedule); -} - -/*! - * brief Initializes LPSPI. - * - * This function initializes the LPSPI module and related RTOS context. - * - * param handle The RTOS LPSPI handle, the pointer to an allocated space for RTOS context. - * param base The pointer base address of the LPSPI instance to initialize. - * param masterConfig Configuration structure to set-up LPSPI in master mode. - * param srcClock_Hz Frequency of input clock of the LPSPI module. - * return status of the operation. - */ -status_t LPSPI_RTOS_Init(lpspi_rtos_handle_t *handle, - LPSPI_Type *base, - const lpspi_master_config_t *masterConfig, - uint32_t srcClock_Hz) -{ - if (handle == NULL) - { - return kStatus_InvalidArgument; - } - - if (base == NULL) - { - return kStatus_InvalidArgument; - } - - (void)memset(handle, 0, sizeof(lpspi_rtos_handle_t)); - - handle->mutex = xSemaphoreCreateMutex(); - if (handle->mutex == NULL) - { - return kStatus_Fail; - } - - handle->event = xSemaphoreCreateBinary(); - if (handle->event == NULL) - { - vSemaphoreDelete(handle->mutex); - return kStatus_Fail; - } - - handle->base = base; - - (void)LPSPI_MasterInit(handle->base, masterConfig, srcClock_Hz); - LPSPI_MasterTransferCreateHandle(handle->base, &handle->drv_handle, LPSPI_RTOS_Callback, (void *)handle); - - return kStatus_Success; -} - -/*! - * brief Deinitializes the LPSPI. - * - * This function deinitializes the LPSPI module and related RTOS context. - * - * param handle The RTOS LPSPI handle. - */ -status_t LPSPI_RTOS_Deinit(lpspi_rtos_handle_t *handle) -{ - LPSPI_Deinit(handle->base); - vSemaphoreDelete(handle->event); - vSemaphoreDelete(handle->mutex); - - return kStatus_Success; -} - -/*! - * brief Performs LPSPI transfer. - * - * This function performs an LPSPI transfer according to data given in the transfer structure. - * - * param handle The RTOS LPSPI handle. - * param transfer Structure specifying the transfer parameters. - * return status of the operation. - */ -status_t LPSPI_RTOS_Transfer(lpspi_rtos_handle_t *handle, lpspi_transfer_t *transfer) -{ - status_t status; - - /* Lock resource mutex */ - if (xSemaphoreTake(handle->mutex, portMAX_DELAY) != pdTRUE) - { - return kStatus_LPSPI_Busy; - } - - /* Initiate transfer */ - status = LPSPI_MasterTransferNonBlocking(handle->base, &handle->drv_handle, transfer); - if (status != kStatus_Success) - { - (void)xSemaphoreGive(handle->mutex); - return status; - } - - /* Wait for transfer to finish */ - if (xSemaphoreTake(handle->event, portMAX_DELAY) != pdTRUE) - { - return kStatus_LPSPI_Error; - } - - /* Retrieve status before releasing mutex */ - status = handle->async_status; - - /* Unlock resource mutex */ - (void)xSemaphoreGive(handle->mutex); - - /* Translate status of underlying driver */ - if (status == kStatus_LPSPI_Idle) - { - status = kStatus_Success; - } - - return status; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpspi_freertos.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpspi_freertos.h deleted file mode 100644 index f9e91108bff..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpspi_freertos.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef __FSL_LPSPI_FREERTOS_H__ -#define __FSL_LPSPI_FREERTOS_H__ - -#include "FreeRTOS.h" -#include "portable.h" -#include "semphr.h" -#include "fsl_lpspi.h" - -/*! - * @addtogroup lpspi_freertos_driver - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief LPSPI FreeRTOS driver version 2.0.0. */ -#define FSL_LPSPI_FREERTOS_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) -/*@}*/ - -/*! @brief LPSPI FreeRTOS handle */ -typedef struct _lpspi_rtos_handle -{ - LPSPI_Type *base; /*!< LPSPI base address */ - lpspi_master_handle_t drv_handle; /*!< Handle of the underlying driver, treated as opaque by the RTOS layer */ - status_t async_status; - SemaphoreHandle_t mutex; /*!< Mutex to lock the handle during a trasfer */ - SemaphoreHandle_t event; /*!< Semaphore to notify and unblock task when transfer ends */ -} lpspi_rtos_handle_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name LPSPI RTOS Operation - * @{ - */ - -/*! - * @brief Initializes LPSPI. - * - * This function initializes the LPSPI module and related RTOS context. - * - * @param handle The RTOS LPSPI handle, the pointer to an allocated space for RTOS context. - * @param base The pointer base address of the LPSPI instance to initialize. - * @param masterConfig Configuration structure to set-up LPSPI in master mode. - * @param srcClock_Hz Frequency of input clock of the LPSPI module. - * @return status of the operation. - */ -status_t LPSPI_RTOS_Init(lpspi_rtos_handle_t *handle, - LPSPI_Type *base, - const lpspi_master_config_t *masterConfig, - uint32_t srcClock_Hz); - -/*! - * @brief Deinitializes the LPSPI. - * - * This function deinitializes the LPSPI module and related RTOS context. - * - * @param handle The RTOS LPSPI handle. - */ -status_t LPSPI_RTOS_Deinit(lpspi_rtos_handle_t *handle); - -/*! - * @brief Performs LPSPI transfer. - * - * This function performs an LPSPI transfer according to data given in the transfer structure. - * - * @param handle The RTOS LPSPI handle. - * @param transfer Structure specifying the transfer parameters. - * @return status of the operation. - */ -status_t LPSPI_RTOS_Transfer(lpspi_rtos_handle_t *handle, lpspi_transfer_t *transfer); - -/*! - * @} - */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ - -#endif /* __FSL_LPSPI_FREERTOS_H__ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lptmr.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lptmr.c deleted file mode 100644 index 9e501e7a51b..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lptmr.c +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2017 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lptmr.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lptmr" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#if defined(LPTMR_CLOCKS) -/*! - * @brief Gets the instance from the base address to be used to gate or ungate the module clock - * - * @param base LPTMR peripheral base address - * - * @return The LPTMR instance - */ -static uint32_t LPTMR_GetInstance(LPTMR_Type *base); -#endif /* LPTMR_CLOCKS */ - -/******************************************************************************* - * Variables - ******************************************************************************/ -#if defined(LPTMR_CLOCKS) -/*! @brief Pointers to LPTMR bases for each instance. */ -static LPTMR_Type *const s_lptmrBases[] = LPTMR_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to LPTMR clocks for each instance. */ -static const clock_ip_name_t s_lptmrClocks[] = LPTMR_CLOCKS; - -#if defined(LPTMR_PERIPH_CLOCKS) -/* Array of LPTMR functional clock name. */ -static const clock_ip_name_t s_lptmrPeriphClocks[] = LPTMR_PERIPH_CLOCKS; -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* LPTMR_CLOCKS */ - -/******************************************************************************* - * Code - ******************************************************************************/ -#if defined(LPTMR_CLOCKS) -static uint32_t LPTMR_GetInstance(LPTMR_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_lptmrBases); instance++) - { - if (s_lptmrBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_lptmrBases)); - - return instance; -} -#endif /* LPTMR_CLOCKS */ - -/*! - * brief Ungates the LPTMR clock and configures the peripheral for a basic operation. - * - * note This API should be called at the beginning of the application using the LPTMR driver. - * - * param base LPTMR peripheral base address - * param config A pointer to the LPTMR configuration structure. - */ -void LPTMR_Init(LPTMR_Type *base, const lptmr_config_t *config) -{ - assert(NULL != config); - -#if defined(LPTMR_CLOCKS) -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - - uint32_t instance = LPTMR_GetInstance(base); - - /* Ungate the LPTMR clock*/ - CLOCK_EnableClock(s_lptmrClocks[instance]); -#if defined(LPTMR_PERIPH_CLOCKS) - CLOCK_EnableClock(s_lptmrPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* LPTMR_CLOCKS */ - - /* Configure the timers operation mode and input pin setup */ - base->CSR = (LPTMR_CSR_TMS(config->timerMode) | LPTMR_CSR_TFC(config->enableFreeRunning) | - LPTMR_CSR_TPP(config->pinPolarity) | LPTMR_CSR_TPS(config->pinSelect)); - - /* Configure the prescale value and clock source */ - base->PSR = (LPTMR_PSR_PRESCALE(config->value) | LPTMR_PSR_PBYP(config->bypassPrescaler) | - LPTMR_PSR_PCS(config->prescalerClockSource)); -} - -/*! - * brief Gates the LPTMR clock. - * - * param base LPTMR peripheral base address - */ -void LPTMR_Deinit(LPTMR_Type *base) -{ - /* Disable the LPTMR and reset the internal logic */ - base->CSR &= ~LPTMR_CSR_TEN_MASK; - -#if defined(LPTMR_CLOCKS) -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - - uint32_t instance = LPTMR_GetInstance(base); - - /* Gate the LPTMR clock*/ - CLOCK_DisableClock(s_lptmrClocks[instance]); -#if defined(LPTMR_PERIPH_CLOCKS) - CLOCK_DisableClock(s_lptmrPeriphClocks[instance]); -#endif - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* LPTMR_CLOCKS */ -} - -/*! - * brief Fills in the LPTMR configuration structure with default settings. - * - * The default values are as follows. - * code - * config->timerMode = kLPTMR_TimerModeTimeCounter; - * config->pinSelect = kLPTMR_PinSelectInput_0; - * config->pinPolarity = kLPTMR_PinPolarityActiveHigh; - * config->enableFreeRunning = false; - * config->bypassPrescaler = true; - * config->prescalerClockSource = kLPTMR_PrescalerClock_1; - * config->value = kLPTMR_Prescale_Glitch_0; - * endcode - * param config A pointer to the LPTMR configuration structure. - */ -void LPTMR_GetDefaultConfig(lptmr_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - /* Use time counter mode */ - config->timerMode = kLPTMR_TimerModeTimeCounter; - /* Use input 0 as source in pulse counter mode */ - config->pinSelect = kLPTMR_PinSelectInput_0; - /* Pulse input pin polarity is active-high */ - config->pinPolarity = kLPTMR_PinPolarityActiveHigh; - /* Counter resets whenever TCF flag is set */ - config->enableFreeRunning = false; - /* Bypass the prescaler */ - config->bypassPrescaler = true; - /* LPTMR clock source */ -#if !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT) - config->prescalerClockSource = kLPTMR_PrescalerClock_1; -#elif !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_0_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_0_SUPPORT) - config->prescalerClockSource = kLPTMR_PrescalerClock_0; -#elif !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_2_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_2_SUPPORT) - config->prescalerClockSource = kLPTMR_PrescalerClock_2; -#elif !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_3_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_3_SUPPORT) - config->prescalerClockSource = kLPTMR_PrescalerClock_3; -#else -#error No valid source -#endif - - /* Divide the prescaler clock by 2 */ - config->value = kLPTMR_Prescale_Glitch_0; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lptmr.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lptmr.h deleted file mode 100644 index b8e473120c5..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lptmr.h +++ /dev/null @@ -1,384 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2017, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LPTMR_H_ -#define FSL_LPTMR_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup lptmr - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! Driver Version */ -#define FSL_LPTMR_DRIVER_VERSION (MAKE_VERSION(2, 2, 0)) -/*! @} */ - -/*! @brief LPTMR pin selection used in pulse counter mode.*/ -typedef enum _lptmr_pin_select -{ - kLPTMR_PinSelectInput_0 = 0x0U, /*!< Pulse counter input 0 is selected */ - kLPTMR_PinSelectInput_1 = 0x1U, /*!< Pulse counter input 1 is selected */ - kLPTMR_PinSelectInput_2 = 0x2U, /*!< Pulse counter input 2 is selected */ - kLPTMR_PinSelectInput_3 = 0x3U /*!< Pulse counter input 3 is selected */ -} lptmr_pin_select_t; - -/*! @brief LPTMR pin polarity used in pulse counter mode.*/ -typedef enum _lptmr_pin_polarity -{ - kLPTMR_PinPolarityActiveHigh = 0x0U, /*!< Pulse Counter input source is active-high */ - kLPTMR_PinPolarityActiveLow = 0x1U /*!< Pulse Counter input source is active-low */ -} lptmr_pin_polarity_t; - -/*! @brief LPTMR timer mode selection.*/ -typedef enum _lptmr_timer_mode -{ - kLPTMR_TimerModeTimeCounter = 0x0U, /*!< Time Counter mode */ - kLPTMR_TimerModePulseCounter = 0x1U /*!< Pulse Counter mode */ -} lptmr_timer_mode_t; - -/*! @brief LPTMR prescaler/glitch filter values*/ -typedef enum _lptmr_prescaler_glitch_value -{ - kLPTMR_Prescale_Glitch_0 = 0x0U, /*!< Prescaler divide 2, glitch filter does not support this setting */ - kLPTMR_Prescale_Glitch_1 = 0x1U, /*!< Prescaler divide 4, glitch filter 2 */ - kLPTMR_Prescale_Glitch_2 = 0x2U, /*!< Prescaler divide 8, glitch filter 4 */ - kLPTMR_Prescale_Glitch_3 = 0x3U, /*!< Prescaler divide 16, glitch filter 8 */ - kLPTMR_Prescale_Glitch_4 = 0x4U, /*!< Prescaler divide 32, glitch filter 16 */ - kLPTMR_Prescale_Glitch_5 = 0x5U, /*!< Prescaler divide 64, glitch filter 32 */ - kLPTMR_Prescale_Glitch_6 = 0x6U, /*!< Prescaler divide 128, glitch filter 64 */ - kLPTMR_Prescale_Glitch_7 = 0x7U, /*!< Prescaler divide 256, glitch filter 128 */ - kLPTMR_Prescale_Glitch_8 = 0x8U, /*!< Prescaler divide 512, glitch filter 256 */ - kLPTMR_Prescale_Glitch_9 = 0x9U, /*!< Prescaler divide 1024, glitch filter 512*/ - kLPTMR_Prescale_Glitch_10 = 0xAU, /*!< Prescaler divide 2048 glitch filter 1024 */ - kLPTMR_Prescale_Glitch_11 = 0xBU, /*!< Prescaler divide 4096, glitch filter 2048 */ - kLPTMR_Prescale_Glitch_12 = 0xCU, /*!< Prescaler divide 8192, glitch filter 4096 */ - kLPTMR_Prescale_Glitch_13 = 0xDU, /*!< Prescaler divide 16384, glitch filter 8192 */ - kLPTMR_Prescale_Glitch_14 = 0xEU, /*!< Prescaler divide 32768, glitch filter 16384 */ - kLPTMR_Prescale_Glitch_15 = 0xFU /*!< Prescaler divide 65536, glitch filter 32768 */ -} lptmr_prescaler_glitch_value_t; - -/*! - * @brief LPTMR prescaler/glitch filter clock select. - * @note Clock connections are SoC-specific - */ -typedef enum _lptmr_prescaler_clock_select -{ -#if !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_0_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_0_SUPPORT) - kLPTMR_PrescalerClock_0 = 0x0U, /*!< Prescaler/glitch filter clock 0 selected. */ -#endif - -#if !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT) - kLPTMR_PrescalerClock_1 = 0x1U, /*!< Prescaler/glitch filter clock 1 selected. */ -#endif /* FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_1_SUPPORT */ - -#if !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_2_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_2_SUPPORT) - kLPTMR_PrescalerClock_2 = 0x2U, /*!< Prescaler/glitch filter clock 2 selected. */ -#endif - -#if !(defined(FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_3_SUPPORT) && \ - FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_3_SUPPORT) - kLPTMR_PrescalerClock_3 = 0x3U, /*!< Prescaler/glitch filter clock 3 selected. */ -#endif /* FSL_FEATURE_LPTMR_HAS_NO_PRESCALER_CLOCK_SOURCE_3_SUPPORT */ -} lptmr_prescaler_clock_select_t; - -/*! @brief List of the LPTMR interrupts */ -typedef enum _lptmr_interrupt_enable -{ - kLPTMR_TimerInterruptEnable = LPTMR_CSR_TIE_MASK, /*!< Timer interrupt enable */ -} lptmr_interrupt_enable_t; - -/*! @brief List of the LPTMR status flags */ -typedef enum _lptmr_status_flags -{ - kLPTMR_TimerCompareFlag = LPTMR_CSR_TCF_MASK, /*!< Timer compare flag */ -} lptmr_status_flags_t; - -/*! - * @brief LPTMR config structure - * - * This structure holds the configuration settings for the LPTMR peripheral. To initialize this - * structure to reasonable defaults, call the LPTMR_GetDefaultConfig() function and pass a - * pointer to your configuration structure instance. - * - * The configuration struct can be made constant so it resides in flash. - */ -typedef struct _lptmr_config -{ - lptmr_timer_mode_t timerMode; /*!< Time counter mode or pulse counter mode */ - lptmr_pin_select_t pinSelect; /*!< LPTMR pulse input pin select; used only in pulse counter mode */ - lptmr_pin_polarity_t pinPolarity; /*!< LPTMR pulse input pin polarity; used only in pulse counter mode */ - bool enableFreeRunning; /*!< True: enable free running, counter is reset on overflow - False: counter is reset when the compare flag is set */ - bool bypassPrescaler; /*!< True: bypass prescaler; false: use clock from prescaler */ - lptmr_prescaler_clock_select_t prescalerClockSource; /*!< LPTMR clock source */ - lptmr_prescaler_glitch_value_t value; /*!< Prescaler or glitch filter value */ -} lptmr_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Ungates the LPTMR clock and configures the peripheral for a basic operation. - * - * @note This API should be called at the beginning of the application using the LPTMR driver. - * - * @param base LPTMR peripheral base address - * @param config A pointer to the LPTMR configuration structure. - */ -void LPTMR_Init(LPTMR_Type *base, const lptmr_config_t *config); - -/*! - * @brief Gates the LPTMR clock. - * - * @param base LPTMR peripheral base address - */ -void LPTMR_Deinit(LPTMR_Type *base); - -/*! - * @brief Fills in the LPTMR configuration structure with default settings. - * - * The default values are as follows. - * @code - * config->timerMode = kLPTMR_TimerModeTimeCounter; - * config->pinSelect = kLPTMR_PinSelectInput_0; - * config->pinPolarity = kLPTMR_PinPolarityActiveHigh; - * config->enableFreeRunning = false; - * config->bypassPrescaler = true; - * config->prescalerClockSource = kLPTMR_PrescalerClock_1; - * config->value = kLPTMR_Prescale_Glitch_0; - * @endcode - * @param config A pointer to the LPTMR configuration structure. - */ -void LPTMR_GetDefaultConfig(lptmr_config_t *config); - -/*! @}*/ - -/*! - * @name Interrupt Interface - * @{ - */ - -/*! - * @brief Enables the selected LPTMR interrupts. - * - * @param base LPTMR peripheral base address - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::lptmr_interrupt_enable_t - */ -static inline void LPTMR_EnableInterrupts(LPTMR_Type *base, uint32_t mask) -{ - uint32_t reg = base->CSR; - - /* Clear the TCF bit so that we don't clear this w1c bit when writing back */ - reg &= ~(LPTMR_CSR_TCF_MASK); - reg |= mask; - base->CSR = reg; -} - -/*! - * @brief Disables the selected LPTMR interrupts. - * - * @param base LPTMR peripheral base address - * @param mask The interrupts to disable. This is a logical OR of members of the - * enumeration ::lptmr_interrupt_enable_t. - */ -static inline void LPTMR_DisableInterrupts(LPTMR_Type *base, uint32_t mask) -{ - uint32_t reg = base->CSR; - - /* Clear the TCF bit so that we don't clear this w1c bit when writing back */ - reg &= ~(LPTMR_CSR_TCF_MASK); - reg &= ~mask; - base->CSR = reg; -} - -/*! - * @brief Gets the enabled LPTMR interrupts. - * - * @param base LPTMR peripheral base address - * - * @return The enabled interrupts. This is the logical OR of members of the - * enumeration ::lptmr_interrupt_enable_t - */ -static inline uint32_t LPTMR_GetEnabledInterrupts(LPTMR_Type *base) -{ - return (base->CSR & LPTMR_CSR_TIE_MASK); -} - -/*! @}*/ - -#if defined(FSL_FEATURE_LPTMR_HAS_CSR_TDRE) && (FSL_FEATURE_LPTMR_HAS_CSR_TDRE) -/*! - * @brief Enable or disable timer DMA request - * - * @param base base LPTMR peripheral base address - * @param enable Switcher of timer DMA feature. "true" means to enable, "false" means to disable. - */ -static inline void LPTMR_EnableTimerDMA(LPTMR_Type *base, bool enable) -{ - if (enable) - { - base->CSR |= LPTMR_CSR_TDRE_MASK; - } - else - { - base->CSR &= ~(LPTMR_CSR_TDRE_MASK); - } -} -#endif /* FSL_FEATURE_LPTMR_HAS_CSR_TDRE */ - -/*! - * @name Status Interface - * @{ - */ - -/*! - * @brief Gets the LPTMR status flags. - * - * @param base LPTMR peripheral base address - * - * @return The status flags. This is the logical OR of members of the - * enumeration ::lptmr_status_flags_t - */ -static inline uint32_t LPTMR_GetStatusFlags(LPTMR_Type *base) -{ - return (base->CSR & LPTMR_CSR_TCF_MASK); -} - -/*! - * @brief Clears the LPTMR status flags. - * - * @param base LPTMR peripheral base address - * @param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::lptmr_status_flags_t. - */ -static inline void LPTMR_ClearStatusFlags(LPTMR_Type *base, uint32_t mask) -{ - base->CSR |= mask; -} - -/*! @}*/ - -/*! - * @name Read and write the timer period - * @{ - */ - -/*! - * @brief Sets the timer period in units of count. - * - * Timers counts from 0 until it equals the count value set here. The count value is written to - * the CMR register. - * - * @note - * 1. The TCF flag is set with the CNR equals the count provided here and then increments. - * 2. Call the utility macros provided in the fsl_common.h to convert to ticks. - * - * @param base LPTMR peripheral base address - * @param ticks A timer period in units of ticks, which should be equal or greater than 1. - */ -static inline void LPTMR_SetTimerPeriod(LPTMR_Type *base, uint32_t ticks) -{ - assert(ticks > 0U); - base->CMR = LPTMR_CMR_COMPARE(ticks - 1U); -} - -/*! - * @brief Reads the current timer counting value. - * - * This function returns the real-time timer counting value in a range from 0 to a - * timer period. - * - * @note Call the utility macros provided in the fsl_common.h to convert ticks to usec or msec. - * - * @param base LPTMR peripheral base address - * - * @return The current counter value in ticks - */ -static inline uint32_t LPTMR_GetCurrentTimerCount(LPTMR_Type *base) -{ - /* Must first write any value to the CNR. This synchronizes and registers the current value - * of the CNR into a temporary register which can then be read - */ - base->CNR = 0U; - return (uint32_t)((base->CNR & LPTMR_CNR_COUNTER_MASK) >> LPTMR_CNR_COUNTER_SHIFT); -} - -/*! @}*/ - -/*! - * @name Timer Start and Stop - * @{ - */ - -/*! - * @brief Starts the timer. - * - * After calling this function, the timer counts up to the CMR register value. - * Each time the timer reaches the CMR value and then increments, it generates a - * trigger pulse and sets the timeout interrupt flag. An interrupt is also - * triggered if the timer interrupt is enabled. - * - * @param base LPTMR peripheral base address - */ -static inline void LPTMR_StartTimer(LPTMR_Type *base) -{ - uint32_t reg = base->CSR; - - /* Clear the TCF bit to avoid clearing the w1c bit when writing back. */ - reg &= ~(LPTMR_CSR_TCF_MASK); - reg |= LPTMR_CSR_TEN_MASK; - base->CSR = reg; -} - -/*! - * @brief Stops the timer. - * - * This function stops the timer and resets the timer's counter register. - * - * @param base LPTMR peripheral base address - */ -static inline void LPTMR_StopTimer(LPTMR_Type *base) -{ - uint32_t reg = base->CSR; - - /* Clear the TCF bit to avoid clearing the w1c bit when writing back. */ - reg &= ~(LPTMR_CSR_TCF_MASK); - reg &= ~LPTMR_CSR_TEN_MASK; - base->CSR = reg; -} - -/*! @}*/ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_LPTMR_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpuart.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpuart.c deleted file mode 100644 index 9c81efa55ce..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpuart.c +++ /dev/null @@ -1,2180 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpuart.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpflexcomm_lpuart" -#endif - -/*! - * @brief Used for conversion from `lpflexcomm_irq_handler_t` to `lpuart_irq_handler_t` - */ -typedef union lpuart_to_lpflexcomm -{ - lpuart_irq_handler_t lpuart_handler; - lpflexcomm_irq_handler_t lpflexcomm_handler; -} lpuart_to_lpflexcomm_t; - -/* LPUART transfer state. */ -enum -{ - kLPUART_TxIdle, /*!< TX idle. */ - kLPUART_TxBusy, /*!< TX busy. */ - kLPUART_RxIdle, /*!< RX idle. */ - kLPUART_RxBusy /*!< RX busy. */ -}; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Check whether the RX ring buffer is full. - * - * @userData handle LPUART handle pointer. - * @retval true RX ring buffer is full. - * @retval false RX ring buffer is not full. - */ -static bool LPUART_TransferIsRxRingBufferFull(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief Write to TX register using non-blocking method. - * - * This function writes data to the TX register directly, upper layer must make - * sure the TX register is empty or TX FIFO has empty room before calling this function. - * - * @note This function does not check whether all the data has been sent out to bus, - * so before disable TX, check kLPUART_TransmissionCompleteFlag to ensure the TX is - * finished. - * - * @param base LPUART peripheral base address. - * @param data Start address of the data to write. - * @param length Size of the buffer to be sent. - */ -static void LPUART_WriteNonBlocking(LPUART_Type *base, const uint8_t *data, size_t length); - -/*! - * @brief Write to TX register using non-blocking method in 9bit or 10bit mode. - * - * @note This function only support 9bit or 10bit transfer. - * - * @param base LPUART peripheral base address. - * @param data Start address of the data to write. - * @param length Size of the buffer to be sent. - */ -static void LPUART_WriteNonBlocking16bit(LPUART_Type *base, const uint16_t *data, size_t length); - -/*! - * @brief Read RX register using non-blocking method. - * - * This function reads data from the TX register directly, upper layer must make - * sure the RX register is full or TX FIFO has data before calling this function. - * - * @param base LPUART peripheral base address. - * @param data Start address of the buffer to store the received data. - * @param length Size of the buffer. - */ -static void LPUART_ReadNonBlocking(LPUART_Type *base, uint8_t *data, size_t length); - -/*! - * @brief Read RX register using non-blocking method in 9bit or 10bit mode. - * - * @note This function only support 9bit or 10bit transfer. - * - * @param base LPUART peripheral base address. - * @param data Start address of the buffer to store the received data. - * @param length Size of the buffer. - */ -static void LPUART_ReadNonBlocking16bit(LPUART_Type *base, uint16_t *data, size_t length); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/* Array of LPUART peripheral base address. */ -static LPUART_Type *const s_lpuartBases[] = LPUART_BASE_PTRS; - -/* Array of LPUART IRQ number. */ -const IRQn_Type s_lpuartIRQ[] = LPUART_RX_TX_IRQS; - -/******************************************************************************* - * Code - ******************************************************************************/ -/*! - * brief Get the LPUART instance from peripheral base address. - * - * param base LPUART peripheral base address. - * return LPUART instance. - */ -uint32_t LPUART_GetInstance(LPUART_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0U; instance < ARRAY_SIZE(s_lpuartBases); instance++) - { - if (s_lpuartBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_lpuartBases)); - - return instance; -} - -/*! - * brief Get the length of received data in RX ring buffer. - * - * userData handle LPUART handle pointer. - * return Length of received data in RX ring buffer. - */ -size_t LPUART_TransferGetRxRingBufferLength(LPUART_Type *base, lpuart_handle_t *handle) -{ - assert(NULL != handle); - - size_t size; - size_t tmpRxRingBufferSize = handle->rxRingBufferSize; - uint16_t tmpRxRingBufferTail = handle->rxRingBufferTail; - uint16_t tmpRxRingBufferHead = handle->rxRingBufferHead; - - if (tmpRxRingBufferTail > tmpRxRingBufferHead) - { - size = ((size_t)tmpRxRingBufferHead + tmpRxRingBufferSize - (size_t)tmpRxRingBufferTail); - } - else - { - size = ((size_t)tmpRxRingBufferHead - (size_t)tmpRxRingBufferTail); - } - - return size; -} - -static bool LPUART_TransferIsRxRingBufferFull(LPUART_Type *base, lpuart_handle_t *handle) -{ - assert(NULL != handle); - - bool full; - - if (LPUART_TransferGetRxRingBufferLength(base, handle) == (handle->rxRingBufferSize - 1U)) - { - full = true; - } - else - { - full = false; - } - return full; -} - -static void LPUART_WriteNonBlocking(LPUART_Type *base, const uint8_t *data, size_t length) -{ - assert(NULL != data); - - size_t i; - - /* The Non Blocking write data API assume user have ensured there is enough space in - peripheral to write. */ - for (i = 0; i < length; i++) - { - base->DATA = data[i]; - } -} - -static void LPUART_WriteNonBlocking16bit(LPUART_Type *base, const uint16_t *data, size_t length) -{ - assert(NULL != data); - - size_t i; - - /* The Non Blocking write data API assume user have ensured there is enough space in - peripheral to write. */ - for (i = 0; i < length; i++) - { - base->DATA = data[i]; - } -} - -static void LPUART_ReadNonBlocking(LPUART_Type *base, uint8_t *data, size_t length) -{ - assert(NULL != data); - - size_t i; -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - uint32_t ctrl = base->CTRL; - bool isSevenDataBits = (((ctrl & LPUART_CTRL_M7_MASK) != 0U) || - (((ctrl & LPUART_CTRL_M_MASK) == 0U) && ((ctrl & LPUART_CTRL_PE_MASK) != 0U))); -#endif - - /* The Non Blocking read data API assume user have ensured there is enough space in - peripheral to write. */ - for (i = 0; i < length; i++) - { -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - if (isSevenDataBits) - { - data[i] = (uint8_t)(base->DATA & 0x7FU); - } - else - { - data[i] = (uint8_t)base->DATA; - } -#else - data[i] = (uint8_t)(base->DATA); -#endif - } -} - -static void LPUART_ReadNonBlocking16bit(LPUART_Type *base, uint16_t *data, size_t length) -{ - assert(NULL != data); - - size_t i; - /* The Non Blocking read data API assume user have ensured there is enough space in - peripheral to write. */ - for (i = 0; i < length; i++) - { - data[i] = (uint16_t)(base->DATA & 0x03FFU); - } -} -/*! - * brief Initializes an LPUART instance with the user configuration structure and the peripheral clock. - * - * This function configures the LPUART module with user-defined settings. Call the LPUART_GetDefaultConfig() function - * to configure the configuration structure and get the default configuration. - * The example below shows how to use this API to configure the LPUART. - * code - * lpuart_config_t lpuartConfig; - * lpuartConfig.baudRate_Bps = 115200U; - * lpuartConfig.parityMode = kLPUART_ParityDisabled; - * lpuartConfig.dataBitsCount = kLPUART_EightDataBits; - * lpuartConfig.isMsb = false; - * lpuartConfig.stopBitCount = kLPUART_OneStopBit; - * lpuartConfig.txFifoWatermark = 0; - * lpuartConfig.rxFifoWatermark = 1; - * LPUART_Init(LPUART1, &lpuartConfig, 20000000U); - * endcode - * - * param base LPUART peripheral base address. - * param config Pointer to a user-defined configuration structure. - * param srcClock_Hz LPUART clock source frequency in HZ. - * retval kStatus_LPUART_BaudrateNotSupport Baudrate is not support in current clock source. - * retval kStatus_Success LPUART initialize succeed - */ -status_t LPUART_Init(LPUART_Type *base, const lpuart_config_t *config, uint32_t srcClock_Hz) -{ - assert(NULL != config); - assert(0U < config->baudRate_Bps); -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - assert((uint8_t)FSL_FEATURE_LPUART_FIFO_SIZEn(base) > config->txFifoWatermark); - assert((uint8_t)FSL_FEATURE_LPUART_FIFO_SIZEn(base) > config->rxFifoWatermark); -#endif - - status_t status = kStatus_Success; - uint32_t temp; - uint16_t sbr, sbrTemp; - uint8_t osr, osrTemp; - uint32_t tempDiff, calculatedBaud, baudDiff; - - /* This LPUART instantiation uses a slightly different baud rate calculation - * The idea is to use the best OSR (over-sampling rate) possible - * Note, OSR is typically hard-set to 16 in other LPUART instantiations - * loop to find the best OSR value possible, one that generates minimum baudDiff - * iterate through the rest of the supported values of OSR */ - - baudDiff = config->baudRate_Bps; - osr = 0U; - sbr = 0U; - for (osrTemp = 4U; osrTemp <= 32U; osrTemp++) - { - /* calculate the temporary sbr value */ - sbrTemp = (uint16_t)((srcClock_Hz * 2U / (config->baudRate_Bps * (uint32_t)osrTemp) + 1U) / 2U); - /*set sbrTemp to 1 if the sourceClockInHz can not satisfy the desired baud rate*/ - if (sbrTemp == 0U) - { - sbrTemp = 1U; - } - else if (sbrTemp > LPUART_BAUD_SBR_MASK) - { - sbrTemp = LPUART_BAUD_SBR_MASK; - } - else - { - /* For MISRA 15.7 */ - } - /* Calculate the baud rate based on the temporary OSR and SBR values */ - calculatedBaud = (srcClock_Hz / ((uint32_t)osrTemp * (uint32_t)sbrTemp)); - tempDiff = calculatedBaud > config->baudRate_Bps ? (calculatedBaud - config->baudRate_Bps) : - (config->baudRate_Bps - calculatedBaud); - - if (tempDiff <= baudDiff) - { - baudDiff = tempDiff; - osr = osrTemp; /* update and store the best OSR value calculated */ - sbr = sbrTemp; /* update store the best SBR value calculated */ - } - } - - /* Check to see if actual baud rate is within 3% of desired baud rate - * based on the best calculate OSR value */ - if (baudDiff > ((config->baudRate_Bps / 100U) * 3U)) - { - /* Unacceptable baud rate difference of more than 3%*/ - status = kStatus_LPUART_BaudrateNotSupport; - } - else - { -#if !(defined(LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) && LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) - /* initialize flexcomm to LPUART mode */ - status = LP_FLEXCOMM_Init(LPUART_GetInstance(base), LP_FLEXCOMM_PERIPH_LPUART); - if (kStatus_Success != status) - { - return status; - } -#endif /* LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER */ - -#if defined(FSL_FEATURE_LPUART_HAS_GLOBAL) && FSL_FEATURE_LPUART_HAS_GLOBAL - /*Reset all internal logic and registers, except the Global Register */ - LPUART_SoftwareReset(base); -#else - /* Disable LPUART TX RX before setting. */ - base->CTRL &= ~(LPUART_CTRL_TE_MASK | LPUART_CTRL_RE_MASK); -#endif - - temp = base->BAUD; - - /* Acceptable baud rate, check if OSR is between 4x and 7x oversampling. - * If so, then "BOTHEDGE" sampling must be turned on */ - if ((osr > 3U) && (osr < 8U)) - { - temp |= LPUART_BAUD_BOTHEDGE_MASK; - } - - /* program the osr value (bit value is one less than actual value) */ - temp &= ~LPUART_BAUD_OSR_MASK; - temp |= LPUART_BAUD_OSR((uint32_t)osr - 1UL); - - /* write the sbr value to the BAUD registers */ - temp &= ~LPUART_BAUD_SBR_MASK; - base->BAUD = temp | LPUART_BAUD_SBR(sbr); - - /* Set bit count and parity mode. */ - base->BAUD &= ~LPUART_BAUD_M10_MASK; - - temp = base->CTRL & ~(LPUART_CTRL_PE_MASK | LPUART_CTRL_PT_MASK | LPUART_CTRL_M_MASK | LPUART_CTRL_ILT_MASK | - LPUART_CTRL_IDLECFG_MASK); - - temp |= (uint8_t)config->parityMode | LPUART_CTRL_IDLECFG(config->rxIdleConfig) | - LPUART_CTRL_ILT(config->rxIdleType); - -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - if (kLPUART_SevenDataBits == config->dataBitsCount) - { - if (kLPUART_ParityDisabled != config->parityMode) - { - temp &= ~LPUART_CTRL_M7_MASK; /* Seven data bits and one parity bit */ - } - else - { - temp |= LPUART_CTRL_M7_MASK; - } - } - else -#endif - { - if (kLPUART_ParityDisabled != config->parityMode) - { - temp |= LPUART_CTRL_M_MASK; /* Eight data bits and one parity bit */ - } - } - - base->CTRL = temp; - -#if defined(FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT) && FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT - /* set stop bit per char */ - temp = base->BAUD & ~LPUART_BAUD_SBNS_MASK; - base->BAUD = temp | LPUART_BAUD_SBNS((uint8_t)config->stopBitCount); -#endif - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Set tx/rx WATER watermark - Note: - Take care of the RX FIFO, RX interrupt request only assert when received bytes - equal or more than RX water mark, there is potential issue if RX water - mark larger than 1. - For example, if RX FIFO water mark is 2, upper layer needs 5 bytes and - 5 bytes are received. the last byte will be saved in FIFO but not trigger - RX interrupt because the water mark is 2. - */ - base->WATER = (((uint32_t)(config->rxFifoWatermark) << 16U) | config->txFifoWatermark); - - /* Enable tx/rx FIFO */ - base->FIFO |= (LPUART_FIFO_TXFE_MASK | LPUART_FIFO_RXFE_MASK); - - /* Flush FIFO */ - base->FIFO |= (LPUART_FIFO_TXFLUSH_MASK | LPUART_FIFO_RXFLUSH_MASK); -#endif - - /* Clear all status flags */ - temp = (LPUART_STAT_RXEDGIF_MASK | LPUART_STAT_IDLE_MASK | LPUART_STAT_OR_MASK | LPUART_STAT_NF_MASK | - LPUART_STAT_FE_MASK | LPUART_STAT_PF_MASK); - -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - temp |= LPUART_STAT_LBKDIF_MASK; -#endif - -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - temp |= (LPUART_STAT_MA1F_MASK | LPUART_STAT_MA2F_MASK); -#endif - -#if defined(FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT) && FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT - /* Set the CTS configuration/TX CTS source. */ - base->MODIR |= LPUART_MODIR_TXCTSC(config->txCtsConfig) | LPUART_MODIR_TXCTSSRC(config->txCtsSource); - if (true == config->enableRxRTS) - { - /* Enable the receiver RTS(request-to-send) function. */ - base->MODIR |= LPUART_MODIR_RXRTSE_MASK; - } - if (true == config->enableTxCTS) - { - /* Enable the CTS(clear-to-send) function. */ - base->MODIR |= LPUART_MODIR_TXCTSE_MASK; - } -#endif - - /* Set data bits order. */ - if (true == config->isMsb) - { - temp |= LPUART_STAT_MSBF_MASK; - } - else - { - temp &= ~LPUART_STAT_MSBF_MASK; - } - - base->STAT |= temp; - - /* Enable TX/RX base on configure structure. */ - temp = base->CTRL; - if (true == config->enableTx) - { - temp |= LPUART_CTRL_TE_MASK; - } - - if (true == config->enableRx) - { - temp |= LPUART_CTRL_RE_MASK; - } - - base->CTRL = temp; -#if defined(FSL_FEATURE_LPUART_HAS_TIMEOUT) && FSL_FEATURE_LPUART_HAS_TIMEOUT - /* Timeout configuration. */ - base->REIR = (uint32_t)config->timeoutConfig.rxExtendedTimeoutValue; - base->TEIR = (uint32_t)config->timeoutConfig.txExtendedTimeoutValue; - base->TOCR |= (uint32_t)config->timeoutConfig.rxCounter0.enableCounter | - ((uint32_t)config->timeoutConfig.rxCounter1.enableCounter << 1U) | - ((uint32_t)config->timeoutConfig.txCounter0.enableCounter << 2U) | - ((uint32_t)config->timeoutConfig.txCounter1.enableCounter << 3U); - base->TIMEOUT[0] = ((uint32_t)config->timeoutConfig.rxCounter0.timeoutCondition << 30U) | - (uint32_t)config->timeoutConfig.rxCounter0.timeoutValue; - base->TIMEOUT[1] = ((uint32_t)config->timeoutConfig.rxCounter1.timeoutCondition << 30U) | - (uint32_t)config->timeoutConfig.rxCounter1.timeoutValue; - base->TIMEOUT[2] = ((uint32_t)config->timeoutConfig.txCounter0.timeoutCondition << 30U) | - (uint32_t)config->timeoutConfig.txCounter0.timeoutValue; - base->TIMEOUT[3] = ((uint32_t)config->timeoutConfig.txCounter1.timeoutCondition << 30U) | - (uint32_t)config->timeoutConfig.txCounter1.timeoutValue; -#endif - - /* Siglewire configuration. */ -#if defined(FSL_FEATURE_LPUART_HAS_HDCR) && FSL_FEATURE_LPUART_HAS_HDCR - base->HDCR = (uint32_t)config->rtsDelay << 8U; - if (config->enableSingleWire) - { - base->HDCR |= 0xFUL; - } -#endif - } - return status; -} -/*! - * brief Deinitializes a LPUART instance. - * - * This function waits for transmit to complete, disables TX and RX, and disables the LPUART clock. - * - * param base LPUART peripheral base address. - */ -void LPUART_Deinit(LPUART_Type *base) -{ - uint32_t temp; - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Wait tx FIFO send out*/ - while (0U != ((base->WATER & LPUART_WATER_TXCOUNT_MASK) >> LPUART_WATER_TXWATER_SHIFT)) - { - } -#endif - /* Wait last char shift out */ - while (0U == (base->STAT & LPUART_STAT_TC_MASK)) - { - } - - /* Clear all status flags */ - temp = (LPUART_STAT_RXEDGIF_MASK | LPUART_STAT_IDLE_MASK | LPUART_STAT_OR_MASK | LPUART_STAT_NF_MASK | - LPUART_STAT_FE_MASK | LPUART_STAT_PF_MASK); - -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - temp |= LPUART_STAT_LBKDIF_MASK; -#endif - -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - temp |= (LPUART_STAT_MA1F_MASK | LPUART_STAT_MA2F_MASK); -#endif - - base->STAT |= temp; - - /* Disable the module. */ - base->CTRL = 0U; - -#if !(defined(LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) && LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER) - LP_FLEXCOMM_Deinit(LPUART_GetInstance(base)); -#endif -} - -/*! - * brief Gets the default configuration structure. - * - * This function initializes the LPUART configuration structure to a default value. The default - * values are: - * lpuartConfig->baudRate_Bps = 115200U; - * lpuartConfig->parityMode = kLPUART_ParityDisabled; - * lpuartConfig->dataBitsCount = kLPUART_EightDataBits; - * lpuartConfig->isMsb = false; - * lpuartConfig->stopBitCount = kLPUART_OneStopBit; - * lpuartConfig->txFifoWatermark = 0; - * lpuartConfig->rxFifoWatermark = 1; - * lpuartConfig->rxIdleType = kLPUART_IdleTypeStartBit; - * lpuartConfig->rxIdleConfig = kLPUART_IdleCharacter1; - * lpuartConfig->enableTx = false; - * lpuartConfig->enableRx = false; - * - * param config Pointer to a configuration structure. - */ -void LPUART_GetDefaultConfig(lpuart_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->baudRate_Bps = 115200U; - config->parityMode = kLPUART_ParityDisabled; - config->dataBitsCount = kLPUART_EightDataBits; - config->isMsb = false; -#if defined(FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT) && FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT - config->stopBitCount = kLPUART_OneStopBit; -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - config->txFifoWatermark = 0U; - config->rxFifoWatermark = 0U; -#endif -#if defined(FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT) && FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT - config->enableRxRTS = false; - config->enableTxCTS = false; - config->txCtsConfig = kLPUART_CtsSampleAtStart; - config->txCtsSource = kLPUART_CtsSourcePin; -#endif - config->rxIdleType = kLPUART_IdleTypeStartBit; - config->rxIdleConfig = kLPUART_IdleCharacter1; - config->enableTx = false; - config->enableRx = false; -} - -/*! - * brief Sets the LPUART instance baudrate. - * - * This function configures the LPUART module baudrate. This function is used to update - * the LPUART module baudrate after the LPUART module is initialized by the LPUART_Init. - * code - * LPUART_SetBaudRate(LPUART1, 115200U, 20000000U); - * endcode - * - * param base LPUART peripheral base address. - * param baudRate_Bps LPUART baudrate to be set. - * param srcClock_Hz LPUART clock source frequency in HZ. - * retval kStatus_LPUART_BaudrateNotSupport Baudrate is not supported in the current clock source. - * retval kStatus_Success Set baudrate succeeded. - */ -status_t LPUART_SetBaudRate(LPUART_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz) -{ - assert(0U < baudRate_Bps); - - status_t status = kStatus_Success; - uint32_t temp, oldCtrl; - uint16_t sbr, sbrTemp; - uint8_t osr, osrTemp; - uint32_t tempDiff, calculatedBaud, baudDiff; - - /* This LPUART instantiation uses a slightly different baud rate calculation - * The idea is to use the best OSR (over-sampling rate) possible - * Note, OSR is typically hard-set to 16 in other LPUART instantiations - * loop to find the best OSR value possible, one that generates minimum baudDiff - * iterate through the rest of the supported values of OSR */ - - baudDiff = baudRate_Bps; - osr = 0U; - sbr = 0U; - for (osrTemp = 4U; osrTemp <= 32U; osrTemp++) - { - /* calculate the temporary sbr value */ - sbrTemp = (uint16_t)((srcClock_Hz * 2U / (baudRate_Bps * (uint32_t)osrTemp) + 1U) / 2U); - /*set sbrTemp to 1 if the sourceClockInHz can not satisfy the desired baud rate*/ - if (sbrTemp == 0U) - { - sbrTemp = 1U; - } - else if (sbrTemp > LPUART_BAUD_SBR_MASK) - { - sbrTemp = LPUART_BAUD_SBR_MASK; - } - else - { - /* For MISRA 15.7 */ - } - - /* Calculate the baud rate based on the temporary OSR and SBR values */ - calculatedBaud = srcClock_Hz / ((uint32_t)osrTemp * (uint32_t)sbrTemp); - - tempDiff = calculatedBaud > baudRate_Bps ? (calculatedBaud - baudRate_Bps) : (baudRate_Bps - calculatedBaud); - - if (tempDiff <= baudDiff) - { - baudDiff = tempDiff; - osr = osrTemp; /* update and store the best OSR value calculated */ - sbr = sbrTemp; /* update store the best SBR value calculated */ - } - } - - /* Check to see if actual baud rate is within 3% of desired baud rate - * based on the best calculate OSR value */ - if (baudDiff < (uint32_t)((baudRate_Bps / 100U) * 3U)) - { - /* Store CTRL before disable Tx and Rx */ - oldCtrl = base->CTRL; - - /* Disable LPUART TX RX before setting. */ - base->CTRL &= ~(LPUART_CTRL_TE_MASK | LPUART_CTRL_RE_MASK); - - temp = base->BAUD; - - /* Acceptable baud rate, check if OSR is between 4x and 7x oversampling. - * If so, then "BOTHEDGE" sampling must be turned on */ - if ((osr > 3U) && (osr < 8U)) - { - temp |= LPUART_BAUD_BOTHEDGE_MASK; - } - - /* program the osr value (bit value is one less than actual value) */ - temp &= ~LPUART_BAUD_OSR_MASK; - temp |= LPUART_BAUD_OSR((uint32_t)osr - 1UL); - - /* write the sbr value to the BAUD registers */ - temp &= ~LPUART_BAUD_SBR_MASK; - base->BAUD = temp | LPUART_BAUD_SBR(sbr); - - /* Restore CTRL. */ - base->CTRL = oldCtrl; - } - else - { - /* Unacceptable baud rate difference of more than 3%*/ - status = kStatus_LPUART_BaudrateNotSupport; - } - - return status; -} - -/*! - * brief Enable 9-bit data mode for LPUART. - * - * This function set the 9-bit mode for LPUART module. The 9th bit is not used for parity thus can be modified by user. - * - * param base LPUART peripheral base address. - * param enable true to enable, flase to disable. - */ -void LPUART_Enable9bitMode(LPUART_Type *base, bool enable) -{ - assert(base != NULL); - - uint32_t temp = 0U; - - if (enable) - { - /* Set LPUART_CTRL_M for 9-bit mode, clear LPUART_CTRL_PE to disable parity. */ - temp = base->CTRL & ~((uint32_t)LPUART_CTRL_PE_MASK | (uint32_t)LPUART_CTRL_M_MASK); - temp |= (uint32_t)LPUART_CTRL_M_MASK; - base->CTRL = temp; - } - else - { - /* Clear LPUART_CTRL_M. */ - base->CTRL &= ~(uint32_t)LPUART_CTRL_M_MASK; - } -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - /* Clear LPUART_CTRL_M7 to disable 7-bit mode. */ - base->CTRL &= ~(uint32_t)LPUART_CTRL_M7_MASK; -#endif -#if defined(FSL_FEATURE_LPUART_HAS_10BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_10BIT_DATA_SUPPORT - /* Clear LPUART_BAUD_M10 to disable 10-bit mode. */ - base->BAUD &= ~(uint32_t)LPUART_BAUD_M10_MASK; -#endif -} - -/*! - * brief Transmit an address frame in 9-bit data mode. - * - * param base LPUART peripheral base address. - * param address LPUART slave address. - */ -void LPUART_SendAddress(LPUART_Type *base, uint8_t address) -{ - assert(base != NULL); - - uint32_t temp = base->DATA & 0xFFFFFC00UL; - temp |= ((uint32_t)address | (1UL << LPUART_DATA_R8T8_SHIFT)); - base->DATA = temp; -} - -/*! - * brief Enables LPUART interrupts according to a provided mask. - * - * This function enables the LPUART interrupts according to a provided mask. The mask - * is a logical OR of enumeration members. See the ref _lpuart_interrupt_enable. - * This examples shows how to enable TX empty interrupt and RX full interrupt: - * code - * LPUART_EnableInterrupts(LPUART1,kLPUART_TxDataRegEmptyInterruptEnable | kLPUART_RxDataRegFullInterruptEnable); - * endcode - * - * param base LPUART peripheral base address. - * param mask The interrupts to enable. Logical OR of ref _uart_interrupt_enable. - */ -void LPUART_EnableInterrupts(LPUART_Type *base, uint32_t mask) -{ - uint32_t s_atomicOldInt; - /* Only consider the real interrupt enable bits. */ - mask &= (uint32_t)kLPUART_AllInterruptEnable; - -#if defined(FSL_FEATURE_LPUART_HAS_MCR) && FSL_FEATURE_LPUART_HAS_MCR - /* Modem control interrupt enables */ - base->MCR |= (mask & 0xFUL); -#endif -#if defined(FSL_FEATURE_LPUART_HAS_TIMEOUT) && FSL_FEATURE_LPUART_HAS_TIMEOUT - /* Timeout interrupt enables. */ - base->TOSR |= ((mask >> 2U) & 0xF00UL); -#endif - /* Check int enable bits in base->BAUD */ - uint32_t baudRegMask = 0UL; -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - baudRegMask |= ((mask << 8U) & LPUART_BAUD_LBKDIE_MASK); - /* Clear bit 7 from mask */ - mask &= ~(uint32_t)kLPUART_LinBreakInterruptEnable; -#endif - baudRegMask |= ((mask << 8U) & LPUART_BAUD_RXEDGIE_MASK); - /* Clear bit 6 from mask */ - mask &= ~(uint32_t)kLPUART_RxActiveEdgeInterruptEnable; - - s_atomicOldInt = DisableGlobalIRQ(); - base->BAUD |= baudRegMask; - EnableGlobalIRQ(s_atomicOldInt); - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Check int enable bits in base->FIFO */ - - s_atomicOldInt = DisableGlobalIRQ(); - base->FIFO = (base->FIFO & ~(LPUART_FIFO_TXOF_MASK | LPUART_FIFO_RXUF_MASK)) | - (mask & (LPUART_FIFO_TXOFE_MASK | LPUART_FIFO_RXUFE_MASK)); - EnableGlobalIRQ(s_atomicOldInt); - - /* Clear bit 9 and bit 8 from mask */ - mask &= ~((uint32_t)kLPUART_TxFifoOverflowInterruptEnable | (uint32_t)kLPUART_RxFifoUnderflowInterruptEnable); -#endif - - /* Check int enable bits in base->CTRL */ - s_atomicOldInt = DisableGlobalIRQ(); - base->CTRL |= mask; - EnableGlobalIRQ(s_atomicOldInt); -} - -/*! - * brief Disables LPUART interrupts according to a provided mask. - * - * This function disables the LPUART interrupts according to a provided mask. The mask - * is a logical OR of enumeration members. See ref _lpuart_interrupt_enable. - * This example shows how to disable the TX empty interrupt and RX full interrupt: - * code - * LPUART_DisableInterrupts(LPUART1,kLPUART_TxDataRegEmptyInterruptEnable | kLPUART_RxDataRegFullInterruptEnable); - * endcode - * - * param base LPUART peripheral base address. - * param mask The interrupts to disable. Logical OR of ref _lpuart_interrupt_enable. - */ -void LPUART_DisableInterrupts(LPUART_Type *base, uint32_t mask) -{ - uint32_t s_atomicOldInt; - /* Only consider the real interrupt enable bits. */ - mask &= (uint32_t)kLPUART_AllInterruptEnable; - -#if defined(FSL_FEATURE_LPUART_HAS_MCR) && FSL_FEATURE_LPUART_HAS_MCR - /* Modem control interrupts. */ - base->MCR &= ~(mask & 0xFUL); -#endif -#if defined(FSL_FEATURE_LPUART_HAS_TIMEOUT) && FSL_FEATURE_LPUART_HAS_TIMEOUT - /* Timeout interrupt enables. */ - base->TOSR &= ~((mask >> 2U) & 0xF00UL); -#endif - - /* Clear int enable bits in base->BAUD */ - uint32_t baudRegMask = 0UL; -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - baudRegMask |= ((mask << 8U) & LPUART_BAUD_LBKDIE_MASK); - /* Clear bit 7 from mask */ - mask &= ~(uint32_t)kLPUART_LinBreakInterruptEnable; -#endif - baudRegMask |= ((mask << 8U) & LPUART_BAUD_RXEDGIE_MASK); - /* Clear bit 6 from mask */ - mask &= ~(uint32_t)kLPUART_RxActiveEdgeInterruptEnable; - - s_atomicOldInt = DisableGlobalIRQ(); - base->BAUD &= ~baudRegMask; - EnableGlobalIRQ(s_atomicOldInt); - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Check int enable bits in base->FIFO */ - - s_atomicOldInt = DisableGlobalIRQ(); - base->FIFO = (base->FIFO & ~(LPUART_FIFO_TXOF_MASK | LPUART_FIFO_RXUF_MASK)) & - ~(mask & (LPUART_FIFO_TXOFE_MASK | LPUART_FIFO_RXUFE_MASK)); - EnableGlobalIRQ(s_atomicOldInt); - /* Clear bit 9 and bit 8 from mask */ - mask &= ~((uint32_t)kLPUART_TxFifoOverflowInterruptEnable | (uint32_t)kLPUART_RxFifoUnderflowInterruptEnable); -#endif - - /* Clear int enable bits in base->CTRL */ - s_atomicOldInt = DisableGlobalIRQ(); - base->CTRL &= ~mask; - EnableGlobalIRQ(s_atomicOldInt); -} - -/*! - * brief Gets enabled LPUART interrupts. - * - * This function gets the enabled LPUART interrupts. The enabled interrupts are returned - * as the logical OR value of the enumerators ref _lpuart_interrupt_enable. To check - * a specific interrupt enable status, compare the return value with enumerators - * in ref _lpuart_interrupt_enable. - * For example, to check whether the TX empty interrupt is enabled: - * code - * uint32_t enabledInterrupts = LPUART_GetEnabledInterrupts(LPUART1); - * - * if (kLPUART_TxDataRegEmptyInterruptEnable & enabledInterrupts) - * { - * ... - * } - * endcode - * - * param base LPUART peripheral base address. - * return LPUART interrupt flags which are logical OR of the enumerators in ref _lpuart_interrupt_enable. - */ -uint32_t LPUART_GetEnabledInterrupts(LPUART_Type *base) -{ - /* Check int enable bits in base->CTRL */ - uint32_t temp = (uint32_t)(base->CTRL & 0xFF0C000UL); - -#if defined(FSL_FEATURE_LPUART_HAS_MCR) && FSL_FEATURE_LPUART_HAS_MCR - /* Check modem control interrupts. */ - temp |= (base->MCR & 0xFUL); -#endif -#if defined(FSL_FEATURE_LPUART_HAS_TIMEOUT) && FSL_FEATURE_LPUART_HAS_TIMEOUT - /* Check timeout control interrupts. */ - temp |= ((base->TOCR & 0xF00UL) << 2U); -#endif - - /* Check int enable bits in base->BAUD */ - temp = (temp & ~(uint32_t)kLPUART_RxActiveEdgeInterruptEnable) | ((base->BAUD & LPUART_BAUD_RXEDGIE_MASK) >> 8U); -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - temp = (temp & ~(uint32_t)kLPUART_LinBreakInterruptEnable) | ((base->BAUD & LPUART_BAUD_LBKDIE_MASK) >> 8U); -#endif - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Check int enable bits in base->FIFO */ - temp = - (temp & ~((uint32_t)kLPUART_TxFifoOverflowInterruptEnable | (uint32_t)kLPUART_RxFifoUnderflowInterruptEnable)) | - (base->FIFO & (LPUART_FIFO_TXOFE_MASK | LPUART_FIFO_RXUFE_MASK)); -#endif - - return temp; -} - -/*! - * brief Gets LPUART status flags. - * - * This function gets all LPUART status flags. The flags are returned as the logical - * OR value of the enumerators ref _lpuart_flags. To check for a specific status, - * compare the return value with enumerators in the ref _lpuart_flags. - * For example, to check whether the TX is empty: - * code - * if (kLPUART_TxDataRegEmptyFlag & LPUART_GetStatusFlags(LPUART1)) - * { - * ... - * } - * endcode - * - * param base LPUART peripheral base address. - * return LPUART status flags which are ORed by the enumerators in the _lpuart_flags. - */ -uint32_t LPUART_GetStatusFlags(LPUART_Type *base) -{ - uint32_t temp; - - temp = (base->STAT & 0xC1FFC000UL); -#if defined(FSL_FEATURE_LPUART_HAS_MCR) && FSL_FEATURE_LPUART_HAS_MCR - temp |= ((base->MSR & 0xFUL) << 2U); -#endif -#if defined(FSL_FEATURE_LPUART_HAS_TIMEOUT) && FSL_FEATURE_LPUART_HAS_TIMEOUT - temp |= ((base->TOSR & 0xF00UL) << 2U); -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - temp |= (base->FIFO & - (LPUART_FIFO_TXEMPT_MASK | LPUART_FIFO_RXEMPT_MASK | LPUART_FIFO_TXOF_MASK | LPUART_FIFO_RXUF_MASK)) >> - 16U; -#endif - /* Only keeps the status bits */ - temp &= (uint32_t)kLPUART_AllFlags; - return temp; -} - -/*! - * brief Clears status flags with a provided mask. - * - * This function clears LPUART status flags with a provided mask. Automatically cleared flags - * can't be cleared by this function. - * Flags that can only cleared or set by hardware are: - * kLPUART_TxDataRegEmptyFlag, kLPUART_TransmissionCompleteFlag, kLPUART_RxDataRegFullFlag, - * kLPUART_RxActiveFlag, kLPUART_NoiseErrorInRxDataRegFlag, kLPUART_ParityErrorInRxDataRegFlag, - * kLPUART_TxFifoEmptyFlag,kLPUART_RxFifoEmptyFlag - * Note: This API should be called when the Tx/Rx is idle, otherwise it takes no effects. - * - * param base LPUART peripheral base address. - * param mask the status flags to be cleared. The user can use the enumerators in the - * _lpuart_status_flag_t to do the OR operation and get the mask. - * return 0 succeed, others failed. - * retval kStatus_LPUART_FlagCannotClearManually The flag can't be cleared by this function but - * it is cleared automatically by hardware. - * retval kStatus_Success Status in the mask are cleared. - */ -status_t LPUART_ClearStatusFlags(LPUART_Type *base, uint32_t mask) -{ - uint32_t temp; - status_t status; - - /* Only deal with the clearable flags */ - mask &= (uint32_t)kLPUART_AllClearFlags; - -#if defined(FSL_FEATURE_LPUART_HAS_MCR) && FSL_FEATURE_LPUART_HAS_MCR - /* Modem status */ - base->MSR = ((mask >> 2U) & 0xFUL); -#endif -#if defined(FSL_FEATURE_LPUART_HAS_TIMEOUT) && FSL_FEATURE_LPUART_HAS_TIMEOUT - /* Timeout status */ - base->TOSR = ((mask >> 2U) & 0xF00UL); -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Status bits in FIFO register */ - if ((mask & ((uint32_t)kLPUART_TxFifoOverflowFlag | (uint32_t)kLPUART_RxFifoUnderflowFlag)) != 0U) - { - /* Get the FIFO register value and mask the rx/tx FIFO flush bits and the status bits that can be W1C in case - they are written 1 accidentally. */ - temp = (uint32_t)base->FIFO; - temp &= (uint32_t)(~(LPUART_FIFO_TXFLUSH_MASK | LPUART_FIFO_RXFLUSH_MASK | LPUART_FIFO_TXOF_MASK | - LPUART_FIFO_RXUF_MASK)); - temp |= (mask << 16U) & (LPUART_FIFO_TXOF_MASK | LPUART_FIFO_RXUF_MASK); - base->FIFO = temp; - } -#endif - /* Status bits in STAT register */ - /* First get the STAT register value and mask all the bits that not represent status, then OR with the status bit - * that is to be W1C */ - temp = (base->STAT & 0x3E000000UL) | mask; - base->STAT = temp; - /* If some flags still pending. */ - if (0U != (mask & LPUART_GetStatusFlags(base))) - { - status = kStatus_LPUART_FlagCannotClearManually; - } - else - { - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Writes to the transmitter register using a blocking method. - * - * This function polls the transmitter register, first waits for the register to be empty or TX FIFO to have room, - * and writes data to the transmitter buffer, then waits for the data to be sent out to bus. - * - * param base LPUART peripheral base address. - * param data Start address of the data to write. - * param length Size of the data to write. - * retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * retval kStatus_Success Successfully wrote all data. - */ -status_t LPUART_WriteBlocking(LPUART_Type *base, const uint8_t *data, size_t length) -{ - assert(NULL != data); - - const uint8_t *dataAddress = data; - size_t transferSize = length; - -#if UART_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != transferSize) - { -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; - while ((0U == (base->STAT & LPUART_STAT_TDRE_MASK)) && (0U != --waitTimes)) -#else - while (0U == (base->STAT & LPUART_STAT_TDRE_MASK)) -#endif - { - } -#if UART_RETRY_TIMES - if (0U == waitTimes) - { - return kStatus_LPUART_Timeout; - } -#endif - base->DATA = *(dataAddress); - dataAddress++; - transferSize--; - } - /* Ensure all the data in the transmit buffer are sent out to bus. */ -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; - while ((0U == (base->STAT & LPUART_STAT_TC_MASK)) && (0U != --waitTimes)) -#else - while (0U == (base->STAT & LPUART_STAT_TC_MASK)) -#endif - { - } -#if UART_RETRY_TIMES - if (0U == waitTimes) - { - return kStatus_LPUART_Timeout; - } -#endif - return kStatus_Success; -} - -/*! - * brief Writes to the transmitter register using a blocking method in 9bit or 10bit mode. - * - * note This function only support 9bit or 10bit transfer. - * Please make sure only 10bit of data is valid and other bits are 0. - * - * param base LPUART peripheral base address. - * param data Start address of the data to write. - * param length Size of the data to write. - * retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * retval kStatus_Success Successfully wrote all data. - */ -status_t LPUART_WriteBlocking16bit(LPUART_Type *base, const uint16_t *data, size_t length) -{ - assert(NULL != data); - - const uint16_t *dataAddress = data; - size_t transferSize = length; - -#if UART_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != transferSize) - { -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; - while ((0U == (base->STAT & LPUART_STAT_TDRE_MASK)) && (0U != --waitTimes)) -#else - while (0U == (base->STAT & LPUART_STAT_TDRE_MASK)) -#endif - { - } -#if UART_RETRY_TIMES - if (0U == waitTimes) - { - return kStatus_LPUART_Timeout; - } -#endif - base->DATA = *(dataAddress); - dataAddress++; - transferSize--; - } - /* Ensure all the data in the transmit buffer are sent out to bus. */ -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; - while ((0U == (base->STAT & LPUART_STAT_TC_MASK)) && (0U != --waitTimes)) -#else - while (0U == (base->STAT & LPUART_STAT_TC_MASK)) -#endif - { - } -#if UART_RETRY_TIMES - if (0U == waitTimes) - { - return kStatus_LPUART_Timeout; - } -#endif - return kStatus_Success; -} - -/*! - * brief Reads the receiver data register using a blocking method. - * - * This function polls the receiver register, waits for the receiver register full or receiver FIFO - * has data, and reads data from the TX register. - * - * param base LPUART peripheral base address. - * param data Start address of the buffer to store the received data. - * param length Size of the buffer. - * retval kStatus_LPUART_RxHardwareOverrun Receiver overrun happened while receiving data. - * retval kStatus_LPUART_NoiseError Noise error happened while receiving data. - * retval kStatus_LPUART_FramingError Framing error happened while receiving data. - * retval kStatus_LPUART_ParityError Parity error happened while receiving data. - * retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * retval kStatus_Success Successfully received all data. - */ -status_t LPUART_ReadBlocking(LPUART_Type *base, uint8_t *data, size_t length) -{ - assert(NULL != data); - - status_t status = kStatus_Success; - uint32_t statusFlag; - uint8_t *dataAddress = data; - -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - uint32_t ctrl = base->CTRL; - bool isSevenDataBits = (((ctrl & LPUART_CTRL_M7_MASK) != 0U) || - (((ctrl & LPUART_CTRL_M_MASK) == 0U) && ((ctrl & LPUART_CTRL_PE_MASK) != 0U))); -#endif - -#if UART_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != (length--)) - { -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - while (0U == ((base->WATER & LPUART_WATER_RXCOUNT_MASK) >> LPUART_WATER_RXCOUNT_SHIFT)) -#else - while (0U == (base->STAT & LPUART_STAT_RDRF_MASK)) -#endif - { -#if UART_RETRY_TIMES - if (0U == --waitTimes) - { - status = kStatus_LPUART_Timeout; - break; - } -#endif - statusFlag = LPUART_GetStatusFlags(base); - - if (0U != (statusFlag & (uint32_t)kLPUART_RxOverrunFlag)) - { - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_RxOverrunFlag)) ? - (kStatus_LPUART_RxHardwareOverrun) : - (kStatus_LPUART_FlagCannotClearManually)); - /* Other error flags(FE, NF, and PF) are prevented from setting once OR is set, no need to check other - * error flags*/ - break; - } - - if (0U != (statusFlag & (uint32_t)kLPUART_ParityErrorFlag)) - { - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_ParityErrorFlag)) ? - (kStatus_LPUART_ParityError) : - (kStatus_LPUART_FlagCannotClearManually)); - } - - if (0U != (statusFlag & (uint32_t)kLPUART_FramingErrorFlag)) - { - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_FramingErrorFlag)) ? - (kStatus_LPUART_FramingError) : - (kStatus_LPUART_FlagCannotClearManually)); - } - - if (0U != (statusFlag & (uint32_t)kLPUART_NoiseErrorFlag)) - { - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_NoiseErrorFlag)) ? - (kStatus_LPUART_NoiseError) : - (kStatus_LPUART_FlagCannotClearManually)); - } - if (kStatus_Success != status) - { - break; - } - } - - if (kStatus_Success == status) - { -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - if (isSevenDataBits) - { - *(dataAddress) = (uint8_t)(base->DATA & 0x7FU); - dataAddress++; - } - else - { - *(dataAddress) = (uint8_t)base->DATA; - dataAddress++; - } -#else - *(dataAddress) = (uint8_t)base->DATA; - dataAddress++; -#endif - } - else - { - break; - } - } - - return status; -} - -/*! - * brief Reads the receiver data register in 9bit or 10bit mode. - * - * note This function only support 9bit or 10bit transfer. - * - * param base LPUART peripheral base address. - * param data Start address of the buffer to store the received data by 16bit, only 10bit is valid. - * param length Size of the buffer. - * retval kStatus_LPUART_RxHardwareOverrun Receiver overrun happened while receiving data. - * retval kStatus_LPUART_NoiseError Noise error happened while receiving data. - * retval kStatus_LPUART_FramingError Framing error happened while receiving data. - * retval kStatus_LPUART_ParityError Parity error happened while receiving data. - * retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * retval kStatus_Success Successfully received all data. - */ -status_t LPUART_ReadBlocking16bit(LPUART_Type *base, uint16_t *data, size_t length) -{ - assert(NULL != data); - - status_t status = kStatus_Success; - uint32_t statusFlag; - uint16_t *dataAddress = data; - -#if UART_RETRY_TIMES - uint32_t waitTimes; -#endif - - while (0U != (length--)) - { -#if UART_RETRY_TIMES - waitTimes = UART_RETRY_TIMES; -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - while (0U == ((base->WATER & LPUART_WATER_RXCOUNT_MASK) >> LPUART_WATER_RXCOUNT_SHIFT)) -#else - while (0U == (base->STAT & LPUART_STAT_RDRF_MASK)) -#endif - { -#if UART_RETRY_TIMES - if (0U == --waitTimes) - { - status = kStatus_LPUART_Timeout; - break; - } -#endif - statusFlag = LPUART_GetStatusFlags(base); - - if (0U != (statusFlag & (uint32_t)kLPUART_RxOverrunFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_RxOverrunFlag)) ? - (kStatus_LPUART_RxHardwareOverrun) : - (kStatus_LPUART_FlagCannotClearManually)); - /* Other error flags(FE, NF, and PF) are prevented from setting once OR is set, no need to check other - * error flags*/ - break; - } - - if (0U != (statusFlag & (uint32_t)kLPUART_ParityErrorFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_ParityErrorFlag)) ? - (kStatus_LPUART_ParityError) : - (kStatus_LPUART_FlagCannotClearManually)); - } - - if (0U != (statusFlag & (uint32_t)kLPUART_FramingErrorFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_FramingErrorFlag)) ? - (kStatus_LPUART_FramingError) : - (kStatus_LPUART_FlagCannotClearManually)); - } - - if (0U != (statusFlag & (uint32_t)kLPUART_NoiseErrorFlag)) - { - /* - * $Branch Coverage Justification$ - * $ref fsl_lpuart_c_ref_2$. - */ - status = ((kStatus_Success == LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_NoiseErrorFlag)) ? - (kStatus_LPUART_NoiseError) : - (kStatus_LPUART_FlagCannotClearManually)); - } - if (kStatus_Success != status) - { - break; - } - } - if (kStatus_Success == status) - { - *(dataAddress) = (uint16_t)(base->DATA & 0x03FFU); - dataAddress++; - } - else - { - break; - } - } - - return status; -} - -/*! - * brief Initializes the LPUART handle. - * - * This function initializes the LPUART handle, which can be used for other LPUART - * transactional APIs. Usually, for a specified LPUART instance, - * call this API once to get the initialized handle. - * - * The LPUART driver supports the "background" receiving, which means that user can set up - * an RX ring buffer optionally. Data received is stored into the ring buffer even when the - * user doesn't call the LPUART_TransferReceiveNonBlocking() API. If there is already data received - * in the ring buffer, the user can get the received data from the ring buffer directly. - * The ring buffer is disabled if passing NULL as p ringBuffer. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param callback Callback function. - * param userData User data. - */ -void LPUART_TransferCreateHandle(LPUART_Type *base, - lpuart_handle_t *handle, - lpuart_transfer_callback_t callback, - void *userData) -{ - assert(NULL != handle); - - /* Get instance from peripheral base address. */ - uint32_t instance = LPUART_GetInstance(base); - - lpuart_to_lpflexcomm_t handler; - handler.lpuart_handler = LPUART_TransferHandleIRQ; - -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - uint32_t ctrl = base->CTRL; - bool isSevenDataBits = (((ctrl & LPUART_CTRL_M7_MASK) != 0U) || - (((ctrl & LPUART_CTRL_M_MASK) == 0U) && ((ctrl & LPUART_CTRL_PE_MASK) != 0U))); -#endif - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(lpuart_handle_t)); - - /* Set the TX/RX state. */ - handle->rxState = (uint8_t)kLPUART_RxIdle; - handle->txState = (uint8_t)kLPUART_TxIdle; - - /* Set the callback and user data. */ - handle->callback = callback; - handle->userData = userData; - -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - /* Initial seven data bits flag */ - handle->isSevenDataBits = isSevenDataBits; -#endif - handle->is16bitData = false; - - /* Save the handle in global variables to support the double weak mechanism. */ - LP_FLEXCOMM_SetIRQHandler(LPUART_GetInstance(base), handler.lpflexcomm_handler, handle, LP_FLEXCOMM_PERIPH_LPUART); - - /* Enable interrupt in NVIC. */ - (void)EnableIRQ(s_lpuartIRQ[instance]); -} - -/*! - * brief Sets up the RX ring buffer. - * - * This function sets up the RX ring buffer to a specific UART handle. - * - * When the RX ring buffer is used, data received is stored into the ring buffer even when - * the user doesn't call the UART_TransferReceiveNonBlocking() API. If there is already data received - * in the ring buffer, the user can get the received data from the ring buffer directly. - * - * note When using RX ring buffer, one byte is reserved for internal use. In other - * words, if p ringBufferSize is 32, then only 31 bytes are used for saving data. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param ringBuffer Start address of ring buffer for background receiving. Pass NULL to disable the ring buffer. - * param ringBufferSize size of the ring buffer. - */ -void LPUART_TransferStartRingBuffer(LPUART_Type *base, - lpuart_handle_t *handle, - uint8_t *ringBuffer, - size_t ringBufferSize) -{ - assert(NULL != handle); - assert(NULL != ringBuffer); - - /* Setup the ring buffer address */ - handle->rxRingBuffer = ringBuffer; - if (!handle->is16bitData) - { - handle->rxRingBufferSize = ringBufferSize; - } - else - { - handle->rxRingBufferSize = ringBufferSize / 2U; - } - handle->rxRingBufferHead = 0U; - handle->rxRingBufferTail = 0U; - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. */ - uint32_t irqMask = DisableGlobalIRQ(); - /* Enable the interrupt to accept the data when user need the ring buffer. */ - base->CTRL |= (uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); -} - -/*! - * brief Aborts the background transfer and uninstalls the ring buffer. - * - * This function aborts the background transfer and uninstalls the ring buffer. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - */ -void LPUART_TransferStopRingBuffer(LPUART_Type *base, lpuart_handle_t *handle) -{ - assert(NULL != handle); - - if (handle->rxState == (uint8_t)kLPUART_RxIdle) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. - */ - uint32_t irqMask = DisableGlobalIRQ(); - base->CTRL &= ~(uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); - } - - handle->rxRingBuffer = NULL; - handle->rxRingBufferSize = 0U; - handle->rxRingBufferHead = 0U; - handle->rxRingBufferTail = 0U; -} - -/*! - * brief Transmits a buffer of data using the interrupt method. - * - * This function send data using an interrupt method. This is a non-blocking function, which - * returns directly without waiting for all data written to the transmitter register. When - * all data is written to the TX register in the ISR, the LPUART driver calls the callback - * function and passes the ref kStatus_LPUART_TxIdle as status parameter. - * - * note The kStatus_LPUART_TxIdle is passed to the upper layer when all data are written - * to the TX register. However, there is no check to ensure that all the data sent out. Before disabling the TX, - * check the kLPUART_TransmissionCompleteFlag to ensure that the transmit is finished. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param xfer LPUART transfer structure, see #lpuart_transfer_t. - * retval kStatus_Success Successfully start the data transmission. - * retval kStatus_LPUART_TxBusy Previous transmission still not finished, data not all written to the TX register. - * retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_TransferSendNonBlocking(LPUART_Type *base, lpuart_handle_t *handle, lpuart_transfer_t *xfer) -{ - assert(NULL != handle); - assert(NULL != xfer); - assert(NULL != xfer->txData); - assert(0U != xfer->dataSize); - - status_t status; - - /* Return error if current TX busy. */ - if ((uint8_t)kLPUART_TxBusy == handle->txState) - { - status = kStatus_LPUART_TxBusy; - } - else - { - if (!handle->is16bitData) - { - handle->txData = xfer->txData; - } - else - { - handle->txData16 = xfer->txData16; - } - handle->txDataSize = xfer->dataSize; - handle->txDataSizeAll = xfer->dataSize; - handle->txState = (uint8_t)kLPUART_TxBusy; - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. - */ - uint32_t irqMask = DisableGlobalIRQ(); - /* Enable transmitter interrupt. */ - base->CTRL |= (uint32_t)LPUART_CTRL_TIE_MASK; - EnableGlobalIRQ(irqMask); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Aborts the interrupt-driven data transmit. - * - * This function aborts the interrupt driven data sending. The user can get the remainBtyes to find out - * how many bytes are not sent out. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - */ -void LPUART_TransferAbortSend(LPUART_Type *base, lpuart_handle_t *handle) -{ - assert(NULL != handle); - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. */ - uint32_t irqMask = DisableGlobalIRQ(); - base->CTRL &= ~(uint32_t)(LPUART_CTRL_TIE_MASK | LPUART_CTRL_TCIE_MASK); - EnableGlobalIRQ(irqMask); - - handle->txDataSize = 0; - handle->txState = (uint8_t)kLPUART_TxIdle; -} - -/*! - * brief Gets the number of bytes that have been sent out to bus. - * - * This function gets the number of bytes that have been sent out to bus by an interrupt method. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param count Send bytes count. - * retval kStatus_NoTransferInProgress No send in progress. - * retval kStatus_InvalidArgument Parameter is invalid. - * retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetSendCount(LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count) -{ - assert(NULL != handle); - assert(NULL != count); - - status_t status = kStatus_Success; - size_t tmptxDataSize = handle->txDataSize; - - if ((uint8_t)kLPUART_TxIdle == handle->txState) - { - status = kStatus_NoTransferInProgress; - } - else - { -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - *count = handle->txDataSizeAll - tmptxDataSize - - ((base->WATER & LPUART_WATER_TXCOUNT_MASK) >> LPUART_WATER_TXCOUNT_SHIFT); -#else - if ((base->STAT & (uint32_t)kLPUART_TxDataRegEmptyFlag) != 0U) - { - *count = handle->txDataSizeAll - tmptxDataSize; - } - else - { - *count = handle->txDataSizeAll - tmptxDataSize - 1U; - } -#endif - } - - return status; -} - -/*! - * brief Receives a buffer of data using the interrupt method. - * - * This function receives data using an interrupt method. This is a non-blocking function - * which returns without waiting to ensure that all data are received. - * If the RX ring buffer is used and not empty, the data in the ring buffer is copied and - * the parameter p receivedBytes shows how many bytes are copied from the ring buffer. - * After copying, if the data in the ring buffer is not enough for read, the receive - * request is saved by the LPUART driver. When the new data arrives, the receive request - * is serviced first. When all data is received, the LPUART driver notifies the upper layer - * through a callback function and passes a status parameter ref kStatus_UART_RxIdle. - * For example, the upper layer needs 10 bytes but there are only 5 bytes in ring buffer. - * The 5 bytes are copied to xfer->data, which returns with the - * parameter p receivedBytes set to 5. For the remaining 5 bytes, the newly arrived data is - * saved from xfer->data[5]. When 5 bytes are received, the LPUART driver notifies the upper layer. - * If the RX ring buffer is not enabled, this function enables the RX and RX interrupt - * to receive data to xfer->data. When all data is received, the upper layer is notified. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param xfer LPUART transfer structure, see #uart_transfer_t. - * param receivedBytes Bytes received from the ring buffer directly. - * retval kStatus_Success Successfully queue the transfer into the transmit queue. - * retval kStatus_LPUART_RxBusy Previous receive request is not finished. - * retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_TransferReceiveNonBlocking(LPUART_Type *base, - lpuart_handle_t *handle, - lpuart_transfer_t *xfer, - size_t *receivedBytes) -{ - assert(NULL != handle); - assert(NULL != xfer); - assert(NULL != xfer->rxData); - assert(0U != xfer->dataSize); - - uint32_t i; - status_t status; - uint32_t irqMask; - /* How many bytes to copy from ring buffer to user memory. */ - size_t bytesToCopy = 0U; - /* How many bytes to receive. */ - size_t bytesToReceive; - /* How many bytes currently have received. */ - size_t bytesCurrentReceived; - - /* How to get data: - 1. If RX ring buffer is not enabled, then save xfer->data and xfer->dataSize - to lpuart handle, enable interrupt to store received data to xfer->data. When - all data received, trigger callback. - 2. If RX ring buffer is enabled and not empty, get data from ring buffer first. - If there are enough data in ring buffer, copy them to xfer->data and return. - If there are not enough data in ring buffer, copy all of them to xfer->data, - save the xfer->data remained empty space to lpuart handle, receive data - to this empty space and trigger callback when finished. */ - - if ((uint8_t)kLPUART_RxBusy == handle->rxState) - { - status = kStatus_LPUART_RxBusy; - } - else - { - bytesToReceive = xfer->dataSize; - bytesCurrentReceived = 0; - - /* If RX ring buffer is used. */ - if (NULL != handle->rxRingBuffer) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - /* Disable LPUART RX IRQ, protect ring buffer. */ - base->CTRL &= ~(uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); - - /* How many bytes in RX ring buffer currently. */ - bytesToCopy = LPUART_TransferGetRxRingBufferLength(base, handle); - - if (0U != bytesToCopy) - { - bytesToCopy = MIN(bytesToReceive, bytesToCopy); - - bytesToReceive -= bytesToCopy; - - /* Copy data from ring buffer to user memory. */ - for (i = 0U; i < bytesToCopy; i++) - { - if (!handle->is16bitData) - { - xfer->rxData[bytesCurrentReceived] = handle->rxRingBuffer[handle->rxRingBufferTail]; - } - else - { - xfer->rxData16[bytesCurrentReceived] = handle->rxRingBuffer16[handle->rxRingBufferTail]; - } - bytesCurrentReceived++; - - /* Wrap to 0. Not use modulo (%) because it might be large and slow. */ - if (((uint32_t)handle->rxRingBufferTail + 1U) == handle->rxRingBufferSize) - { - handle->rxRingBufferTail = 0U; - } - else - { - handle->rxRingBufferTail++; - } - } - } - - /* If ring buffer does not have enough data, still need to read more data. */ - if (0U != bytesToReceive) - { - /* No data in ring buffer, save the request to LPUART handle. */ - if (!handle->is16bitData) - { - handle->rxData = &xfer->rxData[bytesCurrentReceived]; - } - else - { - handle->rxData16 = &xfer->rxData16[bytesCurrentReceived]; - } - handle->rxDataSize = bytesToReceive; - handle->rxDataSizeAll = xfer->dataSize; - handle->rxState = (uint8_t)kLPUART_RxBusy; - } - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - /* Re-enable LPUART RX IRQ. */ - base->CTRL |= (uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); - - /* Call user callback since all data are received. */ - if (0U == bytesToReceive) - { - if (NULL != handle->callback) - { - handle->callback(base, handle, kStatus_LPUART_RxIdle, handle->userData); - } - } - } - /* Ring buffer not used. */ - else - { - if (!handle->is16bitData) - { - handle->rxData = &xfer->rxData[bytesCurrentReceived]; - } - else - { - handle->rxData16 = &xfer->rxData16[bytesCurrentReceived]; - } - handle->rxDataSize = bytesToReceive; - handle->rxDataSizeAll = bytesToReceive; - handle->rxState = (uint8_t)kLPUART_RxBusy; - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - /* Enable RX interrupt. */ - base->CTRL |= (uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ILIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); - } - - /* Return the how many bytes have read. */ - if (NULL != receivedBytes) - { - *receivedBytes = bytesCurrentReceived; - } - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Aborts the interrupt-driven data receiving. - * - * This function aborts the interrupt-driven data receiving. The user can get the remainBytes to find out - * how many bytes not received yet. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - */ -void LPUART_TransferAbortReceive(LPUART_Type *base, lpuart_handle_t *handle) -{ - assert(NULL != handle); - - /* Only abort the receive to handle->rxData, the RX ring buffer is still working. */ - if (NULL == handle->rxRingBuffer) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. - */ - uint32_t irqMask = DisableGlobalIRQ(); - /* Disable RX interrupt. */ - base->CTRL &= ~(uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ILIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); - } - - handle->rxDataSize = 0U; - handle->rxState = (uint8_t)kLPUART_RxIdle; -} - -/*! - * brief Gets the number of bytes that have been received. - * - * This function gets the number of bytes that have been received. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param count Receive bytes count. - * retval kStatus_NoTransferInProgress No receive in progress. - * retval kStatus_InvalidArgument Parameter is invalid. - * retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetReceiveCount(LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count) -{ - assert(NULL != handle); - assert(NULL != count); - - status_t status = kStatus_Success; - size_t tmprxDataSize = handle->rxDataSize; - - if ((uint8_t)kLPUART_RxIdle == handle->rxState) - { - status = kStatus_NoTransferInProgress; - } - else - { - *count = handle->rxDataSizeAll - tmprxDataSize; - } - - return status; -} - -/*! - * brief LPUART IRQ handle function. - * - * This function handles the LPUART transmit and receive IRQ request. - * - * param instance LPUART instance. - * param irqHandle LPUART handle pointer. - */ -void LPUART_TransferHandleIRQ(uint32_t instance, void *irqHandle) -{ - assert(NULL != irqHandle); - assert(instance < ARRAY_SIZE(s_lpuartBases)); - LPUART_Type *base = s_lpuartBases[instance]; - uint8_t count; - uint8_t tempCount; - uint32_t status = LPUART_GetStatusFlags(base); - uint32_t enabledInterrupts = LPUART_GetEnabledInterrupts(base); - uint16_t tpmRxRingBufferHead; - uint32_t tpmData; - uint32_t irqMask; - lpuart_handle_t *handle = (lpuart_handle_t *)irqHandle; - - /* If RX overrun. */ - if ((uint32_t)kLPUART_RxOverrunFlag == ((uint32_t)kLPUART_RxOverrunFlag & status)) - { - /* Clear overrun flag, otherwise the RX does not work. */ - base->STAT = ((base->STAT & 0x3FE00000U) | LPUART_STAT_OR_MASK); - - /* Trigger callback. */ - if (NULL != (handle->callback)) - { - handle->callback(base, handle, kStatus_LPUART_RxHardwareOverrun, handle->userData); - } - } - - /* If IDLE flag is set and the IDLE interrupt is enabled. */ - if ((0U != ((uint32_t)kLPUART_IdleLineFlag & status)) && - (0U != ((uint32_t)kLPUART_IdleLineInterruptEnable & enabledInterrupts))) - { -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - count = ((uint8_t)((base->WATER & LPUART_WATER_RXCOUNT_MASK) >> LPUART_WATER_RXCOUNT_SHIFT)); - - while ((0U != handle->rxDataSize) && (0U != count)) - { - tempCount = (uint8_t)MIN(handle->rxDataSize, count); - - /* Using non block API to read the data from the registers. */ - if (!handle->is16bitData) - { - LPUART_ReadNonBlocking(base, handle->rxData, tempCount); - handle->rxData = &handle->rxData[tempCount]; - } - else - { - LPUART_ReadNonBlocking16bit(base, handle->rxData16, tempCount); - handle->rxData16 = &handle->rxData16[tempCount]; - } - handle->rxDataSize -= tempCount; - count -= tempCount; - - /* If rxDataSize is 0, invoke rx idle callback.*/ - if (0U == (handle->rxDataSize)) - { - handle->rxState = (uint8_t)kLPUART_RxIdle; - - if (NULL != handle->callback) - { - handle->callback(base, handle, kStatus_LPUART_RxIdle, handle->userData); - } - } - } -#endif - /* Clear IDLE flag.*/ - base->STAT = ((base->STAT & 0x3FE00000U) | LPUART_STAT_IDLE_MASK); - - /* If rxDataSize is 0, disable rx ready, overrun and idle line interrupt.*/ - if (0U == handle->rxDataSize) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - base->CTRL &= ~(uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ILIE_MASK | LPUART_CTRL_ORIE_MASK); - EnableGlobalIRQ(irqMask); - } - /* Invoke callback if callback is not NULL and rxDataSize is not 0. */ - else if (NULL != handle->callback) - { - handle->callback(base, handle, kStatus_LPUART_IdleLineDetected, handle->userData); - } - else - { - /* Avoid MISRA 15.7 */ - } - } - /* Receive data register full */ - if ((0U != ((uint32_t)kLPUART_RxDataRegFullFlag & status)) && - (0U != ((uint32_t)kLPUART_RxDataRegFullInterruptEnable & enabledInterrupts))) - { - /* Get the size that can be stored into buffer for this interrupt. */ -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - count = ((uint8_t)((base->WATER & LPUART_WATER_RXCOUNT_MASK) >> LPUART_WATER_RXCOUNT_SHIFT)); -#else - count = 1; -#endif - - /* If handle->rxDataSize is not 0, first save data to handle->rxData. */ - while ((0U != handle->rxDataSize) && (0U != count)) - { -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - tempCount = (uint8_t)MIN(handle->rxDataSize, count); -#else - tempCount = 1; -#endif - - /* Using non block API to read the data from the registers. */ - if (!handle->is16bitData) - { - LPUART_ReadNonBlocking(base, handle->rxData, tempCount); - handle->rxData = &handle->rxData[tempCount]; - } - else - { - LPUART_ReadNonBlocking16bit(base, handle->rxData16, tempCount); - handle->rxData16 = &handle->rxData16[tempCount]; - } - handle->rxDataSize -= tempCount; - count -= tempCount; - - /* If all the data required for upper layer is ready, trigger callback. */ - if (0U == handle->rxDataSize) - { - handle->rxState = (uint8_t)kLPUART_RxIdle; - - if (NULL != handle->callback) - { - handle->callback(base, handle, kStatus_LPUART_RxIdle, handle->userData); - } - } - } - - /* If use RX ring buffer, receive data to ring buffer. */ - if (NULL != handle->rxRingBuffer) - { - while (0U != count--) - { - /* If RX ring buffer is full, trigger callback to notify over run. */ - if (LPUART_TransferIsRxRingBufferFull(base, handle)) - { - if (NULL != handle->callback) - { - handle->callback(base, handle, kStatus_LPUART_RxRingBufferOverrun, handle->userData); - } - } - - /* If ring buffer is still full after callback function, the oldest data is overridden. */ - if (LPUART_TransferIsRxRingBufferFull(base, handle)) - { - /* Increase handle->rxRingBufferTail to make room for new data. */ - if (((uint32_t)handle->rxRingBufferTail + 1U) == handle->rxRingBufferSize) - { - handle->rxRingBufferTail = 0U; - } - else - { - handle->rxRingBufferTail++; - } - } - - /* Read data. */ - tpmRxRingBufferHead = handle->rxRingBufferHead; - tpmData = base->DATA; -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - if (handle->isSevenDataBits) - { - handle->rxRingBuffer[tpmRxRingBufferHead] = (uint8_t)(tpmData & 0x7FU); - } - else - { - if (!handle->is16bitData) - { - handle->rxRingBuffer[tpmRxRingBufferHead] = (uint8_t)tpmData; - } - else - { - handle->rxRingBuffer16[tpmRxRingBufferHead] = (uint16_t)(tpmData & 0x3FFU); - } - } -#else - if (!handle->is16bitData) - { - handle->rxRingBuffer[tpmRxRingBufferHead] = (uint8_t)tpmData; - } - else - { - handle->rxRingBuffer16[tpmRxRingBufferHead] = (uint16_t)(tpmData & 0x3FFU); - } -#endif - - /* Increase handle->rxRingBufferHead. */ - if (((uint32_t)handle->rxRingBufferHead + 1U) == handle->rxRingBufferSize) - { - handle->rxRingBufferHead = 0U; - } - else - { - handle->rxRingBufferHead++; - } - } - } - /* If no receive requst pending, stop RX interrupt. */ - else if (0U == handle->rxDataSize) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - base->CTRL &= ~(uint32_t)(LPUART_CTRL_RIE_MASK | LPUART_CTRL_ORIE_MASK | LPUART_CTRL_ILIE_MASK); - EnableGlobalIRQ(irqMask); - } - else - { - } - } - - /* Send data register empty and the interrupt is enabled. */ - if ((0U != ((uint32_t)kLPUART_TxDataRegEmptyFlag & status)) && - (0U != ((uint32_t)kLPUART_TxDataRegEmptyInterruptEnable & enabledInterrupts))) - { -/* Get the bytes that available at this moment. */ -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - count = (uint8_t)FSL_FEATURE_LPUART_FIFO_SIZEn(base) - - (uint8_t)((base->WATER & LPUART_WATER_TXCOUNT_MASK) >> LPUART_WATER_TXCOUNT_SHIFT); -#else - count = 1; -#endif - - while ((0U != handle->txDataSize) && (0U != count)) - { -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - tempCount = (uint8_t)MIN(handle->txDataSize, count); -#else - tempCount = 1; -#endif - - /* Using non block API to write the data to the registers. */ - if (!handle->is16bitData) - { - LPUART_WriteNonBlocking(base, handle->txData, tempCount); - handle->txData = &handle->txData[tempCount]; - } - else - { - LPUART_WriteNonBlocking16bit(base, handle->txData16, tempCount); - handle->txData16 = &handle->txData16[tempCount]; - } - handle->txDataSize -= tempCount; - count -= tempCount; - - /* If all the data are written to data register, notify user with the callback, then TX finished. */ - if (0U == handle->txDataSize) - { - /* Disable and re-enable the global interrupt to protect the interrupt enable register during - * read-modify-wrte. */ - irqMask = DisableGlobalIRQ(); - /* Disable TX register empty interrupt and enable transmission completion interrupt. */ - base->CTRL = (base->CTRL & ~LPUART_CTRL_TIE_MASK) | LPUART_CTRL_TCIE_MASK; - EnableGlobalIRQ(irqMask); - } - } - } - - /* Transmission complete and the interrupt is enabled. */ - if ((0U != ((uint32_t)kLPUART_TransmissionCompleteFlag & status)) && - (0U != ((uint32_t)kLPUART_TransmissionCompleteInterruptEnable & enabledInterrupts))) - { - /* Set txState to idle only when all data has been sent out to bus. */ - handle->txState = (uint8_t)kLPUART_TxIdle; - - /* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte. - */ - irqMask = DisableGlobalIRQ(); - /* Disable transmission complete interrupt. */ - base->CTRL &= ~(uint32_t)LPUART_CTRL_TCIE_MASK; - EnableGlobalIRQ(irqMask); - - /* Trigger callback. */ - if (NULL != handle->callback) - { - handle->callback(base, handle, kStatus_LPUART_TxIdle, handle->userData); - } - } -} - -/*! - * brief LPUART Error IRQ handle function. - * - * This function handles the LPUART error IRQ request. - * - * param base LPUART peripheral base address. - * param irqHandle LPUART handle pointer. - */ -void LPUART_TransferHandleErrorIRQ(LPUART_Type *base, void *irqHandle) -{ - /* To be implemented by User. */ -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpuart.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpuart.h deleted file mode 100644 index 39974bde07c..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpuart.h +++ /dev/null @@ -1,1188 +0,0 @@ -/* - * Copyright 2022, 2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_LPUART_H_ -#define FSL_LPUART_H_ - -#include "fsl_common.h" -#include "fsl_lpflexcomm.h" - -/*! - * @addtogroup lpuart_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief LPUART driver version. */ -#define FSL_LPUART_DRIVER_VERSION (MAKE_VERSION(2, 3, 2)) -/*! @} */ - -/*! @brief Retry times for waiting flag. */ -#ifndef UART_RETRY_TIMES -#define UART_RETRY_TIMES 0U /* Defining to zero means to keep waiting for the flag until it is assert/deassert. */ -#endif - -/*! @brief Error codes for the LPUART driver. */ -enum -{ - kStatus_LPUART_TxBusy = MAKE_STATUS(kStatusGroup_LPUART, 0), /*!< TX busy */ - kStatus_LPUART_RxBusy = MAKE_STATUS(kStatusGroup_LPUART, 1), /*!< RX busy */ - kStatus_LPUART_TxIdle = MAKE_STATUS(kStatusGroup_LPUART, 2), /*!< LPUART transmitter is idle. */ - kStatus_LPUART_RxIdle = MAKE_STATUS(kStatusGroup_LPUART, 3), /*!< LPUART receiver is idle. */ - kStatus_LPUART_TxWatermarkTooLarge = MAKE_STATUS(kStatusGroup_LPUART, 4), /*!< TX FIFO watermark too large */ - kStatus_LPUART_RxWatermarkTooLarge = MAKE_STATUS(kStatusGroup_LPUART, 5), /*!< RX FIFO watermark too large */ - kStatus_LPUART_FlagCannotClearManually = MAKE_STATUS(kStatusGroup_LPUART, 6), /*!< Some flag can't manually clear */ - kStatus_LPUART_Error = MAKE_STATUS(kStatusGroup_LPUART, 7), /*!< Error happens on LPUART. */ - kStatus_LPUART_RxRingBufferOverrun = - MAKE_STATUS(kStatusGroup_LPUART, 8), /*!< LPUART RX software ring buffer overrun. */ - kStatus_LPUART_RxHardwareOverrun = MAKE_STATUS(kStatusGroup_LPUART, 9), /*!< LPUART RX receiver overrun. */ - kStatus_LPUART_NoiseError = MAKE_STATUS(kStatusGroup_LPUART, 10), /*!< LPUART noise error. */ - kStatus_LPUART_FramingError = MAKE_STATUS(kStatusGroup_LPUART, 11), /*!< LPUART framing error. */ - kStatus_LPUART_ParityError = MAKE_STATUS(kStatusGroup_LPUART, 12), /*!< LPUART parity error. */ - kStatus_LPUART_BaudrateNotSupport = - MAKE_STATUS(kStatusGroup_LPUART, 13), /*!< Baudrate is not support in current clock source */ - kStatus_LPUART_IdleLineDetected = MAKE_STATUS(kStatusGroup_LPUART, 14), /*!< IDLE flag. */ - kStatus_LPUART_Timeout = MAKE_STATUS(kStatusGroup_LPUART, 15), /*!< LPUART times out. */ -}; - -/*! @brief LPUART parity mode. */ -typedef enum _lpuart_parity_mode -{ - kLPUART_ParityDisabled = 0x0U, /*!< Parity disabled */ - kLPUART_ParityEven = 0x2U, /*!< Parity enabled, type even, bit setting: PE|PT = 10 */ - kLPUART_ParityOdd = 0x3U, /*!< Parity enabled, type odd, bit setting: PE|PT = 11 */ -} lpuart_parity_mode_t; - -/*! @brief LPUART data bits count. */ -typedef enum _lpuart_data_bits -{ - kLPUART_EightDataBits = 0x0U, /*!< Eight data bit */ -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - kLPUART_SevenDataBits = 0x1U, /*!< Seven data bit */ -#endif -} lpuart_data_bits_t; - -/*! @brief LPUART stop bit count. */ -typedef enum _lpuart_stop_bit_count -{ - kLPUART_OneStopBit = 0U, /*!< One stop bit */ - kLPUART_TwoStopBit = 1U, /*!< Two stop bits */ -} lpuart_stop_bit_count_t; - -#if defined(FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT) && FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT -/*! @brief LPUART transmit CTS source. */ -typedef enum _lpuart_transmit_cts_source -{ - kLPUART_CtsSourcePin = 0U, /*!< CTS resource is the LPUART_CTS pin. */ - kLPUART_CtsSourceMatchResult = 1U, /*!< CTS resource is the match result. */ -} lpuart_transmit_cts_source_t; - -/*! @brief LPUART transmit CTS configure. */ -typedef enum _lpuart_transmit_cts_config -{ - kLPUART_CtsSampleAtStart = 0U, /*!< CTS input is sampled at the start of each character. */ - kLPUART_CtsSampleAtIdle = 1U, /*!< CTS input is sampled when the transmitter is idle */ -} lpuart_transmit_cts_config_t; -#endif - -/*! @brief LPUART idle flag type defines when the receiver starts counting. */ -typedef enum _lpuart_idle_type_select -{ - kLPUART_IdleTypeStartBit = 0U, /*!< Start counting after a valid start bit. */ - kLPUART_IdleTypeStopBit = 1U, /*!< Start counting after a stop bit. */ -} lpuart_idle_type_select_t; - -/*! @brief LPUART idle detected configuration. - * This structure defines the number of idle characters that must be received before - * the IDLE flag is set. - */ -typedef enum _lpuart_idle_config -{ - kLPUART_IdleCharacter1 = 0U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter2 = 1U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter4 = 2U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter8 = 3U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter16 = 4U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter32 = 5U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter64 = 6U, /*!< the number of idle characters. */ - kLPUART_IdleCharacter128 = 7U, /*!< the number of idle characters. */ -} lpuart_idle_config_t; - -/*! - * @brief LPUART interrupt configuration structure, default settings all disabled. - * - * This structure contains the settings for all LPUART interrupt configurations. - */ -enum _lpuart_interrupt_enable -{ -#if defined(FSL_FEATURE_LPUART_HAS_MCR) && FSL_FEATURE_LPUART_HAS_MCR - kLPUART_CtsStateChangeInterruptEnable = LPUART_MCR_CTS_MASK, /*!< Change of state on CTS_B pin. bit 0 */ - kLPUART_DsrStateChangeInterruptEnable = LPUART_MCR_DSR_MASK, /*!< Change of state on DSR_B pin. bit 1 */ - kLPUART_RinStateChangeInterruptEnable = LPUART_MCR_RIN_MASK, /*!< Change of state on RIN_B pin. bit 2 */ - kLPUART_DcdStateChangeInterruptEnable = LPUART_MCR_DCD_MASK, /*!< Change of state on DCD_B pin. bit 3 */ -#endif - kLPUART_RxActiveEdgeInterruptEnable = (LPUART_BAUD_RXEDGIE_MASK >> 8U), /*!< Receive Active Edge. bit 6 */ -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - kLPUART_LinBreakInterruptEnable = (LPUART_BAUD_LBKDIE_MASK >> 8U), /*!< LIN break detect. bit 7 */ -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - kLPUART_RxFifoUnderflowInterruptEnable = (LPUART_FIFO_RXUFE_MASK), /*!< Receive FIFO Underflow. bit 8 */ - kLPUART_TxFifoOverflowInterruptEnable = (LPUART_FIFO_TXOFE_MASK), /*!< Transmit FIFO Overflow. bit 9 */ -#endif - kLPUART_RxCounter0TimeoutInterruptEnable = 1UL << 10, /*!< Receiver counter0 timeout. bit 10 */ - kLPUART_RxCounter1TimeoutInterruptEnable = 1UL << 11, /*!< Receiver counter1 timeout. bit 11 */ - kLPUART_TxCounter0TimeoutInterruptEnable = 1UL << 12, /*!< Transmitter counter0 timeout. bit 12 */ - kLPUART_TxCounter1TimeoutInterruptEnable = 1UL << 13, /*!< Transmitter counter1 timeout. bit 13 */ -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - kLPUART_DataMatch2InterruptEnable = - (LPUART_CTRL_MA2IE_MASK), /*!< The next character to be read from LPUART_DATA matches MA2. bit 14 */ - kLPUART_DataMatch1InterruptEnable = - (LPUART_CTRL_MA1IE_MASK), /*!< The next character to be read from LPUART_DATA matches MA1. bit 15 */ -#endif - kLPUART_IdleLineInterruptEnable = (LPUART_CTRL_ILIE_MASK), /*!< Idle line. bit 20 */ - kLPUART_RxDataRegFullInterruptEnable = (LPUART_CTRL_RIE_MASK), /*!< Receiver data register full. bit 21 */ - kLPUART_TransmissionCompleteInterruptEnable = (LPUART_CTRL_TCIE_MASK), /*!< Transmission complete. bit 22 */ - kLPUART_TxDataRegEmptyInterruptEnable = (LPUART_CTRL_TIE_MASK), /*!< Transmit data register empty. bit 23 */ - kLPUART_ParityErrorInterruptEnable = (LPUART_CTRL_PEIE_MASK), /*!< Parity error flag. bit 24 */ - kLPUART_FramingErrorInterruptEnable = (LPUART_CTRL_FEIE_MASK), /*!< Framing error flag. bit 25 */ - kLPUART_NoiseErrorInterruptEnable = (LPUART_CTRL_NEIE_MASK), /*!< Noise error flag. bit 26 */ - kLPUART_RxOverrunInterruptEnable = (LPUART_CTRL_ORIE_MASK), /*!< Receiver Overrun. bit 27 */ - kLPUART_AllInterruptEnable = -#if defined(FSL_FEATURE_LPUART_HAS_MCR) && FSL_FEATURE_LPUART_HAS_MCR - kLPUART_CtsStateChangeInterruptEnable | kLPUART_DsrStateChangeInterruptEnable | - kLPUART_RinStateChangeInterruptEnable | kLPUART_DcdStateChangeInterruptEnable | -#endif - kLPUART_RxActiveEdgeInterruptEnable | kLPUART_IdleLineInterruptEnable | kLPUART_RxDataRegFullInterruptEnable | - kLPUART_TransmissionCompleteInterruptEnable | kLPUART_TxDataRegEmptyInterruptEnable | - kLPUART_ParityErrorInterruptEnable | kLPUART_FramingErrorInterruptEnable | kLPUART_NoiseErrorInterruptEnable | - kLPUART_RxOverrunInterruptEnable -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - | kLPUART_LinBreakInterruptEnable -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - | kLPUART_RxFifoUnderflowInterruptEnable | kLPUART_TxFifoOverflowInterruptEnable -#endif -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - | kLPUART_DataMatch2InterruptEnable | kLPUART_DataMatch1InterruptEnable -#endif - , -}; - -/*! - * @brief LPUART status flags. - * - * This provides constants for the LPUART status flags for use in the LPUART functions. - */ -enum _lpuart_flags -{ -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - kLPUART_RxFifoUnderflowFlag = - (LPUART_FIFO_RXUF_MASK >> 16), /*!< RXUF bit, sets if receive buffer underflow occurred. bit 0 */ - kLPUART_TxFifoOverflowFlag = - (LPUART_FIFO_TXOF_MASK >> 16), /*!< TXOF bit, sets if transmit buffer overflow occurred. bit 1 */ - kLPUART_RxFifoEmptyFlag = - (LPUART_FIFO_RXEMPT_MASK >> 16), /*!< RXEMPT bit, sets if receive buffer is empty. bit 6 */ - kLPUART_TxFifoEmptyFlag = - (LPUART_FIFO_TXEMPT_MASK >> 16), /*!< TXEMPT bit, sets if transmit buffer is empty. bit 7 */ -#endif - -#if defined(FSL_FEATURE_LPUART_HAS_MCR) && FSL_FEATURE_LPUART_HAS_MCR - kLPUART_CtsStateChangeFlag = LPUART_MCR_CTS_MASK << 2U, /*!< Change of state on CTS_B pin. bit 2 */ - kLPUART_DsrStateChangeFlag = LPUART_MCR_DSR_MASK << 2U, /*!< Change of state on DSR_B pin. bit 3 */ - kLPUART_RinStateChangeFlag = LPUART_MCR_RIN_MASK << 2U, /*!< Change of state on RIN_B pin. bit 4 */ - kLPUART_DcdStateChangeFlag = LPUART_MCR_DCD_MASK << 2U, /*!< Change of state on DCD_B pin. bit 5 */ -#endif - kLPUART_RxCounter0TimeoutFlag = 1UL << 10, /*!< Receiver counter0 timeout. bit 10 */ - kLPUART_RxCounter1TimeoutFlag = 1UL << 11, /*!< Receiver counter1 timeout. bit 11 */ - kLPUART_TxCounter0TimeoutFlag = 1UL << 12, /*!< Transmitter counter0 timeout. bit 12 */ - kLPUART_TxCounter1TimeoutFlag = 1UL << 13, /*!< Transmitter counter1 timeout. bit 13 */ -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - kLPUART_DataMatch2Flag = - LPUART_STAT_MA2F_MASK, /*!< The next character to be read from LPUART_DATA matches MA2. bit 14 */ - kLPUART_DataMatch1Flag = - LPUART_STAT_MA1F_MASK, /*!< The next character to be read from LPUART_DATA matches MA1. bit 15 */ -#endif - kLPUART_ParityErrorFlag = (LPUART_STAT_PF_MASK), /*!< If parity enabled, sets upon parity error detection. bit 16 */ - kLPUART_FramingErrorFlag = - (LPUART_STAT_FE_MASK), /*!< Frame error flag, sets if logic 0 was detected where stop bit expected. bit 17 */ - kLPUART_NoiseErrorFlag = (LPUART_STAT_NF_MASK), /*!< Receive takes 3 samples of each received bit. If any - of these samples differ, noise flag sets. bit 18 */ - kLPUART_RxOverrunFlag = (LPUART_STAT_OR_MASK), /*!< Receive Overrun, sets when new data is received before - data is read from receive register. bit 19 */ - kLPUART_IdleLineFlag = (LPUART_STAT_IDLE_MASK), /*!< Idle line detect flag, sets when idle line detected. bit 20 */ - kLPUART_RxDataRegFullFlag = (LPUART_STAT_RDRF_MASK), /*!< Receive data register full flag, sets when the - receive data buffer is full. bit 21 */ - kLPUART_TransmissionCompleteFlag = - (LPUART_STAT_TC_MASK), /*!< Transmission complete flag, sets when transmission activity complete. bit 22 */ - kLPUART_TxDataRegEmptyFlag = - (LPUART_STAT_TDRE_MASK), /*!< Transmit data register empty flag, sets when transmit buffer is empty. bit 23 */ - kLPUART_RxActiveFlag = - (LPUART_STAT_RAF_MASK), /*!< Receiver Active Flag (RAF), sets at beginning of valid start. bit 24 */ - kLPUART_RxActiveEdgeFlag = (LPUART_STAT_RXEDGIF_MASK), /*!< Receive pin active edge interrupt flag, sets - when active edge detected. bit 30 */ -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - kLPUART_LinBreakFlag = (LPUART_STAT_LBKDIF_MASK), /*!< LIN break detect interrupt flag, sets when LIN break - char detected and LIN circuit enabled. bit 31 */ -#endif - - kLPUART_AllClearFlags = -#if defined(FSL_FEATURE_LPUART_HAS_MCR) && FSL_FEATURE_LPUART_HAS_MCR - kLPUART_CtsStateChangeFlag | kLPUART_DsrStateChangeFlag | kLPUART_RinStateChangeFlag | - kLPUART_DcdStateChangeFlag | -#endif - kLPUART_ParityErrorFlag | kLPUART_FramingErrorFlag | kLPUART_NoiseErrorFlag | kLPUART_RxOverrunFlag | - kLPUART_IdleLineFlag | kLPUART_RxActiveEdgeFlag -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - | kLPUART_TxFifoOverflowFlag | kLPUART_RxFifoUnderflowFlag -#endif -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - | kLPUART_DataMatch2Flag | kLPUART_DataMatch1Flag -#endif -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - | kLPUART_LinBreakFlag -#endif - , - - kLPUART_AllFlags = -#if defined(FSL_FEATURE_LPUART_HAS_MCR) && FSL_FEATURE_LPUART_HAS_MCR - kLPUART_CtsStateChangeFlag | kLPUART_DsrStateChangeFlag | kLPUART_RinStateChangeFlag | - kLPUART_DcdStateChangeFlag | -#endif - kLPUART_ParityErrorFlag | kLPUART_FramingErrorFlag | kLPUART_NoiseErrorFlag | kLPUART_RxOverrunFlag | - kLPUART_IdleLineFlag | kLPUART_RxDataRegFullFlag | kLPUART_TransmissionCompleteFlag | - kLPUART_TxDataRegEmptyFlag | kLPUART_RxActiveFlag | kLPUART_RxActiveEdgeFlag -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - | kLPUART_TxFifoOverflowFlag | kLPUART_RxFifoUnderflowFlag | kLPUART_TxFifoEmptyFlag | kLPUART_RxFifoEmptyFlag -#endif -#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING - | kLPUART_DataMatch2Flag | kLPUART_DataMatch1Flag -#endif -#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT - | kLPUART_LinBreakFlag -#endif - , -}; - -/*! @brief LPUART timeout condition. - * This structure defines the conditions when the counter timeout occur. - */ -typedef enum _lpuart_timeout_condition -{ - kLPUART_TimeoutAfterCharacters = - 0U, /*!< Timeout occurs when the number of characters specified by timeoutValue are received. */ - kLPUART_TimeoutAfterIdle = 1U, /*!< Timeout occurs when rx/tx remains idle for timeoutValue of bit clocks after idle - condition is detected. */ - kLPUART_TimeoutAfterNext = 2U, /*!< Timeout occurs when rx/tx remains idle for timeoutValue of bit clocks after next - character is received/transmitted. */ - kLPUART_TimeoutAfterIdleBeforeExtended = 3U, /*!< Timeout occurs when tx/rx is idle for larger than timeoutValue of - bit clocks and smaller than tx/rx extended timeout value. */ -} lpuart_timeout_condition_t; - -/*! @brief LPUART timeout counter configuration structure. */ -typedef struct _lpuart_timeout_counter_config -{ - bool enableCounter; /*!< Eneble the timeout counter. */ - lpuart_timeout_condition_t timeoutCondition; /*!< Timeout condition. */ - uint16_t timeoutValue; /*!< Timeout value. */ -} lpuart_timeout_counter_config_t; - -/*! @brief LPUART timeout configuration structure. */ -typedef struct _lpuart_timeout_config -{ - uint16_t rxExtendedTimeoutValue; /*!< The number of bits since the last stop bit that is required for an - idle condition to be detected. Enable this will disable rxIdleType and rxIdleConfig. Set to 0 to disable. */ - uint16_t txExtendedTimeoutValue; /*!< The transmitter idle time in number of bits (baud rate) whenever an - idle character is queued through the transmit FIFO. */ - lpuart_timeout_counter_config_t rxCounter0; /*!< Rx counter 0 configuration. */ - lpuart_timeout_counter_config_t rxCounter1; /*!< Rx counter 1 configuration. */ - lpuart_timeout_counter_config_t txCounter0; /*!< Tx counter 0 configuration. */ - lpuart_timeout_counter_config_t txCounter1; /*!< Tx counter 1 configuration. */ -} lpuart_timeout_config_t; - -/*! @brief LPUART configuration structure. */ -typedef struct _lpuart_config -{ - uint32_t baudRate_Bps; /*!< LPUART baud rate */ - lpuart_parity_mode_t parityMode; /*!< Parity mode, disabled (default), even, odd */ - lpuart_data_bits_t dataBitsCount; /*!< Data bits count, eight (default), seven */ - bool isMsb; /*!< Data bits order, LSB (default), MSB */ -#if defined(FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT) && FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT - lpuart_stop_bit_count_t stopBitCount; /*!< Number of stop bits, 1 stop bit (default) or 2 stop bits */ -#endif -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - uint8_t txFifoWatermark; /*!< TX FIFO watermark */ - uint8_t rxFifoWatermark; /*!< RX FIFO watermark */ -#endif -#if defined(FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT) && FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT - bool enableRxRTS; /*!< RX RTS enable */ - bool enableTxCTS; /*!< TX CTS enable */ - lpuart_transmit_cts_source_t txCtsSource; /*!< TX CTS source */ - lpuart_transmit_cts_config_t txCtsConfig; /*!< TX CTS configure */ -#endif - lpuart_idle_type_select_t rxIdleType; /*!< RX IDLE type. */ - lpuart_idle_config_t rxIdleConfig; /*!< RX IDLE configuration. */ - lpuart_timeout_config_t timeoutConfig; /*!< Timeout configuration. */ - bool enableSingleWire; /*!< Use TXD pin as the source for the receiver. When enabled the TXD pin should be - configured as open drain. */ - uint8_t rtsDelay; /*!< Delay the negation of RTS by the configured number of bit clocks. */ - bool enableTx; /*!< Enable TX */ - bool enableRx; /*!< Enable RX */ -} lpuart_config_t; - -/*! @brief LPUART transfer structure. */ -typedef struct _lpuart_transfer -{ - /* - * Use separate TX and RX data pointer, because TX data is const data. - * The member data is kept for backward compatibility. - */ - union - { - uint8_t *data; /*!< The buffer of data to be transfer.*/ - uint8_t *rxData; /*!< The buffer to receive data. */ - uint16_t *rxData16; /*!< The buffer to receive data. */ - const uint8_t *txData; /*!< The buffer of data to be sent. */ - const uint16_t *txData16; /*!< The buffer of data to be sent. */ - }; - size_t dataSize; /*!< The byte count to be transfer. */ -} lpuart_transfer_t; - -/* Forward declaration of the handle typedef. */ -typedef struct _lpuart_handle lpuart_handle_t; - -/*! @brief LPUART transfer callback function. */ -typedef void (*lpuart_transfer_callback_t)(LPUART_Type *base, lpuart_handle_t *handle, status_t status, void *userData); - -/*! @brief LPUART handle structure. */ -struct _lpuart_handle -{ - union - { - const uint8_t *volatile txData; /*!< Address of remaining data to send. */ - const uint16_t *volatile txData16; /*!< Address of remaining data to send. */ - }; - volatile size_t txDataSize; /*!< Size of the remaining data to send. */ - size_t txDataSizeAll; /*!< Size of the data to send out. */ - union - { - uint8_t *volatile rxData; /*!< Address of remaining data to receive. */ - uint16_t *volatile rxData16; /*!< Address of remaining data to receive. */ - }; - volatile size_t rxDataSize; /*!< Size of the remaining data to receive. */ - size_t rxDataSizeAll; /*!< Size of the data to receive. */ - - union - { - uint8_t *rxRingBuffer; /*!< Start address of the receiver ring buffer. */ - uint16_t *rxRingBuffer16; /*!< Start address of the receiver ring buffer. */ - }; - size_t rxRingBufferSize; /*!< Size of the ring buffer. */ - volatile uint16_t rxRingBufferHead; /*!< Index for the driver to store received data into ring buffer. */ - volatile uint16_t rxRingBufferTail; /*!< Index for the user to get data from the ring buffer. */ - - lpuart_transfer_callback_t callback; /*!< Callback function. */ - void *userData; /*!< LPUART callback function parameter.*/ - - volatile uint8_t txState; /*!< TX transfer state. */ - volatile uint8_t rxState; /*!< RX transfer state. */ - -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - bool isSevenDataBits; /*!< Seven data bits flag. */ -#endif - bool is16bitData; /*!< 16bit data bits flag, only used for 9bit or 10bit data */ -}; - -/* Typedef for interrupt handler. */ -typedef void (*lpuart_irq_handler_t)(uint32_t instance, void *handle); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/* Array of LPUART IRQ number. */ -extern const IRQn_Type s_lpuartIRQ[]; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* _cplusplus */ - -#if defined(FSL_FEATURE_LPUART_HAS_GLOBAL) && FSL_FEATURE_LPUART_HAS_GLOBAL - -/*! - * @name Software Reset - * @{ - */ - -/*! - * @brief Resets the LPUART using software. - * - * This function resets all internal logic and registers except the Global Register. - * Remains set until cleared by software. - * - * @param base LPUART peripheral base address. - */ -static inline void LPUART_SoftwareReset(LPUART_Type *base) -{ - base->GLOBAL |= LPUART_GLOBAL_RST_MASK; - base->GLOBAL &= ~LPUART_GLOBAL_RST_MASK; -} -/*! @} */ -#endif /*FSL_FEATURE_LPUART_HAS_GLOBAL*/ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Initializes an LPUART instance with the user configuration structure and the peripheral clock. - * - * This function configures the LPUART module with user-defined settings. Call the LPUART_GetDefaultConfig() function - * to configure the configuration structure and get the default configuration. - * The example below shows how to use this API to configure the LPUART. - * @code - * lpuart_config_t lpuartConfig; - * lpuartConfig.baudRate_Bps = 115200U; - * lpuartConfig.parityMode = kLPUART_ParityDisabled; - * lpuartConfig.dataBitsCount = kLPUART_EightDataBits; - * lpuartConfig.isMsb = false; - * lpuartConfig.stopBitCount = kLPUART_OneStopBit; - * lpuartConfig.txFifoWatermark = 0; - * lpuartConfig.rxFifoWatermark = 1; - * LPUART_Init(LPUART1, &lpuartConfig, 20000000U); - * @endcode - * - * @param base LPUART peripheral base address. - * @param config Pointer to a user-defined configuration structure. - * @param srcClock_Hz LPUART clock source frequency in HZ. - * @retval kStatus_LPUART_BaudrateNotSupport Baudrate is not support in current clock source. - * @retval kStatus_Success LPUART initialize succeed - */ -status_t LPUART_Init(LPUART_Type *base, const lpuart_config_t *config, uint32_t srcClock_Hz); - -/*! - * @brief Deinitializes a LPUART instance. - * - * This function waits for transmit to complete, disables TX and RX, and disables the LPUART clock. - * - * @param base LPUART peripheral base address. - */ -void LPUART_Deinit(LPUART_Type *base); - -/*! - * @brief Gets the default configuration structure. - * - * This function initializes the LPUART configuration structure to a default value. The default - * values are: - * lpuartConfig->baudRate_Bps = 115200U; - * lpuartConfig->parityMode = kLPUART_ParityDisabled; - * lpuartConfig->dataBitsCount = kLPUART_EightDataBits; - * lpuartConfig->isMsb = false; - * lpuartConfig->stopBitCount = kLPUART_OneStopBit; - * lpuartConfig->txFifoWatermark = 0; - * lpuartConfig->rxFifoWatermark = 1; - * lpuartConfig->rxIdleType = kLPUART_IdleTypeStartBit; - * lpuartConfig->rxIdleConfig = kLPUART_IdleCharacter1; - * lpuartConfig->enableTx = false; - * lpuartConfig->enableRx = false; - * - * @param config Pointer to a configuration structure. - */ -void LPUART_GetDefaultConfig(lpuart_config_t *config); -/*! @} */ - -/*! - * @name Module configuration - * @{ - */ -/*! - * @brief Sets the LPUART instance baudrate. - * - * This function configures the LPUART module baudrate. This function is used to update - * the LPUART module baudrate after the LPUART module is initialized by the LPUART_Init. - * @code - * LPUART_SetBaudRate(LPUART1, 115200U, 20000000U); - * @endcode - * - * @param base LPUART peripheral base address. - * @param baudRate_Bps LPUART baudrate to be set. - * @param srcClock_Hz LPUART clock source frequency in HZ. - * @retval kStatus_LPUART_BaudrateNotSupport Baudrate is not supported in the current clock source. - * @retval kStatus_Success Set baudrate succeeded. - */ -status_t LPUART_SetBaudRate(LPUART_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz); - -/*! - * @brief Enable 9-bit data mode for LPUART. - * - * This function set the 9-bit mode for LPUART module. The 9th bit is not used for parity thus can be modified by user. - * - * @param base LPUART peripheral base address. - * @param enable true to enable, flase to disable. - */ -void LPUART_Enable9bitMode(LPUART_Type *base, bool enable); - -/*! - * @brief Set the LPUART address. - * - * This function configures the address for LPUART module that works as slave in 9-bit data mode. One or two address - * fields can be configured. When the address field's match enable bit is set, the frame it receices with MSB being - * 1 is considered as an address frame, otherwise it is considered as data frame. Once the address frame matches one - * of slave's own addresses, this slave is addressed. This address frame and its following data frames are stored in - * the receive buffer, otherwise the frames will be discarded. To un-address a slave, just send an address frame with - * unmatched address. - * - * @note Any LPUART instance joined in the multi-slave system can work as slave. The position of the address mark is the - * same as the parity bit when parity is enabled for 8 bit and 9 bit data formats. - * - * @param base LPUART peripheral base address. - * @param address1 LPUART slave address1. - * @param address2 LPUART slave address2. - */ -static inline void LPUART_SetMatchAddress(LPUART_Type *base, uint16_t address1, uint16_t address2) -{ - /* Configure match address. */ - uint32_t address = ((uint32_t)address2 << 16U) | (uint32_t)address1 | 0x1000100UL; - base->MATCH = address; -} - -/*! - * @brief Enable the LPUART match address feature. - * - * @param base LPUART peripheral base address. - * @param match1 true to enable match address1, false to disable. - * @param match2 true to enable match address2, false to disable. - */ -static inline void LPUART_EnableMatchAddress(LPUART_Type *base, bool match1, bool match2) -{ - /* Configure match address1 enable bit. */ - if (match1) - { - base->BAUD |= (uint32_t)LPUART_BAUD_MAEN1_MASK; - } - else - { - base->BAUD &= ~(uint32_t)LPUART_BAUD_MAEN1_MASK; - } - /* Configure match address2 enable bit. */ - if (match2) - { - base->BAUD |= (uint32_t)LPUART_BAUD_MAEN2_MASK; - } - else - { - base->BAUD &= ~(uint32_t)LPUART_BAUD_MAEN2_MASK; - } -} - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO -/*! - * @brief Sets the rx FIFO watermark. - * - * @param base LPUART peripheral base address. - * @param water Rx FIFO watermark. - */ -static inline void LPUART_SetRxFifoWatermark(LPUART_Type *base, uint8_t water) -{ - assert((uint8_t)FSL_FEATURE_LPUART_FIFO_SIZEn(base) > water); - base->WATER = (base->WATER & ~LPUART_WATER_RXWATER_MASK) | LPUART_WATER_RXWATER(water); -} - -/*! - * @brief Sets the tx FIFO watermark. - * - * @param base LPUART peripheral base address. - * @param water Tx FIFO watermark. - */ -static inline void LPUART_SetTxFifoWatermark(LPUART_Type *base, uint8_t water) -{ - assert((uint8_t)FSL_FEATURE_LPUART_FIFO_SIZEn(base) > water); - base->WATER = (base->WATER & ~LPUART_WATER_TXWATER_MASK) | LPUART_WATER_TXWATER(water); -} -#endif - -/*! - * @brief Sets the LPUART using 16bit transmit, only for 9bit or 10bit mode. - * - * This function Enable 16bit Data transmit in lpuart_handle_t. - * - * @param handle LPUART handle pointer. - * @param enable true to enable, false to disable. - */ -static inline void LPUART_TransferEnable16Bit(lpuart_handle_t *handle, bool enable) -{ - handle->is16bitData = enable; -} -/*! @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets LPUART status flags. - * - * This function gets all LPUART status flags. The flags are returned as the logical - * OR value of the enumerators @ref _lpuart_flags. To check for a specific status, - * compare the return value with enumerators in the @ref _lpuart_flags. - * For example, to check whether the TX is empty: - * @code - * if (kLPUART_TxDataRegEmptyFlag & LPUART_GetStatusFlags(LPUART1)) - * { - * ... - * } - * @endcode - * - * @param base LPUART peripheral base address. - * @return LPUART status flags which are ORed by the enumerators in the _lpuart_flags. - */ -uint32_t LPUART_GetStatusFlags(LPUART_Type *base); - -/*! - * @brief Clears status flags with a provided mask. - * - * This function clears LPUART status flags with a provided mask. Automatically cleared flags - * can't be cleared by this function. - * Flags that can only cleared or set by hardware are: - * kLPUART_TxDataRegEmptyFlag, kLPUART_TransmissionCompleteFlag, kLPUART_RxDataRegFullFlag, - * kLPUART_RxActiveFlag, kLPUART_NoiseErrorInRxDataRegFlag, kLPUART_ParityErrorInRxDataRegFlag, - * kLPUART_TxFifoEmptyFlag,kLPUART_RxFifoEmptyFlag - * Note: This API should be called when the Tx/Rx is idle, otherwise it takes no effects. - * - * @param base LPUART peripheral base address. - * @param mask the status flags to be cleared. The user can use the enumerators in the - * _lpuart_status_flag_t to do the OR operation and get the mask. - * @return 0 succeed, others failed. - * @retval kStatus_LPUART_FlagCannotClearManually The flag can't be cleared by this function but - * it is cleared automatically by hardware. - * @retval kStatus_Success Status in the mask are cleared. - */ -status_t LPUART_ClearStatusFlags(LPUART_Type *base, uint32_t mask); -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables LPUART interrupts according to a provided mask. - * - * This function enables the LPUART interrupts according to a provided mask. The mask - * is a logical OR of enumeration members. See the @ref _lpuart_interrupt_enable. - * This examples shows how to enable TX empty interrupt and RX full interrupt: - * @code - * LPUART_EnableInterrupts(LPUART1,kLPUART_TxDataRegEmptyInterruptEnable | kLPUART_RxDataRegFullInterruptEnable); - * @endcode - * - * @param base LPUART peripheral base address. - * @param mask The interrupts to enable. Logical OR of the enumeration _uart_interrupt_enable. - */ -void LPUART_EnableInterrupts(LPUART_Type *base, uint32_t mask); - -/*! - * @brief Disables LPUART interrupts according to a provided mask. - * - * This function disables the LPUART interrupts according to a provided mask. The mask - * is a logical OR of enumeration members. See @ref _lpuart_interrupt_enable. - * This example shows how to disable the TX empty interrupt and RX full interrupt: - * @code - * LPUART_DisableInterrupts(LPUART1,kLPUART_TxDataRegEmptyInterruptEnable | kLPUART_RxDataRegFullInterruptEnable); - * @endcode - * - * @param base LPUART peripheral base address. - * @param mask The interrupts to disable. Logical OR of @ref _lpuart_interrupt_enable. - */ -void LPUART_DisableInterrupts(LPUART_Type *base, uint32_t mask); - -/*! - * @brief Gets enabled LPUART interrupts. - * - * This function gets the enabled LPUART interrupts. The enabled interrupts are returned - * as the logical OR value of the enumerators @ref _lpuart_interrupt_enable. To check - * a specific interrupt enable status, compare the return value with enumerators - * in @ref _lpuart_interrupt_enable. - * For example, to check whether the TX empty interrupt is enabled: - * @code - * uint32_t enabledInterrupts = LPUART_GetEnabledInterrupts(LPUART1); - * - * if (kLPUART_TxDataRegEmptyInterruptEnable & enabledInterrupts) - * { - * ... - * } - * @endcode - * - * @param base LPUART peripheral base address. - * @return LPUART interrupt flags which are logical OR of the enumerators in @ref _lpuart_interrupt_enable. - */ -uint32_t LPUART_GetEnabledInterrupts(LPUART_Type *base); -/*! @} */ - -#if defined(FSL_FEATURE_LPUART_HAS_DMA_ENABLE) && FSL_FEATURE_LPUART_HAS_DMA_ENABLE -/*! - * @name DMA Configuration - * @{ - */ -/*! - * @brief Gets the LPUART data register address. - * - * This function returns the LPUART data register address, which is mainly used by the DMA/eDMA. - * - * @param base LPUART peripheral base address. - * @return LPUART data register addresses which are used both by the transmitter and receiver. - */ -static inline uint32_t LPUART_GetDataRegisterAddress(LPUART_Type *base) -{ - return (uint32_t) & (base->DATA); -} - -/*! - * @brief Enables or disables the LPUART transmitter DMA request. - * - * This function enables or disables the transmit data register empty flag, STAT[TDRE], to generate DMA requests. - * - * @param base LPUART peripheral base address. - * @param enable True to enable, false to disable. - */ -static inline void LPUART_EnableTxDMA(LPUART_Type *base, bool enable) -{ - if (enable) - { - base->BAUD |= LPUART_BAUD_TDMAE_MASK; - } - else - { - base->BAUD &= ~LPUART_BAUD_TDMAE_MASK; - } -} - -/*! - * @brief Enables or disables the LPUART receiver DMA. - * - * This function enables or disables the receiver data register full flag, STAT[RDRF], to generate DMA requests. - * - * @param base LPUART peripheral base address. - * @param enable True to enable, false to disable. - */ -static inline void LPUART_EnableRxDMA(LPUART_Type *base, bool enable) -{ - if (enable) - { - base->BAUD |= LPUART_BAUD_RDMAE_MASK; - } - else - { - base->BAUD &= ~LPUART_BAUD_RDMAE_MASK; - } -} -/*! @} */ -#endif /* FSL_FEATURE_LPUART_HAS_DMA_ENABLE */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Get the LPUART instance from peripheral base address. - * - * @param base LPUART peripheral base address. - * @return LPUART instance. - */ -uint32_t LPUART_GetInstance(LPUART_Type *base); - -/*! - * @brief Enables or disables the LPUART transmitter. - * - * This function enables or disables the LPUART transmitter. - * - * @param base LPUART peripheral base address. - * @param enable True to enable, false to disable. - */ -static inline void LPUART_EnableTx(LPUART_Type *base, bool enable) -{ - if (enable) - { - base->CTRL |= LPUART_CTRL_TE_MASK; - } - else - { - base->CTRL &= ~LPUART_CTRL_TE_MASK; - } -} - -/*! - * @brief Enables or disables the LPUART receiver. - * - * This function enables or disables the LPUART receiver. - * - * @param base LPUART peripheral base address. - * @param enable True to enable, false to disable. - */ -static inline void LPUART_EnableRx(LPUART_Type *base, bool enable) -{ - if (enable) - { - base->CTRL |= LPUART_CTRL_RE_MASK; - } - else - { - base->CTRL &= ~LPUART_CTRL_RE_MASK; - } -} - -/*! - * @brief Writes to the transmitter register. - * - * This function writes data to the transmitter register directly. The upper layer must - * ensure that the TX register is empty or that the TX FIFO has room before calling this function. - * - * @param base LPUART peripheral base address. - * @param data Data write to the TX register. - */ -static inline void LPUART_WriteByte(LPUART_Type *base, uint8_t data) -{ - base->DATA = data; -} - -/*! - * @brief Reads the receiver register. - * - * This function reads data from the receiver register directly. The upper layer must - * ensure that the receiver register is full or that the RX FIFO has data before calling this function. - * - * @param base LPUART peripheral base address. - * @return Data read from data register. - */ -static inline uint8_t LPUART_ReadByte(LPUART_Type *base) -{ -#if defined(FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT) && FSL_FEATURE_LPUART_HAS_7BIT_DATA_SUPPORT - uint32_t ctrl = base->CTRL; - uint8_t result; - bool isSevenDataBits = (((ctrl & LPUART_CTRL_M7_MASK) != 0U) || - (((ctrl & LPUART_CTRL_M7_MASK) == 0U) && ((ctrl & LPUART_CTRL_M_MASK) == 0U) && - ((ctrl & LPUART_CTRL_PE_MASK) != 0U))); - - if (isSevenDataBits) - { - result = (uint8_t)(base->DATA & 0x7FU); - } - else - { - result = (uint8_t)base->DATA; - } - - return result; -#else - return (uint8_t)(base->DATA); -#endif -} - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO -/*! - * @brief Gets the rx FIFO data count. - * - * @param base LPUART peripheral base address. - * @return rx FIFO data count. - */ -static inline uint8_t LPUART_GetRxFifoCount(LPUART_Type *base) -{ - return (uint8_t)((base->WATER & LPUART_WATER_RXCOUNT_MASK) >> LPUART_WATER_RXCOUNT_SHIFT); -} - -/*! - * @brief Gets the tx FIFO data count. - * - * @param base LPUART peripheral base address. - * @return tx FIFO data count. - */ -static inline uint8_t LPUART_GetTxFifoCount(LPUART_Type *base) -{ - return (uint8_t)((base->WATER & LPUART_WATER_TXCOUNT_MASK) >> LPUART_WATER_TXCOUNT_SHIFT); -} -#endif - -/*! - * @brief Transmit an address frame in 9-bit data mode. - * - * @param base LPUART peripheral base address. - * @param address LPUART slave address. - */ -void LPUART_SendAddress(LPUART_Type *base, uint8_t address); - -/*! - * @brief Writes to the transmitter register using a blocking method. - * - * This function polls the transmitter register, first waits for the register to be empty or TX FIFO to have room, - * and writes data to the transmitter buffer, then waits for the dat to be sent out to the bus. - * - * @param base LPUART peripheral base address. - * @param data Start address of the data to write. - * @param length Size of the data to write. - * @retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * @retval kStatus_Success Successfully wrote all data. - */ -status_t LPUART_WriteBlocking(LPUART_Type *base, const uint8_t *data, size_t length); - -/*! - * @brief Writes to the transmitter register using a blocking method in 9bit or 10bit mode. - * - * @note This function only support 9bit or 10bit transfer. - * Please make sure only 10bit of data is valid and other bits are 0. - * - * @param base LPUART peripheral base address. - * @param data Start address of the data to write. - * @param length Size of the data to write. - * @retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * @retval kStatus_Success Successfully wrote all data. - */ -status_t LPUART_WriteBlocking16bit(LPUART_Type *base, const uint16_t *data, size_t length); - -/*! - * @brief Reads the receiver data register using a blocking method. - * - * This function polls the receiver register, waits for the receiver register full or receiver FIFO - * has data, and reads data from the TX register. - * - * @param base LPUART peripheral base address. - * @param data Start address of the buffer to store the received data. - * @param length Size of the buffer. - * @retval kStatus_LPUART_RxHardwareOverrun Receiver overrun happened while receiving data. - * @retval kStatus_LPUART_NoiseError Noise error happened while receiving data. - * @retval kStatus_LPUART_FramingError Framing error happened while receiving data. - * @retval kStatus_LPUART_ParityError Parity error happened while receiving data. - * @retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * @retval kStatus_Success Successfully received all data. - */ -status_t LPUART_ReadBlocking(LPUART_Type *base, uint8_t *data, size_t length); - -/*! - * @brief Reads the receiver data register in 9bit or 10bit mode. - * - * @note This function only support 9bit or 10bit transfer. - * - * @param base LPUART peripheral base address. - * @param data Start address of the buffer to store the received data by 16bit, only 10bit is valid. - * @param length Size of the buffer. - * @retval kStatus_LPUART_RxHardwareOverrun Receiver overrun happened while receiving data. - * @retval kStatus_LPUART_NoiseError Noise error happened while receiving data. - * @retval kStatus_LPUART_FramingError Framing error happened while receiving data. - * @retval kStatus_LPUART_ParityError Parity error happened while receiving data. - * @retval kStatus_LPUART_Timeout Transmission timed out and was aborted. - * @retval kStatus_Success Successfully received all data. - */ -status_t LPUART_ReadBlocking16bit(LPUART_Type *base, uint16_t *data, size_t length); - -/*! @} */ - -/*! - * @name Transactional - * @{ - */ - -/*! - * @brief Initializes the LPUART handle. - * - * This function initializes the LPUART handle, which can be used for other LPUART - * transactional APIs. Usually, for a specified LPUART instance, - * call this API once to get the initialized handle. - * - * The LPUART driver supports the "background" receiving, which means that user can set up - * an RX ring buffer optionally. Data received is stored into the ring buffer even when the - * user doesn't call the LPUART_TransferReceiveNonBlocking() API. If there is already data received - * in the ring buffer, the user can get the received data from the ring buffer directly. - * The ring buffer is disabled if passing NULL as @p ringBuffer. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param callback Callback function. - * @param userData User data. - */ -void LPUART_TransferCreateHandle(LPUART_Type *base, - lpuart_handle_t *handle, - lpuart_transfer_callback_t callback, - void *userData); -/*! - * @brief Transmits a buffer of data using the interrupt method. - * - * This function send data using an interrupt method. This is a non-blocking function, which - * returns directly without waiting for all data written to the transmitter register. When - * all data is written to the TX register in the ISR, the LPUART driver calls the callback - * function and passes the @ref kStatus_LPUART_TxIdle as status parameter. - * - * @note The kStatus_LPUART_TxIdle is passed to the upper layer when all data are written - * to the TX register. However, there is no check to ensure that all the data sent out. Before disabling the TX, - * check the kLPUART_TransmissionCompleteFlag to ensure that the transmit is finished. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param xfer LPUART transfer structure, see #lpuart_transfer_t. - * @retval kStatus_Success Successfully start the data transmission. - * @retval kStatus_LPUART_TxBusy Previous transmission still not finished, data not all written to the TX register. - * @retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_TransferSendNonBlocking(LPUART_Type *base, lpuart_handle_t *handle, lpuart_transfer_t *xfer); - -/*! - * @brief Sets up the RX ring buffer. - * - * This function sets up the RX ring buffer to a specific UART handle. - * - * When the RX ring buffer is used, data received is stored into the ring buffer even when - * the user doesn't call the UART_TransferReceiveNonBlocking() API. If there is already data received - * in the ring buffer, the user can get the received data from the ring buffer directly. - * - * @note When using RX ring buffer, one byte is reserved for internal use. In other - * words, if @p ringBufferSize is 32, then only 31 bytes are used for saving data. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param ringBuffer Start address of ring buffer for background receiving. Pass NULL to disable the ring buffer. - * @param ringBufferSize size of the ring buffer. - */ -void LPUART_TransferStartRingBuffer(LPUART_Type *base, - lpuart_handle_t *handle, - uint8_t *ringBuffer, - size_t ringBufferSize); - -/*! - * @brief Aborts the background transfer and uninstalls the ring buffer. - * - * This function aborts the background transfer and uninstalls the ring buffer. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - */ -void LPUART_TransferStopRingBuffer(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief Get the length of received data in RX ring buffer. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @return Length of received data in RX ring buffer. - */ -size_t LPUART_TransferGetRxRingBufferLength(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief Aborts the interrupt-driven data transmit. - * - * This function aborts the interrupt driven data sending. The user can get the remainBtyes to find out - * how many bytes are not sent out. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - */ -void LPUART_TransferAbortSend(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief Gets the number of bytes that have been sent out to bus. - * - * This function gets the number of bytes that have been sent out to bus by an interrupt method. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param count Send bytes count. - * @retval kStatus_NoTransferInProgress No send in progress. - * @retval kStatus_InvalidArgument Parameter is invalid. - * @retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetSendCount(LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count); - -/*! - * @brief Receives a buffer of data using the interrupt method. - * - * This function receives data using an interrupt method. This is a non-blocking function - * which returns without waiting to ensure that all data are received. - * If the RX ring buffer is used and not empty, the data in the ring buffer is copied and - * the parameter @p receivedBytes shows how many bytes are copied from the ring buffer. - * After copying, if the data in the ring buffer is not enough for read, the receive - * request is saved by the LPUART driver. When the new data arrives, the receive request - * is serviced first. When all data is received, the LPUART driver notifies the upper layer - * through a callback function and passes a status parameter kStatus_UART_RxIdle. - * For example, the upper layer needs 10 bytes but there are only 5 bytes in ring buffer. - * The 5 bytes are copied to xfer->data, which returns with the - * parameter @p receivedBytes set to 5. For the remaining 5 bytes, the newly arrived data is - * saved from xfer->data[5]. When 5 bytes are received, the LPUART driver notifies the upper layer. - * If the RX ring buffer is not enabled, this function enables the RX and RX interrupt - * to receive data to xfer->data. When all data is received, the upper layer is notified. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param xfer LPUART transfer structure, see uart_transfer_t. - * @param receivedBytes Bytes received from the ring buffer directly. - * @retval kStatus_Success Successfully queue the transfer into the transmit queue. - * @retval kStatus_LPUART_RxBusy Previous receive request is not finished. - * @retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_TransferReceiveNonBlocking(LPUART_Type *base, - lpuart_handle_t *handle, - lpuart_transfer_t *xfer, - size_t *receivedBytes); - -/*! - * @brief Aborts the interrupt-driven data receiving. - * - * This function aborts the interrupt-driven data receiving. The user can get the remainBytes to find out - * how many bytes not received yet. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - */ -void LPUART_TransferAbortReceive(LPUART_Type *base, lpuart_handle_t *handle); - -/*! - * @brief Gets the number of bytes that have been received. - * - * This function gets the number of bytes that have been received. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param count Receive bytes count. - * @retval kStatus_NoTransferInProgress No receive in progress. - * @retval kStatus_InvalidArgument Parameter is invalid. - * @retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetReceiveCount(LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count); - -/*! - * @brief LPUART IRQ handle function. - * - * This function handles the LPUART transmit and receive IRQ request. - * - * @param instance LPUART instance. - * @param irqHandle LPUART handle pointer. - */ -void LPUART_TransferHandleIRQ(uint32_t instance, void *irqHandle); - -/*! - * @brief LPUART Error IRQ handle function. - * - * This function handles the LPUART error IRQ request. - * - * @param base LPUART peripheral base address. - * @param irqHandle LPUART handle pointer. - */ -void LPUART_TransferHandleErrorIRQ(LPUART_Type *base, void *irqHandle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_LPUART_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpuart_edma.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpuart_edma.c deleted file mode 100644 index ec858aed8c4..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpuart_edma.c +++ /dev/null @@ -1,518 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpuart_edma.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpflexcomm_lpuart_edma" -#endif - -/*base, false); - - /* Stop transfer. */ - EDMA_AbortTransfer(handle); - - /* Enable tx complete interrupt */ - LPUART_EnableInterrupts(lpuartPrivateHandle->base, (uint32_t)kLPUART_TransmissionCompleteInterruptEnable); - } -} - -static void LPUART_ReceiveEDMACallback(edma_handle_t *handle, void *param, bool transferDone, uint32_t tcds) -{ - assert(NULL != param); - - lpuart_edma_private_handle_t *lpuartPrivateHandle = (lpuart_edma_private_handle_t *)param; - - /* Avoid warning for unused parameters. */ - handle = handle; - tcds = tcds; - - if (transferDone) - { - /* Disable transfer. */ - LPUART_TransferAbortReceiveEDMA(lpuartPrivateHandle->base, lpuartPrivateHandle->handle); - - if (NULL != lpuartPrivateHandle->handle->callback) - { - lpuartPrivateHandle->handle->callback(lpuartPrivateHandle->base, lpuartPrivateHandle->handle, - kStatus_LPUART_RxIdle, lpuartPrivateHandle->handle->userData); - } - } -} - -/*! - * brief Initializes the LPUART handle which is used in transactional functions. - * - * note This function disables all LPUART interrupts. - * - * param base LPUART peripheral base address. - * param handle Pointer to lpuart_edma_handle_t structure. - * param callback Callback function. - * param userData User data. - * param txEdmaHandle User requested DMA handle for TX DMA transfer. - * param rxEdmaHandle User requested DMA handle for RX DMA transfer. - */ -void LPUART_TransferCreateHandleEDMA(LPUART_Type *base, - lpuart_edma_handle_t *handle, - lpuart_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *txEdmaHandle, - edma_handle_t *rxEdmaHandle) -{ - assert(NULL != handle); - - uint32_t instance = LPUART_GetInstance(base); - lpuart_to_lpflexcomm_edma_t handler; - - s_lpuartEdmaPrivateHandle[instance].base = base; - s_lpuartEdmaPrivateHandle[instance].handle = handle; - - (void)memset(handle, 0, sizeof(*handle)); - - handle->rxState = (uint8_t)kLPUART_RxIdle; - handle->txState = (uint8_t)kLPUART_TxIdle; - - handle->rxEdmaHandle = rxEdmaHandle; - handle->txEdmaHandle = txEdmaHandle; - - handle->callback = callback; - handle->userData = userData; - -#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO - /* Note: - Take care of the RX FIFO, EDMA request only assert when received bytes - equal or more than RX water mark, there is potential issue if RX water - mark larger than 1. - For example, if RX FIFO water mark is 2, upper layer needs 5 bytes and - 5 bytes are received. the last byte will be saved in FIFO but not trigger - EDMA transfer because the water mark is 2. - */ - if (NULL != rxEdmaHandle) - { - base->WATER &= (~LPUART_WATER_RXWATER_MASK); - } -#endif - handler.lpuart_handler = LPUART_TransferEdmaHandleIRQ; - /* Save the handle in global variables to support the double weak mechanism. */ - LP_FLEXCOMM_SetIRQHandler(instance, handler.lpflexcomm_handler, handle, LP_FLEXCOMM_PERIPH_LPUART); - /* Disable all LPUART internal interrupts */ - LPUART_DisableInterrupts(base, (uint32_t)kLPUART_AllInterruptEnable); - /* Enable interrupt in NVIC. */ -#if defined(FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ) && FSL_FEATURE_LPUART_HAS_SEPARATE_RX_TX_IRQ - (void)EnableIRQ(s_lpuartTxIRQ[instance]); -#else - (void)EnableIRQ(s_lpuartIRQ[instance]); -#endif - - /* Configure TX. */ - if (NULL != txEdmaHandle) - { - EDMA_SetCallback(handle->txEdmaHandle, LPUART_SendEDMACallback, &s_lpuartEdmaPrivateHandle[instance]); - } - - /* Configure RX. */ - if (NULL != rxEdmaHandle) - { - EDMA_SetCallback(handle->rxEdmaHandle, LPUART_ReceiveEDMACallback, &s_lpuartEdmaPrivateHandle[instance]); - } -} - -/*! - * brief Sends data using eDMA. - * - * This function sends data using eDMA. This is a non-blocking function, which returns - * right away. When all data is sent, the send callback function is called. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param xfer LPUART eDMA transfer structure. See #lpuart_transfer_t. - * retval kStatus_Success if succeed, others failed. - * retval kStatus_LPUART_TxBusy Previous transfer on going. - * retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_SendEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, lpuart_transfer_t *xfer) -{ - assert(NULL != handle); - assert(NULL != handle->txEdmaHandle); - assert(NULL != xfer); - assert(NULL != xfer->data); - assert(0U != xfer->dataSize); - - edma_transfer_config_t xferConfig; - status_t status; - - /* If previous TX not finished. */ - if ((uint8_t)kLPUART_TxBusy == handle->txState) - { - status = kStatus_LPUART_TxBusy; - } - else - { - handle->txState = (uint8_t)kLPUART_TxBusy; - handle->txDataSizeAll = xfer->dataSize; - - /* Prepare transfer. */ - EDMA_PrepareTransfer(&xferConfig, xfer->data, sizeof(uint8_t), - (void *)(uint32_t *)LPUART_GetDataRegisterAddress(base), sizeof(uint8_t), sizeof(uint8_t), - xfer->dataSize, kEDMA_MemoryToPeripheral); - - /* Store the initially configured eDMA minor byte transfer count into the LPUART handle */ - handle->nbytes = (uint8_t)sizeof(uint8_t); - - /* Submit transfer. */ - if (kStatus_Success != - EDMA_SubmitTransfer(handle->txEdmaHandle, (const edma_transfer_config_t *)(uint32_t)&xferConfig)) - { - return kStatus_Fail; - } - EDMA_StartTransfer(handle->txEdmaHandle); - - /* Enable LPUART TX EDMA. */ - LPUART_EnableTxDMA(base, true); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Receives data using eDMA. - * - * This function receives data using eDMA. This is non-blocking function, which returns - * right away. When all data is received, the receive callback function is called. - * - * param base LPUART peripheral base address. - * param handle Pointer to lpuart_edma_handle_t structure. - * param xfer LPUART eDMA transfer structure, see #lpuart_transfer_t. - * retval kStatus_Success if succeed, others fail. - * retval kStatus_LPUART_RxBusy Previous transfer ongoing. - * retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_ReceiveEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, lpuart_transfer_t *xfer) -{ - assert(NULL != handle); - assert(NULL != handle->rxEdmaHandle); - assert(NULL != xfer); - assert(NULL != xfer->data); - assert(0U != xfer->dataSize); - - edma_transfer_config_t xferConfig; - status_t status; - - /* If previous RX not finished. */ - if ((uint8_t)kLPUART_RxBusy == handle->rxState) - { - status = kStatus_LPUART_RxBusy; - } - else - { - handle->rxState = (uint8_t)kLPUART_RxBusy; - handle->rxDataSizeAll = xfer->dataSize; - - /* Prepare transfer. */ - EDMA_PrepareTransfer(&xferConfig, (void *)(uint32_t *)LPUART_GetDataRegisterAddress(base), sizeof(uint8_t), - xfer->data, sizeof(uint8_t), sizeof(uint8_t), xfer->dataSize, kEDMA_PeripheralToMemory); - - /* Store the initially configured eDMA minor byte transfer count into the LPUART handle */ - handle->nbytes = (uint8_t)sizeof(uint8_t); - - /* Submit transfer. */ - if (kStatus_Success != - EDMA_SubmitTransfer(handle->rxEdmaHandle, (const edma_transfer_config_t *)(uint32_t)&xferConfig)) - { - return kStatus_Fail; - } - EDMA_StartTransfer(handle->rxEdmaHandle); - - /* Enable LPUART RX EDMA. */ - LPUART_EnableRxDMA(base, true); - - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Aborts the sent data using eDMA. - * - * This function aborts the sent data using eDMA. - * - * param base LPUART peripheral base address. - * param handle Pointer to lpuart_edma_handle_t structure. - */ -void LPUART_TransferAbortSendEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle) -{ - assert(NULL != handle); - assert(NULL != handle->txEdmaHandle); - - /* Disable LPUART TX EDMA. */ - LPUART_EnableTxDMA(base, false); - - /* Stop transfer. */ - EDMA_AbortTransfer(handle->txEdmaHandle); - - handle->txState = (uint8_t)kLPUART_TxIdle; -} - -/*! - * brief Aborts the received data using eDMA. - * - * This function aborts the received data using eDMA. - * - * param base LPUART peripheral base address. - * param handle Pointer to lpuart_edma_handle_t structure. - */ -void LPUART_TransferAbortReceiveEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle) -{ - assert(NULL != handle); - assert(NULL != handle->rxEdmaHandle); - - /* Disable LPUART RX EDMA. */ - LPUART_EnableRxDMA(base, false); - - /* Stop transfer. */ - EDMA_AbortTransfer(handle->rxEdmaHandle); - - handle->rxState = (uint8_t)kLPUART_RxIdle; -} - -/*! - * brief Gets the number of received bytes. - * - * This function gets the number of received bytes. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param count Receive bytes count. - * retval kStatus_NoTransferInProgress No receive in progress. - * retval kStatus_InvalidArgument Parameter is invalid. - * retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetReceiveCountEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, uint32_t *count) -{ - assert(NULL != handle); - assert(NULL != handle->rxEdmaHandle); - assert(NULL != count); - - if ((uint8_t)kLPUART_RxIdle == handle->rxState) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->rxDataSizeAll - - ((uint32_t)handle->nbytes * - EDMA_GetRemainingMajorLoopCount(handle->rxEdmaHandle->base, handle->rxEdmaHandle->channel)); - - return kStatus_Success; -} - -/*! - * brief Gets the number of bytes written to the LPUART TX register. - * - * This function gets the number of bytes written to the LPUART TX - * register by DMA. - * - * param base LPUART peripheral base address. - * param handle LPUART handle pointer. - * param count Send bytes count. - * retval kStatus_NoTransferInProgress No send in progress. - * retval kStatus_InvalidArgument Parameter is invalid. - * retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetSendCountEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, uint32_t *count) -{ - assert(NULL != handle); - assert(NULL != handle->txEdmaHandle); - assert(NULL != count); - - if ((uint8_t)kLPUART_TxIdle == handle->txState) - { - return kStatus_NoTransferInProgress; - } - - *count = handle->txDataSizeAll - - ((uint32_t)handle->nbytes * - EDMA_GetRemainingMajorLoopCount(handle->txEdmaHandle->base, handle->txEdmaHandle->channel)); - - return kStatus_Success; -} - -/*! - * brief LPUART eDMA IRQ handle function. - * - * This function handles the LPUART tx complete IRQ request and invoke user callback. - * It is not set to static so that it can be used in user application. - * note This function is used as default IRQ handler by double weak mechanism. - * If user's specific IRQ handler is implemented, make sure this function is invoked in the handler. - * - * param instance LPUART peripheral index. - * param lpuartEdmaHandle LPUART handle pointer. - */ -void LPUART_TransferEdmaHandleIRQ(uint32_t instance, void *lpuartEdmaHandle) -{ - assert(lpuartEdmaHandle != NULL); - assert(instance < ARRAY_SIZE(s_lpuartBases)); - LPUART_Type *base = s_lpuartBases[instance]; - - if (((uint32_t)kLPUART_TransmissionCompleteFlag & LPUART_GetStatusFlags(base)) != 0U) - { - lpuart_edma_handle_t *handle = (lpuart_edma_handle_t *)lpuartEdmaHandle; - - /* Disable tx complete interrupt */ - LPUART_DisableInterrupts(base, (uint32_t)kLPUART_TransmissionCompleteInterruptEnable); - - handle->txState = (uint8_t)kLPUART_TxIdle; - - if (handle->callback != NULL) - { - handle->callback(base, handle, kStatus_LPUART_TxIdle, handle->userData); - } - } -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpuart_edma.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpuart_edma.h deleted file mode 100644 index 47b83032cee..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpuart_edma.h +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_LPUART_EDMA_H_ -#define FSL_LPUART_EDMA_H_ - -#include "fsl_lpuart.h" -#include "fsl_edma.h" - -/*! - * @addtogroup lpuart_edma_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief LPUART EDMA driver version. */ -#define FSL_LPUART_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) -/*! @} */ - -/* Forward declaration of the handle typedef. */ -typedef struct _lpuart_edma_handle lpuart_edma_handle_t; - -/*! @brief LPUART transfer callback function. */ -typedef void (*lpuart_edma_transfer_callback_t)(LPUART_Type *base, - lpuart_edma_handle_t *handle, - status_t status, - void *userData); - -/*! - * @brief LPUART eDMA handle - */ -struct _lpuart_edma_handle -{ - lpuart_edma_transfer_callback_t callback; /*!< Callback function. */ - void *userData; /*!< LPUART callback function parameter.*/ - size_t rxDataSizeAll; /*!< Size of the data to receive. */ - size_t txDataSizeAll; /*!< Size of the data to send out. */ - - edma_handle_t *txEdmaHandle; /*!< The eDMA TX channel used. */ - edma_handle_t *rxEdmaHandle; /*!< The eDMA RX channel used. */ - - uint8_t nbytes; /*!< eDMA minor byte transfer count initially configured. */ - - volatile uint8_t txState; /*!< TX transfer state. */ - volatile uint8_t rxState; /*!< RX transfer state */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name eDMA transactional - * @{ - */ - -/*! - * @brief Initializes the LPUART handle which is used in transactional functions. - * - * @note This function disables all LPUART interrupts. - * - * @param base LPUART peripheral base address. - * @param handle Pointer to lpuart_edma_handle_t structure. - * @param callback Callback function. - * @param userData User data. - * @param txEdmaHandle User requested DMA handle for TX DMA transfer. - * @param rxEdmaHandle User requested DMA handle for RX DMA transfer. - */ -void LPUART_TransferCreateHandleEDMA(LPUART_Type *base, - lpuart_edma_handle_t *handle, - lpuart_edma_transfer_callback_t callback, - void *userData, - edma_handle_t *txEdmaHandle, - edma_handle_t *rxEdmaHandle); - -/*! - * @brief Sends data using eDMA. - * - * This function sends data using eDMA. This is a non-blocking function, which returns - * right away. When all data is sent, the send callback function is called. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param xfer LPUART eDMA transfer structure. See #lpuart_transfer_t. - * @retval kStatus_Success if succeed, others failed. - * @retval kStatus_LPUART_TxBusy Previous transfer on going. - * @retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_SendEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, lpuart_transfer_t *xfer); - -/*! - * @brief Receives data using eDMA. - * - * This function receives data using eDMA. This is non-blocking function, which returns - * right away. When all data is received, the receive callback function is called. - * - * @param base LPUART peripheral base address. - * @param handle Pointer to lpuart_edma_handle_t structure. - * @param xfer LPUART eDMA transfer structure, see #lpuart_transfer_t. - * @retval kStatus_Success if succeed, others fail. - * @retval kStatus_LPUART_RxBusy Previous transfer ongoing. - * @retval kStatus_InvalidArgument Invalid argument. - */ -status_t LPUART_ReceiveEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, lpuart_transfer_t *xfer); - -/*! - * @brief Aborts the sent data using eDMA. - * - * This function aborts the sent data using eDMA. - * - * @param base LPUART peripheral base address. - * @param handle Pointer to lpuart_edma_handle_t structure. - */ -void LPUART_TransferAbortSendEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle); - -/*! - * @brief Aborts the received data using eDMA. - * - * This function aborts the received data using eDMA. - * - * @param base LPUART peripheral base address. - * @param handle Pointer to lpuart_edma_handle_t structure. - */ -void LPUART_TransferAbortReceiveEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle); - -/*! - * @brief Gets the number of bytes written to the LPUART TX register. - * - * This function gets the number of bytes written to the LPUART TX - * register by DMA. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param count Send bytes count. - * @retval kStatus_NoTransferInProgress No send in progress. - * @retval kStatus_InvalidArgument Parameter is invalid. - * @retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetSendCountEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, uint32_t *count); - -/*! - * @brief Gets the number of received bytes. - * - * This function gets the number of received bytes. - * - * @param base LPUART peripheral base address. - * @param handle LPUART handle pointer. - * @param count Receive bytes count. - * @retval kStatus_NoTransferInProgress No receive in progress. - * @retval kStatus_InvalidArgument Parameter is invalid. - * @retval kStatus_Success Get successfully through the parameter \p count; - */ -status_t LPUART_TransferGetReceiveCountEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, uint32_t *count); - -/*! - * @brief LPUART eDMA IRQ handle function. - * - * This function handles the LPUART tx complete IRQ request and invoke user callback. - * It is not set to static so that it can be used in user application. - * @note This function is used as default IRQ handler by double weak mechanism. - * If user's specific IRQ handler is implemented, make sure this function is invoked in the handler. - * - * @param instance LPUART peripheral index. - * @param lpuartEdmaHandle LPUART handle pointer. - */ -void LPUART_TransferEdmaHandleIRQ(uint32_t instance, void *lpuartEdmaHandle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_LPUART_EDMA_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpuart_freertos.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpuart_freertos.c deleted file mode 100644 index f78a4dc9faa..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpuart_freertos.c +++ /dev/null @@ -1,489 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_lpuart_freertos.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpflexcomm_lpuart_freertos" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -static void LPUART_RTOS_Callback(LPUART_Type *base, lpuart_handle_t *state, status_t status, void *param) -{ - lpuart_rtos_handle_t *handle = (lpuart_rtos_handle_t *)param; - BaseType_t xHigherPriorityTaskWoken, xResult; - - xHigherPriorityTaskWoken = pdFALSE; - xResult = pdFAIL; - - if (status == kStatus_LPUART_RxIdle) - { - xResult = xEventGroupSetBitsFromISR(handle->rxEvent, RTOS_LPUART_RX_COMPLETE, &xHigherPriorityTaskWoken); - } - else if (status == kStatus_LPUART_TxIdle) - { - xResult = xEventGroupSetBitsFromISR(handle->txEvent, RTOS_LPUART_TX_COMPLETE, &xHigherPriorityTaskWoken); - } - else if (status == kStatus_LPUART_RxRingBufferOverrun) - { - xResult = - xEventGroupSetBitsFromISR(handle->rxEvent, RTOS_LPUART_RING_BUFFER_OVERRUN, &xHigherPriorityTaskWoken); - } - else if (status == kStatus_LPUART_RxHardwareOverrun) - { - /* Clear Overrun flag (OR) in LPUART STAT register */ - (void)LPUART_ClearStatusFlags(base, (uint32_t)kLPUART_RxOverrunFlag); - xResult = - xEventGroupSetBitsFromISR(handle->rxEvent, RTOS_LPUART_HARDWARE_BUFFER_OVERRUN, &xHigherPriorityTaskWoken); - } - else - { - xResult = pdFAIL; - } - - if (xResult != pdFAIL) - { - portYIELD_FROM_ISR(xHigherPriorityTaskWoken); - } -} - -/*FUNCTION********************************************************************** - * - * Function Name : LPUART_RTOS_Init - * Description : Initializes the LPUART instance for application - * - *END**************************************************************************/ -/*! - * brief Initializes an LPUART instance for operation in RTOS. - * - * param handle The RTOS LPUART handle, the pointer to an allocated space for RTOS context. - * param t_handle The pointer to an allocated space to store the transactional layer internal state. - * param cfg The pointer to the parameters required to configure the LPUART after initialization. - * return kStatus_Success, others failed - */ -int LPUART_RTOS_Init(lpuart_rtos_handle_t *handle, lpuart_handle_t *t_handle, const lpuart_rtos_config_t *cfg) -{ - status_t status; - lpuart_config_t defcfg; - - if (NULL == handle) - { - return kStatus_InvalidArgument; - } - if (NULL == t_handle) - { - return kStatus_InvalidArgument; - } - if (NULL == cfg) - { - return kStatus_InvalidArgument; - } - if (NULL == cfg->base) - { - return kStatus_InvalidArgument; - } - if (0u == cfg->srcclk) - { - return kStatus_InvalidArgument; - } - if (0u == cfg->baudrate) - { - return kStatus_InvalidArgument; - } - - handle->base = cfg->base; - handle->t_state = t_handle; - handle->rx_timeout_constant_ms = cfg->rx_timeout_constant_ms; - handle->rx_timeout_multiplier_ms = cfg->rx_timeout_multiplier_ms; - handle->tx_timeout_constant_ms = cfg->tx_timeout_constant_ms; - handle->tx_timeout_multiplier_ms = cfg->tx_timeout_multiplier_ms; - -#if (configSUPPORT_STATIC_ALLOCATION == 1) - handle->txSemaphore = xSemaphoreCreateMutexStatic(&handle->txSemaphoreBuffer); -#else - handle->txSemaphore = xSemaphoreCreateMutex(); -#endif - if (NULL == handle->txSemaphore) - { - return kStatus_Fail; - } -#if (configSUPPORT_STATIC_ALLOCATION == 1) - handle->rxSemaphore = xSemaphoreCreateMutexStatic(&handle->rxSemaphoreBuffer); -#else - handle->rxSemaphore = xSemaphoreCreateMutex(); -#endif - if (NULL == handle->rxSemaphore) - { - vSemaphoreDelete(handle->txSemaphore); - return kStatus_Fail; - } -#if (configSUPPORT_STATIC_ALLOCATION == 1) - handle->txEvent = xEventGroupCreateStatic(&handle->txEventBuffer); -#else - handle->txEvent = xEventGroupCreate(); -#endif - if (NULL == handle->txEvent) - { - vSemaphoreDelete(handle->rxSemaphore); - vSemaphoreDelete(handle->txSemaphore); - return kStatus_Fail; - } -#if (configSUPPORT_STATIC_ALLOCATION == 1) - handle->rxEvent = xEventGroupCreateStatic(&handle->rxEventBuffer); -#else - handle->rxEvent = xEventGroupCreate(); -#endif - if (NULL == handle->rxEvent) - { - vEventGroupDelete(handle->txEvent); - vSemaphoreDelete(handle->rxSemaphore); - vSemaphoreDelete(handle->txSemaphore); - return kStatus_Fail; - } - - LPUART_GetDefaultConfig(&defcfg); - - defcfg.baudRate_Bps = cfg->baudrate; - defcfg.parityMode = cfg->parity; - defcfg.stopBitCount = cfg->stopbits; -#if defined(FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT) && FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT - defcfg.enableRxRTS = cfg->enableRxRTS; - defcfg.enableTxCTS = cfg->enableTxCTS; - defcfg.txCtsSource = cfg->txCtsSource; - defcfg.txCtsConfig = cfg->txCtsConfig; -#endif - status = LPUART_Init(handle->base, &defcfg, cfg->srcclk); - if (status != kStatus_Success) - { - vEventGroupDelete(handle->rxEvent); - vEventGroupDelete(handle->txEvent); - vSemaphoreDelete(handle->rxSemaphore); - vSemaphoreDelete(handle->txSemaphore); - return kStatus_Fail; - } - LPUART_TransferCreateHandle(handle->base, handle->t_state, LPUART_RTOS_Callback, handle); - LPUART_TransferStartRingBuffer(handle->base, handle->t_state, cfg->buffer, cfg->buffer_size); - - LPUART_EnableTx(handle->base, true); - LPUART_EnableRx(handle->base, true); - - return kStatus_Success; -} - -/*FUNCTION********************************************************************** - * - * Function Name : LPUART_RTOS_Deinit - * Description : Deinitializes the LPUART instance and frees resources - * - *END**************************************************************************/ -/*! - * brief Deinitializes an LPUART instance for operation. - * - * This function deinitializes the LPUART module, sets all register value to the reset value, - * and releases the resources. - * - * param handle The RTOS LPUART handle. - */ -int LPUART_RTOS_Deinit(lpuart_rtos_handle_t *handle) -{ - LPUART_Deinit(handle->base); - - vEventGroupDelete(handle->txEvent); - vEventGroupDelete(handle->rxEvent); - - /* Give the semaphore. This is for functional safety */ - (void)xSemaphoreGive(handle->txSemaphore); - (void)xSemaphoreGive(handle->rxSemaphore); - - vSemaphoreDelete(handle->txSemaphore); - vSemaphoreDelete(handle->rxSemaphore); - - /* Invalidate the handle */ - handle->base = NULL; - handle->t_state = NULL; - - return 0; -} - -/*FUNCTION********************************************************************** - * - * Function Name : UART_RTOS_Send - * Description : Send chars over LPUART - * - *END**************************************************************************/ -/*! - * brief Sends data in the background. - * - * This function sends data. It is an synchronous API. - * If the hardware buffer is full, the task is in the blocked state. - * - * param handle The RTOS LPUART handle. - * param buffer The pointer to buffer to send. - * param length The number of bytes to send. - */ -int LPUART_RTOS_Send(lpuart_rtos_handle_t *handle, uint8_t *buffer, uint32_t length) -{ - EventBits_t ev; - int retval = kStatus_Fail; - status_t status; - const TickType_t txTickTimeout = - (length * handle->tx_timeout_multiplier_ms + handle->tx_timeout_constant_ms) / portTICK_PERIOD_MS; - - if (NULL == handle->base) - { - /* Invalid handle. */ - return kStatus_Fail; - } - if (0u == length) - { - return kStatus_Success; - } - if (NULL == buffer) - { - return kStatus_InvalidArgument; - } - - if (pdFALSE == xSemaphoreTake(handle->txSemaphore, 0u)) - { - /* We could not take the semaphore, exit with 0 data received */ - return kStatus_Fail; - } - - handle->txTransfer.data = (uint8_t *)buffer; - handle->txTransfer.dataSize = (uint32_t)length; - - /* Non-blocking call */ - status = LPUART_TransferSendNonBlocking(handle->base, handle->t_state, &handle->txTransfer); - if (status != kStatus_Success) - { - (void)xSemaphoreGive(handle->txSemaphore); - return kStatus_Fail; - } - - ev = xEventGroupWaitBits(handle->txEvent, RTOS_LPUART_TX_COMPLETE, pdTRUE, pdFALSE, - (txTickTimeout > 0u) ? txTickTimeout : portMAX_DELAY); - if ((ev & RTOS_LPUART_TX_COMPLETE) != 0u) - { - retval = kStatus_Success; - } - else /* timeout expired or unknown error*/ - { - if (txTickTimeout > 0u) - { - LPUART_TransferAbortSend(handle->base, handle->t_state); - (void)xEventGroupClearBits(handle->txEvent, RTOS_LPUART_TX_COMPLETE); - retval = kStatus_Timeout; - } - else - { - retval = kStatus_Fail; - } - } - - if (pdFALSE == xSemaphoreGive(handle->txSemaphore)) - { - /* We could not post the semaphore, exit with error */ - retval = kStatus_Fail; - } - - return retval; -} - -/*FUNCTION********************************************************************** - * - * Function Name : LPUART_RTOS_Receive - * Description : Receives chars from LPUART - * - *END**************************************************************************/ -/*! - * brief Receives data. - * - * This function receives data from LPUART. It is an synchronous API. If any data is immediately available - * it is returned immediately and the number of bytes received. - * - * param handle The RTOS LPUART handle. - * param buffer The pointer to buffer where to write received data. - * param length The number of bytes to receive. - * param received The pointer to a variable of size_t where the number of received data is filled. - */ -int LPUART_RTOS_Receive(lpuart_rtos_handle_t *handle, uint8_t *buffer, uint32_t length, size_t *received) -{ - EventBits_t ev; - size_t n = 0u; - int retval = kStatus_Fail; - uint32_t local_received = 0u; - status_t status; - const TickType_t rxTickTimeout = - (length * handle->rx_timeout_multiplier_ms + handle->rx_timeout_constant_ms) / portTICK_PERIOD_MS; - - if (NULL == handle->base) - { - /* Invalid handle. */ - return kStatus_Fail; - } - if (0u == length) - { - if (received != NULL) - { - *received = n; - } - return kStatus_Success; - } - if (NULL == buffer) - { - return kStatus_InvalidArgument; - } - - /* New transfer can be performed only after current one is finished */ - if (pdFALSE == xSemaphoreTake(handle->rxSemaphore, portMAX_DELAY)) - { - /* We could not take the semaphore, exit with 0 data received */ - return kStatus_Fail; - } - - handle->rxTransfer.data = buffer; - handle->rxTransfer.dataSize = (uint32_t)length; - - /* Non-blocking call */ - status = LPUART_TransferReceiveNonBlocking(handle->base, handle->t_state, &handle->rxTransfer, &n); - if (status != kStatus_Success) - { - (void)xSemaphoreGive(handle->rxSemaphore); - return kStatus_Fail; - } - - ev = xEventGroupWaitBits( - handle->rxEvent, - RTOS_LPUART_RX_COMPLETE | RTOS_LPUART_RING_BUFFER_OVERRUN | RTOS_LPUART_HARDWARE_BUFFER_OVERRUN, pdTRUE, - pdFALSE, (rxTickTimeout > 0u) ? rxTickTimeout : portMAX_DELAY); - if ((ev & RTOS_LPUART_HARDWARE_BUFFER_OVERRUN) != 0u) - { - /* Stop data transfer to application buffer, ring buffer is still active */ - LPUART_TransferAbortReceive(handle->base, handle->t_state); - /* Prevent false indication of successful transfer in next call of LPUART_RTOS_Receive. - RTOS_LPUART_COMPLETE flag could be set meanwhile overrun is handled */ - (void)xEventGroupClearBits(handle->rxEvent, RTOS_LPUART_RX_COMPLETE); - retval = kStatus_LPUART_RxHardwareOverrun; - local_received = 0u; - } - else if ((ev & RTOS_LPUART_RING_BUFFER_OVERRUN) != 0u) - { - /* Stop data transfer to application buffer, ring buffer is still active */ - LPUART_TransferAbortReceive(handle->base, handle->t_state); - /* Prevent false indication of successful transfer in next call of LPUART_RTOS_Receive. - RTOS_LPUART_COMPLETE flag could be set meanwhile overrun is handled */ - (void)xEventGroupClearBits(handle->rxEvent, RTOS_LPUART_RX_COMPLETE); - retval = kStatus_LPUART_RxRingBufferOverrun; - local_received = 0u; - } - else if ((ev & RTOS_LPUART_RX_COMPLETE) != 0u) - { - retval = kStatus_Success; - local_received = length; - } - else /* timeout expired or unknown error*/ - { - if (rxTickTimeout > 0u) - { - (void)LPUART_TransferGetReceiveCount(handle->base, handle->t_state, &local_received); - LPUART_TransferAbortReceive(handle->base, handle->t_state); - (void)xEventGroupClearBits(handle->rxEvent, RTOS_LPUART_RX_COMPLETE); - retval = kStatus_Timeout; - } - else - { - retval = kStatus_LPUART_Error; - local_received = 0u; - } - } - - /* Prevent repetitive NULL check */ - if (received != NULL) - { - *received = (size_t)local_received; - } - - /* Enable next transfer. Current one is finished */ - if (pdFALSE == xSemaphoreGive(handle->rxSemaphore)) - { - /* We could not post the semaphore, exit with error */ - retval = kStatus_Fail; - } - return retval; -} - -/*FUNCTION********************************************************************** - * - * Function Name : LPUART_RTOS_SetRxTimeout - * Description : Modify receive timeout value in alreaty initialized LPUART RTOS handle. - * - *END**************************************************************************/ -/*! - * brief Set RX timeout in runtime - * - * This function can modify RX timeout between initialization and receive. - * - * param handle The RTOS LPUART handle. - * param rx_timeout_constant_ms RX timeout applied per receive. - * param rx_timeout_multiplier_ms RX timeout added for each byte of the receive. - */ -int LPUART_RTOS_SetRxTimeout(lpuart_rtos_handle_t *handle, - uint32_t rx_timeout_constant_ms, - uint32_t rx_timeout_multiplier_ms) -{ - if (NULL == handle) - { - return kStatus_InvalidArgument; - } - handle->rx_timeout_constant_ms = rx_timeout_constant_ms; - handle->rx_timeout_multiplier_ms = rx_timeout_multiplier_ms; - return kStatus_Success; -} - -/*FUNCTION********************************************************************** - * - * Function Name : LPUART_RTOS_SetTxTimeout - * Description : Modify send timeout value in alreaty initialized LPUART RTOS handle. - * - *END**************************************************************************/ -/*! - * brief Set TX timeout in runtime - * - * This function can modify TX timeout between initialization and send. - * - * param handle The RTOS LPUART handle. - * param tx_timeout_constant_ms TX timeout applied per transmition. - * param tx_timeout_multiplier_ms TX timeout added for each byte of the transmition. - */ -int LPUART_RTOS_SetTxTimeout(lpuart_rtos_handle_t *handle, - uint32_t tx_timeout_constant_ms, - uint32_t tx_timeout_multiplier_ms) -{ - if (NULL == handle) - { - return kStatus_InvalidArgument; - } - handle->tx_timeout_constant_ms = tx_timeout_constant_ms; - handle->tx_timeout_multiplier_ms = tx_timeout_multiplier_ms; - return kStatus_Success; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpuart_freertos.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpuart_freertos.h deleted file mode 100644 index cd7469d5a41..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_lpuart_freertos.h +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef __FSL_LPUART_FREERTOS_H__ -#define __FSL_LPUART_FREERTOS_H__ - -#include "fsl_lpuart.h" -#include "FreeRTOS.h" -#include "event_groups.h" -#include "semphr.h" - -/*! - * @addtogroup lpuart_freertos_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief LPUART FreeRTOS driver version 2.0.0. */ -#define FSL_LPUART_FREERTOS_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) -/*@}*/ - -/*! @brief LPUART RTOS configuration structure. */ -typedef struct _lpuart_rtos_config -{ - LPUART_Type *base; /*!< UART base address */ - uint32_t srcclk; /*!< UART source clock in Hz*/ - uint32_t baudrate; /*!< Desired communication speed */ - lpuart_parity_mode_t parity; /*!< Parity setting */ - lpuart_stop_bit_count_t stopbits; /*!< Number of stop bits to use */ - uint8_t *buffer; /*!< Buffer for background reception */ - uint32_t buffer_size; /*!< Size of buffer for background reception */ - /* Zero in constant and multiplier is interpreted as infinit timeout. */ - uint32_t rx_timeout_constant_ms; /*!< RX timeout applied per receive */ - uint32_t rx_timeout_multiplier_ms; /*!< RX timeout added for each byte of the receive. */ - uint32_t tx_timeout_constant_ms; /*!< TX timeout applied per transmition */ - uint32_t tx_timeout_multiplier_ms; /*!< TX timeout added for each byte of the transmition. */ -#if defined(FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT) && FSL_FEATURE_LPUART_HAS_MODEM_SUPPORT - bool enableRxRTS; /*!< RX RTS enable */ - bool enableTxCTS; /*!< TX CTS enable */ - lpuart_transmit_cts_source_t txCtsSource; /*!< TX CTS source */ - lpuart_transmit_cts_config_t txCtsConfig; /*!< TX CTS configure */ -#endif -} lpuart_rtos_config_t; - -/*! - * @cond RTOS_PRIVATE - * @name LPUART event flags - * - * This are only valid states for txEvent and rxEvent (lpuart_rtos_handle_t). - */ -/*@{*/ -/*! @brief Event flag - uart transmit complete. */ -#define RTOS_LPUART_TX_COMPLETE 0x1U -/*! @brief Event flag - uart receive complete. */ -#define RTOS_LPUART_RX_COMPLETE 0x2U -/*! @brief Event flag - ring buffer overrun. */ -#define RTOS_LPUART_RING_BUFFER_OVERRUN 0x4U -/*! @brief Event flag - hardware buffer overrun. */ -#define RTOS_LPUART_HARDWARE_BUFFER_OVERRUN 0x8U -/*@}*/ - -/*! @brief LPUART FreeRTOS transfer structure. */ -typedef struct _lpuart_rtos_handle -{ - LPUART_Type *base; /*!< UART base address */ - lpuart_transfer_t txTransfer; /*!< TX transfer structure */ - lpuart_transfer_t rxTransfer; /*!< RX transfer structure */ - SemaphoreHandle_t rxSemaphore; /*!< RX semaphore for resource sharing */ - SemaphoreHandle_t txSemaphore; /*!< TX semaphore for resource sharing */ - EventGroupHandle_t rxEvent; /*!< RX completion event */ - EventGroupHandle_t txEvent; /*!< TX completion event */ - uint32_t rx_timeout_constant_ms; /*!< RX Timeout applied per transfer */ - uint32_t rx_timeout_multiplier_ms; /*!< RX Timeout added for each byte of the transfer. */ - uint32_t tx_timeout_constant_ms; /*!< TX Timeout applied per transfer */ - uint32_t tx_timeout_multiplier_ms; /*!< TX Timeout added for each byte of the transfer. */ - void *t_state; /*!< Transactional state of the underlying driver */ -#if (configSUPPORT_STATIC_ALLOCATION == 1) - StaticSemaphore_t txSemaphoreBuffer; /*!< Statically allocated memory for txSemaphore */ - StaticSemaphore_t rxSemaphoreBuffer; /*!< Statically allocated memory for rxSemaphore */ - StaticEventGroup_t txEventBuffer; /*!< Statically allocated memory for txEvent */ - StaticEventGroup_t rxEventBuffer; /*!< Statically allocated memory for rxEvent */ -#endif -} lpuart_rtos_handle_t; -/*! \endcond */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name LPUART RTOS Operation - * @{ - */ - -/*! - * @brief Initializes an LPUART instance for operation in RTOS. - * - * @param handle The RTOS LPUART handle, the pointer to an allocated space for RTOS context. - * @param t_handle The pointer to an allocated space to store the transactional layer internal state. - * @param cfg The pointer to the parameters required to configure the LPUART after initialization. - * @return 0 succeed, others failed - */ -int LPUART_RTOS_Init(lpuart_rtos_handle_t *handle, lpuart_handle_t *t_handle, const lpuart_rtos_config_t *cfg); - -/*! - * @brief Deinitializes an LPUART instance for operation. - * - * This function deinitializes the LPUART module, sets all register value to the reset value, - * and releases the resources. - * - * @param handle The RTOS LPUART handle. - */ -int LPUART_RTOS_Deinit(lpuart_rtos_handle_t *handle); - -/*! - * @name LPUART transactional Operation - * @{ - */ - -/*! - * @brief Sends data in the background. - * - * This function sends data. It is an synchronous API. - * If the hardware buffer is full, the task is in the blocked state. - * - * @param handle The RTOS LPUART handle. - * @param buffer The pointer to buffer to send. - * @param length The number of bytes to send. - */ -int LPUART_RTOS_Send(lpuart_rtos_handle_t *handle, uint8_t *buffer, uint32_t length); - -/*! - * @brief Receives data. - * - * This function receives data from LPUART. It is an synchronous API. If any data is immediately available - * it is returned immediately and the number of bytes received. - * - * @param handle The RTOS LPUART handle. - * @param buffer The pointer to buffer where to write received data. - * @param length The number of bytes to receive. - * @param received The pointer to a variable of size_t where the number of received data is filled. - */ -int LPUART_RTOS_Receive(lpuart_rtos_handle_t *handle, uint8_t *buffer, uint32_t length, size_t *received); - -/*! - * @brief Set RX timeout in runtime - * - * This function can modify RX timeout between initialization and receive. - * - * param handle The RTOS LPUART handle. - * param rx_timeout_constant_ms RX timeout applied per receive. - * param rx_timeout_multiplier_ms RX timeout added for each byte of the receive. - */ -int LPUART_RTOS_SetRxTimeout(lpuart_rtos_handle_t *handle, - uint32_t rx_timeout_constant_ms, - uint32_t rx_timeout_multiplier_ms); - -/*! - * @brief Set TX timeout in runtime - * - * This function can modify TX timeout between initialization and send. - * - * param handle The RTOS LPUART handle. - * param tx_timeout_constant_ms TX timeout applied per transmition. - * param tx_timeout_multiplier_ms TX timeout added for each byte of the transmition. - */ -int LPUART_RTOS_SetTxTimeout(lpuart_rtos_handle_t *handle, - uint32_t tx_timeout_constant_ms, - uint32_t tx_timeout_multiplier_ms); - -/* @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* __FSL_LPUART_FREERTOS_H__ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_mailbox.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_mailbox.h deleted file mode 100644 index d7de5e0384a..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_mailbox.h +++ /dev/null @@ -1,326 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_MAILBOX_H_ -#define FSL_MAILBOX_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup mailbox - * @{ - */ - -/*! @file */ - -/****************************************************************************** - * Definitions - *****************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.mailbox" -#endif - -/*! @name Driver version */ -/*! @{ */ -/*! @brief MAILBOX driver version 2.3.0. */ -#define FSL_MAILBOX_DRIVER_VERSION (MAKE_VERSION(2, 3, 2)) -/*! @} */ - -/*! - * @brief CPU ID. - */ -#if (defined(LPC55S69_cm33_core0_SERIES) || defined(LPC55S69_cm33_core1_SERIES) || \ - defined(LPC55S66_cm33_core0_SERIES) || defined(LPC55S66_cm33_core1_SERIES)) -typedef enum _mailbox_cpu_id -{ - kMAILBOX_CM33_Core1 = 0, - kMAILBOX_CM33_Core0 -} mailbox_cpu_id_t; -#elif ((defined(LPC54114_cm4_SERIES) || defined(LPC54114_cm0plus_SERIES))) -typedef enum _mailbox_cpu_id -{ - kMAILBOX_CM0Plus = 0, - kMAILBOX_CM4 -} mailbox_cpu_id_t; -#elif (defined(MCXN947_cm33_core0_SERIES) || defined(MCXN947_cm33_core1_SERIES) || \ - defined(MCXN946_cm33_core0_SERIES) || defined(MCXN946_cm33_core1_SERIES) || \ - defined(MCXN547_cm33_core0_SERIES) || defined(MCXN547_cm33_core1_SERIES) || \ - defined(MCXN546_cm33_core0_SERIES) || defined(MCXN546_cm33_core1_SERIES)) -typedef enum _mailbox_cpu_id -{ - kMAILBOX_CM33_Core0 = 0, - kMAILBOX_CM33_Core1 -} mailbox_cpu_id_t; -#endif - -#if (defined(CPU_NXH2004J640UK48)) -typedef enum _mailbox_id -{ - kMAILBOX_CM0Plus_Core0 = 0, - kMAILBOX_CM0Plus_Core1, - kMAILBOX_CM0Plus_Sw_Irq0, - kMAILBOX_CM0Plus_Sw_Irq1, - kMAILBOX_CM0Plus_Sw_Irq2, - kMAILBOX_CM0Plus_Sw_Irq3 -} mailbox_id_t; -#endif -/******************************************************************************* - * API - ******************************************************************************/ - -#ifdef __cplusplus -extern "C" { -#endif - -/*! - * @name MAILBOX initialization - * @{ - */ - -/*! - * @brief Initializes the MAILBOX module. - * - * This function enables the MAILBOX clock only. - * - * @param base MAILBOX peripheral base address. - */ -static inline void MAILBOX_Init(MAILBOX_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_EnableClock(kCLOCK_Mailbox); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#if !(defined(FSL_FEATURE_MAILBOX_HAS_NO_RESET) && FSL_FEATURE_MAILBOX_HAS_NO_RESET) - /* Reset the MAILBOX module */ - RESET_PeripheralReset(kMAILBOX_RST_SHIFT_RSTn); -#endif -} - -/*! - * @brief De-initializes the MAILBOX module. - * - * This function disables the MAILBOX clock only. - * - * @param base MAILBOX peripheral base address. - */ -static inline void MAILBOX_Deinit(MAILBOX_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_DisableClock(kCLOCK_Mailbox); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! @} */ - -#if ((defined(LPC55S69_cm33_core0_SERIES) || defined(LPC55S69_cm33_core1_SERIES)) || \ - defined(LPC55S66_cm33_core0_SERIES) || defined(LPC55S66_cm33_core1_SERIES) || \ - defined(MCXN947_cm33_core0_SERIES) || defined(MCXN947_cm33_core1_SERIES) || \ - defined(MCXN946_cm33_core0_SERIES) || defined(MCXN946_cm33_core1_SERIES) || \ - defined(MCXN547_cm33_core0_SERIES) || defined(MCXN547_cm33_core1_SERIES) || \ - defined(MCXN546_cm33_core0_SERIES) || defined(MCXN546_cm33_core1_SERIES) || \ - defined(LPC54114_cm4_SERIES) || defined(LPC54114_cm0plus_SERIES)) -/*! - * @brief Set data value in the mailbox based on the CPU ID. - * - * @param base MAILBOX peripheral base address. - * @param cpu_id CPU id, kMAILBOX_CM0Plus or kMAILBOX_CM4 for LPC5410x and LPC5411x devices, - * kMAILBOX_CM33_Core0 or kMAILBOX_CM33_Core1 for LPC55S69 devices. - * @param mboxData Data to send in the mailbox. - * - * @note Sets a data value to send via the MAILBOX to the other core. - */ -static inline void MAILBOX_SetValue(MAILBOX_Type *base, mailbox_cpu_id_t cpu_id, uint32_t mboxData) -{ -#if ((defined(LPC55S69_cm33_core0_SERIES) || defined(LPC55S69_cm33_core1_SERIES)) || \ - defined(LPC55S66_cm33_core0_SERIES) || defined(LPC55S66_cm33_core1_SERIES) || \ - defined(MCXN947_cm33_core0_SERIES) || defined(MCXN947_cm33_core1_SERIES) || \ - defined(MCXN946_cm33_core0_SERIES) || defined(MCXN946_cm33_core1_SERIES) || \ - defined(MCXN547_cm33_core0_SERIES) || defined(MCXN547_cm33_core1_SERIES) || \ - defined(MCXN546_cm33_core0_SERIES) || defined(MCXN546_cm33_core1_SERIES)) - assert((cpu_id == kMAILBOX_CM33_Core0) || (cpu_id == kMAILBOX_CM33_Core1)); -#elif ((defined(LPC54114_cm4_SERIES) || defined(LPC54114_cm0plus_SERIES))) - assert((cpu_id == kMAILBOX_CM0Plus) || (cpu_id == kMAILBOX_CM4)); -#endif - base->MBOXIRQ[cpu_id].IRQ = mboxData; -} - -/*! - * @brief Get data in the mailbox based on the CPU ID. - * - * @param base MAILBOX peripheral base address. - * @param cpu_id CPU id, kMAILBOX_CM0Plus or kMAILBOX_CM4 for LPC5410x and LPC5411x devices, - * kMAILBOX_CM33_Core0 or kMAILBOX_CM33_Core1 for LPC55S69 devices. - * - * @return Current mailbox data. - */ -static inline uint32_t MAILBOX_GetValue(MAILBOX_Type *base, mailbox_cpu_id_t cpu_id) -{ -#if ((defined(LPC55S69_cm33_core0_SERIES) || defined(LPC55S69_cm33_core1_SERIES)) || \ - defined(LPC55S66_cm33_core0_SERIES) || defined(LPC55S66_cm33_core1_SERIES) || \ - defined(MCXN947_cm33_core0_SERIES) || defined(MCXN947_cm33_core1_SERIES) || \ - defined(MCXN946_cm33_core0_SERIES) || defined(MCXN946_cm33_core1_SERIES) || \ - defined(MCXN547_cm33_core0_SERIES) || defined(MCXN547_cm33_core1_SERIES) || \ - defined(MCXN546_cm33_core0_SERIES) || defined(MCXN546_cm33_core1_SERIES)) - assert((cpu_id == kMAILBOX_CM33_Core0) || (cpu_id == kMAILBOX_CM33_Core1)); -#elif ((defined(LPC54114_cm4_SERIES) || defined(LPC54114_cm0plus_SERIES))) - assert((cpu_id == kMAILBOX_CM0Plus) || (cpu_id == kMAILBOX_CM4)); -#endif - return base->MBOXIRQ[cpu_id].IRQ; -} - -/*! - * @brief Set data bits in the mailbox based on the CPU ID. - * - * @param base MAILBOX peripheral base address. - * @param cpu_id CPU id, kMAILBOX_CM0Plus or kMAILBOX_CM4 for LPC5410x and LPC5411x devices, - * kMAILBOX_CM33_Core0 or kMAILBOX_CM33_Core1 for LPC55S69 devices. - * @param mboxSetBits Data bits to set in the mailbox. - * - * @note Sets data bits to send via the MAILBOX to the other core. A value of 0 will - * do nothing. Only sets bits selected with a 1 in it's bit position. - */ -static inline void MAILBOX_SetValueBits(MAILBOX_Type *base, mailbox_cpu_id_t cpu_id, uint32_t mboxSetBits) -{ -#if ((defined(LPC55S69_cm33_core0_SERIES) || defined(LPC55S69_cm33_core1_SERIES)) || \ - defined(LPC55S66_cm33_core0_SERIES) || defined(LPC55S66_cm33_core1_SERIES) || \ - defined(MCXN947_cm33_core0_SERIES) || defined(MCXN947_cm33_core1_SERIES) || \ - defined(MCXN946_cm33_core0_SERIES) || defined(MCXN946_cm33_core1_SERIES) || \ - defined(MCXN547_cm33_core0_SERIES) || defined(MCXN547_cm33_core1_SERIES) || \ - defined(MCXN546_cm33_core0_SERIES) || defined(MCXN546_cm33_core1_SERIES)) - assert((cpu_id == kMAILBOX_CM33_Core0) || (cpu_id == kMAILBOX_CM33_Core1)); -#elif ((defined(LPC54114_cm4_SERIES) || defined(LPC54114_cm0plus_SERIES))) - assert((cpu_id == kMAILBOX_CM0Plus) || (cpu_id == kMAILBOX_CM4)); -#endif - base->MBOXIRQ[cpu_id].IRQSET = mboxSetBits; -} - -/*! - * @brief Clear data bits in the mailbox based on the CPU ID. - * - * @param base MAILBOX peripheral base address. - * @param cpu_id CPU id, kMAILBOX_CM0Plus or kMAILBOX_CM4 for LPC5410x and LPC5411x devices, - * kMAILBOX_CM33_Core0 or kMAILBOX_CM33_Core1 for LPC55S69 devices. - * @param mboxClrBits Data bits to clear in the mailbox. - * - * @note Clear data bits to send via the MAILBOX to the other core. A value of 0 will - * do nothing. Only clears bits selected with a 1 in it's bit position. - */ -static inline void MAILBOX_ClearValueBits(MAILBOX_Type *base, mailbox_cpu_id_t cpu_id, uint32_t mboxClrBits) -{ -#if ((defined(LPC55S69_cm33_core0_SERIES) || defined(LPC55S69_cm33_core1_SERIES)) || \ - defined(LPC55S66_cm33_core0_SERIES) || defined(LPC55S66_cm33_core1_SERIES) || \ - defined(MCXN947_cm33_core0_SERIES) || defined(MCXN947_cm33_core1_SERIES) || \ - defined(MCXN946_cm33_core0_SERIES) || defined(MCXN946_cm33_core1_SERIES) || \ - defined(MCXN547_cm33_core0_SERIES) || defined(MCXN547_cm33_core1_SERIES) || \ - defined(MCXN546_cm33_core0_SERIES) || defined(MCXN546_cm33_core1_SERIES)) - assert((cpu_id == kMAILBOX_CM33_Core0) || (cpu_id == kMAILBOX_CM33_Core1)); -#elif ((defined(LPC54114_cm4_SERIES) || defined(LPC54114_cm0plus_SERIES))) - assert((cpu_id == kMAILBOX_CM0Plus) || (cpu_id == kMAILBOX_CM4)); -#endif - base->MBOXIRQ[cpu_id].IRQCLR = mboxClrBits; -} - -#elif (defined(CPU_NXH2004J640UK48)) - -/*! - * @brief Set data value in the mailbox based on the Mailbox ID. - * - * @param base MAILBOX peripheral base address. - * @param id Mailbox Index for NXH2004 devices - * @param mboxData Data to send in the mailbox. - * - */ -static inline void MAILBOX_SetValue(MAILBOX_Type *base, mailbox_id_t id, uint32_t mboxData) -{ - assert((id >= kMAILBOX_CM0Plus_Core0) && (id <= kMAILBOX_CM0Plus_Sw_Irq3)); - base->MBOXIRQ[id].IRQ = mboxData; -} - -/*! - * @brief Get data in the mailbox based on the Mailbox ID. - * - * @param base MAILBOX peripheral base address. - * @param id, Mailbox index for NXH2004 devies. - * - * @return Current mailbox data. - */ -static inline uint32_t MAILBOX_GetValue(MAILBOX_Type *base, mailbox_id_t id) -{ - assert((id >= kMAILBOX_CM0Plus_Core0) && (id <= kMAILBOX_CM0Plus_Sw_Irq3)); - return base->MBOXIRQ[id].IRQ; -} - -/*! - * @brief Set data bits in the mailbox based on the Mailbox Index. - * - * @param base MAILBOX peripheral base address. - * @param id Mailbox Index for NXH2004 devices - * @param mboxSetBits Data bits to set in the mailbox. - * - * @note Sets data bits to send via the MAILBOX. A value of 0 will - * do nothing. Only sets bits selected with a 1 in it's bit position. - */ -static inline void MAILBOX_SetValueBits(MAILBOX_Type *base, mailbox_id_t id, uint32_t mboxSetBits) -{ - assert((id >= kMAILBOX_CM0Plus_Core0) && (id <= kMAILBOX_CM0Plus_Sw_Irq3)); - base->MBOXIRQ[id].IRQSET = mboxSetBits; -} - -/*! - * @brief Clear data bits in the mailbox based on the Mailbox ID. - * - * @param base MAILBOX peripheral base address. - * @param id, Index to Mailbox for NXH2004 devices. - * @param mboxClrBits Data bits to clear in the mailbox. - * - * @note Clear data bits to send via the MAILBOX. A value of 0 will do - * nothing. Only clears bits selected with a 1 in it's bit position. - */ -static inline void MAILBOX_ClearValueBits(MAILBOX_Type *base, mailbox_id_t id, uint32_t mboxClrBits) -{ - assert((id >= kMAILBOX_CM0Plus_Core0) && (id <= kMAILBOX_CM0Plus_Sw_Irq3)); - base->MBOXIRQ[id].IRQCLR = mboxClrBits; -} - -#endif /*CPU_NXH2004J640UK48*/ - -/*! - * @brief Get MUTEX state and lock mutex - * - * @param base MAILBOX peripheral base address. - * - * @return See note - * - * @note Returns '1' if the mutex was taken or '0' if another resources has the - * mutex locked. Once a mutex is taken, it can be returned with the MAILBOX_SetMutex() - * function. - */ -static inline uint32_t MAILBOX_GetMutex(MAILBOX_Type *base) -{ - return (base->MUTEX & MAILBOX_MUTEX_EX_MASK); -} - -/*! - * @brief Set MUTEX state - * - * @param base MAILBOX peripheral base address. - * - * @note Sets mutex state to '1' and allows other resources to get the mutex. - */ -static inline void MAILBOX_SetMutex(MAILBOX_Type *base) -{ - base->MUTEX = MAILBOX_MUTEX_EX_MASK; -} - -#if defined(__cplusplus) -} -#endif /*_cplusplus*/ -/*! @} */ - -#endif /* FSL_MAILBOX_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_mrt.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_mrt.c deleted file mode 100644 index 69697a21b5c..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_mrt.c +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2017, 2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_mrt.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.mrt" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Gets the instance from the base address - * - * @param base Multi-Rate timer peripheral base address - * - * @return The MRT instance - */ -static uint32_t MRT_GetInstance(MRT_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to MRT bases for each instance. */ -static MRT_Type *const s_mrtBases[] = MRT_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to MRT clocks for each instance. */ -static const clock_ip_name_t s_mrtClocks[] = MRT_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) -#if defined(MRT_RSTS_N) -/*! @brief Pointers to MRT resets for each instance, writing a zero asserts the reset */ -static const reset_ip_name_t s_mrtResets[] = MRT_RSTS_N; -#elif defined(MRT_RSTS) -/*! @brief Pointers to MRT resets for each instance, writing a one asserts the reset */ -static const reset_ip_name_t s_mrtResets[] = MRT_RSTS; -#endif -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t MRT_GetInstance(MRT_Type *base) -{ - uint32_t instance; - uint32_t mrtArrayCount = (sizeof(s_mrtBases) / sizeof(s_mrtBases[0])); - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < mrtArrayCount; instance++) - { - if (s_mrtBases[instance] == base) - { - break; - } - } - - assert(instance < mrtArrayCount); - - return instance; -} - -/*! - * brief Ungates the MRT clock and configures the peripheral for basic operation. - * - * note This API should be called at the beginning of the application using the MRT driver. - * - * param base Multi-Rate timer peripheral base address - * param config Pointer to user's MRT config structure. If MRT has MULTITASK bit field in - * MODCFG reigster, param config is useless. - */ -void MRT_Init(MRT_Type *base, const mrt_config_t *config) -{ - assert(config != NULL); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate the MRT clock */ - CLOCK_EnableClock(s_mrtClocks[MRT_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) -#if defined(MRT_RSTS_N) || defined(MRT_RSTS) - /* Reset the module. */ - RESET_PeripheralReset(s_mrtResets[MRT_GetInstance(base)]); -#endif -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ - -#if !(defined(FSL_FEATURE_MRT_HAS_NO_MODCFG_MULTITASK) && FSL_FEATURE_MRT_HAS_NO_MODCFG_MULTITASK) - /* Set timer operating mode */ - base->MODCFG = MRT_MODCFG_MULTITASK(config->enableMultiTask); -#endif -} - -/*! - * brief Gate the MRT clock - * - * param base Multi-Rate timer peripheral base address - */ -void MRT_Deinit(MRT_Type *base) -{ - /* Stop all the timers */ - MRT_StopTimer(base, kMRT_Channel_0); - MRT_StopTimer(base, kMRT_Channel_1); -#if (FSL_FEATURE_MRT_NUMBER_OF_CHANNELS > 2U) - MRT_StopTimer(base, kMRT_Channel_2); -#endif -#if (FSL_FEATURE_MRT_NUMBER_OF_CHANNELS > 3U) - MRT_StopTimer(base, kMRT_Channel_3); -#endif - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate the MRT clock*/ - CLOCK_DisableClock(s_mrtClocks[MRT_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Used to update the timer period in units of count. - * - * The new value will be immediately loaded or will be loaded at the end of the current time - * interval. For one-shot interrupt mode the new value will be immediately loaded. - * - * note User can call the utility macros provided in fsl_common.h to convert to ticks - * - * param base Multi-Rate timer peripheral base address - * param channel Timer channel number - * param count Timer period in units of ticks - * param immediateLoad true: Load the new value immediately into the TIMER register; - * false: Load the new value at the end of current timer interval - */ -void MRT_UpdateTimerPeriod(MRT_Type *base, mrt_chnl_t channel, uint32_t count, bool immediateLoad) -{ - assert((uint8_t)channel < (uint8_t)FSL_FEATURE_MRT_NUMBER_OF_CHANNELS); - - uint32_t newValue = count; - if (((base->CHANNEL[channel].CTRL & MRT_CHANNEL_CTRL_MODE_MASK) == (uint8_t)kMRT_OneShotMode) || (immediateLoad)) - { - /* For one-shot interrupt mode, load the new value immediately even if user forgot to enable */ - newValue |= MRT_CHANNEL_INTVAL_LOAD_MASK; - } - - /* Update the timer interval value */ - base->CHANNEL[channel].INTVAL = newValue; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_mrt.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_mrt.h deleted file mode 100644 index 77f3a1353b9..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_mrt.h +++ /dev/null @@ -1,366 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2017, 2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_MRT_H_ -#define FSL_MRT_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup mrt - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -#define FSL_MRT_DRIVER_VERSION (MAKE_VERSION(2, 0, 3)) /*!< Version 2.0.3 */ -/*! @} */ - -/*! @brief List of MRT channels */ -typedef enum _mrt_chnl -{ - kMRT_Channel_0 = 0U, /*!< MRT channel number 0*/ - kMRT_Channel_1, /*!< MRT channel number 1 */ - kMRT_Channel_2, /*!< MRT channel number 2 */ - kMRT_Channel_3 /*!< MRT channel number 3 */ -} mrt_chnl_t; - -/*! @brief List of MRT timer modes */ -typedef enum _mrt_timer_mode -{ - kMRT_RepeatMode = (0 << MRT_CHANNEL_CTRL_MODE_SHIFT), /*!< Repeat Interrupt mode */ - kMRT_OneShotMode = (1 << MRT_CHANNEL_CTRL_MODE_SHIFT), /*!< One-shot Interrupt mode */ - kMRT_OneShotStallMode = (2 << MRT_CHANNEL_CTRL_MODE_SHIFT) /*!< One-shot stall mode */ -} mrt_timer_mode_t; - -/*! @brief List of MRT interrupts */ -typedef enum _mrt_interrupt_enable -{ - kMRT_TimerInterruptEnable = MRT_CHANNEL_CTRL_INTEN_MASK /*!< Timer interrupt enable*/ -} mrt_interrupt_enable_t; - -/*! @brief List of MRT status flags */ -typedef enum _mrt_status_flags -{ - kMRT_TimerInterruptFlag = MRT_CHANNEL_STAT_INTFLAG_MASK, /*!< Timer interrupt flag */ - kMRT_TimerRunFlag = MRT_CHANNEL_STAT_RUN_MASK, /*!< Indicates state of the timer */ -} mrt_status_flags_t; - -/*! - * @brief MRT configuration structure - * - * This structure holds the configuration settings for the MRT peripheral. To initialize this - * structure to reasonable defaults, call the MRT_GetDefaultConfig() function and pass a - * pointer to your config structure instance. - * - * The config struct can be made const so it resides in flash - */ -typedef struct _mrt_config -{ - bool enableMultiTask; /*!< true: Timers run in multi-task mode; false: Timers run in hardware status mode */ -} mrt_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Ungates the MRT clock and configures the peripheral for basic operation. - * - * @note This API should be called at the beginning of the application using the MRT driver. - * - * @param base Multi-Rate timer peripheral base address - * @param config Pointer to user's MRT config structure. If MRT has MULTITASK bit field in - * MODCFG reigster, param config is useless. - */ -void MRT_Init(MRT_Type *base, const mrt_config_t *config); - -/*! - * @brief Gate the MRT clock - * - * @param base Multi-Rate timer peripheral base address - */ -void MRT_Deinit(MRT_Type *base); - -/*! - * @brief Fill in the MRT config struct with the default settings - * - * The default values are: - * @code - * config->enableMultiTask = false; - * @endcode - * @param config Pointer to user's MRT config structure. - */ -static inline void MRT_GetDefaultConfig(mrt_config_t *config) -{ - assert(config != NULL); -#if !(defined(FSL_FEATURE_MRT_HAS_NO_MODCFG_MULTITASK) && FSL_FEATURE_MRT_HAS_NO_MODCFG_MULTITASK) - /* Use hardware status operating mode */ - config->enableMultiTask = false; -#endif -} - -/*! - * @brief Sets up an MRT channel mode. - * - * @param base Multi-Rate timer peripheral base address - * @param channel Channel that is being configured. - * @param mode Timer mode to use for the channel. - */ -static inline void MRT_SetupChannelMode(MRT_Type *base, mrt_chnl_t channel, const mrt_timer_mode_t mode) -{ - assert((uint8_t)channel < (uint8_t)FSL_FEATURE_MRT_NUMBER_OF_CHANNELS); - - uint32_t reg = base->CHANNEL[channel].CTRL; - - /* Clear old value */ - reg &= ~MRT_CHANNEL_CTRL_MODE_MASK; - /* Add the new mode */ - reg |= (uint32_t)mode; - - base->CHANNEL[channel].CTRL = reg; -} - -/*! @}*/ - -/*! - * @name Interrupt Interface - * @{ - */ - -/*! - * @brief Enables the MRT interrupt. - * - * @param base Multi-Rate timer peripheral base address - * @param channel Timer channel number - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::mrt_interrupt_enable_t - */ -static inline void MRT_EnableInterrupts(MRT_Type *base, mrt_chnl_t channel, uint32_t mask) -{ - assert((uint8_t)channel < (uint8_t)FSL_FEATURE_MRT_NUMBER_OF_CHANNELS); - base->CHANNEL[channel].CTRL |= mask; -} - -/*! - * @brief Disables the selected MRT interrupt. - * - * @param base Multi-Rate timer peripheral base address - * @param channel Timer channel number - * @param mask The interrupts to disable. This is a logical OR of members of the - * enumeration ::mrt_interrupt_enable_t - */ -static inline void MRT_DisableInterrupts(MRT_Type *base, mrt_chnl_t channel, uint32_t mask) -{ - assert((uint8_t)channel < (uint8_t)FSL_FEATURE_MRT_NUMBER_OF_CHANNELS); - base->CHANNEL[channel].CTRL &= ~mask; -} - -/*! - * @brief Gets the enabled MRT interrupts. - * - * @param base Multi-Rate timer peripheral base address - * @param channel Timer channel number - * - * @return The enabled interrupts. This is the logical OR of members of the - * enumeration ::mrt_interrupt_enable_t - */ -static inline uint32_t MRT_GetEnabledInterrupts(MRT_Type *base, mrt_chnl_t channel) -{ - assert((uint8_t)channel < (uint8_t)FSL_FEATURE_MRT_NUMBER_OF_CHANNELS); - return (base->CHANNEL[channel].CTRL & MRT_CHANNEL_CTRL_INTEN_MASK); -} - -/*! @}*/ - -/*! - * @name Status Interface - * @{ - */ - -/*! - * @brief Gets the MRT status flags - * - * @param base Multi-Rate timer peripheral base address - * @param channel Timer channel number - * - * @return The status flags. This is the logical OR of members of the - * enumeration ::mrt_status_flags_t - */ -static inline uint32_t MRT_GetStatusFlags(MRT_Type *base, mrt_chnl_t channel) -{ - assert((uint8_t)channel < (uint8_t)FSL_FEATURE_MRT_NUMBER_OF_CHANNELS); - return (base->CHANNEL[channel].STAT & (MRT_CHANNEL_STAT_INTFLAG_MASK | MRT_CHANNEL_STAT_RUN_MASK)); -} - -/*! - * @brief Clears the MRT status flags. - * - * @param base Multi-Rate timer peripheral base address - * @param channel Timer channel number - * @param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::mrt_status_flags_t - */ -static inline void MRT_ClearStatusFlags(MRT_Type *base, mrt_chnl_t channel, uint32_t mask) -{ - assert((uint8_t)channel < (uint8_t)FSL_FEATURE_MRT_NUMBER_OF_CHANNELS); - base->CHANNEL[channel].STAT = (mask & MRT_CHANNEL_STAT_INTFLAG_MASK); -} - -/*! @}*/ - -/*! - * @name Read and Write the timer period - * @{ - */ - -/*! - * @brief Used to update the timer period in units of count. - * - * The new value will be immediately loaded or will be loaded at the end of the current time - * interval. For one-shot interrupt mode the new value will be immediately loaded. - * - * @note User can call the utility macros provided in fsl_common.h to convert to ticks - * - * @param base Multi-Rate timer peripheral base address - * @param channel Timer channel number - * @param count Timer period in units of ticks - * @param immediateLoad true: Load the new value immediately into the TIMER register; - * false: Load the new value at the end of current timer interval - */ -void MRT_UpdateTimerPeriod(MRT_Type *base, mrt_chnl_t channel, uint32_t count, bool immediateLoad); - -/*! - * @brief Reads the current timer counting value. - * - * This function returns the real-time timer counting value, in a range from 0 to a - * timer period. - * - * @note User can call the utility macros provided in fsl_common.h to convert ticks to usec or msec - * - * @param base Multi-Rate timer peripheral base address - * @param channel Timer channel number - * - * @return Current timer counting value in ticks - */ -static inline uint32_t MRT_GetCurrentTimerCount(MRT_Type *base, mrt_chnl_t channel) -{ - assert((uint8_t)channel < (uint8_t)FSL_FEATURE_MRT_NUMBER_OF_CHANNELS); - return base->CHANNEL[channel].TIMER; -} - -/*! @}*/ - -/*! - * @name Timer Start and Stop - * @{ - */ - -/*! - * @brief Starts the timer counting. - * - * After calling this function, timers load period value, counts down to 0 and - * depending on the timer mode it will either load the respective start value again or stop. - * - * @note User can call the utility macros provided in fsl_common.h to convert to ticks - * - * @param base Multi-Rate timer peripheral base address - * @param channel Timer channel number. - * @param count Timer period in units of ticks. Count can contain the LOAD bit, which control the force load feature. - */ -static inline void MRT_StartTimer(MRT_Type *base, mrt_chnl_t channel, uint32_t count) -{ - assert((uint8_t)channel < (uint8_t)FSL_FEATURE_MRT_NUMBER_OF_CHANNELS); - assert((uint32_t)(count & ~MRT_CHANNEL_INTVAL_LOAD_MASK) <= (uint32_t)MRT_CHANNEL_INTVAL_IVALUE_MASK); - /* Write the timer interval value */ - base->CHANNEL[channel].INTVAL = count; -} - -/*! - * @brief Stops the timer counting. - * - * This function stops the timer from counting. - * - * @param base Multi-Rate timer peripheral base address - * @param channel Timer channel number. - */ -static inline void MRT_StopTimer(MRT_Type *base, mrt_chnl_t channel) -{ - assert((uint8_t)channel < (uint8_t)FSL_FEATURE_MRT_NUMBER_OF_CHANNELS); - /* Stop the timer immediately */ - base->CHANNEL[channel].INTVAL = MRT_CHANNEL_INTVAL_LOAD_MASK; -} - -/*! @}*/ - -/*! - * @name Get & release channel - * @{ - */ - -/*! - * @brief Find the available channel. - * - * This function returns the lowest available channel number. - * - * @param base Multi-Rate timer peripheral base address - */ -static inline uint32_t MRT_GetIdleChannel(MRT_Type *base) -{ - return base->IDLE_CH; -} - -#if !(defined(FSL_FEATURE_MRT_HAS_NO_CHANNEL_STAT_INUSE) && FSL_FEATURE_MRT_HAS_NO_CHANNEL_STAT_INUSE) -/*! - * @brief Release the channel when the timer is using the multi-task mode. - * - * In multi-task mode, the INUSE flags allow more control over when MRT channels are released for - * further use. The user can hold on to a channel acquired by calling MRT_GetIdleChannel() for as - * long as it is needed and release it by calling this function. This removes the need to ask for - * an available channel for every use. - * - * @param base Multi-Rate timer peripheral base address - * @param channel Timer channel number. - */ -static inline void MRT_ReleaseChannel(MRT_Type *base, mrt_chnl_t channel) -{ - assert((uint8_t)channel < (uint8_t)FSL_FEATURE_MRT_NUMBER_OF_CHANNELS); - - uint32_t reg = base->CHANNEL[channel].STAT; - - /* Clear flag bits to prevent accidentally clearing anything when writing back */ - reg = ~MRT_CHANNEL_STAT_INTFLAG_MASK; - reg |= MRT_CHANNEL_STAT_INUSE_MASK; - - base->CHANNEL[channel].STAT = reg; -} -#endif - -/*! @}*/ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_MRT_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_opamp.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_opamp.c deleted file mode 100644 index f75075d3ec4..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_opamp.c +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Copyright 2021-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_opamp.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.opamp" -#endif - -#if defined(OPAMP_RSTS) -#define OPAMP_RESETS_ARRAY OPAMP_RSTS -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -static uint32_t OPAMP_GetInstance(OPAMP_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ -static OPAMP_Type *const s_opampBases[] = OPAMP_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to OPAMP clocks for each instance. */ -static const clock_ip_name_t s_opampClocks[] = OPAMP_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(OPAMP_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_opampResets[] = OPAMP_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ - -static uint32_t OPAMP_GetInstance(OPAMP_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0UL; instance < ARRAY_SIZE(s_opampBases); instance++) - { - if (s_opampBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_opampBases)); - - return instance; -} - -/*! - * brief Initialize OPAMP instance. - * - * param base OPAMP peripheral base address. - * param config The pointer to opamp_config_t. - */ -void OPAMP_Init(OPAMP_Type *base, const opamp_config_t *config) -{ - assert(config != NULL); - - uint32_t tmp32 = 0U; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock. */ - CLOCK_EnableClock(s_opampClocks[OPAMP_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(OPAMP_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_opampResets[OPAMP_GetInstance(base)]); -#endif - - tmp32 = OPAMP_OPAMP_CTR_EN(config->enable) | OPAMP_OPAMP_CTR_MODE(config->mode) | - OPAMP_OPAMP_CTR_BIASC(config->trimOption) | OPAMP_OPAMP_CTR_INTREF(config->intRefVoltage) | - OPAMP_OPAMP_CTR_PREF(config->posRefVoltage) | -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_OUTSW) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_OUTSW - OPAMP_OPAMP_CTR_OUTSW(config->enableOutputSwitch) | -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_OUTSW */ -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW1) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW1 - OPAMP_OPAMP_CTR_ADCSW1(config->enablePosADCSw1) | -#else - OPAMP_OPAMP_CTR_ADCSW(config->enablePosADCSw) | -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW1 */ -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW2) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW2 - OPAMP_OPAMP_CTR_ADCSW2(config->enablePosADCSw2) | -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW2 */ -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_INPSEL) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_INPSEL - OPAMP_OPAMP_CTR_INPSEL(config->PosInputChannelSelection) | -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_INPSEL */ -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_TRIGMD) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_TRIGMD - OPAMP_OPAMP_CTR_TRIGMD(config->enableTriggerMode) | -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_TRIGMD */ - OPAMP_OPAMP_CTR_NGAIN(config->negGain); - base->OPAMP_CTR = tmp32; -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_BUFEN) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_BUFEN - if (config->enableRefBuffer) - { - assert((uint32_t)(config->posGain) <= 7UL); - base->OPAMP_CTR |= OPAMP_OPAMP_CTR_PGAIN(config->posGain) | OPAMP_OPAMP_CTR_BUFEN_MASK; - } - else - { - if ((uint32_t)(config->posGain) > 7UL) - { - base->OPAMP_CTR |= OPAMP_OPAMP_CTR_PGAIN((uint32_t)(config->posGain) - 7UL); - } - else - { - assert((uint32_t)(config->posGain) == 0UL); - base->OPAMP_CTR |= OPAMP_OPAMP_CTR_PGAIN(config->posGain); - } - } -#else - base->OPAMP_CTR |= OPAMP_OPAMP_CTR_PGAIN(config->posGain); -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_TRIGMD */ -} - -/*! - * brief De-initialize OPAMP instance. - * - * param base OPAMP peripheral base address. - */ -void OPAMP_Deinit(OPAMP_Type *base) -{ - /* Disable OPAMP instance. */ - base->OPAMP_CTR &= ~OPAMP_OPAMP_CTR_EN_MASK; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable the clock. */ - CLOCK_DisableClock(s_opampClocks[OPAMP_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Get default configuration of OPAMP. - * - * code - * config->enable = false; - * config->mode = kOPAMP_LowNoiseMode; - * config->trimOption = kOPAMP_TrimOptionDefault; - * config->intRefVoltage = kOPAMP_IntRefVoltVddaDiv2; - * config->enablePosADCSw = false; - * config->posRefVoltage = kOPAMP_PosRefVoltVrefh3; - * config->posGain = kOPAMP_PosGainReserved; - * config->negGain = kOPAMP_NegGainBufferMode; - * endcode - * - * param config The pointer to opamp_config_t. - */ -void OPAMP_GetDefaultConfig(opamp_config_t *config) -{ - assert(config != NULL); - - config->enable = false; - config->mode = kOPAMP_LowNoiseMode; - config->trimOption = kOPAMP_TrimOptionDefault; - config->intRefVoltage = kOPAMP_IntRefVoltVddaDiv2; - config->posRefVoltage = kOPAMP_PosRefVoltVrefh3; - config->posGain = kOPAMP_PosGainReserved; - config->negGain = kOPAMP_NegGainBufferMode; -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_OUTSW) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_OUTSW - config->enableOutputSwitch = true; -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_OUTSW */ -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW1) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW1 - config->enablePosADCSw1 = false; -#else - config->enablePosADCSw = false; -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW1 */ -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW2) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW2 - config->enablePosADCSw2 = false; -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW2 */ -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_BUFEN) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_BUFEN - config->enableRefBuffer = false; -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_BUFEN */ -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_INPSEL) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_INPSEL - config->PosInputChannelSelection = kOPAMP_PosInputChannel0; -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_INPSEL */ -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_TRIGMD) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_TRIGMD - config->enableTriggerMode = false; -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_TRIGMD */ -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_opamp.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_opamp.h deleted file mode 100644 index c9767193d0b..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_opamp.h +++ /dev/null @@ -1,301 +0,0 @@ -/* - * Copyright 2021-2022, 2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_OPAMP_H_ -#define FSL_OPAMP_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup opamp - * @{ - */ - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief OPAMP driver version. */ -#define FSL_OPAMP_DRIVER_VERSION (MAKE_VERSION(2, 2, 0)) -/*! @} */ - -/*! - * @brief The enumeration of OPAMP mode, including low noise mode and high speed mode. - */ -typedef enum _opamp_mode -{ - kOPAMP_LowNoiseMode = 0U, /*!< Set opamp mode as low noise mode. */ - kOPAMP_HighSpeedMode, /*!< Set opamp mode as high speed mode. */ -} opamp_mode_t; - -/*! - * @brief The enumeration of bias current trim option. - */ -typedef enum _opamp_bias_current_trim_option -{ - kOPAMP_TrimOptionDefault = 0U, /*!< Default Bias current trim option. */ - kOPAMP_TrimOptionIncreaseCurrent, /*!< Trim option selected as increase current. */ - kOPAMP_TrimOptionDecreaseCurrent, /*!< Trim option selected as decrease current. */ - kOPAMP_TrimOptionFurtherDecreaseCurrent, /*!< Trim option selected as further decrease current. */ -} opamp_bias_current_trim_option_t; - -/*! - * @brief The enumeration of internal reference voltage. - */ -typedef enum _opamp_internal_ref_voltage -{ - kOPAMP_IntRefVoltVddaDiv2 = 0U, /*!< Internal reference voltage selected as Vdda/2. */ - kOPAMP_IntRefVoltVdda3V, /*!< Internal reference voltage selected as Vdda_3V. */ - kOPAMP_IntRefVoltVssa3V, /*!< Internal reference voltage selected as Vssa_3V. */ - kOPAMP_IntRefVoltNotAllowed, /*!< Internal reference voltage not allowed. */ -} opamp_internal_ref_voltage_t; - -/*! - * @brief The enumeration of positive reference voltage(please refer to manual use). - */ -typedef enum _opamp_positive_ref_voltage -{ - kOPAMP_PosRefVoltVrefh3 = 0U, /*!< Positive part reference voltage select Vrefh3, connected from DAC output. */ - kOPAMP_PosRefVoltVrefh0 = 1U, /*!< Positive part reference voltage select Vrefh0, connected from VDDA supply. */ - kOPAMP_PosRefVoltVrefh1 = 2U, /*!< Positive part reference voltage select Vrefh1, - connected from Voltage reference output. */ - kOPAMP_PosRefVoltVrefh4 = 3U, /*!< Positive part reference voltage select 520mv or reserved.*/ -} opamp_positive_ref_voltage_t; - -/*! - * @brief The enumeration of positive programmable gain (please refer to manual use). - */ -typedef enum _opamp_positive_gain -{ - kOPAMP_PosGainReserved = 0U, /*!< Positive Gain reserved. */ - kOPAMP_PosGainNonInvert1X = 1U, /*!< Positive non-inverting gain application 1X. */ - kOPAMP_PosGainNonInvert2X = 2U, /*!< Positive non-inverting gain application 2X. */ - kOPAMP_PosGainNonInvert4X = 3U, /*!< Positive non-inverting gain application 4X. */ - kOPAMP_PosGainNonInvert8X = 4U, /*!< Positive non-inverting gain application 8X. */ - kOPAMP_PosGainNonInvert16X = 5U, /*!< Positive non-inverting gain application 16X. */ - kOPAMP_PosGainNonInvert33X = 6U, /*!< Positive non-inverting gain application 33X. */ - kOPAMP_PosGainNonInvert64X = 7U, /*!< Positive non-inverting gain application 64X. */ -#if defined(FSL_FEATURE_OPAMP_HAS_SUPPORT_REFERENCE_BUFFER) && FSL_FEATURE_OPAMP_HAS_SUPPORT_REFERENCE_BUFFER - /* The following gain selections are for basic OPAMP only, and signal inputs are - supported on the non-inverting and inverting terminals.*/ - kOPAMP_PosGainNonInvertDisableBuffer2X = 8U, /*!< Positive non-inverting gain application 2X. */ - kOPAMP_PosGainNonInvertDisableBuffer3X = 9U, /*!< Positive non-inverting gain application 3X. */ - kOPAMP_PosGainNonInvertDisableBuffer5X = 10U, /*!< Positive non-inverting gain application 5X. */ - kOPAMP_PosGainNonInvertDisableBuffer9X = 11U, /*!< Positive non-inverting gain application 9X. */ - kOPAMP_PosGainNonInvertDisableBuffer17X = 12U, /*!< Positive non-inverting gain application 17X. */ - kOPAMP_PosGainNonInvertDisableBuffer34X = 13U, /*!< Positive non-inverting gain application 34X. */ - kOPAMP_PosGainNonInvertDisableBuffer65X = 14U, /*!< Positive non-inverting gain application 65X. */ -#endif /* FSL_FEATURE_OPAMP_HAS_SUPPORT_REFERENCE_BUFFER */ -} opamp_positive_gain_t; - -/*! - * @brief The enumeration of negative programmable gain. - */ -typedef enum _opamp_negative_gain -{ - kOPAMP_NegGainBufferMode = 0U, /*!< Negative Buffer Mode. */ - kOPAMP_NegGainInvert1X, /*!< Negative inverting gain application -1X. */ - kOPAMP_NegGainInvert2X, /*!< Negative inverting gain application -2X. */ - kOPAMP_NegGainInvert4X, /*!< Negative inverting gain application -4X. */ - kOPAMP_NegGainInvert8X, /*!< Negative inverting gain application -8X. */ - kOPAMP_NegGainInvert16X, /*!< Negative inverting gain application -16X. */ - kOPAMP_NegGainInvert33X, /*!< Negative inverting gain application -33X. */ - kOPAMP_NegGainInvert64X, /*!< Negative inverting gain application -64X. */ -} opamp_negative_gain_t; - -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_INPSEL) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_INPSEL -/*! - * @brief The enumeration of positive input channel selection. - */ -typedef enum _opamp_positive_input_channel_selection -{ - kOPAMP_PosInputChannel0 = 0U, /*!< When OPAMP not in trigger mode, select positive input 0 (INP0).*/ - kOPAMP_PosInputChannel1 = 1U, /*!< When OPAMP not in trigger mode, select positive input 1 (INP1).*/ -} opamp_positive_input_channel_selection_t; -#endif -/*! - * @brief OPAMP configuraion, including mode, internal reference voltage, positive gain, negative gain and so on. - */ -typedef struct _opamp_config -{ - bool enable; /*!< Enable/disable OPAMP. */ - opamp_mode_t mode; /*!< Opamp mode, available values are @ref kOPAMP_LowNoiseMode and @ref kOPAMP_HighSpeedMode. */ - opamp_bias_current_trim_option_t trimOption; /*!< Bias current trim option, please refer to - @ref opamp_bias_current_trim_option_t. */ - opamp_internal_ref_voltage_t intRefVoltage; /*!< Internal reference voltage, please refer to - @ref opamp_internal_ref_voltage_t. */ - opamp_positive_ref_voltage_t posRefVoltage; /*!< Positive part reference voltage, please refer - to @ref opamp_positive_ref_voltage_t. */ - /* Positive part configuration. */ - opamp_positive_gain_t posGain; /*!< Positive part programmable gain, please refer - to @ref opamp_positive_gain_t. */ - /* Negative part configuration. */ - opamp_negative_gain_t negGain; /*!< Negative part programmable gain, please refer - to @ref opamp_negative_gain_t. */ -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_OUTSW) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_OUTSW - bool enableOutputSwitch; /*!< OPAMP out to negative gain resistor ladder switch.*/ -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_OUTSW */ -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW1) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW1 - bool enablePosADCSw1; /*!< Positive part reference voltage switch to ADC channel or not. - - \b true Positive part reference voltage switch to ADC channel. - - \b false Positive part reference voltage do not switch to ADC channel. */ -#else - bool enablePosADCSw; /*!< Positive part reference voltage switch to ADC channel or not. - - \b true Positive part reference voltage switch to ADC channel. - - \b false Positive part reference voltage do not switch to ADC channel. */ -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW1 */ -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW2) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW2 - bool enablePosADCSw2; /*!< Positive part reference voltage switch to ADC channel or not. - - \b true Positive part reference voltage switch to ADC channel. - - \b false Positive part reference voltage do not switch to ADC channel. */ -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_ADCSW2 */ -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_BUFEN) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_BUFEN - bool enableRefBuffer; /*!< Reference buffer enable.*/ -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_BUFEN */ -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_INPSEL) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_INPSEL - opamp_positive_input_channel_selection_t PosInputChannelSelection; /*!< Positive Input Channel Selection*/ -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_INPSEL */ -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_TRIGMD) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_TRIGMD - bool enableTriggerMode; /*!< Trigger Mode Enable.*/ -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_TRIGMD */ -} opamp_config_t; - -/******************************************************************************* - * API - *******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Initialize OPAMP instance. - * - * @param base OPAMP peripheral base address. - * @param config The pointer to @ref opamp_config_t. - */ -void OPAMP_Init(OPAMP_Type *base, const opamp_config_t *config); - -/*! - * @brief De-initialize OPAMP instance. - * - * @param base OPAMP peripheral base address. - */ -void OPAMP_Deinit(OPAMP_Type *base); - -/*! - * @brief Get default configuration of OPAMP. - * - * @code - * config->enable = false; - * config->mode = kOPAMP_LowNoiseMode; - * config->trimOption = kOPAMP_TrimOptionDefault; - * config->intRefVoltage = kOPAMP_IntRefVoltVddaDiv2; - * config->enablePosADCSw = false; - * config->posRefVoltage = kOPAMP_PosRefVoltVrefh3; - * config->posGain = kOPAMP_PosGainReserved; - * config->negGain = kOPAMP_NegGainBufferMode; - * @endcode - * - * @param config The pointer to @ref opamp_config_t. - */ -void OPAMP_GetDefaultConfig(opamp_config_t *config); - -/*! @} */ - -/*! - * @name Positive port gain and negative gain configuration. - * @{ - */ -/*! - * @brief Configure OPAMP positive port gain. - * - * @param base OPAMP peripheral base address. - * @param option OPAMP positive port gain. - */ -static inline void OPAMP_DoPosGainConfig(OPAMP_Type *base, opamp_positive_gain_t option) -{ - base->OPAMP_CTR = (((base->OPAMP_CTR) & (~OPAMP_OPAMP_CTR_PGAIN_MASK)) | OPAMP_OPAMP_CTR_PGAIN(option)); -} - -/*! - * @brief Configure OPAMP negative port gain. - * - * @param base OPAMP peripheral base address. - * @param option OPAMP negative port gain. - */ -static inline void OPAMP_DoNegGainConfig(OPAMP_Type *base, opamp_negative_gain_t option) -{ - base->OPAMP_CTR = (((base->OPAMP_CTR) & (~OPAMP_OPAMP_CTR_NGAIN_MASK)) | OPAMP_OPAMP_CTR_NGAIN(option)); -} -/*! @} */ - -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_BUFEN) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_BUFEN -/*! - * @name Reference Buffer Control Interface - * @{ - */ - -/*! - * @brief Enable reference buffer. - * - * @param base OPAMP peripheral base address. - * @param enable true to enable and false to disable. - */ -static inline void OPAMP_EnableRefBuffer(OPAMP_Type *base, bool enable) -{ - if (enable) - { - base->OPAMP_CTR |= OPAMP_OPAMP_CTR_BUFEN_MASK; - } - else - { - base->OPAMP_CTR &= ~(uint32_t)OPAMP_OPAMP_CTR_BUFEN_MASK; - } -} -/*! @} */ -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_BUFEN */ - -#if defined(FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_TRIGMD) && FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_TRIGMD -/*! - * @name Trigger Mode Control Interface - * @{ - */ - -/*! - * @brief Enable OPAMP trigger mode. - * - * @param base OPAMP peripheral base address. - * @param enable true to enable and false to disable. - */ -static inline void OPAMP_EnableTriggerMode(OPAMP_Type *base, bool enable) -{ - if (enable) - { - base->OPAMP_CTR |= OPAMP_OPAMP_CTR_TRIGMD_MASK; - } - else - { - base->OPAMP_CTR &= ~(uint32_t)OPAMP_OPAMP_CTR_TRIGMD_MASK; - } -} -/*! @} */ -#endif /* FSL_FEATURE_OPAMP_HAS_OPAMP_CTR_TRIGMD */ - -#if defined(__cplusplus) -} -#endif - -/*! @} */ - -#endif /* FSL_OPAMP_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_ostimer.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_ostimer.c deleted file mode 100644 index d978556afbc..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_ostimer.c +++ /dev/null @@ -1,384 +0,0 @@ -/* - * Copyright 2018-2021, 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_ostimer.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.ostimer" -#endif - -#if defined(OSTIMER_RSTS) -#define OSTIMER_RESETS_ARRAY OSTIMER_RSTS -#endif - -/* Typedef for interrupt handler. */ -typedef void (*ostimer_isr_t)(OSTIMER_Type *base, ostimer_callback_t cb); - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Gets the instance from the base address - * - * @param base OSTIMER peripheral base address - * - * @return The OSTIMER instance - */ -static uint32_t OSTIMER_GetInstance(OSTIMER_Type *base); - -#if (defined(FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) && FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) -/* @brief Translate the value from gray-code to decimal by the Code Gray in SYSCTL. - * - * @param gray The gray value input. - * - * @return the decimal value. - */ -static uint64_t OSTIMER_GrayToDecimalbyCodeGray(uint64_t gray); -#endif /* FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY. */ - -/******************************************************************************* - * Variables - ******************************************************************************/ -/* Array of OSTIMER handle. */ -static ostimer_callback_t s_ostimerHandle[FSL_FEATURE_SOC_OSTIMER_COUNT]; -/* Array of OSTIMER peripheral base address. */ -static OSTIMER_Type *const s_ostimerBases[] = OSTIMER_BASE_PTRS; -/* Array of OSTIMER IRQ number. */ -static const IRQn_Type s_ostimerIRQ[] = OSTIMER_IRQS; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/* Array of OSTIMER clock name. */ -static const clock_ip_name_t s_ostimerClock[] = OSTIMER_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/* OSTIMER ISR for transactional APIs. */ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -static ostimer_isr_t s_ostimerIsr = (ostimer_isr_t)DefaultISR; -#else -static ostimer_isr_t s_ostimerIsr; -#endif - -#if defined(OSTIMER_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_ostimerResets[] = OSTIMER_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ - -/* @brief Function for getting the instance number of OS timer. */ -static uint32_t OSTIMER_GetInstance(OSTIMER_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_ostimerBases); instance++) - { - if (s_ostimerBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_ostimerBases)); - - return instance; -} - -#if (defined(FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) && FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) -/* @brief Translate the value from gray-code to decimal by the Code Gray in SYSCTL. - * - * @param gray The gray value input. - * - * @return the decimal value. - */ -static uint64_t OSTIMER_GrayToDecimalbyCodeGray(uint64_t gray) -{ - uint64_t decOut; - - SYSCTL->CODE_GRAY_LSB = (uint32_t)(gray & 0xFFFFFFFFU); - SYSCTL->CODE_GRAY_MSB = (uint32_t)((gray >> 32U) & 0x3FFU); // limit to 42bits as OSevent timer - __NOP(); - decOut = ((uint64_t)(SYSCTL->CODE_BIN_MSB) & 0x3FFU) << 32U; - decOut |= (uint64_t)(SYSCTL->CODE_BIN_LSB); - - return decOut; -} -#endif /* FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY. */ - -/* @brief Translate the value from gray-code to decimal. */ -/* - * @param gray The gray value input. - * - * @return the decimal value. - */ -uint64_t OSTIMER_GrayToDecimal(uint64_t gray) -{ -#if (defined(FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) && FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) - return OSTIMER_GrayToDecimalbyCodeGray(gray); -#else - uint64_t temp = gray; - while (temp != 0U) - { - temp >>= 1U; - gray ^= temp; - } - - return gray; -#endif /* FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY. */ -} - -/* @brief Enable the OSTIMER interrupt. - * - * After calling this function, the OSTIMER driver will enable/disable the IRQ and module interrupt enablement. - * - * @param base OSTIMER peripheral base address. - * @param enable enable/disable the IRQ and module interrupt enablement. - * - true: Disable the IRQ and module interrupt enablement. - * - false: Disable the IRQ and module interrupt enablement. - * @return none - */ -static void OSTIMER_EnableInterrupt(OSTIMER_Type *base, bool enable) -{ - assert(NULL != base); - - if (enable) - { - /* Enable the IRQ and module interrupt enablement. */ - (void)EnableIRQ(s_ostimerIRQ[OSTIMER_GetInstance(base)]); - base->OSEVENT_CTRL |= OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_MASK; - } - else - { - /* Clear interrupt flag, disable the IRQ and module interrupt enablement. */ - (void)DisableIRQ(s_ostimerIRQ[OSTIMER_GetInstance(base)]); - base->OSEVENT_CTRL &= ~OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_MASK; /* Clear interrupt flag by writing 1. */ - } -} - -/*! - * @brief Initializes an OSTIMER by turning it's clock on. - * - */ -void OSTIMER_Init(OSTIMER_Type *base) -{ - assert(NULL != base); - - uint32_t instance = OSTIMER_GetInstance(base); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#if !(defined(FSL_FEATURE_PMC_HAS_NO_OSTIMER_REG) && FSL_FEATURE_PMC_HAS_NO_OSTIMER_REG) - /* Enable the OSTIMER 32k clock in PMC module. */ - CLOCK_EnableOstimer32kClock(); -#endif - /* Enable clock for OSTIMER. */ - CLOCK_EnableClock(s_ostimerClock[instance]); -#if (defined(FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) && FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) - CLOCK_EnableClock(kCLOCK_Sysctl); -#endif /* FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY. */ -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(OSTIMER_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_ostimerResets[OSTIMER_GetInstance(base)]); -#endif -} - -/*! - * @brief Deinitializes a OSTIMER instance. - * - * This function shuts down OSTIMER clock - * - * @param base OSTIMER peripheral base address. - */ -void OSTIMER_Deinit(OSTIMER_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable clock for OSTIMER. */ - CLOCK_DisableClock(s_ostimerClock[OSTIMER_GetInstance(base)]); -#if (defined(FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) && FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY) - CLOCK_DisableClock(kCLOCK_Sysctl); -#endif /* FSL_FEATURE_SYSCTRL_HAS_CODE_GRAY. */ -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * @brief Get OSTIMER status Flags. - * - * This returns the status flag. - * Currently, only match interrupt flag can be got. - * - * @param base OSTIMER peripheral base address. - * @return status register value - */ -uint32_t OSTIMER_GetStatusFlags(OSTIMER_Type *base) -{ - return base->OSEVENT_CTRL & OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG_MASK; -} - -/*! - * @brief Clear Status Interrupt Flags. - * - * This clears intr status flag. - * Currently, only match interrupt flag can be cleared. - * - * @param base OSTIMER peripheral base address. - * @param mask Clear bit mask. - * @return none - */ -void OSTIMER_ClearStatusFlags(OSTIMER_Type *base, uint32_t mask) -{ - base->OSEVENT_CTRL |= mask; -} - -/*! - * @brief Set the match raw value for OSTIMER. - * - * This function will set a match value for OSTIMER with an optional callback. And this callback - * will be called while the data in dedicated pair match register is equals to the value of central EVTIMER. - * Please note that, the data format is gray-code, if decimal data was desired, please using OSTIMER_SetMatchValue(). - * - * @param base OSTIMER peripheral base address. - * @param count OSTIMER timer match value.(Value is gray-code format) - * - * @param cb OSTIMER callback (can be left as NULL if none, otherwise should be a void func(void)). - * @retval kStatus_Success - Set match raw value and enable interrupt Successfully. - * @retval kStatus_Fail - Set match raw value fail. - */ -status_t OSTIMER_SetMatchRawValue(OSTIMER_Type *base, uint64_t count, ostimer_callback_t cb) -{ -#ifdef OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK - uint64_t decValueTimer; -#endif - status_t status; - uint64_t tmp = count; - uint32_t instance = OSTIMER_GetInstance(base); - - /* Clear interrupt flag, disable the IRQ and module interrupt enablement. */ - OSTIMER_EnableInterrupt(base, false); - - s_ostimerIsr = OSTIMER_HandleIRQ; - s_ostimerHandle[instance] = cb; - - /* Set the match value. */ - base->MATCH_L = (uint32_t)tmp; - base->MATCH_H = (uint32_t)(tmp >> 32U); - -#ifdef OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK - /* Workaround-2019-12-30: - * Since OSTimer's counter register is Gray-encoded, it would cost more time to write register. When EVTimer Match - * Write Ready bit is low, which means the previous match value has been updated successfully by that time, it is - * safe to reload (write) the Match Registers. Even if there is the RM comment that "In typical applications, it - * should not be necessary to test this bit", but we found the interruption would not be reported when the delta - * timer user added is smaller(IE: RT595 11us in 1MHz typical application) in release version." To prevent such - * issue from happening, we'd better wait for the match value to update successfully before enabling IRQ. - */ - while (0U != (base->OSEVENT_CTRL & OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK)) - { - } - - /* After the WR_RDY bit became low, we need to check whether current time goes ahead of the match value we set. - * (1) If current timer value has gone ahead of the match value, the interrupt will not be reported before 64-bit - * timer value over flow. We need to check whether the interrupt flag has been set or not: if yes, we will enable - * interrupt and return success; if not, we will return fail directly. - * (2) If current timer value has not gone ahead of match value, we will enable interrupt and return success. - */ - decValueTimer = OSTIMER_GetCurrentTimerValue(base); - if ((decValueTimer >= OSTIMER_GrayToDecimal(tmp)) && - (0U == (base->OSEVENT_CTRL & (uint32_t)kOSTIMER_MatchInterruptFlag))) - { - status = kStatus_Fail; - } - else -#endif /* #ifdef OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK */ - { - /* Enable the module interrupt enablement. */ - OSTIMER_EnableInterrupt(base, true); - status = kStatus_Success; - } - - return status; -} - -/*! - * @brief Set the match value for OSTIMER. - * - * This function will set a match value for OSTIMER with an optional callback. And this callback - * will be called while the data in dedicated pair match register is equals to the value of central EVTIMER. - * - * @param base OSTIMER peripheral base address. - * @param count OSTIMER timer match value.(Value is decimal format, and this value will be translate to Gray code in - * API. ) - * @param cb OSTIMER callback (can be left as NULL if none, otherwise should be a void func(void)). - * @retval kStatus_Success - Set match value and enable interrupt Successfully. - * @retval kStatus_Fail - Set match value fail. - */ -status_t OSTIMER_SetMatchValue(OSTIMER_Type *base, uint64_t count, ostimer_callback_t cb) -{ - uint64_t tmp = OSTIMER_DecimalToGray(count); - - return OSTIMER_SetMatchRawValue(base, tmp, cb); -} - -/*! - * @brief Get current timer count value from OSTIMER. - * - * This function will get a decimal timer count value. - * The RAW value of timer count is gray code format, will be translated to decimal data internally. - * - * @param base OSTIMER peripheral base address. - * @return Value of OSTIMER which will formated to decimal value. - */ -uint64_t OSTIMER_GetCurrentTimerValue(OSTIMER_Type *base) -{ - uint64_t tmp = 0U; - - tmp = OSTIMER_GetCurrentTimerRawValue(base); - - return OSTIMER_GrayToDecimal(tmp); -} - -/*! - * @brief Get the capture value from OSTIMER. - * - * This function will get a capture decimal-value from OSTIMER. - * The RAW value of timer capture is gray code format, will be translated to decimal data internally. - * - * @param base OSTIMER peripheral base address. - * @return Value of capture register, data format is decimal. - */ -uint64_t OSTIMER_GetCaptureValue(OSTIMER_Type *base) -{ - uint64_t tmp = 0U; - - tmp = OSTIMER_GetCaptureRawValue(base); - - return OSTIMER_GrayToDecimal(tmp); -} - -void OSTIMER_HandleIRQ(OSTIMER_Type *base, ostimer_callback_t cb) -{ - /* Clear interrupt flag, disable the IRQ and module interrupt enablement. */ - OSTIMER_EnableInterrupt(base, false); - - if (cb != NULL) - { - cb(); - } -} - -void OS_EVENT_DriverIRQHandler(void); -void OS_EVENT_DriverIRQHandler(void) -{ - s_ostimerIsr(s_ostimerBases[0], s_ostimerHandle[0]); - SDK_ISR_EXIT_BARRIER; -} - diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_ostimer.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_ostimer.h deleted file mode 100644 index 51b1f45503f..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_ostimer.h +++ /dev/null @@ -1,273 +0,0 @@ -/* - * Copyright 2018-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_OSTIMER_H_ -#define FSL_OSTIMER_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup ostimer - * @{ - */ - -/*! @file*/ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief OSTIMER driver version. */ -#define FSL_OSTIMER_DRIVER_VERSION (MAKE_VERSION(2, 2, 2)) -/*! @} */ - -/*! - * @brief OSTIMER status flags. - */ -enum _ostimer_flags -{ - kOSTIMER_MatchInterruptFlag = (OSTIMER_OSEVENT_CTRL_OSTIMER_INTRFLAG_MASK), /*!< Match interrupt flag bit, sets if - the match value was reached. */ -}; - -/*! @brief ostimer callback function. */ -typedef void (*ostimer_callback_t)(void); - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* _cplusplus */ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Initializes an OSTIMER by turning its bus clock on - * - */ -void OSTIMER_Init(OSTIMER_Type *base); - -/*! - * @brief Deinitializes a OSTIMER instance. - * - * This function shuts down OSTIMER bus clock - * - * @param base OSTIMER peripheral base address. - */ -void OSTIMER_Deinit(OSTIMER_Type *base); - -/*! - * @brief Translate the value from gray-code to decimal. - * - * @param gray The gray value input. - * @return The decimal value. - */ -uint64_t OSTIMER_GrayToDecimal(uint64_t gray); - -/*! - * @brief Translate the value from decimal to gray-code. - * - * @param dec The decimal value. - * @return The gray code of the input value. - */ -static inline uint64_t OSTIMER_DecimalToGray(uint64_t dec) -{ - return (dec ^ (dec >> 1U)); -} - -/*! - * @brief Get OSTIMER status Flags. - * - * This returns the status flag. - * Currently, only match interrupt flag can be got. - * - * @param base OSTIMER peripheral base address. - * @return status register value - */ -uint32_t OSTIMER_GetStatusFlags(OSTIMER_Type *base); - -/*! - * @brief Clear Status Interrupt Flags. - * - * This clears intrrupt status flag. - * Currently, only match interrupt flag can be cleared. - * - * @param base OSTIMER peripheral base address. - * @param mask Clear bit mask. - * @return none - */ -void OSTIMER_ClearStatusFlags(OSTIMER_Type *base, uint32_t mask); - -/*! - * @brief Set the match raw value for OSTIMER. - * - * This function will set a match value for OSTIMER with an optional callback. And this callback - * will be called while the data in dedicated pair match register is equals to the value of central EVTIMER. - * Please note that, the data format is gray-code, if decimal data was desired, please using OSTIMER_SetMatchValue(). - * - * @param base OSTIMER peripheral base address. - * @param count OSTIMER timer match value.(Value is gray-code format) - * - * @param cb OSTIMER callback (can be left as NULL if none, otherwise should be a void func(void)). - * @retval kStatus_Success - Set match raw value and enable interrupt Successfully. - * @retval kStatus_Fail - Set match raw value fail. - */ -status_t OSTIMER_SetMatchRawValue(OSTIMER_Type *base, uint64_t count, ostimer_callback_t cb); - -/*! - * @brief Set the match value for OSTIMER. - * - * This function will set a match value for OSTIMER with an optional callback. And this callback - * will be called while the data in dedicated pair match register is equals to the value of central OS TIMER. - * - * @param base OSTIMER peripheral base address. - * @param count OSTIMER timer match value.(Value is decimal format, and this value will be translate to Gray code - * internally.) - * - * @param cb OSTIMER callback (can be left as NULL if none, otherwise should be a void func(void)). - * @retval kStatus_Success - Set match value and enable interrupt Successfully. - * @retval kStatus_Fail - Set match value fail. - */ -status_t OSTIMER_SetMatchValue(OSTIMER_Type *base, uint64_t count, ostimer_callback_t cb); - -/*! - * @brief Set value to OSTIMER MATCH register directly. - * - * This function writes the input value to OSTIMER MATCH register directly, - * it does not touch any other registers. Note that, the data format is - * gray-code. The function @ref OSTIMER_DecimalToGray could convert decimal - * value to gray code. - * - * @param base OSTIMER peripheral base address. - * @param value OSTIMER timer match value (Value is gray-code format). - */ -static inline void OSTIMER_SetMatchRegister(OSTIMER_Type *base, uint64_t value) -{ -#ifdef OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK - /* Wait for MATCH register ready for write. */ - while (0U != (base->OSEVENT_CTRL & OSTIMER_OSEVENT_CTRL_MATCH_WR_RDY_MASK)) - { - } -#endif - - base->MATCH_L = (uint32_t)value; - base->MATCH_H = (uint32_t)(value >> 32U); -} - -/*! - * @brief Enable the OSTIMER counter match interrupt. - * - * Enable the timer counter match interrupt. The interrupt happens when OSTIMER - * counter matches the value in MATCH registers. - * - * @param base OSTIMER peripheral base address. - */ -static inline void OSTIMER_EnableMatchInterrupt(OSTIMER_Type *base) -{ - base->OSEVENT_CTRL |= OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_MASK; -} - -/*! - * @brief Disable the OSTIMER counter match interrupt. - * - * Disable the timer counter match interrupt. The interrupt happens when OSTIMER - * counter matches the value in MATCH registers. - * - * @param base OSTIMER peripheral base address. - */ -static inline void OSTIMER_DisableMatchInterrupt(OSTIMER_Type *base) -{ - base->OSEVENT_CTRL &= ~OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_MASK; -} - -/*! - * @brief Get current timer raw count value from OSTIMER. - * - * This function will get a gray code type timer count value from OS timer register. - * The raw value of timer count is gray code format. - * - * @param base OSTIMER peripheral base address. - * @return Raw value of OSTIMER, gray code format. - */ -static inline uint64_t OSTIMER_GetCurrentTimerRawValue(OSTIMER_Type *base) -{ - uint64_t tmp = 0U; - - tmp = base->EVTIMERL; - tmp |= (uint64_t)(base->EVTIMERH) << 32U; - - return tmp; -} - -/*! - * @brief Get current timer count value from OSTIMER. - * - * This function will get a decimal timer count value. - * The RAW value of timer count is gray code format, will be translated to decimal data internally. - * - * @param base OSTIMER peripheral base address. - * @return Value of OSTIMER which will be formated to decimal value. - */ -uint64_t OSTIMER_GetCurrentTimerValue(OSTIMER_Type *base); - -/*! - * @brief Get the capture value from OSTIMER. - * - * This function will get a captured gray-code value from OSTIMER. - * The Raw value of timer capture is gray code format. - * - * @param base OSTIMER peripheral base address. - * @return Raw value of capture register, data format is gray code. - */ -static inline uint64_t OSTIMER_GetCaptureRawValue(OSTIMER_Type *base) -{ - uint64_t tmp = 0U; - - tmp = base->CAPTURE_L; - tmp |= (uint64_t)(base->CAPTURE_H) << 32U; - - return tmp; -} - -/*! - * @brief Get the capture value from OSTIMER. - * - * This function will get a capture decimal-value from OSTIMER. - * The RAW value of timer capture is gray code format, will be translated to decimal data internally. - * - * @param base OSTIMER peripheral base address. - * @return Value of capture register, data format is decimal. - */ -uint64_t OSTIMER_GetCaptureValue(OSTIMER_Type *base); - -/*! - * @brief OS timer interrupt Service Handler. - * - * This function handles the interrupt and refers to the callback array in the driver to callback user (as per request - * in OSTIMER_SetMatchValue()). - * if no user callback is scheduled, the interrupt will simply be cleared. - * - * @param base OS timer peripheral base address. - * @param cb callback scheduled for this instance of OS timer - * @return none - */ -void OSTIMER_HandleIRQ(OSTIMER_Type *base, ostimer_callback_t cb); -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_OSTIMER_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_pdm.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_pdm.c deleted file mode 100644 index 2132ed2a1d5..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_pdm.c +++ /dev/null @@ -1,969 +0,0 @@ -/* - * Copyright (c) 2018, Freescale Semiconductor, Inc. - * Copyright 2019-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_pdm.h" -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.pdm" -#endif - -/******************************************************************************* - * Definitations - ******************************************************************************/ -/*! @brief Typedef for pdm rx interrupt handler. */ -typedef void (*pdm_isr_t)(PDM_Type *base, pdm_handle_t *pdmHandle); -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#if !(defined FSL_FEATURE_PDM_HAS_NO_MINIMUM_CLKDIV && FSL_FEATURE_PDM_HAS_NO_MINIMUM_CLKDIV) -/*! - * @brief Get the instance number for PDM. - * - * @param channelMask enabled channel. - * @param qualitymode selected quality mode. - * @param osr oversample rate. - * @param regdiv register divider. - */ -static status_t PDM_ValidateSrcClockRate(uint32_t channelMask, - pdm_df_quality_mode_t qualityMode, - uint8_t osr, - uint32_t regDiv); -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ -/* Base pointer array */ -static PDM_Type *const s_pdmBases[] = PDM_BASE_PTRS; -/*!@brief PDM handle pointer */ -static pdm_handle_t *s_pdmHandle[ARRAY_SIZE(s_pdmBases)]; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/* Clock name array */ -static const clock_ip_name_t s_pdmClock[] = PDM_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#if defined(FSL_PDM_HAS_FILTER_CLOCK_GATE) && FSL_PDM_HAS_FILTER_CLOCK_GATE -/* Clock name array */ -static const clock_ip_name_t s_pdmFilterClock[] = PDM_FILTER_CLOCKS; -#endif -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/*! @brief Pointer to tx IRQ handler for each instance. */ -static pdm_isr_t s_pdmIsr; -#if !(defined(FSL_FEATURE_PDM_HAS_NO_HWVAD) && FSL_FEATURE_PDM_HAS_NO_HWVAD) -/*! @brief callback for hwvad. */ -static pdm_hwvad_notification_t s_pdm_hwvad_notification[ARRAY_SIZE(s_pdmBases)]; -#endif -/******************************************************************************* - * Code - ******************************************************************************/ -uint32_t PDM_GetInstance(PDM_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_pdmBases); instance++) - { - if (s_pdmBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_pdmBases)); - - return instance; -} - -/*! - * brief PDM read fifo. - * Note: This function support 16 bit only for IP version that only supports 16bit. - * - * param base PDM base pointer. - * param startChannel start channel number. - * param channelNums total enabled channelnums. - * param buffer received buffer address. - * param size number of samples to read. - * param dataWidth sample width. - */ -void PDM_ReadFifo( - PDM_Type *base, uint32_t startChannel, uint32_t channelNums, void *buffer, size_t size, uint32_t dataWidth) -{ - uint32_t i = 0, j = 0U; - uint32_t *dataAddr = (uint32_t *)buffer; - - for (i = 0U; i < size; i++) - { - for (j = 0; j < channelNums; j++) - { -#if defined(FSL_FEATURE_PDM_FIFO_WIDTH) && (FSL_FEATURE_PDM_FIFO_WIDTH != 2U) - *dataAddr = base->DATACH[startChannel + j] >> (dataWidth == 4U ? 0U : 8U); - dataAddr = (uint32_t *)((uint32_t)dataAddr + dataWidth); -#else - *dataAddr = base->DATACH[startChannel + j]; - dataAddr = (uint32_t *)((uint32_t)dataAddr + 2U); -#endif - } - } -} - -#if defined(FSL_FEATURE_PDM_FIFO_WIDTH) && (FSL_FEATURE_PDM_FIFO_WIDTH == 2U) -/*! - * brief PDM read data non blocking, only support 16bit data read. - * So the actually read data byte size in this function is (size * 2 * channelNums). - * param base PDM base pointer. - * param startChannel start channel number. - * param channelNums total enabled channelnums. - * param buffer received buffer address. - * param size number of 16bit data to read. - */ -void PDM_ReadNonBlocking(PDM_Type *base, uint32_t startChannel, uint32_t channelNums, int16_t *buffer, size_t size) -{ - uint32_t i = 0, j = 0U; - - for (i = 0U; i < size; i++) - { - for (j = 0; j < channelNums; j++) - { - *buffer++ = (int16_t)base->DATACH[startChannel + j]; - } - } -} -#endif - -#if !(defined FSL_FEATURE_PDM_HAS_NO_MINIMUM_CLKDIV && FSL_FEATURE_PDM_HAS_NO_MINIMUM_CLKDIV) -static status_t PDM_ValidateSrcClockRate(uint32_t channelMask, - pdm_df_quality_mode_t qualityMode, - uint8_t osr, - uint32_t regDiv) -{ - uint32_t enabledChannel = 0U, i = 0U, factor = 0U, k = 0U; - - for (i = 0U; i < (uint32_t)FSL_FEATURE_PDM_CHANNEL_NUM; i++) - { - if (((channelMask >> i) & 0x01U) != 0U) - { - enabledChannel++; - } - } - - switch (qualityMode) - { - case kPDM_QualityModeMedium: - factor = FSL_FEATURE_PDM_HIGH_QUALITY_CLKDIV_FACTOR; - k = 2U; - break; - - case kPDM_QualityModeHigh: - factor = FSL_FEATURE_PDM_HIGH_QUALITY_CLKDIV_FACTOR; - k = 1U; - break; - - case kPDM_QualityModeLow: - factor = FSL_FEATURE_PDM_HIGH_QUALITY_CLKDIV_FACTOR; - k = 4U; - break; - - case kPDM_QualityModeVeryLow0: - factor = FSL_FEATURE_PDM_VERY_LOW_QUALITY_CLKDIV_FACTOR; - k = 2U; - break; - - case kPDM_QualityModeVeryLow1: - factor = FSL_FEATURE_PDM_VERY_LOW_QUALITY_CLKDIV_FACTOR; - k = 4U; - break; - - case kPDM_QualityModeVeryLow2: - factor = FSL_FEATURE_PDM_VERY_LOW_QUALITY_CLKDIV_FACTOR; - k = 8U; - break; - - default: - assert(false); - break; - } - - /* validate the minimum clock divider */ - /* 2U is for canculating k, 100U is for determing the specific float number of clock divider */ - if (((regDiv * k) / 2U * 100U) < (((10U + factor * enabledChannel) * 100U / (8U * osr)) * k / 2U)) - { - return kStatus_Fail; - } - - return kStatus_Success; -} -#endif - -/*! - * brief PDM set sample rate. - * - * note This function is depend on the configuration of the PDM and PDM channel, so the correct call sequence is - * code - * PDM_Init(base, pdmConfig) - * PDM_SetChannelConfig(base, channel, &channelConfig) - * PDM_SetSampleRateConfig(base, source, sampleRate) - * endcode - * param base PDM base pointer - * param sourceClock_HZ PDM source clock frequency. - * param sampleRate_HZ PDM sample rate. - */ -status_t PDM_SetSampleRateConfig(PDM_Type *base, uint32_t sourceClock_HZ, uint32_t sampleRate_HZ) -{ - uint32_t osr = (base->CTRL_2 & PDM_CTRL_2_CICOSR_MASK) >> PDM_CTRL_2_CICOSR_SHIFT; -#if !(defined FSL_FEATURE_PDM_HAS_NO_MINIMUM_CLKDIV && FSL_FEATURE_PDM_HAS_NO_MINIMUM_CLKDIV) - pdm_df_quality_mode_t qualityMode = - (pdm_df_quality_mode_t)(uint32_t)((base->CTRL_2 & PDM_CTRL_2_QSEL_MASK) >> PDM_CTRL_2_QSEL_SHIFT); - uint32_t enabledChannelMask = base->CTRL_1 & (uint32_t)kPDM_EnableChannelAll; -#endif - - uint32_t pdmClockRate = 0U; - uint32_t regDiv = 0U; - - /* get divider */ - osr = (PDM_CTRL_2_CICOSR_MASK >> PDM_CTRL_2_CICOSR_SHIFT) + 1U - osr; - pdmClockRate = sampleRate_HZ * osr * 8U; - regDiv = sourceClock_HZ / pdmClockRate; - - if (regDiv > PDM_CTRL_2_CLKDIV_MASK) - { - return kStatus_Fail; - } - -#if !(defined FSL_FEATURE_PDM_HAS_NO_MINIMUM_CLKDIV && FSL_FEATURE_PDM_HAS_NO_MINIMUM_CLKDIV) - if (PDM_ValidateSrcClockRate(enabledChannelMask, qualityMode, (uint8_t)osr, regDiv) == kStatus_Fail) - { - return kStatus_Fail; - } -#endif - - base->CTRL_2 = (base->CTRL_2 & (~PDM_CTRL_2_CLKDIV_MASK)) | PDM_CTRL_2_CLKDIV(regDiv); - - return kStatus_Success; -} - -/*! - * brief PDM set sample rate. - * - * deprecated Do not use this function. It has been superceded by @ref PDM_SetSampleRateConfig - * param base PDM base pointer - * param enableChannelMask PDM channel enable mask. - * param qualityMode quality mode. - * param osr cic oversample rate - * param clkDiv clock divider - */ -status_t PDM_SetSampleRate( - PDM_Type *base, uint32_t enableChannelMask, pdm_df_quality_mode_t qualityMode, uint8_t osr, uint32_t clkDiv) -{ -#if !(defined FSL_FEATURE_PDM_HAS_NO_MINIMUM_CLKDIV && FSL_FEATURE_PDM_HAS_NO_MINIMUM_CLKDIV) - uint8_t realOsr = (PDM_CTRL_2_CICOSR_MASK >> PDM_CTRL_2_CICOSR_SHIFT) + 1U - - (osr & (PDM_CTRL_2_CICOSR_MASK >> PDM_CTRL_2_CICOSR_SHIFT)); -#endif - uint32_t regDiv = clkDiv >> 1U; - - switch (qualityMode) - { - case kPDM_QualityModeHigh: - regDiv <<= 1U; - break; - case kPDM_QualityModeLow: - case kPDM_QualityModeVeryLow1: - regDiv >>= 1U; - break; - case kPDM_QualityModeVeryLow2: - regDiv >>= 2U; - break; - default: - assert(false); - break; - } - -#if !(defined FSL_FEATURE_PDM_HAS_NO_MINIMUM_CLKDIV && FSL_FEATURE_PDM_HAS_NO_MINIMUM_CLKDIV) - if (PDM_ValidateSrcClockRate(enableChannelMask, qualityMode, realOsr, regDiv) == kStatus_Fail) - { - return kStatus_Fail; - } -#endif - - assert(regDiv <= PDM_CTRL_2_CLKDIV_MASK); - base->CTRL_2 = (base->CTRL_2 & (~PDM_CTRL_2_CLKDIV_MASK)) | PDM_CTRL_2_CLKDIV(regDiv); - - return kStatus_Success; -} - -/*! - * brief Initializes the PDM peripheral. - * - * Ungates the PDM clock, resets the module, and configures PDM with a configuration structure. - * The configuration structure can be custom filled or set with default values by - * PDM_GetDefaultConfig(). - * - * note This API should be called at the beginning of the application to use - * the PDM driver. Otherwise, accessing the PDM module can cause a hard fault - * because the clock is not enabled. - * - * param base PDM base pointer - * param config PDM configuration structure. - */ -void PDM_Init(PDM_Type *base, const pdm_config_t *config) -{ - assert(config != NULL); - assert(config->fifoWatermark <= PDM_FIFO_CTRL_FIFOWMK_MASK); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the PDM clock */ - CLOCK_EnableClock(s_pdmClock[PDM_GetInstance(base)]); -#if defined(FSL_PDM_HAS_FILTER_CLOCK_GATE) && FSL_PDM_HAS_FILTER_CLOCK_GATE - CLOCK_EnableClock(s_pdmFilterClock[PDM_GetInstance(base)]); -#endif -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - /* Enable the module and disable the interface/all channel */ - base->CTRL_1 &= - ~(PDM_CTRL_1_MDIS_MASK | PDM_CTRL_1_PDMIEN_MASK | PDM_CTRL_1_ERREN_MASK | (uint32_t)kPDM_EnableChannelAll); - - /* wait all filter stopped */ - while ((base->STAT & PDM_STAT_BSY_FIL_MASK) != 0U) - { - } - - /* software reset */ - base->CTRL_1 |= PDM_CTRL_1_SRES_MASK; - - /* Set the configure settings */ -#if !(defined(FSL_FEATURE_PDM_HAS_NO_DOZEN) && FSL_FEATURE_PDM_HAS_NO_DOZEN) - PDM_EnableDoze(base, config->enableDoze); -#endif - base->CTRL_2 = (base->CTRL_2 & (~(PDM_CTRL_2_CICOSR_MASK | PDM_CTRL_2_QSEL_MASK))) | - PDM_CTRL_2_CICOSR(config->cicOverSampleRate) | PDM_CTRL_2_QSEL(config->qualityMode); - -#if defined(FSL_FEATURE_PDM_HAS_DECIMATION_FILTER_BYPASS) && FSL_FEATURE_PDM_HAS_DECIMATION_FILTER_BYPASS - base->CTRL_2 = (base->CTRL_2 & ~PDM_CTRL_2_DEC_BYPASS_MASK) | PDM_CTRL_2_DEC_BYPASS(config->enableFilterBypass); -#endif - /* Set the watermark */ - base->FIFO_CTRL = PDM_FIFO_CTRL_FIFOWMK(config->fifoWatermark); -} - -/*! - * brief De-initializes the PDM peripheral. - * - * This API gates the PDM clock. The PDM module can't operate unless PDM_Init - * is called to enable the clock. - * - * param base PDM base pointer - */ -void PDM_Deinit(PDM_Type *base) -{ - /* disable PDM interface */ - PDM_DisableInterrupts(base, (uint32_t)kPDM_FIFOInterruptEnable | (uint32_t)kPDM_ErrorInterruptEnable); - PDM_Enable(base, false); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_DisableClock(s_pdmClock[PDM_GetInstance(base)]); -#if defined(FSL_PDM_HAS_FILTER_CLOCK_GATE) && FSL_PDM_HAS_FILTER_CLOCK_GATE - CLOCK_DisableClock(s_pdmFilterClock[PDM_GetInstance(base)]); -#endif -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Enables the PDM interrupt requests. - * - * param base PDM base pointer - * param mask interrupt source - * The parameter can be a combination of the following sources if defined. - * arg kPDM_ErrorInterruptEnable - * arg kPDM_FIFOInterruptEnable - */ -void PDM_EnableInterrupts(PDM_Type *base, uint32_t mask) -{ - if ((mask & (uint32_t)kPDM_FIFOInterruptEnable) != 0U) - { - base->CTRL_1 = (base->CTRL_1 & (~PDM_CTRL_1_DISEL_MASK)) | (uint32_t)kPDM_FIFOInterruptEnable; - } - if ((mask & (uint32_t)kPDM_ErrorInterruptEnable) != 0U) - { - base->CTRL_1 = (base->CTRL_1 & (~PDM_CTRL_1_ERREN_MASK)) | (uint32_t)kPDM_ErrorInterruptEnable; - } -} - -/*! - * brief PDM one channel configurations. - * - * param base PDM base pointer - * param config PDM channel configurations. - * param channel channel number. - * after completing the current frame in debug mode. - */ -void PDM_SetChannelConfig(PDM_Type *base, uint32_t channel, const pdm_channel_config_t *config) -{ - assert(config != NULL); - assert(channel <= (uint32_t)FSL_FEATURE_PDM_CHANNEL_NUM); - - uint32_t dcCtrl = 0U; - -#if (defined(FSL_FEATURE_PDM_HAS_DC_OUT_CTRL) && (FSL_FEATURE_PDM_HAS_DC_OUT_CTRL)) - dcCtrl = base->DC_OUT_CTRL; - /* configure gain and cut off freq */ - dcCtrl &= ~((uint32_t)PDM_DC_OUT_CTRL_DCCONFIG0_MASK << (channel << 1U)); - dcCtrl |= (uint32_t)config->outputCutOffFreq << (channel << 1U); - base->DC_OUT_CTRL = dcCtrl; -#endif - -#if !(defined(FSL_FEATURE_PDM_DC_CTRL_VALUE_FIXED) && (FSL_FEATURE_PDM_DC_CTRL_VALUE_FIXED)) - dcCtrl = base->DC_CTRL; - /* configure gain and cut off freq */ - dcCtrl &= ~((uint32_t)PDM_DC_CTRL_DCCONFIG0_MASK << (channel << 1U)); - dcCtrl |= (uint32_t)config->cutOffFreq << (channel << 1U); - base->DC_CTRL = dcCtrl; -#endif - - PDM_SetChannelGain(base, channel, config->gain); - - /* enable channel */ - base->CTRL_1 |= 1UL << channel; -} - -/*! - * brief Set the PDM channel gain. - * - * Please note for different quality mode, the valid gain value is different, reference RM for detail. - * param base PDM base pointer. - * param channel PDM channel index. - * param gain channel gain, the register gain value range is 0 - 15. - */ -void PDM_SetChannelGain(PDM_Type *base, uint32_t channel, pdm_df_output_gain_t gain) -{ - assert(channel <= (uint32_t)FSL_FEATURE_PDM_CHANNEL_NUM); - -#if defined(FSL_FEATURE_PDM_HAS_RANGE_CTRL) && FSL_FEATURE_PDM_HAS_RANGE_CTRL - uint32_t outCtrl = base->RANGE_CTRL; -#else - uint32_t outCtrl = base->OUT_CTRL; -#endif - -#if defined(FSL_FEATURE_PDM_HAS_RANGE_CTRL) && FSL_FEATURE_PDM_HAS_RANGE_CTRL - outCtrl &= ~((uint32_t)PDM_RANGE_CTRL_RANGEADJ0_MASK << (channel << 2U)); -#else - outCtrl &= ~((uint32_t)PDM_OUT_CTRL_OUTGAIN0_MASK << (channel << 2U)); -#endif - - outCtrl |= (uint32_t)gain << (channel << 2U); - -#if defined(FSL_FEATURE_PDM_HAS_RANGE_CTRL) && FSL_FEATURE_PDM_HAS_RANGE_CTRL - base->RANGE_CTRL = outCtrl; -#else - base->OUT_CTRL = outCtrl; -#endif -} - -/*! - * brief PDM set channel transfer config. - * - * param base PDM base pointer. - * param handle PDM handle pointer. - * param channel PDM channel. - * param config channel config. - * param format data format. - */ -status_t PDM_TransferSetChannelConfig( - PDM_Type *base, pdm_handle_t *handle, uint32_t channel, const pdm_channel_config_t *config, uint32_t format) -{ - assert(handle != NULL); - - PDM_SetChannelConfig(base, channel, config); - - handle->format = format; - - if (handle->channelNums == 0U) - { - handle->startChannel = (uint8_t)channel; - } - - handle->channelNums++; - - if (handle->channelNums > (uint8_t)FSL_FEATURE_PDM_CHANNEL_NUM) - { - return kStatus_PDM_ChannelConfig_Failed; - } - - return kStatus_Success; -} - -/*! - * brief Initializes the PDM handle. - * - * This function initializes the handle for the PDM transactional APIs. Call - * this function once to get the handle initialized. - * - * param base PDM base pointer. - * param handle PDM handle pointer. - * param callback Pointer to the user callback function. - * param userData User parameter passed to the callback function. - */ -void PDM_TransferCreateHandle(PDM_Type *base, pdm_handle_t *handle, pdm_transfer_callback_t callback, void *userData) -{ - assert(handle != NULL); - - /* Zero the handle */ - (void)memset(handle, 0, sizeof(*handle)); - - s_pdmHandle[PDM_GetInstance(base)] = handle; - - handle->callback = callback; - handle->userData = userData; - handle->watermark = (uint8_t)(base->FIFO_CTRL & PDM_FIFO_CTRL_FIFOWMK_MASK); - - /* Set the isr pointer */ - s_pdmIsr = PDM_TransferHandleIRQ; - - /* Enable RX event IRQ */ - (void)EnableIRQ(PDM_EVENT_IRQn); -#if !(defined FSL_FEATURE_PDM_HAS_NO_INDEPENDENT_ERROR_IRQ && FSL_FEATURE_PDM_HAS_NO_INDEPENDENT_ERROR_IRQ) - /* Enable FIFO error IRQ */ - (void)EnableIRQ(PDM_ERROR_IRQn); -#endif -} - -/*! - * brief Performs an interrupt non-blocking receive transfer on PDM. - * - * note This API returns immediately after the transfer initiates. - * Call the PDM_RxGetTransferStatusIRQ to poll the transfer status and check whether - * the transfer is finished. If the return status is not kStatus_PDM_Busy, the transfer - * is finished. - * - * param base PDM base pointer - * param handle Pointer to the pdm_handle_t structure which stores the transfer state. - * param xfer Pointer to the pdm_transfer_t structure. - * retval kStatus_Success Successfully started the data receive. - * retval kStatus_PDM_Busy Previous receive still not finished. - */ -status_t PDM_TransferReceiveNonBlocking(PDM_Type *base, pdm_handle_t *handle, pdm_transfer_t *xfer) -{ - assert(handle != NULL); - - /* Check if the queue is full */ - if (handle->pdmQueue[handle->queueUser].data != NULL) - { - return kStatus_PDM_QueueFull; - } - - /* Add into queue */ - handle->transferSize[handle->queueUser] = xfer->dataSize; - handle->pdmQueue[handle->queueUser].data = xfer->data; - handle->pdmQueue[handle->queueUser].dataSize = xfer->dataSize; - handle->queueUser = (handle->queueUser + 1U) % PDM_XFER_QUEUE_SIZE; - - /* Set state to busy */ - handle->state = kStatus_PDM_Busy; - - /* Enable interrupt */ - PDM_EnableInterrupts(base, (uint32_t)kPDM_FIFOInterruptEnable); - - PDM_Enable(base, true); - - return kStatus_Success; -} - -/*! - * brief Aborts the current IRQ receive. - * - * note This API can be called when an interrupt non-blocking transfer initiates - * to abort the transfer early. - * - * param base PDM base pointer - * param handle Pointer to the pdm_handle_t structure which stores the transfer state. - */ -void PDM_TransferAbortReceive(PDM_Type *base, pdm_handle_t *handle) -{ - assert(handle != NULL); - - /* Use FIFO request interrupt and fifo error */ - PDM_DisableInterrupts(base, (uint32_t)kPDM_FIFOInterruptEnable | (uint32_t)kPDM_ErrorInterruptEnable); - PDM_Enable(base, false); - handle->state = kStatus_PDM_Idle; - /* Clear the queue */ - (void)memset(handle->pdmQueue, 0, sizeof(pdm_transfer_t) * PDM_XFER_QUEUE_SIZE); - handle->queueDriver = 0; - handle->queueUser = 0; -} - -/*! - * brief Tx interrupt handler. - * - * param base PDM base pointer. - * param handle Pointer to the pdm_handle_t structure. - */ -void PDM_TransferHandleIRQ(PDM_Type *base, pdm_handle_t *handle) -{ - assert(handle != NULL); - -#if (defined FSL_FEATURE_PDM_HAS_NO_INDEPENDENT_ERROR_IRQ && FSL_FEATURE_PDM_HAS_NO_INDEPENDENT_ERROR_IRQ) - uint32_t status = 0U; - -#if (defined(FSL_FEATURE_PDM_HAS_STATUS_LOW_FREQ) && (FSL_FEATURE_PDM_HAS_STATUS_LOW_FREQ == 1U)) - if (PDM_GetStatus(base) & PDM_STAT_LOWFREQF_MASK) - { - PDM_ClearStatus(base, PDM_STAT_LOWFREQF_MASK); - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_PDM_CLK_LOW, handle->userData); - } - } -#endif - status = PDM_GetFifoStatus(base); - if (status != 0U) - { - PDM_ClearFIFOStatus(base, status); - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_PDM_FIFO_ERROR, handle->userData); - } - } - -#if !(defined(FSL_FEATURE_PDM_HAS_RANGE_CTRL) && FSL_FEATURE_PDM_HAS_RANGE_CTRL) - status = PDM_GetOutputStatus(base); - if (status != 0U) - { - PDM_ClearOutputStatus(base, status); - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_PDM_Output_ERROR, handle->userData); - } - } -#endif -#endif - - /* Handle transfer */ - if (((base->STAT & 0xFFU) != 0U) && (handle->channelNums != 0U) && - ((base->CTRL_1 & PDM_CTRL_1_DISEL_MASK) == (0x2UL << PDM_CTRL_1_DISEL_SHIFT))) - { - PDM_ClearStatus(base, 0xFFU); - /* Judge if the data need to transmit is less than space */ - uint8_t size = (uint8_t)MIN((handle->pdmQueue[handle->queueDriver].dataSize), - ((uint32_t)handle->watermark * handle->channelNums * handle->format)); - - PDM_ReadFifo(base, handle->startChannel, handle->channelNums, - (uint8_t *)(uint32_t)handle->pdmQueue[handle->queueDriver].data, - ((size_t)size / handle->channelNums / handle->format), handle->format); - - /* Update the internal counter */ - handle->pdmQueue[handle->queueDriver].dataSize -= size; - handle->pdmQueue[handle->queueDriver].data = &(handle->pdmQueue[handle->queueDriver].data[size]); - } - - /* If finished a block, call the callback function */ - if (handle->pdmQueue[handle->queueDriver].dataSize == 0U) - { - handle->pdmQueue[handle->queueDriver].data = NULL; - handle->queueDriver = (handle->queueDriver + 1U) % PDM_XFER_QUEUE_SIZE; - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_PDM_Idle, handle->userData); - } - } - - /* If all data finished, just stop the transfer */ - if (handle->pdmQueue[handle->queueDriver].data == NULL) - { - PDM_TransferAbortReceive(base, handle); - } -} - -#if !(defined(FSL_FEATURE_PDM_HAS_NO_HWVAD) && FSL_FEATURE_PDM_HAS_NO_HWVAD) -/*! - * brief set HWVAD in envelope based mode . - * Recommand configurations, - * code - * static const pdm_hwvad_config_t hwvadConfig = { - * .channel = 0, - * .initializeTime = 10U, - * .cicOverSampleRate = 0U, - * .inputGain = 0U, - * .frameTime = 10U, - * .cutOffFreq = kPDM_HwvadHpfBypassed, - * .enableFrameEnergy = false, - * .enablePreFilter = true, -}; - - * static const pdm_hwvad_noise_filter_t noiseFilterConfig = { - * .enableAutoNoiseFilter = false, - * .enableNoiseMin = true, - * .enableNoiseDecimation = true, - * .noiseFilterAdjustment = 0U, - * .noiseGain = 7U, - * .enableNoiseDetectOR = true, - * }; - * code - * param base PDM base pointer. - * param hwvadConfig internal filter status. - * param noiseConfig Voice activity detector noise filter configure structure pointer. - * param zcdConfig Voice activity detector zero cross detector configure structure pointer . - * param signalGain signal gain value. - */ -void PDM_SetHwvadInEnvelopeBasedMode(PDM_Type *base, - const pdm_hwvad_config_t *hwvadConfig, - const pdm_hwvad_noise_filter_t *noiseConfig, - const pdm_hwvad_zero_cross_detector_t *zcdConfig, - uint32_t signalGain) -{ - assert(hwvadConfig != NULL); - assert(noiseConfig != NULL); - - uint32_t i = 0U; - - PDM_SetHwvadConfig(base, hwvadConfig); - PDM_SetHwvadSignalFilterConfig(base, true, signalGain); - PDM_SetHwvadNoiseFilterConfig(base, noiseConfig); - PDM_EnableHwvad(base, true); - - if (NULL != zcdConfig) - { - PDM_SetHwvadZeroCrossDetectorConfig(base, zcdConfig); - } - - PDM_Enable(base, true); - - while (PDM_GetHwvadInitialFlag(base) != 0U) - { - } - - for (i = 0; i < 3U; i++) - { - /* set HWVAD interal filter stauts initial */ - PDM_SetHwvadInternalFilterStatus(base, kPDM_HwvadInternalFilterInitial); - } - - PDM_SetHwvadInternalFilterStatus(base, kPDM_HwvadInternalFilterNormalOperation); -} - -/*! - * brief set HWVAD in energy based mode . - * Recommand configurations, - * code - * static const pdm_hwvad_config_t hwvadConfig = { - * .channel = 0, - * .initializeTime = 10U, - * .cicOverSampleRate = 0U, - * .inputGain = 0U, - * .frameTime = 10U, - * .cutOffFreq = kPDM_HwvadHpfBypassed, - * .enableFrameEnergy = true, - * .enablePreFilter = true, -}; - - * static const pdm_hwvad_noise_filter_t noiseFilterConfig = { - * .enableAutoNoiseFilter = true, - * .enableNoiseMin = false, - * .enableNoiseDecimation = false, - * .noiseFilterAdjustment = 0U, - * .noiseGain = 7U, - * .enableNoiseDetectOR = false, - * }; - * code - * param base PDM base pointer. - * param hwvadConfig internal filter status. - * param noiseConfig Voice activity detector noise filter configure structure pointer. - * param zcdConfig Voice activity detector zero cross detector configure structure pointer . - * param signalGain signal gain value, signal gain value should be properly according to application. - */ -void PDM_SetHwvadInEnergyBasedMode(PDM_Type *base, - const pdm_hwvad_config_t *hwvadConfig, - const pdm_hwvad_noise_filter_t *noiseConfig, - const pdm_hwvad_zero_cross_detector_t *zcdConfig, - uint32_t signalGain) -{ - assert(hwvadConfig != NULL); - assert(noiseConfig != NULL); - - PDM_SetHwvadConfig(base, hwvadConfig); - /* signal filter need to disable, but signal gain value should be set */ - base->VAD0_SCONFIG = PDM_VAD0_SCONFIG_VADSGAIN(signalGain); - PDM_SetHwvadNoiseFilterConfig(base, noiseConfig); - PDM_EnableHwvad(base, true); - - if (NULL != zcdConfig) - { - PDM_SetHwvadZeroCrossDetectorConfig(base, zcdConfig); - } - - PDM_Enable(base, true); -} - -/*! - * brief Configure voice activity detector. - * - * param base PDM base pointer - * param config Voice activity detector configure structure pointer . - */ -void PDM_SetHwvadConfig(PDM_Type *base, const pdm_hwvad_config_t *config) -{ - assert(config != NULL); - - uint32_t ctrl1 = base->VAD0_CTRL_1; - - /* Configure VAD0_CTRL_1 register */ - ctrl1 &= ~(PDM_VAD0_CTRL_1_VADCHSEL_MASK | PDM_VAD0_CTRL_1_VADCICOSR_MASK | PDM_VAD0_CTRL_1_VADINITT_MASK); - ctrl1 |= (PDM_VAD0_CTRL_1_VADCHSEL(config->channel) | PDM_VAD0_CTRL_1_VADCICOSR(config->cicOverSampleRate) | - PDM_VAD0_CTRL_1_VADINITT(config->initializeTime)); - base->VAD0_CTRL_1 = ctrl1; - - /* Configure VAD0_CTRL_2 register */ - base->VAD0_CTRL_2 = - (PDM_VAD0_CTRL_2_VADFRENDIS((config->enableFrameEnergy == true) ? 0U : 1U) | - PDM_VAD0_CTRL_2_VADPREFEN(config->enablePreFilter) | PDM_VAD0_CTRL_2_VADFRAMET(config->frameTime) | - PDM_VAD0_CTRL_2_VADINPGAIN(config->inputGain) | PDM_VAD0_CTRL_2_VADHPF(config->cutOffFreq)); -} - -/*! - * brief Configure voice activity detector signal filter. - * - * param base PDM base pointer - * param enableMaxBlock If signal maximum block enabled. - * param signalGain Gain value for the signal energy. - */ -void PDM_SetHwvadSignalFilterConfig(PDM_Type *base, bool enableMaxBlock, uint32_t signalGain) -{ - uint32_t signalConfig = base->VAD0_SCONFIG; - - signalConfig &= ~(PDM_VAD0_SCONFIG_VADSMAXEN_MASK | PDM_VAD0_SCONFIG_VADSGAIN_MASK); - signalConfig |= (PDM_VAD0_SCONFIG_VADSMAXEN(enableMaxBlock) | PDM_VAD0_SCONFIG_VADSGAIN(signalGain)) | - PDM_VAD0_SCONFIG_VADSFILEN_MASK; - base->VAD0_SCONFIG = signalConfig; -} - -/*! - * brief Configure voice activity detector noise filter. - * - * param base PDM base pointer - * param config Voice activity detector noise filter configure structure pointer . - */ -void PDM_SetHwvadNoiseFilterConfig(PDM_Type *base, const pdm_hwvad_noise_filter_t *config) -{ - assert(config != NULL); - - base->VAD0_NCONFIG = - (PDM_VAD0_NCONFIG_VADNFILAUTO(config->enableAutoNoiseFilter) | - PDM_VAD0_NCONFIG_VADNOREN(config->enableNoiseDetectOR) | PDM_VAD0_NCONFIG_VADNMINEN(config->enableNoiseMin) | - PDM_VAD0_NCONFIG_VADNDECEN(config->enableNoiseDecimation) | - PDM_VAD0_NCONFIG_VADNFILADJ(config->noiseFilterAdjustment) | PDM_VAD0_NCONFIG_VADNGAIN(config->noiseGain)); -} - -/*! - * brief Configure voice activity detector zero cross detector. - * - * param base PDM base pointer - * param config Voice activity detector zero cross detector configure structure pointer . - */ -void PDM_SetHwvadZeroCrossDetectorConfig(PDM_Type *base, const pdm_hwvad_zero_cross_detector_t *config) -{ - assert(config != NULL); - - uint32_t zcd = (base->VAD0_ZCD & (~(PDM_VAD0_ZCD_VADZCDTH_MASK | PDM_VAD0_ZCD_VADZCDADJ_MASK | - PDM_VAD0_ZCD_VADZCDAUTO_MASK | PDM_VAD0_ZCD_VADZCDAND_MASK))); - - zcd |= (PDM_VAD0_ZCD_VADZCDTH(config->threshold) | PDM_VAD0_ZCD_VADZCDADJ(config->adjustmentThreshold) | - PDM_VAD0_ZCD_VADZCDAUTO(config->enableAutoThreshold) | PDM_VAD0_ZCD_VADZCDAND(config->zcdAnd)) | - PDM_VAD0_ZCD_VADZCDEN_MASK; - - base->VAD0_ZCD = zcd; -} - -/*! - * brief Enable/Disable hwvad callback. - - * This function enable/disable the hwvad interrupt for the selected PDM peripheral. - * - * param base Base address of the PDM peripheral. - * param vadCallback callback Pointer to store callback function, should be NULL when disable. - * param userData user data. - * param enable true is enable, false is disable. - * retval None. - */ -void PDM_EnableHwvadInterruptCallback(PDM_Type *base, pdm_hwvad_callback_t vadCallback, void *userData, bool enable) -{ - uint32_t instance = PDM_GetInstance(base); - - if (enable) - { - PDM_EnableHwvadInterrupts(base, (uint32_t)kPDM_HwvadErrorInterruptEnable | (uint32_t)kPDM_HwvadInterruptEnable); - NVIC_ClearPendingIRQ(PDM_HWVAD_EVENT_IRQn); - (void)EnableIRQ(PDM_HWVAD_EVENT_IRQn); -#if !(defined FSL_FEATURE_PDM_HAS_NO_INDEPENDENT_ERROR_IRQ && FSL_FEATURE_PDM_HAS_NO_INDEPENDENT_ERROR_IRQ) - NVIC_ClearPendingIRQ(PDM_HWVAD_ERROR_IRQn); - (void)EnableIRQ(PDM_HWVAD_ERROR_IRQn); -#endif - s_pdm_hwvad_notification[instance].callback = vadCallback; - s_pdm_hwvad_notification[instance].userData = userData; - } - else - { - PDM_DisableHwvadInterrupts(base, - (uint32_t)kPDM_HwvadErrorInterruptEnable | (uint32_t)kPDM_HwvadInterruptEnable); - (void)DisableIRQ(PDM_HWVAD_EVENT_IRQn); -#if !(defined FSL_FEATURE_PDM_HAS_NO_INDEPENDENT_ERROR_IRQ && FSL_FEATURE_PDM_HAS_NO_INDEPENDENT_ERROR_IRQ) - (void)DisableIRQ(PDM_HWVAD_ERROR_IRQn); - NVIC_ClearPendingIRQ(PDM_HWVAD_ERROR_IRQn); -#endif - s_pdm_hwvad_notification[instance].callback = NULL; - s_pdm_hwvad_notification[instance].userData = NULL; - NVIC_ClearPendingIRQ(PDM_HWVAD_EVENT_IRQn); - } -} - -#if (defined PDM) -void PDM_HWVAD_EVENT_DriverIRQHandler(void); -void PDM_HWVAD_EVENT_DriverIRQHandler(void) -{ - if ((PDM_GetHwvadInterruptStatusFlags(PDM) & (uint32_t)kPDM_HwvadStatusVoiceDetectFlag) != 0U) - { - PDM_ClearHwvadInterruptStatusFlags(PDM, (uint32_t)kPDM_HwvadStatusVoiceDetectFlag); - if (s_pdm_hwvad_notification[0].callback != NULL) - { - s_pdm_hwvad_notification[0].callback(kStatus_PDM_HWVAD_VoiceDetected, s_pdm_hwvad_notification[0].userData); - } - } -#if (defined FSL_FEATURE_PDM_HAS_NO_INDEPENDENT_ERROR_IRQ && FSL_FEATURE_PDM_HAS_NO_INDEPENDENT_ERROR_IRQ) - else - { - PDM_ClearHwvadInterruptStatusFlags(PDM, (uint32_t)kPDM_HwvadStatusInputSaturation); - if (s_pdm_hwvad_notification[0].callback != NULL) - { - s_pdm_hwvad_notification[0].callback(kStatus_PDM_HWVAD_Error, s_pdm_hwvad_notification[0].userData); - } - } -#endif - SDK_ISR_EXIT_BARRIER; -} - -#if !(defined FSL_FEATURE_PDM_HAS_NO_INDEPENDENT_ERROR_IRQ && FSL_FEATURE_PDM_HAS_NO_INDEPENDENT_ERROR_IRQ) -void PDM_HWVAD_ERROR_DriverIRQHandler(void); -void PDM_HWVAD_ERROR_DriverIRQHandler(void) -{ - PDM_ClearHwvadInterruptStatusFlags(PDM, (uint32_t)kPDM_HwvadStatusInputSaturation); - if (s_pdm_hwvad_notification[0].callback != NULL) - { - s_pdm_hwvad_notification[0].callback(kStatus_PDM_HWVAD_Error, s_pdm_hwvad_notification[0].userData); - } - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif -#endif - -#if defined(PDM) -void PDM_EVENT_DriverIRQHandler(void); -void PDM_EVENT_DriverIRQHandler(void) -{ - assert(s_pdmHandle[0] != NULL); - s_pdmIsr(PDM, s_pdmHandle[0]); - SDK_ISR_EXIT_BARRIER; -} -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_pdm.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_pdm.h deleted file mode 100644 index d66a0585e4a..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_pdm.h +++ /dev/null @@ -1,1217 +0,0 @@ -/* - * Copyright (c) 2018, Freescale Semiconductor, Inc. - * Copyright 2019-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_PDM_H_ -#define FSL_PDM_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup pdm_driver PDM Driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -#define FSL_PDM_DRIVER_VERSION (MAKE_VERSION(2, 9, 1)) /*!< Version 2.9.1 */ -/*! @} */ - -/*! @brief PDM XFER QUEUE SIZE */ -#define PDM_XFER_QUEUE_SIZE (4U) - -/*! @brief PDM return status*/ -enum -{ - kStatus_PDM_Busy = MAKE_STATUS(kStatusGroup_PDM, 0), /*!< PDM is busy. */ -#if (defined(FSL_FEATURE_PDM_HAS_STATUS_LOW_FREQ) && (FSL_FEATURE_PDM_HAS_STATUS_LOW_FREQ == 1U)) - kStatus_PDM_CLK_LOW = MAKE_STATUS(kStatusGroup_PDM, 1), /*!< PDM clock frequency low */ -#endif - kStatus_PDM_FIFO_ERROR = MAKE_STATUS(kStatusGroup_PDM, 2), /*!< PDM FIFO underrun or overflow */ - kStatus_PDM_QueueFull = MAKE_STATUS(kStatusGroup_PDM, 3), /*!< PDM FIFO underrun or overflow */ - kStatus_PDM_Idle = MAKE_STATUS(kStatusGroup_PDM, 4), /*!< PDM is idle */ - kStatus_PDM_Output_ERROR = MAKE_STATUS(kStatusGroup_PDM, 5), /*!< PDM is output error */ - kStatus_PDM_ChannelConfig_Failed = MAKE_STATUS(kStatusGroup_PDM, 6), /*!< PDM channel config failed */ -#if !(defined(FSL_FEATURE_PDM_HAS_NO_HWVAD) && FSL_FEATURE_PDM_HAS_NO_HWVAD) - kStatus_PDM_HWVAD_VoiceDetected = MAKE_STATUS(kStatusGroup_PDM, 7), /*!< PDM hwvad voice detected */ - kStatus_PDM_HWVAD_Error = MAKE_STATUS(kStatusGroup_PDM, 8), /*!< PDM hwvad error */ -#endif -}; - -/*! @brief The PDM interrupt enable flag */ -enum _pdm_interrupt_enable -{ - kPDM_ErrorInterruptEnable = PDM_CTRL_1_ERREN_MASK, /*!< PDM channel error interrupt enable. */ - kPDM_FIFOInterruptEnable = PDM_CTRL_1_DISEL(2U), /*!< PDM channel FIFO interrupt */ -}; - -/*! @brief The PDM status */ -enum _pdm_internal_status -{ - kPDM_StatusDfBusyFlag = (int)PDM_STAT_BSY_FIL_MASK, /*!< Decimation filter is busy processing data */ -#if !(defined(FSL_FEATURE_PDM_HAS_NO_FIR_RDY) && FSL_FEATURE_PDM_HAS_NO_FIR_RDY) - kPDM_StatusFIRFilterReady = PDM_STAT_FIR_RDY_MASK, /*!< FIR filter data is ready */ -#endif -#if (defined(FSL_FEATURE_PDM_HAS_STATUS_LOW_FREQ) && (FSL_FEATURE_PDM_HAS_STATUS_LOW_FREQ == 1U)) - kPDM_StatusFrequencyLow = PDM_STAT_LOWFREQF_MASK, /*!< Mic app clock frequency not high enough */ -#endif - kPDM_StatusCh0FifoDataAvaliable = PDM_STAT_CH0F_MASK, /*!< channel 0 fifo data reached watermark level */ - kPDM_StatusCh1FifoDataAvaliable = PDM_STAT_CH1F_MASK, /*!< channel 1 fifo data reached watermark level */ - kPDM_StatusCh2FifoDataAvaliable = PDM_STAT_CH2F_MASK, /*!< channel 2 fifo data reached watermark level */ - kPDM_StatusCh3FifoDataAvaliable = PDM_STAT_CH3F_MASK, /*!< channel 3 fifo data reached watermark level */ -#if !defined(FSL_FEATURE_PDM_CHANNEL_NUM) || (FSL_FEATURE_PDM_CHANNEL_NUM == 8U) - kPDM_StatusCh4FifoDataAvaliable = PDM_STAT_CH4F_MASK, /*!< channel 4 fifo data reached watermark level */ - kPDM_StatusCh5FifoDataAvaliable = PDM_STAT_CH5F_MASK, /*!< channel 5 fifo data reached watermark level */ - kPDM_StatusCh6FifoDataAvaliable = PDM_STAT_CH6F_MASK, /*!< channel 6 fifo data reached watermark level */ - kPDM_StatusCh7FifoDataAvaliable = PDM_STAT_CH7F_MASK, /*!< channel 7 fifo data reached watermark level */ -#endif -}; - -/*! @brief PDM channel enable mask */ -enum _pdm_channel_enable_mask -{ - kPDM_EnableChannel0 = PDM_STAT_CH0F_MASK, /*!< channgel 0 enable mask */ - kPDM_EnableChannel1 = PDM_STAT_CH1F_MASK, /*!< channgel 1 enable mask */ - kPDM_EnableChannel2 = PDM_STAT_CH2F_MASK, /*!< channgel 2 enable mask */ - kPDM_EnableChannel3 = PDM_STAT_CH3F_MASK, /*!< channgel 3 enable mask */ -#if !defined(FSL_FEATURE_PDM_CHANNEL_NUM) || (FSL_FEATURE_PDM_CHANNEL_NUM == 8U) - kPDM_EnableChannel4 = PDM_STAT_CH4F_MASK, /*!< channgel 4 enable mask */ - kPDM_EnableChannel5 = PDM_STAT_CH5F_MASK, /*!< channgel 5 enable mask */ - kPDM_EnableChannel6 = PDM_STAT_CH6F_MASK, /*!< channgel 6 enable mask */ - kPDM_EnableChannel7 = PDM_STAT_CH7F_MASK, /*!< channgel 7 enable mask */ - - kPDM_EnableChannelAll = kPDM_EnableChannel0 | kPDM_EnableChannel1 | kPDM_EnableChannel2 | kPDM_EnableChannel3 | - kPDM_EnableChannel4 | kPDM_EnableChannel5 | kPDM_EnableChannel6 | kPDM_EnableChannel7, -#else - kPDM_EnableChannelAll = kPDM_EnableChannel0 | kPDM_EnableChannel1 | kPDM_EnableChannel2 | kPDM_EnableChannel3, -#endif -}; - -/*! @brief The PDM fifo status */ -enum _pdm_fifo_status -{ - kPDM_FifoStatusUnderflowCh0 = PDM_FIFO_STAT_FIFOUND0_MASK, /*!< channel0 fifo status underflow */ - kPDM_FifoStatusUnderflowCh1 = PDM_FIFO_STAT_FIFOUND1_MASK, /*!< channel1 fifo status underflow */ - kPDM_FifoStatusUnderflowCh2 = PDM_FIFO_STAT_FIFOUND2_MASK, /*!< channel2 fifo status underflow */ - kPDM_FifoStatusUnderflowCh3 = PDM_FIFO_STAT_FIFOUND3_MASK, /*!< channel3 fifo status underflow */ -#if !defined(FSL_FEATURE_PDM_CHANNEL_NUM) || (FSL_FEATURE_PDM_CHANNEL_NUM == 8U) - kPDM_FifoStatusUnderflowCh4 = PDM_FIFO_STAT_FIFOUND4_MASK, /*!< channel4 fifo status underflow */ - kPDM_FifoStatusUnderflowCh5 = PDM_FIFO_STAT_FIFOUND5_MASK, /*!< channel5 fifo status underflow */ - kPDM_FifoStatusUnderflowCh6 = PDM_FIFO_STAT_FIFOUND6_MASK, /*!< channel6 fifo status underflow */ - kPDM_FifoStatusUnderflowCh7 = PDM_FIFO_STAT_FIFOUND6_MASK, /*!< channel7 fifo status underflow */ -#endif - - kPDM_FifoStatusOverflowCh0 = PDM_FIFO_STAT_FIFOOVF0_MASK, /*!< channel0 fifo status overflow */ - kPDM_FifoStatusOverflowCh1 = PDM_FIFO_STAT_FIFOOVF1_MASK, /*!< channel1 fifo status overflow */ - kPDM_FifoStatusOverflowCh2 = PDM_FIFO_STAT_FIFOOVF2_MASK, /*!< channel2 fifo status overflow */ - kPDM_FifoStatusOverflowCh3 = PDM_FIFO_STAT_FIFOOVF3_MASK, /*!< channel3 fifo status overflow */ -#if !defined(FSL_FEATURE_PDM_CHANNEL_NUM) || (FSL_FEATURE_PDM_CHANNEL_NUM == 8U) - kPDM_FifoStatusOverflowCh4 = PDM_FIFO_STAT_FIFOOVF4_MASK, /*!< channel4 fifo status overflow */ - kPDM_FifoStatusOverflowCh5 = PDM_FIFO_STAT_FIFOOVF5_MASK, /*!< channel5 fifo status overflow */ - kPDM_FifoStatusOverflowCh6 = PDM_FIFO_STAT_FIFOOVF6_MASK, /*!< channel6 fifo status overflow */ - kPDM_FifoStatusOverflowCh7 = PDM_FIFO_STAT_FIFOOVF7_MASK, /*!< channel7 fifo status overflow */ -#endif -}; - -#if defined(FSL_FEATURE_PDM_HAS_RANGE_CTRL) && FSL_FEATURE_PDM_HAS_RANGE_CTRL -/*! @brief The PDM output status */ -enum _pdm_range_status -{ - kPDM_RangeStatusUnderFlowCh0 = PDM_RANGE_STAT_RANGEUNF0_MASK, /*!< channel0 range status underflow */ - kPDM_RangeStatusUnderFlowCh1 = PDM_RANGE_STAT_RANGEUNF1_MASK, /*!< channel1 range status underflow */ - kPDM_RangeStatusUnderFlowCh2 = PDM_RANGE_STAT_RANGEUNF2_MASK, /*!< channel2 range status underflow */ - kPDM_RangeStatusUnderFlowCh3 = PDM_RANGE_STAT_RANGEUNF3_MASK, /*!< channel3 range status underflow */ -#if !defined(FSL_FEATURE_PDM_CHANNEL_NUM) || (FSL_FEATURE_PDM_CHANNEL_NUM == 8U) - kPDM_RangeStatusUnderFlowCh4 = PDM_RANGE_STAT_RANGEUNF4_MASK, /*!< channel4 range status underflow */ - kPDM_RangeStatusUnderFlowCh5 = PDM_RANGE_STAT_RANGEUNF5_MASK, /*!< channel5 range status underflow */ - kPDM_RangeStatusUnderFlowCh6 = PDM_RANGE_STAT_RANGEUNF6_MASK, /*!< channel6 range status underflow */ - kPDM_RangeStatusUnderFlowCh7 = PDM_RANGE_STAT_RANGEUNF7_MASK, /*!< channel7 range status underflow */ -#endif - kPDM_RangeStatusOverFlowCh0 = PDM_RANGE_STAT_RANGEOVF0_MASK, /*!< channel0 range status overflow */ - kPDM_RangeStatusOverFlowCh1 = PDM_RANGE_STAT_RANGEOVF1_MASK, /*!< channel1 range status overflow */ - kPDM_RangeStatusOverFlowCh2 = PDM_RANGE_STAT_RANGEOVF2_MASK, /*!< channel2 range status overflow */ - kPDM_RangeStatusOverFlowCh3 = PDM_RANGE_STAT_RANGEOVF3_MASK, /*!< channel3 range status overflow */ -#if !defined(FSL_FEATURE_PDM_CHANNEL_NUM) || (FSL_FEATURE_PDM_CHANNEL_NUM == 8U) - kPDM_RangeStatusOverFlowCh4 = PDM_RANGE_STAT_RANGEOVF4_MASK, /*!< channel4 range status overflow */ - kPDM_RangeStatusOverFlowCh5 = PDM_RANGE_STAT_RANGEOVF5_MASK, /*!< channel5 range status overflow */ - kPDM_RangeStatusOverFlowCh6 = PDM_RANGE_STAT_RANGEOVF6_MASK, /*!< channel6 range status overflow */ - kPDM_RangeStatusOverFlowCh7 = PDM_RANGE_STAT_RANGEOVF7_MASK, /*!< channel7 range status overflow */ -#endif -}; -#else -/*! @brief The PDM output status */ -enum _pdm_output_status -{ - kPDM_OutputStatusUnderFlowCh0 = PDM_OUT_STAT_OUTUNF0_MASK, /*!< channel0 output status underflow */ - kPDM_OutputStatusUnderFlowCh1 = PDM_OUT_STAT_OUTUNF1_MASK, /*!< channel1 output status underflow */ - kPDM_OutputStatusUnderFlowCh2 = PDM_OUT_STAT_OUTUNF2_MASK, /*!< channel2 output status underflow */ - kPDM_OutputStatusUnderFlowCh3 = PDM_OUT_STAT_OUTUNF3_MASK, /*!< channel3 output status underflow */ -#if !defined(FSL_FEATURE_PDM_CHANNEL_NUM) || (FSL_FEATURE_PDM_CHANNEL_NUM == 8U) - kPDM_OutputStatusUnderFlowCh4 = PDM_OUT_STAT_OUTUNF4_MASK, /*!< channel4 output status underflow */ - kPDM_OutputStatusUnderFlowCh5 = PDM_OUT_STAT_OUTUNF5_MASK, /*!< channel5 output status underflow */ - kPDM_OutputStatusUnderFlowCh6 = PDM_OUT_STAT_OUTUNF6_MASK, /*!< channel6 output status underflow */ - kPDM_OutputStatusUnderFlowCh7 = PDM_OUT_STAT_OUTUNF7_MASK, /*!< channel7 output status underflow */ -#endif - kPDM_OutputStatusOverFlowCh0 = PDM_OUT_STAT_OUTOVF0_MASK, /*!< channel0 output status overflow */ - kPDM_OutputStatusOverFlowCh1 = PDM_OUT_STAT_OUTOVF1_MASK, /*!< channel1 output status overflow */ - kPDM_OutputStatusOverFlowCh2 = PDM_OUT_STAT_OUTOVF2_MASK, /*!< channel2 output status overflow */ - kPDM_OutputStatusOverFlowCh3 = PDM_OUT_STAT_OUTOVF3_MASK, /*!< channel3 output status overflow */ -#if !defined(FSL_FEATURE_PDM_CHANNEL_NUM) || (FSL_FEATURE_PDM_CHANNEL_NUM == 8U) - kPDM_OutputStatusOverFlowCh4 = PDM_OUT_STAT_OUTOVF4_MASK, /*!< channel4 output status overflow */ - kPDM_OutputStatusOverFlowCh5 = PDM_OUT_STAT_OUTOVF5_MASK, /*!< channel5 output status overflow */ - kPDM_OutputStatusOverFlowCh6 = PDM_OUT_STAT_OUTOVF6_MASK, /*!< channel6 output status overflow */ - kPDM_OutputStatusOverFlowCh7 = PDM_OUT_STAT_OUTOVF7_MASK, /*!< channel7 output status overflow */ -#endif -}; -#endif - -#if (defined(FSL_FEATURE_PDM_HAS_DC_OUT_CTRL) && (FSL_FEATURE_PDM_HAS_DC_OUT_CTRL)) -/*! @brief PDM DC remover configurations */ -typedef enum _pdm_dc_remover -{ - kPDM_DcRemoverCutOff20Hz = 0U, /*!< DC remover cut off 20HZ */ - kPDM_DcRemoverCutOff13Hz = 1U, /*!< DC remover cut off 13.3HZ */ - kPDM_DcRemoverCutOff40Hz = 2U, /*!< DC remover cut off 40HZ */ - kPDM_DcRemoverBypass = 3U, /*!< DC remover bypass */ -} pdm_dc_remover_t; -#else -/*! @brief PDM DC remover configurations */ -typedef enum _pdm_dc_remover -{ - kPDM_DcRemoverCutOff21Hz = 0U, /*!< DC remover cut off 21HZ */ - kPDM_DcRemoverCutOff83Hz = 1U, /*!< DC remover cut off 83HZ */ - kPDM_DcRemoverCutOff152Hz = 2U, /*!< DC remover cut off 152HZ */ - kPDM_DcRemoverBypass = 3U, /*!< DC remover bypass */ -} pdm_dc_remover_t; -#endif - -/*! @brief PDM decimation filter quality mode */ -typedef enum _pdm_df_quality_mode -{ - kPDM_QualityModeMedium = 0U, /*!< quality mode memdium */ - kPDM_QualityModeHigh = 1U, /*!< quality mode high */ - kPDM_QualityModeLow = 7U, /*!< quality mode low */ - kPDM_QualityModeVeryLow0 = 6U, /*!< quality mode very low0 */ - kPDM_QualityModeVeryLow1 = 5U, /*!< quality mode very low1 */ - kPDM_QualityModeVeryLow2 = 4U, /*!< quality mode very low2 */ -} pdm_df_quality_mode_t; - -/*! @brief PDM quality mode K factor */ -enum _pdm_qulaity_mode_k_factor -{ - kPDM_QualityModeHighKFactor = 1U, /*!< high quality mode K factor = 1 / 2 */ - kPDM_QualityModeMediumKFactor = 2U, /*!< medium/very low0 quality mode K factor = 2 / 2 */ - kPDM_QualityModeLowKFactor = 4U, /*!< low/very low1 quality mode K factor = 4 / 2 */ - kPDM_QualityModeVeryLow2KFactor = 8U, /*!< very low2 quality mode K factor = 8 / 2 */ -}; - -/*! @brief PDM decimation filter output gain */ -typedef enum _pdm_df_output_gain -{ - kPDM_DfOutputGain0 = 0U, /*!< Decimation filter output gain 0 */ - kPDM_DfOutputGain1 = 1U, /*!< Decimation filter output gain 1 */ - kPDM_DfOutputGain2 = 2U, /*!< Decimation filter output gain 2 */ - kPDM_DfOutputGain3 = 3U, /*!< Decimation filter output gain 3 */ - kPDM_DfOutputGain4 = 4U, /*!< Decimation filter output gain 4 */ - kPDM_DfOutputGain5 = 5U, /*!< Decimation filter output gain 5 */ - kPDM_DfOutputGain6 = 6U, /*!< Decimation filter output gain 6 */ - kPDM_DfOutputGain7 = 7U, /*!< Decimation filter output gain 7 */ - kPDM_DfOutputGain8 = 8U, /*!< Decimation filter output gain 8 */ - kPDM_DfOutputGain9 = 9U, /*!< Decimation filter output gain 9 */ - kPDM_DfOutputGain10 = 0xAU, /*!< Decimation filter output gain 10 */ - kPDM_DfOutputGain11 = 0xBU, /*!< Decimation filter output gain 11 */ - kPDM_DfOutputGain12 = 0xCU, /*!< Decimation filter output gain 12 */ - kPDM_DfOutputGain13 = 0xDU, /*!< Decimation filter output gain 13 */ - kPDM_DfOutputGain14 = 0xEU, /*!< Decimation filter output gain 14 */ - kPDM_DfOutputGain15 = 0xFU, /*!< Decimation filter output gain 15 */ -} pdm_df_output_gain_t; - -/*! @brief PDM data width */ -enum _pdm_data_width -{ -#if defined(FSL_FEATURE_PDM_FIFO_WIDTH) && (FSL_FEATURE_PDM_FIFO_WIDTH != 2U) - kPDM_DataWwidth24 = 3U, /*!< PDM data width 24bit */ - kPDM_DataWwidth32 = 4U, /*!< PDM data width 32bit */ -#else - kPDM_DataWdith16 = 2U, /*!< PDM data width 16bit */ -#endif -}; - -/*! @brief PDM channel configurations */ -typedef struct _pdm_channel_config -{ -#if (defined(FSL_FEATURE_PDM_HAS_DC_OUT_CTRL) && (FSL_FEATURE_PDM_HAS_DC_OUT_CTRL)) - pdm_dc_remover_t outputCutOffFreq; /*!< PDM output DC remover cut off frequency */ -#endif - -#if !(defined(FSL_FEATURE_PDM_DC_CTRL_VALUE_FIXED) && (FSL_FEATURE_PDM_DC_CTRL_VALUE_FIXED)) - pdm_dc_remover_t cutOffFreq; /*!< DC remover cut off frequency */ -#endif - - pdm_df_output_gain_t gain; /*!< Decimation Filter Output Gain */ -} pdm_channel_config_t; - -/*! @brief PDM user configuration structure */ -typedef struct _pdm_config -{ - bool - enableDoze; /*!< This module will enter disable/low leakage mode if DOZEN is active with ipg_doze is asserted */ -#if defined(FSL_FEATURE_PDM_HAS_DECIMATION_FILTER_BYPASS) && FSL_FEATURE_PDM_HAS_DECIMATION_FILTER_BYPASS - bool enableFilterBypass; /*!< Switchable bypass path for the decimation filter */ -#endif - uint8_t fifoWatermark; /*!< Watermark value for FIFO */ - pdm_df_quality_mode_t qualityMode; /*!< Quality mode */ - uint8_t cicOverSampleRate; /*!< CIC filter over sampling rate */ -} pdm_config_t; - -#if !(defined(FSL_FEATURE_PDM_HAS_NO_HWVAD) && FSL_FEATURE_PDM_HAS_NO_HWVAD) -/*! @brief PDM voice activity detector interrupt type */ -enum _pdm_hwvad_interrupt_enable -{ - kPDM_HwvadErrorInterruptEnable = PDM_VAD0_CTRL_1_VADERIE_MASK, /*!< PDM channel HWVAD error interrupt enable. */ - kPDM_HwvadInterruptEnable = PDM_VAD0_CTRL_1_VADIE_MASK, /*!< PDM channel HWVAD interrupt */ -}; - -/*! @brief The PDM hwvad interrupt status flag */ -enum _pdm_hwvad_int_status -{ - kPDM_HwvadStatusInputSaturation = PDM_VAD0_STAT_VADINSATF_MASK, /*!< HWVAD saturation condition */ - kPDM_HwvadStatusVoiceDetectFlag = PDM_VAD0_STAT_VADIF_MASK, /*!< HWVAD voice detect interrupt triggered */ -}; - -/*! @brief High pass filter configure cut-off frequency*/ -typedef enum _pdm_hwvad_hpf_config -{ - kPDM_HwvadHpfBypassed = 0x0U, /*!< High-pass filter bypass */ - kPDM_HwvadHpfCutOffFreq1750Hz = 0x1U, /*!< High-pass filter cut off frequency 1750HZ */ - kPDM_HwvadHpfCutOffFreq215Hz = 0x2U, /*!< High-pass filter cut off frequency 215HZ */ - kPDM_HwvadHpfCutOffFreq102Hz = 0x3U, /*!< High-pass filter cut off frequency 102HZ */ -} pdm_hwvad_hpf_config_t; - -/*! @brief HWVAD internal filter status */ -typedef enum _pdm_hwvad_filter_status -{ - kPDM_HwvadInternalFilterNormalOperation = 0U, /*!< internal filter ready for normal operation */ - kPDM_HwvadInternalFilterInitial = PDM_VAD0_CTRL_1_VADST10_MASK, /*!< interla filter are initial */ -} pdm_hwvad_filter_status_t; - -/*! @brief PDM voice activity detector user configuration structure */ -typedef struct _pdm_hwvad_config -{ - uint8_t channel; /*!< Which channel uses voice activity detector */ - uint8_t initializeTime; /*!< Number of frames or samples to initialize voice activity detector. */ - uint8_t cicOverSampleRate; /*!< CIC filter over sampling rate */ - - uint8_t inputGain; /*!< Voice activity detector input gain */ - uint32_t frameTime; /*!< Voice activity frame time */ - pdm_hwvad_hpf_config_t cutOffFreq; /*!< High pass filter cut off frequency */ - bool enableFrameEnergy; /*!< If frame energy enabled, true means enable */ - bool enablePreFilter; /*!< If pre-filter enabled */ -} pdm_hwvad_config_t; - -/*! @brief PDM voice activity detector noise filter user configuration structure */ -typedef struct _pdm_hwvad_noise_filter -{ - bool enableAutoNoiseFilter; /*!< If noise fileter automatically activated, true means enable */ - bool enableNoiseMin; /*!< If Noise minimum block enabled, true means enabled */ - bool enableNoiseDecimation; /*!< If enable noise input decimation */ - bool enableNoiseDetectOR; /*!< Enables a OR logic in the output of minimum noise estimator block */ - uint32_t noiseFilterAdjustment; /*!< The adjustment value of the noise filter */ - uint32_t noiseGain; /*!< Gain value for the noise energy or envelope estimated */ -} pdm_hwvad_noise_filter_t; - -/*! @brief PDM voice activity detector zero cross detector result */ -typedef enum _pdm_hwvad_zcd_result -{ - kPDM_HwvadResultOREnergyBasedDetection = - 0U, /*!< zero cross detector result will be OR with energy based detection */ - kPDM_HwvadResultANDEnergyBasedDetection = - 1U, /*!< zero cross detector result will be AND with energy based detection */ -} pdm_hwvad_zcd_result_t; - -/*! @brief PDM voice activity detector zero cross detector configuration structure */ -typedef struct _pdm_hwvad_zero_cross_detector -{ - bool enableAutoThreshold; /*!< If ZCD auto-threshold enabled, true means enabled. */ - pdm_hwvad_zcd_result_t zcdAnd; /*!< Is ZCD result is AND'ed with energy-based detection, false means OR'ed */ - uint32_t threshold; /*!< The adjustment value of the noise filter */ - uint32_t adjustmentThreshold; /*!< Gain value for the noise energy or envelope estimated */ -} pdm_hwvad_zero_cross_detector_t; -#endif - -/*! @brief PDM SDMA transfer structure */ -typedef struct _pdm_transfer -{ - volatile uint8_t *data; /*!< Data start address to transfer. */ - volatile size_t dataSize; /*!< Total Transfer bytes size. */ -} pdm_transfer_t; - -/*! @brief PDM handle */ -typedef struct _pdm_handle pdm_handle_t; - -/*! @brief PDM transfer callback prototype */ -typedef void (*pdm_transfer_callback_t)(PDM_Type *base, pdm_handle_t *handle, status_t status, void *userData); - -#if !(defined(FSL_FEATURE_PDM_HAS_NO_HWVAD) && FSL_FEATURE_PDM_HAS_NO_HWVAD) -/*! @brief PDM HWVAD callback prototype */ -typedef void (*pdm_hwvad_callback_t)(status_t status, void *userData); -/*! @brief PDM HWVAD notification structure */ -typedef struct _pdm_hwvad_notification -{ - pdm_hwvad_callback_t callback; - void *userData; -} pdm_hwvad_notification_t; -#endif - -/*! @brief PDM handle structure */ -struct _pdm_handle -{ - uint32_t state; /*!< Transfer status */ - pdm_transfer_callback_t callback; /*!< Callback function called at transfer event*/ - void *userData; /*!< Callback parameter passed to callback function*/ - - pdm_transfer_t pdmQueue[PDM_XFER_QUEUE_SIZE]; /*!< Transfer queue storing queued transfer */ - size_t transferSize[PDM_XFER_QUEUE_SIZE]; /*!< Data bytes need to transfer */ - volatile uint8_t queueUser; /*!< Index for user to queue transfer */ - volatile uint8_t queueDriver; /*!< Index for driver to get the transfer data and size */ - - uint32_t format; /*!< data format */ - uint8_t watermark; /*!< Watermark value */ - uint8_t startChannel; /*!< end channel */ - uint8_t channelNums; /*!< Enabled channel number */ -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus*/ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Initializes the PDM peripheral. - * - * Ungates the PDM clock, resets the module, and configures PDM with a configuration structure. - * The configuration structure can be custom filled or set with default values by - * PDM_GetDefaultConfig(). - * - * @note This API should be called at the beginning of the application to use - * the PDM driver. Otherwise, accessing the PDM module can cause a hard fault - * because the clock is not enabled. - * - * @param base PDM base pointer - * @param config PDM configuration structure. - */ -void PDM_Init(PDM_Type *base, const pdm_config_t *config); - -/*! - * @brief De-initializes the PDM peripheral. - * - * This API gates the PDM clock. The PDM module can't operate unless PDM_Init - * is called to enable the clock. - * - * @param base PDM base pointer - */ -void PDM_Deinit(PDM_Type *base); - -/*! - * @brief Resets the PDM module. - * - * @param base PDM base pointer - */ -static inline void PDM_Reset(PDM_Type *base) -{ - base->CTRL_1 |= PDM_CTRL_1_SRES_MASK; -} - -/*! - * @brief Enables/disables PDM interface. - * - * @param base PDM base pointer - * @param enable True means PDM interface is enabled, false means PDM interface is disabled. - */ -static inline void PDM_Enable(PDM_Type *base, bool enable) -{ - if (enable) - { - base->CTRL_1 |= PDM_CTRL_1_PDMIEN_MASK; - } - else - { - base->CTRL_1 &= ~PDM_CTRL_1_PDMIEN_MASK; - } -} - -#if !(defined(FSL_FEATURE_PDM_HAS_NO_DOZEN) && FSL_FEATURE_PDM_HAS_NO_DOZEN) -/*! - * @brief Enables/disables DOZE. - * - * @param base PDM base pointer - * @param enable True means the module will enter Disable/Low Leakage mode when ipg_doze is asserted, false means the - * module will not enter Disable/Low Leakage mode when ipg_doze is asserted. - */ -static inline void PDM_EnableDoze(PDM_Type *base, bool enable) -{ - if (enable) - { - base->CTRL_1 |= PDM_CTRL_1_DOZEN_MASK; - } - else - { - base->CTRL_1 &= ~PDM_CTRL_1_DOZEN_MASK; - } -} -#endif -/*! - * @brief Enables/disables debug mode for PDM. - * The PDM interface cannot enter debug mode once in Disable/Low Leakage or Low Power mode. - * @param base PDM base pointer - * @param enable True means PDM interface enter debug mode, false means PDM interface in normal mode. - */ -static inline void PDM_EnableDebugMode(PDM_Type *base, bool enable) -{ - if (enable) - { - base->CTRL_1 |= PDM_CTRL_1_DBG_MASK; - } - else - { - base->CTRL_1 &= ~PDM_CTRL_1_DBG_MASK; - } -} - -/*! - * @brief Enables/disables PDM interface in debug mode. - * - * @param base PDM base pointer - * @param enable True means PDM interface is enabled debug mode, false means PDM interface is disabled after - * after completing the current frame in debug mode. - */ -static inline void PDM_EnableInDebugMode(PDM_Type *base, bool enable) -{ - if (enable) - { - base->CTRL_1 |= PDM_CTRL_1_DBGE_MASK; - } - else - { - base->CTRL_1 &= ~PDM_CTRL_1_DBGE_MASK; - } -} - -/*! - * @brief Enables/disables PDM interface disable/Low Leakage mode. - * - * @param base PDM base pointer - * @param enable True means PDM interface is in disable/low leakage mode, False means PDM interface is in normal mode. - */ -static inline void PDM_EnterLowLeakageMode(PDM_Type *base, bool enable) -{ - if (enable) - { - base->CTRL_1 |= PDM_CTRL_1_MDIS_MASK; - } - else - { - base->CTRL_1 &= ~PDM_CTRL_1_MDIS_MASK; - } -} - -/*! - * @brief Enables/disables the PDM channel. - * - * @param base PDM base pointer - * @param channel PDM channel number need to enable or disable. - * @param enable True means enable PDM channel, false means disable. - */ -static inline void PDM_EnableChannel(PDM_Type *base, uint8_t channel, bool enable) -{ - if (enable) - { - base->CTRL_1 |= (1UL << channel); - } - else - { - base->CTRL_1 &= ~(1UL << channel); - } -} - -/*! - * @brief PDM one channel configurations. - * - * @param base PDM base pointer - * @param config PDM channel configurations. - * @param channel channel number. - * after completing the current frame in debug mode. - */ -void PDM_SetChannelConfig(PDM_Type *base, uint32_t channel, const pdm_channel_config_t *config); - -/*! - * @brief PDM set sample rate. - * - * @note This function is depend on the configuration of the PDM and PDM channel, so the correct call sequence is - * @code - * PDM_Init(base, pdmConfig) - * PDM_SetChannelConfig(base, channel, &channelConfig) - * PDM_SetSampleRateConfig(base, source, sampleRate) - * @endcode - * @param base PDM base pointer - * @param sourceClock_HZ PDM source clock frequency. - * @param sampleRate_HZ PDM sample rate. - */ -status_t PDM_SetSampleRateConfig(PDM_Type *base, uint32_t sourceClock_HZ, uint32_t sampleRate_HZ); - -/*! - * @brief PDM set sample rate. - * - * @deprecated Do not use this function. It has been superceded by @ref PDM_SetSampleRateConfig - * @param base PDM base pointer - * @param enableChannelMask PDM channel enable mask. - * @param qualityMode quality mode. - * @param osr cic oversample rate - * @param clkDiv clock divider - */ -status_t PDM_SetSampleRate( - PDM_Type *base, uint32_t enableChannelMask, pdm_df_quality_mode_t qualityMode, uint8_t osr, uint32_t clkDiv); - -/*! - * @brief Get the instance number for PDM. - * - * @param base PDM base pointer. - */ -uint32_t PDM_GetInstance(PDM_Type *base); -/*! @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets the PDM internal status flag. - * Use the Status Mask in _pdm_internal_status to get the status value needed - * @param base PDM base pointer - * @return PDM status flag value. - */ -static inline uint32_t PDM_GetStatus(PDM_Type *base) -{ - return base->STAT; -} - -/*! - * @brief Gets the PDM FIFO status flag. - * Use the Status Mask in _pdm_fifo_status to get the status value needed - * @param base PDM base pointer - * @return FIFO status. - */ -static inline uint32_t PDM_GetFifoStatus(PDM_Type *base) -{ - return base->FIFO_STAT; -} - -#if defined(FSL_FEATURE_PDM_HAS_RANGE_CTRL) && FSL_FEATURE_PDM_HAS_RANGE_CTRL -/*! - * @brief Gets the PDM Range status flag. - * Use the Status Mask in _pdm_range_status to get the status value needed - * @param base PDM base pointer - * @return output status. - */ -static inline uint32_t PDM_GetRangeStatus(PDM_Type *base) -{ - return base->RANGE_STAT; -} -#else -/*! - * @brief Gets the PDM output status flag. - * Use the Status Mask in _pdm_output_status to get the status value needed - * @param base PDM base pointer - * @return output status. - */ -static inline uint32_t PDM_GetOutputStatus(PDM_Type *base) -{ - return base->OUT_STAT; -} -#endif - -/*! - * @brief Clears the PDM Tx status. - * - * @param base PDM base pointer - * @param mask State mask. It can be a combination of the status between kPDM_StatusFrequencyLow and - * kPDM_StatusCh7FifoDataAvaliable. - */ -static inline void PDM_ClearStatus(PDM_Type *base, uint32_t mask) -{ - base->STAT = mask; -} - -/*! - * @brief Clears the PDM Tx status. - * - * @param base PDM base pointer - * @param mask State mask.It can be a combination of the status in _pdm_fifo_status. - */ -static inline void PDM_ClearFIFOStatus(PDM_Type *base, uint32_t mask) -{ - base->FIFO_STAT = mask; -} - -#if defined(FSL_FEATURE_PDM_HAS_RANGE_CTRL) && FSL_FEATURE_PDM_HAS_RANGE_CTRL -/*! - * @brief Clears the PDM range status. - * - * @param base PDM base pointer - * @param mask State mask. It can be a combination of the status in _pdm_range_status. - */ -static inline void PDM_ClearRangeStatus(PDM_Type *base, uint32_t mask) -{ - base->RANGE_STAT = mask; -} -#else -/*! - * @brief Clears the PDM output status. - * - * @param base PDM base pointer - * @param mask State mask. It can be a combination of the status in _pdm_output_status. - */ -static inline void PDM_ClearOutputStatus(PDM_Type *base, uint32_t mask) -{ - base->OUT_STAT = mask; -} -#endif - -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables the PDM interrupt requests. - * - * @param base PDM base pointer - * @param mask interrupt source - * The parameter can be a combination of the following sources if defined. - * @arg kPDM_ErrorInterruptEnable - * @arg kPDM_FIFOInterruptEnable - */ -void PDM_EnableInterrupts(PDM_Type *base, uint32_t mask); - -/*! - * @brief Disables the PDM interrupt requests. - * - * @param base PDM base pointer - * @param mask interrupt source - * The parameter can be a combination of the following sources if defined. - * @arg kPDM_ErrorInterruptEnable - * @arg kPDM_FIFOInterruptEnable - */ -static inline void PDM_DisableInterrupts(PDM_Type *base, uint32_t mask) -{ - base->CTRL_1 &= ~mask; -} - -/*! @} */ - -/*! - * @name DMA Control - * @{ - */ - -/*! - * @brief Enables/disables the PDM DMA requests. - * - * @param base PDM base pointer - * @param enable True means enable DMA, false means disable DMA. - */ -static inline void PDM_EnableDMA(PDM_Type *base, bool enable) -{ - if (enable) - { - base->CTRL_1 = (base->CTRL_1 & (~PDM_CTRL_1_DISEL_MASK)) | PDM_CTRL_1_DISEL(0x1U); - } - else - { - base->CTRL_1 &= ~PDM_CTRL_1_DISEL_MASK; - } -} - -/*! - * @brief Gets the PDM data register address. - * - * This API is used to provide a transfer address for the PDM DMA transfer configuration. - * - * @param base PDM base pointer. - * @param channel Which data channel used. - * @return data register address. - */ -static inline uint32_t PDM_GetDataRegisterAddress(PDM_Type *base, uint32_t channel) -{ - return (uint32_t)(&(base->DATACH)[channel]); -} - -/*! @} */ - -/*! - * @name Bus Operations - * @{ - */ -#if defined(FSL_FEATURE_PDM_FIFO_WIDTH) && (FSL_FEATURE_PDM_FIFO_WIDTH == 2U) -/*! - * @brief Reads data from the PDM FIFO. - * - * @param base PDM base pointer. - * @param channel Data channel used. - * @return Data in PDM FIFO. - */ -static inline int16_t PDM_ReadData(PDM_Type *base, uint32_t channel) -{ - return (int16_t)(base->DATACH[channel]); -} - -/*! - * @brief PDM read data non blocking. - * So the actually read data byte size in this function is (size * 2 * channelNums). - * @param base PDM base pointer. - * @param startChannel start channel number. - * @param channelNums total enabled channelnums. - * @param buffer received buffer address. - * @param size number of 16bit data to read. - */ -void PDM_ReadNonBlocking(PDM_Type *base, uint32_t startChannel, uint32_t channelNums, int16_t *buffer, size_t size); -#endif - -/*! - * @brief PDM read fifo. - * @note: This function support 16 bit only for IP version that only supports 16bit. - * - * @param base PDM base pointer. - * @param startChannel start channel number. - * @param channelNums total enabled channelnums. - * @param buffer received buffer address. - * @param size number of samples to read. - * @param dataWidth sample width. - */ -void PDM_ReadFifo( - PDM_Type *base, uint32_t startChannel, uint32_t channelNums, void *buffer, size_t size, uint32_t dataWidth); - -#if defined(FSL_FEATURE_PDM_FIFO_WIDTH) && (FSL_FEATURE_PDM_FIFO_WIDTH == 4U) -/*! - * @brief Reads data from the PDM FIFO. - * - * @param base PDM base pointer. - * @param channel Data channel used. - * @return Data in PDM FIFO. - */ -static inline uint32_t PDM_ReadData(PDM_Type *base, uint32_t channel) -{ - return base->DATACH[channel]; -} -#endif - -/*! - * @brief Set the PDM channel gain. - * - * Please note for different quality mode, the valid gain value is different, reference RM for detail. - * @param base PDM base pointer. - * @param channel PDM channel index. - * @param gain channel gain, the register gain value range is 0 - 15. - */ -void PDM_SetChannelGain(PDM_Type *base, uint32_t channel, pdm_df_output_gain_t gain); - -#if !(defined(FSL_FEATURE_PDM_HAS_NO_HWVAD) && FSL_FEATURE_PDM_HAS_NO_HWVAD) -/*! @} */ - -/*! - * @name Voice Activity Detector - * @{ - */ - -/*! - * @brief Configure voice activity detector. - * - * @param base PDM base pointer - * @param config Voice activity detector configure structure pointer . - */ -void PDM_SetHwvadConfig(PDM_Type *base, const pdm_hwvad_config_t *config); - -/*! - * @brief PDM hwvad force output disable. - * - * @param base PDM base pointer - * @param enable true is output force disable, false is output not force. - */ -static inline void PDM_ForceHwvadOutputDisable(PDM_Type *base, bool enable) -{ - if (enable) - { - base->VAD0_CTRL_2 &= ~PDM_VAD0_CTRL_2_VADFOUTDIS_MASK; - } - else - { - base->VAD0_CTRL_2 |= PDM_VAD0_CTRL_2_VADFOUTDIS_MASK; - } -} - -/*! - * @brief PDM hwvad reset. - * It will reset VADNDATA register and will clean all internal buffers, should be called when the PDM isn't running. - * - * @param base PDM base pointer - */ -static inline void PDM_ResetHwvad(PDM_Type *base) -{ - base->VAD0_CTRL_1 |= PDM_VAD0_CTRL_1_VADRST_MASK; -} -/*! - * @brief Enable/Disable Voice activity detector. - * Should be called when the PDM isn't running. - * @param base PDM base pointer. - * @param enable True means enable voice activity detector, false means disable. - */ -static inline void PDM_EnableHwvad(PDM_Type *base, bool enable) -{ - if (enable) - { - base->VAD0_CTRL_1 |= PDM_VAD0_CTRL_1_VADEN_MASK; - } - else - { - base->VAD0_CTRL_1 &= ~PDM_VAD0_CTRL_1_VADEN_MASK; - } -} - -/*! - * @brief Enables the PDM Voice Detector interrupt requests. - * - * @param base PDM base pointer - * @param mask interrupt source - * The parameter can be a combination of the following sources if defined. - * @arg kPDM_HWVADErrorInterruptEnable - * @arg kPDM_HWVADInterruptEnable - */ -static inline void PDM_EnableHwvadInterrupts(PDM_Type *base, uint32_t mask) -{ - base->VAD0_CTRL_1 |= mask; -} - -/*! - * @brief Disables the PDM Voice Detector interrupt requests. - * - * @param base PDM base pointer - * @param mask interrupt source - * The parameter can be a combination of the following sources if defined. - * @arg kPDM_HWVADErrorInterruptEnable - * @arg kPDM_HWVADInterruptEnable - */ -static inline void PDM_DisableHwvadInterrupts(PDM_Type *base, uint32_t mask) -{ - base->VAD0_CTRL_1 &= ~mask; -} - -/*! - * @brief Clears the PDM voice activity detector status flags. - * - * @param base PDM base pointer - * @param mask State mask,reference _pdm_hwvad_int_status. - */ -static inline void PDM_ClearHwvadInterruptStatusFlags(PDM_Type *base, uint32_t mask) -{ - base->VAD0_STAT = mask; -} - -/*! - * @brief Clears the PDM voice activity detector status flags. - * - * @param base PDM base pointer - * @return status, reference _pdm_hwvad_int_status - */ -static inline uint32_t PDM_GetHwvadInterruptStatusFlags(PDM_Type *base) -{ - return base->VAD0_STAT & (PDM_VAD0_STAT_VADIF_MASK | PDM_VAD0_STAT_VADINSATF_MASK); -} - -/*! - * @brief Get the PDM voice activity detector initial flags. - * - * @param base PDM base pointer - * @return initial flag. - */ -static inline uint32_t PDM_GetHwvadInitialFlag(PDM_Type *base) -{ - return base->VAD0_STAT & PDM_VAD0_STAT_VADINITF_MASK; -} - -#if !(defined(FSL_FEATURE_PDM_HAS_NO_VADEF) && (FSL_FEATURE_PDM_HAS_NO_VADEF)) -/*! - * @brief Get the PDM voice activity detector voice detected flags. - * NOte: this flag is auto cleared when voice gone. - * @param base PDM base pointer - * @return voice detected flag. - */ -static inline uint32_t PDM_GetHwvadVoiceDetectedFlag(PDM_Type *base) -{ - return base->VAD0_STAT & PDM_VAD0_STAT_VADEF_MASK; -} -#endif - -/*! - * @brief Enables/disables voice activity detector signal filter. - * - * @param base PDM base pointer - * @param enable True means enable signal filter, false means disable. - */ -static inline void PDM_EnableHwvadSignalFilter(PDM_Type *base, bool enable) -{ - if (enable) - { - base->VAD0_SCONFIG |= PDM_VAD0_SCONFIG_VADSFILEN_MASK; - } - else - { - base->VAD0_SCONFIG &= ~PDM_VAD0_SCONFIG_VADSFILEN_MASK; - } -} - -/*! - * @brief Configure voice activity detector signal filter. - * - * @param base PDM base pointer - * @param enableMaxBlock If signal maximum block enabled. - * @param signalGain Gain value for the signal energy. - */ -void PDM_SetHwvadSignalFilterConfig(PDM_Type *base, bool enableMaxBlock, uint32_t signalGain); - -/*! - * @brief Configure voice activity detector noise filter. - * - * @param base PDM base pointer - * @param config Voice activity detector noise filter configure structure pointer . - */ -void PDM_SetHwvadNoiseFilterConfig(PDM_Type *base, const pdm_hwvad_noise_filter_t *config); - -/*! - * @brief Enables/disables voice activity detector zero cross detector. - * - * @param base PDM base pointer - * @param enable True means enable zero cross detector, false means disable. - */ -static inline void PDM_EnableHwvadZeroCrossDetector(PDM_Type *base, bool enable) -{ - if (enable) - { - base->VAD0_ZCD |= PDM_VAD0_ZCD_VADZCDEN_MASK; - } - else - { - base->VAD0_ZCD &= ~PDM_VAD0_ZCD_VADZCDEN_MASK; - } -} - -/*! - * @brief Configure voice activity detector zero cross detector. - * - * @param base PDM base pointer - * @param config Voice activity detector zero cross detector configure structure pointer . - */ -void PDM_SetHwvadZeroCrossDetectorConfig(PDM_Type *base, const pdm_hwvad_zero_cross_detector_t *config); - -/*! - * @brief Reads noise data. - * - * @param base PDM base pointer. - * @return Data in PDM noise data register. - */ -static inline uint16_t PDM_GetNoiseData(PDM_Type *base) -{ - return (uint16_t)base->VAD0_NDATA; -} - -/*! - * @brief set hwvad internal filter status . - * Note: filter initial status should be asserted for two more cycles, then set it to normal operation. - * @param base PDM base pointer. - * @param status internal filter status. - */ -static inline void PDM_SetHwvadInternalFilterStatus(PDM_Type *base, pdm_hwvad_filter_status_t status) -{ - base->VAD0_CTRL_1 = (base->VAD0_CTRL_1 & (~PDM_VAD0_CTRL_1_VADST10_MASK)) | (uint32_t)status; -} - -/*! - * @brief set HWVAD in envelope based mode . - * Recommand configurations, - * @code - * static const pdm_hwvad_config_t hwvadConfig = { - * .channel = 0, - * .initializeTime = 10U, - * .cicOverSampleRate = 0U, - * .inputGain = 0U, - * .frameTime = 10U, - * .cutOffFreq = kPDM_HwvadHpfBypassed, - * .enableFrameEnergy = false, - * .enablePreFilter = true, -}; - - * static const pdm_hwvad_noise_filter_t noiseFilterConfig = { - * .enableAutoNoiseFilter = false, - * .enableNoiseMin = true, - * .enableNoiseDecimation = true, - * .noiseFilterAdjustment = 0U, - * .noiseGain = 7U, - * .enableNoiseDetectOR = true, - * }; - * @endcode - * @param base PDM base pointer. - * @param hwvadConfig internal filter status. - * @param noiseConfig Voice activity detector noise filter configure structure pointer. - * @param zcdConfig Voice activity detector zero cross detector configure structure pointer . - * @param signalGain signal gain value. - */ -void PDM_SetHwvadInEnvelopeBasedMode(PDM_Type *base, - const pdm_hwvad_config_t *hwvadConfig, - const pdm_hwvad_noise_filter_t *noiseConfig, - const pdm_hwvad_zero_cross_detector_t *zcdConfig, - uint32_t signalGain); - -/*! - * brief set HWVAD in energy based mode . - * Recommand configurations, - * code - * static const pdm_hwvad_config_t hwvadConfig = { - * .channel = 0, - * .initializeTime = 10U, - * .cicOverSampleRate = 0U, - * .inputGain = 0U, - * .frameTime = 10U, - * .cutOffFreq = kPDM_HwvadHpfBypassed, - * .enableFrameEnergy = true, - * .enablePreFilter = true, -}; - - * static const pdm_hwvad_noise_filter_t noiseFilterConfig = { - * .enableAutoNoiseFilter = true, - * .enableNoiseMin = false, - * .enableNoiseDecimation = false, - * .noiseFilterAdjustment = 0U, - * .noiseGain = 7U, - * .enableNoiseDetectOR = false, - * }; - * code - * param base PDM base pointer. - * param hwvadConfig internal filter status. - * param noiseConfig Voice activity detector noise filter configure structure pointer. - * param zcdConfig Voice activity detector zero cross detector configure structure pointer . - * param signalGain signal gain value, signal gain value should be properly according to application. - */ -void PDM_SetHwvadInEnergyBasedMode(PDM_Type *base, - const pdm_hwvad_config_t *hwvadConfig, - const pdm_hwvad_noise_filter_t *noiseConfig, - const pdm_hwvad_zero_cross_detector_t *zcdConfig, - uint32_t signalGain); - -/*! - * @brief Enable/Disable hwvad callback. - - * This function enable/disable the hwvad interrupt for the selected PDM peripheral. - * - * @param base Base address of the PDM peripheral. - * @param vadCallback callback Pointer to store callback function, should be NULL when disable. - * @param userData user data. - * @param enable true is enable, false is disable. - * @retval None. - */ -void PDM_EnableHwvadInterruptCallback(PDM_Type *base, pdm_hwvad_callback_t vadCallback, void *userData, bool enable); -/*! @} */ -#endif - -/*! - * @name Transactional - * @{ - */ - -/*! - * @brief Initializes the PDM handle. - * - * This function initializes the handle for the PDM transactional APIs. Call - * this function once to get the handle initialized. - * - * @param base PDM base pointer. - * @param handle PDM handle pointer. - * @param callback Pointer to the user callback function. - * @param userData User parameter passed to the callback function. - */ -void PDM_TransferCreateHandle(PDM_Type *base, pdm_handle_t *handle, pdm_transfer_callback_t callback, void *userData); - -/*! - * @brief PDM set channel transfer config. - * - * @param base PDM base pointer. - * @param handle PDM handle pointer. - * @param channel PDM channel. - * @param config channel config. - * @param format data format, support data width configurations,_pdm_data_width. - * @retval kStatus_PDM_ChannelConfig_Failed or kStatus_Success. - */ -status_t PDM_TransferSetChannelConfig( - PDM_Type *base, pdm_handle_t *handle, uint32_t channel, const pdm_channel_config_t *config, uint32_t format); - -/*! - * @brief Performs an interrupt non-blocking receive transfer on PDM. - * - * @note This API returns immediately after the transfer initiates. - * Call the PDM_RxGetTransferStatusIRQ to poll the transfer status and check whether - * the transfer is finished. If the return status is not kStatus_PDM_Busy, the transfer - * is finished. - * - * @param base PDM base pointer - * @param handle Pointer to the pdm_handle_t structure which stores the transfer state. - * @param xfer Pointer to the pdm_transfer_t structure. - * @retval kStatus_Success Successfully started the data receive. - * @retval kStatus_PDM_Busy Previous receive still not finished. - */ -status_t PDM_TransferReceiveNonBlocking(PDM_Type *base, pdm_handle_t *handle, pdm_transfer_t *xfer); - -/*! - * @brief Aborts the current IRQ receive. - * - * @note This API can be called when an interrupt non-blocking transfer initiates - * to abort the transfer early. - * - * @param base PDM base pointer - * @param handle Pointer to the pdm_handle_t structure which stores the transfer state. - */ -void PDM_TransferAbortReceive(PDM_Type *base, pdm_handle_t *handle); - -/*! - * @brief Tx interrupt handler. - * - * @param base PDM base pointer. - * @param handle Pointer to the pdm_handle_t structure. - */ -void PDM_TransferHandleIRQ(PDM_Type *base, pdm_handle_t *handle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /*_cplusplus*/ - -/*! @} */ - -#endif /* FSL_PDM_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_pdm_edma.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_pdm_edma.c deleted file mode 100644 index 2081057c63d..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_pdm_edma.c +++ /dev/null @@ -1,486 +0,0 @@ -/* - * Copyright 2019 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_pdm_edma.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.pdm_edma" -#endif - -/******************************************************************************* - * Definitations - ******************************************************************************/ -/* Used for edma_tcd_t size aligned */ -#define STCD_ADDR(address) (edma_tcd_t *)(((uint32_t)(address) + sizeof(edma_tcd_t)) & ~(sizeof(edma_tcd_t) - 1U)) - -/*handle; - - if (!(pdmHandle->isLoopTransfer)) - { - (void)memset(&pdmHandle->tcd[pdmHandle->tcdDriver], 0, sizeof(edma_tcd_t)); - pdmHandle->tcdDriver = (pdmHandle->tcdDriver + 1U) % pdmHandle->tcdNum; - } -#if defined FSL_EDMA_DRIVER_EDMA4 && FSL_EDMA_DRIVER_EDMA4 - pdmHandle->receivedBytes += - EDMA_TCD_BITER((&pdmHandle->tcd[pdmHandle->tcdDriver]), EDMA_TCD_TYPE(handle->base)) * - (EDMA_TCD_NBYTES((&pdmHandle->tcd[pdmHandle->tcdDriver]), EDMA_TCD_TYPE(handle->base)) & 0x3FFU); -#else - pdmHandle->receivedBytes += - pdmHandle->tcd[pdmHandle->tcdDriver].BITER * (pdmHandle->tcd[pdmHandle->tcdDriver].NBYTES & 0x3FFU); -#endif - /* If finished a block, call the callback function */ - if (pdmHandle->callback != NULL) - { - (pdmHandle->callback)(privHandle->base, pdmHandle, kStatus_PDM_Idle, pdmHandle->userData); - } - - pdmHandle->tcdUsedNum--; - /* If all data finished, just stop the transfer */ - if ((pdmHandle->tcdUsedNum == 0U) && !(pdmHandle->isLoopTransfer)) - { - /* Disable DMA enable bit */ - PDM_EnableDMA(privHandle->base, false); - EDMA_AbortTransfer(handle); - } -} - -/*! - * brief Initializes the PDM Rx eDMA handle. - * - * This function initializes the PDM slave DMA handle, which can be used for other PDM master transactional APIs. - * Usually, for a specified PDM instance, call this API once to get the initialized handle. - * - * param base PDM base pointer. - * param handle PDM eDMA handle pointer. - * param base PDM peripheral base address. - * param callback Pointer to user callback function. - * param userData User parameter passed to the callback function. - * param dmaHandle eDMA handle pointer, this handle shall be static allocated by users. - */ -void PDM_TransferCreateHandleEDMA( - PDM_Type *base, pdm_edma_handle_t *handle, pdm_edma_callback_t callback, void *userData, edma_handle_t *dmaHandle) -{ - assert((handle != NULL) && (dmaHandle != NULL)); - - uint32_t instance = PDM_GetInstance(base); - - /* Zero the handle */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Set pdm base to handle */ - handle->dmaHandle = dmaHandle; - handle->callback = callback; - handle->userData = userData; - - /* Set PDM state to idle */ - handle->state = (uint32_t)kPDM_Idle; - - s_edmaPrivateHandle[instance].base = base; - s_edmaPrivateHandle[instance].handle = handle; - - /* Install callback for Tx dma channel */ - EDMA_SetCallback(dmaHandle, PDM_EDMACallback, &s_edmaPrivateHandle[instance]); -} - -/*! - * brief Initializes the multi PDM channel interleave type. - * - * This function initializes the PDM DMA handle member interleaveType, it shall be called only when application would - * like to use type kPDM_EDMAMultiChannelInterleavePerChannelBlock, since the default interleaveType is - * kPDM_EDMAMultiChannelInterleavePerChannelSample always - * - * param handle PDM eDMA handle pointer. - * param multiChannelInterleaveType Multi channel interleave type. - */ -void PDM_TransferSetMultiChannelInterleaveType(pdm_edma_handle_t *handle, - pdm_edma_multi_channel_interleave_t multiChannelInterleaveType) -{ - handle->interleaveType = multiChannelInterleaveType; -} - -/*! - * brief Install EDMA descriptor memory. - * - * param handle Pointer to EDMA channel transfer handle. - * param tcdAddr EDMA head descriptor address. - * param tcdNum EDMA link descriptor address. - */ -void PDM_TransferInstallEDMATCDMemory(pdm_edma_handle_t *handle, void *tcdAddr, size_t tcdNum) -{ - assert(handle != NULL); - - handle->tcd = (edma_tcd_t *)tcdAddr; - handle->tcdNum = tcdNum; -} - -/*! - * brief Configures the PDM channel. - * - * param base PDM base pointer. - * param handle PDM eDMA handle pointer. - * param channel channel index. - * param pdmConfig pdm channel configurations. - */ -void PDM_TransferSetChannelConfigEDMA(PDM_Type *base, - pdm_edma_handle_t *handle, - uint32_t channel, - const pdm_channel_config_t *config) -{ - assert((handle != NULL) && (config != NULL)); - assert(channel < (uint32_t)FSL_FEATURE_PDM_CHANNEL_NUM); - - /* Configure the PDM channel */ - PDM_SetChannelConfig(base, channel, config); - - /* record end channel number */ - handle->endChannel = (uint8_t)channel; - /* increase totoal enabled channel number */ - handle->channelNums++; - /* increase count pre channel numbers */ - handle->count = (uint8_t)(base->FIFO_CTRL & PDM_FIFO_CTRL_FIFOWMK_MASK); -} - -/*! - * brief Performs a non-blocking PDM receive using eDMA. - * - * note This interface returns immediately after the transfer initiates. Call - * the PDM_GetReceiveRemainingBytes to poll the transfer status and check whether the PDM transfer is finished. - * - * Mcaro MCUX_SDK_PDM_EDMA_PDM_ENABLE_INTERNAL can control whether PDM is enabled internally or externally. - * - * 1. Scatter gather case: - * This functio support dynamic scatter gather and staic scatter gather, - * a. for the dynamic scatter gather case: - * Application should call PDM_TransferReceiveEDMA function continuously to make sure new receive request is submit - *before the previous one finish. b. for the static scatter gather case: Application should use the link transfer - *feature and make sure a loop link transfer is provided, such as: code pdm_edma_transfer_t pdmXfer[2] = - * { - * { - * .data = s_buffer, - * .dataSize = BUFFER_SIZE, - * .linkTransfer = &pdmXfer[1], - * }, - * - * { - * .data = &s_buffer[BUFFER_SIZE], - * .dataSize = BUFFER_SIZE, - * .linkTransfer = &pdmXfer[0] - * }, - * }; - *endcode - * - * 2. Multi channel case: - * This function support receive multi pdm channel data, for example, if two channel is requested, - * code - * PDM_TransferSetChannelConfigEDMA(DEMO_PDM, &s_pdmRxHandle_0, DEMO_PDM_ENABLE_CHANNEL_0, &channelConfig); - * PDM_TransferSetChannelConfigEDMA(DEMO_PDM, &s_pdmRxHandle_0, DEMO_PDM_ENABLE_CHANNEL_1, &channelConfig); - * PDM_TransferReceiveEDMA(DEMO_PDM, &s_pdmRxHandle_0, pdmXfer); - * endcode - * The output data will be formatted as below if handle->interleaveType = - *kPDM_EDMAMultiChannelInterleavePerChannelSample : - * ------------------------------------------------------------------------- - * |CHANNEL0 | CHANNEL1 | CHANNEL0 | CHANNEL1 | CHANNEL0 | CHANNEL 1 | ....| - * ------------------------------------------------------------------------- - * - * The output data will be formatted as below if handle->interleaveType = kPDM_EDMAMultiChannelInterleavePerChannelBlock - *: - * ---------------------------------------------------------------------------------------------------------------------- - * |CHANNEL3 | CHANNEL3 | CHANNEL3 | .... | CHANNEL4 | CHANNEL 4 | CHANNEL4 |....| CHANNEL5 | CHANNEL 5 | CHANNEL5 - *|....| - * ---------------------------------------------------------------------------------------------------------------------- - * Note: the dataSize of xfer is the total data size, while application using - * kPDM_EDMAMultiChannelInterleavePerChannelBlock, the buffer size for each PDM channel is channelSize = dataSize / - * channelNums, there are limitation for this feature, - * 1. For 3 DMIC array: the dataSize shall be 4 * (channelSize) - * The addtional buffer is mandantory for edma modulo feature. - * 2. The kPDM_EDMAMultiChannelInterleavePerChannelBlock feature support below dmic array only, - * 2 DMIC array: CHANNEL3, CHANNEL4 - * 3 DMIC array: CHANNEL3, CHANNEL4, CHANNEL5 - * 4 DMIC array: CHANNEL3, CHANNEL4, CHANNEL5, CHANNEL6 - * Any other combinations is not support, that is to SAY, THE FEATURE SUPPORT RECEIVE START FROM CHANNEL3 ONLY AND 4 - * MAXIMUM DMIC CHANNELS. - * - * param base PDM base pointer - * param handle PDM eDMA handle pointer. - * param xfer Pointer to DMA transfer structure. - * retval kStatus_Success Start a PDM eDMA receive successfully. - * retval kStatus_InvalidArgument The input argument is invalid. - * retval kStatus_RxBusy PDM is busy receiving data. - */ -status_t PDM_TransferReceiveEDMA(PDM_Type *base, pdm_edma_handle_t *handle, pdm_edma_transfer_t *xfer) -{ - assert((handle != NULL) && (xfer != NULL)); - - edma_transfer_config_t config = {0}; - uint32_t startAddr = PDM_GetDataRegisterAddress(base, handle->endChannel - (handle->channelNums - 1UL)); - pdm_edma_transfer_t *currentTransfer = xfer; - uint32_t nextTcdIndex = 0U, tcdIndex = handle->tcdUser, destOffset = FSL_FEATURE_PDM_FIFO_WIDTH; - uint32_t mappedChannel = handle->channelNums; - edma_modulo_t modulo = kEDMA_ModuloDisable; - /* minor offset used for channel sample interleave transfer */ - edma_minor_offset_config_t minorOffset = { - .enableSrcMinorOffset = true, - .enableDestMinorOffset = false, - .minorOffset = 0xFFFFFU - mappedChannel * (uint32_t)FSL_FEATURE_PDM_FIFO_OFFSET + 1U}; - - /* Check if input parameter invalid */ - if ((xfer->data == NULL) || (xfer->dataSize == 0U)) - { - return kStatus_InvalidArgument; - } - - if ((handle->interleaveType == kPDM_EDMAMultiChannelInterleavePerChannelBlock) && (mappedChannel > 1U)) - { - /* Limitation of the feature, reference the API comments */ - if (((startAddr & 0xFU) != 0U) || (mappedChannel > 4U)) - { - return kStatus_InvalidArgument; - } - modulo = PDM_TransferMappingChannel(&mappedChannel); - if ((xfer->dataSize % mappedChannel) != 0U) - { - return kStatus_InvalidArgument; - } - destOffset = xfer->dataSize / mappedChannel; - /* reconfigure the minor loop offset for channel block interleave */ - minorOffset.enableSrcMinorOffset = false, minorOffset.enableDestMinorOffset = true, - minorOffset.minorOffset = - 0xFFFFFU - mappedChannel * (uint32_t)destOffset + (uint32_t)FSL_FEATURE_PDM_FIFO_WIDTH + 1U; - } - - while (currentTransfer != NULL) - { - if (handle->tcdUsedNum >= handle->tcdNum) - { - return kStatus_PDM_QueueFull; - } - else - { - uint32_t primask = DisableGlobalIRQ(); - handle->tcdUsedNum++; - EnableGlobalIRQ(primask); - } - - nextTcdIndex = (handle->tcdUser + 1U) % handle->tcdNum; - - if (mappedChannel == 1U) - { - EDMA_PrepareTransferConfig(&config, (void *)(uint32_t *)startAddr, FSL_FEATURE_PDM_FIFO_WIDTH, 0, - (uint8_t *)(uint32_t)currentTransfer->data, FSL_FEATURE_PDM_FIFO_WIDTH, - FSL_FEATURE_PDM_FIFO_WIDTH, handle->count * (uint32_t)FSL_FEATURE_PDM_FIFO_WIDTH, - currentTransfer->dataSize); - } - else - { - EDMA_PrepareTransferConfig(&config, (void *)(uint32_t *)startAddr, FSL_FEATURE_PDM_FIFO_WIDTH, - FSL_FEATURE_PDM_FIFO_OFFSET, (uint8_t *)(uint32_t)currentTransfer->data, - FSL_FEATURE_PDM_FIFO_WIDTH, (int16_t)destOffset, - mappedChannel * (uint32_t)FSL_FEATURE_PDM_FIFO_WIDTH, currentTransfer->dataSize); - } -#if defined FSL_EDMA_DRIVER_EDMA4 && FSL_EDMA_DRIVER_EDMA4 - EDMA_TcdSetTransferConfigExt(handle->dmaHandle->base, (edma_tcd_t *)&handle->tcd[handle->tcdUser], &config, - (edma_tcd_t *)&handle->tcd[nextTcdIndex]); - - if (mappedChannel > 1U) - { - EDMA_TcdSetMinorOffsetConfigExt(handle->dmaHandle->base, (edma_tcd_t *)&handle->tcd[handle->tcdUser], - &minorOffset); - - if (handle->interleaveType == kPDM_EDMAMultiChannelInterleavePerChannelBlock) - { - EDMA_TcdSetModuloExt(handle->dmaHandle->base, (edma_tcd_t *)&handle->tcd[handle->tcdUser], modulo, - kEDMA_ModuloDisable); - } - } - - EDMA_TcdEnableInterruptsExt(handle->dmaHandle->base, (edma_tcd_t *)&handle->tcd[handle->tcdUser], - (uint32_t)kEDMA_MajorInterruptEnable); -#else - EDMA_TcdSetTransferConfig((edma_tcd_t *)&handle->tcd[handle->tcdUser], &config, - (edma_tcd_t *)&handle->tcd[nextTcdIndex]); - - if (mappedChannel > 1U) - { - EDMA_TcdSetMinorOffsetConfig((edma_tcd_t *)&handle->tcd[handle->tcdUser], &minorOffset); - - if (handle->interleaveType == kPDM_EDMAMultiChannelInterleavePerChannelBlock) - { - EDMA_TcdSetModulo((edma_tcd_t *)&handle->tcd[handle->tcdUser], modulo, kEDMA_ModuloDisable); - } - } - - EDMA_TcdEnableInterrupts((edma_tcd_t *)&handle->tcd[handle->tcdUser], (uint32_t)kEDMA_MajorInterruptEnable); -#endif - - handle->tcdUser = nextTcdIndex; - - currentTransfer = currentTransfer->linkTransfer; - - if (currentTransfer == xfer) - { - handle->isLoopTransfer = true; - break; - } - } - - if (handle->state != (uint32_t)kPDM_Busy) - { - EDMA_InstallTCD(handle->dmaHandle->base, handle->dmaHandle->channel, (edma_tcd_t *)&handle->tcd[tcdIndex]); - /* Start DMA transfer */ - EDMA_StartTransfer(handle->dmaHandle); - - /* Enable DMA enable bit */ - PDM_EnableDMA(base, true); -#if defined(MCUX_SDK_PDM_EDMA_PDM_ENABLE_INTERNAL) && MCUX_SDK_PDM_EDMA_PDM_ENABLE_INTERNAL - /* enable PDM */ - PDM_Enable(base, true); -#endif - - handle->state = (uint32_t)kPDM_Busy; - } - - return kStatus_Success; -} - -/*! - * brief Aborts a PDM receive using eDMA. - * - * This function only aborts the current transfer slots, the other transfer slots' information still kept - * in the handler. If users want to terminate all transfer slots, just call PDM_TransferTerminateReceiveEDMA. - * - * param base PDM base pointer - * param handle PDM eDMA handle pointer. - */ -void PDM_TransferAbortReceiveEDMA(PDM_Type *base, pdm_edma_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable dma */ - EDMA_AbortTransfer(handle->dmaHandle); - - /* Disable DMA enable bit */ - PDM_EnableDMA(base, false); - - /* Disable PDM */ - PDM_Enable(base, false); - - /* Handle the queue index */ - handle->tcdUsedNum--; - - /* Set the handle state */ - handle->state = (uint32_t)kPDM_Idle; -} - -/*! - * brief Terminate all PDM receive. - * - * This function will clear all transfer slots buffered in the pdm queue. If users only want to abort the - * current transfer slot, please call PDM_TransferAbortReceiveEDMA. - * - * param base PDM base pointer. - * param handle PDM eDMA handle pointer. - */ -void PDM_TransferTerminateReceiveEDMA(PDM_Type *base, pdm_edma_handle_t *handle) -{ - assert(handle != NULL); - - /* Abort the current transfer */ - PDM_TransferAbortReceiveEDMA(base, handle); - - /* Clear all the internal information */ - (void)memset(handle->tcd, 0, sizeof(edma_tcd_t) * handle->tcdNum); - handle->tcdUser = 0U; - handle->tcdUsedNum = 0U; -} - -/*! - * brief Gets byte count received by PDM. - * - * param base PDM base pointer - * param handle PDM eDMA handle pointer. - * param count Bytes count received by PDM. - * retval kStatus_Success Succeed get the transfer count. - * retval kStatus_NoTransferInProgress There is no non-blocking transaction in progress. - */ -status_t PDM_TransferGetReceiveCountEDMA(PDM_Type *base, pdm_edma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - *count = handle->receivedBytes; - - return kStatus_Success; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_pdm_edma.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_pdm_edma.h deleted file mode 100644 index b3d363f1ce3..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_pdm_edma.h +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Copyright 2019 - 2020, NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_PDM_EDMA_H_ -#define FSL_PDM_EDMA_H_ - -#include "fsl_edma.h" -#include "fsl_pdm.h" - -/*! - * @addtogroup pdm_edma PDM EDMA Driver - * @ingroup pdm - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -#define FSL_PDM_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 6, 3)) /*!< Version 2.6.3 */ -/*! @} */ - -/*! @brief the PDM enable position When calling PDM_TransferReceiveEDMA */ -#ifndef MCUX_SDK_PDM_EDMA_PDM_ENABLE_INTERNAL -#define MCUX_SDK_PDM_EDMA_PDM_ENABLE_INTERNAL 1U -#endif - -/*! @brief PDM edma handler */ -typedef struct _pdm_edma_handle pdm_edma_handle_t; - -/*!@brief pdm multi channel interleave type */ -typedef enum _pdm_edma_multi_channel_interleave -{ - kPDM_EDMAMultiChannelInterleavePerChannelSample = - 0U, /*!< multi channel PDM data interleave per channel sample - * ------------------------------------------------------------------------- - * |CHANNEL0 | CHANNEL1 | CHANNEL0 | CHANNEL1 | CHANNEL0 | CHANNEL 1 | ....| - * ------------------------------------------------------------------------- - */ - kPDM_EDMAMultiChannelInterleavePerChannelBlock = - 1U, /*!< multi channel PDM data interleave per channel block - * ---------------------------------------------------------------------------------------------------------------------------- - * |CHANNEL0 | CHANNEL0 | CHANNEL0 | ...... | CHANNEL1 | CHANNEL 1 | CHANNEL 1 | ....| CHANNEL2 | CHANNEL 2 - * | CHANNEL 2 | ....| - * ---------------------------------------------------------------------------------------------------------------------------- - */ -} pdm_edma_multi_channel_interleave_t; - -/*! @brief PDM edma transfer */ -typedef struct _pdm_edma_transfer -{ - volatile uint8_t *data; /*!< Data start address to transfer. */ - volatile size_t dataSize; /*!< Total Transfer bytes size. */ - struct _pdm_edma_transfer *linkTransfer; /*!< linked transfer configurations */ -} pdm_edma_transfer_t; - -/*! @brief PDM eDMA transfer callback function for finish and error */ -typedef void (*pdm_edma_callback_t)(PDM_Type *base, pdm_edma_handle_t *handle, status_t status, void *userData); - -/*! @brief PDM DMA transfer handle, users should not touch the content of the handle.*/ -struct _pdm_edma_handle -{ - edma_handle_t *dmaHandle; /*!< DMA handler for PDM send */ - uint8_t count; /*!< The transfer data count in a DMA request */ - uint32_t receivedBytes; /*!< total transfer count */ - uint32_t state; /*!< Internal state for PDM eDMA transfer */ - pdm_edma_callback_t callback; /*!< Callback for users while transfer finish or error occurs */ - bool isLoopTransfer; /*!< loop transfer */ - void *userData; /*!< User callback parameter */ - edma_tcd_t *tcd; /*!< TCD pool for eDMA transfer. */ - uint32_t tcdNum; /*!< TCD number */ - uint32_t tcdUser; /*!< Index for user to queue transfer. */ - uint32_t tcdDriver; /*!< Index for driver to get the transfer data and size */ - volatile uint32_t tcdUsedNum; /*!< Index for user to queue transfer. */ - - pdm_edma_multi_channel_interleave_t interleaveType; /*!< multi channel transfer interleave type */ - - uint8_t endChannel; /*!< The last enabled channel */ - uint8_t channelNums; /*!< total channel numbers */ -}; - -/******************************************************************************* - * APIs - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name PDM eDMA Transactional - * @{ - */ - -/*! - * @brief Install EDMA descriptor memory. - * - * @param handle Pointer to EDMA channel transfer handle. - * @param tcdAddr EDMA head descriptor address. - * @param tcdNum EDMA link descriptor address. - */ -void PDM_TransferInstallEDMATCDMemory(pdm_edma_handle_t *handle, void *tcdAddr, size_t tcdNum); - -/*! - * @brief Initializes the PDM Rx eDMA handle. - * - * This function initializes the PDM slave DMA handle, which can be used for other PDM master transactional APIs. - * Usually, for a specified PDM instance, call this API once to get the initialized handle. - * - * @param base PDM base pointer. - * @param handle PDM eDMA handle pointer. - * @param callback Pointer to user callback function. - * @param userData User parameter passed to the callback function. - * @param dmaHandle eDMA handle pointer, this handle shall be static allocated by users. - */ -void PDM_TransferCreateHandleEDMA( - PDM_Type *base, pdm_edma_handle_t *handle, pdm_edma_callback_t callback, void *userData, edma_handle_t *dmaHandle); - -/*! - * @brief Initializes the multi PDM channel interleave type. - * - * This function initializes the PDM DMA handle member interleaveType, it shall be called only when application would - * like to use type kPDM_EDMAMultiChannelInterleavePerChannelBlock, since the default interleaveType is - * kPDM_EDMAMultiChannelInterleavePerChannelSample always - * - * @param handle PDM eDMA handle pointer. - * @param multiChannelInterleaveType Multi channel interleave type. - */ -void PDM_TransferSetMultiChannelInterleaveType(pdm_edma_handle_t *handle, - pdm_edma_multi_channel_interleave_t multiChannelInterleaveType); - -/*! - * @brief Configures the PDM channel. - * - * @param base PDM base pointer. - * @param handle PDM eDMA handle pointer. - * @param channel channel index. - * @param config pdm channel configurations. - */ -void PDM_TransferSetChannelConfigEDMA(PDM_Type *base, - pdm_edma_handle_t *handle, - uint32_t channel, - const pdm_channel_config_t *config); - -/*! - * @brief Performs a non-blocking PDM receive using eDMA. - * - * @note This interface returns immediately after the transfer initiates. Call - * the PDM_GetReceiveRemainingBytes to poll the transfer status and check whether the PDM transfer is finished. - * - * Mcaro MCUX_SDK_PDM_EDMA_PDM_ENABLE_INTERNAL can control whether PDM is enabled internally or externally. - * - * 1. Scatter gather case: - * This functio support dynamic scatter gather and staic scatter gather, - * a. for the dynamic scatter gather case: - * Application should call PDM_TransferReceiveEDMA function continuously to make sure new receive request is submit - * before the previous one finish. b. for the static scatter gather case: Application should use the link transfer - * feature and make sure a loop link transfer is provided, such as: - * @code pdm_edma_transfer_t pdmXfer[2] = - * { - * { - * .data = s_buffer, - * .dataSize = BUFFER_SIZE, - * .linkTransfer = &pdmXfer[1], - * }, - * - * { - * .data = &s_buffer[BUFFER_SIZE], - * .dataSize = BUFFER_SIZE, - * .linkTransfer = &pdmXfer[0] - * }, - * }; - * @endcode - * - * 2. Multi channel case: - * This function support receive multi pdm channel data, for example, if two channel is requested, - * @code - * PDM_TransferSetChannelConfigEDMA(DEMO_PDM, &s_pdmRxHandle_0, DEMO_PDM_ENABLE_CHANNEL_0, &channelConfig); - * PDM_TransferSetChannelConfigEDMA(DEMO_PDM, &s_pdmRxHandle_0, DEMO_PDM_ENABLE_CHANNEL_1, &channelConfig); - * PDM_TransferReceiveEDMA(DEMO_PDM, &s_pdmRxHandle_0, pdmXfer); - * @endcode - * The output data will be formatted as below if handle->interleaveType = - * kPDM_EDMAMultiChannelInterleavePerChannelSample : - * ------------------------------------------------------------------------- - * |CHANNEL0 | CHANNEL1 | CHANNEL0 | CHANNEL1 | CHANNEL0 | CHANNEL 1 | ....| - * ------------------------------------------------------------------------- - * - * The output data will be formatted as below if handle->interleaveType = kPDM_EDMAMultiChannelInterleavePerChannelBlock - * : - * ---------------------------------------------------------------------------------------------------------------------- - * |CHANNEL3 | CHANNEL3 | CHANNEL3 | .... | CHANNEL4 | CHANNEL 4 | CHANNEL4 |....| CHANNEL5 | CHANNEL 5 | CHANNEL5 - * |....| - * ---------------------------------------------------------------------------------------------------------------------- - * Note: the dataSize of xfer is the total data size, while application using - * kPDM_EDMAMultiChannelInterleavePerChannelBlock, the buffer size for each PDM channel is channelSize = dataSize / - * channelNums, then there are limitation for this feature, - * 1. 3 DMIC array: the dataSize shall be 4 * (channelSize) - * The addtional buffer is mandantory for edma modulo feature. - * 2. The kPDM_EDMAMultiChannelInterleavePerChannelBlock feature support below dmic array only, - * 2 DMIC array: CHANNEL3, CHANNEL4 - * 3 DMIC array: CHANNEL3, CHANNEL4, CHANNEL5 - * 4 DMIC array: CHANNEL3, CHANNEL4, CHANNEL5, CHANNEL6 - * Any other combinations is not support, that is to SAY, THE FEATURE SUPPORT RECEIVE START FROM CHANNEL3 ONLY AND 4 - * MAXIMUM DMIC CHANNELS. - * - * @param base PDM base pointer - * @param handle PDM eDMA handle pointer. - * @param xfer Pointer to DMA transfer structure. - * @retval kStatus_Success Start a PDM eDMA receive successfully. - * @retval kStatus_InvalidArgument The input argument is invalid. - * @retval kStatus_RxBusy PDM is busy receiving data. - */ -status_t PDM_TransferReceiveEDMA(PDM_Type *base, pdm_edma_handle_t *handle, pdm_edma_transfer_t *xfer); - -/*! - * @brief Terminate all PDM receive. - * - * This function will clear all transfer slots buffered in the pdm queue. If users only want to abort the - * current transfer slot, please call PDM_TransferAbortReceiveEDMA. - * - * @param base PDM base pointer. - * @param handle PDM eDMA handle pointer. - */ -void PDM_TransferTerminateReceiveEDMA(PDM_Type *base, pdm_edma_handle_t *handle); - -/*! - * @brief Aborts a PDM receive using eDMA. - * - * This function only aborts the current transfer slots, the other transfer slots' information still kept - * in the handler. If users want to terminate all transfer slots, just call PDM_TransferTerminateReceiveEDMA. - * - * @param base PDM base pointer - * @param handle PDM eDMA handle pointer. - */ -void PDM_TransferAbortReceiveEDMA(PDM_Type *base, pdm_edma_handle_t *handle); - -/*! - * @brief Gets byte count received by PDM. - * - * @param base PDM base pointer - * @param handle PDM eDMA handle pointer. - * @param count Bytes count received by PDM. - * @retval kStatus_Success Succeed get the transfer count. - * @retval kStatus_NoTransferInProgress There is no non-blocking transaction in progress. - */ -status_t PDM_TransferGetReceiveCountEDMA(PDM_Type *base, pdm_edma_handle_t *handle, size_t *count); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_pint.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_pint.c deleted file mode 100644 index ece6c66243c..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_pint.c +++ /dev/null @@ -1,1053 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_pint.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.pint" -#endif - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -#ifndef FSL_FEATURE_PINT_NUMBER_OF_INSTANCE -#define FSL_FEATURE_PINT_NUMBER_OF_INSTANCE (1U) -#endif - -#if defined(GPIOINT_RSTS_N) -#define PINT_RESETS_ARRAY GPIOINT_RSTS_N -#elif defined(PINT_RSTS) -#define PINT_RESETS_ARRAY PINT_RSTS -#elif defined(GPIO_RSTS_N) -#define PINT_RESETS_ARRAY GPIO_RSTS_N -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/*! @brief Array to map PINT instance number to base pointer. */ -static PINT_Type *const s_pintBases[] = PINT_BASE_PTRS; - -#if defined(PINT_RESETS_ARRAY) -/*! @brief Reset array */ -static const reset_ip_name_t s_pintResets[] = PINT_RESETS_ARRAY; -#endif - -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) -/*! @brief Irq number array */ -static const IRQn_Type s_pintIRQ[FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS + - FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS] = PINT_IRQS; - -/*! @brief Callback function array for SECPINT(s). */ -static pint_cb_t s_secpintCallback[FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS]; -#else -/*! @brief Irq number array */ -static const IRQn_Type s_pintIRQ[FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS] = PINT_IRQS; -#endif /* FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS */ - -/*! @brief Callback function array for PINT(s). */ -static pint_cb_t s_pintCallback[FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS]; - -/******************************************************************************* - * Code - ******************************************************************************/ -/*! - * @brief Returns an instance number given a base address. - * - * If an invalid base address is passed, debug builds will assert. Release builds will just return - * instance number 0. - * - * @param base The PINT peripheral base address. - * @return PINT instance number starting from 0. - */ -static uint32_t PINT_GetInstance(PINT_Type *base) -{ - uint32_t instance; - for (instance = 0; instance < ARRAY_SIZE(s_pintBases); ++instance) - { - if (s_pintBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_pintBases)); - - return instance; -} - -/*! - * brief Initialize PINT peripheral. - - * This function initializes the PINT peripheral and enables the clock. - * - * param base Base address of the PINT peripheral. - * - * retval None. - */ -void PINT_Init(PINT_Type *base) -{ - uint32_t pmcfg = 0; - uint8_t pintcount = 0; - uint32_t instance; - uint32_t i; - assert(base != NULL); - - instance = PINT_GetInstance(base); - - if (instance < FSL_FEATURE_PINT_NUMBER_OF_INSTANCE) - { - pintcount = FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS; - /* Clear PINT callback array */ - for (i = 0; i < (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS; i++) - { - s_pintCallback[i] = NULL; - } - } - else - { -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) - pintcount = FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS; - /* Clear SECPINT callback array */ - for (i = 0; i < (uint32_t)FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS; i++) - { - s_secpintCallback[i] = NULL; - } -#endif /* FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS */ - } - - /* Disable all bit slices for pint*/ - for (i = 0; i < pintcount; i++) - { - pmcfg = pmcfg | ((uint32_t)kPINT_PatternMatchNever << (PININT_BITSLICE_CFG_START + (i * 3U))); - } - -#if defined(FSL_FEATURE_CLOCK_HAS_GPIOINT_CLOCK_SOURCE) && (FSL_FEATURE_CLOCK_HAS_GPIOINT_CLOCK_SOURCE == 1) - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock. */ - CLOCK_EnableClock(kCLOCK_GpioInt); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#if defined(PINT_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_pintResets[instance]); -#endif /* PINT_RESETS_ARRAY */ - -#elif defined(FSL_FEATURE_CLOCK_HAS_GPIOINT_CLOCK_SOURCE) && (FSL_FEATURE_CLOCK_HAS_GPIOINT_CLOCK_SOURCE == 0) - - if (instance < FSL_FEATURE_PINT_NUMBER_OF_INSTANCE) - { -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_EnableClock(kCLOCK_Gpio0); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - } - else - { -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_EnableClock(kCLOCK_Gpio_Sec); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS */ - } - -#if defined(PINT_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_pintResets[instance]); -#endif /* PINT_RESETS_ARRAY */ - -#else - - if (instance < FSL_FEATURE_PINT_NUMBER_OF_INSTANCE) - { -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_EnableClock(kCLOCK_Pint); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - } - else - { - /* if need config SECURE PINT device,then enable secure pint interrupt clock */ -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_EnableClock(kCLOCK_Gpio_Sec_Int); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS */ - } - -#if defined(PINT_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_pintResets[instance]); -#endif /* PINT_RESETS_ARRAY */ - -#endif /* FSL_FEATURE_CLOCK_HAS_GPIOINT_CLOCK_SOURCE */ - - /* Disable all pattern match bit slices */ - base->PMCFG = pmcfg; -} - -/*! - * brief Configure PINT peripheral pin interrupt. - - * This function configures a given pin interrupt. - * - * param base Base address of the PINT peripheral. - * param intr Pin interrupt. - * param enable Selects detection logic. - * param callback Callback. - * - * retval None. - */ -void PINT_PinInterruptConfig(PINT_Type *base, pint_pin_int_t intr, pint_pin_enable_t enable, pint_cb_t callback) -{ - assert(base != NULL); - uint32_t instance = PINT_GetInstance(base); - - /* Clear Rise and Fall flags first */ - PINT_PinInterruptClrRiseFlag(base, intr); - PINT_PinInterruptClrFallFlag(base, intr); - - /* Security PINT uses additional callback array */ - if (instance < FSL_FEATURE_PINT_NUMBER_OF_INSTANCE) - { - s_pintCallback[intr] = callback; - } - else - { -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) - s_secpintCallback[intr] = callback; -#endif - } - - /* select level or edge sensitive */ - base->ISEL = (base->ISEL & ~(1UL << (uint32_t)intr)) | - ((((uint32_t)enable & PINT_PIN_INT_LEVEL) != 0U) ? (1UL << (uint32_t)intr) : 0U); - - /* enable rising or level interrupt */ - if (((unsigned)enable & (PINT_PIN_INT_LEVEL | PINT_PIN_INT_RISE)) != 0U) - { - base->SIENR = 1UL << (uint32_t)intr; - } - else - { - base->CIENR = 1UL << (uint32_t)intr; - } - - /* Enable falling or select high level */ - if (((unsigned)enable & PINT_PIN_INT_FALL_OR_HIGH_LEVEL) != 0U) - { - base->SIENF = 1UL << (uint32_t)intr; - } - else - { - base->CIENF = 1UL << (uint32_t)intr; - } -} - -/*! - * brief Get PINT peripheral pin interrupt configuration. - - * This function returns the configuration of a given pin interrupt. - * - * param base Base address of the PINT peripheral. - * param pintr Pin interrupt. - * param enable Pointer to store the detection logic. - * param callback Callback. - * - * retval None. - */ -void PINT_PinInterruptGetConfig(PINT_Type *base, pint_pin_int_t pintr, pint_pin_enable_t *enable, pint_cb_t *callback) -{ - uint32_t instance = PINT_GetInstance(base); - uint32_t mask; - bool level; - - assert(base != NULL); - - *enable = kPINT_PinIntEnableNone; - level = false; - - mask = 1UL << (uint32_t)pintr; - if ((base->ISEL & mask) != 0U) - { - /* Pin interrupt is level sensitive */ - level = true; - } - - if ((base->IENR & mask) != 0U) - { - if (level) - { - /* Level interrupt is enabled */ - *enable = kPINT_PinIntEnableLowLevel; - } - else - { - /* Rising edge interrupt */ - *enable = kPINT_PinIntEnableRiseEdge; - } - } - - if ((base->IENF & mask) != 0U) - { - if (level) - { - /* Level interrupt is active high */ - *enable = kPINT_PinIntEnableHighLevel; - } - else - { - /* Either falling or both edge */ - if (*enable == kPINT_PinIntEnableRiseEdge) - { - /* Rising and faling edge */ - *enable = kPINT_PinIntEnableBothEdges; - } - else - { - /* Falling edge */ - *enable = kPINT_PinIntEnableFallEdge; - } - } - } - - /* Security PINT uses additional callback array */ - if (instance < FSL_FEATURE_PINT_NUMBER_OF_INSTANCE) - { - *callback = s_pintCallback[pintr]; - } - else - { -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) - *callback = s_secpintCallback[pintr]; -#endif - } -} - -/*! - * brief Configure PINT pattern match. - - * This function configures a given pattern match bit slice. - * - * param base Base address of the PINT peripheral. - * param bslice Pattern match bit slice number. - * param cfg Pointer to bit slice configuration. - * - * retval None. - */ -void PINT_PatternMatchConfig(PINT_Type *base, pint_pmatch_bslice_t bslice, pint_pmatch_cfg_t *cfg) -{ - uint32_t src_shift; - uint32_t cfg_shift; - uint32_t pmcfg; - uint32_t tmp_src_shift = PININT_BITSLICE_SRC_MASK; - uint32_t tmp_cfg_shift = PININT_BITSLICE_CFG_MASK; - uint32_t instance = PINT_GetInstance(base); - - assert(base != NULL); - - src_shift = PININT_BITSLICE_SRC_START + ((uint32_t)bslice * 3UL); - cfg_shift = PININT_BITSLICE_CFG_START + ((uint32_t)bslice * 3UL); - - /* Input source selection for selected bit slice */ - base->PMSRC = (base->PMSRC & ~(tmp_src_shift << src_shift)) | ((uint32_t)(cfg->bs_src) << src_shift); - - /* Bit slice configuration */ - pmcfg = base->PMCFG; - pmcfg = (pmcfg & ~(tmp_cfg_shift << cfg_shift)) | ((uint32_t)(cfg->bs_cfg) << cfg_shift); - - /* If end point is true, enable the bits */ - if ((uint32_t)bslice != 7UL) - { - if (cfg->end_point) - { - pmcfg |= (1UL << (uint32_t)bslice); - } - else - { - pmcfg &= ~(1UL << (uint32_t)bslice); - } - } - - base->PMCFG = pmcfg; - - /* Save callback pointer */ - if (instance < FSL_FEATURE_PINT_NUMBER_OF_INSTANCE) - { - if ((uint32_t)bslice < (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) - { - s_pintCallback[bslice] = cfg->callback; - } - } - else - { -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) - if ((uint32_t)bslice < (uint32_t)FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) - { - s_secpintCallback[bslice] = cfg->callback; - } -#endif - } -} - -/*! - * brief Get PINT pattern match configuration. - - * This function returns the configuration of a given pattern match bit slice. - * - * param base Base address of the PINT peripheral. - * param bslice Pattern match bit slice number. - * param cfg Pointer to bit slice configuration. - * - * retval None. - */ -void PINT_PatternMatchGetConfig(PINT_Type *base, pint_pmatch_bslice_t bslice, pint_pmatch_cfg_t *cfg) -{ - uint32_t src_shift; - uint32_t cfg_shift; - uint32_t tmp_src_shift = PININT_BITSLICE_SRC_MASK; - uint32_t tmp_cfg_shift = PININT_BITSLICE_CFG_MASK; - uint32_t instance = PINT_GetInstance(base); - - assert(base != NULL); - - src_shift = PININT_BITSLICE_SRC_START + ((uint32_t)bslice * 3UL); - cfg_shift = PININT_BITSLICE_CFG_START + ((uint32_t)bslice * 3UL); - - cfg->bs_src = (pint_pmatch_input_src_t)(uint32_t)((base->PMSRC & (tmp_src_shift << src_shift)) >> src_shift); - cfg->bs_cfg = (pint_pmatch_bslice_cfg_t)(uint32_t)((base->PMCFG & (tmp_cfg_shift << cfg_shift)) >> cfg_shift); - - if ((uint32_t)bslice == 7U) - { - cfg->end_point = true; - } - else - { - cfg->end_point = (((base->PMCFG & (1UL << (uint32_t)bslice)) >> (uint32_t)bslice) != 0U) ? true : false; - } - - if (instance < FSL_FEATURE_PINT_NUMBER_OF_INSTANCE) - { - if ((uint32_t)bslice < (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) - { - cfg->callback = s_pintCallback[bslice]; - } - } - else - { -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) - if ((uint32_t)bslice < (uint32_t)FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) - { - cfg->callback = s_secpintCallback[bslice]; - } -#endif - } -} - -/*! - * brief Reset pattern match detection logic. - - * This function resets the pattern match detection logic if any of the product term is matching. - * - * param base Base address of the PINT peripheral. - * - * retval pmstatus Each bit position indicates the match status of corresponding bit slice. - * = 0 Match was detected. = 1 Match was not detected. - */ -uint32_t PINT_PatternMatchResetDetectLogic(PINT_Type *base) -{ - uint32_t pmctrl; - uint32_t pmstatus; - uint32_t pmsrc; - - pmctrl = base->PMCTRL; - pmstatus = pmctrl >> PINT_PMCTRL_PMAT_SHIFT; - if (pmstatus != 0UL) - { - /* Reset Pattern match engine detection logic */ - pmsrc = base->PMSRC; - base->PMSRC = pmsrc; - } - return (pmstatus); -} - -/*! - * @brief Clear Selected pin interrupt status only when the pin was triggered by edge-sensitive. - - * This function clears the selected pin interrupt status. - * - * @param base Base address of the PINT peripheral. - * @param pintr Pin interrupt. - * - * @retval None. - */ -void PINT_PinInterruptClrStatus(PINT_Type *base, pint_pin_int_t pintr) -{ - uint32_t pinIntMode = base->ISEL & (1UL << (uint32_t)pintr); - uint32_t pinIntStatus = base->IST & (1UL << (uint32_t)pintr); - - /* Edge sensitive and pin interrupt that is currently requesting an interrupt. */ - if ((pinIntMode == 0x0UL) && (pinIntStatus != 0x0UL)) - { - base->IST = (1UL << (uint32_t)pintr); - } -} - -/*! - * @brief Clear all pin interrupts status only when pins were triggered by edge-sensitive. - - * This function clears the status of all pin interrupts. - * - * @param base Base address of the PINT peripheral. - * - * @retval None. - */ -void PINT_PinInterruptClrStatusAll(PINT_Type *base) -{ - uint32_t instance = PINT_GetInstance(base); - uint32_t pinIntMode = 0; - uint32_t pinIntStatus = 0; - uint32_t pinIntCount = 0; - uint32_t mask = 0; - uint32_t i; - - if (instance < FSL_FEATURE_PINT_NUMBER_OF_INSTANCE) - { - pinIntCount = (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS; - } - else - { -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) - pinIntCount = (uint32_t)FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS; -#endif /* FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS */ - } - - for (i = 0; i < pinIntCount; i++) - { - pinIntMode = base->ISEL & (1UL << i); - pinIntStatus = base->IST & (1UL << i); - - /* Edge sensitive and pin interrupt that is currently requesting an interrupt. */ - if ((pinIntMode == 0x0UL) && (pinIntStatus != 0x0UL)) - { - mask |= 1UL << i; - } - } - - base->IST = mask; -} - -/*! - * brief Enable callback. - - * This function enables the interrupt for the selected PINT peripheral. Although the pin(s) are monitored - * as soon as they are enabled, the callback function is not enabled until this function is called. - * - * param base Base address of the PINT peripheral. - * - * retval None. - */ -void PINT_EnableCallback(PINT_Type *base) -{ - uint32_t instance = PINT_GetInstance(base); - uint32_t i; - - assert(base != NULL); - - if (instance < FSL_FEATURE_PINT_NUMBER_OF_INSTANCE) - { -#if defined(FSL_FEATURE_PINT_INTERRUPT_COMBINE) && (FSL_FEATURE_PINT_INTERRUPT_COMBINE == 1) - for (i = 0; i < (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS; i++) - { - PINT_PinInterruptClrStatus(base, (pint_pin_int_t)i); - } - NVIC_ClearPendingIRQ(s_pintIRQ[0]); - (void)EnableIRQ(s_pintIRQ[0]); -#else - for (i = 0; i < (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS; i++) - { - PINT_PinInterruptClrStatus(base, (pint_pin_int_t)i); - NVIC_ClearPendingIRQ(s_pintIRQ[i]); - (void)EnableIRQ(s_pintIRQ[i]); - } -#endif - } - else - { -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) - for (i = 0; i < (uint32_t)FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS; i++) - { - PINT_PinInterruptClrStatus(base, (pint_pin_int_t)i); - NVIC_ClearPendingIRQ(s_pintIRQ[i + (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS]); - (void)EnableIRQ(s_pintIRQ[i + (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS]); - } -#endif /* FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS */ - } -} - -/*! - * brief enable callback by pin index. - - * This function enables callback by pin index instead of enabling all pins. - * - * param base Base address of the peripheral. - * param pinIdx pin index. - * - * retval None. - */ -void PINT_EnableCallbackByIndex(PINT_Type *base, pint_pin_int_t pintIdx) -{ - assert(base != NULL); - - PINT_PinInterruptClrStatus(base, (pint_pin_int_t)pintIdx); - -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) - /* Get the right security pint irq index in array */ - if ((base == SECPINT) && ((uint32_t)pintIdx < (uint32_t)FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS)) - { - pintIdx = - (pint_pin_int_t)(uint32_t)((uint32_t)pintIdx + (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS); - } -#endif /* FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS */ - -#if defined(FSL_FEATURE_PINT_INTERRUPT_COMBINE) && (FSL_FEATURE_PINT_INTERRUPT_COMBINE == 1) - NVIC_ClearPendingIRQ(s_pintIRQ[0]); - (void)EnableIRQ(s_pintIRQ[0]); -#else - NVIC_ClearPendingIRQ(s_pintIRQ[pintIdx]); - (void)EnableIRQ(s_pintIRQ[pintIdx]); -#endif -} - -/*! - * brief Disable callback. - - * This function disables the interrupt for the selected PINT peripheral. Although the pins are still - * being monitored but the callback function is not called. - * - * param base Base address of the peripheral. - * - * retval None. - */ -void PINT_DisableCallback(PINT_Type *base) -{ - uint32_t instance = PINT_GetInstance(base); - uint32_t i; - - assert(base != NULL); - - if (instance < FSL_FEATURE_PINT_NUMBER_OF_INSTANCE) - { -#if defined(FSL_FEATURE_PINT_INTERRUPT_COMBINE) && (FSL_FEATURE_PINT_INTERRUPT_COMBINE == 1) - (void)DisableIRQ(s_pintIRQ[0]); - for (i = 0; i < (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS; i++) - { - PINT_PinInterruptClrStatus(base, (pint_pin_int_t)i); - } - NVIC_ClearPendingIRQ(s_pintIRQ[0]); -#else - for (i = 0; i < (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS; i++) - { - (void)DisableIRQ(s_pintIRQ[i]); - PINT_PinInterruptClrStatus(base, (pint_pin_int_t)i); - NVIC_ClearPendingIRQ(s_pintIRQ[i]); - } -#endif - } - else - { -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) - for (i = 0; i < (uint32_t)FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS; i++) - { - (void)DisableIRQ(s_pintIRQ[i + (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS]); - PINT_PinInterruptClrStatus(base, (pint_pin_int_t)i); - NVIC_ClearPendingIRQ(s_pintIRQ[i + (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS]); - } -#endif /* FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS */ - } -} - -/*! - * brief disable callback by pin index. - - * This function disables callback by pin index instead of disabling all pins. - * - * param base Base address of the peripheral. - * param pinIdx pin index. - * - * retval None. - */ -void PINT_DisableCallbackByIndex(PINT_Type *base, pint_pin_int_t pintIdx) -{ - uint32_t instance = PINT_GetInstance(base); - - assert(base != NULL); - - if (instance < FSL_FEATURE_PINT_NUMBER_OF_INSTANCE) - { -#if defined(FSL_FEATURE_PINT_INTERRUPT_COMBINE) && (FSL_FEATURE_PINT_INTERRUPT_COMBINE == 1) - (void)DisableIRQ(s_pintIRQ[0]); - PINT_PinInterruptClrStatus(base, (pint_pin_int_t)pintIdx); - NVIC_ClearPendingIRQ(s_pintIRQ[0]); -#else - (void)DisableIRQ(s_pintIRQ[pintIdx]); - PINT_PinInterruptClrStatus(base, (pint_pin_int_t)pintIdx); - NVIC_ClearPendingIRQ(s_pintIRQ[pintIdx]); -#endif - } - else - { -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) - (void)DisableIRQ(s_pintIRQ[(uint32_t)pintIdx + (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS]); - PINT_PinInterruptClrStatus(base, (pint_pin_int_t)pintIdx); - NVIC_ClearPendingIRQ(s_pintIRQ[(uint32_t)pintIdx + (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS]); -#endif - } -} - -/*! - * brief Deinitialize PINT peripheral. - - * This function disables the PINT clock. - * - * param base Base address of the PINT peripheral. - * - * retval None. - */ -void PINT_Deinit(PINT_Type *base) -{ - uint32_t instance = PINT_GetInstance(base); - uint32_t i; - - assert(base != NULL); - - /* Cleanup */ - PINT_DisableCallback(base); - if (instance < FSL_FEATURE_PINT_NUMBER_OF_INSTANCE) - { - /* Clear PINT callback array */ - for (i = 0; i < (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS; i++) - { - s_pintCallback[i] = NULL; - } - } - else - { -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) - /* Clear SECPINT callback array */ - for (i = 0; i < (uint32_t)FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS; i++) - { - s_secpintCallback[i] = NULL; - } -#endif /* FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS */ - } - -#if defined(FSL_FEATURE_CLOCK_HAS_GPIOINT_CLOCK_SOURCE) && (FSL_FEATURE_CLOCK_HAS_GPIOINT_CLOCK_SOURCE == 1) - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_DisableClock(kCLOCK_GpioInt); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#elif defined(FSL_FEATURE_CLOCK_HAS_GPIOINT_CLOCK_SOURCE) && (FSL_FEATURE_CLOCK_HAS_GPIOINT_CLOCK_SOURCE == 0) - - if (instance < FSL_FEATURE_PINT_NUMBER_OF_INSTANCE) - { -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_DisableClock(kCLOCK_Gpio0); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - } - else - { -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_DisableClock(kCLOCK_Gpio_Sec); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS */ - } - -#else - - if (instance < FSL_FEATURE_PINT_NUMBER_OF_INSTANCE) - { -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_DisableClock(kCLOCK_Pint); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - } - else - { - /* if need config SECURE PINT device,then enable secure pint interrupt clock */ -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_DisableClock(kCLOCK_Gpio_Sec_Int); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -#endif /* FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS */ - } -#endif /* FSL_FEATURE_CLOCK_HAS_GPIOINT_CLOCK_SOURCE */ -} -#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) -/* IRQ handler functions overloading weak symbols in the startup */ -void SEC_GPIO_INT0_IRQ0_DriverIRQHandler(void); -void SEC_GPIO_INT0_IRQ0_DriverIRQHandler(void) -{ - uint32_t secPintIndex = FSL_FEATURE_PINT_NUMBER_OF_INSTANCE; - uint32_t pmstatus = 0; - - /* Reset pattern match detection */ - pmstatus = PINT_PatternMatchResetDetectLogic(s_pintBases[secPintIndex]); - /* Call user function */ - if (s_secpintCallback[kPINT_SecPinInt0] != NULL) - { - s_secpintCallback[kPINT_SecPinInt0](kPINT_SecPinInt0, pmstatus); - } - if ((s_pintBases[secPintIndex]->ISEL & 0x1U) == 0x0U) - { - /* Edge sensitive: clear Pin interrupt after callback */ - PINT_PinInterruptClrStatus(s_pintBases[secPintIndex], kPINT_PinInt0); - } - SDK_ISR_EXIT_BARRIER; -} - -#if (FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS > 1U) -/* IRQ handler functions overloading weak symbols in the startup */ -void SEC_GPIO_INT0_IRQ1_DriverIRQHandler(void); -void SEC_GPIO_INT0_IRQ1_DriverIRQHandler(void) -{ - uint32_t secPintIndex = FSL_FEATURE_PINT_NUMBER_OF_INSTANCE; - uint32_t pmstatus; - - /* Reset pattern match detection */ - pmstatus = PINT_PatternMatchResetDetectLogic(s_pintBases[secPintIndex]); - /* Call user function */ - if (s_secpintCallback[kPINT_SecPinInt1] != NULL) - { - s_secpintCallback[kPINT_SecPinInt1](kPINT_SecPinInt1, pmstatus); - } - if ((s_pintBases[secPintIndex]->ISEL & 0x1U) == 0x0U) - { - /* Edge sensitive: clear Pin interrupt after callback */ - PINT_PinInterruptClrStatus(s_pintBases[secPintIndex], kPINT_PinInt1); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS */ -#endif /* FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS */ - -void PINT0_DriverIRQHandler(void); -void PINT0_DriverIRQHandler(void) -{ - uint32_t flags = (s_pintBases[0]->IST & PINT_IST_PSTAT_MASK) | PINT_PatternMatchGetStatusAll(s_pintBases[0]); - uint32_t pmstatus; - - for (uint8_t i = 0; i < (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS; i++) - { - if ((flags & (1UL << i)) != 0UL) - { - /* Reset pattern match detection */ - pmstatus = PINT_PatternMatchResetDetectLogic(s_pintBases[0]); - /* Call user function */ - if (s_pintCallback[i] != NULL) - { - s_pintCallback[i]((pint_pin_int_t)i, pmstatus); - } - if ((s_pintBases[0]->ISEL & (1UL << i)) == 0x0UL) - { - /* Edge sensitive: clear Pin interrupt after callback */ - PINT_PinInterruptClrStatus(s_pintBases[0], (pint_pin_int_t)i); - } - } - } - - SDK_ISR_EXIT_BARRIER; -} - -/* IRQ handler functions overloading weak symbols in the startup */ -void PIN_INT0_DriverIRQHandler(void); -void PIN_INT0_DriverIRQHandler(void) -{ - uint32_t pmstatus; - - /* Reset pattern match detection */ - pmstatus = PINT_PatternMatchResetDetectLogic(s_pintBases[0]); - /* Call user function */ - if (s_pintCallback[kPINT_PinInt0] != NULL) - { - s_pintCallback[kPINT_PinInt0](kPINT_PinInt0, pmstatus); - } - if ((s_pintBases[0]->ISEL & 0x1U) == 0x0U) - { - /* Edge sensitive: clear Pin interrupt after callback */ - PINT_PinInterruptClrStatus(s_pintBases[0], kPINT_PinInt0); - } - SDK_ISR_EXIT_BARRIER; -} - -#if (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 1U) -void PIN_INT1_DriverIRQHandler(void); -void PIN_INT1_DriverIRQHandler(void) -{ - uint32_t pmstatus; - - /* Reset pattern match detection */ - pmstatus = PINT_PatternMatchResetDetectLogic(s_pintBases[0]); - /* Call user function */ - if (s_pintCallback[kPINT_PinInt1] != NULL) - { - s_pintCallback[kPINT_PinInt1](kPINT_PinInt1, pmstatus); - } - if ((s_pintBases[0]->ISEL & 0x2U) == 0x0U) - { - /* Edge sensitive: clear Pin interrupt after callback */ - PINT_PinInterruptClrStatus(s_pintBases[0], kPINT_PinInt1); - } - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 2U) -void PIN_INT2_DriverIRQHandler(void); -void PIN_INT2_DriverIRQHandler(void) -{ - uint32_t pmstatus; - - /* Reset pattern match detection */ - pmstatus = PINT_PatternMatchResetDetectLogic(s_pintBases[0]); - /* Call user function */ - if (s_pintCallback[kPINT_PinInt2] != NULL) - { - s_pintCallback[kPINT_PinInt2](kPINT_PinInt2, pmstatus); - } - if ((s_pintBases[0]->ISEL & 0x4U) == 0x0U) - { - /* Edge sensitive: clear Pin interrupt after callback */ - PINT_PinInterruptClrStatus(s_pintBases[0], kPINT_PinInt2); - } - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 3U) -void PIN_INT3_DriverIRQHandler(void); -void PIN_INT3_DriverIRQHandler(void) -{ - uint32_t pmstatus; - - /* Reset pattern match detection */ - pmstatus = PINT_PatternMatchResetDetectLogic(s_pintBases[0]); - /* Call user function */ - if (s_pintCallback[kPINT_PinInt3] != NULL) - { - s_pintCallback[kPINT_PinInt3](kPINT_PinInt3, pmstatus); - } - if ((s_pintBases[0]->ISEL & 0x8U) == 0x0U) - { - /* Edge sensitive: clear Pin interrupt after callback */ - PINT_PinInterruptClrStatus(s_pintBases[0], kPINT_PinInt3); - } - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 4U) -void PIN_INT4_DriverIRQHandler(void); -void PIN_INT4_DriverIRQHandler(void) -{ - uint32_t pmstatus; - - /* Reset pattern match detection */ - pmstatus = PINT_PatternMatchResetDetectLogic(s_pintBases[0]); - /* Call user function */ - if (s_pintCallback[kPINT_PinInt4] != NULL) - { - s_pintCallback[kPINT_PinInt4](kPINT_PinInt4, pmstatus); - } - if ((s_pintBases[0]->ISEL & 0x10U) == 0x0U) - { - /* Edge sensitive: clear Pin interrupt after callback */ - PINT_PinInterruptClrStatus(s_pintBases[0], kPINT_PinInt4); - } - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 5U) -#if defined(FSL_FEATURE_NVIC_HAS_SHARED_INTERTTUPT_NUMBER) && FSL_FEATURE_NVIC_HAS_SHARED_INTERTTUPT_NUMBER -void PIN_INT5_DAC1_IRQHandler(void); -void PIN_INT5_DAC1_IRQHandler(void) -#else -void PIN_INT5_DriverIRQHandler(void); -void PIN_INT5_DriverIRQHandler(void) -#endif /* FSL_FEATURE_NVIC_HAS_SHARED_INTERTTUPT_NUMBER */ -{ - uint32_t pmstatus; - - /* Reset pattern match detection */ - pmstatus = PINT_PatternMatchResetDetectLogic(s_pintBases[0]); - /* Call user function */ - if (s_pintCallback[kPINT_PinInt5] != NULL) - { - s_pintCallback[kPINT_PinInt5](kPINT_PinInt5, pmstatus); - } - if ((s_pintBases[0]->ISEL & 0x20U) == 0x0U) - { - /* Edge sensitive: clear Pin interrupt after callback */ - PINT_PinInterruptClrStatus(s_pintBases[0], kPINT_PinInt5); - } - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 6U) -#if defined(FSL_FEATURE_NVIC_HAS_SHARED_INTERTTUPT_NUMBER) && FSL_FEATURE_NVIC_HAS_SHARED_INTERTTUPT_NUMBER -void PIN_INT6_USART3_IRQHandler(void); -void PIN_INT6_USART3_IRQHandler(void) -#else -void PIN_INT6_DriverIRQHandler(void); -void PIN_INT6_DriverIRQHandler(void) -#endif /* FSL_FEATURE_NVIC_HAS_SHARED_INTERTTUPT_NUMBER */ -{ - uint32_t pmstatus; - - /* Reset pattern match detection */ - pmstatus = PINT_PatternMatchResetDetectLogic(s_pintBases[0]); - /* Call user function */ - if (s_pintCallback[kPINT_PinInt6] != NULL) - { - s_pintCallback[kPINT_PinInt6](kPINT_PinInt6, pmstatus); - } - if ((s_pintBases[0]->ISEL & 0x40U) == 0x0U) - { - /* Edge sensitive: clear Pin interrupt after callback */ - PINT_PinInterruptClrStatus(s_pintBases[0], kPINT_PinInt6); - } - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 7U) -#if defined(FSL_FEATURE_NVIC_HAS_SHARED_INTERTTUPT_NUMBER) && FSL_FEATURE_NVIC_HAS_SHARED_INTERTTUPT_NUMBER -void PIN_INT7_USART4_IRQHandler(void); -void PIN_INT7_USART4_IRQHandler(void) -#else -void PIN_INT7_DriverIRQHandler(void); -void PIN_INT7_DriverIRQHandler(void) -#endif /* FSL_FEATURE_NVIC_HAS_SHARED_INTERTTUPT_NUMBER */ -{ - uint32_t pmstatus; - - /* Reset pattern match detection */ - pmstatus = PINT_PatternMatchResetDetectLogic(s_pintBases[0]); - /* Call user function */ - if (s_pintCallback[kPINT_PinInt7] != NULL) - { - s_pintCallback[kPINT_PinInt7](kPINT_PinInt7, pmstatus); - } - if ((s_pintBases[0]->ISEL & 0x80U) == 0x0U) - { - /* Edge sensitive: clear Pin interrupt after callback */ - PINT_PinInterruptClrStatus(s_pintBases[0], kPINT_PinInt7); - } - SDK_ISR_EXIT_BARRIER; -} -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_pint.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_pint.h deleted file mode 100644 index c3a3771f520..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_pint.h +++ /dev/null @@ -1,571 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_PINT_H_ -#define FSL_PINT_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup pint_driver - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -#define FSL_PINT_DRIVER_VERSION (MAKE_VERSION(2, 1, 13)) -/*! @} */ - -/* PININT Bit slice source register bits */ -#define PININT_BITSLICE_SRC_START 8U -#define PININT_BITSLICE_SRC_MASK 7U - -/* PININT Bit slice configuration register bits */ -#define PININT_BITSLICE_CFG_START 8U -#define PININT_BITSLICE_CFG_MASK 7U -#define PININT_BITSLICE_ENDP_MASK 7U - -#define PINT_PIN_INT_LEVEL 0x10U -#define PINT_PIN_INT_EDGE 0x00U -#define PINT_PIN_INT_FALL_OR_HIGH_LEVEL 0x02U -#define PINT_PIN_INT_RISE 0x01U -#define PINT_PIN_RISE_EDGE (PINT_PIN_INT_EDGE | PINT_PIN_INT_RISE) -#define PINT_PIN_FALL_EDGE (PINT_PIN_INT_EDGE | PINT_PIN_INT_FALL_OR_HIGH_LEVEL) -#define PINT_PIN_BOTH_EDGE (PINT_PIN_INT_EDGE | PINT_PIN_INT_RISE | PINT_PIN_INT_FALL_OR_HIGH_LEVEL) -#define PINT_PIN_LOW_LEVEL (PINT_PIN_INT_LEVEL) -#define PINT_PIN_HIGH_LEVEL (PINT_PIN_INT_LEVEL | PINT_PIN_INT_FALL_OR_HIGH_LEVEL) - -/*! @brief PINT Pin Interrupt enable type */ -typedef enum _pint_pin_enable -{ - kPINT_PinIntEnableNone = 0U, /*!< Do not generate Pin Interrupt */ - kPINT_PinIntEnableRiseEdge = PINT_PIN_RISE_EDGE, /*!< Generate Pin Interrupt on rising edge */ - kPINT_PinIntEnableFallEdge = PINT_PIN_FALL_EDGE, /*!< Generate Pin Interrupt on falling edge */ - kPINT_PinIntEnableBothEdges = PINT_PIN_BOTH_EDGE, /*!< Generate Pin Interrupt on both edges */ - kPINT_PinIntEnableLowLevel = PINT_PIN_LOW_LEVEL, /*!< Generate Pin Interrupt on low level */ - kPINT_PinIntEnableHighLevel = PINT_PIN_HIGH_LEVEL /*!< Generate Pin Interrupt on high level */ -} pint_pin_enable_t; - -/*! @brief PINT Pin Interrupt type */ -typedef enum _pint_int -{ - kPINT_PinInt0 = 0U, /*!< Pin Interrupt 0 */ -#if defined(FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 1U) - kPINT_PinInt1 = 1U, /*!< Pin Interrupt 1 */ -#endif -#if defined(FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 2U) - kPINT_PinInt2 = 2U, /*!< Pin Interrupt 2 */ -#endif -#if defined(FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 3U) - kPINT_PinInt3 = 3U, /*!< Pin Interrupt 3 */ -#endif -#if defined(FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 4U) - kPINT_PinInt4 = 4U, /*!< Pin Interrupt 4 */ -#endif -#if defined(FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 5U) - kPINT_PinInt5 = 5U, /*!< Pin Interrupt 5 */ -#endif -#if defined(FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 6U) - kPINT_PinInt6 = 6U, /*!< Pin Interrupt 6 */ -#endif -#if defined(FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 7U) - kPINT_PinInt7 = 7U, /*!< Pin Interrupt 7 */ -#endif -#if defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS > 0U) - kPINT_SecPinInt0 = 0U, /*!< Secure Pin Interrupt 0 */ -#endif -#if defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS > 1U) - kPINT_SecPinInt1 = 1U, /*!< Secure Pin Interrupt 1 */ -#endif -} pint_pin_int_t; - -/*! @brief PINT Pattern Match bit slice input source type */ -typedef enum _pint_pmatch_input_src -{ - kPINT_PatternMatchInp0Src = 0U, /*!< Input source 0 */ - kPINT_PatternMatchInp1Src = 1U, /*!< Input source 1 */ - kPINT_PatternMatchInp2Src = 2U, /*!< Input source 2 */ - kPINT_PatternMatchInp3Src = 3U, /*!< Input source 3 */ - kPINT_PatternMatchInp4Src = 4U, /*!< Input source 4 */ - kPINT_PatternMatchInp5Src = 5U, /*!< Input source 5 */ - kPINT_PatternMatchInp6Src = 6U, /*!< Input source 6 */ - kPINT_PatternMatchInp7Src = 7U, /*!< Input source 7 */ - kPINT_SecPatternMatchInp0Src = 0U, /*!< Input source 0 */ - kPINT_SecPatternMatchInp1Src = 1U, /*!< Input source 1 */ -} pint_pmatch_input_src_t; - -/*! @brief PINT Pattern Match bit slice type */ -typedef enum _pint_pmatch_bslice -{ - kPINT_PatternMatchBSlice0 = 0U, /*!< Bit slice 0 */ -#if defined(FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 1U) - kPINT_PatternMatchBSlice1 = 1U, /*!< Bit slice 1 */ -#endif -#if defined(FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 2U) - kPINT_PatternMatchBSlice2 = 2U, /*!< Bit slice 2 */ -#endif -#if defined(FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 3U) - kPINT_PatternMatchBSlice3 = 3U, /*!< Bit slice 3 */ -#endif -#if defined(FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 4U) - kPINT_PatternMatchBSlice4 = 4U, /*!< Bit slice 4 */ -#endif -#if defined(FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 5U) - kPINT_PatternMatchBSlice5 = 5U, /*!< Bit slice 5 */ -#endif -#if defined(FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 6U) - kPINT_PatternMatchBSlice6 = 6U, /*!< Bit slice 6 */ -#endif -#if defined(FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 7U) - kPINT_PatternMatchBSlice7 = 7U, /*!< Bit slice 7 */ -#endif -#if defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS > 0U) - kPINT_SecPatternMatchBSlice0 = 0U, /*!< Bit slice 0 */ -#endif -#if defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && (FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS > 1U) - kPINT_SecPatternMatchBSlice1 = 1U, /*!< Bit slice 1 */ -#endif -} pint_pmatch_bslice_t; - -/*! @brief PINT Pattern Match configuration type */ -typedef enum _pint_pmatch_bslice_cfg -{ - kPINT_PatternMatchAlways = 0U, /*!< Always Contributes to product term match */ - kPINT_PatternMatchStickyRise = 1U, /*!< Sticky Rising edge */ - kPINT_PatternMatchStickyFall = 2U, /*!< Sticky Falling edge */ - kPINT_PatternMatchStickyBothEdges = 3U, /*!< Sticky Rising or Falling edge */ - kPINT_PatternMatchHigh = 4U, /*!< High level */ - kPINT_PatternMatchLow = 5U, /*!< Low level */ - kPINT_PatternMatchNever = 6U, /*!< Never contributes to product term match */ - kPINT_PatternMatchBothEdges = 7U, /*!< Either rising or falling edge */ -} pint_pmatch_bslice_cfg_t; - -/*! @brief PINT Callback function. */ -typedef void (*pint_cb_t)(pint_pin_int_t pintr, uint32_t pmatch_status); - -typedef struct _pint_pmatch_cfg -{ - pint_pmatch_input_src_t bs_src; - pint_pmatch_bslice_cfg_t bs_cfg; - bool end_point; - pint_cb_t callback; -} pint_pmatch_cfg_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @brief Initialize PINT peripheral. - - * This function initializes the PINT peripheral and enables the clock. - * - * @param base Base address of the PINT peripheral. - * - * @retval None. - */ -void PINT_Init(PINT_Type *base); - -/*! - * @brief Configure PINT peripheral pin interrupt. - - * This function configures a given pin interrupt. - * - * @param base Base address of the PINT peripheral. - * @param intr Pin interrupt. - * @param enable Selects detection logic. - * @param callback Callback. - * - * @retval None. - */ -void PINT_PinInterruptConfig(PINT_Type *base, pint_pin_int_t intr, pint_pin_enable_t enable, pint_cb_t callback); - -/*! - * @brief Get PINT peripheral pin interrupt configuration. - - * This function returns the configuration of a given pin interrupt. - * - * @param base Base address of the PINT peripheral. - * @param pintr Pin interrupt. - * @param enable Pointer to store the detection logic. - * @param callback Callback. - * - * @retval None. - */ -void PINT_PinInterruptGetConfig(PINT_Type *base, pint_pin_int_t pintr, pint_pin_enable_t *enable, pint_cb_t *callback); - -/*! - * @brief Clear Selected pin interrupt status only when the pin was triggered by edge-sensitive. - - * This function clears the selected pin interrupt status. - * - * @param base Base address of the PINT peripheral. - * @param pintr Pin interrupt. - * - * @retval None. - */ -void PINT_PinInterruptClrStatus(PINT_Type *base, pint_pin_int_t pintr); - -/*! - * @brief Get Selected pin interrupt status. - - * This function returns the selected pin interrupt status. - * - * @param base Base address of the PINT peripheral. - * @param pintr Pin interrupt. - * - * @retval status = 0 No pin interrupt request. = 1 Selected Pin interrupt request active. - */ -static inline uint32_t PINT_PinInterruptGetStatus(PINT_Type *base, pint_pin_int_t pintr) -{ - return ((base->IST & (1UL << (uint32_t)pintr)) != 0U ? 1U : 0U); -} - -/*! - * @brief Clear all pin interrupts status only when pins were triggered by edge-sensitive. - - * This function clears the status of all pin interrupts. - * - * @param base Base address of the PINT peripheral. - * - * @retval None. - */ -void PINT_PinInterruptClrStatusAll(PINT_Type *base); - -/*! - * @brief Get all pin interrupts status. - - * This function returns the status of all pin interrupts. - * - * @param base Base address of the PINT peripheral. - * - * @retval status Each bit position indicates the status of corresponding pin interrupt. - * = 0 No pin interrupt request. = 1 Pin interrupt request active. - */ -static inline uint32_t PINT_PinInterruptGetStatusAll(PINT_Type *base) -{ - return (base->IST); -} - -/*! - * @brief Clear Selected pin interrupt fall flag. - - * This function clears the selected pin interrupt fall flag. - * - * @param base Base address of the PINT peripheral. - * @param pintr Pin interrupt. - * - * @retval None. - */ -static inline void PINT_PinInterruptClrFallFlag(PINT_Type *base, pint_pin_int_t pintr) -{ - base->FALL = (1UL << (uint32_t)pintr); -} - -/*! - * @brief Get selected pin interrupt fall flag. - - * This function returns the selected pin interrupt fall flag. - * - * @param base Base address of the PINT peripheral. - * @param pintr Pin interrupt. - * - * @retval flag = 0 Falling edge has not been detected. = 1 Falling edge has been detected. - */ -static inline uint32_t PINT_PinInterruptGetFallFlag(PINT_Type *base, pint_pin_int_t pintr) -{ - return ((base->FALL & (1UL << (uint32_t)pintr)) != 0U ? 1U : 0U); -} - -/*! - * @brief Clear all pin interrupt fall flags. - - * This function clears the fall flag for all pin interrupts. - * - * @param base Base address of the PINT peripheral. - * - * @retval None. - */ -static inline void PINT_PinInterruptClrFallFlagAll(PINT_Type *base) -{ - base->FALL = PINT_FALL_FDET_MASK; -} - -/*! - * @brief Get all pin interrupt fall flags. - - * This function returns the fall flag of all pin interrupts. - * - * @param base Base address of the PINT peripheral. - * - * @retval flags Each bit position indicates the falling edge detection of the corresponding pin interrupt. - * 0 Falling edge has not been detected. = 1 Falling edge has been detected. - */ -static inline uint32_t PINT_PinInterruptGetFallFlagAll(PINT_Type *base) -{ - return (base->FALL); -} - -/*! - * @brief Clear Selected pin interrupt rise flag. - - * This function clears the selected pin interrupt rise flag. - * - * @param base Base address of the PINT peripheral. - * @param pintr Pin interrupt. - * - * @retval None. - */ -static inline void PINT_PinInterruptClrRiseFlag(PINT_Type *base, pint_pin_int_t pintr) -{ - base->RISE = (1UL << (uint32_t)pintr); -} - -/*! - * @brief Get selected pin interrupt rise flag. - - * This function returns the selected pin interrupt rise flag. - * - * @param base Base address of the PINT peripheral. - * @param pintr Pin interrupt. - * - * @retval flag = 0 Rising edge has not been detected. = 1 Rising edge has been detected. - */ -static inline uint32_t PINT_PinInterruptGetRiseFlag(PINT_Type *base, pint_pin_int_t pintr) -{ - return ((base->RISE & (1UL << (uint32_t)pintr)) != 0U ? 1U : 0U); -} - -/*! - * @brief Clear all pin interrupt rise flags. - - * This function clears the rise flag for all pin interrupts. - * - * @param base Base address of the PINT peripheral. - * - * @retval None. - */ -static inline void PINT_PinInterruptClrRiseFlagAll(PINT_Type *base) -{ - base->RISE = PINT_RISE_RDET_MASK; -} - -/*! - * @brief Get all pin interrupt rise flags. - - * This function returns the rise flag of all pin interrupts. - * - * @param base Base address of the PINT peripheral. - * - * @retval flags Each bit position indicates the rising edge detection of the corresponding pin interrupt. - * 0 Rising edge has not been detected. = 1 Rising edge has been detected. - */ -static inline uint32_t PINT_PinInterruptGetRiseFlagAll(PINT_Type *base) -{ - return (base->RISE); -} - -/*! - * @brief Configure PINT pattern match. - - * This function configures a given pattern match bit slice. - * - * @param base Base address of the PINT peripheral. - * @param bslice Pattern match bit slice number. - * @param cfg Pointer to bit slice configuration. - * - * @retval None. - */ -void PINT_PatternMatchConfig(PINT_Type *base, pint_pmatch_bslice_t bslice, pint_pmatch_cfg_t *cfg); - -/*! - * @brief Get PINT pattern match configuration. - - * This function returns the configuration of a given pattern match bit slice. - * - * @param base Base address of the PINT peripheral. - * @param bslice Pattern match bit slice number. - * @param cfg Pointer to bit slice configuration. - * - * @retval None. - */ -void PINT_PatternMatchGetConfig(PINT_Type *base, pint_pmatch_bslice_t bslice, pint_pmatch_cfg_t *cfg); - -/*! - * @brief Get pattern match bit slice status. - - * This function returns the status of selected bit slice. - * - * @param base Base address of the PINT peripheral. - * @param bslice Pattern match bit slice number. - * - * @retval status = 0 Match has not been detected. = 1 Match has been detected. - */ -static inline uint32_t PINT_PatternMatchGetStatus(PINT_Type *base, pint_pmatch_bslice_t bslice) -{ - return ((base->PMCTRL >> PINT_PMCTRL_PMAT_SHIFT) & (1UL << (uint32_t)bslice)) >> (uint32_t)bslice; -} - -/*! - * @brief Get status of all pattern match bit slices. - - * This function returns the status of all bit slices. - * - * @param base Base address of the PINT peripheral. - * - * @retval status Each bit position indicates the match status of corresponding bit slice. - * = 0 Match has not been detected. = 1 Match has been detected. - */ -static inline uint32_t PINT_PatternMatchGetStatusAll(PINT_Type *base) -{ - return base->PMCTRL >> PINT_PMCTRL_PMAT_SHIFT; -} - -/*! - * @brief Reset pattern match detection logic. - - * This function resets the pattern match detection logic if any of the product term is matching. - * - * @param base Base address of the PINT peripheral. - * - * @retval pmstatus Each bit position indicates the match status of corresponding bit slice. - * = 0 Match was detected. = 1 Match was not detected. - */ -uint32_t PINT_PatternMatchResetDetectLogic(PINT_Type *base); - -/*! - * @brief Enable pattern match function. - - * This function enables the pattern match function. - * - * @param base Base address of the PINT peripheral. - * - * @retval None. - */ -static inline void PINT_PatternMatchEnable(PINT_Type *base) -{ - base->PMCTRL = (base->PMCTRL & PINT_PMCTRL_ENA_RXEV_MASK) | PINT_PMCTRL_SEL_PMATCH_MASK; -} - -/*! - * @brief Disable pattern match function. - - * This function disables the pattern match function. - * - * @param base Base address of the PINT peripheral. - * - * @retval None. - */ -static inline void PINT_PatternMatchDisable(PINT_Type *base) -{ - base->PMCTRL = (base->PMCTRL & PINT_PMCTRL_ENA_RXEV_MASK) & ~PINT_PMCTRL_SEL_PMATCH_MASK; -} - -/*! - * @brief Enable RXEV output. - - * This function enables the pattern match RXEV output. - * - * @param base Base address of the PINT peripheral. - * - * @retval None. - */ -static inline void PINT_PatternMatchEnableRXEV(PINT_Type *base) -{ - base->PMCTRL = (base->PMCTRL & PINT_PMCTRL_SEL_PMATCH_MASK) | PINT_PMCTRL_ENA_RXEV_MASK; -} - -/*! - * @brief Disable RXEV output. - - * This function disables the pattern match RXEV output. - * - * @param base Base address of the PINT peripheral. - * - * @retval None. - */ -static inline void PINT_PatternMatchDisableRXEV(PINT_Type *base) -{ - base->PMCTRL = (base->PMCTRL & PINT_PMCTRL_SEL_PMATCH_MASK) & ~PINT_PMCTRL_ENA_RXEV_MASK; -} - -/*! - * @brief Enable callback. - - * This function enables the interrupt for the selected PINT peripheral. Although the pin(s) are monitored - * as soon as they are enabled, the callback function is not enabled until this function is called. - * - * @param base Base address of the PINT peripheral. - * - * @retval None. - */ -void PINT_EnableCallback(PINT_Type *base); - -/*! - * @brief Disable callback. - - * This function disables the interrupt for the selected PINT peripheral. Although the pins are still - * being monitored but the callback function is not called. - * - * @param base Base address of the peripheral. - * - * @retval None. - */ -void PINT_DisableCallback(PINT_Type *base); - -/*! - * @brief Deinitialize PINT peripheral. - - * This function disables the PINT clock. - * - * @param base Base address of the PINT peripheral. - * - * @retval None. - */ -void PINT_Deinit(PINT_Type *base); - -/*! - * @brief enable callback by pin index. - - * This function enables callback by pin index instead of enabling all pins. - * - * @param base Base address of the peripheral. - * @param pintIdx pin index. - * - * @retval None. - */ -void PINT_EnableCallbackByIndex(PINT_Type *base, pint_pin_int_t pintIdx); - -/*! - * @brief disable callback by pin index. - - * This function disables callback by pin index instead of disabling all pins. - * - * @param base Base address of the peripheral. - * @param pintIdx pin index. - * - * @retval None. - */ -void PINT_DisableCallbackByIndex(PINT_Type *base, pint_pin_int_t pintIdx); - -#ifdef __cplusplus -} -#endif - -/*! @} */ - -#endif /* FSL_PINT_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_plu.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_plu.c deleted file mode 100644 index b50f472675e..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_plu.c +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright 2018-2019 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_plu.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.plu" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Gets the instance from the base address - * - * @param base PLU peripheral base address - * - * @return The PLU instance - */ -static uint32_t PLU_GetInstance(PLU_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to PLU bases for each instance. */ -static PLU_Type *const s_pluBases[] = PLU_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to PLU clocks for each instance. */ -static const clock_ip_name_t s_pluClocks[] = PLU_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) -/*! @brief Pointers to PLU resets for each instance. */ -static const reset_ip_name_t s_lpuResets[] = PLU_RSTS_N; -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t PLU_GetInstance(PLU_Type *base) -{ - uint32_t instance; - uint32_t pluArrayCount = (sizeof(s_pluBases) / sizeof(s_pluBases[0])); - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < pluArrayCount; instance++) - { - if (s_pluBases[instance] == base) - { - break; - } - } - - assert(instance < pluArrayCount); - - return instance; -} - -/*! - * brief Ungates the PLU clock and reset the module. - * - * note This API should be called at the beginning of the application using the PLU driver. - * - * param base PLU peripheral base address - */ -void PLU_Init(PLU_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the PLU peripheral clock */ - CLOCK_EnableClock(s_pluClocks[PLU_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) - /* Reset the module. */ - RESET_PeripheralReset(s_lpuResets[PLU_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ -} - -/*! - * brief Gate the PLU clock - * - * param base PLU peripheral base address - */ -void PLU_Deinit(PLU_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate the module clock */ - CLOCK_DisableClock((s_pluClocks[PLU_GetInstance(base)])); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -#if defined(FSL_FEATURE_PLU_HAS_WAKEINT_CTRL_REG) && FSL_FEATURE_PLU_HAS_WAKEINT_CTRL_REG -/*! - * @brief Gets an available pre-defined settings for wakeup/interrupt control. - * - * This function initializes the initial configuration structure with an available settings. The default values are: - * @code - * config->filterMode = kPLU_WAKEINT_FILTER_MODE_BYPASS; - * config->clockSource = kPLU_WAKEINT_FILTER_CLK_SRC_1MHZ_LPOSC; - * @endcode - * @param config Pointer to configuration structure. - */ -void PLU_GetDefaultWakeIntConfig(plu_wakeint_config_t *config) -{ - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->filterMode = kPLU_WAKEINT_FILTER_MODE_BYPASS; - config->clockSource = kPLU_WAKEINT_FILTER_CLK_SRC_1MHZ_LPOSC; -} - -/*! - * @brief Enable PLU outputs wakeup/interrupt request. - * - * This function enables Any of the eight selected PLU outputs to contribute to an asynchronous wake-up or an interrupt - * request. - * - * Note: If a PLU_CLKIN is provided, the raw wake-up/interrupt request will be set on the rising-edge of the PLU_CLKIN - * whenever the raw request signal is high. This registered signal will be glitch-free and just use the default wakeint - * config by PLU_GetDefaultWakeIntConfig(). If not, have to specify the filter mode and clock source to eliminate the - * glitches caused by long and widely disparate delays through the network of LUTs making up the PLU. This way may - * increase power consumption in low-power operating modes and inject delay before the wake-up/interrupt request is - * generated. - * - * @param base PLU peripheral base address. - * @param interruptMask PLU interrupt mask (see @ref _plu_interrupt_mask enumeration). - * @param config Pointer to configuration structure (see @ref plu_wakeint_config_t typedef enumeration) - */ -void PLU_EnableWakeIntRequest(PLU_Type *base, uint32_t interruptMask, const plu_wakeint_config_t *config) -{ - uint32_t tmp32 = 0U; - - tmp32 = PLU_WAKEINT_CTRL_FILTER_MODE(config->filterMode) | PLU_WAKEINT_CTRL_FILTER_CLKSEL(config->clockSource) | - PLU_WAKEINT_CTRL_MASK(interruptMask); - - base->WAKEINT_CTRL = tmp32; -} - -/*! - * @brief Clear the latched interrupt - * - * This function clears the wake-up/interrupt request flag latched by PLU_LatchInterrupt() - * - * Note: It is not necessary for the PLU bus clock to be enabled in order to write-to or read-back this bit. - * - * @param base PLU peripheral base address. - */ -void PLU_ClearLatchedInterrupt(PLU_Type *base) -{ - base->WAKEINT_CTRL |= PLU_WAKEINT_CTRL_INTR_CLEAR_MASK; - /* It will take a delay of up to 1.5 PLU_CLKIN clock cycles before this write-to-clear takes effect. */ - while (PLU_WAKEINT_CTRL_INTR_CLEAR_MASK == (base->WAKEINT_CTRL & PLU_WAKEINT_CTRL_INTR_CLEAR_MASK)) - { - } -} -#endif /* FSL_FEATURE_PLU_HAS_WAKEINT_CTRL_REG */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_plu.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_plu.h deleted file mode 100644 index 9335bc6c0cf..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_plu.h +++ /dev/null @@ -1,374 +0,0 @@ -/* - * Copyright 2018-2019 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_PLU_H_ -#define FSL_PLU_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup plu - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -#define FSL_PLU_DRIVER_VERSION (MAKE_VERSION(2, 2, 1)) /*!< Version 2.2.1 */ - /*! @} */ - -/*! @brief Index of LUT */ -typedef enum _plu_lut_index -{ - kPLU_LUT_0 = 0U, /*!< 5-input Look-up Table 0 */ - kPLU_LUT_1 = 1U, /*!< 5-input Look-up Table 1 */ - kPLU_LUT_2 = 2U, /*!< 5-input Look-up Table 2 */ - kPLU_LUT_3 = 3U, /*!< 5-input Look-up Table 3 */ - kPLU_LUT_4 = 4U, /*!< 5-input Look-up Table 4 */ - kPLU_LUT_5 = 5U, /*!< 5-input Look-up Table 5 */ - kPLU_LUT_6 = 6U, /*!< 5-input Look-up Table 6 */ - kPLU_LUT_7 = 7U, /*!< 5-input Look-up Table 7 */ - kPLU_LUT_8 = 8U, /*!< 5-input Look-up Table 8 */ - kPLU_LUT_9 = 9U, /*!< 5-input Look-up Table 9 */ - kPLU_LUT_10 = 10U, /*!< 5-input Look-up Table 10 */ - kPLU_LUT_11 = 11U, /*!< 5-input Look-up Table 11 */ - kPLU_LUT_12 = 12U, /*!< 5-input Look-up Table 12 */ - kPLU_LUT_13 = 13U, /*!< 5-input Look-up Table 13 */ - kPLU_LUT_14 = 14U, /*!< 5-input Look-up Table 14 */ - kPLU_LUT_15 = 15U, /*!< 5-input Look-up Table 15 */ - kPLU_LUT_16 = 16U, /*!< 5-input Look-up Table 16 */ - kPLU_LUT_17 = 17U, /*!< 5-input Look-up Table 17 */ - kPLU_LUT_18 = 18U, /*!< 5-input Look-up Table 18 */ - kPLU_LUT_19 = 19U, /*!< 5-input Look-up Table 19 */ - kPLU_LUT_20 = 20U, /*!< 5-input Look-up Table 20 */ - kPLU_LUT_21 = 21U, /*!< 5-input Look-up Table 21 */ - kPLU_LUT_22 = 22U, /*!< 5-input Look-up Table 22 */ - kPLU_LUT_23 = 23U, /*!< 5-input Look-up Table 23 */ - kPLU_LUT_24 = 24U, /*!< 5-input Look-up Table 24 */ - kPLU_LUT_25 = 25U /*!< 5-input Look-up Table 25 */ -} plu_lut_index_t; - -/*! @brief Inputs of LUT. 5 input present for each LUT. */ -typedef enum _plu_lut_in_index -{ - kPLU_LUT_IN_0 = 0U, /*!< LUT input 0 */ - kPLU_LUT_IN_1 = 1U, /*!< LUT input 1 */ - kPLU_LUT_IN_2 = 2U, /*!< LUT input 2 */ - kPLU_LUT_IN_3 = 3U, /*!< LUT input 3 */ - kPLU_LUT_IN_4 = 4U /*!< LUT input 4 */ -} plu_lut_in_index_t; - -/*! @brief Available sources of LUT input */ -typedef enum _plu_lut_input_source -{ - kPLU_LUT_IN_SRC_PLU_IN_0 = 0U, /*!< Select PLU input 0 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_PLU_IN_1 = 1U, /*!< Select PLU input 1 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_PLU_IN_2 = 2U, /*!< Select PLU input 2 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_PLU_IN_3 = 3U, /*!< Select PLU input 3 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_PLU_IN_4 = 4U, /*!< Select PLU input 4 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_PLU_IN_5 = 5U, /*!< Select PLU input 5 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_LUT_OUT_0 = 6U, /*!< Select LUT output 0 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_LUT_OUT_1 = 7U, /*!< Select LUT output 1 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_LUT_OUT_2 = 8U, /*!< Select LUT output 2 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_LUT_OUT_3 = 9U, /*!< Select LUT output 3 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_LUT_OUT_4 = 10U, /*!< Select LUT output 4 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_LUT_OUT_5 = 11U, /*!< Select LUT output 5 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_LUT_OUT_6 = 12U, /*!< Select LUT output 6 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_LUT_OUT_7 = 13U, /*!< Select LUT output 7 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_LUT_OUT_8 = 14U, /*!< Select LUT output 8 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_LUT_OUT_9 = 15U, /*!< Select LUT output 9 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_LUT_OUT_10 = 16U, /*!< Select LUT output 10 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_LUT_OUT_11 = 17U, /*!< Select LUT output 11 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_LUT_OUT_12 = 18U, /*!< Select LUT output 12 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_LUT_OUT_13 = 19U, /*!< Select LUT output 13 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_LUT_OUT_14 = 20U, /*!< Select LUT output 14 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_LUT_OUT_15 = 21U, /*!< Select LUT output 15 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_LUT_OUT_16 = 22U, /*!< Select LUT output 16 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_LUT_OUT_17 = 23U, /*!< Select LUT output 17 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_LUT_OUT_18 = 24U, /*!< Select LUT output 18 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_LUT_OUT_19 = 25U, /*!< Select LUT output 19 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_LUT_OUT_20 = 26U, /*!< Select LUT output 20 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_LUT_OUT_21 = 27U, /*!< Select LUT output 21 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_LUT_OUT_22 = 28U, /*!< Select LUT output 22 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_LUT_OUT_23 = 29U, /*!< Select LUT output 23 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_LUT_OUT_24 = 30U, /*!< Select LUT output 24 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_LUT_OUT_25 = 31U, /*!< Select LUT output 25 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_FLIPFLOP_0 = 32U, /*!< Select Flip-Flops state 0 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_FLIPFLOP_1 = 33U, /*!< Select Flip-Flops state 1 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_FLIPFLOP_2 = 34U, /*!< Select Flip-Flops state 2 to be connected to LUTn Input x */ - kPLU_LUT_IN_SRC_FLIPFLOP_3 = 35U /*!< Select Flip-Flops state 3 to be connected to LUTn Input x */ -} plu_lut_input_source_t; - -/*! @brief PLU output multiplexer registers */ -typedef enum _plu_output_index -{ - kPLU_OUTPUT_0 = 0U, /*!< PLU OUTPUT 0 */ - kPLU_OUTPUT_1 = 1U, /*!< PLU OUTPUT 1 */ - kPLU_OUTPUT_2 = 2U, /*!< PLU OUTPUT 2 */ - kPLU_OUTPUT_3 = 3U, /*!< PLU OUTPUT 3 */ - kPLU_OUTPUT_4 = 4U, /*!< PLU OUTPUT 4 */ - kPLU_OUTPUT_5 = 5U, /*!< PLU OUTPUT 5 */ - kPLU_OUTPUT_6 = 6U, /*!< PLU OUTPUT 6 */ - kPLU_OUTPUT_7 = 7U /*!< PLU OUTPUT 7 */ -} plu_output_index_t; - -/*! @brief Available sources of PLU output */ -typedef enum _plu_output_source -{ - kPLU_OUT_SRC_LUT_0 = 0U, /*!< Select LUT0 output to be connected to PLU output */ - kPLU_OUT_SRC_LUT_1 = 1U, /*!< Select LUT1 output to be connected to PLU output */ - kPLU_OUT_SRC_LUT_2 = 2U, /*!< Select LUT2 output to be connected to PLU output */ - kPLU_OUT_SRC_LUT_3 = 3U, /*!< Select LUT3 output to be connected to PLU output */ - kPLU_OUT_SRC_LUT_4 = 4U, /*!< Select LUT4 output to be connected to PLU output */ - kPLU_OUT_SRC_LUT_5 = 5U, /*!< Select LUT5 output to be connected to PLU output */ - kPLU_OUT_SRC_LUT_6 = 6U, /*!< Select LUT6 output to be connected to PLU output */ - kPLU_OUT_SRC_LUT_7 = 7U, /*!< Select LUT7 output to be connected to PLU output */ - kPLU_OUT_SRC_LUT_8 = 8U, /*!< Select LUT8 output to be connected to PLU output */ - kPLU_OUT_SRC_LUT_9 = 9U, /*!< Select LUT9 output to be connected to PLU output */ - kPLU_OUT_SRC_LUT_10 = 10U, /*!< Select LUT10 output to be connected to PLU output */ - kPLU_OUT_SRC_LUT_11 = 11U, /*!< Select LUT11 output to be connected to PLU output */ - kPLU_OUT_SRC_LUT_12 = 12U, /*!< Select LUT12 output to be connected to PLU output */ - kPLU_OUT_SRC_LUT_13 = 13U, /*!< Select LUT13 output to be connected to PLU output */ - kPLU_OUT_SRC_LUT_14 = 14U, /*!< Select LUT14 output to be connected to PLU output */ - kPLU_OUT_SRC_LUT_15 = 15U, /*!< Select LUT15 output to be connected to PLU output */ - kPLU_OUT_SRC_LUT_16 = 16U, /*!< Select LUT16 output to be connected to PLU output */ - kPLU_OUT_SRC_LUT_17 = 17U, /*!< Select LUT17 output to be connected to PLU output */ - kPLU_OUT_SRC_LUT_18 = 18U, /*!< Select LUT18 output to be connected to PLU output */ - kPLU_OUT_SRC_LUT_19 = 19U, /*!< Select LUT19 output to be connected to PLU output */ - kPLU_OUT_SRC_LUT_20 = 20U, /*!< Select LUT20 output to be connected to PLU output */ - kPLU_OUT_SRC_LUT_21 = 21U, /*!< Select LUT21 output to be connected to PLU output */ - kPLU_OUT_SRC_LUT_22 = 22U, /*!< Select LUT22 output to be connected to PLU output */ - kPLU_OUT_SRC_LUT_23 = 23U, /*!< Select LUT23 output to be connected to PLU output */ - kPLU_OUT_SRC_LUT_24 = 24U, /*!< Select LUT24 output to be connected to PLU output */ - kPLU_OUT_SRC_LUT_25 = 25U, /*!< Select LUT25 output to be connected to PLU output */ - kPLU_OUT_SRC_FLIPFLOP_0 = 26U, /*!< Select Flip-Flops state(0) to be connected to PLU output */ - kPLU_OUT_SRC_FLIPFLOP_1 = 27U, /*!< Select Flip-Flops state(1) to be connected to PLU output */ - kPLU_OUT_SRC_FLIPFLOP_2 = 28U, /*!< Select Flip-Flops state(2) to be connected to PLU output */ - kPLU_OUT_SRC_FLIPFLOP_3 = 29U /*!< Select Flip-Flops state(3) to be connected to PLU output */ -} plu_output_source_t; - -#if defined(FSL_FEATURE_PLU_HAS_WAKEINT_CTRL_REG) && FSL_FEATURE_PLU_HAS_WAKEINT_CTRL_REG - -/*! @brief The enumerator of PLU Interrupt. */ -enum _plu_interrupt_mask -{ - kPLU_OUTPUT_0_INTERRUPT_MASK = 1 << 0, /*!< Select PLU output 0 contribute to interrupt/wake-up generation */ - kPLU_OUTPUT_1_INTERRUPT_MASK = 1 << 1, /*!< Select PLU output 1 contribute to interrupt/wake-up generation */ - kPLU_OUTPUT_2_INTERRUPT_MASK = 1 << 2, /*!< Select PLU output 2 contribute to interrupt/wake-up generation */ - kPLU_OUTPUT_3_INTERRUPT_MASK = 1 << 3, /*!< Select PLU output 3 contribute to interrupt/wake-up generation */ - kPLU_OUTPUT_4_INTERRUPT_MASK = 1 << 4, /*!< Select PLU output 4 contribute to interrupt/wake-up generation */ - kPLU_OUTPUT_5_INTERRUPT_MASK = 1 << 5, /*!< Select PLU output 5 contribute to interrupt/wake-up generation */ - kPLU_OUTPUT_6_INTERRUPT_MASK = 1 << 6, /*!< Select PLU output 6 contribute to interrupt/wake-up generation */ - kPLU_OUTPUT_7_INTERRUPT_MASK = 1 << 7 /*!< Select PLU output 7 contribute to interrupt/wake-up generation */ -}; - -/*! @brief Control input of the PLU, add filtering for glitch. */ -typedef enum _plu_wakeint_filter_mode -{ - kPLU_WAKEINT_FILTER_MODE_BYPASS = 0U, /*!< Select Bypass mode */ - kPLU_WAKEINT_FILTER_MODE_1_CLK_PERIOD = 1U, /*!< Filter 1 clock period */ - kPLU_WAKEINT_FILTER_MODE_2_CLK_PERIOD = 2U, /*!< Filter 2 clock period */ - kPLU_WAKEINT_FILTER_MODE_3_CLK_PERIOD = 3U /*!< Filter 3 clock period */ -} plu_wakeint_filter_mode_t; - -/*! @brief Clock source for filter mode. */ -typedef enum _plu_wakeint_filter_clock_source -{ - kPLU_WAKEINT_FILTER_CLK_SRC_1MHZ_LPOSC = 0U, /*!< Select the 1MHz low-power oscillator as the filter clock */ - kPLU_WAKEINT_FILTER_CLK_SRC_12MHZ_FRO = 1U, /*!< Select the 12MHz FRO as the filer clock */ - kPLU_WAKEINT_FILTER_CLK_SRC_ALT = 2U /*!< Select a third clock source */ -} plu_wakeint_filter_clock_source_t; - -/*! @brief Wake configuration. */ -typedef struct _plu_wakeint_config -{ - plu_wakeint_filter_mode_t filterMode; /*!< Filter Mode. */ - plu_wakeint_filter_clock_source_t clockSource; /*!< The clock source for filter mode. */ -} plu_wakeint_config_t; -#endif /* FSL_FEATURE_PLU_HAS_WAKEINT_CTRL_REG */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Enable the PLU clock and reset the module. - * - * @note This API should be called at the beginning of the application using the PLU driver. - * - * @param base PLU peripheral base address - */ -void PLU_Init(PLU_Type *base); - -/*! - * @brief Gate the PLU clock - * - * @param base PLU peripheral base address - */ -void PLU_Deinit(PLU_Type *base); - -/*! @}*/ - -/*! - * @name Set input/output source and Truth Table - * @{ - */ - -/*! - * @brief Set Input source of LUT. - * - * Note: An external clock must be applied to the PLU_CLKIN input when using FFs. - * For each LUT, the slot associated with the output from LUTn itself is tied low. - * - * @param base PLU peripheral base address. - * @param lutIndex LUT index (see @ref plu_lut_index_t typedef enumeration). - * @param lutInIndex LUT input index (see @ref plu_lut_in_index_t typedef enumeration). - * @param inputSrc LUT input source (see @ref plu_lut_input_source_t typedef enumeration). - */ -static inline void PLU_SetLutInputSource(PLU_Type *base, - plu_lut_index_t lutIndex, - plu_lut_in_index_t lutInIndex, - plu_lut_input_source_t inputSrc) -{ - PLU->LUT[lutIndex].INP_MUX[lutInIndex] = (uint32_t)inputSrc; -} - -/*! - * @brief Set Output source of PLU. - * - * Note: An external clock must be applied to the PLU_CLKIN input when using FFs. - * - * @param base PLU peripheral base address. - * @param outputIndex PLU output index (see @ref plu_output_index_t typedef enumeration). - * @param outputSrc PLU output source (see @ref plu_output_source_t typedef enumeration). - */ -static inline void PLU_SetOutputSource(PLU_Type *base, plu_output_index_t outputIndex, plu_output_source_t outputSrc) -{ - base->OUTPUT_MUX[outputIndex] = (uint32_t)outputSrc; -} - -/*! - * @brief Set Truth Table of LUT. - * - * @param base PLU peripheral base address. - * @param lutIndex LUT index (see @ref plu_lut_index_t typedef enumeration). - * @param truthTable Truth Table value. - */ -static inline void PLU_SetLutTruthTable(PLU_Type *base, plu_lut_index_t lutIndex, uint32_t truthTable) -{ - base->LUT_TRUTH[lutIndex] = truthTable; -} - -/*! @}*/ - -/*! - * @name Read current Output State - * @{ - */ - -/*! - * @brief Read the current state of the 8 designated PLU Outputs. - * - * Note: The PLU bus clock must be re-enabled prior to reading the Outpus Register if PLU bus clock is - * shut-off. - * - * @param base PLU peripheral base address. - * @return Current PLU output state value. - */ -static inline uint32_t PLU_ReadOutputState(PLU_Type *base) -{ - return (base->OUTPUTS & PLU_OUTPUTS_OUTPUT_STATE_MASK); -} - -/*! @}*/ - -#if defined(FSL_FEATURE_PLU_HAS_WAKEINT_CTRL_REG) && FSL_FEATURE_PLU_HAS_WAKEINT_CTRL_REG -/*! - * @name Wake-up/Interrupt Control - * @{ - */ - -/*! - * @brief Gets an available pre-defined settings for wakeup/interrupt control. - * - * This function initializes the initial configuration structure with an available settings. The default values are: - * @code - * config->filterMode = kPLU_WAKEINT_FILTER_MODE_BYPASS; - * config->clockSource = kPLU_WAKEINT_FILTER_CLK_SRC_1MHZ_LPOSC; - * @endcode - * @param config Pointer to configuration structure. - */ -void PLU_GetDefaultWakeIntConfig(plu_wakeint_config_t *config); - -/*! - * @brief Enable PLU outputs wakeup/interrupt request. - * - * This function enables Any of the eight selected PLU outputs to contribute to an asynchronous wake-up or an interrupt - * request. - * - * Note: If a PLU_CLKIN is provided, the raw wake-up/interrupt request will be set on the rising-edge of the PLU_CLKIN - * whenever the raw request signal is high. This registered signal will be glitch-free and just use the default wakeint - * config by PLU_GetDefaultWakeIntConfig(). If not, have to specify the filter mode and clock source to eliminate the - * glitches caused by long and widely disparate delays through the network of LUTs making up the PLU. This way may - * increase power consumption in low-power operating modes and inject delay before the wake-up/interrupt request is - * generated. - * - * @param base PLU peripheral base address. - * @param interruptMask PLU interrupt mask (see @ref _plu_interrupt_mask enumeration). - * @param config Pointer to configuration structure (see @ref plu_wakeint_config_t typedef enumeration) - */ -void PLU_EnableWakeIntRequest(PLU_Type *base, uint32_t interruptMask, const plu_wakeint_config_t *config); - -/*! - * @brief Latch an interrupt - * - * This function latches the interrupt and then it can be cleared with PLU_ClearLatchedInterrupt(). - * - * Note: This mode is not compatible with use of the glitch filter. If this bit is set, the FILTER MODE should be set - * to kPLU_WAKEINT_FILTER_MODE_BYPASS (Bypass Mode) and PLU_CLKIN should be provided. If this bit is set, the - * wake-up/interrupt request will be set on the rising-edge of PLU_CLKIN whenever the raw wake-up/interrupt signal is - * high. The request must be cleared by software. - * - * @param base PLU peripheral base address. - */ -static inline void PLU_LatchInterrupt(PLU_Type *base) -{ - base->WAKEINT_CTRL |= PLU_WAKEINT_CTRL_LATCH_ENABLE_MASK; -} - -/*! - * @brief Clear the latched interrupt - * - * This function clears the wake-up/interrupt request flag latched by PLU_LatchInterrupt() - * - * Note: It is not necessary for the PLU bus clock to be enabled in order to write-to or read-back this bit. - * - * @param base PLU peripheral base address. - */ -void PLU_ClearLatchedInterrupt(PLU_Type *base); - -/*! @}*/ -#endif /* FSL_FEATURE_PLU_HAS_WAKEINT_CTRL_REG */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_PLU_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_port.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_port.h deleted file mode 100644 index 8eb512969d8..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_port.h +++ /dev/null @@ -1,684 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022, 2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_PORT_H_ -#define FSL_PORT_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup port - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.port" -#endif - -/*! @name Driver version */ -/*! @{ */ -/*! @brief PORT driver version. */ -#define FSL_PORT_DRIVER_VERSION (MAKE_VERSION(2, 5, 0)) -/*! @} */ - -#if defined(FSL_FEATURE_PORT_HAS_PULL_ENABLE) && FSL_FEATURE_PORT_HAS_PULL_ENABLE -/*! @brief Internal resistor pull feature selection */ -enum _port_pull -{ - kPORT_PullDisable = 0U, /*!< Internal pull-up/down resistor is disabled. */ - kPORT_PullDown = 2U, /*!< Internal pull-down resistor is enabled. */ - kPORT_PullUp = 3U, /*!< Internal pull-up resistor is enabled. */ -}; -#endif /* FSL_FEATURE_PORT_HAS_PULL_ENABLE */ - -#if defined(FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE) && FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE -/*! @brief Internal resistor pull value selection */ -enum _port_pull_value -{ - kPORT_LowPullResistor = 0U, /*!< Low internal pull resistor value is selected. */ - kPORT_HighPullResistor = 1U, /*!< High internal pull resistor value is selected. */ -}; -#endif /* FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE */ - -#if defined(FSL_FEATURE_PORT_HAS_SLEW_RATE) && FSL_FEATURE_PORT_HAS_SLEW_RATE -/*! @brief Slew rate selection */ -enum _port_slew_rate -{ - kPORT_FastSlewRate = 0U, /*!< Fast slew rate is configured. */ - kPORT_SlowSlewRate = 1U, /*!< Slow slew rate is configured. */ -}; -#endif /* FSL_FEATURE_PORT_HAS_SLEW_RATE */ - -#if defined(FSL_FEATURE_PORT_HAS_OPEN_DRAIN) && FSL_FEATURE_PORT_HAS_OPEN_DRAIN -/*! @brief Open Drain feature enable/disable */ -enum _port_open_drain_enable -{ - kPORT_OpenDrainDisable = 0U, /*!< Open drain output is disabled. */ - kPORT_OpenDrainEnable = 1U, /*!< Open drain output is enabled. */ -}; -#endif /* FSL_FEATURE_PORT_HAS_OPEN_DRAIN */ - -#if defined(FSL_FEATURE_PORT_HAS_PASSIVE_FILTER) && FSL_FEATURE_PORT_HAS_PASSIVE_FILTER -/*! @brief Passive filter feature enable/disable */ -enum _port_passive_filter_enable -{ - kPORT_PassiveFilterDisable = 0U, /*!< Passive input filter is disabled. */ - kPORT_PassiveFilterEnable = 1U, /*!< Passive input filter is enabled. */ -}; -#endif - -#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH -/*! @brief Configures the drive strength. */ -enum _port_drive_strength -{ - kPORT_LowDriveStrength = 0U, /*!< Low-drive strength is configured. */ - kPORT_HighDriveStrength = 1U, /*!< High-drive strength is configured. */ -}; -#endif /* FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH */ - -#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1 -/*! @brief Configures the drive strength1. */ -enum _port_drive_strength1 -{ - kPORT_NormalDriveStrength = 0U, /*!< Normal drive strength */ - kPORT_DoubleDriveStrength = 1U, /*!< Double drive strength */ -}; -#endif /* FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1 */ - -#if defined(FSL_FEATURE_PORT_HAS_INPUT_BUFFER) && FSL_FEATURE_PORT_HAS_INPUT_BUFFER -/*! @brief input buffer disable/enable. */ -enum _port_input_buffer -{ - kPORT_InputBufferDisable = 0U, /*!< Digital input is disabled */ - kPORT_InputBufferEnable = 1U, /*!< Digital input is enabled */ -}; -#endif /* FSL_FEATURE_PORT_HAS_INPUT_BUFFER */ - -#if defined(FSL_FEATURE_PORT_HAS_INVERT_INPUT) && FSL_FEATURE_PORT_HAS_INVERT_INPUT -/*! @brief Digital input is not inverted or it is inverted. */ -enum _port_invet_input -{ - kPORT_InputNormal = 0U, /*!< Digital input is not inverted */ - kPORT_InputInvert = 1U, /*!< Digital input is inverted */ -}; -#endif /* FSL_FEATURE_PORT_HAS_INVERT_INPUT */ - -#if defined(FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK) && FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK -/*! @brief Unlock/lock the pin control register field[15:0] */ -enum _port_lock_register -{ - kPORT_UnlockRegister = 0U, /*!< Pin Control Register fields [15:0] are not locked. */ - kPORT_LockRegister = 1U, /*!< Pin Control Register fields [15:0] are locked. */ -}; -#endif /* FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK */ - -#if defined(FSL_FEATURE_PORT_PCR_MUX_WIDTH) && FSL_FEATURE_PORT_PCR_MUX_WIDTH -/*! @brief Pin mux selection */ -typedef enum _port_mux -{ -#if defined(FSL_FEATURE_PORT_PCR_MUX_GPIO) && (FSL_FEATURE_PORT_PCR_MUX_GPIO == 0) - kPORT_MuxAsGpio = 0U, /*!< Corresponding pin is configured as GPIO. */ -#else - kPORT_PinDisabledOrAnalog = 0U, /*!< Corresponding pin is disabled, but is used as an analog pin. */ - kPORT_MuxAsGpio = 1U, /*!< Corresponding pin is configured as GPIO. */ -#endif - kPORT_MuxAlt0 = 0U, /*!< Chip-specific */ - kPORT_MuxAlt1 = 1U, /*!< Chip-specific */ - kPORT_MuxAlt2 = 2U, /*!< Chip-specific */ - kPORT_MuxAlt3 = 3U, /*!< Chip-specific */ - kPORT_MuxAlt4 = 4U, /*!< Chip-specific */ - kPORT_MuxAlt5 = 5U, /*!< Chip-specific */ - kPORT_MuxAlt6 = 6U, /*!< Chip-specific */ - kPORT_MuxAlt7 = 7U, /*!< Chip-specific */ - kPORT_MuxAlt8 = 8U, /*!< Chip-specific */ - kPORT_MuxAlt9 = 9U, /*!< Chip-specific */ - kPORT_MuxAlt10 = 10U, /*!< Chip-specific */ - kPORT_MuxAlt11 = 11U, /*!< Chip-specific */ - kPORT_MuxAlt12 = 12U, /*!< Chip-specific */ - kPORT_MuxAlt13 = 13U, /*!< Chip-specific */ - kPORT_MuxAlt14 = 14U, /*!< Chip-specific */ - kPORT_MuxAlt15 = 15U, /*!< Chip-specific */ -} port_mux_t; -#endif /* FSL_FEATURE_PORT_PCR_MUX_WIDTH */ - -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) -/*! @brief Configures the interrupt generation condition. */ -typedef enum _port_interrupt -{ - kPORT_InterruptOrDMADisabled = 0x0U, /*!< Interrupt/DMA request is disabled. */ -#if defined(FSL_FEATURE_PORT_HAS_DMA_REQUEST) && FSL_FEATURE_PORT_HAS_DMA_REQUEST || defined(DOXYGEN_OUTPUT) - kPORT_DMARisingEdge = 0x1U, /*!< DMA request on rising edge. */ - kPORT_DMAFallingEdge = 0x2U, /*!< DMA request on falling edge. */ - kPORT_DMAEitherEdge = 0x3U, /*!< DMA request on either edge. */ -#endif -#if defined(FSL_FEATURE_PORT_HAS_IRQC_FLAG) && FSL_FEATURE_PORT_HAS_IRQC_FLAG || defined(DOXYGEN_OUTPUT) - kPORT_FlagRisingEdge = 0x05U, /*!< Flag sets on rising edge. */ - kPORT_FlagFallingEdge = 0x06U, /*!< Flag sets on falling edge. */ - kPORT_FlagEitherEdge = 0x07U, /*!< Flag sets on either edge. */ -#endif - kPORT_InterruptLogicZero = 0x8U, /*!< Interrupt when logic zero. */ - kPORT_InterruptRisingEdge = 0x9U, /*!< Interrupt on rising edge. */ - kPORT_InterruptFallingEdge = 0xAU, /*!< Interrupt on falling edge. */ - kPORT_InterruptEitherEdge = 0xBU, /*!< Interrupt on either edge. */ - kPORT_InterruptLogicOne = 0xCU, /*!< Interrupt when logic one. */ -#if defined(FSL_FEATURE_PORT_HAS_IRQC_TRIGGER) && FSL_FEATURE_PORT_HAS_IRQC_TRIGGER || defined(DOXYGEN_OUTPUT) - kPORT_ActiveHighTriggerOutputEnable = 0xDU, /*!< Enable active high-trigger output. */ - kPORT_ActiveLowTriggerOutputEnable = 0xEU, /*!< Enable active low-trigger output. */ -#endif -} port_interrupt_t; -#endif - -#if defined(FSL_FEATURE_PORT_HAS_DIGITAL_FILTER) && FSL_FEATURE_PORT_HAS_DIGITAL_FILTER -/*! @brief Digital filter clock source selection */ -typedef enum _port_digital_filter_clock_source -{ - kPORT_BusClock = 0U, /*!< Digital filters are clocked by the bus clock. */ - kPORT_LpoClock = 1U, /*!< Digital filters are clocked by the 1 kHz LPO clock. */ -} port_digital_filter_clock_source_t; - -/*! @brief PORT digital filter feature configuration definition */ -typedef struct _port_digital_filter_config -{ - uint32_t digitalFilterWidth; /*!< Set digital filter width */ - port_digital_filter_clock_source_t clockSource; /*!< Set digital filter clockSource */ -} port_digital_filter_config_t; -#endif /* FSL_FEATURE_PORT_HAS_DIGITAL_FILTER */ - -#if defined(FSL_FEATURE_PORT_PCR_MUX_WIDTH) && FSL_FEATURE_PORT_PCR_MUX_WIDTH -/*! @brief PORT pin configuration structure */ -typedef struct _port_pin_config -{ -#if defined(FSL_FEATURE_PORT_HAS_PULL_ENABLE) && FSL_FEATURE_PORT_HAS_PULL_ENABLE - uint16_t pullSelect : 2; /*!< No-pull/pull-down/pull-up select */ -#else - uint16_t : 2; -#endif /* FSL_FEATURE_PORT_HAS_PULL_ENABLE */ - -#if defined(FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE) && FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE - uint16_t pullValueSelect : 1; /*!< Pull value select */ -#endif /* FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE */ - -#if defined(FSL_FEATURE_PORT_HAS_SLEW_RATE) && FSL_FEATURE_PORT_HAS_SLEW_RATE - uint16_t slewRate : 1; /*!< Fast/slow slew rate Configure */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_SLEW_RATE */ - -#if !(defined(FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE) && FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE) - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE */ - -#if defined(FSL_FEATURE_PORT_HAS_PASSIVE_FILTER) && FSL_FEATURE_PORT_HAS_PASSIVE_FILTER - uint16_t passiveFilterEnable : 1; /*!< Passive filter enable/disable */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_PASSIVE_FILTER */ - -#if defined(FSL_FEATURE_PORT_HAS_OPEN_DRAIN) && FSL_FEATURE_PORT_HAS_OPEN_DRAIN - uint16_t openDrainEnable : 1; /*!< Open drain enable/disable */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_OPEN_DRAIN */ - -#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH - uint16_t driveStrength : 1; /*!< Fast/slow drive strength configure */ -#else - uint16_t : 1; -#endif - -#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1 - uint16_t driveStrength1 : 1; /*!< Normal/Double drive strength enable/disable */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1 */ - -#if defined(FSL_FEATURE_PORT_PCR_MUX_WIDTH) && (FSL_FEATURE_PORT_PCR_MUX_WIDTH == 3) - uint16_t mux : 3; /*!< Pin mux Configure */ - uint16_t : 1; -#elif defined(FSL_FEATURE_PORT_PCR_MUX_WIDTH) && (FSL_FEATURE_PORT_PCR_MUX_WIDTH == 4) - uint16_t mux : 4; /*!< Pin mux Configure */ -#else - uint16_t : 4; -#endif - -#if defined(FSL_FEATURE_PORT_HAS_INPUT_BUFFER) && FSL_FEATURE_PORT_HAS_INPUT_BUFFER - uint16_t inputBuffer : 1; /*!< Input Buffer Configure */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_INPUT_BUFFER */ - -#if defined(FSL_FEATURE_PORT_HAS_INVERT_INPUT) && FSL_FEATURE_PORT_HAS_INVERT_INPUT - uint16_t invertInput : 1; /*!< Invert Input Configure */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_INVERT_INPUT */ - - uint16_t : 1; - -#if defined(FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK) && FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK - uint16_t lockRegister : 1; /*!< Lock/unlock the PCR field[15:0] */ -#else - uint16_t : 1; -#endif /* FSL_FEATURE_PORT_HAS_PIN_CONTROL_LOCK */ -} port_pin_config_t; -#endif /* FSL_FEATURE_PORT_PCR_MUX_WIDTH */ - -#if defined(FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER) && FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER -/*! @brief PORT version information. */ -typedef struct _port_version_info -{ - uint16_t feature; /*!< Feature Specification Number. */ - uint8_t minor; /*!< Minor Version Number. */ - uint8_t major; /*!< Major Version Number. */ -} port_version_info_t; -#endif /* FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER */ - -#if defined(FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE) && FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE -/*! @brief PORT voltage range. */ -typedef enum _port_voltage_range -{ - kPORT_VoltageRange1Dot71V_3Dot6V = 0x0U, /*!< Port voltage range is 1.71 V - 3.6 V. */ - kPORT_VoltageRange2Dot70V_3Dot6V = 0x1U, /*!< Port voltage range is 2.70 V - 3.6 V. */ -} port_voltage_range_t; -#endif /* FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! @name Configuration */ -/*! @{ */ - -#if defined(FSL_FEATURE_PORT_PCR_MUX_WIDTH) && FSL_FEATURE_PORT_PCR_MUX_WIDTH - -#if defined(FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER) && FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER -/*! - * @brief Get PORT version information. - * - * @param base PORT peripheral base pointer - * @param info PORT version information - */ -static inline void PORT_GetVersionInfo(PORT_Type *base, port_version_info_t *info) -{ - uint32_t verid = base->VERID; - info->feature = (uint16_t)verid; - info->minor = (uint8_t)(verid >> PORT_VERID_MINOR_SHIFT); - info->major = (uint8_t)(verid >> PORT_VERID_MAJOR_SHIFT); -} -#endif /* FSL_FEATURE_PORT_HAS_VERSION_INFO_REGISTER */ - -#if defined(FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE) && FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE -/*! - * @brief Get PORT version information. - * - * @note : PORTA_CONFIG[RANGE] controls the voltage ranges of Port A, B, and C. Read or write PORTB_CONFIG[RANGE] and - * PORTC_CONFIG[RANGE] does not take effect. - * - * @param base PORT peripheral base pointer - * @param range port voltage range - */ -static inline void PORT_SecletPortVoltageRange(PORT_Type *base, port_voltage_range_t range) -{ - base->CONFIG = (uint32_t)range; -} -#endif /* FSL_FEATURE_PORT_SUPPORT_DIFFERENT_VOLTAGE_RANGE */ - -/*! - * @brief Sets the port PCR register. - * - * This is an example to define an input pin or output pin PCR configuration. - * @code - * // Define a digital input pin PCR configuration - * port_pin_config_t config = { - * kPORT_PullUp, - * kPORT_FastSlewRate, - * kPORT_PassiveFilterDisable, - * kPORT_OpenDrainDisable, - * kPORT_LowDriveStrength, - * kPORT_MuxAsGpio, - * kPORT_UnLockRegister, - * }; - * @endcode - * - * @param base PORT peripheral base pointer. - * @param pin PORT pin number. - * @param config PORT PCR register configuration structure. - */ -static inline void PORT_SetPinConfig(PORT_Type *base, uint32_t pin, const port_pin_config_t *config) -{ - assert(config); - uint32_t addr = (uint32_t)&base->PCR[pin]; - *(volatile uint16_t *)(addr) = *((const uint16_t *)(const void *)config); -} - -/*! - * @brief Sets the port PCR register for multiple pins. - * - * This is an example to define input pins or output pins PCR configuration. - * @code - * Define a digital input pin PCR configuration - * port_pin_config_t config = { - * kPORT_PullUp , - * kPORT_PullEnable, - * kPORT_FastSlewRate, - * kPORT_PassiveFilterDisable, - * kPORT_OpenDrainDisable, - * kPORT_LowDriveStrength, - * kPORT_MuxAsGpio, - * kPORT_UnlockRegister, - * }; - * @endcode - * - * @param base PORT peripheral base pointer. - * @param mask PORT pin number macro. - * @param config PORT PCR register configuration structure. - */ -static inline void PORT_SetMultiplePinsConfig(PORT_Type *base, uint32_t mask, const port_pin_config_t *config) -{ - assert(config); - - uint16_t pcrl = *((const uint16_t *)(const void *)config); - - if (0U != (mask & 0xffffU)) - { - base->GPCLR = ((mask & 0xffffU) << 16) | pcrl; - } - if (0U != (mask >> 16)) - { - base->GPCHR = (mask & 0xffff0000U) | pcrl; - } -} - -#if defined(FSL_FEATURE_PORT_HAS_MULTIPLE_IRQ_CONFIG) && FSL_FEATURE_PORT_HAS_MULTIPLE_IRQ_CONFIG -/*! - * @brief Sets the port interrupt configuration in PCR register for multiple pins. - * - * @param base PORT peripheral base pointer. - * @param mask PORT pin number macro. - * @param config PORT pin interrupt configuration. - * - #kPORT_InterruptOrDMADisabled: Interrupt/DMA request disabled. - * - #kPORT_DMARisingEdge : DMA request on rising edge(if the DMA requests exit). - * - #kPORT_DMAFallingEdge: DMA request on falling edge(if the DMA requests exit). - * - #kPORT_DMAEitherEdge : DMA request on either edge(if the DMA requests exit). - * - #kPORT_FlagRisingEdge : Flag sets on rising edge(if the Flag states exit). - * - #kPORT_FlagFallingEdge : Flag sets on falling edge(if the Flag states exit). - * - #kPORT_FlagEitherEdge : Flag sets on either edge(if the Flag states exit). - * - #kPORT_InterruptLogicZero : Interrupt when logic zero. - * - #kPORT_InterruptRisingEdge : Interrupt on rising edge. - * - #kPORT_InterruptFallingEdge: Interrupt on falling edge. - * - #kPORT_InterruptEitherEdge : Interrupt on either edge. - * - #kPORT_InterruptLogicOne : Interrupt when logic one. - * - #kPORT_ActiveHighTriggerOutputEnable : Enable active high-trigger output (if the trigger states exit). - * - #kPORT_ActiveLowTriggerOutputEnable : Enable active low-trigger output (if the trigger states exit).. - */ -static inline void PORT_SetMultipleInterruptPinsConfig(PORT_Type *base, uint32_t mask, port_interrupt_t config) -{ - assert(config); - - if (0U != ((uint32_t)mask & 0xffffU)) - { - base->GICLR = ((uint32_t)config << 16U) | ((uint32_t)mask & 0xffffU); - } - mask = mask >> 16; - if (0U != mask) - { - base->GICHR = ((uint32_t)config << 16U) | ((uint32_t)mask & 0xffffU); - } -} -#endif - -/*! - * @brief Configures the pin muxing. - * - * @param base PORT peripheral base pointer. - * @param pin PORT pin number. - * @param mux pin muxing slot selection. - * - #kPORT_PinDisabledOrAnalog: Pin disabled or work in analog function. - * - #kPORT_MuxAsGpio : Set as GPIO. - * - #kPORT_MuxAlt2 : chip-specific. - * - #kPORT_MuxAlt3 : chip-specific. - * - #kPORT_MuxAlt4 : chip-specific. - * - #kPORT_MuxAlt5 : chip-specific. - * - #kPORT_MuxAlt6 : chip-specific. - * - #kPORT_MuxAlt7 : chip-specific. - * @note : This function is NOT recommended to use together with the PORT_SetPinsConfig, because - * the PORT_SetPinsConfig need to configure the pin mux anyway (Otherwise the pin mux is - * reset to zero : kPORT_PinDisabledOrAnalog). - * This function is recommended to use to reset the pin mux - * - */ -static inline void PORT_SetPinMux(PORT_Type *base, uint32_t pin, port_mux_t mux) -{ - base->PCR[pin] = (base->PCR[pin] & ~PORT_PCR_MUX_MASK) | PORT_PCR_MUX(mux); -} -#endif /* FSL_FEATURE_PORT_PCR_MUX_WIDTH */ - -#if defined(FSL_FEATURE_PORT_HAS_DIGITAL_FILTER) && FSL_FEATURE_PORT_HAS_DIGITAL_FILTER - -/*! - * @brief Enables the digital filter in one port, each bit of the 32-bit register represents one pin. - * - * @param base PORT peripheral base pointer. - * @param mask PORT pin number macro. - * @param enable PORT digital filter configuration. - */ -static inline void PORT_EnablePinsDigitalFilter(PORT_Type *base, uint32_t mask, bool enable) -{ - if (enable == true) - { - base->DFER |= mask; - } - else - { - base->DFER &= ~mask; - } -} - -/*! - * @brief Sets the digital filter in one port, each bit of the 32-bit register represents one pin. - * - * @param base PORT peripheral base pointer. - * @param config PORT digital filter configuration structure. - */ -static inline void PORT_SetDigitalFilterConfig(PORT_Type *base, const port_digital_filter_config_t *config) -{ - assert(config); - - base->DFCR = PORT_DFCR_CS(config->clockSource); - base->DFWR = PORT_DFWR_FILT(config->digitalFilterWidth); -} - -#endif /* FSL_FEATURE_PORT_HAS_DIGITAL_FILTER */ -/*! @} */ - -/*! @name Interrupt */ -/*! @{ */ - -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) -/*! - * @brief Configures the port pin interrupt/DMA request. - * - * @param base PORT peripheral base pointer. - * @param pin PORT pin number. - * @param config PORT pin interrupt configuration. - * - #kPORT_InterruptOrDMADisabled: Interrupt/DMA request disabled. - * - #kPORT_DMARisingEdge : DMA request on rising edge(if the DMA requests exit). - * - #kPORT_DMAFallingEdge: DMA request on falling edge(if the DMA requests exit). - * - #kPORT_DMAEitherEdge : DMA request on either edge(if the DMA requests exit). - * - #kPORT_FlagRisingEdge : Flag sets on rising edge(if the Flag states exit). - * - #kPORT_FlagFallingEdge : Flag sets on falling edge(if the Flag states exit). - * - #kPORT_FlagEitherEdge : Flag sets on either edge(if the Flag states exit). - * - #kPORT_InterruptLogicZero : Interrupt when logic zero. - * - #kPORT_InterruptRisingEdge : Interrupt on rising edge. - * - #kPORT_InterruptFallingEdge: Interrupt on falling edge. - * - #kPORT_InterruptEitherEdge : Interrupt on either edge. - * - #kPORT_InterruptLogicOne : Interrupt when logic one. - * - #kPORT_ActiveHighTriggerOutputEnable : Enable active high-trigger output (if the trigger states exit). - * - #kPORT_ActiveLowTriggerOutputEnable : Enable active low-trigger output (if the trigger states exit). - */ -static inline void PORT_SetPinInterruptConfig(PORT_Type *base, uint32_t pin, port_interrupt_t config) -{ - base->PCR[pin] = (base->PCR[pin] & ~PORT_PCR_IRQC_MASK) | PORT_PCR_IRQC(config); -} -#endif - -#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH -/*! - * @brief Configures the port pin drive strength. - * - * @param base PORT peripheral base pointer. - * @param pin PORT pin number. - * @param strength PORT pin drive strength - * - #kPORT_LowDriveStrength = 0U - Low-drive strength is configured. - * - #kPORT_HighDriveStrength = 1U - High-drive strength is configured. - */ -static inline void PORT_SetPinDriveStrength(PORT_Type *base, uint32_t pin, uint8_t strength) -{ - base->PCR[pin] = (base->PCR[pin] & ~PORT_PCR_DSE_MASK) | PORT_PCR_DSE(strength); -} -#endif - -#if defined(FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1) && FSL_FEATURE_PORT_HAS_DRIVE_STRENGTH1 -/*! - * @brief Enables the port pin double drive strength. - * - * @param base PORT peripheral base pointer. - * @param pin PORT pin number. - * @param enable PORT pin drive strength configuration. - */ -static inline void PORT_EnablePinDoubleDriveStrength(PORT_Type *base, uint32_t pin, bool enable) -{ - base->PCR[pin] = (base->PCR[pin] & ~PORT_PCR_DSE1_MASK) | PORT_PCR_DSE1(enable); -} -#endif - -#if defined(FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE) && FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE -/*! - * @brief Configures the port pin pull value. - * - * @param base PORT peripheral base pointer. - * @param pin PORT pin number. - * @param value PORT pin pull value - * - #kPORT_LowPullResistor = 0U - Low internal pull resistor value is selected. - * - #kPORT_HighPullResistor = 1U - High internal pull resistor value is selected. - */ -static inline void PORT_SetPinPullValue(PORT_Type *base, uint32_t pin, uint8_t value) -{ - base->PCR[pin] = (base->PCR[pin] & ~PORT_PCR_PV_MASK) | PORT_PCR_PV(value); -} -#endif /* FSL_FEATURE_PORT_PCR_HAS_PULL_VALUE */ - -#if !(defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT) -/*! - * @brief Reads the whole port status flag. - * - * If a pin is configured to generate the DMA request, the corresponding flag - * is cleared automatically at the completion of the requested DMA transfer. - * Otherwise, the flag remains set until a logic one is written to that flag. - * If configured for a level sensitive interrupt that remains asserted, the flag - * is set again immediately. - * - * @param base PORT peripheral base pointer. - * @return Current port interrupt status flags, for example, 0x00010001 means the - * pin 0 and 16 have the interrupt. - */ -static inline uint32_t PORT_GetPinsInterruptFlags(PORT_Type *base) -{ - return base->ISFR; -} - -/*! - * @brief Clears the multiple pin interrupt status flag. - * - * @param base PORT peripheral base pointer. - * @param mask PORT pin number macro. - */ -static inline void PORT_ClearPinsInterruptFlags(PORT_Type *base, uint32_t mask) -{ - base->ISFR = mask; -} -#endif - -#if defined(FSL_FEATURE_PORT_SUPPORT_EFT) && FSL_FEATURE_PORT_SUPPORT_EFT -/*! - * @brief Get EFT detect flags. - * - * @param base PORT peripheral base pointer - * @return EFT detect flags - */ -static inline uint32_t PORT_GetEFTDetectFlags(PORT_Type *base) -{ - return base->EDFR; -} - -/*! - * @brief Enable EFT detect interrupts. - * - * @param base PORT peripheral base pointer - * @param interrupt EFT detect interrupt - */ -static inline void PORT_EnableEFTDetectInterrupts(PORT_Type *base, uint32_t interrupt) -{ - base->EDIER |= interrupt; -} - -/*! - * @brief Disable EFT detect interrupts. - * - * @param base PORT peripheral base pointer - * @param interrupt EFT detect interrupt - */ -static inline void PORT_DisableEFTDetectInterrupts(PORT_Type *base, uint32_t interrupt) -{ - base->EDIER &= ~interrupt; -} - -/*! - * @brief Clear all low EFT detector. - * - * @note : Port B and Port C pins share the same EFT detector clear control from PORTC_EDCR register. Any write to the - * PORTB_EDCR does not take effect. - * @param base PORT peripheral base pointer - * @param interrupt EFT detect interrupt - */ -static inline void PORT_ClearAllLowEFTDetectors(PORT_Type *base) -{ - base->EDCR |= PORT_EDCR_EDLC_MASK; - base->EDCR &= ~PORT_EDCR_EDLC_MASK; -} - -/*! - * @brief Clear all high EFT detector. - * - * @param base PORT peripheral base pointer - * @param interrupt EFT detect interrupt - */ -static inline void PORT_ClearAllHighEFTDetectors(PORT_Type *base) -{ - base->EDCR |= PORT_EDCR_EDHC_MASK; - base->EDCR &= ~PORT_EDCR_EDHC_MASK; -} -#endif /* FSL_FEATURE_PORT_SUPPORT_EFT */ - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_PORT_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_power.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_power.c deleted file mode 100644 index 407cedb6083..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_power.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2022, NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#include "fsl_common.h" -#include "fsl_power.h" -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.power" -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/******************************************************************************* - * Codes - ******************************************************************************/ - -/******************************************************************************* - * LOCAL FUNCTIONS PROTOTYPES - ******************************************************************************/ - -/** - * brief PMC Sleep function call - * return nothing - */ -void POWER_EnterSleep(void) -{ - uint32_t pmsk; - pmsk = __get_PRIMASK(); - __disable_irq(); - SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk; - __WFI(); - __set_PRIMASK(pmsk); -} - -/** - * brief PMC Deep Sleep function call - * return nothing - */ -void POWER_EnterDeepSleep(uint32_t exclude_from_pd, - uint32_t sram_retention_ctrl, - uint64_t wakeup_interrupts, - uint32_t hardware_wake_ctrl) -{ -} - -/** - * brief PMC power Down function call - * return nothing - */ -void POWER_EnterPowerDown(uint32_t exclude_from_pd, - uint32_t sram_retention_ctrl, - uint64_t wakeup_interrupts, - uint32_t cpu_retention_ctrl) -{ -} - -/** - * brief PMC Deep Sleep Power Down function call - * return nothing - */ -void POWER_EnterDeepPowerDown(uint32_t exclude_from_pd, - uint32_t sram_retention_ctrl, - uint64_t wakeup_interrupts, - uint32_t wakeup_io_ctrl) -{ -} - -/** - * @brief Described in fsl_common.h - * @param - * @return - */ -void POWER_SetVoltageForFreq(uint32_t system_freq_hz) -{ -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_power.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_power.h deleted file mode 100644 index 22c89106e19..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_power.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright 2022, NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef _FSL_POWER_H_ -#define _FSL_POWER_H_ - -#include "fsl_common.h" -#include "fsl_device_registers.h" -#include - -/*! - * @addtogroup power - * @{ - */ -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief power driver version 1.0.0. */ -#define FSL_POWER_DRIVER_VERSION (MAKE_VERSION(1, 0, 0)) -/*@}*/ - -/* Power mode configuration API parameter */ -typedef enum _power_mode_config -{ - kPmu_Sleep = 0U, - kPmu_Deep_Sleep = 1U, - kPmu_PowerDown = 2U, - kPmu_Deep_PowerDown = 3U, -} power_mode_cfg_t; - -#ifdef __cplusplus -extern "C" { -#endif -/******************************************************************************* - * API - ******************************************************************************/ - -/** - * @brief Configures and enters in SLEEP low power mode - * @param : - * @return Nothing - */ -void POWER_EnterSleep(void); - -/** - * @brief Configures and enters in DEEP-SLEEP low power mode - * @param exclude_from_pd: - * @param sram_retention_ctrl: - * @param wakeup_interrupts: - * @param hardware_wake_ctrl: - - * @return Nothing - * - * !!! IMPORTANT NOTES : - 0 - CPU0 & System CLock frequency is switched to FRO12MHz and is NOT restored back by the API. - * 1 - CPU0 Interrupt Enable registers (NVIC->ISER) are modified by this function. They are restored back in - case of CPU retention or if POWERDOWN is not taken (for instance because an interrupt is pending). - * 2 - The Non Maskable Interrupt (NMI) is disabled and its configuration before calling this function will be - restored back if POWERDOWN is not taken (for instance because an RTC or OSTIMER interrupt is pending). - * 3 - The HARD FAULT handler should execute from SRAM. (The Hard fault handler should initiate a full chip - reset) reset) - */ -void POWER_EnterDeepSleep(uint32_t exclude_from_pd, - uint32_t sram_retention_ctrl, - uint64_t wakeup_interrupts, - uint32_t hardware_wake_ctrl); - -/** - * @brief Configures and enters in POWERDOWN low power mode - * @param exclude_from_pd: - * @param sram_retention_ctrl: - * @param wakeup_interrupts: - * @param cpu_retention_ctrl: 0 = CPU retention is disable / 1 = CPU retention is enabled, all other values are - RESERVED. - - * @return Nothing - * - * !!! IMPORTANT NOTES : - 0 - CPU0 & System CLock frequency is switched to FRO12MHz and is NOT restored back by the API. - * 1 - CPU0 Interrupt Enable registers (NVIC->ISER) are modified by this function. They are restored back in - case of CPU retention or if POWERDOWN is not taken (for instance because an interrupt is pending). - * 2 - The Non Maskable Interrupt (NMI) is disabled and its configuration before calling this function will be - restored back if POWERDOWN is not taken (for instance because an RTC or OSTIMER interrupt is pending). - * 3 - In case of CPU retention, it is the responsability of the user to make sure that SRAM instance - containing the stack used to call this function WILL BE preserved during low power (via parameter - "sram_retention_ctrl") - * 4 - The HARD FAULT handler should execute from SRAM. (The Hard fault handler should initiate a full chip - reset) reset) - */ - -void POWER_EnterPowerDown(uint32_t exclude_from_pd, - uint32_t sram_retention_ctrl, - uint64_t wakeup_interrupts, - uint32_t cpu_retention_ctrl); - -/** - * @brief Configures and enters in DEEPPOWERDOWN low power mode - * @param exclude_from_pd: - * @param sram_retention_ctrl: - * @param wakeup_interrupts: - * @param wakeup_io_ctrl: - - * @return Nothing - * - * !!! IMPORTANT NOTES : - 0 - CPU0 & System CLock frequency is switched to FRO12MHz and is NOT restored back by the API. - * 1 - CPU0 Interrupt Enable registers (NVIC->ISER) are modified by this function. They are restored back if - DEEPPOWERDOWN is not taken (for instance because an RTC or OSTIMER interrupt is pending). - * 2 - The Non Maskable Interrupt (NMI) is disabled and its configuration before calling this function will be - restored back if DEEPPOWERDOWN is not taken (for instance because an RTC or OSTIMER interrupt is pending). - * 3 - The HARD FAULT handler should execute from SRAM. (The Hard fault handler should initiate a full chip - reset) - */ -void POWER_EnterDeepPowerDown(uint32_t exclude_from_pd, - uint32_t sram_retention_ctrl, - uint64_t wakeup_interrupts, - uint32_t wakeup_io_ctrl); - -/*! - * @brief Power Library API to choose normal regulation and set the voltage for the desired operating frequency. - * - * @param system_freq_hz - The desired frequency (in Hertz) at which the part would like to operate, - * note that the voltage and flash wait states should be set before changing frequency - * @return none - */ -void POWER_SetVoltageForFreq(uint32_t system_freq_hz); - -#ifdef __cplusplus -} -#endif - -/** - * @} - */ - -#endif /* _FSL_POWER_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_powerquad.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_powerquad.h deleted file mode 100644 index c4f2805468e..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_powerquad.h +++ /dev/null @@ -1,2805 +0,0 @@ -/* - * Copyright 2018-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_POWERQUAD_H_ -#define FSL_POWERQUAD_H_ - -#if defined(__CC_ARM) - -#elif defined(__ICCARM__) -#include -#elif defined(__GNUC__) -#include -#endif /* defined(__CC_ARM) */ - -#include "fsl_common.h" -#include "fsl_powerquad_data.h" - -/*! - * @addtogroup powerquad - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -#define FSL_POWERQUAD_DRIVER_VERSION (MAKE_VERSION(2, 2, 0)) /*!< Version. */ -/*! @} */ - -/* For backword compatibility. */ -#define PQ_VectorBiqaudDf2F32 PQ_VectorBiquadDf2F32 -#define PQ_VectorBiqaudDf2Fixed32 PQ_VectorBiquadDf2Fixed32 -#define PQ_VectorBiqaudDf2Fixed16 PQ_VectorBiquadDf2Fixed16 -#define PQ_VectorBiqaudCascadeDf2F32 PQ_VectorBiquadCascadeDf2F32 -#define PQ_VectorBiqaudCascadeDf2Fixed32 PQ_VectorBiquadCascadeDf2Fixed32 -#define PQ_VectorBiqaudCascadeDf2Fixed16 PQ_VectorBiquadCascadeDf2Fixed16 -#define PQ_Vector8BiqaudDf2CascadeF32 PQ_Vector8BiquadDf2CascadeF32 -#define PQ_Vector8BiqaudDf2CascadeFixed32 PQ_Vector8BiquadDf2CascadeFixed32 -#define PQ_Vector8BiqaudDf2CascadeFixed16 PQ_Vector8BiquadDf2CascadeFixed16 - -#define PQ_FLOAT32 0U -#define PQ_FIXEDPT 1U - -#define CP_PQ 0U -#define CP_MTX 1U -#define CP_FFT 2U -#define CP_FIR 3U -#define CP_CORDIC 5U - -#define PQ_TRANS 0U -#define PQ_TRIG 1U -#define PQ_BIQUAD 2U - -#define PQ_TRANS_FIXED 4U -#define PQ_TRIG_FIXED 5U -#define PQ_BIQUAD_FIXED 6U - -#define PQ_INV 0U -#define PQ_LN 1U -#define PQ_SQRT 2U -#define PQ_INVSQRT 3U -#define PQ_ETOX 4U -#define PQ_ETONX 5U -#define PQ_DIV 6U - -#define PQ_SIN 0U -#define PQ_COS 1U - -#define PQ_BIQ0_CALC 1U -#define PQ_BIQ1_CALC 1U - -#define PQ_COMP0_ONLY (0U << 1U) -#define PQ_COMP1_ONLY (1U << 1U) - -#define CORDIC_ITER(x) ((uint32_t)(x) << 2U) -#define CORDIC_MIU(x) ((uint32_t)(x) << 1U) -#define CORDIC_T(x) ((uint32_t)(x) << 0U) -#define CORDIC_ARCTAN CORDIC_T(1U) | CORDIC_MIU(0U) -#define CORDIC_ARCTANH CORDIC_T(1U) | CORDIC_MIU(1U) - -#define INST_BUSY 0x80000000U - -#define PQ_ERRSTAT_OVERFLOW 0U -#define PQ_ERRSTAT_NAN 1U -#define PQ_ERRSTAT_FIXEDOVERFLOW 2U -#define PQ_ERRSTAT_UNDERFLOW 3U - -#define PQ_TRANS_CFFT 0U -#define PQ_TRANS_IFFT 1U -#define PQ_TRANS_CDCT 2U -#define PQ_TRANS_IDCT 3U -#define PQ_TRANS_RFFT 4U -#define PQ_TRANS_RDCT 6U - -#define PQ_MTX_SCALE 1U -#define PQ_MTX_MULT 2U -#define PQ_MTX_ADD 3U -#define PQ_MTX_INV 4U -#define PQ_MTX_PROD 5U -#define PQ_MTX_SUB 7U -#define PQ_VEC_DOTP 9U -#define PQ_MTX_TRAN 10U - -/* FIR engine operation type */ -#define PQ_FIR_FIR 0U -#define PQ_FIR_CONVOLUTION 1U -#define PQ_FIR_CORRELATION 2U -#define PQ_FIR_INCREMENTAL 4U - -#define _pq_ln0(x) __arm_mcr(CP_PQ, PQ_LN, (uint32_t)(x), PQ_FLOAT32 | PQ_COMP0_ONLY, 0, PQ_TRANS) -#define _pq_inv0(x) __arm_mcr(CP_PQ, PQ_INV, (uint32_t)(x), PQ_FLOAT32 | PQ_COMP0_ONLY, 0, PQ_TRANS) -#define _pq_sqrt0(x) __arm_mcr(CP_PQ, PQ_SQRT, (uint32_t)(x), PQ_FLOAT32 | PQ_COMP0_ONLY, 0, PQ_TRANS) -#define _pq_invsqrt0(x) __arm_mcr(CP_PQ, PQ_INVSQRT, (uint32_t)(x), PQ_FLOAT32 | PQ_COMP0_ONLY, 0, PQ_TRANS) -#define _pq_etox0(x) __arm_mcr(CP_PQ, PQ_ETOX, (uint32_t)(x), PQ_FLOAT32 | PQ_COMP0_ONLY, 0, PQ_TRANS) -#define _pq_etonx0(x) __arm_mcr(CP_PQ, PQ_ETONX, (uint32_t)(x), PQ_FLOAT32 | PQ_COMP0_ONLY, 0, PQ_TRANS) -#define _pq_sin0(x) __arm_mcr(CP_PQ, PQ_SIN, (uint32_t)(x), PQ_FLOAT32 | PQ_COMP0_ONLY, 0, PQ_TRIG) -#define _pq_cos0(x) __arm_mcr(CP_PQ, PQ_COS, (uint32_t)(x), PQ_FLOAT32 | PQ_COMP0_ONLY, 0, PQ_TRIG) -#define _pq_biquad0(x) __arm_mcr(CP_PQ, PQ_BIQ0_CALC, (uint32_t)(x), PQ_FLOAT32 | PQ_COMP0_ONLY, 0, PQ_BIQUAD) - -#define _pq_ln_fx0(x) __arm_mcr(CP_PQ, PQ_LN, (uint32_t)(x), PQ_FIXEDPT | PQ_COMP0_ONLY, 0, PQ_TRANS_FIXED) -#define _pq_inv_fx0(x) __arm_mcr(CP_PQ, PQ_INV, (uint32_t)(x), PQ_FIXEDPT | PQ_COMP0_ONLY, 0, PQ_TRANS_FIXED) -#define _pq_sqrt_fx0(x) __arm_mcr(CP_PQ, PQ_SQRT, (uint32_t)(x), PQ_FIXEDPT | PQ_COMP0_ONLY, 0, PQ_TRANS_FIXED) -#define _pq_invsqrt_fx0(x) __arm_mcr(CP_PQ, PQ_INVSQRT, (uint32_t)(x), PQ_FIXEDPT | PQ_COMP0_ONLY, 0, PQ_TRANS_FIXED) -#define _pq_etox_fx0(x) __arm_mcr(CP_PQ, PQ_ETOX, (uint32_t)(x), PQ_FIXEDPT | PQ_COMP0_ONLY, 0, PQ_TRANS_FIXED) -#define _pq_etonx_fx0(x) __arm_mcr(CP_PQ, PQ_ETONX, (uint32_t)(x), PQ_FIXEDPT | PQ_COMP0_ONLY, 0, PQ_TRANS_FIXED) -#define _pq_sin_fx0(x) __arm_mcr(CP_PQ, PQ_SIN, (uint32_t)(x), PQ_FIXEDPT | PQ_COMP0_ONLY, 0, PQ_TRIG_FIXED) -#define _pq_cos_fx0(x) __arm_mcr(CP_PQ, PQ_COS, (uint32_t)(x), PQ_FIXEDPT | PQ_COMP0_ONLY, 0, PQ_TRIG_FIXED) -#define _pq_biquad0_fx(x) __arm_mcr(CP_PQ, PQ_BIQ0_CALC, (uint32_t)(x), PQ_FIXEDPT | PQ_COMP0_ONLY, 0, PQ_BIQUAD_FIXED) - -#define _pq_div0(x) __arm_mcrr(CP_PQ, PQ_FLOAT32 | PQ_COMP0_ONLY, (uint64_t)(x), PQ_DIV) -#define _pq_div1(x) __arm_mcrr(CP_PQ, PQ_FLOAT32 | PQ_COMP1_ONLY, (uint64_t)(x), PQ_DIV) - -#define _pq_ln1(x) __arm_mcr(CP_PQ, PQ_LN, (uint32_t)(x), PQ_FLOAT32 | PQ_COMP1_ONLY, 0, PQ_TRANS) -#define _pq_inv1(x) __arm_mcr(CP_PQ, PQ_INV, (uint32_t)(x), PQ_FLOAT32 | PQ_COMP1_ONLY, 0, PQ_TRANS) -#define _pq_sqrt1(x) __arm_mcr(CP_PQ, PQ_SQRT, (uint32_t)(x), PQ_FLOAT32 | PQ_COMP1_ONLY, 0, PQ_TRANS) -#define _pq_invsqrt1(x) __arm_mcr(CP_PQ, PQ_INVSQRT, (uint32_t)(x), PQ_FLOAT32 | PQ_COMP1_ONLY, 0, PQ_TRANS) -#define _pq_etox1(x) __arm_mcr(CP_PQ, PQ_ETOX, (uint32_t)(x), PQ_FLOAT32 | PQ_COMP1_ONLY, 0, PQ_TRANS) -#define _pq_etonx1(x) __arm_mcr(CP_PQ, PQ_ETONX, (uint32_t)(x), PQ_FLOAT32 | PQ_COMP1_ONLY, 0, PQ_TRANS) -#define _pq_sin1(x) __arm_mcr(CP_PQ, PQ_SIN, (uint32_t)(x), PQ_FLOAT32 | PQ_COMP1_ONLY, 0, PQ_TRIG) -#define _pq_cos1(x) __arm_mcr(CP_PQ, PQ_COS, (uint32_t)(x), PQ_FLOAT32 | PQ_COMP1_ONLY, 0, PQ_TRIG) -#define _pq_biquad1(x) __arm_mcr(CP_PQ, PQ_BIQ1_CALC, (uint32_t)(x), PQ_FLOAT32 | PQ_COMP1_ONLY, 0, PQ_BIQUAD) - -#define _pq_ln_fx1(x) __arm_mcr(CP_PQ, PQ_LN, (uint32_t)(x), PQ_FIXEDPT | PQ_COMP1_ONLY, 0, PQ_TRANS_FIXED) -#define _pq_inv_fx1(x) __arm_mcr(CP_PQ, PQ_INV, (uint32_t)(x), PQ_FIXEDPT | PQ_COMP1_ONLY, 0, PQ_TRANS_FIXED) -#define _pq_sqrt_fx1(x) __arm_mcr(CP_PQ, PQ_SQRT, (uint32_t)(x), PQ_FIXEDPT | PQ_COMP1_ONLY, 0, PQ_TRANS_FIXED) -#define _pq_invsqrt_fx1(x) __arm_mcr(CP_PQ, PQ_INVSQRT, (uint32_t)(x), PQ_FIXEDPT | PQ_COMP1_ONLY, 0, PQ_TRANS_FIXED) -#define _pq_etox_fx1(x) __arm_mcr(CP_PQ, PQ_ETOX, (uint32_t)(x), PQ_FIXEDPT | PQ_COMP1_ONLY, 0, PQ_TRANS_FIXED) -#define _pq_etonx_fx1(x) __arm_mcr(CP_PQ, PQ_ETONX, (uint32_t)(x), PQ_FIXEDPT | PQ_COMP1_ONLY, 0, PQ_TRANS_FIXED) -#define _pq_sin_fx1(x) __arm_mcr(CP_PQ, PQ_SIN, (uint32_t)(x), PQ_FIXEDPT | PQ_COMP1_ONLY, 0, PQ_TRIG_FIXED) -#define _pq_cos_fx1(x) __arm_mcr(CP_PQ, PQ_COS, (uint32_t)(x), PQ_FIXEDPT | PQ_COMP1_ONLY, 0, PQ_TRIG_FIXED) -#define _pq_biquad1_fx(x) __arm_mcr(CP_PQ, PQ_BIQ1_CALC, (uint32_t)(x), PQ_FIXEDPT | PQ_COMP1_ONLY, 0, PQ_BIQUAD_FIXED) - -#define _pq_readMult0() __arm_mrc(CP_PQ, 0, PQ_FLOAT32 | PQ_COMP0_ONLY, 0, 0) -#define _pq_readAdd0() __arm_mrc(CP_PQ, 1, PQ_FLOAT32 | PQ_COMP0_ONLY, 0, 0) -#define _pq_readMult1() __arm_mrc(CP_PQ, 0, PQ_FLOAT32 | PQ_COMP1_ONLY, 0, 0) -#define _pq_readAdd1() __arm_mrc(CP_PQ, 1, PQ_FLOAT32 | PQ_COMP1_ONLY, 0, 0) -#define _pq_readMult0_fx() __arm_mrc(CP_PQ, 0, PQ_FIXEDPT | PQ_COMP0_ONLY, 0, 0) -#define _pq_readAdd0_fx() __arm_mrc(CP_PQ, 1, PQ_FIXEDPT | PQ_COMP0_ONLY, 0, 0) -#define _pq_readMult1_fx() __arm_mrc(CP_PQ, 0, PQ_FIXEDPT | PQ_COMP1_ONLY, 0, 0) -#define _pq_readAdd1_fx() __arm_mrc(CP_PQ, 1, PQ_FIXEDPT | PQ_COMP1_ONLY, 0, 0) - -/*! Parameter used for vector ln(x) */ -#define PQ_LN_INF PQ_LN, 1, PQ_TRANS -/*! Parameter used for vector 1/x */ -#define PQ_INV_INF PQ_INV, 0, PQ_TRANS -/*! Parameter used for vector sqrt(x) */ -#define PQ_SQRT_INF PQ_SQRT, 0, PQ_TRANS -/*! Parameter used for vector 1/sqrt(x) */ -#define PQ_ISQRT_INF PQ_INVSQRT, 0, PQ_TRANS -/*! Parameter used for vector e^x */ -#define PQ_ETOX_INF PQ_ETOX, 0, PQ_TRANS -/*! Parameter used for vector e^(-x) */ -#define PQ_ETONX_INF PQ_ETONX, 0, PQ_TRANS -/*! Parameter used for vector sin(x) */ -#define PQ_SIN_INF PQ_SIN, 1, PQ_TRIG -/*! Parameter used for vector cos(x) */ -#define PQ_COS_INF PQ_COS, 1, PQ_TRIG - -/* - * Workaround used in vector functions: - * - * 1. In floating sin/cos case, there must be at least 5 core clock cycles - * between MCR and following MRRC - * 2. In fixed sin/cos case, there must be one NOP between two MCR - */ - -/* - * Register assignment for the vector calculation assembly. - * r0: pSrc, r1: pDest, r2-r7: Data - */ - -#define PQ_RUN_OPCODE_R3_R2(BATCH_OPCODE, BATCH_MACHINE) \ - __asm volatile( \ - " MCR p0,%[opcode],r3,c2,c0,%[machine] \n" \ - " MCR p0,%[opcode],r2,c0,c0,%[machine] \n" ::[opcode] "i"(BATCH_OPCODE), \ - [machine] "i"(BATCH_MACHINE)) - -#define PQ_RUN_OPCODE_R5_R4(BATCH_OPCODE, BATCH_MACHINE) \ - __asm volatile( \ - " MCR p0,%[opcode],r5,c2,c0,%[machine] \n" \ - " MCR p0,%[opcode],r4,c0,c0,%[machine] \n" ::[opcode] "i"(BATCH_OPCODE), \ - [machine] "i"(BATCH_MACHINE)) - -#define PQ_RUN_OPCODE_R7_R6(BATCH_OPCODE, BATCH_MACHINE) \ - __asm volatile( \ - " MCR p0,%[opcode],r7,c2,c0,%[machine] \n" \ - " MCR p0,%[opcode],r6,c0,c0,%[machine] \n" ::[opcode] "i"(BATCH_OPCODE), \ - [machine] "i"(BATCH_MACHINE)) - -#define PQ_Vector8_FP(middle, last, BATCH_OPCODE, DOUBLE_READ_ADDERS, BATCH_MACHINE) \ - PQ_RUN_OPCODE_R3_R2(BATCH_OPCODE, BATCH_MACHINE); \ - if (middle) \ - { \ - __asm volatile("STRD r4,r5,[r1],#8"); /* store fourth two results */ \ - } \ - __asm volatile("LDMIA r0!,{r4-r5}"); /* load next 2 datas */ \ - __asm volatile("NOP"); \ - __asm volatile("NOP"); \ - if (DOUBLE_READ_ADDERS) \ - { \ - __asm volatile("MRRC p0,#0,r2,r3,c1"); \ - } \ - else \ - { \ - __asm volatile("MRRC p0,#0,r2,r3,c0"); \ - } \ - PQ_RUN_OPCODE_R5_R4(BATCH_OPCODE, BATCH_MACHINE); \ - __asm volatile("STRD r2,r3,[r1],#8"); /* store first two results */ \ - __asm volatile("LDMIA r0!,{r6-r7}"); /* load next 2 datas */ \ - __asm volatile("NOP"); \ - __asm volatile("NOP"); \ - if (DOUBLE_READ_ADDERS) \ - { \ - __asm volatile("MRRC p0,#0,r4,r5,c1"); \ - } \ - else \ - { \ - __asm volatile("MRRC p0,#0,r4,r5,c0"); \ - } \ - PQ_RUN_OPCODE_R7_R6(BATCH_OPCODE, BATCH_MACHINE); \ - __asm volatile("STRD r4,r5,[r1],#8"); /* store second two results */ \ - __asm volatile("LDRD r4,r5,[r0],#8"); /* load last 2 of the 8 */ \ - __asm volatile("NOP"); \ - __asm volatile("NOP"); \ - if (DOUBLE_READ_ADDERS) \ - { \ - __asm volatile("MRRC p0,#0,r6,r7,c1"); \ - } \ - else \ - { \ - __asm volatile("MRRC p0,#0,r6,r7,c0"); \ - } \ - PQ_RUN_OPCODE_R5_R4(BATCH_OPCODE, BATCH_MACHINE); \ - __asm volatile("STRD r6,r7,[r1],#8"); /* store third two results */ \ - if (!last) \ - { \ - __asm volatile("LDRD r2,r3,[r0],#8"); /* load first two of next 8 */ \ - } \ - else \ - { \ - __asm volatile("NOP"); \ - __asm volatile("NOP"); \ - __asm volatile("NOP"); \ - } \ - __asm volatile("NOP"); \ - __asm volatile("NOP"); \ - if (DOUBLE_READ_ADDERS) \ - { \ - __asm volatile("MRRC p0,#0,r4,r5,c1"); \ - } \ - else \ - { \ - __asm volatile("MRRC p0,#0,r4,r5,c0"); \ - } \ - if (last) \ - { \ - __asm volatile("STRD r4,r5,[r1],#8"); /* store fourth two results */ \ - } - -#define PQ_RUN_OPCODE_R2_R3(BATCH_OPCODE, BATCH_MACHINE) \ - __asm volatile( \ - " MCR p0,%[opcode],r2,c1,c0,%[machine] \n" \ - " NOP \n" \ - " MCR p0,%[opcode],r3,c3,c0,%[machine] \n" ::[opcode] "i"(BATCH_OPCODE), \ - [machine] "i"(BATCH_MACHINE)) - -#define PQ_RUN_OPCODE_R4_R5(BATCH_OPCODE, BATCH_MACHINE) \ - __asm volatile( \ - " MCR p0,%[opcode],r4,c1,c0,%[machine] \n" \ - " NOP \n" \ - " MCR p0,%[opcode],r5,c3,c0,%[machine] \n" ::[opcode] "i"(BATCH_OPCODE), \ - [machine] "i"(BATCH_MACHINE)) - -#define PQ_RUN_OPCODE_R6_R7(BATCH_OPCODE, BATCH_MACHINE) \ - __asm volatile( \ - " MCR p0,%[opcode],r6,c1,c0,%[machine] \n" \ - " NOP \n" \ - " MCR p0,%[opcode],r7,c3,c0,%[machine] \n" ::[opcode] "i"(BATCH_OPCODE), \ - [machine] "i"(BATCH_MACHINE)) - -#define PQ_Vector8_FX(middle, last, BATCH_OPCODE, DOUBLE_READ_ADDERS, BATCH_MACHINE) \ - PQ_RUN_OPCODE_R2_R3(BATCH_OPCODE, BATCH_MACHINE); \ - if (middle) \ - { \ - __asm volatile("STRD r4,r5,[r1],#8"); /* store fourth two results */ \ - } \ - __asm volatile("LDMIA r0!,{r4-r7}"); /* load next 4 datas */ \ - if (DOUBLE_READ_ADDERS) \ - { \ - __asm volatile("MRC p0,#0x1,r2,c1,c0,#0"); \ - __asm volatile("MRC p0,#0x1,r3,c3,c0,#0"); \ - } \ - else \ - { \ - __asm volatile("MRC p0,#0,r2,c1,c0,#0"); \ - __asm volatile("MRC p0,#0,r3,c3,c0,#0"); \ - } \ - PQ_RUN_OPCODE_R4_R5(BATCH_OPCODE, BATCH_MACHINE); \ - __asm volatile("STRD r2,r3,[r1],#8"); /* store first two results */ \ - if (DOUBLE_READ_ADDERS) \ - { \ - __asm volatile("MRC p0,#0x1,r4,c1,c0,#0"); \ - __asm volatile("MRC p0,#0x1,r5,c3,c0,#0"); \ - } \ - else \ - { \ - __asm volatile("MRC p0,#0,r4,c1,c0,#0"); \ - __asm volatile("MRC p0,#0,r5,c3,c0,#0"); \ - } \ - PQ_RUN_OPCODE_R6_R7(BATCH_OPCODE, BATCH_MACHINE); \ - __asm volatile("STRD r4,r5,[r1],#8"); /* store second two results */ \ - __asm volatile("LDRD r4,r5,[r0],#8"); /* load last 2 of the 8 */ \ - if (DOUBLE_READ_ADDERS) \ - { \ - __asm volatile("MRC p0,#0x1,r6,c1,c0,#0"); \ - __asm volatile("MRC p0,#0x1,r7,c3,c0,#0"); \ - } \ - else \ - { \ - __asm volatile("MRC p0,#0,r6,c1,c0,#0"); \ - __asm volatile("MRC p0,#0,r7,c3,c0,#0"); \ - } \ - PQ_RUN_OPCODE_R4_R5(BATCH_OPCODE, BATCH_MACHINE); \ - __asm volatile("STRD r6,r7,[r1],#8"); /* store third two results */ \ - if (!last) \ - __asm volatile("LDRD r2,r3,[r0],#8"); /* load first two of next 8 */ \ - if (DOUBLE_READ_ADDERS) \ - { \ - __asm volatile("MRC p0,#0x1,r4,c1,c0,#0"); \ - __asm volatile("MRC p0,#0x1,r5,c3,c0,#0"); \ - } \ - else \ - { \ - __asm volatile("MRC p0,#0,r4,c1,c0,#0"); \ - __asm volatile("MRC p0,#0,r5,c3,c0,#0"); \ - } \ - if (last) \ - { \ - __asm volatile("STRD r4,r5,[r1],#8"); /* store fourth two results */ \ - } - -/*! - * @brief Start 32-bit data vector calculation. - * - * Start the vector calculation, the input data could be float, int32_t or Q31. - * - * @param pSrc Pointer to the source data. - * @param pDst Pointer to the destination data. - */ -#define PQ_Initiate_Vector_Func(pSrc, pDst) \ - __asm volatile( \ - "MOV r0, %[psrc] \n" \ - "MOV r1, %[pdst] \n" \ - "PUSH {r2-r7} \n" \ - "LDRD r2,r3,[r0],#8 \n" ::[psrc] "r"(pSrc), \ - [pdst] "r"(pDst) \ - : "r0", "r1") - -/*! - * @brief End vector calculation. - * - * This function should be called after vector calculation. - */ -#define PQ_End_Vector_Func() __asm volatile("POP {r2-r7}") - -/* - * Register assignment for the vector calculation assembly. - * r0: pSrc, r1: pDest, r2: length, r3: middle, r4-r9: Data, r10:dra - */ - -/*! - * @brief Start 32-bit data vector calculation. - * - * Start the vector calculation, the input data could be float, int32_t or Q31. - * - * @param PSRC Pointer to the source data. - * @param PDST Pointer to the destination data. - * @param LENGTH Number of the data, must be multiple of 8. - */ -#define PQ_StartVector(PSRC, PDST, LENGTH) \ - __asm volatile( \ - "MOV r0, %[psrc] \n" \ - "MOV r1, %[pdst] \n" \ - "MOV r2, %[length] \n" \ - "PUSH {r3-r10} \n" \ - "MOV r3, #0 \n" \ - "MOV r10, #0 \n" \ - "LDRD r4,r5,[r0],#8 \n" ::[psrc] "r"(PSRC), \ - [pdst] "r"(PDST), [length] "r"(LENGTH) \ - : "r0", "r1", "r2") - -/*! - * @brief Start 16-bit data vector calculation. - * - * Start the vector calculation, the input data could be int16_t. This function - * should be use with @ref PQ_Vector8Fixed16. - * - * @param PSRC Pointer to the source data. - * @param PDST Pointer to the destination data. - * @param LENGTH Number of the data, must be multiple of 8. - */ -#define PQ_StartVectorFixed16(PSRC, PDST, LENGTH) \ - __asm volatile( \ - "MOV r0, %[psrc] \n" \ - "MOV r1, %[pdst] \n" \ - "MOV r2, %[length] \n" \ - "PUSH {r3-r10} \n" \ - "MOV r3, #0 \n" \ - "LDRSH r4,[r0],#2 \n" \ - "LDRSH r5,[r0],#2 \n" ::[psrc] "r"(PSRC), \ - [pdst] "r"(PDST), [length] "r"(LENGTH) \ - : "r0", "r1", "r2") - -/*! - * @brief Start Q15-bit data vector calculation. - * - * Start the vector calculation, the input data could be Q15. This function - * should be use with @ref PQ_Vector8Q15. This function is dedicate for - * SinQ15/CosQ15 vector calculation. Because PowerQuad only supports Q31 Sin/Cos - * fixed function, so the input Q15 data is left shift 16 bits first, after - * Q31 calculation, the output data is right shift 16 bits. - * - * @param PSRC Pointer to the source data. - * @param PDST Pointer to the destination data. - * @param LENGTH Number of the data, must be multiple of 8. - */ -#define PQ_StartVectorQ15(PSRC, PDST, LENGTH) \ - __asm volatile( \ - "MOV r0, %[psrc] \n" \ - "MOV r1, %[pdst] \n" \ - "MOV r2, %[length] \n" \ - "PUSH {r3-r10} \n" \ - "MOV r3, #0 \n" \ - "LDR r5,[r0],#4 \n" \ - "LSL r4,r5,#16 \n" \ - "BFC r5,#0,#16 \n" ::[psrc] "r"(PSRC), \ - [pdst] "r"(PDST), [length] "r"(LENGTH) \ - : "r0", "r1", "r2") - -/*! - * @brief End vector calculation. - * - * This function should be called after vector calculation. - */ -#define PQ_EndVector() __asm volatile("POP {r3-r10} \n") - -/*! - * @brief Float data vector calculation. - * - * Float data vector calculation, the input data should be float. The parameter - * could be PQ_LN_INF, PQ_INV_INF, PQ_SQRT_INF, PQ_ISQRT_INF, PQ_ETOX_INF, PQ_ETONX_INF. - * For example, to calculate sqrt of a vector, use like this: - * @code - #define VECTOR_LEN 8 - float input[VECTOR_LEN] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0}; - float output[VECTOR_LEN]; - - PQ_StartVector(input, output, VECTOR_LEN); - PQ_Vector8F32(PQ_SQRT_INF); - PQ_EndVector(); - @endcode - * - */ -#define PQ_Vector8F32(BATCH_OPCODE, DOUBLE_READ_ADDERS, BATCH_MACHINE) \ - __asm volatile( \ - "1: \n" \ - " MCR p0,%[opcode],r5,c2,c0,%[machine] \n" \ - " MCR p0,%[opcode],r4,c0,c0,%[machine] \n" \ - " CMP r3, #0 \n" \ - " ITE NE \n" \ - " STRDNE r6,r7,[r1],#8 \n" /* store fourth two results */ \ - " MOVEQ r3, #1 \n" /* middle = 1 */ \ - " LDMIA r0!,{r6-r9} \n" /* load next 4 datas */ \ - " MOV r10,%[dra] \n" \ - " CMP r10, #0 \n" \ - " ITE NE \n" \ - " MRRCNE p0,#0,r4,r5,c1 \n" \ - " MRRCEQ p0,#0,r4,r5,c0 \n" \ - " MCR p0,%[opcode],r7,c2,c0,%[machine] \n" \ - " MCR p0,%[opcode],r6,c0,c0,%[machine] \n" \ - " STRD r4,r5,[r1],#8 \n" /* store first two results */ \ - " MOV r10,%[dra] \n" \ - " CMP r10, #0 \n" \ - " ITE NE \n" \ - " MRRCNE p0,#0,r6,r7,c1 \n" \ - " MRRCEQ p0,#0,r6,r7,c0 \n" \ - " MCR p0,%[opcode],r9,c2,c0,%[machine] \n" \ - " MCR p0,%[opcode],r8,c0,c0,%[machine] \n" \ - " STRD r6,r7,[r1],#8 \n" /* store second two results */ \ - " LDRD r6,r7,[r0],#8 \n" /* load last 2 of the 8 */ \ - " CMP r10, #0 \n" \ - " ITE NE \n" \ - " MRRCNE p0,#0,r8,r9,c1 \n" \ - " MRRCEQ p0,#0,r8,r9,c0 \n" \ - " MCR p0,%[opcode],r7,c2,c0,%[machine] \n" \ - " MCR p0,%[opcode],r6,c0,c0,%[machine] \n" \ - " STRD r8,r9,[r1],#8 \n" /* store third two results */ \ - " SUBS r2, r2, #8 \n" /* length -= 8; if (length != 0) */ \ - " IT NE \n" \ - " LDRDNE r4,r5,[r0],#8 \n" /* load first two of next 8 */ \ - " CMP r10, #0 \n" \ - " ITE NE \n" \ - " MRRCNE p0,#0,r6,r7,c1 \n" \ - " MRRCEQ p0,#0,r6,r7,c0 \n" \ - " CMP r2, #0 \n" /* if (length == 0) */ \ - " BNE 1b \n" \ - " STRD r6,r7,[r1],#8 \n" /* store fourth two results */ \ - ::[opcode] "i"(BATCH_OPCODE), \ - [dra] "i"(DOUBLE_READ_ADDERS), [machine] "i"(BATCH_MACHINE)) - -/*! - * @brief Fixed 32bits data vector calculation. - * - * Float data vector calculation, the input data should be 32-bit integer. The parameter - * could be PQ_LN_INF, PQ_INV_INF, PQ_SQRT_INF, PQ_ISQRT_INF, PQ_ETOX_INF, PQ_ETONX_INF. - * PQ_SIN_INF, PQ_COS_INF. When this function is used for sin/cos calculation, the input - * data should be in the format Q1.31. - * For example, to calculate sqrt of a vector, use like this: - * @code - #define VECTOR_LEN 8 - int32_t input[VECTOR_LEN] = {1, 4, 9, 16, 25, 36, 49, 64}; - int32_t output[VECTOR_LEN]; - - PQ_StartVector(input, output, VECTOR_LEN); - PQ_Vector8F32(PQ_SQRT_INF); - PQ_EndVector(); - @endcode - * - */ -#define PQ_Vector8Fixed32(BATCH_OPCODE, DOUBLE_READ_ADDERS, BATCH_MACHINE) \ - __asm volatile( \ - "1: \n" \ - " MCR p0,%[opcode],r4,c1,c0,%[machine] \n" \ - " NOP \n" \ - " MCR p0,%[opcode],r5,c3,c0,%[machine] \n" \ - " CMP r3, #0 \n" \ - " ITE NE \n" \ - " STRDNE r6,r7,[r1],#8 \n" /* store fourth two results */ \ - " MOVEQ r3, #1 \n" /* middle = 1 */ \ - " LDMIA r0!,{r6-r9} \n" /* load next 4 datas */ \ - " MRC p0,%[dra],r4,c1,c0,#0 \n" \ - " MRC p0,%[dra],r5,c3,c0,#0 \n" \ - " MCR p0,%[opcode],r6,c1,c0,%[machine] \n" \ - " NOP \n" \ - " MCR p0,%[opcode],r7,c3,c0,%[machine] \n" \ - " STRD r4,r5,[r1],#8 \n" /* store first two results */ \ - " MRC p0,%[dra],r6,c1,c0,#0 \n" \ - " MRC p0,%[dra],r7,c3,c0,#0 \n" \ - " MCR p0,%[opcode],r8,c1,c0,%[machine] \n" \ - " NOP \n" \ - " MCR p0,%[opcode],r9,c3,c0,%[machine] \n" \ - " STRD r6,r7,[r1],#8 \n" /* store second two results */ \ - " LDRD r6,r7,[r0],#8 \n" /* load last 2 of the 8 */ \ - " MRC p0,%[dra],r8,c1,c0,#0 \n" \ - " MRC p0,%[dra],r9,c3,c0,#0 \n" \ - " MCR p0,%[opcode],r6,c1,c0,%[machine] \n" \ - " NOP \n" \ - " MCR p0,%[opcode],r7,c3,c0,%[machine] \n" \ - " STRD r8,r9,[r1],#8 \n" /* store third two results */ \ - " SUBS r2, r2, #8 \n" /* length -= 8; if (length != 0) */ \ - " IT NE \n" \ - " LDRDNE r4,r5,[r0],#8 \n" /* load first two of next 8 */ \ - " MRC p0,%[dra],r6,c1,c0,#0 \n" \ - " MRC p0,%[dra],r7,c3,c0,#0 \n" \ - " CMP r2, #0 \n" /* if (length == 0) */ \ - " BNE 1b \n" \ - " STRD r6,r7,[r1],#8 \n" /* store fourth two results */ \ - ::[opcode] "i"(BATCH_OPCODE), \ - [dra] "i"(DOUBLE_READ_ADDERS), [machine] "i"(BATCH_MACHINE)) - -/*! - * @brief Fixed 32bits data vector calculation. - * - * Float data vector calculation, the input data should be 16-bit integer. The parameter - * could be PQ_LN_INF, PQ_INV_INF, PQ_SQRT_INF, PQ_ISQRT_INF, PQ_ETOX_INF, PQ_ETONX_INF. - * For example, to calculate sqrt of a vector, use like this: - * @code - #define VECTOR_LEN 8 - int16_t input[VECTOR_LEN] = {1, 4, 9, 16, 25, 36, 49, 64}; - int16_t output[VECTOR_LEN]; - - PQ_StartVector(input, output, VECTOR_LEN); - PQ_Vector8F32(PQ_SQRT_INF); - PQ_EndVector(); - @endcode - * - */ -#define PQ_Vector8Fixed16(BATCH_OPCODE, DOUBLE_READ_ADDERS, BATCH_MACHINE) \ - __asm volatile( \ - "1: \n" \ - " MCR p0,%[opcode],r4,c1,c0,%[machine] \n" \ - " MCR p0,%[opcode],r5,c3,c0,%[machine] \n" \ - " CMP r3, #0 \n" \ - " ITTE NE \n" \ - " STRHNE r6,[r1],#2 \n" /* store fourth two results */ \ - " STRHNE r7,[r1],#2 \n" /* store fourth two results */ \ - " MOVEQ r3, #1 \n" /* middle = 1 */ \ - " LDRSH r6,[r0],#2 \n" /* load next 2 of the 8 */ \ - " LDRSH r7,[r0],#2 \n" /* load next 2 of the 8 */ \ - " MRC p0,%[dra],r4,c1,c0,#0 \n" \ - " MRC p0,%[dra],r5,c3,c0,#0 \n" \ - " MCR p0,%[opcode],r6,c1,c0,%[machine] \n" \ - " MCR p0,%[opcode],r7,c3,c0,%[machine] \n" \ - " STRH r4,[r1],#2 \n" /* store first two results */ \ - " STRH r5,[r1],#2 \n" /* store first two results */ \ - " LDRSH r8,[r0],#2 \n" /* load next 2 of the 8 */ \ - " LDRSH r9,[r0],#2 \n" /* load next 2 of the 8 */ \ - " MRC p0,%[dra],r6,c1,c0,#0 \n" \ - " MRC p0,%[dra],r7,c3,c0,#0 \n" \ - " MCR p0,%[opcode],r8,c1,c0,%[machine] \n" \ - " MCR p0,%[opcode],r9,c3,c0,%[machine] \n" \ - " STRH r6,[r1],#2 \n" /* store second two results */ \ - " STRH r7,[r1],#2 \n" /* store second two results */ \ - " LDRSH r6,[r0],#2 \n" /* load last 2 of the 8 */ \ - " LDRSH r7,[r0],#2 \n" /* load last 2 of the 8 */ \ - " MRC p0,%[dra],r8,c1,c0,#0 \n" \ - " MRC p0,%[dra],r9,c3,c0,#0 \n" \ - " MCR p0,%[opcode],r6,c1,c0,%[machine] \n" \ - " MCR p0,%[opcode],r7,c3,c0,%[machine] \n" \ - " STRH r8,[r1],#2 \n" /* store third two results */ \ - " STRH r9,[r1],#2 \n" /* store third two results */ \ - " SUBS r2, r2, #8 \n" /* length -= 8; if (length != 0) */ \ - " ITT NE \n" \ - " LDRSHNE r4,[r0],#2 \n" /* load first two of next 8 */ \ - " LDRSHNE r5,[r0],#2 \n" /* load first two of next 8 */ \ - " MRC p0,%[dra],r6,c1,c0,#0 \n" \ - " MRC p0,%[dra],r7,c3,c0,#0 \n" \ - " CMP r2, #0 \n" /* if (length == 0) */ \ - " BNE 1b \n" \ - " STRH r6,[r1],#2 \n" /* store fourth two results */ \ - " STRH r7,[r1],#2 \n" /* store fourth two results */ \ - ::[opcode] "i"(BATCH_OPCODE), \ - [dra] "i"(DOUBLE_READ_ADDERS), [machine] "i"(BATCH_MACHINE)) - -/*! - * @brief Q15 data vector calculation. - * - * Q15 data vector calculation, this function should only be used for sin/cos Q15 calculation, - * and the coprocessor output prescaler must be set to 31 before this function. This function - * loads Q15 data and left shift 16 bits, calculate and right shift 16 bits, then stores to - * the output array. The input range -1 to 1 means -pi to pi. - * For example, to calculate sin of a vector, use like this: - * @code - #define VECTOR_LEN 8 - int16_t input[VECTOR_LEN] = {...} - int16_t output[VECTOR_LEN]; - const pq_prescale_t prescale = - { - .inputPrescale = 0, - .outputPrescale = 31, - .outputSaturate = 0 - }; - - PQ_SetCoprocessorScaler(POWERQUAD, const pq_prescale_t *prescale); - - PQ_StartVectorQ15(pSrc, pDst, length); - PQ_Vector8Q15(PQ_SQRT_INF); - PQ_EndVector(); - @endcode - * - */ -#define PQ_Vector8Q15(BATCH_OPCODE, DOUBLE_READ_ADDERS, BATCH_MACHINE) \ - __asm volatile( \ - "1: \n" \ - " MCR p0,%[opcode],r4,c1,c0,%[machine] \n" \ - " NOP \n" \ - " MCR p0,%[opcode],r5,c3,c0,%[machine] \n" \ - " CMP r3, #0 \n" \ - " ITTTE NE \n" \ - " LSRNE r6,r6,#16 \n" /* store fourth two results */ \ - " BFINE r7,r6,#0,#16 \n" /* store fourth two results */ \ - " STRNE r7,[r1],#4 \n" /* store fourth two results */ \ - " MOVEQ r3, #1 \n" /* middle = 1 */ \ - " LDR r7,[r0],#4 \n" /* load next 2 of the 8 */ \ - " LSL r6,r7,#16 \n" /* load next 2 of the 8 */ \ - " BFC r7,#0,#16 \n" /* load next 2 of the 8 */ \ - " MRC p0,%[dra],r4,c1,c0,#0 \n" \ - " MRC p0,%[dra],r5,c3,c0,#0 \n" \ - " MCR p0,%[opcode],r6,c1,c0,%[machine] \n" \ - " NOP \n" \ - " MCR p0,%[opcode],r7,c3,c0,%[machine] \n" \ - " LSR r4,r4,#16 \n" /* store first two results */ \ - " BFI r5,r4,#0,#16 \n" /* store first two results */ \ - " STR r5,[r1],#4 \n" /* store first two results */ \ - " LDR r9,[r0],#4 \n" /* load next 2 of the 8 */ \ - " LSL r8,r9,#16 \n" /* load next 2 of the 8 */ \ - " BFC r9,#0,#16 \n" /* load next 2 of the 8 */ \ - " MRC p0,%[dra],r6,c1,c0,#0 \n" \ - " MRC p0,%[dra],r7,c3,c0,#0 \n" \ - " MCR p0,%[opcode],r8,c1,c0,%[machine] \n" \ - " NOP \n" \ - " MCR p0,%[opcode],r9,c3,c0,%[machine] \n" \ - " LSR r6,r6,#16 \n" /* store second two results */ \ - " BFI r7,r6,#0,#16 \n" /* store second two results */ \ - " STR r7,[r1],#4 \n" /* store second two results */ \ - " LDR r7,[r0],#4 \n" /* load next 2 of the 8 */ \ - " LSL r6,r7,#16 \n" /* load next 2 of the 8 */ \ - " BFC r7,#0,#16 \n" /* load next 2 of the 8 */ \ - " MRC p0,%[dra],r8,c1,c0,#0 \n" \ - " MRC p0,%[dra],r9,c3,c0,#0 \n" \ - " MCR p0,%[opcode],r6,c1,c0,%[machine] \n" \ - " NOP \n" \ - " MCR p0,%[opcode],r7,c3,c0,%[machine] \n" \ - " LSR r8,r8,#16 \n" /* store third two results */ \ - " BFI r9,r8,#0,#16 \n" /* store third two results */ \ - " STR r9,[r1],#4 \n" /* store third two results */ \ - " SUBS r2, r2, #8 \n" /* length -= 8; if (length != 0) */ \ - " ITTT NE \n" \ - " LDRNE r5,[r0],#4 \n" /* load next 2 of the 8 */ \ - " LSLNE r4,r5,#16 \n" /* load next 2 of the 8 */ \ - " BFCNE r5,#0,#16 \n" /* load next 2 of the 8 */ \ - " MRC p0,%[dra],r6,c1,c0,#0 \n" \ - " MRC p0,%[dra],r7,c3,c0,#0 \n" \ - " CMP r2, #0 \n" /* if (length == 0) */ \ - " BNE 1b \n" \ - " LSR r6,r6,#16 \n" /* store fourth two results */ \ - " BFI r7,r6,#0,#16 \n" /* store fourth two results */ \ - " STR r7,[r1],#4 \n" /* store fourth two results */ \ - ::[opcode] "i"(BATCH_OPCODE), \ - [dra] "i"(DOUBLE_READ_ADDERS), [machine] "i"(BATCH_MACHINE)) - -/*! - * @brief Float data vector biquad direct form II calculation. - * - * Biquad filter, the input and output data are float data. Biquad side 0 is used. Example: - * @code - #define VECTOR_LEN 16 - float input[VECTOR_LEN] = {1024.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - float output[VECTOR_LEN]; - pq_biquad_state_t state = - { - .param = - { - .a_1 = xxx, - .a_2 = xxx, - .b_0 = xxx, - .b_1 = xxx, - .b_2 = xxx, - }, - }; - - PQ_BiquadRestoreInternalState(POWERQUAD, 0, &state); - - PQ_Initiate_Vector_Func(pSrc,pDst); - PQ_DF2_Vector8_FP(false,false); - PQ_DF2_Vector8_FP(true,true); - PQ_End_Vector_Func(); - @endcode - * - */ -#define PQ_DF2_Vector8_FP(middle, last) \ - __asm volatile("MCR p0,#0x1,r2,c0,c0,#6"); /* write biquad0*/ \ - if (middle) \ - { \ - __asm volatile("STR r5,[r1],#4"); /* store last result*/ \ - } \ - __asm volatile("LDRD r4,r5,[r0],#8"); /* load next 2 datas */ \ - __asm volatile("MRC p0,#0x1,r2,c0,c0,#0"); /* read biquad0*/ \ - __asm volatile("MCR p0,#0x1,r3,c0,c0,#6"); /* write biquad0 */ \ - __asm volatile("MRC p0,#0x1,r3,c0,c0,#0"); /* read biquad0*/ \ - __asm volatile("MCR p0,#0x1,r4,c0,c0,#6"); /* write biquad0 */ \ - __asm volatile("STRD r2,r3,[r1],#8"); /* store first 2 results */ \ - __asm volatile("MRC p0,#0x1,r4,c0,c0,#0"); \ - __asm volatile("MCR p0,#0x1,r5,c0,c0,#6"); \ - __asm volatile("LDRD r6,r7,[r0],#8"); /* load next 2 datas */ \ - __asm volatile("MRC p0,#0x1,r5,c0,c0,#0"); \ - __asm volatile("MCR p0,#0x1,r6,c0,c0,#6"); \ - __asm volatile("STRD r4,r5,[r1],#8"); /* store next 2 results */ \ - __asm volatile("MRC p0,#0x1,r6,c0,c0,#0"); \ - __asm volatile("MCR p0,#0x1,r7,c0,c0,#6"); \ - __asm volatile("LDRD r4,r5,[r0],#8"); /* load next 2 datas */ \ - __asm volatile("MRC p0,#0x1,r7,c0,c0,#0"); \ - __asm volatile("MCR p0,#0x1,r4,c0,c0,#6"); \ - __asm volatile("STRD r6,r7,[r1],#8"); /* store next 2 results */ \ - __asm volatile("MRC p0,#0x1,r4,c0,c0,#0"); \ - __asm volatile("MCR p0,#0x1,r5,c0,c0,#6"); \ - if (!last) \ - { \ - __asm volatile("LDRD r2,r3,[r0],#8"); /* load first two of next 8 */ \ - } \ - __asm volatile("STR r4,[r1],#4"); \ - __asm volatile("MRC p0,#0x1,r5,c0,c0,#0"); \ - if (last) \ - { \ - __asm volatile("STR r5,[r1],#4"); /* store last result */ \ - } - -/*! - * @brief Fixed data vector biquad direct form II calculation. - * - * Biquad filter, the input and output data are fixed data. Biquad side 0 is used. Example: - * @code - #define VECTOR_LEN 16 - int32_t input[VECTOR_LEN] = {1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - int32_t output[VECTOR_LEN]; - pq_biquad_state_t state = - { - .param = - { - .a_1 = xxx, - .a_2 = xxx, - .b_0 = xxx, - .b_1 = xxx, - .b_2 = xxx, - }, - }; - - PQ_BiquadRestoreInternalState(POWERQUAD, 0, &state); - - PQ_Initiate_Vector_Func(pSrc,pDst); - PQ_DF2_Vector8_FX(false,false); - PQ_DF2_Vector8_FX(true,true); - PQ_End_Vector_Func(); - @endcode - * - */ -#define PQ_DF2_Vector8_FX(middle, last) \ - __asm volatile("MCR p0,#0x1,r2,c1,c0,#6"); /* write biquad0*/ \ - if (middle) \ - { \ - __asm volatile("STR r5,[r1],#4"); /* store last result*/ \ - } \ - __asm volatile("LDRD r4,r5,[r0],#8"); /* load next 2 datas */ \ - __asm volatile("MRC p0,#0x1,r2,c1,c0,#0"); /* read biquad0*/ \ - __asm volatile("MCR p0,#0x1,r3,c1,c0,#6"); /* write biquad0 */ \ - __asm volatile("MRC p0,#0x1,r3,c1,c0,#0"); \ - __asm volatile("MCR p0,#0x1,r4,c1,c0,#6"); \ - __asm volatile("STRD r2,r3,[r1],#8"); /* store first 2 results */ \ - __asm volatile("MRC p0,#0x1,r4,c1,c0,#0"); \ - __asm volatile("MCR p0,#0x1,r5,c1,c0,#6"); \ - __asm volatile("LDRD r6,r7,[r0],#8"); \ - __asm volatile("MRC p0,#0x1,r5,c1,c0,#0"); \ - __asm volatile("MCR p0,#0x1,r6,c1,c0,#6"); \ - __asm volatile("STRD r4,r5,[r1],#8"); /* store next 2 results */ \ - __asm volatile("MRC p0,#0x1,r6,c1,c0,#0"); \ - __asm volatile("MCR p0,#0x1,r7,c1,c0,#6"); \ - __asm volatile("LDRD r4,r5,[r0],#8"); \ - __asm volatile("MRC p0,#0x1,r7,c1,c0,#0"); \ - __asm volatile("MCR p0,#0x1,r4,c1,c0,#6"); \ - __asm volatile("STRD r6,r7,[r1],#8"); /* store next 2 results */ \ - __asm volatile("MRC p0,#0x1,r4,c1,c0,#0"); \ - __asm volatile("MCR p0,#0x1,r5,c1,c0,#6"); \ - if (!last) \ - { \ - __asm volatile("LDRD r2,r3,[r0],#8"); /* load two of next 8 */ \ - } \ - __asm volatile("STR r4,[r1],#4"); /* store 7th results */ \ - __asm volatile("MRC p0,#0x1,r5,c1,c0,#0"); \ - if (last) \ - { \ - __asm volatile("STR r5,[r1],#4"); /* store last result */ \ - } - -/*! - * @brief Float data vector biquad direct form II calculation. - * - * Biquad filter, the input and output data are float data. Biquad side 0 is used. Example: - * @code - #define VECTOR_LEN 8 - float input[VECTOR_LEN] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0}; - float output[VECTOR_LEN]; - pq_biquad_state_t state = - { - .param = - { - .a_1 = xxx, - .a_2 = xxx, - .b_0 = xxx, - .b_1 = xxx, - .b_2 = xxx, - }, - }; - - PQ_BiquadRestoreInternalState(POWERQUAD, 0, &state); - - PQ_StartVector(input, output, VECTOR_LEN); - PQ_Vector8BiquadDf2F32(); - PQ_EndVector(); - @endcode - * - */ -#define PQ_Vector8BiquadDf2F32() \ - __asm volatile( \ - "1: \n" \ - " MCR p0,#0x1,r4,c0,c0,#6 \n" /* write biquad0*/ \ - " CMP r3, #0 \n" \ - " ITE NE \n" \ - " STRNE r7,[r1],#4 \n" /* store last result*/ \ - " MOVEQ r3, #1 \n" /* middle = 1 */ \ - " LDMIA r0!,{r6-r9} \n" /* load next 4 datas */ \ - " MRC p0,#0x1,r4,c0,c0,#0 \n" /* read biquad0*/ \ - " MCR p0,#0x1,r5,c0,c0,#6 \n" /* write biquad0 */ \ - " MRC p0,#0x1,r5,c0,c0,#0 \n" /* read biquad0*/ \ - " MCR p0,#0x1,r6,c0,c0,#6 \n" /* write biquad0 */ \ - " MRC p0,#0x1,r6,c0,c0,#0 \n" /* read biquad0 */ \ - " MCR p0,#0x1,r7,c0,c0,#6 \n" /* write biquad0 */ \ - " MRC p0,#0x1,r7,c0,c0,#0 \n" /* read biquad0 */ \ - " MCR p0,#0x1,r8,c0,c0,#6 \n" /* write biquad0*/ \ - " STMIA r1!,{r4-r7} \n" /* store first four results */ \ - " MRC p0,#0x1,r8,c0,c0,#0 \n" /* read biquad0*/ \ - " MCR p0,#0x1,r9,c0,c0,#6 \n" /* write biquad0*/ \ - " LDRD r6,r7,[r0],#8 \n" /* load next 2 items*/ \ - " MRC p0,#0x1,r9,c0,c0,#0 \n" /* read biquad0*/ \ - " MCR p0,#0x1,r6,c0,c0,#6 \n" /* write biquad0*/ \ - " STRD r8,r9,[r1],#8 \n" /* store third two results */ \ - " MRC p0,#0x1,r6,c0,c0,#0 \n" /* read biquad0*/ \ - " MCR p0,#0x1,r7,c0,c0,#6 \n" /* write biquad0*/ \ - " SUBS r2, r2, #8 \n" /* length -= 8; if (length != 0) */ \ - " IT NE \n" \ - " LDRDNE r4,r5,[r0],#8 \n" /* load first two of next 8 */ \ - " STR r6,[r1],#4 \n" /* store 7th results */ \ - " MRC p0,#0x1,r7,c0,c0,#0 \n" /* read biquad0*/ \ - " CMP r2, #0 \n" /* if (length == 0) */ \ - " BNE 1b \n" \ - " STR r7,[r1],#4 \n" /* store last result */ \ - ) - -/*! - * @brief Fixed 32-bit data vector biquad direct form II calculation. - * - * Biquad filter, the input and output data are Q31 or 32-bit integer. Biquad side 0 is used. Example: - * @code - #define VECTOR_LEN 8 - int32_t input[VECTOR_LEN] = {1, 2, 3, 4, 5, 6, 7, 8}; - int32_t output[VECTOR_LEN]; - pq_biquad_state_t state = - { - .param = - { - .a_1 = xxx, - .a_2 = xxx, - .b_0 = xxx, - .b_1 = xxx, - .b_2 = xxx, - }, - }; - - PQ_BiquadRestoreInternalState(POWERQUAD, 0, &state); - - PQ_StartVector(input, output, VECTOR_LEN); - PQ_Vector8BiquadDf2Fixed32(); - PQ_EndVector(); - @endcode - * - */ -#define PQ_Vector8BiquadDf2Fixed32() \ - __asm volatile( \ - "1: \n" \ - " MCR p0,#0x1,r4,c1,c0,#6 \n" /* write biquad0*/ \ - " CMP r3, #0 \n" \ - " ITE NE \n" \ - " STRNE r7,[r1],#4 \n" /* store last result*/ \ - " MOVEQ r3, #1 \n" /* middle = 1 */ \ - " LDMIA r0!,{r6-r9} \n" /* load next 4 datas */ \ - " MRC p0,#0x1,r4,c1,c0,#0 \n" /* read biquad0*/ \ - " MCR p0,#0x1,r5,c1,c0,#6 \n" /* write biquad0 */ \ - " MRC p0,#0x1,r5,c1,c0,#0 \n" /* read biquad0*/ \ - " MCR p0,#0x1,r6,c1,c0,#6 \n" /* write biquad0 */ \ - " MRC p0,#0x1,r6,c1,c0,#0 \n" /* read biquad0 */ \ - " MCR p0,#0x1,r7,c1,c0,#6 \n" /* write biquad0 */ \ - " MRC p0,#0x1,r7,c1,c0,#0 \n" /* read biquad0 */ \ - " MCR p0,#0x1,r8,c1,c0,#6 \n" /* write biquad0*/ \ - " STMIA r1!,{r4-r7} \n" /* store first four results */ \ - " MRC p0,#0x1,r8,c1,c0,#0 \n" /* read biquad0*/ \ - " MCR p0,#0x1,r9,c1,c0,#6 \n" /* write biquad0*/ \ - " LDRD r6,r7,[r0],#8 \n" /* load next 2 items*/ \ - " MRC p0,#0x1,r9,c1,c0,#0 \n" /* read biquad0*/ \ - " MCR p0,#0x1,r6,c1,c0,#6 \n" /* write biquad0*/ \ - " STRD r8,r9,[r1],#8 \n" /* store third two results */ \ - " MRC p0,#0x1,r6,c1,c0,#0 \n" /* read biquad0*/ \ - " MCR p0,#0x1,r7,c1,c0,#6 \n" /* write biquad0*/ \ - " SUBS r2, r2, #8 \n" /* length -= 8; if (length != 0) */ \ - " IT NE \n" \ - " LDRDNE r4,r5,[r0],#8 \n" /* load first two of next 8 */ \ - " STR r6,[r1],#4 \n" /* store 7th results */ \ - " MRC p0,#0x1,r7,c1,c0,#0 \n" /* read biquad0*/ \ - " CMP r2, #0 \n" /* if (length == 0) */ \ - " BNE 1b \n" \ - " STR r7,[r1],#4 \n" /* store last result */ \ - ) - -/*! - * @brief Fixed 16-bit data vector biquad direct form II calculation. - * - * Biquad filter, the input and output data are Q15 or 16-bit integer. Biquad side 0 is used. Example: - * @code - #define VECTOR_LEN 8 - int16_t input[VECTOR_LEN] = {1, 2, 3, 4, 5, 6, 7, 8}; - int16_t output[VECTOR_LEN]; - pq_biquad_state_t state = - { - .param = - { - .a_1 = xxx, - .a_2 = xxx, - .b_0 = xxx, - .b_1 = xxx, - .b_2 = xxx, - }, - }; - - PQ_BiquadRestoreInternalState(POWERQUAD, 0, &state); - - PQ_StartVector(input, output, VECTOR_LEN); - PQ_Vector8BiquadDf2Fixed16(); - PQ_EndVector(); - @endcode - * - */ -#define PQ_Vector8BiquadDf2Fixed16() \ - __asm volatile( \ - "1: \n" \ - " MCR p0,#0x1,r4,c1,c0,#6 \n" /* write biquad0*/ \ - " CMP r3, #0 \n" \ - " ITE NE \n" \ - " STRHNE r7,[r1],#2 \n" /* store last result*/ \ - " MOVEQ r3, #1 \n" /* middle = 1 */ \ - " LDRSH r6,[r0],#2 \n" /* load next 2 of the 8*/ \ - " LDRSH r7,[r0],#2 \n" /* load next 2 of the 8*/ \ - " MRC p0,#0x1,r4,c1,c0,#0 \n" /* read biquad0*/ \ - " MCR p0,#0x1,r5,c1,c0,#6 \n" /* write biquad0 */ \ - " MRC p0,#0x1,r5,c1,c0,#0 \n" /* read biquad0*/ \ - " LDRSH r8,[r0],#2 \n" /* load next 2 of the 8*/ \ - " LDRSH r9,[r0],#2 \n" /* load next 2 of the 8*/ \ - " MCR p0,#0x1,r6,c1,c0,#6 \n" /* write biquad0 */ \ - " MRC p0,#0x1,r6,c1,c0,#0 \n" /* read biquad0 */ \ - " MCR p0,#0x1,r7,c1,c0,#6 \n" /* write biquad0 */ \ - " MRC p0,#0x1,r7,c1,c0,#0 \n" /* read biquad0 */ \ - " STRH r4,[r1],#2 \n" /* store first 4 results */ \ - " STRH r5,[r1],#2 \n" /* store first 4 results */ \ - " MCR p0,#0x1,r8,c1,c0,#6 \n" /* write biquad0*/ \ - " STRH r6,[r1],#2 \n" /* store first 4 results */ \ - " STRH r7,[r1],#2 \n" /* store first 4 results */ \ - " MRC p0,#0x1,r8,c1,c0,#0 \n" /* read biquad0*/ \ - " MCR p0,#0x1,r9,c1,c0,#6 \n" /* write biquad0*/ \ - " LDRSH r6,[r0],#2 \n" /* load next 1 of the 8*/ \ - " LDRSH r7,[r0],#2 \n" /* load next 1 of the 8*/ \ - " MRC p0,#0x1,r9,c1,c0,#0 \n" /* read biquad0*/ \ - " MCR p0,#0x1,r6,c1,c0,#6 \n" /* write biquad0*/ \ - " STRH r8,[r1],#2 \n" /* store next two results */ \ - " STRH r9,[r1],#2 \n" /* store next two results */ \ - " MRC p0,#0x1,r6,c1,c0,#0 \n" /* read biquad0*/ \ - " MCR p0,#0x1,r7,c1,c0,#6 \n" /* write biquad0*/ \ - " SUBS r2, r2, #8 \n" /* length -= 8; if (length != 0) */ \ - " ITT NE \n" \ - " LDRSHNE r4,[r0],#2 \n" /* load first two of next 8*/ \ - " LDRSHNE r5,[r0],#2 \n" /* load first two of next 8*/ \ - " STRH r6,[r1],#2 \n" /* store 7th results */ \ - " MRC p0,#0x1,r7,c1,c0,#0 \n" /* read biquad0*/ \ - " CMP r2, #0 \n" /* if (length == 0) */ \ - " BNE 1b \n" \ - " STRH r7,[r1],#2 \n" /* store last result */ \ - ) - -/*! - * @brief Float data vector direct form II biquad cascade filter. - * - * The input and output data are float data. The data flow is - * input -> biquad side 1 -> biquad side 0 -> output. - * - * @code - #define VECTOR_LEN 16 - float input[VECTOR_LEN] = {1024.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - float output[VECTOR_LEN]; - pq_biquad_state_t state0 = - { - .param = - { - .a_1 = xxx, - .a_2 = xxx, - .b_0 = xxx, - .b_1 = xxx, - .b_2 = xxx, - }, - }; - - pq_biquad_state_t state1 = - { - .param = - { - .a_1 = xxx, - .a_2 = xxx, - .b_0 = xxx, - .b_1 = xxx, - .b_2 = xxx, - }, - }; - - PQ_BiquadRestoreInternalState(POWERQUAD, 0, &state0); - PQ_BiquadRestoreInternalState(POWERQUAD, 1, &state1); - - PQ_Initiate_Vector_Func(pSrc, pDst); - PQ_DF2_Cascade_Vector8_FP(false, false); - PQ_DF2_Cascade_Vector8_FP(true, true); - PQ_End_Vector_Func(); - @endcode - * - */ -#define PQ_DF2_Cascade_Vector8_FP(middle, last) \ - __asm volatile("MCR p0,#0x1,r2,c2,c0,#6"); /* write biquad1*/ \ - if (middle) \ - { \ - __asm volatile("MCR p0,#0x1,r5,c0,c0,#6"); /* write biquad0*/ \ - __asm volatile("MRRC p0,#0,r5,r2,c1"); /* read both biquad*/ \ - } \ - else \ - { \ - __asm volatile("MRC p0,#0x1,r2,c2,c0,#0"); /* read biquad1*/ \ - } \ - __asm volatile("MCR p0,#0x1,r3,c2,c0,#6"); /* write biquad1*/ \ - __asm volatile("MCR p0,#0x1,r2,c0,c0,#6"); /* write biquad0*/ \ - if (middle) \ - { \ - __asm volatile("STRD r4,r5,[r1],#8"); /* store last two results*/ \ - } \ - __asm volatile("LDRD r4,r5,[r0],#8"); /* load next 2 datas */ \ - __asm volatile("MRRC p0,#0,r2,r3,c1"); /* read both biquad*/ \ - __asm volatile("MCR p0,#0x1,r4,c2,c0,#6"); /* write biquad1*/ \ - __asm volatile("MCR p0,#0x1,r3,c0,c0,#6"); /* write biquad0*/ \ - __asm volatile("LDRD r6,r7,[r0],#8"); \ - __asm volatile("MRRC p0,#0,r3,r4,c1"); \ - __asm volatile("MCR p0,#0x1,r5,c2,c0,#6"); \ - __asm volatile("MCR p0,#0x1,r4,c0,c0,#6"); \ - __asm volatile("STRD r2,r3,[r1],#8"); /* store first two results */ \ - __asm volatile("MRRC p0,#0,r4,r5,c1"); \ - __asm volatile("MCR p0,#0x1,r6,c2,c0,#6"); \ - __asm volatile("MCR p0,#0x1,r5,c0,c0,#6"); \ - __asm volatile("STR r4,[r1],#4"); \ - __asm volatile("MRRC p0,#0,r5,r6,c1"); \ - __asm volatile("MCR p0,#0x1,r7,c2,c0,#6"); \ - __asm volatile("MCR p0,#0x1,r6,c0,c0,#6"); \ - __asm volatile("STR r5,[r1],#4"); \ - __asm volatile("LDRD r4,r5,[r0],#8"); \ - __asm volatile("MRRC p0,#0,r6,r7,c1"); \ - __asm volatile("MCR p0,#0x1,r4,c2,c0,#6"); \ - __asm volatile("MCR p0,#0x1,r7,c0,c0,#6"); \ - if (!last) \ - { \ - __asm volatile("LDRD r2,r3,[r0],#8"); /* load first two of next 8 */ \ - } \ - __asm volatile("MRRC p0,#0,r7,r4,c1"); \ - __asm volatile("MCR p0,#0x1,r5,c2,c0,#6"); \ - __asm volatile("MCR p0,#0x1,r4,c0,c0,#6"); \ - __asm volatile("STRD r6,r7,[r1],#8"); /* store third two results */ \ - __asm volatile("MRRC p0,#0,r4,r5,c1"); \ - if (last) \ - { \ - __asm volatile("MCR p0,#0x1,r5,c0,c0,#6"); /* write biquad0*/ \ - __asm volatile("MRC p0,#0x1,r5,c0,c0,#0"); /* read biquad0*/ \ - __asm volatile("STRD r4,r5,[r1],#8"); /* store fourth two results */ \ - } - -/*! - * @brief Fixed data vector direct form II biquad cascade filter. - * - * The input and output data are fixed data. The data flow is - * input -> biquad side 1 -> biquad side 0 -> output. - * - * @code - #define VECTOR_LEN 16 - int32_t input[VECTOR_LEN] = {1024.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - int32_t output[VECTOR_LEN]; - pq_biquad_state_t state0 = - { - .param = - { - .a_1 = xxx, - .a_2 = xxx, - .b_0 = xxx, - .b_1 = xxx, - .b_2 = xxx, - }, - }; - - pq_biquad_state_t state1 = - { - .param = - { - .a_1 = xxx, - .a_2 = xxx, - .b_0 = xxx, - .b_1 = xxx, - .b_2 = xxx, - }, - }; - - PQ_BiquadRestoreInternalState(POWERQUAD, 0, &state0); - PQ_BiquadRestoreInternalState(POWERQUAD, 1, &state1); - - PQ_Initiate_Vector_Func(pSrc, pDst); - PQ_DF2_Cascade_Vector8_FX(false, false); - PQ_DF2_Cascade_Vector8_FX(true, true); - PQ_End_Vector_Func(); - @endcode - * - */ -#define PQ_DF2_Cascade_Vector8_FX(middle, last) \ - __asm volatile("MCR p0,#0x1,r2,c3,c0,#6"); /* write biquad1*/ \ - if (middle) \ - { \ - __asm volatile("MCR p0,#0x1,r5,c1,c0,#6"); /* write biquad0*/ \ - __asm volatile("MRC p0,#0x1,r5,c1,c0,#0"); /* read biquad0*/ \ - __asm volatile("MRC p0,#0x1,r2,c3,c0,#0"); /* read biquad1*/ \ - } \ - else \ - { \ - __asm volatile("MRC p0,#0x1,r2,c3,c0,#0"); /* read biquad1*/ \ - } \ - __asm volatile("MCR p0,#0x1,r3,c3,c0,#6"); /* write biquad1*/ \ - __asm volatile("MCR p0,#0x1,r2,c1,c0,#6"); /* write biquad0*/ \ - if (middle) \ - { \ - __asm volatile("STRD r4,r5,[r1],#8"); /* store last two results*/ \ - } \ - __asm volatile("LDRD r4,r5,[r0],#8"); /* load next 2 datas */ \ - __asm volatile("MRC p0,#0x1,r2,c1,c0,#0"); /* read biquad0*/ \ - __asm volatile("MRC p0,#0x1,r3,c3,c0,#0"); /* read biquad1*/ \ - __asm volatile("MCR p0,#0x1,r4,c3,c0,#6"); /* write biquad1*/ \ - __asm volatile("MCR p0,#0x1,r3,c1,c0,#6"); /* write biquad0*/ \ - __asm volatile("LDRD r6,r7,[r0],#8"); \ - __asm volatile("MRC p0,#0x1,r3,c1,c0,#0"); \ - __asm volatile("MRC p0,#0x1,r4,c3,c0,#0"); \ - __asm volatile("MCR p0,#0x1,r5,c3,c0,#6"); \ - __asm volatile("MCR p0,#0x1,r4,c1,c0,#6"); \ - __asm volatile("STRD r2,r3,[r1],#8"); \ - __asm volatile("MRC p0,#0x1,r4,c1,c0,#0"); \ - __asm volatile("MRC p0,#0x1,r5,c3,c0,#0"); \ - __asm volatile("MCR p0,#0x1,r6,c3,c0,#6"); \ - __asm volatile("MCR p0,#0x1,r5,c1,c0,#6"); \ - __asm volatile("STR r4,[r1],#4"); \ - __asm volatile("MRC p0,#0x1,r5,c1,c0,#0"); \ - __asm volatile("MRC p0,#0x1,r6,c3,c0,#0"); \ - __asm volatile("MCR p0,#0x1,r7,c3,c0,#6"); \ - __asm volatile("MCR p0,#0x1,r6,c1,c0,#6"); \ - __asm volatile("STR r5,[r1],#4"); \ - __asm volatile("LDRD r4,r5,[r0],#8"); \ - __asm volatile("MRC p0,#0x1,r6,c1,c0,#0"); \ - __asm volatile("MRC p0,#0x1,r7,c3,c0,#0"); \ - __asm volatile("MCR p0,#0x1,r4,c3,c0,#6"); \ - __asm volatile("MCR p0,#0x1,r7,c1,c0,#6"); \ - if (!last) \ - { \ - __asm volatile("LDRD r2,r3,[r0],#8"); /* load first two of next 8 */ \ - } \ - __asm volatile("MRC p0,#0x1,r7,c1,c0,#0"); \ - __asm volatile("MRC p0,#0x1,r4,c3,c0,#0"); \ - __asm volatile("MCR p0,#0x1,r5,c3,c0,#6"); \ - __asm volatile("MCR p0,#0x1,r4,c1,c0,#6"); \ - __asm volatile("STRD r6,r7,[r1],#8"); /* store third two results */ \ - __asm volatile("MRC p0,#0x1,r4,c1,c0,#0"); /* read biquad0*/ \ - __asm volatile("MRC p0,#0x1,r5,c3,c0,#0"); /* read biquad1*/ \ - if (last) \ - { \ - __asm volatile("MCR p0,#0x1,r5,c1,c0,#6"); /* write biquad0*/ \ - __asm volatile("MRC p0,#0x1,r5,c1,c0,#0"); /* read biquad0*/ \ - __asm volatile("STRD r4,r5,[r1],#8"); /* store fourth two results */ \ - } - -/*! - * @brief Float data vector direct form II biquad cascade filter. - * - * The input and output data are float data. The data flow is - * input -> biquad side 1 -> biquad side 0 -> output. - * - * @code - #define VECTOR_LEN 8 - float input[VECTOR_LEN] = {1, 2, 3, 4, 5, 6, 7, 8}; - float output[VECTOR_LEN]; - pq_biquad_state_t state0 = - { - .param = - { - .a_1 = xxx, - .a_2 = xxx, - .b_0 = xxx, - .b_1 = xxx, - .b_2 = xxx, - }, - }; - - pq_biquad_state_t state1 = - { - .param = - { - .a_1 = xxx, - .a_2 = xxx, - .b_0 = xxx, - .b_1 = xxx, - .b_2 = xxx, - }, - }; - - PQ_BiquadRestoreInternalState(POWERQUAD, 0, &state0); - PQ_BiquadRestoreInternalState(POWERQUAD, 1, &state1); - - PQ_StartVector(input, output, VECTOR_LEN); - PQ_Vector8BiquadDf2CascadeF32(); - PQ_EndVector(); - @endcode - * - */ -#define PQ_Vector8BiquadDf2CascadeF32() \ - __asm volatile( \ - "1: \n" \ - " MCR p0,#0x1,r4,c2,c0,#2 \n" /* write biquad1*/ \ - " CMP r3, #0 \n" \ - " ITTE NE \n" \ - " MCRNE p0,#0x1,r7,c0,c0,#2 \n" /* write biquad0*/ \ - " MRRCNE p0,#0,r7,r4,c1 \n" /* read both biquad*/ \ - " MRCEQ p0,#0x1,r4,c2,c0,#0 \n" /* read biquad1*/ \ - " MCR p0,#0x1,r5,c2,c0,#2 \n" /* write biquad1*/ \ - " MCR p0,#0x1,r4,c0,c0,#2 \n" /* write biquad0*/ \ - " CMP r3, #0 \n" \ - " ITE NE \n" \ - " STRDNE r6,r7,[r1],#8 \n" /* store last two results*/ \ - " MOVEQ r3, #1 \n" /* middle = 1 */ \ - " LDMIA r0!,{r6-r9} \n" /* load next 4 datas */ \ - " MRRC p0,#0,r4,r5,c1 \n" /* read both biquad*/ \ - " MCR p0,#0x1,r6,c2,c0,#2 \n" /* write biquad1*/ \ - " MCR p0,#0x1,r5,c0,c0,#2 \n" /* write biquad0*/ \ - " MRRC p0,#0,r5,r6,c1 \n" /* read both biquad*/ \ - " MCR p0,#0x1,r7,c2,c0,#2 \n" /* write biquad1*/ \ - " MCR p0,#0x1,r6,c0,c0,#2 \n" /* write biquad0*/ \ - " MRRC p0,#0,r6,r7,c1 \n" /* read both biquad*/ \ - " MCR p0,#0x1,r8,c2,c0,#2 \n" /* write biquad1*/ \ - " MCR p0,#0x1,r7,c0,c0,#2 \n" /* write biquad0*/ \ - " MRRC p0,#0,r7,r8,c1 \n" /* read both biquad*/ \ - " MCR p0,#0x1,r9,c2,c0,#2 \n" /* write biquad1*/ \ - " MCR p0,#0x1,r8,c0,c0,#2 \n" /* write biquad0*/ \ - " STMIA r1!,{R4-R7} \n" /* store first and second two results */ \ - " LDRD r6,r7,[r0],#8 \n" /* load last 2 of the 8 */ \ - " MRRC p0,#0,r8,r9,c1 \n" /* read both biquad*/ \ - " MCR p0,#0x1,r6,c2,c0,#2 \n" /* write biquad1*/ \ - " MCR p0,#0x1,r9,c0,c0,#2 \n" /* write biquad0*/ \ - " SUBS r2, r2, #8 \n" /* length -= 8; if (length != 0) */ \ - " IT NE \n" \ - " LDRDNE r4,r5,[r0],#8 \n" /* load first two of next 8 */ \ - " MRRC p0,#0,r9,r6,c1 \n" /* read both biquad*/ \ - " MCR p0,#0x1,r7,c2,c0,#2 \n" /* write biquad1*/ \ - " MCR p0,#0x1,r6,c0,c0,#2 \n" /* write biquad0*/ \ - " STRD r8,r9,[r1],#8 \n" /* store third two results */ \ - " MRRC p0,#0,r6,r7,c1 \n" /* read both biquad*/ \ - " CMP r2, #0 \n" /* if (length == 0) */ \ - " BNE 1b \n" \ - " MCR p0,#0x1,r7,c0,c0,#2 \n" /* write biquad0*/ \ - " MRC p0,#0x1,r7,c0,c0,#0 \n" /* read biquad0*/ \ - " STRD r6,r7,[r1],#8 \n" /* store fourth two results */ \ - ) - -/*! - * @brief Fixed 32-bit data vector direct form II biquad cascade filter. - * - * The input and output data are fixed 32-bit data. The data flow is - * input -> biquad side 1 -> biquad side 0 -> output. - * - * @code - #define VECTOR_LEN 8 - int32_t input[VECTOR_LEN] = {1, 2, 3, 4, 5, 6, 7, 8}; - int32_t output[VECTOR_LEN]; - pq_biquad_state_t state0 = - { - .param = - { - .a_1 = xxx, - .a_2 = xxx, - .b_0 = xxx, - .b_1 = xxx, - .b_2 = xxx, - }, - }; - - pq_biquad_state_t state1 = - { - .param = - { - .a_1 = xxx, - .a_2 = xxx, - .b_0 = xxx, - .b_1 = xxx, - .b_2 = xxx, - }, - }; - - PQ_BiquadRestoreInternalState(POWERQUAD, 0, &state0); - PQ_BiquadRestoreInternalState(POWERQUAD, 1, &state1); - - PQ_StartVector(input, output, VECTOR_LEN); - PQ_Vector8BiquadDf2CascadeFixed32(); - PQ_EndVector(); - @endcode - * - */ -#define PQ_Vector8BiquadDf2CascadeFixed32() \ - __asm volatile( \ - "1: \n" \ - " MCR p0,#0x1,r4,c3,c0,#6 \n" /* write biquad1*/ \ - " CMP r3, #0 \n" \ - " ITTTE NE \n" \ - " MCRNE p0,#0x1,r7,c1,c0,#6 \n" /* write biquad0*/ \ - " MRCNE p0,#0x1,r7,c1,c0,#0 \n" /* read biquad0*/ \ - " MRCNE p0,#0x1,r4,c3,c0,#0 \n" /* read biquad1*/ \ - " MRCEQ p0,#0x1,r4,c3,c0,#0 \n" /* read biquad1*/ \ - " MCR p0,#0x1,r5,c3,c0,#6 \n" /* write biquad1*/ \ - " MCR p0,#0x1,r4,c1,c0,#6 \n" /* write biquad0*/ \ - " CMP r3, #0 \n" \ - " ITE NE \n" \ - " STRDNE r6,r7,[r1],#8 \n" /* store last two results*/ \ - " MOVEQ r3, #1 \n" /* middle = 1 */ \ - " LDMIA r0!,{r6-r9} \n" /* load next 4 datas */ \ - " MRC p0,#0x1,r4,c1,c0,#0 \n" /* read biquad0*/ \ - " MRC p0,#0x1,r5,c3,c0,#0 \n" /* read biquad1*/ \ - " MCR p0,#0x1,r6,c3,c0,#6 \n" /* write biquad1*/ \ - " MCR p0,#0x1,r5,c1,c0,#6 \n" /* write biquad0*/ \ - " MRC p0,#0x1,r5,c1,c0,#0 \n" /* read biquad0*/ \ - " MRC p0,#0x1,r6,c3,c0,#0 \n" /* read biquad1*/ \ - " MCR p0,#0x1,r7,c3,c0,#6 \n" /* write biquad1*/ \ - " MCR p0,#0x1,r6,c1,c0,#6 \n" /* write biquad0*/ \ - " MRC p0,#0x1,r6,c1,c0,#0 \n" /* read biquad0*/ \ - " MRC p0,#0x1,r7,c3,c0,#0 \n" /* read biquad1*/ \ - " MCR p0,#0x1,r8,c3,c0,#6 \n" /* write biquad1*/ \ - " MCR p0,#0x1,r7,c1,c0,#6 \n" /* write biquad0*/ \ - " MRC p0,#0x1,r7,c1,c0,#0 \n" /* read biquad0*/ \ - " MRC p0,#0x1,r8,c3,c0,#0 \n" /* read biquad1*/ \ - " MCR p0,#0x1,r9,c3,c0,#6 \n" /* write biquad1*/ \ - " MCR p0,#0x1,r8,c1,c0,#6 \n" /* write biquad0*/ \ - " STMIA r1!,{R4-R7} \n" /* store first and second two results */ \ - " LDRD r6,r7,[r0],#8 \n" /* load last 2 of the 8 */ \ - " MRC p0,#0x1,r8,c1,c0,#0 \n" /* read biquad0*/ \ - " MRC p0,#0x1,r9,c3,c0,#0 \n" /* read biquad1*/ \ - " MCR p0,#0x1,r6,c3,c0,#6 \n" /* write biquad1*/ \ - " MCR p0,#0x1,r9,c1,c0,#6 \n" /* write biquad0*/ \ - " SUBS r2, r2, #8 \n" /* length -= 8; if (length != 0) */ \ - " IT NE \n" \ - " LDRDNE r4,r5,[r0],#8 \n" /* load first two of next 8 */ \ - " MRC p0,#0x1,r9,c1,c0,#0 \n" /* read biquad0*/ \ - " MRC p0,#0x1,r6,c3,c0,#0 \n" /* read biquad1*/ \ - " MCR p0,#0x1,r7,c3,c0,#6 \n" /* write biquad1*/ \ - " MCR p0,#0x1,r6,c1,c0,#6 \n" /* write biquad0*/ \ - " STRD r8,r9,[r1],#8 \n" /* store third two results */ \ - " MRC p0,#0x1,r6,c1,c0,#0 \n" /* read biquad0*/ \ - " MRC p0,#0x1,r7,c3,c0,#0 \n" /* read biquad1*/ \ - " CMP r2, #0 \n" /* if (length == 0) */ \ - " BNE 1b \n" \ - " MCR p0,#0x1,r7,c1,c0,#6 \n" /* write biquad0*/ \ - " MRC p0,#0x1,r7,c1,c0,#0 \n" /* read biquad0*/ \ - " STRD r6,r7,[r1],#8 \n" /* store fourth two results */ \ - ) - -/*! - * @brief Fixed 16-bit data vector direct form II biquad cascade filter. - * - * The input and output data are fixed 16-bit data. The data flow is - * input -> biquad side 1 -> biquad side 0 -> output. - * - * @code - #define VECTOR_LEN 8 - int32_t input[VECTOR_LEN] = {1, 2, 3, 4, 5, 6, 7, 8}; - int32_t output[VECTOR_LEN]; - pq_biquad_state_t state0 = - { - .param = - { - .a_1 = xxx, - .a_2 = xxx, - .b_0 = xxx, - .b_1 = xxx, - .b_2 = xxx, - }, - }; - - pq_biquad_state_t state1 = - { - .param = - { - .a_1 = xxx, - .a_2 = xxx, - .b_0 = xxx, - .b_1 = xxx, - .b_2 = xxx, - }, - }; - - PQ_BiquadRestoreInternalState(POWERQUAD, 0, &state0); - PQ_BiquadRestoreInternalState(POWERQUAD, 1, &state1); - - PQ_StartVector(input, output, VECTOR_LEN); - PQ_Vector8BiquadDf2CascadeFixed16(); - PQ_EndVector(); - @endcode - * - */ -#define PQ_Vector8BiquadDf2CascadeFixed16() \ - __asm volatile( \ - "1: \n" \ - " MCR p0,#0x1,r4,c3,c0,#6 \n" /* write biquad1*/ \ - " CMP r3, #0 \n" \ - " ITTTE NE \n" \ - " MCRNE p0,#0x1,r7,c1,c0,#6 \n" /* write biquad0*/ \ - " MRCNE p0,#0x1,r7,c1,c0,#0 \n" /* read biquad0*/ \ - " MRCNE p0,#0x1,r4,c3,c0,#0 \n" /* read biquad1*/ \ - " MRCEQ p0,#0x1,r4,c3,c0,#0 \n" /* read biquad1*/ \ - " MCR p0,#0x1,r5,c3,c0,#6 \n" /* write biquad1*/ \ - " MCR p0,#0x1,r4,c1,c0,#6 \n" /* write biquad0*/ \ - " CMP r3, #0 \n" \ - " ITTE NE \n" \ - " STRHNE r6,[r1],#2 \n" /* store last two results*/ \ - " STRHNE r7,[r1],#2 \n" /* store last two results*/ \ - " MOVEQ r3, #1 \n" /* middle = 1 */ \ - " LDRSH r6,[r0],#2 \n" /* load next 2 of the 8*/ \ - " LDRSH r7,[r0],#2 \n" /* load next 2 of the 8*/ \ - " MRC p0,#0x1,r4,c1,c0,#0 \n" /* read biquad0*/ \ - " MRC p0,#0x1,r5,c3,c0,#0 \n" /* read biquad1*/ \ - " MCR p0,#0x1,r6,c3,c0,#6 \n" /* write biquad1*/ \ - " MCR p0,#0x1,r5,c1,c0,#6 \n" /* write biquad0*/ \ - " MRC p0,#0x1,r5,c1,c0,#0 \n" /* read biquad0*/ \ - " MRC p0,#0x1,r6,c3,c0,#0 \n" /* read biquad1*/ \ - " LDRSH r8,[r0],#2 \n" /* load next 2 of the 8*/ \ - " LDRSH r9,[r0],#2 \n" /* load next 2 of the 8*/ \ - " MCR p0,#0x1,r7,c3,c0,#6 \n" /* write biquad1*/ \ - " MCR p0,#0x1,r6,c1,c0,#6 \n" /* write biquad0*/ \ - " MRC p0,#0x1,r6,c1,c0,#0 \n" /* read biquad0*/ \ - " MRC p0,#0x1,r7,c3,c0,#0 \n" /* read biquad1*/ \ - " STRH r4,[r1],#2 \n" /* store first 4 results */ \ - " STRH r5,[r1],#2 \n" /* store first 4 results */ \ - " MCR p0,#0x1,r8,c3,c0,#6 \n" /* write biquad1*/ \ - " MCR p0,#0x1,r7,c1,c0,#6 \n" /* write biquad0*/ \ - " MRC p0,#0x1,r7,c1,c0,#0 \n" /* read biquad0*/ \ - " MRC p0,#0x1,r8,c3,c0,#0 \n" /* read biquad1*/ \ - " MCR p0,#0x1,r9,c3,c0,#6 \n" /* write biquad1*/ \ - " MCR p0,#0x1,r8,c1,c0,#6 \n" /* write biquad0*/ \ - " STRH r6,[r1],#2 \n" /* store first 4 results */ \ - " STRH r7,[r1],#2 \n" /* store first 4 results */ \ - " LDRSH r6,[r0],#2 \n" /* load last 2 of the 8*/ \ - " LDRSH r7,[r0],#2 \n" /* load last 2 of the 8*/ \ - " MRC p0,#0x1,r8,c1,c0,#0 \n" /* read biquad0*/ \ - " MRC p0,#0x1,r9,c3,c0,#0 \n" /* read biquad1*/ \ - " MCR p0,#0x1,r6,c3,c0,#6 \n" /* write biquad1*/ \ - " MCR p0,#0x1,r9,c1,c0,#6 \n" /* write biquad0*/ \ - " SUBS r2, r2, #8 \n" /* length -= 8; if (length != 0) */ \ - " ITT NE \n" \ - " LDRSHNE r4,[r0],#2 \n" /* load first two of next 8*/ \ - " LDRSHNE r5,[r0],#2 \n" /* load first two of next 8*/ \ - " MRC p0,#0x1,r9,c1,c0,#0 \n" /* read biquad0*/ \ - " MRC p0,#0x1,r6,c3,c0,#0 \n" /* read biquad1*/ \ - " MCR p0,#0x1,r7,c3,c0,#6 \n" /* write biquad1*/ \ - " MCR p0,#0x1,r6,c1,c0,#6 \n" /* write biquad0*/ \ - " STRH r8,[r1],#2 \n" /* store third two results */ \ - " STRH r9,[r1],#2 \n" /* store third two results */ \ - " MRC p0,#0x1,r6,c1,c0,#0 \n" /* read biquad0*/ \ - " MRC p0,#0x1,r7,c3,c0,#0 \n" /* read biquad1*/ \ - " CMP r2, #0 \n" /* if (length == 0) */ \ - " BNE 1b \n" \ - " MCR p0,#0x1,r7,c1,c0,#6 \n" /* write biquad0*/ \ - " MRC p0,#0x1,r7,c1,c0,#0 \n" /* read biquad0*/ \ - " STRH r6,[r1],#2 \n" /* store fourth two results */ \ - " STRH r7,[r1],#2 \n" /* store fourth two results */ \ - ) - -/*! @brief Make the length used for matrix functions. */ -#define POWERQUAD_MAKE_MATRIX_LEN(mat1Row, mat1Col, mat2Col) \ - (((uint32_t)(mat1Row) << 0U) | ((uint32_t)(mat1Col) << 8U) | ((uint32_t)(mat2Col) << 16U)) - -/*! @brief Convert Q31 to float. */ -#define PQ_Q31_2_FLOAT(x) (((float)(x)) / 2147483648.0f) - -/*! @brief Convert Q15 to float. */ -#define PQ_Q15_2_FLOAT(x) (((float)(x)) / 32768.0f) - -/*! @brief powerquad computation engine */ -typedef enum -{ - kPQ_CP_PQ = 0, /*!< Math engine.*/ - kPQ_CP_MTX = 1, /*!< Matrix engine.*/ - kPQ_CP_FFT = 2, /*!< FFT engine.*/ - kPQ_CP_FIR = 3, /*!< FIR engine.*/ - kPQ_CP_CORDIC = 5 /*!< CORDIC engine.*/ -} pq_computationengine_t; - -/*! @brief powerquad data structure format type */ -typedef enum -{ - kPQ_16Bit = 0, /*!< Int16 Fixed point.*/ - kPQ_32Bit = 1, /*!< Int32 Fixed point.*/ - kPQ_Float = 2 /*!< Float point.*/ -} pq_format_t; - -/*! @brief Coprocessor prescale */ -typedef struct -{ - int8_t inputPrescale; /*!< Input prescale.*/ - int8_t outputPrescale; /*!< Output prescale.*/ - int8_t outputSaturate; /*!< Output saturate at n bits, for example 0x11 is 8 bit space, - the value will be truncated at +127 or -128.*/ -} pq_prescale_t; - -/*! @brief powerquad data structure format */ -typedef struct -{ - pq_format_t inputAFormat; /*!< Input A format.*/ - int8_t inputAPrescale; /*!< Input A prescale, for example 1.5 can be 1.5*2^n if you scale by 'shifting' - ('scaling' by a factor of n).*/ - pq_format_t inputBFormat; /*!< Input B format.*/ - int8_t inputBPrescale; /*!< Input B prescale.*/ - pq_format_t outputFormat; /*!< Out format.*/ - int8_t outputPrescale; /*!< Out prescale.*/ - pq_format_t tmpFormat; /*!< Temp format.*/ - int8_t tmpPrescale; /*!< Temp prescale.*/ - pq_format_t machineFormat; /*!< Machine format.*/ - uint32_t *tmpBase; /*!< Tmp base address.*/ -} pq_config_t; - -/*! @brief Struct to save biquad parameters. */ -typedef struct _pq_biquad_param -{ - float v_n_1; /*!< v[n-1], set to 0 when initialization. */ - float v_n; /*!< v[n], set to 0 when initialization. */ - float a_1; /*!< a[1] */ - float a_2; /*!< a[2] */ - float b_0; /*!< b[0] */ - float b_1; /*!< b[1] */ - float b_2; /*!< b[2] */ -} pq_biquad_param_t; - -/*! @brief Struct to save biquad state. */ -typedef struct _pq_biquad_state -{ - pq_biquad_param_t param; /*!< Filter parameter. */ - uint32_t compreg; /*!< Internal register, set to 0 when initialization. */ -} pq_biquad_state_t; - -/*! @brief Instance structure for the direct form II Biquad cascade filter */ -typedef struct -{ - uint8_t numStages; /**< Number of 2nd order stages in the filter.*/ - pq_biquad_state_t *pState; /**< Points to the array of state coefficients.*/ -} pq_biquad_cascade_df2_instance; - -/*! @brief CORDIC iteration */ -typedef enum -{ - kPQ_Iteration_8 = 0, /*!< Iterate 8 times.*/ - kPQ_Iteration_16, /*!< Iterate 16 times.*/ - kPQ_Iteration_24 /*!< Iterate 24 times.*/ -} pq_cordic_iter_t; - -/*! @brief Conversion between integer and float type */ -typedef union _pq_float -{ - float floatX; /*!< Float type.*/ - uint32_t integerX; /*!< Unsigned interger type.*/ -} pq_float_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name POWERQUAD functional Operation - * @{ - */ - -/*! - * @brief Get default configuration. - * - * This function initializes the POWERQUAD configuration structure to a default value. - * FORMAT register field definitions - * Bits[15:8] scaler (for scaled 'q31' formats) - * Bits[5:4] external format. 00b=q15, 01b=q31, 10b=float - * Bits[1:0] internal format. 00b=q15, 01b=q31, 10b=float - * POWERQUAD->INAFORMAT = (config->inputAPrescale << 8U) | (config->inputAFormat << 4U) | config->machineFormat - * - * For all Powerquad operations internal format must be float (with the only exception being - * the FFT related functions, ie FFT/IFFT/DCT/IDCT which must be set to q31). - * The default values are: - * config->inputAFormat = kPQ_Float; - * config->inputAPrescale = 0; - * config->inputBFormat = kPQ_Float; - * config->inputBPrescale = 0; - * config->outputFormat = kPQ_Float; - * config->outputPrescale = 0; - * config->tmpFormat = kPQ_Float; - * config->tmpPrescale = 0; - * config->machineFormat = kPQ_Float; - * config->tmpBase = 0xE0000000; - * - * @param config Pointer to "pq_config_t" structure. - */ -void PQ_GetDefaultConfig(pq_config_t *config); - -/*! - * @brief Set configuration with format/prescale. - * - * @param base POWERQUAD peripheral base address - * @param config Pointer to "pq_config_t" structure. - */ -void PQ_SetConfig(POWERQUAD_Type *base, const pq_config_t *config); - -/*! - * @brief set coprocessor scaler for coprocessor instructions, this function is used to - * set output saturation and scaleing for input/output. - * - * @param base POWERQUAD peripheral base address - * @param prescale Pointer to "pq_prescale_t" structure. - */ -static inline void PQ_SetCoprocessorScaler(POWERQUAD_Type *base, const pq_prescale_t *prescale) -{ - assert(NULL != prescale); - - base->CPPRE = POWERQUAD_CPPRE_CPPRE_IN(prescale->inputPrescale) | - POWERQUAD_CPPRE_CPPRE_OUT(prescale->outputPrescale) | - ((uint32_t)prescale->outputSaturate << POWERQUAD_CPPRE_CPPRE_SAT_SHIFT); -} - -/*! - * @brief Initializes the POWERQUAD module. - * - * @param base POWERQUAD peripheral base address. - */ -void PQ_Init(POWERQUAD_Type *base); - -/*! - * @brief De-initializes the POWERQUAD module. - * - * @param base POWERQUAD peripheral base address. - */ -void PQ_Deinit(POWERQUAD_Type *base); - -/*! - * @brief Set format for non-coprecessor instructions. - * - * @param base POWERQUAD peripheral base address - * @param engine Computation engine - * @param format Data format - */ -void PQ_SetFormat(POWERQUAD_Type *base, pq_computationengine_t engine, pq_format_t format); - -/*! - * @brief Wait for the completion. - * - * @param base POWERQUAD peripheral base address - */ -static inline void PQ_WaitDone(POWERQUAD_Type *base) -{ - /* wait for the completion */ - while ((base->CONTROL & INST_BUSY) == INST_BUSY) - { - __WFE(); - } -} - -/*! - * @brief Processing function for the floating-point natural log. - * - * @param *pSrc points to the block of input data. The range of the input value is (0 +INFINITY). - * @param *pDst points to the block of output data - */ -static inline void PQ_LnF32(float *pSrc, float *pDst) -{ - pq_float_t val; - - val.floatX = *pSrc; - _pq_ln0(val.integerX); - val.integerX = _pq_readAdd0(); - *pDst = val.floatX; -} - -/*! - * @brief Processing function for the floating-point reciprocal. - * - * @param *pSrc points to the block of input data. The range of the input value is non-zero. - * @param *pDst points to the block of output data - */ -static inline void PQ_InvF32(float *pSrc, float *pDst) -{ - pq_float_t val; - - val.floatX = *pSrc; - _pq_inv0(val.integerX); - val.integerX = _pq_readMult0(); - *pDst = val.floatX; -} - -/*! - * @brief Processing function for the floating-point square-root. - * - * @param *pSrc points to the block of input data. The range of the input value is [0 +INFINITY). - * @param *pDst points to the block of output data - */ -static inline void PQ_SqrtF32(float *pSrc, float *pDst) -{ - pq_float_t val; - - val.floatX = *pSrc; - _pq_sqrt0(val.integerX); - val.integerX = _pq_readMult0(); - *pDst = val.floatX; -} - -/*! - * @brief Processing function for the floating-point inverse square-root. - * - * @param *pSrc points to the block of input data. The range of the input value is (0 +INFINITY). - * @param *pDst points to the block of output data - */ -static inline void PQ_InvSqrtF32(float *pSrc, float *pDst) -{ - pq_float_t val; - - val.floatX = *pSrc; - _pq_invsqrt0(val.integerX); - val.integerX = _pq_readMult0(); - *pDst = val.floatX; -} - -/*! - * @brief Processing function for the floating-point natural exponent. - * - * @param *pSrc points to the block of input data. The range of the input value is (-INFINITY +INFINITY). - * @param *pDst points to the block of output data - */ -static inline void PQ_EtoxF32(float *pSrc, float *pDst) -{ - pq_float_t val; - - val.floatX = *pSrc; - _pq_etox0(val.integerX); - val.integerX = _pq_readMult0(); - *pDst = val.floatX; -} - -/*! - * @brief Processing function for the floating-point natural exponent with negative parameter. - * - * @param *pSrc points to the block of input data. The range of the input value is (-INFINITY +INFINITY). - * @param *pDst points to the block of output data - */ -static inline void PQ_EtonxF32(float *pSrc, float *pDst) -{ - pq_float_t val; - - val.floatX = *pSrc; - _pq_etonx0(val.integerX); - val.integerX = _pq_readMult0(); - *pDst = val.floatX; -} - -/*! - * @brief Processing function for the floating-point sine. - * - * @param *pSrc points to the block of input data. The input value is in radians, the range is (-INFINITY - * +INFINITY). - * @param *pDst points to the block of output data - */ -static inline void PQ_SinF32(float *pSrc, float *pDst) -{ - pq_float_t val; - - val.floatX = *pSrc; - _pq_sin0(val.integerX); - val.integerX = _pq_readAdd0(); - *pDst = val.floatX; -} - -/*! - * @brief Processing function for the floating-point cosine. - * - * @param *pSrc points to the block of input data. The input value is in radians, the range is (-INFINITY - * +INFINITY). - * @param *pDst points to the block of output data - */ -static inline void PQ_CosF32(float *pSrc, float *pDst) -{ - pq_float_t val; - - val.floatX = *pSrc; - _pq_cos0(val.integerX); - val.integerX = _pq_readAdd0(); - *pDst = val.floatX; -} - -/*! - * @brief Processing function for the floating-point biquad. - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - */ -static inline void PQ_BiquadF32(float *pSrc, float *pDst) -{ - pq_float_t val; - - val.floatX = *pSrc; - _pq_biquad0(val.integerX); - val.integerX = _pq_readAdd0(); - *pDst = val.floatX; -} - -/*! - * @brief Processing function for the floating-point division. - * - * Get x1 / x2. - * - * @param x1 x1 - * @param x2 x2 - * @param *pDst points to the block of output data - */ -static inline void PQ_DivF32(float *x1, float *x2, float *pDst) -{ - pq_float_t X1; - pq_float_t X2; - - X1.floatX = *x1; - X2.floatX = *x2; - uint64_t input = (uint64_t)(X2.integerX) | ((uint64_t)(X1.integerX) << 32U); - - _pq_div0(input); - X1.integerX = _pq_readMult0(); - *pDst = X1.floatX; -} - -/*! - * @brief Processing function for the floating-point biquad. - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - */ -static inline void PQ_Biquad1F32(float *pSrc, float *pDst) -{ - pq_float_t val; - - val.floatX = *pSrc; - _pq_biquad1(val.integerX); - val.integerX = _pq_readAdd1(); - *pDst = val.floatX; -} - -/*! - * @brief Processing function for the fixed natural log. - * - * @param val value to be calculated. The range of the input value is (0 +INFINITY). - * @return returns ln(val). - */ -static inline int32_t PQ_LnFixed(int32_t val) -{ - _pq_ln_fx0(val); - return (int32_t)_pq_readAdd0_fx(); -} - -/*! - * @brief Processing function for the fixed reciprocal. - * - * @param val value to be calculated. The range of the input value is non-zero. - * @return returns inv(val). - */ -static inline int32_t PQ_InvFixed(int32_t val) -{ - _pq_inv_fx0(val); - return (int32_t)_pq_readMult0_fx(); -} - -/*! - * @brief Processing function for the fixed square-root. - * - * @param val value to be calculated. The range of the input value is [0 +INFINITY). - * @return returns sqrt(val). - */ -static inline uint32_t PQ_SqrtFixed(uint32_t val) -{ - _pq_sqrt_fx0(val); - return _pq_readMult0_fx(); -} - -/*! - * @brief Processing function for the fixed inverse square-root. - * - * @param val value to be calculated. The range of the input value is (0 +INFINITY). - * @return returns 1/sqrt(val). - */ -static inline int32_t PQ_InvSqrtFixed(int32_t val) -{ - _pq_invsqrt_fx0(val); - return (int32_t)_pq_readMult0_fx(); -} - -/*! - * @brief Processing function for the Fixed natural exponent. - * - * @param val value to be calculated. The range of the input value is (-INFINITY +INFINITY). - * @return returns etox^(val). - */ -static inline int32_t PQ_EtoxFixed(int32_t val) -{ - _pq_etox_fx0(val); - return (int32_t)_pq_readMult0_fx(); -} - -/*! - * @brief Processing function for the fixed natural exponent with negative parameter. - * - * @param val value to be calculated. The range of the input value is (-INFINITY +INFINITY). - * @return returns etonx^(val). - */ -static inline int32_t PQ_EtonxFixed(int32_t val) -{ - _pq_etonx_fx0(val); - return (int32_t)_pq_readMult0_fx(); -} - -/*! - * @brief Processing function for the fixed sine. - * - * @param val value to be calculated. The input value is [-1, 1] in Q31 format, which means [-pi, pi]. - * @return returns sin(val). - */ -static inline int32_t PQ_SinQ31(int32_t val) -{ - int32_t ret; - uint32_t cppre; -#if defined(FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA) && FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA - pq_float_t magic; - pq_float_t valFloat; - - magic.integerX = 0x30c90fdb; - valFloat.floatX = magic.floatX * (float)val; -#endif - - cppre = POWERQUAD->CPPRE; - POWERQUAD->CPPRE = POWERQUAD_CPPRE_CPPRE_OUT(31); - -#if defined(FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA) && FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA - _pq_sin0(valFloat.integerX); - - (void)_pq_readAdd0(); - ret = (int32_t)_pq_readAdd0_fx(); -#else - _pq_sin_fx0(val); - ret = (int32_t)_pq_readAdd0_fx(); -#endif - - POWERQUAD->CPPRE = cppre; - - return ret; -} - -/*! - * @brief Processing function for the fixed sine. - * - * @param val value to be calculated. The input value is [-1, 1] in Q15 format, which means [-pi, pi]. - * @return returns sin(val). - */ -static inline int16_t PQ_SinQ15(int16_t val) -{ - uint32_t ret; - uint32_t cppre; -#if defined(FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA) && FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA - pq_float_t magic; - pq_float_t valFloat; - - magic.integerX = 0x30c90fdbU; - valFloat.floatX = magic.floatX * (float)(uint32_t)((uint32_t)val << 16U); -#endif - - cppre = POWERQUAD->CPPRE; - /* Don't use 15 here, it is wrong then val is 0x4000 */ - POWERQUAD->CPPRE = POWERQUAD_CPPRE_CPPRE_OUT(31); - -#if defined(FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA) && FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA - _pq_sin0(valFloat.integerX); - - (void)_pq_readAdd0(); - ret = (_pq_readAdd0_fx() >> 16U); -#else - _pq_sin_fx0((uint32_t)val << 16U); - ret = (_pq_readAdd0_fx() >> 16U); -#endif - - POWERQUAD->CPPRE = cppre; - - return (int16_t)ret; -} - -/*! - * @brief Processing function for the fixed cosine. - * - * @param val value to be calculated. The input value is [-1, 1] in Q31 format, which means [-pi, pi]. - * @return returns cos(val). - */ -static inline int32_t PQ_CosQ31(int32_t val) -{ - int32_t ret; - uint32_t cppre; -#if defined(FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA) && FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA - pq_float_t magic; - pq_float_t valFloat; - - magic.integerX = 0x30c90fdb; - valFloat.floatX = magic.floatX * (float)val; -#endif - - cppre = POWERQUAD->CPPRE; - POWERQUAD->CPPRE = POWERQUAD_CPPRE_CPPRE_OUT(31); - -#if defined(FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA) && FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA - _pq_cos0(valFloat.integerX); - - (void)_pq_readAdd0(); - ret = (int32_t)_pq_readAdd0_fx(); -#else - _pq_cos_fx0(val); - ret = (int32_t)_pq_readAdd0_fx(); -#endif - - POWERQUAD->CPPRE = cppre; - - return ret; -} - -/*! - * @brief Processing function for the fixed sine. - * - * @param val value to be calculated. The input value is [-1, 1] in Q15 format, which means [-pi, pi]. - * @return returns sin(val). - */ -static inline int16_t PQ_CosQ15(int16_t val) -{ - uint32_t ret; - uint32_t cppre; -#if defined(FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA) && FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA - pq_float_t magic; - pq_float_t valFloat; - - magic.integerX = 0x30c90fdbU; - valFloat.floatX = magic.floatX * (float)(uint32_t)((uint32_t)val << 16U); -#endif - - cppre = POWERQUAD->CPPRE; - POWERQUAD->CPPRE = POWERQUAD_CPPRE_CPPRE_OUT(31); - -#if defined(FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA) && FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA - _pq_cos0(valFloat.integerX); - - (void)_pq_readAdd0(); - ret = _pq_readAdd0_fx() >> 16U; -#else - _pq_cos_fx0((uint32_t)val << 16U); - ret = _pq_readAdd0_fx() >> 16U; -#endif - - POWERQUAD->CPPRE = cppre; - - return (int16_t)ret; -} - -/*! - * @brief Processing function for the fixed biquad. - * - * @param val value to be calculated - * @return returns biquad(val). - */ -static inline int32_t PQ_BiquadFixed(int32_t val) -{ - _pq_biquad0_fx(val); - return (int32_t)_pq_readAdd0_fx(); -} - -/*! - * @brief Processing function for the floating-point vectorised natural log. - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - * @param length the block of input data. - */ -void PQ_VectorLnF32(float *pSrc, float *pDst, int32_t length); - -/*! - * @brief Processing function for the floating-point vectorised reciprocal. - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - * @param length the block of input data. - */ -void PQ_VectorInvF32(float *pSrc, float *pDst, int32_t length); - -/*! - * @brief Processing function for the floating-point vectorised square-root. - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - * @param length the block of input data. - */ -void PQ_VectorSqrtF32(float *pSrc, float *pDst, int32_t length); - -/*! - * @brief Processing function for the floating-point vectorised inverse square-root. - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - * @param length the block of input data. - */ -void PQ_VectorInvSqrtF32(float *pSrc, float *pDst, int32_t length); - -/*! - * @brief Processing function for the floating-point vectorised natural exponent. - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - * @param length the block of input data. - */ -void PQ_VectorEtoxF32(float *pSrc, float *pDst, int32_t length); - -/*! - * @brief Processing function for the floating-point vectorised natural exponent with negative parameter. - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - * @param length the block of input data. - */ -void PQ_VectorEtonxF32(float *pSrc, float *pDst, int32_t length); - -/*! - * @brief Processing function for the floating-point vectorised sine - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - * @param length the block of input data. - */ -void PQ_VectorSinF32(float *pSrc, float *pDst, int32_t length); - -/*! - * @brief Processing function for the floating-point vectorised cosine. - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - * @param length the block of input data. - */ -void PQ_VectorCosF32(float *pSrc, float *pDst, int32_t length); - -/*! - * @brief Processing function for the Q31 vectorised natural log. - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - * @param length the block of input data. - */ -void PQ_VectorLnFixed32(int32_t *pSrc, int32_t *pDst, int32_t length); - -/*! - * @brief Processing function for the Q31 vectorised reciprocal. - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - * @param length the block of input data. - */ -void PQ_VectorInvFixed32(int32_t *pSrc, int32_t *pDst, int32_t length); - -/*! - * @brief Processing function for the 32-bit integer vectorised square-root. - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - * @param length the block of input data. - */ -void PQ_VectorSqrtFixed32(int32_t *pSrc, int32_t *pDst, int32_t length); - -/*! - * @brief Processing function for the 32-bit integer vectorised inverse square-root. - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - * @param length the block of input data. - */ -void PQ_VectorInvSqrtFixed32(int32_t *pSrc, int32_t *pDst, int32_t length); - -/*! - * @brief Processing function for the 32-bit integer vectorised natural exponent. - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - * @param length the block of input data. - */ -void PQ_VectorEtoxFixed32(int32_t *pSrc, int32_t *pDst, int32_t length); - -/*! - * @brief Processing function for the 32-bit integer vectorised natural exponent with negative parameter. - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - * @param length the block of input data. - */ -void PQ_VectorEtonxFixed32(int32_t *pSrc, int32_t *pDst, int32_t length); - -/*! - * @brief Processing function for the Q15 vectorised sine - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - * @param length the block of input data. - */ -void PQ_VectorSinQ15(int16_t *pSrc, int16_t *pDst, int32_t length); - -/*! - * @brief Processing function for the Q15 vectorised cosine. - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - * @param length the block of input data. - */ -void PQ_VectorCosQ15(int16_t *pSrc, int16_t *pDst, int32_t length); - -/*! - * @brief Processing function for the Q31 vectorised sine - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - * @param length the block of input data. - */ -void PQ_VectorSinQ31(int32_t *pSrc, int32_t *pDst, int32_t length); - -/*! - * @brief Processing function for the Q31 vectorised cosine. - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - * @param length the block of input data. - */ -void PQ_VectorCosQ31(int32_t *pSrc, int32_t *pDst, int32_t length); - -/*! - * @brief Processing function for the 16-bit integer vectorised natural log. - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - * @param length the block of input data. - */ -void PQ_VectorLnFixed16(int16_t *pSrc, int16_t *pDst, int32_t length); - -/*! - * @brief Processing function for the 16-bit integer vectorised reciprocal. - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - * @param length the block of input data. - */ -void PQ_VectorInvFixed16(int16_t *pSrc, int16_t *pDst, int32_t length); - -/*! - * @brief Processing function for the 16-bit integer vectorised square-root. - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - * @param length the block of input data. - */ -void PQ_VectorSqrtFixed16(int16_t *pSrc, int16_t *pDst, int32_t length); - -/*! - * @brief Processing function for the 16-bit integer vectorised inverse square-root. - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - * @param length the block of input data. - */ -void PQ_VectorInvSqrtFixed16(int16_t *pSrc, int16_t *pDst, int32_t length); - -/*! - * @brief Processing function for the 16-bit integer vectorised natural exponent. - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - * @param length the block of input data. - */ -void PQ_VectorEtoxFixed16(int16_t *pSrc, int16_t *pDst, int32_t length); - -/*! - * @brief Processing function for the 16-bit integer vectorised natural exponent with negative parameter. - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - * @param length the block of input data. - */ -void PQ_VectorEtonxFixed16(int16_t *pSrc, int16_t *pDst, int32_t length); - -/*! - * @brief Processing function for the floating-point vectorised biquad direct form II. - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - * @param length the block size of input data. - */ -void PQ_VectorBiquadDf2F32(float *pSrc, float *pDst, int32_t length); - -/*! - * @brief Processing function for the 32-bit integer vectorised biquad direct form II. - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - * @param length the block size of input data - */ -void PQ_VectorBiquadDf2Fixed32(int32_t *pSrc, int32_t *pDst, int32_t length); - -/*! - * @brief Processing function for the 16-bit integer vectorised biquad direct form II. - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - * @param length the block size of input data - */ -void PQ_VectorBiquadDf2Fixed16(int16_t *pSrc, int16_t *pDst, int32_t length); - -/*! - * @brief Processing function for the floating-point vectorised biquad direct form II. - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - * @param length the block size of input data - */ -void PQ_VectorBiquadCascadeDf2F32(float *pSrc, float *pDst, int32_t length); - -/*! - * @brief Processing function for the 32-bit integer vectorised biquad direct form II. - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - * @param length the block size of input data - */ -void PQ_VectorBiquadCascadeDf2Fixed32(int32_t *pSrc, int32_t *pDst, int32_t length); - -/*! - * @brief Processing function for the 16-bit integer vectorised biquad direct form II. - * - * @param *pSrc points to the block of input data - * @param *pDst points to the block of output data - * @param length the block size of input data - */ -void PQ_VectorBiquadCascadeDf2Fixed16(int16_t *pSrc, int16_t *pDst, int32_t length); - -/*! - * @brief Processing function for the fixed inverse trigonometric. - * - * Get the inverse tangent, the behavior is like c function atan. - * - * @param base POWERQUAD peripheral base address - * @param x value of opposite - * @param y value of adjacent - * @param iteration iteration times - * @return The return value is in the range of -2^26 to 2^26, which means -pi/2 to pi/2. - * @note The sum of x and y should not exceed the range of int32_t. - * @note Larger input number gets higher output accuracy, for example the arctan(0.5), - * the result of PQ_ArctanFixed(POWERQUAD, 100000, 200000, kPQ_Iteration_24) is more - * accurate than PQ_ArctanFixed(POWERQUAD, 1, 2, kPQ_Iteration_24). - */ -int32_t PQ_ArctanFixed(POWERQUAD_Type *base, int32_t x, int32_t y, pq_cordic_iter_t iteration); - -/*! - * @brief Processing function for the fixed inverse trigonometric. - * - * @param base POWERQUAD peripheral base address - * @param x value of opposite - * @param y value of adjacent - * @param iteration iteration times - * @return The return value is radians, 2^27 means pi. The range is -1.118 to 1.118 radians. - * @note The sum of x and y should not exceed the range of int32_t. - * @note Larger input number gets higher output accuracy, for example the arctanh(0.5), - * the result of PQ_ArctanhFixed(POWERQUAD, 100000, 200000, kPQ_Iteration_24) is more - * accurate than PQ_ArctanhFixed(POWERQUAD, 1, 2, kPQ_Iteration_24). - */ -int32_t PQ_ArctanhFixed(POWERQUAD_Type *base, int32_t x, int32_t y, pq_cordic_iter_t iteration); - -/*! - * @brief Processing function for the fixed inverse trigonometric. - * - * Get the inverse tangent, it calculates the angle in radians for the quadrant. - * The behavior is like c function atan2. - * - * @param base POWERQUAD peripheral base address - * @param x value of opposite - * @param y value of adjacent - * @param iteration iteration times - * @return The return value is in the range of -2^27 to 2^27, which means -pi to pi. - * @note The sum of x and y should not exceed the range of int32_t. - * @note Larger input number gets higher output accuracy, for example the arctan(0.5), - * the result of PQ_Arctan2Fixed(POWERQUAD, 100000, 200000, kPQ_Iteration_24) is more - * accurate than PQ_Arctan2Fixed(POWERQUAD, 1, 2, kPQ_Iteration_24). - */ -int32_t PQ_Arctan2Fixed(POWERQUAD_Type *base, int32_t x, int32_t y, pq_cordic_iter_t iteration); - -/*! - * @brief Processing function for the fixed biquad. - * - * @param val value to be calculated - * @return returns biquad(val). - */ -static inline int32_t PQ_Biquad1Fixed(int32_t val) -{ - _pq_biquad1_fx(val); - return (int32_t)_pq_readAdd1_fx(); -} - -/*! - * @brief Processing function for the complex FFT. - * - * @param base POWERQUAD peripheral base address - * @param length number of input samples - * @param pData input data - * @param pResult output data. - */ -void PQ_TransformCFFT(POWERQUAD_Type *base, uint32_t length, void *pData, void *pResult); - -/*! - * @brief Processing function for the real FFT. - * - * @param base POWERQUAD peripheral base address - * @param length number of input samples - * @param pData input data - * @param pResult output data. - */ -void PQ_TransformRFFT(POWERQUAD_Type *base, uint32_t length, void *pData, void *pResult); - -/*! - * @brief Processing function for the inverse complex FFT. - * - * @param base POWERQUAD peripheral base address - * @param length number of input samples - * @param pData input data - * @param pResult output data. - */ -void PQ_TransformIFFT(POWERQUAD_Type *base, uint32_t length, void *pData, void *pResult); - -/*! - * @brief Processing function for the complex DCT. - * - * @param base POWERQUAD peripheral base address - * @param length number of input samples - * @param pData input data - * @param pResult output data. - */ -void PQ_TransformCDCT(POWERQUAD_Type *base, uint32_t length, void *pData, void *pResult); - -/*! - * @brief Processing function for the real DCT. - * - * @param base POWERQUAD peripheral base address - * @param length number of input samples - * @param pData input data - * @param pResult output data. - */ -void PQ_TransformRDCT(POWERQUAD_Type *base, uint32_t length, void *pData, void *pResult); - -/*! - * @brief Processing function for the inverse complex DCT. - * - * @param base POWERQUAD peripheral base address - * @param length number of input samples - * @param pData input data - * @param pResult output data. - */ -void PQ_TransformIDCT(POWERQUAD_Type *base, uint32_t length, void *pData, void *pResult); - -/*! - * @brief Processing function for backup biquad context. - * - * @param base POWERQUAD peripheral base address - * @param biquad_num biquad side - * @param state point to states. - */ -void PQ_BiquadBackUpInternalState(POWERQUAD_Type *base, int32_t biquad_num, pq_biquad_state_t *state); - -/*! - * @brief Processing function for restore biquad context. - * - * @param base POWERQUAD peripheral base address - * @param biquad_num biquad side - * @param state point to states. - */ -void PQ_BiquadRestoreInternalState(POWERQUAD_Type *base, int32_t biquad_num, pq_biquad_state_t *state); - -/*! - * @brief Initialization function for the direct form II Biquad cascade filter. - * - * @param[in,out] *S points to an instance of the filter data structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] *pState points to the state buffer. - */ -void PQ_BiquadCascadeDf2Init(pq_biquad_cascade_df2_instance *S, uint8_t numStages, pq_biquad_state_t *pState); - -/*! - * @brief Processing function for the floating-point direct form II Biquad cascade filter. - * - * @param[in] *S points to an instance of the filter data structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ -void PQ_BiquadCascadeDf2F32(const pq_biquad_cascade_df2_instance *S, float *pSrc, float *pDst, uint32_t blockSize); - -/*! - * @brief Processing function for the Q31 direct form II Biquad cascade filter. - * - * @param[in] *S points to an instance of the filter data structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ -void PQ_BiquadCascadeDf2Fixed32(const pq_biquad_cascade_df2_instance *S, - int32_t *pSrc, - int32_t *pDst, - uint32_t blockSize); - -/*! - * @brief Processing function for the Q15 direct form II Biquad cascade filter. - * - * @param[in] *S points to an instance of the filter data structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ -void PQ_BiquadCascadeDf2Fixed16(const pq_biquad_cascade_df2_instance *S, - int16_t *pSrc, - int16_t *pDst, - uint32_t blockSize); - -/*! - * @brief Processing function for the FIR. - * - * @param base POWERQUAD peripheral base address - * @param pAData the first input sequence - * @param ALength number of the first input sequence - * @param pBData the second input sequence - * @param BLength number of the second input sequence - * @param pResult array for the output data - * @param opType operation type, could be PQ_FIR_FIR, PQ_FIR_CONVOLUTION, PQ_FIR_CORRELATION. - */ -void PQ_FIR(POWERQUAD_Type *base, - const void *pAData, - int32_t ALength, - const void *pBData, - int32_t BLength, - void *pResult, - uint32_t opType); - -/*! - * @brief Processing function for the incremental FIR. - * This function can be used after pq_fir() for incremental FIR - * operation when new x data are available - * - * @param base POWERQUAD peripheral base address - * @param ALength number of input samples - * @param BLength number of taps - * @param xOffset offset for number of input samples - */ -void PQ_FIRIncrement(POWERQUAD_Type *base, int32_t ALength, int32_t BLength, int32_t xOffset); - -/*! - * @brief Processing function for the matrix addition. - * - * @param base POWERQUAD peripheral base address - * @param length rows and cols for matrix. LENGTH register configuration: - * LENGTH[23:16] = M2 cols - * LENGTH[15:8] = M1 cols - * LENGTH[7:0] = M1 rows - * This could be constructed using macro @ref POWERQUAD_MAKE_MATRIX_LEN. - * @param pAData input matrix A - * @param pBData input matrix B - * @param pResult array for the output data. - */ -void PQ_MatrixAddition(POWERQUAD_Type *base, uint32_t length, void *pAData, void *pBData, void *pResult); - -/*! - * @brief Processing function for the matrix subtraction. - * - * @param base POWERQUAD peripheral base address - * @param length rows and cols for matrix. LENGTH register configuration: - * LENGTH[23:16] = M2 cols - * LENGTH[15:8] = M1 cols - * LENGTH[7:0] = M1 rows - * This could be constructed using macro @ref POWERQUAD_MAKE_MATRIX_LEN. - * @param pAData input matrix A - * @param pBData input matrix B - * @param pResult array for the output data. - */ -void PQ_MatrixSubtraction(POWERQUAD_Type *base, uint32_t length, void *pAData, void *pBData, void *pResult); - -/*! - * @brief Processing function for the matrix multiplication. - * - * @param base POWERQUAD peripheral base address - * @param length rows and cols for matrix. LENGTH register configuration: - * LENGTH[23:16] = M2 cols - * LENGTH[15:8] = M1 cols - * LENGTH[7:0] = M1 rows - * This could be constructed using macro @ref POWERQUAD_MAKE_MATRIX_LEN. - * @param pAData input matrix A - * @param pBData input matrix B - * @param pResult array for the output data. - */ -void PQ_MatrixMultiplication(POWERQUAD_Type *base, uint32_t length, void *pAData, void *pBData, void *pResult); - -/*! - * @brief Processing function for the matrix product. - * - * @param base POWERQUAD peripheral base address - * @param length rows and cols for matrix. LENGTH register configuration: - * LENGTH[23:16] = M2 cols - * LENGTH[15:8] = M1 cols - * LENGTH[7:0] = M1 rows - * This could be constructed using macro @ref POWERQUAD_MAKE_MATRIX_LEN. - * @param pAData input matrix A - * @param pBData input matrix B - * @param pResult array for the output data. - */ -void PQ_MatrixProduct(POWERQUAD_Type *base, uint32_t length, void *pAData, void *pBData, void *pResult); - -/*! - * @brief Processing function for the vector dot product. - * - * @param base POWERQUAD peripheral base address - * @param length length of vector - * @param pAData input vector A - * @param pBData input vector B - * @param pResult array for the output data. - */ -void PQ_VectorDotProduct(POWERQUAD_Type *base, uint32_t length, void *pAData, void *pBData, void *pResult); - -/*! - * @brief Processing function for the matrix inverse. - * - * @param base POWERQUAD peripheral base address - * @param length rows and cols for matrix. LENGTH register configuration: - * LENGTH[23:16] = M2 cols - * LENGTH[15:8] = M1 cols - * LENGTH[7:0] = M1 rows - * This could be constructed using macro @ref POWERQUAD_MAKE_MATRIX_LEN. - * @param pData input matrix - * @param pTmpData input temporary matrix, pTmpData length not less than pData lenght and 1024 words is sufficient for - * the largest supported matrix. - * @param pResult array for the output data, round down for fixed point. - */ -void PQ_MatrixInversion(POWERQUAD_Type *base, uint32_t length, void *pData, void *pTmpData, void *pResult); - -/*! - * @brief Processing function for the matrix transpose. - * - * @param base POWERQUAD peripheral base address - * @param length rows and cols for matrix. LENGTH register configuration: - * LENGTH[23:16] = M2 cols - * LENGTH[15:8] = M1 cols - * LENGTH[7:0] = M1 rows - * This could be constructed using macro @ref POWERQUAD_MAKE_MATRIX_LEN. - * @param pData input matrix - * @param pResult array for the output data. - */ -void PQ_MatrixTranspose(POWERQUAD_Type *base, uint32_t length, void *pData, void *pResult); - -/*! - * @brief Processing function for the matrix scale. - * - * @param base POWERQUAD peripheral base address - * @param length rows and cols for matrix. LENGTH register configuration: - * LENGTH[23:16] = M2 cols - * LENGTH[15:8] = M1 cols - * LENGTH[7:0] = M1 rows - * This could be constructed using macro @ref POWERQUAD_MAKE_MATRIX_LEN. - * @param misc scaling parameters - * @param pData input matrix - * @param pResult array for the output data. - */ -void PQ_MatrixScale(POWERQUAD_Type *base, uint32_t length, float misc, const void *pData, void *pResult); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @}*/ - -#endif /* FSL_POWERQUAD_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_powerquad_basic.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_powerquad_basic.c deleted file mode 100644 index 3a1de44b629..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_powerquad_basic.c +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright 2018-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_powerquad.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.powerquad_basic" -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -void PQ_GetDefaultConfig(pq_config_t *config) -{ - config->inputAFormat = kPQ_Float; - config->inputAPrescale = 0; - config->inputBFormat = kPQ_Float; - config->inputBPrescale = 0; - config->outputFormat = kPQ_Float; - config->outputPrescale = 0; - config->tmpFormat = kPQ_Float; - config->tmpPrescale = 0; - config->machineFormat = kPQ_Float; - config->tmpBase = (uint32_t *)0xE0000000U; -} - -void PQ_SetConfig(POWERQUAD_Type *base, const pq_config_t *config) -{ - assert(NULL != config); - - base->TMPBASE = (uint32_t)config->tmpBase; - base->INAFORMAT = ((uint32_t)config->inputAPrescale << 8U) | ((uint32_t)config->inputAFormat << 4U) | - (uint32_t)config->machineFormat; - base->INBFORMAT = ((uint32_t)config->inputBPrescale << 8U) | ((uint32_t)config->inputBFormat << 4U) | - (uint32_t)config->machineFormat; - base->TMPFORMAT = - ((uint32_t)config->tmpPrescale << 8U) | ((uint32_t)config->tmpFormat << 4U) | (uint32_t)config->machineFormat; - base->OUTFORMAT = ((uint32_t)config->outputPrescale << 8U) | ((uint32_t)config->outputFormat << 4U) | - (uint32_t)config->machineFormat; -} - -void PQ_Init(POWERQUAD_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#if defined(POWERQUAD_CLOCKS) - CLOCK_EnableClock(kCLOCK_PowerQuad); -#endif -#endif -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) -#if defined(POWERQUAD_RSTS) - RESET_PeripheralReset(kPOWERQUAD_RST_SHIFT_RSTn); -#endif -#endif - - /* Enable event used for WFE. */ - base->EVENTEN = POWERQUAD_EVENTEN_EVENT_OFLOW_MASK | POWERQUAD_EVENTEN_EVENT_NAN_MASK | - POWERQUAD_EVENTEN_EVENT_FIXED_MASK | POWERQUAD_EVENTEN_EVENT_UFLOW_MASK | - POWERQUAD_EVENTEN_EVENT_BERR_MASK | POWERQUAD_EVENTEN_EVENT_COMP_MASK; -} - -void PQ_Deinit(POWERQUAD_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#if defined(POWERQUAD_CLOCKS) - CLOCK_DisableClock(kCLOCK_PowerQuad); -#endif -#endif -} - -void PQ_SetFormat(POWERQUAD_Type *base, pq_computationengine_t engine, pq_format_t format) -{ - pq_config_t config; - - PQ_GetDefaultConfig(&config); - - /* 32-bit Float point */ - if (kPQ_Float == format) - { - config.inputAFormat = kPQ_Float; - config.inputAPrescale = 0; - config.inputBFormat = kPQ_Float; - config.inputBPrescale = 0; - config.outputFormat = kPQ_Float; - config.outputPrescale = 0; - config.tmpFormat = kPQ_Float; - config.tmpPrescale = 0; - } - /* 32-bit Fixed point */ - if (kPQ_32Bit == format) - { - config.inputAFormat = kPQ_32Bit; - config.inputAPrescale = 0; - config.inputBFormat = kPQ_32Bit; - config.inputBPrescale = 0; - config.outputFormat = kPQ_32Bit; - config.outputPrescale = 0; - config.tmpFormat = kPQ_Float; - config.tmpPrescale = 0; - } - /* 16-bit Fixed point */ - if (kPQ_16Bit == format) - { - config.inputAFormat = kPQ_16Bit; - config.inputAPrescale = 0; - config.inputBFormat = kPQ_16Bit; - config.inputBPrescale = 0; - config.outputFormat = kPQ_16Bit; - config.outputPrescale = 0; - config.tmpFormat = kPQ_Float; - config.tmpPrescale = 0; - } - - if (CP_FFT == (uint8_t)engine) - { - config.machineFormat = kPQ_32Bit; - } - else - { - config.machineFormat = kPQ_Float; - } - - PQ_SetConfig(base, &config); -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_powerquad_cmsis.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_powerquad_cmsis.c deleted file mode 100644 index fd34d1ade6a..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_powerquad_cmsis.c +++ /dev/null @@ -1,1693 +0,0 @@ -/* - * Copyright 2018-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_powerquad.h" -#include "fsl_powerquad_data.h" -#include "arm_math.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.powerquad_cmsis" -#endif - -#define PQ_SET_FIX32_CONFIG \ - POWERQUAD->OUTFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_32Bit << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->INAFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_32Bit << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->INBFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_32Bit << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->TMPFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_Float << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->TMPBASE = 0xE0000000U - -#define PQ_SET_FIX16_CONFIG \ - POWERQUAD->OUTFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_16Bit << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->INAFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_16Bit << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->INBFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_16Bit << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->TMPFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_Float << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->TMPBASE = 0xE0000000U - -#define PQ_SET_Q31_CONFIG \ - POWERQUAD->OUTFORMAT = ((uint32_t)(-31) << 8U) | ((uint32_t)kPQ_32Bit << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->INAFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_32Bit << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->INBFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_32Bit << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->TMPFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_Float << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->TMPBASE = 0xE0000000U - -#define PQ_SET_Q15_CONFIG \ - POWERQUAD->OUTFORMAT = ((uint32_t)(-15) << 8U) | ((uint32_t)kPQ_16Bit << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->INAFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_16Bit << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->INBFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_16Bit << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->TMPFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_Float << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->TMPBASE = 0xE0000000U - -#define PQ_SET_F32_CONFIG \ - POWERQUAD->OUTFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_Float << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->INAFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_Float << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->INBFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_Float << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->TMPFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_Float << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->TMPBASE = 0xE0000000U - -#define PQ_SET_FFT_Q31_CONFIG \ - POWERQUAD->OUTFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_32Bit << 4U) | (uint32_t)kPQ_32Bit; \ - POWERQUAD->INAFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_32Bit << 4U) | (uint32_t)kPQ_32Bit; \ - POWERQUAD->INBFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_32Bit << 4U) | (uint32_t)kPQ_32Bit; \ - POWERQUAD->TMPFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_32Bit << 4U) | (uint32_t)kPQ_32Bit; \ - POWERQUAD->TMPBASE = 0xE0000000U - -#define PQ_SET_FFT_Q15_CONFIG \ - POWERQUAD->OUTFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_16Bit << 4U) | (uint32_t)kPQ_32Bit; \ - POWERQUAD->INAFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_16Bit << 4U) | (uint32_t)kPQ_32Bit; \ - POWERQUAD->INBFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_16Bit << 4U) | (uint32_t)kPQ_32Bit; \ - POWERQUAD->TMPFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_32Bit << 4U) | (uint32_t)kPQ_32Bit; \ - POWERQUAD->TMPBASE = 0xE0000000U - -#define PQ_SET_MAT_FIX32_WORKAROUND_SCALE_CONFIG \ - POWERQUAD->OUTFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_Float << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->INAFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_32Bit << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->INBFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_32Bit << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->TMPFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_Float << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->TMPBASE = 0xE0000000U - -#define PQ_SET_MAT_FIX32_WORKAROUND_MULT_CONFIG \ - POWERQUAD->OUTFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_32Bit << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->INBFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_Float << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->TMPBASE = 0xE0000000U - -#define PQ_SET_MAT_FIX16_WORKAROUND_SCALE_CONFIG \ - POWERQUAD->OUTFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_Float << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->INAFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_16Bit << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->INBFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_16Bit << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->TMPFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_Float << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->TMPBASE = 0xE0000000U - -#define PQ_SET_MAT_FIX16_WORKAROUND_MULT_CONFIG \ - POWERQUAD->OUTFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_16Bit << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->INBFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_Float << 4U) | (uint32_t)kPQ_Float; \ - POWERQUAD->TMPBASE = 0xE0000000U - -/******************************************************************************* - * Code - ******************************************************************************/ -static void _arm_fir_increment(const void *pSrc, - uint32_t srcLen, - const void *pTap, - uint16_t tapLen, - void *pDst, - uint32_t offset, - uint32_t elemSize) -{ - POWERQUAD->INABASE = ((uint32_t)(const uint32_t *)pSrc) - (offset * elemSize); - POWERQUAD->INBBASE = (uint32_t)(const uint32_t *)pTap; - POWERQUAD->LENGTH = (((uint32_t)tapLen & 0xFFFFUL) << 16U) + (srcLen & 0xFFFFUL); - POWERQUAD->OUTBASE = ((uint32_t)(uint32_t *)pDst) - (offset * elemSize); - POWERQUAD->MISC = offset; - POWERQUAD->CONTROL = (CP_FIR << 4U) | PQ_FIR_INCREMENTAL; -} - -float32_t arm_cos_f32(float32_t x) -{ - float tmp; - - PQ_CosF32(&x, &tmp); - return tmp; -} - -q31_t arm_cos_q31(q31_t x) -{ - /* For PQ: input -1 to 1 means -pi to pi - * For CMSIS DSP: input 0 to 1 means pi to 2*pi */ - x *= 2; - return PQ_CosQ31(x); -} - -q15_t arm_cos_q15(q15_t x) -{ - /* For PQ: input -1 to 1 means -pi to pi - * For CMSIS DSP: input 0 to 1 means pi to 2*pi */ - x *= 2; - return PQ_CosQ15(x); -} - -float32_t arm_sin_f32(float32_t x) -{ - float tmp; - - PQ_SinF32(&x, &tmp); - return tmp; -} - -q31_t arm_sin_q31(q31_t x) -{ - /* For PQ: input -1 to 1 means -pi to pi - * For CMSIS DSP: input 0 to 1 means pi to 2*pi */ - x *= 2; - return PQ_SinQ31(x); -} - -q15_t arm_sin_q15(q15_t x) -{ - /* For PQ: input -1 to 1 means -pi to pi - * For CMSIS DSP: input 0 to 1 means pi to 2*pi */ - x *= 2; - return PQ_SinQ15(x); -} - -arm_status arm_sqrt_q31(q31_t in, q31_t *pOut) -{ - uint32_t cppre; - arm_status status; - - /* If the input is a positive number then compute the signBits. */ - if (in > 0) - { - cppre = POWERQUAD->CPPRE; - POWERQUAD->CPPRE = POWERQUAD_CPPRE_CPPRE_IN(-31) | POWERQUAD_CPPRE_CPPRE_OUT(31); - *pOut = (q31_t)PQ_SqrtFixed((uint32_t)in); - POWERQUAD->CPPRE = cppre; - - status = (ARM_MATH_SUCCESS); - } - /* If the number is a negative number then store zero as its square root value */ - else - { - *pOut = 0; - - status = (ARM_MATH_ARGUMENT_ERROR); - } - - return status; -} - -arm_status arm_sqrt_q15(q15_t in, q15_t *pOut) -{ - uint32_t cppre; - arm_status status; - - /* If the input is a positive number then compute the signBits. */ - if (in > 0) - { - cppre = POWERQUAD->CPPRE; - POWERQUAD->CPPRE = POWERQUAD_CPPRE_CPPRE_IN(-15) | POWERQUAD_CPPRE_CPPRE_OUT(15); - *pOut = (q15_t)PQ_SqrtFixed((uint32_t)in); - POWERQUAD->CPPRE = cppre; - - status = (ARM_MATH_SUCCESS); - } - /* If the number is a negative number then store zero as its square root value */ - else - { - *pOut = 0; - - status = (ARM_MATH_ARGUMENT_ERROR); - } - - return status; -} - -void arm_cfft_q31(const arm_cfft_instance_q31 *S, q31_t *p1, uint8_t ifftFlag, uint8_t bitReverseFlag) -{ - assert(bitReverseFlag == 1U); - - q31_t *pIn = p1; - q31_t *pOut = p1; - uint32_t length = S->fftLen; - - PQ_SET_FFT_Q31_CONFIG; - - if (ifftFlag == 1U) - { - PQ_TransformIFFT(POWERQUAD, length, pIn, pOut); - } - else - { - PQ_TransformCFFT(POWERQUAD, length, pIn, pOut); - } - - PQ_WaitDone(POWERQUAD); -} - -void arm_cfft_q15(const arm_cfft_instance_q15 *S, q15_t *p1, uint8_t ifftFlag, uint8_t bitReverseFlag) -{ - assert(bitReverseFlag == 1U); - - q15_t *pIn = p1; - q15_t *pOut = p1; - uint32_t length = S->fftLen; - - PQ_SET_FFT_Q15_CONFIG; - - if (ifftFlag == 1U) - { - PQ_TransformIFFT(POWERQUAD, length, pIn, pOut); - } - else - { - PQ_TransformCFFT(POWERQUAD, length, pIn, pOut); - } - - PQ_WaitDone(POWERQUAD); -} - -arm_status arm_rfft_init_q31(arm_rfft_instance_q31 *S, uint32_t fftLenReal, uint32_t ifftFlagR, uint32_t bitReverseFlag) -{ - /* Only supprt such mode. */ - assert(ifftFlagR == 0U); - assert(bitReverseFlag == 1U); - - /* Initialise the default arm status */ - arm_status status = ARM_MATH_SUCCESS; - - /* Initialize the Real FFT length */ - S->fftLenReal = (uint16_t)fftLenReal; - - /* Initialize the Flag for selection of RFFT or RIFFT */ - S->ifftFlagR = (uint8_t)ifftFlagR; - - /* Initialize the Flag for calculation Bit reversal or not */ - S->bitReverseFlagR = (uint8_t)bitReverseFlag; - - /* return the status of RFFT Init function */ - return (status); -} - -void arm_rfft_q31(const arm_rfft_instance_q31 *S, q31_t *pSrc, q31_t *pDst) -{ - uint32_t length = S->fftLenReal; - PQ_SET_FFT_Q31_CONFIG; - - /* Calculation of RFFT of input */ - PQ_TransformRFFT(POWERQUAD, length, pSrc, pDst); - - PQ_WaitDone(POWERQUAD); -} - -arm_status arm_rfft_init_q15(arm_rfft_instance_q15 *S, uint32_t fftLenReal, uint32_t ifftFlagR, uint32_t bitReverseFlag) -{ - /* Only supprt such mode. */ - assert(ifftFlagR == 0U); - assert(bitReverseFlag == 1U); - - /* Initialise the default arm status */ - arm_status status = ARM_MATH_SUCCESS; - - /* Initialize the Real FFT length */ - S->fftLenReal = (uint16_t)fftLenReal; - - /* Initialize the Flag for selection of RFFT or RIFFT */ - S->ifftFlagR = (uint8_t)ifftFlagR; - - /* Initialize the Flag for calculation Bit reversal or not */ - S->bitReverseFlagR = (uint8_t)bitReverseFlag; - - /* return the status of RFFT Init function */ - return (status); -} - -void arm_rfft_q15(const arm_rfft_instance_q15 *S, q15_t *pSrc, q15_t *pDst) -{ - uint32_t length = S->fftLenReal; - PQ_SET_FFT_Q15_CONFIG; - - /* Calculation of RFFT of input */ - PQ_TransformRFFT(POWERQUAD, length, pSrc, pDst); - - PQ_WaitDone(POWERQUAD); -} - -arm_status arm_dct4_init_q31(arm_dct4_instance_q31 *S, - arm_rfft_instance_q31 *S_RFFT, - arm_cfft_radix4_instance_q31 *S_CFFT, - uint16_t N, - uint16_t Nby2, - q31_t normalize) -{ - arm_status status = ARM_MATH_SUCCESS; - - /* Initialize the DCT4 length */ - S->N = N; - - /* Initialize Real FFT Instance */ - S->pRfft = S_RFFT; - - switch (N) - { - /* Initialize the table modifier values */ - case 512U: - S->pTwiddle = dct512_twiddle; - S->pCosFactor = dct512_cosFactor; - break; - - case 256U: - S->pTwiddle = dct256_twiddle; - S->pCosFactor = dct256_cosFactor; - break; - - case 128U: - S->pTwiddle = dct128_twiddle; - S->pCosFactor = dct128_cosFactor; - break; - - case 64U: - S->pTwiddle = dct64_twiddle; - S->pCosFactor = dct64_cosFactor; - break; - - case 32U: - S->pTwiddle = dct32_twiddle; - S->pCosFactor = dct32_cosFactor; - break; - - case 16U: - S->pTwiddle = dct16_twiddle; - S->pCosFactor = dct16_cosFactor; - break; - - default: - status = ARM_MATH_ARGUMENT_ERROR; - break; - } - - if (ARM_MATH_SUCCESS == status) - { - /* Initialize the RFFT/RIFFT Function */ - status = arm_rfft_init_q31(S->pRfft, S->N, 0, 1); - } - - return status; -} - -void arm_dct4_q31(const arm_dct4_instance_q31 *S, q31_t *pState, q31_t *pInlineBuffer) -{ - /* Calculate DCT-II for N-point input */ - uint16_t i; /* Loop counter */ - const q31_t *weights; /* Pointer to the Weights table */ - q31_t *pOut; /* Temporary pointers for output buffer */ - q31_t *pS1, *pbuff; /* Temporary pointers for input buffer and pState buffer */ - q31_t in; /* Temporary variable */ - const q31_t *cosFact; - uint32_t length; - uint8_t matRow; - uint8_t matCol; - uint8_t matLoop; - uint16_t lenPerMatLoop; - - /* - * Pre-processing involves multiplying input with cos factor, - * r(n) = 2 * u(n) * cos(pi*(2*n+1)/(4*N)) - * where, - * r(n) -- output of preprocessing - * u(n) -- input to preprocessing(actual Source buffer) - */ - - /* - * Use matrix production function for preprocessing. Matrix production - * supports 16x16 at the most, so the matrix row is set to 16. - */ - matRow = 16U; - lenPerMatLoop = S->N >= 256U ? 256U : S->N; - matCol = (uint8_t)(lenPerMatLoop / 16U); - matLoop = (uint8_t)(((S->N - 1U) >> 8U) + 1U); - cosFact = S->pCosFactor; - pbuff = pInlineBuffer; - - length = POWERQUAD_MAKE_MATRIX_LEN(matRow, matCol, matCol); - - while ((matLoop--) != 0U) - { - PQ_SET_MAT_FIX32_WORKAROUND_SCALE_CONFIG; - - /* cos factor is Q31, convert to float */ - PQ_MatrixScale(POWERQUAD, length, 2.0f / 2147483648.0f, cosFact, (void *)(uint32_t *)0xE0000000U); - cosFact = &cosFact[lenPerMatLoop]; - - PQ_WaitDone(POWERQUAD); - - /* Product. */ - PQ_SET_MAT_FIX32_WORKAROUND_MULT_CONFIG; - - PQ_MatrixProduct(POWERQUAD, length, pbuff, (void *)(uint32_t *)0xE0000000U, pbuff); - - pbuff = &pbuff[lenPerMatLoop]; - - PQ_WaitDone(POWERQUAD); - } - - PQ_SET_FFT_Q31_CONFIG; - - PQ_TransformRDCT(POWERQUAD, S->N, pInlineBuffer, pState); - - /* ARM calculation while PQ is running. */ - /* - * Use matrix production function for twiddle multiplication. - * Matrix production supports 16x16 at the most. The total elements are 2*N; - */ - lenPerMatLoop = S->N >= 128U ? 128U : S->N; - matCol = (uint8_t)(lenPerMatLoop / 8U); - matLoop = (uint8_t)(((S->N - 1U) >> 7U) + 1U); - weights = S->pTwiddle; - pOut = pState; - - length = POWERQUAD_MAKE_MATRIX_LEN(matRow, matCol, matCol); - - PQ_WaitDone(POWERQUAD); - - while ((matLoop--) != 0U) - { - PQ_SET_MAT_FIX32_WORKAROUND_SCALE_CONFIG; - - /* Downscale by 1024 * 1024 * 16, because the twiddle are multiplied by 1024 * 1024 * 16. */ - PQ_MatrixScale(POWERQUAD, length, 1.0f / 16777216.0f, weights, (void *)(uint32_t *)0xE0000000U); - weights = &weights[lenPerMatLoop * 2U]; - - PQ_WaitDone(POWERQUAD); - - /* Product. */ - PQ_SET_MAT_FIX32_WORKAROUND_MULT_CONFIG; - - PQ_MatrixProduct(POWERQUAD, length, pOut, (void *)(uint32_t *)0xE0000000U, pOut); - - PQ_WaitDone(POWERQUAD); - - for (i = 0; i < lenPerMatLoop / 4U; i++) - { - pOut[0] -= pOut[1]; - pOut = &pOut[2]; - pOut[0] -= pOut[1]; - pOut = &pOut[2]; - pOut[0] -= pOut[1]; - pOut = &pOut[2]; - pOut[0] -= pOut[1]; - pOut = &pOut[2]; - } - } - - /* ----------- Post-processing ---------- */ - /* DCT-IV can be obtained from DCT-II by the equation, - * Y4(k) = Y2(k) - Y4(k-1) and Y4(-1) = Y4(0) - * Hence, Y4(0) = Y2(0)/2 */ - /* Getting only real part from the output and Converting to DCT-IV */ - - /* pbuff initialized to input buffer. */ - pbuff = pInlineBuffer; - - /* pS1 initialized to pState */ - pS1 = pState; - - /* Calculating Y4(0) from Y2(0) using Y4(0) = Y2(0)/2. Considering the DCT II normalize, here divided by sqrt(2).*/ - in = (q31_t)(float)((float)*pS1 / 1.41421356237f); - *pbuff++ = in; - pS1 = &pS1[2]; - - in = *pS1 - in; - *pbuff++ = in; - pS1 = &pS1[2]; - - in = *pS1 - in; - *pbuff++ = in; - pS1 = &pS1[2]; - - in = *pS1 - in; - *pbuff++ = in; - pS1 = &pS1[2]; - - i = S->N / 4U - 1U; - - while (i > 0U) - { - in = *pS1 - in; - *pbuff++ = in; - pS1 = &pS1[2]; - - in = *pS1 - in; - *pbuff++ = in; - pS1 = &pS1[2]; - - in = *pS1 - in; - *pbuff++ = in; - pS1 = &pS1[2]; - - in = *pS1 - in; - *pbuff++ = in; - pS1 = &pS1[2]; - - i--; - } -} - -arm_status arm_dct4_init_q15(arm_dct4_instance_q15 *S, - arm_rfft_instance_q15 *S_RFFT, - arm_cfft_radix4_instance_q15 *S_CFFT, - uint16_t N, - uint16_t Nby2, - q15_t normalize) -{ - arm_status status = ARM_MATH_SUCCESS; - - /* Initialize the DCT4 length */ - S->N = N; - - /* Initialize Real FFT Instance */ - S->pRfft = S_RFFT; - - switch (N) - { - /* Initialize the table modifier values */ - case 512U: - S->pTwiddle = (void *)dct512_twiddle; - S->pCosFactor = (void *)dct512_cosFactor; - break; - - case 256U: - S->pTwiddle = (void *)dct256_twiddle; - S->pCosFactor = (void *)dct256_cosFactor; - break; - - case 128U: - S->pTwiddle = (void *)dct128_twiddle; - S->pCosFactor = (void *)dct128_cosFactor; - break; - - case 64U: - S->pTwiddle = (void *)dct64_twiddle; - S->pCosFactor = (void *)dct64_cosFactor; - break; - - case 32U: - S->pTwiddle = (void *)dct32_twiddle; - S->pCosFactor = (void *)dct32_cosFactor; - break; - - case 16U: - S->pTwiddle = (void *)dct16_twiddle; - S->pCosFactor = (void *)dct16_cosFactor; - break; - - default: - status = ARM_MATH_ARGUMENT_ERROR; - break; - } - - if (ARM_MATH_SUCCESS == status) - { - /* Initialize the RFFT/RIFFT Function */ - status = arm_rfft_init_q15(S->pRfft, S->N, 0, 1); - } - - /* return the status of DCT4 Init function */ - return status; -} - -void arm_dct4_q15(const arm_dct4_instance_q15 *S, q15_t *pState, q15_t *pInlineBuffer) -{ - /* Calculate DCT-II for N-point input */ - uint16_t i; /* Loop counter */ - const q15_t *weights; /* Pointer to the Weights table */ - q15_t *pOut; /* Temporary pointers for output buffer */ - q15_t *pS1, *pbuff; /* Temporary pointers for input buffer and pState buffer */ - q15_t in; /* Temporary variable */ - const q15_t *cosFact; - uint32_t length; - uint8_t matRow; - uint8_t matCol; - uint8_t matLoop; - uint16_t lenPerMatLoop; - - /* - * Pre-processing involves multiplying input with cos factor, - * r(n) = 2 * u(n) * cos(pi*(2*n+1)/(4*N)) - * where, - * r(n) -- output of preprocessing - * u(n) -- input to preprocessing(actual Source buffer) - */ - - /* - * Use matrix production function for preprocessing. Matrix production - * supports 16x16 at the most, so the matrix row is set to 16. - */ - matRow = 16U; - lenPerMatLoop = S->N >= 256U ? 256U : S->N; - matCol = (uint8_t)(lenPerMatLoop / 16U); - matLoop = (uint8_t)(((S->N - 1U) >> 8U) + 1U); - cosFact = S->pCosFactor; - pbuff = pInlineBuffer; - - length = POWERQUAD_MAKE_MATRIX_LEN(matRow, matCol, 0); - - while ((matLoop--) != 0U) - { - PQ_SET_MAT_FIX32_WORKAROUND_SCALE_CONFIG; - - /* cos factor is Q31, convert to float */ - PQ_MatrixScale(POWERQUAD, length, 2.0f / 2147483648.0f, cosFact, (void *)(uint32_t *)0xE0000000U); - cosFact = &cosFact[2U * lenPerMatLoop]; - - PQ_WaitDone(POWERQUAD); - - /* Product. */ - POWERQUAD->OUTFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_16Bit << 4U) | (uint32_t)kPQ_Float; - POWERQUAD->INAFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_16Bit << 4U) | (uint32_t)kPQ_Float; - POWERQUAD->INBFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_Float << 4U) | (uint32_t)kPQ_Float; - POWERQUAD->TMPFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_Float << 4U) | (uint32_t)kPQ_Float; - POWERQUAD->TMPBASE = 0xE0000000U; - - PQ_MatrixProduct(POWERQUAD, length, pbuff, (void *)(uint32_t *)0xE0000000U, pbuff); - - PQ_WaitDone(POWERQUAD); - - pbuff = &pbuff[lenPerMatLoop]; - } - - PQ_SET_FFT_Q15_CONFIG; - - PQ_TransformRDCT(POWERQUAD, S->N, pInlineBuffer, pState); - - /* ARM calculation while PQ is running. */ - /* - * Use matrix production function for twiddle multiplication. - * Matrix production supports 16x16 at the most. The total elements are 2*N; - */ - lenPerMatLoop = S->N >= 128U ? 128U : S->N; - matCol = (uint8_t)(lenPerMatLoop / 8U); - matLoop = (uint8_t)(((S->N - 1U) >> 7U) + 1U); - weights = S->pTwiddle; - pOut = pState; - - length = POWERQUAD_MAKE_MATRIX_LEN(matRow, matCol, matCol); - - PQ_WaitDone(POWERQUAD); - - while ((matLoop--) != 0U) - { - PQ_SET_MAT_FIX32_WORKAROUND_SCALE_CONFIG; - - /* Downscale by 1024 * 1024 * 16, because the twiddle are multiplied by 1024 * 1024 * 16. */ - PQ_MatrixScale(POWERQUAD, length, 1.0f / 16777216.0f, weights, (void *)(uint32_t *)0xE0000000U); - weights = &weights[lenPerMatLoop * 2U]; - - PQ_WaitDone(POWERQUAD); - - /* Product. */ - POWERQUAD->OUTFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_16Bit << 4U) | (uint32_t)kPQ_Float; - POWERQUAD->INAFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_16Bit << 4U) | (uint32_t)kPQ_Float; - POWERQUAD->INBFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_Float << 4U) | (uint32_t)kPQ_Float; - POWERQUAD->TMPFORMAT = ((uint32_t)(0) << 8U) | ((uint32_t)kPQ_Float << 4U) | (uint32_t)kPQ_Float; - POWERQUAD->TMPBASE = 0xE0000000U; - - PQ_MatrixProduct(POWERQUAD, length, pOut, (void *)(uint32_t *)0xE0000000U, pOut); - - PQ_WaitDone(POWERQUAD); - - for (i = 0; i < lenPerMatLoop / 4U; i++) - { - pOut[0] -= pOut[1]; - pOut = &pOut[2]; - pOut[0] -= pOut[1]; - pOut = &pOut[2]; - pOut[0] -= pOut[1]; - pOut = &pOut[2]; - pOut[0] -= pOut[1]; - pOut = &pOut[2]; - } - } - - /* ----------- Post-processing ---------- */ - /* DCT-IV can be obtained from DCT-II by the equation, - * Y4(k) = Y2(k) - Y4(k-1) and Y4(-1) = Y4(0) - * Hence, Y4(0) = Y2(0)/2 */ - /* Getting only real part from the output and Converting to DCT-IV */ - - /* pbuff initialized to input buffer. */ - pbuff = pInlineBuffer; - - /* pS1 initialized to pState */ - pS1 = pState; - - /* Calculating Y4(0) from Y2(0) using Y4(0) = Y2(0)/2. Considering the DCT II normalize, here divided by sqrt(2).*/ - in = (q15_t)(float)((float)*pS1 / 1.41421356237f); - *pbuff++ = in; - pS1 = &pS1[2]; - - in = *pS1 - in; - *pbuff++ = in; - pS1 = &pS1[2]; - - in = *pS1 - in; - *pbuff++ = in; - pS1 = &pS1[2]; - - in = *pS1 - in; - *pbuff++ = in; - pS1 = &pS1[2]; - - i = S->N / 4U - 1U; - - while (i > 0U) - { - in = *pS1 - in; - *pbuff++ = in; - pS1 = &pS1[2]; - - in = *pS1 - in; - *pbuff++ = in; - pS1 = &pS1[2]; - - in = *pS1 - in; - *pbuff++ = in; - pS1 = &pS1[2]; - - in = *pS1 - in; - *pbuff++ = in; - pS1 = &pS1[2]; - - i--; - } -} - -void arm_fir_init_f32( - arm_fir_instance_f32 *S, uint16_t numTaps, const float32_t *pCoeffs, float32_t *pState, uint32_t blockSize) -{ - uint32_t i; - - /* - * CMSIS DSP API filter coefficients stored in time reversed order, but PQ - * uses the positive order. PQ does not use pState, so pState pState[1:numTaps] - * is used here to save the coefficients in positive order. At the same time, - * pState[0] is used to save the offset used for incremetal calculation. - * Because the length of pState is (numTaps + blockSize -1), to ensure enough space, - * the blockSize should be larger than 1. - */ - assert(blockSize > 1U); - - S->numTaps = numTaps; - S->pCoeffs = pCoeffs; - S->pState = pState; - - for (i = 0U; i < numTaps; i++) - { - pState[numTaps - i] = pCoeffs[i]; - } - - *(uint32_t *)(void *)pState = 0U; -} - -void arm_fir_init_q31( - arm_fir_instance_q31 *S, uint16_t numTaps, const q31_t *pCoeffs, q31_t *pState, uint32_t blockSize) -{ - uint32_t i; - - /* - * CMSIS DSP API filter coefficients stored in time reversed order, but PQ - * uses the positive order. PQ does not use pState, so pState pState[1:numTaps] - * is used here to save the coefficients in positive order. At the same time, - * pState[0] is used to save the offset used for incremetal calculation. - * Because the length of pState is (numTaps + blockSize -1), to ensure enough space, - * the blockSize should be larger than 1. - */ - assert(blockSize > 1U); - - S->numTaps = numTaps; - S->pCoeffs = pCoeffs; - S->pState = pState; - - for (i = 0U; i < numTaps; i++) - { - pState[numTaps - i] = pCoeffs[i]; - } - - pState[0] = 0; -} - -arm_status arm_fir_init_q15( - arm_fir_instance_q15 *S, uint16_t numTaps, const q15_t *pCoeffs, q15_t *pState, uint32_t blockSize) -{ - uint16_t i; - - /* - * CMSIS DSP API filter coefficients stored in time reversed order, but PQ - * uses the positive order. PQ does not use pState, so pState pState[2:numTaps] - * is used here to save the coefficients in positive order. At the same time, - * pState[0:1] is used to save the offset used for incremetal calculation. - * Because the length of pState is (numTaps + blockSize -1), to ensure enough space, - * the blockSize should be larger than 2. - */ - assert(blockSize > 2U); - - S->numTaps = numTaps; - S->pCoeffs = pCoeffs; - S->pState = pState; - - for (i = 0U; i < numTaps; i++) - { - pState[numTaps + 1U - i] = pCoeffs[i]; - } - - *(uint32_t *)(void *)pState = 0U; - - return ARM_MATH_SUCCESS; -} - -/** - * brief Processing function for the floating-point FIR filter. - * param[in] S points to an instance of the floating-point FIR structure. - * param[in] pSrc points to the block of input data. - * param[out] pDst points to the block of output data. - * param[in] blockSize number of samples to process. - * - * Note: Powerquad has a hardware limitation, when using it for FIR increment calculation, the address of pSrc needs to - * be a continuous address. - */ -void arm_fir_f32(const arm_fir_instance_f32 *S, const float32_t *pSrc, float32_t *pDst, uint32_t blockSize) -{ - assert(NULL != S); - assert(NULL != pSrc); - assert(NULL != pDst); - - uint32_t curOffset; - PQ_SET_F32_CONFIG; - - curOffset = *(uint32_t *)(void *)(S->pState); - - if (curOffset == 0U) - { - PQ_FIR(POWERQUAD, pSrc, (int32_t)blockSize, &(S->pState[1]), (int32_t)S->numTaps, pDst, PQ_FIR_FIR); - } - else - { - _arm_fir_increment(pSrc, blockSize, &S->pState[1], S->numTaps, pDst, curOffset, sizeof(*pSrc)); - } - - *(uint32_t *)(void *)(S->pState) = curOffset + blockSize; - - PQ_WaitDone(POWERQUAD); -} - -void arm_fir_q31(const arm_fir_instance_q31 *S, const q31_t *pSrc, q31_t *pDst, uint32_t blockSize) -{ - assert(NULL != S); - assert(NULL != pSrc); - assert(NULL != pDst); - - uint32_t curOffset; - PQ_SET_Q31_CONFIG; - - curOffset = *(uint32_t *)(void *)(S->pState); - - if (curOffset == 0U) - { - PQ_FIR(POWERQUAD, pSrc, (int32_t)blockSize, &(S->pState[1]), (int32_t)S->numTaps, pDst, PQ_FIR_FIR); - } - else - { - _arm_fir_increment(pSrc, blockSize, &S->pState[1], S->numTaps, pDst, curOffset, sizeof(*pSrc)); - } - - *(uint32_t *)(void *)(S->pState) = curOffset + blockSize; - - PQ_WaitDone(POWERQUAD); -} - -void arm_fir_q15(const arm_fir_instance_q15 *S, const q15_t *pSrc, q15_t *pDst, uint32_t blockSize) -{ - assert(NULL != S); - assert(NULL != pSrc); - assert(NULL != pDst); - - uint32_t curOffset; - - PQ_SET_Q15_CONFIG; - - curOffset = *(uint32_t *)(void *)(S->pState); - - if (curOffset == 0U) - { - PQ_FIR(POWERQUAD, pSrc, (int32_t)blockSize, &(S->pState[2]), (int32_t)S->numTaps, pDst, PQ_FIR_FIR); - } - else - { - _arm_fir_increment(pSrc, blockSize, &S->pState[2], S->numTaps, pDst, curOffset, sizeof(*pSrc)); - } - - *(uint32_t *)(void *)(S->pState) = curOffset + blockSize; - - PQ_WaitDone(POWERQUAD); -} - -void arm_conv_f32(const float32_t *pSrcA, uint32_t srcALen, const float32_t *pSrcB, uint32_t srcBLen, float32_t *pDst) -{ - assert(NULL != pSrcA); - assert(NULL != pSrcB); - assert(NULL != pDst); - - PQ_SET_F32_CONFIG; - - PQ_FIR(POWERQUAD, pSrcA, (int32_t)srcALen, pSrcB, (int32_t)srcBLen, pDst, PQ_FIR_CONVOLUTION); - PQ_WaitDone(POWERQUAD); -} - -void arm_conv_q31(const q31_t *pSrcA, uint32_t srcALen, const q31_t *pSrcB, uint32_t srcBLen, q31_t *pDst) -{ - assert(NULL != pSrcA); - assert(NULL != pSrcB); - assert(NULL != pDst); - - PQ_SET_Q31_CONFIG; - - PQ_FIR(POWERQUAD, pSrcA, (int32_t)srcALen, pSrcB, (int32_t)srcBLen, pDst, PQ_FIR_CONVOLUTION); - PQ_WaitDone(POWERQUAD); -} - -void arm_conv_q15(const q15_t *pSrcA, uint32_t srcALen, const q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst) -{ - assert(NULL != pSrcA); - assert(NULL != pSrcB); - assert(NULL != pDst); - - PQ_SET_Q15_CONFIG; - - PQ_FIR(POWERQUAD, pSrcA, (int32_t)srcALen, pSrcB, (int32_t)srcBLen, pDst, PQ_FIR_CONVOLUTION); - PQ_WaitDone(POWERQUAD); -} - -void arm_correlate_f32( - const float32_t *pSrcA, uint32_t srcALen, const float32_t *pSrcB, uint32_t srcBLen, float32_t *pDst) -{ - assert(NULL != pSrcA); - assert(NULL != pSrcB); - assert(NULL != pDst); - - PQ_SET_F32_CONFIG; - - PQ_FIR(POWERQUAD, pSrcA, (int32_t)srcALen, pSrcB, (int32_t)srcBLen, pDst, PQ_FIR_CORRELATION); - PQ_WaitDone(POWERQUAD); -} - -void arm_correlate_q31(const q31_t *pSrcA, uint32_t srcALen, const q31_t *pSrcB, uint32_t srcBLen, q31_t *pDst) -{ - assert(NULL != pSrcA); - assert(NULL != pSrcB); - assert(NULL != pDst); - - PQ_SET_Q31_CONFIG; - - PQ_FIR(POWERQUAD, pSrcA, (int32_t)srcALen, pSrcB, (int32_t)srcBLen, pDst, PQ_FIR_CORRELATION); - PQ_WaitDone(POWERQUAD); -} - -void arm_correlate_q15(const q15_t *pSrcA, uint32_t srcALen, const q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst) -{ - assert(NULL != pSrcA); - assert(NULL != pSrcB); - assert(NULL != pDst); - - PQ_SET_Q15_CONFIG; - - PQ_FIR(POWERQUAD, pSrcA, (int32_t)srcALen, pSrcB, (int32_t)srcBLen, pDst, PQ_FIR_CORRELATION); - PQ_WaitDone(POWERQUAD); -} - -void arm_mat_init_f32(arm_matrix_instance_f32 *S, uint16_t nRows, uint16_t nColumns, float32_t *pData) -{ - /* Assign Number of Rows */ - S->numRows = nRows; - - /* Assign Number of Columns */ - S->numCols = nColumns; - - /* Assign Data pointer */ - S->pData = pData; -} - -void arm_mat_init_q31(arm_matrix_instance_q31 *S, uint16_t nRows, uint16_t nColumns, q31_t *pData) -{ - /* Assign Number of Rows */ - S->numRows = nRows; - - /* Assign Number of Columns */ - S->numCols = nColumns; - - /* Assign Data pointer */ - S->pData = pData; -} - -void arm_mat_init_q15(arm_matrix_instance_q15 *S, uint16_t nRows, uint16_t nColumns, q15_t *pData) -{ - /* Assign Number of Rows */ - S->numRows = nRows; - - /* Assign Number of Columns */ - S->numCols = nColumns; - - /* Assign Data pointer */ - S->pData = pData; -} - -arm_status arm_mat_add_f32(const arm_matrix_instance_f32 *pSrcA, - const arm_matrix_instance_f32 *pSrcB, - arm_matrix_instance_f32 *pDst) -{ - assert(NULL != pSrcA); - assert(NULL != pSrcB); - assert(NULL != pDst); - - arm_status status; - uint32_t length; - -#ifdef ARM_MATH_MATRIX_CHECK - /* Check for matrix mismatch condition */ - if ((pSrcA->numRows != pSrcB->numRows) || (pSrcA->numCols != pSrcB->numCols) || (pSrcA->numRows != pDst->numRows) || - (pSrcA->numCols != pDst->numCols)) - { - /* Set status as ARM_MATH_SIZE_MISMATCH */ - status = ARM_MATH_SIZE_MISMATCH; - } - else -#endif - { - PQ_SET_F32_CONFIG; - - length = POWERQUAD_MAKE_MATRIX_LEN(pSrcA->numRows, pSrcA->numCols, pSrcB->numCols); - - PQ_MatrixAddition(POWERQUAD, length, pSrcA->pData, pSrcB->pData, pDst->pData); - - /* Wait for the completion */ - PQ_WaitDone(POWERQUAD); - - status = ARM_MATH_SUCCESS; - } - - /* Return to application */ - return status; -} - -arm_status arm_mat_add_q31(const arm_matrix_instance_q31 *pSrcA, - const arm_matrix_instance_q31 *pSrcB, - arm_matrix_instance_q31 *pDst) -{ - assert(NULL != pSrcA); - assert(NULL != pSrcB); - assert(NULL != pDst); - - arm_status status; - uint32_t length; - -#ifdef ARM_MATH_MATRIX_CHECK - /* Check for matrix mismatch condition */ - if ((pSrcA->numRows != pSrcB->numRows) || (pSrcA->numCols != pSrcB->numCols) || (pSrcA->numRows != pDst->numRows) || - (pSrcA->numCols != pDst->numCols)) - { - /* Set status as ARM_MATH_SIZE_MISMATCH */ - status = ARM_MATH_SIZE_MISMATCH; - } - else -#endif - { - PQ_SET_FIX32_CONFIG; - - length = POWERQUAD_MAKE_MATRIX_LEN(pSrcA->numRows, pSrcA->numCols, pSrcB->numCols); - - PQ_MatrixAddition(POWERQUAD, length, pSrcA->pData, pSrcB->pData, pDst->pData); - - /* Wait for the completion */ - PQ_WaitDone(POWERQUAD); - - status = ARM_MATH_SUCCESS; - } - - /* Return to application */ - return status; -} - -arm_status arm_mat_add_q15(const arm_matrix_instance_q15 *pSrcA, - const arm_matrix_instance_q15 *pSrcB, - arm_matrix_instance_q15 *pDst) -{ - assert(NULL != pSrcA); - assert(NULL != pSrcB); - assert(NULL != pDst); - - arm_status status; - uint32_t length; - -#ifdef ARM_MATH_MATRIX_CHECK - /* Check for matrix mismatch condition */ - if ((pSrcA->numRows != pSrcB->numRows) || (pSrcA->numCols != pSrcB->numCols) || (pSrcA->numRows != pDst->numRows) || - (pSrcA->numCols != pDst->numCols)) - { - /* Set status as ARM_MATH_SIZE_MISMATCH */ - status = ARM_MATH_SIZE_MISMATCH; - } - else -#endif - { - PQ_SET_FIX16_CONFIG; - - length = POWERQUAD_MAKE_MATRIX_LEN(pSrcA->numRows, pSrcA->numCols, pSrcB->numCols); - - PQ_MatrixAddition(POWERQUAD, length, pSrcA->pData, pSrcB->pData, pDst->pData); - - /* Wait for the completion */ - PQ_WaitDone(POWERQUAD); - - status = ARM_MATH_SUCCESS; - } - - /* Return to application */ - return status; -} - -arm_status arm_mat_sub_f32(const arm_matrix_instance_f32 *pSrcA, - const arm_matrix_instance_f32 *pSrcB, - arm_matrix_instance_f32 *pDst) -{ - assert(NULL != pSrcA); - assert(NULL != pSrcB); - assert(NULL != pDst); - - arm_status status; - uint32_t length; - -#ifdef ARM_MATH_MATRIX_CHECK - /* Check for matrix mismatch condition */ - if ((pSrcA->numRows != pSrcB->numRows) || (pSrcA->numCols != pSrcB->numCols) || (pSrcA->numRows != pDst->numRows) || - (pSrcA->numCols != pDst->numCols)) - { - /* Set status as ARM_MATH_SIZE_MISMATCH */ - status = ARM_MATH_SIZE_MISMATCH; - } - else -#endif - { - PQ_SET_F32_CONFIG; - - length = POWERQUAD_MAKE_MATRIX_LEN(pSrcA->numRows, pSrcA->numCols, pSrcB->numCols); - - PQ_MatrixSubtraction(POWERQUAD, length, pSrcA->pData, pSrcB->pData, pDst->pData); - - /* Wait for the completion */ - PQ_WaitDone(POWERQUAD); - - status = ARM_MATH_SUCCESS; - } - - /* Return to application */ - return status; -} - -arm_status arm_mat_sub_q31(const arm_matrix_instance_q31 *pSrcA, - const arm_matrix_instance_q31 *pSrcB, - arm_matrix_instance_q31 *pDst) -{ - assert(NULL != pSrcA); - assert(NULL != pSrcB); - assert(NULL != pDst); - - arm_status status; - uint32_t length; - -#ifdef ARM_MATH_MATRIX_CHECK - /* Check for matrix mismatch condition */ - if ((pSrcA->numRows != pSrcB->numRows) || (pSrcA->numCols != pSrcB->numCols) || (pSrcA->numRows != pDst->numRows) || - (pSrcA->numCols != pDst->numCols)) - { - /* Set status as ARM_MATH_SIZE_MISMATCH */ - status = ARM_MATH_SIZE_MISMATCH; - } - else -#endif - { - PQ_SET_FIX32_CONFIG; - - length = POWERQUAD_MAKE_MATRIX_LEN(pSrcA->numRows, pSrcA->numCols, pSrcB->numCols); - - PQ_MatrixSubtraction(POWERQUAD, length, pSrcA->pData, pSrcB->pData, pDst->pData); - - /* Wait for the completion */ - PQ_WaitDone(POWERQUAD); - - status = ARM_MATH_SUCCESS; - } - - /* Return to application */ - return status; -} - -arm_status arm_mat_sub_q15(const arm_matrix_instance_q15 *pSrcA, - const arm_matrix_instance_q15 *pSrcB, - arm_matrix_instance_q15 *pDst) -{ - assert(NULL != pSrcA); - assert(NULL != pSrcB); - assert(NULL != pDst); - - arm_status status; - uint32_t length; - -#ifdef ARM_MATH_MATRIX_CHECK - /* Check for matrix mismatch condition */ - if ((pSrcA->numRows != pSrcB->numRows) || (pSrcA->numCols != pSrcB->numCols) || (pSrcA->numRows != pDst->numRows) || - (pSrcA->numCols != pDst->numCols)) - { - /* Set status as ARM_MATH_SIZE_MISMATCH */ - status = ARM_MATH_SIZE_MISMATCH; - } - else -#endif - { - PQ_SET_FIX16_CONFIG; - - length = POWERQUAD_MAKE_MATRIX_LEN(pSrcA->numRows, pSrcA->numCols, pSrcB->numCols); - - PQ_MatrixSubtraction(POWERQUAD, length, pSrcA->pData, pSrcB->pData, pDst->pData); - - /* Wait for the completion */ - PQ_WaitDone(POWERQUAD); - - status = ARM_MATH_SUCCESS; - } - - /* Return to application */ - return status; -} - -arm_status arm_mat_mult_f32(const arm_matrix_instance_f32 *pSrcA, - const arm_matrix_instance_f32 *pSrcB, - arm_matrix_instance_f32 *pDst) -{ - assert(NULL != pSrcA); - assert(NULL != pSrcB); - assert(NULL != pDst); - - arm_status status; - uint32_t length; - -#ifdef ARM_MATH_MATRIX_CHECK - /* Check for matrix mismatch condition */ - if ((pSrcA->numRows != pSrcB->numRows) || (pSrcA->numCols != pSrcB->numCols) || (pSrcA->numRows != pDst->numRows) || - (pSrcA->numCols != pDst->numCols)) - { - /* Set status as ARM_MATH_SIZE_MISMATCH */ - status = ARM_MATH_SIZE_MISMATCH; - } - else -#endif - { - PQ_SET_F32_CONFIG; - - length = POWERQUAD_MAKE_MATRIX_LEN(pSrcA->numRows, pSrcA->numCols, pSrcB->numCols); - - PQ_MatrixMultiplication(POWERQUAD, length, pSrcA->pData, pSrcB->pData, pDst->pData); - - /* Wait for the completion */ - PQ_WaitDone(POWERQUAD); - - status = ARM_MATH_SUCCESS; - } - - /* Return to application */ - return status; -} - -arm_status arm_mat_mult_q31(const arm_matrix_instance_q31 *pSrcA, - const arm_matrix_instance_q31 *pSrcB, - arm_matrix_instance_q31 *pDst) -{ - assert(NULL != pSrcA); - assert(NULL != pSrcB); - assert(NULL != pDst); - - arm_status status; - uint32_t length; - - /* - * The output prescale does not supprt negative value due to hardware issue, - * workaround: - * 1. Downscale the matrix B and save the float output value to private memory. - * 2. Multiply the float matrix B in private memory with matrix A, output as Q31. - * Note: Put matrix B in private memory is faster. - */ - -#ifdef ARM_MATH_MATRIX_CHECK - /* Check for matrix mismatch condition */ - if ((pSrcA->numRows != pSrcB->numRows) || (pSrcA->numCols != pSrcB->numCols) || (pSrcA->numRows != pDst->numRows) || - (pSrcA->numCols != pDst->numCols)) - { - /* Set status as ARM_MATH_SIZE_MISMATCH */ - status = ARM_MATH_SIZE_MISMATCH; - } - else -#endif - { - length = POWERQUAD_MAKE_MATRIX_LEN(pSrcB->numRows, pSrcB->numCols, 0U); - - PQ_SET_MAT_FIX32_WORKAROUND_SCALE_CONFIG; - - /* Downscale. */ - PQ_MatrixScale(POWERQUAD, length, 1.0f / 2147483648.0f, pSrcB->pData, (void *)(uint32_t *)0xE0000000U); - - length = POWERQUAD_MAKE_MATRIX_LEN(pSrcA->numRows, pSrcA->numCols, pSrcB->numCols); - - PQ_WaitDone(POWERQUAD); - - PQ_SET_MAT_FIX32_WORKAROUND_MULT_CONFIG; - - PQ_MatrixMultiplication(POWERQUAD, length, pSrcA->pData, (void *)(uint32_t *)0xE0000000U, pDst->pData); - - /* Wait for the completion */ - PQ_WaitDone(POWERQUAD); - - status = ARM_MATH_SUCCESS; - } - - /* Return to application */ - return status; -} - -arm_status arm_mat_mult_q15(const arm_matrix_instance_q15 *pSrcA, - const arm_matrix_instance_q15 *pSrcB, - arm_matrix_instance_q15 *pDst, - q15_t *pState) -{ - assert(NULL != pSrcA); - assert(NULL != pSrcB); - assert(NULL != pDst); - - arm_status status; - uint32_t length; - -#ifdef ARM_MATH_MATRIX_CHECK - /* Check for matrix mismatch condition */ - if ((pSrcA->numRows != pSrcB->numRows) || (pSrcA->numCols != pSrcB->numCols) || (pSrcA->numRows != pDst->numRows) || - (pSrcA->numCols != pDst->numCols)) - { - /* Set status as ARM_MATH_SIZE_MISMATCH */ - status = ARM_MATH_SIZE_MISMATCH; - } - else -#endif - { - length = POWERQUAD_MAKE_MATRIX_LEN(pSrcB->numRows, pSrcB->numCols, 0U); - - PQ_SET_MAT_FIX16_WORKAROUND_SCALE_CONFIG; - - /* Downscale. */ - PQ_MatrixScale(POWERQUAD, length, 1.0f / 32768.0f, pSrcB->pData, (void *)(uint32_t *)0xE0000000U); - - length = POWERQUAD_MAKE_MATRIX_LEN(pSrcA->numRows, pSrcA->numCols, pSrcB->numCols); - - PQ_WaitDone(POWERQUAD); - - PQ_SET_MAT_FIX16_WORKAROUND_MULT_CONFIG; - - PQ_MatrixMultiplication(POWERQUAD, length, pSrcA->pData, (void *)(uint32_t *)0xE0000000U, pDst->pData); - - /* Wait for the completion */ - PQ_WaitDone(POWERQUAD); - - status = ARM_MATH_SUCCESS; - } - - /* Return to application */ - return status; -} - -arm_status arm_mat_inverse_f32(const arm_matrix_instance_f32 *src, arm_matrix_instance_f32 *dst) -{ - assert(NULL != src); - assert(NULL != dst); - - arm_status status; - uint32_t length; - float tmp[1024]; - -#ifdef ARM_MATH_MATRIX_CHECK - /* Check for matrix mismatch condition */ - if ((src->numRows != src->numCols) || (dst->numRows != dst->numCols) || (src->numRows != dst->numRows)) - { - /* Set status as ARM_MATH_SIZE_MISMATCH */ - status = ARM_MATH_SIZE_MISMATCH; - } - else -#endif - { - PQ_SET_F32_CONFIG; - - length = POWERQUAD_MAKE_MATRIX_LEN(src->numRows, src->numCols, src->numRows); - - PQ_MatrixInversion(POWERQUAD, length, src->pData, tmp, dst->pData); - - /* Wait for the completion */ - PQ_WaitDone(POWERQUAD); - - status = ARM_MATH_SUCCESS; - } - - /* Return to application */ - return status; -} - -arm_status arm_mat_trans_f32(const arm_matrix_instance_f32 *pSrc, arm_matrix_instance_f32 *pDst) -{ - assert(NULL != pSrc); - assert(NULL != pDst); - - arm_status status; - uint32_t length; - -#ifdef ARM_MATH_MATRIX_CHECK - /* Check for matrix mismatch condition */ - if ((pSrc->numRows != pSrc->numCols) || (pDst->numRows != pDst->numCols) || (pSrc->numRows != pDst->numRows)) - { - /* Set status as ARM_MATH_SIZE_MISMATCH */ - status = ARM_MATH_SIZE_MISMATCH; - } - else -#endif - { - length = POWERQUAD_MAKE_MATRIX_LEN(pSrc->numRows, pSrc->numCols, 0U); - - PQ_SetFormat(POWERQUAD, kPQ_CP_MTX, kPQ_Float); - - PQ_MatrixTranspose(POWERQUAD, length, pSrc->pData, pDst->pData); - - /* Wait for the completion */ - PQ_WaitDone(POWERQUAD); - status = ARM_MATH_SUCCESS; - } - - /* Return to application */ - return status; -} - -arm_status arm_mat_trans_q31(const arm_matrix_instance_q31 *pSrc, arm_matrix_instance_q31 *pDst) -{ - assert(NULL != pSrc); - assert(NULL != pDst); - - arm_status status; - uint32_t length; - -#ifdef ARM_MATH_MATRIX_CHECK - /* Check for matrix mismatch condition */ - if ((pSrc->numRows != pSrc->numCols) || (pDst->numRows != pDst->numCols) || (pSrc->numRows != pDst->numRows)) - { - /* Set status as ARM_MATH_SIZE_MISMATCH */ - status = ARM_MATH_SIZE_MISMATCH; - } - else -#endif - { - PQ_SET_FIX32_CONFIG; - - length = POWERQUAD_MAKE_MATRIX_LEN(pSrc->numRows, pSrc->numCols, 0U); - - PQ_MatrixTranspose(POWERQUAD, length, pSrc->pData, pDst->pData); - - /* Wait for the completion */ - PQ_WaitDone(POWERQUAD); - - status = ARM_MATH_SUCCESS; - } - - /* Return to application */ - return status; -} - -arm_status arm_mat_trans_q15(const arm_matrix_instance_q15 *pSrc, arm_matrix_instance_q15 *pDst) -{ - assert(NULL != pSrc); - assert(NULL != pDst); - - arm_status status; - uint32_t length; - -#ifdef ARM_MATH_MATRIX_CHECK - /* Check for matrix mismatch condition */ - if ((pSrc->numRows != pSrc->numCols) || (pDst->numRows != pDst->numCols) || (pSrc->numRows != pDst->numRows)) - { - /* Set status as ARM_MATH_SIZE_MISMATCH */ - status = ARM_MATH_SIZE_MISMATCH; - } - else -#endif - { - PQ_SET_FIX16_CONFIG; - - length = POWERQUAD_MAKE_MATRIX_LEN(pSrc->numRows, pSrc->numCols, 0U); - - PQ_MatrixTranspose(POWERQUAD, length, pSrc->pData, pDst->pData); - - /* Wait for the completion */ - PQ_WaitDone(POWERQUAD); - - status = ARM_MATH_SUCCESS; - } - - /* Return to application */ - return status; -} - -arm_status arm_mat_scale_f32(const arm_matrix_instance_f32 *pSrc, float32_t scale, arm_matrix_instance_f32 *pDst) -{ - assert(NULL != pSrc); - assert(NULL != pDst); - - arm_status status; - uint32_t length; - -#ifdef ARM_MATH_MATRIX_CHECK - /* Check for matrix mismatch condition */ - if ((pSrc->numRows != pSrc->numCols) || (pDst->numRows != pDst->numCols) || (pSrc->numRows != pDst->numRows)) - { - /* Set status as ARM_MATH_SIZE_MISMATCH */ - status = ARM_MATH_SIZE_MISMATCH; - } - else -#endif - { - PQ_SET_F32_CONFIG; - - length = POWERQUAD_MAKE_MATRIX_LEN(pSrc->numRows, pSrc->numCols, 0U); - - PQ_MatrixScale(POWERQUAD, length, scale, pSrc->pData, pDst->pData); - - /* Wait for the completion */ - PQ_WaitDone(POWERQUAD); - - status = ARM_MATH_SUCCESS; - } - - /* Return to application */ - return status; -} - -arm_status arm_mat_scale_q31(const arm_matrix_instance_q31 *pSrc, - q31_t scaleFract, - int32_t shift, - arm_matrix_instance_q31 *pDst) -{ - assert(NULL != pSrc); - assert(NULL != pDst); - - arm_status status; - uint32_t length; - float scaleFloat; - - pq_config_t config = { - kPQ_32Bit, /* inputAFormat */ - 0, /* inputAPrescale */ - kPQ_32Bit, /* inputBFormat */ - 0, /* inputBPrescale */ - kPQ_32Bit, /* outputFormat */ - (int8_t)shift, /* outputPrescale */ - kPQ_Float, /* tmpFormat */ - 0, /* tmpPrescale */ - kPQ_Float, /* machineFormat */ - (uint32_t *)0xe0000000U, /* tmpBase */ - }; - -#ifdef ARM_MATH_MATRIX_CHECK - /* Check for matrix mismatch condition */ - if ((pSrc->numRows != pSrc->numCols) || (pDst->numRows != pDst->numCols) || (pSrc->numRows != pDst->numRows)) - { - /* Set status as ARM_MATH_SIZE_MISMATCH */ - status = ARM_MATH_SIZE_MISMATCH; - } - else -#endif - { - length = POWERQUAD_MAKE_MATRIX_LEN(pSrc->numRows, pSrc->numCols, 0U); - - scaleFloat = PQ_Q31_2_FLOAT(scaleFract); - - PQ_SetConfig(POWERQUAD, &config); - - PQ_MatrixScale(POWERQUAD, length, scaleFloat, pSrc->pData, pDst->pData); - - /* Wait for the completion */ - PQ_WaitDone(POWERQUAD); - - status = ARM_MATH_SUCCESS; - } - - /* Return to application */ - return status; -} - -arm_status arm_mat_scale_q15(const arm_matrix_instance_q15 *pSrc, - q15_t scaleFract, - int32_t shift, - arm_matrix_instance_q15 *pDst) -{ - assert(NULL != pSrc); - assert(NULL != pDst); - - arm_status status; - uint32_t length; - float scaleFloat; - - pq_config_t config = { - kPQ_16Bit, /* inputAFormat */ - 0, /* inputAPrescale */ - kPQ_16Bit, /* inputBFormat */ - 0, /* inputBPrescale */ - kPQ_16Bit, /* outputFormat */ - (int8_t)shift, /* outputPrescale */ - kPQ_Float, /* tmpFormat */ - 0, /* tmpPrescale */ - kPQ_Float, /* machineFormat */ - (uint32_t *)0xe0000000U, /* tmpBase */ - }; - -#ifdef ARM_MATH_MATRIX_CHECK - /* Check for matrix mismatch condition */ - if ((pSrc->numRows != pSrc->numCols) || (pDst->numRows != pDst->numCols) || (pSrc->numRows != pDst->numRows)) - { - /* Set status as ARM_MATH_SIZE_MISMATCH */ - status = ARM_MATH_SIZE_MISMATCH; - } - else -#endif - { - length = POWERQUAD_MAKE_MATRIX_LEN(pSrc->numRows, pSrc->numCols, 0U); - - scaleFloat = PQ_Q15_2_FLOAT(scaleFract); - - PQ_SetConfig(POWERQUAD, &config); - - PQ_MatrixScale(POWERQUAD, length, scaleFloat, pSrc->pData, pDst->pData); - - /* Wait for the completion */ - PQ_WaitDone(POWERQUAD); - - status = ARM_MATH_SUCCESS; - } - - /* Return to application */ - return status; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_powerquad_data.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_powerquad_data.c deleted file mode 100644 index a0b613263e0..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_powerquad_data.c +++ /dev/null @@ -1,585 +0,0 @@ -/* - * Copyright 2018-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include -#include "fsl_powerquad_data.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.powerquad" -#endif - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ -/*! - * @brief MATLAB script for calculating twiddle factor table for DCT is below,this gives phasor for FFTs twiddle at end - * of DCT, - * note that y is raw, scaled y is for fixed point multiplication. - * - * N=32; - * n=0; - * while(n - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -extern int32_t dct16_twiddle[32]; -extern int32_t dct32_twiddle[64]; -extern int32_t dct64_twiddle[128]; -extern int32_t dct128_twiddle[256]; -extern int32_t dct256_twiddle[512]; -extern int32_t dct512_twiddle[1024]; -extern int32_t idct16_twiddle[32]; -extern int32_t idct32_twiddle[64]; -extern int32_t idct64_twiddle[128]; -extern int32_t idct128_twiddle[256]; -extern int32_t idct256_twiddle[512]; -extern int32_t idct512_twiddle[1024]; -extern int32_t dct16_cosFactor[16]; -extern int32_t dct32_cosFactor[32]; -extern int32_t dct64_cosFactor[64]; -extern int32_t dct128_cosFactor[128]; -extern int32_t dct256_cosFactor[256]; -extern int32_t dct512_cosFactor[512]; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -#endif /* FSL_POWERQUAD_DATA_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_powerquad_filter.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_powerquad_filter.c deleted file mode 100644 index 7efe7987977..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_powerquad_filter.c +++ /dev/null @@ -1,428 +0,0 @@ -/* - * Copyright 2018-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_powerquad.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.powerquad_filter" -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -void PQ_VectorBiquadDf2F32(float *pSrc, float *pDst, int32_t length) -{ - int32_t remainderBy8 = length % 8; - pq_float_t val; - - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - val.floatX = *pSrc++; - _pq_biquad0(val.integerX); - val.integerX = _pq_readAdd0(); - *pDst++ = val.floatX; - } - } - - if (length > 0) - { - PQ_StartVector(pSrc, pDst, length); - PQ_Vector8BiquadDf2F32(); - PQ_EndVector(); - } -} - -void PQ_VectorBiquadDf2Fixed32(int32_t *pSrc, int32_t *pDst, int32_t length) -{ - int32_t remainderBy8 = length % 8; - - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - _pq_biquad0_fx(*pSrc++); - *pDst++ = (int32_t)_pq_readAdd0_fx(); - } - } - - if (length > 0) - { - PQ_StartVector(pSrc, pDst, length); - PQ_Vector8BiquadDf2Fixed32(); - PQ_EndVector(); - } -} - -void PQ_VectorBiquadDf2Fixed16(int16_t *pSrc, int16_t *pDst, int32_t length) -{ - int32_t remainderBy8 = length % 8; - - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - _pq_biquad0_fx(*pSrc++); - *pDst++ = (int16_t)_pq_readAdd0_fx(); - } - } - - if (length > 0) - { - PQ_StartVectorFixed16(pSrc, pDst, length); - PQ_Vector8BiquadDf2Fixed16(); - PQ_EndVector(); - } -} - -void PQ_VectorBiquadCascadeDf2F32(float *pSrc, float *pDst, int32_t length) -{ - int32_t remainderBy8 = length % 8; - pq_float_t val; - - if (remainderBy8 > 0) - { - length -= remainderBy8; - - PQ_Biquad1F32(&pSrc[0], &pDst[0]); - - for (int i = 1; i < remainderBy8; i++) - { - val.floatX = pSrc[i - 1]; - _pq_biquad0(val.integerX); - - val.floatX = pSrc[i]; - _pq_biquad1(val.integerX); - - val.integerX = _pq_readAdd0(); - pDst[i - 1] = val.floatX; - - val.integerX = _pq_readAdd1(); - pDst[i] = val.floatX; - } - - PQ_BiquadF32(&pSrc[remainderBy8 - 1], &pDst[remainderBy8 - 1]); - } - - if (length > 0) - { - PQ_StartVector(&pSrc[remainderBy8], &pDst[remainderBy8], length); - PQ_Vector8BiquadDf2CascadeF32(); - PQ_EndVector(); - } -} - -void PQ_VectorBiquadCascadeDf2Fixed32(int32_t *pSrc, int32_t *pDst, int32_t length) -{ - int32_t remainderBy8 = length % 8; - - if (remainderBy8 > 0) - { - length -= remainderBy8; - - _pq_biquad1_fx(pSrc[0]); - pDst[0] = (int32_t)_pq_readAdd1_fx(); - - for (int i = 1; i < remainderBy8; i++) - { - _pq_biquad0_fx(pSrc[i - 1]); - _pq_biquad1_fx(pSrc[i]); - pDst[i - 1] = (int32_t)_pq_readAdd0_fx(); - pDst[i] = (int32_t)_pq_readAdd1_fx(); - } - - _pq_biquad0_fx(pSrc[remainderBy8 - 1]); - pDst[remainderBy8 - 1] = (int32_t)_pq_readAdd0_fx(); - } - - if (length > 0) - { - PQ_StartVector(&pSrc[remainderBy8], &pDst[remainderBy8], length); - PQ_Vector8BiquadDf2CascadeFixed32(); - PQ_EndVector(); - } -} - -void PQ_VectorBiquadCascadeDf2Fixed16(int16_t *pSrc, int16_t *pDst, int32_t length) -{ - int32_t remainderBy8 = length % 8; - - if (remainderBy8 > 0) - { - length -= remainderBy8; - - _pq_biquad1_fx(pSrc[0]); - pDst[0] = (int16_t)_pq_readAdd1_fx(); - - for (int i = 1; i < remainderBy8; i++) - { - _pq_biquad0_fx(pSrc[i - 1]); - _pq_biquad1_fx(pSrc[i]); - pDst[i - 1] = (int16_t)_pq_readAdd0_fx(); - pDst[i] = (int16_t)_pq_readAdd1_fx(); - } - - _pq_biquad0_fx(pSrc[remainderBy8 - 1]); - pDst[remainderBy8 - 1] = (int16_t)_pq_readAdd0_fx(); - } - - if (length > 0) - { - PQ_StartVectorFixed16(&pSrc[remainderBy8], &pDst[remainderBy8], length); - PQ_Vector8BiquadDf2CascadeFixed16(); - PQ_EndVector(); - } -} - -void PQ_BiquadBackUpInternalState(POWERQUAD_Type *base, int32_t biquad_num, pq_biquad_state_t *state) -{ - pq_float_t v_n_1; - pq_float_t v_n; - -#if defined(__GNUC__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif - if (0 == biquad_num) - { - v_n_1.integerX = base->GPREG[0]; - v_n.integerX = base->GPREG[1]; - - state->param.v_n_1 = v_n_1.floatX; - state->param.v_n = v_n.floatX; - state->compreg = base->COMPREG[1]; - } - else - { - v_n_1.integerX = base->GPREG[8]; - v_n.integerX = base->GPREG[9]; - - state->param.v_n_1 = v_n_1.floatX; - state->param.v_n = v_n.floatX; - state->compreg = base->COMPREG[3]; - } -#if defined(__GNUC__) -#pragma GCC diagnostic pop -#endif -} - -void PQ_BiquadRestoreInternalState(POWERQUAD_Type *base, int32_t biquad_num, pq_biquad_state_t *state) -{ - pq_float_t v_n_1; - pq_float_t v_n; - pq_float_t a_1; - pq_float_t a_2; - pq_float_t b_0; - pq_float_t b_1; - pq_float_t b_2; - - if (0 == biquad_num) - { - v_n_1.floatX = state->param.v_n_1; - v_n.floatX = state->param.v_n; - a_1.floatX = state->param.a_1; - a_2.floatX = state->param.a_2; - b_0.floatX = state->param.b_0; - b_1.floatX = state->param.b_1; - b_2.floatX = state->param.b_2; - - base->GPREG[0] = v_n_1.integerX; - base->GPREG[1] = v_n.integerX; - base->GPREG[2] = a_1.integerX; - base->GPREG[3] = a_2.integerX; - base->GPREG[4] = b_0.integerX; - base->GPREG[5] = b_1.integerX; - base->GPREG[6] = b_2.integerX; - base->COMPREG[1] = state->compreg; - } - else - { - v_n_1.floatX = state->param.v_n_1; - v_n.floatX = state->param.v_n; - a_1.floatX = state->param.a_1; - a_2.floatX = state->param.a_2; - b_0.floatX = state->param.b_0; - b_1.floatX = state->param.b_1; - b_2.floatX = state->param.b_2; - - base->GPREG[8] = v_n_1.integerX; - base->GPREG[9] = v_n.integerX; - base->GPREG[10] = a_1.integerX; - base->GPREG[11] = a_2.integerX; - base->GPREG[12] = b_0.integerX; - base->GPREG[13] = b_1.integerX; - base->GPREG[14] = b_2.integerX; - base->COMPREG[3] = state->compreg; - } -} - -void PQ_FIR(POWERQUAD_Type *base, - const void *pAData, - int32_t ALength, - const void *pBData, - int32_t BLength, - void *pResult, - uint32_t opType) -{ - assert(NULL != pAData); - assert(NULL != pBData); - assert(NULL != pResult); - - base->INABASE = (uint32_t)(const uint32_t *)pAData; - base->INBBASE = (uint32_t)(const uint32_t *)pBData; - base->LENGTH = ((uint32_t)BLength << 16U) + (uint32_t)ALength; - base->OUTBASE = (uint32_t)(uint32_t *)pResult; - base->CONTROL = (CP_FIR << 4U) | opType; -} - -void PQ_FIRIncrement(POWERQUAD_Type *base, int32_t ALength, int32_t BLength, int32_t xOffset) -{ - base->MISC = (uint32_t)xOffset; - base->LENGTH = ((uint32_t)BLength << 16U) + (uint32_t)ALength; - base->CONTROL = (CP_FIR << 4U) | PQ_FIR_INCREMENTAL; -} - -void PQ_BiquadCascadeDf2Init(pq_biquad_cascade_df2_instance *S, uint8_t numStages, pq_biquad_state_t *pState) -{ - S->numStages = numStages; - S->pState = pState; -} - -void PQ_BiquadCascadeDf2F32(const pq_biquad_cascade_df2_instance *S, float *pSrc, float *pDst, uint32_t blockSize) -{ - uint32_t stage = S->numStages; - pq_biquad_state_t *states = S->pState; - - if (pDst != pSrc) - { - (void)memcpy(pDst, pSrc, 4U * blockSize); - } - - if ((stage & 0x01U) == 0x01U) - { - PQ_BiquadRestoreInternalState(POWERQUAD, 0, states); - - PQ_VectorBiquadDf2F32(pSrc, pDst, (int32_t)blockSize); - - PQ_BiquadBackUpInternalState(POWERQUAD, 0, states); - - states++; - stage--; - } - - while (stage > 0U) - { - PQ_BiquadRestoreInternalState(POWERQUAD, 1, states); - states++; - PQ_BiquadRestoreInternalState(POWERQUAD, 0, states); - - PQ_VectorBiquadCascadeDf2F32(pDst, pDst, (int32_t)blockSize); - - states--; - PQ_BiquadBackUpInternalState(POWERQUAD, 1, states); - states++; - PQ_BiquadBackUpInternalState(POWERQUAD, 0, states); - - states++; - stage -= 2U; - } -} - -void PQ_BiquadCascadeDf2Fixed32(const pq_biquad_cascade_df2_instance *S, - int32_t *pSrc, - int32_t *pDst, - uint32_t blockSize) -{ - uint32_t stage = S->numStages; - pq_biquad_state_t *states = S->pState; - - if (pDst != pSrc) - { - (void)memcpy(pDst, pSrc, 4U * blockSize); - } - - if ((stage & 0x01U) == 0x01U) - { - PQ_BiquadRestoreInternalState(POWERQUAD, 0, states); - - PQ_VectorBiquadDf2Fixed32(pSrc, pDst, (int32_t)blockSize); - - PQ_BiquadBackUpInternalState(POWERQUAD, 0, states); - - states++; - stage--; - } - - while (stage > 0U) - { - PQ_BiquadRestoreInternalState(POWERQUAD, 0, states); - states++; - PQ_BiquadRestoreInternalState(POWERQUAD, 1, states); - - PQ_VectorBiquadCascadeDf2Fixed32(pDst, pDst, (int32_t)blockSize); - - states--; - PQ_BiquadBackUpInternalState(POWERQUAD, 0, states); - states++; - PQ_BiquadBackUpInternalState(POWERQUAD, 1, states); - - states++; - stage -= 2U; - } -} - -void PQ_BiquadCascadeDf2Fixed16(const pq_biquad_cascade_df2_instance *S, - int16_t *pSrc, - int16_t *pDst, - uint32_t blockSize) -{ - uint32_t stage = S->numStages; - pq_biquad_state_t *states = S->pState; - - if (pDst != pSrc) - { - (void)memcpy(pDst, pSrc, 2U * blockSize); - } - - if ((stage & 0x01U) == 0x01U) - { - PQ_BiquadRestoreInternalState(POWERQUAD, 0, states); - - PQ_VectorBiquadDf2Fixed16(pSrc, pDst, (int32_t)blockSize); - - PQ_BiquadBackUpInternalState(POWERQUAD, 0, states); - - states++; - stage--; - } - - while (stage > 0U) - { - PQ_BiquadRestoreInternalState(POWERQUAD, 0, states); - states++; - PQ_BiquadRestoreInternalState(POWERQUAD, 1, states); - - PQ_VectorBiquadCascadeDf2Fixed16(pDst, pDst, (int32_t)blockSize); - - states--; - PQ_BiquadBackUpInternalState(POWERQUAD, 0, states); - states++; - PQ_BiquadBackUpInternalState(POWERQUAD, 1, states); - - states++; - stage -= 2U; - } -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_powerquad_math.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_powerquad_math.c deleted file mode 100644 index c9233bb073c..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_powerquad_math.c +++ /dev/null @@ -1,907 +0,0 @@ -/* - * Copyright 2018-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_powerquad.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.powerquad_math" -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -void PQ_VectorLnF32(float *pSrc, float *pDst, int32_t length) -{ - int32_t remainderBy8 = length % 8; - pq_float_t val; - - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - val.floatX = *pSrc++; - _pq_ln0(val.integerX); - val.integerX = _pq_readAdd0(); - *pDst++ = val.floatX; - } - } - - if (length > 0) - { - PQ_StartVector(pSrc, pDst, length); - PQ_Vector8F32(PQ_LN, 1, PQ_TRANS); - PQ_EndVector(); - } -} - -void PQ_VectorInvF32(float *pSrc, float *pDst, int32_t length) -{ - int32_t remainderBy8 = length % 8; - pq_float_t val; - - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - val.floatX = *pSrc++; - _pq_inv0(val.integerX); - val.integerX = _pq_readMult0(); - *pDst++ = val.floatX; - } - } - - if (length > 0) - { - PQ_StartVector(pSrc, pDst, length); - PQ_Vector8F32(PQ_INV, 0, PQ_TRANS); - PQ_EndVector(); - } -} - -void PQ_VectorSqrtF32(float *pSrc, float *pDst, int32_t length) -{ - int32_t remainderBy8 = length % 8; - pq_float_t val; - - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - val.floatX = *pSrc++; - _pq_sqrt0(val.integerX); - val.integerX = _pq_readMult0(); - *pDst++ = val.floatX; - } - } - - if (length > 0) - { - PQ_StartVector(pSrc, pDst, length); - PQ_Vector8F32(PQ_SQRT, 0, PQ_TRANS); - PQ_EndVector(); - } -} - -void PQ_VectorInvSqrtF32(float *pSrc, float *pDst, int32_t length) -{ - int32_t remainderBy8 = length % 8; - pq_float_t val; - - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - val.floatX = *pSrc++; - _pq_invsqrt0(val.integerX); - val.integerX = _pq_readMult0(); - *pDst++ = val.floatX; - } - } - - if (length > 0) - { - PQ_StartVector(pSrc, pDst, length); - PQ_Vector8F32(PQ_INVSQRT, 0, PQ_TRANS); - PQ_EndVector(); - } -} - -void PQ_VectorEtoxF32(float *pSrc, float *pDst, int32_t length) -{ - int32_t remainderBy8 = length % 8; - pq_float_t val; - - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - val.floatX = *pSrc++; - _pq_etox0(val.integerX); - val.integerX = _pq_readMult0(); - *pDst++ = val.floatX; - } - } - - if (length > 0) - { - PQ_StartVector(pSrc, pDst, length); - PQ_Vector8F32(PQ_ETOX, 0, PQ_TRANS); - PQ_EndVector(); - } -} - -void PQ_VectorEtonxF32(float *pSrc, float *pDst, int32_t length) -{ - int32_t remainderBy8 = length % 8; - pq_float_t val; - - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - val.floatX = *pSrc++; - _pq_etonx0(val.integerX); - val.integerX = _pq_readMult0(); - *pDst++ = val.floatX; - } - } - - if (length > 0) - { - PQ_StartVector(pSrc, pDst, length); - PQ_Vector8F32(PQ_ETONX, 0, PQ_TRANS); - PQ_EndVector(); - } -} - -void PQ_VectorSinF32(float *pSrc, float *pDst, int32_t length) -{ - int32_t remainderBy8 = length % 8; - pq_float_t val; - - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - val.floatX = *pSrc++; - _pq_sin0(val.integerX); - val.integerX = _pq_readAdd0(); - *pDst++ = val.floatX; - } - } - - if (length > 0) - { - PQ_StartVector(pSrc, pDst, length); - PQ_Vector8F32(PQ_SIN, 1, PQ_TRIG); - PQ_EndVector(); - } -} - -void PQ_VectorCosF32(float *pSrc, float *pDst, int32_t length) -{ - int32_t remainderBy8 = length % 8; - pq_float_t val; - - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - val.floatX = *pSrc++; - _pq_cos0(val.integerX); - val.integerX = _pq_readAdd0(); - *pDst++ = val.floatX; - } - } - - if (length > 0) - { - PQ_StartVector(pSrc, pDst, length); - PQ_Vector8F32(PQ_COS, 1, PQ_TRIG); - PQ_EndVector(); - } -} - -void PQ_VectorLnFixed32(int32_t *pSrc, int32_t *pDst, int32_t length) -{ - int32_t remainderBy8 = length % 8; - - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - _pq_ln_fx0(*pSrc++); - *pDst++ = (int32_t)_pq_readAdd0_fx(); - } - } - - if (length > 0) - { - PQ_StartVector(pSrc, pDst, length); - PQ_Vector8Fixed32(PQ_LN, 1, PQ_TRANS_FIXED); - PQ_EndVector(); - } -} - -void PQ_VectorInvFixed32(int32_t *pSrc, int32_t *pDst, int32_t length) -{ - int32_t remainderBy8 = length % 8; - - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - _pq_inv_fx0(*pSrc++); - *pDst++ = (int32_t)_pq_readMult0_fx(); - } - } - - if (length > 0) - { - PQ_StartVector(pSrc, pDst, length); - PQ_Vector8Fixed32(PQ_INV, 0, PQ_TRANS_FIXED); - PQ_EndVector(); - } -} - -void PQ_VectorSqrtFixed32(int32_t *pSrc, int32_t *pDst, int32_t length) -{ - int32_t remainderBy8 = length % 8; - - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - _pq_sqrt_fx0(*pSrc++); - *pDst++ = (int32_t)_pq_readMult0_fx(); - } - } - - if (length > 0) - { - PQ_StartVector(pSrc, pDst, length); - PQ_Vector8Fixed32(PQ_SQRT, 0, PQ_TRANS_FIXED); - PQ_EndVector(); - } -} - -void PQ_VectorInvSqrtFixed32(int32_t *pSrc, int32_t *pDst, int32_t length) -{ - int32_t remainderBy8 = length % 8; - - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - _pq_invsqrt_fx0(*pSrc++); - *pDst++ = (int32_t)_pq_readMult0_fx(); - } - } - - if (length > 0) - { - PQ_StartVector(pSrc, pDst, length); - PQ_Vector8Fixed32(PQ_INVSQRT, 0, PQ_TRANS_FIXED); - PQ_EndVector(); - } -} - -void PQ_VectorEtoxFixed32(int32_t *pSrc, int32_t *pDst, int32_t length) -{ - int32_t remainderBy8 = length % 8; - - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - _pq_etox_fx0(*pSrc++); - *pDst++ = (int32_t)_pq_readMult0_fx(); - } - } - - if (length > 0) - { - PQ_StartVector(pSrc, pDst, length); - PQ_Vector8Fixed32(PQ_ETOX, 0, PQ_TRANS_FIXED); - PQ_EndVector(); - } -} - -void PQ_VectorEtonxFixed32(int32_t *pSrc, int32_t *pDst, int32_t length) -{ - int32_t remainderBy8 = length % 8; - - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - _pq_etonx_fx0(*pSrc++); - *pDst++ = (int32_t)_pq_readMult0_fx(); - } - } - - if (length > 0) - { - PQ_StartVector(pSrc, pDst, length); - PQ_Vector8Fixed32(PQ_ETONX, 0, PQ_TRANS_FIXED); - PQ_EndVector(); - } -} - -void PQ_VectorSinQ31(int32_t *pSrc, int32_t *pDst, int32_t length) -{ - int32_t remainderBy8 = length % 8; - - uint32_t cppre; -#if defined(FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA) && FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA - pq_float_t magic; - pq_float_t valFloat; - - magic.integerX = 0x30c90fdbU; -#endif - - cppre = POWERQUAD->CPPRE; - POWERQUAD->CPPRE = POWERQUAD_CPPRE_CPPRE_OUT(31); - -#if defined(FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA) && FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - valFloat.floatX = magic.floatX * (float)(*pSrc++); - _pq_sin0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int32_t)_pq_readAdd0_fx(); - } - } - - while (length > 0) - { - valFloat.floatX = magic.floatX * (float)(*pSrc++); - _pq_sin0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int32_t)_pq_readAdd0_fx(); - - valFloat.floatX = magic.floatX * (float)(*pSrc++); - _pq_sin0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int32_t)_pq_readAdd0_fx(); - - valFloat.floatX = magic.floatX * (float)(*pSrc++); - _pq_sin0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int32_t)_pq_readAdd0_fx(); - - valFloat.floatX = magic.floatX * (float)(*pSrc++); - _pq_sin0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int32_t)_pq_readAdd0_fx(); - - valFloat.floatX = magic.floatX * (float)(*pSrc++); - _pq_sin0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int32_t)_pq_readAdd0_fx(); - - valFloat.floatX = magic.floatX * (float)(*pSrc++); - _pq_sin0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int32_t)_pq_readAdd0_fx(); - - valFloat.floatX = magic.floatX * (float)(*pSrc++); - _pq_sin0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int32_t)_pq_readAdd0_fx(); - - valFloat.floatX = magic.floatX * (float)(*pSrc++); - _pq_sin0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int32_t)_pq_readAdd0_fx(); - - length -= 8; - } - -#else - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - _pq_sin_fx0(*pSrc++); - *pDst++ = (int32_t)_pq_readAdd0_fx(); - } - } - - if (length > 0) - { - PQ_StartVector(pSrc, pDst, length); - PQ_Vector8Fixed32(PQ_SIN, 1, PQ_TRIG_FIXED); - PQ_EndVector(); - } -#endif - - POWERQUAD->CPPRE = cppre; -} - -void PQ_VectorCosQ31(int32_t *pSrc, int32_t *pDst, int32_t length) -{ - int32_t remainderBy8 = length % 8; - - uint32_t cppre; -#if defined(FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA) && FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA - pq_float_t magic; - pq_float_t valFloat; - - magic.integerX = 0x30c90fdb; -#endif - - cppre = POWERQUAD->CPPRE; - POWERQUAD->CPPRE = POWERQUAD_CPPRE_CPPRE_OUT(31); - -#if defined(FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA) && FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - valFloat.floatX = magic.floatX * (float)(*pSrc++); - _pq_cos0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int32_t)_pq_readAdd0_fx(); - } - } - - while (length > 0) - { - valFloat.floatX = magic.floatX * (float)(*pSrc++); - _pq_cos0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int32_t)_pq_readAdd0_fx(); - - valFloat.floatX = magic.floatX * (float)(*pSrc++); - _pq_cos0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int32_t)_pq_readAdd0_fx(); - - valFloat.floatX = magic.floatX * (float)(*pSrc++); - _pq_cos0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int32_t)_pq_readAdd0_fx(); - - valFloat.floatX = magic.floatX * (float)(*pSrc++); - _pq_cos0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int32_t)_pq_readAdd0_fx(); - - valFloat.floatX = magic.floatX * (float)(*pSrc++); - _pq_cos0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int32_t)_pq_readAdd0_fx(); - - valFloat.floatX = magic.floatX * (float)(*pSrc++); - _pq_cos0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int32_t)_pq_readAdd0_fx(); - - valFloat.floatX = magic.floatX * (float)(*pSrc++); - _pq_cos0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int32_t)_pq_readAdd0_fx(); - - valFloat.floatX = magic.floatX * (float)(*pSrc++); - _pq_cos0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int32_t)_pq_readAdd0_fx(); - - length -= 8; - } - -#else - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - _pq_cos_fx0(*pSrc++); - *pDst++ = (int32_t)_pq_readAdd0_fx(); - } - } - - if (length > 0) - { - PQ_StartVector(pSrc, pDst, length); - PQ_Vector8Fixed32(PQ_COS, 1, PQ_TRIG_FIXED); - PQ_EndVector(); - } -#endif - - POWERQUAD->CPPRE = cppre; -} - -void PQ_VectorLnFixed16(int16_t *pSrc, int16_t *pDst, int32_t length) -{ - int32_t remainderBy8 = length % 8; - - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - _pq_ln_fx0(*pSrc++); - *pDst++ = (int16_t)_pq_readAdd0_fx(); - } - } - - if (length > 0) - { - PQ_StartVectorFixed16(pSrc, pDst, length); - PQ_Vector8Fixed16(PQ_LN, 1, PQ_TRANS_FIXED); - PQ_EndVector(); - } -} - -void PQ_VectorInvFixed16(int16_t *pSrc, int16_t *pDst, int32_t length) -{ - int32_t remainderBy8 = length % 8; - - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - _pq_inv_fx0(*pSrc++); - *pDst++ = (int16_t)_pq_readMult0_fx(); - } - } - - if (length > 0) - { - PQ_StartVectorFixed16(pSrc, pDst, length); - PQ_Vector8Fixed16(PQ_INV, 0, PQ_TRANS_FIXED); - PQ_EndVector(); - } -} - -void PQ_VectorSqrtFixed16(int16_t *pSrc, int16_t *pDst, int32_t length) -{ - int32_t remainderBy8 = length % 8; - - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - _pq_sqrt_fx0(*pSrc++); - *pDst++ = (int16_t)_pq_readMult0_fx(); - } - } - - if (length > 0) - { - PQ_StartVectorFixed16(pSrc, pDst, length); - PQ_Vector8Fixed16(PQ_SQRT, 0, PQ_TRANS_FIXED); - PQ_EndVector(); - } -} - -void PQ_VectorInvSqrtFixed16(int16_t *pSrc, int16_t *pDst, int32_t length) -{ - int32_t remainderBy8 = length % 8; - - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - _pq_invsqrt_fx0(*pSrc++); - *pDst++ = (int16_t)_pq_readMult0_fx(); - } - } - - if (length > 0) - { - PQ_StartVectorFixed16(pSrc, pDst, length); - PQ_Vector8Fixed16(PQ_INVSQRT, 0, PQ_TRANS_FIXED); - PQ_EndVector(); - } -} - -void PQ_VectorEtoxFixed16(int16_t *pSrc, int16_t *pDst, int32_t length) -{ - int32_t remainderBy8 = length % 8; - - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - _pq_etox_fx0(*pSrc++); - *pDst++ = (int16_t)_pq_readMult0_fx(); - } - } - - if (length > 0) - { - PQ_StartVectorFixed16(pSrc, pDst, length); - PQ_Vector8Fixed16(PQ_ETOX, 0, PQ_TRANS_FIXED); - PQ_EndVector(); - } -} - -void PQ_VectorEtonxFixed16(int16_t *pSrc, int16_t *pDst, int32_t length) -{ - int32_t remainderBy8 = length % 8; - - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - _pq_etonx_fx0(*pSrc++); - *pDst++ = (int16_t)_pq_readMult0_fx(); - } - } - - if (length > 0) - { - PQ_StartVectorFixed16(pSrc, pDst, length); - PQ_Vector8Fixed16(PQ_ETONX, 0, PQ_TRANS_FIXED); - PQ_EndVector(); - } -} - -void PQ_VectorSinQ15(int16_t *pSrc, int16_t *pDst, int32_t length) -{ - uint32_t cppre; -#if defined(FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA) && FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA - pq_float_t magic; - pq_float_t valFloat; - - magic.integerX = 0x30c90fdb; -#endif - - cppre = POWERQUAD->CPPRE; - POWERQUAD->CPPRE = POWERQUAD_CPPRE_CPPRE_OUT(31); - - int32_t remainderBy8 = length % 8; - -#if defined(FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA) && FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - valFloat.floatX = magic.floatX * (float)(uint32_t)((uint32_t)(*pSrc++) << 16U); - _pq_sin0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int16_t)(uint32_t)((_pq_readAdd0_fx()) >> 16U); - } - } - - while (length > 0) - { - valFloat.floatX = magic.floatX * (float)(uint32_t)((uint32_t)(*pSrc++) << 16U); - _pq_sin0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int16_t)(uint32_t)((_pq_readAdd0_fx()) >> 16U); - - valFloat.floatX = magic.floatX * (float)(uint32_t)((uint32_t)(*pSrc++) << 16U); - _pq_sin0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int16_t)(uint32_t)((_pq_readAdd0_fx()) >> 16U); - - valFloat.floatX = magic.floatX * (float)(uint32_t)((uint32_t)(*pSrc++) << 16U); - _pq_sin0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int16_t)(uint32_t)((_pq_readAdd0_fx()) >> 16U); - - valFloat.floatX = magic.floatX * (float)(uint32_t)((uint32_t)(*pSrc++) << 16U); - _pq_sin0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int16_t)(uint32_t)((_pq_readAdd0_fx()) >> 16U); - - valFloat.floatX = magic.floatX * (float)(uint32_t)((uint32_t)(*pSrc++) << 16U); - _pq_sin0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int16_t)(uint32_t)((_pq_readAdd0_fx()) >> 16U); - - valFloat.floatX = magic.floatX * (float)(uint32_t)((uint32_t)(*pSrc++) << 16U); - _pq_sin0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int16_t)(uint32_t)((_pq_readAdd0_fx()) >> 16U); - - valFloat.floatX = magic.floatX * (float)(uint32_t)((uint32_t)(*pSrc++) << 16U); - _pq_sin0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int16_t)(uint32_t)((_pq_readAdd0_fx()) >> 16U); - - valFloat.floatX = magic.floatX * (float)(uint32_t)((uint32_t)(*pSrc++) << 16U); - _pq_sin0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int16_t)(uint32_t)((_pq_readAdd0_fx()) >> 16U); - - length -= 8; - } - -#else - - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - _pq_sin_fx0((uint32_t)(*pSrc++) << 16U); - *pDst++ = (int16_t)(uint32_t)((_pq_readAdd0_fx()) >> 16U); - } - } - - if (length > 0) - { - PQ_StartVectorQ15(pSrc, pDst, length); - PQ_Vector8Q15(PQ_SIN, 1, PQ_TRIG_FIXED); - PQ_EndVector(); - } -#endif - - POWERQUAD->CPPRE = cppre; -} - -void PQ_VectorCosQ15(int16_t *pSrc, int16_t *pDst, int32_t length) -{ - uint32_t cppre; -#if defined(FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA) && FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA - pq_float_t magic; - pq_float_t valFloat; - - magic.integerX = 0x30c90fdbU; -#endif - - cppre = POWERQUAD->CPPRE; - POWERQUAD->CPPRE = POWERQUAD_CPPRE_CPPRE_OUT(31); - - int32_t remainderBy8 = length % 8; - -#if defined(FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA) && FSL_FEATURE_POWERQUAD_SIN_COS_FIX_ERRATA - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - valFloat.floatX = magic.floatX * (float)(uint32_t)((uint32_t)(*pSrc++) << 16U); - _pq_cos0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int16_t)(uint32_t)((_pq_readAdd0_fx()) >> 16U); - } - } - - while (length > 0) - { - valFloat.floatX = magic.floatX * (float)(uint32_t)((uint32_t)(*pSrc++) << 16U); - _pq_cos0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int16_t)(uint32_t)((_pq_readAdd0_fx()) >> 16U); - - valFloat.floatX = magic.floatX * (float)(uint32_t)((uint32_t)(*pSrc++) << 16U); - _pq_cos0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int16_t)(uint32_t)((_pq_readAdd0_fx()) >> 16U); - - valFloat.floatX = magic.floatX * (float)(uint32_t)((uint32_t)(*pSrc++) << 16U); - _pq_cos0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int16_t)(uint32_t)((_pq_readAdd0_fx()) >> 16U); - - valFloat.floatX = magic.floatX * (float)(uint32_t)((uint32_t)(*pSrc++) << 16U); - _pq_cos0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int16_t)(uint32_t)((_pq_readAdd0_fx()) >> 16U); - - valFloat.floatX = magic.floatX * (float)(uint32_t)((uint32_t)(*pSrc++) << 16U); - _pq_cos0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int16_t)(uint32_t)((_pq_readAdd0_fx()) >> 16U); - - valFloat.floatX = magic.floatX * (float)(uint32_t)((uint32_t)(*pSrc++) << 16U); - _pq_cos0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int16_t)(uint32_t)((_pq_readAdd0_fx()) >> 16U); - - valFloat.floatX = magic.floatX * (float)(uint32_t)((uint32_t)(*pSrc++) << 16U); - _pq_cos0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int16_t)(uint32_t)((_pq_readAdd0_fx()) >> 16U); - - valFloat.floatX = magic.floatX * (float)(uint32_t)((uint32_t)(*pSrc++) << 16U); - _pq_cos0(valFloat.integerX); - (void)_pq_readAdd0(); - *pDst++ = (int16_t)(uint32_t)((_pq_readAdd0_fx()) >> 16U); - - length -= 8; - } - -#else - - if (remainderBy8 > 0) - { - length -= remainderBy8; - while ((remainderBy8--) > 0) - { - _pq_cos_fx0((uint32_t)(*pSrc++) << 16U); - *pDst++ = (int16_t)(uint32_t)((_pq_readAdd0_fx()) >> 16U); - } - } - - if (length > 0) - { - PQ_StartVectorQ15(pSrc, pDst, length); - PQ_Vector8Q15(PQ_COS, 1, PQ_TRIG_FIXED); - PQ_EndVector(); - } -#endif - - POWERQUAD->CPPRE = cppre; -} - -int32_t PQ_ArctanFixed(POWERQUAD_Type *base, int32_t x, int32_t y, pq_cordic_iter_t iteration) -{ - base->CORDIC_X = (uint32_t)x; - base->CORDIC_Y = (uint32_t)y; - base->CORDIC_Z = 0U; - base->CONTROL = (CP_CORDIC << 4U) | CORDIC_ARCTAN | CORDIC_ITER(iteration); - - return (int32_t)base->CORDIC_Z; -} - -int32_t PQ_ArctanhFixed(POWERQUAD_Type *base, int32_t x, int32_t y, pq_cordic_iter_t iteration) -{ - base->CORDIC_X = (uint32_t)x; - base->CORDIC_Y = (uint32_t)y; - base->CORDIC_Z = 0U; - base->CONTROL = (CP_CORDIC << 4U) | CORDIC_ARCTANH | CORDIC_ITER(iteration); - - return (int32_t)base->CORDIC_Z; -} - -int32_t PQ_Arctan2Fixed(POWERQUAD_Type *base, int32_t x, int32_t y, pq_cordic_iter_t iteration) -{ - int32_t result; - - result = PQ_ArctanFixed(base, x, y, iteration); - - if (x < 0) - { - if (y < 0) - { - result -= 0x08000000; - } - else - { - result += 0x08000000; - } - } - - return result; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_powerquad_matrix.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_powerquad_matrix.c deleted file mode 100644 index 6394cfd13bc..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_powerquad_matrix.c +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright 2018-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_powerquad.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.powerquad_matrix" -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -void PQ_MatrixAddition(POWERQUAD_Type *base, uint32_t length, void *pAData, void *pBData, void *pResult) -{ - assert(NULL != pAData); - assert(NULL != pBData); - assert(NULL != pResult); - - base->OUTBASE = (uint32_t)(uint32_t *)pResult; - base->INABASE = (uint32_t)(uint32_t *)pAData; - base->INBBASE = (uint32_t)(uint32_t *)pBData; - base->LENGTH = length; - base->CONTROL = (CP_MTX << 4U) | PQ_MTX_ADD; -} - -void PQ_MatrixSubtraction(POWERQUAD_Type *base, uint32_t length, void *pAData, void *pBData, void *pResult) -{ - assert(NULL != pAData); - assert(NULL != pBData); - assert(NULL != pResult); - - base->OUTBASE = (uint32_t)(uint32_t *)pResult; - base->INABASE = (uint32_t)(uint32_t *)pAData; - base->INBBASE = (uint32_t)(uint32_t *)pBData; - base->LENGTH = length; - base->CONTROL = (CP_MTX << 4U) | PQ_MTX_SUB; -} - -void PQ_MatrixMultiplication(POWERQUAD_Type *base, uint32_t length, void *pAData, void *pBData, void *pResult) -{ - assert(NULL != pAData); - assert(NULL != pBData); - assert(NULL != pResult); - - base->OUTBASE = (uint32_t)(uint32_t *)pResult; - base->INABASE = (uint32_t)(uint32_t *)pAData; - base->INBBASE = (uint32_t)(uint32_t *)pBData; - base->LENGTH = length; - base->CONTROL = (CP_MTX << 4U) | PQ_MTX_MULT; -} - -void PQ_MatrixProduct(POWERQUAD_Type *base, uint32_t length, void *pAData, void *pBData, void *pResult) -{ - assert(NULL != pAData); - assert(NULL != pBData); - assert(NULL != pResult); - - base->OUTBASE = (uint32_t)(uint32_t *)pResult; - base->INABASE = (uint32_t)(uint32_t *)pAData; - base->INBBASE = (uint32_t)(uint32_t *)pBData; - base->LENGTH = length; - base->CONTROL = (CP_MTX << 4U) | PQ_MTX_PROD; -} - -void PQ_VectorDotProduct(POWERQUAD_Type *base, uint32_t length, void *pAData, void *pBData, void *pResult) -{ - assert(NULL != pAData); - assert(NULL != pBData); - assert(NULL != pResult); - - base->OUTBASE = (uint32_t)(uint32_t *)pResult; - base->INABASE = (uint32_t)(uint32_t *)pAData; - base->INBBASE = (uint32_t)(uint32_t *)pBData; - base->LENGTH = length; - base->CONTROL = (CP_MTX << 4U) | PQ_VEC_DOTP; -} - -void PQ_MatrixInversion(POWERQUAD_Type *base, uint32_t length, void *pData, void *pTmpData, void *pResult) -{ - assert(NULL != pData); - assert(NULL != pTmpData); - assert(NULL != pResult); - - /* Workaround: - * - * Matrix inv depends on the coproc 1/x function, this puts coproc to right state. - */ - _pq_inv0(1.0f); - - base->INABASE = (uint32_t)(uint32_t *)pData; - base->TMPBASE = (uint32_t)(uint32_t *)pTmpData; - base->OUTBASE = (uint32_t)(uint32_t *)pResult; - base->LENGTH = length; - base->CONTROL = (CP_MTX << 4U) | PQ_MTX_INV; -} - -void PQ_MatrixTranspose(POWERQUAD_Type *base, uint32_t length, void *pData, void *pResult) -{ - assert(NULL != pData); - assert(NULL != pResult); - - base->OUTBASE = (uint32_t)(uint32_t *)pResult; - base->INABASE = (uint32_t)(uint32_t *)pData; - base->LENGTH = length; - base->CONTROL = (CP_MTX << 4U) | PQ_MTX_TRAN; -} - -void PQ_MatrixScale(POWERQUAD_Type *base, uint32_t length, float misc, const void *pData, void *pResult) -{ - assert(NULL != pData); - assert(NULL != pResult); - pq_float_t val; - - base->OUTBASE = (uint32_t)(uint32_t *)pResult; - base->INABASE = (uint32_t)(const uint32_t *)pData; - base->LENGTH = length; - - val.floatX = misc; - base->MISC = val.integerX; - - base->CONTROL = (CP_MTX << 4U) | PQ_MTX_SCALE; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_powerquad_transform.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_powerquad_transform.c deleted file mode 100644 index 9a7d3244f8f..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_powerquad_transform.c +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright 2018-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_powerquad.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.powerquad_transform" -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -void PQ_TransformCFFT(POWERQUAD_Type *base, uint32_t length, void *pData, void *pResult) -{ - assert(NULL != pData); - assert(NULL != pResult); - - base->OUTBASE = (uint32_t)(uint32_t *)pResult; - base->INABASE = (uint32_t)(uint32_t *)pData; - base->LENGTH = length; - base->CONTROL = (CP_FFT << 4U) | PQ_TRANS_CFFT; -} - -void PQ_TransformRFFT(POWERQUAD_Type *base, uint32_t length, void *pData, void *pResult) -{ - assert(NULL != pData); - assert(NULL != pResult); - - /* Set 0's for imaginary inputs as not be reading them in by the machine */ - base->GPREG[1] = 0U; - base->GPREG[3] = 0U; - base->GPREG[5] = 0U; - base->GPREG[7] = 0U; - base->GPREG[9] = 0U; - base->GPREG[11] = 0U; - base->GPREG[13] = 0U; - base->GPREG[15] = 0U; - base->OUTBASE = (uint32_t)(uint32_t *)pResult; - base->INABASE = (uint32_t)(uint32_t *)pData; - base->LENGTH = length; - base->CONTROL = (CP_FFT << 4U) | PQ_TRANS_RFFT; -} - -void PQ_TransformIFFT(POWERQUAD_Type *base, uint32_t length, void *pData, void *pResult) -{ - assert(NULL != pData); - assert(NULL != pResult); - - base->OUTBASE = (uint32_t)(uint32_t *)pResult; - base->INABASE = (uint32_t)(uint32_t *)pData; - base->LENGTH = length; - base->CONTROL = (CP_FFT << 4U) | PQ_TRANS_IFFT; -} - -void PQ_TransformCDCT(POWERQUAD_Type *base, uint32_t length, void *pData, void *pResult) -{ - assert(NULL != pData); - assert(NULL != pResult); - - base->OUTBASE = (uint32_t)(uint32_t *)pResult; - base->INABASE = (uint32_t)(uint32_t *)pData; - base->LENGTH = length; - base->CONTROL = (CP_FFT << 4U) | PQ_TRANS_CDCT; -} - -void PQ_TransformRDCT(POWERQUAD_Type *base, uint32_t length, void *pData, void *pResult) -{ - assert(NULL != pData); - assert(NULL != pResult); - - base->GPREG[1] = 0U; - base->GPREG[3] = 0U; - base->GPREG[5] = 0U; - base->GPREG[7] = 0U; - base->GPREG[9] = 0U; - base->GPREG[11] = 0U; - base->GPREG[13] = 0U; - base->GPREG[15] = 0U; - base->OUTBASE = (uint32_t)(uint32_t *)pResult; - base->INABASE = (uint32_t)(uint32_t *)pData; - base->LENGTH = length; - base->CONTROL = (CP_FFT << 4U) | PQ_TRANS_RDCT; -} - -void PQ_TransformIDCT(POWERQUAD_Type *base, uint32_t length, void *pData, void *pResult) -{ - assert(NULL != pData); - assert(NULL != pResult); - - base->OUTBASE = (uint32_t)(uint32_t *)pResult; - base->INABASE = (uint32_t)(uint32_t *)pData; - base->LENGTH = length; - base->CONTROL = (CP_FFT << 4U) | PQ_TRANS_IDCT; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_puf_v3.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_puf_v3.c deleted file mode 100644 index de5ff296b36..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_puf_v3.c +++ /dev/null @@ -1,1000 +0,0 @@ -/* - * Copyright 2020,2023 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_common.h" -#include "fsl_puf_v3.h" -#include "fsl_clock.h" -#include "fsl_reset.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.puf_v3" -#endif - -#define kPUF_OperationInProgress (0x0u) -#define kPUF_Enroll (0x1u) -#define kPUF_Start (0x2u) -#define kPUF_Stop (0x5u) -#define kPUF_GetKey (0x6u) -#define kPUF_Unwrap (0x7u) -#define kPUF_WrapGeneratedRandom (0x8u) -#define kPUF_Wrap (0x9u) -#define kPUF_GenerateRandom (0xfu) -#define kPUF_Test (0x1fu) -#define kPUF_Init (0x20u) -#define kPUF_Zeroize (0x2fu) -typedef uint32_t puf_last_operation_t; - -#define PUF_KEY_OPERATION_CONTEXT_TYPE (0x10UL << 16UL) -#define PUF_CONTEXT_GENERIC_KEY_TYPE (0x0u) -#define PUF_CONTEXT_KEY_LEN_MASK (0x1fffu) - -/******************************************************************************* - * Code - ******************************************************************************/ - -static status_t puf_waitForInit(PUF_Type *base) -{ - status_t status = kStatus_Fail; - - /* wait until status register reads non-zero. All zero is not valid. It should be BUSY or OK or ERROR */ - while (0u == base->SR) - { - } - - /* wait if busy */ - while ((base->SR & PUF_SR_BUSY_MASK) != 0u) - { - } - - /* return status */ - if (0U != (base->SR & (PUF_SR_OK_MASK | PUF_SR_ERROR_MASK))) - { - status = kStatus_Success; - } - - return status; -} - -static void puf_powerOn(PUF_Type *base, puf_config_t *conf) -{ - /* Power On PUF SRAM */ - base->SRAM_CFG = 0x1u; - while (0u == (PUF_SRAM_STATUS_READY_MASK & base->SRAM_STATUS)) - { - } -} - -static status_t puf_powerCycle(PUF_Type *base, puf_config_t *conf) -{ - /* Power off */ - base->SRAM_CFG = 0x0u; - - /* Reset PUF and reenable power to PUF SRAM */ - RESET_PeripheralReset(kPUF_RST_SHIFT_RSTn); - puf_powerOn(base, conf); - - return kStatus_Success; -} - -static status_t puf_makeStatus(PUF_Type *base, puf_last_operation_t operation) -{ - uint32_t result; - status_t status = kStatus_Fail; - - if (((base->ORR & PUF_ORR_LAST_OPERATION_MASK) >> PUF_ORR_LAST_OPERATION_SHIFT) == operation) - { - result = (base->ORR & PUF_ORR_RESULT_CODE_MASK); - if ((result == kPUF_ResultOK) && (0u == (base->SR & PUF_SR_ERROR_MASK))) - { - status = kStatus_Success; - } - else - { - status = MAKE_STATUS((int32_t)kStatusGroup_PUF, (int32_t)result); - } - } - - return status; -} - -/*! - * brief Sets the default configuration of PUF - * - * This function initialize PUF config structure to default values. - * - * @param conf PUF configuration structure - */ -void PUF_GetDefaultConfig(puf_config_t *conf) -{ - /* Default configuration after reset */ - conf->dataEndianness = kPUF_EndianBig; - conf->CKGATING = 0U; -} - -/*! - * brief Initialize PUF - * - * This function enables power to PUF block and waits until the block initializes. - * - * @param conf PUF configuration structure - * @return Status of the init operation - */ -status_t PUF_Init(PUF_Type *base, puf_config_t *conf) -{ - status_t status = kStatus_Fail; - - /* Enable PUF clock */ - CLOCK_EnableClock(kCLOCK_Puf); - - /* Clear the PUF peripheral reset */ - RESET_ClearPeripheralReset(kPUF_RST_SHIFT_RSTn); - - /* Reset PUF */ -#if defined(FSL_FEATURE_PUF_HAS_RESET) && FSL_FEATURE_PUF_HAS_RESET - RESET_PeripheralReset(kPUF_RST_SHIFT_RSTn); -#endif /* FSL_FEATURE_PUF_HAS_RESET */ - - /* Set configuration from SRAM */ - base->SRAM_CFG |= PUF_SRAM_CFG_CKGATING(conf->CKGATING); - - /* Enable power to PUF SRAM */ - puf_powerOn(base, conf); - - /* Wait for peripheral to become ready */ - status = puf_waitForInit(base); - - /* In case of error or enroll & start not allowed, do power-cycle */ - if ((status != kStatus_Success) || ((PUF_AR_ALLOW_ENROLL_MASK | PUF_AR_ALLOW_START_MASK) != - (base->AR & (PUF_AR_ALLOW_ENROLL_MASK | PUF_AR_ALLOW_START_MASK)))) - { - (void)puf_powerCycle(base, conf); - status = puf_waitForInit(base); - } - - if (kStatus_Success == status) - { - /* Set data endianness */ - base->MISC = PUF_MISC_DATA_ENDIANNESS(conf->dataEndianness); - - /* get status */ - status = puf_makeStatus(base, kPUF_Init); - } - - return status; -} - -/*! - * brief Denitialize PUF - * - * This function disables power to PUF SRAM and peripheral clock. - * - * @param base PUF peripheral base address - * @param conf PUF configuration structure - */ -void PUF_Deinit(PUF_Type *base, puf_config_t *conf) -{ - base->SRAM_CFG = 0x0u; - - RESET_PeripheralReset(kPUF_RST_SHIFT_RSTn); - CLOCK_DisableClock(kCLOCK_Puf); -} - -/*! - * brief Enroll PUF - * - * This function derives a digital fingerprint, generates the corresponding Activation Code (AC) - * and returns it to be stored in an NVM or a file. This step needs to be - * performed only once for each device. This function may be permanently disallowed by a fuse. - * - * @param base PUF peripheral base address - * @param[out] activationCode Word aligned address of the resulting activation code. - * @param activationCodeSize Size of the activationCode buffer in bytes. Shall be FSL_FEATURE_PUF_ACTIVATION_CODE_SIZE bytes. - * @param score Value of the PUF Score that was obtained during the enroll operation. - * @return Status of enroll operation. - */ -status_t PUF_Enroll(PUF_Type *base, uint8_t *activationCode, size_t activationCodeSize, uint8_t *score) -{ - status_t status = kStatus_Fail; - uint32_t *activationCodeAligned = NULL; - register uint32_t temp32 = 0; - - /* check that activation code buffer size is at least FSL_FEATURE_PUF_ACTIVATION_CODE_SIZE bytes */ - if (activationCodeSize < PUF_ACTIVATION_CODE_SIZE) - { - return kStatus_InvalidArgument; - } - - /* only work with aligned and valid activationCode */ - if ((0U != (0x3u & (uintptr_t)activationCode)) || (activationCode == NULL)) - { - return kStatus_InvalidArgument; - } - - activationCodeAligned = (uint32_t *)(uintptr_t)activationCode; - - /* check if ENROLL is allowed */ - if (0x0u == (base->AR & PUF_AR_ALLOW_ENROLL_MASK)) - { - return kStatus_PUF_OperationNotAllowed; - } - - /* begin */ - base->CR = PUF_CR_ENROLL_MASK; - - /* wait till command is accepted */ - while (0u != (base->CR & PUF_CR_ENROLL_MASK)) - { - } - - /* read out AC */ - while (0u != (base->SR & PUF_SR_BUSY_MASK)) - { - if (0u != (PUF_SR_DO_REQUEST_MASK & base->SR)) - { - temp32 = base->DOR; - if (activationCodeSize >= sizeof(uint32_t)) - { - *activationCodeAligned = temp32; - activationCodeAligned++; - activationCodeSize -= sizeof(uint32_t); - } - } - } - - /* In case of success fill in score */ - if ((0u != (base->SR & PUF_SR_OK_MASK)) && (score != NULL)) - { - *score = (uint8_t)(base->PSR & PUF_PSR_PUF_SCORE_MASK); - } - - /* get status */ - status = puf_makeStatus(base, kPUF_Enroll); - - return status; -} - -/*! - * brief Start PUF - * - * The Activation Code generated during the Enroll operation is used to - * reconstruct the digital fingerprint. This needs to be done after every power-up - * and reset. - * - * @param base PUF peripheral base address - * @param[in] activationCode Word aligned address of the input activation code. - * @param activationCodeSize Size of the activationCode buffer in bytes. Shall be FSL_FEATURE_PUF_ACTIVATION_CODE_SIZE bytes. - * @param score Value of the PUF Score that was obtained during the start operation. - * return Status of start operation. - */ -status_t PUF_Start(PUF_Type *base, const uint8_t *activationCode, size_t activationCodeSize, uint8_t *score) -{ - status_t status = kStatus_Fail; - const uint32_t *activationCodeAligned = NULL; - register uint32_t temp32 = 0; - - /* check that activation code size is at least FSL_FEATURE_PUF_ACTIVATION_CODE_SIZE bytes */ - if (activationCodeSize < PUF_ACTIVATION_CODE_SIZE) - { - return kStatus_InvalidArgument; - } - - /* Set activationCodeSize to FSL_FEATURE_PUF_ACTIVATION_CODE_SIZE bytes */ - activationCodeSize = PUF_ACTIVATION_CODE_SIZE; - - /* only work with aligned activationCode */ - if ((0U != (0x3u & (uintptr_t)activationCode)) || (activationCode == NULL)) - { - return kStatus_InvalidArgument; - } - - activationCodeAligned = (const uint32_t *)(uintptr_t)activationCode; - - /* check if START is allowed */ - if (0x0u == (base->AR & PUF_AR_ALLOW_START_MASK)) - { - return kStatus_PUF_OperationNotAllowed; - } - - /* begin */ - base->CR = PUF_CR_START_MASK; - - /* wait till command is accepted */ - while (0u != (base->CR & PUF_CR_START_MASK)) - { - } - - /* while busy send AC */ - while (0u != (base->SR & PUF_SR_BUSY_MASK)) - { - if (0u != (PUF_SR_DI_REQUEST_MASK & base->SR)) - { - if (activationCodeSize >= sizeof(uint32_t)) - { - temp32 = *activationCodeAligned; - activationCodeAligned++; - activationCodeSize -= sizeof(uint32_t); - } - /* Send AC again */ - else - { - activationCodeAligned = (const uint32_t *)(uintptr_t)activationCode; - temp32 = *activationCodeAligned; - activationCodeAligned++; - activationCodeSize = PUF_ACTIVATION_CODE_SIZE - sizeof(uint32_t); - } - base->DIR = temp32; - } - } - - /* In case of success fill in score */ - if ((0u != (base->SR & PUF_SR_OK_MASK)) && (score != NULL)) - { - *score = (uint8_t)(base->PSR & PUF_PSR_PUF_SCORE_MASK); - } - - /* get status */ - status = puf_makeStatus(base, kPUF_Start); - - return status; -} - -/*! - * brief Stop PUF - * - * The Stop operation removes all key material from PUF flipflops and PUF SRAM, and sets - * PUF to the Stopped state. - * - * @param base PUF peripheral base address - * @return Status of stop operation. - */ -status_t PUF_Stop(PUF_Type *base) -{ - status_t status = kStatus_Fail; - - /* check if STOP is allowed */ - if (0x0u == (base->AR & PUF_AR_ALLOW_STOP_MASK)) - { - return kStatus_PUF_OperationNotAllowed; - } - - /* begin */ - base->CR = PUF_CR_STOP_MASK; - - /* wait till command is accepted */ - while (0u != (base->CR & PUF_CR_STOP_MASK)) - { - } - - /* wait while busy */ - while (0u != (base->SR & PUF_SR_BUSY_MASK)) - { - } - - /* get status */ - status = puf_makeStatus(base, kPUF_Stop); - - return status; -} - -/*! - * brief PUF Get Key - * - * The Get Key operation derives a key from the intrinsic PUF key and externally provided context. - * - * @param base PUF peripheral base address - * @param keyCtx PUF key context struct - * @param keyDest output destination of the derived PUF key - * @param[out] key Word aligned address of output key (only used when kPUF_KeyDestRegister). - * @param keySize Size of the derived key in bytes. - * @return Status of get key operation. - */ -status_t PUF_GetKey(PUF_Type *base, puf_key_ctx_t *keyCtx, puf_key_dest_t keyDest, uint8_t *key, size_t keySize) -{ - uint8_t idx = 0; - uint32_t *keyAligned = NULL; - uint32_t context[4] = {0}; - status_t status = kStatus_Fail; - - /* check if GET KEY is allowed */ - if (0x0u == (base->AR & PUF_AR_ALLOW_GET_KEY_MASK)) - { - return kStatus_PUF_OperationNotAllowed; - } - - /* check for key context */ - if (keyCtx == NULL) - { - return kStatus_InvalidArgument; - } - - /* check for valid key destination */ - if (((keyDest == kPUF_KeyDestRegister) && (key == NULL)) || (keyDest == kPUF_KeyDestInvalid)) - { - return kStatus_InvalidArgument; - } - - /* check for valid key size. */ - /* must be 8byte multiple */ - if (0U != (keySize & 0x7u)) - { - return kStatus_InvalidArgument; - } - /* if keySize > 128bytes, it must be equal to 256bytes or 384bytes or 512bytes */ - if ((keySize > 128u) && !((keySize == 256u) || (keySize == 384u) || (keySize == 512u))) - { - return kStatus_InvalidArgument; - } - - /* only work with aligned key */ - if (0U != (0x3u & (uintptr_t)key)) - { - return kStatus_InvalidArgument; - } - - keyAligned = (uint32_t *)(uintptr_t)key; - - /* fill in key context */ - context[0] = PUF_KEY_OPERATION_CONTEXT_TYPE | ((keySize * 8u) & PUF_CONTEXT_KEY_LEN_MASK); - context[1] = PUF_CONTEXT_GENERIC_KEY_TYPE | (keyCtx->keyScopeStarted << 8u) | keyCtx->keyScopeEnrolled; - context[2] = keyCtx->userCtx0; - context[3] = keyCtx->userCtx1; - - /* set key destination */ - base->DATA_DEST = keyDest; - - /* begin */ - base->CR = PUF_CR_GET_KEY_MASK; - - /* wait till command is accepted */ - while (0u != (base->CR & PUF_CR_GET_KEY_MASK)) - { - } - - /* send context and read output data while busy */ - while (0U != (base->SR & PUF_SR_BUSY_MASK)) - { - if ((0U != (PUF_SR_DI_REQUEST_MASK & base->SR)) && (idx < 4u)) - { - base->DIR = context[idx]; - idx++; - } - - if ((0U != (PUF_SR_DO_REQUEST_MASK & base->SR)) && (kPUF_KeyDestRegister == keyDest)) - { - if (keySize >= sizeof(uint32_t)) - { - *keyAligned = base->DOR; - keyAligned++; - keySize -= sizeof(uint32_t); - } - } - } - - /* get status */ - status = puf_makeStatus(base, kPUF_GetKey); - - return status; -} - -/*! - * brief PUF Wrap generated random - * - * The Wrap Generated Random operation wraps a random key into a Key Code (KC). - * - * @param base PUF peripheral base address - * @param keyCtx PUF key context struct - * @param keySize Size of the key to be generated in bytes. - * @param[out] keyCode Word aligned address of the resulting key code. - * @param keyCodeSize Size of the output keycode in bytes. - * @return Status of wrap generated random operation. - */ -status_t PUF_WrapGeneratedRandom( - PUF_Type *base, puf_key_ctx_t *keyCtx, size_t keySize, uint8_t *keyCode, size_t keyCodeSize) -{ - uint8_t idx = 0; - uint32_t *keyCodeAligned = NULL; - uint32_t context[4] = {0}; - status_t status = kStatus_Fail; - - /* check if WRAP GENERATED RANDOM is allowed */ - if (0x0u == (base->AR & PUF_AR_ALLOW_WRAP_GENERATED_RANDOM_MASK)) - { - return kStatus_PUF_OperationNotAllowed; - } - - /* check for valid key context and keyCode buffer */ - if ((keyCtx == NULL) || (keyCode == NULL)) - { - return kStatus_InvalidArgument; - } - - /* check for valid key size. */ - /* must be 8byte multiple */ - if (0U != (keySize & 0x7u)) - { - return kStatus_InvalidArgument; - } - /* if keySize > 128bytes, it must be equal to 256bytes or 384bytes or 512bytes */ - if ((keySize > 128u) && !((keySize == 256u) || (keySize == 384u) || (keySize == 512u))) - { - return kStatus_InvalidArgument; - } - - /* check that keyCodeSize is correct for given keySize */ - if (keyCodeSize < PUF_GET_KEY_CODE_SIZE_FOR_KEY_SIZE(keySize)) - { - return kStatus_InvalidArgument; - } - - /* only work with aligned key code */ - if (0U != (0x3u & (uintptr_t)keyCode)) - { - return kStatus_InvalidArgument; - } - - keyCodeAligned = (uint32_t *)(uintptr_t)keyCode; - - /* fill in key context */ - context[0] = PUF_KEY_OPERATION_CONTEXT_TYPE | ((keySize * 8u) & 0x1FFFu); - context[1] = PUF_CONTEXT_GENERIC_KEY_TYPE | (keyCtx->keyScopeStarted << 8u) | keyCtx->keyScopeEnrolled; - context[2] = keyCtx->userCtx0; - context[3] = keyCtx->userCtx1; - - /* begin */ - base->CR = PUF_CR_WRAP_GENERATED_RANDOM_MASK; - - /* wait till command is accepted */ - while (0u != (base->CR & PUF_CR_WRAP_GENERATED_RANDOM_MASK)) - { - } - - /* send context and read output data while busy */ - while (0u != (base->SR & PUF_SR_BUSY_MASK)) - { - if ((0u != (PUF_SR_DI_REQUEST_MASK & base->SR)) && (idx < 4u)) - { - base->DIR = context[idx]; - idx++; - } - - if (0u != (PUF_SR_DO_REQUEST_MASK & base->SR)) - { - if (keyCodeSize >= sizeof(uint32_t)) - { - *keyCodeAligned = base->DOR; - keyCodeAligned++; - keyCodeSize -= sizeof(uint32_t); - } - } - } - - /* get status */ - status = puf_makeStatus(base, kPUF_WrapGeneratedRandom); - - return status; -} - -/*! - * brief PUF Wrap user key - * - * The Wrap operation wraps a user defined key into a Key Code (KC). - * - * @param base PUF peripheral base address - * @param keyCtx PUF key context struct. - * @param userKey Word aligned address of input user key. - * @param userKeySize Size of the key to be wrapped in bytes. - * @param[out] keyCode Word aligned address of the resulting key code. - * @param keyCodeSize Size of the output keycode in bytes. - * @return Status of wrap operation. - */ -status_t PUF_Wrap( - PUF_Type *base, puf_key_ctx_t *keyCtx, uint8_t *userKey, size_t userKeySize, uint8_t *keyCode, size_t keyCodeSize) -{ - uint8_t ctxIdx = 0; - uint32_t *userKeyAligned = NULL; - uint32_t *keyCodeAligned = NULL; - uint32_t context[4] = {0}; - status_t status = kStatus_Fail; - - /* check if WRAP is allowed */ - if (0x0u == (base->AR & PUF_AR_ALLOW_WRAP_MASK)) - { - return kStatus_PUF_OperationNotAllowed; - } - - /* check for valid keyCtx and keyCode pointers */ - if ((keyCtx == NULL) || (keyCode == NULL)) - { - return kStatus_InvalidArgument; - } - - /* check for valid userKey size. */ - /* must be 8byte multiple */ - if (0U != (userKeySize & 0x7u)) - { - return kStatus_InvalidArgument; - } - /* if userKeySize > 128bytes, it must be equal to 256bytes or 384bytes or 512bytes */ - if ((userKeySize > 128u) && !((userKeySize == 256u) || (userKeySize == 384u) || (userKeySize == 512u))) - { - return kStatus_InvalidArgument; - } - - /* check that keyCodeSize is correct for given userKeySize */ - if (keyCodeSize < PUF_GET_KEY_CODE_SIZE_FOR_KEY_SIZE(userKeySize)) - { - return kStatus_InvalidArgument; - } - - /* only work with aligned userKey and key code */ - if (0U != ((0x3u & (uintptr_t)userKey)) || (0U != (0x3u & (uintptr_t)keyCode))) - { - return kStatus_InvalidArgument; - } - - userKeyAligned = (uint32_t *)(uintptr_t)userKey; - keyCodeAligned = (uint32_t *)(uintptr_t)keyCode; - - /* fill in key context */ - context[0] = PUF_KEY_OPERATION_CONTEXT_TYPE | ((userKeySize * 8u) & 0x1FFFu); - context[1] = PUF_CONTEXT_GENERIC_KEY_TYPE | (keyCtx->keyScopeStarted << 8u) | keyCtx->keyScopeEnrolled; - context[2] = keyCtx->userCtx0; - context[3] = keyCtx->userCtx1; - - /* begin */ - base->CR = PUF_CR_WRAP_MASK; - - /* wait till command is accepted */ - while (0u != (base->CR & PUF_CR_WRAP_MASK)) - { - } - - /* send context and read output data while busy */ - while (0u != (base->SR & PUF_SR_BUSY_MASK)) - { - if (0u != (PUF_SR_DI_REQUEST_MASK & base->SR)) - { - /* send context first */ - if (ctxIdx < 4u) - { - base->DIR = context[ctxIdx]; - ctxIdx++; - } - /* send userKey */ - else - { - base->DIR = *userKeyAligned; - userKeyAligned++; - } - } - - if (0u != (PUF_SR_DO_REQUEST_MASK & base->SR)) - { - if (keyCodeSize >= sizeof(uint32_t)) - { - *keyCodeAligned = base->DOR; - keyCodeAligned++; - keyCodeSize -= sizeof(uint32_t); - } - } - } - - /* get status */ - status = puf_makeStatus(base, kPUF_Wrap); - - return status; -} - -/*! - * brief PUF Unwrap user key - * - * The unwrap operation unwraps the key from a previously created Key Code (KC) - * - * @param base PUF peripheral base address - * @param keyDest output destination of the unwraped PUF key - * @param[in] keyCode Word aligned address of the input key code. - * @param keyCodeSize Size of the input keycode in bytes. - * @param key Word aligned address of output key (only used when kPUF_KeyDestRegister). - * @param keySize Size of the key to be generated in bytes. - * @return Status of unwrap operation. - */ -status_t PUF_Unwrap( - PUF_Type *base, puf_key_dest_t keyDest, uint8_t *keyCode, size_t keyCodeSize, uint8_t *key, size_t keySize) -{ - uint32_t *keyAligned = NULL; - uint32_t *keyCodeAligned = NULL; - status_t status = kStatus_Fail; - - /* check if UNWRAP is allowed */ - if (0x0u == (base->AR & PUF_AR_ALLOW_UNWRAP_MASK)) - { - return kStatus_PUF_OperationNotAllowed; - } - - /* check for valid key destination */ - if (((keyDest == kPUF_KeyDestRegister) && (key == NULL)) || (keyDest == kPUF_KeyDestInvalid)) - { - return kStatus_InvalidArgument; - } - - /* only work with aligned key and key code */ - if ((0U != (0x3u & (uintptr_t)key)) || (0U != (0x3u & (uintptr_t)keyCode)) || (keyCode == NULL)) - { - return kStatus_InvalidArgument; - } - - keyAligned = (uint32_t *)(uintptr_t)key; - keyCodeAligned = (uint32_t *)(uintptr_t)keyCode; - - /* set key destination */ - base->DATA_DEST = keyDest; - - /* begin */ - base->CR = PUF_CR_UNWRAP_MASK; - - /* wait till command is accepted */ - while (0u != (base->CR & PUF_CR_UNWRAP_MASK)) - { - } - - /* send context and read output data while busy */ - while (0u != (base->SR & PUF_SR_BUSY_MASK)) - { - if (0u != (PUF_SR_DI_REQUEST_MASK & base->SR)) - { - if (keyCodeSize >= sizeof(uint32_t)) - { - base->DIR = *keyCodeAligned; - keyCodeAligned++; - keyCodeSize -= sizeof(uint32_t); - } - } - - if (0u != (PUF_SR_DO_REQUEST_MASK & base->SR)) - { - if (keySize >= sizeof(uint32_t)) - { - *keyAligned = base->DOR; - keyAligned++; - keySize -= sizeof(uint32_t); - } - } - } - - /* get status */ - status = puf_makeStatus(base, kPUF_Unwrap); - - return status; -} - -/*! - * brief Generate Random - * - * The Generate Random operation outputs the requested amount of random data as specified in a - * provided context. - * - * @param base PUF peripheral base address - * @param size Size of random data to be genarated in bytes. - * @return Status of generate random operation. - */ -status_t PUF_GenerateRandom(PUF_Type *base, uint8_t *data, size_t size) -{ - uint32_t context; - uint32_t *dataAligned = NULL; - status_t status = kStatus_Fail; - - if (data == NULL) - { - return kStatus_InvalidArgument; - } - - /* check if Generate random is allowed */ - if (0u == (base->AR & PUF_AR_ALLOW_GENERATE_RANDOM_MASK)) - { - return kStatus_PUF_OperationNotAllowed; - } - - /* check for valid size. */ - /* must be 8byte multiple */ - if (0U != (size & 0x7u)) - { - return kStatus_InvalidArgument; - } - /* if size > 128bytes, it must be equal to 256bytes or 384bytes or 512bytes */ - if ((size > 128u) && !((size == 256u) || (size == 384u) || (size == 512u))) - { - return kStatus_InvalidArgument; - } - - /* only work with aligned data buffer */ - if (0U != (0x3u & (uintptr_t)data)) - { - return kStatus_InvalidArgument; - } - - /* Configure context */ - context = ((size * 8u) & 0x1FFFu); - - dataAligned = (uint32_t *)(uintptr_t)data; - - /* begin */ - base->DATA_DEST = PUF_DATA_DEST_DEST_DOR_MASK; - - base->CR = PUF_CR_GENERATE_RANDOM_MASK; - - /* wait till command is accepted */ - while (0u != (base->CR & PUF_CR_GENERATE_RANDOM_MASK)) - { - } - - /* send context and read output data while busy */ - while (0u != (base->SR & PUF_SR_BUSY_MASK)) - { - if (0u != (PUF_SR_DI_REQUEST_MASK & base->SR)) - { - base->DIR = context; - } - - if (0u != (PUF_SR_DO_REQUEST_MASK & base->SR)) - { - *dataAligned = base->DOR; - dataAligned++; - } - } - - /* get status */ - status = puf_makeStatus(base, kPUF_GenerateRandom); - - return status; -} - -/*! - * brief Zeroize PUF - * - * This function clears all PUF internal logic and puts the PUF to zeroized state. - * - * @param base PUF peripheral base address - * @return Status of the zeroize operation. - */ -status_t PUF_Zeroize(PUF_Type *base) -{ - status_t status = kStatus_Fail; - - /* zeroize command is always allowed */ - base->CR = PUF_CR_ZEROIZE_MASK; - - /* wait till command is accepted */ - while (0u != (base->CR & PUF_CR_ZEROIZE_MASK)) - { - } - - /* wait while busy */ - while (0u != (base->SR & PUF_SR_BUSY_MASK)) - { - } - - /* check status */ - if (((PUF_SR_ZEROIZED_MASK | PUF_SR_OK_MASK) == base->SR) && (0u == base->AR)) - { - status = puf_makeStatus(base, kPUF_Zeroize); - } - - return status; -} - -/*! - * brief Test PUF - * - * With the Test PUF operation, diagnostics about the PUF quality is collected and presented in a PUF - * score. - * - * @param base PUF peripheral base address - * @param score Value of the PUF Score that was obtained during the enroll operation. - * @return Status of the test operation. - */ -status_t PUF_Test(PUF_Type *base, uint8_t *score) -{ - status_t status = kStatus_Fail; - - /* check if TEST is allowed */ - if (0x0u == (base->AR & PUF_AR_ALLOW_TEST_PUF_MASK)) - { - return kStatus_PUF_OperationNotAllowed; - } - - /* begin */ - base->CR = PUF_CR_TEST_PUF_MASK; - - /* wait till command is accepted */ - while (0u != (base->CR & PUF_CR_TEST_PUF_MASK)) - { - } - - /* wait while busy */ - while (0u != (base->SR & PUF_SR_BUSY_MASK)) - { - } - - /* In case of success fill in score */ - if ((0u != (base->SR & PUF_SR_OK_MASK)) && (score != NULL)) - { - *score = (uint8_t)(base->PSR & PUF_PSR_PUF_SCORE_MASK); - } - - /* Check status */ - status = puf_makeStatus(base, kPUF_Test); - - return status; -} - -/*! - * brief Set lock of PUF operation - * - * Lock the security level of PUF block until key generate, wrap or unwrap operation is completed. - * Note: Only secure-privilege code can change the security level. - * - * @param base PUF peripheral base address - * @param securityLevel Security level of PUF block. - * @return Status of the test operation. - */ -status_t PUF_SetLock(PUF_Type *base, puf_sec_level_t securityLevel) -{ - uint32_t sec_lock_option = 0u; - - if ((securityLevel != kPUF_NonsecureUser) && (securityLevel != kPUF_NonsecurePrivilege) && - (securityLevel != kPUF_SecureUser) && (securityLevel != kPUF_SecurePrivilege)) - { - return kStatus_InvalidArgument; - } - - /* Wait until PUF is in IDLE */ - while ((base->SR & PUF_SR_BUSY_MASK) != 0u) - { - } - - /* Prepare SEC_LOCK option word */ - /* [1:0] - Security level */ - /* [3:2] - anti-pole of security level [1:0] */ - /* [15:4] - PATTERN: This field must be written as 0xAC5 */ - sec_lock_option = SEC_LOCK_PATTERN | securityLevel; - - /* Apply setings */ - base->SEC_LOCK = sec_lock_option; - - /* Check if the security level is same as the level written */ - if (securityLevel != base->SEC_LOCK) - { - return kStatus_Fail; - } - - return kStatus_Success; -} - -/*! - * brief Set App Context mask - * - * This function sets Application defined context mask used in conjunction with key user context 2. - * Whenever bit in this register is 1, corresponding bit in user context 2 provided - * during key code creation should be zero only. - * - * This register is only modifiable by task running at secure-privilege level. - * - * @param base PUF peripheral base address - * @param appCtxMask Value of the Application defined context mask. - * @return Status of the test operation. - */ -status_t PUF_SetCtxMask(PUF_Type *base, uint32_t appCtxMask) -{ - base->APP_CTX_MASK = appCtxMask; - - return kStatus_Success; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_puf_v3.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_puf_v3.h deleted file mode 100644 index de4ea12e54b..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_puf_v3.h +++ /dev/null @@ -1,325 +0,0 @@ -/* - * Copyright 2017-2018,2023 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _PUF_V3_H_ -#define _PUF_V3_H_ - -#include -#include - -#include "fsl_common.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/*! - * @addtogroup puf_v3_driver - * @{ - */ -/*! @name Driver version */ -/*! @{ */ -/*! @brief PUFv3 driver version. Version 2.0.2. - * - * Current version: 2.0.2 - * - * Change log: - * - 2.0.2 - * - Fix MISRA issue in driver. - * - 2.0.1 - * - Fix PUF initialization issue and update driver to reflect SoC header changes. - * - 2.0.0 - * - Initial version. - */ -#define FSL_PUF_V3_DRIVER_VERSION (MAKE_VERSION(2, 0, 2)) -/*! @} */ - -#define kPUF_EndianLittle (0x0u) -#define kPUF_EndianBig (0x1u) -typedef uint32_t puf_endianness_t; - -#define kPUF_KeyDestRegister (0x1u) -#define kPUF_KeyDestKeyBus (0x2u) -#define kPUF_KeyDestInvalid (0x3u) -typedef uint32_t puf_key_dest_t; - -#define kPUF_KeyAllowRegister (0x1u) -#define kPUF_KeyAllowKeyBus (0x2u) -#define kPUF_KeyAllowAll (0x3u) -typedef uint32_t puf_key_scope_t; - -#define kPUF_ResultOK (0x0u) -#define kPUF_AcNotForThisProductPhase1 (0xf0u) -#define kPUF_AcNotForThisProductPhase2 (0xf1u) -#define kPUF_AcCorruptedPhase1 (0xf2u) -#define kPUF_AcCorruptedPhase2 (0xf3u) -#define kPUF_AcAuthFailedPhase1 (0xf4u) -#define kPUF_AcAuthFailedPhase2 (0xf5u) -#define kPUF_QualityVerificationFail (0xf6u) -#define kPUF_ContextIncorrect (0xf7u) -#define kPUF_DestinationNotAllowed (0xf8u) -#define kPUF_Failure (0xFFu) -typedef uint32_t puf_result_code_t; - -#define kPUF_NonsecureUser (0xCu) /* b1100 */ -#define kPUF_NonsecurePrivilege (0x9u) /* b1001 */ -#define kPUF_SecureUser (0x6u) /* b0110 */ -#define kPUF_SecurePrivilege (0x3u) /* b0011 */ -typedef uint32_t puf_sec_level_t; - -typedef struct -{ - puf_endianness_t dataEndianness; - uint8_t CKGATING; -} puf_config_t; - -typedef struct -{ - puf_key_scope_t keyScopeStarted; - puf_key_scope_t keyScopeEnrolled; - uint32_t userCtx0; - uint32_t userCtx1; -} puf_key_ctx_t; - -#define PUF_ACTIVATION_CODE_SIZE (size_t)(FSL_FEATURE_PUF_ACTIVATION_CODE_SIZE) -#define PUF_GET_KEY_CODE_SIZE_FOR_KEY_SIZE(x) ((0x34u + (x)) + 0x10u * ((x) / 0x32u)) -#define SEC_LOCK_PATTERN 0xAC50u - -enum -{ - kStatus_PUF_OperationNotAllowed = MAKE_STATUS(kStatusGroup_PUF, 0xA5), - kStatus_PUF_AcNotForThisProductPhase1 = MAKE_STATUS(kStatusGroup_PUF, kPUF_AcNotForThisProductPhase1), - kStatus_PUF_AcNotForThisProductPhase2 = MAKE_STATUS(kStatusGroup_PUF, kPUF_AcNotForThisProductPhase2), - kStatus_PUF_AcCorruptedPhase1 = MAKE_STATUS(kStatusGroup_PUF, kPUF_AcCorruptedPhase1), - kStatus_PUF_AcCorruptedPhase2 = MAKE_STATUS(kStatusGroup_PUF, kPUF_AcCorruptedPhase2), - kStatus_PUF_AcAuthFailedPhase1 = MAKE_STATUS(kStatusGroup_PUF, kPUF_AcAuthFailedPhase1), - kStatus_PUF_NBOOT_AcAuthFailedPhase2 = MAKE_STATUS(kStatusGroup_PUF, kPUF_AcAuthFailedPhase2), - kStatus_PUF_QualityVerificationFail = MAKE_STATUS(kStatusGroup_PUF, kPUF_QualityVerificationFail), - kStatus_PUF_ContextIncorrect = MAKE_STATUS(kStatusGroup_PUF, kPUF_ContextIncorrect), - kStatus_PUF_DestinationNotAllowed = MAKE_STATUS(kStatusGroup_PUF, kPUF_DestinationNotAllowed), - kStatus_PUF_Failure = MAKE_STATUS(kStatusGroup_PUF, kPUF_Failure), -}; - -/******************************************************************************* - * API - *******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * brief Sets the default configuration of PUF - * - * This function initialize PUF config structure to default values. - * - * @param conf PUF configuration structure - */ -void PUF_GetDefaultConfig(puf_config_t *conf); - -/*! - * brief Initialize PUF - * - * This function enables power to PUF block and waits until the block initializes. - * - * @param conf PUF configuration structure - * @return Status of the init operation - */ -status_t PUF_Init(PUF_Type *base, puf_config_t *conf); - -/*! - * brief Denitialize PUF - * - * This function disables power to PUF SRAM and peripheral clock. - * - * @param base PUF peripheral base address - * @param conf PUF configuration structure - */ -void PUF_Deinit(PUF_Type *base, puf_config_t *conf); - -/*! - * brief Enroll PUF - * - * This function derives a digital fingerprint, generates the corresponding Activation Code (AC) - * and returns it to be stored in an NVM or a file. This step needs to be - * performed only once for each device. This function may be permanently disallowed by a fuse. - * - * @param base PUF peripheral base address - * @param[out] activationCode Word aligned address of the resulting activation code. - * @param activationCodeSize Size of the activationCode buffer in bytes. Shall be FSL_FEATURE_PUF_ACTIVATION_CODE_SIZE bytes. - * @param score Value of the PUF Score that was obtained during the enroll operation. - * @return Status of enroll operation. - */ -status_t PUF_Enroll(PUF_Type *base, uint8_t *activationCode, size_t activationCodeSize, uint8_t *score); - -/*! - * brief Start PUF - * - * The Activation Code generated during the Enroll operation is used to - * reconstruct the digital fingerprint. This needs to be done after every power-up - * and reset. - * - * @param base PUF peripheral base address - * @param[in] activationCode Word aligned address of the input activation code. - * @param activationCodeSize Size of the activationCode buffer in bytes. Shall be FSL_FEATURE_PUF_ACTIVATION_CODE_SIZE bytes. - * @param score Value of the PUF Score that was obtained during the start operation. - * return Status of start operation. - */ -status_t PUF_Start(PUF_Type *base, const uint8_t *activationCode, size_t activationCodeSize, uint8_t *score); - -/*! - * brief Stop PUF - * - * The Stop operation removes all key material from PUF flipflops and PUF SRAM, and sets - * PUF to the Stopped state. - * - * @param base PUF peripheral base address - * @return Status of stop operation. - */ -status_t PUF_Stop(PUF_Type *base); - -/*! - * brief PUF Get Key - * - * The Get Key operation derives a key from the intrinsic PUF key and externally provided context. - * - * @param base PUF peripheral base address - * @param keyCtx PUF key context struct - * @param keyDest output destination of the derived PUF key - * @param[out] key Word aligned address of output key (only used when kPUF_KeyDestRegister). - * @param keySize Size of the derived key in bytes. - * @return Status of get key operation. - */ -status_t PUF_GetKey(PUF_Type *base, puf_key_ctx_t *keyCtx, puf_key_dest_t keyDest, uint8_t *key, size_t keySize); - -/*! - * brief PUF Wrap generated random - * - * The Wrap Generated Random operation wraps a random key into a Key Code (KC). - * - * @param base PUF peripheral base address - * @param keyCtx PUF key context struct - * @param keySize Size of the key to be generated in bytes. - * @param[out] keyCode Word aligned address of the resulting key code. - * @param keyCodeSize Size of the output keycode in bytes. - * @return Status of wrap generated random operation. - */ -status_t PUF_WrapGeneratedRandom( - PUF_Type *base, puf_key_ctx_t *keyCtx, size_t keySize, uint8_t *keyCode, size_t keyCodeSize); - -/*! - * brief PUF Wrap user key - * - * The Wrap operation wraps a user defined key into a Key Code (KC). - * - * @param base PUF peripheral base address - * @param keyCtx PUF key context struct. - * @param userKey Word aligned address of input user key. - * @param userKeySize Size of the key to be wrapped in bytes. - * @param[out] keyCode Word aligned address of the resulting key code. - * @param keyCodeSize Size of the output keycode in bytes. - * @return Status of wrap operation. - */ -status_t PUF_Wrap( - PUF_Type *base, puf_key_ctx_t *keyCtx, uint8_t *userKey, size_t userKeySize, uint8_t *keyCode, size_t keyCodeSize); - -/*! - * brief PUF Unwrap user key - * - * The unwrap operation unwraps the key from a previously created Key Code (KC) - * - * @param base PUF peripheral base address - * @param keyDest output destination of the unwraped PUF key - * @param[in] keyCode Word aligned address of the input key code. - * @param keyCodeSize Size of the input keycode in bytes. - * @param key Word aligned address of output key (only used when kPUF_KeyDestRegister). - * @param keySize Size of the key to be generated in bytes. - * @return Status of unwrap operation. - */ -status_t PUF_Unwrap( - PUF_Type *base, puf_key_dest_t keyDest, uint8_t *keyCode, size_t keyCodeSize, uint8_t *key, size_t keySize); - -/*! - * brief Generate Random - * - * The Generate Random operation outputs the requested amount of random data as specified in a - * provided context. - * - * @param base PUF peripheral base address - * @param size Size of random data to be genarated in bytes. - * @return Status of generate random operation. - */ -status_t PUF_GenerateRandom(PUF_Type *base, uint8_t *data, size_t size); - -/*! - * brief Zeroize PUF - * - * This function clears all PUF internal logic and puts the PUF to zeroized state. - * - * @param base PUF peripheral base address - * @return Status of the zeroize operation. - */ -status_t PUF_Zeroize(PUF_Type *base); - -/*! - * brief Test PUF - * - * With the Test PUF operation, diagnostics about the PUF quality is collected and presented in a PUF - * score. - * - * @param base PUF peripheral base address - * @param score Value of the PUF Score that was obtained during the enroll operation. - * @return Status of the test operation. - */ -status_t PUF_Test(PUF_Type *base, uint8_t *score); - -/*! - * @brief Blocks specified PUF commands - * - * This function blocks PUF commands specified by mask parameter. - * - * @param base PUF peripheral base address - * @param mask Mask of parameters which should be blocked until power-cycle. - * @return Status of the test operation. - */ -static inline void PUF_BlockCommand(PUF_Type *base, uint32_t mask) -{ - base->CONFIG |= mask; -} - -/*! - * brief Set lock of PUF operation - * - * Lock the security level of PUF block until key generate, wrap or unwrap operation is completed. - * Note: Only security level defined in SEC_LOCK register can use PUFv3 or change its security level. - * Default setting after leaving ROM is Secure-Privilege - * - * @param base PUF peripheral base address - * @param securityLevel Security level of PUF block. - * @return Status of the test operation. - */ -status_t PUF_SetLock(PUF_Type *base, puf_sec_level_t securityLevel); - -/*! - * brief Set App Context mask - * - * This function sets Application defined context mask used in conjunction with key user context 2. - * Whenever bit in this register is 1, corresponding bit in user context 2 provided - * during key code creation should be zero only. - * - * This register is only modifiable by task running at secure-privilege level. - * - * @param base PUF peripheral base address - * @param appCtxMask Value of the Application defined context mask. - * @return Status of the test operation. - */ -status_t PUF_SetCtxMask(PUF_Type *base, uint32_t appCtxMask); - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -#endif /* _PUF_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_pwm.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_pwm.c deleted file mode 100644 index 7fe51bcc779..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_pwm.c +++ /dev/null @@ -1,1491 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_pwm.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.pwm" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Get the instance from the base address - * - * @param base PWM peripheral base address - * - * @return The PWM module instance - */ -static uint32_t PWM_GetInstance(PWM_Type *base); - -#if defined(PWM_RSTS) -#define PWM_RESETS_ARRAY PWM_RSTS -#elif defined(FLEXPWM_RSTS) -#define PWM_RESETS_ARRAY FLEXPWM_RSTS -#elif defined(FLEXPWM_RSTS_N) -#define PWM_RESETS_ARRAY FLEXPWM_RSTS_N -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to PWM bases for each instance. */ -static PWM_Type *const s_pwmBases[] = PWM_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to PWM clocks for each PWM submodule. */ -static const clock_ip_name_t s_pwmClocks[][FSL_FEATURE_PWM_SUBMODULE_COUNT] = PWM_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(PWM_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_pwmResets[] = PWM_RESETS_ARRAY; -#endif - -/*! @brief Temporary PWM duty cycle. */ -static uint8_t s_pwmGetPwmDutyCycle[FSL_FEATURE_PWM_SUBMODULE_COUNT][PWM_SUBMODULE_CHANNEL] = {{0}}; - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Complement the variable of type uint16_t as needed - * - * This function can complement the variable of type uint16_t as needed.For example, - * need to ask for the opposite of a positive integer. - * - * param value Parameters of type uint16_t - */ -static inline uint16_t PWM_GetComplementU16(uint16_t value) -{ - return (~value + 1U); -} - -static inline uint16_t dutyCycleToReloadValue(uint8_t dutyCyclePercent) -{ - /* Rounding calculations to improve the accuracy of reloadValue */ - return ((65535U * dutyCyclePercent) + 50U) / 100U; -} - -static uint32_t PWM_GetInstance(PWM_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_pwmBases); instance++) - { - if (s_pwmBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_pwmBases)); - - return instance; -} - -/*! - * brief Set register about period on one PWM submodule. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param mode PWM operation mode, options available in enumeration ::pwm_mode_t - * param pulseCnt PWM period, value should be between 0 to 65535 - */ -static void PWM_SetPeriodRegister(PWM_Type *base, pwm_submodule_t subModule, pwm_mode_t mode, uint16_t pulseCnt) -{ - uint16_t modulo = 0; - - switch (mode) - { - case kPWM_SignedCenterAligned: - /* Setup the PWM period for a signed center aligned signal */ - modulo = (pulseCnt >> 1U); - /* Indicates the start of the PWM period */ - base->SM[subModule].INIT = PWM_GetComplementU16(modulo); - /* Indicates the center value */ - base->SM[subModule].VAL0 = 0; - /* Indicates the end of the PWM period */ - /* The change during the end to start of the PWM period requires a count time */ - base->SM[subModule].VAL1 = modulo - 1U; - break; - case kPWM_CenterAligned: - /* Setup the PWM period for an unsigned center aligned signal */ - /* Indicates the start of the PWM period */ - base->SM[subModule].INIT = 0; - /* Indicates the center value */ - base->SM[subModule].VAL0 = (pulseCnt / 2U); - /* Indicates the end of the PWM period */ - /* The change during the end to start of the PWM period requires a count time */ - base->SM[subModule].VAL1 = pulseCnt - 1U; - break; - case kPWM_SignedEdgeAligned: - /* Setup the PWM period for a signed edge aligned signal */ - modulo = (pulseCnt >> 1U); - /* Indicates the start of the PWM period */ - base->SM[subModule].INIT = PWM_GetComplementU16(modulo); - /* Indicates the center value */ - base->SM[subModule].VAL0 = 0; - /* Indicates the end of the PWM period */ - /* The change during the end to start of the PWM period requires a count time */ - base->SM[subModule].VAL1 = modulo - 1U; - break; - case kPWM_EdgeAligned: - /* Setup the PWM period for a unsigned edge aligned signal */ - /* Indicates the start of the PWM period */ - base->SM[subModule].INIT = 0; - /* Indicates the center value */ - base->SM[subModule].VAL0 = (pulseCnt / 2U); - /* Indicates the end of the PWM period */ - /* The change during the end to start of the PWM period requires a count time */ - base->SM[subModule].VAL1 = pulseCnt - 1U; - break; - default: - assert(false); - break; - } -} - -/*! - * brief Set register about dutycycle on one PWM submodule. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmSignal Signal (PWM A or PWM B) to update - * param mode PWM operation mode, options available in enumeration ::pwm_mode_t - * param pulseCnt PWM period, value should be between 0 to 65535 - * param dutyCycle New PWM pulse width, value should be between 0 to 65535 - */ -static void PWM_SetDutycycleRegister(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmSignal, - pwm_mode_t mode, - uint16_t pulseCnt, - uint16_t pwmHighPulse) -{ - uint16_t modulo = 0; - - switch (mode) - { - case kPWM_SignedCenterAligned: - /* Setup the PWM dutycycle for a signed center aligned signal */ - if (pwmSignal == kPWM_PwmA) - { - base->SM[subModule].VAL2 = PWM_GetComplementU16(pwmHighPulse / 2U); - base->SM[subModule].VAL3 = (pwmHighPulse / 2U); - } - else if (pwmSignal == kPWM_PwmB) - { - base->SM[subModule].VAL4 = PWM_GetComplementU16(pwmHighPulse / 2U); - base->SM[subModule].VAL5 = (pwmHighPulse / 2U); - } - else - { - ; /* Intentional empty */ - } - break; - case kPWM_CenterAligned: - /* Setup the PWM dutycycle for an unsigned center aligned signal */ - if (pwmSignal == kPWM_PwmA) - { - base->SM[subModule].VAL2 = ((pulseCnt - pwmHighPulse) / 2U); - base->SM[subModule].VAL3 = ((pulseCnt + pwmHighPulse) / 2U); - } - else if (pwmSignal == kPWM_PwmB) - { - base->SM[subModule].VAL4 = ((pulseCnt - pwmHighPulse) / 2U); - base->SM[subModule].VAL5 = ((pulseCnt + pwmHighPulse) / 2U); - } - else - { - ; /* Intentional empty */ - } - break; - case kPWM_SignedEdgeAligned: - modulo = (pulseCnt >> 1U); - - /* Setup the PWM dutycycle for a signed edge aligned signal */ - if (pwmSignal == kPWM_PwmA) - { - base->SM[subModule].VAL2 = PWM_GetComplementU16(modulo); - base->SM[subModule].VAL3 = PWM_GetComplementU16(modulo) + pwmHighPulse; - } - else if (pwmSignal == kPWM_PwmB) - { - base->SM[subModule].VAL4 = PWM_GetComplementU16(modulo); - base->SM[subModule].VAL5 = PWM_GetComplementU16(modulo) + pwmHighPulse; - } - else - { - ; /* Intentional empty */ - } - break; - case kPWM_EdgeAligned: - /* Setup the PWM dutycycle for a unsigned edge aligned signal */ - if (pwmSignal == kPWM_PwmA) - { - base->SM[subModule].VAL2 = 0; - base->SM[subModule].VAL3 = pwmHighPulse; - } - else if (pwmSignal == kPWM_PwmB) - { - base->SM[subModule].VAL4 = 0; - base->SM[subModule].VAL5 = pwmHighPulse; - } - else - { - ; /* Intentional empty */ - } - break; - default: - assert(false); - break; - } -} - -/*! - * brief Ungates the PWM submodule clock and configures the peripheral for basic operation. - * - * note This API should be called at the beginning of the application using the PWM driver. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param config Pointer to user's PWM config structure. - * - * return kStatus_Success means success; else failed. - */ -status_t PWM_Init(PWM_Type *base, pwm_submodule_t subModule, const pwm_config_t *config) -{ - assert(config); - - uint16_t reg; - - /* Source clock for submodule 0 cannot be itself */ - if ((config->clockSource == kPWM_Submodule0Clock) && (subModule == kPWM_Module_0)) - { - return kStatus_Fail; - } - - /* Reload source select clock for submodule 0 cannot be master reload */ - if ((config->reloadSelect == kPWM_MasterReload) && (subModule == kPWM_Module_0)) - { - return kStatus_Fail; - } - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate the PWM submodule clock*/ - CLOCK_EnableClock(s_pwmClocks[PWM_GetInstance(base)][subModule]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(PWM_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_pwmResets[PWM_GetInstance(base)]); -#endif - - /* Clear the fault status flags */ - base->FSTS |= PWM_FSTS_FFLAG_MASK; - - reg = base->SM[subModule].CTRL2; - - /* Setup the submodule clock-source, control source of the INIT signal, - * source of the force output signal, operation in debug & wait modes and reload source select - */ - reg &= - ~(uint16_t)(PWM_CTRL2_CLK_SEL_MASK | PWM_CTRL2_FORCE_SEL_MASK | PWM_CTRL2_INIT_SEL_MASK | PWM_CTRL2_INDEP_MASK | -#if !defined(FSL_FEATURE_PWM_HAS_NO_WAITEN) || (!FSL_FEATURE_PWM_HAS_NO_WAITEN) - PWM_CTRL2_WAITEN_MASK | -#endif /* FSL_FEATURE_PWM_HAS_NO_WAITEN */ - PWM_CTRL2_DBGEN_MASK | PWM_CTRL2_RELOAD_SEL_MASK); - reg |= (PWM_CTRL2_CLK_SEL(config->clockSource) | PWM_CTRL2_FORCE_SEL(config->forceTrigger) | - PWM_CTRL2_INIT_SEL(config->initializationControl) | PWM_CTRL2_DBGEN(config->enableDebugMode) | -#if !defined(FSL_FEATURE_PWM_HAS_NO_WAITEN) || (!FSL_FEATURE_PWM_HAS_NO_WAITEN) - PWM_CTRL2_WAITEN(config->enableWait) | -#endif /* FSL_FEATURE_PWM_HAS_NO_WAITEN */ - PWM_CTRL2_RELOAD_SEL(config->reloadSelect)); - - /* Setup PWM A & B to be independent or a complementary-pair */ - switch (config->pairOperation) - { - case kPWM_Independent: - reg |= PWM_CTRL2_INDEP_MASK; - break; - case kPWM_ComplementaryPwmA: - base->MCTRL &= ~((uint16_t)1U << (PWM_MCTRL_IPOL_SHIFT + (uint16_t)subModule)); - break; - case kPWM_ComplementaryPwmB: - base->MCTRL |= ((uint16_t)1U << (PWM_MCTRL_IPOL_SHIFT + (uint16_t)subModule)); - break; - default: - assert(false); - break; - } - base->SM[subModule].CTRL2 = reg; - - reg = base->SM[subModule].CTRL; - - /* Setup the clock prescale, load mode and frequency */ - reg &= ~(uint16_t)(PWM_CTRL_PRSC_MASK | PWM_CTRL_LDFQ_MASK | PWM_CTRL_LDMOD_MASK); - reg |= (PWM_CTRL_PRSC(config->prescale) | PWM_CTRL_LDFQ(config->reloadFrequency)); - - /* Setup register reload logic */ - switch (config->reloadLogic) - { - case kPWM_ReloadImmediate: - reg |= PWM_CTRL_LDMOD_MASK; - break; - case kPWM_ReloadPwmHalfCycle: - reg |= PWM_CTRL_HALF_MASK; - reg &= (uint16_t)(~PWM_CTRL_FULL_MASK); - break; - case kPWM_ReloadPwmFullCycle: - reg &= (uint16_t)(~PWM_CTRL_HALF_MASK); - reg |= PWM_CTRL_FULL_MASK; - break; - case kPWM_ReloadPwmHalfAndFullCycle: - reg |= PWM_CTRL_HALF_MASK; - reg |= PWM_CTRL_FULL_MASK; - break; - default: - assert(false); - break; - } - base->SM[subModule].CTRL = reg; - - /* Set PWM output normal */ -#if defined(PWM_MASK_UPDATE_MASK) - base->MASK &= (uint16_t)(~(uint16_t)(PWM_MASK_MASKX_MASK | PWM_MASK_MASKA_MASK | PWM_MASK_MASKB_MASK | - PWM_MASK_UPDATE_MASK_MASK)); -#else - base->MASK &= ~(uint16_t)(PWM_MASK_MASKX_MASK | PWM_MASK_MASKA_MASK | PWM_MASK_MASKB_MASK); -#endif - - base->DTSRCSEL = 0U; - - /* Issue a Force trigger event when configured to trigger locally */ - if (config->forceTrigger == kPWM_Force_Local) - { - base->SM[subModule].CTRL2 |= PWM_CTRL2_FORCE(1U); - } - - return kStatus_Success; -} - -/*! - * brief Gate the PWM submodule clock - * - * param base PWM peripheral base address - * param subModule PWM submodule to deinitialize - */ -void PWM_Deinit(PWM_Type *base, pwm_submodule_t subModule) -{ - /* Stop the submodule */ - base->MCTRL &= ~((uint16_t)1U << (PWM_MCTRL_RUN_SHIFT + (uint16_t)subModule)); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate the PWM submodule clock*/ - CLOCK_DisableClock(s_pwmClocks[PWM_GetInstance(base)][subModule]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Fill in the PWM config struct with the default settings - * - * The default values are: - * code - * config->enableDebugMode = false; - * config->enableWait = false; - * config->reloadSelect = kPWM_LocalReload; - * config->clockSource = kPWM_BusClock; - * config->prescale = kPWM_Prescale_Divide_1; - * config->initializationControl = kPWM_Initialize_LocalSync; - * config->forceTrigger = kPWM_Force_Local; - * config->reloadFrequency = kPWM_LoadEveryOportunity; - * config->reloadLogic = kPWM_ReloadImmediate; - * config->pairOperation = kPWM_Independent; - * endcode - * param config Pointer to user's PWM config structure. - */ -void PWM_GetDefaultConfig(pwm_config_t *config) -{ - assert(config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - /* PWM is paused in debug mode */ - config->enableDebugMode = false; - /* PWM is paused in wait mode */ -#if !defined(FSL_FEATURE_PWM_HAS_NO_WAITEN) || (!FSL_FEATURE_PWM_HAS_NO_WAITEN) - config->enableWait = false; -#endif /* FSL_FEATURE_PWM_HAS_NO_WAITEN */ - /* PWM module uses the local reload signal to reload registers */ - config->reloadSelect = kPWM_LocalReload; - /* Use the IP Bus clock as source clock for the PWM submodule */ - config->clockSource = kPWM_BusClock; - /* Clock source prescale is set to divide by 1*/ - config->prescale = kPWM_Prescale_Divide_1; - /* Local sync causes initialization */ - config->initializationControl = kPWM_Initialize_LocalSync; - /* The local force signal, CTRL2[FORCE], from the submodule is used to force updates */ - config->forceTrigger = kPWM_Force_Local; - /* PWM reload frequency, reload opportunity is PWM half cycle or full cycle. - * This field is not used in Immediate reload mode - */ - config->reloadFrequency = kPWM_LoadEveryOportunity; - /* Buffered-registers get loaded with new values as soon as LDOK bit is set */ - config->reloadLogic = kPWM_ReloadImmediate; - /* PWM A & PWM B operate as 2 independent channels */ - config->pairOperation = kPWM_Independent; -} - -/*! - * brief Sets up the PWM signals for a PWM submodule. - * - * The function initializes the submodule according to the parameters passed in by the user. The function - * also sets up the value compare registers to match the PWM signal requirements. - * If the dead time insertion logic is enabled, the pulse period is reduced by the - * dead time period specified by the user. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param chnlParams Array of PWM channel parameters to configure the channel(s), PWMX submodule is not supported. - * param numOfChnls Number of channels to configure, this should be the size of the array passed in. - * Array size should not be more than 2 as each submodule has 2 pins to output PWM - * param mode PWM operation mode, options available in enumeration ::pwm_mode_t - * param pwmFreq_Hz PWM signal frequency in Hz - * param srcClock_Hz PWM source clock of correspond submodule in Hz. If source clock of submodule1,2,3 is from - * submodule0 AUX_CLK, its source clock is submodule0 source clock divided with submodule0 - * prescaler value instead of submodule0 source clock. - * - * return Returns kStatusFail if there was error setting up the signal; kStatusSuccess otherwise - */ -status_t PWM_SetupPwm(PWM_Type *base, - pwm_submodule_t subModule, - const pwm_signal_param_t *chnlParams, - uint8_t numOfChnls, - pwm_mode_t mode, - uint32_t pwmFreq_Hz, - uint32_t srcClock_Hz) -{ - assert(chnlParams); - assert(pwmFreq_Hz); - assert(numOfChnls); - assert(srcClock_Hz); - - uint32_t pwmClock; - uint16_t pulseCnt = 0, pwmHighPulse = 0; - uint8_t i, polarityShift = 0, outputEnableShift = 0; - - for (i = 0; i < numOfChnls; i++) - { - if (chnlParams[i].pwmChannel == kPWM_PwmX) - { - /* PWMX configuration is not supported yet */ - return kStatus_Fail; - } - } - - /* Divide the clock by the prescale value */ - pwmClock = (srcClock_Hz / (1UL << ((base->SM[subModule].CTRL & PWM_CTRL_PRSC_MASK) >> PWM_CTRL_PRSC_SHIFT))); - pulseCnt = (uint16_t)(pwmClock / pwmFreq_Hz); - - /* Setup each PWM channel */ - for (i = 0; i < numOfChnls; i++) - { - /* Calculate pulse width */ - pwmHighPulse = (pulseCnt * chnlParams->dutyCyclePercent) / 100U; - - /* Setup the different match registers to generate the PWM signal */ - if (i == 0U) - { - /* Update register about period */ - PWM_SetPeriodRegister(base, subModule, mode, pulseCnt); - } - - /* Update register about dutycycle */ - PWM_SetDutycycleRegister(base, subModule, chnlParams->pwmChannel, mode, pulseCnt, pwmHighPulse); - - /* Setup register shift values based on the channel being configured. - * Also setup the deadtime value - */ - if (chnlParams->pwmChannel == kPWM_PwmA) - { - polarityShift = PWM_OCTRL_POLA_SHIFT; - outputEnableShift = PWM_OUTEN_PWMA_EN_SHIFT; - base->SM[subModule].DTCNT0 = PWM_DTCNT0_DTCNT0(chnlParams->deadtimeValue); - } - else - { - polarityShift = PWM_OCTRL_POLB_SHIFT; - outputEnableShift = PWM_OUTEN_PWMB_EN_SHIFT; - base->SM[subModule].DTCNT1 = PWM_DTCNT1_DTCNT1(chnlParams->deadtimeValue); - } - - /* Set PWM output fault status */ - switch (chnlParams->pwmChannel) - { - case kPWM_PwmA: - base->SM[subModule].OCTRL &= ~((uint16_t)PWM_OCTRL_PWMAFS_MASK); - base->SM[subModule].OCTRL |= (((uint16_t)(chnlParams->faultState) << (uint16_t)PWM_OCTRL_PWMAFS_SHIFT) & - (uint16_t)PWM_OCTRL_PWMAFS_MASK); - break; - case kPWM_PwmB: - base->SM[subModule].OCTRL &= ~((uint16_t)PWM_OCTRL_PWMBFS_MASK); - base->SM[subModule].OCTRL |= (((uint16_t)(chnlParams->faultState) << (uint16_t)PWM_OCTRL_PWMBFS_SHIFT) & - (uint16_t)PWM_OCTRL_PWMBFS_MASK); - break; - default: - assert(false); - break; - } - - /* Setup signal active level */ - if ((bool)chnlParams->level == kPWM_HighTrue) - { - base->SM[subModule].OCTRL &= ~((uint16_t)1U << (uint16_t)polarityShift); - } - else - { - base->SM[subModule].OCTRL |= ((uint16_t)1U << (uint16_t)polarityShift); - } - if (chnlParams->pwmchannelenable) - { - /* Enable PWM output */ - base->OUTEN |= ((uint16_t)1U << ((uint16_t)outputEnableShift + (uint16_t)subModule)); - } - - /* Get the pwm duty cycle */ - s_pwmGetPwmDutyCycle[subModule][chnlParams->pwmChannel] = chnlParams->dutyCyclePercent; - - /* Get the next channel parameters */ - chnlParams++; - } - - return kStatus_Success; -} - -/*! - * brief Set PWM phase shift for PWM channel running on channel PWM_A, PWM_B which with 50% duty cycle. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmChannel PWM channel to configure - * param pwmFreq_Hz PWM signal frequency in Hz - * param srcClock_Hz PWM main counter clock in Hz. - * param shiftvalue Phase shift value, range in 0 ~ 50 - * param doSync true: Set LDOK bit for the submodule list; - * false: LDOK bit don't set, need to call PWM_SetPwmLdok to sync update. - * - * return Returns kStatus_Fail if there was error setting up the signal; kStatus_Success otherwise - */ -status_t PWM_SetupPwmPhaseShift(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - uint32_t pwmFreq_Hz, - uint32_t srcClock_Hz, - uint8_t shiftvalue, - bool doSync) -{ - assert(pwmFreq_Hz != 0U); - assert(srcClock_Hz != 0U); - assert(shiftvalue <= 50U); - - uint32_t pwmClock; - uint16_t pulseCnt = 0, pwmHighPulse = 0; - uint16_t modulo = 0; - uint16_t shift = 0; - - if (pwmChannel != kPWM_PwmX) - { - /* Divide the clock by the prescale value */ - pwmClock = (srcClock_Hz / (1UL << ((base->SM[subModule].CTRL & PWM_CTRL_PRSC_MASK) >> PWM_CTRL_PRSC_SHIFT))); - pulseCnt = (uint16_t)(pwmClock / pwmFreq_Hz); - - /* Clear LDOK bit if it is set */ - if (0U != (base->MCTRL & PWM_MCTRL_LDOK(1UL << (uint8_t)subModule))) - { - base->MCTRL |= PWM_MCTRL_CLDOK(1UL << (uint8_t)subModule); - } - - modulo = (pulseCnt >> 1U); - /* Indicates the start of the PWM period */ - base->SM[subModule].INIT = PWM_GetComplementU16(modulo); - /* Indicates the center value */ - base->SM[subModule].VAL0 = 0; - /* Indicates the end of the PWM period */ - /* The change during the end to start of the PWM period requires a count time */ - base->SM[subModule].VAL1 = modulo - 1U; - - /* Immediately upon when MCTRL[LDOK] being set */ - base->SM[subModule].CTRL |= PWM_CTRL_LDMOD_MASK; - - /* phase shift value */ - shift = (pulseCnt * shiftvalue) / 100U; - - /* duty cycle 50% */ - pwmHighPulse = pulseCnt / 2U; - - if (pwmChannel == kPWM_PwmA) - { - base->SM[subModule].VAL2 = PWM_GetComplementU16(modulo) + shift; - base->SM[subModule].VAL3 = PWM_GetComplementU16(modulo) + pwmHighPulse + shift - 1U; - } - else if (pwmChannel == kPWM_PwmB) - { - base->SM[subModule].VAL4 = PWM_GetComplementU16(modulo) + shift; - base->SM[subModule].VAL5 = PWM_GetComplementU16(modulo) + pwmHighPulse + shift - 1U; - } - else - { - return kStatus_Fail; - } - - if (doSync) - { - /* Set LDOK bit to load VALx bit */ - base->MCTRL |= PWM_MCTRL_LDOK(1UL << (uint8_t)subModule); - } - } - else - { - return kStatus_Fail; - } - - return kStatus_Success; -} - -/*! - * brief Updates the PWM signal's dutycycle. - * - * The function updates the PWM dutycyle to the new value that is passed in. - * If the dead time insertion logic is enabled then the pulse period is reduced by the - * dead time period specified by the user. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmSignal Signal (PWM A or PWM B) to update - * param currPwmMode The current PWM mode set during PWM setup - * param dutyCyclePercent New PWM pulse width, value should be between 0 to 100 - * 0=inactive signal(0% duty cycle)... - * 100=active signal (100% duty cycle) - */ -void PWM_UpdatePwmDutycycle(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmSignal, - pwm_mode_t currPwmMode, - uint8_t dutyCyclePercent) -{ - assert(dutyCyclePercent <= 100U); - assert(pwmSignal != kPWM_PwmX); - uint16_t reloadValue = dutyCycleToReloadValue(dutyCyclePercent); - - PWM_UpdatePwmDutycycleHighAccuracy(base, subModule, pwmSignal, currPwmMode, reloadValue); -} - -/*! - * brief Updates the PWM signal's dutycycle with 16-bit accuracy. - * - * The function updates the PWM dutycyle to the new value that is passed in. - * If the dead time insertion logic is enabled then the pulse period is reduced by the - * dead time period specified by the user. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmSignal Signal (PWM A or PWM B) to update - * param currPwmMode The current PWM mode set during PWM setup - * param dutyCycle New PWM pulse width, value should be between 0 to 65535 - * 0=inactive signal(0% duty cycle)... - * 65535=active signal (100% duty cycle) - */ -void PWM_UpdatePwmDutycycleHighAccuracy( - PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmSignal, pwm_mode_t currPwmMode, uint16_t dutyCycle) -{ - assert(pwmSignal != kPWM_PwmX); - uint16_t pulseCnt = 0, pwmHighPulse = 0; - uint16_t modulo = 0; - - switch (currPwmMode) - { - case kPWM_SignedCenterAligned: - modulo = base->SM[subModule].VAL1 + 1U; - pulseCnt = modulo * 2U; - /* Calculate pulse width */ - pwmHighPulse = (pulseCnt * dutyCycle) / 65535U; - break; - case kPWM_CenterAligned: - pulseCnt = base->SM[subModule].VAL1 + 1U; - /* Calculate pulse width */ - pwmHighPulse = (pulseCnt * dutyCycle) / 65535U; - break; - case kPWM_SignedEdgeAligned: - modulo = base->SM[subModule].VAL1 + 1U; - pulseCnt = modulo * 2U; - /* Calculate pulse width */ - pwmHighPulse = (pulseCnt * dutyCycle) / 65535U; - break; - case kPWM_EdgeAligned: - pulseCnt = base->SM[subModule].VAL1 + 1U; - /* Calculate pulse width */ - pwmHighPulse = (pulseCnt * dutyCycle) / 65535U; - break; - default: - assert(false); - break; - } - - /* Update register about dutycycle */ - if (kPWM_PwmA == pwmSignal) - { - PWM_SetDutycycleRegister(base, subModule, kPWM_PwmA, currPwmMode, pulseCnt, pwmHighPulse); - } - else if (kPWM_PwmB == pwmSignal) - { - PWM_SetDutycycleRegister(base, subModule, kPWM_PwmB, currPwmMode, pulseCnt, pwmHighPulse); - } - else - { - ; /* Intentional empty */ - } - - if (kPWM_PwmX != pwmSignal) - { - /* Get the pwm duty cycle */ - s_pwmGetPwmDutyCycle[subModule][pwmSignal] = (uint8_t)(dutyCycle * 100U / 65535U); - } -} - -/*! - * brief Update the PWM signal's period and dutycycle for a PWM submodule. - * - * The function updates PWM signal period generated by a specific submodule according to the parameters - * passed in by the user. This function can also set dutycycle weather you want to keep original dutycycle - * or update new dutycycle. Call this function in local sync control mode because PWM period is depended by - * INIT and VAL1 register of each submodule. In master sync initialization control mode, call this function - * to update INIT and VAL1 register of all submodule because PWM period is depended by INIT and VAL1 register - * in submodule0. If the dead time insertion logic is enabled, the pulse period is reduced by the dead time - * period specified by the user. PWM signal will not be generated if its period is less than dead time duration. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmSignal Signal (PWM A or PWM B) to update - * param currPwmMode The current PWM mode set during PWM setup, options available in enumeration ::pwm_mode_t - * param pulseCnt New PWM period, value should be between 0 to 65535 - * 0=minimum PWM period... - * 65535=maximum PWM period - * param dutyCycle New PWM pulse width of channel, value should be between 0 to 65535 - * 0=inactive signal(0% duty cycle)... - * 65535=active signal (100% duty cycle) - * You can keep original dutycycle or update new dutycycle - */ -void PWM_UpdatePwmPeriodAndDutycycle(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmSignal, - pwm_mode_t currPwmMode, - uint16_t pulseCnt, - uint16_t dutyCycle) -{ - uint16_t pwmHighPulse = 0; - - assert(pwmSignal != kPWM_PwmX); - - /* Calculate pulse width */ - pwmHighPulse = (pulseCnt * dutyCycle) / 65535U; - - /* Update register about period */ - PWM_SetPeriodRegister(base, subModule, currPwmMode, pulseCnt); - - /* Update register about dutycycle */ - PWM_SetDutycycleRegister(base, subModule, pwmSignal, currPwmMode, pulseCnt, pwmHighPulse); - - /* Get the pwm duty cycle */ - s_pwmGetPwmDutyCycle[subModule][pwmSignal] = (uint8_t)((dutyCycle * 100U) / 65535U); -} - -/*! - * brief Sets up the PWM input capture - * - * Each PWM submodule has 3 pins that can be configured for use as input capture pins. This function - * sets up the capture parameters for each pin and enables the pin for input capture operation. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmChannel Channel in the submodule to setup - * param inputCaptureParams Parameters passed in to set up the input pin - */ -void PWM_SetupInputCapture(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - const pwm_input_capture_param_t *inputCaptureParams) -{ - uint16_t reg = 0; - switch (pwmChannel) - { -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA - case kPWM_PwmA: - /* Setup the capture paramters for PWM A pin */ - reg = (PWM_CAPTCTRLA_INP_SELA(inputCaptureParams->captureInputSel) | - PWM_CAPTCTRLA_EDGA0(inputCaptureParams->edge0) | PWM_CAPTCTRLA_EDGA1(inputCaptureParams->edge1) | - PWM_CAPTCTRLA_ONESHOTA(inputCaptureParams->enableOneShotCapture) | - PWM_CAPTCTRLA_CFAWM(inputCaptureParams->fifoWatermark)); - /* Enable the edge counter if using the output edge counter */ - if (inputCaptureParams->captureInputSel) - { - reg |= PWM_CAPTCTRLA_EDGCNTA_EN_MASK; - } - /* Enable input capture operation */ - reg |= PWM_CAPTCTRLA_ARMA_MASK; - - base->SM[subModule].CAPTCTRLA = reg; - - /* Setup the compare value when using the edge counter as source */ - base->SM[subModule].CAPTCOMPA = PWM_CAPTCOMPA_EDGCMPA(inputCaptureParams->edgeCompareValue); - /* Setup PWM A pin for input capture */ - base->OUTEN &= ~((uint16_t)1U << (PWM_OUTEN_PWMA_EN_SHIFT + (uint16_t)subModule)); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB - case kPWM_PwmB: - /* Setup the capture paramters for PWM B pin */ - reg = (PWM_CAPTCTRLB_INP_SELB(inputCaptureParams->captureInputSel) | - PWM_CAPTCTRLB_EDGB0(inputCaptureParams->edge0) | PWM_CAPTCTRLB_EDGB1(inputCaptureParams->edge1) | - PWM_CAPTCTRLB_ONESHOTB(inputCaptureParams->enableOneShotCapture) | - PWM_CAPTCTRLB_CFBWM(inputCaptureParams->fifoWatermark)); - /* Enable the edge counter if using the output edge counter */ - if (inputCaptureParams->captureInputSel) - { - reg |= PWM_CAPTCTRLB_EDGCNTB_EN_MASK; - } - /* Enable input capture operation */ - reg |= PWM_CAPTCTRLB_ARMB_MASK; - - base->SM[subModule].CAPTCTRLB = reg; - - /* Setup the compare value when using the edge counter as source */ - base->SM[subModule].CAPTCOMPB = PWM_CAPTCOMPB_EDGCMPB(inputCaptureParams->edgeCompareValue); - /* Setup PWM B pin for input capture */ - base->OUTEN &= ~((uint16_t)1U << (PWM_OUTEN_PWMB_EN_SHIFT + (uint16_t)subModule)); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX - case kPWM_PwmX: - reg = (PWM_CAPTCTRLX_INP_SELX(inputCaptureParams->captureInputSel) | - PWM_CAPTCTRLX_EDGX0(inputCaptureParams->edge0) | PWM_CAPTCTRLX_EDGX1(inputCaptureParams->edge1) | - PWM_CAPTCTRLX_ONESHOTX(inputCaptureParams->enableOneShotCapture) | - PWM_CAPTCTRLX_CFXWM(inputCaptureParams->fifoWatermark)); - /* Enable the edge counter if using the output edge counter */ - if (inputCaptureParams->captureInputSel) - { - reg |= PWM_CAPTCTRLX_EDGCNTX_EN_MASK; - } - /* Enable input capture operation */ - reg |= PWM_CAPTCTRLX_ARMX_MASK; - - base->SM[subModule].CAPTCTRLX = reg; - - /* Setup the compare value when using the edge counter as source */ - base->SM[subModule].CAPTCOMPX = PWM_CAPTCOMPX_EDGCMPX(inputCaptureParams->edgeCompareValue); - /* Setup PWM X pin for input capture */ - base->OUTEN &= ~((uint16_t)1U << (PWM_OUTEN_PWMX_EN_SHIFT + (uint16_t)subModule)); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX */ - default: - assert(false); - break; - } -} - -/*! - * @brief Sets up the PWM fault input filter. - * - * @param base PWM peripheral base address - * @param faultInputFilterParams Parameters passed in to set up the fault input filter. - */ -void PWM_SetupFaultInputFilter(PWM_Type *base, const pwm_fault_input_filter_param_t *faultInputFilterParams) -{ - assert(NULL != faultInputFilterParams); - - /* When changing values for fault period from a non-zero value, first write a value of 0 to clear the filter. */ - if (0U != (base->FFILT & PWM_FFILT_FILT_PER_MASK)) - { - base->FFILT &= ~(uint16_t)(PWM_FFILT_FILT_PER_MASK); - } - - base->FFILT = (uint16_t)(PWM_FFILT_FILT_PER(faultInputFilterParams->faultFilterPeriod) | - PWM_FFILT_FILT_CNT(faultInputFilterParams->faultFilterCount) | - PWM_FFILT_GSTR(faultInputFilterParams->faultGlitchStretch ? 1U : 0U)); -} - -/*! - * brief Sets up the PWM fault protection. - * - * PWM has 4 fault inputs. - * - * param base PWM peripheral base address - * param faultNum PWM fault to configure. - * param faultParams Pointer to the PWM fault config structure - */ -void PWM_SetupFaults(PWM_Type *base, pwm_fault_input_t faultNum, const pwm_fault_param_t *faultParams) -{ - assert(faultParams); - uint16_t reg; - - reg = base->FCTRL; - /* Set the faults level-settting */ - if (faultParams->faultLevel) - { - reg |= ((uint16_t)1U << (PWM_FCTRL_FLVL_SHIFT + (uint16_t)faultNum)); - } - else - { - reg &= ~((uint16_t)1U << (PWM_FCTRL_FLVL_SHIFT + (uint16_t)faultNum)); - } - /* Set the fault clearing mode */ - if ((uint16_t)faultParams->faultClearingMode != 0U) - { - /* Use manual fault clearing */ - reg &= ~((uint16_t)1U << (PWM_FCTRL_FAUTO_SHIFT + (uint16_t)faultNum)); - if (faultParams->faultClearingMode == kPWM_ManualSafety) - { - /* Use manual fault clearing with safety mode enabled */ - reg |= ((uint16_t)1U << (PWM_FCTRL_FSAFE_SHIFT + (uint16_t)faultNum)); - } - else - { - /* Use manual fault clearing with safety mode disabled */ - reg &= ~((uint16_t)1U << (PWM_FCTRL_FSAFE_SHIFT + (uint16_t)faultNum)); - } - } - else - { - /* Use automatic fault clearing */ - reg |= ((uint16_t)1U << (PWM_FCTRL_FAUTO_SHIFT + (uint16_t)faultNum)); - } - base->FCTRL = reg; - - /* Set the combinational path option */ - if (faultParams->enableCombinationalPath) - { - /* Combinational path from the fault input to the PWM output is available */ - base->FCTRL2 &= ~((uint16_t)1U << (uint16_t)faultNum); - } - else - { - /* No combinational path available, only fault filter & latch signal can disable PWM output */ - base->FCTRL2 |= ((uint16_t)1U << (uint16_t)faultNum); - } - - /* Initially clear both recovery modes */ - reg = base->FSTS; - reg &= ~(((uint16_t)1U << (PWM_FSTS_FFULL_SHIFT + (uint16_t)faultNum)) | - ((uint16_t)1U << (PWM_FSTS_FHALF_SHIFT + (uint16_t)faultNum))); - /* Setup fault recovery */ - switch (faultParams->recoverMode) - { - case kPWM_NoRecovery: - break; - case kPWM_RecoverHalfCycle: - reg |= ((uint16_t)1U << (PWM_FSTS_FHALF_SHIFT + (uint16_t)faultNum)); - break; - case kPWM_RecoverFullCycle: - reg |= ((uint16_t)1U << (PWM_FSTS_FFULL_SHIFT + (uint16_t)faultNum)); - break; - case kPWM_RecoverHalfAndFullCycle: - reg |= ((uint16_t)1U << (PWM_FSTS_FHALF_SHIFT + (uint16_t)faultNum)); - reg |= ((uint16_t)1U << (PWM_FSTS_FFULL_SHIFT + (uint16_t)faultNum)); - break; - default: - assert(false); - break; - } - base->FSTS = reg; -} - -/*! - * brief Fill in the PWM fault config struct with the default settings - * - * The default values are: - * code - * config->faultClearingMode = kPWM_Automatic; - * config->faultLevel = false; - * config->enableCombinationalPath = true; - * config->recoverMode = kPWM_NoRecovery; - * endcode - * param config Pointer to user's PWM fault config structure. - */ -void PWM_FaultDefaultConfig(pwm_fault_param_t *config) -{ - assert(config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - /* PWM uses automatic fault clear mode */ - config->faultClearingMode = kPWM_Automatic; - /* PWM fault level is set to logic 0 */ - config->faultLevel = false; - /* Combinational Path from fault input is enabled */ - config->enableCombinationalPath = true; - /* PWM output will stay inactive when recovering from a fault */ - config->recoverMode = kPWM_NoRecovery; -} - -/*! - * brief Selects the signal to output on a PWM pin when a FORCE_OUT signal is asserted. - * - * The user specifies which channel to configure by supplying the submodule number and whether - * to modify PWM A or PWM B within that submodule. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmChannel Channel to configure - * param mode Signal to output when a FORCE_OUT is triggered - */ -void PWM_SetupForceSignal(PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmChannel, pwm_force_signal_t mode) - -{ - uint16_t shift; - uint16_t reg; - - /* DTSRCSEL register has 4 bits per submodule; 2 bits for PWM A and 2 bits for PWM B */ - shift = ((uint16_t)subModule * 4U) + ((uint16_t)pwmChannel * 2U); - - /* Setup the signal to be passed upon occurrence of a FORCE_OUT signal */ - reg = base->DTSRCSEL; - reg &= ~((uint16_t)0x3U << shift); - reg |= (uint16_t)((uint16_t)mode << shift); - base->DTSRCSEL = reg; -} - -/*! - * brief Enables the selected PWM interrupts - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::pwm_interrupt_enable_t - */ -void PWM_EnableInterrupts(PWM_Type *base, pwm_submodule_t subModule, uint32_t mask) -{ - /* Upper 16 bits are for related to the submodule */ - base->SM[subModule].INTEN |= ((uint16_t)mask & 0xFFFFU); - /* Fault related interrupts */ - base->FCTRL |= ((uint16_t)(mask >> 16U) & PWM_FCTRL_FIE_MASK); -} - -/*! - * brief Disables the selected PWM interrupts - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::pwm_interrupt_enable_t - */ -void PWM_DisableInterrupts(PWM_Type *base, pwm_submodule_t subModule, uint32_t mask) -{ - base->SM[subModule].INTEN &= ~((uint16_t)mask & 0xFFFFU); - base->FCTRL &= ~((uint16_t)(mask >> 16U) & PWM_FCTRL_FIE_MASK); -} - -/*! - * brief Gets the enabled PWM interrupts - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * - * return The enabled interrupts. This is the logical OR of members of the - * enumeration ::pwm_interrupt_enable_t - */ -uint32_t PWM_GetEnabledInterrupts(PWM_Type *base, pwm_submodule_t subModule) -{ - uint32_t enabledInterrupts; - - enabledInterrupts = base->SM[subModule].INTEN; - enabledInterrupts |= (((uint32_t)base->FCTRL & PWM_FCTRL_FIE_MASK) << 16UL); - return enabledInterrupts; -} - -/*! - * brief Gets the PWM status flags - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * - * return The status flags. This is the logical OR of members of the - * enumeration ::pwm_status_flags_t - */ -uint32_t PWM_GetStatusFlags(PWM_Type *base, pwm_submodule_t subModule) -{ - uint32_t statusFlags; - - statusFlags = base->SM[subModule].STS; - statusFlags |= (((uint32_t)base->FSTS & PWM_FSTS_FFLAG_MASK) << 16UL); - - return statusFlags; -} - -/*! - * brief Clears the PWM status flags - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::pwm_status_flags_t - */ -void PWM_ClearStatusFlags(PWM_Type *base, pwm_submodule_t subModule, uint32_t mask) -{ - uint16_t reg; - - base->SM[subModule].STS = ((uint16_t)mask & 0xFFFFU); - reg = base->FSTS; - /* Clear the fault flags and set only the ones we wish to clear as the fault flags are cleared - * by writing a login one - */ - reg &= ~(uint16_t)(PWM_FSTS_FFLAG_MASK); - reg |= (uint16_t)((mask >> 16U) & PWM_FSTS_FFLAG_MASK); - base->FSTS = reg; -} - -/*! - * brief Set PWM output in idle status (high or low). - * - * note This API should call after PWM_SetupPwm() APIs, and PWMX submodule is not supported. - * - * param base PWM peripheral base address - * param pwmChannel PWM channel to configure - * param subModule PWM submodule to configure - * param idleStatus True: PWM output is high in idle status; false: PWM output is low in idle status. - * - * return kStatus_Fail if there was error setting up the signal; kStatus_Success if set output idle success - */ -status_t PWM_SetOutputToIdle(PWM_Type *base, pwm_channels_t pwmChannel, pwm_submodule_t subModule, bool idleStatus) -{ - uint16_t valOn = 0, valOff = 0; - uint16_t ldmod; - - /* Clear LDOK bit if it is set */ - if (0U != (base->MCTRL & PWM_MCTRL_LDOK(1UL << (uint8_t)subModule))) - { - base->MCTRL |= PWM_MCTRL_CLDOK(1UL << (uint8_t)subModule); - } - - valOff = base->SM[subModule].INIT; - valOn = base->SM[subModule].VAL1 + 0x1U; - - if ((valOff + 1U) == valOn) - { - return kStatus_Fail; - } - - /* Should not PWM_X channel */ - if (kPWM_PwmA == pwmChannel) - { - if (0U != (base->SM[subModule].OCTRL & PWM_OCTRL_POLA_MASK)) - { - if (!idleStatus) - { - valOn = base->SM[subModule].INIT; - valOff = base->SM[subModule].VAL1 + 0x1U; - } - } - else - { - if (idleStatus) - { - valOn = base->SM[subModule].INIT; - valOff = base->SM[subModule].VAL1 + 0x1U; - } - } - base->SM[subModule].VAL2 = valOn; - base->SM[subModule].VAL3 = valOff; - } - else if (kPWM_PwmB == pwmChannel) - { - if (0U != (base->SM[subModule].OCTRL & PWM_OCTRL_POLB_MASK)) - { - if (!idleStatus) - { - valOn = base->SM[subModule].INIT; - valOff = base->SM[subModule].VAL1 + 0x1U; - } - } - else - { - if (idleStatus) - { - valOn = base->SM[subModule].INIT; - valOff = base->SM[subModule].VAL1 + 0x1U; - } - } - base->SM[subModule].VAL4 = valOn; - base->SM[subModule].VAL5 = valOff; - } - else - { - return kStatus_Fail; - } - - /* Record Load mode */ - ldmod = base->SM[subModule].CTRL; - /* Set Load mode to make Buffered registers take effect immediately when LDOK bit set */ - base->SM[subModule].CTRL |= PWM_CTRL_LDMOD_MASK; - /* Set LDOK bit to load buffer registers */ - base->MCTRL |= PWM_MCTRL_LDOK(1UL << (uint8_t)subModule); - /* Restore Load mode */ - base->SM[subModule].CTRL = ldmod; - - /* Get pwm duty cycle */ - s_pwmGetPwmDutyCycle[subModule][pwmChannel] = 0x0U; - - return kStatus_Success; -} - -/*! - * brief Get the dutycycle value. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmChannel PWM channel to configure - * - * return Current channel dutycycle value. - */ -uint8_t PWM_GetPwmChannelState(PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmChannel) -{ - return s_pwmGetPwmDutyCycle[subModule][pwmChannel]; -} - -/*! - * brief Set the pwm submodule prescaler. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param prescaler Set prescaler value - */ -void PWM_SetClockMode(PWM_Type *base, pwm_submodule_t subModule, pwm_clock_prescale_t prescaler) -{ - uint16_t reg = base->SM[subModule].CTRL; - - /* Clear LDOK bit if it is set */ - if (0U != (base->MCTRL & PWM_MCTRL_LDOK(1UL << (uint8_t)subModule))) - { - base->MCTRL |= PWM_MCTRL_CLDOK(1UL << (uint8_t)subModule); - } - /* Set submodule prescaler. */ - reg &= ~(uint16_t)PWM_CTRL_PRSC_MASK; - reg |= PWM_CTRL_PRSC(prescaler); - base->SM[subModule].CTRL = reg; - /* Set Load mode to make Buffered registers take effect immediately when LDOK bit set */ - base->SM[subModule].CTRL |= PWM_CTRL_LDMOD_MASK; - /* Set LDOK bit to load buffer registers */ - base->MCTRL |= PWM_MCTRL_LDOK(1UL << (uint8_t)subModule); - /* Restore Load mode */ - base->SM[subModule].CTRL = reg; -} - -/*! - * brief This function enables-disables the forcing of the output of a given eFlexPwm channel to logic 0. - * - * param base PWM peripheral base address - * param pwmChannel PWM channel to configure - * param subModule PWM submodule to configure - * param forcetozero True: Enable the pwm force output to zero; False: Disable the pwm output resumes normal - * function. - */ -void PWM_SetPwmForceOutputToZero(PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmChannel, bool forcetozero) -{ -#if !defined(PWM_MASK_UPDATE_MASK) - uint16_t reg = base->SM[subModule].CTRL2; -#endif - uint16_t mask; - - if (kPWM_PwmA == pwmChannel) - { - mask = PWM_MASK_MASKA(0x01UL << (uint8_t)subModule); - } - else if (kPWM_PwmB == pwmChannel) - { - mask = PWM_MASK_MASKB(0x01UL << (uint8_t)subModule); - } - else - { - mask = PWM_MASK_MASKX(0x01UL << (uint8_t)subModule); - } - - if (forcetozero) - { - /* Disables the channel output, forcing output level to 0 */ - base->MASK |= mask; - } - else - { - /* Enables the channel output */ - base->MASK &= ~mask; - } - -#if defined(PWM_MASK_UPDATE_MASK) - /* Update output mask bits immediately with UPDATE_MASK bit */ - base->MASK |= PWM_MASK_UPDATE_MASK(0x01UL << (uint8_t)subModule); -#else - /* Select local force signal */ - base->SM[subModule].CTRL2 &= ~(uint16_t)PWM_CTRL2_FORCE_SEL_MASK; - /* Issue a local Force trigger event */ - base->SM[subModule].CTRL2 |= PWM_CTRL2_FORCE_MASK; - /* Restore the source of FORCE OUTPUT signal */ - base->SM[subModule].CTRL2 = reg; -#endif -} - -/*! - * brief This function set the output state of the PWM pin as requested for the current cycle. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmChannel PWM channel to configure - * param outputstate Set pwm output state, see @ref pwm_output_state_t. - */ -void PWM_SetChannelOutput(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - pwm_output_state_t outputstate) -{ - uint16_t mask, swcout, sourceShift; - uint16_t reg = base->SM[subModule].CTRL2; - - if (kPWM_PwmA == pwmChannel) - { - mask = PWM_MASK_MASKA(0x01UL << (uint8_t)subModule); - swcout = (uint16_t)PWM_SWCOUT_SM0OUT23_MASK << ((uint8_t)subModule * 2U); - sourceShift = PWM_DTSRCSEL_SM0SEL23_SHIFT + ((uint16_t)subModule * 4U); - } - else if (kPWM_PwmB == pwmChannel) - { - mask = PWM_MASK_MASKB(0x01UL << (uint8_t)subModule); - swcout = (uint16_t)PWM_SWCOUT_SM0OUT45_MASK << ((uint8_t)subModule * 2U); - sourceShift = PWM_DTSRCSEL_SM0SEL45_SHIFT + ((uint16_t)subModule * 4U); - } - else - { - mask = PWM_MASK_MASKX(0x01UL << (uint8_t)subModule); - swcout = 0U; - sourceShift = 0U; - } - - if (kPWM_MaskState == outputstate) - { - /* Disables the channel output, forcing output level to 0 */ - base->MASK |= mask; - } - else - { - /* Enables the channel output first */ - base->MASK &= ~mask; - /* PwmX only support MASK mode */ - if (kPWM_PwmX != pwmChannel) - { - if (kPWM_HighState == outputstate) - { - base->SWCOUT |= swcout; - base->DTSRCSEL = - (base->DTSRCSEL & ~(uint16_t)(0x3UL << sourceShift)) | (uint16_t)(0x2UL << sourceShift); - } - else if (kPWM_LowState == outputstate) - { - base->SWCOUT &= ~swcout; - base->DTSRCSEL = - (base->DTSRCSEL & ~(uint16_t)(0x3UL << sourceShift)) | (uint16_t)(0x2UL << sourceShift); - } - else if (kPWM_NormalState == outputstate) - { - base->DTSRCSEL &= ~(uint16_t)(0x3UL << sourceShift); - } - else - { - base->DTSRCSEL = - (base->DTSRCSEL & ~(uint16_t)(0x3UL << sourceShift)) | (uint16_t)(0x1UL << sourceShift); - } - } - } - - /* Select local force signal */ - base->SM[subModule].CTRL2 &= ~(uint16_t)PWM_CTRL2_FORCE_SEL_MASK; - /* Issue a local Force trigger event */ - base->SM[subModule].CTRL2 |= PWM_CTRL2_FORCE_MASK; - /* Restore the source of FORCE OUTPUT signal */ - base->SM[subModule].CTRL2 = reg; -} - -#if defined(FSL_FEATURE_PWM_HAS_PHASE_DELAY) && FSL_FEATURE_PWM_HAS_PHASE_DELAY -/*! - * brief This function set the phase delay from the master sync signal of submodule 0. - * - * param base PWM peripheral base address - * param subModule PWM submodule to configure - * param pwmChannel PWM channel to configure - * param delayCycles Number of cycles delayed from submodule 0. - * - * return kStatus_Fail if the number of delay cycles is set larger than the period defined in submodule 0; - * kStatus_Success if set phase delay success - */ -status_t PWM_SetPhaseDelay(PWM_Type *base, pwm_channels_t pwmChannel, pwm_submodule_t subModule, uint16_t delayCycles) -{ - assert(subModule != kPWM_Module_0); - uint16_t reg = base->SM[subModule].CTRL2; - - /* Clear LDOK bit if it is set */ - if (0U != (base->MCTRL & PWM_MCTRL_LDOK(1UL << (uint8_t)subModule))) - { - base->MCTRL |= PWM_MCTRL_CLDOK(1UL << (uint8_t)subModule); - } - - if (base->SM[kPWM_Module_0].VAL1 < delayCycles) - { - return kStatus_Fail; - } - else - { - /* - * ERR051989: When the value of the phase delay register SMxPHASEDLY is reduced from a - * non-zero value to 0 and submodule x reload source is from submodule0, the submodule - * x may output an unexpected wide PWM pulse. The workaround is set SMxPHASEDLY=1, - * SMxINIT=SM0INIT-1, SMxVALy=SM0VALy-1 (x=1,2,3, y=0,1,2,3,4,5). - */ -#if defined(FSL_FEATURE_PWM_HAS_ERRATA_51989) && FSL_FEATURE_PWM_HAS_ERRATA_51989 - if (delayCycles == 0 && - ((base->SM[subModule].CTRL2 & PWM_CTRL2_RELOAD_SEL_MASK) >> PWM_CTRL2_RELOAD_SEL_SHIFT) == 1U) - { - base->SM[subModule].PHASEDLY = 1U; - base->SM[subModule].INIT = base->SM[0].INIT - 1U; - base->SM[subModule].VAL0 = base->SM[0].VAL0 - 1U; - base->SM[subModule].VAL1 = base->SM[0].VAL1 - 1U; - base->SM[subModule].VAL2 = base->SM[0].VAL2 - 1U; - base->SM[subModule].VAL3 = base->SM[0].VAL3 - 1U; - base->SM[subModule].VAL4 = base->SM[0].VAL4 - 1U; - base->SM[subModule].VAL5 = base->SM[0].VAL5 - 1U; - } - else - { - base->SM[subModule].PHASEDLY = delayCycles; - } -#else - base->SM[subModule].PHASEDLY = delayCycles; -#endif - } - - /* Select the master sync signal as the source for initialization */ - reg = (reg & ~(uint16_t)PWM_CTRL2_INIT_SEL_MASK) | PWM_CTRL2_INIT_SEL(2); - /* Set Load mode to make Buffered registers take effect immediately when LDOK bit set */ - base->SM[subModule].CTRL |= PWM_CTRL_LDMOD_MASK; - /* Set LDOK bit to load buffer registers */ - base->MCTRL |= PWM_MCTRL_LDOK(1UL << (uint8_t)subModule); - /* Restore the source of phase delay register intialization */ - base->SM[subModule].CTRL2 = reg; - return kStatus_Success; -} -#endif /* FSL_FEATURE_PWM_HAS_PHASE_DELAY */ \ No newline at end of file diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_pwm.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_pwm.h deleted file mode 100644 index 9e0b12ba654..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_pwm.h +++ /dev/null @@ -1,1372 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_PWM_H_ -#define FSL_PWM_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup pwm_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/*! @name Driver version */ -/*! @{ */ -#define FSL_PWM_DRIVER_VERSION (MAKE_VERSION(2, 8, 4)) /*!< Version 2.8.4 */ -/*! @} */ - -/*! Number of bits per submodule for software output control */ -#define PWM_SUBMODULE_SWCONTROL_WIDTH 2 -/*! Because setting the pwm duty cycle doesn't support PWMX, getting the pwm duty cycle also doesn't support PWMX. */ -#define PWM_SUBMODULE_CHANNEL 2 - -/*! @brief List of PWM submodules */ -typedef enum _pwm_submodule -{ - kPWM_Module_0 = 0U, /*!< Submodule 0 */ - kPWM_Module_1, /*!< Submodule 1 */ - kPWM_Module_2, /*!< Submodule 2 */ -#if defined(FSL_FEATURE_PWM_SUBMODULE_COUNT) && (FSL_FEATURE_PWM_SUBMODULE_COUNT > 3U) - kPWM_Module_3 /*!< Submodule 3 */ -#endif /* FSL_FEATURE_PWM_SUBMODULE_COUNT */ -} pwm_submodule_t; - -/*! @brief List of PWM channels in each module */ -typedef enum _pwm_channels -{ - kPWM_PwmB = 0U, - kPWM_PwmA, - kPWM_PwmX -} pwm_channels_t; - -/*! @brief List of PWM value registers */ -typedef enum _pwm_value_register -{ - kPWM_ValueRegister_0 = 0U, /*!< PWM Value0 register */ - kPWM_ValueRegister_1, /*!< PWM Value1 register */ - kPWM_ValueRegister_2, /*!< PWM Value2 register */ - kPWM_ValueRegister_3, /*!< PWM Value3 register */ - kPWM_ValueRegister_4, /*!< PWM Value4 register */ - kPWM_ValueRegister_5 /*!< PWM Value5 register */ -} pwm_value_register_t; - -/*! @brief List of PWM value registers mask */ -enum _pwm_value_register_mask -{ - kPWM_ValueRegisterMask_0 = (1U << 0), /*!< PWM Value0 register mask */ - kPWM_ValueRegisterMask_1 = (1U << 1), /*!< PWM Value1 register mask */ - kPWM_ValueRegisterMask_2 = (1U << 2), /*!< PWM Value2 register mask */ - kPWM_ValueRegisterMask_3 = (1U << 3), /*!< PWM Value3 register mask */ - kPWM_ValueRegisterMask_4 = (1U << 4), /*!< PWM Value4 register mask */ - kPWM_ValueRegisterMask_5 = (1U << 5) /*!< PWM Value5 register mask */ -}; - -/*! @brief PWM clock source selection.*/ -typedef enum _pwm_clock_source -{ - kPWM_BusClock = 0U, /*!< The IPBus clock is used as the clock */ - kPWM_ExternalClock, /*!< EXT_CLK is used as the clock */ - kPWM_Submodule0Clock /*!< Clock of the submodule 0 (AUX_CLK) is used as the source clock */ -} pwm_clock_source_t; - -/*! @brief PWM prescaler factor selection for clock source*/ -typedef enum _pwm_clock_prescale -{ - kPWM_Prescale_Divide_1 = 0U, /*!< PWM clock frequency = fclk/1 */ - kPWM_Prescale_Divide_2, /*!< PWM clock frequency = fclk/2 */ - kPWM_Prescale_Divide_4, /*!< PWM clock frequency = fclk/4 */ - kPWM_Prescale_Divide_8, /*!< PWM clock frequency = fclk/8 */ - kPWM_Prescale_Divide_16, /*!< PWM clock frequency = fclk/16 */ - kPWM_Prescale_Divide_32, /*!< PWM clock frequency = fclk/32 */ - kPWM_Prescale_Divide_64, /*!< PWM clock frequency = fclk/64 */ - kPWM_Prescale_Divide_128 /*!< PWM clock frequency = fclk/128 */ -} pwm_clock_prescale_t; - -/*! @brief Options that can trigger a PWM FORCE_OUT */ -typedef enum _pwm_force_output_trigger -{ - kPWM_Force_Local = 0U, /*!< The local force signal, CTRL2[FORCE], from the submodule is used to force updates */ - kPWM_Force_Master, /*!< The master force signal from submodule 0 is used to force updates */ - kPWM_Force_LocalReload, /*!< The local reload signal from this submodule is used to force updates without regard to - the state of LDOK */ - kPWM_Force_MasterReload, /*!< The master reload signal from submodule 0 is used to force updates if LDOK is set */ - kPWM_Force_LocalSync, /*!< The local sync signal from this submodule is used to force updates */ - kPWM_Force_MasterSync, /*!< The master sync signal from submodule0 is used to force updates */ - kPWM_Force_External, /*!< The external force signal, EXT_FORCE, from outside the PWM module causes updates */ - kPWM_Force_ExternalSync /*!< The external sync signal, EXT_SYNC, from outside the PWM module causes updates */ -} pwm_force_output_trigger_t; - -/*! @brief PWM channel output status */ -typedef enum _pwm_output_state -{ - kPWM_HighState = 0, /*!< The output state of PWM channel is high */ - kPWM_LowState, /*!< The output state of PWM channel is low */ - kPWM_NormalState, /*!< The output state of PWM channel is normal */ - kPWM_InvertState, /*!< The output state of PWM channel is invert */ - kPWM_MaskState /*!< The output state of PWM channel is mask */ -} pwm_output_state_t; - -/*! @brief PWM counter initialization options */ -typedef enum _pwm_init_source -{ - kPWM_Initialize_LocalSync = 0U, /*!< Local sync causes initialization */ - kPWM_Initialize_MasterReload, /*!< Master reload from submodule 0 causes initialization */ - kPWM_Initialize_MasterSync, /*!< Master sync from submodule 0 causes initialization */ - kPWM_Initialize_ExtSync /*!< EXT_SYNC causes initialization */ -} pwm_init_source_t; - -/*! @brief PWM load frequency selection */ -typedef enum _pwm_load_frequency -{ - kPWM_LoadEveryOportunity = 0U, /*!< Every PWM opportunity */ - kPWM_LoadEvery2Oportunity, /*!< Every 2 PWM opportunities */ - kPWM_LoadEvery3Oportunity, /*!< Every 3 PWM opportunities */ - kPWM_LoadEvery4Oportunity, /*!< Every 4 PWM opportunities */ - kPWM_LoadEvery5Oportunity, /*!< Every 5 PWM opportunities */ - kPWM_LoadEvery6Oportunity, /*!< Every 6 PWM opportunities */ - kPWM_LoadEvery7Oportunity, /*!< Every 7 PWM opportunities */ - kPWM_LoadEvery8Oportunity, /*!< Every 8 PWM opportunities */ - kPWM_LoadEvery9Oportunity, /*!< Every 9 PWM opportunities */ - kPWM_LoadEvery10Oportunity, /*!< Every 10 PWM opportunities */ - kPWM_LoadEvery11Oportunity, /*!< Every 11 PWM opportunities */ - kPWM_LoadEvery12Oportunity, /*!< Every 12 PWM opportunities */ - kPWM_LoadEvery13Oportunity, /*!< Every 13 PWM opportunities */ - kPWM_LoadEvery14Oportunity, /*!< Every 14 PWM opportunities */ - kPWM_LoadEvery15Oportunity, /*!< Every 15 PWM opportunities */ - kPWM_LoadEvery16Oportunity /*!< Every 16 PWM opportunities */ -} pwm_load_frequency_t; - -/*! @brief List of PWM fault selections */ -typedef enum _pwm_fault_input -{ - kPWM_Fault_0 = 0U, /*!< Fault 0 input pin */ - kPWM_Fault_1, /*!< Fault 1 input pin */ - kPWM_Fault_2, /*!< Fault 2 input pin */ - kPWM_Fault_3 /*!< Fault 3 input pin */ -} pwm_fault_input_t; - -/*! @brief List of PWM fault disable mapping selections */ -typedef enum _pwm_fault_disable -{ - kPWM_FaultDisable_0 = (1U << 0), /*!< Fault 0 disable mapping */ - kPWM_FaultDisable_1 = (1U << 1), /*!< Fault 1 disable mapping */ - kPWM_FaultDisable_2 = (1U << 2), /*!< Fault 2 disable mapping */ - kPWM_FaultDisable_3 = (1U << 3) /*!< Fault 3 disable mapping */ -} pwm_fault_disable_t; - -/*! @brief List of PWM fault channels */ -typedef enum _pwm_fault_channels -{ - kPWM_faultchannel_0 = 0U, - kPWM_faultchannel_1 -} pwm_fault_channels_t; - -/*! @brief PWM capture edge select */ -typedef enum _pwm_input_capture_edge -{ - kPWM_Disable = 0U, /*!< Disabled */ - kPWM_FallingEdge, /*!< Capture on falling edge only */ - kPWM_RisingEdge, /*!< Capture on rising edge only */ - kPWM_RiseAndFallEdge /*!< Capture on rising or falling edge */ -} pwm_input_capture_edge_t; - -/*! @brief PWM output options when a FORCE_OUT signal is asserted */ -typedef enum _pwm_force_signal -{ - kPWM_UsePwm = 0U, /*!< Generated PWM signal is used by the deadtime logic.*/ - kPWM_InvertedPwm, /*!< Inverted PWM signal is used by the deadtime logic.*/ - kPWM_SoftwareControl, /*!< Software controlled value is used by the deadtime logic. */ - kPWM_UseExternal /*!< PWM_EXTA signal is used by the deadtime logic. */ -} pwm_force_signal_t; - -/*! @brief Options available for the PWM A & B pair operation */ -typedef enum _pwm_chnl_pair_operation -{ - kPWM_Independent = 0U, /*!< PWM A & PWM B operate as 2 independent channels */ - kPWM_ComplementaryPwmA, /*!< PWM A & PWM B are complementary channels, PWM A generates the signal */ - kPWM_ComplementaryPwmB /*!< PWM A & PWM B are complementary channels, PWM B generates the signal */ -} pwm_chnl_pair_operation_t; - -/*! @brief Options available on how to load the buffered-registers with new values */ -typedef enum _pwm_register_reload -{ - kPWM_ReloadImmediate = 0U, /*!< Buffered-registers get loaded with new values as soon as LDOK bit is set */ - kPWM_ReloadPwmHalfCycle, /*!< Registers loaded on a PWM half cycle */ - kPWM_ReloadPwmFullCycle, /*!< Registers loaded on a PWM full cycle */ - kPWM_ReloadPwmHalfAndFullCycle /*!< Registers loaded on a PWM half & full cycle */ -} pwm_register_reload_t; - -/*! @brief Options available on how to re-enable the PWM output when recovering from a fault */ -typedef enum _pwm_fault_recovery_mode -{ - kPWM_NoRecovery = 0U, /*!< PWM output will stay inactive */ - kPWM_RecoverHalfCycle, /*!< PWM output re-enabled at the first half cycle */ - kPWM_RecoverFullCycle, /*!< PWM output re-enabled at the first full cycle */ - kPWM_RecoverHalfAndFullCycle /*!< PWM output re-enabled at the first half or full cycle */ -} pwm_fault_recovery_mode_t; - -/*! @brief List of PWM interrupt options */ -typedef enum _pwm_interrupt_enable -{ - kPWM_CompareVal0InterruptEnable = (1U << 0), /*!< PWM VAL0 compare interrupt */ - kPWM_CompareVal1InterruptEnable = (1U << 1), /*!< PWM VAL1 compare interrupt */ - kPWM_CompareVal2InterruptEnable = (1U << 2), /*!< PWM VAL2 compare interrupt */ - kPWM_CompareVal3InterruptEnable = (1U << 3), /*!< PWM VAL3 compare interrupt */ - kPWM_CompareVal4InterruptEnable = (1U << 4), /*!< PWM VAL4 compare interrupt */ - kPWM_CompareVal5InterruptEnable = (1U << 5), /*!< PWM VAL5 compare interrupt */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX - kPWM_CaptureX0InterruptEnable = (1U << 6), /*!< PWM capture X0 interrupt */ - kPWM_CaptureX1InterruptEnable = (1U << 7), /*!< PWM capture X1 interrupt */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB - kPWM_CaptureB0InterruptEnable = (1U << 8), /*!< PWM capture B0 interrupt */ - kPWM_CaptureB1InterruptEnable = (1U << 9), /*!< PWM capture B1 interrupt */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA - kPWM_CaptureA0InterruptEnable = (1U << 10), /*!< PWM capture A0 interrupt */ - kPWM_CaptureA1InterruptEnable = (1U << 11), /*!< PWM capture A1 interrupt */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA */ - kPWM_ReloadInterruptEnable = (1U << 12), /*!< PWM reload interrupt */ - kPWM_ReloadErrorInterruptEnable = (1U << 13), /*!< PWM reload error interrupt */ - kPWM_Fault0InterruptEnable = (1U << 16), /*!< PWM fault 0 interrupt */ - kPWM_Fault1InterruptEnable = (1U << 17), /*!< PWM fault 1 interrupt */ - kPWM_Fault2InterruptEnable = (1U << 18), /*!< PWM fault 2 interrupt */ - kPWM_Fault3InterruptEnable = (1U << 19) /*!< PWM fault 3 interrupt */ -} pwm_interrupt_enable_t; - -/*! @brief List of PWM status flags */ -typedef enum _pwm_status_flags -{ - kPWM_CompareVal0Flag = (1U << 0), /*!< PWM VAL0 compare flag */ - kPWM_CompareVal1Flag = (1U << 1), /*!< PWM VAL1 compare flag */ - kPWM_CompareVal2Flag = (1U << 2), /*!< PWM VAL2 compare flag */ - kPWM_CompareVal3Flag = (1U << 3), /*!< PWM VAL3 compare flag */ - kPWM_CompareVal4Flag = (1U << 4), /*!< PWM VAL4 compare flag */ - kPWM_CompareVal5Flag = (1U << 5), /*!< PWM VAL5 compare flag */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX - kPWM_CaptureX0Flag = (1U << 6), /*!< PWM capture X0 flag */ - kPWM_CaptureX1Flag = (1U << 7), /*!< PWM capture X1 flag */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB - kPWM_CaptureB0Flag = (1U << 8), /*!< PWM capture B0 flag */ - kPWM_CaptureB1Flag = (1U << 9), /*!< PWM capture B1 flag */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA - kPWM_CaptureA0Flag = (1U << 10), /*!< PWM capture A0 flag */ - kPWM_CaptureA1Flag = (1U << 11), /*!< PWM capture A1 flag */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA */ - kPWM_ReloadFlag = (1U << 12), /*!< PWM reload flag */ - kPWM_ReloadErrorFlag = (1U << 13), /*!< PWM reload error flag */ - kPWM_RegUpdatedFlag = (1U << 14), /*!< PWM registers updated flag */ - kPWM_Fault0Flag = (1U << 16), /*!< PWM fault 0 flag */ - kPWM_Fault1Flag = (1U << 17), /*!< PWM fault 1 flag */ - kPWM_Fault2Flag = (1U << 18), /*!< PWM fault 2 flag */ - kPWM_Fault3Flag = (1U << 19) /*!< PWM fault 3 flag */ -} pwm_status_flags_t; - -/*! @brief List of PWM DMA options */ -typedef enum _pwm_dma_enable -{ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX - kPWM_CaptureX0DMAEnable = (1U << 0), /*!< PWM capture X0 DMA */ - kPWM_CaptureX1DMAEnable = (1U << 1), /*!< PWM capture X1 DMA */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB - kPWM_CaptureB0DMAEnable = (1U << 2), /*!< PWM capture B0 DMA */ - kPWM_CaptureB1DMAEnable = (1U << 3), /*!< PWM capture B1 DMA */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA - kPWM_CaptureA0DMAEnable = (1U << 4), /*!< PWM capture A0 DMA */ - kPWM_CaptureA1DMAEnable = (1U << 5) /*!< PWM capture A1 DMA */ -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA */ -} pwm_dma_enable_t; - -/*! @brief List of PWM capture DMA enable source select */ -typedef enum _pwm_dma_source_select -{ - kPWM_DMARequestDisable = 0U, /*!< Read DMA requests disabled */ - kPWM_DMAWatermarksEnable, /*!< Exceeding a FIFO watermark sets the DMA read request */ - kPWM_DMALocalSync, /*!< A local sync (VAL1 matches counter) sets the read DMA request */ - kPWM_DMALocalReload /*!< A local reload (STS[RF] being set) sets the read DMA request */ -} pwm_dma_source_select_t; - -/*! @brief PWM FIFO Watermark AND Control */ -typedef enum _pwm_watermark_control -{ - kPWM_FIFOWatermarksOR = 0U, /*!< Selected FIFO watermarks are OR'ed together */ - kPWM_FIFOWatermarksAND /*!< Selected FIFO watermarks are AND'ed together */ -} pwm_watermark_control_t; - -/*! @brief PWM operation mode */ -typedef enum _pwm_mode -{ - kPWM_SignedCenterAligned = 0U, /*!< Signed center-aligned */ - kPWM_CenterAligned, /*!< Unsigned cente-aligned */ - kPWM_SignedEdgeAligned, /*!< Signed edge-aligned */ - kPWM_EdgeAligned /*!< Unsigned edge-aligned */ -} pwm_mode_t; - -/*! @brief PWM output pulse mode, high-true or low-true */ -typedef enum _pwm_level_select -{ - kPWM_HighTrue = 0U, /*!< High level represents "on" or "active" state */ - kPWM_LowTrue /*!< Low level represents "on" or "active" state */ -} pwm_level_select_t; - -/*! @brief PWM output fault status */ -typedef enum _pwm_fault_state -{ - kPWM_PwmFaultState0 = - 0U, /*!< Output is forced to logic 0 state prior to consideration of output polarity control. */ - kPWM_PwmFaultState1, /*!< Output is forced to logic 1 state prior to consideration of output polarity control. */ - kPWM_PwmFaultState2, /*!< Output is tristated. */ - kPWM_PwmFaultState3 /*!< Output is tristated. */ -} pwm_fault_state_t; - -/*! @brief PWM reload source select */ -typedef enum _pwm_reload_source_select -{ - kPWM_LocalReload = 0U, /*!< The local reload signal is used to reload registers */ - kPWM_MasterReload /*!< The master reload signal (from submodule 0) is used to reload */ -} pwm_reload_source_select_t; - -/*! @brief PWM fault clearing options */ -typedef enum _pwm_fault_clear -{ - kPWM_Automatic = 0U, /*!< Automatic fault clearing */ - kPWM_ManualNormal, /*!< Manual fault clearing with no fault safety mode */ - kPWM_ManualSafety /*!< Manual fault clearing with fault safety mode */ -} pwm_fault_clear_t; - -/*! @brief Options for submodule master control operation */ -typedef enum _pwm_module_control -{ - kPWM_Control_Module_0 = (1U << 0), /*!< Control submodule 0's start/stop,buffer reload operation */ - kPWM_Control_Module_1 = (1U << 1), /*!< Control submodule 1's start/stop,buffer reload operation */ - kPWM_Control_Module_2 = (1U << 2), /*!< Control submodule 2's start/stop,buffer reload operation */ - kPWM_Control_Module_3 = (1U << 3) /*!< Control submodule 3's start/stop,buffer reload operation */ -} pwm_module_control_t; - -/*! @brief Structure for the user to define the PWM signal characteristics */ -typedef struct _pwm_signal_param -{ - pwm_channels_t pwmChannel; /*!< PWM channel being configured; PWM A or PWM B */ - uint8_t dutyCyclePercent; /*!< PWM pulse width, value should be between 0 to 100 - 0=inactive signal(0% duty cycle)... - 100=always active signal (100% duty cycle)*/ - pwm_level_select_t level; /*!< PWM output active level select */ - uint16_t deadtimeValue; /*!< The deadtime value; only used if channel pair is operating in complementary mode */ - pwm_fault_state_t faultState; /*!< PWM output fault status */ - bool pwmchannelenable; /*!< Enable PWM output */ -} pwm_signal_param_t; - -/*! - * @brief PWM config structure - * - * This structure holds the configuration settings for the PWM peripheral. To initialize this - * structure to reasonable defaults, call the PWM_GetDefaultConfig() function and pass a - * pointer to your config structure instance. - * - * The config struct can be made const so it resides in flash - */ -typedef struct _pwm_config -{ - bool enableDebugMode; /*!< true: PWM continues to run in debug mode; - false: PWM is paused in debug mode */ -#if !defined(FSL_FEATURE_PWM_HAS_NO_WAITEN) || (!FSL_FEATURE_PWM_HAS_NO_WAITEN) - bool enableWait; /*!< true: PWM continues to run in WAIT mode; - false: PWM is paused in WAIT mode */ -#endif /* FSL_FEATURE_PWM_HAS_NO_WAITEN */ - pwm_init_source_t initializationControl; /*!< Option to initialize the counter */ - pwm_clock_source_t clockSource; /*!< Clock source for the counter */ - pwm_clock_prescale_t prescale; /*!< Pre-scaler to divide down the clock */ - pwm_chnl_pair_operation_t pairOperation; /*!< Channel pair in indepedent or complementary mode */ - pwm_register_reload_t reloadLogic; /*!< PWM Reload logic setup */ - pwm_reload_source_select_t reloadSelect; /*!< Reload source select */ - pwm_load_frequency_t reloadFrequency; /*!< Specifies when to reload, used when user's choice - is not immediate reload */ - pwm_force_output_trigger_t forceTrigger; /*!< Specify which signal will trigger a FORCE_OUT */ -} pwm_config_t; - -/*! @brief Structure for the user to configure the fault input filter. */ -typedef struct _pwm_fault_input_filter_param -{ - uint8_t faultFilterCount; /*!< Fault filter count */ - uint8_t faultFilterPeriod; /*!< Fault filter period;value of 0 will bypass the filter */ - bool faultGlitchStretch; /*!< Fault Glitch Stretch Enable: A logic 1 means that input - fault signals will be stretched to at least 2 IPBus clock cycles */ -} pwm_fault_input_filter_param_t; - -/*! @brief Structure is used to hold the parameters to configure a PWM fault */ -typedef struct _pwm_fault_param -{ - pwm_fault_clear_t faultClearingMode; /*!< Fault clearing mode to use */ - bool faultLevel; /*!< true: Logic 1 indicates fault; - false: Logic 0 indicates fault */ - bool enableCombinationalPath; /*!< true: Combinational Path from fault input is enabled; - false: No combination path is available */ - pwm_fault_recovery_mode_t recoverMode; /*!< Specify when to re-enable the PWM output */ -} pwm_fault_param_t; - -/*! - * @brief Structure is used to hold parameters to configure the capture capability of a signal pin - */ -typedef struct _pwm_input_capture_param -{ - bool captureInputSel; /*!< true: Use the edge counter signal as source - false: Use the raw input signal from the pin as source */ - uint8_t edgeCompareValue; /*!< Compare value, used only if edge counter is used as source */ - pwm_input_capture_edge_t edge0; /*!< Specify which edge causes a capture for input circuitry 0 */ - pwm_input_capture_edge_t edge1; /*!< Specify which edge causes a capture for input circuitry 1 */ - bool enableOneShotCapture; /*!< true: Use one-shot capture mode; - false: Use free-running capture mode */ - uint8_t fifoWatermark; /*!< Watermark level for capture FIFO. The capture flags in - the status register will set if the word count in the FIFO - is greater than this watermark level */ -} pwm_input_capture_param_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Ungates the PWM submodule clock and configures the peripheral for basic operation. - * - * @note This API should be called at the beginning of the application using the PWM driver. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param config Pointer to user's PWM config structure. - * - * @return kStatus_Success means success; else failed. - */ -status_t PWM_Init(PWM_Type *base, pwm_submodule_t subModule, const pwm_config_t *config); - -/*! - * @brief Gate the PWM submodule clock - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to deinitialize - */ -void PWM_Deinit(PWM_Type *base, pwm_submodule_t subModule); - -/*! - * @brief Fill in the PWM config struct with the default settings - * - * The default values are: - * @code - * config->enableDebugMode = false; - * config->enableWait = false; - * config->reloadSelect = kPWM_LocalReload; - * config->clockSource = kPWM_BusClock; - * config->prescale = kPWM_Prescale_Divide_1; - * config->initializationControl = kPWM_Initialize_LocalSync; - * config->forceTrigger = kPWM_Force_Local; - * config->reloadFrequency = kPWM_LoadEveryOportunity; - * config->reloadLogic = kPWM_ReloadImmediate; - * config->pairOperation = kPWM_Independent; - * @endcode - * @param config Pointer to user's PWM config structure. - */ -void PWM_GetDefaultConfig(pwm_config_t *config); - -/*! @}*/ - -/*! - * @name Module PWM output - * @{ - */ -/*! - * @brief Sets up the PWM signals for a PWM submodule. - * - * The function initializes the submodule according to the parameters passed in by the user. The function - * also sets up the value compare registers to match the PWM signal requirements. - * If the dead time insertion logic is enabled, the pulse period is reduced by the - * dead time period specified by the user. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param chnlParams Array of PWM channel parameters to configure the channel(s), PWMX submodule is not supported. - * @param numOfChnls Number of channels to configure, this should be the size of the array passed in. - * Array size should not be more than 2 as each submodule has 2 pins to output PWM - * @param mode PWM operation mode, options available in enumeration ::pwm_mode_t - * @param pwmFreq_Hz PWM signal frequency in Hz - * @param srcClock_Hz PWM source clock of correspond submodule in Hz. If source clock of submodule1,2,3 is from - * submodule0 AUX_CLK, its source clock is submodule0 source clock divided with submodule0 - * prescaler value instead of submodule0 source clock. - * - * @return Returns kStatus_Fail if there was error setting up the signal; kStatus_Success otherwise - */ -status_t PWM_SetupPwm(PWM_Type *base, - pwm_submodule_t subModule, - const pwm_signal_param_t *chnlParams, - uint8_t numOfChnls, - pwm_mode_t mode, - uint32_t pwmFreq_Hz, - uint32_t srcClock_Hz); - -/*! - * @brief Set PWM phase shift for PWM channel running on channel PWM_A, PWM_B which with 50% duty cycle. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel PWM channel to configure - * @param pwmFreq_Hz PWM signal frequency in Hz - * @param srcClock_Hz PWM main counter clock in Hz. - * @param shiftvalue Phase shift value, range in 0 ~ 50 - * @param doSync true: Set LDOK bit for the submodule list; - * false: LDOK bit don't set, need to call PWM_SetPwmLdok to sync update. - * - * @return Returns kStatus_Fail if there was error setting up the signal; kStatus_Success otherwise - */ -status_t PWM_SetupPwmPhaseShift(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - uint32_t pwmFreq_Hz, - uint32_t srcClock_Hz, - uint8_t shiftvalue, - bool doSync); - -/*! - * @brief Updates the PWM signal's dutycycle. - * - * The function updates the PWM dutycyle to the new value that is passed in. - * If the dead time insertion logic is enabled then the pulse period is reduced by the - * dead time period specified by the user. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmSignal Signal (PWM A or PWM B) to update - * @param currPwmMode The current PWM mode set during PWM setup - * @param dutyCyclePercent New PWM pulse width, value should be between 0 to 100 - * 0=inactive signal(0% duty cycle)... - * 100=active signal (100% duty cycle) - */ -void PWM_UpdatePwmDutycycle(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmSignal, - pwm_mode_t currPwmMode, - uint8_t dutyCyclePercent); - -/*! - * @brief Updates the PWM signal's dutycycle with 16-bit accuracy. - * - * The function updates the PWM dutycyle to the new value that is passed in. - * If the dead time insertion logic is enabled then the pulse period is reduced by the - * dead time period specified by the user. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmSignal Signal (PWM A or PWM B) to update - * @param currPwmMode The current PWM mode set during PWM setup - * @param dutyCycle New PWM pulse width, value should be between 0 to 65535 - * 0=inactive signal(0% duty cycle)... - * 65535=active signal (100% duty cycle) - */ -void PWM_UpdatePwmDutycycleHighAccuracy( - PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmSignal, pwm_mode_t currPwmMode, uint16_t dutyCycle); - -/*! - * @brief Update the PWM signal's period and dutycycle for a PWM submodule. - * - * The function updates PWM signal period generated by a specific submodule according to the parameters - * passed in by the user. This function can also set dutycycle weather you want to keep original dutycycle - * or update new dutycycle. Call this function in local sync control mode because PWM period is depended by - * INIT and VAL1 register of each submodule. In master sync initialization control mode, call this function - * to update INIT and VAL1 register of all submodule because PWM period is depended by INIT and VAL1 register - * in submodule0. If the dead time insertion logic is enabled, the pulse period is reduced by the dead time - * period specified by the user. PWM signal will not be generated if its period is less than dead time duration. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmSignal Signal (PWM A or PWM B) to update - * @param currPwmMode The current PWM mode set during PWM setup, options available in enumeration ::pwm_mode_t - * @param pulseCnt New PWM period, value should be between 0 to 65535 - * 0=minimum PWM period... - * 65535=maximum PWM period - * @param dutyCycle New PWM pulse width of channel, value should be between 0 to 65535 - * 0=inactive signal(0% duty cycle)... - * 65535=active signal (100% duty cycle) - * You can keep original duty cycle or update new duty cycle - */ -void PWM_UpdatePwmPeriodAndDutycycle(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmSignal, - pwm_mode_t currPwmMode, - uint16_t pulseCnt, - uint16_t dutyCycle); - -/*! @}*/ - -/*! - * @brief Sets up the PWM input capture - * - * Each PWM submodule has 3 pins that can be configured for use as input capture pins. This function - * sets up the capture parameters for each pin and enables the pin for input capture operation. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel Channel in the submodule to setup - * @param inputCaptureParams Parameters passed in to set up the input pin - */ -void PWM_SetupInputCapture(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - const pwm_input_capture_param_t *inputCaptureParams); - -/*! - * @brief Sets up the PWM fault input filter. - * - * @param base PWM peripheral base address - * @param faultInputFilterParams Parameters passed in to set up the fault input filter. - */ -void PWM_SetupFaultInputFilter(PWM_Type *base, const pwm_fault_input_filter_param_t *faultInputFilterParams); - -/*! - * @brief Sets up the PWM fault protection. - * - * PWM has 4 fault inputs. - * - * @param base PWM peripheral base address - * @param faultNum PWM fault to configure. - * @param faultParams Pointer to the PWM fault config structure - */ -void PWM_SetupFaults(PWM_Type *base, pwm_fault_input_t faultNum, const pwm_fault_param_t *faultParams); - -/*! - * @brief Fill in the PWM fault config struct with the default settings - * - * The default values are: - * @code - * config->faultClearingMode = kPWM_Automatic; - * config->faultLevel = false; - * config->enableCombinationalPath = true; - * config->recoverMode = kPWM_NoRecovery; - * @endcode - * @param config Pointer to user's PWM fault config structure. - */ -void PWM_FaultDefaultConfig(pwm_fault_param_t *config); - -/*! - * @brief Selects the signal to output on a PWM pin when a FORCE_OUT signal is asserted. - * - * The user specifies which channel to configure by supplying the submodule number and whether - * to modify PWM A or PWM B within that submodule. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel Channel to configure - * @param mode Signal to output when a FORCE_OUT is triggered - */ -void PWM_SetupForceSignal(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - pwm_force_signal_t mode); - -/*! - * @name Interrupts Interface - * @{ - */ - -/*! - * @brief Enables the selected PWM interrupts - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::pwm_interrupt_enable_t - */ -void PWM_EnableInterrupts(PWM_Type *base, pwm_submodule_t subModule, uint32_t mask); - -/*! - * @brief Disables the selected PWM interrupts - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::pwm_interrupt_enable_t - */ -void PWM_DisableInterrupts(PWM_Type *base, pwm_submodule_t subModule, uint32_t mask); - -/*! - * @brief Gets the enabled PWM interrupts - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * - * @return The enabled interrupts. This is the logical OR of members of the - * enumeration ::pwm_interrupt_enable_t - */ -uint32_t PWM_GetEnabledInterrupts(PWM_Type *base, pwm_submodule_t subModule); - -/*! @}*/ - -/*! - * @name DMA Interface - * @{ - */ - -/*! - * @brief Capture DMA Enable Source Select. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwm_watermark_control PWM FIFO watermark and control - */ -static inline void PWM_DMAFIFOWatermarkControl(PWM_Type *base, - pwm_submodule_t subModule, - pwm_watermark_control_t pwm_watermark_control) -{ - uint16_t reg = base->SM[subModule].DMAEN; - if (pwm_watermark_control == kPWM_FIFOWatermarksOR) - { - reg &= ~((uint16_t)PWM_DMAEN_FAND_MASK); - } - else - { - reg |= ((uint16_t)PWM_DMAEN_FAND_MASK); - } - base->SM[subModule].DMAEN = reg; -} - -/*! - * @brief Capture DMA Enable Source Select. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwm_dma_source_select PWM capture DMA enable source select - */ -static inline void PWM_DMACaptureSourceSelect(PWM_Type *base, - pwm_submodule_t subModule, - pwm_dma_source_select_t pwm_dma_source_select) -{ - uint16_t reg = base->SM[subModule].DMAEN; - - reg &= ~((uint16_t)PWM_DMAEN_CAPTDE_MASK); - reg |= (((uint16_t)pwm_dma_source_select << (uint16_t)PWM_DMAEN_CAPTDE_SHIFT) & (uint16_t)PWM_DMAEN_CAPTDE_MASK); - - base->SM[subModule].DMAEN = reg; -} - -/*! - * @brief Enables or disables the selected PWM DMA Capture read request. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param mask The DMA to enable or disable. This is a logical OR of members of the - * enumeration ::pwm_dma_enable_t - * @param activate true: Enable DMA read request; false: Disable DMA read request - */ -static inline void PWM_EnableDMACapture(PWM_Type *base, pwm_submodule_t subModule, uint16_t mask, bool activate) -{ - uint16_t reg = base->SM[subModule].DMAEN; - if (activate) - { - reg |= (uint16_t)(mask); - } - else - { - reg &= ~((uint16_t)(mask)); - } - base->SM[subModule].DMAEN = reg; -} - -/*! - * @brief Enables or disables the PWM DMA write request. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param activate true: Enable DMA write request; false: Disable DMA write request - */ -static inline void PWM_EnableDMAWrite(PWM_Type *base, pwm_submodule_t subModule, bool activate) -{ - uint16_t reg = base->SM[subModule].DMAEN; - if (activate) - { - reg |= ((uint16_t)PWM_DMAEN_VALDE_MASK); - } - else - { - reg &= ~((uint16_t)PWM_DMAEN_VALDE_MASK); - } - base->SM[subModule].DMAEN = reg; -} - -/*! @}*/ - -/*! - * @name Status Interface - * @{ - */ - -/*! - * @brief Gets the PWM status flags - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * - * @return The status flags. This is the logical OR of members of the - * enumeration ::pwm_status_flags_t - */ -uint32_t PWM_GetStatusFlags(PWM_Type *base, pwm_submodule_t subModule); - -/*! - * @brief Clears the PWM status flags - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::pwm_status_flags_t - */ -void PWM_ClearStatusFlags(PWM_Type *base, pwm_submodule_t subModule, uint32_t mask); - -/*! @}*/ - -/*! - * @name Timer Start and Stop - * @{ - */ - -/*! - * @brief Starts the PWM counter for a single or multiple submodules. - * - * Sets the Run bit which enables the clocks to the PWM submodule. This function can start multiple - * submodules at the same time. - * - * @param base PWM peripheral base address - * @param subModulesToStart PWM submodules to start. This is a logical OR of members of the - * enumeration ::pwm_module_control_t - */ -static inline void PWM_StartTimer(PWM_Type *base, uint8_t subModulesToStart) -{ - base->MCTRL |= PWM_MCTRL_RUN(subModulesToStart); -} - -/*! - * @brief Stops the PWM counter for a single or multiple submodules. - * - * Clears the Run bit which resets the submodule's counter. This function can stop multiple - * submodules at the same time. - * - * @param base PWM peripheral base address - * @param subModulesToStop PWM submodules to stop. This is a logical OR of members of the - * enumeration ::pwm_module_control_t - */ -static inline void PWM_StopTimer(PWM_Type *base, uint8_t subModulesToStop) -{ - base->MCTRL &= ~(PWM_MCTRL_RUN(subModulesToStop)); -} - -/*! @}*/ - -/*! - * @brief Set the PWM VALx registers. - * - * This function allows the user to write value into VAL registers directly. And it will destroying the PWM clock period - * set by the PWM_SetupPwm()/PWM_SetupPwmPhaseShift() functions. - * Due to VALx registers are bufferd, the new value will not active uless call PWM_SetPwmLdok() and the reload point is - * reached. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param valueRegister VALx register that will be writen new value - * @param value Value that will been write into VALx register - */ -static inline void PWM_SetVALxValue(PWM_Type *base, - pwm_submodule_t subModule, - pwm_value_register_t valueRegister, - uint16_t value) -{ - switch (valueRegister) - { - case kPWM_ValueRegister_0: - base->SM[subModule].VAL0 = value; - break; - case kPWM_ValueRegister_1: - base->SM[subModule].VAL1 = value; - break; - case kPWM_ValueRegister_2: - base->SM[subModule].VAL2 = value; - break; - case kPWM_ValueRegister_3: - base->SM[subModule].VAL3 = value; - break; - case kPWM_ValueRegister_4: - base->SM[subModule].VAL4 = value; - break; - case kPWM_ValueRegister_5: - base->SM[subModule].VAL5 = value; - break; - default: - assert(false); - break; - } -} - -/*! - * @brief Get the PWM VALx registers. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param valueRegister VALx register that will be read value - * @return The VALx register value - */ -static inline uint16_t PWM_GetVALxValue(PWM_Type *base, pwm_submodule_t subModule, pwm_value_register_t valueRegister) -{ - uint16_t temp = 0U; - - switch (valueRegister) - { - case kPWM_ValueRegister_0: - temp = base->SM[subModule].VAL0; - break; - case kPWM_ValueRegister_1: - temp = base->SM[subModule].VAL1; - break; - case kPWM_ValueRegister_2: - temp = base->SM[subModule].VAL2; - break; - case kPWM_ValueRegister_3: - temp = base->SM[subModule].VAL3; - break; - case kPWM_ValueRegister_4: - temp = base->SM[subModule].VAL4; - break; - case kPWM_ValueRegister_5: - temp = base->SM[subModule].VAL5; - break; - default: - assert(false); - break; - } - - return temp; -} - -/*! - * @brief Enables or disables the PWM output trigger. - * - * This function allows the user to enable or disable the PWM trigger. The PWM has 2 triggers. Trigger 0 - * is activated when the counter matches VAL 0, VAL 2, or VAL 4 register. Trigger 1 is activated - * when the counter matches VAL 1, VAL 3, or VAL 5 register. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param valueRegister Value register that will activate the trigger - * @param activate true: Enable the trigger; false: Disable the trigger - */ -static inline void PWM_OutputTriggerEnable(PWM_Type *base, - pwm_submodule_t subModule, - pwm_value_register_t valueRegister, - bool activate) -{ - if (activate) - { - base->SM[subModule].TCTRL |= ((uint16_t)1U << (uint16_t)valueRegister); - } - else - { - base->SM[subModule].TCTRL &= ~((uint16_t)1U << (uint16_t)valueRegister); - } -} - -/*! - * @brief Enables the PWM output trigger. - * - * This function allows the user to enable one or more (VAL0-5) PWM trigger. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param valueRegisterMask Value register mask that will activate one or more (VAL0-5) trigger - * enumeration ::_pwm_value_register_mask - */ -static inline void PWM_ActivateOutputTrigger(PWM_Type *base, pwm_submodule_t subModule, uint16_t valueRegisterMask) -{ - base->SM[subModule].TCTRL |= (PWM_TCTRL_OUT_TRIG_EN_MASK & (valueRegisterMask)); -} - -/*! - * @brief Disables the PWM output trigger. - * - * This function allows the user to disables one or more (VAL0-5) PWM trigger. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param valueRegisterMask Value register mask that will Deactivate one or more (VAL0-5) trigger - * enumeration ::_pwm_value_register_mask - */ -static inline void PWM_DeactivateOutputTrigger(PWM_Type *base, pwm_submodule_t subModule, uint16_t valueRegisterMask) -{ - base->SM[subModule].TCTRL &= ~(PWM_TCTRL_OUT_TRIG_EN_MASK & (valueRegisterMask)); -} - -/*! - * @brief Sets the software control output for a pin to high or low. - * - * The user specifies which channel to modify by supplying the submodule number and whether - * to modify PWM A or PWM B within that submodule. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel Channel to configure - * @param value true: Supply a logic 1, false: Supply a logic 0. - */ -static inline void PWM_SetupSwCtrlOut(PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmChannel, bool value) -{ - if (value) - { - base->SWCOUT |= - ((uint16_t)1U << (((uint16_t)subModule * (uint16_t)PWM_SUBMODULE_SWCONTROL_WIDTH) + (uint16_t)pwmChannel)); - } - else - { - base->SWCOUT &= - ~((uint16_t)1U << (((uint16_t)subModule * (uint16_t)PWM_SUBMODULE_SWCONTROL_WIDTH) + (uint16_t)pwmChannel)); - } -} - -/*! - * @brief Sets or clears the PWM LDOK bit on a single or multiple submodules - * - * Set LDOK bit to load buffered values into CTRL[PRSC] and the INIT, FRACVAL and VAL registers. The - * values are loaded immediately if kPWM_ReloadImmediate option was choosen during config. Else the - * values are loaded at the next PWM reload point. - * This function can issue the load command to multiple submodules at the same time. - * - * @param base PWM peripheral base address - * @param subModulesToUpdate PWM submodules to update with buffered values. This is a logical OR of - * members of the enumeration ::pwm_module_control_t - * @param value true: Set LDOK bit for the submodule list; false: Clear LDOK bit - */ -static inline void PWM_SetPwmLdok(PWM_Type *base, uint8_t subModulesToUpdate, bool value) -{ - if (value) - { - base->MCTRL |= PWM_MCTRL_LDOK(subModulesToUpdate); - } - else - { - base->MCTRL |= PWM_MCTRL_CLDOK(subModulesToUpdate); - } -} - -/*! - * @brief Set PWM output fault status - * - * These bits determine the fault state for the PWM_A output in fault conditions - * and STOP mode. It may also define the output state in WAIT and DEBUG modes - * depending on the settings of CTRL2[WAITEN] and CTRL2[DBGEN]. - * This function can update PWM output fault status. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel Channel to configure - * @param faultState PWM output fault status - */ -static inline void PWM_SetPwmFaultState(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - pwm_fault_state_t faultState) -{ - uint16_t reg = base->SM[subModule].OCTRL; - switch (pwmChannel) - { - case kPWM_PwmA: - reg &= ~((uint16_t)PWM_OCTRL_PWMAFS_MASK); - reg |= (((uint16_t)faultState << (uint16_t)PWM_OCTRL_PWMAFS_SHIFT) & (uint16_t)PWM_OCTRL_PWMAFS_MASK); - break; - case kPWM_PwmB: - reg &= ~((uint16_t)PWM_OCTRL_PWMBFS_MASK); - reg |= (((uint16_t)faultState << (uint16_t)PWM_OCTRL_PWMBFS_SHIFT) & (uint16_t)PWM_OCTRL_PWMBFS_MASK); - break; - case kPWM_PwmX: - reg &= ~((uint16_t)PWM_OCTRL_PWMXFS_MASK); - reg |= (((uint16_t)faultState << (uint16_t)PWM_OCTRL_PWMXFS_SHIFT) & (uint16_t)PWM_OCTRL_PWMXFS_MASK); - break; - default: - assert(false); - break; - } - base->SM[subModule].OCTRL = reg; -} - -/*! - * @brief Set PWM fault disable mapping - * - * Each of the four bits of this read/write field is one-to-one associated - * with the four FAULTx inputs of fault channel 0/1. The PWM output will be turned - * off if there is a logic 1 on an FAULTx input and a 1 in the corresponding - * bit of this field. A reset sets all bits in this field. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel PWM channel to configure - * @param pwm_fault_channels PWM fault channel to configure - * @param value Fault disable mapping mask value - * enumeration ::pwm_fault_disable_t - */ -static inline void PWM_SetupFaultDisableMap(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - pwm_fault_channels_t pwm_fault_channels, - uint16_t value) -{ - uint16_t reg = base->SM[subModule].DISMAP[pwm_fault_channels]; - switch (pwmChannel) - { - case kPWM_PwmA: - reg &= ~((uint16_t)PWM_DISMAP_DIS0A_MASK); - reg |= (((uint16_t)(value) << (uint16_t)PWM_DISMAP_DIS0A_SHIFT) & (uint16_t)PWM_DISMAP_DIS0A_MASK); - break; - case kPWM_PwmB: - reg &= ~((uint16_t)PWM_DISMAP_DIS0B_MASK); - reg |= (((uint16_t)(value) << (uint16_t)PWM_DISMAP_DIS0B_SHIFT) & (uint16_t)PWM_DISMAP_DIS0B_MASK); - break; - case kPWM_PwmX: - reg &= ~((uint16_t)PWM_DISMAP_DIS0X_MASK); - reg |= (((uint16_t)(value) << (uint16_t)PWM_DISMAP_DIS0X_SHIFT) & (uint16_t)PWM_DISMAP_DIS0X_MASK); - break; - default: - assert(false); - break; - } - base->SM[subModule].DISMAP[pwm_fault_channels] = reg; -} - -/*! - * @brief Set PWM output enable - * - * This feature allows the user to enable the PWM Output. - * - * @param base PWM peripheral base address - * @param pwmChannel PWM channel to configure - * @param subModule PWM submodule to configure - */ -static inline void PWM_OutputEnable(PWM_Type *base, pwm_channels_t pwmChannel, pwm_submodule_t subModule) -{ - /* Set PWM output */ - switch (pwmChannel) - { - case kPWM_PwmA: - base->OUTEN |= ((uint16_t)1U << ((uint16_t)PWM_OUTEN_PWMA_EN_SHIFT + (uint16_t)subModule)); - break; - case kPWM_PwmB: - base->OUTEN |= ((uint16_t)1U << ((uint16_t)PWM_OUTEN_PWMB_EN_SHIFT + (uint16_t)subModule)); - break; - case kPWM_PwmX: - base->OUTEN |= ((uint16_t)1U << ((uint16_t)PWM_OUTEN_PWMX_EN_SHIFT + (uint16_t)subModule)); - break; - default: - assert(false); - break; - } -} - -/*! - * @brief Set PWM output disable - * - *This feature allows the user to disable the PWM output. - * - * @param base PWM peripheral base address - * @param pwmChannel PWM channel to configure - * @param subModule PWM submodule to configure - */ -static inline void PWM_OutputDisable(PWM_Type *base, pwm_channels_t pwmChannel, pwm_submodule_t subModule) -{ - switch (pwmChannel) - { - case kPWM_PwmA: - base->OUTEN &= ~((uint16_t)1U << ((uint16_t)PWM_OUTEN_PWMA_EN_SHIFT + (uint16_t)subModule)); - break; - case kPWM_PwmB: - base->OUTEN &= ~((uint16_t)1U << ((uint16_t)PWM_OUTEN_PWMB_EN_SHIFT + (uint16_t)subModule)); - break; - case kPWM_PwmX: - base->OUTEN &= ~((uint16_t)1U << ((uint16_t)PWM_OUTEN_PWMX_EN_SHIFT + (uint16_t)subModule)); - break; - default: - assert(false); - break; - } -} - -/*! - * @brief Get the dutycycle value. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel PWM channel to configure - * - * @return Current channel dutycycle value. - */ -uint8_t PWM_GetPwmChannelState(PWM_Type *base, pwm_submodule_t subModule, pwm_channels_t pwmChannel); - -/*! - * @brief Set PWM output in idle status (high or low). - * - * @note This API should call after PWM_SetupPwm() APIs, and PWMX submodule is not supported. - * - * @param base PWM peripheral base address - * @param pwmChannel PWM channel to configure - * @param subModule PWM submodule to configure - * @param idleStatus True: PWM output is high in idle status; false: PWM output is low in idle status. - * - * @return kStatus_Fail if there was error setting up the signal; kStatus_Success if set output idle success - */ -status_t PWM_SetOutputToIdle(PWM_Type *base, pwm_channels_t pwmChannel, pwm_submodule_t subModule, bool idleStatus); - -/*! - * @brief Set the pwm submodule prescaler. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param prescaler Set prescaler value - */ -void PWM_SetClockMode(PWM_Type *base, pwm_submodule_t subModule, pwm_clock_prescale_t prescaler); - -/*! - * @brief This function enables-disables the forcing of the output of a given eFlexPwm channel to logic 0. - * - * @param base PWM peripheral base address - * @param pwmChannel PWM channel to configure - * @param subModule PWM submodule to configure - * @param forcetozero True: Enable the pwm force output to zero; False: Disable the pwm output resumes normal - * function. - */ -void PWM_SetPwmForceOutputToZero(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - bool forcetozero); - -/*! - * @brief This function set the output state of the PWM pin as requested for the current cycle. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel PWM channel to configure - * @param outputstate Set pwm output state, see @ref pwm_output_state_t. - */ -void PWM_SetChannelOutput(PWM_Type *base, - pwm_submodule_t subModule, - pwm_channels_t pwmChannel, - pwm_output_state_t outputstate); - -#if defined(FSL_FEATURE_PWM_HAS_PHASE_DELAY) && FSL_FEATURE_PWM_HAS_PHASE_DELAY -/*! - * @brief This function set the phase delay from the master sync signal of submodule 0. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel PWM channel to configure - * @param delayCycles Number of cycles delayed from submodule 0. - * - * @return kStatus_Fail if the number of delay cycles is set larger than the period defined in submodule 0; - * kStatus_Success if set phase delay success - */ -status_t PWM_SetPhaseDelay(PWM_Type *base, pwm_channels_t pwmChannel, pwm_submodule_t subModule, uint16_t delayCycles); -#endif - -#if defined(FSL_FEATURE_PWM_HAS_INPUT_FILTER_CAPTURE) && FSL_FEATURE_PWM_HAS_INPUT_FILTER_CAPTURE -/*! - * @brief This function set the number of consecutive samples that must agree prior to the input filter. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel PWM channel to configure - * @param filterSampleCount Number of consecutive samples. - */ -static inline void PWM_SetFilterSampleCount(PWM_Type *base, - pwm_channels_t pwmChannel, - pwm_submodule_t subModule, - uint8_t filterSampleCount) -{ - switch(pwmChannel) - { -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA - case kPWM_PwmA: - base->SM[subModule].CAPTFILTA &= ~((uint16_t)PWM_CAPTFILTA_CAPTA_FILT_CNT_MASK); - base->SM[subModule].CAPTFILTA |= PWM_CAPTFILTA_CAPTA_FILT_CNT(filterSampleCount); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB - case kPWM_PwmB: - base->SM[subModule].CAPTFILTB &= ~((uint16_t)PWM_CAPTFILTB_CAPTB_FILT_CNT_MASK); - base->SM[subModule].CAPTFILTB |= PWM_CAPTFILTB_CAPTB_FILT_CNT(filterSampleCount); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX - case kPWM_PwmX: - base->SM[subModule].CAPTFILTX &= ~((uint16_t)PWM_CAPTFILTX_CAPTX_FILT_CNT_MASK); - base->SM[subModule].CAPTFILTX |= PWM_CAPTFILTX_CAPTX_FILT_CNT(filterSampleCount); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX */ - default: - assert(false); - break; - } -} - -/*! - * @brief This function set the sampling period of the fault pin input filter. - * - * @param base PWM peripheral base address - * @param subModule PWM submodule to configure - * @param pwmChannel PWM channel to configure - * @param filterSamplePeriod Sampling period of input filter. - */ -static inline void PWM_SetFilterSamplePeriod(PWM_Type *base, - pwm_channels_t pwmChannel, - pwm_submodule_t subModule, - uint8_t filterSamplePeriod) -{ - switch(pwmChannel) - { -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA - case kPWM_PwmA: - base->SM[subModule].CAPTFILTA &= ~((uint16_t)PWM_CAPTFILTA_CAPTA_FILT_PER_MASK); - base->SM[subModule].CAPTFILTA |= PWM_CAPTFILTA_CAPTA_FILT_PER(filterSamplePeriod); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELA */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB - case kPWM_PwmB: - base->SM[subModule].CAPTFILTB &= ~((uint16_t)PWM_CAPTFILTB_CAPTB_FILT_PER_MASK); - base->SM[subModule].CAPTFILTB |= PWM_CAPTFILTB_CAPTB_FILT_PER(filterSamplePeriod); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELB */ -#if defined(FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX) && FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX - case kPWM_PwmX: - base->SM[subModule].CAPTFILTX &= ~((uint16_t)PWM_CAPTFILTX_CAPTX_FILT_PER_MASK); - base->SM[subModule].CAPTFILTX |= PWM_CAPTFILTX_CAPTX_FILT_PER(filterSamplePeriod); - break; -#endif /* FSL_FEATURE_PWM_HAS_CAPTURE_ON_CHANNELX */ - default: - assert(false); - break; - } -} -#endif - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_PWM_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_qdc.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_qdc.c deleted file mode 100644 index 75158b976c5..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_qdc.c +++ /dev/null @@ -1,645 +0,0 @@ -/* - * Copyright 2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_qdc.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.qdc" -#endif - -#define QDC_CTRL_W1C_FLAGS (QDC_CTRL_HIRQ_MASK | QDC_CTRL_XIRQ_MASK | QDC_CTRL_DIRQ_MASK | QDC_CTRL_CMPIRQ_MASK) -#if (defined(FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) && FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) -#define QDC_CTRL2_W1C_FLAGS (QDC_CTRL2_ROIRQ_MASK | QDC_CTRL2_RUIRQ_MASK) -#else -#define QDC_CTRL2_W1C_FLAGS (QDC_CTRL2_SABIRQ_MASK | QDC_CTRL2_ROIRQ_MASK | QDC_CTRL2_RUIRQ_MASK) -#endif - -#if defined(QDC_RSTS) -#define QDC_RESETS_ARRAY QDC_RSTS -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Get instance number for QDC module. - * - * @param base QDC peripheral base address - */ -static uint32_t QDC_GetInstance(QDC_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to QDC bases for each instance. */ -static QDC_Type *const s_qdcBases[] = QDC_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to QDC clocks for each instance. */ -static const clock_ip_name_t s_qdcClocks[] = QDC_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(QDC_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_qdcResets[] = QDC_RESETS_ARRAY; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t QDC_GetInstance(QDC_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_qdcBases); instance++) - { - if (s_qdcBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_qdcBases)); - - return instance; -} - -/*! - * brief Initialization for the QDC module. - * - * This function is to make the initialization for the QDC module. It should be called firstly before any operation to - * the QDC with the operations like: - * - Enable the clock for QDC module. - * - Configure the QDC's working attributes. - * - * param base QDC peripheral base address. - * param config Pointer to configuration structure. See to "qdc_config_t". - */ -void QDC_Init(QDC_Type *base, const qdc_config_t *config) -{ - assert(NULL != config); - - uint16_t tmp16; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the clock. */ - CLOCK_EnableClock(s_qdcClocks[QDC_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(QDC_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_qdcResets[QDC_GetInstance(base)]); -#endif - - /* QDC_CTRL. */ - tmp16 = base->CTRL & (uint16_t)(~(QDC_CTRL_W1C_FLAGS | QDC_CTRL_HIP_MASK | QDC_CTRL_HNE_MASK | QDC_CTRL_REV_MASK | - QDC_CTRL_PH1_MASK | QDC_CTRL_XIP_MASK | QDC_CTRL_XNE_MASK | QDC_CTRL_WDE_MASK)); - /* For HOME trigger. */ - if (kQDC_HOMETriggerDisabled != config->HOMETriggerMode) - { - tmp16 |= QDC_CTRL_HIP_MASK; - if (kQDC_HOMETriggerOnFallingEdge == config->HOMETriggerMode) - { - tmp16 |= QDC_CTRL_HNE_MASK; - } - } - /* For encoder work mode. */ - if (config->enableReverseDirection) - { - tmp16 |= QDC_CTRL_REV_MASK; - } - if (kQDC_DecoderWorkAsSignalPhaseCountMode == config->decoderWorkMode) - { - tmp16 |= QDC_CTRL_PH1_MASK; - } - /* For INDEX trigger. */ - if (kQDC_INDEXTriggerDisabled != config->INDEXTriggerMode) - { - tmp16 |= QDC_CTRL_XIP_MASK; - if (kQDC_INDEXTriggerOnFallingEdge == config->INDEXTriggerMode) - { - tmp16 |= QDC_CTRL_XNE_MASK; - } - } - /* Watchdog. */ - if (config->enableWatchdog) - { - tmp16 |= QDC_CTRL_WDE_MASK; - base->WTR = config->watchdogTimeoutValue; /* WDOG can be only available when the feature is enabled. */ - } - base->CTRL = tmp16; - - /* QDC_FILT. */ - base->FILT = QDC_FILT_FILT_CNT(config->filterCount) | QDC_FILT_FILT_PER(config->filterSamplePeriod) -#if (defined(FSL_FEATURE_QDC_HAS_FILT_PRSC) && FSL_FEATURE_QDC_HAS_FILT_PRSC) - | QDC_FILT_FILT_PRSC(config->filterPrescaler) -#endif - ; - - /* QDC_CTRL2. */ - tmp16 = base->CTRL2 & (uint16_t)(~(QDC_CTRL2_W1C_FLAGS | QDC_CTRL2_OUTCTL_MASK | QDC_CTRL2_REVMOD_MASK | - QDC_CTRL2_MOD_MASK | QDC_CTRL2_UPDPOS_MASK | QDC_CTRL2_UPDHLD_MASK)); - if (kQDC_POSMATCHOnReadingAnyPositionCounter == config->positionMatchMode) - { - tmp16 |= QDC_CTRL2_OUTCTL_MASK; - } - if (kQDC_RevolutionCountOnRollOverModulus == config->revolutionCountCondition) - { - tmp16 |= QDC_CTRL2_REVMOD_MASK; - } - if (config->enableModuloCountMode) - { - tmp16 |= QDC_CTRL2_MOD_MASK; - /* Set modulus value. */ - base->UMOD = (uint16_t)(config->positionModulusValue >> 16U); /* Upper 16 bits. */ - base->LMOD = (uint16_t)(config->positionModulusValue); /* Lower 16 bits. */ - } - if (config->enableTRIGGERClearPositionCounter) - { - tmp16 |= QDC_CTRL2_UPDPOS_MASK; - } - if (config->enableTRIGGERClearHoldPositionCounter) - { - tmp16 |= QDC_CTRL2_UPDHLD_MASK; - } - base->CTRL2 = tmp16; - -#if (defined(FSL_FEATURE_QDC_HAS_CTRL3) && FSL_FEATURE_QDC_HAS_CTRL3) - /* QDC_CTRL3. */ - tmp16 = base->CTRL3 & (uint16_t)(~(QDC_CTRL3_PMEN_MASK | QDC_CTRL3_PRSC_MASK)); - if (config->enablePeriodMeasurementFunction) - { - tmp16 |= QDC_CTRL3_PMEN_MASK; - /* Set prescaler value. */ - tmp16 |= ((uint16_t)config->prescalerValue << QDC_CTRL3_PRSC_SHIFT); - } - base->CTRL3 = tmp16; -#endif - - /* QDC_UCOMP & QDC_LCOMP. */ - base->UCOMP = (uint16_t)(config->positionCompareValue >> 16U); /* Upper 16 bits. */ - base->LCOMP = (uint16_t)(config->positionCompareValue); /* Lower 16 bits. */ - - /* QDC_UINIT & QDC_LINIT. */ - base->UINIT = (uint16_t)(config->positionInitialValue >> 16U); /* Upper 16 bits. */ - base->LINIT = (uint16_t)(config->positionInitialValue); /* Lower 16 bits. */ -} - -/*! - * brief De-initialization for the QDC module. - * - * This function is to make the de-initialization for the QDC module. It could be called when QDC is no longer used with - * the operations like: - * - Disable the clock for QDC module. - * - * param base QDC peripheral base address. - */ -void QDC_Deinit(QDC_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable the clock. */ - CLOCK_DisableClock(s_qdcClocks[QDC_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Get an available pre-defined settings for QDC's configuration. - * - * This function initializes the QDC configuration structure with an available settings, the default value are: - * code - * config->enableReverseDirection = false; - * config->decoderWorkMode = kQDC_DecoderWorkAsNormalMode; - * config->HOMETriggerMode = kQDC_HOMETriggerDisabled; - * config->INDEXTriggerMode = kQDC_INDEXTriggerDisabled; - * config->enableTRIGGERClearPositionCounter = false; - * config->enableTRIGGERClearHoldPositionCounter = false; - * config->enableWatchdog = false; - * config->watchdogTimeoutValue = 0U; - * config->filterCount = 0U; - * config->filterSamplePeriod = 0U; - * config->positionMatchMode = kQDC_POSMATCHOnPositionCounterEqualToComapreValue; - * config->positionCompareValue = 0xFFFFFFFFU; - * config->revolutionCountCondition = kQDC_RevolutionCountOnINDEXPulse; - * config->enableModuloCountMode = false; - * config->positionModulusValue = 0U; - * config->positionInitialValue = 0U; - * config->prescalerValue = kQDC_ClockDiv1; - * config->enablePeriodMeasurementFunction = true; - * endcode - * param config Pointer to a variable of configuration structure. See to "qdc_config_t". - */ -void QDC_GetDefaultConfig(qdc_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->enableReverseDirection = false; - config->decoderWorkMode = kQDC_DecoderWorkAsNormalMode; - config->HOMETriggerMode = kQDC_HOMETriggerDisabled; - config->INDEXTriggerMode = kQDC_INDEXTriggerDisabled; - config->enableTRIGGERClearPositionCounter = false; - config->enableTRIGGERClearHoldPositionCounter = false; - config->enableWatchdog = false; - config->watchdogTimeoutValue = 0U; - config->filterCount = 0U; - config->filterSamplePeriod = 0U; - config->positionMatchMode = kQDC_POSMATCHOnPositionCounterEqualToComapreValue; - config->positionCompareValue = 0xFFFFFFFFU; - config->revolutionCountCondition = kQDC_RevolutionCountOnINDEXPulse; - config->enableModuloCountMode = false; - config->positionModulusValue = 0U; - config->positionInitialValue = 0U; -#if (defined(FSL_FEATURE_QDC_HAS_CTRL3) && FSL_FEATURE_QDC_HAS_CTRL3) - config->prescalerValue = kQDC_ClockDiv1; - config->enablePeriodMeasurementFunction = true; -#endif - -#if (defined(FSL_FEATURE_QDC_HAS_FILT_PRSC) && FSL_FEATURE_QDC_HAS_FILT_PRSC) - config->filterPrescaler = kQDC_FilterPrescalerDiv1; -#endif -} - -/*! - * brief Load the initial position value to position counter. - * - * This function is to transfer the initial position value (UINIT and LINIT) contents to position counter (UPOS and - * LPOS), so that to provide the consistent operation the position counter registers. - * - * param base QDC peripheral base address. - */ -void QDC_DoSoftwareLoadInitialPositionValue(QDC_Type *base) -{ - uint16_t tmp16 = base->CTRL & (uint16_t)(~QDC_CTRL_W1C_FLAGS); - - tmp16 |= QDC_CTRL_SWIP_MASK; /* Write 1 to trigger the command for loading initial position value. */ - base->CTRL = tmp16; -} - -/*! - * brief Enable and configure the self test function. - * - * This function is to enable and configuration the self test function. It controls and sets the frequency of a - * quadrature signal generator. It provides a quadrature test signal to the inputs of the quadrature decoder module. - * It is a factory test feature; however, it may be useful to customers' software development and testing. - * - * param base QDC peripheral base address. - * param config Pointer to configuration structure. See to "qdc_self_test_config_t". Pass "NULL" to disable. - */ -void QDC_SetSelfTestConfig(QDC_Type *base, const qdc_self_test_config_t *config) -{ - uint16_t tmp16 = 0U; - - if (NULL == config) /* Pass "NULL" to disable the feature. */ - { - tmp16 = 0U; - } - else - { - tmp16 = QDC_TST_TEN_MASK | QDC_TST_TCE_MASK | QDC_TST_TEST_PERIOD(config->signalPeriod) | - QDC_TST_TEST_COUNT(config->signalCount); - if (kQDC_SelfTestDirectionNegative == config->signalDirection) - { - tmp16 |= QDC_TST_QDN_MASK; - } - } - - base->TST = tmp16; -} - -/*! - * brief Enable watchdog for QDC module. - * - * param base QDC peripheral base address - * param enable Enables or disables the watchdog - */ -void QDC_EnableWatchdog(QDC_Type *base, bool enable) -{ - uint16_t tmp16 = base->CTRL & (uint16_t)(~(QDC_CTRL_W1C_FLAGS | QDC_CTRL_WDE_MASK)); - - if (enable) - { - tmp16 |= QDC_CTRL_WDE_MASK; - } - base->CTRL = tmp16; -} - -/*! - * brief Get the status flags. - * - * param base QDC peripheral base address. - * - * return Mask value of status flags. For available mask, see to "_qdc_status_flags". - */ -uint32_t QDC_GetStatusFlags(QDC_Type *base) -{ - uint32_t ret32 = 0U; - - /* QDC_CTRL. */ - if (0U != (QDC_CTRL_HIRQ_MASK & base->CTRL)) - { - ret32 |= (uint32_t)kQDC_HOMETransitionFlag; - } - if (0U != (QDC_CTRL_XIRQ_MASK & base->CTRL)) - { - ret32 |= (uint32_t)kQDC_INDEXPulseFlag; - } - if (0U != (QDC_CTRL_DIRQ_MASK & base->CTRL)) - { - ret32 |= (uint32_t)kQDC_WatchdogTimeoutFlag; - } - if (0U != (QDC_CTRL_CMPIRQ_MASK & base->CTRL)) - { - ret32 |= (uint32_t)kQDC_PositionCompareFlag; - } - - /* QDC_CTRL2. */ -#if !(defined(FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) && FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) - if (0U != (QDC_CTRL2_SABIRQ_MASK & base->CTRL2)) - { - ret32 |= (uint32_t)kQDC_SimultBothPhaseChangeFlag; - } -#endif - if (0U != (QDC_CTRL2_ROIRQ_MASK & base->CTRL2)) - { - ret32 |= (uint32_t)kQDC_PositionRollOverFlag; - } - if (0U != (QDC_CTRL2_RUIRQ_MASK & base->CTRL2)) - { - ret32 |= (uint32_t)kQDC_PositionRollUnderFlag; - } - if (0U != (QDC_CTRL2_DIR_MASK & base->CTRL2)) - { - ret32 |= (uint32_t)kQDC_LastCountDirectionFlag; - } - - return ret32; -} - -/*! - * brief Clear the status flags. - * - * param base QDC peripheral base address. - * param mask Mask value of status flags to be cleared. For available mask, see to "_qdc_status_flags". - */ -void QDC_ClearStatusFlags(QDC_Type *base, uint32_t mask) -{ - uint32_t tmp16 = 0U; - - /* QDC_CTRL. */ - if (0U != ((uint32_t)kQDC_HOMETransitionFlag & mask)) - { - tmp16 |= QDC_CTRL_HIRQ_MASK; - } - if (0U != ((uint32_t)kQDC_INDEXPulseFlag & mask)) - { - tmp16 |= QDC_CTRL_XIRQ_MASK; - } - if (0U != ((uint32_t)kQDC_WatchdogTimeoutFlag & mask)) - { - tmp16 |= QDC_CTRL_DIRQ_MASK; - } - if (0U != ((uint32_t)kQDC_PositionCompareFlag & mask)) - { - tmp16 |= QDC_CTRL_CMPIRQ_MASK; - } - if (0U != tmp16) - { - base->CTRL = (uint16_t)(((uint32_t)base->CTRL & (~QDC_CTRL_W1C_FLAGS)) | tmp16); - } - - /* QDC_CTRL2. */ - tmp16 = 0U; -#if !(defined(FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) && FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) - if (0U != ((uint32_t)kQDC_SimultBothPhaseChangeFlag & mask)) - { - tmp16 |= QDC_CTRL2_SABIRQ_MASK; - } -#endif - if (0U != ((uint32_t)kQDC_PositionRollOverFlag & mask)) - { - tmp16 |= QDC_CTRL2_ROIRQ_MASK; - } - if (0U != ((uint32_t)kQDC_PositionRollUnderFlag & mask)) - { - tmp16 |= QDC_CTRL2_RUIRQ_MASK; - } - if (0U != tmp16) - { - base->CTRL2 = (uint16_t)(((uint32_t)base->CTRL2 & (~QDC_CTRL2_W1C_FLAGS)) | tmp16); - } -} - -/*! - * brief Enable the interrupts. - * - * param base QDC peripheral base address. - * param mask Mask value of interrupts to be enabled. For available mask, see to "_qdc_interrupt_enable". - */ -void QDC_EnableInterrupts(QDC_Type *base, uint32_t mask) -{ - uint32_t tmp16 = 0U; - - /* QDC_CTRL. */ - if (0U != ((uint32_t)kQDC_HOMETransitionInterruptEnable & mask)) - { - tmp16 |= QDC_CTRL_HIE_MASK; - } - if (0U != ((uint32_t)kQDC_INDEXPulseInterruptEnable & mask)) - { - tmp16 |= QDC_CTRL_XIE_MASK; - } - if (0U != ((uint32_t)kQDC_WatchdogTimeoutInterruptEnable & mask)) - { - tmp16 |= QDC_CTRL_DIE_MASK; - } - if (0U != ((uint32_t)kQDC_PositionCompareInerruptEnable & mask)) - { - tmp16 |= QDC_CTRL_CMPIE_MASK; - } - if (tmp16 != 0U) - { - base->CTRL = (uint16_t)(((uint32_t)base->CTRL & (~QDC_CTRL_W1C_FLAGS)) | tmp16); - } - /* QDC_CTRL2. */ - tmp16 = 0U; -#if !(defined(FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) && FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) - if (0U != ((uint32_t)kQDC_SimultBothPhaseChangeInterruptEnable & mask)) - { - tmp16 |= QDC_CTRL2_SABIE_MASK; - } -#endif - if (0U != ((uint32_t)kQDC_PositionRollOverInterruptEnable & mask)) - { - tmp16 |= QDC_CTRL2_ROIE_MASK; - } - if (0U != ((uint32_t)kQDC_PositionRollUnderInterruptEnable & mask)) - { - tmp16 |= QDC_CTRL2_RUIE_MASK; - } - if (tmp16 != 0U) - { - base->CTRL2 = (uint16_t)(((uint32_t)base->CTRL2 & (~QDC_CTRL2_W1C_FLAGS)) | tmp16); - } -} - -/*! - * brief Disable the interrupts. - * - * param base QDC peripheral base address. - * param mask Mask value of interrupts to be disabled. For available mask, see to "_qdc_interrupt_enable". - */ -void QDC_DisableInterrupts(QDC_Type *base, uint32_t mask) -{ - uint16_t tmp16 = 0U; - - /* QDC_CTRL. */ - if (0U != ((uint32_t)kQDC_HOMETransitionInterruptEnable & mask)) - { - tmp16 |= QDC_CTRL_HIE_MASK; - } - if (0U != ((uint32_t)kQDC_INDEXPulseInterruptEnable & mask)) - { - tmp16 |= QDC_CTRL_XIE_MASK; - } - if (0U != ((uint32_t)kQDC_WatchdogTimeoutInterruptEnable & mask)) - { - tmp16 |= QDC_CTRL_DIE_MASK; - } - if (0U != ((uint32_t)kQDC_PositionCompareInerruptEnable & mask)) - { - tmp16 |= QDC_CTRL_CMPIE_MASK; - } - if (0U != tmp16) - { - base->CTRL = (uint16_t)(base->CTRL & (uint16_t)(~QDC_CTRL_W1C_FLAGS)) & (uint16_t)(~tmp16); - } - /* QDC_CTRL2. */ - tmp16 = 0U; -#if !(defined(FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) && FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) - if (0U != ((uint32_t)kQDC_SimultBothPhaseChangeInterruptEnable & mask)) - { - tmp16 |= QDC_CTRL2_SABIE_MASK; - } -#endif - if (0U != ((uint32_t)kQDC_PositionRollOverInterruptEnable & mask)) - { - tmp16 |= QDC_CTRL2_ROIE_MASK; - } - if (0U != ((uint32_t)kQDC_PositionRollUnderInterruptEnable & mask)) - { - tmp16 |= QDC_CTRL2_RUIE_MASK; - } - if (tmp16 != 0U) - { - base->CTRL2 = (uint16_t)(base->CTRL2 & (uint16_t)(~QDC_CTRL2_W1C_FLAGS)) & (uint16_t)(~tmp16); - } -} - -/*! - * brief Get the enabled interrupts' flags. - * - * param base QDC peripheral base address. - * - * return Mask value of enabled interrupts. - */ -uint32_t QDC_GetEnabledInterrupts(QDC_Type *base) -{ - uint32_t ret32 = 0U; - - /* QDC_CTRL. */ - if (0U != (QDC_CTRL_HIE_MASK & base->CTRL)) - { - ret32 |= (uint32_t)kQDC_HOMETransitionInterruptEnable; - } - if (0U != (QDC_CTRL_XIE_MASK & base->CTRL)) - { - ret32 |= (uint32_t)kQDC_INDEXPulseInterruptEnable; - } - if (0U != (QDC_CTRL_DIE_MASK & base->CTRL)) - { - ret32 |= (uint32_t)kQDC_WatchdogTimeoutInterruptEnable; - } - if (0U != (QDC_CTRL_CMPIE_MASK & base->CTRL)) - { - ret32 |= (uint32_t)kQDC_PositionCompareInerruptEnable; - } - /* QDC_CTRL2. */ -#if !(defined(FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) && FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) - if (0U != (QDC_CTRL2_SABIE_MASK & base->CTRL2)) - { - ret32 |= (uint32_t)kQDC_SimultBothPhaseChangeInterruptEnable; - } -#endif - if (0U != (QDC_CTRL2_ROIE_MASK & base->CTRL2)) - { - ret32 |= (uint32_t)kQDC_PositionRollOverInterruptEnable; - } - if (0U != (QDC_CTRL2_RUIE_MASK & base->CTRL2)) - { - ret32 |= (uint32_t)kQDC_PositionRollUnderInterruptEnable; - } - return ret32; -} - -/*! - * brief Set initial position value for QDC module. - * - * param base QDC peripheral base address - * param value Positive initial value - */ -void QDC_SetInitialPositionValue(QDC_Type *base, uint32_t value) -{ - base->UINIT = (uint16_t)(value >> 16U); /* Set upper 16 bits. */ - base->LINIT = (uint16_t)(value); /* Set lower 16 bits. */ -} - -/*! - * brief Get the current position counter's value. - * - * param base QDC peripheral base address. - * - * return Current position counter's value. - */ -uint32_t QDC_GetPositionValue(QDC_Type *base) -{ - uint32_t ret32; - - ret32 = base->UPOS; /* Get upper 16 bits and make a snapshot. */ - ret32 <<= 16U; - ret32 |= base->LPOSH; /* Get lower 16 bits from hold register. */ - - return ret32; -} - -/*! - * brief Get the hold position counter's value. - * - * When any of the counter registers is read, the contents of each counter register is written to the corresponding hold - * register. Taking a snapshot of the counters' values provides a consistent view of a system position and a velocity to - * be attained. - * - * param base QDC peripheral base address. - * - * return Hold position counter's value. - */ -uint32_t QDC_GetHoldPositionValue(QDC_Type *base) -{ - uint32_t ret32; - - ret32 = base->UPOSH; /* Get upper 16 bits and make a snapshot. */ - ret32 <<= 16U; - ret32 |= base->LPOSH; /* Get lower 16 bits from hold register. */ - - return ret32; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_qdc.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_qdc.h deleted file mode 100644 index 5a79f3de116..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_qdc.h +++ /dev/null @@ -1,585 +0,0 @@ -/* - * Copyright 2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_QDC_H_ -#define FSL_QDC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup qdc - * @{ - */ -/******************************************************************************* - * Definitions - ******************************************************************************/ -#define FSL_QDC_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) - -/*! - * @brief Interrupt enable/disable mask. - */ -enum _qdc_interrupt_enable -{ - kQDC_HOMETransitionInterruptEnable = (1U << 0U), /*!< HOME interrupt enable. */ - kQDC_INDEXPulseInterruptEnable = (1U << 1U), /*!< INDEX pulse interrupt enable. */ - kQDC_WatchdogTimeoutInterruptEnable = (1U << 2U), /*!< Watchdog timeout interrupt enable. */ - kQDC_PositionCompareInerruptEnable = (1U << 3U), /*!< Position compare interrupt enable. */ -#if !(defined(FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) && FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) - kQDC_SimultBothPhaseChangeInterruptEnable = - (1U << 4U), /*!< Simultaneous PHASEA and PHASEB change interrupt enable. */ -#endif - kQDC_PositionRollOverInterruptEnable = (1U << 5U), /*!< Roll-over interrupt enable. */ - kQDC_PositionRollUnderInterruptEnable = (1U << 6U), /*!< Roll-under interrupt enable. */ -}; - -/*! - * @brief Status flag mask. - * - * These flags indicate the counter's events. - */ -enum _qdc_status_flags -{ - kQDC_HOMETransitionFlag = (1U << 0U), /*!< HOME signal transition interrupt request. */ - kQDC_INDEXPulseFlag = (1U << 1U), /*!< INDEX Pulse Interrupt Request. */ - kQDC_WatchdogTimeoutFlag = (1U << 2U), /*!< Watchdog timeout interrupt request. */ - kQDC_PositionCompareFlag = (1U << 3U), /*!< Position compare interrupt request. */ -#if !(defined(FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) && FSL_FEATURE_QDC_HAS_NO_CTRL2_SAB_INT) - kQDC_SimultBothPhaseChangeFlag = (1U << 4U), /*!< Simultaneous PHASEA and PHASEB change interrupt request. */ -#endif - kQDC_PositionRollOverFlag = (1U << 5U), /*!< Roll-over interrupt request. */ - kQDC_PositionRollUnderFlag = (1U << 6U), /*!< Roll-under interrupt request. */ - kQDC_LastCountDirectionFlag = (1U << 7U), /*!< Last count was in the up direction, or the down direction. */ -}; - -/*! - * @brief Signal status flag mask. - * - * These flags indicate the counter's signal. - */ -enum _qdc_signal_status_flags -{ - kQDC_RawHOMEStatusFlag = QDC_IMR_HOME_MASK, /*!< Raw HOME input. */ - kQDC_RawINDEXStatusFlag = QDC_IMR_INDEX_MASK, /*!< Raw INDEX input. */ - kQDC_RawPHBStatusFlag = QDC_IMR_PHB_MASK, /*!< Raw PHASEB input. */ - kQDC_RawPHAEXStatusFlag = QDC_IMR_PHA_MASK, /*!< Raw PHASEA input. */ - kQDC_FilteredHOMEStatusFlag = QDC_IMR_FHOM_MASK, /*!< The filtered version of HOME input. */ - kQDC_FilteredINDEXStatusFlag = QDC_IMR_FIND_MASK, /*!< The filtered version of INDEX input. */ - kQDC_FilteredPHBStatusFlag = QDC_IMR_FPHB_MASK, /*!< The filtered version of PHASEB input. */ - kQDC_FilteredPHAStatusFlag = QDC_IMR_FPHA_MASK, /*!< The filtered version of PHASEA input. */ -}; - -/*! - * @brief Define HOME signal's trigger mode. - * - * The QDC would count the trigger from HOME signal line. - */ -typedef enum _qdc_home_trigger_mode -{ - kQDC_HOMETriggerDisabled = 0U, /*!< HOME signal's trigger is disabled. */ - kQDC_HOMETriggerOnRisingEdge, /*!< Use positive going edge-to-trigger initialization of position counters. */ - kQDC_HOMETriggerOnFallingEdge, /*!< Use negative going edge-to-trigger initialization of position counters. */ -} qdc_home_trigger_mode_t; - -/*! - * @brief Define INDEX signal's trigger mode. - * - * The QDC would count the trigger from INDEX signal line. - */ -typedef enum _qdc_index_trigger_mode -{ - kQDC_INDEXTriggerDisabled = 0U, /*!< INDEX signal's trigger is disabled. */ - kQDC_INDEXTriggerOnRisingEdge, /*!< Use positive going edge-to-trigger initialization of position counters. */ - kQDC_INDEXTriggerOnFallingEdge, /*!< Use negative going edge-to-trigger initialization of position counters. */ -} qdc_index_trigger_mode_t; - -/*! - * @brief Define type for decoder work mode. - * - * The normal work mode uses the standard quadrature decoder with PHASEA and PHASEB. When in signal phase count mode, - * a positive transition of the PHASEA input generates a count signal while the PHASEB input and the reverse direction - * control the counter direction. If the reverse direction is not enabled, PHASEB = 0 means counting up and PHASEB = 1 - * means counting down. Otherwise, the direction is reversed. - */ -typedef enum _qdc_decoder_work_mode -{ - kQDC_DecoderWorkAsNormalMode = 0U, /*!< Use standard quadrature decoder with PHASEA and PHASEB. */ - kQDC_DecoderWorkAsSignalPhaseCountMode, /*!< PHASEA input generates a count signal while PHASEB input control the - direction. */ -} qdc_decoder_work_mode_t; - -/*! - * @brief Define type for the condition of POSMATCH pulses. - */ -typedef enum _qdc_position_match_mode -{ - kQDC_POSMATCHOnPositionCounterEqualToComapreValue = 0U, /*!< POSMATCH pulses when a match occurs between the - position counters (POS) and the compare value (COMP). */ - kQDC_POSMATCHOnReadingAnyPositionCounter, /*!< POSMATCH pulses when any position counter register is read. */ -} qdc_position_match_mode_t; - -/*! - * @brief Define type for determining how the revolution counter (REV) is incremented/decremented. - */ -typedef enum _qdc_revolution_count_condition -{ - kQDC_RevolutionCountOnINDEXPulse = 0U, /*!< Use INDEX pulse to increment/decrement revolution counter. */ - kQDC_RevolutionCountOnRollOverModulus, /*!< Use modulus counting roll-over/under to increment/decrement revolution - counter. */ -} qdc_revolution_count_condition_t; - -/*! - * @brief Define type for direction of self test generated signal. - */ -typedef enum _qdc_self_test_direction -{ - kQDC_SelfTestDirectionPositive = 0U, /*!< Self test generates the signal in positive direction. */ - kQDC_SelfTestDirectionNegative, /*!< Self test generates the signal in negative direction. */ -} qdc_self_test_direction_t; - -#if (defined(FSL_FEATURE_QDC_HAS_CTRL3) && FSL_FEATURE_QDC_HAS_CTRL3) -/*! - * @brief Define prescaler value for clock in CTRL3. - * - * The clock is prescaled by a value of 2^PRSC which means that the prescaler logic - * can divide the clock by a minimum of 1 and a maximum of 32,768. - */ -typedef enum _qdc_prescaler -{ - kQDC_ClockDiv1 = 0, - kQDC_ClockDiv2 = 1, - kQDC_ClockDiv4 = 2, - kQDC_ClockDiv8 = 3, - kQDC_ClockDiv16 = 4, - kQDC_ClockDiv32 = 5, - kQDC_ClockDiv64 = 6, - kQDC_ClockDiv128 = 7, - kQDC_ClockDiv256 = 8, - kQDC_ClockDiv512 = 9, - kQDC_ClockDiv1024 = 10, - kQDC_ClockDiv2048 = 11, - kQDC_ClockDiv4096 = 12, - kQDC_ClockDiv8192 = 13, - kQDC_ClockDiv16384 = 14, - kQDC_ClockDiv32768 = 15, -} qdc_prescaler_t; -#endif - -#if (defined(FSL_FEATURE_QDC_HAS_FILT_PRSC) && FSL_FEATURE_QDC_HAS_FILT_PRSC) -/*! - * @brief Define input filter prescaler value. - * - * The input filter prescaler value is to prescale the IPBus clock. - * (Frequency of FILT clock) = (Frequency of IPBus clock) / 2^FILT_PRSC. - */ -typedef enum _qdc_filter_prescaler -{ - kQDC_FilterPrescalerDiv1 = 0U, /*!< Input filter prescaler is 1. */ - kQDC_FilterPrescalerDiv2 = 1U, /*!< Input filter prescaler is 2. */ - kQDC_FilterPrescalerDiv4 = 2U, /*!< Input filter prescaler is 4. */ - kQDC_FilterPrescalerDiv8 = 3U, /*!< Input filter prescaler is 8. */ - kQDC_FilterPrescalerDiv16 = 4U, /*!< Input filter prescaler is 16. */ - kQDC_FilterPrescalerDiv32 = 5U, /*!< Input filter prescaler is 32. */ - kQDC_FilterPrescalerDiv64 = 6U, /*!< Input filter prescaler is 64. */ - kQDC_FilterPrescalerDiv128 = 7U, /*!< Input filter prescaler is 128. */ -} qdc_filter_prescaler_t; -#endif - -/*! - * @brief Define user configuration structure for QDC module. - */ -typedef struct _qdc_config -{ - /* Basic counter. */ - bool enableReverseDirection; /*!< Enable reverse direction counting. */ - qdc_decoder_work_mode_t decoderWorkMode; /*!< Enable signal phase count mode. */ - - /* Signal detection. */ - qdc_home_trigger_mode_t HOMETriggerMode; /*!< Enable HOME to initialize position counters. */ - qdc_index_trigger_mode_t INDEXTriggerMode; /*!< Enable INDEX to initialize position counters. */ - bool enableTRIGGERClearPositionCounter; /*!< Clear POSD, REV, UPOS and LPOS on rising edge of TRIGGER, or not. */ - bool enableTRIGGERClearHoldPositionCounter; /*!< Enable update of hold registers on rising edge of TRIGGER, or not. - */ - - /* Watchdog. */ - bool enableWatchdog; /*!< Enable the watchdog to detect if the target is moving or not. */ - uint16_t watchdogTimeoutValue; /*!< Watchdog timeout count value. It stores the timeout count for the quadrature - decoder module watchdog timer. This field is only available when - "enableWatchdog" = true. The available value is a 16-bit unsigned number.*/ - -#if (defined(FSL_FEATURE_QDC_HAS_FILT_PRSC) && FSL_FEATURE_QDC_HAS_FILT_PRSC) - qdc_filter_prescaler_t filterPrescaler; /*!< Input filter prescaler. */ -#endif - - /* Filter for PHASEA, PHASEB, INDEX and HOME. */ - uint16_t filterCount; /*!< Input Filter Sample Count. This value should be chosen to reduce the probability of - noisy samples causing an incorrect transition to be recognized. The value represent the - number of consecutive samples that must agree prior to the input filter accepting an - input transition. A value of 0x0 represents 3 samples. A value of 0x7 represents 10 - samples. The Available range is 0 - 7.*/ - uint16_t filterSamplePeriod; /*!< Input Filter Sample Period. This value should be set such that the sampling period - is larger than the period of the expected noise. This value represents the - sampling period (in IPBus clock cycles) of the decoder input signals. - The available range is 0 - 255. */ - - /* Position compare. */ - qdc_position_match_mode_t positionMatchMode; /*!< The condition of POSMATCH pulses. */ - uint32_t positionCompareValue; /*!< Position compare value. The available value is a 32-bit number.*/ - - /* Modulus counting. */ - qdc_revolution_count_condition_t revolutionCountCondition; /*!< Revolution Counter Modulus Enable. */ - bool enableModuloCountMode; /*!< Enable Modulo Counting. */ - uint32_t positionModulusValue; /*!< Position modulus value. This value would be available only when - "enableModuloCountMode" = true. The available value is a 32-bit number. */ - uint32_t positionInitialValue; /*!< Position initial value. The available value is a 32-bit number. */ - -#if (defined(FSL_FEATURE_QDC_HAS_CTRL3) && FSL_FEATURE_QDC_HAS_CTRL3) - /* Prescaler. */ - bool enablePeriodMeasurementFunction; /*!< Enable period measurement function. */ - qdc_prescaler_t prescalerValue; /*!< The value of prescaler. */ -#endif -} qdc_config_t; - -/*! - * @brief Define configuration structure for self test module. - * - * The self test module provides a quadrature test signal to the inputs of the quadrature decoder module. - * This is a factory test feature. It is also useful to customers' software development and testing. - */ -typedef struct _qdc_self_test_config -{ - qdc_self_test_direction_t signalDirection; /*!< Direction of self test generated signal. */ - uint16_t signalCount; /*!< Hold the number of quadrature advances to generate. The available range is 0 - 255.*/ - uint16_t signalPeriod; /*!< Hold the period of quadrature phase in IPBus clock cycles. - The available range is 0 - 31. */ -} qdc_self_test_config_t; - -#if defined(__cplusplus) -extern "C" { -#endif - -/******************************************************************************* - * API - ******************************************************************************/ - -/*! - * @name Initialization and De-initialization - * @{ - */ - -/*! - * @brief Initialization for the QDC module. - * - * This function is to make the initialization for the QDC module. It should be called firstly before any operation to - * the QDC with the operations like: - * - Enable the clock for QDC module. - * - Configure the QDC's working attributes. - * - * @param base QDC peripheral base address. - * @param config Pointer to configuration structure. See to "qdc_config_t". - */ -void QDC_Init(QDC_Type *base, const qdc_config_t *config); - -/*! - * @brief De-initialization for the QDC module. - * - * This function is to make the de-initialization for the QDC module. It could be called when QDC is no longer used with - * the operations like: - * - Disable the clock for QDC module. - * - * @param base QDC peripheral base address. - */ -void QDC_Deinit(QDC_Type *base); - -/*! - * @brief Get an available pre-defined settings for QDC's configuration. - * - * This function initializes the QDC configuration structure with an available settings, the default value are: - * @code - * config->enableReverseDirection = false; - * config->decoderWorkMode = kQDC_DecoderWorkAsNormalMode; - * config->HOMETriggerMode = kQDC_HOMETriggerDisabled; - * config->INDEXTriggerMode = kQDC_INDEXTriggerDisabled; - * config->enableTRIGGERClearPositionCounter = false; - * config->enableTRIGGERClearHoldPositionCounter = false; - * config->enableWatchdog = false; - * config->watchdogTimeoutValue = 0U; - * config->filterCount = 0U; - * config->filterSamplePeriod = 0U; - * config->positionMatchMode = kQDC_POSMATCHOnPositionCounterEqualToComapreValue; - * config->positionCompareValue = 0xFFFFFFFFU; - * config->revolutionCountCondition = kQDC_RevolutionCountOnINDEXPulse; - * config->enableModuloCountMode = false; - * config->positionModulusValue = 0U; - * config->positionInitialValue = 0U; - * config->prescalerValue = kQDC_ClockDiv1; - * config->enablePeriodMeasurementFunction = true; - * @endcode - * @param config Pointer to a variable of configuration structure. See to "qdc_config_t". - */ -void QDC_GetDefaultConfig(qdc_config_t *config); - -/*! - * @brief Load the initial position value to position counter. - * - * This function is to transfer the initial position value (UINIT and LINIT) contents to position counter (UPOS and - * LPOS), so that to provide the consistent operation the position counter registers. - * - * @param base QDC peripheral base address. - */ -void QDC_DoSoftwareLoadInitialPositionValue(QDC_Type *base); - -/*! - * @brief Enable and configure the self test function. - * - * This function is to enable and configuration the self test function. It controls and sets the frequency of a - * quadrature signal generator. It provides a quadrature test signal to the inputs of the quadrature decoder module. - * It is a factory test feature; however, it may be useful to customers' software development and testing. - * - * @param base QDC peripheral base address. - * @param config Pointer to configuration structure. See to "qdc_self_test_config_t". Pass "NULL" to disable. - */ -void QDC_SetSelfTestConfig(QDC_Type *base, const qdc_self_test_config_t *config); - -/*! - * @brief Enable watchdog for QDC module. - * - * @param base QDC peripheral base address - * @param enable Enables or disables the watchdog - */ -void QDC_EnableWatchdog(QDC_Type *base, bool enable); - -/*! - * @brief Set initial position value for QDC module. - * - * @param base QDC peripheral base address - * @param value Positive initial value - */ -void QDC_SetInitialPositionValue(QDC_Type *base, uint32_t value); - -/*! @} */ - -/*! - * @name Status - * @{ - */ -/*! - * @brief Get the status flags. - * - * @param base QDC peripheral base address. - * - * @return Mask value of status flags. For available mask, see to "_qdc_status_flags". - */ -uint32_t QDC_GetStatusFlags(QDC_Type *base); - -/*! - * @brief Clear the status flags. - * - * @param base QDC peripheral base address. - * @param mask Mask value of status flags to be cleared. For available mask, see to "_qdc_status_flags". - */ -void QDC_ClearStatusFlags(QDC_Type *base, uint32_t mask); - -/*! - * @brief Get the signals' real-time status. - * - * @param base QDC peripheral base address. - * - * @return Mask value of signals' real-time status. For available mask, see to "_qdc_signal_status_flags" - */ -static inline uint16_t QDC_GetSignalStatusFlags(QDC_Type *base) -{ - return base->IMR; -} -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enable the interrupts. - * - * @param base QDC peripheral base address. - * @param mask Mask value of interrupts to be enabled. For available mask, see to "_qdc_interrupt_enable". - */ -void QDC_EnableInterrupts(QDC_Type *base, uint32_t mask); - -/*! - * @brief Disable the interrupts. - * - * @param base QDC peripheral base address. - * @param mask Mask value of interrupts to be disabled. For available mask, see to "_qdc_interrupt_enable". - */ -void QDC_DisableInterrupts(QDC_Type *base, uint32_t mask); - -/*! - * @brief Get the enabled interrupts' flags. - * - * @param base QDC peripheral base address. - * - * @return Mask value of enabled interrupts. - */ -uint32_t QDC_GetEnabledInterrupts(QDC_Type *base); - -/*! @} */ - -/*! - * @name Value Operation - * @{ - */ - -/*! - * @brief Get the current position counter's value. - * - * @param base QDC peripheral base address. - * - * @return Current position counter's value. - */ -uint32_t QDC_GetPositionValue(QDC_Type *base); - -/*! - * @brief Get the hold position counter's value. - * - * When any of the counter registers is read, the contents of each counter register is written to the corresponding hold - * register. Taking a snapshot of the counters' values provides a consistent view of a system position and a velocity to - * be attained. - * - * @param base QDC peripheral base address. - * - * @return Hold position counter's value. - */ -uint32_t QDC_GetHoldPositionValue(QDC_Type *base); - -/*! - * @brief Get the position difference counter's value. - * - * @param base QDC peripheral base address. - * - * @return The position difference counter's value. - */ -static inline uint16_t QDC_GetPositionDifferenceValue(QDC_Type *base) -{ - return base->POSD; -} - -/*! - * @brief Get the hold position difference counter's value. - * - * When any of the counter registers is read, the contents of each counter register is written to the corresponding hold - * register. Taking a snapshot of the counters' values provides a consistent view of a system position and a velocity to - * be attained. - * - * @param base QDC peripheral base address. - * - * @return Hold position difference counter's value. - */ -static inline uint16_t QDC_GetHoldPositionDifferenceValue(QDC_Type *base) -{ - return base->POSDH; -} - -/*! - * @brief Get the position revolution counter's value. - * - * @param base QDC peripheral base address. - * - * @return The position revolution counter's value. - */ -static inline uint16_t QDC_GetRevolutionValue(QDC_Type *base) -{ - return base->REV; -} - -/*! - * @brief Get the hold position revolution counter's value. - * - * When any of the counter registers is read, the contents of each counter register is written to the corresponding hold - * register. Taking a snapshot of the counters' values provides a consistent view of a system position and a velocity to - * be attained. - * - * @param base QDC peripheral base address. - * - * @return Hold position revolution counter's value. - */ -static inline uint16_t QDC_GetHoldRevolutionValue(QDC_Type *base) -{ - return base->REVH; -} - -#if (defined(FSL_FEATURE_QDC_HAS_LASTEDGE) && FSL_FEATURE_QDC_HAS_LASTEDGE) -/*! - * @brief Get the last edge time value. - * - * @param base QDC peripheral base address. - * - * @return The last edge time hold value. - */ -static inline uint16_t QDC_GetLastEdgeTimeValue(QDC_Type *base) -{ - return base->LASTEDGE; -} - -/*! - * @brief Get the last edge time hold value. - * - * @param base QDC peripheral base address. - * - * @return The last edge time hold value. - */ -static inline uint16_t QDC_GetHoldLastEdgeTimeValue(QDC_Type *base) -{ - return base->LASTEDGEH; -} -#endif - -#if (defined(FSL_FEATURE_QDC_HAS_POSDPER) && FSL_FEATURE_QDC_HAS_POSDPER) -/*! - * @brief Get the position difference period value. - * - * @param base QDC peripheral base address. - * - * @return The position difference period hold value. - */ -static inline uint16_t QDC_GetPositionDifferencePeriodValue(QDC_Type *base) -{ - return base->POSDPER; -} - -/*! - * @brief Get the position difference period buffer value. - * - * @param base QDC peripheral base address. - * - * @return The position difference period hold value. - */ -static inline uint16_t QDC_GetPositionDifferencePeriodBufferValue(QDC_Type *base) -{ - return base->POSDPERBFR; -} - -/*! - * @brief Get the position difference period hold value. - * - * @param base QDC peripheral base address. - * - * @return The position difference period hold value. - */ -static inline uint16_t QDC_GetHoldPositionDifferencePeriodValue(QDC_Type *base) -{ - return base->POSDPERH; -} -#endif -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @} */ - -#endif /* FSL_QDC_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_reset.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_reset.c deleted file mode 100644 index 58c05995054..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_reset.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright 2022, NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_common.h" -#include "fsl_reset.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.reset" -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -#if (defined(FSL_FEATURE_SOC_SYSCON_COUNT) && (FSL_FEATURE_SOC_SYSCON_COUNT > 0)) - -/*! - * brief Assert reset to peripheral. - * - * Asserts reset signal to specified peripheral module. - * - * param peripheral Assert reset to this peripheral. The enum argument contains encoding of reset register - * and reset bit position in the reset register. - */ -void RESET_SetPeripheralReset(reset_ip_name_t peripheral) -{ - const uint32_t regIndex = ((uint32_t)peripheral & 0xFFFF0000u) >> 16; - const uint32_t bitPos = ((uint32_t)peripheral & 0x0000FFFFu); - const uint32_t bitMask = 1UL << bitPos; - volatile uint32_t *pResetCtrl; - - assert(bitPos < 32u); - - /* reset register is in SYSCON */ - /* set bit */ - SYSCON->PRESETCTRLSET[regIndex] = bitMask; - /* wait until it reads 0b1 */ - pResetCtrl = &(SYSCON->PRESETCTRL0); - while (0u == ((uint32_t)((volatile uint32_t *)pResetCtrl)[regIndex] & bitMask)) - { - } -} - -/*! - * brief Clear reset to peripheral. - * - * Clears reset signal to specified peripheral module, allows it to operate. - * - * param peripheral Clear reset to this peripheral. The enum argument contains encoding of reset register - * and reset bit position in the reset register. - */ -void RESET_ClearPeripheralReset(reset_ip_name_t peripheral) -{ - const uint32_t regIndex = ((uint32_t)peripheral & 0xFFFF0000u) >> 16; - const uint32_t bitPos = ((uint32_t)peripheral & 0x0000FFFFu); - const uint32_t bitMask = 1UL << bitPos; - volatile uint32_t *pResetCtrl; - - assert(bitPos < 32u); - - /* reset register is in SYSCON */ - - /* clear bit */ - SYSCON->PRESETCTRLCLR[regIndex] = bitMask; - /* wait until it reads 0b0 */ - pResetCtrl = &(SYSCON->PRESETCTRL0); - while (bitMask == ((uint32_t)((volatile uint32_t *)pResetCtrl)[regIndex] & bitMask)) - { - } -} - -/*! - * brief Reset peripheral module. - * - * Reset peripheral module. - * - * param peripheral Peripheral to reset. The enum argument contains encoding of reset register - * and reset bit position in the reset register. - */ -void RESET_PeripheralReset(reset_ip_name_t peripheral) -{ - RESET_SetPeripheralReset(peripheral); - RESET_ClearPeripheralReset(peripheral); -} - -#endif /* FSL_FEATURE_SOC_SYSCON_COUNT || FSL_FEATURE_SOC_ASYNC_SYSCON_COUNT */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_reset.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_reset.h deleted file mode 100644 index b2b42754dc4..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_reset.h +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Copyright 2022, NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _FSL_RESET_H_ -#define _FSL_RESET_H_ - -#include -#include -#include -#include -#include "fsl_device_registers.h" - -/*! - * @addtogroup reset - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief reset driver version 2.4.0 */ -#define FSL_RESET_DRIVER_VERSION (MAKE_VERSION(2, 4, 0)) -/*@}*/ - -/*! - * @brief Enumeration for peripheral reset control bits - * - * Defines the enumeration for peripheral reset control bits in PRESETCTRL/ASYNCPRESETCTRL registers - */ -typedef enum _SYSCON_RSTn -{ - kFMU_RST_SHIFT_RSTn = 0 | 9U, /**< Flash management unit reset control */ - kFLEXSPI_RST_SHIFT_RSTn = 0 | 11U, /**< FLEXSPI reset control */ - kMUX_RST_SHIFT_RSTn = 0 | 12U, /**< Input mux reset control */ - kPORT0_RST_SHIFT_RSTn = 0 | 13U, /**< PORT0 reset control */ - kPORT1_RST_SHIFT_RSTn = 0 | 14U, /**< PORT1 reset control */ - kPORT2_RST_SHIFT_RSTn = 0 | 15U, /**< PORT2 reset control */ - kPORT3_RST_SHIFT_RSTn = 0 | 16U, /**< PORT3 reset control */ - kPORT4_RST_SHIFT_RSTn = 0 | 17U, /**< PORT4 reset control */ - kGPIO0_RST_SHIFT_RSTn = 0 | 19U, /**< GPIO0 reset control */ - kGPIO1_RST_SHIFT_RSTn = 0 | 20U, /**< GPIO1 reset control */ - kGPIO2_RST_SHIFT_RSTn = 0 | 21U, /**< GPIO2 reset control */ - kGPIO3_RST_SHIFT_RSTn = 0 | 22U, /**< GPIO3 reset control */ - kGPIO4_RST_SHIFT_RSTn = 0 | 23U, /**< GPIO4 reset control */ - kPINT_RST_SHIFT_RSTn = 0 | 25U, /**< Pin interrupt (PINT) reset control */ - kDMA0_RST_SHIFT_RSTn = 0 | 26U, /**< DMA0 reset control */ - kCRC_RST_SHIFT_RSTn = 0 | 27U, /**< CRC reset control */ - kMAILBOX_RST_SHIFT_RSTn = 0 | 31U, /**< Mailbox reset control */ - - kMRT_RST_SHIFT_RSTn = 65536 | 0U, /**< Multi-rate timer (MRT) reset control */ - kOSTIMER_RST_SHIFT_RSTn = 65536 | 1U, /**< OSTimer reset control */ - kSCT_RST_SHIFT_RSTn = 65536 | 2U, /**< SCTimer/PWM(SCT) reset control */ - kADC0_RST_SHIFT_RSTn = 65536 | 3U, /**< ADC0 reset control */ - kADC1_RST_SHIFT_RSTn = 65536 | 4U, /**< ADC1 reset control */ - kDAC0_RST_SHIFT_RSTn = 65536 | 5U, /**< DAC0 reset control */ - kEVSIM0_RST_SHIFT_RSTn = 65536 | 8U, /**< EVSIM0 reset control */ - kEVSIM1_RST_SHIFT_RSTn = 65536 | 9U, /**< EVSIM1 reset control */ - kUTICK_RST_SHIFT_RSTn = 65536 | 10U, /**< Micro-tick timer reset control */ - kFC0_RST_SHIFT_RSTn = 65536 | 11U, /**< Flexcomm Interface 0 reset control */ - kFC1_RST_SHIFT_RSTn = 65536 | 12U, /**< Flexcomm Interface 1 reset control */ - kFC2_RST_SHIFT_RSTn = 65536 | 13U, /**< Flexcomm Interface 2 reset control */ - kFC3_RST_SHIFT_RSTn = 65536 | 14U, /**< Flexcomm Interface 3 reset control */ - kFC4_RST_SHIFT_RSTn = 65536 | 15U, /**< Flexcomm Interface 4 reset control */ - kFC5_RST_SHIFT_RSTn = 65536 | 16U, /**< Flexcomm Interface 5 reset control */ - kFC6_RST_SHIFT_RSTn = 65536 | 17U, /**< Flexcomm Interface 6 reset control */ - kFC7_RST_SHIFT_RSTn = 65536 | 18U, /**< Flexcomm Interface 7 reset control */ - kFC8_RST_SHIFT_RSTn = 65536 | 19U, /**< Flexcomm Interface 8 reset control */ - kFC9_RST_SHIFT_RSTn = 65536 | 20U, /**< MICFIL reset control */ - kMICFIL_RST_SHIFT_RSTn = 65536 | 21U, /**< Flexcomm Interface 7 reset control */ - kCTIMER2_RST_SHIFT_RSTn = 65536 | 22U, /**< CTimer 2 reset control */ - kUSB0_RAM_RST_SHIFT_RSTn = 65536 | 23U, /**< USB0 RAM reset control */ - kUSB0_FS_DCD_RST_SHIFT_RSTn = 65536 | 24U, /**< USB0-FS DCD reset control */ - kUSB0_FS_RST_SHIFT_RSTn = 65536 | 25U, /**< USB0-FS reset control */ - kCTIMER0_RST_SHIFT_RSTn = 65536 | 26U, /**< CTimer 0 reset control */ - kCTIMER1_RST_SHIFT_RSTn = 65536 | 27U, /**< CTimer 1 reset control */ - kSMART_DMA_RST_SHIFT_RSTn = 65536 | 31U, /**< SmartDMA reset control */ - - kDMA1_RST_SHIFT_RSTn = 131072 | 1U, /**< DMA1 reset control */ - kENET_RST_SHIFT_RSTn = 131072 | 2U, /**< Ethernet reset control */ - kUSDHC_RST_SHIFT_RSTn = 131072 | 3U, /**< uSDHC reset control */ - kFLEXIO_RST_SHIFT_RSTn = 131072 | 4U, /**< FLEXIO reset control */ - kSAI0_RST_SHIFT_RSTn = 131072 | 5U, /**< SAI0 reset control */ - kSAI1_RST_SHIFT_RSTn = 131072 | 6U, /**< SAI1 reset control */ - kTRO_RST_SHIFT_RSTn = 131072 | 7U, /**< TRO reset control */ - kFREQME_RST_SHIFT_RSTn = 131072 | 8U, /**< FREQME reset control */ - kTRNG_RST_SHIFT_RSTn = 131072 | 13U, /**< TRNG reset control */ - kFLEXCAN0_RST_SHIFT_RSTn = 131072 | 14U, /**< Flexcan0 reset control */ - kFLEXCAN1_RST_SHIFT_RSTn = 131072 | 15U, /**< Flexcan1 reset control */ - kUSB_HS_RST_SHIFT_RSTn = 131072 | 16U, /**< USB HS reset control */ - kUSB_HS_PHY_RST_SHIFT_RSTn = 131072 | 17U, /**< USB HS PHY reset control */ - kPOWERQUAD_RST_SHIFT_RSTn = 131072 | 19U, /**< PowerQuad reset control */ - kPLU_RST_SHIFT_RSTn = 131072 | 20U, /**< PLU reset control */ - kCTIMER3_RST_SHIFT_RSTn = 131072 | 21U, /**< CTimer 3 reset control */ - kCTIMER4_RST_SHIFT_RSTn = 131072 | 22U, /**< CTimer 4 reset control */ - kPUF_RST_SHIFT_RSTn = 131072 | 23U, /**< PUF reset control */ - kPKC_RST_SHIFT_RSTn = 131072 | 24U, /**< PKC reset control */ - kSM3_RST_SHIFT_RSTn = 131072 | 30U, /**< SM3 reset control */ - - kI3C0_RST_SHIFT_RSTn = 196608 | 0U, /**< I3C0 reset control */ - kI3C1_RST_SHIFT_RSTn = 196608 | 1U, /**< I3C1 reset control */ - kSINC_RST_SHIFT_RSTn = 196608 | 2U, /**< SINC reset control */ - kCOOLFLUX_RST_SHIFT_RSTn = 196608 | 3U, /**< CoolFlux reset control */ - kQDC0_RST_SHIFT_RSTn = 196608 | 4U, /**< QDC0 reset control */ - kQDC1_RST_SHIFT_RSTn = 196608 | 5U, /**< QDC1 reset control */ - kPWM0_RST_SHIFT_RSTn = 196608 | 6U, /**< PWM0 reset control */ - kPWM1_RST_SHIFT_RSTn = 196608 | 7U, /**< PWM1 reset control */ - kAOI0_RST_SHIFT_RSTn = 196608 | 8U, /**< AOI0 reset control */ - kDAC1_RST_SHIFT_RSTn = 196608 | 11U, /**< DAC1 reset control */ - kDAC2_RST_SHIFT_RSTn = 196608 | 12U, /**< DAC2 reset control */ - kOPAMP0_RST_SHIFT_RSTn = 196608 | 13U, /**< OPAMP0 reset control */ - kOPAMP1_RST_SHIFT_RSTn = 196608 | 14U, /**< OPAMP1 reset control */ - kOPAMP2_RST_SHIFT_RSTn = 196608 | 15U, /**< OPAMP2 reset control */ - kCMP2_RST_SHIFT_RSTn = 196608 | 18U, /**< CMP2 reset control */ - kVREF_RST_SHIFT_RSTn = 196608 | 19U, /**< VREF reset control */ - kCOOLFLUX_APB_RST_SHIFT_RSTn = 196608 | 20U, /**< CoolFlux APB reset control */ - kNEUTRON_RST_SHIFT_RSTn = 196608 | 21U, /**< Neutron mini reset control */ - kTSI_RST_SHIFT_RSTn = 196608 | 22U, /**< TSI reset control */ - kEWM_RST_SHIFT_RSTn = 196608 | 23U, /**< EWM reset control */ - kEIM_RST_SHIFT_RSTn = 196608 | 24U, /**< EIM reset control */ - kSEMA42_RST_SHIFT_RSTn = 196608 | 27U, /**< Semaphore reset control */ -} SYSCON_RSTn_t; - -/** Array initializers with peripheral reset bits **/ -#define ADC_RSTS \ - { \ - kADC0_RST_SHIFT_RSTn, kADC1_RST_SHIFT_RSTn \ - } /* Reset bits for ADC peripheral */ -#define CRC_RSTS \ - { \ - kCRC_RST_SHIFT_RSTn \ - } /* Reset bits for CRC peripheral */ -#define CTIMER_RSTS \ - { \ - kCTIMER0_RST_SHIFT_RSTn, kCTIMER1_RST_SHIFT_RSTn, kCTIMER2_RST_SHIFT_RSTn, kCTIMER3_RST_SHIFT_RSTn, \ - kCTIMER4_RST_SHIFT_RSTn \ - } /* Reset bits for CTIMER peripheral */ -#define DMA_RSTS_N \ - { \ - kDMA0_RST_SHIFT_RSTn, kDMA1_RST_SHIFT_RSTn \ - } /* Reset bits for DMA peripheral */ - -#define LP_FLEXCOMM_RSTS \ - { \ - kFC0_RST_SHIFT_RSTn, kFC1_RST_SHIFT_RSTn, kFC2_RST_SHIFT_RSTn, kFC3_RST_SHIFT_RSTn, kFC4_RST_SHIFT_RSTn, \ - kFC5_RST_SHIFT_RSTn, kFC6_RST_SHIFT_RSTn, kFC7_RST_SHIFT_RSTn, kFC8_RST_SHIFT_RSTn, kFC9_RST_SHIFT_RSTn \ - } /* Reset bits for FLEXCOMM peripheral */ -#define GPIO_RSTS_N \ - { \ - kGPIO0_RST_SHIFT_RSTn, kGPIO1_RST_SHIFT_RSTn, kGPIO2_RST_SHIFT_RSTn, kGPIO3_RST_SHIFT_RSTn, \ - kGPIO4_RST_SHIFT_RSTn \ - } /* Reset bits for GPIO peripheral */ -#define INPUTMUX_RSTS \ - { \ - kMUX_RST_SHIFT_RSTn \ - } /* Reset bits for INPUTMUX peripheral */ -#define FLASH_RSTS \ - { \ - kFMC_RST_SHIFT_RSTn \ - } /* Reset bits for Flash peripheral */ -#define MRT_RSTS \ - { \ - kMRT_RST_SHIFT_RSTn \ - } /* Reset bits for MRT peripheral */ -#define PINT_RSTS \ - { \ - kPINT_RST_SHIFT_RSTn \ - } /* Reset bits for PINT peripheral */ -#define TRNG_RSTS \ - { \ - kTRNG_RST_SHIFT_RSTn \ - } /* Reset bits for TRNG peripheral */ -#define SCT_RSTS \ - { \ - kSCT_RST_SHIFT_RSTn \ - } /* Reset bits for SCT peripheral */ -#define UTICK_RSTS \ - { \ - kUTICK_RST_SHIFT_RSTn \ - } /* Reset bits for UTICK peripheral */ -#define PLU_RSTS_N \ - { \ - kPLU_RST_SHIFT_RSTn \ - } /* Reset bits for PLU peripheral */ -#define OSTIMER_RSTS \ - { \ - kOSTIMER_RST_SHIFT_RSTn \ - } /* Reset bits for OSTIMER peripheral */ -#define POWERQUAD_RSTS \ - { \ - kPOWERQUAD_RST_SHIFT_RSTn \ - } /* Reset bits for Powerquad peripheral */ -#define I3C_RSTS \ - { \ - kI3C0_RST_SHIFT_RSTn, kI3C1_RST_SHIFT_RSTn \ - } /* Reset bits for I3C peripheral */ -typedef SYSCON_RSTn_t reset_ip_name_t; - -/******************************************************************************* - * API - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @brief Assert reset to peripheral. - * - * Asserts reset signal to specified peripheral module. - * - * @param peripheral Assert reset to this peripheral. The enum argument contains encoding of reset register - * and reset bit position in the reset register. - */ -void RESET_SetPeripheralReset(reset_ip_name_t peripheral); - -/*! - * @brief Clear reset to peripheral. - * - * Clears reset signal to specified peripheral module, allows it to operate. - * - * @param peripheral Clear reset to this peripheral. The enum argument contains encoding of reset register - * and reset bit position in the reset register. - */ -void RESET_ClearPeripheralReset(reset_ip_name_t peripheral); - -/*! - * @brief Reset peripheral module. - * - * Reset peripheral module. - * - * @param peripheral Peripheral to reset. The enum argument contains encoding of reset register - * and reset bit position in the reset register. - */ -void RESET_PeripheralReset(reset_ip_name_t peripheral); - -/*! - * @brief Release peripheral module. - * - * Release peripheral module. - * - * @param peripheral Peripheral to release. The enum argument contains encoding of reset register - * and reset bit position in the reset register. - */ -static inline void RESET_ReleasePeripheralReset(reset_ip_name_t peripheral) -{ - RESET_ClearPeripheralReset(peripheral); -} - -#if defined(__cplusplus) -} -#endif - -/*! @} */ - -#endif /* _FSL_RESET_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_sai.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_sai.c deleted file mode 100644 index 6d69f5efb2a..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_sai.c +++ /dev/null @@ -1,3140 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_sai.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.sai" -#endif - -/******************************************************************************* - * Definitations - ******************************************************************************/ -/*! @brief _sai_transfer_state sai transfer state.*/ -enum -{ - kSAI_Busy = 0x0U, /*!< SAI is busy */ - kSAI_Idle, /*!< Transfer is done. */ - kSAI_Error /*!< Transfer error occurred. */ -}; - -/*! @brief Typedef for sai tx interrupt handler. */ -typedef void (*sai_tx_isr_t)(I2S_Type *base, sai_handle_t *saiHandle); - -/*! @brief Typedef for sai rx interrupt handler. */ -typedef void (*sai_rx_isr_t)(I2S_Type *base, sai_handle_t *saiHandle); - -/*! @brief check flag avalibility */ -#define IS_SAI_FLAG_SET(reg, flag) (((reg) & ((uint32_t)flag)) != 0UL) - -#if defined(SAI_RSTS) -#define SAI_RESETS_ARRAY SAI_RSTS -#endif -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief sai get rx enabled interrupt status. - * - * - * @param base SAI base pointer. - * @param enableFlag enable flag to check. - * @param statusFlag status flag to check. - */ -static bool SAI_RxGetEnabledInterruptStatus(I2S_Type *base, uint32_t enableFlag, uint32_t statusFlag); - -/*! - * @brief sai get tx enabled interrupt status. - * - * - * @param base SAI base pointer. - * @param enableFlag enable flag to check. - * @param statusFlag status flag to check. - */ -static bool SAI_TxGetEnabledInterruptStatus(I2S_Type *base, uint32_t enableFlag, uint32_t statusFlag); - -/*! - * @brief Set the master clock divider. - * - * This API will compute the master clock divider according to master clock frequency and master - * clock source clock source frequency. - * - * @param base SAI base pointer. - * @param mclk_Hz Mater clock frequency in Hz. - * @param mclkSrcClock_Hz Master clock source frequency in Hz. - */ -static bool SAI_TxGetEnabledInterruptStatus(I2S_Type *base, uint32_t enableFlag, uint32_t statusFlag); - -#if ((defined(FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) && (FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER)) || \ - (defined(FSL_FEATURE_SAI_HAS_MCR_MCLK_POST_DIV) && (FSL_FEATURE_SAI_HAS_MCR_MCLK_POST_DIV))) - -/*! - * @brief Set the master clock divider. - * - * This API will compute the master clock divider according to master clock frequency and master - * clock source clock source frequency. - * - * @param base SAI base pointer. - * @param mclk_Hz Mater clock frequency in Hz. - * @param mclkSrcClock_Hz Master clock source frequency in Hz. - */ -static void SAI_SetMasterClockDivider(I2S_Type *base, uint32_t mclk_Hz, uint32_t mclkSrcClock_Hz); -#endif /* FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER */ - -/*! - * @brief Get the instance number for SAI. - * - * @param base SAI base pointer. - */ -static uint32_t SAI_GetInstance(I2S_Type *base); - -/*! - * @brief sends a piece of data in non-blocking way. - * - * @param base SAI base pointer - * @param channel start channel number. - * @param channelMask enabled channels mask. - * @param endChannel end channel numbers. - * @param bitWidth How many bits in a audio word, usually 8/16/24/32 bits. - * @param buffer Pointer to the data to be written. - * @param size Bytes to be written. - */ -static void SAI_WriteNonBlocking(I2S_Type *base, - uint32_t channel, - uint32_t channelMask, - uint32_t endChannel, - uint8_t bitWidth, - uint8_t *buffer, - uint32_t size); - -/*! - * @brief Receive a piece of data in non-blocking way. - * - * @param base SAI base pointer - * @param channel start channel number. - * @param channelMask enabled channels mask. - * @param endChannel end channel numbers. - * @param bitWidth How many bits in a audio word, usually 8/16/24/32 bits. - * @param buffer Pointer to the data to be read. - * @param size Bytes to be read. - */ -static void SAI_ReadNonBlocking(I2S_Type *base, - uint32_t channel, - uint32_t channelMask, - uint32_t endChannel, - uint8_t bitWidth, - uint8_t *buffer, - uint32_t size); - -/*! - * @brief Get classic I2S mode configurations. - * - * @param config transceiver configurations - * @param bitWidth audio data bitWidth. - * @param mode audio data channel - * @param saiChannelMask channel mask value to enable - */ -static void SAI_GetCommonConfig(sai_transceiver_t *config, - sai_word_width_t bitWidth, - sai_mono_stereo_t mode, - uint32_t saiChannelMask); -/******************************************************************************* - * Variables - ******************************************************************************/ -/* Base pointer array */ -static I2S_Type *const s_saiBases[] = I2S_BASE_PTRS; -#if defined(SAI_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_saiReset[] = SAI_RESETS_ARRAY; -#endif -/*!@brief SAI handle pointer */ -static sai_handle_t *s_saiHandle[ARRAY_SIZE(s_saiBases)][2]; -/* IRQ number array */ -static const IRQn_Type s_saiTxIRQ[] = I2S_TX_IRQS; -static const IRQn_Type s_saiRxIRQ[] = I2S_RX_IRQS; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/* Clock name array */ -static const clock_ip_name_t s_saiClock[] = SAI_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -/*! @brief Pointer to tx IRQ handler for each instance. */ -static sai_tx_isr_t s_saiTxIsr; -/*! @brief Pointer to tx IRQ handler for each instance. */ -static sai_rx_isr_t s_saiRxIsr; - -/******************************************************************************* - * Code - ******************************************************************************/ -static bool SAI_RxGetEnabledInterruptStatus(I2S_Type *base, uint32_t enableFlag, uint32_t statusFlag) -{ - uint32_t rcsr = base->RCSR; - - return IS_SAI_FLAG_SET(rcsr, enableFlag) && IS_SAI_FLAG_SET(rcsr, statusFlag); -} - -static bool SAI_TxGetEnabledInterruptStatus(I2S_Type *base, uint32_t enableFlag, uint32_t statusFlag) -{ - uint32_t tcsr = base->TCSR; - - return IS_SAI_FLAG_SET(tcsr, enableFlag) && IS_SAI_FLAG_SET(tcsr, statusFlag); -} - -#if ((defined(FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) && (FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER)) || \ - (defined(FSL_FEATURE_SAI_HAS_MCR_MCLK_POST_DIV) && (FSL_FEATURE_SAI_HAS_MCR_MCLK_POST_DIV))) -static void SAI_SetMasterClockDivider(I2S_Type *base, uint32_t mclk_Hz, uint32_t mclkSrcClock_Hz) -{ - assert(mclk_Hz <= mclkSrcClock_Hz); - - uint32_t sourceFreq = mclkSrcClock_Hz / 100U; /*In order to prevent overflow */ - uint32_t targetFreq = mclk_Hz / 100U; /*In order to prevent overflow */ - -#if FSL_FEATURE_SAI_HAS_MCR_MCLK_POST_DIV - uint32_t postDivider = sourceFreq / targetFreq; - - /* if source equal to target, then disable divider */ - if (postDivider == 1U) - { - base->MCR &= ~I2S_MCR_DIVEN_MASK; - } - else - { - base->MCR = (base->MCR & (~I2S_MCR_DIV_MASK)) | I2S_MCR_DIV(postDivider / 2U - 1U) | I2S_MCR_DIVEN_MASK; - } -#endif -#if FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER - uint16_t fract, divide; - uint32_t remaind = 0; - uint32_t current_remainder = 0xFFFFFFFFU; - uint16_t current_fract = 0; - uint16_t current_divide = 0; - uint32_t mul_freq = 0; - uint32_t max_fract = 256; - - /* Compute the max fract number */ - max_fract = targetFreq * 4096U / sourceFreq + 1U; - if (max_fract > 256U) - { - max_fract = 256U; - } - - /* Looking for the closet frequency */ - for (fract = 1; fract < max_fract; fract++) - { - mul_freq = sourceFreq * fract; - remaind = mul_freq % targetFreq; - divide = (uint16_t)(mul_freq / targetFreq); - - /* Find the exactly frequency */ - if (remaind == 0U) - { - current_fract = fract; - current_divide = (uint16_t)(mul_freq / targetFreq); - break; - } - - /* Closer to next one, set the closest to next data */ - if (remaind > mclk_Hz / 2U) - { - remaind = targetFreq - remaind; - divide += 1U; - } - - /* Update the closest div and fract */ - if (remaind < current_remainder) - { - current_fract = fract; - current_divide = divide; - current_remainder = remaind; - } - } - - /* Fill the computed fract and divider to registers */ - base->MDR = I2S_MDR_DIVIDE(current_divide - 1UL) | I2S_MDR_FRACT(current_fract - 1UL); - - /* Waiting for the divider updated */ - while ((base->MCR & I2S_MCR_DUF_MASK) != 0UL) - { - } -#endif -} -#endif /* FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER */ - -static uint32_t SAI_GetInstance(I2S_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_saiBases); instance++) - { - if (s_saiBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_saiBases)); - - return instance; -} - -static void SAI_WriteNonBlocking(I2S_Type *base, - uint32_t channel, - uint32_t channelMask, - uint32_t endChannel, - uint8_t bitWidth, - uint8_t *buffer, - uint32_t size) -{ - uint32_t i = 0, j = 0U; - uint8_t m = 0; - uint8_t bytesPerWord = bitWidth / 8U; - uint32_t data = 0; - uint32_t temp = 0; - - for (i = 0; i < size / bytesPerWord; i++) - { - for (j = channel; j <= endChannel; j++) - { - if (IS_SAI_FLAG_SET((1UL << j), channelMask)) - { - for (m = 0; m < bytesPerWord; m++) - { - temp = (uint32_t)(*buffer); - data |= (temp << (8U * m)); - buffer++; - } - base->TDR[j] = data; - data = 0; - } - } - } -} - -static void SAI_ReadNonBlocking(I2S_Type *base, - uint32_t channel, - uint32_t channelMask, - uint32_t endChannel, - uint8_t bitWidth, - uint8_t *buffer, - uint32_t size) -{ - uint32_t i = 0, j = 0; - uint8_t m = 0; - uint8_t bytesPerWord = bitWidth / 8U; - uint32_t data = 0; - - for (i = 0; i < size / bytesPerWord; i++) - { - for (j = channel; j <= endChannel; j++) - { - if (IS_SAI_FLAG_SET((1UL << j), channelMask)) - { - data = base->RDR[j]; - for (m = 0; m < bytesPerWord; m++) - { - *buffer = (uint8_t)(data >> (8U * m)) & 0xFFU; - buffer++; - } - } - } - } -} - -static void SAI_GetCommonConfig(sai_transceiver_t *config, - sai_word_width_t bitWidth, - sai_mono_stereo_t mode, - uint32_t saiChannelMask) -{ - assert(NULL != config); - assert(saiChannelMask != 0U); - - (void)memset(config, 0, sizeof(sai_transceiver_t)); - - config->channelMask = (uint8_t)saiChannelMask; - /* sync mode default configurations */ - config->syncMode = kSAI_ModeAsync; - - /* master mode default */ - config->masterSlave = kSAI_Master; - - /* bit default configurations */ - config->bitClock.bclkSrcSwap = false; - config->bitClock.bclkInputDelay = false; - config->bitClock.bclkPolarity = kSAI_SampleOnRisingEdge; - config->bitClock.bclkSource = kSAI_BclkSourceMclkDiv; - - /* frame sync default configurations */ - config->frameSync.frameSyncWidth = (uint8_t)bitWidth; - config->frameSync.frameSyncEarly = true; -#if defined(FSL_FEATURE_SAI_HAS_ON_DEMAND_MODE) && FSL_FEATURE_SAI_HAS_ON_DEMAND_MODE - config->frameSync.frameSyncGenerateOnDemand = false; -#endif - config->frameSync.frameSyncPolarity = kSAI_PolarityActiveLow; - - /* serial data default configurations */ -#if defined(FSL_FEATURE_SAI_HAS_CHANNEL_MODE) && FSL_FEATURE_SAI_HAS_CHANNEL_MODE - config->serialData.dataMode = kSAI_DataPinStateOutputZero; -#endif - config->serialData.dataOrder = kSAI_DataMSB; - config->serialData.dataWord0Length = (uint8_t)bitWidth; - config->serialData.dataWordLength = (uint8_t)bitWidth; - config->serialData.dataWordNLength = (uint8_t)bitWidth; - config->serialData.dataFirstBitShifted = (uint8_t)bitWidth; - config->serialData.dataWordNum = 2U; - config->serialData.dataMaskedWord = (uint32_t)mode; - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) && FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR - config->fifo.fifoContinueOneError = true; -#endif -} - -/*! - * brief Initializes the SAI peripheral. - * - * This API gates the SAI clock. The SAI module can't operate unless SAI_Init is called to enable the clock. - * - * param base SAI base pointer - */ -void SAI_Init(I2S_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the SAI clock */ - (void)CLOCK_EnableClock(s_saiClock[SAI_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(SAI_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_saiReset[SAI_GetInstance(base)]); -#endif - -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - /* disable interrupt and DMA request*/ - base->TCSR &= - ~(I2S_TCSR_FRIE_MASK | I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK | I2S_TCSR_FRDE_MASK | I2S_TCSR_FWDE_MASK); - base->RCSR &= - ~(I2S_RCSR_FRIE_MASK | I2S_RCSR_FWIE_MASK | I2S_RCSR_FEIE_MASK | I2S_RCSR_FRDE_MASK | I2S_RCSR_FWDE_MASK); -#else - /* disable interrupt and DMA request*/ - base->TCSR &= ~(I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK | I2S_TCSR_FWDE_MASK); - base->RCSR &= ~(I2S_RCSR_FWIE_MASK | I2S_RCSR_FEIE_MASK | I2S_RCSR_FWDE_MASK); -#endif -} - -/*! - * brief De-initializes the SAI peripheral. - * - * This API gates the SAI clock. The SAI module can't operate unless SAI_TxInit - * or SAI_RxInit is called to enable the clock. - * - * param base SAI base pointer - */ -void SAI_Deinit(I2S_Type *base) -{ - SAI_TxEnable(base, false); - SAI_RxEnable(base, false); -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - (void)CLOCK_DisableClock(s_saiClock[SAI_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Resets the SAI Tx. - * - * This function enables the software reset and FIFO reset of SAI Tx. After reset, clear the reset bit. - * - * param base SAI base pointer - */ -void SAI_TxReset(I2S_Type *base) -{ - /* Set the software reset and FIFO reset to clear internal state */ - base->TCSR = I2S_TCSR_SR_MASK | I2S_TCSR_FR_MASK; - - /* Clear software reset bit, this should be done by software */ - base->TCSR &= ~I2S_TCSR_SR_MASK; - - /* Reset all Tx register values */ - base->TCR2 = 0; - base->TCR3 = 0; - base->TCR4 = 0; - base->TCR5 = 0; - base->TMR = 0; -} - -/*! - * brief Resets the SAI Rx. - * - * This function enables the software reset and FIFO reset of SAI Rx. After reset, clear the reset bit. - * - * param base SAI base pointer - */ -void SAI_RxReset(I2S_Type *base) -{ - /* Set the software reset and FIFO reset to clear internal state */ - base->RCSR = I2S_RCSR_SR_MASK | I2S_RCSR_FR_MASK; - - /* Clear software reset bit, this should be done by software */ - base->RCSR &= ~I2S_RCSR_SR_MASK; - - /* Reset all Rx register values */ - base->RCR2 = 0; - base->RCR3 = 0; - base->RCR4 = 0; - base->RCR5 = 0; - base->RMR = 0; -} - -/*! - * brief Enables/disables the SAI Tx. - * - * param base SAI base pointer - * param enable True means enable SAI Tx, false means disable. - */ -void SAI_TxEnable(I2S_Type *base, bool enable) -{ - if (enable) - { - /* If clock is sync with Rx, should enable RE bit. */ - if (((base->TCR2 & I2S_TCR2_SYNC_MASK) >> I2S_TCR2_SYNC_SHIFT) == 0x1U) - { - base->RCSR = ((base->RCSR & 0xFFE3FFFFU) | I2S_RCSR_RE_MASK); - } - base->TCSR = ((base->TCSR & 0xFFE3FFFFU) | I2S_TCSR_TE_MASK); - /* Also need to clear the FIFO error flag before start */ - SAI_TxClearStatusFlags(base, kSAI_FIFOErrorFlag); - } - else - { - /* If Rx not in sync with Tx, then disable Tx, otherwise, shall not disable Tx */ - if (((base->RCR2 & I2S_RCR2_SYNC_MASK) >> I2S_RCR2_SYNC_SHIFT) != 0x1U) - { - /* Disable TE bit */ - base->TCSR = ((base->TCSR & 0xFFE3FFFFU) & (~I2S_TCSR_TE_MASK)); - } - } -} - -/*! - * brief Enables/disables the SAI Rx. - * - * param base SAI base pointer - * param enable True means enable SAI Rx, false means disable. - */ -void SAI_RxEnable(I2S_Type *base, bool enable) -{ - if (enable) - { - /* If clock is sync with Tx, should enable TE bit. */ - if (((base->RCR2 & I2S_RCR2_SYNC_MASK) >> I2S_RCR2_SYNC_SHIFT) == 0x1U) - { - base->TCSR = ((base->TCSR & 0xFFE3FFFFU) | I2S_TCSR_TE_MASK); - } - base->RCSR = ((base->RCSR & 0xFFE3FFFFU) | I2S_RCSR_RE_MASK); - /* Also need to clear the FIFO error flag before start */ - SAI_RxClearStatusFlags(base, kSAI_FIFOErrorFlag); - } - else - { - /* If Tx not in sync with Rx, then disable Rx, otherwise, shall not disable Rx */ - if (((base->TCR2 & I2S_TCR2_SYNC_MASK) >> I2S_TCR2_SYNC_SHIFT) != 0x1U) - { - /* Disable RE bit */ - base->RCSR = ((base->RCSR & 0xFFE3FFFFU) & (~I2S_RCSR_RE_MASK)); - } - } -} - -/*! - * brief Do software reset or FIFO reset . - * - * FIFO reset means clear all the data in the FIFO, and make the FIFO pointer both to 0. - * Software reset means clear the Tx internal logic, including the bit clock, frame count etc. But software - * reset will not clear any configuration registers like TCR1~TCR5. - * This function will also clear all the error flags such as FIFO error, sync error etc. - * - * param base SAI base pointer - * param resetType Reset type, FIFO reset or software reset - */ -void SAI_TxSoftwareReset(I2S_Type *base, sai_reset_type_t resetType) -{ - base->TCSR |= (uint32_t)resetType; - - /* Clear the software reset */ - base->TCSR &= ~I2S_TCSR_SR_MASK; -} - -/*! - * brief Do software reset or FIFO reset . - * - * FIFO reset means clear all the data in the FIFO, and make the FIFO pointer both to 0. - * Software reset means clear the Rx internal logic, including the bit clock, frame count etc. But software - * reset will not clear any configuration registers like RCR1~RCR5. - * This function will also clear all the error flags such as FIFO error, sync error etc. - * - * param base SAI base pointer - * param resetType Reset type, FIFO reset or software reset - */ -void SAI_RxSoftwareReset(I2S_Type *base, sai_reset_type_t resetType) -{ - base->RCSR |= (uint32_t)resetType; - - /* Clear the software reset */ - base->RCSR &= ~I2S_RCSR_SR_MASK; -} - -/*! - * brief Set the Tx channel FIFO enable mask. - * - * param base SAI base pointer - * param mask Channel enable mask, 0 means all channel FIFO disabled, 1 means channel 0 enabled, - * 3 means both channel 0 and channel 1 enabled. - */ -void SAI_TxSetChannelFIFOMask(I2S_Type *base, uint8_t mask) -{ - base->TCR3 &= ~I2S_TCR3_TCE_MASK; - base->TCR3 |= I2S_TCR3_TCE(mask); -} - -/*! - * brief Set the Rx channel FIFO enable mask. - * - * param base SAI base pointer - * param mask Channel enable mask, 0 means all channel FIFO disabled, 1 means channel 0 enabled, - * 3 means both channel 0 and channel 1 enabled. - */ -void SAI_RxSetChannelFIFOMask(I2S_Type *base, uint8_t mask) -{ - base->RCR3 &= ~I2S_RCR3_RCE_MASK; - base->RCR3 |= I2S_RCR3_RCE(mask); -} - -/*! - * brief Set the Tx data order. - * - * param base SAI base pointer - * param order Data order MSB or LSB - */ -void SAI_TxSetDataOrder(I2S_Type *base, sai_data_order_t order) -{ - uint32_t val = (base->TCR4) & (~I2S_TCR4_MF_MASK); - - val |= I2S_TCR4_MF(order); - base->TCR4 = val; -} - -/*! - * brief Set the Rx data order. - * - * param base SAI base pointer - * param order Data order MSB or LSB - */ -void SAI_RxSetDataOrder(I2S_Type *base, sai_data_order_t order) -{ - uint32_t val = (base->RCR4) & (~I2S_RCR4_MF_MASK); - - val |= I2S_RCR4_MF(order); - base->RCR4 = val; -} - -/*! - * brief Set the Tx data order. - * - * param base SAI base pointer - * param order Data order MSB or LSB - */ -void SAI_TxSetBitClockPolarity(I2S_Type *base, sai_clock_polarity_t polarity) -{ - uint32_t val = (base->TCR2) & (~I2S_TCR2_BCP_MASK); - - val |= I2S_TCR2_BCP(polarity); - base->TCR2 = val; -} - -/*! - * brief Set the Rx data order. - * - * param base SAI base pointer - * param order Data order MSB or LSB - */ -void SAI_RxSetBitClockPolarity(I2S_Type *base, sai_clock_polarity_t polarity) -{ - uint32_t val = (base->RCR2) & (~I2S_RCR2_BCP_MASK); - - val |= I2S_RCR2_BCP(polarity); - base->RCR2 = val; -} - -/*! - * brief Set the Tx data order. - * - * param base SAI base pointer - * param order Data order MSB or LSB - */ -void SAI_TxSetFrameSyncPolarity(I2S_Type *base, sai_clock_polarity_t polarity) -{ - uint32_t val = (base->TCR4) & (~I2S_TCR4_FSP_MASK); - - val |= I2S_TCR4_FSP(polarity); - base->TCR4 = val; -} - -/*! - * brief Set the Rx data order. - * - * param base SAI base pointer - * param order Data order MSB or LSB - */ -void SAI_RxSetFrameSyncPolarity(I2S_Type *base, sai_clock_polarity_t polarity) -{ - uint32_t val = (base->RCR4) & (~I2S_RCR4_FSP_MASK); - - val |= I2S_RCR4_FSP(polarity); - base->RCR4 = val; -} - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_PACKING) && FSL_FEATURE_SAI_HAS_FIFO_PACKING -/*! - * brief Set Tx FIFO packing feature. - * - * param base SAI base pointer. - * param pack FIFO pack type. It is element of sai_fifo_packing_t. - */ -void SAI_TxSetFIFOPacking(I2S_Type *base, sai_fifo_packing_t pack) -{ - uint32_t val = base->TCR4; - - val &= ~I2S_TCR4_FPACK_MASK; - val |= I2S_TCR4_FPACK(pack); - base->TCR4 = val; -} - -/*! - * brief Set Rx FIFO packing feature. - * - * param base SAI base pointer. - * param pack FIFO pack type. It is element of sai_fifo_packing_t. - */ -void SAI_RxSetFIFOPacking(I2S_Type *base, sai_fifo_packing_t pack) -{ - uint32_t val = base->RCR4; - - val &= ~I2S_RCR4_FPACK_MASK; - val |= I2S_RCR4_FPACK(pack); - base->RCR4 = val; -} -#endif /* FSL_FEATURE_SAI_HAS_FIFO_PACKING */ - -/*! - * brief Transmitter bit clock rate configurations. - * - * param base SAI base pointer. - * param sourceClockHz, bit clock source frequency. - * param sampleRate audio data sample rate. - * param bitWidth, audio data bitWidth. - * param channelNumbers, audio channel numbers. - */ -void SAI_TxSetBitClockRate( - I2S_Type *base, uint32_t sourceClockHz, uint32_t sampleRate, uint32_t bitWidth, uint32_t channelNumbers) -{ - uint32_t tcr2 = base->TCR2; - uint32_t bitClockDiv = 0; - uint32_t bitClockFreq = sampleRate * bitWidth * channelNumbers; - - assert(sourceClockHz >= bitClockFreq); - - tcr2 &= ~I2S_TCR2_DIV_MASK; - /* need to check the divided bclk, if bigger than target, then divider need to re-calculate. */ - bitClockDiv = sourceClockHz / bitClockFreq; - /* for the condition where the source clock is smaller than target bclk */ - if (bitClockDiv == 0U) - { - bitClockDiv++; - } - /* recheck the divider if properly or not, to make sure output blck not bigger than target*/ - if ((sourceClockHz / bitClockDiv) > bitClockFreq) - { - bitClockDiv++; - } - -#if defined(FSL_FEATURE_SAI_HAS_BCLK_BYPASS) && (FSL_FEATURE_SAI_HAS_BCLK_BYPASS) - /* if bclk same with MCLK, bypass the divider */ - if (bitClockDiv == 1U) - { - tcr2 |= I2S_TCR2_BYP_MASK; - } - else -#endif - { - tcr2 |= I2S_TCR2_DIV(bitClockDiv / 2U - 1UL); - } - - base->TCR2 = tcr2; -} - -/*! - * brief Receiver bit clock rate configurations. - * - * param base SAI base pointer. - * param sourceClockHz, bit clock source frequency. - * param sampleRate audio data sample rate. - * param bitWidth, audio data bitWidth. - * param channelNumbers, audio channel numbers. - */ -void SAI_RxSetBitClockRate( - I2S_Type *base, uint32_t sourceClockHz, uint32_t sampleRate, uint32_t bitWidth, uint32_t channelNumbers) -{ - uint32_t rcr2 = base->RCR2; - uint32_t bitClockDiv = 0; - uint32_t bitClockFreq = sampleRate * bitWidth * channelNumbers; - - assert(sourceClockHz >= bitClockFreq); - - rcr2 &= ~I2S_RCR2_DIV_MASK; - /* need to check the divided bclk, if bigger than target, then divider need to re-calculate. */ - bitClockDiv = sourceClockHz / bitClockFreq; - /* for the condition where the source clock is smaller than target bclk */ - if (bitClockDiv == 0U) - { - bitClockDiv++; - } - /* recheck the divider if properly or not, to make sure output blck not bigger than target*/ - if ((sourceClockHz / bitClockDiv) > bitClockFreq) - { - bitClockDiv++; - } - -#if defined(FSL_FEATURE_SAI_HAS_BCLK_BYPASS) && (FSL_FEATURE_SAI_HAS_BCLK_BYPASS) - /* if bclk same with MCLK, bypass the divider */ - if (bitClockDiv == 1U) - { - rcr2 |= I2S_RCR2_BYP_MASK; - } - else -#endif - { - rcr2 |= I2S_RCR2_DIV(bitClockDiv / 2U - 1UL); - } - - base->RCR2 = rcr2; -} - -/*! - * brief Transmitter Bit clock configurations. - * - * param base SAI base pointer. - * param masterSlave master or slave. - * param config bit clock other configurations, can be NULL in slave mode. - */ -void SAI_TxSetBitclockConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_bit_clock_t *config) -{ - uint32_t tcr2 = base->TCR2; - - if ((masterSlave == kSAI_Master) || (masterSlave == kSAI_Bclk_Master_FrameSync_Slave)) - { - assert(config != NULL); - - tcr2 &= ~(I2S_TCR2_BCD_MASK | I2S_TCR2_BCP_MASK | I2S_TCR2_BCI_MASK | I2S_TCR2_BCS_MASK | I2S_TCR2_MSEL_MASK); - tcr2 |= I2S_TCR2_BCD(1U) | I2S_TCR2_BCP(config->bclkPolarity) | I2S_TCR2_BCI(config->bclkInputDelay) | - I2S_TCR2_BCS(config->bclkSrcSwap) | I2S_TCR2_MSEL(config->bclkSource); - } - else - { - tcr2 &= ~(I2S_TCR2_BCD_MASK); - tcr2 |= I2S_TCR2_BCP(config->bclkPolarity); - } - - base->TCR2 = tcr2; -} - -/*! - * brief Receiver Bit clock configurations. - * - * param base SAI base pointer. - * param masterSlave master or slave. - * param config bit clock other configurations, can be NULL in slave mode. - */ -void SAI_RxSetBitclockConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_bit_clock_t *config) -{ - uint32_t rcr2 = base->RCR2; - - if ((masterSlave == kSAI_Master) || (masterSlave == kSAI_Bclk_Master_FrameSync_Slave)) - { - assert(config != NULL); - - rcr2 &= ~(I2S_RCR2_BCD_MASK | I2S_RCR2_BCP_MASK | I2S_RCR2_BCI_MASK | I2S_RCR2_BCS_MASK | I2S_RCR2_MSEL_MASK); - rcr2 |= I2S_RCR2_BCD(1U) | I2S_RCR2_BCP(config->bclkPolarity) | I2S_RCR2_BCI(config->bclkInputDelay) | - I2S_RCR2_BCS(config->bclkSrcSwap) | I2S_RCR2_MSEL(config->bclkSource); - } - else - { - rcr2 &= ~(I2S_RCR2_BCD_MASK); - rcr2 |= I2S_RCR2_BCP(config->bclkPolarity); - } - - base->RCR2 = rcr2; -} - -#if (defined(FSL_FEATURE_SAI_HAS_MCR) && (FSL_FEATURE_SAI_HAS_MCR)) || \ - (defined(FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) && (FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER)) -/*! - * brief Master clock configurations. - * - * param base SAI base pointer. - * param config master clock configurations. - */ -void SAI_SetMasterClockConfig(I2S_Type *base, sai_master_clock_t *config) -{ - assert(config != NULL); - -#if defined(FSL_FEATURE_SAI_HAS_MCR) && (FSL_FEATURE_SAI_HAS_MCR) - uint32_t val = 0; -#if !(defined(FSL_FEATURE_SAI_HAS_NO_MCR_MICS) && (FSL_FEATURE_SAI_HAS_NO_MCR_MICS)) - /* Master clock source setting */ - val = (base->MCR & ~I2S_MCR_MICS_MASK); - base->MCR = (val | I2S_MCR_MICS(config->mclkSource)); -#endif - - /* Configure Master clock output enable */ - val = (base->MCR & ~I2S_MCR_MOE_MASK); - base->MCR = (val | I2S_MCR_MOE(config->mclkOutputEnable)); -#endif /* FSL_FEATURE_SAI_HAS_MCR */ - -#if ((defined(FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) && (FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER)) || \ - (defined(FSL_FEATURE_SAI_HAS_MCR_MCLK_POST_DIV) && (FSL_FEATURE_SAI_HAS_MCR_MCLK_POST_DIV))) - /* Check if master clock divider enabled, then set master clock divider */ - if (config->mclkOutputEnable) - { - SAI_SetMasterClockDivider(base, config->mclkHz, config->mclkSourceClkHz); - } -#endif /* FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER */ -} -#endif - -#if FSL_SAI_HAS_FIFO_EXTEND_FEATURE -/*! - * brief SAI transmitter fifo configurations. - * - * param base SAI base pointer. - * param config fifo configurations. - */ -void SAI_TxSetFifoConfig(I2S_Type *base, sai_fifo_t *config) -{ - assert(config != NULL); -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((config->fifoWatermark == 0U) || - (config->fifoWatermark > (uint8_t)((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base)))) - { - config->fifoWatermark = (uint8_t)((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base) / 2U); - } -#endif - - uint32_t tcr4 = base->TCR4; - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE - tcr4 &= ~I2S_TCR4_FCOMB_MASK; - tcr4 |= I2S_TCR4_FCOMB(config->fifoCombine); -#endif - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) && FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR - tcr4 &= ~I2S_TCR4_FCONT_MASK; - /* ERR05144: not set FCONT = 1 when TMR > 0, the transmit shift register may not load correctly that will cause TX - * not work */ - if (base->TMR == 0U) - { - tcr4 |= I2S_TCR4_FCONT(config->fifoContinueOneError); - } -#endif - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_PACKING) && FSL_FEATURE_SAI_HAS_FIFO_PACKING - tcr4 &= ~I2S_TCR4_FPACK_MASK; - tcr4 |= I2S_TCR4_FPACK(config->fifoPacking); -#endif - - base->TCR4 = tcr4; - -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - base->TCR1 = (base->TCR1 & (~I2S_TCR1_TFW_MASK)) | I2S_TCR1_TFW(config->fifoWatermark); -#endif -} - -/*! - * brief SAI receiver fifo configurations. - * - * param base SAI base pointer. - * param config fifo configurations. - */ -void SAI_RxSetFifoConfig(I2S_Type *base, sai_fifo_t *config) -{ - assert(config != NULL); -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((config->fifoWatermark == 0U) || - (config->fifoWatermark > (uint8_t)((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base)))) - { - config->fifoWatermark = (uint8_t)((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base) / 2U); - } -#endif - uint32_t rcr4 = base->RCR4; - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE - rcr4 &= ~I2S_RCR4_FCOMB_MASK; - rcr4 |= I2S_RCR4_FCOMB(config->fifoCombine); -#endif - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) && FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR - rcr4 &= ~I2S_RCR4_FCONT_MASK; - rcr4 |= I2S_RCR4_FCONT(config->fifoContinueOneError); -#endif - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_PACKING) && FSL_FEATURE_SAI_HAS_FIFO_PACKING - rcr4 &= ~I2S_RCR4_FPACK_MASK; - rcr4 |= I2S_RCR4_FPACK(config->fifoPacking); -#endif - - base->RCR4 = rcr4; - -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - base->RCR1 = (base->RCR1 & (~I2S_RCR1_RFW_MASK)) | I2S_RCR1_RFW(config->fifoWatermark); -#endif -} -#endif - -/*! - * brief SAI transmitter Frame sync configurations. - * - * param base SAI base pointer. - * param masterSlave master or slave. - * param config frame sync configurations, can be NULL in slave mode. - */ -void SAI_TxSetFrameSyncConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_frame_sync_t *config) -{ - assert(config != NULL); - assert((config->frameSyncWidth - 1UL) <= (I2S_TCR4_SYWD_MASK >> I2S_TCR4_SYWD_SHIFT)); - - uint32_t tcr4 = base->TCR4; - - tcr4 &= ~(I2S_TCR4_FSE_MASK | I2S_TCR4_FSP_MASK | I2S_TCR4_FSD_MASK | I2S_TCR4_SYWD_MASK); - -#if defined(FSL_FEATURE_SAI_HAS_ON_DEMAND_MODE) && FSL_FEATURE_SAI_HAS_ON_DEMAND_MODE - tcr4 &= ~I2S_TCR4_ONDEM_MASK; - tcr4 |= I2S_TCR4_ONDEM(config->frameSyncGenerateOnDemand); -#endif - - tcr4 |= - I2S_TCR4_FSE(config->frameSyncEarly) | I2S_TCR4_FSP(config->frameSyncPolarity) | - I2S_TCR4_FSD(((masterSlave == kSAI_Master) || (masterSlave == kSAI_Bclk_Slave_FrameSync_Master)) ? 1UL : 0U) | - I2S_TCR4_SYWD(config->frameSyncWidth - 1UL); - - base->TCR4 = tcr4; -} - -/*! - * brief SAI receiver Frame sync configurations. - * - * param base SAI base pointer. - * param masterSlave master or slave. - * param config frame sync configurations, can be NULL in slave mode. - */ -void SAI_RxSetFrameSyncConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_frame_sync_t *config) -{ - assert(config != NULL); - assert((config->frameSyncWidth - 1UL) <= (I2S_RCR4_SYWD_MASK >> I2S_RCR4_SYWD_SHIFT)); - - uint32_t rcr4 = base->RCR4; - - rcr4 &= ~(I2S_RCR4_FSE_MASK | I2S_RCR4_FSP_MASK | I2S_RCR4_FSD_MASK | I2S_RCR4_SYWD_MASK); - -#if defined(FSL_FEATURE_SAI_HAS_ON_DEMAND_MODE) && FSL_FEATURE_SAI_HAS_ON_DEMAND_MODE - rcr4 &= ~I2S_RCR4_ONDEM_MASK; - rcr4 |= I2S_RCR4_ONDEM(config->frameSyncGenerateOnDemand); -#endif - - rcr4 |= - I2S_RCR4_FSE(config->frameSyncEarly) | I2S_RCR4_FSP(config->frameSyncPolarity) | - I2S_RCR4_FSD(((masterSlave == kSAI_Master) || (masterSlave == kSAI_Bclk_Slave_FrameSync_Master)) ? 1UL : 0U) | - I2S_RCR4_SYWD(config->frameSyncWidth - 1UL); - - base->RCR4 = rcr4; -} - -/*! - * brief SAI transmitter Serial data configurations. - * - * param base SAI base pointer. - * param config serial data configurations. - */ -void SAI_TxSetSerialDataConfig(I2S_Type *base, sai_serial_data_t *config) -{ - assert(config != NULL); - - uint32_t tcr4 = base->TCR4; - - base->TCR5 = I2S_TCR5_WNW(config->dataWordNLength - 1UL) | I2S_TCR5_W0W(config->dataWord0Length - 1UL) | - I2S_TCR5_FBT(config->dataFirstBitShifted - 1UL); - base->TMR = config->dataMaskedWord; -#if defined(FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) && FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR - /* ERR05144: not set FCONT = 1 when TMR > 0, the transmit shift register may not load correctly that will cause TX - * not work */ - if (config->dataMaskedWord > 0U) - { - tcr4 &= ~I2S_TCR4_FCONT_MASK; - } -#endif - tcr4 &= ~(I2S_TCR4_FRSZ_MASK | I2S_TCR4_MF_MASK); - tcr4 |= I2S_TCR4_FRSZ(config->dataWordNum - 1UL) | I2S_TCR4_MF(config->dataOrder); - -#if defined(FSL_FEATURE_SAI_HAS_CHANNEL_MODE) && FSL_FEATURE_SAI_HAS_CHANNEL_MODE - tcr4 &= ~I2S_TCR4_CHMOD_MASK; - tcr4 |= I2S_TCR4_CHMOD(config->dataMode); -#endif - - base->TCR4 = tcr4; -} - -/*! - * @brief SAI receiver Serial data configurations. - * - * @param base SAI base pointer. - * @param config serial data configurations. - */ -void SAI_RxSetSerialDataConfig(I2S_Type *base, sai_serial_data_t *config) -{ - assert(config != NULL); - - uint32_t rcr4 = base->RCR4; - - base->RCR5 = I2S_RCR5_WNW(config->dataWordNLength - 1UL) | I2S_RCR5_W0W(config->dataWord0Length - 1UL) | - I2S_RCR5_FBT(config->dataFirstBitShifted - 1UL); - base->RMR = config->dataMaskedWord; - - rcr4 &= ~(I2S_RCR4_FRSZ_MASK | I2S_RCR4_MF_MASK); - rcr4 |= I2S_RCR4_FRSZ(config->dataWordNum - 1uL) | I2S_RCR4_MF(config->dataOrder); - - base->RCR4 = rcr4; -} - -/*! - * brief SAI transmitter configurations. - * - * param base SAI base pointer. - * param config transmitter configurations. - */ -void SAI_TxSetConfig(I2S_Type *base, sai_transceiver_t *config) -{ - assert(config != NULL); - assert(FSL_FEATURE_SAI_CHANNEL_COUNTn(base) != -1); - - uint8_t i = 0U; - uint32_t val = 0U; - uint8_t channelNums = 0U; - - /* reset transmitter */ - SAI_TxReset(base); - - /* if channel mask is not set, then format->channel must be set, - use it to get channel mask value */ - if (config->channelMask == 0U) - { - config->channelMask = 1U << config->startChannel; - } - - for (i = 0U; i < (uint32_t)FSL_FEATURE_SAI_CHANNEL_COUNTn(base); i++) - { - if (IS_SAI_FLAG_SET(1UL << i, config->channelMask)) - { - channelNums++; - config->endChannel = i; - } - } - - for (i = 0U; i < (uint32_t)FSL_FEATURE_SAI_CHANNEL_COUNTn(base); i++) - { - if (IS_SAI_FLAG_SET((1UL << i), config->channelMask)) - { - config->startChannel = i; - break; - } - } - - config->channelNums = channelNums; -#if defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && (FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) - /* make sure combine mode disabled while multipe channel is used */ - if (config->channelNums > 1U) - { - base->TCR4 &= ~I2S_TCR4_FCOMB_MASK; - } -#endif - - /* Set data channel */ - base->TCR3 &= ~I2S_TCR3_TCE_MASK; - base->TCR3 |= I2S_TCR3_TCE(config->channelMask); - - if (config->syncMode == kSAI_ModeAsync) - { - val = base->TCR2; - val &= ~I2S_TCR2_SYNC_MASK; - base->TCR2 = (val | I2S_TCR2_SYNC(0U)); - } - if (config->syncMode == kSAI_ModeSync) - { - val = base->TCR2; - val &= ~I2S_TCR2_SYNC_MASK; - base->TCR2 = (val | I2S_TCR2_SYNC(1U)); - /* If sync with Rx, should set Rx to async mode */ - val = base->RCR2; - val &= ~I2S_RCR2_SYNC_MASK; - base->RCR2 = (val | I2S_RCR2_SYNC(0U)); - } -#if defined(FSL_FEATURE_SAI_HAS_SYNC_WITH_ANOTHER_SAI) && (FSL_FEATURE_SAI_HAS_SYNC_WITH_ANOTHER_SAI) - if (config->syncMode == kSAI_ModeSyncWithOtherTx) - { - val = base->TCR2; - val &= ~I2S_TCR2_SYNC_MASK; - base->TCR2 = (val | I2S_TCR2_SYNC(2U)); - } - if (config->syncMode == kSAI_ModeSyncWithOtherRx) - { - val = base->TCR2; - val &= ~I2S_TCR2_SYNC_MASK; - base->TCR2 = (val | I2S_TCR2_SYNC(3U)); - } -#endif /* FSL_FEATURE_SAI_HAS_SYNC_WITH_ANOTHER_SAI */ - - /* bit clock configurations */ - SAI_TxSetBitclockConfig(base, config->masterSlave, &config->bitClock); - /* serial data configurations */ - SAI_TxSetSerialDataConfig(base, &config->serialData); - /* frame sync configurations */ - SAI_TxSetFrameSyncConfig(base, config->masterSlave, &config->frameSync); -#if FSL_SAI_HAS_FIFO_EXTEND_FEATURE - /* fifo configurations */ - SAI_TxSetFifoConfig(base, &config->fifo); -#endif -} - -/*! - * brief SAI transmitter transfer configurations. - * - * This function initializes the TX, include bit clock, frame sync, master clock, serial data and fifo configurations. - * - * param base SAI base pointer. - * param handle SAI handle pointer. - * param config tranmitter configurations. - */ -void SAI_TransferTxSetConfig(I2S_Type *base, sai_handle_t *handle, sai_transceiver_t *config) -{ - assert(handle != NULL); - assert(config != NULL); - assert(config->channelNums <= (uint32_t)FSL_FEATURE_SAI_CHANNEL_COUNTn(base)); - - handle->bitWidth = config->serialData.dataWordNLength; -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((config->fifo.fifoWatermark == 0U) || - (config->fifo.fifoWatermark > (uint8_t)((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base)))) - { - config->fifo.fifoWatermark = (uint8_t)((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base) / 2U); - } - handle->watermark = config->fifo.fifoWatermark; -#endif - - /* transmitter configurations */ - SAI_TxSetConfig(base, config); - - handle->channel = config->startChannel; - /* used for multi channel */ - handle->channelMask = config->channelMask; - handle->channelNums = config->channelNums; - handle->endChannel = config->endChannel; -} - -/*! - * brief SAI receiver configurations. - * - * param base SAI base pointer. - * param config transmitter configurations. - */ -void SAI_RxSetConfig(I2S_Type *base, sai_transceiver_t *config) -{ - assert(config != NULL); - assert(FSL_FEATURE_SAI_CHANNEL_COUNTn(base) != -1); - - uint8_t i = 0U; - uint32_t val = 0U; - uint8_t channelNums = 0U; - - /* reset receiver */ - SAI_RxReset(base); - - /* if channel mask is not set, then format->channel must be set, - use it to get channel mask value */ - if (config->channelMask == 0U) - { - config->channelMask = 1U << config->startChannel; - } - - for (i = 0U; i < (uint32_t)FSL_FEATURE_SAI_CHANNEL_COUNTn(base); i++) - { - if (IS_SAI_FLAG_SET((1UL << i), config->channelMask)) - { - channelNums++; - config->endChannel = i; - } - } - - for (i = 0U; i < (uint32_t)FSL_FEATURE_SAI_CHANNEL_COUNTn(base); i++) - { - if (IS_SAI_FLAG_SET((1UL << i), config->channelMask)) - { - config->startChannel = i; - break; - } - } - - config->channelNums = channelNums; -#if defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && (FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) - /* make sure combine mode disabled while multipe channel is used */ - if (config->channelNums > 1U) - { - base->RCR4 &= ~I2S_RCR4_FCOMB_MASK; - } -#endif - - /* Set data channel */ - base->RCR3 &= ~I2S_RCR3_RCE_MASK; - base->RCR3 |= I2S_RCR3_RCE(config->channelMask); - - /* Set Sync mode */ - if (config->syncMode == kSAI_ModeAsync) - { - val = base->RCR2; - val &= ~I2S_RCR2_SYNC_MASK; - base->RCR2 = (val | I2S_RCR2_SYNC(0U)); - } - if (config->syncMode == kSAI_ModeSync) - { - val = base->RCR2; - val &= ~I2S_RCR2_SYNC_MASK; - base->RCR2 = (val | I2S_RCR2_SYNC(1U)); - /* If sync with Tx, should set Tx to async mode */ - val = base->TCR2; - val &= ~I2S_TCR2_SYNC_MASK; - base->TCR2 = (val | I2S_TCR2_SYNC(0U)); - } -#if defined(FSL_FEATURE_SAI_HAS_SYNC_WITH_ANOTHER_SAI) && (FSL_FEATURE_SAI_HAS_SYNC_WITH_ANOTHER_SAI) - if (config->syncMode == kSAI_ModeSyncWithOtherTx) - { - val = base->RCR2; - val &= ~I2S_RCR2_SYNC_MASK; - base->RCR2 = (val | I2S_RCR2_SYNC(2U)); - } - if (config->syncMode == kSAI_ModeSyncWithOtherRx) - { - val = base->RCR2; - val &= ~I2S_RCR2_SYNC_MASK; - base->RCR2 = (val | I2S_RCR2_SYNC(3U)); - } -#endif /* FSL_FEATURE_SAI_HAS_SYNC_WITH_ANOTHER_SAI */ - - /* bit clock configurations */ - SAI_RxSetBitclockConfig(base, config->masterSlave, &config->bitClock); - /* serial data configurations */ - SAI_RxSetSerialDataConfig(base, &config->serialData); - /* frame sync configurations */ - SAI_RxSetFrameSyncConfig(base, config->masterSlave, &config->frameSync); -#if FSL_SAI_HAS_FIFO_EXTEND_FEATURE - /* fifo configurations */ - SAI_RxSetFifoConfig(base, &config->fifo); -#endif -} - -/*! - * brief SAI receiver transfer configurations. - * - * This function initializes the TX, include bit clock, frame sync, master clock, serial data and fifo configurations. - * - * param base SAI base pointer. - * param handle SAI handle pointer. - * param config tranmitter configurations. - */ -void SAI_TransferRxSetConfig(I2S_Type *base, sai_handle_t *handle, sai_transceiver_t *config) -{ - assert(handle != NULL); - assert(config != NULL); - - handle->bitWidth = config->serialData.dataWordNLength; -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((config->fifo.fifoWatermark == 0U) || - (config->fifo.fifoWatermark > (uint8_t)((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base)))) - { - config->fifo.fifoWatermark = (uint8_t)((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base) / 2U); - } - handle->watermark = config->fifo.fifoWatermark; -#endif - - /* receiver configurations */ - SAI_RxSetConfig(base, config); - - handle->channel = config->startChannel; - /* used for multi channel */ - handle->channelMask = config->channelMask; - handle->channelNums = config->channelNums; - handle->endChannel = config->endChannel; -} - -/*! - * brief Get classic I2S mode configurations. - * - * param config transceiver configurations. - * param bitWidth audio data bitWidth. - * param mode audio data channel. - * param saiChannelMask channel mask value to enable. - */ -void SAI_GetClassicI2SConfig(sai_transceiver_t *config, - sai_word_width_t bitWidth, - sai_mono_stereo_t mode, - uint32_t saiChannelMask) -{ - SAI_GetCommonConfig(config, bitWidth, mode, saiChannelMask); -} - -/*! - * brief Get left justified mode configurations. - * - * param config transceiver configurations. - * param bitWidth audio data bitWidth. - * param mode audio data channel. - * param saiChannelMask channel mask value to enable. - */ -void SAI_GetLeftJustifiedConfig(sai_transceiver_t *config, - sai_word_width_t bitWidth, - sai_mono_stereo_t mode, - uint32_t saiChannelMask) -{ - assert(NULL != config); - assert(saiChannelMask != 0U); - - SAI_GetCommonConfig(config, bitWidth, mode, saiChannelMask); - - config->frameSync.frameSyncEarly = false; - config->frameSync.frameSyncPolarity = kSAI_PolarityActiveHigh; -} - -/*! - * brief Get right justified mode configurations. - * - * param config transceiver configurations. - * param bitWidth audio data bitWidth. - * param mode audio data channel. - * param saiChannelMask channel mask value to enable. - */ -void SAI_GetRightJustifiedConfig(sai_transceiver_t *config, - sai_word_width_t bitWidth, - sai_mono_stereo_t mode, - uint32_t saiChannelMask) -{ - assert(NULL != config); - assert(saiChannelMask != 0U); - - SAI_GetCommonConfig(config, bitWidth, mode, saiChannelMask); - - config->frameSync.frameSyncEarly = false; - config->frameSync.frameSyncPolarity = kSAI_PolarityActiveHigh; -} - -/*! - * brief Get DSP mode configurations. - * - * note DSP mode is also called PCM mode which support MODE A and MODE B, - * DSP/PCM MODE A configuration flow. RX is similiar but uses SAI_RxSetConfig instead of SAI_TxSetConfig: - * code - * SAI_GetDSPConfig(config, kSAI_FrameSyncLenOneBitClk, bitWidth, kSAI_Stereo, channelMask) - * config->frameSync.frameSyncEarly = true; - * SAI_TxSetConfig(base, config) - * endcode - * - * DSP/PCM MODE B configuration flow for TX. RX is similiar but uses SAI_RxSetConfig instead of SAI_TxSetConfig: - * code - * SAI_GetDSPConfig(config, kSAI_FrameSyncLenOneBitClk, bitWidth, kSAI_Stereo, channelMask) - * SAI_TxSetConfig(base, config) - * endcode - * - * param config transceiver configurations. - * param frameSyncWidth length of frame sync. - * param bitWidth audio data bitWidth. - * param mode audio data channel. - * param saiChannelMask mask value of the channel to enable. - */ -void SAI_GetDSPConfig(sai_transceiver_t *config, - sai_frame_sync_len_t frameSyncWidth, - sai_word_width_t bitWidth, - sai_mono_stereo_t mode, - uint32_t saiChannelMask) -{ - assert(NULL != config); - assert(saiChannelMask != 0U); - - SAI_GetCommonConfig(config, bitWidth, mode, saiChannelMask); - - /* frame sync default configurations */ - switch (frameSyncWidth) - { - case kSAI_FrameSyncLenOneBitClk: - config->frameSync.frameSyncWidth = 1U; - break; - default: - assert(false); - break; - } - config->frameSync.frameSyncEarly = false; - config->frameSync.frameSyncPolarity = kSAI_PolarityActiveHigh; -} - -/*! - * brief Get TDM mode configurations. - * - * param config transceiver configurations. - * param bitWidth audio data bitWidth. - * param mode audio data channel. - * param saiChannelMask channel mask value to enable. - */ -void SAI_GetTDMConfig(sai_transceiver_t *config, - sai_frame_sync_len_t frameSyncWidth, - sai_word_width_t bitWidth, - uint32_t dataWordNum, - uint32_t saiChannelMask) -{ - assert(NULL != config); - assert(saiChannelMask != 0U); - assert(dataWordNum <= 32U); - - SAI_GetCommonConfig(config, bitWidth, kSAI_Stereo, saiChannelMask); - - /* frame sync default configurations */ - switch (frameSyncWidth) - { - case kSAI_FrameSyncLenOneBitClk: - config->frameSync.frameSyncWidth = 1U; - break; - case kSAI_FrameSyncLenPerWordWidth: - break; - default: - assert(false); - break; - } - config->frameSync.frameSyncEarly = false; - config->frameSync.frameSyncPolarity = kSAI_PolarityActiveHigh; - config->serialData.dataWordNum = (uint8_t)dataWordNum; -} - -/*! - * brief Sends data using a blocking method. - * - * note This function blocks by polling until data is ready to be sent. - * - * param base SAI base pointer. - * param channel Data channel used. - * param bitWidth How many bits in an audio word; usually 8/16/24/32 bits. - * param buffer Pointer to the data to be written. - * param size Bytes to be written. - */ -void SAI_WriteBlocking(I2S_Type *base, uint32_t channel, uint32_t bitWidth, uint8_t *buffer, uint32_t size) -{ - uint32_t i = 0; - uint32_t bytesPerWord = bitWidth / 8U; -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - bytesPerWord = (((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base) - base->TCR1) * bytesPerWord); -#endif - - while (i < size) - { - /* Wait until it can write data */ - while (!(IS_SAI_FLAG_SET(base->TCSR, I2S_TCSR_FWF_MASK))) - { - } - - SAI_WriteNonBlocking(base, channel, 1UL << channel, channel, (uint8_t)bitWidth, buffer, bytesPerWord); - buffer = (uint8_t *)((uintptr_t)buffer + bytesPerWord); - i += bytesPerWord; - } - - /* Wait until the last data is sent */ - while (!(IS_SAI_FLAG_SET(base->TCSR, I2S_TCSR_FWF_MASK))) - { - } -} - -/*! - * brief Sends data to multi channel using a blocking method. - * - * note This function blocks by polling until data is ready to be sent. - * - * param base SAI base pointer. - * param channel Data channel used. - * param channelMask channel mask. - * param bitWidth How many bits in an audio word; usually 8/16/24/32 bits. - * param buffer Pointer to the data to be written. - * param size Bytes to be written. - */ -void SAI_WriteMultiChannelBlocking( - I2S_Type *base, uint32_t channel, uint32_t channelMask, uint32_t bitWidth, uint8_t *buffer, uint32_t size) -{ - assert(FSL_FEATURE_SAI_CHANNEL_COUNTn(base) != -1); - - uint32_t i = 0, j = 0; - uint32_t bytesPerWord = bitWidth / 8U; - uint32_t channelNums = 0U, endChannel = 0U; - -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - bytesPerWord = (((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base) - base->TCR1) * bytesPerWord); -#endif - - for (i = 0U; (i < (uint32_t)FSL_FEATURE_SAI_CHANNEL_COUNTn(base)); i++) - { - if (IS_SAI_FLAG_SET((1UL << i), channelMask)) - { - channelNums++; - endChannel = i; - } - } - - bytesPerWord *= channelNums; - - while (j < size) - { - /* Wait until it can write data */ - while (!(IS_SAI_FLAG_SET(base->TCSR, I2S_TCSR_FWF_MASK))) - { - } - - SAI_WriteNonBlocking(base, channel, channelMask, endChannel, (uint8_t)bitWidth, buffer, - bytesPerWord * channelNums); - buffer = (uint8_t *)((uintptr_t)buffer + bytesPerWord * channelNums); - j += bytesPerWord * channelNums; - } - - /* Wait until the last data is sent */ - while (!(IS_SAI_FLAG_SET(base->TCSR, I2S_TCSR_FWF_MASK))) - { - } -} - -/*! - * brief Receives multi channel data using a blocking method. - * - * note This function blocks by polling until data is ready to be sent. - * - * param base SAI base pointer. - * param channel Data channel used. - * param channelMask channel mask. - * param bitWidth How many bits in an audio word; usually 8/16/24/32 bits. - * param buffer Pointer to the data to be read. - * param size Bytes to be read. - */ -void SAI_ReadMultiChannelBlocking( - I2S_Type *base, uint32_t channel, uint32_t channelMask, uint32_t bitWidth, uint8_t *buffer, uint32_t size) -{ - assert(FSL_FEATURE_SAI_CHANNEL_COUNTn(base) != -1); - - uint32_t i = 0, j = 0; - uint32_t bytesPerWord = bitWidth / 8U; - uint32_t channelNums = 0U, endChannel = 0U; -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - bytesPerWord = base->RCR1 * bytesPerWord; -#endif - for (i = 0U; (i < (uint32_t)FSL_FEATURE_SAI_CHANNEL_COUNTn(base)); i++) - { - if (IS_SAI_FLAG_SET((1UL << i), channelMask)) - { - channelNums++; - endChannel = i; - } - } - - bytesPerWord *= channelNums; - - while (j < size) - { - /* Wait until data is received */ - while (!(IS_SAI_FLAG_SET(base->RCSR, I2S_RCSR_FWF_MASK))) - { - } - - SAI_ReadNonBlocking(base, channel, channelMask, endChannel, (uint8_t)bitWidth, buffer, - bytesPerWord * channelNums); - buffer = (uint8_t *)((uintptr_t)buffer + bytesPerWord * channelNums); - j += bytesPerWord * channelNums; - } -} - -/*! - * brief Receives data using a blocking method. - * - * note This function blocks by polling until data is ready to be sent. - * - * param base SAI base pointer. - * param channel Data channel used. - * param bitWidth How many bits in an audio word; usually 8/16/24/32 bits. - * param buffer Pointer to the data to be read. - * param size Bytes to be read. - */ -void SAI_ReadBlocking(I2S_Type *base, uint32_t channel, uint32_t bitWidth, uint8_t *buffer, uint32_t size) -{ - uint32_t i = 0; - uint32_t bytesPerWord = bitWidth / 8U; -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - bytesPerWord = base->RCR1 * bytesPerWord; -#endif - - while (i < size) - { - /* Wait until data is received */ - while (!(IS_SAI_FLAG_SET(base->RCSR, I2S_RCSR_FWF_MASK))) - { - } - - SAI_ReadNonBlocking(base, channel, 1UL << channel, channel, (uint8_t)bitWidth, buffer, bytesPerWord); - buffer = (uint8_t *)((uintptr_t)buffer + bytesPerWord); - i += bytesPerWord; - } -} - -/*! - * brief Initializes the SAI Tx handle. - * - * This function initializes the Tx handle for the SAI Tx transactional APIs. Call - * this function once to get the handle initialized. - * - * param base SAI base pointer - * param handle SAI handle pointer. - * param callback Pointer to the user callback function. - * param userData User parameter passed to the callback function - */ -void SAI_TransferTxCreateHandle(I2S_Type *base, sai_handle_t *handle, sai_transfer_callback_t callback, void *userData) -{ - assert(handle != NULL); - - /* Zero the handle */ - (void)memset(handle, 0, sizeof(*handle)); - - s_saiHandle[SAI_GetInstance(base)][0] = handle; - - handle->callback = callback; - handle->userData = userData; - handle->base = base; - - /* Set the isr pointer */ - s_saiTxIsr = SAI_TransferTxHandleIRQ; - - /* Enable Tx irq */ - (void)EnableIRQ(s_saiTxIRQ[SAI_GetInstance(base)]); -} - -/*! - * brief Initializes the SAI Rx handle. - * - * This function initializes the Rx handle for the SAI Rx transactional APIs. Call - * this function once to get the handle initialized. - * - * param base SAI base pointer. - * param handle SAI handle pointer. - * param callback Pointer to the user callback function. - * param userData User parameter passed to the callback function. - */ -void SAI_TransferRxCreateHandle(I2S_Type *base, sai_handle_t *handle, sai_transfer_callback_t callback, void *userData) -{ - assert(handle != NULL); - - /* Zero the handle */ - (void)memset(handle, 0, sizeof(*handle)); - - s_saiHandle[SAI_GetInstance(base)][1] = handle; - - handle->callback = callback; - handle->userData = userData; - handle->base = base; - - /* Set the isr pointer */ - s_saiRxIsr = SAI_TransferRxHandleIRQ; - - /* Enable Rx irq */ - (void)EnableIRQ(s_saiRxIRQ[SAI_GetInstance(base)]); -} - -/*! - * brief Performs an interrupt non-blocking send transfer on SAI. - * - * note This API returns immediately after the transfer initiates. - * Call the SAI_TxGetTransferStatusIRQ to poll the transfer status and check whether - * the transfer is finished. If the return status is not kStatus_SAI_Busy, the transfer - * is finished. - * - * param base SAI base pointer. - * param handle Pointer to the sai_handle_t structure which stores the transfer state. - * param xfer Pointer to the sai_transfer_t structure. - * retval kStatus_Success Successfully started the data receive. - * retval kStatus_SAI_TxBusy Previous receive still not finished. - * retval kStatus_InvalidArgument The input parameter is invalid. - */ -status_t SAI_TransferSendNonBlocking(I2S_Type *base, sai_handle_t *handle, sai_transfer_t *xfer) -{ - assert(handle != NULL); - assert(handle->channelNums <= (uint32_t)FSL_FEATURE_SAI_CHANNEL_COUNTn(base)); - - /* Check if the queue is full */ - if (handle->saiQueue[handle->queueUser].data != NULL) - { - return kStatus_SAI_QueueFull; - } - - /* Add into queue */ - handle->transferSize[handle->queueUser] = xfer->dataSize; - handle->saiQueue[handle->queueUser].data = xfer->data; - handle->saiQueue[handle->queueUser].dataSize = xfer->dataSize; - handle->queueUser = (handle->queueUser + 1U) % (uint8_t)SAI_XFER_QUEUE_SIZE; - - /* Set the state to busy */ - handle->state = (uint32_t)kSAI_Busy; - - /* Enable interrupt */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - /* Use FIFO request interrupt and fifo error*/ - SAI_TxEnableInterrupts(base, I2S_TCSR_FEIE_MASK | I2S_TCSR_FRIE_MASK); -#else - SAI_TxEnableInterrupts(base, I2S_TCSR_FEIE_MASK | I2S_TCSR_FWIE_MASK); -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ - - /* Enable Tx transfer */ - SAI_TxEnable(base, true); - - return kStatus_Success; -} - -/*! - * brief Performs an interrupt non-blocking receive transfer on SAI. - * - * note This API returns immediately after the transfer initiates. - * Call the SAI_RxGetTransferStatusIRQ to poll the transfer status and check whether - * the transfer is finished. If the return status is not kStatus_SAI_Busy, the transfer - * is finished. - * - * param base SAI base pointer - * param handle Pointer to the sai_handle_t structure which stores the transfer state. - * param xfer Pointer to the sai_transfer_t structure. - * retval kStatus_Success Successfully started the data receive. - * retval kStatus_SAI_RxBusy Previous receive still not finished. - * retval kStatus_InvalidArgument The input parameter is invalid. - */ -status_t SAI_TransferReceiveNonBlocking(I2S_Type *base, sai_handle_t *handle, sai_transfer_t *xfer) -{ - assert(handle != NULL); - assert(handle->channelNums <= (uint32_t)FSL_FEATURE_SAI_CHANNEL_COUNTn(base)); - - /* Check if the queue is full */ - if (handle->saiQueue[handle->queueUser].data != NULL) - { - return kStatus_SAI_QueueFull; - } - - /* Add into queue */ - handle->transferSize[handle->queueUser] = xfer->dataSize; - handle->saiQueue[handle->queueUser].data = xfer->data; - handle->saiQueue[handle->queueUser].dataSize = xfer->dataSize; - handle->queueUser = (handle->queueUser + 1U) % (uint8_t)SAI_XFER_QUEUE_SIZE; - - /* Set state to busy */ - handle->state = (uint32_t)kSAI_Busy; - -/* Enable interrupt */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - /* Use FIFO request interrupt and fifo error*/ - SAI_RxEnableInterrupts(base, I2S_TCSR_FEIE_MASK | I2S_TCSR_FRIE_MASK); -#else - SAI_RxEnableInterrupts(base, I2S_TCSR_FEIE_MASK | I2S_TCSR_FWIE_MASK); -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ - - /* Enable Rx transfer */ - SAI_RxEnable(base, true); - - return kStatus_Success; -} - -/*! - * brief Gets a set byte count. - * - * param base SAI base pointer. - * param handle Pointer to the sai_handle_t structure which stores the transfer state. - * param count Bytes count sent. - * retval kStatus_Success Succeed get the transfer count. - * retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t SAI_TransferGetSendCount(I2S_Type *base, sai_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - status_t status = kStatus_Success; - uint32_t queueDriverIndex = handle->queueDriver; - - if (handle->state != (uint32_t)kSAI_Busy) - { - status = kStatus_NoTransferInProgress; - } - else - { - *count = (handle->transferSize[queueDriverIndex] - handle->saiQueue[queueDriverIndex].dataSize); - } - - return status; -} - -/*! - * brief Gets a received byte count. - * - * param base SAI base pointer. - * param handle Pointer to the sai_handle_t structure which stores the transfer state. - * param count Bytes count received. - * retval kStatus_Success Succeed get the transfer count. - * retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t SAI_TransferGetReceiveCount(I2S_Type *base, sai_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - status_t status = kStatus_Success; - uint32_t queueDriverIndex = handle->queueDriver; - - if (handle->state != (uint32_t)kSAI_Busy) - { - status = kStatus_NoTransferInProgress; - } - else - { - *count = (handle->transferSize[queueDriverIndex] - handle->saiQueue[queueDriverIndex].dataSize); - } - - return status; -} - -/*! - * brief Aborts the current send. - * - * note This API can be called any time when an interrupt non-blocking transfer initiates - * to abort the transfer early. - * - * param base SAI base pointer. - * param handle Pointer to the sai_handle_t structure which stores the transfer state. - */ -void SAI_TransferAbortSend(I2S_Type *base, sai_handle_t *handle) -{ - assert(handle != NULL); - - /* Stop Tx transfer and disable interrupt */ - SAI_TxEnable(base, false); -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - /* Use FIFO request interrupt and fifo error */ - SAI_TxDisableInterrupts(base, I2S_TCSR_FEIE_MASK | I2S_TCSR_FRIE_MASK); -#else - SAI_TxDisableInterrupts(base, I2S_TCSR_FEIE_MASK | I2S_TCSR_FWIE_MASK); -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ - - handle->state = (uint32_t)kSAI_Idle; - - /* Clear the queue */ - (void)memset(handle->saiQueue, 0, sizeof(sai_transfer_t) * (uint8_t)SAI_XFER_QUEUE_SIZE); - handle->queueDriver = 0; - handle->queueUser = 0; -} - -/*! - * brief Aborts the current IRQ receive. - * - * note This API can be called when an interrupt non-blocking transfer initiates - * to abort the transfer early. - * - * param base SAI base pointer - * param handle Pointer to the sai_handle_t structure which stores the transfer state. - */ -void SAI_TransferAbortReceive(I2S_Type *base, sai_handle_t *handle) -{ - assert(handle != NULL); - - /* Stop Tx transfer and disable interrupt */ - SAI_RxEnable(base, false); -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - /* Use FIFO request interrupt and fifo error */ - SAI_RxDisableInterrupts(base, I2S_TCSR_FEIE_MASK | I2S_TCSR_FRIE_MASK); -#else - SAI_RxDisableInterrupts(base, I2S_TCSR_FEIE_MASK | I2S_TCSR_FWIE_MASK); -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ - - handle->state = (uint32_t)kSAI_Idle; - - /* Clear the queue */ - (void)memset(handle->saiQueue, 0, sizeof(sai_transfer_t) * (uint8_t)SAI_XFER_QUEUE_SIZE); - handle->queueDriver = 0; - handle->queueUser = 0; -} - -/*! - * brief Terminate all SAI send. - * - * This function will clear all transfer slots buffered in the sai queue. If users only want to abort the - * current transfer slot, please call SAI_TransferAbortSend. - * - * param base SAI base pointer. - * param handle SAI eDMA handle pointer. - */ -void SAI_TransferTerminateSend(I2S_Type *base, sai_handle_t *handle) -{ - assert(handle != NULL); - - /* Abort the current transfer */ - SAI_TransferAbortSend(base, handle); - - /* Clear all the internal information */ - (void)memset(handle->saiQueue, 0, sizeof(handle->saiQueue)); - (void)memset(handle->transferSize, 0, sizeof(handle->transferSize)); - - handle->queueUser = 0U; - handle->queueDriver = 0U; -} - -/*! - * brief Terminate all SAI receive. - * - * This function will clear all transfer slots buffered in the sai queue. If users only want to abort the - * current transfer slot, please call SAI_TransferAbortReceive. - * - * param base SAI base pointer. - * param handle SAI eDMA handle pointer. - */ -void SAI_TransferTerminateReceive(I2S_Type *base, sai_handle_t *handle) -{ - assert(handle != NULL); - - /* Abort the current transfer */ - SAI_TransferAbortReceive(base, handle); - - /* Clear all the internal information */ - (void)memset(handle->saiQueue, 0, sizeof(handle->saiQueue)); - (void)memset(handle->transferSize, 0, sizeof(handle->transferSize)); - - handle->queueUser = 0U; - handle->queueDriver = 0U; -} - -/*! - * brief Tx interrupt handler. - * - * param base SAI base pointer. - * param handle Pointer to the sai_handle_t structure. - */ -void SAI_TransferTxHandleIRQ(I2S_Type *base, sai_handle_t *handle) -{ - assert(handle != NULL); - - uint8_t *buffer = handle->saiQueue[handle->queueDriver].data; - uint32_t dataSize = (handle->bitWidth / 8UL) * handle->channelNums; - - /* Handle Error */ - if (IS_SAI_FLAG_SET(base->TCSR, I2S_TCSR_FEF_MASK)) - { - /* Clear FIFO error flag to continue transfer */ - SAI_TxClearStatusFlags(base, I2S_TCSR_FEF_MASK); - - /* Reset FIFO for safety */ - SAI_TxSoftwareReset(base, kSAI_ResetTypeFIFO); - - /* Call the callback */ - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_SAI_TxError, handle->userData); - } - } - -/* Handle transfer */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if (IS_SAI_FLAG_SET(base->TCSR, I2S_TCSR_FRF_MASK)) - { - /* Judge if the data need to transmit is less than space */ - size_t size = MIN((handle->saiQueue[handle->queueDriver].dataSize), - (size_t)(((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base) - handle->watermark) * dataSize)); - - /* Copy the data from sai buffer to FIFO */ - SAI_WriteNonBlocking(base, handle->channel, handle->channelMask, handle->endChannel, handle->bitWidth, buffer, - size); - - /* Update the internal counter */ - handle->saiQueue[handle->queueDriver].dataSize -= size; - handle->saiQueue[handle->queueDriver].data = (uint8_t *)((uintptr_t)buffer + size); - } -#else - if (IS_SAI_FLAG_SET(base->TCSR, I2S_TCSR_FWF_MASK)) - { - size_t size = MIN((handle->saiQueue[handle->queueDriver].dataSize), dataSize); - - SAI_WriteNonBlocking(base, handle->channel, handle->channelMask, handle->endChannel, handle->bitWidth, buffer, - size); - - /* Update internal counter */ - handle->saiQueue[handle->queueDriver].dataSize -= size; - handle->saiQueue[handle->queueDriver].data = (uint8_t *)((uintptr_t)buffer + size); - } -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ - - /* If finished a block, call the callback function */ - if (handle->saiQueue[handle->queueDriver].dataSize == 0U) - { - (void)memset(&handle->saiQueue[handle->queueDriver], 0, sizeof(sai_transfer_t)); - handle->queueDriver = (handle->queueDriver + 1U) % (uint8_t)SAI_XFER_QUEUE_SIZE; - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_SAI_TxIdle, handle->userData); - } - } - - /* If all data finished, just stop the transfer */ - if (handle->saiQueue[handle->queueDriver].data == NULL) - { - SAI_TransferAbortSend(base, handle); - } -} - -/*! - * brief Tx interrupt handler. - * - * param base SAI base pointer. - * param handle Pointer to the sai_handle_t structure. - */ -void SAI_TransferRxHandleIRQ(I2S_Type *base, sai_handle_t *handle) -{ - assert(handle != NULL); - - uint8_t *buffer = handle->saiQueue[handle->queueDriver].data; - uint32_t dataSize = (handle->bitWidth / 8UL) * handle->channelNums; - - /* Handle Error */ - if (IS_SAI_FLAG_SET(base->RCSR, I2S_RCSR_FEF_MASK)) - { - /* Clear FIFO error flag to continue transfer */ - SAI_RxClearStatusFlags(base, I2S_TCSR_FEF_MASK); - - /* Reset FIFO for safety */ - SAI_RxSoftwareReset(base, kSAI_ResetTypeFIFO); - - /* Call the callback */ - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_SAI_RxError, handle->userData); - } - } - -/* Handle transfer */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if (IS_SAI_FLAG_SET(base->RCSR, I2S_RCSR_FRF_MASK)) - { - /* Judge if the data need to transmit is less than space */ - size_t size = MIN((handle->saiQueue[handle->queueDriver].dataSize), handle->watermark * dataSize); - - /* Copy the data from sai buffer to FIFO */ - SAI_ReadNonBlocking(base, handle->channel, handle->channelMask, handle->endChannel, handle->bitWidth, buffer, - size); - - /* Update the internal counter */ - handle->saiQueue[handle->queueDriver].dataSize -= size; - handle->saiQueue[handle->queueDriver].data = (uint8_t *)((uintptr_t)buffer + size); - } -#else - if (IS_SAI_FLAG_SET(base->RCSR, I2S_RCSR_FWF_MASK)) - { - size_t size = MIN((handle->saiQueue[handle->queueDriver].dataSize), dataSize); - - SAI_ReadNonBlocking(base, handle->channel, handle->channelMask, handle->endChannel, handle->bitWidth, buffer, - size); - - /* Update internal state */ - handle->saiQueue[handle->queueDriver].dataSize -= size; - handle->saiQueue[handle->queueDriver].data = (uint8_t *)((uintptr_t)buffer + size); - } -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ - - /* If finished a block, call the callback function */ - if (handle->saiQueue[handle->queueDriver].dataSize == 0U) - { - (void)memset(&handle->saiQueue[handle->queueDriver], 0, sizeof(sai_transfer_t)); - handle->queueDriver = (handle->queueDriver + 1U) % (uint8_t)SAI_XFER_QUEUE_SIZE; - if (handle->callback != NULL) - { - (handle->callback)(base, handle, kStatus_SAI_RxIdle, handle->userData); - } - } - - /* If all data finished, just stop the transfer */ - if (handle->saiQueue[handle->queueDriver].data == NULL) - { - SAI_TransferAbortReceive(base, handle); - } -} - -#if defined(I2S0) -void I2S0_DriverIRQHandler(void); -void I2S0_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[0][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S0, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[0][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S0, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(I2S0, s_saiHandle[0][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[0][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S0, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[0][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S0, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(I2S0, s_saiHandle[0][0]); - } - SDK_ISR_EXIT_BARRIER; -} - -void I2S0_Tx_DriverIRQHandler(void); -void I2S0_Tx_DriverIRQHandler(void) -{ - assert(s_saiHandle[0][0] != NULL); - s_saiTxIsr(I2S0, s_saiHandle[0][0]); - SDK_ISR_EXIT_BARRIER; -} - -void I2S0_Rx_DriverIRQHandler(void); -void I2S0_Rx_DriverIRQHandler(void) -{ - assert(s_saiHandle[0][1] != NULL); - s_saiRxIsr(I2S0, s_saiHandle[0][1]); - SDK_ISR_EXIT_BARRIER; -} -#endif /* I2S0*/ - -#if defined(I2S1) -void I2S1_DriverIRQHandler(void); -void I2S1_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S1, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S1, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(I2S1, s_saiHandle[1][1]); - } - -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S1, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S1, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(I2S1, s_saiHandle[1][0]); - } - SDK_ISR_EXIT_BARRIER; -} - -void I2S1_Tx_DriverIRQHandler(void); -void I2S1_Tx_DriverIRQHandler(void) -{ - assert(s_saiHandle[1][0] != NULL); - s_saiTxIsr(I2S1, s_saiHandle[1][0]); - SDK_ISR_EXIT_BARRIER; -} - -void I2S1_Rx_DriverIRQHandler(void); -void I2S1_Rx_DriverIRQHandler(void) -{ - assert(s_saiHandle[1][1] != NULL); - s_saiRxIsr(I2S1, s_saiHandle[1][1]); - SDK_ISR_EXIT_BARRIER; -} -#endif /* I2S1*/ - -#if defined(I2S2) -void I2S2_DriverIRQHandler(void); -void I2S2_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[2][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S2, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[2][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S2, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(I2S2, s_saiHandle[2][1]); - } - -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[2][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S2, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[2][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S2, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(I2S2, s_saiHandle[2][0]); - } - SDK_ISR_EXIT_BARRIER; -} - -void I2S2_Tx_DriverIRQHandler(void); -void I2S2_Tx_DriverIRQHandler(void) -{ - assert(s_saiHandle[2][0] != NULL); - s_saiTxIsr(I2S2, s_saiHandle[2][0]); - SDK_ISR_EXIT_BARRIER; -} - -void I2S2_Rx_DriverIRQHandler(void); -void I2S2_Rx_DriverIRQHandler(void) -{ - assert(s_saiHandle[2][1] != NULL); - s_saiRxIsr(I2S2, s_saiHandle[2][1]); - SDK_ISR_EXIT_BARRIER; -} -#endif /* I2S2*/ - -#if defined(I2S3) -void I2S3_DriverIRQHandler(void); -void I2S3_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[3][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S3, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[3][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S3, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(I2S3, s_saiHandle[3][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[3][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S3, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[3][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S3, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(I2S3, s_saiHandle[3][0]); - } - SDK_ISR_EXIT_BARRIER; -} - -void I2S3_Tx_DriverIRQHandler(void); -void I2S3_Tx_DriverIRQHandler(void) -{ - assert(s_saiHandle[3][0] != NULL); - s_saiTxIsr(I2S3, s_saiHandle[3][0]); - SDK_ISR_EXIT_BARRIER; -} - -void I2S3_Rx_DriverIRQHandler(void); -void I2S3_Rx_DriverIRQHandler(void) -{ - assert(s_saiHandle[3][1] != NULL); - s_saiRxIsr(I2S3, s_saiHandle[3][1]); - SDK_ISR_EXIT_BARRIER; -} -#endif /* I2S3*/ - -#if defined(I2S4) -void I2S4_DriverIRQHandler(void); -void I2S4_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[4][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S4, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[4][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S4, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(I2S4, s_saiHandle[4][1]); - } - -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[4][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S4, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[4][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S4, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(I2S4, s_saiHandle[4][0]); - } - SDK_ISR_EXIT_BARRIER; -} - -void I2S4_Tx_DriverIRQHandler(void); -void I2S4_Tx_DriverIRQHandler(void) -{ - assert(s_saiHandle[4][0] != NULL); - s_saiTxIsr(I2S4, s_saiHandle[4][0]); - SDK_ISR_EXIT_BARRIER; -} - -void I2S4_Rx_DriverIRQHandler(void); -void I2S4_Rx_DriverIRQHandler(void) -{ - assert(s_saiHandle[4][1] != NULL); - s_saiRxIsr(I2S4, s_saiHandle[4][1]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(FSL_FEATURE_SAI_SAI5_SAI6_SHARE_IRQ) && (FSL_FEATURE_SAI_SAI5_SAI6_SHARE_IRQ) && defined(I2S5) && \ - defined(I2S6) -void I2S56_DriverIRQHandler(void); -void I2S56_DriverIRQHandler(void) -{ - /* use index 5 to get handle when I2S5 & I2S6 share IRQ NUMBER */ - I2S_Type *base = s_saiHandle[5][1]->base; -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[5][1] != NULL) && SAI_RxGetEnabledInterruptStatus(base, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[5][1] != NULL) && SAI_RxGetEnabledInterruptStatus(base, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(base, s_saiHandle[5][1]); - } - - base = s_saiHandle[5][0]->base; -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[5][0] != NULL) && SAI_TxGetEnabledInterruptStatus(base, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[5][0] != NULL) && SAI_TxGetEnabledInterruptStatus(base, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(base, s_saiHandle[5][0]); - } - SDK_ISR_EXIT_BARRIER; -} - -void I2S56_Tx_DriverIRQHandler(void); -void I2S56_Tx_DriverIRQHandler(void) -{ - /* use index 5 to get handle when I2S5 & I2S6 share IRQ NUMBER */ - assert(s_saiHandle[5][0] != NULL); - s_saiTxIsr(s_saiHandle[5][0]->base, s_saiHandle[5][0]); - SDK_ISR_EXIT_BARRIER; -} - -void I2S56_Rx_DriverIRQHandler(void); -void I2S56_Rx_DriverIRQHandler(void) -{ - /* use index 5 to get handle when I2S5 & I2S6 share IRQ NUMBER */ - assert(s_saiHandle[5][1] != NULL); - s_saiRxIsr(s_saiHandle[5][1]->base, s_saiHandle[5][1]); - SDK_ISR_EXIT_BARRIER; -} - -#else - -#if defined(I2S5) -void I2S5_DriverIRQHandler(void); -void I2S5_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[5][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S5, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[5][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S5, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(I2S5, s_saiHandle[5][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[5][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S5, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[5][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S5, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(I2S5, s_saiHandle[5][0]); - } - SDK_ISR_EXIT_BARRIER; -} - -void I2S5_Tx_DriverIRQHandler(void); -void I2S5_Tx_DriverIRQHandler(void) -{ - assert(s_saiHandle[5][0] != NULL); - s_saiTxIsr(I2S5, s_saiHandle[5][0]); - SDK_ISR_EXIT_BARRIER; -} - -void I2S5_Rx_DriverIRQHandler(void); -void I2S5_Rx_DriverIRQHandler(void) -{ - assert(s_saiHandle[5][1] != NULL); - s_saiRxIsr(I2S5, s_saiHandle[5][1]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(I2S6) -void I2S6_DriverIRQHandler(void); -void I2S6_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[6][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S6, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[6][1] != NULL) && SAI_RxGetEnabledInterruptStatus(I2S6, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(I2S6, s_saiHandle[6][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[6][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S6, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[6][0] != NULL) && SAI_TxGetEnabledInterruptStatus(I2S6, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(I2S6, s_saiHandle[6][0]); - } - SDK_ISR_EXIT_BARRIER; -} - -void I2S6_Tx_DriverIRQHandler(void); -void I2S6_Tx_DriverIRQHandler(void) -{ - assert(s_saiHandle[6][0] != NULL); - s_saiTxIsr(I2S6, s_saiHandle[6][0]); - SDK_ISR_EXIT_BARRIER; -} - -void I2S6_Rx_DriverIRQHandler(void); -void I2S6_Rx_DriverIRQHandler(void) -{ - assert(s_saiHandle[6][1] != NULL); - s_saiRxIsr(I2S6, s_saiHandle[6][1]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#endif - -#if defined(AUDIO__SAI0) -void AUDIO_SAI0_INT_DriverIRQHandler(void); -void AUDIO_SAI0_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[0][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI0, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[0][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI0, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(AUDIO__SAI0, s_saiHandle[0][1]); - } - -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[0][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI0, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[0][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI0, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(AUDIO__SAI0, s_saiHandle[0][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* AUDIO__SAI0 */ - -#if defined(AUDIO__SAI1) -void AUDIO_SAI1_INT_DriverIRQHandler(void); -void AUDIO_SAI1_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI1, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI1, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(AUDIO__SAI1, s_saiHandle[1][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI1, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI1, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(AUDIO__SAI1, s_saiHandle[1][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* AUDIO__SAI1 */ - -#if defined(AUDIO__SAI2) -void AUDIO_SAI2_INT_DriverIRQHandler(void); -void AUDIO_SAI2_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[2][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI2, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[2][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI2, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(AUDIO__SAI2, s_saiHandle[2][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[2][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI2, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[2][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI2, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(AUDIO__SAI2, s_saiHandle[2][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* AUDIO__SAI2 */ - -#if defined(AUDIO__SAI3) -void AUDIO_SAI3_INT_DriverIRQHandler(void); -void AUDIO_SAI3_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[3][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI3, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[3][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI3, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(AUDIO__SAI3, s_saiHandle[3][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[3][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI3, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[3][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI3, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(AUDIO__SAI3, s_saiHandle[3][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(AUDIO__SAI6) -void AUDIO_SAI6_INT_DriverIRQHandler(void); -void AUDIO_SAI6_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[6][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI6, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[6][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI6, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(AUDIO__SAI6, s_saiHandle[6][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[6][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI6, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[6][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI6, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(AUDIO__SAI6, s_saiHandle[6][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* AUDIO__SAI6 */ - -#if defined(AUDIO__SAI7) -void AUDIO_SAI7_INT_DriverIRQHandler(void); -void AUDIO_SAI7_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[7][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI7, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[7][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(AUDIO__SAI7, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(AUDIO__SAI7, s_saiHandle[7][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[7][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI7, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[7][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(AUDIO__SAI7, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(AUDIO__SAI7, s_saiHandle[7][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* AUDIO__SAI7 */ - -#if defined(ADMA__SAI0) -void ADMA_SAI0_INT_DriverIRQHandler(void); -void ADMA_SAI0_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI0, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI0, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(ADMA__SAI0, s_saiHandle[1][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI0, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI0, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(ADMA__SAI0, s_saiHandle[1][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* ADMA__SAI0 */ - -#if defined(ADMA__SAI1) -void ADMA_SAI1_INT_DriverIRQHandler(void); -void ADMA_SAI1_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI1, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI1, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(ADMA__SAI1, s_saiHandle[1][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI1, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI1, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(ADMA__SAI1, s_saiHandle[1][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* ADMA__SAI1 */ - -#if defined(ADMA__SAI2) -void ADMA_SAI2_INT_DriverIRQHandler(void); -void ADMA_SAI2_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI2, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI2, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(ADMA__SAI2, s_saiHandle[1][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI2, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI2, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(ADMA__SAI2, s_saiHandle[1][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* ADMA__SAI2 */ - -#if defined(ADMA__SAI3) -void ADMA_SAI3_INT_DriverIRQHandler(void); -void ADMA_SAI3_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI3, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI3, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(ADMA__SAI3, s_saiHandle[1][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI3, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI3, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(ADMA__SAI3, s_saiHandle[1][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* ADMA__SAI3 */ - -#if defined(ADMA__SAI4) -void ADMA_SAI4_INT_DriverIRQHandler(void); -void ADMA_SAI4_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI4, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI4, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(ADMA__SAI4, s_saiHandle[1][1]); - } - -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI4, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI4, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(ADMA__SAI4, s_saiHandle[1][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* ADMA__SAI4 */ - -#if defined(ADMA__SAI5) -void ADMA_SAI5_INT_DriverIRQHandler(void); -void ADMA_SAI5_INT_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI5, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][1] != NULL) && - SAI_RxGetEnabledInterruptStatus(ADMA__SAI5, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(ADMA__SAI5, s_saiHandle[1][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI5, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][0] != NULL) && - SAI_TxGetEnabledInterruptStatus(ADMA__SAI5, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(ADMA__SAI5, s_saiHandle[1][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* ADMA__SAI5 */ - -#if defined(SAI0) -void SAI0_DriverIRQHandler(void); -void SAI0_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[0][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI0, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[0][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI0, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(SAI0, s_saiHandle[0][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[0][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI0, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[0][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI0, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(SAI0, s_saiHandle[0][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* SAI0 */ - -#if defined(SAI1) -void SAI1_DriverIRQHandler(void); -void SAI1_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI1, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI1, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(SAI1, s_saiHandle[1][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[1][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI1, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[1][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI1, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(SAI1, s_saiHandle[1][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* SAI1 */ - -#if defined(SAI2) -void SAI2_DriverIRQHandler(void); -void SAI2_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[2][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI2, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[2][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI2, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(SAI2, s_saiHandle[2][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[2][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI2, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[2][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI2, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(SAI2, s_saiHandle[2][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* SAI2 */ - -#if defined(SAI3) -void SAI3_DriverIRQHandler(void); -void SAI3_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[3][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI3, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[3][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI3, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(SAI3, s_saiHandle[3][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[3][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI3, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[3][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI3, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(SAI3, s_saiHandle[3][0]); - } - SDK_ISR_EXIT_BARRIER; -} - -void SAI3_TX_DriverIRQHandler(void); -void SAI3_TX_DriverIRQHandler(void) -{ - assert(s_saiHandle[3][0] != NULL); - s_saiTxIsr(SAI3, s_saiHandle[3][0]); - SDK_ISR_EXIT_BARRIER; -} - -void SAI3_RX_DriverIRQHandler(void); -void SAI3_RX_DriverIRQHandler(void) -{ - assert(s_saiHandle[3][1] != NULL); - s_saiRxIsr(SAI3, s_saiHandle[3][1]); - SDK_ISR_EXIT_BARRIER; -} -#endif /* SAI3 */ - -#if defined(SAI4) -void SAI4_DriverIRQHandler(void); -void SAI4_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[4][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI4, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[4][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI4, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(SAI4, s_saiHandle[4][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[4][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI4, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[4][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI4, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(SAI4, s_saiHandle[4][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* SAI4 */ - -#if defined(SAI5) -void SAI5_DriverIRQHandler(void); -void SAI5_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[5][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI5, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[5][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI5, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(SAI5, s_saiHandle[5][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[5][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI5, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[5][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI5, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(SAI5, s_saiHandle[5][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* SAI5 */ - -#if defined(SAI6) -void SAI6_DriverIRQHandler(void); -void SAI6_DriverIRQHandler(void) -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[6][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI6, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[6][1] != NULL) && SAI_RxGetEnabledInterruptStatus(SAI6, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiRxIsr(SAI6, s_saiHandle[6][1]); - } -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - if ((s_saiHandle[6][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI6, (I2S_TCSR_FRIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FRF_MASK | I2S_TCSR_FEF_MASK))) -#else - if ((s_saiHandle[6][0] != NULL) && SAI_TxGetEnabledInterruptStatus(SAI6, (I2S_TCSR_FWIE_MASK | I2S_TCSR_FEIE_MASK), - (I2S_TCSR_FWF_MASK | I2S_TCSR_FEF_MASK))) -#endif - { - s_saiTxIsr(SAI6, s_saiHandle[6][0]); - } - SDK_ISR_EXIT_BARRIER; -} -#endif /* SAI6 */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_sai.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_sai.h deleted file mode 100644 index 16da4fd98e3..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_sai.h +++ /dev/null @@ -1,1437 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_SAI_H_ -#define FSL_SAI_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup sai_driver SAI Driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -#define FSL_SAI_DRIVER_VERSION (MAKE_VERSION(2, 4, 2)) /*!< Version 2.4.2 */ -/*! @} */ - -/*! @brief _sai_status_t, SAI return status.*/ -enum -{ - kStatus_SAI_TxBusy = MAKE_STATUS(kStatusGroup_SAI, 0), /*!< SAI Tx is busy. */ - kStatus_SAI_RxBusy = MAKE_STATUS(kStatusGroup_SAI, 1), /*!< SAI Rx is busy. */ - kStatus_SAI_TxError = MAKE_STATUS(kStatusGroup_SAI, 2), /*!< SAI Tx FIFO error. */ - kStatus_SAI_RxError = MAKE_STATUS(kStatusGroup_SAI, 3), /*!< SAI Rx FIFO error. */ - kStatus_SAI_QueueFull = MAKE_STATUS(kStatusGroup_SAI, 4), /*!< SAI transfer queue is full. */ - kStatus_SAI_TxIdle = MAKE_STATUS(kStatusGroup_SAI, 5), /*!< SAI Tx is idle */ - kStatus_SAI_RxIdle = MAKE_STATUS(kStatusGroup_SAI, 6) /*!< SAI Rx is idle */ -}; - -/*! @brief _sai_channel_mask,.sai channel mask value, actual channel numbers is depend soc specific */ -enum -{ - kSAI_Channel0Mask = 1 << 0U, /*!< channel 0 mask value */ - kSAI_Channel1Mask = 1 << 1U, /*!< channel 1 mask value */ - kSAI_Channel2Mask = 1 << 2U, /*!< channel 2 mask value */ - kSAI_Channel3Mask = 1 << 3U, /*!< channel 3 mask value */ - kSAI_Channel4Mask = 1 << 4U, /*!< channel 4 mask value */ - kSAI_Channel5Mask = 1 << 5U, /*!< channel 5 mask value */ - kSAI_Channel6Mask = 1 << 6U, /*!< channel 6 mask value */ - kSAI_Channel7Mask = 1 << 7U, /*!< channel 7 mask value */ -}; - -/*! @brief Define the SAI bus type */ -typedef enum _sai_protocol -{ - kSAI_BusLeftJustified = 0x0U, /*!< Uses left justified format.*/ - kSAI_BusRightJustified, /*!< Uses right justified format. */ - kSAI_BusI2S, /*!< Uses I2S format. */ - kSAI_BusPCMA, /*!< Uses I2S PCM A format.*/ - kSAI_BusPCMB /*!< Uses I2S PCM B format. */ -} sai_protocol_t; - -/*! @brief Master or slave mode */ -typedef enum _sai_master_slave -{ - kSAI_Master = 0x0U, /*!< Master mode include bclk and frame sync */ - kSAI_Slave = 0x1U, /*!< Slave mode include bclk and frame sync */ - kSAI_Bclk_Master_FrameSync_Slave = 0x2U, /*!< bclk in master mode, frame sync in slave mode */ - kSAI_Bclk_Slave_FrameSync_Master = 0x3U, /*!< bclk in slave mode, frame sync in master mode */ -} sai_master_slave_t; - -/*! @brief Mono or stereo audio format */ -typedef enum _sai_mono_stereo -{ - kSAI_Stereo = 0x0U, /*!< Stereo sound. */ - kSAI_MonoRight, /*!< Only Right channel have sound. */ - kSAI_MonoLeft /*!< Only left channel have sound. */ -} sai_mono_stereo_t; - -/*! @brief SAI data order, MSB or LSB */ -typedef enum _sai_data_order -{ - kSAI_DataLSB = 0x0U, /*!< LSB bit transferred first */ - kSAI_DataMSB /*!< MSB bit transferred first */ -} sai_data_order_t; - -/*! @brief SAI clock polarity, active high or low */ -typedef enum _sai_clock_polarity -{ - kSAI_PolarityActiveHigh = 0x0U, /*!< Drive outputs on rising edge */ - kSAI_PolarityActiveLow = 0x1U, /*!< Drive outputs on falling edge */ - kSAI_SampleOnFallingEdge = 0x0U, /*!< Sample inputs on falling edge */ - kSAI_SampleOnRisingEdge = 0x1U, /*!< Sample inputs on rising edge */ -} sai_clock_polarity_t; - -/*! @brief Synchronous or asynchronous mode */ -typedef enum _sai_sync_mode -{ - kSAI_ModeAsync = 0x0U, /*!< Asynchronous mode */ - kSAI_ModeSync, /*!< Synchronous mode (with receiver or transmit) */ -#if defined(FSL_FEATURE_SAI_HAS_SYNC_WITH_ANOTHER_SAI) && (FSL_FEATURE_SAI_HAS_SYNC_WITH_ANOTHER_SAI) - kSAI_ModeSyncWithOtherTx, /*!< Synchronous with another SAI transmit */ - kSAI_ModeSyncWithOtherRx /*!< Synchronous with another SAI receiver */ -#endif /* FSL_FEATURE_SAI_HAS_SYNC_WITH_ANOTHER_SAI */ -} sai_sync_mode_t; - -#if !(defined(FSL_FEATURE_SAI_HAS_NO_MCR_MICS) && (FSL_FEATURE_SAI_HAS_NO_MCR_MICS)) -/*! @brief Mater clock source */ -typedef enum _sai_mclk_source -{ - kSAI_MclkSourceSysclk = 0x0U, /*!< Master clock from the system clock */ - kSAI_MclkSourceSelect1, /*!< Master clock from source 1 */ - kSAI_MclkSourceSelect2, /*!< Master clock from source 2 */ - kSAI_MclkSourceSelect3 /*!< Master clock from source 3 */ -} sai_mclk_source_t; -#endif - -/*! @brief Bit clock source */ -typedef enum _sai_bclk_source -{ - kSAI_BclkSourceBusclk = 0x0U, /*!< Bit clock using bus clock */ - /* General device bit source definition */ - kSAI_BclkSourceMclkOption1 = 0x1U, /*!< Bit clock MCLK option 1 */ - kSAI_BclkSourceMclkOption2 = 0x2U, /*!< Bit clock MCLK option2 */ - kSAI_BclkSourceMclkOption3 = 0x3U, /*!< Bit clock MCLK option3 */ - /* Kinetis device bit clock source definition */ - kSAI_BclkSourceMclkDiv = 0x1U, /*!< Bit clock using master clock divider */ - kSAI_BclkSourceOtherSai0 = 0x2U, /*!< Bit clock from other SAI device */ - kSAI_BclkSourceOtherSai1 = 0x3U /*!< Bit clock from other SAI device */ -} sai_bclk_source_t; - -/*! @brief _sai_interrupt_enable_t, The SAI interrupt enable flag */ -enum -{ - kSAI_WordStartInterruptEnable = - I2S_TCSR_WSIE_MASK, /*!< Word start flag, means the first word in a frame detected */ - kSAI_SyncErrorInterruptEnable = I2S_TCSR_SEIE_MASK, /*!< Sync error flag, means the sync error is detected */ - kSAI_FIFOWarningInterruptEnable = I2S_TCSR_FWIE_MASK, /*!< FIFO warning flag, means the FIFO is empty */ - kSAI_FIFOErrorInterruptEnable = I2S_TCSR_FEIE_MASK, /*!< FIFO error flag */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - kSAI_FIFORequestInterruptEnable = I2S_TCSR_FRIE_MASK, /*!< FIFO request, means reached watermark */ -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ -}; - -/*! @brief _sai_dma_enable_t, The DMA request sources */ -enum -{ - kSAI_FIFOWarningDMAEnable = I2S_TCSR_FWDE_MASK, /*!< FIFO warning caused by the DMA request */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - kSAI_FIFORequestDMAEnable = I2S_TCSR_FRDE_MASK, /*!< FIFO request caused by the DMA request */ -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ -}; - -/*! @brief _sai_flags, The SAI status flag */ -enum -{ - kSAI_WordStartFlag = I2S_TCSR_WSF_MASK, /*!< Word start flag, means the first word in a frame detected */ - kSAI_SyncErrorFlag = I2S_TCSR_SEF_MASK, /*!< Sync error flag, means the sync error is detected */ - kSAI_FIFOErrorFlag = I2S_TCSR_FEF_MASK, /*!< FIFO error flag */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - kSAI_FIFORequestFlag = I2S_TCSR_FRF_MASK, /*!< FIFO request flag. */ -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ - kSAI_FIFOWarningFlag = I2S_TCSR_FWF_MASK, /*!< FIFO warning flag */ -}; - -/*! @brief The reset type */ -typedef enum _sai_reset_type -{ - kSAI_ResetTypeSoftware = I2S_TCSR_SR_MASK, /*!< Software reset, reset the logic state */ - kSAI_ResetTypeFIFO = I2S_TCSR_FR_MASK, /*!< FIFO reset, reset the FIFO read and write pointer */ - kSAI_ResetAll = I2S_TCSR_SR_MASK | I2S_TCSR_FR_MASK /*!< All reset. */ -} sai_reset_type_t; - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_PACKING) && FSL_FEATURE_SAI_HAS_FIFO_PACKING -/*! - * @brief The SAI packing mode - * The mode includes 8 bit and 16 bit packing. - */ -typedef enum _sai_fifo_packing -{ - kSAI_FifoPackingDisabled = 0x0U, /*!< Packing disabled */ - kSAI_FifoPacking8bit = 0x2U, /*!< 8 bit packing enabled */ - kSAI_FifoPacking16bit = 0x3U /*!< 16bit packing enabled */ -} sai_fifo_packing_t; -#endif /* FSL_FEATURE_SAI_HAS_FIFO_PACKING */ - -/*! @brief SAI user configuration structure */ -typedef struct _sai_config -{ - sai_protocol_t protocol; /*!< Audio bus protocol in SAI */ - sai_sync_mode_t syncMode; /*!< SAI sync mode, control Tx/Rx clock sync */ -#if defined(FSL_FEATURE_SAI_HAS_MCR) && (FSL_FEATURE_SAI_HAS_MCR) - bool mclkOutputEnable; /*!< Master clock output enable, true means master clock divider enabled */ -#if !(defined(FSL_FEATURE_SAI_HAS_NO_MCR_MICS) && (FSL_FEATURE_SAI_HAS_NO_MCR_MICS)) - sai_mclk_source_t mclkSource; /*!< Master Clock source */ -#endif /* FSL_FEATURE_SAI_HAS_MCR */ -#endif - sai_bclk_source_t bclkSource; /*!< Bit Clock source */ - sai_master_slave_t masterSlave; /*!< Master or slave */ -} sai_config_t; - -#ifndef SAI_XFER_QUEUE_SIZE -/*!@brief SAI transfer queue size, user can refine it according to use case. */ -#define SAI_XFER_QUEUE_SIZE (4U) -#endif - -/*! @brief Audio sample rate */ -typedef enum _sai_sample_rate -{ - kSAI_SampleRate8KHz = 8000U, /*!< Sample rate 8000 Hz */ - kSAI_SampleRate11025Hz = 11025U, /*!< Sample rate 11025 Hz */ - kSAI_SampleRate12KHz = 12000U, /*!< Sample rate 12000 Hz */ - kSAI_SampleRate16KHz = 16000U, /*!< Sample rate 16000 Hz */ - kSAI_SampleRate22050Hz = 22050U, /*!< Sample rate 22050 Hz */ - kSAI_SampleRate24KHz = 24000U, /*!< Sample rate 24000 Hz */ - kSAI_SampleRate32KHz = 32000U, /*!< Sample rate 32000 Hz */ - kSAI_SampleRate44100Hz = 44100U, /*!< Sample rate 44100 Hz */ - kSAI_SampleRate48KHz = 48000U, /*!< Sample rate 48000 Hz */ - kSAI_SampleRate96KHz = 96000U, /*!< Sample rate 96000 Hz */ - kSAI_SampleRate192KHz = 192000U, /*!< Sample rate 192000 Hz */ - kSAI_SampleRate384KHz = 384000U, /*!< Sample rate 384000 Hz */ -} sai_sample_rate_t; - -/*! @brief Audio word width */ -typedef enum _sai_word_width -{ - kSAI_WordWidth8bits = 8U, /*!< Audio data width 8 bits */ - kSAI_WordWidth16bits = 16U, /*!< Audio data width 16 bits */ - kSAI_WordWidth24bits = 24U, /*!< Audio data width 24 bits */ - kSAI_WordWidth32bits = 32U /*!< Audio data width 32 bits */ -} sai_word_width_t; - -#if defined(FSL_FEATURE_SAI_HAS_CHANNEL_MODE) && FSL_FEATURE_SAI_HAS_CHANNEL_MODE -/*! @brief sai data pin state definition */ -typedef enum _sai_data_pin_state -{ - kSAI_DataPinStateTriState = - 0U, /*!< transmit data pins are tri-stated when slots are masked or channels are disabled */ - kSAI_DataPinStateOutputZero = 1U, /*!< transmit data pins are never tri-stated and will output zero when slots - are masked or channel disabled */ -} sai_data_pin_state_t; -#endif - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE -/*! @brief sai fifo combine mode definition */ -typedef enum _sai_fifo_combine -{ - kSAI_FifoCombineDisabled = 0U, /*!< sai fifo combine mode disabled */ - kSAI_FifoCombineModeEnabledOnRead, /*!< sai fifo combine mode enabled on FIFO reads */ - kSAI_FifoCombineModeEnabledOnWrite, /*!< sai fifo combine mode enabled on FIFO write */ - kSAI_FifoCombineModeEnabledOnReadWrite, /*!< sai fifo combined mode enabled on FIFO read/writes */ -} sai_fifo_combine_t; -#endif - -/*! @brief sai transceiver type */ -typedef enum _sai_transceiver_type -{ - kSAI_Transmitter = 0U, /*!< sai transmitter */ - kSAI_Receiver = 1U, /*!< sai receiver */ -} sai_transceiver_type_t; - -/*! @brief sai frame sync len */ -typedef enum _sai_frame_sync_len -{ - kSAI_FrameSyncLenOneBitClk = 0U, /*!< 1 bit clock frame sync len for DSP mode */ - kSAI_FrameSyncLenPerWordWidth = 1U, /*!< Frame sync length decided by word width */ -} sai_frame_sync_len_t; - -/*! @brief sai transfer format */ -typedef struct _sai_transfer_format -{ - uint32_t sampleRate_Hz; /*!< Sample rate of audio data */ - uint32_t bitWidth; /*!< Data length of audio data, usually 8/16/24/32 bits */ - sai_mono_stereo_t stereo; /*!< Mono or stereo */ -#if defined(FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) && (FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) - uint32_t masterClockHz; /*!< Master clock frequency in Hz */ -#endif /* FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - uint8_t watermark; /*!< Watermark value */ -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ - - /* for the multi channel usage, user can provide channelMask Oonly, then sai driver will handle - * other parameter carefully, such as - * channelMask = kSAI_Channel0Mask | kSAI_Channel1Mask | kSAI_Channel4Mask - * then in SAI_RxSetFormat/SAI_TxSetFormat function, channel/endChannel/channelNums will be calculated. - * for the single channel usage, user can provide channel or channel mask only, such as, - * channel = 0 or channelMask = kSAI_Channel0Mask. - */ - uint8_t channel; /*!< Transfer start channel */ - uint8_t channelMask; /*!< enabled channel mask value, reference _sai_channel_mask */ - uint8_t endChannel; /*!< end channel number */ - uint8_t channelNums; /*!< Total enabled channel numbers */ - - sai_protocol_t protocol; /*!< Which audio protocol used */ - bool isFrameSyncCompact; /*!< True means Frame sync length is configurable according to bitWidth, false means frame - sync length is 64 times of bit clock. */ -} sai_transfer_format_t; - -#if (defined(FSL_FEATURE_SAI_HAS_MCR) && (FSL_FEATURE_SAI_HAS_MCR)) || \ - (defined(FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) && (FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER)) -/*! @brief master clock configurations */ -typedef struct _sai_master_clock -{ -#if defined(FSL_FEATURE_SAI_HAS_MCR) && (FSL_FEATURE_SAI_HAS_MCR) - bool mclkOutputEnable; /*!< master clock output enable */ -#if !(defined(FSL_FEATURE_SAI_HAS_NO_MCR_MICS) && (FSL_FEATURE_SAI_HAS_NO_MCR_MICS)) - sai_mclk_source_t mclkSource; /*!< Master Clock source */ -#endif -#endif - -#if (defined(FSL_FEATURE_SAI_HAS_MCR) && (FSL_FEATURE_SAI_HAS_MCR)) || \ - (defined(FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) && (FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER)) - uint32_t mclkHz; /*!< target mclk frequency */ - uint32_t mclkSourceClkHz; /*!< mclk source frequency*/ -#endif -} sai_master_clock_t; -#endif - -/*! @brief sai fifo feature*/ -#if (defined(FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) && FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) || \ - (defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) || \ - (defined(FSL_FEATURE_SAI_HAS_FIFO_PACKING) && FSL_FEATURE_SAI_HAS_FIFO_PACKING) || \ - (defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO)) -#define FSL_SAI_HAS_FIFO_EXTEND_FEATURE 1 -#else -#define FSL_SAI_HAS_FIFO_EXTEND_FEATURE 0 -#endif - -#if FSL_SAI_HAS_FIFO_EXTEND_FEATURE -/*! @brief sai fifo configurations */ -typedef struct _sai_fifo -{ -#if defined(FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) && FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR - bool fifoContinueOneError; /*!< fifo continues when error occur */ -#endif - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE - sai_fifo_combine_t fifoCombine; /*!< fifo combine mode */ -#endif - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_PACKING) && FSL_FEATURE_SAI_HAS_FIFO_PACKING - sai_fifo_packing_t fifoPacking; /*!< fifo packing mode */ -#endif -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - uint8_t fifoWatermark; /*!< fifo watermark */ -#endif -} sai_fifo_t; -#endif - -/*! @brief sai bit clock configurations */ -typedef struct _sai_bit_clock -{ - bool bclkSrcSwap; /*!< bit clock source swap */ - bool bclkInputDelay; /*!< bit clock actually used by the transmitter is delayed by the pad output delay, - this has effect of decreasing the data input setup time, but increasing the data output valid - time .*/ - sai_clock_polarity_t bclkPolarity; /*!< bit clock polarity */ - sai_bclk_source_t bclkSource; /*!< bit Clock source */ -} sai_bit_clock_t; - -/*! @brief sai frame sync configurations */ -typedef struct _sai_frame_sync -{ - uint8_t frameSyncWidth; /*!< frame sync width in number of bit clocks */ - bool frameSyncEarly; /*!< TRUE is frame sync assert one bit before the first bit of frame - FALSE is frame sync assert with the first bit of the frame */ - -#if defined(FSL_FEATURE_SAI_HAS_ON_DEMAND_MODE) && FSL_FEATURE_SAI_HAS_ON_DEMAND_MODE - bool frameSyncGenerateOnDemand; /*!< internal frame sync is generated when FIFO waring flag is clear */ -#endif - - sai_clock_polarity_t frameSyncPolarity; /*!< frame sync polarity */ - -} sai_frame_sync_t; - -/*! @brief sai serial data configurations */ -typedef struct _sai_serial_data -{ -#if defined(FSL_FEATURE_SAI_HAS_CHANNEL_MODE) && FSL_FEATURE_SAI_HAS_CHANNEL_MODE - sai_data_pin_state_t dataMode; /*!< sai data pin state when slots masked or channel disabled */ -#endif - - sai_data_order_t dataOrder; /*!< configure whether the LSB or MSB is transmitted first */ - uint8_t dataWord0Length; /*!< configure the number of bits in the first word in each frame */ - uint8_t dataWordNLength; /*!< configure the number of bits in the each word in each frame, except the first word */ - uint8_t dataWordLength; /*!< used to record the data length for dma transfer */ - uint8_t - dataFirstBitShifted; /*!< Configure the bit index for the first bit transmitted for each word in the frame */ - uint8_t dataWordNum; /*!< configure the number of words in each frame */ - uint32_t dataMaskedWord; /*!< configure whether the transmit word is masked */ -} sai_serial_data_t; - -/*! @brief sai transceiver configurations */ -typedef struct _sai_transceiver -{ - sai_serial_data_t serialData; /*!< serial data configurations */ - sai_frame_sync_t frameSync; /*!< ws configurations */ - sai_bit_clock_t bitClock; /*!< bit clock configurations */ -#if FSL_SAI_HAS_FIFO_EXTEND_FEATURE - sai_fifo_t fifo; /*!< fifo configurations */ -#endif - sai_master_slave_t masterSlave; /*!< transceiver is master or slave */ - - sai_sync_mode_t syncMode; /*!< transceiver sync mode */ - - uint8_t startChannel; /*!< Transfer start channel */ - uint8_t channelMask; /*!< enabled channel mask value, reference _sai_channel_mask */ - uint8_t endChannel; /*!< end channel number */ - uint8_t channelNums; /*!< Total enabled channel numbers */ - -} sai_transceiver_t; - -/*! @brief SAI transfer structure */ -typedef struct _sai_transfer -{ - uint8_t *data; /*!< Data start address to transfer. */ - size_t dataSize; /*!< Transfer size. */ -} sai_transfer_t; - -typedef struct _sai_handle sai_handle_t; - -/*! @brief SAI transfer callback prototype */ -typedef void (*sai_transfer_callback_t)(I2S_Type *base, sai_handle_t *handle, status_t status, void *userData); - -/*! @brief SAI handle structure */ -struct _sai_handle -{ - I2S_Type *base; /*!< base address */ - - uint32_t state; /*!< Transfer status */ - sai_transfer_callback_t callback; /*!< Callback function called at transfer event*/ - void *userData; /*!< Callback parameter passed to callback function*/ - uint8_t bitWidth; /*!< Bit width for transfer, 8/16/24/32 bits */ - - /* for the multi channel usage, user can provide channelMask Oonly, then sai driver will handle - * other parameter carefully, such as - * channelMask = kSAI_Channel0Mask | kSAI_Channel1Mask | kSAI_Channel4Mask - * then in SAI_RxSetFormat/SAI_TxSetFormat function, channel/endChannel/channelNums will be calculated. - * for the single channel usage, user can provide channel or channel mask only, such as, - * channel = 0 or channelMask = kSAI_Channel0Mask. - */ - uint8_t channel; /*!< Transfer start channel */ - uint8_t channelMask; /*!< enabled channel mask value, refernece _sai_channel_mask */ - uint8_t endChannel; /*!< end channel number */ - uint8_t channelNums; /*!< Total enabled channel numbers */ - - sai_transfer_t saiQueue[SAI_XFER_QUEUE_SIZE]; /*!< Transfer queue storing queued transfer */ - size_t transferSize[SAI_XFER_QUEUE_SIZE]; /*!< Data bytes need to transfer */ - volatile uint8_t queueUser; /*!< Index for user to queue transfer */ - volatile uint8_t queueDriver; /*!< Index for driver to get the transfer data and size */ -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - uint8_t watermark; /*!< Watermark value */ -#endif -}; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus*/ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Initializes the SAI peripheral. - * - * This API gates the SAI clock. The SAI module can't operate unless SAI_Init is called to enable the clock. - * - * @param base SAI base pointer. - */ -void SAI_Init(I2S_Type *base); - -/*! - * @brief De-initializes the SAI peripheral. - * - * This API gates the SAI clock. The SAI module can't operate unless SAI_TxInit - * or SAI_RxInit is called to enable the clock. - * - * @param base SAI base pointer. - */ -void SAI_Deinit(I2S_Type *base); - -/*! - * @brief Resets the SAI Tx. - * - * This function enables the software reset and FIFO reset of SAI Tx. After reset, clear the reset bit. - * - * @param base SAI base pointer - */ -void SAI_TxReset(I2S_Type *base); - -/*! - * @brief Resets the SAI Rx. - * - * This function enables the software reset and FIFO reset of SAI Rx. After reset, clear the reset bit. - * - * @param base SAI base pointer - */ -void SAI_RxReset(I2S_Type *base); - -/*! - * @brief Enables/disables the SAI Tx. - * - * @param base SAI base pointer. - * @param enable True means enable SAI Tx, false means disable. - */ -void SAI_TxEnable(I2S_Type *base, bool enable); - -/*! - * @brief Enables/disables the SAI Rx. - * - * @param base SAI base pointer. - * @param enable True means enable SAI Rx, false means disable. - */ -void SAI_RxEnable(I2S_Type *base, bool enable); - -/*! - * @brief Set Rx bit clock direction. - * - * Select bit clock direction, master or slave. - * - * @param base SAI base pointer. - * @param masterSlave reference sai_master_slave_t. - */ -static inline void SAI_TxSetBitClockDirection(I2S_Type *base, sai_master_slave_t masterSlave) -{ - if (masterSlave == kSAI_Master) - { - base->TCR2 |= I2S_TCR2_BCD_MASK; - } - else - { - base->TCR2 &= ~I2S_TCR2_BCD_MASK; - } -} - -/*! - * @brief Set Rx bit clock direction. - * - * Select bit clock direction, master or slave. - * - * @param base SAI base pointer. - * @param masterSlave reference sai_master_slave_t. - */ -static inline void SAI_RxSetBitClockDirection(I2S_Type *base, sai_master_slave_t masterSlave) -{ - if (masterSlave == kSAI_Master) - { - base->RCR2 |= I2S_RCR2_BCD_MASK; - } - else - { - base->RCR2 &= ~I2S_RCR2_BCD_MASK; - } -} - -/*! - * @brief Set Rx frame sync direction. - * - * Select frame sync direction, master or slave. - * - * @param base SAI base pointer. - * @param masterSlave reference sai_master_slave_t. - */ -static inline void SAI_RxSetFrameSyncDirection(I2S_Type *base, sai_master_slave_t masterSlave) -{ - if (masterSlave == kSAI_Master) - { - base->RCR4 |= I2S_RCR4_FSD_MASK; - } - else - { - base->RCR4 &= ~I2S_RCR4_FSD_MASK; - } -} - -/*! - * @brief Set Tx frame sync direction. - * - * Select frame sync direction, master or slave. - * - * @param base SAI base pointer. - * @param masterSlave reference sai_master_slave_t. - */ -static inline void SAI_TxSetFrameSyncDirection(I2S_Type *base, sai_master_slave_t masterSlave) -{ - if (masterSlave == kSAI_Master) - { - base->TCR4 |= I2S_TCR4_FSD_MASK; - } - else - { - base->TCR4 &= ~I2S_TCR4_FSD_MASK; - } -} - -/*! - * @brief Transmitter bit clock rate configurations. - * - * @param base SAI base pointer. - * @param sourceClockHz Bit clock source frequency. - * @param sampleRate Audio data sample rate. - * @param bitWidth Audio data bitWidth. - * @param channelNumbers Audio channel numbers. - */ -void SAI_TxSetBitClockRate( - I2S_Type *base, uint32_t sourceClockHz, uint32_t sampleRate, uint32_t bitWidth, uint32_t channelNumbers); - -/*! - * @brief Receiver bit clock rate configurations. - * - * @param base SAI base pointer. - * @param sourceClockHz Bit clock source frequency. - * @param sampleRate Audio data sample rate. - * @param bitWidth Audio data bitWidth. - * @param channelNumbers Audio channel numbers. - */ -void SAI_RxSetBitClockRate( - I2S_Type *base, uint32_t sourceClockHz, uint32_t sampleRate, uint32_t bitWidth, uint32_t channelNumbers); - -/*! - * @brief Transmitter Bit clock configurations. - * - * @param base SAI base pointer. - * @param masterSlave master or slave. - * @param config bit clock other configurations, can be NULL in slave mode. - */ -void SAI_TxSetBitclockConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_bit_clock_t *config); - -/*! - * @brief Receiver Bit clock configurations. - * - * @param base SAI base pointer. - * @param masterSlave master or slave. - * @param config bit clock other configurations, can be NULL in slave mode. - */ -void SAI_RxSetBitclockConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_bit_clock_t *config); - -#if (defined(FSL_FEATURE_SAI_HAS_MCR) && (FSL_FEATURE_SAI_HAS_MCR)) || \ - (defined(FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) && (FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER)) -/*! - * @brief Master clock configurations. - * - * @param base SAI base pointer. - * @param config master clock configurations. - */ -void SAI_SetMasterClockConfig(I2S_Type *base, sai_master_clock_t *config); -#endif - -#if FSL_SAI_HAS_FIFO_EXTEND_FEATURE -/*! - * @brief SAI transmitter fifo configurations. - * - * @param base SAI base pointer. - * @param config fifo configurations. - */ -void SAI_TxSetFifoConfig(I2S_Type *base, sai_fifo_t *config); - -/*! - * @brief SAI receiver fifo configurations. - * - * @param base SAI base pointer. - * @param config fifo configurations. - */ -void SAI_RxSetFifoConfig(I2S_Type *base, sai_fifo_t *config); -#endif - -/*! - * @brief SAI transmitter Frame sync configurations. - * - * @param base SAI base pointer. - * @param masterSlave master or slave. - * @param config frame sync configurations, can be NULL in slave mode. - */ -void SAI_TxSetFrameSyncConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_frame_sync_t *config); - -/*! - * @brief SAI receiver Frame sync configurations. - * - * @param base SAI base pointer. - * @param masterSlave master or slave. - * @param config frame sync configurations, can be NULL in slave mode. - */ -void SAI_RxSetFrameSyncConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_frame_sync_t *config); - -/*! - * @brief SAI transmitter Serial data configurations. - * - * @param base SAI base pointer. - * @param config serial data configurations. - */ -void SAI_TxSetSerialDataConfig(I2S_Type *base, sai_serial_data_t *config); - -/*! - * @brief SAI receiver Serial data configurations. - * - * @param base SAI base pointer. - * @param config serial data configurations. - */ -void SAI_RxSetSerialDataConfig(I2S_Type *base, sai_serial_data_t *config); - -/*! - * @brief SAI transmitter configurations. - * - * @param base SAI base pointer. - * @param config transmitter configurations. - */ -void SAI_TxSetConfig(I2S_Type *base, sai_transceiver_t *config); - -/*! - * @brief SAI receiver configurations. - * - * @param base SAI base pointer. - * @param config receiver configurations. - */ -void SAI_RxSetConfig(I2S_Type *base, sai_transceiver_t *config); - -/*! - * @brief Get classic I2S mode configurations. - * - * @param config transceiver configurations. - * @param bitWidth audio data bitWidth. - * @param mode audio data channel. - * @param saiChannelMask mask value of the channel to be enable. - */ -void SAI_GetClassicI2SConfig(sai_transceiver_t *config, - sai_word_width_t bitWidth, - sai_mono_stereo_t mode, - uint32_t saiChannelMask); - -/*! - * @brief Get left justified mode configurations. - * - * @param config transceiver configurations. - * @param bitWidth audio data bitWidth. - * @param mode audio data channel. - * @param saiChannelMask mask value of the channel to be enable. - */ -void SAI_GetLeftJustifiedConfig(sai_transceiver_t *config, - sai_word_width_t bitWidth, - sai_mono_stereo_t mode, - uint32_t saiChannelMask); - -/*! - * @brief Get right justified mode configurations. - * - * @param config transceiver configurations. - * @param bitWidth audio data bitWidth. - * @param mode audio data channel. - * @param saiChannelMask mask value of the channel to be enable. - */ -void SAI_GetRightJustifiedConfig(sai_transceiver_t *config, - sai_word_width_t bitWidth, - sai_mono_stereo_t mode, - uint32_t saiChannelMask); - -/*! - * @brief Get TDM mode configurations. - * - * @param config transceiver configurations. - * @param frameSyncWidth length of frame sync. - * @param bitWidth audio data word width. - * @param dataWordNum word number in one frame. - * @param saiChannelMask mask value of the channel to be enable. - */ -void SAI_GetTDMConfig(sai_transceiver_t *config, - sai_frame_sync_len_t frameSyncWidth, - sai_word_width_t bitWidth, - uint32_t dataWordNum, - uint32_t saiChannelMask); - -/*! - * @brief Get DSP mode configurations. - * - * @note DSP mode is also called PCM mode which support MODE A and MODE B, - * DSP/PCM MODE A configuration flow. RX is similiar but uses SAI_RxSetConfig instead of SAI_TxSetConfig: - * @code - * SAI_GetDSPConfig(config, kSAI_FrameSyncLenOneBitClk, bitWidth, kSAI_Stereo, channelMask) - * config->frameSync.frameSyncEarly = true; - * SAI_TxSetConfig(base, config) - * @endcode - * - * DSP/PCM MODE B configuration flow for TX. RX is similiar but uses SAI_RxSetConfig instead of SAI_TxSetConfig: - * @code - * SAI_GetDSPConfig(config, kSAI_FrameSyncLenOneBitClk, bitWidth, kSAI_Stereo, channelMask) - * SAI_TxSetConfig(base, config) - * @endcode - * - * @param config transceiver configurations. - * @param frameSyncWidth length of frame sync. - * @param bitWidth audio data bitWidth. - * @param mode audio data channel. - * @param saiChannelMask mask value of the channel to enable. - */ -void SAI_GetDSPConfig(sai_transceiver_t *config, - sai_frame_sync_len_t frameSyncWidth, - sai_word_width_t bitWidth, - sai_mono_stereo_t mode, - uint32_t saiChannelMask); -/*! @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets the SAI Tx status flag state. - * - * @param base SAI base pointer - * @return SAI Tx status flag value. Use the Status Mask to get the status value needed. - */ -static inline uint32_t SAI_TxGetStatusFlag(I2S_Type *base) -{ - return base->TCSR; -} - -/*! - * @brief Clears the SAI Tx status flag state. - * - * @param base SAI base pointer - * @param mask State mask. It can be a combination of the following source if defined: - * @arg kSAI_WordStartFlag - * @arg kSAI_SyncErrorFlag - * @arg kSAI_FIFOErrorFlag - */ -static inline void SAI_TxClearStatusFlags(I2S_Type *base, uint32_t mask) -{ - base->TCSR = ((base->TCSR & 0xFFE3FFFFU) | mask); -} - -/*! - * @brief Gets the SAI Tx status flag state. - * - * @param base SAI base pointer - * @return SAI Rx status flag value. Use the Status Mask to get the status value needed. - */ -static inline uint32_t SAI_RxGetStatusFlag(I2S_Type *base) -{ - return base->RCSR; -} - -/*! - * @brief Clears the SAI Rx status flag state. - * - * @param base SAI base pointer - * @param mask State mask. It can be a combination of the following sources if defined. - * @arg kSAI_WordStartFlag - * @arg kSAI_SyncErrorFlag - * @arg kSAI_FIFOErrorFlag - */ -static inline void SAI_RxClearStatusFlags(I2S_Type *base, uint32_t mask) -{ - base->RCSR = ((base->RCSR & 0xFFE3FFFFU) | mask); -} - -/*! - * @brief Do software reset or FIFO reset . - * - * FIFO reset means clear all the data in the FIFO, and make the FIFO pointer both to 0. - * Software reset means clear the Tx internal logic, including the bit clock, frame count etc. But software - * reset will not clear any configuration registers like TCR1~TCR5. - * This function will also clear all the error flags such as FIFO error, sync error etc. - * - * @param base SAI base pointer - * @param resetType Reset type, FIFO reset or software reset - */ -void SAI_TxSoftwareReset(I2S_Type *base, sai_reset_type_t resetType); - -/*! - * @brief Do software reset or FIFO reset . - * - * FIFO reset means clear all the data in the FIFO, and make the FIFO pointer both to 0. - * Software reset means clear the Rx internal logic, including the bit clock, frame count etc. But software - * reset will not clear any configuration registers like RCR1~RCR5. - * This function will also clear all the error flags such as FIFO error, sync error etc. - * - * @param base SAI base pointer - * @param resetType Reset type, FIFO reset or software reset - */ -void SAI_RxSoftwareReset(I2S_Type *base, sai_reset_type_t resetType); - -/*! - * @brief Set the Tx channel FIFO enable mask. - * - * @param base SAI base pointer - * @param mask Channel enable mask, 0 means all channel FIFO disabled, 1 means channel 0 enabled, - * 3 means both channel 0 and channel 1 enabled. - */ -void SAI_TxSetChannelFIFOMask(I2S_Type *base, uint8_t mask); - -/*! - * @brief Set the Rx channel FIFO enable mask. - * - * @param base SAI base pointer - * @param mask Channel enable mask, 0 means all channel FIFO disabled, 1 means channel 0 enabled, - * 3 means both channel 0 and channel 1 enabled. - */ -void SAI_RxSetChannelFIFOMask(I2S_Type *base, uint8_t mask); - -/*! - * @brief Set the Tx data order. - * - * @param base SAI base pointer - * @param order Data order MSB or LSB - */ -void SAI_TxSetDataOrder(I2S_Type *base, sai_data_order_t order); - -/*! - * @brief Set the Rx data order. - * - * @param base SAI base pointer - * @param order Data order MSB or LSB - */ -void SAI_RxSetDataOrder(I2S_Type *base, sai_data_order_t order); - -/*! - * @brief Set the Tx data order. - * - * @param base SAI base pointer - * @param polarity - */ -void SAI_TxSetBitClockPolarity(I2S_Type *base, sai_clock_polarity_t polarity); - -/*! - * @brief Set the Rx data order. - * - * @param base SAI base pointer - * @param polarity - */ -void SAI_RxSetBitClockPolarity(I2S_Type *base, sai_clock_polarity_t polarity); - -/*! - * @brief Set the Tx data order. - * - * @param base SAI base pointer - * @param polarity - */ -void SAI_TxSetFrameSyncPolarity(I2S_Type *base, sai_clock_polarity_t polarity); - -/*! - * @brief Set the Rx data order. - * - * @param base SAI base pointer - * @param polarity - */ -void SAI_RxSetFrameSyncPolarity(I2S_Type *base, sai_clock_polarity_t polarity); - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_PACKING) && FSL_FEATURE_SAI_HAS_FIFO_PACKING -/*! - * @brief Set Tx FIFO packing feature. - * - * @param base SAI base pointer. - * @param pack FIFO pack type. It is element of sai_fifo_packing_t. - */ -void SAI_TxSetFIFOPacking(I2S_Type *base, sai_fifo_packing_t pack); - -/*! - * @brief Set Rx FIFO packing feature. - * - * @param base SAI base pointer. - * @param pack FIFO pack type. It is element of sai_fifo_packing_t. - */ -void SAI_RxSetFIFOPacking(I2S_Type *base, sai_fifo_packing_t pack); -#endif /* FSL_FEATURE_SAI_HAS_FIFO_PACKING */ - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) && FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR -/*! - * @brief Set Tx FIFO error continue. - * - * FIFO error continue mode means SAI will keep running while FIFO error occurred. If this feature - * not enabled, SAI will hang and users need to clear FEF flag in TCSR register. - * - * @param base SAI base pointer. - * @param isEnabled Is FIFO error continue enabled, true means enable, false means disable. - */ -static inline void SAI_TxSetFIFOErrorContinue(I2S_Type *base, bool isEnabled) -{ - if (isEnabled) - { - base->TCR4 |= I2S_TCR4_FCONT_MASK; - } - else - { - base->TCR4 &= ~I2S_TCR4_FCONT_MASK; - } -} - -/*! - * @brief Set Rx FIFO error continue. - * - * FIFO error continue mode means SAI will keep running while FIFO error occurred. If this feature - * not enabled, SAI will hang and users need to clear FEF flag in RCSR register. - * - * @param base SAI base pointer. - * @param isEnabled Is FIFO error continue enabled, true means enable, false means disable. - */ -static inline void SAI_RxSetFIFOErrorContinue(I2S_Type *base, bool isEnabled) -{ - if (isEnabled) - { - base->RCR4 |= I2S_RCR4_FCONT_MASK; - } - else - { - base->RCR4 &= ~I2S_RCR4_FCONT_MASK; - } -} -#endif - -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables the SAI Tx interrupt requests. - * - * @param base SAI base pointer - * @param mask interrupt source - * The parameter can be a combination of the following sources if defined. - * @arg kSAI_WordStartInterruptEnable - * @arg kSAI_SyncErrorInterruptEnable - * @arg kSAI_FIFOWarningInterruptEnable - * @arg kSAI_FIFORequestInterruptEnable - * @arg kSAI_FIFOErrorInterruptEnable - */ -static inline void SAI_TxEnableInterrupts(I2S_Type *base, uint32_t mask) -{ - base->TCSR = ((base->TCSR & 0xFFE3FFFFU) | mask); -} - -/*! - * @brief Enables the SAI Rx interrupt requests. - * - * @param base SAI base pointer - * @param mask interrupt source - * The parameter can be a combination of the following sources if defined. - * @arg kSAI_WordStartInterruptEnable - * @arg kSAI_SyncErrorInterruptEnable - * @arg kSAI_FIFOWarningInterruptEnable - * @arg kSAI_FIFORequestInterruptEnable - * @arg kSAI_FIFOErrorInterruptEnable - */ -static inline void SAI_RxEnableInterrupts(I2S_Type *base, uint32_t mask) -{ - base->RCSR = ((base->RCSR & 0xFFE3FFFFU) | mask); -} - -/*! - * @brief Disables the SAI Tx interrupt requests. - * - * @param base SAI base pointer - * @param mask interrupt source - * The parameter can be a combination of the following sources if defined. - * @arg kSAI_WordStartInterruptEnable - * @arg kSAI_SyncErrorInterruptEnable - * @arg kSAI_FIFOWarningInterruptEnable - * @arg kSAI_FIFORequestInterruptEnable - * @arg kSAI_FIFOErrorInterruptEnable - */ -static inline void SAI_TxDisableInterrupts(I2S_Type *base, uint32_t mask) -{ - base->TCSR = ((base->TCSR & 0xFFE3FFFFU) & (~mask)); -} - -/*! - * @brief Disables the SAI Rx interrupt requests. - * - * @param base SAI base pointer - * @param mask interrupt source - * The parameter can be a combination of the following sources if defined. - * @arg kSAI_WordStartInterruptEnable - * @arg kSAI_SyncErrorInterruptEnable - * @arg kSAI_FIFOWarningInterruptEnable - * @arg kSAI_FIFORequestInterruptEnable - * @arg kSAI_FIFOErrorInterruptEnable - */ -static inline void SAI_RxDisableInterrupts(I2S_Type *base, uint32_t mask) -{ - base->RCSR = ((base->RCSR & 0xFFE3FFFFU) & (~mask)); -} - -/*! @} */ - -/*! - * @name DMA Control - * @{ - */ - -/*! - * @brief Enables/disables the SAI Tx DMA requests. - * @param base SAI base pointer - * @param mask DMA source - * The parameter can be combination of the following sources if defined. - * @arg kSAI_FIFOWarningDMAEnable - * @arg kSAI_FIFORequestDMAEnable - * @param enable True means enable DMA, false means disable DMA. - */ -static inline void SAI_TxEnableDMA(I2S_Type *base, uint32_t mask, bool enable) -{ - if (enable) - { - base->TCSR = ((base->TCSR & 0xFFE3FFFFU) | mask); - } - else - { - base->TCSR = ((base->TCSR & 0xFFE3FFFFU) & (~mask)); - } -} - -/*! - * @brief Enables/disables the SAI Rx DMA requests. - * @param base SAI base pointer - * @param mask DMA source - * The parameter can be a combination of the following sources if defined. - * @arg kSAI_FIFOWarningDMAEnable - * @arg kSAI_FIFORequestDMAEnable - * @param enable True means enable DMA, false means disable DMA. - */ -static inline void SAI_RxEnableDMA(I2S_Type *base, uint32_t mask, bool enable) -{ - if (enable) - { - base->RCSR = ((base->RCSR & 0xFFE3FFFFU) | mask); - } - else - { - base->RCSR = ((base->RCSR & 0xFFE3FFFFU) & (~mask)); - } -} - -/*! - * @brief Gets the SAI Tx data register address. - * - * This API is used to provide a transfer address for the SAI DMA transfer configuration. - * - * @param base SAI base pointer. - * @param channel Which data channel used. - * @return data register address. - */ -static inline uintptr_t SAI_TxGetDataRegisterAddress(I2S_Type *base, uint32_t channel) -{ - return (uintptr_t)(&(base->TDR)[channel]); -} - -/*! - * @brief Gets the SAI Rx data register address. - * - * This API is used to provide a transfer address for the SAI DMA transfer configuration. - * - * @param base SAI base pointer. - * @param channel Which data channel used. - * @return data register address. - */ -static inline uintptr_t SAI_RxGetDataRegisterAddress(I2S_Type *base, uint32_t channel) -{ - return (uintptr_t)(&(base->RDR)[channel]); -} - -/*! @} */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Sends data using a blocking method. - * - * @note This function blocks by polling until data is ready to be sent. - * - * @param base SAI base pointer. - * @param channel Data channel used. - * @param bitWidth How many bits in an audio word; usually 8/16/24/32 bits. - * @param buffer Pointer to the data to be written. - * @param size Bytes to be written. - */ -void SAI_WriteBlocking(I2S_Type *base, uint32_t channel, uint32_t bitWidth, uint8_t *buffer, uint32_t size); - -/*! - * @brief Sends data to multi channel using a blocking method. - * - * @note This function blocks by polling until data is ready to be sent. - * - * @param base SAI base pointer. - * @param channel Data channel used. - * @param channelMask channel mask. - * @param bitWidth How many bits in an audio word; usually 8/16/24/32 bits. - * @param buffer Pointer to the data to be written. - * @param size Bytes to be written. - */ -void SAI_WriteMultiChannelBlocking( - I2S_Type *base, uint32_t channel, uint32_t channelMask, uint32_t bitWidth, uint8_t *buffer, uint32_t size); - -/*! - * @brief Writes data into SAI FIFO. - * - * @param base SAI base pointer. - * @param channel Data channel used. - * @param data Data needs to be written. - */ -static inline void SAI_WriteData(I2S_Type *base, uint32_t channel, uint32_t data) -{ - base->TDR[channel] = data; -} - -/*! - * @brief Receives data using a blocking method. - * - * @note This function blocks by polling until data is ready to be sent. - * - * @param base SAI base pointer. - * @param channel Data channel used. - * @param bitWidth How many bits in an audio word; usually 8/16/24/32 bits. - * @param buffer Pointer to the data to be read. - * @param size Bytes to be read. - */ -void SAI_ReadBlocking(I2S_Type *base, uint32_t channel, uint32_t bitWidth, uint8_t *buffer, uint32_t size); - -/*! - * @brief Receives multi channel data using a blocking method. - * - * @note This function blocks by polling until data is ready to be sent. - * - * @param base SAI base pointer. - * @param channel Data channel used. - * @param channelMask channel mask. - * @param bitWidth How many bits in an audio word; usually 8/16/24/32 bits. - * @param buffer Pointer to the data to be read. - * @param size Bytes to be read. - */ -void SAI_ReadMultiChannelBlocking( - I2S_Type *base, uint32_t channel, uint32_t channelMask, uint32_t bitWidth, uint8_t *buffer, uint32_t size); - -/*! - * @brief Reads data from the SAI FIFO. - * - * @param base SAI base pointer. - * @param channel Data channel used. - * @return Data in SAI FIFO. - */ -static inline uint32_t SAI_ReadData(I2S_Type *base, uint32_t channel) -{ - return base->RDR[channel]; -} - -/*! @} */ - -/*! - * @name Transactional - * @{ - */ - -/*! - * @brief Initializes the SAI Tx handle. - * - * This function initializes the Tx handle for the SAI Tx transactional APIs. Call - * this function once to get the handle initialized. - * - * @param base SAI base pointer - * @param handle SAI handle pointer. - * @param callback Pointer to the user callback function. - * @param userData User parameter passed to the callback function - */ -void SAI_TransferTxCreateHandle(I2S_Type *base, sai_handle_t *handle, sai_transfer_callback_t callback, void *userData); - -/*! - * @brief Initializes the SAI Rx handle. - * - * This function initializes the Rx handle for the SAI Rx transactional APIs. Call - * this function once to get the handle initialized. - * - * @param base SAI base pointer. - * @param handle SAI handle pointer. - * @param callback Pointer to the user callback function. - * @param userData User parameter passed to the callback function. - */ -void SAI_TransferRxCreateHandle(I2S_Type *base, sai_handle_t *handle, sai_transfer_callback_t callback, void *userData); - -/*! - * @brief SAI transmitter transfer configurations. - * - * This function initializes the Tx, include bit clock, frame sync, master clock, serial data and fifo - * configurations. - * - * @param base SAI base pointer. - * @param handle SAI handle pointer. - * @param config tranmitter configurations. - */ -void SAI_TransferTxSetConfig(I2S_Type *base, sai_handle_t *handle, sai_transceiver_t *config); - -/*! - * @brief SAI receiver transfer configurations. - * - * This function initializes the Rx, include bit clock, frame sync, master clock, serial data and fifo - * configurations. - * - * @param base SAI base pointer. - * @param handle SAI handle pointer. - * @param config receiver configurations. - */ -void SAI_TransferRxSetConfig(I2S_Type *base, sai_handle_t *handle, sai_transceiver_t *config); - - -/*! - * @brief Performs an interrupt non-blocking send transfer on SAI. - * - * @note This API returns immediately after the transfer initiates. - * Call the SAI_TxGetTransferStatusIRQ to poll the transfer status and check whether - * the transfer is finished. If the return status is not kStatus_SAI_Busy, the transfer - * is finished. - * - * @param base SAI base pointer. - * @param handle Pointer to the sai_handle_t structure which stores the transfer state. - * @param xfer Pointer to the sai_transfer_t structure. - * @retval kStatus_Success Successfully started the data receive. - * @retval kStatus_SAI_TxBusy Previous receive still not finished. - * @retval kStatus_InvalidArgument The input parameter is invalid. - */ -status_t SAI_TransferSendNonBlocking(I2S_Type *base, sai_handle_t *handle, sai_transfer_t *xfer); - -/*! - * @brief Performs an interrupt non-blocking receive transfer on SAI. - * - * @note This API returns immediately after the transfer initiates. - * Call the SAI_RxGetTransferStatusIRQ to poll the transfer status and check whether - * the transfer is finished. If the return status is not kStatus_SAI_Busy, the transfer - * is finished. - * - * @param base SAI base pointer - * @param handle Pointer to the sai_handle_t structure which stores the transfer state. - * @param xfer Pointer to the sai_transfer_t structure. - * @retval kStatus_Success Successfully started the data receive. - * @retval kStatus_SAI_RxBusy Previous receive still not finished. - * @retval kStatus_InvalidArgument The input parameter is invalid. - */ -status_t SAI_TransferReceiveNonBlocking(I2S_Type *base, sai_handle_t *handle, sai_transfer_t *xfer); - -/*! - * @brief Gets a set byte count. - * - * @param base SAI base pointer. - * @param handle Pointer to the sai_handle_t structure which stores the transfer state. - * @param count Bytes count sent. - * @retval kStatus_Success Succeed get the transfer count. - * @retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t SAI_TransferGetSendCount(I2S_Type *base, sai_handle_t *handle, size_t *count); - -/*! - * @brief Gets a received byte count. - * - * @param base SAI base pointer. - * @param handle Pointer to the sai_handle_t structure which stores the transfer state. - * @param count Bytes count received. - * @retval kStatus_Success Succeed get the transfer count. - * @retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. - */ -status_t SAI_TransferGetReceiveCount(I2S_Type *base, sai_handle_t *handle, size_t *count); - -/*! - * @brief Aborts the current send. - * - * @note This API can be called any time when an interrupt non-blocking transfer initiates - * to abort the transfer early. - * - * @param base SAI base pointer. - * @param handle Pointer to the sai_handle_t structure which stores the transfer state. - */ -void SAI_TransferAbortSend(I2S_Type *base, sai_handle_t *handle); - -/*! - * @brief Aborts the current IRQ receive. - * - * @note This API can be called when an interrupt non-blocking transfer initiates - * to abort the transfer early. - * - * @param base SAI base pointer - * @param handle Pointer to the sai_handle_t structure which stores the transfer state. - */ -void SAI_TransferAbortReceive(I2S_Type *base, sai_handle_t *handle); - -/*! - * @brief Terminate all SAI send. - * - * This function will clear all transfer slots buffered in the sai queue. If users only want to abort the - * current transfer slot, please call SAI_TransferAbortSend. - * - * @param base SAI base pointer. - * @param handle SAI eDMA handle pointer. - */ -void SAI_TransferTerminateSend(I2S_Type *base, sai_handle_t *handle); - -/*! - * @brief Terminate all SAI receive. - * - * This function will clear all transfer slots buffered in the sai queue. If users only want to abort the - * current transfer slot, please call SAI_TransferAbortReceive. - * - * @param base SAI base pointer. - * @param handle SAI eDMA handle pointer. - */ -void SAI_TransferTerminateReceive(I2S_Type *base, sai_handle_t *handle); - -/*! - * @brief Tx interrupt handler. - * - * @param base SAI base pointer. - * @param handle Pointer to the sai_handle_t structure. - */ -void SAI_TransferTxHandleIRQ(I2S_Type *base, sai_handle_t *handle); - -/*! - * @brief Tx interrupt handler. - * - * @param base SAI base pointer. - * @param handle Pointer to the sai_handle_t structure. - */ -void SAI_TransferRxHandleIRQ(I2S_Type *base, sai_handle_t *handle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /*_cplusplus*/ - -/*! @} */ - -#endif /* FSL_SAI_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_sai_edma.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_sai_edma.c deleted file mode 100644 index b3ffa7a7ecc..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_sai_edma.c +++ /dev/null @@ -1,1063 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_sai_edma.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.sai_edma" -#endif - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/* Used for edma_tcd_t size aligned */ -#define STCD_ADDR(address) (edma_tcd_t *)(((uint32_t)(address) + sizeof(edma_tcd_t)) & ~(sizeof(edma_tcd_t) - 1U)) - -static I2S_Type *const s_saiBases[] = I2S_BASE_PTRS; -/* Only support 2 and 4 channel */ -#define SAI_CHANNEL_MAP_MODULO(channel) ((channel) == 2U ? kEDMA_Modulo8bytes : kEDMA_Modulo16bytes) - -/*handle; - status_t status = kStatus_SAI_TxBusy; - - if (saiHandle->state != (uint32_t)kSAI_BusyLoopTransfer) - { - if (saiHandle->queueDriver + tcds > (uint32_t)SAI_XFER_QUEUE_SIZE) - { - (void)memset(&saiHandle->saiQueue[saiHandle->queueDriver], 0, - sizeof(sai_transfer_t) * ((uint32_t)SAI_XFER_QUEUE_SIZE - saiHandle->queueDriver)); - (void)memset(&saiHandle->saiQueue[0U], 0, - sizeof(sai_transfer_t) * (saiHandle->queueDriver + tcds - (uint32_t)SAI_XFER_QUEUE_SIZE)); - } - else - { - (void)memset(&saiHandle->saiQueue[saiHandle->queueDriver], 0, sizeof(sai_transfer_t) * tcds); - } - saiHandle->queueDriver = (uint8_t)((saiHandle->queueDriver + tcds) % (uint32_t)SAI_XFER_QUEUE_SIZE); - - /* If all data finished, just stop the transfer */ - if (saiHandle->saiQueue[saiHandle->queueDriver].data == NULL) - { - /* Disable DMA enable bit */ - SAI_TxEnableDMA(privHandle->base, kSAI_FIFORequestDMAEnable, false); - EDMA_AbortTransfer(handle); - status = kStatus_SAI_TxIdle; - } - } - - /* If finished a block, call the callback function */ - if (saiHandle->callback != NULL) - { - (saiHandle->callback)(privHandle->base, saiHandle, status, saiHandle->userData); - } -} - -static void SAI_RxEDMACallback(edma_handle_t *handle, void *userData, bool done, uint32_t tcds) -{ - sai_edma_private_handle_t *privHandle = (sai_edma_private_handle_t *)userData; - sai_edma_handle_t *saiHandle = privHandle->handle; - status_t status = kStatus_SAI_RxBusy; - - if (saiHandle->state != (uint32_t)kSAI_BusyLoopTransfer) - { - if (saiHandle->queueDriver + tcds > (uint32_t)SAI_XFER_QUEUE_SIZE) - { - (void)memset(&saiHandle->saiQueue[saiHandle->queueDriver], 0, - sizeof(sai_transfer_t) * ((uint32_t)SAI_XFER_QUEUE_SIZE - saiHandle->queueDriver)); - (void)memset(&saiHandle->saiQueue[0U], 0, - sizeof(sai_transfer_t) * (saiHandle->queueDriver + tcds - (uint32_t)SAI_XFER_QUEUE_SIZE)); - } - else - { - (void)memset(&saiHandle->saiQueue[saiHandle->queueDriver], 0, sizeof(sai_transfer_t) * tcds); - } - saiHandle->queueDriver = (uint8_t)((saiHandle->queueDriver + tcds) % (uint32_t)SAI_XFER_QUEUE_SIZE); - - /* If all data finished, just stop the transfer */ - if (saiHandle->saiQueue[saiHandle->queueDriver].data == NULL) - { - /* Disable DMA enable bit */ - SAI_RxEnableDMA(privHandle->base, kSAI_FIFORequestDMAEnable, false); - EDMA_AbortTransfer(handle); - status = kStatus_SAI_RxIdle; - } - } - - /* If finished a block, call the callback function */ - if (saiHandle->callback != NULL) - { - (saiHandle->callback)(privHandle->base, saiHandle, status, saiHandle->userData); - } -} - -/*! - * brief Initializes the SAI eDMA handle. - * - * This function initializes the SAI master DMA handle, which can be used for other SAI master transactional APIs. - * Usually, for a specified SAI instance, call this API once to get the initialized handle. - * - * param base SAI base pointer. - * param handle SAI eDMA handle pointer. - * param base SAI peripheral base address. - * param callback Pointer to user callback function. - * param userData User parameter passed to the callback function. - * param dmaHandle eDMA handle pointer, this handle shall be static allocated by users. - */ -void SAI_TransferTxCreateHandleEDMA( - I2S_Type *base, sai_edma_handle_t *handle, sai_edma_callback_t callback, void *userData, edma_handle_t *txDmaHandle) -{ - assert((handle != NULL) && (txDmaHandle != NULL)); - - uint32_t instance = SAI_GetInstance(base); - - /* Zero the handle */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Set sai base to handle */ - handle->dmaHandle = txDmaHandle; - handle->callback = callback; - handle->userData = userData; - handle->interleaveType = kSAI_EDMAInterleavePerChannelSample; - - /* Set SAI state to idle */ - handle->state = (uint32_t)kSAI_Idle; - - s_edmaPrivateHandle[instance][0].base = base; - s_edmaPrivateHandle[instance][0].handle = handle; - - /* Need to use scatter gather */ - EDMA_InstallTCDMemory(txDmaHandle, (edma_tcd_t *)(STCD_ADDR(handle->tcd)), SAI_XFER_QUEUE_SIZE); - - /* Install callback for Tx dma channel */ - EDMA_SetCallback(txDmaHandle, SAI_TxEDMACallback, &s_edmaPrivateHandle[instance][0]); -} - -/*! - * brief Initializes the SAI Rx eDMA handle. - * - * This function initializes the SAI slave DMA handle, which can be used for other SAI master transactional APIs. - * Usually, for a specified SAI instance, call this API once to get the initialized handle. - * - * param base SAI base pointer. - * param handle SAI eDMA handle pointer. - * param base SAI peripheral base address. - * param callback Pointer to user callback function. - * param userData User parameter passed to the callback function. - * param dmaHandle eDMA handle pointer, this handle shall be static allocated by users. - */ -void SAI_TransferRxCreateHandleEDMA( - I2S_Type *base, sai_edma_handle_t *handle, sai_edma_callback_t callback, void *userData, edma_handle_t *rxDmaHandle) -{ - assert((handle != NULL) && (rxDmaHandle != NULL)); - - uint32_t instance = SAI_GetInstance(base); - - /* Zero the handle */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Set sai base to handle */ - handle->dmaHandle = rxDmaHandle; - handle->callback = callback; - handle->userData = userData; - handle->interleaveType = kSAI_EDMAInterleavePerChannelSample; - - /* Set SAI state to idle */ - handle->state = (uint32_t)kSAI_Idle; - - s_edmaPrivateHandle[instance][1].base = base; - s_edmaPrivateHandle[instance][1].handle = handle; - - /* Need to use scatter gather */ - EDMA_InstallTCDMemory(rxDmaHandle, STCD_ADDR(handle->tcd), SAI_XFER_QUEUE_SIZE); - - /* Install callback for Tx dma channel */ - EDMA_SetCallback(rxDmaHandle, SAI_RxEDMACallback, &s_edmaPrivateHandle[instance][1]); -} - -/*! - * brief Initializes the SAI interleave type. - * - * This function initializes the SAI DMA handle member interleaveType, it shall be called only when application would - * like to use type kSAI_EDMAInterleavePerChannelBlock, since the default interleaveType is - * kSAI_EDMAInterleavePerChannelSample always - * - * param handle SAI eDMA handle pointer. - * param interleaveType SAI interleave type. - */ -void SAI_TransferSetInterleaveType(sai_edma_handle_t *handle, sai_edma_interleave_t interleaveType) -{ - handle->interleaveType = interleaveType; -} - -/*! - * brief Configures the SAI Tx. - * - * note SAI eDMA supports data transfer in a multiple SAI channels if the FIFO Combine feature is supported. - * To activate the multi-channel transfer enable SAI channels by filling the channelMask - * of sai_transceiver_t with the corresponding values of _sai_channel_mask enum, enable the FIFO Combine - * mode by assigning kSAI_FifoCombineModeEnabledOnWrite to the fifoCombine member of sai_fifo_combine_t - * which is a member of sai_transceiver_t. - * This is an example of multi-channel data transfer configuration step. - * code - * sai_transceiver_t config; - * SAI_GetClassicI2SConfig(&config, kSAI_WordWidth16bits, kSAI_Stereo, kSAI_Channel0Mask|kSAI_Channel1Mask); - * config.fifo.fifoCombine = kSAI_FifoCombineModeEnabledOnWrite; - * SAI_TransferTxSetConfigEDMA(I2S0, &edmaHandle, &config); - * endcode - * param base SAI base pointer. - * param handle SAI eDMA handle pointer. - * param saiConfig sai configurations. - */ -void SAI_TransferTxSetConfigEDMA(I2S_Type *base, sai_edma_handle_t *handle, sai_transceiver_t *saiConfig) -{ - assert((handle != NULL) && (saiConfig != NULL)); - - /* Configure the audio format to SAI registers */ - SAI_TxSetConfig(base, saiConfig); - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE - /* Allow multi-channel transfer only if FIFO Combine mode is enabled */ - assert( - (saiConfig->channelNums <= 1U) || - ((saiConfig->channelNums > 1U) && ((saiConfig->fifo.fifoCombine == kSAI_FifoCombineModeEnabledOnWrite) || - (saiConfig->fifo.fifoCombine == kSAI_FifoCombineModeEnabledOnReadWrite)))); -#endif - - /* Get the transfer size from format, this should be used in EDMA configuration */ - if (saiConfig->serialData.dataWordLength == 24U) - { - handle->bytesPerFrame = 4U; - } - else - { - handle->bytesPerFrame = saiConfig->serialData.dataWordLength / 8U; - } - /* Update the data channel SAI used */ - handle->channel = saiConfig->startChannel; - handle->channelMask = saiConfig->channelMask; - handle->channelNums = saiConfig->channelNums; - - /* Clear the channel enable bits until do a send/receive */ - base->TCR3 &= ~I2S_TCR3_TCE_MASK; -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - handle->count = (uint8_t)((uint32_t)FSL_FEATURE_SAI_FIFO_COUNTn(base) - saiConfig->fifo.fifoWatermark); -#else - handle->count = 1U; -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ -} - -/*! - * brief Configures the SAI Rx. - * - * note SAI eDMA supports data transfer in a multiple SAI channels if the FIFO Combine feature is supported. - * To activate the multi-channel transfer enable SAI channels by filling the channelMask - * of sai_transceiver_t with the corresponding values of _sai_channel_mask enum, enable the FIFO Combine - * mode by assigning kSAI_FifoCombineModeEnabledOnRead to the fifoCombine member of sai_fifo_combine_t - * which is a member of sai_transceiver_t. - * This is an example of multi-channel data transfer configuration step. - * code - * sai_transceiver_t config; - * SAI_GetClassicI2SConfig(&config, kSAI_WordWidth16bits, kSAI_Stereo, kSAI_Channel0Mask|kSAI_Channel1Mask); - * config.fifo.fifoCombine = kSAI_FifoCombineModeEnabledOnRead; - * SAI_TransferRxSetConfigEDMA(I2S0, &edmaHandle, &config); - * endcode - * param base SAI base pointer. - * param handle SAI eDMA handle pointer. - * param saiConfig sai configurations. - */ -void SAI_TransferRxSetConfigEDMA(I2S_Type *base, sai_edma_handle_t *handle, sai_transceiver_t *saiConfig) -{ - assert((handle != NULL) && (saiConfig != NULL)); - - /* Configure the audio format to SAI registers */ - SAI_RxSetConfig(base, saiConfig); - -#if defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE - /* Allow multi-channel transfer only if FIFO Combine mode is enabled */ - assert( - (saiConfig->channelNums <= 1U) || - ((saiConfig->channelNums > 1U) && ((saiConfig->fifo.fifoCombine == kSAI_FifoCombineModeEnabledOnRead) || - (saiConfig->fifo.fifoCombine == kSAI_FifoCombineModeEnabledOnReadWrite)))); -#endif - - /* Get the transfer size from format, this should be used in EDMA configuration */ - if (saiConfig->serialData.dataWordLength == 24U) - { - handle->bytesPerFrame = 4U; - } - else - { - handle->bytesPerFrame = saiConfig->serialData.dataWordLength / 8U; - } - - /* Update the data channel SAI used */ - handle->channel = saiConfig->startChannel; - handle->channelMask = saiConfig->channelMask; - handle->channelNums = saiConfig->channelNums; - /* Clear the channel enable bits until do a send/receive */ - base->RCR3 &= ~I2S_RCR3_RCE_MASK; -#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO) - handle->count = saiConfig->fifo.fifoWatermark; -#else - handle->count = 1U; -#endif /* FSL_FEATURE_SAI_HAS_FIFO */ -} - -/*! - * brief Performs a non-blocking SAI transfer using DMA. - * - * note This interface returns immediately after the transfer initiates. Call - * SAI_GetTransferStatus to poll the transfer status and check whether the SAI transfer is finished. - * - * In classic I2S mode configuration. - * 1. The data source sent should be formatted as below if handle->interleaveType = - * kSAI_EDMAInterleavePerChannelSample : - * -------------------------------------------------------------------------------------------------- - * |LEFT CHANNEL | RIGHT CHANNEL | LEFT CHANNEL | RIGHT CHANNEL | LEFT CHANNEL | RIGHT CHANNEL | ...| - * -------------------------------------------------------------------------------------------------- - * 2. The data source sent should be formatted as below if handle->interleaveType = - * kSAI_EDMAInterleavePerChannelBlock : - * ------------------------------------------------------------------------------------------------------- - * |LEFT CHANNEL | LEFT CHANNEL | LEFT CHANNEL | ...| RIGHT CHANNEL | RIGHT CHANNEL | RIGHT CHANNEL | ...| - * ------------------------------------------------------------------------------------------------------- - * - * This function support multi channel transfer, - * 1. for the sai IP support fifo combine mode, application should enable the fifo combine mode, no limitation - * on channel numbers - * 2. for the sai IP not support fifo combine mode, sai edma provide another solution which using - * EDMA modulo feature, but support 2 or 4 channels only. - * - * param base SAI base pointer. - * param handle SAI eDMA handle pointer. - * param xfer Pointer to the DMA transfer structure. - * retval kStatus_Success Start a SAI eDMA send successfully. - * retval kStatus_InvalidArgument The input argument is invalid. - * retval kStatus_TxBusy SAI is busy sending data. - */ -status_t SAI_TransferSendEDMA(I2S_Type *base, sai_edma_handle_t *handle, sai_transfer_t *xfer) -{ - assert((handle != NULL) && (xfer != NULL)); - - edma_transfer_config_t config = {0}; - uint32_t destAddr = SAI_TxGetDataRegisterAddress(base, handle->channel); - uint32_t destOffset = 0U; - uint32_t srcOffset = xfer->dataSize / 2U; - edma_tcd_t *currentTCD = STCD_ADDR(handle->tcd); - edma_minor_offset_config_t minorOffset = {.enableSrcMinorOffset = true, - .enableDestMinorOffset = false, - .minorOffset = 0xFFFFFU - 2U * srcOffset + 1U + handle->bytesPerFrame}; - - /* Check if input parameter invalid */ - if ((xfer->data == NULL) || (xfer->dataSize == 0U)) - { - return kStatus_InvalidArgument; - } - - if (handle->saiQueue[handle->queueUser].data != NULL) - { - return kStatus_SAI_QueueFull; - } - - /* Change the state of handle */ - handle->state = (uint32_t)kSAI_Busy; - - /* Update the queue state */ - handle->transferSize[handle->queueUser] = xfer->dataSize; - handle->saiQueue[handle->queueUser].data = xfer->data; - handle->saiQueue[handle->queueUser].dataSize = xfer->dataSize; - handle->queueUser = (handle->queueUser + 1U) % (uint8_t)SAI_XFER_QUEUE_SIZE; - -#if !(defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) - if (handle->channelNums > 1U) - { - destOffset = sizeof(uint32_t); - } -#endif - - if (handle->interleaveType == kSAI_EDMAInterleavePerChannelSample) - { - /* Prepare edma configure */ - EDMA_PrepareTransferConfig(&config, xfer->data, (uint32_t)handle->bytesPerFrame, (int16_t)handle->bytesPerFrame, - (uint32_t *)destAddr, (uint32_t)handle->bytesPerFrame, (int16_t)destOffset, - (uint32_t)handle->count * handle->bytesPerFrame, xfer->dataSize); - } - else - { - EDMA_PrepareTransferConfig(&config, xfer->data, (uint32_t)handle->bytesPerFrame, (int16_t)srcOffset, - (uint32_t *)destAddr, (uint32_t)handle->bytesPerFrame, (int16_t)destOffset, - (uint32_t)2U * handle->bytesPerFrame, xfer->dataSize); -#if defined FSL_EDMA_DRIVER_EDMA4 && FSL_EDMA_DRIVER_EDMA4 - EDMA_TcdSetTransferConfigExt(handle->dmaHandle->base, currentTCD, &config, NULL); - EDMA_TcdSetMinorOffsetConfigExt(handle->dmaHandle->base, currentTCD, &minorOffset); - EDMA_TcdEnableInterruptsExt(handle->dmaHandle->base, currentTCD, (uint32_t)kEDMA_MajorInterruptEnable); - EDMA_TcdEnableAutoStopRequestExt(handle->dmaHandle->base, currentTCD, true); -#else - EDMA_TcdSetTransferConfig(currentTCD, &config, NULL); - EDMA_TcdSetMinorOffsetConfig(currentTCD, &minorOffset); - EDMA_TcdEnableInterrupts(currentTCD, (uint32_t)kEDMA_MajorInterruptEnable); - EDMA_TcdEnableAutoStopRequest(currentTCD, true); -#endif - EDMA_InstallTCD(handle->dmaHandle->base, handle->dmaHandle->channel, currentTCD); - } - /* Store the initially configured eDMA minor byte transfer count into the SAI handle */ - handle->nbytes = handle->count * handle->bytesPerFrame; - - if (EDMA_SubmitTransfer(handle->dmaHandle, &config) != kStatus_Success) - { - return kStatus_SAI_QueueFull; - } - -#if !(defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) - if (handle->channelNums > 1U) - { - if ((handle->channelNums % 2U) != 0U) - { - return kStatus_InvalidArgument; - } - - EDMA_SetModulo(handle->dmaHandle->base, handle->dmaHandle->channel, kEDMA_ModuloDisable, - SAI_CHANNEL_MAP_MODULO(handle->channelNums)); - } -#endif - /* Start DMA transfer */ - EDMA_StartTransfer(handle->dmaHandle); - - /* Enable DMA enable bit */ - SAI_TxEnableDMA(base, kSAI_FIFORequestDMAEnable, true); - - /* Enable SAI Tx clock */ - SAI_TxEnable(base, true); - - /* Enable the channel FIFO */ - base->TCR3 |= I2S_TCR3_TCE(handle->channelMask); - - return kStatus_Success; -} - -/*! - * brief Performs a non-blocking SAI receive using eDMA. - * - * note This interface returns immediately after the transfer initiates. Call - * the SAI_GetReceiveRemainingBytes to poll the transfer status and check whether the SAI transfer is finished. - * - * In classic I2S mode configuration. - * 1. The output data will be formatted as below if handle->interleaveType = - * kSAI_EDMAInterleavePerChannelSample : - * -------------------------------------------------------------------------------------------------- - * |LEFT CHANNEL | RIGHT CHANNEL | LEFT CHANNEL | RIGHT CHANNEL | LEFT CHANNEL | RIGHT CHANNEL | ...| - * -------------------------------------------------------------------------------------------------- - * 2. The output data will be formatted as below if handle->interleaveType = - * kSAI_EDMAInterleavePerChannelBlock : - * ------------------------------------------------------------------------------------------------------- - * |LEFT CHANNEL | LEFT CHANNEL | LEFT CHANNEL | ...| RIGHT CHANNEL | RIGHT CHANNEL | RIGHT CHANNEL | ...| - * ------------------------------------------------------------------------------------------------------- - * - * This function support multi channel transfer, - * 1. for the sai IP support fifo combine mode, application should enable the fifo combine mode, no limitation - * on channel numbers - * 2. for the sai IP not support fifo combine mode, sai edma provide another solution which using - * EDMA modulo feature, but support 2 or 4 channels only. - * - * param base SAI base pointer - * param handle SAI eDMA handle pointer. - * param xfer Pointer to DMA transfer structure. - * retval kStatus_Success Start a SAI eDMA receive successfully. - * retval kStatus_InvalidArgument The input argument is invalid. - * retval kStatus_RxBusy SAI is busy receiving data. - */ -status_t SAI_TransferReceiveEDMA(I2S_Type *base, sai_edma_handle_t *handle, sai_transfer_t *xfer) -{ - assert((handle != NULL) && (xfer != NULL)); - - edma_transfer_config_t config = {0}; - uint32_t srcAddr = SAI_RxGetDataRegisterAddress(base, handle->channel); - uint32_t srcOffset = 0U; - uint32_t destOffset = xfer->dataSize / 2U; - edma_tcd_t *currentTCD = STCD_ADDR(handle->tcd); - edma_minor_offset_config_t minorOffset = { - .enableSrcMinorOffset = false, - .enableDestMinorOffset = true, - .minorOffset = 0xFFFFFU - 2U * destOffset + 1U + (uint32_t)handle->bytesPerFrame}; - - /* Check if input parameter invalid */ - if ((xfer->data == NULL) || (xfer->dataSize == 0U)) - { - return kStatus_InvalidArgument; - } - - if (handle->saiQueue[handle->queueUser].data != NULL) - { - return kStatus_SAI_QueueFull; - } - - /* Change the state of handle */ - handle->state = (uint32_t)kSAI_Busy; - - /* Update queue state */ - handle->transferSize[handle->queueUser] = xfer->dataSize; - handle->saiQueue[handle->queueUser].data = xfer->data; - handle->saiQueue[handle->queueUser].dataSize = xfer->dataSize; - handle->queueUser = (handle->queueUser + 1U) % (uint8_t)SAI_XFER_QUEUE_SIZE; - -#if !(defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) - if (handle->channelNums > 1U) - { - srcOffset = sizeof(uint32_t); - } -#endif - - if (handle->interleaveType == kSAI_EDMAInterleavePerChannelSample) - { - /* Prepare edma configure */ - EDMA_PrepareTransferConfig(&config, (uint32_t *)srcAddr, (uint32_t)handle->bytesPerFrame, (int16_t)srcOffset, - xfer->data, (uint32_t)handle->bytesPerFrame, (int16_t)handle->bytesPerFrame, - (uint32_t)handle->count * handle->bytesPerFrame, xfer->dataSize); - } - else - { - EDMA_PrepareTransferConfig(&config, (uint32_t *)srcAddr, (uint32_t)handle->bytesPerFrame, (int16_t)srcOffset, - xfer->data, (uint32_t)handle->bytesPerFrame, (int16_t)destOffset, - (uint32_t)2U * handle->bytesPerFrame, xfer->dataSize); -#if defined FSL_EDMA_DRIVER_EDMA4 && FSL_EDMA_DRIVER_EDMA4 - EDMA_TcdSetTransferConfigExt(handle->dmaHandle->base, currentTCD, &config, NULL); - EDMA_TcdSetMinorOffsetConfigExt(handle->dmaHandle->base, currentTCD, &minorOffset); - EDMA_TcdEnableInterruptsExt(handle->dmaHandle->base, currentTCD, (uint32_t)kEDMA_MajorInterruptEnable); - EDMA_TcdEnableAutoStopRequestExt(handle->dmaHandle->base, currentTCD, true); -#else - EDMA_TcdSetTransferConfig(currentTCD, &config, NULL); - EDMA_TcdSetMinorOffsetConfig(currentTCD, &minorOffset); - EDMA_TcdEnableInterrupts(currentTCD, (uint32_t)kEDMA_MajorInterruptEnable); - EDMA_TcdEnableAutoStopRequest(currentTCD, true); -#endif - EDMA_InstallTCD(handle->dmaHandle->base, handle->dmaHandle->channel, currentTCD); - } - - /* Store the initially configured eDMA minor byte transfer count into the SAI handle */ - handle->nbytes = handle->count * handle->bytesPerFrame; - - if (EDMA_SubmitTransfer(handle->dmaHandle, &config) != kStatus_Success) - { - return kStatus_SAI_QueueFull; - } - -#if !(defined(FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) - if (handle->channelNums > 1U) - { - if ((handle->channelNums % 2U) != 0U) - { - return kStatus_InvalidArgument; - } - - EDMA_SetModulo(handle->dmaHandle->base, handle->dmaHandle->channel, SAI_CHANNEL_MAP_MODULO(handle->channelNums), - kEDMA_ModuloDisable); - } -#endif - /* Start DMA transfer */ - EDMA_StartTransfer(handle->dmaHandle); - - /* Enable DMA enable bit */ - SAI_RxEnableDMA(base, kSAI_FIFORequestDMAEnable, true); - - /* Enable the channel FIFO */ - base->RCR3 |= I2S_RCR3_RCE(handle->channelMask); - - /* Enable SAI Rx clock */ - SAI_RxEnable(base, true); - - return kStatus_Success; -} - -/*! - * brief Performs a non-blocking SAI loop transfer using eDMA. - * - * note This function support loop transfer only,such as A->B->...->A, application must be aware of - * that the more counts of the loop transfer, then more tcd memory required, as the function use the tcd pool in - * sai_edma_handle_t, so application could redefine the SAI_XFER_QUEUE_SIZE to determine the proper TCD pool size. - * This function support one sai channel only. - * - * Once the loop transfer start, application can use function SAI_TransferAbortSendEDMA to stop the loop transfer. - * - * param base SAI base pointer. - * param handle SAI eDMA handle pointer. - * param xfer Pointer to the DMA transfer structure, should be a array with elements counts >=1(loopTransferCount). - * param loopTransferCount the counts of xfer array. - * retval kStatus_Success Start a SAI eDMA send successfully. - * retval kStatus_InvalidArgument The input argument is invalid. - */ -status_t SAI_TransferSendLoopEDMA(I2S_Type *base, - sai_edma_handle_t *handle, - sai_transfer_t *xfer, - uint32_t loopTransferCount) -{ - assert((handle != NULL) && (xfer != NULL)); - - edma_transfer_config_t config = {0}; - uint32_t destAddr = SAI_TxGetDataRegisterAddress(base, handle->channel); - sai_transfer_t *transfer = xfer; - edma_tcd_t *currentTCD = STCD_ADDR(handle->tcd); - uint32_t tcdIndex = 0U; - - /* Change the state of handle */ - handle->state = (uint32_t)kSAI_Busy; - - for (uint32_t i = 0U; i < loopTransferCount; i++) - { - transfer = &xfer[i]; - - if ((transfer->data == NULL) || (transfer->dataSize == 0U) || (tcdIndex >= (uint32_t)SAI_XFER_QUEUE_SIZE)) - { - return kStatus_InvalidArgument; - } - - /* Update the queue state */ - handle->transferSize[tcdIndex] = transfer->dataSize; - handle->saiQueue[tcdIndex].data = transfer->data; - handle->saiQueue[tcdIndex].dataSize = transfer->dataSize; - - /* Prepare edma configure */ - EDMA_PrepareTransfer(&config, transfer->data, handle->bytesPerFrame, (uint32_t *)destAddr, - handle->bytesPerFrame, (uint32_t)handle->count * handle->bytesPerFrame, transfer->dataSize, - kEDMA_MemoryToPeripheral); - -#if defined FSL_EDMA_DRIVER_EDMA4 && FSL_EDMA_DRIVER_EDMA4 - if (i == (loopTransferCount - 1U)) - { - EDMA_TcdSetTransferConfigExt(handle->dmaHandle->base, ¤tTCD[tcdIndex], &config, ¤tTCD[0U]); - EDMA_TcdEnableInterruptsExt(handle->dmaHandle->base, ¤tTCD[tcdIndex], - (uint32_t)kEDMA_MajorInterruptEnable); - handle->state = (uint32_t)kSAI_BusyLoopTransfer; - break; - } - else - { - EDMA_TcdSetTransferConfigExt(handle->dmaHandle->base, ¤tTCD[tcdIndex], &config, - ¤tTCD[tcdIndex + 1U]); - EDMA_TcdEnableInterruptsExt(handle->dmaHandle->base, ¤tTCD[tcdIndex], - (uint32_t)kEDMA_MajorInterruptEnable); - } -#else - if (i == (loopTransferCount - 1U)) - { - EDMA_TcdSetTransferConfig(¤tTCD[tcdIndex], &config, ¤tTCD[0U]); - EDMA_TcdEnableInterrupts(¤tTCD[tcdIndex], (uint32_t)kEDMA_MajorInterruptEnable); - handle->state = (uint32_t)kSAI_BusyLoopTransfer; - break; - } - else - { - EDMA_TcdSetTransferConfig(¤tTCD[tcdIndex], &config, ¤tTCD[tcdIndex + 1U]); - EDMA_TcdEnableInterrupts(¤tTCD[tcdIndex], (uint32_t)kEDMA_MajorInterruptEnable); - } -#endif - - tcdIndex = tcdIndex + 1U; - } - - EDMA_InstallTCD(handle->dmaHandle->base, handle->dmaHandle->channel, ¤tTCD[0]); - /* Start DMA transfer */ - EDMA_StartTransfer(handle->dmaHandle); - - /* Enable DMA enable bit */ - SAI_TxEnableDMA(base, kSAI_FIFORequestDMAEnable, true); - - /* Enable SAI Tx clock */ - SAI_TxEnable(base, true); - - /* Enable the channel FIFO */ - base->TCR3 |= I2S_TCR3_TCE(1UL << handle->channel); - - return kStatus_Success; -} - -/*! - * brief Performs a non-blocking SAI loop transfer using eDMA. - * - * note This function support loop transfer only,such as A->B->...->A, application must be aware of - * that the more counts of the loop transfer, then more tcd memory required, as the function use the tcd pool in - * sai_edma_handle_t, so application could redefine the SAI_XFER_QUEUE_SIZE to determine the proper TCD pool size. - * This function support one sai channel only. - * - * Once the loop transfer start, application can use function SAI_TransferAbortReceiveEDMA to stop the loop transfer. - * - * param base SAI base pointer. - * param handle SAI eDMA handle pointer. - * param xfer Pointer to the DMA transfer structure, should be a array with elements counts >=1(loopTransferCount). - * param loopTransferCount the counts of xfer array. - * retval kStatus_Success Start a SAI eDMA receive successfully. - * retval kStatus_InvalidArgument The input argument is invalid. - */ -status_t SAI_TransferReceiveLoopEDMA(I2S_Type *base, - sai_edma_handle_t *handle, - sai_transfer_t *xfer, - uint32_t loopTransferCount) -{ - assert((handle != NULL) && (xfer != NULL)); - - edma_transfer_config_t config = {0}; - uint32_t srcAddr = SAI_RxGetDataRegisterAddress(base, handle->channel); - sai_transfer_t *transfer = xfer; - edma_tcd_t *currentTCD = STCD_ADDR(handle->tcd); - uint32_t tcdIndex = 0U; - - /* Change the state of handle */ - handle->state = (uint32_t)kSAI_Busy; - - for (uint32_t i = 0U; i < loopTransferCount; i++) - { - transfer = &xfer[i]; - - if ((tcdIndex >= (uint32_t)SAI_XFER_QUEUE_SIZE) || (xfer->data == NULL) || (xfer->dataSize == 0U)) - { - return kStatus_InvalidArgument; - } - - /* Update the queue state */ - handle->transferSize[tcdIndex] = transfer->dataSize; - handle->saiQueue[tcdIndex].data = transfer->data; - handle->saiQueue[tcdIndex].dataSize = transfer->dataSize; - - /* Prepare edma configure */ - EDMA_PrepareTransfer(&config, (uint32_t *)srcAddr, handle->bytesPerFrame, transfer->data, handle->bytesPerFrame, - (uint32_t)handle->count * handle->bytesPerFrame, transfer->dataSize, - kEDMA_PeripheralToMemory); - -#if defined FSL_EDMA_DRIVER_EDMA4 && FSL_EDMA_DRIVER_EDMA4 - if (i == (loopTransferCount - 1U)) - { - EDMA_TcdSetTransferConfigExt(handle->dmaHandle->base, ¤tTCD[tcdIndex], &config, ¤tTCD[0U]); - EDMA_TcdEnableInterruptsExt(handle->dmaHandle->base, ¤tTCD[tcdIndex], - (uint32_t)kEDMA_MajorInterruptEnable); - handle->state = (uint32_t)kSAI_BusyLoopTransfer; - break; - } - else - { - EDMA_TcdSetTransferConfigExt(handle->dmaHandle->base, ¤tTCD[tcdIndex], &config, - ¤tTCD[tcdIndex + 1U]); - EDMA_TcdEnableInterruptsExt(handle->dmaHandle->base, ¤tTCD[tcdIndex], - (uint32_t)kEDMA_MajorInterruptEnable); - } -#else - if (i == (loopTransferCount - 1U)) - { - EDMA_TcdSetTransferConfig(¤tTCD[tcdIndex], &config, ¤tTCD[0U]); - EDMA_TcdEnableInterrupts(¤tTCD[tcdIndex], (uint32_t)kEDMA_MajorInterruptEnable); - handle->state = (uint32_t)kSAI_BusyLoopTransfer; - break; - } - else - { - EDMA_TcdSetTransferConfig(¤tTCD[tcdIndex], &config, ¤tTCD[tcdIndex + 1U]); - EDMA_TcdEnableInterrupts(¤tTCD[tcdIndex], (uint32_t)kEDMA_MajorInterruptEnable); - } -#endif - - tcdIndex = tcdIndex + 1U; - } - - EDMA_InstallTCD(handle->dmaHandle->base, handle->dmaHandle->channel, ¤tTCD[0]); - /* Start DMA transfer */ - EDMA_StartTransfer(handle->dmaHandle); - /* Enable DMA enable bit */ - SAI_RxEnableDMA(base, kSAI_FIFORequestDMAEnable, true); - - /* Enable the channel FIFO */ - base->RCR3 |= I2S_RCR3_RCE(1UL << handle->channel); - - /* Enable SAI Rx clock */ - SAI_RxEnable(base, true); - - return kStatus_Success; -} - -/*! - * brief Aborts a SAI transfer using eDMA. - * - * This function only aborts the current transfer slots, the other transfer slots' information still kept - * in the handler. If users want to terminate all transfer slots, just call SAI_TransferTerminateSendEDMA. - * - * param base SAI base pointer. - * param handle SAI eDMA handle pointer. - */ -void SAI_TransferAbortSendEDMA(I2S_Type *base, sai_edma_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable dma */ - EDMA_AbortTransfer(handle->dmaHandle); - - /* Disable the channel FIFO */ - base->TCR3 &= ~I2S_TCR3_TCE_MASK; - - /* Disable DMA enable bit */ - SAI_TxEnableDMA(base, kSAI_FIFORequestDMAEnable, false); - - /* Disable Tx */ - SAI_TxEnable(base, false); - - /* If Tx is disabled, reset the FIFO pointer and clear error flags */ - if ((base->TCSR & I2S_TCSR_TE_MASK) == 0UL) - { - base->TCSR |= (I2S_TCSR_FR_MASK | I2S_TCSR_SR_MASK); - base->TCSR &= ~I2S_TCSR_SR_MASK; - } - - /* Handle the queue index */ - (void)memset(&handle->saiQueue[handle->queueDriver], 0, sizeof(sai_transfer_t)); - handle->queueDriver = (handle->queueDriver + 1U) % (uint8_t)SAI_XFER_QUEUE_SIZE; - - /* Set the handle state */ - handle->state = (uint32_t)kSAI_Idle; -} - -/*! - * brief Aborts a SAI receive using eDMA. - * - * This function only aborts the current transfer slots, the other transfer slots' information still kept - * in the handler. If users want to terminate all transfer slots, just call SAI_TransferTerminateReceiveEDMA. - * - * param base SAI base pointer. - * param handle SAI eDMA handle pointer. - */ -void SAI_TransferAbortReceiveEDMA(I2S_Type *base, sai_edma_handle_t *handle) -{ - assert(handle != NULL); - - /* Disable dma */ - EDMA_AbortTransfer(handle->dmaHandle); - - /* Disable the channel FIFO */ - base->RCR3 &= ~I2S_RCR3_RCE_MASK; - - /* Disable DMA enable bit */ - SAI_RxEnableDMA(base, kSAI_FIFORequestDMAEnable, false); - - /* Disable Rx */ - SAI_RxEnable(base, false); - - /* If Rx is disabled, reset the FIFO pointer and clear error flags */ - if ((base->RCSR & I2S_RCSR_RE_MASK) == 0UL) - { - base->RCSR |= (I2S_RCSR_FR_MASK | I2S_RCSR_SR_MASK); - base->RCSR &= ~I2S_RCSR_SR_MASK; - } - - /* Handle the queue index */ - (void)memset(&handle->saiQueue[handle->queueDriver], 0, sizeof(sai_transfer_t)); - handle->queueDriver = (handle->queueDriver + 1U) % (uint8_t)SAI_XFER_QUEUE_SIZE; - - /* Set the handle state */ - handle->state = (uint32_t)kSAI_Idle; -} - -/*! - * brief Terminate all SAI send. - * - * This function will clear all transfer slots buffered in the sai queue. If users only want to abort the - * current transfer slot, please call SAI_TransferAbortSendEDMA. - * - * param base SAI base pointer. - * param handle SAI eDMA handle pointer. - */ -void SAI_TransferTerminateSendEDMA(I2S_Type *base, sai_edma_handle_t *handle) -{ - assert(handle != NULL); - - /* Abort the current transfer */ - SAI_TransferAbortSendEDMA(base, handle); - - /* Clear all the internal information */ - (void)memset(handle->tcd, 0, sizeof(handle->tcd)); - (void)memset(handle->saiQueue, 0, sizeof(handle->saiQueue)); - (void)memset(handle->transferSize, 0, sizeof(handle->transferSize)); - - handle->queueUser = 0U; - handle->queueDriver = 0U; -} - -/*! - * brief Terminate all SAI receive. - * - * This function will clear all transfer slots buffered in the sai queue. If users only want to abort the - * current transfer slot, please call SAI_TransferAbortReceiveEDMA. - * - * param base SAI base pointer. - * param handle SAI eDMA handle pointer. - */ -void SAI_TransferTerminateReceiveEDMA(I2S_Type *base, sai_edma_handle_t *handle) -{ - assert(handle != NULL); - - /* Abort the current transfer */ - SAI_TransferAbortReceiveEDMA(base, handle); - - /* Clear all the internal information */ - (void)memset(handle->tcd, 0, sizeof(handle->tcd)); - (void)memset(handle->saiQueue, 0, sizeof(handle->saiQueue)); - (void)memset(handle->transferSize, 0, sizeof(handle->transferSize)); - - handle->queueUser = 0U; - handle->queueDriver = 0U; -} - -/*! - * brief Gets byte count sent by SAI. - * - * param base SAI base pointer. - * param handle SAI eDMA handle pointer. - * param count Bytes count sent by SAI. - * retval kStatus_Success Succeed get the transfer count. - * retval kStatus_NoTransferInProgress There is no non-blocking transaction in progress. - */ -status_t SAI_TransferGetSendCountEDMA(I2S_Type *base, sai_edma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - status_t status = kStatus_Success; - - if (handle->state != (uint32_t)kSAI_Busy) - { - status = kStatus_NoTransferInProgress; - } - else - { - *count = (handle->transferSize[handle->queueDriver] - - (uint32_t)handle->nbytes * - EDMA_GetRemainingMajorLoopCount(handle->dmaHandle->base, handle->dmaHandle->channel)); - } - - return status; -} - -/*! - * brief Gets byte count received by SAI. - * - * param base SAI base pointer - * param handle SAI eDMA handle pointer. - * param count Bytes count received by SAI. - * retval kStatus_Success Succeed get the transfer count. - * retval kStatus_NoTransferInProgress There is no non-blocking transaction in progress. - */ -status_t SAI_TransferGetReceiveCountEDMA(I2S_Type *base, sai_edma_handle_t *handle, size_t *count) -{ - assert(handle != NULL); - - status_t status = kStatus_Success; - - if (handle->state != (uint32_t)kSAI_Busy) - { - status = kStatus_NoTransferInProgress; - } - else - { - *count = (handle->transferSize[handle->queueDriver] - - (uint32_t)handle->nbytes * - EDMA_GetRemainingMajorLoopCount(handle->dmaHandle->base, handle->dmaHandle->channel)); - } - - return status; -} - -/*! - * @rief Gets valid transfer slot. - * - * This function can be used to query the valid transfer request slot that the application can submit. - * It should be called in the critical section, that means the application could call it in the corresponding callback - * function or disable IRQ before calling it in the application, otherwise, the returned value may not correct. - * - * param base SAI base pointer - * param handle SAI eDMA handle pointer. - * retval valid slot count that application submit. - */ -uint32_t SAI_TransferGetValidTransferSlotsEDMA(I2S_Type *base, sai_edma_handle_t *handle) -{ - uint32_t validSlot = 0U; - - for (uint32_t i = 0U; i < (uint32_t)SAI_XFER_QUEUE_SIZE; i++) - { - if (handle->saiQueue[i].data == NULL) - { - validSlot++; - } - } - - return validSlot; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_sai_edma.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_sai_edma.h deleted file mode 100644 index 42507ff437e..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_sai_edma.h +++ /dev/null @@ -1,349 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_SAI_EDMA_H_ -#define FSL_SAI_EDMA_H_ - -#include "fsl_edma.h" -#include "fsl_sai.h" - -/*! - * @addtogroup sai_edma SAI EDMA Driver - * @ingroup sai - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -#define FSL_SAI_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 7, 1)) /*!< Version 2.7.1 */ -/*! @} */ - -typedef struct sai_edma_handle sai_edma_handle_t; - -/*! @brief SAI eDMA transfer callback function for finish and error */ -typedef void (*sai_edma_callback_t)(I2S_Type *base, sai_edma_handle_t *handle, status_t status, void *userData); - -/*!@brief sai interleave type */ -typedef enum _sai_edma_interleave -{ - kSAI_EDMAInterleavePerChannelSample = - 0U, /*!< SAI data interleave per channel sample - * --------------------------------------------------------------------------------------------------- - * |LEFT CHANNEL | RIGHT CHANNEL | LEFT CHANNEL | RIGHT CHANNEL | LEFT CHANNEL | RIGHT CHANNEL | ....| - * --------------------------------------------------------------------------------------------------- - */ - kSAI_EDMAInterleavePerChannelBlock = - 1U, /*!< SAI data interleave per channel block - * -------------------------------------------------------------------------------------------------------- - * |LEFT CHANNEL | LEFT CHANNEL | LEFT CHANNEL | ... | RIGHT CHANNEL | RIGHT CHANNEL | RIGHT CHANNEL | ...| - * -------------------------------------------------------------------------------------------------------- - */ -} sai_edma_interleave_t; - -/*! @brief SAI DMA transfer handle, users should not touch the content of the handle.*/ -struct sai_edma_handle -{ - edma_handle_t *dmaHandle; /*!< DMA handler for SAI send */ - uint8_t nbytes; /*!< eDMA minor byte transfer count initially configured. */ - uint8_t bytesPerFrame; /*!< Bytes in a frame */ - uint8_t channelMask; /*!< Enabled channel mask value, reference _sai_channel_mask */ - uint8_t channelNums; /*!< total enabled channel nums */ - uint8_t channel; /*!< Which data channel */ - uint8_t count; /*!< The transfer data count in a DMA request */ - uint32_t state; /*!< Internal state for SAI eDMA transfer */ - sai_edma_callback_t callback; /*!< Callback for users while transfer finish or error occurs */ - void *userData; /*!< User callback parameter */ - uint8_t tcd[(SAI_XFER_QUEUE_SIZE + 1U) * sizeof(edma_tcd_t)]; /*!< TCD pool for eDMA transfer. */ - sai_transfer_t saiQueue[SAI_XFER_QUEUE_SIZE]; /*!< Transfer queue storing queued transfer. */ - size_t transferSize[SAI_XFER_QUEUE_SIZE]; /*!< Data bytes need to transfer */ - sai_edma_interleave_t interleaveType; /*!< Transfer interleave type */ - volatile uint8_t queueUser; /*!< Index for user to queue transfer. */ - volatile uint8_t queueDriver; /*!< Index for driver to get the transfer data and size */ -}; - -/******************************************************************************* - * APIs - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name eDMA Transactional - * @{ - */ - -/*! - * @brief Initializes the SAI eDMA handle. - * - * This function initializes the SAI master DMA handle, which can be used for other SAI master transactional APIs. - * Usually, for a specified SAI instance, call this API once to get the initialized handle. - * - * @param base SAI base pointer. - * @param handle SAI eDMA handle pointer. - * @param callback Pointer to user callback function. - * @param userData User parameter passed to the callback function. - * @param txDmaHandle eDMA handle pointer, this handle shall be static allocated by users. - */ -void SAI_TransferTxCreateHandleEDMA(I2S_Type *base, - sai_edma_handle_t *handle, - sai_edma_callback_t callback, - void *userData, - edma_handle_t *txDmaHandle); - -/*! - * @brief Initializes the SAI Rx eDMA handle. - * - * This function initializes the SAI slave DMA handle, which can be used for other SAI master transactional APIs. - * Usually, for a specified SAI instance, call this API once to get the initialized handle. - * - * @param base SAI base pointer. - * @param handle SAI eDMA handle pointer. - * @param callback Pointer to user callback function. - * @param userData User parameter passed to the callback function. - * @param rxDmaHandle eDMA handle pointer, this handle shall be static allocated by users. - */ -void SAI_TransferRxCreateHandleEDMA(I2S_Type *base, - sai_edma_handle_t *handle, - sai_edma_callback_t callback, - void *userData, - edma_handle_t *rxDmaHandle); - -/*! - * @brief Initializes the SAI interleave type. - * - * This function initializes the SAI DMA handle member interleaveType, it shall be called only when application would - * like to use type kSAI_EDMAInterleavePerChannelBlock, since the default interleaveType is - * kSAI_EDMAInterleavePerChannelSample always - * - * @param handle SAI eDMA handle pointer. - * @param interleaveType Multi channel interleave type. - */ -void SAI_TransferSetInterleaveType(sai_edma_handle_t *handle, sai_edma_interleave_t interleaveType); - -/*! - * @brief Configures the SAI Tx. - * - * @note SAI eDMA supports data transfer in a multiple SAI channels if the FIFO Combine feature is supported. - * To activate the multi-channel transfer enable SAI channels by filling the channelMask - * of sai_transceiver_t with the corresponding values of _sai_channel_mask enum, enable the FIFO Combine - * mode by assigning kSAI_FifoCombineModeEnabledOnWrite to the fifoCombine member of sai_fifo_combine_t - * which is a member of sai_transceiver_t. - * This is an example of multi-channel data transfer configuration step. - * @code - * sai_transceiver_t config; - * SAI_GetClassicI2SConfig(&config, kSAI_WordWidth16bits, kSAI_Stereo, kSAI_Channel0Mask|kSAI_Channel1Mask); - * config.fifo.fifoCombine = kSAI_FifoCombineModeEnabledOnWrite; - * SAI_TransferTxSetConfigEDMA(I2S0, &edmaHandle, &config); - * @endcode - * - * @param base SAI base pointer. - * @param handle SAI eDMA handle pointer. - * @param saiConfig sai configurations. - */ -void SAI_TransferTxSetConfigEDMA(I2S_Type *base, sai_edma_handle_t *handle, sai_transceiver_t *saiConfig); - -/*! - * @brief Configures the SAI Rx. - * - * @note SAI eDMA supports data transfer in a multiple SAI channels if the FIFO Combine feature is supported. - * To activate the multi-channel transfer enable SAI channels by filling the channelMask - * of sai_transceiver_t with the corresponding values of _sai_channel_mask enum, enable the FIFO Combine - * mode by assigning kSAI_FifoCombineModeEnabledOnRead to the fifoCombine member of sai_fifo_combine_t - * which is a member of sai_transceiver_t. - * This is an example of multi-channel data transfer configuration step. - * @code - * sai_transceiver_t config; - * SAI_GetClassicI2SConfig(&config, kSAI_WordWidth16bits, kSAI_Stereo, kSAI_Channel0Mask|kSAI_Channel1Mask); - * config.fifo.fifoCombine = kSAI_FifoCombineModeEnabledOnRead; - * SAI_TransferRxSetConfigEDMA(I2S0, &edmaHandle, &config); - * @endcode - * @param base SAI base pointer. - * @param handle SAI eDMA handle pointer. - * @param saiConfig sai configurations. - */ -void SAI_TransferRxSetConfigEDMA(I2S_Type *base, sai_edma_handle_t *handle, sai_transceiver_t *saiConfig); - -/*! - * @brief Performs a non-blocking SAI transfer using DMA. - * - * @note This interface returns immediately after the transfer initiates. Call - * SAI_GetTransferStatus to poll the transfer status and check whether the SAI transfer is finished. - * - * This function support multi channel transfer, - * 1. for the sai IP support fifo combine mode, application should enable the fifo combine mode, no limitation - * on channel numbers - * 2. for the sai IP not support fifo combine mode, sai edma provide another solution which using - * EDMA modulo feature, but support 2 or 4 channels only. - * - * @param base SAI base pointer. - * @param handle SAI eDMA handle pointer. - * @param xfer Pointer to the DMA transfer structure. - * @retval kStatus_Success Start a SAI eDMA send successfully. - * @retval kStatus_InvalidArgument The input argument is invalid. - * @retval kStatus_TxBusy SAI is busy sending data. - */ -status_t SAI_TransferSendEDMA(I2S_Type *base, sai_edma_handle_t *handle, sai_transfer_t *xfer); - -/*! - * @brief Performs a non-blocking SAI receive using eDMA. - * - * @note This interface returns immediately after the transfer initiates. Call - * the SAI_GetReceiveRemainingBytes to poll the transfer status and check whether the SAI transfer is finished. - * - * This function support multi channel transfer, - * 1. for the sai IP support fifo combine mode, application should enable the fifo combine mode, no limitation - * on channel numbers - * 2. for the sai IP not support fifo combine mode, sai edma provide another solution which using - * EDMA modulo feature, but support 2 or 4 channels only. - * - * @param base SAI base pointer - * @param handle SAI eDMA handle pointer. - * @param xfer Pointer to DMA transfer structure. - * @retval kStatus_Success Start a SAI eDMA receive successfully. - * @retval kStatus_InvalidArgument The input argument is invalid. - * @retval kStatus_RxBusy SAI is busy receiving data. - */ -status_t SAI_TransferReceiveEDMA(I2S_Type *base, sai_edma_handle_t *handle, sai_transfer_t *xfer); - -/*! - * @brief Performs a non-blocking SAI loop transfer using eDMA. - * - * @note This function support loop transfer only,such as A->B->...->A, application must be aware of - * that the more counts of the loop transfer, then more tcd memory required, as the function use the tcd pool in - * sai_edma_handle_t, so application could redefine the SAI_XFER_QUEUE_SIZE to determine the proper TCD pool size. - * This function support one sai channel only. - * - * Once the loop transfer start, application can use function SAI_TransferAbortSendEDMA to stop the loop transfer. - * - * @param base SAI base pointer. - * @param handle SAI eDMA handle pointer. - * @param xfer Pointer to the DMA transfer structure, should be a array with elements counts >=1(loopTransferCount). - * @param loopTransferCount the counts of xfer array. - * @retval kStatus_Success Start a SAI eDMA send successfully. - * @retval kStatus_InvalidArgument The input argument is invalid. - */ -status_t SAI_TransferSendLoopEDMA(I2S_Type *base, - sai_edma_handle_t *handle, - sai_transfer_t *xfer, - uint32_t loopTransferCount); - -/*! - * @brief Performs a non-blocking SAI loop transfer using eDMA. - * - * @note This function support loop transfer only,such as A->B->...->A, application must be aware of - * that the more counts of the loop transfer, then more tcd memory required, as the function use the tcd pool in - * sai_edma_handle_t, so application could redefine the SAI_XFER_QUEUE_SIZE to determine the proper TCD pool size. - * This function support one sai channel only. - * - * Once the loop transfer start, application can use function SAI_TransferAbortReceiveEDMA to stop the loop transfer. - * - * @param base SAI base pointer. - * @param handle SAI eDMA handle pointer. - * @param xfer Pointer to the DMA transfer structure, should be a array with elements counts >=1(loopTransferCount). - * @param loopTransferCount the counts of xfer array. - * @retval kStatus_Success Start a SAI eDMA receive successfully. - * @retval kStatus_InvalidArgument The input argument is invalid. - */ -status_t SAI_TransferReceiveLoopEDMA(I2S_Type *base, - sai_edma_handle_t *handle, - sai_transfer_t *xfer, - uint32_t loopTransferCount); - -/*! - * @brief Terminate all SAI send. - * - * This function will clear all transfer slots buffered in the sai queue. If users only want to abort the - * current transfer slot, please call SAI_TransferAbortSendEDMA. - * - * @param base SAI base pointer. - * @param handle SAI eDMA handle pointer. - */ -void SAI_TransferTerminateSendEDMA(I2S_Type *base, sai_edma_handle_t *handle); - -/*! - * @brief Terminate all SAI receive. - * - * This function will clear all transfer slots buffered in the sai queue. If users only want to abort the - * current transfer slot, please call SAI_TransferAbortReceiveEDMA. - * - * @param base SAI base pointer. - * @param handle SAI eDMA handle pointer. - */ -void SAI_TransferTerminateReceiveEDMA(I2S_Type *base, sai_edma_handle_t *handle); - -/*! - * @brief Aborts a SAI transfer using eDMA. - * - * This function only aborts the current transfer slots, the other transfer slots' information still kept - * in the handler. If users want to terminate all transfer slots, just call SAI_TransferTerminateSendEDMA. - * - * @param base SAI base pointer. - * @param handle SAI eDMA handle pointer. - */ -void SAI_TransferAbortSendEDMA(I2S_Type *base, sai_edma_handle_t *handle); - -/*! - * @brief Aborts a SAI receive using eDMA. - * - * This function only aborts the current transfer slots, the other transfer slots' information still kept - * in the handler. If users want to terminate all transfer slots, just call SAI_TransferTerminateReceiveEDMA. - * - * @param base SAI base pointer - * @param handle SAI eDMA handle pointer. - */ -void SAI_TransferAbortReceiveEDMA(I2S_Type *base, sai_edma_handle_t *handle); - -/*! - * @brief Gets byte count sent by SAI. - * - * @param base SAI base pointer. - * @param handle SAI eDMA handle pointer. - * @param count Bytes count sent by SAI. - * @retval kStatus_Success Succeed get the transfer count. - * @retval kStatus_NoTransferInProgress There is no non-blocking transaction in progress. - */ -status_t SAI_TransferGetSendCountEDMA(I2S_Type *base, sai_edma_handle_t *handle, size_t *count); - -/*! - * @brief Gets byte count received by SAI. - * - * @param base SAI base pointer - * @param handle SAI eDMA handle pointer. - * @param count Bytes count received by SAI. - * @retval kStatus_Success Succeed get the transfer count. - * @retval kStatus_NoTransferInProgress There is no non-blocking transaction in progress. - */ -status_t SAI_TransferGetReceiveCountEDMA(I2S_Type *base, sai_edma_handle_t *handle, size_t *count); - -/*! - * @brief Gets valid transfer slot. - * - * This function can be used to query the valid transfer request slot that the application can submit. - * It should be called in the critical section, that means the application could call it in the corresponding callback - * function or disable IRQ before calling it in the application, otherwise, the returned value may not correct. - * - * @param base SAI base pointer - * @param handle SAI eDMA handle pointer. - * @retval valid slot count that application submit. - */ -uint32_t SAI_TransferGetValidTransferSlotsEDMA(I2S_Type *base, sai_edma_handle_t *handle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_sctimer.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_sctimer.c deleted file mode 100644 index 54a032e1006..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_sctimer.c +++ /dev/null @@ -1,821 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_sctimer.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.sctimer" -#endif -#if defined(SCT_RSTS_N) || defined(SCT_RSTS) -#define FSL_FEATURE_SCT_HAS_RESET -#endif - - -/*! @brief Typedef for interrupt handler. */ -typedef void (*sctimer_isr_t)(SCT_Type *base); - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Gets the instance from the base address - * - * @param base SCTimer peripheral base address - * - * @return The SCTimer instance - */ -static uint32_t SCTIMER_GetInstance(SCT_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to SCT bases for each instance. */ -static SCT_Type *const s_sctBases[] = SCT_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to SCT clocks for each instance. */ -static const clock_ip_name_t s_sctClocks[] = SCT_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(FSL_FEATURE_SCT_HAS_RESET) -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) -#if defined(FSL_FEATURE_SCT_WRITE_ZERO_ASSERT_RESET) && FSL_FEATURE_SCT_WRITE_ZERO_ASSERT_RESET -/*! @brief Pointers to SCT resets for each instance, writing a zero asserts the reset */ -static const reset_ip_name_t s_sctResets[] = SCT_RSTS_N; -#else -/*! @brief Pointers to SCT resets for each instance, writing a one asserts the reset */ -static const reset_ip_name_t s_sctResets[] = SCT_RSTS; -#endif -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ -#endif /* FSL_FEATURE_SCT_HAS_RESET */ - -/*!< @brief SCTimer event Callback function. */ -static sctimer_event_callback_t s_eventCallback[FSL_FEATURE_SCT_NUMBER_OF_EVENTS]; - -/*!< @brief Keep track of SCTimer event number */ -static uint32_t s_currentEvent; - -/*!< @brief Keep track of SCTimer state number */ -static uint32_t s_currentState; - -/*!< @brief Keep track of SCTimer unify 32-bit or low 16-bit match/capture register number. */ -static uint32_t s_currentMatch; -/*!< @brief Keep track of SCTimer high 16-bit match/capture register number. */ -static uint32_t s_currentMatchhigh; - -/*! @brief Pointer to SCTimer IRQ handler */ -static sctimer_isr_t s_sctimerIsr; - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t SCTIMER_GetInstance(SCT_Type *base) -{ - uint32_t instance; - uint32_t sctArrayCount = (sizeof(s_sctBases) / sizeof(s_sctBases[0])); - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < sctArrayCount; instance++) - { - if (s_sctBases[instance] == base) - { - break; - } - } - - assert(instance < sctArrayCount); - - return instance; -} - -/*! - * brief Ungates the SCTimer clock and configures the peripheral for basic operation. - * - * note This API should be called at the beginning of the application using the SCTimer driver. - * - * param base SCTimer peripheral base address - * param config Pointer to the user configuration structure. - * - * return kStatus_Success indicates success; Else indicates failure. - */ -status_t SCTIMER_Init(SCT_Type *base, const sctimer_config_t *config) -{ - assert(NULL != config); - - uint32_t i; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the SCTimer clock*/ - CLOCK_EnableClock(s_sctClocks[SCTIMER_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(FSL_FEATURE_SCT_HAS_RESET) -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) - /* Reset the module. */ - RESET_PeripheralReset(s_sctResets[SCTIMER_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ -#endif /* FSL_FEATURE_SCT_HAS_RESET */ - - /* Setup the counter operation. For Current Driver interface SCTIMER_Init don't know detail - * frequency of input clock, but User know it. So the INSYNC have to set by user level. */ - base->CONFIG = SCT_CONFIG_CKSEL(config->clockSelect) | SCT_CONFIG_CLKMODE(config->clockMode) | - SCT_CONFIG_UNIFY(config->enableCounterUnify) | SCT_CONFIG_INSYNC(config->inputsync); - - /* Write to the control register, keep the counters halted. */ - base->CTRL = - SCT_CTRL_BIDIR_L(config->enableBidirection_l) | SCT_CTRL_PRE_L(config->prescale_l) | SCT_CTRL_HALT_L_MASK; - /* Clear the counter after changing the PRE value. */ - base->CTRL |= SCT_CTRL_CLRCTR_L_MASK; - - if (!(config->enableCounterUnify)) - { - base->CTRL |= - SCT_CTRL_BIDIR_H(config->enableBidirection_h) | SCT_CTRL_PRE_H(config->prescale_h) | SCT_CTRL_HALT_H_MASK; - base->CTRL |= SCT_CTRL_CLRCTR_H_MASK; - } - - /* Initial state of channel output */ - base->OUTPUT = config->outInitState; - - /* Clear the global variables */ - s_currentEvent = 0U; - s_currentState = 0U; - s_currentMatch = 0U; - s_currentMatchhigh = 0U; - - /* Clear the callback array */ - for (i = 0; i < (uint32_t)FSL_FEATURE_SCT_NUMBER_OF_EVENTS; i++) - { - s_eventCallback[i] = NULL; - } - - /* Save interrupt handler */ - s_sctimerIsr = SCTIMER_EventHandleIRQ; - - return kStatus_Success; -} - -/*! - * brief Gates the SCTimer clock. - * - * param base SCTimer peripheral base address - */ -void SCTIMER_Deinit(SCT_Type *base) -{ - /* Halt the counters */ - base->CTRL |= (SCT_CTRL_HALT_L_MASK | SCT_CTRL_HALT_H_MASK); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable the SCTimer clock*/ - CLOCK_DisableClock(s_sctClocks[SCTIMER_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Fills in the SCTimer configuration structure with the default settings. - * - * The default values are: - * code - * config->enableCounterUnify = true; - * config->clockMode = kSCTIMER_System_ClockMode; - * config->clockSelect = kSCTIMER_Clock_On_Rise_Input_0; - * config->enableBidirection_l = false; - * config->enableBidirection_h = false; - * config->prescale_l = 0U; - * config->prescale_h = 0U; - * config->outInitState = 0U; - * config->inputsync = 0xFU; - * endcode - * param config Pointer to the user configuration structure. - */ -void SCTIMER_GetDefaultConfig(sctimer_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - /* SCT operates as a unified 32-bit counter */ - config->enableCounterUnify = true; - /* System clock clocks the entire SCT module */ - config->clockMode = kSCTIMER_System_ClockMode; - /* This is used only by certain clock modes */ - config->clockSelect = kSCTIMER_Clock_On_Rise_Input_0; - /* Up count mode only for the unified counter */ - config->enableBidirection_l = false; - /* Up count mode only for Counte_H */ - config->enableBidirection_h = false; - /* Prescale factor of 1 */ - config->prescale_l = 0U; - /* Prescale factor of 1 for Counter_H*/ - config->prescale_h = 0U; - /* Clear outputs */ - config->outInitState = 0U; - /* Default value is 0xFU, it can be clear as 0 when speical conditions met. - * Condition can be clear as 0: (for all Clock Modes): - * (1) The corresponding input is already synchronous to the SCTimer/PWM clock. - * (2) The SCTimer/PWM clock frequency does not exceed 100 MHz. - * Note: The SCTimer/PWM clock is the bus/system clock for CKMODE 0-2 or asynchronous input - * clock for CKMODE3. - * Another condition can be clear as 0: (for CKMODE2 only) - * (1) The corresponding input is synchronous to the designated CKMODE2 input clock. - * (2) The CKMODE2 input clock frequency is less than one-third the frequency of the bus/system clock. - * Default value set as 0U, input0~input3 are set as bypasses. */ - config->inputsync = 0xFU; -} - -/*! - * brief Configures the PWM signal parameters. - * - * Call this function to configure the PWM signal period, mode, duty cycle, and edge. This - * function will create 2 events; one of the events will trigger on match with the pulse value - * and the other will trigger when the counter matches the PWM period. The PWM period event is - * also used as a limit event to reset the counter or change direction. Both events are enabled - * for the same state. The state number can be retrieved by calling the function - * SCTIMER_GetCurrentStateNumber(). - * The counter is set to operate as one 32-bit counter (unify bit is set to 1). - * The counter operates in bi-directional mode when generating a center-aligned PWM. - * - * note When setting PWM output from multiple output pins, they all should use the same PWM mode - * i.e all PWM's should be either edge-aligned or center-aligned. - * When using this API, the PWM signal frequency of all the initialized channels must be the same. - * Otherwise all the initialized channels' PWM signal frequency is equal to the last call to the - * API's pwmFreq_Hz. - * - * param base SCTimer peripheral base address - * param pwmParams PWM parameters to configure the output - * param mode PWM operation mode, options available in enumeration ::sctimer_pwm_mode_t - * param pwmFreq_Hz PWM signal frequency in Hz - * param srcClock_Hz SCTimer counter clock in Hz - * param event Pointer to a variable where the PWM period event number is stored - * - * return kStatus_Success on success - * kStatus_Fail If we have hit the limit in terms of number of events created or if - * an incorrect PWM dutycylce is passed in. - */ -status_t SCTIMER_SetupPwm(SCT_Type *base, - const sctimer_pwm_signal_param_t *pwmParams, - sctimer_pwm_mode_t mode, - uint32_t pwmFreq_Hz, - uint32_t srcClock_Hz, - uint32_t *event) -{ - assert(NULL != pwmParams); - assert(0U != srcClock_Hz); - assert(0U != pwmFreq_Hz); - assert((uint32_t)pwmParams->output < (uint32_t)FSL_FEATURE_SCT_NUMBER_OF_OUTPUTS); - assert(1U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - - /* If we do not have enough events available (this function will create two events), - * the function will return fail. - */ - status_t status = kStatus_Fail; - status_t status2; - uint32_t period, pulsePeriod = 0; - uint32_t sctClock = srcClock_Hz / (((base->CTRL & SCT_CTRL_PRE_L_MASK) >> SCT_CTRL_PRE_L_SHIFT) + 1U); - uint32_t periodEvent = 0, pulseEvent = 0; - uint32_t reg; - - if ((s_currentEvent + 2U) <= (uint32_t)FSL_FEATURE_SCT_NUMBER_OF_EVENTS) - { - /* Use bi-directional mode for center-aligned PWM */ - if (mode == kSCTIMER_CenterAlignedPwm) - { - base->CTRL |= SCT_CTRL_BIDIR_L_MASK; - } - - /* Calculate PWM period match value */ - if (mode == kSCTIMER_EdgeAlignedPwm) - { - period = (sctClock / pwmFreq_Hz) - 1U; - } - else - { - period = sctClock / (pwmFreq_Hz * 2U); - } - - /* For 100% dutycyle, make pulse period greater than period so the event will never occur */ - if (pwmParams->dutyCyclePercent >= 100U) - { - pulsePeriod = period + 2U; - } - else - { - pulsePeriod = (uint32_t)(((uint64_t)period * pwmParams->dutyCyclePercent) / 100U); - } - - /* Schedule an event when we reach the PWM period */ - status = - SCTIMER_CreateAndScheduleEvent(base, kSCTIMER_MatchEventOnly, period, 0, kSCTIMER_Counter_U, &periodEvent); - - /* Schedule an event when we reach the pulse width */ - status2 = SCTIMER_CreateAndScheduleEvent(base, kSCTIMER_MatchEventOnly, pulsePeriod, 0, kSCTIMER_Counter_U, - &pulseEvent); - - if ((kStatus_Success == status) && (kStatus_Success == status2)) - { - /* Reset the counter when we reach the PWM period */ - SCTIMER_SetupCounterLimitAction(base, kSCTIMER_Counter_U, periodEvent); - - /* Return the period event to the user */ - *event = periodEvent; - - /* For high-true level */ - if ((uint32_t)pwmParams->level == (uint32_t)kSCTIMER_HighTrue) - { - if (mode == kSCTIMER_EdgeAlignedPwm) - { - /* Set the initial output level to low which is the inactive state */ - base->OUTPUT &= ~(1UL << (uint32_t)pwmParams->output); - /* Set the output when we reach the PWM period */ - SCTIMER_SetupOutputSetAction(base, (uint32_t)pwmParams->output, periodEvent); - /* Clear the output when we reach the PWM pulse value */ - SCTIMER_SetupOutputClearAction(base, (uint32_t)pwmParams->output, pulseEvent); - } - else - { - /* Set the initial output level to high which is the active state */ - base->OUTPUT |= (1UL << (uint32_t)pwmParams->output); - /* Clear the output when we reach the PWM pulse event */ - SCTIMER_SetupOutputClearAction(base, (uint32_t)pwmParams->output, pulseEvent); - /* Reverse output when down counting */ - reg = base->OUTPUTDIRCTRL; - reg &= ~((uint32_t)SCT_OUTPUTDIRCTRL_SETCLR0_MASK << (2U * (uint32_t)pwmParams->output)); - reg |= (1UL << (2U * (uint32_t)pwmParams->output)); - base->OUTPUTDIRCTRL = reg; - } - } - /* For low-true level */ - else - { - if (mode == kSCTIMER_EdgeAlignedPwm) - { - /* Set the initial output level to high which is the inactive state */ - base->OUTPUT |= (1UL << (uint32_t)pwmParams->output); - /* Clear the output when we reach the PWM period */ - SCTIMER_SetupOutputClearAction(base, (uint32_t)pwmParams->output, periodEvent); - /* Set the output when we reach the PWM pulse value */ - SCTIMER_SetupOutputSetAction(base, (uint32_t)pwmParams->output, pulseEvent); - } - else - { - /* Set the initial output level to low which is the active state */ - base->OUTPUT &= ~(1UL << (uint32_t)pwmParams->output); - /* Set the output when we reach the PWM pulse event */ - SCTIMER_SetupOutputSetAction(base, (uint32_t)pwmParams->output, pulseEvent); - /* Reverse output when down counting */ - reg = base->OUTPUTDIRCTRL; - reg &= ~((uint32_t)SCT_OUTPUTDIRCTRL_SETCLR0_MASK << (2U * (uint32_t)pwmParams->output)); - reg |= (1UL << (2U * (uint32_t)pwmParams->output)); - base->OUTPUTDIRCTRL = reg; - } - } - } - else - { - status = kStatus_Fail; - } - } - - return status; -} - -/*! - * brief Updates the duty cycle of an active PWM signal. - * - * Before calling this function, the counter is set to operate as one 32-bit counter (unify bit is set to 1). - * - * param base SCTimer peripheral base address - * param output The output to configure - * param dutyCyclePercent New PWM pulse width; the value should be between 0 to 100 - * param event Event number associated with this PWM signal. This was returned to the user by the - * function SCTIMER_SetupPwm(). - */ -void SCTIMER_UpdatePwmDutycycle(SCT_Type *base, sctimer_out_t output, uint8_t dutyCyclePercent, uint32_t event) - -{ - assert(dutyCyclePercent <= 100U); - assert((uint32_t)output < (uint32_t)FSL_FEATURE_SCT_NUMBER_OF_OUTPUTS); - assert(1U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - - uint32_t periodMatchReg, pulseMatchReg; - uint32_t pulsePeriod = 0, period; - bool isHighTrue = (0U != (base->OUT[output].CLR & (1UL << (event + 1U)))); - - /* Retrieve the match register number for the PWM period */ - periodMatchReg = base->EV[event].CTRL & SCT_EV_CTRL_MATCHSEL_MASK; - - /* Retrieve the match register number for the PWM pulse period */ - pulseMatchReg = base->EV[event + 1U].CTRL & SCT_EV_CTRL_MATCHSEL_MASK; - - period = base->MATCH[periodMatchReg]; - - /* Stop the counter before updating match register */ - SCTIMER_StopTimer(base, (uint32_t)kSCTIMER_Counter_U); - - /* For 100% dutycyle, make pulse period greater than period so the event will never occur */ - if (dutyCyclePercent >= 100U) - { - pulsePeriod = period + 2U; - - /* Set the initial output level base on output mode */ - if (isHighTrue) - { - base->OUTPUT |= (1UL << (uint32_t)output); - } - else - { - base->OUTPUT &= ~(1UL << (uint32_t)output); - } - } - else - { - pulsePeriod = (uint32_t)(((uint64_t)period * dutyCyclePercent) / 100U); - } - - /* Update dutycycle */ - base->MATCH[pulseMatchReg] = pulsePeriod; - base->MATCHREL[pulseMatchReg] = pulsePeriod; - - /* Restart the counter */ - SCTIMER_StartTimer(base, (uint32_t)kSCTIMER_Counter_U); -} - -/*! - * brief Create an event that is triggered on a match or IO and schedule in current state. - * - * This function will configure an event using the options provided by the user. If the event type uses - * the counter match, then the function will set the user provided match value into a match register - * and put this match register number into the event control register. - * The event is enabled for the current state and the event number is increased by one at the end. - * The function returns the event number; this event number can be used to configure actions to be - * done when this event is triggered. - * - * param base SCTimer peripheral base address - * param howToMonitor Event type; options are available in the enumeration ::sctimer_event_t - * param matchValue The match value that will be programmed to a match register - * param whichIO The input or output that will be involved in event triggering. This field - * is ignored if the event type is "match only" - * param whichCounter SCTimer counter to use. In 16-bit mode, we can select Counter_L and Counter_H, - * In 32-bit mode, we can select Counter_U. - * param event Pointer to a variable where the new event number is stored - * - * return kStatus_Success on success - * kStatus_Error if we have hit the limit in terms of number of events created or - if we have reached the limit in terms of number of match registers - */ -status_t SCTIMER_CreateAndScheduleEvent(SCT_Type *base, - sctimer_event_t howToMonitor, - uint32_t matchValue, - uint32_t whichIO, - sctimer_counter_t whichCounter, - uint32_t *event) -{ - uint32_t combMode = (((uint32_t)howToMonitor & SCT_EV_CTRL_COMBMODE_MASK) >> SCT_EV_CTRL_COMBMODE_SHIFT); - uint32_t currentCtrlVal = (uint32_t)howToMonitor; - status_t status = kStatus_Success; - uint32_t temp = 0; - - if (s_currentEvent < (uint32_t)FSL_FEATURE_SCT_NUMBER_OF_EVENTS) - { - if (2U == combMode) - { - base->EV[s_currentEvent].CTRL = currentCtrlVal | SCT_EV_CTRL_IOSEL(whichIO); - } - else - { - if ((0U == combMode) || (3U == combMode)) - { - currentCtrlVal |= SCT_EV_CTRL_IOSEL(whichIO); - } - - if ((kSCTIMER_Counter_L == whichCounter) && (0U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK))) - { - if (s_currentMatch < (uint32_t)FSL_FEATURE_SCT_NUMBER_OF_MATCH_CAPTURE) - { - currentCtrlVal |= SCT_EV_CTRL_MATCHSEL(s_currentMatch); - - /* Use Counter_L bits if user wants to setup the Low counter */ - base->MATCH_ACCESS16BIT[s_currentMatch].MATCHL = (uint16_t)matchValue; - base->MATCHREL_ACCESS16BIT[s_currentMatch].MATCHRELL = (uint16_t)matchValue; - base->EV[s_currentEvent].CTRL = currentCtrlVal; - - /* Increment the match register number */ - s_currentMatch++; - } - else - { - /* An error would occur if we have hit the limit in terms of number of match registers */ - status = kStatus_Fail; - } - } - else if ((kSCTIMER_Counter_H == whichCounter) && (0U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK))) - { - if (s_currentMatchhigh < (uint32_t)FSL_FEATURE_SCT_NUMBER_OF_MATCH_CAPTURE) - { - currentCtrlVal |= SCT_EV_CTRL_MATCHSEL(s_currentMatchhigh); - - /* Use Counter_H bits if user wants to setup the High counter */ - currentCtrlVal |= SCT_EV_CTRL_HEVENT(1U); - temp = base->MATCH_ACCESS16BIT[s_currentMatchhigh].MATCHL; - base->MATCH[s_currentMatchhigh] = temp | (matchValue << 16U); - temp = base->MATCHREL_ACCESS16BIT[s_currentMatchhigh].MATCHRELL; - base->MATCHREL[s_currentMatchhigh] = temp | (matchValue << 16U); - - base->EV[s_currentEvent].CTRL = currentCtrlVal; - /* Increment the match register number */ - s_currentMatchhigh++; - } - else - { - /* An error would occur if we have hit the limit in terms of number of match registers */ - status = kStatus_Fail; - } - } - else if ((kSCTIMER_Counter_U == whichCounter) && (0U != (base->CONFIG & SCT_CONFIG_UNIFY_MASK))) - { - if (s_currentMatch < (uint32_t)FSL_FEATURE_SCT_NUMBER_OF_MATCH_CAPTURE) - { - /* Use Counter_L bits if counter is operating in 32-bit mode */ - currentCtrlVal |= SCT_EV_CTRL_MATCHSEL(s_currentMatch); - - base->MATCH[s_currentMatch] = matchValue; - base->MATCHREL[s_currentMatch] = matchValue; - base->EV[s_currentEvent].CTRL = currentCtrlVal; - - /* Increment the match register number */ - s_currentMatch++; - } - else - { - /* An error would occur if we have hit the limit in terms of number of match registers */ - status = kStatus_Fail; - } - } - else - { - /* The used counter must match the CONFIG[UNIFY] bit selection */ - status = kStatus_Fail; - } - } - - if (kStatus_Success == status) - { - /* Enable the event in the current state */ - base->EV[s_currentEvent].STATE = (1UL << s_currentState); - - /* Return the event number */ - *event = s_currentEvent; - - /* Increment the event number */ - s_currentEvent++; - } - } - else - { - /* An error would occur if we have hit the limit in terms of number of events created */ - status = kStatus_Fail; - } - - return status; -} - -/*! - * brief Enable an event in the current state. - * - * This function will allow the event passed in to trigger in the current state. The event must - * be created earlier by either calling the function SCTIMER_SetupPwm() or function - * SCTIMER_CreateAndScheduleEvent() . - * - * param base SCTimer peripheral base address - * param event Event number to enable in the current state - * - */ -void SCTIMER_ScheduleEvent(SCT_Type *base, uint32_t event) -{ - /* Enable event in the current state */ - base->EV[event].STATE |= (1UL << s_currentState); -} - -/*! - * brief Increase the state by 1 - * - * All future events created by calling the function SCTIMER_ScheduleEvent() will be enabled in this new - * state. - * - * param base SCTimer peripheral base address - * - * return kStatus_Success on success - * kStatus_Error if we have hit the limit in terms of states used - - */ -status_t SCTIMER_IncreaseState(SCT_Type *base) -{ - status_t status = kStatus_Success; - - /* Return an error if we have hit the limit in terms of states used */ - if (s_currentState >= (uint32_t)FSL_FEATURE_SCT_NUMBER_OF_STATES) - { - status = kStatus_Fail; - } - else - { - s_currentState++; - } - - return status; -} - -/*! - * brief Provides the current state - * - * User can use this to set the next state by calling the function SCTIMER_SetupNextStateAction(). - * - * param base SCTimer peripheral base address - * - * return The current state - */ -uint32_t SCTIMER_GetCurrentState(SCT_Type *base) -{ - return s_currentState; -} - -/*! - * brief Toggle the output level. - * - * This change in the output level is triggered by the event number that is passed in by the user. - * - * param base SCTimer peripheral base address - * param whichIO The output to toggle - * param event Event number that will trigger the output change - */ -void SCTIMER_SetupOutputToggleAction(SCT_Type *base, uint32_t whichIO, uint32_t event) -{ - assert(whichIO < (uint32_t)FSL_FEATURE_SCT_NUMBER_OF_OUTPUTS); - - uint32_t reg; - - /* Set the same event to set and clear the output */ - base->OUT[whichIO].CLR |= (1UL << event); - base->OUT[whichIO].SET |= (1UL << event); - - /* Set the conflict resolution to toggle output */ - reg = base->RES; - reg &= ~(((uint32_t)SCT_RES_O0RES_MASK) << (2U * whichIO)); - reg |= ((uint32_t)(kSCTIMER_ResolveToggle)) << (2U * whichIO); - base->RES = reg; -} - -/*! - * brief Setup capture of the counter value on trigger of a selected event - * - * param base SCTimer peripheral base address - * param whichCounter SCTimer counter to use. In 16-bit mode, we can select Counter_L and Counter_H, - * In 32-bit mode, we can select Counter_U. - * param captureRegister Pointer to a variable where the capture register number will be returned. User - * can read the captured value from this register when the specified event is triggered. - * param event Event number that will trigger the capture - * - * return kStatus_Success on success - * kStatus_Error if we have hit the limit in terms of number of match/capture registers available - */ -status_t SCTIMER_SetupCaptureAction(SCT_Type *base, - sctimer_counter_t whichCounter, - uint32_t *captureRegister, - uint32_t event) -{ - status_t status; - uint32_t temp = 0; - - if ((kSCTIMER_Counter_L == whichCounter) || (kSCTIMER_Counter_U == whichCounter)) - { - if (s_currentMatch < (uint32_t)FSL_FEATURE_SCT_NUMBER_OF_MATCH_CAPTURE) - { - /* Set the bit to enable event */ - base->CAPCTRL_ACCESS16BIT[s_currentMatch].CAPCTRLL |= SCT_CAPCTRLL_CAPCTRLL(1UL << event); - - /* Set this resource to be a capture rather than match */ - base->REGMODE_ACCESS16BIT.REGMODEL |= SCT_REGMODEL_REGMODEL(1UL << s_currentMatch); - - /* Return the match register number */ - *captureRegister = s_currentMatch; - - /* Increase the match register number */ - s_currentMatch++; - - status = kStatus_Success; - } - else - { - /* Return an error if we have hit the limit in terms of number of capture/match registers used */ - status = kStatus_Fail; - } - } - else - { - if (s_currentMatchhigh < (uint32_t)FSL_FEATURE_SCT_NUMBER_OF_MATCH_CAPTURE) - { - /* Set bit to enable event */ - temp = base->CAPCTRL_ACCESS16BIT[s_currentMatchhigh].CAPCTRLL; - base->CAPCTRL[s_currentMatchhigh] = temp | ((uint32_t)((uint32_t)(1UL << event) << 16U) & 0xFFFF0000U); - /* Set this resource to be a capture rather than match */ - temp = base->REGMODE_ACCESS16BIT.REGMODEL; - base->REGMODE = temp | ((uint32_t)((uint32_t)(1UL << s_currentMatchhigh) << 16U) & 0xFFFF0000U); - - /* Return the match register number */ - *captureRegister = s_currentMatchhigh; - - /* Increase the match register number */ - s_currentMatchhigh++; - - status = kStatus_Success; - } - else - { - /* Return an error if we have hit the limit in terms of number of capture/match registers used */ - status = kStatus_Fail; - } - } - - return status; -} - -/*! - * brief Receive noticification when the event trigger an interrupt. - * - * If the interrupt for the event is enabled by the user, then a callback can be registered - * which will be invoked when the event is triggered - * - * param base SCTimer peripheral base address - * param event Event number that will trigger the interrupt - * param callback Function to invoke when the event is triggered - */ - -void SCTIMER_SetCallback(SCT_Type *base, sctimer_event_callback_t callback, uint32_t event) -{ - s_eventCallback[event] = callback; -} - -/*! - * brief SCTimer interrupt handler. - * - * param base SCTimer peripheral base address. - */ -void SCTIMER_EventHandleIRQ(SCT_Type *base) -{ - uint32_t eventFlag = base->EVFLAG; - /* Only clear the flags whose interrupt field is enabled */ - uint32_t clearFlag = (eventFlag & base->EVEN); - uint32_t mask = eventFlag; - uint32_t i; - - /* Invoke the callback for certain events */ - for (i = 0; i < (uint32_t)FSL_FEATURE_SCT_NUMBER_OF_EVENTS; i++) - { - if ((mask & 0x1U) != 0U) - { - if (s_eventCallback[i] != NULL) - { - s_eventCallback[i](); - } - } - mask >>= 1UL; - - if (0U == mask) - { - /* All events have been handled. */ - break; - } - } - - /* Clear event interrupt flag */ - base->EVFLAG = clearFlag; -} - -#if defined(SCT0) -void SCT0_DriverIRQHandler(void); -void SCT0_DriverIRQHandler(void) -{ - s_sctimerIsr(SCT0); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#if defined(SCT) -void SCT_DriverIRQHandler(void); -void SCT_DriverIRQHandler(void) -{ - s_sctimerIsr(SCT); - SDK_ISR_EXIT_BARRIER; -} -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_sctimer.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_sctimer.h deleted file mode 100644 index 4df44e84b31..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_sctimer.h +++ /dev/null @@ -1,1302 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_SCTIMER_H_ -#define FSL_SCTIMER_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup sctimer - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -#define FSL_SCTIMER_DRIVER_VERSION (MAKE_VERSION(2, 5, 1)) /*!< Version */ -/*! @} */ - -#ifndef SCT_EV_STATE_STATEMSKn -#define SCT_EV_STATE_STATEMSKn(x) ((uint32_t)(x) & (((uint32_t)1UL << FSL_FEATURE_SCT_NUMBER_OF_STATES) - 1UL)) -#endif - -/*! @brief SCTimer PWM operation modes */ -typedef enum _sctimer_pwm_mode -{ - kSCTIMER_EdgeAlignedPwm = 0U, /*!< Edge-aligned PWM */ - kSCTIMER_CenterAlignedPwm /*!< Center-aligned PWM */ -} sctimer_pwm_mode_t; - -/*! @brief SCTimer counters type. */ -typedef enum _sctimer_counter -{ - kSCTIMER_Counter_L = (1U << 0), /*!< 16-bit Low counter. */ - kSCTIMER_Counter_H = (1U << 1), /*!< 16-bit High counter. */ - kSCTIMER_Counter_U = (1U << 2), /*!< 32-bit Unified counter. */ -} sctimer_counter_t; - -/*! @brief List of SCTimer input pins */ -typedef enum _sctimer_input -{ - kSCTIMER_Input_0 = 0U, /*!< SCTIMER input 0 */ - kSCTIMER_Input_1, /*!< SCTIMER input 1 */ - kSCTIMER_Input_2, /*!< SCTIMER input 2 */ - kSCTIMER_Input_3, /*!< SCTIMER input 3 */ - kSCTIMER_Input_4, /*!< SCTIMER input 4 */ - kSCTIMER_Input_5, /*!< SCTIMER input 5 */ - kSCTIMER_Input_6, /*!< SCTIMER input 6 */ - kSCTIMER_Input_7 /*!< SCTIMER input 7 */ -} sctimer_input_t; - -/*! @brief List of SCTimer output pins */ -typedef enum _sctimer_out -{ - kSCTIMER_Out_0 = 0U, /*!< SCTIMER output 0*/ - kSCTIMER_Out_1, /*!< SCTIMER output 1 */ - kSCTIMER_Out_2, /*!< SCTIMER output 2 */ - kSCTIMER_Out_3, /*!< SCTIMER output 3 */ - kSCTIMER_Out_4, /*!< SCTIMER output 4 */ - kSCTIMER_Out_5, /*!< SCTIMER output 5 */ - kSCTIMER_Out_6, /*!< SCTIMER output 6 */ - kSCTIMER_Out_7, /*!< SCTIMER output 7 */ - kSCTIMER_Out_8, /*!< SCTIMER output 8 */ - kSCTIMER_Out_9 /*!< SCTIMER output 9 */ -} sctimer_out_t; - -/*! @brief SCTimer PWM output pulse mode: high-true, low-true or no output */ -typedef enum _sctimer_pwm_level_select -{ - kSCTIMER_LowTrue = 0U, /*!< Low true pulses */ - kSCTIMER_HighTrue /*!< High true pulses */ -} sctimer_pwm_level_select_t; - -/*! @brief Options to configure a SCTimer PWM signal */ -typedef struct _sctimer_pwm_signal_param -{ - sctimer_out_t output; /*!< The output pin to use to generate the PWM signal */ - sctimer_pwm_level_select_t level; /*!< PWM output active level select. */ - uint8_t dutyCyclePercent; /*!< PWM pulse width, value should be between 0 to 100 - 0 = always inactive signal (0% duty cycle) - 100 = always active signal (100% duty cycle).*/ -} sctimer_pwm_signal_param_t; - -/*! @brief SCTimer clock mode options */ -typedef enum _sctimer_clock_mode -{ - kSCTIMER_System_ClockMode = 0U, /*!< System Clock Mode */ - kSCTIMER_Sampled_ClockMode, /*!< Sampled System Clock Mode */ - kSCTIMER_Input_ClockMode, /*!< SCT Input Clock Mode */ - kSCTIMER_Asynchronous_ClockMode /*!< Asynchronous Mode */ -} sctimer_clock_mode_t; - -/*! @brief SCTimer clock select options */ -typedef enum _sctimer_clock_select -{ - kSCTIMER_Clock_On_Rise_Input_0 = 0U, /*!< Rising edges on input 0 */ - kSCTIMER_Clock_On_Fall_Input_0, /*!< Falling edges on input 0 */ - kSCTIMER_Clock_On_Rise_Input_1, /*!< Rising edges on input 1 */ - kSCTIMER_Clock_On_Fall_Input_1, /*!< Falling edges on input 1 */ - kSCTIMER_Clock_On_Rise_Input_2, /*!< Rising edges on input 2 */ - kSCTIMER_Clock_On_Fall_Input_2, /*!< Falling edges on input 2 */ - kSCTIMER_Clock_On_Rise_Input_3, /*!< Rising edges on input 3 */ - kSCTIMER_Clock_On_Fall_Input_3, /*!< Falling edges on input 3 */ - kSCTIMER_Clock_On_Rise_Input_4, /*!< Rising edges on input 4 */ - kSCTIMER_Clock_On_Fall_Input_4, /*!< Falling edges on input 4 */ - kSCTIMER_Clock_On_Rise_Input_5, /*!< Rising edges on input 5 */ - kSCTIMER_Clock_On_Fall_Input_5, /*!< Falling edges on input 5 */ - kSCTIMER_Clock_On_Rise_Input_6, /*!< Rising edges on input 6 */ - kSCTIMER_Clock_On_Fall_Input_6, /*!< Falling edges on input 6 */ - kSCTIMER_Clock_On_Rise_Input_7, /*!< Rising edges on input 7 */ - kSCTIMER_Clock_On_Fall_Input_7 /*!< Falling edges on input 7 */ -} sctimer_clock_select_t; - -/*! - * @brief SCTimer output conflict resolution options. - * - * Specifies what action should be taken if multiple events dictate that a given output should be - * both set and cleared at the same time - */ -typedef enum _sctimer_conflict_resolution -{ - kSCTIMER_ResolveNone = 0U, /*!< No change */ - kSCTIMER_ResolveSet, /*!< Set output */ - kSCTIMER_ResolveClear, /*!< Clear output */ - kSCTIMER_ResolveToggle /*!< Toggle output */ -} sctimer_conflict_resolution_t; - -/*! @brief List of SCTimer event generation active direction when the counters are operating in BIDIR mode. */ -typedef enum _sctimer_event_active_direction -{ - kSCTIMER_ActiveIndependent = 0U, /*!< This event is triggered regardless of the count direction. */ - kSCTIMER_ActiveInCountUp, /*!< This event is triggered only during up-counting when BIDIR = 1. */ - kSCTIMER_ActiveInCountDown /*!< This event is triggered only during down-counting when BIDIR = 1. */ -} sctimer_event_active_direction_t; - -/*! @brief List of SCTimer event types */ -typedef enum _sctimer_event -{ - kSCTIMER_InputLowOrMatchEvent = - (0 << SCT_EV_CTRL_COMBMODE_SHIFT) + (0 << SCT_EV_CTRL_IOCOND_SHIFT) + (0 << SCT_EV_CTRL_OUTSEL_SHIFT), - kSCTIMER_InputRiseOrMatchEvent = - (0 << SCT_EV_CTRL_COMBMODE_SHIFT) + (1 << SCT_EV_CTRL_IOCOND_SHIFT) + (0 << SCT_EV_CTRL_OUTSEL_SHIFT), - kSCTIMER_InputFallOrMatchEvent = - (0 << SCT_EV_CTRL_COMBMODE_SHIFT) + (2 << SCT_EV_CTRL_IOCOND_SHIFT) + (0 << SCT_EV_CTRL_OUTSEL_SHIFT), - kSCTIMER_InputHighOrMatchEvent = - (0 << SCT_EV_CTRL_COMBMODE_SHIFT) + (3 << SCT_EV_CTRL_IOCOND_SHIFT) + (0 << SCT_EV_CTRL_OUTSEL_SHIFT), - - kSCTIMER_MatchEventOnly = - (1 << SCT_EV_CTRL_COMBMODE_SHIFT) + (0 << SCT_EV_CTRL_IOCOND_SHIFT) + (0 << SCT_EV_CTRL_OUTSEL_SHIFT), - - kSCTIMER_InputLowEvent = - (2 << SCT_EV_CTRL_COMBMODE_SHIFT) + (0 << SCT_EV_CTRL_IOCOND_SHIFT) + (0 << SCT_EV_CTRL_OUTSEL_SHIFT), - kSCTIMER_InputRiseEvent = - (2 << SCT_EV_CTRL_COMBMODE_SHIFT) + (1 << SCT_EV_CTRL_IOCOND_SHIFT) + (0 << SCT_EV_CTRL_OUTSEL_SHIFT), - kSCTIMER_InputFallEvent = - (2 << SCT_EV_CTRL_COMBMODE_SHIFT) + (2 << SCT_EV_CTRL_IOCOND_SHIFT) + (0 << SCT_EV_CTRL_OUTSEL_SHIFT), - kSCTIMER_InputHighEvent = - (2 << SCT_EV_CTRL_COMBMODE_SHIFT) + (3 << SCT_EV_CTRL_IOCOND_SHIFT) + (0 << SCT_EV_CTRL_OUTSEL_SHIFT), - - kSCTIMER_InputLowAndMatchEvent = - (3 << SCT_EV_CTRL_COMBMODE_SHIFT) + (0 << SCT_EV_CTRL_IOCOND_SHIFT) + (0 << SCT_EV_CTRL_OUTSEL_SHIFT), - kSCTIMER_InputRiseAndMatchEvent = - (3 << SCT_EV_CTRL_COMBMODE_SHIFT) + (1 << SCT_EV_CTRL_IOCOND_SHIFT) + (0 << SCT_EV_CTRL_OUTSEL_SHIFT), - kSCTIMER_InputFallAndMatchEvent = - (3 << SCT_EV_CTRL_COMBMODE_SHIFT) + (2 << SCT_EV_CTRL_IOCOND_SHIFT) + (0 << SCT_EV_CTRL_OUTSEL_SHIFT), - kSCTIMER_InputHighAndMatchEvent = - (3 << SCT_EV_CTRL_COMBMODE_SHIFT) + (3 << SCT_EV_CTRL_IOCOND_SHIFT) + (0 << SCT_EV_CTRL_OUTSEL_SHIFT), - - kSCTIMER_OutputLowOrMatchEvent = - (0 << SCT_EV_CTRL_COMBMODE_SHIFT) + (0 << SCT_EV_CTRL_IOCOND_SHIFT) + (1 << SCT_EV_CTRL_OUTSEL_SHIFT), - kSCTIMER_OutputRiseOrMatchEvent = - (0 << SCT_EV_CTRL_COMBMODE_SHIFT) + (1 << SCT_EV_CTRL_IOCOND_SHIFT) + (1 << SCT_EV_CTRL_OUTSEL_SHIFT), - kSCTIMER_OutputFallOrMatchEvent = - (0 << SCT_EV_CTRL_COMBMODE_SHIFT) + (2 << SCT_EV_CTRL_IOCOND_SHIFT) + (1 << SCT_EV_CTRL_OUTSEL_SHIFT), - kSCTIMER_OutputHighOrMatchEvent = - (0 << SCT_EV_CTRL_COMBMODE_SHIFT) + (3 << SCT_EV_CTRL_IOCOND_SHIFT) + (1 << SCT_EV_CTRL_OUTSEL_SHIFT), - - kSCTIMER_OutputLowEvent = - (2 << SCT_EV_CTRL_COMBMODE_SHIFT) + (0 << SCT_EV_CTRL_IOCOND_SHIFT) + (1 << SCT_EV_CTRL_OUTSEL_SHIFT), - kSCTIMER_OutputRiseEvent = - (2 << SCT_EV_CTRL_COMBMODE_SHIFT) + (1 << SCT_EV_CTRL_IOCOND_SHIFT) + (1 << SCT_EV_CTRL_OUTSEL_SHIFT), - kSCTIMER_OutputFallEvent = - (2 << SCT_EV_CTRL_COMBMODE_SHIFT) + (2 << SCT_EV_CTRL_IOCOND_SHIFT) + (1 << SCT_EV_CTRL_OUTSEL_SHIFT), - kSCTIMER_OutputHighEvent = - (2 << SCT_EV_CTRL_COMBMODE_SHIFT) + (3 << SCT_EV_CTRL_IOCOND_SHIFT) + (1 << SCT_EV_CTRL_OUTSEL_SHIFT), - - kSCTIMER_OutputLowAndMatchEvent = - (3 << SCT_EV_CTRL_COMBMODE_SHIFT) + (0 << SCT_EV_CTRL_IOCOND_SHIFT) + (1 << SCT_EV_CTRL_OUTSEL_SHIFT), - kSCTIMER_OutputRiseAndMatchEvent = - (3 << SCT_EV_CTRL_COMBMODE_SHIFT) + (1 << SCT_EV_CTRL_IOCOND_SHIFT) + (1 << SCT_EV_CTRL_OUTSEL_SHIFT), - kSCTIMER_OutputFallAndMatchEvent = - (3 << SCT_EV_CTRL_COMBMODE_SHIFT) + (2 << SCT_EV_CTRL_IOCOND_SHIFT) + (1 << SCT_EV_CTRL_OUTSEL_SHIFT), - kSCTIMER_OutputHighAndMatchEvent = - (3 << SCT_EV_CTRL_COMBMODE_SHIFT) + (3 << SCT_EV_CTRL_IOCOND_SHIFT) + (1 << SCT_EV_CTRL_OUTSEL_SHIFT) -} sctimer_event_t; - -/*! @brief SCTimer callback typedef. */ -typedef void (*sctimer_event_callback_t)(void); - -/*! @brief List of SCTimer interrupts */ -typedef enum _sctimer_interrupt_enable -{ - kSCTIMER_Event0InterruptEnable = (1U << 0), /*!< Event 0 interrupt */ - kSCTIMER_Event1InterruptEnable = (1U << 1), /*!< Event 1 interrupt */ - kSCTIMER_Event2InterruptEnable = (1U << 2), /*!< Event 2 interrupt */ - kSCTIMER_Event3InterruptEnable = (1U << 3), /*!< Event 3 interrupt */ - kSCTIMER_Event4InterruptEnable = (1U << 4), /*!< Event 4 interrupt */ - kSCTIMER_Event5InterruptEnable = (1U << 5), /*!< Event 5 interrupt */ - kSCTIMER_Event6InterruptEnable = (1U << 6), /*!< Event 6 interrupt */ - kSCTIMER_Event7InterruptEnable = (1U << 7), /*!< Event 7 interrupt */ - kSCTIMER_Event8InterruptEnable = (1U << 8), /*!< Event 8 interrupt */ - kSCTIMER_Event9InterruptEnable = (1U << 9), /*!< Event 9 interrupt */ - kSCTIMER_Event10InterruptEnable = (1U << 10), /*!< Event 10 interrupt */ - kSCTIMER_Event11InterruptEnable = (1U << 11), /*!< Event 11 interrupt */ - kSCTIMER_Event12InterruptEnable = (1U << 12), /*!< Event 12 interrupt */ -} sctimer_interrupt_enable_t; - -/*! @brief List of SCTimer flags */ -typedef enum _sctimer_status_flags -{ - kSCTIMER_Event0Flag = (1U << 0), /*!< Event 0 Flag */ - kSCTIMER_Event1Flag = (1U << 1), /*!< Event 1 Flag */ - kSCTIMER_Event2Flag = (1U << 2), /*!< Event 2 Flag */ - kSCTIMER_Event3Flag = (1U << 3), /*!< Event 3 Flag */ - kSCTIMER_Event4Flag = (1U << 4), /*!< Event 4 Flag */ - kSCTIMER_Event5Flag = (1U << 5), /*!< Event 5 Flag */ - kSCTIMER_Event6Flag = (1U << 6), /*!< Event 6 Flag */ - kSCTIMER_Event7Flag = (1U << 7), /*!< Event 7 Flag */ - kSCTIMER_Event8Flag = (1U << 8), /*!< Event 8 Flag */ - kSCTIMER_Event9Flag = (1U << 9), /*!< Event 9 Flag */ - kSCTIMER_Event10Flag = (1U << 10), /*!< Event 10 Flag */ - kSCTIMER_Event11Flag = (1U << 11), /*!< Event 11 Flag */ - kSCTIMER_Event12Flag = (1U << 12), /*!< Event 12 Flag */ - kSCTIMER_BusErrorLFlag = - (1U << SCT_CONFLAG_BUSERRL_SHIFT), /*!< Bus error due to write when L counter was not halted */ - kSCTIMER_BusErrorHFlag = - (int)(1U << SCT_CONFLAG_BUSERRH_SHIFT) /*!< Bus error due to write when H counter was not halted */ -} sctimer_status_flags_t; - -/*! - * @brief SCTimer configuration structure - * - * This structure holds the configuration settings for the SCTimer peripheral. To initialize this - * structure to reasonable defaults, call the SCTMR_GetDefaultConfig() function and pass a - * pointer to the configuration structure instance. - * - * The configuration structure can be made constant so as to reside in flash. - */ -typedef struct _sctimer_config -{ - bool enableCounterUnify; /*!< true: SCT operates as a unified 32-bit counter; - false: SCT operates as two 16-bit counters. - User can use the 16-bit low counter and the 16-bit high counters at the - same time; for Hardware limit, user can not use unified 32-bit counter - and any 16-bit low/high counter at the same time. */ - sctimer_clock_mode_t clockMode; /*!< SCT clock mode value */ - sctimer_clock_select_t clockSelect; /*!< SCT clock select value */ - bool enableBidirection_l; /*!< true: Up-down count mode for the L or unified counter - false: Up count mode only for the L or unified counter */ - bool enableBidirection_h; /*!< true: Up-down count mode for the H or unified counter - false: Up count mode only for the H or unified counter. - This field is used only if the enableCounterUnify is set - to false */ - uint8_t prescale_l; /*!< Prescale value to produce the L or unified counter clock */ - uint8_t prescale_h; /*!< Prescale value to produce the H counter clock. - This field is used only if the enableCounterUnify is set - to false */ - uint8_t outInitState; /*!< Defines the initial output value */ - uint8_t inputsync; /*!< SCT INSYNC value, INSYNC field in the CONFIG register, from bit9 to bit 16. - it is used to define synchronization for input N: - bit 9 = input 0 - bit 10 = input 1 - bit 11 = input 2 - bit 12 = input 3 - All other bits are reserved (bit13 ~bit 16). - How User to set the the value for the member inputsync. - IE: delay for input0, and input 1, bypasses for input 2 and input 3 - MACRO definition in user level. - \#define INPUTSYNC0 (0U) - \#define INPUTSYNC1 (1U) - \#define INPUTSYNC2 (2U) - \#define INPUTSYNC3 (3U) - User Code. - sctimerInfo.inputsync = (1 << INPUTSYNC2) | (1 << INPUTSYNC3); */ -} sctimer_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Ungates the SCTimer clock and configures the peripheral for basic operation. - * - * @note This API should be called at the beginning of the application using the SCTimer driver. - * - * @param base SCTimer peripheral base address - * @param config Pointer to the user configuration structure. - * - * @return kStatus_Success indicates success; Else indicates failure. - */ -status_t SCTIMER_Init(SCT_Type *base, const sctimer_config_t *config); - -/*! - * @brief Gates the SCTimer clock. - * - * @param base SCTimer peripheral base address - */ -void SCTIMER_Deinit(SCT_Type *base); - -/*! - * @brief Fills in the SCTimer configuration structure with the default settings. - * - * The default values are: - * @code - * config->enableCounterUnify = true; - * config->clockMode = kSCTIMER_System_ClockMode; - * config->clockSelect = kSCTIMER_Clock_On_Rise_Input_0; - * config->enableBidirection_l = false; - * config->enableBidirection_h = false; - * config->prescale_l = 0U; - * config->prescale_h = 0U; - * config->outInitState = 0U; - * config->inputsync = 0xFU; - * @endcode - * @param config Pointer to the user configuration structure. - */ -void SCTIMER_GetDefaultConfig(sctimer_config_t *config); - -/*! @}*/ - -/*! - * @name PWM setup operations - * @{ - */ - -/*! - * @brief Configures the PWM signal parameters. - * - * Call this function to configure the PWM signal period, mode, duty cycle, and edge. This - * function will create 2 events; one of the events will trigger on match with the pulse value - * and the other will trigger when the counter matches the PWM period. The PWM period event is - * also used as a limit event to reset the counter or change direction. Both events are enabled - * for the same state. The state number can be retrieved by calling the function - * SCTIMER_GetCurrentStateNumber(). - * The counter is set to operate as one 32-bit counter (unify bit is set to 1). - * The counter operates in bi-directional mode when generating a center-aligned PWM. - * - * @note When setting PWM output from multiple output pins, they all should use the same PWM mode - * i.e all PWM's should be either edge-aligned or center-aligned. - * When using this API, the PWM signal frequency of all the initialized channels must be the same. - * Otherwise all the initialized channels' PWM signal frequency is equal to the last call to the - * API's pwmFreq_Hz. - * - * @param base SCTimer peripheral base address - * @param pwmParams PWM parameters to configure the output - * @param mode PWM operation mode, options available in enumeration ::sctimer_pwm_mode_t - * @param pwmFreq_Hz PWM signal frequency in Hz - * @param srcClock_Hz SCTimer counter clock in Hz - * @param event Pointer to a variable where the PWM period event number is stored - * - * @return kStatus_Success on success - * kStatus_Fail If we have hit the limit in terms of number of events created or if - * an incorrect PWM dutycylce is passed in. - */ -status_t SCTIMER_SetupPwm(SCT_Type *base, - const sctimer_pwm_signal_param_t *pwmParams, - sctimer_pwm_mode_t mode, - uint32_t pwmFreq_Hz, - uint32_t srcClock_Hz, - uint32_t *event); - -/*! - * @brief Updates the duty cycle of an active PWM signal. - * - * Before calling this function, the counter is set to operate as one 32-bit counter (unify bit is set to 1). - * - * @param base SCTimer peripheral base address - * @param output The output to configure - * @param dutyCyclePercent New PWM pulse width; the value should be between 1 to 100 - * @param event Event number associated with this PWM signal. This was returned to the user by the - * function SCTIMER_SetupPwm(). - */ -void SCTIMER_UpdatePwmDutycycle(SCT_Type *base, sctimer_out_t output, uint8_t dutyCyclePercent, uint32_t event); - -/*! - * @name Interrupt Interface - * @{ - */ - -/*! - * @brief Enables the selected SCTimer interrupts. - * - * @param base SCTimer peripheral base address - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::sctimer_interrupt_enable_t - */ -static inline void SCTIMER_EnableInterrupts(SCT_Type *base, uint32_t mask) -{ - base->EVEN |= mask; -} - -/*! - * @brief Disables the selected SCTimer interrupts. - * - * @param base SCTimer peripheral base address - * @param mask The interrupts to enable. This is a logical OR of members of the - * enumeration ::sctimer_interrupt_enable_t - */ -static inline void SCTIMER_DisableInterrupts(SCT_Type *base, uint32_t mask) -{ - base->EVEN &= ~mask; -} - -/*! - * @brief Gets the enabled SCTimer interrupts. - * - * @param base SCTimer peripheral base address - * - * @return The enabled interrupts. This is the logical OR of members of the - * enumeration ::sctimer_interrupt_enable_t - */ -static inline uint32_t SCTIMER_GetEnabledInterrupts(SCT_Type *base) -{ - return (base->EVEN & 0xFFFFU); -} - -/*! @}*/ - -/*! - * @name Status Interface - * @{ - */ - -/*! - * @brief Gets the SCTimer status flags. - * - * @param base SCTimer peripheral base address - * - * @return The status flags. This is the logical OR of members of the - * enumeration ::sctimer_status_flags_t - */ -static inline uint32_t SCTIMER_GetStatusFlags(SCT_Type *base) -{ - uint32_t statusFlags = 0; - - /* Add the recorded events */ - statusFlags = (base->EVFLAG & 0xFFFFU); - - /* Add bus error flags */ - statusFlags |= (base->CONFLAG & (SCT_CONFLAG_BUSERRL_MASK | SCT_CONFLAG_BUSERRH_MASK)); - - return statusFlags; -} - -/*! - * @brief Clears the SCTimer status flags. - * - * @param base SCTimer peripheral base address - * @param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::sctimer_status_flags_t - */ -static inline void SCTIMER_ClearStatusFlags(SCT_Type *base, uint32_t mask) -{ - /* Write to the flag registers */ - base->EVFLAG = (mask & 0xFFFFU); - base->CONFLAG = (mask & (SCT_CONFLAG_BUSERRL_MASK | SCT_CONFLAG_BUSERRH_MASK)); -} - -/*! @}*/ - -/*! - * @name Counter Start and Stop - * @{ - */ - -/*! - * @brief Starts the SCTimer counter. - * - * @note In 16-bit mode, we can enable both Counter_L and Counter_H, In 32-bit mode, we only can select Counter_U. - * - * @param base SCTimer peripheral base address - * @param countertoStart The SCTimer counters to enable. This is a logical OR of members of the - * enumeration ::sctimer_counter_t. - */ -static inline void SCTIMER_StartTimer(SCT_Type *base, uint32_t countertoStart) -{ - switch (countertoStart) - { - case (uint32_t)kSCTIMER_Counter_L: - assert(0U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Clear HALT_L bit when user wants to start the Low counter */ - base->CTRL_ACCESS16BIT.CTRLL &= ~((uint16_t)SCT_CTRLL_HALT_L_MASK); - break; - - case (uint32_t)kSCTIMER_Counter_H: - assert(0U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Clear HALT_H bit when user wants to start the High counter */ - base->CTRL &= ~(SCT_CTRL_HALT_H_MASK); - break; - - case (uint32_t)kSCTIMER_Counter_L | (uint32_t)kSCTIMER_Counter_H: - assert(0U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Clear HALT_L/HALT_H bit when user wants to H counter and L counter at same time */ - base->CTRL &= ~(SCT_CTRL_HALT_L_MASK | SCT_CTRL_HALT_H_MASK); - break; - - case (uint32_t)kSCTIMER_Counter_U: - assert(1U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Clear HALT_L bit when the counter is operating in 32-bit mode (unify counter). */ - base->CTRL &= ~(SCT_CTRL_HALT_L_MASK); - break; - - default: - /* Counter_L/Counter_H can't work together with Counter_U. */ - assert(false); - break; - } -} - -/*! - * @brief Halts the SCTimer counter. - * - * @param base SCTimer peripheral base address - * @param countertoStop The SCTimer counters to stop. This is a logical OR of members of the - * enumeration ::sctimer_counter_t. - */ -static inline void SCTIMER_StopTimer(SCT_Type *base, uint32_t countertoStop) -{ - switch (countertoStop) - { - case (uint32_t)kSCTIMER_Counter_L: - assert(0U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Set HALT_L bit when user wants to start the Low counter */ - base->CTRL_ACCESS16BIT.CTRLL |= (SCT_CTRLL_HALT_L_MASK); - break; - - case (uint32_t)kSCTIMER_Counter_H: - assert(0U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Set HALT_H bit when user wants to start the High counter */ - base->CTRL |= (SCT_CTRL_HALT_H_MASK); - break; - - case (uint32_t)kSCTIMER_Counter_L | (uint32_t)kSCTIMER_Counter_H: - assert(0U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Clear HALT_L/HALT_H bit when user wants to H counter and L counter at same time */ - base->CTRL |= (SCT_CTRL_HALT_L_MASK | SCT_CTRL_HALT_H_MASK); - break; - - case (uint32_t)kSCTIMER_Counter_U: - assert(1U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Set HALT_L bit when the counter is operating in 32-bit mode (unify counter). */ - base->CTRL |= (SCT_CTRL_HALT_L_MASK); - break; - - default: - /* Counter_L/Counter_H can't work together with Counter_U. */ - assert(false); - break; - } -} - -/*! @}*/ - -/*! - * @name Functions to create a new event and manage the state logic - * @{ - */ - -/*! - * @brief Create an event that is triggered on a match or IO and schedule in current state. - * - * This function will configure an event using the options provided by the user. If the event type uses - * the counter match, then the function will set the user provided match value into a match register - * and put this match register number into the event control register. - * The event is enabled for the current state and the event number is increased by one at the end. - * The function returns the event number; this event number can be used to configure actions to be - * done when this event is triggered. - * - * @param base SCTimer peripheral base address - * @param howToMonitor Event type; options are available in the enumeration ::sctimer_interrupt_enable_t - * @param matchValue The match value that will be programmed to a match register - * @param whichIO The input or output that will be involved in event triggering. This field - * is ignored if the event type is "match only" - * @param whichCounter SCTimer counter to use. In 16-bit mode, we can select Counter_L and Counter_H, - * In 32-bit mode, we can select Counter_U. - * @param event Pointer to a variable where the new event number is stored - * - * @return kStatus_Success on success - * kStatus_Error if we have hit the limit in terms of number of events created or - if we have reached the limit in terms of number of match registers - */ -status_t SCTIMER_CreateAndScheduleEvent(SCT_Type *base, - sctimer_event_t howToMonitor, - uint32_t matchValue, - uint32_t whichIO, - sctimer_counter_t whichCounter, - uint32_t *event); - -/*! - * @brief Enable an event in the current state. - * - * This function will allow the event passed in to trigger in the current state. The event must - * be created earlier by either calling the function SCTIMER_SetupPwm() or function - * SCTIMER_CreateAndScheduleEvent() . - * - * @param base SCTimer peripheral base address - * @param event Event number to enable in the current state - * - */ -void SCTIMER_ScheduleEvent(SCT_Type *base, uint32_t event); - -/*! - * @brief Increase the state by 1 - * - * All future events created by calling the function SCTIMER_ScheduleEvent() will be enabled in this new - * state. - * - * @param base SCTimer peripheral base address - * - * @return kStatus_Success on success - * kStatus_Error if we have hit the limit in terms of states used - - */ -status_t SCTIMER_IncreaseState(SCT_Type *base); - -/*! - * @brief Provides the current state - * - * User can use this to set the next state by calling the function SCTIMER_SetupNextStateAction(). - * - * @param base SCTimer peripheral base address - * - * @return The current state - */ -uint32_t SCTIMER_GetCurrentState(SCT_Type *base); - -/*! - * @brief Set the counter current state. - * - * The function is to set the state variable bit field of STATE register. Writing to the STATE_L, STATE_H, or unified - * register is only allowed when the corresponding counter is halted (HALT bits are set to 1 in the CTRL register). - * - * @param base SCTimer peripheral base address - * @param whichCounter SCTimer counter to use. In 16-bit mode, we can select Counter_L and Counter_H, - * In 32-bit mode, we can select Counter_U. - * @param state The counter current state number (only support range from 0~31). - */ -static inline void SCTIMER_SetCounterState(SCT_Type *base, sctimer_counter_t whichCounter, uint32_t state) -{ - /* SCT only support 0 ~ FSL_FEATURE_SCT_NUMBER_OF_STATES state value. */ - assert(state < (uint32_t)FSL_FEATURE_SCT_NUMBER_OF_STATES); - - SCTIMER_StopTimer(base, (uint32_t)whichCounter); - - switch (whichCounter) - { - case kSCTIMER_Counter_L: - assert(0U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Use STATE_L bits when user wants to setup the Low counter */ - base->STATE_ACCESS16BIT.STATEL = SCT_STATEL_STATEL(state); - break; - - case kSCTIMER_Counter_H: - assert(0U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Use STATE_H bits when user wants to start the High counter */ - base->STATE = (uint32_t)base->STATE_ACCESS16BIT.STATEL | SCT_STATE_STATE_H(state); - break; - - case kSCTIMER_Counter_U: - assert(1U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Use STATE_L bits when counter is operating in 32-bit mode (unify counter). */ - base->STATE = SCT_STATE_STATE_L(state); - break; - - default: - /* Fix the MISRA C-2012 issue rule 16.4. */ - break; - } - - SCTIMER_StartTimer(base, (uint32_t)whichCounter); -} - -/*! - * @brief Get the counter current state value. - * - * The function is to get the state variable bit field of STATE register. - * - * @param base SCTimer peripheral base address - * @param whichCounter SCTimer counter to use. In 16-bit mode, we can select Counter_L and Counter_H, - * In 32-bit mode, we can select Counter_U. - * @return The the counter current state value. - */ -static inline uint16_t SCTIMER_GetCounterState(SCT_Type *base, sctimer_counter_t whichCounter) -{ - uint16_t regs; - - switch (whichCounter) - { - case kSCTIMER_Counter_L: - assert(0U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Use STATE_L bits when user wants to setup the Low counter */ - regs = base->STATE_ACCESS16BIT.STATEL & SCT_STATEL_STATEL_MASK; - break; - - case kSCTIMER_Counter_H: - assert(0U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Use STATE_H bits when user wants to start the High counter */ - regs = base->STATE_ACCESS16BIT.STATEH & SCT_STATEH_STATEH_MASK; - break; - - case kSCTIMER_Counter_U: - assert(1U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Use STATE_L bits when counter is operating in 32-bit mode (unify counter). */ - regs = (uint16_t)(base->STATE & SCT_STATE_STATE_L_MASK); - break; - - default: - /* Fix the MISRA C-2012 issue rule 16.4. */ - break; - } - - return regs; -} - -/*! @}*/ - -/*! - * @name Actions to take in response to an event - * @{ - */ - -/*! - * @brief Setup capture of the counter value on trigger of a selected event - * - * @param base SCTimer peripheral base address - * @param whichCounter SCTimer counter to use. In 16-bit mode, we can select Counter_L and Counter_H, - * In 32-bit mode, we can select Counter_U. - * @param captureRegister Pointer to a variable where the capture register number will be returned. User - * can read the captured value from this register when the specified event is triggered. - * @param event Event number that will trigger the capture - * - * @return kStatus_Success on success - * kStatus_Error if we have hit the limit in terms of number of match/capture registers available - */ -status_t SCTIMER_SetupCaptureAction(SCT_Type *base, - sctimer_counter_t whichCounter, - uint32_t *captureRegister, - uint32_t event); - -/*! - * @brief Receive noticification when the event trigger an interrupt. - * - * If the interrupt for the event is enabled by the user, then a callback can be registered - * which will be invoked when the event is triggered - * - * @param base SCTimer peripheral base address - * @param event Event number that will trigger the interrupt - * @param callback Function to invoke when the event is triggered - */ - -void SCTIMER_SetCallback(SCT_Type *base, sctimer_event_callback_t callback, uint32_t event); - -/*! - * @brief Change the load method of transition to the specified state. - * - * Change the load method of transition, it will be triggered by the event number that is passed in by the user. - * - * @param base SCTimer peripheral base address - * @param event Event number that will change the method to trigger the state transition - * @param fgLoad The method to load highest-numbered event occurring for that state to the STATE register. - * - true: Load the STATEV value to STATE when the event occurs to be the next state. - * - false: Add the STATEV value to STATE when the event occurs to be the next state. - */ -static inline void SCTIMER_SetupStateLdMethodAction(SCT_Type *base, uint32_t event, bool fgLoad) -{ - uint32_t reg = base->EV[event].CTRL; - - if (fgLoad) - { - /* Load the STATEV value to STATE when the event occurs to be the next state */ - reg |= SCT_EV_CTRL_STATELD_MASK; - } - else - { - /* Add the STATEV value to STATE when the event occurs to be the next state */ - reg &= ~SCT_EV_CTRL_STATELD_MASK; - } - - base->EV[event].CTRL = reg; -} - -/*! - * @brief Transition to the specified state with Load method. - * - * This transition will be triggered by the event number that is passed in by the user, the method decide how to load - * the highest-numbered event occurring for that state to the STATE register. - * - * @param base SCTimer peripheral base address - * @param nextState The next state SCTimer will transition to - * @param event Event number that will trigger the state transition - * @param fgLoad The method to load the highest-numbered event occurring for that state to the STATE register. - * - true: Load the STATEV value to STATE when the event occurs to be the next state. - * - false: Add the STATEV value to STATE when the event occurs to be the next state. - */ -static inline void SCTIMER_SetupNextStateActionwithLdMethod(SCT_Type *base, - uint32_t nextState, - uint32_t event, - bool fgLoad) -{ - uint32_t reg = base->EV[event].CTRL; - - reg &= ~(SCT_EV_CTRL_STATEV_MASK | SCT_EV_CTRL_STATELD_MASK); - - reg |= SCT_EV_CTRL_STATEV(nextState); - - if (fgLoad) - { - /* Load the STATEV value when the event occurs to be the next state */ - reg |= SCT_EV_CTRL_STATELD_MASK; - } - - base->EV[event].CTRL = reg; -} - -/*! - * @brief Transition to the specified state. - * @deprecated Do not use this function. It has been superceded by @ref SCTIMER_SetupNextStateActionwithLdMethod - * - * This transition will be triggered by the event number that is passed in by the user. - * - * @param base SCTimer peripheral base address - * @param nextState The next state SCTimer will transition to - * @param event Event number that will trigger the state transition - */ -static inline void SCTIMER_SetupNextStateAction(SCT_Type *base, uint32_t nextState, uint32_t event) -{ - uint32_t reg = base->EV[event].CTRL; - - reg &= ~(SCT_EV_CTRL_STATEV_MASK); - /* Load the STATEV value when the event occurs to be the next state */ - reg |= SCT_EV_CTRL_STATEV(nextState) | SCT_EV_CTRL_STATELD_MASK; - - base->EV[event].CTRL = reg; -} - -/*! - * @brief Setup event active direction when the counters are operating in BIDIR mode. - * - * @param base SCTimer peripheral base address - * @param activeDirection Event generation active direction, see @ref sctimer_event_active_direction_t. - * @param event Event number that need setup the active direction. - */ -static inline void SCTIMER_SetupEventActiveDirection(SCT_Type *base, - sctimer_event_active_direction_t activeDirection, - uint32_t event) -{ - uint32_t reg = base->EV[event].CTRL; - - reg &= ~(SCT_EV_CTRL_DIRECTION_MASK); - - reg |= SCT_EV_CTRL_DIRECTION(activeDirection); - - base->EV[event].CTRL = reg; -} - -/*! - * @brief Set the Output. - * - * This output will be set when the event number that is passed in by the user is triggered. - * - * @param base SCTimer peripheral base address - * @param whichIO The output to set - * @param event Event number that will trigger the output change - */ -static inline void SCTIMER_SetupOutputSetAction(SCT_Type *base, uint32_t whichIO, uint32_t event) -{ - assert(whichIO < (uint32_t)FSL_FEATURE_SCT_NUMBER_OF_OUTPUTS); - - base->OUT[whichIO].SET |= (1UL << event); -} - -/*! - * @brief Clear the Output. - * - * This output will be cleared when the event number that is passed in by the user is triggered. - * - * @param base SCTimer peripheral base address - * @param whichIO The output to clear - * @param event Event number that will trigger the output change - */ -static inline void SCTIMER_SetupOutputClearAction(SCT_Type *base, uint32_t whichIO, uint32_t event) -{ - assert(whichIO < (uint32_t)FSL_FEATURE_SCT_NUMBER_OF_OUTPUTS); - - base->OUT[whichIO].CLR |= (1UL << event); -} - -/*! - * @brief Toggle the output level. - * - * This change in the output level is triggered by the event number that is passed in by the user. - * - * @param base SCTimer peripheral base address - * @param whichIO The output to toggle - * @param event Event number that will trigger the output change - */ -void SCTIMER_SetupOutputToggleAction(SCT_Type *base, uint32_t whichIO, uint32_t event); - -/*! - * @brief Limit the running counter. - * - * The counter is limited when the event number that is passed in by the user is triggered. - * - * @param base SCTimer peripheral base address - * @param whichCounter SCTimer counter to use. In 16-bit mode, we can select Counter_L and Counter_H, - * In 32-bit mode, we can select Counter_U. - * @param event Event number that will trigger the counter to be limited - */ -static inline void SCTIMER_SetupCounterLimitAction(SCT_Type *base, sctimer_counter_t whichCounter, uint32_t event) -{ - switch (whichCounter) - { - case kSCTIMER_Counter_L: - assert(0U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Use Counter_L bits when user wants to setup the Low counter */ - base->LIMIT_ACCESS16BIT.LIMITL |= SCT_LIMITL_LIMITL(1UL << event); - break; - - case kSCTIMER_Counter_H: - assert(0U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Use Counter_H bits when user wants to setup the High counter */ - base->LIMIT |= SCT_LIMIT_LIMMSK_H(1UL << event); - break; - - case kSCTIMER_Counter_U: - assert(1U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Use Counter_L bits when counter is operating in 32-bit mode (unify counter). */ - base->LIMIT |= SCT_LIMIT_LIMMSK_L(1UL << event); - break; - - default: - /* Fix the MISRA C-2012 issue rule 16.4. */ - break; - } -} - -/*! - * @brief Stop the running counter. - * - * The counter is stopped when the event number that is passed in by the user is triggered. - * - * @param base SCTimer peripheral base address - * @param whichCounter SCTimer counter to use. In 16-bit mode, we can select Counter_L and Counter_H, - * In 32-bit mode, we can select Counter_U. - * @param event Event number that will trigger the counter to be stopped - */ -static inline void SCTIMER_SetupCounterStopAction(SCT_Type *base, sctimer_counter_t whichCounter, uint32_t event) -{ - switch (whichCounter) - { - case kSCTIMER_Counter_L: - assert(0U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Use Counter_L bits when user wants to setup the Low counter */ - base->STOP_ACCESS16BIT.STOPL |= SCT_STOPL_STOPL(1UL << event); - break; - - case kSCTIMER_Counter_H: - assert(0U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Use Counter_H bits when user wants to start the High counter */ - base->STOP |= SCT_STOP_STOPMSK_H(1UL << event); - break; - - case kSCTIMER_Counter_U: - assert(1U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Use Counter_L bits when counter is operating in 32-bit mode (unify counter). */ - base->STOP |= SCT_STOP_STOPMSK_L(1UL << event); - break; - - default: - /* Fix the MISRA C-2012 issue rule 16.4. */ - break; - } -} - -/*! - * @brief Re-start the stopped counter. - * - * The counter will re-start when the event number that is passed in by the user is triggered. - * - * @param base SCTimer peripheral base address - * @param whichCounter SCTimer counter to use. In 16-bit mode, we can select Counter_L and Counter_H, - * In 32-bit mode, we can select Counter_U. - * @param event Event number that will trigger the counter to re-start - */ -static inline void SCTIMER_SetupCounterStartAction(SCT_Type *base, sctimer_counter_t whichCounter, uint32_t event) -{ - switch (whichCounter) - { - case kSCTIMER_Counter_L: - assert(0U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Use Counter_L bits when user wants to setup the Low counter */ - base->START_ACCESS16BIT.STARTL |= SCT_STARTL_STARTL(1UL << event); - break; - - case kSCTIMER_Counter_H: - assert(0U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Use Counter_H bits when user wants to start the High counter */ - base->START |= SCT_START_STARTMSK_H(1UL << event); - break; - - case kSCTIMER_Counter_U: - assert(1U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Use Counter_L bits when counter is operating in 32-bit mode (unify counter). */ - base->START |= SCT_START_STARTMSK_L(1UL << event); - break; - - default: - /* Fix the MISRA C-2012 issue rule 16.4. */ - break; - } -} - -/*! - * @brief Halt the running counter. - * - * The counter is disabled (halted) when the event number that is passed in by the user is - * triggered. When the counter is halted, all further events are disabled. The HALT condition - * can only be removed by calling the SCTIMER_StartTimer() function. - * - * @param base SCTimer peripheral base address - * @param whichCounter SCTimer counter to use. In 16-bit mode, we can select Counter_L and Counter_H, - * In 32-bit mode, we can select Counter_U. - * @param event Event number that will trigger the counter to be halted - */ -static inline void SCTIMER_SetupCounterHaltAction(SCT_Type *base, sctimer_counter_t whichCounter, uint32_t event) -{ - switch (whichCounter) - { - case kSCTIMER_Counter_L: - assert(0U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Use Counter_L bits when user wants to setup the Low counter */ - base->HALT_ACCESS16BIT.HALTL |= SCT_HALTL_HALTL(1UL << event); - break; - - case kSCTIMER_Counter_H: - assert(0U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Use Counter_H bits when user wants to start the High counter */ - base->HALT |= SCT_HALT_HALTMSK_H(1UL << event); - break; - - case kSCTIMER_Counter_U: - assert(1U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Use Counter_L bits when counter is operating in 32-bit mode (unify counter). */ - base->HALT |= SCT_HALT_HALTMSK_L(1UL << event); - break; - - default: - /* Fix the MISRA C-2012 issue rule 16.4. */ - break; - } -} - -#if !(defined(FSL_FEATURE_SCT_HAS_NO_DMA_REQUEST) && FSL_FEATURE_SCT_HAS_NO_DMA_REQUEST) -/*! - * @brief Generate a DMA request. - * - * DMA request will be triggered by the event number that is passed in by the user. - * - * @param base SCTimer peripheral base address - * @param dmaNumber The DMA request to generate - * @param event Event number that will trigger the DMA request - */ -static inline void SCTIMER_SetupDmaTriggerAction(SCT_Type *base, uint32_t dmaNumber, uint32_t event) -{ - if (dmaNumber == 0U) - { - base->DMAREQ0 |= (1UL << event); - } - else - { - base->DMAREQ1 |= (1UL << event); - } -} -#endif /* FSL_FEATURE_SCT_HAS_NO_DMA_REQUEST */ - -/*! - * @brief Set the value of counter. - * - * The function is to set the value of Count register, Writing to the COUNT_L, COUNT_H, or unified register - * is only allowed when the corresponding counter is halted (HALT bits are set to 1 in the CTRL register). - * - * @param base SCTimer peripheral base address - * @param whichCounter SCTimer counter to use. In 16-bit mode, we can select Counter_L and Counter_H, - * In 32-bit mode, we can select Counter_U. - * @param value the counter value update to the COUNT register. - */ -static inline void SCTIMER_SetCOUNTValue(SCT_Type *base, sctimer_counter_t whichCounter, uint32_t value) -{ - SCTIMER_StopTimer(base, (uint32_t)whichCounter); - - switch (whichCounter) - { - case kSCTIMER_Counter_L: - assert(value <= 0xFFFFU); - assert(0U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Use Counter_L bits when user wants to setup the Low counter */ - base->COUNT_ACCESS16BIT.COUNTL = (uint16_t)value; - break; - - case kSCTIMER_Counter_H: - assert(value <= 0xFFFFU); - assert(0U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Use Counter_H bits when user wants to setup the High counter */ - base->COUNT = (uint32_t)base->COUNT_ACCESS16BIT.COUNTL | SCT_COUNT_CTR_H(value); - break; - - case kSCTIMER_Counter_U: - assert(1U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Use both Counter_L/Counter_H bits when counter is operating in 32-bit mode (unify counter). */ - base->COUNT = value; - break; - - default: - /* Fix the MISRA C-2012 issue rule 16.4. */ - break; - } - - SCTIMER_StartTimer(base, (uint32_t)whichCounter); -} - -/*! - * @brief Get the value of counter. - * - * The function is to read the value of Count register, software can read the counter registers at any time.. - * - * @param base SCTimer peripheral base address - * @param whichCounter SCTimer counter to use. In 16-bit mode, we can select Counter_L and Counter_H, - * In 32-bit mode, we can select Counter_U. - * @return The value of counter selected. - */ -static inline uint32_t SCTIMER_GetCOUNTValue(SCT_Type *base, sctimer_counter_t whichCounter) -{ - uint32_t value; - - switch (whichCounter) - { - case kSCTIMER_Counter_L: - assert(0U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Use Counter_L bits when user wants to setup the Low counter */ - value = base->COUNT_ACCESS16BIT.COUNTL; - break; - - case kSCTIMER_Counter_H: - assert(0U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Use Counter_H bits when user wants to start the High counter */ - value = base->COUNT_ACCESS16BIT.COUNTH; - break; - - case kSCTIMER_Counter_U: - assert(1U == (base->CONFIG & SCT_CONFIG_UNIFY_MASK)); - /* Use Counter_L bits when counter is operating in 32-bit mode (unify counter). */ - value = base->COUNT; - break; - - default: - /* Fix the MISRA C-2012 issue rule 16.4. */ - break; - } - - return value; -} - -/*! - * @brief Set the state mask bit field of EV_STATE register. - * - * @param base SCTimer peripheral base address - * @param event The EV_STATE register be set. - * @param state The state value in which the event is enabled to occur. - */ -static inline void SCTIMER_SetEventInState(SCT_Type *base, uint32_t event, uint32_t state) -{ - assert(state < (uint32_t)FSL_FEATURE_SCT_NUMBER_OF_STATES); - assert(event < (uint32_t)FSL_FEATURE_SCT_NUMBER_OF_EVENTS); - - base->EV[event].STATE |= SCT_EV_STATE_STATEMSKn((uint32_t)1U << state); -} - -/*! - * @brief Clear the state mask bit field of EV_STATE register. - * - * @param base SCTimer peripheral base address - * @param event The EV_STATE register be clear. - * @param state The state value in which the event is disabled to occur. - */ -static inline void SCTIMER_ClearEventInState(SCT_Type *base, uint32_t event, uint32_t state) -{ - assert(state < (uint32_t)FSL_FEATURE_SCT_NUMBER_OF_STATES); - assert(event < (uint32_t)FSL_FEATURE_SCT_NUMBER_OF_EVENTS); - - base->EV[event].STATE &= ~SCT_EV_STATE_STATEMSKn((uint32_t)1U << state); -} - -/*! - * @brief Get the state mask bit field of EV_STATE register. - * - * @note This function is to check whether the event is enabled in a specific state. - * - * @param base SCTimer peripheral base address - * @param event The EV_STATE register be read. - * @param state The state value. - * - * @return The the state mask bit field of EV_STATE register. - * - true: The event is enable in state. - * - false: The event is disable in state. - */ -static inline bool SCTIMER_GetEventInState(SCT_Type *base, uint32_t event, uint32_t state) -{ - assert(state < (uint32_t)FSL_FEATURE_SCT_NUMBER_OF_STATES); - assert(event < (uint32_t)FSL_FEATURE_SCT_NUMBER_OF_EVENTS); - - return (0U != (base->EV[event].STATE & SCT_EV_STATE_STATEMSKn((uint32_t)1U << state))); -} - -/*! - * @brief Get the value of capture register. - * - * This function returns the captured value upon occurrence of the events selected by the corresponding - * Capture Control registers occurred. - * - * @param base SCTimer peripheral base address - * @param whichCounter SCTimer counter to use. In 16-bit mode, we can select Counter_L and Counter_H, - * In 32-bit mode, we can select Counter_U. - * @param capChannel SCTimer capture register of capture channel. - * - * @return The SCTimer counter value at which this register was last captured. - */ -static inline uint32_t SCTIMER_GetCaptureValue(SCT_Type *base, sctimer_counter_t whichCounter, uint8_t capChannel) -{ - uint32_t value = 0; - - switch (whichCounter) - { - case kSCTIMER_Counter_L: - assert(capChannel < SCT_CAPL_COUNT); - /* Use Counter_L bits when user wants to setup the Low counter */ - value = base->CAP_ACCESS16BIT[capChannel].CAPL; - break; - - case kSCTIMER_Counter_H: - assert(capChannel < SCT_CAPH_COUNT); - /* Use Counter_H bits when user wants to start the High counter */ - value = base->CAP_ACCESS16BIT[capChannel].CAPH; - break; - - case kSCTIMER_Counter_U: - assert(capChannel < SCT_CAP_COUNT); - /* Use Counter_L bits when counter is operating in 32-bit mode (unify counter). */ - value = base->CAP[capChannel]; - break; - - default: - /* Fix the MISRA C-2012 issue rule 16.4. */ - break; - } - - return value; -} - -/*! - * @brief SCTimer interrupt handler. - * - * @param base SCTimer peripheral base address. - */ -void SCTIMER_EventHandleIRQ(SCT_Type *base); - -/*! @}*/ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_SCTIMER_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_sema42.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_sema42.c deleted file mode 100644 index fe0b750222f..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_sema42.c +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020, 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_sema42.h" - -/****************************************************************************** - * Definitions - *****************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.sema42" -#endif - -/* The first number write to RSTGDP when reset SEMA42 gate. */ -#define SEMA42_GATE_RESET_PATTERN_1 (0xE2U) -/* The second number write to RSTGDP when reset SEMA42 gate. */ -#define SEMA42_GATE_RESET_PATTERN_2 (0x1DU) - -#if defined(SEMA42_RSTS) -#define SEMA42_RESETS_ARRAY SEMA42_RSTS -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Get instance number for SEMA42 module. - * - * @param base SEMA42 peripheral base address. - */ -uint32_t SEMA42_GetInstance(SEMA42_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/*! @brief Pointers to sema42 bases for each instance. */ -static SEMA42_Type *const s_sema42Bases[] = SEMA42_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to sema42 clocks for each instance. */ -static const clock_ip_name_t s_sema42Clocks[] = SEMA42_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(SEMA42_RESETS_ARRAY) -/* Reset array */ -static const reset_ip_name_t s_sema42Resets[] = SEMA42_RESETS_ARRAY; -#endif - -/****************************************************************************** - * CODE - *****************************************************************************/ - -uint32_t SEMA42_GetInstance(SEMA42_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - /* - * $Branch Coverage Justification$ - * (instance >= ARRAY_SIZE(s_sema42Bases)) not covered. The peripheral base - * address is always valid and checked by assert. - */ - for (instance = 0; instance < ARRAY_SIZE(s_sema42Bases); instance++) - { - /* - * $Branch Coverage Justification$ - * (s_sema42Bases[instance] != base) not covered. The peripheral base - * address is always valid and checked by assert. - */ - if (s_sema42Bases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_sema42Bases)); - - return instance; -} - -/*! - * brief Initializes the SEMA42 module. - * - * This function initializes the SEMA42 module. It only enables the clock but does - * not reset the gates because the module might be used by other processors - * at the same time. To reset the gates, call either SEMA42_ResetGate or - * SEMA42_ResetAllGates function. - * - * param base SEMA42 peripheral base address. - */ -void SEMA42_Init(SEMA42_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - (void)CLOCK_EnableClock(s_sema42Clocks[SEMA42_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if defined(SEMA42_RESETS_ARRAY) - RESET_ReleasePeripheralReset(s_sema42Resets[SEMA42_GetInstance(base)]); -#endif -} - -/*! - * brief De-initializes the SEMA42 module. - * - * This function de-initializes the SEMA42 module. It only disables the clock. - * - * param base SEMA42 peripheral base address. - */ -void SEMA42_Deinit(SEMA42_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - (void)CLOCK_DisableClock(s_sema42Clocks[SEMA42_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Tries to lock the SEMA42 gate. - * - * This function tries to lock the specific SEMA42 gate. If the gate has been - * locked by another processor, this function returns an error code. - * - * param base SEMA42 peripheral base address. - * param gateNum Gate number to lock. - * param procNum Current processor number. - * - * retval kStatus_Success Lock the sema42 gate successfully. - * retval kStatus_SEMA42_Busy Sema42 gate has been locked by another processor. - */ -status_t SEMA42_TryLock(SEMA42_Type *base, uint8_t gateNum, uint8_t procNum) -{ - status_t status; - - assert(gateNum < (uint8_t)FSL_FEATURE_SEMA42_GATE_COUNT); - - ++procNum; - - /* Try to lock. */ - SEMA42_GATEn(base, gateNum) = procNum; - - /* Check locked or not. */ - if (procNum != SEMA42_GATEn(base, gateNum)) - { - status = kStatus_SEMA42_Busy; - } - else - { - status = kStatus_Success; - } - - return status; -} - -/*! - * brief Locks the SEMA42 gate. - * - * This function locks the specific SEMA42 gate. If the gate has been - * locked by other processors, this function waits until it is unlocked and then - * lock it. - * - * param base SEMA42 peripheral base address. - * param gateNum Gate number to lock. - * param procNum Current processor number. - */ -void SEMA42_Lock(SEMA42_Type *base, uint8_t gateNum, uint8_t procNum) -{ - while (kStatus_Success != SEMA42_TryLock(base, gateNum, procNum)) - { - } -} - -/*! - * brief Resets the SEMA42 gate to an unlocked status. - * - * This function resets a SEMA42 gate to an unlocked status. - * - * param base SEMA42 peripheral base address. - * param gateNum Gate number. - * - * retval kStatus_Success SEMA42 gate is reset successfully. - * retval kStatus_SEMA42_Reseting Some other reset process is ongoing. - */ -status_t SEMA42_ResetGate(SEMA42_Type *base, uint8_t gateNum) -{ - status_t status; - - /* - * Reset all gates if gateNum >= SEMA42_GATE_NUM_RESET_ALL - * Reset specific gate if gateNum < FSL_FEATURE_SEMA42_GATE_COUNT - */ - assert(!((gateNum < SEMA42_GATE_NUM_RESET_ALL) && (gateNum >= (uint8_t)FSL_FEATURE_SEMA42_GATE_COUNT))); - - /* Check whether some reset is ongoing. */ - /* - * $Branch Coverage Justification$ - * (0U == (base->RSTGT_R & SEMA42_RSTGT_R_RSTGSM_MASK))) not covered. Test unfeasible, - * the reset state is too short to catch. - */ - if (0U != (base->RSTGT_R & SEMA42_RSTGT_R_RSTGSM_MASK)) - { - /* - * $Line Coverage Justification$ - * Block not covered. Test unfeasible, the reset state is too short to catch. - */ - status = kStatus_SEMA42_Reseting; - } - else - { - /* First step. */ - base->RSTGT_W = SEMA42_RSTGT_W_RSTGDP(SEMA42_GATE_RESET_PATTERN_1); - /* Second step. */ - base->RSTGT_W = SEMA42_RSTGT_W_RSTGDP(SEMA42_GATE_RESET_PATTERN_2) | SEMA42_RSTGT_W_RSTGTN(gateNum); - - status = kStatus_Success; - } - - return status; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_sema42.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_sema42.h deleted file mode 100644 index 5c0193a7a34..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_sema42.h +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright (c) 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2020, 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_SEMA42_H_ -#define FSL_SEMA42_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup sema42 - * @{ - */ - -/****************************************************************************** - * Definitions - *****************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief SEMA42 driver version */ -#define FSL_SEMA42_DRIVER_VERSION (MAKE_VERSION(2, 0, 4)) -/*! @} */ - -/*! - * @brief SEMA42 status return codes. - */ -enum -{ - kStatus_SEMA42_Busy = MAKE_STATUS(kStatusGroup_SEMA42, 0), /*!< SEMA42 gate has been locked by other processor. */ - kStatus_SEMA42_Reseting = MAKE_STATUS(kStatusGroup_SEMA42, 1) /*!< SEMA42 gate reseting is ongoing. */ -}; - -/*! - * @brief SEMA42 gate lock status. - */ -typedef enum _sema42_gate_status -{ - kSEMA42_Unlocked = 0U, /*!< The gate is unlocked. */ - kSEMA42_LockedByProc0 = 1U, /*!< The gate is locked by processor 0. */ - kSEMA42_LockedByProc1 = 2U, /*!< The gate is locked by processor 1. */ - kSEMA42_LockedByProc2 = 3U, /*!< The gate is locked by processor 2. */ - kSEMA42_LockedByProc3 = 4U, /*!< The gate is locked by processor 3. */ - kSEMA42_LockedByProc4 = 5U, /*!< The gate is locked by processor 4. */ - kSEMA42_LockedByProc5 = 6U, /*!< The gate is locked by processor 5. */ - kSEMA42_LockedByProc6 = 7U, /*!< The gate is locked by processor 6. */ - kSEMA42_LockedByProc7 = 8U, /*!< The gate is locked by processor 7. */ - kSEMA42_LockedByProc8 = 9U, /*!< The gate is locked by processor 8. */ - kSEMA42_LockedByProc9 = 10U, /*!< The gate is locked by processor 9. */ - kSEMA42_LockedByProc10 = 11U, /*!< The gate is locked by processor 10. */ - kSEMA42_LockedByProc11 = 12U, /*!< The gate is locked by processor 11. */ - kSEMA42_LockedByProc12 = 13U, /*!< The gate is locked by processor 12. */ - kSEMA42_LockedByProc13 = 14U, /*!< The gate is locked by processor 13. */ - kSEMA42_LockedByProc14 = 15U /*!< The gate is locked by processor 14. */ -} sema42_gate_status_t; - -/*! @brief The number to reset all SEMA42 gates. */ -#define SEMA42_GATE_NUM_RESET_ALL (64U) - -/*! @brief SEMA42 gate n register address. - * - * The SEMA42 gates are sorted in the order 3, 2, 1, 0, 7, 6, 5, 4, ... not in the order - * 0, 1, 2, 3, 4, 5, 6, 7, ... The macro SEMA42_GATEn gets the SEMA42 gate based on the gate - * index. - * - * The input gate index is XOR'ed with 3U: - * 0 ^ 3 = 3 - * 1 ^ 3 = 2 - * 2 ^ 3 = 1 - * 3 ^ 3 = 0 - * 4 ^ 3 = 7 - * 5 ^ 3 = 6 - * 6 ^ 3 = 5 - * 7 ^ 3 = 4 - * ... - */ -#define SEMA42_GATEn(base, n) (((volatile uint8_t *)(&((base)->GATE3)))[(n) ^ 3U]) - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @brief Initializes the SEMA42 module. - * - * This function initializes the SEMA42 module. It only enables the clock but does - * not reset the gates because the module might be used by other processors - * at the same time. To reset the gates, call either SEMA42_ResetGate or - * SEMA42_ResetAllGates function. - * - * @param base SEMA42 peripheral base address. - */ -void SEMA42_Init(SEMA42_Type *base); - -/*! - * @brief De-initializes the SEMA42 module. - * - * This function de-initializes the SEMA42 module. It only disables the clock. - * - * @param base SEMA42 peripheral base address. - */ -void SEMA42_Deinit(SEMA42_Type *base); - -/*! - * @brief Tries to lock the SEMA42 gate. - * - * This function tries to lock the specific SEMA42 gate. If the gate has been - * locked by another processor, this function returns an error code. - * - * @param base SEMA42 peripheral base address. - * @param gateNum Gate number to lock. - * @param procNum Current processor number. - * - * @retval kStatus_Success Lock the sema42 gate successfully. - * @retval kStatus_SEMA42_Busy Sema42 gate has been locked by another processor. - */ -status_t SEMA42_TryLock(SEMA42_Type *base, uint8_t gateNum, uint8_t procNum); - -/*! - * @brief Locks the SEMA42 gate. - * - * This function locks the specific SEMA42 gate. If the gate has been - * locked by other processors, this function waits until it is unlocked and then - * lock it. - * - * @param base SEMA42 peripheral base address. - * @param gateNum Gate number to lock. - * @param procNum Current processor number. - */ -void SEMA42_Lock(SEMA42_Type *base, uint8_t gateNum, uint8_t procNum); - -/*! - * @brief Unlocks the SEMA42 gate. - * - * This function unlocks the specific SEMA42 gate. It only writes unlock value - * to the SEMA42 gate register. However, it does not check whether the SEMA42 gate is locked - * by the current processor or not. As a result, if the SEMA42 gate is not locked by the current - * processor, this function has no effect. - * - * @param base SEMA42 peripheral base address. - * @param gateNum Gate number to unlock. - */ -static inline void SEMA42_Unlock(SEMA42_Type *base, uint8_t gateNum) -{ - assert(gateNum < (uint8_t)FSL_FEATURE_SEMA42_GATE_COUNT); - - /* ^= 0x03U because SEMA42 gates are in the order 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 7, ...*/ - SEMA42_GATEn(base, gateNum) = (uint8_t)kSEMA42_Unlocked; -} - -/*! - * @brief Gets the status of the SEMA42 gate. - * - * This function checks the lock status of a specific SEMA42 gate. - * - * @param base SEMA42 peripheral base address. - * @param gateNum Gate number. - * - * @return status Current status. - */ -static inline sema42_gate_status_t SEMA42_GetGateStatus(SEMA42_Type *base, uint8_t gateNum) -{ - assert(gateNum < (uint8_t)FSL_FEATURE_SEMA42_GATE_COUNT); - - return (sema42_gate_status_t)(SEMA42_GATEn(base, gateNum)); -} - -/*! - * @brief Resets the SEMA42 gate to an unlocked status. - * - * This function resets a SEMA42 gate to an unlocked status. - * - * @param base SEMA42 peripheral base address. - * @param gateNum Gate number. - * - * @retval kStatus_Success SEMA42 gate is reset successfully. - * @retval kStatus_SEMA42_Reseting Some other reset process is ongoing. - */ -status_t SEMA42_ResetGate(SEMA42_Type *base, uint8_t gateNum); - -/*! - * @brief Resets all SEMA42 gates to an unlocked status. - * - * This function resets all SEMA42 gate to an unlocked status. - * - * @param base SEMA42 peripheral base address. - * - * @retval kStatus_Success SEMA42 is reset successfully. - * @retval kStatus_SEMA42_Reseting Some other reset process is ongoing. - */ -static inline status_t SEMA42_ResetAllGates(SEMA42_Type *base) -{ - return SEMA42_ResetGate(base, SEMA42_GATE_NUM_RESET_ALL); -} - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ - -#endif /* FSL_SEMA42_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_sinc.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_sinc.c deleted file mode 100644 index 64c16921168..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_sinc.c +++ /dev/null @@ -1,353 +0,0 @@ -/* - * Copyright 2022-2023 NXP - * - * All rights reserved. - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_sinc.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.sinc" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -static uint8_t SINC_GetInstance(SINC_Type *base); -#endif /*FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL*/ - -/******************************************************************************* - * Variables - ******************************************************************************/ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! brief Pointer to SINC clocks for each instance. */ -static clock_ip_name_t const s_sincClocks[] = SINC_CLOCKS; - -/*! brief Pointers to SINC bases for each instance. */ -static SINC_Type *const s_sincBases[] = SINC_BASE_PTRS; - -#endif /*FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL*/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -static uint8_t SINC_GetInstance(SINC_Type *base) -{ - uint8_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0U; instance < ARRAY_SIZE(s_sincBases); instance++) - { - if (s_sincBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_sincBases)); - - return instance; -} -#endif /*FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL*/ - -/*! - * brief Initialize selected SINC instance, including clock options and channel options. - * - * param base SINC peripheral base address. - * param config The pointer to sinc_config_t structure. - */ -void SINC_Init(SINC_Type *base, const sinc_config_t *config) -{ - assert(config != NULL); - uint8_t i = 0U; - - /* Enable SINC clock root. */ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_EnableClock(s_sincClocks[SINC_GetInstance(base)]); -#endif /*FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL*/ - - SINC_EnableMaster(base, false); - /* Reset all function blocks except for the clock. */ - SINC_DoSoftwareReset(base); - - /* Set clock configuration. */ - SINC_SetClkPrescale(base, config->clockPreDivider); - SINC_SetModulatorClockDivider(base, config->modClkDivider); - SINC_DisableModulatorClockOutput(base, (uint32_t)kSINC_ModClk0, config->disableModClk0Output); - SINC_DisableModulatorClockOutput(base, (uint32_t)kSINC_ModClk1, config->disableModClk1Output); - SINC_DisableModulatorClockOutput(base, (uint32_t)kSINC_ModClk2, config->disableModClk2Output); - - SINC_DisableDozeMode(base, config->disableDozeMode); - - for (i = 0U; i < (uint8_t)SINC_CHANNEL_COUNT; i++) - { - if (config->channelsConfigArray[i] != NULL) - { - SINC_SetChannelConfig(base, (sinc_channel_id_t)i, config->channelsConfigArray[i]); - } - } - - SINC_EnableMaster(base, config->enableMaster); - if ((config->disableModClk0Output == false) && (config->enableMaster == true)) - { - while (!SINC_CheckModulatorClockReady(base, (uint32_t)kSINC_ModClk0)) - { - /* Loop until Modulator clock 0 is ready. */ - ; - } - } - else if ((config->disableModClk1Output == false) && (config->enableMaster == true)) - { - while (!SINC_CheckModulatorClockReady(base, (uint32_t)kSINC_ModClk1)) - { - /* Loop until Modulator clock 0 is ready. */ - ; - } - } - else if ((config->disableModClk2Output == false) && (config->enableMaster == true)) - { - while (!SINC_CheckModulatorClockReady(base, (uint32_t)kSINC_ModClk2)) - { - /* Loop until Modulator clock 0 is ready. */ - ; - } - } - else - { - /* Added comments to avoid violations of MISRA C-2012 rules. */ - } -} - -/*! - * brief De-initialize selected SINC instance. - * - * param base SINC peripheral base address. - */ -void SINC_Deinit(SINC_Type *base) -{ - SINC_DoSoftwareReset(base); - /* Disable master */ - SINC_EnableMaster(base, false); - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - CLOCK_DisableClock(s_sincClocks[SINC_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Get default configuration. - * - * code {.c} - * config->clockPreDivider = kSINC_ClkPrescale1; - * config->modClkDivider = 2UL; - * config->disableModClk0Output = false; - * config->disableModClk1Output = false; - * config->disableModClk2Output = false; - * - * config->channelsConfigArray[SINC_CHANNEL_COUNT] = {NULL, NULL, NULL, NULL}; - * - * config->disableDozeMode = false; - * config->enableMaster = false; - * endcode - * - * - * param config The pointer to sinc_config_t structure, must not be NULL. - */ -void SINC_GetDefaultConfig(sinc_config_t *config) -{ - assert(config != NULL); - - config->clockPreDivider = kSINC_ClkPrescale1; - config->modClkDivider = 2UL; - config->disableModClk0Output = false; - config->disableModClk1Output = false; - config->disableModClk2Output = false; - - for (uint8_t i = 0U; i < (uint8_t)SINC_CHANNEL_COUNT; i++) - { - config->channelsConfigArray[i] = NULL; - } - - config->disableDozeMode = false; - config->enableMaster = false; -} - -/*! - * brief Set channel configurations, including input options, conversion options and protection options. - * - * param base SINC peripheral base address. - * param chId Selected channel id, please refer to sinc_channel_id_t. - * param chConfig Pointer to sinc_channel_config_t structure, must not be NULL. - */ -void SINC_SetChannelConfig(SINC_Type *base, sinc_channel_id_t chId, sinc_channel_config_t *chConfig) -{ - assert(chConfig != NULL); - - SINC_EnableChannel(base, chId, false); - - /* Set channel input options, including input clock and input source. */ - SINC_SetChannelInputOption(base, chId, chConfig->chInputOption); - - /* Set channel conversion options, including trigger source and primary filter. */ - SINC_SetChannelConversionOption(base, chId, chConfig->chConvOption); - - /* Set channel protection options, including SCD, limit check, CAD, zero crossing. */ - SINC_SetChannelProtectionOption(base, chId, chConfig->chProtectionOption); - - SINC_EnableChannelFIFO(base, chId, chConfig->bEnableFifo); - SINC_SetChannelFifoWatermark(base, chId, chConfig->u8FifoWaterMark); - - SINC_EnableChannelPrimaryDma(base, chId, chConfig->bEnablePrimaryDma); - -#if (defined(FSL_FEATURE_SINC_CACFR_HAS_ADMASEL) && FSL_FEATURE_SINC_CACFR_HAS_ADMASEL) - SINC_SetChannelAltDmaSource(base, chId, chConfig->altDmaSource); -#endif /* (defined(FSL_FEATURE_SINC_CACFR_HAS_ADMASEL) && FSL_FEATURE_SINC_CACFR_HAS_ADMASEL) */ - - SINC_SetChannelResultDataFormat(base, chId, chConfig->dataFormat); - - SINC_EnableChannel(base, chId, chConfig->bEnableChannel); -} -/*! - * brief Set channel input options, including input bit format, input bit source, input bit delay, input clock source, - * input clock edge. - * - * param base SINC peripheral base address. - * param chId Selected channel id, please refer to sinc_channel_id_t. - * param chInputOption Pointer to sinc_channel_input_option_t structure, must not be NULL. - */ -void SINC_SetChannelInputOption(SINC_Type *base, sinc_channel_id_t chId, sinc_channel_input_option_t *chInputOption) -{ - assert(chInputOption != NULL); - - uint32_t u32Tmp; - - u32Tmp = ((base->CHANNEL[(uint8_t)chId].CCFR) & - ~(SINC_CCFR_IBFMT_MASK | SINC_CCFR_ICSEL_MASK | SINC_CCFR_ICESEL_MASK | SINC_CCFR_IBSEL_MASK)); - u32Tmp |= SINC_CCFR_ICSEL(chInputOption->inputClkSource) | SINC_CCFR_IBFMT(chInputOption->inputBitFormat) | - SINC_CCFR_ICESEL(chInputOption->inputClkEdge) | SINC_CCFR_IBSEL(chInputOption->inputBitSource); - base->CHANNEL[(uint8_t)chId].CCFR = u32Tmp; - - u32Tmp = ((base->CHANNEL[(uint8_t)chId].CACFR) & ~SINC_CACFR_IBDLY_MASK); - u32Tmp |= SINC_CACFR_IBDLY(chInputOption->inputBitDelay); - base->CHANNEL[(uint8_t)chId].CACFR = u32Tmp; -} - -/*! - * brief Set channel conversion options, including conversion mode, trigger source, and primary filter settings. - * - * param base SINC peripheral base address. - * param chId Selected channel id, please refer to sinc_channel_id_t. - * param chConvOption Pointer to sinc_channel_conv_option_t structure, must not be NULL. - */ -void SINC_SetChannelConversionOption(SINC_Type *base, sinc_channel_id_t chId, sinc_channel_conv_option_t *chConvOption) -{ - assert(chConvOption != NULL); - - /* Set trigger source. */ - SINC_SetChannelTriggerSource(base, chId, chConvOption->convTriggerSource); - - /* Set PF CIC options. */ - SINC_SetChannelConversionMode(base, chId, chConvOption->convMode); - SINC_SetChannelPfOrder(base, chId, chConvOption->pfOrder); - SINC_SetChannelPfOsr(base, chId, chConvOption->u16pfOverSampleRatio); - - /* Set HPF alpha coefficient. */ - SINC_SetChannelPfHpfAlphaCoeff(base, chId, chConvOption->pfHpfAlphaCoeff); - - /* Set shift options */ - SINC_SetChannelPfShiftConfig(base, chId, chConvOption->pfShiftDirection, chConvOption->u8pfShiftBitsNum); - - /* Set bias options. */ - SINC_SetChannelPfBiasConfig(base, chId, chConvOption->pfBiasSign, chConvOption->u32pfBiasValue); - - /* Enable channel's primary filter. */ - SINC_EnableChannelPrimaryFilter(base, chId, chConvOption->enableChPrimaryFilter); -} - -/*! - * brief Set channel protection options, including limit check, short-circuit detector, clock-absence detector, and - * zero-crossing detector. - * - * param base SINC peripheral base address. - * param chId Selected channel id, please refer to sinc_channel_id_t. - * param chProtection Pointer to sinc_channel_protection_option_t, must not be NULL. - */ -void SINC_SetChannelProtectionOption(SINC_Type *base, - sinc_channel_id_t chId, - sinc_channel_protection_option_t *chProtection) -{ - assert(chProtection != NULL); - - /* limit check */ - if (chProtection->limitDetectorMode == kSINC_Lmt_Disabled) - { - base->CHANNEL[(uint8_t)chId].CCR &= ~SINC_CCR_LMTEN_MASK; - } - else - { - SINC_SetChannelLowLimitThreshold(base, chId, chProtection->u32LowLimitThreshold); - SINC_SetChannelHighLimitThreshold(base, chId, chProtection->u32HighLimitThreshold); - base->CHANNEL[(uint8_t)chId].CPROT = (base->CHANNEL[(uint8_t)chId].CPROT & ~SINC_CPROT_LMTOP_MASK) | - SINC_CPROT_LMTOP((uint32_t)chProtection->limitDetectorMode & 0x3UL); - if (chProtection->bEnableLmtBreakSignal) - { - base->CHANNEL[(uint8_t)chId].CPROT |= - (((((uint32_t)(chProtection->limitDetectorMode)) & 0x1CUL) >> 2UL) << SINC_CPROT_LLMTBK_SHIFT); - } - else - { - base->CHANNEL[(uint8_t)chId].CPROT &= - ~(((((uint32_t)(chProtection->limitDetectorMode)) & 0x1CUL) >> 2UL) << SINC_CPROT_LLMTBK_SHIFT); - } - base->CHANNEL[(uint8_t)chId].CCR |= SINC_CCR_LMTEN_MASK; - } - - /* Short-circuit detector. */ - if (chProtection->scdOperateMode == kSINC_Scd_OperateDisabled) - { - SINC_SetChannelScdOperateMode(base, chId, kSINC_Scd_OperateDisabled); - } - else - { - SINC_SetChannelScdLimitThreshold(base, chId, chProtection->u8ScdLimitThreshold); - SINC_SetChannelScdOption(base, chId, chProtection->scdOption); - SINC_EnableChannelScdBreakSignal(base, chId, chProtection->bEnableScdBreakSignal); - SINC_SetChannelScdOperateMode(base, chId, chProtection->scdOperateMode); - } - - /* Clock-absence detector. */ - SINC_EnableChannelCadBreakSignal(base, chId, chProtection->bEnableCadBreakSignal); - SINC_SetChannelCadLimitThreshold(base, chId, chProtection->cadLimitThreshold); - - /* zero-crossing detector. */ - SINC_SetChannelZcdOperateMode(base, chId, chProtection->zcdOperateMode); -} - -/*! - * brief Get selected channel's number of conversions. - * - * param base SINC peripheral base address. - * param chId Selected channel id, refer to sinc_channel_id_t for details. - * return uint8_t Selected channel's number of conversions. - */ -uint8_t SINC_GetChannelConversionCount(SINC_Type *base, sinc_channel_id_t chId) -{ - uint8_t u8Count; - - u8Count = (uint8_t)((base->CHANNEL[(uint8_t)chId].CSR & SINC_CSR_CNUM_MASK) >> SINC_CSR_CNUM_SHIFT); - if ((base->CHANNEL[(uint8_t)chId].CSR & SINC_CSR_CNUM_OV_MASK) != 0UL) - { - u8Count += 128U; - } - - return u8Count; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_sinc.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_sinc.h deleted file mode 100644 index b8bf925f375..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_sinc.h +++ /dev/null @@ -1,2057 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * - * All rights reserved. - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_SINC_H_ -#define FSL_SINC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup sinc - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief lower_component_name driver version 2.1.4. */ -#define FSL_SINC_DRIVER_VERSION (MAKE_VERSION(2, 1, 4)) -/*! @} */ -#if defined(FSL_FEATURE_SINC_CHANNEL_COUNT) -#define SINC_CHANNEL_COUNT (FSL_FEATURE_SINC_CHANNEL_COUNT) -#else -#error "The definition of FSL_FEATURE_SINC_CHANNEL_COUNT is missing!" -#endif -#define SINC_NORMAL_INT_REG_ID (0ULL) -#define SINC_NORMAL_INT_NAME_COCIE (0ULL) -#define SINC_NORMAL_INT_NAME_CHFIE (1ULL) -#define SINC_NORMAL_INT_NAME_ZCDIE (2ULL) - -#define SINC_ERROR_INT_REG_ID (1ULL) -#define SINC_ERROR_INT_NAME_SCDIE (0ULL) -#define SINC_ERROR_INT_NAME_WLMTIE (1ULL) -#define SINC_ERROR_INT_NAME_LLMTIE (2ULL) -#define SINC_ERROR_INT_NAME_HLMTIE (3ULL) - -#define SINC_FIFO_CAD_INT_REG_ID (2ULL) -#define SINC_FIFO_CAD_INT_FUNFIE (0ULL) -#define SINC_FIFO_CAD_INT_FOVFIE (1ULL) -#define SINC_FIFO_CAD_INT_CADIE (2ULL) -#define SINC_FIFO_CAD_INT_SATIE (3ULL) - -#define SINC_ENCODE_INTERRUPT(regId, name, channelId) \ - ((((1ULL << (uint64_t)(channelId))) << ((uint64_t)(name) * (uint64_t)(SINC_CHANNEL_COUNT))) \ - << (uint64_t)(regId)*20ULL) - -#define SINC_DECODE_INTERRUPT(interruptMask) \ - normalIntMask = ((uint32_t)(interruptMask) & (0xFFFFFUL)); \ - errorIntMask = ((uint32_t)((interruptMask) >> 20ULL) & (0xFFFFFUL)); \ - fifoCadIntMask = ((uint32_t)((interruptMask) >> 40ULL) & (0xFFFFFUL)) - -#define SINC_FIND_INT_FIELD_VALUE(mask, name) \ - ((((uint32_t)(mask) >> ((uint32_t)(name) * ((uint32_t)SINC_CHANNEL_COUNT))) & \ - ((1UL << ((uint32_t)SINC_CHANNEL_COUNT)) - 1UL)) \ - << (8UL * (uint32_t)(name))) - -#define SINC_FIND_STATUS_FIELD_VALUE(statusValue, name) \ - (((uint64_t)(statusValue) & (0xFFUL << ((uint64_t)(name)*8UL))) >> \ - ((uint64_t)(name) * (8UL - ((uint64_t)SINC_CHANNEL_COUNT)))) -/*! - * @brief The enumeration of SINC module's interrupts. - * @anchor sinc_interrupt_enable_t - */ -enum _sinc_interrupt_enable -{ - /* Normal interrupts enable. */ - /* Enable the conversion complete interrupt for channel 0. */ - kSINC_CH0ConvCompleteIntEnable = SINC_ENCODE_INTERRUPT(SINC_NORMAL_INT_REG_ID, SINC_NORMAL_INT_NAME_COCIE, 0ULL), - /* Enable the conversion complete interrupt for channel 1. */ - kSINC_CH1ConvCompleteIntEnable = SINC_ENCODE_INTERRUPT(SINC_NORMAL_INT_REG_ID, SINC_NORMAL_INT_NAME_COCIE, 1ULL), - /* Enable the conversion complete interrupt for channel 2. */ - kSINC_CH2ConvCompleteIntEnable = SINC_ENCODE_INTERRUPT(SINC_NORMAL_INT_REG_ID, SINC_NORMAL_INT_NAME_COCIE, 2ULL), - /* Enable the conversion complete interrupt for channel 3. */ - kSINC_CH3ConvCompleteIntEnable = SINC_ENCODE_INTERRUPT(SINC_NORMAL_INT_REG_ID, SINC_NORMAL_INT_NAME_COCIE, 3ULL), -#if (SINC_CHANNEL_COUNT >= 5UL) - /* Enable the conversion complete interrupt for channel 4. */ - kSINC_CH4ConvCompleteIntEnable = SINC_ENCODE_INTERRUPT(SINC_NORMAL_INT_REG_ID, SINC_NORMAL_INT_NAME_COCIE, 4ULL), -#endif - - /* Enable the data output ready interrupt for channel 0. */ - kSINC_CH0DataReadyIntEnable = SINC_ENCODE_INTERRUPT(SINC_NORMAL_INT_REG_ID, SINC_NORMAL_INT_NAME_CHFIE, 0ULL), - /* Enable the data output ready interrupt for channel 1. */ - kSINC_CH1DataReadyIntEnable = SINC_ENCODE_INTERRUPT(SINC_NORMAL_INT_REG_ID, SINC_NORMAL_INT_NAME_CHFIE, 1ULL), - /* Enable the data output ready interrupt for channel 2. */ - kSINC_CH2DataReadyIntEnable = SINC_ENCODE_INTERRUPT(SINC_NORMAL_INT_REG_ID, SINC_NORMAL_INT_NAME_CHFIE, 2ULL), - /* Enable the data output ready interrupt for channel 3. */ - kSINC_CH3DataReadyIntEnable = SINC_ENCODE_INTERRUPT(SINC_NORMAL_INT_REG_ID, SINC_NORMAL_INT_NAME_CHFIE, 3ULL), -#if (SINC_CHANNEL_COUNT >= 5UL) - /* Enable the data output ready interrupt for channel 4. */ - kSINC_CH4DataReadyIntEnable = SINC_ENCODE_INTERRUPT(SINC_NORMAL_INT_REG_ID, SINC_NORMAL_INT_NAME_CHFIE, 4ULL), -#endif - - /* Enable the zero cross detected interrupt for channel 0. */ - kSINC_CH0ZeroCrossDetectedIntEnable = - SINC_ENCODE_INTERRUPT(SINC_NORMAL_INT_REG_ID, SINC_NORMAL_INT_NAME_ZCDIE, 0ULL), - /* Enable the zero cross detected interrupt for channel 1. */ - kSINC_CH1ZeroCrossDetectedIntEnable = - SINC_ENCODE_INTERRUPT(SINC_NORMAL_INT_REG_ID, SINC_NORMAL_INT_NAME_ZCDIE, 1ULL), - /* Enable the zero cross detected interrupt for channel 2. */ - kSINC_CH2ZeroCrossDetectedIntEnable = - SINC_ENCODE_INTERRUPT(SINC_NORMAL_INT_REG_ID, SINC_NORMAL_INT_NAME_ZCDIE, 2ULL), - /* Enable the zero cross detected interrupt for channel 3. */ - kSINC_CH3ZeroCrossDetectedIntEnable = - SINC_ENCODE_INTERRUPT(SINC_NORMAL_INT_REG_ID, SINC_NORMAL_INT_NAME_ZCDIE, 3ULL), -#if (SINC_CHANNEL_COUNT >= 5UL) - /* Enable the zero cross detected interrupt for channel 4. */ - kSINC_CH4ZeroCrossDetectedIntEnable = - SINC_ENCODE_INTERRUPT(SINC_NORMAL_INT_REG_ID, SINC_NORMAL_INT_NAME_ZCDIE, 4ULL), -#endif - - /* Error interrupts enable. */ - /* Enable the short circuit detected interrupt for channel 0. */ - kSINC_CH0SCDIntEnable = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_SCDIE, 0ULL), - /* Enable the short circuit detected interrupt for channel 1. */ - kSINC_CH1SCDIntEnable = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_SCDIE, 1ULL), - /* Enable the short circuit detected interrupt for channel 2. */ - kSINC_CH2SCDIntEnable = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_SCDIE, 2ULL), - /* Enable the short circuit detected interrupt for channel 3. */ - kSINC_CH3SCDIntEnable = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_SCDIE, 3ULL), -#if (SINC_CHANNEL_COUNT >= 5UL) - /* Enable the short circuit detected interrupt for channel 4. */ - kSINC_CH4SCDIntEnable = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_SCDIE, 4ULL), -#endif - - /* Enable the window limit interrupt for channel 0. */ - kSINC_CH0WindowLimitIntEnable = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_WLMTIE, 0ULL), - /* Enable the window limit interrupt for channel 1. */ - kSINC_CH1WindowLimitIntEnable = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_WLMTIE, 1ULL), - /* Enable the window limit interrupt for channel 2. */ - kSINC_CH2WindowLimitIntEnable = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_WLMTIE, 2ULL), - /* Enable the window limit interrupt for channel 3. */ - kSINC_CH3WindowLimitIntEnable = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_WLMTIE, 3ULL), -#if (SINC_CHANNEL_COUNT >= 5UL) - /* Enable the window limit interrupt for channel 4. */ - kSINC_CH4WindowLimitIntEnable = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_WLMTIE, 4ULL), -#endif - - /* Enable the low limit interrupt for channel 0. */ - kSINC_CH0LowLimitIntEnable = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_LLMTIE, 0ULL), - /* Enable the low limit interrupt for channel 1. */ - kSINC_CH1LowLimitIntEnable = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_LLMTIE, 1ULL), - /* Enable the low limit interrupt for channel 2. */ - kSINC_CH2LowLimitIntEnable = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_LLMTIE, 2ULL), - /* Enable the low limit interrupt for channel 3. */ - kSINC_CH3LowLimitIntEnable = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_LLMTIE, 3ULL), -#if (SINC_CHANNEL_COUNT >= 5UL) - /* Enable the low limit interrupt for channel 4. */ - kSINC_CH4LowLimitIntEnable = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_LLMTIE, 4ULL), -#endif - - /* Enable the high limit interrupt for channel 0. */ - kSINC_CH0HighLimitIntEnable = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_HLMTIE, 0ULL), - /* Enable the high limit interrupt for channel 1. */ - kSINC_CH1HighLimitIntEnable = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_HLMTIE, 1ULL), - /* Enable the high limit interrupt for channel 2. */ - kSINC_CH2HighLimitIntEnable = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_HLMTIE, 2ULL), - /* Enable the high limit interrupt for channel 3. */ - kSINC_CH3HighLimitIntEnable = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_HLMTIE, 3ULL), -#if (SINC_CHANNEL_COUNT >= 5UL) - /* Enable the high limit interrupt for channel 4. */ - kSINC_CH4HighLimitIntEnable = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_HLMTIE, 4ULL), -#endif - - /* FIFO and CAD(clock-absence detector) Error interrupts enable. */ - /* Enable the FIFO underflow interrupt for channel 0. */ - kSINC_CH0FifoUnderflowIntEnable = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_FUNFIE, 0ULL), - /* Enable the FIFO underflow interrupt for channel 1. */ - kSINC_CH1FifoUnderflowIntEnable = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_FUNFIE, 1ULL), - /* Enable the FIFO underflow interrupt for channel 2. */ - kSINC_CH2FifoUnderflowIntEnable = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_FUNFIE, 2ULL), - /* Enable the FIFO underflow interrupt for channel 3. */ - kSINC_CH3FifoUnderflowIntEnable = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_FUNFIE, 3ULL), -#if (SINC_CHANNEL_COUNT >= 5UL) - /* Enable the FIFO underflow interrupt for channel 4. */ - kSINC_CH4FifoUnderflowIntEnable = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_FUNFIE, 4ULL), -#endif - - /* Enable the FIFO overflow interrupt for channel 0. */ - kSINC_CH0FifoOverflowIntEnable = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_FOVFIE, 0ULL), - /* Enable the FIFO overflow interrupt for channel 1. */ - kSINC_CH1FifoOverflowIntEnable = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_FOVFIE, 1ULL), - /* Enable the FIFO overflow interrupt for channel 2. */ - kSINC_CH2FifoOverflowIntEnable = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_FOVFIE, 2ULL), - /* Enable the FIFO overflow interrupt for channel 3. */ - kSINC_CH3FifoOverflowIntEnable = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_FOVFIE, 3ULL), -#if (SINC_CHANNEL_COUNT >= 5UL) - /* Enable the FIFO overflow interrupt for channel 4. */ - kSINC_CH4FifoOverflowIntEnable = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_FOVFIE, 4ULL), -#endif - - /* Enable the clock absence interrupt for channel 0. */ - kSINC_CH0CADIntEnable = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_CADIE, 0ULL), - /* Enable the clock absence interrupt for channel 1. */ - kSINC_CH1CADIntEnable = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_CADIE, 1ULL), - /* Enable the clock absence interrupt for channel 2. */ - kSINC_CH2CADIntEnable = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_CADIE, 2ULL), - /* Enable the clock absence interrupt for channel 3. */ - kSINC_CH3CADIntEnable = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_CADIE, 3ULL), -#if (SINC_CHANNEL_COUNT >= 5UL) - /* Enable the clock absence interrupt for channel 4. */ - kSINC_CH4CADIntEnable = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_CADIE, 4ULL), -#endif - - /* Enable the saturation interrupt for channel 0. */ - kSINC_CH0SaturationIntEnable = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_SATIE, 0ULL), - /* Enable the saturation interrupt for channel 1. */ - kSINC_CH1SaturationIntEnable = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_SATIE, 1ULL), - /* Enable the saturation interrupt for channel 2. */ - kSINC_CH2SaturationIntEnable = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_SATIE, 2ULL), - /* Enable the saturation interrupt for channel 3. */ - kSINC_CH3SaturationIntEnable = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_SATIE, 3ULL), -#if (SINC_CHANNEL_COUNT >= 5UL) - /* Enable the saturation interrupt for channel 4. */ - kSINC_CH4SaturationIntEnable = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_SATIE, 4ULL), -#endif -}; - -/*! - * @brief The enumeration of SINC interrupt status flags. - * @anchor sinc_interrupt_status_t - */ -enum _sinc_interrupt_status -{ - /* Normal interrupts status. */ - /* One conversion has finished and data is available in channel 0. */ - kSINC_CH0ConvCompleteIntStatus = SINC_ENCODE_INTERRUPT(SINC_NORMAL_INT_REG_ID, SINC_NORMAL_INT_NAME_COCIE, 0ULL), - /* One conversion has finished and data is available in channel 1. */ - kSINC_CH1ConvCompleteIntStatus = SINC_ENCODE_INTERRUPT(SINC_NORMAL_INT_REG_ID, SINC_NORMAL_INT_NAME_COCIE, 1ULL), - /* One conversion has finished and data is available in channel 2. */ - kSINC_CH2ConvCompleteIntStatus = SINC_ENCODE_INTERRUPT(SINC_NORMAL_INT_REG_ID, SINC_NORMAL_INT_NAME_COCIE, 2ULL), - /* One conversion has finished and data is available in channel 3. */ - kSINC_CH3ConvCompleteIntStatus = SINC_ENCODE_INTERRUPT(SINC_NORMAL_INT_REG_ID, SINC_NORMAL_INT_NAME_COCIE, 3ULL), -#if (SINC_CHANNEL_COUNT >= 5UL) - /* One conversion has finished and data is available in channel 4. */ - kSINC_CH4ConvCompleteIntStatus = SINC_ENCODE_INTERRUPT(SINC_NORMAL_INT_REG_ID, SINC_NORMAL_INT_NAME_COCIE, 4ULL), -#endif /* (SINC_CHANNEL_COUNT >= 5UL) */ - - /* The FIFO of channel 0 has exceeded its watermark level and the data is available in channel 0 result register. */ - kSINC_CH0DataReadyIntStatus = SINC_ENCODE_INTERRUPT(SINC_NORMAL_INT_REG_ID, SINC_NORMAL_INT_NAME_CHFIE, 0ULL), - /* The FIFO of channel 1 has exceeded its watermark level and the data is available in channel 1 result register. */ - kSINC_CH1DataReadyIntStatus = SINC_ENCODE_INTERRUPT(SINC_NORMAL_INT_REG_ID, SINC_NORMAL_INT_NAME_CHFIE, 1ULL), - /* The FIFO of channel 2 has exceeded its watermark level and the data is available in channel 2 result register. */ - kSINC_CH2DataReadyIntStatus = SINC_ENCODE_INTERRUPT(SINC_NORMAL_INT_REG_ID, SINC_NORMAL_INT_NAME_CHFIE, 2ULL), - /* The FIFO of channel 3 has exceeded its watermark level and the data is available in channel 3 result register. */ - kSINC_CH3DataReadyIntStatus = SINC_ENCODE_INTERRUPT(SINC_NORMAL_INT_REG_ID, SINC_NORMAL_INT_NAME_CHFIE, 3ULL), -#if (SINC_CHANNEL_COUNT >= 5UL) - /* The FIFO of channel 4 has exceeded its watermark level and the data is available in channel 4 result register. */ - kSINC_CH4DataReadyIntStatus = SINC_ENCODE_INTERRUPT(SINC_NORMAL_INT_REG_ID, SINC_NORMAL_INT_NAME_CHFIE, 4ULL), -#endif /* (SINC_CHANNEL_COUNT >= 5UL) */ - - /* The resulting data on channel 0 crossed zero and changed sign. */ - kSINC_CH0ZeroCrossDetectedIntStatus = - SINC_ENCODE_INTERRUPT(SINC_NORMAL_INT_REG_ID, SINC_NORMAL_INT_NAME_ZCDIE, 0ULL), - /* The resulting data on channel 1 crossed zero and changed sign. */ - kSINC_CH1ZeroCrossDetectedIntStatus = - SINC_ENCODE_INTERRUPT(SINC_NORMAL_INT_REG_ID, SINC_NORMAL_INT_NAME_ZCDIE, 1ULL), - /* The resulting data on channel 2 crossed zero and changed sign. */ - kSINC_CH2ZeroCrossDetectedIntStatus = - SINC_ENCODE_INTERRUPT(SINC_NORMAL_INT_REG_ID, SINC_NORMAL_INT_NAME_ZCDIE, 2ULL), - /* The resulting data on channel 3 crossed zero and changed sign. */ - kSINC_CH3ZeroCrossDetectedIntStatus = - SINC_ENCODE_INTERRUPT(SINC_NORMAL_INT_REG_ID, SINC_NORMAL_INT_NAME_ZCDIE, 3ULL), -#if (SINC_CHANNEL_COUNT >= 5UL) - /* The resulting data on channel 4 crossed zero and changed sign. */ - kSINC_CH4ZeroCrossDetectedIntStatus = - SINC_ENCODE_INTERRUPT(SINC_NORMAL_INT_REG_ID, SINC_NORMAL_INT_NAME_ZCDIE, 4ULL), -#endif /* (SINC_CHANNEL_COUNT >= 5UL) */ - - /* Error interrupts Status. */ - /* SINC detected a short circuit on channel 0. */ - kSINC_CH0SCDIntStatus = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_SCDIE, 0ULL), - /* SINC detected a short circuit on channel 1. */ - kSINC_CH1SCDIntStatus = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_SCDIE, 1ULL), - /* SINC detected a short circuit on channel 2. */ - kSINC_CH2SCDIntStatus = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_SCDIE, 2ULL), - /* SINC detected a short circuit on channel 3. */ - kSINC_CH3SCDIntStatus = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_SCDIE, 3ULL), -#if (SINC_CHANNEL_COUNT >= 5UL) - /* SINC detected a short circuit on channel 4. */ - kSINC_CH4SCDIntStatus = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_SCDIE, 4ULL), -#endif /* (SINC_CHANNEL_COUNT >= 5UL) */ - - /* Indicates channel 0 exceeded its window limit. */ - kSINC_CH0WindowLimitIntStatus = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_WLMTIE, 0ULL), - /* Indicates channel 1 exceeded its window limit. */ - kSINC_CH1WindowLimitIntStatus = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_WLMTIE, 1ULL), - /* Indicates channel 2 exceeded its window limit. */ - kSINC_CH2WindowLimitIntStatus = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_WLMTIE, 2ULL), - /* Indicates channel 3 exceeded its window limit. */ - kSINC_CH3WindowLimitIntStatus = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_WLMTIE, 3ULL), -#if (SINC_CHANNEL_COUNT >= 5UL) - /* Indicates channel 4 exceeded its window limit. */ - kSINC_CH4WindowLimitIntStatus = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_WLMTIE, 4ULL), -#endif /* (SINC_CHANNEL_COUNT >= 5UL) */ - - /* Indicates channel 0 exceeded its low limit. */ - kSINC_CH0LowLimitIntStatus = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_LLMTIE, 0ULL), - /* Indicates channel 1 exceeded its window limit. */ - kSINC_CH1LowLimitIntStatus = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_LLMTIE, 1ULL), - /* Indicates channel 2 exceeded its window limit. */ - kSINC_CH2LowLimitIntStatus = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_LLMTIE, 2ULL), - /* Indicates channel 3 exceeded its window limit. */ - kSINC_CH3LowLimitIntStatus = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_LLMTIE, 3ULL), -#if (SINC_CHANNEL_COUNT >= 5UL) - /* Indicates channel 4 exceeded its window limit. */ - kSINC_CH4LowLimitIntStatus = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_LLMTIE, 4ULL), -#endif /* (SINC_CHANNEL_COUNT >= 5UL) */ - - /* Indicates channel 0 exceeded its high limit. */ - kSINC_CH0HighLimitIntStatus = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_HLMTIE, 0ULL), - /* Indicates channel 1 exceeded its high limit. */ - kSINC_CH1HighLimitIntStatus = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_HLMTIE, 1ULL), - /* Indicates channel 2 exceeded its high limit. */ - kSINC_CH2HighLimitIntStatus = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_HLMTIE, 2ULL), - /* Indicates channel 3 exceeded its high limit. */ - kSINC_CH3HighLimitIntStatus = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_HLMTIE, 3ULL), -#if (SINC_CHANNEL_COUNT >= 5UL) - /* Indicates channel 4 exceeded its high limit. */ - kSINC_CH4HighLimitIntStatus = SINC_ENCODE_INTERRUPT(SINC_ERROR_INT_REG_ID, SINC_ERROR_INT_NAME_HLMTIE, 4ULL), -#endif /* (SINC_CHANNEL_COUNT >= 5UL) */ - - /* FIFO and CAD(clock-absence detector) Error interrupts Status. */ - /* A FIFO underflow occurred on channel 0. */ - kSINC_CH0FifoUnderflowIntStatus = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_FUNFIE, 0ULL), - /* A FIFO underflow occurred on channel 1. */ - kSINC_CH1FifoUnderflowIntStatus = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_FUNFIE, 1ULL), - /* A FIFO underflow occurred on channel 2. */ - kSINC_CH2FifoUnderflowIntStatus = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_FUNFIE, 2ULL), - /* A FIFO underflow occurred on channel 3. */ - kSINC_CH3FifoUnderflowIntStatus = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_FUNFIE, 3ULL), -#if (SINC_CHANNEL_COUNT >= 5UL) - /* A FIFO underflow occurred on channel 4. */ - kSINC_CH4FifoUnderflowIntStatus = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_FUNFIE, 4ULL), -#endif /* (SINC_CHANNEL_COUNT >= 5UL) */ - - /* A FIFO overflow occurred on channel 0. */ - kSINC_CH0FifoOverflowIntStatus = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_FOVFIE, 0ULL), - /* A FIFO overflow occurred on channel 1. */ - kSINC_CH1FifoOverflowIntStatus = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_FOVFIE, 1ULL), - /* A FIFO overflow occurred on channel 2. */ - kSINC_CH2FifoOverflowIntStatus = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_FOVFIE, 2ULL), - /* A FIFO overflow occurred on channel 3. */ - kSINC_CH3FifoOverflowIntStatus = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_FOVFIE, 3ULL), -#if (SINC_CHANNEL_COUNT >= 5UL) - /* A FIFO overflow occurred on channel 4. */ - kSINC_CH4FifoOverflowIntStatus = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_FOVFIE, 4ULL), -#endif /* (SINC_CHANNEL_COUNT >= 5UL) */ - - /* SINC detected the absence of a clock on channel 0. */ - kSINC_CH0CADIntStatus = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_CADIE, 0ULL), - /* SINC detected the absence of a clock on channel 1. */ - kSINC_CH1CADIntStatus = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_CADIE, 1ULL), - /* SINC detected the absence of a clock on channel 2. */ - kSINC_CH2CADIntStatus = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_CADIE, 2ULL), - /* SINC detected the absence of a clock on channel 3. */ - kSINC_CH3CADIntStatus = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_CADIE, 3ULL), -#if (SINC_CHANNEL_COUNT >= 5UL) - /* SINC detected the absence of a clock on channel 4. */ - kSINC_CH4CADIntStatus = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_CADIE, 4ULL), -#endif /* (SINC_CHANNEL_COUNT >= 5UL) */ - - /* Channel 0 is saturated. */ - kSINC_CH0SaturationIntStatus = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_SATIE, 0ULL), - /* Channel 1 is saturated. */ - kSINC_CH1SaturationIntStatus = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_SATIE, 1ULL), - /* Channel 2 is saturated. */ - kSINC_CH2SaturationIntStatus = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_SATIE, 2ULL), - /* Channel 3 is saturated. */ - kSINC_CH3SaturationIntStatus = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_SATIE, 3ULL), -#if (SINC_CHANNEL_COUNT >= 5UL) - /* Channel 4 is saturated. */ - kSINC_CH4SaturationIntStatus = SINC_ENCODE_INTERRUPT(SINC_FIFO_CAD_INT_REG_ID, SINC_FIFO_CAD_INT_SATIE, 4ULL), -#endif /* (SINC_CHANNEL_COUNT >= 5UL) */ -}; - -/*! - * @brief The enumeration of channel id, the sinc module contains 4 channels. - */ -typedef enum _sinc_channel_id -{ - kSINC_Channel0 = 0U, /*!< Channel 0. */ - kSINC_Channel1, /*!< Channel 1. */ - kSINC_Channel2, /*!< Channel 2. */ - kSINC_Channel3, /*!< Channel 3. */ -} sinc_channel_id_t; - -/*! - * @brief The enumeration of modulator clock name. - * @anchor _sinc_modulator_clock - */ -enum _sinc_modulator_clock -{ - kSINC_ModClk0 = 1UL, /*!< Modulator Clock 0 output. */ - kSINC_ModClk1 = 2UL, /*!< Modulator Clock 1 output. */ - kSINC_ModClk2 = 4UL, /*!< Modulator Clock 2 output. */ -}; - -/*! - * @brief The enumeration of input clock. - */ -typedef enum _sinc_inputClk_source -{ - kSINC_InputClk_SourceMclkOut0 = 0U, /*!< MCLK_OUT0 with internal routeback. */ - kSINC_InputClk_SourceMclkOut1 = 1U, /*!< MCLK_OUT1 with internal routeback. */ - kSINC_InputClk_SourceMclkOut2 = 2U, /*!< MCLK_OUT2 with internal routeback. */ - kSINC_InputClk_SourceExternalModulatorClk = 3U, /*!< External modulator clock dedicated to the selected channel. */ - kSINC_InputClk_SourceAdjacentChannelClk = 7U, /*!< Grouped clock shared with an adjacent channel. */ -} sinc_inputClk_source_t; - -/*! - * @brief The enumeration of clock edge. - */ -typedef enum _sinc_inputClk_edge -{ - kSINC_InputClk_EdgePositive = 1U, /*!< Positive edge. */ - kSINC_InputClk_EdgeNegative, /*!< Negative edge. */ - kSINC_InputClk_EdgeBoth, /*!< Both edges. */ - kSINC_InputClk_EdgeOddPositive, /*!< Every other odd positive edge. */ - kSINC_InputClk_EdgeEvenPositive, /*!< Every other even positive edge. */ - kSINC_InputClk_EdgeOddNegative, /*!< Every other odd negative edge. */ - kSINC_InputClk_EdgeEvenNegative, /*!< Every other even negative edge. */ -} sinc_inputClk_edge_t; - -/*! - * @brief The enumeration of input bit format. - */ -typedef enum _sinc_inputBit_format -{ - kSINC_InputBit_FormatExternalBitstream = 0U, /*!< External bitstream from the MBIT[n] signal. */ - kSINC_InputBit_FormatExternalManchesterCode, /*!< External Manchester code. */ - kSINC_InputBit_FormatInternal16bitParallelData, /*!< Internal 16-bit parallel data from MPDATA register. */ - kSINC_InputBit_FormatInternal32bitSerialData, /*!< Internal 32-bit serial data from MPDATA. */ -} sinc_inputBit_format_t; - -/*! - * @brief The enumeration of input bit source. - */ -typedef enum _sinc_inputBit_source -{ - kSINC_InputBit_SourceExternalBitstream = 0U, /*!< External bitstream from the MBIT[n] signal. */ - kSINC_InputBit_SourceInternalBitstream = 1U, /*!< Alternate internal bitstream from the INP[n] signal. */ - kSINC_InputBit_SourceAdjacentChannel = 3U, /*!< Grouped bitstream shared with an adjacent chanel. */ -} sinc_inputBit_source_t; - -/*! - * @brief The enumeration of trigger source. - */ -typedef enum _sinc_conv_trigger_source -{ - kSINC_ConvTrig_SoftPosEdge = 0x0U, /*!< Positive edge software trigger. */ - kSINC_ConvTrig_SoftHighLevel = 0x4U, /*!< High level software trigger. */ - kSINC_ConvTrig_HardPosEdge = 0x1U, /*!< Positive edge hardware trigger. */ - kSINC_ConvTrig_HardHighLevel = 0x5U, /*!< High level hardware trigger. */ - kSINC_ConvTrig_AdjacentChannel = 0x3U, /*!< Grouped hardware trigger shared with an adjacent channel. */ -} sinc_conv_trigger_source_t; - -/*! - * @brief The enumeration of conversion mode. - */ -typedef enum _sinc_conv_mode -{ - kSINC_ConvMode_Single = 0U, /*!< One conversion that follows an edge or level trigger event. */ - kSINC_ConvMode_Continuous, /*!< Multiple conversions that follow a triggering event, a new triggering event - cancels and restarts conversion. */ - kSINC_ConvMode_Always, /*!< Multiple conversions that follow the first triggering event, SINC ignores the - next triggering event. */ - kSINC_ConvMode_FixedNumber, /*!< Fixed number conversions that follow the first triggering event, a new - triggering event cancels and restarts conversion. */ -} sinc_conv_mode_t; - -/*! - * @brief The enumeration of pulse trigger mux. - */ -typedef enum _sinc_pulse_trigger_mux -{ - kSINC_PulseTrigger_Disabled = 0U, /*!< Disable pulse trigger output. */ - kSINC_PulseTrigger_MuxHighLimitLevelSignal, /*!< Select high limit level signal for pulse trigger output. */ - kSINC_PulseTrigger_MuxLowLimitLevelSignal, /*!< Select low limit level signal for pulse trigger output. */ - kSINC_PulseTrigger_MuxHighLowLimitLevelSignal, /*!< Select low or high limit level signal for pulse trigger output. - */ - kSINC_PulseTrigger_MuxWindowLimitLevelSignal, /*!< Select window limit level signal for pulse trigger output. */ - kSINC_PulseTrigger_MuxZeroCrossRisingLevelSignal, /*!< Select zero cross rising level signal for pulse trigger - output. */ - kSINC_PulseTrigger_MuxZeroCrossFallingLevelSignal, /*!< Select zero cross falling level signal for pulse trigger - output. */ - kSINC_PulseTrigger_MuxRsLimHighLevelSignal, /*!< Select level signal that indicates a high level from an RS - flip-flop or a schmitt trigger for pulse trigger output. */ - kSINC_PulseTrigger_MuxRsLimLowLevelSignal, /*!< Select level signal that indicates a low level from an RS flip-flop - or a schmitt trigger for pulse trigger output. */ - kSINC_PulseTrigger_MuxChannelRawInputModBitStream, /*!< Select channel raw input modulator bitstream for pulse - trigger output. */ - kSINC_PulseTrigger_MuxChannelRawInputModClock, /*!< Select channel raw input modulator clock for pulse trigger - output. */ - kSINC_PulseTrigger_MuxChannelRecoveredModBitStream, /*!< Select channel output recovered modulator bitstream for - pulse trigger output. */ - kSINC_PulseTrigger_MuxChannelRecoveredModClock, /*!< Select channel output recovered modulator clock for pulse - trigger output. */ - kSINC_PulseTrigger_MuxHighLimitPulseSignal, /*!< Select high limit pulse signal for pulse trigger output. */ - kSINC_PulseTrigger_MuxLowLimitPulseSignal, /*!< Select low limit pulse signal for pulse trigger output. */ - kSINC_PulseTrigger_MuxLimitPulseSignal, /*!< Select the pulse signal that indicates a high/low/window limit for - pulse trigger output. */ - kSINC_PulseTrigger_MuxWindowLimitPulseSignal, /*!< Select window limit pulse signal for pulse trigger output. */ - kSINC_PulseTrigger_MuxHighLowLimitPulseSignal, /*!< Select the pulse signal that indicates a high or low limit for - pulse trigger output. */ - kSINC_PulseTrigger_MuxZeroCrossRisePulseSignal, /*!< Select zero cross rise pulse signal for trigger output. */ - kSINC_PulseTrigger_MuxZeroCrossFallPulseSignal, /*!< Select zero cross fall pulse signal for trigger output. */ - kSINC_PulseTrigger_MuxZeroCrossRiseFallPulseSignal, /*!< Select zero cross rise/fall pulse signal for trigger - output. */ - kSINC_PulseTrigger_MuxFifoWatermarkOkPulseSignal, /*!< Select FIFO watermark OK pulse signal for trigger output. */ - kSINC_PulseTrigger_MuxFifoOverflowPulseSignal, /*!< Select FIFO overflow pulse signal. */ - kSINC_PulseTrigger_MuxFifoUnderflowPulseSignal, /*!< Select FIFO underflow pulse signal. */ - kSINC_PulseTrigger_MuxFifoEmptyPulseSignal, /*!< Select FIFO empty pulse signal. */ - kSINC_PulseTrigger_MuxClockMonitorAssertPulseSignal, /*!< Select clock monitor assert pulse signal. */ - kSINC_PulseTrigger_MuxShortCircuitAssertPulseSignal, /*!< Select short circuit assert pulse signal. */ - kSINC_PulseTrigger_MuxSaturationPulseSignal, /*!< Select saturation pulse signal. */ - kSINC_PulseTrigger_MuxConversionCompletePulseSignal, /*!< Select conversion complete pulse signal. */ -} sinc_pulse_trigger_mux_t; - -/*! - * @brief The enumeration of zero cross detector operate mode. - */ -typedef enum _sinc_zero_cross_operate_mode -{ - kSINC_ZCD_BothRiseAndFall = 0U, /*!< Zero cross detector operate on both rise and fall. */ - kSINC_ZCD_OnlyFall, /*!< Zero cross detector operate on fall edge. */ - kSINC_ZCD_OnlyRise, /*!< Zero cross detector operate on rise edge. */ - kSINC_ZCD_Disabled = 0xFU, /*!< Zero cross detector disabled. */ -} sinc_zero_cross_operate_mode_t; - -/*! - * @brief The enumeration of primary filter order. - */ -typedef enum _sinc_primary_filter_order -{ - kSINC_PF_FastSinc = 0U, /*!< Fast sinc filter, ORD is 4. */ - kSINC_PF_FirstOrder, /*!< First order filter, ORD is 1. */ - kSINC_PF_SecondOrder, /*!< Second order filter, ORD is 2. */ - kSINC_PF_ThirdOrder, /*!< Third order filter, ORD is 3. */ -} sinc_primary_filter_order_t; - -/*! - * @brief The enumeration of clock prescale that specify the clock divider ratio for the modulator clock. - */ -typedef enum _sinc_clock_prescale -{ - kSINC_ClkPrescale1 = 0UL, /*!< No prescale. */ - kSINC_ClkPrescale2, /*!< Modulator clock divider ratio is 2. */ - kSINC_ClkPrescale4, /*!< Modulator clock divider ratio is 4. */ - kSINC_ClkPrescale8, /*!< Modulator clock divider ratio is 8. */ -} sinc_clock_prescale_t; - -/*! - * @brief The enumeration of primary filter shift direction. - */ -typedef enum _sinc_primary_filter_shift_direction -{ - kSINC_PF_ShiftRight = 0U, /*!< Right shift the raw data. */ - kSINC_PF_ShiftLeft = 1U << 4U, /*!< Left shift the raw data. */ -} sinc_primary_filter_shift_direction_t; - -/*! - * @brief The enumeration of primary filer bias sign. - */ -typedef enum _sinc_primary_filter_bias_sign -{ - kSINC_PF_BiasPositive = 0UL, /*!< The bias sign is positive. */ - kSINC_PF_BiasNegative, /*!< The bias sign is negative. */ -} sinc_primary_filter_bias_sign_t; - -/*! - * @brief The enumeration of HPF DC remover Alpha coefficient. - */ -typedef enum _sinc_primary_filter_hpf_alpha_coeff -{ - kSINC_PF_HPFAlphaCoeff0 = 0UL, /*!< Disabled HPF. */ - kSINC_PF_HPFAlphaCoeff1, /*!< Alpha coefficient = 1 - (2^-5) */ - kSINC_PF_HPFAlphaCoeff2, /*!< Alpha coefficient = 1 - (2^-6) */ - kSINC_PF_HPFAlphaCoeff3, /*!< Alpha coefficient = 1 - (2^-7) */ - kSINC_PF_HPFAlphaCoeff4, /*!< Alpha coefficient = 1 - (2^-8) */ - kSINC_PF_HPFAlphaCoeff5, /*!< Alpha coefficient = 1 - (2^-9) */ - kSINC_PF_HPFAlphaCoeff6, /*!< Alpha coefficient = 1 - (2^-10) */ - kSINC_PF_HPFAlphaCoeff7, /*!< Alpha coefficient = 1 - (2^-11) */ - kSINC_PF_HPFAlphaCoeff8, /*!< Alpha coefficient = 1 - (2^-12) */ - kSINC_PF_HPFAlphaCoeff9, /*!< Alpha coefficient = 1 - (2^-13) */ - kSINC_PF_HPFAlphaCoeff10, /*!< Alpha coefficient = 1 - (2^-14) */ - kSINC_PF_HPFAlphaCoeff11, /*!< Alpha coefficient = 1 - (2^-15) */ - kSINC_PF_HPFAlphaCoeff12, /*!< Alpha coefficient = 1 - (2^-16) */ - kSINC_PF_HPFAlphaCoeff13, /*!< Alpha coefficient = 1 - (2^-17) */ - kSINC_PF_HPFAlphaCoeff14, /*!< Alpha coefficient = 1 - (2^-18) */ - kSINC_PF_HPFAlphaCoeff15, /*!< Alpha coefficient = 1 - (2^-19) */ -} sin_primary_filter_hpf_alpha_coeff_t; - -/*! - * @brief The enumeration of input bit delay. - */ -typedef enum _sinc_inputBit_delay -{ - kSINC_InputBit_DelayDisabled = 0U, /*!< Input modulator bitstream delay disabled. */ - kSINC_InputBit_Delay1ClkCycle, /*!< Input modulator bitstream delay 1 PRE_CLK cycle. */ - kSINC_InputBit_Delay2ClkCycle, /*!< Input modulator bitstream delay 2 PRE_CLK cycle. */ - kSINC_InputBit_Delay3ClkCycle, /*!< Input modulator bitstream delay 3 PRE_CLK cycle. */ - kSINC_InputBit_Delay4ClkCycle, /*!< Input modulator bitstream delay 4 PRE_CLK cycle. */ - kSINC_InputBit_Delay5ClkCycle, /*!< Input modulator bitstream delay 5 PRE_CLK cycle. */ - kSINC_InputBit_Delay6ClkCycle, /*!< Input modulator bitstream delay 6 PRE_CLK cycle. */ - kSINC_InputBit_Delay7ClkCycle, /*!< Input modulator bitstream delay 7 PRE_CLK cycle. */ - kSINC_InputBit_Delay8ClkCycle, /*!< Input modulator bitstream delay 8 PRE_CLK cycle. */ - kSINC_InputBit_Delay9ClkCycle, /*!< Input modulator bitstream delay 9 PRE_CLK cycle. */ - kSINC_InputBit_Delay10ClkCycle, /*!< Input modulator bitstream delay 10 PRE_CLK cycle. */ - kSINC_InputBit_Delay11ClkCycle, /*!< Input modulator bitstream delay 11 PRE_CLK cycle. */ - kSINC_InputBit_Delay12ClkCycle, /*!< Input modulator bitstream delay 12 PRE_CLK cycle. */ - kSINC_InputBit_Delay13ClkCycle, /*!< Input modulator bitstream delay 13 PRE_CLK cycle. */ - kSINC_InputBit_Delay14ClkCycle, /*!< Input modulator bitstream delay 14 PRE_CLK cycle. */ - kSINC_InputBit_Delay15ClkCycle, /*!< Input modulator bitstream delay 15 PRE_CLK cycle. */ -} sinc_inputBit_delay_t; - -/*! - * @brief The enumeration of short-circuit detector operate mode. - */ -typedef enum _sinc_scd_operate_mode -{ - kSINC_Scd_OperateAtChannelEnabled = 0U, /*!< SCD operates when the channel is enabled. */ - kSINC_Scd_OperateAtConversion, /*!< SCD operates when the PF is performing a conversion. */ - kSINC_Scd_OperateDisabled = 0xFU, /*!< Short circuit detect is disabled. */ -} sinc_scd_operate_mode_t; - -/*! - * @brief The enumeration of short-circuit detector option. - */ -typedef enum _sinc_scd_option -{ - kSINC_Scd_DetectRepeating0And1 = 0U, /*!< Both repeating 0 and 1 increment the SCD counter. */ - kSINC_Scd_DetectRepeatingOnly1, /*!< Only repeating 1 increment the SCD counter. */ - kSINC_Scd_DetectRepeatingOnly0, /*!< Only repeating 1 increment the SCD counter. */ -} sinc_scd_option_t; - -/*! - * @brief The mode of limit detector. - * - * @note The value of each limit detector contains lot of information: - * bit[1:0]: limit detection options, - * bit[2]: low limit break signal. - * bit[3]: window limit break signal. - * bit[4]: High limit break signal. - * bit[7]: Enable/disable limit detector. - */ -typedef enum _sinc_limit_detector_mode -{ - kSINC_Lmt_BothHighAndLowLimit = 0x94U, /*!< Limit detector is enabled, and compare the filter sample value to high - and low limit, if the value larger than high limit will trigger - interrupt or break, and if the value lower than low limit will trigger - interrupt or break. */ - kSINC_Lmt_OnlyHighLimit = 0x91U, /*!< Limit detector is enabled, and compare the filter sample value to high limit, - if the value larger than high limit will trigger interrupt or break. */ - kSINC_Lmt_OnlyLowLimit = 0x86U, /*!< Limit detector is enabled, and compare the filter sample value to low limit, if - the value lower than low limit will trigger interrupt or break. */ - kSINC_Lmt_WindowedValue = 0x8BU, /*!< Limit detector is enabled, and compare the filter sample value to high and low - limit, if the value higher than low limit and lower than high limit will trigger - interrupt or break. */ - kSINC_Lmt_Disabled = 0x0U, /*!< Limit detector is disabled. */ - -} sinc_limit_detector_mode_t; - -/*! - * @brief The enumeration of clock-absence threshold. - */ -typedef enum _sinc_cad_threshold -{ - kSINC_Cad_Disabled = 0U, /*!< Clock absence detector is disabled. */ - kSINC_Cad_Count1ClkCycle, /*!< Clock absence detector threshold is 1 clock cycle. */ - kSINC_Cad_Count2ClkCycle, /*!< Clock absence detector threshold is 2 clock cycle. */ - kSINC_Cad_Count3ClkCycle, /*!< Clock absence detector threshold is 3 clock cycle. */ - kSINC_Cad_Count4ClkCycle, /*!< Clock absence detector threshold is 4 clock cycle. */ - kSINC_Cad_Count5ClkCycle, /*!< Clock absence detector threshold is 5 clock cycle. */ - kSINC_Cad_Count6ClkCycle, /*!< Clock absence detector threshold is 6 clock cycle. */ - kSINC_Cad_Count7ClkCycle, /*!< Clock absence detector threshold is 7 clock cycle. */ - kSINC_Cad_Count8ClkCycle, /*!< Clock absence detector threshold is 8 clock cycle. */ - kSINC_Cad_Count9ClkCycle, /*!< Clock absence detector threshold is 9 clock cycle. */ - kSINC_Cad_Count10ClkCycle, /*!< Clock absence detector threshold is 10 clock cycle. */ - kSINC_Cad_Count11ClkCycle, /*!< Clock absence detector threshold is 11 clock cycle. */ - kSINC_Cad_Count12ClkCycle, /*!< Clock absence detector threshold is 12 clock cycle. */ - kSINC_Cad_Count13ClkCycle, /*!< Clock absence detector threshold is 13 clock cycle. */ - kSINC_Cad_Count14ClkCycle, /*!< Clock absence detector threshold is 14 clock cycle. */ - kSINC_Cad_Count15ClkCycle, /*!< Clock absence detector threshold is 15 clock cycle. */ -} sinc_cad_threshold_t; - -#if (defined(FSL_FEATURE_SINC_CACFR_HAS_ADMASEL) && FSL_FEATURE_SINC_CACFR_HAS_ADMASEL) -/*! - * @brief The enumeration of alternate DMA source. - */ -typedef enum _sinc_alternate_dma_source -{ - kSINC_AltDma_Disabled = 0U, /*!< Alternate DMA disabled. */ - kSINC_AltDma_PfConvComplete, /*!< Select PF conversion complete for alternate DMA. */ - kSINC_AltDma_PfDataOutputReady, /*!< Select PF data output ready for alternate DMA. */ - kSINC_AltDma_ZeroCrossDetected, /*!< Select zero crossing detected for alternate DMA. */ - kSINC_AltDma_ShortCircuitDetected, /*!< Select short circuit detected for alternate DMA. */ - kSINC_AltDma_WindowLimitDetected, /*!< Select window limit detected for alternate DMA. */ - kSINC_AltDma_LowLimitDetected, /*!< Select low limit detected for alternate DMA. */ - kSINC_AltDma_HighLimitDetected, /*!< Select high limit detected for alternate DMA. */ - kSINC_AltDma_FifoUnderflow, /*!< Select FIFO underflow detected for alternate DMA. */ - kSINC_AltDma_FifoOverflow, /*!< Select FIFO overflow detected for alternate DMA. */ - kSINC_AltDma_ClockAbsence, /*!< Select clock absence detected for alternate DMA. */ - kSINC_AltDma_Saturation, /*!< Select channel saturation for alternate DMA. */ -} sinc_alternate_dma_source_t; -#endif /* (defined(FSL_FEATURE_SINC_CACFR_HAS_ADMASEL) && FSL_FEATURE_SINC_CACFR_HAS_ADMASEL) */ - -/*! - * @brief The enumeration of result data format. - */ -typedef enum _sinc_result_data_format -{ - kSINC_LeftJustifiedSigned = 0U, /*!< Left justified, signed. */ - kSINC_LeftJustifiedUnsigned, /*!< Left justified, unsigned. */ -} sinc_result_data_format_t; - -/*! - * @brief The enumeration of debug output. - */ -typedef enum _sinc_debug_output -{ - kSINC_Debug_PfFinalData = 0U, /*!< Final data from PF(24 bits). */ - kSINC_Debug_OffsetData, /*!< Offset data(24 bits). */ - kSINC_Debug_PfShiftedData, /*!< Shifted data from the PF(24 bits). */ - kSINC_Debug_HpfData, /*!< DC remover(HPF) data(32 bits). */ - kSINC_Debug_CicRawData, /*!< Raw data from the PF's CIC filter. */ - kSINC_Debug_ScdHistoricalData, /*!< Historical data from SCD. */ - kSINC_Debug_ManchesterDecoderData, /*!< Data from the Manchester decoder. */ - kSINC_Debug_CadData, /*!< Data from CAD. */ - kSINC_Debug_FifoEntriesNum, /*!< Number of available entries in the FIFO. */ - kSINC_Debug_ParallelSerialConverterStatus, /*!< Status of the parallel or serial data converter. */ -} sinc_debug_output_t; - -/*! - * @brief The structure of channel input options, including input bit settings and input clock settings. - */ -typedef struct _sinc_channel_input_option -{ - sinc_inputBit_format_t inputBitFormat; /*!< Specify input bit format, please refer - to @ref sinc_inputBit_format_t. */ - sinc_inputBit_source_t inputBitSource; /*!< Specify input bit source, please refer - to @ref sinc_inputBit_source_t. */ - sinc_inputBit_delay_t inputBitDelay; /*!< Specify input bit delay, please refer to @ref sinc_inputBit_delay_t. */ - - sinc_inputClk_source_t inputClkSource; /*!< Specify input clock source, please refer - to @ref sinc_inputClk_source_t. */ - sinc_inputClk_edge_t inputClkEdge; /*!< Specify input clock edge, please refer to @ref sinc_inputClk_edge_t. */ -} sinc_channel_input_option_t; - -/*! - * @brief The structure of channel conversion options, including CIC filter settings, HPF settings, shift settings, - * bias settings and so on. - */ -typedef struct _sinc_channel_conv_option -{ - sinc_conv_mode_t convMode; /*!< Specify conversion mode, please refer to @ref sinc_conv_mode_t. */ - sinc_conv_trigger_source_t convTriggerSource; /*!< Specify conversion trigger source, please - refer to @ref sinc_conv_trigger_source_t. */ - - bool enableChPrimaryFilter; /*!< Enable/disable channel's primary filter. */ - sinc_primary_filter_order_t pfOrder; /*!< Specify the order of primary filter, please - refer to @ref sinc_primary_filter_order_t. */ - uint16_t u16pfOverSampleRatio; /*!< Control primary filter's OSR, the minimum permissible value is 3, - low value produce unpredictable result, the maximum permissible value depend on - PF order and the desired data format, if PF order is third order and data format - is signed, the maximum OSR value is 1289, if PF order is third order and data - format is unsigned, the maximum OSR value is 1624, otherwise the maximum OSR - value is 2047. Please note that the OSR for equation is - u16pfOverSampleRatio + 1*/ - - sin_primary_filter_hpf_alpha_coeff_t pfHpfAlphaCoeff; /*!< Specify HPF's alpha coeff, please - refer to @ref sin_primary_filter_hpf_alpha_coeff_t. */ - - sinc_primary_filter_shift_direction_t pfShiftDirection; /*!< Select shift direction, right or left. */ - uint8_t u8pfShiftBitsNum; /*!< Specify the number of bits to shift the data, ranges from 0 to 15. */ - - sinc_primary_filter_bias_sign_t pfBiasSign; /*!< Select bias sign, please refer - to @ref sinc_primary_filter_bias_sign_t. */ - uint32_t u32pfBiasValue; /*!< Range from 0 to 0x7FFFFFUL. */ -} sinc_channel_conv_option_t; - -/*! - * @brief The structure of channel protection options, including limit check settings, short-circuit settings, - * clock-absence settings, and zero-crossing settings. - */ -typedef struct _sinc_channel_protection_option -{ - sinc_limit_detector_mode_t limitDetectorMode; /*!< Specify limit detector mode, please - refer to @ref sinc_limit_detector_mode_t. */ - bool bEnableLmtBreakSignal; /*!< Enable/disable limit break signal, - the details of break signal is depended on detector mode. */ - uint32_t u32LowLimitThreshold; /*!< Specify the low-limit threshold value, range from 0 to 0xFFFFFFUL. */ - uint32_t u32HighLimitThreshold; /*!< Specify the high-limit threshold value, range from 0 to 0xFFFFFFUL. */ - - sinc_scd_operate_mode_t scdOperateMode; /*!< Enable/disable scd, and set SCD operate timming. */ - uint8_t u8ScdLimitThreshold; /*!< Range from 2 to 255, 0 and 1 are prohibited. */ - sinc_scd_option_t scdOption; /*!< Specify SCD options, please refer to @ref sinc_scd_option_t. */ - bool bEnableScdBreakSignal; /*!< Enable/disable SCD break signal. */ - - sinc_cad_threshold_t cadLimitThreshold; /*!< Specify the threshold value for the CAD counter. */ - bool bEnableCadBreakSignal; /*!< Enable/disable CAD break signal. */ - - sinc_zero_cross_operate_mode_t zcdOperateMode; /*!< Specify zero cross detector operate mode. */ -} sinc_channel_protection_option_t; - -/*! - * @brief The structure of channel configurations, including channel input option, channel conversion options, channel - * protection options, and so on. - */ -typedef struct _sinc_channel_config -{ - bool bEnableChannel; /*!< Enable/disable channel. */ - bool bEnableFifo; /*!< Enable/disable channel's FIFO. */ - uint8_t u8FifoWaterMark; /*!< Specify the fifo watermark, range from 0 to 15. */ - bool bEnablePrimaryDma; /*!< Used to enable/disable primary DMA. */ -#if (defined(FSL_FEATURE_SINC_CACFR_HAS_ADMASEL) && FSL_FEATURE_SINC_CACFR_HAS_ADMASEL) - sinc_alternate_dma_source_t altDmaSource; /*!< Set channel's alternate DMA source, please refer - to @ref sinc_alternate_dma_source_t. */ -#endif /* (defined(FSL_FEATURE_SINC_CACFR_HAS_ADMASEL) && FSL_FEATURE_SINC_CACFR_HAS_ADMASEL) */ - sinc_result_data_format_t dataFormat; /*!< Set channel's result data format, please refer - to @ref sinc_result_data_format_t. */ - - sinc_channel_input_option_t *chInputOption; /*!< The pointer to @ref sinc_channel_input_option_t that contains - channel input options. */ - sinc_channel_conv_option_t *chConvOption; /*!< The pointer to @ref sinc_channel_conv_option_t that contains - channel conversion options. */ - sinc_channel_protection_option_t *chProtectionOption; /*!< The pointer to @ref sinc_channel_protection_option_t - that contains channel protection options. */ -} sinc_channel_config_t; - -/*! - * @brief The structure of sinc configurations, including clock settings anc channels' settings. - */ -typedef struct _sinc_config -{ - sinc_clock_prescale_t clockPreDivider; /*!< Specify modulator clock pre divider, please - refer to @ref sinc_clock_prescale_t. */ - uint32_t modClkDivider; /*!< Range from 2 to 256, 0 and 1 are prohibited, to obtain a 50% duty cycle in - the MCLK output, write an even value to*/ - bool disableModClk0Output; /*!< Disable/enable modulator clock0 output. */ - bool disableModClk1Output; /*!< Disable/enable modulator clock1 output. */ - bool disableModClk2Output; /*!< Disable/enable modulator clock2 output. */ - - sinc_channel_config_t *channelsConfigArray[SINC_CHANNEL_COUNT]; /*!< The array that contains 4 elements, and the - type of each element is \b sinc_channel_config_t *, - channelsConfigArray[0] corresponding to channel0, - channelsConfigArray[1] corresponding to channel1, - channelsConfigArray[2] corresponding to channel2, - channelsConfigArray[3] corresponding to channel3, if some channels - are not used, the corresponding elements should be set as NULL. */ - - bool disableDozeMode; /*!< Disable/enable SINC module when the chip enters Doze or stop mode. */ - bool enableMaster; /*!< Enable/disable all function blocks of SINC module. */ -} sinc_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -/*! - * @name SINC Generic Functional Control APIs - * @{ - */ - -/*! - * @brief Initialize selected SINC instance, including clock options and channel options. - * - * @param base SINC peripheral base address. - * @param config The pointer to @ref sinc_config_t structure. - */ -void SINC_Init(SINC_Type *base, const sinc_config_t *config); - -/*! - * @brief De-initialize selected SINC instance. - * - * @param base SINC peripheral base address. - */ -void SINC_Deinit(SINC_Type *base); - -/*! - * @brief Get default configuration. - * - * @code {.c} - * config->clockPreDivider = kSINC_ClkPrescale1; - * config->modClkDivider = 2UL; - * config->disableModClk0Output = false; - * config->disableModClk1Output = false; - * config->disableModClk2Output = false; - * - * config->channelsConfigArray[4] = {NULL, NULL, NULL, NULL}; - * - * config->disableDozeMode = false; - * config->enableMaster = false; - * @endcode - * - * - * @param config The pointer to @ref sinc_config_t structure, must not be NULL. - */ -void SINC_GetDefaultConfig(sinc_config_t *config); - -/*! @} */ - -/*! - * @name SINC Generic Low Level Control APIs - * @{ - */ - -/*! - * @brief Enable/disable all function blocks enabled in their respective registers. - * - * @param base SINC peripheral base address. - * @param enable Used to enable/disable all function blocks: - * - \b true Enable all function blocks, please note that clock must be configured previously; - * - \b false Disable all function blocks. - */ -static inline void SINC_EnableMaster(SINC_Type *base, bool enable) -{ - if (enable) - { - base->MCR |= SINC_MCR_MEN_MASK; - } - else - { - base->MCR &= ~SINC_MCR_MEN_MASK; - } -} - -/*! - * @brief Reset all function blocks(except for the clock blocks), interrupt statuses. - * - * @param base SINC peripheral base address. - */ -static inline void SINC_DoSoftwareReset(SINC_Type *base) -{ - base->MCR |= SINC_MCR_RST_MASK; - base->MCR &= ~SINC_MCR_RST_MASK; -} - -/*! - * @brief Disable/enable SINC module when the chip enters Doze or Stop mode. - * - * @param base SINC peripheral base address. - * @param disable Used to control if module functional when the chip enters Doze and Stop mode: - * - \b true Disable SINC when the chip enters Doze or Stop mode; - * - \b false Enable SINC when the chip enters Doze or stop mode. - */ -static inline void SINC_DisableDozeMode(SINC_Type *base, bool disable) -{ - if (disable) - { - base->MCR |= SINC_MCR_DOZEN_MASK; - } - else - { - base->MCR &= ~SINC_MCR_DOZEN_MASK; - } -} - -/*! @} */ - -/*! - * @name Clock Control APIs - * @{ - */ - -/*! - * @brief Check whether selected modulator clocks are ready. - * - * @note The result of this APIs means all selected modulator clocks are (not) ready. - * - * @param base SINC peripheral base address. - * @param modClkMasks The mask of modulator clocks, please refer to @ref _sinc_modulator_clock. - * - * @retval true The input mask of modulator clocks are ready. - * @retval false The input mask of modulator clocks are not ready. - */ -static inline bool SINC_CheckModulatorClockReady(SINC_Type *base, uint32_t modClkMasks) -{ - return ((base->SR & (modClkMasks << SINC_SR_MCLKRDY0_SHIFT)) != 0UL); -} - -/*! - * @brief Disable/enable modulator clocks' output. - * - * @note By default, modulator clock's output is enabled. - * - * @param base SINC peripheral base address. - * @param modClkMasks The mask of modulator clocks, please refer to @ref _sinc_modulator_clock. - * @param disable Used to enable/disable clock output: - * - \b true Disable modulator clocks' output; - * - \b false Enable modulator clocks' output. - */ -static inline void SINC_DisableModulatorClockOutput(SINC_Type *base, uint32_t modClkMasks, bool disable) -{ - if (disable) - { - base->MCR |= (modClkMasks << SINC_MCR_MCLK0DIS_SHIFT); - } - else - { - base->MCR &= ~(modClkMasks << SINC_MCR_MCLK0DIS_SHIFT); - } -} - -/*! - * @brief Set the clock divider ratio for the modulator clock. - * - * @param base SINC peripheral base address. - * @param clkPrescale Clock prescale value, please refer to @ref sinc_clock_prescale_t. - */ -static inline void SINC_SetClkPrescale(SINC_Type *base, sinc_clock_prescale_t clkPrescale) -{ - base->MCR = (((base->MCR) & (~SINC_MCR_PRESCALE_MASK)) | SINC_MCR_PRESCALE(clkPrescale)); -} - -/*! - * @brief Set modulator clock divider value. - * - * @note IMCLK0 = PRE_CLK / modClkDivider, the minimum clock divider ration is 2. - * - * @param base SINC peripheral base address. - * @param modClkDivider Range from 2 to 256, 0 and 1 are prohibited, to obtain a 50% duty cycle in the MCLK output, - * write an even value to \b modClkDivider . - */ -static inline void SINC_SetModulatorClockDivider(SINC_Type *base, uint32_t modClkDivider) -{ - assert(modClkDivider != 0UL); - assert(modClkDivider != 1UL); - - base->MCR = (((base->MCR) & (~SINC_MCR_MCLKDIV_MASK)) | SINC_MCR_MCLKDIV((modClkDivider - 1UL))); -} - -/* !} */ - -/*! - * @name Channel Functional Control APIs - * @{ - */ - -/*! - * @brief Set channel configurations, including input options, conversion options and protection options. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param chConfig Pointer to @ref sinc_channel_config_t structure, must not be NULL. - */ -void SINC_SetChannelConfig(SINC_Type *base, sinc_channel_id_t chId, sinc_channel_config_t *chConfig); - -/*! - * @brief Set channel input options, including input bit format, input bit source, input bit delay, input clock source, - * input clock edge. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param chInputOption Pointer to @ref sinc_channel_input_option_t structure, must not be NULL. - */ -void SINC_SetChannelInputOption(SINC_Type *base, sinc_channel_id_t chId, sinc_channel_input_option_t *chInputOption); - -/*! - * @brief Set channel conversion options, including conversion mode, trigger source, and primary filter settings. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param chConvOption Pointer to @ref sinc_channel_conv_option_t structure, must not be NULL. - */ -void SINC_SetChannelConversionOption(SINC_Type *base, sinc_channel_id_t chId, sinc_channel_conv_option_t *chConvOption); - -/*! - * @brief Set channel protection options, including limit check, short-circuit detector, clock-absence detector, and - * zero-crossing detector. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param chProtection Pointer to @ref sinc_channel_protection_option_t, must not be NULL. - */ -void SINC_SetChannelProtectionOption(SINC_Type *base, - sinc_channel_id_t chId, - sinc_channel_protection_option_t *chProtection); - -/*! @} */ - -/*! - * @name Channel Result/FIFO Low Level Control APIs - * @{ - */ - -/*! - * @brief Read selected channel's result data. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * - * @return Result data of the selected channel, 24 bits width. - */ -static inline uint32_t SINC_ReadChannelResultData(SINC_Type *base, sinc_channel_id_t chId) -{ - return ((base->CHANNEL[(uint8_t)chId].CRDATA & SINC_CRDATA_RDATA_MASK) >> SINC_CRDATA_RDATA_SHIFT); -} - -/*! - * @brief Enable/disable FIFO transfers for the primary filter. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param enable Used to enable/disable channl FIFO: - * - \b true Enable channel FIFO. - * - \b false Disable channle FIFO. - */ -static inline void SINC_EnableChannelFIFO(SINC_Type *base, sinc_channel_id_t chId, bool enable) -{ - if (enable) - { - base->CHANNEL[(uint8_t)chId].CCR |= SINC_CCR_FIFOEN_MASK; - } - else - { - base->CHANNEL[(uint8_t)chId].CCR &= ~SINC_CCR_FIFOEN_MASK; - } -} - -/*! - * @brief Set the FIFO watermark. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param fifoWaterMark Specify the fifo watermark, range from 0 to 15. - */ -static inline void SINC_SetChannelFifoWatermark(SINC_Type *base, sinc_channel_id_t chId, uint8_t fifoWaterMark) -{ - base->CHANNEL[(uint8_t)chId].CCFR = - ((base->CHANNEL[(uint8_t)chId].CCFR) & (~SINC_CCFR_FIFOWMK_MASK)) | (SINC_CCFR_FIFOWMK(fifoWaterMark)); -} - -/*! - * @brief Enable/disable selected channel. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param enable Used to enable/disable selected channel: - * - \b true Enable selected channel; - * - \b false Disable selected channel. - */ -static inline void SINC_EnableChannel(SINC_Type *base, sinc_channel_id_t chId, bool enable) -{ - if (enable) - { - base->CHANNEL[(uint8_t)chId].CCR |= SINC_CCR_CHEN_MASK; - } - else - { - base->CHANNEL[(uint8_t)chId].CCR &= ~SINC_CCR_CHEN_MASK; - } -} - -/*! - * @brief Enable/disable selected channel's primary DMA transfers when the channel's FIFO exceeds its watermark. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param enable Used to enable/disable primary DMA : - * - \b true Enable primary DMA; - * - \b false Disable primary DMA. - */ -static inline void SINC_EnableChannelPrimaryDma(SINC_Type *base, sinc_channel_id_t chId, bool enable) -{ - if (enable) - { - base->CHANNEL[(uint8_t)chId].CCR |= SINC_CCR_DMAEN_MASK; - } - else - { - base->CHANNEL[(uint8_t)chId].CCR &= ~SINC_CCR_DMAEN_MASK; - } -} - -#if (defined(FSL_FEATURE_SINC_CACFR_HAS_ADMASEL) && FSL_FEATURE_SINC_CACFR_HAS_ADMASEL) -/*! - * @brief Set selected channel's alternate DMA source selection. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param altDmaSource Specify the trigger source for alternate DMA, please refer to @ref sinc_alternate_dma_source_t. - */ -static inline void SINC_SetChannelAltDmaSource(SINC_Type *base, - sinc_channel_id_t chId, - sinc_alternate_dma_source_t altDmaSource) -{ - base->CHANNEL[(uint8_t)chId].CACFR = - ((base->CHANNEL[(uint8_t)chId].CACFR & ~SINC_CACFR_ADMASEL_MASK) | SINC_CACFR_ADMASEL(altDmaSource)); -} -#endif /* (defined(FSL_FEATURE_SINC_CACFR_HAS_ADMASEL) && FSL_FEATURE_SINC_CACFR_HAS_ADMASEL) */ - -/*! - * @brief Set selected channel's result data format. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param dataFormat Specify the result data format, please refer to @ref sinc_result_data_format_t. - */ -static inline void SINC_SetChannelResultDataFormat(SINC_Type *base, - sinc_channel_id_t chId, - sinc_result_data_format_t dataFormat) -{ - if (dataFormat == kSINC_LeftJustifiedSigned) - { - base->CHANNEL[(uint8_t)chId].CCFR &= ~SINC_CCFR_RDFMT_MASK; - } - else - { - base->CHANNEL[(uint8_t)chId].CCFR |= SINC_CCFR_RDFMT_MASK; - } -} - -/*! - * @brief Get the number of remaining data entries in the FIFO. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * - * @return The number of remaining data entries in the FIFO. - */ -static inline uint8_t SINC_GetChannelFifoCount(SINC_Type *base, sinc_channel_id_t chId) -{ - return (uint8_t)(base->CHANNEL[(uint8_t)chId].CSR & SINC_CSR_FIFOAVIL_MASK); -} - -/*! - * @brief Check whether the data in selected channel's result data register is stable when FIFO is disabled. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, refer to @ref sinc_channel_id_t for details. - * - * @retval true Data in selected channel's result data regiter is stable. - * @retval false Data in selected channel's result data register is not stable. - */ -static inline bool SINC_CheckChannelResultDataReady(SINC_Type *base, sinc_channel_id_t chId) -{ - return ((base->CHANNEL[(uint8_t)chId].CSR & SINC_CSR_RDRS_MASK) != SINC_CSR_RDRS_MASK); -} - -/*! - * @brief Check whether selected channel's FIFO is empty. - * - * @param base SINC peripheral base address. - * @param chId The id of sinc channel to check. - * - * @retval true Selected channel's FIFO is empty. - * @retval false Selected channel's FIFO is not empty. - */ -static inline bool SINC_CheckChannelFifoEmpty(SINC_Type *base, sinc_channel_id_t chId) -{ - return ((base->SR & (SINC_SR_FIFOEMPTY0_MASK << (uint32_t)chId)) != 0UL); -} - -/*! @} */ - -/*! - * @name Channel Conversion Low Level Control APIs - * @{ - */ - -/*! - * @brief Trigger selected channel's conversion. - * - * @param base SINC peripheral base address. - * @param chMask The mask of channels to trigger. - */ -static inline void SINC_AffirmChannelSoftwareTrigger(SINC_Type *base, uint32_t chMask) -{ - base->MCR |= chMask; -} - -/*! - * @brief Negate the trigger of selected channel. - * - * @param base SINC peripheral base address. - * @param chMask The mask of channels. - */ -static inline void SINC_NegateChannelSoftwareTrigger(SINC_Type *base, uint32_t chMask) -{ - base->MCR &= ~chMask; -} - -/*! - * @brief Set selected channel's conversion mode. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param mode The conversion mode to set, please refer to @ref sinc_conv_mode_t. - */ -static inline void SINC_SetChannelConversionMode(SINC_Type *base, sinc_channel_id_t chId, sinc_conv_mode_t mode) -{ - base->CHANNEL[(uint8_t)chId].CDR = ((base->CHANNEL[(uint8_t)chId].CDR & ~SINC_CDR_PFCM_MASK) | SINC_CDR_PFCM(mode)); -} - -/*! - * @brief Set selected channel's trigger source. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param triggerSource Trigger source to set, please refer to @ref sinc_conv_trigger_source_t. - */ -static inline void SINC_SetChannelTriggerSource(SINC_Type *base, - sinc_channel_id_t chId, - sinc_conv_trigger_source_t triggerSource) -{ - base->CHANNEL[(uint8_t)chId].CCFR = - (((base->CHANNEL[(uint8_t)chId].CCFR) & ~(SINC_CCFR_ITLVL_MASK | SINC_CCFR_ITSEL_MASK)) | - SINC_CCFR_ITLVL((((uint32_t)triggerSource) & 0x4UL) >> 2UL) | - SINC_CCFR_ITSEL((uint32_t)triggerSource & 0x3UL)); -} - -/*! - * @brief Set multipurpose data to selected channel. - * - * @note If input bit format is set as ManchesterCode, multipurpose data indicates the Manchester decoder threshold - * value and is 11 bits width; if input bit format is set as parallel, multipurpose data indicates the parallel 16-bit - * data and is 16 bits width; if input bit format is set as serial, multipurpose data indicates the serial data and is - * 32 bits width. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param data Multipurpose data to set. - */ -static inline void SINC_SetChannelMultipurposeData(SINC_Type *base, sinc_channel_id_t chId, uint32_t data) -{ - base->CHANNEL[(uint8_t)chId].CMPDATA = SINC_CMPDATA_MPDATA(data); -} - -/*! - * @brief Set selected channel's PF order. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param pfOrder Primary filter order to set, please refer to @ref sinc_primary_filter_order_t - */ -static inline void SINC_SetChannelPfOrder(SINC_Type *base, sinc_channel_id_t chId, sinc_primary_filter_order_t pfOrder) -{ - base->CHANNEL[(uint8_t)chId].CDR = - ((base->CHANNEL[(uint8_t)chId].CDR) & (~SINC_CDR_PFORD_MASK)) | (SINC_CDR_PFORD(pfOrder)); -} - -/*! - * @brief Set selected channel's PF over sample rate. - * - * @note If PF order is third order and data format is signed, the maximum OSR value is 1289, if PF order is third - * order and data format is unsigned, the maximum OSR value is 1624, otherwise the maximum OSR value is 2047. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param pfOsr Control the channel's PF OSR, the minimum permissible value is 3, low value produce unpredictable - * result, the maximum permissible value depend on PF order and the desired data format. - */ -static inline void SINC_SetChannelPfOsr(SINC_Type *base, sinc_channel_id_t chId, uint16_t pfOsr) -{ - base->CHANNEL[(uint8_t)chId].CDR = - ((base->CHANNEL[(uint8_t)chId].CDR) & (~SINC_CDR_PFOSR_MASK)) | (SINC_CDR_PFOSR(pfOsr)); -} - -/*! - * @brief set selected channel's HPF DC remover Alpha coefficient. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param pfHpfAlphaCoeff Specify the HPF alpha coefficient or disable HPF as described in @ref - * sin_primary_filter_hpf_alpha_coeff_t. - */ -static inline void SINC_SetChannelPfHpfAlphaCoeff(SINC_Type *base, - sinc_channel_id_t chId, - sin_primary_filter_hpf_alpha_coeff_t pfHpfAlphaCoeff) -{ - base->CHANNEL[(uint8_t)chId].CACFR = - ((base->CHANNEL[(uint8_t)chId].CACFR) & (~SINC_CACFR_HPFA_MASK)) | (SINC_CACFR_HPFA(pfHpfAlphaCoeff)); -} - -/*! - * @brief Set the value that shifts the PF data for the correct 24-bit precision. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param pfShiftDirection Specify the PF shift direction, including right and left. - * @param pfShiftBitsNum Specify the PF shift value, range from 0 to 15. - */ -static inline void SINC_SetChannelPfShiftConfig(SINC_Type *base, - sinc_channel_id_t chId, - sinc_primary_filter_shift_direction_t pfShiftDirection, - uint8_t pfShiftBitsNum) -{ - base->CHANNEL[(uint8_t)chId].CCFR = ((base->CHANNEL[(uint8_t)chId].CCFR) & (~SINC_CCFR_PFSFT_MASK)) | - (SINC_CCFR_PFSFT((uint32_t)pfShiftDirection | (uint32_t)pfShiftBitsNum)); -} - -/*! - * @brief Set the bias offset for the selected channel's PF. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param pfBiasSign Specify the bias sign, please refer to @ref sinc_primary_filter_bias_sign_t for details. - * @param pfBiasValue The bias value to subtracted from the output of PF shift block, range from 0 to 0x7FFFFFUL. - */ -static inline void SINC_SetChannelPfBiasConfig(SINC_Type *base, - sinc_channel_id_t chId, - sinc_primary_filter_bias_sign_t pfBiasSign, - uint32_t pfBiasValue) -{ - base->CHANNEL[(uint8_t)chId].CBIAS = (uint32_t)pfBiasSign << 31UL | pfBiasValue << SINC_CBIAS_BIAS_SHIFT; -} - -/*! - * @brief Enable/disable selected channel's primary filter. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param enable Used to enable primary filter: - * - \b true Enable channel's PF; - * - \b false Disable channel's PF. - */ -static inline void SINC_EnableChannelPrimaryFilter(SINC_Type *base, sinc_channel_id_t chId, bool enable) -{ - if (enable) - { - base->CHANNEL[(uint8_t)chId].CCR |= SINC_CCR_PFEN_MASK; - } - else - { - base->CHANNEL[(uint8_t)chId].CCR &= ~SINC_CCR_PFEN_MASK; - } -} - -/*! - * @brief Check whether selected channel's multipurpose data is ready to write parallel or serial data. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, refer to @ref sinc_channel_id_t for details. - * - * @retval true Selected channel's multipurpose data is ready to write parallel or serial data. - * @retval false Selected channel's multipurpose data is not ready to write parallel or serial data. - */ -static inline bool SINC_CheckChannelParallelSerialDataReady(SINC_Type *base, sinc_channel_id_t chId) -{ - return ((base->CHANNEL[(uint8_t)chId].CSR & SINC_CSR_PSRDY_MASK) == SINC_CSR_PSRDY_MASK); -} - -/*! - * @brief Check whether primary CIC filter saturation occurred. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, refer to @ref sinc_channel_id_t for details. - * - * @retval true Selected channel's primary CIC filter saturation occurred. - * @retval false Selected channel's primary CIC filter saturation did not occurred. - */ -static inline bool SINC_CheckChannelPrimaryCICSaturation(SINC_Type *base, sinc_channel_id_t chId) -{ - return ((base->CHANNEL[(uint8_t)chId].CSR & SINC_CSR_PFSAT_MASK) == SINC_CSR_PFSAT_MASK); -} - -/*! - * @brief Check whether HPF saturation occurred. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, refer to @ref sinc_channel_id_t for details. - * - * @retval true Selected channel's HPF saturation occurred. - * @retval false Selected channel's HPF saturation did not occurred. - */ -static inline bool SINC_CheckChannelHPFSaturation(SINC_Type *base, sinc_channel_id_t chId) -{ - return ((base->CHANNEL[(uint8_t)chId].CSR & SINC_CSR_HPFSAT_MASK) == SINC_CSR_HPFSAT_MASK); -} - -/*! - * @brief Check whether Shift saturation occurred. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, refer to @ref sinc_channel_id_t for details. - * - * @retval true Selected channel's shift saturation occurred. - * @retval false Selected channel's shift saturation did not occurred. - */ -static inline bool SINC_CheckChannelShiftSaturation(SINC_Type *base, sinc_channel_id_t chId) -{ - return ((base->CHANNEL[(uint8_t)chId].CSR & SINC_CSR_SFTSAT_MASK) == SINC_CSR_SFTSAT_MASK); -} - -/*! - * @brief Check whether bias saturation occurred. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, refer to @ref sinc_channel_id_t for details. - * - * @retval true Selected channel's bias saturation occurred. - * @retval false Selected channel's bias saturation did not occurred. - */ -static inline bool SINC_CheckChannelBiasSaturation(SINC_Type *base, sinc_channel_id_t chId) -{ - return ((base->CHANNEL[(uint8_t)chId].CSR & SINC_CSR_BIASSAT_MASK) == SINC_CSR_BIASSAT_MASK); -} - -/*! - * @brief Get selected channel's number of conversions. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, refer to @ref sinc_channel_id_t for details. - * @return uint8_t Selected channel's number of conversions. - */ -uint8_t SINC_GetChannelConversionCount(SINC_Type *base, sinc_channel_id_t chId); - -/*! - * @brief Check whether the selected channel is in conversion. - * - * @param base SINC peripheral base address. - * @param chId The id of sinc channel to check. - * - * @retval false Selected channel conversion not in progress. - * @retval true Selected channel conversion in progress. - */ -static inline bool SINC_CheckChannelConvProgress(SINC_Type *base, sinc_channel_id_t chId) -{ - return ((base->SR & (((uint32_t)SINC_SR_CIP0_MASK) << (uint32_t)chId)) != 0UL); -} - -/*! - * @brief Check whether the selected channel is ready for conversion. - * - * @param base SINC peripheral base address. - * @param chId The id of sinc channel to check. - * - * @retval true Selected channel is ready for conversion. - * @retval false Selected channel is not ready for conversion. - */ -static inline bool SINC_CheckChannelReadyForConv(SINC_Type *base, sinc_channel_id_t chId) -{ - return ((base->SR & (((uint32_t)SINC_SR_CHRDY0_MASK) << (uint32_t)chId)) != 0UL); -} - -/*! @} */ - -/*! - * @name Channel Protection Low Level Control APIs - * @{ - */ - -/*! - * @brief Set selected channel's low-limit threshold value. - * - * @note When the data exceeds the low-limit threshold value, a low-limit event occurs, and the limit threshold format - * is determines by channel's result data format @ref sinc_result_data_format_t. - * - * @note Low limit value must lower than high limit value, otherwise the low-limit threshold does not work. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param lowLimitThreshold Specify the low-limit threshold value, range from 0 to 0xFFFFFFUL. - */ -static inline void SINC_SetChannelLowLimitThreshold(SINC_Type *base, sinc_channel_id_t chId, uint32_t lowLimitThreshold) -{ - base->CHANNEL[(uint8_t)chId].CLOLMT = SINC_CLOLMT_LOLMT(lowLimitThreshold); -} - -/*! - * @brief Set selected channel's high-limit threshold value. - * - * @note When the data exceeds the high-limit threshold value, a high-limit event occurs, and the limit threshold format - * is determines by channel's result data format @ref sinc_result_data_format_t. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param highLimitThreshold Specify the high-limit threshold value, range from 0 to 0xFFFFFFUL. - */ -static inline void SINC_SetChannelHighLimitThreshold(SINC_Type *base, - sinc_channel_id_t chId, - uint32_t highLimitThreshold) -{ - base->CHANNEL[(uint8_t)chId].CHILMT = SINC_CHILMT_HILMT(highLimitThreshold); -} - -/*! - * @brief Set selected channel's limit detector mode. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param mode Specify the mode of limit detector, please refer to @ref sinc_limit_detector_mode_t. - */ -static inline void SINC_SetChannelLimitDetectorMode(SINC_Type *base, - sinc_channel_id_t chId, - sinc_limit_detector_mode_t mode) -{ - if (mode == kSINC_Lmt_Disabled) - { - base->CHANNEL[(uint8_t)chId].CCR &= ~SINC_CCR_LMTEN_MASK; - } - else - { - base->CHANNEL[(uint8_t)chId].CPROT = - (base->CHANNEL[(uint8_t)chId].CPROT & ~SINC_CPROT_LMTOP_MASK) | SINC_CPROT_LMTOP((uint32_t)mode & 0x3UL); - base->CHANNEL[(uint8_t)chId].CCR |= SINC_CCR_LMTEN_MASK; - } -} - -/*! - * @brief Enable/disable selected channel's high limit break signal. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param enable Used to enable/disable high limit break signal: - * - \b true Enable the automatic assertion of the BREAK_HIGH signal when SINC detects a high-limit event on - * the selected channel. - * - \b false Disable high limit break signal. - */ -static inline void SINC_EnableChannelHighLimitBreakSignal(SINC_Type *base, sinc_channel_id_t chId, bool enable) -{ - if (enable) - { - base->CHANNEL[(uint8_t)chId].CPROT |= SINC_CPROT_HLMTBK_MASK; - } - else - { - base->CHANNEL[(uint8_t)chId].CPROT &= ~SINC_CPROT_HLMTBK_MASK; - } -} - -/*! - * @brief Enable/disable selected channel's window limit break signal. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param enable Used to enable/disable window limit break signal: - * - \b true Enable the automatic assertion of the BREAK_WIN signal when SINC detects a window-limit event on - * the selected channel. - * - \b false Disable window limit break signal. - */ -static inline void SINC_EnableChannelWindowLimitBreakSignal(SINC_Type *base, sinc_channel_id_t chId, bool enable) -{ - if (enable) - { - base->CHANNEL[(uint8_t)chId].CPROT |= SINC_CPROT_WLMTBK_MASK; - } - else - { - base->CHANNEL[(uint8_t)chId].CPROT &= ~SINC_CPROT_WLMTBK_MASK; - } -} - -/*! - * @brief Enable/disable selected channel's low limit break signal. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param enable Used to enable/disable low limit break signal: - * - \b true Enable the automatic assertion of the BREAK_LOW signal when SINC detects a low-limit event on - * the selected channel. - * - \b false Disable low limit break signal. - */ -static inline void SINC_EnableChannelLowLimitBreakSignal(SINC_Type *base, sinc_channel_id_t chId, bool enable) -{ - if (enable) - { - base->CHANNEL[(uint8_t)chId].CPROT |= SINC_CPROT_HLMTBK_MASK; - } - else - { - base->CHANNEL[(uint8_t)chId].CPROT &= ~SINC_CPROT_HLMTBK_MASK; - } -} - -/*! - * @brief Set selected channel's short-circuit detector operate mode. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param opMode Specify the operate mode to set, please refer to @ref sinc_scd_operate_mode_t. - */ -static inline void SINC_SetChannelScdOperateMode(SINC_Type *base, - sinc_channel_id_t chId, - sinc_scd_operate_mode_t opMode) -{ - if (opMode == kSINC_Scd_OperateDisabled) - { - base->CHANNEL[(uint8_t)chId].CCR &= ~SINC_CCR_SCDEN_MASK; - } - else - { - base->CHANNEL[(uint8_t)chId].CPROT = - ((base->CHANNEL[(uint8_t)chId].CPROT & ~SINC_CPROT_SCDCM_MASK) | SINC_CPROT_SCDCM(opMode)); - base->CHANNEL[(uint8_t)chId].CCR |= SINC_CCR_SCDEN_MASK; - } -} - -/*! - * @brief Set selected channel's Scd limit threshold. - * - * @note The SCD counter tracks the number of received bits with the same repeating value(always 0 or always 1, set by - * SINC_SetChannelScdOption()), if that - * number exceeds the scdLimitThreshold, an SCD event occurs on the associated channel. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param u8ScdLimitThreshold Specify the threshold value for the SCD counter, range from 2 to 255. - */ -static inline void SINC_SetChannelScdLimitThreshold(SINC_Type *base, - sinc_channel_id_t chId, - uint8_t u8ScdLimitThreshold) -{ - assert(u8ScdLimitThreshold != 0U); - assert(u8ScdLimitThreshold != 1U); - - base->CHANNEL[(uint8_t)chId].CPROT = - ((base->CHANNEL[(uint8_t)chId].CPROT) & (~SINC_CPROT_SCDLMT_MASK)) | (SINC_CPROT_SCDLMT(u8ScdLimitThreshold)); -} - -/*! - * @brief Set selected channel's SDC option. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param option Specify which repeating bit value increments the SCD counter. - */ -static inline void SINC_SetChannelScdOption(SINC_Type *base, sinc_channel_id_t chId, sinc_scd_option_t option) -{ - base->CHANNEL[(uint8_t)chId].CPROT = - ((base->CHANNEL[(uint8_t)chId].CPROT) & (~SINC_CPROT_SCDOP_MASK)) | (SINC_CPROT_SCDOP(option)); -} - -/*! - * @brief Enable/disable the automatic assertion of the BREAK_SCD signal when SINC detects an SCD event on the selected - * channel. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param enable Used to enable/disable SCD break signal: - * - \b true Enable SCD break signal. - * - \b false Disable SCD break signal. - */ -static inline void SINC_EnableChannelScdBreakSignal(SINC_Type *base, sinc_channel_id_t chId, bool enable) -{ - if (enable) - { - base->CHANNEL[(uint8_t)chId].CPROT |= SINC_CPROT_SCDBK_MASK; - } - else - { - base->CHANNEL[(uint8_t)chId].CPROT &= ~SINC_CPROT_SCDBK_MASK; - } -} - -/*! - * @brief Set the threshold value for the CAD counter. - * - * @note The CAD counter tracks the number of clock cycles during which SINC does not detect a clock, if that number - * exceeds the threshold value, a CAD event occurs on the selected channel. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param cadLimitThreshold Specify the threshold value for the CAD counter, please refer to @ref sinc_cad_threshold_t. - */ -static inline void SINC_SetChannelCadLimitThreshold(SINC_Type *base, - sinc_channel_id_t chId, - sinc_cad_threshold_t cadLimitThreshold) -{ - base->CHANNEL[(uint8_t)chId].CPROT = - ((base->CHANNEL[(uint8_t)chId].CPROT) & (~SINC_CPROT_CADLMT_MASK)) | (SINC_CPROT_CADLMT(cadLimitThreshold)); - if (cadLimitThreshold == kSINC_Cad_Disabled) - { - base->CHANNEL[(uint8_t)chId].CCR &= ~SINC_CCR_CADEN_MASK; - } - else - { - base->CHANNEL[(uint8_t)chId].CCR |= SINC_CCR_CADEN_MASK; - } -} - -/*! - * @brief Enable/disable the automatic assertion of the BREAK_CAD signal when SINC detects a CAD event on the assoicated - * channel. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param enable Used to enable/disble CAD break signal: - * - \b true Enable selected channel's CAD break signal; - * - \b false Disable selected channel's CAD break signal. - */ -static inline void SINC_EnableChannelCadBreakSignal(SINC_Type *base, sinc_channel_id_t chId, bool enable) -{ - if (enable) - { - base->CHANNEL[(uint8_t)chId].CPROT |= SINC_CPROT_CADBK_MASK; - } - else - { - base->CHANNEL[(uint8_t)chId].CPROT &= ~SINC_CPROT_CADBK_MASK; - } -} - -/*! - * @brief Set selected channel's zero-crossing detector operate mode. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param opMode Specify the operate mode, please refer to @ref sinc_zero_cross_operate_mode_t. - */ -static inline void SINC_SetChannelZcdOperateMode(SINC_Type *base, - sinc_channel_id_t chId, - sinc_zero_cross_operate_mode_t opMode) -{ - if (opMode == kSINC_ZCD_Disabled) - { - base->CHANNEL[(uint8_t)chId].CCR &= ~SINC_CCR_ZCDEN_MASK; - } - else - { - base->CHANNEL[(uint8_t)chId].CCFR = - ((base->CHANNEL[(uint8_t)chId].CCFR) & (~SINC_CCFR_ZCOP_MASK)) | (SINC_CCFR_ZCOP(opMode)); - base->CHANNEL[(uint8_t)chId].CCR |= SINC_CCR_ZCDEN_MASK; - } -} - -/*! @} */ - -/*! - * @name Channel Debug Low Level Control APIs - * @{ - */ - -#if !((defined(FSL_FEATURE_SINC_CACFR_HAS_NO_PTMUX) && FSL_FEATURE_SINC_CACFR_HAS_NO_PTMUX)) -/*! - * @brief Set selected channel's pulse trigger mux. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param pulseTrigMux Used to selected the signal for pulse-trigger output. - */ -static inline void SINC_SetChannelPulseTriggerMux(SINC_Type *base, - sinc_channel_id_t chId, - sinc_pulse_trigger_mux_t pulseTrigMux) -{ - base->CHANNEL[(uint8_t)chId].CACFR = - ((base->CHANNEL[(uint8_t)chId].CACFR & ~SINC_CACFR_PTMUX_MASK) | SINC_CACFR_PTMUX(pulseTrigMux)); -} -#endif /* !(defined(FSL_FEATURE_SINC_CACFR_HAS_NO_PTMUX) && FSL_FEATURE_SINC_CACFR_HAS_NO_PTMUX) */ - -/*! - * @brief Set selected channel's debug output. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * @param debugOutput Used to select debug output, please refer to @ref sinc_debug_output_t. - */ -static inline void SINC_SetChannelDebugOutput(SINC_Type *base, sinc_channel_id_t chId, sinc_debug_output_t debugOutput) -{ - base->CHANNEL[(uint8_t)chId].CCR = - ((base->CHANNEL[(uint8_t)chId].CCR & ~SINC_CCR_DBGSEL_MASK) | SINC_CCR_DBGSEL(debugOutput)); -} - -/*! - * @brief Start selected channel's debug data latch proceduce. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - */ -static inline void SINC_LatchChannelDebugProceduce(SINC_Type *base, sinc_channel_id_t chId) -{ - base->CHANNEL[(uint8_t)chId].CSR |= SINC_CSR_SRDS_MASK; -} - -/*! - * @brief Check if the selected channel's debug data is valid. - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * - * @retval true Data is valid. - * @retval false Data is invalid. - */ -static inline bool SINC_CheckChannelDebugDataValid(SINC_Type *base, sinc_channel_id_t chId) -{ - return ((base->CHANNEL[(uint8_t)chId].CSR & (SINC_CSR_SRDS_MASK | SINC_CSR_DBGRS_MASK)) == 0UL); -} - -/*! - * @brief Return selected channel's the debug data that requested by SINC_SetChannelDebugOutput(). - * - * @param base SINC peripheral base address. - * @param chId Selected channel id, please refer to @ref sinc_channel_id_t. - * - * @return Selected channel's debug data. - */ -static inline uint32_t SINC_GetChannelDebugData(SINC_Type *base, sinc_channel_id_t chId) -{ - return base->CHANNEL[(uint8_t)chId].CDBGR; -} - -/*! @} */ - -/*! - * @name Interrupt Control APIs - * @{ - */ - -/*! - * @brief Enable the mask of interrupts, such as channel data ready interrupt, channel limit detect interrupt and so on. - * - * @param base SINC peripheral base address. - * @param interruptMasks Mask of interrupts to enable, should be the OR'ed value of @ref sinc_interrupt_enable_t. - */ -static inline void SINC_EnableInterrupts(SINC_Type *base, uint64_t interruptMasks) -{ - uint32_t normalIntMask; - uint32_t errorIntMask; - uint32_t fifoCadIntMask; - - /* - * #define SINC_DECODE_INTERRUPT(interruptMask) \ - * normalIntMask = ((uint32_t)(interruptMask) & (0xFFFFFUL)); \ - * errorIntMask = ((uint32_t)((interruptMask) >> 20ULL) & (0xFFFFFUL)); \ - * fifoCadIntMask = ((uint32_t)((interruptMask) >> 40ULL) & (0xFFFFFUL)) - */ - SINC_DECODE_INTERRUPT(interruptMasks); - - base->NIE |= SINC_FIND_INT_FIELD_VALUE(normalIntMask, SINC_NORMAL_INT_NAME_COCIE) | - SINC_FIND_INT_FIELD_VALUE(normalIntMask, SINC_NORMAL_INT_NAME_CHFIE) | - SINC_FIND_INT_FIELD_VALUE(normalIntMask, SINC_NORMAL_INT_NAME_ZCDIE); - - base->EIE |= SINC_FIND_INT_FIELD_VALUE(errorIntMask, SINC_ERROR_INT_NAME_SCDIE) | - SINC_FIND_INT_FIELD_VALUE(errorIntMask, SINC_ERROR_INT_NAME_WLMTIE) | - SINC_FIND_INT_FIELD_VALUE(errorIntMask, SINC_ERROR_INT_NAME_LLMTIE) | - SINC_FIND_INT_FIELD_VALUE(errorIntMask, SINC_ERROR_INT_NAME_HLMTIE); - - base->FIFOIE |= SINC_FIND_INT_FIELD_VALUE(fifoCadIntMask, SINC_FIFO_CAD_INT_FUNFIE) | - SINC_FIND_INT_FIELD_VALUE(fifoCadIntMask, SINC_FIFO_CAD_INT_FOVFIE) | - SINC_FIND_INT_FIELD_VALUE(fifoCadIntMask, SINC_FIFO_CAD_INT_CADIE) | - SINC_FIND_INT_FIELD_VALUE(fifoCadIntMask, SINC_FIFO_CAD_INT_SATIE); -} - -/*! - * @brief Enable the mask of interrupts, such as channel data ready interrupt, channel limit detect interrupt and so on. - * - * @param base SINC peripheral base address. - * @param interruptMasks Mask of interrupts to disable, should be the OR'ed value of @ref sinc_interrupt_enable_t. - */ -static inline void SINC_DisableInterrupts(SINC_Type *base, uint64_t interruptMasks) -{ - uint32_t normalIntMask; - uint32_t errorIntMask; - uint32_t fifoCadIntMask; - - /* - * #define SINC_DECODE_INTERRUPT(interruptMask) \ - * normalIntMask = ((uint32_t)(interruptMask) & (0xFFFFFUL)); \ - * errorIntMask = ((uint32_t)((interruptMask) >> 20ULL) & (0xFFFFFUL)); \ - * fifoCadIntMask = ((uint32_t)((interruptMask) >> 40ULL) & (0xFFFFFUL)) - */ - SINC_DECODE_INTERRUPT(interruptMasks); - - base->NIE &= ~(SINC_FIND_INT_FIELD_VALUE(normalIntMask, SINC_NORMAL_INT_NAME_COCIE) | - SINC_FIND_INT_FIELD_VALUE(normalIntMask, SINC_NORMAL_INT_NAME_CHFIE) | - SINC_FIND_INT_FIELD_VALUE(normalIntMask, SINC_NORMAL_INT_NAME_ZCDIE)); - - base->EIE &= ~(SINC_FIND_INT_FIELD_VALUE(errorIntMask, SINC_ERROR_INT_NAME_SCDIE) | - SINC_FIND_INT_FIELD_VALUE(errorIntMask, SINC_ERROR_INT_NAME_WLMTIE) | - SINC_FIND_INT_FIELD_VALUE(errorIntMask, SINC_ERROR_INT_NAME_LLMTIE) | - SINC_FIND_INT_FIELD_VALUE(errorIntMask, SINC_ERROR_INT_NAME_HLMTIE)); - - base->FIFOIE &= ~(SINC_FIND_INT_FIELD_VALUE(fifoCadIntMask, SINC_FIFO_CAD_INT_FUNFIE) | - SINC_FIND_INT_FIELD_VALUE(fifoCadIntMask, SINC_FIFO_CAD_INT_FOVFIE) | - SINC_FIND_INT_FIELD_VALUE(fifoCadIntMask, SINC_FIFO_CAD_INT_CADIE) | - SINC_FIND_INT_FIELD_VALUE(fifoCadIntMask, SINC_FIFO_CAD_INT_SATIE)); -} - -/*! - * @brief Get interrupt status flags. - * - * @param base SINC peripheral base address. - * - * @return SINC module's interrupt status flags, the OR'ed value of @ref sinc_interrupt_status_t. - */ -static inline uint64_t SINC_GetInterruptStatus(SINC_Type *base) -{ - uint64_t allIntStatusValue = 0ULL; - uint32_t normalIntStatusValue = base->NIS; - uint32_t errorIntStatusValue = base->EIS; - uint32_t fifoCadIntStatusValue = base->FIFOIS; - - allIntStatusValue |= ((uint64_t)SINC_FIND_STATUS_FIELD_VALUE(normalIntStatusValue, SINC_NORMAL_INT_NAME_COCIE) | - (uint64_t)SINC_FIND_STATUS_FIELD_VALUE(normalIntStatusValue, SINC_NORMAL_INT_NAME_CHFIE) | - (uint64_t)SINC_FIND_STATUS_FIELD_VALUE(normalIntStatusValue, SINC_NORMAL_INT_NAME_ZCDIE)); - - allIntStatusValue |= (((uint64_t)SINC_FIND_STATUS_FIELD_VALUE(errorIntStatusValue, SINC_ERROR_INT_NAME_SCDIE) | - (uint64_t)SINC_FIND_STATUS_FIELD_VALUE(errorIntStatusValue, SINC_ERROR_INT_NAME_WLMTIE) | - (uint64_t)SINC_FIND_STATUS_FIELD_VALUE(errorIntStatusValue, SINC_ERROR_INT_NAME_LLMTIE) | - (uint64_t)SINC_FIND_STATUS_FIELD_VALUE(errorIntStatusValue, SINC_ERROR_INT_NAME_HLMTIE)) - << 20ULL); - - allIntStatusValue |= (((uint64_t)SINC_FIND_STATUS_FIELD_VALUE(fifoCadIntStatusValue, SINC_FIFO_CAD_INT_FUNFIE) | - (uint64_t)SINC_FIND_STATUS_FIELD_VALUE(fifoCadIntStatusValue, SINC_FIFO_CAD_INT_FOVFIE) | - (uint64_t)SINC_FIND_STATUS_FIELD_VALUE(fifoCadIntStatusValue, SINC_FIFO_CAD_INT_CADIE) | - (uint64_t)SINC_FIND_STATUS_FIELD_VALUE(fifoCadIntStatusValue, SINC_FIFO_CAD_INT_SATIE)) - << 40ULL); - - return (uint64_t)allIntStatusValue; -} - -/*! - * @brief Clear selected mask of interrupt status flags. - * - * @param base SINC peripheral base address. - * @param statusMasks The mask of interrupt status flags to clear, should be the OR'ed - * value of @ref sinc_interrupt_status_t. - */ -static inline void SINC_ClearInterruptStatus(SINC_Type *base, uint64_t statusMasks) -{ - uint32_t normalIntMask; - uint32_t errorIntMask; - uint32_t fifoCadIntMask; - - /* - * #define SINC_DECODE_INTERRUPT(interruptMask) \ - * normalIntMask = ((uint32_t)(interruptMask) & (0xFFFFFUL)); \ - * errorIntMask = ((uint32_t)((interruptMask) >> 20ULL) & (0xFFFFFUL)); \ - * fifoCadIntMask = ((uint32_t)((interruptMask) >> 40ULL) & (0xFFFFFUL)) - */ - SINC_DECODE_INTERRUPT(statusMasks); - - base->EIS = (SINC_FIND_INT_FIELD_VALUE(errorIntMask, SINC_ERROR_INT_NAME_SCDIE) | - SINC_FIND_INT_FIELD_VALUE(errorIntMask, SINC_ERROR_INT_NAME_WLMTIE) | - SINC_FIND_INT_FIELD_VALUE(errorIntMask, SINC_ERROR_INT_NAME_LLMTIE) | - SINC_FIND_INT_FIELD_VALUE(errorIntMask, SINC_ERROR_INT_NAME_HLMTIE)); - - base->FIFOIS = (SINC_FIND_INT_FIELD_VALUE(fifoCadIntMask, SINC_FIFO_CAD_INT_FUNFIE) | - SINC_FIND_INT_FIELD_VALUE(fifoCadIntMask, SINC_FIFO_CAD_INT_FOVFIE) | - SINC_FIND_INT_FIELD_VALUE(fifoCadIntMask, SINC_FIFO_CAD_INT_CADIE) | - SINC_FIND_INT_FIELD_VALUE(fifoCadIntMask, SINC_FIFO_CAD_INT_SATIE)); - - base->NIS = (SINC_FIND_INT_FIELD_VALUE(normalIntMask, SINC_NORMAL_INT_NAME_COCIE) | - SINC_FIND_INT_FIELD_VALUE(normalIntMask, SINC_NORMAL_INT_NAME_CHFIE) | - SINC_FIND_INT_FIELD_VALUE(normalIntMask, SINC_NORMAL_INT_NAME_ZCDIE)); -} - -/*! @} */ - -#if defined(__cplusplus) -extern "C" { -#endif - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ -#endif /* FSL_SINC_H__ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartcard.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartcard.h deleted file mode 100644 index cacf963ff6e..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartcard.h +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2017 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_SMARTCARD_H_ -#define FSL_SMARTCARD_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup smartcard - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief Smart card driver version 2.3.0. - */ -#define FSL_SMARTCARD_DRIVER_VERSION (MAKE_VERSION(2, 3, 0)) -/*! @} */ - -/*! @brief Smart card global define which specify number of clock cycles until initial 'TS' character has to be received - */ -#define SMARTCARD_INIT_DELAY_CLOCK_CYCLES (42000u) - -/*! @brief Smart card global define which specify number of clock cycles during which ATR string has to be received */ -#define SMARTCARD_EMV_ATR_DURATION_ETU (20150u) - -/*! @brief Smart card specification initial TS character definition of direct convention */ -#define SMARTCARD_TS_DIRECT_CONVENTION (0x3Bu) - -/*! @brief Smart card specification initial TS character definition of inverse convention */ -#define SMARTCARD_TS_INVERSE_CONVENTION (0x3Fu) - -/*! @brief Smart card Error codes. */ -enum -{ - kStatus_SMARTCARD_Success = MAKE_STATUS(kStatusGroup_SMARTCARD, 0), /*!< Transfer ends successfully */ - kStatus_SMARTCARD_TxBusy = MAKE_STATUS(kStatusGroup_SMARTCARD, 1), /*!< Transmit in progress */ - kStatus_SMARTCARD_RxBusy = MAKE_STATUS(kStatusGroup_SMARTCARD, 2), /*!< Receiving in progress */ - kStatus_SMARTCARD_NoTransferInProgress = MAKE_STATUS(kStatusGroup_SMARTCARD, 3), /*!< No transfer in progress */ - kStatus_SMARTCARD_Timeout = MAKE_STATUS(kStatusGroup_SMARTCARD, 4), /*!< Transfer ends with time-out */ - kStatus_SMARTCARD_Initialized = - MAKE_STATUS(kStatusGroup_SMARTCARD, 5), /*!< Smart card driver is already initialized */ - kStatus_SMARTCARD_PhyInitialized = - MAKE_STATUS(kStatusGroup_SMARTCARD, 6), /*!< Smart card PHY drive is already initialized */ - kStatus_SMARTCARD_CardNotActivated = MAKE_STATUS(kStatusGroup_SMARTCARD, 7), /*!< Smart card is not activated */ - kStatus_SMARTCARD_InvalidInput = - MAKE_STATUS(kStatusGroup_SMARTCARD, 8), /*!< Function called with invalid input arguments */ - kStatus_SMARTCARD_OtherError = MAKE_STATUS(kStatusGroup_SMARTCARD, 9) /*!< Some other error occur */ -}; - -/*! @brief Control codes for the Smart card protocol timers and misc. */ -typedef enum _smartcard_control -{ - kSMARTCARD_EnableADT = 0x0u, - kSMARTCARD_DisableADT = 0x1u, - kSMARTCARD_EnableGTV = 0x2u, - kSMARTCARD_DisableGTV = 0x3u, - kSMARTCARD_ResetWWT = 0x4u, - kSMARTCARD_EnableWWT = 0x5u, - kSMARTCARD_DisableWWT = 0x6u, - kSMARTCARD_ResetCWT = 0x7u, - kSMARTCARD_EnableCWT = 0x8u, - kSMARTCARD_DisableCWT = 0x9u, - kSMARTCARD_ResetBWT = 0xAu, - kSMARTCARD_EnableBWT = 0xBu, - kSMARTCARD_DisableBWT = 0xCu, - kSMARTCARD_EnableInitDetect = 0xDu, - kSMARTCARD_EnableAnack = 0xEu, - kSMARTCARD_DisableAnack = 0xFu, - kSMARTCARD_ConfigureBaudrate = 0x10u, - kSMARTCARD_SetupATRMode = 0x11u, - kSMARTCARD_SetupT0Mode = 0x12u, - kSMARTCARD_SetupT1Mode = 0x13u, - kSMARTCARD_EnableReceiverMode = 0x14u, - kSMARTCARD_DisableReceiverMode = 0x15u, - kSMARTCARD_EnableTransmitterMode = 0x16u, - kSMARTCARD_DisableTransmitterMode = 0x17u, - kSMARTCARD_ResetWaitTimeMultiplier = 0x18u, -} smartcard_control_t; - -/*! @brief Defines Smart card interface voltage class values */ -typedef enum _smartcard_card_voltage_class -{ - kSMARTCARD_VoltageClassUnknown = 0x0u, - kSMARTCARD_VoltageClassA5_0V = 0x1u, - kSMARTCARD_VoltageClassB3_3V = 0x2u, - kSMARTCARD_VoltageClassC1_8V = 0x3u -} smartcard_card_voltage_class_t; - -/*! @brief Defines Smart card I/O transfer states */ -typedef enum _smartcard_transfer_state -{ - kSMARTCARD_IdleState = 0x0u, - kSMARTCARD_WaitingForTSState = 0x1u, - kSMARTCARD_InvalidTSDetecetedState = 0x2u, - kSMARTCARD_ReceivingState = 0x3u, - kSMARTCARD_TransmittingState = 0x4u, -} smartcard_transfer_state_t; - -/*! @brief Defines Smart card reset types */ -typedef enum _smartcard_reset_type -{ - kSMARTCARD_ColdReset = 0x0u, - kSMARTCARD_WarmReset = 0x1u, - kSMARTCARD_NoColdReset = 0x2u, - kSMARTCARD_NoWarmReset = 0x3u, -} smartcard_reset_type_t; - -/*! @brief Defines Smart card transport protocol types */ -typedef enum _smartcard_transport_type -{ - kSMARTCARD_T0Transport = 0x0u, - kSMARTCARD_T1Transport = 0x1u -} smartcard_transport_type_t; - -/*! @brief Defines Smart card data parity types */ -typedef enum _smartcard_parity_type -{ - kSMARTCARD_EvenParity = 0x0u, - kSMARTCARD_OddParity = 0x1u -} smartcard_parity_type_t; - -/*! @brief Defines data Convention format */ -typedef enum _smartcard_card_convention -{ - kSMARTCARD_DirectConvention = 0x0u, - kSMARTCARD_InverseConvention = 0x1u -} smartcard_card_convention_t; - -/*! @brief Defines Smart card interface IC control types */ -typedef enum _smartcard_interface_control -{ - kSMARTCARD_InterfaceSetVcc = 0x00u, - kSMARTCARD_InterfaceSetClockToResetDelay = 0x01u, - kSMARTCARD_InterfaceReadStatus = 0x02u -} smartcard_interface_control_t; - -/*! @brief Defines transfer direction.*/ -typedef enum _smartcard_direction -{ - kSMARTCARD_Receive = 0u, - kSMARTCARD_Transmit = 1u -} smartcard_direction_t; - -/*! @brief Smart card interface interrupt callback function type */ -typedef void (*smartcard_interface_callback_t)(void *smartcardContext, void *param); -/*! @brief Smart card transfer interrupt callback function type */ -typedef void (*smartcard_transfer_callback_t)(void *smartcardContext, void *param); - -/*! @brief Time Delay function used to passive waiting using RTOS [us] */ -typedef void (*smartcard_time_delay_t)(uint32_t us); - -/*! @brief Defines card-specific parameters for Smart card driver */ -typedef struct _smartcard_card_params -{ - /* ISO7816/EMV4.3 specification variables */ - uint16_t Fi; /*!< 4 bits Fi - clock rate conversion integer */ - uint8_t fMax; /*!< Maximum Smart card frequency in MHz */ - uint8_t WI; /*!< 8 bits WI - work wait time integer */ - uint8_t Di; /*!< 4 bits DI - baud rate divisor */ - uint8_t BWI; /*!< 4 bits BWI - block wait time integer */ - uint8_t CWI; /*!< 4 bits CWI - character wait time integer */ - uint8_t BGI; /*!< 4 bits BGI - block guard time integer */ - uint8_t GTN; /*!< 8 bits GTN - extended guard time integer */ - uint8_t IFSC; /*!< Indicates IFSC value of the card */ - uint8_t modeNegotiable; /*!< Indicates if the card acts in negotiable or a specific mode. */ - uint8_t currentD; /*!< 4 bits DI - current baud rate divisor*/ - /* Driver-specific variables */ - uint8_t status; /*!< Indicates smart card status */ - bool t0Indicated; /*!< Indicates ff T=0 indicated in TD1 byte */ - bool t1Indicated; /*!< Indicates if T=1 indicated in TD2 byte */ - bool atrComplete; /*!< Indicates whether the ATR received from the card was complete or not */ - bool atrValid; /*!< Indicates whether the ATR received from the card was valid or not */ - bool present; /*!< Indicates if a smart card is present */ - bool active; /*!< Indicates if the smart card is activated */ - bool faulty; /*!< Indicates whether smart card/interface is faulty */ - smartcard_card_convention_t convention; /*!< Card convention, kSMARTCARD_DirectConvention for direct convention, - kSMARTCARD_InverseConvention for inverse convention */ -} smartcard_card_params_t; - -/*! @brief Smart card defines the state of the EMV timers in the Smart card driver */ -typedef struct _smartcard_timers_state -{ - volatile bool adtExpired; /*!< Indicates whether ADT timer expired */ - volatile bool wwtExpired; /*!< Indicates whether WWT timer expired */ - volatile bool cwtExpired; /*!< Indicates whether CWT timer expired */ - volatile bool bwtExpired; /*!< Indicates whether BWT timer expired */ - volatile bool initCharTimerExpired; /*!< Indicates whether reception timer - for initialization character (TS) after the RST has expired */ -} smartcard_timers_state_t; - -/*! @brief Defines user specified configuration of Smart card interface */ -typedef struct _smartcard_interface_config -{ - uint32_t smartCardClock; /*!< Smart card interface clock [Hz] */ - uint32_t clockToResetDelay; /*!< Indicates clock to RST apply delay [smart card clock cycles] */ - uint8_t clockModule; /*!< Smart card clock module number */ - uint8_t clockModuleChannel; /*!< Smart card clock module channel number */ - uint8_t clockModuleSourceClock; /*!< Smart card clock module source clock [e.g., BusClk] */ - smartcard_card_voltage_class_t vcc; /*!< Smart card voltage class */ - uint8_t controlPort; /*!< Smart card PHY control port instance */ - uint8_t controlPin; /*!< Smart card PHY control pin instance */ - uint8_t irqPort; /*!< Smart card PHY Interrupt port instance */ - uint8_t irqPin; /*!< Smart card PHY Interrupt pin instance */ - uint8_t resetPort; /*!< Smart card reset port instance */ - uint8_t resetPin; /*!< Smart card reset pin instance */ - uint8_t vsel0Port; /*!< Smart card PHY Vsel0 control port instance */ - uint8_t vsel0Pin; /*!< Smart card PHY Vsel0 control pin instance */ - uint8_t vsel1Port; /*!< Smart card PHY Vsel1 control port instance */ - uint8_t vsel1Pin; /*!< Smart card PHY Vsel1 control pin instance */ - uint8_t dataPort; /*!< Smart card PHY data port instance */ - uint8_t dataPin; /*!< Smart card PHY data pin instance */ - uint8_t dataPinMux; /*!< Smart card PHY data pin mux option */ - uint8_t tsTimerId; /*!< Numerical identifier of the External HW timer for Initial character detection */ -} smartcard_interface_config_t; - -/*! @brief Defines user transfer structure used to initialize transfer */ -typedef struct _smartcard_xfer -{ - smartcard_direction_t direction; /*!< Direction of communication. (RX/TX) */ - uint8_t *buff; /*!< The buffer of data. */ - size_t size; /*!< The number of transferred units. */ -} smartcard_xfer_t; - -/*! - * @brief Runtime state of the Smart card driver. - */ -typedef struct _smartcard_context -{ - /* Xfer part */ - void *base; /*!< Smart card module base address */ - smartcard_direction_t direction; /*!< Direction of communication. (RX/TX) */ - uint8_t *xBuff; /*!< The buffer of data being transferred.*/ - volatile size_t xSize; /*!< The number of bytes to be transferred. */ - volatile bool xIsBusy; /*!< True if there is an active transfer. */ - uint8_t txFifoEntryCount; /*!< Number of data word entries in transmit FIFO. */ - uint8_t rxFifoThreshold; /*!< The max value of the receiver FIFO threshold. */ - /* Smart card Interface part */ - smartcard_interface_callback_t interfaceCallback; /*!< Callback to invoke after interface IC raised interrupt.*/ - smartcard_transfer_callback_t transferCallback; /*!< Callback to invoke after transfer event occur.*/ - void *interfaceCallbackParam; /*!< Interface callback parameter pointer.*/ - void *transferCallbackParam; /*!< Transfer callback parameter pointer.*/ - smartcard_time_delay_t timeDelay; /*!< Function which handles time delay defined by user or RTOS. */ - smartcard_reset_type_t resetType; /*!< Indicates whether a Cold reset or Warm reset was requested. */ - smartcard_transport_type_t tType; /*!< Indicates current transfer protocol (T0 or T1) */ - /* Smart card State part */ - volatile smartcard_transfer_state_t transferState; /*!< Indicates the current transfer state */ - smartcard_timers_state_t timersState; /*!< Indicates the state of different protocol timers used in driver */ - smartcard_card_params_t - cardParams; /*!< Smart card parameters(ATR and current) and interface slots states(ATR and current) */ - uint8_t IFSD; /*!< Indicates the terminal IFSD */ - smartcard_parity_type_t parity; /*!< Indicates current parity even/odd */ - volatile bool rxtCrossed; /*!< Indicates whether RXT thresholds has been crossed */ - volatile bool txtCrossed; /*!< Indicates whether TXT thresholds has been crossed */ - volatile bool wtxRequested; /*!< Indicates whether WTX has been requested or not*/ - volatile bool parityError; /*!< Indicates whether a parity error has been detected */ - uint8_t statusBytes[2]; /*!< Used to store Status bytes SW1, SW2 of the last executed card command response */ - /* Configuration part */ - smartcard_interface_config_t interfaceConfig; /*!< Smart card interface configuration structure */ - bool abortTransfer; /*!< Used to abort transfer. */ -} smartcard_context_t; - -/*! @}*/ -#endif /* FSL_SMARTCARD_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartcard_emvsim.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartcard_emvsim.c deleted file mode 100644 index 61bca20b492..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartcard_emvsim.c +++ /dev/null @@ -1,1143 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2019 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_smartcard_emvsim.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.smartcard_emvsim" -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to emvsim bases for each instance. */ -static EMVSIM_Type *const s_emvsimBases[] = EMVSIM_BASE_PTRS; - -/*! @brief Pointers to emvsim IRQ number for each instance. */ -static const IRQn_Type s_emvsimIRQ[] = EMVSIM_IRQS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to emvsim clocks for each instance. */ -static const clock_ip_name_t s_emvsimClock[] = EMVSIM_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/* #define CARDSIM_EXTRADELAY_USED */ - -/******************************************************************************* - * Private Functions - ******************************************************************************/ -static void smartcard_emvsim_CompleteSendData(EMVSIM_Type *base, smartcard_context_t *context); -static void smartcard_emvsim_StartSendData(EMVSIM_Type *base, smartcard_context_t *context); -static void smartcard_emvsim_CompleteReceiveData(EMVSIM_Type *base, smartcard_context_t *context); -static void smartcard_emvsim_StartReceiveData(EMVSIM_Type *base, smartcard_context_t *context); -static void smartcard_emvsim_SetTransferType(EMVSIM_Type *base, - smartcard_context_t *context, - smartcard_control_t control); -static uint32_t smartcard_emvsim_GetInstance(EMVSIM_Type *base); - -/******************************************************************************* - * Code - ******************************************************************************/ -/*! - * @brief Get the UART instance from peripheral base address. - * - * @param base UART peripheral base address. - * @return UART instance. - */ -static uint32_t smartcard_emvsim_GetInstance(EMVSIM_Type *base) -{ - uint8_t instance = 0; - uint32_t emvsimArrayCount = (sizeof(s_emvsimBases) / sizeof(s_emvsimBases[0])); - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < emvsimArrayCount; instance++) - { - if (s_emvsimBases[instance] == base) - { - break; - } - } - - assert(instance < emvsimArrayCount); - - return instance; -} -/*! - * @brief Finish up a transmit by completing the process of sending data and disabling the interrupt. - * - * @param base The EMVSIM peripheral base address. - * @param context A pointer to a SMARTCARD driver context structure. - */ -static void smartcard_emvsim_CompleteSendData(EMVSIM_Type *base, smartcard_context_t *context) -{ - assert((NULL != context)); - - /* Disable ETC and TDT interrupt */ - base->INT_MASK |= (EMVSIM_INT_MASK_ETC_IM_MASK | EMVSIM_INT_MASK_TDT_IM_MASK); - - /* Disable transmitter */ - base->CTRL &= ~EMVSIM_CTRL_XMT_EN_MASK; - /* Clear receive status flag */ - base->RX_STATUS = EMVSIM_RX_STATUS_RX_DATA_MASK; - /* Enable Receiver */ - base->CTRL |= EMVSIM_CTRL_RCV_EN_MASK; - /* Update the information of the module driver context */ - context->xIsBusy = false; - context->transferState = kSMARTCARD_IdleState; - /* Clear txSize to avoid any spurious transmit from ISR */ - context->xSize = 0u; - /* Invoke user call-back */ - if (NULL != context->transferCallback) - { - context->transferCallback(context, context->transferCallbackParam); - } -} - -/*! - * @brief Finish up a receive by completing the process of receiving data and disabling the interrupt. - * - * @param base The EMVSIM peripheral base address. - * @param context A pointer to a SMARTCARD driver context structure. - */ -static void smartcard_emvsim_CompleteReceiveData(EMVSIM_Type *base, smartcard_context_t *context) -{ - assert((NULL != context)); - - /* Disable RDT and RX_DATA interrupt */ - base->INT_MASK |= (EMVSIM_INT_MASK_RDT_IM_MASK | EMVSIM_INT_MASK_RX_DATA_IM_MASK); - - /* Read data from fifo */ - while (((base->RX_STATUS & EMVSIM_RX_STATUS_RX_CNT_MASK) != 0u) && ((context->xSize) > 0u)) - { - /* Get data and put into receive buffer */ - *context->xBuff = (uint8_t)(base->RX_BUF); - ++context->xBuff; - --context->xSize; - } - - /* Update the information of the module driver context */ - context->xIsBusy = false; - /* Invoke user call-back */ - if (NULL != context->transferCallback) - { - context->transferCallback(context, context->transferCallbackParam); - } -} - -/*! - * @brief Initiate (start) a transmit by beginning the process of sending data and enabling the interrupt. - * - * @param base The EMVSIM peripheral base address. - * @param context A pointer to a SMARTCARD driver context structure. - */ -static void smartcard_emvsim_StartSendData(EMVSIM_Type *base, smartcard_context_t *context) -{ - assert((NULL != context)); - - uint32_t delay = 0u; - uint32_t control = 0u; - - /* Block guard time */ - /* 22 etus (16 Receiver Clocks == 1 etu) */ - delay = 22u * 16u; - /* Disable all functionality like protocol timers, NACK generation */ - control = base->CTRL; - base->CTRL = 0u; - base->TX_GETU = context->cardParams.GTN; - /* Clear Global counter time-out flag */ - base->TX_STATUS = EMVSIM_TX_STATUS_GPCNT1_TO_MASK; - /* Disable counter interrupt */ - base->INT_MASK |= EMVSIM_INT_MASK_GPCNT1_IM_MASK; - /* Set counter value */ - base->GPCNT1_VAL = delay; - /* Select the clock for GPCNT */ - base->CLKCFG = - (base->CLKCFG & ~EMVSIM_CLKCFG_GPCNT1_CLK_SEL_MASK) | EMVSIM_CLKCFG_GPCNT1_CLK_SEL(kEMVSIM_GPCRxClock); - /* Trigger the counter */ - base->CTRL |= EMVSIM_CTRL_RCV_EN_MASK; - /* Wait until counter overflow event occur */ - while ((base->TX_STATUS & EMVSIM_TX_STATUS_GPCNT1_TO_MASK) == 0u) - { - } - /* Clear status flag and disable GPCNT1 clock */ - base->TX_STATUS = EMVSIM_TX_STATUS_GPCNT1_TO_MASK; - base->CLKCFG &= ~EMVSIM_CLKCFG_GPCNT1_CLK_SEL_MASK; - /* Restore Control register */ - base->CTRL = control & ~(EMVSIM_CTRL_XMT_EN_MASK | EMVSIM_CTRL_RCV_EN_MASK); - /* Update transferState */ - context->transferState = kSMARTCARD_TransmittingState; - context->xIsBusy = true; - - /* Flush transmitter */ - base->CTRL |= EMVSIM_CTRL_FLSH_TX_MASK; - - /* Enable transmitter */ - base->CTRL |= EMVSIM_CTRL_XMT_EN_MASK; - - /* Set transmitter data threshold value to 0 - TDTF is set when the fifo is empty */ - base->TX_THD &= ~EMVSIM_TX_THD_TDT_MASK; - - /* Enable TDT interrupt */ - base->INT_MASK &= ~EMVSIM_INT_MASK_TDT_IM_MASK; -} - -/*! - * @brief Initiate (start) a receive by beginning the process of receiving data and enabling the interrupt. - * - * @param base The EMVSIM peripheral base address. - * @param context A pointer to a SMARTCARD driver context structure. - */ -static void smartcard_emvsim_StartReceiveData(EMVSIM_Type *base, smartcard_context_t *context) -{ - assert((NULL != context)); - - /* Initialize the module driver context structure to indicate transfer in progress */ - context->xIsBusy = true; - /* Enable BWT Timer interrupt to occur */ - base->INT_MASK &= ~EMVSIM_INT_MASK_BWT_ERR_IM_MASK; - /* Disable transmitter */ - base->CTRL &= ~EMVSIM_CTRL_XMT_EN_MASK; - /* Enable receiver and switch to receive direction */ - base->CTRL |= EMVSIM_CTRL_RCV_EN_MASK; - - /* Set rx threshold value - number of bytes that must exist in the Receive FIFO to trigger the receive data - * threshold interrupt flag (RDTF).*/ - if (context->xSize < context->rxFifoThreshold) - { - uint32_t rx_thd; - rx_thd = (base->RX_THD & ~EMVSIM_RX_THD_RDT_MASK); - rx_thd |= context->xSize; - base->RX_THD = rx_thd; - } - else - { - base->RX_THD = ((base->RX_THD & ~EMVSIM_RX_THD_RDT_MASK) | context->rxFifoThreshold); - } - - /* Enable RDT interrupt - count of bytes in rx fifo is equal or greater than threshold RX_THD[RDT] */ - base->INT_MASK &= ~EMVSIM_INT_MASK_RDT_IM_MASK; - - if (context->tType == kSMARTCARD_T1Transport) - { - /* Enable interrupt when new byte is received - in T=1 is necessary to disable BWT interrupt and enable CWT - * interrupt after receiving the first byte */ - base->INT_MASK &= ~EMVSIM_INT_MASK_RX_DATA_IM_MASK; - } -} - -/*! - * @brief Sets up the EMVSIM hardware for T=0 or T=1 protocol data exchange and initialize timer values. - * - * @param base The EMVSIM peripheral base address. - * @param context A pointer to a SMARTCARD driver context structure. - */ -static void smartcard_emvsim_SetTransferType(EMVSIM_Type *base, - smartcard_context_t *context, - smartcard_control_t control) -{ - assert((NULL != context)); - assert((control == kSMARTCARD_SetupATRMode) || (control == kSMARTCARD_SetupT0Mode) || - (control == kSMARTCARD_SetupT1Mode)); - - uint16_t temp16 = 0u; - uint32_t bwiVal = 0u; - uint8_t tdt = 0u; - - if (control == kSMARTCARD_SetupATRMode) - { - /* Disable all functionality at first */ - base->CTRL &= ~(EMVSIM_CTRL_RCVR_11_MASK | EMVSIM_CTRL_XMT_CRC_LRC_MASK | EMVSIM_CTRL_LRC_EN_MASK | - EMVSIM_CTRL_ANACK_MASK | EMVSIM_CTRL_ONACK_MASK | EMVSIM_CTRL_RCV_EN_MASK); - /* Set default values as per EMV specification */ - context->cardParams.Fi = 372u; - context->cardParams.Di = 1u; - context->cardParams.currentD = 1u; - context->cardParams.WI = 0x0Au; - context->cardParams.GTN = 0x00u; - /* Set default baudrate/ETU time based on EMV parameters and card clock */ - base->DIVISOR = (((uint32_t)context->cardParams.Fi / context->cardParams.currentD) & 0x1FFu); - /* EMV expectation: WWT = (960 x D x WI) + (D x 480) - * EMVSIM formula: BWT_VAL[15:0] = CWT_VAL[15:0] */ - temp16 = (960u * context->cardParams.currentD * context->cardParams.WI) + - (context->cardParams.currentD * 480u) + SMARTCARD_WWT_ADJUSTMENT; - base->CWT_VAL = temp16; - base->BWT_VAL = temp16; - /* Set Extended Guard Timer value - * EMV expectation: GT = GTN not equal to 255 -> 12 + GTN = GTN equal to 255 -> 12 - * EMVSIM formula: same as above */ - base->TX_GETU = context->cardParams.GTN; - /* Setting Rx threshold so that an interrupt is generated when a NACK is - sent either due to parity error or wrong INIT char*/ - base->RX_THD = EMVSIM_RX_THD_RDT(1); - /* Setting up Tx NACK threshold */ - tdt = (uint8_t)(((base->PARAM & EMVSIM_PARAM_TX_FIFO_DEPTH_MASK) >> EMVSIM_PARAM_TX_FIFO_DEPTH_SHIFT) - 1u); - base->TX_THD = (EMVSIM_TX_THD_TNCK_THD(SMARTCARD_EMV_TX_NACK_THRESHOLD) | EMVSIM_TX_THD_TDT(tdt)); - /* Clear all pending interrupts */ - base->RX_STATUS = 0xFFFFFFFFu; - /* Enable Tx NACK threshold interrupt to occur */ - base->INT_MASK &= ~EMVSIM_INT_MASK_TNACK_IM_MASK; - /* Set transport type to T=0 in SMARTCARD context structure */ - context->tType = kSMARTCARD_T0Transport; - } - else if (control == kSMARTCARD_SetupT0Mode) - { - /* Disable receiver at first if it's not, Disable T=0 mode counters 1st, - * Setup for single wire ISO7816 mode (setup 12 etu mode). - * Set transport protocol type to T=0, Disable initial character detection.*/ - base->CTRL &= - ~(EMVSIM_CTRL_RCV_EN_MASK | EMVSIM_CTRL_CWT_EN_MASK | EMVSIM_CTRL_BWT_EN_MASK | EMVSIM_CTRL_RCVR_11_MASK | - EMVSIM_CTRL_XMT_CRC_LRC_MASK | EMVSIM_CTRL_LRC_EN_MASK | EMVSIM_CTRL_ICM_MASK); - /* EMV expectation: WWT = (960 x D x WI) + (D x 480) - * EMVSIM formula: BWT_VAL[15:0] = CWT_VAL[15:0] */ - temp16 = (960u * context->cardParams.currentD * context->cardParams.WI) + - (context->cardParams.currentD * 480u) + SMARTCARD_WWT_ADJUSTMENT; - base->CWT_VAL = temp16; - base->BWT_VAL = temp16; - /* Set Extended Guard Timer value - * EMV expectation: GT = GTN not equal to 255 -> 12 + GTN = GTN equal to 255 -> 12 - * EMVSIM formula: same as above for range [0:254] - * Fix for EMV. If TX_GETU == 0 in T0 mode, 3 stop bits are inserted. */ - context->cardParams.GTN = (context->cardParams.GTN == 0xFFu) ? 0x00u : context->cardParams.GTN; - base->TX_GETU = context->cardParams.GTN; - /* Setting Rx threshold so that an interrupt is generated when a NACK is - sent either due to parity error or wrong INIT char */ - base->RX_THD = (EMVSIM_RX_THD_RNCK_THD(SMARTCARD_EMV_RX_NACK_THRESHOLD) | EMVSIM_RX_THD_RDT(1)); - /* Setting up Tx NACK threshold */ - tdt = (uint8_t)(((base->PARAM & EMVSIM_PARAM_TX_FIFO_DEPTH_MASK) >> EMVSIM_PARAM_TX_FIFO_DEPTH_SHIFT) - 1u); - base->TX_THD = (EMVSIM_TX_THD_TNCK_THD(SMARTCARD_EMV_TX_NACK_THRESHOLD) | EMVSIM_TX_THD_TDT(tdt)); - /* Enable Tx NACK threshold interrupt to occur */ - base->INT_MASK &= ~EMVSIM_INT_MASK_TNACK_IM_MASK; - /* Enable T=0 mode counters, Enable NACK on error interrupt and NACK on overflow interrupt */ - base->CTRL |= - (EMVSIM_CTRL_CWT_EN_MASK | EMVSIM_CTRL_BWT_EN_MASK | EMVSIM_CTRL_ANACK_MASK | EMVSIM_CTRL_ONACK_MASK); - /* Set transport type to T=0 in SMARTCARD context structure */ - context->tType = kSMARTCARD_T0Transport; - } - else - { /* Disable T=1 mode counters 1st, Disable NACK on error interrupt, Disable NACK on overflow interrupt */ - base->CTRL &= ~(EMVSIM_CTRL_CWT_EN_MASK | EMVSIM_CTRL_BWT_EN_MASK | EMVSIM_CTRL_ANACK_MASK | - EMVSIM_CTRL_ONACK_MASK | EMVSIM_CTRL_XMT_CRC_LRC_MASK | EMVSIM_CTRL_LRC_EN_MASK); - /* Calculate and set Block Wait Timer (BWT) value - * EMV expectation: BWT = 11 + (2^BWI x 960 x D) + (D x 960) = 11 + (2^BWI + 1) x 960 x D - * EMVSIM formula: BWT = Same */ - bwiVal = 11u + ((((uint32_t)1u << context->cardParams.BWI) + 1u) * 960u * context->cardParams.currentD); -#ifdef CARDSIM_EXTRADELAY_USED - base->BWT_VAL = bwiVal + 100u; -#else - base->BWT_VAL = bwiVal; -#endif - /* Calculate and set Character Wait Timer (CWT) value - * EMV expectation: CWT = ((2^CWI + 11) + 4) - * EMVSIM formula: CWT = Same */ - if (context->cardParams.currentD == 1u) - { -#ifdef CARDSIM_EXTRADELAY_USED - temp16 = ((uint16_t)1u << context->cardParams.CWI) + 16u; -#else - temp16 = ((uint16_t)1u << context->cardParams.CWI) + 15u; -#endif - } - else - { -#ifdef CARDSIM_EXTRADELAY_USED - temp16 = ((uint16_t)1u << context->cardParams.CWI) + 20u + SMARTCARD_CWT_ADJUSTMENT; -#else - temp16 = ((uint16_t)1u << context->cardParams.CWI) + 15u + SMARTCARD_CWT_ADJUSTMENT; -#endif - } - /* EMV = 15, ISO = 11, - * EMV expectation: BGT = 22 - * EMVSIM formula: BGT = Same */ - base->CWT_VAL = temp16; - context->cardParams.BGI = 22u; - base->BGT_VAL = context->cardParams.BGI; - /* Set Extended Guard Timer value - * EMV expectation: GT = GTN not equal to 255 -> 12 + GTN = GTN equal to 255 -> 11 - * EMVSIM formula: same as above */ - base->TX_GETU = context->cardParams.GTN; - /* Setup for single wire ISO7816 mode, - * Set transport protocol type to T=1, Enable T=0 mode counters */ - base->CTRL |= (EMVSIM_CTRL_RCVR_11_MASK | EMVSIM_CTRL_CWT_EN_MASK | EMVSIM_CTRL_BWT_EN_MASK); - /* Setting Rx threshold */ - base->RX_THD = (EMVSIM_RX_THD_RNCK_THD(SMARTCARD_EMV_RX_NACK_THRESHOLD) | EMVSIM_RX_THD_RDT(1)); - /* Setting up Tx threshold */ - tdt = (uint8_t)(((base->PARAM & EMVSIM_PARAM_TX_FIFO_DEPTH_MASK) >> EMVSIM_PARAM_TX_FIFO_DEPTH_SHIFT) - 1u); - base->TX_THD = (EMVSIM_TX_THD_TDT(tdt) | EMVSIM_TX_THD_TNCK_THD(SMARTCARD_EMV_TX_NACK_THRESHOLD)); - /* Set transport type to T=1 in SMARTCARD context structure */ - context->tType = kSMARTCARD_T1Transport; - } -} - -/*! - * brief Fills in the smartcard_card_params structure with default values according to the EMV 4.3 specification. - * - * param cardParams The configuration structure of type smartcard_interface_config_t. - * Function fill in members: - * Fi = 372; - * Di = 1; - * currentD = 1; - * WI = 0x0A; - * GTN = 0x00; - * with default values. - */ -void SMARTCARD_EMVSIM_GetDefaultConfig(smartcard_card_params_t *cardParams) -{ - /* Initializes the configure structure to zero. */ - (void)memset(cardParams, 0, sizeof(*cardParams)); - - /* EMV default values */ - cardParams->Fi = 372u; - cardParams->Di = 1u; - cardParams->currentD = 1u; - cardParams->WI = 0x0Au; - cardParams->GTN = 0x00u; -} - -/*! - * brief Initializes an EMVSIM peripheral for the Smart card/ISO-7816 operation. - * - * This function un-gates the EMVSIM clock, initializes the module to EMV default settings, - * configures the IRQ, enables the module-level interrupt to the core and, initializes the driver context. - * - * param base The EMVSIM peripheral base address. - * param context A pointer to the smart card driver context structure. - * param srcClock_Hz Smart card clock generation module source clock. - * - * return An error code or kStatus_SMARTCARD_Success. - */ -status_t SMARTCARD_EMVSIM_Init(EMVSIM_Type *base, smartcard_context_t *context, uint32_t srcClock_Hz) -{ - assert((NULL != base)); - - if ((NULL == context) || (srcClock_Hz == 0u)) - { - return kStatus_SMARTCARD_InvalidInput; - } - - uint32_t instance = smartcard_emvsim_GetInstance(base); -/* Set source clock for EMVSIM MCGPLLCLK */ -#if (defined(FSL_FEATURE_SOC_MCG_COUNT) && FSL_FEATURE_SOC_MCG_COUNT) - CLOCK_SetEmvsimClock(1u); -#endif -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable emvsim clock */ - CLOCK_EnableClock(s_emvsimClock[instance]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - context->base = base; - /* Initialize EMVSIM to a known context. */ - base->CLKCFG = 0u; - base->DIVISOR = 372u; - base->CTRL = 0x300u; - base->INT_MASK = 0x7FFFu; - base->RX_THD = 1u; - base->TX_THD = 0u; - base->PCSR = 0x1000000u; - base->TX_GETU = 0u; - base->CWT_VAL = 0xFFFFu; - base->BWT_VAL = 0xFFFFFFFFu; - base->BGT_VAL = 0u; - base->GPCNT0_VAL = 0xFFFFu; - base->GPCNT1_VAL = 0xFFFFu; - /* Initialize EMVSIM module for SMARTCARD mode of default operation */ - smartcard_emvsim_SetTransferType(base, context, kSMARTCARD_SetupATRMode); - /* Store information about tx fifo depth */ - context->txFifoEntryCount = - (uint8_t)((base->PARAM & EMVSIM_PARAM_TX_FIFO_DEPTH_MASK) >> EMVSIM_PARAM_TX_FIFO_DEPTH_SHIFT); - /* Compute max value of rx fifo threshold */ - context->rxFifoThreshold = - (uint8_t)((base->PARAM & EMVSIM_PARAM_RX_FIFO_DEPTH_MASK) >> EMVSIM_PARAM_RX_FIFO_DEPTH_SHIFT); - if ((EMVSIM_RX_THD_RDT_MASK >> EMVSIM_RX_THD_RDT_SHIFT) < context->rxFifoThreshold) - { - context->rxFifoThreshold = (EMVSIM_RX_THD_RDT_MASK >> EMVSIM_RX_THD_RDT_SHIFT); - } -/* Enable EMVSIM interrupt on NVIC level. */ -#if defined(FSL_FEATURE_SOC_INTMUX_COUNT) && FSL_FEATURE_SOC_INTMUX_COUNT - if ((uint32_t)s_emvsimIRQ[instance] < (uint32_t)FSL_FEATURE_INTMUX_IRQ_START_INDEX) - { - NVIC_EnableIRQ(s_emvsimIRQ[instance]); - } -#else - NVIC_EnableIRQ(s_emvsimIRQ[instance]); -#endif - /* Finally, disable the EMVSIM receiver and transmitter */ - base->CTRL &= ~EMVSIM_CTRL_XMT_EN_MASK & ~EMVSIM_CTRL_RCV_EN_MASK; - - return kStatus_SMARTCARD_Success; -} - -/*! - * brief This function disables the EMVSIM interrupts, disables the transmitter and receiver, - * flushes the FIFOs, and gates EMVSIM clock in SIM. - * - * param base The EMVSIM module base address. - */ -void SMARTCARD_EMVSIM_Deinit(EMVSIM_Type *base) -{ - uint32_t instance = 0u; - /* In case there is still data in the TX FIFO or shift register that is - * being transmitted wait till transmit is complete. - * Wait until the data is completely shifted out of shift register */ - if ((base->TX_STATUS & EMVSIM_TX_STATUS_TX_CNT_MASK) != 0u) - { - while ((base->TX_STATUS & EMVSIM_TX_STATUS_ETCF_MASK) == 0u) - { - } - } - instance = smartcard_emvsim_GetInstance(base); - /* Disable TX and RX */ - base->CTRL &= ~EMVSIM_CTRL_XMT_EN_MASK & ~EMVSIM_CTRL_RCV_EN_MASK; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate EMVSIM module clock */ - CLOCK_DisableClock(s_emvsimClock[instance]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -/* Disable emvsim interrupt in NVIC */ -#if defined(FSL_FEATURE_SOC_INTMUX_COUNT) && FSL_FEATURE_SOC_INTMUX_COUNT - if ((uint32_t)s_emvsimIRQ[instance] < (uint32_t)FSL_FEATURE_INTMUX_IRQ_START_INDEX) - { - NVIC_DisableIRQ(s_emvsimIRQ[instance]); - } -#else - NVIC_DisableIRQ(s_emvsimIRQ[instance]); -#endif -} - -/*! - * brief Transfer data using interrupts. - * - * A non-blocking (also known as asynchronous) function means that the function returns - * immediately after initiating the transfer function. The application has to get the - * transfer status to see when the transfer is complete. In other words, after calling the non-blocking - * (asynchronous) transfer function, the application must get the transfer status to check if the transmit - * is completed or not. - * - * param base The EMVSIM peripheral base address. - * param context A pointer to a smart card driver context structure. - * param xfer A pointer to the smart card transfer structure where the linked buffers and sizes are stored. - * - * return An error code or kStatus_SMARTCARD_Success. - */ -status_t SMARTCARD_EMVSIM_TransferNonBlocking(EMVSIM_Type *base, smartcard_context_t *context, smartcard_xfer_t *xfer) -{ - if ((NULL == context) || (NULL == xfer) || (xfer->buff == NULL)) - { - return kStatus_SMARTCARD_InvalidInput; - } - - /* Check input parameters */ - if ((0u == xfer->size)) - { - return kStatus_SMARTCARD_Success; - } - /* Check if some transfer is in progress */ - if (0 != SMARTCARD_EMVSIM_GetTransferRemainingBytes(base, context)) - { - if (kSMARTCARD_Receive == context->direction) - { - return kStatus_SMARTCARD_RxBusy; - } - else - { - return kStatus_SMARTCARD_TxBusy; - } - } - /* Initialize error check flags */ - context->rxtCrossed = false; - context->txtCrossed = false; - context->parityError = false; - /* Initialize SMARTCARD context structure to start transfer */ - context->xBuff = xfer->buff; - context->xSize = xfer->size; - - if (kSMARTCARD_Receive == xfer->direction) - { - context->direction = xfer->direction; - context->transferState = kSMARTCARD_ReceivingState; - /* Start transfer */ - smartcard_emvsim_StartReceiveData(base, context); - } - else if (kSMARTCARD_Transmit == xfer->direction) - { - context->direction = xfer->direction; - context->transferState = kSMARTCARD_TransmittingState; - /* Start transfer */ - smartcard_emvsim_StartSendData(base, context); - } - else - { - return kStatus_SMARTCARD_InvalidInput; - } - - return kStatus_SMARTCARD_Success; -} - -/*! - * brief Returns whether the previous EMVSIM transfer has finished. - * - * When performing an async transfer, call this function to ascertain the context of the - * current transfer: in progress (or busy) or complete (success). If the - * transfer is still in progress, the user can obtain the number of words that have not been - * transferred. - * - * param base The EMVSIM module base address. - * param context A pointer to a smart card driver context structure. - * - * return The number of bytes not transferred. - */ -int32_t SMARTCARD_EMVSIM_GetTransferRemainingBytes(EMVSIM_Type *base, smartcard_context_t *context) -{ - if ((NULL == context)) - { - return -1; - } - if (context->xIsBusy) - { - if (context->direction == kSMARTCARD_Transmit) - { - /* Count of bytes in buffer + data in fifo */ - uint32_t count; - count = context->xSize; - count += ((base->TX_STATUS & EMVSIM_TX_STATUS_TX_CNT_MASK) >> EMVSIM_TX_STATUS_TX_CNT_SHIFT); - return (int32_t)count; - } - return (int32_t)context->xSize; - } - - return 0; -} - -/*! - * brief Terminates an asynchronous EMVSIM transfer early. - * - * During an async EMVSIM transfer, the user can terminate the transfer early - * if the transfer is still in progress. - * - * param base The EMVSIM peripheral address. - * param context A pointer to a smart card driver context structure. - * retval kStatus_SMARTCARD_Success The transmit abort was successful. - * retval kStatus_SMARTCARD_NoTransmitInProgress No transmission is currently in progress. - */ -status_t SMARTCARD_EMVSIM_AbortTransfer(EMVSIM_Type *base, smartcard_context_t *context) -{ - if ((NULL == context)) - { - return kStatus_SMARTCARD_InvalidInput; - } - - context->abortTransfer = true; - - /* Check if a transfer is running. */ - if ((!context->xIsBusy)) - { - return kStatus_SMARTCARD_NoTransferInProgress; - } - /* Call transfer complete to abort transfer */ - if (kSMARTCARD_Receive == context->direction) - { /* Stop the running transfer. */ - smartcard_emvsim_CompleteReceiveData(base, context); - } - else if (kSMARTCARD_Transmit == context->direction) - { /* Stop the running transfer. */ - smartcard_emvsim_CompleteSendData(base, context); - } - else - { - return kStatus_SMARTCARD_InvalidInput; - } - - return kStatus_SMARTCARD_Success; -} - -/*! - * brief Handles EMVSIM module interrupts. - * - * param base The EMVSIM peripheral base address. - * param context A pointer to a smart card driver context structure. - */ -void SMARTCARD_EMVSIM_IRQHandler(EMVSIM_Type *base, smartcard_context_t *context) -{ - if (NULL == context) - { - return; - } - - /* Check card insertion/removal interrupt occurs, only EMVSIM DIRECT interface driver using enables this interrupt - * to occur */ - if (((base->PCSR & EMVSIM_PCSR_SPDIM_MASK) == 0u) && ((base->PCSR & EMVSIM_PCSR_SPDIF_MASK) != 0u)) - { - /* Clear card presence interrupt status */ - base->PCSR |= EMVSIM_PCSR_SPDIF_MASK; - /* Set PD signal edge behaviour */ - if (((emvsim_presence_detect_edge_t)(uint32_t)((base->PCSR & EMVSIM_PCSR_SPDES_MASK) >> - EMVSIM_PCSR_SPDES_SHIFT) == kEMVSIM_DetectOnFallingEdge) && - ((emvsim_presence_detect_status_t)(uint32_t)((base->PCSR & EMVSIM_PCSR_SPDP_MASK) >> - EMVSIM_PCSR_SPDP_SHIFT) == kEMVSIM_DetectPinIsLow)) - { /* Set rising edge interrupt */ - base->PCSR |= EMVSIM_PCSR_SPDES_MASK; - } - if (((emvsim_presence_detect_edge_t)(uint32_t)((base->PCSR & EMVSIM_PCSR_SPDES_MASK) >> - EMVSIM_PCSR_SPDES_SHIFT) == kEMVSIM_DetectOnRisingEdge) && - ((emvsim_presence_detect_status_t)(uint32_t)((base->PCSR & EMVSIM_PCSR_SPDP_MASK) >> - EMVSIM_PCSR_SPDP_SHIFT) == kEMVSIM_DetectPinIsHigh)) - { /* Set falling edge interrupt */ - base->PCSR &= ~EMVSIM_PCSR_SPDES_MASK; - } - /* Card presence(insertion)/removal detected */ - /* Invoke callback if there is one */ - if (NULL != context->interfaceCallback) - { - context->interfaceCallback(context, context->interfaceCallbackParam); - } - return; - } - /* Check if timer for initial character (TS) detection has expired */ - if (((base->INT_MASK & EMVSIM_INT_MASK_GPCNT0_IM_MASK) >> EMVSIM_INT_MASK_GPCNT0_IM_SHIFT == 0u) && - ((base->TX_STATUS & EMVSIM_TX_STATUS_GPCNT0_TO_MASK) != 0u)) - { - /* Disable TS and ADT timers by clearing source clock to 0 */ - base->CLKCFG &= ~(EMVSIM_CLKCFG_GPCNT0_CLK_SEL_MASK | EMVSIM_CLKCFG_GPCNT1_CLK_SEL_MASK); - context->timersState.initCharTimerExpired = true; - /* Disable and clear GPCNT interrupt */ - base->INT_MASK |= EMVSIM_INT_MASK_GPCNT0_IM_MASK; - base->TX_STATUS = EMVSIM_TX_STATUS_GPCNT0_TO_MASK; - /* Down counter trigger, and clear any pending counter status flag */ - base->CTRL &= ~EMVSIM_CTRL_RCV_EN_MASK; - base->CTRL |= EMVSIM_CTRL_RCV_EN_MASK; - context->transferState = kSMARTCARD_IdleState; - /* Unblock the caller */ - smartcard_emvsim_CompleteReceiveData(base, context); - return; - } - /* Check if timer for ATR duration timer has expired */ - if (((base->INT_MASK & EMVSIM_INT_MASK_GPCNT1_IM_MASK) == 0u) && - ((base->TX_STATUS & EMVSIM_TX_STATUS_GPCNT1_TO_MASK) != 0u)) - { /* Disable clock counter by clearing source clock to 0 */ - base->CLKCFG &= ~EMVSIM_CLKCFG_GPCNT1_CLK_SEL_MASK; - /* Disable and clear GPCNT interrupt */ - base->INT_MASK |= EMVSIM_INT_MASK_GPCNT1_IM_MASK; - base->TX_STATUS = EMVSIM_TX_STATUS_GPCNT1_TO_MASK; - context->timersState.adtExpired = true; - /* Unblock the caller */ - smartcard_emvsim_CompleteReceiveData(base, context); - return; - } - /* - * Check if a parity error was indicated. - * A parity error will cause transmission of NACK if ANACK bit is set in - * CTRL register and PEF bit will not be asserted. When ANACK is not set, - * PEF will be asserted. - */ - if ((base->RX_STATUS & EMVSIM_RX_STATUS_PEF_MASK) != 0u) - { - context->parityError = true; - /* Clear parity error indication */ - base->RX_STATUS = EMVSIM_RX_STATUS_PEF_MASK; - } - /* Check if transmit NACK generation threshold was reached */ - if ((base->TX_STATUS & EMVSIM_TX_STATUS_TNTE_MASK) != 0u) - { - context->txtCrossed = true; - /* Disable transmit NACK threshold interrupt */ - base->INT_MASK |= EMVSIM_INT_MASK_TNACK_IM_MASK; - /* Clear transmit NACK threshold error flag */ - base->TX_STATUS = EMVSIM_TX_STATUS_TNTE_MASK; - /* Unblock the caller */ - smartcard_emvsim_CompleteSendData(base, context); - return; - } - /* Check if receive NACK generation threshold was reached */ - if ((base->RX_STATUS & EMVSIM_RX_STATUS_RTE_MASK) != 0u) - { - context->rxtCrossed = true; - /* Clear receiver NACK threshold interrupt status */ - base->RX_STATUS = EMVSIM_RX_STATUS_RTE_MASK; - if (context->xIsBusy) - { /* Unblock the caller */ - smartcard_emvsim_CompleteReceiveData(base, context); - } - } - /* Check if a Character Wait Timer expired */ - if (((base->INT_MASK & EMVSIM_INT_MASK_CWT_ERR_IM_MASK) == 0u) && - ((base->RX_STATUS & EMVSIM_RX_STATUS_CWT_ERR_MASK) != 0u)) - { /* Disable Character Wait Timer interrupt */ - base->INT_MASK |= EMVSIM_INT_MASK_CWT_ERR_IM_MASK; - /* Reset the counter */ - base->CTRL &= ~EMVSIM_CTRL_CWT_EN_MASK; - /* Clear interrupt status */ - base->RX_STATUS = EMVSIM_RX_STATUS_CWT_ERR_MASK; - /* Enable CWT timer */ - base->CTRL |= EMVSIM_CTRL_CWT_EN_MASK; - context->transferState = kSMARTCARD_IdleState; - - if (kSMARTCARD_T0Transport == context->tType) - { /* Indicate WWT expired */ - context->timersState.wwtExpired = true; - } - else - { /* Indicate CWT expired */ - context->timersState.cwtExpired = true; - } - if (context->xIsBusy) - { /* Terminate and unblock any caller */ - smartcard_emvsim_CompleteReceiveData(base, context); - } - } - /* Check if a Block Wait Timer expired */ - if (((base->INT_MASK & EMVSIM_INT_MASK_BWT_ERR_IM_MASK) == 0u) && - ((base->RX_STATUS & EMVSIM_RX_STATUS_BWT_ERR_MASK) != 0u)) - { /* Disable Block Wait Timer interrupt */ - base->INT_MASK |= EMVSIM_INT_MASK_BWT_ERR_IM_MASK; - /* Clear interrupt status flag */ - base->CTRL &= ~EMVSIM_CTRL_BWT_EN_MASK; - /* Clear error */ - base->RX_STATUS = EMVSIM_RX_STATUS_BWT_ERR_MASK; - /* Enable BWT timer */ - base->CTRL |= EMVSIM_CTRL_BWT_EN_MASK; - - if (kSMARTCARD_T0Transport == context->tType) - { /* Indicate WWT expired */ - context->timersState.wwtExpired = true; - } - else - { /* Indicate BWT expired */ - context->timersState.bwtExpired = true; - } - /* Check if Wait Time Extension(WTX) was requested */ - if (context->wtxRequested) - { /* Reset WTX to default */ - (void)SMARTCARD_EMVSIM_Control(base, context, kSMARTCARD_ResetWaitTimeMultiplier, 1u); - } - if (context->xIsBusy) - { /* Terminate and unblock any caller */ - smartcard_emvsim_CompleteReceiveData(base, context); - } - } - - /* RX_DATA IRQ */ - /* Used in T=1 after receive 1st byte - disable BWT and enable CWT interrupt */ - if (((base->INT_MASK & EMVSIM_INT_MASK_RX_DATA_IM_MASK) == 0u) && - ((base->RX_STATUS & EMVSIM_RX_STATUS_RX_DATA_MASK) != 0u)) - { - if ((context->tType == kSMARTCARD_T1Transport) && (context->xSize > 0u) && - ((base->INT_MASK & EMVSIM_INT_MASK_BWT_ERR_IM_MASK) == 0u)) - { - context->timersState.cwtExpired = false; - /* Clear CWT error flag */ - base->RX_STATUS = EMVSIM_RX_STATUS_CWT_ERR_MASK; - /* Enable CWT */ - base->CTRL |= EMVSIM_CTRL_CWT_EN_MASK; - /* Only the 1st byte has been received, now time to disable BWT interrupt and enable CWT interrupt */ - base->INT_MASK = (base->INT_MASK & ~EMVSIM_INT_MASK_CWT_ERR_IM_MASK) | EMVSIM_INT_MASK_BWT_ERR_IM_MASK; - } - /* Disable interrupt when is received new byte */ - base->INT_MASK |= EMVSIM_INT_MASK_RX_DATA_IM_MASK; - } - - /* RDT IRQ - count of bytes in rx fifo reached the rx threshold value RX_THD[RDT] */ - if (((base->INT_MASK & EMVSIM_INT_MASK_RDT_IM_MASK) == 0u) && - ((base->RX_STATUS & EMVSIM_RX_STATUS_RDTF_MASK) != 0u)) - { - if (kSMARTCARD_WaitingForTSState == context->transferState) - { - /* Read byte */ - (void)(base->RX_BUF); - - if ((base->CTRL & EMVSIM_CTRL_ICM_MASK) != 0u) - { /* ICM mode still enabled, this is due to parity error */ - context->transferState = kSMARTCARD_InvalidTSDetecetedState; - } - else - { /* Received valid TS */ - context->transferState = kSMARTCARD_ReceivingState; - /* Get Data Convention form by reading IC bit of EMVSIM_CTRL register */ - context->cardParams.convention = - (smartcard_card_convention_t)(uint32_t)((base->CTRL & EMVSIM_CTRL_IC_MASK) >> EMVSIM_CTRL_IC_SHIFT); - } - if (kSMARTCARD_InvalidTSDetecetedState == context->transferState) - { /* Stop initial character (TS) detection timer, ADT timer and it's interrupt to occur */ - base->CLKCFG &= ~(EMVSIM_CLKCFG_GPCNT0_CLK_SEL_MASK | EMVSIM_CLKCFG_GPCNT1_CLK_SEL_MASK); - base->INT_MASK |= EMVSIM_INT_MASK_GPCNT0_IM_MASK; - smartcard_emvsim_CompleteReceiveData(base, context); - } - if (kSMARTCARD_ReceivingState == context->transferState) - { /* Stop initial character (TS) detection timer and disable ATR duration timer to reset it */ - base->CLKCFG &= ~(EMVSIM_CLKCFG_GPCNT0_CLK_SEL_MASK | EMVSIM_CLKCFG_GPCNT1_CLK_SEL_MASK); - /* Start ATR duration counter (restart GPCNT) */ - base->CLKCFG |= EMVSIM_CLKCFG_GPCNT1_CLK_SEL(kEMVSIM_GPCTxClock); - /* Start ATR duration counter, Disable counter 0 interrupt and Enable counter 1 interrupt */ - base->INT_MASK = (base->INT_MASK & ~EMVSIM_INT_MASK_GPCNT1_IM_MASK) | EMVSIM_INT_MASK_GPCNT0_IM_MASK; - /* Complete receive transfer */ - smartcard_emvsim_CompleteReceiveData(base, context); - } - /* Return anyway */ - return; - } - - while (((base->RX_STATUS & EMVSIM_RX_STATUS_RX_CNT_MASK) != 0u) && ((context->xSize) > 0u)) - { - /* Get data and put into receive buffer */ - *context->xBuff = (uint8_t)(base->RX_BUF); - ++context->xBuff; - --context->xSize; - } - - /* Check if the last byte was received */ - if (context->xSize == 0u) - { - smartcard_emvsim_CompleteReceiveData(base, context); - } - else - { - /* If the count of remaining bytes to receive is less than depth of fifo, update the value of the receiver - * data threshold */ - if (context->xSize < context->rxFifoThreshold) - { - /* Set receiver data threshold value to count of remaining bytes */ - uint32_t rx_thd; - rx_thd = (base->RX_THD & ~EMVSIM_RX_THD_RDT_MASK); - rx_thd |= context->xSize; - base->RX_THD = rx_thd; - } - } - } - - /* ETC IRQ - all data from fifo is transmitted */ - if (((base->INT_MASK & EMVSIM_INT_MASK_ETC_IM_MASK) == 0u) && - ((base->TX_STATUS & EMVSIM_TX_STATUS_ETCF_MASK) != 0u)) - { - smartcard_emvsim_CompleteSendData(base, context); - } - - /* TDT IRQ - tx fifo is empty */ - if (((base->INT_MASK & EMVSIM_INT_MASK_TDT_IM_MASK) == 0u) && - ((base->TX_STATUS & EMVSIM_TX_STATUS_TDTF_MASK) != 0u)) - { - if (context->xSize == 0u) - { - smartcard_emvsim_CompleteSendData(base, context); - } - - if (context->xSize == 1u) - { - /* Disable TDT interrupt */ - base->INT_MASK |= EMVSIM_INT_MASK_TDT_IM_MASK; - /* When the TX_GETU is not zero while sending last byte, the transmitter sends one byte more */ - base->TX_GETU = 0; - - /* Write data to fifo */ - base->TX_BUF = *(context->xBuff); - ++context->xBuff; - --context->xSize; - - /* Last byte was written to fifo - wait for ETC interrupt */ - /* Clear ETC flag and enable ETC interrupt */ - base->TX_STATUS |= EMVSIM_TX_STATUS_ETCF_MASK; - base->INT_MASK &= ~EMVSIM_INT_MASK_ETC_IM_MASK; - } - else - { - /* To fifo will be written 2 or more bytes */ - size_t getu_tail = (size_t)(base->TX_GETU > 0u); - while (((context->txFifoEntryCount - (uint8_t)((base->TX_STATUS & EMVSIM_TX_STATUS_TX_CNT_MASK) >> - EMVSIM_TX_STATUS_TX_CNT_SHIFT)) > 0u) && - (context->xSize > getu_tail)) - { - /* Write data to fifo */ - base->TX_BUF = *(context->xBuff); - ++context->xBuff; - --context->xSize; - } - - if (context->xSize == 0u) - { - /* Disable TDT interrupt */ - base->INT_MASK |= EMVSIM_INT_MASK_TDT_IM_MASK; - - /* Clear ETC flag and enable ETC interrupt */ - base->TX_STATUS |= EMVSIM_TX_STATUS_ETCF_MASK; - base->INT_MASK &= ~EMVSIM_INT_MASK_ETC_IM_MASK; - } - } - } - SDK_ISR_EXIT_BARRIER; -} - -/*! - * brief Controls the EMVSIM module per different user request. - * - * param base The EMVSIM peripheral base address. - * param context A pointer to a smart card driver context structure. - * param control Control type. - * param param Integer value of specific to control command. - * - * return kStatus_SMARTCARD_Success in success. - * return kStatus_SMARTCARD_OtherError in case of error. - */ -status_t SMARTCARD_EMVSIM_Control(EMVSIM_Type *base, - smartcard_context_t *context, - smartcard_control_t control, - uint32_t param) -{ - if ((NULL == context)) - { - return kStatus_SMARTCARD_InvalidInput; - } - - status_t status = kStatus_SMARTCARD_Success; - uint32_t temp32 = 0u; - - switch (control) - { - case kSMARTCARD_EnableADT: - /* Do nothing, ADT counter has been loaded and started after reset - * and during starting TS delay counter only. This is because, once - * TS counter has been triggered with RCV_EN down-up, we should not - * trigger again after TS is received(to avoid missing next character to - * TS. Rather, after TS is received, the ATR duration counter should just - * be restarted w/o re-triggering the counter. */ - break; - case kSMARTCARD_DisableADT: - base->CTRL &= ~EMVSIM_CTRL_RCV_EN_MASK; - /* Stop ADT specific counter and it's interrupt to occur */ - base->CLKCFG &= ~EMVSIM_CLKCFG_GPCNT1_CLK_SEL_MASK; - base->TX_STATUS = EMVSIM_TX_STATUS_GPCNT1_TO_MASK; - base->INT_MASK |= EMVSIM_INT_MASK_GPCNT1_IM_MASK; - break; - case kSMARTCARD_EnableGTV: - /* Enable GTV specific interrupt */ - base->INT_MASK &= ~EMVSIM_INT_MASK_BGT_ERR_IM_MASK; - break; - case kSMARTCARD_DisableGTV: - /* Disable GTV specific interrupt */ - base->INT_MASK |= EMVSIM_INT_MASK_BGT_ERR_IM_MASK; - break; - case kSMARTCARD_ResetWWT: - /* Reset WWT Timer */ - base->CTRL &= ~(EMVSIM_CTRL_CWT_EN_MASK | EMVSIM_CTRL_BWT_EN_MASK); - base->CTRL |= (EMVSIM_CTRL_CWT_EN_MASK | EMVSIM_CTRL_BWT_EN_MASK); - break; - case kSMARTCARD_EnableWWT: - /* BGT must be masked */ - base->INT_MASK |= EMVSIM_INT_MASK_BGT_ERR_IM_MASK; - /* Enable WWT Timer interrupt to occur */ - base->INT_MASK &= (~EMVSIM_INT_MASK_CWT_ERR_IM_MASK & ~EMVSIM_INT_MASK_BWT_ERR_IM_MASK); - break; - case kSMARTCARD_DisableWWT: - /* Disable WWT Timer interrupt to occur */ - base->INT_MASK |= (EMVSIM_INT_MASK_CWT_ERR_IM_MASK | EMVSIM_INT_MASK_BWT_ERR_IM_MASK); - break; - case kSMARTCARD_ResetCWT: - /* Reset CWT Timer */ - base->CTRL &= ~EMVSIM_CTRL_CWT_EN_MASK; - base->CTRL |= EMVSIM_CTRL_CWT_EN_MASK; - break; - case kSMARTCARD_EnableCWT: - base->CTRL |= EMVSIM_CTRL_CWT_EN_MASK; - /* Enable CWT Timer interrupt to occur */ - base->INT_MASK &= ~EMVSIM_INT_MASK_CWT_ERR_IM_MASK; - break; - case kSMARTCARD_DisableCWT: - /* CWT counter is for receive mode only */ - base->CTRL &= ~EMVSIM_CTRL_CWT_EN_MASK; - /* Disable CWT Timer interrupt to occur */ - base->INT_MASK |= EMVSIM_INT_MASK_CWT_ERR_IM_MASK; - break; - case kSMARTCARD_ResetBWT: - /* Reset BWT Timer */ - base->CTRL &= ~EMVSIM_CTRL_BWT_EN_MASK; - base->CTRL |= EMVSIM_CTRL_BWT_EN_MASK; - break; - case kSMARTCARD_EnableBWT: - base->CTRL |= EMVSIM_CTRL_BWT_EN_MASK; - /* Enable BWT Timer interrupt to occur */ - base->INT_MASK &= ~EMVSIM_INT_MASK_BWT_ERR_IM_MASK; - break; - case kSMARTCARD_DisableBWT: - /* Disable BWT Timer interrupt to occur */ - base->INT_MASK |= EMVSIM_INT_MASK_BWT_ERR_IM_MASK; - break; - case kSMARTCARD_EnableInitDetect: - /* Clear all ISO7816 interrupt flags */ - base->RX_STATUS = 0xFFFFFFFFu; - /* Enable initial character detection : hardware method */ - context->transferState = kSMARTCARD_WaitingForTSState; - /* Enable initial character detection */ - base->CTRL |= EMVSIM_CTRL_ICM_MASK; - base->CTRL |= EMVSIM_CTRL_RCV_EN_MASK; - break; - case kSMARTCARD_EnableAnack: - /* Enable NACK-on-error interrupt to occur */ - base->CTRL |= EMVSIM_CTRL_ANACK_MASK; - break; - case kSMARTCARD_DisableAnack: - /* Disable NACK-on-error interrupt to occur */ - base->CTRL &= ~EMVSIM_CTRL_ANACK_MASK; - break; - case kSMARTCARD_ConfigureBaudrate: - /* Set default baudrate/ETU time based on EMV parameters and card clock */ - base->DIVISOR = (((uint32_t)context->cardParams.Fi / context->cardParams.currentD) & 0x1FFu); - break; - case kSMARTCARD_SetupATRMode: - /* Set in default ATR mode */ - smartcard_emvsim_SetTransferType(base, context, kSMARTCARD_SetupATRMode); - break; - case kSMARTCARD_SetupT0Mode: - /* Set transport protocol type to T=0 */ - smartcard_emvsim_SetTransferType(base, context, kSMARTCARD_SetupT0Mode); - break; - case kSMARTCARD_SetupT1Mode: - /* Set transport protocol type to T=1 */ - smartcard_emvsim_SetTransferType(base, context, kSMARTCARD_SetupT1Mode); - break; - case kSMARTCARD_EnableReceiverMode: - /* Enable receiver mode and switch to receive direction */ - base->CTRL |= EMVSIM_CTRL_RCV_EN_MASK; - /* Set receiver threshold value to 1 */ - base->RX_THD = ((base->RX_THD & ~EMVSIM_RX_THD_RDT_MASK) | 1u); - /* Enable RDT interrupt */ - base->INT_MASK &= ~EMVSIM_INT_MASK_RDT_IM_MASK; - break; - case kSMARTCARD_DisableReceiverMode: - /* Disable receiver */ - base->CTRL &= ~EMVSIM_CTRL_RCV_EN_MASK; - break; - case kSMARTCARD_EnableTransmitterMode: - /* Enable transmitter mode and switch to transmit direction */ - base->CTRL |= EMVSIM_CTRL_XMT_EN_MASK; - break; - case kSMARTCARD_DisableTransmitterMode: - /* Disable transmitter */ - base->CTRL &= ~EMVSIM_CTRL_XMT_EN_MASK; - break; - case kSMARTCARD_ResetWaitTimeMultiplier: - base->CTRL &= ~EMVSIM_CTRL_BWT_EN_MASK; - /* Reset Wait Timer Multiplier - * EMV Formula : WTX x (11 + ((2^BWI + 1) x 960 x D)) */ - temp32 = ((uint8_t)param) * - (11u + ((((uint32_t)1u << context->cardParams.BWI) + 1u) * 960u * context->cardParams.currentD)); -#ifdef CARDSIM_EXTRADELAY_USED - temp32 += context->cardParams.currentD * 50; -#endif - base->BWT_VAL = temp32; - /* Set flag to SMARTCARD context accordingly */ - if (param > 1u) - { - context->wtxRequested = true; - } - else - { - context->wtxRequested = false; - } - base->CTRL |= EMVSIM_CTRL_BWT_EN_MASK; - break; - default: - status = kStatus_SMARTCARD_InvalidInput; - break; - } - return status; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartcard_emvsim.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartcard_emvsim.h deleted file mode 100644 index 503f411aaad..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartcard_emvsim.h +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2017 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_SMARTCARD_EMVSIM_H_ -#define FSL_SMARTCARD_EMVSIM_H_ - -#include "fsl_smartcard.h" - -/*! - * @addtogroup smartcard_emvsim_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @brief EMV RX NACK interrupt generation threshold */ -#define SMARTCARD_EMV_RX_NACK_THRESHOLD (5u) - -/*! @brief EMV TX NACK interrupt generation threshold */ -#define SMARTCARD_EMV_TX_NACK_THRESHOLD (5u) - -/*! @brief Smart card Word Wait Timer adjustment value */ -#define SMARTCARD_WWT_ADJUSTMENT (160u) - -/*! @brief Smart card Character Wait Timer adjustment value */ -#define SMARTCARD_CWT_ADJUSTMENT (3u) - -/*! @brief General Purpose Counter clock selections */ -typedef enum _emvsim_gpc_clock_select -{ - kEMVSIM_GPCClockDisable = 0u, /*!< Disabled */ - kEMVSIM_GPCCardClock = 1u, /*!< Card clock */ - kEMVSIM_GPCRxClock = 2u, /*!< Receive clock */ - kEMVSIM_GPCTxClock = 3u, /*!< Transmit ETU clock */ -} emvsim_gpc_clock_select_t; - -/*! @brief EMVSIM card presence detection edge control */ -typedef enum _presence_detect_edge -{ - kEMVSIM_DetectOnFallingEdge = 0u, /*!< Presence detected on the falling edge */ - kEMVSIM_DetectOnRisingEdge = 1u, /*!< Presence detected on the rising edge */ -} emvsim_presence_detect_edge_t; - -/*! @brief EMVSIM card presence detection status */ -typedef enum _presence_detect_status -{ - kEMVSIM_DetectPinIsLow = 0u, /*!< Presence detected pin is logic low */ - kEMVSIM_DetectPinIsHigh = 1u, /*!< Presence detected pin is logic high */ -} emvsim_presence_detect_status_t; - -/******************************************************************************* - * API - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Smart card EMVSIM Driver - * @{ - */ - -/*! - * @brief Fills in the smartcard_card_params structure with default values according to the EMV 4.3 specification. - * - * @param cardParams The configuration structure of type smartcard_interface_config_t. - * Function fill in members: - * Fi = 372; - * Di = 1; - * currentD = 1; - * WI = 0x0A; - * GTN = 0x00; - * with default values. - */ -void SMARTCARD_EMVSIM_GetDefaultConfig(smartcard_card_params_t *cardParams); - -/*! - * @brief Initializes an EMVSIM peripheral for the Smart card/ISO-7816 operation. - * - * This function un-gates the EMVSIM clock, initializes the module to EMV default settings, - * configures the IRQ, enables the module-level interrupt to the core and, initializes the driver context. - * - * @param base The EMVSIM peripheral base address. - * @param context A pointer to the smart card driver context structure. - * @param srcClock_Hz Smart card clock generation module source clock. - * - * @return An error code or kStatus_SMARTCARD_Success. - */ -status_t SMARTCARD_EMVSIM_Init(EMVSIM_Type *base, smartcard_context_t *context, uint32_t srcClock_Hz); - -/*! - * @brief This function disables the EMVSIM interrupts, disables the transmitter and receiver, - * flushes the FIFOs, and gates EMVSIM clock in SIM. - * - * @param base The EMVSIM module base address. - */ -void SMARTCARD_EMVSIM_Deinit(EMVSIM_Type *base); - -/*! - * @brief Returns whether the previous EMVSIM transfer has finished. - * - * When performing an async transfer, call this function to ascertain the context of the - * current transfer: in progress (or busy) or complete (success). If the - * transfer is still in progress, the user can obtain the number of words that have not been - * transferred. - * - * @param base The EMVSIM module base address. - * @param context A pointer to a smart card driver context structure. - * - * @return The number of bytes not transferred. - */ -int32_t SMARTCARD_EMVSIM_GetTransferRemainingBytes(EMVSIM_Type *base, smartcard_context_t *context); - -/*! - * @brief Terminates an asynchronous EMVSIM transfer early. - * - * During an async EMVSIM transfer, the user can terminate the transfer early - * if the transfer is still in progress. - * - * @param base The EMVSIM peripheral address. - * @param context A pointer to a smart card driver context structure. - * @retval kStatus_SMARTCARD_Success The transmit abort was successful. - * @retval kStatus_SMARTCARD_NoTransmitInProgress No transmission is currently in progress. - */ -status_t SMARTCARD_EMVSIM_AbortTransfer(EMVSIM_Type *base, smartcard_context_t *context); - -/*! - * @brief Transfer data using interrupts. - * - * A non-blocking (also known as asynchronous) function means that the function returns - * immediately after initiating the transfer function. The application has to get the - * transfer status to see when the transfer is complete. In other words, after calling the non-blocking - * (asynchronous) transfer function, the application must get the transfer status to check if the transmit - * is completed or not. - * - * @param base The EMVSIM peripheral base address. - * @param context A pointer to a smart card driver context structure. - * @param xfer A pointer to the smart card transfer structure where the linked buffers and sizes are stored. - * - * @return An error code or kStatus_SMARTCARD_Success. - */ -status_t SMARTCARD_EMVSIM_TransferNonBlocking(EMVSIM_Type *base, smartcard_context_t *context, smartcard_xfer_t *xfer); - -/*! - * @brief Controls the EMVSIM module per different user request. - * - * @param base The EMVSIM peripheral base address. - * @param context A pointer to a smart card driver context structure. - * @param control Control type. - * @param param Integer value of specific to control command. - * - * return kStatus_SMARTCARD_Success in success. - * return kStatus_SMARTCARD_OtherError in case of error. - */ -status_t SMARTCARD_EMVSIM_Control(EMVSIM_Type *base, - smartcard_context_t *context, - smartcard_control_t control, - uint32_t param); - -/*! - * @brief Handles EMVSIM module interrupts. - * - * @param base The EMVSIM peripheral base address. - * @param context A pointer to a smart card driver context structure. - */ -void SMARTCARD_EMVSIM_IRQHandler(EMVSIM_Type *base, smartcard_context_t *context); -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_SMARTCARD_EMVSIM_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartcard_phy.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartcard_phy.h deleted file mode 100644 index 007eee67633..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartcard_phy.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2017 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_SMARTCARD_PHY_H_ -#define FSL_SMARTCARD_PHY_H_ - -#include "fsl_smartcard.h" - -/*! - * @addtogroup smartcard_phy_driver - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @brief Smart card definition which specifies the adjustment number of clock cycles during which an ATR string has to - * be received. - */ -#define SMARTCARD_ATR_DURATION_ADJUSTMENT (360u) - -/*! @brief Smart card definition which specifies the adjustment number of clock cycles until an initial 'TS' character - * has to be - * received. */ -#define SMARTCARD_INIT_DELAY_CLOCK_CYCLES_ADJUSTMENT (4200u) - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @brief Fills in the configuration structure with default values. - * - * @param config The Smart card user configuration structure which contains configuration structure of type - * smartcard_interface_config_t. - * Function fill in members: - * clockToResetDelay = 42000, - * vcc = kSmartcardVoltageClassB3_3V, - * with default values. - */ -void SMARTCARD_PHY_GetDefaultConfig(smartcard_interface_config_t *config); - -/*! - * @brief Initializes a Smart card interface instance. - * - * @param base The Smart card peripheral base address. - * @param config The user configuration structure of type smartcard_interface_config_t. Call the - * function SMARTCARD_PHY_GetDefaultConfig() to fill the configuration structure. - * @param srcClock_Hz Smart card clock generation module source clock. - * - * @retval kStatus_SMARTCARD_Success or kStatus_SMARTCARD_OtherError in case of error. - */ -status_t SMARTCARD_PHY_Init(void *base, smartcard_interface_config_t const *config, uint32_t srcClock_Hz); - -/*! - * @brief De-initializes a Smart card interface, stops the Smart card clock, and disables the VCC. - * - * @param base The Smart card peripheral module base address. - * @param config The user configuration structure of type smartcard_interface_config_t. - */ -void SMARTCARD_PHY_Deinit(void *base, smartcard_interface_config_t const *config); - -/*! - * @brief Activates the Smart card IC. - * - * @param base The Smart card peripheral module base address. - * @param context A pointer to a Smart card driver context structure. - * @param resetType type of reset to be performed, possible values - * = kSmartcardColdReset, kSmartcardWarmReset - * - * @retval kStatus_SMARTCARD_Success or kStatus_SMARTCARD_OtherError in case of error. - */ -status_t SMARTCARD_PHY_Activate(void *base, smartcard_context_t *context, smartcard_reset_type_t resetType); - -/*! - * @brief De-activates the Smart card IC. - * - * @param base The Smart card peripheral module base address. - * @param context A pointer to a Smart card driver context structure. - * - * @retval kStatus_SMARTCARD_Success or kStatus_SMARTCARD_OtherError in case of error. - */ -status_t SMARTCARD_PHY_Deactivate(void *base, smartcard_context_t *context); - -/*! - * @brief Controls the Smart card interface IC. - * - * @param base The Smart card peripheral module base address. - * @param context A pointer to a Smart card driver context structure. - * @param control A interface command type. - * @param param Integer value specific to control type - * - * @retval kStatus_SMARTCARD_Success or kStatus_SMARTCARD_OtherError in case of error. - */ -status_t SMARTCARD_PHY_Control(void *base, - smartcard_context_t *context, - smartcard_interface_control_t control, - uint32_t param); - -/*! - * @brief Smart card interface IC IRQ ISR. - * - * @param base The Smart card peripheral module base address. - * @param context The Smart card context pointer. - */ -#if defined(USING_PHY_TDA8035) -void SMARTCARD_PHY_IRQHandler(void *base, smartcard_context_t *context); -#endif -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_SMARTCARD_PHY_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartcard_phy_emvsim.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartcard_phy_emvsim.c deleted file mode 100644 index 1be83f8101d..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartcard_phy_emvsim.c +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. - * Copyright 2016-2017 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_smartcard_emvsim.h" -#include "fsl_smartcard_phy.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.smartcard_phy_emvsim" -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Private Functions - ******************************************************************************/ -static uint32_t smartcard_phy_emvsim_InterfaceClockInit(EMVSIM_Type *base, - const smartcard_interface_config_t *config, - uint32_t srcClock_Hz); - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * @brief This function initializes clock module used for card clock generation - */ -static uint32_t smartcard_phy_emvsim_InterfaceClockInit(EMVSIM_Type *base, - const smartcard_interface_config_t *config, - uint32_t srcClock_Hz) -{ - assert((NULL != config) && (0u != srcClock_Hz)); - - uint32_t emvsimClkMhz = 0u; - uint8_t emvsimPRSCValue; - - /* Retrieve EMV SIM clock */ - emvsimClkMhz = srcClock_Hz / 1000000u; - /* Calculate MOD value */ - emvsimPRSCValue = (uint8_t)((emvsimClkMhz * 1000u) / (config->smartCardClock / 1000u)); - /* Set clock prescaler */ - base->CLKCFG = (base->CLKCFG & ~EMVSIM_CLKCFG_CLK_PRSC_MASK) | EMVSIM_CLKCFG_CLK_PRSC(emvsimPRSCValue); - - return config->smartCardClock; -} - -void SMARTCARD_PHY_GetDefaultConfig(smartcard_interface_config_t *config) -{ - assert((NULL != config)); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->clockToResetDelay = SMARTCARD_INIT_DELAY_CLOCK_CYCLES; - config->vcc = kSMARTCARD_VoltageClassB3_3V; -} - -status_t SMARTCARD_PHY_Init(void *base, smartcard_interface_config_t const *config, uint32_t srcClock_Hz) -{ - if ((NULL == config) || (0u == srcClock_Hz)) - { - return kStatus_SMARTCARD_InvalidInput; - } - EMVSIM_Type *emvsimBase = (EMVSIM_Type *)base; - - /* SMARTCARD clock initialization. Clock is still not active after this call */ - (void)smartcard_phy_emvsim_InterfaceClockInit(emvsimBase, config, srcClock_Hz); - - /* Configure EMVSIM direct interface driver interrupt occur according card presence */ - if ((emvsimBase->PCSR & EMVSIM_PCSR_SPDP_MASK) != 0u) - { - emvsimBase->PCSR &= ~EMVSIM_PCSR_SPDES_MASK; - } - else - { - emvsimBase->PCSR |= EMVSIM_PCSR_SPDES_MASK; - } - /* Un-mask presence detect interrupt flag */ - emvsimBase->PCSR &= ~EMVSIM_PCSR_SPDIM_MASK; - - return kStatus_SMARTCARD_Success; -} - -void SMARTCARD_PHY_Deinit(void *base, smartcard_interface_config_t const *config) -{ - assert((NULL != config)); - /* Deactivate VCC, CLOCK */ - ((EMVSIM_Type *)base)->PCSR &= ~(EMVSIM_PCSR_SCEN_MASK | EMVSIM_PCSR_SVCC_EN_MASK); -} - -status_t SMARTCARD_PHY_Activate(void *base, smartcard_context_t *context, smartcard_reset_type_t resetType) -{ - if ((NULL == context) || (NULL == context->timeDelay)) - { - return kStatus_SMARTCARD_InvalidInput; - } - assert(context->interfaceConfig.vcc == kSMARTCARD_VoltageClassB3_3V); - - EMVSIM_Type *emvsimBase = (EMVSIM_Type *)base; - - context->timersState.initCharTimerExpired = false; - context->resetType = resetType; - - /* Disable receiver to deactivate GPC timers trigger */ - emvsimBase->CTRL &= ~EMVSIM_CTRL_RCV_EN_MASK; - if (resetType == kSMARTCARD_ColdReset) - { /* Set polarity of VCC to active high, Enable VCC for SMARTCARD, Enable smart card clock */ - emvsimBase->PCSR = - (emvsimBase->PCSR & ~EMVSIM_PCSR_VCCENP_MASK) | (EMVSIM_PCSR_SVCC_EN_MASK | EMVSIM_PCSR_SCEN_MASK); - /* Set transfer inversion to default(direct) value */ - emvsimBase->CTRL &= ~EMVSIM_CTRL_IC_MASK; - } - else if (resetType == kSMARTCARD_WarmReset) - { /* Ensure that card is already active */ - if (!context->cardParams.active) - { /* Card is not active;hence return */ - return kStatus_SMARTCARD_CardNotActivated; - } - } - else - { - return kStatus_SMARTCARD_InvalidInput; - } - /* Set Reset low */ - emvsimBase->PCSR &= ~EMVSIM_PCSR_SRST_MASK; - /* Calculate time delay needed for reset */ - uint32_t temp = - ((((uint32_t)10000u * context->interfaceConfig.clockToResetDelay) / context->interfaceConfig.smartCardClock) * - 100u) + - 1u; - context->timeDelay(temp); - /* Pull reset HIGH Now to mark the end of Activation sequence */ - emvsimBase->PCSR |= EMVSIM_PCSR_SRST_MASK; - /* Disable GPC timers input clock */ - emvsimBase->CLKCFG &= ~(EMVSIM_CLKCFG_GPCNT0_CLK_SEL_MASK | EMVSIM_CLKCFG_GPCNT1_CLK_SEL_MASK); - /* Down counter trigger, and clear any pending counter status flag */ - emvsimBase->TX_STATUS = EMVSIM_TX_STATUS_GPCNT1_TO_MASK | EMVSIM_TX_STATUS_GPCNT0_TO_MASK; - /* Set counter value for TS detection delay */ - emvsimBase->GPCNT0_VAL = (SMARTCARD_INIT_DELAY_CLOCK_CYCLES + SMARTCARD_INIT_DELAY_CLOCK_CYCLES_ADJUSTMENT); - /* Pre-load counter value for ATR duration delay */ - emvsimBase->GPCNT1_VAL = (SMARTCARD_EMV_ATR_DURATION_ETU + SMARTCARD_ATR_DURATION_ADJUSTMENT); - /* Select the clock for GPCNT for both TS detection and early start of ATR duration counter */ - emvsimBase->CLKCFG |= - (EMVSIM_CLKCFG_GPCNT0_CLK_SEL(kEMVSIM_GPCCardClock) | EMVSIM_CLKCFG_GPCNT1_CLK_SEL(kEMVSIM_GPCTxClock)); - /* Set receiver to ICM mode, Flush RX FIFO */ - emvsimBase->CTRL |= (EMVSIM_CTRL_ICM_MASK | EMVSIM_CTRL_FLSH_RX_MASK); - /* Enable counter interrupt for TS detection */ - emvsimBase->INT_MASK &= ~EMVSIM_INT_MASK_GPCNT0_IM_MASK; - /* Clear any pending status flags */ - emvsimBase->RX_STATUS = 0xFFFFFFFFu; - /* Enable receiver */ - emvsimBase->CTRL |= EMVSIM_CTRL_RCV_EN_MASK; - /* Here the card was activated */ - context->cardParams.active = true; - - return kStatus_SMARTCARD_Success; -} - -status_t SMARTCARD_PHY_Deactivate(void *base, smartcard_context_t *context) -{ - if ((NULL == context)) - { - return kStatus_SMARTCARD_InvalidInput; - } - - EMVSIM_Type *emvsimBase = (EMVSIM_Type *)base; - - /* Assert Reset */ - emvsimBase->PCSR &= ~EMVSIM_PCSR_SRST_MASK; - /* Stop SMARTCARD clock generation */ - emvsimBase->PCSR &= ~EMVSIM_PCSR_SCEN_MASK; - /* Deactivate card by disabling VCC */ - emvsimBase->PCSR &= ~EMVSIM_PCSR_SVCC_EN_MASK; - /* According EMV 4.3 specification deactivation sequence should be done within 100ms. - * The period is measured from the time that RST is set to state L to the time that Vcc - * reaches 0.4 V or less. - */ - context->timeDelay(100 * 1000); - /* Here the card was deactivated */ - context->cardParams.active = false; - - return kStatus_SMARTCARD_Success; -} - -status_t SMARTCARD_PHY_Control(void *base, - smartcard_context_t *context, - smartcard_interface_control_t control, - uint32_t param) -{ - if ((NULL == context)) - { - return kStatus_SMARTCARD_InvalidInput; - } - - status_t status = kStatus_SMARTCARD_Success; - - switch (control) - { - case kSMARTCARD_InterfaceSetVcc: - /* Only 3.3V interface supported by the direct interface */ - assert((smartcard_card_voltage_class_t)param == kSMARTCARD_VoltageClassB3_3V); - context->interfaceConfig.vcc = (smartcard_card_voltage_class_t)param; - break; - case kSMARTCARD_InterfaceSetClockToResetDelay: - /* Set interface clock to Reset delay set by caller */ - context->interfaceConfig.clockToResetDelay = param; - break; - case kSMARTCARD_InterfaceReadStatus: - /* Expecting active low present detect */ - context->cardParams.present = (bool)((emvsim_presence_detect_status_t)(uint32_t)( - (((EMVSIM_Type *)base)->PCSR & EMVSIM_PCSR_SPDP_MASK) >> - EMVSIM_PCSR_SPDP_SHIFT) == kEMVSIM_DetectPinIsLow); - break; - default: - status = kStatus_SMARTCARD_InvalidInput; - break; - } - - return status; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartdma.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartdma.c deleted file mode 100644 index d1560d46b64..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartdma.c +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright 2019-2023 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_smartdma.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.lpc_smartdma" -#endif - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -typedef void (*smartdma_func_t)(void); - -#define SMARTDMA_HANDSHAKE_EVENT 0U -#define SMARTDMA_HANDSHAKE_ENABLE 1U -#define SMARTDMA_MASK_RESP 2U -#define SMARTDMA_ENABLE_AHBBUF 3U -#define SMARTDMA_ENABLE_GPISYNCH 4U - -#if defined(SMARTDMA0) && !(defined(SMARTDMA)) -#define SMARTDMA SMARTDMA0 -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ -static smartdma_func_t *s_smartdmaApiTable; -static smartdma_callback_t s_smartdmaCallback; -static void *s_smartdmaCallbackParam; -static smartdma_param_t s_smartdmaParam; - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Codes - ******************************************************************************/ -/*! - * brief Initialize the SMARTDMA. - * - * param apiMemAddr The address firmware will be copied to. - * param firmware The firmware to use. - * param firmwareSizeByte Size of firmware. - */ -void SMARTDMA_Init(uint32_t apiMemAddr, const void *firmware, uint32_t firmwareSizeByte) -{ - SMARTDMA_InitWithoutFirmware(); - SMARTDMA_InstallFirmware(apiMemAddr, firmware, firmwareSizeByte); -} - -/*! - * brief Initialize the SMARTDMA. - * - * This function is similar with SMARTDMA_Init, the difference is this function - * does not install the firmware, the firmware could be installed using - * SMARTDMA_InstallFirmware. - */ -void SMARTDMA_InitWithoutFirmware(void) -{ - /* Clear Smart DMA RAM */ - RESET_PeripheralReset(kSMART_DMA_RST_SHIFT_RSTn); - CLOCK_EnableClock(kCLOCK_Smartdma); -} - -/*! - * @brief Install the firmware. - * - * param apiMemAddr The address firmware will be copied to. - * param firmware The firmware to use. - * param firmwareSizeByte Size of firmware. - */ -void SMARTDMA_InstallFirmware(uint32_t apiMemAddr, const void *firmware, uint32_t firmwareSizeByte) -{ - (void)memcpy((void *)(uint8_t *)apiMemAddr, firmware, firmwareSizeByte); - SMARTDMA->CTRL = (0xC0DE0000U | (1U << SMARTDMA_ENABLE_GPISYNCH)); - s_smartdmaApiTable = (smartdma_func_t *)apiMemAddr; -} - -/*! - * brief Install the complete callback function.. - * - * param callback The callback called when smartdma program finished. - */ -void SMARTDMA_InstallCallback(smartdma_callback_t callback, void *param) -{ - s_smartdmaCallback = callback; - s_smartdmaCallbackParam = param; -} - -/*! - * brief Boot the SMARTDMA to run program. - * - * param apiIndex Index of the API to call. - * param pParam Pointer to the parameter allocated by caller. - * param mask Value set to SMARTDMA_ARM2SMARTDMA[0:1]. - */ -void SMARTDMA_Boot(uint32_t apiIndex, void *pParam, uint8_t mask) -{ - SMARTDMA->ARM2EZH = (uint32_t)(uint8_t *)pParam | (uint32_t)mask; - SMARTDMA->BOOTADR = (uint32_t)(s_smartdmaApiTable[apiIndex]); - SMARTDMA->CTRL = 0xC0DE0011U | (0U << SMARTDMA_MASK_RESP) | (0U << SMARTDMA_ENABLE_AHBBUF); /* BOOT */ -}; - -/* - * brief Copy SMARTDMA params and Boot to run program. - * - * This function is similar with SMARTDMA_Boot, the only difference - * is, this function copies the *pParam to a local variable, upper layer - * can free the pParam's memory before the SMARTDMA execution finished, - * for example, upper layer can define the param as a local variable. - * - * param apiIndex Index of the API to call. - * param pParam Pointer to the parameter. - * param mask Value set to SMARTDMA_ARM2SMARTDMA[0:1]. - * note Only call this function when SMARTDMA is not busy. - */ -void SMARTDMA_Boot1(uint32_t apiIndex, const smartdma_param_t *pParam, uint8_t mask) -{ - (void)memcpy(&s_smartdmaParam, pParam, sizeof(smartdma_param_t)); - SMARTDMA_Boot(apiIndex, &s_smartdmaParam, mask); -} - -/*! - * brief Deinitialize the SMARTDMA. - */ -void SMARTDMA_Deinit(void) -{ - SMARTDMA->CTRL = 0xC0DE0000U; - CLOCK_DisableClock(kCLOCK_Smartdma); -} - -/*! - * brief Reset the SMARTDMA. - */ -void SMARTDMA_Reset(void) -{ - RESET_PeripheralReset(kSMART_DMA_RST_SHIFT_RSTn); - SMARTDMA->CTRL = (0xC0DE0000U | (1U << SMARTDMA_ENABLE_GPISYNCH)); -} - -/*! - * brief SMARTDMA IRQ. - */ -void SMARTDMA_HandleIRQ(void) -{ - if (NULL != s_smartdmaCallback) - { - s_smartdmaCallback(s_smartdmaCallbackParam); - } -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartdma.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartdma.h deleted file mode 100644 index 8741711c9cb..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartdma.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright 2019-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_SMARTDMA_H_ -#define FSL_SMARTDMA_H_ - -#include "fsl_common.h" - -#if defined(MIMXRT533S_SERIES) || defined(MIMXRT555S_SERIES) || defined(MIMXRT595S_cm33_SERIES) -#include "fsl_smartdma_rt500.h" -#elif defined(MCXN546_cm33_core0_SERIES) || defined(MCXN546_cm33_core1_SERIES) || \ - defined(MCXN547_cm33_core0_SERIES) || defined(MCXN547_cm33_core1_SERIES) || defined(MCXN946_cm33_core0_SERIES) || \ - defined(MCXN946_cm33_core1_SERIES) || defined(MCXN947_cm33_core0_SERIES) || defined(MCXN947_cm33_core1_SERIES) || \ - defined(MCXN236_SERIES) || defined(MCXN235_SERIES) -#include "fsl_smartdma_mcxn.h" -#else -#error "Device not supported" -#endif - -/*! - * @addtogroup smartdma - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief SMARTDMA driver version */ -#define FSL_SMARTDMA_DRIVER_VERSION (MAKE_VERSION(2, 9, 1)) -/*@}*/ - -/*! @brief Callback function prototype for the smartdma driver. */ -typedef void (*smartdma_callback_t)(void *param); - -/******************************************************************************* - * APIs - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @brief Initialize the SMARTDMA. - * - * @param apiMemAddr The address firmware will be copied to. - * @param firmware The firmware to use. - * @param firmwareSizeByte Size of firmware. - * @deprecated Do not use this function. It has been superceded by - * @ref SMARTDMA_InitWithoutFirmware and @ref SMARTDMA_InstallFirmware. - */ -void SMARTDMA_Init(uint32_t apiMemAddr, const void *firmware, uint32_t firmwareSizeByte); - -/*! - * @brief Initialize the SMARTDMA. - * - * This function is similar with @ref SMARTDMA_Init, the difference is this function - * does not install the firmware, the firmware could be installed using - * @ref SMARTDMA_InstallFirmware. - */ -void SMARTDMA_InitWithoutFirmware(void); - -/*! - * @brief Install the firmware. - * - * @param apiMemAddr The address firmware will be copied to. - * @param firmware The firmware to use. - * @param firmwareSizeByte Size of firmware. - * @note Only call this function when SMARTDMA is not busy. - */ -void SMARTDMA_InstallFirmware(uint32_t apiMemAddr, const void *firmware, uint32_t firmwareSizeByte); - -/*! - * @brief Install the complete callback function. - * - * @param callback The callback called when smartdma program finished. - * @param param Parameter for the callback. - * @note Only call this function when SMARTDMA is not busy. - */ -void SMARTDMA_InstallCallback(smartdma_callback_t callback, void *param); - -/*! - * @brief Boot the SMARTDMA to run program. - * - * @param apiIndex Index of the API to call. - * @param pParam Pointer to the parameter allocated by caller. - * @param mask Value set to register SMARTDMA->ARM2EZH[0:1]. - * @note Only call this function when SMARTDMA is not busy. - * @note The memory *pParam shall not be freed before the SMARTDMA function finished. - */ -void SMARTDMA_Boot(uint32_t apiIndex, void *pParam, uint8_t mask); - -/*! - * @brief Copy SMARTDMA params and Boot to run program. - * - * This function is similar with @ref SMARTDMA_Boot, the only difference - * is, this function copies the *pParam to a local variable, upper layer - * can free the pParam's memory before the SMARTDMA execution finished, - * for example, upper layer can define the param as a local variable. - * - * @param apiIndex Index of the API to call. - * @param pParam Pointer to the parameter. - * @param mask Value set to SMARTDMA_ARM2SMARTDMA[0:1]. - * @note Only call this function when SMARTDMA is not busy. - */ -void SMARTDMA_Boot1(uint32_t apiIndex, const smartdma_param_t *pParam, uint8_t mask); - -/*! - * @brief Deinitialize the SMARTDMA. - */ -void SMARTDMA_Deinit(void); - -/*! - * @brief Reset the SMARTDMA. - */ -void SMARTDMA_Reset(void); - -/*! - * @brief SMARTDMA IRQ. - */ -void SMARTDMA_HandleIRQ(void); - -#if defined(__cplusplus) -} -#endif - -/* @} */ - -#endif /* FSL_SMARTDMA_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartdma_mcxn.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartdma_mcxn.c deleted file mode 100644 index 456b0e95eee..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartdma_mcxn.c +++ /dev/null @@ -1,545 +0,0 @@ -/* - * Copyright 2019-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_smartdma.h" - -#if defined(MCXN546_cm33_core0_SERIES) || defined(MCXN546_cm33_core1_SERIES) || defined(MCXN547_cm33_core0_SERIES) || \ - defined(MCXN547_cm33_core1_SERIES) || defined(MCXN946_cm33_core0_SERIES) || defined(MCXN946_cm33_core1_SERIES) || \ - defined(MCXN947_cm33_core0_SERIES) || defined(MCXN947_cm33_core1_SERIES) || defined(MCXN236_SERIES) - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ - -const uint8_t s_smartdmaDisplayFirmware[] = { - 0x24U, 0x00U, 0x00U, 0x04U, 0x18U, 0x01U, 0x00U, 0x04U, 0xC8U, 0x02U, 0x00U, 0x04U, 0xF0U, 0x01U, 0x00U, 0x04U, - 0x7CU, 0x03U, 0x00U, 0x04U, 0xACU, 0x08U, 0x00U, 0x04U, 0x10U, 0x0EU, 0x00U, 0x04U, 0x38U, 0x10U, 0x00U, 0x04U, - 0xC0U, 0x12U, 0x00U, 0x04U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, - 0x04U, 0x18U, 0x04U, 0x33U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, - 0x10U, 0x04U, 0x14U, 0x05U, 0x00U, 0x08U, 0x26U, 0x05U, 0x00U, 0x0CU, 0x0CU, 0x01U, 0x0CU, 0x88U, 0x30U, 0x00U, - 0x00U, 0x1CU, 0x0EU, 0x04U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0xC7U, 0x08U, - 0x1AU, 0x80U, 0x10U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x02U, 0xC0U, 0x25U, 0x00U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x02U, 0xC0U, 0x25U, 0x01U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x02U, 0xC0U, 0x25U, 0x02U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x02U, 0xC0U, 0x25U, 0x03U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x02U, 0xC0U, 0x25U, 0x04U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x02U, 0xC0U, 0x25U, 0x05U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x02U, 0xC0U, 0x25U, 0x06U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x02U, 0xC0U, 0x25U, 0x07U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xF2U, 0x01U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x33U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0xB0U, 0x05U, 0x02U, 0x10U, 0x04U, 0x14U, 0x05U, 0x00U, 0x08U, 0x26U, 0x05U, 0x00U, 0x0CU, 0x0CU, 0x01U, - 0x0CU, 0x88U, 0x30U, 0x00U, 0x00U, 0x1CU, 0x0EU, 0x04U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x08U, 0x44U, 0x14U, 0x00U, - 0x06U, 0x48U, 0x07U, 0x07U, 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x06U, 0x00U, 0xC4U, 0x01U, 0x01U, 0x08U, 0x1CU, 0xFFU, 0x01U, 0x0CU, 0x1CU, 0xFFU, - 0x01U, 0x10U, 0x1CU, 0xFFU, 0x01U, 0x14U, 0x1CU, 0xFFU, 0x11U, 0x08U, 0x20U, 0x00U, 0x02U, 0xC0U, 0x25U, 0x00U, - 0x11U, 0x0CU, 0x30U, 0x00U, 0x02U, 0xC0U, 0x35U, 0x01U, 0x11U, 0x10U, 0x40U, 0x00U, 0x02U, 0xC0U, 0x45U, 0x02U, - 0x11U, 0x14U, 0x50U, 0x00U, 0x02U, 0xC0U, 0x55U, 0x03U, 0x01U, 0x08U, 0x1CU, 0xFFU, 0x01U, 0x0CU, 0x1CU, 0xFFU, - 0x01U, 0x10U, 0x1CU, 0xFFU, 0x01U, 0x14U, 0x1CU, 0x08U, 0x11U, 0x08U, 0x20U, 0x00U, 0x02U, 0xC0U, 0x25U, 0x04U, - 0x11U, 0x0CU, 0x30U, 0x00U, 0x02U, 0xC0U, 0x35U, 0x05U, 0x11U, 0x10U, 0x40U, 0x00U, 0x02U, 0xC0U, 0x45U, 0x06U, - 0x11U, 0x14U, 0x50U, 0x00U, 0x02U, 0xC0U, 0x55U, 0x07U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xA2U, 0x03U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x33U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, 0x06U, 0x18U, 0x10U, 0x00U, - 0x10U, 0x04U, 0x14U, 0x05U, 0x00U, 0x08U, 0x26U, 0x05U, 0x00U, 0x0CU, 0x0CU, 0x01U, 0x0CU, 0x88U, 0x30U, 0x00U, - 0x00U, 0x1CU, 0x0EU, 0x04U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0xC7U, 0x06U, - 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x01U, 0x88U, 0x15U, 0xFFU, 0x01U, 0x8CU, 0x15U, 0xFFU, 0x01U, 0x90U, 0x15U, 0xFFU, 0x01U, 0x94U, 0x15U, 0xFFU, - 0x11U, 0x08U, 0x20U, 0x00U, 0x02U, 0xC0U, 0x25U, 0x00U, 0x11U, 0x0CU, 0x30U, 0x00U, 0x02U, 0xC0U, 0x35U, 0x01U, - 0x11U, 0x10U, 0x40U, 0x00U, 0x02U, 0xC0U, 0x45U, 0x02U, 0x11U, 0x14U, 0x50U, 0x00U, 0x02U, 0xC0U, 0x55U, 0x03U, - 0x01U, 0x88U, 0x15U, 0xFFU, 0x01U, 0x8CU, 0x15U, 0xFFU, 0x01U, 0x90U, 0x15U, 0xFFU, 0x01U, 0x94U, 0x15U, 0xFFU, - 0x11U, 0x08U, 0x20U, 0x00U, 0x02U, 0xC0U, 0x25U, 0x04U, 0x11U, 0x0CU, 0x30U, 0x00U, 0x02U, 0xC0U, 0x35U, 0x05U, - 0x11U, 0x10U, 0x40U, 0x00U, 0x02U, 0xC0U, 0x45U, 0x06U, 0x11U, 0x14U, 0x50U, 0x00U, 0x02U, 0xC0U, 0x55U, 0x07U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x52U, 0x05U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x33U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0xB0U, 0x05U, 0x02U, 0x10U, 0x04U, 0x14U, 0x05U, 0x00U, 0x08U, 0x26U, 0x05U, 0x00U, 0x0CU, 0x0CU, 0x01U, - 0x0CU, 0x88U, 0x30U, 0x00U, 0x00U, 0x1CU, 0x0EU, 0x04U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x08U, 0x44U, 0x14U, 0x00U, - 0x06U, 0x48U, 0xC7U, 0x04U, 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x02U, 0xC0U, 0x25U, 0x00U, 0x02U, 0xC0U, 0x35U, 0x01U, 0x02U, 0xC0U, 0x45U, 0x02U, - 0x02U, 0xC0U, 0x55U, 0x03U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x02U, 0xC0U, 0x25U, 0x04U, 0x02U, 0xC0U, 0x35U, 0x05U, 0x02U, 0xC0U, 0x45U, 0x06U, - 0x02U, 0xC0U, 0x55U, 0x07U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, - 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xBAU, 0x06U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x04U, 0x18U, 0x04U, 0x33U, 0x10U, 0x18U, 0x68U, 0x02U, 0x10U, 0x18U, 0x60U, 0x02U, 0x01U, 0x80U, 0x05U, 0x00U, - 0x01U, 0xA4U, 0x05U, 0x01U, 0x01U, 0x84U, 0x05U, 0x02U, 0x01U, 0xB0U, 0x05U, 0x03U, 0x10U, 0x04U, 0x14U, 0x06U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, - 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, - 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, - 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, - 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, - 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, - 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, - 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, - 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x02U, 0x44U, 0x3EU, 0x01U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, - 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, - 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, - 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, - 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, - 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, - 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, - 0x02U, 0x44U, 0x3EU, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, - 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, - 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, - 0x10U, 0xCCU, 0x70U, 0x4BU, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, - 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, - 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, - 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, 0x02U, 0x44U, 0x3EU, 0x01U, - 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, - 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, 0x02U, 0x44U, 0x3EU, 0x01U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, - 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, - 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, - 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, - 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, - 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, - 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, - 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, - 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x02U, 0x44U, 0x3EU, 0x01U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, - 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, - 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, - 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, - 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, - 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, - 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, - 0x02U, 0x44U, 0x3EU, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, - 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, - 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, - 0x10U, 0xCCU, 0x70U, 0x4BU, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, - 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, - 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, - 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, 0x02U, 0x44U, 0x3EU, 0x01U, - 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, - 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, 0x02U, 0x44U, 0x3EU, 0x01U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x42U, 0x07U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, - 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x1AU, 0x11U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x33U, 0x10U, 0x18U, 0x68U, 0x02U, - 0x10U, 0x18U, 0x60U, 0x02U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, - 0x10U, 0x04U, 0x14U, 0x06U, 0x00U, 0x08U, 0x26U, 0x05U, 0x00U, 0x0CU, 0x0CU, 0x01U, 0x0CU, 0x88U, 0x30U, 0x00U, - 0x00U, 0x1CU, 0x0EU, 0x04U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x24U, 0x10U, 0xCCU, 0x40U, 0x45U, 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x28U, - 0x10U, 0xCCU, 0x40U, 0x48U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x10U, 0x90U, 0x40U, 0x30U, 0x10U, 0xCCU, 0x40U, 0x4BU, - 0x02U, 0xC0U, 0x35U, 0x00U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, - 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x48U, 0x50U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x0DU, 0x90U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x53U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x24U, 0x10U, 0xCCU, 0x40U, 0x55U, 0x02U, 0xC0U, 0x35U, 0x01U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x10U, 0x90U, 0x40U, 0x30U, 0x10U, 0xCCU, 0x48U, 0x45U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0xCCU, 0x48U, 0x43U, 0x00U, 0x10U, 0x84U, 0x0FU, - 0x10U, 0x90U, 0x40U, 0x38U, 0x10U, 0xCCU, 0x48U, 0x40U, 0x02U, 0xC0U, 0x35U, 0x02U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x24U, - 0x10U, 0xCCU, 0x40U, 0x45U, 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x28U, 0x10U, 0xCCU, 0x40U, 0x48U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x10U, 0x90U, 0x40U, 0x30U, 0x10U, 0xCCU, 0x40U, 0x4BU, 0x02U, 0xC0U, 0x35U, 0x03U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x00U, 0x10U, 0x84U, 0x0FU, - 0x10U, 0x90U, 0x40U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x48U, 0x50U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x0DU, 0x90U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x53U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x24U, - 0x10U, 0xCCU, 0x40U, 0x55U, 0x02U, 0xC0U, 0x35U, 0x04U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x10U, 0x90U, 0x40U, 0x30U, 0x10U, 0xCCU, 0x48U, 0x45U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0xCCU, 0x48U, 0x43U, 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x38U, - 0x10U, 0xCCU, 0x48U, 0x40U, 0x02U, 0xC0U, 0x35U, 0x05U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x0DU, 0x8CU, 0x40U, 0x03U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x24U, 0x10U, 0xCCU, 0x40U, 0x45U, - 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x28U, 0x10U, 0xCCU, 0x40U, 0x48U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x10U, 0x90U, 0x40U, 0x30U, 0x10U, 0xCCU, 0x40U, 0x4BU, 0x02U, 0xC0U, 0x35U, 0x06U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x38U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x48U, 0x50U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x0DU, 0x90U, 0x40U, 0x00U, - 0x10U, 0xCCU, 0x40U, 0x53U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x24U, 0x10U, 0xCCU, 0x40U, 0x55U, - 0x02U, 0xC0U, 0x35U, 0x07U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x10U, 0x90U, 0x40U, 0x30U, 0x10U, 0xCCU, 0x48U, 0x45U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0xCCU, 0x48U, 0x43U, 0x00U, 0x10U, 0x84U, 0x0FU, - 0x10U, 0x90U, 0x40U, 0x38U, 0x10U, 0xCCU, 0x48U, 0x40U, 0x02U, 0xC0U, 0x35U, 0x00U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x24U, - 0x10U, 0xCCU, 0x40U, 0x45U, 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x28U, 0x10U, 0xCCU, 0x40U, 0x48U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x10U, 0x90U, 0x40U, 0x30U, 0x10U, 0xCCU, 0x40U, 0x4BU, 0x02U, 0xC0U, 0x35U, 0x01U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x00U, 0x10U, 0x84U, 0x0FU, - 0x10U, 0x90U, 0x40U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x48U, 0x50U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x0DU, 0x90U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x53U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x24U, - 0x10U, 0xCCU, 0x40U, 0x55U, 0x02U, 0xC0U, 0x35U, 0x02U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x10U, 0x90U, 0x40U, 0x30U, 0x10U, 0xCCU, 0x48U, 0x45U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0xCCU, 0x48U, 0x43U, 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x38U, - 0x10U, 0xCCU, 0x48U, 0x40U, 0x02U, 0xC0U, 0x35U, 0x03U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x0DU, 0x8CU, 0x40U, 0x03U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x24U, 0x10U, 0xCCU, 0x40U, 0x45U, - 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x28U, 0x10U, 0xCCU, 0x40U, 0x48U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x10U, 0x90U, 0x40U, 0x30U, 0x10U, 0xCCU, 0x40U, 0x4BU, 0x02U, 0xC0U, 0x35U, 0x04U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x38U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x48U, 0x50U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x0DU, 0x90U, 0x40U, 0x00U, - 0x10U, 0xCCU, 0x40U, 0x53U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x24U, 0x10U, 0xCCU, 0x40U, 0x55U, - 0x02U, 0xC0U, 0x35U, 0x05U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x10U, 0x90U, 0x40U, 0x30U, 0x10U, 0xCCU, 0x48U, 0x45U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, - 0x10U, 0xCCU, 0x48U, 0x43U, 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x38U, 0x10U, 0xCCU, 0x48U, 0x40U, - 0x02U, 0xC0U, 0x35U, 0x06U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x24U, 0x10U, 0xCCU, 0x40U, 0x45U, 0x00U, 0x10U, 0x84U, 0x0FU, - 0x10U, 0x90U, 0x40U, 0x28U, 0x10U, 0xCCU, 0x40U, 0x48U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x10U, 0x90U, 0x40U, 0x30U, - 0x10U, 0xCCU, 0x40U, 0x4BU, 0x02U, 0xC0U, 0x35U, 0x07U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x00U, 0x10U, 0x84U, 0x0FU, - 0x10U, 0x90U, 0x40U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x48U, 0x50U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x0DU, 0x90U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x53U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x24U, - 0x10U, 0xCCU, 0x40U, 0x55U, 0x02U, 0xC0U, 0x35U, 0x00U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x10U, 0x90U, 0x40U, 0x30U, 0x10U, 0xCCU, 0x48U, 0x45U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0xCCU, 0x48U, 0x43U, 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x38U, - 0x10U, 0xCCU, 0x48U, 0x40U, 0x02U, 0xC0U, 0x35U, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x0DU, 0x8CU, 0x40U, 0x03U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x24U, 0x10U, 0xCCU, 0x40U, 0x45U, - 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x28U, 0x10U, 0xCCU, 0x40U, 0x48U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x10U, 0x90U, 0x40U, 0x30U, 0x10U, 0xCCU, 0x40U, 0x4BU, 0x02U, 0xC0U, 0x35U, 0x02U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x38U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x48U, 0x50U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x0DU, 0x90U, 0x40U, 0x00U, - 0x10U, 0xCCU, 0x40U, 0x53U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x24U, 0x10U, 0xCCU, 0x40U, 0x55U, - 0x02U, 0xC0U, 0x35U, 0x03U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x10U, 0x90U, 0x40U, 0x30U, 0x10U, 0xCCU, 0x48U, 0x45U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, - 0x10U, 0xCCU, 0x48U, 0x43U, 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x38U, 0x10U, 0xCCU, 0x48U, 0x40U, - 0x02U, 0xC0U, 0x35U, 0x04U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x24U, 0x10U, 0xCCU, 0x40U, 0x45U, 0x00U, 0x10U, 0x84U, 0x0FU, - 0x10U, 0x90U, 0x40U, 0x28U, 0x10U, 0xCCU, 0x40U, 0x48U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x10U, 0x90U, 0x40U, 0x30U, - 0x10U, 0xCCU, 0x40U, 0x4BU, 0x02U, 0xC0U, 0x35U, 0x05U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, - 0x10U, 0x0CU, 0x48U, 0x13U, 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x10U, 0xCCU, 0x48U, 0x50U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x0DU, 0x90U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x53U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x24U, 0x10U, 0xCCU, 0x40U, 0x55U, 0x02U, 0xC0U, 0x35U, 0x06U, - 0x00U, 0x10U, 0x86U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x10U, 0x90U, 0x40U, 0x30U, - 0x10U, 0xCCU, 0x48U, 0x45U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0xCCU, 0x48U, 0x43U, - 0x00U, 0x10U, 0x84U, 0x0FU, 0x10U, 0x90U, 0x40U, 0x38U, 0x10U, 0xCCU, 0x48U, 0x40U, 0x02U, 0xC0U, 0x35U, 0x07U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xD2U, 0x11U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xE2U, 0x1BU, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x33U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, 0x10U, 0x04U, 0x14U, 0x07U, - 0x00U, 0x18U, 0xFEU, 0x8FU, 0x00U, 0x08U, 0x26U, 0x05U, 0x00U, 0x0CU, 0x0CU, 0x01U, 0x0CU, 0x88U, 0x30U, 0x00U, - 0x00U, 0x1CU, 0x0EU, 0x04U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0xC7U, 0x1BU, - 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x00U, 0x02U, 0xC0U, 0x35U, 0x01U, - 0x02U, 0xC0U, 0x45U, 0x02U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x03U, - 0x02U, 0xC0U, 0x35U, 0x04U, 0x02U, 0xC0U, 0x45U, 0x05U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, - 0x02U, 0xC0U, 0x25U, 0x06U, 0x02U, 0xC0U, 0x35U, 0x07U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x02U, 0xC0U, 0x45U, 0x00U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x01U, - 0x02U, 0xC0U, 0x35U, 0x02U, 0x02U, 0xC0U, 0x45U, 0x03U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, - 0x02U, 0xC0U, 0x25U, 0x04U, 0x02U, 0xC0U, 0x35U, 0x05U, 0x02U, 0xC0U, 0x45U, 0x06U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x07U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x02U, 0xC0U, 0x35U, 0x00U, 0x02U, 0xC0U, 0x45U, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, - 0x02U, 0xC0U, 0x25U, 0x02U, 0x02U, 0xC0U, 0x35U, 0x03U, 0x02U, 0xC0U, 0x45U, 0x04U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x05U, 0x02U, 0xC0U, 0x35U, 0x06U, 0x02U, 0xC0U, 0x45U, 0x07U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x32U, 0x20U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x33U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0xB0U, 0x05U, 0x02U, 0x10U, 0x04U, 0x14U, 0x07U, 0x00U, 0x18U, 0xFEU, 0x8FU, 0x00U, 0x08U, 0x26U, 0x05U, - 0x00U, 0x0CU, 0x0CU, 0x01U, 0x0CU, 0x88U, 0x30U, 0x00U, 0x00U, 0x1CU, 0x0EU, 0x04U, 0x0CU, 0xDCU, 0x21U, 0x00U, - 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0xC7U, 0x21U, 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x00U, - 0x02U, 0xC0U, 0x35U, 0x01U, 0x02U, 0xC0U, 0x45U, 0x02U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x03U, - 0x02U, 0xC0U, 0x35U, 0x04U, 0x02U, 0xC0U, 0x45U, 0x05U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x06U, - 0x02U, 0xC0U, 0x35U, 0x07U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x02U, 0xC0U, 0x45U, 0x00U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x01U, 0x02U, 0xC0U, 0x35U, 0x02U, 0x02U, 0xC0U, 0x45U, 0x03U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x04U, 0x02U, 0xC0U, 0x35U, 0x05U, 0x02U, 0xC0U, 0x45U, 0x06U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x07U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x02U, 0xC0U, 0x35U, 0x00U, 0x02U, 0xC0U, 0x45U, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x02U, - 0x02U, 0xC0U, 0x35U, 0x03U, 0x02U, 0xC0U, 0x45U, 0x04U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x05U, - 0x02U, 0xC0U, 0x35U, 0x06U, 0x02U, 0xC0U, 0x45U, 0x07U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x42U, 0x25U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x33U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, 0x00U, 0x18U, 0xFEU, 0x8FU, - 0x06U, 0x00U, 0x10U, 0x00U, 0x10U, 0x04U, 0x14U, 0x07U, 0x00U, 0x08U, 0x26U, 0x05U, 0x00U, 0x0CU, 0x0CU, 0x01U, - 0x0CU, 0x88U, 0x30U, 0x00U, 0x00U, 0x1CU, 0x0EU, 0x04U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x08U, 0x44U, 0x14U, 0x00U, - 0x06U, 0x48U, 0xC7U, 0x21U, 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, - 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x00U, 0x02U, 0xC0U, 0x35U, 0x01U, - 0x02U, 0xC0U, 0x45U, 0x02U, 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, - 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x03U, 0x02U, 0xC0U, 0x35U, 0x04U, - 0x02U, 0xC0U, 0x45U, 0x05U, 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, - 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x06U, 0x02U, 0xC0U, 0x35U, 0x07U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x02U, 0xC0U, 0x45U, 0x00U, 0x01U, 0x08U, 0x14U, 0xFFU, - 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, - 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, - 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, - 0x02U, 0xC0U, 0x25U, 0x01U, 0x02U, 0xC0U, 0x35U, 0x02U, 0x02U, 0xC0U, 0x45U, 0x03U, 0x01U, 0x08U, 0x14U, 0xFFU, - 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, - 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, - 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, - 0x02U, 0xC0U, 0x25U, 0x04U, 0x02U, 0xC0U, 0x35U, 0x05U, 0x02U, 0xC0U, 0x45U, 0x06U, 0x01U, 0x08U, 0x14U, 0xFFU, - 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, - 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, - 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, - 0x02U, 0xC0U, 0x25U, 0x07U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x02U, 0xC0U, 0x35U, 0x00U, - 0x02U, 0xC0U, 0x45U, 0x01U, 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, - 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x02U, 0x02U, 0xC0U, 0x35U, 0x03U, - 0x02U, 0xC0U, 0x45U, 0x04U, 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, - 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, 0x02U, 0xC0U, 0x25U, 0x05U, 0x02U, 0xC0U, 0x35U, 0x06U, - 0x02U, 0xC0U, 0x45U, 0x07U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, - 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x5AU, 0x2AU, 0x00U}; - -const uint32_t s_smartdmaDisplayFirmwareSize = sizeof(s_smartdmaDisplayFirmware); - -const uint8_t s_smartdmaCameraFirmware[] = { - 0x21U, 0x00U, 0x00U, 0x04U, 0x01U, 0x01U, 0x00U, 0x04U, 0x01U, 0x03U, 0x00U, 0x04U, 0xE1U, 0x03U, 0x00U, 0x04, - 0x21U, 0x05U, 0x00U, 0x04U, 0x21U, 0x07U, 0x00U, 0x04U, 0x21U, 0x09U, 0x00U, 0x04U, 0x00U, 0x00U, 0x00U, 0x00, - 0x12U, 0x00U, 0x00U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00, - 0x04U, 0x18U, 0x04U, 0x33U, 0x10U, 0x18U, 0x68U, 0x02U, 0x10U, 0x18U, 0x60U, 0x02U, 0x01U, 0xB0U, 0x05U, 0x00, - 0x01U, 0x8CU, 0x05U, 0x01U, 0x01U, 0x68U, 0x07U, 0x01U, 0x01U, 0x6CU, 0x07U, 0x01U, 0x06U, 0x74U, 0x47U, 0x00, - 0x00U, 0x88U, 0x00U, 0x00U, 0x01U, 0x92U, 0x6CU, 0xDBU, 0x18U, 0x64U, 0x02U, 0x20U, 0x18U, 0x64U, 0x02U, 0x21, - 0x18U, 0x64U, 0x02U, 0x22U, 0x18U, 0x64U, 0x02U, 0x23U, 0x18U, 0x64U, 0x02U, 0x24U, 0x18U, 0x64U, 0x02U, 0x25, - 0x18U, 0x64U, 0x02U, 0x26U, 0x18U, 0x64U, 0x02U, 0x27U, 0x18U, 0x64U, 0x02U, 0xD2U, 0x00U, 0x04U, 0xF4U, 0x0F, - 0x1CU, 0x36U, 0xD0U, 0x04U, 0x18U, 0x20U, 0x02U, 0xF2U, 0x18U, 0xECU, 0x02U, 0xC2U, 0xB3U, 0x00U, 0x00U, 0x04, - 0xCFU, 0x00U, 0x00U, 0x04U, 0x18U, 0x20U, 0x02U, 0xF2U, 0x10U, 0x40U, 0xE8U, 0x20U, 0x02U, 0xC4U, 0x08U, 0x01, - 0x08U, 0x76U, 0x87U, 0x02U, 0x18U, 0x20U, 0x02U, 0xF2U, 0x12U, 0x00U, 0x00U, 0x00U, 0x83U, 0x00U, 0x00U, 0x04, - 0x18U, 0xECU, 0x02U, 0xC0U, 0x18U, 0xECU, 0x02U, 0xC1U, 0x18U, 0xECU, 0x02U, 0xC2U, 0x01U, 0x8CU, 0x05U, 0x01, - 0x18U, 0x20U, 0x02U, 0xF2U, 0x14U, 0x11U, 0x00U, 0x00U, 0x83U, 0x00U, 0x00U, 0x04U, 0x18U, 0xCCU, 0x00U, 0x20, - 0x18U, 0xCCU, 0x00U, 0x21U, 0x18U, 0xECU, 0x02U, 0xC1U, 0x18U, 0xECU, 0x02U, 0xC2U, 0x18U, 0x20U, 0x02U, 0xF2, - 0x83U, 0x00U, 0x00U, 0x04U, 0x70U, 0x47U, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBF, - 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBF, - 0x12U, 0x00U, 0x00U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00, - 0x04U, 0x18U, 0x04U, 0x33U, 0x10U, 0x18U, 0x68U, 0x02U, 0x10U, 0x18U, 0x60U, 0x02U, 0x01U, 0xB0U, 0x05U, 0x00, - 0x01U, 0x8CU, 0x05U, 0x03U, 0x01U, 0x68U, 0x07U, 0x01U, 0x01U, 0x6CU, 0x07U, 0x01U, 0x06U, 0x74U, 0x47U, 0x00, - 0x00U, 0x88U, 0x00U, 0x00U, 0x01U, 0x92U, 0x6CU, 0xDBU, 0x18U, 0x64U, 0x02U, 0x20U, 0x18U, 0x64U, 0x02U, 0x21, - 0x18U, 0x64U, 0x02U, 0x22U, 0x18U, 0x64U, 0x02U, 0x23U, 0x18U, 0x64U, 0x02U, 0x24U, 0x18U, 0x64U, 0x02U, 0x25, - 0x18U, 0x64U, 0x02U, 0x26U, 0x18U, 0x64U, 0x02U, 0x27U, 0x18U, 0x64U, 0x02U, 0xD2U, 0x00U, 0x08U, 0x14U, 0x00, - 0x00U, 0x14U, 0x04U, 0x00U, 0x1CU, 0x36U, 0xD0U, 0x04U, 0x0DU, 0x80U, 0xF7U, 0x0FU, 0x18U, 0xECU, 0x02U, 0xC2, - 0x87U, 0x01U, 0x00U, 0x04U, 0xA7U, 0x01U, 0x00U, 0x04U, 0x08U, 0x76U, 0xC7U, 0x01U, 0x02U, 0xC4U, 0x08U, 0x01, - 0x18U, 0x20U, 0x02U, 0xF2U, 0x18U, 0xECU, 0x02U, 0xC0U, 0x00U, 0x08U, 0x14U, 0x00U, 0x00U, 0x14U, 0x04U, 0x00, - 0x18U, 0xECU, 0x02U, 0xC1U, 0x18U, 0xECU, 0x02U, 0xC2U, 0x01U, 0x8CU, 0x05U, 0x03U, 0x18U, 0x20U, 0x02U, 0xF2, - 0x67U, 0x01U, 0x00U, 0x04U, 0x18U, 0xCCU, 0x00U, 0x20U, 0x18U, 0xCCU, 0x00U, 0x21U, 0x00U, 0x14U, 0x04U, 0x00, - 0x0DU, 0x88U, 0xF4U, 0x1FU, 0x01U, 0x90U, 0x05U, 0x02U, 0x0EU, 0x82U, 0xF4U, 0x00U, 0x20U, 0x04U, 0x04U, 0x00, - 0x22U, 0x00U, 0x15U, 0x00U, 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0xE4U, 0x01U, 0x20U, 0x04U, 0x14U, 0x00, - 0x22U, 0x00U, 0x15U, 0x00U, 0x21U, 0x8CU, 0x05U, 0x03U, 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0xD4U, 0x02, - 0x20U, 0x04U, 0x24U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0xC4U, 0x03, - 0x20U, 0x04U, 0x34U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x21U, 0x8CU, 0x05U, 0x03U, 0x25U, 0x44U, 0x00U, 0x33, - 0x0EU, 0x82U, 0xB4U, 0x04U, 0x20U, 0x04U, 0x44U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x25U, 0x44U, 0x00U, 0x33, - 0x0EU, 0x82U, 0xA4U, 0x05U, 0x20U, 0x04U, 0x54U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x21U, 0x8CU, 0x05U, 0x03, - 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x94U, 0x06U, 0x20U, 0x04U, 0x64U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00, - 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x84U, 0x07U, 0x20U, 0x04U, 0x74U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00, - 0x21U, 0x8CU, 0x05U, 0x03U, 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x74U, 0x08U, 0x20U, 0x04U, 0x84U, 0x00, - 0x22U, 0x00U, 0x15U, 0x00U, 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x64U, 0x09U, 0x20U, 0x04U, 0x94U, 0x00, - 0x22U, 0x00U, 0x15U, 0x00U, 0x21U, 0x8CU, 0x05U, 0x03U, 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x54U, 0x0A, - 0x20U, 0x04U, 0xA4U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x44U, 0x0B, - 0x20U, 0x04U, 0xB4U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x21U, 0x8CU, 0x05U, 0x03U, 0x25U, 0x44U, 0x00U, 0x33, - 0x0EU, 0x82U, 0x34U, 0x0CU, 0x20U, 0x04U, 0xC4U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x25U, 0x44U, 0x00U, 0x33, - 0x0EU, 0x82U, 0x24U, 0x0DU, 0x20U, 0x04U, 0xD4U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x21U, 0x8CU, 0x05U, 0x03, - 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x14U, 0x0EU, 0x20U, 0x04U, 0xE4U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00, - 0x25U, 0x44U, 0x00U, 0x33U, 0x18U, 0xECU, 0x02U, 0xC1U, 0x18U, 0xECU, 0x02U, 0xC2U, 0x0EU, 0x82U, 0x04U, 0x0F, - 0x20U, 0x04U, 0xF4U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x21U, 0x8CU, 0x05U, 0x03U, 0x25U, 0x44U, 0x00U, 0x33, - 0x38U, 0xECU, 0x02U, 0x21U, 0x38U, 0xECU, 0x02U, 0x22U, 0x06U, 0x88U, 0x14U, 0x00U, 0x18U, 0x20U, 0x02U, 0xF2, - 0x67U, 0x01U, 0x00U, 0x04U, 0x70U, 0x47U, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBF, - 0x12U, 0x00U, 0x00U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00, - 0x04U, 0x18U, 0x04U, 0x33U, 0x10U, 0x18U, 0x68U, 0x02U, 0x10U, 0x18U, 0x60U, 0x02U, 0x01U, 0xB0U, 0x05U, 0x00, - 0x01U, 0x8CU, 0x05U, 0x01U, 0x01U, 0x68U, 0x07U, 0x01U, 0x01U, 0x6CU, 0x07U, 0x01U, 0x06U, 0x74U, 0x47U, 0x00, - 0x00U, 0x88U, 0x00U, 0x00U, 0x01U, 0x92U, 0x6CU, 0xDBU, 0x18U, 0x64U, 0x02U, 0x20U, 0x18U, 0x64U, 0x02U, 0x21, - 0x18U, 0x64U, 0x02U, 0x22U, 0x18U, 0x64U, 0x02U, 0x23U, 0x18U, 0x64U, 0x02U, 0x24U, 0x18U, 0x64U, 0x02U, 0x25, - 0x18U, 0x64U, 0x02U, 0x26U, 0x18U, 0x64U, 0x02U, 0x27U, 0x18U, 0x64U, 0x02U, 0xD2U, 0x00U, 0x04U, 0xF4U, 0x0F, - 0x1CU, 0x36U, 0xD0U, 0x04U, 0x10U, 0x40U, 0xE8U, 0x20U, 0x18U, 0xECU, 0x02U, 0xC2U, 0x8BU, 0x03U, 0x00U, 0x04, - 0xABU, 0x03U, 0x00U, 0x04U, 0x08U, 0xBEU, 0x04U, 0x3CU, 0x82U, 0xC4U, 0x08U, 0x01U, 0x08U, 0x76U, 0x47U, 0x02, - 0x98U, 0x20U, 0x02U, 0xF2U, 0x06U, 0x88U, 0x14U, 0x00U, 0x18U, 0xECU, 0x02U, 0xC0U, 0x18U, 0xECU, 0x02U, 0xC1, - 0x01U, 0x8CU, 0x05U, 0x01U, 0x00U, 0x08U, 0x04U, 0x00U, 0x00U, 0x10U, 0x04U, 0x00U, 0x18U, 0x20U, 0x02U, 0xF2, - 0x05U, 0x44U, 0x00U, 0x33U, 0x63U, 0x03U, 0x00U, 0x04U, 0x18U, 0xECU, 0x02U, 0xC1U, 0x06U, 0x10U, 0x15U, 0x00, - 0x08U, 0x3EU, 0x05U, 0x05U, 0xB8U, 0xECU, 0x02U, 0xC2U, 0x08U, 0x3EU, 0x05U, 0x19U, 0xB8U, 0xECU, 0x02U, 0x22, - 0x00U, 0x08U, 0x04U, 0x00U, 0x63U, 0x03U, 0x00U, 0x04U, 0x70U, 0x47U, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBF, - 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBF, - 0x12U, 0x00U, 0x00U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00, - 0x04U, 0x18U, 0x04U, 0x33U, 0x10U, 0x18U, 0x68U, 0x02U, 0x10U, 0x18U, 0x60U, 0x02U, 0x01U, 0xB0U, 0x05U, 0x00, - 0x01U, 0x8CU, 0x05U, 0x03U, 0x01U, 0x68U, 0x07U, 0x01U, 0x01U, 0x6CU, 0x07U, 0x01U, 0x06U, 0x74U, 0x47U, 0x00, - 0x00U, 0x88U, 0x00U, 0x00U, 0x01U, 0x92U, 0x6CU, 0xDBU, 0x18U, 0x64U, 0x02U, 0x20U, 0x18U, 0x64U, 0x02U, 0x21, - 0x18U, 0x64U, 0x02U, 0x22U, 0x18U, 0x64U, 0x02U, 0x23U, 0x18U, 0x64U, 0x02U, 0x24U, 0x18U, 0x64U, 0x02U, 0x25, - 0x18U, 0x64U, 0x02U, 0x26U, 0x18U, 0x64U, 0x02U, 0x27U, 0x18U, 0x64U, 0x02U, 0xD2U, 0x00U, 0x14U, 0xF4U, 0x0F, - 0x1CU, 0x36U, 0xD0U, 0x04U, 0x10U, 0x40U, 0xE9U, 0x20U, 0x18U, 0xECU, 0x02U, 0xC2U, 0x73U, 0x04U, 0x00U, 0x04, - 0x8FU, 0x04U, 0x00U, 0x04U, 0x1CU, 0x36U, 0xD0U, 0x04U, 0x10U, 0x40U, 0xE9U, 0x20U, 0x18U, 0xECU, 0x02U, 0xC2, - 0x73U, 0x04U, 0x00U, 0x04U, 0x8FU, 0x04U, 0x00U, 0x04U, 0x02U, 0xC4U, 0x08U, 0x01U, 0x43U, 0x04U, 0x00U, 0x04, - 0x18U, 0xECU, 0x02U, 0xC0U, 0x00U, 0x08U, 0x14U, 0x00U, 0x18U, 0xECU, 0x02U, 0xC1U, 0x18U, 0xECU, 0x02U, 0xC2, - 0x01U, 0x8CU, 0x05U, 0x03U, 0x18U, 0x20U, 0x02U, 0xF2U, 0x43U, 0x04U, 0x00U, 0x04U, 0x18U, 0xCCU, 0x00U, 0x20, - 0x18U, 0xCCU, 0x00U, 0x21U, 0x0DU, 0x88U, 0xF4U, 0x1FU, 0x01U, 0x90U, 0x05U, 0x02U, 0x0EU, 0x82U, 0xC4U, 0x03, - 0x20U, 0x04U, 0x04U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x84U, 0x07, - 0x20U, 0x04U, 0x14U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x21U, 0x8CU, 0x05U, 0x03U, 0x25U, 0x44U, 0x00U, 0x33, - 0x0EU, 0x82U, 0x44U, 0x0BU, 0x20U, 0x04U, 0x24U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x25U, 0x44U, 0x00U, 0x33, - 0x18U, 0xECU, 0x02U, 0xC1U, 0x18U, 0xECU, 0x02U, 0xC2U, 0x0EU, 0x82U, 0x04U, 0x0FU, 0x20U, 0x04U, 0x34U, 0x00, - 0x22U, 0x00U, 0x15U, 0x00U, 0x21U, 0x8CU, 0x05U, 0x03U, 0x25U, 0x44U, 0x00U, 0x33U, 0x38U, 0xECU, 0x02U, 0x21, - 0x38U, 0xECU, 0x02U, 0x22U, 0x06U, 0x88U, 0x14U, 0x00U, 0x18U, 0x20U, 0x02U, 0xF2U, 0x43U, 0x04U, 0x00U, 0x04, - 0x70U, 0x47U, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBF, - 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBF, - 0x12U, 0x00U, 0x00U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00, - 0x04U, 0x18U, 0x04U, 0x33U, 0x10U, 0x18U, 0x68U, 0x02U, 0x10U, 0x18U, 0x60U, 0x02U, 0x01U, 0xB0U, 0x05U, 0x00, - 0x01U, 0x8CU, 0x05U, 0x03U, 0x01U, 0x68U, 0x07U, 0x01U, 0x01U, 0x6CU, 0x07U, 0x01U, 0x06U, 0x74U, 0x47U, 0x00, - 0x00U, 0x88U, 0x00U, 0x00U, 0x01U, 0x92U, 0x6CU, 0xDBU, 0x18U, 0x64U, 0x02U, 0x20U, 0x18U, 0x64U, 0x02U, 0x21, - 0x18U, 0x64U, 0x02U, 0x22U, 0x18U, 0x64U, 0x02U, 0x23U, 0x18U, 0x64U, 0x02U, 0x24U, 0x18U, 0x64U, 0x02U, 0x25, - 0x18U, 0x64U, 0x02U, 0x26U, 0x18U, 0x64U, 0x02U, 0x27U, 0x18U, 0x64U, 0x02U, 0xD2U, 0x00U, 0x14U, 0xF4U, 0x0F, - 0x1CU, 0x36U, 0xD0U, 0x04U, 0x10U, 0x40U, 0xE9U, 0x20U, 0x18U, 0xECU, 0x02U, 0xC2U, 0xB3U, 0x05U, 0x00U, 0x04, - 0xCFU, 0x05U, 0x00U, 0x04U, 0x1CU, 0x36U, 0xD0U, 0x04U, 0x10U, 0x40U, 0xE9U, 0x20U, 0x18U, 0xECU, 0x02U, 0xC2, - 0xB3U, 0x05U, 0x00U, 0x04U, 0xCFU, 0x05U, 0x00U, 0x04U, 0x02U, 0xC4U, 0x08U, 0x01U, 0x83U, 0x05U, 0x00U, 0x04, - 0x18U, 0xECU, 0x02U, 0xC0U, 0x00U, 0x08U, 0x14U, 0x00U, 0x18U, 0xECU, 0x02U, 0xC1U, 0x18U, 0xECU, 0x02U, 0xC2, - 0x01U, 0x8CU, 0x05U, 0x03U, 0x18U, 0x20U, 0x02U, 0xF2U, 0x83U, 0x05U, 0x00U, 0x04U, 0x18U, 0xCCU, 0x00U, 0x20, - 0x18U, 0xCCU, 0x00U, 0x21U, 0x0DU, 0x88U, 0xF4U, 0x1FU, 0x01U, 0x90U, 0x05U, 0x02U, 0x0EU, 0x82U, 0xF4U, 0x00, - 0x20U, 0x04U, 0x04U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0xE4U, 0x01, - 0x20U, 0x04U, 0x14U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x21U, 0x8CU, 0x05U, 0x03U, 0x25U, 0x44U, 0x00U, 0x33, - 0x0EU, 0x82U, 0xD4U, 0x02U, 0x20U, 0x04U, 0x24U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x25U, 0x44U, 0x00U, 0x33, - 0x0EU, 0x82U, 0xC4U, 0x03U, 0x20U, 0x04U, 0x34U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x21U, 0x8CU, 0x05U, 0x03, - 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0xB4U, 0x04U, 0x20U, 0x04U, 0x44U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00, - 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0xA4U, 0x05U, 0x20U, 0x04U, 0x54U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00, - 0x21U, 0x8CU, 0x05U, 0x03U, 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x94U, 0x06U, 0x20U, 0x04U, 0x64U, 0x00, - 0x22U, 0x00U, 0x15U, 0x00U, 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x84U, 0x07U, 0x20U, 0x04U, 0x74U, 0x00, - 0x22U, 0x00U, 0x15U, 0x00U, 0x21U, 0x8CU, 0x05U, 0x03U, 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x74U, 0x08, - 0x20U, 0x04U, 0x84U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x64U, 0x09, - 0x20U, 0x04U, 0x94U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x21U, 0x8CU, 0x05U, 0x03U, 0x25U, 0x44U, 0x00U, 0x33, - 0x0EU, 0x82U, 0x54U, 0x0AU, 0x20U, 0x04U, 0xA4U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x25U, 0x44U, 0x00U, 0x33, - 0x0EU, 0x82U, 0x44U, 0x0BU, 0x20U, 0x04U, 0xB4U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x21U, 0x8CU, 0x05U, 0x03, - 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x34U, 0x0CU, 0x20U, 0x04U, 0xC4U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00, - 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x24U, 0x0DU, 0x20U, 0x04U, 0xD4U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00, - 0x21U, 0x8CU, 0x05U, 0x03U, 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x14U, 0x0EU, 0x20U, 0x04U, 0xE4U, 0x00, - 0x22U, 0x00U, 0x15U, 0x00U, 0x25U, 0x44U, 0x00U, 0x33U, 0x18U, 0xECU, 0x02U, 0xC1U, 0x18U, 0xECU, 0x02U, 0xC2, - 0x0EU, 0x82U, 0x04U, 0x0FU, 0x20U, 0x04U, 0xF4U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x21U, 0x8CU, 0x05U, 0x03, - 0x25U, 0x44U, 0x00U, 0x33U, 0x38U, 0xECU, 0x02U, 0x21U, 0x38U, 0xECU, 0x02U, 0x22U, 0x06U, 0x88U, 0x14U, 0x00, - 0x18U, 0x20U, 0x02U, 0xF2U, 0x83U, 0x05U, 0x00U, 0x04U, 0x70U, 0x47U, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBF, - 0x12U, 0x00U, 0x00U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00, - 0x04U, 0x18U, 0x04U, 0x33U, 0x10U, 0x18U, 0x68U, 0x02U, 0x10U, 0x18U, 0x60U, 0x02U, 0x01U, 0xB0U, 0x05U, 0x00, - 0x01U, 0x8CU, 0x05U, 0x03U, 0x01U, 0x68U, 0x07U, 0x01U, 0x01U, 0x6CU, 0x07U, 0x01U, 0x06U, 0x74U, 0x47U, 0x00, - 0x00U, 0x88U, 0x00U, 0x00U, 0x01U, 0x92U, 0x6CU, 0xDBU, 0x18U, 0x64U, 0x02U, 0x20U, 0x18U, 0x64U, 0x02U, 0x21, - 0x18U, 0x64U, 0x02U, 0x22U, 0x18U, 0x64U, 0x02U, 0x23U, 0x18U, 0x64U, 0x02U, 0x24U, 0x18U, 0x64U, 0x02U, 0x25, - 0x18U, 0x64U, 0x02U, 0x26U, 0x18U, 0x64U, 0x02U, 0x27U, 0x18U, 0x64U, 0x02U, 0xD2U, 0x00U, 0x14U, 0xF4U, 0x0F, - 0x1CU, 0x36U, 0xD0U, 0x04U, 0x10U, 0x40U, 0xE9U, 0x20U, 0x18U, 0xECU, 0x02U, 0xC2U, 0xABU, 0x07U, 0x00U, 0x04, - 0xCBU, 0x07U, 0x00U, 0x04U, 0x08U, 0xFEU, 0x05U, 0x30U, 0xC2U, 0xC4U, 0x08U, 0x01U, 0x08U, 0x76U, 0x47U, 0x02, - 0x06U, 0xDCU, 0x15U, 0x00U, 0x18U, 0x20U, 0x02U, 0xF2U, 0x18U, 0xECU, 0x02U, 0xC0U, 0x00U, 0x08U, 0x14U, 0x00, - 0x00U, 0x1CU, 0x04U, 0x00U, 0x18U, 0xECU, 0x02U, 0xC1U, 0x18U, 0xECU, 0x02U, 0xC2U, 0x01U, 0x8CU, 0x05U, 0x03, - 0x18U, 0x20U, 0x02U, 0xF2U, 0x83U, 0x07U, 0x00U, 0x04U, 0x00U, 0x1CU, 0x04U, 0x00U, 0x18U, 0xCCU, 0x00U, 0x20, - 0x18U, 0xCCU, 0x00U, 0x21U, 0x0DU, 0x88U, 0xF4U, 0x1FU, 0x01U, 0x90U, 0x05U, 0x02U, 0x0EU, 0x82U, 0x84U, 0x01, - 0x20U, 0x04U, 0x04U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x04U, 0x03, - 0x20U, 0x04U, 0x14U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x21U, 0x8CU, 0x05U, 0x03U, 0x25U, 0x44U, 0x00U, 0x33, - 0x0EU, 0x82U, 0x84U, 0x04U, 0x20U, 0x04U, 0x24U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x25U, 0x44U, 0x00U, 0x33, - 0x0EU, 0x82U, 0x04U, 0x06U, 0x20U, 0x04U, 0x34U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x21U, 0x8CU, 0x05U, 0x03, - 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x84U, 0x07U, 0x20U, 0x04U, 0x44U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00, - 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x04U, 0x09U, 0x20U, 0x04U, 0x54U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00, - 0x21U, 0x8CU, 0x05U, 0x03U, 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x84U, 0x0AU, 0x20U, 0x04U, 0x64U, 0x00, - 0x22U, 0x00U, 0x15U, 0x00U, 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x04U, 0x0CU, 0x20U, 0x04U, 0x74U, 0x00, - 0x22U, 0x00U, 0x15U, 0x00U, 0x21U, 0x8CU, 0x05U, 0x03U, 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x84U, 0x0D, - 0x20U, 0x04U, 0x84U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x04U, 0x0F, - 0x20U, 0x04U, 0x94U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x21U, 0x8CU, 0x05U, 0x03U, 0x25U, 0x44U, 0x00U, 0x33, - 0x0EU, 0x82U, 0x84U, 0x10U, 0x20U, 0x04U, 0xA4U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x25U, 0x44U, 0x00U, 0x33, - 0x0EU, 0x82U, 0x04U, 0x12U, 0x20U, 0x04U, 0xB4U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x21U, 0x8CU, 0x05U, 0x03, - 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x84U, 0x13U, 0x20U, 0x04U, 0xC4U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00, - 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x04U, 0x15U, 0x20U, 0x04U, 0xD4U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00, - 0x21U, 0x8CU, 0x05U, 0x03U, 0x25U, 0x44U, 0x00U, 0x33U, 0x0EU, 0x82U, 0x84U, 0x16U, 0x20U, 0x04U, 0xE4U, 0x00, - 0x22U, 0x00U, 0x15U, 0x00U, 0x25U, 0x44U, 0x00U, 0x33U, 0x18U, 0xECU, 0x02U, 0xC1U, 0x18U, 0xECU, 0x02U, 0xC2, - 0x0EU, 0x82U, 0x04U, 0x18U, 0x20U, 0x04U, 0xF4U, 0x00U, 0x22U, 0x00U, 0x15U, 0x00U, 0x21U, 0x8CU, 0x05U, 0x03, - 0x25U, 0x44U, 0x00U, 0x33U, 0x38U, 0xECU, 0x02U, 0x21U, 0x38U, 0xECU, 0x02U, 0x22U, 0x06U, 0x88U, 0x14U, 0x00, - 0x18U, 0x20U, 0x02U, 0xF2U, 0x83U, 0x07U, 0x00U, 0x04U, 0x70U, 0x47U, 0x00U, 0xBFU, 0x00U, 0xBFU, 0x00U, 0xBF, - 0x12U, 0x00U, 0x00U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00, - 0x04U, 0x18U, 0x04U, 0x33U, 0x10U, 0x18U, 0x68U, 0x02U, 0x10U, 0x18U, 0x60U, 0x02U, 0x01U, 0xB0U, 0x05U, 0x00, - 0x01U, 0x8CU, 0x05U, 0x01U, 0x01U, 0x68U, 0x07U, 0x01U, 0x01U, 0x6CU, 0x07U, 0x01U, 0x06U, 0x74U, 0x47U, 0x00, - 0x00U, 0x88U, 0x00U, 0x00U, 0x01U, 0x92U, 0x6CU, 0xDBU, 0x18U, 0x64U, 0x02U, 0x20U, 0x18U, 0x64U, 0x02U, 0x21, - 0x18U, 0x64U, 0x02U, 0x22U, 0x18U, 0x64U, 0x02U, 0x23U, 0x18U, 0x64U, 0x02U, 0x24U, 0x18U, 0x64U, 0x02U, 0x25, - 0x18U, 0x64U, 0x02U, 0x26U, 0x18U, 0x64U, 0x02U, 0x27U, 0x18U, 0x64U, 0x02U, 0xD2U, 0x00U, 0x04U, 0xF4U, 0x0F, - 0x1CU, 0x36U, 0xD0U, 0x04U, 0x10U, 0x40U, 0xE8U, 0x20U, 0x18U, 0xECU, 0x02U, 0xC2U, 0xABU, 0x09U, 0x00U, 0x04, - 0xCBU, 0x09U, 0x00U, 0x04U, 0x08U, 0xBEU, 0x04U, 0x28U, 0x82U, 0xC4U, 0x08U, 0x01U, 0x08U, 0x76U, 0x47U, 0x02, - 0x98U, 0x20U, 0x02U, 0xF2U, 0x06U, 0x88U, 0x14U, 0x00U, 0x18U, 0xECU, 0x02U, 0xC0U, 0x18U, 0xECU, 0x02U, 0xC1, - 0x01U, 0x8CU, 0x05U, 0x01U, 0x00U, 0x08U, 0x04U, 0x00U, 0x00U, 0x10U, 0x04U, 0x00U, 0x18U, 0x20U, 0x02U, 0xF2, - 0x05U, 0x44U, 0x00U, 0x33U, 0x83U, 0x09U, 0x00U, 0x04U, 0x18U, 0xECU, 0x02U, 0xC1U, 0x06U, 0x10U, 0x15U, 0x00, - 0x08U, 0x3EU, 0x05U, 0x05U, 0xB8U, 0xECU, 0x02U, 0xC2U, 0x08U, 0x3EU, 0x05U, 0x23U, 0xB8U, 0xECU, 0x02U, 0x22, - 0x00U, 0x08U, 0x04U, 0x00U, 0x83U, 0x09U, 0x00U, 0x04U, 0x70U, 0x47U, 0x00U, 0x00U, -}; - -const uint32_t s_smartdmaCameraFirmwareSize = sizeof(s_smartdmaCameraFirmware); - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Codes - ******************************************************************************/ - -void SMARTDMA_IRQHandler(void); -void SMARTDMA_IRQHandler(void) -{ - SMARTDMA_HandleIRQ(); -} - -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartdma_mcxn.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartdma_mcxn.h deleted file mode 100644 index 50acc398315..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartdma_mcxn.h +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright 2019-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_SMARTDMA_MCXN_H_ -#define FSL_SMARTDMA_MCXN_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup smartdma_mcxn MCXN SMARTDMA Firmware - * @ingroup smartdma - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -#if defined(MCXN236_SERIES) || defined(MCXN235_SERIES) -#define SMARTDMA_USE_FLEXIO_SHIFTER_DMA 1 -#endif - -/*! @brief The firmware used for display. */ -extern const uint8_t s_smartdmaDisplayFirmware[]; - -/*! @brief The s_smartdmaDisplayFirmware firmware memory address. */ -#define SMARTDMA_DISPLAY_MEM_ADDR 0x04000000U - -/*! @brief Size of s_smartdmaDisplayFirmware */ -#define SMARTDMA_DISPLAY_FIRMWARE_SIZE (s_smartdmaDisplayFirmwareSize) - -/*! @brief Size of s_smartdmaDisplayFirmware */ -extern const uint32_t s_smartdmaDisplayFirmwareSize; - -/*! @brief The firmware used for camera. */ -extern const uint8_t s_smartdmaCameraFirmware[]; - -/*! @brief The s_smartdmaCameraFirmware firmware memory address. */ -#define SMARTDMA_CAMERA_MEM_ADDR 0x04000000U - -/*! @brief Size of s_smartdmacameraFirmware */ -#define SMARTDMA_CAMERA_FIRMWARE_SIZE (s_smartdmaCameraFirmwareSize) - -/*! @brief Size of s_smartdmacameraFirmware */ -extern const uint32_t s_smartdmaCameraFirmwareSize; - -/*! - * @brief The API index when using s_smartdmaDisplayFirmware. - */ -enum _smartdma_display_api -{ - kSMARTDMA_FlexIO_DMA_Endian_Swap = 0U, - kSMARTDMA_FlexIO_DMA_Reverse32, - kSMARTDMA_FlexIO_DMA, - kSMARTDMA_FlexIO_DMA_Reverse, /*!< Send data to FlexIO with reverse order. */ - kSMARTDMA_RGB565To888, /*!< Convert RGB565 to RGB888 and save to output memory, use parameter - smartdma_rgb565_rgb888_param_t. */ - kSMARTDMA_FlexIO_DMA_RGB565To888, /*!< Convert RGB565 to RGB888 and send to FlexIO, use parameter - smartdma_flexio_mculcd_param_t. */ - kSMARTDMA_FlexIO_DMA_ARGB2RGB, /*!< Convert ARGB to RGB and send to FlexIO, use parameter - smartdma_flexio_mculcd_param_t. */ - kSMARTDMA_FlexIO_DMA_ARGB2RGB_Endian_Swap, /*!< Convert ARGB to RGB, then swap endian, and send to FlexIO, use - parameter smartdma_flexio_mculcd_param_t. */ - kSMARTDMA_FlexIO_DMA_ARGB2RGB_Endian_Swap_Reverse, /*!< Convert ARGB to RGB, then swap endian and reverse, and send - to FlexIO, use parameter smartdma_flexio_mculcd_param_t. */ -}; - -/*! - * @brief Parameter for FlexIO MCULCD - */ -typedef struct _smartdma_flexio_mculcd_param -{ - uint32_t *p_buffer; - uint32_t buffersize; - uint32_t *smartdma_stack; -} smartdma_flexio_mculcd_param_t; - -/*! - * @brief Parameter for RGB565To888 - */ -typedef struct _smartdma_rgb565_rgb888_param -{ - uint32_t *inBuf; - uint32_t *outBuf; - uint32_t buffersize; - uint32_t *smartdma_stack; -} smartdma_rgb565_rgb888_param_t; - -/*! - * @brief The API index when using s_smartdmaCameraFirmware - */ -enum _smartdma_camera_api -{ - kSMARTDMA_FlexIO_CameraWholeFrame = 0U, /*! Deprecated. Use kSMARTDMA_CameraWholeFrameQVGA instead. */ - kSMARTDMA_FlexIO_CameraDiv16Frame = 1U, /*! Deprecated. Use kSMARTDMA_CameraDiv16FrameQVGA instead. */ - /*! Save whole frame of QVGA(320x240) to buffer in each interrupt in RGB565 format. */ - kSMARTDMA_CameraWholeFrameQVGA = 0U, - /*! Save 1/16 frame of QVGA(320x240) to buffer in each interrupt in RGB565 format, - takes 16 interrupts to get the whole frame. */ - kSMARTDMA_CameraDiv16FrameQVGA = 1U, - /*! Save whole frame of 480x320 to buffer in each interrupt in RGB565 format. */ - kSMARTDMA_CameraWholeFrame480_320 = 2U, - /*! Save 1/4 frame of QVGA(320x240) to buffer in each interrupt in grayscale format, - takes 4 interrupts to get the whole frame. */ - kSMARTDMA_CameraDiv4FrameQVGAGrayScale = 3U, - /*! Save 1/16 frame of QVGA(320x240) to buffer in each interrupt in grayscale format, - takes 16 interrupts to get the whole frame. */ - kSMARTDMA_CameraDiv16FrameQVGAGrayScale = 4U, - /*! Save 1/16 frame of 384x384 to buffer in each interrupt in grayscale format, - takes 16 interrupts to get the whole frame. */ - kSMARTDMA_CameraDiv16Frame384_384 = 5U, - /*! Save whole frame of 320x480 to buffer in each interrupt in RGB565 format. */ - kSMARTDMA_CameraWholeFrame320_480 = 6U, -}; - -/*! - * @brief Parameter for camera - */ -typedef struct _smartdma_camera_param -{ - uint32_t *smartdma_stack; /*!< Stack used by SMARTDMA, shall be at least 64 bytes. */ - uint32_t *p_buffer; /*!< Buffer to store the received camera data. */ - uint32_t *p_stripe_index; /*!< Pointer to stripe index. Used when only partial frame is received per interrupt. */ - uint32_t *p_buffer_ping_pong; /*!< Buffer to store the 2nd stripe of camera data. Used when only partial frame is - received per interrupt. */ -} smartdma_camera_param_t; - -/*! - * @brief Parameter for all supported APIs. - */ -typedef union -{ - smartdma_flexio_mculcd_param_t flexioMcuLcdParam; /*!< Parameter for flexio MCULCD. */ - smartdma_rgb565_rgb888_param_t rgb565_rgb888Param; /*!< Parameter for RGB565_RGB888 convertion. */ - smartdma_camera_param_t cameraParam; /*!< Parameter for camera. */ -} smartdma_param_t; - -/******************************************************************************* - * APIs - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -#if defined(__cplusplus) -} -#endif - -/*! @} */ - -#endif /* FSL_SMARTDMA_MCXN_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartdma_prv.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartdma_prv.h deleted file mode 100644 index f297aa0687a..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartdma_prv.h +++ /dev/null @@ -1,6058 +0,0 @@ -/* - * @brief IOH Architecture B mnemonics - * - * @note - * Copyright 2014, 2019, NXP - * All rights reserved. - * - * @par - * Software that is described herein is for illustrative purposes only - * which provides customers with programming information regarding the - * LPC products. This software is supplied "AS IS" without any warranties of - * any kind, and NXP Semiconductors and its licensor disclaim any and - * all warranties, express or implied, including all implied warranties of - * merchantability, fitness for a particular purpose and non-infringement of - * intellectual property rights. NXP Semiconductors assumes no responsibility - * or liability for the use of the software, conveys no license or rights under any - * patent, copyright, mask work right, or any other intellectual property rights in - * or to any products. NXP Semiconductors reserves the right to make changes - * in the software without notification. NXP Semiconductors also makes no - * representation or warranty that such application will be suitable for the - * specified use without further testing or modification. - * - * @par - * Permission to use, copy, modify, and distribute this software and its - * documentation is hereby granted, under NXP Semiconductors' and its - * licensor's relevant copyrights in the software, without fee, provided that it - * is used in conjunction with NXP Semiconductors microcontrollers. This - * copyright, permission, and disclaimer notice must appear in all copies of - * this code. - */ - -#ifndef FSL_SMARTDMA_PRV_H_ -#define FSL_SMARTDMA_PRV_H_ - -#include "fsl_common.h" - -#define SMARTDMA_INPUT_SOURCE_0 0 -#define SMARTDMA_INPUT_SOURCE_1 1 -#define SMARTDMA_INPUT_SOURCE_2 2 -#define SMARTDMA_INPUT_SOURCE_3 3 -#define SMARTDMA_INPUT_SOURCE_4 4 -#define SMARTDMA_INPUT_SOURCE_5 5 -#define SMARTDMA_INPUT_SOURCE_6 6 -#define SMARTDMA_INPUT_SOURCE_7 7 - -#define BS0(c) (c << 8) -#define BS1(c) (c << 11) -#define BS2(c) (c << 14) -#define BS3(c) (c << 17) -#define BS4(c) (c << 20) -#define BS5(c) (c << 23) -#define BS6(c) (c << 26) -#define BS7(c) (c << 29) - -#define SMARTDMA_DISABLE_EMERGENCY_BIT 8 - -#define SMARTDMA_HANDSHAKE_EVENT 0 -#define SMARTDMA_HANDSHAKE_ENABLE 1 - -#define SMARTDMA_MASK_RESP 2 -#define SMARTDMA_ENABLE_AHBBUF 3 -#define SMARTDMA_ENABLE_GPISYNCH 4 - -typedef enum -{ - ezh_trap_low = 1, - ezh_trap_high = 0 -} trap_pol; - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* SMARTDMA ARCH B */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -#define R0 0x00 -#define R1 0x01 -#define R2 0x02 -#define R3 0x03 -#define R4 0x04 -#define R5 0x05 -#define R6 0x06 -#define R7 0x07 -#define GPO 0x08 -#define GPD 0x09 -#define CFS 0x0a -#define CFM 0x0b -#define SP 0x0c -#define PC 0x0d -#define GPI 0x0e -#define RA 0x0f - -/* Conditional Flags */ -#define EU 0x0 -#define ZE 0x1 -#define NZ 0x2 -#define PO 0x3 -#define NE 0x4 -#define AZ 0x5 -#define ZB 0x6 -#define CA 0x7 -#define NC 0x8 -#define CZ 0x9 -#define SPO 0xa -#define SNE 0xb -#define NBS 0xc -#define NEX 0xd -#define BS 0xe -#define EX 0xf - -#define UNS 0xa -#define NZS 0xb - -#define VECT0 0x1 -#define VECT1 0x2 -#define VECT2 0x4 -#define VECT3 0x8 -#define VECT4 0x10 -#define VECT5 0x20 -#define VECT6 0x40 -#define VECT7 0x80 - -/* Bit Slice Mux cfg */ - -#define BS_1 0 -#define BS_RISE 1 -#define BS_FALL 2 -#define BS_CHANGE 3 -#define BS_SIG 4 -#define BS_SIGN 5 -#define BS_0 6 -#define BS_EVENT 7 - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* Unconditional OpCodes */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -#define E_GOSUB(a30) DCD 0x03 + a30 -#define E_NOP DCD 0x12 -#define E_INT_TRIGGER(x24) DCD 0x14 + (x24 << 8) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_GOTO */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* the pre-processor/linker will calculate it this way (<< relative not allowed) */ -#define E_GOTO(a21) \ - DCD 0x15 + (1 << 9) + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 - -#define E_GOTO_REG(raddr) DCD 0x15 + (raddr << 14) - -/* the pre-processor/linker will calculate it this way (<< relative not allowed) */ -#define E_GOTOL(a21) \ - DCD 0x15 + (1 << 10) + (1 << 9) + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 - -#define E_GOTO_REGL(raddr) DCD 0x15 + (raddr << 14) + (1 << 10) - -#define E_COND_GOTO(cond, a21) \ - DCD 0x15 + (cond << 5) + (1 << 9) + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 - -#define E_COND_GOTO_REG(cond, raddr) DCD 0x15 + (raddr << 14) + (cond << 5) - -/* the pre-processor/linker will calculate it this way (<< relative not allowed) */ -#define E_COND_GOTOL(cond, a21) \ - DCD 0x15 + (1 << 10) + (cond << 5) + (1 << 9) + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + \ - a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 + a21 - -#define E_COND_GOTO_REGL(cond, raddr) DCD 0x15 + (raddr << 14) + (1 << 10) + (cond << 5) -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_MOV */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -#define E_MOV(dest, source) DCD 0x0 + (source << 14) + (dest << 10) + (EU << 5) -#define E_MOVS(dest, source) DCD 0x0 + (source << 14) + (dest << 10) + (1 << 9) + (EU << 5) -#define E_COND_MOV(cond, dest, source) DCD 0x0 + (source << 14) + (dest << 10) + (cond << 5) -#define E_COND_MOVS(cond, dest, source) DCD 0x0 + (source << 14) + (dest << 10) + (1 << 9) + (cond << 5) - -/* Invert */ -#define E_MVN(dest, source) DCD 0x0 + (source << 14) + (dest << 10) + (EU << 5) + (1 << 31) -#define E_MVNS(dest, source) DCD 0x0 + (source << 14) + (dest << 10) + (1 << 9) + (EU << 5) + (1 << 31) -#define E_COND_MVN(cond, dest, source) DCD 0x0 + (source << 14) + (dest << 10) + (cond << 5) + (1 << 31) -#define E_COND_MVNS(cond, dest, source) DCD 0x0 + (source << 14) + (dest << 10) + (1 << 9) + (cond << 5) + (1 << 31) - -/* Load Immediate */ -#define E_LOAD_IMM(dest, imm11s) DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (EU << 5) -#define E_LOAD_IMMS(dest, imm11s) DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (1 << 9) + (EU << 5) -#define E_COND_LOAD_IMM(cond, dest, imm11s) DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (cond << 5) -#define E_COND_LOAD_IMMS(cond, dest, imm11s) \ - DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (1 << 9) + (cond << 5) - -/* Load Shifted Immediate */ -#define E_LOAD_SIMM(dest, imm11s, sam) \ - DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (EU << 5) + ((sam & 0xf) << 14) + \ - (((sam & 0x10) >> 4) << 19) -#define E_LOAD_SIMMS(dest, imm11s, sam) \ - DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (1 << 9) + (EU << 5) + ((sam & 0xf) << 14) + \ - (((sam & 0x10) >> 4) << 19) -#define E_COND_LOAD_SIMM(cond, dest, imm11s, sam) \ - DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (cond << 5) + ((sam & 0xf) << 14) + \ - (((sam & 0x10) >> 4) << 19) -#define E_COND_LOAD_SIMMS(cond, dest, imm11s, sam) \ - DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (1 << 9) + (cond << 5) + ((sam & 0xf) << 14) + \ - (((sam & 0x10) >> 4) << 19) - -/* Load Inverted Immediate */ -#define E_LOAD_IMMN(dest, imm11s) DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (EU << 5) + (1 << 31) -#define E_LOAD_IMMNS(dest, imm11s) \ - DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (1 << 9) + (EU << 5) + (1 << 31) -#define E_COND_LOAD_IMMN(cond, dest, imm11s) \ - DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (cond << 5) + (1 << 31) -#define E_COND_LOAD_IMMNS(cond, dest, imm11s) \ - DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (1 << 9) + (cond << 5) + (1 << 31) - -/* Load Shifted then inverted Immediate */ -#define E_LOAD_SIMMN(dest, imm11s, sam) \ - DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (EU << 5) + ((sam & 0xf) << 14) + \ - (((sam & 0x10) >> 4) << 19) + (1 << 31) -#define E_LOAD_SIMMNS(dest, imm11s, sam) \ - DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (1 << 9) + (EU << 5) + ((sam & 0xf) << 14) + \ - (((sam & 0x10) >> 4) << 19) + (1 << 31) -#define E_COND_LOAD_SIMMN(cond, dest, imm11s, sam) \ - DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (cond << 5) + ((sam & 0xf) << 14) + \ - (((sam & 0x10) >> 4) << 19) + (1 << 31) -#define E_COND_LOAD_SIMMNS(cond, dest, imm11s, sam) \ - DCD 0x0 + (dest << 10) + ((imm11s & 0x7ff) << 20) + (1 << 18) + (1 << 9) + (cond << 5) + ((sam & 0xf) << 14) + \ - (((sam & 0x10) >> 4) << 19) + (1 << 31) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_AHB_READ Codes */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Ptr PostIncrement (0 means pre-inc) Rdata Dest */ -/* Pointer WData Source Offset UpdatePointer */ -/* SizeWord Signed Access Cond */ - -/* LDR (Load, Load Byte, LoadByteSigned) */ -#define E_LDR(dest, source, offset8s) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (0 << 20) + (1 << 18) + (0 << 21) + \ - (EU << 5) -#define E_LDRB(dest, source, offset8s) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (0 << 20) + (0 << 18) + (0 << 21) + \ - (EU << 5) -#define E_LDRBS(dest, source, offset8s) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (0 << 20) + (0 << 18) + (1 << 21) + \ - (EU << 5) - -/* Conditional LDR (Load, Load Byte, LoadByteSigned) */ -#define E_COND_LDR(cond, dest, source, offset8s) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (0 << 20) + (1 << 18) + (0 << 21) + \ - (cond << 5) -#define E_COND_LDRB(cond, dest, source, offset8s) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (0 << 20) + (0 << 18) + (0 << 21) + \ - (cond << 5) -#define E_COND_LDRBS(cond, dest, source, offset8s) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (0 << 20) + (0 << 18) + (1 << 21) + \ - (cond << 5) - -/* With Update Pointer */ -#define E_LDR_PRE(dest, source, offset8s) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (1 << 20) + (1 << 18) + (0 << 21) + \ - (EU << 5) -#define E_LDRB_PRE(dest, source, offset8s) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (1 << 20) + (0 << 18) + (0 << 21) + \ - (EU << 5) -#define E_LDRBS_PRE(dest, source, offset8s) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (1 << 20) + (0 << 18) + (1 << 21) + \ - (EU << 5) -#define E_COND_LDR_PRE(cond, dest, source, offset8s) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (1 << 20) + (1 << 18) + (0 << 21) + \ - (cond << 5) -#define E_COND_LDRB_PRE(cond, dest, source, offset8s) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (1 << 20) + (0 << 18) + (0 << 21) + \ - (cond << 5) -#define E_COND_LDRBS_PRE(cond, dest, source, offset8s) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (1 << 20) + (0 << 18) + (1 << 21) + \ - (cond << 5) - -/* With Update Pointer (Post Increment pointer) */ -#define E_LDR_POST(dest, source, offset8s) \ - DCD 0x1 + (1 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (1 << 20) + (1 << 18) + (0 << 21) + \ - (EU << 5) -#define E_LDRB_POST(dest, source, offset8s) \ - DCD 0x1 + (1 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (1 << 20) + (0 << 18) + (0 << 21) + \ - (EU << 5) -#define E_LDRBS_POST(dest, source, offset8s) \ - DCD 0x1 + (1 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (1 << 20) + (0 << 18) + (1 << 21) + \ - (EU << 5) -#define E_COND_LDR_POST(cond, dest, source, offset8s) \ - DCD 0x1 + (1 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (1 << 20) + (1 << 18) + (0 << 21) + \ - (cond << 5) -#define E_COND_LDRB_POST(cond, dest, source, offset8s) \ - DCD 0x1 + (1 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (1 << 20) + (0 << 18) + (0 << 21) + \ - (cond << 5) -#define E_COND_LDRBS_POST(cond, dest, source, offset8s) \ - DCD 0x1 + (1 << 19) + (dest << 10) + (source << 14) + (offset8s << 24) + (1 << 20) + (0 << 18) + (1 << 21) + \ - (cond << 5) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_AHB_WRITE Codes */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Ptr PostIncrement (0 means pre-inc) Rdata Dest */ -/* Pointer WData Source offset8s UpdatePointer */ -/* SizeWord Signed Access Cond */ - -/* STR (Load, Load Byte, LoadByteSigned) */ -#define E_STR(raddr, rdata, offset8s) \ - DCD 0x2 + (0 << 19) + (raddr << 14) + (rdata << 20) + (offset8s << 24) + (0 << 10) + (1 << 18) + (0 << 11) + \ - (EU << 5) -#define E_STRB(raddr, rdata, offset8s) \ - DCD 0x2 + (0 << 19) + (raddr << 14) + (rdata << 20) + (offset8s << 24) + (0 << 10) + (0 << 18) + (0 << 11) + \ - (EU << 5) - -/* Conditional STR (Load, Load Byte, LoadByteSigned) */ -#define E_COND_STR(cond, raddr, rdata, offset8s) \ - DCD 0x2 + (0 << 19) + (raddr << 14) + (rdata << 20) + (offset8s << 24) + (0 << 10) + (1 << 18) + (0 << 11) + \ - (cond << 5) -#define E_COND_STRB(cond, raddr, rdata, offset8s) \ - DCD 0x2 + (0 << 19) + (raddr << 14) + (rdata << 20) + (offset8s << 24) + (0 << 10) + (0 << 18) + (0 << 11) + \ - (cond << 5) - -/* With Update Pointer */ -#define E_STR_PRE(raddr, rdata, offset8s) \ - DCD 0x2 + (0 << 19) + (raddr << 14) + (rdata << 20) + (offset8s << 24) + (1 << 10) + (1 << 18) + (0 << 11) + \ - (EU << 5) -#define E_STRB_PRE(raddr, rdata, offset8s) \ - DCD 0x2 + (0 << 19) + (raddr << 14) + (rdata << 20) + (offset8s << 24) + (1 << 10) + (0 << 18) + (0 << 11) + \ - (EU << 5) -#define E_COND_STR_PRE(cond, raddr, rdata, offset8s) \ - DCD 0x2 + (0 << 19) + (raddr << 14) + (rdata << 20) + (offset8s << 24) + (1 << 10) + (1 << 18) + (0 << 11) + \ - (cond << 5) -#define E_COND_STRB_PRE(cond, raddr, rdata, offset8s) \ - DCD 0x2 + (0 << 19) + (raddr << 14) + (rdata << 20) + (offset8s << 24) + (1 << 10) + (0 << 18) + (0 << 11) + \ - (cond << 5) - -/* With Update Pointer (Post Increment pointer) */ -#define E_STR_POST(raddr, rdata, offset8s) \ - DCD 0x2 + (1 << 19) + (raddr << 14) + (rdata << 20) + (offset8s << 24) + (1 << 10) + (1 << 18) + (0 << 11) + \ - (EU << 5) -#define E_STRB_POST(raddr, rdata, offset8s) \ - DCD 0x2 + (1 << 19) + (raddr << 14) + (rdata << 20) + (offset8s << 24) + (1 << 10) + (0 << 18) + (0 << 11) + \ - (EU << 5) -#define E_COND_STR_POST(cond, raddr, rdata, offset8s) \ - DCD 0x2 + (1 << 19) + (raddr << 14) + (rdata << 20) + (offset8s << 24) + (1 << 10) + (1 << 18) + (0 << 11) + \ - (cond << 5) -#define E_COND_STRB_POST(cond, raddr, rdata, offset8s) \ - DCD 0x2 + (1 << 19) + (raddr << 14) + (rdata << 20) + (offset8s << 24) + (1 << 10) + (0 << 18) + (0 << 11) + \ - (cond << 5) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* Stack Operations (built up from E_LDR and E_STR codes */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Ptr PostIncrement (0 means pre-inc) Rdata Dest */ -/* Pointer WData Source Offset UpdatePointer - */ -/* SizeWord Signed Access Cond */ - -#define E_PUSH(source) \ - DCD 0x2 + (1 << 19) + (SP << 14) + (source << 20) + (1 << 24) + (1 << 10) + (1 << 18) + (0 << 11) + (EU << 5) -#define E_POP(dest) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (SP << 14) + ((-1) << 24) + (1 << 20) + (1 << 18) + (0 << 21) + (EU << 5) -#define E_PUSHB(source) \ - DCD 0x2 + (1 << 19) + (SP << 14) + (source << 20) + (1 << 24) + (1 << 10) + (0 << 18) + (0 << 11) + (EU << 5) -#define E_POPB(dest) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (SP << 14) + ((-1) << 24) + (1 << 20) + (0 << 18) + (0 << 21) + (EU << 5) - -#define E_POPBS(dest) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (SP << 14) + ((-1) << 24) + (1 << 20) + (0 << 18) + (1 << 21) + (EU << 5) - -#define E_COND_PUSH(cond, source) \ - DCD 0x2 + (1 << 19) + (SP << 14) + (source << 20) + (1 << 24) + (1 << 10) + (1 << 18) + (0 << 11) + (cond << 5) -#define E_COND_POP(cond, dest) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (SP << 14) + ((-1) << 24) + (1 << 20) + (1 << 18) + (0 << 21) + (cond << 5) -#define E_COND_PUSHB(cond, source) \ - DCD 0x2 + (1 << 19) + (SP << 14) + (source << 20) + (1 << 24) + (1 << 10) + (0 << 18) + (0 << 11) + (cond << 5) -#define E_COND_POPB(cond, dest) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (SP << 14) + ((-1) << 24) + (1 << 20) + (0 << 18) + (0 << 21) + (cond << 5) - -#define E_COND_POPBS(cond, dest) \ - DCD 0x1 + (0 << 19) + (dest << 10) + (SP << 14) + ((-1) << 24) + (1 << 20) + (0 << 18) + (1 << 21) + (cond << 5) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_PER_READ Codes */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Address Cond */ - -#define E_PER_READ(dest, addr20) DCD 0x4 + (dest << 10) + ((addr20 & 0x000ffffc) << 12) + (EU << 5) -#define E_COND_PER_READ(cond, dest, addr20) DCD 0x4 + (dest << 10) + ((addr20 & 0x000ffffc) << 12) + (cond << 5) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_PER_WRITE Codes */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Address Cond */ - -#define E_PER_WRITE(source, addr20) \ - DCD 0x5 + (source << 20) + ((addr20 & 0x000ff000) << 12) + ((addr20 & 0x00000ffc) << 8) + (EU << 5) -#define E_COND_PER_WRITE(cond, source, addr20) \ - DCD 0x5 + (source << 20) + ((addr20 & 0x000ff000) << 12) + ((addr20 & 0x00000ffc) << 8) + (cond << 5) - -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_ADD Codes */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Src1 src2 SFlag Cond - */ -/* Imm Use_Imm Invert Result Shift Amount - */ -/* Shift/Rotate Left/Right Flip */ - -/* Add reg to reg */ -#define E_ADD(dest, src1, src2) DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) -#define E_ADDS(dest, src1, src2) DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) -#define E_COND_ADD(cond, dest, src1, src2) DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) -#define E_COND_ADDS(cond, dest, src1, src2) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) - -/* Add reg to reg and invert result */ -#define E_ADDN(dest, src1, src2) DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) -#define E_ADDNS(dest, src1, src2) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) -#define E_COND_ADDN(cond, dest, src1, src2) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) -#define E_COND_ADDNS(cond, dest, src1, src2) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) - -/* Add imm12s to reg */ -#define E_ADD_IMM(dest, src1, imm12s) DCD 0x6 + (dest << 10) + (src1 << 14) + (EU << 5) + (imm12s << 20) + (1 << 18) -#define E_ADD_IMMS(dest, src1, imm12s) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (1 << 9) + (EU << 5) + (imm12s << 20) + (1 << 18) -#define E_COND_ADD_IMM(cond, dest, src1, imm12s) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (cond << 5) + (imm12s << 20) + (1 << 18) -#define E_COND_ADD_IMMS(cond, dest, src1, imm12s) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (1 << 9) + (cond << 5) + (imm12s << 20) + (1 << 18) - -/* Add imm12s to reg and invert result */ -#define E_ADDN_IMM(dest, src1, imm12s) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (EU << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_ADDN_IMMS(dest, src1, imm12s) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (1 << 9) + (EU << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_COND_ADDN_IMM(cond, dest, src1, imm12s) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (cond << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_COND_ADDN_IMMS(cond, dest, src1, imm12s) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (1 << 9) + (cond << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) - -/* Add reg to reg with Post Shift Left */ -#define E_ADD_LSL(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (0 << 31) -#define E_ADD_LSLS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ADD_LSL(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (0 << 31) -#define E_COND_ADD_LSLS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) - -/* Add reg to reg and invert result with Post Shift Left */ -#define E_ADDN_LSL(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_ADDN_LSLS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ADDN_LSL(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ADDN_LSLS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (0 << 31) - -/* Add reg to reg with Post Shift Right */ -#define E_ADD_LSR(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (0 << 31) -#define E_ADD_LSRS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ADD_LSR(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (0 << 31) -#define E_COND_ADD_LSRS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) - -/* Add reg to reg and invert result with Post Shift Right */ -#define E_ADDN_LSR(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_ADDN_LSRS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ADDN_LSR(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ADDN_LSRS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (0 << 31) - -/* Add reg to reg with Post Arith Shift Right */ -#define E_ADD_ASR(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (0 << 31) -#define E_ADD_ASRS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ADD_ASR(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (0 << 31) -#define E_COND_ADD_ASRS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) - -/* Add reg to reg and invert result with Post Arith Shift Right */ -#define E_ADDN_ASR(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_ADDN_ASRS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ADDN_ASR(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ADDN_ASRS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (0 << 31) - -/* Add reg to reg with Post ROR */ -#define E_ADD_ROR(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (0 << 31) -#define E_ADD_RORS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ADD_ROR(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (0 << 31) -#define E_COND_ADD_RORS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) - -/* Add reg to reg and invert result with ROR */ -#define E_ADDN_ROR(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_ADDN_RORS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ADDN_ROR(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ADDN_RORS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (0 << 31) - -/* Add reg to reg with Flip */ -#define E_ADD_F(dest, src1, src2) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((0 & 0x1f) << 24) + (0 << 29) + (0 << 30) + \ - (1 << 31) -#define E_ADD_FS(dest, src1, src2) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_ADD_F(cond, dest, src1, src2) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((0 & 0x1f) << 24) + (0 << 29) + (0 << 30) + \ - (1 << 31) -#define E_COND_ADD_FS(cond, dest, src1, src2) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) - -/* Add reg to reg and invert result with Flip */ -#define E_ADDN_F(dest, src1, src2) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_ADDN_FS(dest, src1, src2) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + ((0 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ADDN_F(cond, dest, src1, src2) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_ADDN_FS(cond, dest, src1, src2) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + ((0 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) - -/* Add reg to reg with Post Shift Left */ -#define E_ADD_FLSL(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_ADD_FLSLS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ADD_FLSL(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_ADD_FLSLS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) - -/* Add reg to reg and invert result with Post Shift Left */ -#define E_ADDN_FLSL(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_ADDN_FLSLS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ADDN_FLSL(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ADDN_FLSLS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (1 << 31) - -/* Add reg to reg with Post Shift Right */ -#define E_ADD_FLSR(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (1 << 31) -#define E_ADD_FLSRS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ADD_FLSR(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (1 << 31) -#define E_COND_ADD_FLSRS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) - -/* Add reg to reg and invert result with Post Shift Right */ -#define E_ADDN_FLSR(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_ADDN_FLSRS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ADDN_FLSR(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ADDN_FLSRS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (1 << 31) - -/* Add reg to reg with Post Arith Shift Right */ -#define E_ADD_FASR(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (1 << 31) -#define E_ADD_FASRS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ADD_FASR(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_ADD_FASRS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) - -/* Add reg to reg and invert result with Post Arith Shift Right */ -#define E_ADDN_FASR(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_ADDN_FASRS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ADDN_FASR(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ADDN_FASRS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (1 << 31) - -/* Add reg to reg with Post ROR */ -#define E_ADD_FROR(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (1 << 31) -#define E_ADD_FRORS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ADD_FROR(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (1 << 31) -#define E_COND_ADD_FRORS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) - -/* Add reg to reg and invert result with ROR */ -#define E_ADDN_FROR(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_ADDN_FRORS(dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ADDN_FROR(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ADDN_FRORS(cond, dest, src1, src2, shift5) \ - DCD 0x6 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (1 << 31) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_SUB Codes */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Src1 src2 SFlag Cond - */ -/* Imm Use_Imm Invert Result Shift Result */ - -/* sub reg from reg */ -#define E_SUB(dest, src1, src2) DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) -#define E_SUBS(dest, src1, src2) DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) -#define E_COND_SUB(cond, dest, src1, src2) DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) -#define E_COND_SUBS(cond, dest, src1, src2) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) - -/* sub reg from reg and invert result */ -#define E_SUBN(dest, src1, src2) DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) -#define E_SUBNS(dest, src1, src2) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) -#define E_COND_SUBN(cond, dest, src1, src2) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) -#define E_COND_SUBNS(cond, dest, src1, src2) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) - -/* sub imm12s from reg */ -#define E_SUB_IMM(dest, src1, imm12s) DCD 0x8 + (dest << 10) + (src1 << 14) + (EU << 5) + (imm12s << 20) + (1 << 18) -#define E_SUB_IMMS(dest, src1, imm12s) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (1 << 9) + (EU << 5) + (imm12s << 20) + (1 << 18) -#define E_COND_SUB_IMM(cond, dest, src1, imm12s) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (cond << 5) + (imm12s << 20) + (1 << 18) -#define E_COND_SUB_IMMS(cond, dest, src1, imm12s) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (1 << 9) + (cond << 5) + (imm12s << 20) + (1 << 18) - -/* sub imm12s from reg and invert result */ -#define E_SUBN_IMM(dest, src1, imm12s) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (EU << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_SUBN_IMMS(dest, src1, imm12s) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (1 << 9) + (EU << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_COND_SUBN_IMM(cond, dest, src1, imm12s) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (cond << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_COND_SUBN_IMMS(cond, dest, src1, imm12s) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (1 << 9) + (cond << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) - -/* SUB reg to reg with Post Shift Left */ -#define E_SUB_LSL(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (0 << 31) -#define E_SUB_LSLS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_SUB_LSL(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (0 << 31) -#define E_COND_SUB_LSLS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) - -/* SUB reg to reg and invert result with Post Shift Left */ -#define E_SUBN_LSL(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_SUBN_LSLS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_SUBN_LSL(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_SUBN_LSLS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (0 << 31) - -/* SUB reg to reg with Post Shift Right */ -#define E_SUB_LSR(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (0 << 31) -#define E_SUB_LSRS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_SUB_LSR(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (0 << 31) -#define E_COND_SUB_LSRS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) - -/* SUB reg to reg and invert result with Post Shift Right */ -#define E_SUBN_LSR(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_SUBN_LSRS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_SUBN_LSR(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_SUBN_LSRS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (0 << 31) - -/* SUB reg to reg with Post Arith Shift Right */ -#define E_SUB_ASR(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (0 << 31) -#define E_SUB_ASRS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_SUB_ASR(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (0 << 31) -#define E_COND_SUB_ASRS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) - -/* SUB reg to reg and invert result with Post Arith Shift Right */ -#define E_SUBN_ASR(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_SUBN_ASRS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_SUBN_ASR(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_SUBN_ASRS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (0 << 31) - -/* SUB reg to reg with Post ROR */ -#define E_SUB_ROR(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (0 << 31) -#define E_SUB_RORS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_SUB_ROR(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (0 << 31) -#define E_COND_SUB_RORS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) - -/* SUB reg to reg and invert result with ROR */ -#define E_SUBN_ROR(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_SUBN_RORS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_SUBN_ROR(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_SUBN_RORS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (0 << 31) - -/* Flip Endianness and then shift5/Rotate */ - -/* Sub reg to reg with Flip */ -#define E_SUB_F(dest, src1, src2) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((0 & 0x1f) << 24) + (0 << 29) + (0 << 30) + \ - (1 << 31) -#define E_SUB_FS(dest, src1, src2) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_SUB_F(cond, dest, src1, src2) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((0 & 0x1f) << 24) + (0 << 29) + (0 << 30) + \ - (1 << 31) -#define E_COND_SUB_FS(cond, dest, src1, src2) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) - -/* Sub reg to reg and invert result with Flip */ -#define E_SUBN_F(dest, src1, src2) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_SUBN_FS(dest, src1, src2) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + ((0 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_SUBN_F(cond, dest, src1, src2) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_SUBN_FS(cond, dest, src1, src2) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + ((0 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) - -/* SUB reg to reg with Post Shift Left */ -#define E_SUB_FLSL(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_SUB_FLSLS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_SUB_FLSL(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_SUB_FLSLS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) - -/* SUB reg to reg and invert result with Post Shift Left */ -#define E_SUBN_FLSL(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_SUBN_FLSLS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_SUBN_FLSL(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_SUBN_FLSLS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (1 << 31) - -/* SUB reg to reg with Post Shift Right */ -#define E_SUB_FLSR(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (1 << 31) -#define E_SUB_FLSRS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_SUB_FLSR(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (1 << 31) -#define E_COND_SUB_FLSRS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) - -/* SUB reg to reg and invert result with Post Shift Right */ -#define E_SUBN_FLSR(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_SUBN_FLSRS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_SUBN_FLSR(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_SUBN_FLSRS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (1 << 31) - -/* SUB reg to reg with Post Arith Shift Right */ -#define E_SUB_FASR(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (1 << 31) -#define E_SUB_FASRS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_SUB_FASR(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_SUB_FASRS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) - -/* SUB reg to reg and invert result with Post Arith Shift Right */ -#define E_SUBN_FASR(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_SUBN_FASRS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_SUBN_FASR(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_SUBN_FASRS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (1 << 31) - -/* SUB reg to reg with Post ROR */ -#define E_SUB_FROR(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (1 << 31) -#define E_SUB_FRORS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_SUB_FROR(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (1 << 31) -#define E_COND_SUB_FRORS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) - -/* SUB reg to reg and invert result with ROR */ -#define E_SUBN_FROR(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_SUBN_FRORS(dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_SUBN_FROR(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_SUBN_FRORS(cond, dest, src1, src2, shift5) \ - DCD 0x8 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (1 << 31) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_ADC Codes */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Src1 src2 SFlag Cond - */ -/* Imm Use_Imm Invert Result Shift Result */ - -/* carry add reg from reg */ -#define E_ADC(dest, src1, src2) DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) -#define E_ADCS(dest, src1, src2) DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) -#define E_COND_ADC(cond, dest, src1, src2) DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) -#define E_COND_ADCS(cond, dest, src1, src2) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) - -/* carry add reg from reg and invert result */ -#define E_ADCN(dest, src1, src2) DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) -#define E_ADCNS(dest, src1, src2) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) -#define E_COND_ADCN(cond, dest, src1, src2) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) -#define E_COND_ADCNS(cond, dest, src1, src2) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) - -/* carry add imm12s from reg */ -#define E_ADC_IMM(dest, src1, imm12s) DCD 0x9 + (dest << 10) + (src1 << 14) + (EU << 5) + (imm12s << 20) + (1 << 18) -#define E_ADC_IMMS(dest, src1, imm12s) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (1 << 9) + (EU << 5) + (imm12s << 20) + (1 << 18) -#define E_COND_ADC_IMM(cond, dest, src1, imm12s) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (cond << 5) + (imm12s << 20) + (1 << 18) -#define E_COND_ADC_IMMS(cond, dest, src1, imm12s) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (1 << 9) + (cond << 5) + (imm12s << 20) + (1 << 18) - -/* carry add imm12s from reg and invert result */ -#define E_ADCN_IMM(dest, src1, imm12s) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (EU << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_ADCN_IMMS(dest, src1, imm12s) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (1 << 9) + (EU << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_COND_ADCN_IMM(cond, dest, src1, imm12s) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (cond << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_COND_ADCN_IMMS(cond, dest, src1, imm12s) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (1 << 9) + (cond << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) - -/* ADC reg to reg with Post Shift Left */ -#define E_ADC_LSL(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (0 << 31) -#define E_ADC_LSLS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ADC_LSL(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (0 << 31) -#define E_COND_ADC_LSLS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) - -/* ADC reg to reg and invert result with Post Shift Left */ -#define E_ADCN_LSL(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_ADCN_LSLS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ADCN_LSL(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ADCN_LSLS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (0 << 31) - -/* ADC reg to reg with Post Shift Right */ -#define E_ADC_LSR(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (0 << 31) -#define E_ADC_LSRS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ADC_LSR(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (0 << 31) -#define E_COND_ADC_LSRS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) - -/* ADC reg to reg and invert result with Post Shift Right */ -#define E_ADCN_LSR(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_ADCN_LSRS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ADCN_LSR(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ADCN_LSRS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (0 << 31) - -/* ADC reg to reg with Post Arith Shift Right */ -#define E_ADC_ASR(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (0 << 31) -#define E_ADC_ASRS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ADC_ASR(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (0 << 31) -#define E_COND_ADC_ASRS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) - -/* ADC reg to reg and invert result with Post Arith Shift Right */ -#define E_ADCN_ASR(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_ADCN_ASRS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ADCN_ASR(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ADCN_ASRS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (0 << 31) - -/* ADC reg to reg with Post ROR */ -#define E_ADC_ROR(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (0 << 31) -#define E_ADC_RORS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ADC_ROR(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (0 << 31) -#define E_COND_ADC_RORS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) - -/* ADC reg to reg and invert result with ROR */ -#define E_ADCN_ROR(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_ADCN_RORS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ADCN_ROR(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ADCN_RORS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (0 << 31) - -/* Flip Endianness and then shift5/Rotate */ - -/* adc reg to reg with Flip */ -#define E_ADC_F(dest, src1, src2) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((0 & 0x1f) << 24) + (0 << 29) + (0 << 30) + \ - (1 << 31) -#define E_ADC_FS(dest, src1, src2) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_ADC_F(cond, dest, src1, src2) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((0 & 0x1f) << 24) + (0 << 29) + (0 << 30) + \ - (1 << 31) -#define E_COND_ADC_FS(cond, dest, src1, src2) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) - -/* ADC reg to reg and invert result with Flip */ -#define E_ADCN_F(dest, src1, src2) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_ADCN_FS(dest, src1, src2) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + ((0 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ADCN_F(cond, dest, src1, src2) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_ADCN_FS(cond, dest, src1, src2) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + ((0 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) - -/* ADC reg to reg with Post Shift Left */ -#define E_ADC_FLSL(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_ADC_FLSLS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ADC_FLSL(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_ADC_FLSLS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) - -/* ADC reg to reg and invert result with Post Shift Left */ -#define E_ADCN_FLSL(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_ADCN_FLSLS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ADCN_FLSL(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ADCN_FLSLS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (1 << 31) - -/* ADC reg to reg with Post Shift Right */ -#define E_ADC_FLSR(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (1 << 31) -#define E_ADC_FLSRS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ADC_FLSR(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (1 << 31) -#define E_COND_ADC_FLSRS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) - -/* ADC reg to reg and invert result with Post Shift Right */ -#define E_ADCN_FLSR(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_ADCN_FLSRS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ADCN_FLSR(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ADCN_FLSRS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (1 << 31) - -/* ADC reg to reg with Post Arith Shift Right */ -#define E_ADC_FASR(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (1 << 31) -#define E_ADC_FASRS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ADC_FASR(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_ADC_FASRS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) - -/* ADC reg to reg and invert result with Post Arith Shift Right */ -#define E_ADCN_FASR(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_ADCN_FASRS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ADCN_FASR(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ADCN_FASRS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (1 << 31) - -/* ADC reg to reg with Post ROR */ -#define E_ADC_FROR(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (1 << 31) -#define E_ADC_FRORS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ADC_FROR(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (1 << 31) -#define E_COND_ADC_FRORS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) - -/* ADC reg to reg and invert result with ROR */ -#define E_ADCN_FROR(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_ADCN_FRORS(dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ADCN_FROR(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ADCN_FRORS(cond, dest, src1, src2, shift5) \ - DCD 0x9 + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (1 << 31) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_SBC Codes */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Src1 src2 SFlag Cond - */ -/* Imm Use_Imm Invert Result Shift Result */ - -/* carry sub reg from reg */ -#define E_SBC(dest, src1, src2) DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) -#define E_SBCS(dest, src1, src2) DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) -#define E_COND_SBC(cond, dest, src1, src2) DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) -#define E_COND_SBCS(cond, dest, src1, src2) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) - -/* carry sub reg from reg and invert result */ -#define E_SBCN(dest, src1, src2) DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) -#define E_SBCNS(dest, src1, src2) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) -#define E_COND_SBCN(cond, dest, src1, src2) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) -#define E_COND_SBCNS(cond, dest, src1, src2) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) - -/* carry sub imm12s from reg */ -#define E_SBC_IMM(dest, src1, imm12s) DCD 0xA + (dest << 10) + (src1 << 14) + (EU << 5) + (imm12s << 20) + (1 << 18) -#define E_SBC_IMMS(dest, src1, imm12s) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (1 << 9) + (EU << 5) + (imm12s << 20) + (1 << 18) -#define E_COND_SBC_IMM(cond, dest, src1, imm12s) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (cond << 5) + (imm12s << 20) + (1 << 18) -#define E_COND_SBC_IMMS(cond, dest, src1, imm12s) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (1 << 9) + (cond << 5) + (imm12s << 20) + (1 << 18) - -/* carry sub imm12s from reg and invert result */ -#define E_SBCN_IMM(dest, src1, imm12s) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (EU << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_SBCN_IMMS(dest, src1, imm12s) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (1 << 9) + (EU << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_COND_SBCN_IMM(cond, dest, src1, imm12s) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (cond << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_COND_SBCN_IMMS(cond, dest, src1, imm12s) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (1 << 9) + (cond << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) - -/* SBC reg to reg with Post Shift Left */ -#define E_SBC_LSL(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (0 << 31) -#define E_SBC_LSLS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_SBC_LSL(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (0 << 31) -#define E_COND_SBC_LSLS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) - -/* SBC reg to reg and invert result with Post Shift Left */ -#define E_SBCN_LSL(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_SBCN_LSLS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_SBCN_LSL(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_SBCN_LSLS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (0 << 31) - -/* SBC reg to reg with Post Shift Right */ -#define E_SBC_LSR(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (0 << 31) -#define E_SBC_LSRS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_SBC_LSR(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (0 << 31) -#define E_COND_SBC_LSRS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) - -/* SBC reg to reg and invert result with Post Shift Right */ -#define E_SBCN_LSR(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_SBCN_LSRS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_SBCN_LSR(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_SBCN_LSRS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (0 << 31) - -/* SBC reg to reg with Post Arith Shift Right */ -#define E_SBC_ASR(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (0 << 31) -#define E_SBC_ASRS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_SBC_ASR(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (0 << 31) -#define E_COND_SBC_ASRS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) - -/* SBC reg to reg and invert result with Post Arith Shift Right */ -#define E_SBCN_ASR(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_SBCN_ASRS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_SBCN_ASR(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_SBCN_ASRS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (0 << 31) - -/* SBC reg to reg with Post ROR */ -#define E_SBC_ROR(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (0 << 31) -#define E_SBC_RORS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_SBC_ROR(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (0 << 31) -#define E_COND_SBC_RORS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) - -/* SBC reg to reg and invert result with ROR */ -#define E_SBCN_ROR(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_SBCN_RORS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_SBCN_ROR(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_SBCN_RORS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (0 << 31) - -/* Flip Endianness and then shift5/Rotate */ - -/* SBC reg to reg with Flip */ -#define E_SBC_F(dest, src1, src2) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((0 & 0x1f) << 24) + (0 << 29) + (0 << 30) + \ - (1 << 31) -#define E_SBC_FS(dest, src1, src2) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_SBC_F(cond, dest, src1, src2) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((0 & 0x1f) << 24) + (0 << 29) + (0 << 30) + \ - (1 << 31) -#define E_COND_SBC_FS(cond, dest, src1, src2) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) - -/* SBC reg to reg and invert result with Flip */ -#define E_SBCN_F(dest, src1, src2) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_SBCN_FS(dest, src1, src2) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + ((0 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_SBCN_F(cond, dest, src1, src2) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_SBCN_FS(cond, dest, src1, src2) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + ((0 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) - -/* SBC reg to reg with Post Shift Left */ -#define E_SBC_FLSL(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_SBC_FLSLS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_SBC_FLSL(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_SBC_FLSLS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) - -/* SBC reg to reg and invert result with Post Shift Left */ -#define E_SBCN_FLSL(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_SBCN_FLSLS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_SBCN_FLSL(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_SBCN_FLSLS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (1 << 31) - -/* SBC reg to reg with Post Shift Right */ -#define E_SBC_FLSR(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (1 << 31) -#define E_SBC_FLSRS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_SBC_FLSR(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (1 << 31) -#define E_COND_SBC_FLSRS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) - -/* SBC reg to reg and invert result with Post Shift Right */ -#define E_SBCN_FLSR(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_SBCN_FLSRS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_SBCN_FLSR(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_SBCN_FLSRS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (1 << 31) - -/* SBC reg to reg with Post Arith Shift Right */ -#define E_SBC_FASR(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (1 << 31) -#define E_SBC_FASRS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_SBC_FASR(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_SBC_FASRS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) - -/* SBC reg to reg and invert result with Post Arith Shift Right */ -#define E_SBCN_FASR(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_SBCN_FASRS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_SBCN_FASR(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_SBCN_FASRS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (1 << 31) - -/* SBC reg to reg with Post ROR */ -#define E_SBC_FROR(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (1 << 31) -#define E_SBC_FRORS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_SBC_FROR(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (1 << 31) -#define E_COND_SBC_FRORS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) - -/* SBC reg to reg and invert result with ROR */ -#define E_SBCN_FROR(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_SBCN_FRORS(dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_SBCN_FROR(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_SBCN_FRORS(cond, dest, src1, src2, shift5) \ - DCD 0xA + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (1 << 31) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_OR Codes */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Src1 src2 SFlag Cond - */ -/* Imm Use_Imm Invert Result Shift Result */ - -/* or reg with reg */ -#define E_OR(dest, src1, src2) DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) -#define E_ORS(dest, src1, src2) DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) -#define E_COND_OR(cond, dest, src1, src2) DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) -#define E_COND_ORS(cond, dest, src1, src2) DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) - -/* or reg with reg and invert result */ -#define E_ORN(dest, src1, src2) DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) -#define E_ORNS(dest, src1, src2) DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) -#define E_COND_ORN(cond, dest, src1, src2) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) -#define E_COND_ORNS(cond, dest, src1, src2) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) - -/* or imm12s with reg */ -#define E_OR_IMM(dest, src1, imm12s) DCD 0xC + (dest << 10) + (src1 << 14) + (EU << 5) + (imm12s << 20) + (1 << 18) -#define E_OR_IMMS(dest, src1, imm12s) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (1 << 9) + (EU << 5) + (imm12s << 20) + (1 << 18) -#define E_COND_OR_IMM(cond, dest, src1, imm12s) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (cond << 5) + (imm12s << 20) + (1 << 18) -#define E_COND_OR_IMMS(cond, dest, src1, imm12s) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (1 << 9) + (cond << 5) + (imm12s << 20) + (1 << 18) - -/* or imm12s with reg and invert result */ -#define E_ORN_IMM(dest, src1, imm12s) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (EU << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_ORN_IMMS(dest, src1, imm12s) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (1 << 9) + (EU << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_COND_ORN_IMM(cond, dest, src1, imm12s) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (cond << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_COND_ORN_IMMS(cond, dest, src1, imm12s) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (1 << 9) + (cond << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) - -/* OR reg to reg with Post Shift Left */ -#define E_OR_LSL(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (0 << 31) -#define E_OR_LSLS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_OR_LSL(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (0 << 31) -#define E_COND_OR_LSLS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) - -/* OR reg to reg and invert result with Post Shift Left */ -#define E_ORN_LSL(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_ORN_LSLS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ORN_LSL(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ORN_LSLS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (0 << 31) - -/* OR reg to reg with Post Shift Right */ -#define E_OR_LSR(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (0 << 31) -#define E_OR_LSRS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_OR_LSR(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (0 << 31) -#define E_COND_OR_LSRS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) - -/* OR reg to reg and invert result with Post Shift Right */ -#define E_ORN_LSR(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_ORN_LSRS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ORN_LSR(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ORN_LSRS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (0 << 31) - -/* OR reg to reg with Post Arith Shift Right */ -#define E_OR_ASR(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (0 << 31) -#define E_OR_ASRS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_OR_ASR(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (0 << 31) -#define E_COND_OR_ASRS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) - -/* OR reg to reg and invert result with Post Arith Shift Right */ -#define E_ORN_ASR(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_ORN_ASRS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ORN_ASR(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ORN_ASRS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (0 << 31) - -/* OR reg to reg with Post ROR */ -#define E_OR_ROR(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (0 << 31) -#define E_OR_RORS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_OR_ROR(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (0 << 31) -#define E_COND_OR_RORS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) - -/* OR reg to reg and invert result with ROR */ -#define E_ORN_ROR(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_ORN_RORS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ORN_ROR(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ORN_RORS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (0 << 31) -/* Flip Endianness and then shift5/Rotate */ - -/* OR reg to reg with Flip */ -#define E_OR_F(dest, src1, src2) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((0 & 0x1f) << 24) + (0 << 29) + (0 << 30) + \ - (1 << 31) -#define E_OR_FS(dest, src1, src2) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_OR_F(cond, dest, src1, src2) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((0 & 0x1f) << 24) + (0 << 29) + (0 << 30) + \ - (1 << 31) -#define E_COND_OR_FS(cond, dest, src1, src2) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) - -/* OR reg to reg and invert result with Flip */ -#define E_ORN_F(dest, src1, src2) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_ORN_FS(dest, src1, src2) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + ((0 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ORN_F(cond, dest, src1, src2) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_ORN_FS(cond, dest, src1, src2) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + ((0 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) - -/* OR reg to reg with Post Shift Left */ -#define E_OR_FLSL(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_OR_FLSLS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_OR_FLSL(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_OR_FLSLS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) - -/* OR reg to reg and invert result with Post Shift Left */ -#define E_ORN_FLSL(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_ORN_FLSLS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ORN_FLSL(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ORN_FLSLS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (1 << 31) - -/* OR reg to reg with Post Shift Right */ -#define E_OR_FLSR(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (1 << 31) -#define E_OR_FLSRS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_OR_FLSR(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (1 << 31) -#define E_COND_OR_FLSRS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) - -/* OR reg to reg and invert result with Post Shift Right */ -#define E_ORN_FLSR(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_ORN_FLSRS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ORN_FLSR(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ORN_FLSRS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (1 << 31) - -/* OR reg to reg with Post Arith Shift Right */ -#define E_OR_FASR(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (1 << 31) -#define E_OR_FASRS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_OR_FASR(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_OR_FASRS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) - -/* OR reg to reg and invert result with Post Arith Shift Right */ -#define E_ORN_FASR(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_ORN_FASRS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ORN_FASR(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ORN_FASRS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (1 << 31) - -/* OR reg to reg with Post ROR */ -#define E_OR_FROR(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (1 << 31) -#define E_OR_FRORS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_OR_FROR(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (1 << 31) -#define E_COND_OR_FRORS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) - -/* OR reg to reg and invert result with ROR */ -#define E_ORN_FROR(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_ORN_FRORS(dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ORN_FROR(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ORN_FRORS(cond, dest, src1, src2, shift5) \ - DCD 0xC + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (1 << 31) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_AND Codes */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Src1 src2 SFlag Cond - */ -/* Imm Use_Imm Invert Result Shift Result */ - -/* AND reg with reg */ -#define E_AND(dest, src1, src2) DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) -#define E_ANDS(dest, src1, src2) DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) -#define E_COND_AND(cond, dest, src1, src2) DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) -#define E_COND_ANDS(cond, dest, src1, src2) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) - -/* AND reg with reg and invert result */ -#define E_ANDN(dest, src1, src2) DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) -#define E_ANDNS(dest, src1, src2) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) -#define E_COND_ANDN(cond, dest, src1, src2) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) -#define E_COND_ANDNS(cond, dest, src1, src2) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) - -/* AND imm12s with reg */ -#define E_AND_IMM(dest, src1, imm12s) DCD 0xd + (dest << 10) + (src1 << 14) + (EU << 5) + (imm12s << 20) + (1 << 18) -#define E_AND_IMMS(dest, src1, imm12s) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (1 << 9) + (EU << 5) + (imm12s << 20) + (1 << 18) -#define E_COND_AND_IMM(cond, dest, src1, imm12s) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (cond << 5) + (imm12s << 20) + (1 << 18) -#define E_COND_AND_IMMS(cond, dest, src1, imm12s) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (1 << 9) + (cond << 5) + (imm12s << 20) + (1 << 18) - -/* AND imm12s with reg and invert result */ -#define E_ANDN_IMM(dest, src1, imm12s) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (EU << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_ANDN_IMMS(dest, src1, imm12s) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (1 << 9) + (EU << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_COND_ANDN_IMM(cond, dest, src1, imm12s) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (cond << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_COND_ANDN_IMMS(cond, dest, src1, imm12s) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (1 << 9) + (cond << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) - -/* AND reg to reg with Post Shift Left */ -#define E_AND_LSL(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (0 << 31) -#define E_AND_LSLS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_AND_LSL(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (0 << 31) -#define E_COND_AND_LSLS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) - -/* AND reg to reg and invert result with Post Shift Left */ -#define E_ANDN_LSL(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_ANDN_LSLS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ANDN_LSL(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ANDN_LSLS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (0 << 31) - -/* AND reg to reg with Post Shift Right */ -#define E_AND_LSR(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (0 << 31) -#define E_AND_LSRS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_AND_LSR(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (0 << 31) -#define E_COND_AND_LSRS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) - -/* AND reg to reg and invert result with Post Shift Right */ -#define E_ANDN_LSR(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_ANDN_LSRS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ANDN_LSR(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ANDN_LSRS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (0 << 31) - -/* AND reg to reg with Post Arith Shift Right */ -#define E_AND_ASR(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (0 << 31) -#define E_AND_ASRS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_AND_ASR(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (0 << 31) -#define E_COND_AND_ASRS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) - -/* AND reg to reg and invert result with Post Arith Shift Right */ -#define E_ANDN_ASR(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_ANDN_ASRS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ANDN_ASR(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_ANDN_ASRS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (0 << 31) - -/* AND reg to reg with Post ROR */ -#define E_AND_ROR(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (0 << 31) -#define E_AND_RORS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_AND_ROR(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (0 << 31) -#define E_COND_AND_RORS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) - -/* AND reg to reg and invert result with ROR */ -#define E_ANDN_ROR(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_ANDN_RORS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ANDN_ROR(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_ANDN_RORS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (0 << 31) - -/* Flip Endianness and then shift5/Rotate */ - -/* AND reg to reg with Flip */ -#define E_AND_F(dest, src1, src2) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((0 & 0x1f) << 24) + (0 << 29) + (0 << 30) + \ - (1 << 31) -#define E_AND_FS(dest, src1, src2) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_AND_F(cond, dest, src1, src2) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((0 & 0x1f) << 24) + (0 << 29) + (0 << 30) + \ - (1 << 31) -#define E_COND_AND_FS(cond, dest, src1, src2) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) - -/* AND reg to reg and invert result with Flip */ -#define E_ANDN_F(dest, src1, src2) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_ANDN_FS(dest, src1, src2) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + ((0 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ANDN_F(cond, dest, src1, src2) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_ANDN_FS(cond, dest, src1, src2) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + ((0 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) - -/* AND reg to reg with Post Shift Left */ -#define E_AND_FLSL(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_AND_FLSLS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_AND_FLSL(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_AND_FLSLS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) - -/* AND reg to reg and invert result with Post Shift Left */ -#define E_ANDN_FLSL(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_ANDN_FLSLS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ANDN_FLSL(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ANDN_FLSLS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (1 << 31) - -/* AND reg to reg with Post Shift Right */ -#define E_AND_FLSR(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (1 << 31) -#define E_AND_FLSRS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_AND_FLSR(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (1 << 31) -#define E_COND_AND_FLSRS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) - -/* AND reg to reg and invert result with Post Shift Right */ -#define E_ANDN_FLSR(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_ANDN_FLSRS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ANDN_FLSR(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ANDN_FLSRS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (1 << 31) - -/* AND reg to reg with Post Arith Shift Right */ -#define E_AND_FASR(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (1 << 31) -#define E_AND_FASRS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_AND_FASR(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_AND_FASRS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) - -/* AND reg to reg and invert result with Post Arith Shift Right */ -#define E_ANDN_FASR(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_ANDN_FASRS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ANDN_FASR(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_ANDN_FASRS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (1 << 31) - -/* AND reg to reg with Post ROR */ -#define E_AND_FROR(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (1 << 31) -#define E_AND_FRORS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_AND_FROR(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (1 << 31) -#define E_COND_AND_FRORS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) - -/* AND reg to reg and invert result with ROR */ -#define E_ANDN_FROR(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_ANDN_FRORS(dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ANDN_FROR(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_ANDN_FRORS(cond, dest, src1, src2, shift5) \ - DCD 0xd + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (1 << 31) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_XOR Codes */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Src1 src2 SFlag Cond - */ -/* Imm Use_Imm Invert Result Shift Result */ - -/* XOR reg with reg */ -#define E_XOR(dest, src1, src2) DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) -#define E_XORS(dest, src1, src2) DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) -#define E_COND_XOR(cond, dest, src1, src2) DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) -#define E_COND_XORS(cond, dest, src1, src2) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) - -/* XOR reg with reg XOR invert result */ -#define E_XORN(dest, src1, src2) DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) -#define E_XORNS(dest, src1, src2) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) -#define E_COND_XORN(cond, dest, src1, src2) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) -#define E_COND_XORNS(cond, dest, src1, src2) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) - -/* XOR imm12s with reg */ -#define E_XOR_IMM(dest, src1, imm12s) DCD 0xe + (dest << 10) + (src1 << 14) + (EU << 5) + (imm12s << 20) + (1 << 18) -#define E_XOR_IMMS(dest, src1, imm12s) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (1 << 9) + (EU << 5) + (imm12s << 20) + (1 << 18) -#define E_COND_XOR_IMM(cond, dest, src1, imm12s) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (cond << 5) + (imm12s << 20) + (1 << 18) -#define E_COND_XOR_IMMS(cond, dest, src1, imm12s) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (1 << 9) + (cond << 5) + (imm12s << 20) + (1 << 18) - -/* XOR imm12s with reg XOR invert result */ -#define E_XORN_IMM(dest, src1, imm12s) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (EU << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_XORN_IMMS(dest, src1, imm12s) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (1 << 9) + (EU << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_COND_XORN_IMM(cond, dest, src1, imm12s) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (cond << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) -#define E_COND_XORN_IMMS(cond, dest, src1, imm12s) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (1 << 9) + (cond << 5) + (imm12s << 20) + (1 << 18) + (1 << 19) - -/* XOR reg to reg with Post Shift Left */ -#define E_XOR_LSL(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (0 << 31) -#define E_XOR_LSLS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_XOR_LSL(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (0 << 31) -#define E_COND_XOR_LSLS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) - -/* XOR reg to reg XOR invert result with Post Shift Left */ -#define E_XORN_LSL(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_XORN_LSLS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_XORN_LSL(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (0 << 31) -#define E_COND_XORN_LSLS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (0 << 31) - -/* XOR reg to reg with Post Shift Right */ -#define E_XOR_LSR(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (0 << 31) -#define E_XOR_LSRS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_XOR_LSR(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (0 << 31) -#define E_COND_XOR_LSRS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) - -/* XOR reg to reg XOR invert result with Post Shift Right */ -#define E_XORN_LSR(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_XORN_LSRS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_XORN_LSR(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (0 << 31) -#define E_COND_XORN_LSRS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (0 << 31) - -/* XOR reg to reg with Post Arith Shift Right */ -#define E_XOR_ASR(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (0 << 31) -#define E_XOR_ASRS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_XOR_ASR(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (0 << 31) -#define E_COND_XOR_ASRS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) - -/* XOR reg to reg XOR invert result with Post Arith Shift Right */ -#define E_XORN_ASR(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_XORN_ASRS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_XORN_ASR(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (0 << 31) -#define E_COND_XORN_ASRS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (0 << 31) - -/* XOR reg to reg with Post ROR */ -#define E_XOR_ROR(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (0 << 31) -#define E_XOR_RORS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_XOR_ROR(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (0 << 31) -#define E_COND_XOR_RORS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) - -/* XOR reg to reg XOR invert result with ROR */ -#define E_XORN_ROR(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_XORN_RORS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_XORN_ROR(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (0 << 31) -#define E_COND_XORN_RORS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (0 << 31) - -/* Flip Endianness and then shift5/Rotate */ - -/* XOR reg to reg with Flip */ -#define E_XOR_F(dest, src1, src2) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((0 & 0x1f) << 24) + (0 << 29) + (0 << 30) + \ - (1 << 31) -#define E_XOR_FS(dest, src1, src2) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_XOR_F(cond, dest, src1, src2) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((0 & 0x1f) << 24) + (0 << 29) + (0 << 30) + \ - (1 << 31) -#define E_COND_XOR_FS(cond, dest, src1, src2) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) - -/* XOR reg to reg and invert result with Flip */ -#define E_XORN_F(dest, src1, src2) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_XORN_FS(dest, src1, src2) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + ((0 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_XORN_F(cond, dest, src1, src2) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((0 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_XORN_FS(cond, dest, src1, src2) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + ((0 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) - -/* XOR reg to reg with Post Shift Left */ -#define E_XOR_FLSL(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_XOR_FLSLS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_XOR_FLSL(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_XOR_FLSLS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) - -/* XOR reg to reg XOR invert result with Post Shift Left */ -#define E_XORN_FLSL(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_XORN_FLSLS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_XORN_FLSL(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (0 << 30) + (1 << 31) -#define E_COND_XORN_FLSLS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (0 << 30) + (1 << 31) - -/* XOR reg to reg with Post Shift Right */ -#define E_XOR_FLSR(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (1 << 31) -#define E_XOR_FLSRS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_XOR_FLSR(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 30) + (1 << 31) -#define E_COND_XOR_FLSRS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) - -/* XOR reg to reg XOR invert result with Post Shift Right */ -#define E_XORN_FLSR(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_XORN_FLSRS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_XORN_FLSR(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (0 << 29) + (1 << 30) + (1 << 31) -#define E_COND_XORN_FLSRS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (0 << 29) + (1 << 30) + (1 << 31) - -/* XOR reg to reg with Post Arith Shift Right */ -#define E_XOR_FASR(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (1 << 31) -#define E_XOR_FASRS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_XOR_FASR(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (0 << 30) + (1 << 31) -#define E_COND_XOR_FASRS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) - -/* XOR reg to reg XOR invert result with Post Arith Shift Right */ -#define E_XORN_FASR(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_XORN_FASRS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_XORN_FASR(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 30) + (1 << 31) -#define E_COND_XORN_FASRS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (0 << 30) + (1 << 31) - -/* XOR reg to reg with Post ROR */ -#define E_XOR_FROR(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (1 << 31) -#define E_XOR_FRORS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_XOR_FROR(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + ((shift5 & 0x1f) << 24) + (1 << 29) + \ - (1 << 30) + (1 << 31) -#define E_COND_XOR_FRORS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) - -/* XOR reg to reg XOR invert result with ROR */ -#define E_XORN_FROR(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (EU << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_XORN_FRORS(dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (EU << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_XORN_FROR(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (cond << 5) + (1 << 19) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 30) + (1 << 31) -#define E_COND_XORN_FRORS(cond, dest, src1, src2, shift5) \ - DCD 0xe + (dest << 10) + (src1 << 14) + (src2 << 20) + (1 << 9) + (cond << 5) + (1 << 19) + \ - ((shift5 & 0x1f) << 24) + (1 << 29) + (1 << 30) + (1 << 31) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_Shift Codes */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Src1 r2shift SFlag - */ -/* Cond Imm Extra Operation */ -/* Left/Right Shift/Rotate */ - -/* Logical Shift */ -#define E_LSL(dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (0 << 18) -#define E_LSR(dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag */ -#define E_LSLS(dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (0 << 18) -#define E_LSRS(dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (0 << 18) - -/* Logical Shift and then AND */ -#define E_LSL_AND(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) -#define E_LSR_AND(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then AND */ -#define E_LSL_ANDS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) -#define E_LSR_ANDS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then OR */ -#define E_LSL_OR(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) -#define E_LSR_OR(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then OR */ -#define E_LSL_ORS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) -#define E_LSR_ORS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then XOR */ -#define E_LSL_XOR(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) -#define E_LSR_XOR(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then XOR */ -#define E_LSL_XORS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) -#define E_LSR_XORS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then ADD */ -#define E_LSL_ADD(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) -#define E_LSR_ADD(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then ADD */ -#define E_LSL_ADDS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) -#define E_LSR_ADDS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then SUB */ -#define E_LSL_SUB(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) -#define E_LSR_SUB(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then SUB */ -#define E_LSL_SUBS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) -#define E_LSR_SUBS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then ADC */ -#define E_LSL_ADC(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) -#define E_LSR_ADC(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then ADC */ -#define E_LSL_ADCS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) -#define E_LSR_ADCS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then SBC */ -#define E_LSL_SBC(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) -#define E_LSR_SBC(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then SBC */ -#define E_LSL_SBCS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) -#define E_LSR_SBCS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) - -/* Conditional */ -/* Logical Shift */ -#define E_COND_LSL(cond, dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (0 << 18) -#define E_COND_LSR(cond, dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag */ -#define E_COND_LSLS(cond, dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (0 << 18) -#define E_COND_LSRS(cond, dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (0 << 18) - -/* Logical Shift and then AND */ -#define E_COND_LSL_AND(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) -#define E_COND_LSR_AND(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then AND */ -#define E_COND_LSL_ANDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) -#define E_COND_LSR_ANDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then OR */ -#define E_COND_LSL_OR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) -#define E_COND_LSR_OR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then OR */ -#define E_COND_LSL_ORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) -#define E_COND_LSR_ORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then XOR */ -#define E_COND_LSL_XOR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) -#define E_COND_LSR_XOR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then XOR */ -#define E_COND_LSL_XORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) -#define E_COND_LSR_XORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then ADD */ -#define E_COND_LSL_ADD(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) -#define E_COND_LSR_ADD(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then ADD */ -#define E_COND_LSL_ADDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) -#define E_COND_LSR_ADDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then SUB */ -#define E_COND_LSL_SUB(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) -#define E_COND_LSR_SUB(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then SUB */ -#define E_COND_LSL_SUBS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) -#define E_COND_LSR_SUBS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then ADC */ -#define E_COND_LSL_ADC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) -#define E_COND_LSR_ADC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then ADC */ -#define E_COND_LSL_ADCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) -#define E_COND_LSR_ADCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then SBC */ -#define E_COND_LSL_SBC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) -#define E_COND_LSR_SBC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then SBC */ -#define E_COND_LSL_SBCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) -#define E_COND_LSR_SBCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) - -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_ROTATE Codes */ -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Src1 r2shift SFlag - */ -/* Cond Imm Extra Operation Left/Right - */ -/* Shift/Rotate */ - -/* Rotate */ -#define E_ROR(dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (1 << 18) -/* Rotate and Set Flag */ -#define E_RORS(dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (1 << 18) - -/* Rotate and then AND */ -#define E_ROR_AND(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then AND */ -#define E_ROR_ANDS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then OR */ -#define E_ROR_OR(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then OR */ -#define E_ROR_ORS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then XOR */ -#define E_ROR_XOR(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then XOR */ -#define E_ROR_XORS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then ADD */ -#define E_ROR_ADD(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then ADD */ -#define E_ROR_ADDS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then SUB */ -#define E_ROR_SUB(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then SUB */ -#define E_ROR_SUBS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then ADC */ -#define E_ROR_ADC(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then ADC */ -#define E_ROR_ADCS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then SBC */ -#define E_ROR_SBC(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then SBC */ -#define E_ROR_SBCS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) - -/* Conditional */ -/* Rotate */ -#define E_COND_ROR(cond, dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (1 << 18) -/* Rotate and Set Flag */ -#define E_COND_RORS(cond, dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (1 << 18) - -/* Rotate and then AND */ -#define E_COND_ROR_AND(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then AND */ -#define E_COND_ROR_ANDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then OR */ -#define E_COND_ROR_OR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then OR */ -#define E_COND_ROR_ORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then XOR */ -#define E_COND_ROR_XOR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then XOR */ -#define E_COND_ROR_XORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then ADD */ -#define E_COND_ROR_ADD(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then ADD */ -#define E_COND_ROR_ADDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then SUB */ -#define E_COND_ROR_SUB(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then SUB */ -#define E_COND_ROR_SUBS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then ADC */ -#define E_COND_ROR_ADC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then ADC */ -#define E_COND_ROR_ADCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then SBC */ -#define E_COND_ROR_SBC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then SBC */ -#define E_COND_ROR_SBCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) - -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* Arithmetical Shift Codes */ -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Src1 r2shift SFlag - */ -/* Cond Imm Extra Operation Left/Right - */ -/* Shift/Rotate Arith/Shift */ - -/* Arith Shift Right */ -#define E_ASR(dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag */ -#define E_ASRS(dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (1 << 18) - -/* Arith Shift Right and then AND */ -#define E_ASR_AND(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag then AND */ -#define E_ASR_ANDS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) - -/* Arith Shift Right and then OR */ -#define E_ASR_OR(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag then OR */ -#define E_ASR_ORS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) - -/* Arith Shift Right and then XOR */ -#define E_ASR_XOR(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag then XOR */ -#define E_ASR_XORS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) - -/* Arith Shift Right and then ADD */ -#define E_ASR_ADD(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag then ADD */ -#define E_ASR_ADDS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) - -/* Arith Shift Right and then SUB */ -#define E_ASR_SUB(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag then SUB */ -#define E_ASR_SUBS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) - -/* Arith Shift Right and then ADC */ -#define E_ASR_ADC(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag then ADC */ -#define E_ASR_ADCS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) - -/* Arith Shift Right and then SBC */ -#define E_ASR_SBC(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag then SBC */ -#define E_ASR_SBCS(dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) - -/* Conditional */ -/* Conditional Arith Shift */ -#define E_COND_ASR(cond, dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag */ -#define E_COND_ASRS(cond, dest, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (1 << 18) - -/* Conditional Arith Shift and then AND */ -#define E_COND_ASR_AND(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag then AND */ -#define E_COND_ASR_ANDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) - -/* Conditional Arith Shift and then OR */ -#define E_COND_ASR_OR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag then OR */ -#define E_COND_ASR_ORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) - -/* Conditional Arith Shift and then XOR */ -#define E_COND_ASR_XOR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag then XOR */ -#define E_COND_ASR_XORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) - -/* Conditional Arith Shift and then ADD */ -#define E_COND_ASR_ADD(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag then ADD */ -#define E_COND_ASR_ADDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) - -/* Conditional Arith Shift and then SUB */ -#define E_COND_ASR_SUB(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag then SUB */ -#define E_COND_ASR_SUBS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) - -/* Conditional Arith Shift and then ADC */ -#define E_COND_ASR_ADC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag then ADC */ -#define E_COND_ASR_ADCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) - -/* Conditional Arith Shift and then SBC */ -#define E_COND_ASR_SBC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag then SBC */ -#define E_COND_ASR_SBCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x10 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) - -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* Flip Opcodes */ -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* opcode Dest Src1 r2shift SFlag - */ -/* Cond Imm Extra Operation Endian/bit - */ -/* ARITH Arith/Shift */ - -/* Flip Endian , ASR Right */ -#define E_FEND_ASR(dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 18) + (1 << 19) -/* Flip Endian , ASR Right ,Set Flag */ -#define E_FEND_ASRS(dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 18) + (1 << 19) - -/* Flip Endian , ASR Right , AND */ -#define E_FEND_ASR_AND(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 18) + (1 << 19) -/* Flip Endian , ASR Right ,Set Flag then AND */ -#define E_FEND_ASR_ANDS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 18) + (1 << 19) - -/* Flip Endian , ASR Right , OR */ -#define E_FEND_ASR_OR(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 18) + (1 << 19) -/* Flip Endian , ASR Right ,Set Flag then OR */ -#define E_FEND_ASR_ORS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 18) + (1 << 19) - -/* Flip Endian , ASR Right , XOR */ -#define E_FEND_ASR_XOR(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 18) + (1 << 19) -/* Flip Endian , ASR Right ,Set Flag then XOR */ -#define E_FEND_ASR_XORS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 18) + (1 << 19) - -/* Flip Endian , ASR Right , ADD */ -#define E_FEND_ASR_ADD(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 18) + (1 << 19) -/* Flip Endian , ASR Right ,Set Flag then ADD */ -#define E_FEND_ASR_ADDS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 18) + (1 << 19) - -/* Flip Endian , ASR Right , SUB */ -#define E_FEND_ASR_SUB(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 18) + (1 << 19) -/* Flip Endian , ASR Right ,Set Flag then SUB */ -#define E_FEND_ASR_SUBS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 18) + (1 << 19) - -/* Flip Endian , ASR Right , ADC */ -#define E_FEND_ASR_ADC(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 18) + (1 << 19) -/* Flip Endian , ASR Right ,Set Flag then ADC */ -#define E_FEND_ASR_ADCS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 18) + (1 << 19) - -/* Flip Endian , ASR Right , SBC */ -#define E_FEND_ASR_SBC(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 18) + (1 << 19) -/* Flip Endian , ASR Right ,Set Flag then SBC */ -#define E_FEND_ASR_SBCS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 18) + (1 << 19) - -/* Conditional */ -/* Conditional Flip Endian , ASR */ -#define E_COND_FEND_ASR(cond, dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 18) + (1 << 19) -/* Conditional Flip Endian , ASR ,Set Flag */ -#define E_COND_FEND_ASRS(cond, dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 18) + (1 << 19) - -/* Conditional Flip Endian , ASR , AND */ -#define E_COND_FEND_ASR_AND(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 18) + (1 << 19) -/* Conditional Flip Endian , ASR ,Set Flag then AND */ -#define E_COND_FEND_ASR_ANDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 18) + (1 << 19) - -/* Conditional Flip Endian , ASR , OR */ -#define E_COND_FEND_ASR_OR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 18) + (1 << 19) -/* Conditional Flip Endian , ASR ,Set Flag then OR */ -#define E_COND_FEND_ASR_ORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 18) + (1 << 19) - -/* Conditional Flip Endian , ASR , XOR */ -#define E_COND_FEND_ASR_XOR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 18) + (1 << 19) -/* Conditional Flip Endian , ASR ,Set Flag then XOR */ -#define E_COND_FEND_ASR_XORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 18) + (1 << 19) - -/* Conditional Flip Endian , ASR , ADD */ -#define E_COND_FEND_ASR_ADD(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 18) + (1 << 19) -/* Conditional Flip Endian , ASR ,Set Flag then ADD */ -#define E_COND_FEND_ASR_ADDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 18) + (1 << 19) - -/* Conditional Flip Endian , ASR , SUB */ -#define E_COND_FEND_ASR_SUB(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 18) + (1 << 19) -/* Conditional Flip Endian , ASR ,Set Flag then SUB */ -#define E_COND_FEND_ASR_SUBS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 18) + (1 << 19) - -/* Conditional Flip Endian , ASR , ADC */ -#define E_COND_FEND_ASR_ADC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 18) + (1 << 19) -/* Conditional Flip Endian , ASR ,Set Flag then ADC */ -#define E_COND_FEND_ASR_ADCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 18) + (1 << 19) - -/* Conditional Flip Endian , ASR , SBC */ -#define E_COND_FEND_ASR_SBC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 18) + (1 << 19) -/* Conditional Flip Endian , ASR ,Set Flag then SBC */ -#define E_COND_FEND_ASR_SBCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 18) + (1 << 19) - -/* Bitwise Flip ASR */ - -/* Flip Bitwise , ASR Right */ -#define E_FBIT_ASR(dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 18) + (1 << 19) -/* Flip Bitwise , ASR Right ,Set Flag */ -#define E_FBIT_ASRS(dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 18) + (1 << 19) - -/* Flip Bitwise , ASR Right , AND */ -#define E_FBIT_ASR_AND(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 18) + (1 << 19) -/* Flip Bitwise , ASR Right ,Set Flag then AND */ -#define E_FBIT_ASR_ANDS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 18) + (1 << 19) - -/* Flip Bitwise , ASR Right , OR */ -#define E_FBIT_ASR_OR(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 18) + (1 << 19) -/* Flip Bitwise , ASR Right ,Set Flag then OR */ -#define E_FBIT_ASR_ORS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 18) + (1 << 19) - -/* Flip Bitwise , ASR Right , XOR */ -#define E_FBIT_ASR_XOR(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 18) + (1 << 19) -/* Flip Bitwise , ASR Right ,Set Flag then XOR */ -#define E_FBIT_ASR_XORS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 18) + (1 << 19) - -/* Flip Bitwise , ASR Right , ADD */ -#define E_FBIT_ASR_ADD(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 18) + (1 << 19) -/* Flip Bitwise , ASR Right ,Set Flag then ADD */ -#define E_FBIT_ASR_ADDS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 18) + (1 << 19) - -/* Flip Bitwise , ASR Right , SUB */ -#define E_FBIT_ASR_SUB(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 18) + (1 << 19) -/* Flip Bitwise , ASR Right ,Set Flag then SUB */ -#define E_FBIT_ASR_SUBS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 18) + (1 << 19) - -/* Flip Bitwise , ASR Right , ADC */ -#define E_FBIT_ASR_ADC(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 18) + (1 << 19) -/* Flip Bitwise , ASR Right ,Set Flag then ADC */ -#define E_FBIT_ASR_ADCS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 18) + (1 << 19) - -/* Flip Bitwise , ASR Right , SBC */ -#define E_FBIT_ASR_SBC(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 18) + (1 << 19) -/* Flip Bitwise , ASR Right ,Set Flag then SBC */ -#define E_FBIT_ASR_SBCS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 18) + (1 << 19) - -/* Conditional */ -/* Conditional Flip Bitwise , ASR */ -#define E_COND_FBIT_ASR(cond, dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 18) + (1 << 19) -/* Conditional Flip Bitwise , ASR ,Set Flag */ -#define E_COND_FBIT_ASRS(cond, dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 18) + (1 << 19) - -/* Conditional Flip Bitwise , ASR , AND */ -#define E_COND_FBIT_ASR_AND(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 18) + (1 << 19) -/* Conditional Flip Bitwise , ASR ,Set Flag then AND */ -#define E_COND_FBIT_ASR_ANDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 18) + (1 << 19) - -/* Conditional Flip Bitwise , ASR , OR */ -#define E_COND_FBIT_ASR_OR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 18) + (1 << 19) -/* Conditional Flip Bitwise , ASR ,Set Flag then OR */ -#define E_COND_FBIT_ASR_ORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 18) + (1 << 19) - -/* Conditional Flip Bitwise , ASR , XOR */ -#define E_COND_FBIT_ASR_XOR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 18) + (1 << 19) -/* Conditional Flip Bitwise , ASR ,Set Flag then XOR */ -#define E_COND_FBIT_ASR_XORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 18) + (1 << 19) - -/* Conditional Flip Bitwise , ASR , ADD */ -#define E_COND_FBIT_ASR_ADD(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 18) + (1 << 19) -/* Conditional Flip Bitwise , ASR ,Set Flag then ADD */ -#define E_COND_FBIT_ASR_ADDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 18) + (1 << 19) - -/* Conditional Flip Bitwise , ASR , SUB */ -#define E_COND_FBIT_ASR_SUB(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 18) + (1 << 19) -/* Conditional Flip Bitwise , ASR ,Set Flag then SUB */ -#define E_COND_FBIT_ASR_SUBS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 18) + (1 << 19) - -/* Conditional Flip Bitwise , ASR , ADC */ -#define E_COND_FBIT_ASR_ADC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 18) + (1 << 19) -/* Conditional Flip Bitwise , ASR ,Set Flag then ADC */ -#define E_COND_FBIT_ASR_ADCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 18) + (1 << 19) - -/* Conditional Flip Bitwise , ASR , SBC */ -#define E_COND_FBIT_ASR_SBC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 18) + (1 << 19) -/* Conditional Flip Bitwise , ASR ,Set Flag then SBC */ -#define E_COND_FBIT_ASR_SBCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 18) + (1 << 19) - -/* Flip Endian , LSR Right */ -#define E_FEND_LSR(dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 18) + (0 << 19) -/* Flip Endian , LSR Right ,Set Flag */ -#define E_FEND_LSRS(dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 18) + (0 << 19) - -/* Flip Endian , LSR Right , AND */ -#define E_FEND_LSR_AND(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 18) + (0 << 19) -/* Flip Endian , LSR Right ,Set Flag then AND */ -#define E_FEND_LSR_ANDS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 18) + (0 << 19) - -/* Flip Endian , LSR Right , OR */ -#define E_FEND_LSR_OR(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 18) + (0 << 19) -/* Flip Endian , LSR Right ,Set Flag then OR */ -#define E_FEND_LSR_ORS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 18) + (0 << 19) - -/* Flip Endian , LSR Right , XOR */ -#define E_FEND_LSR_XOR(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 18) + (0 << 19) -/* Flip Endian , LSR Right ,Set Flag then XOR */ -#define E_FEND_LSR_XORS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 18) + (0 << 19) - -/* Flip Endian , LSR Right , ADD */ -#define E_FEND_LSR_ADD(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 18) + (0 << 19) -/* Flip Endian , LSR Right ,Set Flag then ADD */ -#define E_FEND_LSR_ADDS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 18) + (0 << 19) - -/* Flip Endian , LSR Right , SUB */ -#define E_FEND_LSR_SUB(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 18) + (0 << 19) -/* Flip Endian , LSR Right ,Set Flag then SUB */ -#define E_FEND_LSR_SUBS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 18) + (0 << 19) - -/* Flip Endian , LSR Right , ADC */ -#define E_FEND_LSR_ADC(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 18) + (0 << 19) -/* Flip Endian , LSR Right ,Set Flag then ADC */ -#define E_FEND_LSR_ADCS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 18) + (0 << 19) - -/* Flip Endian , LSR Right , SBC */ -#define E_FEND_LSR_SBC(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 18) + (0 << 19) -/* Flip Endian , LSR Right ,Set Flag then SBC */ -#define E_FEND_LSR_SBCS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 18) + (0 << 19) - -/* Conditional */ -/* Conditional Flip Endian , LSR */ -#define E_COND_FEND_LSR(cond, dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 18) + (0 << 19) -/* Conditional Flip Endian , LSR ,Set Flag */ -#define E_COND_FEND_LSRS(cond, dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (0 << 18) + (0 << 19) - -/* Conditional Flip Endian , LSR , AND */ -#define E_COND_FEND_LSR_AND(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 18) + (0 << 19) -/* Conditional Flip Endian , LSR ,Set Flag then AND */ -#define E_COND_FEND_LSR_ANDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (0 << 18) + (0 << 19) - -/* Conditional Flip Endian , LSR , OR */ -#define E_COND_FEND_LSR_OR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 18) + (0 << 19) -/* Conditional Flip Endian , LSR ,Set Flag then OR */ -#define E_COND_FEND_LSR_ORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (0 << 18) + (0 << 19) - -/* Conditional Flip Endian , LSR , XOR */ -#define E_COND_FEND_LSR_XOR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 18) + (0 << 19) -/* Conditional Flip Endian , LSR ,Set Flag then XOR */ -#define E_COND_FEND_LSR_XORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (0 << 18) + (0 << 19) - -/* Conditional Flip Endian , LSR , ADD */ -#define E_COND_FEND_LSR_ADD(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 18) + (0 << 19) -/* Conditional Flip Endian , LSR ,Set Flag then ADD */ -#define E_COND_FEND_LSR_ADDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (0 << 18) + (0 << 19) - -/* Conditional Flip Endian , LSR , SUB */ -#define E_COND_FEND_LSR_SUB(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 18) + (0 << 19) -/* Conditional Flip Endian , LSR ,Set Flag then SUB */ -#define E_COND_FEND_LSR_SUBS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (0 << 18) + (0 << 19) - -/* Conditional Flip Endian , LSR , ADC */ -#define E_COND_FEND_LSR_ADC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 18) + (0 << 19) -/* Conditional Flip Endian , LSR ,Set Flag then ADC */ -#define E_COND_FEND_LSR_ADCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (0 << 18) + (0 << 19) - -/* Conditional Flip Endian , LSR , SBC */ -#define E_COND_FEND_LSR_SBC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 18) + (0 << 19) -/* Conditional Flip Endian , LSR ,Set Flag then SBC */ -#define E_COND_FEND_LSR_SBCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (0 << 18) + (0 << 19) - -/* Bitwise Flip LSR */ - -/* Flip Bitwise , LSR Right */ -#define E_FBIT_LSR(dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 18) + (0 << 19) -/* Flip Bitwise , LSR Right ,Set Flag */ -#define E_FBIT_LSRS(dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 18) + (0 << 19) - -/* Flip Bitwise , LSR Right , AND */ -#define E_FBIT_LSR_AND(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 18) + (0 << 19) -/* Flip Bitwise , LSR Right ,Set Flag then AND */ -#define E_FBIT_LSR_ANDS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 18) + (0 << 19) - -/* Flip Bitwise , LSR Right , OR */ -#define E_FBIT_LSR_OR(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 18) + (0 << 19) -/* Flip Bitwise , LSR Right ,Set Flag then OR */ -#define E_FBIT_LSR_ORS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 18) + (0 << 19) - -/* Flip Bitwise , LSR Right , XOR */ -#define E_FBIT_LSR_XOR(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 18) + (0 << 19) -/* Flip Bitwise , LSR Right ,Set Flag then XOR */ -#define E_FBIT_LSR_XORS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 18) + (0 << 19) - -/* Flip Bitwise , LSR Right , ADD */ -#define E_FBIT_LSR_ADD(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 18) + (0 << 19) -/* Flip Bitwise , LSR Right ,Set Flag then ADD */ -#define E_FBIT_LSR_ADDS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 18) + (0 << 19) - -/* Flip Bitwise , LSR Right , SUB */ -#define E_FBIT_LSR_SUB(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 18) + (0 << 19) -/* Flip Bitwise , LSR Right ,Set Flag then SUB */ -#define E_FBIT_LSR_SUBS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 18) + (0 << 19) - -/* Flip Bitwise , LSR Right , ADC */ -#define E_FBIT_LSR_ADC(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 18) + (0 << 19) -/* Flip Bitwise , LSR Right ,Set Flag then ADC */ -#define E_FBIT_LSR_ADCS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 18) + (0 << 19) - -/* Flip Bitwise , LSR Right , SBC */ -#define E_FBIT_LSR_SBC(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 18) + (0 << 19) -/* Flip Bitwise , LSR Right ,Set Flag then SBC */ -#define E_FBIT_LSR_SBCS(dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 18) + (0 << 19) - -/* Conditional */ -/* Conditional Flip Bitwise , LSR */ -#define E_COND_FBIT_LSR(cond, dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 18) + (0 << 19) -/* Conditional Flip Bitwise , LSR ,Set Flag */ -#define E_COND_FBIT_LSRS(cond, dest, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + (0 << 29) + \ - (1 << 18) + (0 << 19) - -/* Conditional Flip Bitwise , LSR , AND */ -#define E_COND_FBIT_LSR_AND(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 18) + (0 << 19) -/* Conditional Flip Bitwise , LSR ,Set Flag then AND */ -#define E_COND_FBIT_LSR_ANDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (1 << 29) + (1 << 18) + (0 << 19) - -/* Conditional Flip Bitwise , LSR , OR */ -#define E_COND_FBIT_LSR_OR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 18) + (0 << 19) -/* Conditional Flip Bitwise , LSR ,Set Flag then OR */ -#define E_COND_FBIT_LSR_ORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (2 << 29) + (1 << 18) + (0 << 19) - -/* Conditional Flip Bitwise , LSR , XOR */ -#define E_COND_FBIT_LSR_XOR(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 18) + (0 << 19) -/* Conditional Flip Bitwise , LSR ,Set Flag then XOR */ -#define E_COND_FBIT_LSR_XORS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (3 << 29) + (1 << 18) + (0 << 19) - -/* Conditional Flip Bitwise , LSR , ADD */ -#define E_COND_FBIT_LSR_ADD(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 18) + (0 << 19) -/* Conditional Flip Bitwise , LSR ,Set Flag then ADD */ -#define E_COND_FBIT_LSR_ADDS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (4 << 29) + (1 << 18) + (0 << 19) - -/* Conditional Flip Bitwise , LSR , SUB */ -#define E_COND_FBIT_LSR_SUB(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 18) + (0 << 19) -/* Conditional Flip Bitwise , LSR ,Set Flag then SUB */ -#define E_COND_FBIT_LSR_SUBS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (5 << 29) + (1 << 18) + (0 << 19) - -/* Conditional Flip Bitwise , LSR , ADC */ -#define E_COND_FBIT_LSR_ADC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 18) + (0 << 19) -/* Conditional Flip Bitwise , LSR ,Set Flag then ADC */ -#define E_COND_FBIT_LSR_ADCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (6 << 29) + (1 << 18) + (0 << 19) - -/* Conditional Flip Bitwise , LSR , SBC */ -#define E_COND_FBIT_LSR_SBC(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 18) + (0 << 19) -/* Conditional Flip Bitwise , LSR ,Set Flag then SBC */ -#define E_COND_FBIT_LSR_SBCS(cond, dest, roperand, r2shift, shift5) \ - DCD 0x11 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((shift5 & 0x1f) << 24) + \ - (7 << 29) + (1 << 18) + (0 << 19) - -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_ANDOR */ -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* opcode Dest Src1 src2 SFlag */ -/* Cond SRC3 */ - -/* ANDOR */ -#define E_ANDOR(dest, rsrc, rand, ror) \ - DCD 0x16 + (dest << 10) + (rsrc << 14)(rand << 20) + (0 << 9) + (EU << 5) + (ror << 24) -#define E_ANDORS(dest, rsrc, rand, ror) \ - DCD 0x16 + (dest << 10) + (rsrc << 14)(rand << 20) + (1 << 9) + (EU << 5) + (ror << 24) -#define E_COND_ANDOR(cond, dest, rsrc, rand, ror) \ - DCD 0x16 + (dest << 10) + (rsrc << 14)(rand << 20) + (0 << 9) + (cond << 5) + (ror << 24) -#define E_COND_ANDORS(cond, dest, rsrc, rand, ror) \ - DCD 0x16 + (dest << 10) + (rsrc << 14)(rand << 20) + (1 << 9) + (cond << 5) + (ror << 24) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_Shift byte reg Codes */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Src1 src2 SFlag Cond - */ -/* Imm Extra Operation Left/Right */ -/* Shift/Rotate Invert */ - -/* Logical Shift */ -#define E_RLSL(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (0 << 18) -#define E_RLSR(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag */ -#define E_RLSLS(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (0 << 18) -#define E_RLSRS(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (0 << 18) - -/* Logical Shift and then AND */ -#define E_RLSL_AND(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) -#define E_RLSR_AND(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then AND */ -#define E_RLSL_ANDS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) -#define E_RLSR_ANDS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then OR */ -#define E_RLSL_OR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) -#define E_RLSR_OR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then OR */ -#define E_RLSL_ORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) -#define E_RLSR_ORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then XOR */ -#define E_RLSL_XOR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) -#define E_RLSR_XOR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then XOR */ -#define E_RLSL_XORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) -#define E_RLSR_XORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then ADD */ -#define E_RLSL_ADD(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) -#define E_RLSR_ADD(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then ADD */ -#define E_RLSL_ADDS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) -#define E_RLSR_ADDS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then SUB */ -#define E_RLSL_SUB(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) -#define E_RLSR_SUB(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then SUB */ -#define E_RLSL_SUBS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) -#define E_RLSR_SUBS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then ADC */ -#define E_RLSL_ADC(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) -#define E_RLSR_ADC(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then ADC */ -#define E_RLSL_ADCS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) -#define E_RLSR_ADCS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then SBC */ -#define E_RLSL_SBC(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) -#define E_RLSR_SBC(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then SBC */ -#define E_RLSL_SBCS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) -#define E_RLSR_SBCS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) - -/* Conditional */ -/* Logical Shift */ -#define E_COND_RLSL(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (0 << 18) -#define E_COND_RLSR(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag */ -#define E_COND_RLSLS(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (0 << 18) -#define E_COND_RLSRS(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (0 << 18) - -/* Logical Shift and then AND */ -#define E_COND_RLSL_AND(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) -#define E_COND_RLSR_AND(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then AND */ -#define E_COND_RLSL_ANDS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) -#define E_COND_RLSR_ANDS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then OR */ -#define E_COND_RLSL_OR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) -#define E_COND_RLSR_OR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then OR */ -#define E_COND_RLSL_ORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) -#define E_COND_RLSR_ORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then XOR */ -#define E_COND_RLSL_XOR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) -#define E_COND_RLSR_XOR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then XOR */ -#define E_COND_RLSL_XORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) -#define E_COND_RLSR_XORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then ADD */ -#define E_COND_RLSL_ADD(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) -#define E_COND_RLSR_ADD(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then ADD */ -#define E_COND_RLSL_ADDS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) -#define E_COND_RLSR_ADDS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then SUB */ -#define E_COND_RLSL_SUB(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) -#define E_COND_RLSR_SUB(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then SUB */ -#define E_COND_RLSL_SUBS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) -#define E_COND_RLSR_SUBS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then ADC */ -#define E_COND_RLSL_ADC(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) -#define E_COND_RLSR_ADC(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then ADC */ -#define E_COND_RLSL_ADCS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) -#define E_COND_RLSR_ADCS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) - -/* Logical Shift and then SBC */ -#define E_COND_RLSL_SBC(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) -#define E_COND_RLSR_SBC(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) -/* Logical Shift and Set Flag then SBC */ -#define E_COND_RLSL_SBCS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) -#define E_COND_RLSR_SBCS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) - -/* opcode Dest Src1 r2shift SFlag - */ -/* Cond Imm Extra Operation */ -/* Left/Right Shift/Rotate POSTshift */ - -/* Logical Shift and then AND */ -#define E_AND_RLSL(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_AND_RLSR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) + (1 << 28) -/* Logical Shift and Set Flag then AND */ -#define E_AND_RLSLS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_AND_RLSRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) + (1 << 28) - -/* Logical Shift and then OR */ -#define E_OR_RLSL(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_OR_RLSR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) + (1 << 28) -/* Logical Shift and Set Flag then OR */ -#define E_OR_RLSLS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_OR_RLSRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) + (1 << 28) - -/* Logical Shift and then XOR */ -#define E_XOR_RLSL(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_XOR_RLSR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) + (1 << 28) -/* Logical Shift and Set Flag then XOR */ -#define E_XOR_RLSLS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_XOR_RLSRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) + (1 << 28) - -/* Logical Shift and then ADD */ -#define E_ADD_RLSL(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_ADD_RLSR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) + (1 << 28) -/* Logical Shift and Set Flag then ADD */ -#define E_ADD_RLSLS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_ADD_RLSRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) + (1 << 28) - -/* Logical Shift and then SUB */ -#define E_SUB_RLSL(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_SUB_RLSR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) + (1 << 28) -/* Logical Shift and Set Flag then SUB */ -#define E_SUB_RLSLS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_SUB_RLSRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) + (1 << 28) - -/* Logical Shift and then ADC */ -#define E_ADC_RLSL(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_ADC_RLSR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) + (1 << 28) -/* Logical Shift and Set Flag then ADC */ -#define E_ADC_RLSLS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_ADC_RLSRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) + (1 << 28) - -/* Logical Shift and then SBC */ -#define E_SBC_RLSL(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_SBC_RLSR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) + (1 << 28) -/* Logical Shift and Set Flag then SBC */ -#define E_SBC_RLSLS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_SBC_RLSRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) + (1 << 28) - -/* Conditional */ - -/* Logical Shift and then AND */ -#define E_COND_AND_RLSL(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_COND_AND_RLSR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) + (1 << 28) -/* Logical Shift and Set Flag then AND */ -#define E_COND_AND_RLSLS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_COND_AND_RLSRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) + (1 << 28) - -/* Logical Shift and then OR */ -#define E_COND_OR_RLSL(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_COND_OR_RLSR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) + (1 << 28) -/* Logical Shift and Set Flag then OR */ -#define E_COND_OR_RLSLS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_COND_OR_RLSRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) + (1 << 28) - -/* Logical Shift and then XOR */ -#define E_COND_XOR_RLSL(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_COND_XOR_RLSR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) + (1 << 28) -/* Logical Shift and Set Flag then XOR */ -#define E_COND_XOR_RLSLS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_COND_XOR_RLSRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) + (1 << 28) - -/* Logical Shift and then ADD */ -#define E_COND_ADD_RLSL(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_COND_ADD_RLSR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) + (1 << 28) -/* Logical Shift and Set Flag then ADD */ -#define E_COND_ADD_RLSLS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_COND_ADD_RLSRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) + (1 << 28) - -/* Logical Shift and then SUB */ -#define E_COND_SUB_RLSL(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_COND_SUB_RLSR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) + (1 << 28) -/* Logical Shift and Set Flag then SUB */ -#define E_COND_SUB_RLSLS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_COND_SUB_RLSRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) + (1 << 28) - -/* Logical Shift and then ADC */ -#define E_COND_ADC_RLSL(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_COND_ADC_RLSR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) + (1 << 28) -/* Logical Shift and Set Flag then ADC */ -#define E_COND_ADC_RLSLS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_COND_ADC_RLSRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) + (1 << 28) - -/* Logical Shift and then SBC */ -#define E_COND_SBC_RLSL(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_COND_SBC_RLSR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) + (1 << 28) -/* Logical Shift and Set Flag then SBC */ -#define E_COND_SBC_RLSLS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) + (1 << 28) -#define E_COND_SBC_RLSRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) + (1 << 28) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_Shift byte reg with inversion */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* Logical Shift */ -#define E_RLSLN(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSRN(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag */ -#define E_RLSLNS(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSRNS(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (0 << 18) + (1 << 27) - -/* Logical Shift and then AND */ -#define E_RLSL_ANDN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSR_ANDN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag then AND */ -#define E_RLSL_ANDNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSR_ANDNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) + (1 << 27) - -/* Logical Shift and then OR */ -#define E_RLSL_ORN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSR_ORN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag then OR */ -#define E_RLSL_ORNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSR_ORNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) + (1 << 27) - -/* Logical Shift and then XOR */ -#define E_RLSL_XORN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSR_XORN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag then XOR */ -#define E_RLSL_XORNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSR_XORNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) + (1 << 27) - -/* Logical Shift and then ADD */ -#define E_RLSL_ADDN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSR_ADDN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag then ADD */ -#define E_RLSL_ADDNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSR_ADDNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) + (1 << 27) - -/* Logical Shift and then SUB */ -#define E_RLSL_SUBN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSR_SUBN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag then SUB */ -#define E_RLSL_SUBNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSR_SUBNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) + (1 << 27) - -/* Logical Shift and then ADC */ -#define E_RLSL_ADCN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSR_ADCN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag then ADC */ -#define E_RLSL_ADCNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSR_ADCNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) + (1 << 27) - -/* Logical Shift and then SBC */ -#define E_RLSL_SBCN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSR_SBCN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag then SBC */ -#define E_RLSL_SBCNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_RLSR_SBCNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) + (1 << 27) - -/* Conditional */ -/* Logical Shift */ -#define E_COND_RLSLN(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSRN(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag */ -#define E_COND_RLSLNS(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSRNS(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (0 << 18) + (1 << 27) - -/* Logical Shift and then AND */ -#define E_COND_RLSL_ANDN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSR_ANDN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag then AND */ -#define E_COND_RLSL_ANDNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSR_ANDNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) + (1 << 27) - -/* Logical Shift and then OR */ -#define E_COND_RLSL_ORN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSR_ORN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag then OR */ -#define E_COND_RLSL_ORNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSR_ORNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) + (1 << 27) - -/* Logical Shift and then XOR */ -#define E_COND_RLSL_XORN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSR_XORN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag then XOR */ -#define E_COND_RLSL_XORNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSR_XORNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) + (1 << 27) - -/* Logical Shift and then ADD */ -#define E_COND_RLSL_ADDN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSR_ADDN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag then ADD */ -#define E_COND_RLSL_ADDNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSR_ADDNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) + (1 << 27) - -/* Logical Shift and then SUB */ -#define E_COND_RLSL_SUBN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSR_SUBN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag then SUB */ -#define E_COND_RLSL_SUBNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSR_SUBNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) + (1 << 27) - -/* Logical Shift and then ADC */ -#define E_COND_RLSL_ADCN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSR_ADCN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag then ADC */ -#define E_COND_RLSL_ADCNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSR_ADCNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) + (1 << 27) - -/* Logical Shift and then SBC */ -#define E_COND_RLSL_SBCN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSR_SBCN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) + (1 << 27) -/* Logical Shift and Set Flag then SBC */ -#define E_COND_RLSL_SBCNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) + (1 << 27) -#define E_COND_RLSR_SBCNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) + (1 << 27) - -/* opcode Dest Src1 r2shift SFlag - */ -/* Cond Imm Extra Operation */ -/* Left/Right Shift/Rotate Inv POSTshift */ - -/* Logical Shift and then AND */ -#define E_ANDN_RLSL(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_ANDN_RLSR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -/* Logical Shift and Set Flag then AND */ -#define E_ANDN_RLSLS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_ANDN_RLSRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) - -/* Logical Shift and then OR */ -#define E_ORN_RLSL(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_ORN_RLSR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -/* Logical Shift and Set Flag then OR */ -#define E_ORN_RLSLS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_ORN_RLSRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) - -/* Logical Shift and then XOR */ -#define E_XORN_RLSL(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_XORN_RLSR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -/* Logical Shift and Set Flag then XOR */ -#define E_XORN_RLSLS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_XORN_RLSRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) - -/* Logical Shift and then ADD */ -#define E_ADDN_RLSL(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_ADDN_RLSR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -/* Logical Shift and Set Flag then ADD */ -#define E_ADDN_RLSLS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_ADDN_RLSRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) - -/* Logical Shift and then SUB */ -#define E_SUBN_RLSL(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_SUBN_RLSR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -/* Logical Shift and Set Flag then SUB */ -#define E_SUBN_RLSLS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_SUBN_RLSRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) - -/* Logical Shift and then ADC */ -#define E_ADCN_RLSL(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_ADCN_RLSR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -/* Logical Shift and Set Flag then ADC */ -#define E_ADCN_RLSLS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_ADCN_RLSRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) - -/* Logical Shift and then SBC */ -#define E_SBCN_RLSL(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_SBCN_RLSR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -/* Logical Shift and Set Flag then SBC */ -#define E_SBCN_RLSLS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_SBCN_RLSRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) - -/* Conditional */ - -/* Logical Shift and then AND */ -#define E_COND_ANDN_RLSL(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_COND_ANDN_RLSR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -/* Logical Shift and Set Flag then AND */ -#define E_COND_ANDN_RLSLS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_COND_ANDN_RLSRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) - -/* Logical Shift and then OR */ -#define E_COND_ORN_RLSL(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_COND_ORN_RLSR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -/* Logical Shift and Set Flag then OR */ -#define E_COND_ORN_RLSLS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_COND_ORN_RLSRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) - -/* Logical Shift and then XOR */ -#define E_COND_XORN_RLSL(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_COND_XORN_RLSR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -/* Logical Shift and Set Flag then XOR */ -#define E_COND_XORN_RLSLS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_COND_XORN_RLSRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) - -/* Logical Shift and then ADD */ -#define E_COND_ADDN_RLSL(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_COND_ADDN_RLSR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -/* Logical Shift and Set Flag then ADD */ -#define E_COND_ADDN_RLSLS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_COND_ADDN_RLSRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) - -/* Logical Shift and then SUB */ -#define E_COND_SUBN_RLSL(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_COND_SUBN_RLSR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -/* Logical Shift and Set Flag then SUB */ -#define E_COND_SUBN_RLSLS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_COND_SUBN_RLSRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) - -/* Logical Shift and then ADC */ -#define E_COND_ADCN_RLSL(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_COND_ADCN_RLSR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -/* Logical Shift and Set Flag then ADC */ -#define E_COND_ADCN_RLSLS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_COND_ADCN_RLSRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) - -/* Logical Shift and then SBC */ -#define E_COND_SBCN_RLSL(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_COND_SBCN_RLSR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -/* Logical Shift and Set Flag then SBC */ -#define E_COND_SBCN_RLSLS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (0 << 18) + (1 << 27) + (1 << 28) -#define E_COND_SBCN_RLSRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (0 << 18) + (1 << 27) + (1 << 28) - -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_ROTATE by Reg Codes */ -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Src1 r2shift SFlag - */ -/* Cond Imm Extra Operation Left/Right - */ -/* Shift/Rotate */ - -/* Rotate */ -#define E_RROR(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (1 << 18) -/* Rotate and Set Flag */ -#define E_RRORS(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (1 << 18) - -/* Rotate and then AND */ -#define E_RROR_AND(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then AND */ -#define E_RROR_ANDS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then OR */ -#define E_RROR_OR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then OR */ -#define E_RROR_ORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then XOR */ -#define E_RROR_XOR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then XOR */ -#define E_RROR_XORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then ADD */ -#define E_RROR_ADD(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then ADD */ -#define E_RROR_ADDS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then SUB */ -#define E_RROR_SUB(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then SUB */ -#define E_RROR_SUBS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then ADC */ -#define E_RROR_ADC(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then ADC */ -#define E_RROR_ADCS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then SBC */ -#define E_RROR_SBC(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then SBC */ -#define E_RROR_SBCS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) - -/* Conditional */ -/* Rotate */ -#define E_COND_RROR(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (1 << 18) -/* Rotate and Set Flag */ -#define E_COND_RRORS(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (1 << 18) - -/* Rotate and then AND */ -#define E_COND_RROR_AND(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then AND */ -#define E_COND_RROR_ANDS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then OR */ -#define E_COND_RROR_OR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then OR */ -#define E_COND_RROR_ORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then XOR */ -#define E_COND_RROR_XOR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then XOR */ -#define E_COND_RROR_XORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then ADD */ -#define E_COND_RROR_ADD(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then ADD */ -#define E_COND_RROR_ADDS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then SUB */ -#define E_COND_RROR_SUB(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then SUB */ -#define E_COND_RROR_SUBS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then ADC */ -#define E_COND_RROR_ADC(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then ADC */ -#define E_COND_RROR_ADCS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then SBC */ -#define E_COND_RROR_SBC(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) -/* Rotate and Set Flag then SBC */ -#define E_COND_RROR_SBCS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) - -/* Rotate and then AND */ -#define E_AND_RROR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) + (1 << 28) -/* Rotate and Set Flag then AND */ -#define E_AND_RRORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) + (1 << 28) - -/* Rotate and then OR */ -#define E_OR_RROR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) + (1 << 28) -/* Rotate and Set Flag then OR */ -#define E_OR_RRORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) + (1 << 28) - -/* Rotate and then XOR */ -#define E_XOR_RROR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) + (1 << 28) -/* Rotate and Set Flag then XOR */ -#define E_XOR_RRORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) + (1 << 28) - -/* Rotate and then ADD */ -#define E_ADD_RROR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) + (1 << 28) -/* Rotate and Set Flag then ADD */ -#define E_ADD_RRORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) + (1 << 28) - -/* Rotate and then SUB */ -#define E_SUB_RROR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) + (1 << 28) -/* Rotate and Set Flag then SUB */ -#define E_SUB_RRORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) + (1 << 28) - -/* Rotate and then ADC */ -#define E_ADC_RROR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) + (1 << 28) -/* Rotate and Set Flag then ADC */ -#define E_ADC_RRORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) + (1 << 28) - -/* Rotate and then SBC */ -#define E_SBC_RROR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) + (1 << 28) -/* Rotate and Set Flag then SBC */ -#define E_SBC_RRORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) + (1 << 28) - -/* Conditional */ - -/* Rotate and then AND */ -#define E_COND_AND_RROR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) + (1 << 28) -/* Rotate and Set Flag then AND */ -#define E_COND_AND_RRORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) + (1 << 28) - -/* Rotate and then OR */ -#define E_COND_OR_RROR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) + (1 << 28) -/* Rotate and Set Flag then OR */ -#define E_COND_OR_RRORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) + (1 << 28) - -/* Rotate and then XOR */ -#define E_COND_XOR_RROR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) + (1 << 28) -/* Rotate and Set Flag then XOR */ -#define E_COND_XOR_RRORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) + (1 << 28) - -/* Rotate and then ADD */ -#define E_COND_ADD_RROR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) + (1 << 28) -/* Rotate and Set Flag then ADD */ -#define E_COND_ADD_RRORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) + (1 << 28) - -/* Rotate and then SUB */ -#define E_COND_SUB_RROR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) + (1 << 28) -/* Rotate and Set Flag then SUB */ -#define E_COND_SUB_RRORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) + (1 << 28) - -/* Rotate and then ADC */ -#define E_COND_ADC_RROR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) + (1 << 28) -/* Rotate and Set Flag then ADC */ -#define E_COND_ADC_RRORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) + (1 << 28) - -/* Rotate and then SBC */ -#define E_COND_SBC_RROR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) + (1 << 28) -/* Rotate and Set Flag then SBC */ -#define E_COND_SBC_RRORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) + (1 << 28) - -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* E_ROTATE by Reg Codes and invert ALU result */ -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Src1 r2shift SFlag - */ -/* Cond Imm Extra Operation Left/Right - */ -/* Shift/Rotate */ - -/* Rotate */ -#define E_RRORN(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag */ -#define E_RRORNS(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (1 << 18) + (1 << 27) - -/* Rotate and then AND */ -#define E_RROR_ANDN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag then AND */ -#define E_RROR_ANDNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) + (1 << 27) - -/* Rotate and then OR */ -#define E_RROR_ORN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag then OR */ -#define E_RROR_ORNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) + (1 << 27) - -/* Rotate and then XOR */ -#define E_RROR_XORN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag then XOR */ -#define E_RROR_XORNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) + (1 << 27) - -/* Rotate and then ADD */ -#define E_RROR_ADDN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag then ADD */ -#define E_RROR_ADDNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) + (1 << 27) - -/* Rotate and then SUB */ -#define E_RROR_SUBN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag then SUB */ -#define E_RROR_SUBNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) + (1 << 27) - -/* Rotate and then ADC */ -#define E_RROR_ADCN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag then ADC */ -#define E_RROR_ADCNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) + (1 << 27) - -/* Rotate and then SBC */ -#define E_RROR_SBCN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag then SBC */ -#define E_RROR_SBCNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) + (1 << 27) - -/* Conditional */ -/* Rotate */ -#define E_COND_RRORN(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag */ -#define E_COND_RRORNS(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (1 << 19) + (1 << 18) + (1 << 27) - -/* Rotate and then AND */ -#define E_COND_RROR_ANDN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag then AND */ -#define E_COND_RROR_ANDNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) + (1 << 27) - -/* Rotate and then OR */ -#define E_COND_RROR_ORN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag then OR */ -#define E_COND_RROR_ORNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) + (1 << 27) - -/* Rotate and then XOR */ -#define E_COND_RROR_XORN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag then XOR */ -#define E_COND_RROR_XORNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) + (1 << 27) - -/* Rotate and then ADD */ -#define E_COND_RROR_ADDN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag then ADD */ -#define E_COND_RROR_ADDNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) + (1 << 27) - -/* Rotate and then SUB */ -#define E_COND_RROR_SUBN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag then SUB */ -#define E_COND_RROR_SUBNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) + (1 << 27) - -/* Rotate and then ADC */ -#define E_COND_RROR_ADCN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag then ADC */ -#define E_COND_RROR_ADCNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) + (1 << 27) - -/* Rotate and then SBC */ -#define E_COND_RROR_SBCN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) + (1 << 27) -/* Rotate and Set Flag then SBC */ -#define E_COND_RROR_SBCNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) + (1 << 27) - -/* Rotate and then AND */ -#define E_ANDN_RROR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Rotate and Set Flag then AND */ -#define E_ANDN_RRORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Rotate and then OR */ -#define E_ORN_RROR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Rotate and Set Flag then OR */ -#define E_ORN_RRORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Rotate and then XOR */ -#define E_XORN_RROR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Rotate and Set Flag then XOR */ -#define E_XORN_RRORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Rotate and then ADD */ -#define E_ADDN_RROR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Rotate and Set Flag then ADD */ -#define E_ADDN_RRORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Rotate and then SUB */ -#define E_SUBN_RROR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Rotate and Set Flag then SUB */ -#define E_SUBN_RRORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Rotate and then ADC */ -#define E_ADCN_RROR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Rotate and Set Flag then ADC */ -#define E_ADCN_RRORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Rotate and then SBC */ -#define E_SBCN_RROR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Rotate and Set Flag then SBC */ -#define E_SBCN_RRORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Conditional */ - -/* Rotate and then AND */ -#define E_COND_ANDN_RROR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Rotate and Set Flag then AND */ -#define E_COND_ANDN_RRORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Rotate and then OR */ -#define E_COND_ORN_RROR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Rotate and Set Flag then OR */ -#define E_COND_ORN_RRORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Rotate and then XOR */ -#define E_COND_XORN_RROR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Rotate and Set Flag then XOR */ -#define E_COND_XORN_RRORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Rotate and then ADD */ -#define E_COND_ADDN_RROR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Rotate and Set Flag then ADD */ -#define E_COND_ADDN_RRORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Rotate and then SUB */ -#define E_COND_SUBN_RROR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Rotate and Set Flag then SUB */ -#define E_COND_SUBN_RRORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Rotate and then ADC */ -#define E_COND_ADCN_RROR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Rotate and Set Flag then ADC */ -#define E_COND_ADCN_RRORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Rotate and then SBC */ -#define E_COND_SBCN_RROR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Rotate and Set Flag then SBC */ -#define E_COND_SBCN_RRORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (1 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* Arithmetical Shift Codes */ -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Src1 r2shift SFlag - */ -/* Cond Imm Extra Operation Left/Right - */ -/* Shift/Rotate Arith/Shift */ - -/* Arith Shift Right */ -#define E_RASR(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag */ -#define E_RASRS(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (1 << 18) - -/* Arith Shift Right and then AND */ -#define E_RASR_AND(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag then AND */ -#define E_RASR_ANDS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) - -/* Arith Shift Right and then OR */ -#define E_RASR_OR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag then OR */ -#define E_RASR_ORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) - -/* Arith Shift Right and then XOR */ -#define E_RASR_XOR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag then XOR */ -#define E_RASR_XORS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) - -/* Arith Shift Right and then ADD */ -#define E_RASR_ADD(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag then ADD */ -#define E_RASR_ADDS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) - -/* Arith Shift Right and then SUB */ -#define E_RASR_SUB(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag then SUB */ -#define E_RASR_SUBS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) - -/* Arith Shift Right and then ADC */ -#define E_RASR_ADC(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag then ADC */ -#define E_RASR_ADCS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) - -/* Arith Shift Right and then SBC */ -#define E_RASR_SBC(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) -/* Arith Shift Right and Set Flag then SBC */ -#define E_RASR_SBCS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) - -/* Conditional */ -/* Conditional Arith Shift */ -#define E_COND_RASR(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag */ -#define E_COND_RASRS(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (1 << 18) - -/* Conditional Arith Shift and then AND */ -#define E_COND_RASR_AND(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag then AND */ -#define E_COND_RASR_ANDS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) - -/* Conditional Arith Shift and then OR */ -#define E_COND_RASR_OR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag then OR */ -#define E_COND_RASR_ORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) - -/* Conditional Arith Shift and then XOR */ -#define E_COND_RASR_XOR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag then XOR */ -#define E_COND_RASR_XORS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) - -/* Conditional Arith Shift and then ADD */ -#define E_COND_RASR_ADD(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag then ADD */ -#define E_COND_RASR_ADDS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) - -/* Conditional Arith Shift and then SUB */ -#define E_COND_RASR_SUB(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag then SUB */ -#define E_COND_RASR_SUBS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) - -/* Conditional Arith Shift and then ADC */ -#define E_COND_RASR_ADC(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag then ADC */ -#define E_COND_RASR_ADCS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) - -/* Conditional Arith Shift and then SBC */ -#define E_COND_RASR_SBC(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) -/* Conditional Arith Shift and Set Flag then SBC */ -#define E_COND_RASR_SBCS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) - -/* Arith Shift Right and then AND */ -#define E_AND_RASR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) + (1 << 28) -/* Arith Shift Right and Set Flag then AND */ -#define E_AND_RASRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) + (1 << 28) - -/* Arith Shift Right and then OR */ -#define E_OR_RASR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) + (1 << 28) -/* Arith Shift Right and Set Flag then OR */ -#define E_OR_RASRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) + (1 << 28) - -/* Arith Shift Right and then XOR */ -#define E_XOR_RASR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) + (1 << 28) -/* Arith Shift Right and Set Flag then XOR */ -#define E_XOR_RASRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) + (1 << 28) - -/* Arith Shift Right and then ADD */ -#define E_ADD_RASR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) + (1 << 28) -/* Arith Shift Right and Set Flag then ADD */ -#define E_ADD_RASRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) + (1 << 28) - -/* Arith Shift Right and then SUB */ -#define E_SUB_RASR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) + (1 << 28) -/* Arith Shift Right and Set Flag then SUB */ -#define E_SUB_RASRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) + (1 << 28) - -/* Arith Shift Right and then ADC */ -#define E_ADC_RASR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) + (1 << 28) -/* Arith Shift Right and Set Flag then ADC */ -#define E_ADC_RASRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) + (1 << 28) - -/* Arith Shift Right and then SBC */ -#define E_SBC_RASR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) + (1 << 28) -/* Arith Shift Right and Set Flag then SBC */ -#define E_SBC_RASRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) + (1 << 28) - -/* Conditional */ - -/* Conditional Arith Shift and then AND */ -#define E_COND_AND_RASR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) + (1 << 28) -/* Conditional Arith Shift and Set Flag then AND */ -#define E_COND_AND_RASRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) + (1 << 28) - -/* Conditional Arith Shift and then OR */ -#define E_COND_OR_RASR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) + (1 << 28) -/* Conditional Arith Shift and Set Flag then OR */ -#define E_COND_OR_RASRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) + (1 << 28) - -/* Conditional Arith Shift and then XOR */ -#define E_COND_XOR_RASR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) + (1 << 28) -/* Conditional Arith Shift and Set Flag then XOR */ -#define E_COND_XOR_RASRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) + (1 << 28) - -/* Conditional Arith Shift and then ADD */ -#define E_COND_ADD_RASR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) + (1 << 28) -/* Conditional Arith Shift and Set Flag then ADD */ -#define E_COND_ADD_RASRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) + (1 << 28) - -/* Conditional Arith Shift and then SUB */ -#define E_COND_SUB_RASR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) + (1 << 28) -/* Conditional Arith Shift and Set Flag then SUB */ -#define E_COND_SUB_RASRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) + (1 << 28) - -/* Conditional Arith Shift and then ADC */ -#define E_COND_ADC_RASR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) + (1 << 28) -/* Conditional Arith Shift and Set Flag then ADC */ -#define E_COND_ADC_RASRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) + (1 << 28) - -/* Conditional Arith Shift and then SBC */ -#define E_COND_SBC_RASR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) + (1 << 28) -/* Conditional Arith Shift and Set Flag then SBC */ -#define E_COND_SBC_RASRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) + (1 << 28) - -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* Arithmetical Shift Codes with invert ALU */ -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Dest Src1 r2shift SFlag - */ -/* Cond Imm Extra Operation Left/Right - */ -/* Shift/Rotate pOSTShift */ - -/* Arith Shift Right */ -#define E_RASRN(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (1 << 18) + (1 << 27) -/* Arith Shift Right and Set Flag */ -#define E_RASRNS(dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (1 << 18) + (1 << 27) - -/* Arith Shift Right and then AND */ -#define E_RASR_ANDN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) + (1 << 27) -/* Arith Shift Right and Set Flag then AND */ -#define E_RASR_ANDNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) + (1 << 27) - -/* Arith Shift Right and then OR */ -#define E_RASR_ORN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) + (1 << 27) -/* Arith Shift Right and Set Flag then OR */ -#define E_RASR_ORNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) + (1 << 27) - -/* Arith Shift Right and then XOR */ -#define E_RASR_XORN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) + (1 << 27) -/* Arith Shift Right and Set Flag then XOR */ -#define E_RASR_XORNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) + (1 << 27) - -/* Arith Shift Right and then ADD */ -#define E_RASR_ADDN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) + (1 << 27) -/* Arith Shift Right and Set Flag then ADD */ -#define E_RASR_ADDNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) + (1 << 27) - -/* Arith Shift Right and then SUB */ -#define E_RASR_SUBN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) + (1 << 27) -/* Arith Shift Right and Set Flag then SUB */ -#define E_RASR_SUBNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) + (1 << 27) - -/* Arith Shift Right and then ADC */ -#define E_RASR_ADCN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) + (1 << 27) -/* Arith Shift Right and Set Flag then ADC */ -#define E_RASR_ADCNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) + (1 << 27) - -/* Arith Shift Right and then SBC */ -#define E_RASR_SBCN(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) + (1 << 27) -/* Arith Shift Right and Set Flag then SBC */ -#define E_RASR_SBCNS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) + (1 << 27) - -/* Conditional */ -/* Conditional Arith Shift */ -#define E_COND_RASRN(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (1 << 18) + (1 << 27) -/* Conditional Arith Shift and Set Flag */ -#define E_COND_RASRNS(cond, dest, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + (0 << 29) + \ - (0 << 19) + (1 << 18) + (1 << 27) - -/* Conditional Arith Shift and then AND */ -#define E_COND_RASR_ANDN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) + (1 << 27) -/* Conditional Arith Shift and Set Flag then AND */ -#define E_COND_RASR_ANDNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) + (1 << 27) - -/* Conditional Arith Shift and then OR */ -#define E_COND_RASR_ORN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) + (1 << 27) -/* Conditional Arith Shift and Set Flag then OR */ -#define E_COND_RASR_ORNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) + (1 << 27) - -/* Conditional Arith Shift and then XOR */ -#define E_COND_RASR_XORN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) + (1 << 27) -/* Conditional Arith Shift and Set Flag then XOR */ -#define E_COND_RASR_XORNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) + (1 << 27) - -/* Conditional Arith Shift and then ADD */ -#define E_COND_RASR_ADDN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) + (1 << 27) -/* Conditional Arith Shift and Set Flag then ADD */ -#define E_COND_RASR_ADDNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) + (1 << 27) - -/* Conditional Arith Shift and then SUB */ -#define E_COND_RASR_SUBN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) + (1 << 27) -/* Conditional Arith Shift and Set Flag then SUB */ -#define E_COND_RASR_SUBNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) + (1 << 27) - -/* Conditional Arith Shift and then ADC */ -#define E_COND_RASR_ADCN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) + (1 << 27) -/* Conditional Arith Shift and Set Flag then ADC */ -#define E_COND_RASR_ADCNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) + (1 << 27) - -/* Conditional Arith Shift and then SBC */ -#define E_COND_RASR_SBCN(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) + (1 << 27) -/* Conditional Arith Shift and Set Flag then SBC */ -#define E_COND_RASR_SBCNS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) + (1 << 27) - -/* Arith Shift Right and then AND */ -#define E_ANDN_RASR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Arith Shift Right and Set Flag then AND */ -#define E_ANDN_RASRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Arith Shift Right and then OR */ -#define E_ORN_RASR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Arith Shift Right and Set Flag then OR */ -#define E_ORN_RASRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Arith Shift Right and then XOR */ -#define E_XORN_RASR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Arith Shift Right and Set Flag then XOR */ -#define E_XORN_RASRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Arith Shift Right and then ADD */ -#define E_ADDN_RASR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Arith Shift Right and Set Flag then ADD */ -#define E_ADDN_RASRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Arith Shift Right and then SUB */ -#define E_SUBN_RASR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Arith Shift Right and Set Flag then SUB */ -#define E_SUBN_RASRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Arith Shift Right and then ADC */ -#define E_ADCN_RASR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Arith Shift Right and Set Flag then ADC */ -#define E_ADCN_RASRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Arith Shift Right and then SBC */ -#define E_SBCN_RASR(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Arith Shift Right and Set Flag then SBC */ -#define E_SBCN_RASRS(dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (EU << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Conditional */ - -/* Conditional Arith Shift and then AND */ -#define E_COND_ANDN_RASR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Conditional Arith Shift and Set Flag then AND */ -#define E_COND_ANDN_RASRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (1 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Conditional Arith Shift and then OR */ -#define E_COND_ORN_RASR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Conditional Arith Shift and Set Flag then OR */ -#define E_COND_ORN_RASRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (2 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Conditional Arith Shift and then XOR */ -#define E_COND_XORN_RASR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Conditional Arith Shift and Set Flag then XOR */ -#define E_COND_XORN_RASRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (3 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Conditional Arith Shift and then ADD */ -#define E_COND_ADDN_RASR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Conditional Arith Shift and Set Flag then ADD */ -#define E_COND_ADDN_RASRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (4 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Conditional Arith Shift and then SUB */ -#define E_COND_SUBN_RASR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Conditional Arith Shift and Set Flag then SUB */ -#define E_COND_SUBN_RASRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (5 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Conditional Arith Shift and then ADC */ -#define E_COND_ADCN_RASR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Conditional Arith Shift and Set Flag then ADC */ -#define E_COND_ADCN_RASRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (6 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/* Conditional Arith Shift and then SBC */ -#define E_COND_SBCN_RASR(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (0 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) -/* Conditional Arith Shift and Set Flag then SBC */ -#define E_COND_SBCN_RASRS(cond, dest, roperand, r2shift, rshift) \ - DCD 0x19 + (dest << 10) + (roperand << 14) + (r2shift << 20) + (1 << 9) + (cond << 5) + ((rshift & 0x1f) << 24) + \ - (7 << 29) + (0 << 19) + (1 << 18) + (1 << 27) + (1 << 28) - -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* Bit Manipulate */ -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* opcode Dest Src1 src2 SFlag */ -/* Cond Imm Extra Operation ShiftByByte - */ -/* Neg/Pos Mask */ - -/* Bit test by byte */ -#define E_BTST(dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (0 << 9) + (EU << 5) + (0 << 24) + (1 << 29) + \ - (1 << 18) + (1 << 31) -#define E_BCLR(dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (0 << 9) + (EU << 5) + (0 << 24) + (1 << 29) + \ - (1 << 18) + (0 << 31) -#define E_BSET(dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (0 << 9) + (EU << 5) + (0 << 24) + (2 << 29) + \ - (1 << 18) + (1 << 31) -#define E_BTOG(dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (0 << 9) + (EU << 5) + (0 << 24) + (3 << 29) + \ - (1 << 18) + (1 << 31) - -/* Bit test by byte with set flags */ -#define E_BTSTS(dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (1 << 9) + (EU << 5) + (0 << 24) + (1 << 29) + \ - (1 << 18) + (1 << 31) -#define E_BCLRS(dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (1 << 9) + (EU << 5) + (0 << 24) + (1 << 29) + \ - (1 << 18) + (0 << 31) -#define E_BSETS(dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (1 << 9) + (EU << 5) + (0 << 24) + (2 << 29) + \ - (1 << 18) + (1 << 31) -#define E_BTOGS(dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (1 << 9) + (EU << 5) + (0 << 24) + (3 << 29) + \ - (1 << 18) + (1 << 31) - -/* Conditional Bit test by byte */ -#define E_COND_BTST(cond, dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (0 << 9) + (cond << 5) + (0 << 24) + (1 << 29) + \ - (1 << 18) + (1 << 31) -#define E_COND_BCLR(cond, dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (0 << 9) + (cond << 5) + (0 << 24) + (1 << 29) + \ - (1 << 18) + (0 << 31) -#define E_COND_BSET(cond, dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (0 << 9) + (cond << 5) + (0 << 24) + (2 << 29) + \ - (1 << 18) + (1 << 31) -#define E_COND_BTOG(cond, dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (0 << 9) + (cond << 5) + (0 << 24) + (3 << 29) + \ - (1 << 18) + (1 << 31) - -/* Conditional Bit test by byte with set flags */ -#define E_COND_BTSTS(cond, dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (1 << 9) + (cond << 5) + (0 << 24) + (1 << 29) + \ - (1 << 18) + (1 << 31) -#define E_COND_BCLRS(cond, dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (1 << 9) + (cond << 5) + (0 << 24) + (1 << 29) + \ - (1 << 18) + (0 << 31) -#define E_COND_BSETS(cond, dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (1 << 9) + (cond << 5) + (0 << 24) + (2 << 29) + \ - (1 << 18) + (1 << 31) -#define E_COND_BTOGS(cond, dest, rdata, rbit) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (rbit << 20) + (1 << 9) + (cond << 5) + (0 << 24) + (3 << 29) + \ - (1 << 18) + (1 << 31) - -/* Bit test by imm */ -#define E_BTST_IMM(dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (0 << 9) + (EU << 5) + ((bit5 & 0x1f) << 24) + (1 << 29) + (0 << 18) + \ - (1 << 31) -#define E_BCLR_IMM(dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (0 << 9) + (EU << 5) + ((bit5 & 0x1f) << 24) + (1 << 29) + (0 << 18) + \ - (0 << 31) -#define E_BSET_IMM(dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (0 << 9) + (EU << 5) + ((bit5 & 0x1f) << 24) + (2 << 29) + (0 << 18) + \ - (1 << 31) -#define E_BTOG_IMM(dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (0 << 9) + (EU << 5) + ((bit5 & 0x1f) << 24) + (3 << 29) + (0 << 18) + \ - (1 << 31) - -/* Bit test by imm with set flags */ -#define E_BTST_IMMS(dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (1 << 9) + (EU << 5) + ((bit5 & 0x1f) << 24) + (1 << 29) + (0 << 18) + \ - (1 << 31) -#define E_BCLR_IMMS(dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (1 << 9) + (EU << 5) + ((bit5 & 0x1f) << 24) + (1 << 29) + (0 << 18) + \ - (0 << 31) -#define E_BSET_IMMS(dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (1 << 9) + (EU << 5) + ((bit5 & 0x1f) << 24) + (2 << 29) + (0 << 18) + \ - (1 << 31) -#define E_BTOG_IMMS(dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (1 << 9) + (EU << 5) + ((bit5 & 0x1f) << 24) + (3 << 29) + (0 << 18) + \ - (1 << 31) - -/* Conditional Bit test by imm */ -#define E_COND_BTST_IMM(cond, dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (0 << 9) + (cond << 5) + ((bit5 & 0x1f) << 24) + (1 << 29) + (0 << 18) + \ - (1 << 31) -#define E_COND_BCLR_IMM(cond, dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (0 << 9) + (cond << 5) + ((bit5 & 0x1f) << 24) + (1 << 29) + (0 << 18) + \ - (0 << 31) -#define E_COND_BSET_IMM(cond, dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (0 << 9) + (cond << 5) + ((bit5 & 0x1f) << 24) + (2 << 29) + (0 << 18) + \ - (1 << 31) -#define E_COND_BTOG_IMM(cond, dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (0 << 9) + (cond << 5) + ((bit5 & 0x1f) << 24) + (3 << 29) + (0 << 18) + \ - (1 << 31) - -/* Conditional Bit test by imm with set flags */ -#define E_COND_BTST_IMMS(cond, dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (1 << 9) + (cond << 5) + ((bit5 & 0x1f) << 24) + (1 << 29) + (0 << 18) + \ - (1 << 31) -#define E_COND_BCLR_IMMS(cond, dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (1 << 9) + (cond << 5) + ((bit5 & 0x1f) << 24) + (1 << 29) + (0 << 18) + \ - (0 << 31) -#define E_COND_BSET_IMMS(cond, dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (1 << 9) + (cond << 5) + ((bit5 & 0x1f) << 24) + (2 << 29) + (0 << 18) + \ - (1 << 31) -#define E_COND_BTOG_IMMS(cond, dest, rdata, bit5) \ - DCD 0x18 + (dest << 10) + (rdata << 14) + (1 << 9) + (cond << 5) + ((bit5 & 0x1f) << 24) + (3 << 29) + (0 << 18) + \ - (1 << 31) - -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* Tight Loop */ -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -#define E_TIGHT_LOOP(rend, rcount) DCD 0x1A + (rend << 14) + (rcount << 20) -#define E_COND_TIGHT_LOOP(cond, rend, rcount) DCD 0x1A + (rend << 14) + (rcount << 20) + (cond << 5) - -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* Boolean Detect */ -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* Opcode Dest Vector/Single NoUpdateRA */ -/* LargeVectors Cond Table */ - -#define E_HOLD DCD 0x1C + (PC << 10) + (1 << 15) + (0 << 18) + (0 << 19) + (EU << 5) -#define E_COND_HOLD(cond) DCD 0x1C + (PC << 10) + (1 << 15) + (0 << 18) + (0 << 19) + (cond << 5) - -/* Small Vector Versions */ -#define E_VECTORED_HOLD(table) DCD 0x1C + (table << 10) + (0 << 15) + (0 << 18) + (0 << 19) + (EU << 5) + (table << 20) -#define E_COND_VECTORED_HOLD(cond, table) \ - DCD 0x1C + (table << 10) + (0 << 15) + (0 << 18) + (0 << 19) + (cond << 5) + (table << 20) -#define E_VECTORED_HOLD_NRA(table) \ - DCD 0x1C + (table << 10) + (0 << 15) + (1 << 18) + (0 << 19) + (EU << 5) + (table << 20) -#define E_COND_VECTORED_HOLD_NRA \ - (cond, table) DCD 0x1C + (table << 10) + (0 << 15) + (1 << 18) + (0 << 19) + (cond << 5) + (table << 20) - -/* Large Vector Versions */ -#define E_VECTORED_HOLD_LV(table) \ - DCD 0x1C + (table << 10) + (0 << 15) + (0 << 18) + (1 << 19) + (EU << 5) + (table << 20) -#define E_COND_VECTORED_HOLD_LV(cond, table) \ - DCD 0x1C + (table << 10) + (0 << 15) + (0 << 18) + (1 << 19) + (cond << 5) + (table << 20) -#define E_VECTORED_HOLD_LV_NRA(table) \ - DCD 0x1C + (table << 10) + (0 << 15) + (1 << 18) + (1 << 19) + (EU << 5) + (table << 20) -#define E_COND_VECTORED_HOLD_LV_NRA \ - (cond, table) DCD 0x1C + (table << 10) + (0 << 15) + (1 << 18) + (1 << 19) + (cond << 5) + (table << 20) - -/*/ Accelarated Vectored_hold */ -/* Small Vector Versions */ -#define E_ACC_VECTORED_HOLD(table, vectors) \ - DCD 0x1C + (table << 10) + (0 << 15) + (0 << 18) + (0 << 19) + (EU << 5) + (table << 20) + (1 << 9) + \ - (vectors << 24) -#define E_COND_ACC_VECTORED_HOLD(cond, table, vectors) \ - DCD 0x1C + (table << 10) + (0 << 15) + (0 << 18) + (0 << 19) + (cond << 5) + (table << 20) + (1 << 9) + \ - (vectors << 24) -#define E_ACC_VECTORED_HOLD_NRA(table, vectors) \ - DCD 0x1C + (table << 10) + (0 << 15) + (1 << 18) + (0 << 19) + (EU << 5) + (table << 20) + (1 << 9) + \ - (vectors << 24) -#define E_COND_ACC_VECTORED_HOLD_NRA \ - (cond, table, vectors) DCD 0x1C + (table << 10) + (0 << 15) + (1 << 18) + (0 << 19) + (cond << 5) + \ - (table << 20) + (1 << 9) + (vectors << 24) - -/* Large Vector Versions */ -#define E_ACC_VECTORED_HOLD_LV(table, vectors) \ - DCD 0x1C + (table << 10) + (0 << 15) + (0 << 18) + (1 << 19) + (EU << 5) + (table << 20) + (1 << 9) + \ - (vectors << 24) -#define E_COND_ACC_VECTORED_HOLD_LV(cond, table, vectors) \ - DCD 0x1C + (table << 10) + (0 << 15) + (0 << 18) + (1 << 19) + (cond << 5) + (table << 20) + (1 << 9) + \ - (vectors << 24) -#define E_ACC_VECTORED_HOLD_LV_NRA(table, vectors) \ - DCD 0x1C + (table << 10) + (0 << 15) + (1 << 18) + (1 << 19) + (EU << 5) + (table << 20) + (1 << 9) + \ - (vectors << 24) -#define E_COND_ACC_VECTORED_HOLD_LV_NRA \ - (cond, table, vectors) DCD 0x1C + (table << 10) + (0 << 15) + (1 << 18) + (1 << 19) + (cond << 5) + \ - (table << 20) + (1 << 9) + (vectors << 24) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* Reg offset Read */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Rdata Dest Pointer WData Source */ -/* Offset SizeWord Signed Access Cond Write */ - -/* LDR (Load, Load Byte, LoadByteSigned) */ -#define E_LDR_REG(dest, source, offset) \ - DCD 0x1D + (dest << 10) + (source << 14) + (offset << 24) + (1 << 18) + (0 << 21) + (EU << 5) -#define E_LDR_REGB(dest, source, offset) \ - DCD 0x1D + (dest << 10) + (source << 14) + (offset << 24) + (0 << 18) + (0 << 21) + (EU << 5) -#define E_LDR_REGBS(dest, source, offset) \ - DCD 0x1D + (dest << 10) + (source << 14) + (offset << 24) + (0 << 18) + (1 << 21) + (EU << 5) - -/* Conditional LDR (Load, Load Byte, LoadByteSigned) */ -#define E_COND_LDR_REG(cond, dest, source, offset) \ - DCD 0x1D + (dest << 10) + (source << 14) + (offset << 24) + (1 << 18) + (0 << 21) + (cond << 5) -#define E_COND_LDR_REGB(cond, dest, source, offset) \ - DCD 0x1D + (dest << 10) + (source << 14) + (offset << 24) + (0 << 18) + (0 << 21) + (cond << 5) -#define E_COND_LDR_REGBS(cond, dest, source, offset) \ - DCD 0x1D + (dest << 10) + (source << 14) + (offset << 24) + (0 << 18) + (1 << 21) + (cond << 5) - -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* Reg offset Write */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -/* opcode Rdata Dest Pointer WData Source */ -/* Offset SizeWord Signed Access Cond Write */ - -/* STR (Load, Load Byte, LoadByteSigned) */ -#define E_STR_REG(raddr, rdata, roffset) \ - DCD 0x1D + (raddr << 14) + (rdata << 20) + (roffset << 24) + (1 << 18) + (0 << 11) + (EU << 5) + (1 << 30) -#define E_STR_REGB(raddr, rdata, roffset) \ - DCD 0x1D + (raddr << 14) + (rdata << 20) + (roffset << 24) + (0 << 18) + (0 << 11) + (EU << 5) + (1 << 30) - -/* Conditional STR (Load, Load Byte, LoadByteSigned) */ -#define E_COND_STR_REG(cond, raddr, rdata, roffset) \ - DCD 0x1D + (raddr << 14) + (rdata << 20) + (roffset << 24) + (1 << 18) + (0 << 11) + (cond << 5) + (1 << 30) -#define E_COND_STR_REGB(cond, raddr, rdata, roffset) \ - DCD 0x1D + (raddr << 14) + (rdata << 20) + (roffset << 24) + (0 << 18) + (0 << 11) + (cond << 5) + (1 << 30) - -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* GPO modify Byte */ -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -#define E_MODIFY_GPO_BYTE(andmask, ormask, xormask) DCD 0x1E + (andmask << 8) + (ormask << 16) + (xormask << 24) - -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* HeartBeat opcodes */ -/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -#define E_HEART_RYTHM_IMM(val16imm) DCD 0x32 + (val16imm << 16) -#define E_HEART_RYTHM(r16bit) DCD 0x32 + (r16bit << 14) + (1 << 9) -#define E_SYNCH_ALL_TO_BEAT(on1imm) DCD 0x52 + (on1imm << 31) -#define E_WAIT_FOR_BEAT DCD 0x72 - -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartdma_rt500.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartdma_rt500.c deleted file mode 100644 index f8952e16e1d..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartdma_rt500.c +++ /dev/null @@ -1,2518 +0,0 @@ -/* - * Copyright 2019-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_smartdma.h" - -#if defined(MIMXRT533S_SERIES) || defined(MIMXRT555S_SERIES) || defined(MIMXRT595S_cm33_SERIES) - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ -#if (SMARTDMA_DISPLAY_FIRMWARE_SELECT == SMARTDMA_DISPLAY_MIPI_AND_FLEXIO) -const uint8_t s_smartdmaDisplayFirmware[] = { - 0x60U, 0x00U, 0x10U, 0x24U, 0x40U, 0x01U, 0x10U, 0x24U, 0xC8U, 0x02U, 0x10U, 0x24U, - 0x04U, 0x02U, 0x10U, 0x24U, 0x68U, 0x03U, 0x10U, 0x24U, 0x98U, 0x08U, 0x10U, 0x24U, - 0xE8U, 0x0DU, 0x10U, 0x24U, 0xFCU, 0x0FU, 0x10U, 0x24U, 0x70U, 0x12U, 0x10U, 0x24U, - 0xE8U, 0x14U, 0x10U, 0x24U, 0xACU, 0x25U, 0x10U, 0x24U, 0x54U, 0x16U, 0x10U, 0x24U, - 0xCCU, 0x27U, 0x10U, 0x24U, 0x18U, 0x19U, 0x10U, 0x24U, 0x7CU, 0x2BU, 0x10U, 0x24U, - 0xE4U, 0x1BU, 0x10U, 0x24U, 0x54U, 0x1DU, 0x10U, 0x24U, 0x24U, 0x20U, 0x10U, 0x24U, - 0xDCU, 0x2EU, 0x10U, 0x24U, 0x68U, 0x33U, 0x10U, 0x24U, 0x70U, 0x38U, 0x10U, 0x24U, - 0x8CU, 0x3BU, 0x10U, 0x24U, 0xF8U, 0x22U, 0x10U, 0x24U, 0x44U, 0x3EU, 0x10U, 0x24U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, - 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0xB0U, 0x05U, 0x02U, 0x10U, 0x04U, 0x14U, 0x05U, 0x08U, 0x44U, 0x14U, 0x00U, - 0x06U, 0x48U, 0xC7U, 0x08U, 0x1AU, 0x80U, 0x10U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x11U, 0x08U, 0x38U, 0x00U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x05U, 0x00U, 0x22U, 0x32U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, - 0x05U, 0x04U, 0x22U, 0x32U, 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x10U, 0x08U, 0x2CU, 0x10U, 0x05U, 0x08U, 0x22U, 0x32U, 0x11U, 0x08U, 0x38U, 0x00U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x05U, 0x0CU, 0x22U, 0x32U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, - 0x05U, 0x10U, 0x22U, 0x32U, 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x10U, 0x08U, 0x2CU, 0x10U, 0x05U, 0x14U, 0x22U, 0x32U, 0x11U, 0x08U, 0x38U, 0x00U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x05U, 0x18U, 0x22U, 0x32U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, - 0x05U, 0x1CU, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x42U, 0x02U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, - 0x10U, 0x04U, 0x14U, 0x05U, 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0x07U, 0x07U, - 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x06U, 0x00U, 0xC4U, 0x01U, 0x01U, 0x08U, 0x1CU, 0xFFU, - 0x01U, 0x0CU, 0x1CU, 0xFFU, 0x01U, 0x10U, 0x1CU, 0xFFU, 0x01U, 0x14U, 0x1CU, 0xFFU, - 0x11U, 0x08U, 0x20U, 0x00U, 0x05U, 0x00U, 0x22U, 0x32U, 0x11U, 0x0CU, 0x30U, 0x00U, - 0x05U, 0x04U, 0x32U, 0x32U, 0x11U, 0x10U, 0x40U, 0x00U, 0x05U, 0x08U, 0x42U, 0x32U, - 0x11U, 0x14U, 0x50U, 0x00U, 0x05U, 0x0CU, 0x52U, 0x32U, 0x01U, 0x08U, 0x1CU, 0xFFU, - 0x01U, 0x0CU, 0x1CU, 0xFFU, 0x01U, 0x10U, 0x1CU, 0xFFU, 0x01U, 0x14U, 0x1CU, 0x08U, - 0x11U, 0x08U, 0x20U, 0x00U, 0x05U, 0x10U, 0x22U, 0x32U, 0x11U, 0x0CU, 0x30U, 0x00U, - 0x05U, 0x14U, 0x32U, 0x32U, 0x11U, 0x10U, 0x40U, 0x00U, 0x05U, 0x18U, 0x42U, 0x32U, - 0x11U, 0x14U, 0x50U, 0x00U, 0x05U, 0x1CU, 0x52U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, - 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xCAU, 0x03U, 0x20U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, - 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0xB0U, 0x05U, 0x02U, 0x06U, 0x18U, 0x10U, 0x00U, 0x10U, 0x04U, 0x14U, 0x05U, - 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0xC7U, 0x06U, 0x1AU, 0x80U, 0x10U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x01U, 0x88U, 0x15U, 0xFFU, 0x01U, 0x8CU, 0x15U, 0xFFU, 0x01U, 0x90U, 0x15U, 0xFFU, - 0x01U, 0x94U, 0x15U, 0xFFU, 0x11U, 0x08U, 0x20U, 0x00U, 0x05U, 0x00U, 0x22U, 0x32U, - 0x11U, 0x0CU, 0x30U, 0x00U, 0x05U, 0x04U, 0x32U, 0x32U, 0x11U, 0x10U, 0x40U, 0x00U, - 0x05U, 0x08U, 0x42U, 0x32U, 0x11U, 0x14U, 0x50U, 0x00U, 0x05U, 0x0CU, 0x52U, 0x32U, - 0x01U, 0x88U, 0x15U, 0xFFU, 0x01U, 0x8CU, 0x15U, 0xFFU, 0x01U, 0x90U, 0x15U, 0xFFU, - 0x01U, 0x94U, 0x15U, 0xFFU, 0x11U, 0x08U, 0x20U, 0x00U, 0x05U, 0x10U, 0x22U, 0x32U, - 0x11U, 0x0CU, 0x30U, 0x00U, 0x05U, 0x14U, 0x32U, 0x32U, 0x11U, 0x10U, 0x40U, 0x00U, - 0x05U, 0x18U, 0x42U, 0x32U, 0x11U, 0x14U, 0x50U, 0x00U, 0x05U, 0x1CU, 0x52U, 0x32U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x15U, 0x52U, 0x05U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, - 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, 0x10U, 0x04U, 0x14U, 0x05U, - 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0xC7U, 0x04U, 0x1AU, 0x80U, 0x10U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x05U, 0x00U, 0x22U, 0x32U, 0x05U, 0x04U, 0x32U, 0x32U, - 0x05U, 0x08U, 0x42U, 0x32U, 0x05U, 0x0CU, 0x52U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x05U, 0x10U, 0x22U, 0x32U, 0x05U, 0x14U, 0x32U, 0x32U, 0x05U, 0x18U, 0x42U, 0x32U, - 0x05U, 0x1CU, 0x52U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x92U, 0x06U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x04U, 0x18U, 0x04U, 0x27U, 0x10U, 0x18U, 0x68U, 0x02U, 0x10U, 0x18U, 0x60U, 0x02U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0xA4U, 0x05U, 0x01U, 0x01U, 0x84U, 0x05U, 0x02U, - 0x01U, 0xB0U, 0x05U, 0x03U, 0x10U, 0x04U, 0x14U, 0x06U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, - 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, - 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x02U, 0x44U, 0x3EU, 0x01U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, - 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, - 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, - 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, - 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x02U, 0x44U, 0x3EU, 0x01U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, - 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, - 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, - 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, - 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x02U, 0x44U, 0x3EU, 0x01U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, - 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, - 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, - 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, - 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x02U, 0x44U, 0x3EU, 0x01U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, - 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, - 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, - 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, - 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x02U, 0x44U, 0x3EU, 0x01U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, - 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, - 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, - 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, - 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x02U, 0x44U, 0x3EU, 0x01U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, - 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, - 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, - 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, - 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x02U, 0x44U, 0x3EU, 0x01U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, - 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, - 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, - 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, - 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x02U, 0x44U, 0x3EU, 0x01U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, - 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, - 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x02U, 0x44U, 0x3EU, 0x01U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x1AU, 0x07U, 0x20U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x15U, 0xF2U, 0x10U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x10U, 0x18U, 0x68U, 0x02U, - 0x10U, 0x18U, 0x60U, 0x02U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0xB0U, 0x05U, 0x02U, 0x10U, 0x04U, 0x14U, 0x06U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, - 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, - 0x10U, 0xCCU, 0x70U, 0x4BU, 0x05U, 0x00U, 0x32U, 0x32U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, - 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, - 0x05U, 0x04U, 0x32U, 0x32U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, - 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, - 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, - 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, - 0x05U, 0x08U, 0x32U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, - 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, - 0x10U, 0xCCU, 0x70U, 0x4BU, 0x05U, 0x0CU, 0x32U, 0x32U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, - 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, - 0x05U, 0x10U, 0x32U, 0x32U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, - 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, - 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, - 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, - 0x05U, 0x14U, 0x32U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, - 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, - 0x10U, 0xCCU, 0x70U, 0x4BU, 0x05U, 0x18U, 0x32U, 0x32U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, - 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, - 0x05U, 0x1CU, 0x32U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, - 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, - 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, - 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, 0x05U, 0x00U, 0x32U, 0x32U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, - 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, - 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, - 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, - 0x05U, 0x04U, 0x32U, 0x32U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, - 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, - 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, - 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, 0x05U, 0x08U, 0x32U, 0x32U, - 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, - 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, - 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, - 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, 0x05U, 0x0CU, 0x32U, 0x32U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, - 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, - 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, - 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, - 0x05U, 0x10U, 0x32U, 0x32U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, - 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, - 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, - 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, 0x05U, 0x14U, 0x32U, 0x32U, - 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, - 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, - 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, - 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, 0x05U, 0x18U, 0x32U, 0x32U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, - 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, - 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, - 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, - 0x05U, 0x1CU, 0x32U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, - 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, - 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x05U, 0x00U, 0x32U, 0x32U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x05U, 0x04U, 0x32U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, - 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, - 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x05U, 0x08U, 0x32U, 0x32U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, - 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, - 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x05U, 0x0CU, 0x32U, 0x32U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x05U, 0x10U, 0x32U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, - 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, - 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x05U, 0x14U, 0x32U, 0x32U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, - 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, - 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x05U, 0x18U, 0x32U, 0x32U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x05U, 0x1CU, 0x32U, 0x32U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x82U, 0x11U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x92U, 0x1BU, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, - 0x10U, 0x04U, 0x14U, 0x07U, 0x00U, 0x18U, 0xFEU, 0x8FU, 0x08U, 0x44U, 0x14U, 0x00U, - 0x06U, 0x48U, 0xC7U, 0x1BU, 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, - 0x05U, 0x00U, 0x22U, 0x32U, 0x05U, 0x04U, 0x32U, 0x32U, 0x05U, 0x08U, 0x42U, 0x32U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x0CU, 0x22U, 0x32U, 0x05U, 0x10U, 0x32U, 0x32U, - 0x05U, 0x14U, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x18U, 0x22U, 0x32U, - 0x05U, 0x1CU, 0x32U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x00U, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x04U, 0x22U, 0x32U, - 0x05U, 0x08U, 0x32U, 0x32U, 0x05U, 0x0CU, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, - 0x05U, 0x10U, 0x22U, 0x32U, 0x05U, 0x14U, 0x32U, 0x32U, 0x05U, 0x18U, 0x42U, 0x32U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x1CU, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x00U, 0x32U, 0x32U, 0x05U, 0x04U, 0x42U, 0x32U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x08U, 0x22U, 0x32U, 0x05U, 0x0CU, 0x32U, 0x32U, - 0x05U, 0x10U, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x14U, 0x22U, 0x32U, - 0x05U, 0x18U, 0x32U, 0x32U, 0x05U, 0x1CU, 0x42U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, - 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xBAU, 0x1FU, 0x20U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, - 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0xB0U, 0x05U, 0x02U, 0x10U, 0x04U, 0x14U, 0x07U, 0x00U, 0x18U, 0xFEU, 0x8FU, - 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0xC7U, 0x21U, 0x1AU, 0x80U, 0x10U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x00U, - 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x00U, 0x22U, 0x32U, 0x05U, 0x04U, 0x32U, 0x32U, - 0x05U, 0x08U, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x11U, 0x88U, 0x21U, 0x20U, - 0x11U, 0x0CU, 0x30U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x0CU, 0x22U, 0x32U, - 0x05U, 0x10U, 0x32U, 0x32U, 0x05U, 0x14U, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x10U, 0x51U, 0x48U, - 0x05U, 0x18U, 0x22U, 0x32U, 0x05U, 0x1CU, 0x32U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x00U, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x10U, 0x51U, 0x48U, - 0x05U, 0x04U, 0x22U, 0x32U, 0x05U, 0x08U, 0x32U, 0x32U, 0x05U, 0x0CU, 0x42U, 0x32U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x00U, - 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x10U, 0x22U, 0x32U, 0x05U, 0x14U, 0x32U, 0x32U, - 0x05U, 0x18U, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x11U, 0x88U, 0x21U, 0x20U, - 0x11U, 0x0CU, 0x30U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x1CU, 0x22U, 0x32U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x00U, 0x32U, 0x32U, - 0x05U, 0x04U, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x11U, 0x88U, 0x21U, 0x20U, - 0x11U, 0x0CU, 0x30U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x08U, 0x22U, 0x32U, - 0x05U, 0x0CU, 0x32U, 0x32U, 0x05U, 0x10U, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x10U, 0x51U, 0x48U, - 0x05U, 0x14U, 0x22U, 0x32U, 0x05U, 0x18U, 0x32U, 0x32U, 0x05U, 0x1CU, 0x42U, 0x32U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x15U, 0xA2U, 0x24U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, - 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, 0x00U, 0x18U, 0xFEU, 0x8FU, - 0x06U, 0x00U, 0x10U, 0x00U, 0x10U, 0x04U, 0x14U, 0x07U, 0x08U, 0x44U, 0x14U, 0x00U, - 0x06U, 0x48U, 0xC7U, 0x21U, 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x01U, 0x08U, 0x14U, 0xFFU, - 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, - 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, - 0x05U, 0x00U, 0x22U, 0x32U, 0x05U, 0x04U, 0x32U, 0x32U, 0x05U, 0x08U, 0x42U, 0x32U, - 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, - 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, - 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x0CU, 0x22U, 0x32U, 0x05U, 0x10U, 0x32U, 0x32U, - 0x05U, 0x14U, 0x42U, 0x32U, 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, - 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x18U, 0x22U, 0x32U, - 0x05U, 0x1CU, 0x32U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x00U, 0x42U, 0x32U, 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, - 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x04U, 0x22U, 0x32U, - 0x05U, 0x08U, 0x32U, 0x32U, 0x05U, 0x0CU, 0x42U, 0x32U, 0x01U, 0x08U, 0x14U, 0xFFU, - 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, - 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, - 0x05U, 0x10U, 0x22U, 0x32U, 0x05U, 0x14U, 0x32U, 0x32U, 0x05U, 0x18U, 0x42U, 0x32U, - 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, - 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, - 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x1CU, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x00U, 0x32U, 0x32U, 0x05U, 0x04U, 0x42U, 0x32U, - 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, - 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, - 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x08U, 0x22U, 0x32U, 0x05U, 0x0CU, 0x32U, 0x32U, - 0x05U, 0x10U, 0x42U, 0x32U, 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, - 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x14U, 0x22U, 0x32U, - 0x05U, 0x18U, 0x32U, 0x32U, 0x05U, 0x1CU, 0x42U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, - 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x92U, 0x29U, 0x20U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, - 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0xB0U, 0x05U, 0x02U, 0x01U, 0x9CU, 0x05U, 0x03U, 0x00U, 0x0CU, 0xC4U, 0x02U, - 0x00U, 0xDEU, 0x01U, 0x00U, 0x35U, 0x32U, 0x2AU, 0x20U, 0x15U, 0x5AU, 0x2BU, 0x20U, - 0x08U, 0x4AU, 0xC4U, 0x0FU, 0x60U, 0x08U, 0xC4U, 0x0FU, 0x80U, 0x48U, 0x00U, 0x00U, - 0x06U, 0x98U, 0x34U, 0x00U, 0x10U, 0x18U, 0x68U, 0x02U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x5AU, 0x2AU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x11U, 0x10U, 0x48U, 0x00U, 0x10U, 0x10U, 0x4CU, 0x10U, 0x10U, 0xDCU, 0x40U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x0CU, 0x48U, 0x18U, 0x08U, 0x9AU, 0x15U, 0x00U, - 0x55U, 0x5AU, 0x2AU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0xB2U, 0x2AU, 0x20U, 0x0DU, 0x9AU, 0x34U, 0x00U, 0x25U, 0x80U, 0x32U, 0x31U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, - 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, - 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, 0x08U, 0x46U, 0x20U, 0x00U, - 0xB5U, 0x32U, 0x2AU, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x15U, 0x6AU, 0x2CU, 0x20U, 0x08U, 0x4AU, 0xC4U, 0x0FU, 0x60U, 0x08U, 0xC4U, 0x0FU, - 0x80U, 0x48U, 0x00U, 0x00U, 0x06U, 0x98U, 0x34U, 0x00U, 0x10U, 0x18U, 0x68U, 0x02U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x82U, 0x2BU, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x10U, 0x0CU, 0x48U, 0x18U, 0x08U, 0x9AU, 0x15U, 0x00U, 0x55U, 0x82U, 0x2BU, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0xCAU, 0x2BU, 0x20U, - 0x0DU, 0x9AU, 0x34U, 0x00U, 0x25U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, - 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, - 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, - 0x00U, 0x0CU, 0xC4U, 0x03U, 0x08U, 0x46U, 0x20U, 0x00U, 0xB5U, 0x5AU, 0x2BU, 0x20U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x15U, 0x6AU, 0x2CU, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, - 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, 0x01U, 0x9CU, 0x05U, 0x03U, - 0x00U, 0x0CU, 0xC4U, 0x02U, 0x00U, 0xDEU, 0x01U, 0x00U, 0x35U, 0x0AU, 0x2DU, 0x20U, - 0x15U, 0xC2U, 0x2FU, 0x20U, 0x08U, 0x4AU, 0xC4U, 0x0FU, 0x60U, 0x08U, 0xC4U, 0x0FU, - 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0x2AU, 0x2EU, 0x20U, 0x00U, 0x24U, 0x54U, 0x01U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x32U, 0x2DU, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x01U, 0x18U, 0x1CU, 0x01U, - 0x11U, 0x1CU, 0x40U, 0x08U, 0x10U, 0xDCU, 0x70U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x10U, 0x10U, 0x48U, 0x18U, 0x0DU, 0x8CU, 0xF5U, 0x0FU, 0x10U, 0x0CU, 0x31U, 0x48U, - 0x11U, 0x10U, 0x50U, 0x10U, 0x10U, 0x1CU, 0x31U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x14U, 0x50U, 0x10U, 0x11U, 0x1CU, 0x60U, 0x00U, - 0x10U, 0x1CU, 0x70U, 0x10U, 0x10U, 0xDCU, 0x59U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x00U, 0x0CU, 0xF6U, 0x0FU, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x08U, 0x66U, 0x16U, 0x00U, - 0x55U, 0x32U, 0x2DU, 0x20U, 0x08U, 0x46U, 0x20U, 0x00U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x02U, 0x2EU, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, - 0x15U, 0x42U, 0x2FU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0x2AU, 0x2EU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x01U, 0x18U, 0x1CU, 0x01U, 0x11U, 0x1CU, 0x40U, 0x08U, 0x10U, 0xDCU, 0x70U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, 0x35U, 0x42U, 0x2FU, 0x20U, - 0x10U, 0x10U, 0x48U, 0x18U, 0x0DU, 0x8CU, 0xF5U, 0x0FU, 0x10U, 0x0CU, 0x31U, 0x48U, - 0x11U, 0x10U, 0x50U, 0x10U, 0x10U, 0x1CU, 0x31U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x34U, 0x00U, 0x35U, 0x42U, 0x2FU, 0x20U, 0x11U, 0x14U, 0x50U, 0x00U, - 0x10U, 0x14U, 0x50U, 0x10U, 0x11U, 0x1CU, 0x60U, 0x00U, 0x10U, 0x1CU, 0x70U, 0x10U, - 0x10U, 0xDCU, 0x59U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, - 0x35U, 0x42U, 0x2FU, 0x20U, 0x00U, 0x0CU, 0xF6U, 0x0FU, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x08U, 0x46U, 0x34U, 0x00U, 0xB5U, 0x2AU, 0x2EU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x22U, 0x2FU, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, - 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, - 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, 0x00U, 0x46U, 0x00U, 0x00U, - 0xB5U, 0x0AU, 0x2DU, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x15U, 0xF2U, 0x31U, 0x20U, 0x08U, 0x4AU, 0xC4U, 0x0FU, 0x60U, 0x08U, 0xC4U, 0x0FU, - 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0xA2U, 0x30U, 0x20U, 0x00U, 0x24U, 0x54U, 0x01U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0xEAU, 0x2FU, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x01U, 0x18U, 0x1CU, 0x01U, - 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x10U, 0x48U, 0x18U, - 0x10U, 0x1CU, 0x51U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x14U, 0x58U, 0x18U, - 0x10U, 0x5CU, 0x61U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x0CU, 0x68U, 0x18U, - 0x08U, 0x66U, 0x16U, 0x00U, 0x55U, 0xEAU, 0x2FU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x72U, 0x30U, 0x20U, 0x08U, 0x46U, 0x20U, 0x00U, - 0x05U, 0x80U, 0x32U, 0x31U, 0x15U, 0x7AU, 0x31U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0xA2U, 0x30U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x01U, 0x18U, 0x1CU, 0x01U, 0x10U, 0xDCU, 0x40U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, 0x35U, 0x7AU, 0x31U, 0x20U, - 0x10U, 0x10U, 0x48U, 0x18U, 0x10U, 0x1CU, 0x51U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x34U, 0x00U, 0x35U, 0x7AU, 0x31U, 0x20U, 0x10U, 0x14U, 0x58U, 0x18U, - 0x10U, 0x5CU, 0x61U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, - 0x35U, 0x7AU, 0x31U, 0x20U, 0x10U, 0x0CU, 0x68U, 0x18U, 0x08U, 0x46U, 0x34U, 0x00U, - 0xB5U, 0xA2U, 0x30U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0x5AU, 0x31U, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, - 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, - 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, - 0x00U, 0x0CU, 0xC4U, 0x03U, 0x00U, 0x46U, 0x00U, 0x00U, 0xB5U, 0xC2U, 0x2FU, 0x20U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x15U, 0xF2U, 0x31U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, - 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, 0x01U, 0x9CU, 0x05U, 0x03U, - 0x00U, 0x0CU, 0xC4U, 0x02U, 0x00U, 0x24U, 0xF4U, 0x0FU, 0x00U, 0xDEU, 0x01U, 0x00U, - 0x35U, 0x9AU, 0x32U, 0x20U, 0x15U, 0x1AU, 0x35U, 0x20U, 0x08U, 0x4AU, 0x04U, 0x15U, - 0x60U, 0x08U, 0x04U, 0x15U, 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0x9AU, 0x33U, 0x20U, - 0x00U, 0x20U, 0x54U, 0x01U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0xC2U, 0x32U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x01U, 0x18U, 0x1CU, 0x01U, 0x11U, 0x1CU, 0x40U, 0x08U, 0x10U, 0xDCU, 0x70U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x11U, 0x14U, 0x50U, 0x08U, - 0x10U, 0x9CU, 0x91U, 0x30U, 0x10U, 0x5CU, 0x71U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x11U, 0x18U, 0x60U, 0x10U, 0x11U, 0x1CU, 0x40U, 0x08U, 0x10U, 0x9CU, 0x71U, 0x50U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x0DU, 0x4CU, 0x42U, 0x00U, 0x08U, 0x22U, 0x16U, 0x00U, - 0x55U, 0xC2U, 0x32U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0x6AU, 0x33U, 0x20U, 0x08U, 0x46U, 0x20U, 0x00U, 0x05U, 0x80U, 0x32U, 0x31U, - 0x15U, 0x92U, 0x34U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0x9AU, 0x33U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x01U, 0x18U, 0x1CU, 0x01U, 0x11U, 0x1CU, 0x40U, 0x08U, 0x10U, 0xDCU, 0x70U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, 0x35U, 0x92U, 0x34U, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x9CU, 0x91U, 0x30U, - 0x10U, 0x5CU, 0x71U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x35U, 0x92U, 0x34U, 0x20U, 0x11U, 0x18U, 0x60U, 0x10U, 0x11U, 0x1CU, 0x40U, 0x08U, - 0x10U, 0x9CU, 0x71U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x35U, 0x92U, 0x34U, 0x20U, 0x0DU, 0x4CU, 0x42U, 0x00U, 0x08U, 0x46U, 0x44U, 0x00U, - 0xB5U, 0x9AU, 0x33U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0x72U, 0x34U, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, - 0x10U, 0x0CU, 0x28U, 0x02U, 0x08U, 0x88U, 0x30U, 0x00U, 0x0CU, 0xDCU, 0x21U, 0x00U, - 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, - 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, - 0xB5U, 0x9AU, 0x32U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x15U, 0x8AU, 0x37U, 0x20U, 0x08U, 0x4AU, 0x04U, 0x15U, 0x60U, 0x08U, 0x04U, 0x15U, - 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0x12U, 0x36U, 0x20U, 0x00U, 0x20U, 0x54U, 0x01U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x42U, 0x35U, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x01U, 0x18U, 0x1CU, 0x01U, - 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x10U, 0x14U, 0x50U, 0x08U, 0x10U, 0x14U, 0x58U, 0x08U, 0x10U, 0x5CU, 0x61U, 0x58U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x18U, 0x60U, 0x08U, 0x10U, 0x18U, 0x68U, 0x10U, - 0x10U, 0x9CU, 0x41U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x4CU, 0x4AU, 0x30U, - 0x08U, 0x22U, 0x16U, 0x00U, 0x55U, 0x42U, 0x35U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0xE2U, 0x35U, 0x20U, 0x08U, 0x46U, 0x20U, 0x00U, - 0x05U, 0x80U, 0x32U, 0x31U, 0x15U, 0x02U, 0x37U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x12U, 0x36U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x01U, 0x18U, 0x1CU, 0x01U, 0x10U, 0xDCU, 0x40U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, 0x35U, 0x02U, 0x37U, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x10U, 0x14U, 0x50U, 0x08U, 0x10U, 0x14U, 0x58U, 0x08U, - 0x10U, 0x5CU, 0x61U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x35U, 0x02U, 0x37U, 0x20U, 0x10U, 0x18U, 0x60U, 0x08U, 0x10U, 0x18U, 0x68U, 0x10U, - 0x10U, 0x9CU, 0x41U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x35U, 0x02U, 0x37U, 0x20U, 0x10U, 0x4CU, 0x4AU, 0x30U, 0x08U, 0x46U, 0x44U, 0x00U, - 0xB5U, 0x12U, 0x36U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0xE2U, 0x36U, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, - 0x10U, 0x0CU, 0x28U, 0x02U, 0x08U, 0x88U, 0x30U, 0x00U, 0x0CU, 0xDCU, 0x21U, 0x00U, - 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, - 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, - 0x00U, 0x46U, 0x00U, 0x00U, 0xB5U, 0x1AU, 0x35U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, - 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x8AU, 0x37U, 0x20U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, - 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0xB0U, 0x05U, 0x02U, 0x01U, 0x9CU, 0x05U, 0x03U, 0x00U, 0x0CU, 0xC4U, 0x02U, - 0x06U, 0x00U, 0x10U, 0x00U, 0x00U, 0xDEU, 0x01U, 0x00U, 0x35U, 0x32U, 0x38U, 0x20U, - 0x15U, 0x52U, 0x39U, 0x20U, 0x08U, 0x4AU, 0xC4U, 0x0FU, 0x60U, 0x08U, 0xC4U, 0x0FU, - 0x80U, 0x48U, 0x00U, 0x00U, 0x06U, 0x98U, 0x34U, 0x00U, 0x10U, 0x18U, 0x68U, 0x02U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x5AU, 0x38U, 0x20U, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x11U, 0x10U, 0x48U, 0x00U, 0x10U, 0xDCU, 0x40U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x0CU, 0x48U, 0x18U, 0x08U, 0x9AU, 0x15U, 0x00U, - 0x55U, 0x5AU, 0x38U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0xAAU, 0x38U, 0x20U, 0x0DU, 0x9AU, 0x34U, 0x00U, 0x25U, 0x80U, 0x32U, 0x31U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, - 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, - 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, 0x08U, 0x46U, 0x20U, 0x00U, - 0xB5U, 0x32U, 0x38U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x15U, 0x6AU, 0x3AU, 0x20U, 0x08U, 0x4AU, 0xC4U, 0x0FU, 0x60U, 0x08U, 0xC4U, 0x0FU, - 0x80U, 0x48U, 0x00U, 0x00U, 0x06U, 0x98U, 0x34U, 0x00U, 0x10U, 0x18U, 0x68U, 0x02U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x7AU, 0x39U, 0x20U, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x10U, 0x10U, 0x4CU, 0x10U, 0x10U, 0xDCU, 0x40U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x0CU, 0x48U, 0x18U, 0x08U, 0x9AU, 0x15U, 0x00U, - 0x55U, 0x7AU, 0x39U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0xCAU, 0x39U, 0x20U, 0x0DU, 0x9AU, 0x34U, 0x00U, 0x25U, 0x80U, 0x32U, 0x31U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, - 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, - 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, 0x08U, 0x46U, 0x20U, 0x00U, - 0xB5U, 0x52U, 0x39U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x6AU, 0x3AU, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, - 0x01U, 0x9CU, 0x05U, 0x03U, 0x00U, 0x0CU, 0xC4U, 0x02U, 0x06U, 0x00U, 0x10U, 0x00U, - 0x00U, 0xDEU, 0x01U, 0x00U, 0x35U, 0x12U, 0x3BU, 0x20U, 0x15U, 0x7AU, 0x3DU, 0x20U, - 0x08U, 0x4AU, 0xC4U, 0x0FU, 0x60U, 0x08U, 0xC4U, 0x0FU, 0x80U, 0x48U, 0x00U, 0x00U, - 0x95U, 0x0AU, 0x3CU, 0x20U, 0x00U, 0x24U, 0x54U, 0x01U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x3AU, 0x3BU, 0x20U, 0x01U, 0x10U, 0x14U, 0xFFU, - 0x01U, 0x14U, 0x14U, 0xFFU, 0x01U, 0x18U, 0x14U, 0xFFU, 0x11U, 0x1CU, 0x40U, 0x00U, - 0x10U, 0xDCU, 0x70U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x0DU, 0x10U, 0xF5U, 0x0FU, - 0x11U, 0x1CU, 0x58U, 0x00U, 0x10U, 0x1CU, 0x71U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x0DU, 0x54U, 0xF5U, 0x0FU, 0x11U, 0x1CU, 0x68U, 0x00U, 0x10U, 0x5CU, 0x71U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x0DU, 0x8CU, 0xF5U, 0x0FU, 0x08U, 0x66U, 0x16U, 0x00U, - 0x55U, 0x3AU, 0x3BU, 0x20U, 0x08U, 0x46U, 0x20U, 0x00U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0xE2U, 0x3BU, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, - 0x15U, 0xFAU, 0x3CU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0x2AU, 0x2EU, 0x20U, 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, - 0x01U, 0x18U, 0x14U, 0xFFU, 0x11U, 0x1CU, 0x40U, 0x00U, 0x10U, 0xDCU, 0x70U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, 0x35U, 0xFAU, 0x3CU, 0x20U, - 0x0DU, 0x10U, 0xF5U, 0x0FU, 0x11U, 0x1CU, 0x58U, 0x00U, 0x10U, 0x1CU, 0x71U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, 0x35U, 0xFAU, 0x3CU, 0x20U, - 0x0DU, 0x54U, 0xF5U, 0x0FU, 0x11U, 0x1CU, 0x68U, 0x00U, 0x10U, 0x5CU, 0x71U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, 0x35U, 0xFAU, 0x3CU, 0x20U, - 0x0DU, 0x8CU, 0xF5U, 0x0FU, 0x08U, 0x46U, 0x34U, 0x00U, 0xB5U, 0x0AU, 0x3CU, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0xDAU, 0x3CU, 0x20U, - 0x05U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x21U, 0x00U, - 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, - 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, - 0x00U, 0x46U, 0x00U, 0x00U, 0xB5U, 0x12U, 0x3BU, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x0AU, 0x40U, 0x20U, 0x08U, 0x4AU, 0xC4U, 0x0FU, - 0x60U, 0x08U, 0xC4U, 0x0FU, 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0x8AU, 0x3EU, 0x20U, - 0x00U, 0x24U, 0x54U, 0x01U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0xA2U, 0x3DU, 0x20U, 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, - 0x01U, 0x18U, 0x14U, 0xFFU, 0x10U, 0x1CU, 0x48U, 0x08U, 0x10U, 0xDCU, 0x70U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x0DU, 0x10U, 0xF5U, 0x0FU, 0x10U, 0x1CU, 0x68U, 0x18U, - 0x10U, 0x1CU, 0x70U, 0x18U, 0x10U, 0xDCU, 0x59U, 0x50U, 0x10U, 0xDCU, 0x41U, 0x50U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x14U, 0x50U, 0x10U, 0x10U, 0x1CU, 0x60U, 0x10U, - 0x10U, 0xDCU, 0x59U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x0CU, 0x68U, 0x10U, - 0x0DU, 0xCCU, 0xF4U, 0x0FU, 0x08U, 0x66U, 0x16U, 0x00U, 0x55U, 0xA2U, 0x3DU, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x72U, 0x30U, 0x20U, - 0x08U, 0x46U, 0x20U, 0x00U, 0x05U, 0x80U, 0x32U, 0x31U, 0x15U, 0x92U, 0x3FU, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x8AU, 0x3EU, 0x20U, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x01U, 0x18U, 0x14U, 0xFFU, - 0x10U, 0x1CU, 0x48U, 0x08U, 0x10U, 0xDCU, 0x70U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x34U, 0x00U, 0x35U, 0x92U, 0x3FU, 0x20U, 0x0DU, 0x10U, 0xF5U, 0x0FU, - 0x10U, 0x1CU, 0x68U, 0x18U, 0x10U, 0x1CU, 0x70U, 0x18U, 0x10U, 0xDCU, 0x59U, 0x50U, - 0x10U, 0xDCU, 0x41U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, - 0x35U, 0x92U, 0x3FU, 0x20U, 0x10U, 0x14U, 0x50U, 0x10U, 0x10U, 0x1CU, 0x60U, 0x10U, - 0x10U, 0xDCU, 0x59U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, - 0x35U, 0x92U, 0x3FU, 0x20U, 0x10U, 0x0CU, 0x68U, 0x10U, 0x0DU, 0xCCU, 0xF4U, 0x0FU, - 0x08U, 0x46U, 0x34U, 0x00U, 0xB5U, 0x8AU, 0x3EU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x72U, 0x3FU, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, - 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, - 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, 0x00U, 0x46U, 0x00U, 0x00U, - 0xB5U, 0x7AU, 0x3DU, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x0AU, 0x40U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, - 0x01U, 0x9CU, 0x05U, 0x03U, 0x00U, 0x0CU, 0xC4U, 0x02U, 0x00U, 0x24U, 0xF4U, 0x0FU, - 0x06U, 0x00U, 0x10U, 0x00U, 0x00U, 0xDEU, 0x01U, 0x00U, 0x35U, 0xBAU, 0x40U, 0x20U, - 0x15U, 0x42U, 0x43U, 0x20U, 0x08U, 0x4AU, 0x04U, 0x15U, 0x60U, 0x08U, 0x04U, 0x15U, - 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0xBAU, 0x41U, 0x20U, 0x00U, 0x20U, 0x54U, 0x01U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0xE2U, 0x40U, 0x20U, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x01U, 0x18U, 0x14U, 0xFFU, - 0x11U, 0x1CU, 0x40U, 0x08U, 0x10U, 0xDCU, 0x70U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x9CU, 0x91U, 0x30U, - 0x10U, 0x5CU, 0x71U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x11U, 0x18U, 0x60U, 0x10U, - 0x11U, 0x1CU, 0x40U, 0x08U, 0x10U, 0x9CU, 0x71U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x0DU, 0x4CU, 0x42U, 0x00U, 0x08U, 0x22U, 0x16U, 0x00U, 0x55U, 0xE2U, 0x40U, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x8AU, 0x41U, 0x20U, - 0x08U, 0x46U, 0x20U, 0x00U, 0x05U, 0x80U, 0x32U, 0x31U, 0x15U, 0xB2U, 0x42U, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0xBAU, 0x41U, 0x20U, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x01U, 0x18U, 0x14U, 0xFFU, - 0x11U, 0x1CU, 0x40U, 0x08U, 0x10U, 0xDCU, 0x70U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x44U, 0x00U, 0x35U, 0xB2U, 0x42U, 0x20U, 0x01U, 0x10U, 0x14U, 0xFFU, - 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x9CU, 0x91U, 0x30U, 0x10U, 0x5CU, 0x71U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, 0x35U, 0xB2U, 0x42U, 0x20U, - 0x11U, 0x18U, 0x60U, 0x10U, 0x11U, 0x1CU, 0x40U, 0x08U, 0x10U, 0x9CU, 0x71U, 0x50U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, 0x35U, 0xB2U, 0x42U, 0x20U, - 0x0DU, 0x4CU, 0x42U, 0x00U, 0x08U, 0x46U, 0x44U, 0x00U, 0xB5U, 0xBAU, 0x41U, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x92U, 0x42U, 0x20U, - 0x05U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, 0x10U, 0x0CU, 0x28U, 0x02U, - 0x08U, 0x88U, 0x30U, 0x00U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, - 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, - 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, 0x00U, 0x46U, 0x00U, 0x00U, - 0xB5U, 0xBAU, 0x40U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x15U, 0xB2U, 0x45U, 0x20U, 0x08U, 0x4AU, 0x04U, 0x15U, 0x60U, 0x08U, 0x04U, 0x15U, - 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0x3AU, 0x44U, 0x20U, 0x00U, 0x20U, 0x54U, 0x01U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x6AU, 0x43U, 0x20U, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x01U, 0x18U, 0x14U, 0xFFU, - 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x01U, 0x10U, 0x14U, 0xFFU, - 0x10U, 0x14U, 0x50U, 0x08U, 0x10U, 0x14U, 0x58U, 0x08U, 0x10U, 0x5CU, 0x61U, 0x58U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x18U, 0x60U, 0x08U, 0x10U, 0x18U, 0x68U, 0x10U, - 0x10U, 0x9CU, 0x41U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x4CU, 0x4AU, 0x30U, - 0x08U, 0x22U, 0x16U, 0x00U, 0x55U, 0x6AU, 0x43U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x0AU, 0x44U, 0x20U, 0x08U, 0x46U, 0x20U, 0x00U, - 0x05U, 0x80U, 0x32U, 0x31U, 0x15U, 0x2AU, 0x45U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x3AU, 0x44U, 0x20U, 0x01U, 0x10U, 0x14U, 0xFFU, - 0x01U, 0x14U, 0x14U, 0xFFU, 0x01U, 0x18U, 0x14U, 0xFFU, 0x10U, 0xDCU, 0x40U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, 0x35U, 0x2AU, 0x45U, 0x20U, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x10U, 0x14U, 0x50U, 0x08U, 0x10U, 0x14U, 0x58U, 0x08U, - 0x10U, 0x5CU, 0x61U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x35U, 0x2AU, 0x45U, 0x20U, 0x10U, 0x18U, 0x60U, 0x08U, 0x10U, 0x18U, 0x68U, 0x10U, - 0x10U, 0x9CU, 0x41U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x35U, 0x2AU, 0x45U, 0x20U, 0x10U, 0x4CU, 0x4AU, 0x30U, 0x08U, 0x46U, 0x44U, 0x00U, - 0xB5U, 0x3AU, 0x44U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0x0AU, 0x45U, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, - 0x10U, 0x0CU, 0x28U, 0x02U, 0x08U, 0x88U, 0x30U, 0x00U, 0x0CU, 0xDCU, 0x21U, 0x00U, - 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, - 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, - 0x00U, 0x46U, 0x00U, 0x00U, 0xB5U, 0x42U, 0x43U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, - 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xB2U, 0x45U, 0x20U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, - 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0x8CU, 0x05U, 0x02U, 0x01U, 0xB0U, 0x05U, 0x03U, 0x10U, 0x04U, 0x14U, 0x02U, - 0x0DU, 0x50U, 0x14U, 0x00U, 0x10U, 0x04U, 0x14U, 0x01U, 0x08U, 0x44U, 0x14U, 0x00U, - 0x00U, 0xCEU, 0x00U, 0x00U, 0x35U, 0xDAU, 0x46U, 0x20U, 0x08U, 0xCEU, 0x14U, 0x00U, - 0x35U, 0x62U, 0x47U, 0x20U, 0x08U, 0xCEU, 0x14U, 0x00U, 0x35U, 0xEAU, 0x47U, 0x20U, - 0x08U, 0xCEU, 0x14U, 0x00U, 0x35U, 0x72U, 0x48U, 0x20U, 0x08U, 0xCEU, 0x14U, 0x00U, - 0x35U, 0xFAU, 0x48U, 0x20U, 0x08U, 0xCEU, 0x14U, 0x00U, 0x35U, 0x82U, 0x49U, 0x20U, - 0x08U, 0xCEU, 0x14U, 0x00U, 0x35U, 0x0AU, 0x4AU, 0x20U, 0x08U, 0xCEU, 0x14U, 0x00U, - 0x35U, 0x92U, 0x4AU, 0x20U, 0x15U, 0x1AU, 0x4BU, 0x20U, 0x06U, 0x48U, 0x47U, 0x02U, - 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x00U, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x00U, 0x32U, 0x32U, 0x00U, 0x12U, 0x01U, 0x00U, 0x41U, 0x08U, 0x1CU, 0x01U, - 0x5CU, 0xB4U, 0x00U, 0x00U, 0x45U, 0x00U, 0x22U, 0x32U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x15U, 0x1AU, 0x4BU, 0x20U, 0x06U, 0x48U, 0x47U, 0x02U, 0x1AU, 0x80U, 0x10U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x04U, 0x22U, 0x32U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x04U, 0x32U, 0x32U, - 0x00U, 0x12U, 0x01U, 0x00U, 0x41U, 0x08U, 0x1CU, 0x01U, 0x5CU, 0xB4U, 0x00U, 0x00U, - 0x45U, 0x04U, 0x22U, 0x32U, 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x1AU, 0x4BU, 0x20U, - 0x06U, 0x48U, 0x47U, 0x02U, 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x08U, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x08U, 0x32U, 0x32U, 0x00U, 0x12U, 0x01U, 0x00U, - 0x41U, 0x08U, 0x1CU, 0x01U, 0x5CU, 0xB4U, 0x00U, 0x00U, 0x45U, 0x08U, 0x22U, 0x32U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x1AU, 0x4BU, 0x20U, 0x06U, 0x48U, 0x47U, 0x02U, - 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x0CU, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x0CU, 0x32U, 0x32U, 0x00U, 0x12U, 0x01U, 0x00U, 0x41U, 0x08U, 0x1CU, 0x01U, - 0x5CU, 0xB4U, 0x00U, 0x00U, 0x45U, 0x0CU, 0x22U, 0x32U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x15U, 0x1AU, 0x4BU, 0x20U, 0x06U, 0x48U, 0x47U, 0x02U, 0x1AU, 0x80U, 0x10U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x10U, 0x22U, 0x32U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x10U, 0x32U, 0x32U, - 0x00U, 0x12U, 0x01U, 0x00U, 0x41U, 0x08U, 0x1CU, 0x01U, 0x5CU, 0xB4U, 0x00U, 0x00U, - 0x45U, 0x10U, 0x22U, 0x32U, 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x1AU, 0x4BU, 0x20U, - 0x06U, 0x48U, 0x47U, 0x02U, 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x14U, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x14U, 0x32U, 0x32U, 0x00U, 0x12U, 0x01U, 0x00U, - 0x41U, 0x08U, 0x1CU, 0x01U, 0x5CU, 0xB4U, 0x00U, 0x00U, 0x45U, 0x14U, 0x22U, 0x32U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x1AU, 0x4BU, 0x20U, 0x06U, 0x48U, 0x47U, 0x02U, - 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x18U, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x18U, 0x32U, 0x32U, 0x00U, 0x12U, 0x01U, 0x00U, 0x41U, 0x08U, 0x1CU, 0x01U, - 0x5CU, 0xB4U, 0x00U, 0x00U, 0x45U, 0x18U, 0x22U, 0x32U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x15U, 0x1AU, 0x4BU, 0x20U, 0x06U, 0x48U, 0x47U, 0x02U, 0x1AU, 0x80U, 0x10U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x1CU, 0x22U, 0x32U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x1CU, 0x32U, 0x32U, - 0x00U, 0x12U, 0x01U, 0x00U, 0x41U, 0x08U, 0x1CU, 0x01U, 0x5CU, 0xB4U, 0x00U, 0x00U, - 0x45U, 0x1CU, 0x22U, 0x32U, 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x1AU, 0x4BU, 0x20U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x1AU, 0x4BU, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0x88U, 0x05U, 0x02U, - 0x01U, 0x8CU, 0x05U, 0x03U, 0x01U, 0xB0U, 0x05U, 0x04U, 0x01U, 0x9CU, 0x05U, 0x05U, - 0x02U, 0x00U, 0x17U, 0x00U, 0x02U, 0x00U, 0x27U, 0x01U, 0x08U, 0xCCU, 0x14U, 0x00U, - 0x00U, 0x18U, 0x04U, 0x00U, 0x00U, 0x08U, 0xC4U, 0x02U, 0x00U, 0xDEU, 0x01U, 0x00U, - 0x35U, 0xEAU, 0x4BU, 0x20U, 0x15U, 0xA2U, 0x4DU, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x10U, 0x5CU, 0x41U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x48U, - 0x08U, 0x46U, 0x24U, 0x00U, 0x55U, 0x62U, 0x4CU, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x62U, 0x4CU, 0x20U, 0x26U, 0x98U, 0x25U, 0x00U, - 0x20U, 0xC8U, 0x01U, 0x00U, 0x35U, 0xE2U, 0x4CU, 0x20U, 0x01U, 0x08U, 0x18U, 0x01U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x08U, 0x44U, 0x24U, 0x00U, 0x10U, 0xDCU, 0x51U, 0x58U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, - 0x75U, 0xE2U, 0x4CU, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0xEAU, 0x4BU, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0xEAU, 0x4BU, 0x20U, - 0x05U, 0x80U, 0x22U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x61U, 0x00U, - 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, - 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x08U, 0xC4U, 0x03U, - 0x00U, 0x18U, 0x04U, 0x00U, 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0xEAU, 0x4BU, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0xEAU, 0x4BU, 0x20U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x5AU, 0x4FU, 0x20U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, 0x10U, 0x1CU, 0x51U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x48U, 0x08U, 0x46U, 0x24U, 0x00U, 0x55U, 0x1AU, 0x4EU, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x1AU, 0x4EU, 0x20U, - 0x26U, 0x98U, 0x25U, 0x00U, 0x20U, 0xC8U, 0x01U, 0x00U, 0x35U, 0x9AU, 0x4EU, 0x20U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x08U, 0x18U, 0x01U, 0x08U, 0x44U, 0x24U, 0x00U, - 0x10U, 0xDCU, 0x51U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, 0x06U, 0x98U, 0x45U, 0x00U, - 0x08U, 0x92U, 0xC5U, 0x07U, 0x75U, 0x9AU, 0x4EU, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, - 0x55U, 0xA2U, 0x4DU, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0xA2U, 0x4DU, 0x20U, 0x05U, 0x80U, 0x22U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, - 0x0CU, 0xDCU, 0x61U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, - 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, - 0x00U, 0x08U, 0xC4U, 0x03U, 0x00U, 0x18U, 0x04U, 0x00U, 0x00U, 0x46U, 0x00U, 0x00U, - 0x55U, 0xA2U, 0x4DU, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0xA2U, 0x4DU, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x15U, 0x5AU, 0x4FU, 0x20U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, - 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x5AU, 0x4FU, 0x20U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, - 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0x88U, 0x05U, 0x02U, 0x01U, 0x8CU, 0x05U, 0x03U, 0x01U, 0xB0U, 0x05U, 0x04U, - 0x01U, 0x9CU, 0x05U, 0x05U, 0x02U, 0x00U, 0x17U, 0x00U, 0x02U, 0x00U, 0x27U, 0x01U, - 0x08U, 0xCCU, 0x14U, 0x00U, 0x00U, 0x18U, 0x04U, 0x00U, 0x00U, 0x08U, 0xC4U, 0x02U, - 0x00U, 0xDEU, 0x01U, 0x00U, 0x35U, 0x2AU, 0x50U, 0x20U, 0x15U, 0x72U, 0x53U, 0x20U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x1CU, 0x18U, 0x01U, - 0x10U, 0xD4U, 0x51U, 0x48U, 0x10U, 0x5CU, 0x41U, 0x50U, 0x10U, 0x9CU, 0x70U, 0x48U, - 0x08U, 0x44U, 0x34U, 0x00U, 0x05U, 0x80U, 0x72U, 0x31U, 0x06U, 0x98U, 0x45U, 0x00U, - 0x08U, 0x92U, 0xC5U, 0x07U, 0x75U, 0xBAU, 0x52U, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, - 0x55U, 0xCAU, 0x50U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0xCAU, 0x50U, 0x20U, 0x35U, 0xBAU, 0x52U, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x1CU, 0x18U, 0x01U, 0x10U, 0xD4U, 0x51U, 0x48U, - 0x10U, 0x5CU, 0x41U, 0x50U, 0x08U, 0x46U, 0x34U, 0x00U, 0x55U, 0x4AU, 0x51U, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x4AU, 0x51U, 0x20U, - 0x25U, 0x80U, 0x72U, 0x31U, 0x26U, 0x98U, 0x35U, 0x00U, 0x35U, 0xBAU, 0x52U, 0x20U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x24U, 0x18U, 0x01U, - 0x08U, 0x44U, 0x34U, 0x00U, 0x10U, 0xDCU, 0x91U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x10U, 0x5CU, 0x41U, 0x48U, 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, - 0x25U, 0x80U, 0x72U, 0x31U, 0x26U, 0x98U, 0x25U, 0x00U, 0x35U, 0xBAU, 0x52U, 0x20U, - 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0x02U, 0x52U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x02U, 0x52U, 0x20U, 0x25U, 0x80U, 0x72U, 0x31U, - 0x26U, 0x98U, 0x25U, 0x00U, 0x35U, 0xBAU, 0x52U, 0x20U, 0x01U, 0x08U, 0x18U, 0x01U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x10U, 0x18U, 0x01U, 0x08U, 0x44U, 0x34U, 0x00U, - 0x10U, 0xDCU, 0x41U, 0x50U, 0x10U, 0xDCU, 0x51U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, 0x25U, 0x80U, 0x22U, 0x31U, - 0x26U, 0x98U, 0x15U, 0x00U, 0x35U, 0xBAU, 0x52U, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, - 0x55U, 0x2AU, 0x50U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0x2AU, 0x50U, 0x20U, 0x25U, 0x80U, 0x22U, 0x31U, 0x26U, 0x98U, 0x15U, 0x00U, - 0x35U, 0xBAU, 0x52U, 0x20U, 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x61U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, - 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, - 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x08U, 0xC4U, 0x03U, 0x08U, 0x98U, 0x15U, 0x00U, - 0x00U, 0x18U, 0x04U, 0x00U, 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0x2AU, 0x50U, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x2AU, 0x50U, 0x20U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0xBAU, 0x56U, 0x20U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x1CU, 0x18U, 0x01U, - 0x10U, 0x14U, 0x51U, 0x48U, 0x10U, 0x5CU, 0x71U, 0x50U, 0x10U, 0x9CU, 0x70U, 0x48U, - 0x08U, 0x44U, 0x34U, 0x00U, 0x05U, 0x80U, 0x72U, 0x31U, 0x06U, 0x98U, 0x45U, 0x00U, - 0x08U, 0x92U, 0xC5U, 0x07U, 0x75U, 0x02U, 0x56U, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, - 0x55U, 0x12U, 0x54U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0x12U, 0x54U, 0x20U, 0x35U, 0x02U, 0x56U, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x1CU, 0x18U, 0x01U, 0x10U, 0x14U, 0x51U, 0x48U, - 0x10U, 0x5CU, 0x71U, 0x50U, 0x08U, 0x46U, 0x34U, 0x00U, 0x55U, 0x92U, 0x54U, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x92U, 0x54U, 0x20U, - 0x25U, 0x80U, 0x72U, 0x31U, 0x26U, 0x98U, 0x35U, 0x00U, 0x35U, 0x02U, 0x56U, 0x20U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x24U, 0x18U, 0x01U, - 0x08U, 0x44U, 0x34U, 0x00U, 0x10U, 0xDCU, 0x41U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x10U, 0x5CU, 0x91U, 0x48U, 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, - 0x25U, 0x80U, 0x72U, 0x31U, 0x26U, 0x98U, 0x25U, 0x00U, 0x35U, 0x02U, 0x56U, 0x20U, - 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0x4AU, 0x55U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x4AU, 0x55U, 0x20U, 0x25U, 0x80U, 0x72U, 0x31U, - 0x26U, 0x98U, 0x25U, 0x00U, 0x35U, 0x02U, 0x56U, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x08U, 0x18U, 0x01U, 0x08U, 0x44U, 0x34U, 0x00U, - 0x10U, 0xDCU, 0x41U, 0x50U, 0x10U, 0xDCU, 0x51U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, 0x25U, 0x80U, 0x22U, 0x31U, - 0x26U, 0x98U, 0x15U, 0x00U, 0x35U, 0x02U, 0x56U, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, - 0x55U, 0x72U, 0x53U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0x72U, 0x53U, 0x20U, 0x25U, 0x80U, 0x22U, 0x31U, 0x26U, 0x98U, 0x15U, 0x00U, - 0x35U, 0x02U, 0x56U, 0x20U, 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x61U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, - 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, - 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x08U, 0xC4U, 0x03U, 0x08U, 0x98U, 0x15U, 0x00U, - 0x00U, 0x18U, 0x04U, 0x00U, 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0x72U, 0x53U, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x72U, 0x53U, 0x20U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0xBAU, 0x56U, 0x20U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xBAU, 0x56U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0x88U, 0x05U, 0x02U, - 0x01U, 0x8CU, 0x05U, 0x03U, 0x01U, 0xB0U, 0x05U, 0x04U, 0x01U, 0x9CU, 0x05U, 0x05U, - 0x02U, 0x00U, 0x17U, 0x00U, 0x02U, 0x00U, 0x27U, 0x01U, 0x08U, 0xCCU, 0x14U, 0x00U, - 0x00U, 0x18U, 0x04U, 0x00U, 0x00U, 0x14U, 0xFEU, 0x8FU, 0x00U, 0xDEU, 0x01U, 0x00U, - 0x00U, 0x08U, 0xC4U, 0x02U, 0x35U, 0x92U, 0x57U, 0x20U, 0x15U, 0x9AU, 0x5AU, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x10U, 0x10U, 0x40U, 0x08U, 0x11U, 0x10U, 0x48U, 0x00U, - 0x10U, 0x9CU, 0x40U, 0x48U, 0x08U, 0x44U, 0x44U, 0x00U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, 0x75U, 0xE2U, 0x59U, 0x20U, - 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0x22U, 0x58U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x22U, 0x58U, 0x20U, 0x35U, 0xE2U, 0x59U, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x10U, 0x1CU, 0x40U, 0x08U, 0x11U, 0x1CU, 0x78U, 0x00U, - 0x08U, 0x46U, 0x44U, 0x00U, 0x55U, 0x92U, 0x58U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x92U, 0x58U, 0x20U, 0x25U, 0x80U, 0x72U, 0x31U, - 0x26U, 0x98U, 0x35U, 0x00U, 0x35U, 0xE2U, 0x59U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x10U, 0x10U, 0x40U, 0x08U, 0x11U, 0x10U, 0x48U, 0x00U, 0x10U, 0xDCU, 0x41U, 0x58U, - 0x08U, 0x46U, 0x44U, 0x00U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x1CU, 0x48U, 0x08U, - 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, 0x75U, 0xE2U, 0x59U, 0x20U, - 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0x3AU, 0x59U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x3AU, 0x59U, 0x20U, 0x25U, 0x80U, 0x72U, 0x31U, - 0x26U, 0x98U, 0x25U, 0x00U, 0x35U, 0xE2U, 0x59U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x10U, 0x10U, 0x40U, 0x08U, 0x11U, 0x10U, 0x48U, 0x00U, 0x10U, 0xDCU, 0x41U, 0x50U, - 0x08U, 0x46U, 0x44U, 0x00U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x08U, 0x48U, 0x10U, - 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, 0x75U, 0xE2U, 0x59U, 0x20U, - 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0x92U, 0x57U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x92U, 0x57U, 0x20U, 0x25U, 0x80U, 0x22U, 0x31U, - 0x26U, 0x98U, 0x25U, 0x00U, 0x35U, 0xE2U, 0x59U, 0x20U, 0x00U, 0x9CU, 0x9CU, 0x07U, - 0x0CU, 0xDCU, 0x61U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, - 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x08U, 0xC4U, 0x03U, - 0x08U, 0x98U, 0x15U, 0x00U, 0x00U, 0x18U, 0x04U, 0x00U, 0x00U, 0x46U, 0x00U, 0x00U, - 0x55U, 0x92U, 0x57U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0x92U, 0x57U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x15U, 0x7AU, 0x5DU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x10U, 0x9CU, 0x40U, 0x48U, - 0x08U, 0x44U, 0x44U, 0x00U, 0x05U, 0x80U, 0x72U, 0x31U, 0x06U, 0x98U, 0x45U, 0x00U, - 0x08U, 0x92U, 0xC5U, 0x07U, 0x75U, 0xC2U, 0x5CU, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, - 0x55U, 0x1AU, 0x5BU, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0x1AU, 0x5BU, 0x20U, 0x35U, 0xC2U, 0x5CU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x0DU, 0x1CU, 0x51U, 0x00U, 0x08U, 0x46U, 0x44U, 0x00U, 0x55U, 0x82U, 0x5BU, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x82U, 0x5BU, 0x20U, - 0x25U, 0x80U, 0x72U, 0x31U, 0x26U, 0x98U, 0x35U, 0x00U, 0x35U, 0xC2U, 0x5CU, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x0DU, 0x10U, 0x51U, 0x00U, 0x10U, 0xDCU, 0x41U, 0x58U, - 0x08U, 0x46U, 0x44U, 0x00U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x1CU, 0x48U, 0x08U, - 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, 0x75U, 0xC2U, 0x5CU, 0x20U, - 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0x22U, 0x5CU, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x22U, 0x5CU, 0x20U, 0x25U, 0x80U, 0x72U, 0x31U, - 0x26U, 0x98U, 0x25U, 0x00U, 0x35U, 0xC2U, 0x5CU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x0DU, 0x10U, 0x51U, 0x00U, 0x10U, 0xDCU, 0x41U, 0x50U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x08U, 0x48U, 0x10U, 0x06U, 0x98U, 0x45U, 0x00U, - 0x08U, 0x92U, 0xC5U, 0x07U, 0x75U, 0xC2U, 0x5CU, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, - 0x55U, 0x9AU, 0x5AU, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0x9AU, 0x5AU, 0x20U, 0x25U, 0x80U, 0x22U, 0x31U, 0x26U, 0x98U, 0x25U, 0x00U, - 0x35U, 0xC2U, 0x5CU, 0x20U, 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x61U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, - 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, - 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x08U, 0xC4U, 0x03U, 0x08U, 0x98U, 0x15U, 0x00U, - 0x00U, 0x18U, 0x04U, 0x00U, 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0x9AU, 0x5AU, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x9AU, 0x5AU, 0x20U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x7AU, 0x5DU, 0x20U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x7AU, 0x5DU, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, - 0x01U, 0x9CU, 0x05U, 0x03U, 0x00U, 0x0CU, 0xC4U, 0x02U, 0x00U, 0xDEU, 0x01U, 0x00U, - 0x35U, 0x1AU, 0x5EU, 0x20U, 0x15U, 0x5AU, 0x62U, 0x20U, 0x08U, 0x4AU, 0x84U, 0x0AU, - 0x60U, 0x08U, 0x84U, 0x0AU, 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0xFAU, 0x5FU, 0x20U, - 0x00U, 0x24U, 0x54U, 0x01U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0x42U, 0x5EU, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x0DU, 0x18U, 0xF5U, 0x01U, 0x10U, 0x18U, 0x60U, 0x1BU, 0x0DU, 0x1CU, 0x05U, 0x0EU, - 0x10U, 0x98U, 0x71U, 0x4DU, 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x55U, - 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x48U, 0x10U, 0xDCU, 0x60U, 0x40U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x0DU, 0x18U, 0xF5U, 0x01U, 0x10U, 0x18U, 0x60U, 0x13U, 0x0DU, 0x1CU, 0x05U, 0x0EU, - 0x10U, 0x98U, 0x71U, 0x45U, 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x4DU, - 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x40U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x9CU, 0x71U, 0x58U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x18U, 0x78U, 0x03U, - 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x45U, 0x0DU, 0x1CU, 0xF5U, 0x01U, - 0x10U, 0x9CU, 0x71U, 0x4BU, 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x50U, 0x0DU, 0x1CU, 0x05U, 0x0EU, - 0x10U, 0x98U, 0x71U, 0x55U, 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x9CU, 0x71U, 0x5DU, - 0x05U, 0x80U, 0x72U, 0x31U, 0x0DU, 0x0CU, 0xF5U, 0x01U, 0x10U, 0x0CU, 0x30U, 0x03U, - 0x08U, 0x66U, 0x16U, 0x00U, 0x55U, 0x42U, 0x5EU, 0x20U, 0x08U, 0x46U, 0x20U, 0x00U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0xD2U, 0x5FU, 0x20U, - 0x05U, 0x80U, 0x32U, 0x31U, 0x15U, 0xD2U, 0x61U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0xFAU, 0x5FU, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x0DU, 0x18U, 0xF5U, 0x01U, 0x10U, 0x18U, 0x60U, 0x1BU, - 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x98U, 0x71U, 0x4DU, 0x0DU, 0x5CU, 0x75U, 0x00U, - 0x10U, 0x98U, 0x71U, 0x55U, 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x48U, - 0x10U, 0xDCU, 0x60U, 0x40U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x24U, 0x00U, - 0x35U, 0xD2U, 0x61U, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x0DU, 0x18U, 0xF5U, 0x01U, 0x10U, 0x18U, 0x60U, 0x13U, 0x0DU, 0x1CU, 0x05U, 0x0EU, - 0x10U, 0x98U, 0x71U, 0x45U, 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x4DU, - 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x40U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x9CU, 0x71U, 0x58U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x24U, 0x00U, 0x35U, 0xD2U, 0x61U, 0x20U, - 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x18U, 0x78U, 0x03U, 0x0DU, 0x5CU, 0x75U, 0x00U, - 0x10U, 0x98U, 0x71U, 0x45U, 0x0DU, 0x1CU, 0xF5U, 0x01U, 0x10U, 0x9CU, 0x71U, 0x4BU, - 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, 0x0DU, 0x5CU, 0x85U, 0x0FU, - 0x10U, 0x98U, 0x71U, 0x50U, 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x98U, 0x71U, 0x55U, - 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x9CU, 0x71U, 0x5DU, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x24U, 0x00U, 0x35U, 0xD2U, 0x61U, 0x20U, 0x0DU, 0x0CU, 0xF5U, 0x01U, - 0x10U, 0x0CU, 0x30U, 0x03U, 0x08U, 0x46U, 0x24U, 0x00U, 0xB5U, 0xFAU, 0x5FU, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0xB2U, 0x61U, 0x20U, - 0x05U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, 0x10U, 0x88U, 0x28U, 0x81U, - 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, - 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, - 0x00U, 0x0CU, 0xC4U, 0x03U, 0x00U, 0x46U, 0x00U, 0x00U, 0xB5U, 0x1AU, 0x5EU, 0x20U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x92U, 0x66U, 0x20U, - 0x08U, 0x4AU, 0x84U, 0x0AU, 0x60U, 0x08U, 0x84U, 0x0AU, 0x80U, 0x48U, 0x00U, 0x00U, - 0x95U, 0x3AU, 0x64U, 0x20U, 0x00U, 0x24U, 0x54U, 0x01U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x82U, 0x62U, 0x20U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x0DU, 0x18U, 0xF5U, 0x01U, 0x10U, 0x18U, 0x60U, 0x1BU, - 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x98U, 0x71U, 0x4DU, 0x0DU, 0x5CU, 0x75U, 0x00U, - 0x10U, 0x98U, 0x71U, 0x55U, 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x48U, - 0x10U, 0xDCU, 0x60U, 0x40U, 0x05U, 0x80U, 0x72U, 0x31U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x0DU, 0x18U, 0xF5U, 0x01U, 0x10U, 0x18U, 0x60U, 0x13U, - 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x98U, 0x71U, 0x45U, 0x0DU, 0x5CU, 0x75U, 0x00U, - 0x10U, 0x98U, 0x71U, 0x4DU, 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x40U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x10U, 0x18U, 0x01U, 0x0DU, 0x5CU, 0x85U, 0x0FU, - 0x10U, 0x9CU, 0x71U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, 0x0DU, 0x1CU, 0x05U, 0x0EU, - 0x10U, 0x18U, 0x78U, 0x03U, 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x45U, - 0x0DU, 0x1CU, 0xF5U, 0x01U, 0x10U, 0x9CU, 0x71U, 0x4BU, 0x01U, 0x14U, 0x18U, 0x01U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x50U, - 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x98U, 0x71U, 0x55U, 0x0DU, 0x5CU, 0x75U, 0x00U, - 0x10U, 0x9CU, 0x71U, 0x5DU, 0x05U, 0x80U, 0x72U, 0x31U, 0x0DU, 0x0CU, 0xF5U, 0x01U, - 0x10U, 0x0CU, 0x30U, 0x03U, 0x08U, 0x66U, 0x16U, 0x00U, 0x55U, 0x82U, 0x62U, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x0AU, 0x64U, 0x20U, - 0x08U, 0x46U, 0x20U, 0x00U, 0x05U, 0x80U, 0x32U, 0x31U, 0x15U, 0x12U, 0x66U, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x3AU, 0x64U, 0x20U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x10U, 0x18U, 0x01U, 0x0DU, 0x18U, 0xF5U, 0x01U, - 0x10U, 0x18U, 0x60U, 0x1BU, 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x98U, 0x71U, 0x4DU, - 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x55U, 0x0DU, 0x5CU, 0x85U, 0x0FU, - 0x10U, 0x98U, 0x71U, 0x48U, 0x10U, 0xDCU, 0x60U, 0x40U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x24U, 0x00U, 0x35U, 0x12U, 0x66U, 0x20U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x0DU, 0x18U, 0xF5U, 0x01U, 0x10U, 0x18U, 0x60U, 0x13U, - 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x98U, 0x71U, 0x45U, 0x0DU, 0x5CU, 0x75U, 0x00U, - 0x10U, 0x98U, 0x71U, 0x4DU, 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x40U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x10U, 0x18U, 0x01U, 0x0DU, 0x5CU, 0x85U, 0x0FU, - 0x10U, 0x9CU, 0x71U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x24U, 0x00U, - 0x35U, 0x12U, 0x66U, 0x20U, 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x18U, 0x78U, 0x03U, - 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x45U, 0x0DU, 0x1CU, 0xF5U, 0x01U, - 0x10U, 0x9CU, 0x71U, 0x4BU, 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x50U, 0x0DU, 0x1CU, 0x05U, 0x0EU, - 0x10U, 0x98U, 0x71U, 0x55U, 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x9CU, 0x71U, 0x5DU, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x24U, 0x00U, 0x35U, 0x12U, 0x66U, 0x20U, - 0x0DU, 0x0CU, 0xF5U, 0x01U, 0x10U, 0x0CU, 0x30U, 0x03U, 0x08U, 0x46U, 0x24U, 0x00U, - 0xB5U, 0x3AU, 0x64U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0xF2U, 0x65U, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, - 0x10U, 0x88U, 0x28U, 0x81U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, - 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, - 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, 0x00U, 0x46U, 0x00U, 0x00U, - 0xB5U, 0x5AU, 0x62U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x92U, 0x66U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0x88U, 0x05U, 0x02U, - 0x01U, 0xA0U, 0x05U, 0x03U, 0x01U, 0x90U, 0x05U, 0x04U, 0x01U, 0xB0U, 0x05U, 0x05U, - 0x01U, 0xBCU, 0x05U, 0x06U, 0x02U, 0x00U, 0x17U, 0x00U, 0x02U, 0x00U, 0x27U, 0x01U, - 0x02U, 0x00U, 0xF7U, 0x02U, 0x02U, 0x00U, 0x47U, 0x03U, 0x0DU, 0x1EU, 0x15U, 0x00U, - 0x40U, 0x1CU, 0x14U, 0x00U, 0x20U, 0x1CU, 0x04U, 0x00U, 0x02U, 0x00U, 0x77U, 0x04U, - 0x02U, 0x00U, 0x77U, 0x05U, 0x08U, 0x1EU, 0x15U, 0x00U, 0x26U, 0x00U, 0x44U, 0x00U, - 0x00U, 0x24U, 0xFCU, 0x0FU, 0x00U, 0x10U, 0xF6U, 0x0FU, 0x0CU, 0x64U, 0x42U, 0x00U, - 0x00U, 0x10U, 0xF4U, 0x0FU, 0x0CU, 0x64U, 0x42U, 0x00U, 0x00U, 0x0CU, 0xC4U, 0x02U, - 0x01U, 0x08U, 0x07U, 0x00U, 0x08U, 0x88U, 0x14U, 0x00U, 0x02U, 0x00U, 0x27U, 0x00U, - 0x01U, 0x04U, 0x07U, 0x01U, 0x08U, 0x4AU, 0x44U, 0x05U, 0x60U, 0x08U, 0x44U, 0x05U, - 0x80U, 0x48U, 0x00U, 0x00U, 0x02U, 0x00U, 0x27U, 0x07U, 0x95U, 0x2AU, 0x6AU, 0x20U, - 0x0DU, 0x1EU, 0x16U, 0x00U, 0x55U, 0x12U, 0x68U, 0x20U, 0x15U, 0x32U, 0x68U, 0x20U, - 0x01U, 0x10U, 0x07U, 0x04U, 0x00U, 0x12U, 0x01U, 0x00U, 0x35U, 0xFAU, 0x68U, 0x20U, - 0x55U, 0x9AU, 0x69U, 0x20U, 0x01U, 0x10U, 0x07U, 0x03U, 0x08U, 0x1EU, 0x15U, 0x00U, - 0x35U, 0x7AU, 0x68U, 0x20U, 0x08U, 0x1EU, 0x25U, 0x00U, 0x35U, 0x9AU, 0x68U, 0x20U, - 0x08U, 0x1EU, 0x35U, 0x00U, 0x35U, 0xBAU, 0x68U, 0x20U, 0x08U, 0x1EU, 0x45U, 0x00U, - 0x35U, 0xDAU, 0x68U, 0x20U, 0x01U, 0x10U, 0x07U, 0x04U, 0x00U, 0x12U, 0x01U, 0x00U, - 0x55U, 0x9AU, 0x69U, 0x20U, 0x35U, 0x02U, 0x6EU, 0x20U, 0x01U, 0x10U, 0x07U, 0x04U, - 0x00U, 0x12U, 0x01U, 0x00U, 0x35U, 0xFAU, 0x68U, 0x20U, 0x55U, 0x02U, 0x6EU, 0x20U, - 0x01U, 0x10U, 0x07U, 0x04U, 0x00U, 0x12U, 0x01U, 0x00U, 0x35U, 0x9AU, 0x69U, 0x20U, - 0x55U, 0x02U, 0x6EU, 0x20U, 0x01U, 0x10U, 0x07U, 0x04U, 0x00U, 0x12U, 0x01U, 0x00U, - 0x55U, 0xFAU, 0x68U, 0x20U, 0x35U, 0x02U, 0x6EU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0xFAU, 0x68U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x02U, - 0x01U, 0x18U, 0x1CU, 0x02U, 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, - 0x0DU, 0x98U, 0x91U, 0x00U, 0x31U, 0x10U, 0x40U, 0x08U, 0x31U, 0x18U, 0x60U, 0x08U, - 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x1CU, 0x60U, 0x18U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x1CU, 0x68U, 0x08U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x00U, 0x0CU, 0x04U, 0x00U, 0x08U, 0x8AU, 0x44U, 0x00U, 0xB5U, 0xFAU, 0x68U, 0x20U, - 0x15U, 0xE2U, 0x6EU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0x9AU, 0x69U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x02U, 0x01U, 0x18U, 0x1CU, 0x02U, - 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, 0x0DU, 0x98U, 0x91U, 0x00U, - 0x31U, 0x10U, 0x40U, 0x08U, 0x31U, 0x18U, 0x60U, 0x08U, 0x05U, 0x80U, 0x32U, 0x31U, - 0x05U, 0x80U, 0x42U, 0x31U, 0x10U, 0x1CU, 0x60U, 0x10U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x10U, 0x0CU, 0x68U, 0x10U, 0x08U, 0x8AU, 0x44U, 0x00U, 0xB5U, 0x9AU, 0x69U, 0x20U, - 0x15U, 0xE2U, 0x6EU, 0x20U, 0x0DU, 0x1EU, 0x16U, 0x00U, 0x55U, 0x42U, 0x6AU, 0x20U, - 0x15U, 0x62U, 0x6AU, 0x20U, 0x01U, 0x10U, 0x07U, 0x04U, 0x00U, 0x12U, 0x01U, 0x00U, - 0x35U, 0x2AU, 0x6BU, 0x20U, 0x55U, 0x02U, 0x6CU, 0x20U, 0x01U, 0x10U, 0x07U, 0x03U, - 0x08U, 0x1EU, 0x15U, 0x00U, 0x35U, 0xAAU, 0x6AU, 0x20U, 0x08U, 0x1EU, 0x25U, 0x00U, - 0x35U, 0xCAU, 0x6AU, 0x20U, 0x08U, 0x1EU, 0x35U, 0x00U, 0x35U, 0xEAU, 0x6AU, 0x20U, - 0x08U, 0x1EU, 0x45U, 0x00U, 0x35U, 0x0AU, 0x6BU, 0x20U, 0x01U, 0x10U, 0x07U, 0x04U, - 0x00U, 0x12U, 0x01U, 0x00U, 0x55U, 0x02U, 0x6CU, 0x20U, 0x35U, 0xDAU, 0x6CU, 0x20U, - 0x01U, 0x10U, 0x07U, 0x04U, 0x00U, 0x12U, 0x01U, 0x00U, 0x35U, 0x2AU, 0x6BU, 0x20U, - 0x55U, 0xDAU, 0x6CU, 0x20U, 0x01U, 0x10U, 0x07U, 0x04U, 0x00U, 0x12U, 0x01U, 0x00U, - 0x35U, 0x02U, 0x6CU, 0x20U, 0x55U, 0xDAU, 0x6CU, 0x20U, 0x01U, 0x10U, 0x07U, 0x04U, - 0x00U, 0x12U, 0x01U, 0x00U, 0x55U, 0x2AU, 0x6BU, 0x20U, 0x35U, 0xDAU, 0x6CU, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x2AU, 0x6BU, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x02U, 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, - 0x31U, 0x10U, 0x40U, 0x08U, 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x8AU, 0x14U, 0x00U, 0x35U, 0x02U, 0x6FU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x02U, - 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, 0x31U, 0x10U, 0x40U, 0x08U, - 0x10U, 0x1CU, 0x40U, 0x18U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x8AU, 0x14U, 0x00U, - 0x35U, 0x02U, 0x6FU, 0x20U, 0x10U, 0x1CU, 0x48U, 0x08U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x8AU, 0x14U, 0x00U, 0x35U, 0x02U, 0x6FU, 0x20U, 0x00U, 0x0CU, 0x04U, 0x00U, - 0x08U, 0x8AU, 0x14U, 0x00U, 0xB5U, 0x2AU, 0x6BU, 0x20U, 0x15U, 0xE2U, 0x6EU, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x02U, 0x6CU, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x02U, 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, - 0x31U, 0x10U, 0x40U, 0x08U, 0x00U, 0xDCU, 0x00U, 0x00U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x8AU, 0x14U, 0x00U, 0x35U, 0x02U, 0x6FU, 0x20U, 0x00U, 0x1CU, 0x01U, 0x00U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x8AU, 0x14U, 0x00U, 0x35U, 0x02U, 0x6FU, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x02U, 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, - 0x31U, 0x10U, 0x40U, 0x08U, 0x10U, 0x1CU, 0x40U, 0x10U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x8AU, 0x14U, 0x00U, 0x35U, 0x02U, 0x6FU, 0x20U, 0x10U, 0x0CU, 0x48U, 0x10U, - 0x08U, 0x8AU, 0x14U, 0x00U, 0xB5U, 0x02U, 0x6CU, 0x20U, 0x15U, 0xE2U, 0x6EU, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0xDAU, 0x6CU, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, - 0x31U, 0x10U, 0x40U, 0x08U, 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x8AU, 0x14U, 0x00U, 0x35U, 0x02U, 0x6FU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, 0x31U, 0x10U, 0x40U, 0x08U, - 0x00U, 0x18U, 0x01U, 0x00U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x00U, 0xFEU, 0x03U, 0x00U, - 0x0DU, 0x10U, 0x91U, 0x00U, 0x31U, 0x10U, 0x40U, 0x08U, 0x10U, 0x9CU, 0x41U, 0x58U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x8AU, 0x14U, 0x00U, 0x35U, 0x02U, 0x6FU, 0x20U, - 0x10U, 0x18U, 0x48U, 0x08U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x00U, 0xFEU, 0x03U, 0x00U, - 0x0DU, 0x10U, 0x91U, 0x00U, 0x31U, 0x10U, 0x40U, 0x08U, 0x10U, 0x9CU, 0x41U, 0x50U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x8AU, 0x14U, 0x00U, 0x35U, 0x02U, 0x6FU, 0x20U, - 0x10U, 0x0CU, 0x48U, 0x10U, 0x08U, 0x8AU, 0x14U, 0x00U, 0xB5U, 0xDAU, 0x6CU, 0x20U, - 0x15U, 0xE2U, 0x6EU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0x02U, 0x6EU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x18U, 0x1CU, 0x01U, - 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, 0x0DU, 0x98U, 0x91U, 0x00U, - 0x31U, 0x10U, 0x40U, 0x08U, 0x31U, 0x18U, 0x60U, 0x08U, 0x10U, 0xDCU, 0x40U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x00U, 0x94U, 0x01U, 0x00U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x18U, 0x1CU, 0x01U, 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, - 0x0DU, 0x98U, 0x91U, 0x00U, 0x31U, 0x10U, 0x40U, 0x08U, 0x31U, 0x18U, 0x60U, 0x08U, - 0x10U, 0x5CU, 0x41U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x10U, 0x48U, 0x08U, - 0x10U, 0x1CU, 0x61U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x0CU, 0x68U, 0x10U, - 0x08U, 0x8AU, 0x44U, 0x00U, 0xB5U, 0x02U, 0x6EU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0xE2U, 0x6EU, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x01U, 0x08U, 0x07U, 0x07U, 0x10U, 0x0CU, 0x20U, 0x01U, - 0x06U, 0x8CU, 0x30U, 0x00U, 0x0CU, 0xDCU, 0x31U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, - 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, - 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, 0x08U, 0x46U, 0x20U, 0x00U, - 0xB5U, 0xD2U, 0x67U, 0x20U, 0x0DU, 0x1EU, 0x16U, 0x00U, 0x55U, 0x9AU, 0x6FU, 0x20U, - 0x35U, 0xC2U, 0x6FU, 0x20U, 0x01U, 0x1CU, 0x07U, 0x04U, 0x08U, 0xDEU, 0x15U, 0x00U, - 0x28U, 0x00U, 0x44U, 0x00U, 0x46U, 0x00U, 0x44U, 0x00U, 0x15U, 0x52U, 0x70U, 0x20U, - 0x01U, 0x10U, 0x07U, 0x03U, 0x08U, 0x1EU, 0x15U, 0x00U, 0x35U, 0x0AU, 0x70U, 0x20U, - 0x08U, 0x1EU, 0x25U, 0x00U, 0x35U, 0x52U, 0x70U, 0x20U, 0x08U, 0x1EU, 0x35U, 0x00U, - 0x35U, 0x32U, 0x70U, 0x20U, 0x08U, 0x1EU, 0x45U, 0x00U, 0x35U, 0x52U, 0x70U, 0x20U, - 0x01U, 0x1CU, 0x07U, 0x04U, 0x08U, 0xDEU, 0x15U, 0x00U, 0x28U, 0x00U, 0x44U, 0x00U, - 0x46U, 0x00U, 0x44U, 0x00U, 0x15U, 0x52U, 0x70U, 0x20U, 0x01U, 0x1CU, 0x07U, 0x04U, - 0x08U, 0xDEU, 0x15U, 0x00U, 0x26U, 0x00U, 0x44U, 0x00U, 0x48U, 0x00U, 0x44U, 0x00U, - 0x01U, 0x1CU, 0x07U, 0x04U, 0x08U, 0xDEU, 0x15U, 0x00U, 0x20U, 0x1CU, 0x04U, 0x00U, - 0x40U, 0x1CU, 0x14U, 0x00U, 0x02U, 0x00U, 0x77U, 0x04U, 0x01U, 0x08U, 0x07U, 0x00U, - 0x00U, 0x8AU, 0x00U, 0x00U, 0xB5U, 0xB2U, 0x67U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, - 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xA2U, 0x70U, 0x20U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, - 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0xB0U, 0x05U, 0x00U, 0x00U, 0x00U, 0x14U, 0x00U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x44U, 0x00U, 0x27U, 0x04U, 0x84U, 0x01U, 0x01U, - 0x00U, 0x80U, 0x1FU, 0x00U, 0x0CU, 0x00U, 0x10U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x18U, 0x00U, 0x01U, 0x00U, 0x00U, 0x0EU, 0x04U, 0x00U, 0x04U, 0x1CU, 0x01U, - 0x00U, 0x08U, 0x06U, 0x06U, 0x0CU, 0x1CU, 0x10U, 0x00U, 0x0CU, 0xDCU, 0x21U, 0x00U, - 0x00U, 0x00U, 0x2EU, 0x00U, 0x00U, 0x04U, 0x6CU, 0x04U, 0x00U, 0x08U, 0xA6U, 0x08U, - 0x00U, 0x0CU, 0xE4U, 0x0CU, 0x0CU, 0x14U, 0x10U, 0x00U, 0x0CU, 0x54U, 0x21U, 0x00U, - 0x0CU, 0x54U, 0x31U, 0x00U, 0x00U, 0x00U, 0x3EU, 0x01U, 0x00U, 0x04U, 0x7CU, 0x05U, - 0x00U, 0x08U, 0xB6U, 0x09U, 0x00U, 0x0CU, 0xF4U, 0x0DU, 0x0CU, 0x18U, 0x10U, 0x00U, - 0x0CU, 0x98U, 0x21U, 0x00U, 0x0CU, 0x98U, 0x31U, 0x00U, 0x02U, 0x04U, 0x5FU, 0x01U, - 0x02U, 0x04U, 0x6FU, 0x01U, 0x02U, 0x04U, 0x7FU, 0x01U, 0x02U, 0xC0U, 0x55U, 0x00U, - 0x02U, 0xC0U, 0x65U, 0x00U, 0x00U, 0x00U, 0xF4U, 0x03U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x18U, 0xB4U, 0x00U, 0x02U, 0x04U, 0x6FU, 0x01U, - 0x05U, 0x24U, 0x6FU, 0x02U, 0x00U, 0x04U, 0x04U, 0x02U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x42U, 0x72U, 0x20U, 0x00U, 0x00U, 0xF4U, 0x03U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x00U, 0xD4U, 0x03U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x92U, 0x72U, 0x20U, - 0x00U, 0x00U, 0xC4U, 0x03U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0xCAU, 0x72U, 0x20U, 0x00U, 0x00U, 0xE4U, 0x03U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x02U, 0x73U, 0x20U, 0x00U, 0x00U, 0xC4U, 0x03U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x3AU, 0x73U, 0x20U, - 0x00U, 0x00U, 0x24U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x72U, 0x73U, 0x20U, 0x00U, 0x00U, 0x04U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xAAU, 0x73U, 0x20U, 0x00U, 0x00U, 0x24U, 0x00U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xE2U, 0x73U, 0x20U, - 0x00U, 0x00U, 0x04U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x1AU, 0x74U, 0x20U, 0x00U, 0x00U, 0x24U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x52U, 0x74U, 0x20U, 0x00U, 0x00U, 0x04U, 0x00U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x8AU, 0x74U, 0x20U, - 0x00U, 0x00U, 0x14U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0xC2U, 0x74U, 0x20U, 0x00U, 0x00U, 0x04U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xFAU, 0x74U, 0x20U, 0x00U, 0x00U, 0x14U, 0x00U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x32U, 0x75U, 0x20U, - 0x00U, 0x00U, 0x04U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x6AU, 0x75U, 0x20U, 0x00U, 0x00U, 0x14U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xA2U, 0x75U, 0x20U, 0x00U, 0x00U, 0x04U, 0x00U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xDAU, 0x75U, 0x20U, - 0x00U, 0x00U, 0x14U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x12U, 0x76U, 0x20U, 0x00U, 0x00U, 0x04U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x4AU, 0x76U, 0x20U, 0x00U, 0x00U, 0x24U, 0x00U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x82U, 0x76U, 0x20U, - 0x00U, 0x00U, 0x04U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0xBAU, 0x76U, 0x20U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x15U, 0xDAU, 0x76U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0xB0U, 0x05U, 0x00U, - 0x00U, 0x00U, 0x04U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x44U, 0x00U, 0x27U, - 0x00U, 0x00U, 0xD4U, 0x03U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x02U, 0x04U, 0x4FU, 0x01U, 0x02U, 0xC0U, 0x45U, 0x00U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x8AU, 0x77U, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0xAAU, 0x77U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xCAU, 0x77U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xEAU, 0x77U, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x0AU, 0x78U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x2AU, 0x78U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x4AU, 0x78U, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x6AU, 0x78U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x8AU, 0x78U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xAAU, 0x78U, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0xCAU, 0x78U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xEAU, 0x78U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x0AU, 0x79U, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x2AU, 0x79U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x4AU, 0x79U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x6AU, 0x79U, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x8AU, 0x79U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xAAU, 0x79U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xCAU, 0x79U, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0xEAU, 0x79U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x0AU, 0x7AU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x2AU, 0x7AU, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x4AU, 0x7AU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x6AU, 0x7AU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x8AU, 0x7AU, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0xAAU, 0x7AU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xCAU, 0x7AU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xEAU, 0x7AU, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x0AU, 0x7BU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x2AU, 0x7BU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x4AU, 0x7BU, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x6AU, 0x7BU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x8AU, 0x7BU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xAAU, 0x7BU, 0x20U, - 0x00U, 0x00U, 0xF4U, 0x03U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x02U, 0x80U, 0x45U, 0x00U, 0x00U, 0x00U, 0x0EU, 0x04U, 0x00U, 0x04U, 0x1CU, 0x01U, - 0x00U, 0x08U, 0x06U, 0x06U, 0x0CU, 0x14U, 0x10U, 0x00U, 0x0CU, 0x54U, 0x21U, 0x00U, - 0x00U, 0x00U, 0x04U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x02U, 0x40U, 0x05U, 0x00U, - 0x00U, 0x00U, 0x04U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x24U, 0x0FU, 0x02U, - 0x02U, 0xC0U, 0x45U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x15U, 0x4AU, 0x7CU, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x00U, 0x1CU, 0xF4U, 0x0FU, 0x05U, 0x10U, 0x70U, 0x32U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, - 0x10U, 0x04U, 0x18U, 0x05U, 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0xC7U, 0x04U, - 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x04U, 0x1CU, 0x20U, 0x32U, 0x04U, 0x4CU, 0x20U, 0x32U, - 0x04U, 0x90U, 0x20U, 0x32U, 0x04U, 0xD4U, 0x20U, 0x32U, 0x02U, 0x04U, 0x7CU, 0x01U, - 0x02U, 0x04U, 0x3CU, 0x01U, 0x02U, 0x04U, 0x4CU, 0x01U, 0x02U, 0x04U, 0x5CU, 0x01U, - 0x04U, 0x1CU, 0x21U, 0x32U, 0x04U, 0x4CU, 0x21U, 0x32U, 0x04U, 0x90U, 0x21U, 0x32U, - 0x04U, 0xD4U, 0x21U, 0x32U, 0x02U, 0x04U, 0x7CU, 0x01U, 0x02U, 0x04U, 0x3CU, 0x01U, - 0x02U, 0x04U, 0x4CU, 0x01U, 0x02U, 0x04U, 0x5CU, 0x01U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xA2U, 0x7DU, 0x20U -}; -#elif (SMARTDMA_DISPLAY_FIRMWARE_SELECT == SMARTDMA_DISPLAY_FLEXIO_ONLY) -const uint8_t s_smartdmaDisplayFirmware[] = { - 0x28U, 0x00U, 0x10U, 0x24U, 0x08U, 0x01U, 0x10U, 0x24U, 0x90U, 0x02U, 0x10U, 0x24U, 0xCCU, 0x01U, 0x10U, 0x24U, - 0x30U, 0x03U, 0x10U, 0x24U, 0x80U, 0x08U, 0x10U, 0x24U, 0x94U, 0x0AU, 0x10U, 0x24U, 0x08U, 0x0DU, 0x10U, 0x24U, - 0x80U, 0x0FU, 0x10U, 0x24U, 0x34U, 0x12U, 0x10U, 0x24U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0xB0U, 0x05U, 0x02U, 0x10U, 0x04U, 0x14U, 0x05U, 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0xC7U, 0x08U, - 0x1AU, 0x80U, 0x10U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x05U, 0x00U, 0x22U, 0x32U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x05U, 0x04U, 0x22U, 0x32U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x05U, 0x08U, 0x22U, 0x32U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x05U, 0x0CU, 0x22U, 0x32U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x05U, 0x10U, 0x22U, 0x32U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x05U, 0x14U, 0x22U, 0x32U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x05U, 0x18U, 0x22U, 0x32U, - 0x11U, 0x08U, 0x38U, 0x00U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x10U, 0x08U, 0x2CU, 0x10U, 0x05U, 0x1CU, 0x22U, 0x32U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xD2U, 0x01U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0xB0U, 0x05U, 0x02U, 0x10U, 0x04U, 0x14U, 0x05U, 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0x07U, 0x07U, - 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x06U, 0x00U, 0xC4U, 0x01U, 0x01U, 0x08U, 0x1CU, 0xFFU, 0x01U, 0x0CU, 0x1CU, 0xFFU, 0x01U, 0x10U, 0x1CU, 0xFFU, - 0x01U, 0x14U, 0x1CU, 0xFFU, 0x11U, 0x08U, 0x20U, 0x00U, 0x05U, 0x00U, 0x22U, 0x32U, 0x11U, 0x0CU, 0x30U, 0x00U, - 0x05U, 0x04U, 0x32U, 0x32U, 0x11U, 0x10U, 0x40U, 0x00U, 0x05U, 0x08U, 0x42U, 0x32U, 0x11U, 0x14U, 0x50U, 0x00U, - 0x05U, 0x0CU, 0x52U, 0x32U, 0x01U, 0x08U, 0x1CU, 0xFFU, 0x01U, 0x0CU, 0x1CU, 0xFFU, 0x01U, 0x10U, 0x1CU, 0xFFU, - 0x01U, 0x14U, 0x1CU, 0x08U, 0x11U, 0x08U, 0x20U, 0x00U, 0x05U, 0x10U, 0x22U, 0x32U, 0x11U, 0x0CU, 0x30U, 0x00U, - 0x05U, 0x14U, 0x32U, 0x32U, 0x11U, 0x10U, 0x40U, 0x00U, 0x05U, 0x18U, 0x42U, 0x32U, 0x11U, 0x14U, 0x50U, 0x00U, - 0x05U, 0x1CU, 0x52U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, - 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x5AU, 0x03U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, - 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, 0x06U, 0x18U, 0x10U, 0x00U, 0x10U, 0x04U, 0x14U, 0x05U, - 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0xC7U, 0x06U, 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x01U, 0x88U, 0x15U, 0xFFU, 0x01U, 0x8CU, 0x15U, 0xFFU, - 0x01U, 0x90U, 0x15U, 0xFFU, 0x01U, 0x94U, 0x15U, 0xFFU, 0x11U, 0x08U, 0x20U, 0x00U, 0x05U, 0x00U, 0x22U, 0x32U, - 0x11U, 0x0CU, 0x30U, 0x00U, 0x05U, 0x04U, 0x32U, 0x32U, 0x11U, 0x10U, 0x40U, 0x00U, 0x05U, 0x08U, 0x42U, 0x32U, - 0x11U, 0x14U, 0x50U, 0x00U, 0x05U, 0x0CU, 0x52U, 0x32U, 0x01U, 0x88U, 0x15U, 0xFFU, 0x01U, 0x8CU, 0x15U, 0xFFU, - 0x01U, 0x90U, 0x15U, 0xFFU, 0x01U, 0x94U, 0x15U, 0xFFU, 0x11U, 0x08U, 0x20U, 0x00U, 0x05U, 0x10U, 0x22U, 0x32U, - 0x11U, 0x0CU, 0x30U, 0x00U, 0x05U, 0x14U, 0x32U, 0x32U, 0x11U, 0x10U, 0x40U, 0x00U, 0x05U, 0x18U, 0x42U, 0x32U, - 0x11U, 0x14U, 0x50U, 0x00U, 0x05U, 0x1CU, 0x52U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xE2U, 0x04U, 0x20U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, 0x10U, 0x04U, 0x14U, 0x05U, - 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0xC7U, 0x04U, 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x05U, 0x00U, 0x22U, 0x32U, 0x05U, 0x04U, 0x32U, 0x32U, - 0x05U, 0x08U, 0x42U, 0x32U, 0x05U, 0x0CU, 0x52U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x05U, 0x10U, 0x22U, 0x32U, 0x05U, 0x14U, 0x32U, 0x32U, - 0x05U, 0x18U, 0x42U, 0x32U, 0x05U, 0x1CU, 0x52U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x22U, 0x06U, 0x20U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x10U, 0x18U, 0x68U, 0x02U, 0x10U, 0x18U, 0x60U, 0x02U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0xB0U, 0x05U, 0x02U, 0x10U, 0x04U, 0x14U, 0x06U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, - 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, - 0x05U, 0x00U, 0x32U, 0x32U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, - 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, - 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, 0x05U, 0x04U, 0x32U, 0x32U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, - 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, - 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, 0x05U, 0x08U, 0x32U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, - 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, - 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x05U, 0x0CU, 0x32U, 0x32U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x05U, 0x10U, 0x32U, 0x32U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, - 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, - 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x05U, 0x14U, 0x32U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, - 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x05U, 0x18U, 0x32U, 0x32U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, - 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, - 0x05U, 0x1CU, 0x32U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x00U, 0x10U, 0x86U, 0x0FU, - 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, - 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, - 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, 0x05U, 0x00U, 0x32U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, - 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, - 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x05U, 0x04U, 0x32U, 0x32U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x05U, 0x08U, 0x32U, 0x32U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, - 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, - 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x05U, 0x0CU, 0x32U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, - 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x05U, 0x10U, 0x32U, 0x32U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, - 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, - 0x05U, 0x14U, 0x32U, 0x32U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, - 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, - 0x05U, 0x18U, 0x32U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, - 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, - 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, - 0x10U, 0xCCU, 0x70U, 0x4BU, 0x05U, 0x1CU, 0x32U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, - 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, - 0x10U, 0xCCU, 0x70U, 0x55U, 0x05U, 0x00U, 0x32U, 0x32U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, - 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, - 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, - 0x10U, 0xCCU, 0x78U, 0x40U, 0x05U, 0x04U, 0x32U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, - 0x00U, 0x14U, 0xE4U, 0x07U, 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, - 0x10U, 0x94U, 0x50U, 0x24U, 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, - 0x10U, 0x9CU, 0x70U, 0x30U, 0x10U, 0xCCU, 0x70U, 0x4BU, 0x05U, 0x08U, 0x32U, 0x32U, 0x00U, 0x10U, 0xE4U, 0x07U, - 0x00U, 0x14U, 0x84U, 0x0FU, 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, - 0x10U, 0x0CU, 0x48U, 0x13U, 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, - 0x0DU, 0x98U, 0x60U, 0x00U, 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, - 0x05U, 0x0CU, 0x32U, 0x32U, 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, - 0x00U, 0x1CU, 0x84U, 0x0FU, 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, - 0x10U, 0x98U, 0x60U, 0x34U, 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, - 0x05U, 0x10U, 0x32U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x00U, 0x10U, 0xF4U, 0x01U, 0x00U, 0x14U, 0xE4U, 0x07U, - 0x00U, 0x18U, 0x84U, 0x0FU, 0x00U, 0x1CU, 0xF4U, 0x01U, 0x0DU, 0x8CU, 0x40U, 0x03U, 0x10U, 0x94U, 0x50U, 0x24U, - 0x10U, 0xCCU, 0x50U, 0x45U, 0x10U, 0x98U, 0x60U, 0x28U, 0x10U, 0xCCU, 0x60U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x30U, - 0x10U, 0xCCU, 0x70U, 0x4BU, 0x05U, 0x14U, 0x32U, 0x32U, 0x00U, 0x10U, 0xE4U, 0x07U, 0x00U, 0x14U, 0x84U, 0x0FU, - 0x00U, 0x18U, 0xF4U, 0x01U, 0x00U, 0x1CU, 0xE4U, 0x07U, 0x10U, 0x90U, 0x40U, 0x34U, 0x10U, 0x0CU, 0x48U, 0x13U, - 0x10U, 0x94U, 0x50U, 0x38U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x10U, 0xCCU, 0x58U, 0x50U, 0x0DU, 0x98U, 0x60U, 0x00U, - 0x10U, 0xCCU, 0x60U, 0x53U, 0x10U, 0x9CU, 0x70U, 0x24U, 0x10U, 0xCCU, 0x70U, 0x55U, 0x05U, 0x18U, 0x32U, 0x32U, - 0x00U, 0x10U, 0x86U, 0x0FU, 0x00U, 0x14U, 0xF4U, 0x01U, 0x00U, 0x18U, 0xE4U, 0x07U, 0x00U, 0x1CU, 0x84U, 0x0FU, - 0x0DU, 0x8CU, 0x40U, 0x48U, 0x10U, 0x94U, 0x50U, 0x30U, 0x10U, 0xCCU, 0x58U, 0x45U, 0x10U, 0x98U, 0x60U, 0x34U, - 0x10U, 0xCCU, 0x68U, 0x43U, 0x10U, 0x9CU, 0x70U, 0x38U, 0x10U, 0xCCU, 0x78U, 0x40U, 0x05U, 0x1CU, 0x32U, 0x32U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xB2U, 0x06U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xC2U, 0x10U, 0x20U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, 0x10U, 0x04U, 0x14U, 0x07U, - 0x00U, 0x18U, 0xFEU, 0x8FU, 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0xC7U, 0x1BU, 0x1AU, 0x80U, 0x10U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x00U, 0x22U, 0x32U, 0x05U, 0x04U, 0x32U, 0x32U, 0x05U, 0x08U, 0x42U, 0x32U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x0CU, 0x22U, 0x32U, 0x05U, 0x10U, 0x32U, 0x32U, - 0x05U, 0x14U, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x18U, 0x22U, 0x32U, - 0x05U, 0x1CU, 0x32U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x00U, 0x42U, 0x32U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x04U, 0x22U, 0x32U, 0x05U, 0x08U, 0x32U, 0x32U, - 0x05U, 0x0CU, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x10U, 0x22U, 0x32U, - 0x05U, 0x14U, 0x32U, 0x32U, 0x05U, 0x18U, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, - 0x05U, 0x1CU, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x00U, 0x32U, 0x32U, - 0x05U, 0x04U, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x08U, 0x22U, 0x32U, - 0x05U, 0x0CU, 0x32U, 0x32U, 0x05U, 0x10U, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x0DU, 0x88U, 0x60U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x10U, 0x10U, 0x51U, 0x48U, - 0x05U, 0x14U, 0x22U, 0x32U, 0x05U, 0x18U, 0x32U, 0x32U, 0x05U, 0x1CU, 0x42U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x15U, 0xEAU, 0x14U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, - 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, - 0x10U, 0x04U, 0x14U, 0x07U, 0x00U, 0x18U, 0xFEU, 0x8FU, 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0xC7U, 0x21U, - 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x00U, 0x22U, 0x32U, 0x05U, 0x04U, 0x32U, 0x32U, 0x05U, 0x08U, 0x42U, 0x32U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x0CU, 0x22U, 0x32U, 0x05U, 0x10U, 0x32U, 0x32U, 0x05U, 0x14U, 0x42U, 0x32U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x18U, 0x22U, 0x32U, 0x05U, 0x1CU, 0x32U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x00U, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x04U, 0x22U, 0x32U, - 0x05U, 0x08U, 0x32U, 0x32U, 0x05U, 0x0CU, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x10U, 0x22U, 0x32U, - 0x05U, 0x14U, 0x32U, 0x32U, 0x05U, 0x18U, 0x42U, 0x32U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x1CU, 0x22U, 0x32U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x00U, 0x32U, 0x32U, 0x05U, 0x04U, 0x42U, 0x32U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x08U, 0x22U, 0x32U, 0x05U, 0x0CU, 0x32U, 0x32U, 0x05U, 0x10U, 0x42U, 0x32U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x11U, 0x88U, 0x21U, 0x20U, 0x11U, 0x0CU, 0x30U, 0x00U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x00U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x00U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x14U, 0x22U, 0x32U, 0x05U, 0x18U, 0x32U, 0x32U, 0x05U, 0x1CU, 0x42U, 0x32U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xD2U, 0x19U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0xB0U, 0x05U, 0x02U, 0x00U, 0x18U, 0xFEU, 0x8FU, 0x06U, 0x00U, 0x10U, 0x00U, 0x10U, 0x04U, 0x14U, 0x07U, - 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0xC7U, 0x21U, 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x00U, 0x22U, 0x32U, - 0x05U, 0x04U, 0x32U, 0x32U, 0x05U, 0x08U, 0x42U, 0x32U, 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x0CU, 0x22U, 0x32U, - 0x05U, 0x10U, 0x32U, 0x32U, 0x05U, 0x14U, 0x42U, 0x32U, 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x18U, 0x22U, 0x32U, - 0x05U, 0x1CU, 0x32U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x00U, 0x42U, 0x32U, - 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, - 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x04U, 0x22U, 0x32U, 0x05U, 0x08U, 0x32U, 0x32U, 0x05U, 0x0CU, 0x42U, 0x32U, - 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, - 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x10U, 0x22U, 0x32U, 0x05U, 0x14U, 0x32U, 0x32U, 0x05U, 0x18U, 0x42U, 0x32U, - 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, - 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, - 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x1CU, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x00U, 0x32U, 0x32U, 0x05U, 0x04U, 0x42U, 0x32U, 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x08U, 0x22U, 0x32U, - 0x05U, 0x0CU, 0x32U, 0x32U, 0x05U, 0x10U, 0x42U, 0x32U, 0x01U, 0x08U, 0x14U, 0xFFU, 0x01U, 0x0CU, 0x14U, 0xFFU, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x11U, 0x88U, 0x21U, 0x28U, 0x11U, 0x0CU, 0x30U, 0x08U, - 0x10U, 0x88U, 0x30U, 0x58U, 0x0DU, 0xCCU, 0x60U, 0x48U, 0x11U, 0x10U, 0x40U, 0x08U, 0x10U, 0xCCU, 0x40U, 0x50U, - 0x0DU, 0x10U, 0x61U, 0x50U, 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x10U, 0x51U, 0x48U, 0x05U, 0x14U, 0x22U, 0x32U, - 0x05U, 0x18U, 0x32U, 0x32U, 0x05U, 0x1CU, 0x42U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xC2U, 0x1EU, 0x20U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0x8CU, 0x05U, 0x02U, 0x01U, 0xB0U, 0x05U, 0x03U, - 0x10U, 0x04U, 0x14U, 0x02U, 0x0DU, 0x50U, 0x14U, 0x00U, 0x10U, 0x04U, 0x14U, 0x01U, 0x08U, 0x44U, 0x14U, 0x00U, - 0x00U, 0xCEU, 0x00U, 0x00U, 0x35U, 0xEAU, 0x1FU, 0x20U, 0x08U, 0xCEU, 0x14U, 0x00U, 0x35U, 0x72U, 0x20U, 0x20U, - 0x08U, 0xCEU, 0x14U, 0x00U, 0x35U, 0xFAU, 0x20U, 0x20U, 0x08U, 0xCEU, 0x14U, 0x00U, 0x35U, 0x82U, 0x21U, 0x20U, - 0x08U, 0xCEU, 0x14U, 0x00U, 0x35U, 0x0AU, 0x22U, 0x20U, 0x08U, 0xCEU, 0x14U, 0x00U, 0x35U, 0x92U, 0x22U, 0x20U, - 0x08U, 0xCEU, 0x14U, 0x00U, 0x35U, 0x1AU, 0x23U, 0x20U, 0x08U, 0xCEU, 0x14U, 0x00U, 0x35U, 0xA2U, 0x23U, 0x20U, - 0x15U, 0x2AU, 0x24U, 0x20U, 0x06U, 0x48U, 0x47U, 0x02U, 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x00U, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x00U, 0x32U, 0x32U, - 0x00U, 0x12U, 0x01U, 0x00U, 0x41U, 0x08U, 0x1CU, 0x01U, 0x5CU, 0xB4U, 0x00U, 0x00U, 0x45U, 0x00U, 0x22U, 0x32U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x2AU, 0x24U, 0x20U, 0x06U, 0x48U, 0x47U, 0x02U, 0x1AU, 0x80U, 0x10U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x04U, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x04U, 0x32U, 0x32U, 0x00U, 0x12U, 0x01U, 0x00U, 0x41U, 0x08U, 0x1CU, 0x01U, 0x5CU, 0xB4U, 0x00U, 0x00U, - 0x45U, 0x04U, 0x22U, 0x32U, 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x2AU, 0x24U, 0x20U, 0x06U, 0x48U, 0x47U, 0x02U, - 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x08U, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x08U, 0x32U, 0x32U, 0x00U, 0x12U, 0x01U, 0x00U, 0x41U, 0x08U, 0x1CU, 0x01U, - 0x5CU, 0xB4U, 0x00U, 0x00U, 0x45U, 0x08U, 0x22U, 0x32U, 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x2AU, 0x24U, 0x20U, - 0x06U, 0x48U, 0x47U, 0x02U, 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x0CU, 0x22U, 0x32U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x0CU, 0x32U, 0x32U, 0x00U, 0x12U, 0x01U, 0x00U, - 0x41U, 0x08U, 0x1CU, 0x01U, 0x5CU, 0xB4U, 0x00U, 0x00U, 0x45U, 0x0CU, 0x22U, 0x32U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x15U, 0x2AU, 0x24U, 0x20U, 0x06U, 0x48U, 0x47U, 0x02U, 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x10U, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x10U, 0x32U, 0x32U, - 0x00U, 0x12U, 0x01U, 0x00U, 0x41U, 0x08U, 0x1CU, 0x01U, 0x5CU, 0xB4U, 0x00U, 0x00U, 0x45U, 0x10U, 0x22U, 0x32U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x2AU, 0x24U, 0x20U, 0x06U, 0x48U, 0x47U, 0x02U, 0x1AU, 0x80U, 0x10U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x14U, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x14U, 0x32U, 0x32U, 0x00U, 0x12U, 0x01U, 0x00U, 0x41U, 0x08U, 0x1CU, 0x01U, 0x5CU, 0xB4U, 0x00U, 0x00U, - 0x45U, 0x14U, 0x22U, 0x32U, 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x2AU, 0x24U, 0x20U, 0x06U, 0x48U, 0x47U, 0x02U, - 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x01U, 0x08U, 0x1CU, 0x01U, 0x01U, 0x0CU, 0x1CU, 0x01U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x18U, 0x22U, 0x32U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x18U, 0x32U, 0x32U, 0x00U, 0x12U, 0x01U, 0x00U, 0x41U, 0x08U, 0x1CU, 0x01U, - 0x5CU, 0xB4U, 0x00U, 0x00U, 0x45U, 0x18U, 0x22U, 0x32U, 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x2AU, 0x24U, 0x20U, - 0x06U, 0x48U, 0x47U, 0x02U, 0x1AU, 0x80U, 0x10U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x01U, 0x08U, 0x1CU, 0x01U, - 0x01U, 0x0CU, 0x1CU, 0x01U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x1CU, 0x22U, 0x32U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x1CU, 0x32U, 0x32U, 0x00U, 0x12U, 0x01U, 0x00U, - 0x41U, 0x08U, 0x1CU, 0x01U, 0x5CU, 0xB4U, 0x00U, 0x00U, 0x45U, 0x1CU, 0x22U, 0x32U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x15U, 0x2AU, 0x24U, 0x20U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x15U, 0x2AU, 0x24U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, - 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x00U, 0x1CU, 0xF4U, 0x0FU, 0x05U, 0x10U, 0x70U, 0x32U, - 0x10U, 0x04U, 0x18U, 0x05U, 0x08U, 0x44U, 0x14U, 0x00U, 0x06U, 0x48U, 0xC7U, 0x04U, 0x1AU, 0x80U, 0x10U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x04U, 0x1CU, 0x20U, 0x32U, - 0x04U, 0x4CU, 0x20U, 0x32U, 0x04U, 0x90U, 0x20U, 0x32U, 0x04U, 0xD4U, 0x20U, 0x32U, 0x02U, 0x04U, 0x7CU, 0x01U, - 0x02U, 0x04U, 0x3CU, 0x01U, 0x02U, 0x04U, 0x4CU, 0x01U, 0x02U, 0x04U, 0x5CU, 0x01U, 0x04U, 0x1CU, 0x21U, 0x32U, - 0x04U, 0x4CU, 0x21U, 0x32U, 0x04U, 0x90U, 0x21U, 0x32U, 0x04U, 0xD4U, 0x21U, 0x32U, 0x02U, 0x04U, 0x7CU, 0x01U, - 0x02U, 0x04U, 0x3CU, 0x01U, 0x02U, 0x04U, 0x4CU, 0x01U, 0x02U, 0x04U, 0x5CU, 0x01U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x82U, 0x25U, 0x20U}; -#elif (SMARTDMA_DISPLAY_FIRMWARE_SELECT == SMARTDMA_DISPLAY_MIPI_ONLY) -const uint8_t s_smartdmaDisplayFirmware[] = { - 0x34U, 0x00U, 0x10U, 0x24U, 0x44U, 0x0EU, 0x10U, 0x24U, 0xA0U, 0x01U, 0x10U, 0x24U, - 0x64U, 0x10U, 0x10U, 0x24U, 0x64U, 0x04U, 0x10U, 0x24U, 0x14U, 0x14U, 0x10U, 0x24U, - 0x30U, 0x07U, 0x10U, 0x24U, 0xA0U, 0x08U, 0x10U, 0x24U, 0x70U, 0x0BU, 0x10U, 0x24U, - 0x74U, 0x17U, 0x10U, 0x24U, 0x00U, 0x1CU, 0x10U, 0x24U, 0x08U, 0x21U, 0x10U, 0x24U, - 0x24U, 0x24U, 0x10U, 0x24U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, - 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, 0x01U, 0x9CU, 0x05U, 0x03U, - 0x00U, 0x0CU, 0xC4U, 0x02U, 0x00U, 0xDEU, 0x01U, 0x00U, 0x35U, 0xCAU, 0x00U, 0x20U, - 0x15U, 0xF2U, 0x01U, 0x20U, 0x08U, 0x4AU, 0xC4U, 0x0FU, 0x60U, 0x08U, 0xC4U, 0x0FU, - 0x80U, 0x48U, 0x00U, 0x00U, 0x06U, 0x98U, 0x34U, 0x00U, 0x10U, 0x18U, 0x68U, 0x02U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0xF2U, 0x00U, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x11U, 0x10U, 0x48U, 0x00U, 0x10U, 0x10U, 0x4CU, 0x10U, - 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x0CU, 0x48U, 0x18U, - 0x08U, 0x9AU, 0x15U, 0x00U, 0x55U, 0xF2U, 0x00U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x4AU, 0x01U, 0x20U, 0x0DU, 0x9AU, 0x34U, 0x00U, - 0x25U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x21U, 0x00U, - 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, - 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, - 0x08U, 0x46U, 0x20U, 0x00U, 0xB5U, 0xCAU, 0x00U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x02U, 0x03U, 0x20U, 0x08U, 0x4AU, 0xC4U, 0x0FU, - 0x60U, 0x08U, 0xC4U, 0x0FU, 0x80U, 0x48U, 0x00U, 0x00U, 0x06U, 0x98U, 0x34U, 0x00U, - 0x10U, 0x18U, 0x68U, 0x02U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0x1AU, 0x02U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x10U, 0xDCU, 0x40U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x0CU, 0x48U, 0x18U, 0x08U, 0x9AU, 0x15U, 0x00U, - 0x55U, 0x1AU, 0x02U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0x62U, 0x02U, 0x20U, 0x0DU, 0x9AU, 0x34U, 0x00U, 0x25U, 0x80U, 0x32U, 0x31U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, - 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, - 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, 0x08U, 0x46U, 0x20U, 0x00U, - 0xB5U, 0xF2U, 0x01U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x02U, 0x03U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, - 0x01U, 0x9CU, 0x05U, 0x03U, 0x00U, 0x0CU, 0xC4U, 0x02U, 0x00U, 0xDEU, 0x01U, 0x00U, - 0x35U, 0xA2U, 0x03U, 0x20U, 0x15U, 0x5AU, 0x06U, 0x20U, 0x08U, 0x4AU, 0xC4U, 0x0FU, - 0x60U, 0x08U, 0xC4U, 0x0FU, 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0xC2U, 0x04U, 0x20U, - 0x00U, 0x24U, 0x54U, 0x01U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0xCAU, 0x03U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x01U, 0x18U, 0x1CU, 0x01U, 0x11U, 0x1CU, 0x40U, 0x08U, 0x10U, 0xDCU, 0x70U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x10U, 0x48U, 0x18U, 0x0DU, 0x8CU, 0xF5U, 0x0FU, - 0x10U, 0x0CU, 0x31U, 0x48U, 0x11U, 0x10U, 0x50U, 0x10U, 0x10U, 0x1CU, 0x31U, 0x50U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x14U, 0x50U, 0x10U, - 0x11U, 0x1CU, 0x60U, 0x00U, 0x10U, 0x1CU, 0x70U, 0x10U, 0x10U, 0xDCU, 0x59U, 0x50U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xF6U, 0x0FU, 0x0DU, 0xCCU, 0x60U, 0x48U, - 0x08U, 0x66U, 0x16U, 0x00U, 0x55U, 0xCAU, 0x03U, 0x20U, 0x08U, 0x46U, 0x20U, 0x00U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x9AU, 0x04U, 0x20U, - 0x05U, 0x80U, 0x32U, 0x31U, 0x15U, 0xDAU, 0x05U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0xC2U, 0x04U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x01U, 0x18U, 0x1CU, 0x01U, 0x11U, 0x1CU, 0x40U, 0x08U, - 0x10U, 0xDCU, 0x70U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, - 0x35U, 0xDAU, 0x05U, 0x20U, 0x10U, 0x10U, 0x48U, 0x18U, 0x0DU, 0x8CU, 0xF5U, 0x0FU, - 0x10U, 0x0CU, 0x31U, 0x48U, 0x11U, 0x10U, 0x50U, 0x10U, 0x10U, 0x1CU, 0x31U, 0x50U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, 0x35U, 0xDAU, 0x05U, 0x20U, - 0x11U, 0x14U, 0x50U, 0x00U, 0x10U, 0x14U, 0x50U, 0x10U, 0x11U, 0x1CU, 0x60U, 0x00U, - 0x10U, 0x1CU, 0x70U, 0x10U, 0x10U, 0xDCU, 0x59U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x34U, 0x00U, 0x35U, 0xDAU, 0x05U, 0x20U, 0x00U, 0x0CU, 0xF6U, 0x0FU, - 0x0DU, 0xCCU, 0x60U, 0x48U, 0x08U, 0x46U, 0x34U, 0x00U, 0xB5U, 0xC2U, 0x04U, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0xBAU, 0x05U, 0x20U, - 0x05U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x21U, 0x00U, - 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, - 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, - 0x00U, 0x46U, 0x00U, 0x00U, 0xB5U, 0xA2U, 0x03U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x8AU, 0x08U, 0x20U, 0x08U, 0x4AU, 0xC4U, 0x0FU, - 0x60U, 0x08U, 0xC4U, 0x0FU, 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0x3AU, 0x07U, 0x20U, - 0x00U, 0x24U, 0x54U, 0x01U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0x82U, 0x06U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x01U, 0x18U, 0x1CU, 0x01U, 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x10U, 0x10U, 0x48U, 0x18U, 0x10U, 0x1CU, 0x51U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x10U, 0x14U, 0x58U, 0x18U, 0x10U, 0x5CU, 0x61U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x10U, 0x0CU, 0x68U, 0x18U, 0x08U, 0x66U, 0x16U, 0x00U, 0x55U, 0x82U, 0x06U, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x0AU, 0x07U, 0x20U, - 0x08U, 0x46U, 0x20U, 0x00U, 0x05U, 0x80U, 0x32U, 0x31U, 0x15U, 0x12U, 0x08U, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x3AU, 0x07U, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x01U, 0x18U, 0x1CU, 0x01U, - 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, - 0x35U, 0x12U, 0x08U, 0x20U, 0x10U, 0x10U, 0x48U, 0x18U, 0x10U, 0x1CU, 0x51U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, 0x35U, 0x12U, 0x08U, 0x20U, - 0x10U, 0x14U, 0x58U, 0x18U, 0x10U, 0x5CU, 0x61U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x34U, 0x00U, 0x35U, 0x12U, 0x08U, 0x20U, 0x10U, 0x0CU, 0x68U, 0x18U, - 0x08U, 0x46U, 0x34U, 0x00U, 0xB5U, 0x3AU, 0x07U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0xF2U, 0x07U, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, - 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, - 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, 0x00U, 0x46U, 0x00U, 0x00U, - 0xB5U, 0x5AU, 0x06U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x8AU, 0x08U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, - 0x01U, 0x9CU, 0x05U, 0x03U, 0x00U, 0x0CU, 0xC4U, 0x02U, 0x00U, 0x24U, 0xF4U, 0x0FU, - 0x00U, 0xDEU, 0x01U, 0x00U, 0x35U, 0x32U, 0x09U, 0x20U, 0x15U, 0xB2U, 0x0BU, 0x20U, - 0x08U, 0x4AU, 0x04U, 0x15U, 0x60U, 0x08U, 0x04U, 0x15U, 0x80U, 0x48U, 0x00U, 0x00U, - 0x95U, 0x32U, 0x0AU, 0x20U, 0x00U, 0x20U, 0x54U, 0x01U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x5AU, 0x09U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x01U, 0x18U, 0x1CU, 0x01U, 0x11U, 0x1CU, 0x40U, 0x08U, - 0x10U, 0xDCU, 0x70U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x9CU, 0x91U, 0x30U, 0x10U, 0x5CU, 0x71U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x11U, 0x18U, 0x60U, 0x10U, 0x11U, 0x1CU, 0x40U, 0x08U, - 0x10U, 0x9CU, 0x71U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, 0x0DU, 0x4CU, 0x42U, 0x00U, - 0x08U, 0x22U, 0x16U, 0x00U, 0x55U, 0x5AU, 0x09U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x02U, 0x0AU, 0x20U, 0x08U, 0x46U, 0x20U, 0x00U, - 0x05U, 0x80U, 0x32U, 0x31U, 0x15U, 0x2AU, 0x0BU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x32U, 0x0AU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x01U, 0x14U, 0x1CU, 0x01U, 0x01U, 0x18U, 0x1CU, 0x01U, 0x11U, 0x1CU, 0x40U, 0x08U, - 0x10U, 0xDCU, 0x70U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x35U, 0x2AU, 0x0BU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x11U, 0x14U, 0x50U, 0x08U, - 0x10U, 0x9CU, 0x91U, 0x30U, 0x10U, 0x5CU, 0x71U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x44U, 0x00U, 0x35U, 0x2AU, 0x0BU, 0x20U, 0x11U, 0x18U, 0x60U, 0x10U, - 0x11U, 0x1CU, 0x40U, 0x08U, 0x10U, 0x9CU, 0x71U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x44U, 0x00U, 0x35U, 0x2AU, 0x0BU, 0x20U, 0x0DU, 0x4CU, 0x42U, 0x00U, - 0x08U, 0x46U, 0x44U, 0x00U, 0xB5U, 0x32U, 0x0AU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x0AU, 0x0BU, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x10U, 0x0CU, 0x28U, 0x02U, 0x08U, 0x88U, 0x30U, 0x00U, - 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, - 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, - 0x00U, 0x0CU, 0xC4U, 0x03U, 0xB5U, 0x32U, 0x09U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x22U, 0x0EU, 0x20U, 0x08U, 0x4AU, 0x04U, 0x15U, - 0x60U, 0x08U, 0x04U, 0x15U, 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0xAAU, 0x0CU, 0x20U, - 0x00U, 0x20U, 0x54U, 0x01U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0xDAU, 0x0BU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, - 0x01U, 0x18U, 0x1CU, 0x01U, 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x10U, 0x14U, 0x50U, 0x08U, 0x10U, 0x14U, 0x58U, 0x08U, - 0x10U, 0x5CU, 0x61U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x18U, 0x60U, 0x08U, - 0x10U, 0x18U, 0x68U, 0x10U, 0x10U, 0x9CU, 0x41U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x10U, 0x4CU, 0x4AU, 0x30U, 0x08U, 0x22U, 0x16U, 0x00U, 0x55U, 0xDAU, 0x0BU, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x7AU, 0x0CU, 0x20U, - 0x08U, 0x46U, 0x20U, 0x00U, 0x05U, 0x80U, 0x32U, 0x31U, 0x15U, 0x9AU, 0x0DU, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0xAAU, 0x0CU, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x14U, 0x1CU, 0x01U, 0x01U, 0x18U, 0x1CU, 0x01U, - 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x35U, 0x9AU, 0x0DU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x10U, 0x14U, 0x50U, 0x08U, - 0x10U, 0x14U, 0x58U, 0x08U, 0x10U, 0x5CU, 0x61U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x44U, 0x00U, 0x35U, 0x9AU, 0x0DU, 0x20U, 0x10U, 0x18U, 0x60U, 0x08U, - 0x10U, 0x18U, 0x68U, 0x10U, 0x10U, 0x9CU, 0x41U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x44U, 0x00U, 0x35U, 0x9AU, 0x0DU, 0x20U, 0x10U, 0x4CU, 0x4AU, 0x30U, - 0x08U, 0x46U, 0x44U, 0x00U, 0xB5U, 0xAAU, 0x0CU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x7AU, 0x0DU, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x10U, 0x0CU, 0x28U, 0x02U, 0x08U, 0x88U, 0x30U, 0x00U, - 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, - 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, - 0x00U, 0x0CU, 0xC4U, 0x03U, 0x00U, 0x46U, 0x00U, 0x00U, 0xB5U, 0xB2U, 0x0BU, 0x20U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x15U, 0x22U, 0x0EU, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, - 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, 0x01U, 0x9CU, 0x05U, 0x03U, - 0x00U, 0x0CU, 0xC4U, 0x02U, 0x06U, 0x00U, 0x10U, 0x00U, 0x00U, 0xDEU, 0x01U, 0x00U, - 0x35U, 0xCAU, 0x0EU, 0x20U, 0x15U, 0xEAU, 0x0FU, 0x20U, 0x08U, 0x4AU, 0xC4U, 0x0FU, - 0x60U, 0x08U, 0xC4U, 0x0FU, 0x80U, 0x48U, 0x00U, 0x00U, 0x06U, 0x98U, 0x34U, 0x00U, - 0x10U, 0x18U, 0x68U, 0x02U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0xF2U, 0x0EU, 0x20U, 0x01U, 0x10U, 0x14U, 0xFFU, 0x11U, 0x10U, 0x48U, 0x00U, - 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x0CU, 0x48U, 0x18U, - 0x08U, 0x9AU, 0x15U, 0x00U, 0x55U, 0xF2U, 0x0EU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x42U, 0x0FU, 0x20U, 0x0DU, 0x9AU, 0x34U, 0x00U, - 0x25U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x21U, 0x00U, - 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, - 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, - 0x08U, 0x46U, 0x20U, 0x00U, 0xB5U, 0xCAU, 0x0EU, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x02U, 0x11U, 0x20U, 0x08U, 0x4AU, 0xC4U, 0x0FU, - 0x60U, 0x08U, 0xC4U, 0x0FU, 0x80U, 0x48U, 0x00U, 0x00U, 0x06U, 0x98U, 0x34U, 0x00U, - 0x10U, 0x18U, 0x68U, 0x02U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0x12U, 0x10U, 0x20U, 0x01U, 0x10U, 0x14U, 0xFFU, 0x10U, 0x10U, 0x4CU, 0x10U, - 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x0CU, 0x48U, 0x18U, - 0x08U, 0x9AU, 0x15U, 0x00U, 0x55U, 0x12U, 0x10U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x62U, 0x10U, 0x20U, 0x0DU, 0x9AU, 0x34U, 0x00U, - 0x25U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x21U, 0x00U, - 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, - 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, - 0x08U, 0x46U, 0x20U, 0x00U, 0xB5U, 0xEAU, 0x0FU, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, - 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x02U, 0x11U, 0x20U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, - 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0xB0U, 0x05U, 0x02U, 0x01U, 0x9CU, 0x05U, 0x03U, 0x00U, 0x0CU, 0xC4U, 0x02U, - 0x06U, 0x00U, 0x10U, 0x00U, 0x00U, 0xDEU, 0x01U, 0x00U, 0x35U, 0xAAU, 0x11U, 0x20U, - 0x15U, 0x12U, 0x14U, 0x20U, 0x08U, 0x4AU, 0xC4U, 0x0FU, 0x60U, 0x08U, 0xC4U, 0x0FU, - 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0xA2U, 0x12U, 0x20U, 0x00U, 0x24U, 0x54U, 0x01U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0xD2U, 0x11U, 0x20U, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x01U, 0x18U, 0x14U, 0xFFU, - 0x11U, 0x1CU, 0x40U, 0x00U, 0x10U, 0xDCU, 0x70U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x0DU, 0x10U, 0xF5U, 0x0FU, 0x11U, 0x1CU, 0x58U, 0x00U, 0x10U, 0x1CU, 0x71U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x0DU, 0x54U, 0xF5U, 0x0FU, 0x11U, 0x1CU, 0x68U, 0x00U, - 0x10U, 0x5CU, 0x71U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x0DU, 0x8CU, 0xF5U, 0x0FU, - 0x08U, 0x66U, 0x16U, 0x00U, 0x55U, 0xD2U, 0x11U, 0x20U, 0x08U, 0x46U, 0x20U, 0x00U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x7AU, 0x12U, 0x20U, - 0x05U, 0x80U, 0x32U, 0x31U, 0x15U, 0x92U, 0x13U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0xC2U, 0x04U, 0x20U, 0x01U, 0x10U, 0x14U, 0xFFU, - 0x01U, 0x14U, 0x14U, 0xFFU, 0x01U, 0x18U, 0x14U, 0xFFU, 0x11U, 0x1CU, 0x40U, 0x00U, - 0x10U, 0xDCU, 0x70U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, - 0x35U, 0x92U, 0x13U, 0x20U, 0x0DU, 0x10U, 0xF5U, 0x0FU, 0x11U, 0x1CU, 0x58U, 0x00U, - 0x10U, 0x1CU, 0x71U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, - 0x35U, 0x92U, 0x13U, 0x20U, 0x0DU, 0x54U, 0xF5U, 0x0FU, 0x11U, 0x1CU, 0x68U, 0x00U, - 0x10U, 0x5CU, 0x71U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, - 0x35U, 0x92U, 0x13U, 0x20U, 0x0DU, 0x8CU, 0xF5U, 0x0FU, 0x08U, 0x46U, 0x34U, 0x00U, - 0xB5U, 0xA2U, 0x12U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0x72U, 0x13U, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, - 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, - 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, - 0x00U, 0x0CU, 0xC4U, 0x03U, 0x00U, 0x46U, 0x00U, 0x00U, 0xB5U, 0xAAU, 0x11U, 0x20U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0xA2U, 0x16U, 0x20U, - 0x08U, 0x4AU, 0xC4U, 0x0FU, 0x60U, 0x08U, 0xC4U, 0x0FU, 0x80U, 0x48U, 0x00U, 0x00U, - 0x95U, 0x22U, 0x15U, 0x20U, 0x00U, 0x24U, 0x54U, 0x01U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x3AU, 0x14U, 0x20U, 0x01U, 0x10U, 0x14U, 0xFFU, - 0x01U, 0x14U, 0x14U, 0xFFU, 0x01U, 0x18U, 0x14U, 0xFFU, 0x10U, 0x1CU, 0x48U, 0x08U, - 0x10U, 0xDCU, 0x70U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x0DU, 0x10U, 0xF5U, 0x0FU, - 0x10U, 0x1CU, 0x68U, 0x18U, 0x10U, 0x1CU, 0x70U, 0x18U, 0x10U, 0xDCU, 0x59U, 0x50U, - 0x10U, 0xDCU, 0x41U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x14U, 0x50U, 0x10U, - 0x10U, 0x1CU, 0x60U, 0x10U, 0x10U, 0xDCU, 0x59U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x10U, 0x0CU, 0x68U, 0x10U, 0x0DU, 0xCCU, 0xF4U, 0x0FU, 0x08U, 0x66U, 0x16U, 0x00U, - 0x55U, 0x3AU, 0x14U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0x0AU, 0x07U, 0x20U, 0x08U, 0x46U, 0x20U, 0x00U, 0x05U, 0x80U, 0x32U, 0x31U, - 0x15U, 0x2AU, 0x16U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0x22U, 0x15U, 0x20U, 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, - 0x01U, 0x18U, 0x14U, 0xFFU, 0x10U, 0x1CU, 0x48U, 0x08U, 0x10U, 0xDCU, 0x70U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x34U, 0x00U, 0x35U, 0x2AU, 0x16U, 0x20U, - 0x0DU, 0x10U, 0xF5U, 0x0FU, 0x10U, 0x1CU, 0x68U, 0x18U, 0x10U, 0x1CU, 0x70U, 0x18U, - 0x10U, 0xDCU, 0x59U, 0x50U, 0x10U, 0xDCU, 0x41U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x34U, 0x00U, 0x35U, 0x2AU, 0x16U, 0x20U, 0x10U, 0x14U, 0x50U, 0x10U, - 0x10U, 0x1CU, 0x60U, 0x10U, 0x10U, 0xDCU, 0x59U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x34U, 0x00U, 0x35U, 0x2AU, 0x16U, 0x20U, 0x10U, 0x0CU, 0x68U, 0x10U, - 0x0DU, 0xCCU, 0xF4U, 0x0FU, 0x08U, 0x46U, 0x34U, 0x00U, 0xB5U, 0x22U, 0x15U, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x0AU, 0x16U, 0x20U, - 0x05U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x21U, 0x00U, - 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, - 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, - 0x00U, 0x46U, 0x00U, 0x00U, 0xB5U, 0x12U, 0x14U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, - 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xA2U, 0x16U, 0x20U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, - 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, - 0x01U, 0xB0U, 0x05U, 0x02U, 0x01U, 0x9CU, 0x05U, 0x03U, 0x00U, 0x0CU, 0xC4U, 0x02U, - 0x00U, 0x24U, 0xF4U, 0x0FU, 0x06U, 0x00U, 0x10U, 0x00U, 0x00U, 0xDEU, 0x01U, 0x00U, - 0x35U, 0x52U, 0x17U, 0x20U, 0x15U, 0xDAU, 0x19U, 0x20U, 0x08U, 0x4AU, 0x04U, 0x15U, - 0x60U, 0x08U, 0x04U, 0x15U, 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0x52U, 0x18U, 0x20U, - 0x00U, 0x20U, 0x54U, 0x01U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0x7AU, 0x17U, 0x20U, 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, - 0x01U, 0x18U, 0x14U, 0xFFU, 0x11U, 0x1CU, 0x40U, 0x08U, 0x10U, 0xDCU, 0x70U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x01U, 0x10U, 0x14U, 0xFFU, 0x11U, 0x14U, 0x50U, 0x08U, - 0x10U, 0x9CU, 0x91U, 0x30U, 0x10U, 0x5CU, 0x71U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x11U, 0x18U, 0x60U, 0x10U, 0x11U, 0x1CU, 0x40U, 0x08U, 0x10U, 0x9CU, 0x71U, 0x50U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x0DU, 0x4CU, 0x42U, 0x00U, 0x08U, 0x22U, 0x16U, 0x00U, - 0x55U, 0x7AU, 0x17U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0x22U, 0x18U, 0x20U, 0x08U, 0x46U, 0x20U, 0x00U, 0x05U, 0x80U, 0x32U, 0x31U, - 0x15U, 0x4AU, 0x19U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0x52U, 0x18U, 0x20U, 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, - 0x01U, 0x18U, 0x14U, 0xFFU, 0x11U, 0x1CU, 0x40U, 0x08U, 0x10U, 0xDCU, 0x70U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, 0x35U, 0x4AU, 0x19U, 0x20U, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x11U, 0x14U, 0x50U, 0x08U, 0x10U, 0x9CU, 0x91U, 0x30U, - 0x10U, 0x5CU, 0x71U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x35U, 0x4AU, 0x19U, 0x20U, 0x11U, 0x18U, 0x60U, 0x10U, 0x11U, 0x1CU, 0x40U, 0x08U, - 0x10U, 0x9CU, 0x71U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x35U, 0x4AU, 0x19U, 0x20U, 0x0DU, 0x4CU, 0x42U, 0x00U, 0x08U, 0x46U, 0x44U, 0x00U, - 0xB5U, 0x52U, 0x18U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0x2AU, 0x19U, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, - 0x10U, 0x0CU, 0x28U, 0x02U, 0x08U, 0x88U, 0x30U, 0x00U, 0x0CU, 0xDCU, 0x21U, 0x00U, - 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, - 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, - 0x00U, 0x46U, 0x00U, 0x00U, 0xB5U, 0x52U, 0x17U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x4AU, 0x1CU, 0x20U, 0x08U, 0x4AU, 0x04U, 0x15U, - 0x60U, 0x08U, 0x04U, 0x15U, 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0xD2U, 0x1AU, 0x20U, - 0x00U, 0x20U, 0x54U, 0x01U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0x02U, 0x1AU, 0x20U, 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, - 0x01U, 0x18U, 0x14U, 0xFFU, 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x10U, 0x14U, 0x50U, 0x08U, 0x10U, 0x14U, 0x58U, 0x08U, - 0x10U, 0x5CU, 0x61U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x18U, 0x60U, 0x08U, - 0x10U, 0x18U, 0x68U, 0x10U, 0x10U, 0x9CU, 0x41U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x10U, 0x4CU, 0x4AU, 0x30U, 0x08U, 0x22U, 0x16U, 0x00U, 0x55U, 0x02U, 0x1AU, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0xA2U, 0x1AU, 0x20U, - 0x08U, 0x46U, 0x20U, 0x00U, 0x05U, 0x80U, 0x32U, 0x31U, 0x15U, 0xC2U, 0x1BU, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0xD2U, 0x1AU, 0x20U, - 0x01U, 0x10U, 0x14U, 0xFFU, 0x01U, 0x14U, 0x14U, 0xFFU, 0x01U, 0x18U, 0x14U, 0xFFU, - 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x35U, 0xC2U, 0x1BU, 0x20U, 0x01U, 0x10U, 0x14U, 0xFFU, 0x10U, 0x14U, 0x50U, 0x08U, - 0x10U, 0x14U, 0x58U, 0x08U, 0x10U, 0x5CU, 0x61U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x44U, 0x00U, 0x35U, 0xC2U, 0x1BU, 0x20U, 0x10U, 0x18U, 0x60U, 0x08U, - 0x10U, 0x18U, 0x68U, 0x10U, 0x10U, 0x9CU, 0x41U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x44U, 0x00U, 0x35U, 0xC2U, 0x1BU, 0x20U, 0x10U, 0x4CU, 0x4AU, 0x30U, - 0x08U, 0x46U, 0x44U, 0x00U, 0xB5U, 0xD2U, 0x1AU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0xA2U, 0x1BU, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x10U, 0x0CU, 0x28U, 0x02U, 0x08U, 0x88U, 0x30U, 0x00U, - 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, - 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, - 0x00U, 0x0CU, 0xC4U, 0x03U, 0x00U, 0x46U, 0x00U, 0x00U, 0xB5U, 0xDAU, 0x19U, 0x20U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x15U, 0x4AU, 0x1CU, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, - 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0x88U, 0x05U, 0x02U, 0x01U, 0x8CU, 0x05U, 0x03U, - 0x01U, 0xB0U, 0x05U, 0x04U, 0x01U, 0x9CU, 0x05U, 0x05U, 0x02U, 0x00U, 0x17U, 0x00U, - 0x02U, 0x00U, 0x27U, 0x01U, 0x08U, 0xCCU, 0x14U, 0x00U, 0x00U, 0x18U, 0x04U, 0x00U, - 0x00U, 0x08U, 0xC4U, 0x02U, 0x00U, 0xDEU, 0x01U, 0x00U, 0x35U, 0x1AU, 0x1DU, 0x20U, - 0x15U, 0xD2U, 0x1EU, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x10U, 0x5CU, 0x41U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x48U, 0x08U, 0x46U, 0x24U, 0x00U, - 0x55U, 0x92U, 0x1DU, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0x92U, 0x1DU, 0x20U, 0x26U, 0x98U, 0x25U, 0x00U, 0x20U, 0xC8U, 0x01U, 0x00U, - 0x35U, 0x12U, 0x1EU, 0x20U, 0x01U, 0x08U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x08U, 0x44U, 0x24U, 0x00U, 0x10U, 0xDCU, 0x51U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, 0x75U, 0x12U, 0x1EU, 0x20U, - 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0x1AU, 0x1DU, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x1AU, 0x1DU, 0x20U, 0x05U, 0x80U, 0x22U, 0x31U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x61U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, - 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, - 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x08U, 0xC4U, 0x03U, 0x00U, 0x18U, 0x04U, 0x00U, - 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0x1AU, 0x1DU, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x1AU, 0x1DU, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x8AU, 0x20U, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x10U, 0x1CU, 0x51U, 0x48U, 0x10U, 0x9CU, 0x70U, 0x48U, - 0x08U, 0x46U, 0x24U, 0x00U, 0x55U, 0x4AU, 0x1FU, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x4AU, 0x1FU, 0x20U, 0x26U, 0x98U, 0x25U, 0x00U, - 0x20U, 0xC8U, 0x01U, 0x00U, 0x35U, 0xCAU, 0x1FU, 0x20U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x01U, 0x08U, 0x18U, 0x01U, 0x08U, 0x44U, 0x24U, 0x00U, 0x10U, 0xDCU, 0x51U, 0x58U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, - 0x75U, 0xCAU, 0x1FU, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0xD2U, 0x1EU, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0xD2U, 0x1EU, 0x20U, - 0x05U, 0x80U, 0x22U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x61U, 0x00U, - 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, - 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x08U, 0xC4U, 0x03U, - 0x00U, 0x18U, 0x04U, 0x00U, 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0xD2U, 0x1EU, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0xD2U, 0x1EU, 0x20U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0x8AU, 0x20U, 0x20U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x8AU, 0x20U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x01U, 0x80U, 0x05U, 0x00U, 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0x88U, 0x05U, 0x02U, - 0x01U, 0x8CU, 0x05U, 0x03U, 0x01U, 0xB0U, 0x05U, 0x04U, 0x01U, 0x9CU, 0x05U, 0x05U, - 0x02U, 0x00U, 0x17U, 0x00U, 0x02U, 0x00U, 0x27U, 0x01U, 0x08U, 0xCCU, 0x14U, 0x00U, - 0x00U, 0x18U, 0x04U, 0x00U, 0x00U, 0x08U, 0xC4U, 0x02U, 0x00U, 0xDEU, 0x01U, 0x00U, - 0x35U, 0x5AU, 0x21U, 0x20U, 0x15U, 0xA2U, 0x24U, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x1CU, 0x18U, 0x01U, 0x10U, 0xD4U, 0x51U, 0x48U, - 0x10U, 0x5CU, 0x41U, 0x50U, 0x10U, 0x9CU, 0x70U, 0x48U, 0x08U, 0x44U, 0x34U, 0x00U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, - 0x75U, 0xEAU, 0x23U, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0xFAU, 0x21U, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0xFAU, 0x21U, 0x20U, - 0x35U, 0xEAU, 0x23U, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x01U, 0x1CU, 0x18U, 0x01U, 0x10U, 0xD4U, 0x51U, 0x48U, 0x10U, 0x5CU, 0x41U, 0x50U, - 0x08U, 0x46U, 0x34U, 0x00U, 0x55U, 0x7AU, 0x22U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x7AU, 0x22U, 0x20U, 0x25U, 0x80U, 0x72U, 0x31U, - 0x26U, 0x98U, 0x35U, 0x00U, 0x35U, 0xEAU, 0x23U, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x24U, 0x18U, 0x01U, 0x08U, 0x44U, 0x34U, 0x00U, - 0x10U, 0xDCU, 0x91U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x5CU, 0x41U, 0x48U, - 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, 0x25U, 0x80U, 0x72U, 0x31U, - 0x26U, 0x98U, 0x25U, 0x00U, 0x35U, 0xEAU, 0x23U, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, - 0x55U, 0x32U, 0x23U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0x32U, 0x23U, 0x20U, 0x25U, 0x80U, 0x72U, 0x31U, 0x26U, 0x98U, 0x25U, 0x00U, - 0x35U, 0xEAU, 0x23U, 0x20U, 0x01U, 0x08U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x08U, 0x44U, 0x34U, 0x00U, 0x10U, 0xDCU, 0x41U, 0x50U, - 0x10U, 0xDCU, 0x51U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, 0x06U, 0x98U, 0x45U, 0x00U, - 0x08U, 0x92U, 0xC5U, 0x07U, 0x25U, 0x80U, 0x22U, 0x31U, 0x26U, 0x98U, 0x15U, 0x00U, - 0x35U, 0xEAU, 0x23U, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0x5AU, 0x21U, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x5AU, 0x21U, 0x20U, - 0x25U, 0x80U, 0x22U, 0x31U, 0x26U, 0x98U, 0x15U, 0x00U, 0x35U, 0xEAU, 0x23U, 0x20U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x61U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, - 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, - 0x00U, 0x08U, 0xC4U, 0x03U, 0x08U, 0x98U, 0x15U, 0x00U, 0x00U, 0x18U, 0x04U, 0x00U, - 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0x5AU, 0x21U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x5AU, 0x21U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0xEAU, 0x27U, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x1CU, 0x18U, 0x01U, 0x10U, 0x14U, 0x51U, 0x48U, - 0x10U, 0x5CU, 0x71U, 0x50U, 0x10U, 0x9CU, 0x70U, 0x48U, 0x08U, 0x44U, 0x34U, 0x00U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, - 0x75U, 0x32U, 0x27U, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0x42U, 0x25U, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x42U, 0x25U, 0x20U, - 0x35U, 0x32U, 0x27U, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x01U, 0x1CU, 0x18U, 0x01U, 0x10U, 0x14U, 0x51U, 0x48U, 0x10U, 0x5CU, 0x71U, 0x50U, - 0x08U, 0x46U, 0x34U, 0x00U, 0x55U, 0xC2U, 0x25U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0xC2U, 0x25U, 0x20U, 0x25U, 0x80U, 0x72U, 0x31U, - 0x26U, 0x98U, 0x35U, 0x00U, 0x35U, 0x32U, 0x27U, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x24U, 0x18U, 0x01U, 0x08U, 0x44U, 0x34U, 0x00U, - 0x10U, 0xDCU, 0x41U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x5CU, 0x91U, 0x48U, - 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, 0x25U, 0x80U, 0x72U, 0x31U, - 0x26U, 0x98U, 0x25U, 0x00U, 0x35U, 0x32U, 0x27U, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, - 0x55U, 0x7AU, 0x26U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0x7AU, 0x26U, 0x20U, 0x25U, 0x80U, 0x72U, 0x31U, 0x26U, 0x98U, 0x25U, 0x00U, - 0x35U, 0x32U, 0x27U, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x01U, 0x08U, 0x18U, 0x01U, 0x08U, 0x44U, 0x34U, 0x00U, 0x10U, 0xDCU, 0x41U, 0x50U, - 0x10U, 0xDCU, 0x51U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, 0x06U, 0x98U, 0x45U, 0x00U, - 0x08U, 0x92U, 0xC5U, 0x07U, 0x25U, 0x80U, 0x22U, 0x31U, 0x26U, 0x98U, 0x15U, 0x00U, - 0x35U, 0x32U, 0x27U, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0xA2U, 0x24U, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0xA2U, 0x24U, 0x20U, - 0x25U, 0x80U, 0x22U, 0x31U, 0x26U, 0x98U, 0x15U, 0x00U, 0x35U, 0x32U, 0x27U, 0x20U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x61U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, - 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, - 0x00U, 0x08U, 0xC4U, 0x03U, 0x08U, 0x98U, 0x15U, 0x00U, 0x00U, 0x18U, 0x04U, 0x00U, - 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0xA2U, 0x24U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0xA2U, 0x24U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0xEAU, 0x27U, 0x20U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x15U, 0xEAU, 0x27U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, - 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0x88U, 0x05U, 0x02U, 0x01U, 0x8CU, 0x05U, 0x03U, - 0x01U, 0xB0U, 0x05U, 0x04U, 0x01U, 0x9CU, 0x05U, 0x05U, 0x02U, 0x00U, 0x17U, 0x00U, - 0x02U, 0x00U, 0x27U, 0x01U, 0x08U, 0xCCU, 0x14U, 0x00U, 0x00U, 0x18U, 0x04U, 0x00U, - 0x00U, 0x14U, 0xFEU, 0x8FU, 0x00U, 0xDEU, 0x01U, 0x00U, 0x00U, 0x08U, 0xC4U, 0x02U, - 0x35U, 0xC2U, 0x28U, 0x20U, 0x15U, 0xCAU, 0x2BU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x10U, 0x10U, 0x40U, 0x08U, 0x11U, 0x10U, 0x48U, 0x00U, 0x10U, 0x9CU, 0x40U, 0x48U, - 0x08U, 0x44U, 0x44U, 0x00U, 0x05U, 0x80U, 0x72U, 0x31U, 0x06U, 0x98U, 0x45U, 0x00U, - 0x08U, 0x92U, 0xC5U, 0x07U, 0x75U, 0x12U, 0x2BU, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, - 0x55U, 0x52U, 0x29U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0x52U, 0x29U, 0x20U, 0x35U, 0x12U, 0x2BU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x10U, 0x1CU, 0x40U, 0x08U, 0x11U, 0x1CU, 0x78U, 0x00U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x55U, 0xC2U, 0x29U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0xC2U, 0x29U, 0x20U, 0x25U, 0x80U, 0x72U, 0x31U, 0x26U, 0x98U, 0x35U, 0x00U, - 0x35U, 0x12U, 0x2BU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x10U, 0x10U, 0x40U, 0x08U, - 0x11U, 0x10U, 0x48U, 0x00U, 0x10U, 0xDCU, 0x41U, 0x58U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x1CU, 0x48U, 0x08U, 0x06U, 0x98U, 0x45U, 0x00U, - 0x08U, 0x92U, 0xC5U, 0x07U, 0x75U, 0x12U, 0x2BU, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, - 0x55U, 0x6AU, 0x2AU, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0x6AU, 0x2AU, 0x20U, 0x25U, 0x80U, 0x72U, 0x31U, 0x26U, 0x98U, 0x25U, 0x00U, - 0x35U, 0x12U, 0x2BU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x10U, 0x10U, 0x40U, 0x08U, - 0x11U, 0x10U, 0x48U, 0x00U, 0x10U, 0xDCU, 0x41U, 0x50U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x08U, 0x48U, 0x10U, 0x06U, 0x98U, 0x45U, 0x00U, - 0x08U, 0x92U, 0xC5U, 0x07U, 0x75U, 0x12U, 0x2BU, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, - 0x55U, 0xC2U, 0x28U, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0xC2U, 0x28U, 0x20U, 0x25U, 0x80U, 0x22U, 0x31U, 0x26U, 0x98U, 0x25U, 0x00U, - 0x35U, 0x12U, 0x2BU, 0x20U, 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x61U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, - 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, - 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x08U, 0xC4U, 0x03U, 0x08U, 0x98U, 0x15U, 0x00U, - 0x00U, 0x18U, 0x04U, 0x00U, 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0xC2U, 0x28U, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0xC2U, 0x28U, 0x20U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0xAAU, 0x2EU, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x10U, 0x9CU, 0x40U, 0x48U, 0x08U, 0x44U, 0x44U, 0x00U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, - 0x75U, 0xF2U, 0x2DU, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0x4AU, 0x2CU, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0x4AU, 0x2CU, 0x20U, - 0x35U, 0xF2U, 0x2DU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x0DU, 0x1CU, 0x51U, 0x00U, - 0x08U, 0x46U, 0x44U, 0x00U, 0x55U, 0xB2U, 0x2CU, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0xB2U, 0x2CU, 0x20U, 0x25U, 0x80U, 0x72U, 0x31U, - 0x26U, 0x98U, 0x35U, 0x00U, 0x35U, 0xF2U, 0x2DU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x0DU, 0x10U, 0x51U, 0x00U, 0x10U, 0xDCU, 0x41U, 0x58U, 0x08U, 0x46U, 0x44U, 0x00U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x1CU, 0x48U, 0x08U, 0x06U, 0x98U, 0x45U, 0x00U, - 0x08U, 0x92U, 0xC5U, 0x07U, 0x75U, 0xF2U, 0x2DU, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, - 0x55U, 0x52U, 0x2DU, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, - 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, - 0x55U, 0x52U, 0x2DU, 0x20U, 0x25U, 0x80U, 0x72U, 0x31U, 0x26U, 0x98U, 0x25U, 0x00U, - 0x35U, 0xF2U, 0x2DU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x0DU, 0x10U, 0x51U, 0x00U, - 0x10U, 0xDCU, 0x41U, 0x50U, 0x08U, 0x46U, 0x44U, 0x00U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x10U, 0x08U, 0x48U, 0x10U, 0x06U, 0x98U, 0x45U, 0x00U, 0x08U, 0x92U, 0xC5U, 0x07U, - 0x75U, 0xF2U, 0x2DU, 0x20U, 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0xCAU, 0x2BU, 0x20U, - 0x20U, 0xCEU, 0x00U, 0x00U, 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, - 0x46U, 0x00U, 0x40U, 0x00U, 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0xCAU, 0x2BU, 0x20U, - 0x25U, 0x80U, 0x22U, 0x31U, 0x26U, 0x98U, 0x25U, 0x00U, 0x35U, 0xF2U, 0x2DU, 0x20U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x0CU, 0xDCU, 0x61U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, - 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, - 0x00U, 0x08U, 0xC4U, 0x03U, 0x08U, 0x98U, 0x15U, 0x00U, 0x00U, 0x18U, 0x04U, 0x00U, - 0x00U, 0x46U, 0x00U, 0x00U, 0x55U, 0xCAU, 0x2BU, 0x20U, 0x20U, 0xCEU, 0x00U, 0x00U, - 0x41U, 0x04U, 0x07U, 0x00U, 0x41U, 0x10U, 0x07U, 0x01U, 0x46U, 0x00U, 0x40U, 0x00U, - 0x48U, 0xCCU, 0x14U, 0x00U, 0x55U, 0xCAU, 0x2BU, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0xAAU, 0x2EU, 0x20U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x15U, 0xAAU, 0x2EU, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, - 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0xB0U, 0x05U, 0x02U, 0x01U, 0x9CU, 0x05U, 0x03U, - 0x00U, 0x0CU, 0xC4U, 0x02U, 0x00U, 0xDEU, 0x01U, 0x00U, 0x35U, 0x4AU, 0x2FU, 0x20U, - 0x15U, 0x8AU, 0x33U, 0x20U, 0x08U, 0x4AU, 0x84U, 0x0AU, 0x60U, 0x08U, 0x84U, 0x0AU, - 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0x2AU, 0x31U, 0x20U, 0x00U, 0x24U, 0x54U, 0x01U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x72U, 0x2FU, 0x20U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, 0x0DU, 0x18U, 0xF5U, 0x01U, - 0x10U, 0x18U, 0x60U, 0x1BU, 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x98U, 0x71U, 0x4DU, - 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x55U, 0x0DU, 0x5CU, 0x85U, 0x0FU, - 0x10U, 0x98U, 0x71U, 0x48U, 0x10U, 0xDCU, 0x60U, 0x40U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, 0x0DU, 0x18U, 0xF5U, 0x01U, - 0x10U, 0x18U, 0x60U, 0x13U, 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x98U, 0x71U, 0x45U, - 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x4DU, 0x0DU, 0x5CU, 0x85U, 0x0FU, - 0x10U, 0x98U, 0x71U, 0x40U, 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x9CU, 0x71U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x18U, 0x78U, 0x03U, 0x0DU, 0x5CU, 0x75U, 0x00U, - 0x10U, 0x98U, 0x71U, 0x45U, 0x0DU, 0x1CU, 0xF5U, 0x01U, 0x10U, 0x9CU, 0x71U, 0x4BU, - 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, 0x0DU, 0x5CU, 0x85U, 0x0FU, - 0x10U, 0x98U, 0x71U, 0x50U, 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x98U, 0x71U, 0x55U, - 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x9CU, 0x71U, 0x5DU, 0x05U, 0x80U, 0x72U, 0x31U, - 0x0DU, 0x0CU, 0xF5U, 0x01U, 0x10U, 0x0CU, 0x30U, 0x03U, 0x08U, 0x66U, 0x16U, 0x00U, - 0x55U, 0x72U, 0x2FU, 0x20U, 0x08U, 0x46U, 0x20U, 0x00U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x02U, 0x31U, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, - 0x15U, 0x02U, 0x33U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0x2AU, 0x31U, 0x20U, 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x0DU, 0x18U, 0xF5U, 0x01U, 0x10U, 0x18U, 0x60U, 0x1BU, 0x0DU, 0x1CU, 0x05U, 0x0EU, - 0x10U, 0x98U, 0x71U, 0x4DU, 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x55U, - 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x48U, 0x10U, 0xDCU, 0x60U, 0x40U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x24U, 0x00U, 0x35U, 0x02U, 0x33U, 0x20U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, 0x0DU, 0x18U, 0xF5U, 0x01U, - 0x10U, 0x18U, 0x60U, 0x13U, 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x98U, 0x71U, 0x45U, - 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x4DU, 0x0DU, 0x5CU, 0x85U, 0x0FU, - 0x10U, 0x98U, 0x71U, 0x40U, 0x01U, 0x10U, 0x18U, 0x01U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x9CU, 0x71U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x24U, 0x00U, 0x35U, 0x02U, 0x33U, 0x20U, 0x0DU, 0x1CU, 0x05U, 0x0EU, - 0x10U, 0x18U, 0x78U, 0x03U, 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x45U, - 0x0DU, 0x1CU, 0xF5U, 0x01U, 0x10U, 0x9CU, 0x71U, 0x4BU, 0x01U, 0x10U, 0x18U, 0x01U, - 0x01U, 0x14U, 0x18U, 0x01U, 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x50U, - 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x98U, 0x71U, 0x55U, 0x0DU, 0x5CU, 0x75U, 0x00U, - 0x10U, 0x9CU, 0x71U, 0x5DU, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x24U, 0x00U, - 0x35U, 0x02U, 0x33U, 0x20U, 0x0DU, 0x0CU, 0xF5U, 0x01U, 0x10U, 0x0CU, 0x30U, 0x03U, - 0x08U, 0x46U, 0x24U, 0x00U, 0xB5U, 0x2AU, 0x31U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0xE2U, 0x32U, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, - 0x00U, 0x9CU, 0x9CU, 0x07U, 0x10U, 0x88U, 0x28U, 0x81U, 0x0CU, 0xDCU, 0x21U, 0x00U, - 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x18U, 0xECU, 0x02U, 0x20U, - 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, 0x04U, 0x1CU, 0x2AU, 0x31U, - 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, 0x00U, 0x0CU, 0xC4U, 0x03U, - 0x00U, 0x46U, 0x00U, 0x00U, 0xB5U, 0x4AU, 0x2FU, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x15U, 0xC2U, 0x37U, 0x20U, 0x08U, 0x4AU, 0x84U, 0x0AU, - 0x60U, 0x08U, 0x84U, 0x0AU, 0x80U, 0x48U, 0x00U, 0x00U, 0x95U, 0x6AU, 0x35U, 0x20U, - 0x00U, 0x24U, 0x54U, 0x01U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0xB2U, 0x33U, 0x20U, 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x0DU, 0x18U, 0xF5U, 0x01U, 0x10U, 0x18U, 0x60U, 0x1BU, 0x0DU, 0x1CU, 0x05U, 0x0EU, - 0x10U, 0x98U, 0x71U, 0x4DU, 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x55U, - 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x48U, 0x10U, 0xDCU, 0x60U, 0x40U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x0DU, 0x18U, 0xF5U, 0x01U, 0x10U, 0x18U, 0x60U, 0x13U, 0x0DU, 0x1CU, 0x05U, 0x0EU, - 0x10U, 0x98U, 0x71U, 0x45U, 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x4DU, - 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x40U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x9CU, 0x71U, 0x58U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x18U, 0x78U, 0x03U, - 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x45U, 0x0DU, 0x1CU, 0xF5U, 0x01U, - 0x10U, 0x9CU, 0x71U, 0x4BU, 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x50U, 0x0DU, 0x1CU, 0x05U, 0x0EU, - 0x10U, 0x98U, 0x71U, 0x55U, 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x9CU, 0x71U, 0x5DU, - 0x05U, 0x80U, 0x72U, 0x31U, 0x0DU, 0x0CU, 0xF5U, 0x01U, 0x10U, 0x0CU, 0x30U, 0x03U, - 0x08U, 0x66U, 0x16U, 0x00U, 0x55U, 0xB2U, 0x33U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x3AU, 0x35U, 0x20U, 0x08U, 0x46U, 0x20U, 0x00U, - 0x05U, 0x80U, 0x32U, 0x31U, 0x15U, 0x42U, 0x37U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x6AU, 0x35U, 0x20U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x0DU, 0x18U, 0xF5U, 0x01U, 0x10U, 0x18U, 0x60U, 0x1BU, - 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x98U, 0x71U, 0x4DU, 0x0DU, 0x5CU, 0x75U, 0x00U, - 0x10U, 0x98U, 0x71U, 0x55U, 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x48U, - 0x10U, 0xDCU, 0x60U, 0x40U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x24U, 0x00U, - 0x35U, 0x42U, 0x37U, 0x20U, 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x10U, 0x18U, 0x01U, - 0x0DU, 0x18U, 0xF5U, 0x01U, 0x10U, 0x18U, 0x60U, 0x13U, 0x0DU, 0x1CU, 0x05U, 0x0EU, - 0x10U, 0x98U, 0x71U, 0x45U, 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x98U, 0x71U, 0x4DU, - 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x98U, 0x71U, 0x40U, 0x01U, 0x14U, 0x18U, 0x01U, - 0x01U, 0x10U, 0x18U, 0x01U, 0x0DU, 0x5CU, 0x85U, 0x0FU, 0x10U, 0x9CU, 0x71U, 0x58U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x46U, 0x24U, 0x00U, 0x35U, 0x42U, 0x37U, 0x20U, - 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x18U, 0x78U, 0x03U, 0x0DU, 0x5CU, 0x75U, 0x00U, - 0x10U, 0x98U, 0x71U, 0x45U, 0x0DU, 0x1CU, 0xF5U, 0x01U, 0x10U, 0x9CU, 0x71U, 0x4BU, - 0x01U, 0x14U, 0x18U, 0x01U, 0x01U, 0x10U, 0x18U, 0x01U, 0x0DU, 0x5CU, 0x85U, 0x0FU, - 0x10U, 0x98U, 0x71U, 0x50U, 0x0DU, 0x1CU, 0x05U, 0x0EU, 0x10U, 0x98U, 0x71U, 0x55U, - 0x0DU, 0x5CU, 0x75U, 0x00U, 0x10U, 0x9CU, 0x71U, 0x5DU, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x46U, 0x24U, 0x00U, 0x35U, 0x42U, 0x37U, 0x20U, 0x0DU, 0x0CU, 0xF5U, 0x01U, - 0x10U, 0x0CU, 0x30U, 0x03U, 0x08U, 0x46U, 0x24U, 0x00U, 0xB5U, 0x6AU, 0x35U, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, 0x35U, 0x22U, 0x37U, 0x20U, - 0x05U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, 0x10U, 0x88U, 0x28U, 0x81U, - 0x0CU, 0xDCU, 0x21U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, - 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, - 0x00U, 0x0CU, 0xC4U, 0x03U, 0x00U, 0x46U, 0x00U, 0x00U, 0xB5U, 0x8AU, 0x33U, 0x20U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, - 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x15U, 0xC2U, 0x37U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, - 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0x80U, 0x05U, 0x00U, - 0x01U, 0x84U, 0x05U, 0x01U, 0x01U, 0x88U, 0x05U, 0x02U, 0x01U, 0xA0U, 0x05U, 0x03U, - 0x01U, 0x90U, 0x05U, 0x04U, 0x01U, 0xB0U, 0x05U, 0x05U, 0x01U, 0xBCU, 0x05U, 0x06U, - 0x02U, 0x00U, 0x17U, 0x00U, 0x02U, 0x00U, 0x27U, 0x01U, 0x02U, 0x00U, 0xF7U, 0x02U, - 0x02U, 0x00U, 0x47U, 0x03U, 0x0DU, 0x1EU, 0x15U, 0x00U, 0x40U, 0x1CU, 0x14U, 0x00U, - 0x20U, 0x1CU, 0x04U, 0x00U, 0x02U, 0x00U, 0x77U, 0x04U, 0x02U, 0x00U, 0x77U, 0x05U, - 0x08U, 0x1EU, 0x15U, 0x00U, 0x26U, 0x00U, 0x44U, 0x00U, 0x00U, 0x24U, 0xFCU, 0x0FU, - 0x00U, 0x10U, 0xF6U, 0x0FU, 0x0CU, 0x64U, 0x42U, 0x00U, 0x00U, 0x10U, 0xF4U, 0x0FU, - 0x0CU, 0x64U, 0x42U, 0x00U, 0x00U, 0x0CU, 0xC4U, 0x02U, 0x01U, 0x08U, 0x07U, 0x00U, - 0x08U, 0x88U, 0x14U, 0x00U, 0x02U, 0x00U, 0x27U, 0x00U, 0x01U, 0x04U, 0x07U, 0x01U, - 0x08U, 0x4AU, 0x44U, 0x05U, 0x60U, 0x08U, 0x44U, 0x05U, 0x80U, 0x48U, 0x00U, 0x00U, - 0x02U, 0x00U, 0x27U, 0x07U, 0x95U, 0x5AU, 0x3BU, 0x20U, 0x0DU, 0x1EU, 0x16U, 0x00U, - 0x55U, 0x42U, 0x39U, 0x20U, 0x15U, 0x62U, 0x39U, 0x20U, 0x01U, 0x10U, 0x07U, 0x04U, - 0x00U, 0x12U, 0x01U, 0x00U, 0x35U, 0x2AU, 0x3AU, 0x20U, 0x55U, 0xCAU, 0x3AU, 0x20U, - 0x01U, 0x10U, 0x07U, 0x03U, 0x08U, 0x1EU, 0x15U, 0x00U, 0x35U, 0xAAU, 0x39U, 0x20U, - 0x08U, 0x1EU, 0x25U, 0x00U, 0x35U, 0xCAU, 0x39U, 0x20U, 0x08U, 0x1EU, 0x35U, 0x00U, - 0x35U, 0xEAU, 0x39U, 0x20U, 0x08U, 0x1EU, 0x45U, 0x00U, 0x35U, 0x0AU, 0x3AU, 0x20U, - 0x01U, 0x10U, 0x07U, 0x04U, 0x00U, 0x12U, 0x01U, 0x00U, 0x55U, 0xCAU, 0x3AU, 0x20U, - 0x35U, 0x32U, 0x3FU, 0x20U, 0x01U, 0x10U, 0x07U, 0x04U, 0x00U, 0x12U, 0x01U, 0x00U, - 0x35U, 0x2AU, 0x3AU, 0x20U, 0x55U, 0x32U, 0x3FU, 0x20U, 0x01U, 0x10U, 0x07U, 0x04U, - 0x00U, 0x12U, 0x01U, 0x00U, 0x35U, 0xCAU, 0x3AU, 0x20U, 0x55U, 0x32U, 0x3FU, 0x20U, - 0x01U, 0x10U, 0x07U, 0x04U, 0x00U, 0x12U, 0x01U, 0x00U, 0x55U, 0x2AU, 0x3AU, 0x20U, - 0x35U, 0x32U, 0x3FU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, - 0x75U, 0x2AU, 0x3AU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x02U, 0x01U, 0x18U, 0x1CU, 0x02U, - 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, 0x0DU, 0x98U, 0x91U, 0x00U, - 0x31U, 0x10U, 0x40U, 0x08U, 0x31U, 0x18U, 0x60U, 0x08U, 0x10U, 0xDCU, 0x40U, 0x48U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x1CU, 0x60U, 0x18U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x10U, 0x1CU, 0x68U, 0x08U, 0x05U, 0x80U, 0x72U, 0x31U, 0x00U, 0x0CU, 0x04U, 0x00U, - 0x08U, 0x8AU, 0x44U, 0x00U, 0xB5U, 0x2AU, 0x3AU, 0x20U, 0x15U, 0x12U, 0x40U, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0xCAU, 0x3AU, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x02U, 0x01U, 0x18U, 0x1CU, 0x02U, 0x00U, 0xFEU, 0x03U, 0x00U, - 0x0DU, 0x10U, 0x91U, 0x00U, 0x0DU, 0x98U, 0x91U, 0x00U, 0x31U, 0x10U, 0x40U, 0x08U, - 0x31U, 0x18U, 0x60U, 0x08U, 0x05U, 0x80U, 0x32U, 0x31U, 0x05U, 0x80U, 0x42U, 0x31U, - 0x10U, 0x1CU, 0x60U, 0x10U, 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x0CU, 0x68U, 0x10U, - 0x08U, 0x8AU, 0x44U, 0x00U, 0xB5U, 0xCAU, 0x3AU, 0x20U, 0x15U, 0x12U, 0x40U, 0x20U, - 0x0DU, 0x1EU, 0x16U, 0x00U, 0x55U, 0x72U, 0x3BU, 0x20U, 0x15U, 0x92U, 0x3BU, 0x20U, - 0x01U, 0x10U, 0x07U, 0x04U, 0x00U, 0x12U, 0x01U, 0x00U, 0x35U, 0x5AU, 0x3CU, 0x20U, - 0x55U, 0x32U, 0x3DU, 0x20U, 0x01U, 0x10U, 0x07U, 0x03U, 0x08U, 0x1EU, 0x15U, 0x00U, - 0x35U, 0xDAU, 0x3BU, 0x20U, 0x08U, 0x1EU, 0x25U, 0x00U, 0x35U, 0xFAU, 0x3BU, 0x20U, - 0x08U, 0x1EU, 0x35U, 0x00U, 0x35U, 0x1AU, 0x3CU, 0x20U, 0x08U, 0x1EU, 0x45U, 0x00U, - 0x35U, 0x3AU, 0x3CU, 0x20U, 0x01U, 0x10U, 0x07U, 0x04U, 0x00U, 0x12U, 0x01U, 0x00U, - 0x55U, 0x32U, 0x3DU, 0x20U, 0x35U, 0x0AU, 0x3EU, 0x20U, 0x01U, 0x10U, 0x07U, 0x04U, - 0x00U, 0x12U, 0x01U, 0x00U, 0x35U, 0x5AU, 0x3CU, 0x20U, 0x55U, 0x0AU, 0x3EU, 0x20U, - 0x01U, 0x10U, 0x07U, 0x04U, 0x00U, 0x12U, 0x01U, 0x00U, 0x35U, 0x32U, 0x3DU, 0x20U, - 0x55U, 0x0AU, 0x3EU, 0x20U, 0x01U, 0x10U, 0x07U, 0x04U, 0x00U, 0x12U, 0x01U, 0x00U, - 0x55U, 0x5AU, 0x3CU, 0x20U, 0x35U, 0x0AU, 0x3EU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x5AU, 0x3CU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x02U, - 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, 0x31U, 0x10U, 0x40U, 0x08U, - 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x8AU, 0x14U, 0x00U, - 0x35U, 0x32U, 0x40U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x02U, 0x00U, 0xFEU, 0x03U, 0x00U, - 0x0DU, 0x10U, 0x91U, 0x00U, 0x31U, 0x10U, 0x40U, 0x08U, 0x10U, 0x1CU, 0x40U, 0x18U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x8AU, 0x14U, 0x00U, 0x35U, 0x32U, 0x40U, 0x20U, - 0x10U, 0x1CU, 0x48U, 0x08U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x8AU, 0x14U, 0x00U, - 0x35U, 0x32U, 0x40U, 0x20U, 0x00U, 0x0CU, 0x04U, 0x00U, 0x08U, 0x8AU, 0x14U, 0x00U, - 0xB5U, 0x5AU, 0x3CU, 0x20U, 0x15U, 0x12U, 0x40U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x32U, 0x3DU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x02U, - 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, 0x31U, 0x10U, 0x40U, 0x08U, - 0x00U, 0xDCU, 0x00U, 0x00U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x8AU, 0x14U, 0x00U, - 0x35U, 0x32U, 0x40U, 0x20U, 0x00U, 0x1CU, 0x01U, 0x00U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x8AU, 0x14U, 0x00U, 0x35U, 0x32U, 0x40U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x02U, - 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, 0x31U, 0x10U, 0x40U, 0x08U, - 0x10U, 0x1CU, 0x40U, 0x10U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x8AU, 0x14U, 0x00U, - 0x35U, 0x32U, 0x40U, 0x20U, 0x10U, 0x0CU, 0x48U, 0x10U, 0x08U, 0x8AU, 0x14U, 0x00U, - 0xB5U, 0x32U, 0x3DU, 0x20U, 0x15U, 0x12U, 0x40U, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, - 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x0AU, 0x3EU, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, - 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, 0x31U, 0x10U, 0x40U, 0x08U, - 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, 0x08U, 0x8AU, 0x14U, 0x00U, - 0x35U, 0x32U, 0x40U, 0x20U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x00U, 0xFEU, 0x03U, 0x00U, - 0x0DU, 0x10U, 0x91U, 0x00U, 0x31U, 0x10U, 0x40U, 0x08U, 0x00U, 0x18U, 0x01U, 0x00U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, - 0x31U, 0x10U, 0x40U, 0x08U, 0x10U, 0x9CU, 0x41U, 0x58U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x8AU, 0x14U, 0x00U, 0x35U, 0x32U, 0x40U, 0x20U, 0x10U, 0x18U, 0x48U, 0x08U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, - 0x31U, 0x10U, 0x40U, 0x08U, 0x10U, 0x9CU, 0x41U, 0x50U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x08U, 0x8AU, 0x14U, 0x00U, 0x35U, 0x32U, 0x40U, 0x20U, 0x10U, 0x0CU, 0x48U, 0x10U, - 0x08U, 0x8AU, 0x14U, 0x00U, 0xB5U, 0x0AU, 0x3EU, 0x20U, 0x15U, 0x12U, 0x40U, 0x20U, - 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0xE5U, 0x03U, 0x75U, 0x32U, 0x3FU, 0x20U, - 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x18U, 0x1CU, 0x01U, 0x00U, 0xFEU, 0x03U, 0x00U, - 0x0DU, 0x10U, 0x91U, 0x00U, 0x0DU, 0x98U, 0x91U, 0x00U, 0x31U, 0x10U, 0x40U, 0x08U, - 0x31U, 0x18U, 0x60U, 0x08U, 0x10U, 0xDCU, 0x40U, 0x48U, 0x05U, 0x80U, 0x72U, 0x31U, - 0x00U, 0x94U, 0x01U, 0x00U, 0x01U, 0x10U, 0x1CU, 0x01U, 0x01U, 0x18U, 0x1CU, 0x01U, - 0x00U, 0xFEU, 0x03U, 0x00U, 0x0DU, 0x10U, 0x91U, 0x00U, 0x0DU, 0x98U, 0x91U, 0x00U, - 0x31U, 0x10U, 0x40U, 0x08U, 0x31U, 0x18U, 0x60U, 0x08U, 0x10U, 0x5CU, 0x41U, 0x58U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x10U, 0x48U, 0x08U, 0x10U, 0x1CU, 0x61U, 0x50U, - 0x05U, 0x80U, 0x72U, 0x31U, 0x10U, 0x0CU, 0x68U, 0x10U, 0x08U, 0x8AU, 0x44U, 0x00U, - 0xB5U, 0x32U, 0x3FU, 0x20U, 0x04U, 0x1CU, 0x29U, 0x31U, 0x08U, 0xDEU, 0x05U, 0x04U, - 0x35U, 0x12U, 0x40U, 0x20U, 0x05U, 0x80U, 0x32U, 0x31U, 0x00U, 0x9CU, 0x9CU, 0x07U, - 0x01U, 0x08U, 0x07U, 0x07U, 0x10U, 0x0CU, 0x20U, 0x01U, 0x06U, 0x8CU, 0x30U, 0x00U, - 0x0CU, 0xDCU, 0x31U, 0x00U, 0x06U, 0xDCU, 0x15U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, - 0x18U, 0xECU, 0x02U, 0x20U, 0x05U, 0x84U, 0x72U, 0x31U, 0x04U, 0x5CU, 0x2AU, 0x31U, - 0x04U, 0x1CU, 0x2AU, 0x31U, 0x00U, 0x1CU, 0x14U, 0x00U, 0x05U, 0x88U, 0x72U, 0x31U, - 0x00U, 0x0CU, 0xC4U, 0x03U, 0x08U, 0x46U, 0x20U, 0x00U, 0xB5U, 0x02U, 0x39U, 0x20U, - 0x0DU, 0x1EU, 0x16U, 0x00U, 0x55U, 0xCAU, 0x40U, 0x20U, 0x35U, 0xF2U, 0x40U, 0x20U, - 0x01U, 0x1CU, 0x07U, 0x04U, 0x08U, 0xDEU, 0x15U, 0x00U, 0x28U, 0x00U, 0x44U, 0x00U, - 0x46U, 0x00U, 0x44U, 0x00U, 0x15U, 0x82U, 0x41U, 0x20U, 0x01U, 0x10U, 0x07U, 0x03U, - 0x08U, 0x1EU, 0x15U, 0x00U, 0x35U, 0x3AU, 0x41U, 0x20U, 0x08U, 0x1EU, 0x25U, 0x00U, - 0x35U, 0x82U, 0x41U, 0x20U, 0x08U, 0x1EU, 0x35U, 0x00U, 0x35U, 0x62U, 0x41U, 0x20U, - 0x08U, 0x1EU, 0x45U, 0x00U, 0x35U, 0x82U, 0x41U, 0x20U, 0x01U, 0x1CU, 0x07U, 0x04U, - 0x08U, 0xDEU, 0x15U, 0x00U, 0x28U, 0x00U, 0x44U, 0x00U, 0x46U, 0x00U, 0x44U, 0x00U, - 0x15U, 0x82U, 0x41U, 0x20U, 0x01U, 0x1CU, 0x07U, 0x04U, 0x08U, 0xDEU, 0x15U, 0x00U, - 0x26U, 0x00U, 0x44U, 0x00U, 0x48U, 0x00U, 0x44U, 0x00U, 0x01U, 0x1CU, 0x07U, 0x04U, - 0x08U, 0xDEU, 0x15U, 0x00U, 0x20U, 0x1CU, 0x04U, 0x00U, 0x40U, 0x1CU, 0x14U, 0x00U, - 0x02U, 0x00U, 0x77U, 0x04U, 0x01U, 0x08U, 0x07U, 0x00U, 0x00U, 0x8AU, 0x00U, 0x00U, - 0xB5U, 0xE2U, 0x38U, 0x20U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x14U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, 0x00U, 0x04U, 0xDCU, 0x06U, - 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, 0x0EU, 0x2CU, 0x20U, 0x00U, - 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0xD2U, 0x41U, 0x20U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, 0x04U, 0x18U, 0x04U, 0x27U, - 0x01U, 0xB0U, 0x05U, 0x00U, 0x00U, 0x00U, 0x14U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x44U, 0x00U, 0x27U, 0x04U, 0x84U, 0x01U, 0x01U, 0x00U, 0x80U, 0x1FU, 0x00U, - 0x0CU, 0x00U, 0x10U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x18U, 0x00U, 0x01U, - 0x00U, 0x00U, 0x0EU, 0x04U, 0x00U, 0x04U, 0x1CU, 0x01U, 0x00U, 0x08U, 0x06U, 0x06U, - 0x0CU, 0x1CU, 0x10U, 0x00U, 0x0CU, 0xDCU, 0x21U, 0x00U, 0x00U, 0x00U, 0x2EU, 0x00U, - 0x00U, 0x04U, 0x6CU, 0x04U, 0x00U, 0x08U, 0xA6U, 0x08U, 0x00U, 0x0CU, 0xE4U, 0x0CU, - 0x0CU, 0x14U, 0x10U, 0x00U, 0x0CU, 0x54U, 0x21U, 0x00U, 0x0CU, 0x54U, 0x31U, 0x00U, - 0x00U, 0x00U, 0x3EU, 0x01U, 0x00U, 0x04U, 0x7CU, 0x05U, 0x00U, 0x08U, 0xB6U, 0x09U, - 0x00U, 0x0CU, 0xF4U, 0x0DU, 0x0CU, 0x18U, 0x10U, 0x00U, 0x0CU, 0x98U, 0x21U, 0x00U, - 0x0CU, 0x98U, 0x31U, 0x00U, 0x02U, 0x04U, 0x5FU, 0x01U, 0x02U, 0x04U, 0x6FU, 0x01U, - 0x02U, 0x04U, 0x7FU, 0x01U, 0x02U, 0xC0U, 0x55U, 0x00U, 0x02U, 0xC0U, 0x65U, 0x00U, - 0x00U, 0x00U, 0xF4U, 0x03U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x00U, 0x18U, 0xB4U, 0x00U, 0x02U, 0x04U, 0x6FU, 0x01U, 0x05U, 0x24U, 0x6FU, 0x02U, - 0x00U, 0x04U, 0x04U, 0x02U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x72U, 0x43U, 0x20U, 0x00U, 0x00U, 0xF4U, 0x03U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x00U, 0xD4U, 0x03U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xC2U, 0x43U, 0x20U, 0x00U, 0x00U, 0xC4U, 0x03U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xFAU, 0x43U, 0x20U, - 0x00U, 0x00U, 0xE4U, 0x03U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x32U, 0x44U, 0x20U, 0x00U, 0x00U, 0xC4U, 0x03U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x6AU, 0x44U, 0x20U, 0x00U, 0x00U, 0x24U, 0x00U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xA2U, 0x44U, 0x20U, - 0x00U, 0x00U, 0x04U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0xDAU, 0x44U, 0x20U, 0x00U, 0x00U, 0x24U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x12U, 0x45U, 0x20U, 0x00U, 0x00U, 0x04U, 0x00U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x4AU, 0x45U, 0x20U, - 0x00U, 0x00U, 0x24U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x82U, 0x45U, 0x20U, 0x00U, 0x00U, 0x04U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xBAU, 0x45U, 0x20U, 0x00U, 0x00U, 0x14U, 0x00U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xF2U, 0x45U, 0x20U, - 0x00U, 0x00U, 0x04U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x2AU, 0x46U, 0x20U, 0x00U, 0x00U, 0x14U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x62U, 0x46U, 0x20U, 0x00U, 0x00U, 0x04U, 0x00U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x9AU, 0x46U, 0x20U, - 0x00U, 0x00U, 0x14U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0xD2U, 0x46U, 0x20U, 0x00U, 0x00U, 0x04U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x0AU, 0x47U, 0x20U, 0x00U, 0x00U, 0x14U, 0x00U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x42U, 0x47U, 0x20U, - 0x00U, 0x00U, 0x04U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, - 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x7AU, 0x47U, 0x20U, 0x00U, 0x00U, 0x24U, 0x00U, 0x02U, 0x04U, 0x0FU, 0x01U, - 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xB2U, 0x47U, 0x20U, 0x00U, 0x00U, 0x04U, 0x00U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x00U, 0x04U, 0x24U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xEAU, 0x47U, 0x20U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, - 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x0AU, 0x48U, 0x20U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x2CU, 0x14U, 0x10U, - 0x04U, 0x18U, 0x04U, 0x27U, 0x01U, 0xB0U, 0x05U, 0x00U, 0x00U, 0x00U, 0x04U, 0x00U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x44U, 0x00U, 0x27U, 0x00U, 0x00U, 0xD4U, 0x03U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x02U, 0x04U, 0x4FU, 0x01U, - 0x02U, 0xC0U, 0x45U, 0x00U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xBAU, 0x48U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xDAU, 0x48U, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0xFAU, 0x48U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x1AU, 0x49U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x3AU, 0x49U, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x5AU, 0x49U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x7AU, 0x49U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x9AU, 0x49U, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0xBAU, 0x49U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xDAU, 0x49U, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xFAU, 0x49U, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x1AU, 0x4AU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x3AU, 0x4AU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x5AU, 0x4AU, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x7AU, 0x4AU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x9AU, 0x4AU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xBAU, 0x4AU, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0xDAU, 0x4AU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xFAU, 0x4AU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x1AU, 0x4BU, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x3AU, 0x4BU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x5AU, 0x4BU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x7AU, 0x4BU, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x9AU, 0x4BU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xBAU, 0x4BU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xDAU, 0x4BU, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0xFAU, 0x4BU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x1AU, 0x4CU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x3AU, 0x4CU, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0x5AU, 0x4CU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x7AU, 0x4CU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, - 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0x9AU, 0x4CU, 0x20U, - 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, 0x08U, 0x46U, 0x14U, 0x00U, - 0x55U, 0xBAU, 0x4CU, 0x20U, 0x00U, 0x04U, 0x46U, 0x00U, 0x12U, 0x00U, 0x00U, 0x00U, - 0x08U, 0x46U, 0x14U, 0x00U, 0x55U, 0xDAU, 0x4CU, 0x20U, 0x00U, 0x00U, 0xF4U, 0x03U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x20U, 0x0FU, 0x02U, 0x02U, 0x80U, 0x45U, 0x00U, - 0x00U, 0x00U, 0x0EU, 0x04U, 0x00U, 0x04U, 0x1CU, 0x01U, 0x00U, 0x08U, 0x06U, 0x06U, - 0x0CU, 0x14U, 0x10U, 0x00U, 0x0CU, 0x54U, 0x21U, 0x00U, 0x00U, 0x00U, 0x04U, 0x00U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x02U, 0x40U, 0x05U, 0x00U, 0x00U, 0x00U, 0x04U, 0x00U, - 0x02U, 0x04U, 0x0FU, 0x01U, 0x05U, 0x24U, 0x0FU, 0x02U, 0x02U, 0xC0U, 0x45U, 0x00U, - 0x14U, 0x00U, 0x00U, 0x00U, 0x00U, 0x28U, 0x04U, 0x00U, 0x00U, 0x00U, 0xBEU, 0x0DU, - 0x00U, 0x04U, 0xDCU, 0x06U, 0x00U, 0x08U, 0x66U, 0x0BU, 0x0EU, 0x00U, 0x10U, 0x00U, - 0x0EU, 0x2CU, 0x20U, 0x00U, 0x1CU, 0xB4U, 0x00U, 0x00U, 0x15U, 0x7AU, 0x4DU, 0x20U -}; -#endif -const uint32_t s_smartdmaDisplayFirmwareSize = sizeof(s_smartdmaDisplayFirmware); - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Codes - ******************************************************************************/ - -void SDMA_IRQHandler(void); -void SDMA_IRQHandler(void) -{ - SMARTDMA_HandleIRQ(); -} - -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartdma_rt500.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartdma_rt500.h deleted file mode 100644 index 8e680bf51d1..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_smartdma_rt500.h +++ /dev/null @@ -1,321 +0,0 @@ -/* - * Copyright 2019-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_SMARTDMA_RT500_H_ -#define FSL_SMARTDMA_RT500_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup smartdma_rt500 RT500 SMARTDMA Firmware - * @ingroup smartdma - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -#define SMARTDMA_DISPLAY_MIPI_AND_FLEXIO 0 -#define SMARTDMA_DISPLAY_MIPI_ONLY 1 -#define SMARTDMA_DISPLAY_FLEXIO_ONLY 2 - -/* Select firmware for MIPI and FLEXIO by default. */ -#ifndef SMARTDMA_DISPLAY_FIRMWARE_SELECT -#define SMARTDMA_DISPLAY_FIRMWARE_SELECT SMARTDMA_DISPLAY_MIPI_AND_FLEXIO -#endif - -/*! @brief The firmware used for display. */ -extern const uint8_t s_smartdmaDisplayFirmware[]; - -/*! @brief The s_smartdmaDisplayFirmware firmware memory address. */ -#define SMARTDMA_DISPLAY_MEM_ADDR 0x24100000U - -/*! @brief Size of s_smartdmaDisplayFirmware */ -#define SMARTDMA_DISPLAY_FIRMWARE_SIZE (s_smartdmaDisplayFirmwareSize) - -/*! @brief Size of s_smartdmaDisplayFirmware */ -extern const uint32_t s_smartdmaDisplayFirmwareSize; - -#if (SMARTDMA_DISPLAY_FIRMWARE_SELECT == SMARTDMA_DISPLAY_MIPI_AND_FLEXIO) -/*! - * @brief The API index when using s_smartdmaDisplayFirmware. - */ -enum _smartdma_display_api -{ - kSMARTDMA_FlexIO_DMA_Endian_Swap = 0U, - kSMARTDMA_FlexIO_DMA_Reverse32, - kSMARTDMA_FlexIO_DMA, - kSMARTDMA_FlexIO_DMA_Reverse, /*!< Send data to FlexIO with reverse order. */ - kSMARTDMA_RGB565To888, /*!< Convert RGB565 to RGB888 and save to output memory, use parameter - smartdma_rgb565_rgb888_param_t. */ - kSMARTDMA_FlexIO_DMA_RGB565To888, /*!< Convert RGB565 to RGB888 and send to FlexIO, use parameter - smartdma_flexio_mculcd_param_t. */ - kSMARTDMA_FlexIO_DMA_ARGB2RGB, /*!< Convert ARGB to RGB and send to FlexIO, use parameter - smartdma_flexio_mculcd_param_t. */ - kSMARTDMA_FlexIO_DMA_ARGB2RGB_Endian_Swap, /*!< Convert ARGB to RGB, then swap endian, and send to - FlexIO, use parameter smartdma_flexio_mculcd_param_t. */ - kSMARTDMA_FlexIO_DMA_ARGB2RGB_Endian_Swap_Reverse, /*!< Convert ARGB to RGB, then swap endian and reverse, and send - to FlexIO, use parameter smartdma_flexio_mculcd_param_t. */ - kSMARTDMA_MIPI_RGB565_DMA, /*!< Send RGB565 data to MIPI DSI, use parameter smartdma_dsi_param_t. */ - kSMARTDMA_MIPI_RGB565_DMA2D, /*!< Send RGB565 data to MIPI DSI, use parameter smartdma_dsi_2d_param_t. - */ - kSMARTDMA_MIPI_RGB888_DMA, /*!< Send RGB888 data to MIPI DSI, use parameter smartdma_dsi_param_t. */ - kSMARTDMA_MIPI_RGB888_DMA2D, /*!< Send RGB565 data to MIPI DSI, use parameter smartdma_dsi_2d_param_t. - */ - kSMARTDMA_MIPI_XRGB2RGB_DMA, /*!< Send XRGB8888 data to MIPI DSI, use parameter smartdma_dsi_param_t */ - kSMARTDMA_MIPI_XRGB2RGB_DMA2D, /*!< Send XRGB8888 data to MIPI DSI, use parameter - smartdma_dsi_2d_param_t. */ - kSMARTDMA_MIPI_RGB565_R180_DMA, /*!< Send RGB565 data to MIPI DSI, Rotate 180, use parameter - * smartdma_dsi_param_t. - */ - kSMARTDMA_MIPI_RGB888_R180_DMA, /*!< Send RGB888 data to MIPI DSI, Rotate 180, use parameter - * smartdma_dsi_param_t. - */ - kSMARTDMA_MIPI_XRGB2RGB_R180_DMA, /*!< Send XRGB8888 data to MIPI DSI, Rotate 180, use parameter - smartdma_dsi_param_t */ - kSMARTDMA_MIPI_RGB5652RGB888_DMA, /*!< Send RGB565 data to MIPI DSI, use parameter smartdma_dsi_param_t. - */ - kSMARTDMA_MIPI_RGB888_CHECKER_BOARD_DMA, /*!< Send RGB888 data to MIPI DSI with checker board pattern, - use parameter smartdma_dsi_checkerboard_param_t. */ - kSMARTDMA_MIPI_Enter_ULPS, /*!< Set MIPI-DSI to enter ultra low power state. */ - kSMARTDMA_MIPI_Exit_ULPS, /*!< Set MIPI-DSI to exit ultra low power state. */ - kSMARTDMA_FlexIO_DMA_ONELANE, /*!< FlexIO DMA for one SHIFTBUF, Write Data to SHIFTBUF[OFFSET] */ - kSMARTDMA_FlexIO_FIFO2RAM, /*!< Read data from FlexIO FIFO to ram space. */ -}; - -#elif (SMARTDMA_DISPLAY_FIRMWARE_SELECT == SMARTDMA_DISPLAY_MIPI_ONLY) - -/*! - * @brief The API index when using s_smartdmaDisplayFirmware. - */ -enum _smartdma_display_api -{ - kSMARTDMA_MIPI_RGB565_DMA, /*!< Send RGB565 data to MIPI DSI, use parameter smartdma_dsi_param_t. */ - kSMARTDMA_MIPI_RGB565_DMA2D, /*!< Send RGB565 data to MIPI DSI, use parameter smartdma_dsi_2d_param_t. - */ - kSMARTDMA_MIPI_RGB888_DMA, /*!< Send RGB888 data to MIPI DSI, use parameter smartdma_dsi_param_t. */ - kSMARTDMA_MIPI_RGB888_DMA2D, /*!< Send RGB565 data to MIPI DSI, use parameter smartdma_dsi_2d_param_t. - */ - kSMARTDMA_MIPI_XRGB2RGB_DMA, /*!< Send XRGB8888 data to MIPI DSI, use parameter smartdma_dsi_param_t */ - kSMARTDMA_MIPI_XRGB2RGB_DMA2D, /*!< Send XRGB8888 data to MIPI DSI, use parameter - smartdma_dsi_2d_param_t. */ - kSMARTDMA_MIPI_RGB565_R180_DMA, /*!< Send RGB565 data to MIPI DSI, Rotate 180, use parameter - * smartdma_dsi_param_t. - */ - kSMARTDMA_MIPI_RGB888_R180_DMA, /*!< Send RGB888 data to MIPI DSI, Rotate 180, use parameter - * smartdma_dsi_param_t. - */ - kSMARTDMA_MIPI_XRGB2RGB_R180_DMA, /*!< Send XRGB8888 data to MIPI DSI, Rotate 180, use parameter - smartdma_dsi_param_t */ - kSMARTDMA_MIPI_RGB5652RGB888_DMA, /*!< Send RGB565 data to MIPI DSI, use parameter smartdma_dsi_param_t. - */ - kSMARTDMA_MIPI_RGB888_CHECKER_BOARD_DMA, /*!< Send RGB888 data to MIPI DSI with checker board pattern, - use parameter smartdma_dsi_checkerboard_param_t. */ - kSMARTDMA_MIPI_Enter_ULPS, /*!< Set MIPI-DSI to enter ultra low power state. */ - kSMARTDMA_MIPI_Exit_ULPS, /*!< Set MIPI-DSI to exit ultra low power state. */ -}; - -#elif (SMARTDMA_DISPLAY_FIRMWARE_SELECT == SMARTDMA_DISPLAY_FLEXIO_ONLY) - -/*! - * @brief The API index when using s_smartdmaDisplayFirmware. - */ -enum _smartdma_display_api -{ - kSMARTDMA_FlexIO_DMA_Endian_Swap = 0U, - kSMARTDMA_FlexIO_DMA_Reverse32, - kSMARTDMA_FlexIO_DMA, - kSMARTDMA_FlexIO_DMA_Reverse, /*!< Send data to FlexIO with reverse order. */ - kSMARTDMA_FlexIO_DMA_RGB565To888, /*!< Convert RGB565 to RGB888 and send to FlexIO, use parameter - smartdma_flexio_mculcd_param_t. */ - kSMARTDMA_FlexIO_DMA_ARGB2RGB, /*!< Convert ARGB to RGB and send to FlexIO, use parameter - smartdma_flexio_mculcd_param_t. */ - kSMARTDMA_FlexIO_DMA_ARGB2RGB_Endian_Swap, /*!< Convert ARGB to RGB, then swap endian, and send to FlexIO, use - parameter smartdma_flexio_mculcd_param_t. */ - kSMARTDMA_FlexIO_DMA_ARGB2RGB_Endian_Swap_Reverse, /*!< Convert ARGB to RGB, then swap endian and reverse, and send - to FlexIO, use parameter smartdma_flexio_mculcd_param_t. */ - kSMARTDMA_FlexIO_DMA_ONELANE, /*!< FlexIO DMA for one SHIFTBUF, Write Data to SHIFTBUF[OFFSET] */ - kSMARTDMA_FlexIO_FIFO2RAM, /*!< Read data from FlexIO FIFO to ram space. */ -}; -#endif - -/*! - * @brief Parameter for FlexIO MCULCD except kSMARTDMA_FlexIO_DMA_ONELANE - */ -typedef struct _smartdma_flexio_mculcd_param -{ - uint32_t *p_buffer; - uint32_t buffersize; - uint32_t *smartdma_stack; -} smartdma_flexio_mculcd_param_t; - -/*! - * @brief Parameter for kSMARTDMA_FlexIO_DMA_ONELANE - */ -typedef struct _smartdma_flexio_onelane_mculcd_param -{ - uint32_t *p_buffer; - uint32_t buffersize; - uint32_t offset; - uint32_t *smartdma_stack; -} smartdma_flexio_onelane_mculcd_param_t; - -/*! - * @brief Parameter for MIPI DSI - */ -typedef struct _smartdma_dsi_param -{ - /*! Pointer to the buffer to send. */ - const uint8_t *p_buffer; - /*! Buffer size in byte. */ - uint32_t buffersize; - /*! Stack used by SMARTDMA. */ - uint32_t *smartdma_stack; - /*! - * If set to 1, the pixels are filled to MIPI DSI FIFO directly. - * If set to 0, the pixel bytes are swapped then filled to - * MIPI DSI FIFO. For example, when set to 0 and frame buffer pixel - * format is RGB565: - * LSB MSB - * B0 B1 B2 B3 B4 G0 G1 G2 | G3 G4 G5 R0 R1 R2 R3 R4 - * Then the pixel filled to DSI FIFO is: - * LSB MSB - * G3 G4 G5 R0 R1 R2 R3 R4 | B0 B1 B2 B3 B4 G0 G1 G2 - */ - uint32_t disablePixelByteSwap; -} smartdma_dsi_param_t; - -/*! - * @brief Parameter for kSMARTDMA_MIPI_RGB565_DMA2D, kSMARTDMA_MIPI_RGB888_DMA2D - * and kSMARTDMA_MIPI_XRGB2RGB_DMA2D. - */ -typedef struct _smartdma_dsi_2d_param -{ - /*! Pointer to the buffer to send. */ - const uint8_t *p_buffer; - /*! SRC data transfer in a minor loop */ - uint32_t minorLoop; - /*! SRC data offset added after a minor loop */ - uint32_t minorLoopOffset; - /*! SRC data transfer in a major loop */ - uint32_t majorLoop; - /*! Stack used by SMARTDMA. */ - uint32_t *smartdma_stack; - /*! - * If set to 1, the pixels are filled to MIPI DSI FIFO directly. - * If set to 0, the pixel bytes are swapped then filled to - * MIPI DSI FIFO. For example, when set to 0 and frame buffer pixel - * format is RGB565: - * LSB MSB - * B0 B1 B2 B3 B4 G0 G1 G2 | G3 G4 G5 R0 R1 R2 R3 R4 - * Then the pixel filled to DSI FIFO is: - * LSB MSB - * G3 G4 G5 R0 R1 R2 R3 R4 | B0 B1 B2 B3 B4 G0 G1 G2 - */ - uint32_t disablePixelByteSwap; -} smartdma_dsi_2d_param_t; - -/*! - * @brief Parameter for kSMARTDMA_MIPI_RGB888_CHECKER_BOARD_DMA - */ -typedef struct _smartdma_dsi_checkerboard_param -{ - /*! Pointer to the buffer to send, pixel format is ARGB8888. */ - const uint8_t *p_buffer; - uint32_t height; /*! Height resolution in pixel. */ - uint32_t width; /*! Width resolution in pixel. */ - /*! Cube block type. - * cbType=1 : 1/2 pixel mask cases - * cbType=2 : 1/4 pixel mask cases - */ - uint32_t cbType; - /*! which pixel is turned off in each type - * cbType=2: indexOff= 1,2,3,4 - * cbType=1: indexOff= 0,1 - */ - uint32_t indexOff; - /*! Stack used by SMARTDMA. */ - uint32_t *smartdma_stack; - /*! - * If set to 1, the pixels are filled to MIPI DSI FIFO directly. - * If set to 0, the pixel bytes are swapped then filled to - * MIPI DSI FIFO. For example, when set to 0 and frame buffer pixel - * for example - * format is RGB888: - * LSB MSB - * B0 B1 B2 B3 B4 B5 B6 B7 | G0 G1 G2 G3 G4 G5 G6 G7 | R0 R1 R2 R3 R4 R5 R6 R7 - * Then the pixel filled to DSI FIFO is: - * LSB MSB - * R0 R1 R2 R3 R4 R5 R6 R7 | G0 G1 G2 G3 G4 G5 G6 G7 | B0 B1 B2 B3 B4 B5 B6 B7 - */ - uint32_t disablePixelByteSwap; -} smartdma_dsi_checkerboard_param_t; - -/*! - * @brief Parameter for RGB565To888 - */ -typedef struct _smartdma_rgb565_rgb888_param -{ - uint32_t *inBuf; - uint32_t *outBuf; - uint32_t buffersize; - uint32_t *smartdma_stack; -} smartdma_rgb565_rgb888_param_t; - -/*! - * @brief Parameter for all supported APIs. - */ -typedef union -{ - /*! Parameter for flexio MCULCD. */ - smartdma_flexio_mculcd_param_t flexioMcuLcdParam; - /*! Parameter for flexio MCULCD with one shift buffer. */ - smartdma_flexio_onelane_mculcd_param_t flexioOneLineMcuLcdParam; - /*! Parameter for MIPI DSI functions. */ - smartdma_dsi_param_t dsiParam; - /*! Parameter for MIPI DSI 2D functions. */ - smartdma_dsi_2d_param_t dsi2DParam; - /*! Parameter for MIPI DSI checker board functions. */ - smartdma_dsi_checkerboard_param_t dsiCheckerBoardParam; - /*! Parameter for RGB565_RGB888 convertion. */ - smartdma_rgb565_rgb888_param_t rgb565_rgb888Param; -} smartdma_param_t; - -typedef struct -{ - uint8_t RESERVED_0[32]; - __IO uint32_t BOOTADR; /* 0x20 */ - __IO uint32_t CTRL; /* 0x24 */ - __I uint32_t PC; /* 0x28 */ - __I uint32_t SP; /* 0x2C */ - __IO uint32_t BREAK_ADDR; /* 0x30 */ - __IO uint32_t BREAK_VECT; /* 0x34 */ - __IO uint32_t EMER_VECT; /* 0x38 */ - __IO uint32_t EMER_SEL; /* 0x3C */ - __IO uint32_t ARM2EZH; /* 0x40 */ - __IO uint32_t EZH2ARM; /* 0x44 */ - __IO uint32_t PENDTRAP; /* 0x48 */ -} SMARTDMA_Type; - -#define SMARTDMA_BASE 0x40027000 -#define SMARTDMA ((volatile SMARTDMA_Type *)SMARTDMA_BASE) - -/******************************************************************************* - * APIs - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -#if defined(__cplusplus) -} -#endif - -/*! @} */ - -#endif /* FSL_SMARTDMA_RT500_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_spc.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_spc.c deleted file mode 100644 index c6a9b293262..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_spc.c +++ /dev/null @@ -1,1680 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_spc.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.mcx_spc" -#endif - -/* - * $Coverage Justification Reference$ - * - * $Justification spc_c_ref_1$ - * The SPC busy status flag is too short to get coverage data. - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Gets selected power domain's requested low power mode. - * - * param base SPC peripheral base address. - * param powerDomainId Power Domain Id, please refer to spc_power_domain_id_t. - * - * return The selected power domain's requested low power mode, please refer to spc_power_domain_low_power_mode_t. - */ -spc_power_domain_low_power_mode_t SPC_GetPowerDomainLowPowerMode(SPC_Type *base, spc_power_domain_id_t powerDomainId) -{ - assert((uint8_t)powerDomainId < SPC_PD_STATUS_COUNT); - - uint32_t val; - - val = ((base->PD_STATUS[(uint8_t)powerDomainId] & SPC_PD_STATUS_LP_MODE_MASK) >> SPC_PD_STATUS_LP_MODE_SHIFT); - return (spc_power_domain_low_power_mode_t)val; -} - -/*! - * brief Gets Isolation status for each power domains. - * - * This function gets the status which indicates whether certain - * peripheral and the IO pads are in a latched state as a result - * of having been in POWERDOWN mode. - * - * param base SPC peripheral base address. - * return Current isolation status for each power domains. - */ -uint8_t SPC_GetPeriphIOIsolationStatus(SPC_Type *base) -{ - uint32_t reg; - - reg = base->SC; - return (uint8_t)((reg & SPC_SC_ISO_CLR_MASK) >> SPC_SC_ISO_CLR_SHIFT); -} - -/*! - * brief Configs Low power request output pin. - * - * This function configs the low power request output pin - * - * param base SPC peripheral base address. - * param config Pointer the spc_LowPower_Request_config_t structure. - */ -void SPC_SetLowPowerRequestConfig(SPC_Type *base, const spc_lowpower_request_config_t *config) -{ - assert(config != NULL); - - uint32_t reg; - - reg = base->LPREQ_CFG; - reg &= ~(SPC_LPREQ_CFG_LPREQOE_MASK | SPC_LPREQ_CFG_LPREQPOL_MASK | SPC_LPREQ_CFG_LPREQOV_MASK); - - if (config->enable) - { - reg |= SPC_LPREQ_CFG_LPREQOE_MASK | SPC_LPREQ_CFG_LPREQPOL((uint8_t)(config->polarity)) | - SPC_LPREQ_CFG_LPREQOV((uint8_t)(config->override)); - } - else - { - reg &= ~SPC_LPREQ_CFG_LPREQOE_MASK; - } - - base->LPREQ_CFG = reg; -} - -#if !(defined(FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) && FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) -/*! - * brief Configures VDD Core Glitch detector, including ripple counter selection, timeout value and so on. - * - * param base SPC peripheral base address. - * param config Pointer to the structure in type of spc_vdd_core_glitch_detector_config_t. - */ -void SPC_ConfigVddCoreGlitchDetector(SPC_Type *base, const spc_vdd_core_glitch_detector_config_t *config) -{ - assert(config != NULL); - - uint32_t reg; - - reg = (base->VDD_CORE_GLITCH_DETECT_SC) & - ~(SPC_VDD_CORE_GLITCH_DETECT_SC_CNT_SELECT_MASK | SPC_VDD_CORE_GLITCH_DETECT_SC_TIMEOUT_MASK | - SPC_VDD_CORE_GLITCH_DETECT_SC_RE_MASK | SPC_VDD_CORE_GLITCH_DETECT_SC_IE_MASK); - - reg |= SPC_VDD_CORE_GLITCH_DETECT_SC_CNT_SELECT(config->rippleCounterSelect) | - SPC_VDD_CORE_GLITCH_DETECT_SC_TIMEOUT(config->resetTimeoutValue) | - SPC_VDD_CORE_GLITCH_DETECT_SC_RE(config->enableReset) | - SPC_VDD_CORE_GLITCH_DETECT_SC_IE(config->enableInterrupt); - - base->VDD_CORE_GLITCH_DETECT_SC = reg; -} -#endif - -/*! - * brief Set SRAM operate voltage. - * - * param base SPC peripheral base address. - * param config The pointer to spc_sram_voltage_config_t, specifies the configuration of sram voltage. - */ -void SPC_SetSRAMOperateVoltage(SPC_Type *base, const spc_sram_voltage_config_t *config) -{ - assert(config != NULL); - - uint32_t reg = 0UL; - - reg |= SPC_SRAMCTL_VSM(config->operateVoltage); - - base->SRAMCTL = reg; - - if (config->requestVoltageUpdate) - { - base->SRAMCTL |= SPC_SRAMCTL_REQ_MASK; - while ((base->SRAMCTL & SPC_SRAMCTL_ACK_MASK) == 0UL) - { - /* Wait until acknowledged */ - ; - } - base->SRAMCTL &= ~SPC_SRAMCTL_REQ_MASK; - } -} - -/*! - * brief Configs Bandgap mode in Active mode. - * - * @note To disable bandgap in Active mode: - * 1. Disable all LVD's and HVD's in active mode; - * 2. Disable Glitch detect; - * 3. Configrue LDO's and DCDC to low drive strength in active mode; - * 4. Invoke this function to disable bandgap in active mode; - * otherwise the error status will be reported. - * - * @note Some other system resources(such as PLL, CMP) require bandgap to be enabled, to disable bandgap please - * take care of other system resources. - * - * param base SPC peripheral base address. - * param mode The Bandgap mode be selected. - * - * retval kStatus_SPC_BandgapModeWrong The Bandgap can not be disabled in active mode. - * retval kStatus_Success Config Bandgap mode in Active power mode successful. - */ -status_t SPC_SetActiveModeBandgapModeConfig(SPC_Type *base, spc_bandgap_mode_t mode) -{ - uint32_t reg; - uint32_t state; - - reg = base->ACTIVE_CFG; - - if (mode == kSPC_BandgapDisabled) - { - state = SPC_GetActiveModeVoltageDetectStatus(base); - - /* If any of the LVD/HVDs are kept enabled, bandgap mode must be enabled with buffer disabled. */ - if (state != 0UL) - { - return kStatus_SPC_BandgapModeWrong; - } - - /* The bandgap mode must be enabled if any regulators' drive strength set as Normal. */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - if ((base->ACTIVE_CFG & SPC_ACTIVE_CFG_SYSLDO_VDD_DS_MASK) == - SPC_ACTIVE_CFG_SYSLDO_VDD_DS(kSPC_SysLDO_NormalDriveStrength)) - { - return kStatus_SPC_BandgapModeWrong; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - if ((base->ACTIVE_CFG & SPC_ACTIVE_CFG_DCDC_VDD_DS_MASK) == SPC_ACTIVE_CFG_DCDC_VDD_DS(kSPC_DCDC_NormalVoltage)) - { - return kStatus_SPC_BandgapModeWrong; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -#if !(defined(FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) && FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) - /* state of GLITCH_DETECT_DISABLE will be ignored if bandgap is disabled. */ - if ((base->ACTIVE_CFG & SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE_MASK) == 0UL) - { - return kStatus_SPC_BandgapModeWrong; - } -#endif -#if defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS - if ((base->ACTIVE_CFG & SPC_ACTIVE_CFG_CORELDO_VDD_DS_MASK) == - SPC_ACTIVE_CFG_CORELDO_VDD_DS(kSPC_CoreLDO_NormalDriveStrength)) - { - return kStatus_SPC_BandgapModeWrong; - } -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - } - - reg &= ~SPC_ACTIVE_CFG_BGMODE_MASK; - reg |= SPC_ACTIVE_CFG_BGMODE(mode); - - base->ACTIVE_CFG = reg; - - return kStatus_Success; -} - -/*! - * brief Configs Bandgap mode in Low Power mode. - * - * @note To disable Bandgap in Low-power mode: - * 1. Disable all LVD's ad HVD's in low power mode; - * 2. Disable Glitch detect in low power mode; - * 3. Configure LDO's and DCDC to low drive strength in low power mode; - * 4. Disable bandgap in low power mode; - * Otherwise, the error status will be reported. - * - * @note Some other system resources(such as PLL, CMP) require bandgap to be enabled, to disable bandgap please - * take care of other system resources. - * - * param base SPC peripheral base address. - * param mode The Bandgap mode be selected. - * - * retval kStatus_SPC_BandgapModeWrong The bandgap mode setting in Low Power mode is wrong. - * retval kStatus_Success Config Bandgap mode in Low Power power mode successful. - */ -status_t SPC_SetLowPowerModeBandgapmodeConfig(SPC_Type *base, spc_bandgap_mode_t mode) -{ - uint32_t reg; - uint32_t state; - - reg = base->LP_CFG; - - if (mode == kSPC_BandgapDisabled) - { - state = (uint32_t)SPC_GetLowPowerModeVoltageDetectStatus(base); - - /* If any of the LVD/HVDs are kept enabled, bandgap mode must be enabled with buffer disabled. */ - if (state != 0UL) - { - return kStatus_SPC_BandgapModeWrong; - } - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - if ((base->LP_CFG & SPC_LP_CFG_DCDC_VDD_DS_MASK) == SPC_LP_CFG_DCDC_VDD_DS(kSPC_DCDC_NormalDriveStrength)) - { - return kStatus_SPC_BandgapModeWrong; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - if ((base->LP_CFG & SPC_LP_CFG_SYSLDO_VDD_DS_MASK) == SPC_LP_CFG_SYSLDO_VDD_DS(kSPC_SysLDO_NormalDriveStrength)) - { - return kStatus_SPC_BandgapModeWrong; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - - if ((base->LP_CFG & SPC_LP_CFG_CORELDO_VDD_DS_MASK) == - SPC_LP_CFG_CORELDO_VDD_DS(kSPC_CoreLDO_NormalDriveStrength)) - { - return kStatus_SPC_BandgapModeWrong; - } - -#if !(defined(FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) && FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) - /* state of GLITCH_DETECT_DISABLE will be ignored if bandgap is disabled. */ - if ((base->LP_CFG & SPC_LP_CFG_GLITCH_DETECT_DISABLE_MASK) == 0UL) - { - return kStatus_SPC_BandgapModeWrong; - } -#endif - } - - reg &= ~SPC_LP_CFG_BGMODE_MASK; - reg |= SPC_LP_CFG_BGMODE(mode); - base->LP_CFG = reg; - - return kStatus_Success; -} - -/*! - * brief Configs CORE voltage detect options. - * - * This function configs CORE voltage detect options. - * Note: Setting both the voltage detect interrupt and reset - * enable will cause interrupt to be generated on exit from reset. - * If those conditioned is not desired, interrupt/reset only one is enabled. - * - * param base SPC peripheral base address. - * param config Pointer to spc_core_voltage_detect_config_t structure. - */ -void SPC_SetCoreVoltageDetectConfig(SPC_Type *base, const spc_core_voltage_detect_config_t *config) -{ - assert(config != NULL); - - uint32_t reg = 0UL; - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) - reg |= (config->option.HVDInterruptEnable) ? SPC_VD_CORE_CFG_HVDIE(1U) : SPC_VD_CORE_CFG_HVDIE(0U); - reg |= (config->option.HVDResetEnable) ? SPC_VD_CORE_CFG_HVDRE(1U) : SPC_VD_CORE_CFG_HVDRE(0U); -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD */ - reg |= (config->option.LVDInterruptEnable) ? SPC_VD_CORE_CFG_LVDIE(1U) : SPC_VD_CORE_CFG_LVDIE(0U); - reg |= (config->option.LVDResetEnable) ? SPC_VD_CORE_CFG_LVDRE(1U) : SPC_VD_CORE_CFG_LVDRE(0U); - - base->VD_CORE_CFG = reg; -} - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) -/*! - * brief Enables the Core High Voltage Detector in Active mode. - * - * note If the CORE_LDO high voltage detect is enabled in Active mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low. - * - * param base SPC peripheral base address. - * param enable Enable/Disable Core HVD. - * true - Enable Core High voltage detector in active mode. - * false - Disable Core High voltage detector in active mode. - * - * retval kStatus_Success Enable Core High Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeCoreHighVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_CORE_HVDE_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_CORE_HVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the Core High Voltage Detector in Low Power mode. - * - * note If the CORE_LDO high voltage detect is enabled in Low Power mode, - * please note that the bandgap must be enabled and the drive strength of each regulator - * must not set to low in low power mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable Core HVD. - * true - Enable Core High voltage detector in low power mode. - * false - Disable Core High voltage detector in low power mode. - * - * retval kStatus_Success Enable Core High Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeCoreHighVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_CORE_HVDE_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_CORE_HVDE_MASK; - } - - return status; -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD */ - -/*! - * brief Enables the Core VDD Low Voltage Detector in Active mode. - * - * note If the Core VDD high voltage detect is enabled in Active mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low. - * - * param base SPC peripheral base address. - * param enable Enable/Disable Core LVD. - * true - Enable Core Low voltage detector in active mode. - * false - Disable Core Low voltage detector in active mode. - * - * retval kStatus_Success Enable Core Low Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeCoreLowVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_CORE_LVDE_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_CORE_LVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the Core Low Voltage Detector in Low Power mode. - * - * note If the Core VDD low voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Low Power mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable Core HVD. - * true - Enable Core Low voltage detector in low power mode. - * false - Disable Core Low voltage detector in low power mode. - * - * retval kStatus_Success Enable Core Low Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeCoreLowVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_CORE_LVDE_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_CORE_LVDE_MASK; - } - - return status; -} - -/*! - * brief Set system VDD Low-voltage level selection. - * - * This function selects the system VDD low-voltage level. Changing system VDD low-voltage level - * must be done after disabling the System VDD low voltage reset and interrupt. - * - * @deprecated In latest RM, reserved for all devices, will removed in next release. - * - * param base SPC peripheral base address. - * param level System VDD Low-Voltage level selection. See @ref spc_low_voltage_level_select_t for details. - */ -void SPC_SetSystemVDDLowVoltageLevel(SPC_Type *base, spc_low_voltage_level_select_t level) -{ - (void)level; - (void)base; - - /* - uint32_t reg; - - reg = base->VD_SYS_CFG; - - base->VD_SYS_CFG &= ~(SPC_VD_SYS_CFG_LVDRE_MASK | SPC_VD_SYS_CFG_LVDIE_MASK); - reg |= SPC_VD_SYS_CFG_LVSEL(level); - - base->VD_SYS_CFG = reg; */ -} - -/*! - * brief Configs SYS VDD voltage detect options. - * - * This function config SYS voltage detect options. - * Note: Setting both the voltage detect interrupt and reset - * enable will cause interrupt to be generated on exit from reset. - * If those conditioned is not desired, interrupt/reset only one is enabled. - * - * param base SPC peripheral base address. - * param config Pointer to spc_system_voltage_detect_config_t structure. - */ -void SPC_SetSystemVoltageDetectConfig(SPC_Type *base, const spc_system_voltage_detect_config_t *config) -{ - assert(config != NULL); - - uint32_t reg = 0UL; - - reg |= (config->option.HVDInterruptEnable) ? SPC_VD_SYS_CFG_HVDIE(1U) : SPC_VD_SYS_CFG_HVDIE(0U); - reg |= (config->option.LVDInterruptEnable) ? SPC_VD_SYS_CFG_LVDIE(1U) : SPC_VD_SYS_CFG_LVDIE(0U); - reg |= (config->option.HVDResetEnable) ? SPC_VD_SYS_CFG_HVDRE(1U) : SPC_VD_SYS_CFG_HVDRE(0U); - reg |= (config->option.LVDResetEnable) ? SPC_VD_SYS_CFG_LVDRE(1U) : SPC_VD_SYS_CFG_LVDRE(0U); - - base->VD_SYS_CFG = reg; - - (void)(config->level); - /* SPC_SetSystemVDDLowVoltageLevel(base, config->level); */ -} - -/*! - * brief Enables the System VDD High Voltage Detector in Active mode. - * - * note If the System_LDO high voltage detect is enabled in Active mode, - * please note that the bandgap must be enabled and the drive strength of - * each regulator must not set to low in Active mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable System HVD. - * true - Enable System High voltage detector in active mode. - * false - Disable System High voltage detector in active mode. - * - * retval kStatus_Success Enable System High Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeSystemHighVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_SYS_HVDE_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_SYS_HVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the System VDD Low Voltage Detector in Active mode. - * - * note If the System_LDO low voltage detect is enabled in Active mode, - * please note that the bandgap must be enabled and the drive strength of each - * regulator must not set to low in Active mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable System LVD. - * true - Enable System Low voltage detector in active mode. - * false - Disable System Low voltage detector in active mode. - * - * retval kStatus_Success Enable the System Low Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeSystemLowVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_SYS_LVDE_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_SYS_LVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the System VDD High Voltage Detector in Low Power mode. - * - * note If the System_LDO high voltage detect is enabled in low power mode, - * please note that the bandgap must be enabled and the drive strength of each - * regulator must not set to low in low power mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable System HVD. - * true - Enable System High voltage detector in low power mode. - * false - Disable System High voltage detector in low power mode. - * - * retval kStatus_Success Enable System High Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeSystemHighVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_SYS_HVDE_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_SYS_HVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the System VDD Low Voltage Detector in Low Power mode. - * - * note If the System_LDO low voltage detect is enabled in Low Power mode, - * please note that the bandgap must be enabled and the drive strength of each - * regulator must not set to low in Low Power mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable System HVD. - * true - Enable System Low voltage detector in low power mode. - * false - Disable System Low voltage detector in low power mode. - * - * retval kStatus_Success Enable System Low Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeSystemLowVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_SYS_LVDE_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_SYS_LVDE_MASK; - } - - return status; -} - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) && FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) -/*! - * brief Set IO VDD Low-Voltage level selection. - * - * This function selects the IO VDD Low-voltage level. Changing IO VDD low-voltage level - * must be done after disabling the IO VDD low voltage reset and interrupt. - * - * param base SPC peripheral base address. - * param level IO VDD Low-voltage level selection. - */ -void SPC_SetIOVDDLowVoltageLevel(SPC_Type *base, spc_low_voltage_level_select_t level) -{ - uint32_t reg; - - reg = base->VD_IO_CFG; - - base->VD_IO_CFG &= ~(SPC_VD_IO_CFG_LVDRE_MASK | SPC_VD_IO_CFG_LVDIE_MASK | SPC_VD_IO_CFG_LVSEL_MASK); - reg |= SPC_VD_IO_CFG_LVSEL(level); - - base->VD_IO_CFG = reg; -} - -/*! - * brief Configs IO VDD voltage detect options. - * - * This function config IO voltage detect options. - * Note: Setting both the voltage detect interrupt and reset - * enable will cause interrupt to be generated on exit from reset. - * If those conditioned is not desired, interrupt/reset so only one is enabled. - * - * param base SPC peripheral base address. - * param config Pointer to spc_IO_voltage_detect_config_t structure. - */ -void SPC_SetIOVoltageDetectConfig(SPC_Type *base, const spc_io_voltage_detect_config_t *config) -{ - assert(config != NULL); - - uint32_t reg = 0UL; - - /* Set trip voltage level. */ - SPC_SetIOVDDLowVoltageLevel(base, config->level); - - reg = base->VD_IO_CFG; - reg &= ~(SPC_VD_IO_CFG_LVDRE_MASK | SPC_VD_IO_CFG_LVDIE_MASK | SPC_VD_IO_CFG_HVDRE_MASK | SPC_VD_IO_CFG_HVDIE_MASK); - - reg |= (config->option.HVDInterruptEnable) ? SPC_VD_IO_CFG_HVDIE(1U) : SPC_VD_IO_CFG_HVDIE(0U); - reg |= (config->option.LVDInterruptEnable) ? SPC_VD_IO_CFG_LVDIE(1U) : SPC_VD_IO_CFG_LVDIE(0U); - reg |= (config->option.HVDResetEnable) ? SPC_VD_IO_CFG_HVDRE(1U) : SPC_VD_IO_CFG_HVDRE(0U); - reg |= (config->option.LVDResetEnable) ? SPC_VD_IO_CFG_LVDRE(1U) : SPC_VD_IO_CFG_LVDRE(0U); - - base->VD_IO_CFG = reg; -} - -/*! - * brief Enables the IO VDD High Voltage Detector in Active mode. - * - * note If the IO high voltage detect is enabled in Active mode, - * please note that the bandgap must be enabled and the drive strength - * of each regulator must not set to low in Active mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable IO HVD. - * true - Enable IO High voltage detector in active mode. - * false - Disable IO High voltage detector in active mode. - * - * retval kStatus_Success Enable IO High Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeIOHighVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_IO_HVDE_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_IO_HVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the IO VDD Low Voltage Detector in Active mode. - * - * note If the IO low voltage detect is enabled in Active mode, - * please note that the bandgap must be enabled and the drive strength - * of each regulator must not set to low in Active mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable IO LVD. - * true - Enable IO Low voltage detector in active mode. - * false - Disable IO Low voltage detector in active mode. - * - * retval kStatus_Success Enable IO Low Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeIOLowVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_IO_LVDE_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_IO_LVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the IO VDD High Voltage Detector in Low Power mode. - * - * note If the IO high voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Low Power mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable IO HVD. - * true - Enable IO High voltage detector in low power mode. - * false - Disable IO High voltage detector in low power mode. - * - * retval kStatus_Success Enable IO High Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeIOHighVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_IO_HVDE_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_IO_HVDE_MASK; - } - - return status; -} - -/*! - * brief Enables the IO VDD Low Voltage Detector in Low Power mode. - * - * note If the IO low voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Low Power mode. - * - * param base SPC peripheral base address. - * param enable Enable/Disable IO HVD. - * true - Enable IO Low voltage detector in low power mode. - * false - Disable IO Low voltage detector in low power mode. - * - * retval kStatus_Success Enable IO Low Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeIOLowVoltageDetect(SPC_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_IO_LVDE_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_IO_LVDE_MASK; - } - - return status; -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD */ - -/*! - * brief Configs external voltage domains - * - * This function configs external voltage domains isolation. - * - * param base SPC peripheral base address. - * param lowPowerIsoMask The mask of external domains isolate enable during low power mode. - * param IsoMask The mask of external domains isolate. - */ -void SPC_SetExternalVoltageDomainsConfig(SPC_Type *base, uint8_t lowPowerIsoMask, uint8_t IsoMask) -{ - uint32_t reg = 0UL; - - reg |= SPC_EVD_CFG_REG_EVDISO(IsoMask) | SPC_EVD_CFG_REG_EVDLPISO(lowPowerIsoMask); - base->EVD_CFG = reg; -} - -/*! - * brief Configs Core LDO Regulator in Active mode. - * - * @note The bandgap must be enabled before invoking this function. - * @note To set Core LDO as low drive strength, all HVDs/LVDs must be disabled previously. - * - * param base SPC peripheral base address. - * param option Pointer to the spc_active_mode_Core_LDO_option_t structure. - * - * retval kStatus_Success Config Core LDO regulator in Active power mode successful. - * retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * retval kStatus_SPC_BandgapModeWrong Bandgap should be enabled before invoking this function. - * retval kStatus_SPC_CORELDOLowDriveStrengthIgnore To set Core LDO as low drive strength, - * all LVDs/HVDs must be disabled before invoking this function. - */ -status_t SPC_SetActiveModeCoreLDORegulatorConfig(SPC_Type *base, const spc_active_mode_core_ldo_option_t *option) -{ - assert(option != NULL); - - if ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - return kStatus_SPC_Busy; - } - - /* Check input parameters. */ - /* 1. Bandgap must not be disabled. */ - if (SPC_GetActiveModeBandgapMode(base) == kSPC_BandgapDisabled) - { - return kStatus_SPC_BandgapModeWrong; - } - - /* 2. To set to low drive strength, all LVDs/HVDs must be disabled previously. */ - if ((SPC_GetActiveModeVoltageDetectStatus(base) != 0UL) && - (option->CoreLDODriveStrength == kSPC_CoreLDO_LowDriveStrength)) - { - return kStatus_SPC_CORELDOLowDriveStrengthIgnore; - } - - if ((uint8_t)SPC_GetActiveModeCoreLDOVDDVoltageLevel(base) != (uint8_t)(option->CoreLDOVoltage)) - { -#if defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS - (void)SPC_SetActiveModeCoreLDORegulatorDriveStrength(base, kSPC_CoreLDO_NormalDriveStrength); -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - (void)SPC_SetActiveModeCoreLDORegulatorVoltageLevel(base, option->CoreLDOVoltage); - } - -#if defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS - (void)SPC_SetActiveModeCoreLDORegulatorDriveStrength(base, option->CoreLDODriveStrength); -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - - return kStatus_Success; -} - -/*! - * brief Set Core LDO VDD Regulator Voltage level in Active mode. - * - * @note In active mode, the Core LDO voltage level should only be changed when the - * Core LDO is in normal drive strength. - * - * @note Update Core LDO voltage level will set Busy flag, - * this function return only when busy flag is cleared by hardware - * - * param base SPC peripheral base address. - * param voltageLevel Specify the voltage level of CORE LDO Regulator in Active mode, please - refer to @ref spc_core_ldo_voltage_level_t. - * - * retval kStatus_SPC_CORELDOVoltageSetFail Core LDO voltage level should only be - * changed when the CORE_LDO is in normal drive strength. - * retval kStatus_Success Set Core LDO regulator voltage level in Active power mode successful. - */ -status_t SPC_SetActiveModeCoreLDORegulatorVoltageLevel(SPC_Type *base, spc_core_ldo_voltage_level_t voltageLevel) -{ - if ((uint8_t)voltageLevel != (uint8_t)SPC_GetActiveModeCoreLDOVDDVoltageLevel(base)) - { -#if (defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) - if (SPC_GetActiveModeCoreLDODriveStrength(base) != kSPC_CoreLDO_NormalDriveStrength) - { - return kStatus_SPC_CORELDOVoltageSetFail; - } -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - - base->ACTIVE_CFG = - ((base->ACTIVE_CFG & ~SPC_ACTIVE_CFG_CORELDO_VDD_LVL_MASK) | SPC_ACTIVE_CFG_CORELDO_VDD_LVL(voltageLevel)); - - /* - * $Branch Coverage Justification$ - * $ref spc_c_ref_1$. - */ - while ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - } - } - return kStatus_Success; -} - -#if defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS -/*! - * brief Set Core LDO VDD Regulator Drive Strength in Active mode. - * - * param base SPC peripheral base address. - * param driveStrength Specify the drive strength of CORE LDO Regulator in Active mode, please - refer to @ref spc_core_ldo_drive_strength_t. - * - * retval #kStatus_Success Set Core LDO regulator drive strength in Active power mode successful. - * retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore If any voltage detect enabled, - core_ldo's drive strength can not set to low. - * retval #kStatus_SPC_BandgapModeWrong The selected bandgap mode is not allowed. - */ -status_t SPC_SetActiveModeCoreLDORegulatorDriveStrength(SPC_Type *base, spc_core_ldo_drive_strength_t driveStrength) -{ - if (driveStrength == kSPC_CoreLDO_LowDriveStrength) - { - /* If any voltage detect feature is enabled in Active mode, then CORE_LDO's drive strength must not set to low. - */ - if (SPC_GetActiveModeVoltageDetectStatus(base) != 0UL) - { - return kStatus_SPC_CORELDOLowDriveStrengthIgnore; - } - } - - if (driveStrength == kSPC_CoreLDO_NormalDriveStrength) - { - /* If specify normal drive strength, bandgap must not be disabled. */ - if (SPC_GetActiveModeBandgapMode(base) == kSPC_BandgapDisabled) - { - return kStatus_SPC_BandgapModeWrong; - } - } - - base->ACTIVE_CFG = - ((base->ACTIVE_CFG & ~SPC_ACTIVE_CFG_CORELDO_VDD_DS_MASK) | SPC_ACTIVE_CFG_CORELDO_VDD_DS(driveStrength)); - - return kStatus_Success; -} -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - -/*! - * brief Configs CORE LDO Regulator in low power mode - * - * This function configs CORE LDO Regulator in Low Power mode. - * If CORE LDO VDD Drive Strength is set to Normal, the CORE LDO VDD regulator voltage - * level in Active mode must be equal to the voltage level in Low power mode. And the Bandgap - * must be programmed to select bandgap enabled. - * Core VDD voltage levels for the Core LDO low power regulator can only be changed when the CORE - * LDO Drive Strength is set as Normal. - * - * param base SPC peripheral base address. - * param option Pointer to the spc_lowpower_mode_Core_LDO_option_t structure. - * retval kStatus_Success Config Core LDO regulator in power mode successfully. - * retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * retval kStatus_SPC_CORELDOLowDriveStrengthIgnore HVDs/LVDs are not disabled before invoking this function. - * retval kStatus_SPC_BandgapModeWrong The bandgap is not enabled before invoking this function. - */ -status_t SPC_SetLowPowerModeCoreLDORegulatorConfig(SPC_Type *base, const spc_lowpower_mode_core_ldo_option_t *option) -{ - status_t status = kStatus_Success; - - if ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - /* - * $Line Coverage Justification$ - * $ref spc_c_ref_1$. - */ - return kStatus_SPC_Busy; - } - - status = SPC_SetLowPowerModeCoreLDORegulatorDriveStrength(base, option->CoreLDODriveStrength); - if (status == kStatus_Success) - { - (void)SPC_SetLowPowerModeCoreLDORegulatorVoltageLevel(base, option->CoreLDOVoltage); - } - - return status; -} - -/*! - * brief Set Core LDO VDD Regulator Voltage level in Low power mode. - * - * @note If Core LDO's drive strengths are same in active and low power mode, the Core LDO's voltage must be set to the - * same value in active and low power mode. Application should take care of this limitation. - * - * @note Some devices require Core LDO and DCDC have the same voltage level even if Core LDO is off. Application should - * take care of this limitation. - * - * param base SPC peripheral base address. - * param voltageLevel Voltage level of CORE LDO Regulator in Low power mode, please - refer to @ref spc_core_ldo_voltage_level_t. - * - * retval #kStatus_SPC_Busy The SPC instance is busy to execute other operation. - * retval #kStatus_Success Set Core LDO regulator voltage level in Low power mode successful. - */ -status_t SPC_SetLowPowerModeCoreLDORegulatorVoltageLevel(SPC_Type *base, spc_core_ldo_voltage_level_t voltageLevel) -{ - if ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - /* - * $Line Coverage Justification$ - * $ref spc_c_ref_1$. - */ - return kStatus_SPC_Busy; - } - - base->LP_CFG = ((base->LP_CFG & ~SPC_LP_CFG_CORELDO_VDD_LVL_MASK) | SPC_LP_CFG_CORELDO_VDD_LVL(voltageLevel)); - - /* - * $Branch Coverage Justification$ - * $ref spc_c_ref_1$. - */ - while ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - } - - return kStatus_Success; -} - -/*! - * brief Set Core LDO VDD Regulator Drive Strength in Low power mode. - * - * param base SPC peripheral base address. - * param driveStrength Specify drive strength of CORE LDO in low power mode. - * - * retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore Some voltage detect enabled, CORE LDO's drive strength can not set - * as low. - * retval #kStatus_Success Set Core LDO regulator drive strength in Low power mode successful. - * retval #kStatus_SPC_BandgapModeWrong Bandgap is disabled when attempt to set CORE LDO work as normal drive strength. - */ -status_t SPC_SetLowPowerModeCoreLDORegulatorDriveStrength(SPC_Type *base, spc_core_ldo_drive_strength_t driveStrength) -{ - if (driveStrength == kSPC_CoreLDO_LowDriveStrength) - { - /* If any voltage detect feature is enabled in Low Power mode, then CORE_LDO's drive strength must not set to - * low. - */ - if (SPC_GetLowPowerModeVoltageDetectStatus(base) != 0UL) - { - return kStatus_SPC_CORELDOLowDriveStrengthIgnore; - } - } - else - { - /* To specify normal drive strength, the bandgap must be enabled in low power mode. */ - if (SPC_GetLowPowerModeBandgapMode(base) == kSPC_BandgapDisabled) - { - return kStatus_SPC_BandgapModeWrong; - } - } - - base->LP_CFG = ((base->LP_CFG & ~SPC_LP_CFG_CORELDO_VDD_DS_MASK) | SPC_LP_CFG_CORELDO_VDD_DS(driveStrength)); - - return kStatus_Success; -} - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) -/*! - * brief Configs System LDO VDD Regulator in Active mode. - * - * This function configs System LDO VDD Regulator in Active mode. - * If System LDO VDD Drive Strength is set to Normal, the Bandgap mode in Active mode must be programmed - * to a value that enable the bandgap. - * If any voltage detects are kept enabled, configuration to set System LDO VDD drive strength to low will - * be ignored. - * If select System LDO VDD Regulator voltage level to Over Drive Voltage, the Drive Strength of System LDO VDD - * Regulator must be set to Normal otherwise the regulator Drive Strength will be forced to Normal. - * If select System LDO VDD Regulator voltage level to Over Drive Voltage, the High voltage detect must be disabled. - * Otherwise it will be fail to regulator to Over Drive Voltage. - * - * param base SPC peripheral base address. - * param option Pointer to the spc_active_mode_Sys_LDO_option_t structure. - * retval kStatus_Success Config System LDO regulator in Active power mode successful. - * retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * retval kStatus_SPC_BandgapModeWrong The bandgap is not enabled before invoking this function. - * retval kStatus_SPC_SYSLDOOverDriveVoltageFail HVD of System VDD is not disable before setting to Over Drive voltage. - * retval kStatus_SPC_SYSLDOLowDriveStrengthIgnore Set System LDO VDD regulator's driver strength to Low will be - * ignored. - */ -status_t SPC_SetActiveModeSystemLDORegulatorConfig(SPC_Type *base, const spc_active_mode_sys_ldo_option_t *option) -{ - assert(option != NULL); - - if ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - /* - * $Line Coverage Justification$ - * $ref spc_c_ref_1$. - */ - return kStatus_SPC_Busy; - } - - /* Check input parameters before setting registers. */ - /* 1. To set to low DS, all LVDs/HVDs must be disabled previously. */ - if ((SPC_GetActiveModeVoltageDetectStatus(base) != 0UL) && - (option->SysLDODriveStrength == kSPC_SysLDO_LowDriveStrength)) - { - return kStatus_SPC_SYSLDOLowDriveStrengthIgnore; - } - /* 2. If specify normal drive strength, bandgap must not be disabled. */ - if ((SPC_GetActiveModeBandgapMode(base) == kSPC_BandgapDisabled) && - (option->SysLDODriveStrength == kSPC_SysLDO_NormalDriveStrength)) - { - return kStatus_SPC_BandgapModeWrong; - } - - /* 3. Must disable system LDO high voltage detector before specifing overdrive voltage. */ - if ((option->SysLDOVoltage == kSPC_SysLDO_OverDriveVoltage) && - ((SPC_GetActiveModeVoltageDetectStatus(base) & SPC_ACTIVE_CFG_SYS_HVDE_MASK) != 0UL)) - { - return kStatus_SPC_SYSLDOOverDriveVoltageFail; - } - - (void)SPC_SetActiveModeSystemLDORegulatorDriveStrength(base, option->SysLDODriveStrength); - (void)SPC_SetActiveModeSystemLDORegulatorVoltageLevel(base, option->SysLDOVoltage); - - return kStatus_Success; -} - -/*! - * brief Set System LDO Regulator voltage level in Active mode. - * - * @note The system LDO regulator can only operate at the overdrive voltage level for a limited amount of time for the - * life of chip. - * - * param base SPC peripheral base address. - * param voltageLevel Specify the voltage level of System LDO Regulator in Active mode. - * - * retval #kStatus_Success Set System LDO Regulator voltage level in Active mode successfully. - * retval #kStatus_SPC_SYSLDOOverDriveVoltageFail Must disable system LDO high voltage detector before specifing - * overdrive voltage. - */ -status_t SPC_SetActiveModeSystemLDORegulatorVoltageLevel(SPC_Type *base, spc_sys_ldo_voltage_level_t voltageLevel) -{ - if (voltageLevel == kSPC_SysLDO_OverDriveVoltage) - { - /* Must disable system LDO high voltage detector before specifing overdrive voltage. */ - if ((SPC_GetActiveModeVoltageDetectStatus(base) & SPC_ACTIVE_CFG_SYS_HVDE_MASK) != 0UL) - { - return kStatus_SPC_SYSLDOOverDriveVoltageFail; - } - } - - base->ACTIVE_CFG = - (base->ACTIVE_CFG & ~SPC_ACTIVE_CFG_SYSLDO_VDD_LVL_MASK) | SPC_ACTIVE_CFG_SYSLDO_VDD_LVL(voltageLevel); - - return kStatus_Success; -} - -/*! - * brief Set System LDO Regulator Drive Strength in Active mode. - * - * param base SPC peripheral base address. - * param driveStrength Specify the drive strength of System LDO Regulator in Active mode. - * - * retval #kStatus_Success Set System LDO Regulator drive strength in Active mode successfully. - * retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Attempt to specify low drive strength is ignored due to any - voltage detect feature is enabled in active mode. - * retval #kStatus_SPC_BandgapModeWrong Bandgap mode in Active mode must be programmed to a value that enables - the bandgap if attempt to specify normal drive strength. - */ -status_t SPC_SetActiveModeSystemLDORegulatorDriveStrength(SPC_Type *base, spc_sys_ldo_drive_strength_t driveStrength) -{ - if (driveStrength == kSPC_SysLDO_LowDriveStrength) - { - /* If enabled any LVDs or HVDs, SPC will ignore the attempt to specify low drive strength. */ - if (SPC_GetActiveModeVoltageDetectStatus(base) != 0UL) - { - return kStatus_SPC_SYSLDOLowDriveStrengthIgnore; - } - } - - if (driveStrength == kSPC_SysLDO_NormalDriveStrength) - { - /* If specify normal drive strength, bandgap must not be disabled. */ - if (SPC_GetActiveModeBandgapMode(base) == kSPC_BandgapDisabled) - { - return kStatus_SPC_BandgapModeWrong; - } - } - - base->ACTIVE_CFG = - (base->ACTIVE_CFG & ~SPC_ACTIVE_CFG_SYSLDO_VDD_DS_MASK) | SPC_ACTIVE_CFG_SYSLDO_VDD_DS(driveStrength); - - return kStatus_Success; -} - -/*! - * brief Configs System LDO regulator in low power modes. - * - * This function configs System LDO regulator in low power modes. - * If System LDO VDD Regulator Drive strength is set to normal, bandgap mode in low power - * mode must be programmed to a value that enables the Bandgap. - * If any High voltage detectors or Low Voltage detectors are kept enabled, configuration - * to set System LDO Regulator drive strength as Low will be ignored. - * - * param base SPC peripheral base address. - * param option Pointer to spc_lowpower_mode_Sys_LDO_option_t structure. - * - * retval kStatus_Success Config System LDO regulator in Low Power Mode successfully. - * retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * retval kStatus_SPC_BandgapModeWrong The bandgap mode setting in Low Power Mode is wrong. - * retval kStatus_SPC_SYSLDOLowDriveStrengthIgnore Set driver strength to low will be ignored. - */ -status_t SPC_SetLowPowerModeSystemLDORegulatorConfig(SPC_Type *base, const spc_lowpower_mode_sys_ldo_option_t *option) -{ - status_t status; - - if ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - /* - * $Line Coverage Justification$ - * $ref spc_c_ref_1$. - */ - return kStatus_SPC_Busy; - } - - status = SPC_SetLowPowerModeSystemLDORegulatorDriveStrength(base, option->SysLDODriveStrength); - - return status; -} - -/*! - * brief Set System LDO Regulator drive strength in Low Power Mode. - * - * param base SPC peripheral base address. - * param driveStrength Specify the drive strength of System LDO Regulator in Low Power Mode. - * - * retval #kStatus_Success Set System LDO Regulator drive strength in Low Power Mode successfully. - * retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Attempt to specify low drive strength is ignored due to any - voltage detect feature is enabled in low power mode. - * retval #kStatus_SPC_BandgapModeWrong Bandgap mode in low power mode must be programmed to a value that enables - the bandgap if attempt to specify normal drive strength. - */ -status_t SPC_SetLowPowerModeSystemLDORegulatorDriveStrength(SPC_Type *base, spc_sys_ldo_drive_strength_t driveStrength) -{ - if (driveStrength == kSPC_SysLDO_LowDriveStrength) - { - /* If enabled any LVDs or HVDs, SPC will ignore the attempt to specify low drive strength. */ - if (SPC_GetLowPowerModeVoltageDetectStatus(base) != 0UL) - { - return kStatus_SPC_SYSLDOLowDriveStrengthIgnore; - } - } - else - { - /* If specify normal drive strength, bandgap must not be disabled. */ - if (SPC_GetLowPowerModeBandgapMode(base) == kSPC_BandgapDisabled) - { - return kStatus_SPC_BandgapModeWrong; - } - } - - base->LP_CFG = (base->LP_CFG & ~SPC_LP_CFG_SYSLDO_VDD_DS_MASK) | SPC_LP_CFG_SYSLDO_VDD_DS(driveStrength); - - return kStatus_Success; -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) -/*! - * brief Configs DCDC VDD Regulator in Active mode. - * - * note When changing the DCDC output voltage level, take care to change the CORE LDO voltage level. - * - * param base SPC peripheral base address. - * param option Pointer to the spc_active_mode_DCDC_option_t structure. - * - * retval kStatus_Success Config DCDC regulator in Active power mode successful. - * retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * retval kStatus_SPC_BandgapModeWrong The bandgap mode setting in Active mode is wrong. - */ -status_t SPC_SetActiveModeDCDCRegulatorConfig(SPC_Type *base, const spc_active_mode_dcdc_option_t *option) -{ - assert(option != NULL); - status_t status = kStatus_Success; - - if ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - /* - * $Line Coverage Justification$ - * $ref spc_c_ref_1$. - */ - return kStatus_SPC_Busy; - } - - status = SPC_SetActiveModeDCDCRegulatorDriveStrength(base, option->DCDCDriveStrength); - - if (status == kStatus_Success) - { - SPC_SetActiveModeDCDCRegulatorVoltageLevel(base, option->DCDCVoltage); - } - - /* - * $Branch Coverage Justification$ - * $ref spc_c_ref_1$. - */ - while ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - } - - return status; -} - -/*! - * brief Set DCDC VDD Regulator drive strength in Active mode. - * - * note To set DCDC drive strength as Normal, the bandgap must be enabled. - * - * param base SPC peripheral base address. - * param driveStrength Specify the DCDC VDD regulator drive strength, please refer to @ref spc_dcdc_drive_strength_t. - * - * retval #kStatus_Success Set DCDC VDD Regulator drive strength in Active mode successfully. - * retval #kStatus_SPC_BandgapModeWrong Set DCDC VDD Regulator drive strength to Normal, the Bandgap must be enabled. - */ -status_t SPC_SetActiveModeDCDCRegulatorDriveStrength(SPC_Type *base, spc_dcdc_drive_strength_t driveStrength) -{ - if (driveStrength == kSPC_DCDC_NormalDriveStrength) - { - /* If specify normal drive strength, bandgap must not be disabled. */ - if (SPC_GetActiveModeBandgapMode(base) == kSPC_BandgapDisabled) - { - return kStatus_SPC_BandgapModeWrong; - } - } - - base->ACTIVE_CFG = - ((base->ACTIVE_CFG) & (~SPC_ACTIVE_CFG_DCDC_VDD_DS_MASK)) | SPC_ACTIVE_CFG_DCDC_VDD_DS(driveStrength); - - return kStatus_Success; -} - -/*! - * brief Configs DCDC VDD Regulator in Low power modes. - * - * If DCDC VDD Drive Strength is set to Normal, the Bandgap mode in Low Power mode must be programmed - * to a value that enables the Bandgap. - * In Deep Power Down mode, DCDC regulator is always turned off. - * - * param base SPC peripheral base address. - * param option Pointer to the spc_lowpower_mode_DCDC_option_t structure. - * - * retval kStatus_Success Config DCDC regulator in low power mode successfully. - * retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * retval kStatus_SPC_BandgapModeWrong The bandgap should be enabled before invoking this function. - */ -status_t SPC_SetLowPowerModeDCDCRegulatorConfig(SPC_Type *base, const spc_lowpower_mode_dcdc_option_t *option) -{ - if ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - /* - * $Line Coverage Justification$ - * $ref spc_c_ref_1$. - */ - return kStatus_SPC_Busy; - } - - /* Check input parameter before setting registers. */ - if ((option->DCDCDriveStrength == kSPC_DCDC_NormalDriveStrength) && - (SPC_GetLowPowerModeBandgapMode(base) == kSPC_BandgapDisabled)) - { - return kStatus_SPC_BandgapModeWrong; - } - - /* - 1. Configure to desired voltage level. - 2. Change to low drive strength. - 3. Configure same voltage level in active mode. - */ - SPC_SetLowPowerModeDCDCRegulatorVoltageLevel(base, option->DCDCVoltage); - - /* Change to desired drive strength. */ - if (option->DCDCDriveStrength != kSPC_DCDC_LowDriveStrength) - { - (void)SPC_SetLowPowerModeDCDCRegulatorDriveStrength(base, option->DCDCDriveStrength); - } - - /* - * $Branch Coverage Justification$ - * $ref spc_c_ref_1$. - */ - while ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - } - - return kStatus_Success; -} - -/*! - * brief Set DCDC VDD Regulator drive strength in Low power mode. - * - * param base SPC peripheral base address. - * param driveStrength Specify the DCDC VDD Regulator drive strength, please refer to @ref spc_dcdc_drive_strength_t. - * - * retval #kStatus_Success Set DCDC VDD Regulator drive strength in Low power mode successfully. - * retval #kStatus_SPC_BandgapModeWrong Set DCDC VDD Regulator drive strength to Normal, the Bandgap must be enabled. - */ -status_t SPC_SetLowPowerModeDCDCRegulatorDriveStrength(SPC_Type *base, spc_dcdc_drive_strength_t driveStrength) -{ - if (driveStrength == kSPC_DCDC_NormalDriveStrength) - { - /* If specify normal drive strength, bandgap must not be disabled. */ - if (SPC_GetLowPowerModeBandgapMode(base) == kSPC_BandgapDisabled) - { - return kStatus_SPC_BandgapModeWrong; - } - } - - base->LP_CFG = ((base->LP_CFG) & (~SPC_LP_CFG_DCDC_VDD_DS_MASK)) | SPC_LP_CFG_DCDC_VDD_DS(driveStrength); - - return kStatus_Success; -} - -/*! - * brief Config DCDC Burst options - * - * param base SPC peripheral base address. - * param config Pointer to spc_DCDC_burst_config_t structure. - */ -void SPC_SetDCDCBurstConfig(SPC_Type *base, spc_dcdc_burst_config_t *config) -{ - assert(config != NULL); - uint32_t reg; - reg = base->DCDC_CFG; - reg &= ~(SPC_DCDC_CFG_FREQ_CNTRL_MASK | SPC_DCDC_CFG_FREQ_CNTRL_ON_MASK); - reg |= SPC_DCDC_CFG_FREQ_CNTRL(config->freq); - reg |= config->stabilizeBurstFreq ? SPC_DCDC_CFG_FREQ_CNTRL_ON(1U) : SPC_DCDC_CFG_FREQ_CNTRL_ON(0U); - base->DCDC_CFG = reg; - - /* Blocking until previous DCDC burst completed. */ - while ((base->DCDC_BURST_CFG & SPC_DCDC_BURST_CFG_BURST_ACK_MASK) == 0UL) - { - } - - if ((config->sofwareBurstRequest) || (config->externalBurstRequest)) - { - /* Clear DCDC burst acknowledge flag. */ - base->DCDC_BURST_CFG |= SPC_DCDC_BURST_CFG_BURST_ACK_MASK; - } - base->DCDC_BURST_CFG |= SPC_DCDC_BURST_CFG_EXT_BURST_EN(config->externalBurstRequest); - - if (config->sofwareBurstRequest) - { - base->DCDC_BURST_CFG |= SPC_DCDC_BURST_CFG_BURST_REQ_MASK; - } -} - -/*! - * brief Set the count value of the reference clock. - * - * This function set the count value of the reference clock to control the frequency - * of dcdc refresh when dcdc is configured in Pulse Refresh mode. - * - * param base SPC peripheral base address. - * param count The count value, 16 bit width. - */ -void SPC_SetDCDCRefreshCount(SPC_Type *base, uint16_t count) -{ - uint32_t reg; - - reg = base->DCDC_BURST_CFG; - reg &= ~SPC_DCDC_BURST_CFG_PULSE_REFRESH_CNT_MASK; - reg |= SPC_DCDC_BURST_CFG_PULSE_REFRESH_CNT(count); - - base->DCDC_BURST_CFG = reg; -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -/*! - * brief Configs all settings of regulators in Active mode at a time. - * - * @note This function is used to overwrite all settings of regulators(including bandgap mode, regulators' - * drive strength and voltage level) in active mode at a time. - * - * @note Enable/disable LVDs/HVDs before invoking this function. - * - * @note This function will check input parameters based on hardware restrictions before setting registers, if input - * parameters do not satisfy hardware restrictions the specific error will be reported. - * - * - * @note Some hardware restrictions not covered, application should be aware of this and follow this hardware - * restrictions otherwise some unkown issue may occur: - * 1. If Core LDO's drive strength are set to same value in both Active mode and low power mode, - * the voltage level should also set to same value. - * 2. When switching Core LDO's drive strength from low to normal, ensure the LDO_CORE high voltage level is set - * to same level that was set prior to switching to the LDO_CORE drive strength. Otherwise, if the LVDs are - * enabled, an unexpected LVD can occur. - * - * @note If this function can not satisfy some tricky settings, please invoke other low-level functions. - * - * param base SPC peripheral base address. - * param config Pointer to spc_active_mode_regulators_config_t structure. - * retval kStatus_Success Config regulators in Active power mode successful. - * retval kStatus_SPC_BandgapModeWrong The bandgap mode setting in Active mode is wrong. - * retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * retval kStatus_SPC_CORELDOVoltageWrong The selected voltage level in active mode is not allowed. - * retval kStatus_SPC_SYSLDOOverDriveVoltageFail Fail to regulator to Over Drive Voltage. - * retval kStatus_SPC_SYSLDOLowDriveStrengthIgnore Set driver strength to Low will be ignored. - * retval kStatus_SPC_DCDCLowDriveStrengthIgnore Set driver strength to Low will be ignored. - */ -status_t SPC_SetActiveModeRegulatorsConfig(SPC_Type *base, const spc_active_mode_regulators_config_t *config) -{ - assert(config != NULL); - - uint32_t activeModeVDValue = SPC_GetActiveModeVoltageDetectStatus(base); - - /* Check input parameters */ - /* 1. Bandgap should not be disabled if any of regulator in normal drive strength or - if any of LVDs/HVDs are enabled or if VDD CORE glitch detect are enabled. */ - if ((config->bandgapMode == kSPC_BandgapDisabled) && - ((activeModeVDValue != 0UL) -#if !(defined(FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) && FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) - || (SPC_CheckActiveModeVddCoreGlitchDetectEnabled(base) == true) -#endif /* FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - || (config->DCDCOption.DCDCDriveStrength == kSPC_DCDC_NormalDriveStrength) -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - || (config->SysLDOOption.SysLDODriveStrength == kSPC_SysLDO_NormalDriveStrength) -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ -#if (defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) - || (config->CoreLDOOption.CoreLDODriveStrength == kSPC_CoreLDO_NormalDriveStrength) -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - )) - { - return kStatus_SPC_BandgapModeWrong; - } - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - /* 2. Must disable system LDO high voltage detector before specifing SysLDO to overdrive voltage */ - if (((activeModeVDValue & SPC_ACTIVE_CFG_SYS_HVDE_MASK) != 0UL) && - (config->SysLDOOption.SysLDOVoltage == kSPC_SysLDO_OverDriveVoltage)) - { - return kStatus_SPC_SYSLDOOverDriveVoltageFail; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - /* 3. To set System LDO's drive strength to low, all LVDs and HVDs must be disabled. */ - if ((activeModeVDValue != 0UL) && (config->SysLDOOption.SysLDODriveStrength == kSPC_SysLDO_LowDriveStrength)) - { - return kStatus_SPC_SYSLDOLowDriveStrengthIgnore; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) - /* 4. To set Core LDO's drive strength to low, all LVDs and HVDs must be disabled. */ - if ((activeModeVDValue != 0UL) && (config->CoreLDOOption.CoreLDODriveStrength == kSPC_CoreLDO_LowDriveStrength)) - { - return kStatus_SPC_CORELDOLowDriveStrengthIgnore; - } -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - /* 5. Core LDO and DCDC should have same voltage level. */ - if ((uint8_t)config->DCDCOption.DCDCVoltage != (uint8_t)config->CoreLDOOption.CoreLDOVoltage) - { - return kStatus_SPC_CORELDOVoltageWrong; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - - if ((base->SC & SPC_SC_BUSY_MASK) != 0UL) - { - return kStatus_SPC_Busy; - } - - base->ACTIVE_CFG = - ((base->ACTIVE_CFG) & ~(SPC_ACTIVE_CFG_BGMODE_MASK)) | SPC_ACTIVE_CFG_BGMODE(config->bandgapMode); -#if (defined(FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) - SPC_EnableActiveModeCMPBandgapBuffer(base, config->lpBuff); -#endif /* FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - (void)SPC_SetActiveModeSystemLDORegulatorConfig(base, &config->SysLDOOption); -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - (void)SPC_SetActiveModeDCDCRegulatorConfig(base, &config->DCDCOption); -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - - (void)SPC_SetActiveModeCoreLDORegulatorConfig(base, &config->CoreLDOOption); - - return kStatus_Success; -} - -/*! - * brief Configs regulators in Low Power mode. - * - * This function provides the method to config all on-chip regulators in Low Power mode. - * - * param base SPC peripheral base address. - * param config Pointer to spc_lowpower_mode_regulators_config_t structure. - * retval #kStatus_Success Config regulators in Low power mode successful. - * retval #kStatus_SPC_BandgapModeWrong The bandgap should not be disabled based on input settings. - * retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore Set driver strength to low will be ignored. - * retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Set driver strength to low will be ignored. - * retval #kStatus_SPC_CORELDOVoltageWrong Core LDO and System LDO do not have same voltage level. - */ -status_t SPC_SetLowPowerModeRegulatorsConfig(SPC_Type *base, const spc_lowpower_mode_regulators_config_t *config) -{ - assert(config != NULL); - uint32_t lpModeVDValue = SPC_GetLowPowerModeVoltageDetectStatus(base); - - /* Check input parameters */ - /* 1. Bandgap should not be disabled if any of regulator in normal drive strength or - if any of LVDs/HVDs are enabled or if VDD CORE glitch detect are enabled. */ - if ((config->bandgapMode == kSPC_BandgapDisabled) && - ((lpModeVDValue != 0UL) -#if !(defined(FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) && FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) - || (SPC_CheckLowPowerModeVddCoreGlitchDetectEnabled(base) == true) -#endif /* FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - || (config->DCDCOption.DCDCDriveStrength == kSPC_DCDC_NormalDriveStrength) -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - || (config->SysLDOOption.SysLDODriveStrength == kSPC_SysLDO_NormalDriveStrength) -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ -#if (defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) - || (config->CoreLDOOption.CoreLDODriveStrength == kSPC_CoreLDO_NormalDriveStrength) -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - )) - { - return kStatus_SPC_BandgapModeWrong; - } - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - /* 2. To set System LDO's drive strength to low, all LVDs and HVDs must be disabled. */ - if ((lpModeVDValue != 0UL) && (config->SysLDOOption.SysLDODriveStrength == kSPC_SysLDO_LowDriveStrength)) - { - return kStatus_SPC_SYSLDOLowDriveStrengthIgnore; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) - /* 3. To set Core LDO's drive strength to low, all LVDs and HVDs must be disabled. */ - if ((lpModeVDValue != 0UL) && (config->CoreLDOOption.CoreLDODriveStrength == kSPC_CoreLDO_LowDriveStrength)) - { - return kStatus_SPC_CORELDOLowDriveStrengthIgnore; - } -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - /* 5. Core LDO and DCDC should have same voltage level. */ - if ((uint8_t)config->DCDCOption.DCDCVoltage != (uint8_t)config->CoreLDOOption.CoreLDOVoltage) - { - return kStatus_SPC_CORELDOVoltageWrong; - } -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - base->LP_CFG = ((base->LP_CFG) & ~(SPC_LP_CFG_BGMODE_MASK)) | SPC_LP_CFG_BGMODE(config->bandgapMode); -#if (defined(FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) - SPC_EnableLowPowerModeCMPBandgapBuffer(base, config->lpBuff); -#endif /* FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT) - SPC_EnableLowPowerModeCoreVDDInternalVoltageScaling(base, config->CoreIVS); -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT */ - SPC_EnableLowPowerModeLowPowerIREF(base, config->lpIREF); - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - (void)SPC_SetLowPowerModeSystemLDORegulatorConfig(base, &config->SysLDOOption); -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - (void)SPC_SetLowPowerModeDCDCRegulatorConfig(base, &config->DCDCOption); -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - - (void)SPC_SetLowPowerModeCoreLDORegulatorConfig(base, &config->CoreLDOOption); - - return kStatus_Success; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_spc.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_spc.h deleted file mode 100644 index 52cb71c24db..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_spc.h +++ /dev/null @@ -1,2433 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_SPC_H_ -#define FSL_SPC_H_ -#include "fsl_common.h" - -/*! - * @addtogroup mcx_spc - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief SPC driver version 2.4.2. */ -#define FSL_SPC_DRIVER_VERSION (MAKE_VERSION(2, 4, 2)) -/*! @} */ - -#define SPC_EVD_CFG_REG_EVDISO_SHIFT 0UL -#define SPC_EVD_CFG_REG_EVDLPISO_SHIFT 8UL -#define SPC_EVD_CFG_REG_EVDSTAT_SHIFT 16UL - -#define SPC_EVD_CFG_REG_EVDISO(x) ((uint32_t)(x) << SPC_EVD_CFG_REG_EVDISO_SHIFT) -#define SPC_EVD_CFG_REG_EVDLPISO(x) ((uint32_t)(x) << SPC_EVD_CFG_REG_EVDLPISO_SHIFT) -#define SPC_EVD_CFG_REG_EVDSTAT(x) ((uint32_t)(x) << SPC_EVD_CFG_REG_EVDSTAT_SHIFT) - -#if (defined(SPC_GLITCH_DETECT_SC_CNT_SELECT_MASK)) -#define VDD_CORE_GLITCH_DETECT_SC GLITCH_DETECT_SC -#define SPC_VDD_CORE_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG_MASK SPC_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG_MASK -#define SPC_VDD_CORE_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG SPC_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG -#define SPC_VDD_CORE_GLITCH_DETECT_SC_LOCK_MASK SPC_GLITCH_DETECT_SC_LOCK_MASK -#define SPC_VDD_CORE_GLITCH_DETECT_SC_CNT_SELECT_MASK SPC_GLITCH_DETECT_SC_CNT_SELECT_MASK -#define SPC_VDD_CORE_GLITCH_DETECT_SC_CNT_SELECT SPC_GLITCH_DETECT_SC_CNT_SELECT -#define SPC_VDD_CORE_GLITCH_DETECT_SC_RE_MASK SPC_GLITCH_DETECT_SC_RE_MASK -#define SPC_VDD_CORE_GLITCH_DETECT_SC_RE SPC_GLITCH_DETECT_SC_RE -#define SPC_VDD_CORE_GLITCH_DETECT_SC_TIMEOUT_MASK SPC_GLITCH_DETECT_SC_TIMEOUT_MASK -#define SPC_VDD_CORE_GLITCH_DETECT_SC_TIMEOUT SPC_GLITCH_DETECT_SC_TIMEOUT -#define SPC_VDD_CORE_GLITCH_DETECT_SC_IE_MASK SPC_GLITCH_DETECT_SC_IE_MASK -#define SPC_VDD_CORE_GLITCH_DETECT_SC_IE SPC_GLITCH_DETECT_SC_IE -#endif - -/*! - * @brief SPC status enumeration. - * - * @note Some device(such as MCXA family) do not equip DCDC or System LDO, please refer to the reference manual - * to check. - */ -enum -{ - kStatus_SPC_Busy = MAKE_STATUS(kStatusGroup_SPC, 0U), /*!< The SPC instance is busy executing any - type of power mode transition. */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - kStatus_SPC_DCDCLowDriveStrengthIgnore = MAKE_STATUS(kStatusGroup_SPC, 1U), /*!< DCDC Low drive strength setting be - ignored for LVD/HVD enabled. */ - kStatus_SPC_DCDCPulseRefreshModeIgnore = MAKE_STATUS(kStatusGroup_SPC, 2U), /*!< DCDC Pulse Refresh Mode drive - strength setting be ignored for LVD/HVD enabled. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - kStatus_SPC_SYSLDOOverDriveVoltageFail = MAKE_STATUS(kStatusGroup_SPC, 3U), /*!< SYS LDO regulate to Over drive - voltage failed for SYS LDO HVD must be disabled. */ - kStatus_SPC_SYSLDOLowDriveStrengthIgnore = MAKE_STATUS(kStatusGroup_SPC, 4U), /*!< SYS LDO Low driver strength - setting be ignored for LDO LVD/HVD enabled. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - kStatus_SPC_CORELDOLowDriveStrengthIgnore = MAKE_STATUS(kStatusGroup_SPC, 5U), /*!< CORE LDO Low driver strength - setting be ignored for LDO LVD/HVD enabled. */ - kStatus_SPC_CORELDOVoltageWrong = MAKE_STATUS(kStatusGroup_SPC, 7U), /*!< Core LDO voltage is wrong. */ - kStatus_SPC_CORELDOVoltageSetFail = MAKE_STATUS(kStatusGroup_SPC, 8U), /*!< Core LDO voltage set fail. */ - kStatus_SPC_BandgapModeWrong = MAKE_STATUS(kStatusGroup_SPC, 6U), /*!< Selected Bandgap Mode wrong. */ -}; - -/*! - * @brief Voltage Detect Status Flags. - */ -enum _spc_voltage_detect_flags -{ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) && FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) - kSPC_IOVDDHighVoltageDetectFlag = SPC_VD_STAT_IOVDD_HVDF_MASK, /*!< IO VDD High-Voltage detect flag. */ - kSPC_IOVDDLowVoltageDetectFlag = SPC_VD_STAT_IOVDD_LVDF_MASK, /*!< IO VDD Low-Voltage detect flag. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD */ - kSPC_SystemVDDHighVoltageDetectFlag = SPC_VD_STAT_SYSVDD_HVDF_MASK, /*!< System VDD High-Voltage detect flag. */ - kSPC_SystemVDDLowVoltageDetectFlag = SPC_VD_STAT_SYSVDD_LVDF_MASK, /*!< System VDD Low-Voltage detect flag. */ -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) - kSPC_CoreVDDHighVoltageDetectFlag = SPC_VD_STAT_COREVDD_HVDF_MASK, /*!< Core VDD High-Voltage detect flag. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD */ - kSPC_CoreVDDLowVoltageDetectFlag = SPC_VD_STAT_COREVDD_LVDF_MASK, /*!< Core VDD Low-Voltage detect flag. */ -}; - -/*! - * @brief SPC power domain isolation status. - * @note Some devices(such as MCXA family) do not contain WAKE Power Domain, please refer to the reference manual to - * check. - */ -enum _spc_power_domains -{ - kSPC_MAINPowerDomainRetain = 1UL << 16U, /*!< Peripherals and IO pads retain in MAIN Power Domain. */ - kSPC_WAKEPowerDomainRetain = 1UL << 17U, /*!< Peripherals and IO pads retain in WAKE Power Domain. */ -}; - -/*! - * @brief The enumeration of all analog module that can be controlled by SPC in active or low-power modes. - * @anchor spc_analog_module_control - */ -enum _spc_analog_module_control -{ - kSPC_controlVref = 1UL << 0UL, /*!< Enable/disable VREF in active or low-power modes. */ - kSPC_controlUsb3vDet = 1UL << 1UL, /*!< Enable/disable USB3V_Det in active or low-power modes. */ - kSPC_controlDac0 = 1UL << 4UL, /*!< Enable/disable DAC0 in active or low-power modes. */ - kSPC_controlDac1 = 1UL << 5UL, /*!< Enable/disable DAC1 in active or low-power modes. */ - kSPC_controlDac2 = 1UL << 6UL, /*!< Enable/disable DAC2 in active or low-power modes. */ - kSPC_controlOpamp0 = 1UL << 8UL, /*!< Enable/disable OPAMP0 in active or low-power modes. */ - kSPC_controlOpamp1 = 1UL << 9UL, /*!< Enable/disable OPAMP1 in active or low-power modes. */ - kSPC_controlOpamp2 = 1UL << 10UL, /*!< Enable/disable OPAMP2 in active or low-power modes. */ - kSPC_controlCmp0 = 1UL << 16UL, /*!< Enable/disable CMP0 in active or low-power modes. */ - kSPC_controlCmp1 = 1UL << 17UL, /*!< Enable/disable CMP1 in active or low-power modes. */ - kSPC_controlCmp2 = 1UL << 18UL, /*!< Enable/disable CMP2 in active or low-power modes. */ - kSPC_controlCmp0Dac = 1UL << 20UL, /*!< Enable/disable CMP0_DAC in active or low-power modes. */ - kSPC_controlCmp1Dac = 1UL << 21UL, /*!< Enable/disable CMP1_DAC in active or low-power modes. */ - kSPC_controlCmp2Dac = 1UL << 22UL, /*!< Enable/disable CMP2_DAC in active or low-power modes. */ - kSPC_controlAllModules = 0x770773UL, /*!< Enable/disable all modules in active or low-power modes. */ -}; - -/*! - * @brief The enumeration of spc power domain, the connected power domain is chip specfic, please refer to chip's RM - * for details. - */ -typedef enum _spc_power_domain_id -{ - kSPC_PowerDomain0 = 0U, /*!< Power domain0, the connected power domain is chip specific. */ - kSPC_PowerDomain1 = 1U, /*!< Power domain1, the connected power domain is chip specific. */ -} spc_power_domain_id_t; - -/*! - * @brief The enumeration of Power domain's low power mode. - */ -typedef enum _spc_power_domain_low_power_mode -{ - kSPC_SleepWithSYSClockRunning = 0U, /*!< Power domain request SLEEP mode with SYS clock running. */ - kSPC_DeepSleepWithSysClockOff = 1U, /*!< Power domain request deep sleep mode with system clock off. */ - kSPC_PowerDownWithSysClockOff = 2U, /*!< Power domain request power down mode with system clock off. */ - kSPC_DeepPowerDownWithSysClockOff = 4U, /*!< Power domain request deep power down mode with system clock off. */ -} spc_power_domain_low_power_mode_t; - -/*! - * @brief SPC low power request output pin polarity. - */ -typedef enum _spc_lowPower_request_pin_polarity -{ - kSPC_HighTruePolarity = 0x0U, /*!< Control the High Polarity of the Low Power Reqest Pin. */ - kSPC_LowTruePolarity = 0x1U, /*!< Control the Low Polarity of the Low Power Reqest Pin. */ -} spc_lowpower_request_pin_polarity_t; - -/*! - * @brief SPC low power request output override. - */ -typedef enum _spc_lowPower_request_output_override -{ - kSPC_LowPowerRequestNotForced = 0x0U, /*!< Not Forced. */ - kSPC_LowPowerRequestReserved = 0x1U, /*!< Reserved. */ - kSPC_LowPowerRequestForcedLow = 0x2U, /*!< Forced Low (Ignore LowPower request output polarity setting.) */ - kSPC_LowPowerRequestForcedHigh = 0x3U, /*!< Forced High (Ignore LowPower request output polarity setting.) */ -} spc_lowpower_request_output_override_t; - -/*! - * @brief SPC Bandgap mode enumeration in Active mode or Low Power mode. - */ -typedef enum _spc_bandgap_mode -{ - kSPC_BandgapDisabled = 0x0U, /*!< Bandgap disabled. */ - kSPC_BandgapEnabledBufferDisabled = 0x1U, /*!< Bandgap enabled with Buffer disabled. */ - kSPC_BandgapEnabledBufferEnabled = 0x2U, /*!< Bandgap enabled with Buffer enabled. */ - kSPC_BandgapReserved = 0x3U, /*!< Reserved. */ -} spc_bandgap_mode_t; - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) -/*! - * @brief DCDC regulator voltage level enumeration in Active mode or Low Power Mode. - * - * @note #kSPC_DCDC_RetentionVoltage not supported for all power modes. - */ -typedef enum _spc_dcdc_voltage_level -{ - kSPC_DCDC_RetentionVoltage = 0x0U, /*!< DCDC_CORE Regulator regulate to retention - Voltage(Only supportedin low power modes) */ - kSPC_DCDC_MidVoltage = 0x1U, /*!< DCDC_CORE Regulator regulate to Mid Voltage(1.0V). */ - kSPC_DCDC_NormalVoltage = 0x2U, /*!< DCDC_CORE Regulator regulate to Normal Voltage(1.1V). */ - kSPC_DCDC_OverdriveVoltage = 0x3U, /*!< DCDC_CORE Regulator regulate to Safe-Mode Voltage(1.2V). */ -} spc_dcdc_voltage_level_t; - -/*! - * @brief DCDC regulator Drive Strength enumeration in Active mode or Low Power Mode. - * - * @note Different drive strength differ in these DCDC characterstics: - * Maximum load current - * Quiescent current - * Transient response. - */ -typedef enum _spc_dcdc_drive_strength -{ - kSPC_DCDC_PulseRefreshMode = 0x0U, /*!< DCDC_CORE Regulator Drive Strength set to Pulse Refresh Mode, - * This enum member is only useful for Low Power Mode config, please - * note that pluse refresh mode is invalid in SLEEP mode. - */ - kSPC_DCDC_LowDriveStrength = 0x1U, /*!< DCDC_CORE regulator Drive Strength set to low. */ - kSPC_DCDC_NormalDriveStrength = 0x2U, /*!< DCDC_CORE regulator Drive Strength set to Normal. */ -} spc_dcdc_drive_strength_t; -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) -/*! - * @brief SYS LDO regulator voltage level enumeration in Active mode. - */ -typedef enum _spc_sys_ldo_voltage_level -{ - kSPC_SysLDO_NormalVoltage = 0x0U, /*!< SYS LDO VDD Regulator regulate to Normal Voltage(1.8V). */ - kSPC_SysLDO_OverDriveVoltage = 0x1U, /*!< SYS LDO VDD Regulator regulate to Over Drive Voltage(2.5V). */ -} spc_sys_ldo_voltage_level_t; - -/*! - * @brief SYS LDO regulator Drive Strength enumeration in Active mode or Low Power mode. - */ -typedef enum _spc_sys_ldo_drive_strength -{ - kSPC_SysLDO_LowDriveStrength = 0x0U, /*!< SYS LDO VDD regulator Drive Strength set to low. */ - kSPC_SysLDO_NormalDriveStrength = 0x1U, /*!< SYS LDO VDD regulator Drive Strength set to Normal. */ -} spc_sys_ldo_drive_strength_t; -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -/*! - * @brief Core LDO regulator voltage level enumeration in Active mode or Low Power mode. - */ -typedef enum _spc_core_ldo_voltage_level -{ - kSPC_CoreLDO_UnderDriveVoltage = 0x0U, /*!< @deprecated, to align with description of latest RM, please use - #kSPC_Core_LDO_RetentionVoltage as instead. */ - kSPC_Core_LDO_RetentionVoltage = 0x0U, /*!< Core LDO VDD regulator regulate to retention voltage, please note that - only useful in low power modes and not all devices support this options - please refer to devices' RM for details. */ - kSPC_CoreLDO_MidDriveVoltage = 0x1U, /*!< Core LDO VDD regulator regulate to Mid Drive Voltage. */ - kSPC_CoreLDO_NormalVoltage = 0x2U, /*!< Core LDO VDD regulator regulate to Normal Voltage. */ - kSPC_CoreLDO_OverDriveVoltage = 0x3U, /*!< Core LDO VDD regulator regulate to overdrive Voltage. */ -} spc_core_ldo_voltage_level_t; - -/*! - * @brief CORE LDO VDD regulator Drive Strength enumeration in Low Power mode. - */ -typedef enum _spc_core_ldo_drive_strength -{ - kSPC_CoreLDO_LowDriveStrength = 0x0U, /*!< Core LDO VDD regulator Drive Strength set to low. */ - kSPC_CoreLDO_NormalDriveStrength = 0x1U, /*!< Core LDO VDD regulator Drive Strength set to Normal. */ -} spc_core_ldo_drive_strength_t; - -/*! - * @brief IO VDD Low-Voltage Level Select. - */ -typedef enum _spc_low_voltage_level_select -{ - kSPC_LowVoltageNormalLevel = 0x0U, /*!< @deprecated, please use kSPC_LowVoltageHighRange as instead. */ - kSPC_LowVoltageSafeLevel = 0x1U, /*!< @deprecated, please use kSPC_LowVoltageLowRange as instead. */ - - kSPC_LowVoltageHighRange = 0x0U, /*!< High range LVD threshold. */ - kSPC_LowVoltageLowRange = 0x1U, /*!< Low range LVD threshold. */ -} spc_low_voltage_level_select_t; - -#if !(defined(FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) && FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) -/*! - * @brief Used to select output of 4-bit ripple counter is used to monitor a glitch on VDD core. - */ -typedef enum _spc_vdd_core_glitch_ripple_counter_select -{ - kSPC_selectBit0Of4bitRippleCounter = 0x0U, /*!< Select bit-0 of 4-bit Ripple Counter - to detect glitch on VDD Core. */ - kSPC_selectBit1Of4bitRippleCounter = 0x1U, /*!< Select bit-1 of 4-bit Ripple Counter - to detect glitch on VDD Core. */ - kSPC_selectBit2Of4bitRippleCounter = 0x2U, /*!< Select bit-2 of 4-bit Ripple Counter - to detect glitch on VDD Core. */ - kSPC_selectBit3Of4bitRippleCounter = 0x3U, /*!< Select bit-3 of 4-bit Ripple Counter - to detect glitch on VDD Core. */ -} spc_vdd_core_glitch_ripple_counter_select_t; -#endif - -/*! - * @brief The list of the operating voltage for the SRAM's read/write timing margin. - */ -typedef enum _spc_sram_operate_voltage -{ - kSPC_sramOperateAt1P0V = 0x1U, /*!< SRAM configured for 1.0V operation. */ - kSPC_sramOperateAt1P1V = 0x2U, /*!< SRAM configured for 1.1V operation. */ - kSPC_sramOperateAt1P2V = 0x3U, /*!< SRAM configured for 1.2V operation. */ -} spc_sram_operate_voltage_t; - -#if !(defined(FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) && FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) -/*! - * @brief The configuration of VDD Core glitch detector. - */ -typedef struct _spc_vdd_core_glitch_detector_config -{ - spc_vdd_core_glitch_ripple_counter_select_t rippleCounterSelect; /*!< Used to set ripple counter. */ - uint8_t resetTimeoutValue; /*!< The timeout value used to reset glitch detect/compare logic after an initial - glitch is detected. */ - bool enableReset; /*!< Used to enable/disable POR/LVD reset that caused by CORE VDD glitch detect error. */ - bool enableInterrupt; /*!< Used to enable/disable hardware interrupt if CORE VDD glitch detect error. */ -} spc_vdd_core_glitch_detector_config_t; -#endif - -typedef struct _spc_sram_voltage_config -{ - spc_sram_operate_voltage_t operateVoltage; /*!< Specifies the operating voltage for the SRAM's - read/write timing margin. */ - bool requestVoltageUpdate; /*!< Used to control whether request an SRAM trim value change. */ -} spc_sram_voltage_config_t; - -/*! - * @brief Low Power Request output pin configuration. - */ -typedef struct _spc_lowpower_request_config -{ - bool enable; /*!< Low Power Request Output enable. */ - spc_lowpower_request_pin_polarity_t polarity; /*!< Low Power Request Output pin polarity select. */ - spc_lowpower_request_output_override_t override; /*!< Low Power Request Output Override. */ -} spc_lowpower_request_config_t; - -/*! - * @brief Core LDO regulator options in Active mode. - */ -typedef struct _spc_active_mode_core_ldo_option -{ - spc_core_ldo_voltage_level_t CoreLDOVoltage; /*!< Core LDO Regulator Voltage Level selection in Active mode. */ -#if defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS - spc_core_ldo_drive_strength_t CoreLDODriveStrength; /*!< Core LDO Regulator Drive Strength - selection in Active mode */ -#endif /* FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ -} spc_active_mode_core_ldo_option_t; - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) -/*! - * @brief System LDO regulator options in Active mode. - */ -typedef struct _spc_active_mode_sys_ldo_option -{ - spc_sys_ldo_voltage_level_t SysLDOVoltage; /*!< System LDO Regulator Voltage Level selection in Active mode. */ - spc_sys_ldo_drive_strength_t SysLDODriveStrength; /*!< System LDO Regulator Drive Strength - selection in Active mode. */ -} spc_active_mode_sys_ldo_option_t; -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) -/*! - * @brief DCDC regulator options in Active mode. - */ -typedef struct _spc_active_mode_dcdc_option -{ - spc_dcdc_voltage_level_t DCDCVoltage; /*!< DCDC Regulator Voltage Level selection in Active mode. */ - spc_dcdc_drive_strength_t DCDCDriveStrength; /*!< DCDC_CORE Regulator Drive Strength selection in Active mode. */ -} spc_active_mode_dcdc_option_t; -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -/*! - * @brief Core LDO regulator options in Low Power mode. - */ -typedef struct _spc_lowpower_mode_core_ldo_option -{ - spc_core_ldo_voltage_level_t CoreLDOVoltage; /*!< Core LDO Regulator Voltage Level selection in Low Power mode. */ - spc_core_ldo_drive_strength_t CoreLDODriveStrength; /*!< Core LDO Regulator Drive Strength - selection in Low Power mode */ -} spc_lowpower_mode_core_ldo_option_t; - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) -/*! - * @brief System LDO regulator options in Low Power mode. - */ -typedef struct _spc_lowpower_mode_sys_ldo_option -{ - spc_sys_ldo_drive_strength_t SysLDODriveStrength; /*!< System LDO Regulator Drive Strength - selection in Low Power mode. */ -} spc_lowpower_mode_sys_ldo_option_t; -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) -/*! - * @brief DCDC regulator options in Low Power mode. - */ -typedef struct _spc_lowpower_mode_dcdc_option -{ - spc_dcdc_voltage_level_t DCDCVoltage; /*!< DCDC Regulator Voltage Level selection in Low Power mode. */ - spc_dcdc_drive_strength_t DCDCDriveStrength; /*!< DCDC_CORE Regulator Drive Strength selection in Low Power mode. */ -} spc_lowpower_mode_dcdc_option_t; - -/*! - * @brief DCDC Burst configuration. - * @deprecated Do not recommend to use this structure. - */ -typedef struct _spc_dcdc_burst_config -{ - bool sofwareBurstRequest; /*!< Enable/Disable DCDC Software Burst Request. */ - bool externalBurstRequest; /*!< Enable/Disable DCDC External Burst Request. */ - bool stabilizeBurstFreq; /*!< Enable/Disable DCDC frequency stabilization. */ - uint8_t freq; /*!< The frequency of the current burst. */ -} spc_dcdc_burst_config_t; -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -/*! - * @brief CORE/SYS/IO VDD Voltage Detect options. - */ -typedef struct _spc_voltage_detect_option -{ - bool HVDInterruptEnable; /*!< CORE/SYS/IO VDD High Voltage Detect interrupt enable. */ - bool HVDResetEnable; /*!< CORE/SYS/IO VDD High Voltage Detect reset enable. */ - bool LVDInterruptEnable; /*!< CORE/SYS/IO VDD Low Voltage Detect interrupt enable. */ - bool LVDResetEnable; /*!< CORE/SYS/IO VDD Low Voltage Detect reset enable. */ -} spc_voltage_detect_option_t; - -/*! - * @brief Core Voltage Detect configuration. - */ -typedef struct _spc_core_voltage_detect_config -{ - spc_voltage_detect_option_t option; /*!< Core VDD Voltage Detect option. */ -} spc_core_voltage_detect_config_t; - -/*! - * @brief System Voltage Detect Configuration. - */ -typedef struct _spc_system_voltage_detect_config -{ - spc_voltage_detect_option_t option; /*!< System VDD Voltage Detect option. */ - spc_low_voltage_level_select_t level; /*!< @deprecated, reserved for all devices, will removed in next release. */ -} spc_system_voltage_detect_config_t; - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) && FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) -/*! - * @brief IO Voltage Detect Configuration. - */ -typedef struct _spc_io_voltage_detect_config -{ - spc_voltage_detect_option_t option; /*!< IO VDD Voltage Detect option. */ - spc_low_voltage_level_select_t level; /*!< IO VDD Low-voltage level selection. */ -} spc_io_voltage_detect_config_t; -#endif /* FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD */ - -/*! - * @brief Active mode configuration. - */ -typedef struct _spc_active_mode_regulators_config -{ - spc_bandgap_mode_t bandgapMode; /*!< Specify bandgap mode in active mode. */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) - bool lpBuff; /*!< Enable/disable CMP bandgap buffer. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - spc_active_mode_dcdc_option_t DCDCOption; /*!< Specify DCDC configurations in active mode. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - spc_active_mode_sys_ldo_option_t SysLDOOption; /*!< Specify System LDO configurations in active mode. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - - spc_active_mode_core_ldo_option_t CoreLDOOption; /*!< Specify Core LDO configurations in active mode. */ -} spc_active_mode_regulators_config_t; - -/*! - * @brief Low Power Mode configuration. - */ -typedef struct _spc_lowpower_mode_regulators_config -{ - bool lpIREF; /*!< Enable/disable low power IREF in low power modes. */ - spc_bandgap_mode_t bandgapMode; /*!< Specify bandgap mode in low power modes. */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) - bool lpBuff; /*!< Enable/disable CMP bandgap buffer in low power modes. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT) - bool CoreIVS; /*!< Enable/disable CORE VDD internal voltage scaling. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) - spc_lowpower_mode_dcdc_option_t DCDCOption; /*!< Specify DCDC configurations in low power modes. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) - spc_lowpower_mode_sys_ldo_option_t SysLDOOption; /*!< Specify system LDO configurations in low power modes. */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - - spc_lowpower_mode_core_ldo_option_t CoreLDOOption; /*!< Specify core LDO configurations in low power modes. */ -} spc_lowpower_mode_regulators_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name SPC Status - * @{ - */ -/*! - * @brief Gets Isolation status for each power domains. - * - * This function gets the status which indicates whether certain - * peripheral and the IO pads are in a latched state as a result - * of having been in POWERDOWN mode. - * - * @param base SPC peripheral base address. - * @return Current isolation status for each power domains. See @ref _spc_power_domains for details. - */ -uint8_t SPC_GetPeriphIOIsolationStatus(SPC_Type *base); - -/*! - * @brief Clears peripherals and I/O pads isolation flags for each power domains. - * - * This function clears peripherals and I/O pads isolation flags for each power domains. - * After recovering from the POWERDOWN mode, user must invoke this function to release the - * I/O pads and certain peripherals to their normal run mode state. Before invoking this - * function, user must restore chip configuration in particular pin configuration for enabled - * WUU wakeup pins. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_ClearPeriphIOIsolationFlag(SPC_Type *base) -{ - base->SC |= SPC_SC_ISO_CLR_MASK; -} - -/*! - * @brief Gets SPC busy status flag. - * - * This function gets SPC busy status flag. When SPC executing any type of power mode - * transition in ACTIVE mode or any of the SOC low power mode, the SPC busy status flag is set - * and this function returns true. When changing CORE LDO voltage level and DCDC voltage level - * in ACTIVE mode, the SPC busy status flag is set and this function return true. - * - * @param base SPC peripheral base address. - * @return Ack busy flag. - * true - SPC is busy. - * false - SPC is not busy. - */ -static inline bool SPC_GetBusyStatusFlag(SPC_Type *base) -{ - return ((base->SC & SPC_SC_BUSY_MASK) != 0UL); -} - -/*! - * @brief Checks system low power request. - * - * @note Only when all power domains request low power mode entry, the result of this function is true. That means when - * all power domains request low power mode entry, the SPC regulators will be controlled by LP_CFG register. - * - * @param base SPC peripheral base address. - * @return The system low power request check result. - * - \b true All power domains have requested low power mode and SPC has entered a low power state and power mode - * configuration are based on the LP_CFG configuration register. - * - \b false SPC in active mode and ACTIVE_CFG register control system power supply. - */ -static inline bool SPC_CheckLowPowerReqest(SPC_Type *base) -{ - return ((base->SC & SPC_SC_SPC_LP_REQ_MASK) == SPC_SC_SPC_LP_REQ_MASK); -} - -/*! - * @brief Clears system low power request, set SPC in active mode. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_ClearLowPowerRequest(SPC_Type *base) -{ - base->SC |= SPC_SC_SPC_LP_REQ_MASK; -} - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SWITCH_STATE_BIT) && FSL_FEATURE_MCX_SPC_HAS_SWITCH_STATE_BIT) -/*! - * @brief Checks whether the power switch is on. - * - * @param base SPC peripheral base address. - * - * @retval true The power switch is on. - * @retval false The power switch is off. - */ -static inline bool SPC_CheckSwitchState(SPC_Type *base) -{ - return ((base->SC & SPC_SC_SWITCH_STATE_MASK) != 0UL); -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_SWITCH_STATE_BIT */ - -/*! - * @brief Gets selected power domain's requested low power mode. - * - * @param base SPC peripheral base address. - * @param powerDomainId Power Domain Id, please refer to @ref spc_power_domain_id_t. - * - * @return The selected power domain's requested low power mode, please refer to @ref spc_power_domain_low_power_mode_t. - */ -spc_power_domain_low_power_mode_t SPC_GetPowerDomainLowPowerMode(SPC_Type *base, spc_power_domain_id_t powerDomainId); - -/*! - * @brief Checks power domain's low power request. - * - * @param base SPC peripheral base address. - * @param powerDomainId Power Domain Id, please refer to @ref spc_power_domain_id_t. - * @return The result of power domain's low power request. - * - \b true The selected power domain requests low power mode entry. - * - \b false The selected power domain does not request low power mode entry. - */ -static inline bool SPC_CheckPowerDomainLowPowerRequest(SPC_Type *base, spc_power_domain_id_t powerDomainId) -{ - assert((uint8_t)powerDomainId < SPC_PD_STATUS_COUNT); - return ((base->PD_STATUS[(uint8_t)powerDomainId] & SPC_PD_STATUS_PWR_REQ_STATUS_MASK) == - SPC_PD_STATUS_PWR_REQ_STATUS_MASK); -} - -/*! - * @brief Clears selected power domain's low power request flag. - * - * @param base SPC peripheral base address. - * @param powerDomainId Power Domain Id, please refer to @ref spc_power_domain_id_t. - */ -static inline void SPC_ClearPowerDomainLowPowerRequestFlag(SPC_Type *base, spc_power_domain_id_t powerDomainId) -{ - assert((uint8_t)powerDomainId < SPC_PD_STATUS_COUNT); - base->PD_STATUS[(uint8_t)powerDomainId] |= SPC_PD_STATUS_PD_LP_REQ_MASK; -} - -/*! @} */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SRAMRETLDO_REG) && FSL_FEATURE_MCX_SPC_HAS_SRAMRETLDO_REG) -/*! - * @name SRAM Retention LDO Control APIs - * @{ - */ - -/*! - * @brief Trims SRAM retention regulator reference voltage, trim step is 12 mV, range is around 0.48V to 0.85V. - * - * @param base SPC peripheral base address. - * @param trimValue Reference voltage trim value. - */ -static inline void SPC_TrimSRAMLdoRefVoltage(SPC_Type *base, uint8_t trimValue) -{ - base->SRAMRETLDO_REFTRIM = - ((base->SRAMRETLDO_REFTRIM & ~SPC_SRAMRETLDO_REFTRIM_REFTRIM_MASK) | SPC_SRAMRETLDO_REFTRIM_REFTRIM(trimValue)); -} - -/*! - * @brief Enables/disables SRAM retention LDO. - * - * @param base SPC peripheral base address. - * @param enable Used to enable/disable SRAM LDO : - * - \b true Enable SRAM LDO; - * - \b false Disable SRAM LDO. - */ -static inline void SPC_EnableSRAMLdo(SPC_Type *base, bool enable) -{ - if (enable) - { - base->SRAMRETLDO_CNTRL |= SPC_SRAMRETLDO_CNTRL_SRAMLDO_ON_MASK; - } - else - { - base->SRAMRETLDO_CNTRL &= ~SPC_SRAMRETLDO_CNTRL_SRAMLDO_ON_MASK; - } -} - -/*! - * @brief - * - * @todo Need to check. - * - * @param base SPC peripheral base address. - * @param mask The OR'ed value of SRAM Array. - */ -static inline void SPC_RetainSRAMArray(SPC_Type *base, uint8_t mask) -{ - base->SRAMRETLDO_CNTRL |= SPC_SRAMRETLDO_CNTRL_SRAM_RET_EN(mask); -} - -/*! @} */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_SRAMRETLDO_REG */ - -/*! - * @name Low Power Request configuration - * @{ - */ -/*! - * @brief Configs Low power request output pin. - * - * This function config the low power request output pin - * - * @param base SPC peripheral base address. - * @param config Pointer the @ref spc_lowpower_request_config_t structure. - */ -void SPC_SetLowPowerRequestConfig(SPC_Type *base, const spc_lowpower_request_config_t *config); - -/*! @} */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_CFG_REG) && FSL_FEATURE_MCX_SPC_HAS_CFG_REG) -/*! - * @name Integrated Power Switch Control APIs - * @{ - */ - -/*! - * @brief Enables/disables the integrated power switch manually. - * - * @param base SPC peripheral base address. - * @param enable Used to enable/disable the integrated power switch: - * - \b true Enable the integrated power switch; - * - \b false Disable the integrated power switch. - */ -static inline void SPC_EnableIntegratedPowerSwitchManually(SPC_Type *base, bool enable) -{ - if (enable) - { - base->CFG |= (SPC_CFG_INTG_PWSWTCH_SLEEP_ACTIVE_EN_MASK | SPC_CFG_INTG_PWSWTCH_WKUP_ACTIVE_EN_MASK); - } - else - { - base->CFG &= ~(SPC_CFG_INTG_PWSWTCH_SLEEP_ACTIVE_EN_MASK | SPC_CFG_INTG_PWSWTCH_WKUP_ACTIVE_EN_MASK); - } -} - -/*! - * @brief Enables/disables the integrated power switch automatically. - * - * To gate the integrated power switch when chip enter low power modes, and ungate the switch after wake-up from low - * power modes: - * @code - * SPC_EnableIntegratedPowerSwitchAutomatically(SPC, true, true); - * @endcode - * - * @param base SPC peripheral base address. - * @param sleepGate Enable the integrated power switch when chip enter low power modes: - * - \b true SPC asserts an output pin at low-power entry to power-gate the switch; - * - \b false SPC does not assert an output pin at low-power entry to power-gate the switch. - * @param wakeupUngate Enables the switch after wake-up from low power modes: - * - \b true SPC asserts an output pin at low-power exit to power-ungate the switch; - * - \b false SPC does not assert an output pin at low-power exit to power-ungate the switch. - */ -static inline void SPC_EnableIntegratedPowerSwitchAutomatically(SPC_Type *base, bool sleepGate, bool wakeupUngate) -{ - uint32_t tmp32 = ((base->CFG) & ~(SPC_CFG_INTG_PWSWTCH_SLEEP_EN_MASK | SPC_CFG_INTG_PWSWTCH_WKUP_EN_MASK)); - - tmp32 |= SPC_CFG_INTG_PWSWTCH_SLEEP_EN(sleepGate) | SPC_CFG_INTG_PWSWTCH_WKUP_EN(wakeupUngate); - - base->CFG = tmp32; -} - -/*! @} */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_CFG_REG */ - -#if !(defined(FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) && FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) -/*! - * @name VDD Core Glitch Detector Control APIs - * @{ - */ - -/*! - * @brief Configures VDD Core Glitch detector, including ripple counter selection, timeout value and so on. - * - * @param base SPC peripheral base address. - * @param config Pointer to the structure in type of @ref spc_vdd_core_glitch_detector_config_t. - */ -void SPC_ConfigVddCoreGlitchDetector(SPC_Type *base, const spc_vdd_core_glitch_detector_config_t *config); - -/*! - * @brief Checks selected 4-bit glitch ripple counter's output. - * - * @param base SPC peripheral base address. - * @param rippleCounter The ripple counter to check, please refer to @ref spc_vdd_core_glitch_ripple_counter_select_t. - * - * @retval true The selected ripple counter output is 1, will generate interrupt or reset based on settings. - * @retval false The selected ripple counter output is 0. - */ - -static inline bool SPC_CheckGlitchRippleCounterOutput(SPC_Type *base, - spc_vdd_core_glitch_ripple_counter_select_t rippleCounter) -{ - return ((base->VDD_CORE_GLITCH_DETECT_SC & SPC_VDD_CORE_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG_MASK) == - SPC_VDD_CORE_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG(1UL << (uint32_t)(rippleCounter))); -} - -/*! - * @brief Clears output of selected glitch ripple counter. - * - * @param base SPC peripheral base address. - * @param rippleCounter The ripple counter to check, please refer to @ref spc_vdd_core_glitch_ripple_counter_select_t. - */ -static inline void SPC_ClearGlitchRippleCounterOutput(SPC_Type *base, - spc_vdd_core_glitch_ripple_counter_select_t rippleCounter) -{ - base->VDD_CORE_GLITCH_DETECT_SC |= - SPC_VDD_CORE_GLITCH_DETECT_SC_GLITCH_DETECT_FLAG(1UL << (uint32_t)(rippleCounter)); -} - -/*! - * @brief After invoking this function, writes to SPC_VDD_CORE_GLITCH_DETECT_SC[RE] register are ignored. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_LockVddCoreVoltageGlitchDetectResetControl(SPC_Type *base) -{ - base->VDD_CORE_GLITCH_DETECT_SC |= SPC_VDD_CORE_GLITCH_DETECT_SC_LOCK_MASK; -} - -/*! - * @brief After invoking this function, writes to SPC_VDD_CORE_GLITCH_DETECT_SC[RE] register are allowed. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_UnlockVddCoreVoltageGlitchDetectResetControl(SPC_Type *base) -{ - base->VDD_CORE_GLITCH_DETECT_SC &= ~SPC_VDD_CORE_GLITCH_DETECT_SC_LOCK_MASK; -} - -/*! - * @brief Checks if SPC_VDD_CORE_GLITCH_DETECT_SC[RE] register is writable. - * - * @param base SPC peripheral base address. - * - * @retval true SPC_VDD_CORE_GLITCH_DETECT_SC[RE] register is writable. - * @retval false SPC_VDD_CORE_GLITCH_DETECT_SC[RE] register is not writable. - */ -static inline bool SPC_CheckVddCoreVoltageGlitchResetControlState(SPC_Type *base) -{ - return ((base->VDD_CORE_GLITCH_DETECT_SC & SPC_VDD_CORE_GLITCH_DETECT_SC_LOCK_MASK) != 0UL); -} - -/*! @} */ -#endif - -/*! - * @name SRAM Control APIs - * @{ - */ - -/*! - * @brief Set SRAM operate voltage. - * - * @param base SPC peripheral base address. - * @param config The pointer to @ref spc_sram_voltage_config_t, specifies the configuration of sram voltage. - */ -void SPC_SetSRAMOperateVoltage(SPC_Type *base, const spc_sram_voltage_config_t *config); - -/*! @} */ - -/*! - * @name Active Mode configuration - * @{ - */ - -/*! - * @brief Gets the Bandgap mode in Active mode. - * - * @param base SPC peripheral base address. - * @return Bandgap mode in the type of @ref spc_bandgap_mode_t enumeration. - */ -static inline spc_bandgap_mode_t SPC_GetActiveModeBandgapMode(SPC_Type *base) -{ - return (spc_bandgap_mode_t)(uint32_t)((base->ACTIVE_CFG & SPC_ACTIVE_CFG_BGMODE_MASK) >> - SPC_ACTIVE_CFG_BGMODE_SHIFT); -} - -/*! - * @brief Gets all voltage detectors status in Active mode. - * - * @param base SPC peripheral base address. - * @return All voltage detectors status in Active mode. - */ -static inline uint32_t SPC_GetActiveModeVoltageDetectStatus(SPC_Type *base) -{ - uint32_t state; - state = base->ACTIVE_CFG & - ( -#if (defined(FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) && FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) - SPC_ACTIVE_CFG_IO_HVDE_MASK | SPC_ACTIVE_CFG_IO_LVDE_MASK | - -#endif /* FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD */ - SPC_ACTIVE_CFG_SYS_HVDE_MASK | SPC_ACTIVE_CFG_SYS_LVDE_MASK | SPC_ACTIVE_CFG_CORE_LVDE_MASK - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) - | SPC_ACTIVE_CFG_CORE_HVDE_MASK - -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD */ - ); - return state; -} - -/*! - * @brief Configs Bandgap mode in Active mode. - * - * @note To disable bandgap in Active mode: - * 1. Disable all LVD's and HVD's in active mode; - * 2. Disable Glitch detect; - * 3. Configrue LDO's and DCDC to low drive strength in active mode; - * 4. Invoke this function to disable bandgap in active mode; - * otherwise the error status will be reported. - * - * @note Some other system resources(such as PLL, CMP) require bandgap to be enabled, to disable bandgap please - * take care of other system resources. - * - * @param base SPC peripheral base address. - * @param mode The Bandgap mode be selected. - * - * @retval #kStatus_SPC_BandgapModeWrong The Bandgap can not be disabled in active mode. - * @retval #kStatus_Success Config Bandgap mode in Active power mode successful. - */ -status_t SPC_SetActiveModeBandgapModeConfig(SPC_Type *base, spc_bandgap_mode_t mode); - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) -/*! - * @brief Enables/Disable the CMP Bandgap Buffer in Active mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable CMP Bandgap buffer. - * true - Enable Buffer Stored Reference voltage to CMP. - * false - Disable Buffer Stored Reference voltage to CMP. - */ -static inline void SPC_EnableActiveModeCMPBandgapBuffer(SPC_Type *base, bool enable) -{ - if (enable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_LPBUFF_EN_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_LPBUFF_EN_MASK; - } -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT */ - -/*! - * @brief Sets the delay when the regulators change voltage level in Active mode. - * - * @param base SPC peripheral base address. - * @param delay The number of SPC timer clock cycles. - */ -static inline void SPC_SetActiveModeVoltageTrimDelay(SPC_Type *base, uint16_t delay) -{ - base->ACTIVE_VDELAY = SPC_ACTIVE_VDELAY_ACTIVE_VDELAY(delay); -} - -/*! - * @brief Configs all settings of regulators in Active mode at a time. - * - * @note This function is used to overwrite all settings of regulators(including bandgap mode, regulators' - * drive strength and voltage level) in active mode at a time. - * - * @note Enable/disable LVDs/HVDs before invoking this function. - * - * @note This function will check input parameters based on hardware restrictions before setting registers, if input - * parameters do not satisfy hardware restrictions the specific error will be reported. - * - * - * @note Some hardware restrictions not covered, application should be aware of this and follow this hardware - * restrictions otherwise some unkown issue may occur: - * 1. If Core LDO's drive strength are set to same value in both Active mode and low power mode, - * the voltage level should also set to same value. - * 2. When switching Core LDO's drive strength from low to normal, ensure the LDO_CORE high voltage level is set - * to same level that was set prior to switching to the LDO_CORE drive strength. Otherwise, if the LVDs are - * enabled, an unexpected LVD can occur. - * - * @note If this function can not satisfy some tricky settings, please invoke other APIs in low-level function group. - * - * @param base SPC peripheral base address. - * @param config Pointer to spc_active_mode_regulators_config_t structure. - * - * @retval #kStatus_Success Config regulators in Active power mode successful. - * @retval #kStatus_SPC_BandgapModeWrong Based on input setting, bandgap can not be disabled. - * @retval #kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * @retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore Any of LVDs/HVDs kept enabled before invoking this function. - * @retval #kStatus_SPC_SYSLDOOverDriveVoltageFail Fail to regulator to Over Drive Voltage due to - * System VDD HVD is not disabled. - * @retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Any of LVDs/HVDs kept enabled before invoking this function. - * @retval #kStatus_SPC_CORELDOVoltageWrong Core LDO and System LDO do not have same voltage level. - */ -status_t SPC_SetActiveModeRegulatorsConfig(SPC_Type *base, const spc_active_mode_regulators_config_t *config); - -#if !(defined(FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) && FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) -/*! - * @brief Disables/Enables VDD Core Glitch Detect in Active mode. - * - * @note State of glitch detect disable feature will be ignored if bandgap is disabled and - * glitch detect hardware will be forced to OFF state. - * - * @param base SPC peripheral base address. - * @param disable Used to disable/enable VDD Core Glitch detect feature. - * - \b true Disable VDD Core Low Voltage detect; - * - \b false Enable VDD Core Low Voltage detect. - */ -static inline void SPC_DisableActiveModeVddCoreGlitchDetect(SPC_Type *base, bool disable) -{ - if (disable) - { - base->ACTIVE_CFG |= SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE_MASK; - } - else - { - base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE_MASK; - } -} - -/*! - * @brief Check if Glitch detect hardware is enabled in active mode. - * - * @param base SPC peripheral base address. - * @return Indicate if Glitch detector is enabled. - */ -static inline bool SPC_CheckActiveModeVddCoreGlitchDetectEnabled(SPC_Type *base) -{ - if ((base->ACTIVE_CFG & SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE_MASK) == 0UL) - { - return true; - } - else - { - return false; - } -} - -#endif /* FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT */ - -/*! - * @brief Enables analog modules in active mode. - * - * @param base SPC peripheral base address. - * @param maskValue The mask of analog modules to enable in active mode, should be the OR'ed value - * of @ref spc_analog_module_control. - */ -static inline void SPC_EnableActiveModeAnalogModules(SPC_Type *base, uint32_t maskValue) -{ - base->ACTIVE_CFG1 |= SPC_ACTIVE_CFG1_SOC_CNTRL(maskValue); -} - -/*! - * @brief Disables analog modules in active mode. - * - * @param base SPC peripheral base address. - * @param maskValue The mask of analog modules to disable in active mode, should be the OR'ed value - * of @ref spc_analog_module_control. - */ -static inline void SPC_DisableActiveModeAnalogModules(SPC_Type *base, uint32_t maskValue) -{ - base->ACTIVE_CFG1 &= ~SPC_ACTIVE_CFG1_SOC_CNTRL(maskValue); -} - -/*! - * @brief Gets enabled analog modules that enabled in active mode. - * - * @param base SPC peripheral base address. - * - * @return The mask of enabled analog modules that enabled in active mode. - */ -static inline uint32_t SPC_GetActiveModeEnabledAnalogModules(SPC_Type *base) -{ - return base->ACTIVE_CFG1; -} - -/*! @} */ - -/*! - * @name Low Power mode configuration - * @{ - */ - -/*! - * @brief Gets the Bandgap mode in Low Power mode. - * - * @param base SPC peripheral base address. - * @return Bandgap mode in the type of @ref spc_bandgap_mode_t enumeration. - */ -static inline spc_bandgap_mode_t SPC_GetLowPowerModeBandgapMode(SPC_Type *base) -{ - return (spc_bandgap_mode_t)(uint32_t)((base->LP_CFG & SPC_LP_CFG_BGMODE_MASK) >> SPC_LP_CFG_BGMODE_SHIFT); -} - -/*! - * @brief Gets the status of all voltage detectors in Low Power mode. - * - * @param base SPC peripheral base address. - * @return The status of all voltage detectors in low power mode. - */ -static inline uint32_t SPC_GetLowPowerModeVoltageDetectStatus(SPC_Type *base) -{ - uint32_t state; - state = base->LP_CFG & ( -#if (defined(FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) && FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) - SPC_LP_CFG_IO_HVDE_MASK | SPC_LP_CFG_IO_LVDE_MASK | - -#endif /* FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD */ - SPC_LP_CFG_SYS_HVDE_MASK | SPC_LP_CFG_SYS_LVDE_MASK | SPC_LP_CFG_CORE_LVDE_MASK - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) - | SPC_LP_CFG_CORE_HVDE_MASK - -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD */ - ); - return state; -} - -/*! - * @brief Enables/Disables Low Power IREF in low power modes. - * - * This function enables/disables Low Power IREF. Low Power IREF can only get - * disabled in Deep power down mode. In other low power modes, the Low Power IREF - * is always enabled. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable Low Power IREF. - * true - Enable Low Power IREF for Low Power modes. - * false - Disable Low Power IREF for Deep Power Down mode. - */ -static inline void SPC_EnableLowPowerModeLowPowerIREF(SPC_Type *base, bool enable) -{ - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_LP_IREFEN_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_LP_IREFEN_MASK; - } -} - -/*! - * @brief Configs Bandgap mode in Low Power mode. - * - * @note To disable Bandgap in Low-power mode: - * 1. Disable all LVD's ad HVD's in low power mode; - * 2. Disable Glitch detect in low power mode; - * 3. Configure LDO's and DCDC to low drive strength in low power mode; - * 4. Disable bandgap in low power mode; - * Otherwise, the error status will be reported. - * - * @note Some other system resources(such as PLL, CMP) require bandgap to be enabled, to disable bandgap please - * take care of other system resources. - * - * @param base SPC peripheral base address. - * @param mode The Bandgap mode be selected. - * - * @retval #kStatus_SPC_BandgapModeWrong The bandgap mode setting in Low Power mode is wrong. - * @retval #kStatus_Success Config Bandgap mode in Low Power power mode successful. - */ -status_t SPC_SetLowPowerModeBandgapmodeConfig(SPC_Type *base, spc_bandgap_mode_t mode); - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SRAMLDO_DPD_ON_BIT) && FSL_FEATURE_MCX_SPC_HAS_SRAMLDO_DPD_ON_BIT) -/*! - * @brief Enables/disables SRAM_LDO deep power low power IREF. - * - * @param base SPC peripheral base address. - * @param enable Used to enable/disable low power IREF : - * - \b true: Low Power IREF is enabled ; - * - \b false: Low Power IREF is disabled for power saving. - */ -static inline void SPC_EnableSRAMLdOLowPowerModeIREF(SPC_Type *base, bool enable) -{ - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_SRAMLDO_DPD_ON_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_SRAMLDO_DPD_ON_MASK; - } -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_SRAMLDO_DPD_ON_BIT */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT) -/*! - * @brief Enables/Disables CMP Bandgap Buffer. - * - * This function gates CMP bandgap buffer. CMP bandgap buffer is automatically disabled and turned off - * in Deep Power Down mode. - * - * @deprecated No longer used, please use SPC_EnableLowPowerModeCMPBandgapBuffer as instead. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable CMP Bandgap buffer. - * true - Enable Buffer Stored Reference Voltage to CMP. - * false - Disable Buffer Stored Reference Voltage to CMP. - */ -static inline void SPC_EnableLowPowerModeCMPBandgapBufferMode(SPC_Type *base, bool enable) -{ - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_LPBUFF_EN_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_LPBUFF_EN_MASK; - } -} - -/*! - * @brief Enables/Disables CMP Bandgap Buffer. - * - * This function gates CMP bandgap buffer. CMP bandgap buffer is automatically disabled and turned off - * in Deep Power Down mode. - * - * @deprecated No longer used. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable CMP Bandgap buffer. - * true - Enable Buffer Stored Reference Voltage to CMP. - * false - Disable Buffer Stored Reference Voltage to CMP. - */ -static inline void SPC_EnableLowPowerModeCMPBandgapBuffer(SPC_Type *base, bool enable) -{ - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_LPBUFF_EN_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_LPBUFF_EN_MASK; - } -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_LPBUFF_EN_BIT */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT) -/*! - * @brief Enables/Disables CORE VDD IVS(Internal Voltage Scaling) in power down modes. - * - * This function gates CORE VDD IVS. When enabled, the IVS regulator will scale the - * external input CORE VDD to a lower voltage level to reduce internal leakage. - * IVS is invalid in Sleep or Deep power down mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable IVS. - * true - enable CORE VDD IVS in Power Down mode. - * false - disable CORE VDD IVS in Power Down mode. - */ -static inline void SPC_EnableLowPowerModeCoreVDDInternalVoltageScaling(SPC_Type *base, bool enable) -{ - if (enable) - { - base->LP_CFG |= SPC_LP_CFG_COREVDD_IVS_EN_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_COREVDD_IVS_EN_MASK; - } -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_IVS_EN_BIT */ - -/*! - * @brief Sets the delay when exit the low power modes. - * - * @param base SPC peripheral base address. - * @param delay The number of SPC timer clock cycles that the SPC waits on exit from low power modes. - */ -static inline void SPC_SetLowPowerWakeUpDelay(SPC_Type *base, uint16_t delay) -{ - base->LPWKUP_DELAY = SPC_LPWKUP_DELAY_LPWKUP_DELAY(delay); -} - -/*! - * @brief Configs all settings of regulators in Low power mode at a time. - * - * @note This function is used to overwrite all settings of regulators(including bandgap mode, regulators' - * drive strength and voltage level) in low power mode at a time. - * - * @note Enable/disable LVDs/HVDs before invoking this function. - * - * @note This function will check input parameters based on hardware restrictions before setting registers, if input - * parameters do not satisfy hardware restrictions the specific error will be reported. - * - * @note Some hardware restrictions not covered, application should be aware of this and follow this hardware - * restrictions otherwise some unkown issue may occur: - * 1. If Core LDO's drive strength are set to same value in both Active mode and low power mode, - * the voltage level should also set to same value. - * 2. When switching Core LDO's drive strength from low to normal, ensure the LDO_CORE high voltage level is set - * to same level that was set prior to switching to the LDO_CORE drive strength. Otherwise, if the LVDs are - * enabled, an unexpected LVD can occur. - * - * @note If this function can not satisfy some tricky settings, please invoke other APIs in low-level function group. - * - * @param base SPC peripheral base address. - * @param config Pointer to spc_lowpower_mode_regulators_config_t structure. - * @retval #kStatus_Success Config regulators in Low power mode successful. - * @retval #kStatus_SPC_BandgapModeWrong The bandgap should not be disabled based on input settings. - * @retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore Set driver strength to low will be ignored. - * @retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Set driver strength to low will be ignored. - * @retval #kStatus_SPC_CORELDOVoltageWrong Core LDO and System LDO do not have same voltage level. - */ -status_t SPC_SetLowPowerModeRegulatorsConfig(SPC_Type *base, const spc_lowpower_mode_regulators_config_t *config); - -#if !(defined(FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) && FSL_FEATURE_MCX_SPC_HAS_NO_GLITCH_DETECT) -/*! - * @brief Disable/Enable VDD Core Glitch Detect in low power mode. - * - * @note State of glitch detect disable feature will be ignored if bandgap is disabled and - * glitch detect hardware will be forced to OFF state. - * - * @param base SPC peripheral base address. - * @param disable Used to disable/enable VDD Core Glitch detect feature. - * - \b true Disable VDD Core Low Voltage detect; - * - \b false Enable VDD Core Low Voltage detect. - */ -static inline void SPC_DisableLowPowerModeVddCoreGlitchDetect(SPC_Type *base, bool disable) -{ - if (disable) - { - base->LP_CFG |= SPC_LP_CFG_GLITCH_DETECT_DISABLE_MASK; - } - else - { - base->LP_CFG &= ~SPC_LP_CFG_GLITCH_DETECT_DISABLE_MASK; - } -} - -/*! - * @brief Check if Glitch detect hardware is enabled in low power mode. - * - * @param base SPC peripheral base address. - * @return Indicate if Glitch detector is enabled. - */ -static inline bool SPC_CheckLowPowerModeVddCoreGlitchDetectEnabled(SPC_Type *base) -{ - if ((base->LP_CFG & SPC_LP_CFG_GLITCH_DETECT_DISABLE_MASK) == 0UL) - { - return true; - } - else - { - return false; - } -} -#endif - -/*! - * @brief Enables analog modules in low power modes. - * - * @param base SPC peripheral base address. - * @param maskValue The mask of analog modules to enable in low power modes, should be OR'ed value - of @ref spc_analog_module_control. - */ -static inline void SPC_EnableLowPowerModeAnalogModules(SPC_Type *base, uint32_t maskValue) -{ - base->LP_CFG1 |= SPC_LP_CFG1_SOC_CNTRL(maskValue); -} - -/*! - * @brief Disables analog modules in low power modes. - * - * @param base SPC peripheral base address. - * @param maskValue The mask of analog modules to disable in low power modes, should be OR'ed value - of @ref spc_analog_module_control. - */ -static inline void SPC_DisableLowPowerModeAnalogModules(SPC_Type *base, uint32_t maskValue) -{ - base->LP_CFG1 &= ~SPC_LP_CFG1_SOC_CNTRL(maskValue); -} - -/*! - * @brief Gets enabled analog modules that enabled in low power modes. - * - * @param base SPC peripheral base address. - * - * @return The mask of enabled analog modules that enabled in low power modes. - */ -static inline uint32_t SPC_GetLowPowerModeEnabledAnalogModules(SPC_Type *base) -{ - return base->LP_CFG1; -} - -/*! @} */ - -/*! - * @name Voltage Detect Status - * @{ - */ -/*! - * @brief Get Voltage Detect Status Flags. - * - * @param base SPC peripheral base address. - * @return Voltage Detect Status Flags. See @ref _spc_voltage_detect_flags for details. - */ -static inline uint8_t SPC_GetVoltageDetectStatusFlag(SPC_Type *base) -{ - return (uint8_t)(base->VD_STAT); -} - -/*! - * @brief Clear Voltage Detect Status Flags. - * - * @param base SPC peripheral base address. - * @param mask The mask of the voltage detect status flags. See @ref _spc_voltage_detect_flags for details. - */ -static inline void SPC_ClearVoltageDetectStatusFlag(SPC_Type *base, uint8_t mask) -{ - base->VD_STAT |= mask; -} - -/*! @} */ - -/*! - * @name Voltage Detect configuration for Core voltage domain. - * @{ - */ - -/*! - * @brief Configs CORE voltage detect options. - * - * @note: Setting both the voltage detect interrupt and reset - * enable will cause interrupt to be generated on exit from reset. - * If those conditioned is not desired, interrupt/reset so only one is enabled. - * - * @param base SPC peripheral base address. - * @param config Pointer to spc_core_voltage_detect_config_t structure. - */ -void SPC_SetCoreVoltageDetectConfig(SPC_Type *base, const spc_core_voltage_detect_config_t *config); - -/*! - * @brief Locks Core voltage detect reset setting. - * - * This function locks core voltage detect reset setting. After invoking this function - * any configuration of Core voltage detect reset will be ignored. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_LockCoreVoltageDetectResetSetting(SPC_Type *base) -{ - base->VD_CORE_CFG |= SPC_VD_CORE_CFG_LOCK_MASK; -} - -/*! - * @brief Unlocks Core voltage detect reset setting. - * - * This function unlocks core voltage detect reset setting. If locks the Core - * voltage detect reset setting, invoking this function to unlock. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_UnlockCoreVoltageDetectResetSetting(SPC_Type *base) -{ - base->VD_CORE_CFG &= ~SPC_VD_CORE_CFG_LOCK_MASK; -} - -/*! - * @brief Enables/Disables the Core Low Voltage Detector in Active mode. - * - * @note If the CORE_LDO low voltage detect is enabled in Active mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable Core LVD. - * true - Enable Core Low voltage detector in active mode. - * false - Disable Core Low voltage detector in active mode. - * - * @retval #kStatus_Success Enable/Disable Core Low Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeCoreLowVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disables the Core Low Voltage Detector in Low Power mode. - * - * This function enables/disables the Core Low Voltage Detector. - * If enabled the Core Low Voltage detector. The Bandgap mode in - * low power mode must be programmed so that Bandgap is enabled. - * - * @note If the CORE_LDO low voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Low Power mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable Core HVD. - * true - Enable Core Low voltage detector in low power mode. - * false - Disable Core Low voltage detector in low power mode. - * - * @retval #kStatus_Success Enable/Disable Core Low Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeCoreLowVoltageDetect(SPC_Type *base, bool enable); - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) && FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD) -/*! - * @brief Enables/Disables the Core High Voltage Detector in Active mode. - * - * @note If the CORE_LDO high voltage detect is enabled in Active mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable Core HVD. - * true - Enable Core High voltage detector in active mode. - * false - Disable Core High voltage detector in active mode. - * - * @retval #kStatus_Success Enable/Disable Core High Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeCoreHighVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disables the Core High Voltage Detector in Low Power mode. - * - * This function enables/disables the Core High Voltage Detector. - * If enabled the Core High Voltage detector. The Bandgap mode in - * low power mode must be programmed so that Bandgap is enabled. - * - * @note If the CORE_LDO high voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in low power mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable Core HVD. - * true - Enable Core High voltage detector in low power mode. - * false - Disable Core High voltage detector in low power mode. - * - * @retval #kStatus_Success Enable/Disable Core High Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeCoreHighVoltageDetect(SPC_Type *base, bool enable); -#endif /* FSL_FEATURE_MCX_SPC_HAS_COREVDD_HVD */ - -/*! @} */ - -/*! - * @name Voltage detect configuration for System Voltage domain - * @{ - */ -/*! - * @brief Set system VDD Low-voltage level selection. - * - * This function selects the system VDD low-voltage level. Changing system VDD low-voltage level - * must be done after disabling the System VDD low voltage reset and interrupt. - * - * @deprecated In latest RM, reserved for all devices, will removed in next release. - * - * @param base SPC peripheral base address. - * @param level System VDD Low-Voltage level selection. - */ -void SPC_SetSystemVDDLowVoltageLevel(SPC_Type *base, spc_low_voltage_level_select_t level); - -/*! - * @brief Configs SYS voltage detect options. - * - * This function config SYS voltage detect options. - * @note: Setting both the voltage detect interrupt and reset - * enable will cause interrupt to be generated on exit from reset. - * If those conditioned is not desired, interrupt/reset so only one is enabled. - * - * @param base SPC peripheral base address. - * @param config Pointer to spc_system_voltage_detect_config_t structure. - */ -void SPC_SetSystemVoltageDetectConfig(SPC_Type *base, const spc_system_voltage_detect_config_t *config); - -/*! - * @brief Lock System voltage detect reset setting. - * - * This function locks system voltage detect reset setting. After invoking this function - * any configuration of System Voltage detect reset will be ignored. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_LockSystemVoltageDetectResetSetting(SPC_Type *base) -{ - base->VD_SYS_CFG |= SPC_VD_SYS_CFG_LOCK_MASK; -} - -/*! - * @brief Unlock System voltage detect reset setting. - * - * This function unlocks system voltage detect reset setting. If locks the System - * voltage detect reset setting, invoking this function to unlock. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_UnlockSystemVoltageDetectResetSetting(SPC_Type *base) -{ - base->VD_SYS_CFG &= ~SPC_VD_SYS_CFG_LOCK_MASK; -} - -/*! - * @brief Enables/Disables the System High Voltage Detector in Active mode. - * - * @note If the System_LDO high voltage detect is enabled in Active mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Active mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable System HVD. - * true - Enable System High voltage detector in active mode. - * false - Disable System High voltage detector in active mode. - * - * @retval #kStatus_Success Enable/Disable System High Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeSystemHighVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disable the System Low Voltage Detector in Active mode. - * - * @note If the System_LDO low voltage detect is enabled in Active mode, - * please note that the bandgap must be enabled and the drive strength of each - * regulator must not set to low in Active mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable System LVD. - * true - Enable System Low voltage detector in active mode. - * false - Disable System Low voltage detector in active mode. - * - * @retval #kStatus_Success Enable/Disable the System Low Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeSystemLowVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disables the System High Voltage Detector in Low Power mode. - * - * @note If the System_LDO high voltage detect is enabled in Low Power mode, please note - * that the bandgap must be enabled and the drive strength of each regulator must - * not set to low in Low Power mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable System HVD. - * true - Enable System High voltage detector in low power mode. - * false - Disable System High voltage detector in low power mode. - * - * @retval #kStatus_Success Enable/Disable System High Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeSystemHighVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disables the System Low Voltage Detector in Low Power mode. - * - * @note If the System_LDO low voltage detect is enabled in Low Power mode, - * please note that the bandgap must be enabled and the drive strength of each - * regulator must not set to low in Low Power mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable System HVD. - * true - Enable System Low voltage detector in low power mode. - * false - Disable System Low voltage detector in low power mode. - * - * @retval #kStatus_Success Enables System Low Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeSystemLowVoltageDetect(SPC_Type *base, bool enable); - -/*! @} */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) && FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD) -/*! - * @name Voltage detect configuration for IO voltage domain - * @{ - */ -/*! - * @brief Set IO VDD Low-Voltage level selection. - * - * This function selects the IO VDD Low-voltage level. Changing IO VDD low-voltage level - * must be done after disabling the IO VDD low voltage reset and interrupt. - * - * @param base SPC peripheral base address. - * @param level IO VDD Low-voltage level selection. - */ -void SPC_SetIOVDDLowVoltageLevel(SPC_Type *base, spc_low_voltage_level_select_t level); - -/*! - * @brief Configs IO voltage detect options. - * - * This function config IO voltage detect options. - * @note: Setting both the voltage detect interrupt and reset - * enable will cause interrupt to be generated on exit from reset. - * If those conditioned is not desired, interrupt/reset so only one is enabled. - * - * @param base SPC peripheral base address. - * @param config Pointer to spc_voltage_detect_config_t structure. - */ -void SPC_SetIOVoltageDetectConfig(SPC_Type *base, const spc_io_voltage_detect_config_t *config); - -/*! - * @brief Lock IO Voltage detect reset setting. - * - * This function locks IO voltage detect reset setting. After invoking this function - * any configuration of system voltage detect reset will be ignored. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_LockIOVoltageDetectResetSetting(SPC_Type *base) -{ - base->VD_IO_CFG |= SPC_VD_IO_CFG_LOCK_MASK; -} - -/*! - * @brief Unlock IO voltage detect reset setting. - * - * This function unlocks IO voltage detect reset setting. If locks the IO - * voltage detect reset setting, invoking this function to unlock. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_UnlockIOVoltageDetectResetSetting(SPC_Type *base) -{ - base->VD_IO_CFG &= ~SPC_VD_IO_CFG_LOCK_MASK; -} - -/*! - * @brief Enables/Disables the IO High Voltage Detector in Active mode. - * - * @note If the IO high voltage detect is enabled in Active mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Active mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable IO HVD. - * true - Enable IO High voltage detector in active mode. - * false - Disable IO High voltage detector in active mode. - * - * @retval #kStatus_Success Enable/Disable IO High Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeIOHighVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disables the IO Low Voltage Detector in Active mode. - * - * @note If the IO low voltage detect is enabled in Active mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Active mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable IO LVD. - * true - Enable IO Low voltage detector in active mode. - * false - Disable IO Low voltage detector in active mode. - * - * @retval #kStatus_Success Enable IO Low Voltage Detect successfully. - */ -status_t SPC_EnableActiveModeIOLowVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disables the IO High Voltage Detector in Low Power mode. - * - * @note If the IO high voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Low Power mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable IO HVD. - * true - Enable IO High voltage detector in low power mode. - * false - Disable IO High voltage detector in low power mode. - * - * @retval #kStatus_Success Enable IO High Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeIOHighVoltageDetect(SPC_Type *base, bool enable); - -/*! - * @brief Enables/Disables the IO Low Voltage Detector in Low Power mode. - * - * @note If the IO low voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled - * and the drive strength of each regulator must not set to low in Low Power mode. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable IO LVD. - * true - Enable IO Low voltage detector in low power mode. - * false - Disable IO Low voltage detector in low power mode. - * - * @retval #kStatus_Success Enable/Disable IO Low Voltage Detect in low power mode successfully. - */ -status_t SPC_EnableLowPowerModeIOLowVoltageDetect(SPC_Type *base, bool enable); - -/*! @} */ - -#endif /* FSL_FEATURE_MCX_SPC_HAS_IOVDD_VD */ - -/*! - * @name External Voltage domains configuration - * @{ - */ -/*! - * @brief Configs external voltage domains - * - * This function configs external voltage domains isolation. - * - * @param base SPC peripheral base address. - * @param lowPowerIsoMask The mask of external domains isolate enable during low power mode. Please read the Reference - * Manual for the Bitmap. - * @param IsoMask The mask of external domains isolate. Please read the Reference Manual for the Bitmap. - */ -void SPC_SetExternalVoltageDomainsConfig(SPC_Type *base, uint8_t lowPowerIsoMask, uint8_t IsoMask); - -/*! - * @brief Gets External Domains status. - * - * @param base SPC peripheral base address. - * @return The status of each external domain. - */ -static inline uint8_t SPC_GetExternalDomainsStatus(SPC_Type *base) -{ - return (uint8_t)(base->EVD_CFG >> SPC_EVD_CFG_REG_EVDSTAT_SHIFT); -} - -/*! @} */ - -/*! - * @name Low Level APIs To Set CORE LDO Regulator - * @{ - */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_CNTRL_REG) && FSL_FEATURE_MCX_SPC_HAS_CNTRL_REG) -/*! - * @brief Enable/Disable Core LDO regulator. - * - * @note The CORE LDO enable bit is write-once. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable CORE LDO Regulator. - * true - Enable CORE LDO Regulator. - * false - Disable CORE LDO Regulator. - */ -static inline void SPC_EnableCoreLDORegulator(SPC_Type *base, bool enable) -{ - if (enable) - { - base->CNTRL |= SPC_CNTRL_CORELDO_EN_MASK; - } - else - { - /* - * $Branch Coverage Justification$ - * If CORE_LDO is disabled, all RAMs data will powered off. - */ - base->CNTRL &= ~SPC_CNTRL_CORELDO_EN_MASK; - } -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_CNTRL_REG */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DPDOWN_PULLDOWN_DISABLE_BIT) && \ - FSL_FEATURE_MCX_SPC_HAS_DPDOWN_PULLDOWN_DISABLE_BIT) -/*! - * @brief Enable/Disable the CORE LDO Regulator pull down in Deep Power Down. - * - * @note This function only useful when enabled the CORE LDO Regulator. - * - * @param base SPC peripheral base address. - * @param pulldown Enable/Disable CORE LDO pulldown in Deep Power Down mode. - * true - CORE LDO Regulator will discharge in Deep Power Down mode. - * false - CORE LDO Regulator will not discharge in Deep Power Down mode. - */ -static inline void SPC_PullDownCoreLDORegulator(SPC_Type *base, bool pulldown) -{ - if (pulldown) - { - base->CORELDO_CFG &= ~SPC_CORELDO_CFG_DPDOWN_PULLDOWN_DISABLE_MASK; - } - else - { - base->CORELDO_CFG |= SPC_CORELDO_CFG_DPDOWN_PULLDOWN_DISABLE_MASK; - } -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_DPDOWN_PULLDOWN_DISABLE_BIT */ - -/*! - * @brief Configs Core LDO Regulator in Active mode. - * - * @note The bandgap must be enabled before invoking this function. - * @note To set Core LDO as low drive strength, all HVDs/LVDs must be disabled previously. - * - * @param base SPC peripheral base address. - * @param option Pointer to the spc_active_mode_core_ldo_option_t structure. - * - * @retval kStatus_Success Config Core LDO regulator in Active power mode successful. - * @retval kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * @retval kStatus_SPC_BandgapModeWrong Bandgap should be enabled before invoking this function. - * @retval kStatus_SPC_CORELDOLowDriveStrengthIgnore To set Core LDO as low drive strength, - * all LVDs/HVDs must be disabled before invoking this function. - */ -status_t SPC_SetActiveModeCoreLDORegulatorConfig(SPC_Type *base, const spc_active_mode_core_ldo_option_t *option); - -/*! - * @brief Set Core LDO Regulator Voltage level in Active mode. - * - * @param base SPC peripheral base address. - * @param voltageLevel Specify the voltage level of CORE LDO Regulator in Active mode, please - refer to @ref spc_core_ldo_voltage_level_t. - * - * @note In active mode, the Core LDO voltage level should only be changed when the - * Core LDO is in normal drive strength. - * - * @note Update Core LDO voltage level will set Busy flag, - * this function return only when busy flag is cleared by hardware - * - * @retval kStatus_SPC_CORELDOVoltageSetFail The drive strength of Core LDO is not normal. - * @retval kStatus_Success Set Core LDO regulator voltage level in Active power mode successful. - */ -status_t SPC_SetActiveModeCoreLDORegulatorVoltageLevel(SPC_Type *base, spc_core_ldo_voltage_level_t voltageLevel); - -/*! - * @brief Gets CORE LDO Regulator Voltage level. - * - * This function returns the voltage level of CORE LDO Regulator in Active mode. - * - * @param base SPC peripheral base address. - * @return Voltage level of CORE LDO in type of @ref spc_core_ldo_voltage_level_t enumeration. - */ -static inline spc_core_ldo_voltage_level_t SPC_GetActiveModeCoreLDOVDDVoltageLevel(SPC_Type *base) -{ - return (spc_core_ldo_voltage_level_t)(uint32_t)((base->ACTIVE_CFG & SPC_ACTIVE_CFG_CORELDO_VDD_LVL_MASK) >> - SPC_ACTIVE_CFG_CORELDO_VDD_LVL_SHIFT); -} - -#if (defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) -/*! - * @brief Set Core LDO VDD Regulator Drive Strength in Active mode. - * - * @param base SPC peripheral base address. - * @param driveStrength Specify the drive strength of CORE LDO Regulator in Active mode, please - refer to @ref spc_core_ldo_drive_strength_t. - * - * @retval #kStatus_Success Set Core LDO regulator drive strength in Active power mode successful. - * @retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore If any voltage detect enabled, - core_ldo's drive strength can not set to low. - * @retval #kStatus_SPC_BandgapModeWrong The selected bandgap mode is not allowed. - */ -status_t SPC_SetActiveModeCoreLDORegulatorDriveStrength(SPC_Type *base, spc_core_ldo_drive_strength_t driveStrength); - -/*! - * @brief Gets CORE LDO VDD Regulator Drive Strength in Active mode. - * - * @param base SPC peripheral base address. - * @return Drive Strength of CORE LDO regulator in Active mode, please refer to @ref spc_core_ldo_drive_strength_t. - */ -static inline spc_core_ldo_drive_strength_t SPC_GetActiveModeCoreLDODriveStrength(SPC_Type *base) -{ - return (spc_core_ldo_drive_strength_t)(uint32_t)((base->ACTIVE_CFG & SPC_ACTIVE_CFG_CORELDO_VDD_DS_MASK) >> - SPC_ACTIVE_CFG_CORELDO_VDD_DS_SHIFT); -} -#endif /* defined(FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS) && FSL_FEATURE_SPC_HAS_CORELDO_VDD_DS */ - -/*! - * @brief Configs CORE LDO Regulator in low power mode - * - * This function configs CORE LDO Regulator in Low Power mode. - * If CORE LDO VDD Drive Strength is set to Normal, the CORE LDO VDD regulator voltage - * level in Active mode must be equal to the voltage level in Low power mode. And the Bandgap - * must be programmed to select bandgap enabled. - * Core VDD voltage levels for the Core LDO low power regulator can only be changed when the CORE - * LDO Drive Strength set as Normal. - * - * @param base SPC peripheral base address. - * @param option Pointer to the spc_lowpower_mode_core_ldo_option_t structure. - * - * @retval #kStatus_Success Config Core LDO regulator in power mode successfully. - * @retval #kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * @retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore Set driver strength to low will be ignored. - * @retval #kStatus_SPC_CORELDOVoltageSetFail. Fail to change Core LDO voltage level. - */ -status_t SPC_SetLowPowerModeCoreLDORegulatorConfig(SPC_Type *base, const spc_lowpower_mode_core_ldo_option_t *option); - -/*! - * @brief Set Core LDO VDD Regulator Voltage level in Low power mode. - * - * @note If CORE LDO's drive strength is set to Normal, the CORE LDO VDD regulator voltage in active mode and low power - * mode must be same. - * @note Voltage level for the CORE LDO in low power mode can only be changed when the CORE LDO Drive Strength set as - * Normal. - * - * @param base SPC peripheral base address. - * @param voltageLevel Voltage level of CORE LDO Regulator in Low power mode, please - refer to @ref spc_core_ldo_voltage_level_t. - * - * @retval #kStatus_SPC_CORELDOVoltageWrong Voltage level in active mode and low power mode is not same. - * @retval #kStatus_Success Set Core LDO regulator voltage level in Low power mode successful. - * @retval #kStatus_SPC_CORELDOVoltageSetFail Fail to update voltage level because drive strength is incorrect. - */ -status_t SPC_SetLowPowerModeCoreLDORegulatorVoltageLevel(SPC_Type *base, spc_core_ldo_voltage_level_t voltageLevel); - -/*! - * @brief Gets the CORE LDO VDD Regulator Voltage Level for Low Power modes. - * - * @param base SPC peripheral base address. - * @return The CORE LDO VDD Regulator's voltage level. - */ -static inline spc_core_ldo_voltage_level_t SPC_GetLowPowerCoreLDOVDDVoltageLevel(SPC_Type *base) -{ - return ((spc_core_ldo_voltage_level_t)(uint32_t)((base->LP_CFG & SPC_LP_CFG_CORELDO_VDD_LVL_MASK) >> - SPC_LP_CFG_CORELDO_VDD_LVL_SHIFT)); -} - -/*! - * @brief Set Core LDO VDD Regulator Drive Strength in Low power mode. - * - * @param base SPC peripheral base address. - * @param driveStrength Specify drive strength of CORE LDO in low power mode. - * - * @retval #kStatus_SPC_CORELDOLowDriveStrengthIgnore Some voltage detect enabled, CORE LDO's drive strength can not set - * as low. - * @retval #kStatus_Success Set Core LDO regulator drive strength in Low power mode successful. - * @retval #kStatus_SPC_BandgapModeWrong Bandgap is disabled when attempt to set CORE LDO work as normal drive strength. - */ -status_t SPC_SetLowPowerModeCoreLDORegulatorDriveStrength(SPC_Type *base, spc_core_ldo_drive_strength_t driveStrength); - -/*! - * @brief Gets CORE LDO VDD Drive Strength for Low Power modes. - * - * @param base SPC peripheral base address. - * @return The CORE LDO's VDD Drive Strength. - */ -static inline spc_core_ldo_drive_strength_t SPC_GetLowPowerCoreLDOVDDDriveStrength(SPC_Type *base) -{ - return (spc_core_ldo_drive_strength_t)(uint32_t)((base->LP_CFG & SPC_LP_CFG_CORELDO_VDD_DS_MASK) >> - SPC_LP_CFG_CORELDO_VDD_DS_SHIFT); -} - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) && FSL_FEATURE_MCX_SPC_HAS_SYS_LDO) -/*! - * @name Low Level APIs To Set System LDO Regulator - * @{ - */ - -/*! - * @brief Enable/Disable System LDO regulator. - * - * @note The SYSTEM LDO enable bit is write-once. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable System LDO Regulator. - * true - Enable System LDO Regulator. - * false - Disable System LDO Regulator. - */ -static inline void SPC_EnableSystemLDORegulator(SPC_Type *base, bool enable) -{ - if (enable) - { - base->CNTRL |= SPC_CNTRL_SYSLDO_EN_MASK; - } - else - { - /* - * $Branch Coverage Justification$ - * If SYSTEM_LDO is disabled, may cause some unexpected issues. - */ - base->CNTRL &= ~SPC_CNTRL_SYSLDO_EN_MASK; - } -} - -/*! - * @brief Enable/Disable current sink feature of System LDO Regulator. - * - * @param base SPC peripheral base address. - * @param sink Enable/Disable current sink feature. - * true - Enable current sink feature of System LDO Regulator. - * false - Disable current sink feature of System LDO Regulator. - */ -static inline void SPC_EnableSystemLDOSinkFeature(SPC_Type *base, bool sink) -{ - if (sink) - { - base->SYSLDO_CFG |= SPC_SYSLDO_CFG_ISINKEN_MASK; - } - else - { - base->SYSLDO_CFG &= ~SPC_SYSLDO_CFG_ISINKEN_MASK; - } -} - -/*! - * @brief Configs System LDO VDD Regulator in Active mode. - * - * @note If System LDO VDD Drive Strength is set to Normal, the Bandgap mode in Active mode must be programmed - * to a value that enables the bandgap. - * @note If any voltage detects are kept enabled, configuration to set System LDO VDD drive strength to low will - * be ignored. - * @note If select System LDO VDD Regulator voltage level to Over Drive Voltage, the Drive Strength of System LDO VDD - * Regulator must be set to Normal otherwise the regulator Drive Strength will be forced to Normal. - * @note If select System LDO VDD Regulator voltage level to Over Drive Voltage, the High voltage detect must be - * disabled. Otherwise it will be fail to regulator to Over Drive Voltage. - * - * @param base SPC peripheral base address. - * @param option Pointer to the spc_active_mode_sys_ldo_option_t structure. - * - * @retval #kStatus_Success Config System LDO regulator in Active power mode successful. - * @retval #kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * @retval #kStatus_SPC_BandgapModeWrong The bandgap is not enabled before invoking this function. - * @retval #kStatus_SPC_SYSLDOOverDriveVoltageFail HVD of System VDD is not disable before setting to Over Drive - * voltage. - * @retval kStatus_SPC_SYSLDOLowDriveStrengthIgnore Set System LDO VDD regulator's driver strength to Low will be - * ignored. - */ -status_t SPC_SetActiveModeSystemLDORegulatorConfig(SPC_Type *base, const spc_active_mode_sys_ldo_option_t *option); - -/*! - * @brief Set System LDO Regulator voltage level in Active mode. - * - * @note The system LDO regulator can only operate at the overdrive voltage level for a limited amount of time for the - * life of chip. - * - * @param base SPC peripheral base address. - * @param voltageLevel Specify the voltage level of System LDO Regulator in Active mode. - * - * @retval #kStatus_Success Set System LDO Regulator voltage level in Active mode successfully. - * @retval #kStatus_SPC_SYSLDOOverDriveVoltageFail Must disable system LDO high voltage detector before specifing - * overdrive voltage. - */ -status_t SPC_SetActiveModeSystemLDORegulatorVoltageLevel(SPC_Type *base, spc_sys_ldo_voltage_level_t voltageLevel); - -/*! - * @brief Get System LDO Regulator voltage level in Active mode. - * - * @param base SPC peripheral base address. - * @return System LDO Regulator voltage level in Active mode, please refer to @ref spc_sys_ldo_voltage_level_t. - */ -static inline spc_sys_ldo_voltage_level_t SPC_GetActiveModeSystemLDORegulatorVoltageLevel(SPC_Type *base) -{ - return (spc_sys_ldo_voltage_level_t)(uint32_t)((base->ACTIVE_CFG & SPC_ACTIVE_CFG_SYSLDO_VDD_LVL_MASK) >> - SPC_ACTIVE_CFG_SYSLDO_VDD_LVL_SHIFT); -} - -/*! - * @brief Set System LDO Regulator Drive Strength in Active mode. - * - * @param base SPC peripheral base address. - * @param driveStrength Specify the drive strength of System LDO Regulator in Active mode. - * - * @retval #kStatus_Success Set System LDO Regulator drive strength in Active mode successfully. - * @retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Attempt to specify low drive strength is ignored due to any - voltage detect feature is enabled in active mode. - * @retval #kStatus_SPC_BandgapModeWrong Bandgap mode in Active mode must be programmed to a value that enables - the bandgap if attempt to specify normal drive strength. - */ -status_t SPC_SetActiveModeSystemLDORegulatorDriveStrength(SPC_Type *base, spc_sys_ldo_drive_strength_t driveStrength); - -/*! - * @brief Get System LDO Regulator Drive Strength in Active mode. - * - * @param base SPC peripheral base address. - * @return System LDO regulator drive strength in Active mode, please refer to @ref spc_sys_ldo_drive_strength_t. - */ -static inline spc_sys_ldo_drive_strength_t SPC_GetActiveModeSystemLDORegulatorDriveStrength(SPC_Type *base) -{ - return (spc_sys_ldo_drive_strength_t)(uint32_t)((base->ACTIVE_CFG & SPC_ACTIVE_CFG_SYSLDO_VDD_DS_MASK) >> - SPC_ACTIVE_CFG_SYSLDO_VDD_DS_SHIFT); -} - -/*! - * @brief Configs System LDO regulator in low power modes. - * - * This function configs System LDO regulator in low power modes. - * If System LDO VDD Regulator Drive strength is set to normal, bandgap mode in low power - * mode must be programmed to a value that enables the Bandgap. - * If any High voltage detectors or Low Voltage detectors are kept enabled, configuration - * to set System LDO Regulator drive strength as Low will be ignored. - * - * @param base SPC peripheral base address. - * @param option Pointer to spc_lowpower_mode_sys_ldo_option_t structure. - * - * @retval #kStatus_Success Config System LDO regulator in Low Power Mode successfully. - * @retval #kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * @retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Set driver strength to low will be ignored. - */ -status_t SPC_SetLowPowerModeSystemLDORegulatorConfig(SPC_Type *base, const spc_lowpower_mode_sys_ldo_option_t *option); - -/*! - * @brief Set System LDO Regulator drive strength in Low Power Mode. - * - * @param base SPC peripheral base address. - * @param driveStrength Specify the drive strength of System LDO Regulator in Low Power Mode. - * - * @retval #kStatus_Success Set System LDO Regulator drive strength in Low Power Mode successfully. - * @retval #kStatus_SPC_SYSLDOLowDriveStrengthIgnore Attempt to specify low drive strength is ignored due to any - voltage detect feature is enabled in low power mode. - * @retval #kStatus_SPC_BandgapModeWrong Bandgap mode in low power mode must be programmed to a value that enables - the bandgap if attempt to specify normal drive strength. - */ -status_t SPC_SetLowPowerModeSystemLDORegulatorDriveStrength(SPC_Type *base, spc_sys_ldo_drive_strength_t driveStrength); - -/*! - * @brief Get System LDO Regulator drive strength in Low Power Mode. - * - * @param base SPC peripheral base address. - * @return System LDO regulator drive strength in Low Power Mode, please refer to @ref spc_sys_ldo_drive_strength_t. - */ -static inline spc_sys_ldo_drive_strength_t SPC_GetLowPowerModeSystemLDORegulatorDriveStrength(SPC_Type *base) -{ - return (spc_sys_ldo_drive_strength_t)(uint32_t)((base->LP_CFG & SPC_LP_CFG_SYSLDO_VDD_DS_MASK) >> - SPC_LP_CFG_SYSLDO_VDD_DS_SHIFT); -} -/*! @} */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_SYS_LDO */ - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC) && FSL_FEATURE_MCX_SPC_HAS_DCDC) -/*! - * @name Low Level APIs To Set DCDC Regulator - * @{ - */ - -/*! - * @brief Enable/Disable DCDC Regulator. - * - * @note The DCDC enable bit is write-once, settings only reset after a POR, LVD, or HVD event. - * - * @param base SPC peripheral base address. - * @param enable Enable/Disable DCDC Regulator. - * true - Enable DCDC Regulator. - * false - Disable DCDC Regulator. - */ -static inline void SPC_EnableDCDCRegulator(SPC_Type *base, bool enable) -{ - if (enable) - { - base->CNTRL |= SPC_CNTRL_DCDC_EN_MASK; - } - else - { - /* - * $Branch Coverage Justification$ - * If DCDC is disabled, all RAMs data will powered off. - */ - base->CNTRL &= ~SPC_CNTRL_DCDC_EN_MASK; - } -} - -/*! - * @brief Config DCDC Burst options - * - * @param base SPC peripheral base address. - * @param config Pointer to spc_dcdc_burst_config_t structure. - */ -void SPC_SetDCDCBurstConfig(SPC_Type *base, spc_dcdc_burst_config_t *config); - -/*! - * @brief Trigger a software burst request to DCDC. - * - * @param base SPC peripheral base address. - */ -static inline void SPC_TriggerDCDCBurstRequest(SPC_Type *base) -{ - /* Blocking until previous DCDC burst completed. */ - while ((base->DCDC_BURST_CFG & SPC_DCDC_BURST_CFG_BURST_ACK_MASK) == 0UL) - { - } - - base->DCDC_BURST_CFG |= SPC_DCDC_BURST_CFG_BURST_REQ_MASK; -} - -/*! - * @brief Check if burst acknowlege flag is asserted. - * - * @param base SPC peripheral base address. - * - * @retval false DCDC burst not complete. - * @retval true DCDC burst complete. - */ -static inline bool SPC_CheckDCDCBurstAck(SPC_Type *base) -{ - return ((base->DCDC_BURST_CFG & SPC_DCDC_BURST_CFG_BURST_ACK_MASK) != 0UL); -} - -/*! - * @brief Clear DCDC busrt acknowledge flag. - * - * @param base SPC periphral base address. - */ -static inline void SPC_ClearDCDCBurstAckFlag(SPC_Type *base) -{ - base->DCDC_BURST_CFG |= SPC_DCDC_BURST_CFG_BURST_ACK_MASK; -} - -/*! - * @brief Set the count value of the reference clock to configure the period of DCDC not active. - * - * @note This function is only useful when DCDC's drive strength is set as pulse refresh. - * @note The pulse duration(time between on and off) is: reference clock period * (count + 2). - * - * @param base SPC peripheral base address. - * @param count The count value, 16 bit width. - */ -void SPC_SetDCDCRefreshCount(SPC_Type *base, uint16_t count); - -#if (defined(FSL_FEATURE_MCX_SPC_HAS_DCDC_CFG_BLEED_EN) && FSL_FEATURE_MCX_SPC_HAS_DCDC_CFG_BLEED_EN) -/*! - * @brief Enable a bleed resistor to discharge DCDC output when DCDC is disabled. - * - * @param base SPC peripheral base address. - * @param enable Used to enable/disable bleed resistor. - */ -static inline void SPC_EnableDCDCBleedResistor(SPC_Type *base, bool enable) -{ - if (enable) - { - base->DCDC_CFG |= SPC_DCDC_CFG_BLEED_EN_MASK; - } - else - { - base->DCDC_CFG &= ~SPC_DCDC_CFG_BLEED_EN_MASK; - } -} -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC_CFG_BLEED_EN */ - -/*! - * @brief Configs DCDC_CORE Regulator in Active mode. - * - * @note When changing the DCDC output voltage level, take care to change the CORE LDO voltage level. - * - * @param base SPC peripheral base address. - * @param option Pointer to the spc_active_mode_dcdc_option_t structure. - * - * @retval #kStatus_Success Config DCDC regulator in Active power mode successful. - * @retval #kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * @retval #kStatus_SPC_BandgapModeWrong Set DCDC_CORE Regulator drive strength to Normal, the Bandgap must be enabled. - */ -status_t SPC_SetActiveModeDCDCRegulatorConfig(SPC_Type *base, const spc_active_mode_dcdc_option_t *option); - -/*! - * @brief Set DCDC_CORE Regulator voltage level in Active mode. - * - * @note When changing the DCDC output voltage level, take care to change the CORE LDO voltage level. - * - * @param base SPC peripheral base address. - * @param voltageLevel Specify the DCDC_CORE Regulator voltage level, please refer to @ref spc_dcdc_voltage_level_t. - */ -static inline void SPC_SetActiveModeDCDCRegulatorVoltageLevel(SPC_Type *base, spc_dcdc_voltage_level_t voltageLevel) -{ - base->ACTIVE_CFG = - (base->ACTIVE_CFG & (~SPC_ACTIVE_CFG_DCDC_VDD_LVL_MASK)) | SPC_ACTIVE_CFG_DCDC_VDD_LVL(voltageLevel); -} - -/*! - * @brief Get DCDC_CORE Regulator voltage level in Active mode. - * - * @param base SPC peripheral base address. - * @return DCDC_CORE Regulator voltage level, please refer to @ref spc_dcdc_voltage_level_t. - */ -static inline spc_dcdc_voltage_level_t SPC_GetActiveModeDCDCRegulatorVoltageLevel(SPC_Type *base) -{ - return (spc_dcdc_voltage_level_t)((uint32_t)((base->ACTIVE_CFG & SPC_ACTIVE_CFG_DCDC_VDD_LVL_MASK) >> - SPC_ACTIVE_CFG_DCDC_VDD_LVL_SHIFT)); -} - -/*! - * @brief Set DCDC_CORE Regulator drive strength in Active mode. - * - * @note To set DCDC drive strength as Normal, the bandgap must be enabled. - * - * @param base SPC peripheral base address. - * @param driveStrength Specify the DCDC_CORE regulator drive strength, please refer to @ref spc_dcdc_drive_strength_t. - * - * @retval #kStatus_Success Set DCDC_CORE Regulator drive strength in Active mode successfully. - * @retval #kStatus_SPC_BandgapModeWrong Set DCDC_CORE Regulator drive strength to Normal, the Bandgap must be enabled. - */ -status_t SPC_SetActiveModeDCDCRegulatorDriveStrength(SPC_Type *base, spc_dcdc_drive_strength_t driveStrength); - -/*! - * @brief Get DCDC_CORE Regulator drive strength in Active mode. - * - * @param base SPC peripheral base address. - * @return DCDC_CORE Regulator drive strength, please refer to @ref spc_dcdc_drive_strength_t. - */ -static inline spc_dcdc_drive_strength_t SPC_GetActiveModeDCDCRegulatorDriveStrength(SPC_Type *base) -{ - return (spc_dcdc_drive_strength_t)((uint32_t)((base->ACTIVE_CFG & SPC_ACTIVE_CFG_DCDC_VDD_DS_MASK) >> - SPC_ACTIVE_CFG_DCDC_VDD_DS_SHIFT)); -} - -/*! - * @brief Configs DCDC_CORE Regulator in Low power modes. - * - * @note If DCDC_CORE Drive Strength is set to Normal, the Bandgap mode in Low Power mode must be programmed - * to a value that enables the Bandgap. - * @note In Deep Power Down mode, DCDC regulator is always turned off. - * - * @param base SPC peripheral base address. - * @param option Pointer to the spc_lowpower_mode_dcdc_option_t structure. - * - * @retval #kStatus_Success Config DCDC regulator in low power mode successfully. - * @retval #kStatus_SPC_Busy The SPC instance is busy to execute any type of power mode transition. - * @retval #kStatus_SPC_BandgapModeWrong The bandgap mode setting in Low Power mode is wrong. - */ -status_t SPC_SetLowPowerModeDCDCRegulatorConfig(SPC_Type *base, const spc_lowpower_mode_dcdc_option_t *option); - -/*! - * @brief Set DCDC_CORE Regulator drive strength in Low power mode. - * - * @note To set drive strength as normal, the bandgap must be enabled. - * - * @param base SPC peripheral base address. - * @param driveStrength Specify the DCDC_CORE Regulator drive strength, please refer to @ref spc_dcdc_drive_strength_t. - * - * @retval #kStatus_Success Set DCDC_CORE Regulator drive strength in Low power mode successfully. - * @retval #kStatus_SPC_BandgapModeWrong Set DCDC_CORE Regulator drive strength to Normal, the Bandgap must be enabled. - */ -status_t SPC_SetLowPowerModeDCDCRegulatorDriveStrength(SPC_Type *base, spc_dcdc_drive_strength_t driveStrength); - -/*! - * @brief Get DCDC_CORE Regulator drive strength in Low power mode. - * - * @param base SPC peripheral base address. - * @return DCDC_CORE Regulator drive strength, please refer to @ref spc_dcdc_drive_strength_t. - */ -static inline spc_dcdc_drive_strength_t SPC_GetLowPowerModeDCDCRegulatorDriveStrength(SPC_Type *base) -{ - return (spc_dcdc_drive_strength_t)((uint32_t)((base->LP_CFG & SPC_LP_CFG_DCDC_VDD_DS_MASK) >> - SPC_LP_CFG_DCDC_VDD_DS_SHIFT)); -} - -/*! - * @brief Set DCDC_CORE Regulator voltage level in Low power mode. - * - * @note To change DCDC level in Low-Power mode: - * 1. Configure LP_CFG[DCDC_VDD_LVL] to desired level; - * 2. Configure LP_CFG[DCDC_VDD_DS] to low driver strength; - * 3. Configure ACTIVE_CFG[DCDC_VDD_LVL] to same level programmed in #1. - * - * @note After invoking this function, the voltage level in active mode(wakeup from low power modes) also changed, - * if it is necessary, please invoke SPC_SetActiveModeDCDCRegulatorVoltageLevel() to change to desried voltage level. - * - * @param base SPC peripheral base address. - * @param voltageLevel Specify the DCDC_CORE Regulator voltage level, please refer to @ref spc_dcdc_voltage_level_t. - */ -static inline void SPC_SetLowPowerModeDCDCRegulatorVoltageLevel(SPC_Type *base, spc_dcdc_voltage_level_t voltageLevel) -{ - base->LP_CFG = (base->LP_CFG & (~SPC_LP_CFG_DCDC_VDD_LVL_MASK)) | SPC_LP_CFG_DCDC_VDD_LVL(voltageLevel); - (void)SPC_SetLowPowerModeDCDCRegulatorDriveStrength(base, kSPC_DCDC_LowDriveStrength); - SPC_SetActiveModeDCDCRegulatorVoltageLevel(base, voltageLevel); -} - -/*! - * @brief Get DCDC_CORE Regulator voltage level in Low power mode. - * - * @param base SPC peripheral base address. - * @return DCDC_CORE Regulator voltage level, please refer to @ref spc_dcdc_voltage_level_t. - */ -static inline spc_dcdc_voltage_level_t SPC_GetLowPowerModeDCDCRegulatorVoltageLevel(SPC_Type *base) -{ - return (spc_dcdc_voltage_level_t)((uint32_t)((base->LP_CFG & SPC_LP_CFG_DCDC_VDD_LVL_MASK) >> - SPC_LP_CFG_DCDC_VDD_LVL_SHIFT)); -} - -/*! @} */ -#endif /* FSL_FEATURE_MCX_SPC_HAS_DCDC */ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @} */ - -#endif /* FSL_SPC_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_syspm.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_syspm.c deleted file mode 100644 index 2fecd525bc6..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_syspm.c +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Copyright 2021-2022 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_syspm.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.syspm" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -#if (!(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)) && defined(SYSPM_CLOCKS) -/*! - * @brief Get instance number for ESYSPM. - * - * @param base ESYSPM peripheral base address. - */ -static uint32_t SYSPM_GetInstance(SYSPM_Type *base); -#endif - -/******************************************************************************* - * Variables - ******************************************************************************/ -#if (!(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)) && defined(SYSPM_CLOCKS) -/*! @brief Array to map SYSPM instance number to base pointer. */ -static SYSPM_Type *const s_syspmBases[] = SYSPM_BASE_PTRS; - -/*! @brief Array to map SYSPM instance number to clock name. */ -static const clock_ip_name_t s_syspmClockName[] = SYSPM_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/******************************************************************************* - * Code - ******************************************************************************/ -#if (!(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)) && defined(SYSPM_CLOCKS) -static uint32_t SYSPM_GetInstance(SYSPM_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_syspmBases); instance++) - { - if (s_syspmBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_syspmBases)); - - return instance; -} -#endif - -/* - * brief Initializes the SYSPM - * - * This function enables the SYSPM clock. - * - * param base SYSPM peripheral base address. - */ -void SYSPM_Init(SYSPM_Type *base) -{ -#if (!(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)) && defined(SYSPM_CLOCKS) - CLOCK_EnableClock(s_syspmClockName[SYSPM_GetInstance(base)]); -#endif -} - -/* - * brief Deinitializes the SYSPM - * - * This function disables the SYSPM clock. - * - * param base SYSPM peripheral base address. - */ -void SYSPM_Deinit(SYSPM_Type *base) -{ -#if (!(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)) && defined(SYSPM_CLOCKS) - CLOCK_DisableClock(s_syspmClockName[SYSPM_GetInstance(base)]); -#endif -} - -/*! - * @brief Select event counters - * - * @param base SYSPM peripheral base address. - * @param monitor syspm control monitor, see to #syspm_monitor_t. - * @param event syspm select event, see to #syspm_event_t. - * @param eventCode select which event to be counted in PMECTRx., see to table Events. - */ -void SYSPM_SelectEvent(SYSPM_Type *base, syspm_monitor_t monitor, syspm_event_t event, uint8_t eventCode) -{ - uint32_t pmcr; - uint8_t shift; - - shift = 7U * (uint8_t)event; - - pmcr = base->PMCR[(uint8_t)monitor].PMCR; - pmcr &= ~(SYSPM_PMCR_SELEVT1_MASK << shift); - pmcr |= SYSPM_PMCR_SELEVT1(eventCode) << shift; - - base->PMCR[(uint8_t)monitor].PMCR = pmcr; -} - -/*! - * @brief Reset event counters - * - * @param base SYSPM peripheral base address. - * @param monitor syspm control monitor, see to #syspm_monitor_t. - */ -void SYSPM_ResetEvent(SYSPM_Type *base, syspm_monitor_t monitor, syspm_event_t event) -{ - base->PMCR[(uint8_t)monitor].PMCR |= ((uint32_t)SYSPM_PMCR_RECTR1_MASK << (uint8_t)event); -} - -#if !((defined(FSL_FEATURE_SYSPM_HAS_PMCR_RICTR) && (FSL_FEATURE_SYSPM_HAS_PMCR_RICTR == 0U))) -/*! - * @brief Reset Instruction Counter - * - * @param base SYSPM peripheral base address. - * @param monitor syspm control monitor, see to #syspm_monitor_t. - */ -void SYSPM_ResetInstructionEvent(SYSPM_Type *base, syspm_monitor_t monitor) -{ - base->PMCR[(uint8_t)monitor].PMCR |= SYSPM_PMCR_RICTR_MASK; -} -#endif /* FSL_FEATURE_SYSPM_HAS_PMCR_RICTR */ - -/*! - * @brief Set count mode - * - * @param base SYSPM peripheral base address. - * @param monitor syspm control monitor, see to #syspm_monitor_t. - * @param mode syspm select counter mode, see to #syspm_mode_t. - */ -void SYSPM_SetCountMode(SYSPM_Type *base, syspm_monitor_t monitor, syspm_mode_t mode) -{ - base->PMCR[(uint8_t)monitor].PMCR = - (base->PMCR[(uint8_t)monitor].PMCR & ~SYSPM_PMCR_CMODE_MASK) | SYSPM_PMCR_CMODE(mode); -} - -/*! - * @brief Set Start/Stop Control - * - * @param base SYSPM peripheral base address. - * @param monitor syspm control monitor, see to #syspm_monitor_t. - * @param ssc This 3-bit field provides a three-phase mechanism to start/stop the counters. It includes a - * prioritized scheme with local start > local stop > global start > global stop > conditional - * TSTART > TSTOP. The global and conditional start/stop affect all configured PM/PSAM module concurrently so counters - * are "coherent". see to #syspm_startstop_control_t - */ -void SYSPM_SetStartStopControl(SYSPM_Type *base, syspm_monitor_t monitor, syspm_startstop_control_t ssc) -{ - base->PMCR[(uint8_t)monitor].PMCR = - (base->PMCR[(uint8_t)monitor].PMCR & ~SYSPM_PMCR_SSC_MASK) | SYSPM_PMCR_SSC(ssc); -} - -#if !((defined(FSL_FEATURE_SYSPM_HAS_PMCR_DCIFSH)) && (FSL_FEATURE_SYSPM_HAS_PMCR_DCIFSH == 0U)) -/*! - * @brief Disable Counters if Stopped or Halted - * - * @param base SYSPM peripheral base address. - * @param monitor syspm control monitor, see to #syspm_monitor_t. - */ -void SYSPM_DisableCounter(SYSPM_Type *base, syspm_monitor_t monitor) -{ - base->PMCR[(uint8_t)monitor].PMCR |= SYSPM_PMCR_DCIFSH_MASK; -} -#endif /* FSL_FEATURE_SYSPM_HAS_PMCR_DCIFSH */ - -/*! - * @brief This is the the 40-bits of eventx counter. - The value in this register increments each time the event - selected in PMCRx[SELEVTx] occurs. - * - * @param base SYSPM peripheral base address. - * @param monitor syspm control monitor, see to #syspm_monitor_t. - * @param event syspm select event, see to #syspm_event_t. - * @return get the the 40 bits of eventx counter. - */ -uint64_t SYSPM_GetEventCounter(SYSPM_Type *base, syspm_monitor_t monitor, syspm_event_t event) -{ - uint32_t highOld; - uint32_t high; - uint32_t low; - - highOld = base->PMCR[(uint8_t)monitor].PMECTR[(uint8_t)event].HI; - while (true) - { - low = base->PMCR[(uint8_t)monitor].PMECTR[(uint8_t)event].LO; - high = base->PMCR[(uint8_t)monitor].PMECTR[(uint8_t)event].HI; - if (high == highOld) - { - break; - } - else - { - highOld = high; - } - } - - return ((uint64_t)high << 32U) + low; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_syspm.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_syspm.h deleted file mode 100644 index bfa5bf28aa0..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_syspm.h +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright 2021-2022 NXP - * All rights reserved. - * - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_SYSPM_H_ -#define FSL_SYSPM_H_ - -#include "fsl_common.h" - -/*! @addtogroup syspm */ -/*! @{ */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief SYSPM driver version */ -#define FSL_SYSPM_DRIVER_VERSION (MAKE_VERSION(2, 2, 0)) - -/*! @} */ -/*! @brief syspm select control monitor */ -typedef enum _syspm_monitor -{ - kSYSPM_Monitor0 = 0U, /*!< Monitor 0 */ -#if (SYSPM_PMCR_COUNT > 1U) - kSYSPM_Monitor1 = 1U, /*!< Monitor 1 */ -#endif -} syspm_monitor_t; - -/*! @brief syspm select event */ -typedef enum _syspm_event -{ - kSYSPM_Event1 = 0U, /*!< Event 1 */ - kSYSPM_Event2 = 1U, /*!< Event 2 */ - kSYSPM_Event3 = 2U, /*!< Event 3 */ -} syspm_event_t; - -/*! @brief syspm set count mode */ -typedef enum _syspm_mode -{ - kSYSPM_BothMode = 0x00, /*!< count in both modes */ - kSYSPM_UserMode = 0x02, /*!< count only in user mode */ - kSYSPM_PrivilegedMode = 0x03, /*!< count only in privileged mode */ -} syspm_mode_t; - -/*! @brief syspm start/stop control */ -typedef enum _syspm_startstop_control -{ - kSYSPM_Idle = 0x00, /*!< idle >*/ - kSYSPM_LocalStop = 0x01, /*!< local stop */ - kSYSPM_LocalStart = 0x02, /*!< local start */ - KSYSPM_EnableTraceControl = 0x04, /*!< enable global TSTART/TSTOP */ - kSYSPM_GlobalStart = 0x05, /*!< global stop */ - kSYSPM_GlobalStop = 0x06, /*!< global start */ -} syspm_startstop_control_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /*_cplusplus. */ - -/*! - * @brief Initializes the SYSPM - * - * This function enables the SYSPM clock. - * - * @param base SYSPM peripheral base address. - */ -void SYSPM_Init(SYSPM_Type *base); - -/*! - * @brief Deinitializes the SYSPM - * - * This function disables the SYSPM clock. - * - * @param base SYSPM peripheral base address. - */ -void SYSPM_Deinit(SYSPM_Type *base); - -/*! - * @brief Select event counters - * - * @param base SYSPM peripheral base address. - * @param event syspm select event, see to #syspm_event_t. - * @param eventCode select which event to be counted in PMECTRx., see to table Events. - */ -void SYSPM_SelectEvent(SYSPM_Type *base, syspm_monitor_t monitor, syspm_event_t event, uint8_t eventCode); - -/*! - * @brief Reset event counters - * - * @param base SYSPM peripheral base address. - * @param monitor syspm control monitor, see to #syspm_monitor_t. - */ -void SYSPM_ResetEvent(SYSPM_Type *base, syspm_monitor_t monitor, syspm_event_t event); - -#if !((defined(FSL_FEATURE_SYSPM_HAS_PMCR_RICTR) && (FSL_FEATURE_SYSPM_HAS_PMCR_RICTR == 0U))) -/*! - * @brief Reset Instruction Counter - * - * @param base SYSPM peripheral base address. - * @param monitor syspm control monitor, see to #syspm_monitor_t. - */ -void SYSPM_ResetInstructionEvent(SYSPM_Type *base, syspm_monitor_t monitor); -#endif - -/*! - * @brief Set count mode - * - * @param base SYSPM peripheral base address. - * @param monitor syspm control monitor, see to #syspm_monitor_t. - * @param mode syspm select counter mode, see to #syspm_mode_t. - */ -void SYSPM_SetCountMode(SYSPM_Type *base, syspm_monitor_t monitor, syspm_mode_t mode); - -/*! - * @brief Set Start/Stop Control - * - * @param base SYSPM peripheral base address. - * @param monitor syspm control monitor, see to #syspm_monitor_t. - * @param ssc This 3-bit field provides a three-phase mechanism to start/stop the counters. It includes a - * prioritized scheme with local start > local stop > global start > global stop > conditional - * TSTART > TSTOP. The global and conditional start/stop affect all configured PM/PSAM module concurrently so counters - * are "coherent". see to #syspm_startstop_control_t - */ -void SYSPM_SetStartStopControl(SYSPM_Type *base, syspm_monitor_t monitor, syspm_startstop_control_t ssc); - -#if !((defined(FSL_FEATURE_SYSPM_HAS_PMCR_DCIFSH)) && (FSL_FEATURE_SYSPM_HAS_PMCR_DCIFSH == 0U)) -/*! - * @brief Disable Counters if Stopped or Halted - * - * @param base SYSPM peripheral base address. - * @param monitor syspm control monitor, see to #syspm_monitor_t. - */ -void SYSPM_DisableCounter(SYSPM_Type *base, syspm_monitor_t monitor); -#endif - -/*! - * @brief This is the the 40-bits of eventx counter. - The value in this register increments each time the event - selected in PMCRx[SELEVTx] occurs. - * - * @param base SYSPM peripheral base address. - * @param monitor syspm control monitor, see to #syspm_monitor_t. - * @param event syspm select event, see to #syspm_event_t. - * @return get the the 40 bits of eventx counter. - */ -uint64_t SYSPM_GetEventCounter(SYSPM_Type *base, syspm_monitor_t monitor, syspm_event_t event); - -#if defined(__cplusplus) -} -#endif /* __cplusplus*/ - -/*! @}*/ - -#endif /* FSL_SYSPM_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_tdet.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_tdet.c deleted file mode 100644 index 4caa262a500..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_tdet.c +++ /dev/null @@ -1,656 +0,0 @@ -/* - * Copyright 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_tdet.h" - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.tdet" -#endif - -/* all bits defined in the LOCK Register. */ -#define TDET_ALL_LC_MASK 0x00FF3FF0u - -/* all bits defined in the Interrupt Enable Register. */ -#define TDET_ALL_IER_MASK 0x00FF03FDu - -/* all bits defined in the Tamper Enable Register. */ -#define TDET_ALL_TER_MASK 0x00FF0FFCu - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * Weak implementation of TDET IRQ, should be re-defined by user when using TDET IRQ - */ -__WEAK void VBAT0_DriverIRQHandler(void) -{ - /* TDET generates IRQ until corresponding bit in STATUS is cleared by calling - * TDET_ClearStatusFlags(TDET0,kTDET_StatusAll); - * which clear all bits or kTDET_StatusXXX to clear only one bit - */ -} - -static bool tdet_IsRegisterWriteAllowed(DIGTMP_Type *base, uint32_t mask) -{ - bool retval; - - retval = false; - mask = mask & TDET_ALL_LC_MASK; - - /* specified LR bit(s) must be set */ - if (mask == (mask & base->LR)) - { - retval = true; - } - return retval; -} - -static status_t tdet_PinConfigure(DIGTMP_Type *base, const tdet_pin_config_t *pinConfig, uint32_t pin) -{ - uint32_t temp; - uint32_t mask; - status_t status; - - if ((tdet_IsRegisterWriteAllowed( - base, DIGTMP_LR_PDL_MASK | DIGTMP_LR_PPL_MASK | (((uint32_t)1u << DIGTMP_LR_GFL0_SHIFT) << pin))) && - (pinConfig != NULL)) - { - /* pin 0 to 7 selects bit0 to bit7 */ - mask = ((uint32_t)1u << pin); - - /* Pin Direction Register */ - temp = base->PDR; - temp &= ~mask; /* clear the bit */ - if (kTDET_TamperPinDirectionOut == pinConfig->pinDirection) - { - temp |= mask; /* set the bit, if configured */ - } - base->PDR = temp; - - /* Pin Polarity Register */ - temp = base->PPR; - temp &= ~mask; /* clear the bit */ - if (kTDET_TamperPinPolarityExpectInverted == pinConfig->pinPolarity) - { - temp |= mask; /* set the bit, if configured */ - } - base->PPR = temp; - - /* compute and set the configured value to the glitch filter register */ - temp = 0; - temp |= DIGTMP_PGFR_GFW(pinConfig->glitchFilterWidth); - temp |= DIGTMP_PGFR_GFP(pinConfig->glitchFilterPrescaler); - temp |= DIGTMP_PGFR_TPSW(pinConfig->tamperPinSampleWidth); - temp |= DIGTMP_PGFR_TPSF(pinConfig->tamperPinSampleFrequency); - temp |= DIGTMP_PGFR_TPEX(pinConfig->tamperPinExpected); - temp |= DIGTMP_PGFR_TPE(pinConfig->tamperPullEnable); - temp |= DIGTMP_PGFR_TPS(pinConfig->tamperPullSelect); - /* make sure the glitch filter is disabled when we configure glitch filter width */ - base->PGFR[pin] = temp; - /* add glitch filter enabled */ - if (pinConfig->glitchFilterEnable) - { - temp |= DIGTMP_PGFR_GFE(1u); - base->PGFR[pin] = temp; - } - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -static status_t tdet_ActiveTamperConfigure(DIGTMP_Type *base, - const tdet_active_tamper_config_t *activeTamperConfig, - uint32_t activeTamperRegister) -{ - uint32_t temp; - status_t status; - - /* check if writing to active tamper register is allowed */ - if ((tdet_IsRegisterWriteAllowed(base, ((uint32_t)1u << DIGTMP_LR_ATL0_SHIFT) << activeTamperRegister)) && - (activeTamperConfig != NULL)) - { - /* compute and set the configured value to the active tamper register */ - temp = 0; - temp |= DIGTMP_ATR_ATSR(activeTamperConfig->activeTamperShift); - temp |= DIGTMP_ATR_ATP(activeTamperConfig->activeTamperPolynomial); - base->ATR[activeTamperRegister] = temp; - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -/*! - * brief Initialize TDET - * - * This function initializes TDET. - * - * param base TDET peripheral base address - * return Status of the init operation - */ -status_t TDET_Init(DIGTMP_Type *base) -{ - return kStatus_Success; -} - -/*! - * brief Deinitialize TDET - * - * This function disables glitch filters and active tampers - * This function disables the TDET clock and prescaler in TDET Control Register. - * param base TDET peripheral base address - */ -void TDET_Deinit(DIGTMP_Type *base) -{ - uint32_t i, j, k; - j = ARRAY_SIZE(base->PGFR); - k = ARRAY_SIZE(base->ATR); - /* disable all glitch filters and active tampers */ - for (i = 0; i < j; i++) - { - base->PGFR[i] = 0; - } - for (i = 0; i < k; i++) - { - base->ATR[i] = 0; - } - - /* disable inner TDET clock and prescaler */ - base->CR &= ~DIGTMP_CR_DEN_MASK; -} - -/*! - * brief Gets default values for the TDET Control Register. - * - * This function fills the given structure with default values for the TDET Control Register. - * The default values are: - * code - * defaultConfig->innerClockAndPrescalerEnable = true - * defaultConfig->tamperForceSystemResetEnable = false - * defaultConfig->updateMode = kTDET_StatusLockWithTamper - * defaultConfig->clockSourceActiveTamper0 = kTDET_ClockType1Hz - * defaultConfig->clockSourceActiveTamper1 = kTDET_ClockType1Hz - * defaultConfig->disablePrescalerAfterTamper = false - * defaultConfig->prescaler = 0 - * endcode - * param base TDET peripheral base address - * param[out] defaultConfig Pointer to structure to be filled with default parameters - */ -void TDET_GetDefaultConfig(DIGTMP_Type *base, tdet_config_t *defaultConfig) -{ - /* Initializes the configure structure to zero. */ - (void)memset(defaultConfig, 0, sizeof(*defaultConfig)); - - struct _tdet_config myDefaultConfig = { - true, /* innerClockAndPrescalerEnable */ - false, /* tamperForceSystemResetEnable */ - kTDET_StatusLockWithTamper, /* updateMode */ - kTDET_ClockType1Hz, /* clockSourceActiveTamper0 */ - kTDET_ClockType1Hz, /* clockSourceActiveTamper1 */ - false, /* disable prescaler on tamper event */ - 0, /* prescaler */ - }; - - *defaultConfig = myDefaultConfig; -} - -/*! - * brief Writes to the TDET Control Register. - * - * This function writes the given structure to the TDET Control Register. - * param base TDET peripheral base address - * param config Pointer to structure with TDET peripheral configuration parameters - * return kStatus_Fail when writing to TDET Control Register is not allowed - * return kStatus_Success when operation completes successfully - */ -status_t TDET_SetConfig(DIGTMP_Type *base, const tdet_config_t *config) -{ - uint32_t tmpCR; - - status_t retval = kStatus_Fail; - - /* check if writing to CR is allowed */ - if ((tdet_IsRegisterWriteAllowed(base, DIGTMP_LR_CRL_MASK)) && (config != NULL)) - { - /* compute CR value */ - tmpCR = 0; - tmpCR |= DIGTMP_CR_TFSR(config->tamperForceSystemResetEnable); - tmpCR |= DIGTMP_CR_UM(config->updateMode); - tmpCR |= DIGTMP_CR_ATCS0(config->clockSourceActiveTamper0); - tmpCR |= DIGTMP_CR_ATCS1(config->clockSourceActiveTamper1); - tmpCR |= DIGTMP_CR_DISTAM(config->disablePrescalerAfterTamper); - tmpCR |= DIGTMP_CR_DPR(config->prescaler); - /* write the computed value to the CR register */ - base->CR = tmpCR; - /* after the prescaler is written to CR register, enable the inner TDET clock and prescaler */ - if (config->innerClockAndPrescalerEnable) - { - base->CR = tmpCR | DIGTMP_CR_DEN_MASK; - } - retval = kStatus_Success; - } - else - { - retval = kStatus_Fail; - } - - return retval; -} - -/*! - * brief Software reset. - * - * This function resets all TDET registers. The CR[SWR] itself is not affected; - * it is reset by VBAT POR only. - * - * param base TDET peripheral base address - * return kStatus_Fail when writing to TDET Control Register is not allowed - * return kStatus_Success when operation completes successfully - */ -status_t TDET_SoftwareReset(DIGTMP_Type *base) -{ - status_t retval = kStatus_Fail; - - /* check if writing to CR is allowed */ - if (tdet_IsRegisterWriteAllowed(base, DIGTMP_LR_CRL_MASK)) - { - /* set the CR[SWR] */ - base->CR = DIGTMP_CR_SWR_MASK; - retval = kStatus_Success; - } - else - { - retval = kStatus_Fail; - } - - return retval; -} - -/*! - * brief Writes to the active tamper register(s). - * - * This function writes per active tamper register parameters to active tamper register(s). - * - * param base TDET peripheral base address - * param activeTamperConfig Pointer to structure with active tamper register parameters - * param activeTamperRegisterSelect Bit mask for active tamper registers to be configured. The passed value is - * combination of tdet_active_tamper_register_t values (OR'ed). - * return kStatus_Fail when writing to TDET Active Tamper Register(s) is not allowed - * return kStatus_Success when operation completes successfully - */ -status_t TDET_ActiveTamperSetConfig(DIGTMP_Type *base, - const tdet_active_tamper_config_t *activeTamperConfig, - uint32_t activeTamperRegisterSelect) -{ - uint32_t mask; - status_t status; - uint32_t i, j; - - mask = 1u; - status = kStatus_Success; - j = ARRAY_SIZE(base->ATR); - /* configure active tamper register by active tamper register, by moving through all active tamper registers */ - for (i = 0; i < j; i++) - { - if ((activeTamperRegisterSelect & mask) != 0U) - { - /* configure this active tamper register */ - status = tdet_ActiveTamperConfigure(base, activeTamperConfig, i); - if (status != kStatus_Success) - { - break; - } - } - mask = mask << 1u; - } - - return status; -} - -/*! - * brief Gets default values for tamper pin configuration. - * - * This function fills the give structure with default values for the tamper pin and glitch filter configuration. - * The default values are: - * code - * pinConfig->pinPolarity = kTDET_TamperPinPolarityExpectNormal; - * pinConfig->pinDirection = kTDET_TamperPinDirectionIn; - * pinConfig->tamperPullEnable = false; - * pinConfig->tamperPinSampleFrequency = kTDET_GlitchFilterSamplingEveryCycle8; - * pinConfig->tamperPinSampleWidth = kTDET_GlitchFilterSampleDisable; - * pinConfig->glitchFilterEnable = false; - * pinConfig->glitchFilterPrescaler = kTDET_GlitchFilterClock512Hz; - * pinConfig->glitchFilterWidth = 0; - * pinConfig->tamperPinExpected = kTDET_GlitchFilterExpectedLogicZero; - * pinConfig->tamperPullSelect = kTDET_GlitchFilterPullTypeAssert; - * endcode - * - * param base TDET peripheral base address - * param[out] pinConfig Pointer to structure to be filled with tamper pins default parameters - */ -void TDET_PinGetDefaultConfig(DIGTMP_Type *base, tdet_pin_config_t *pinConfig) -{ - /* Initializes the configure structure to zero. */ - (void)memset(pinConfig, 0, sizeof(*pinConfig)); - - struct _tdet_pin_config myPinDefaultConfig = { - kTDET_TamperPinPolarityExpectNormal, /* pinPolarity */ - kTDET_TamperPinDirectionIn, /* pinDirection */ - false, /* tamperPullEnable */ - kTDET_GlitchFilterSamplingEveryCycle8, /* tamperPinSampleFrequency */ - kTDET_GlitchFilterSampleDisable, /* tamperPinSampleWidth */ - false, /* glitchFilterEnable */ - kTDET_GlitchFilterClock512Hz, /* glitchFilterPrescaler */ - 0, /* glitchFilterWidth */ - kTDET_GlitchFilterExpectedLogicZero, /* tamperPinExpected */ - kTDET_GlitchFilterPullTypeAssert, /* tamperPullSelect */ - }; - - *pinConfig = myPinDefaultConfig; -} - -/*! - * brief Writes the tamper pin configuration. - * - * This function writes per pin parameters to tamper pin and glitch filter configuration registers. - * - * param base TDET peripheral base address - * param pinConfig Pointer to structure with tamper pin and glitch filter configuration parameters - * param pinSelect Bit mask for tamper pins to be configured. The passed value is combination of - * enum _tdet_external_tamper_pin (tdet_external_tamper_pin_t) values (OR'ed). - * return kStatus_Fail when writing to TDET Pin Direction, Pin Polarity or Glitch Filter Register(s) is not allowed - * return kStatus_Success when operation completes successfully - */ -status_t TDET_PinSetConfig(DIGTMP_Type *base, const tdet_pin_config_t *pinConfig, uint32_t pinSelect) -{ - uint32_t mask; - status_t status; - uint32_t i, j; - - mask = 1u; - status = kStatus_Success; - j = ARRAY_SIZE(base->PGFR); - /* configure pin by pin, by moving through all selected pins */ - for (i = 0; i < j; i++) - { - if ((pinSelect & mask) != 0U) - { - /* clear this pin from pinSelect */ - pinSelect &= ~mask; - - /* configure this pin */ - status = tdet_PinConfigure(base, pinConfig, i); - - /* if pinSelect is zero, we have configured all pins selected by pinSelect, so skip */ - if ((status != kStatus_Success) || (0U == pinSelect)) - { - break; - } - } - mask = mask << 1u; - } - - return status; -} - -/*! - * brief Reads the Status Register. - * - * This function reads flag bits from TDET Status Register. - * - * param base TDET peripheral base address - * param[out] result Pointer to uint32_t where to write Status Register read value. Use tdet_status_flag_t to decode - * individual flags. - * return kStatus_Fail when Status Register reading is not allowed - * return kStatus_Success when result is written with the Status Register read value - */ -status_t TDET_GetStatusFlags(DIGTMP_Type *base, uint32_t *result) -{ - status_t status; - - if (result != NULL) - { - *result = base->SR; - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -/*! - * brief Writes to the Status Register. - * - * This function clears specified flag bits in TDET Status Register. - * - * param base TDET peripheral base address - * param mask Bit mask for the flag bits to be cleared. Use tdet_status_flag_t to encode flags. - * return kStatus_Fail when Status Register writing is not allowed - * return kStatus_Success when mask is written to the Status Register - */ -status_t TDET_ClearStatusFlags(DIGTMP_Type *base, uint32_t mask) -{ - status_t status; - - if (tdet_IsRegisterWriteAllowed(base, DIGTMP_LR_SRL_MASK)) - { - base->SR = mask; - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -/*! - * brief Writes to the Interrupt Enable Register. - * - * This function sets specified interrupt enable bits in TDET Interrupt Enable Register. - * - * param base TDET peripheral base address - * param mask Bit mask for the interrupt enable bits to be set. - * return kStatus_Fail when Interrupt Enable Register writing is not allowed - * return kStatus_Success when mask is written to the Interrupt Enable Register - */ -status_t TDET_EnableInterrupts(DIGTMP_Type *base, uint32_t mask) -{ - status_t status; - - mask = mask & TDET_ALL_IER_MASK; /* only set the bits documented in Reference Manual. */ - if (tdet_IsRegisterWriteAllowed(base, DIGTMP_LR_IEL_MASK)) - { - base->IER |= mask; - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -/*! - * brief Writes to the Interrupt Enable Register. - * - * This function clears specified interrupt enable bits in TDET Interrupt Enable Register. - * - * param base TDET peripheral base address - * param mask Bit mask for the interrupt enable bits to be cleared. - * return kStatus_Fail when Interrupt Enable Register writing is not allowed - * return kStatus_Success when specified bits are cleared in the Interrupt Enable Register - */ -status_t TDET_DisableInterrupts(DIGTMP_Type *base, uint32_t mask) -{ - status_t status; - - mask = mask & TDET_ALL_IER_MASK; /* only clear the bits documented in Reference Manual. */ - if (tdet_IsRegisterWriteAllowed(base, DIGTMP_LR_IEL_MASK)) - { - base->IER &= ~mask; - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -/*! - * brief Writes to the Tamper Enable Register. - * - * This function sets specified tamper enable bits in TDET Tamper Enable Register. - * - * param base TDET peripheral base address - * param mask Bit mask for the tamper enable bits to be set. - * return kStatus_Fail when Tamper Enable Register writing is not allowed - * return kStatus_Success when mask is written to the Tamper Enable Register - */ -status_t TDET_EnableTampers(DIGTMP_Type *base, uint32_t mask) -{ - status_t status; - - mask = mask & TDET_ALL_TER_MASK; /* only set the bits documented in Reference Manual */ - if (tdet_IsRegisterWriteAllowed(base, DIGTMP_LR_TEL_MASK)) - { - base->TER |= mask; - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -/*! - * brief Writes to the Tamper Enable Register. - * - * This function clears specified tamper enable bits in TDET Tamper Enable Register. - * - * param base TDET peripheral base address - * param mask Bit mask for the tamper enable bits to be cleared. - * return kStatus_Fail when Tamper Enable Register writing is not allowed - * return kStatus_Success when specified bits are cleared in the Tamper Enable Register - */ -status_t TDET_DisableTampers(DIGTMP_Type *base, uint32_t mask) -{ - status_t status; - - mask = mask & TDET_ALL_TER_MASK; /* only clear the bits documented in Reference Manual */ - if (tdet_IsRegisterWriteAllowed(base, DIGTMP_LR_TEL_MASK)) - { - base->TER &= ~mask; - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -/*! - * brief Writes to the Tamper Seconds Register. - * - * This function writes to TDET Tamper Seconds Register. This causes Status Register DTF flag to be set (TDET - * tampering detected). - * - * param base TDET peripheral base address - * return kStatus_Fail when Tamper Seconds Register writing is not allowed - * return kStatus_Success when Tamper Seconds Register is written - */ -status_t TDET_ForceTamper(DIGTMP_Type *base) -{ - status_t status; - - if (tdet_IsRegisterWriteAllowed(base, DIGTMP_LR_TSL_MASK)) - { - base->TSR = 0; - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -/*! - * brief Reads the Tamper Seconds Register. - * - * This function reads TDET Tamper Seconds Register. The read value returns the time in seconds at which the Status - * Register DTF flag was set. - * - * param base TDET peripheral base address - * param tamperTimeSeconds Time in seconds at which the tamper detection SR[DTF] flag was set. - * return kStatus_Fail when Tamper Seconds Register reading is not allowed - * return kStatus_Success when Tamper Seconds Register is read - */ -status_t TDET_GetTamperTimeSeconds(DIGTMP_Type *base, uint32_t *tamperTimeSeconds) -{ - status_t status; - - if (tamperTimeSeconds != NULL) - { - *tamperTimeSeconds = base->TSR; - status = kStatus_Success; - } - else - { - status = kStatus_Fail; - } - - return status; -} - -/*! - * brief Writes to the TDET Lock Register. - * - * This function clears specified lock bits in the TDET Lock Register. - * When a lock bit is clear, a write to corresponding TDET Register is ignored. - * Once cleared, these bits can only be set by VBAT POR or software reset. - * - * param base TDET peripheral base address - * param mask Bit mask for the lock bits to be cleared. Use tdet_register_t values to encode (OR'ed) which TDET - * Registers shall be locked. - */ -void TDET_LockRegisters(DIGTMP_Type *base, uint32_t mask) -{ - mask &= (uint32_t)kTDET_AllRegisters; /* make sure only documented registers are selected by the mask */ - base->LR &= ~mask; /* clear the selected bits */ -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_tdet.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_tdet.h deleted file mode 100644 index 78ecda6d87a..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_tdet.h +++ /dev/null @@ -1,601 +0,0 @@ -/* - * Copyright 2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_TDET_H_ -#define FSL_TDET_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup TDET - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief Defines TDET driver version 2.1.0. - * - * Change log: - * - Version 2.1.0 - * - Added setting of disabling prescaler on tamper event into TDET_SetConfig() and TDET_GetDefaultConfig functions. - * - Version 2.0.0 - * - Initial version - */ -#define FSL_TDET_DRIVER_VERSION (MAKE_VERSION(2, 1, 0)) -/*! @} */ - -/*! - * @brief TDET Update Mode. - * - * These constants allow TDET interrupts to be cleared if no tampering has been detected, while still preventing - * the TDET Tamper Flag (SR[DTF]) from being cleared once it is set. - */ -typedef enum _tdet_update_mode -{ - kTDET_StatusLockNormal = 0U, /*!< TDET Status Register cannot be written when the Status Register Lock bit - within the Lock Register (LR[SRL]) is clear */ - kTDET_StatusLockWithTamper = 1U, /*!< TDET Status Register cannot be written when the Status Register Lock bit - within the Lock Register (LR[SRL]) is clear and TDET Tamper Flag (SR[DTF]) - is set*/ -} tdet_update_mode_t; - -/*! - * @brief TDET Active Tamper Clock Source. - * - * These constants define the clock source for Active Tamper Shift Register to configure in a TDET base. - */ -typedef enum _tdet_active_tamper_clock -{ - kTDET_ClockType1Hz = 0U, /*!< clocked by 1 Hz prescaler clock */ - kTDET_ClockType64Hz = 1U, /*!< clocked by 614 Hz prescaler clock */ -} tdet_active_tamper_clock_t; - -/*! - * @brief TDET Control Register. - * - * This structure defines values for TDET Control Register. - */ -typedef struct _tdet_config -{ - bool innerClockAndPrescalerEnable; /*!< Enable/disable 32768 Hz clock within TDET and the TDET prescaler that - generates 512 Hz, 64Hz and 1 Hz prescaler clocks */ - bool tamperForceSystemResetEnable; /*!< Enable/disable assertion of chip reset when tampering is detected */ - enum _tdet_update_mode updateMode; /*!< Selects update mode for TDET Status Register */ - enum _tdet_active_tamper_clock - clockSourceActiveTamper0; /*!< Selects clock source for Active Tamper Shift Register 0 */ - enum _tdet_active_tamper_clock - clockSourceActiveTamper1; /*!< Selects clock source for Active Tamper Shift Register 1 */ - bool disablePrescalerAfterTamper; /*!< Allows the 32-KHz clock and prescaler to be automatically disabled after - tamper detection and until the system acknowledges the tamper. Disabling the - prescaler after detecting a tamper event conserves power and freezes the state - of the active tamper outputs and glitch filters. To ensure a clean transition, - the prescaler is disabled at the end of a 1 Hz period. */ - uint32_t prescaler; /*!< Initial value for the TDET prescaler 15-bit value. */ -} tdet_config_t; - -/*! - * @brief TDET Tamper Pin Polarity. - * - * These constants define tamper pin polarity to configure in a TDET base. - */ -typedef enum _tdet_pin_polarity -{ - kTDET_TamperPinPolarityExpectNormal = 0U, /*!< Tamper pin expected value is not inverted */ - kTDET_TamperPinPolarityExpectInverted = 1U, /*!< Tamper pin expected value is inverted */ -} tdet_pin_polarity_t; - -/*! - * @brief TDET Tamper Pin Direction. - * - * These constants define tamper pin direction to configure in a TDET base. - */ -typedef enum _tdet_pin_direction -{ - kTDET_TamperPinDirectionIn = 0U, /*!< Tamper pins configured as input */ - kTDET_TamperPinDirectionOut = 1U, /*!< Tamper pins configured as output, drives inverse of expected value */ -} tdet_pin_direction_t; - -/*! - * @brief TDET Glitch Filter Tamper Pin Sample Frequency. - * - * These constants define tamper pin glitch filter sample frequency to configure in a TDET base. - */ -typedef enum _tdet_glitch_filter_sample_freq -{ - kTDET_GlitchFilterSamplingEveryCycle8 = 0U, /*!< Sample once every 8 cycles */ - kTDET_GlitchFilterSamplingEveryCycle32 = 1U, /*!< Sample once every 32 cycles */ - kTDET_GlitchFilterSamplingEveryCycle128 = 2U, /*!< Sample once every 128 cycles */ - kTDET_GlitchFilterSamplingEveryCycle512 = 3U, /*!< Sample once every 512 cycles */ -} tdet_glitch_filter_sample_freq_t; -/*! - * @brief TDET Glitch Filter Tamper Pin Sample Width. - * - * These constants define tamper pin glitch filter sample width to configure in a TDET base. - */ -typedef enum _tdet_glitch_filter_sample_width -{ - kTDET_GlitchFilterSampleDisable = 0U, /*!< Sampling disabled */ - kTDET_GlitchFilterSampleCycle2 = 1U, /*!< Sample width pull enable/input buffer enable=2 cycles/1 cycle */ - kTDET_GlitchFilterSampleCycle4 = 2U, /*!< Sample width pull enable/input buffer enable=4 cycles/2 cycles */ - kTDET_GlitchFilterSampleCycle8 = 3U, /*!< Sample width pull enable/input buffer enable=8 cycles/4 cycles */ -} tdet_glitch_filter_sample_width_t; - -/*! - * @brief TDET Glitch Filter Tamper Pin Clock Source. - * - * These constants define tamper pin glitch filter clock source to configure in a TDET base. - */ -typedef enum _tdet_glitch_filter_prescaler -{ - kTDET_GlitchFilterClock512Hz = 0U, /*!< Glitch Filter on tamper pin is clocked by the 512 Hz prescaler clock */ - kTDET_GlitchFilterClock32768Hz = 1U, /*!< Glitch Filter on tamper pin is clocked by the 32768 Hz prescaler clock */ -} tdet_glitch_filter_prescaler_t; - -/*! - * @brief TDET Glitch Filter Tamper Pin Expected Value. - * - * These constants define tamper pin glitch filter expected value to configure in a TDET base. - */ -typedef enum _tdet_glitch_filter_expected -{ - kTDET_GlitchFilterExpectedLogicZero = 0U, /*!< Expected value is logic zero */ - kTDET_GlitchFilterExpectedActTamperOut0 = 1U, /*!< Expected value is active tamper 0 output */ - kTDET_GlitchFilterExpectedActTamperOut1 = 2U, /*!< Expected value is active tamper 1 output */ - kTDET_GlitchFilterExpectedActTamperOutXOR = - 3U, /*!< Expected value is active tamper 0 output XORed with active tamper 1 output */ -} tdet_glitch_filter_expected_t; - -/*! - * @brief TDET Glitch Filter Tamper Pull Select. - * - * These constants define tamper pin glitch filter pull direction to configure in a TDET base. - */ -typedef enum _tdet_glitch_filter_pull -{ - kTDET_GlitchFilterPullTypeAssert = 0U, /*!< Tamper pin pull direction always asserts the tamper pin. */ - kTDET_GlitchFilterPullTypeNegate = 1U, /*!< Tamper pin pull direction always negates the tamper pin. */ -} tdet_glitch_filter_pull_t; - -/*! - * @brief TDET Tamper Pin configuration registers. - * - * This structure defines values for TDET Pin Direction, Pin Polarity, and Glitch Filter registers. - */ -typedef struct _tdet_pin_config -{ - enum _tdet_pin_polarity pinPolarity; /*!< Selects tamper pin expected value */ - enum _tdet_pin_direction pinDirection; /*!< Selects tamper pin direction */ - bool tamperPullEnable; /*!< Enable/disable pull resistor on the tamper pin */ - enum _tdet_glitch_filter_sample_freq tamperPinSampleFrequency; /*!< Selects tamper pin sample frequency */ - enum _tdet_glitch_filter_sample_width tamperPinSampleWidth; /*!< Selects tamper pin sample width */ - bool glitchFilterEnable; /*!< Enable/disable glitch filter on the tamper pin */ - enum _tdet_glitch_filter_prescaler - glitchFilterPrescaler; /*!< Selects the prescaler for the glitch filter on tamper pin */ - - uint8_t glitchFilterWidth; /*!< 6-bit value to configure number of clock edges the input must remain stable for to - be passed through the glitch filter for the tamper pin */ - - enum _tdet_glitch_filter_expected tamperPinExpected; /*!< Selects tamper pin expected value */ - enum _tdet_glitch_filter_pull tamperPullSelect; /*!< Selects the direction of the tamper pin pull resistor */ -} tdet_pin_config_t; - -/*! @brief List of TDET external tampers */ -typedef enum _tdet_external_tamper_pin -{ - kTDET_ExternalTamper0 = 1U << 0, - kTDET_ExternalTamper1 = 1U << 1, - kTDET_ExternalTamper2 = 1U << 2, - kTDET_ExternalTamper3 = 1U << 3, - kTDET_ExternalTamper4 = 1U << 4, - kTDET_ExternalTamper5 = 1U << 5, - kTDET_ExternalTamper6 = 1U << 6, - kTDET_ExternalTamper7 = 1U << 7 -} tdet_external_tamper_pin_t; - -/*! - * @brief TDET Active Tamper Register Select. - * - * These constants are used to define activeTamperRegisterSelect argument to be used with - * TDET_ActiveTamperConfigure(). - */ -typedef enum _tdet_active_tamper_register -{ - kTDET_ActiveTamperRegister0 = 1u << 0, - kTDET_ActiveTamperRegister1 = 1u << 1, -} tdet_active_tamper_register_t; - -/*! - * @brief TDET Active Tamper registers. - * - * This structure defines values for TDET Active Tamper Registers. - */ -typedef struct _tdet_active_tamper_config -{ - uint32_t activeTamperShift; /*!< Active tamper shift register. initialize to non-zero value. */ - uint32_t activeTamperPolynomial; /*!< Polynomial of the active tamper shift register. */ -} tdet_active_tamper_config_t; - -/*! - * @brief TDET Status Register flags. - * - * This provides constants for the TDET Status Register. - */ -typedef enum _tdet_status_flag -{ - kTDET_StatusTamperFlag = 1U << DIGTMP_SR_DTF_SHIFT, /*!< TDET Digital Tamper Flag */ - kTDET_StatusTamperAcknowledgeFlag = 1U << DIGTMP_SR_TAF_SHIFT, /*!< TDET Tamper Acknowledge Flag */ - kTDET_StatusClockTamper = 1U << DIGTMP_IER_TIIE0_SHIFT, /*!< TDET Clock Tamper detected */ - kTDET_StatusConfigurationTamper = 1U << DIGTMP_IER_TIIE1_SHIFT, /*!< TDET Configuration Tamper detected */ - kTDET_StatusVoltageTamper = 1U << DIGTMP_IER_TIIE2_SHIFT, /*!< TDET Voltage Tamper detected */ - kTDET_StatusTemperatureTamper = 1U << DIGTMP_IER_TIIE3_SHIFT, /*!< TDET Temperature Tamper detected */ - kTDET_StatusRamZeroizeTamper = 1U << DIGTMP_IER_TIIE6_SHIFT, /*!< TDET RAM Zeroize Tamper detected */ - kTDET_StatusTamperPinTamper0 = 1U << DIGTMP_IER_TPIE0_SHIFT, /*!< TDET Tamper Pin 0 Tamper detected */ - kTDET_StatusTamperPinTamper1 = 1U << DIGTMP_IER_TPIE1_SHIFT, /*!< TDET Tamper Pin 1 Tamper detected */ - kTDET_StatusTamperPinTamper2 = 1U << DIGTMP_IER_TPIE2_SHIFT, /*!< TDET Tamper Pin 2 Tamper detected */ - kTDET_StatusTamperPinTamper3 = 1U << DIGTMP_IER_TPIE3_SHIFT, /*!< TDET Tamper Pin 3 Tamper detected */ - kTDET_StatusTamperPinTamper4 = 1U << DIGTMP_IER_TPIE4_SHIFT, /*!< TDET Tamper Pin 4 Tamper detected */ - kTDET_StatusTamperPinTamper5 = 1U << DIGTMP_IER_TPIE5_SHIFT, /*!< TDET Tamper Pin 5 Tamper detected */ - kTDET_StatusTamperPinTamper6 = 1U << DIGTMP_IER_TPIE6_SHIFT, /*!< TDET Tamper Pin 6 Tamper detected */ - kTDET_StatusTamperPinTamper7 = 1U << DIGTMP_IER_TPIE7_SHIFT, /*!< TDET Tamper Pin 7 Tamper detected */ - kTDET_StatusAll = DIGTMP_SR_DTF_MASK | DIGTMP_SR_TAF_MASK | DIGTMP_IER_TIIE0_MASK | DIGTMP_IER_TIIE1_MASK | - DIGTMP_IER_TIIE2_MASK | DIGTMP_IER_TIIE3_MASK | DIGTMP_IER_TIIE6_MASK | DIGTMP_IER_TPIE0_MASK | - DIGTMP_IER_TPIE1_MASK | DIGTMP_IER_TPIE2_MASK | DIGTMP_IER_TPIE3_MASK | DIGTMP_IER_TPIE4_MASK | - DIGTMP_IER_TPIE5_MASK | DIGTMP_IER_TPIE6_MASK | - DIGTMP_IER_TPIE7_MASK, /*!< Mask for all of the TDET Status Register bits */ -} tdet_status_flag_t; - -/*! - * @brief TDET Interrupt Enable Register. - * - * This provides constants for the TDET Interrupt Enable Register. - */ -typedef enum _tdet_interrupt -{ - kTDET_InterruptTamper = 1U << DIGTMP_IER_DTIE_SHIFT, /*!< TDET Digital Tamper Interrupt */ - kTDET_InterruptClockTamper = 1U << DIGTMP_IER_TIIE0_SHIFT, /*!< TDET Clock Tamper Interrupt */ - kTDET_InterruptConfigurationTamper = 1U << DIGTMP_IER_TIIE1_SHIFT, /*!< TDET Configuration error */ - kTDET_InterruptVoltageTamper = 1U << DIGTMP_IER_TIIE2_SHIFT, /*!< TDET Voltage Tamper */ - kTDET_InterruptTemperatureTamper = 1U << DIGTMP_IER_TIIE3_SHIFT, /*!< TDET Temperature Tamper Interrupt */ - kTDET_InterruptRamZeroizeTamper = 1U << DIGTMP_IER_TIIE6_SHIFT, /*!< TDET RAM Zeroize Tamper Interrupt */ - kTDET_InterruptTamperPinTamper0 = 1U << DIGTMP_IER_TPIE0_SHIFT, /*!< TDET Tamper Pin Tamper 0 Interrupt */ - kTDET_InterruptTamperPinTamper1 = 1U << DIGTMP_IER_TPIE1_SHIFT, /*!< TDET Tamper Pin Tamper 1 Interrupt */ - kTDET_InterruptTamperPinTamper2 = 1U << DIGTMP_IER_TPIE2_SHIFT, /*!< TDET Tamper Pin Tamper 2 Interrupt */ - kTDET_InterruptTamperPinTamper3 = 1U << DIGTMP_IER_TPIE3_SHIFT, /*!< TDET Tamper Pin Tamper 3 Interrupt */ - kTDET_InterruptTamperPinTamper4 = 1U << DIGTMP_IER_TPIE4_SHIFT, /*!< TDET Tamper Pin Tamper 4 Interrupt */ - kTDET_InterruptTamperPinTamper5 = 1U << DIGTMP_IER_TPIE5_SHIFT, /*!< TDET Tamper Pin Tamper 5 Interrupt */ - kTDET_InterruptTamperPinTamper6 = 1U << DIGTMP_IER_TPIE6_SHIFT, /*!< TDET Tamper Pin Tamper 6 Interrupt */ - kTDET_InterruptTamperPinTamper7 = 1U << DIGTMP_IER_TPIE7_SHIFT, /*!< TDET Tamper Pin Tamper 7 Interrupt */ - kTDET_InterruptTamperPinTamper_All = DIGTMP_IER_TPIE0_MASK | DIGTMP_IER_TPIE1_MASK | DIGTMP_IER_TPIE2_MASK | - DIGTMP_IER_TPIE3_MASK | DIGTMP_IER_TPIE4_MASK | DIGTMP_IER_TPIE5_MASK | - DIGTMP_IER_TPIE6_MASK | - DIGTMP_IER_TPIE7_MASK, /*!< TDET All Tamper Pins Interrupt */ - kTDET_InterruptAll = DIGTMP_IER_DTIE_MASK | DIGTMP_IER_TIIE0_MASK | DIGTMP_IER_TIIE1_MASK | DIGTMP_IER_TIIE2_MASK | - DIGTMP_IER_TIIE3_MASK | DIGTMP_IER_TIIE6_MASK | DIGTMP_IER_TPIE0_MASK | DIGTMP_IER_TPIE1_MASK | - DIGTMP_IER_TPIE2_MASK | DIGTMP_IER_TPIE3_MASK | DIGTMP_IER_TPIE4_MASK | DIGTMP_IER_TPIE5_MASK | - DIGTMP_IER_TPIE6_MASK | - DIGTMP_IER_TPIE7_MASK, /*!< Mask to select all TDET Interrupt Enable Register bits */ -} tdet_interrupt_t; - -/*! - * @brief TDET Tamper Enable Register. - * - * This provides constants for the TDET Tamper Enable Register. - */ -typedef enum _tdet_tamper -{ - kTDET_TamperClock = 1U << DIGTMP_TER_TIE0_SHIFT, /*!< Clock Tamper Enable */ - kTDET_TamperConfiguration = 1U << DIGTMP_TER_TIE1_SHIFT, /*!< Configuration error Tamper Enable */ - kTDET_TamperVoltage = 1U << DIGTMP_TER_TIE2_SHIFT, /*!< Voltage Tamper Enable */ - kTDET_TamperTemperature = 1U << DIGTMP_TER_TIE3_SHIFT, /*!< Temperature Tamper Enable */ - kTDET_TamperRamZeroize = 1U << DIGTMP_TER_TIE6_SHIFT, /*!< RAM Zeroize Tamper Enable */ - kTDET_TamperTamperPin0 = 1U << DIGTMP_TER_TPE0_SHIFT, /*!< Tamper Pin 0 Tamper Enable */ - kTDET_TamperTamperPin1 = 1U << DIGTMP_TER_TPE1_SHIFT, /*!< Tamper Pin 1 Tamper Enable */ - kTDET_TamperTamperPin2 = 1U << DIGTMP_TER_TPE2_SHIFT, /*!< Tamper Pin 2 Tamper Enable */ - kTDET_TamperTamperPin3 = 1U << DIGTMP_TER_TPE3_SHIFT, /*!< Tamper Pin 3 Tamper Enable */ - kTDET_TamperTamperPin4 = 1U << DIGTMP_TER_TPE4_SHIFT, /*!< Tamper Pin 4 Tamper Enable */ - kTDET_TamperTamperPin5 = 1U << DIGTMP_TER_TPE5_SHIFT, /*!< Tamper Pin 5 Tamper Enable */ - kTDET_TamperTamperPin6 = 1U << DIGTMP_TER_TPE6_SHIFT, /*!< Tamper Pin 6 Tamper Enable */ - kTDET_TamperTamperPin7 = 1U << DIGTMP_TER_TPE7_SHIFT, /*!< Tamper Pin 7 Tamper Enable */ - kTDET_TamperTamperPinAll = DIGTMP_TER_TPE0_MASK | DIGTMP_TER_TPE1_MASK | DIGTMP_TER_TPE2_MASK | - DIGTMP_TER_TPE3_MASK | DIGTMP_TER_TPE4_MASK | DIGTMP_TER_TPE5_MASK | - DIGTMP_TER_TPE6_MASK | DIGTMP_TER_TPE7_MASK, /*!< All Tamper Pin Tamper Enable */ - kTDET_TamperAll = DIGTMP_TER_TIE0_MASK | DIGTMP_TER_TIE1_MASK | DIGTMP_TER_TIE2_MASK | DIGTMP_TER_TIE3_MASK | - DIGTMP_TER_TIE6_MASK | DIGTMP_TER_TPE0_MASK | DIGTMP_TER_TPE1_MASK | DIGTMP_TER_TPE2_MASK | - DIGTMP_TER_TPE3_MASK | DIGTMP_TER_TPE4_MASK | DIGTMP_TER_TPE5_MASK | DIGTMP_TER_TPE6_MASK | - DIGTMP_TER_TPE7_MASK, /*!< Mask to select all Tamper Enable Register bits */ -} tdet_tamper_t; - -/*! - * @brief TDET Registers. - * - * This provides constants to encode a mask for the TDET Registers. - */ -typedef enum _tdet_register -{ - kTDET_NoRegister = 0U, /*!< No Register */ - kTDET_Control = 1U << DIGTMP_LR_CRL_SHIFT, /*!< Control Register */ - kTDET_Status = 1U << DIGTMP_LR_SRL_SHIFT, /*!< Status Register */ - kTDET_Lock = 1U << DIGTMP_LR_LRL_SHIFT, /*!< Lock Register */ - kTDET_InterruptEnable = 1U << DIGTMP_LR_IEL_SHIFT, /*!< Interrupt Enable Register */ - kTDET_TamperSeconds = 1U << DIGTMP_LR_TSL_SHIFT, /*!< Tamper Seconds Register */ - kTDET_TamperEnable = 1U << DIGTMP_LR_TEL_SHIFT, /*!< Tamper Enable Register */ - kTDET_PinDirection = 1U << DIGTMP_LR_PDL_SHIFT, /*!< Pin Direction Register */ - kTDET_PinPolarity = 1U << DIGTMP_LR_PPL_SHIFT, /*!< Pin Polarity Register */ - kTDET_ActiveTamper0 = 1U << DIGTMP_LR_ATL0_SHIFT, /*!< Active Tamper Register 0 */ - kTDET_ActiveTamper1 = 1U << DIGTMP_LR_ATL1_SHIFT, /*!< Active Tamper Register 1 */ - kTDET_GlitchFilter0 = 1U << DIGTMP_LR_GFL0_SHIFT, /*!< Glitch Filter Register 0 */ - kTDET_GlitchFilter1 = 1U << DIGTMP_LR_GFL1_SHIFT, /*!< Glitch Filter Register 1 */ - kTDET_GlitchFilter2 = 1U << DIGTMP_LR_GFL2_SHIFT, /*!< Glitch Filter Register 2 */ - kTDET_GlitchFilter3 = 1U << DIGTMP_LR_GFL3_SHIFT, /*!< Glitch Filter Register 3 */ - kTDET_GlitchFilter4 = 1U << DIGTMP_LR_GFL4_SHIFT, /*!< Glitch Filter Register 4 */ - kTDET_GlitchFilter5 = 1U << DIGTMP_LR_GFL5_SHIFT, /*!< Glitch Filter Register 5 */ - kTDET_GlitchFilter6 = 1U << DIGTMP_LR_GFL6_SHIFT, /*!< Glitch Filter Register 6 */ - kTDET_GlitchFilter7 = 1U << DIGTMP_LR_GFL7_SHIFT, /*!< Glitch Filter Register 7 */ - kTDET_PinConfigurationRegisters = - DIGTMP_LR_PDL_MASK | DIGTMP_LR_PPL_MASK | DIGTMP_LR_ATL0_MASK | DIGTMP_LR_ATL1_MASK | DIGTMP_LR_GFL0_MASK | - DIGTMP_LR_GFL1_MASK | DIGTMP_LR_GFL2_MASK | DIGTMP_LR_GFL3_MASK | DIGTMP_LR_GFL4_MASK | DIGTMP_LR_GFL5_MASK | - DIGTMP_LR_GFL6_MASK | DIGTMP_LR_GFL7_MASK, /*!< Mask to select all TDET Pin Configuration Registers */ - kTDET_AllRegisters = DIGTMP_LR_CRL_MASK | DIGTMP_LR_SRL_MASK | DIGTMP_LR_LRL_MASK | DIGTMP_LR_IEL_MASK | - DIGTMP_LR_TSL_MASK | DIGTMP_LR_TEL_MASK | DIGTMP_LR_PDL_MASK | DIGTMP_LR_PPL_MASK | - DIGTMP_LR_ATL0_MASK | DIGTMP_LR_ATL1_MASK | DIGTMP_LR_GFL0_MASK | DIGTMP_LR_GFL1_MASK | - DIGTMP_LR_GFL2_MASK | DIGTMP_LR_GFL3_MASK | DIGTMP_LR_GFL4_MASK | DIGTMP_LR_GFL5_MASK | - DIGTMP_LR_GFL6_MASK | DIGTMP_LR_GFL7_MASK, /*!< Mask to select all TDET Registers */ -} tdet_register_t; - -/******************************************************************************* - * API - *******************************************************************************/ -extern void VBAT0_DriverIRQHandler(void); - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name TDET Functional Operation - * @{ - */ - -/*! - * @brief Initialize TDET - * - * This function initializes TDET. - * - * @param base TDET peripheral base address - * @return Status of the init operation - */ -status_t TDET_Init(DIGTMP_Type *base); - -/*! - * @brief Deinitialize TDET - * - * This function disables glitch filters and active tampers - * This function disables the TDET clock and prescaler in TDET Control Register. - * @param base TDET peripheral base address - */ -void TDET_Deinit(DIGTMP_Type *base); - -/*! - * @brief Gets default values for the TDET Control Register. - * - * This function fills the given structure with default values for the TDET Control Register. - * The default values are: - * @code - * defaultConfig->innerClockAndPrescalerEnable = true - * defaultConfig->tamperForceSystemResetEnable = false - * defaultConfig->updateMode = kTDET_StatusLockWithTamper - * defaultConfig->clockSourceActiveTamper0 = kTDET_ClockType1Hz - * defaultConfig->clockSourceActiveTamper1 = kTDET_ClockType1Hz - * defaultConfig->prescaler = 0 - * @endcode - * @param base TDET peripheral base address - * @param[out] defaultConfig Pointer to structure to be filled with default parameters - */ -void TDET_GetDefaultConfig(DIGTMP_Type *base, tdet_config_t *defaultConfig); - -/*! - * @brief Writes to the TDET Control Register. - * - * This function writes the given structure to the TDET Control Register. - * @param base TDET peripheral base address - * @param config Pointer to structure with TDET peripheral configuration parameters - * @return kStatus_Fail when writing to TDET Control Register is not allowed - * @return kStatus_Success when operation completes successfully - */ -status_t TDET_SetConfig(DIGTMP_Type *base, const tdet_config_t *config); - -/*! - * @brief Software reset. - * - * This function resets all TDET registers. The CR[SWR] itself is not affected; - * it is reset by VBAT POR only. - * - * @param base TDET peripheral base address - * @return kStatus_Fail when writing to TDET Control Register is not allowed - * @return kStatus_Success when operation completes successfully - */ -status_t TDET_SoftwareReset(DIGTMP_Type *base); - -/*! - * @brief Writes to the active tamper register(s). - * - * This function writes per active tamper register parameters to active tamper register(s). - * - * @param base TDET peripheral base address - * @param activeTamperConfig Pointer to structure with active tamper register parameters - * @param activeTamperRegisterSelect Bit mask for active tamper registers to be configured. The passed value is - * combination of tdet_active_tamper_register_t values (OR'ed). - * @return kStatus_Fail when writing to TDET Active Tamper Register(s) is not allowed - * @return kStatus_Success when operation completes successfully - */ -status_t TDET_ActiveTamperSetConfig(DIGTMP_Type *base, - const tdet_active_tamper_config_t *activeTamperConfig, - uint32_t activeTamperRegisterSelect); - -/*! - * @brief Gets default values for tamper pin configuration. - * - * This function fills the give structure with default values for the tamper pin and glitch filter configuration. - * The default values are: - * code - * pinConfig->pinPolarity = kTDET_TamperPinPolarityExpectNormal; - * pinConfig->pinDirection = kTDET_TamperPinDirectionIn; - * pinConfig->tamperPullEnable = false; - * pinConfig->tamperPinSampleFrequency = kTDET_GlitchFilterSamplingEveryCycle8; - * pinConfig->tamperPinSampleWidth = kTDET_GlitchFilterSampleDisable; - * pinConfig->glitchFilterEnable = false; - * pinConfig->glitchFilterPrescaler = kTDET_GlitchFilterClock512Hz; - * pinConfig->glitchFilterWidth = 0; - * pinConfig->tamperPinExpected = kTDET_GlitchFilterExpectedLogicZero; - * pinConfig->tamperPullSelect = kTDET_GlitchFilterPullTypeAssert; - * endcode - * - * @param base TDET peripheral base address - * @param[out] pinConfig Pointer to structure to be filled with tamper pins default parameters - */ - -void TDET_PinGetDefaultConfig(DIGTMP_Type *base, tdet_pin_config_t *pinConfig); - -/*! - * @brief Writes the tamper pin configuration. - * - * This function writes per pin parameters to tamper pin and glitch filter configuration registers. - * - * @param base TDET peripheral base address - * @param pinConfig Pointer to structure with tamper pin and glitch filter configuration parameters - * @param pinSelect Bit mask for tamper pins to be configured. The passed value is combination of - * enum _tdet_tamper_pin (tdet_tamper_pin_t) values (OR'ed). - * @return kStatus_Fail when writing to TDET Pin Direction, Pin Polarity or Glitch Filter Register(s) is not allowed - * @return kStatus_Success when operation completes successfully - */ -status_t TDET_PinSetConfig(DIGTMP_Type *base, const tdet_pin_config_t *pinConfig, uint32_t pinSelect); - -/*! - * @brief Reads the Status Register. - * - * This function reads flag bits from TDET Status Register. - * - * @param base TDET peripheral base address - * @param[out] result Pointer to uint32_t where to write Status Register read value. Use tdet_status_flag_t to decode - * individual flags. - * @return kStatus_Fail when Status Register reading is not allowed - * @return kStatus_Success when result is written with the Status Register read value - */ -status_t TDET_GetStatusFlags(DIGTMP_Type *base, uint32_t *result); - -/*! - * @brief Writes to the Status Register. - * - * This function clears specified flag bits in TDET Status Register. - * - * @param base TDET peripheral base address - * @param mask Bit mask for the flag bits to be cleared. Use tdet_status_flag_t to encode flags. - * @return kStatus_Fail when Status Register writing is not allowed - * @return kStatus_Success when mask is written to the Status Register - */ -status_t TDET_ClearStatusFlags(DIGTMP_Type *base, uint32_t mask); - -/*! - * @brief Writes to the Interrupt Enable Register. - * - * This function sets specified interrupt enable bits in TDET Interrupt Enable Register. - * - * @param base TDET peripheral base address - * @param mask Bit mask for the interrupt enable bits to be set. - * @return kStatus_Fail when Interrupt Enable Register writing is not allowed - * @return kStatus_Success when mask is written to the Interrupt Enable Register - */ -status_t TDET_EnableInterrupts(DIGTMP_Type *base, uint32_t mask); - -/*! - * @brief Writes to the Interrupt Enable Register. - * - * This function clears specified interrupt enable bits in TDET Interrupt Enable Register. - * - * @param base TDET peripheral base address - * @param mask Bit mask for the interrupt enable bits to be cleared. - * @return kStatus_Fail when Interrupt Enable Register writing is not allowed - * @return kStatus_Success when specified bits are cleared in the Interrupt Enable Register - */ -status_t TDET_DisableInterrupts(DIGTMP_Type *base, uint32_t mask); - -/*! - * @brief Writes to the Tamper Enable Register. - * - * This function sets specified tamper enable bits in TDET Tamper Enable Register. - * - * @param base TDET peripheral base address - * @param mask Bit mask for the tamper enable bits to be set. - * @return kStatus_Fail when Tamper Enable Register writing is not allowed - * @return kStatus_Success when mask is written to the Tamper Enable Register - */ -status_t TDET_EnableTampers(DIGTMP_Type *base, uint32_t mask); - -/*! - * @brief Writes to the Tamper Enable Register. - * - * This function clears specified tamper enable bits in TDET Tamper Enable Register. - * - * @param base TDET peripheral base address - * @param mask Bit mask for the tamper enable bits to be cleared. - * @return kStatus_Fail when Tamper Enable Register writing is not allowed - * @return kStatus_Success when specified bits are cleared in the Tamper Enable Register - */ -status_t TDET_DisableTampers(DIGTMP_Type *base, uint32_t mask); - -/*! - * @brief Writes to the Tamper Seconds Register. - * - * This function writes to TDET Tamper Seconds Register. This causes Status Register DTF flag to be set (TDET - * tampering detected). - * - * @param base TDET peripheral base address - * @return kStatus_Fail when Tamper Seconds Register writing is not allowed - * @return kStatus_Success when Tamper Seconds Register is written - */ -status_t TDET_ForceTamper(DIGTMP_Type *base); - -/*! - * @brief Reads the Tamper Seconds Register. - * - * This function reads TDET Tamper Seconds Register. The read value returns the time in seconds at which the Status - * Register DTF flag was set. - * - * @param base TDET peripheral base address - * @param tamperTimeSeconds Time in seconds at which the tamper detection SR[DTF] flag was set. - * @return kStatus_Fail when Tamper Seconds Register reading is not allowed - * @return kStatus_Success when Tamper Seconds Register is read - */ -status_t TDET_GetTamperTimeSeconds(DIGTMP_Type *base, uint32_t *tamperTimeSeconds); - -/*! - * @brief Writes to the TDET Lock Register. - * - * This function clears specified lock bits in the TDET Lock Register. - * When a lock bit is clear, a write to corresponding TDET Register is ignored. - * Once cleared, these bits can only be set by VBAT POR or software reset. - * - * @param base TDET peripheral base address - * @param mask Bit mask for the lock bits to be cleared. Use tdet_register_t values to encode (OR'ed) which TDET - * Registers shall be locked. - */ -void TDET_LockRegisters(DIGTMP_Type *base, uint32_t mask); - -/*! @}*/ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @}*/ /* end of group tdet */ - -#endif /* FSL_TDET_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_trdc.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_trdc.c deleted file mode 100644 index b94abe1afbc..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_trdc.c +++ /dev/null @@ -1,854 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_trdc.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.trdc1" -#endif - -/* The memory increment definition in byte of MBC and MRC configuration registers */ -#define TRDC_MRC_DOMAIN_INCREMENT 0x100UL -#define TRDC_MBC_DOMAIN_INCREMENT 0x200UL -/* In latest TRDC register definition this macro has been removed from device header file. Add this for backward - * compatability. */ -#ifndef TRDC_MBC_NSE_BLK_CLR_ALL_DID_SEL -#define TRDC_MBC_NSE_BLK_CLR_ALL_DID_SEL(x) ((uint32_t)(((uint32_t)(x)) << TRDC_MBC_NSE_BLK_CLR_ALL_DID_SEL0_SHIFT)) -#endif -/* Get the memory increment in for each slave inside MBC */ -#define TRDC_MBC_SLAVE_INCREMENT(x) \ - (((x) == 0U) ? (0U) : (((x) == 1U) ? (0x140UL) : (((x) == 2U) ? (0x168UL) : (0x190UL)))) - -typedef union -{ -#if defined(FSL_FEATURE_TRDC_HAS_DOMAIN_ASSIGNMENT) && FSL_FEATURE_TRDC_HAS_DOMAIN_ASSIGNMENT - trdc_processor_domain_assignment_t _processor_domain_assignment; - trdc_non_processor_domain_assignment_t _non_processor_domain_assignment; - trdc_pid_config_t _pid_config; -#endif -#if defined(FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG) && FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG - trdc_idau_config_t _idau_config; -#endif -#if (defined(FSL_FEATURE_TRDC_HAS_MBC) && FSL_FEATURE_TRDC_HAS_MBC) || \ - (defined(FSL_FEATURE_TRDC_HAS_MRC) && FSL_FEATURE_TRDC_HAS_MRC) - trdc_memory_access_control_config_t _memory_access_control; -#endif -#if defined(FSL_FEATURE_TRDC_HAS_MBC) && FSL_FEATURE_TRDC_HAS_MBC - trdc_mbc_memory_block_config_t _mbc_memory_blk; - trdc_mbc_nse_update_config_t _mbc_nse_update; -#endif - uint32_t _u32; -} trdc_reg32_convert_t; - -/******************************************************************************* - * Variables - ******************************************************************************/ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/******************************************************************************* - * Code - ******************************************************************************/ -#if defined(FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG) && FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG -/*! - * brief Gets the TRDC hardware configuration. - * - * This function gets the TRDC hardware configurations, including number of bus - * masters, number of domains, number of MRCs and number of PACs. - * - * param base TRDC peripheral base address. - * param config Pointer to the structure to get the configuration. - */ -void TRDC_GetHardwareConfig(TRDC_Type *base, trdc_hardware_config_t *config) -{ - assert(NULL != config); - - config->masterNumber = - (uint8_t)((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NMSTR_MASK) >> TRDC_TRDC_HWCFG0_NMSTR_SHIFT); - config->domainNumber = - (uint8_t)((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NDID_MASK) >> TRDC_TRDC_HWCFG0_NDID_SHIFT); - config->mbcNumber = - (uint8_t)((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NMBC_MASK) >> TRDC_TRDC_HWCFG0_NMBC_SHIFT); - config->mrcNumber = - (uint8_t)((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NMRC_MASK) >> TRDC_TRDC_HWCFG0_NMRC_SHIFT); -} -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_MBC) && FSL_FEATURE_TRDC_HAS_MBC -/*! - * brief Gets the hardware configuration of the one of two slave memories within each MBC(memory block checker). - * - * param base TRDC peripheral base address. - * param config Pointer to the structure to get the configuration. - * param mbcIdx MBC number. - * param slvIdx Slave number. - */ -void TRDC_GetMbcHardwareConfig(TRDC_Type *base, - trdc_slave_memory_hardware_config_t *config, - uint8_t mbcIdx, - uint8_t slvIdx) -{ - assert(NULL != config); -#if defined(TRDC_MBC_COUNT) && TRDC_MBC_COUNT - assert(mbcIdx < (uint8_t)TRDC_MBC_COUNT); -#else - assert(mbcIdx < (uint8_t)((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NMBC_MASK) >> - TRDC_TRDC_HWCFG0_NMBC_SHIFT)); -#endif - assert(slvIdx < 4U); - - config->blockNum = TRDC_MBC_BASE(base, mbcIdx)->MBC_MEM_GLBCFG[slvIdx] & TRDC_MBC_MEM_GLBCFG_NBLKS_MASK; - config->blockSize = (TRDC_MBC_BASE(base, mbcIdx)->MBC_MEM_GLBCFG[slvIdx] & TRDC_MBC_MEM_GLBCFG_SIZE_LOG2_MASK) >> - TRDC_MBC_MEM_GLBCFG_SIZE_LOG2_SHIFT; -} -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_DOMAIN_ASSIGNMENT) && FSL_FEATURE_TRDC_HAS_DOMAIN_ASSIGNMENT -/*! - * brief Gets the default master domain assignment for the processor bus master. - * - * This function gets the default master domain assignment for the processor bus master. - * It should only be used for the processor bus masters, such as CORE0. This function - * sets the assignment as follows: - * - * code - * assignment->domainId = 0U; - * assignment->domainIdSelect = kTRDC_DidMda; - * assignment->lock = 0U; - * endcode - * - * param domainAssignment Pointer to the assignment structure. - */ -void TRDC_GetDefaultProcessorDomainAssignment(trdc_processor_domain_assignment_t *domainAssignment) -{ - assert(NULL != domainAssignment); - - /* Initializes the configure structure to zero. */ - (void)memset(domainAssignment, 0, sizeof(*domainAssignment)); -} - -/*! - * brief Gets the default master domain assignment for non-processor bus master. - * - * This function gets the default master domain assignment for non-processor bus master. - * It should only be used for the non-processor bus masters, such as DMA. This function - * sets the assignment as follows: - * - * code - * assignment->domainId = 0U; - * assignment->privilegeAttr = kTRDC_ForceUser; - * assignment->secureAttr = kTRDC_ForceSecure; - * assignment->bypassDomainId = 0U; - * assignment->lock = 0U; - * endcode - * - * param domainAssignment Pointer to the assignment structure. - */ -void TRDC_GetDefaultNonProcessorDomainAssignment(trdc_non_processor_domain_assignment_t *domainAssignment) -{ - assert(NULL != domainAssignment); - - /* Initializes the configure structure to zero. */ - (void)memset(domainAssignment, 0, sizeof(*domainAssignment)); -} - -/*! - * brief Sets the processor bus master domain assignment. - * - * This function sets the processor master domain assignment as valid. - * One bus master might have multiple domain assignment registers. The parameter - * \p assignIndex specifies which assignment register to set. - * - * Example: Set domain assignment for core 0. - * - * code - * trdc_processor_domain_assignment_t processorAssignment; - * - * TRDC_GetDefaultProcessorDomainAssignment(&processorAssignment); - * - * processorAssignment.domainId = 0; - * processorAssignment.xxx = xxx; - * TRDC_SetMasterDomainAssignment(TRDC, 1, &processorAssignment); - * endcode - * - * param base TRDC peripheral base address. - * param master Which master to configure, refer to trdcx_master_t in processor header file, x is trdc instance. - * param regNum Which register to configure, processor master can have more than one register for the MDAC - * configuration. param domainAssignment Pointer to the assignment structure. - */ -void TRDC_SetProcessorDomainAssignment(TRDC_Type *base, - uint8_t master, - uint8_t regNum, - const trdc_processor_domain_assignment_t *domainAssignment) -{ - /* Make sure the master number does not exceed the max master count. */ - assert(master < - ((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NMSTR_MASK) >> TRDC_TRDC_HWCFG0_NMSTR_SHIFT)); - /* Make sure the master is a processor master. */ - assert(0U == (TRDC_GENERAL_BASE(base)->DACFG[master] & TRDC_DACFG_NCM_MASK)); - assert(NULL != domainAssignment); - assert(domainAssignment->domainId < - ((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NDID_MASK) >> TRDC_TRDC_HWCFG0_NDID_SHIFT)); - - trdc_reg32_convert_t pid; - pid._processor_domain_assignment = *domainAssignment; - TRDC_DOMAIN_ASSIGNMENT_BASE(base)->MDA_DFMT0[master].MDA_W_DFMT0[regNum] = pid._u32 | TRDC_MDA_W_DFMT0_VLD_MASK; -} - -/*! - * brief Sets the non-processor bus master domain assignment. - * - * This function sets the non-processor master domain assignment as valid. - * One bus master might have multiple domain assignment registers. The parameter - * \p assignIndex specifies which assignment register to set. - * - * Example: Set domain assignment for DMA0. - * code - * trdc_non_processor_domain_assignment_t nonProcessorAssignment; - * - * TRDC_GetDefaultNonProcessorDomainAssignment(&nonProcessorAssignment); - * nonProcessorAssignment.domainId = 1; - * nonProcessorAssignment.xxx = xxx; - * - * TRDC_SetMasterDomainAssignment(TRDC, kTrdcMasterDma0, 0U, &nonProcessorAssignment); - * endcode - * - * param base TRDC peripheral base address. - * param master Which master to configure, refer to trdc_master_t in processor header file. - * param domainAssignment Pointer to the assignment structure. - */ -void TRDC_SetNonProcessorDomainAssignment(TRDC_Type *base, - uint8_t master, - const trdc_non_processor_domain_assignment_t *domainAssignment) -{ - /* The master number should be less than the master count. */ - assert(master < - ((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NMSTR_MASK) >> TRDC_TRDC_HWCFG0_NMSTR_SHIFT)); - /* Make sure the master is a non-CPU/non-processor master */ - assert(0U != (TRDC_GENERAL_BASE(base)->DACFG[master] & TRDC_DACFG_NCM_MASK)); - assert(NULL != domainAssignment); - assert(domainAssignment->domainId < - ((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NDID_MASK) >> TRDC_TRDC_HWCFG0_NDID_SHIFT)); - - trdc_reg32_convert_t pid; - pid._non_processor_domain_assignment = *domainAssignment; - - TRDC_DOMAIN_ASSIGNMENT_BASE(base)->MDA_DFMT1[master].MDA_W_DFMT1[0] = pid._u32 | TRDC_MDA_W_DFMT1_VLD_MASK; -} - -/*! - * brief Sets the current Process identifier(PID) for processor core. - * - * Each processor has a corresponding process identifier (PID) which can be used to group tasks into different domains. - * Secure privileged software saves and restores the PID as part of any context switch. - * This data structure defines an array of 32-bit values, one per MDA module, that define the PID. Since this register - * resource is only applicable to processor cores, the data structure is typically sparsely populated. The HWCFG[2-3] - * registers provide a bitmap of the implemented PIDn registers. This data structure is indexed using the corresponding - * MDA instance number. Depending on the operating clock domain of each DAC instance, there may be optional information - * stored in the corresponding PIDm register to properly implement the LK2 = 2 functionality. - * - * param base TRDC peripheral base address. - * param master Which processor master to configure, refer to trdc_master_t in processor header file. - * param pidConfig Pointer to the configuration structure. - */ -void TRDC_SetPid(TRDC_Type *base, uint8_t master, const trdc_pid_config_t *pidConfig) -{ - assert(pidConfig != NULL); - /* The master number should be less than the master count. */ - assert(master < - ((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NMSTR_MASK) >> TRDC_TRDC_HWCFG0_NMSTR_SHIFT)); - /* This master has to be a processor master. */ - assert((TRDC_GENERAL_BASE(base)->DACFG[master] & TRDC_DACFG_NCM_MASK) == 0U); - - trdc_reg32_convert_t pid; - pid._pid_config = *pidConfig; - TRDC_DOMAIN_ASSIGNMENT_BASE(base)->PID[master] = pid._u32; -} -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG) && FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG -/*! - * brief Gets the default IDAU(Implementation-Defined Attribution Unit) configuration. - * - * code - * config->lockSecureVTOR = false; - * config->lockNonsecureVTOR = false; - * config->lockSecureMPU = false; - * config->lockNonsecureMPU = false; - * config->lockSAU = false; - * endcode - * - * param domainAssignment Pointer to the configuration structure. - */ -void TRDC_GetDefaultIDAUConfig(trdc_idau_config_t *idauConfiguration) -{ - assert(NULL != idauConfiguration); - - /* Initializes the configure structure to zero. */ - (void)memset(idauConfiguration, 0, sizeof(*idauConfiguration)); -} - -/*! - * brief Sets the IDAU(Implementation-Defined Attribution Unit) control configuration. - * - * Example: Lock the secure and non-secure MPU registers. - * - * code - * trdc_idau_config_t idauConfiguration; - * - * TRDC_GetDefaultIDAUConfig(&idauConfiguration); - * - * idauConfiguration.lockSecureMPU = true; - * idauConfiguration.lockNonsecureMPU = true; - * TRDC_SetIDAU(TRDC, &idauConfiguration); - * endcode - * - * param base TRDC peripheral base address. - * param domainAssignment Pointer to the configuration structure. - */ -void TRDC_SetIDAU(TRDC_Type *base, const trdc_idau_config_t *idauConfiguration) -{ - assert(NULL != idauConfiguration); - - trdc_reg32_convert_t pid; - pid._idau_config = *idauConfiguration; - - TRDC_GENERAL_BASE(base)->TRDC_IDAU_CR = pid._u32 | TRDC_TRDC_IDAU_CR_VLD_MASK; -} -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_FLW) && FSL_FEATURE_TRDC_HAS_FLW -/*! - * brief Gets the default FLW(Flsh Logical Window) configuration. - * - * code - * config->blockCount = false; - * config->arrayBaseAddr = false; - * config->lock = false; - * config->enable = false; - * endcode - * - * param flwConfiguration Pointer to the configuration structure. - */ -void TRDC_GetDefaultFlashLogicalWindowConfig(trdc_flw_config_t *flwConfiguration) -{ - assert(NULL != flwConfiguration); - - /* Initializes the configure structure to zero. */ - (void)memset(flwConfiguration, 0, sizeof(*flwConfiguration)); - - flwConfiguration->enable = 0x1UL; -} - -/*! - * brief Sets the FLW function's configuration. - * - * code - * trdc_flw_config_t flwConfiguration; - * - * TRDC_GetDefaultIDAUConfig(&flwConfiguration); - * - * flwConfiguration.blockCount = 32U; - * flwConfiguration.arrayBaseAddr = 0xXXXXXXXX; - * TRDC_SetIDAU(TRDC, &flwConfiguration); - * endcode - * - * param base TRDC peripheral base address. - * param flwConfiguration Pointer to the configuration structure. - */ -void TRDC_SetFlashLogicalWindow(TRDC_Type *base, const trdc_flw_config_t *flwConfiguration) -{ - assert(NULL != flwConfiguration); - - TRDC_FLW_BASE(base)->TRDC_FLW_ABASE = flwConfiguration->arrayBaseAddr; - TRDC_FLW_BASE(base)->TRDC_FLW_BCNT = flwConfiguration->blockCount; - TRDC_FLW_BASE(base)->TRDC_FLW_CTL = - TRDC_TRDC_FLW_CTL_V(flwConfiguration->enable) | TRDC_TRDC_FLW_CTL_LK(flwConfiguration->lock); -} -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_DOMAIN_ERROR) && FSL_FEATURE_TRDC_HAS_DOMAIN_ERROR -#if (((__CORTEX_M == 0U) && (defined(__ICCARM__))) || (defined(__XTENSA__))) -/*! - * @brief Count the leading zeros. - * - * Count the leading zeros of an 32-bit data. This function is only defined - * for CM0 and CM0+ for IAR, because other cortex series have the clz instruction, - * KEIL and ARMGCC have toolchain build in function for this purpose. - * - * @param data The data to process. - * @return Count of the leading zeros. - */ -static uint8_t TRDC_CountLeadingZeros(uint32_t data) -{ - uint8_t count = 0U; - uint32_t mask = 0x80000000U; - - while ((data & mask) == 0U) - { - count++; - mask >>= 1U; - } - - return count; -} -#endif -#endif - -/*! - * brief Initializes the TRDC module. - * - * This function enables the TRDC clock. - * - * param base TRDC peripheral base address. - */ -void TRDC_Init(TRDC_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief De-initializes the TRDC module. - * - * This function disables the TRDC clock. - * - * param base TRDC peripheral base address. - */ -void TRDC_Deinit(TRDC_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -#if defined(FSL_FEATURE_TRDC_HAS_DOMAIN_ERROR) && FSL_FEATURE_TRDC_HAS_DOMAIN_ERROR -/*! - * brief Gets and clears the first domain error of the current domain. - * - * This function gets the first access violation information for the current domain - * and clears the pending flag. There might be multiple access violations pending - * for the current domain. This function only processes the first error. - * - * param base TRDC peripheral base address. - * param error Pointer to the error information. - * return If the access violation is captured, this function returns the kStatus_Success. - * The error information can be obtained from the parameter error. If no - * access violation is captured, this function returns the kStatus_NoData. - */ -status_t TRDC_GetAndClearFirstDomainError(TRDC_Type *base, trdc_domain_error_t *error) -{ - return TRDC_GetAndClearFirstSpecificDomainError(base, error, TRDC_GetCurrentMasterDomainId(base)); -} - -/*! - * brief Gets and clears the first domain error of the specific domain. - * - * This function gets the first access violation information for the specific domain - * and clears the pending flag. There might be multiple access violations pending - * for the current domain. This function only processes the first error. - * - * param base TRDC peripheral base address. - * param error Pointer to the error information. - * param domainId The error of which domain to get and clear. - * return If the access violation is captured, this function returns the kStatus_Success. - * The error information can be obtained from the parameter error. If no - * access violation is captured, this function returns the kStatus_NoData. - */ -status_t TRDC_GetAndClearFirstSpecificDomainError(TRDC_Type *base, trdc_domain_error_t *error, uint8_t domainId) -{ - assert(NULL != error); - - status_t status; - uint8_t errorIndex; /* The index of first domain error. */ - uint32_t errorBitMap; /* Domain error location bit map. */ - uint32_t regW1; /* To save TRDC_DERR_W1. */ - - /* Get the error bitmap. */ - errorBitMap = TRDC_DOMAIN_ERROR_BASE(base)->TRDC_DERRLOC[domainId]; - - if (0U == errorBitMap) /* No error captured. */ - { - status = kStatus_NoData; - } - else - { - /* Get the first error controller index. */ -#if (((__CORTEX_M == 0U) && (defined(__ICCARM__))) || (defined(__XTENSA__))) - errorIndex = 31U - TRDC_CountLeadingZeros(errorBitMap); -#else - errorIndex = 31U - __CLZ(errorBitMap); -#endif - - /* Must write TRDC_FDID[TRDC_FDID] with the domain ID before reading the Domain Error registers. */ - TRDC_DOMAIN_ERROR_BASE(base)->TRDC_FDID = TRDC_TRDC_FDID_FDID(domainId); - - /* Initializes the error structure to zero. */ - (void)memset(error, 0, sizeof(*error)); - - if (errorIndex > 15U) - { - /* Error in Memory Region Checker (MRC) */ - errorIndex -= 12U; - error->controller = (trdc_controller_t)errorIndex; - errorIndex -= 4U; - - /* Get the error information. */ - regW1 = TRDC_DOMAIN_ERROR_BASE(base)->MRC_DERR[errorIndex].W1; - error->address = TRDC_DOMAIN_ERROR_BASE(base)->MRC_DERR[errorIndex].W0; - /* Clear error pending. */ - TRDC_DOMAIN_ERROR_BASE(base)->MRC_DERR[errorIndex].W3 = TRDC_W3_RECR(0x01U); - } - else - { - /* Error in Memory Block Controller (MBC) */ - error->slaveMemoryIdx = errorIndex % 4U; - errorIndex /= 4U; - error->controller = (trdc_controller_t)errorIndex; - - /* Check if the MBC error index exceeds the module's max MBC index to avoid overrun access. */ - if (errorIndex >= - ((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NMBC_MASK) >> TRDC_TRDC_HWCFG0_NMBC_SHIFT)) - { - return kStatus_Fail; - } - - error->controller = (trdc_controller_t)errorIndex; - - /* Get the error information. */ - regW1 = TRDC_DOMAIN_ERROR_BASE(base)->MBC_DERR[errorIndex].W1; - error->address = TRDC_DOMAIN_ERROR_BASE(base)->MBC_DERR[errorIndex].W0; - /* Clear error pending. */ - TRDC_DOMAIN_ERROR_BASE(base)->MBC_DERR[errorIndex].W3 = TRDC_W3_RECR(0x01U); - } - - uint8_t tempVal = 0U; - error->domainId = (uint8_t)((regW1 & TRDC_W1_EDID_MASK) >> TRDC_W1_EDID_MASK); - tempVal = (uint8_t)((regW1 & TRDC_W1_EATR_MASK) >> TRDC_W1_EATR_SHIFT); - error->errorAttr = (trdc_error_attr_t)tempVal; - tempVal = (uint8_t)((regW1 & TRDC_W1_ERW_MASK) >> TRDC_W1_ERW_SHIFT); - error->errorType = (trdc_error_type_t)tempVal; - error->errorPort = (uint8_t)((regW1 & TRDC_W1_EPORT_MASK) >> TRDC_W1_EPORT_SHIFT); - tempVal = (uint8_t)((regW1 & TRDC_W1_EST_MASK) >> TRDC_W1_EST_SHIFT); - error->errorState = (trdc_error_state_t)tempVal; - - status = kStatus_Success; - } - - return status; -} -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_MRC) && FSL_FEATURE_TRDC_HAS_MRC -/*! - * brief Sets the memory access configuration for one of the access control register of one MRC. - * - * Example: Enable the secure operations and lock the configuration for MRC0 region 1. - * - * code - * trdc_memory_access_control_config_t config; - * - * config.securePrivX = true; - * config.securePrivW = true; - * config.securePrivR = true; - * config.lock = true; - * TRDC_SetMrcMemoryAccess(TRDC, &config, 0, 1); - * endcode - * - * param base TRDC peripheral base address. - * param config Pointer to the configuration structure. - * param mrcIdx MRC index. - * param regIdx Register number. - */ -void TRDC_MrcSetMemoryAccessConfig(TRDC_Type *base, - const trdc_memory_access_control_config_t *config, - uint8_t mrcIdx, - uint8_t regIdx) -{ - assert(NULL != base); - assert(NULL != config); - - trdc_reg32_convert_t pid; - - pid._memory_access_control = *config; - TRDC_MRC_BASE(base, mrcIdx)->MRC_GLBAC[regIdx] = pid._u32; -} - -/*! - * brief Enables the update of the selected domians. - * - * After the domians' update are enabled, their regions' NSE bits can be set or clear. - * - * param base TRDC peripheral base address. - * param mrcIdx MRC index. - * param domianMask Bit mask of the domains to be enabled. - * param enable True to enable, false to disable. - */ -void TRDC_MrcEnableDomainNseUpdate(TRDC_Type *base, uint8_t mrcIdx, uint16_t domianMask, bool enable) -{ - assert(NULL != base); - - if (enable) - { - TRDC_MRC_BASE(base, mrcIdx)->MRC_NSE_RGN_INDIRECT |= ((uint32_t)domianMask << 16U); - } - else - { - TRDC_MRC_BASE(base, mrcIdx)->MRC_NSE_RGN_INDIRECT &= ~((uint32_t)domianMask << 16U); - } -} - -/*! - * brief Sets the NSE bits of the selected regions for domains. - * - * This function sets the NSE bits for the selected regions for the domains whose update are enabled. - * - * param base TRDC peripheral base address. - * param mrcIdx MRC index. - * param regionMask Bit mask of the regions whose NSE bits to set. - */ -void TRDC_MrcRegionNseSet(TRDC_Type *base, uint8_t mrcIdx, uint16_t regionMask) -{ - assert(NULL != base); - - TRDC_MRC_BASE(base, mrcIdx)->MRC_NSE_RGN_SET = ((uint32_t)regionMask); -} - -/*! - * brief Clears the NSE bits of the selected regions for domains. - * - * This function clears the NSE bits for the selected regions for the domains whose update are enabled. - * - * param base TRDC peripheral base address. - * param mrcIdx MRC index. - * param regionMask Bit mask of the regions whose NSE bits to clear. - */ -void TRDC_MrcRegionNseClear(TRDC_Type *base, uint8_t mrcIdx, uint16_t regionMask) -{ - assert(NULL != base); - - TRDC_MRC_BASE(base, mrcIdx)->MRC_NSE_RGN_CLR = ((uint32_t)regionMask); -} - -/*! - * brief Clears the NSE bits for all the regions of the selected domains. - * - * This function clears the NSE bits for all regions of selected domains whose update are enabled. - * - * param base TRDC peripheral base address. - * param mrcIdx MRC index. - * param domainMask Bit mask of the domians whose NSE bits to clear. - */ -void TRDC_MrcDomainNseClear(TRDC_Type *base, uint8_t mrcIdx, uint16_t domainMask) -{ - assert(NULL != base); - - uint8_t domainCount = - (uint8_t)((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NDID_MASK) >> TRDC_TRDC_HWCFG0_NDID_SHIFT); - uint8_t maxDomainId = 0U; - uint16_t tmpDomainMask = domainMask; - - while (tmpDomainMask != 0U) - { - tmpDomainMask >>= 1U; - maxDomainId++; - } - - /* Check whether the domain mask contains invalid domain. */ - if (maxDomainId > domainCount) - { - assert(false); - } - - TRDC_MRC_BASE(base, mrcIdx)->MRC_NSE_RGN_CLR_ALL = ((uint32_t)domainMask << 16U); -} - -/*! - * brief Sets the configuration for one of the region descriptor per domain per MRC instnce. - * - * This function sets the configuration for one of the region descriptor, including the start - * and end address of the region, memory access control policy and valid. - * - * param base TRDC peripheral base address. - * param config Pointer to region descriptor configuration structure. - */ -void TRDC_MrcSetRegionDescriptorConfig(TRDC_Type *base, const trdc_mrc_region_descriptor_config_t *config) -{ - assert(NULL != base); - - uint32_t regAddr = (uint32_t) & (TRDC_MRC_BASE(base, config->mrcIdx)->MRC_DOM0_RGD_W[config->regionIdx][0]); - - regAddr += TRDC_MRC_DOMAIN_INCREMENT * config->domainIdx; - - /* Set configuration for word 0 */ - uint32_t data = TRDC_MRC_DOM0_RGD_W_MRACSEL(config->memoryAccessControlSelect) | - ((config->startAddr) & ~(TRDC_MRC_DOM0_RGD_W_MRACSEL_MASK)); - *(uint32_t *)regAddr = data; - - /* Set configuration for word 1 */ - regAddr += 4U; - data = TRDC_MRC_DOM0_RGD_W_VLD(config->valid) | TRDC_MRC_DOM0_RGD_W_NSE(config->nseEnable) | - ((config->endAddr) & ~(TRDC_MRC_DOM0_RGD_W_VLD_MASK | TRDC_MRC_DOM0_RGD_W_NSE_MASK)); - *(uint32_t *)regAddr = data; -} -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_MBC) && FSL_FEATURE_TRDC_HAS_MBC -/*! - * brief Sets the NSR update configuration for one of the MBC instance. - * - * After set the NSE configuration, the configured memory area can be updateby NSE set/clear. - * - * param base TRDC peripheral base address. - * param config Pointer to NSE update configuration structure. - * param mbcIdx MBC index. - */ -void TRDC_MbcSetNseUpdateConfig(TRDC_Type *base, const trdc_mbc_nse_update_config_t *config, uint8_t mbcIdx) -{ - assert(base != NULL); - - trdc_reg32_convert_t pid; - - pid._mbc_nse_update = *config; - TRDC_MBC_BASE(base, mbcIdx)->MBC_NSE_BLK_INDEX = pid._u32; -} - -/*! - * brief Sets the NSE bits of the selected configuration words according to NSE update configuration. - * - * This function sets the NSE bits of the word for the configured regio, memory. - * - * param base TRDC peripheral base address. - * param mbcIdx MBC index. - * param bitMask Mask of the bits whose NSE bits to set. - */ -void TRDC_MbcWordNseSet(TRDC_Type *base, uint8_t mbcIdx, uint32_t bitMask) -{ - assert(NULL != base); - - TRDC_MBC_BASE(base, mbcIdx)->MBC_NSE_BLK_SET = ((uint32_t)bitMask); -} - -/*! - * brief Clears the NSE bits of the selected configuration words according to NSE update configuration. - * - * This function sets the NSE bits of the word for the configured regio, memory. - * - * param base TRDC peripheral base address. - * param mbcIdx MBC index. - * param bitMask Mask of the bits whose NSE bits to clear. - */ -void TRDC_MbcWordNseClear(TRDC_Type *base, uint8_t mbcIdx, uint32_t bitMask) -{ - assert(NULL != base); - - TRDC_MBC_BASE(base, mbcIdx)->MBC_NSE_BLK_CLR = ((uint32_t)bitMask); -} - -/*! - * brief Clears all configuration words' NSE bits of the selected domain and memory. - * - * param base TRDC peripheral base address. - * param mbcIdx MBC index. - * param domainMask Mask of the domains whose NSE bits to clear, 0b110 means clear domain 1&2. - * param slaveMask Mask of the slaves whose NSE bits to clear, 0x11 means clear all slave 0&1's NSE bits. - */ -void TRDC_MbcNseClearAll(TRDC_Type *base, uint8_t mbcIdx, uint16_t domainMask, uint8_t slave) -{ - assert(NULL != base); - -#if defined(FSL_FEATURE_TRDC_DOMAIN_COUNT) && FSL_FEATURE_TRDC_DOMAIN_COUNT - uint8_t dmainCount = FSL_FEATURE_TRDC_DOMAIN_COUNT; -#else - uint8_t dmainCount = - (uint8_t)((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NDID_MASK) >> TRDC_TRDC_HWCFG0_NDID_SHIFT); -#endif - uint8_t maxDomainId = 0U; - uint16_t tmpDomainMask = domainMask; - - while (tmpDomainMask != 0U) - { - tmpDomainMask >>= 1U; - maxDomainId++; - } - - if (maxDomainId > dmainCount) - { - assert(false); - } - - TRDC_MBC_BASE(base, mbcIdx)->MBC_NSE_BLK_CLR_ALL = - TRDC_MBC_NSE_BLK_CLR_ALL_DID_SEL(domainMask) | TRDC_MBC_NSE_BLK_CLR_ALL_MEMSEL(slave); -} - -/*! - * brief Sets the memory access configuration for one of the region descriptor of one MBC. - * - * Example: Enable the secure operations and lock the configuration for MRC0 region 1. - * - * code - * trdc_memory_access_control_config_t config; - * - * config.securePrivX = true; - * config.securePrivW = true; - * config.securePrivR = true; - * config.lock = true; - * TRDC_SetMbcMemoryAccess(TRDC, &config, 0, 1); - * endcode - * - * param base TRDC peripheral base address. - * param config Pointer to the configuration structure. - * param mbcIdx MBC index. - * param rgdIdx Region descriptor number. - */ -void TRDC_MbcSetMemoryAccessConfig(TRDC_Type *base, - const trdc_memory_access_control_config_t *config, - uint8_t mbcIdx, - uint8_t rgdIdx) -{ - assert(NULL != base); - assert(NULL != config); - - trdc_reg32_convert_t pid; - - pid._memory_access_control = *config; - TRDC_MBC_BASE(base, mbcIdx)->MBC_MEMN_GLBAC[rgdIdx] = pid._u32; -} - -/*! - * brief Sets the configuration for one of the memory block per domain per MBC instnce. - * - * This function sets the configuration for one of the memory block, including the memory access - * control policy and nse enable. - * - * param base TRDC peripheral base address. - * param config Pointer to memory block configuration structure. - */ -void TRDC_MbcSetMemoryBlockConfig(TRDC_Type *base, const trdc_mbc_memory_block_config_t *config) -{ - assert(NULL != base); - - uint32_t shift = 4UL * (config->memoryBlockIdx % 8UL); - uint32_t regAddr = (uint32_t) & (TRDC_MBC_BASE(base, config->mbcIdx)->MBC_DOM0_MEM0_BLK_CFG_W[0]); - uint32_t configWord = 0U; - trdc_reg32_convert_t pid; - - pid._mbc_memory_blk = *config; - configWord = (pid._u32 & 0xFU) << shift; - - regAddr += (TRDC_MBC_DOMAIN_INCREMENT * config->domainIdx + TRDC_MBC_SLAVE_INCREMENT(config->slaveMemoryIdx)) + - ((uint32_t)config->memoryBlockIdx / 8U) * sizeof(uint32_t); - configWord = configWord | (*(uint32_t *)regAddr & ~(0xFUL << shift)); - *(uint32_t *)regAddr = configWord; -} -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_trdc.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_trdc.h deleted file mode 100644 index 68d29530882..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_trdc.h +++ /dev/null @@ -1,1131 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_TRDC_H_ -#define FSL_TRDC_H_ - -#include "fsl_common.h" -#include "fsl_trdc_core.h" - -/*! - * @addtogroup trdc - * @{ - */ - -/****************************************************************************** - * Definitions - *****************************************************************************/ -#define FSL_TRDC_DRIVER_VERSION (MAKE_VERSION(2, 2, 1)) - -#if defined(FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG) && FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG -/* Hardware configuration definitions */ -/*! - * @brief TRDC hardware configuration. - */ -typedef struct _trdc_hardware_config -{ - uint8_t masterNumber; /*!< Number of bus masters. */ - uint8_t domainNumber; /*!< Number of domains. */ - uint8_t mbcNumber; /*!< Number of MBCs. */ - uint8_t mrcNumber; /*!< Number of MRCs. */ -} trdc_hardware_config_t; -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_MBC) && FSL_FEATURE_TRDC_HAS_MBC -/*! - * @brief Hardware configuration of the two slave memories within each MBC(memory block checker). - */ -typedef struct _trdc_slave_memory_hardware_config -{ - uint32_t blockNum; /*!< Number of blocks. */ - uint32_t blockSize; /*!< Block size. */ -} trdc_slave_memory_hardware_config_t; -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_DOMAIN_ASSIGNMENT) && FSL_FEATURE_TRDC_HAS_DOMAIN_ASSIGNMENT -/* Master domain assignment definitions */ -/*! - * @brief TRDC domain ID select method, the register bit TRDC_MDA_W0_0_DFMT0[DIDS], used for - * domain hit evaluation. - */ -typedef enum _trdc_did_sel -{ - kTRDC_DidMda, /*!< Use MDAn[2:0] as DID. */ - kTRDC_DidInput, /*!< Use the input DID (DID_in) as DID. */ - kTRDC_DidMdaAndInput, /*!< Use MDAn[2] concatenated with DID_in[1:0] as DID. */ - kTRDC_DidReserved /*!< Reserved. */ -} trdc_did_sel_t; - -/*! - * @brief TRDC secure attribute, the register bit TRDC_MDA_W0_0_DFMT0[SA], used for - * bus master domain assignment. - */ -typedef enum _trdc_secure_attr -{ - kTRDC_ForceSecure, /*!< Force the bus attribute for this master to secure. */ - kTRDC_ForceNonSecure, /*!< Force the bus attribute for this master to non-secure. */ - kTRDC_MasterSecure, /*!< Use the bus master's secure/nonsecure attribute directly. */ - kTRDC_MasterSecure1, /*!< Use the bus master's secure/nonsecure attribute directly. */ -} trdc_secure_attr_t; - -/*! - * @brief The configuration of domain hit evaluation of PID. - */ -typedef enum _trdc_pid_domain_hit_config -{ - kTRDC_pidDomainHitNone0, /*!< No PID is included in the domain hit evaluation. */ - kTRDC_pidDomainHitNone1, /*!< No PID is included in the domain hit evaluation. */ - kTRDC_pidDomainHitInclusive, /*!< The PID is included in the domain hit evaluation when (PID & ~PIDM). */ - kTRDC_pidDomainHitExclusive, /*!< The PID is included in the domain hit evaluation when ~(PID & ~PIDM). */ -} trdc_pid_domain_hit_config_t; - -/*! - * @brief Domain assignment for the processor bus master. - */ -typedef struct _trdc_processor_domain_assignment -{ - uint32_t domainId : 4U; /*!< Domain ID. */ - uint32_t domainIdSelect : 2U; /*!< Domain ID select method, see @ref trdc_did_sel_t. */ - uint32_t pidDomainHitConfig : 2U; /*!< The configuration of the domain hit evaluation for PID, see @ref - trdc_pid_domain_hit_config_t. */ - uint32_t pidMask : 6U; /*!< The mask combined with PID, so multiple PID can be included as part of the domain hit - determination. Set to 0 to disable. */ - uint32_t secureAttr : 2U; /*!< Secure attribute, see @ref trdc_secure_attr_t. */ - uint32_t pid : 6U; /*!< The process identifier, combined with pidMask to form the domain hit determination. */ - uint32_t : 8U; /*!< Reserved. */ - uint32_t lock : 1U; /*!< Lock the register. */ - uint32_t : 1U; /*!< Reserved. */ -} trdc_processor_domain_assignment_t; - -/*! - * @brief TRDC privileged attribute, the register bit TRDC_MDA_W0_x_DFMT1[PA], used for non-processor - * bus master domain assignment. - */ -typedef enum _trdc_privilege_attr -{ - kTRDC_ForceUser, /*!< Force the bus attribute for this master to user. */ - kTRDC_ForcePrivilege, /*!< Force the bus attribute for this master to privileged. */ - kTRDC_MasterPrivilege, /*!< Use the bus master's attribute directly. */ - kTRDC_MasterPrivilege1, /*!< Use the bus master's attribute directly. */ -} trdc_privilege_attr_t; - -/*! - * @brief Domain assignment for the non-processor bus master. - */ -typedef struct _trdc_non_processor_domain_assignment -{ - uint32_t domainId : 4U; /*!< Domain ID. */ - uint32_t privilegeAttr : 2U; /*!< Privileged attribute, see @ref trdc_privilege_attr_t. */ - uint32_t secureAttr : 2U; /*!< Secure attribute, see @ref trdc_secure_attr_t. */ - uint32_t bypassDomainId : 1U; /*!< Bypass domain ID. */ - uint32_t : 21U; /*!< Reserved. */ - uint32_t lock : 1U; /*!< Lock the register. */ - uint32_t : 1U; /*!< Reserved. */ -} trdc_non_processor_domain_assignment_t; - -/*! - * @brief PID lock configuration. - */ -typedef enum _trdc_pid_lock -{ - kTRDC_PidUnlocked0, /*!< The PID value can be updated by any secure priviledged write. */ - kTRDC_PidUnlocked1, /*!< The PID value can be updated by any secure priviledged write. */ - kTRDC_PidUnlocked2, /*!< The PID value can be updated by any secure priviledged write from the bus master that first - configured this register. */ - kTRDC_PidLocked, /*!< The PID value is locked until next reset. */ -} trdc_pid_lock_t; - -/*! - * @brief Process identifier(PID) configuration for processor cores. - */ -typedef struct _trdc_pid_config -{ - uint32_t pid : 6U; /*!< The process identifier of the executing task. The highest bit can be used to define - secure/nonsecure attribute of the task. */ - uint32_t : 23U; /*!< Reserved. */ - uint32_t lock : 2U; /*!< How to lock the register, see @ref trdc_pid_lock_t. */ - uint32_t : 1U; /*!< Reserved. */ -} trdc_pid_config_t; -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG) && FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG -/* TZ-M congiguration definitions */ -/*! - * @brief IDAU(Implementation-Defined Attribution Unit) configuration for TZ-M function control. - */ -typedef struct _trdc_idau_config -{ - uint32_t : 8U; /*!< Reserved. */ - uint32_t lockSecureVTOR : 1U; /*!< Disable writes to secure VTOR(Vector Table Offset Register). */ - uint32_t lockNonsecureVTOR : 1U; /*!< Disable writes to non-secure VTOR, Application interrupt and Reset Control - Registers. */ - uint32_t lockSecureMPU : 1U; /*!< Disable writes to secure MPU(Memory Protection Unit) from software or from a debug - agent connected to the processor in Secure state. */ - uint32_t lockNonsecureMPU : 1U; /*!< Disable writes to non-secure MPU(Memory Protection Unit) from software or from - a debug agent connected to the processor. */ - uint32_t lockSAU : 1U; /*!< Disable writes to SAU(Security Attribution Unit) registers. */ - uint32_t : 19U; /*!< Reserved. */ -} trdc_idau_config_t; - -/* FLW(Flash Logical Window) configuration definitions */ -/*! - * @brief FLW(Flash Logical Window) configuration. - */ -typedef struct _trdc_flw_config -{ - uint16_t blockCount; /*!< Block count of the Flash Logic Window in 32KByte blocks. */ - uint32_t arrayBaseAddr; /*!< Flash array base address of the Flash Logical Window. */ - bool lock; /*!< Disable writes to FLW registers. */ - bool enable; /*!< Enable FLW function. */ -} trdc_flw_config_t; -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_DOMAIN_ERROR) && FSL_FEATURE_TRDC_HAS_DOMAIN_ERROR -/* Domain error check and clear definitions */ -/*! - * @brief TRDC controller definition for domain error check. Each TRDC instance may have different - * MRC or MBC count, call TRDC_GetHardwareConfig to get the actual count. - */ -typedef enum _trdc_controller -{ - kTRDC_MemBlockController0 = 0U, /*!< Memory block checker 0. */ - kTRDC_MemBlockController1 = 1U, /*!< Memory block checker 1. */ - kTRDC_MemBlockController2 = 2U, /*!< Memory block checker 2. */ - kTRDC_MemBlockController3 = 3U, /*!< Memory block checker 3. */ - kTRDC_MemRegionChecker0 = 4U, /*!< Memory region checker 0. */ - kTRDC_MemRegionChecker1 = 5U, /*!< Memory region checker 1. */ - kTRDC_MemRegionChecker2 = 6U, /*!< Memory region checker 2. */ - kTRDC_MemRegionChecker3 = 7U, /*!< Memory region checker 3. */ - kTRDC_MemRegionChecker4 = 8U, /*!< Memory region checker 4. */ - kTRDC_MemRegionChecker5 = 9U, /*!< Memory region checker 5. */ - kTRDC_MemRegionChecker6 = 10U, /*!< Memory region checker 6. */ -} trdc_controller_t; - -/*! - * @brief TRDC domain error state definition TRDC_MBCn_DERR_W1[EST] or TRDC_MRCn_DERR_W1[EST]. - */ -typedef enum _trdc_error_state -{ - kTRDC_ErrorStateNone = 0x00U, /*!< No access violation detected. */ - kTRDC_ErrorStateNone1 = 0x01U, /*!< No access violation detected. */ - kTRDC_ErrorStateSingle = 0x02U, /*!< Single access violation detected. */ - kTRDC_ErrorStateMulti = 0x03U /*!< Multiple access violation detected. */ -} trdc_error_state_t; - -/*! - * @brief TRDC domain error attribute definition TRDC_MBCn_DERR_W1[EATR] or TRDC_MRCn_DERR_W1[EATR]. - */ -typedef enum _trdc_error_attr -{ - kTRDC_ErrorSecureUserInst = 0x00U, /*!< Secure user mode, instruction fetch access. */ - kTRDC_ErrorSecureUserData = 0x01U, /*!< Secure user mode, data access. */ - kTRDC_ErrorSecurePrivilegeInst = 0x02U, /*!< Secure privileged mode, instruction fetch access. */ - kTRDC_ErrorSecurePrivilegeData = 0x03U, /*!< Secure privileged mode, data access. */ - kTRDC_ErrorNonSecureUserInst = 0x04U, /*!< NonSecure user mode, instruction fetch access. */ - kTRDC_ErrorNonSecureUserData = 0x05U, /*!< NonSecure user mode, data access. */ - kTRDC_ErrorNonSecurePrivilegeInst = 0x06U, /*!< NonSecure privileged mode, instruction fetch access. */ - kTRDC_ErrorNonSecurePrivilegeData = 0x07U /*!< NonSecure privileged mode, data access. */ -} trdc_error_attr_t; - -/*! - * @brief TRDC domain error access type definition TRDC_DERR_W1_n[ERW]. - */ -typedef enum _trdc_error_type -{ - kTRDC_ErrorTypeRead = 0x00U, /*!< Error occurs on read reference. */ - kTRDC_ErrorTypeWrite = 0x01U /*!< Error occurs on write reference. */ -} trdc_error_type_t; - -/*! - * @brief TRDC domain error definition. - */ -typedef struct _trdc_domain_error -{ - trdc_controller_t controller; /*!< Which controller captured access violation. */ - uint32_t address; /*!< Access address that generated access violation. */ - trdc_error_state_t errorState; /*!< Error state. */ - trdc_error_attr_t errorAttr; /*!< Error attribute. */ - trdc_error_type_t errorType; /*!< Error type. */ - uint8_t errorPort; /*!< Error port. */ - uint8_t domainId; /*!< Domain ID. */ - uint8_t slaveMemoryIdx; /*!< The slave memory index. Only apply when violation in MBC. */ -} trdc_domain_error_t; -#endif - -#if (defined(FSL_FEATURE_TRDC_HAS_MBC) && FSL_FEATURE_TRDC_HAS_MBC) || \ - (defined(FSL_FEATURE_TRDC_HAS_MRC) && FSL_FEATURE_TRDC_HAS_MRC) -/* Common definitions for MBC/MRC configuration */ -/*! - * @brief Memory access control configuration for MBC/MRC. - */ -typedef struct _trdc_memory_access_control_config -{ - uint32_t nonsecureUsrX : 1U; /*!< Allow nonsecure user execute access. */ - uint32_t nonsecureUsrW : 1U; /*!< Allow nonsecure user write access. */ - uint32_t nonsecureUsrR : 1U; /*!< Allow nonsecure user read access. */ - uint32_t : 1U; /*!< Reserved. */ - uint32_t nonsecurePrivX : 1U; /*!< Allow nonsecure privilege execute access. */ - uint32_t nonsecurePrivW : 1U; /*!< Allow nonsecure privilege write access. */ - uint32_t nonsecurePrivR : 1U; /*!< Allow nonsecure privilege read access. */ - uint32_t : 1U; /*!< Reserved. */ - uint32_t secureUsrX : 1U; /*!< Allow secure user execute access. */ - uint32_t secureUsrW : 1U; /*!< Allow secure user write access. */ - uint32_t secureUsrR : 1U; /*!< Allow secure user read access. */ - uint32_t : 1U; /*!< Reserved. */ - uint32_t securePrivX : 1U; /*!< Allownsecure privilege execute access. */ - uint32_t securePrivW : 1U; /*!< Allownsecure privilege write access. */ - uint32_t securePrivR : 1U; /*!< Allownsecure privilege read access. */ - uint32_t : 16U; /*!< Reserved. */ - uint32_t lock : 1U; /*!< Lock the configuration until next reset, only apply to access control register 0. */ -} trdc_memory_access_control_config_t; -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_MRC) && FSL_FEATURE_TRDC_HAS_MRC -/*! @brief The region descriptor enumeration, used to form a mask to set/clear the NSE bits for one or several regions. - */ -enum _trdc_region_descriptor -{ - kTRDC_RegionDescriptor0 = (1U << 0U), /*!< Region descriptor 0. */ - kTRDC_RegionDescriptor1 = (1U << 1U), /*!< Region descriptor 1. */ - kTRDC_RegionDescriptor2 = (1U << 2U), /*!< Region descriptor 2. */ - kTRDC_RegionDescriptor3 = (1U << 3U), /*!< Region descriptor 3. */ - kTRDC_RegionDescriptor4 = (1U << 4U), /*!< Region descriptor 4. */ - kTRDC_RegionDescriptor5 = (1U << 5U), /*!< Region descriptor 5. */ - kTRDC_RegionDescriptor6 = (1U << 6U), /*!< Region descriptor 6. */ - kTRDC_RegionDescriptor7 = (1U << 7U), /*!< Region descriptor 7. */ - kTRDC_RegionDescriptor8 = (1U << 8U), /*!< Region descriptor 8. */ - kTRDC_RegionDescriptor9 = (1U << 9U), /*!< Region descriptor 9. */ - kTRDC_RegionDescriptor10 = (1U << 10U), /*!< Region descriptor 10. */ - kTRDC_RegionDescriptor11 = (1U << 11U), /*!< Region descriptor 11. */ - kTRDC_RegionDescriptor12 = (1U << 12U), /*!< Region descriptor 12. */ - kTRDC_RegionDescriptor13 = (1U << 13U), /*!< Region descriptor 13. */ - kTRDC_RegionDescriptor14 = (1U << 14U), /*!< Region descriptor 14. */ - kTRDC_RegionDescriptor15 = (1U << 15U), /*!< Region descriptor 15. */ -}; - -/* MRC configuration definitions */ -/*! @brief The MRC domain enumeration, used to form a mask to enable/disable the update or clear all NSE bits of one or - * several domains. */ -enum _trdc_MRC_domain -{ - kTRDC_MrcDomain0 = (1U << 0U), /*!< Domain 0. */ - kTRDC_MrcDomain1 = (1U << 1U), /*!< Domain 1. */ - kTRDC_MrcDomain2 = (1U << 2U), /*!< Domain 2. */ - kTRDC_MrcDomain3 = (1U << 3U), /*!< Domain 3. */ - kTRDC_MrcDomain4 = (1U << 4U), /*!< Domain 4. */ - kTRDC_MrcDomain5 = (1U << 5U), /*!< Domain 5. */ - kTRDC_MrcDomain6 = (1U << 6U), /*!< Domain 6. */ - kTRDC_MrcDomain7 = (1U << 7U), /*!< Domain 7. */ - kTRDC_MrcDomain8 = (1U << 8U), /*!< Domain 8. */ - kTRDC_MrcDomain9 = (1U << 9U), /*!< Domain 9. */ - kTRDC_MrcDomain10 = (1U << 10U), /*!< Domain 10. */ - kTRDC_MrcDomain11 = (1U << 11U), /*!< Domain 11. */ - kTRDC_MrcDomain12 = (1U << 12U), /*!< Domain 12. */ - kTRDC_MrcDomain13 = (1U << 13U), /*!< Domain 13. */ - kTRDC_MrcDomain14 = (1U << 14U), /*!< Domain 14. */ - kTRDC_MrcDomain15 = (1U << 15U), /*!< Domain 15. */ -}; - -/*! - * @brief The configuration of each region descriptor per domain per MRC instance. - */ -typedef struct _trdc_mrc_region_descriptor_config -{ - uint8_t memoryAccessControlSelect; /*!< Select one of the 8 access control policies for this region, for - access cotrol policies see @ref trdc_memory_access_control_config_t. */ - uint32_t startAddr; /*!< Physical start address. */ - bool valid; /*!< Lock the register. */ - bool nseEnable; /*!< Enable non-secure accesses and disable secure accesses. */ - uint32_t endAddr; /*!< Physical start address. */ - uint8_t mrcIdx; /*!< The index of the MRC for this configuration to take effect. */ - uint8_t domainIdx; /*!< The index of the domain for this configuration to take effect. */ - uint8_t regionIdx; /*!< The index of the region for this configuration to take effect. */ -} trdc_mrc_region_descriptor_config_t; -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_MBC) && FSL_FEATURE_TRDC_HAS_MBC -/* MBC configuration definitions */ -/*! - * @brief The configuration of MBC NSE update. - */ -#if defined(FSL_FEATURE_TRDC_DOMAIN_COUNT) && (FSL_FEATURE_TRDC_DOMAIN_COUNT > 0x8U) -typedef struct _trdc_mbc_nse_update_config -{ - uint32_t autoIncrement : 1U; /*!< Whether to increment the word index after current word is updated using this - configuration. */ - uint32_t : 1U; /*!< Reserved. */ - uint32_t wordIdx : 4U; /*!< MBC configuration word index to be updated. */ - uint32_t : 2U; /*!< Reserved. */ - uint32_t memorySelect : 4U; /*!< Bit mask of the selected memory to be updated. @ref _trdc_MBC_memory. */ - uint32_t : 4U; /*!< Reserved. */ - uint32_t domianSelect : 16U; /*!< Bit mask of the selected domain to be updated. @ref _trdc_MBC_domain. */ -} trdc_mbc_nse_update_config_t; -#else -typedef struct _trdc_mbc_nse_update_config -{ - uint32_t : 2U; /*!< Reserved. */ - uint32_t wordIdx : 4U; /*!< MBC configuration word index to be updated. */ - uint32_t : 2U; /*!< Reserved. */ - uint32_t memorySelect : 4U; /*!< Bit mask of the selected memory to be updated. @ref _trdc_MBC_memory. */ - uint32_t : 4U; /*!< Reserved. */ - uint32_t domianSelect : 8U; /*!< Bit mask of the selected domain to be updated. @ref _trdc_MBC_domain. */ - uint32_t : 7U; /*!< Reserved. */ - uint32_t autoIncrement : 1U; /*!< Whether to increment the word index after current word is updated using this - configuration. */ -} trdc_mbc_nse_update_config_t; -#endif - -/*! @brief The MBC domain enumeration, used to form a mask to enable/disable the update or clear NSE bits of one or - * several domains. */ -enum _trdc_MBC_domain -{ - kTRDC_MbcDomain0 = (1U << 0U), /*!< Domain 0. */ - kTRDC_MbcDomain1 = (1U << 1U), /*!< Domain 1. */ - kTRDC_MbcDomain2 = (1U << 2U), /*!< Domain 2. */ - kTRDC_MbcDomain3 = (1U << 3U), /*!< Domain 3. */ - kTRDC_MbcDomain4 = (1U << 4U), /*!< Domain 4. */ - kTRDC_MbcDomain5 = (1U << 5U), /*!< Domain 5. */ - kTRDC_MbcDomain6 = (1U << 6U), /*!< Domain 6. */ - kTRDC_MbcDomain7 = (1U << 7U), /*!< Domain 7. */ -}; - -/*! @brief The MBC slave memory enumeration, used to form a mask to enable/disable the update or clear NSE bits of one - * or several memory block. */ -enum _trdc_MBC_memory -{ - kTRDC_MbcSlaveMemory0 = (1U << 0U), /*!< Memory 0. */ - kTRDC_MbcSlaveMemory1 = (1U << 1U), /*!< Memory 1. */ - kTRDC_MbcSlaveMemory2 = (1U << 2U), /*!< Memory 2. */ - kTRDC_MbcSlaveMemory3 = (1U << 3U), /*!< Memory 3. */ -}; - -/*! @brief The MBC bit enumeration, used to form a mask to set/clear configured words' NSE. */ -enum _trdc_MBC_bit -{ - kTRDC_MbcBit0 = (1U << 0U), /*!< Bit 0. */ - kTRDC_MbcBit1 = (1U << 1U), /*!< Bit 1. */ - kTRDC_MbcBit2 = (1U << 2U), /*!< Bit 2. */ - kTRDC_MbcBit3 = (1U << 3U), /*!< Bit 3. */ - kTRDC_MbcBit4 = (1U << 4U), /*!< Bit 4. */ - kTRDC_MbcBit5 = (1U << 5U), /*!< Bit 5. */ - kTRDC_MbcBit6 = (1U << 6U), /*!< Bit 6. */ - kTRDC_MbcBit7 = (1U << 7U), /*!< Bit 7. */ - kTRDC_MbcBit8 = (1U << 8U), /*!< Bit 8. */ - kTRDC_MbcBit9 = (1U << 9U), /*!< Bit 9. */ - kTRDC_MbcBit10 = (1U << 10U), /*!< Bit 10. */ - kTRDC_MbcBit11 = (1U << 11U), /*!< Bit 11. */ - kTRDC_MbcBit12 = (1U << 12U), /*!< Bit 12. */ - kTRDC_MbcBit13 = (1U << 13U), /*!< Bit 13. */ - kTRDC_MbcBit14 = (1U << 14U), /*!< Bit 14. */ - kTRDC_MbcBit15 = (1U << 15U), /*!< Bit 15. */ - kTRDC_MbcBit16 = (1U << 16U), /*!< Bit 16. */ - kTRDC_MbcBit17 = (1U << 17U), /*!< Bit 17. */ - kTRDC_MbcBit18 = (1U << 18U), /*!< Bit 18. */ - kTRDC_MbcBit19 = (1U << 19U), /*!< Bit 19. */ - kTRDC_MbcBit20 = (1U << 20U), /*!< Bit 20. */ - kTRDC_MbcBit21 = (1U << 21U), /*!< Bit 21. */ - kTRDC_MbcBit22 = (1U << 22U), /*!< Bit 22. */ - kTRDC_MbcBit23 = (1U << 23U), /*!< Bit 23. */ - kTRDC_MbcBit24 = (1U << 24U), /*!< Bit 24. */ - kTRDC_MbcBit25 = (1U << 25U), /*!< Bit 25. */ - kTRDC_MbcBit26 = (1U << 26U), /*!< Bit 26. */ - kTRDC_MbcBit27 = (1U << 27U), /*!< Bit 27. */ - kTRDC_MbcBit28 = (1U << 28U), /*!< Bit 28. */ - kTRDC_MbcBit29 = (1U << 29U), /*!< Bit 29. */ - kTRDC_MbcBit30 = (1U << 30U), /*!< Bit 30. */ - kTRDC_MbcBit31 = (1U << 31U), /*!< Bit 31. */ -}; - -/*! - * @brief The configuration of each memory block per domain per MBC instance. - */ -typedef struct _trdc_mbc_memory_block_config -{ - uint32_t memoryAccessControlSelect : 3U; /*!< Select one of the 8 access control policies for this memory block, for - access cotrol policies see @ref trdc_memory_access_control_config_t. */ - uint32_t nseEnable : 1U; /*!< Enable non-secure accesses and disable secure accesses. */ - uint32_t mbcIdx : 4U; /*!< The index of the MBC for this configuration to take effect. */ - uint32_t domainIdx : 8U; /*!< The index of the domain for this configuration to take effect. */ - uint32_t slaveMemoryIdx : 8U; /*!< The index of the slave memory for this configuration to take effect. */ - uint32_t memoryBlockIdx : 8U; /*!< The index of the memory block for this configuration to take effect. */ -} trdc_mbc_memory_block_config_t; -#endif - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ -/*! - * @brief Initializes the TRDC module. - * - * This function enables the TRDC clock. - * - * @param base TRDC peripheral base address. - */ -void TRDC_Init(TRDC_Type *base); - -/*! - * @brief De-initializes the TRDC module. - * - * This function disables the TRDC clock. - * - * @param base TRDC peripheral base address. - */ -void TRDC_Deinit(TRDC_Type *base); -/*! @} */ - -#if defined(FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG) && FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG -/*! - * @name Hardware configuration - * @{ - */ -/*! - * @brief Gets the domain ID of the current bus master. - * - * @param base TRDC peripheral base address. - * @return Domain ID of current bus master. - */ -static inline uint8_t TRDC_GetCurrentMasterDomainId(TRDC_Type *base) -{ - return (uint8_t)((TRDC_GENERAL_BASE(base)->TRDC_HWCFG1 & TRDC_TRDC_HWCFG1_DID_MASK) >> TRDC_TRDC_HWCFG1_DID_SHIFT); -} - -/*! - * @brief Gets the TRDC hardware configuration. - * - * This function gets the TRDC hardware configurations, including number of bus - * masters, number of domains, number of MRCs and number of PACs. - * - * @param base TRDC peripheral base address. - * @param config Pointer to the structure to get the configuration. - */ -void TRDC_GetHardwareConfig(TRDC_Type *base, trdc_hardware_config_t *config); -/*! @} */ -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_DOMAIN_ASSIGNMENT) && FSL_FEATURE_TRDC_HAS_DOMAIN_ASSIGNMENT -/*! - * @name Master domain assignment - * @{ - */ -/*! - * @brief Sets the TRDC DAC(Domain Assignment Controllers) global valid. - * - * Once enabled, it will remain enabled until next reset. - * - * @param base TRDC peripheral base address. - */ -static inline void TRDC_SetDacGlobalValid(TRDC_Type *base) -{ - TRDC_GENERAL_BASE(base)->TRDC_CR |= TRDC_TRDC_CR_GVLDM_MASK; -} - -/*! - * @brief Locks the bus master domain assignment register. - * - * This function locks the master domain assignment. After it is locked, the register can't be changed - * until next reset. - * - * @param base TRDC peripheral base address. - * @param master Which master to configure, refer to trdcx_master_t in processor header file, x is trdc instance. - * @param regNum Which register to configure, processor master can have more than one register for the MDAC - configuration. - * @param assignIndex Which assignment register to lock. - */ -static inline void TRDC_LockMasterDomainAssignment(TRDC_Type *base, uint8_t master, uint8_t regNum) -{ - /* Make sure in the master range. */ - assert((uint32_t)master < - ((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NMSTR_MASK) >> TRDC_TRDC_HWCFG0_NMSTR_SHIFT)); - if (0U == (TRDC_GENERAL_BASE(base)->DACFG[master] & TRDC_DACFG_NCM_MASK)) - { - TRDC_DOMAIN_ASSIGNMENT_BASE(base)->MDA_DFMT0[master].MDA_W_DFMT0[regNum] |= TRDC_MDA_W_DFMT0_LK1_MASK; - } - else - { - TRDC_DOMAIN_ASSIGNMENT_BASE(base)->MDA_DFMT1[master].MDA_W_DFMT1[0] |= TRDC_MDA_W_DFMT1_LK1_MASK; - } -} - -/*! - * @brief Sets the master domain assignment as valid or invalid. - * - * This function sets the master domain assignment as valid or invalid. - * - * @param base TRDC peripheral base address. - * @param master Which master to configure. - * @param regNum Which register to configure, processor master can have more than one register for the MDAC - * configuration. - * @param assignIndex Index for the domain assignment register. - * @param valid True to set valid, false to set invalid. - */ -static inline void TRDC_SetMasterDomainAssignmentValid(TRDC_Type *base, uint8_t master, uint8_t regNum, bool valid) -{ - /* Make sure in the master range. */ - assert((uint32_t)master < - ((TRDC_GENERAL_BASE(base)->TRDC_HWCFG0 & TRDC_TRDC_HWCFG0_NMSTR_MASK) >> TRDC_TRDC_HWCFG0_NMSTR_SHIFT)); - if (valid) - { - if (0U == (TRDC_GENERAL_BASE(base)->DACFG[master] & TRDC_DACFG_NCM_MASK)) - { - TRDC_DOMAIN_ASSIGNMENT_BASE(base)->MDA_DFMT0[master].MDA_W_DFMT0[regNum] |= TRDC_MDA_W_DFMT0_VLD_MASK; - } - else - { - TRDC_DOMAIN_ASSIGNMENT_BASE(base)->MDA_DFMT1[master].MDA_W_DFMT1[0] |= TRDC_MDA_W_DFMT1_VLD_MASK; - } - } - else - { - if (0U == (TRDC_GENERAL_BASE(base)->DACFG[master] & TRDC_DACFG_NCM_MASK)) - { - TRDC_DOMAIN_ASSIGNMENT_BASE(base)->MDA_DFMT0[master].MDA_W_DFMT0[regNum] &= ~TRDC_MDA_W_DFMT0_VLD_MASK; - } - else - { - TRDC_DOMAIN_ASSIGNMENT_BASE(base)->MDA_DFMT1[master].MDA_W_DFMT1[0] &= ~TRDC_MDA_W_DFMT1_VLD_MASK; - } - } -} - -/*! - * @brief Gets the default master domain assignment for the processor bus master. - * - * This function gets the default master domain assignment for the processor bus master. - * It should only be used for the processor bus masters, such as CORE0. This function - * sets the assignment as follows: - * - * @code - * assignment->domainId = 0U; - * assignment->domainIdSelect = kTRDC_DidMda; - * assignment->lock = 0U; - * @endcode - * - * @param domainAssignment Pointer to the assignment structure. - */ -void TRDC_GetDefaultProcessorDomainAssignment(trdc_processor_domain_assignment_t *domainAssignment); - -/*! - * @brief Gets the default master domain assignment for non-processor bus master. - * - * This function gets the default master domain assignment for non-processor bus master. - * It should only be used for the non-processor bus masters, such as DMA. This function - * sets the assignment as follows: - * - * @code - * assignment->domainId = 0U; - * assignment->privilegeAttr = kTRDC_ForceUser; - * assignment->secureAttr = kTRDC_ForceSecure; - * assignment->bypassDomainId = 0U; - * assignment->lock = 0U; - * @endcode - * - * @param domainAssignment Pointer to the assignment structure. - */ -void TRDC_GetDefaultNonProcessorDomainAssignment(trdc_non_processor_domain_assignment_t *domainAssignment); - -/*! - * @brief Sets the processor bus master domain assignment. - * - * This function sets the processor master domain assignment as valid. - * One bus master might have multiple domain assignment registers. The parameter - * \p assignIndex specifies which assignment register to set. - * - * Example: Set domain assignment for core 0. - * - * @code - * trdc_processor_domain_assignment_t processorAssignment; - * - * TRDC_GetDefaultProcessorDomainAssignment(&processorAssignment); - * - * processorAssignment.domainId = 0; - * processorAssignment.xxx = xxx; - * TRDC_SetMasterDomainAssignment(TRDC, &processorAssignment); - * @endcode - * - * @param base TRDC peripheral base address. - * @param master Which master to configure, refer to trdc_master_t in processor header file. - * @param regNum Which register to configure, processor master can have more than one register for the MDAC - * configuration. - * @param domainAssignment Pointer to the assignment structure. - */ -void TRDC_SetProcessorDomainAssignment(TRDC_Type *base, - uint8_t master, - uint8_t regNum, - const trdc_processor_domain_assignment_t *domainAssignment); - -/*! - * @brief Sets the non-processor bus master domain assignment. - * - * This function sets the non-processor master domain assignment as valid. - * One bus master might have multiple domain assignment registers. The parameter - * \p assignIndex specifies which assignment register to set. - * - * Example: Set domain assignment for DMA0. - * @code - * trdc_non_processor_domain_assignment_t nonProcessorAssignment; - * - * TRDC_GetDefaultNonProcessorDomainAssignment(&nonProcessorAssignment); - * nonProcessorAssignment.domainId = 1; - * nonProcessorAssignment.xxx = xxx; - * - * TRDC_SetMasterDomainAssignment(TRDC, kTrdcMasterDma0, 0U, &nonProcessorAssignment); - * @endcode - * - * @param base TRDC peripheral base address. - * @param master Which master to configure, refer to trdc_master_t in processor header file. - * @param domainAssignment Pointer to the assignment structure. - */ -void TRDC_SetNonProcessorDomainAssignment(TRDC_Type *base, - uint8_t master, - const trdc_non_processor_domain_assignment_t *domainAssignment); - -/*! - * @brief Gets the bit map of the bus master(s) that is(are) sourcing a PID register. - * - * This function sets the non-processor master domain assignment as valid. - * - * @param base TRDC peripheral base address. - * @return the bit map of the master(s). Bit 1 sets indicates bus master 1. - */ -static inline uint64_t TRDC_GetActiveMasterPidMap(TRDC_Type *base) -{ - return ((uint64_t)TRDC_GENERAL_BASE(base)->TRDC_HWCFG3 << 32U) | (uint64_t)TRDC_GENERAL_BASE(base)->TRDC_HWCFG2; -} - -/*! - * @brief Sets the current Process identifier(PID) for processor core. - * - * Each processor has a corresponding process identifier (PID) which can be used to group tasks into different domains. - * Secure privileged software saves and restores the PID as part of any context switch. - * This data structure defines an array of 32-bit values, one per MDA module, that define the PID. Since this register - * resource is only applicable to processor cores, the data structure is typically sparsely populated. The HWCFG[2-3] - * registers provide a bitmap of the implemented PIDn registers. This data structure is indexed using the corresponding - * MDA instance number. Depending on the operating clock domain of each DAC instance, there may be optional information - * stored in the corresponding PIDm register to properly implement the LK2 = 2 functionality. - * - * @param base TRDC peripheral base address. - * @param master Which processor master to configure, refer to trdc_master_t in processor header file. - * @param pidConfig Pointer to the configuration structure. - */ -void TRDC_SetPid(TRDC_Type *base, uint8_t master, const trdc_pid_config_t *pidConfig); -/*! @} */ -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG) && FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG -/*! - * @name TZ-M congiguration - * @{ - */ -/*! - * @brief Gets the default IDAU(Implementation-Defined Attribution Unit) configuration. - * - * @code - * config->lockSecureVTOR = false; - * config->lockNonsecureVTOR = false; - * config->lockSecureMPU = false; - * config->lockNonsecureMPU = false; - * config->lockSAU = false; - * @endcode - * - * @param domainAssignment Pointer to the configuration structure. - */ -void TRDC_GetDefaultIDAUConfig(trdc_idau_config_t *idauConfiguration); - -/*! - * @brief Sets the IDAU(Implementation-Defined Attribution Unit) control configuration. - * - * Example: Lock the secure and non-secure MPU registers. - * - * @code - * trdc_idau_config_t idauConfiguration; - * - * TRDC_GetDefaultIDAUConfig(&idauConfiguration); - * - * idauConfiguration.lockSecureMPU = true; - * idauConfiguration.lockNonsecureMPU = true; - * TRDC_SetIDAU(TRDC, &idauConfiguration); - * @endcode - * - * @param base TRDC peripheral base address. - * @param domainAssignment Pointer to the configuration structure. - */ -void TRDC_SetIDAU(TRDC_Type *base, const trdc_idau_config_t *idauConfiguration); -/*! @} */ -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_FLW) && FSL_FEATURE_TRDC_HAS_FLW -/*! - * @name FLW(Flash Logical Window) configuration - * @{ - */ -/*! - * @brief Enables/disables the FLW(flash logical window) function. - * - * @param base TRDC peripheral base address. - * @param enable True to enable, false to disable. - */ -static inline void TRDC_EnableFlashLogicalWindow(TRDC_Type *base, bool enable) -{ - if (enable) - { - TRDC_FLW_BASE(base)->TRDC_FLW_CTL |= TRDC_TRDC_FLW_CTL_V_MASK; - } - else - { - TRDC_FLW_BASE(base)->TRDC_FLW_CTL &= ~TRDC_TRDC_FLW_CTL_V_MASK; - } -} - -/*! - * @brief Locks FLW registers. Once locked the registers can noy be updated until next reset. - * - * @param base TRDC peripheral base address. - */ -static inline void TRDC_LockFlashLogicalWindow(TRDC_Type *base) -{ - TRDC_FLW_BASE(base)->TRDC_FLW_CTL |= TRDC_TRDC_FLW_CTL_LK_MASK; -} - -/*! - * @brief Gets the FLW physical base address. - * - * @param base TRDC peripheral base address. - * @return Physical address of the FLW function. - */ -static inline uint32_t TRDC_GetFlashLogicalWindowPbase(TRDC_Type *base) -{ - return TRDC_FLW_BASE(base)->TRDC_FLW_PBASE; -} - -/*! - * @brief Sets the FLW size. - * - * @param base TRDC peripheral base address. - * @param size Size of the FLW in unit of 32k bytes. - */ -static inline void TRDC_GetSetFlashLogicalWindowSize(TRDC_Type *base, uint16_t size) -{ - TRDC_FLW_BASE(base)->TRDC_FLW_BCNT = size; -} - -/*! - * @brief Gets the default FLW(Flsh Logical Window) configuration. - * - * @code - * config->blockCount = false; - * config->arrayBaseAddr = false; - * config->lock = false; - * config->enable = false; - * @endcode - * - * @param flwConfiguration Pointer to the configuration structure. - */ -void TRDC_GetDefaultFlashLogicalWindowConfig(trdc_flw_config_t *flwConfiguration); - -/*! - * @brief Sets the FLW function's configuration. - * - * @code - * trdc_flw_config_t flwConfiguration; - * - * TRDC_GetDefaultIDAUConfig(&flwConfiguration); - * - * flwConfiguration.blockCount = 32U; - * flwConfiguration.arrayBaseAddr = 0xXXXXXXXX; - * TRDC_SetIDAU(TRDC, &flwConfiguration); - * @endcode - * - * @param base TRDC peripheral base address. - * @param flwConfiguration Pointer to the configuration structure. - */ -void TRDC_SetFlashLogicalWindow(TRDC_Type *base, const trdc_flw_config_t *flwConfiguration); -/*! @} */ -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_DOMAIN_ERROR) && FSL_FEATURE_TRDC_HAS_DOMAIN_ERROR -/*! - * @name Domain error check and clear - * @{ - */ -/*! - * @brief Gets and clears the first domain error of the current domain. - * - * This function gets the first access violation information for the current domain - * and clears the pending flag. There might be multiple access violations pending - * for the current domain. This function only processes the first error. - * - * @param base TRDC peripheral base address. - * @param error Pointer to the error information. - * @return If the access violation is captured, this function returns the kStatus_Success. - * The error information can be obtained from the parameter error. If no - * access violation is captured, this function returns the kStatus_NoData. - */ -status_t TRDC_GetAndClearFirstDomainError(TRDC_Type *base, trdc_domain_error_t *error); - -/*! - * @brief Gets and clears the first domain error of the specific domain. - * - * This function gets the first access violation information for the specific domain - * and clears the pending flag. There might be multiple access violations pending - * for the current domain. This function only processes the first error. - * - * @param base TRDC peripheral base address. - * @param error Pointer to the error information. - * @param domainId The error of which domain to get and clear. - * @return If the access violation is captured, this function returns the kStatus_Success. - * The error information can be obtained from the parameter error. If no - * access violation is captured, this function returns the kStatus_NoData. - */ -status_t TRDC_GetAndClearFirstSpecificDomainError(TRDC_Type *base, trdc_domain_error_t *error, uint8_t domainId); -/*! @} */ -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_MRC) && FSL_FEATURE_TRDC_HAS_MRC -/*! - * @name MRC configuration - * @{ - */ -#if defined(FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG) && FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG -/*! - * @brief Sets the TRDC MRC(Memory Region Checkers) global valid. - * - * Once enabled, it will remain enabled until next reset. - * - * @param base TRDC peripheral base address. - */ -static inline void TRDC_SetMrcGlobalValid(TRDC_Type *base) -{ - TRDC_GENERAL_BASE(base)->TRDC_CR |= TRDC_TRDC_CR_GVLDR_MASK; -} -#endif - -/*! - * @brief Gets the TRDC MRC(Memory Region Checkers) region number valid. - * - * @param base TRDC peripheral base address. - * @return the region number of the given MRC instance - */ -static inline uint8_t TRDC_GetMrcRegionNumber(TRDC_Type *base, uint8_t mrcIdx) -{ - return (uint8_t)((TRDC_MRC_BASE(base, mrcIdx)->MRC_GLBCFG & TRDC_MRC_GLBCFG_NRGNS_MASK) >> - TRDC_MRC_GLBCFG_NRGNS_SHIFT); -} - -/*! - * @brief Sets the memory access configuration for one of the access control register of one MRC. - * - * Example: Enable the secure operations and lock the configuration for MRC0 region 1. - * - * @code - * trdc_memory_access_control_config_t config; - * - * config.securePrivX = true; - * config.securePrivW = true; - * config.securePrivR = true; - * config.lock = true; - * TRDC_SetMrcMemoryAccess(TRDC, &config, 0, 1); - * @endcode - * - * @param base TRDC peripheral base address. - * @param config Pointer to the configuration structure. - * @param mrcIdx MRC index. - * @param regIdx Register number. - */ -void TRDC_MrcSetMemoryAccessConfig(TRDC_Type *base, - const trdc_memory_access_control_config_t *config, - uint8_t mrcIdx, - uint8_t regIdx); - -/*! - * @brief Enables the update of the selected domians. - * - * After the domians' update are enabled, their regions' NSE bits can be set or clear. - * - * @param base TRDC peripheral base address. - * @param mrcIdx MRC index. - * @param domianMask Bit mask of the domains to be enabled. - * @param enable True to enable, false to disable. - */ -void TRDC_MrcEnableDomainNseUpdate(TRDC_Type *base, uint8_t mrcIdx, uint16_t domianMask, bool enable); - -/*! - * @brief Sets the NSE bits of the selected regions for domains. - * - * This function sets the NSE bits for the selected regions for the domains whose update are enabled. - * - * @param base TRDC peripheral base address. - * @param mrcIdx MRC index. - * @param regionMask Bit mask of the regions whose NSE bits to set. - */ -void TRDC_MrcRegionNseSet(TRDC_Type *base, uint8_t mrcIdx, uint16_t regionMask); - -/*! - * @brief Clears the NSE bits of the selected regions for domains. - * - * This function clears the NSE bits for the selected regions for the domains whose update are enabled. - * - * @param base TRDC peripheral base address. - * @param mrcIdx MRC index. - * @param regionMask Bit mask of the regions whose NSE bits to clear. - */ -void TRDC_MrcRegionNseClear(TRDC_Type *base, uint8_t mrcIdx, uint16_t regionMask); - -/*! - * @brief Clears the NSE bits for all the regions of the selected domains. - * - * This function clears the NSE bits for all regions of selected domains whose update are enabled. - * - * @param base TRDC peripheral base address. - * @param mrcIdx MRC index. - * @param domainMask Bit mask of the domians whose NSE bits to clear. - */ -void TRDC_MrcDomainNseClear(TRDC_Type *base, uint8_t mrcIdx, uint16_t domainMask); - -/*! - * @brief Sets the configuration for one of the region descriptor per domain per MRC instnce. - * - * This function sets the configuration for one of the region descriptor, including the start - * and end address of the region, memory access control policy and valid. - * - * @param base TRDC peripheral base address. - * @param config Pointer to region descriptor configuration structure. - */ -void TRDC_MrcSetRegionDescriptorConfig(TRDC_Type *base, const trdc_mrc_region_descriptor_config_t *config); -/*! @} */ -#endif - -#if defined(FSL_FEATURE_TRDC_HAS_MBC) && FSL_FEATURE_TRDC_HAS_MBC -/*! - * @name MBC configuration - * @{ - */ -#if defined(FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG) && FSL_FEATURE_TRDC_HAS_GENERAL_CONFIG -/*! - * @brief Sets the TRDC MBC(Memory Block Checkers) global valid. - * - * Once enabled, it will remain enabled until next reset. - * - * @param base TRDC peripheral base address. - */ -static inline void TRDC_SetMbcGlobalValid(TRDC_Type *base) -{ - TRDC_GENERAL_BASE(base)->TRDC_CR |= TRDC_TRDC_CR_GVLDB_MASK; -} -#endif - -/*! - * @brief Gets the hardware configuration of the one of two slave memories within each MBC(memory block checker). - * - * @param base TRDC peripheral base address. - * @param config Pointer to the structure to get the configuration. - * @param mbcIdx MBC number. - * @param slvIdx Slave number. - */ -void TRDC_GetMbcHardwareConfig(TRDC_Type *base, - trdc_slave_memory_hardware_config_t *config, - uint8_t mbcIdx, - uint8_t slvIdx); - -/*! - * @brief Sets the NSR update configuration for one of the MBC instance. - * - * After set the NSE configuration, the configured memory area can be updateby NSE set/clear. - * - * @param base TRDC peripheral base address. - * @param config Pointer to NSE update configuration structure. - * @param mbcIdx MBC index. - */ -void TRDC_MbcSetNseUpdateConfig(TRDC_Type *base, const trdc_mbc_nse_update_config_t *config, uint8_t mbcIdx); - -/*! - * @brief Sets the NSE bits of the selected configuration words according to NSE update configuration. - * - * This function sets the NSE bits of the word for the configured regio, memory. - * - * @param base TRDC peripheral base address. - * @param mbcIdx MBC index. - * @param bitMask Mask of the bits whose NSE bits to set. - */ -void TRDC_MbcWordNseSet(TRDC_Type *base, uint8_t mbcIdx, uint32_t bitMask); - -/*! - * @brief Clears the NSE bits of the selected configuration words according to NSE update configuration. - * - * This function sets the NSE bits of the word for the configured regio, memory. - * - * @param base TRDC peripheral base address. - * @param mbcIdx MBC index. - * @param bitMask Mask of the bits whose NSE bits to clear. - */ -void TRDC_MbcWordNseClear(TRDC_Type *base, uint8_t mbcIdx, uint32_t bitMask); - -/*! - * @brief Clears all configuration words' NSE bits of the selected domain and memory. - * - * @param base TRDC peripheral base address. - * @param mbcIdx MBC index. - * @param domainMask Mask of the domains whose NSE bits to clear, 0b110 means clear domain 1&2. - * @param slaveMask Mask of the slaves whose NSE bits to clear, 0x11 means clear all slave 0&1's NSE bits. - */ -void TRDC_MbcNseClearAll(TRDC_Type *base, uint8_t mbcIdx, uint16_t domainMask, uint8_t slave); - -/*! - * @brief Sets the memory access configuration for one of the region descriptor of one MBC. - * - * Example: Enable the secure operations and lock the configuration for MRC0 region 1. - * - * @code - * trdc_memory_access_control_config_t config; - * - * config.securePrivX = true; - * config.securePrivW = true; - * config.securePrivR = true; - * config.lock = true; - * TRDC_SetMbcMemoryAccess(TRDC, &config, 0, 1); - * @endcode - * - * @param base TRDC peripheral base address. - * @param config Pointer to the configuration structure. - * @param mbcIdx MBC index. - * @param rgdIdx Region descriptor number. - */ -void TRDC_MbcSetMemoryAccessConfig(TRDC_Type *base, - const trdc_memory_access_control_config_t *config, - uint8_t mbcIdx, - uint8_t rgdIdx); - -/*! - * @brief Sets the configuration for one of the memory block per domain per MBC instnce. - * - * This function sets the configuration for one of the memory block, including the memory access - * control policy and nse enable. - * - * @param base TRDC peripheral base address. - * @param config Pointer to memory block configuration structure. - */ -void TRDC_MbcSetMemoryBlockConfig(TRDC_Type *base, const trdc_mbc_memory_block_config_t *config); -/*! @} */ -#endif - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ - -#endif /* FSL_TRDC_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_trdc_core.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_trdc_core.h deleted file mode 100644 index 8c3e2a9b508..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_trdc_core.h +++ /dev/null @@ -1,489 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_TRDC_CORE_H_ -#define FSL_TRDC_CORE_H_ - -#include "fsl_trdc_soc.h" - -/*! - * @addtogroup trdc_core - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/*!@brief TRDC general configuration register definition. */ -typedef struct _TRDC_General_Type -{ - __IO uint32_t TRDC_CR; /**< TRDC Register, offset: 0x0 */ - uint8_t RESERVED_0[236]; - __I uint32_t TRDC_HWCFG0; /**< TRDC Hardware Configuration Register 0, offset: 0xF0 */ - __I uint32_t TRDC_HWCFG1; /**< TRDC Hardware Configuration Register 1, offset: 0xF4 */ - __I uint32_t TRDC_HWCFG2; /**< TRDC Hardware Configuration Register 2, offset: 0xF8 */ - __I uint32_t TRDC_HWCFG3; /**< TRDC Hardware Configuration Register 3, offset: 0xFC */ - __I uint8_t DACFG[8]; /**< Domain Assignment Configuration Register, array offset: 0x100, array step: 0x1 */ - uint8_t RESERVED_1[184]; - __IO uint32_t TRDC_IDAU_CR; /**< TRDC IDAU Control Register, offset: 0x1C0 */ -} TRDC_General_Type; - -/*!@brief TRDC flash logical control register definition. */ -typedef struct _TRDC_FLW_Type -{ - __IO uint32_t TRDC_FLW_CTL; /**< TRDC FLW Control, offset: 0x1E0 */ - __I uint32_t TRDC_FLW_PBASE; /**< TRDC FLW Physical Base, offset: 0x1E4 */ - __IO uint32_t TRDC_FLW_ABASE; /**< TRDC FLW Array Base, offset: 0x1E8 */ - __IO uint32_t TRDC_FLW_BCNT; /**< TRDC FLW Block Count, offset: 0x1EC */ -} TRDC_FLW_Type; - -/*!@brief TRDC domain error register definition. */ -typedef struct _TRDC_DomainError_Type -{ - __IO uint32_t TRDC_FDID; /**< TRDC Fault Domain ID, offset: 0x1FC */ - __I uint32_t TRDC_DERRLOC[16]; /**< TRDC Domain Error Location Register, array offset: 0x200, array step: 0x4 */ - uint8_t RESERVED_4[448]; - struct - { /* offset: 0x400, array step: 0x10 */ - __I uint32_t W0; /**< MBC Domain Error Word0 Register, array offset: 0x400, array step: 0x10 */ - __I uint32_t W1; /**< MBC Domain Error Word1 Register, array offset: 0x404, array step: 0x10 */ - uint8_t RESERVED_0[4]; - __O uint32_t W3; /**< MBC Domain Error Word3 Register, array offset: 0x40C, array step: 0x10 */ - } MBC_DERR[8]; - struct - { /* offset: 0x480, array step: 0x10 */ - __I uint32_t W0; /**< MRC Domain Error Word0 Register, array offset: 0x480, array step: 0x10 */ - __I uint32_t W1; /**< MRC Domain Error Word1 Register, array offset: 0x484, array step: 0x10 */ - uint8_t RESERVED_0[4]; - __O uint32_t W3; /**< MRC Domain Error Word3 Register, array offset: 0x48C, array step: 0x10 */ - } MRC_DERR[8]; -} TRDC_DomainError_Type; - -/*!@brief TRDC master domain assignment register definition. */ -typedef struct _TRDC_DomainAssignment_Type -{ - __IO uint32_t PID[8]; /**< Process Identifier, array offset: 0x700, array step: 0x4 */ - uint8_t RESERVED_7[224]; - union - { - struct - { /* offset: 0x800, array step: 0x20 */ - __IO uint32_t MDA_W_DFMT0[8]; /**< DAC Master Domain Assignment Register, array offset: 0x800, array step: - index*0x20, index2*0x4 */ - } MDA_DFMT0[8]; - struct - { /* offset: 0x800, array step: 0x20 */ - __IO uint32_t MDA_W_DFMT1[1]; /**< DAC Master Domain Assignment Register, array offset: 0x800, array step: - index*0x20, index2*0x4 */ - uint8_t RESERVED_0[28]; - } MDA_DFMT1[8]; - }; -} TRDC_DomainAssignment_Type; - -/*!@brief TRDC MBC control register definition. */ -typedef struct _TRDC_MBC_Type -{ - __I uint32_t MBC_MEM_GLBCFG[4]; /**< MBC Global Configuration Register, array offset: 0x10000, array step: - index*0x2000, index2*0x4 */ - __IO uint32_t MBC_NSE_BLK_INDEX; /**< MBC NonSecure Enable Block Index, array offset: 0x10010, array step: 0x2000 */ - __O uint32_t MBC_NSE_BLK_SET; /**< MBC NonSecure Enable Block Set, array offset: 0x10014, array step: 0x2000 */ - __O uint32_t MBC_NSE_BLK_CLR; /**< MBC NonSecure Enable Block Clear, array offset: 0x10018, array step: 0x2000 */ - __O uint32_t - MBC_NSE_BLK_CLR_ALL; /**< MBC NonSecure Enable Block Clear All, array offset: 0x1001C, array step: 0x2000 */ - __IO uint32_t MBC_MEMN_GLBAC[8]; /**< MBC Global Access Control, array offset: 0x10020, array step: index*0x2000, - index2*0x4 */ - __IO uint32_t MBC_DOM0_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x10040, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM0_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10140, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM0_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10180, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM0_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x101A0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM0_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x101A8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM0_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x101C8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM0_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x101D0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM0_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x101F0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_0[72]; - __IO uint32_t MBC_DOM1_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x10240, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM1_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10340, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM1_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10380, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM1_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x103A0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM1_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x103A8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM1_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x103C8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM1_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x103D0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM1_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x103F0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_1[72]; - __IO uint32_t MBC_DOM2_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x10440, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM2_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10540, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM2_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10580, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM2_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x105A0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM2_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x105A8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM2_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x105C8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM2_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x105D0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM2_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x105F0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_2[72]; - __IO uint32_t MBC_DOM3_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x10640, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM3_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10740, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM3_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10780, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM3_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x107A0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM3_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x107A8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM3_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x107C8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM3_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x107D0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM3_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x107F0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_3[72]; - __IO uint32_t MBC_DOM4_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x10840, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM4_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10940, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM4_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10980, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM4_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x109A0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM4_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x109A8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM4_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x109C8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM4_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x109D0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM4_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x109F0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_4[72]; - __IO uint32_t MBC_DOM5_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x10A40, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM5_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10B40, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM5_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10B80, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM5_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10BA0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM5_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10BA8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM5_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10BC8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM5_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10BD0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM5_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10BF0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_5[72]; - __IO uint32_t MBC_DOM6_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x10C40, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM6_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10D40, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM6_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10D80, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM6_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10DA0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM6_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10DA8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM6_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10DC8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM6_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10DD0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM6_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10DF0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_7[72]; - __IO uint32_t MBC_DOM7_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x10E40, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM7_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10F40, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM7_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10F80, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM7_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10FA0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM7_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10FA8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM7_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10FC8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM7_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x10FD0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM7_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x10FF0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_8[72]; - __IO uint32_t MBC_DOM8_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x11040, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM8_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11140, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM8_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11180, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM8_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x111A0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM8_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x111A8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM8_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x111C8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM8_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x111D0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM8_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x111F0, array - step: index*0x2000, index2*0x4 */ - - __IO uint32_t MBC_DOM9_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x11240, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM9_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11340, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM9_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11380, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM9_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x113A0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM9_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x113A8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM9_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x113C8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM9_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x113D0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM9_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x113F0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_9[72]; - __IO uint32_t MBC_DOM10_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x11440, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM10_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11540, - array step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM10_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11580, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM10_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x115A0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM10_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x115A8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM10_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x115C8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM10_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x115D0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM10_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x115F0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_10[72]; - __IO uint32_t MBC_DOM11_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x11640, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM11_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11740, - array step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM11_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11780, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM11_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x117A0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM11_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x117A8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM11_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x117C8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM11_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x117D0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM11_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x117F0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_11[72]; - __IO uint32_t MBC_DOM12_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x11840, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM12_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11940, - array step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM12_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11980, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM12_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x119A0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM12_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x119A8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM12_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x119C8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM12_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x119D0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM12_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x119F0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_12[72]; - __IO uint32_t MBC_DOM13_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x11A40, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM13_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11B40, - array step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM13_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11B80, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM13_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11BA0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM13_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11BA8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM13_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11BC8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM13_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11BD0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM13_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11BF0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_13[72]; - __IO uint32_t MBC_DOM14_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x11C40, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM14_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11D40, - array step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM14_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11D80, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM14_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11DA0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM14_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11DA8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM14_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11DC8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM14_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11DD0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM14_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11DF0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_14[72]; - __IO uint32_t MBC_DOM15_MEM0_BLK_CFG_W[64]; /**< MBC Memory Block Configuration Word, array offset: 0x11E40, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM15_MEM0_BLK_NSE_W[16]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11F40, - array step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM15_MEM1_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11F80, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM15_MEM1_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11FA0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM15_MEM2_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11FA8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM15_MEM2_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11FC8, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM15_MEM3_BLK_CFG_W[8]; /**< MBC Memory Block Configuration Word, array offset: 0x11FD0, array - step: index*0x2000, index2*0x4 */ - __IO uint32_t MBC_DOM15_MEM3_BLK_NSE_W[2]; /**< MBC Memory Block NonSecure Enable Word, array offset: 0x11FF0, array - step: index*0x2000, index2*0x4 */ - uint8_t RESERVED_15[8]; -} TRDC_MBC_Type; - -/*!@brief TRDC MRC control register definition. MRC_DOM0_RGD_W[region][word] */ -typedef struct _TRDC_MRC_Type -{ - __I uint32_t MRC_GLBCFG; /**< MRC Global Configuration Register, array offset: 0x14000, array step: 0x1000 */ - uint8_t RESERVED_0[12]; - __IO uint32_t - MRC_NSE_RGN_INDIRECT; /**< MRC NonSecure Enable Region Indirect, array offset: 0x14010, array step: 0x1000 */ - __O uint32_t MRC_NSE_RGN_SET; /**< MRC NonSecure Enable Region Set, array offset: 0x14014, array step: 0x1000 */ - __O uint32_t MRC_NSE_RGN_CLR; /**< MRC NonSecure Enable Region Clear, array offset: 0x14018, array step: 0x1000 */ - __O uint32_t - MRC_NSE_RGN_CLR_ALL; /**< MRC NonSecure Enable Region Clear All, array offset: 0x1401C, array step: 0x1000 */ - __IO uint32_t - MRC_GLBAC[8]; /**< MRC Global Access Control, array offset: 0x14020, array step: index*0x1000, index2*0x4 */ - __IO uint32_t MRC_DOM0_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14040, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM0_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x140C0, array step: 0x1000 */ - uint8_t RESERVED_1[124]; - __IO uint32_t MRC_DOM1_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14140, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM1_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x141C0, array step: 0x1000 */ - uint8_t RESERVED_2[124]; - __IO uint32_t MRC_DOM2_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14240, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM2_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x142C0, array step: 0x1000 */ - uint8_t RESERVED_3[124]; - __IO uint32_t MRC_DOM3_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14340, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM3_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x143C0, array step: 0x1000 */ - uint8_t RESERVED_4[124]; - __IO uint32_t MRC_DOM4_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14440, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM4_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x144C0, array step: 0x1000 */ - uint8_t RESERVED_5[124]; - __IO uint32_t MRC_DOM5_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14540, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM5_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x145C0, array step: 0x1000 */ - uint8_t RESERVED_6[124]; - __IO uint32_t MRC_DOM6_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14640, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM6_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x146C0, array step: 0x1000 */ - uint8_t RESERVED_7[124]; - __IO uint32_t MRC_DOM7_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14740, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM7_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x147C0, array step: 0x1000 */ - uint8_t RESERVED_8[124]; - __IO uint32_t MRC_DOM8_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14840, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM8_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x148C0, array step: 0x1000 */ - uint8_t RESERVED_9[124]; - __IO uint32_t MRC_DOM9_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14940, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM9_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x149C0, array step: 0x1000 */ - uint8_t RESERVED_10[124]; - __IO uint32_t MRC_DOM10_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14A40, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM10_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x14AC0, array step: 0x1000 */ - uint8_t RESERVED_11[124]; - __IO uint32_t MRC_DOM11_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14B40, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM11_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x14BC0, array step: 0x1000 */ - uint8_t RESERVED_12[124]; - __IO uint32_t MRC_DOM12_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14C40, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM12_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x14CC0, array step: 0x1000 */ - uint8_t RESERVED_13[124]; - __IO uint32_t MRC_DOM13_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14D40, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM13_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x14DC0, array step: 0x1000 */ - uint8_t RESERVED_14[124]; - __IO uint32_t MRC_DOM14_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14E40, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM14_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x14EC0, array step: 0x1000 */ - uint8_t RESERVED_15[124]; - __IO uint32_t MRC_DOM15_RGD_W[16][2]; /**< MRC Region Descriptor Word 0..MRC Region Descriptor Word 1, array offset: - 0x14F40, array step: index*0x1000, index2*0x8, index3*0x4 */ - __IO uint32_t - MRC_DOM15_RGD_NSE; /**< MRC Region Descriptor NonSecure Enable, array offset: 0x14FC0, array step: 0x1000 */ -} TRDC_MRC_Type; - -/*!@brief TRDC base address convert macro */ -#define TRDC_GENERAL_BASE(base) ((TRDC_General_Type *)((base))) -#define TRDC_FLW_BASE(base) ((TRDC_FLW_Type *)(((uint32_t)(uintptr_t)(base) + (uint32_t)TRDC_FLW_OFFSET))) -#define TRDC_DOMAIN_ERROR_BASE(base) ((TRDC_DomainError_Type *)(((uint32_t)(uintptr_t)(base) + (uint32_t)TRDC_DOMAIN_ERROR_OFFSET))) -#define TRDC_DOMAIN_ASSIGNMENT_BASE(base) \ - ((TRDC_DomainAssignment_Type *)(((uint32_t)(uintptr_t)(base) + (uint32_t)TRDC_DOMAIN_ASSIGNMENT_OFFSET))) -#define TRDC_MBC_BASE(base, instance) \ - ((TRDC_MBC_Type *)((uint32_t)(uintptr_t)(base) + (uint32_t)TRDC_MBC_OFFSET(base) + (instance) * (uint32_t)TRDC_MBC_ARRAY_STEP)) -#define TRDC_MRC_BASE(base, instance) \ - ((TRDC_MRC_Type *)((uint32_t)(uintptr_t)(base) + (uint32_t)TRDC_MRC_OFFSET(base) + (instance) * (uint32_t)TRDC_MRC_ARRAY_STEP)) - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif - -/*! - * @} - */ - -#endif /* FSL_TRDC_CORE_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_trdc_soc.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_trdc_soc.h deleted file mode 100644 index 8c061083535..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_trdc_soc.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2023 NXP - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef _FSL_TRDC_SOC_H_ -#define _FSL_TRDC_SOC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup trdc_soc - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - /* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.trdc_soc" -#endif - -/*! @name Driver version */ -/*@{*/ -/*! @brief Driver version 2.0.0. */ -#define FSL_TRDC_SOC_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) -/*@}*/ - -/*!@brief TRDC base table */ -#define TRDC_BASE_PTRS \ - { \ - TRDC \ - } -/* @} */ - -#define TRDC_MBC_MEM_GLBCFG_NBLKS_MASK TRDC_MBC_INDEX_MBC_MEM_GLBCFG_NBLKS_MASK -#define TRDC_MBC_MEM_GLBCFG_SIZE_LOG2_MASK TRDC_MBC_INDEX_MBC_MEM_GLBCFG_SIZE_LOG2_MASK -#define TRDC_MBC_MEM_GLBCFG_SIZE_LOG2_SHIFT TRDC_MBC_INDEX_MBC_MEM_GLBCFG_SIZE_LOG2_SHIFT -#define TRDC_MBC_NSE_BLK_CLR_ALL_MEMSEL TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_MEMSEL -#define TRDC_MBC_NSE_BLK_CLR_ALL_DID_SEL TRDC_MBC_INDEX_MBC_NSE_BLK_CLR_ALL_DID_SEL0 - -/*!@brief TRDC feature */ -#define FSL_FEATURE_TRDC_DOMAIN_COUNT 1 - -/*!@brief TRDC base address convert macro */ -#define TRDC_MBC_COUNT 1 -#define TRDC_MBC_OFFSET(x) 0x0 -#define TRDC_MBC_ARRAY_STEP 0U - -/******************************************************************************* - * API - ******************************************************************************/ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif - -/*! - * @} - */ - -#endif /* _FSL_TRDC_SOC_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_tsi_v6.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_tsi_v6.c deleted file mode 100644 index ab1a2a4ec35..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_tsi_v6.c +++ /dev/null @@ -1,447 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#include "fsl_tsi_v6.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.tsi_v6" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ -/* Array of TSI clock name. */ -const clock_ip_name_t s_tsiClock[] = TSI_CLOCKS; -/* Array of TSI peripheral base address. */ -TSI_Type *const s_tsiBases[] = TSI_BASE_PTRS; -/******************************************************************************* - * Code - ******************************************************************************/ -/*! - * brief Get the TSI instance from peripheral base address. - * - * param base TSI peripheral base address. - * return TSI instance. - */ -uint32_t TSI_GetInstance(TSI_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0U; instance < ARRAY_SIZE(s_tsiBases); instance++) - { - if (s_tsiBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_tsiBases)); - - return instance; -} - -/*! - * brief Initialize hardware to Self-cap mode. - * - * details Initialize the peripheral to the targeted state specified by parameter config, - * such as sets sensitivity adjustment, current settings. - * param base TSI peripheral base address. - * param config Pointer to TSI self-cap configuration structure. - * return none - */ -void TSI_InitSelfCapMode(TSI_Type *base, const tsi_selfCap_config_t *config) -{ - uint32_t temp = 0U; - assert(config != NULL); - - bool is_module_enabled = false; - bool is_int_enabled = false; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - uint32_t instance = TSI_GetInstance(base); - - /* Enable tsi clock */ - (void)CLOCK_EnableClock(s_tsiClock[instance]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - if ((bool)(base->GENCS & TSI_GENCS_TSIEN_MASK)) - { - is_module_enabled = true; - TSI_EnableModule(base, false); - } - - /* common settings */ - temp = (base->CONFIG) & ~(TSI_CONFIG_MUTUAL_MODE_MASK | TSI_CONFIG_S_SEN_MASK); - base->CONFIG = - temp | (TSI_CONFIG_MUTUAL_MODE(config->commonConfig.mode) | TSI_CONFIG_S_SEN(config->enableSensitivity)); - - temp = (base->GENCS) & ~(TSI_GENCS_SETCLK_MASK); - base->GENCS = temp | (TSI_GENCS_SETCLK(config->commonConfig.mainClock)); - - temp = (base->SHIELD) & ~(TSI_SHIELD_SHIELD_ENABLE_MASK); - base->SHIELD = temp | (TSI_SHIELD_SHIELD_ENABLE(config->enableShield)); - - base->DATA = base->DATA & ~(ALL_FLAGS_MASK); - base->GENCS = (base->GENCS & (~(TSI_GENCS_DVOLT_MASK))) | TSI_GENCS_DVOLT(config->commonConfig.dvolt); - temp = (base->SINC) & ~(TSI_SINC_CUTOFF_MASK | TSI_SINC_ORDER_MASK | TSI_SINC_DECIMATION_MASK); - base->SINC = temp | (TSI_SINC_CUTOFF(config->commonConfig.cutoff) | TSI_SINC_ORDER(config->commonConfig.order) | - TSI_SINC_DECIMATION(config->commonConfig.decimation)); - - temp = (base->SSC0) & ~(TSI_SSC0_CHARGE_NUM_MASK | TSI_SSC0_BASE_NOCHARGE_NUM_MASK | TSI_SSC0_PRBS_OUTSEL_MASK | - TSI_SSC0_SSC_PRESCALE_NUM_MASK | TSI_SSC0_SSC_MODE_MASK); - base->SSC0 = - temp | (TSI_SSC0_PRBS_OUTSEL(config->commonConfig.prbsOutsel) | - TSI_SSC0_SSC_MODE(config->commonConfig.ssc_mode) | TSI_SSC0_CHARGE_NUM(config->commonConfig.chargeNum) | - TSI_SSC0_BASE_NOCHARGE_NUM(config->commonConfig.noChargeNum) | - TSI_SSC0_SSC_PRESCALE_NUM(config->commonConfig.ssc_prescaler)); - - /* Self-cap mode specific settings */ - temp = (base->CONFIG) & - ~(TSI_CONFIG_S_XDN_MASK | TSI_CONFIG_S_CTRIM_MASK | TSI_CONFIG_S_XIN_MASK | TSI_CONFIG_S_XCH_MASK); - base->CONFIG = temp | (TSI_CONFIG_S_XDN(config->xdn) | TSI_CONFIG_S_CTRIM(config->ctrim) | - TSI_CONFIG_S_XIN(config->inputCurrent) | TSI_CONFIG_S_XCH(config->chargeCurrent)); - - if (is_module_enabled) - { - TSI_EnableModule(base, true); - } - if (is_int_enabled) - { - TSI_EnableInterrupts(base, (uint32_t)kTSI_GlobalInterruptEnable); - } -} - -/*! - * brief Initialize hardware to Mutual-cap mode. - * - * details Initialize the peripheral to the targeted state specified by parameter config, - * such as sets Vref generator setting, sensitivity boost settings, Pmos/Nmos settings. - * param base TSI peripheral base address. - * param config Pointer to TSI mutual-cap configuration structure. - * return none - */ -void TSI_InitMutualCapMode(TSI_Type *base, const tsi_mutualCap_config_t *config) -{ - uint32_t temp = 0U; - assert(config != NULL); - - bool is_module_enabled = false; - bool is_int_enabled = false; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - uint32_t instance = TSI_GetInstance(base); - - /* Enable tsi clock */ - (void)CLOCK_EnableClock(s_tsiClock[instance]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - if ((bool)(base->GENCS & TSI_GENCS_TSIEN_MASK)) - { - is_module_enabled = true; - TSI_EnableModule(base, false); - } - - temp = (base->CONFIG_MUTUAL) & ~(TSI_CONFIG_MUTUAL_MODE_MASK); - base->CONFIG_MUTUAL = temp | (TSI_CONFIG_MUTUAL_MODE(config->commonConfig.mode)); - - temp = (base->GENCS) & ~(TSI_GENCS_SETCLK_MASK); - base->GENCS = temp | (TSI_GENCS_SETCLK(config->commonConfig.mainClock)); - - base->DATA = base->DATA & ~(ALL_FLAGS_MASK); - base->GENCS = (base->GENCS & (~(TSI_GENCS_DVOLT_MASK))) | TSI_GENCS_DVOLT(config->commonConfig.dvolt); - - temp = (base->SINC) & ~(TSI_SINC_CUTOFF_MASK | TSI_SINC_ORDER_MASK | TSI_SINC_DECIMATION_MASK); - base->SINC = temp | (TSI_SINC_CUTOFF(config->commonConfig.cutoff) | TSI_SINC_ORDER(config->commonConfig.order) | - TSI_SINC_DECIMATION(config->commonConfig.decimation)); - - temp = (base->SSC0) & ~(TSI_SSC0_CHARGE_NUM_MASK | TSI_SSC0_BASE_NOCHARGE_NUM_MASK | TSI_SSC0_PRBS_OUTSEL_MASK | - TSI_SSC0_SSC_PRESCALE_NUM_MASK | TSI_SSC0_SSC_MODE_MASK); - base->SSC0 = - temp | (TSI_SSC0_PRBS_OUTSEL(config->commonConfig.prbsOutsel) | - TSI_SSC0_SSC_MODE(config->commonConfig.ssc_mode) | TSI_SSC0_CHARGE_NUM(config->commonConfig.chargeNum) | - TSI_SSC0_BASE_NOCHARGE_NUM(config->commonConfig.noChargeNum) | - TSI_SSC0_SSC_PRESCALE_NUM(config->commonConfig.ssc_prescaler)); - - temp = (base->CONFIG_MUTUAL) & ~(TSI_CONFIG_MUTUAL_M_PRE_RES_MASK | TSI_CONFIG_MUTUAL_M_PRE_CURRENT_MASK | - TSI_CONFIG_MUTUAL_M_SEN_BOOST_MASK | TSI_CONFIG_MUTUAL_M_PMIRRORL_MASK | - TSI_CONFIG_MUTUAL_M_PMIRRORR_MASK | TSI_CONFIG_MUTUAL_M_NMIRROR_MASK); - base->CONFIG_MUTUAL = - temp | - (TSI_CONFIG_MUTUAL_M_PRE_RES(config->preResistor) | TSI_CONFIG_MUTUAL_M_PRE_CURRENT(config->preCurrent) | - TSI_CONFIG_MUTUAL_M_SEN_BOOST(config->boostCurrent) | TSI_CONFIG_MUTUAL_M_PMIRRORL(config->pmosLeftCurrent) | - TSI_CONFIG_MUTUAL_M_PMIRRORR(config->pmosRightCurrent) | TSI_CONFIG_MUTUAL_M_NMIRROR(config->nmosCurrent)); - - temp = (base->SHIELD) & ~(TSI_SHIELD_M_SEN_RES_MASK); - base->SHIELD = temp | (TSI_SHIELD_M_SEN_RES(config->senseResistor)); - - temp = (base->MUL) & ~(TSI_MUL_M_MODE_MASK); - base->MUL = temp | (TSI_MUL_M_MODE(config->txDriveMode)); - - if (is_module_enabled) - { - TSI_EnableModule(base, true); - } - if (is_int_enabled) - { - TSI_EnableInterrupts(base, (uint32_t)kTSI_EndOfScanInterruptEnable); - } -} - -/*! - * brief De-initialize hardware. - * - * details De-initialize the peripheral to default state. - * - * param base TSI peripheral base address. - * return none - */ -void TSI_Deinit(TSI_Type *base) -{ - base->GENCS = 0U; - base->DATA = 0U; - base->TSHD = 0U; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - uint32_t instance = TSI_GetInstance(base); - - /* Disable tsi clock */ - (void)CLOCK_DisableClock(s_tsiClock[instance]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Get TSI self-cap mode user configure structure. - * This interface sets userConfig structure to a default value. The configuration structure only - * includes the settings for the whole TSI. - * The user configure is set to a value: - * code - userConfig->commonConfig.mainClock = kTSI_MainClockSlection_0; - userConfig->commonConfig.mode = kTSI_SensingModeSlection_Self; - userConfig->commonConfig.dvolt = kTSI_DvoltOption_2; - userConfig->commonConfig.cutoff = kTSI_SincCutoffDiv_1; - userConfig->commonConfig.order = kTSI_SincFilterOrder_1; - userConfig->commonConfig.decimation = kTSI_SincDecimationValue_8; - userConfig->commonConfig.chargeNum = kTSI_SscChargeNumValue_3; - userConfig->commonConfig.prbsOutsel = kTSI_SscPrbsOutsel_2; - userConfig->commonConfig.noChargeNum = kTSI_SscNoChargeNumValue_2; - userConfig->commonConfig.ssc_mode = kTSI_ssc_prbs_method; - userConfig->commonConfig.ssc_prescaler = kTSI_ssc_div_by_1; - userConfig->enableSensitivity = true; - userConfig->enableShield = false; - userConfig->xdn = kTSI_SensitivityXdnOption_1; - userConfig->ctrim = kTSI_SensitivityCtrimOption_7; - userConfig->inputCurrent = kTSI_CurrentMultipleInputValue_0; - userConfig->chargeCurrent = kTSI_CurrentMultipleChargeValue_1; - endcode - * - * param userConfig Pointer to TSI user configure structure. - */ -void TSI_GetSelfCapModeDefaultConfig(tsi_selfCap_config_t *userConfig) -{ - /* Initializes the configure structure to zero. */ - (void)memset(userConfig, 0, sizeof(*userConfig)); - - userConfig->commonConfig.mainClock = kTSI_MainClockSlection_0; - userConfig->commonConfig.mode = kTSI_SensingModeSlection_Self; - userConfig->commonConfig.dvolt = kTSI_DvoltOption_2; - userConfig->commonConfig.cutoff = kTSI_SincCutoffDiv_1; - userConfig->commonConfig.order = kTSI_SincFilterOrder_1; - userConfig->commonConfig.decimation = kTSI_SincDecimationValue_8; - userConfig->commonConfig.chargeNum = kTSI_SscChargeNumValue_3; - userConfig->commonConfig.prbsOutsel = kTSI_SscPrbsOutsel_2; - userConfig->commonConfig.noChargeNum = kTSI_SscNoChargeNumValue_2; - userConfig->commonConfig.ssc_mode = kTSI_ssc_prbs_method; - userConfig->commonConfig.ssc_prescaler = kTSI_ssc_div_by_1; - userConfig->enableSensitivity = true; - userConfig->enableShield = kTSI_shieldAllOff; - userConfig->xdn = kTSI_SensitivityXdnOption_1; - userConfig->ctrim = kTSI_SensitivityCtrimOption_7; - userConfig->inputCurrent = kTSI_CurrentMultipleInputValue_0; - userConfig->chargeCurrent = kTSI_CurrentMultipleChargeValue_1; -} - -/*! - * brief Get TSI mutual-cap mode default user configure structure. - * This interface sets userConfig structure to a default value. The configuration structure only - * includes the settings for the whole TSI. - * The user configure is set to a value: - * code - userConfig->commonConfig.mainClock = kTSI_MainClockSlection_1; - userConfig->commonConfig.mode = kTSI_SensingModeSlection_Mutual; - userConfig->commonConfig.dvolt = kTSI_DvoltOption_0; - userConfig->commonConfig.cutoff = kTSI_SincCutoffDiv_1; - userConfig->commonConfig.order = kTSI_SincFilterOrder_1; - userConfig->commonConfig.decimation = kTSI_SincDecimationValue_8; - userConfig->commonConfig.chargeNum = kTSI_SscChargeNumValue_4; - userConfig->commonConfig.prbsOutsel = kTSI_SscPrbsOutsel_2; - userConfig->commonConfig.noChargeNum = kTSI_SscNoChargeNumValue_5; - userConfig->commonConfig.ssc_mode = kTSI_ssc_prbs_method; - userConfig->commonConfig.ssc_prescaler = kTSI_ssc_div_by_1; - userConfig->preCurrent = kTSI_MutualPreCurrent_4uA; - userConfig->preResistor = kTSI_MutualPreResistor_4k; - userConfig->senseResistor = kTSI_MutualSenseResistor_10k; - userConfig->boostCurrent = kTSI_MutualSenseBoostCurrent_0uA; - userConfig->txDriveMode = kTSI_MutualTxDriveModeOption_0; - userConfig->pmosLeftCurrent = kTSI_MutualPmosCurrentMirrorLeft_32; - userConfig->pmosRightCurrent = kTSI_MutualPmosCurrentMirrorRight_1; - userConfig->enableNmosMirror = true; - userConfig->nmosCurrent = kTSI_MutualNmosCurrentMirror_1; - endcode - * - * param userConfig Pointer to TSI user configure structure. - */ -void TSI_GetMutualCapModeDefaultConfig(tsi_mutualCap_config_t *userConfig) -{ - /* Initializes the configure structure to zero. */ - (void)memset(userConfig, 0, sizeof(*userConfig)); - - userConfig->commonConfig.mainClock = kTSI_MainClockSlection_1; - userConfig->commonConfig.mode = kTSI_SensingModeSlection_Mutual; - userConfig->commonConfig.dvolt = kTSI_DvoltOption_0; - userConfig->commonConfig.cutoff = kTSI_SincCutoffDiv_1; - userConfig->commonConfig.order = kTSI_SincFilterOrder_1; - userConfig->commonConfig.decimation = kTSI_SincDecimationValue_8; - userConfig->commonConfig.chargeNum = kTSI_SscChargeNumValue_4; - userConfig->commonConfig.prbsOutsel = kTSI_SscPrbsOutsel_2; - userConfig->commonConfig.noChargeNum = kTSI_SscNoChargeNumValue_5; - userConfig->commonConfig.ssc_mode = kTSI_ssc_prbs_method; - userConfig->commonConfig.ssc_prescaler = kTSI_ssc_div_by_1; - userConfig->preCurrent = kTSI_MutualPreCurrent_4uA; - userConfig->preResistor = kTSI_MutualPreResistor_4k; - userConfig->senseResistor = kTSI_MutualSenseResistor_10k; - userConfig->boostCurrent = kTSI_MutualSenseBoostCurrent_0uA; - userConfig->txDriveMode = kTSI_MutualTxDriveModeOption_0; - userConfig->pmosLeftCurrent = kTSI_MutualPmosCurrentMirrorLeft_32; - userConfig->pmosRightCurrent = kTSI_MutualPmosCurrentMirrorRight_1; - userConfig->enableNmosMirror = true; - userConfig->nmosCurrent = kTSI_MutualNmosCurrentMirror_1; -} - -/*! - * brief Hardware base counter value for calibration. - * - * details Calibrate the peripheral to fetch the initial counter value of - * the enabled channels. - * This API is mostly used at initial application setup, it shall be called - * after the \ref TSI_Init API, then user can use the calibrated - * counter values to setup applications(such as to determine - * under which counter value we can confirm a touch event occurs). - * - * param base TSI peripheral base address. - * param calBuff Data buffer that store the calibrated counter value. - * return none - * note This API is mainly used for self-cap mode; - * note The calibration work in mutual-cap mode shall be done in applications due to different board layout. - * - */ -void TSI_SelfCapCalibrate(TSI_Type *base, tsi_calibration_data_t *calBuff) -{ - assert(calBuff != NULL); - - uint8_t i = 0U; - bool is_int_enabled = false; - /* Enable software trigger scan */ - TSI_EnableHardwareTriggerScan(base, false); - - if ((bool)(base->GENCS & TSI_GENCS_ESOR_MASK)) - { - is_int_enabled = true; - TSI_DisableInterrupts(base, (uint32_t)kTSI_EndOfScanInterruptEnable); - } - for (i = 0U; i < (uint8_t)FSL_FEATURE_TSI_CHANNEL_COUNT; i++) - { - TSI_SetSelfCapMeasuredChannel(base, i); - TSI_StartSoftwareTrigger(base); - while (!(bool)((TSI_GetStatusFlags(base) & (uint32_t)kTSI_EndOfScanFlag))) - { - } - calBuff->calibratedData[i] = TSI_GetCounter(base); - TSI_ClearStatusFlags(base, (uint32_t)kTSI_EndOfScanFlag); - } - if (is_int_enabled) - { - TSI_EnableInterrupts(base, (uint32_t)kTSI_EndOfScanInterruptEnable); - } -} - -/*! - * brief Enables TSI interrupt requests. - * param base TSI peripheral base address. - * param mask interrupt source - * The parameter can be combination of the following source if defined: - * arg kTSI_GlobalInterruptEnable - * arg kTSI_EndOfScanInterruptEnable - * arg kTSI_OutOfRangeInterruptEnable - */ -void TSI_EnableInterrupts(TSI_Type *base, uint32_t mask) -{ - uint32_t regValue = base->GENCS; - - if ((bool)(mask & (uint32_t)kTSI_OutOfRangeInterruptEnable)) - { - regValue |= TSI_GENCS_OUTRG_EN_MASK; - } - if ((bool)(mask & (uint32_t)kTSI_EndOfScanInterruptEnable)) - { - regValue |= TSI_GENCS_ESOR_MASK; - } - base->DATA &= ~(ALL_FLAGS_MASK); - base->GENCS = regValue; /* write value to register */ -} - -/*! - * brief Disables TSI interrupt requests. - * param base TSI peripheral base address. - * param mask interrupt source - * The parameter can be combination of the following source if defined: - * arg kTSI_GlobalInterruptEnable - * arg kTSI_EndOfScanInterruptEnable - * arg kTSI_OutOfRangeInterruptEnable - */ -void TSI_DisableInterrupts(TSI_Type *base, uint32_t mask) -{ - uint32_t regValue = base->GENCS; - - base->DATA &= ~(ALL_FLAGS_MASK); - if ((bool)(mask & (uint32_t)kTSI_OutOfRangeInterruptEnable)) - { - regValue &= (~TSI_GENCS_OUTRG_EN_MASK); - } - if ((bool)(mask & (uint32_t)kTSI_EndOfScanInterruptEnable)) - { - regValue &= (~TSI_GENCS_ESOR_MASK); - } - - base->GENCS = regValue; /* write value to register */ -} - -/*! - * brief Clear interrupt flag. - * - * This function clear tsi interrupt flag, - * automatically cleared flags can not be cleared by this function. - * - * param base TSI peripheral base address. - * param mask The status flags to clear. - */ -void TSI_ClearStatusFlags(TSI_Type *base, uint32_t mask) -{ - uint32_t regValue = base->DATA & (~ALL_FLAGS_MASK); - - if ((bool)(mask & (uint32_t)kTSI_EndOfScanFlag)) - { - regValue |= TSI_DATA_EOSF_MASK; - } - if ((bool)(mask & (uint32_t)kTSI_OutOfRangeFlag)) - { - regValue |= TSI_DATA_OUTRGF_MASK; - } - base->DATA = regValue; /* write value to register */ -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_tsi_v6.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_tsi_v6.h deleted file mode 100644 index c6fc98772fd..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_tsi_v6.h +++ /dev/null @@ -1,1115 +0,0 @@ -/* - * Copyright 2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_TSI_V6_H_ -#define FSL_TSI_V6_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup tsi_v6_driver - * @{ - */ -/******************************************************************************* - * Variables - ******************************************************************************/ -/* Array of TSI clock name. */ -extern const clock_ip_name_t s_tsiClock[]; -/* Array of TSI peripheral base address. */ -extern TSI_Type *const s_tsiBases[]; -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @brief TSI driver version */ -#define FSL_TSI_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) - -/*! @brief TSI status flags macro collection */ -#define ALL_FLAGS_MASK (TSI_DATA_EOSF_MASK | TSI_DATA_OUTRGF_MASK) - -/*! - * @brief TSI main clock selection. - * - * These constants set the tsi main clock. - */ -typedef enum _tsi_main_clock_selection -{ - kTSI_MainClockSlection_0 = 0U, /*!< Set TSI main clock frequency to 20.72MHz */ - kTSI_MainClockSlection_1 = 1U, /*!< Set TSI main clock frequency to 16.65MHz */ - kTSI_MainClockSlection_2 = 2U, /*!< Set TSI main clock frequency to 13.87MHz */ - kTSI_MainClockSlection_3 = 3U, /*!< Set TSI main clock frequency to 11.91MHz */ -} tsi_main_clock_selection_t; - -/*! - * @brief TSI sensing mode selection. - * - * These constants set the tsi sensing mode. - */ -typedef enum _tsi_sensing_mode_selection -{ - kTSI_SensingModeSlection_Self = 0U, /*!< Set TSI sensing mode to self-cap mode */ - kTSI_SensingModeSlection_Mutual = 1U, /*!< Set TSI sensing mode to mutual-cap mode */ -} tsi_sensing_mode_selection_t; - -/*! - * @brief TSI DVOLT settings - * - * These bits indicate the comparator vp, vm and dvolt voltage. - */ -typedef enum _tsi_dvolt_option -{ - kTSI_DvoltOption_0 = 0U, /*!< DVOLT value option 0, the value may differ on different platforms */ - kTSI_DvoltOption_1 = 1U, /*!< DVOLT value option 1, the value may differ on different platforms */ - kTSI_DvoltOption_2 = 2U, /*!< DVOLT value option 2, the value may differ on different platforms */ - kTSI_DvoltOption_3 = 3U, /*!< DVOLT value option 3, the value may differ on different platforms */ - kTSI_DvoltOption_4 = 4U, /*!< DVOLT value option 4, the value may differ on different platforms */ - kTSI_DvoltOption_5 = 5U /*!< DVOLT value option 5, the value may differ on different platforms */ -} tsi_dvolt_option_t; - -/*! - * @brief TSI sensitivity ajustment (XDN option). - * - * These constants define the tsi sensitivity ajustment in self-cap mode, when TSI_MODE[S_SEN] = 1. - */ -typedef enum _tsi_sensitivity_xdn_option -{ - kTSI_SensitivityXdnOption_0 = 0U, /*!< Adjust sensitivity in self-cap mode, 1/16 */ - kTSI_SensitivityXdnOption_1 = 1U, /*!< Adjust sensitivity in self-cap mode, 1/8 */ - kTSI_SensitivityXdnOption_2 = 2U, /*!< Adjust sensitivity in self-cap mode, 1/4 */ - kTSI_SensitivityXdnOption_3 = 3U, /*!< Adjust sensitivity in self-cap mode, 1/2 */ - kTSI_SensitivityXdnOption_4 = 4U, /*!< Adjust sensitivity in self-cap mode, 1/1 */ - kTSI_SensitivityXdnOption_5 = 5U, /*!< Adjust sensitivity in self-cap mode, 2/1 */ - kTSI_SensitivityXdnOption_6 = 6U, /*!< Adjust sensitivity in self-cap mode, 4/1 */ - kTSI_SensitivityXdnOption_7 = 7U, /*!< Adjust sensitivity in self-cap mode, 8/1 */ -} tsi_sensitivity_xdn_option_t; - -/*! - * @brief TSI Shield setting (S_W_SHIELD option). - * - * These constants define the shield pin used for HW shielding functionality. One or more shield pin can be selected. - * The involved bitfield is not fix can change from device to device (KE16Z7 and KE17Z7 support 3 shield pins, other KE - * serials only support 1 shield pin). - */ -typedef enum _tsi_shield -{ - kTSI_shieldAllOff = 0U, /*!< No pin used */ - kTSI_shield0On = 1U, /*!< Shield 0 pin used */ - kTSI_shield1On = 2U, /*!< Shield 1 pin used */ - kTSI_shield1and0On = 3U, /*!< Shield 0,1 pins used */ - kTSI_shield2On = 4U, /*!< Shield 2 pin used */ - kTSI_shield2and0On = 5U, /*!< Shield 2,0 pins used */ - kTSI_shield2and1On = 6U, /*!< Shield 2,1 pins used */ - kTSI_shieldAllOn = 7U, /*!< Shield 2,1,0 pins used */ -} tsi_shield_t; - -/*! - * @brief TSI sensitivity ajustment (CTRIM option). - * - * These constants define the tsi sensitivity ajustment in self-cap mode, when TSI_MODE[S_SEN] = 1. - */ -typedef enum _tsi_sensitivity_ctrim_option -{ - kTSI_SensitivityCtrimOption_0 = 0U, /*!< Adjust sensitivity in self-cap mode, 2.5p */ - kTSI_SensitivityCtrimOption_1 = 1U, /*!< Adjust sensitivity in self-cap mode, 5.0p */ - kTSI_SensitivityCtrimOption_2 = 2U, /*!< Adjust sensitivity in self-cap mode, 7.5p */ - kTSI_SensitivityCtrimOption_3 = 3U, /*!< Adjust sensitivity in self-cap mode, 10.0p */ - kTSI_SensitivityCtrimOption_4 = 4U, /*!< Adjust sensitivity in self-cap mode, 12.5p */ - kTSI_SensitivityCtrimOption_5 = 5U, /*!< Adjust sensitivity in self-cap mode, 15.0p */ - kTSI_SensitivityCtrimOption_6 = 6U, /*!< Adjust sensitivity in self-cap mode, 17.5p */ - kTSI_SensitivityCtrimOption_7 = 7U, /*!< Adjust sensitivity in self-cap mode, 20.0p */ -} tsi_sensitivity_ctrim_option_t; - -/*! - * @brief TSI current ajustment (Input current multiple). - * - * These constants set the tsi input current multiple in self-cap mode. - */ -typedef enum _tsi_current_multiple_input -{ - kTSI_CurrentMultipleInputValue_0 = 0U, /*!< Adjust input current multiple in self-cap mode, 1/8 */ - kTSI_CurrentMultipleInputValue_1 = 1U, /*!< Adjust input current multiple in self-cap mode, 1/4 */ -} tsi_current_multiple_input_t; - -/*! - * @brief TSI current ajustment (Charge/Discharge current multiple). - * - * These constants set the tsi charge/discharge current multiple in self-cap mode. - */ -typedef enum _tsi_current_multiple_charge -{ - kTSI_CurrentMultipleChargeValue_0 = 0U, /*!< Adjust charge/discharge current multiple in self-cap mode, 1/16 */ - kTSI_CurrentMultipleChargeValue_1 = 1U, /*!< Adjust charge/discharge current multiple in self-cap mode, 1/8 */ - kTSI_CurrentMultipleChargeValue_2 = 2U, /*!< Adjust charge/discharge current multiple in self-cap mode, 1/4 */ - kTSI_CurrentMultipleChargeValue_3 = 3U, /*!< Adjust charge/discharge current multiple in self-cap mode, 1/2 */ - kTSI_CurrentMultipleChargeValue_4 = 4U, /*!< Adjust charge/discharge current multiple in self-cap mode, 1/1 */ - kTSI_CurrentMultipleChargeValue_5 = 5U, /*!< Adjust charge/discharge current multiple in self-cap mode, 2/1 */ - kTSI_CurrentMultipleChargeValue_6 = 6U, /*!< Adjust charge/discharge current multiple in self-cap mode, 4/1 */ - kTSI_CurrentMultipleChargeValue_7 = 7U, /*!< Adjust charge/discharge current multiple in self-cap mode, 8/1 */ -} tsi_current_multiple_charge_t; - -/*! - * @brief TSI current used in vref generator - * - * These constants Choose the current used in vref generator. - */ -typedef enum _tsi_mutual_pre_current -{ - kTSI_MutualPreCurrent_1uA = 0U, /*!< Vref generator current is 1uA, used in mutual-cap mode */ - kTSI_MutualPreCurrent_2uA = 1U, /*!< Vref generator current is 2uA, used in mutual-cap mode */ - kTSI_MutualPreCurrent_3uA = 2U, /*!< Vref generator current is 3uA, used in mutual-cap mode */ - kTSI_MutualPreCurrent_4uA = 3U, /*!< Vref generator current is 4uA, used in mutual-cap mode */ - kTSI_MutualPreCurrent_5uA = 4U, /*!< Vref generator current is 5uA, used in mutual-cap mode */ - kTSI_MutualPreCurrent_6uA = 5U, /*!< Vref generator current is 6uA, used in mutual-cap mode */ - kTSI_MutualPreCurrent_7uA = 6U, /*!< Vref generator current is 7uA, used in mutual-cap mode */ - kTSI_MutualPreCurrent_8uA = 7U /*!< Vref generator current is 8uA, used in mutual-cap mode */ -} tsi_mutual_pre_current_t; - -/*! - * @brief TSI resistor used in pre-charge - * - * These constants Choose the resistor used in pre-charge. - */ -typedef enum _tsi_mutual_pre_resistor -{ - kTSI_MutualPreResistor_1k = 0U, /*!< Vref generator resistor is 1k, used in mutual-cap mode */ - kTSI_MutualPreResistor_2k = 1U, /*!< Vref generator resistor is 2k, used in mutual-cap mode */ - kTSI_MutualPreResistor_3k = 2U, /*!< Vref generator resistor is 3k, used in mutual-cap mode */ - kTSI_MutualPreResistor_4k = 3U, /*!< Vref generator resistor is 4k, used in mutual-cap mode */ - kTSI_MutualPreResistor_5k = 4U, /*!< Vref generator resistor is 5k, used in mutual-cap mode */ - kTSI_MutualPreResistor_6k = 5U, /*!< Vref generator resistor is 6k, used in mutual-cap mode */ - kTSI_MutualPreResistor_7k = 6U, /*!< Vref generator resistor is 7k, used in mutual-cap mode */ - kTSI_MutualPreResistor_8k = 7U /*!< Vref generator resistor is 8k, used in mutual-cap mode */ -} tsi_mutual_pre_resistor_t; - -/*! - * @brief TSI resistor used in I-sense generator - * - * These constants Choose the resistor used in I-sense generator. - */ -typedef enum _tsi_mutual_sense_resistor -{ - kTSI_MutualSenseResistor_2k5 = 0U, /*!< I-sense resistor is 2.5k , used in mutual-cap mode */ - kTSI_MutualSenseResistor_5k = 1U, /*!< I-sense resistor is 5.0k , used in mutual-cap mode */ - kTSI_MutualSenseResistor_7k5 = 2U, /*!< I-sense resistor is 7.5k , used in mutual-cap mode */ - kTSI_MutualSenseResistor_10k = 3U, /*!< I-sense resistor is 10.0k, used in mutual-cap mode */ - kTSI_MutualSenseResistor_12k5 = 4U, /*!< I-sense resistor is 12.5k, used in mutual-cap mode */ - kTSI_MutualSenseResistor_15k = 5U, /*!< I-sense resistor is 15.0k, used in mutual-cap mode */ - kTSI_MutualSenseResistor_17k5 = 6U, /*!< I-sense resistor is 17.5k, used in mutual-cap mode */ - kTSI_MutualSenseResistor_20k = 7U, /*!< I-sense resistor is 20.0k, used in mutual-cap mode */ - kTSI_MutualSenseResistor_22k5 = 8U, /*!< I-sense resistor is 22.5k, used in mutual-cap mode */ - kTSI_MutualSenseResistor_25k = 9U, /*!< I-sense resistor is 25.0k, used in mutual-cap mode */ - kTSI_MutualSenseResistor_27k5 = 10U, /*!< I-sense resistor is 27.5k, used in mutual-cap mode */ - kTSI_MutualSenseResistor_30k = 11U, /*!< I-sense resistor is 30.0k, used in mutual-cap mode */ - kTSI_MutualSenseResistor_32k5 = 12U, /*!< I-sense resistor is 32.5k, used in mutual-cap mode */ - kTSI_MutualSenseResistor_35k = 13U, /*!< I-sense resistor is 35.0k, used in mutual-cap mode */ - kTSI_MutualSenseResistor_37k5 = 14U, /*!< I-sense resistor is 37.5k, used in mutual-cap mode */ - kTSI_MutualSenseResistor_40k = 15U /*!< I-sense resistor is 40.0k, used in mutual-cap mode */ -} tsi_mutual_sense_resistor_t; - -/*! - * @brief TSI TX channel selection in mutual-cap mode - * - * These constants Choose the TX channel used in mutual-cap mode. - */ -typedef enum _tsi_mutual_tx_channel -{ - kTSI_MutualTxChannel_0 = 0U, /*!< Select channel 0 as tx0, used in mutual-cap mode */ - kTSI_MutualTxChannel_1 = 1U, /*!< Select channel 1 as tx1, used in mutual-cap mode */ - kTSI_MutualTxChannel_2 = 2U, /*!< Select channel 2 as tx2, used in mutual-cap mode */ - kTSI_MutualTxChannel_3 = 3U, /*!< Select channel 3 as tx3, used in mutual-cap mode */ - kTSI_MutualTxChannel_4 = 4U, /*!< Select channel 4 as tx4, used in mutual-cap mode */ - kTSI_MutualTxChannel_5 = 5U, /*!< Select channel 5 as tx5, used in mutual-cap mode */ -} tsi_mutual_tx_channel_t; - -/*! - * @brief TSI RX channel selection in mutual-cap mode - * - * These constants Choose the RX channel used in mutual-cap mode. - */ -typedef enum _tsi_mutual_rx_channel -{ - kTSI_MutualRxChannel_6 = 0U, /*!< Select channel 6 as rx6, used in mutual-cap mode */ - kTSI_MutualRxChannel_7 = 1U, /*!< Select channel 7 as rx7, used in mutual-cap mode */ - kTSI_MutualRxChannel_8 = 2U, /*!< Select channel 8 as rx8, used in mutual-cap mode */ - kTSI_MutualRxChannel_9 = 3U, /*!< Select channel 9 as rx9, used in mutual-cap mode */ - kTSI_MutualRxChannel_10 = 4U, /*!< Select channel 10 as rx10, used in mutual-cap mode */ - kTSI_MutualRxChannel_11 = 5U, /*!< Select channel 11 as rx11, used in mutual-cap mode */ -} tsi_mutual_rx_channel_t; - -/*! - * @brief TSI sensitivity boost current settings - * - * These constants set the sensitivity boost current. - */ -typedef enum _tsi_mutual_sense_boost_current -{ - kTSI_MutualSenseBoostCurrent_0uA = 0U, /*!< Sensitivity boost current is 0uA , used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_2uA = 1U, /*!< Sensitivity boost current is 2uA , used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_4uA = 2U, /*!< Sensitivity boost current is 4uA , used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_6uA = 3U, /*!< Sensitivity boost current is 6uA , used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_8uA = 4U, /*!< Sensitivity boost current is 8uA , used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_10uA = 5U, /*!< Sensitivity boost current is 10uA, used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_12uA = 6U, /*!< Sensitivity boost current is 12uA, used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_14uA = 7U, /*!< Sensitivity boost current is 14uA, used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_16uA = 8U, /*!< Sensitivity boost current is 16uA, used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_18uA = 9U, /*!< Sensitivity boost current is 18uA, used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_20uA = 10U, /*!< Sensitivity boost current is 20uA, used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_22uA = 11U, /*!< Sensitivity boost current is 22uA, used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_24uA = 12U, /*!< Sensitivity boost current is 24uA, used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_26uA = 13U, /*!< Sensitivity boost current is 26uA, used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_28uA = 14U, /*!< Sensitivity boost current is 28uA, used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_30uA = 15U, /*!< Sensitivity boost current is 30uA, used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_32uA = 16U, /*!< Sensitivity boost current is 32uA, used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_34uA = 17U, /*!< Sensitivity boost current is 34uA, used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_36uA = 18U, /*!< Sensitivity boost current is 36uA, used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_38uA = 19U, /*!< Sensitivity boost current is 38uA, used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_40uA = 20U, /*!< Sensitivity boost current is 40uA, used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_42uA = 21U, /*!< Sensitivity boost current is 42uA, used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_44uA = 22U, /*!< Sensitivity boost current is 44uA, used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_46uA = 23U, /*!< Sensitivity boost current is 46uA, used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_48uA = 24U, /*!< Sensitivity boost current is 48uA, used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_50uA = 25U, /*!< Sensitivity boost current is 50uA, used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_52uA = 26U, /*!< Sensitivity boost current is 52uA, used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_54uA = 27U, /*!< Sensitivity boost current is 54uA, used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_56uA = 28U, /*!< Sensitivity boost current is 56uA, used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_58uA = 29U, /*!< Sensitivity boost current is 58uA, used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_60uA = 30U, /*!< Sensitivity boost current is 60uA, used in mutual-cap mode */ - kTSI_MutualSenseBoostCurrent_62uA = 31U /*!< Sensitivity boost current is 62uA, used in mutual-cap mode */ -} tsi_mutual_sense_boost_current_t; - -/*! - * @brief TSI TX drive mode control - * - * These constants Choose the TX drive mode control setting. - */ -typedef enum _tsi_mutual_tx_drive_mode -{ - kTSI_MutualTxDriveModeOption_0 = 0U, /*!< TX drive mode is -5v ~ +5v, used in mutual-cap mode */ - kTSI_MutualTxDriveModeOption_1 = 1U, /*!< TX drive mode is 0v ~ +5v, used in mutual-cap mode */ -} tsi_mutual_tx_drive_mode_t; - -/*! - * @brief TSI Pmos current mirror selection on the left side - * - * These constants set the Pmos current mirror on the left side used in mutual-cap mode. - */ -typedef enum _tsi_mutual_pmos_current_left -{ - kTSI_MutualPmosCurrentMirrorLeft_4 = 0U, /*!< Set Pmos current mirror left value as 4, used in mutual-cap mode */ - kTSI_MutualPmosCurrentMirrorLeft_8 = 1U, /*!< Set Pmos current mirror left value as 8, used in mutual-cap mode */ - kTSI_MutualPmosCurrentMirrorLeft_12 = 2U, /*!< Set Pmos current mirror left value as 12, used in mutual-cap mode */ - kTSI_MutualPmosCurrentMirrorLeft_16 = 3U, /*!< Set Pmos current mirror left value as 16, used in mutual-cap mode */ - kTSI_MutualPmosCurrentMirrorLeft_20 = 4U, /*!< Set Pmos current mirror left value as 20, used in mutual-cap mode */ - kTSI_MutualPmosCurrentMirrorLeft_24 = 5U, /*!< Set Pmos current mirror left value as 24, used in mutual-cap mode */ - kTSI_MutualPmosCurrentMirrorLeft_28 = 6U, /*!< Set Pmos current mirror left value as 28, used in mutual-cap mode */ - kTSI_MutualPmosCurrentMirrorLeft_32 = 7U, /*!< Set Pmos current mirror left value as 32, used in mutual-cap mode */ -} tsi_mutual_pmos_current_left_t; - -/*! - * @brief TSI Pmos current mirror selection on the right side - * - * These constants set the Pmos current mirror on the right side used in mutual-cap mode. - */ -typedef enum _tsi_mutual_pmos_current_right -{ - kTSI_MutualPmosCurrentMirrorRight_1 = 0U, /*!< Set Pmos current mirror right value as 1, used in mutual-cap mode */ - kTSI_MutualPmosCurrentMirrorRight_2 = 1U, /*!< Set Pmos current mirror right value as 2, used in mutual-cap mode */ - kTSI_MutualPmosCurrentMirrorRight_3 = 2U, /*!< Set Pmos current mirror right value as 3, used in mutual-cap mode */ - kTSI_MutualPmosCurrentMirrorRight_4 = 3U, /*!< Set Pmos current mirror right value as 4, used in mutual-cap mode */ -} tsi_mutual_pmos_current_right_t; - -/*! - * @brief TSI Nmos current mirror selection - * - * These constants set the Nmos current mirror used in mutual-cap mode. - */ -typedef enum _tsi_mutual_nmos_current -{ - kTSI_MutualNmosCurrentMirror_1 = 0U, /*!< Set Nmos current mirror value as 1, used in mutual-cap mode */ - kTSI_MutualNmosCurrentMirror_2 = 1U, /*!< Set Nmos current mirror value as 2, used in mutual-cap mode */ - kTSI_MutualNmosCurrentMirror_3 = 2U, /*!< Set Nmos current mirror value as 3, used in mutual-cap mode */ - kTSI_MutualNmosCurrentMirror_4 = 3U, /*!< Set Nmos current mirror value as 4, used in mutual-cap mode */ -} tsi_mutual_nmos_current_t; - -/*! - * @brief TSI SINC cutoff divider setting - * - * These bits set the SINC cutoff divider. - */ -typedef enum _tsi_sinc_cutoff_div -{ - kTSI_SincCutoffDiv_1 = 0U, /*!< Set SINC cutoff divider as 1 */ - kTSI_SincCutoffDiv_2 = 1U, /*!< Set SINC cutoff divider as 2 */ - kTSI_SincCutoffDiv_4 = 2U, /*!< Set SINC cutoff divider as 4 */ - kTSI_SincCutoffDiv_8 = 3U, /*!< Set SINC cutoff divider as 8 */ - kTSI_SincCutoffDiv_16 = 4U, /*!< Set SINC cutoff divider as 16 */ - kTSI_SincCutoffDiv_32 = 5U, /*!< Set SINC cutoff divider as 32 */ - kTSI_SincCutoffDiv_64 = 6U, /*!< Set SINC cutoff divider as 64 */ - kTSI_SincCutoffDiv_128 = 7U /*!< Set SINC cutoff divider as 128 */ -} tsi_sinc_cutoff_div_t; - -/*! - * @brief TSI SINC filter order setting - * - * These bits set the SINC filter order. - */ -typedef enum _tsi_sinc_filter_order -{ - kTSI_SincFilterOrder_1 = 0U, /*!< Use 1 order SINC filter */ - kTSI_SincFilterOrder_2 = 1U, /*!< Use 1 order SINC filter */ -} tsi_sinc_filter_order_t; - -/*! - * @brief TSI SINC decimation value setting - * - * These bits set the SINC decimation value. - */ -typedef enum _tsi_sinc_decimation_value -{ - kTSI_SincDecimationValue_1 = 0U, /*!< The TSI_DATA[TSICH] bits is the counter value of 1 triger period. */ - kTSI_SincDecimationValue_2 = 1U, /*!< The TSI_DATA[TSICH] bits is the counter value of 2 triger period. */ - kTSI_SincDecimationValue_3 = 2U, /*!< The TSI_DATA[TSICH] bits is the counter value of 3 triger period. */ - kTSI_SincDecimationValue_4 = 3U, /*!< The TSI_DATA[TSICH] bits is the counter value of 4 triger period. */ - kTSI_SincDecimationValue_5 = 4U, /*!< The TSI_DATA[TSICH] bits is the counter value of 5 triger period. */ - kTSI_SincDecimationValue_6 = 5U, /*!< The TSI_DATA[TSICH] bits is the counter value of 6 triger period. */ - kTSI_SincDecimationValue_7 = 6U, /*!< The TSI_DATA[TSICH] bits is the counter value of 7 triger period. */ - kTSI_SincDecimationValue_8 = 7U, /*!< The TSI_DATA[TSICH] bits is the counter value of 8 triger period. */ - kTSI_SincDecimationValue_9 = 8U, /*!< The TSI_DATA[TSICH] bits is the counter value of 9 triger period. */ - kTSI_SincDecimationValue_10 = 9U, /*!< The TSI_DATA[TSICH] bits is the counter value of 10 triger period. */ - kTSI_SincDecimationValue_11 = 10U, /*!< The TSI_DATA[TSICH] bits is the counter value of 11 triger period. */ - kTSI_SincDecimationValue_12 = 11U, /*!< The TSI_DATA[TSICH] bits is the counter value of 12 triger period. */ - kTSI_SincDecimationValue_13 = 12U, /*!< The TSI_DATA[TSICH] bits is the counter value of 13 triger period. */ - kTSI_SincDecimationValue_14 = 13U, /*!< The TSI_DATA[TSICH] bits is the counter value of 14 triger period. */ - kTSI_SincDecimationValue_15 = 14U, /*!< The TSI_DATA[TSICH] bits is the counter value of 15 triger period. */ - kTSI_SincDecimationValue_16 = 15U, /*!< The TSI_DATA[TSICH] bits is the counter value of 16 triger period. */ - kTSI_SincDecimationValue_17 = 16U, /*!< The TSI_DATA[TSICH] bits is the counter value of 17 triger period. */ - kTSI_SincDecimationValue_18 = 17U, /*!< The TSI_DATA[TSICH] bits is the counter value of 18 triger period. */ - kTSI_SincDecimationValue_19 = 18U, /*!< The TSI_DATA[TSICH] bits is the counter value of 19 triger period. */ - kTSI_SincDecimationValue_20 = 19U, /*!< The TSI_DATA[TSICH] bits is the counter value of 20 triger period. */ - kTSI_SincDecimationValue_21 = 20U, /*!< The TSI_DATA[TSICH] bits is the counter value of 21 triger period. */ - kTSI_SincDecimationValue_22 = 21U, /*!< The TSI_DATA[TSICH] bits is the counter value of 22 triger period. */ - kTSI_SincDecimationValue_23 = 22U, /*!< The TSI_DATA[TSICH] bits is the counter value of 23 triger period. */ - kTSI_SincDecimationValue_24 = 23U, /*!< The TSI_DATA[TSICH] bits is the counter value of 24 triger period. */ - kTSI_SincDecimationValue_25 = 24U, /*!< The TSI_DATA[TSICH] bits is the counter value of 25 triger period. */ - kTSI_SincDecimationValue_26 = 25U, /*!< The TSI_DATA[TSICH] bits is the counter value of 26 triger period. */ - kTSI_SincDecimationValue_27 = 26U, /*!< The TSI_DATA[TSICH] bits is the counter value of 27 triger period. */ - kTSI_SincDecimationValue_28 = 27U, /*!< The TSI_DATA[TSICH] bits is the counter value of 28 triger period. */ - kTSI_SincDecimationValue_29 = 28U, /*!< The TSI_DATA[TSICH] bits is the counter value of 29 triger period. */ - kTSI_SincDecimationValue_30 = 29U, /*!< The TSI_DATA[TSICH] bits is the counter value of 30 triger period. */ - kTSI_SincDecimationValue_31 = 30U, /*!< The TSI_DATA[TSICH] bits is the counter value of 31 triger period. */ - kTSI_SincDecimationValue_32 = 31U /*!< The TSI_DATA[TSICH] bits is the counter value of 32 triger period. */ -} tsi_sinc_decimation_value_t; - -/*! - * @brief TSI SSC output bit0's period setting(SSC0[CHARGE_NUM]) - * - * These bits set the SSC output bit0's period setting. - */ -typedef enum _tsi_ssc_charge_num -{ - kTSI_SscChargeNumValue_1 = 0U, /*!< The SSC output bit 0's period will be 1 clock cycle of system clock. */ - kTSI_SscChargeNumValue_2 = 1U, /*!< The SSC output bit 0's period will be 2 clock cycle of system clock. */ - kTSI_SscChargeNumValue_3 = 2U, /*!< The SSC output bit 0's period will be 3 clock cycle of system clock. */ - kTSI_SscChargeNumValue_4 = 3U, /*!< The SSC output bit 0's period will be 4 clock cycle of system clock. */ - kTSI_SscChargeNumValue_5 = 4U, /*!< The SSC output bit 0's period will be 5 clock cycle of system clock. */ - kTSI_SscChargeNumValue_6 = 5U, /*!< The SSC output bit 0's period will be 6 clock cycle of system clock. */ - kTSI_SscChargeNumValue_7 = 6U, /*!< The SSC output bit 0's period will be 7 clock cycle of system clock. */ - kTSI_SscChargeNumValue_8 = 7U, /*!< The SSC output bit 0's period will be 8 clock cycle of system clock. */ - kTSI_SscChargeNumValue_9 = 8U, /*!< The SSC output bit 0's period will be 9 clock cycle of system clock. */ - kTSI_SscChargeNumValue_10 = 9U, /*!< The SSC output bit 0's period will be 10 clock cycle of system clock. */ - kTSI_SscChargeNumValue_11 = 10U, /*!< The SSC output bit 0's period will be 11 clock cycle of system clock. */ - kTSI_SscChargeNumValue_12 = 11U, /*!< The SSC output bit 0's period will be 12 clock cycle of system clock. */ - kTSI_SscChargeNumValue_13 = 12U, /*!< The SSC output bit 0's period will be 13 clock cycle of system clock. */ - kTSI_SscChargeNumValue_14 = 13U, /*!< The SSC output bit 0's period will be 14 clock cycle of system clock. */ - kTSI_SscChargeNumValue_15 = 14U, /*!< The SSC output bit 0's period will be 15 clock cycle of system clock. */ - kTSI_SscChargeNumValue_16 = 15U, /*!< The SSC output bit 0's period will be 16 clock cycle of system clock. */ -} tsi_ssc_charge_num_t; - -/*! - * @brief TSI SSC output bit1's period setting(SSC0[BASE_NOCHARGE_NUM]) - * - * These bits set the SSC output bit1's period setting. - */ -typedef enum _tsi_ssc_nocharge_num -{ - kTSI_SscNoChargeNumValue_1 = 0U, /*!< The SSC output bit 1's basic period will be 1 clock cycle of system clock. */ - kTSI_SscNoChargeNumValue_2 = 1U, /*!< The SSC output bit 1's basic period will be 2 clock cycle of system clock. */ - kTSI_SscNoChargeNumValue_3 = 2U, /*!< The SSC output bit 1's basic period will be 3 clock cycle of system clock. */ - kTSI_SscNoChargeNumValue_4 = 3U, /*!< The SSC output bit 1's basic period will be 4 clock cycle of system clock. */ - kTSI_SscNoChargeNumValue_5 = 4U, /*!< The SSC output bit 1's basic period will be 5 clock cycle of system clock. */ - kTSI_SscNoChargeNumValue_6 = 5U, /*!< The SSC output bit 1's basic period will be 6 clock cycle of system clock. */ - kTSI_SscNoChargeNumValue_7 = 6U, /*!< The SSC output bit 1's basic period will be 7 clock cycle of system clock. */ - kTSI_SscNoChargeNumValue_8 = 7U, /*!< The SSC output bit 1's basic period will be 8 clock cycle of system clock. */ - kTSI_SscNoChargeNumValue_9 = 8U, /*!< The SSC output bit 1's basic period will be 9 clock cycle of system clock. */ - kTSI_SscNoChargeNumValue_10 = - 9U, /*!< The SSC output bit 1's basic period will be 10 clock cycle of system clock. */ - kTSI_SscNoChargeNumValue_11 = - 10U, /*!< The SSC output bit 1's basic period will be 11 clock cycle of system clock. */ - kTSI_SscNoChargeNumValue_12 = - 11U, /*!< The SSC output bit 1's basic period will be 12 clock cycle of system clock. */ - kTSI_SscNoChargeNumValue_13 = - 12U, /*!< The SSC output bit 1's basic period will be 13 clock cycle of system clock. */ - kTSI_SscNoChargeNumValue_14 = - 13U, /*!< The SSC output bit 1's basic period will be 14 clock cycle of system clock. */ - kTSI_SscNoChargeNumValue_15 = - 14U, /*!< The SSC output bit 1's basic period will be 15 clock cycle of system clock. */ - kTSI_SscNoChargeNumValue_16 = - 15U, /*!< The SSC output bit 1's basic period will be 16 clock cycle of system clock. */ -} tsi_ssc_nocharge_num_t; - -/*! - * @brief TSI SSC outsel choosing the length of the PRBS (Pseudo-RandomBinarySequence) method - * setting(SSC0[TSI_SSC0_PRBS_OUTSEL]) - * - * These bits set the SSC PRBS length. - */ -typedef enum _tsi_ssc_prbs_outsel -{ - kTSI_SscPrbsOutsel_2 = 2U, /*!< The length of the PRBS is 2. */ - kTSI_SscPrbsOutsel_3 = 3U, /*!< The length of the PRBS is 3. */ - kTSI_SscPrbsOutsel_4 = 4U, /*!< The length of the PRBS is 4. */ - kTSI_SscPrbsOutsel_5 = 5U, /*!< The length of the PRBS is 5. */ - kTSI_SscPrbsOutsel_6 = 6U, /*!< The length of the PRBS is 6. */ - kTSI_SscPrbsOutsel_7 = 7U, /*!< The length of the PRBS is 7. */ - kTSI_SscPrbsOutsel_8 = 8U, /*!< The length of the PRBS is 8. */ - kTSI_SscPrbsOutsel_9 = 9U, /*!< The length of the PRBS is 9. */ - kTSI_SscPrbsOutsel_10 = 10U, /*!< The length of the PRBS is 10. */ - kTSI_SscPrbsOutsel_11 = 11U, /*!< The length of the PRBS is 11. */ - kTSI_SscPrbsOutsel_12 = 12U, /*!< The length of the PRBS is 12. */ - kTSI_SscPrbsOutsel_13 = 13U, /*!< The length of the PRBS is 13. */ - kTSI_SscPrbsOutsel_14 = 14U, /*!< The length of the PRBS is 14. */ - kTSI_SscPrbsOutsel_15 = 15U, /*!< The length of the PRBS is 15. */ -} tsi_ssc_prbs_outsel_t; - -/*! @brief TSI status flags. */ -typedef enum _tsi_status_flags -{ - kTSI_EndOfScanFlag = TSI_DATA_EOSF_MASK, /*!< End-Of-Scan flag */ - kTSI_OutOfRangeFlag = (int)TSI_DATA_OUTRGF_MASK /*!< Out-Of-Range flag */ -} tsi_status_flags_t; - -/*! @brief TSI feature interrupt source.*/ -typedef enum _tsi_interrupt_enable -{ - kTSI_GlobalInterruptEnable = 1U, /*!< TSI module global interrupt */ - kTSI_OutOfRangeInterruptEnable = 2U, /*!< Out-Of-Range interrupt */ - kTSI_EndOfScanInterruptEnable = 4U /*!< End-Of-Scan interrupt */ -} tsi_interrupt_enable_t; - -/*! - * @brief TSI SSC mode selection. - * - * These constants set the SSC mode. - */ -typedef enum _tsi_ssc_mode -{ - kTSI_ssc_prbs_method = 0U, /*!< Using PRBS method generating SSC output bit. */ - kTSI_ssc_up_down_counter = 1U, /*!< Using up-down counter generating SSC output bit. */ - kTSI_ssc_dissable = 2U, /*!< SSC function is disabled. */ -} tsi_ssc_mode_t; - -/*! - * @brief TSI main clock selection. - * - * These constants set select the divider ratio for the clock used for generating the SSC output bit. - */ -typedef enum _tsi_ssc_prescaler -{ - kTSI_ssc_div_by_1 = 0x0U, /*!< Set SSC divider to 00000000 div1(2^0) */ - kTSI_ssc_div_by_2 = 0x1U, /*!< Set SSC divider to 00000001 div2(2^1) */ - kTSI_ssc_div_by_4 = 0x3U, /*!< Set SSC divider to 00000011 div4(2^2) */ - kTSI_ssc_div_by_8 = 0x7U, /*!< Set SSC divider to 00000111 div8(2^3) */ - kTSI_ssc_div_by_16 = 0xfU, /*!< Set SSC divider to 00001111 div16(2^4) */ - kTSI_ssc_div_by_32 = 0x1fU, /*!< Set SSC divider to 00011111 div32(2^5) */ - kTSI_ssc_div_by_64 = 0x3fU, /*!< Set SSC divider to 00111111 div64(2^6) */ - kTSI_ssc_div_by_128 = 0x7fU, /*!< Set SSC divider to 01111111 div128(2^7) */ - kTSI_ssc_div_by_256 = 0xffU, /*!< Set SSC divider to 11111111 div256(2^8) */ -} tsi_ssc_prescaler_t; - -/*! @brief TSI calibration data storage. */ -typedef struct _tsi_calibration_data -{ - uint16_t calibratedData[FSL_FEATURE_TSI_CHANNEL_COUNT]; /*!< TSI calibration data storage buffer */ -} tsi_calibration_data_t; - -/*! - * @brief TSI common configuration structure - * - * This structure contains the common settings for TSI self-cap or mutual-cap mode, configurations including - * the TSI module main clock, sensing mode, DVOLT options, SINC and SSC configurations. - */ -typedef struct _tsi_common_config -{ - tsi_main_clock_selection_t mainClock; /*!< Set main clock. */ - tsi_sensing_mode_selection_t mode; /*!< Choose sensing mode. */ - tsi_dvolt_option_t dvolt; /*!< DVOLT option value. */ - tsi_sinc_cutoff_div_t cutoff; /*!< Cutoff divider. */ - tsi_sinc_filter_order_t order; /*!< SINC filter order. */ - tsi_sinc_decimation_value_t decimation; /*!< SINC decimation value. */ - tsi_ssc_charge_num_t chargeNum; /*!< SSC High Width (t1), SSC output bit0's period setting. */ - tsi_ssc_prbs_outsel_t prbsOutsel; /*!< SSC High Random Width (t2), length of PRBS(Pseudo-RandomBinarySequence),SSC - output bit2's period setting. */ - tsi_ssc_nocharge_num_t noChargeNum; /*!< SSC Low Width (t3), SSC output bit1's period setting. */ - tsi_ssc_mode_t ssc_mode; /*!< Clock mode selection (basic - from main clock by divider,advanced - using - SSC(Switching Speed Clock) by three configurable intervals. */ - tsi_ssc_prescaler_t ssc_prescaler; /*!< Set clock divider for basic mode. */ -} tsi_common_config_t; - -/*! - * @brief TSI configuration structure for self-cap mode - * - * This structure contains the settings for the most common TSI self-cap configurations including - * the TSI module charge currents, sensitivity configuration and so on. - */ -typedef struct _tsi_selfCap_config -{ - tsi_common_config_t commonConfig; /*!< Common settings. */ - bool enableSensitivity; /*!< Enable sensitivity boost of self-cap or not. */ - tsi_shield_t enableShield; /*!< Enable shield of self-cap mode or not. */ - tsi_sensitivity_xdn_option_t xdn; /*!< Sensitivity XDN option. */ - tsi_sensitivity_ctrim_option_t ctrim; /*!< Sensitivity CTRIM option. */ - tsi_current_multiple_input_t inputCurrent; /*!< Input current multiple. */ - tsi_current_multiple_charge_t chargeCurrent; /*!< Charge/Discharge current multiple. */ -} tsi_selfCap_config_t; - -/*! - * @brief TSI configuration structure for mutual-cap mode - * - * This structure contains the settings for the most common TSI mutual-cap configurations including - * the TSI module generator settings, sensitivity related current settings and so on. - */ -typedef struct _tsi_mutualCap_config -{ - tsi_common_config_t commonConfig; /*!< Common settings. */ - tsi_mutual_pre_current_t preCurrent; /*!< Vref generator current. */ - tsi_mutual_pre_resistor_t preResistor; /*!< Vref generator resistor. */ - tsi_mutual_sense_resistor_t senseResistor; /*!< I-sense generator resistor. */ - tsi_mutual_sense_boost_current_t boostCurrent; /*!< Sensitivity boost current setting. */ - tsi_mutual_tx_drive_mode_t txDriveMode; /*!< TX drive mode control setting. */ - tsi_mutual_pmos_current_left_t pmosLeftCurrent; /*!< Pmos current mirror on the left side. */ - tsi_mutual_pmos_current_right_t pmosRightCurrent; /*!< Pmos current mirror on the right side. */ - bool enableNmosMirror; /*!< Enable Nmos current mirror setting or not. */ - tsi_mutual_nmos_current_t nmosCurrent; /*!< Nmos current mirror setting. */ -} tsi_mutualCap_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#ifdef __cplusplus -extern "C" { -#endif - -/*! - * @brief Get the TSI instance from peripheral base address. - * - * @param base TSI peripheral base address. - * @return TSI instance. - */ -uint32_t TSI_GetInstance(TSI_Type *base); - -/*! - * @brief Initialize hardware to Self-cap mode. - * - * @details Initialize the peripheral to the targeted state specified by parameter config, - * such as sets sensitivity adjustment, current settings. - * @param base TSI peripheral base address. - * @param config Pointer to TSI self-cap configuration structure. - * @return none - */ -void TSI_InitSelfCapMode(TSI_Type *base, const tsi_selfCap_config_t *config); - -/*! - * @brief Initialize hardware to Mutual-cap mode. - * - * @details Initialize the peripheral to the targeted state specified by parameter config, - * such as sets Vref generator setting, sensitivity boost settings, Pmos/Nmos settings. - * @param base TSI peripheral base address. - * @param config Pointer to TSI mutual-cap configuration structure. - * @return none - */ -void TSI_InitMutualCapMode(TSI_Type *base, const tsi_mutualCap_config_t *config); - -/*! - * @brief De-initialize hardware. - * - * @details De-initialize the peripheral to default state. - * - * @param base TSI peripheral base address. - * @return none - */ -void TSI_Deinit(TSI_Type *base); - -/*! - * @brief Get TSI self-cap mode user configure structure. - * This interface sets userConfig structure to a default value. The configuration structure only - * includes the settings for the whole TSI. - * The user configure is set to a value: - * @code - userConfig->commonConfig.mainClock = kTSI_MainClockSlection_0; - userConfig->commonConfig.mode = kTSI_SensingModeSlection_Self; - userConfig->commonConfig.dvolt = kTSI_DvoltOption_2; - userConfig->commonConfig.cutoff = kTSI_SincCutoffDiv_1; - userConfig->commonConfig.order = kTSI_SincFilterOrder_1; - userConfig->commonConfig.decimation = kTSI_SincDecimationValue_8; - userConfig->commonConfig.chargeNum = kTSI_SscChargeNumValue_3; - userConfig->commonConfig.prbsOutsel = kTSI_SscPrbsOutsel_2; - userConfig->commonConfig.noChargeNum = kTSI_SscNoChargeNumValue_2; - userConfig->commonConfig.ssc_mode = kTSI_ssc_prbs_method; - userConfig->commonConfig.ssc_prescaler = kTSI_ssc_div_by_1; - userConfig->enableSensitivity = true; - userConfig->enableShield = false; - userConfig->xdn = kTSI_SensitivityXdnOption_1; - userConfig->ctrim = kTSI_SensitivityCtrimOption_7; - userConfig->inputCurrent = kTSI_CurrentMultipleInputValue_0; - userConfig->chargeCurrent = kTSI_CurrentMultipleChargeValue_1; - @endcode - * - * @param userConfig Pointer to TSI user configure structure. - */ -void TSI_GetSelfCapModeDefaultConfig(tsi_selfCap_config_t *userConfig); - -/*! - * @brief Get TSI mutual-cap mode default user configure structure. - * This interface sets userConfig structure to a default value. The configuration structure only - * includes the settings for the whole TSI. - * The user configure is set to a value: - * @code - userConfig->commonConfig.mainClock = kTSI_MainClockSlection_1; - userConfig->commonConfig.mode = kTSI_SensingModeSlection_Mutual; - userConfig->commonConfig.dvolt = kTSI_DvoltOption_0; - userConfig->commonConfig.cutoff = kTSI_SincCutoffDiv_1; - userConfig->commonConfig.order = kTSI_SincFilterOrder_1; - userConfig->commonConfig.decimation = kTSI_SincDecimationValue_8; - userConfig->commonConfig.chargeNum = kTSI_SscChargeNumValue_4; - userConfig->commonConfig.prbsOutsel = kTSI_SscPrbsOutsel_2; - userConfig->commonConfig.noChargeNum = kTSI_SscNoChargeNumValue_5; - userConfig->commonConfig.ssc_mode = kTSI_ssc_prbs_method; - userConfig->commonConfig.ssc_prescaler = kTSI_ssc_div_by_1; - userConfig->preCurrent = kTSI_MutualPreCurrent_4uA; - userConfig->preResistor = kTSI_MutualPreResistor_4k; - userConfig->senseResistor = kTSI_MutualSenseResistor_10k; - userConfig->boostCurrent = kTSI_MutualSenseBoostCurrent_0uA; - userConfig->txDriveMode = kTSI_MutualTxDriveModeOption_0; - userConfig->pmosLeftCurrent = kTSI_MutualPmosCurrentMirrorLeft_32; - userConfig->pmosRightCurrent = kTSI_MutualPmosCurrentMirrorRight_1; - userConfig->enableNmosMirror = true; - userConfig->nmosCurrent = kTSI_MutualNmosCurrentMirror_1; - @endcode - * - * @param userConfig Pointer to TSI user configure structure. - */ -void TSI_GetMutualCapModeDefaultConfig(tsi_mutualCap_config_t *userConfig); - -/*! - * @brief Hardware base counter value for calibration. - * - * @details Calibrate the peripheral to fetch the initial counter value of - * the enabled channels. - * This API is mostly used at initial application setup, it shall be called - * after the TSI_Init API, then user can use the calibrated - * counter values to setup applications(such as to determine - * under which counter value we can confirm a touch event occurs). - * - * @param base TSI peripheral base address. - * @param calBuff Data buffer that store the calibrated counter value. - * @return none - * @note This API is mainly used for self-cap mode; - * @note The calibration work in mutual-cap mode shall be done in applications due to different board layout. - * - */ -void TSI_SelfCapCalibrate(TSI_Type *base, tsi_calibration_data_t *calBuff); - -/*! - * @brief Enables TSI interrupt requests. - * @param base TSI peripheral base address. - * @param mask interrupt source - * The parameter can be combination of the following source if defined: - * @arg kTSI_GlobalInterruptEnable - * @arg kTSI_EndOfScanInterruptEnable - * @arg kTSI_OutOfRangeInterruptEnable - */ -void TSI_EnableInterrupts(TSI_Type *base, uint32_t mask); - -/*! - * @brief Disables TSI interrupt requests. - * @param base TSI peripheral base address. - * @param mask interrupt source - * The parameter can be combination of the following source if defined: - * @arg kTSI_GlobalInterruptEnable - * @arg kTSI_EndOfScanInterruptEnable - * @arg kTSI_OutOfRangeInterruptEnable - */ -void TSI_DisableInterrupts(TSI_Type *base, uint32_t mask); - -/*! - * @brief Get interrupt flag. - * This function get tsi interrupt flags. - * - * @param base TSI peripheral base address. - * @return The mask of these status flags combination. - */ -static inline uint32_t TSI_GetStatusFlags(TSI_Type *base) -{ - return (base->DATA & (uint32_t)((uint32_t)kTSI_EndOfScanFlag | (uint32_t)kTSI_OutOfRangeFlag)); -} - -/*! - * @brief Clear interrupt flag. - * - * This function clear tsi interrupt flag, - * automatically cleared flags can not be cleared by this function. - * - * @param base TSI peripheral base address. - * @param mask The status flags to clear. - */ -void TSI_ClearStatusFlags(TSI_Type *base, uint32_t mask); - -/*! - * @brief Get TSI scan trigger mode. - * - * @param base TSI peripheral base address. - * @return Scan trigger mode. - */ -static inline uint32_t TSI_GetScanTriggerMode(TSI_Type *base) -{ - return (base->GENCS & TSI_GENCS_STM_MASK); -} - -/*! - * @brief Enables the TSI Module or not. - * - * @param base TSI peripheral base address. - * @param enable Choose whether to enable or disable module; - * - true Enable TSI module; - * - false Disable TSI module; - * @return none. - */ -static inline void TSI_EnableModule(TSI_Type *base, bool enable) -{ - if (enable) - { - base->DATA = base->DATA & ~ALL_FLAGS_MASK; - base->GENCS = base->GENCS | TSI_GENCS_TSIEN_MASK; /* Enable module */ - } - else - { - base->DATA = base->DATA & ~ALL_FLAGS_MASK; - base->GENCS = base->GENCS & ~TSI_GENCS_TSIEN_MASK; /* Disable module */ - } -} - -/*! - * @brief Sets the TSI low power STOP mode enable or not. - * This enables TSI module function in low power modes. - * - * @param base TSI peripheral base address. - * @param enable Choose to enable or disable STOP mode. - * - true Enable module in STOP mode; - * - false Disable module in STOP mode; - * @return none. - */ -static inline void TSI_EnableLowPower(TSI_Type *base, bool enable) -{ - if (enable) - { - base->GENCS = - (base->GENCS & ~ALL_FLAGS_MASK) | TSI_GENCS_STPE_MASK; /* Module enabled in low power stop modes */ - } - else - { - base->GENCS = - (base->GENCS & ~ALL_FLAGS_MASK) & (~TSI_GENCS_STPE_MASK); /* Module disabled in low power stop modes */ - } -} - -/*! - * @brief Enable the hardware trigger scan or not. - * - * @param base TSI peripheral base address. - * @param enable Choose to enable hardware trigger or software trigger scan. - * - true Enable hardware trigger scan; - * - false Enable software trigger scan; - * @return none. - */ -static inline void TSI_EnableHardwareTriggerScan(TSI_Type *base, bool enable) -{ - if (enable) - { - base->DATA = base->DATA & ~ALL_FLAGS_MASK; - base->GENCS = base->GENCS | TSI_GENCS_STM_MASK; /* Enable hardware trigger scan */ - } - else - { - base->DATA = base->DATA & ~ALL_FLAGS_MASK; - base->GENCS = base->GENCS & ~TSI_GENCS_STM_MASK; /* Enable software trigger scan */ - } -} - -/*! - * @brief Start one sotware trigger measurement (trigger a new measurement). - * - * @param base TSI peripheral base address. - * @return none. - */ -static inline void TSI_StartSoftwareTrigger(TSI_Type *base) -{ - base->GENCS |= TSI_GENCS_SWTS_MASK; -} - -/*! - * @brief Set the measured channel number for self-cap mode. - * - * @param base TSI peripheral base address. - * @param channel Channel number 0 ... 24. - * @return none. - * @note This API can only be used in self-cap mode! - */ -static inline void TSI_SetSelfCapMeasuredChannel(TSI_Type *base, uint8_t channel) -{ - assert(channel < (uint8_t)FSL_FEATURE_TSI_CHANNEL_COUNT); - - base->CONFIG = ((base->CONFIG) & ~TSI_CONFIG_TSICH_MASK) | (TSI_CONFIG_TSICH(channel)); -} - -/*! - * @brief Get the current measured channel number, in self-cap mode. - * - * @param base TSI peripheral base address. - * @return uint8_t Channel number 0 ... 24. - * @note This API can only be used in self-cap mode! - */ -static inline uint8_t TSI_GetSelfCapMeasuredChannel(TSI_Type *base) -{ - return (uint8_t)((base->CONFIG & TSI_CONFIG_TSICH_MASK) >> TSI_CONFIG_TSICH_SHIFT); -} - -/*! - * @brief Decide whether to enable End of Scan DMA transfer request only. - * - * @param base TSI peripheral base address. - * @param enable Choose whether to enable End of Scan DMA transfer request only. - * - true Enable End of Scan DMA transfer request only; - * - false Both End-of-Scan and Out-of-Range can generate DMA transfer request. - * @return none. - */ -static inline void TSI_EnableEndOfScanDmaTransferOnly(TSI_Type *base, bool enable) -{ - if (enable) - { - base->GENCS = (base->GENCS & ~ALL_FLAGS_MASK) | - TSI_GENCS_DMAEN_EOS_MASK; /* Enable End of Scan DMA transfer request only; */ - } - else - { - base->GENCS = (base->GENCS & ~ALL_FLAGS_MASK) & - (~TSI_GENCS_DMAEN_EOS_MASK); /* Both types of events can generate DMA transfer request. */ - } -} - -/*! - * @brief Gets the conversion counter value. - * - * @param base TSI peripheral base address. - * @return Accumulated scan counter value ticked by the reference clock. - */ -static inline uint16_t TSI_GetCounter(TSI_Type *base) -{ - return (uint16_t)(base->DATA & TSI_DATA_TSICNT_MASK); -} - -/*! - * @brief Set the TSI wake-up channel low threshold. - * - * @param base TSI peripheral base address. - * @param low_threshold Low counter threshold. - * @return none. - */ -static inline void TSI_SetLowThreshold(TSI_Type *base, uint16_t low_threshold) -{ - base->TSHD = ((base->TSHD) & ~TSI_TSHD_THRESL_MASK) | (TSI_TSHD_THRESL(low_threshold)); -} - -/*! - * @brief Set the TSI wake-up channel high threshold. - * - * @param base TSI peripheral base address. - * @param high_threshold High counter threshold. - * @return none. - */ -static inline void TSI_SetHighThreshold(TSI_Type *base, uint16_t high_threshold) -{ - base->TSHD = ((base->TSHD) & ~TSI_TSHD_THRESH_MASK) | (TSI_TSHD_THRESH(high_threshold)); -} - -/*! - * @brief Set the main clock of the TSI module. - * - * @param base TSI peripheral base address. - * @param mainClock clock option value. - * @return none. - */ -static inline void TSI_SetMainClock(TSI_Type *base, tsi_main_clock_selection_t mainClock) -{ - base->GENCS = ((base->GENCS) & ~TSI_GENCS_SETCLK_MASK) | (TSI_GENCS_SETCLK(mainClock)); -} - -/*! - * @brief Set the sensing mode of the TSI module. - * - * @param base TSI peripheral base address. - * @param mode Mode value. - * @return none. - */ -static inline void TSI_SetSensingMode(TSI_Type *base, tsi_sensing_mode_selection_t mode) -{ - base->CONFIG = ((base->CONFIG) & ~TSI_CONFIG_MODE_MASK) | (TSI_CONFIG_MODE(mode)); -} - -/*! - * @brief Get the sensing mode of the TSI module. - * - * @param base TSI peripheral base address. - * @return Currently selected sensing mode. - */ -static inline tsi_sensing_mode_selection_t TSI_GetSensingMode(TSI_Type *base) -{ - return (tsi_sensing_mode_selection_t)(uint32_t)((base->CONFIG & TSI_CONFIG_MODE_MASK) >> TSI_CONFIG_MODE_SHIFT); -} - -/*! - * @brief Set the DVOLT settings. - * - * @param base TSI peripheral base address. - * @param dvolt The voltage rails. - * @return none. - */ -static inline void TSI_SetDvolt(TSI_Type *base, tsi_dvolt_option_t dvolt) -{ - base->GENCS = (base->GENCS & ~(TSI_GENCS_DVOLT_MASK | ALL_FLAGS_MASK)) | (TSI_GENCS_DVOLT(dvolt)); -} - -/*! - * @brief Enable self-cap mode noise cancellation function or not. - * - * @param base TSI peripheral base address. - * @param enableCancellation Choose whether to enable noise cancellation in self-cap mode - * - true Enable noise cancellation; - * - false Disable noise cancellation; - * @return none. - */ -static inline void TSI_EnableNoiseCancellation(TSI_Type *base, bool enableCancellation) -{ - base->CONFIG = ((base->CONFIG) & ~TSI_CONFIG_S_NOISE_MASK) | (TSI_CONFIG_S_NOISE(enableCancellation)); -} - -/*! - * @brief Set the mutual-cap mode TX channel. - * - * @param base TSI peripheral base address. - * @param txChannel Mutual-cap mode TX channel number - * @return none. - */ -static inline void TSI_SetMutualCapTxChannel(TSI_Type *base, tsi_mutual_tx_channel_t txChannel) -{ - base->CONFIG_MUTUAL = - ((base->CONFIG_MUTUAL) & ~TSI_CONFIG_MUTUAL_M_SEL_TX_MASK) | (TSI_CONFIG_MUTUAL_M_SEL_TX(txChannel)); -} - -/*! - * @brief Get the current measured TX channel number, in mutual-cap mode. - * - * @param base TSI peripheral base address; - * @return Tx Channel number 0 ... 5; - * @note This API can only be used in mutual-cap mode! - */ -static inline tsi_mutual_tx_channel_t TSI_GetTxMutualCapMeasuredChannel(TSI_Type *base) -{ - return (tsi_mutual_tx_channel_t)(uint32_t)((base->CONFIG_MUTUAL & TSI_CONFIG_MUTUAL_M_SEL_TX_MASK) >> - TSI_CONFIG_MUTUAL_M_SEL_TX_SHIFT); -} - -/*! - * @brief Set the mutual-cap mode RX channel. - * - * @param base TSI peripheral base address. - * @param rxChannel Mutual-cap mode RX channel number - * @return none. - */ -static inline void TSI_SetMutualCapRxChannel(TSI_Type *base, tsi_mutual_rx_channel_t rxChannel) -{ - base->CONFIG_MUTUAL = - ((base->CONFIG_MUTUAL) & ~TSI_CONFIG_MUTUAL_M_SEL_RX_MASK) | (TSI_CONFIG_MUTUAL_M_SEL_RX(rxChannel)); -} - -/*! - * @brief Get the current measured RX channel number, in mutual-cap mode. - * - * @param base TSI peripheral base address; - * @return Rx Channel number 6 ... 11; - * @note This API can only be used in mutual-cap mode! - */ -static inline tsi_mutual_rx_channel_t TSI_GetRxMutualCapMeasuredChannel(TSI_Type *base) -{ - return (tsi_mutual_rx_channel_t)(uint32_t)((base->CONFIG_MUTUAL & TSI_CONFIG_MUTUAL_M_SEL_RX_MASK) >> - TSI_CONFIG_MUTUAL_M_SEL_RX_SHIFT); -} - -/*! - * @brief Set the SSC clock mode of the TSI module. - * - * @param base TSI peripheral base address. - * @param mode SSC mode option value. - * @return none. - */ -static inline void TSI_SetSscMode(TSI_Type *base, tsi_ssc_mode_t mode) -{ - base->SSC0 = ((base->SSC0) & ~TSI_SSC0_SSC_MODE_MASK) | (TSI_SSC0_SSC_MODE(mode)); -} - -/*! - * @brief Set the SSC prescaler of the TSI module. - * - * @param base TSI peripheral base address. - * @param prescaler SSC prescaler option value. - * @return none. - */ -static inline void TSI_SetSscPrescaler(TSI_Type *base, tsi_ssc_prescaler_t prescaler) -{ - base->SSC0 = ((base->SSC0) & ~TSI_SSC0_SSC_PRESCALE_NUM_MASK) | (TSI_SSC0_SSC_PRESCALE_NUM(prescaler)); -} - -/*! - * @brief Set used mutual-cap TX channel. - * - * @param base TSI peripheral base address. - * @param txChannel Mutual-cap mode TX channel number - * @return none. - */ -static inline void TSI_SetUsedTxChannel(TSI_Type *base, tsi_mutual_tx_channel_t txChannel) -{ - base->MUL = (base->MUL) | (TSI_MUL_M_TX_USED(1UL << (uint8_t)txChannel)); -} - -/*! - * @brief Clear used mutual-cap TX channel. - * - * @param base TSI peripheral base address. - * @param txChannel Mutual-cap mode TX channel number - * @return none. - */ -static inline void TSI_ClearUsedTxChannel(TSI_Type *base, tsi_mutual_tx_channel_t txChannel) -{ - base->MUL &= ~TSI_MUL_M_TX_USED(1UL << (uint8_t)txChannel); -} - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -/*! @}*/ - -#endif /* FSL_TSI_V6_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_usdhc.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_usdhc.c deleted file mode 100644 index 7738f531448..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_usdhc.c +++ /dev/null @@ -1,2501 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_usdhc.h" -#if defined(FSL_SDK_ENABLE_DRIVER_CACHE_CONTROL) && FSL_SDK_ENABLE_DRIVER_CACHE_CONTROL -#include "fsl_cache.h" -#endif /* FSL_SDK_ENABLE_DRIVER_CACHE_CONTROL */ -#if defined(FSL_FEATURE_MEMORY_HAS_ADDRESS_OFFSET) && FSL_FEATURE_MEMORY_HAS_ADDRESS_OFFSET -#include "fsl_memory.h" -#endif -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.usdhc" -#endif - -/*! @brief Clock setting */ -/* Max SD clock divisor from base clock */ -#define USDHC_MAX_DVS ((USDHC_SYS_CTRL_DVS_MASK >> USDHC_SYS_CTRL_DVS_SHIFT) + 1U) -#define USDHC_MAX_CLKFS ((USDHC_SYS_CTRL_SDCLKFS_MASK >> USDHC_SYS_CTRL_SDCLKFS_SHIFT) + 1U) -#define USDHC_PREV_DVS(x) ((x) -= 1U) -#define USDHC_PREV_CLKFS(x, y) ((x) >>= (y)) -/*! @brief USDHC ADMA table address align size */ -#define USDHC_ADMA_TABLE_ADDRESS_ALIGN (4U) - -/* Typedef for interrupt handler. */ -typedef void (*usdhc_isr_t)(USDHC_Type *base, usdhc_handle_t *handle); -/*! @brief check flag avalibility */ -#define IS_USDHC_FLAG_SET(reg, flag) (((reg) & ((uint32_t)flag)) != 0UL) - -/*! @brief usdhc transfer flags */ -enum _usdhc_transfer_flags -{ - kUSDHC_CommandOnly = 1U, /*!< transfer command only */ - kUSDHC_CommandAndTxData = 2U, /*!< transfer command and transmit data */ - kUSDHC_CommandAndRxData = 4U, /*!< transfer command and receive data */ - kUSDHC_DataWithAutoCmd12 = 8U, /*!< transfer data with auto cmd12 enabled */ - kUSDHC_DataWithAutoCmd23 = 16U, /*!< transfer data with auto cmd23 enabled */ - kUSDHC_BootData = 32U, /*!< transfer boot data */ - kUSDHC_BootDataContinuous = 64U, /*!< transfer boot data continuous */ -}; - -#if defined(FSL_FEATURE_MEMORY_HAS_ADDRESS_OFFSET) && FSL_FEATURE_MEMORY_HAS_ADDRESS_OFFSET -#define USDHC_ADDR_CPU_2_DMA(addr) (MEMORY_ConvertMemoryMapAddress((addr), kMEMORY_Local2DMA)) -#else -#define USDHC_ADDR_CPU_2_DMA(addr) (addr) -#endif -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Get the instance. - * - * @param base USDHC peripheral base address. - * @return Instance number. - */ -static uint32_t USDHC_GetInstance(USDHC_Type *base); - -/*! - * @brief Start transfer according to current transfer state - * - * @param base USDHC peripheral base address. - * @param transferFlags transfer flags, @ref _usdhc_transfer_flags. - * @param blockSize block size. - * @param blockCount block count. - */ -static status_t USDHC_SetTransferConfig(USDHC_Type *base, - uint32_t transferFlags, - size_t blockSize, - uint32_t blockCount); - -/*! - * @brief Receive command response - * - * @param base USDHC peripheral base address. - * @param command Command to be sent. - */ -static status_t USDHC_ReceiveCommandResponse(USDHC_Type *base, usdhc_command_t *command); - -/*! - * @brief Read DATAPORT when buffer enable bit is set. - * - * @param base USDHC peripheral base address. - * @param data Data to be read. - * @param transferredWords The number of data words have been transferred last time transaction. - * @return The number of total data words have been transferred after this time transaction. - */ -static uint32_t USDHC_ReadDataPort(USDHC_Type *base, usdhc_data_t *data, uint32_t transferredWords); - -/*! - * @brief Read data by using DATAPORT polling way. - * - * @param base USDHC peripheral base address. - * @param data Data to be read. - * @retval kStatus_Fail Read DATAPORT failed. - * @retval kStatus_Success Operate successfully. - */ -static status_t USDHC_ReadByDataPortBlocking(USDHC_Type *base, usdhc_data_t *data); - -/*! - * @brief Write DATAPORT when buffer enable bit is set. - * - * @param base USDHC peripheral base address. - * @param data Data to be read. - * @param transferredWords The number of data words have been transferred last time. - * @return The number of total data words have been transferred after this time transaction. - */ -static uint32_t USDHC_WriteDataPort(USDHC_Type *base, usdhc_data_t *data, uint32_t transferredWords); - -/*! - * @brief Write data by using DATAPORT polling way. - * - * @param base USDHC peripheral base address. - * @param data Data to be transferred. - * @retval kStatus_Fail Write DATAPORT failed. - * @retval kStatus_Success Operate successfully. - */ -static status_t USDHC_WriteByDataPortBlocking(USDHC_Type *base, usdhc_data_t *data); - -/*! - * @brief Transfer data by polling way. - * - * @param base USDHC peripheral base address. - * @param data Data to be transferred. - * @param use DMA flag. - * @retval kStatus_Fail Transfer data failed. - * @retval kStatus_InvalidArgument Argument is invalid. - * @retval kStatus_Success Operate successfully. - */ -static status_t USDHC_TransferDataBlocking(USDHC_Type *base, usdhc_data_t *data, bool enDMA); - -/*! - * @brief wait command done - * - * @param base USDHC peripheral base address. - * @param command configuration - * @param pollingCmdDone polling command done flag - */ -static status_t USDHC_WaitCommandDone(USDHC_Type *base, usdhc_command_t *command, bool pollingCmdDone); - -/*! - * @brief Handle card detect interrupt. - * - * @param base USDHC peripheral base address. - * @param handle USDHC handle. - * @param interruptFlags Card detect related interrupt flags. - */ -static void USDHC_TransferHandleCardDetect(USDHC_Type *base, usdhc_handle_t *handle, uint32_t interruptFlags); - -/*! - * @brief Handle command interrupt. - * - * @param base USDHC peripheral base address. - * @param handle USDHC handle. - * @param interruptFlags Command related interrupt flags. - */ -static void USDHC_TransferHandleCommand(USDHC_Type *base, usdhc_handle_t *handle, uint32_t interruptFlags); - -/*! - * @brief Handle data interrupt. - * - * @param base USDHC peripheral base address. - * @param handle USDHC handle. - * @param interruptFlags Data related interrupt flags. - */ -static void USDHC_TransferHandleData(USDHC_Type *base, usdhc_handle_t *handle, uint32_t interruptFlags); - -/*! - * @brief Handle SDIO card interrupt signal. - * - * @param base USDHC peripheral base address. - * @param handle USDHC handle. - */ -static void USDHC_TransferHandleSdioInterrupt(USDHC_Type *base, usdhc_handle_t *handle); - -/*! - * @brief Handle SDIO block gap event. - * - * @param base USDHC peripheral base address. - * @param handle USDHC handle. - */ -static void USDHC_TransferHandleBlockGap(USDHC_Type *base, usdhc_handle_t *handle); - -#if defined(FSL_FEATURE_USDHC_HAS_SDR50_MODE) && (FSL_FEATURE_USDHC_HAS_SDR50_MODE) -/*! - * @brief Handle retuning - * - * @param base USDHC peripheral base address. - * @param handle USDHC handle. - * @param interrupt flags - */ -static void USDHC_TransferHandleReTuning(USDHC_Type *base, usdhc_handle_t *handle, uint32_t interruptFlags); -#endif -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief USDHC base pointer array */ -static USDHC_Type *const s_usdhcBase[] = USDHC_BASE_PTRS; - -/*! @brief USDHC internal handle pointer array */ -static usdhc_handle_t *s_usdhcHandle[ARRAY_SIZE(s_usdhcBase)] = {0}; - -/*! @brief USDHC IRQ name array */ -static const IRQn_Type s_usdhcIRQ[] = USDHC_IRQS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief USDHC clock array name */ -static const clock_ip_name_t s_usdhcClock[] = USDHC_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if (defined(FSL_FEATURE_USDHC_HAS_RESET) && FSL_FEATURE_USDHC_HAS_RESET) -/*! @brief Pointers to USDHC resets for each instance. */ -static const reset_ip_name_t s_usdhcResets[] = USDHC_RSTS; -#endif - -/* USDHC ISR for transactional APIs. */ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -static usdhc_isr_t s_usdhcIsr = (usdhc_isr_t)DefaultISR; -#else -static usdhc_isr_t s_usdhcIsr; -#endif -/*! @brief Dummy data buffer for mmc boot mode */ -AT_NONCACHEABLE_SECTION_ALIGN(static uint32_t s_usdhcBootDummy, USDHC_ADMA2_ADDRESS_ALIGN); - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t USDHC_GetInstance(USDHC_Type *base) -{ - uint8_t instance = 0; - - while ((instance < ARRAY_SIZE(s_usdhcBase)) && (s_usdhcBase[instance] != base)) - { - instance++; - } - - assert(instance < ARRAY_SIZE(s_usdhcBase)); - - return instance; -} - -static status_t USDHC_SetTransferConfig(USDHC_Type *base, uint32_t transferFlags, size_t blockSize, uint32_t blockCount) -{ - uint32_t mixCtrl = base->MIX_CTRL; - - if (((uint32_t)kUSDHC_CommandOnly & transferFlags) != 0U) - { - /* clear data flags */ - mixCtrl &= ~(USDHC_MIX_CTRL_MSBSEL_MASK | USDHC_MIX_CTRL_BCEN_MASK | USDHC_MIX_CTRL_DTDSEL_MASK | - USDHC_MIX_CTRL_AC12EN_MASK | USDHC_MIX_CTRL_AC23EN_MASK); - - if (IS_USDHC_FLAG_SET(base->PRES_STATE, kUSDHC_CommandInhibitFlag)) - { - return kStatus_USDHC_BusyTransferring; - } - } - else - { - /* if transfer boot continous, only need set the CREQ bit, leave others as it is */ - if ((transferFlags & (uint32_t)kUSDHC_BootDataContinuous) != 0U) - { - /* clear stop at block gap request */ - base->PROT_CTRL &= ~USDHC_PROT_CTRL_SABGREQ_MASK; - /* continous transfer data */ - base->PROT_CTRL |= USDHC_PROT_CTRL_CREQ_MASK; - return kStatus_Success; - } - - /* check data inhibit flag */ - if (IS_USDHC_FLAG_SET(base->PRES_STATE, kUSDHC_DataInhibitFlag)) - { - return kStatus_USDHC_BusyTransferring; - } - /* check transfer block count */ - if ((blockCount > USDHC_MAX_BLOCK_COUNT)) - { - return kStatus_InvalidArgument; - } - - /* config mix parameter */ - mixCtrl &= ~(USDHC_MIX_CTRL_MSBSEL_MASK | USDHC_MIX_CTRL_BCEN_MASK | USDHC_MIX_CTRL_DTDSEL_MASK | - USDHC_MIX_CTRL_AC12EN_MASK); - - if ((transferFlags & (uint32_t)kUSDHC_CommandAndRxData) != 0U) - { - mixCtrl |= USDHC_MIX_CTRL_DTDSEL_MASK; - } - - if (blockCount > 1U) - { - mixCtrl |= USDHC_MIX_CTRL_MSBSEL_MASK | USDHC_MIX_CTRL_BCEN_MASK; - /* auto command 12 */ - if ((transferFlags & (uint32_t)kUSDHC_DataWithAutoCmd12) != 0U) - { - mixCtrl |= USDHC_MIX_CTRL_AC12EN_MASK; - } - } - - /* auto command 23, auto send set block count cmd before multiple read/write */ - if ((transferFlags & (uint32_t)kUSDHC_DataWithAutoCmd23) != 0U) - { - mixCtrl |= USDHC_MIX_CTRL_AC23EN_MASK; - base->VEND_SPEC2 |= USDHC_VEND_SPEC2_ACMD23_ARGU2_EN_MASK; - /* config the block count to DS_ADDR */ - base->DS_ADDR = blockCount; - } - else - { - mixCtrl &= ~USDHC_MIX_CTRL_AC23EN_MASK; - base->VEND_SPEC2 &= ~USDHC_VEND_SPEC2_ACMD23_ARGU2_EN_MASK; - } - - /* if transfer boot data, leave the block count to USDHC_SetMmcBootConfig function */ - if ((transferFlags & (uint32_t)kUSDHC_BootData) == 0U) - { - /* config data block size/block count */ - base->BLK_ATT = ((base->BLK_ATT & ~(USDHC_BLK_ATT_BLKSIZE_MASK | USDHC_BLK_ATT_BLKCNT_MASK)) | - (USDHC_BLK_ATT_BLKSIZE(blockSize) | USDHC_BLK_ATT_BLKCNT(blockCount))); - } - else - { - mixCtrl |= USDHC_MIX_CTRL_MSBSEL_MASK | USDHC_MIX_CTRL_BCEN_MASK; - base->PROT_CTRL |= USDHC_PROT_CTRL_RD_DONE_NO_8CLK_MASK; - } - } - /* config the mix parameter */ - base->MIX_CTRL = mixCtrl; - - return kStatus_Success; -} - -void USDHC_SetDataConfig(USDHC_Type *base, - usdhc_transfer_direction_t dataDirection, - uint32_t blockCount, - uint32_t blockSize) -{ - assert(blockCount <= USDHC_MAX_BLOCK_COUNT); - - uint32_t mixCtrl = base->MIX_CTRL; - - /* block attribute configuration */ - base->BLK_ATT = ((base->BLK_ATT & ~(USDHC_BLK_ATT_BLKSIZE_MASK | USDHC_BLK_ATT_BLKCNT_MASK)) | - (USDHC_BLK_ATT_BLKSIZE(blockSize) | USDHC_BLK_ATT_BLKCNT(blockCount))); - - /* config mix parameter */ - mixCtrl &= ~(USDHC_MIX_CTRL_MSBSEL_MASK | USDHC_MIX_CTRL_BCEN_MASK | USDHC_MIX_CTRL_DTDSEL_MASK); - - mixCtrl |= USDHC_MIX_CTRL_DTDSEL(dataDirection) | (blockCount > 1U ? USDHC_MIX_CTRL_MSBSEL_MASK : 0U); - - base->MIX_CTRL = mixCtrl; -} - -static status_t USDHC_ReceiveCommandResponse(USDHC_Type *base, usdhc_command_t *command) -{ - assert(command != NULL); - - uint32_t response0 = base->CMD_RSP0; - uint32_t response1 = base->CMD_RSP1; - uint32_t response2 = base->CMD_RSP2; - - if (command->responseType != kCARD_ResponseTypeNone) - { - command->response[0U] = response0; - if (command->responseType == kCARD_ResponseTypeR2) - { - /* R3-R2-R1-R0(lowest 8 bit is invalid bit) has the same format as R2 format in SD specification document - after removed internal CRC7 and end bit. */ - command->response[0U] <<= 8U; - command->response[1U] = (response1 << 8U) | ((response0 & 0xFF000000U) >> 24U); - command->response[2U] = (response2 << 8U) | ((response1 & 0xFF000000U) >> 24U); - command->response[3U] = (base->CMD_RSP3 << 8U) | ((response2 & 0xFF000000U) >> 24U); - } - } - - /* check response error flag */ - if ((command->responseErrorFlags != 0U) && - ((command->responseType == kCARD_ResponseTypeR1) || (command->responseType == kCARD_ResponseTypeR1b) || - (command->responseType == kCARD_ResponseTypeR6) || (command->responseType == kCARD_ResponseTypeR5))) - { - if (((command->responseErrorFlags) & (command->response[0U])) != 0U) - { - return kStatus_USDHC_SendCommandFailed; - } - } - - return kStatus_Success; -} - -static uint32_t USDHC_ReadDataPort(USDHC_Type *base, usdhc_data_t *data, uint32_t transferredWords) -{ - uint32_t i; - uint32_t totalWords; - uint32_t wordsCanBeRead; /* The words can be read at this time. */ - uint32_t readWatermark = ((base->WTMK_LVL & USDHC_WTMK_LVL_RD_WML_MASK) >> USDHC_WTMK_LVL_RD_WML_SHIFT); - - /* If DMA is enable, do not need to polling data port */ - if ((base->MIX_CTRL & USDHC_MIX_CTRL_DMAEN_MASK) == 0U) - { - /* - * Add non aligned access support ,user need make sure your buffer size is big - * enough to hold the data,in other words,user need make sure the buffer size - * is 4 byte aligned - */ - if (data->blockSize % sizeof(uint32_t) != 0U) - { - data->blockSize += - sizeof(uint32_t) - (data->blockSize % sizeof(uint32_t)); /* make the block size as word-aligned */ - } - - totalWords = ((data->blockCount * data->blockSize) / sizeof(uint32_t)); - - /* If watermark level is equal or bigger than totalWords, transfers totalWords data. */ - if (readWatermark >= totalWords) - { - wordsCanBeRead = totalWords; - } - /* If watermark level is less than totalWords and left words to be sent is equal or bigger than readWatermark, - transfers watermark level words. */ - else if ((readWatermark < totalWords) && ((totalWords - transferredWords) >= readWatermark)) - { - wordsCanBeRead = readWatermark; - } - /* If watermark level is less than totalWords and left words to be sent is less than readWatermark, transfers - left - words. */ - else - { - wordsCanBeRead = (totalWords - transferredWords); - } - - i = 0U; - while (i < wordsCanBeRead) - { - data->rxData[transferredWords++] = USDHC_ReadData(base); - i++; - } - } - - return transferredWords; -} - -static status_t USDHC_ReadByDataPortBlocking(USDHC_Type *base, usdhc_data_t *data) -{ - uint32_t totalWords; - uint32_t transferredWords = 0U, interruptStatus = 0U; - status_t error = kStatus_Success; - - /* - * Add non aligned access support ,user need make sure your buffer size is big - * enough to hold the data,in other words,user need make sure the buffer size - * is 4 byte aligned - */ - if (data->blockSize % sizeof(uint32_t) != 0U) - { - data->blockSize += - sizeof(uint32_t) - (data->blockSize % sizeof(uint32_t)); /* make the block size as word-aligned */ - } - - totalWords = ((data->blockCount * data->blockSize) / sizeof(uint32_t)); - - while ((error == kStatus_Success) && (transferredWords < totalWords)) - { - while ( - !(IS_USDHC_FLAG_SET(interruptStatus, ((uint32_t)kUSDHC_BufferReadReadyFlag | - (uint32_t)kUSDHC_DataErrorFlag | (uint32_t)kUSDHC_TuningErrorFlag)))) - { - interruptStatus = USDHC_GetInterruptStatusFlags(base); - } - - /* during std tuning process, software do not need to read data, but wait BRR is enough */ - if ((data->dataType == (uint32_t)kUSDHC_TransferDataTuning) && - (IS_USDHC_FLAG_SET(interruptStatus, kUSDHC_BufferReadReadyFlag))) - { - USDHC_ClearInterruptStatusFlags(base, kUSDHC_BufferReadReadyFlag); - - return kStatus_Success; - } -#if defined(FSL_FEATURE_USDHC_HAS_SDR50_MODE) && (FSL_FEATURE_USDHC_HAS_SDR50_MODE) - else if (IS_USDHC_FLAG_SET(interruptStatus, kUSDHC_TuningErrorFlag)) - { - USDHC_ClearInterruptStatusFlags(base, kUSDHC_TuningErrorFlag); - /* if tuning error occur ,return directly */ - error = kStatus_USDHC_TuningError; - } -#endif - else if (IS_USDHC_FLAG_SET(interruptStatus, kUSDHC_DataErrorFlag)) - { - if (!(data->enableIgnoreError)) - { - error = kStatus_Fail; - } - /* clear data error flag */ - USDHC_ClearInterruptStatusFlags(base, kUSDHC_DataErrorFlag); - } - else - { - /* Intentional empty */ - } - - if (error == kStatus_Success) - { - transferredWords = USDHC_ReadDataPort(base, data, transferredWords); - /* clear buffer read ready */ - USDHC_ClearInterruptStatusFlags(base, kUSDHC_BufferReadReadyFlag); - interruptStatus = 0U; - } - } - - /* Clear data complete flag after the last read operation. */ - USDHC_ClearInterruptStatusFlags(base, kUSDHC_DataCompleteFlag); - - return error; -} - -static uint32_t USDHC_WriteDataPort(USDHC_Type *base, usdhc_data_t *data, uint32_t transferredWords) -{ - uint32_t i; - uint32_t totalWords; - uint32_t wordsCanBeWrote; /* Words can be wrote at this time. */ - uint32_t writeWatermark = ((base->WTMK_LVL & USDHC_WTMK_LVL_WR_WML_MASK) >> USDHC_WTMK_LVL_WR_WML_SHIFT); - - /* If DMA is enable, do not need to polling data port */ - if ((base->MIX_CTRL & USDHC_MIX_CTRL_DMAEN_MASK) == 0U) - { - /* - * Add non aligned access support ,user need make sure your buffer size is big - * enough to hold the data,in other words,user need make sure the buffer size - * is 4 byte aligned - */ - if (data->blockSize % sizeof(uint32_t) != 0U) - { - data->blockSize += - sizeof(uint32_t) - (data->blockSize % sizeof(uint32_t)); /* make the block size as word-aligned */ - } - - totalWords = ((data->blockCount * data->blockSize) / sizeof(uint32_t)); - - /* If watermark level is equal or bigger than totalWords, transfers totalWords data.*/ - if (writeWatermark >= totalWords) - { - wordsCanBeWrote = totalWords; - } - /* If watermark level is less than totalWords and left words to be sent is equal or bigger than watermark, - transfers watermark level words. */ - else if ((writeWatermark < totalWords) && ((totalWords - transferredWords) >= writeWatermark)) - { - wordsCanBeWrote = writeWatermark; - } - /* If watermark level is less than totalWords and left words to be sent is less than watermark, transfers left - words. */ - else - { - wordsCanBeWrote = (totalWords - transferredWords); - } - - i = 0U; - while (i < wordsCanBeWrote) - { - USDHC_WriteData(base, data->txData[transferredWords++]); - i++; - } - } - - return transferredWords; -} - -static status_t USDHC_WriteByDataPortBlocking(USDHC_Type *base, usdhc_data_t *data) -{ - uint32_t totalWords; - - uint32_t transferredWords = 0U, interruptStatus = 0U; - status_t error = kStatus_Success; - - /* - * Add non aligned access support ,user need make sure your buffer size is big - * enough to hold the data,in other words,user need make sure the buffer size - * is 4 byte aligned - */ - if (data->blockSize % sizeof(uint32_t) != 0U) - { - data->blockSize += - sizeof(uint32_t) - (data->blockSize % sizeof(uint32_t)); /* make the block size as word-aligned */ - } - - totalWords = (data->blockCount * data->blockSize) / sizeof(uint32_t); - - while ((error == kStatus_Success) && (transferredWords < totalWords)) - { - while (!(IS_USDHC_FLAG_SET(interruptStatus, (uint32_t)kUSDHC_BufferWriteReadyFlag | - (uint32_t)kUSDHC_DataErrorFlag | - (uint32_t)kUSDHC_TuningErrorFlag))) - { - interruptStatus = USDHC_GetInterruptStatusFlags(base); - } -#if defined(FSL_FEATURE_USDHC_HAS_SDR50_MODE) && (FSL_FEATURE_USDHC_HAS_SDR50_MODE) - if (IS_USDHC_FLAG_SET(interruptStatus, kUSDHC_TuningErrorFlag)) - { - USDHC_ClearInterruptStatusFlags(base, kUSDHC_TuningErrorFlag); - /* if tuning error occur ,return directly */ - return kStatus_USDHC_TuningError; - } - else -#endif - if (IS_USDHC_FLAG_SET(interruptStatus, kUSDHC_DataErrorFlag)) - { - if (!(data->enableIgnoreError)) - { - error = kStatus_Fail; - } - /* clear data error flag */ - USDHC_ClearInterruptStatusFlags(base, kUSDHC_DataErrorFlag); - } - else - { - /* Intentional empty */ - } - - if (error == kStatus_Success) - { - transferredWords = USDHC_WriteDataPort(base, data, transferredWords); - /* clear buffer write ready */ - USDHC_ClearInterruptStatusFlags(base, kUSDHC_BufferWriteReadyFlag); - interruptStatus = 0U; - } - } - - /* Wait write data complete or data transfer error after the last writing operation. */ - while (!(IS_USDHC_FLAG_SET(interruptStatus, (uint32_t)kUSDHC_DataCompleteFlag | (uint32_t)kUSDHC_DataErrorFlag))) - { - interruptStatus = USDHC_GetInterruptStatusFlags(base); - } - - if ((interruptStatus & (uint32_t)kUSDHC_DataErrorFlag) != 0UL) - { - if (!(data->enableIgnoreError)) - { - error = kStatus_Fail; - } - } - USDHC_ClearInterruptStatusFlags(base, ((uint32_t)kUSDHC_DataCompleteFlag | (uint32_t)kUSDHC_DataErrorFlag)); - - return error; -} - -/*! - * brief send command function - * - * param base USDHC peripheral base address. - * param command configuration - */ -void USDHC_SendCommand(USDHC_Type *base, usdhc_command_t *command) -{ - assert(NULL != command); - - uint32_t xferType = base->CMD_XFR_TYP, flags = command->flags; - - if (((base->PRES_STATE & (uint32_t)kUSDHC_CommandInhibitFlag) == 0U) && (command->type != kCARD_CommandTypeEmpty)) - { - if ((command->responseType == kCARD_ResponseTypeR1) || (command->responseType == kCARD_ResponseTypeR5) || - (command->responseType == kCARD_ResponseTypeR6) || (command->responseType == kCARD_ResponseTypeR7)) - { - flags |= ((uint32_t)kUSDHC_ResponseLength48Flag | (uint32_t)kUSDHC_EnableCrcCheckFlag | - (uint32_t)kUSDHC_EnableIndexCheckFlag); - } - else if ((command->responseType == kCARD_ResponseTypeR1b) || (command->responseType == kCARD_ResponseTypeR5b)) - { - flags |= ((uint32_t)kUSDHC_ResponseLength48BusyFlag | (uint32_t)kUSDHC_EnableCrcCheckFlag | - (uint32_t)kUSDHC_EnableIndexCheckFlag); - } - else if (command->responseType == kCARD_ResponseTypeR2) - { - flags |= ((uint32_t)kUSDHC_ResponseLength136Flag | (uint32_t)kUSDHC_EnableCrcCheckFlag); - } - else if ((command->responseType == kCARD_ResponseTypeR3) || (command->responseType == kCARD_ResponseTypeR4)) - { - flags |= ((uint32_t)kUSDHC_ResponseLength48Flag); - } - else - { - /* Intentional empty */ - } - - if (command->type == kCARD_CommandTypeAbort) - { - flags |= (uint32_t)kUSDHC_CommandTypeAbortFlag; - } - - /* config cmd index */ - xferType &= ~(USDHC_CMD_XFR_TYP_CMDINX_MASK | USDHC_CMD_XFR_TYP_CMDTYP_MASK | USDHC_CMD_XFR_TYP_CICEN_MASK | - USDHC_CMD_XFR_TYP_CCCEN_MASK | USDHC_CMD_XFR_TYP_RSPTYP_MASK | USDHC_CMD_XFR_TYP_DPSEL_MASK); - - xferType |= - (((command->index << USDHC_CMD_XFR_TYP_CMDINX_SHIFT) & USDHC_CMD_XFR_TYP_CMDINX_MASK) | - ((flags) & (USDHC_CMD_XFR_TYP_CMDTYP_MASK | USDHC_CMD_XFR_TYP_CICEN_MASK | USDHC_CMD_XFR_TYP_CCCEN_MASK | - USDHC_CMD_XFR_TYP_RSPTYP_MASK | USDHC_CMD_XFR_TYP_DPSEL_MASK))); - - /* config the command xfertype and argument */ - base->CMD_ARG = command->argument; - base->CMD_XFR_TYP = xferType; - } - - if (command->type == kCARD_CommandTypeEmpty) - { - /* disable CMD done interrupt for empty command */ - base->INT_SIGNAL_EN &= ~USDHC_INT_SIGNAL_EN_CCIEN_MASK; - } -} - -static status_t USDHC_WaitCommandDone(USDHC_Type *base, usdhc_command_t *command, bool pollingCmdDone) -{ - assert(NULL != command); - - status_t error = kStatus_Success; - uint32_t interruptStatus = 0U; - /* check if need polling command done or not */ - if (pollingCmdDone) - { - /* Wait command complete or USDHC encounters error. */ - while (!(IS_USDHC_FLAG_SET(interruptStatus, kUSDHC_CommandFlag))) - { - interruptStatus = USDHC_GetInterruptStatusFlags(base); - } - - if ((interruptStatus & (uint32_t)kUSDHC_CommandErrorFlag) != 0UL) - { - error = kStatus_Fail; - } - - /* Receive response when command completes successfully. */ - if (error == kStatus_Success) - { - error = USDHC_ReceiveCommandResponse(base, command); - } - - USDHC_ClearInterruptStatusFlags(base, kUSDHC_CommandFlag); - } - - return error; -} - -static status_t USDHC_TransferDataBlocking(USDHC_Type *base, usdhc_data_t *data, bool enDMA) -{ - status_t error = kStatus_Success; - uint32_t interruptStatus = 0U; - - if (enDMA) - { - /* Wait data complete or USDHC encounters error. */ - while (!(IS_USDHC_FLAG_SET(interruptStatus, ((uint32_t)kUSDHC_DataDMAFlag | (uint32_t)kUSDHC_TuningErrorFlag)))) - { - interruptStatus = USDHC_GetInterruptStatusFlags(base); - } - -#if defined(FSL_FEATURE_USDHC_HAS_SDR50_MODE) && (FSL_FEATURE_USDHC_HAS_SDR50_MODE) - if (IS_USDHC_FLAG_SET(interruptStatus, kUSDHC_TuningErrorFlag)) - { - error = kStatus_USDHC_TuningError; - } - else -#endif - if (IS_USDHC_FLAG_SET(interruptStatus, ((uint32_t)kUSDHC_DataErrorFlag | (uint32_t)kUSDHC_DmaErrorFlag))) - { - if ((!(data->enableIgnoreError)) || (IS_USDHC_FLAG_SET(interruptStatus, kUSDHC_DataTimeoutFlag))) - { - error = kStatus_USDHC_TransferDataFailed; - } - } - else - { - /* Intentional empty */ - } - /* load dummy data */ - if ((data->dataType == (uint32_t)kUSDHC_TransferDataBootcontinous) && (error == kStatus_Success)) - { - *(data->rxData) = s_usdhcBootDummy; - } - - USDHC_ClearInterruptStatusFlags(base, ((uint32_t)kUSDHC_DataDMAFlag | (uint32_t)kUSDHC_TuningErrorFlag)); - } - else - { - if (data->rxData != NULL) - { - error = USDHC_ReadByDataPortBlocking(base, data); - if (error != kStatus_Success) - { - return error; - } - } - else - { - error = USDHC_WriteByDataPortBlocking(base, data); - if (error != kStatus_Success) - { - return error; - } - } - } - - return error; -} - -/*! - * brief USDHC module initialization function. - * - * Configures the USDHC according to the user configuration. - * - * Example: - code - usdhc_config_t config; - config.cardDetectDat3 = false; - config.endianMode = kUSDHC_EndianModeLittle; - config.dmaMode = kUSDHC_DmaModeAdma2; - config.readWatermarkLevel = 128U; - config.writeWatermarkLevel = 128U; - USDHC_Init(USDHC, &config); - endcode - * - * param base USDHC peripheral base address. - * param config USDHC configuration information. - * retval kStatus_Success Operate successfully. - */ -void USDHC_Init(USDHC_Type *base, const usdhc_config_t *config) -{ - assert(config != NULL); - assert((config->writeWatermarkLevel >= 1U) && (config->writeWatermarkLevel <= 128U)); - assert((config->readWatermarkLevel >= 1U) && (config->readWatermarkLevel <= 128U)); -#if !(defined(FSL_FEATURE_USDHC_HAS_NO_RW_BURST_LEN) && FSL_FEATURE_USDHC_HAS_NO_RW_BURST_LEN) - assert(config->writeBurstLen <= 16U); -#endif - uint32_t proctl, sysctl, wml; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable USDHC clock. */ - CLOCK_EnableClock(s_usdhcClock[USDHC_GetInstance(base)]); -#endif - -#if (defined(FSL_FEATURE_USDHC_HAS_RESET) && FSL_FEATURE_USDHC_HAS_RESET) - /* Reset the USDHC module */ - RESET_PeripheralReset(s_usdhcResets[USDHC_GetInstance(base)]); -#endif - - /* Reset ALL USDHC. */ - base->SYS_CTRL |= USDHC_SYS_CTRL_RSTA_MASK | USDHC_SYS_CTRL_RSTC_MASK | USDHC_SYS_CTRL_RSTD_MASK; - - proctl = base->PROT_CTRL; - wml = base->WTMK_LVL; - sysctl = base->SYS_CTRL; - - proctl &= ~(USDHC_PROT_CTRL_EMODE_MASK | USDHC_PROT_CTRL_DMASEL_MASK); - /* Endian mode*/ - proctl |= USDHC_PROT_CTRL_EMODE(config->endianMode); - -#if (defined(FSL_FEATURE_USDHC_HAS_NO_RW_BURST_LEN) && FSL_FEATURE_USDHC_HAS_NO_RW_BURST_LEN) - /* Watermark level */ - wml &= ~(USDHC_WTMK_LVL_RD_WML_MASK | USDHC_WTMK_LVL_WR_WML_MASK); - wml |= (USDHC_WTMK_LVL_RD_WML(config->readWatermarkLevel) | USDHC_WTMK_LVL_WR_WML(config->writeWatermarkLevel)); -#else - /* Watermark level */ - wml &= ~(USDHC_WTMK_LVL_RD_WML_MASK | USDHC_WTMK_LVL_WR_WML_MASK | USDHC_WTMK_LVL_RD_BRST_LEN_MASK | - USDHC_WTMK_LVL_WR_BRST_LEN_MASK); - wml |= (USDHC_WTMK_LVL_RD_WML(config->readWatermarkLevel) | USDHC_WTMK_LVL_WR_WML(config->writeWatermarkLevel) | - USDHC_WTMK_LVL_RD_BRST_LEN(config->readBurstLen) | USDHC_WTMK_LVL_WR_BRST_LEN(config->writeBurstLen)); -#endif - - /* config the data timeout value */ - sysctl &= ~USDHC_SYS_CTRL_DTOCV_MASK; - sysctl |= USDHC_SYS_CTRL_DTOCV(config->dataTimeout); - - base->SYS_CTRL = sysctl; - base->WTMK_LVL = wml; - base->PROT_CTRL = proctl; - -#if FSL_FEATURE_USDHC_HAS_EXT_DMA - /* disable external DMA */ - base->VEND_SPEC &= ~USDHC_VEND_SPEC_EXT_DMA_EN_MASK; -#endif - /* disable internal DMA and DDR mode */ - base->MIX_CTRL &= ~(USDHC_MIX_CTRL_DMAEN_MASK | USDHC_MIX_CTRL_DDR_EN_MASK); - /* disable interrupt, enable all the interrupt status, clear status. */ - base->INT_STATUS_EN = kUSDHC_AllInterruptFlags; - base->INT_SIGNAL_EN = 0UL; - base->INT_STATUS = kUSDHC_AllInterruptFlags; -} - -/*! - * brief Deinitializes the USDHC. - * - * param base USDHC peripheral base address. - */ -void USDHC_Deinit(USDHC_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable clock. */ - CLOCK_DisableClock(s_usdhcClock[USDHC_GetInstance(base)]); -#endif -} - -/*! - * brief Resets the USDHC. - * - * param base USDHC peripheral base address. - * param mask The reset type mask(_usdhc_reset). - * param timeout Timeout for reset. - * retval true Reset successfully. - * retval false Reset failed. - */ -bool USDHC_Reset(USDHC_Type *base, uint32_t mask, uint32_t timeout) -{ - base->SYS_CTRL |= (mask & (USDHC_SYS_CTRL_RSTA_MASK | USDHC_SYS_CTRL_RSTC_MASK | USDHC_SYS_CTRL_RSTD_MASK -#if defined(FSL_FEATURE_USDHC_HAS_SDR50_MODE) && (FSL_FEATURE_USDHC_HAS_SDR50_MODE) - | USDHC_SYS_CTRL_RSTT_MASK -#endif - )); - /* Delay some time to wait reset success. */ - while (IS_USDHC_FLAG_SET(base->SYS_CTRL, mask)) - { - if (timeout == 0UL) - { - break; - } - timeout--; - } - - return ((0UL == timeout) ? false : true); -} - -/*! - * brief Gets the capability information. - * - * param base USDHC peripheral base address. - * param capability Structure to save capability information. - */ -void USDHC_GetCapability(USDHC_Type *base, usdhc_capability_t *capability) -{ - assert(capability != NULL); - - uint32_t htCapability; - uint32_t maxBlockLength; - - htCapability = base->HOST_CTRL_CAP; - - /* Get the capability of USDHC. */ - maxBlockLength = ((htCapability & USDHC_HOST_CTRL_CAP_MBL_MASK) >> USDHC_HOST_CTRL_CAP_MBL_SHIFT); - capability->maxBlockLength = (512UL << maxBlockLength); - /* Other attributes not in HTCAPBLT register. */ - capability->maxBlockCount = USDHC_MAX_BLOCK_COUNT; - capability->flags = - (htCapability & (USDHC_HOST_CTRL_CAP_ADMAS_MASK | USDHC_HOST_CTRL_CAP_HSS_MASK | USDHC_HOST_CTRL_CAP_DMAS_MASK | - USDHC_HOST_CTRL_CAP_SRS_MASK | USDHC_HOST_CTRL_CAP_VS33_MASK)); - capability->flags |= htCapability & USDHC_HOST_CTRL_CAP_VS30_MASK; -#if !(defined(FSL_FEATURE_USDHC_HAS_NO_VS18) && FSL_FEATURE_USDHC_HAS_NO_VS18) - capability->flags |= htCapability & USDHC_HOST_CTRL_CAP_VS18_MASK; -#endif - capability->flags |= htCapability & USDHC_HOST_CTRL_CAP_DDR50_SUPPORT_MASK; -#if defined(FSL_FEATURE_USDHC_HAS_SDR104_MODE) && FSL_FEATURE_USDHC_HAS_SDR104_MODE - capability->flags |= USDHC_HOST_CTRL_CAP_SDR104_SUPPORT_MASK; -#endif - -#if defined(FSL_FEATURE_USDHC_HAS_SDR104_MODE) && FSL_FEATURE_USDHC_HAS_SDR50_MODE - capability->flags |= USDHC_HOST_CTRL_CAP_SDR50_SUPPORT_MASK; -#endif - /* USDHC support 4/8 bit data bus width. */ - capability->flags |= (USDHC_HOST_CTRL_CAP_MBL_SHIFT << 0UL) | (USDHC_HOST_CTRL_CAP_MBL_SHIFT << 1UL); -} - -/*! - * brief Sets the SD bus clock frequency. - * - * param base USDHC peripheral base address. - * param srcClock_Hz USDHC source clock frequency united in Hz. - * param busClock_Hz SD bus clock frequency united in Hz. - * - * return The nearest frequency of busClock_Hz configured to SD bus. - */ -uint32_t USDHC_SetSdClock(USDHC_Type *base, uint32_t srcClock_Hz, uint32_t busClock_Hz) -{ - assert(srcClock_Hz != 0U); - assert(busClock_Hz != 0U); - - uint32_t totalDiv = 0UL; - uint32_t divisor = 0UL; - uint32_t prescaler = 0UL; - uint32_t sysctl = 0UL; - uint32_t nearestFrequency = 0UL; - - if (busClock_Hz > srcClock_Hz) - { - busClock_Hz = srcClock_Hz; - } - - totalDiv = srcClock_Hz / busClock_Hz; - - /* calucate total divisor first */ - if (totalDiv > (USDHC_MAX_CLKFS * USDHC_MAX_DVS)) - { - return 0UL; - } - - if (totalDiv != 0UL) - { - /* calucate the divisor (srcClock_Hz / divisor) <= busClock_Hz */ - if ((srcClock_Hz / totalDiv) > busClock_Hz) - { - totalDiv++; - } - - /* divide the total divisor to div and prescaler */ - if (totalDiv > USDHC_MAX_DVS) - { - prescaler = totalDiv / USDHC_MAX_DVS; - /* prescaler must be a value which equal 2^n and smaller than SDHC_MAX_CLKFS */ - while (((USDHC_MAX_CLKFS % prescaler) != 0UL) || (prescaler == 1UL)) - { - prescaler++; - } - /* calucate the divisor */ - divisor = totalDiv / prescaler; - /* fine tuning the divisor until divisor * prescaler >= totalDiv */ - while ((divisor * prescaler) < totalDiv) - { - divisor++; - if (divisor > USDHC_MAX_DVS) - { - prescaler <<= 1UL; - if (prescaler > USDHC_MAX_CLKFS) - { - return 0UL; - } - divisor = totalDiv / prescaler; - } - } - } - else - { - /* in this situation , divsior and SDCLKFS can generate same clock - use SDCLKFS*/ - if (((totalDiv % 2UL) != 0UL) && (totalDiv != 1UL)) - { - divisor = totalDiv; - prescaler = 1UL; - } - else - { - divisor = 1UL; - prescaler = totalDiv; - } - } - nearestFrequency = srcClock_Hz / (divisor == 0UL ? 1UL : divisor) / prescaler; - } - /* in this condition , srcClock_Hz = busClock_Hz, */ - else - { - /* in DDR mode , set SDCLKFS to 0, divisor = 0, actually the - totoal divider = 2U */ - divisor = 0UL; - prescaler = 0UL; - nearestFrequency = srcClock_Hz; - } - - /* calucate the value write to register */ - if (divisor != 0UL) - { - USDHC_PREV_DVS(divisor); - } - /* calucate the value write to register */ - if (prescaler != 0UL) - { - USDHC_PREV_CLKFS(prescaler, 1UL); - } - - /* Set the SD clock frequency divisor, SD clock frequency select, data timeout counter value. */ - sysctl = base->SYS_CTRL; - sysctl &= ~(USDHC_SYS_CTRL_DVS_MASK | USDHC_SYS_CTRL_SDCLKFS_MASK); - sysctl |= (USDHC_SYS_CTRL_DVS(divisor) | USDHC_SYS_CTRL_SDCLKFS(prescaler)); - base->SYS_CTRL = sysctl; - - /* Wait until the SD clock is stable. */ - while (!IS_USDHC_FLAG_SET(base->PRES_STATE, USDHC_PRES_STATE_SDSTB_MASK)) - { - } - - return nearestFrequency; -} - -/*! - * brief Sends 80 clocks to the card to set it to the active state. - * - * This function must be called each time the card is inserted to ensure that the card can receive the command - * correctly. - * - * param base USDHC peripheral base address. - * param timeout Timeout to initialize card. - * retval true Set card active successfully. - * retval false Set card active failed. - */ -bool USDHC_SetCardActive(USDHC_Type *base, uint32_t timeout) -{ - base->SYS_CTRL |= USDHC_SYS_CTRL_INITA_MASK; - /* Delay some time to wait card become active state. */ - while (IS_USDHC_FLAG_SET(base->SYS_CTRL, USDHC_SYS_CTRL_INITA_MASK)) - { - if (0UL == timeout) - { - break; - } - timeout--; - } - - return ((0UL == timeout) ? false : true); -} - -/*! - * brief the enable/disable DDR mode - * - * param base USDHC peripheral base address. - * param enable/disable flag - * param nibble position - */ -void USDHC_EnableDDRMode(USDHC_Type *base, bool enable, uint32_t nibblePos) -{ - uint32_t prescaler = (base->SYS_CTRL & USDHC_SYS_CTRL_SDCLKFS_MASK) >> USDHC_SYS_CTRL_SDCLKFS_SHIFT; - - if (enable) - { - base->MIX_CTRL &= ~USDHC_MIX_CTRL_NIBBLE_POS_MASK; - base->MIX_CTRL |= (USDHC_MIX_CTRL_DDR_EN_MASK | USDHC_MIX_CTRL_NIBBLE_POS(nibblePos)); - prescaler >>= 1UL; - } - else - { - base->MIX_CTRL &= ~USDHC_MIX_CTRL_DDR_EN_MASK; - - if (prescaler == 0UL) - { - prescaler += 1UL; - } - else - { - prescaler <<= 1UL; - } - } - - base->SYS_CTRL = (base->SYS_CTRL & (~USDHC_SYS_CTRL_SDCLKFS_MASK)) | USDHC_SYS_CTRL_SDCLKFS(prescaler); -} - -/*! - * brief Configures the MMC boot feature. - * - * Example: - code - usdhc_boot_config_t config; - config.ackTimeoutCount = 4; - config.bootMode = kUSDHC_BootModeNormal; - config.blockCount = 5; - config.enableBootAck = true; - config.enableBoot = true; - config.enableAutoStopAtBlockGap = true; - USDHC_SetMmcBootConfig(USDHC, &config); - endcode - * - * param base USDHC peripheral base address. - * param config The MMC boot configuration information. - */ -void USDHC_SetMmcBootConfig(USDHC_Type *base, const usdhc_boot_config_t *config) -{ - assert(config != NULL); - assert(config->ackTimeoutCount <= (USDHC_MMC_BOOT_DTOCV_ACK_MASK >> USDHC_MMC_BOOT_DTOCV_ACK_SHIFT)); - assert(config->blockCount <= (USDHC_MMC_BOOT_BOOT_BLK_CNT_MASK >> USDHC_MMC_BOOT_BOOT_BLK_CNT_SHIFT)); - - uint32_t mmcboot = base->MMC_BOOT; - - mmcboot &= ~(USDHC_MMC_BOOT_DTOCV_ACK_MASK | USDHC_MMC_BOOT_BOOT_MODE_MASK | USDHC_MMC_BOOT_BOOT_BLK_CNT_MASK); - mmcboot |= USDHC_MMC_BOOT_DTOCV_ACK(config->ackTimeoutCount) | USDHC_MMC_BOOT_BOOT_MODE(config->bootMode); - - if (config->enableBootAck) - { - mmcboot |= USDHC_MMC_BOOT_BOOT_ACK_MASK; - } - if (config->enableAutoStopAtBlockGap) - { - mmcboot |= - USDHC_MMC_BOOT_AUTO_SABG_EN_MASK | USDHC_MMC_BOOT_BOOT_BLK_CNT(USDHC_MAX_BLOCK_COUNT - config->blockCount); - /* always set the block count to USDHC_MAX_BLOCK_COUNT to use auto stop at block gap feature */ - base->BLK_ATT = ((base->BLK_ATT & ~(USDHC_BLK_ATT_BLKSIZE_MASK | USDHC_BLK_ATT_BLKCNT_MASK)) | - (USDHC_BLK_ATT_BLKSIZE(config->blockSize) | USDHC_BLK_ATT_BLKCNT(USDHC_MAX_BLOCK_COUNT))); - } - else - { - base->BLK_ATT = ((base->BLK_ATT & ~(USDHC_BLK_ATT_BLKSIZE_MASK | USDHC_BLK_ATT_BLKCNT_MASK)) | - (USDHC_BLK_ATT_BLKSIZE(config->blockSize) | USDHC_BLK_ATT_BLKCNT(config->blockCount))); - } - - base->MMC_BOOT = mmcboot; -} - -/*! - * brief Sets the ADMA1 descriptor table configuration. - * - * param admaTable Adma table address. - * param admaTableWords Adma table length. - * param dataBufferAddr Data buffer address. - * param dataBytes Data length. - * param flags ADAM descriptor flag, used to indicate to create multiple or single descriptor, please - * reference _usdhc_adma_flag. - * retval kStatus_OutOfRange ADMA descriptor table length isn't enough to describe data. - * retval kStatus_Success Operate successfully. - */ -status_t USDHC_SetADMA1Descriptor( - uint32_t *admaTable, uint32_t admaTableWords, const uint32_t *dataBufferAddr, uint32_t dataBytes, uint32_t flags) -{ - assert(NULL != admaTable); - assert(NULL != dataBufferAddr); - - uint32_t miniEntries, startEntries = 0UL, - maxEntries = (admaTableWords * sizeof(uint32_t)) / sizeof(usdhc_adma1_descriptor_t); - usdhc_adma1_descriptor_t *adma1EntryAddress = (usdhc_adma1_descriptor_t *)(uint32_t)(admaTable); - uint32_t i, dmaBufferLen = 0UL; - const uint32_t *data = dataBufferAddr; - - if (((uint32_t)data % USDHC_ADMA1_ADDRESS_ALIGN) != 0UL) - { - return kStatus_USDHC_DMADataAddrNotAlign; - } - - if (flags == (uint32_t)kUSDHC_AdmaDescriptorMultipleFlag) - { - return kStatus_USDHC_NotSupport; - } - /* - * Add non aligned access support ,user need make sure your buffer size is big - * enough to hold the data,in other words,user need make sure the buffer size - * is 4 byte aligned - */ - if (dataBytes % sizeof(uint32_t) != 0UL) - { - /* make the data length as word-aligned */ - dataBytes += sizeof(uint32_t) - (dataBytes % sizeof(uint32_t)); - } - - /* Check if ADMA descriptor's number is enough. */ - if ((dataBytes % USDHC_ADMA1_DESCRIPTOR_MAX_LENGTH_PER_ENTRY) == 0UL) - { - miniEntries = dataBytes / USDHC_ADMA1_DESCRIPTOR_MAX_LENGTH_PER_ENTRY; - } - else - { - miniEntries = ((dataBytes / USDHC_ADMA1_DESCRIPTOR_MAX_LENGTH_PER_ENTRY) + 1UL); - } - - /* ADMA1 needs two descriptors to finish a transfer */ - miniEntries <<= 1UL; - - if (miniEntries + startEntries > maxEntries) - { - return kStatus_OutOfRange; - } - - for (i = startEntries; i < (miniEntries + startEntries); i += 2UL) - { - if (dataBytes > USDHC_ADMA1_DESCRIPTOR_MAX_LENGTH_PER_ENTRY) - { - dmaBufferLen = USDHC_ADMA1_DESCRIPTOR_MAX_LENGTH_PER_ENTRY; - } - else - { - dmaBufferLen = dataBytes; - } - - adma1EntryAddress[i] = (dmaBufferLen << USDHC_ADMA1_DESCRIPTOR_LENGTH_SHIFT); - adma1EntryAddress[i] |= (uint32_t)kUSDHC_Adma1DescriptorTypeSetLength; - adma1EntryAddress[i + 1UL] = (uint32_t)(data); - adma1EntryAddress[i + 1UL] |= - (uint32_t)kUSDHC_Adma1DescriptorTypeTransfer | (uint32_t)kUSDHC_Adma1DescriptorInterrupFlag; - data = (uint32_t *)((uint32_t)data + dmaBufferLen); - dataBytes -= dmaBufferLen; - } - /* the end of the descriptor */ - adma1EntryAddress[i - 1UL] |= (uint32_t)kUSDHC_Adma1DescriptorEndFlag; - - return kStatus_Success; -} - -/*! - * brief Sets the ADMA2 descriptor table configuration. - * - * param admaTable Adma table address. - * param admaTableWords Adma table length. - * param dataBufferAddr Data buffer address. - * param dataBytes Data Data length. - * param flags ADAM descriptor flag, used to indicate to create multiple or single descriptor, please - * reference _usdhc_adma_flag. - * retval kStatus_OutOfRange ADMA descriptor table length isn't enough to describe data. - * retval kStatus_Success Operate successfully. - */ -status_t USDHC_SetADMA2Descriptor( - uint32_t *admaTable, uint32_t admaTableWords, const uint32_t *dataBufferAddr, uint32_t dataBytes, uint32_t flags) -{ - assert(NULL != admaTable); - assert(NULL != dataBufferAddr); - - uint32_t miniEntries, startEntries = 0UL, - maxEntries = (admaTableWords * sizeof(uint32_t)) / sizeof(usdhc_adma2_descriptor_t); - usdhc_adma2_descriptor_t *adma2EntryAddress = (usdhc_adma2_descriptor_t *)(uint32_t)(admaTable); - uint32_t i, dmaBufferLen = 0UL; - const uint32_t *data = dataBufferAddr; - - if (((uint32_t)data % USDHC_ADMA2_ADDRESS_ALIGN) != 0UL) - { - return kStatus_USDHC_DMADataAddrNotAlign; - } - /* - * Add non aligned access support ,user need make sure your buffer size is big - * enough to hold the data,in other words,user need make sure the buffer size - * is 4 byte aligned - */ - if (dataBytes % sizeof(uint32_t) != 0UL) - { - /* make the data length as word-aligned */ - dataBytes += sizeof(uint32_t) - (dataBytes % sizeof(uint32_t)); - } - - /* Check if ADMA descriptor's number is enough. */ - if ((dataBytes % USDHC_ADMA2_DESCRIPTOR_MAX_LENGTH_PER_ENTRY) == 0UL) - { - miniEntries = dataBytes / USDHC_ADMA2_DESCRIPTOR_MAX_LENGTH_PER_ENTRY; - } - else - { - miniEntries = ((dataBytes / USDHC_ADMA2_DESCRIPTOR_MAX_LENGTH_PER_ENTRY) + 1UL); - } - /* calucate the start entry for multiple descriptor mode, ADMA engine is not stop, so update the descriptor - data adress and data size is enough */ - if (flags == (uint32_t)kUSDHC_AdmaDescriptorMultipleFlag) - { - for (i = 0UL; i < maxEntries; i++) - { - if ((adma2EntryAddress[i].attribute & (uint32_t)kUSDHC_Adma2DescriptorValidFlag) == 0UL) - { - break; - } - } - startEntries = i; - /* add one entry for dummy entry */ - miniEntries += 1UL; - } - - if ((miniEntries + startEntries) > maxEntries) - { - return kStatus_OutOfRange; - } - - for (i = startEntries; i < (miniEntries + startEntries); i++) - { - if (dataBytes > USDHC_ADMA2_DESCRIPTOR_MAX_LENGTH_PER_ENTRY) - { - dmaBufferLen = USDHC_ADMA2_DESCRIPTOR_MAX_LENGTH_PER_ENTRY; - } - else - { - dmaBufferLen = (dataBytes == 0UL ? sizeof(uint32_t) : - dataBytes); /* adma don't support 0 data length transfer descriptor */ - } - - /* Each descriptor for ADMA2 is 64-bit in length */ - adma2EntryAddress[i].address = (dataBytes == 0UL) ? &s_usdhcBootDummy : data; - adma2EntryAddress[i].attribute = (dmaBufferLen << USDHC_ADMA2_DESCRIPTOR_LENGTH_SHIFT); - adma2EntryAddress[i].attribute |= - (dataBytes == 0UL) ? - 0UL : - ((uint32_t)kUSDHC_Adma2DescriptorTypeTransfer | (uint32_t)kUSDHC_Adma2DescriptorInterruptFlag); - data = (uint32_t *)((uint32_t)data + dmaBufferLen); - - if (dataBytes != 0UL) - { - dataBytes -= dmaBufferLen; - } - } - - /* add a dummy valid ADMA descriptor for multiple descriptor mode, this is useful when transfer boot data, the ADMA - engine - will not stop at block gap */ - if (flags == (uint32_t)kUSDHC_AdmaDescriptorMultipleFlag) - { - adma2EntryAddress[startEntries + 1UL].attribute |= (uint32_t)kUSDHC_Adma2DescriptorTypeTransfer; - } - else - { - /* set the end bit */ - adma2EntryAddress[i - 1UL].attribute |= (uint32_t)kUSDHC_Adma2DescriptorEndFlag; - } - - return kStatus_Success; -} - -/*! - * brief Internal DMA configuration. - * This function is used to config the USDHC DMA related registers. - * param base USDHC peripheral base address. - * param adma configuration - * param dataAddr transfer data address, a simple DMA parameter, if ADMA is used, leave it to NULL. - * param enAutoCmd23 flag to indicate Auto CMD23 is enable or not, a simple DMA parameter,if ADMA is used, leave it to - * false. - * retval kStatus_OutOfRange ADMA descriptor table length isn't enough to describe data. - * retval kStatus_Success Operate successfully. - */ -status_t USDHC_SetInternalDmaConfig(USDHC_Type *base, - usdhc_adma_config_t *dmaConfig, - const uint32_t *dataAddr, - bool enAutoCmd23) -{ - assert(dmaConfig != NULL); - assert(dataAddr != NULL); - assert((NULL != dmaConfig->admaTable) && - (((USDHC_ADMA_TABLE_ADDRESS_ALIGN - 1U) & (uint32_t)dmaConfig->admaTable) == 0UL)); - -#if FSL_FEATURE_USDHC_HAS_EXT_DMA - /* disable the external DMA if support */ - base->VEND_SPEC &= ~USDHC_VEND_SPEC_EXT_DMA_EN_MASK; -#endif - - if (dmaConfig->dmaMode == kUSDHC_DmaModeSimple) - { - /* check DMA data buffer address align or not */ - if (((uint32_t)dataAddr % USDHC_ADMA2_ADDRESS_ALIGN) != 0UL) - { - return kStatus_USDHC_DMADataAddrNotAlign; - } - /* in simple DMA mode if use auto CMD23, address should load to ADMA addr, - and block count should load to DS_ADDR*/ - if (enAutoCmd23) - { - base->ADMA_SYS_ADDR = USDHC_ADDR_CPU_2_DMA((uint32_t)dataAddr); - } - else - { - base->DS_ADDR = USDHC_ADDR_CPU_2_DMA((uint32_t)dataAddr); - } - } - else - { - /* When use ADMA, disable simple DMA */ - base->DS_ADDR = 0UL; - base->ADMA_SYS_ADDR = USDHC_ADDR_CPU_2_DMA((uint32_t)(dmaConfig->admaTable)); - } - -#if (defined(FSL_FEATURE_USDHC_HAS_NO_RW_BURST_LEN) && FSL_FEATURE_USDHC_HAS_NO_RW_BURST_LEN) - /* select DMA mode and config the burst length */ - base->PROT_CTRL &= ~(USDHC_PROT_CTRL_DMASEL_MASK); - base->PROT_CTRL |= USDHC_PROT_CTRL_DMASEL(dmaConfig->dmaMode); -#else - /* select DMA mode and config the burst length */ - base->PROT_CTRL &= ~(USDHC_PROT_CTRL_DMASEL_MASK | USDHC_PROT_CTRL_BURST_LEN_EN_MASK); - base->PROT_CTRL |= USDHC_PROT_CTRL_DMASEL(dmaConfig->dmaMode) | USDHC_PROT_CTRL_BURST_LEN_EN(dmaConfig->burstLen); -#endif - /* enable DMA */ - base->MIX_CTRL |= USDHC_MIX_CTRL_DMAEN_MASK; - - return kStatus_Success; -} - -/*! - * brief Sets the DMA descriptor table configuration. - * A high level DMA descriptor configuration function. - * param base USDHC peripheral base address. - * param adma configuration - * param data Data descriptor - * param flags ADAM descriptor flag, used to indicate to create multiple or single descriptor, please - * reference _usdhc_adma_flag - * retval kStatus_OutOfRange ADMA descriptor table length isn't enough to describe data. - * retval kStatus_Success Operate successfully. - */ -status_t USDHC_SetAdmaTableConfig(USDHC_Type *base, - usdhc_adma_config_t *dmaConfig, - usdhc_data_t *dataConfig, - uint32_t flags) -{ - assert(NULL != dmaConfig); - assert((NULL != dmaConfig->admaTable) && - (((USDHC_ADMA_TABLE_ADDRESS_ALIGN - 1U) & (uint32_t)dmaConfig->admaTable) == 0UL)); - assert(NULL != dataConfig); - - status_t error = kStatus_Fail; - uint32_t bootDummyOffset = - dataConfig->dataType == (uint32_t)kUSDHC_TransferDataBootcontinous ? sizeof(uint32_t) : 0UL; - const uint32_t *data = (const uint32_t *)USDHC_ADDR_CPU_2_DMA((uint32_t)( - (uint32_t)((dataConfig->rxData == NULL) ? dataConfig->txData : dataConfig->rxData) + bootDummyOffset)); - uint32_t blockSize = dataConfig->blockSize * dataConfig->blockCount - bootDummyOffset; - -#if FSL_FEATURE_USDHC_HAS_EXT_DMA - if (dmaConfig->dmaMode == kUSDHC_ExternalDMA) - { - /* enable the external DMA */ - base->VEND_SPEC |= USDHC_VEND_SPEC_EXT_DMA_EN_MASK; - } - else -#endif - if (dmaConfig->dmaMode == kUSDHC_DmaModeSimple) - { - error = kStatus_Success; - } - else if (dmaConfig->dmaMode == kUSDHC_DmaModeAdma1) - { - error = USDHC_SetADMA1Descriptor(dmaConfig->admaTable, dmaConfig->admaTableWords, data, blockSize, flags); - } - /* ADMA2 */ - else - { - error = USDHC_SetADMA2Descriptor(dmaConfig->admaTable, dmaConfig->admaTableWords, data, blockSize, flags); - } - - /* for internal dma, internal DMA configurations should not update the configurations when continous transfer the - * boot data, only the DMA descriptor need update */ - if ((dmaConfig->dmaMode != kUSDHC_ExternalDMA) && (error == kStatus_Success) && - (dataConfig->dataType != (uint32_t)kUSDHC_TransferDataBootcontinous)) - { - error = USDHC_SetInternalDmaConfig(base, dmaConfig, data, dataConfig->enableAutoCommand23); - } - - return error; -} - -/*! - * brief Transfers the command/data using a blocking method. - * - * This function waits until the command response/data is received or the USDHC encounters an error by polling the - * status - * flag. - * The application must not call this API in multiple threads at the same time. Because of that this API doesn't support - * the re-entry mechanism. - * - * note There is no need to call the API 'USDHC_TransferCreateHandle' when calling this API. - * - * param base USDHC peripheral base address. - * param adma configuration - * param transfer Transfer content. - * retval kStatus_InvalidArgument Argument is invalid. - * retval kStatus_USDHC_PrepareAdmaDescriptorFailed Prepare ADMA descriptor failed. - * retval kStatus_USDHC_SendCommandFailed Send command failed. - * retval kStatus_USDHC_TransferDataFailed Transfer data failed. - * retval kStatus_Success Operate successfully. - */ -status_t USDHC_TransferBlocking(USDHC_Type *base, usdhc_adma_config_t *dmaConfig, usdhc_transfer_t *transfer) -{ - assert(transfer != NULL); - - status_t error = kStatus_Fail; - usdhc_command_t *command = transfer->command; - usdhc_data_t *data = transfer->data; - bool enDMA = true; - bool executeTuning = ((data == NULL) ? false : data->dataType == (uint32_t)kUSDHC_TransferDataTuning); - uint32_t transferFlags = (uint32_t)kUSDHC_CommandOnly; - size_t blockSize = 0U; - size_t blockCount = 0U; - -#if defined(FSL_FEATURE_USDHC_HAS_SDR50_MODE) && (FSL_FEATURE_USDHC_HAS_SDR50_MODE) - /*check re-tuning request*/ - if ((USDHC_GetInterruptStatusFlags(base) & (uint32_t)kUSDHC_ReTuningEventFlag) != 0UL) - { - USDHC_ClearInterruptStatusFlags(base, kUSDHC_ReTuningEventFlag); - return kStatus_USDHC_ReTuningRequest; - } -#endif - - if (data != NULL) - { - /* Update ADMA descriptor table according to different DMA mode(no DMA, ADMA1, ADMA2).*/ - if ((dmaConfig != NULL) && (!executeTuning)) - { - error = USDHC_SetAdmaTableConfig(base, dmaConfig, data, - (uint32_t)(IS_USDHC_FLAG_SET(data->dataType, kUSDHC_TransferDataBoot) ? - kUSDHC_AdmaDescriptorMultipleFlag : - kUSDHC_AdmaDescriptorSingleFlag)); - } - blockSize = data->blockSize; - blockCount = data->blockCount; - transferFlags = data->enableAutoCommand12 ? (uint32_t)kUSDHC_DataWithAutoCmd12 : 0U; - transferFlags |= data->enableAutoCommand23 ? (uint32_t)kUSDHC_DataWithAutoCmd23 : 0U; - transferFlags |= data->txData != NULL ? (uint32_t)kUSDHC_CommandAndTxData : (uint32_t)kUSDHC_CommandAndRxData; - transferFlags |= data->dataType == (uint8_t)kUSDHC_TransferDataBoot ? (uint32_t)kUSDHC_BootData : 0U; - transferFlags |= - data->dataType == (uint8_t)kUSDHC_TransferDataBootcontinous ? (uint32_t)kUSDHC_BootDataContinuous : 0U; - - command->flags |= (uint32_t)kUSDHC_DataPresentFlag; - } - - /* if the DMA desciptor configure fail or not needed , disable it */ - if (error != kStatus_Success) - { - enDMA = false; - /* disable DMA, using polling mode in this situation */ - USDHC_EnableInternalDMA(base, false); - } -#if defined(FSL_SDK_ENABLE_DRIVER_CACHE_CONTROL) && FSL_SDK_ENABLE_DRIVER_CACHE_CONTROL - else - { - if (data->txData != NULL) - { - /* clear the DCACHE */ - DCACHE_CleanByRange((uint32_t)data->txData, (data->blockSize) * (data->blockCount)); - } - else - { - /* clear the DCACHE */ - DCACHE_CleanInvalidateByRange((uint32_t)data->rxData, (data->blockSize) * (data->blockCount)); - } - } -#endif - - /* config the data transfer parameter */ - error = USDHC_SetTransferConfig(base, transferFlags, blockSize, blockCount); - if (error != kStatus_Success) - { - return error; - } - /* send command first */ - USDHC_SendCommand(base, command); - /* wait command done */ - error = - USDHC_WaitCommandDone(base, command, (data == NULL) || (data->dataType == (uint32_t)kUSDHC_TransferDataNormal)); - if (kStatus_Success != error) - { - return kStatus_USDHC_SendCommandFailed; - } - - /* wait transfer data finsih */ - if (data != NULL) - { - error = USDHC_TransferDataBlocking(base, data, enDMA); - if (kStatus_Success != error) - { - return error; - } - } - - return kStatus_Success; -} - -#if (defined FSL_USDHC_ENABLE_SCATTER_GATHER_TRANSFER) && FSL_USDHC_ENABLE_SCATTER_GATHER_TRANSFER -static status_t USDHC_SetScatterGatherAdmaTableConfig(USDHC_Type *base, - usdhc_adma_config_t *dmaConfig, - usdhc_scatter_gather_data_t *dataConfig, - uint32_t *totalTransferSize) -{ - assert(NULL != dmaConfig); - assert((NULL != dmaConfig->admaTable) && - (((USDHC_ADMA_TABLE_ADDRESS_ALIGN - 1U) & (uint32_t)dmaConfig->admaTable) == 0UL)); - assert(NULL != dataConfig); - - status_t error = kStatus_Fail; - uint32_t *admaDesBuffer = dmaConfig->admaTable; - uint32_t admaDesLen = dmaConfig->admaTableWords; - usdhc_scatter_gather_data_list_t *sgDataList = &dataConfig->sgData; - uint32_t oneDescriptorMaxTransferSize = dmaConfig->dmaMode == kUSDHC_DmaModeAdma1 ? - USDHC_ADMA1_DESCRIPTOR_MAX_LENGTH_PER_ENTRY : - USDHC_ADMA2_DESCRIPTOR_MAX_LENGTH_PER_ENTRY; - uint32_t miniEntries = 0U; - - while (sgDataList != NULL) - { - if (dmaConfig->dmaMode == kUSDHC_DmaModeAdma1) - { - error = USDHC_SetADMA1Descriptor(admaDesBuffer, admaDesLen, sgDataList->dataAddr, sgDataList->dataSize, 0U); - } - /* ADMA2 */ - else - { - error = USDHC_SetADMA2Descriptor(admaDesBuffer, admaDesLen, sgDataList->dataAddr, sgDataList->dataSize, 0U); - } - - if (error != kStatus_Success) - { - return kStatus_USDHC_PrepareAdmaDescriptorFailed; - } - -#if defined(FSL_SDK_ENABLE_DRIVER_CACHE_CONTROL) && FSL_SDK_ENABLE_DRIVER_CACHE_CONTROL - if (dataConfig->dataDirection == kUSDHC_TransferDirectionSend) - { - /* clear the DCACHE */ - DCACHE_CleanByRange((uint32_t)sgDataList->dataAddr, sgDataList->dataSize); - } - else - { - /* clear the DCACHE */ - DCACHE_CleanInvalidateByRange((uint32_t)sgDataList->dataAddr, sgDataList->dataSize); - } -#endif - - *totalTransferSize += sgDataList->dataSize; - if (sgDataList->dataList != NULL) - { - if ((sgDataList->dataSize % oneDescriptorMaxTransferSize) == 0UL) - { - miniEntries = sgDataList->dataSize / oneDescriptorMaxTransferSize; - } - else - { - miniEntries = ((sgDataList->dataSize / oneDescriptorMaxTransferSize) + 1UL); - } - if (dmaConfig->dmaMode == kUSDHC_DmaModeAdma1) - { - admaDesBuffer[miniEntries * 2U - 1U] &= ~kUSDHC_Adma1DescriptorEndFlag; - } - else - { - admaDesBuffer[miniEntries * 2U - 2U] &= ~kUSDHC_Adma2DescriptorEndFlag; - } - admaDesBuffer += miniEntries * 2U; - admaDesLen -= miniEntries * 2U; - } - - sgDataList = sgDataList->dataList; - } - - base->DS_ADDR = 0UL; - base->ADMA_SYS_ADDR = (uint32_t)(dmaConfig->admaTable); - - /* select DMA mode and config the burst length */ - base->PROT_CTRL &= ~(USDHC_PROT_CTRL_DMASEL_MASK); - base->PROT_CTRL |= USDHC_PROT_CTRL_DMASEL(dmaConfig->dmaMode); - - /* enable DMA */ - base->MIX_CTRL |= USDHC_MIX_CTRL_DMAEN_MASK; - - return error; -} - -/*! - * brief Transfers the command/scatter gather data using an interrupt and an asynchronous method. - * - * This function sends a command and data and returns immediately. It doesn't wait for the transfer to complete or - * to encounter an error. The application must not call this API in multiple threads at the same time. Because of that - * this API doesn't support the re-entry mechanism. - * This function is target for the application would like to have scatter gather buffer to be transferred within one - * read/write request, non scatter gather buffer is support by this function also. - * - * note Call API @ref USDHC_TransferCreateHandle when calling this API. - * - * param base USDHC peripheral base address. - * param handle USDHC handle. - * param dmaConfig adma configurations, must be not NULL, since the function is target for ADMA only. - * param transfer scatter gather transfer content. - * - * retval #kStatus_InvalidArgument Argument is invalid. - * retval #kStatus_USDHC_BusyTransferring Busy transferring. - * retval #kStatus_USDHC_PrepareAdmaDescriptorFailed Prepare ADMA descriptor failed. - * retval #kStatus_Success Operate successfully. - */ -status_t USDHC_TransferScatterGatherADMANonBlocking(USDHC_Type *base, - usdhc_handle_t *handle, - usdhc_adma_config_t *dmaConfig, - usdhc_scatter_gather_transfer_t *transfer) -{ - assert(handle != NULL); - assert(transfer != NULL); - assert(dmaConfig != NULL); - - status_t error = kStatus_Fail; - usdhc_command_t *command = transfer->command; - uint32_t totalTransferSize = 0U; - uint32_t transferFlags = kUSDHC_CommandOnly; - size_t blockSize = 0U; - size_t blockCount = 0U; - usdhc_scatter_gather_data_t *scatterGatherData = transfer->data; - bool enDMA = false; - - /* check data inhibit flag */ - if (IS_USDHC_FLAG_SET(base->PRES_STATE, kUSDHC_CommandInhibitFlag)) - { - return kStatus_USDHC_BusyTransferring; - } - - handle->command = command; - handle->data = scatterGatherData; - /* transferredWords will only be updated in ISR when transfer way is DATAPORT. */ - handle->transferredWords = 0UL; - - /* Update ADMA descriptor table according to different DMA mode(ADMA1, ADMA2).*/ - if (scatterGatherData != NULL) - { - if (scatterGatherData->sgData.dataAddr == NULL) - { - return kStatus_InvalidArgument; - } - - if (scatterGatherData->dataType != (uint32_t)kUSDHC_TransferDataTuning) - { - if (USDHC_SetScatterGatherAdmaTableConfig(base, dmaConfig, transfer->data, &totalTransferSize) != - kStatus_Success) - { - return kStatus_USDHC_PrepareAdmaDescriptorFailed; - } - - enDMA = true; - } - blockSize = scatterGatherData->blockSize; - blockCount = totalTransferSize / scatterGatherData->blockSize; - transferFlags = scatterGatherData->enableAutoCommand12 ? kUSDHC_DataWithAutoCmd12 : 0U; - transferFlags |= scatterGatherData->enableAutoCommand23 ? kUSDHC_DataWithAutoCmd23 : 0U; - transferFlags |= scatterGatherData->dataDirection == kUSDHC_TransferDirectionSend ? kUSDHC_CommandAndTxData : - kUSDHC_CommandAndRxData; - command->flags |= kUSDHC_DataPresentFlag; - } - - error = USDHC_SetTransferConfig(base, transferFlags, blockSize, blockCount); - if (error != kStatus_Success) - { - return error; - } - - /* enable interrupt per transfer request */ - if (scatterGatherData != NULL) - { - USDHC_ClearInterruptStatusFlags( - base, (uint32_t)(enDMA == false ? kUSDHC_DataFlag : kUSDHC_DataDMAFlag | kUSDHC_DmaCompleteFlag) | - (uint32_t)kUSDHC_CommandFlag); - USDHC_EnableInterruptSignal( - base, (uint32_t)(enDMA == false ? kUSDHC_DataFlag : kUSDHC_DataDMAFlag | kUSDHC_DmaCompleteFlag) | - (uint32_t)kUSDHC_CommandFlag); - } - else - { - USDHC_ClearInterruptStatusFlags(base, kUSDHC_CommandFlag); - USDHC_EnableInterruptSignal(base, kUSDHC_CommandFlag); - } - - /* send command first */ - USDHC_SendCommand(base, command); - - return kStatus_Success; -} -#else -/*! - * brief Transfers the command/data using an interrupt and an asynchronous method. - * - * This function sends a command and data and returns immediately. It doesn't wait the transfer complete or encounter an - * error. - * The application must not call this API in multiple threads at the same time. Because of that this API doesn't support - * the re-entry mechanism. - * - * note Call the API 'USDHC_TransferCreateHandle' when calling this API. - * - * param base USDHC peripheral base address. - * param handle USDHC handle. - * param adma configuration. - * param transfer Transfer content. - * retval kStatus_InvalidArgument Argument is invalid. - * retval kStatus_USDHC_BusyTransferring Busy transferring. - * retval kStatus_USDHC_PrepareAdmaDescriptorFailed Prepare ADMA descriptor failed. - * retval kStatus_Success Operate successfully. - */ -status_t USDHC_TransferNonBlocking(USDHC_Type *base, - usdhc_handle_t *handle, - usdhc_adma_config_t *dmaConfig, - usdhc_transfer_t *transfer) -{ - assert(handle != NULL); - assert(transfer != NULL); - - status_t error = kStatus_Fail; - usdhc_command_t *command = transfer->command; - usdhc_data_t *data = transfer->data; - bool executeTuning = ((data == NULL) ? false : data->dataType == (uint32_t)kUSDHC_TransferDataTuning); - bool enDMA = true; - uint32_t transferFlags = (uint32_t)kUSDHC_CommandOnly; - size_t blockSize = 0U; - size_t blockCount = 0U; - -#if defined(FSL_FEATURE_USDHC_HAS_SDR50_MODE) && (FSL_FEATURE_USDHC_HAS_SDR50_MODE) - /*check re-tuning request*/ - if ((USDHC_GetInterruptStatusFlags(base) & ((uint32_t)kUSDHC_ReTuningEventFlag)) != 0UL) - { - USDHC_ClearInterruptStatusFlags(base, kUSDHC_ReTuningEventFlag); - return kStatus_USDHC_ReTuningRequest; - } -#endif - /* Save command and data into handle before transferring. */ - - handle->command = command; - handle->data = data; - /* transferredWords will only be updated in ISR when transfer way is DATAPORT. */ - handle->transferredWords = 0UL; - - if (data != NULL) - { - /* Update ADMA descriptor table according to different DMA mode(no DMA, ADMA1, ADMA2).*/ - if ((dmaConfig != NULL) && (!executeTuning)) - { - error = USDHC_SetAdmaTableConfig( - base, dmaConfig, data, - (uint32_t)(IS_USDHC_FLAG_SET(data->dataType, (uint32_t)kUSDHC_TransferDataBoot) ? - kUSDHC_AdmaDescriptorMultipleFlag : - kUSDHC_AdmaDescriptorSingleFlag)); - } - - blockSize = data->blockSize; - blockCount = data->blockCount; - transferFlags = data->enableAutoCommand12 ? (uint32_t)kUSDHC_DataWithAutoCmd12 : 0U; - transferFlags |= data->enableAutoCommand23 ? (uint32_t)kUSDHC_DataWithAutoCmd23 : 0U; - transferFlags |= data->txData != NULL ? (uint32_t)kUSDHC_CommandAndTxData : (uint32_t)kUSDHC_CommandAndRxData; - transferFlags |= data->dataType == (uint8_t)kUSDHC_TransferDataBoot ? (uint32_t)kUSDHC_BootData : 0U; - transferFlags |= - data->dataType == (uint8_t)kUSDHC_TransferDataBootcontinous ? (uint32_t)kUSDHC_BootDataContinuous : 0U; - - command->flags |= (uint32_t)kUSDHC_DataPresentFlag; - } - - /* if the DMA desciptor configure fail or not needed , disable it */ - if (error != kStatus_Success) - { - /* disable DMA, using polling mode in this situation */ - USDHC_EnableInternalDMA(base, false); - enDMA = false; - } -#if defined(FSL_SDK_ENABLE_DRIVER_CACHE_CONTROL) && FSL_SDK_ENABLE_DRIVER_CACHE_CONTROL - else - { - if (data->txData != NULL) - { - /* clear the DCACHE */ - DCACHE_CleanByRange((uint32_t)data->txData, (data->blockSize) * (data->blockCount)); - } - else - { - /* clear the DCACHE */ - DCACHE_CleanInvalidateByRange((uint32_t)data->rxData, (data->blockSize) * (data->blockCount)); - } - } -#endif - - /* config the data transfer parameter */ - error = USDHC_SetTransferConfig(base, transferFlags, blockSize, blockCount); - if (error != kStatus_Success) - { - return error; - } - - /* enable interrupt per transfer request */ - if (handle->data != NULL) - { - USDHC_ClearInterruptStatusFlags( - base, (uint32_t)(enDMA == false ? kUSDHC_DataFlag : kUSDHC_DataDMAFlag) | (uint32_t)kUSDHC_CommandFlag | - (uint32_t)(data->dataType == (uint8_t)kUSDHC_TransferDataBootcontinous ? - (uint32_t)kUSDHC_DmaCompleteFlag : - 0U)); - USDHC_EnableInterruptSignal(base, (uint32_t)(enDMA == false ? kUSDHC_DataFlag : kUSDHC_DataDMAFlag) | - (uint32_t)kUSDHC_CommandFlag | - (uint32_t)(data->dataType == (uint8_t)kUSDHC_TransferDataBootcontinous ? - (uint32_t)kUSDHC_DmaCompleteFlag : - 0U)); - } - else - { - USDHC_ClearInterruptStatusFlags(base, kUSDHC_CommandFlag); - USDHC_EnableInterruptSignal(base, kUSDHC_CommandFlag); - } - - /* send command first */ - USDHC_SendCommand(base, command); - - return kStatus_Success; -} -#endif - -#if defined(FSL_FEATURE_USDHC_HAS_SDR50_MODE) && (FSL_FEATURE_USDHC_HAS_SDR50_MODE) -/*! - * brief manual tuning trigger or abort - * User should handle the tuning cmd and find the boundary of the delay - * then calucate a average value which will be config to the CLK_TUNE_CTRL_STATUS - * This function should called before USDHC_AdjustDelayforSDR104 function - * param base USDHC peripheral base address. - * param tuning enable flag - */ -void USDHC_EnableManualTuning(USDHC_Type *base, bool enable) -{ - if (enable) - { - /* make sure std_tun_en bit is clear */ - base->TUNING_CTRL &= ~USDHC_TUNING_CTRL_STD_TUNING_EN_MASK; - /* disable auto tuning here */ - base->MIX_CTRL &= ~USDHC_MIX_CTRL_AUTO_TUNE_EN_MASK; - /* execute tuning for SDR104 mode */ - base->MIX_CTRL |= USDHC_MIX_CTRL_EXE_TUNE_MASK | USDHC_MIX_CTRL_SMP_CLK_SEL_MASK; - } - else - { /* abort the tuning */ - base->MIX_CTRL &= ~USDHC_MIX_CTRL_EXE_TUNE_MASK; - } -} - -/*! - * brief the SDR104 mode delay setting adjust - * This function should called after USDHC_ManualTuningForSDR104 - * param base USDHC peripheral base address. - * param delay setting configuration - * retval kStatus_Fail config the delay setting fail - * retval kStatus_Success config the delay setting success - */ -status_t USDHC_AdjustDelayForManualTuning(USDHC_Type *base, uint32_t delay) -{ - uint32_t clkTuneCtrl = 0UL; - - clkTuneCtrl = base->CLK_TUNE_CTRL_STATUS; - - clkTuneCtrl &= ~USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE_MASK; - - clkTuneCtrl |= USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE(delay); - - /* load the delay setting */ - base->CLK_TUNE_CTRL_STATUS = clkTuneCtrl; - /* check delat setting error */ - if (IS_USDHC_FLAG_SET(base->CLK_TUNE_CTRL_STATUS, - USDHC_CLK_TUNE_CTRL_STATUS_PRE_ERR_MASK | USDHC_CLK_TUNE_CTRL_STATUS_NXT_ERR_MASK)) - { - return kStatus_Fail; - } - - return kStatus_Success; -} - -/*! - * brief The tuning delay cell setting. - * - * param base USDHC peripheral base address. - * param preDelay Set the number of delay cells on the feedback clock between the feedback clock and CLK_PRE. - * param outDelay Set the number of delay cells on the feedback clock between CLK_PRE and CLK_OUT. - * param postDelay Set the number of delay cells on the feedback clock between CLK_OUT and CLK_POST. - * retval kStatus_Fail config the delay setting fail - * retval kStatus_Success config the delay setting success - */ -status_t USDHC_SetTuningDelay(USDHC_Type *base, uint32_t preDelay, uint32_t outDelay, uint32_t postDelay) -{ - assert(preDelay <= - (USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE_MASK >> USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE_SHIFT)); - assert(outDelay <= - (USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_OUT_MASK >> USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_OUT_SHIFT)); - assert(postDelay <= - (USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_POST_MASK >> USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_POST_SHIFT)); - - uint32_t clkTuneCtrl = 0UL; - - clkTuneCtrl = base->CLK_TUNE_CTRL_STATUS; - - clkTuneCtrl &= - ~(USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE_MASK | USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_OUT_MASK | - USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_POST_MASK); - - clkTuneCtrl |= USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_PRE(preDelay) | - USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_OUT(outDelay) | - USDHC_CLK_TUNE_CTRL_STATUS_DLY_CELL_SET_POST(postDelay); - - /* load the delay setting */ - base->CLK_TUNE_CTRL_STATUS = clkTuneCtrl; - /* check delat setting error */ - if (IS_USDHC_FLAG_SET(base->CLK_TUNE_CTRL_STATUS, - USDHC_CLK_TUNE_CTRL_STATUS_PRE_ERR_MASK | USDHC_CLK_TUNE_CTRL_STATUS_NXT_ERR_MASK)) - { - return kStatus_Fail; - } - - return kStatus_Success; -} - -/*! - * brief the enable standard tuning function - * The standard tuning window and tuning counter use the default config - * tuning cmd is send by the software, user need to check the tuning result - * can be used for SDR50,SDR104,HS200 mode tuning - * param base USDHC peripheral base address. - * param tuning start tap - * param tuning step - * param enable/disable flag - */ -void USDHC_EnableStandardTuning(USDHC_Type *base, uint32_t tuningStartTap, uint32_t step, bool enable) -{ - uint32_t tuningCtrl = 0UL; - - if (enable) - { - /* feedback clock */ - base->MIX_CTRL |= USDHC_MIX_CTRL_FBCLK_SEL_MASK; - /* config tuning start and step */ - tuningCtrl = base->TUNING_CTRL; - tuningCtrl &= ~(USDHC_TUNING_CTRL_TUNING_START_TAP_MASK | USDHC_TUNING_CTRL_TUNING_STEP_MASK); - tuningCtrl |= (USDHC_TUNING_CTRL_TUNING_START_TAP(tuningStartTap) | USDHC_TUNING_CTRL_TUNING_STEP(step) | - USDHC_TUNING_CTRL_STD_TUNING_EN_MASK); - base->TUNING_CTRL = tuningCtrl; - - /* excute tuning */ - base->AUTOCMD12_ERR_STATUS |= - (USDHC_AUTOCMD12_ERR_STATUS_EXECUTE_TUNING_MASK | USDHC_AUTOCMD12_ERR_STATUS_SMP_CLK_SEL_MASK); - } - else - { - /* disable the standard tuning */ - base->TUNING_CTRL &= ~USDHC_TUNING_CTRL_STD_TUNING_EN_MASK; - /* clear excute tuning */ - base->AUTOCMD12_ERR_STATUS &= - ~(USDHC_AUTOCMD12_ERR_STATUS_EXECUTE_TUNING_MASK | USDHC_AUTOCMD12_ERR_STATUS_SMP_CLK_SEL_MASK); - } -} - -#if FSL_FEATURE_USDHC_HAS_HS400_MODE -/*! - * brief config the strobe DLL delay target and update interval - * - * param base USDHC peripheral base address. - * param delayTarget delay target - * param updateInterval update interval - */ -void USDHC_ConfigStrobeDLL(USDHC_Type *base, uint32_t delayTarget, uint32_t updateInterval) -{ - assert(delayTarget <= (USDHC_STROBE_DLL_CTRL_STROBE_DLL_CTRL_SLV_DLY_TARGET_MASK >> - USDHC_STROBE_DLL_CTRL_STROBE_DLL_CTRL_SLV_DLY_TARGET_SHIFT)); - - /* reset strobe dll firstly */ - base->STROBE_DLL_CTRL |= USDHC_STROBE_DLL_CTRL_STROBE_DLL_CTRL_RESET_MASK; - /* clear reset and other register fields */ - base->STROBE_DLL_CTRL = 0; - /* configure the DELAY target and update interval */ - base->STROBE_DLL_CTRL |= USDHC_STROBE_DLL_CTRL_STROBE_DLL_CTRL_ENABLE_MASK | - USDHC_STROBE_DLL_CTRL_STROBE_DLL_CTRL_SLV_UPDATE_INT(updateInterval) | - USDHC_STROBE_DLL_CTRL_STROBE_DLL_CTRL_SLV_DLY_TARGET(delayTarget); - - while ( - (USDHC_GetStrobeDLLStatus(base) & (USDHC_STROBE_DLL_STATUS_STROBE_DLL_STS_SLV_LOCK_MASK | - USDHC_STROBE_DLL_STATUS_STROBE_DLL_STS_REF_LOCK_MASK)) != - ((USDHC_STROBE_DLL_STATUS_STROBE_DLL_STS_SLV_LOCK_MASK | USDHC_STROBE_DLL_STATUS_STROBE_DLL_STS_REF_LOCK_MASK))) - { - } -} -#endif - -/*! - * brief the auto tuning enbale for CMD/DATA line - * - * param base USDHC peripheral base address. - */ -void USDHC_EnableAutoTuningForCmdAndData(USDHC_Type *base) -{ - uint32_t busWidth = (base->PROT_CTRL & USDHC_PROT_CTRL_DTW_MASK) >> USDHC_PROT_CTRL_DTW_SHIFT; - - base->VEND_SPEC2 |= USDHC_VEND_SPEC2_TUNING_CMD_EN_MASK; - -#if defined(USDHC_VEND_SPEC2_TUNING_BIT_EN_MASK) && USDHC_VEND_SPEC2_TUNING_BIT_EN_MASK - base->VEND_SPEC2 &= ~USDHC_VEND_SPEC2_TUNING_BIT_EN_MASK; - /* 1bit data width */ - if (busWidth == 0UL) - { - base->VEND_SPEC2 |= USDHC_VEND_SPEC2_TUNING_BIT_EN(2U); - } - /* 4bit data width */ - else if (busWidth == 1UL) - { - base->VEND_SPEC2 |= USDHC_VEND_SPEC2_TUNING_BIT_EN(0U); - } - /* 8bit data width */ - else - { - base->VEND_SPEC2 |= USDHC_VEND_SPEC2_TUNING_BIT_EN(1U); - } -#else - /* 1bit data width */ - if (busWidth == 0UL) - { - base->VEND_SPEC2 &= ~USDHC_VEND_SPEC2_TUNING_8bit_EN_MASK; - base->VEND_SPEC2 |= USDHC_VEND_SPEC2_TUNING_1bit_EN_MASK; - } - /* 4bit data width */ - else if (busWidth == 1UL) - { - base->VEND_SPEC2 &= ~USDHC_VEND_SPEC2_TUNING_8bit_EN_MASK; - base->VEND_SPEC2 &= ~USDHC_VEND_SPEC2_TUNING_1bit_EN_MASK; - } - /* 8bit data width */ - else - { - base->VEND_SPEC2 |= USDHC_VEND_SPEC2_TUNING_8bit_EN_MASK; - base->VEND_SPEC2 &= ~USDHC_VEND_SPEC2_TUNING_1bit_EN_MASK; - } -#endif -} -#endif /* FSL_FEATURE_USDHC_HAS_SDR50_MODE */ - -static void USDHC_TransferHandleCardDetect(USDHC_Type *base, usdhc_handle_t *handle, uint32_t interruptFlags) -{ - if (IS_USDHC_FLAG_SET(interruptFlags, kUSDHC_CardInsertionFlag)) - { - if (handle->callback.CardInserted != NULL) - { - handle->callback.CardInserted(base, handle->userData); - } - } - else - { - if (handle->callback.CardRemoved != NULL) - { - handle->callback.CardRemoved(base, handle->userData); - } - } -} - -static void USDHC_TransferHandleCommand(USDHC_Type *base, usdhc_handle_t *handle, uint32_t interruptFlags) -{ - assert(handle->command != NULL); - - if (IS_USDHC_FLAG_SET(interruptFlags, kUSDHC_CommandErrorFlag)) - { - if (handle->callback.TransferComplete != NULL) - { - handle->callback.TransferComplete(base, handle, kStatus_USDHC_SendCommandFailed, handle->userData); - } - } - else - { - /* Receive response */ - if (kStatus_Success != USDHC_ReceiveCommandResponse(base, handle->command)) - { - if (handle->callback.TransferComplete != NULL) - { - handle->callback.TransferComplete(base, handle, kStatus_USDHC_SendCommandFailed, handle->userData); - } - } - else - { - if (handle->callback.TransferComplete != NULL) - { - handle->callback.TransferComplete(base, handle, kStatus_USDHC_SendCommandSuccess, handle->userData); - } - } - } - /* disable interrupt signal and reset command pointer */ - USDHC_DisableInterruptSignal(base, kUSDHC_CommandFlag); - handle->command = NULL; -} - -#if (defined FSL_USDHC_ENABLE_SCATTER_GATHER_TRANSFER) && FSL_USDHC_ENABLE_SCATTER_GATHER_TRANSFER -static void USDHC_TransferHandleData(USDHC_Type *base, usdhc_handle_t *handle, uint32_t interruptFlags) -{ - assert(handle->data != NULL); - - status_t transferStatus = kStatus_USDHC_BusyTransferring; - - if ((!(handle->data->enableIgnoreError)) && - (IS_USDHC_FLAG_SET(interruptFlags, (uint32_t)kUSDHC_DataErrorFlag | (uint32_t)kUSDHC_DmaErrorFlag))) - { - transferStatus = kStatus_USDHC_TransferDataFailed; - } - else - { - if (IS_USDHC_FLAG_SET(interruptFlags, kUSDHC_BufferReadReadyFlag)) - { - /* std tuning process only need to wait BRR */ - if (handle->data->dataType == (uint32_t)kUSDHC_TransferDataTuning) - { - transferStatus = kStatus_USDHC_TransferDataComplete; - } - } - else - { - if (IS_USDHC_FLAG_SET(interruptFlags, kUSDHC_DmaCompleteFlag)) - { - transferStatus = kStatus_USDHC_TransferDMAComplete; - } - - if (IS_USDHC_FLAG_SET(interruptFlags, kUSDHC_DataCompleteFlag)) - { - transferStatus = kStatus_USDHC_TransferDataComplete; - -#if defined(FSL_SDK_ENABLE_DRIVER_CACHE_CONTROL) && FSL_SDK_ENABLE_DRIVER_CACHE_CONTROL - if (handle->data->dataDirection == kUSDHC_TransferDirectionReceive) - { - usdhc_scatter_gather_data_list_t *sgDataList = &handle->data->sgData; - while (sgDataList != NULL) - { - DCACHE_InvalidateByRange((uint32_t)sgDataList->dataAddr, sgDataList->dataSize); - sgDataList = sgDataList->dataList; - } - } -#endif - } - } - } - - if ((handle->callback.TransferComplete != NULL) && (transferStatus != kStatus_USDHC_BusyTransferring)) - { - handle->callback.TransferComplete(base, handle, transferStatus, handle->userData); - USDHC_DisableInterruptSignal( - base, (uint32_t)kUSDHC_DataFlag | (uint32_t)kUSDHC_DataDMAFlag | (uint32_t)kUSDHC_DmaCompleteFlag); - handle->data = NULL; - } -} - -#else -static void USDHC_TransferHandleData(USDHC_Type *base, usdhc_handle_t *handle, uint32_t interruptFlags) -{ - assert(handle->data != NULL); - - status_t transferStatus = kStatus_USDHC_BusyTransferring; - uint32_t transferredWords = handle->transferredWords; - - if ((!(handle->data->enableIgnoreError)) && - (IS_USDHC_FLAG_SET(interruptFlags, (uint32_t)kUSDHC_DataErrorFlag | (uint32_t)kUSDHC_DmaErrorFlag))) - { - transferStatus = kStatus_USDHC_TransferDataFailed; - } - else - { - if (IS_USDHC_FLAG_SET(interruptFlags, kUSDHC_BufferReadReadyFlag)) - { - /* std tuning process only need to wait BRR */ - if (handle->data->dataType == (uint32_t)kUSDHC_TransferDataTuning) - { - transferStatus = kStatus_USDHC_TransferDataComplete; - } - else - { - handle->transferredWords = USDHC_ReadDataPort(base, handle->data, transferredWords); - } - } - else if (IS_USDHC_FLAG_SET(interruptFlags, kUSDHC_BufferWriteReadyFlag)) - { - handle->transferredWords = USDHC_WriteDataPort(base, handle->data, transferredWords); - } - else - { - if ((IS_USDHC_FLAG_SET(interruptFlags, kUSDHC_DmaCompleteFlag)) && - (handle->data->dataType == (uint32_t)kUSDHC_TransferDataBootcontinous)) - { - *(handle->data->rxData) = s_usdhcBootDummy; - } - - if (IS_USDHC_FLAG_SET(interruptFlags, kUSDHC_DataCompleteFlag)) - { - transferStatus = kStatus_USDHC_TransferDataComplete; - -#if defined(FSL_SDK_ENABLE_DRIVER_CACHE_CONTROL) && FSL_SDK_ENABLE_DRIVER_CACHE_CONTROL - if (handle->data->rxData != NULL) - { - DCACHE_InvalidateByRange((uint32_t)(handle->data->rxData), - (handle->data->blockSize) * (handle->data->blockCount)); - } -#endif - } - } - } - - if ((handle->callback.TransferComplete != NULL) && (transferStatus != kStatus_USDHC_BusyTransferring)) - { - handle->callback.TransferComplete(base, handle, transferStatus, handle->userData); - USDHC_DisableInterruptSignal(base, (uint32_t)kUSDHC_DataFlag | (uint32_t)kUSDHC_DataDMAFlag); - handle->data = NULL; - } -} -#endif - -static void USDHC_TransferHandleSdioInterrupt(USDHC_Type *base, usdhc_handle_t *handle) -{ - if (handle->callback.SdioInterrupt != NULL) - { - handle->callback.SdioInterrupt(base, handle->userData); - } -} - -#if defined(FSL_FEATURE_USDHC_HAS_SDR50_MODE) && (FSL_FEATURE_USDHC_HAS_SDR50_MODE) -static void USDHC_TransferHandleReTuning(USDHC_Type *base, usdhc_handle_t *handle, uint32_t interruptFlags) -{ - assert(handle->callback.ReTuning != NULL); - /* retuning request */ - if (IS_USDHC_FLAG_SET(interruptFlags, kUSDHC_TuningErrorFlag)) - { - handle->callback.ReTuning(base, handle->userData); /* retuning fail */ - } -} -#endif - -static void USDHC_TransferHandleBlockGap(USDHC_Type *base, usdhc_handle_t *handle) -{ - if (handle->callback.BlockGap != NULL) - { - handle->callback.BlockGap(base, handle->userData); - } -} - -/*! - * brief Creates the USDHC handle. - * - * param base USDHC peripheral base address. - * param handle USDHC handle pointer. - * param callback Structure pointer to contain all callback functions. - * param userData Callback function parameter. - */ -void USDHC_TransferCreateHandle(USDHC_Type *base, - usdhc_handle_t *handle, - const usdhc_transfer_callback_t *callback, - void *userData) -{ - assert(handle != NULL); - assert(callback != NULL); - - /* Zero the handle. */ - (void)memset(handle, 0, sizeof(*handle)); - - /* Set the callback. */ - handle->callback.CardInserted = callback->CardInserted; - handle->callback.CardRemoved = callback->CardRemoved; - handle->callback.SdioInterrupt = callback->SdioInterrupt; - handle->callback.BlockGap = callback->BlockGap; - handle->callback.TransferComplete = callback->TransferComplete; - handle->callback.ReTuning = callback->ReTuning; - handle->userData = userData; - - /* Save the handle in global variables to support the double weak mechanism. */ - s_usdhcHandle[USDHC_GetInstance(base)] = handle; - - /* save IRQ handler */ - s_usdhcIsr = USDHC_TransferHandleIRQ; - - (void)EnableIRQ(s_usdhcIRQ[USDHC_GetInstance(base)]); -} - -/*! - * brief IRQ handler for the USDHC. - * - * This function deals with the IRQs on the given host controller. - * - * param base USDHC peripheral base address. - * param handle USDHC handle. - */ -void USDHC_TransferHandleIRQ(USDHC_Type *base, usdhc_handle_t *handle) -{ - assert(handle != NULL); - - uint32_t interruptFlags; - - interruptFlags = USDHC_GetEnabledInterruptStatusFlags(base); - - if (IS_USDHC_FLAG_SET(interruptFlags, kUSDHC_CardDetectFlag)) - { - USDHC_TransferHandleCardDetect(base, handle, interruptFlags); - } - if (IS_USDHC_FLAG_SET(interruptFlags, kUSDHC_CommandFlag)) - { - USDHC_TransferHandleCommand(base, handle, interruptFlags); - } - if (IS_USDHC_FLAG_SET(interruptFlags, kUSDHC_DataFlag)) - { - USDHC_TransferHandleData(base, handle, interruptFlags); - } - if (IS_USDHC_FLAG_SET(interruptFlags, kUSDHC_CardInterruptFlag)) - { - USDHC_TransferHandleSdioInterrupt(base, handle); - } - if (IS_USDHC_FLAG_SET(interruptFlags, kUSDHC_BlockGapEventFlag)) - { - USDHC_TransferHandleBlockGap(base, handle); - } -#if defined(FSL_FEATURE_USDHC_HAS_SDR50_MODE) && (FSL_FEATURE_USDHC_HAS_SDR50_MODE) - if (IS_USDHC_FLAG_SET(interruptFlags, kUSDHC_SDR104TuningFlag)) - { - USDHC_TransferHandleReTuning(base, handle, interruptFlags); - } -#endif - USDHC_ClearInterruptStatusFlags(base, interruptFlags); -} - -#ifdef USDHC0 -void USDHC0_DriverIRQHandler(void); -void USDHC0_DriverIRQHandler(void) -{ - s_usdhcIsr(s_usdhcBase[0U], s_usdhcHandle[0U]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#ifdef USDHC1 -void USDHC1_DriverIRQHandler(void); -void USDHC1_DriverIRQHandler(void) -{ - s_usdhcIsr(s_usdhcBase[1U], s_usdhcHandle[1U]); - SDK_ISR_EXIT_BARRIER; -} -#endif - -#ifdef USDHC2 -void USDHC2_DriverIRQHandler(void); -void USDHC2_DriverIRQHandler(void) -{ - s_usdhcIsr(s_usdhcBase[2U], s_usdhcHandle[2U]); - SDK_ISR_EXIT_BARRIER; -} - -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_usdhc.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_usdhc.h deleted file mode 100644 index 5fd51c21950..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_usdhc.h +++ /dev/null @@ -1,1705 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_USDHC_H_ -#define FSL_USDHC_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup usdhc - * @{ - */ - -/****************************************************************************** - * Definitions. - *****************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief Driver version 2.8.4. */ -#define FSL_USDHC_DRIVER_VERSION (MAKE_VERSION(2U, 8U, 4U)) -/*! @} */ - -/*! @brief Maximum block count can be set one time */ -#define USDHC_MAX_BLOCK_COUNT (USDHC_BLK_ATT_BLKCNT_MASK >> USDHC_BLK_ATT_BLKCNT_SHIFT) - -/*! @brief USDHC scatter gather feature control macro */ -#ifndef FSL_USDHC_ENABLE_SCATTER_GATHER_TRANSFER -#define FSL_USDHC_ENABLE_SCATTER_GATHER_TRANSFER 0U -#endif - -/*! @brief Enum _usdhc_status. USDHC status. */ -enum -{ - kStatus_USDHC_BusyTransferring = MAKE_STATUS(kStatusGroup_USDHC, 0U), /*!< Transfer is on-going. */ - kStatus_USDHC_PrepareAdmaDescriptorFailed = MAKE_STATUS(kStatusGroup_USDHC, 1U), /*!< Set DMA descriptor failed. */ - kStatus_USDHC_SendCommandFailed = MAKE_STATUS(kStatusGroup_USDHC, 2U), /*!< Send command failed. */ - kStatus_USDHC_TransferDataFailed = MAKE_STATUS(kStatusGroup_USDHC, 3U), /*!< Transfer data failed. */ - kStatus_USDHC_DMADataAddrNotAlign = MAKE_STATUS(kStatusGroup_USDHC, 4U), /*!< Data address not aligned. */ - kStatus_USDHC_ReTuningRequest = MAKE_STATUS(kStatusGroup_USDHC, 5U), /*!< Re-tuning request. */ - kStatus_USDHC_TuningError = MAKE_STATUS(kStatusGroup_USDHC, 6U), /*!< Tuning error. */ - kStatus_USDHC_NotSupport = MAKE_STATUS(kStatusGroup_USDHC, 7U), /*!< Not support. */ - kStatus_USDHC_TransferDataComplete = MAKE_STATUS(kStatusGroup_USDHC, 8U), /*!< Transfer data complete. */ - kStatus_USDHC_SendCommandSuccess = MAKE_STATUS(kStatusGroup_USDHC, 9U), /*!< Transfer command complete. */ - kStatus_USDHC_TransferDMAComplete = MAKE_STATUS(kStatusGroup_USDHC, 10U), /*!< Transfer DMA complete. */ -}; - -/*! @brief Enum _usdhc_capability_flag. Host controller capabilities flag mask. - * @anchor _usdhc_capability_flag - */ -enum -{ - kUSDHC_SupportAdmaFlag = USDHC_HOST_CTRL_CAP_ADMAS_MASK, /*!< Support ADMA. */ - kUSDHC_SupportHighSpeedFlag = USDHC_HOST_CTRL_CAP_HSS_MASK, /*!< Support high-speed. */ - kUSDHC_SupportDmaFlag = USDHC_HOST_CTRL_CAP_DMAS_MASK, /*!< Support DMA. */ - kUSDHC_SupportSuspendResumeFlag = USDHC_HOST_CTRL_CAP_SRS_MASK, /*!< Support suspend/resume. */ - kUSDHC_SupportV330Flag = USDHC_HOST_CTRL_CAP_VS33_MASK, /*!< Support voltage 3.3V. */ - kUSDHC_SupportV300Flag = USDHC_HOST_CTRL_CAP_VS30_MASK, /*!< Support voltage 3.0V. */ -#if !(defined(FSL_FEATURE_USDHC_HAS_NO_VS18) && FSL_FEATURE_USDHC_HAS_NO_VS18) - kUSDHC_SupportV180Flag = USDHC_HOST_CTRL_CAP_VS18_MASK, /*!< Support voltage 1.8V. */ -#endif - kUSDHC_Support4BitFlag = (USDHC_HOST_CTRL_CAP_MBL_SHIFT << 0U), - /*!< Flag in HTCAPBLT_MBL's position, supporting 4-bit mode. */ - kUSDHC_Support8BitFlag = (USDHC_HOST_CTRL_CAP_MBL_SHIFT << 1U), - /*!< Flag in HTCAPBLT_MBL's position, supporting 8-bit mode. */ - kUSDHC_SupportDDR50Flag = USDHC_HOST_CTRL_CAP_DDR50_SUPPORT_MASK, -/*!< SD version 3.0 new feature, supporting DDR50 mode. */ - -#if defined(FSL_FEATURE_USDHC_HAS_SDR104_MODE) && (!FSL_FEATURE_USDHC_HAS_SDR104_MODE) - kUSDHC_SupportSDR104Flag = 0, /*!< not support SDR104 mode */ -#else - kUSDHC_SupportSDR104Flag = USDHC_HOST_CTRL_CAP_SDR104_SUPPORT_MASK, /*!< Support SDR104 mode. */ -#endif -#if defined(FSL_FEATURE_USDHC_HAS_SDR50_MODE) && (!FSL_FEATURE_USDHC_HAS_SDR50_MODE) - kUSDHC_SupportSDR50Flag = 0U, /*!< not support SDR50 mode */ -#else - kUSDHC_SupportSDR50Flag = USDHC_HOST_CTRL_CAP_SDR50_SUPPORT_MASK, /*!< Support SDR50 mode. */ -#endif -}; - -/*! @brief Enum _usdhc_wakeup_event. Wakeup event mask. - * @anchor _usdhc_wakeup_event - */ -enum -{ - kUSDHC_WakeupEventOnCardInt = USDHC_PROT_CTRL_WECINT_MASK, /*!< Wakeup on card interrupt. */ - kUSDHC_WakeupEventOnCardInsert = USDHC_PROT_CTRL_WECINS_MASK, /*!< Wakeup on card insertion. */ - kUSDHC_WakeupEventOnCardRemove = USDHC_PROT_CTRL_WECRM_MASK, /*!< Wakeup on card removal. */ - kUSDHC_WakeupEventsAll = - (kUSDHC_WakeupEventOnCardInt | kUSDHC_WakeupEventOnCardInsert | kUSDHC_WakeupEventOnCardRemove), - /*!< All wakeup events */ -}; - -/*! @brief Enum _usdhc_reset. Reset type mask. - * @anchor _usdhc_reset - */ -enum -{ - kUSDHC_ResetAll = USDHC_SYS_CTRL_RSTA_MASK, /*!< Reset all except card detection. */ - kUSDHC_ResetCommand = USDHC_SYS_CTRL_RSTC_MASK, /*!< Reset command line. */ - kUSDHC_ResetData = USDHC_SYS_CTRL_RSTD_MASK, /*!< Reset data line. */ - -#if defined(FSL_FEATURE_USDHC_HAS_SDR50_MODE) && (!FSL_FEATURE_USDHC_HAS_SDR50_MODE) - kUSDHC_ResetTuning = 0U, /*!< no reset tuning circuit bit */ -#else - kUSDHC_ResetTuning = USDHC_SYS_CTRL_RSTT_MASK, /*!< Reset tuning circuit. */ -#endif - - kUSDHC_ResetsAll = (kUSDHC_ResetAll | kUSDHC_ResetCommand | kUSDHC_ResetData | kUSDHC_ResetTuning), - /*!< All reset types */ -}; - -/*! @brief Enum _usdhc_transfer_flag. Transfer flag mask. */ -enum -{ - kUSDHC_EnableDmaFlag = USDHC_MIX_CTRL_DMAEN_MASK, /*!< Enable DMA. */ - - kUSDHC_CommandTypeSuspendFlag = USDHC_CMD_XFR_TYP_CMDTYP(1U), /*!< Suspend command. */ - kUSDHC_CommandTypeResumeFlag = USDHC_CMD_XFR_TYP_CMDTYP(2U), /*!< Resume command. */ - kUSDHC_CommandTypeAbortFlag = USDHC_CMD_XFR_TYP_CMDTYP(3U), /*!< Abort command. */ - - kUSDHC_EnableBlockCountFlag = USDHC_MIX_CTRL_BCEN_MASK, /*!< Enable block count. */ - kUSDHC_EnableAutoCommand12Flag = USDHC_MIX_CTRL_AC12EN_MASK, /*!< Enable auto CMD12. */ - kUSDHC_DataReadFlag = USDHC_MIX_CTRL_DTDSEL_MASK, /*!< Enable data read. */ - kUSDHC_MultipleBlockFlag = USDHC_MIX_CTRL_MSBSEL_MASK, /*!< Multiple block data read/write. */ - kUSDHC_EnableAutoCommand23Flag = USDHC_MIX_CTRL_AC23EN_MASK, /*!< Enable auto CMD23. */ - - kUSDHC_ResponseLength136Flag = USDHC_CMD_XFR_TYP_RSPTYP(1U), /*!< 136-bit response length. */ - kUSDHC_ResponseLength48Flag = USDHC_CMD_XFR_TYP_RSPTYP(2U), /*!< 48-bit response length. */ - kUSDHC_ResponseLength48BusyFlag = USDHC_CMD_XFR_TYP_RSPTYP(3U), /*!< 48-bit response length with busy status. */ - - kUSDHC_EnableCrcCheckFlag = USDHC_CMD_XFR_TYP_CCCEN_MASK, /*!< Enable CRC check. */ - kUSDHC_EnableIndexCheckFlag = USDHC_CMD_XFR_TYP_CICEN_MASK, /*!< Enable index check. */ - kUSDHC_DataPresentFlag = USDHC_CMD_XFR_TYP_DPSEL_MASK, /*!< Data present flag. */ -}; - -/*! @brief Enum _usdhc_present_status_flag. Present status flag mask. - * @anchor _usdhc_present_status_flag - */ -enum -{ - kUSDHC_CommandInhibitFlag = USDHC_PRES_STATE_CIHB_MASK, /*!< Command inhibit. */ - kUSDHC_DataInhibitFlag = USDHC_PRES_STATE_CDIHB_MASK, /*!< Data inhibit. */ - kUSDHC_DataLineActiveFlag = USDHC_PRES_STATE_DLA_MASK, /*!< Data line active. */ - kUSDHC_SdClockStableFlag = USDHC_PRES_STATE_SDSTB_MASK, /*!< SD bus clock stable. */ - kUSDHC_WriteTransferActiveFlag = USDHC_PRES_STATE_WTA_MASK, /*!< Write transfer active. */ - kUSDHC_ReadTransferActiveFlag = USDHC_PRES_STATE_RTA_MASK, /*!< Read transfer active. */ - kUSDHC_BufferWriteEnableFlag = USDHC_PRES_STATE_BWEN_MASK, /*!< Buffer write enable. */ - kUSDHC_BufferReadEnableFlag = USDHC_PRES_STATE_BREN_MASK, /*!< Buffer read enable. */ - -#if defined(FSL_FEATURE_USDHC_HAS_SDR50_MODE) && (!FSL_FEATURE_USDHC_HAS_SDR50_MODE) - kUSDHC_DelaySettingFinishedFlag = 0U, /*!< not support */ - kUSDHC_ReTuningRequestFlag = 0U, /*!< not support */ -#else - kUSDHC_ReTuningRequestFlag = USDHC_PRES_STATE_RTR_MASK, /*!< Re-tuning request flag, only used for SDR104 mode. */ - kUSDHC_DelaySettingFinishedFlag = USDHC_PRES_STATE_TSCD_MASK, /*!< Delay setting finished flag. */ -#endif - - kUSDHC_CardInsertedFlag = USDHC_PRES_STATE_CINST_MASK, /*!< Card inserted. */ - kUSDHC_CommandLineLevelFlag = USDHC_PRES_STATE_CLSL_MASK, /*!< Command line signal level. */ - - kUSDHC_Data0LineLevelFlag = 1U << USDHC_PRES_STATE_DLSL_SHIFT, /*!< Data0 line signal level. */ - kUSDHC_Data1LineLevelFlag = 1U << (USDHC_PRES_STATE_DLSL_SHIFT + 1U), /*!< Data1 line signal level. */ - kUSDHC_Data2LineLevelFlag = 1U << (USDHC_PRES_STATE_DLSL_SHIFT + 2U), /*!< Data2 line signal level. */ - kUSDHC_Data3LineLevelFlag = 1U << (USDHC_PRES_STATE_DLSL_SHIFT + 3U), /*!< Data3 line signal level. */ - kUSDHC_Data4LineLevelFlag = 1U << (USDHC_PRES_STATE_DLSL_SHIFT + 4U), /*!< Data4 line signal level. */ - kUSDHC_Data5LineLevelFlag = 1U << (USDHC_PRES_STATE_DLSL_SHIFT + 5U), /*!< Data5 line signal level. */ - kUSDHC_Data6LineLevelFlag = 1U << (USDHC_PRES_STATE_DLSL_SHIFT + 6U), /*!< Data6 line signal level. */ - kUSDHC_Data7LineLevelFlag = (int)(1U << (USDHC_PRES_STATE_DLSL_SHIFT + 7U)), /*!< Data7 line signal level. */ -}; - -/*! @brief Enum _usdhc_interrupt_status_flag. Interrupt status flag mask. - * @anchor _usdhc_interrupt_status_flag - */ -enum -{ - kUSDHC_CommandCompleteFlag = USDHC_INT_STATUS_CC_MASK, /*!< Command complete. */ - kUSDHC_DataCompleteFlag = USDHC_INT_STATUS_TC_MASK, /*!< Data complete. */ - kUSDHC_BlockGapEventFlag = USDHC_INT_STATUS_BGE_MASK, /*!< Block gap event. */ - kUSDHC_DmaCompleteFlag = USDHC_INT_STATUS_DINT_MASK, /*!< DMA interrupt. */ - kUSDHC_BufferWriteReadyFlag = USDHC_INT_STATUS_BWR_MASK, /*!< Buffer write ready. */ - kUSDHC_BufferReadReadyFlag = USDHC_INT_STATUS_BRR_MASK, /*!< Buffer read ready. */ - kUSDHC_CardInsertionFlag = USDHC_INT_STATUS_CINS_MASK, /*!< Card inserted. */ - kUSDHC_CardRemovalFlag = USDHC_INT_STATUS_CRM_MASK, /*!< Card removed. */ - kUSDHC_CardInterruptFlag = USDHC_INT_STATUS_CINT_MASK, /*!< Card interrupt. */ - -#if defined(FSL_FEATURE_USDHC_HAS_SDR50_MODE) && (!FSL_FEATURE_USDHC_HAS_SDR50_MODE) - kUSDHC_ReTuningEventFlag = 0U, /*!< Re-Tuning event, only for SD3.0 SDR104 mode. */ - kUSDHC_TuningPassFlag = 0U, /*!< SDR104 mode tuning pass flag. */ - kUSDHC_TuningErrorFlag = 0U, /*!< SDR104 tuning error flag. */ -#else - kUSDHC_ReTuningEventFlag = USDHC_INT_STATUS_RTE_MASK, /*!< Re-Tuning event, only for SD3.0 SDR104 mode. */ - kUSDHC_TuningPassFlag = USDHC_INT_STATUS_TP_MASK, /*!< SDR104 mode tuning pass flag. */ - kUSDHC_TuningErrorFlag = USDHC_INT_STATUS_TNE_MASK, /*!< SDR104 tuning error flag. */ -#endif - - kUSDHC_CommandTimeoutFlag = USDHC_INT_STATUS_CTOE_MASK, /*!< Command timeout error. */ - kUSDHC_CommandCrcErrorFlag = USDHC_INT_STATUS_CCE_MASK, /*!< Command CRC error. */ - kUSDHC_CommandEndBitErrorFlag = USDHC_INT_STATUS_CEBE_MASK, /*!< Command end bit error. */ - kUSDHC_CommandIndexErrorFlag = USDHC_INT_STATUS_CIE_MASK, /*!< Command index error. */ - kUSDHC_DataTimeoutFlag = USDHC_INT_STATUS_DTOE_MASK, /*!< Data timeout error. */ - kUSDHC_DataCrcErrorFlag = USDHC_INT_STATUS_DCE_MASK, /*!< Data CRC error. */ - kUSDHC_DataEndBitErrorFlag = USDHC_INT_STATUS_DEBE_MASK, /*!< Data end bit error. */ - kUSDHC_AutoCommand12ErrorFlag = USDHC_INT_STATUS_AC12E_MASK, /*!< Auto CMD12 error. */ - kUSDHC_DmaErrorFlag = USDHC_INT_STATUS_DMAE_MASK, /*!< DMA error. */ - - kUSDHC_CommandErrorFlag = (kUSDHC_CommandTimeoutFlag | kUSDHC_CommandCrcErrorFlag | kUSDHC_CommandEndBitErrorFlag | - kUSDHC_CommandIndexErrorFlag), /*!< Command error */ - kUSDHC_DataErrorFlag = (kUSDHC_DataTimeoutFlag | kUSDHC_DataCrcErrorFlag | kUSDHC_DataEndBitErrorFlag | - kUSDHC_AutoCommand12ErrorFlag), /*!< Data error */ - kUSDHC_ErrorFlag = (kUSDHC_CommandErrorFlag | kUSDHC_DataErrorFlag | kUSDHC_DmaErrorFlag), /*!< All error */ - - kUSDHC_DataFlag = (kUSDHC_DataCompleteFlag | kUSDHC_BufferWriteReadyFlag | kUSDHC_BufferReadReadyFlag | - kUSDHC_DataErrorFlag), /*!< Data interrupts */ - - kUSDHC_DataDMAFlag = (kUSDHC_DataCompleteFlag | kUSDHC_DataErrorFlag | kUSDHC_DmaErrorFlag), /*!< Data interrupts */ - - kUSDHC_CommandFlag = (kUSDHC_CommandErrorFlag | kUSDHC_CommandCompleteFlag), /*!< Command interrupts */ - kUSDHC_CardDetectFlag = (kUSDHC_CardInsertionFlag | kUSDHC_CardRemovalFlag), /*!< Card detection interrupts */ - kUSDHC_SDR104TuningFlag = (kUSDHC_TuningErrorFlag | kUSDHC_TuningPassFlag | kUSDHC_ReTuningEventFlag), - /*!< SDR104 tuning flag. */ - kUSDHC_AllInterruptFlags = - (kUSDHC_BlockGapEventFlag | kUSDHC_CardInterruptFlag | kUSDHC_CommandFlag | kUSDHC_DataFlag | kUSDHC_ErrorFlag | - kUSDHC_SDR104TuningFlag | kUSDHC_DmaCompleteFlag), /*!< All flags mask */ -}; - -/*! @brief Enum _usdhc_auto_command12_error_status_flag. Auto CMD12 error status flag mask. - * @anchor _usdhc_auto_command12_error_status_flag - */ -enum -{ - kUSDHC_AutoCommand12NotExecutedFlag = USDHC_AUTOCMD12_ERR_STATUS_AC12NE_MASK, /*!< Not executed error. */ - kUSDHC_AutoCommand12TimeoutFlag = USDHC_AUTOCMD12_ERR_STATUS_AC12TOE_MASK, /*!< Timeout error. */ - kUSDHC_AutoCommand12EndBitErrorFlag = USDHC_AUTOCMD12_ERR_STATUS_AC12EBE_MASK, /*!< End bit error. */ - kUSDHC_AutoCommand12CrcErrorFlag = USDHC_AUTOCMD12_ERR_STATUS_AC12CE_MASK, /*!< CRC error. */ - kUSDHC_AutoCommand12IndexErrorFlag = USDHC_AUTOCMD12_ERR_STATUS_AC12IE_MASK, /*!< Index error. */ - kUSDHC_AutoCommand12NotIssuedFlag = USDHC_AUTOCMD12_ERR_STATUS_CNIBAC12E_MASK, /*!< Not issued error. */ -}; - -/*! @brief Enum _usdhc_standard_tuning. Standard tuning flag. */ -enum -{ -#if defined(FSL_FEATURE_USDHC_HAS_SDR50_MODE) && (!FSL_FEATURE_USDHC_HAS_SDR50_MODE) - kUSDHC_ExecuteTuning = 0U, /*!< not support */ - kUSDHC_TuningSampleClockSel = 0U, /*!< not support */ -#else - kUSDHC_ExecuteTuning = USDHC_AUTOCMD12_ERR_STATUS_EXECUTE_TUNING_MASK, /*!< Used to start tuning procedure. */ - kUSDHC_TuningSampleClockSel = - USDHC_AUTOCMD12_ERR_STATUS_SMP_CLK_SEL_MASK, /*!< When std_tuning_en bit is set, this - bit is used to select sampleing clock. */ -#endif -}; - -/*! @brief Enum _usdhc_adma_error_status_flag. ADMA error status flag mask. - * @anchor _usdhc_adma_error_status_flag - */ -enum -{ - kUSDHC_AdmaLenghMismatchFlag = USDHC_ADMA_ERR_STATUS_ADMALME_MASK, /*!< Length mismatch error. */ - kUSDHC_AdmaDescriptorErrorFlag = USDHC_ADMA_ERR_STATUS_ADMADCE_MASK, /*!< Descriptor error. */ -}; - -/*! - * @brief Enum _usdhc_adma_error_state. ADMA error state. - * - * This state is the detail state when ADMA error has occurred. - */ -enum -{ - kUSDHC_AdmaErrorStateStopDma = 0x00U, - /*!< Stop DMA, previous location set in the ADMA system address is errored address. */ - kUSDHC_AdmaErrorStateFetchDescriptor = 0x01U, - /*!< Fetch descriptor, current location set in the ADMA system address is errored address. */ - kUSDHC_AdmaErrorStateChangeAddress = 0x02U, /*!< Change address, no DMA error has occurred. */ - kUSDHC_AdmaErrorStateTransferData = 0x03U, - /*!< Transfer data, previous location set in the ADMA system address is errored address. */ - kUSDHC_AdmaErrorStateInvalidLength = 0x04U, /*!< Invalid length in ADMA descriptor. */ - kUSDHC_AdmaErrorStateInvalidDescriptor = 0x08U, /*!< Invalid descriptor fetched by ADMA. */ - - kUSDHC_AdmaErrorState = kUSDHC_AdmaErrorStateInvalidLength | kUSDHC_AdmaErrorStateInvalidDescriptor | - kUSDHC_AdmaErrorStateFetchDescriptor, /*!< ADMA error state */ -}; - -/*! @brief Enum _usdhc_force_event. Force event bit position. - * @anchor _usdhc_force_event - */ -enum -{ - kUSDHC_ForceEventAutoCommand12NotExecuted = - USDHC_FORCE_EVENT_FEVTAC12NE_MASK, /*!< Auto CMD12 not executed error. */ - kUSDHC_ForceEventAutoCommand12Timeout = USDHC_FORCE_EVENT_FEVTAC12TOE_MASK, /*!< Auto CMD12 timeout error. */ - kUSDHC_ForceEventAutoCommand12CrcError = USDHC_FORCE_EVENT_FEVTAC12CE_MASK, /*!< Auto CMD12 CRC error. */ - kUSDHC_ForceEventEndBitError = USDHC_FORCE_EVENT_FEVTAC12EBE_MASK, /*!< Auto CMD12 end bit error. */ - kUSDHC_ForceEventAutoCommand12IndexError = USDHC_FORCE_EVENT_FEVTAC12IE_MASK, /*!< Auto CMD12 index error. */ - kUSDHC_ForceEventAutoCommand12NotIssued = USDHC_FORCE_EVENT_FEVTCNIBAC12E_MASK, /*!< Auto CMD12 not issued error. */ - kUSDHC_ForceEventCommandTimeout = USDHC_FORCE_EVENT_FEVTCTOE_MASK, /*!< Command timeout error. */ - kUSDHC_ForceEventCommandCrcError = USDHC_FORCE_EVENT_FEVTCCE_MASK, /*!< Command CRC error. */ - kUSDHC_ForceEventCommandEndBitError = USDHC_FORCE_EVENT_FEVTCEBE_MASK, /*!< Command end bit error. */ - kUSDHC_ForceEventCommandIndexError = USDHC_FORCE_EVENT_FEVTCIE_MASK, /*!< Command index error. */ - kUSDHC_ForceEventDataTimeout = USDHC_FORCE_EVENT_FEVTDTOE_MASK, /*!< Data timeout error. */ - kUSDHC_ForceEventDataCrcError = USDHC_FORCE_EVENT_FEVTDCE_MASK, /*!< Data CRC error. */ - kUSDHC_ForceEventDataEndBitError = USDHC_FORCE_EVENT_FEVTDEBE_MASK, /*!< Data end bit error. */ - kUSDHC_ForceEventAutoCommand12Error = USDHC_FORCE_EVENT_FEVTAC12E_MASK, /*!< Auto CMD12 error. */ - kUSDHC_ForceEventCardInt = (int)USDHC_FORCE_EVENT_FEVTCINT_MASK, /*!< Card interrupt. */ - kUSDHC_ForceEventDmaError = USDHC_FORCE_EVENT_FEVTDMAE_MASK, /*!< Dma error. */ -#if defined(FSL_FEATURE_USDHC_HAS_SDR50_MODE) && (!FSL_FEATURE_USDHC_HAS_SDR50_MODE) - kUSDHC_ForceEventTuningError = 0U, /*!< not support */ -#else - kUSDHC_ForceEventTuningError = USDHC_FORCE_EVENT_FEVTTNE_MASK, /*!< Tuning error. */ -#endif - - kUSDHC_ForceEventsAll = - (int)(USDHC_FORCE_EVENT_FEVTAC12NE_MASK | USDHC_FORCE_EVENT_FEVTAC12TOE_MASK | - USDHC_FORCE_EVENT_FEVTAC12CE_MASK | USDHC_FORCE_EVENT_FEVTAC12EBE_MASK | - USDHC_FORCE_EVENT_FEVTAC12IE_MASK | USDHC_FORCE_EVENT_FEVTCNIBAC12E_MASK | - USDHC_FORCE_EVENT_FEVTCTOE_MASK | USDHC_FORCE_EVENT_FEVTCCE_MASK | USDHC_FORCE_EVENT_FEVTCEBE_MASK | - USDHC_FORCE_EVENT_FEVTCIE_MASK | USDHC_FORCE_EVENT_FEVTDTOE_MASK | USDHC_FORCE_EVENT_FEVTDCE_MASK | - USDHC_FORCE_EVENT_FEVTDEBE_MASK | USDHC_FORCE_EVENT_FEVTAC12E_MASK | USDHC_FORCE_EVENT_FEVTCINT_MASK | - USDHC_FORCE_EVENT_FEVTDMAE_MASK | kUSDHC_ForceEventTuningError), /*!< All force event flags mask. */ -}; - -/*! @brief Data transfer direction. */ -typedef enum _usdhc_transfer_direction -{ - kUSDHC_TransferDirectionReceive = 1U, /*!< USDHC transfer direction receive. */ - kUSDHC_TransferDirectionSend = 0U, /*!< USDHC transfer direction send. */ -} usdhc_transfer_direction_t; - -/*! @brief Data transfer width. */ -typedef enum _usdhc_data_bus_width -{ - kUSDHC_DataBusWidth1Bit = 0U, /*!< 1-bit mode */ - kUSDHC_DataBusWidth4Bit = 1U, /*!< 4-bit mode */ - kUSDHC_DataBusWidth8Bit = 2U, /*!< 8-bit mode */ -} usdhc_data_bus_width_t; - -/*! @brief Endian mode */ -typedef enum _usdhc_endian_mode -{ - kUSDHC_EndianModeBig = 0U, /*!< Big endian mode. */ - kUSDHC_EndianModeHalfWordBig = 1U, /*!< Half word big endian mode. */ - kUSDHC_EndianModeLittle = 2U, /*!< Little endian mode. */ -} usdhc_endian_mode_t; - -/*! @brief DMA mode */ -typedef enum _usdhc_dma_mode -{ - kUSDHC_DmaModeSimple = 0U, /*!< External DMA. */ - kUSDHC_DmaModeAdma1 = 1U, /*!< ADMA1 is selected. */ - kUSDHC_DmaModeAdma2 = 2U, /*!< ADMA2 is selected. */ - kUSDHC_ExternalDMA = 3U, /*!< External DMA mode selected. */ -} usdhc_dma_mode_t; - -/*! @brief Enum _usdhc_sdio_control_flag. SDIO control flag mask. - * @anchor _usdhc_sdio_control_flag - */ -enum -{ - kUSDHC_StopAtBlockGapFlag = USDHC_PROT_CTRL_SABGREQ_MASK, /*!< Stop at block gap. */ - kUSDHC_ReadWaitControlFlag = USDHC_PROT_CTRL_RWCTL_MASK, /*!< Read wait control. */ - kUSDHC_InterruptAtBlockGapFlag = USDHC_PROT_CTRL_IABG_MASK, /*!< Interrupt at block gap. */ - kUSDHC_ReadDoneNo8CLK = USDHC_PROT_CTRL_RD_DONE_NO_8CLK_MASK, /*!< Read done without 8 clk for block gap. */ - kUSDHC_ExactBlockNumberReadFlag = USDHC_PROT_CTRL_NON_EXACT_BLK_RD_MASK, /*!< Exact block number read. */ -}; - -/*! @brief MMC card boot mode */ -typedef enum _usdhc_boot_mode -{ - kUSDHC_BootModeNormal = 0U, /*!< Normal boot */ - kUSDHC_BootModeAlternative = 1U, /*!< Alternative boot */ -} usdhc_boot_mode_t; - -/*! @brief The command type */ -typedef enum _usdhc_card_command_type -{ - kCARD_CommandTypeNormal = 0U, /*!< Normal command */ - kCARD_CommandTypeSuspend = 1U, /*!< Suspend command */ - kCARD_CommandTypeResume = 2U, /*!< Resume command */ - kCARD_CommandTypeAbort = 3U, /*!< Abort command */ - kCARD_CommandTypeEmpty = 4U, /*!< Empty command */ -} usdhc_card_command_type_t; - -/*! - * @brief The command response type. - * - * Defines the command response type from card to host controller. - */ -typedef enum _usdhc_card_response_type -{ - kCARD_ResponseTypeNone = 0U, /*!< Response type: none */ - kCARD_ResponseTypeR1 = 1U, /*!< Response type: R1 */ - kCARD_ResponseTypeR1b = 2U, /*!< Response type: R1b */ - kCARD_ResponseTypeR2 = 3U, /*!< Response type: R2 */ - kCARD_ResponseTypeR3 = 4U, /*!< Response type: R3 */ - kCARD_ResponseTypeR4 = 5U, /*!< Response type: R4 */ - kCARD_ResponseTypeR5 = 6U, /*!< Response type: R5 */ - kCARD_ResponseTypeR5b = 7U, /*!< Response type: R5b */ - kCARD_ResponseTypeR6 = 8U, /*!< Response type: R6 */ - kCARD_ResponseTypeR7 = 9U, /*!< Response type: R7 */ -} usdhc_card_response_type_t; - -/*! @brief The alignment size for ADDRESS filed in ADMA1's descriptor. */ -#define USDHC_ADMA1_ADDRESS_ALIGN (4096U) -/*! @brief The alignment size for LENGTH field in ADMA1's descriptor. */ -#define USDHC_ADMA1_LENGTH_ALIGN (4096U) -/*! @brief The alignment size for ADDRESS field in ADMA2's descriptor. */ -#define USDHC_ADMA2_ADDRESS_ALIGN (4U) -/*! @brief The alignment size for LENGTH filed in ADMA2's descriptor. */ -#define USDHC_ADMA2_LENGTH_ALIGN (4U) - -/* ADMA1 descriptor table: - * |------------------------|---------|--------------------------| - * | Address/page field |Reserved | Attribute | - * |------------------------|---------|--------------------------| - * |31 12|11 6|05 |04 |03|02 |01 |00 | - * |------------------------|---------|----|----|--|---|---|-----| - * | address or data length | 000000 |Act2|Act1| 0|Int|End|Valid| - * |------------------------|---------|----|----|--|---|---|-----| - * - * ADMA2 action table: - * |------|------|-----------------|-------|-------------| - * | Act2 | Act1 | Comment | 31-28 | 27 - 12 | - * |------|------|-----------------|---------------------| - * | 0 | 0 | No op | Don't care | - * |------|------|-----------------|-------|-------------| - * | 0 | 1 | Set data length | 0000 | Data Length | - * |------|------|-----------------|-------|-------------| - * | 1 | 0 | Transfer data | Data address | - * |------|------|-----------------|---------------------| - * | 1 | 1 | Link descriptor | Descriptor address | - * |------|------|-----------------|---------------------| - */ -/****************************tables below are created only for Doxygen*********************************/ -/*! @brief The bit shift for ADDRESS filed in ADMA1's descriptor. - * - * - *
ADMA1 descriptor table
Address/page field Reserved Attribute - *
31 12 11 6 05 04 03 02 01 00 - *
address or data length 000000 Act2 Act1 0 Int End Valid - *
- * - * - * - *
ADMA2 action
Act2 Act1 Comment 31-28 27-12 - *
0 0 No op Don't care - *
0 1 Set data length 0000 Data Length - *
1 0 Transfer data Data address - *
1 1 Link descriptor Descriptor address - *
- */ -#define USDHC_ADMA1_DESCRIPTOR_ADDRESS_SHIFT (12U) -/*! @brief The bit mask for ADDRESS field in ADMA1's descriptor. */ -#define USDHC_ADMA1_DESCRIPTOR_ADDRESS_MASK (0xFFFFFU) -/*! @brief The bit shift for LENGTH filed in ADMA1's descriptor. */ -#define USDHC_ADMA1_DESCRIPTOR_LENGTH_SHIFT (12U) -/*! @brief The mask for LENGTH field in ADMA1's descriptor. */ -#define USDHC_ADMA1_DESCRIPTOR_LENGTH_MASK (0xFFFFU) -/*! @brief The maximum value of LENGTH filed in ADMA1's descriptor. - * Since the max transfer size ADMA1 support is 65535 which is indivisible by - * 4096, so to make sure a large data load transfer (>64KB) continuously (require the data - * address be always align with 4096), software will set the maximum data length - * for ADMA1 to (64 - 4)KB. - */ -#define USDHC_ADMA1_DESCRIPTOR_MAX_LENGTH_PER_ENTRY (USDHC_ADMA1_DESCRIPTOR_LENGTH_MASK + 1U - 4096U) - -/*! @brief Enum _usdhc_adma1_descriptor_flag. The mask for the control/status field in ADMA1 descriptor. */ -enum -{ - kUSDHC_Adma1DescriptorValidFlag = (1U << 0U), /*!< Valid flag. */ - kUSDHC_Adma1DescriptorEndFlag = (1U << 1U), /*!< End flag. */ - kUSDHC_Adma1DescriptorInterrupFlag = (1U << 2U), /*!< Interrupt flag. */ - kUSDHC_Adma1DescriptorActivity1Flag = (1U << 4U), /*!< Activity 1 flag. */ - kUSDHC_Adma1DescriptorActivity2Flag = (1U << 5U), /*!< Activity 2 flag. */ - kUSDHC_Adma1DescriptorTypeNop = (kUSDHC_Adma1DescriptorValidFlag), /*!< No operation. */ - kUSDHC_Adma1DescriptorTypeTransfer = (kUSDHC_Adma1DescriptorActivity2Flag | kUSDHC_Adma1DescriptorValidFlag), - /*!< Transfer data. */ - kUSDHC_Adma1DescriptorTypeLink = (kUSDHC_Adma1DescriptorActivity1Flag | kUSDHC_Adma1DescriptorActivity2Flag | - kUSDHC_Adma1DescriptorValidFlag), /*!< Link descriptor. */ - kUSDHC_Adma1DescriptorTypeSetLength = (kUSDHC_Adma1DescriptorActivity1Flag | kUSDHC_Adma1DescriptorValidFlag), - /*!< Set data length. */ -}; - -/* ADMA2 descriptor table: - * |----------------|---------------|-------------|--------------------------| - * | Address field | Length | Reserved | Attribute | - * |----------------|---------------|-------------|--------------------------| - * |63 32|31 16|15 06|05 |04 |03|02 |01 |00 | - * |----------------|---------------|-------------|----|----|--|---|---|-----| - * | 32-bit address | 16-bit length | 0000000000 |Act2|Act1| 0|Int|End|Valid| - * |----------------|---------------|-------------|----|----|--|---|---|-----| - * - * ADMA2 action table: - * | Act2 | Act1 | Comment | Operation | - * |------|------|-----------------|-------------------------------------------------------------------| - * | 0 | 0 | No op | Don't care | - * |------|------|-----------------|-------------------------------------------------------------------| - * | 0 | 1 | Reserved | Read this line and go to next one | - * |------|------|-----------------|-------------------------------------------------------------------| - * | 1 | 0 | Transfer data | Transfer data with address and length set in this descriptor line | - * |------|------|-----------------|-------------------------------------------------------------------| - * | 1 | 1 | Link descriptor | Link to another descriptor | - * |------|------|-----------------|-------------------------------------------------------------------| - */ -/**********************************tables below are created only for Doxygen***********************************/ -/*! @brief The bit shift for LENGTH field in ADMA2's descriptor. - * - * - * - *
ADMA2 descriptor table
Address field Length Reserved Attribute - *
63 32 31 16 15 06 05 04 03 02 01 00 - *
32-bit address 16-bit length 0000000000 Act2 Act1 0 Int End Valid - *
- * - * - * - *
ADMA2 action
Act2 Act1 Comment Operation - *
0 0 No op Don't care - *
0 1 Reserved Read this line and go to next one - *
1 0 Transfer data Transfer data with address and length set in this descriptor line - *
1 1 Link descriptor Link to another descriptor - *
- */ -#define USDHC_ADMA2_DESCRIPTOR_LENGTH_SHIFT (16U) -/*! @brief The bit mask for LENGTH field in ADMA2's descriptor. */ -#define USDHC_ADMA2_DESCRIPTOR_LENGTH_MASK (0xFFFFU) -/*! @brief The maximum value of LENGTH field in ADMA2's descriptor. */ -#define USDHC_ADMA2_DESCRIPTOR_MAX_LENGTH_PER_ENTRY (USDHC_ADMA2_DESCRIPTOR_LENGTH_MASK - 3U) - -/*! @brief Enum _usdhc_adma2_descriptor_flag. ADMA1 descriptor control and status mask. */ -enum -{ - kUSDHC_Adma2DescriptorValidFlag = (1U << 0U), /*!< Valid flag. */ - kUSDHC_Adma2DescriptorEndFlag = (1U << 1U), /*!< End flag. */ - kUSDHC_Adma2DescriptorInterruptFlag = (1U << 2U), /*!< Interrupt flag. */ - kUSDHC_Adma2DescriptorActivity1Flag = (1U << 4U), /*!< Activity 1 mask. */ - kUSDHC_Adma2DescriptorActivity2Flag = (1U << 5U), /*!< Activity 2 mask. */ - - kUSDHC_Adma2DescriptorTypeNop = (kUSDHC_Adma2DescriptorValidFlag), /*!< No operation. */ - kUSDHC_Adma2DescriptorTypeReserved = (kUSDHC_Adma2DescriptorActivity1Flag | kUSDHC_Adma2DescriptorValidFlag), - /*!< Reserved. */ - kUSDHC_Adma2DescriptorTypeTransfer = (kUSDHC_Adma2DescriptorActivity2Flag | kUSDHC_Adma2DescriptorValidFlag), - /*!< Transfer type. */ - kUSDHC_Adma2DescriptorTypeLink = (kUSDHC_Adma2DescriptorActivity1Flag | kUSDHC_Adma2DescriptorActivity2Flag | - kUSDHC_Adma2DescriptorValidFlag), /*!< Link type. */ -}; - -/*! @brief Enum _usdhc_adma_flag. ADMA descriptor configuration flag. - * @anchor _usdhc_adma_flag - */ -enum -{ - kUSDHC_AdmaDescriptorSingleFlag = 0U, - /*!< Try to finish the transfer in a single ADMA descriptor. If transfer size is bigger than one - ADMA descriptor's ability, new another descriptor for data transfer. */ - kUSDHC_AdmaDescriptorMultipleFlag = - 1U, /*!< Create multiple ADMA descriptors within the ADMA table, this is used for - mmc boot mode specifically, which need - to modify the ADMA descriptor on the fly, so the flag should be used - combining with stop at block gap feature. */ -}; - -/*! @brief DMA transfer burst len config. */ -typedef enum _usdhc_burst_len -{ - kUSDHC_EnBurstLenForINCR = 0x01U, /*!< Enable burst len for INCR. */ - kUSDHC_EnBurstLenForINCR4816 = 0x02U, /*!< Enable burst len for INCR4/INCR8/INCR16. */ - kUSDHC_EnBurstLenForINCR4816WRAP = 0x04U, /*!< Enable burst len for INCR4/8/16 WRAP. */ -} usdhc_burst_len_t; - -/*! @brief Enum _usdhc_transfer_data_type. Tansfer data type definition. */ -enum -{ - kUSDHC_TransferDataNormal = 0U, /*!< Transfer normal read/write data. */ - kUSDHC_TransferDataTuning = 1U, /*!< Transfer tuning data. */ - kUSDHC_TransferDataBoot = 2U, /*!< Transfer boot data. */ - kUSDHC_TransferDataBootcontinous = 3U, /*!< Transfer boot data continuously. */ -}; - -/*! @brief Defines the ADMA1 descriptor structure. */ -typedef uint32_t usdhc_adma1_descriptor_t; - -/*! @brief Defines the ADMA2 descriptor structure. */ -typedef struct _usdhc_adma2_descriptor -{ - uint32_t attribute; /*!< The control and status field. */ - const uint32_t *address; /*!< The address field. */ -} usdhc_adma2_descriptor_t; - -/*! - * @brief USDHC capability information. - * - * Defines a structure to save the capability information of USDHC. - */ -typedef struct _usdhc_capability -{ - uint32_t sdVersion; /*!< Support SD card/sdio version. */ - uint32_t mmcVersion; /*!< Support EMMC card version. */ - uint32_t maxBlockLength; /*!< Maximum block length united as byte. */ - uint32_t maxBlockCount; /*!< Maximum block count can be set one time. */ - uint32_t flags; /*!< Capability flags to indicate the support information(@ref _usdhc_capability_flag). */ -} usdhc_capability_t; - -/*! @brief Data structure to configure the MMC boot feature. */ -typedef struct _usdhc_boot_config -{ - uint32_t ackTimeoutCount; /*!< Timeout value for the boot ACK. The available range is 0 ~ 15. */ - usdhc_boot_mode_t bootMode; /*!< Boot mode selection. */ - uint32_t blockCount; /*!< Stop at block gap value of automatic mode. Available range is 0 ~ 65535. */ - size_t blockSize; /*!< Block size. */ - bool enableBootAck; /*!< Enable or disable boot ACK. */ - bool enableAutoStopAtBlockGap; /*!< Enable or disable auto stop at block gap function in boot period. */ -} usdhc_boot_config_t; - -/*! @brief Data structure to initialize the USDHC. */ -typedef struct _usdhc_config -{ - uint32_t dataTimeout; /*!< Data timeout value. */ - usdhc_endian_mode_t endianMode; /*!< Endian mode. */ - uint8_t readWatermarkLevel; /*!< Watermark level for DMA read operation. Available range is 1 ~ 128. */ - uint8_t writeWatermarkLevel; /*!< Watermark level for DMA write operation. Available range is 1 ~ 128. */ -#if !(defined(FSL_FEATURE_USDHC_HAS_NO_RW_BURST_LEN) && FSL_FEATURE_USDHC_HAS_NO_RW_BURST_LEN) - uint8_t readBurstLen; /*!< Read burst len. */ - uint8_t writeBurstLen; /*!< Write burst len. */ -#endif -} usdhc_config_t; - -/*! - * @brief Card command descriptor. - * - * Defines card command-related attribute. - */ -typedef struct _usdhc_command -{ - uint32_t index; /*!< Command index. */ - uint32_t argument; /*!< Command argument. */ - usdhc_card_command_type_t type; /*!< Command type. */ - usdhc_card_response_type_t responseType; /*!< Command response type. */ - uint32_t response[4U]; /*!< Response for this command. */ - uint32_t responseErrorFlags; /*!< Response error flag, which need to check - the command reponse. */ - uint32_t flags; /*!< Cmd flags. */ -} usdhc_command_t; - -/*! @brief ADMA configuration. */ -typedef struct _usdhc_adma_config -{ - usdhc_dma_mode_t dmaMode; /*!< DMA mode. */ -#if !(defined(FSL_FEATURE_USDHC_HAS_NO_RW_BURST_LEN) && FSL_FEATURE_USDHC_HAS_NO_RW_BURST_LEN) - usdhc_burst_len_t burstLen; /*!< Burst len config. */ -#endif - uint32_t *admaTable; /*!< ADMA table address, can't be null if transfer way is ADMA1/ADMA2. */ - uint32_t admaTableWords; /*!< ADMA table length united as words, can't be 0 if transfer way is ADMA1/ADMA2. */ -} usdhc_adma_config_t; - -/*! - * @brief Card scatter gather data list. - * - * Allow application register uncontinuous data buffer for data transfer. - */ -typedef struct _usdhc_scatter_gather_data_list -{ - uint32_t *dataAddr; - uint32_t dataSize; - struct _usdhc_scatter_gather_data_list *dataList; -} usdhc_scatter_gather_data_list_t; - -/*! - * @brief Card scatter gather data descriptor. - * - * Defines a structure to contain data-related attribute. The 'enableIgnoreError' is used when upper card - * driver wants to ignore the error event to read/write all the data and not to stop read/write immediately when an - * error event happens. For example, bus testing procedure for MMC card. - */ -typedef struct _usdhc_scatter_gather_data -{ - bool enableAutoCommand12; /*!< Enable auto CMD12. */ - bool enableAutoCommand23; /*!< Enable auto CMD23. */ - bool enableIgnoreError; /*!< Enable to ignore error event to read/write all the data. */ - - usdhc_transfer_direction_t dataDirection; /*!< data direction */ - uint8_t dataType; /*!< this is used to distinguish the normal/tuning/boot data. */ - size_t blockSize; /*!< Block size. */ - - usdhc_scatter_gather_data_list_t sgData; /*!< scatter gather data */ -} usdhc_scatter_gather_data_t; - -/*! @brief usdhc scatter gather transfer. */ -typedef struct _usdhc_scatter_gather_transfer -{ - usdhc_scatter_gather_data_t *data; /*!< Data to transfer. */ - usdhc_command_t *command; /*!< Command to send. */ -} usdhc_scatter_gather_transfer_t; - -/*! - * @brief Card data descriptor. - * - * Defines a structure to contain data-related attribute. The 'enableIgnoreError' is used when upper card - * driver wants to ignore the error event to read/write all the data and not to stop read/write immediately when an - * error event happens. For example, bus testing procedure for MMC card. - */ -typedef struct _usdhc_data -{ - bool enableAutoCommand12; /*!< Enable auto CMD12. */ - bool enableAutoCommand23; /*!< Enable auto CMD23. */ - bool enableIgnoreError; /*!< Enable to ignore error event to read/write all the data. */ - uint8_t dataType; /*!< this is used to distinguish the normal/tuning/boot data. */ - size_t blockSize; /*!< Block size. */ - uint32_t blockCount; /*!< Block count. */ - uint32_t *rxData; /*!< Buffer to save data read. */ - const uint32_t *txData; /*!< Data buffer to write. */ -} usdhc_data_t; - -/*! @brief Transfer state. */ -typedef struct _usdhc_transfer -{ - usdhc_data_t *data; /*!< Data to transfer. */ - usdhc_command_t *command; /*!< Command to send. */ -} usdhc_transfer_t; - -/*! @brief USDHC handle typedef. */ -typedef struct _usdhc_handle usdhc_handle_t; - -/*! @brief USDHC callback functions. */ -typedef struct _usdhc_transfer_callback -{ - void (*CardInserted)(USDHC_Type *base, - void *userData); /*!< Card inserted occurs when DAT3/CD pin is for card detect */ - void (*CardRemoved)(USDHC_Type *base, void *userData); /*!< Card removed occurs */ - void (*SdioInterrupt)(USDHC_Type *base, void *userData); /*!< SDIO card interrupt occurs */ - void (*BlockGap)(USDHC_Type *base, void *userData); /*!< stopped at block gap event */ - void (*TransferComplete)(USDHC_Type *base, - usdhc_handle_t *handle, - status_t status, - void *userData); /*!< Transfer complete callback. */ - void (*ReTuning)(USDHC_Type *base, void *userData); /*!< Handle the re-tuning. */ -} usdhc_transfer_callback_t; - -/*! - * @brief USDHC handle. - * - * Defines the structure to save the USDHC state information and callback function. - * - * @note All the fields except interruptFlags and transferredWords must be allocated by the user. - */ -struct _usdhc_handle -{ -#if (defined FSL_USDHC_ENABLE_SCATTER_GATHER_TRANSFER) && FSL_USDHC_ENABLE_SCATTER_GATHER_TRANSFER - usdhc_scatter_gather_data_t *volatile data; /*!< scatter gather data pointer */ -#else - usdhc_data_t *volatile data; /*!< Transfer parameter. Data to transfer. */ -#endif - usdhc_command_t *volatile command; /*!< Transfer parameter. Command to send. */ - - volatile uint32_t transferredWords; /*!< Transfer status. Words transferred by DATAPORT way. */ - - usdhc_transfer_callback_t callback; /*!< Callback function. */ - void *userData; /*!< Parameter for transfer complete callback. */ -}; - -/*! @brief USDHC transfer function. */ -typedef status_t (*usdhc_transfer_function_t)(USDHC_Type *base, usdhc_transfer_t *content); - -/*! @brief USDHC host descriptor. */ -typedef struct _usdhc_host -{ - USDHC_Type *base; /*!< USDHC peripheral base address. */ - uint32_t sourceClock_Hz; /*!< USDHC source clock frequency united in Hz. */ - usdhc_config_t config; /*!< USDHC configuration. */ - usdhc_capability_t capability; /*!< USDHC capability information. */ - usdhc_transfer_function_t transfer; /*!< USDHC transfer function. */ -} usdhc_host_t; - -/************************************************************************************************* - * API - ************************************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief USDHC module initialization function. - * - * Configures the USDHC according to the user configuration. - * - * Example: - @code - usdhc_config_t config; - config.cardDetectDat3 = false; - config.endianMode = kUSDHC_EndianModeLittle; - config.dmaMode = kUSDHC_DmaModeAdma2; - config.readWatermarkLevel = 128U; - config.writeWatermarkLevel = 128U; - USDHC_Init(USDHC, &config); - @endcode - * - * @param base USDHC peripheral base address. - * @param config USDHC configuration information. - * @retval #kStatus_Success Operate successfully. - */ -void USDHC_Init(USDHC_Type *base, const usdhc_config_t *config); - -/*! - * @brief Deinitializes the USDHC. - * - * @param base USDHC peripheral base address. - */ -void USDHC_Deinit(USDHC_Type *base); - -/*! - * @brief Resets the USDHC. - * - * @param base USDHC peripheral base address. - * @param mask The reset type mask(@ref _usdhc_reset). - * @param timeout Timeout for reset. - * @retval true Reset successfully. - * @retval false Reset failed. - */ -bool USDHC_Reset(USDHC_Type *base, uint32_t mask, uint32_t timeout); - -/*! @} */ - -/*! - * @name DMA Control - * @{ - */ - -/*! - * @brief Sets the DMA descriptor table configuration. - * A high level DMA descriptor configuration function. - * @param base USDHC peripheral base address. - * @param dmaConfig ADMA configuration - * @param dataConfig Data descriptor - * @param flags ADAM descriptor flag, used to indicate to create multiple or single descriptor, please - * refer to enum @ref _usdhc_adma_flag. - * @retval #kStatus_OutOfRange ADMA descriptor table length isn't enough to describe data. - * @retval #kStatus_Success Operate successfully. - */ -status_t USDHC_SetAdmaTableConfig(USDHC_Type *base, - usdhc_adma_config_t *dmaConfig, - usdhc_data_t *dataConfig, - uint32_t flags); - -/*! - * @brief Internal DMA configuration. - * This function is used to config the USDHC DMA related registers. - * @param base USDHC peripheral base address. - * @param dmaConfig ADMA configuration. - * @param dataAddr Transfer data address, a simple DMA parameter, if ADMA is used, leave it to NULL. - * @param enAutoCmd23 Flag to indicate Auto CMD23 is enable or not, a simple DMA parameter, if ADMA is used, leave it - * to false. - * @retval #kStatus_OutOfRange ADMA descriptor table length isn't enough to describe data. - * @retval #kStatus_Success Operate successfully. - */ -status_t USDHC_SetInternalDmaConfig(USDHC_Type *base, - usdhc_adma_config_t *dmaConfig, - const uint32_t *dataAddr, - bool enAutoCmd23); - -/*! - * @brief Sets the ADMA2 descriptor table configuration. - * - * @param admaTable ADMA table address. - * @param admaTableWords ADMA table length. - * @param dataBufferAddr Data buffer address. - * @param dataBytes Data Data length. - * @param flags ADAM descriptor flag, used to indicate to create multiple or single descriptor, please - * refer to enum @ref _usdhc_adma_flag. - * @retval #kStatus_OutOfRange ADMA descriptor table length isn't enough to describe data. - * @retval #kStatus_Success Operate successfully. - */ -status_t USDHC_SetADMA2Descriptor( - uint32_t *admaTable, uint32_t admaTableWords, const uint32_t *dataBufferAddr, uint32_t dataBytes, uint32_t flags); - -/*! - * @brief Sets the ADMA1 descriptor table configuration. - * - * @param admaTable ADMA table address. - * @param admaTableWords ADMA table length. - * @param dataBufferAddr Data buffer address. - * @param dataBytes Data length. - * @param flags ADAM descriptor flag, used to indicate to create multiple or single descriptor, please - * refer to enum @ref _usdhc_adma_flag. - * @retval #kStatus_OutOfRange ADMA descriptor table length isn't enough to describe data. - * @retval #kStatus_Success Operate successfully. - */ -status_t USDHC_SetADMA1Descriptor( - uint32_t *admaTable, uint32_t admaTableWords, const uint32_t *dataBufferAddr, uint32_t dataBytes, uint32_t flags); - -/*! - * @brief Enables internal DMA. - * - * @param base USDHC peripheral base address. - * @param enable enable or disable flag - */ -static inline void USDHC_EnableInternalDMA(USDHC_Type *base, bool enable) -{ - if (enable) - { - base->MIX_CTRL |= USDHC_MIX_CTRL_DMAEN_MASK; - } - else - { - base->MIX_CTRL &= ~USDHC_MIX_CTRL_DMAEN_MASK; - base->PROT_CTRL &= ~USDHC_PROT_CTRL_DMASEL_MASK; - } -} - -/*! @} */ - -/*! - * @name Interrupts - * @{ - */ - -/*! - * @brief Enables the interrupt status. - * - * @param base USDHC peripheral base address. - * @param mask Interrupt status flags mask(@ref _usdhc_interrupt_status_flag). - */ -static inline void USDHC_EnableInterruptStatus(USDHC_Type *base, uint32_t mask) -{ - base->INT_STATUS_EN |= mask; -} - -/*! - * @brief Disables the interrupt status. - * - * @param base USDHC peripheral base address. - * @param mask The interrupt status flags mask(@ref _usdhc_interrupt_status_flag). - */ -static inline void USDHC_DisableInterruptStatus(USDHC_Type *base, uint32_t mask) -{ - base->INT_STATUS_EN &= ~mask; -} - -/*! - * @brief Enables the interrupt signal corresponding to the interrupt status flag. - * - * @param base USDHC peripheral base address. - * @param mask The interrupt status flags mask(@ref _usdhc_interrupt_status_flag). - */ -static inline void USDHC_EnableInterruptSignal(USDHC_Type *base, uint32_t mask) -{ - base->INT_SIGNAL_EN |= mask; -} - -/*! - * @brief Disables the interrupt signal corresponding to the interrupt status flag. - * - * @param base USDHC peripheral base address. - * @param mask The interrupt status flags mask(@ref _usdhc_interrupt_status_flag). - */ -static inline void USDHC_DisableInterruptSignal(USDHC_Type *base, uint32_t mask) -{ - base->INT_SIGNAL_EN &= ~mask; -} - -/*! @} */ - -/*! - * @name Status - * @{ - */ - -/*! - * @brief Gets the enabled interrupt status. - * - * @param base USDHC peripheral base address. - * @return Current interrupt status flags mask(@ref _usdhc_interrupt_status_flag). - */ -static inline uint32_t USDHC_GetEnabledInterruptStatusFlags(USDHC_Type *base) -{ - uint32_t intStatus = base->INT_STATUS; - - return intStatus & base->INT_SIGNAL_EN; -} - -/*! - * @brief Gets the current interrupt status. - * - * @param base USDHC peripheral base address. - * @return Current interrupt status flags mask(@ref _usdhc_interrupt_status_flag). - */ -static inline uint32_t USDHC_GetInterruptStatusFlags(USDHC_Type *base) -{ - return base->INT_STATUS; -} - -/*! - * @brief Clears a specified interrupt status. - * write 1 clears - * @param base USDHC peripheral base address. - * @param mask The interrupt status flags mask(@ref _usdhc_interrupt_status_flag). - */ -static inline void USDHC_ClearInterruptStatusFlags(USDHC_Type *base, uint32_t mask) -{ - base->INT_STATUS = mask; -} - -/*! - * @brief Gets the status of auto command 12 error. - * - * @param base USDHC peripheral base address. - * @return Auto command 12 error status flags mask(@ref _usdhc_auto_command12_error_status_flag). - */ -static inline uint32_t USDHC_GetAutoCommand12ErrorStatusFlags(USDHC_Type *base) -{ - return base->AUTOCMD12_ERR_STATUS; -} - -/*! - * @brief Gets the status of the ADMA error. - * - * @param base USDHC peripheral base address. - * @return ADMA error status flags mask(@ref _usdhc_adma_error_status_flag). - */ -static inline uint32_t USDHC_GetAdmaErrorStatusFlags(USDHC_Type *base) -{ - return base->ADMA_ERR_STATUS & 0xFUL; -} - -/*! - * @brief Gets a present status. - * - * This function gets the present USDHC's status except for an interrupt status and an error status. - * - * @param base USDHC peripheral base address. - * @return Present USDHC's status flags mask(@ref _usdhc_present_status_flag). - */ -static inline uint32_t USDHC_GetPresentStatusFlags(USDHC_Type *base) -{ - return base->PRES_STATE; -} - -/*! @} */ - -/*! - * @name Bus Operations - * @{ - */ - -/*! - * @brief Gets the capability information. - * - * @param base USDHC peripheral base address. - * @param capability Structure to save capability information. - */ -void USDHC_GetCapability(USDHC_Type *base, usdhc_capability_t *capability); - -/*! - * @brief Forces the card clock on. - * - * @param base USDHC peripheral base address. - * @param enable enable/disable flag - */ -static inline void USDHC_ForceClockOn(USDHC_Type *base, bool enable) -{ - if (enable) - { - base->VEND_SPEC |= USDHC_VEND_SPEC_FRC_SDCLK_ON_MASK; - } - else - { - base->VEND_SPEC &= ~USDHC_VEND_SPEC_FRC_SDCLK_ON_MASK; - } -} - -/*! - * @brief Sets the SD bus clock frequency. - * - * @param base USDHC peripheral base address. - * @param srcClock_Hz USDHC source clock frequency united in Hz. - * @param busClock_Hz SD bus clock frequency united in Hz. - * - * @return The nearest frequency of busClock_Hz configured for SD bus. - */ -uint32_t USDHC_SetSdClock(USDHC_Type *base, uint32_t srcClock_Hz, uint32_t busClock_Hz); - -/*! - * @brief Sends 80 clocks to the card to set it to the active state. - * - * This function must be called each time the card is inserted to ensure that the card can receive the command - * correctly. - * - * @param base USDHC peripheral base address. - * @param timeout Timeout to initialize card. - * @retval true Set card active successfully. - * @retval false Set card active failed. - */ -bool USDHC_SetCardActive(USDHC_Type *base, uint32_t timeout); - -/*! - * @brief Triggers a hardware reset. - * - * @param base USDHC peripheral base address. - * @param high 1 or 0 level - */ -static inline void USDHC_AssertHardwareReset(USDHC_Type *base, bool high) -{ - if (high) - { - base->SYS_CTRL |= USDHC_SYS_CTRL_IPP_RST_N_MASK; - } - else - { - base->SYS_CTRL &= ~USDHC_SYS_CTRL_IPP_RST_N_MASK; - } -} - -/*! - * @brief Sets the data transfer width. - * - * @param base USDHC peripheral base address. - * @param width Data transfer width. - */ -static inline void USDHC_SetDataBusWidth(USDHC_Type *base, usdhc_data_bus_width_t width) -{ - base->PROT_CTRL = ((base->PROT_CTRL & ~USDHC_PROT_CTRL_DTW_MASK) | USDHC_PROT_CTRL_DTW(width)); -} - -/*! - * @brief Fills the data port. - * - * This function is used to implement the data transfer by Data Port instead of DMA. - * - * @param base USDHC peripheral base address. - * @param data The data about to be sent. - */ -static inline void USDHC_WriteData(USDHC_Type *base, uint32_t data) -{ - base->DATA_BUFF_ACC_PORT = data; -} - -/*! - * @brief Retrieves the data from the data port. - * - * This function is used to implement the data transfer by Data Port instead of DMA. - * - * @param base USDHC peripheral base address. - * @return The data has been read. - */ -static inline uint32_t USDHC_ReadData(USDHC_Type *base) -{ - return base->DATA_BUFF_ACC_PORT; -} - -/*! - * @brief Sends command function. - * - * @param base USDHC peripheral base address. - * @param command configuration - */ -void USDHC_SendCommand(USDHC_Type *base, usdhc_command_t *command); - -/*! - * @brief Enables or disables a wakeup event in low-power mode. - * - * @param base USDHC peripheral base address. - * @param mask Wakeup events mask(@ref _usdhc_wakeup_event). - * @param enable True to enable, false to disable. - */ -static inline void USDHC_EnableWakeupEvent(USDHC_Type *base, uint32_t mask, bool enable) -{ - if (enable) - { - base->PROT_CTRL |= mask; - } - else - { - base->PROT_CTRL &= ~mask; - } -} - -/*! - * @brief Detects card insert status. - * - * @param base USDHC peripheral base address. - * @param enable enable/disable flag - */ -static inline void USDHC_CardDetectByData3(USDHC_Type *base, bool enable) -{ - if (enable) - { - base->PROT_CTRL |= USDHC_PROT_CTRL_D3CD_MASK; - } - else - { - base->PROT_CTRL &= ~USDHC_PROT_CTRL_D3CD_MASK; - } -} - -/*! - * @brief Detects card insert status. - * - * @param base USDHC peripheral base address. - */ -static inline bool USDHC_DetectCardInsert(USDHC_Type *base) -{ - return ((base->PRES_STATE & (uint32_t)kUSDHC_CardInsertedFlag) != 0UL) ? true : false; -} - -/*! - * @brief Enables or disables the SDIO card control. - * - * @param base USDHC peripheral base address. - * @param mask SDIO card control flags mask(@ref _usdhc_sdio_control_flag). - * @param enable True to enable, false to disable. - */ -static inline void USDHC_EnableSdioControl(USDHC_Type *base, uint32_t mask, bool enable) -{ - if (enable) - { - base->PROT_CTRL |= mask; - } - else - { - base->PROT_CTRL &= ~mask; - } -} - -/*! - * @brief Restarts a transaction which has stopped at the block GAP for the SDIO card. - * - * @param base USDHC peripheral base address. - */ -static inline void USDHC_SetContinueRequest(USDHC_Type *base) -{ - base->PROT_CTRL |= USDHC_PROT_CTRL_CREQ_MASK; -} - -/*! - * @brief Request stop at block gap function. - * - * @param base USDHC peripheral base address. - * @param enable True to stop at block gap, false to normal transfer. - */ -static inline void USDHC_RequestStopAtBlockGap(USDHC_Type *base, bool enable) -{ - if (enable) - { - base->PROT_CTRL |= USDHC_PROT_CTRL_SABGREQ_MASK; - } - else - { - base->PROT_CTRL &= ~USDHC_PROT_CTRL_SABGREQ_MASK; - } -} - -/*! - * @brief Configures the MMC boot feature. - * - * Example: - @code - usdhc_boot_config_t config; - config.ackTimeoutCount = 4; - config.bootMode = kUSDHC_BootModeNormal; - config.blockCount = 5; - config.enableBootAck = true; - config.enableBoot = true; - config.enableAutoStopAtBlockGap = true; - USDHC_SetMmcBootConfig(USDHC, &config); - @endcode - * - * @param base USDHC peripheral base address. - * @param config The MMC boot configuration information. - */ -void USDHC_SetMmcBootConfig(USDHC_Type *base, const usdhc_boot_config_t *config); - -/*! - * @brief Enables or disables the mmc boot mode. - * - * @param base USDHC peripheral base address. - * @param enable True to enable, false to disable. - */ -static inline void USDHC_EnableMmcBoot(USDHC_Type *base, bool enable) -{ - if (enable) - { - base->MMC_BOOT |= USDHC_MMC_BOOT_BOOT_EN_MASK; - } - else - { - base->MMC_BOOT &= ~USDHC_MMC_BOOT_BOOT_EN_MASK; - } -} - -/*! - * @brief Forces generating events according to the given mask. - * - * @param base USDHC peripheral base address. - * @param mask The force events bit posistion (_usdhc_force_event). - */ -static inline void USDHC_SetForceEvent(USDHC_Type *base, uint32_t mask) -{ - base->FORCE_EVENT = mask; -} - -#if !(defined(FSL_FEATURE_USDHC_HAS_NO_VOLTAGE_SELECT) && (FSL_FEATURE_USDHC_HAS_NO_VOLTAGE_SELECT)) -/*! - * @brief Selects the USDHC output voltage. - * - * @param base USDHC peripheral base address. - * @param en18v True means 1.8V, false means 3.0V. - */ -static inline void UDSHC_SelectVoltage(USDHC_Type *base, bool en18v) -{ - if (en18v) - { - base->VEND_SPEC |= USDHC_VEND_SPEC_VSELECT_MASK; - } - else - { - base->VEND_SPEC &= ~USDHC_VEND_SPEC_VSELECT_MASK; - } -} -#endif - -#if defined(FSL_FEATURE_USDHC_HAS_SDR50_MODE) && (FSL_FEATURE_USDHC_HAS_SDR50_MODE) -/*! - * @brief Checks the SDR50 mode request tuning bit. - * When this bit set, application shall perform tuning for SDR50 mode. - * @param base USDHC peripheral base address. - */ -static inline bool USDHC_RequestTuningForSDR50(USDHC_Type *base) -{ - return ((base->HOST_CTRL_CAP & USDHC_HOST_CTRL_CAP_USE_TUNING_SDR50_MASK) != 0UL) ? true : false; -} - -/*! - * @brief Checks the request re-tuning bit. - * When this bit is set, user should do manual tuning or standard tuning function. - * @param base USDHC peripheral base address. - */ -static inline bool USDHC_RequestReTuning(USDHC_Type *base) -{ - return ((base->PRES_STATE & USDHC_PRES_STATE_RTR_MASK) != 0UL) ? true : false; -} - -/*! - * @brief The SDR104 mode auto tuning enable and disable. - * This function should be called after tuning function execute pass, auto tuning will handle - * by hardware. - * @param base USDHC peripheral base address. - * @param enable enable/disable flag - */ -static inline void USDHC_EnableAutoTuning(USDHC_Type *base, bool enable) -{ - if (enable) - { - base->MIX_CTRL |= USDHC_MIX_CTRL_AUTO_TUNE_EN_MASK; - } - else - { - base->MIX_CTRL &= ~USDHC_MIX_CTRL_AUTO_TUNE_EN_MASK; - } -} - -#if !(defined(FSL_FEATURE_USDHC_REGISTER_HOST_CTRL_CAP_HAS_NO_RETUNING_TIME_COUNTER) && \ - FSL_FEATURE_USDHC_REGISTER_HOST_CTRL_CAP_HAS_NO_RETUNING_TIME_COUNTER) -/*! - * @brief Configs the re-tuning timer for mode 1 and mode 3. - * This timer is used for standard tuning auto re-tuning, - * @param base USDHC peripheral base address. - * @param counter timer counter value - */ -static inline void USDHC_SetRetuningTimer(USDHC_Type *base, uint32_t counter) -{ - base->HOST_CTRL_CAP &= ~USDHC_HOST_CTRL_CAP_TIME_COUNT_RETUNING_MASK; - base->HOST_CTRL_CAP |= USDHC_HOST_CTRL_CAP_TIME_COUNT_RETUNING(counter); -} -#endif /* FSL_FEATURE_USDHC_REGISTER_HOST_CTRL_CAP_HAS_RETUNING_TIME_COUNTER */ - -/*! - * @brief The auto tuning enbale for CMD/DATA line. - * - * @param base USDHC peripheral base address. - */ -void USDHC_EnableAutoTuningForCmdAndData(USDHC_Type *base); - -/*! - * @brief Manual tuning trigger or abort. - * User should handle the tuning cmd and find the boundary of the delay - * then calucate a average value which will be configured to the CLK_TUNE_CTRL_STATUS - * This function should be called before function @ref USDHC_AdjustDelayForManualTuning. - * @param base USDHC peripheral base address. - * @param enable tuning enable flag - */ -void USDHC_EnableManualTuning(USDHC_Type *base, bool enable); - -/*! - * @brief Get the tuning delay cell setting. - * - * @param base USDHC peripheral base address. - * @retval CLK Tuning Control and Status register value. - */ -static inline uint32_t USDHC_GetTuningDelayStatus(USDHC_Type *base) -{ - return base->CLK_TUNE_CTRL_STATUS >> 16U; -} - -/*! - * @brief The tuning delay cell setting. - * - * @param base USDHC peripheral base address. - * @param preDelay Set the number of delay cells on the feedback clock between the feedback clock and CLK_PRE. - * @param outDelay Set the number of delay cells on the feedback clock between CLK_PRE and CLK_OUT. - * @param postDelay Set the number of delay cells on the feedback clock between CLK_OUT and CLK_POST. - * @retval kStatus_Fail config the delay setting fail - * @retval kStatus_Success config the delay setting success - */ -status_t USDHC_SetTuningDelay(USDHC_Type *base, uint32_t preDelay, uint32_t outDelay, uint32_t postDelay); - -/*! - * @brief Adjusts delay for mannual tuning. - * @deprecated Do not use this function. It has been superceded by USDHC_SetTuingDelay - * @param base USDHC peripheral base address. - * @param delay setting configuration - * @retval #kStatus_Fail config the delay setting fail - * @retval #kStatus_Success config the delay setting success - */ -status_t USDHC_AdjustDelayForManualTuning(USDHC_Type *base, uint32_t delay); - -/*! - * @brief set tuning counter tuning. - * @param base USDHC peripheral base address. - * @param counter tuning counter - * @retval #kStatus_Fail config the delay setting fail - * @retval #kStatus_Success config the delay setting success - */ -static inline void USDHC_SetStandardTuningCounter(USDHC_Type *base, uint8_t counter) -{ - base->TUNING_CTRL = - (base->TUNING_CTRL & (~USDHC_TUNING_CTRL_TUNING_COUNTER_MASK)) | USDHC_TUNING_CTRL_TUNING_COUNTER(counter); -} - -/*! - * @brief The enable standard tuning function. - * The standard tuning window and tuning counter using the default config - * tuning cmd is sent by the software, user need to check whether the tuning result - * can be used for SDR50, SDR104, and HS200 mode tuning. - * @param base USDHC peripheral base address. - * @param tuningStartTap start tap - * @param step tuning step - * @param enable enable/disable flag - */ -void USDHC_EnableStandardTuning(USDHC_Type *base, uint32_t tuningStartTap, uint32_t step, bool enable); - -/*! - * @brief Gets execute STD tuning status. - * - * @param base USDHC peripheral base address. - */ -static inline uint32_t USDHC_GetExecuteStdTuningStatus(USDHC_Type *base) -{ - return (base->AUTOCMD12_ERR_STATUS & USDHC_AUTOCMD12_ERR_STATUS_EXECUTE_TUNING_MASK); -} - -/*! - * @brief Checks STD tuning result. - * - * @param base USDHC peripheral base address. - */ -static inline uint32_t USDHC_CheckStdTuningResult(USDHC_Type *base) -{ - return (base->AUTOCMD12_ERR_STATUS & USDHC_AUTOCMD12_ERR_STATUS_SMP_CLK_SEL_MASK); -} - -/*! - * @brief Checks tuning error. - * - * @param base USDHC peripheral base address. - */ -static inline uint32_t USDHC_CheckTuningError(USDHC_Type *base) -{ - return (base->CLK_TUNE_CTRL_STATUS & - (USDHC_CLK_TUNE_CTRL_STATUS_NXT_ERR_MASK | USDHC_CLK_TUNE_CTRL_STATUS_PRE_ERR_MASK)); -} - -#endif -/*! - * @brief The enable/disable DDR mode. - * - * @param base USDHC peripheral base address. - * @param enable enable/disable flag - * @param nibblePos nibble position - */ -void USDHC_EnableDDRMode(USDHC_Type *base, bool enable, uint32_t nibblePos); - -#if FSL_FEATURE_USDHC_HAS_HS400_MODE -/*! - * @brief The enable/disable HS400 mode. - * - * @param base USDHC peripheral base address. - * @param enable enable/disable flag - */ -static inline void USDHC_EnableHS400Mode(USDHC_Type *base, bool enable) -{ - if (enable) - { - base->MIX_CTRL |= USDHC_MIX_CTRL_HS400_MODE_MASK; - } - else - { - base->MIX_CTRL &= ~USDHC_MIX_CTRL_HS400_MODE_MASK; - } -} - -/*! - * @brief Resets the strobe DLL. - * - * @param base USDHC peripheral base address. - */ -static inline void USDHC_ResetStrobeDLL(USDHC_Type *base) -{ - base->STROBE_DLL_CTRL |= USDHC_STROBE_DLL_CTRL_STROBE_DLL_CTRL_RESET_MASK; -} - -/*! - * @brief Enables/disables the strobe DLL. - * - * @param base USDHC peripheral base address. - * @param enable enable/disable flag - */ -static inline void USDHC_EnableStrobeDLL(USDHC_Type *base, bool enable) -{ - if (enable) - { - base->STROBE_DLL_CTRL |= USDHC_STROBE_DLL_CTRL_STROBE_DLL_CTRL_ENABLE_MASK; - } - else - { - base->STROBE_DLL_CTRL &= ~USDHC_STROBE_DLL_CTRL_STROBE_DLL_CTRL_ENABLE_MASK; - } -} - -/*! - * @brief Configs the strobe DLL delay target and update interval. - * - * @param base USDHC peripheral base address. - * @param delayTarget delay target - * @param updateInterval update interval - */ -void USDHC_ConfigStrobeDLL(USDHC_Type *base, uint32_t delayTarget, uint32_t updateInterval); - -/*! - * @brief Enables manual override for slave delay chain using STROBE_SLV_OVERRIDE_VAL. - * - * @param base USDHC peripheral base address. - * @param delayTaps Valid delay taps range from 1 - 128 taps. A value of 0 selects tap 1, and a value of 0x7F selects - * tap 128. - */ -static inline void USDHC_SetStrobeDllOverride(USDHC_Type *base, uint32_t delayTaps) -{ - base->STROBE_DLL_CTRL &= (USDHC_STROBE_DLL_CTRL_STROBE_DLL_CTRL_ENABLE_MASK | - USDHC_STROBE_DLL_CTRL_STROBE_DLL_CTRL_SLV_OVERRIDE_VAL_MASK); - - base->STROBE_DLL_CTRL |= USDHC_STROBE_DLL_CTRL_STROBE_DLL_CTRL_SLV_OVERRIDE_MASK | - USDHC_STROBE_DLL_CTRL_STROBE_DLL_CTRL_SLV_OVERRIDE_VAL(delayTaps); -} - -/*! - * @brief Gets the strobe DLL status. - * - * @param base USDHC peripheral base address. - */ -static inline uint32_t USDHC_GetStrobeDLLStatus(USDHC_Type *base) -{ - return base->STROBE_DLL_STATUS; -} - -#endif - -/*! - * @brief USDHC data configuration. - * - * @param base USDHC peripheral base address. - * @param dataDirection Data direction, tx or rx. - * @param blockCount Data block count. - * @param blockSize Data block size. - * - */ -void USDHC_SetDataConfig(USDHC_Type *base, - usdhc_transfer_direction_t dataDirection, - uint32_t blockCount, - uint32_t blockSize); -/*! @} */ - -/*! - * @name Transactional functions - * @{ - */ - -/*! - * @brief Creates the USDHC handle. - * - * @param base USDHC peripheral base address. - * @param handle USDHC handle pointer. - * @param callback Structure pointer to contain all callback functions. - * @param userData Callback function parameter. - */ -void USDHC_TransferCreateHandle(USDHC_Type *base, - usdhc_handle_t *handle, - const usdhc_transfer_callback_t *callback, - void *userData); - -#if (defined FSL_USDHC_ENABLE_SCATTER_GATHER_TRANSFER) && FSL_USDHC_ENABLE_SCATTER_GATHER_TRANSFER -/*! - * @brief Transfers the command/scatter gather data using an interrupt and an asynchronous method. - * - * This function sends a command and data and returns immediately. It doesn't wait for the transfer to complete or - * to encounter an error. The application must not call this API in multiple threads at the same time. Because of that - * this API doesn't support the re-entry mechanism. - * This function is target for the application would like to have scatter gather buffer to be transferred within one - * read/write request, non scatter gather buffer is support by this function also. - * - * @note Call API @ref USDHC_TransferCreateHandle when calling this API. - * - * @param base USDHC peripheral base address. - * @param handle USDHC handle. - * @param dmaConfig adma configurations, must be not NULL, since the function is target for ADMA only. - * @param transfer scatter gather transfer content. - * - * @retval #kStatus_InvalidArgument Argument is invalid. - * @retval #kStatus_USDHC_BusyTransferring Busy transferring. - * @retval #kStatus_USDHC_PrepareAdmaDescriptorFailed Prepare ADMA descriptor failed. - * @retval #kStatus_Success Operate successfully. - */ -status_t USDHC_TransferScatterGatherADMANonBlocking(USDHC_Type *base, - usdhc_handle_t *handle, - usdhc_adma_config_t *dmaConfig, - usdhc_scatter_gather_transfer_t *transfer); -#else -/*! - * @brief Transfers the command/data using an interrupt and an asynchronous method. - * - * This function sends a command and data and returns immediately. It doesn't wait for the transfer to complete or - * to encounter an error. The application must not call this API in multiple threads at the same time. Because of that - * this API doesn't support the re-entry mechanism. - * - * @note Call API @ref USDHC_TransferCreateHandle when calling this API. - * - * @param base USDHC peripheral base address. - * @param handle USDHC handle. - * @param dmaConfig ADMA configuration. - * @param transfer Transfer content. - * @retval #kStatus_InvalidArgument Argument is invalid. - * @retval #kStatus_USDHC_BusyTransferring Busy transferring. - * @retval #kStatus_USDHC_PrepareAdmaDescriptorFailed Prepare ADMA descriptor failed. - * @retval #kStatus_Success Operate successfully. - */ -status_t USDHC_TransferNonBlocking(USDHC_Type *base, - usdhc_handle_t *handle, - usdhc_adma_config_t *dmaConfig, - usdhc_transfer_t *transfer); -#endif - -/*! - * @brief Transfers the command/data using a blocking method. - * - * This function waits until the command response/data is received or the USDHC encounters an error by polling the - * status flag. \n - * The application must not call this API in multiple threads at the same time. Because this API doesn't - * support the re-entry mechanism. - * - * @note There is no need to call API @ref USDHC_TransferCreateHandle when calling this API. - * - * @param base USDHC peripheral base address. - * @param dmaConfig adma configuration - * @param transfer Transfer content. - * @retval #kStatus_InvalidArgument Argument is invalid. - * @retval #kStatus_USDHC_PrepareAdmaDescriptorFailed Prepare ADMA descriptor failed. - * @retval #kStatus_USDHC_SendCommandFailed Send command failed. - * @retval #kStatus_USDHC_TransferDataFailed Transfer data failed. - * @retval #kStatus_Success Operate successfully. - */ -status_t USDHC_TransferBlocking(USDHC_Type *base, usdhc_adma_config_t *dmaConfig, usdhc_transfer_t *transfer); - -/*! - * @brief IRQ handler for the USDHC. - * - * This function deals with the IRQs on the given host controller. - * - * @param base USDHC peripheral base address. - * @param handle USDHC handle. - */ -void USDHC_TransferHandleIRQ(USDHC_Type *base, usdhc_handle_t *handle); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif -/*! @} */ - -#endif /* FSL_USDHC_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_utick.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_utick.c deleted file mode 100644 index 0eea419cd34..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_utick.c +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2019, 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_utick.h" -#if !(defined(FSL_FEATURE_UTICK_HAS_NO_PDCFG) && FSL_FEATURE_UTICK_HAS_NO_PDCFG) -#include "fsl_power.h" -#endif -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.utick" -#endif - -/* Typedef for interrupt handler. */ -typedef void (*utick_isr_t)(UTICK_Type *base, utick_callback_t cb); - -/******************************************************************************* - * Prototypes - ******************************************************************************/ -/*! - * @brief Gets the instance from the base address - * - * @param base UTICK peripheral base address - * - * @return The UTICK instance - */ -static uint32_t UTICK_GetInstance(UTICK_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/* Array of UTICK handle. */ -static utick_callback_t s_utickHandle[FSL_FEATURE_SOC_UTICK_COUNT]; -/* Array of UTICK peripheral base address. */ -static UTICK_Type *const s_utickBases[] = UTICK_BASE_PTRS; -/* Array of UTICK IRQ number. */ -static const IRQn_Type s_utickIRQ[] = UTICK_IRQS; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/* Array of UTICK clock name. */ -static const clock_ip_name_t s_utickClock[] = UTICK_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_FEATURE_UTICK_HAS_NO_RESET) && FSL_FEATURE_UTICK_HAS_NO_RESET) -/*! @brief Pointers to UTICK resets for each instance. */ -static const reset_ip_name_t s_utickResets[] = UTICK_RSTS; -#endif - -/* UTICK ISR for transactional APIs. */ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -static utick_isr_t s_utickIsr = (utick_isr_t)DefaultISR; -#else -static utick_isr_t s_utickIsr; -#endif - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t UTICK_GetInstance(UTICK_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < ARRAY_SIZE(s_utickBases); instance++) - { - if (s_utickBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_utickBases)); - - return instance; -} - -/*! - * brief Starts UTICK. - * - * This function starts a repeat/onetime countdown with an optional callback - * - * param base UTICK peripheral base address. - * param mode UTICK timer mode (ie kUTICK_onetime or kUTICK_repeat) - * param count UTICK timer mode (ie kUTICK_onetime or kUTICK_repeat) - * param cb UTICK callback (can be left as NULL if none, otherwise should be a void func(void)) - * return none - */ -void UTICK_SetTick(UTICK_Type *base, utick_mode_t mode, uint32_t count, utick_callback_t cb) -{ - uint32_t instance; - - /* Get instance from peripheral base address. */ - instance = UTICK_GetInstance(base); - - /* Save the handle in global variables to support the double weak mechanism. */ - s_utickHandle[instance] = cb; -#if ((defined(FSL_FEATURE_SOC_SYSCON_COUNT) && (FSL_FEATURE_SOC_SYSCON_COUNT > 0)) && \ - !(defined(FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS) && FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS)) - EnableDeepSleepIRQ(s_utickIRQ[instance]); -#else - (void)EnableIRQ(s_utickIRQ[instance]); -#endif /* FSL_FEATURE_SOC_SYSCON_COUNT && !FSL_FEATURE_SYSCON_STARTER_DISCONTINUOUS */ - base->CTRL = count | UTICK_CTRL_REPEAT(mode); -} - -/*! - * brief Initializes an UTICK by turning its bus clock on - * - */ -void UTICK_Init(UTICK_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable utick clock */ - CLOCK_EnableClock(s_utickClock[UTICK_GetInstance(base)]); -#endif - -#if !(defined(FSL_FEATURE_UTICK_HAS_NO_RESET) && FSL_FEATURE_UTICK_HAS_NO_RESET) - RESET_PeripheralReset(s_utickResets[UTICK_GetInstance(base)]); -#endif - -#if !(defined(FSL_FEATURE_UTICK_HAS_NO_PDCFG) && FSL_FEATURE_UTICK_HAS_NO_PDCFG) - /* Power up Watchdog oscillator*/ - POWER_DisablePD(kPDRUNCFG_PD_WDT_OSC); -#endif - - s_utickIsr = UTICK_HandleIRQ; -} - -/*! - * brief Deinitializes a UTICK instance. - * - * This function shuts down Utick bus clock - * - * param base UTICK peripheral base address. - */ -void UTICK_Deinit(UTICK_Type *base) -{ - /* Turn off utick */ - base->CTRL = 0; -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable utick clock */ - CLOCK_DisableClock(s_utickClock[UTICK_GetInstance(base)]); -#endif -} - -/*! - * brief Get Status Flags. - * - * This returns the status flag - * - * param base UTICK peripheral base address. - * return status register value - */ -uint32_t UTICK_GetStatusFlags(UTICK_Type *base) -{ - return (base->STAT); -} - -/*! - * brief Clear Status Interrupt Flags. - * - * This clears intr status flag - * - * param base UTICK peripheral base address. - * return none - */ -void UTICK_ClearStatusFlags(UTICK_Type *base) -{ - base->STAT = UTICK_STAT_INTR_MASK; -} - -/*! - * brief UTICK Interrupt Service Handler. - * - * This function handles the interrupt and refers to the callback array in the driver to callback user (as per request - * in UTICK_SetTick()). - * if no user callback is scheduled, the interrupt will simply be cleared. - * - * param base UTICK peripheral base address. - * param cb callback scheduled for this instance of UTICK - * return none - */ -void UTICK_HandleIRQ(UTICK_Type *base, utick_callback_t cb) -{ - UTICK_ClearStatusFlags(base); - if (cb != NULL) - { - cb(); - } -} - -#if defined(UTICK0) -void UTICK0_DriverIRQHandler(void); -void UTICK0_DriverIRQHandler(void) -{ - s_utickIsr(UTICK0, s_utickHandle[0]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#if defined(UTICK1) -void UTICK1_DriverIRQHandler(void); -void UTICK1_DriverIRQHandler(void) -{ - s_utickIsr(UTICK1, s_utickHandle[1]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#if defined(UTICK2) -void UTICK2_DriverIRQHandler(void); -void UTICK2_DriverIRQHandler(void) -{ - s_utickIsr(UTICK2, s_utickHandle[2]); - SDK_ISR_EXIT_BARRIER; -} -#endif -#if defined(UTICK) -void UTICK_DriverIRQHandler(void); -void UTICK_DriverIRQHandler(void) -{ - s_utickIsr(UTICK, s_utickHandle[0]); - SDK_ISR_EXIT_BARRIER; -} -#endif diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_utick.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_utick.h deleted file mode 100644 index a3b734eae47..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_utick.h +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2019, 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_UTICK_H_ -#define FSL_UTICK_H_ - -#include "fsl_common.h" -/*! - * @addtogroup utick - * @{ - */ - -/*! @file*/ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief UTICK driver version 2.0.5. */ -#define FSL_UTICK_DRIVER_VERSION (MAKE_VERSION(2, 0, 5)) -/*! @} */ - -/*! @brief UTICK timer operational mode. */ -typedef enum _utick_mode -{ - kUTICK_Onetime = 0x0U, /*!< Trigger once*/ - kUTICK_Repeat = 0x1U, /*!< Trigger repeatedly */ -} utick_mode_t; - -/*! @brief UTICK callback function. */ -typedef void (*utick_callback_t)(void); - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* _cplusplus */ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Initializes an UTICK by turning its bus clock on - * - */ -void UTICK_Init(UTICK_Type *base); - -/*! - * @brief Deinitializes a UTICK instance. - * - * This function shuts down Utick bus clock - * - * @param base UTICK peripheral base address. - */ -void UTICK_Deinit(UTICK_Type *base); -/*! - * @brief Get Status Flags. - * - * This returns the status flag - * - * @param base UTICK peripheral base address. - * @return status register value - */ -uint32_t UTICK_GetStatusFlags(UTICK_Type *base); -/*! - * @brief Clear Status Interrupt Flags. - * - * This clears intr status flag - * - * @param base UTICK peripheral base address. - * @return none - */ -void UTICK_ClearStatusFlags(UTICK_Type *base); - -/*! - * @brief Starts UTICK. - * - * This function starts a repeat/onetime countdown with an optional callback - * - * @param base UTICK peripheral base address. - * @param mode UTICK timer mode (ie kUTICK_onetime or kUTICK_repeat) - * @param count UTICK timer mode (ie kUTICK_onetime or kUTICK_repeat) - * @param cb UTICK callback (can be left as NULL if none, otherwise should be a void func(void)) - * @return none - */ -void UTICK_SetTick(UTICK_Type *base, utick_mode_t mode, uint32_t count, utick_callback_t cb); -/*! - * @brief UTICK Interrupt Service Handler. - * - * This function handles the interrupt and refers to the callback array in the driver to callback user (as per request - * in UTICK_SetTick()). - * if no user callback is scheduled, the interrupt will simply be cleared. - * - * @param base UTICK peripheral base address. - * @param cb callback scheduled for this instance of UTICK - * @return none - */ -void UTICK_HandleIRQ(UTICK_Type *base, utick_callback_t cb); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_UTICK_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_vbat.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_vbat.c deleted file mode 100644 index 60f97571576..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_vbat.c +++ /dev/null @@ -1,498 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_vbat.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.mcx_vbat" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Configure internal 16kHz free running oscillator, including enabel FRO16k, gate FRO16k output. - * - * param base VBAT peripheral base address. - * param config Pointer to vbat_fro16k_config_t structure. - */ -void VBAT_ConfigFRO16k(VBAT_Type *base, const vbat_fro16k_config_t *config) -{ - assert(config != NULL); - - VBAT_EnableFRO16k(base, config->enableFRO16k); - VBAT_UngateFRO16k(base, config->enabledConnectionsMask); -} - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG) -/*! - * brief Set 32k crystal oscillator mode and load capacitance for the XTAL/EXTAL pin. - * - * param base VBAT peripheral base address. - * param operateMode Specify the crystal oscillator mode, please refer to vbat_osc32k_operate_mode_t. - * param xtalCap Specify the internal capacitance for the XTAL pin from the capacitor bank. - * param extalCap Specify the internal capacitance for the EXTAL pin from the capacitor bank. - * - * retval kStatus_VBAT_WrongCapacitanceValue The load capacitance value to set is not align with operate mode's - * requirements. - * retval kStatus_Success Success to set operate mode and load capacitance. - */ -status_t VBAT_SetCrystalOsc32kModeAndLoadCapacitance(VBAT_Type *base, - vbat_osc32k_operate_mode_t operateMode, - vbat_osc32k_load_capacitance_select_t xtalCap, - vbat_osc32k_load_capacitance_select_t extalCap) -{ - if (operateMode == kVBAT_Osc32kEnabledToTransconductanceMode) - { - if (((uint8_t)extalCap & 0x1U) == 0U) - { - return kStatus_VBAT_WrongCapacitanceValue; - } - } - - if (operateMode == kVBAT_Osc32kEnabledToLowPowerSwitchedMode) - { - if ((extalCap != kVBAT_Osc32kCrystalLoadCap0pF) && (xtalCap != kVBAT_Osc32kCrystalLoadCap0pF)) - { - return kStatus_VBAT_WrongCapacitanceValue; - } - } - - if (operateMode == kVBAT_Osc32kEnabledToLowPowerBackupMode) - { - if (((uint8_t)extalCap & 0x1U) != 0U) - { - return kStatus_VBAT_WrongCapacitanceValue; - } - } - - if ((xtalCap != kVBAT_Osc32kCrystalLoadCapBankDisabled) && (extalCap != kVBAT_Osc32kCrystalLoadCapBankDisabled)) - { - base->OSCCTLA |= VBAT_OSCCTLA_CAP_SEL_EN_MASK; - base->OSCCTLB &= ~VBAT_OSCCTLA_CAP_SEL_EN_MASK; - base->OSCCTLA = ((base->OSCCTLA & ~(VBAT_OSCCTLA_EXTAL_CAP_SEL_MASK | VBAT_OSCCTLA_XTAL_CAP_SEL_MASK)) | - (VBAT_OSCCTLA_XTAL_CAP_SEL(xtalCap) | VBAT_OSCCTLA_EXTAL_CAP_SEL(extalCap))); - base->OSCCTLB = ((base->OSCCTLB & ~(VBAT_OSCCTLA_EXTAL_CAP_SEL_MASK | VBAT_OSCCTLA_XTAL_CAP_SEL_MASK)) | - VBAT_OSCCTLA_XTAL_CAP_SEL(~(uint32_t)xtalCap) | VBAT_OSCCTLA_EXTAL_CAP_SEL(~(uint32_t)extalCap)); - } - - base->OSCCTLA = (((base->OSCCTLA & ~VBAT_OSCCTLA_MODE_EN_MASK)) | VBAT_OSCCTLA_MODE_EN(operateMode)); - base->OSCCTLB = ((base->OSCCTLB & ~VBAT_OSCCTLA_MODE_EN_MASK) | VBAT_OSCCTLA_MODE_EN(~(uint32_t)operateMode)); - - return kStatus_Success; -} -#endif /* FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG) -/*! - * brief Enable/disable Bandgap. - * - * note The FRO16K must be enabled before enableing the bandgap. - * note This setting can be locked by VBAT_LockRamLdoSettings() function. - * - * param base VBAT peripheral base address. - * param enable Used to enable/disable bandgap. - * - \b true Enable the bandgap. - * - \b false Disable the bandgap. - * - * retval kStatus_Success Success to enable/disable the bandgap. - * retval kStatus_VBAT_Fro16kNotEnabled Fail to enable the bandgap due to FRO16k is not enabled previously. - */ -status_t VBAT_EnableBandgap(VBAT_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - if (VBAT_CheckFRO16kEnabled(base)) - { - base->LDOCTLA |= VBAT_LDOCTLA_BG_EN_MASK; - base->LDOCTLB &= ~VBAT_LDOCTLA_BG_EN_MASK; - } - else - { - /* FRO16K must be enabled before enabling the Bandgap. */ - status = kStatus_VBAT_Fro16kNotEnabled; - } - } - else - { - base->LDOCTLA &= ~VBAT_LDOCTLA_BG_EN_MASK; - base->LDOCTLB |= VBAT_LDOCTLA_BG_EN_MASK; - } - - return status; -} - -/*! - * brief Enable/disable Backup RAM Regulator(RAM_LDO). - * - * note This setting can be locked by VBAT_LockRamLdoSettings() function. - * - * param base VBAT peripheral base address. - * param enable Used to enable/disable RAM_LDO. - * - \b true Enable backup SRAM regulator. - * - \b false Disable backup SRAM regulator. - * - * retval kStatusSuccess Success to enable/disable backup SRAM regulator. - * retval kStatus_VBAT_Fro16kNotEnabled Fail to enable backup SRAM regulator due to FRO16k is not enabled previously. - * retval kStatus_VBAT_BandgapNotEnabled Fail to enable backup SRAM regulator due to the bandgap is not enabled - * previously. - */ -status_t VBAT_EnableBackupSRAMRegulator(VBAT_Type *base, bool enable) -{ - status_t status = kStatus_Success; - - if (enable) - { - if (VBAT_CheckFRO16kEnabled(base)) - { - if (VBAT_CheckBandgapEnabled(base)) - { - base->LDOCTLA |= VBAT_LDOCTLA_LDO_EN_MASK; - base->LDOCTLB &= ~VBAT_LDOCTLA_LDO_EN_MASK; - /* Polling until LDO is enabled. */ - while ((base->STATUSA & VBAT_STATUSA_LDO_RDY_MASK) == 0UL) - { - } - } - else - { - /* The bandgap must be enabled previously. */ - status = kStatus_VBAT_BandgapNotEnabled; - } - } - else - { - /* FRO16k must be enabled previously. */ - status = kStatus_VBAT_Fro16kNotEnabled; - } - } - else - { - base->LDOCTLA &= ~VBAT_LDOCTLA_LDO_EN_MASK; - base->LDOCTLB |= VBAT_LDOCTLA_LDO_EN_MASK; - } - - return status; -} - -/*! - * brief Switch the SRAM to be powered by VBAT. - * - * param base VBAT peripheral base address. - * - * retval kStatusSuccess Success to Switch SRAM powered by VBAT. - * retval kStatus_VBAT_Fro16kNotEnabled Fail to switch SRAM powered by VBAT due to FRO16K not enabled previously. - */ -status_t VBAT_SwitchSRAMPowerByLDOSRAM(VBAT_Type *base) -{ - status_t status = kStatus_Success; - - status = VBAT_EnableBandgap(base, true); - - if (status == kStatus_Success) - { - VBAT_EnableBandgapRefreshMode(base, true); - (void)VBAT_EnableBackupSRAMRegulator(base, true); - - /* Isolate the SRAM array */ - base->LDORAMC |= VBAT_LDORAMC_ISO_MASK; - /* Switch the supply to VBAT LDO. */ - base->LDORAMC |= VBAT_LDORAMC_SWI_MASK; - } - - return status; -} -#endif /* FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) && FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) -/*! - * brief Enable/disable Bandgap timer. - * - * note The bandgap timer is available when the bandgap is enabled and are clocked by the FRO16k. - * - * param base VBAT peripheral base address. - * param enable Used to enable/disable bandgap timer. - * param timerIdMask The mask of bandgap timer Id, should be the OR'ed value of vbat_bandgap_timer_id_t. - * - * retval kStatus_Success Success to enable/disable selected bandgap timer. - * retval kStatus_VBAT_Fro16kNotEnabled Fail to enable/disable selected bandgap timer due to FRO16k not enabled - * previously. retval kStatus_VBAT_BandgapNotEnabled Fail to enable/disable selected bandgap timer due to bandgap not - * enabled previously. - */ -status_t VBAT_EnableBandgapTimer(VBAT_Type *base, bool enable, uint8_t timerIdMask) -{ - status_t status = kStatus_Success; - - if (enable) - { - if (VBAT_CheckFRO16kEnabled(base)) - { - if (VBAT_CheckBandgapEnabled(base)) - { - if ((timerIdMask & (uint8_t)kVBAT_BandgapTimer0) != 0U) - { - base->LDOTIMER0 |= VBAT_LDOTIMER0_TIMEN_MASK; - } - - if ((timerIdMask & (uint8_t)kVBAT_BandgapTimer1) != 0U) - { - base->LDOTIMER1 |= VBAT_LDOTIMER1_TIMEN_MASK; - } - } - else - { - /* Bandgap must be enabled previously. */ - status = kStatus_VBAT_BandgapNotEnabled; - } - } - else - { - /* FRO16K must be enabled previously. */ - status = kStatus_VBAT_Fro16kNotEnabled; - } - } - else - { - if ((timerIdMask & (uint8_t)kVBAT_BandgapTimer0) != 0U) - { - base->LDOTIMER0 &= ~VBAT_LDOTIMER0_TIMEN_MASK; - } - - if ((timerIdMask & (uint8_t)kVBAT_BandgapTimer1) != 0U) - { - base->LDOTIMER1 &= ~VBAT_LDOTIMER1_TIMEN_MASK; - } - } - - return status; -} - -/*! - * brief Set bandgap timer0 timeout value. - * - * param base VBAT peripheral base address. - * param timeoutPeriod Bandgap timer timeout value, please refer to vbat_bandgap_timer0_timeout_period_t. - */ -void VBAT_SetBandgapTimer0TimeoutValue(VBAT_Type *base, vbat_bandgap_timer0_timeout_period_t timeoutPeriod) -{ - bool timerEnabled = false; - - timerEnabled = ((base->LDOTIMER0 & VBAT_LDOTIMER0_TIMEN_MASK) != 0UL) ? true : false; - - if (timerEnabled) - { - base->LDOTIMER0 &= ~VBAT_LDOTIMER0_TIMEN_MASK; - } - - base->LDOTIMER0 = ((base->LDOTIMER0 & (~VBAT_LDOTIMER0_TIMCFG_MASK)) | VBAT_LDOTIMER0_TIMCFG(timeoutPeriod)); - - if (timerEnabled) - { - base->LDOTIMER0 |= VBAT_LDOTIMER0_TIMEN_MASK; - } -} - -/*! - * brief Set bandgap timer1 timeout value. - * - * note The timeout value can only be changed when the timer is disabled. - * - * param base VBAT peripheral base address. - * param timeoutPeriod The bandgap timerout 1 period, in number of seconds, ranging from 0 to 65535s. - */ -void VBAT_SetBandgapTimer1TimeoutValue(VBAT_Type *base, uint32_t timeoutPeriod) -{ - bool timerEnabled = false; - - timerEnabled = ((base->LDOTIMER1 & VBAT_LDOTIMER1_TIMEN_MASK) != 0UL) ? true : false; - - if (timerEnabled) - { - base->LDOTIMER1 &= ~VBAT_LDOTIMER1_TIMEN_MASK; - } - - base->LDOTIMER1 = ((base->LDOTIMER1 & (~VBAT_LDOTIMER1_TIMCFG_MASK)) | VBAT_LDOTIMER1_TIMCFG(timeoutPeriod)); - - if (timerEnabled) - { - base->LDOTIMER1 |= VBAT_LDOTIMER1_TIMEN_MASK; - } -} -#endif /* FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) && FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) -/*! - * brief Initializes the VBAT clock monitor, enable clock monitor and set the clock monitor configuration. - * - * note Both FRO16K and OSC32K should be enabled and stable before invoking this function. - * - * param base VBAT peripheral base address. - * param config Pointer to vbat_clock_monitor_config_t structure. - * - * retval kStatus_Success Clock monitor is initialized successfully. - * retval kStatus_VBAT_Fro16kNotEnabled FRO16K is not enabled. - * retval kStatus_VBAT_Osc32kNotReady OSC32K is not ready. - * retval kStatus_VBAT_ClockMonitorLocked Clock monitor is locked. - */ -status_t VBAT_InitClockMonitor(VBAT_Type *base, const vbat_clock_monitor_config_t *config) -{ - assert(config != NULL); - - status_t status = kStatus_Success; - - if (VBAT_CheckFRO16kEnabled(base)) - { - if ((VBAT_GetStatusFlags(base) & kVBAT_StatusFlagOsc32kReady) != 0UL) - { - if (VBAT_CheckClockMonitorControlLocked(base)) - { - status = kStatus_VBAT_ClockMonitorLocked; - } - else - { - /* Disable clock monitor before configuring clock monitor. */ - VBAT_EnableClockMonitor(base, false); - /* Set clock monitor divide trim value. */ - VBAT_SetClockMonitorDivideTrim(base, config->divideTrim); - /* Set clock monitor frequency trim value. */ - VBAT_SetClockMonitorFrequencyTrim(base, config->freqTrim); - /* Enable clock monitor. */ - VBAT_EnableClockMonitor(base, true); - - if (config->lock) - { - VBAT_LockClockMonitorControl(base); - } - } - } - else - { - status = kStatus_VBAT_OSC32KNotReady; - } - } - else - { - status = kStatus_VBAT_Fro16kNotEnabled; - } - - return status; -} - -/*! - * brief Deinitialize the VBAT clock monitor. - * - * param base VBAT peripheral base address. - * - * retval kStatus_Success Clock monitor is de-initialized successfully. - * retval kStatus_VBAT_ClockMonitorLocked Control of Clock monitor is locked. - */ -status_t VBAT_DeinitMonitor(VBAT_Type *base) -{ - if (VBAT_CheckClockMonitorControlLocked(base)) - { - return kStatus_VBAT_ClockMonitorLocked; - } - - VBAT_EnableClockMonitor(base, false); - - return kStatus_Success; -} -#endif /* FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) && FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) -/*! - * brief Initialize tamper control. - * - * note Both FRO16K and bandgap should be enabled before calling this function. - * - * param base VBAT peripheral base address. - * param config Pointer to vbat_tamper_config_t structure. - * - * retval kStatus_Success Tamper is initialized successfully. - * retval kStatus_VBAT_TamperLocked Tamper control is locked. - * retval kStatus_VBAT_BandgapNotEnabled Bandgap is not enabled. - * retval kStatus_VBAT_Fro16kNotEnabled FRO 16K is not enabled. - */ -status_t VBAT_InitTamper(VBAT_Type *base, const vbat_tamper_config_t *config) -{ - assert(config != NULL); - - status_t status = kStatus_Success; - - if (VBAT_CheckFRO16kEnabled(base)) - { - if (VBAT_CheckBandgapEnabled(base)) - { - if (VBAT_CheckTamperControlLocked(base)) - { - return kStatus_VBAT_TamperLocked; - } - else - { - base->TAMCTLA = ((base->TAMCTLA & (~VBAT_TAMCTLA_VOLT_EN_MASK | VBAT_TAMCTLA_TEMP_EN_MASK)) | - VBAT_TAMCTLA_VOLT_EN(config->enableVoltageDetect) | - VBAT_TAMCTLA_TEMP_EN(config->enableTemperatureDetect)); - base->TAMCTLB = ((base->TAMCTLB & (~VBAT_TAMCTLA_VOLT_EN_MASK | VBAT_TAMCTLA_TEMP_EN_MASK)) | - VBAT_TAMCTLA_VOLT_EN((config->enableVoltageDetect) ? 0U : 1U) | - VBAT_TAMCTLA_TEMP_EN((config->enableTemperatureDetect) ? 0U : 1U)); - - if (config->lock) - { - VBAT_LockTamperControl(base); - } - } - } - else - { - status = kStatus_VBAT_BandgapNotEnabled; - } - } - else - { - status = kStatus_VBAT_Fro16kNotEnabled; - } - - return status; -} - -/*! - * brief De-initialize tamper control. - * - * param base VBAT peripheral base address. - * - * retval kStatus_Success Tamper is de-initialized successfully. - * retval kStatus_VBAT_TamperLocked Tamper control is locked. - */ -status_t VBAT_DeinitTamper(VBAT_Type *base) -{ - if (VBAT_CheckTamperControlLocked(base)) - { - return kStatus_VBAT_TamperLocked; - } - - base->TAMCTLA &= ~(VBAT_TAMCTLA_VOLT_EN_MASK | VBAT_TAMCTLA_TEMP_EN_MASK); - base->TAMCTLB |= (VBAT_TAMCTLA_VOLT_EN_MASK | VBAT_TAMCTLA_TEMP_EN_MASK); - - return kStatus_Success; -} -#endif /* FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_vbat.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_vbat.h deleted file mode 100644 index 5858b005eb9..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_vbat.h +++ /dev/null @@ -1,1386 +0,0 @@ -/* - * Copyright 2022-2024 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_VBAT_H_ -#define FSL_VBAT_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup mcx_vbat - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*@{*/ -/*! @brief VBAT driver version 2.3.1. */ -#define FSL_VBAT_DRIVER_VERSION (MAKE_VERSION(2, 3, 1)) -/*@}*/ - -#if !defined(VBAT_LDORAMC_RET_MASK) -#define VBAT_LDORAMC_RET_MASK (0xF00U) -#define VBAT_LDORAMC_RET_SHIFT (8U) -#define VBAT_LDORAMC_RET(x) (((uint32_t)(((uint32_t)(x)) << VBAT_LDORAMC_RET_SHIFT)) & VBAT_LDORAMC_RET_MASK) -#endif - -/*! - * @brief The enumeration of VBAT module status. - */ -enum -{ - kStatus_VBAT_Fro16kNotEnabled = MAKE_STATUS(kStatusGroup_VBAT, 0), /*!< Internal 16kHz free running - oscillator not enabled. */ - kStatus_VBAT_BandgapNotEnabled = MAKE_STATUS(kStatusGroup_VBAT, 1), /*!< Bandgap not enabled. */ - kStatus_VBAT_WrongCapacitanceValue = MAKE_STATUS(kStatusGroup_VBAT, 2), /*!< Wrong capacitance for - selected oscillator mode. */ - kStatus_VBAT_ClockMonitorLocked = MAKE_STATUS(kStatusGroup_VBAT, 3), /*!< Clock monitor locked. */ - kStatus_VBAT_OSC32KNotReady = MAKE_STATUS(kStatusGroup_VBAT, 4), /*!< OSC32K not ready. */ - kStatus_VBAT_LDONotReady = MAKE_STATUS(kStatusGroup_VBAT, 5), /*!< LDO not ready. */ - kStatus_VBAT_TamperLocked = MAKE_STATUS(kStatusGroup_VBAT, 6), /*!< Tamper locked. */ -}; - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_STATUS_REG) && FSL_FEATURE_MCX_VBAT_HAS_STATUS_REG) -/*! - * @brief The enumeration of VBAT status flags. - * - * @anchor vbat_status_flag_t - */ -enum _vbat_status_flag -{ - kVBAT_StatusFlagPORDetect = VBAT_STATUSA_POR_DET_MASK, /*!< VBAT domain has been reset */ - kVBAT_StatusFlagWakeupPin = VBAT_STATUSA_WAKEUP_FLAG_MASK, /*!< A falling edge is detected on the wakeup pin. */ - kVBAT_StatusFlagBandgapTimer0 = VBAT_STATUSA_TIMER0_FLAG_MASK, /*!< Bandgap Timer0 period reached. */ - kVBAT_StatusFlagBandgapTimer1 = VBAT_STATUSA_TIMER1_FLAG_MASK, /*!< Bandgap Timer1 period reached. */ - kVBAT_StatusFlagLdoReady = VBAT_STATUSA_LDO_RDY_MASK, /*!< LDO is enabled and ready. */ - kVBAT_StatusFlagOsc32kReady = VBAT_STATUSA_OSC_RDY_MASK, /*!< OSC32k is enabled and clock is ready. */ -#if defined(VBAT_STATUSA_CLOCK_DET_MASK) - kVBAT_StatusFlagClockDetect = VBAT_STATUSA_CLOCK_DET_MASK, /*!< The clock monitor has detected an error. */ -#endif /* VBAT_STATUSA_CLOCK_DET_MASK */ - kVBAT_StatusFlagConfigDetect = VBAT_STATUSA_CONFIG_DET_MASK, /*!< Configuration error detected. */ -#if defined(VBAT_STATUSA_VOLT_DET_MASK) - kVBAT_StatusFlagVoltageDetect = VBAT_STATUSA_VOLT_DET_MASK, /*!< Voltage monitor has detected - an error with VBAT supply. */ -#endif /* VBAT_STATUSA_VOLT_DET_MASK */ -#if defined(VBAT_STATUSA_TEMP_DET_MASK) - kVBAT_StatusFlagTemperatureDetect = VBAT_STATUSA_TEMP_DET_MASK, /*!< Temperature monitor has detected an error. */ -#endif /* VBAT_STATUSA_TEMP_DET_MASK */ -#if defined(VBAT_STATUSA_SEC0_DET_MASK) - kVBAT_StatusFlagSec0Detect = VBAT_STATUSA_SEC0_DET_MASK, /*!< Security input 0 has detected an error. */ -#endif /* VBAT_STATUSA_SEC0_DET_MASK */ - kVBAT_StatusFlagInterrupt0Detect = VBAT_STATUSA_IRQ0_DET_MASK, /*!< Interrupt 0 asserted. */ - kVBAT_StatusFlagInterrupt1Detect = VBAT_STATUSA_IRQ1_DET_MASK, /*!< Interrupt 1 asserted. */ - kVBAT_StatusFlagInterrupt2Detect = VBAT_STATUSA_IRQ2_DET_MASK, /*!< Interrupt 2 asserted. */ - kVBAT_StatusFlagInterrupt3Detect = VBAT_STATUSA_IRQ3_DET_MASK, /*!< Interrupt 2 asserted. */ -}; - -/*! - * @brief The enumeration of VBAT interrupt enable. - * - * @anchor vbat_interrupt_enable_t - */ -enum _vbat_interrupt_enable -{ - kVBAT_InterruptEnablePORDetect = VBAT_IRQENA_POR_DET_MASK, /*!< Enable POR detect interrupt. */ - kVBAT_InterruptEnableWakeupPin = VBAT_IRQENA_WAKEUP_FLAG_MASK, /*!< Enable the interrupt when a falling edge is - detected on the wakeup pin. */ - kVBAT_InterruptEnableBandgapTimer0 = VBAT_IRQENA_TIMER0_FLAG_MASK, /*!< Enable the interrupt if Bandgap - Timer0 period reached. */ - kVBAT_InterruptEnableBandgapTimer1 = VBAT_IRQENA_TIMER1_FLAG_MASK, /*!< Enable the interrupt if Bandgap - Timer1 period reached. */ - kVBAT_InterruptEnableLdoReady = VBAT_IRQENA_LDO_RDY_MASK, /*!< Enable LDO ready interrupt. */ - kVBAT_InterruptEnableOsc32kReady = VBAT_IRQENA_OSC_RDY_MASK, /*!< Enable OSC32K ready interrupt. */ -#if defined(VBAT_IRQENA_CLOCK_DET_MASK) - kVBAT_InterruptEnableClockDetect = VBAT_IRQENA_CLOCK_DET_MASK, /*!< Enable clock monitor detect interrupt. */ -#endif /* VBAT_IRQENA_CLOCK_DET_MASK */ - kVBAT_InterruptEnableConfigDetect = - VBAT_IRQENA_CONFIG_DET_MASK, /*!< Enable configuration error detected interrupt. */ -#if defined(VBAT_IRQENA_VOLT_DET_MASK) - kVBAT_InterruptEnableVoltageDetect = VBAT_IRQENA_VOLT_DET_MASK, /*!< Enable voltage monitor detect interrupt. */ -#endif /* VBAT_IRQENA_VOLT_DET_MASK */ -#if defined(VBAT_IRQENA_TEMP_DET_MASK) - kVBAT_InterruptEnableTemperatureDetect = VBAT_IRQENA_TEMP_DET_MASK, /*!< Enable temperature monitor detect - interrupt. */ -#endif /* VBAT_IRQENA_TEMP_DET_MASK */ -#if defined(VBAT_IRQENA_SEC0_DET_MASK) - kVBAT_InterruptEnableSec0Detect = VBAT_IRQENA_SEC0_DET_MASK, /*!< Enable security input 0 detect interrupt. */ -#endif /* VBAT_IRQENA_SEC0_DET_MASK */ - kVBAT_InterruptEnableInterrupt0 = VBAT_IRQENA_IRQ0_DET_MASK, /*!< Enable the interrupt0. */ - kVBAT_InterruptEnableInterrupt1 = VBAT_IRQENA_IRQ1_DET_MASK, /*!< Enable the interrupt1. */ - kVBAT_InterruptEnableInterrupt2 = VBAT_IRQENA_IRQ2_DET_MASK, /*!< Enable the interrupt2. */ - kVBAT_InterruptEnableInterrupt3 = VBAT_IRQENA_IRQ3_DET_MASK, /*!< Enable the interrupt3. */ - - kVBAT_AllInterruptsEnable = - (VBAT_IRQENA_POR_DET_MASK | VBAT_IRQENA_WAKEUP_FLAG_MASK | VBAT_IRQENA_TIMER0_FLAG_MASK | - VBAT_IRQENA_TIMER1_FLAG_MASK | VBAT_IRQENA_LDO_RDY_MASK | VBAT_IRQENA_OSC_RDY_MASK | - VBAT_IRQENA_CONFIG_DET_MASK | VBAT_IRQENA_IRQ0_DET_MASK | VBAT_IRQENA_IRQ1_DET_MASK | - VBAT_IRQENA_IRQ2_DET_MASK | VBAT_IRQENA_IRQ3_DET_MASK), /*!< Enable all interrupts. */ -}; - -/*! - * @brief The enumeration of VBAT wakeup enable. - * - * @anchor vbat_wakeup_enable_t - */ -enum _vbat_wakeup_enable -{ - kVBAT_WakeupEnablePORDetect = VBAT_WAKENA_POR_DET_MASK, /*!< Enable POR detect wakeup. */ - kVBAT_WakeupEnableWakeupPin = VBAT_WAKENA_WAKEUP_FLAG_MASK, /*!< Enable wakeup feature when a falling edge is - detected on the wakeup pin. */ - kVBAT_WakeupEnableBandgapTimer0 = VBAT_WAKENA_TIMER0_FLAG_MASK, /*!< Enable wakeup feature when bandgap - timer0 period reached. */ - kVBAT_WakeupEnableBandgapTimer1 = VBAT_WAKENA_TIMER1_FLAG_MASK, /*!< Enable wakeup feature when bandgap - timer1 period reached. */ - kVBAT_WakeupEnableLdoReady = VBAT_WAKENA_LDO_RDY_MASK, /*!< Enable wakeup when LDO ready. */ - kVBAT_WakeupEnableOsc32kReady = VBAT_WAKENA_OSC_RDY_MASK, /*!< Enable wakeup when OSC32k ready. */ -#if defined(VBAT_WAKENA_CLOCK_DET_MASK) - kVBAT_WakeupEnableClockDetect = - VBAT_WAKENA_CLOCK_DET_MASK, /*!< Enable wakeup when clock monitor detect an error. */ -#endif /* VBAT_WAKENA_CLOCK_DET_MASK */ - kVBAT_WakeupEnableConfigDetect = VBAT_WAKENA_CONFIG_DET_MASK, /*!< Enable wakeup when - configuration error detected. */ -#if defined(VBAT_WAKENA_VOLT_DET_MASK) - kVBAT_WakeupEnableVoltageDetect = VBAT_WAKENA_VOLT_DET_MASK, /*!< Enable wakeup when voltage monitor detect an - error. */ -#endif /* VBAT_WAKENA_VOLT_DET_MASK */ -#if defined(VBAT_WAKENA_TEMP_DET_MASK) - kVBAT_WakeupEnableTemperatureDetect = VBAT_WAKENA_TEMP_DET_MASK, /*!< Enable wakeup when temperature monitor - detect an error. */ -#endif /* VBAT_WAKENA_TEMP_DET_MASK */ -#if defined(VBAT_WAKENA_SEC0_DET_MASK) - kVBAT_WakeupEnableSec0Detect = VBAT_WAKENA_SEC0_DET_MASK, /*!< Enable wakeup when security input 0 detect an - error. */ -#endif /* VBAT_WAKENA_SEC0_DET_MASK */ - kVBAT_WakeupEnableInterrupt0 = VBAT_WAKENA_IRQ0_DET_MASK, /*!< Enable wakeup when interrupt0 asserted. */ - kVBAT_WakeupEnableInterrupt1 = VBAT_WAKENA_IRQ1_DET_MASK, /*!< Enable wakeup when interrupt1 asserted. */ - kVBAT_WakeupEnableInterrupt2 = VBAT_WAKENA_IRQ2_DET_MASK, /*!< Enable wakeup when interrupt2 asserted. */ - kVBAT_WakeupEnableInterrupt3 = VBAT_WAKENA_IRQ3_DET_MASK, /*!< Enable wakeup when interrupt3 asserted. */ - - kVBAT_AllWakeupsEnable = (VBAT_WAKENA_POR_DET_MASK | VBAT_WAKENA_WAKEUP_FLAG_MASK | VBAT_WAKENA_TIMER0_FLAG_MASK | - VBAT_WAKENA_TIMER1_FLAG_MASK | VBAT_WAKENA_LDO_RDY_MASK | VBAT_WAKENA_OSC_RDY_MASK | - VBAT_WAKENA_CONFIG_DET_MASK | VBAT_WAKENA_IRQ0_DET_MASK | VBAT_WAKENA_IRQ1_DET_MASK | - VBAT_WAKENA_IRQ2_DET_MASK | VBAT_WAKENA_IRQ3_DET_MASK - -#if defined(VBAT_WAKENA_CLOCK_DET_MASK) - | VBAT_WAKENA_CLOCK_DET_MASK - -#endif /* VBAT_WAKENA_CLOCK_DET_MASK */ -#if defined(VBAT_WAKENA_VOLT_DET_MASK) - | VBAT_WAKENA_VOLT_DET_MASK - -#endif /* VBAT_WAKENA_VOLT_DET_MASK */ -#if defined(VBAT_WAKENA_TEMP_DET_MASK) - | VBAT_WAKENA_TEMP_DET_MASK - -#endif /* VBAT_WAKENA_TEMP_DET_MASK */ -#if defined(VBAT_WAKENA_SEC0_DET_MASK) - | VBAT_WAKENA_SEC0_DET_MASK - -#endif /* VBAT_WAKENA_SEC0_DET_MASK */ - ), /*!< Enable all wakeup. */ -}; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_STATUS_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) && FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) -/*! - * @brief The enumeration of VBAT tamper enable. - */ -enum _vbat_tamper_enable -{ - kVBAT_TamperEnablePOR = VBAT_TAMPERA_POR_DET_MASK, /*!< Enable tamper if POR asserted in STATUS register. */ - kVBAT_TamperEnableClockDetect = VBAT_TAMPERA_CLOCK_DET_MASK, /*!< Enable tamper if clock monitor detect an error. */ - kVBAT_TamperEnableConfigDetect = - VBAT_TAMPERA_CONFIG_DET_MASK, /*!< Enable tamper if configuration error detected. */ - kVBAT_TamperEnableVoltageDetect = VBAT_TAMPERA_VOLT_DET_MASK, /*!< Enable tamper if voltage monitor detect an - error. */ - kVBAT_TamperEnableTemperatureDetect = VBAT_TAMPERA_TEMP_DET_MASK, /*!< Enable tamper if temperature monitor - detect an error. */ - kVBAT_TamperEnableSec0Detect = VBAT_TAMPERA_SEC0_DET_MASK, /*!< Enable tamper if security input 0 detect an - error. */ -}; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) && FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) -/*! - * @brief The enumeration of bandgap timer id, VBAT support two bandgap timers. - * - * @anchor vbat_bandgap_timer_id_t - */ -enum _vbat_bandgap_timer_id -{ - kVBAT_BandgapTimer0 = 1U << 0U, /*!< Bandgap Timer0. */ - kVBAT_BandgapTimer1 = 1U << 1U, /*!< Bandgap Timer1. */ -}; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER */ - -/*! - * @brief The enumeration of connections for OSC32K/FRO32K output clock to other modules. - * - * @anchor vbat_clock_enable_t - */ -enum _vbat_clock_enable -{ - kVBAT_EnableClockToDomain0 = 1U << 0U, /*!< Enable clock to power domain0. */ - kVBAT_EnableClockToDomain1 = 1U << 1U, /*!< Enable clock to power domain1. */ - kVBAT_EnableClockToDomain2 = 1U << 2U, /*!< Enable clock to power domain2. */ - kVBAT_EnableClockToDomain3 = 1U << 3U, /*!< Enable clock to power domain3. */ -}; -#define kVBAT_EnableClockToVddBat kVBAT_EnableClockToDomain0 -#define kVBAT_EnableClockToVddSys kVBAT_EnableClockToDomain1 -#define kVBAT_EnableClockToVddWake kVBAT_EnableClockToDomain2 -#define kVBAT_EnableClockToVddMain kVBAT_EnableClockToDomain3 - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG) -/*! - * @brief The enumeration of SRAM arrays that controlled by VBAT. - * @anchor vbat_ram_array_t - */ -enum _vbat_ram_array -{ - kVBAT_SramArray0 = 1U << 0U, /*!< Specify SRAM array0 that controlled by VBAT. */ - kVBAT_SramArray1 = 1U << 1U, /*!< Specify SRAM array1 that controlled by VBAT. */ - kVBAT_SramArray2 = 1U << 2U, /*!< Specify SRAM array2 that controlled by VBAT. */ - kVBAT_SramArray3 = 1U << 3U, /*!< Specify SRAM array3 that controlled by VBAT. */ -}; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG */ - -/*! - * @brief The enumeration of bandgap refresh period. - */ -typedef enum _vbat_bandgap_refresh_period -{ - kVBAT_BandgapRefresh7P8125ms = 0U, /*!< Bandgap refresh every 7.8125ms. */ - kVBAT_BandgapRefresh15P625ms = 1U, /*!< Bandgap refresh every 15.625ms. */ - kVBAT_BandgapRefresh31P25ms = 2U, /*!< Bandgap refresh every 31.25ms. */ - kVBAT_BandgapRefresh62P5ms = 3U, /*!< Bandgap refresh every 62.5ms. */ -} vbat_bandgap_refresh_period_t; - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) && FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) -/*! - * @brief The enumeration of bandgap timer0 timeout period. - */ -typedef enum _vbat_bandgap_timer0_timeout_period -{ - kVBAT_BangapTimer0Timeout1s = 0U, /*!< Bandgap timer0 timerout every 1s. */ - kVBAT_BangapTimer0Timeout500ms = 1U, /*!< Bandgap timer0 timerout every 500ms. */ - kVBAT_BangapTimer0Timeout250ms = 2U, /*!< Bandgap timer0 timerout every 250ms. */ - kVBAT_BangapTimer0Timeout125ms = 3U, /*!< Bandgap timer0 timerout every 125ms. */ - kVBAT_BangapTimer0Timeout62P5ms = 4U, /*!< Bandgap timer0 timerout every 62.5ms. */ - kVBAT_BangapTimer0Timeout31P25ms = 5U, /*!< Bandgap timer0 timerout every 31.25ms. */ -} vbat_bandgap_timer0_timeout_period_t; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG) -/*! - * @brief The enumeration of osc32k operate mode, including Bypass mode, low power switched mode and so on. - */ -typedef enum _vbat_osc32k_operate_mode -{ - kVBAT_Osc32kEnabledToTransconductanceMode = 0U, /*!< Set to transconductance mode. */ - kVBAT_Osc32kEnabledToLowPowerBackupMode = 1U, /*!< Set to low power backup mode. */ - kVBAT_Osc32kEnabledToLowPowerSwitchedMode = 2U, /*!< Set to low power switched mode. */ -} vbat_osc32k_operate_mode_t; - -/*! - * @brief The enumeration of OSC32K load capacitance. - */ -typedef enum _vbat_osc32k_load_capacitance_select -{ - kVBAT_Osc32kCrystalLoadCap0pF = - 0U, /*!< Internal capacitance bank is enabled, set the internal capacitance to 0 pF. */ - kVBAT_Osc32kCrystalLoadCap2pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 2 pF. */ - kVBAT_Osc32kCrystalLoadCap4pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 4 pF. */ - kVBAT_Osc32kCrystalLoadCap6pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 6 pF. */ - kVBAT_Osc32kCrystalLoadCap8pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 8 pF. */ - kVBAT_Osc32kCrystalLoadCap10pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 10 pF. */ - kVBAT_Osc32kCrystalLoadCap12pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 12 pF. */ - kVBAT_Osc32kCrystalLoadCap14pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 14 pF. */ - kVBAT_Osc32kCrystalLoadCap16pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 16 pF. */ - kVBAT_Osc32kCrystalLoadCap18pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 18 pF. */ - kVBAT_Osc32kCrystalLoadCap20pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 20 pF. */ - kVBAT_Osc32kCrystalLoadCap22pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 22 pF. */ - kVBAT_Osc32kCrystalLoadCap24pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 24 pF. */ - kVBAT_Osc32kCrystalLoadCap26pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 26 pF. */ - kVBAT_Osc32kCrystalLoadCap28pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 28 pF. */ - kVBAT_Osc32kCrystalLoadCap30pF, /*!< Internal capacitance bank is enabled, set the internal capacitance to 30 pF. */ - kVBAT_Osc32kCrystalLoadCapBankDisabled = 0xF0U, /*!< Internal capacitance bank is disabled. */ -} vbat_osc32k_load_capacitance_select_t; - -/*! - * @brief The enumeration of start-up time of the oscillator. - */ -typedef enum _vbat_osc32k_start_up_time -{ - kVBAT_Osc32kStartUpTime8Sec = 0U, /*!< Configure the start-up time as 8 seconds. */ - kVBAT_Osc32kStartUpTime4Sec, /*!< Configure the start-up time as 4 seconds. */ - kVBAT_Osc32kStartUpTime2Sec, /*!< Configure the start-up time as 2 seconds. */ - kVBAT_Osc32kStartUpTime1Sec, /*!< Configure the start-up time as 1 seconds. */ - kVBAT_Osc32kStartUpTime0P5Sec, /*!< Configure the start-up time as 0.5 seconds. */ - kVBAT_Osc32kStartUpTime0P25Sec, /*!< Configure the start-up time as 0.25 seconds. */ - kVBAT_Osc32kStartUpTime0P125Sec, /*!< Configure the start-up time as 0.125 seconds. */ - kVBAT_Osc32kStartUpTime0P5MSec, /*!< Configure the start-up time as 0.5 milliseconds. */ -} vbat_osc32k_start_up_time_t; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_SWICTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_SWICTL_REG) -/*! - * @brief The enumeration of VBAT module supplies. - */ -typedef enum _vbat_internal_module_supply -{ - kVBAT_ModuleSuppliedByVddBat = 0U, /*!< VDD_BAT supplies VBAT modules. */ - kVBAT_ModuleSuppliedByVddSys = 1U, /*!< VDD_SYS supplies VBAT modules. */ -} vbat_internal_module_supply_t; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_SWICTL_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) && FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) -/*! - * @brief The enumeration of VBAT clock monitor divide trim value - */ -typedef enum _vbat_clock_monitor_divide_trim -{ - kVBAT_ClockMonitorOperateAt1kHz = 0U, /*!< Clock monitor operates at 1 kHz. */ - kVBAT_ClockMonitorOperateAt64Hz = 1U, /*!< Clock monitor operates at 64 Hz. */ -} vbat_clock_monitor_divide_trim_t; - -/*! - * @brief The enumeration of VBAT clock monitor frequency trim value used to adjust the clock monitor assert. - */ -typedef enum _vbat_clock_monitor_freq_trim -{ - kVBAT_ClockMonitorAssert2Cycle = 0U, /*!< Clock monitor assert 2 cycles after expected edge. */ - kVBAT_ClockMonitorAssert4Cycle = 1U, /*!< Clock monitor assert 4 cycles after expected edge. */ - kVBAT_ClockMonitorAssert6Cycle = 2U, /*!< Clock monitor assert 8 cycles after expected edge. */ - kVBAT_ClockMonitorAssert8Cycle = 3U, /*!< Clock monitor assert 8 cycles after expected edge. */ -} vbat_clock_monitor_freq_trim_t; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG */ - -/*! - * @brief The structure of internal 16kHz free running oscillator attributes. - */ -typedef struct _vbat_fro16k_config -{ - bool enableFRO16k; /*!< Enable/disable internal 16kHz free running oscillator. */ - uint8_t enabledConnectionsMask; /*!< The mask of connected modules to enable FRO16k clock output. */ -} vbat_fro16k_config_t; - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) && FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) -/*! - * @brief The structure of internal clock monitor, including divide trim and frequency trim. - */ -typedef struct _vbat_clock_monitor_config -{ - vbat_clock_monitor_divide_trim_t divideTrim : 1U; /* !< Divide trim value, please - refer to @ref vbat_clock_monitor_divide_trim_t */ - vbat_clock_monitor_freq_trim_t freqTrim : 2U; /*!< Frequency trim value used to adjust the clock monitor - assert, please refer to @ref vbat_clock_monitor_freq_trim_t. */ - bool lock : 1U; /*!< Lock the clock monitor control after enabled. */ -} vbat_clock_monitor_config_t; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) && FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) -/*! - * @brief The structure of Tamper configuration. - */ -typedef struct _vbat_tamper_config -{ - bool enableVoltageDetect : 1U; /*!< Enable/disable voltage detection. */ - bool enableTemperatureDetect : 1U; /*!< Enable/disable temperature detection. */ - bool lock : 1U; /*!< Lock the tamper control after enabled. */ -} vbat_tamper_config_t; -#endif /* FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG */ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name FRO16K Control Interfaces - * @{ - */ - -/*! - * @brief Configure internal 16kHz free running oscillator, including enabel FRO16k, gate FRO16k output. - * - * @param base VBAT peripheral base address. - * @param config Pointer to @ref vbat_fro16k_config_t structure. - */ -void VBAT_ConfigFRO16k(VBAT_Type *base, const vbat_fro16k_config_t *config); - -/*! - * @brief Enable/disable internal 16kHz free running oscillator. - * - * @param base VBAT peripheral base address. - * @param enable Used to enable/disable 16kHz FRO. - * - \b true Enable internal 16kHz free running oscillator. - * - \b false Disable internal 16kHz free running oscillator. - */ -static inline void VBAT_EnableFRO16k(VBAT_Type *base, bool enable) -{ - if (enable) - { - base->FROCTLA |= VBAT_FROCTLA_FRO_EN_MASK; -#if (defined(VBAT_FROCTLB_INVERSE_MASK)) - base->FROCTLB &= ~VBAT_FROCTLB_INVERSE_MASK; -#endif /* VBAT_FROCTLB_INVERSE_MASK */ - } - else - { - base->FROCTLA &= ~VBAT_FROCTLA_FRO_EN_MASK; -#if (defined(VBAT_FROCTLB_INVERSE_MASK)) - base->FROCTLB |= VBAT_FROCTLB_INVERSE_MASK; -#endif /* VBAT_FROCTLB_INVERSE_MASK */ - } -} - -/*! - * @brief Check if internal 16kHz free running oscillator is enabled. - * - * @param base VBAT peripheral base address. - * - * @retval true The internal 16kHz Free running oscillator is enabled. - * @retval false The internal 16kHz Free running oscillator is enabled. - */ -static inline bool VBAT_CheckFRO16kEnabled(VBAT_Type *base) -{ - return (bool)((base->FROCTLA & VBAT_FROCTLA_FRO_EN_MASK) == VBAT_FROCTLA_FRO_EN_MASK); -} - -/*! - * @brief Enable FRO16kHz output clock to selected modules. - * - * @param base VBAT peripheral base address. - * @param connectionsMask The mask of modules that FRO16k is connected, should be the OR'ed - * value of @ref vbat_clock_enable_t. - */ -static inline void VBAT_UngateFRO16k(VBAT_Type *base, uint8_t connectionsMask) -{ - base->FROCLKE |= VBAT_FROCLKE_CLKE(connectionsMask); -} - -/*! - * @brief Disable FRO16kHz output clock to selected modules. - * - * @param base VBAT peripheral base address. - * @param connectionsMask The OR'ed value of @ref vbat_clock_enable_t. - */ -static inline void VBAT_GateFRO16k(VBAT_Type *base, uint8_t connectionsMask) -{ - base->FROCLKE &= ~VBAT_FROCLKE_CLKE(connectionsMask); -} - -/*! - * @brief Lock settings of internal 16kHz free running oscillator, please note that if locked 16kHz FRO's settings can - * not be updated until the next POR. - * - * @note Please note that the operation to ungate/gate FRO 16kHz output clock can not be locked by this function. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_LockFRO16kSettings(VBAT_Type *base) -{ - base->FROLCKA |= VBAT_FROLCKA_LOCK_MASK; -#if (defined(VBAT_FROLCKB_LOCK_MASK)) - base->FROLCKB &= ~VBAT_FROLCKB_LOCK_MASK; -#endif /* VBAT_FROLCKB_LOCK_MASK */ -} - -/*! - * @brief Check if FRO16K settings are locked. - * - * @param base VBAT peripheral base address. - * - * @return @c true in case of FRO16k settings are locked, @c false in case of FRO16k settings are not locked. - */ -static inline bool VBAT_CheckFRO16kSettingsLocked(VBAT_Type *base) -{ - return ((base->FROLCKA & VBAT_FROLCKA_LOCK_MASK) != 0UL); -} - -/*! @} */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG) -/*! - * @name OSC32K Control Interfaces - * @{ - */ - -/*! - * @brief Enable/disable 32K Crystal Oscillator. - * - * @param base VBAT peripheral base address. - * @param enable Used to enable/disable 32k Crystal Oscillator: - * - \b true Enable crystal oscillator and polling status register to check clock is ready. - * - \b false Disable crystal oscillator. - */ -static inline void VBAT_EnableCrystalOsc32k(VBAT_Type *base, bool enable) -{ - if (enable) - { - base->OSCCTLA |= VBAT_OSCCTLA_OSC_EN_MASK; - base->OSCCTLB &= ~VBAT_OSCCTLA_OSC_EN_MASK; - - /* Polling status register to check clock is ready. */ - while ((base->STATUSA & VBAT_STATUSA_OSC_RDY_MASK) == 0UL) - {} - } - else - { - base->OSCCTLA &= ~VBAT_OSCCTLA_OSC_EN_MASK; - base->OSCCTLB |= VBAT_OSCCTLA_OSC_EN_MASK; - } -} - -/*! - * @brief Bypass 32k crystal oscillator, the clock is still output by oscillator but this clock is the same as clock - * provided on EXTAL pin. - * - * @note In bypass mode, oscillator must be enabled; To exit bypass mode, oscillator must be disabled. - * - * @param base VBAT peripheral base address. - * @param enableBypass Used to enter/exit bypass mode: - * - \b true Enter into bypass mode; - * - \b false Exit bypass mode. - */ -static inline void VBAT_BypassCrystalOsc32k(VBAT_Type *base, bool enableBypass) -{ - if (enableBypass) - { - base->OSCCTLA |= (VBAT_OSCCTLA_OSC_EN_MASK | VBAT_OSCCTLA_OSC_BYP_EN_MASK); - base->OSCCTLB &= ~(VBAT_OSCCTLA_OSC_EN_MASK | VBAT_OSCCTLA_OSC_BYP_EN_MASK); - } - else - { - base->OSCCTLA &= ~(VBAT_OSCCTLA_OSC_EN_MASK | VBAT_OSCCTLA_OSC_BYP_EN_MASK); - base->OSCCTLB |= (VBAT_OSCCTLA_OSC_EN_MASK | VBAT_OSCCTLA_OSC_BYP_EN_MASK); - } -} - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_OSCCTLA_FINE_AMP_GAIN_BIT) && FSL_FEATURE_MCX_VBAT_HAS_OSCCTLA_FINE_AMP_GAIN_BIT) -/*! - * @brief Adjust 32k crystal oscillator amplifier gain. - * - * @param base VBAT peripheral base address. - * @param coarse Specify amplifier coarse trim value. - * @param fine Specify amplifier fine trim value. - */ -static inline void VBAT_AdjustCrystalOsc32kAmplifierGain(VBAT_Type *base, uint8_t coarse, uint8_t fine) -{ - base->OSCCTLA = ((base->OSCCTLA & ~(VBAT_OSCCTLA_COARSE_AMP_GAIN_MASK | VBAT_OSCCTLA_FINE_AMP_GAIN_MASK)) | - (VBAT_OSCCTLA_COARSE_AMP_GAIN(coarse) | VBAT_OSCCTLA_FINE_AMP_GAIN(fine))); - base->OSCCTLB = ((base->OSCCTLB & ~(VBAT_OSCCTLA_COARSE_AMP_GAIN_MASK | VBAT_OSCCTLA_FINE_AMP_GAIN_MASK)) | - (VBAT_OSCCTLA_COARSE_AMP_GAIN(~coarse) | VBAT_OSCCTLA_FINE_AMP_GAIN(~fine))); -} -#else -/*! - * @brief Adjust 32k crystal oscillator amplifier gain. - * - * @param base VBAT peripheral base address. - * @param coarse Specify amplifier coarse trim value. - */ -static inline void VBAT_AdjustCrystalOsc32kAmplifierGain(VBAT_Type *base, uint8_t coarse) -{ - base->OSCCTLA = (base->OSCCTLA & ~VBAT_OSCCTLA_COARSE_AMP_GAIN_MASK) | (VBAT_OSCCTLA_COARSE_AMP_GAIN(coarse)); - base->OSCCTLB = (base->OSCCTLB & ~VBAT_OSCCTLA_COARSE_AMP_GAIN_MASK) | (VBAT_OSCCTLA_COARSE_AMP_GAIN(~(uint32_t)coarse)); -} - -#endif /* */ - -/*! - * @brief Set 32k crystal oscillator mode and load capacitance for the XTAL/EXTAL pin. - * - * @param base VBAT peripheral base address. - * @param operateMode Specify the crystal oscillator mode, please refer to @ref vbat_osc32k_operate_mode_t. - * @param xtalCap Specify the internal capacitance for the XTAL pin from the capacitor bank. - * @param extalCap Specify the internal capacitance for the EXTAL pin from the capacitor bank. - * - * @retval kStatus_VBAT_WrongCapacitanceValue The load capacitance value to set is not align with operate mode's - * requirements. - * @retval kStatus_Success Success to set operate mode and load capacitance. - */ -status_t VBAT_SetCrystalOsc32kModeAndLoadCapacitance(VBAT_Type *base, - vbat_osc32k_operate_mode_t operateMode, - vbat_osc32k_load_capacitance_select_t xtalCap, - vbat_osc32k_load_capacitance_select_t extalCap); - -/*! - * @brief Trim 32k crystal oscillator startup time. - * - * @param base VBAT peripheral base address. - * @param startupTime Specify the startup time of the oscillator. - */ -static inline void VBAT_TrimCrystalOsc32kStartupTime(VBAT_Type *base, vbat_osc32k_start_up_time_t startupTime) -{ - base->OSCCFGA = ((base->OSCCFGA & ~(VBAT_OSCCFGA_INIT_TRIM_MASK)) | VBAT_OSCCFGA_INIT_TRIM(startupTime)); - base->OSCCFGB = ((base->OSCCFGB & ~(VBAT_OSCCFGA_INIT_TRIM_MASK)) | VBAT_OSCCFGA_INIT_TRIM(~((uint32_t)startupTime))); -} - -/*! - * @brief Set crystal oscillator comparator trim value when oscillator is set as low power switch mode. - * - * @param base VBAT peripheral base address. - * @param comparatorTrimValue Comparator trim value, ranges from 0 to 7. - */ -static inline void VBAT_SetOsc32kSwitchModeComparatorTrimValue(VBAT_Type *base, uint8_t comparatorTrimValue) -{ - base->OSCCFGA = ((base->OSCCFGA & ~VBAT_OSCCFGA_CMP_TRIM_MASK) | VBAT_OSCCFGA_CMP_TRIM(comparatorTrimValue)); - base->OSCCFGB = ((base->OSCCFGB & ~VBAT_OSCCFGA_CMP_TRIM_MASK) | VBAT_OSCCFGA_CMP_TRIM(~((uint32_t)comparatorTrimValue))); -} - -/*! - * @brief Set crystal oscillator delay trim value when oscillator is set as low power switch mode. - * - * @param base VBAT peripheral base address. - * @param delayTrimValue Delay trim value, ranges from 0 to 15. - */ -static inline void VBAT_SetOsc32kSwitchModeDelayTrimValue(VBAT_Type *base, uint8_t delayTrimValue) -{ - base->OSCCFGA = ((base->OSCCFGA & ~VBAT_OSCCFGA_DLY_TRIM_MASK) | VBAT_OSCCFGA_DLY_TRIM(delayTrimValue)); - base->OSCCFGB = ((base->OSCCFGB & ~VBAT_OSCCFGA_DLY_TRIM_MASK) | VBAT_OSCCFGA_DLY_TRIM(~((uint32_t)delayTrimValue))); -} - -/*! - * @brief Set crystal oscillator capacitor trim value when oscillator is set as low power switch mode. - * - * @param base VBAT peripheral base address. - * @param capacitorTrimValue Capacitor value to trim, ranges from 0 to 3. - */ -static inline void VBAT_SetOsc32kSwitchModeCapacitorTrimValue(VBAT_Type *base, uint8_t capacitorTrimValue) -{ - base->OSCCFGA = ((base->OSCCFGA & ~VBAT_OSCCFGA_CAP_TRIM_MASK) | VBAT_OSCCFGA_CAP_TRIM(capacitorTrimValue)); - base->OSCCFGB = ((base->OSCCFGB & ~VBAT_OSCCFGA_CAP_TRIM_MASK) | VBAT_OSCCFGA_CAP_TRIM(~((uint32_t)capacitorTrimValue))); -} - -/*! - * @brief Lock Osc32k settings, after locked all writes to the Oscillator registers are blocked. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_LookOsc32kSettings(VBAT_Type *base) -{ - base->OSCLCKA |= VBAT_OSCLCKA_LOCK_MASK; - base->OSCLCKB &= ~VBAT_OSCLCKB_LOCK_MASK; -} - -/*! - * @brief Unlock Osc32k settings. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_UnlockOsc32kSettings(VBAT_Type *base) -{ - base->OSCLCKA &= ~VBAT_OSCLCKA_LOCK_MASK; - base->OSCLCKB |= VBAT_OSCLCKB_LOCK_MASK; -} - -/*! - * @brief Check if osc32k settings are locked. - * - * @param base VBAT peripheral base address. - * @return \c true in case of osc32k settings are locked, \c false in case of osc32k settings are not locked. - */ -static inline bool VBAT_CheckOsc32kSettingsLocked(VBAT_Type *base) -{ - return ((base->OSCLCKA & VBAT_OSCLCKA_LOCK_MASK) != 0UL); -} - -/*! - * @brief Enable OSC32k output clock to selected modules. - * - * @param base VBAT peripheral base address. - * @param connectionsMask The OR'ed value of @ref vbat_clock_enable_t. - */ -static inline void VBAT_UngateOsc32k(VBAT_Type *base, uint8_t connectionsMask) -{ - base->OSCCLKE |= VBAT_OSCCLKE_CLKE(connectionsMask); -} - -/*! - * @brief Disable OSC32k output clock to selected modules. - * - * @param base VBAT peripheral base address. - * @param connectionsMask The OR'ed value of @ref vbat_clock_enable_t. - */ -static inline void VBAT_GateOsc32k(VBAT_Type *base, uint8_t connectionsMask) -{ - base->OSCCLKE &= ~VBAT_OSCCLKE_CLKE(connectionsMask); -} - -/*! @} */ -#endif /* FSL_FEATURE_MCX_VBAT_HAS_OSCCTL_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_LDOCTL_REG) -/*! - * @name RAM_LDO Control Interfaces - * @{ - */ - -/*! - * @brief Enable/disable Bandgap. - * - * @note The FRO16K must be enabled before enabling the bandgap. - * @note This setting can be locked by VBAT_LockRamLdoSettings() function. - * - * @param base VBAT peripheral base address. - * @param enable Used to enable/disable bandgap. - * - \b true Enable the bandgap. - * - \b false Disable the bandgap. - * - * @retval kStatus_Success Success to enable/disable the bandgap. - * @retval kStatus_VBAT_Fro16kNotEnabled Fail to enable the bandgap due to FRO16k is not enabled previously. - */ -status_t VBAT_EnableBandgap(VBAT_Type *base, bool enable); - -/*! - * @brief Check if bandgap is enabled. - * - * @param base VBAT peripheral base address. - * - * @retval true The bandgap is enabled. - * @retval false The bandgap is disabled. - */ -static inline bool VBAT_CheckBandgapEnabled(VBAT_Type *base) -{ - return (bool)((base->LDOCTLA & VBAT_LDOCTLA_BG_EN_MASK) == VBAT_LDOCTLA_BG_EN_MASK); -} - -/*! - * @brief Enable/disable bandgap low power refresh mode. - * - * @note For lowest power consumption, refresh mode must be enabled. - * @note This setting can be locked by VBAT_LockRamLdoSettings() function. - * - * @param base VBAT peripheral base address. - * @param enableRefreshMode Used to enable/disable bandgap low power refresh mode. - * - \b true Enable bandgap low power refresh mode. - * - \b false Disable bandgap low power refresh mode. - */ -static inline void VBAT_EnableBandgapRefreshMode(VBAT_Type *base, bool enableRefreshMode) -{ - if (enableRefreshMode) - { - base->LDOCTLA |= VBAT_LDOCTLA_REFRESH_EN_MASK; - base->LDOCTLB &= ~VBAT_LDOCTLA_REFRESH_EN_MASK; - } - else - { - base->LDOCTLA &= ~VBAT_LDOCTLA_REFRESH_EN_MASK; - base->LDOCTLB |= VBAT_LDOCTLA_REFRESH_EN_MASK; - } -} - -/*! - * @brief Enable/disable Backup RAM Regulator(RAM_LDO). - * - * @note This setting can be locked by VBAT_LockRamLdoSettings() function. - * - * @param base VBAT peripheral base address. - * @param enable Used to enable/disable RAM_LDO. - * - \b true Enable backup SRAM regulator. - * - \b false Disable backup SRAM regulator. - * - * @retval kStatusSuccess Success to enable/disable backup SRAM regulator. - * @retval kStatus_VBAT_Fro16kNotEnabled Fail to enable backup SRAM regulator due to FRO16k is not enabled previously. - * @retval kStatus_VBAT_BandgapNotEnabled Fail to enable backup SRAM regulator due to the bandgap is not enabled - * previously. - */ -status_t VBAT_EnableBackupSRAMRegulator(VBAT_Type *base, bool enable); - -/*! - * @brief Lock settings of RAM_LDO, please note that if locked then RAM_LDO's settings - * can not be updated until the next POR. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_LockRamLdoSettings(VBAT_Type *base) -{ - base->LDOLCKA |= VBAT_LDOLCKA_LOCK_MASK; - base->LDOLCKB &= ~VBAT_LDOLCKA_LOCK_MASK; -} - -/*! - * @brief Check if RAM_LDO settings is locked. - * - * @param base VBAT peripheral base address. - * @return @c true in case of RAM_LDO settings are locked, @c false in case of RAM_LDO settings are unlocked. - */ -static inline bool VBAT_CheckRamLdoSettingsLocked(VBAT_Type *base) -{ - return ((base->LDOLCKA & VBAT_LDOLCKA_LOCK_MASK) != 0UL); -} - -/*! - * @brief Switch the SRAM to be powered by LDO_RAM. - * - * @note This function can be used to switch the SRAM to the VBAT retention supply at any time, but please note that the - * SRAM must not be accessed during this time. - * @note Invoke this function to switch power supply before switching off external power. - * @note RAM_LDO must be enabled before invoking this function. - * @note To access the SRAM arrays retained by the LDO_RAM, please invoke VBAT_SwitchSRAMPowerBySocSupply(), after - * external power is switched back on. - * - * @param base VBAT peripheral base address. - * - * @retval kStatusSuccess Success to Switch SRAM powered by VBAT. - * @retval kStatus_VBAT_Fro16kNotEnabled Fail to switch SRAM powered by VBAT due to FRO16K not enabled previously. - */ -status_t VBAT_SwitchSRAMPowerByLDOSRAM(VBAT_Type *base); - -/*! - * @brief Switch the RAM to be powered by Soc Supply in software mode. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_SwitchSRAMPowerBySocSupply(VBAT_Type *base) -{ - base->LDORAMC &= ~VBAT_LDORAMC_SWI_MASK; - base->LDORAMC &= ~VBAT_LDORAMC_ISO_MASK; -} - -/*! - * @brief Power off selected SRAM array in low power modes. - * - * @param base VBAT peripheral base address. - * @param sramMask The mask of SRAM array to power off, should be the OR'ed value of @ref vbat_ram_array_t. - */ -static inline void VBAT_PowerOffSRAMsInLowPowerModes(VBAT_Type *base, uint8_t sramMask) -{ - base->LDORAMC |= (uint32_t)VBAT_LDORAMC_RET(sramMask); -} - -/*! - * @brief Retain selected SRAM array in low power modes. - * - * @param base VBAT peripheral base address. - * @param sramMask The mask of SRAM array to retain, should be the OR'ed value of @ref vbat_ram_array_t. - */ -static inline void VBAT_RetainSRAMsInLowPowerModes(VBAT_Type *base, uint8_t sramMask) -{ - base->LDORAMC &= ~(uint32_t)VBAT_LDORAMC_RET(sramMask); -} - -/*! - * @brief Enable/disable SRAM isolation. - * - * @param base VBAT peripheral base address. - * @param enable Used to enable/disable SRAM violation. - * - \b true SRAM will be isolated. - * - \b false SRAM state follows the SoC power modes. - */ -static inline void VBAT_EnableSRAMIsolation(VBAT_Type *base, bool enable) -{ - if (enable) - { - base->LDORAMC |= VBAT_LDORAMC_ISO_MASK; - } - else - { - base->LDORAMC &= ~VBAT_LDORAMC_ISO_MASK; - } -} - -/*! @} */ -#endif /* FSL_FEATURE_MCX_VBAT_HAS_RAM_LDO */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) && FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER) -/*! @name Bandgap Timer Control Interfaces - * @{ - */ - -/*! - * @brief Enable/disable Bandgap timer. - * - * @note The bandgap timer is available when the bandgap is enabled and are clocked by the FRO16k. - * - * @param base VBAT peripheral base address. - * @param enable Used to enable/disable bandgap timer. - * @param timerIdMask The mask of bandgap timer Id, should be the OR'ed value of @ref vbat_bandgap_timer_id_t. - * - * @retval kStatus_Success Success to enable/disable selected bandgap timer. - * @retval kStatus_VBAT_Fro16kNotEnabled Fail to enable/disable selected bandgap timer due to FRO16k not enabled - * previously. - * @retval kStatus_VBAT_BandgapNotEnabled Fail to enable/disable selected bandgap timer due to bandgap not enabled - * previously. - */ -status_t VBAT_EnableBandgapTimer(VBAT_Type *base, bool enable, uint8_t timerIdMask); - -/*! - * @brief Set bandgap timer0 timeout value. - * - * @note The timeout value can only be changed when the timer is disabled. - * - * @param base VBAT peripheral base address. - * @param timeoutPeriod Bandgap timer timeout value, please refer to @ref vbat_bandgap_timer0_timeout_period_t. - */ -void VBAT_SetBandgapTimer0TimeoutValue(VBAT_Type *base, vbat_bandgap_timer0_timeout_period_t timeoutPeriod); - -/*! - * @brief Set bandgap timer1 timeout value. - * - * @note The timeout value can only be changed when the timer is disabled. - * - * @param base VBAT peripheral base address. - * @param timeoutPeriod The bandgap timerout 1 period, in number of seconds, ranging from 0 to 65535s. - */ -void VBAT_SetBandgapTimer1TimeoutValue(VBAT_Type *base, uint32_t timeoutPeriod); - -/*! @} */ -#endif /* FSL_FEATURE_MCX_VBAT_HAS_BANDGAP_TIMER */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_SWICTL_REG) && FSL_FEATURE_MCX_VBAT_HAS_SWICTL_REG) -/*! @name Switch Control Interfaces - * @{ - */ - -/*! - * @brief Control the VBAT internal switch in active mode, VBAT modules can be suppiled by VDD_BAT and VDD_SYS. - * - * @param base VBAT peripheral base address. - * @param supply Used to control the VBAT internal switch. - */ -static inline void VBAT_SwitchVBATModuleSupplyActiveMode(VBAT_Type *base, vbat_internal_module_supply_t supply) -{ - if (supply == kVBAT_ModuleSuppliedByVddBat) - { - base->SWICTLA &= ~VBAT_SWICTLA_SWI_EN_MASK; - base->SWICTLB |= VBAT_SWICTLA_SWI_EN_MASK; - } - else - { - base->SWICTLA |= VBAT_SWICTLA_SWI_EN_MASK; - base->SWICTLB &= ~VBAT_SWICTLA_SWI_EN_MASK; - } -} - -/*! - * @brief Get VBAT module supply in active mode. - * - * @param base VBAT peripheral base address. - * @return VDD_SYS supplies VBAT modules or VDD_BAT supplies VBAT modules, in type of @ref - * vbat_internal_module_supply_t. - */ -static inline vbat_internal_module_supply_t VBAT_GetVBATModuleSupply(VBAT_Type *base) -{ - return (vbat_internal_module_supply_t)(uint8_t)(base->SWICTLA & VBAT_SWICTLA_SWI_EN_MASK); -} - -/*! - * @brief Control the VBAT internal switch in low power modes. - * - * @note If VBAT modules are supplied by VDD_SYS in low power modes, VBAT module will also supplied by VDD_SYS in active - * mode. - * - * @param base VBAT peripheral base address. - * @param supply Used to specify which voltage input supply VBAT modules in low power mode. - */ -static inline void VBAT_SwitchVBATModuleSupplyLowPowerMode(VBAT_Type *base, vbat_internal_module_supply_t supply) -{ - if (supply == kVBAT_ModuleSuppliedByVddBat) - { - base->SWICTLA &= ~VBAT_SWICTLA_LP_EN_MASK; - base->SWICTLB |= VBAT_SWICTLA_LP_EN_MASK; - } - else - { - base->SWICTLA |= VBAT_SWICTLA_SWI_EN_MASK; - base->SWICTLB &= ~VBAT_SWICTLA_SWI_EN_MASK; - base->SWICTLA |= VBAT_SWICTLA_LP_EN_MASK; - base->SWICTLB &= ~VBAT_SWICTLA_LP_EN_MASK; - } -} - -/*! - * @brief Lock switch control, if locked all writes to the switch registers will be blocked. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_LockSwitchControl(VBAT_Type *base) -{ - base->SWILCKA |= VBAT_SWILCKA_LOCK_MASK; - base->SWILCKB &= ~VBAT_SWILCKB_LOCK_MASK; -} - -/*! - * @brief Unlock switch control. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_UnlockSwitchControl(VBAT_Type *base) -{ - base->SWILCKA &= ~VBAT_SWILCKA_LOCK_MASK; - base->SWILCKB |= VBAT_SWILCKB_LOCK_MASK; -} - -/*! - * @brief Check if switch control is locked. - * - * @param base VBAT peripheral base address. - * - * @retval false switch control is not locked. - * @retval true switch control is locked, any writes to related registers are blocked. - */ -static inline bool VBAT_CheckSwitchControlLocked(VBAT_Type *base) -{ - return ((base->SWILCKA & VBAT_SWILCKA_LOCK_MASK) != 0UL); -} - -/*! @} */ -#endif /* FSL_FEATURE_MCX_VBAT_HAS_SWICTL_REG */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) && FSL_FEATURE_MCX_VBAT_HAS_CLKMON_REG) -/*! - * @name Clock Monitor Interfaces - * @{ - */ - -/*! - * @brief Initialize the VBAT clock monitor, enable clock monitor and set the clock monitor configuration. - * - * @note Both FRO16K and OSC32K should be enabled and stable before invoking this function. - * - * @param base VBAT peripheral base address. - * @param config Pointer to @ref vbat_clock_monitor_config_t structure. - * - * @retval kStatus_Success Clock monitor is initialized successfully. - * @retval kStatus_VBAT_Fro16kNotEnabled FRO16K is not enabled. - * @retval kStatus_VBAT_Osc32kNotReady OSC32K is not ready. - * @retval kStatus_VBAT_ClockMonitorLocked Clock monitor is locked. - */ -status_t VBAT_InitClockMonitor(VBAT_Type *base, const vbat_clock_monitor_config_t *config); - -/*! - * @brief Deinitialize the VBAT clock monitor. - * - * @param base VBAT peripheral base address. - * - * @retval kStatus_Success Clock monitor is de-initialized successfully. - * @retval kStatus_VBAT_ClockMonitorLocked Control of Clock monitor is locked. - */ -status_t VBAT_DeinitMonitor(VBAT_Type *base); - -/*! - * @brief Enable/disable clock monitor. - * - * @param base VBAT peripheral base address. - * @param enable Switcher to enable/disable clock monitor: - * - true: enable clock monitor; - * - false: disable clock monitor. - */ -static inline void VBAT_EnableClockMonitor(VBAT_Type *base, bool enable) -{ - if (enable) - { - base->MONCTLA |= VBAT_MONCTLA_MON_EN_MASK; - base->MONCTLB &= ~VBAT_MONCTLA_MON_EN_MASK; - } - else - { - base->MONCTLA &= ~VBAT_MONCTLA_MON_EN_MASK; - base->MONCTLB |= VBAT_MONCTLA_MON_EN_MASK; - } -} - -/*! - * @brief Set clock monitor's divide trim, avaiable value is #kVBAT_ClockMonitorOperateAt1kHz and - * #kVBAT_ClockMonitorOperateAt64Hz - * - * @param base VBAT peripheral base address. - * @param divideTrim Specify divide trim value, please refer to @ref vbat_clock_monitor_divide_trim_t. - */ -static inline void VBAT_SetClockMonitorDivideTrim(VBAT_Type *base, vbat_clock_monitor_divide_trim_t divideTrim) -{ - base->MONCFGA = (base->MONCFGA & ~VBAT_MONCFGA_DIVIDE_TRIM_MASK) | VBAT_MONCFGA_DIVIDE_TRIM(divideTrim); - base->MONCFGB = (base->MONCFGB & ~VBAT_MONCFGA_DIVIDE_TRIM_MASK) | VBAT_MONCFGA_DIVIDE_TRIM(~divideTrim); -} - -/*! - * @brief Set clock monitor's frequency trim, avaiable value is #kVBAT_ClockMonitorAssert2Cycle, - * #kVBAT_ClockMonitorAssert4Cycle, #kVBAT_ClockMonitorAssert6Cycle and #kVBAT_ClockMonitorAssert8Cycle. - * - * @param base VBAT peripheral base address. - * @param freqTrim Specify frequency trim value, please refer to @ref vbat_clock_monitor_freq_trim_t. - */ -static inline void VBAT_SetClockMonitorFrequencyTrim(VBAT_Type *base, vbat_clock_monitor_freq_trim_t freqTrim) -{ - base->MONCFGA = (base->MONCFGA & ~VBAT_MONCFGA_FREQ_TRIM_MASK) | VBAT_MONCFGA_FREQ_TRIM(freqTrim); - base->MONCFGB = (base->MONCFGB & ~VBAT_MONCFGA_FREQ_TRIM_MASK) | VBAT_MONCFGA_FREQ_TRIM(~freqTrim); -} - -/*! - * @brief Lock clock monitor enable/disable control. - * - * @note If locked, it is not allowed to change clock monitor enable/disable control. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_LockClockMonitorControl(VBAT_Type *base) -{ - base->MONLCKA |= VBAT_MONLCKA_LOCK_MASK; - base->MONLCKB &= ~VBAT_MONLCKA_LOCK_MASK; -} - -/*! - * @brief Unlock clock monitor enable/disable control. - * - * @param base VBTA peripheral base address. - */ -static inline void VBAT_UnlockClockMonitorControl(VBAT_Type *base) -{ - base->MONLCKA &= ~VBAT_MONLCKA_LOCK_MASK; - base->MONLCKB |= VBAT_MONLCKA_LOCK_MASK; -} - -/*! - * @brief Check if clock monitor enable/disable control is locked. - * - * @note If locked, it is not allowed to change clock monitor enable/disable control. - * - * @param base VBAT peripheral base address. - * - * @retval false clock monitor enable/disable control is not locked. - * @retval true clock monitor enable/disable control is locked, any writes to related registers are blocked. - */ -static inline bool VBAT_CheckClockMonitorControlLocked(VBAT_Type *base) -{ - return ((base->MONLCKA & VBAT_MONLCKA_LOCK_MASK) != 0UL); -} - -/*! @} */ -#endif /* FSL_FEATURE_VBAT_HAS_CLOCK_MONITOR */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) && FSL_FEATURE_MCX_VBAT_HAS_TAMPER_REG) -/*! @name Tamper Control Interfaces - * - */ - -/*! - * @brief Initialize tamper control. - * - * @note Both FRO16K and bandgap should be enabled before calling this function. - * - * @param base VBAT peripheral base address. - * @param config Pointer to @ref vbat_tamper_config_t structure. - * - * @retval kStatus_Success Tamper is initialized successfully. - * @retval kStatus_VBAT_TamperLocked Tamper control is locked. - * @retval kStatus_VBAT_BandgapNotEnabled Bandgap is not enabled. - * @retval kStatus_VBAT_Fro16kNotEnabled FRO 16K is not enabled. - */ -status_t VBAT_InitTamper(VBAT_Type *base, const vbat_tamper_config_t *config); - -/*! - * @brief De-initialize tamper control. - * - * @param base VBAT peripheral base address. - * - * @retval kStatus_Success Tamper is de-initialized successfully. - * @retval kStatus_VBAT_TamperLocked Tamper control is locked. - */ -status_t VBAT_DeinitTamper(VBAT_Type *base); - -/*! - * @brief Enable tampers for VBAT. - * - * @param base VBAT peripheral base address. - * @param tamperEnableMask Mask of tamper to be enabled, should be the OR'ed value of @ref _vbat_tamper_enable. - */ -static inline void VBAT_EnableTamper(VBAT_Type *base, uint32_t tamperEnableMask) -{ - base->TAMPERA |= tamperEnableMask; - base->TAMPERB &= ~tamperEnableMask; -} - -/*! - * @brief Disable tampers for VBAT. - * - * @param base VBAT peripheral base address. - * @param tamperEnableMask Mask of tamper to be disabled, should be the OR'ed value of @ref _vbat_tamper_enable. - */ -static inline void VBAT_DisableTamper(VBAT_Type *base, uint32_t tamperEnableMask) -{ - base->TAMPERA &= ~tamperEnableMask; - base->TAMPERB |= tamperEnableMask; -} - -/*! - * @brief Get tamper enable information. - * - * @param base VBAT peripheral base address. - * - * @return Mask of tamper enable information, should be the OR'ed value of @ref _vbat_tamper_enable. - */ -static inline uint32_t VBAT_GetTamperEnableInfo(VBAT_Type *base) -{ - return base->TAMPERA; -} - -/*! - * @brief Lock tamper control, if locked, it is not allowed to change tamper control. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_LockTamperControl(VBAT_Type *base) -{ - base->TAMLCKA |= VBAT_TAMLCKA_LOCK_MASK; - base->TAMLCKB &= ~VBAT_TAMLCKA_LOCK_MASK; -} - -/*! - * @brief Unlock tamper control. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_UnlockTamperControl(VBAT_Type *base) -{ - base->TAMLCKA &= ~VBAT_TAMLCKA_LOCK_MASK; - base->TAMLCKB |= VBAT_TAMLCKA_LOCK_MASK; -} - -/*! - * @brief Check if tamper control is locked. - * - * @param base VBAT peripheral base address. - * - * @retval false Tamper control is not locked. - * @retval true Tamper control is locked, any writes to related registers are blocked. - */ -static inline bool VBAT_CheckTamperControlLocked(VBAT_Type *base) -{ - return ((base->TAMLCKA & VBAT_TAMLCKA_LOCK_MASK) != 0UL); -} - -/*! @} */ -#endif /* FSL_FEATURE_VBAT_HAS_TAMPER */ - -#if (defined(FSL_FEATURE_MCX_VBAT_HAS_STATUS_REG) && FSL_FEATURE_MCX_VBAT_HAS_STATUS_REG) -/*! @name Status, Interrupt, Wakeup Control Interfaces - * @{ - */ - -/*! - * @brief Get VBAT status flags - * - * @param base VBAT peripheral base address. - * @return The asserted status flags, should be the OR'ed value of @ref vbat_status_flag_t. - */ -static inline uint32_t VBAT_GetStatusFlags(VBAT_Type *base) -{ - return (uint32_t)(base->STATUSA); -} - -/*! - * @brief Clear VBAT status flags. - * - * @param base VBAT peripheral base address. - * @param mask The mask of status flags to be cleared, should be the OR'ed value of @ref vbat_status_flag_t except - * @ref kVBAT_StatusFlagLdoReady, @ref kVBAT_StatusFlagOsc32kReady, @ref kVBAT_StatusFlagInterrupt0Detect, - * @ref kVBAT_StatusFlagInterrupt1Detect, @ref kVBAT_StatusFlagInterrupt2Detect, - * @ref kVBAT_StatusFlagInterrupt3Detect. - */ -static inline void VBAT_ClearStatusFlags(VBAT_Type *base, uint32_t mask) -{ - base->STATUSA = mask; - base->STATUSB = ~mask; -} - -/*! - * @brief Enable interrupts for the VBAT module, such as POR detect interrupt, Wakeup Pin interrupt and so on. - * - * @param base VBAT peripheral base address. - * @param mask The mask of interrupts to be enabled, should be the OR'ed value of @ref vbat_interrupt_enable_t. - */ -static inline void VBAT_EnableInterrupts(VBAT_Type *base, uint32_t mask) -{ - base->IRQENA |= mask; - base->IRQENB &= (uint32_t)~mask; -} - -/*! - * @brief Disable interrupts for the VBAT module, such as POR detect interrupt, wakeup pin interrupt and so on. - * - * @param base VBAT peripheral base address. - * @param mask The mask of interrupts to be disabled, should be the OR'ed value of @ref vbat_interrupt_enable_t. - */ -static inline void VBAT_DisableInterrupts(VBAT_Type *base, uint32_t mask) -{ - base->IRQENA &= ~mask; - base->IRQENB |= mask; -} - -/*! - * @brief Enable wakeup for the VBAT module, such as POR detect wakeup, wakeup pin wakeup and so on. - * - * @param base VBAT peripheral base address. - * @param mask The mask of enumerators in @ref vbat_wakeup_enable_t. - */ -static inline void VBAT_EnableWakeup(VBAT_Type *base, uint32_t mask) -{ - base->WAKENA |= mask; - base->WAKENB &= ~mask; -} - -/*! - * @brief Disable wakeup for VBAT module, such as POR detect wakeup, wakeup pin wakeup and so on. - * - * @param base VBAT peripheral base address. - * @param mask The mask of enumerators in @ref vbat_wakeup_enable_t. - */ -static inline void VBAT_DisableWakeup(VBAT_Type *base, uint32_t mask) -{ - base->WAKENA &= ~mask; - base->WAKENB |= mask; -} - -/*! - * @brief Lock VBAT interrupt and wakeup settings, please note that if locked the interrupt and wakeup settings can not - * be updated until the next POR. - * - * @param base VBAT peripheral base address. - */ -static inline void VBAT_LockInterruptWakeupSettings(VBAT_Type *base) -{ - base->LOCKA |= VBAT_LOCKA_LOCK_MASK; -} - -/*! - * @brief Set the default state of the WAKEUP_b pin output when no enabled wakeup source is asserted. - * - * @param base VBAT peripheral base address. - * @param assert Used to set default state of the WAKEUP_b pin output: - * - \b true WAKEUP_b output state is logic one; - * - \b false WAKEUP_b output state is logic zero. - */ -static inline void VBAT_SetWakeupPinDefaultState(VBAT_Type *base, bool assert) -{ - if (assert) - { - base->WAKECFG |= VBAT_WAKECFG_OUT_MASK; - } - else - { - base->WAKECFG &= ~VBAT_WAKECFG_OUT_MASK; - } -} - -/*! @} */ -#endif /* FSL_FEATURE_MCX_VBAT_HAS_STATUS_REG */ - -#if defined(__cplusplus) -} -#endif - -/*! - * @} - */ -#endif /* FSL_VBAT_H__ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_vref.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_vref.c deleted file mode 100644 index fd8ee68ae2b..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_vref.c +++ /dev/null @@ -1,308 +0,0 @@ -/* - * Copyright 2019-2022 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_vref.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.vref_1" -#endif - -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Gets the instance from the base address - * - * @param base VREF peripheral base address - * - * @return The VREF instance - */ -static uint32_t VREF_GetInstance(VREF_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/*! @brief Pointers to VREF bases for each instance. */ -static VREF_Type *const s_vrefBases[] = VREF_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to VREF clocks for each instance. */ -static const clock_ip_name_t s_vrefClocks[] = VREF_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -/******************************************************************************* - * Code - ******************************************************************************/ - -static uint32_t VREF_GetInstance(VREF_Type *base) -{ - uint32_t instance; - - /* Find the instance index from base address mappings. */ - /* - * $Branch Coverage Justification$ - * (instance >= ARRAY_SIZE(s_vrefBases)) not covered. The peripheral base - * address is always valid and checked by assert. - */ - for (instance = 0; instance < ARRAY_SIZE(s_vrefBases); instance++) - { - /* - * $Branch Coverage Justification$ - * (s_vrefBases[instance] != base) not covered. The peripheral base - * address is always valid and checked by assert. - */ - if (s_vrefBases[instance] == base) - { - break; - } - } - - assert(instance < ARRAY_SIZE(s_vrefBases)); - - return instance; -} - -/*! - * brief Enables the clock gate and configures the VREF module according to the configuration structure. - * - * This function must be called before calling all other VREF driver functions, read/write registers, and - * configurations with user-defined settings. The example below shows how to set up vref_config_t parameters - * and how to call the VREF_Init function by passing in these parameters. - * code - * vref_config_t vrefConfig; - * VREF_GetDefaultConfig(VREF, &vrefConfig); - * vrefConfig.bufferMode = kVREF_ModeHighPowerBuffer; - * VREF_Init(VREF, &vrefConfig); - * endcode - * - * param base VREF peripheral address. - * param config Pointer to the configuration structure. - */ -void VREF_Init(VREF_Type *base, const vref_config_t *config) -{ - assert(config != NULL); - - uint32_t tmp32 = 0UL; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Ungate clock for VREF */ - CLOCK_EnableClock(s_vrefClocks[VREF_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - - base->CSR |= VREF_CSR_LPBGEN_MASK; - /* After enabling low power bandgap, delay 20 us. */ - SDK_DelayAtLeastUs(20U, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY); - - /* Provides bias current for other peripherals. */ - if (config->enableLowPowerBuff) - { - base->CSR |= VREF_CSR_LPBG_BUF_EN_MASK; - } - - if (config->bufferMode != kVREF_ModeBandgapOnly) - { - if (config->enableHCBandgap) - { - tmp32 |= VREF_CSR_HCBGEN_MASK; - } - - if (config->enableInternalVoltageRegulator) - { - tmp32 |= VREF_CSR_REGEN_MASK; - } - - if (config->enableChopOscillator) - { - tmp32 |= (VREF_CSR_REGEN_MASK | VREF_CSR_CHOPEN_MASK); - } - - if (config->enableCurvatureCompensation) - { - tmp32 |= VREF_CSR_ICOMPEN_MASK; - } - - if (config->bufferMode == kVREF_ModeLowPowerBuffer) - { - tmp32 |= VREF_CSR_BUF21EN_MASK; - } - else - { - tmp32 |= (VREF_CSR_BUF21EN_MASK | VREF_CSR_HI_PWR_LV_MASK); - } - - base->CSR |= tmp32; - /* After enabling high accurancy bandgap, delay 400 us. */ - SDK_DelayAtLeastUs(400U, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY); - } -} - -/*! - * brief Stops and disables the clock for the VREF module. - * - * This function should be called to shut down the module. - * This is an example. - * code - * vref_config_t vrefUserConfig; - * VREF_GetDefaultConfig(VREF, &vrefUserConfig); - * VREF_Init(VREF, &vrefUserConfig); - * ... - * VREF_Deinit(VREF); - * endcode - * - * param base VREF peripheral address. - */ -void VREF_Deinit(VREF_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Gate clock for VREF */ - CLOCK_DisableClock(s_vrefClocks[VREF_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Initializes the VREF configuration structure. - * - * This function initializes the VREF configuration structure to default values. - * This is an example. - * code - * config->bufferMode = kVREF_ModeHighPowerBuffer; - * config->enableInternalVoltageRegulator = true; - * config->enableChopOscillator = true; - * config->enableHCBandgap = true; - * config->enableCurvatureCompensation = true; - * config->enableLowPowerBuff = true; - * endcode - * - * param config Pointer to the initialization structure. - */ -void VREF_GetDefaultConfig(vref_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - config->bufferMode = kVREF_ModeHighPowerBuffer; - config->enableInternalVoltageRegulator = true; - config->enableChopOscillator = true; - config->enableHCBandgap = true; - config->enableCurvatureCompensation = true; - config->enableLowPowerBuff = true; -} - -/*! - * brief Sets a TRIM value for the accurate 1.0V bandgap output. - * - * This function sets a TRIM value for the reference voltage. It will trim the accurate 1.0V bandgap by 0.5mV each step. - * - * param base VREF peripheral address. - * param trimValue Value of the trim register to set the output reference voltage (maximum 0x3F (6-bit)). - */ -void VREF_SetVrefTrimVal(VREF_Type *base, uint8_t trimValue) -{ - uint32_t tmp32 = base->UTRIM; - - tmp32 &= (~VREF_UTRIM_VREFTRIM_MASK); - tmp32 |= VREF_UTRIM_VREFTRIM(trimValue); - - base->UTRIM = tmp32; - - if (VREF_CSR_CHOPEN_MASK == (base->CSR & VREF_CSR_CHOPEN_MASK)) - { - /* After enabling high accurancy bandgap, delay 400 us. */ - SDK_DelayAtLeastUs(400U, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY); - } - else - { - /*Wait internal HC voltage reference stable*/ - /* - * $Branch Coverage Justification$ - * while ((base->CSR & VREF_CSR_VREFST_MASK) != 0U) not covered. Test unfeasible, - * the internal HC voltage stable state is too short not to catch. - */ - while ((base->CSR & VREF_CSR_VREFST_MASK) == 0U) - { - } - } -} - -/*! - * brief Sets a TRIM value for the accurate buffered VREF output. - * - * This function sets a TRIM value for the reference voltage. If buffer mode be set to other values (Buf21 - * enabled), it will trim the VREF_OUT by 0.1V each step from 1.0V to 2.1V. - * - * note When Buf21 is enabled, the value of UTRIM[TRIM2V1] should be ranged from 0b0000 to 0b1011 in order to trim the - * output voltage from 1.0V to 2.1V, other values will make the VREF_OUT to default value, 1.0V. - * - * param base VREF peripheral address. - * param trim21Value Value of the trim register to set the output reference voltage (maximum 0xF (4-bit)). - */ -void VREF_SetTrim21Val(VREF_Type *base, uint8_t trim21Value) -{ - uint32_t tmp32 = base->UTRIM; - - tmp32 &= (~VREF_UTRIM_TRIM2V1_MASK); - tmp32 |= VREF_UTRIM_TRIM2V1(trim21Value); - - base->UTRIM = tmp32; - - if (VREF_CSR_CHOPEN_MASK == (base->CSR & VREF_CSR_CHOPEN_MASK)) - { - /* After enabling high accurancy bandgap, delay 400 us. */ - SDK_DelayAtLeastUs(400U, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY); - } - else - { - /*Wait internal HC voltage reference stable*/ - /* - * $Branch Coverage Justification$ - * while ((base->CSR & VREF_CSR_VREFST_MASK) != 0U) not covered. Test unfeasible, - * the internal HC voltage stable state is too short not to catch. - */ - while ((base->CSR & VREF_CSR_VREFST_MASK) == 0U) - { - } - } -} - -/*! - * brief Reads the VREF trim value. - * - * This function gets the TRIM value from the UTRIM register. It reads UTRIM[VREFTRIM] (13:8) - * - * param base VREF peripheral address. - * return 6-bit value of trim setting. - */ -uint8_t VREF_GetVrefTrimVal(VREF_Type *base) -{ - uint8_t trimValue; - - trimValue = (uint8_t)((base->UTRIM & VREF_UTRIM_VREFTRIM_MASK) >> VREF_UTRIM_VREFTRIM_SHIFT); - - return trimValue; -} - -/*! - * brief Reads the VREF 2.1V trim value. - * - * This function gets the TRIM value from the UTRIM register. It reads UTRIM[TRIM2V1] (3:0), - * - * param base VREF peripheral address. - * return 4-bit value of trim setting. - */ -uint8_t VREF_GetTrim21Val(VREF_Type *base) -{ - uint8_t trimValue; - - trimValue = (uint8_t)((base->UTRIM & VREF_UTRIM_TRIM2V1_MASK) >> VREF_UTRIM_TRIM2V1_SHIFT); - - return trimValue; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_vref.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_vref.h deleted file mode 100644 index 4c248df98c3..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_vref.h +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright 2019-2023 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_VREF_H_ -#define FSL_VREF_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup vref - * @{ - */ - -/****************************************************************************** - * Definitions - ******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -#define FSL_VREF_DRIVER_VERSION (MAKE_VERSION(2, 2, 2)) /*!< Version 2.2.2. */ -/*! @} */ - -/*! @brief VREF buffer modes. */ -typedef enum _vref_buffer_mode -{ - kVREF_ModeBandgapOnly = 0U, /*!< Bandgap enabled/standby. */ - kVREF_ModeLowPowerBuffer = 1U, /*!< Low-power buffer mode enabled */ - kVREF_ModeHighPowerBuffer = 2U, /*!< High-power buffer mode enabled */ -} vref_buffer_mode_t; - -/*! @brief The description structure for the VREF module. */ -typedef struct _vref_config -{ - vref_buffer_mode_t bufferMode; /*!< Buffer mode selection */ - bool enableInternalVoltageRegulator; /*!< Provide additional supply noise rejection. */ - bool enableChopOscillator; /*!< Enable Chop oscillator.*/ - bool enableHCBandgap; /*!< Enable High-Accurate bandgap.*/ - bool enableCurvatureCompensation; /*!< Enable second order curvature compensation. */ - bool enableLowPowerBuff; /*!< Provides bias current for other peripherals.*/ - -} vref_config_t; - -/****************************************************************************** - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name Initialization and deinitialization - * @{ - */ - -/*! - * @brief Enables the clock gate and configures the VREF module according to the configuration structure. - * - * This function must be called before calling all other VREF driver functions, read/write registers, and - * configurations with user-defined settings. The example below shows how to set up vref_config_t parameters - * and how to call the VREF_Init function by passing in these parameters. - * @code - * vref_config_t vrefConfig; - * VREF_GetDefaultConfig(VREF, &vrefConfig); - * vrefConfig.bufferMode = kVREF_ModeHighPowerBuffer; - * VREF_Init(VREF, &vrefConfig); - * @endcode - * - * @param base VREF peripheral address. - * @param config Pointer to the configuration structure. - */ -void VREF_Init(VREF_Type *base, const vref_config_t *config); - -/*! - * @brief Stops and disables the clock for the VREF module. - * - * This function should be called to shut down the module. - * This is an example. - * @code - * vref_config_t vrefUserConfig; - * VREF_GetDefaultConfig(VREF, &vrefUserConfig); - * VREF_Init(VREF, &vrefUserConfig); - * ... - * VREF_Deinit(VREF); - * @endcode - * - * @param base VREF peripheral address. - */ -void VREF_Deinit(VREF_Type *base); - -/*! - * @brief Initializes the VREF configuration structure. - * - * This function initializes the VREF configuration structure to default values. - * This is an example. - * @code - * config->bufferMode = kVREF_ModeHighPowerBuffer; - * config->enableInternalVoltageRegulator = true; - * config->enableChopOscillator = true; - * config->enableHCBandgap = true; - * config->enableCurvatureCompensation = true; - * config->enableLowPowerBuff = true; - * @endcode - * - * @param config Pointer to the initialization structure. - */ -void VREF_GetDefaultConfig(vref_config_t *config); - -/*! @} */ - -/*! - * @name Trim functions - * @{ - */ - -/*! - * @brief Sets a TRIM value for the accurate 1.0V bandgap output. - * - * This function sets a TRIM value for the reference voltage. It will trim the accurate 1.0V bandgap by 0.5mV each step. - * - * @param base VREF peripheral address. - * @param trimValue Value of the trim register to set the output reference voltage (maximum 0x3F (6-bit)). - */ -void VREF_SetVrefTrimVal(VREF_Type *base, uint8_t trimValue); - -/*! - * @brief Sets a TRIM value for the accurate buffered VREF output. - * - * This function sets a TRIM value for the reference voltage. If buffer mode be set to other values (Buf21 - * enabled), it will trim the VREF_OUT by 0.1V each step from 1.0V to 2.1V. - * - * @note When Buf21 is enabled, the value of UTRIM[TRIM2V1] should be ranged from 0b0000 to 0b1011 in order to trim the - * output voltage from 1.0V to 2.1V, other values will make the VREF_OUT to default value, 1.0V. - * - * @param base VREF peripheral address. - * @param trim21Value Value of the trim register to set the output reference voltage (maximum 0xF (4-bit)). - */ -void VREF_SetTrim21Val(VREF_Type *base, uint8_t trim21Value); - -/*! - * @brief Reads the trim value. - * - * This function gets the TRIM value from the UTRIM register. It reads UTRIM[VREFTRIM] (13:8) - * - * @param base VREF peripheral address. - * @return 6-bit value of trim setting. - */ -uint8_t VREF_GetVrefTrimVal(VREF_Type *base); - -/*! - * @brief Reads the VREF 2.1V trim value. - * - * This function gets the TRIM value from the UTRIM register. It reads UTRIM[TRIM2V1] (3:0), - * - * @param base VREF peripheral address. - * @return 4-bit value of trim setting. - */ -uint8_t VREF_GetTrim21Val(VREF_Type *base); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @}*/ - -#endif /* FSL_VREF_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_wuu.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_wuu.c deleted file mode 100644 index 214e7c07f08..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_wuu.c +++ /dev/null @@ -1,312 +0,0 @@ -/* - * Copyright 2019-2024 NXP. - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_wuu.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.wuu" -#endif - -#define WUU_PE_REG_BIT_FIELD_MASK 0x03UL -#define WUU_PDC_REG_BIT_FIELD_MASK 0x03UL -#define WUU_PMC_REG_BIT_FIELD_MASK 0x01UL - -#define WUU_ME_REG_WUME_FIELD_MASK 0x01UL -#define WUU_DE_REG_WUME_FIELD_MASK 0x01UL - -#define WUU_FILT_REG_FILTE_FIELD_MASK 0x60U -#define WUU_FILT_REG_FILTSET_FIELD_MASK 0x1FU -#define WUU_FDC_REG_FILTC_FIELD_MASK 0x3U -#define WUU_FMC_REG_FILTM_FIELD_MASK 0x1U - -#define WUU_FILT_REG_FILTSET_FIELD(x) (((uint32_t)(x) << 5UL) & WUU_FILT_REG_FILTE_FIELD_MASK) -#define WUU_CLEAR_BIT_FIELD_IN_REG(mask, offset) (~((uint32_t)(mask) << (offset))) -#define WUU_SET_BIT_FIELD_IN_REG(val, offset) ((uint32_t)(val) << (offset)) -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Enables and Configs External WakeUp Pins. - * - * This function enables/disables the external pin as wakeup input. What's more this - * function configs pins options, including edge detection wakeup event and operate mode. - * - * param base MUU peripheral base address. - * param pinIndex The index of the external input pin. See Reference Manual for the details. - * param config Pointer to wuu_external_wakeup_pin_config_t structure. - */ -void WUU_SetExternalWakeUpPinsConfig(WUU_Type *base, uint8_t pinIndex, const wuu_external_wakeup_pin_config_t *config) -{ - assert(config != NULL); - - volatile uint32_t *edgeRegBase = NULL; - volatile uint32_t *eventRegBase = NULL; - uint32_t edgeReg; - uint32_t eventReg; - uint32_t modeReg; - uint8_t offset; - - /* Calculate offset. */ - offset = 2U * (pinIndex & 0xFU); - - if (config->edge != kWUU_ExternalPinDisable) - { - /* Based on pin index, get register base address. */ - if ((pinIndex >> 4U) != 0U) - { - edgeRegBase = &base->PE2; - eventRegBase = &base->PDC2; - } - else - { - edgeRegBase = &base->PE1; - eventRegBase = &base->PDC1; - } - - /* Enable and config the edge detection. */ - edgeReg = *edgeRegBase; - edgeReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_PE_REG_BIT_FIELD_MASK, offset); - edgeReg |= WUU_SET_BIT_FIELD_IN_REG(config->edge, offset); - *edgeRegBase = edgeReg; - - /* Config the wakeup event. */ - eventReg = *eventRegBase; - eventReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_PDC_REG_BIT_FIELD_MASK, offset); - eventReg |= WUU_SET_BIT_FIELD_IN_REG(config->event, offset); - *eventRegBase = eventReg; - - /* Config operate mode. */ - modeReg = base->PMC; - modeReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_PMC_REG_BIT_FIELD_MASK, pinIndex); - modeReg |= WUU_SET_BIT_FIELD_IN_REG(config->mode, pinIndex); - - base->PMC = modeReg; - } - else - { - /* Based on pin index, get register base address. */ - if ((pinIndex >> 4U) != 0U) - { - edgeRegBase = &base->PE2; - } - else - { - edgeRegBase = &base->PE1; - } - - edgeReg = *edgeRegBase; - edgeReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_PE_REG_BIT_FIELD_MASK, offset); - *edgeRegBase = edgeReg; - } -} - -/*! - * brief Disable and clear external wakeup pin settings. - * - * param base MUU peripheral base address. - * param pinIndex The index of the external input pin. - */ -void WUU_ClearExternalWakeupPinsConfig(WUU_Type *base, uint8_t pinIndex) -{ - if (pinIndex <= 15U) - { - base->PE1 &= ~(WUU_PE_REG_BIT_FIELD_MASK << (2UL * (uint32_t)pinIndex)); - base->PDC1 &= ~(WUU_PDC_REG_BIT_FIELD_MASK << (2UL * (uint32_t)pinIndex)); - } - else - { - base->PE1 &= ~(WUU_PE_REG_BIT_FIELD_MASK << (2UL * (uint32_t)((uint32_t)pinIndex % 16UL))); - base->PDC1 &= ~(WUU_PDC_REG_BIT_FIELD_MASK << (2UL * (uint32_t)((uint32_t)pinIndex % 16UL))); - } -} - -/*! - * brief Config Internal modules' event as the wake up soures. - * - * This function configs the internal modules event as the wake up sources. - * - * param base WUU peripheral base address. - * param moduleIndex The selected internal module. See the Reference Manual for the details. - * param event Select interrupt or DMA/Trigger of the internal module as the wake up source. - */ -void WUU_SetInternalWakeUpModulesConfig(WUU_Type *base, uint8_t moduleIndex, wuu_internal_wakeup_module_event_t event) -{ - switch (event) - { - case kWUU_InternalModuleInterrupt: - base->ME |= WUU_SET_BIT_FIELD_IN_REG(WUU_ME_REG_WUME_FIELD_MASK, moduleIndex); - break; - case kWUU_InternalModuleDMATrigger: - base->DE |= WUU_SET_BIT_FIELD_IN_REG(WUU_DE_REG_WUME_FIELD_MASK, moduleIndex); - break; - default: - assert(false); - break; - } -} - -/*! - * brief Disable an on-chip internal modules' event as the wakeup sources. - * - * param base WUU peripheral base address. - * param moduleIndex The selected internal module. See the Reference Manual for the details. - * param event The event(interrupt or DMA/trigger) of the internal module to disable. - */ -void WUU_ClearInternalWakeUpModulesConfig(WUU_Type *base, uint8_t moduleIndex, wuu_internal_wakeup_module_event_t event) -{ - switch(event) - { - case kWUU_InternalModuleInterrupt: - base->ME &= ~WUU_SET_BIT_FIELD_IN_REG(WUU_ME_REG_WUME_FIELD_MASK, moduleIndex); - break; - case kWUU_InternalModuleDMATrigger: - base->DE &= ~WUU_SET_BIT_FIELD_IN_REG(WUU_DE_REG_WUME_FIELD_MASK, moduleIndex); - break; - default: - assert(false); - break; - } -} - -/*! - * brief Configs and Enables Pin filters. - * - * This function configs Pin filter, including pin select, filer operate mode - * filer wakeup event and filter edge detection. - * - * param base WUU peripheral base address. - * param filterIndex The index of the pin filer. - * param config Pointer to wuu_pin_filter_config_t structure. - */ -void WUU_SetPinFilterConfig(WUU_Type *base, uint8_t filterIndex, const wuu_pin_filter_config_t *config) -{ - assert(config != NULL); - - uint8_t shift; - uint32_t filterReg; - uint32_t eventReg; - uint32_t modeReg; - - shift = (filterIndex - 1U) * 8U; - filterReg = base->FILT; - filterReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_FILT_REG_FILTE_FIELD_MASK, shift); - filterReg |= WUU_SET_BIT_FIELD_IN_REG(WUU_FILT_REG_FILTSET_FIELD(config->edge), shift); - - if (config->edge != kWUU_FilterDisabled) - { - filterReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_FILT_REG_FILTSET_FIELD_MASK, shift); - filterReg |= WUU_SET_BIT_FIELD_IN_REG(config->pinIndex, shift); - - /* Config wake up event. */ - shift = (filterIndex - 1U) * 2U; - eventReg = base->FDC; - eventReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_FDC_REG_FILTC_FIELD_MASK, shift); - eventReg |= WUU_SET_BIT_FIELD_IN_REG(config->event, shift); - base->FDC = eventReg; - - /* Config operate mode. */ - shift = (filterIndex - 1U) * 1U; - modeReg = base->FMC; - modeReg &= WUU_CLEAR_BIT_FIELD_IN_REG(WUU_FMC_REG_FILTM_FIELD_MASK, shift); - modeReg |= WUU_SET_BIT_FIELD_IN_REG(config->mode, shift); - base->FMC = modeReg; - } - - base->FILT = filterReg; -} - -/*! - * brief Gets the pin filter configuration. - * - * This function gets the pin filter flag. - * - * param base WUU peripheral base address. - * param filterIndex A pin filter index, which starts from 1. - * return True if the flag is a source of the existing low-leakage power mode. - */ -bool WUU_GetPinFilterFlag(WUU_Type *base, uint8_t filterIndex) -{ - bool ret = false; - - switch (filterIndex) - { - case 1: - ret = ((base->FILT & WUU_FILT_FILTF1_MASK) != 0U); - break; - case 2: - ret = ((base->FILT & WUU_FILT_FILTF2_MASK) != 0U); - break; - default: - ret = false; - break; - } - - return ret; -} - -/*! - * brief Clears the pin filter configuration. - * - * This function clears the pin filter flag. - * - * param base WUU peripheral base address. - * param filterIndex A pin filter index to clear the flag, starting from 1. - */ -void WUU_ClearPinFilterFlag(WUU_Type *base, uint8_t filterIndex) -{ - uint32_t reg; - - reg = base->FILT; - /* Clean the W1C bits, in case the flags are cleared by mistake. */ - reg &= ~(WUU_FILT_FILTF1_MASK | WUU_FILT_FILTF2_MASK); - - reg |= WUU_SET_BIT_FIELD_IN_REG(WUU_FILT_FILTF1_MASK, ((filterIndex - 1U) * 8U)); - - base->FILT = reg; -} - -/*! - * brief Gets the external wakeup source flag. - * - * This function checks the external pin flag to detect whether the MCU is - * woken up by the specific pin. - * - * param base WUU peripheral base address. - * param pinIndex A pin index, which starts from 0. - * return True if the specific pin is a wakeup source. - */ -bool WUU_GetExternalWakeupPinFlag(WUU_Type *base, uint32_t pinIndex) -{ - return (0U != (base->PF & (1UL << pinIndex))); -} - -/*! - * brief Clears the external wakeup source flag. - * - * This function clears the external wakeup source flag for a specific pin. - * - * param base WUU peripheral base address. - * param pinIndex A pin index, which starts from 0. - */ -void WUU_ClearExternalWakeupPinFlag(WUU_Type *base, uint32_t pinIndex) -{ - base->PF = (1UL << pinIndex); -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_wuu.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_wuu.h deleted file mode 100644 index bedfde56859..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_wuu.h +++ /dev/null @@ -1,294 +0,0 @@ -/* - * Copyright 2019-2024 NXP. - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_WUU_H_ -#define FSL_WUU_H_ - -#include "fsl_common.h" - -/*! @addtogroup wuu */ -/*! @{ */ - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief Defines WUU driver version 2.4.0. */ -#define FSL_WUU_DRIVER_VERSION (MAKE_VERSION(2, 4, 0)) -/*! @} */ - -/*! - * @brief External WakeUp pin edge detection enumeration. - */ -typedef enum _wuu_external_pin_edge_detection -{ - kWUU_ExternalPinDisable = 0x0U, /*!< External input Pin disabled as wake up input. */ - kWUU_ExternalPinRisingEdge = 0x1U, /*!< External input Pin enabled with the rising edge detection. */ - kWUU_ExternalPinFallingEdge = 0x2U, /*!< External input Pin enabled with the falling edge detection. */ - kWUU_ExternalPinAnyEdge = 0x3U, /*!< External input Pin enabled with any change detection. */ -} wuu_external_pin_edge_detection_t; - -/*! - * @brief External input wake up pin event enumeration. - */ -typedef enum _wuu_external_wakeup_pin_event -{ - kWUU_ExternalPinInterrupt = 0x0U, /*!< External input Pin configured as interrupt. */ - kWUU_ExternalPinDMARequest = 0x1U, /*!< External input Pin configured as DMA request. */ - kWUU_ExternalPinTriggerEvent = 0x2U, /*!< External input Pin configured as Trigger event. */ -} wuu_external_wakeup_pin_event_t; - -/*! - * @brief External input wake up pin mode enumeration. - */ -typedef enum _wuu_external_wakeup_pin_mode -{ - kWUU_ExternalPinActiveDSPD = 0x0U, /*!< External input Pin is active only during Deep Sleep/Power Down Mode. */ - kWUU_ExternalPinActiveAlways = 0x1U, /*!< External input Pin is active during all power modes. */ -} wuu_external_wakeup_pin_mode_t; - -/*! - * @brief Internal module wake up event enumeration. - */ -typedef enum _wuu_internal_wakeup_module_event -{ - kWUU_InternalModuleInterrupt = 0x0U, /*!< Internal modules' interrupt as a wakeup source. */ - kWUU_InternalModuleDMATrigger = 0x1U, /*!< Internal modules' DMA/Trigger as a wakeup source. */ -} wuu_internal_wakeup_module_event_t; - -/*! - * @brief Pin filter edge enumeration. - */ -typedef enum _wuu_filter_edge -{ - kWUU_FilterDisabled = 0x0U, /*!< Filter disabled. */ - kWUU_FilterPosedgeEnable = 0x1U, /*!< Filter posedge detect enabled. */ - kWUU_FilterNegedgeEnable = 0x2U, /*!< Filter negedge detect enabled. */ - kWUU_FilterAnyEdge = 0x3U, /*!< Filter any edge detect enabled. */ -} wuu_filter_edge_t; - -/*! - * @brief Pin Filter event enumeration. - */ -typedef enum _wuu_filter_event -{ - kWUU_FilterInterrupt = 0x0U, /*!< Filter output configured as interrupt. */ - kWUU_FilterDMARequest = 0x1U, /*!< Filter output configured as DMA request. */ - kWUU_FilterTriggerEvent = 0x2U, /*!< Filter output configured as Trigger event. */ -} wuu_filter_event_t; - -/*! - * @brief Pin filter mode enumeration. - */ -typedef enum _wuu_filter_mode -{ - kWUU_FilterActiveDSPD = 0x0U, /*!< External input pin filter is active only during Deep Sleep/Power Down Mode. */ - kWUU_FilterActiveAlways = 0x1U, /*!< External input Pin filter is active during all power modes. */ -} wuu_filter_mode_t; - -/*! - * @brief External WakeUp pin configuration - */ -typedef struct _wuu_external_wakeup_pin_config -{ - wuu_external_pin_edge_detection_t edge; /*!< External Input pin edge detection. */ - wuu_external_wakeup_pin_event_t event; /*!< External Input wakeup Pin event */ - wuu_external_wakeup_pin_mode_t mode; /*!< External Input wakeup Pin operate mode. */ -} wuu_external_wakeup_pin_config_t; - -/*! - * @brief Pin Filter configuration. - */ -typedef struct _wuu_pin_filter_config -{ - uint32_t pinIndex; /*!< The index of wakeup pin to be muxxed into filter. */ - wuu_filter_edge_t edge; /*!< The edge of the pin digital filter. */ - wuu_filter_event_t event; /*!< The event of the filter output. */ - wuu_filter_mode_t mode; /*!< The mode of the filter operate. */ -} wuu_pin_filter_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name External Wake up Pins Control APIs. - * @{ - */ -/*! - * @brief Enables and Configs External WakeUp Pins. - * - * This function enables/disables the external pin as wakeup input. What's more this - * function configs pins options, including edge detection wakeup event and operate mode. - * - * @param base MUU peripheral base address. - * @param pinIndex The index of the external input pin. See Reference Manual for the details. - * @param config Pointer to wuu_external_wakeup_pin_config_t structure. - */ -void WUU_SetExternalWakeUpPinsConfig(WUU_Type *base, uint8_t pinIndex, const wuu_external_wakeup_pin_config_t *config); - -/*! - * @brief Disable and clear external wakeup pin settings. - * - * @param base MUU peripheral base address. - * @param pinIndex The index of the external input pin. - */ -void WUU_ClearExternalWakeupPinsConfig(WUU_Type *base, uint8_t pinIndex); - -/*! - * @brief Gets External Wakeup pin flags. - * - * This function return the external wakeup pin flags. - * - * @param base WUU peripheral base address. - * @return Wakeup flags for all external wakeup pins. - */ -static inline uint32_t WUU_GetExternalWakeUpPinsFlag(WUU_Type *base) -{ - return base->PF; -} - -/*! - * @brief Clears External WakeUp Pin flags. - * - * This function clears external wakeup pins flags based on the mask. - * - * @param base WUU peripheral base address. - * @param mask The mask of Wakeup pin index to be cleared. - */ -static inline void WUU_ClearExternalWakeUpPinsFlag(WUU_Type *base, uint32_t mask) -{ - base->PF = mask; -} -/*! @} */ - -/*! - * @name Internal Wakeup Module control APIs. - * @{ - */ - -/*! - * @brief Config Internal modules' event as the wake up soures. - * - * This function configs the internal modules event as the wake up sources. - * - * @param base WUU peripheral base address. - * @param moduleIndex The selected internal module. See the Reference Manual for the details. - * @param event Select interrupt or DMA/Trigger of the internal module as the wake up source. - */ -void WUU_SetInternalWakeUpModulesConfig(WUU_Type *base, uint8_t moduleIndex, wuu_internal_wakeup_module_event_t event); - -/*! - * @brief Disable an on-chip internal modules' event as the wakeup sources. - * - * @param base WUU peripheral base address. - * @param moduleIndex The selected internal module. See the Reference Manual for the details. - * @param event The event(interrupt or DMA/trigger) of the internal module to disable. - */ -void WUU_ClearInternalWakeUpModulesConfig(WUU_Type *base, uint8_t moduleIndex, wuu_internal_wakeup_module_event_t event); - -#if (defined(FSL_FEATURE_WUU_HAS_MF) && FSL_FEATURE_WUU_HAS_MF) -/*! - * @brief Get wakeup flags for internal wakeup modules. - * - * @param base WUU peripheral base address. - * @return Wakeup flags for all internal wakeup modules. - */ -static inline uint32_t WUU_GetModuleInterruptFlag(WUU_Type *base) -{ - return base->MF; -} - -/*! - * @brief Gets the internal module wakeup source flag. - * - * This function checks the flag to detect whether the system is - * woken up by specific on-chip module interrupt. - * - * @param base WWU peripheral base address. - * @param moduleIndex A module index, which starts from 0. - * @return True if the specific pin is a wake up source. - */ -static inline bool WUU_GetInternalWakeupModuleFlag(WUU_Type *base, uint32_t moduleIndex) -{ - return ((1UL << moduleIndex) == (WUU_GetModuleInterruptFlag(base) & (1UL << moduleIndex))); -} -#endif /* FSL_FEATURE_WUU_HAS_MF */ - -/*! @} */ - -/*! - * @name Pin Filter Control APIs - * @{ - */ -/*! - * @brief Configs and Enables Pin filters. - * - * This function configs Pin filter, including pin select, filer operate mode - * filer wakeup event and filter edge detection. - * - * @param base WUU peripheral base address. - * @param filterIndex The index of the pin filer. - * @param config Pointer to wuu_pin_filter_config_t structure. - */ -void WUU_SetPinFilterConfig(WUU_Type *base, uint8_t filterIndex, const wuu_pin_filter_config_t *config); - -/*! - * @brief Gets the pin filter configuration. - * - * This function gets the pin filter flag. - * - * @param base WUU peripheral base address. - * @param filterIndex A pin filter index, which starts from 1. - * @return True if the flag is a source of the existing low-leakage power mode. - */ -bool WUU_GetPinFilterFlag(WUU_Type *base, uint8_t filterIndex); - -/*! - * @brief Clears the pin filter configuration. - * - * This function clears the pin filter flag. - * - * @param base WUU peripheral base address. - * @param filterIndex A pin filter index to clear the flag, starting from 1. - */ -void WUU_ClearPinFilterFlag(WUU_Type *base, uint8_t filterIndex); - -/*! - * brief Gets the external wakeup source flag. - * - * This function checks the external pin flag to detect whether the MCU is - * woken up by the specific pin. - * - * param base WUU peripheral base address. - * param pinIndex A pin index, which starts from 0. - * return True if the specific pin is a wakeup source. - */ -bool WUU_GetExternalWakeupPinFlag(WUU_Type *base, uint32_t pinIndex); - -/*! - * brief Clears the external wakeup source flag. - * - * This function clears the external wakeup source flag for a specific pin. - * - * param base WUU peripheral base address. - * param pinIndex A pin index, which starts from 0. - */ -void WUU_ClearExternalWakeupPinFlag(WUU_Type *base, uint32_t pinIndex); -/*! @} */ - -#if defined(__cplusplus) -} -#endif - -/*! @} */ - -#endif /*FSL_WUU_H_*/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_wwdt.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_wwdt.c deleted file mode 100644 index 6680148acf7..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_wwdt.c +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "fsl_wwdt.h" - -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.wwdt" -#endif - -#define FREQUENCY_3MHZ (3000000U) -/******************************************************************************* - * Prototypes - ******************************************************************************/ - -/*! - * @brief Gets the instance from the base address - * - * @param base WWDT peripheral base address - * - * @return The WWDT instance - */ -static uint32_t WWDT_GetInstance(WWDT_Type *base); - -/******************************************************************************* - * Variables - ******************************************************************************/ -/*! @brief Pointers to WWDT bases for each instance. */ -static WWDT_Type *const s_wwdtBases[] = WWDT_BASE_PTRS; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) -/*! @brief Pointers to WWDT clocks for each instance. */ -static const clock_ip_name_t s_wwdtClocks[] = WWDT_CLOCKS; -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) -#if !(defined(FSL_FEATURE_WWDT_HAS_NO_RESET) && FSL_FEATURE_WWDT_HAS_NO_RESET) -/*! @brief Pointers to WWDT resets for each instance. */ -static const reset_ip_name_t s_wwdtResets[] = WWDT_RSTS; -#endif -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ - -/******************************************************************************* - * Code - ******************************************************************************/ -static uint32_t WWDT_GetInstance(WWDT_Type *base) -{ - uint32_t instance; - uint32_t wwdtArrayCount = (sizeof(s_wwdtBases) / sizeof(s_wwdtBases[0])); - - /* Find the instance index from base address mappings. */ - for (instance = 0; instance < wwdtArrayCount; instance++) - { - if (s_wwdtBases[instance] == base) - { - break; - } - } - - assert(instance < wwdtArrayCount); - - return instance; -} - -/******************************************************************************* - * Code - ******************************************************************************/ - -/*! - * brief Initializes WWDT configure structure. - * - * This function initializes the WWDT configure structure to default value. The default - * value are: - * code - * config->enableWwdt = true; - * config->enableWatchdogReset = false; - * config->enableWatchdogProtect = false; - * config->enableLockOscillator = false; - * config->windowValue = 0xFFFFFFU; - * config->timeoutValue = 0xFFFFFFU; - * config->warningValue = 0; - * endcode - * - * param config Pointer to WWDT config structure. - * see wwdt_config_t - */ -void WWDT_GetDefaultConfig(wwdt_config_t *config) -{ - assert(NULL != config); - - /* Initializes the configure structure to zero. */ - (void)memset(config, 0, sizeof(*config)); - - /* Enable the watch dog */ - config->enableWwdt = true; - /* Disable the watchdog timeout reset */ - config->enableWatchdogReset = false; - /* Disable the watchdog protection for updating the timeout value */ - config->enableWatchdogProtect = false; -#if !(defined(FSL_FEATURE_WWDT_HAS_NO_OSCILLATOR_LOCK) && FSL_FEATURE_WWDT_HAS_NO_OSCILLATOR_LOCK) - /* Do not lock the watchdog oscillator */ - config->enableLockOscillator = false; -#endif - /* Windowing is not in effect */ - config->windowValue = 0xFFFFFFU; - /* Set the timeout value to the max */ - config->timeoutValue = 0xFFFFFFU; - /* No warning is provided */ - config->warningValue = 0; - /* Set clock frequency. */ - config->clockFreq_Hz = 0U; -} - -/*! - * brief Initializes the WWDT. - * - * This function initializes the WWDT. When called, the WWDT runs according to the configuration. - * - * Example: - * code - * wwdt_config_t config; - * WWDT_GetDefaultConfig(&config); - * config.timeoutValue = 0x7ffU; - * WWDT_Init(wwdt_base,&config); - * endcode - * - * param base WWDT peripheral base address - * param config The configuration of WWDT - */ -void WWDT_Init(WWDT_Type *base, const wwdt_config_t *config) -{ - assert(NULL != config); - - uint32_t value = 0U; - uint32_t DelayUs = 0U; - uint32_t primaskValue = 0U; - -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Enable the WWDT clock */ - CLOCK_EnableClock(s_wwdtClocks[WWDT_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ - -#if !(defined(FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) && FSL_SDK_DISABLE_DRIVER_RESET_CONTROL) -#if !(defined(FSL_FEATURE_WWDT_HAS_NO_RESET) && FSL_FEATURE_WWDT_HAS_NO_RESET) - /* Reset the module. */ - RESET_PeripheralReset(s_wwdtResets[WWDT_GetInstance(base)]); -#endif - -#if defined(FSL_FEATURE_WWDT_WDTRESET_FROM_PMC) && (FSL_FEATURE_WWDT_WDTRESET_FROM_PMC) - /* PMC RESETCAUSE: set bit to clear it by write 1. */ - PMC->RESETCAUSE = PMC_RESETCAUSE_WDTRESET_MASK; - /* Enable the watchdog reset event to affect the system in the Power Management Controller */ - PMC->CTRL |= PMC_CTRL_WDTRESETENABLE_MASK; -#endif /*FSL_FEATURE_WWDT_WDTRESET_FROM_PMC*/ - -#endif /* FSL_SDK_DISABLE_DRIVER_RESET_CONTROL */ - -#if !(defined(FSL_FEATURE_WWDT_HAS_NO_OSCILLATOR_LOCK) && FSL_FEATURE_WWDT_HAS_NO_OSCILLATOR_LOCK) - value = WWDT_MOD_WDEN(config->enableWwdt) | WWDT_MOD_WDRESET(config->enableWatchdogReset) | - WWDT_MOD_LOCK(config->enableLockOscillator); -#else - value = WWDT_MOD_WDEN(config->enableWwdt) | WWDT_MOD_WDRESET(config->enableWatchdogReset); -#endif - /* Clear legacy flag in the MOD register by software writing a "1" to this bit field.. */ - if (0U != (base->MOD & WWDT_MOD_WDINT_MASK)) - { - value |= WWDT_MOD_WDINT_MASK; - } - /* Set configuration */ - primaskValue = DisableGlobalIRQ(); - base->TC = WWDT_TC_COUNT(config->timeoutValue); - base->MOD = value; - base->WINDOW = WWDT_WINDOW_WINDOW(config->windowValue); - base->WARNINT = WWDT_WARNINT_WARNINT(config->warningValue); - /* Refreshes the WWDT timer. */ - base->FEED = WWDT_FIRST_WORD_OF_REFRESH; - base->FEED = WWDT_SECOND_WORD_OF_REFRESH; - EnableGlobalIRQ(primaskValue); - /* Read counter value to wait wwdt timer start*/ - if (config->enableWwdt) - { - while (base->TV == 0xFFUL) - { - } - } - - /* This WDPROTECT bit can be set once by software and is only cleared by a reset */ - if (config->enableWatchdogProtect && (0U == (base->MOD & WWDT_MOD_WDPROTECT_MASK))) - { - /* The config->clockFreq_Hz must be set in order to config the delay time. */ - assert(0U != config->clockFreq_Hz); - - /* Set the WDPROTECT bit after the Feed Sequence (0xAA, 0x55) with 3 WDCLK delay */ - DelayUs = FREQUENCY_3MHZ / config->clockFreq_Hz + 1U; - SDK_DelayAtLeastUs(DelayUs, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY); - - base->MOD |= WWDT_MOD_WDPROTECT(1U); - } -} - -/*! - * brief Shuts down the WWDT. - * - * This function shuts down the WWDT. - * - * param base WWDT peripheral base address - */ -void WWDT_Deinit(WWDT_Type *base) -{ -#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) - /* Disable the WWDT clock */ - CLOCK_DisableClock(s_wwdtClocks[WWDT_GetInstance(base)]); -#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */ -} - -/*! - * brief Refreshes the WWDT timer. - * - * This function feeds the WWDT. - * This function should be called before WWDT timer is in timeout. Otherwise, a reset is asserted. - * - * param base WWDT peripheral base address - */ -void WWDT_Refresh(WWDT_Type *base) -{ - uint32_t primaskValue = 0U; - - /* Disable the global interrupt to protect refresh sequence */ - primaskValue = DisableGlobalIRQ(); - base->FEED = WWDT_FIRST_WORD_OF_REFRESH; - base->FEED = WWDT_SECOND_WORD_OF_REFRESH; - EnableGlobalIRQ(primaskValue); -} - -/*! - * brief Clear WWDT flag. - * - * This function clears WWDT status flag. - * - * Example for clearing warning flag: - * code - * WWDT_ClearStatusFlags(wwdt_base, kWWDT_WarningFlag); - * endcode - * param base WWDT peripheral base address - * param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::_wwdt_status_flags_t - */ -void WWDT_ClearStatusFlags(WWDT_Type *base, uint32_t mask) -{ - /* Clear the WDINT bit so that we don't accidentally clear it */ - uint32_t reg = (base->MOD & (~WWDT_MOD_WDINT_MASK)); - - /* Clear timeout by writing a zero */ - if (0U != (mask & (uint32_t)kWWDT_TimeoutFlag)) - { - reg &= ~WWDT_MOD_WDTOF_MASK; -#if defined(FSL_FEATURE_WWDT_WDTRESET_FROM_PMC) && (FSL_FEATURE_WWDT_WDTRESET_FROM_PMC) - /* PMC RESETCAUSE: set bit to clear it */ - PMC->RESETCAUSE = PMC_RESETCAUSE_WDTRESET_MASK; -#endif /*FSL_FEATURE_WWDT_WDTRESET_FROM_PMC*/ - } - - /* Clear warning interrupt flag by writing a one */ - if (0U != (mask & (uint32_t)kWWDT_WarningFlag)) - { - reg |= WWDT_MOD_WDINT_MASK; - } - - base->MOD = reg; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_wwdt.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_wwdt.h deleted file mode 100644 index 40c90e48b38..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/fsl_wwdt.h +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_WWDT_H_ -#define FSL_WWDT_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup wwdt - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - *******************************************************************************/ - -/*! @name Driver version */ -/*! @{ */ -/*! @brief Defines WWDT driver version. */ -#define FSL_WWDT_DRIVER_VERSION (MAKE_VERSION(2, 1, 9)) -/*! @} */ - -/*! @name Refresh sequence */ -/*! @{ */ -#define WWDT_FIRST_WORD_OF_REFRESH (0xAAU) /*!< First word of refresh sequence */ -#define WWDT_SECOND_WORD_OF_REFRESH (0x55U) /*!< Second word of refresh sequence */ -/*! @} */ - -/*! @brief Describes WWDT configuration structure. */ -typedef struct _wwdt_config -{ - bool enableWwdt; /*!< Enables or disables WWDT */ - bool enableWatchdogReset; /*!< true: Watchdog timeout will cause a chip reset - false: Watchdog timeout will not cause a chip reset */ - bool enableWatchdogProtect; /*!< true: Enable watchdog protect i.e timeout value can only be - changed after counter is below warning & window values - false: Disable watchdog protect; timeout value can be changed - at any time */ -#if !(defined(FSL_FEATURE_WWDT_HAS_NO_OSCILLATOR_LOCK) && FSL_FEATURE_WWDT_HAS_NO_OSCILLATOR_LOCK) - bool enableLockOscillator; /*!< true: Disabling or powering down the watchdog oscillator is prevented - Once set, this bit can only be cleared by a reset - false: Do not lock oscillator */ -#endif - uint32_t windowValue; /*!< Window value, set this to 0xFFFFFF if windowing is not in effect */ - uint32_t timeoutValue; /*!< Timeout value */ - uint32_t warningValue; /*!< Watchdog time counter value that will generate a - warning interrupt. Set this to 0 for no warning */ - uint32_t clockFreq_Hz; /*!< Watchdog clock source frequency. */ -} wwdt_config_t; - -/*! - * @brief WWDT status flags. - * - * This structure contains the WWDT status flags for use in the WWDT functions. - */ -enum _wwdt_status_flags_t -{ - kWWDT_TimeoutFlag = WWDT_MOD_WDTOF_MASK, /*!< Time-out flag, set when the timer times out */ - kWWDT_WarningFlag = WWDT_MOD_WDINT_MASK /*!< Warning interrupt flag, set when timer is below the value WDWARNINT */ -}; - -/******************************************************************************* - * API - *******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ - -/*! - * @name WWDT Initialization and De-initialization - * @{ - */ - -/*! - * @brief Initializes WWDT configure structure. - * - * This function initializes the WWDT configure structure to default value. The default - * value are: - * @code - * config->enableWwdt = true; - * config->enableWatchdogReset = false; - * config->enableWatchdogProtect = false; - * config->enableLockOscillator = false; - * config->windowValue = 0xFFFFFFU; - * config->timeoutValue = 0xFFFFFFU; - * config->warningValue = 0; - * @endcode - * - * @param config Pointer to WWDT config structure. - * @see wwdt_config_t - */ -void WWDT_GetDefaultConfig(wwdt_config_t *config); - -/*! - * @brief Initializes the WWDT. - * - * This function initializes the WWDT. When called, the WWDT runs according to the configuration. - * - * Example: - * @code - * wwdt_config_t config; - * WWDT_GetDefaultConfig(&config); - * config.timeoutValue = 0x7ffU; - * WWDT_Init(wwdt_base,&config); - * @endcode - * - * @param base WWDT peripheral base address - * @param config The configuration of WWDT - */ -void WWDT_Init(WWDT_Type *base, const wwdt_config_t *config); - -/*! - * @brief Shuts down the WWDT. - * - * This function shuts down the WWDT. - * - * @param base WWDT peripheral base address - */ -void WWDT_Deinit(WWDT_Type *base); - -/*! @} */ - -/*! - * @name WWDT Functional Operation - * @{ - */ - -/*! - * @brief Enables the WWDT module. - * - * This function write value into WWDT_MOD register to enable the WWDT, it is a write-once bit; - * once this bit is set to one and a watchdog feed is performed, the watchdog timer will run - * permanently. - * - * @param base WWDT peripheral base address - */ -static inline void WWDT_Enable(WWDT_Type *base) -{ - base->MOD |= WWDT_MOD_WDEN_MASK; -} - -/*! - * @brief Disables the WWDT module. - * @deprecated Do not use this function. It will be deleted in next release version, for - * once the bit field of WDEN written with a 1, it can not be re-written with a 0. - * - * This function write value into WWDT_MOD register to disable the WWDT. - * - * @param base WWDT peripheral base address - */ -static inline void WWDT_Disable(WWDT_Type *base) -{ - base->MOD &= ~WWDT_MOD_WDEN_MASK; -} - -/*! - * @brief Gets all WWDT status flags. - * - * This function gets all status flags. - * - * Example for getting Timeout Flag: - * @code - * uint32_t status; - * status = WWDT_GetStatusFlags(wwdt_base) & kWWDT_TimeoutFlag; - * @endcode - * @param base WWDT peripheral base address - * @return The status flags. This is the logical OR of members of the - * enumeration ::_wwdt_status_flags_t - */ -static inline uint32_t WWDT_GetStatusFlags(WWDT_Type *base) -{ -#if defined(FSL_FEATURE_WWDT_WDTRESET_FROM_PMC) && (FSL_FEATURE_WWDT_WDTRESET_FROM_PMC) - uint32_t status; - /* WDTOF is not set in case of WD reset - get info from PMC instead */ - status = (base->MOD & (WWDT_MOD_WDTOF_MASK | WWDT_MOD_WDINT_MASK)); - if (PMC->RESETCAUSE & PMC_RESETCAUSE_WDTRESET_MASK) - { - status |= kWWDT_TimeoutFlag; - } - return status; -#else - return (base->MOD & (WWDT_MOD_WDTOF_MASK | WWDT_MOD_WDINT_MASK)); -#endif /*FSL_FEATURE_WWDT_WDTRESET_FROM_PMC*/ -} - -/*! - * @brief Clear WWDT flag. - * - * This function clears WWDT status flag. - * - * Example for clearing warning flag: - * @code - * WWDT_ClearStatusFlags(wwdt_base, kWWDT_WarningFlag); - * @endcode - * @param base WWDT peripheral base address - * @param mask The status flags to clear. This is a logical OR of members of the - * enumeration ::_wwdt_status_flags_t - */ -void WWDT_ClearStatusFlags(WWDT_Type *base, uint32_t mask); - -/*! - * @brief Set the WWDT warning value. - * - * The WDWARNINT register determines the watchdog timer counter value that will generate a watchdog - * interrupt. When the watchdog timer counter is no longer greater than the value defined by - * WARNINT, an interrupt will be generated after the subsequent WDCLK. - * - * @param base WWDT peripheral base address - * @param warningValue WWDT warning value. - */ -static inline void WWDT_SetWarningValue(WWDT_Type *base, uint32_t warningValue) -{ - base->WARNINT = WWDT_WARNINT_WARNINT(warningValue); -} - -/*! - * @brief Set the WWDT timeout value. - * - * This function sets the timeout value. Every time a feed sequence occurs the value in the TC - * register is loaded into the Watchdog timer. Writing a value below 0xFF will cause 0xFF to be - * loaded into the TC register. Thus the minimum time-out interval is TWDCLK*256*4. - * If enableWatchdogProtect flag is true in wwdt_config_t config structure, any attempt to change - * the timeout value before the watchdog counter is below the warning and window values - * will cause a watchdog reset and set the WDTOF flag. - * - * @param base WWDT peripheral base address - * @param timeoutCount WWDT timeout value, count of WWDT clock tick. - */ -static inline void WWDT_SetTimeoutValue(WWDT_Type *base, uint32_t timeoutCount) -{ - base->TC = WWDT_TC_COUNT(timeoutCount); -} - -/*! - * @brief Sets the WWDT window value. - * - * The WINDOW register determines the highest TV value allowed when a watchdog feed is performed. - * If a feed sequence occurs when timer value is greater than the value in WINDOW, a watchdog - * event will occur. To disable windowing, set windowValue to 0xFFFFFF (maximum possible timer - * value) so windowing is not in effect. - * - * @param base WWDT peripheral base address - * @param windowValue WWDT window value. - */ -static inline void WWDT_SetWindowValue(WWDT_Type *base, uint32_t windowValue) -{ - base->WINDOW = WWDT_WINDOW_WINDOW(windowValue); -} - -/*! - * @brief Refreshes the WWDT timer. - * - * This function feeds the WWDT. - * This function should be called before WWDT timer is in timeout. Otherwise, a reset is asserted. - * - * @param base WWDT peripheral base address - */ -void WWDT_Refresh(WWDT_Type *base); - -/*! @} */ - -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -/*! @}*/ - -#endif /* FSL_WWDT_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/flash/fsl_efuse.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/flash/fsl_efuse.h deleted file mode 100644 index 53f40047759..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/flash/fsl_efuse.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - * - */ - -#ifndef FSL_EFUSE_H_ -#define FSL_EFUSE_H_ - -#include "fsl_flash.h" - -/*! - * @addtogroup efuse_driver - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name EFUSE APIs - * @{ - */ - -/*! - * @brief Initialize EFUSE controller. - * - * This function enables EFUSE Controller clock. - * - * @retval #kStatus_Success 0 Operation succeeded without error. - * @retval #kStatus_Fail 1 The operation failed with a generic error. - * @retval #kStatus_ReadOnly 2 Requested value cannot be changed because it is read-only. - * @retval #kStatus_OutOfRange 3 Requested value is out of range. - * @retval #kStatus_InvalidArgument 4 The requested command's argument is undefined. - * @retval #kStatus_Timeout An invalid 5 A timeout occurred - * @retval #kStatus_NoTransferInProgress 6 No send in progress. - */ -status_t EFUSE_Init(void); - -/*! - * @brief De-Initialize EFUSE controller. - * - * This functin disables EFUSE Controller Clock. - * - * @retval #kStatus_Success 0 Operation succeeded without error. - * @retval #kStatus_Fail 1 The operation failed with a generic error. - * @retval #kStatus_ReadOnly 2 Requested value cannot be changed because it is read-only. - * @retval #kStatus_OutOfRange 3 Requested value is out of range. - * @retval #kStatus_InvalidArgument 4 The requested command's argument is undefined. - * @retval #kStatus_Timeout An invalid 5 A timeout occurred - * @retval #kStatus_NoTransferInProgress 6 No send in progress. - */ -status_t EFUSE_Deinit(void); - -/*! - * @brief Read Fuse value from eFuse word. - * - * This function read fuse data from eFuse word to specified data buffer. - * - * @param addr Fuse address - * @param data Buffer to hold the data read from eFuse word - * - * @retval #kStatus_Success 0 Operation succeeded without error. - * @retval #kStatus_Fail 1 The operation failed with a generic error. - * @retval #kStatus_ReadOnly 2 Requested value cannot be changed because it is read-only. - * @retval #kStatus_OutOfRange 3 Requested value is out of range. - * @retval #kStatus_InvalidArgument 4 The requested command's argument is undefined. - * @retval #kStatus_Timeout An invalid 5 A timeout occurred - * @retval #kStatus_NoTransferInProgress 6 No send in progress. - */ -status_t EFUSE_Read(uint32_t addr, uint32_t *data); - -/*! - * @brief Program value to eFuse block. - * - * This function program data to specified eFuse address. - * - * @param addr Fuse address - * @param data data to be programmed into eFuse Fuse block - * - * @retval #kStatus_Success 0 Operation succeeded without error. - * @retval #kStatus_Fail 1 The operation failed with a generic error. - * @retval #kStatus_ReadOnly 2 Requested value cannot be changed because it is read-only. - * @retval #kStatus_OutOfRange 3 Requested value is out of range. - * @retval #kStatus_InvalidArgument 4 The requested command's argument is undefined. - * @retval #kStatus_Timeout An invalid 5 A timeout occurred - * @retval #kStatus_NoTransferInProgress 6 No send in progress. - */ -status_t EFUSE_Program(uint32_t addr, uint32_t data); - -/*! @} */ - -#ifdef __cplusplus -} -#endif - -/*! @} */ - -#endif /*! FSL_EFUSE_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/flash/fsl_flash.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/flash/fsl_flash.h deleted file mode 100644 index 012f22e7bec..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/flash/fsl_flash.h +++ /dev/null @@ -1,591 +0,0 @@ -/* - * Copyright 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - * - */ - -#ifndef FSL_FLASH_H_ -#define FSL_FLASH_H_ - -#include "fsl_common.h" -/*! - * @addtogroup flash_driver - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/*! - * @name Flash version - * @{ - */ -/*! @brief Constructs the version number for drivers. */ -#if !defined(MAKE_VERSION) -#define MAKE_VERSION(major, minor, bugfix) (((major) << 16) | ((minor) << 8) | (bugfix)) -#endif - -/*! @brief Flash driver version for SDK*/ -#define FSL_FLASH_DRIVER_VERSION (MAKE_VERSION(1, 0, 0)) /*!< Version 1.0.0. */ - -/*! @brief Flash driver version for ROM*/ -enum _flash_driver_version_constants -{ - kFLASH_DriverVersionName = 'F', /*!< Flash driver version name.*/ - kFLASH_DriverVersionMajor = 1, /*!< Major flash driver version.*/ - kFLASH_DriverVersionMinor = 0, /*!< Minor flash driver version.*/ - kFLASH_DriverVersionBugfix = 0 /*!< Bugfix for flash driver version.*/ -}; -/*! @} */ - -/*! - * @name Flash driver support feature - * @{ - */ -#define FSL_FEATURE_SYSCON_HAS_FLASH_HIDING 1U - -/*! @} */ - -/*! - * @name Flash status - * @{ - */ -/*! @brief Flash driver status group. */ -#if defined(kStatusGroup_FlashDriver) -#define kStatusGroupGeneric kStatusGroup_Generic -#define kStatusGroupFlashDriver kStatusGroup_FlashDriver -#elif defined(kStatusGroup_FLASHIAP) -#define kStatusGroupGeneric kStatusGroup_Generic -#define kStatusGroupFlashDriver kStatusGroup_FLASH -#else -#define kStatusGroupGeneric 0 -#define kStatusGroupFlashDriver 1 -#endif - -/*! @brief Constructs a status code value from a group and a code number. */ -#if !defined(MAKE_STATUS) -#define MAKE_STATUS(group, code) ((((group)*100) + (code))) -#endif - -/*! - * @brief Flash driver status codes. - */ -enum -{ - kStatus_FLASH_Success = MAKE_STATUS(kStatusGroupGeneric, 0), /*!< API is executed successfully*/ - kStatus_FLASH_InvalidArgument = MAKE_STATUS(kStatusGroupGeneric, 4), /*!< Invalid argument*/ - kStatus_FLASH_SizeError = MAKE_STATUS(kStatusGroupFlashDriver, 0), /*!< Error size*/ - kStatus_FLASH_AlignmentError = - MAKE_STATUS(kStatusGroupFlashDriver, 1), /*!< Parameter is not aligned with the specified baseline*/ - kStatus_FLASH_AddressError = MAKE_STATUS(kStatusGroupFlashDriver, 2), /*!< Address is out of range */ - kStatus_FLASH_AccessError = - MAKE_STATUS(kStatusGroupFlashDriver, 3), /*!< Invalid instruction codes and out-of bound addresses */ - kStatus_FLASH_ProtectionViolation = MAKE_STATUS( - kStatusGroupFlashDriver, 4), /*!< The program/erase operation is requested to execute on protected areas */ - kStatus_FLASH_CommandFailure = - MAKE_STATUS(kStatusGroupFlashDriver, 5), /*!< Run-time error during command execution. */ - kStatus_FLASH_UnknownProperty = MAKE_STATUS(kStatusGroupFlashDriver, 6), /*!< Unknown property.*/ - kStatus_FLASH_EraseKeyError = MAKE_STATUS(kStatusGroupFlashDriver, 7), /*!< API erase key is invalid.*/ - kStatus_FLASH_RegionExecuteOnly = - MAKE_STATUS(kStatusGroupFlashDriver, 8), /*!< The current region is execute-only.*/ - kStatus_FLASH_ExecuteInRamFunctionNotReady = - MAKE_STATUS(kStatusGroupFlashDriver, 9), /*!< Execute-in-RAM function is not available.*/ - - kStatus_FLASH_CommandNotSupported = MAKE_STATUS(kStatusGroupFlashDriver, 11), /*!< Flash API is not supported.*/ - kStatus_FLASH_ReadOnlyProperty = MAKE_STATUS(kStatusGroupFlashDriver, 12), /*!< The flash property is read-only.*/ - kStatus_FLASH_InvalidPropertyValue = - MAKE_STATUS(kStatusGroupFlashDriver, 13), /*!< The flash property value is out of range.*/ - kStatus_FLASH_InvalidSpeculationOption = - MAKE_STATUS(kStatusGroupFlashDriver, 14), /*!< The option of flash prefetch speculation is invalid.*/ - kStatus_FLASH_EccError = MAKE_STATUS(kStatusGroupFlashDriver, - 0x10), /*!< A correctable or uncorrectable error during command execution. */ - kStatus_FLASH_CompareError = - MAKE_STATUS(kStatusGroupFlashDriver, 0x11), /*!< Destination and source memory contents do not match. */ - kStatus_FLASH_RegulationLoss = MAKE_STATUS(kStatusGroupFlashDriver, 0x12), /*!< A loss of regulation during read. */ - kStatus_FLASH_InvalidWaitStateCycles = - MAKE_STATUS(kStatusGroupFlashDriver, 0x13), /*!< The wait state cycle set to r/w mode is invalid. */ - - kStatus_FLASH_OutOfDateCfpaPage = - MAKE_STATUS(kStatusGroupFlashDriver, 0x20), /*!< CFPA page version is out of date. */ - kStatus_FLASH_BlankIfrPageData = MAKE_STATUS(kStatusGroupFlashDriver, 0x21), /*!< Blank page cannnot be read. */ - kStatus_FLASH_EncryptedRegionsEraseNotDoneAtOnce = - MAKE_STATUS(kStatusGroupFlashDriver, 0x22), /*!< Encrypted flash subregions are not erased at once. */ - kStatus_FLASH_ProgramVerificationNotAllowed = MAKE_STATUS( - kStatusGroupFlashDriver, 0x23), /*!< Program verification is not allowed when the encryption is enabled. */ - kStatus_FLASH_HashCheckError = - MAKE_STATUS(kStatusGroupFlashDriver, 0x24), /*!< Hash check of page data is failed. */ - kStatus_FLASH_SealedFfrRegion = MAKE_STATUS(kStatusGroupFlashDriver, 0x25), /*!< The FFR region is sealed. */ - kStatus_FLASH_FfrRegionWriteBroken = MAKE_STATUS( - kStatusGroupFlashDriver, 0x26), /*!< The FFR Spec region is not allowed to be written discontinuously. */ - kStatus_FLASH_NmpaAccessNotAllowed = - MAKE_STATUS(kStatusGroupFlashDriver, 0x27), /*!< The NMPA region is not allowed to be read/written/erased. */ - kStatus_FLASH_CmpaCfgDirectEraseNotAllowed = - MAKE_STATUS(kStatusGroupFlashDriver, 0x28), /*!< The CMPA Cfg region is not allowed to be erased directly. */ - kStatus_FLASH_FfrBankIsLocked = MAKE_STATUS(kStatusGroupFlashDriver, 0x29), /*!< The FFR bank region is locked. */ - kStatus_FLASH_CfpaScratchPageInvalid = - MAKE_STATUS(kStatusGroupFlashDriver, 0x30), /*!< CFPA Scratch Page is invalid*/ - kStatus_FLASH_CfpaVersionRollbackDisallowed = - MAKE_STATUS(kStatusGroupFlashDriver, 0x31), /*!< CFPA version rollback is not allowed */ - kStatus_FLASH_ReadHidingAreaDisallowed = - MAKE_STATUS(kStatusGroupFlashDriver, 0x32), /*!< Flash hiding read is not allowed */ - kStatus_FLASH_ModifyProtectedAreaDisallowed = - MAKE_STATUS(kStatusGroupFlashDriver, 0x33), /*!< Flash firewall page locked erase and program are not allowed */ - kStatus_FLASH_CommandOperationInProgress = MAKE_STATUS( - kStatusGroupFlashDriver, 0x34), /*!< The flash state is busy, indicate that a flash command in progress. */ -}; -/*! @} */ - -/*! - * @name Flash API key - * @{ - */ -/*! @brief Constructs the four character code for the Flash driver API key. */ -#if !defined(FOUR_CHAR_CODE) -#define FOUR_CHAR_CODE(a, b, c, d) (((d) << 24) | ((c) << 16) | ((b) << 8) | ((a))) -#endif - -/*! - * @brief Enumeration for Flash driver API keys. - * - * @note The resulting value is built with a byte order such that the string - * being readable in expected order when viewed in a hex editor, if the value - * is treated as a 32-bit little endian value. - */ -enum _flash_driver_api_keys -{ - kFLASH_ApiEraseKey = FOUR_CHAR_CODE('l', 'f', 'e', 'k') /*!< Key value used to validate all flash erase APIs.*/ -}; -/*! @} */ - -/*! - * @brief Enumeration for various flash properties. - */ -typedef enum _flash_property_tag -{ - kFLASH_PropertyPflashSectorSize = 0x00U, /*!< Pflash sector size property.*/ - kFLASH_PropertyPflashTotalSize = 0x01U, /*!< Pflash total size property.*/ - kFLASH_PropertyPflashBlockSize = 0x02U, /*!< Pflash block size property.*/ - kFLASH_PropertyPflashBlockCount = 0x03U, /*!< Pflash block count property.*/ - kFLASH_PropertyPflashBlockBaseAddr = 0x04U, /*!< Pflash block base address property.*/ - - kFLASH_PropertyPflashPageSize = 0x30U, /*!< Pflash page size property.*/ - kFLASH_PropertyPflashSystemFreq = 0x31U, /*!< System Frequency System Frequency.*/ - - kFLASH_PropertyFfrSectorSize = 0x40U, /*!< FFR sector size property.*/ - kFLASH_PropertyFfrTotalSize = 0x41U, /*!< FFR total size property.*/ - kFLASH_PropertyFfrBlockBaseAddr = 0x42U, /*!< FFR block base address property.*/ - kFLASH_PropertyFfrPageSize = 0x43U, /*!< FFR page size property.*/ -} flash_property_tag_t; - -/*! - * @brief Enumeration for flash max pages to erase. - */ -enum _flash_max_erase_page_value -{ - kFLASH_MaxPagesToErase = 100U /*!< The max value in pages to erase. */ -}; - -/*! - * @brief Enumeration for flash alignment property. - */ -enum _flash_alignment_property -{ - kFLASH_AlignementUnitVerifyErase = 4U, /*!< The alignment unit in bytes used for verify erase operation.*/ - kFLASH_AlignementUnitProgram = 512U, /*!< The alignment unit in bytes used for program operation.*/ - /*kFLASH_AlignementUnitVerifyProgram = 4U,*/ /*!< The alignment unit in bytes used for verify program operation.*/ - kFLASH_AlignementUnitSingleWordRead = 16U /*!< The alignment unit in bytes used for SingleWordRead command.*/ -}; - -/*! - * @brief Enumeration for flash read ecc option - */ -enum _flash_read_ecc_option -{ - kFLASH_ReadWithEccOn = 0U, /*! ECC is on */ - kFLASH_ReadWithEccOff = 1U /*! ECC is off */ -}; - -/*! - * @brief Enumeration for flash read margin option - */ -enum _flash_read_margin_option -{ - kFLASH_ReadMarginNormal = 0U, /*!< Normal read */ - kFLASH_ReadMarginVsProgram = 1U, /*!< Margin vs. program */ - kFLASH_ReadMarginVsErase = 2U, /*!< Margin vs. erase */ - kFLASH_ReadMarginIllegalBitCombination = 3U /*!< Illegal bit combination */ -}; - -/*! - * @brief Enumeration for flash read dmacc option - */ -enum _flash_read_dmacc_option -{ - kFLASH_ReadDmaccDisabled = 0U, /*!< Memory word */ - kFLASH_ReadDmaccEnabled = 1U /*!< DMACC word */ -}; - -/*! - * @brief Enumeration for flash ramp control option - */ -enum _flash_ramp_control_option -{ - kFLASH_RampControlDivisionFactorReserved = 0U, /*!< Reserved */ - kFLASH_RampControlDivisionFactor256 = 1U, /*!< clk48mhz / 256 = 187.5KHz */ - kFLASH_RampControlDivisionFactor128 = 2U, /*!< clk48mhz / 128 = 375KHz */ - kFLASH_RampControlDivisionFactor64 = 3U /*!< clk48mhz / 64 = 750KHz */ -}; - -/*! @brief Flash ECC log info. */ -typedef struct _flash_ecc_log -{ - uint32_t firstEccEventAddress; - uint32_t eccErrorCount; - uint32_t eccCorrectionCount; - uint32_t reserved; -} flash_ecc_log_t; - -/*! @brief Flash controller paramter config. */ -typedef struct _flash_mode_config -{ - uint32_t sysFreqInMHz; - /* ReadSingleWord parameter. */ - struct - { - uint8_t readWithEccOff : 1; - uint8_t readMarginLevel : 2; - uint8_t readDmaccWord : 1; - uint8_t reserved0 : 4; - uint8_t reserved1[3]; - } readSingleWord; - /* SetWriteMode parameter. */ - struct - { - uint8_t programRampControl; - uint8_t eraseRampControl; - uint8_t reserved[2]; - } setWriteMode; - /* SetReadMode parameter. */ - struct - { - uint16_t readInterfaceTimingTrim; - uint16_t readControllerTimingTrim; - uint8_t readWaitStates; - uint8_t reserved[3]; - } setReadMode; -} flash_mode_config_t; - -/*! @brief Flash controller paramter config. */ -typedef struct _flash_ffr_config -{ - uint32_t ffrBlockBase; - uint32_t ffrTotalSize; - uint32_t ffrPageSize; - uint32_t cfpaPageVersion; - uint32_t cfpaPageOffset; -} flash_ffr_config_t; - -/*! @brief Flash driver state information. - * - * An instance of this structure is allocated by the user of the flash driver and - * passed into each of the driver APIs. - */ -typedef struct -{ - uint32_t PFlashBlockBase; /*!< A base address of the first PFlash block */ - uint32_t PFlashTotalSize; /*!< The size of the combined PFlash block. */ - uint32_t PFlashBlockCount; /*!< A number of PFlash blocks. */ - uint32_t PFlashPageSize; /*!< The size in bytes of a page of PFlash. */ - uint32_t PFlashSectorSize; /*!< The size in bytes of a sector of PFlash. */ - flash_ffr_config_t ffrConfig; - flash_mode_config_t modeConfig; - uint32_t *nbootCtx; - bool useAhbRead; -} flash_config_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization - * @{ - */ - -/*! - * @brief Initializes the global flash properties structure members. - * - * This function checks and initializes the Flash module for the other Flash APIs. - * - * @param config Pointer to the storage for the driver runtime state. - * - * @retval #kStatus_FLASH_Success API was executed successfully. - * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FLASH_CommandFailure Run-time error during the command execution. - * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported. - * @retval #kStatus_FLASH_EccError A correctable or uncorrectable error during command execution. - * @retval #kStatus_FLASH_RegulationLoss A loss of regulation during read. - */ -status_t FLASH_Init(flash_config_t *config); - -/*! - * @brief De-Initializes the global flash properties structure members. - * - * This API De-initializes the FLASH default parameters and related FLASH clock for the FLASH and FMC. - * The flash_deinit API should be called after all the other FLASH APIs. - * - * @param config Pointer to the storage for the driver runtime state. - * - * @retval #kStatus_FLASH_Success API was executed successfully. - * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided. - */ -status_t FLASH_Deinit(flash_config_t *config); - -/*! @} */ - -/*! - * @name Erasing - * @{ - */ - -/*! - * @brief Erases the flash sectors encompassed by parameters passed into function. - * - * This function erases the appropriate number of flash sectors based on the - * desired start address and length. - * - * @param config The pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be erased. - * NOTE: The start address need to be 4 Bytes-aligned. - * - * @param lengthInBytes The length, given in bytes need be 4 Bytes-aligned. - * - * @param key The value used to validate all flash erase APIs. - * - * @retval #kStatus_FLASH_Success API was executed successfully. - * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FLASH_AlignmentError The parameter is not aligned with the specified baseline. - * @retval #kStatus_FLASH_AddressError The address is out of range. - * @retval #kStatus_FLASH_EraseKeyError The API erase key is invalid. - * @retval #kStatus_FLASH_ModifyProtectedAreaDisallowed Flash firewall page locked erase and program are not allowed - * @retval #kStatus_FLASH_CommandFailure Run-time error during the command execution. - * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported. - * @retval #kStatus_FLASH_EccError A correctable or uncorrectable error during command execution. - * @retval #kStatus_FLASH_RegulationLoss A loss of regulation during read. - */ -status_t FLASH_Erase(flash_config_t *config, uint32_t start, uint32_t lengthInBytes, uint32_t key); - -/*! @} */ - -/*! - * @name Programming - * @{ - */ - -/*! - * @brief Programs flash with data at locations passed in through parameters. - * - * This function programs the flash memory with the desired data for a given - * flash area as determined by the start address and the length. - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be programmed. Must be - * word-aligned. - * @param src A pointer to the source buffer of data that is to be programmed - * into the flash. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be programmed. Must be word-aligned. - * - * @retval #kStatus_FLASH_Success API was executed successfully. - * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with the specified baseline. - * @retval #kStatus_FLASH_AddressError Address is out of range. - * @retval #kStatus_FLASH_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FLASH_ModifyProtectedAreaDisallowed Flash firewall page locked erase and program are not allowed - * @retval #kStatus_FLASH_CommandFailure Run-time error during the command execution. - * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported. - * @retval #kStatus_FLASH_RegulationLoss A loss of regulation during read. - * @retval #kStatus_FLASH_EccError A correctable or uncorrectable error during command execution. - */ -status_t FLASH_Program(flash_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes); - -/*! - * @name Reading - * @{ - */ - -/*! - * @brief Reads flash at locations passed in through parameters. - * - * This function read the flash memory from a given flash area as determined - * by the start address and the length. - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be read. - * @param dest A pointer to the dest buffer of data that is to be read - * from the flash. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be read. - * - * @retval #kStatus_FLASH_Success API was executed successfully. - * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with the specified baseline. - * @retval #kStatus_FLASH_AddressError Address is out of range. - * @retval #kStatus_FLASH_ReadHidingAreaDisallowed Flash hiding read is not allowed - * @retval #kStatus_FLASH_CommandFailure Run-time error during the command execution. - * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported. - * @retval #kStatus_FLASH_RegulationLoss A loss of regulation during read. - * @retval #kStatus_FLASH_EccError A correctable or uncorrectable error during command execution. - */ -status_t FLASH_Read(flash_config_t *config, uint32_t start, uint8_t *dest, uint32_t lengthInBytes); - -/*! @} */ - -/*! - * @name Verification - * @{ - */ - -/*! - * @brief Verifies an erasure of the desired flash area at a specified margin level. - * - * This function checks the appropriate number of flash sectors based on - * the desired start address and length to check whether the flash is erased - * to the specified read margin level. - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be verified. - * The start address does not need to be sector-aligned but must be word-aligned. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be verified. Must be word-aligned. - * @param margin Read margin choice. - * - * @retval #kStatus_FLASH_Success API was executed successfully. - * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with specified baseline. - * @retval #kStatus_FLASH_AddressError Address is out of range. - * @retval #kStatus_FLASH_CommandFailure Run-time error during the command execution. - * @retval #kStatus_FLASH_CommandFailure Run-time error during the command execution. - * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported. - * @retval #kStatus_FLASH_RegulationLoss A loss of regulation during read. - * @retval #kStatus_FLASH_EccError A correctable or uncorrectable error during command execution. - */ -status_t FLASH_VerifyErase(flash_config_t *config, uint32_t start, uint32_t lengthInBytes); - -/*! - * @brief Verifies programming of the desired flash area at a specified margin level. - * - * This function verifies the data programed in the flash memory using the - * Flash Program Check Command and compares it to the expected data for a given - * flash area as determined by the start address and length. - * - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired flash memory to be verified. Must be word-aligned. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be verified. Must be word-aligned. - * @param expectedData A pointer to the expected data that is to be - * verified against. - * @param margin Read margin choice. - * @param failedAddress A pointer to the returned failing address. - * @param failedData A pointer to the returned failing data. Some derivatives do - * not include failed data as part of the FCCOBx registers. In this - * case, zeros are returned upon failure. - * - * @retval #kStatus_FLASH_Success API was executed successfully. - * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with specified baseline. - * @retval #kStatus_FLASH_AddressError Address is out of range. - * @retval #kStatus_FLASH_AccessError Invalid instruction codes and out-of bounds addresses. - * @retval #kStatus_FLASH_ReadHidingAreaDisallowed Flash hiding read is not allowed - * @retval #kStatus_FLASH_CommandFailure Run-time error during the command execution. - * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported. - * @retval #kStatus_FLASH_RegulationLoss A loss of regulation during read. - * @retval #kStatus_FLASH_EccError A correctable or uncorrectable error during command execution. - */ -status_t FLASH_VerifyProgram(flash_config_t *config, - uint32_t start, - uint32_t lengthInBytes, - const uint8_t *expectedData, - uint32_t *failedAddress, - uint32_t *failedData); - -/*! @} */ - -/*! - * @name Properties - * @{ - */ - -/*! - * @brief Returns the desired flash property. - * - * @param config A pointer to the storage for the driver runtime state. - * @param whichProperty The desired property from the list of properties in - * enum flash_property_tag_t - * @param value A pointer to the value returned for the desired flash property. - * - * @retval #kStatus_FLASH_Success API was executed successfully. - * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FLASH_UnknownProperty An unknown property tag. - */ -status_t FLASH_GetProperty(flash_config_t *config, flash_property_tag_t whichProperty, uint32_t *value); - -/*! @} */ - -/*! - * @name CustKeyStore - * @{ - */ - -/*! - * @brief Get the customer key store data from the customer key store region . - * - * @param config Pointer to flash_config_t data structure in memory to store driver runtime state. - * @param pData Pointer to the customer key store data buffer, which got from the customer key store region. - * @param offset Point to the offset value based on the customer key store address(0x3e400) of the device. - * @param len Point to the length of the expected get customer key store data, and the offset + len <= 512B. - * - * @retval #kStatus_FLASH_Success API was executed successfully. - * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided. - */ -status_t FLASH_GetCustKeyStore(flash_config_t *config, uint8_t *pData, uint32_t offset, uint32_t len); - -/*! @} */ - -/*! - * @name flash status - * @{ - */ -#if defined(FSL_FEATURE_SYSCON_HAS_FLASH_HIDING) && (FSL_FEATURE_SYSCON_HAS_FLASH_HIDING == 1) -/*! - * @brief Validates the given address range is loaded in the flash hiding region. - * - * @param config A pointer to the storage for the driver runtime state. - * @param startAddress The start address of the desired flash memory to be verified. - * @param lengthInBytes The length, given in bytes (not words or long-words), - * to be verified. - * - * @retval #kStatus_FLASH_Success API was executed successfully. - * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FLASH_ReadHidingAreaDisallowed Flash hiding read is not allowed. - */ -status_t FLASH_IsFlashAreaReadable(flash_config_t *config, uint32_t startAddress, uint32_t lengthInBytes); -#endif - -/*! @} */ - -#ifdef __cplusplus -} -#endif - -/*! @} */ - -#endif /* _FLASH_FLASH_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/flash/fsl_flash_ffr.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/flash/fsl_flash_ffr.h deleted file mode 100644 index a8e2caf1c22..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/flash/fsl_flash_ffr.h +++ /dev/null @@ -1,591 +0,0 @@ -/* - * Copyright 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - * - */ - -#ifndef FSL_FLASH_FFR_H_ -#define FSL_FLASH_FFR_H_ - -#include "fsl_flash.h" - -/*! - * @addtogroup flash_ffr_driver - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @brief Alignment(down) utility. */ -#if !defined(ALIGN_DOWN) -#define ALIGN_DOWN(x, a) ((x) & (uint32_t)(-((int32_t)(a)))) -#endif - -/*! @brief Alignment(up) utility. */ -#if !defined(ALIGN_UP) -#define ALIGN_UP(x, a) (-((int32_t)((uint32_t)(-((int32_t)(x))) & (uint32_t)(-((int32_t)(a)))))) -#endif - -#define FLASH_FFR_MAX_PAGE_SIZE (512u) -#define FLASH_FFR_CUST_ADDRESS (0x200U) -#define FLASH_FFR_CUST_PAGE_NUMBER (15u) - -#define FLASH_FFR_HASH_DIGEST_SIZE (32u) -#define FLASH_FFR_IV_CODE_SIZE (52u) -#define FLASH_FFR_KETBLOB_OFFSET (0x160u) -#define FLASH_FFR_KETBLOB_SIZE (0x30u) -#define CFPA_HEADER_MARKER (0x9635u) -#define CMPA_HEADER_MARKER (0x5963u) -#define FLASH_FFR_UUID_SIZE (16u) -enum flash_ffr_page_offset -{ - kFfrPageOffset_CFPA = 0, /*!< Customer In-Field programmed area*/ - kFfrPageOffset_CFPA_CfgPing = 0, /*!< CFPA Configuration area (Ping page)*/ - kFfrPageOffset_CFPA_CfgPong = 1, /*!< Same as CFPA page (Pong page)*/ - kFfrPageOffset_CMPA_Cfg = 2, /*!< Customer Manufacturing programmed area*/ - kFfrPageOffset_NMPA_Cfg = 3, /*!< Customer Manufacturing programmed area*/ - kFfrPageOffset_SBL_Cfg = 4, /*!< SBL recovery programmed area*/ - kFfrPageOffset_B0_IFR1_Visible = 128, /*!< Trim programmed area*/ - -}; - -enum flash_ffr_page_num -{ - kFfrSectorNum_CFPA = 2, /*!< Customer In-Field programmed area*/ - kFfrSectorNum_CMPA = 1, /*!< Customer Manufacturing programmed area*/ - kFfrSectorNum_NMPA = 1, /*!< NXP Manufacturing programmed area*/ - kFfrSectorNum_SBL = 4, /*!< SBL Cus programmed area*/ - kFfrSectorNum_Total = (kFfrSectorNum_CFPA + kFfrSectorNum_CMPA + kFfrSectorNum_NMPA + kFfrSectorNum_SBL), -}; - -enum flash_ffr_block_size -{ - kFfrBlockSize_Key = 52u, - kFfrBlockSize_ActivationCode = 1000u, -}; - -enum cfpa_cfg_cmpa_prog_status -{ - kFfrCmpaProgStatus_Idle = 0x0u, - kFfrCmpaProgStatus_InProgress = 0x5CC55AA5u, -}; - -typedef enum -{ - kFfrCmpaProgProcess_Pre = 0x0u, - kFfrCmpaProgProcess_Post = 0xFFFFFFFFu, -} cmpa_prog_process_t; - -typedef struct -{ - struct - { - uint32_t cfpa_lc_state : 8; - uint32_t cfpa_lc_state_inv : 8; - uint32_t header_marker : 16; - } header; //!< [0x000-0x003] - - struct //!< [0x004-0x007] - { - uint32_t version : 24; //!< cfpa version - uint32_t img_upd : 2; //!< image cmac update - uint32_t reserved0 : 1; - uint32_t cmpa_update : 3; //!< CFPA page updated through SB command. - uint32_t reserved1 : 1; - uint32_t dice_en : 1; //!< Update DICE certificate during next boot - } cfpa_page_version; - - uint32_t secureFwVersion; //!< [0x008-0x00b] - uint32_t nsFwVersion; //!< [0x00c-0x00f] - uint32_t recFwVersion; //!< [0x010-0x013] - uint32_t secBootFlags; //!< [0x014-0x01f] - uint32_t imageKeyRevoke; //!< [0x018-0x01b] - uint32_t lpVectorAddr; //!< [0x01c-0x01f] - uint32_t vendorUsage; //!< [0x020-0x02f] - uint32_t dcfgNsPin; //!< [0x024-0x027] - uint32_t dcfgNsDflt; //!< [0x028-0x02b] - uint32_t reserved0; //!< [0x02c-0x02f] - uint32_t ivPrince[4]; //!< [0x030-0x03f] - uint32_t ivIped[8]; //!< [0x040-0x05f] - - uint32_t errCnt[8]; //!< [0x060-0x07f] - - uint32_t custCtr[8]; //!< [0x080-0x09f] - uint32_t mflagCtr[8]; //!< [0x0a0-0x0bf] - uint32_t flashAcl[8]; //!< [0x0C0-0x0Df] - uint32_t sblImg0Cmac[4]; //!< [0x0E0-0x0Ef] - uint32_t img1Cmac[4]; //!< [0x0F0-0x0Ff] - uint32_t diceCert[36]; //!< [0x100-0x18f] - uint32_t reserved2[23]; //!< [0x190-0x1eb] - uint32_t cfpaCrc; //!< [0x1ec-0x1ef] - uint32_t cfpaCmac[4]; //!< [0x1f0-0x1ff] -} cfpa_cfg_info_t; - -#define FFR_BOOTCFG_USBSPEED_SHIFT (9U) -#define FFR_BOOTCFG_USBSPEED_MASK (0x3u << FFR_BOOTCFG_USBSPEED_SHIFT) -#define FFR_BOOTCFG_USBSPEED_NMPASEL0 (0x0U) -#define FFR_BOOTCFG_USBSPEED_FS (0x1U) -#define FFR_BOOTCFG_USBSPEED_HS (0x2U) -#define FFR_BOOTCFG_USBSPEED_NMPASEL3 (0x3U) - -#define FFR_BOOTCFG_BOOTSPEED_MASK (0x18U) -#define FFR_BOOTCFG_BOOTSPEED_SHIFT (7U) -#define FFR_BOOTCFG_BOOTSPEED_NMPASEL (0x0U) -#define FFR_BOOTCFG_BOOTSPEED_48MHZ (0x1U) -#define FFR_BOOTCFG_BOOTSPEED_96MHZ (0x2U) - -#define FFR_USBID_VENDORID_MASK (0xFFFFU) -#define FFR_USBID_VENDORID_SHIFT (0U) -#define FFR_USBID_PRODUCTID_MASK (0xFFFF0000U) -#define FFR_USBID_PRODUCTID_SHIFT (16U) - -#define FFR_IMAGE0_CMAC_UPDATE_MASK (0x1) -#define FFR_IMAGE1_CMAC_UPDATE_MASK (0x2) - -#define FFR_IFR1_PUF_AC_CODE_ADDR (0x01100200UL) -#define FFR_IFR1_PUF_AC_CODE_LEN (1024UL) - -#define FFR_IFR1_NXP_CERT_ADDR (0x01100600UL) -#define FFR_IFR1_NXP_CERT_LEN (1448UL) - -#define FFR_IFR1_ROM_PATCH_ARRAY0_ADDR (0x01101900UL) -#define FFR_IFR1_ROM_PATCH_ARRAY0_LEN (1792UL) - -#define FFR_IFR1_ROM_PATCH_ARRAY1_ADDR (0x01102000UL) -#define FFR_IFR1_ROM_PATCH_ARRAY1_LEN (3584UL) - -#define FFR_IFR1_ROM_PATCH_ARRAY2_ADDR (0x01103000UL) -#define FFR_IFR1_ROM_PATCH_ARRAY2_LEN (2048UL) - -#define FFR_IFR1_ROM_PATCH_ARRAY3_ADDR (0x01103800UL) -#define FFR_IFR1_ROM_PATCH_ARRAY3_LEN (2048UL) - -#define FFR_IFR1_NXP_WRITEABLE_REGION0_START (FFR_IFR1_PUF_AC_CODE_ADDR) -#define FFR_IFR1_NXP_WRITEABLE_REGION0_END \ - (FFR_IFR1_PUF_AC_CODE_ADDR + FFR_IFR1_PUF_AC_CODE_LEN + FFR_IFR1_NXP_CERT_LEN) -#define FFR_IFR1_NXP_WRITEABLE_REGION1_START (FFR_IFR1_ROM_PATCH_ARRAY0_ADDR) -#define FFR_IFR1_NXP_WRITEABLE_REGION1_END \ - (FFR_IFR1_ROM_PATCH_ARRAY0_ADDR + FFR_IFR1_ROM_PATCH_ARRAY0_LEN + FFR_IFR1_ROM_PATCH_ARRAY1_LEN) -#define FFR_IFR1_NXP_WRITEABLE_REGION2_START (FFR_IFR1_ROM_PATCH_ARRAY2_ADDR) -#define FFR_IFR1_NXP_WRITEABLE_REGION2_END \ - (FFR_IFR1_ROM_PATCH_ARRAY2_ADDR + FFR_IFR1_ROM_PATCH_ARRAY2_LEN + FFR_IFR1_ROM_PATCH_ARRAY3_LEN) - -typedef struct -{ - struct - { - uint32_t boot_src : 2; - uint32_t rsv0 : 2; - uint32_t isp_boot_if : 3; - uint32_t rsv1 : 1; - uint32_t rec_boot_src : 2; - uint32_t rsv2 : 2; - uint32_t boot_speed : 2; - uint32_t rsv3 : 2; - uint32_t header_marker : 16; - } bootCfg; //!< [0x000-0x003] - - struct - { - uint32_t flash_remap_size : 5; - uint32_t bank1_ifr0_usage : 3; - uint32_t reserved : 24; - } FlashCfg; //!< [0x004-0x007] - - struct - { - uint8_t recLed; - uint8_t ispLed; - uint8_t bootFailLed; - uint8_t resv0; - } bootLedStatus; //!< [0x008-0x00b] - - struct - { - uint16_t powerDnTimeout; - uint16_t wdogTimeout; - } bootTimers; //!< [0x00c-0x00f] - - uint32_t resv2; //!< [0x010-0x013] - uint32_t resv3; //!< [0x014-0x017] - - uint32_t recSpiFlashCfg0; //!< [0x018-0x01b] - uint32_t recSpiFlashCfg1; //!< [0x01c-0x01f] - - uint32_t isp_uart_cfg; //!< [0x020-0x023] - uint32_t isp_i2c_cfg; //!< [0x024-0x027] - uint32_t isp_can_cfg; //!< [0x028-0x02b] - uint32_t isp_spi_cfg0; //!< [0x02c-0x02f] - uint32_t isp_spi_cfg1; //!< [0x030-0x034] - - struct - { - uint16_t vid; - uint16_t pid; - } usbId; //!< [0x034-0x037] - - uint32_t isp_usb_cfg; //!< [0x038-0x038] - uint32_t isp_misc_cfg; //!< [0x03c-0x03f] - uint32_t dcfgPin; //!< [0x040-0x043] - uint32_t dcfgDflt; //!< [0x044-0x047] - uint32_t dapVendorUsage; //!< [0x048-0x04b] - uint32_t resv1; //!< [0x04c-0x04f] - uint32_t secureBootCfg; //!< [0x050-0x053] - uint32_t rokthUsage; //!< [0x054-0x057] - uint32_t resv4; //!< [0x058-0x05b] - uint32_t resv5; //!< [0x05c-0x05f] - uint32_t rotkh[12]; //!< [0x060-0x08f] - - struct - { - uint32_t npx_w0; - uint32_t npx_w1; - } princeSr[4]; //!< [0x090-0x0af] - - struct - { - uint32_t ipedStartAddr; - uint32_t ipedEndAddr; - } ipedRegions[8]; //!< [0x0b0-0x11f] - - uint32_t rec_img_exit0; - uint32_t rec_img_exit1; - - uint32_t resv6[10]; - - struct - { - uint32_t set0; - uint32_t clr0; - } quickSetGpio[6]; //!< [0x120-0x14f] - - uint32_t resv7[4]; //!< [0x150-0x15f] - uint32_t cust_key_blob[12]; //!< [0x160-0x18f] - - uint32_t resv8[23]; //!< [0x190-0x1eb] - uint32_t cmpaCrc; //!< [0x1ec-0x1ef] - uint32_t cmpaCmac[4]; //!< [0x1f0-0x1ff] - -} cmpa_cfg_info_t; - -typedef struct -{ - uint32_t header; - uint8_t reserved[4]; -} cmpa_key_store_header_t; - -#define FFR_SYSTEM_SPEED_CODE_MASK (0x3U) -#define FFR_SYSTEM_SPEED_CODE_SHIFT (0U) -#define FFR_SYSTEM_SPEED_CODE_FRO12MHZ_12MHZ (0x0U) -#define FFR_SYSTEM_SPEED_CODE_FROHF96MHZ_24MHZ (0x1U) -#define FFR_SYSTEM_SPEED_CODE_FROHF96MHZ_48MHZ (0x2U) -#define FFR_SYSTEM_SPEED_CODE_FROHF96MHZ_96MHZ (0x3U) - -#define FFR_USBCFG_USBSPEED_HS (0x0U) -#define FFR_USBCFG_USBSPEED_FS (0x1U) -#define FFR_USBCFG_USBSPEED_NO (0x2U) - -#define FFR_MCAN_BAUDRATE_MASK (0xF0000U) -#define FFR_MCAN_BAUDRATE_SHIFT (16U) - -#define FFR_PERIPHERALCFG_PERI_MASK (0x7FFFFFFFU) -#define FFR_PERIPHERALCFG_PERI_SHIFT (0U) -#define FFR_PERIPHERALCFG_COREEN_MASK (0x10000000U) -#define FFR_PERIPHERALCFG_COREEN_SHIFT (31U) - -#define FFR_PUF_SRAM_CONFIG_MASK (0x3FFFF07) -#define FFR_PUF_SRAM_CONFIG_MASK_SHIFT (0U) -#define FFR_PUF_SRAM_VALID_MASK (0x1U) -#define FFR_PUF_SRAM_VALID_SHIFT (0U) -#define FFR_PUF_SRAM_MODE_MASK (0x2U) -#define FFR_PUF_SRAM_MODE_SHIFT (1U) -#define FFR_PUF_SRAM_CKGATING_MASK (0x4U) -#define FFR_PUF_SRAM_CKGATING_SHIFT (2) -#define FFR_PUF_SRAM_SMB_MASK (0x300U) -#define FFR_PUF_SRAM_SMB_SHIFT (8U) -#define FFR_PUF_SRAM_RM_MASK (0x1C00U) -#define FFR_PUF_SRAM_RM_SHIFT (10U) -#define FFR_PUF_SRAM_WM_MASK (0xE000U) -#define FFR_PUF_SRAM_WM_SHIFT (13U) -#define FFR_PUF_SRAM_WRME_MASK (0x10000U) -#define FFR_PUF_SRAM_WRME_SHIFT (16U) -#define FFR_PUF_SRAM_RAEN_MASK (0x20000U) -#define FFR_PUF_SRAM_RAEN_SHIFT (17U) -#define FFR_PUF_SRAM_RAM_MASK (0x3C0000U) -#define FFR_PUF_SRAM_RAM_SHIFT (18U) -#define FFR_PUF_SRAM_WAEN_MASK (0x400000U) -#define FFR_PUF_SRAM_WAEN_SHIFT (22U) -#define FFR_PUF_SRAM_WAM_MASK (0x1800000U) -#define FFR_PUF_SRAM_WAM_SHIFT (23U) -#define FFR_PUF_SRAM_STBP_MASK (0x2000000U) -#define FFR_PUF_SRAM_STBP_SHIFT (25U) - -typedef struct -{ - uint32_t fro32kCfg; //!< [0x000-0x003] - uint32_t puf_cfg; //!< [0x004-0x007] - uint32_t bod; //!< [0x008-0x00b] - uint32_t trim; //!< [0x00c-0x00f] - uint32_t deviceID; //!< [0x010-0x03f] - uint32_t peripheralCfg; //!< [0x014-0x017] - uint32_t dcdPowerProFileLOW[2]; //!< [0x018-0x01f] - uint32_t deviceType; //!< [0x020-0x023] - uint32_t ldo_ao; //!< [0x024-0x027] - uint32_t gdetDelayCfg; //!< [0x028-0x02b] - uint32_t gdetMargin; //!< [0x02c-0x02f] - uint32_t gdetTrim1; //!< [0x030-0x033] - uint32_t gdetEanble1; //!< [0x034-0x037] - uint32_t gdetCtrl1; //!< [0x038-0x03b] - uint32_t gdetUpdateTimer; //!< [0x03c-0x03f] - uint32_t GpoDataChecksum[4]; //!< [0x040-0x04f] - uint32_t finalTestBatchId[4]; //!< [0x050-0x05f] - uint32_t ecidBackup[4]; //!< [0x060-0x06f] - uint32_t uuid[4]; //!< [0x070-0x07f] - uint32_t reserved1[7]; //!< [0x080-0x09b] - struct - { - uint8_t xo32mReadyTimeoutInMs; - uint8_t usbSpeed; - uint8_t reserved[2]; - } usbCfg; //!< [0x09c-0x09f] - uint32_t reserved2[80]; //!< [0x0a0-0x1df] - uint8_t cmac[16]; //!< [0x1e0-0x1ef] - uint32_t pageChecksum[4]; //!< [0x1f0-0x1ff] -} nmpa_cfg_info_t; - -typedef struct -{ - uint8_t reserved[1][FLASH_FFR_MAX_PAGE_SIZE]; -} ffr_key_store_t; - -typedef enum -{ - kFFR_KeyTypeSbkek = 0x00U, - kFFR_KeyTypeUser = 0x01U, - kFFR_KeyTypeUds = 0x02U, - kFFR_KeyTypePrinceRegion0 = 0x03U, - kFFR_KeyTypePrinceRegion1 = 0x04U, - kFFR_KeyTypePrinceRegion2 = 0x05U, -} ffr_key_type_t; - -typedef enum -{ - kFFR_BankTypeBank0_CFPA0 = 0x00u, - kFFR_BankTypeBank0_CFPA1 = 0x01u, - kFFR_BankTypeBank0_CMPA = 0x02U, - kFFR_BankTypeBank0_NMPA = 0x03U, - kFFR_BankTypeBank0_SBL = 0x04U, - -} ffr_bank_type_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name FFR APIs - * @{ - */ - -/*! - * @brief Initializes the global FFR properties structure members. - * - * @param config A pointer to the storage for the driver runtime state. - * - * @retval #kStatus_FLASH_Success API was executed successfully. - */ -status_t FFR_Init(flash_config_t *config); - -/*! - * @brief Enable firewall for all flash banks. - * - * CFPA, CMPA, and NMPA flash areas region will be locked, After this function executed; - * Unless the board is reset again. - * - * @param config A pointer to the storage for the driver runtime state. - * - * @retval #kStatus_FLASH_Success An invalid argument is provided. - */ -status_t FFR_Lock(flash_config_t *config); - -/*! - * @brief APIs to access CFPA pages - * - * This routine will erase CFPA and program the CFPA page with passed data. - * - * @param config A pointer to the storage for the driver runtime state. - * @param page_data A pointer to the source buffer of data that is to be programmed - * into the CFPA. - * @param valid_len The length, given in bytes, to be programmed. - * - * @retval #kStatus_FLASH_Success The desire page-data were programed successfully into CFPA. - * @retval #kStatus_FLASH_SizeError Error size - * @retval #kStatus_FLASH_ReadHidingAreaDisallowed Flash hiding read is not allowed - * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with the specified baseline - * @retval #kStatus_FLASH_ModifyProtectedAreaDisallowed Flash firewall page locked erase and program are not allowed - * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_AddressError Address is out of range. - * @retval #kStatus_FLASH_FfrBankIsLocked The CFPA was locked. - * @retval #kStatus_FLASH_OutOfDateCfpaPage It is not newest CFPA page. - * @retval #kStatus_FLASH_CommandFailure access error. - * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported - * @retval #kStatus_FLASH_EccError A correctable or uncorrectable error during command execution. - * @retval #kStatus_FLASH_RegulationLoss A loss of regulation during read. - */ -status_t FFR_InfieldPageWrite(flash_config_t *config, uint8_t *page_data, uint32_t valid_len); - -/*! - * @brief APIs to access CFPA pages - * - * Generic read function, used by customer to read data stored in 'Customer In-field Page'. - * - * @param config A pointer to the storage for the driver runtime state. - * @param pData A pointer to the dest buffer of data that is to be read from 'Customer In-field Page'. - * @param offset An offset from the 'Customer In-field Page' start address. - * @param len The length, given in bytes, to be read. - * - * @retval #kStatus_FLASH_Success Get data from 'Customer In-field Page'. - * @retval #kStatus_FLASH_InvalidArgument An invalid argument is provided. - * @retval #kStatus_FTFx_AddressError Address is out of range. - * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with the specified baseline. - * @retval #kStatus_FLASH_ReadHidingAreaDisallowed Flash hiding read is not allowed - * @retval #kStatus_FLASH_CommandFailure access error. - * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported - * @retval #kStatus_FLASH_EccError A correctable or uncorrectable error during command execution. - * @retval #kStatus_FLASH_RegulationLoss A loss of regulation during read. - */ -status_t FFR_GetCustomerInfieldData(flash_config_t *config, uint8_t *pData, uint32_t offset, uint32_t len); - -/*! - * @brief APIs to access CMPA pages - * - * This routine will erase "customer factory page" and program the page with passed data. - * If 'seal_part' parameter is TRUE then the routine will compute SHA256 hash of - * the page contents and then programs the pages. - * 1.During development customer code uses this API with 'seal_part' set to FALSE. - * 2.During manufacturing this parameter should be set to TRUE to seal the part - * from further modifications - * 3.This routine checks if the page is sealed or not. A page is said to be sealed if - * the SHA256 value in the page has non-zero value. On boot ROM locks the firewall for - * the region if hash is programmed anyways. So, write/erase commands will fail eventually. - * - * @param config A pointer to the storage for the driver runtime state. - * @param page_data A pointer to the source buffer of data that is to be programmed - * into the "customer factory page". - * @param seal_part Set fasle for During development customer code. - * - * @retval #kStatus_FLASH_Success The desire page-data were programed successfully into CMPA. - * @retval #kStatus_FLASH_InvalidArgument Parameter is not aligned with the specified baseline. - * @retval #kStatus_FTFx_AddressError Address is out of range. - * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with the specified baseline. - * @retval #kStatus_FLASH_EraseKeyError API erase key is invalid. - * @retval #kStatus_FLASH_ModifyProtectedAreaDisallowed Flash firewall page locked erase and program are not allowed - * @retval #kStatus_Fail Generic status for Fail. - * @retval #kStatus_FLASH_CommandFailure access error. - * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported - * @retval #kStatus_FLASH_EccError A correctable or uncorrectable error during command execution. - * @retval #kStatus_FLASH_RegulationLoss A loss of regulation during read. - */ -status_t FFR_CustFactoryPageWrite(flash_config_t *config, uint8_t *page_data, bool seal_part); - -/*! - * @brief APIs to access CMPA page - * - * Read data stored in 'Customer Factory CFG Page'. - * - * @param config A pointer to the storage for the driver runtime state. - * @param pData A pointer to the dest buffer of data that is to be read - * from the Customer Factory CFG Page. - * @param offset Address offset relative to the CMPA area. - * @param len The length, given in bytes to be read. - * - * @retval #kStatus_FLASH_Success Get data from 'Customer Factory CFG Page'. - * @retval #kStatus_FLASH_InvalidArgument Parameter is not aligned with the specified baseline. - * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with the specified baseline. - * @retval #kStatus_FTFx_AddressError Address is out of range. - * @retval #kStatus_FLASH_CommandFailure access error. - * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported - * @retval #kStatus_FLASH_EccError A correctable or uncorrectable error during command execution. - * @retval #kStatus_FLASH_RegulationLoss A loss of regulation during read. - * @retval #kStatus_FLASH_ReadHidingAreaDisallowed Flash hiding read is not allowed - */ -status_t FFR_GetCustomerData(flash_config_t *config, uint8_t *pData, uint32_t offset, uint32_t len); - -/*! - * @brief The API is used for getting the customer key store data from the customer key store region(0x3e400 �C - * 0x3e600), and the API should be called after the FLASH_Init and FFR_Init. - * - * @param config A pointer to the storage for the driver runtime state. - * @param pData A pointer to the dest buffer of data that is to be read - * from the Customer Factory CFG Page. - * @param offset Address offset relative to the CMPA area. - * @param len The length, given in bytes to be read. - * - * @retval #kStatus_FLASH_Success Get data from 'Customer Factory CFG Page'. - * @retval #kStatus_FLASH_InvalidArgument Parameter is not aligned with the specified baseline. - * @retval #kStatus_FTFx_AddressError Address is out of range. - * @retval #kStatus_FLASH_AddressError Address is out of range - * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with the specified baseline. - * @retval #kStatus_FLASH_ReadHidingAreaDisallowed Flash hiding read is not allowed - * @retval #kStatus_FLASH_CommandFailure access error. - * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported - * @retval #kStatus_FLASH_EccError A correctable or uncorrectable error during command execution. - * @retval #kStatus_FLASH_RegulationLoss A loss of regulation during read. - */ -status_t FFR_GetCustKeystoreData(flash_config_t *config, uint8_t *pData, uint32_t offset, uint32_t len); - -/*! - * @brief This routine writes the 3 pages allocated for Key store data. - * - * @param config A pointer to the storage for the driver runtime state. - * @param pKeyStore A pointer to the source buffer of data that is to be programmed - * into the "Key store". - * - * @retval #kStatus_FLASH_Success Get data from 'Customer Factory CFG Page'. - * @retval #kStatus_FLASH_InvalidArgument Parameter is not aligned with the specified baseline. - * @retval #kStatus_FLASH_CommandFailure access error. - * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported - * @retval #kStatus_FLASH_EccError A correctable or uncorrectable error during command execution. - * @retval #kStatus_FLASH_RegulationLoss A loss of regulation during read. - * @retval #kStatus_FLASH_SealedFfrRegion The FFR region is sealed. - * @retval #kStatus_FLASH_FfrBankIsLocked The FFR bank region is locked. - * @retval #kStatus_FLASH_AddressError Address is out of range - * @retval #kStatus_FLASH_AlignmentError Parameter is not aligned with the specified baseline. - * @retval #kStatus_FLASH_ModifyProtectedAreaDisallowed Flash firewall page locked erase and program are not allowed - */ -status_t FFR_CustKeystoreWrite(flash_config_t *config, ffr_key_store_t *pKeyStore); - -/*! - * @brief APIs to access CMPA page - * - * 1.SW should use this API routine to get the UUID of the chip. - * 2.Calling routine should pass a pointer to buffer which can hold 128-bit value. - * - * @retval #kStatus_FLASH_Success Get data from 'Customer Factory CFG Page'. - * @retval #kStatus_FLASH_InvalidArgument Parameter is not aligned with the specified baseline. - * @retval #kStatus_FLASH_ReadHidingAreaDisallowed Flash hiding read is not allowed - * @retval #kStatus_FLASH_CommandFailure Run-time error during command execution. - * @retval #kStatus_FLASH_CommandNotSupported Flash API is not supported - * @retval #kStatus_FLASH_RegulationLoss A loss of regulation during read. - */ -status_t FFR_GetUUID(flash_config_t *config, uint8_t *uuid); - -/*! @} */ - -#ifdef __cplusplus -} -#endif - -/*! @} */ - -#endif /*! FSL_FLASH_FFR_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/flash/fsl_flexspi_nor_flash.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/flash/fsl_flexspi_nor_flash.h deleted file mode 100644 index 6965988e956..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/flash/fsl_flexspi_nor_flash.h +++ /dev/null @@ -1,721 +0,0 @@ -/* - * Copyright 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - * - */ - -#ifndef FSL_FLEXSPI_NOR_FLASH_H__ -#define FSL_FLEXSPI_NOR_FLASH_H__ - -#include "fsl_common.h" -/*! - * @addtogroup flexspi_nor_flash_driver - * @{ - */ - -/*! @file */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -#define FLEXSPI_FEATURE_HAS_PARALLEL_MODE 0 /*!< FLEXSPI Feature related definitions */ - -#define FSL_ROM_FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) \ - (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | \ - FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1)) - -#define CMD_SDR 0x01U -#define CMD_DDR 0x21U -#define RADDR_SDR 0x02U -#define RADDR_DDR 0x22U -#define CADDR_SDR 0x03U -#define CADDR_DDR 0x23U -#define MODE1_SDR 0x04U -#define MODE1_DDR 0x24U -#define MODE2_SDR 0x05U -#define MODE2_DDR 0x25U -#define MODE4_SDR 0x06U -#define MODE4_DDR 0x26U -#define MODE8_SDR 0x07U -#define MODE8_DDR 0x27U -#define WRITE_SDR 0x08U -#define WRITE_DDR 0x28U -#define READ_SDR 0x09U -#define READ_DDR 0x29U -#define LEARN_SDR 0x0AU -#define LEARN_DDR 0x2AU -#define DATSZ_SDR 0x0BU -#define DATSZ_DDR 0x2BU -#define DUMMY_SDR 0x0CU -#define DUMMY_DDR 0x2CU -#define DUMMY_RWDS_SDR 0x0DU -#define DUMMY_RWDS_DDR 0x2DU -#define JMP_ON_CS 0x1FU -#define FLEXSPI_STOP 0U - -#define FLEXSPI_1PAD 0U -#define FLEXSPI_2PAD 1U -#define FLEXSPI_4PAD 2U -#define FLEXSPI_8PAD 3U - -/*! - * @brief NOR LUT sequence index used for default LUT assignment - * NOTE: - * The will take effect if the lut sequences are not customized. - */ -#define NOR_CMD_LUT_SEQ_IDX_READ 0U /*!< READ LUT sequence id in lookupTable stored in config block */ -#define NOR_CMD_LUT_SEQ_IDX_READSTATUS 1U /*!< Read Status LUT sequence id in lookupTable stored in config block */ -#define NOR_CMD_LUT_SEQ_IDX_READSTATUS_XPI \ - 2U /*!< Read status DPI/QPI/OPI sequence id in lookupTable stored in config block */ -#define NOR_CMD_LUT_SEQ_IDX_WRITEENABLE 3U /*!< Write Enable sequence id in lookupTable stored in config block */ -#define NOR_CMD_LUT_SEQ_IDX_WRITEENABLE_XPI \ - 4U /*!< Write Enable DPI/QPI/OPI sequence id in lookupTable stored in config block */ -#define NOR_CMD_LUT_SEQ_IDX_ERASESECTOR 5U /*!< Erase Sector sequence id in lookupTable stored in config block */ -#define NOR_CMD_LUT_SEQ_IDX_READID 7U -#define NOR_CMD_LUT_SEQ_IDX_ERASEBLOCK 8U /*!< Erase Block sequence id in lookupTable stored in config block */ -#define NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM 9U /*!< Program sequence id in lookupTable stored in config block */ -#define NOR_CMD_LUT_SEQ_IDX_CHIPERASE 11U /*!< Chip Erase sequence in lookupTable id stored in config block */ -#define NOR_CMD_LUT_SEQ_IDX_READ_SFDP 13U /*!< Read SFDP sequence in lookupTable id stored in config block */ -#define NOR_CMD_LUT_SEQ_IDX_RESTORE_NOCMD \ - 14U /*!< Restore 0-4-4/0-8-8 mode sequence id in lookupTable stored in config block */ -#define NOR_CMD_LUT_SEQ_IDX_EXIT_NOCMD \ - 15U /*!< Exit 0-4-4/0-8-8 mode sequence id in lookupTable stored in config blobk */ - -/*! @brief FLEXSPI status group numbers. */ -enum _flexspi_status_groups -{ - kStatusROMGroup_FLEXSPI = 60, /*!< Group number for ROM FLEXSPI status codes. */ - kStatusROMGroup_FLEXSPINOR = 201, /*!< ROM FLEXSPI NOR status group number.*/ -}; - -/*! @brief FLEXSPI NOR status */ -enum _flexspi_nor_status -{ - kStatus_FLEXSPINOR_ProgramFail = - MAKE_STATUS(kStatusROMGroup_FLEXSPINOR, 0), /*!< Status for Page programming failure */ - kStatus_FLEXSPINOR_EraseSectorFail = - MAKE_STATUS(kStatusROMGroup_FLEXSPINOR, 1), /*!< Status for Sector Erase failure */ - kStatus_FLEXSPINOR_EraseAllFail = MAKE_STATUS(kStatusROMGroup_FLEXSPINOR, 2), /*!< Status for Chip Erase failure */ - kStatus_FLEXSPINOR_WaitTimeout = MAKE_STATUS(kStatusROMGroup_FLEXSPINOR, 3), /*!< Status for timeout */ - kStatus_FlexSPINOR_NotSupported = MAKE_STATUS(kStatusROMGroup_FLEXSPINOR, 4), // Status for PageSize overflow */ - kStatus_FlexSPINOR_WriteAlignmentError = - MAKE_STATUS(kStatusROMGroup_FLEXSPINOR, 5), /*!< Status for Alignement error */ - kStatus_FlexSPINOR_CommandFailure = - MAKE_STATUS(kStatusROMGroup_FLEXSPINOR, 6), /*!< Status for Erase/Program Verify Error */ - kStatus_FlexSPINOR_SFDP_NotFound = MAKE_STATUS(kStatusROMGroup_FLEXSPINOR, 7), /*!< Status for SFDP read failure */ - kStatus_FLEXSPINOR_Unsupported_SFDP_Version = - MAKE_STATUS(kStatusROMGroup_FLEXSPINOR, 8), /*!< Status for Unrecognized SFDP version */ - kStatus_FLEXSPINOR_Flash_NotFound = - MAKE_STATUS(kStatusROMGroup_FLEXSPINOR, 9), /*!< Status for Flash detection failure */ - kStatus_FLEXSPINOR_DTRRead_DummyProbeFailed = - MAKE_STATUS(kStatusROMGroup_FLEXSPINOR, 10), /*!< Status for DDR Read dummy probe failure */ - - kStatus_FLEXSPI_SequenceExecutionTimeout = - MAKE_STATUS(kStatusROMGroup_FLEXSPI, 0), /*!< Status for Sequence Execution timeout */ - kStatus_FLEXSPI_InvalidSequence = MAKE_STATUS(kStatusROMGroup_FLEXSPI, 1), /*!< Status for Invalid Sequence */ - kStatus_FLEXSPI_DeviceTimeout = MAKE_STATUS(kStatusROMGroup_FLEXSPI, 2), /*!< Status for Device timeout */ - -}; - -/*! @brief Configure the device_type of "serial_nor_config_option_t" structure */ -enum -{ - kSerialNorCfgOption_Tag = 0x0cU, - kSerialNorCfgOption_DeviceType_ReadSFDP_SDR = 0U, - kSerialNorCfgOption_DeviceType_ReadSFDP_DDR = 1U, - kSerialNorCfgOption_DeviceType_HyperFLASH1V8 = 2U, - kSerialNorCfgOption_DeviceType_HyperFLASH3V0 = 3U, - kSerialNorCfgOption_DeviceType_MacronixOctalDDR = 4U, - kSerialNorCfgOption_DeviceType_MacronixOctalSDR = 5U, - kSerialNorCfgOption_DeviceType_MicronOctalDDR = 6U, - kSerialNorCfgOption_DeviceType_MicronOctalSDR = 7U, - kSerialNorCfgOption_DeviceType_AdestoOctalDDR = 8U, - kSerialNorCfgOption_DeviceType_AdestoOctalSDR = 9U, -}; - -/*! @brief Configure the quad_mode_setting of "serial_nor_config_option_t" structure */ -enum -{ - kSerialNorQuadMode_NotConfig = 0U, - kSerialNorQuadMode_StatusReg1_Bit6 = 1U, - kSerialNorQuadMode_StatusReg2_Bit1 = 2U, - kSerialNorQuadMode_StatusReg2_Bit7 = 3U, - kSerialNorQuadMode_StatusReg2_Bit1_0x31 = 4U, -}; - -/*! @brief FLEXSPI NOR Octal mode */ -enum -{ - kSerialNorOctaldMode_NoOctalEnableBit = 0U, - kSerialNorOctaldMode_HasOctalEnableBit = 1U, -}; - -/*! @brief miscellaneous mode */ -enum -{ - kSerialNorEnhanceMode_Disabled = 0U, - kSerialNorEnhanceMode_0_4_4_Mode = 1U, - kSerialNorEnhanceMode_0_8_8_Mode = 2U, - kSerialNorEnhanceMode_DataOrderSwapped = 3U, - kSerialNorEnhanceMode_2ndPinMux = 4U, - kSerialNorEnhanceMode_InternalLoopback = 5U, - kSerialNorEnhanceMode_SpiMode = 6U, - kSerialNorEnhanceMode_ExtDqs = 8U, -}; - -/*! @brief FLEXSPI NOR reset logic options */ -enum -{ - kFlashResetLogic_Disabled = 0U, - kFlashResetLogic_ResetPin = 1U, - kFlashResetLogic_JedecHwReset = 2U, -}; - -/*! @brief Configure the flash_connection of "serial_nor_config_option_t" structure */ -enum -{ - kSerialNorConnection_SinglePortA, - kSerialNorConnection_Parallel, - kSerialNorConnection_SinglePortB, - kSerialNorConnection_BothPorts -}; - -/*! @brief - * FLEXSPI ROOT clock soruce related definitions - */ -enum -{ - kFLEXSPIClkSrc_MainClk = 0U, - kFLEXSPIClkSrc_Pll0 = 1U, - kFLEXSPIClkSrc_FroHf = 3U, - kFLEXSPIClkSrc_Pll1 = 5U, -}; - -/*! @brief Restore sequence options - * Configure the restore_sequence of "flash_run_context_t" structure - */ -enum -{ - kRestoreSequence_None = 0U, - kRestoreSequence_HW_Reset = 1U, - kRestoreSequence_QPI_4_0xFFs = 2U, - kRestoreSequence_QPI_Mode_0x00 = 3U, - kRestoreSequence_8QPI_FF = 4U, - kRestoreSequence_Send_F0 = 5U, - kRestoreSequence_Send_66_99 = 6U, - kRestoreSequence_Send_6699_9966 = 7U, - kRestoreSequence_Send_06_FF = 8U, /*!< Adesto EcoXIP */ - kRestoreSequence_QPI_5_0xFFs = 9U, - kRestoreSequence_Send_QPI_8_0xFFs = 10U, - kRestoreSequence_Wakeup_0xAB = 11U, - kRestoreSequence_Wakeup_0xAB_54 = 12U, -}; - -/*! @brief Port mode options*/ -enum -{ - kFlashInstMode_ExtendedSpi = 0x00U, - kFlashInstMode_0_4_4_SDR = 0x01U, - kFlashInstMode_0_4_4_DDR = 0x02U, - kFlashInstMode_DPI_SDR = 0x21U, - kFlashInstMode_DPI_DDR = 0x22U, - kFlashInstMode_QPI_SDR = 0x41U, - kFlashInstMode_QPI_DDR = 0x42U, - kFlashInstMode_OPI_SDR = 0x81U, - kFlashInstMode_OPI_DDR = 0x82U, -}; - -/*! - * @name Support for init FLEXSPI NOR configuration - * @{ - */ -/*! @brief Flash Pad Definitions */ -enum -{ - kSerialFlash_1Pad = 1U, - kSerialFlash_2Pads = 2U, - kSerialFlash_4Pads = 4U, - kSerialFlash_8Pads = 8U, -}; - -/*! @brief FLEXSPI clock configuration type */ -enum -{ - kFLEXSPIClk_SDR, /*!< Clock configure for SDR mode */ - kFLEXSPIClk_DDR, /*!< Clock configurat for DDR mode */ -}; - -/*! @brief FLEXSPI Read Sample Clock Source definition */ -enum _flexspi_read_sample_clk -{ - kFLEXSPIReadSampleClk_LoopbackInternally = 0U, - kFLEXSPIReadSampleClk_LoopbackFromDqsPad = 1U, - kFLEXSPIReadSampleClk_LoopbackFromSckPad = 2U, - kFLEXSPIReadSampleClk_ExternalInputFromDqsPad = 3U, -}; - -/*! @brief Flash Type Definition */ -enum -{ - kFLEXSPIDeviceType_SerialNOR = 1U, /*!< Flash device is Serial NOR */ -}; - -/*! @brief Flash Configuration Command Type */ -enum -{ - kDeviceConfigCmdType_Generic, /*!< Generic command, for example: configure dummy cycles, drive strength, etc */ - kDeviceConfigCmdType_QuadEnable, /*!< Quad Enable command */ - kDeviceConfigCmdType_Spi2Xpi, /*!< Switch from SPI to DPI/QPI/OPI mode */ - kDeviceConfigCmdType_Xpi2Spi, /*!< Switch from DPI/QPI/OPI to SPI mode */ - kDeviceConfigCmdType_Spi2NoCmd, /*!< Switch to 0-4-4/0-8-8 mode */ - kDeviceConfigCmdType_Reset, /*!< Reset device command */ -}; - -/*! @brief Defintions for FLEXSPI Serial Clock Frequency */ -enum _flexspi_serial_clk_freq -{ - kFLEXSPISerialClk_NoChange = 0U, - kFLEXSPISerialClk_30MHz = 1U, - kFLEXSPISerialClk_50MHz = 2U, - kFLEXSPISerialClk_60MHz = 3U, - kFLEXSPISerialClk_75MHz = 4U, - kFLEXSPISerialClk_100MHz = 5U, -}; - -/*! @brief Misc feature bit definitions */ -enum -{ - kFLEXSPIMiscOffset_DiffClkEnable = 0U, /*!< Bit for Differential clock enable */ - kFLEXSPIMiscOffset_Ck2Enable = 1U, /*!< Bit for CK2 enable */ - kFLEXSPIMiscOffset_ParallelEnable = 2U, /*!< Bit for Parallel mode enable */ - kFLEXSPIMiscOffset_WordAddressableEnable = 3U, /*!< Bit for Word Addressable enable */ - kFLEXSPIMiscOffset_SafeConfigFreqEnable = 4U, /*!< Bit for Safe Configuration Frequency enable */ - kFLEXSPIMiscOffset_PadSettingOverrideEnable = 5U, /*!< Bit for Pad setting override enable */ - kFLEXSPIMiscOffset_DdrModeEnable = 6U, /*!< Bit for DDR clock confiuration indication. */ - kFLEXSPIMiscOffset_UseValidTimeForAllFreq = 7U, /*!< Bit for DLLCR settings under all modes */ -}; - -/*! @} */ - -/*! @brief Manufacturer ID */ -enum -{ - kSerialFlash_ISSI_ManufacturerID = 0x9DU, /*!< Manufacturer ID of the ISSI serial flash */ - kSerialFlash_Adesto_ManufacturerID = 0x1FU, /*!< Manufacturer ID of the Adesto Technologies serial flash*/ - kSerialFlash_Winbond_ManufacturerID = 0xEFU, /*!< Manufacturer ID of the Winbond serial flash */ - kSerialFlash_Cypress_ManufacturerID = 0x01U, /*!< Manufacturer ID for Cypress */ -}; - -/*! @brief - * Serial NOR configuration option - */ -typedef struct _serial_nor_config_option -{ - union - { - struct - { - uint32_t max_freq : 4; /*!< Maximum supported Frequency */ - uint32_t misc_mode : 4; /*!< miscellaneous mode */ - uint32_t quad_mode_setting : 4; /*!< Quad mode setting */ - uint32_t cmd_pads : 4; /*!< Command pads */ - uint32_t query_pads : 4; /*!< SFDP read pads */ - uint32_t device_type : 4; /*!< Device type */ - uint32_t option_size : 4; /*!< Option size, in terms of uint32_t, size = (option_size + 1) * 4 */ - uint32_t tag : 4; /*!< Tag, must be 0x0E */ - } B; - uint32_t U; - } option0; - - union - { - struct - { - uint32_t dummy_cycles : 8; /*!< Dummy cycles before read */ - uint32_t status_override : 8; /*!< Override status register value during device mode configuration */ - uint32_t pinmux_group : 4; /*!< The pinmux group selection */ - uint32_t dqs_pinmux_group : 4; /*!< The DQS Pinmux Group Selection */ - uint32_t drive_strength : 4; /*!< The Drive Strength of FLEXSPI Pads */ - uint32_t flash_connection : 4; /*!< Flash connection option: 0 - Single Flash connected to port A, 1 - */ - /*!< Parallel mode, 2 - Single Flash connected to Port B */ - } B; - uint32_t U; - } option1; - -} serial_nor_config_option_t; - -typedef union -{ - struct - { - uint8_t por_mode; - uint8_t current_mode; - uint8_t exit_no_cmd_sequence; - uint8_t restore_sequence; - } B; - uint32_t U; -} flash_run_context_t; - -/*! @brief - * FLEXSPI LUT Sequence structure - */ -typedef struct _lut_sequence -{ - uint8_t seqNum; /*!< Sequence Number, valid number: 1-16 */ - uint8_t seqId; /*!< Sequence Index, valid number: 0-15 */ - uint16_t reserved; -} flexspi_lut_seq_t; - -typedef struct -{ - uint8_t time_100ps; /*!< Data valid time, in terms of 100ps */ - uint8_t delay_cells; /*!< Data valid time, in terms of delay cells */ -} flexspi_dll_time_t; - -/*! @brief - * FLEXSPI Memory Configuration Block - */ -typedef struct _FlexSPIConfig -{ - uint32_t tag; /*!< [0x000-0x003] Tag, fixed value 0x42464346UL */ - uint32_t version; /*!< [0x004-0x007] Version,[31:24] -'V', [23:16] - Major, [15:8] - Minor, [7:0] - bugfix */ - uint32_t reserved0; /*!< [0x008-0x00b] Reserved for future use */ - uint8_t readSampleClkSrc; /*!< [0x00c-0x00c] Read Sample Clock Source, valid value: 0/1/3 */ - uint8_t csHoldTime; /*!< [0x00d-0x00d] CS hold time, default value: 3 */ - uint8_t csSetupTime; /*!< [0x00e-0x00e] CS setup time, default value: 3 */ - uint8_t columnAddressWidth; /*!< [0x00f-0x00f] Column Address with, for HyperBus protocol, it is fixed to 3, For - Serial NAND, need to refer to datasheet */ - uint8_t deviceModeCfgEnable; /*!< [0x010-0x010] Device Mode Configure enable flag, 1 - Enable, 0 - Disable */ - uint8_t deviceModeType; /*!< [0x011-0x011] Specify the configuration command type:Quad Enable, DPI/QPI/OPI switch, - Generic configuration, etc. */ - uint16_t waitTimeCfgCommands; /*!< [0x012-0x013] Wait time for all configuration commands, unit: 100us, Used for - DPI/QPI/OPI switch or reset command */ - flexspi_lut_seq_t deviceModeSeq; /*!< [0x014-0x017] Device mode sequence info, [7:0] - LUT sequence id, [15:8] - LUt - sequence number, [31:16] Reserved */ - uint32_t deviceModeArg; /*!< [0x018-0x01b] Argument/Parameter for device configuration */ - uint8_t configCmdEnable; /*!< [0x01c-0x01c] Configure command Enable Flag, 1 - Enable, 0 - Disable */ - uint8_t configModeType[3]; /*!< [0x01d-0x01f] Configure Mode Type, similar as deviceModeTpe */ - flexspi_lut_seq_t - configCmdSeqs[3]; /*!< [0x020-0x02b] Sequence info for Device Configuration command, similar as deviceModeSeq */ - uint32_t reserved1; /*!< [0x02c-0x02f] Reserved for future use */ - uint32_t configCmdArgs[3]; /*!< [0x030-0x03b] Arguments/Parameters for device Configuration commands */ - uint32_t reserved2; /*!< [0x03c-0x03f] Reserved for future use */ - uint32_t controllerMiscOption; /*!< [0x040-0x043] Controller Misc Options, see Misc feature bit definitions for more - details */ - uint8_t deviceType; /*!< [0x044-0x044] Device Type: See Flash Type Definition for more details */ - uint8_t sflashPadType; /*!< [0x045-0x045] Serial Flash Pad Type: 1 - Single, 2 - Dual, 4 - Quad, 8 - Octal */ - uint8_t serialClkFreq; /*!< [0x046-0x046] Serial Flash Frequencey, device specific definitions, See System Boot - Chapter for more details */ - uint8_t lutCustomSeqEnable; /*!< [0x047-0x047] LUT customization Enable, it is required if the program/erase cannot - be done using 1 LUT sequence, currently, only applicable to HyperFLASH */ - uint32_t reserved3[2]; /*!< [0x048-0x04f] Reserved for future use */ - uint32_t sflashA1Size; /*!< [0x050-0x053] Size of Flash connected to A1 */ - uint32_t sflashA2Size; /*!< [0x054-0x057] Size of Flash connected to A2 */ - uint32_t sflashB1Size; /*!< [0x058-0x05b] Size of Flash connected to B1 */ - uint32_t sflashB2Size; /*!< [0x05c-0x05f] Size of Flash connected to B2 */ - uint32_t csPadSettingOverride; /*!< [0x060-0x063] CS pad setting override value */ - uint32_t sclkPadSettingOverride; /*!< [0x064-0x067] SCK pad setting override value */ - uint32_t dataPadSettingOverride; /*!< [0x068-0x06b] data pad setting override value */ - uint32_t dqsPadSettingOverride; /*!< [0x06c-0x06f] DQS pad setting override value */ - uint32_t timeoutInMs; /*!< [0x070-0x073] Timeout threshold for read status command */ - uint32_t commandInterval; /*!< [0x074-0x077] CS deselect interval between two commands */ - flexspi_dll_time_t dataValidTime[2]; /*!< [0x078-0x07b] CLK edge to data valid time for PORT A and PORT B */ - uint16_t busyOffset; /*!< [0x07c-0x07d] Busy offset, valid value: 0-31 */ - uint16_t busyBitPolarity; /*!< [0x07e-0x07f] Busy flag polarity, 0 - busy flag is 1 when flash device is busy, 1 - - busy flag is 0 when flash device is busy */ - uint32_t lookupTable[64]; /*!< [0x080-0x17f] Lookup table holds Flash command sequences */ - flexspi_lut_seq_t lutCustomSeq[12]; /*!< [0x180-0x1af] Customizable LUT Sequences */ - uint32_t dll0CrVal; //!> [0x1b0-0x1b3] Customizable DLL0CR setting */ - uint32_t dll1CrVal; //!> [0x1b4-0x1b7] Customizable DLL1CR setting */ - uint32_t reserved4[2]; /*!< [0x1b8-0x1bf] Reserved for future use */ -} flexspi_mem_config_t; - -/*! @brief - * Serial NOR configuration block - */ -typedef struct _flexspi_nor_config -{ - flexspi_mem_config_t memConfig; /*!< Common memory configuration info via FLEXSPI */ - uint32_t pageSize; /*!< Page size of Serial NOR */ - uint32_t sectorSize; /*!< Sector size of Serial NOR */ - uint8_t ipcmdSerialClkFreq; /*!< Clock frequency for IP command */ - uint8_t isUniformBlockSize; /*!< Sector/Block size is the same */ - uint8_t isDataOrderSwapped; /*!< Data order (D0, D1, D2, D3) is swapped (D1,D0, D3, D2) */ - uint8_t reserved0[1]; /*!< Reserved for future use */ - uint8_t serialNorType; /*!< Serial NOR Flash type: 0/1/2/3 */ - uint8_t needExitNoCmdMode; /*!< Need to exit NoCmd mode before other IP command */ - uint8_t halfClkForNonReadCmd; /*!< Half the Serial Clock for non-read command: true/false */ - uint8_t needRestoreNoCmdMode; /*!< Need to Restore NoCmd mode after IP commmand execution */ - uint32_t blockSize; /*!< Block size */ - uint32_t flashStateCtx; /*!< Flash State Context */ - uint32_t reserve2[10]; /*!< Reserved for future use */ -} flexspi_nor_config_t; - -typedef enum _flexspi_operation -{ - kFLEXSPIOperation_Command, /*!< FLEXSPI operation: Only command, both TX and RX buffer are ignored. */ - kFLEXSPIOperation_Config, /*!< FLEXSPI operation: Configure device mode, the TX FIFO size is fixed in LUT. */ - kFLEXSPIOperation_Write, /*!< FLEXSPI operation: Write, only TX buffer is effective */ - kFLEXSPIOperation_Read, /*!< FLEXSPI operation: Read, only Rx Buffer is effective. */ - kFLEXSPIOperation_End = kFLEXSPIOperation_Read, -} flexspi_operation_t; - -/*! @brief FLEXSPI Transfer Context */ -typedef struct _flexspi_xfer -{ - flexspi_operation_t operation; /*!< FLEXSPI operation */ - uint32_t baseAddress; /*!< FLEXSPI operation base address */ - uint32_t seqId; /*!< Sequence Id */ - uint32_t seqNum; /*!< Sequence Number */ - bool isParallelModeEnable; /*!< Is a parallel transfer */ - uint32_t *txBuffer; /*!< Tx buffer */ - uint32_t txSize; /*!< Tx size in bytes */ - uint32_t *rxBuffer; /*!< Rx buffer */ - uint32_t rxSize; /*!< Rx size in bytes */ -} flexspi_xfer_t; - -/*! @brief - * FLEXSPI Clock Type - */ -typedef enum -{ - kFlexSpiClock_CoreClock, /*!< ARM Core Clock */ - kFlexSpiClock_AhbClock, /*!< AHB clock */ - kFlexSpiClock_SerialRootClock, /*!< Serial Root Clock */ - kFlexSpiClock_IpgClock, /*!< IPG clock */ -} flexspi_clock_type_t; - -#ifdef __cplusplus -extern "C" { -#endif - -uint32_t FLEXSPI_NorFlash_GetVersion(void); -/*! - * @brief Initialize Serial NOR devices via FLEXSPI - * - * This function checks and initializes the FLEXSPI module for the other FLEXSPI APIs. - * - * @param instance storage the instance of FLEXSPI. - * @param config A pointer to the storage for the driver runtime state. - * - * @retval #kStatus_Success Api was executed succesfuly. - * @retval #kStatus_InvalidArgument A invalid argument is provided. - * @retval #kStatus_FLEXSPI_InvalidSequence A invalid Sequence is provided. - * @retval #kStatus_FLEXSPI_SequenceExecutionTimeout Sequence Execution timeout. - * @retval #kStatus_FLEXSPI_DeviceTimeout the device timeout - */ -status_t FLEXSPI_NorFlash_Init(uint32_t instance, flexspi_nor_config_t *config); - -/*! - * @brief Program data to Serial NOR via FLEXSPI. - * - * This function programs the NOR flash memory with the dest address for a given - * flash area as determined by the dst address and the length. - * - * @param instance storage the instance of FLEXSPI. - * @param config A pointer to the storage for the driver runtime state. - * @param dst_addr A pointer to the desired flash memory to be programmed. - * NOTE: - * It is recommended that use page aligned access; - * If the dst_addr is not aligned to page,the driver automatically - * aligns address down with the page address. - * @param src A pointer to the source buffer of data that is to be programmed - * into the NOR flash. - * - * @retval #kStatus_Success Api was executed succesfuly. - * @retval #kStatus_InvalidArgument A invalid argument is provided. - * @retval #kStatus_FLEXSPI_InvalidSequence A invalid Sequence is provided. - * @retval #kStatus_FLEXSPI_SequenceExecutionTimeout Sequence Execution timeout. - * @retval #kStatus_FLEXSPI_DeviceTimeout the device timeout - */ -status_t FLEXSPI_NorFlash_ProgramPage(uint32_t instance, - flexspi_nor_config_t *config, - uint32_t dstAddr, - const uint32_t *src); - -/*! - * @brief Erase all the Serial NOR devices connected on FLEXSPI. - * - * @param instance storage the instance of FLEXSPI. - * @param config A pointer to the storage for the driver runtime state. - * - * @retval #kStatus_Success Api was executed succesfuly. - * @retval #kStatus_InvalidArgument A invalid argument is provided. - * @retval #kStatus_FLEXSPI_InvalidSequence A invalid Sequence is provided. - * @retval #kStatus_FLEXSPI_SequenceExecutionTimeout Sequence Execution timeout. - * @retval #kStatus_FLEXSPI_DeviceTimeout the device timeout - */ -status_t FLEXSPI_NorFlash_EraseAll(uint32_t instance, flexspi_nor_config_t *config); - -/*! - * @brief Erase one sector specified by address - * - * This function erases one of NOR flash sectors based on the desired address. - * - * @param instance storage the index of FLEXSPI. - * @param config A pointer to the storage for the driver runtime state. - * @param address The start address of the desired NOR flash memory to be erased. - * NOTE: - * It is recommended that use sector-aligned access nor device; - * If dstAddr is not aligned with the sector,The driver automatically - * aligns address down with the sector address. - * - * @retval #kStatus_Success Api was executed succesfuly. - * @retval #kStatus_InvalidArgument A invalid argument is provided. - * @retval #kStatus_FLEXSPI_InvalidSequence A invalid Sequence is provided. - * @retval #kStatus_FLEXSPI_SequenceExecutionTimeout Sequence Execution timeout. - * @retval #kStatus_FLEXSPI_DeviceTimeout the device timeout - */ -status_t FLEXSPI_NorFlash_EraseSector(uint32_t instance, flexspi_nor_config_t *config, uint32_t address); - -/*! - * @brief Erase one block specified by address - * - * This function erases one block of NOR flash based on the desired address. - * - * @param instance storage the index of FLEXSPI. - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired NOR flash memory to be erased. - * NOTE: - * It is recommended that use block-aligned access nor device; - * If dstAddr is not aligned with the block,The driver automatically - * aligns address down with the block address. - * - * @retval #kStatus_Success Api was executed succesfuly. - * @retval #kStatus_InvalidArgument A invalid argument is provided. - * @retval #kStatus_FLEXSPI_InvalidSequence A invalid Sequence is provided. - * @retval #kStatus_FLEXSPI_SequenceExecutionTimeout Sequence Execution timeout. - * @retval #kStatus_FLEXSPI_DeviceTimeout the device timeout - */ -status_t FLEXSPI_NorFlash_EraseBlock(uint32_t instance, flexspi_nor_config_t *config, uint32_t address); - -/*! - * @brief Get FLEXSPI NOR Configuration Block based on specified option. - * - * @param instance storage the instance of FLEXSPI. - * @param config A pointer to the storage for the driver runtime state. - * @param option A pointer to the storage Serial NOR Configuration Option Context. - * - * @retval #kStatus_Success Api was executed succesfuly. - * @retval #kStatus_InvalidArgument A invalid argument is provided. - * @retval #kStatus_FLEXSPI_InvalidSequence A invalid Sequence is provided. - * @retval #kStatus_FLEXSPI_SequenceExecutionTimeout Sequence Execution timeout. - * @retval #kStatus_FLEXSPI_DeviceTimeout the device timeout - */ -status_t FLEXSPI_NorFlash_GetConfig(uint32_t instance, - flexspi_nor_config_t *config, - serial_nor_config_option_t *option); - -/*! - * @brief Erase Flash Region specified by address and length - * - * This function erases the appropriate number of flash sectors based on the - * desired start address and length. - * - * @param instance storage the index of FLEXSPI. - * @param config A pointer to the storage for the driver runtime state. - * @param start The start address of the desired NOR flash memory to be erased. - * NOTE: - * It is recommended that use sector-aligned access nor device; - * If dstAddr is not aligned with the sector,the driver automatically - * aligns address down with the sector address. - * @param length The length, given in bytes to be erased. - * NOTE: - * It is recommended that use sector-aligned access nor device; - * If length is not aligned with the sector,the driver automatically - * aligns up with the sector. - * @retval #kStatus_Success Api was executed succesfuly. - * @retval #kStatus_InvalidArgument A invalid argument is provided. - * @retval #kStatus_FLEXSPI_InvalidSequence A invalid Sequence is provided. - * @retval #kStatus_FLEXSPI_SequenceExecutionTimeout Sequence Execution timeout. - * @retval #kStatus_FLEXSPI_DeviceTimeout the device timeout - */ -status_t FLEXSPI_NorFlash_Erase(uint32_t instance, flexspi_nor_config_t *config, uint32_t start, uint32_t length); - -/*! - * @brief Read data from Serial NOR via FLEXSPI. - * - * This function read the NOR flash memory with the start address for a given - * flash area as determined by the dst address and the length. - * - * @param instance storage the instance of FLEXSPI. - * @param config A pointer to the storage for the driver runtime state. - * @param dst A pointer to the dest buffer of data that is to be read from the NOR flash. - * NOTE: - * It is recommended that use page aligned access; - * If the dstAddr is not aligned to page,the driver automatically - * aligns address down with the page address. - * @param start The start address of the desired NOR flash memory to be read. - * @param lengthInBytes The length, given in bytes to be read. - * - * @retval #kStatus_Success Api was executed succesfuly. - * @retval #kStatus_InvalidArgument A invalid argument is provided. - * @retval #kStatus_FLEXSPI_InvalidSequence A invalid Sequence is provided. - * @retval #kStatus_FLEXSPI_SequenceExecutionTimeout Sequence Execution timeout. - * @retval #kStatus_FLEXSPI_DeviceTimeout the device timeout - */ -status_t FLEXSPI_NorFlash_Read( - uint32_t instance, flexspi_nor_config_t *config, uint32_t *dst, uint32_t start, uint32_t bytes); - -/*! - * @brief FLEXSPI command - * - * This function is used to perform the command write sequence to the NOR device. - * - * @param instance storage the index of FLEXSPI. - * @param xfer A pointer to the storage FLEXSPI Transfer Context. - * - * @retval kStatus_Success Api was executed succesfuly. - * @retval kStatus_InvalidArgument A invalid argument is provided. - * @retval kStatus_ROM_FLEXSPI_InvalidSequence A invalid Sequence is provided. - * @retval kStatus_ROM_FLEXSPI_SequenceExecutionTimeout Sequence Execution timeout. - */ -status_t FLEXSPI_NorFlash_CommandXfer(uint32_t instance, flexspi_xfer_t *xfer); - -/*! - * @brief Configure FLEXSPI Lookup table - * - * @param instance storage the index of FLEXSPI. - * @param seqIndex storage the sequence Id. - * @param lutBase A pointer to the look-up-table for command sequences. - * @param seqNumber storage sequence number. - * - * @retval kStatus_Success Api was executed succesfuly. - * @retval kStatus_InvalidArgument A invalid argument is provided. - * @retval kStatus_ROM_FLEXSPI_InvalidSequence A invalid Sequence is provided. - * @retval kStatus_ROM_FLEXSPI_SequenceExecutionTimeout Sequence Execution timeout. - */ -status_t FLEXSPI_NorFlash_UpdateLut(uint32_t instance, uint32_t seqIndex, const uint32_t *lutBase, uint32_t seqNumber); - -/*! - * @brief Set the clock source for FLEXSPI NOR - * - * @param clockSource Clock source for FLEXSPI NOR. See to "_flexspi_nor_clock_source". - * - * @retval #kStatus_Success Api was executed succesfuly. - * @retval #kStatus_InvalidArgument A invalid argument is provided. - */ -status_t FLEXSPI_NorFlash_SetClockSource(uint32_t clockSource); - -/*! - * @brief Configure the FlexSPI clock. - * - *The API is used for configuring the FlexSPI clock. - * - * @param instance storage the index of FLEXSPI. - * @param freqOption storage FlexSPIFlexSPI flash serial clock frequency. - * @param sampleClkMode storage the FlexSPI clock configuration type. - * - * @retval #kStatus_Success Api was executed succesfuly. - * @retval #kStatus_InvalidArgument A invalid argument is provided. - */ -void FLEXSPI_NorFlash_ConfigClock(uint32_t instance, uint32_t freqOption, uint32_t sampleClkMode); - -#ifdef __cplusplus -} -#endif - -#endif /*! FSL_FLEXSPI_NOR_FLASH_H__ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/flash/src/fsl_flash.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/flash/src/fsl_flash.c deleted file mode 100644 index c6450b5a0b7..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/flash/src/fsl_flash.c +++ /dev/null @@ -1,568 +0,0 @@ -/* - * Copyright 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - * - */ - -#include "fsl_flash.h" -#include "fsl_flash_ffr.h" -#include "fsl_flexspi_nor_flash.h" - -/*! @brief Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.flashiap" -#endif - -#define BOOTLOADER_API_TREE_POINTER ((bootloader_tree_t *)0x1303fc00U) - -/*! - * @name flash, ffr, flexspi nor flash Structure - * @{ - */ - -typedef union functionCommandOption -{ - uint32_t commandAddr; - status_t (*isFlashAreaReadable)(flash_config_t *config, uint32_t startAddress, uint32_t lengthInBytes); - status_t (*isFlashAreaModifiable)(flash_config_t *config, uint32_t startAddress, uint32_t lengthInBytes); -} function_command_option_t; - -/*! - * @brief Structure of version property. - * - * @ingroup bl_core - */ -typedef union StandardVersion -{ - struct - { - uint8_t bugfix; /*!< bugfix version [7:0] */ - uint8_t minor; /*!< minor version [15:8] */ - uint8_t major; /*!< major version [23:16] */ - char name; /*!< name [31:24] */ - }; - uint32_t version; /*!< combined version numbers */ -} standard_version_t; - -/*! @brief Interface for the flash driver.*/ -typedef struct FlashDriverInterface -{ - standard_version_t version; /*!< flash driver API version number. */ - /* Flash driver */ - status_t (*flash_init)(flash_config_t *config); - status_t (*flash_erase)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes, uint32_t key); - status_t (*flash_program)(flash_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes); - status_t (*flash_verify_erase)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes); - status_t (*flash_verify_program)(flash_config_t *config, - uint32_t start, - uint32_t lengthInBytes, - const uint8_t *expectedData, - uint32_t *failedAddress, - uint32_t *failedData); - status_t (*flash_get_property)(flash_config_t *config, flash_property_tag_t whichProperty, uint32_t *value); - - const uint32_t reserved0[3]; - - /*!< Flash FFR driver */ - status_t (*ffr_init)(flash_config_t *config); - status_t (*ffr_lock)(flash_config_t *config); - status_t (*ffr_cust_factory_page_write)(flash_config_t *config, uint8_t *page_data, bool seal_part); - status_t (*ffr_get_uuid)(flash_config_t *config, uint8_t *uuid); - status_t (*ffr_get_customer_data)(flash_config_t *config, uint8_t *pData, uint32_t offset, uint32_t len); - status_t (*ffr_cust_keystore_write)(flash_config_t *config, ffr_key_store_t *pKeyStore); - status_t reserved1; - status_t reserved2; - status_t (*ffr_infield_page_write)(flash_config_t *config, uint8_t *page_data, uint32_t valid_len); - status_t (*ffr_get_customer_infield_data)(flash_config_t *config, uint8_t *pData, uint32_t offset, uint32_t len); - status_t (*flash_read)(flash_config_t *config, uint32_t start, uint8_t *dest, uint32_t lengthInBytes); - const uint32_t reserved3; - status_t (*flash_get_cust_keystore)(flash_config_t *config, uint8_t *pData, uint32_t offset, uint32_t len); - status_t (*flash_deinit)(flash_config_t *config); -} flash_driver_interface_t; - -/*! @brief FLEXSPI Flash driver API Interface */ -typedef struct -{ - uint32_t version; - status_t (*init)(uint32_t instance, flexspi_nor_config_t *config); - status_t (*page_program)(uint32_t instance, flexspi_nor_config_t *config, uint32_t dstAddr, const uint32_t *src); - status_t (*erase_all)(uint32_t instance, flexspi_nor_config_t *config); - status_t (*erase)(uint32_t instance, flexspi_nor_config_t *config, uint32_t start, uint32_t length); - status_t (*erase_sector)(uint32_t instance, flexspi_nor_config_t *config, uint32_t address); - status_t (*erase_block)(uint32_t instance, flexspi_nor_config_t *config, uint32_t address); - status_t (*get_config)(uint32_t instance, flexspi_nor_config_t *config, serial_nor_config_option_t *option); - status_t (*read)(uint32_t instance, flexspi_nor_config_t *config, uint32_t *dst, uint32_t start, uint32_t bytes); - status_t (*xfer)(uint32_t instance, flexspi_xfer_t *xfer); - status_t (*update_lut)(uint32_t instance, uint32_t seqIndex, const uint32_t *lutBase, uint32_t numberOfSeq); - status_t (*set_clock_source)(uint32_t clockSrc); - void (*config_clock)(uint32_t instance, uint32_t freqOption, uint32_t sampleClkMode); - status_t (*partial_program)( - uint32_t instance, flexspi_nor_config_t *config, uint32_t dstAddr, const uint32_t *src, uint32_t length); -} flexspi_nor_flash_driver_t; - -/* !@brief EFUSE driver API Interface */ -typedef struct -{ - standard_version_t version; - status_t (*init)(void); - status_t (*deinit)(void); - status_t (*read)(uint32_t addr, uint32_t *data); - status_t (*program)(uint32_t addr, uint32_t data); -} efuse_driver_t; - -/*! @}*/ - -/*! - * @brief Root of the bootloader API tree. - * - * An instance of this struct resides in read-only memory in the bootloader. It - * provides a user application access to APIs exported by the bootloader. - * - * @note The order of existing fields must not be changed. - */ -typedef struct BootloaderTree -{ - void (*runBootloader)(void *arg); /*!< Function to start the bootloader executing.*/ - standard_version_t version; /*!< Bootloader version number.*/ - const char *copyright; /*!< Copyright string.*/ - const uint32_t reserved0; /*!< reserved*/ - const flash_driver_interface_t *flashDriver; /*!< Internal Flash driver API.*/ - const uint32_t reserved1[5]; /*!< reserved*/ - const uint32_t nbootDriver; /*!< Please refer to "fsl_nboot.h" */ - const flexspi_nor_flash_driver_t *flexspiNorDriver; /*!< FlexSPI NOR FLASH Driver API.*/ - const efuse_driver_t *efuseDriver; /*!< eFuse driver API */ - const uint32_t memoryInterface; /*!< Please refer to "fsl_mem_interface.h" */ -} bootloader_tree_t; - -/******************************************************************************* - * Code - ******************************************************************************/ - -/******************************************************************************** - * Internal Flash driver API - *******************************************************************************/ -/*! - * @brief Initializes the global flash properties structure members. - * - * This function checks and initializes the Flash module for the other Flash APIs. - */ -status_t FLASH_Init(flash_config_t *config) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->flash_init(config); -} - -/*! - * @brief De-Initializes the global flash properties structure members. - * - * This API De-initializes the FLASH default parameters and related FLASH clock for the FLASH and FMC. - */ -status_t FLASH_Deinit(flash_config_t *config) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->flash_deinit(config); -} - -/*! - * @brief Erases the flash sectors encompassed by parameters passed into function. - * - * This function erases the appropriate number of flash sectors based on the - * desired start address and length. - */ -status_t FLASH_Erase(flash_config_t *config, uint32_t start, uint32_t lengthInBytes, uint32_t key) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->flash_erase(config, start, lengthInBytes, key); -} - -/*! - * @brief Programs flash with data at locations passed in through parameters. - * - * This function programs the flash memory with the desired data for a given - * flash area as determined by the start address and the length. - */ -status_t FLASH_Program(flash_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->flash_program(config, start, src, lengthInBytes); -} - -/*! - * @brief Verifies an erasure of the desired flash area at a specified margin level. - * - * This function checks the appropriate number of flash sectors based on - * the desired start address and length to check whether the flash is erased - * to the specified read margin level. - */ -status_t FLASH_VerifyErase(flash_config_t *config, uint32_t start, uint32_t lengthInBytes) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->flash_verify_erase(config, start, lengthInBytes); -} - -/*! - * @brief Reads flash at locations passed in through parameters. - * - * This function read the flash memory from a given flash area as determined - * by the start address and the length. - */ -status_t FLASH_Read(flash_config_t *config, uint32_t start, uint8_t *dest, uint32_t lengthInBytes) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->flash_read(config, start, dest, lengthInBytes); -} - -/*! - * @brief Verifies programming of the desired flash area at a specified margin level. - * - * This function verifies the data programed in the flash memory using the - * Flash Program Check Command and compares it to the expected data for a given - * flash area as determined by the start address and length. - */ -status_t FLASH_VerifyProgram(flash_config_t *config, - uint32_t start, - uint32_t lengthInBytes, - const uint8_t *expectedData, - uint32_t *failedAddress, - uint32_t *failedData) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->flash_verify_program(config, start, lengthInBytes, expectedData, - failedAddress, failedData); -} - -/*! - * @brief Returns the desired flash property. - */ -status_t FLASH_GetProperty(flash_config_t *config, flash_property_tag_t whichProperty, uint32_t *value) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->flash_get_property(config, whichProperty, value); -} - -status_t FLASH_GetCustKeyStore(flash_config_t *config, uint8_t *pData, uint32_t offset, uint32_t len) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->flash_get_cust_keystore(config, pData, offset, len); -} - -#if defined(BL_FEATURE_HAS_BUS_CRYPTO_ENGINE) && BL_FEATURE_HAS_BUS_CRYPTO_ENGINE -status_t FLASH_ErasePrologue(flash_config_t *config, uint32_t start, uint32_t lengthInBytes, uint32_t key) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->flash_erase_with_checker(config, start, lengthInBytes, key); -} - -status_t FLASH_ProgramPrologue(flash_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->flash_program_with_checker(config, start, src, lengthInBytes); -} - -status_t FLASH_VerifyProgramPrologue(flash_config_t *config, - uint32_t start, - uint32_t lengthInBytes, - const uint8_t *expectedData, - uint32_t *failedAddress, - uint32_t *failedData) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->flash_verify_program_with_checker( - config, start, lengthInBytes, expectedData, failedAddress, failedData); -} - -#endif // BL_FEATURE_HAS_BUS_CRYPTO_ENGINE - -#if defined(FSL_FEATURE_SYSCON_HAS_FLASH_HIDING) && (FSL_FEATURE_SYSCON_HAS_FLASH_HIDING == 1) -/*! - * @brief Validates the given address range is loaded in the flash hiding region. - */ -status_t FLASH_IsFlashAreaReadable(flash_config_t *config, uint32_t startAddress, uint32_t lengthInBytes) -{ - function_command_option_t runCmdFuncOption; - runCmdFuncOption.commandAddr = 0x130366f9u; - return runCmdFuncOption.isFlashAreaReadable(config, startAddress, lengthInBytes); -} -#endif - -/******************************************************************************** - * fsl iap ffr CODE - *******************************************************************************/ - -/*! - * @brief Initializes the global FFR properties structure members. - */ -status_t FFR_Init(flash_config_t *config) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->ffr_init(config); -} - -/*! - * @brief Enable firewall for all flash banks. - */ -status_t FFR_Lock(flash_config_t *config) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->ffr_lock(config); -} - -/*! - * @brief APIs to access CMPA pages; - * This routine will erase "customer factory page" and program the page with passed data. - */ -status_t FFR_CustFactoryPageWrite(flash_config_t *config, uint8_t *page_data, bool seal_part) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->ffr_cust_factory_page_write(config, page_data, seal_part); -} - -/*! - * @brief See fsl_iap_ffr.h for documentation of this function. - */ -status_t FFR_GetUUID(flash_config_t *config, uint8_t *uuid) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->ffr_get_uuid(config, uuid); -} - -/*! - * @brief APIs to access CMPA pages - * Read data stored in 'Customer Factory CFG Page'. - */ -status_t FFR_GetCustomerData(flash_config_t *config, uint8_t *pData, uint32_t offset, uint32_t len) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->ffr_get_customer_data(config, pData, offset, len); -} - -/*! - * @brief This routine writes the 3 pages allocated for Key store data. - */ -status_t FFR_CustKeystoreWrite(flash_config_t *config, ffr_key_store_t *pKeyStore) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->ffr_cust_keystore_write(config, pKeyStore); -} - -/*! - * @brief APIs to access CFPA pages - * This routine will erase CFPA and program the CFPA page with passed data. - */ -status_t FFR_InfieldPageWrite(flash_config_t *config, uint8_t *page_data, uint32_t valid_len) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->ffr_infield_page_write(config, page_data, valid_len); -} - -/*! - * @brief APIs to access CFPA pages - * Generic read function, used by customer to read data stored in 'Customer In-field Page'. - */ -status_t FFR_GetCustomerInfieldData(flash_config_t *config, uint8_t *pData, uint32_t offset, uint32_t len) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->ffr_get_customer_infield_data(config, pData, offset, len); -} - -/*! - * @brief The API is used for getting the customer key store data from the customer key store region(0x3e400 �C - * 0x3e600), and the API should be called after the FLASH_Init and FFR_Init. - */ -status_t FFR_GetCustKeystoreData(flash_config_t *config, uint8_t *pData, uint32_t offset, uint32_t len) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flashDriver->flash_get_cust_keystore(config, pData, offset, len); -} - -/******************************************************************************** - * FlexSPI NOR FLASH Driver API - *******************************************************************************/ -/*! - * @brief Initialize Serial NOR devices via FLEXSPI. - */ -status_t FLEXSPI_NorFlash_Init(uint32_t instance, flexspi_nor_config_t *config) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flexspiNorDriver->init(instance, config); -} - -/*! - * @brief Program data to Serial NOR via FlexSPI - */ -status_t FLEXSPI_NorFlash_ProgramPage(uint32_t instance, - flexspi_nor_config_t *config, - uint32_t dstAddr, - const uint32_t *src) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flexspiNorDriver->page_program(instance, config, dstAddr, src); -} - -/*! - * @brief Erase all the Serial NOR devices connected on FlexSPI - */ -status_t FLEXSPI_NorFlash_EraseAll(uint32_t instance, flexspi_nor_config_t *config) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flexspiNorDriver->erase_all(instance, config); -} - -/*! - * @brief Erase Flash Region specified by address and length - */ -status_t FLEXSPI_NorFlash_Erase(uint32_t instance, flexspi_nor_config_t *config, uint32_t start, uint32_t length) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flexspiNorDriver->erase(instance, config, start, length); -} - -/*! - * @brief Erase one sector specified by address - */ -status_t FLEXSPI_NorFlash_EraseSector(uint32_t instance, flexspi_nor_config_t *config, uint32_t address) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flexspiNorDriver->erase_sector(instance, config, address); -} - -/*! - * @brief Erase one block specified by address - */ -status_t FLEXSPI_NorFlash_EraseBlock(uint32_t instance, flexspi_nor_config_t *config, uint32_t address) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flexspiNorDriver->erase_block(instance, config, address); -} - -/*! - * @brief Get FlexSPI NOR driver version - */ -uint32_t FLEXSPI_NorFlash_GetVersion(void) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flexspiNorDriver->version; -} - -/*! - * @brief Get FlexSPI NOR Configuration Block based on specified option - */ -status_t FLEXSPI_NorFlash_GetConfig(uint32_t instance, flexspi_nor_config_t *config, serial_nor_config_option_t *option) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flexspiNorDriver->get_config(instance, config, option); -} - -/*! - * @brief Read data from Serial NOR - */ -status_t FLEXSPI_NorFlash_Read( - uint32_t instance, flexspi_nor_config_t *config, uint32_t *dst, uint32_t start, uint32_t bytes) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flexspiNorDriver->read(instance, config, dst, start, bytes); -} - -/*! - * @brief Perform FlexSPI command - */ -status_t FLEXSPI_NorFlash_CommandXfer(uint32_t instance, flexspi_xfer_t *xfer) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flexspiNorDriver->xfer(instance, xfer); -} - -/*! - * @brief Configure FlexSPI Lookup table - */ -status_t FLEXSPI_NorFlash_UpdateLut(uint32_t instance, uint32_t seqIndex, const uint32_t *lutBase, uint32_t seqNumber) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flexspiNorDriver->update_lut(instance, seqIndex, lutBase, seqNumber); -} - -/*! - * @brief Set flexspi clock source - */ -status_t FLEXSPI_NorFlash_SetClockSource(uint32_t clockSource) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->flexspiNorDriver->set_clock_source(clockSource); -} - -/*! - * @brief config flexspi clock - */ -void FLEXSPI_NorFlash_ConfigClock(uint32_t instance, uint32_t freqOption, uint32_t sampleClkMode) -{ - assert(BOOTLOADER_API_TREE_POINTER); - BOOTLOADER_API_TREE_POINTER->flexspiNorDriver->config_clock(instance, freqOption, sampleClkMode); -} - -/******************************************************************************** - * EFUSE driver API - *******************************************************************************/ - -/*! - * @brief Initialize EFUSE controller. - */ -status_t EFUSE_Init(void) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->efuseDriver->init(); -} - -/*! - * @brief De-Initialize EFUSE controller. - */ -status_t EFUSE_Deinit(void) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->efuseDriver->deinit(); -} - -/*! - * @brief Read Fuse value from eFuse word. - */ -status_t EFUSE_Read(uint32_t addr, uint32_t *data) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->efuseDriver->read(addr, data); -} - -/*! - * @brief Program value to eFuse block. - */ -status_t EFUSE_Program(uint32_t addr, uint32_t data) -{ - assert(BOOTLOADER_API_TREE_POINTER); - status_t status; - bool is_hvd_enabled = false; - - /* Workaround for ROM Errata ERR052108 */ - /* Disable SYS_HVD */ - if (0U != (SPC0->ACTIVE_CFG & SPC_ACTIVE_CFG_SYS_HVDE_MASK)) - { - is_hvd_enabled = true; - SPC0->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_SYS_HVDE_MASK; - } - - /* Call ROM API to program efuse */ - status = BOOTLOADER_API_TREE_POINTER->efuseDriver->program(addr, data); - - /* Bring VDD_SYS back to 1.8v */ - SPC0->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_SYSLDO_VDD_LVL_MASK; - - /* Wait for voltage to settle */ - SDK_DelayAtLeastUs(5000U, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY); - - /* Enable SYS_HVD back */ - if (is_hvd_enabled) - { - SPC0->ACTIVE_CFG |= SPC_ACTIVE_CFG_SYS_HVDE_MASK; - } - - return status; -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/mem_interface/fsl_mem_interface.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/mem_interface/fsl_mem_interface.h deleted file mode 100644 index 98147b6baf3..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/mem_interface/fsl_mem_interface.h +++ /dev/null @@ -1,379 +0,0 @@ -/* - * Copyright 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_MEM_INTERFACE_H_ -#define FSL_MEM_INTERFACE_H_ - -#include "fsl_sbloader.h" -#include "fsl_common.h" - -/*! - * @addtogroup memory_interface - * @{ - */ -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @brief Bit mask for device ID. */ -#define DEVICE_ID_MASK (0xffU) -/*! @brief Bit position of device ID. */ -#define DEVICE_ID_SHIFT 0U -/*! @brief Bit mask for group ID. */ -#define GROUP_ID_MASK (0xf00U) -/*! @brief Bit position of group ID. */ -#define GROUP_ID_SHIFT 8U - -/*! @brief Construct a memory ID from a given group ID and device ID. */ -#define MAKE_MEMORYID(group, device) \ - ((((group) << GROUP_ID_SHIFT) & GROUP_ID_MASK) | (((device) << DEVICE_ID_SHIFT) & DEVICE_ID_MASK)) -/*! @brief Get group ID from a given memory ID. */ -#define GROUPID(memoryId) (((memoryId)&GROUP_ID_MASK) >> GROUP_ID_SHIFT) - -/*! @brief Get device ID from a given memory ID. */ -#define DEVICEID(memoryId) (((memoryId)&DEVICE_ID_MASK) >> DEVICE_ID_SHIFT) - -/*! @brief Memory group definition. */ -enum -{ - kMemoryGroup_Internal = 0U, /*!< Memory belongs internal 4G memory region. */ - kMemoryGroup_External = 1U, /*!< Memory belongs external memory region. */ -}; - -/*! @brief Memory device ID definition. */ -enum -{ - /* Memory ID bitfiled definition. - | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | - | Reserved | INT/EXT | Type | Sub-Type | - | | 0: INT | INT: | | - | | 1: EXT | 0: NorFlash0 | 0: Internal Flash(FTFX) | - | | | | 1: QSPI | - | | | | 4: IFR | - | | | | 5: LPC FFR | - | | | | 8: SEMC | - | | | | 9: FlexSPI | - | | | | others: Unused | - | | | | | - | | | 1: ExecuteOnlyRegion | 0: Internal Flash(FTFX) | - | | | | others: Unused | - | | | | | - | | | others: Unused | | - | | | | | - | | | EXT: | | - | | | 0: NandFlash | 0: SEMC | - | | | | 1: FlexSPI | - | | | | others: Unused | - | | | | | - | | | 1: NorFlash/EEPROM | 0: LPSPI | - | | | | 1: LPI2C | - | | | | others: Unused | - | | | | | - | | | 2: SD/SDHC/SDXC/MMC/eMMC | 0: uSDHC SD | - | | | | 1: uSDHC MMC | - | | | | others: Unused | - | | | others: Unused | | - - INT : Internal 4G memory, including internal memory modules, and XIP external memory modules. - EXT : Non-XIP external memory modules. - */ - kMemoryInternal = MAKE_MEMORYID(kMemoryGroup_Internal, 0U), /*!< Internal memory (include all on chip memory) */ - kMemoryQuadSpi0 = MAKE_MEMORYID(kMemoryGroup_Internal, 1U), /*!< Qsuad SPI memory 0 */ - kMemoryIFR0 = - MAKE_MEMORYID(kMemoryGroup_Internal, 4U), /*!< Nonvolatile information register 0. Only used by SB loader. */ - kMemoryFFR = MAKE_MEMORYID(kMemoryGroup_Internal, 5U), /*!< LPCc040hd flash FFR region. */ - kMemorySemcNor = MAKE_MEMORYID(kMemoryGroup_Internal, 8U), /*!< SEMC Nor memory */ - kMemoryFlexSpiNor = MAKE_MEMORYID(kMemoryGroup_Internal, 9U), /*!< Flex SPI Nor memory */ - kMemorySpifiNor = MAKE_MEMORYID(kMemoryGroup_Internal, 0xAU), /*!< SPIFI Nor memory */ - kMemoryFlashExecuteOnly = MAKE_MEMORYID(kMemoryGroup_Internal, 0x10U), /*!< Execute-only region on internal Flash */ - - kMemorySemcNand = MAKE_MEMORYID(kMemoryGroup_External, 0U), /*!< SEMC NAND memory */ - kMemorySpiNand = MAKE_MEMORYID(kMemoryGroup_External, 1U), /*!< SPI NAND memory */ - kMemorySpiNorEeprom = MAKE_MEMORYID(kMemoryGroup_External, 0x10U), /*!< SPI NOR/EEPROM memory */ - kMemoryI2cNorEeprom = MAKE_MEMORYID(kMemoryGroup_External, 0x11U), /*!< I2C NOR/EEPROM memory */ - kMemorySDCard = MAKE_MEMORYID(kMemoryGroup_External, 0x20U), /*!< eSD, SD, SDHC, SDXC memory Card */ - kMemoryMMCCard = MAKE_MEMORYID(kMemoryGroup_External, 0x21U), /*!< MMC, eMMC memory Card */ -}; - -/*! @brief Bootloader status group numbers. - * - * @ingroup bl_core - */ -enum -{ - kStatusGroup_Bootloader = 100, /*!< Bootloader status group number (100). */ - kStatusGroup_MemoryInterface = 102, /*!< Memory interface status group number (102). */ -}; - -/*! @brief Memory interface status codes. */ -enum -{ - kStatusMemoryRangeInvalid = MAKE_STATUS(kStatusGroup_MemoryInterface, 0), - kStatusMemoryReadFailed = MAKE_STATUS(kStatusGroup_MemoryInterface, 1), - kStatusMemoryWriteFailed = MAKE_STATUS(kStatusGroup_MemoryInterface, 2), - kStatusMemoryCumulativeWrite = MAKE_STATUS(kStatusGroup_MemoryInterface, 3), - kStatusMemoryAppOverlapWithExecuteOnlyRegion = MAKE_STATUS(kStatusGroup_MemoryInterface, 4), - kStatusMemoryNotConfigured = MAKE_STATUS(kStatusGroup_MemoryInterface, 5), - kStatusMemoryAlignmentError = MAKE_STATUS(kStatusGroup_MemoryInterface, 6), - kStatusMemoryVerifyFailed = MAKE_STATUS(kStatusGroup_MemoryInterface, 7), - kStatusMemoryWriteProtected = MAKE_STATUS(kStatusGroup_MemoryInterface, 8), - kStatusMemoryAddressError = MAKE_STATUS(kStatusGroup_MemoryInterface, 9), - kStatusMemoryBlankCheckFailed = MAKE_STATUS(kStatusGroup_MemoryInterface, 10), - kStatusMemoryBlankPageReadDisallowed = MAKE_STATUS(kStatusGroup_MemoryInterface, 11), - kStatusMemoryProtectedPageReadDisallowed = MAKE_STATUS(kStatusGroup_MemoryInterface, 12), - kStatusMemoryFfrSpecRegionWriteBroken = MAKE_STATUS(kStatusGroup_MemoryInterface, 13), - kStatusMemoryUnsupportedCommand = MAKE_STATUS(kStatusGroup_MemoryInterface, 14), -}; - -/*! @brief Bootloader status codes. */ -enum -{ - kStatus_UnknownCommand = MAKE_STATUS(kStatusGroup_Bootloader, 0), - kStatus_SecurityViolation = MAKE_STATUS(kStatusGroup_Bootloader, 1), - kStatus_AbortDataPhase = MAKE_STATUS(kStatusGroup_Bootloader, 2), - kStatus_Ping = MAKE_STATUS(kStatusGroup_Bootloader, 3), - kStatus_NoResponse = MAKE_STATUS(kStatusGroup_Bootloader, 4), - kStatus_NoResponseExpected = MAKE_STATUS(kStatusGroup_Bootloader, 5), - kStatus_CommandUnsupported = MAKE_STATUS(kStatusGroup_Bootloader, 6), -}; - -/*! - * @brief Interface to memory operations. - * - * This is the main abstract interface to all memory operations. - */ -typedef struct -{ - status_t (*init)(void); - status_t (*read)(uint32_t address, uint32_t length, uint8_t *buffer, uint32_t memoryId); - status_t (*write)(uint32_t address, uint32_t length, const uint8_t *buffer, uint32_t memoryId); - status_t (*fill)(uint32_t address, uint32_t length, uint32_t pattern); - status_t (*flush)(void); - status_t (*finalize)(void); - status_t (*erase)(uint32_t address, uint32_t length, uint32_t memoryId); -} memory_interface_t; - -/*! @brief Interface to memory operations for one region of memory. */ -typedef struct -{ - status_t (*init)(void); - status_t (*read)(uint32_t address, uint32_t length, uint8_t *buffer); - status_t (*write)(uint32_t address, uint32_t length, const uint8_t *buffer); - status_t (*fill)(uint32_t address, uint32_t length, uint32_t pattern); - status_t (*flush)(void); - status_t (*erase)(uint32_t address, uint32_t length); - status_t (*config)(uint32_t *buffer); - status_t (*erase_all)(void); -} memory_region_interface_t; - -//! @brief Structure of a memory map entry. -typedef struct -{ - uint32_t startAddress; - uint32_t endAddress; - uint32_t memoryProperty; - uint32_t memoryId; - const memory_region_interface_t *memoryInterface; -} memory_map_entry_t; - -/*! @brief Structure of version property. */ -typedef union StandardVersion -{ - struct - { - uint8_t bugfix; /*!< bugfix version [7:0] */ - uint8_t minor; /*!< minor version [15:8] */ - uint8_t major; /*!< major version [23:16] */ - char name; /*!< name [31:24] */ - }; - uint32_t version; /*!< combined version numbers */ -} standard_version_t; - -/*! @brief API initialization data structure */ -typedef struct kb_api_parameter_struct -{ - uint32_t allocStart; - uint32_t allocSize; -} kp_api_init_param_t; - -#ifdef __cplusplus -extern "C" { -#endif - -/******************************************************************************* - * API - ******************************************************************************/ - -standard_version_t API_Version(void); - -/*! @brief Initialize the IAP API runtime environment */ -status_t API_Init(api_core_context_t *coreCtx, const kp_api_init_param_t *param); - -/*! @brief Deinitialize the IAP API runtime environment */ -status_t API_Deinit(api_core_context_t *coreCtx); - -/*! - * @brief Initialize memory interface. - * - * @retval #kStatus_Fail - * @retval #kStatus_Success - */ -status_t MEM_Init(api_core_context_t *coreCtx); - -/*! - * @brief Configure memory interface - * - * @param config A pointer to the storage for the driver runtime state. - * @param memoryId Indicates the index of the memory type. Please refer to "Memory group definition" - - * @retval #kStatus_Success - * @retval #kStatus_CommandUnsupported - * @retval #kStatus_InvalidArgument - * @retval #kStatus_FLASH_ModifyProtectedAreaDisallowed - * @retval #kStatusMemoryRangeInvalid - * @retval #kStatus_Fail - * @retval #kStatus_OutOfRange - * @retval #kStatus_SPI_BaudrateNotSupport -*/ -status_t MEM_Config(api_core_context_t *coreCtx, uint32_t *config, uint32_t memoryId); - -/*! - * @brief Write memory. - * - * @param address The start address of the desired flash memory to be programmed. - For internal flash the address need to be 512bytes-aligned. - * @param length Number of bytes to be programmed. - * @param buffer A pointer to the source buffer of data that is to be programmed into the flash. - * @param memoryId Indicates the index of the memory type. Please refer to "Memory group definition" - * - * @retval #kStatus_Success - * @retval #kStatus_Fail - * @retval #kStatusMemoryRangeInvalid - * @retval #kStatus_CommandUnsupported - * @retval #kStatus_FLASH_AlignmentError - * @retval #kStatusMemoryCumulativeWrite - * @retval #kStatus_FLASH_InvalidArgument - * @retval #kStatus_FLASH_AddressError - * @retval #kStatus_FLASH_ModifyProtectedAreaDisallowed - * @retval #kStatus_FLASH_CommandFailure - * @retval #kStatus_FLASH_CommandNotSupported - * @retval #kStatus_FLASH_EccError - * @retval #kStatus_FLASH_RegulationLoss - * @retval #kStatus_FLASH_Success - * @retval #kStatus_FLASH_ReadHidingAreaDisallowed - * @retval #kStatus_FLASH_CompareError - * @retval #kStatusMemoryNotConfigured - * @retval #kStatusMemoryVerifyFailed - */ -status_t MEM_Write( - api_core_context_t *coreCtx, uint32_t start, uint32_t lengthInBytes, const uint8_t *buf, uint32_t memoryId); - -/*! - * @brief Fill memory with a word pattern. - * - * @param address The start address of the desired flash memory to be programmed. - * For internal flash the address need to be 512bytes-aligned. - * @param length Number of bytes to be programmed. - * @param pattern The data to be written into the specified memory area. - * - * @retval #kStatus_CommandUnsupported - * @retval #kStatus_Success - * @retval #kStatus_FLASH_AlignmentError - * @retval #kStatusMemoryCumulativeWrite - * @retval #kStatus_Fail - * @retval #kStatus_FLASH_InvalidArgument - * @retval #kStatus_FLASH_AddressError - * @retval #kStatus_FLASH_Success - * @retval #kStatus_FLASH_ModifyProtectedAreaDisallowed - * @retval #kStatus_FLASH_CommandFailure - * @retval #kStatus_FLASH_CommandNotSupported - * @retval #kStatus_FLASH_EccError - * @retval #kStatus_FLASH_RegulationLoss - * @retval #kStatus_FLASH_ReadHidingAreaDisallowed - */ -status_t MEM_Fill( - api_core_context_t *coreCtx, uint32_t start, uint32_t lengthInBytes, uint32_t pattern, uint32_t memoryId); - -/*! - * @brief Flush memory. - * - * @retval #kStatus_Success - * @retval #kStatus_Fail - * @retval #kStatusMemoryCumulativeWrite - * @retval #kStatus_FLASH_InvalidArgument - * @retval #kStatus_FLASH_AlignmentError - * @retval #kStatus_FLASH_Success - * @retval #kStatus_FLASH_AddressError - * @retval #kStatus_FLASH_ModifyProtectedAreaDisallowed - * @retval #kStatus_FLASH_CommandFailure - * @retval #kStatus_FLASH_CommandNotSupported - * @retval #kStatus_FLASH_EccError - * @retval #kStatus_FLASH_RegulationLoss - * @retval #kStatus_FLASH_ReadHidingAreaDisallowed - * @retval #kStatusMemoryVerifyFailed - */ -status_t MEM_Flush(api_core_context_t *coreCtx); - -/*! - * @brief Erase memory. - * - * @param address The start address of the desired flash memory to be erased. - * @param length Number of bytes to be read. - * @param memoryId Indicates the index of the memory type. Please refer to "Memory group definition" - * - * @retval #kStatus_Success - * @retval #kStatusMemoryRangeInvalid - * @retval #kStatusMemoryAddressError - * @retval #kStatus_FLASH_InvalidArgument - * @retval #kStatus_FLASH_AlignmentError - * @retval #kStatus_FLASH_Success - * @retval #kStatus_FLASH_AddressError - * @retval #kStatus_FLASH_EraseKeyError - * @retval #kStatus_FLASH_ModifyProtectedAreaDisallowed - * @retval #kStatus_Fail - * @retval #kStatus_FLASH_CommandFailure - * @retval #kStatus_FLASH_CommandNotSupported - * @retval #kStatus_FLASH_EccError - * @retval #kStatus_FLASH_RegulationLoss - * @retval #kStatusMemoryNotConfigured - * @retval #kStatusMemoryVerifyFailed - - */ -status_t MEM_Erase(api_core_context_t *coreCtx, uint32_t start, uint32_t lengthInBytes, uint32_t memoryId); - -/*! - * @brief Erase entire memory based on memoryId - * - * @param memoryId Indicates the index of the memory type. Please refer to "Memory group definition" - * - * @retval #kStatus_Success - * @retval #kStatus_Fail - * @retval #kStatus_CommandUnsupported - * @retval #kStatus_FLASH_InvalidArgument - * @retval #kStatus_FLASH_AlignmentError - * @retval #kStatus_FLASH_Success - * @retval #kStatus_FLASH_AddressError - * @retval #kStatus_FLASH_EraseKeyError - * @retval #kStatus_FLASH_CommandFailure - * @retval #kStatus_FLASH_CommandNotSupported - * @retval #kStatus_FLASH_EccError - * @retval #kStatus_FLASH_RegulationLoss - * @retval #kStatus_FLASH_ModifyProtectedAreaDisallowed - * @retval #kStatusMemoryVerifyFailed - * @retval #kStatusMemoryNotConfigured - * @retval #kStatus_InvalidArgument - */ -status_t MEM_EraseAll(api_core_context_t *coreCtx, uint32_t memoryId); - -#ifdef __cplusplus -} -#endif - -/** - * @} - */ - -#endif /* FSL_MEM_INTERFACE_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/mem_interface/fsl_sbloader.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/mem_interface/fsl_sbloader.h deleted file mode 100644 index 1f2f14bee7f..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/mem_interface/fsl_sbloader.h +++ /dev/null @@ -1,373 +0,0 @@ -/* - * Copyright 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_SBLOADER_H_ -#define FSL_SBLOADER_H_ - -#include "fsl_flash.h" -#include "fsl_flexspi_nor_flash.h" -#include "fsl_sbloader_v3.h" -#include "fsl_common.h" -/*! - * @addtogroup sbloader - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/*! @brief Determines the version of SB loader implementation (1: sb1.0; 2: sb2.0; 3.1: sb3.1) */ -#define SB_FILE_MAJOR_VERSION (3) -#define SB_FILE_MINOR_VERSION (1) - -/*! @brief Bootloader status group numbers */ -#define kStatusGroup_SBLoader (101U) - -/*! @brief Contiguous RAM region count */ -#define RAM_REGION_COUNT (2U) - -/*! @brief Contiguous FLASH region count */ -#define FLASH_REGION_COUNT (1U) - -/*! @brief Contiguous FFR region count */ -#define FFR_REGION_COUNT (1U) - -/*! @brief Memory Interface count */ -#define MEM_INTERFACE_COUNT (4U) - -/*! @brief Contiguous FLEXSPINOR meomry count */ -#define FLEXSPINOR_REGION_COUNT (1U) - -/*! @brief SB loader status codes.*/ -enum -{ - kStatusRomLdrSectionOverrun = MAKE_STATUS(kStatusGroup_SBLoader, 0), - kStatusRomLdrSignature = MAKE_STATUS(kStatusGroup_SBLoader, 1), - kStatusRomLdrSectionLength = MAKE_STATUS(kStatusGroup_SBLoader, 2), - kStatusRomLdrUnencryptedOnly = MAKE_STATUS(kStatusGroup_SBLoader, 3), - kStatusRomLdrEOFReached = MAKE_STATUS(kStatusGroup_SBLoader, 4), - kStatusRomLdrChecksum = MAKE_STATUS(kStatusGroup_SBLoader, 5), - kStatusRomLdrCrc32Error = MAKE_STATUS(kStatusGroup_SBLoader, 6), - kStatusRomLdrUnknownCommand = MAKE_STATUS(kStatusGroup_SBLoader, 7), - kStatusRomLdrIdNotFound = MAKE_STATUS(kStatusGroup_SBLoader, 8), - kStatusRomLdrDataUnderrun = MAKE_STATUS(kStatusGroup_SBLoader, 9), - kStatusRomLdrJumpReturned = MAKE_STATUS(kStatusGroup_SBLoader, 10), - kStatusRomLdrCallFailed = MAKE_STATUS(kStatusGroup_SBLoader, 11), - kStatusRomLdrKeyNotFound = MAKE_STATUS(kStatusGroup_SBLoader, 12), - kStatusRomLdrSecureOnly = MAKE_STATUS(kStatusGroup_SBLoader, 13), - kStatusRomLdrResetReturned = MAKE_STATUS(kStatusGroup_SBLoader, 14), - - kStatusRomLdrRollbackBlocked = MAKE_STATUS(kStatusGroup_SBLoader, 15), - kStatusRomLdrInvalidSectionMacCount = MAKE_STATUS(kStatusGroup_SBLoader, 16), - kStatusRomLdrUnexpectedCommand = MAKE_STATUS(kStatusGroup_SBLoader, 17), - kStatusRomLdrBadSBKEK = MAKE_STATUS(kStatusGroup_SBLoader, 18), - kStatusRomLdrPendingJumpCommand = MAKE_STATUS(kStatusGroup_SBLoader, 19), -}; - -/*! - * @brief Defines the number of bytes in a cipher block (chunk). This is dictated by - * the encryption algorithm. - */ -#define BYTES_PER_CHUNK 16 - -#define SB_SECTION_COUNT_MAX 8 - -/*! @brief Boot image signature in 32-bit little-endian format "PMTS" */ -#define BOOT_SIGNATURE 0x504d5453 - -/*! @brief Boot image signature in 32-bit little-endian format "ltgs" */ -#define BOOT_SIGNATURE2 0x6c746773 - -/*! @brief These define file header flags */ -#define FFLG_DISPLAY_PROGRESS 0x0001 - -/*! @brief These define section header flags */ -#define SFLG_SECTION_BOOTABLE 0x0001 - -/*! @brief These define boot command flags */ -#define CFLG_LAST_TAG 0x01 - -/*! @brief ROM_ERASE_CMD flags */ -#define ROM_ERASE_ALL_MASK 0x01 -#define ROM_ERASE_ALL_UNSECURE_MASK 0x02 - -/*! @brief ROM_JUMP_CMD flags */ -#define ROM_JUMP_SP_MASK 0x02 - -/*! @brief Memory device id shift at sb command flags */ -#define ROM_MEM_DEVICE_ID_SHIFT 0x8 - -/*! @brief Memory device id mask */ -#define ROM_MEM_DEVICE_ID_MASK 0xff00 - -/*! @brief Memory group id shift at sb command flags */ -#define ROM_MEM_GROUP_ID_SHIFT 0x4 - -/*! @brief Memory group id flags mask */ -#define ROM_MEM_GROUP_ID_MASK 0xf0 - -/*! @brief ROM_PROG_CMD flags */ -#define ROM_PROG_8BYTE_MASK 0x01 - -/*! @brief These define the boot command tags */ -#define ROM_NOP_CMD 0x00 -#define ROM_TAG_CMD 0x01 -#define ROM_LOAD_CMD 0x02 -#define ROM_FILL_CMD 0x03 -#define ROM_JUMP_CMD 0x04 -#define ROM_CALL_CMD 0x05 -#define ROM_MODE_CMD 0x06 -#define ROM_ERASE_CMD 0x07 -#define ROM_RESET_CMD 0x08 -#define ROM_MEM_ENABLE_CMD 0x09 -#define ROM_PROG_CMD 0x0a -#define ROM_FW_VER_CHK 0x0b - -#if SB_FILE_MAJOR_VERSION == 2 -#define SBLOADER_CMD_SET_IN_ISP_MODE (SBLOADER_V2_CMD_SET_IN_ISP_MODE) -#define SBLOADER_CMD_SET_IN_REC_MODE (SBLOADER_V2_CMD_SET_IN_REC_MODE) -#elif SB_FILE_MAJOR_VERSION == 3 -#define SBLOADER_CMD_SET_IN_ISP_MODE (SBLOADER_V3_CMD_SET_IN_ISP_MODE) -#define SBLOADER_CMD_SET_IN_REC_MODE (SBLOADER_V3_CMD_SET_IN_REC_MODE) -#endif - -/*! @brief Plugin return codes */ -#define ROM_BOOT_SECTION_ID 1 -#define ROM_BOOT_IMAGE_ID 2 - -enum _fw_version_check_option -{ - kRomLdr_FwCheckOption_SecureVersion = 0x0U, - kRomLdr_FwCheckOption_NonSecureVersion = 0x1U, -}; - -typedef uint8_t chunk_t[BYTES_PER_CHUNK]; - -/*! @brief Boot command definition */ -typedef struct _boot_cmd -{ - uint8_t checksum; /*!< 8-bit checksum over command chunk */ - uint8_t tag; /*!< command tag (identifier) */ - uint16_t flags; /*!< command flags (modifier) */ - uint32_t address; /*!< address argument */ - uint32_t count; /*!< count argument */ - uint32_t data; /*!< data argument */ -} boot_cmd_t; - -/*! @brief Definition for boot image file header chunk 1 */ -typedef struct _boot_hdr1 -{ - uint32_t hash; /*!< last 32-bits of SHA-1 hash */ - uint32_t signature; /*!< must equal "STMP" */ - uint8_t major; /*!< major file format version */ - uint8_t minor; /*!< minor file format version */ - uint16_t fileFlags; /*!< global file flags */ - uint32_t fileChunks; /*!< total chunks in the file */ -} boot_hdr1_t; - -/*! @brief Definition for boot image file header chunk 2 */ -typedef struct _boot_hdr2 -{ - uint32_t bootOffset; /*!< chunk offset to the first boot section */ - uint32_t bootSectID; /*!< section ID of the first boot section */ - uint16_t keyCount; /*!< number of keys in the key dictionary */ - uint16_t keyOffset; /*!< chunk offset to the key dictionary */ - uint16_t hdrChunks; /*!< number of chunks in the header */ - uint16_t sectCount; /*!< number of sections in the image */ -} boot_hdr2_t; - -/*! @brief Provides forward reference to the loader context definition. */ -typedef struct _ldr_Context ldr_Context_t; - -/*! @brief Function pointer definition for all loader action functions. */ -typedef status_t (*pLdrFnc_t)(ldr_Context_t *context); - -/*! @brief Jump command function pointer definition. */ -typedef status_t (*pJumpFnc_t)(uint32_t parameter); - -/*! @brief Call command function pointer definition. */ -typedef status_t (*pCallFnc_t)(uint32_t parameter, uint32_t *func); - -/*! @brief State information for the CRC32 algorithm. */ -typedef struct Crc32Data -{ - uint32_t currentCrc; /*!< Current CRC value. */ - uint32_t byteCountCrc; /*!< Number of bytes processed. */ -} crc32_data_t; - -/*! @brief Loader context definition. */ -struct _ldr_Context -{ - pLdrFnc_t Action; /*!< pointer to loader action function */ - uint32_t fileChunks; /*!< chunks remaining in file */ - uint32_t sectChunks; /*!< chunks remaining in section */ - uint32_t bootSectChunks; /*!< number of chunks we need to complete the boot section */ - uint32_t receivedChunks; /*!< number of chunks we need to complete the boot section */ - uint16_t fileFlags; /*!< file header flags */ - uint16_t keyCount; /*!< number of keys in the key dictionary */ - uint32_t objectID; /*!< ID of the current boot section or image */ - crc32_data_t crc32; /*!< crc calculated over load command payload */ - uint8_t *src; /*!< source buffer address */ - chunk_t initVector; /*!< decryption initialization vector */ - chunk_t dek; /*!< chunk size DEK if the image is encrypted */ - chunk_t scratchPad; /*!< chunk size scratch pad area */ - boot_cmd_t bootCmd; /*!< current boot command */ - uint32_t skipCount; /*!< Number of chunks to skip */ - bool skipToEnd; /*!< true if skipping to end of file */ - - // extended for SB 2.0 - uint32_t nonce[4]; - uint32_t keyBlobBlock; - uint32_t keyBlobBlockCount; - uint8_t *keyBlobBuffer; - uint32_t offsetSignatureBytes; /*!< offset to signagure block header in bytesn */ - uint8_t *headerBuffer; -}; - -typedef struct soc_memory_map_struct -{ - struct - { - uint32_t start; - uint32_t end; - } ramRegions[RAM_REGION_COUNT]; - struct - { - uint32_t start; - uint32_t end; - } flashRegions[FLASH_REGION_COUNT]; - struct - { - uint32_t start; - uint32_t end; - } ffrRegions[FFR_REGION_COUNT]; - struct - { - uint32_t start; - uint32_t end; - } flexspiNorRegions[FLEXSPINOR_REGION_COUNT]; -} soc_mem_regions_t; - -typedef struct arena_context -{ - uint32_t start; - uint32_t end; - uint32_t nextAddr; -} arena_context_t; - -/*! @brief Memory region information table */ -typedef struct mem_region -{ - uint32_t start; - uint32_t end; -} mem_region_t; - -/*! @brief Memory Attribute Structure */ -typedef struct memory_attribute_struct -{ - uint32_t memId; - uint32_t regionCount; - mem_region_t *memRegions; - void *context; -} mem_attribute_t; - -/*! @brief Memory context structure */ -typedef struct memory_context_struct -{ - status_t (*flush)(mem_attribute_t *attr); - mem_attribute_t *attr; -} mem_context_t; - -/*! @brief Memory region interface structure */ -typedef struct api_memory_region_interface -{ - status_t (*init)(mem_attribute_t *attr); -#if (defined(ROM_API_HAS_FEATURE_MEM_READ) && ROM_API_HAS_FEATURE_MEM_READ) - status_t (*read)(mem_attribute_t *attr, uint32_t addr, uint32_t leth, uint8_t *buf); -#endif - status_t (*write)(mem_attribute_t *attr, uint32_t addr, uint32_t len, const uint8_t *buf); - status_t (*fill)(mem_attribute_t *attr, uint32_t addr, uint32_t len, uint32_t pattern); - status_t (*flush)(mem_attribute_t *attr); - status_t (*erase)(mem_attribute_t *attr, uint32_t addr, uint32_t len); - status_t (*config)(mem_attribute_t *attr, uint32_t *buf); - status_t (*erase_all)(mem_attribute_t *attr); - status_t (*alloc_ctx)(arena_context_t *ctx, mem_attribute_t *attr, void *miscParams); -} api_memory_region_interface_t; - -/*! @brief Memory entry data structure */ -typedef struct memory_map_entry -{ - mem_attribute_t *memoryAttribute; - const api_memory_region_interface_t *memoryInterface; -} api_memory_map_entry_t; - -/*! @brief The API context structure */ -typedef struct api_core_context -{ - soc_mem_regions_t memRegions; - arena_context_t arenaCtx; - flash_config_t flashConfig; - flexspi_nor_config_t flexspinorCfg; - mem_context_t memCtx; - ldr_Context_v3_t *sbloaderCtx; - nboot_context_t *nbootCtx; - uint8_t *sharedBuf; - api_memory_map_entry_t memEntries[MEM_INTERFACE_COUNT]; -} api_core_context_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif /* _cplusplus */ - -/*! - * @brief Perform the Sbloader runtime environment initialization - * This API is used for initializing the sbloader state machine before calling - * the api_sbloader_pump. This API should be called after the iap_api_init API. - * - * @param ctx Pointer to IAP API core context structure. - * - * @retval #kStatus_Success Api was executed succesfuly. - */ -status_t Sbloader_Init(api_core_context_t *ctx); - -/*! - * @brief Handle the SB data stream - * This API is used for handling the secure binary(SB3.1 format) data stream, - * which is used for image update, lifecycle advancing, etc. - * This API should be called after the iap_api_init and api_sbloader_init APIs. - - * @param ctx Pointer to IAP API core context structure. - * @param data Pointer to source data that is the sb file buffer data. - * @param length The size of the process buffer data. - * - * @retval #kStatus_Success Api was executed succesfuly. - * @retval #kStatus_InvalidArgument An invalid argument is provided. - * @retval #kStatus_Fail API execution failed. - */ -status_t Sbloader_Pump(api_core_context_t *ctx, uint8_t *data, uint32_t length); - -/*! - * @brief Finish the sbloader handling - * The API is used for finalizing the sbloader operations. - * - * @param ctx Pointer to IAP API core context structure. - * - * @retval #kStatus_Success Api was executed succesfuly. - */ -status_t Sbloader_Finalize(api_core_context_t *ctx); - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ - -#endif /* FSL_SBLOADER_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/mem_interface/fsl_sbloader_v3.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/mem_interface/fsl_sbloader_v3.h deleted file mode 100644 index 795d8f19e75..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/mem_interface/fsl_sbloader_v3.h +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Copyright 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_SBLOADER_V3_H_ -#define FSL_SBLOADER_V3_H_ - -#include - -#include "fsl_nboot_hal.h" - -/*! @addtogroup sbloader */ -/*! @{ */ - -/******************************************************************************* - * Definitions - *****************************************************************************/ - -/*! - * @brief Defines the number of bytes in a cipher block (chunk). This is dictated by - * the encryption algorithm. - */ -#define SB3_BYTES_PER_CHUNK 16 - -typedef uint8_t chunk_v3_t[SB3_BYTES_PER_CHUNK]; - -typedef struct _ldr_buf ldr_buf_t; - -struct _ldr_buf -{ - chunk_v3_t data; - uint32_t fillPosition; -}; - -/*! @brief Provides forward reference to the loader context definition. */ -typedef struct _ldr_Context_v3 ldr_Context_v3_t; - -/*! @brief Function pointer definition for all loader action functions. */ -typedef status_t (*pLdrFnc_v3_t)(ldr_Context_v3_t *content); - -/*! @brief sb3 section definitions */ -/*! @brief section type */ -typedef enum _sectionType -{ - kSectionNone = 0, /*!< end or invalid */ - kSectionDataRange = 1, - kSectionDiffUpdate = 2, - kSectionDDRConfig = 3, - kSectionRegister = 4, -} section_type_t; - -#define SB3_DATA_RANGE_HEADER_FLAGS_ERASE_MASK (0x1u) /*!< bit 0 */ -#define SB3_DATA_RANGE_HEADER_FLAGS_LOAD_MASK (0x2u) /*!< bit 1 */ - -/*! @brief section data range structure */ -typedef struct range_header -{ - uint32_t tag; - uint32_t startAddress; - uint32_t length; - uint32_t cmd; -} sb3_data_range_header_t; - -typedef struct range_header_expansion -{ - uint32_t memoryId; - uint32_t pad0; - uint32_t pad1; - uint32_t pad2; -} sb3_data_range_expansion_t; - -typedef struct copy_memory_expansion -{ - uint32_t destAddr; - uint32_t memoryIdFrom; - uint32_t memoryIdTo; - uint32_t pad; -} sb3_copy_memory_expansion_t; - -typedef struct copy -{ - sb3_data_range_header_t header; - sb3_copy_memory_expansion_t expansion; -} sb3_copy_memory_t; - -typedef struct load_keyblob -{ - uint32_t tag; - uint16_t offset; - uint16_t keyWrapId; - uint32_t length; - uint32_t cmd; -} sb3_load_keyblob_t; - -typedef struct fill_memory_expansion -{ - uint32_t pattern; /*!< word to be used as pattern */ - uint32_t pad0; - uint32_t pad1; - uint32_t pad2; -} sb3_fill_memory_expansion_t; - -typedef struct fill_memory -{ - sb3_data_range_header_t header; - sb3_fill_memory_expansion_t arg; -} sb3_fill_memory_t; - -typedef struct config_memory -{ - uint32_t tag; - uint32_t memoryId; - uint32_t address; /*!< address of config blob */ - uint32_t cmd; -} sb3_config_memory_t; - -enum -{ - kFwVerChk_Id_none = 0, - kFwVerChk_Id_nonsecure = 1, - kFwVerChk_Id_secure = 2, -}; - -typedef struct fw_ver_check -{ - uint32_t tag; - uint32_t version; - uint32_t id; - uint32_t cmd; -} sb3_fw_ver_check_t; - -/*! @brief sb3 DATA section header format */ -typedef struct section_header -{ - uint32_t sectionUid; - uint32_t sectionType; - uint32_t length; - uint32_t _pad; -} sb3_section_header_t; - -/*! @brief loader command enum */ -typedef enum _loader_command_sb3 -{ - kSB3_CmdInvalid = 0, - kSB3_CmdErase = 1, - kSB3_CmdLoad = 2, - kSB3_CmdExecute = 3, - kSB3_CmdCall = 4, - kSB3_CmdProgramFuse = 5, - kSB3_CmdProgramIFR = 6, - kSB3_CmdLoadCmac = 7, - kSB3_CmdCopy = 8, - kSB3_CmdLoadHashLocking = 9, - kSB3_CmdLoadKeyBlob = 10, - kSB3_CmdConfigMem = 11, - kSB3_CmdFillMem = 12, - kSB3_CmdFwVerCheck = 13, -} sb3_cmd_t; - -/*! @brief The all of the allowed command */ -#define SBLOADER_V3_CMD_SET_ALL \ - ((1u << kSB3_CmdErase) | (1u << kSB3_CmdLoad) | (1u << kSB3_CmdExecute) | (1u << kSB3_CmdCall) | \ - (1u << kSB3_CmdProgramFuse) | (1u << kSB3_CmdProgramIFR) | (1u << kSB3_CmdCopy) | (1u << kSB3_CmdLoadKeyBlob) | \ - (1u << kSB3_CmdConfigMem) | (1u << kSB3_CmdFillMem) | (1u << kSB3_CmdFwVerCheck)) -/*! @brief The allowed command set in ISP mode */ -#define SBLOADER_V3_CMD_SET_IN_ISP_MODE \ - ((1u << kSB3_CmdErase) | (1u << kSB3_CmdLoad) | (1u << kSB3_CmdExecute) | (1u << kSB3_CmdProgramFuse) | \ - (1u << kSB3_CmdProgramIFR) | (1u << kSB3_CmdCopy) | (1u << kSB3_CmdLoadKeyBlob) | (1u << kSB3_CmdConfigMem) | \ - (1u << kSB3_CmdFillMem) | (1u << kSB3_CmdFwVerCheck)) -/*! @brief The allowed command set in recovery mode */ -#define SBLOADER_V3_CMD_SET_IN_REC_MODE \ - ((1u << kSB3_CmdErase) | (1u << kSB3_CmdLoad) | (1u << kSB3_CmdExecute) | (1u << kSB3_CmdProgramFuse) | \ - (1u << kSB3_CmdProgramIFR) | (1u << kSB3_CmdCopy) | (1u << kSB3_CmdLoadKeyBlob) | (1u << kSB3_CmdConfigMem) | \ - (1u << kSB3_CmdFillMem) | (1u << kSB3_CmdFwVerCheck)) - -#define SB3_DATA_BUFFER_SIZE_IN_BYTE (MAX(128, NBOOT_KEY_BLOB_SIZE_IN_BYTE_MAX)) - -/*! @brief Memory region definition. */ -typedef struct -{ - uint32_t address; - uint32_t length; -} kb_region_t; - -/*! - * @brief Details of the operation to be performed by the ROM. - * - * The #kRomAuthenticateImage operation requires the entire signed image to be - * available to the application. - */ -typedef enum -{ - kRomAuthenticateImage = 1, /*!< Authenticate a signed image. */ - kRomLoadImage = 2, /*!< Load SB file. */ - kRomOperationCount = 3, -} kb_operation_t; - -typedef struct -{ - uint32_t profile; - uint32_t minBuildNumber; - uint32_t overrideSBBootSectionID; - uint32_t *userSBKEK; - uint32_t regionCount; - const kb_region_t *regions; -} kb_load_sb_t; - -typedef struct -{ - uint32_t profile; - uint32_t minBuildNumber; - uint32_t maxImageLength; - uint32_t *userRHK; -} kb_authenticate_t; - -typedef struct -{ - uint32_t version; /*!< Should be set to #kKbootApiVersion. */ - uint8_t *buffer; /*!< Caller-provided buffer used by Kboot. */ - uint32_t bufferLength; - kb_operation_t op; - union - { - kb_authenticate_t authenticate; /*!< Settings for #kKbootAuthenticate operation.*/ - kb_load_sb_t loadSB; /*!< Settings for #kKbootLoadSB operation.*/ - }; -} kb_options_t; - -/*! @brief Loader context definition. */ -struct _ldr_Context_v3 -{ - pLdrFnc_v3_t Action; /*!< pointer to loader action function */ - uint32_t block_size; /*!< size of each block in bytes */ - uint32_t block_data_size; /*!< data size in bytes (NBOOT_SB3_CHUNK_SIZE_IN_BYTES) */ - uint32_t block_data_total; /*!< data max size in bytes (block_size * data_size */ - uint32_t block_buffer_size; /*!< block0 and block size */ - uint32_t block_buffer_position; - uint8_t block_buffer[MAX(NBOOT_SB3_MANIFEST_MAX_SIZE_IN_BYTES, - NBOOT_SB3_BLOCK_MAX_SIZE_IN_BYTES)]; /*! will be used for both block0 and blockx */ - uint32_t processedBlocks; - - uint8_t data_block_offset; /*! data block offset in a block. */ - bool in_data_block; /*!< in progress of handling a data block within a block */ - uint8_t *data_block; - uint32_t data_block_position; - - bool in_data_section; /*!< in progress of handling a data section within a data block */ - uint32_t data_section_handled; - sb3_section_header_t data_section_header; - - bool in_data_range; /*!< in progress of handling a data range within a data section */ - uint32_t data_range_handled; - uint32_t data_range_gap; - sb3_data_range_header_t data_range_header; - bool has_data_range_expansion; - sb3_data_range_expansion_t data_range_expansion; - - uint32_t commandSet; /*!< support command set during sb file handling */ - - uint32_t data_position; - uint8_t data_buffer[SB3_DATA_BUFFER_SIZE_IN_BYTE]; /*!< temporary data buffer */ - - kb_options_t fromAPI; /*!< options from ROM API */ -}; - -/*! @} */ - -#endif /* FSL_SBLOADER_V3_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/mem_interface/src/fsl_mem_interface.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/mem_interface/src/fsl_mem_interface.c deleted file mode 100644 index b95b82c8a32..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/mem_interface/src/fsl_mem_interface.c +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#include "fsl_flash.h" -#include "fsl_flash_ffr.h" -#include "fsl_flexspi_nor_flash.h" -#include "fsl_mem_interface.h" - -/*! @brief Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.memInterface" -#endif - -/******************************************************************************* - * Definitions - ******************************************************************************/ -#define BOOTLOADER_API_TREE_POINTER ((bootloader_tree_t *)0x1303fc00U) - -/*! @brief IAP API Interface structure */ -typedef struct iap_api_interface_struct -{ - standard_version_t version; /*!< IAP API version number. */ - status_t (*api_init)(api_core_context_t *coreCtx, const kp_api_init_param_t *param); - status_t (*api_deinit)(api_core_context_t *coreCtx); - status_t (*mem_init)(api_core_context_t *ctx); - status_t (*mem_read)(api_core_context_t *ctx, uint32_t addr, uint32_t len, uint8_t *buf, uint32_t memoryId); - status_t (*mem_write)(api_core_context_t *ctx, uint32_t addr, uint32_t len, const uint8_t *buf, uint32_t memoryId); - status_t (*mem_fill)(api_core_context_t *ctx, uint32_t addr, uint32_t len, uint32_t pattern, uint32_t memoryId); - status_t (*mem_flush)(api_core_context_t *ctx); - status_t (*mem_erase)(api_core_context_t *ctx, uint32_t addr, uint32_t len, uint32_t memoryId); - status_t (*mem_config)(api_core_context_t *ctx, uint32_t *buf, uint32_t memoryId); - status_t (*mem_erase_all)(api_core_context_t *ctx, uint32_t memoryId); - status_t (*sbloader_init)(api_core_context_t *ctx); - status_t (*sbloader_pump)(api_core_context_t *ctx, uint8_t *data, uint32_t length); - status_t (*sbloader_finalize)(api_core_context_t *ctx); -} iap_api_interface_t; - -/*! - * @brief Root of the bootloader API tree. - * - * An instance of this struct resides in read-only memory in the bootloader. It - * provides a user application access to APIs exported by the bootloader. - * - * @note The order of existing fields must not be changed. - */ -typedef struct BootloaderTree -{ - void (*runBootloader)(void *arg); /*!< Function to start the bootloader executing.*/ - standard_version_t version; /*!< Bootloader version number.*/ - const char *copyright; /*!< Copyright string.*/ - const uint32_t reserved0; /*!< reserved*/ - const uint32_t flashDriver; /*!< Internal Flash driver API.*/ - const uint32_t reserved1[5]; /*!< reserved*/ - const uint32_t nbootDriver; /*!< Please refer to "fsl_nboot.h" */ - const uint32_t flexspiNorDriver; /*!< FlexSPI NOR FLASH Driver API.*/ - const uint32_t efuseDriver; /*!< eFuse driver API */ - const iap_api_interface_t *iapAPIDriver; /*!< IAP driver API */ -} bootloader_tree_t; -/******************************************************************************* - * API - ******************************************************************************/ - -standard_version_t API_Version(void) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->iapAPIDriver->version; -} - -/*! @brief Initialize the IAP API runtime environment */ -status_t API_Init(api_core_context_t *coreCtx, const kp_api_init_param_t *param) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->iapAPIDriver->api_init(coreCtx, param); -} - -/*! @brief Deinitialize the IAP API runtime environment */ -status_t API_Deinit(api_core_context_t *coreCtx) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->iapAPIDriver->api_deinit(coreCtx); -} - -/*! @brief Intialize the memory interface of the IAP API */ -status_t MEM_Init(api_core_context_t *coreCtx) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->iapAPIDriver->mem_init(coreCtx); -} - -/*! @brief Perform the memory write operation */ -status_t MEM_Write( - api_core_context_t *coreCtx, uint32_t start, uint32_t lengthInBytes, const uint8_t *buf, uint32_t memoryId) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->iapAPIDriver->mem_write(coreCtx, start, lengthInBytes, buf, memoryId); -} - -/*! @brief Perform the Fill operation */ -status_t MEM_Fill( - api_core_context_t *coreCtx, uint32_t start, uint32_t lengthInBytes, uint32_t pattern, uint32_t memoryId) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->iapAPIDriver->mem_fill(coreCtx, start, lengthInBytes, pattern, memoryId); -} - -/*! @brief Perform the Memory erase operation */ -status_t MEM_Erase(api_core_context_t *coreCtx, uint32_t start, uint32_t lengthInBytes, uint32_t memoryId) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->iapAPIDriver->mem_erase(coreCtx, start, lengthInBytes, memoryId); -} -/*! @brief Perform the full Memory erase operation */ -status_t MEM_EraseAll(api_core_context_t *coreCtx, uint32_t memoryId) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->iapAPIDriver->mem_erase_all(coreCtx, memoryId); -} - -/*! @brief Perform the Memory configuration operation */ -status_t MEM_Config(api_core_context_t *coreCtx, uint32_t *config, uint32_t memoryId) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->iapAPIDriver->mem_config(coreCtx, config, memoryId); -} - -/*! @brief Perform the Memory Flush operation */ -status_t MEM_Flush(api_core_context_t *coreCtx) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->iapAPIDriver->mem_flush(coreCtx); -} - -/*! @brief Perform the Sbloader runtime environment initialization */ -status_t Sbloader_Init(api_core_context_t *ctx) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->iapAPIDriver->sbloader_init(ctx); -} - -/*! @brief Handle the SB data stream */ -status_t Sbloader_Pump(api_core_context_t *ctx, uint8_t *data, uint32_t length) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->iapAPIDriver->sbloader_pump(ctx, data, length); -} -/*! @brief Finish the sbloader handling */ -status_t Sbloader_Finalize(api_core_context_t *ctx) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->iapAPIDriver->sbloader_finalize(ctx); -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/nboot/fsl_nboot.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/nboot/fsl_nboot.h deleted file mode 100644 index f1cca4da17d..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/nboot/fsl_nboot.h +++ /dev/null @@ -1,346 +0,0 @@ -/* - * Copyright 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_NBOOT_H_ -#define FSL_NBOOT_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup nboot - * @{ - */ -/******************************************************************************* - * Definitions - ******************************************************************************/ -/** @def NXPCLHASH_WA_SIZE_MAX - * @brief Define the max workarea size required for this component - */ -#define NXPCLHASH_WA_SIZE_MAX (128U + 64U) -#define NBOOT_ROOT_CERT_COUNT (4U) -#define NXPCLCSS_HASH_RTF_OUTPUT_SIZE_HAL ((size_t)32U) ///< Size of RTF appendix to hash output buffer, in bytes - -#define NBOOT_KEYINFO_WORDLEN (23U) -#define NBOOT_CONTEXT_BYTELEN (192U + NXPCLHASH_WA_SIZE_MAX) -#define NBOOT_CONTEXT_WORDLEN (NBOOT_CONTEXT_BYTELEN / sizeof(uint32_t)) -typedef int romapi_status_t; - -/*! - * @brief NBOOT type for the root key usage - * - * This type defines the NBOOT root key usage; - * any other value means the root key is not valid (treat as if revoked). - */ -#define kNBOOT_RootKeyUsage_DebugCA_ImageCA_FwCA_ImageKey_FwKey (0x0U) -#define kNBOOT_RootKeyUsage_DebugCA (0x1U) -#define kNBOOT_RootKeyUsage_ImageCA_FwCA (0x2U) -#define kNBOOT_RootKeyUsage_DebugCA_ImageCA_FwCA (0x3U) -#define kNBOOT_RootKeyUsage_ImageKey_FwKey (0x4U) -#define kNBOOT_RootKeyUsage_ImageKey (0x5U) -#define kNBOOT_RootKeyUsage_FwKey (0x6U) -#define kNBOOT_RootKeyUsage_Unused (0x7U) -typedef uint32_t nboot_root_key_usage_t; - -/*! - * @brief NBOOT type for the root key revocation - * - * This type defines the NBOOT root key revocation; - * any other value means the root key is revoked. - */ -#define kNBOOT_RootKey_Enabled (0xAAU) -#define kNBOOT_RootKey_Revoked (0xBBU) -typedef uint32_t nboot_root_key_revocation_t; - -/*! - * @brief NBOOT type specifying the elliptic curve to be used - * - * This type defines the elliptic curve type and length - */ -#define kNBOOT_RootKey_Ecdsa_P256 (0x0000FE01U) -#define kNBOOT_RootKey_Ecdsa_P384 (0x0000FD02U) -typedef uint32_t nboot_root_key_type_and_length_t; - -/*! @brief Enumeration for SoC Lifecycle. */ -#define nboot_lc_nxpBlank (0xFFFF0000U) -#define nboot_lc_nxpFab (0xFFFE0001U) -#define nboot_lc_nxpDev (0xFF0300FCU) -#define nboot_lc_nxpProvisioned (0xFFFC0003U) -#define nboot_lc_oemOpen (0xFFFC0003U) -#define nboot_lc_oemSecureWorld (0xFFF80007U) -#define nboot_lc_oemClosed (0xFFF0000FU) -#define nboot_lc_oemLocked (0xFF3000CFU) -#define nboot_lc_oemFieldReturn (0xFFE0001FU) -#define nboot_lc_nxpFieldReturn (0xFF80007FU) -#define nboot_lc_shredded (0xFF0000FFU) -typedef uint32_t nboot_soc_lifecycle_t; - -/*! @brief Type for nboot status codes */ -typedef uint32_t nboot_status_t; - -/*! @brief Type for nboot protected status codes */ -typedef uint64_t nboot_status_protected_t; - -/*! - * @brief nboot status codes. - */ -enum -{ - kStatus_NBOOT_Success = 0x5A5A5A5AU, /*!< Operation completed successfully. */ - kStatus_NBOOT_Fail = 0x5A5AA5A5U, /*!< Operation failed. */ - kStatus_NBOOT_InvalidArgument = 0x5A5AA5F0U, /*!< Invalid argument passed to the function. */ - kStatus_NBOOT_RequestTimeout = 0x5A5AA5E1U, /*!< Operation timed out. */ - kStatus_NBOOT_KeyNotLoaded = 0x5A5AA5E2U, /*!< The requested key is not loaded. */ - kStatus_NBOOT_AuthFail = 0x5A5AA5E4U, /*!< Authentication failed. */ - kStatus_NBOOT_OperationNotAvaialable = 0x5A5AA5E5U, /*!< Operation not available on this HW. */ - kStatus_NBOOT_KeyNotAvailable = 0x5A5AA5E6U, /*!< Key is not avaialble. */ - kStatus_NBOOT_IvCounterOverflow = 0x5A5AA5E7U, /*!< Overflow of IV counter (PRINCE/IPED). */ - kStatus_NBOOT_SelftestFail = 0x5A5AA5E8U, /*!< FIPS self-test failure. */ - kStatus_NBOOT_InvalidDataFormat = 0x5A5AA5E9U, /*!< Invalid data format for example antipole */ - kStatus_NBOOT_IskCertUserDataTooBig = - 0x5A5AA5EAU, /*!< Size of User data in ISK certificate is greater than 96 bytes */ - kStatus_NBOOT_IskCertSignatureOffsetTooSmall = - 0x5A5AA5EBU, /*!< Signature offset in ISK certificate is smaller than expected */ - kStatus_NBOOT_MemcpyFail = 0x5A5A845AU, /*!< Unexpected error detected during nboot_memcpy() */ -}; - -/*! @brief Data structure holding secure counter value used by nboot library */ -typedef struct _nboot_secure_counter -{ - uint32_t sc; - uint32_t scAp; -} nboot_secure_counter_t; - -/*! - * @brief NBOOT context type - * - * This type defines the NBOOT context - * - */ -typedef struct _nboot_context -{ - uint32_t totalBlocks; /*!< holds number of SB3 blocks. Initialized by nboot_sb3_load_header(). */ - uint32_t processData; /*!< flag, initialized by nboot_sb3_load_header(). - SB3 related flag set by NBOOT in case the nboot_sb3_load_block() - provides plain data to output buffer (for processing by ROM SB3 loader */ - uint32_t timeout; /*!< timeout value for css operation. In case it is 0, infinite wait is performed */ - uint32_t keyinfo[NBOOT_KEYINFO_WORDLEN]; /*!< data for NBOOT key management. */ - uint32_t context[NBOOT_CONTEXT_WORDLEN]; /*!< work area for NBOOT lib. */ - uint32_t uuid[4]; /*!< holds UUID value from NMPA */ - uint32_t prngReadyFlag; /*!< flag, used by nboot_rng_generate_lq_random() to determine whether CSS is ready to - generate rnd number */ - uint32_t multipartMacBuffer[1024 / sizeof(uint32_t)]; - uint32_t oemShareValidFlag; /*!< flag, used during TP to determine whether valid oemShare was set by - nboot_tp_isp_gen_oem_master_share() */ - uint32_t oemShare[4]; /*!< buffer to store OEM_SHARE computed by nxpCLTrustProv_nboot_isp_gen_oem_master_share() */ - nboot_secure_counter_t secureCounter; /*!< Secure counter used by nboot */ - uint32_t rtf[NXPCLCSS_HASH_RTF_OUTPUT_SIZE_HAL / sizeof(uint32_t)]; - uint32_t imageHash[48 / sizeof(uint32_t)]; - uint32_t authStatus; -} nboot_context_t; - -/*! - * @brief NBOOT type for the root of trust parameters - * - * This type defines the NBOOT root of trust parameters - * - */ -typedef struct _nboot_rot_auth_parms -{ - /* trusted information originated from CFPA */ - nboot_root_key_revocation_t soc_rootKeyRevocation[NBOOT_ROOT_CERT_COUNT]; /*!< Provided by caller based on NVM - information in CFPA: ROTKH_REVOKE */ - uint32_t soc_imageKeyRevocation; /*!< Provided by caller based on NVM information in CFPA: IMAGE_KEY_REVOKE */ - - /* trusted information originated from CMPA */ - uint32_t soc_rkh[12]; /*!< Provided by caller based on NVM information in CMPA: ROTKH (hash of hashes) */ - /*!< In case of kNBOOT_RootKey_Ecdsa_P384, sock_rkh[0..11] are used */ - /*!< In case of kNBOOT_RootKey_Ecdsa_P256, sock_rkh[0..7] are used */ - - uint32_t soc_numberOfRootKeys; /*!< unsigned int, between minimum = 1 and maximum = 4; */ - nboot_root_key_usage_t soc_rootKeyUsage[NBOOT_ROOT_CERT_COUNT]; /*!< CMPA */ - nboot_root_key_type_and_length_t - soc_rootKeyTypeAndLength; /*!< static selection between ECDSA P-256 or ECDSA P-384 based root keys */ - - /* trusted information originated from OTP fuses */ - nboot_soc_lifecycle_t soc_lifecycle; -} nboot_rot_auth_parms_t; - -/*! - * @brief manifest loading parameters - * - * This type defines the NBOOT SB3.1 manifest loading parameters - * - */ -typedef struct _nboot_sb3_load_manifest_parms -{ - nboot_rot_auth_parms_t soc_RoTNVM; /*!< trusted information originated from CFPA and NMPA */ - uint32_t soc_trustedFirmwareVersion; /*!< Provided by caller based on NVM information in CFPA: Secure_FW_Version */ - uint8_t pckBlob[48]; -} nboot_sb3_load_manifest_parms_t; - -/*! - * @brief Data structure holding input arguments to POR secure boot (authentication) algorithm. - * Shall be read from SoC trusted NVM or SoC fuses. - */ -typedef struct _nboot_img_auth_ecdsa_parms -{ - nboot_rot_auth_parms_t soc_RoTNVM; /*!< trusted information originated from CFPA and NMPA */ - uint32_t soc_trustedFirmwareVersion; /*!< Provided by caller based on NVM information in CFPA: Secure_FW_Version */ -} nboot_img_auth_ecdsa_parms_t; - -/*! @brief Data structure holding input arguments for CMAC authentication */ -typedef struct _nboot_cmac_authenticate_parms -{ - uint32_t expectedMAC[4]; /*!< expected MAC result */ -} nboot_img_authenticate_cmac_parms_t; - -/*! - * @brief Boolean type for the NBOOT functions - * - * This type defines boolean values used by NBOOT functions that are not easily disturbed by Fault Attacks - */ -typedef enum _nboot_bool -{ - kNBOOT_TRUE = 0x3C5AC33CU, /*!< Value for TRUE. */ - kNBOOT_TRUE256 = 0x3C5AC35AU, /*!< Value for TRUE when P256 was used to sign the image. */ - kNBOOT_TRUE384 = 0x3C5AC3A5U, /*!< Value for TRUE when P384 was used to sign the image. */ - kNBOOT_FALSE = 0x5AA55AA5U, /*!< Value for FALSE. */ - kNBOOT_OperationAllowed = 0x3c5a33ccU, - kNBOOT_OperationDisallowed = 0x5aa5cc33U, -} nboot_bool_t; - -#ifdef __cplusplus -extern "C" { -#endif - -/******************************************************************************* - * API - ******************************************************************************/ - -/*! - * @brief This API function is used to generate random number with specified length. - * - * @param output Pointer to random number buffer - * @param outputByteLen length of generated random number in bytes. Length has to be in range <1, 2^16> - * - * @retval #kStatus_NBOOT_InvalidArgument Invalid input parameters (Input pointers points to NULL or length is invalid) - * @retval #kStatus_NBOOT_Success Operation successfully finished - * @retval #kStatus_NBOOT_Fail Error occured during operation - */ -status_t NBOOT_GenerateRandom(uint8_t *output, size_t outputByteLen); - -/*! - * @brief The function is used for initializing of the nboot context data structure. - * It should be called prior to any other calls of nboot API. - * - * @param nbootCtx Pointer to nboot_context_t structure. - * - * @retval #kStatus_NBOOT_Success Operation successfully finished - * @retval #kStatus_NBOOT_Fail Error occured during operation - */ -nboot_status_t NBOOT_ContextInit(nboot_context_t *context); - -/*! - * @brief The function is used to deinitialize nboot context data structure. - * Its contents are overwritten with random data so that any sensitive data does not remain in memory. - * - * @param context Pointer to nboot_context_t structure. - - * @retval #kStatus_NBOOT_Success Operation successfully finished - * @retval #kStatus_NBOOT_Fail Error occured during operation - */ -nboot_status_t NBOOT_ContextDeinit(nboot_context_t *context); - -/*! - * @brief Verify NBOOT SB3.1 manifest (header message) - * - * This function verifies the NBOOT SB3.1 manifest (header message), initializes - * the context and loads keys into the CSS key store so that they can be used by nboot_sb3_load_block - * function. The NBOOT context has to be initialized by the function nboot_context_init before calling - * this function. Please note that this API is intended to be used only by users who needs to split - * FW update process (loading of SB3.1 file) to partial steps to customize whole operation. - * For regular SB3.1 processing, please use API described in chapter ��SBloader APIs��. - * - * @param nbootCtx Pointer to nboot_context_t structure. - * @param manifest Pointer to the input manifest buffer - * @param params additional input parameters. Please refer to nboot_sb3_load_manifest_parms_t definition for details. - * - * @retval #kStatus_NBOOT_Success Operation successfully finished - * @retval #kStatus_NBOOT_Fail Error occured during operation - */ -nboot_status_protected_t NBOOT_Sb3LoadManifest(nboot_context_t *context, - uint32_t *manifest, - nboot_sb3_load_manifest_parms_t *parms); - -/*! - * @brief Verify NBOOT SB3.1 block - * - * This function verifies and decrypts an NBOOT SB3.1 block. Decryption is performed in-place. - * The NBOOT context has to be initialized by the function nboot_context_init before calling this function. - * Please note that this API is intended to be used only by users who needs to split FW update process - * (loading of SB3.1 file) to partial steps to customize whole operation. For regular SB3.1 processing, - * please use API described in chapter ��SBloader APIs��. - * - * @param context Pointer to nboot_context_t structure. - * @param block Pointer to the input SB3.1 data block - * - * @retval #kStatus_NBOOT_Success successfully finished - * @retval #kStatus_NBOOT_Fail occured during operation - */ -nboot_status_protected_t NBOOT_Sb3LoadBlock(nboot_context_t *context, uint32_t *block); - -/*! - * @brief This function authenticates image with asymmetric cryptography. - * The NBOOT context has to be initialized by the function nboot_context_init - * before calling this function. - * - * @param context Pointer to nboot_context_t structure. - * @param imageStartAddress Pointer to start of the image in memory. - * @param isSignatureVerified Pointer to memory holding function call result. - * After the function returns, the value will be set to kNBOOT_TRUE when the image is - * authentic. Any other value means the authentication does not pass. - * - * @param parms Pointer to a data structure in trusted memory, holding input parameters for the algorithm. - * The data structure shall be correctly filled before the function call. - * - * @retval #kStatus_NBOOT_Success Operation successfully finished - * @retval #kStatus_NBOOT_Fail Returned in all other cases. Doesn't always mean invalid image, - * it could also mean transient error caused by short time environmental conditions. - */ -nboot_status_protected_t NBOOT_ImgAuthenticateEcdsa(nboot_context_t *context, - uint8_t imageStartAddress[], - nboot_bool_t *isSignatureVerified, - nboot_img_auth_ecdsa_parms_t *parms); - -/*! - * @brief This function calculates the CMAC over the given image and compares it to the expected value. - * To be more resistant against SPA, it is recommended that imageStartAddress is word aligned. - * The NBOOT context has to be initialized by the nboot_context_init() before calling this function. - * - * @param context Pointer to nboot_context_t structure. - * @param imageStartAddress Pointer to start of the image in memory. - * @param isSignatureVerified Pointer to memory holding function call result. - After the function returns, the value will be set to - * @param parms Pointer to a data structure in trusted memory, holding the reference MAC. - The data structure shall be correctly filled before the function call. - * - * @retval kStatus_NBOOT_Success - * @retval kStatus_NBOOT_Fail - */ -nboot_status_protected_t NBOOT_ImgAuthenticateCmac(nboot_context_t *context, - uint8_t imageStartAddress[], - nboot_bool_t *isSignatureVerified, - nboot_img_authenticate_cmac_parms_t *parms); - -#ifdef __cplusplus -} -#endif - -/** - * @} - */ - -#endif /* FSL_NBOOT_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/nboot/fsl_nboot_hal.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/nboot/fsl_nboot_hal.h deleted file mode 100644 index 79e0dd490ef..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/nboot/fsl_nboot_hal.h +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Copyright 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef FSL_NBOOT_HAL_H_ -#define FSL_NBOOT_HAL_H_ - -#include "fsl_nboot.h" - -/*! @addtogroup nbot_hal */ -/*! @{ */ - -/*! @file */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/*! @brief The size of the UUID. */ -#define NBOOT_UUID_SIZE_IN_WORD (4) -#define NBOOT_UUID_SIZE_IN_BYTE (NBOOT_UUID_SIZE_IN_WORD * 4) - -/*! @brief The size of the PUF activation code. */ -#define NBOOT_PUF_AC_SIZE_IN_BYTE (996) -/*! @brief The size of the PUF key code. */ -#define NBOOT_PUF_KC_SIZE_IN_BYTE (84) - -/*! @brief The size of the key store. */ -#define NBOOT_KEY_STORE_SIZE_IN_BYTE (NBOOT_PUF_AC_SIZE_IN_BYTE + 8) - -/*! @brief The size of the root of trust key table hash. */ -#define NBOOT_ROOT_ROTKH_SIZE_IN_WORD (12) -#define NBOOT_ROOT_ROTKH_SIZE_IN_BYTE (NBOOT_ROOT_ROTKH_SIZE_IN_WORD * 4) - -/*! @brief The size of the blob with Key Blob. */ -#define NBOOT_KEY_BLOB_SIZE_IN_BYTE_256 (32) -#define NBOOT_KEY_BLOB_SIZE_IN_BYTE_384 (48) -#define NBOOT_KEY_BLOB_SIZE_IN_BYTE_MAX (NBOOT_KEY_BLOB_SIZE_IN_BYTE_384) - -/*! @brief The mask of the value of the debug state . */ -#define NBOOT_DBG_AUTH_DBG_STATE_MASK (0x0000FFFFu) -/*! @brief The shift inverted value of the debug state. */ -#define NBOOT_DBG_AUTH_DBG_STATE_SHIFT (16) -/*! @brief The value with all debug feature disabled. */ -#define NBOOT_DBG_AUTH_DBG_STATE_ALL_DISABLED (0xFFFF0000u) - -#define NBOOT_ROOT_OF_TRUST_HASH_SIZE_IN_BYTES (48u) - -#define NBOOT_EC_COORDINATE_384_SIZE_IN_BYTES (48u) -#define NBOOT_EC_COORDINATE_MAX_SIZE NBOOT_EC_COORDINATE_384_SIZE_IN_BYTES - -/* SB3.1 */ -#define NBOOT_SB3_CHUNK_SIZE_IN_BYTES (256u) -#define NBOOT_SB3_BLOCK_HASH256_SIZE_IN_BYTES (32u) -#define NBOOT_SB3_BLOCK_HASH384_SIZE_IN_BYTES (48u) - -/*! - * @brief NBOOT type for a timestamp - * - * This type defines the NBOOT timestamp - * - */ -typedef uint32_t nboot_timestamp_t[2]; - -/*! - * @brief NBOOT SB3.1 header type - * - * This type defines the header used in the SB3.1 manifest - * - */ -typedef struct _nboot_sb3_header -{ - uint32_t magic; /*!< offset 0x00: Fixed 4-byte string of 'sbv3' without the trailing NULL */ - uint32_t formatVersion; /*!< offset 0x04: (major = 3, minor = 1); The format version determines the manifest - (block0) size. */ - uint32_t flags; /*!< offset 0x08: not defined yet, keep zero for future compatibility */ - uint32_t blockCount; /*!< offset 0x0C: Number of blocks not including the manifest (block0). */ - uint32_t - blockSize; /*!< offset 0x10: Size in bytes of data block (repeated blockCount times for SB3 data stream). */ - nboot_timestamp_t timeStamp; /*!< offset 0x14: 64-bit value used as key derivation data. */ - uint32_t firmwareVersion; /*!< offset 0x1c: Version number of the included firmware */ - uint32_t imageTotalLength; /*!< offset 0x20: Total manifest length in bytes, including signatures etc. */ - uint32_t imageType; /*!< offset 0x24: image type and flags */ - uint32_t certificateBlockOffset; /*!< offset 0x28: Offset from start of header block to the certificate block. */ - uint8_t description[16]; /*!< offset 0x32: This field provides description of the file. It is an arbitrary - string injected by the signing tool, which helps to identify the file. */ -} nboot_sb3_header_t; - -/*! - * @brief NBOOT type for the header of the certificate block - * - * This type defines the NBOOT header of the certificate block, it is part of the nboot_certificate_block_t - * - */ -typedef struct _nboot_certificate_header_block -{ - uint32_t magic; /*!< magic number. */ - uint32_t formatMajorMinorVersion; /*!< format major minor version */ - uint32_t certBlockSize; /*!< Size of the full certificate block */ -} nboot_certificate_header_block_t; - -typedef uint8_t nboot_ctrk_hash_t[NBOOT_ROOT_OF_TRUST_HASH_SIZE_IN_BYTES]; - -/*! - * @brief NBOOT type for the hash table - * - * This type defines the NBOOT hash table - * - */ -typedef struct _nboot_ctrk_hash_table -{ - nboot_ctrk_hash_t ctrkHashTable[NBOOT_ROOT_CERT_COUNT]; -} nboot_ctrk_hash_table_t; - -/*! - * @brief NBOOT type for an ECC coordinate - * - * This type defines the NBOOT ECC coordinate type - * - */ -typedef uint8_t - nboot_ecc_coordinate_t[NBOOT_EC_COORDINATE_MAX_SIZE]; /*!< ECC point coordinate, up to 384-bits. big endian. */ - -/*! - * @brief NBOOT type for an ECC point - * - * This type defines the NBOOT ECC point type - */ -typedef struct -{ - nboot_ecc_coordinate_t x; /*!< x portion of the ECDSA public key, up to 384-bits. big endian. */ - nboot_ecc_coordinate_t y; /*!< y portion of the ECDSA public key, up to 384-bits. big endian. */ -} nboot_ecdsa_public_key_t; - -/*! - * @brief NBOOT type for the root certificate block - * - * This type defines the NBOOT root certificate block, it is part of the nboot_certificate_block_t - */ -typedef struct _nboot_root_certificate_block -{ - uint32_t flags; /*!< root certificate flags */ - nboot_ctrk_hash_table_t ctrkHashTable; /*!< hash table */ - nboot_ecdsa_public_key_t rootPublicKey; /*!< root public key */ -} nboot_root_certificate_block_t; - -/*! - * @brief NBOOT type for an ECC signature - * - * This type defines the NBOOT ECC signature type - */ -typedef struct -{ - nboot_ecc_coordinate_t r; /*!< r portion of the ECDSA signature, up to 384-bits. big endian. */ - nboot_ecc_coordinate_t s; /*!< s portion of the ECDSA signature, up to 384-bits. big endian. */ -} nboot_ecdsa_signature_t; - -/*! - * @brief NBOOT type for the isk block - * - * This type defines the constant length part of an NBOOT isk block - */ -typedef struct -{ - uint32_t signatureOffset; /*!< Offset of signature in ISK block. */ - uint32_t constraints; /*!< Version number of signing certificate. */ - uint32_t iskFlags; /*!< Reserved for definiton of ISK certificate flags. */ - nboot_ecdsa_public_key_t - iskPubKey; /*!< Public key of signing certificate. Variable length; only used to determine start address*/ - nboot_ecdsa_public_key_t userData; /*!< Space for at lest one addition public key*/ - nboot_ecdsa_signature_t iskSign; /*!< ISK signature*/ -} nboot_isk_block_t; - -/*! - * @brief NBOOT type for the certificate block - * - * This type defines the constant length part of an NBOOT certificate block - */ -typedef struct _nboot_certificate_block -{ - nboot_certificate_header_block_t header; - nboot_root_certificate_block_t rootCertBlock; /*! Details of selected root certificate (root certificate which will - be used for ISK signing/SB3 header signing) */ - nboot_isk_block_t iskBlock; -} nboot_certificate_block_t; - -#define NBOOT_SB3_MANIFEST_MAX_SIZE_IN_BYTES \ - (sizeof(nboot_sb3_header_t) + NBOOT_SB3_BLOCK_HASH384_SIZE_IN_BYTES + sizeof(nboot_certificate_block_t) + \ - NBOOT_EC_COORDINATE_MAX_SIZE * 2) -#define NBOOT_SB3_BLOCK_MAX_SIZE_IN_BYTES \ - (4 /* blockNumber */ + NBOOT_SB3_BLOCK_HASH384_SIZE_IN_BYTES + NBOOT_SB3_CHUNK_SIZE_IN_BYTES) - -/*! @brief The size of the DICE certificate. */ -#define NBOOT_DICE_CSR_SIZE_IN_WORD (36) -#define NBOOT_DICE_CSR_SIZE_IN_BYTES (NBOOT_DICE_CSR_SIZE_IN_WORD * 4) - -/*! @brief The physical address to put the DICE certificate. */ -#define NBOOT_DICE_CSR_ADDRESS (0x30000000u) - -/*! @brief The offset for the PRCINE/IPED erase region return by nboot mem checker. */ -#define NBOOT_IPED_IV_OFFSET (3U) - -#define NBOOT_IMAGE_CMAC_UPDATE_NONE (0u) -#define NBOOT_IMAGE_CMAC_UPDATE_INDEX0 (1u) -#define NBOOT_IMAGE_CMAC_UPDATE_INDEX1 (2u) -#define NBOOT_IMAGE_CMAC_UPDATE_BOTH (3u) -#define NBOOT_IMAGE_CMAC_UPDATE_MASK (3u) - -#define NBOOT_CMPA_CMAC_UPDATE_MASK (0x1Cu) -#define NBOOT_CMPA_CMAC_UPDATE_SHIFT (0x2u) - -#define NBOOT_CMPA_UPDATE_CMAC_PFR (0x2u) -#define NBOOT_CMPA_UPDATE_CMAC_PFR_OTP_OEM_SECURE (0x3u) -#define NBOOT_CMPA_UPDATE_CMAC_PFR_OTP_OEM_CLOSE (0x5u) -#define NBOOT_CMPA_UPDATE_CMAC_PFR_OTP_OEM_LOCKED (0x6u) - -/*! @brief Algorithm used for nboot HASH operation */ -typedef enum _nboot_hash_algo_t -{ - kHASH_Sha1 = 1, /*!< SHA_1 */ - kHASH_Sha256 = 2, /*!< SHA_256 */ - kHASH_Sha512 = 3, /*!< SHA_512 */ - kHASH_Aes = 4, /*!< AES */ - kHASH_AesIcb = 5, /*!< AES_ICB */ -} nboot_hash_algo_t; - -/*! @} */ - -#endif /*FSL_NBOOT_HAL_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/nboot/src/fsl_nboot.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/nboot/src/fsl_nboot.c deleted file mode 100644 index 909be4ae3e5..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/nboot/src/fsl_nboot.c +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#include "fsl_nboot.h" -#include "fsl_common.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/*! @brief Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.nboot" -#endif - -#define BOOTLOADER_API_TREE_POINTER ((bootloader_tree_t *)0x1303fc00U) - -/** - * @brief Image authentication operations. - * - * These abstract interface are used for image verification operations. - */ -typedef struct -{ - romapi_status_t (*romapi_rng_generate_random)(uint8_t *output, size_t outputByteLen); - nboot_status_t (*nboot_context_init)(nboot_context_t *context); - nboot_status_t (*nboot_context_deinit)(nboot_context_t *context); - nboot_status_protected_t (*nboot_sb3_load_manifest)(nboot_context_t *context, - uint32_t *manifest, - nboot_sb3_load_manifest_parms_t *parms); - nboot_status_protected_t (*nboot_sb3_load_block)(nboot_context_t *context, uint32_t *block); - nboot_status_protected_t (*nboot_img_authenticate_ecdsa)(nboot_context_t *context, - uint8_t imageStartAddress[], - nboot_bool_t *isSignatureVerified, - nboot_img_auth_ecdsa_parms_t *parms); - nboot_status_protected_t (*nboot_img_authenticate_cmac)(nboot_context_t *context, - uint8_t imageStartAddress[], - nboot_bool_t *isSignatureVerified, - nboot_img_authenticate_cmac_parms_t *parms); -} nboot_interface_t; - -/*! - * @brief Root of the bootloader API tree. - * - * An instance of this struct resides in read-only memory in the bootloader. It - * provides a user application access to APIs exported by the bootloader. - * - * @note The order of existing fields must not be changed. - */ -typedef struct BootloaderTree -{ - void (*runBootloader)(void *arg); /*!< Function to start the bootloader executing.*/ - const uint32_t version; /*!< Bootloader version number.*/ - const char *copyright; /*!< Copyright string.*/ - const uint32_t reserved0; /*!< reserved*/ - const uint32_t flashDriver; /*!< Internal Flash driver API.*/ - const uint32_t reserved1[5]; /*!< reserved*/ - const nboot_interface_t *nbootDriver; /*!< nBoot driver API */ - const uint32_t flexspiNorDriver; /*!< FlexSPI NOR FLASH Driver API.*/ - const uint32_t efuseDriver; /*!< eFuse driver API */ - const uint32_t iapAPIDriver; /*!< IAP driver API */ -} bootloader_tree_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -/*! - * @brief This API function is used to generate random number with specified length. - * - * @param output Pointer to random number buffer - * @param outputByteLen length of generated random number in bytes. Length has to be in range <1, 2^16> - * - * @retval #kStatus_NBOOT_InvalidArgument Invalid input parameters (Input pointers points to NULL or length is invalid) - * @retval #kStatus_NBOOT_Success Operation successfully finished - * @retval #kStatus_NBOOT_Fail Error occured during operation - */ -status_t NBOOT_GenerateRandom(uint8_t *output, size_t outputByteLen) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->nbootDriver->romapi_rng_generate_random(output, outputByteLen); -} - -/*! - * @brief The function is used for initializing of the nboot context data structure. - * It should be called prior to any other calls of nboot API. - * - * @param nbootCtx Pointer to nboot_context_t structure. - * - * @retval #kStatus_NBOOT_Success Operation successfully finished - * @retval #kStatus_NBOOT_Fail Error occured during operation - */ -nboot_status_t NBOOT_ContextInit(nboot_context_t *context) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->nbootDriver->nboot_context_init(context); -} - -/*! - * @brief The function is used to deinitialize nboot context data structure. - * Its contents are overwritten with random data so that any sensitive data does not remain in memory. - * - * @param context Pointer to nboot_context_t structure. - - * @retval #kStatus_NBOOT_Success Operation successfully finished - * @retval #kStatus_NBOOT_Fail Error occured during operation - */ -nboot_status_t NBOOT_ContextDeinit(nboot_context_t *context) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->nbootDriver->nboot_context_deinit(context); -} -/*! - * @brief Verify NBOOT SB3.1 manifest (header message) - * - * This function verifies the NBOOT SB3.1 manifest (header message), initializes - * the context and loads keys into the CSS key store so that they can be used by nboot_sb3_load_block - * function. The NBOOT context has to be initialized by the function nboot_context_init before calling - * this function. Please note that this API is intended to be used only by users who needs to split - * FW update process (loading of SB3.1 file) to partial steps to customize whole operation. - * For regular SB3.1 processing, please use API described in chapter SBloader APIs. - * - * @param nbootCtx Pointer to nboot_context_t structure. - * @param manifest Pointer to the input manifest buffer - * @param params additional input parameters. Please refer to nboot_sb3_load_manifest_parms_t definition for details. - * - * @retval #kStatus_NBOOT_Success Operation successfully finished - * @retval #kStatus_NBOOT_Fail Error occured during operation - */ -nboot_status_protected_t NBOOT_Sb3LoadManifest(nboot_context_t *context, - uint32_t *manifest, - nboot_sb3_load_manifest_parms_t *parms) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->nbootDriver->nboot_sb3_load_manifest(context, manifest, parms); -} - -/*! - * @brief Verify NBOOT SB3.1 block - * - * This function verifies and decrypts an NBOOT SB3.1 block. Decryption is performed in-place. - * The NBOOT context has to be initialized by the function nboot_context_init before calling this function. - * Please note that this API is intended to be used only by users who needs to split FW update process - * (loading of SB3.1 file) to partial steps to customize whole operation. For regular SB3.1 processing, - * please use API described in chapter SBloader APIs. - * - * @param context Pointer to nboot_context_t structure. - * @param block Pointer to the input SB3.1 data block - * - * @retval #kStatus_NBOOT_Success successfully finished - * @retval #kStatus_NBOOT_Fail occured during operation - */ -nboot_status_protected_t NBOOT_Sb3LoadBlock(nboot_context_t *context, uint32_t *block) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->nbootDriver->nboot_sb3_load_block(context, block); -} - -/*! - * @brief This function authenticates image with asymmetric cryptography. - * The NBOOT context has to be initialized by the function nboot_context_init - * before calling this function. - * - * @param context Pointer to nboot_context_t structure. - * @param imageStartAddress Pointer to start of the image in memory. - * @param isSignatureVerified Pointer to memory holding function call result. - * After the function returns, the value will be set to kNBOOT_TRUE when the image is - * authentic. Any other value means the authentication does not pass. - * - * @param parms Pointer to a data structure in trusted memory, holding input parameters for the algorithm. - * The data structure shall be correctly filled before the function call. - * - * @retval #kStatus_NBOOT_Success Operation successfully finished - * @retval #kStatus_NBOOT_Fail Returned in all other cases. Doesn't always mean invalid image, - * it could also mean transient error caused by short time environmental conditions. - */ -nboot_status_protected_t NBOOT_ImgAuthenticateEcdsa(nboot_context_t *context, - uint8_t imageStartAddress[], - nboot_bool_t *isSignatureVerified, - nboot_img_auth_ecdsa_parms_t *parms) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->nbootDriver->nboot_img_authenticate_ecdsa(context, imageStartAddress, - isSignatureVerified, parms); -} - -/*! - * @brief This function calculates the CMAC over the given image and compares it to the expected value. - * To be more resistant against SPA, it is recommended that imageStartAddress is word aligned. - * The NBOOT context has to be initialized by the nboot_context_init() before calling this function. - * - * @param context Pointer to nboot_context_t structure. - * @param imageStartAddress Pointer to start of the image in memory. - * @param isSignatureVerified Pointer to memory holding function call result. - After the function returns, the value will be set to - * @param parms Pointer to a data structure in trusted memory, holding the reference MAC. - The data structure shall be correctly filled before the function call. - * - * @retval kStatus_NBOOT_Success - * @retval kStatus_NBOOT_Fail - */ -nboot_status_protected_t NBOOT_ImgAuthenticateCmac(nboot_context_t *context, - uint8_t imageStartAddress[], - nboot_bool_t *isSignatureVerified, - nboot_img_authenticate_cmac_parms_t *parms) -{ - assert(BOOTLOADER_API_TREE_POINTER); - return BOOTLOADER_API_TREE_POINTER->nbootDriver->nboot_img_authenticate_cmac(context, imageStartAddress, - isSignatureVerified, parms); -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/runbootloader/fsl_runbootloader.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/runbootloader/fsl_runbootloader.h deleted file mode 100644 index de0ed4a9c5e..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/runbootloader/fsl_runbootloader.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef FSL_RUN_BOOTLOADER_H_ -#define FSL_RUN_BOOTLOADER_H_ - -#include "fsl_common.h" - -/*! - * @addtogroup runbootloader - * @{ - */ -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/* API prototype fields definition. -| 31 : 24 | 23 : 20 | 19 : 16 | 15 : 12 | 11 : 8 | 7 : 0 | - | Tag | Boot mode | bootloader periphal| Instance | Image Index| Reserved | -| | | | Used For Boot mode 0| | | -| | 0: Passive mode | 0 - Auto detection | | | | -| | 1: ISP mode | 1 - USB-HID | | | | -| | | 2 - UART | | | | -| | | 3 - SPI | | | | -| | | 4 - I2C | | | | -| | | 5 - CAN | | | | -*/ - -typedef struct -{ - union - { - struct - { - uint32_t reserved : 8; - uint32_t boot_image_index : 4; - uint32_t instance : 4; - uint32_t boot_interface : 4; - uint32_t mode : 4; - uint32_t tag : 8; - } B; - uint32_t U; - } option; -} user_app_boot_invoke_option_t; - -#ifdef __cplusplus -extern "C" { -#endif - -/******************************************************************************* - * API - ******************************************************************************/ - -/*! - * @brief Run the Bootloader API to force into the ISP mode base on the user arg - * - * @param arg Indicates API prototype fields definition. Refer to the above user_app_boot_invoke_option_t structure - */ -void bootloader_user_entry(void *arg); - -#ifdef __cplusplus -} -#endif - -/** - * @} - */ - -#endif /* FSL_RUN_BOOTLOADER_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/runbootloader/src/fsl_runbootloader.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/runbootloader/src/fsl_runbootloader.c deleted file mode 100644 index ebfe866f1eb..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/drivers/romapi/runbootloader/src/fsl_runbootloader.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2021 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#include "fsl_flash.h" -#include "fsl_flash_ffr.h" -#include "fsl_flexspi_nor_flash.h" -#include "fsl_runbootloader.h" - -/*! @brief Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.runBootloader" -#endif - -/******************************************************************************* - * Definitions - ******************************************************************************/ -#define BOOTLOADER_API_TREE_POINTER ((bootloader_tree_t *)0x1303fc00U) - -/*! - * @brief Root of the bootloader API tree. - * - * An instance of this struct resides in read-only memory in the bootloader. It - * provides a user application access to APIs exported by the bootloader. - * - * @note The order of existing fields must not be changed. - */ -typedef struct BootloaderTree -{ - void (*runBootloader)(void *arg); /*!< Function to start the bootloader executing.*/ - const uint32_t version; /*!< Bootloader version number.*/ - const char *copyright; /*!< Copyright string.*/ - const uint32_t reserved0; /*!< reserved*/ - const uint32_t flashDriver; /*!< Internal Flash driver API.*/ - const uint32_t reserved1[5]; /*!< reserved*/ - const uint32_t nbootDriver; /*!< Please refer to "fsl_nboot.h" */ - const uint32_t flexspiNorDriver; /*!< FlexSPI NOR FLASH Driver API.*/ - const uint32_t reserved2; /*!< reserved*/ - const uint32_t memoryInterface; /*!< Please refer to "fsl_mem_interface.h" */ -} bootloader_tree_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -void bootloader_user_entry(void *arg) -{ - assert(BOOTLOADER_API_TREE_POINTER); - BOOTLOADER_API_TREE_POINTER->runBootloader(arg); -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/fsl_device_registers.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/fsl_device_registers.h deleted file mode 100644 index 3678503d1ee..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/fsl_device_registers.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2014-2016 Freescale Semiconductor, Inc. - * Copyright 2016-2023 NXP - * SPDX-License-Identifier: BSD-3-Clause - * - */ - -#ifndef __FSL_DEVICE_REGISTERS_H__ -#define __FSL_DEVICE_REGISTERS_H__ - -/* - * Include the cpu specific register header files. - * - * The CPU macro should be declared in the project or makefile. - */ -#if (defined(CPU_MCXN947VDF_cm33_core0) || defined(CPU_MCXN947VNL_cm33_core0)) - -#define MCXN947_cm33_core0_SERIES - -/* CMSIS-style register definitions */ -#include "MCXN947_cm33_core0.h" -/* CPU specific feature definitions */ -#include "MCXN947_cm33_core0_features.h" - -#elif (defined(CPU_MCXN947VDF_cm33_core1) || defined(CPU_MCXN947VNL_cm33_core1)) - -#define MCXN947_cm33_core1_SERIES - -/* CMSIS-style register definitions */ -#include "MCXN947_cm33_core1.h" -/* CPU specific feature definitions */ -#include "MCXN947_cm33_core1_features.h" - -#else -#error "No valid CPU defined!" -#endif - -#endif /* __FSL_DEVICE_REGISTERS_H__ */ - -/******************************************************************************* - * EOF - ******************************************************************************/ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/gcc/startup_MCXN947_cm33_core0.S b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/gcc/startup_MCXN947_cm33_core0.S deleted file mode 100644 index 2cac371b571..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/gcc/startup_MCXN947_cm33_core0.S +++ /dev/null @@ -1,1948 +0,0 @@ -/* ------------------------------------------------------------------------- */ -/* @file: startup_MCXN947_cm33_core0.s */ -/* @purpose: CMSIS Cortex-M33 Core Device Startup File */ -/* MCXN947_cm33_core0 */ -/* @version: 2.0 */ -/* @date: 2023-2-1 */ -/* @build: b240410 */ -/* ------------------------------------------------------------------------- */ -/* */ -/* Copyright 1997-2016 Freescale Semiconductor, Inc. */ -/* Copyright 2016-2024 NXP */ -/* SPDX-License-Identifier: BSD-3-Clause */ -/*****************************************************************************/ -/* Version: GCC for ARM Embedded Processors */ -/*****************************************************************************/ - .syntax unified - .arch armv8-m.main - - .section .isr_vector, "a" - .align 2 - .globl __Vectors -__Vectors: - .long __StackTop /* Top of Stack */ - .long Reset_Handler /* Reset Handler */ - .long NMI_Handler /* NMI Handler*/ - .long HardFault_Handler /* Hard Fault Handler*/ - .long MemManage_Handler /* MPU Fault Handler*/ - .long BusFault_Handler /* Bus Fault Handler*/ - .long UsageFault_Handler /* Usage Fault Handler*/ - .long SecureFault_Handler /* Secure Fault Handler*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long SVC_Handler /* SVCall Handler*/ - .long DebugMon_Handler /* Debug Monitor Handler*/ - .long 0 /* Reserved*/ - .long PendSV_Handler /* PendSV Handler*/ - .long SysTick_Handler /* SysTick Handler*/ - - /* External Interrupts*/ - .long OR_IRQHandler /* OR IRQ*/ - .long EDMA_0_CH0_IRQHandler /* eDMA_0_CH0 error or transfer complete*/ - .long EDMA_0_CH1_IRQHandler /* eDMA_0_CH1 error or transfer complete*/ - .long EDMA_0_CH2_IRQHandler /* eDMA_0_CH2 error or transfer complete*/ - .long EDMA_0_CH3_IRQHandler /* eDMA_0_CH3 error or transfer complete*/ - .long EDMA_0_CH4_IRQHandler /* eDMA_0_CH4 error or transfer complete*/ - .long EDMA_0_CH5_IRQHandler /* eDMA_0_CH5 error or transfer complete*/ - .long EDMA_0_CH6_IRQHandler /* eDMA_0_CH6 error or transfer complete*/ - .long EDMA_0_CH7_IRQHandler /* eDMA_0_CH7 error or transfer complete*/ - .long EDMA_0_CH8_IRQHandler /* eDMA_0_CH8 error or transfer complete*/ - .long EDMA_0_CH9_IRQHandler /* eDMA_0_CH9 error or transfer complete*/ - .long EDMA_0_CH10_IRQHandler /* eDMA_0_CH10 error or transfer complete*/ - .long EDMA_0_CH11_IRQHandler /* eDMA_0_CH11 error or transfer complete*/ - .long EDMA_0_CH12_IRQHandler /* eDMA_0_CH12 error or transfer complete*/ - .long EDMA_0_CH13_IRQHandler /* eDMA_0_CH13 error or transfer complete*/ - .long EDMA_0_CH14_IRQHandler /* eDMA_0_CH14 error or transfer complete*/ - .long EDMA_0_CH15_IRQHandler /* eDMA_0_CH15 error or transfer complete*/ - .long GPIO00_IRQHandler /* GPIO0 interrupt 0*/ - .long GPIO01_IRQHandler /* GPIO0 interrupt 1*/ - .long GPIO10_IRQHandler /* GPIO1 interrupt 0*/ - .long GPIO11_IRQHandler /* GPIO1 interrupt 1*/ - .long GPIO20_IRQHandler /* GPIO2 interrupt 0*/ - .long GPIO21_IRQHandler /* GPIO2 interrupt 1*/ - .long GPIO30_IRQHandler /* GPIO3 interrupt 0*/ - .long GPIO31_IRQHandler /* GPIO3 interrupt 1*/ - .long GPIO40_IRQHandler /* GPIO4 interrupt 0*/ - .long GPIO41_IRQHandler /* GPIO4 interrupt 1*/ - .long GPIO50_IRQHandler /* GPIO5 interrupt 0*/ - .long GPIO51_IRQHandler /* GPIO5 interrupt 1*/ - .long UTICK0_IRQHandler /* Micro-Tick Timer interrupt*/ - .long MRT0_IRQHandler /* Multi-Rate Timer interrupt*/ - .long CTIMER0_IRQHandler /* Standard counter/timer 0 interrupt*/ - .long CTIMER1_IRQHandler /* Standard counter/timer 1 interrupt*/ - .long SCT0_IRQHandler /* SCTimer/PWM interrupt*/ - .long CTIMER2_IRQHandler /* Standard counter/timer 2 interrupt*/ - .long LP_FLEXCOMM0_IRQHandler /* LP_FLEXCOMM0 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM1_IRQHandler /* LP_FLEXCOMM1 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM2_IRQHandler /* LP_FLEXCOMM2 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM3_IRQHandler /* LP_FLEXCOMM3 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM4_IRQHandler /* LP_FLEXCOMM4 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM5_IRQHandler /* LP_FLEXCOMM5 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM6_IRQHandler /* LP_FLEXCOMM6 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM7_IRQHandler /* LP_FLEXCOMM7 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM8_IRQHandler /* LP_FLEXCOMM8 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM9_IRQHandler /* LP_FLEXCOMM9 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long ADC0_IRQHandler /* Analog-to-Digital Converter 0 - General Purpose interrupt*/ - .long ADC1_IRQHandler /* Analog-to-Digital Converter 1 - General Purpose interrupt*/ - .long PINT0_IRQHandler /* Pin Interrupt Pattern Match Interrupt*/ - .long PDM_EVENT_IRQHandler /* Microphone Interface interrupt*/ - .long Reserved65_IRQHandler /* Reserved interrupt*/ - .long USB0_FS_IRQHandler /* Universal Serial Bus - Full Speed interrupt*/ - .long USB0_DCD_IRQHandler /* Universal Serial Bus - Device Charge Detect interrupt*/ - .long RTC_IRQHandler /* RTC Subsystem interrupt (RTC interrupt or Wake timer interrupt)*/ - .long SMARTDMA_IRQHandler /* SmartDMA_IRQ*/ - .long MAILBOX_IRQHandler /* Inter-CPU Mailbox interrupt0 for CPU0 Inter-CPU Mailbox interrupt1 for CPU1*/ - .long CTIMER3_IRQHandler /* Standard counter/timer 3 interrupt*/ - .long CTIMER4_IRQHandler /* Standard counter/timer 4 interrupt*/ - .long OS_EVENT_IRQHandler /* OS event timer interrupt*/ - .long FLEXSPI0_IRQHandler /* Flexible Serial Peripheral Interface interrupt*/ - .long SAI0_IRQHandler /* Serial Audio Interface 0 interrupt*/ - .long SAI1_IRQHandler /* Serial Audio Interface 1 interrupt*/ - .long USDHC0_IRQHandler /* Ultra Secured Digital Host Controller interrupt*/ - .long CAN0_IRQHandler /* Controller Area Network 0 interrupt*/ - .long CAN1_IRQHandler /* Controller Area Network 1 interrupt*/ - .long Reserved80_IRQHandler /* Reserved interrupt*/ - .long Reserved81_IRQHandler /* Reserved interrupt*/ - .long USB1_HS_PHY_IRQHandler /* USBHS DCD or USBHS Phy interrupt*/ - .long USB1_HS_IRQHandler /* USB High Speed OTG Controller interrupt */ - .long SEC_HYPERVISOR_CALL_IRQHandler /* AHB Secure Controller hypervisor call interrupt*/ - .long Reserved85_IRQHandler /* Reserved interrupt*/ - .long PLU_IRQHandler /* Programmable Logic Unit interrupt*/ - .long Freqme_IRQHandler /* Frequency Measurement interrupt*/ - .long SEC_VIO_IRQHandler /* Secure violation interrupt (Memory Block Checker interrupt or secure AHB matrix violation interrupt)*/ - .long ELS_IRQHandler /* ELS interrupt*/ - .long PKC_IRQHandler /* PKC interrupt*/ - .long PUF_IRQHandler /* Physical Unclonable Function interrupt*/ - .long PQ_IRQHandler /* Power Quad interrupt*/ - .long EDMA_1_CH0_IRQHandler /* eDMA_1_CH0 error or transfer complete*/ - .long EDMA_1_CH1_IRQHandler /* eDMA_1_CH1 error or transfer complete*/ - .long EDMA_1_CH2_IRQHandler /* eDMA_1_CH2 error or transfer complete*/ - .long EDMA_1_CH3_IRQHandler /* eDMA_1_CH3 error or transfer complete*/ - .long EDMA_1_CH4_IRQHandler /* eDMA_1_CH4 error or transfer complete*/ - .long EDMA_1_CH5_IRQHandler /* eDMA_1_CH5 error or transfer complete*/ - .long EDMA_1_CH6_IRQHandler /* eDMA_1_CH6 error or transfer complete*/ - .long EDMA_1_CH7_IRQHandler /* eDMA_1_CH7 error or transfer complete*/ - .long EDMA_1_CH8_IRQHandler /* eDMA_1_CH8 error or transfer complete*/ - .long EDMA_1_CH9_IRQHandler /* eDMA_1_CH9 error or transfer complete*/ - .long EDMA_1_CH10_IRQHandler /* eDMA_1_CH10 error or transfer complete*/ - .long EDMA_1_CH11_IRQHandler /* eDMA_1_CH11 error or transfer complete*/ - .long EDMA_1_CH12_IRQHandler /* eDMA_1_CH12 error or transfer complete*/ - .long EDMA_1_CH13_IRQHandler /* eDMA_1_CH13 error or transfer complete*/ - .long EDMA_1_CH14_IRQHandler /* eDMA_1_CH14 error or transfer complete*/ - .long EDMA_1_CH15_IRQHandler /* eDMA_1_CH15 error or transfer complete*/ - .long CDOG0_IRQHandler /* Code Watchdog Timer 0 interrupt*/ - .long CDOG1_IRQHandler /* Code Watchdog Timer 1 interrupt*/ - .long I3C0_IRQHandler /* Improved Inter Integrated Circuit interrupt 0*/ - .long I3C1_IRQHandler /* Improved Inter Integrated Circuit interrupt 1*/ - .long NPU_IRQHandler /* NPU interrupt*/ - .long GDET_IRQHandler /* Digital Glitch Detect 0 interrupt or Digital Glitch Detect 1 interrupt*/ - .long VBAT0_IRQHandler /* VBAT interrupt( VBAT interrupt or digital tamper interrupt)*/ - .long EWM0_IRQHandler /* External Watchdog Monitor interrupt*/ - .long TSI_END_OF_SCAN_IRQHandler /* TSI End of Scan interrupt*/ - .long TSI_OUT_OF_SCAN_IRQHandler /* TSI Out of Scan interrupt*/ - .long EMVSIM0_IRQHandler /* EMVSIM0 interrupt*/ - .long EMVSIM1_IRQHandler /* EMVSIM1 interrupt*/ - .long FLEXIO_IRQHandler /* Flexible Input/Output interrupt*/ - .long DAC0_IRQHandler /* Digital-to-Analog Converter 0 - General Purpose interrupt*/ - .long DAC1_IRQHandler /* Digital-to-Analog Converter 1 - General Purpose interrupt*/ - .long DAC2_IRQHandler /* 14-bit Digital-to-Analog Converter interrupt*/ - .long HSCMP0_IRQHandler /* High-Speed comparator0 interrupt*/ - .long HSCMP1_IRQHandler /* High-Speed comparator1 interrupt*/ - .long HSCMP2_IRQHandler /* High-Speed comparator2 interrupt*/ - .long FLEXPWM0_RELOAD_ERROR_IRQHandler /* FlexPWM0_reload_error interrupt*/ - .long FLEXPWM0_FAULT_IRQHandler /* FlexPWM0_fault interrupt*/ - .long FLEXPWM0_SUBMODULE0_IRQHandler /* FlexPWM0 Submodule 0 capture/compare/reload interrupt*/ - .long FLEXPWM0_SUBMODULE1_IRQHandler /* FlexPWM0 Submodule 1 capture/compare/reload interrupt*/ - .long FLEXPWM0_SUBMODULE2_IRQHandler /* FlexPWM0 Submodule 2 capture/compare/reload interrupt*/ - .long FLEXPWM0_SUBMODULE3_IRQHandler /* FlexPWM0 Submodule 3 capture/compare/reload interrupt*/ - .long FLEXPWM1_RELOAD_ERROR_IRQHandler /* FlexPWM1_reload_error interrupt*/ - .long FLEXPWM1_FAULT_IRQHandler /* FlexPWM1_fault interrupt*/ - .long FLEXPWM1_SUBMODULE0_IRQHandler /* FlexPWM1 Submodule 0 capture/compare/reload interrupt*/ - .long FLEXPWM1_SUBMODULE1_IRQHandler /* FlexPWM1 Submodule 1 capture/compare/reload interrupt*/ - .long FLEXPWM1_SUBMODULE2_IRQHandler /* FlexPWM1 Submodule 2 capture/compare/reload interrupt*/ - .long FLEXPWM1_SUBMODULE3_IRQHandler /* FlexPWM1 Submodule 3 capture/compare/reload interrupt*/ - .long QDC0_COMPARE_IRQHandler /* QDC0_Compare interrupt*/ - .long QDC0_HOME_IRQHandler /* QDC0_Home interrupt*/ - .long QDC0_WDG_SAB_IRQHandler /* QDC0_WDG_IRQ/SAB interrupt*/ - .long QDC0_IDX_IRQHandler /* QDC0_IDX interrupt*/ - .long QDC1_COMPARE_IRQHandler /* QDC1_Compare interrupt*/ - .long QDC1_HOME_IRQHandler /* QDC1_Home interrupt*/ - .long QDC1_WDG_SAB_IRQHandler /* QDC1_WDG_IRQ/SAB interrupt*/ - .long QDC1_IDX_IRQHandler /* QDC1_IDX interrupt*/ - .long ITRC0_IRQHandler /* Intrusion and Tamper Response Controller interrupt*/ - .long BSP32_IRQHandler /* CoolFlux BSP32 interrupt*/ - .long ELS_ERR_IRQHandler /* ELS error interrupt*/ - .long PKC_ERR_IRQHandler /* PKC error interrupt*/ - .long ERM_SINGLE_BIT_ERROR_IRQHandler /* ERM Single Bit error interrupt*/ - .long ERM_MULTI_BIT_ERROR_IRQHandler /* ERM Multi Bit error interrupt*/ - .long FMU0_IRQHandler /* Flash Management Unit interrupt*/ - .long ETHERNET_IRQHandler /* Ethernet QoS interrupt*/ - .long ETHERNET_PMT_IRQHandler /* Ethernet QoS power management interrupt*/ - .long ETHERNET_MACLP_IRQHandler /* Ethernet QoS MAC interrupt*/ - .long SINC_FILTER_IRQHandler /* SINC Filter interrupt */ - .long LPTMR0_IRQHandler /* Low Power Timer 0 interrupt*/ - .long LPTMR1_IRQHandler /* Low Power Timer 1 interrupt*/ - .long SCG_IRQHandler /* System Clock Generator interrupt*/ - .long SPC_IRQHandler /* System Power Controller interrupt*/ - .long WUU_IRQHandler /* Wake Up Unit interrupt*/ - .long PORT_EFT_IRQHandler /* PORT0~5 EFT interrupt*/ - .long ETB0_IRQHandler /* ETB counter expires interrupt*/ - .long Reserved166_IRQHandler /* Reserved interrupt*/ - .long Reserved167_IRQHandler /* Reserved interrupt*/ - .long WWDT0_IRQHandler /* Windowed Watchdog Timer 0 interrupt*/ - .long WWDT1_IRQHandler /* Windowed Watchdog Timer 1 interrupt*/ - .long CMC0_IRQHandler /* Core Mode Controller interrupt*/ - .long CTI0_IRQHandler /* Cross Trigger Interface interrupt*/ - - .size __Vectors, . - __Vectors - - .text - .thumb - -#if defined (__cplusplus) -#ifdef __REDLIB__ -#error Redlib does not support C++ -#endif -#endif -/* Reset Handler */ - - .thumb_func - .align 2 - .globl Reset_Handler - .weak Reset_Handler - .type Reset_Handler, %function -Reset_Handler: - cpsid i /* Mask interrupts */ - .equ VTOR, 0xE000ED08 - ldr r0, =VTOR - ldr r1, =__Vectors - str r1, [r0] - ldr r2, [r1] - msr msp, r2 - ldr r0, =__StackLimit - msr msplim, r0 -#ifndef __NO_SYSTEM_INIT - ldr r0,=SystemInit - blx r0 -#endif -/* Loop to copy data from read only memory to RAM. The ranges - * of copy from/to are specified by following symbols evaluated in - * linker script. - * __etext: End of code section, i.e., begin of data sections to copy from. - * __data_start__/__data_end__: RAM address range that data should be - * copied to. Both must be aligned to 4 bytes boundary. */ - - ldr r1, =__etext - ldr r2, =__data_start__ - ldr r3, =__data_end__ - -#if 1 -/* Here are two copies of loop implemenations. First one favors code size - * and the second one favors performance. Default uses the first one. - * Change to "#if 0" to use the second one */ -.LC0: - cmp r2, r3 - ittt lt - ldrlt r0, [r1], #4 - strlt r0, [r2], #4 - blt .LC0 -#else - subs r3, r2 - ble .LC1 -.LC0: - subs r3, #4 - ldr r0, [r1, r3] - str r0, [r2, r3] - bgt .LC0 -.LC1: -#endif - -#ifdef __STARTUP_CLEAR_BSS -/* This part of work usually is done in C library startup code. Otherwise, - * define this macro to enable it in this startup. - * - * Loop to zero out BSS section, which uses following symbols - * in linker script: - * __bss_start__: start of BSS section. Must align to 4 - * __bss_end__: end of BSS section. Must align to 4 - */ - ldr r1, =__bss_start__ - ldr r2, =__bss_end__ - - movs r0, 0 -.LC2: - cmp r1, r2 - itt lt - strlt r0, [r1], #4 - blt .LC2 -#endif /* __STARTUP_CLEAR_BSS */ - -/* Add stack / heap initializaiton */ - movs r0, 0 - ldr r1, =__HeapBase - ldr r2, =__HeapLimit -.LC3: - cmp r1, r2 - itt lt - strlt r0, [r1], #4 - blt .LC3 - - ldr r1, =__StackLimit - ldr r2, =__StackTop -.LC4: - cmp r1, r2 - itt lt - strlt r0, [r1], #4 - blt .LC4 - -/*End of stack / heap initializaiton */ - cpsie i /* Unmask interrupts */ -#ifndef __START -#ifdef __REDLIB__ -#define __START __main -#else -#define __START _start -#endif -#endif -#ifndef __ATOLLIC__ - ldr r0,=__START - blx r0 -#else - ldr r0,=__libc_init_array - blx r0 - ldr r0,=main - bx r0 -#endif - .pool - .size Reset_Handler, . - Reset_Handler - - .align 1 - .thumb_func - .weak DefaultISR - .type DefaultISR, %function -DefaultISR: - b DefaultISR - .size DefaultISR, . - DefaultISR - - .align 1 - .thumb_func - .weak NMI_Handler - .type NMI_Handler, %function -NMI_Handler: - ldr r0,=NMI_Handler - bx r0 - .size NMI_Handler, . - NMI_Handler - - .align 1 - .thumb_func - .weak HardFault_Handler - .type HardFault_Handler, %function -HardFault_Handler: - ldr r0,=HardFault_Handler - bx r0 - .size HardFault_Handler, . - HardFault_Handler - - .align 1 - .thumb_func - .weak SVC_Handler - .type SVC_Handler, %function -SVC_Handler: - ldr r0,=SVC_Handler - bx r0 - .size SVC_Handler, . - SVC_Handler - - .align 1 - .thumb_func - .weak PendSV_Handler - .type PendSV_Handler, %function -PendSV_Handler: - ldr r0,=PendSV_Handler - bx r0 - .size PendSV_Handler, . - PendSV_Handler - - .align 1 - .thumb_func - .weak SysTick_Handler - .type SysTick_Handler, %function -SysTick_Handler: - ldr r0,=SysTick_Handler - bx r0 - .size SysTick_Handler, . - SysTick_Handler - - .align 1 - .thumb_func - .weak OR_IRQHandler - .type OR_IRQHandler, %function -OR_IRQHandler: - ldr r0,=OR_DriverIRQHandler - bx r0 - .size OR_IRQHandler, . - OR_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH0_IRQHandler - .type EDMA_0_CH0_IRQHandler, %function -EDMA_0_CH0_IRQHandler: - ldr r0,=EDMA_0_CH0_DriverIRQHandler - bx r0 - .size EDMA_0_CH0_IRQHandler, . - EDMA_0_CH0_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH1_IRQHandler - .type EDMA_0_CH1_IRQHandler, %function -EDMA_0_CH1_IRQHandler: - ldr r0,=EDMA_0_CH1_DriverIRQHandler - bx r0 - .size EDMA_0_CH1_IRQHandler, . - EDMA_0_CH1_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH2_IRQHandler - .type EDMA_0_CH2_IRQHandler, %function -EDMA_0_CH2_IRQHandler: - ldr r0,=EDMA_0_CH2_DriverIRQHandler - bx r0 - .size EDMA_0_CH2_IRQHandler, . - EDMA_0_CH2_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH3_IRQHandler - .type EDMA_0_CH3_IRQHandler, %function -EDMA_0_CH3_IRQHandler: - ldr r0,=EDMA_0_CH3_DriverIRQHandler - bx r0 - .size EDMA_0_CH3_IRQHandler, . - EDMA_0_CH3_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH4_IRQHandler - .type EDMA_0_CH4_IRQHandler, %function -EDMA_0_CH4_IRQHandler: - ldr r0,=EDMA_0_CH4_DriverIRQHandler - bx r0 - .size EDMA_0_CH4_IRQHandler, . - EDMA_0_CH4_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH5_IRQHandler - .type EDMA_0_CH5_IRQHandler, %function -EDMA_0_CH5_IRQHandler: - ldr r0,=EDMA_0_CH5_DriverIRQHandler - bx r0 - .size EDMA_0_CH5_IRQHandler, . - EDMA_0_CH5_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH6_IRQHandler - .type EDMA_0_CH6_IRQHandler, %function -EDMA_0_CH6_IRQHandler: - ldr r0,=EDMA_0_CH6_DriverIRQHandler - bx r0 - .size EDMA_0_CH6_IRQHandler, . - EDMA_0_CH6_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH7_IRQHandler - .type EDMA_0_CH7_IRQHandler, %function -EDMA_0_CH7_IRQHandler: - ldr r0,=EDMA_0_CH7_DriverIRQHandler - bx r0 - .size EDMA_0_CH7_IRQHandler, . - EDMA_0_CH7_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH8_IRQHandler - .type EDMA_0_CH8_IRQHandler, %function -EDMA_0_CH8_IRQHandler: - ldr r0,=EDMA_0_CH8_DriverIRQHandler - bx r0 - .size EDMA_0_CH8_IRQHandler, . - EDMA_0_CH8_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH9_IRQHandler - .type EDMA_0_CH9_IRQHandler, %function -EDMA_0_CH9_IRQHandler: - ldr r0,=EDMA_0_CH9_DriverIRQHandler - bx r0 - .size EDMA_0_CH9_IRQHandler, . - EDMA_0_CH9_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH10_IRQHandler - .type EDMA_0_CH10_IRQHandler, %function -EDMA_0_CH10_IRQHandler: - ldr r0,=EDMA_0_CH10_DriverIRQHandler - bx r0 - .size EDMA_0_CH10_IRQHandler, . - EDMA_0_CH10_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH11_IRQHandler - .type EDMA_0_CH11_IRQHandler, %function -EDMA_0_CH11_IRQHandler: - ldr r0,=EDMA_0_CH11_DriverIRQHandler - bx r0 - .size EDMA_0_CH11_IRQHandler, . - EDMA_0_CH11_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH12_IRQHandler - .type EDMA_0_CH12_IRQHandler, %function -EDMA_0_CH12_IRQHandler: - ldr r0,=EDMA_0_CH12_DriverIRQHandler - bx r0 - .size EDMA_0_CH12_IRQHandler, . - EDMA_0_CH12_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH13_IRQHandler - .type EDMA_0_CH13_IRQHandler, %function -EDMA_0_CH13_IRQHandler: - ldr r0,=EDMA_0_CH13_DriverIRQHandler - bx r0 - .size EDMA_0_CH13_IRQHandler, . - EDMA_0_CH13_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH14_IRQHandler - .type EDMA_0_CH14_IRQHandler, %function -EDMA_0_CH14_IRQHandler: - ldr r0,=EDMA_0_CH14_DriverIRQHandler - bx r0 - .size EDMA_0_CH14_IRQHandler, . - EDMA_0_CH14_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH15_IRQHandler - .type EDMA_0_CH15_IRQHandler, %function -EDMA_0_CH15_IRQHandler: - ldr r0,=EDMA_0_CH15_DriverIRQHandler - bx r0 - .size EDMA_0_CH15_IRQHandler, . - EDMA_0_CH15_IRQHandler - - .align 1 - .thumb_func - .weak GPIO00_IRQHandler - .type GPIO00_IRQHandler, %function -GPIO00_IRQHandler: - ldr r0,=GPIO00_DriverIRQHandler - bx r0 - .size GPIO00_IRQHandler, . - GPIO00_IRQHandler - - .align 1 - .thumb_func - .weak GPIO01_IRQHandler - .type GPIO01_IRQHandler, %function -GPIO01_IRQHandler: - ldr r0,=GPIO01_DriverIRQHandler - bx r0 - .size GPIO01_IRQHandler, . - GPIO01_IRQHandler - - .align 1 - .thumb_func - .weak GPIO10_IRQHandler - .type GPIO10_IRQHandler, %function -GPIO10_IRQHandler: - ldr r0,=GPIO10_DriverIRQHandler - bx r0 - .size GPIO10_IRQHandler, . - GPIO10_IRQHandler - - .align 1 - .thumb_func - .weak GPIO11_IRQHandler - .type GPIO11_IRQHandler, %function -GPIO11_IRQHandler: - ldr r0,=GPIO11_DriverIRQHandler - bx r0 - .size GPIO11_IRQHandler, . - GPIO11_IRQHandler - - .align 1 - .thumb_func - .weak GPIO20_IRQHandler - .type GPIO20_IRQHandler, %function -GPIO20_IRQHandler: - ldr r0,=GPIO20_DriverIRQHandler - bx r0 - .size GPIO20_IRQHandler, . - GPIO20_IRQHandler - - .align 1 - .thumb_func - .weak GPIO21_IRQHandler - .type GPIO21_IRQHandler, %function -GPIO21_IRQHandler: - ldr r0,=GPIO21_DriverIRQHandler - bx r0 - .size GPIO21_IRQHandler, . - GPIO21_IRQHandler - - .align 1 - .thumb_func - .weak GPIO30_IRQHandler - .type GPIO30_IRQHandler, %function -GPIO30_IRQHandler: - ldr r0,=GPIO30_DriverIRQHandler - bx r0 - .size GPIO30_IRQHandler, . - GPIO30_IRQHandler - - .align 1 - .thumb_func - .weak GPIO31_IRQHandler - .type GPIO31_IRQHandler, %function -GPIO31_IRQHandler: - ldr r0,=GPIO31_DriverIRQHandler - bx r0 - .size GPIO31_IRQHandler, . - GPIO31_IRQHandler - - .align 1 - .thumb_func - .weak GPIO40_IRQHandler - .type GPIO40_IRQHandler, %function -GPIO40_IRQHandler: - ldr r0,=GPIO40_DriverIRQHandler - bx r0 - .size GPIO40_IRQHandler, . - GPIO40_IRQHandler - - .align 1 - .thumb_func - .weak GPIO41_IRQHandler - .type GPIO41_IRQHandler, %function -GPIO41_IRQHandler: - ldr r0,=GPIO41_DriverIRQHandler - bx r0 - .size GPIO41_IRQHandler, . - GPIO41_IRQHandler - - .align 1 - .thumb_func - .weak GPIO50_IRQHandler - .type GPIO50_IRQHandler, %function -GPIO50_IRQHandler: - ldr r0,=GPIO50_DriverIRQHandler - bx r0 - .size GPIO50_IRQHandler, . - GPIO50_IRQHandler - - .align 1 - .thumb_func - .weak GPIO51_IRQHandler - .type GPIO51_IRQHandler, %function -GPIO51_IRQHandler: - ldr r0,=GPIO51_DriverIRQHandler - bx r0 - .size GPIO51_IRQHandler, . - GPIO51_IRQHandler - - .align 1 - .thumb_func - .weak UTICK0_IRQHandler - .type UTICK0_IRQHandler, %function -UTICK0_IRQHandler: - ldr r0,=UTICK0_DriverIRQHandler - bx r0 - .size UTICK0_IRQHandler, . - UTICK0_IRQHandler - - .align 1 - .thumb_func - .weak MRT0_IRQHandler - .type MRT0_IRQHandler, %function -MRT0_IRQHandler: - ldr r0,=MRT0_DriverIRQHandler - bx r0 - .size MRT0_IRQHandler, . - MRT0_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER0_IRQHandler - .type CTIMER0_IRQHandler, %function -CTIMER0_IRQHandler: - ldr r0,=CTIMER0_DriverIRQHandler - bx r0 - .size CTIMER0_IRQHandler, . - CTIMER0_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER1_IRQHandler - .type CTIMER1_IRQHandler, %function -CTIMER1_IRQHandler: - ldr r0,=CTIMER1_DriverIRQHandler - bx r0 - .size CTIMER1_IRQHandler, . - CTIMER1_IRQHandler - - .align 1 - .thumb_func - .weak SCT0_IRQHandler - .type SCT0_IRQHandler, %function -SCT0_IRQHandler: - ldr r0,=SCT0_DriverIRQHandler - bx r0 - .size SCT0_IRQHandler, . - SCT0_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER2_IRQHandler - .type CTIMER2_IRQHandler, %function -CTIMER2_IRQHandler: - ldr r0,=CTIMER2_DriverIRQHandler - bx r0 - .size CTIMER2_IRQHandler, . - CTIMER2_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM0_IRQHandler - .type LP_FLEXCOMM0_IRQHandler, %function -LP_FLEXCOMM0_IRQHandler: - ldr r0,=LP_FLEXCOMM0_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM0_IRQHandler, . - LP_FLEXCOMM0_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM1_IRQHandler - .type LP_FLEXCOMM1_IRQHandler, %function -LP_FLEXCOMM1_IRQHandler: - ldr r0,=LP_FLEXCOMM1_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM1_IRQHandler, . - LP_FLEXCOMM1_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM2_IRQHandler - .type LP_FLEXCOMM2_IRQHandler, %function -LP_FLEXCOMM2_IRQHandler: - ldr r0,=LP_FLEXCOMM2_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM2_IRQHandler, . - LP_FLEXCOMM2_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM3_IRQHandler - .type LP_FLEXCOMM3_IRQHandler, %function -LP_FLEXCOMM3_IRQHandler: - ldr r0,=LP_FLEXCOMM3_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM3_IRQHandler, . - LP_FLEXCOMM3_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM4_IRQHandler - .type LP_FLEXCOMM4_IRQHandler, %function -LP_FLEXCOMM4_IRQHandler: - ldr r0,=LP_FLEXCOMM4_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM4_IRQHandler, . - LP_FLEXCOMM4_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM5_IRQHandler - .type LP_FLEXCOMM5_IRQHandler, %function -LP_FLEXCOMM5_IRQHandler: - ldr r0,=LP_FLEXCOMM5_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM5_IRQHandler, . - LP_FLEXCOMM5_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM6_IRQHandler - .type LP_FLEXCOMM6_IRQHandler, %function -LP_FLEXCOMM6_IRQHandler: - ldr r0,=LP_FLEXCOMM6_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM6_IRQHandler, . - LP_FLEXCOMM6_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM7_IRQHandler - .type LP_FLEXCOMM7_IRQHandler, %function -LP_FLEXCOMM7_IRQHandler: - ldr r0,=LP_FLEXCOMM7_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM7_IRQHandler, . - LP_FLEXCOMM7_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM8_IRQHandler - .type LP_FLEXCOMM8_IRQHandler, %function -LP_FLEXCOMM8_IRQHandler: - ldr r0,=LP_FLEXCOMM8_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM8_IRQHandler, . - LP_FLEXCOMM8_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM9_IRQHandler - .type LP_FLEXCOMM9_IRQHandler, %function -LP_FLEXCOMM9_IRQHandler: - ldr r0,=LP_FLEXCOMM9_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM9_IRQHandler, . - LP_FLEXCOMM9_IRQHandler - - .align 1 - .thumb_func - .weak ADC0_IRQHandler - .type ADC0_IRQHandler, %function -ADC0_IRQHandler: - ldr r0,=ADC0_DriverIRQHandler - bx r0 - .size ADC0_IRQHandler, . - ADC0_IRQHandler - - .align 1 - .thumb_func - .weak ADC1_IRQHandler - .type ADC1_IRQHandler, %function -ADC1_IRQHandler: - ldr r0,=ADC1_DriverIRQHandler - bx r0 - .size ADC1_IRQHandler, . - ADC1_IRQHandler - - .align 1 - .thumb_func - .weak PINT0_IRQHandler - .type PINT0_IRQHandler, %function -PINT0_IRQHandler: - ldr r0,=PINT0_DriverIRQHandler - bx r0 - .size PINT0_IRQHandler, . - PINT0_IRQHandler - - .align 1 - .thumb_func - .weak PDM_EVENT_IRQHandler - .type PDM_EVENT_IRQHandler, %function -PDM_EVENT_IRQHandler: - ldr r0,=PDM_EVENT_DriverIRQHandler - bx r0 - .size PDM_EVENT_IRQHandler, . - PDM_EVENT_IRQHandler - - .align 1 - .thumb_func - .weak Reserved65_IRQHandler - .type Reserved65_IRQHandler, %function -Reserved65_IRQHandler: - ldr r0,=Reserved65_DriverIRQHandler - bx r0 - .size Reserved65_IRQHandler, . - Reserved65_IRQHandler - - .align 1 - .thumb_func - .weak USB0_FS_IRQHandler - .type USB0_FS_IRQHandler, %function -USB0_FS_IRQHandler: - ldr r0,=USB0_FS_DriverIRQHandler - bx r0 - .size USB0_FS_IRQHandler, . - USB0_FS_IRQHandler - - .align 1 - .thumb_func - .weak USB0_DCD_IRQHandler - .type USB0_DCD_IRQHandler, %function -USB0_DCD_IRQHandler: - ldr r0,=USB0_DCD_DriverIRQHandler - bx r0 - .size USB0_DCD_IRQHandler, . - USB0_DCD_IRQHandler - - .align 1 - .thumb_func - .weak RTC_IRQHandler - .type RTC_IRQHandler, %function -RTC_IRQHandler: - ldr r0,=RTC_DriverIRQHandler - bx r0 - .size RTC_IRQHandler, . - RTC_IRQHandler - - .align 1 - .thumb_func - .weak SMARTDMA_IRQHandler - .type SMARTDMA_IRQHandler, %function -SMARTDMA_IRQHandler: - ldr r0,=SMARTDMA_DriverIRQHandler - bx r0 - .size SMARTDMA_IRQHandler, . - SMARTDMA_IRQHandler - - .align 1 - .thumb_func - .weak MAILBOX_IRQHandler - .type MAILBOX_IRQHandler, %function -MAILBOX_IRQHandler: - ldr r0,=MAILBOX_DriverIRQHandler - bx r0 - .size MAILBOX_IRQHandler, . - MAILBOX_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER3_IRQHandler - .type CTIMER3_IRQHandler, %function -CTIMER3_IRQHandler: - ldr r0,=CTIMER3_DriverIRQHandler - bx r0 - .size CTIMER3_IRQHandler, . - CTIMER3_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER4_IRQHandler - .type CTIMER4_IRQHandler, %function -CTIMER4_IRQHandler: - ldr r0,=CTIMER4_DriverIRQHandler - bx r0 - .size CTIMER4_IRQHandler, . - CTIMER4_IRQHandler - - .align 1 - .thumb_func - .weak OS_EVENT_IRQHandler - .type OS_EVENT_IRQHandler, %function -OS_EVENT_IRQHandler: - ldr r0,=OS_EVENT_DriverIRQHandler - bx r0 - .size OS_EVENT_IRQHandler, . - OS_EVENT_IRQHandler - - .align 1 - .thumb_func - .weak FLEXSPI0_IRQHandler - .type FLEXSPI0_IRQHandler, %function -FLEXSPI0_IRQHandler: - ldr r0,=FLEXSPI0_DriverIRQHandler - bx r0 - .size FLEXSPI0_IRQHandler, . - FLEXSPI0_IRQHandler - - .align 1 - .thumb_func - .weak SAI0_IRQHandler - .type SAI0_IRQHandler, %function -SAI0_IRQHandler: - ldr r0,=SAI0_DriverIRQHandler - bx r0 - .size SAI0_IRQHandler, . - SAI0_IRQHandler - - .align 1 - .thumb_func - .weak SAI1_IRQHandler - .type SAI1_IRQHandler, %function -SAI1_IRQHandler: - ldr r0,=SAI1_DriverIRQHandler - bx r0 - .size SAI1_IRQHandler, . - SAI1_IRQHandler - - .align 1 - .thumb_func - .weak USDHC0_IRQHandler - .type USDHC0_IRQHandler, %function -USDHC0_IRQHandler: - ldr r0,=USDHC0_DriverIRQHandler - bx r0 - .size USDHC0_IRQHandler, . - USDHC0_IRQHandler - - .align 1 - .thumb_func - .weak CAN0_IRQHandler - .type CAN0_IRQHandler, %function -CAN0_IRQHandler: - ldr r0,=CAN0_DriverIRQHandler - bx r0 - .size CAN0_IRQHandler, . - CAN0_IRQHandler - - .align 1 - .thumb_func - .weak CAN1_IRQHandler - .type CAN1_IRQHandler, %function -CAN1_IRQHandler: - ldr r0,=CAN1_DriverIRQHandler - bx r0 - .size CAN1_IRQHandler, . - CAN1_IRQHandler - - .align 1 - .thumb_func - .weak Reserved80_IRQHandler - .type Reserved80_IRQHandler, %function -Reserved80_IRQHandler: - ldr r0,=Reserved80_DriverIRQHandler - bx r0 - .size Reserved80_IRQHandler, . - Reserved80_IRQHandler - - .align 1 - .thumb_func - .weak Reserved81_IRQHandler - .type Reserved81_IRQHandler, %function -Reserved81_IRQHandler: - ldr r0,=Reserved81_DriverIRQHandler - bx r0 - .size Reserved81_IRQHandler, . - Reserved81_IRQHandler - - .align 1 - .thumb_func - .weak USB1_HS_PHY_IRQHandler - .type USB1_HS_PHY_IRQHandler, %function -USB1_HS_PHY_IRQHandler: - ldr r0,=USB1_HS_PHY_DriverIRQHandler - bx r0 - .size USB1_HS_PHY_IRQHandler, . - USB1_HS_PHY_IRQHandler - - .align 1 - .thumb_func - .weak USB1_HS_IRQHandler - .type USB1_HS_IRQHandler, %function -USB1_HS_IRQHandler: - ldr r0,=USB1_HS_DriverIRQHandler - bx r0 - .size USB1_HS_IRQHandler, . - USB1_HS_IRQHandler - - .align 1 - .thumb_func - .weak SEC_HYPERVISOR_CALL_IRQHandler - .type SEC_HYPERVISOR_CALL_IRQHandler, %function -SEC_HYPERVISOR_CALL_IRQHandler: - ldr r0,=SEC_HYPERVISOR_CALL_DriverIRQHandler - bx r0 - .size SEC_HYPERVISOR_CALL_IRQHandler, . - SEC_HYPERVISOR_CALL_IRQHandler - - .align 1 - .thumb_func - .weak Reserved85_IRQHandler - .type Reserved85_IRQHandler, %function -Reserved85_IRQHandler: - ldr r0,=Reserved85_DriverIRQHandler - bx r0 - .size Reserved85_IRQHandler, . - Reserved85_IRQHandler - - .align 1 - .thumb_func - .weak PLU_IRQHandler - .type PLU_IRQHandler, %function -PLU_IRQHandler: - ldr r0,=PLU_DriverIRQHandler - bx r0 - .size PLU_IRQHandler, . - PLU_IRQHandler - - .align 1 - .thumb_func - .weak Freqme_IRQHandler - .type Freqme_IRQHandler, %function -Freqme_IRQHandler: - ldr r0,=Freqme_DriverIRQHandler - bx r0 - .size Freqme_IRQHandler, . - Freqme_IRQHandler - - .align 1 - .thumb_func - .weak SEC_VIO_IRQHandler - .type SEC_VIO_IRQHandler, %function -SEC_VIO_IRQHandler: - ldr r0,=SEC_VIO_DriverIRQHandler - bx r0 - .size SEC_VIO_IRQHandler, . - SEC_VIO_IRQHandler - - .align 1 - .thumb_func - .weak ELS_IRQHandler - .type ELS_IRQHandler, %function -ELS_IRQHandler: - ldr r0,=ELS_DriverIRQHandler - bx r0 - .size ELS_IRQHandler, . - ELS_IRQHandler - - .align 1 - .thumb_func - .weak PKC_IRQHandler - .type PKC_IRQHandler, %function -PKC_IRQHandler: - ldr r0,=PKC_DriverIRQHandler - bx r0 - .size PKC_IRQHandler, . - PKC_IRQHandler - - .align 1 - .thumb_func - .weak PUF_IRQHandler - .type PUF_IRQHandler, %function -PUF_IRQHandler: - ldr r0,=PUF_DriverIRQHandler - bx r0 - .size PUF_IRQHandler, . - PUF_IRQHandler - - .align 1 - .thumb_func - .weak PQ_IRQHandler - .type PQ_IRQHandler, %function -PQ_IRQHandler: - ldr r0,=PQ_DriverIRQHandler - bx r0 - .size PQ_IRQHandler, . - PQ_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH0_IRQHandler - .type EDMA_1_CH0_IRQHandler, %function -EDMA_1_CH0_IRQHandler: - ldr r0,=EDMA_1_CH0_DriverIRQHandler - bx r0 - .size EDMA_1_CH0_IRQHandler, . - EDMA_1_CH0_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH1_IRQHandler - .type EDMA_1_CH1_IRQHandler, %function -EDMA_1_CH1_IRQHandler: - ldr r0,=EDMA_1_CH1_DriverIRQHandler - bx r0 - .size EDMA_1_CH1_IRQHandler, . - EDMA_1_CH1_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH2_IRQHandler - .type EDMA_1_CH2_IRQHandler, %function -EDMA_1_CH2_IRQHandler: - ldr r0,=EDMA_1_CH2_DriverIRQHandler - bx r0 - .size EDMA_1_CH2_IRQHandler, . - EDMA_1_CH2_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH3_IRQHandler - .type EDMA_1_CH3_IRQHandler, %function -EDMA_1_CH3_IRQHandler: - ldr r0,=EDMA_1_CH3_DriverIRQHandler - bx r0 - .size EDMA_1_CH3_IRQHandler, . - EDMA_1_CH3_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH4_IRQHandler - .type EDMA_1_CH4_IRQHandler, %function -EDMA_1_CH4_IRQHandler: - ldr r0,=EDMA_1_CH4_DriverIRQHandler - bx r0 - .size EDMA_1_CH4_IRQHandler, . - EDMA_1_CH4_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH5_IRQHandler - .type EDMA_1_CH5_IRQHandler, %function -EDMA_1_CH5_IRQHandler: - ldr r0,=EDMA_1_CH5_DriverIRQHandler - bx r0 - .size EDMA_1_CH5_IRQHandler, . - EDMA_1_CH5_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH6_IRQHandler - .type EDMA_1_CH6_IRQHandler, %function -EDMA_1_CH6_IRQHandler: - ldr r0,=EDMA_1_CH6_DriverIRQHandler - bx r0 - .size EDMA_1_CH6_IRQHandler, . - EDMA_1_CH6_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH7_IRQHandler - .type EDMA_1_CH7_IRQHandler, %function -EDMA_1_CH7_IRQHandler: - ldr r0,=EDMA_1_CH7_DriverIRQHandler - bx r0 - .size EDMA_1_CH7_IRQHandler, . - EDMA_1_CH7_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH8_IRQHandler - .type EDMA_1_CH8_IRQHandler, %function -EDMA_1_CH8_IRQHandler: - ldr r0,=EDMA_1_CH8_DriverIRQHandler - bx r0 - .size EDMA_1_CH8_IRQHandler, . - EDMA_1_CH8_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH9_IRQHandler - .type EDMA_1_CH9_IRQHandler, %function -EDMA_1_CH9_IRQHandler: - ldr r0,=EDMA_1_CH9_DriverIRQHandler - bx r0 - .size EDMA_1_CH9_IRQHandler, . - EDMA_1_CH9_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH10_IRQHandler - .type EDMA_1_CH10_IRQHandler, %function -EDMA_1_CH10_IRQHandler: - ldr r0,=EDMA_1_CH10_DriverIRQHandler - bx r0 - .size EDMA_1_CH10_IRQHandler, . - EDMA_1_CH10_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH11_IRQHandler - .type EDMA_1_CH11_IRQHandler, %function -EDMA_1_CH11_IRQHandler: - ldr r0,=EDMA_1_CH11_DriverIRQHandler - bx r0 - .size EDMA_1_CH11_IRQHandler, . - EDMA_1_CH11_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH12_IRQHandler - .type EDMA_1_CH12_IRQHandler, %function -EDMA_1_CH12_IRQHandler: - ldr r0,=EDMA_1_CH12_DriverIRQHandler - bx r0 - .size EDMA_1_CH12_IRQHandler, . - EDMA_1_CH12_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH13_IRQHandler - .type EDMA_1_CH13_IRQHandler, %function -EDMA_1_CH13_IRQHandler: - ldr r0,=EDMA_1_CH13_DriverIRQHandler - bx r0 - .size EDMA_1_CH13_IRQHandler, . - EDMA_1_CH13_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH14_IRQHandler - .type EDMA_1_CH14_IRQHandler, %function -EDMA_1_CH14_IRQHandler: - ldr r0,=EDMA_1_CH14_DriverIRQHandler - bx r0 - .size EDMA_1_CH14_IRQHandler, . - EDMA_1_CH14_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH15_IRQHandler - .type EDMA_1_CH15_IRQHandler, %function -EDMA_1_CH15_IRQHandler: - ldr r0,=EDMA_1_CH15_DriverIRQHandler - bx r0 - .size EDMA_1_CH15_IRQHandler, . - EDMA_1_CH15_IRQHandler - - .align 1 - .thumb_func - .weak CDOG0_IRQHandler - .type CDOG0_IRQHandler, %function -CDOG0_IRQHandler: - ldr r0,=CDOG0_DriverIRQHandler - bx r0 - .size CDOG0_IRQHandler, . - CDOG0_IRQHandler - - .align 1 - .thumb_func - .weak CDOG1_IRQHandler - .type CDOG1_IRQHandler, %function -CDOG1_IRQHandler: - ldr r0,=CDOG1_DriverIRQHandler - bx r0 - .size CDOG1_IRQHandler, . - CDOG1_IRQHandler - - .align 1 - .thumb_func - .weak I3C0_IRQHandler - .type I3C0_IRQHandler, %function -I3C0_IRQHandler: - ldr r0,=I3C0_DriverIRQHandler - bx r0 - .size I3C0_IRQHandler, . - I3C0_IRQHandler - - .align 1 - .thumb_func - .weak I3C1_IRQHandler - .type I3C1_IRQHandler, %function -I3C1_IRQHandler: - ldr r0,=I3C1_DriverIRQHandler - bx r0 - .size I3C1_IRQHandler, . - I3C1_IRQHandler - - .align 1 - .thumb_func - .weak NPU_IRQHandler - .type NPU_IRQHandler, %function -NPU_IRQHandler: - ldr r0,=NPU_DriverIRQHandler - bx r0 - .size NPU_IRQHandler, . - NPU_IRQHandler - - .align 1 - .thumb_func - .weak GDET_IRQHandler - .type GDET_IRQHandler, %function -GDET_IRQHandler: - ldr r0,=GDET_DriverIRQHandler - bx r0 - .size GDET_IRQHandler, . - GDET_IRQHandler - - .align 1 - .thumb_func - .weak VBAT0_IRQHandler - .type VBAT0_IRQHandler, %function -VBAT0_IRQHandler: - ldr r0,=VBAT0_DriverIRQHandler - bx r0 - .size VBAT0_IRQHandler, . - VBAT0_IRQHandler - - .align 1 - .thumb_func - .weak EWM0_IRQHandler - .type EWM0_IRQHandler, %function -EWM0_IRQHandler: - ldr r0,=EWM0_DriverIRQHandler - bx r0 - .size EWM0_IRQHandler, . - EWM0_IRQHandler - - .align 1 - .thumb_func - .weak TSI_END_OF_SCAN_IRQHandler - .type TSI_END_OF_SCAN_IRQHandler, %function -TSI_END_OF_SCAN_IRQHandler: - ldr r0,=TSI_END_OF_SCAN_DriverIRQHandler - bx r0 - .size TSI_END_OF_SCAN_IRQHandler, . - TSI_END_OF_SCAN_IRQHandler - - .align 1 - .thumb_func - .weak TSI_OUT_OF_SCAN_IRQHandler - .type TSI_OUT_OF_SCAN_IRQHandler, %function -TSI_OUT_OF_SCAN_IRQHandler: - ldr r0,=TSI_OUT_OF_SCAN_DriverIRQHandler - bx r0 - .size TSI_OUT_OF_SCAN_IRQHandler, . - TSI_OUT_OF_SCAN_IRQHandler - - .align 1 - .thumb_func - .weak EMVSIM0_IRQHandler - .type EMVSIM0_IRQHandler, %function -EMVSIM0_IRQHandler: - ldr r0,=EMVSIM0_DriverIRQHandler - bx r0 - .size EMVSIM0_IRQHandler, . - EMVSIM0_IRQHandler - - .align 1 - .thumb_func - .weak EMVSIM1_IRQHandler - .type EMVSIM1_IRQHandler, %function -EMVSIM1_IRQHandler: - ldr r0,=EMVSIM1_DriverIRQHandler - bx r0 - .size EMVSIM1_IRQHandler, . - EMVSIM1_IRQHandler - - .align 1 - .thumb_func - .weak FLEXIO_IRQHandler - .type FLEXIO_IRQHandler, %function -FLEXIO_IRQHandler: - ldr r0,=FLEXIO_DriverIRQHandler - bx r0 - .size FLEXIO_IRQHandler, . - FLEXIO_IRQHandler - - .align 1 - .thumb_func - .weak DAC0_IRQHandler - .type DAC0_IRQHandler, %function -DAC0_IRQHandler: - ldr r0,=DAC0_DriverIRQHandler - bx r0 - .size DAC0_IRQHandler, . - DAC0_IRQHandler - - .align 1 - .thumb_func - .weak DAC1_IRQHandler - .type DAC1_IRQHandler, %function -DAC1_IRQHandler: - ldr r0,=DAC1_DriverIRQHandler - bx r0 - .size DAC1_IRQHandler, . - DAC1_IRQHandler - - .align 1 - .thumb_func - .weak DAC2_IRQHandler - .type DAC2_IRQHandler, %function -DAC2_IRQHandler: - ldr r0,=DAC2_DriverIRQHandler - bx r0 - .size DAC2_IRQHandler, . - DAC2_IRQHandler - - .align 1 - .thumb_func - .weak HSCMP0_IRQHandler - .type HSCMP0_IRQHandler, %function -HSCMP0_IRQHandler: - ldr r0,=HSCMP0_DriverIRQHandler - bx r0 - .size HSCMP0_IRQHandler, . - HSCMP0_IRQHandler - - .align 1 - .thumb_func - .weak HSCMP1_IRQHandler - .type HSCMP1_IRQHandler, %function -HSCMP1_IRQHandler: - ldr r0,=HSCMP1_DriverIRQHandler - bx r0 - .size HSCMP1_IRQHandler, . - HSCMP1_IRQHandler - - .align 1 - .thumb_func - .weak HSCMP2_IRQHandler - .type HSCMP2_IRQHandler, %function -HSCMP2_IRQHandler: - ldr r0,=HSCMP2_DriverIRQHandler - bx r0 - .size HSCMP2_IRQHandler, . - HSCMP2_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_RELOAD_ERROR_IRQHandler - .type FLEXPWM0_RELOAD_ERROR_IRQHandler, %function -FLEXPWM0_RELOAD_ERROR_IRQHandler: - ldr r0,=FLEXPWM0_RELOAD_ERROR_DriverIRQHandler - bx r0 - .size FLEXPWM0_RELOAD_ERROR_IRQHandler, . - FLEXPWM0_RELOAD_ERROR_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_FAULT_IRQHandler - .type FLEXPWM0_FAULT_IRQHandler, %function -FLEXPWM0_FAULT_IRQHandler: - ldr r0,=FLEXPWM0_FAULT_DriverIRQHandler - bx r0 - .size FLEXPWM0_FAULT_IRQHandler, . - FLEXPWM0_FAULT_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE0_IRQHandler - .type FLEXPWM0_SUBMODULE0_IRQHandler, %function -FLEXPWM0_SUBMODULE0_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE0_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE0_IRQHandler, . - FLEXPWM0_SUBMODULE0_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE1_IRQHandler - .type FLEXPWM0_SUBMODULE1_IRQHandler, %function -FLEXPWM0_SUBMODULE1_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE1_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE1_IRQHandler, . - FLEXPWM0_SUBMODULE1_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE2_IRQHandler - .type FLEXPWM0_SUBMODULE2_IRQHandler, %function -FLEXPWM0_SUBMODULE2_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE2_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE2_IRQHandler, . - FLEXPWM0_SUBMODULE2_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE3_IRQHandler - .type FLEXPWM0_SUBMODULE3_IRQHandler, %function -FLEXPWM0_SUBMODULE3_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE3_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE3_IRQHandler, . - FLEXPWM0_SUBMODULE3_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_RELOAD_ERROR_IRQHandler - .type FLEXPWM1_RELOAD_ERROR_IRQHandler, %function -FLEXPWM1_RELOAD_ERROR_IRQHandler: - ldr r0,=FLEXPWM1_RELOAD_ERROR_DriverIRQHandler - bx r0 - .size FLEXPWM1_RELOAD_ERROR_IRQHandler, . - FLEXPWM1_RELOAD_ERROR_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_FAULT_IRQHandler - .type FLEXPWM1_FAULT_IRQHandler, %function -FLEXPWM1_FAULT_IRQHandler: - ldr r0,=FLEXPWM1_FAULT_DriverIRQHandler - bx r0 - .size FLEXPWM1_FAULT_IRQHandler, . - FLEXPWM1_FAULT_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_SUBMODULE0_IRQHandler - .type FLEXPWM1_SUBMODULE0_IRQHandler, %function -FLEXPWM1_SUBMODULE0_IRQHandler: - ldr r0,=FLEXPWM1_SUBMODULE0_DriverIRQHandler - bx r0 - .size FLEXPWM1_SUBMODULE0_IRQHandler, . - FLEXPWM1_SUBMODULE0_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_SUBMODULE1_IRQHandler - .type FLEXPWM1_SUBMODULE1_IRQHandler, %function -FLEXPWM1_SUBMODULE1_IRQHandler: - ldr r0,=FLEXPWM1_SUBMODULE1_DriverIRQHandler - bx r0 - .size FLEXPWM1_SUBMODULE1_IRQHandler, . - FLEXPWM1_SUBMODULE1_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_SUBMODULE2_IRQHandler - .type FLEXPWM1_SUBMODULE2_IRQHandler, %function -FLEXPWM1_SUBMODULE2_IRQHandler: - ldr r0,=FLEXPWM1_SUBMODULE2_DriverIRQHandler - bx r0 - .size FLEXPWM1_SUBMODULE2_IRQHandler, . - FLEXPWM1_SUBMODULE2_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_SUBMODULE3_IRQHandler - .type FLEXPWM1_SUBMODULE3_IRQHandler, %function -FLEXPWM1_SUBMODULE3_IRQHandler: - ldr r0,=FLEXPWM1_SUBMODULE3_DriverIRQHandler - bx r0 - .size FLEXPWM1_SUBMODULE3_IRQHandler, . - FLEXPWM1_SUBMODULE3_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_COMPARE_IRQHandler - .type QDC0_COMPARE_IRQHandler, %function -QDC0_COMPARE_IRQHandler: - ldr r0,=QDC0_COMPARE_DriverIRQHandler - bx r0 - .size QDC0_COMPARE_IRQHandler, . - QDC0_COMPARE_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_HOME_IRQHandler - .type QDC0_HOME_IRQHandler, %function -QDC0_HOME_IRQHandler: - ldr r0,=QDC0_HOME_DriverIRQHandler - bx r0 - .size QDC0_HOME_IRQHandler, . - QDC0_HOME_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_WDG_SAB_IRQHandler - .type QDC0_WDG_SAB_IRQHandler, %function -QDC0_WDG_SAB_IRQHandler: - ldr r0,=QDC0_WDG_SAB_DriverIRQHandler - bx r0 - .size QDC0_WDG_SAB_IRQHandler, . - QDC0_WDG_SAB_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_IDX_IRQHandler - .type QDC0_IDX_IRQHandler, %function -QDC0_IDX_IRQHandler: - ldr r0,=QDC0_IDX_DriverIRQHandler - bx r0 - .size QDC0_IDX_IRQHandler, . - QDC0_IDX_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_COMPARE_IRQHandler - .type QDC1_COMPARE_IRQHandler, %function -QDC1_COMPARE_IRQHandler: - ldr r0,=QDC1_COMPARE_DriverIRQHandler - bx r0 - .size QDC1_COMPARE_IRQHandler, . - QDC1_COMPARE_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_HOME_IRQHandler - .type QDC1_HOME_IRQHandler, %function -QDC1_HOME_IRQHandler: - ldr r0,=QDC1_HOME_DriverIRQHandler - bx r0 - .size QDC1_HOME_IRQHandler, . - QDC1_HOME_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_WDG_SAB_IRQHandler - .type QDC1_WDG_SAB_IRQHandler, %function -QDC1_WDG_SAB_IRQHandler: - ldr r0,=QDC1_WDG_SAB_DriverIRQHandler - bx r0 - .size QDC1_WDG_SAB_IRQHandler, . - QDC1_WDG_SAB_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_IDX_IRQHandler - .type QDC1_IDX_IRQHandler, %function -QDC1_IDX_IRQHandler: - ldr r0,=QDC1_IDX_DriverIRQHandler - bx r0 - .size QDC1_IDX_IRQHandler, . - QDC1_IDX_IRQHandler - - .align 1 - .thumb_func - .weak ITRC0_IRQHandler - .type ITRC0_IRQHandler, %function -ITRC0_IRQHandler: - ldr r0,=ITRC0_DriverIRQHandler - bx r0 - .size ITRC0_IRQHandler, . - ITRC0_IRQHandler - - .align 1 - .thumb_func - .weak BSP32_IRQHandler - .type BSP32_IRQHandler, %function -BSP32_IRQHandler: - ldr r0,=BSP32_DriverIRQHandler - bx r0 - .size BSP32_IRQHandler, . - BSP32_IRQHandler - - .align 1 - .thumb_func - .weak ELS_ERR_IRQHandler - .type ELS_ERR_IRQHandler, %function -ELS_ERR_IRQHandler: - ldr r0,=ELS_ERR_DriverIRQHandler - bx r0 - .size ELS_ERR_IRQHandler, . - ELS_ERR_IRQHandler - - .align 1 - .thumb_func - .weak PKC_ERR_IRQHandler - .type PKC_ERR_IRQHandler, %function -PKC_ERR_IRQHandler: - ldr r0,=PKC_ERR_DriverIRQHandler - bx r0 - .size PKC_ERR_IRQHandler, . - PKC_ERR_IRQHandler - - .align 1 - .thumb_func - .weak ERM_SINGLE_BIT_ERROR_IRQHandler - .type ERM_SINGLE_BIT_ERROR_IRQHandler, %function -ERM_SINGLE_BIT_ERROR_IRQHandler: - ldr r0,=ERM_SINGLE_BIT_ERROR_DriverIRQHandler - bx r0 - .size ERM_SINGLE_BIT_ERROR_IRQHandler, . - ERM_SINGLE_BIT_ERROR_IRQHandler - - .align 1 - .thumb_func - .weak ERM_MULTI_BIT_ERROR_IRQHandler - .type ERM_MULTI_BIT_ERROR_IRQHandler, %function -ERM_MULTI_BIT_ERROR_IRQHandler: - ldr r0,=ERM_MULTI_BIT_ERROR_DriverIRQHandler - bx r0 - .size ERM_MULTI_BIT_ERROR_IRQHandler, . - ERM_MULTI_BIT_ERROR_IRQHandler - - .align 1 - .thumb_func - .weak FMU0_IRQHandler - .type FMU0_IRQHandler, %function -FMU0_IRQHandler: - ldr r0,=FMU0_DriverIRQHandler - bx r0 - .size FMU0_IRQHandler, . - FMU0_IRQHandler - - .align 1 - .thumb_func - .weak ETHERNET_IRQHandler - .type ETHERNET_IRQHandler, %function -ETHERNET_IRQHandler: - ldr r0,=ETHERNET_DriverIRQHandler - bx r0 - .size ETHERNET_IRQHandler, . - ETHERNET_IRQHandler - - .align 1 - .thumb_func - .weak ETHERNET_PMT_IRQHandler - .type ETHERNET_PMT_IRQHandler, %function -ETHERNET_PMT_IRQHandler: - ldr r0,=ETHERNET_PMT_DriverIRQHandler - bx r0 - .size ETHERNET_PMT_IRQHandler, . - ETHERNET_PMT_IRQHandler - - .align 1 - .thumb_func - .weak ETHERNET_MACLP_IRQHandler - .type ETHERNET_MACLP_IRQHandler, %function -ETHERNET_MACLP_IRQHandler: - ldr r0,=ETHERNET_MACLP_DriverIRQHandler - bx r0 - .size ETHERNET_MACLP_IRQHandler, . - ETHERNET_MACLP_IRQHandler - - .align 1 - .thumb_func - .weak SINC_FILTER_IRQHandler - .type SINC_FILTER_IRQHandler, %function -SINC_FILTER_IRQHandler: - ldr r0,=SINC_FILTER_DriverIRQHandler - bx r0 - .size SINC_FILTER_IRQHandler, . - SINC_FILTER_IRQHandler - - .align 1 - .thumb_func - .weak LPTMR0_IRQHandler - .type LPTMR0_IRQHandler, %function -LPTMR0_IRQHandler: - ldr r0,=LPTMR0_DriverIRQHandler - bx r0 - .size LPTMR0_IRQHandler, . - LPTMR0_IRQHandler - - .align 1 - .thumb_func - .weak LPTMR1_IRQHandler - .type LPTMR1_IRQHandler, %function -LPTMR1_IRQHandler: - ldr r0,=LPTMR1_DriverIRQHandler - bx r0 - .size LPTMR1_IRQHandler, . - LPTMR1_IRQHandler - - .align 1 - .thumb_func - .weak SCG_IRQHandler - .type SCG_IRQHandler, %function -SCG_IRQHandler: - ldr r0,=SCG_DriverIRQHandler - bx r0 - .size SCG_IRQHandler, . - SCG_IRQHandler - - .align 1 - .thumb_func - .weak SPC_IRQHandler - .type SPC_IRQHandler, %function -SPC_IRQHandler: - ldr r0,=SPC_DriverIRQHandler - bx r0 - .size SPC_IRQHandler, . - SPC_IRQHandler - - .align 1 - .thumb_func - .weak WUU_IRQHandler - .type WUU_IRQHandler, %function -WUU_IRQHandler: - ldr r0,=WUU_DriverIRQHandler - bx r0 - .size WUU_IRQHandler, . - WUU_IRQHandler - - .align 1 - .thumb_func - .weak PORT_EFT_IRQHandler - .type PORT_EFT_IRQHandler, %function -PORT_EFT_IRQHandler: - ldr r0,=PORT_EFT_DriverIRQHandler - bx r0 - .size PORT_EFT_IRQHandler, . - PORT_EFT_IRQHandler - - .align 1 - .thumb_func - .weak ETB0_IRQHandler - .type ETB0_IRQHandler, %function -ETB0_IRQHandler: - ldr r0,=ETB0_DriverIRQHandler - bx r0 - .size ETB0_IRQHandler, . - ETB0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved166_IRQHandler - .type Reserved166_IRQHandler, %function -Reserved166_IRQHandler: - ldr r0,=Reserved166_DriverIRQHandler - bx r0 - .size Reserved166_IRQHandler, . - Reserved166_IRQHandler - - .align 1 - .thumb_func - .weak Reserved167_IRQHandler - .type Reserved167_IRQHandler, %function -Reserved167_IRQHandler: - ldr r0,=Reserved167_DriverIRQHandler - bx r0 - .size Reserved167_IRQHandler, . - Reserved167_IRQHandler - - .align 1 - .thumb_func - .weak WWDT0_IRQHandler - .type WWDT0_IRQHandler, %function -WWDT0_IRQHandler: - ldr r0,=WWDT0_DriverIRQHandler - bx r0 - .size WWDT0_IRQHandler, . - WWDT0_IRQHandler - - .align 1 - .thumb_func - .weak WWDT1_IRQHandler - .type WWDT1_IRQHandler, %function -WWDT1_IRQHandler: - ldr r0,=WWDT1_DriverIRQHandler - bx r0 - .size WWDT1_IRQHandler, . - WWDT1_IRQHandler - - .align 1 - .thumb_func - .weak CMC0_IRQHandler - .type CMC0_IRQHandler, %function -CMC0_IRQHandler: - ldr r0,=CMC0_DriverIRQHandler - bx r0 - .size CMC0_IRQHandler, . - CMC0_IRQHandler - - .align 1 - .thumb_func - .weak CTI0_IRQHandler - .type CTI0_IRQHandler, %function -CTI0_IRQHandler: - ldr r0,=CTI0_DriverIRQHandler - bx r0 - .size CTI0_IRQHandler, . - CTI0_IRQHandler - - -/* Macro to define default handlers. Default handler - * will be weak symbol and just dead loops. They can be - * overwritten by other handlers */ - .macro def_irq_handler handler_name - .weak \handler_name - .set \handler_name, DefaultISR - .endm -/* Exception Handlers */ - def_irq_handler MemManage_Handler - def_irq_handler BusFault_Handler - def_irq_handler UsageFault_Handler - def_irq_handler SecureFault_Handler - def_irq_handler DebugMon_Handler - def_irq_handler OR_DriverIRQHandler - def_irq_handler EDMA_0_CH0_DriverIRQHandler - def_irq_handler EDMA_0_CH1_DriverIRQHandler - def_irq_handler EDMA_0_CH2_DriverIRQHandler - def_irq_handler EDMA_0_CH3_DriverIRQHandler - def_irq_handler EDMA_0_CH4_DriverIRQHandler - def_irq_handler EDMA_0_CH5_DriverIRQHandler - def_irq_handler EDMA_0_CH6_DriverIRQHandler - def_irq_handler EDMA_0_CH7_DriverIRQHandler - def_irq_handler EDMA_0_CH8_DriverIRQHandler - def_irq_handler EDMA_0_CH9_DriverIRQHandler - def_irq_handler EDMA_0_CH10_DriverIRQHandler - def_irq_handler EDMA_0_CH11_DriverIRQHandler - def_irq_handler EDMA_0_CH12_DriverIRQHandler - def_irq_handler EDMA_0_CH13_DriverIRQHandler - def_irq_handler EDMA_0_CH14_DriverIRQHandler - def_irq_handler EDMA_0_CH15_DriverIRQHandler - def_irq_handler GPIO00_DriverIRQHandler - def_irq_handler GPIO01_DriverIRQHandler - def_irq_handler GPIO10_DriverIRQHandler - def_irq_handler GPIO11_DriverIRQHandler - def_irq_handler GPIO20_DriverIRQHandler - def_irq_handler GPIO21_DriverIRQHandler - def_irq_handler GPIO30_DriverIRQHandler - def_irq_handler GPIO31_DriverIRQHandler - def_irq_handler GPIO40_DriverIRQHandler - def_irq_handler GPIO41_DriverIRQHandler - def_irq_handler GPIO50_DriverIRQHandler - def_irq_handler GPIO51_DriverIRQHandler - def_irq_handler UTICK0_DriverIRQHandler - def_irq_handler MRT0_DriverIRQHandler - def_irq_handler CTIMER0_DriverIRQHandler - def_irq_handler CTIMER1_DriverIRQHandler - def_irq_handler SCT0_DriverIRQHandler - def_irq_handler CTIMER2_DriverIRQHandler - def_irq_handler LP_FLEXCOMM0_DriverIRQHandler - def_irq_handler LP_FLEXCOMM1_DriverIRQHandler - def_irq_handler LP_FLEXCOMM2_DriverIRQHandler - def_irq_handler LP_FLEXCOMM3_DriverIRQHandler - def_irq_handler LP_FLEXCOMM4_DriverIRQHandler - def_irq_handler LP_FLEXCOMM5_DriverIRQHandler - def_irq_handler LP_FLEXCOMM6_DriverIRQHandler - def_irq_handler LP_FLEXCOMM7_DriverIRQHandler - def_irq_handler LP_FLEXCOMM8_DriverIRQHandler - def_irq_handler LP_FLEXCOMM9_DriverIRQHandler - def_irq_handler ADC0_DriverIRQHandler - def_irq_handler ADC1_DriverIRQHandler - def_irq_handler PINT0_DriverIRQHandler - def_irq_handler PDM_EVENT_DriverIRQHandler - def_irq_handler Reserved65_DriverIRQHandler - def_irq_handler USB0_FS_DriverIRQHandler - def_irq_handler USB0_DCD_DriverIRQHandler - def_irq_handler RTC_DriverIRQHandler - def_irq_handler SMARTDMA_DriverIRQHandler - def_irq_handler MAILBOX_DriverIRQHandler - def_irq_handler CTIMER3_DriverIRQHandler - def_irq_handler CTIMER4_DriverIRQHandler - def_irq_handler OS_EVENT_DriverIRQHandler - def_irq_handler FLEXSPI0_DriverIRQHandler - def_irq_handler SAI0_DriverIRQHandler - def_irq_handler SAI1_DriverIRQHandler - def_irq_handler USDHC0_DriverIRQHandler - def_irq_handler CAN0_DriverIRQHandler - def_irq_handler CAN1_DriverIRQHandler - def_irq_handler Reserved80_DriverIRQHandler - def_irq_handler Reserved81_DriverIRQHandler - def_irq_handler USB1_HS_PHY_DriverIRQHandler - def_irq_handler USB1_HS_DriverIRQHandler - def_irq_handler SEC_HYPERVISOR_CALL_DriverIRQHandler - def_irq_handler Reserved85_DriverIRQHandler - def_irq_handler PLU_DriverIRQHandler - def_irq_handler Freqme_DriverIRQHandler - def_irq_handler SEC_VIO_DriverIRQHandler - def_irq_handler ELS_DriverIRQHandler - def_irq_handler PKC_DriverIRQHandler - def_irq_handler PUF_DriverIRQHandler - def_irq_handler PQ_DriverIRQHandler - def_irq_handler EDMA_1_CH0_DriverIRQHandler - def_irq_handler EDMA_1_CH1_DriverIRQHandler - def_irq_handler EDMA_1_CH2_DriverIRQHandler - def_irq_handler EDMA_1_CH3_DriverIRQHandler - def_irq_handler EDMA_1_CH4_DriverIRQHandler - def_irq_handler EDMA_1_CH5_DriverIRQHandler - def_irq_handler EDMA_1_CH6_DriverIRQHandler - def_irq_handler EDMA_1_CH7_DriverIRQHandler - def_irq_handler EDMA_1_CH8_DriverIRQHandler - def_irq_handler EDMA_1_CH9_DriverIRQHandler - def_irq_handler EDMA_1_CH10_DriverIRQHandler - def_irq_handler EDMA_1_CH11_DriverIRQHandler - def_irq_handler EDMA_1_CH12_DriverIRQHandler - def_irq_handler EDMA_1_CH13_DriverIRQHandler - def_irq_handler EDMA_1_CH14_DriverIRQHandler - def_irq_handler EDMA_1_CH15_DriverIRQHandler - def_irq_handler CDOG0_DriverIRQHandler - def_irq_handler CDOG1_DriverIRQHandler - def_irq_handler I3C0_DriverIRQHandler - def_irq_handler I3C1_DriverIRQHandler - def_irq_handler NPU_DriverIRQHandler - def_irq_handler GDET_DriverIRQHandler - def_irq_handler VBAT0_DriverIRQHandler - def_irq_handler EWM0_DriverIRQHandler - def_irq_handler TSI_END_OF_SCAN_DriverIRQHandler - def_irq_handler TSI_OUT_OF_SCAN_DriverIRQHandler - def_irq_handler EMVSIM0_DriverIRQHandler - def_irq_handler EMVSIM1_DriverIRQHandler - def_irq_handler FLEXIO_DriverIRQHandler - def_irq_handler DAC0_DriverIRQHandler - def_irq_handler DAC1_DriverIRQHandler - def_irq_handler DAC2_DriverIRQHandler - def_irq_handler HSCMP0_DriverIRQHandler - def_irq_handler HSCMP1_DriverIRQHandler - def_irq_handler HSCMP2_DriverIRQHandler - def_irq_handler FLEXPWM0_RELOAD_ERROR_DriverIRQHandler - def_irq_handler FLEXPWM0_FAULT_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE0_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE1_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE2_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE3_DriverIRQHandler - def_irq_handler FLEXPWM1_RELOAD_ERROR_DriverIRQHandler - def_irq_handler FLEXPWM1_FAULT_DriverIRQHandler - def_irq_handler FLEXPWM1_SUBMODULE0_DriverIRQHandler - def_irq_handler FLEXPWM1_SUBMODULE1_DriverIRQHandler - def_irq_handler FLEXPWM1_SUBMODULE2_DriverIRQHandler - def_irq_handler FLEXPWM1_SUBMODULE3_DriverIRQHandler - def_irq_handler QDC0_COMPARE_DriverIRQHandler - def_irq_handler QDC0_HOME_DriverIRQHandler - def_irq_handler QDC0_WDG_SAB_DriverIRQHandler - def_irq_handler QDC0_IDX_DriverIRQHandler - def_irq_handler QDC1_COMPARE_DriverIRQHandler - def_irq_handler QDC1_HOME_DriverIRQHandler - def_irq_handler QDC1_WDG_SAB_DriverIRQHandler - def_irq_handler QDC1_IDX_DriverIRQHandler - def_irq_handler ITRC0_DriverIRQHandler - def_irq_handler BSP32_DriverIRQHandler - def_irq_handler ELS_ERR_DriverIRQHandler - def_irq_handler PKC_ERR_DriverIRQHandler - def_irq_handler ERM_SINGLE_BIT_ERROR_DriverIRQHandler - def_irq_handler ERM_MULTI_BIT_ERROR_DriverIRQHandler - def_irq_handler FMU0_DriverIRQHandler - def_irq_handler ETHERNET_DriverIRQHandler - def_irq_handler ETHERNET_PMT_DriverIRQHandler - def_irq_handler ETHERNET_MACLP_DriverIRQHandler - def_irq_handler SINC_FILTER_DriverIRQHandler - def_irq_handler LPTMR0_DriverIRQHandler - def_irq_handler LPTMR1_DriverIRQHandler - def_irq_handler SCG_DriverIRQHandler - def_irq_handler SPC_DriverIRQHandler - def_irq_handler WUU_DriverIRQHandler - def_irq_handler PORT_EFT_DriverIRQHandler - def_irq_handler ETB0_DriverIRQHandler - def_irq_handler Reserved166_DriverIRQHandler - def_irq_handler Reserved167_DriverIRQHandler - def_irq_handler WWDT0_DriverIRQHandler - def_irq_handler WWDT1_DriverIRQHandler - def_irq_handler CMC0_DriverIRQHandler - def_irq_handler CTI0_DriverIRQHandler - - .end diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/gcc/startup_MCXN947_cm33_core1.S b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/gcc/startup_MCXN947_cm33_core1.S deleted file mode 100644 index 1e528bcd124..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/gcc/startup_MCXN947_cm33_core1.S +++ /dev/null @@ -1,1939 +0,0 @@ -/* ------------------------------------------------------------------------- */ -/* @file: startup_MCXN947_cm33_core1.s */ -/* @purpose: CMSIS Cortex-M33 Core Device Startup File */ -/* MCXN947_cm33_core1 */ -/* @version: 2.0 */ -/* @date: 2023-2-1 */ -/* @build: b240410 */ -/* ------------------------------------------------------------------------- */ -/* */ -/* Copyright 1997-2016 Freescale Semiconductor, Inc. */ -/* Copyright 2016-2024 NXP */ -/* SPDX-License-Identifier: BSD-3-Clause */ -/*****************************************************************************/ -/* Version: GCC for ARM Embedded Processors */ -/*****************************************************************************/ - .syntax unified - .arch armv8-m.main - - .section .isr_vector, "a" - .align 2 - .globl __Vectors -__Vectors: - .long __StackTop /* Top of Stack */ - .long Reset_Handler /* Reset Handler */ - .long NMI_Handler /* NMI Handler*/ - .long HardFault_Handler /* Hard Fault Handler*/ - .long MemManage_Handler /* MPU Fault Handler*/ - .long BusFault_Handler /* Bus Fault Handler*/ - .long UsageFault_Handler /* Usage Fault Handler*/ - .long SecureFault_Handler /* Secure Fault Handler*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long 0 /* Reserved*/ - .long SVC_Handler /* SVCall Handler*/ - .long DebugMon_Handler /* Debug Monitor Handler*/ - .long 0 /* Reserved*/ - .long PendSV_Handler /* PendSV Handler*/ - .long SysTick_Handler /* SysTick Handler*/ - - /* External Interrupts*/ - .long OR_IRQHandler /* OR IRQ*/ - .long EDMA_0_CH0_IRQHandler /* eDMA_0_CH0 error or transfer complete*/ - .long EDMA_0_CH1_IRQHandler /* eDMA_0_CH1 error or transfer complete*/ - .long EDMA_0_CH2_IRQHandler /* eDMA_0_CH2 error or transfer complete*/ - .long EDMA_0_CH3_IRQHandler /* eDMA_0_CH3 error or transfer complete*/ - .long EDMA_0_CH4_IRQHandler /* eDMA_0_CH4 error or transfer complete*/ - .long EDMA_0_CH5_IRQHandler /* eDMA_0_CH5 error or transfer complete*/ - .long EDMA_0_CH6_IRQHandler /* eDMA_0_CH6 error or transfer complete*/ - .long EDMA_0_CH7_IRQHandler /* eDMA_0_CH7 error or transfer complete*/ - .long EDMA_0_CH8_IRQHandler /* eDMA_0_CH8 error or transfer complete*/ - .long EDMA_0_CH9_IRQHandler /* eDMA_0_CH9 error or transfer complete*/ - .long EDMA_0_CH10_IRQHandler /* eDMA_0_CH10 error or transfer complete*/ - .long EDMA_0_CH11_IRQHandler /* eDMA_0_CH11 error or transfer complete*/ - .long EDMA_0_CH12_IRQHandler /* eDMA_0_CH12 error or transfer complete*/ - .long EDMA_0_CH13_IRQHandler /* eDMA_0_CH13 error or transfer complete*/ - .long EDMA_0_CH14_IRQHandler /* eDMA_0_CH14 error or transfer complete*/ - .long EDMA_0_CH15_IRQHandler /* eDMA_0_CH15 error or transfer complete*/ - .long GPIO00_IRQHandler /* GPIO0 interrupt 0*/ - .long GPIO01_IRQHandler /* GPIO0 interrupt 1*/ - .long GPIO10_IRQHandler /* GPIO1 interrupt 0*/ - .long GPIO11_IRQHandler /* GPIO1 interrupt 1*/ - .long GPIO20_IRQHandler /* GPIO2 interrupt 0*/ - .long GPIO21_IRQHandler /* GPIO2 interrupt 1*/ - .long GPIO30_IRQHandler /* GPIO3 interrupt 0*/ - .long GPIO31_IRQHandler /* GPIO3 interrupt 1*/ - .long GPIO40_IRQHandler /* GPIO4 interrupt 0*/ - .long GPIO41_IRQHandler /* GPIO4 interrupt 1*/ - .long GPIO50_IRQHandler /* GPIO5 interrupt 0*/ - .long GPIO51_IRQHandler /* GPIO5 interrupt 1*/ - .long UTICK0_IRQHandler /* Micro-Tick Timer interrupt*/ - .long MRT0_IRQHandler /* Multi-Rate Timer interrupt*/ - .long CTIMER0_IRQHandler /* Standard counter/timer 0 interrupt*/ - .long CTIMER1_IRQHandler /* Standard counter/timer 1 interrupt*/ - .long SCT0_IRQHandler /* SCTimer/PWM interrupt*/ - .long CTIMER2_IRQHandler /* Standard counter/timer 2 interrupt*/ - .long LP_FLEXCOMM0_IRQHandler /* LP_FLEXCOMM0 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM1_IRQHandler /* LP_FLEXCOMM1 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM2_IRQHandler /* LP_FLEXCOMM2 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM3_IRQHandler /* LP_FLEXCOMM3 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM4_IRQHandler /* LP_FLEXCOMM4 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM5_IRQHandler /* LP_FLEXCOMM5 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM6_IRQHandler /* LP_FLEXCOMM6 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM7_IRQHandler /* LP_FLEXCOMM7 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM8_IRQHandler /* LP_FLEXCOMM8 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long LP_FLEXCOMM9_IRQHandler /* LP_FLEXCOMM9 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt)*/ - .long ADC0_IRQHandler /* Analog-to-Digital Converter 0 - General Purpose interrupt*/ - .long ADC1_IRQHandler /* Analog-to-Digital Converter 1 - General Purpose interrupt*/ - .long PINT0_IRQHandler /* Pin Interrupt Pattern Match Interrupt*/ - .long PDM_EVENT_IRQHandler /* Microphone Interface interrupt*/ - .long Reserved65_IRQHandler /* Reserved interrupt*/ - .long USB0_FS_IRQHandler /* Universal Serial Bus - Full Speed interrupt*/ - .long USB0_DCD_IRQHandler /* Universal Serial Bus - Device Charge Detect interrupt*/ - .long RTC_IRQHandler /* RTC Subsystem interrupt (RTC interrupt or Wake timer interrupt)*/ - .long SMARTDMA_IRQHandler /* SmartDMA_IRQ*/ - .long MAILBOX_IRQHandler /* Inter-CPU Mailbox interrupt0 for CPU0 Inter-CPU Mailbox interrupt1 for CPU1*/ - .long CTIMER3_IRQHandler /* Standard counter/timer 3 interrupt*/ - .long CTIMER4_IRQHandler /* Standard counter/timer 4 interrupt*/ - .long OS_EVENT_IRQHandler /* OS event timer interrupt*/ - .long FLEXSPI0_IRQHandler /* Flexible Serial Peripheral Interface interrupt*/ - .long SAI0_IRQHandler /* Serial Audio Interface 0 interrupt*/ - .long SAI1_IRQHandler /* Serial Audio Interface 1 interrupt*/ - .long USDHC0_IRQHandler /* Ultra Secured Digital Host Controller interrupt*/ - .long CAN0_IRQHandler /* Controller Area Network 0 interrupt*/ - .long CAN1_IRQHandler /* Controller Area Network 1 interrupt*/ - .long Reserved80_IRQHandler /* Reserved interrupt*/ - .long Reserved81_IRQHandler /* Reserved interrupt*/ - .long USB1_HS_PHY_IRQHandler /* USBHS DCD or USBHS Phy interrupt*/ - .long USB1_HS_IRQHandler /* USB High Speed OTG Controller interrupt */ - .long SEC_HYPERVISOR_CALL_IRQHandler /* AHB Secure Controller hypervisor call interrupt*/ - .long Reserved85_IRQHandler /* Reserved interrupt*/ - .long PLU_IRQHandler /* Programmable Logic Unit interrupt*/ - .long Freqme_IRQHandler /* Frequency Measurement interrupt*/ - .long SEC_VIO_IRQHandler /* Secure violation interrupt (Memory Block Checker interrupt or secure AHB matrix violation interrupt)*/ - .long ELS_IRQHandler /* ELS interrupt*/ - .long PKC_IRQHandler /* PKC interrupt*/ - .long PUF_IRQHandler /* Physical Unclonable Function interrupt*/ - .long PQ_IRQHandler /* Power Quad interrupt*/ - .long EDMA_1_CH0_IRQHandler /* eDMA_1_CH0 error or transfer complete*/ - .long EDMA_1_CH1_IRQHandler /* eDMA_1_CH1 error or transfer complete*/ - .long EDMA_1_CH2_IRQHandler /* eDMA_1_CH2 error or transfer complete*/ - .long EDMA_1_CH3_IRQHandler /* eDMA_1_CH3 error or transfer complete*/ - .long EDMA_1_CH4_IRQHandler /* eDMA_1_CH4 error or transfer complete*/ - .long EDMA_1_CH5_IRQHandler /* eDMA_1_CH5 error or transfer complete*/ - .long EDMA_1_CH6_IRQHandler /* eDMA_1_CH6 error or transfer complete*/ - .long EDMA_1_CH7_IRQHandler /* eDMA_1_CH7 error or transfer complete*/ - .long EDMA_1_CH8_IRQHandler /* eDMA_1_CH8 error or transfer complete*/ - .long EDMA_1_CH9_IRQHandler /* eDMA_1_CH9 error or transfer complete*/ - .long EDMA_1_CH10_IRQHandler /* eDMA_1_CH10 error or transfer complete*/ - .long EDMA_1_CH11_IRQHandler /* eDMA_1_CH11 error or transfer complete*/ - .long EDMA_1_CH12_IRQHandler /* eDMA_1_CH12 error or transfer complete*/ - .long EDMA_1_CH13_IRQHandler /* eDMA_1_CH13 error or transfer complete*/ - .long EDMA_1_CH14_IRQHandler /* eDMA_1_CH14 error or transfer complete*/ - .long EDMA_1_CH15_IRQHandler /* eDMA_1_CH15 error or transfer complete*/ - .long CDOG0_IRQHandler /* Code Watchdog Timer 0 interrupt*/ - .long CDOG1_IRQHandler /* Code Watchdog Timer 1 interrupt*/ - .long I3C0_IRQHandler /* Improved Inter Integrated Circuit interrupt 0*/ - .long I3C1_IRQHandler /* Improved Inter Integrated Circuit interrupt 1*/ - .long NPU_IRQHandler /* NPU interrupt*/ - .long GDET_IRQHandler /* Digital Glitch Detect 0 interrupt or Digital Glitch Detect 1 interrupt*/ - .long VBAT0_IRQHandler /* VBAT interrupt( VBAT interrupt or digital tamper interrupt)*/ - .long EWM0_IRQHandler /* External Watchdog Monitor interrupt*/ - .long TSI_END_OF_SCAN_IRQHandler /* TSI End of Scan interrupt*/ - .long TSI_OUT_OF_SCAN_IRQHandler /* TSI Out of Scan interrupt*/ - .long EMVSIM0_IRQHandler /* EMVSIM0 interrupt*/ - .long EMVSIM1_IRQHandler /* EMVSIM1 interrupt*/ - .long FLEXIO_IRQHandler /* Flexible Input/Output interrupt*/ - .long DAC0_IRQHandler /* Digital-to-Analog Converter 0 - General Purpose interrupt*/ - .long DAC1_IRQHandler /* Digital-to-Analog Converter 1 - General Purpose interrupt*/ - .long DAC2_IRQHandler /* 14-bit Digital-to-Analog Converter interrupt*/ - .long HSCMP0_IRQHandler /* High-Speed comparator0 interrupt*/ - .long HSCMP1_IRQHandler /* High-Speed comparator1 interrupt*/ - .long HSCMP2_IRQHandler /* High-Speed comparator2 interrupt*/ - .long FLEXPWM0_RELOAD_ERROR_IRQHandler /* FlexPWM0_reload_error interrupt*/ - .long FLEXPWM0_FAULT_IRQHandler /* FlexPWM0_fault interrupt*/ - .long FLEXPWM0_SUBMODULE0_IRQHandler /* FlexPWM0 Submodule 0 capture/compare/reload interrupt*/ - .long FLEXPWM0_SUBMODULE1_IRQHandler /* FlexPWM0 Submodule 1 capture/compare/reload interrupt*/ - .long FLEXPWM0_SUBMODULE2_IRQHandler /* FlexPWM0 Submodule 2 capture/compare/reload interrupt*/ - .long FLEXPWM0_SUBMODULE3_IRQHandler /* FlexPWM0 Submodule 3 capture/compare/reload interrupt*/ - .long FLEXPWM1_RELOAD_ERROR_IRQHandler /* FlexPWM1_reload_error interrupt*/ - .long FLEXPWM1_FAULT_IRQHandler /* FlexPWM1_fault interrupt*/ - .long FLEXPWM1_SUBMODULE0_IRQHandler /* FlexPWM1 Submodule 0 capture/compare/reload interrupt*/ - .long FLEXPWM1_SUBMODULE1_IRQHandler /* FlexPWM1 Submodule 1 capture/compare/reload interrupt*/ - .long FLEXPWM1_SUBMODULE2_IRQHandler /* FlexPWM1 Submodule 2 capture/compare/reload interrupt*/ - .long FLEXPWM1_SUBMODULE3_IRQHandler /* FlexPWM1 Submodule 3 capture/compare/reload interrupt*/ - .long QDC0_COMPARE_IRQHandler /* QDC0_Compare interrupt*/ - .long QDC0_HOME_IRQHandler /* QDC0_Home interrupt*/ - .long QDC0_WDG_SAB_IRQHandler /* QDC0_WDG_IRQ/SAB interrupt*/ - .long QDC0_IDX_IRQHandler /* QDC0_IDX interrupt*/ - .long QDC1_COMPARE_IRQHandler /* QDC1_Compare interrupt*/ - .long QDC1_HOME_IRQHandler /* QDC1_Home interrupt*/ - .long QDC1_WDG_SAB_IRQHandler /* QDC1_WDG_IRQ/SAB interrupt*/ - .long QDC1_IDX_IRQHandler /* QDC1_IDX interrupt*/ - .long ITRC0_IRQHandler /* Intrusion and Tamper Response Controller interrupt*/ - .long BSP32_IRQHandler /* CoolFlux BSP32 interrupt*/ - .long ELS_ERR_IRQHandler /* ELS error interrupt*/ - .long PKC_ERR_IRQHandler /* PKC error interrupt*/ - .long ERM_SINGLE_BIT_ERROR_IRQHandler /* ERM Single Bit error interrupt*/ - .long ERM_MULTI_BIT_ERROR_IRQHandler /* ERM Multi Bit error interrupt*/ - .long FMU0_IRQHandler /* Flash Management Unit interrupt*/ - .long ETHERNET_IRQHandler /* Ethernet QoS interrupt*/ - .long ETHERNET_PMT_IRQHandler /* Ethernet QoS power management interrupt*/ - .long ETHERNET_MACLP_IRQHandler /* Ethernet QoS MAC interrupt*/ - .long SINC_FILTER_IRQHandler /* SINC Filter interrupt */ - .long LPTMR0_IRQHandler /* Low Power Timer 0 interrupt*/ - .long LPTMR1_IRQHandler /* Low Power Timer 1 interrupt*/ - .long SCG_IRQHandler /* System Clock Generator interrupt*/ - .long SPC_IRQHandler /* System Power Controller interrupt*/ - .long WUU_IRQHandler /* Wake Up Unit interrupt*/ - .long PORT_EFT_IRQHandler /* PORT0~5 EFT interrupt*/ - .long ETB0_IRQHandler /* ETB counter expires interrupt*/ - .long Reserved166_IRQHandler /* Reserved interrupt*/ - .long Reserved167_IRQHandler /* Reserved interrupt*/ - .long WWDT0_IRQHandler /* Windowed Watchdog Timer 0 interrupt*/ - .long WWDT1_IRQHandler /* Windowed Watchdog Timer 1 interrupt*/ - .long CMC0_IRQHandler /* Core Mode Controller interrupt*/ - .long CTI0_IRQHandler /* Cross Trigger Interface interrupt*/ - - .size __Vectors, . - __Vectors - - .text - .thumb - -#if defined (__cplusplus) -#ifdef __REDLIB__ -#error Redlib does not support C++ -#endif -#endif -/* Reset Handler */ - - .thumb_func - .align 2 - .globl Reset_Handler - .weak Reset_Handler - .type Reset_Handler, %function -Reset_Handler: -#ifndef __NO_SYSTEM_INIT - ldr r0,=SystemInit - blx r0 -#endif -/* Loop to copy data from read only memory to RAM. The ranges - * of copy from/to are specified by following symbols evaluated in - * linker script. - * __etext: End of code section, i.e., begin of data sections to copy from. - * __data_start__/__data_end__: RAM address range that data should be - * copied to. Both must be aligned to 4 bytes boundary. */ - - ldr r1, =__etext - ldr r2, =__data_start__ - ldr r3, =__data_end__ - -#if 1 -/* Here are two copies of loop implemenations. First one favors code size - * and the second one favors performance. Default uses the first one. - * Change to "#if 0" to use the second one */ -.LC0: - cmp r2, r3 - ittt lt - ldrlt r0, [r1], #4 - strlt r0, [r2], #4 - blt .LC0 -#else - subs r3, r2 - ble .LC1 -.LC0: - subs r3, #4 - ldr r0, [r1, r3] - str r0, [r2, r3] - bgt .LC0 -.LC1: -#endif - -#ifdef __STARTUP_CLEAR_BSS -/* This part of work usually is done in C library startup code. Otherwise, - * define this macro to enable it in this startup. - * - * Loop to zero out BSS section, which uses following symbols - * in linker script: - * __bss_start__: start of BSS section. Must align to 4 - * __bss_end__: end of BSS section. Must align to 4 - */ - ldr r1, =__bss_start__ - ldr r2, =__bss_end__ - - movs r0, 0 -.LC2: - cmp r1, r2 - itt lt - strlt r0, [r1], #4 - blt .LC2 -#endif /* __STARTUP_CLEAR_BSS */ - -/* Add stack / heap initializaiton */ - movs r0, 0 - ldr r1, =__HeapBase - ldr r2, =__HeapLimit -.LC3: - cmp r1, r2 - itt lt - strlt r0, [r1], #4 - blt .LC3 - - ldr r1, =__StackLimit - ldr r2, =__StackTop -.LC4: - cmp r1, r2 - itt lt - strlt r0, [r1], #4 - blt .LC4 - -/*End of stack / heap initializaiton */ - cpsie i /* Unmask interrupts */ -#ifndef __START -#ifdef __REDLIB__ -#define __START __main -#else -#define __START _start -#endif -#endif -#ifndef __ATOLLIC__ - ldr r0,=__START - blx r0 -#else - ldr r0,=__libc_init_array - blx r0 - ldr r0,=main - bx r0 -#endif - .pool - .size Reset_Handler, . - Reset_Handler - - .align 1 - .thumb_func - .weak DefaultISR - .type DefaultISR, %function -DefaultISR: - b DefaultISR - .size DefaultISR, . - DefaultISR - - .align 1 - .thumb_func - .weak NMI_Handler - .type NMI_Handler, %function -NMI_Handler: - ldr r0,=NMI_Handler - bx r0 - .size NMI_Handler, . - NMI_Handler - - .align 1 - .thumb_func - .weak HardFault_Handler - .type HardFault_Handler, %function -HardFault_Handler: - ldr r0,=HardFault_Handler - bx r0 - .size HardFault_Handler, . - HardFault_Handler - - .align 1 - .thumb_func - .weak SVC_Handler - .type SVC_Handler, %function -SVC_Handler: - ldr r0,=SVC_Handler - bx r0 - .size SVC_Handler, . - SVC_Handler - - .align 1 - .thumb_func - .weak PendSV_Handler - .type PendSV_Handler, %function -PendSV_Handler: - ldr r0,=PendSV_Handler - bx r0 - .size PendSV_Handler, . - PendSV_Handler - - .align 1 - .thumb_func - .weak SysTick_Handler - .type SysTick_Handler, %function -SysTick_Handler: - ldr r0,=SysTick_Handler - bx r0 - .size SysTick_Handler, . - SysTick_Handler - - .align 1 - .thumb_func - .weak OR_IRQHandler - .type OR_IRQHandler, %function -OR_IRQHandler: - ldr r0,=OR_DriverIRQHandler - bx r0 - .size OR_IRQHandler, . - OR_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH0_IRQHandler - .type EDMA_0_CH0_IRQHandler, %function -EDMA_0_CH0_IRQHandler: - ldr r0,=EDMA_0_CH0_DriverIRQHandler - bx r0 - .size EDMA_0_CH0_IRQHandler, . - EDMA_0_CH0_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH1_IRQHandler - .type EDMA_0_CH1_IRQHandler, %function -EDMA_0_CH1_IRQHandler: - ldr r0,=EDMA_0_CH1_DriverIRQHandler - bx r0 - .size EDMA_0_CH1_IRQHandler, . - EDMA_0_CH1_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH2_IRQHandler - .type EDMA_0_CH2_IRQHandler, %function -EDMA_0_CH2_IRQHandler: - ldr r0,=EDMA_0_CH2_DriverIRQHandler - bx r0 - .size EDMA_0_CH2_IRQHandler, . - EDMA_0_CH2_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH3_IRQHandler - .type EDMA_0_CH3_IRQHandler, %function -EDMA_0_CH3_IRQHandler: - ldr r0,=EDMA_0_CH3_DriverIRQHandler - bx r0 - .size EDMA_0_CH3_IRQHandler, . - EDMA_0_CH3_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH4_IRQHandler - .type EDMA_0_CH4_IRQHandler, %function -EDMA_0_CH4_IRQHandler: - ldr r0,=EDMA_0_CH4_DriverIRQHandler - bx r0 - .size EDMA_0_CH4_IRQHandler, . - EDMA_0_CH4_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH5_IRQHandler - .type EDMA_0_CH5_IRQHandler, %function -EDMA_0_CH5_IRQHandler: - ldr r0,=EDMA_0_CH5_DriverIRQHandler - bx r0 - .size EDMA_0_CH5_IRQHandler, . - EDMA_0_CH5_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH6_IRQHandler - .type EDMA_0_CH6_IRQHandler, %function -EDMA_0_CH6_IRQHandler: - ldr r0,=EDMA_0_CH6_DriverIRQHandler - bx r0 - .size EDMA_0_CH6_IRQHandler, . - EDMA_0_CH6_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH7_IRQHandler - .type EDMA_0_CH7_IRQHandler, %function -EDMA_0_CH7_IRQHandler: - ldr r0,=EDMA_0_CH7_DriverIRQHandler - bx r0 - .size EDMA_0_CH7_IRQHandler, . - EDMA_0_CH7_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH8_IRQHandler - .type EDMA_0_CH8_IRQHandler, %function -EDMA_0_CH8_IRQHandler: - ldr r0,=EDMA_0_CH8_DriverIRQHandler - bx r0 - .size EDMA_0_CH8_IRQHandler, . - EDMA_0_CH8_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH9_IRQHandler - .type EDMA_0_CH9_IRQHandler, %function -EDMA_0_CH9_IRQHandler: - ldr r0,=EDMA_0_CH9_DriverIRQHandler - bx r0 - .size EDMA_0_CH9_IRQHandler, . - EDMA_0_CH9_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH10_IRQHandler - .type EDMA_0_CH10_IRQHandler, %function -EDMA_0_CH10_IRQHandler: - ldr r0,=EDMA_0_CH10_DriverIRQHandler - bx r0 - .size EDMA_0_CH10_IRQHandler, . - EDMA_0_CH10_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH11_IRQHandler - .type EDMA_0_CH11_IRQHandler, %function -EDMA_0_CH11_IRQHandler: - ldr r0,=EDMA_0_CH11_DriverIRQHandler - bx r0 - .size EDMA_0_CH11_IRQHandler, . - EDMA_0_CH11_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH12_IRQHandler - .type EDMA_0_CH12_IRQHandler, %function -EDMA_0_CH12_IRQHandler: - ldr r0,=EDMA_0_CH12_DriverIRQHandler - bx r0 - .size EDMA_0_CH12_IRQHandler, . - EDMA_0_CH12_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH13_IRQHandler - .type EDMA_0_CH13_IRQHandler, %function -EDMA_0_CH13_IRQHandler: - ldr r0,=EDMA_0_CH13_DriverIRQHandler - bx r0 - .size EDMA_0_CH13_IRQHandler, . - EDMA_0_CH13_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH14_IRQHandler - .type EDMA_0_CH14_IRQHandler, %function -EDMA_0_CH14_IRQHandler: - ldr r0,=EDMA_0_CH14_DriverIRQHandler - bx r0 - .size EDMA_0_CH14_IRQHandler, . - EDMA_0_CH14_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_0_CH15_IRQHandler - .type EDMA_0_CH15_IRQHandler, %function -EDMA_0_CH15_IRQHandler: - ldr r0,=EDMA_0_CH15_DriverIRQHandler - bx r0 - .size EDMA_0_CH15_IRQHandler, . - EDMA_0_CH15_IRQHandler - - .align 1 - .thumb_func - .weak GPIO00_IRQHandler - .type GPIO00_IRQHandler, %function -GPIO00_IRQHandler: - ldr r0,=GPIO00_DriverIRQHandler - bx r0 - .size GPIO00_IRQHandler, . - GPIO00_IRQHandler - - .align 1 - .thumb_func - .weak GPIO01_IRQHandler - .type GPIO01_IRQHandler, %function -GPIO01_IRQHandler: - ldr r0,=GPIO01_DriverIRQHandler - bx r0 - .size GPIO01_IRQHandler, . - GPIO01_IRQHandler - - .align 1 - .thumb_func - .weak GPIO10_IRQHandler - .type GPIO10_IRQHandler, %function -GPIO10_IRQHandler: - ldr r0,=GPIO10_DriverIRQHandler - bx r0 - .size GPIO10_IRQHandler, . - GPIO10_IRQHandler - - .align 1 - .thumb_func - .weak GPIO11_IRQHandler - .type GPIO11_IRQHandler, %function -GPIO11_IRQHandler: - ldr r0,=GPIO11_DriverIRQHandler - bx r0 - .size GPIO11_IRQHandler, . - GPIO11_IRQHandler - - .align 1 - .thumb_func - .weak GPIO20_IRQHandler - .type GPIO20_IRQHandler, %function -GPIO20_IRQHandler: - ldr r0,=GPIO20_DriverIRQHandler - bx r0 - .size GPIO20_IRQHandler, . - GPIO20_IRQHandler - - .align 1 - .thumb_func - .weak GPIO21_IRQHandler - .type GPIO21_IRQHandler, %function -GPIO21_IRQHandler: - ldr r0,=GPIO21_DriverIRQHandler - bx r0 - .size GPIO21_IRQHandler, . - GPIO21_IRQHandler - - .align 1 - .thumb_func - .weak GPIO30_IRQHandler - .type GPIO30_IRQHandler, %function -GPIO30_IRQHandler: - ldr r0,=GPIO30_DriverIRQHandler - bx r0 - .size GPIO30_IRQHandler, . - GPIO30_IRQHandler - - .align 1 - .thumb_func - .weak GPIO31_IRQHandler - .type GPIO31_IRQHandler, %function -GPIO31_IRQHandler: - ldr r0,=GPIO31_DriverIRQHandler - bx r0 - .size GPIO31_IRQHandler, . - GPIO31_IRQHandler - - .align 1 - .thumb_func - .weak GPIO40_IRQHandler - .type GPIO40_IRQHandler, %function -GPIO40_IRQHandler: - ldr r0,=GPIO40_DriverIRQHandler - bx r0 - .size GPIO40_IRQHandler, . - GPIO40_IRQHandler - - .align 1 - .thumb_func - .weak GPIO41_IRQHandler - .type GPIO41_IRQHandler, %function -GPIO41_IRQHandler: - ldr r0,=GPIO41_DriverIRQHandler - bx r0 - .size GPIO41_IRQHandler, . - GPIO41_IRQHandler - - .align 1 - .thumb_func - .weak GPIO50_IRQHandler - .type GPIO50_IRQHandler, %function -GPIO50_IRQHandler: - ldr r0,=GPIO50_DriverIRQHandler - bx r0 - .size GPIO50_IRQHandler, . - GPIO50_IRQHandler - - .align 1 - .thumb_func - .weak GPIO51_IRQHandler - .type GPIO51_IRQHandler, %function -GPIO51_IRQHandler: - ldr r0,=GPIO51_DriverIRQHandler - bx r0 - .size GPIO51_IRQHandler, . - GPIO51_IRQHandler - - .align 1 - .thumb_func - .weak UTICK0_IRQHandler - .type UTICK0_IRQHandler, %function -UTICK0_IRQHandler: - ldr r0,=UTICK0_DriverIRQHandler - bx r0 - .size UTICK0_IRQHandler, . - UTICK0_IRQHandler - - .align 1 - .thumb_func - .weak MRT0_IRQHandler - .type MRT0_IRQHandler, %function -MRT0_IRQHandler: - ldr r0,=MRT0_DriverIRQHandler - bx r0 - .size MRT0_IRQHandler, . - MRT0_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER0_IRQHandler - .type CTIMER0_IRQHandler, %function -CTIMER0_IRQHandler: - ldr r0,=CTIMER0_DriverIRQHandler - bx r0 - .size CTIMER0_IRQHandler, . - CTIMER0_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER1_IRQHandler - .type CTIMER1_IRQHandler, %function -CTIMER1_IRQHandler: - ldr r0,=CTIMER1_DriverIRQHandler - bx r0 - .size CTIMER1_IRQHandler, . - CTIMER1_IRQHandler - - .align 1 - .thumb_func - .weak SCT0_IRQHandler - .type SCT0_IRQHandler, %function -SCT0_IRQHandler: - ldr r0,=SCT0_DriverIRQHandler - bx r0 - .size SCT0_IRQHandler, . - SCT0_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER2_IRQHandler - .type CTIMER2_IRQHandler, %function -CTIMER2_IRQHandler: - ldr r0,=CTIMER2_DriverIRQHandler - bx r0 - .size CTIMER2_IRQHandler, . - CTIMER2_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM0_IRQHandler - .type LP_FLEXCOMM0_IRQHandler, %function -LP_FLEXCOMM0_IRQHandler: - ldr r0,=LP_FLEXCOMM0_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM0_IRQHandler, . - LP_FLEXCOMM0_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM1_IRQHandler - .type LP_FLEXCOMM1_IRQHandler, %function -LP_FLEXCOMM1_IRQHandler: - ldr r0,=LP_FLEXCOMM1_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM1_IRQHandler, . - LP_FLEXCOMM1_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM2_IRQHandler - .type LP_FLEXCOMM2_IRQHandler, %function -LP_FLEXCOMM2_IRQHandler: - ldr r0,=LP_FLEXCOMM2_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM2_IRQHandler, . - LP_FLEXCOMM2_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM3_IRQHandler - .type LP_FLEXCOMM3_IRQHandler, %function -LP_FLEXCOMM3_IRQHandler: - ldr r0,=LP_FLEXCOMM3_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM3_IRQHandler, . - LP_FLEXCOMM3_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM4_IRQHandler - .type LP_FLEXCOMM4_IRQHandler, %function -LP_FLEXCOMM4_IRQHandler: - ldr r0,=LP_FLEXCOMM4_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM4_IRQHandler, . - LP_FLEXCOMM4_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM5_IRQHandler - .type LP_FLEXCOMM5_IRQHandler, %function -LP_FLEXCOMM5_IRQHandler: - ldr r0,=LP_FLEXCOMM5_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM5_IRQHandler, . - LP_FLEXCOMM5_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM6_IRQHandler - .type LP_FLEXCOMM6_IRQHandler, %function -LP_FLEXCOMM6_IRQHandler: - ldr r0,=LP_FLEXCOMM6_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM6_IRQHandler, . - LP_FLEXCOMM6_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM7_IRQHandler - .type LP_FLEXCOMM7_IRQHandler, %function -LP_FLEXCOMM7_IRQHandler: - ldr r0,=LP_FLEXCOMM7_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM7_IRQHandler, . - LP_FLEXCOMM7_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM8_IRQHandler - .type LP_FLEXCOMM8_IRQHandler, %function -LP_FLEXCOMM8_IRQHandler: - ldr r0,=LP_FLEXCOMM8_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM8_IRQHandler, . - LP_FLEXCOMM8_IRQHandler - - .align 1 - .thumb_func - .weak LP_FLEXCOMM9_IRQHandler - .type LP_FLEXCOMM9_IRQHandler, %function -LP_FLEXCOMM9_IRQHandler: - ldr r0,=LP_FLEXCOMM9_DriverIRQHandler - bx r0 - .size LP_FLEXCOMM9_IRQHandler, . - LP_FLEXCOMM9_IRQHandler - - .align 1 - .thumb_func - .weak ADC0_IRQHandler - .type ADC0_IRQHandler, %function -ADC0_IRQHandler: - ldr r0,=ADC0_DriverIRQHandler - bx r0 - .size ADC0_IRQHandler, . - ADC0_IRQHandler - - .align 1 - .thumb_func - .weak ADC1_IRQHandler - .type ADC1_IRQHandler, %function -ADC1_IRQHandler: - ldr r0,=ADC1_DriverIRQHandler - bx r0 - .size ADC1_IRQHandler, . - ADC1_IRQHandler - - .align 1 - .thumb_func - .weak PINT0_IRQHandler - .type PINT0_IRQHandler, %function -PINT0_IRQHandler: - ldr r0,=PINT0_DriverIRQHandler - bx r0 - .size PINT0_IRQHandler, . - PINT0_IRQHandler - - .align 1 - .thumb_func - .weak PDM_EVENT_IRQHandler - .type PDM_EVENT_IRQHandler, %function -PDM_EVENT_IRQHandler: - ldr r0,=PDM_EVENT_DriverIRQHandler - bx r0 - .size PDM_EVENT_IRQHandler, . - PDM_EVENT_IRQHandler - - .align 1 - .thumb_func - .weak Reserved65_IRQHandler - .type Reserved65_IRQHandler, %function -Reserved65_IRQHandler: - ldr r0,=Reserved65_DriverIRQHandler - bx r0 - .size Reserved65_IRQHandler, . - Reserved65_IRQHandler - - .align 1 - .thumb_func - .weak USB0_FS_IRQHandler - .type USB0_FS_IRQHandler, %function -USB0_FS_IRQHandler: - ldr r0,=USB0_FS_DriverIRQHandler - bx r0 - .size USB0_FS_IRQHandler, . - USB0_FS_IRQHandler - - .align 1 - .thumb_func - .weak USB0_DCD_IRQHandler - .type USB0_DCD_IRQHandler, %function -USB0_DCD_IRQHandler: - ldr r0,=USB0_DCD_DriverIRQHandler - bx r0 - .size USB0_DCD_IRQHandler, . - USB0_DCD_IRQHandler - - .align 1 - .thumb_func - .weak RTC_IRQHandler - .type RTC_IRQHandler, %function -RTC_IRQHandler: - ldr r0,=RTC_DriverIRQHandler - bx r0 - .size RTC_IRQHandler, . - RTC_IRQHandler - - .align 1 - .thumb_func - .weak SMARTDMA_IRQHandler - .type SMARTDMA_IRQHandler, %function -SMARTDMA_IRQHandler: - ldr r0,=SMARTDMA_DriverIRQHandler - bx r0 - .size SMARTDMA_IRQHandler, . - SMARTDMA_IRQHandler - - .align 1 - .thumb_func - .weak MAILBOX_IRQHandler - .type MAILBOX_IRQHandler, %function -MAILBOX_IRQHandler: - ldr r0,=MAILBOX_DriverIRQHandler - bx r0 - .size MAILBOX_IRQHandler, . - MAILBOX_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER3_IRQHandler - .type CTIMER3_IRQHandler, %function -CTIMER3_IRQHandler: - ldr r0,=CTIMER3_DriverIRQHandler - bx r0 - .size CTIMER3_IRQHandler, . - CTIMER3_IRQHandler - - .align 1 - .thumb_func - .weak CTIMER4_IRQHandler - .type CTIMER4_IRQHandler, %function -CTIMER4_IRQHandler: - ldr r0,=CTIMER4_DriverIRQHandler - bx r0 - .size CTIMER4_IRQHandler, . - CTIMER4_IRQHandler - - .align 1 - .thumb_func - .weak OS_EVENT_IRQHandler - .type OS_EVENT_IRQHandler, %function -OS_EVENT_IRQHandler: - ldr r0,=OS_EVENT_DriverIRQHandler - bx r0 - .size OS_EVENT_IRQHandler, . - OS_EVENT_IRQHandler - - .align 1 - .thumb_func - .weak FLEXSPI0_IRQHandler - .type FLEXSPI0_IRQHandler, %function -FLEXSPI0_IRQHandler: - ldr r0,=FLEXSPI0_DriverIRQHandler - bx r0 - .size FLEXSPI0_IRQHandler, . - FLEXSPI0_IRQHandler - - .align 1 - .thumb_func - .weak SAI0_IRQHandler - .type SAI0_IRQHandler, %function -SAI0_IRQHandler: - ldr r0,=SAI0_DriverIRQHandler - bx r0 - .size SAI0_IRQHandler, . - SAI0_IRQHandler - - .align 1 - .thumb_func - .weak SAI1_IRQHandler - .type SAI1_IRQHandler, %function -SAI1_IRQHandler: - ldr r0,=SAI1_DriverIRQHandler - bx r0 - .size SAI1_IRQHandler, . - SAI1_IRQHandler - - .align 1 - .thumb_func - .weak USDHC0_IRQHandler - .type USDHC0_IRQHandler, %function -USDHC0_IRQHandler: - ldr r0,=USDHC0_DriverIRQHandler - bx r0 - .size USDHC0_IRQHandler, . - USDHC0_IRQHandler - - .align 1 - .thumb_func - .weak CAN0_IRQHandler - .type CAN0_IRQHandler, %function -CAN0_IRQHandler: - ldr r0,=CAN0_DriverIRQHandler - bx r0 - .size CAN0_IRQHandler, . - CAN0_IRQHandler - - .align 1 - .thumb_func - .weak CAN1_IRQHandler - .type CAN1_IRQHandler, %function -CAN1_IRQHandler: - ldr r0,=CAN1_DriverIRQHandler - bx r0 - .size CAN1_IRQHandler, . - CAN1_IRQHandler - - .align 1 - .thumb_func - .weak Reserved80_IRQHandler - .type Reserved80_IRQHandler, %function -Reserved80_IRQHandler: - ldr r0,=Reserved80_DriverIRQHandler - bx r0 - .size Reserved80_IRQHandler, . - Reserved80_IRQHandler - - .align 1 - .thumb_func - .weak Reserved81_IRQHandler - .type Reserved81_IRQHandler, %function -Reserved81_IRQHandler: - ldr r0,=Reserved81_DriverIRQHandler - bx r0 - .size Reserved81_IRQHandler, . - Reserved81_IRQHandler - - .align 1 - .thumb_func - .weak USB1_HS_PHY_IRQHandler - .type USB1_HS_PHY_IRQHandler, %function -USB1_HS_PHY_IRQHandler: - ldr r0,=USB1_HS_PHY_DriverIRQHandler - bx r0 - .size USB1_HS_PHY_IRQHandler, . - USB1_HS_PHY_IRQHandler - - .align 1 - .thumb_func - .weak USB1_HS_IRQHandler - .type USB1_HS_IRQHandler, %function -USB1_HS_IRQHandler: - ldr r0,=USB1_HS_DriverIRQHandler - bx r0 - .size USB1_HS_IRQHandler, . - USB1_HS_IRQHandler - - .align 1 - .thumb_func - .weak SEC_HYPERVISOR_CALL_IRQHandler - .type SEC_HYPERVISOR_CALL_IRQHandler, %function -SEC_HYPERVISOR_CALL_IRQHandler: - ldr r0,=SEC_HYPERVISOR_CALL_DriverIRQHandler - bx r0 - .size SEC_HYPERVISOR_CALL_IRQHandler, . - SEC_HYPERVISOR_CALL_IRQHandler - - .align 1 - .thumb_func - .weak Reserved85_IRQHandler - .type Reserved85_IRQHandler, %function -Reserved85_IRQHandler: - ldr r0,=Reserved85_DriverIRQHandler - bx r0 - .size Reserved85_IRQHandler, . - Reserved85_IRQHandler - - .align 1 - .thumb_func - .weak PLU_IRQHandler - .type PLU_IRQHandler, %function -PLU_IRQHandler: - ldr r0,=PLU_DriverIRQHandler - bx r0 - .size PLU_IRQHandler, . - PLU_IRQHandler - - .align 1 - .thumb_func - .weak Freqme_IRQHandler - .type Freqme_IRQHandler, %function -Freqme_IRQHandler: - ldr r0,=Freqme_DriverIRQHandler - bx r0 - .size Freqme_IRQHandler, . - Freqme_IRQHandler - - .align 1 - .thumb_func - .weak SEC_VIO_IRQHandler - .type SEC_VIO_IRQHandler, %function -SEC_VIO_IRQHandler: - ldr r0,=SEC_VIO_DriverIRQHandler - bx r0 - .size SEC_VIO_IRQHandler, . - SEC_VIO_IRQHandler - - .align 1 - .thumb_func - .weak ELS_IRQHandler - .type ELS_IRQHandler, %function -ELS_IRQHandler: - ldr r0,=ELS_DriverIRQHandler - bx r0 - .size ELS_IRQHandler, . - ELS_IRQHandler - - .align 1 - .thumb_func - .weak PKC_IRQHandler - .type PKC_IRQHandler, %function -PKC_IRQHandler: - ldr r0,=PKC_DriverIRQHandler - bx r0 - .size PKC_IRQHandler, . - PKC_IRQHandler - - .align 1 - .thumb_func - .weak PUF_IRQHandler - .type PUF_IRQHandler, %function -PUF_IRQHandler: - ldr r0,=PUF_DriverIRQHandler - bx r0 - .size PUF_IRQHandler, . - PUF_IRQHandler - - .align 1 - .thumb_func - .weak PQ_IRQHandler - .type PQ_IRQHandler, %function -PQ_IRQHandler: - ldr r0,=PQ_DriverIRQHandler - bx r0 - .size PQ_IRQHandler, . - PQ_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH0_IRQHandler - .type EDMA_1_CH0_IRQHandler, %function -EDMA_1_CH0_IRQHandler: - ldr r0,=EDMA_1_CH0_DriverIRQHandler - bx r0 - .size EDMA_1_CH0_IRQHandler, . - EDMA_1_CH0_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH1_IRQHandler - .type EDMA_1_CH1_IRQHandler, %function -EDMA_1_CH1_IRQHandler: - ldr r0,=EDMA_1_CH1_DriverIRQHandler - bx r0 - .size EDMA_1_CH1_IRQHandler, . - EDMA_1_CH1_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH2_IRQHandler - .type EDMA_1_CH2_IRQHandler, %function -EDMA_1_CH2_IRQHandler: - ldr r0,=EDMA_1_CH2_DriverIRQHandler - bx r0 - .size EDMA_1_CH2_IRQHandler, . - EDMA_1_CH2_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH3_IRQHandler - .type EDMA_1_CH3_IRQHandler, %function -EDMA_1_CH3_IRQHandler: - ldr r0,=EDMA_1_CH3_DriverIRQHandler - bx r0 - .size EDMA_1_CH3_IRQHandler, . - EDMA_1_CH3_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH4_IRQHandler - .type EDMA_1_CH4_IRQHandler, %function -EDMA_1_CH4_IRQHandler: - ldr r0,=EDMA_1_CH4_DriverIRQHandler - bx r0 - .size EDMA_1_CH4_IRQHandler, . - EDMA_1_CH4_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH5_IRQHandler - .type EDMA_1_CH5_IRQHandler, %function -EDMA_1_CH5_IRQHandler: - ldr r0,=EDMA_1_CH5_DriverIRQHandler - bx r0 - .size EDMA_1_CH5_IRQHandler, . - EDMA_1_CH5_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH6_IRQHandler - .type EDMA_1_CH6_IRQHandler, %function -EDMA_1_CH6_IRQHandler: - ldr r0,=EDMA_1_CH6_DriverIRQHandler - bx r0 - .size EDMA_1_CH6_IRQHandler, . - EDMA_1_CH6_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH7_IRQHandler - .type EDMA_1_CH7_IRQHandler, %function -EDMA_1_CH7_IRQHandler: - ldr r0,=EDMA_1_CH7_DriverIRQHandler - bx r0 - .size EDMA_1_CH7_IRQHandler, . - EDMA_1_CH7_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH8_IRQHandler - .type EDMA_1_CH8_IRQHandler, %function -EDMA_1_CH8_IRQHandler: - ldr r0,=EDMA_1_CH8_DriverIRQHandler - bx r0 - .size EDMA_1_CH8_IRQHandler, . - EDMA_1_CH8_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH9_IRQHandler - .type EDMA_1_CH9_IRQHandler, %function -EDMA_1_CH9_IRQHandler: - ldr r0,=EDMA_1_CH9_DriverIRQHandler - bx r0 - .size EDMA_1_CH9_IRQHandler, . - EDMA_1_CH9_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH10_IRQHandler - .type EDMA_1_CH10_IRQHandler, %function -EDMA_1_CH10_IRQHandler: - ldr r0,=EDMA_1_CH10_DriverIRQHandler - bx r0 - .size EDMA_1_CH10_IRQHandler, . - EDMA_1_CH10_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH11_IRQHandler - .type EDMA_1_CH11_IRQHandler, %function -EDMA_1_CH11_IRQHandler: - ldr r0,=EDMA_1_CH11_DriverIRQHandler - bx r0 - .size EDMA_1_CH11_IRQHandler, . - EDMA_1_CH11_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH12_IRQHandler - .type EDMA_1_CH12_IRQHandler, %function -EDMA_1_CH12_IRQHandler: - ldr r0,=EDMA_1_CH12_DriverIRQHandler - bx r0 - .size EDMA_1_CH12_IRQHandler, . - EDMA_1_CH12_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH13_IRQHandler - .type EDMA_1_CH13_IRQHandler, %function -EDMA_1_CH13_IRQHandler: - ldr r0,=EDMA_1_CH13_DriverIRQHandler - bx r0 - .size EDMA_1_CH13_IRQHandler, . - EDMA_1_CH13_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH14_IRQHandler - .type EDMA_1_CH14_IRQHandler, %function -EDMA_1_CH14_IRQHandler: - ldr r0,=EDMA_1_CH14_DriverIRQHandler - bx r0 - .size EDMA_1_CH14_IRQHandler, . - EDMA_1_CH14_IRQHandler - - .align 1 - .thumb_func - .weak EDMA_1_CH15_IRQHandler - .type EDMA_1_CH15_IRQHandler, %function -EDMA_1_CH15_IRQHandler: - ldr r0,=EDMA_1_CH15_DriverIRQHandler - bx r0 - .size EDMA_1_CH15_IRQHandler, . - EDMA_1_CH15_IRQHandler - - .align 1 - .thumb_func - .weak CDOG0_IRQHandler - .type CDOG0_IRQHandler, %function -CDOG0_IRQHandler: - ldr r0,=CDOG0_DriverIRQHandler - bx r0 - .size CDOG0_IRQHandler, . - CDOG0_IRQHandler - - .align 1 - .thumb_func - .weak CDOG1_IRQHandler - .type CDOG1_IRQHandler, %function -CDOG1_IRQHandler: - ldr r0,=CDOG1_DriverIRQHandler - bx r0 - .size CDOG1_IRQHandler, . - CDOG1_IRQHandler - - .align 1 - .thumb_func - .weak I3C0_IRQHandler - .type I3C0_IRQHandler, %function -I3C0_IRQHandler: - ldr r0,=I3C0_DriverIRQHandler - bx r0 - .size I3C0_IRQHandler, . - I3C0_IRQHandler - - .align 1 - .thumb_func - .weak I3C1_IRQHandler - .type I3C1_IRQHandler, %function -I3C1_IRQHandler: - ldr r0,=I3C1_DriverIRQHandler - bx r0 - .size I3C1_IRQHandler, . - I3C1_IRQHandler - - .align 1 - .thumb_func - .weak NPU_IRQHandler - .type NPU_IRQHandler, %function -NPU_IRQHandler: - ldr r0,=NPU_DriverIRQHandler - bx r0 - .size NPU_IRQHandler, . - NPU_IRQHandler - - .align 1 - .thumb_func - .weak GDET_IRQHandler - .type GDET_IRQHandler, %function -GDET_IRQHandler: - ldr r0,=GDET_DriverIRQHandler - bx r0 - .size GDET_IRQHandler, . - GDET_IRQHandler - - .align 1 - .thumb_func - .weak VBAT0_IRQHandler - .type VBAT0_IRQHandler, %function -VBAT0_IRQHandler: - ldr r0,=VBAT0_DriverIRQHandler - bx r0 - .size VBAT0_IRQHandler, . - VBAT0_IRQHandler - - .align 1 - .thumb_func - .weak EWM0_IRQHandler - .type EWM0_IRQHandler, %function -EWM0_IRQHandler: - ldr r0,=EWM0_DriverIRQHandler - bx r0 - .size EWM0_IRQHandler, . - EWM0_IRQHandler - - .align 1 - .thumb_func - .weak TSI_END_OF_SCAN_IRQHandler - .type TSI_END_OF_SCAN_IRQHandler, %function -TSI_END_OF_SCAN_IRQHandler: - ldr r0,=TSI_END_OF_SCAN_DriverIRQHandler - bx r0 - .size TSI_END_OF_SCAN_IRQHandler, . - TSI_END_OF_SCAN_IRQHandler - - .align 1 - .thumb_func - .weak TSI_OUT_OF_SCAN_IRQHandler - .type TSI_OUT_OF_SCAN_IRQHandler, %function -TSI_OUT_OF_SCAN_IRQHandler: - ldr r0,=TSI_OUT_OF_SCAN_DriverIRQHandler - bx r0 - .size TSI_OUT_OF_SCAN_IRQHandler, . - TSI_OUT_OF_SCAN_IRQHandler - - .align 1 - .thumb_func - .weak EMVSIM0_IRQHandler - .type EMVSIM0_IRQHandler, %function -EMVSIM0_IRQHandler: - ldr r0,=EMVSIM0_DriverIRQHandler - bx r0 - .size EMVSIM0_IRQHandler, . - EMVSIM0_IRQHandler - - .align 1 - .thumb_func - .weak EMVSIM1_IRQHandler - .type EMVSIM1_IRQHandler, %function -EMVSIM1_IRQHandler: - ldr r0,=EMVSIM1_DriverIRQHandler - bx r0 - .size EMVSIM1_IRQHandler, . - EMVSIM1_IRQHandler - - .align 1 - .thumb_func - .weak FLEXIO_IRQHandler - .type FLEXIO_IRQHandler, %function -FLEXIO_IRQHandler: - ldr r0,=FLEXIO_DriverIRQHandler - bx r0 - .size FLEXIO_IRQHandler, . - FLEXIO_IRQHandler - - .align 1 - .thumb_func - .weak DAC0_IRQHandler - .type DAC0_IRQHandler, %function -DAC0_IRQHandler: - ldr r0,=DAC0_DriverIRQHandler - bx r0 - .size DAC0_IRQHandler, . - DAC0_IRQHandler - - .align 1 - .thumb_func - .weak DAC1_IRQHandler - .type DAC1_IRQHandler, %function -DAC1_IRQHandler: - ldr r0,=DAC1_DriverIRQHandler - bx r0 - .size DAC1_IRQHandler, . - DAC1_IRQHandler - - .align 1 - .thumb_func - .weak DAC2_IRQHandler - .type DAC2_IRQHandler, %function -DAC2_IRQHandler: - ldr r0,=DAC2_DriverIRQHandler - bx r0 - .size DAC2_IRQHandler, . - DAC2_IRQHandler - - .align 1 - .thumb_func - .weak HSCMP0_IRQHandler - .type HSCMP0_IRQHandler, %function -HSCMP0_IRQHandler: - ldr r0,=HSCMP0_DriverIRQHandler - bx r0 - .size HSCMP0_IRQHandler, . - HSCMP0_IRQHandler - - .align 1 - .thumb_func - .weak HSCMP1_IRQHandler - .type HSCMP1_IRQHandler, %function -HSCMP1_IRQHandler: - ldr r0,=HSCMP1_DriverIRQHandler - bx r0 - .size HSCMP1_IRQHandler, . - HSCMP1_IRQHandler - - .align 1 - .thumb_func - .weak HSCMP2_IRQHandler - .type HSCMP2_IRQHandler, %function -HSCMP2_IRQHandler: - ldr r0,=HSCMP2_DriverIRQHandler - bx r0 - .size HSCMP2_IRQHandler, . - HSCMP2_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_RELOAD_ERROR_IRQHandler - .type FLEXPWM0_RELOAD_ERROR_IRQHandler, %function -FLEXPWM0_RELOAD_ERROR_IRQHandler: - ldr r0,=FLEXPWM0_RELOAD_ERROR_DriverIRQHandler - bx r0 - .size FLEXPWM0_RELOAD_ERROR_IRQHandler, . - FLEXPWM0_RELOAD_ERROR_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_FAULT_IRQHandler - .type FLEXPWM0_FAULT_IRQHandler, %function -FLEXPWM0_FAULT_IRQHandler: - ldr r0,=FLEXPWM0_FAULT_DriverIRQHandler - bx r0 - .size FLEXPWM0_FAULT_IRQHandler, . - FLEXPWM0_FAULT_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE0_IRQHandler - .type FLEXPWM0_SUBMODULE0_IRQHandler, %function -FLEXPWM0_SUBMODULE0_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE0_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE0_IRQHandler, . - FLEXPWM0_SUBMODULE0_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE1_IRQHandler - .type FLEXPWM0_SUBMODULE1_IRQHandler, %function -FLEXPWM0_SUBMODULE1_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE1_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE1_IRQHandler, . - FLEXPWM0_SUBMODULE1_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE2_IRQHandler - .type FLEXPWM0_SUBMODULE2_IRQHandler, %function -FLEXPWM0_SUBMODULE2_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE2_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE2_IRQHandler, . - FLEXPWM0_SUBMODULE2_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM0_SUBMODULE3_IRQHandler - .type FLEXPWM0_SUBMODULE3_IRQHandler, %function -FLEXPWM0_SUBMODULE3_IRQHandler: - ldr r0,=FLEXPWM0_SUBMODULE3_DriverIRQHandler - bx r0 - .size FLEXPWM0_SUBMODULE3_IRQHandler, . - FLEXPWM0_SUBMODULE3_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_RELOAD_ERROR_IRQHandler - .type FLEXPWM1_RELOAD_ERROR_IRQHandler, %function -FLEXPWM1_RELOAD_ERROR_IRQHandler: - ldr r0,=FLEXPWM1_RELOAD_ERROR_DriverIRQHandler - bx r0 - .size FLEXPWM1_RELOAD_ERROR_IRQHandler, . - FLEXPWM1_RELOAD_ERROR_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_FAULT_IRQHandler - .type FLEXPWM1_FAULT_IRQHandler, %function -FLEXPWM1_FAULT_IRQHandler: - ldr r0,=FLEXPWM1_FAULT_DriverIRQHandler - bx r0 - .size FLEXPWM1_FAULT_IRQHandler, . - FLEXPWM1_FAULT_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_SUBMODULE0_IRQHandler - .type FLEXPWM1_SUBMODULE0_IRQHandler, %function -FLEXPWM1_SUBMODULE0_IRQHandler: - ldr r0,=FLEXPWM1_SUBMODULE0_DriverIRQHandler - bx r0 - .size FLEXPWM1_SUBMODULE0_IRQHandler, . - FLEXPWM1_SUBMODULE0_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_SUBMODULE1_IRQHandler - .type FLEXPWM1_SUBMODULE1_IRQHandler, %function -FLEXPWM1_SUBMODULE1_IRQHandler: - ldr r0,=FLEXPWM1_SUBMODULE1_DriverIRQHandler - bx r0 - .size FLEXPWM1_SUBMODULE1_IRQHandler, . - FLEXPWM1_SUBMODULE1_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_SUBMODULE2_IRQHandler - .type FLEXPWM1_SUBMODULE2_IRQHandler, %function -FLEXPWM1_SUBMODULE2_IRQHandler: - ldr r0,=FLEXPWM1_SUBMODULE2_DriverIRQHandler - bx r0 - .size FLEXPWM1_SUBMODULE2_IRQHandler, . - FLEXPWM1_SUBMODULE2_IRQHandler - - .align 1 - .thumb_func - .weak FLEXPWM1_SUBMODULE3_IRQHandler - .type FLEXPWM1_SUBMODULE3_IRQHandler, %function -FLEXPWM1_SUBMODULE3_IRQHandler: - ldr r0,=FLEXPWM1_SUBMODULE3_DriverIRQHandler - bx r0 - .size FLEXPWM1_SUBMODULE3_IRQHandler, . - FLEXPWM1_SUBMODULE3_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_COMPARE_IRQHandler - .type QDC0_COMPARE_IRQHandler, %function -QDC0_COMPARE_IRQHandler: - ldr r0,=QDC0_COMPARE_DriverIRQHandler - bx r0 - .size QDC0_COMPARE_IRQHandler, . - QDC0_COMPARE_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_HOME_IRQHandler - .type QDC0_HOME_IRQHandler, %function -QDC0_HOME_IRQHandler: - ldr r0,=QDC0_HOME_DriverIRQHandler - bx r0 - .size QDC0_HOME_IRQHandler, . - QDC0_HOME_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_WDG_SAB_IRQHandler - .type QDC0_WDG_SAB_IRQHandler, %function -QDC0_WDG_SAB_IRQHandler: - ldr r0,=QDC0_WDG_SAB_DriverIRQHandler - bx r0 - .size QDC0_WDG_SAB_IRQHandler, . - QDC0_WDG_SAB_IRQHandler - - .align 1 - .thumb_func - .weak QDC0_IDX_IRQHandler - .type QDC0_IDX_IRQHandler, %function -QDC0_IDX_IRQHandler: - ldr r0,=QDC0_IDX_DriverIRQHandler - bx r0 - .size QDC0_IDX_IRQHandler, . - QDC0_IDX_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_COMPARE_IRQHandler - .type QDC1_COMPARE_IRQHandler, %function -QDC1_COMPARE_IRQHandler: - ldr r0,=QDC1_COMPARE_DriverIRQHandler - bx r0 - .size QDC1_COMPARE_IRQHandler, . - QDC1_COMPARE_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_HOME_IRQHandler - .type QDC1_HOME_IRQHandler, %function -QDC1_HOME_IRQHandler: - ldr r0,=QDC1_HOME_DriverIRQHandler - bx r0 - .size QDC1_HOME_IRQHandler, . - QDC1_HOME_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_WDG_SAB_IRQHandler - .type QDC1_WDG_SAB_IRQHandler, %function -QDC1_WDG_SAB_IRQHandler: - ldr r0,=QDC1_WDG_SAB_DriverIRQHandler - bx r0 - .size QDC1_WDG_SAB_IRQHandler, . - QDC1_WDG_SAB_IRQHandler - - .align 1 - .thumb_func - .weak QDC1_IDX_IRQHandler - .type QDC1_IDX_IRQHandler, %function -QDC1_IDX_IRQHandler: - ldr r0,=QDC1_IDX_DriverIRQHandler - bx r0 - .size QDC1_IDX_IRQHandler, . - QDC1_IDX_IRQHandler - - .align 1 - .thumb_func - .weak ITRC0_IRQHandler - .type ITRC0_IRQHandler, %function -ITRC0_IRQHandler: - ldr r0,=ITRC0_DriverIRQHandler - bx r0 - .size ITRC0_IRQHandler, . - ITRC0_IRQHandler - - .align 1 - .thumb_func - .weak BSP32_IRQHandler - .type BSP32_IRQHandler, %function -BSP32_IRQHandler: - ldr r0,=BSP32_DriverIRQHandler - bx r0 - .size BSP32_IRQHandler, . - BSP32_IRQHandler - - .align 1 - .thumb_func - .weak ELS_ERR_IRQHandler - .type ELS_ERR_IRQHandler, %function -ELS_ERR_IRQHandler: - ldr r0,=ELS_ERR_DriverIRQHandler - bx r0 - .size ELS_ERR_IRQHandler, . - ELS_ERR_IRQHandler - - .align 1 - .thumb_func - .weak PKC_ERR_IRQHandler - .type PKC_ERR_IRQHandler, %function -PKC_ERR_IRQHandler: - ldr r0,=PKC_ERR_DriverIRQHandler - bx r0 - .size PKC_ERR_IRQHandler, . - PKC_ERR_IRQHandler - - .align 1 - .thumb_func - .weak ERM_SINGLE_BIT_ERROR_IRQHandler - .type ERM_SINGLE_BIT_ERROR_IRQHandler, %function -ERM_SINGLE_BIT_ERROR_IRQHandler: - ldr r0,=ERM_SINGLE_BIT_ERROR_DriverIRQHandler - bx r0 - .size ERM_SINGLE_BIT_ERROR_IRQHandler, . - ERM_SINGLE_BIT_ERROR_IRQHandler - - .align 1 - .thumb_func - .weak ERM_MULTI_BIT_ERROR_IRQHandler - .type ERM_MULTI_BIT_ERROR_IRQHandler, %function -ERM_MULTI_BIT_ERROR_IRQHandler: - ldr r0,=ERM_MULTI_BIT_ERROR_DriverIRQHandler - bx r0 - .size ERM_MULTI_BIT_ERROR_IRQHandler, . - ERM_MULTI_BIT_ERROR_IRQHandler - - .align 1 - .thumb_func - .weak FMU0_IRQHandler - .type FMU0_IRQHandler, %function -FMU0_IRQHandler: - ldr r0,=FMU0_DriverIRQHandler - bx r0 - .size FMU0_IRQHandler, . - FMU0_IRQHandler - - .align 1 - .thumb_func - .weak ETHERNET_IRQHandler - .type ETHERNET_IRQHandler, %function -ETHERNET_IRQHandler: - ldr r0,=ETHERNET_DriverIRQHandler - bx r0 - .size ETHERNET_IRQHandler, . - ETHERNET_IRQHandler - - .align 1 - .thumb_func - .weak ETHERNET_PMT_IRQHandler - .type ETHERNET_PMT_IRQHandler, %function -ETHERNET_PMT_IRQHandler: - ldr r0,=ETHERNET_PMT_DriverIRQHandler - bx r0 - .size ETHERNET_PMT_IRQHandler, . - ETHERNET_PMT_IRQHandler - - .align 1 - .thumb_func - .weak ETHERNET_MACLP_IRQHandler - .type ETHERNET_MACLP_IRQHandler, %function -ETHERNET_MACLP_IRQHandler: - ldr r0,=ETHERNET_MACLP_DriverIRQHandler - bx r0 - .size ETHERNET_MACLP_IRQHandler, . - ETHERNET_MACLP_IRQHandler - - .align 1 - .thumb_func - .weak SINC_FILTER_IRQHandler - .type SINC_FILTER_IRQHandler, %function -SINC_FILTER_IRQHandler: - ldr r0,=SINC_FILTER_DriverIRQHandler - bx r0 - .size SINC_FILTER_IRQHandler, . - SINC_FILTER_IRQHandler - - .align 1 - .thumb_func - .weak LPTMR0_IRQHandler - .type LPTMR0_IRQHandler, %function -LPTMR0_IRQHandler: - ldr r0,=LPTMR0_DriverIRQHandler - bx r0 - .size LPTMR0_IRQHandler, . - LPTMR0_IRQHandler - - .align 1 - .thumb_func - .weak LPTMR1_IRQHandler - .type LPTMR1_IRQHandler, %function -LPTMR1_IRQHandler: - ldr r0,=LPTMR1_DriverIRQHandler - bx r0 - .size LPTMR1_IRQHandler, . - LPTMR1_IRQHandler - - .align 1 - .thumb_func - .weak SCG_IRQHandler - .type SCG_IRQHandler, %function -SCG_IRQHandler: - ldr r0,=SCG_DriverIRQHandler - bx r0 - .size SCG_IRQHandler, . - SCG_IRQHandler - - .align 1 - .thumb_func - .weak SPC_IRQHandler - .type SPC_IRQHandler, %function -SPC_IRQHandler: - ldr r0,=SPC_DriverIRQHandler - bx r0 - .size SPC_IRQHandler, . - SPC_IRQHandler - - .align 1 - .thumb_func - .weak WUU_IRQHandler - .type WUU_IRQHandler, %function -WUU_IRQHandler: - ldr r0,=WUU_DriverIRQHandler - bx r0 - .size WUU_IRQHandler, . - WUU_IRQHandler - - .align 1 - .thumb_func - .weak PORT_EFT_IRQHandler - .type PORT_EFT_IRQHandler, %function -PORT_EFT_IRQHandler: - ldr r0,=PORT_EFT_DriverIRQHandler - bx r0 - .size PORT_EFT_IRQHandler, . - PORT_EFT_IRQHandler - - .align 1 - .thumb_func - .weak ETB0_IRQHandler - .type ETB0_IRQHandler, %function -ETB0_IRQHandler: - ldr r0,=ETB0_DriverIRQHandler - bx r0 - .size ETB0_IRQHandler, . - ETB0_IRQHandler - - .align 1 - .thumb_func - .weak Reserved166_IRQHandler - .type Reserved166_IRQHandler, %function -Reserved166_IRQHandler: - ldr r0,=Reserved166_DriverIRQHandler - bx r0 - .size Reserved166_IRQHandler, . - Reserved166_IRQHandler - - .align 1 - .thumb_func - .weak Reserved167_IRQHandler - .type Reserved167_IRQHandler, %function -Reserved167_IRQHandler: - ldr r0,=Reserved167_DriverIRQHandler - bx r0 - .size Reserved167_IRQHandler, . - Reserved167_IRQHandler - - .align 1 - .thumb_func - .weak WWDT0_IRQHandler - .type WWDT0_IRQHandler, %function -WWDT0_IRQHandler: - ldr r0,=WWDT0_DriverIRQHandler - bx r0 - .size WWDT0_IRQHandler, . - WWDT0_IRQHandler - - .align 1 - .thumb_func - .weak WWDT1_IRQHandler - .type WWDT1_IRQHandler, %function -WWDT1_IRQHandler: - ldr r0,=WWDT1_DriverIRQHandler - bx r0 - .size WWDT1_IRQHandler, . - WWDT1_IRQHandler - - .align 1 - .thumb_func - .weak CMC0_IRQHandler - .type CMC0_IRQHandler, %function -CMC0_IRQHandler: - ldr r0,=CMC0_DriverIRQHandler - bx r0 - .size CMC0_IRQHandler, . - CMC0_IRQHandler - - .align 1 - .thumb_func - .weak CTI0_IRQHandler - .type CTI0_IRQHandler, %function -CTI0_IRQHandler: - ldr r0,=CTI0_DriverIRQHandler - bx r0 - .size CTI0_IRQHandler, . - CTI0_IRQHandler - - -/* Macro to define default handlers. Default handler - * will be weak symbol and just dead loops. They can be - * overwritten by other handlers */ - .macro def_irq_handler handler_name - .weak \handler_name - .set \handler_name, DefaultISR - .endm -/* Exception Handlers */ - def_irq_handler MemManage_Handler - def_irq_handler BusFault_Handler - def_irq_handler UsageFault_Handler - def_irq_handler SecureFault_Handler - def_irq_handler DebugMon_Handler - def_irq_handler OR_DriverIRQHandler - def_irq_handler EDMA_0_CH0_DriverIRQHandler - def_irq_handler EDMA_0_CH1_DriverIRQHandler - def_irq_handler EDMA_0_CH2_DriverIRQHandler - def_irq_handler EDMA_0_CH3_DriverIRQHandler - def_irq_handler EDMA_0_CH4_DriverIRQHandler - def_irq_handler EDMA_0_CH5_DriverIRQHandler - def_irq_handler EDMA_0_CH6_DriverIRQHandler - def_irq_handler EDMA_0_CH7_DriverIRQHandler - def_irq_handler EDMA_0_CH8_DriverIRQHandler - def_irq_handler EDMA_0_CH9_DriverIRQHandler - def_irq_handler EDMA_0_CH10_DriverIRQHandler - def_irq_handler EDMA_0_CH11_DriverIRQHandler - def_irq_handler EDMA_0_CH12_DriverIRQHandler - def_irq_handler EDMA_0_CH13_DriverIRQHandler - def_irq_handler EDMA_0_CH14_DriverIRQHandler - def_irq_handler EDMA_0_CH15_DriverIRQHandler - def_irq_handler GPIO00_DriverIRQHandler - def_irq_handler GPIO01_DriverIRQHandler - def_irq_handler GPIO10_DriverIRQHandler - def_irq_handler GPIO11_DriverIRQHandler - def_irq_handler GPIO20_DriverIRQHandler - def_irq_handler GPIO21_DriverIRQHandler - def_irq_handler GPIO30_DriverIRQHandler - def_irq_handler GPIO31_DriverIRQHandler - def_irq_handler GPIO40_DriverIRQHandler - def_irq_handler GPIO41_DriverIRQHandler - def_irq_handler GPIO50_DriverIRQHandler - def_irq_handler GPIO51_DriverIRQHandler - def_irq_handler UTICK0_DriverIRQHandler - def_irq_handler MRT0_DriverIRQHandler - def_irq_handler CTIMER0_DriverIRQHandler - def_irq_handler CTIMER1_DriverIRQHandler - def_irq_handler SCT0_DriverIRQHandler - def_irq_handler CTIMER2_DriverIRQHandler - def_irq_handler LP_FLEXCOMM0_DriverIRQHandler - def_irq_handler LP_FLEXCOMM1_DriverIRQHandler - def_irq_handler LP_FLEXCOMM2_DriverIRQHandler - def_irq_handler LP_FLEXCOMM3_DriverIRQHandler - def_irq_handler LP_FLEXCOMM4_DriverIRQHandler - def_irq_handler LP_FLEXCOMM5_DriverIRQHandler - def_irq_handler LP_FLEXCOMM6_DriverIRQHandler - def_irq_handler LP_FLEXCOMM7_DriverIRQHandler - def_irq_handler LP_FLEXCOMM8_DriverIRQHandler - def_irq_handler LP_FLEXCOMM9_DriverIRQHandler - def_irq_handler ADC0_DriverIRQHandler - def_irq_handler ADC1_DriverIRQHandler - def_irq_handler PINT0_DriverIRQHandler - def_irq_handler PDM_EVENT_DriverIRQHandler - def_irq_handler Reserved65_DriverIRQHandler - def_irq_handler USB0_FS_DriverIRQHandler - def_irq_handler USB0_DCD_DriverIRQHandler - def_irq_handler RTC_DriverIRQHandler - def_irq_handler SMARTDMA_DriverIRQHandler - def_irq_handler MAILBOX_DriverIRQHandler - def_irq_handler CTIMER3_DriverIRQHandler - def_irq_handler CTIMER4_DriverIRQHandler - def_irq_handler OS_EVENT_DriverIRQHandler - def_irq_handler FLEXSPI0_DriverIRQHandler - def_irq_handler SAI0_DriverIRQHandler - def_irq_handler SAI1_DriverIRQHandler - def_irq_handler USDHC0_DriverIRQHandler - def_irq_handler CAN0_DriverIRQHandler - def_irq_handler CAN1_DriverIRQHandler - def_irq_handler Reserved80_DriverIRQHandler - def_irq_handler Reserved81_DriverIRQHandler - def_irq_handler USB1_HS_PHY_DriverIRQHandler - def_irq_handler USB1_HS_DriverIRQHandler - def_irq_handler SEC_HYPERVISOR_CALL_DriverIRQHandler - def_irq_handler Reserved85_DriverIRQHandler - def_irq_handler PLU_DriverIRQHandler - def_irq_handler Freqme_DriverIRQHandler - def_irq_handler SEC_VIO_DriverIRQHandler - def_irq_handler ELS_DriverIRQHandler - def_irq_handler PKC_DriverIRQHandler - def_irq_handler PUF_DriverIRQHandler - def_irq_handler PQ_DriverIRQHandler - def_irq_handler EDMA_1_CH0_DriverIRQHandler - def_irq_handler EDMA_1_CH1_DriverIRQHandler - def_irq_handler EDMA_1_CH2_DriverIRQHandler - def_irq_handler EDMA_1_CH3_DriverIRQHandler - def_irq_handler EDMA_1_CH4_DriverIRQHandler - def_irq_handler EDMA_1_CH5_DriverIRQHandler - def_irq_handler EDMA_1_CH6_DriverIRQHandler - def_irq_handler EDMA_1_CH7_DriverIRQHandler - def_irq_handler EDMA_1_CH8_DriverIRQHandler - def_irq_handler EDMA_1_CH9_DriverIRQHandler - def_irq_handler EDMA_1_CH10_DriverIRQHandler - def_irq_handler EDMA_1_CH11_DriverIRQHandler - def_irq_handler EDMA_1_CH12_DriverIRQHandler - def_irq_handler EDMA_1_CH13_DriverIRQHandler - def_irq_handler EDMA_1_CH14_DriverIRQHandler - def_irq_handler EDMA_1_CH15_DriverIRQHandler - def_irq_handler CDOG0_DriverIRQHandler - def_irq_handler CDOG1_DriverIRQHandler - def_irq_handler I3C0_DriverIRQHandler - def_irq_handler I3C1_DriverIRQHandler - def_irq_handler NPU_DriverIRQHandler - def_irq_handler GDET_DriverIRQHandler - def_irq_handler VBAT0_DriverIRQHandler - def_irq_handler EWM0_DriverIRQHandler - def_irq_handler TSI_END_OF_SCAN_DriverIRQHandler - def_irq_handler TSI_OUT_OF_SCAN_DriverIRQHandler - def_irq_handler EMVSIM0_DriverIRQHandler - def_irq_handler EMVSIM1_DriverIRQHandler - def_irq_handler FLEXIO_DriverIRQHandler - def_irq_handler DAC0_DriverIRQHandler - def_irq_handler DAC1_DriverIRQHandler - def_irq_handler DAC2_DriverIRQHandler - def_irq_handler HSCMP0_DriverIRQHandler - def_irq_handler HSCMP1_DriverIRQHandler - def_irq_handler HSCMP2_DriverIRQHandler - def_irq_handler FLEXPWM0_RELOAD_ERROR_DriverIRQHandler - def_irq_handler FLEXPWM0_FAULT_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE0_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE1_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE2_DriverIRQHandler - def_irq_handler FLEXPWM0_SUBMODULE3_DriverIRQHandler - def_irq_handler FLEXPWM1_RELOAD_ERROR_DriverIRQHandler - def_irq_handler FLEXPWM1_FAULT_DriverIRQHandler - def_irq_handler FLEXPWM1_SUBMODULE0_DriverIRQHandler - def_irq_handler FLEXPWM1_SUBMODULE1_DriverIRQHandler - def_irq_handler FLEXPWM1_SUBMODULE2_DriverIRQHandler - def_irq_handler FLEXPWM1_SUBMODULE3_DriverIRQHandler - def_irq_handler QDC0_COMPARE_DriverIRQHandler - def_irq_handler QDC0_HOME_DriverIRQHandler - def_irq_handler QDC0_WDG_SAB_DriverIRQHandler - def_irq_handler QDC0_IDX_DriverIRQHandler - def_irq_handler QDC1_COMPARE_DriverIRQHandler - def_irq_handler QDC1_HOME_DriverIRQHandler - def_irq_handler QDC1_WDG_SAB_DriverIRQHandler - def_irq_handler QDC1_IDX_DriverIRQHandler - def_irq_handler ITRC0_DriverIRQHandler - def_irq_handler BSP32_DriverIRQHandler - def_irq_handler ELS_ERR_DriverIRQHandler - def_irq_handler PKC_ERR_DriverIRQHandler - def_irq_handler ERM_SINGLE_BIT_ERROR_DriverIRQHandler - def_irq_handler ERM_MULTI_BIT_ERROR_DriverIRQHandler - def_irq_handler FMU0_DriverIRQHandler - def_irq_handler ETHERNET_DriverIRQHandler - def_irq_handler ETHERNET_PMT_DriverIRQHandler - def_irq_handler ETHERNET_MACLP_DriverIRQHandler - def_irq_handler SINC_FILTER_DriverIRQHandler - def_irq_handler LPTMR0_DriverIRQHandler - def_irq_handler LPTMR1_DriverIRQHandler - def_irq_handler SCG_DriverIRQHandler - def_irq_handler SPC_DriverIRQHandler - def_irq_handler WUU_DriverIRQHandler - def_irq_handler PORT_EFT_DriverIRQHandler - def_irq_handler ETB0_DriverIRQHandler - def_irq_handler Reserved166_DriverIRQHandler - def_irq_handler Reserved167_DriverIRQHandler - def_irq_handler WWDT0_DriverIRQHandler - def_irq_handler WWDT1_DriverIRQHandler - def_irq_handler CMC0_DriverIRQHandler - def_irq_handler CTI0_DriverIRQHandler - - .end diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/iar/startup_MCXN947_cm33_core0.s b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/iar/startup_MCXN947_cm33_core0.s deleted file mode 100644 index 35a27f32411..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/iar/startup_MCXN947_cm33_core0.s +++ /dev/null @@ -1,1556 +0,0 @@ -; ------------------------------------------------------------------------- -; @file: startup_MCXN947_cm33_core0.s -; @purpose: CMSIS Cortex-M33 Core Device Startup File -; MCXN947_cm33_core0 -; @version: 2.0 -; @date: 2023-2-1 -; @build: b240410 -; ------------------------------------------------------------------------- -; -; Copyright 1997-2016 Freescale Semiconductor, Inc. -; Copyright 2016-2024 NXP -; SPDX-License-Identifier: BSD-3-Clause -; -; The modules in this file are included in the libraries, and may be replaced -; by any user-defined modules that define the PUBLIC symbol _program_start or -; a user defined start symbol. -; To override the cstartup defined in the library, simply add your modified -; version to the workbench project. -; -; The vector table is normally located at address 0. -; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. -; The name "__vector_table" has special meaning for C-SPY: -; it is where the SP start value is found, and the NVIC vector -; table register (VTOR) is initialized to this address if != 0. -; -; Cortex-M version -; - - MODULE ?cstartup - - ;; Forward declaration of sections. - SECTION CSTACK:DATA:NOROOT(3) - - SECTION .intvec:CODE:NOROOT(2) - - EXTERN __iar_program_start - EXTERN SystemInit - PUBLIC __vector_table - PUBLIC __vector_table_0x1c - PUBLIC __Vectors - PUBLIC __Vectors_End - PUBLIC __Vectors_Size - - DATA - -__iar_init$$done: ; The vector table is not needed - ; until after copy initialization is done - -__vector_table - DCD sfe(CSTACK) - DCD Reset_Handler - - DCD NMI_Handler ;NMI Handler - DCD HardFault_Handler ;Hard Fault Handler - DCD MemManage_Handler ;MPU Fault Handler - DCD BusFault_Handler ;Bus Fault Handler - DCD UsageFault_Handler ;Usage Fault Handler -__vector_table_0x1c - DCD SecureFault_Handler ;Secure Fault Handler - DCD 0 ;Reserved - DCD 0 ;Reserved - DCD 0 ;Reserved - DCD SVC_Handler ;SVCall Handler - DCD DebugMon_Handler ;Debug Monitor Handler - DCD 0 ;Reserved - DCD PendSV_Handler ;PendSV Handler - DCD SysTick_Handler ;SysTick Handler - - ;External Interrupts - DCD OR_IRQHandler ;OR IRQ - DCD EDMA_0_CH0_IRQHandler ;eDMA_0_CH0 error or transfer complete - DCD EDMA_0_CH1_IRQHandler ;eDMA_0_CH1 error or transfer complete - DCD EDMA_0_CH2_IRQHandler ;eDMA_0_CH2 error or transfer complete - DCD EDMA_0_CH3_IRQHandler ;eDMA_0_CH3 error or transfer complete - DCD EDMA_0_CH4_IRQHandler ;eDMA_0_CH4 error or transfer complete - DCD EDMA_0_CH5_IRQHandler ;eDMA_0_CH5 error or transfer complete - DCD EDMA_0_CH6_IRQHandler ;eDMA_0_CH6 error or transfer complete - DCD EDMA_0_CH7_IRQHandler ;eDMA_0_CH7 error or transfer complete - DCD EDMA_0_CH8_IRQHandler ;eDMA_0_CH8 error or transfer complete - DCD EDMA_0_CH9_IRQHandler ;eDMA_0_CH9 error or transfer complete - DCD EDMA_0_CH10_IRQHandler ;eDMA_0_CH10 error or transfer complete - DCD EDMA_0_CH11_IRQHandler ;eDMA_0_CH11 error or transfer complete - DCD EDMA_0_CH12_IRQHandler ;eDMA_0_CH12 error or transfer complete - DCD EDMA_0_CH13_IRQHandler ;eDMA_0_CH13 error or transfer complete - DCD EDMA_0_CH14_IRQHandler ;eDMA_0_CH14 error or transfer complete - DCD EDMA_0_CH15_IRQHandler ;eDMA_0_CH15 error or transfer complete - DCD GPIO00_IRQHandler ;GPIO0 interrupt 0 - DCD GPIO01_IRQHandler ;GPIO0 interrupt 1 - DCD GPIO10_IRQHandler ;GPIO1 interrupt 0 - DCD GPIO11_IRQHandler ;GPIO1 interrupt 1 - DCD GPIO20_IRQHandler ;GPIO2 interrupt 0 - DCD GPIO21_IRQHandler ;GPIO2 interrupt 1 - DCD GPIO30_IRQHandler ;GPIO3 interrupt 0 - DCD GPIO31_IRQHandler ;GPIO3 interrupt 1 - DCD GPIO40_IRQHandler ;GPIO4 interrupt 0 - DCD GPIO41_IRQHandler ;GPIO4 interrupt 1 - DCD GPIO50_IRQHandler ;GPIO5 interrupt 0 - DCD GPIO51_IRQHandler ;GPIO5 interrupt 1 - DCD UTICK0_IRQHandler ;Micro-Tick Timer interrupt - DCD MRT0_IRQHandler ;Multi-Rate Timer interrupt - DCD CTIMER0_IRQHandler ;Standard counter/timer 0 interrupt - DCD CTIMER1_IRQHandler ;Standard counter/timer 1 interrupt - DCD SCT0_IRQHandler ;SCTimer/PWM interrupt - DCD CTIMER2_IRQHandler ;Standard counter/timer 2 interrupt - DCD LP_FLEXCOMM0_IRQHandler ;LP_FLEXCOMM0 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) - DCD LP_FLEXCOMM1_IRQHandler ;LP_FLEXCOMM1 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) - DCD LP_FLEXCOMM2_IRQHandler ;LP_FLEXCOMM2 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) - DCD LP_FLEXCOMM3_IRQHandler ;LP_FLEXCOMM3 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) - DCD LP_FLEXCOMM4_IRQHandler ;LP_FLEXCOMM4 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) - DCD LP_FLEXCOMM5_IRQHandler ;LP_FLEXCOMM5 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) - DCD LP_FLEXCOMM6_IRQHandler ;LP_FLEXCOMM6 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) - DCD LP_FLEXCOMM7_IRQHandler ;LP_FLEXCOMM7 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) - DCD LP_FLEXCOMM8_IRQHandler ;LP_FLEXCOMM8 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) - DCD LP_FLEXCOMM9_IRQHandler ;LP_FLEXCOMM9 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) - DCD ADC0_IRQHandler ;Analog-to-Digital Converter 0 - General Purpose interrupt - DCD ADC1_IRQHandler ;Analog-to-Digital Converter 1 - General Purpose interrupt - DCD PINT0_IRQHandler ;Pin Interrupt Pattern Match Interrupt - DCD PDM_EVENT_IRQHandler ;Microphone Interface interrupt - DCD Reserved65_IRQHandler ;Reserved interrupt - DCD USB0_FS_IRQHandler ;Universal Serial Bus - Full Speed interrupt - DCD USB0_DCD_IRQHandler ;Universal Serial Bus - Device Charge Detect interrupt - DCD RTC_IRQHandler ;RTC Subsystem interrupt (RTC interrupt or Wake timer interrupt) - DCD SMARTDMA_IRQHandler ;SmartDMA_IRQ - DCD MAILBOX_IRQHandler ;Inter-CPU Mailbox interrupt0 for CPU0 Inter-CPU Mailbox interrupt1 for CPU1 - DCD CTIMER3_IRQHandler ;Standard counter/timer 3 interrupt - DCD CTIMER4_IRQHandler ;Standard counter/timer 4 interrupt - DCD OS_EVENT_IRQHandler ;OS event timer interrupt - DCD FLEXSPI0_IRQHandler ;Flexible Serial Peripheral Interface interrupt - DCD SAI0_IRQHandler ;Serial Audio Interface 0 interrupt - DCD SAI1_IRQHandler ;Serial Audio Interface 1 interrupt - DCD USDHC0_IRQHandler ;Ultra Secured Digital Host Controller interrupt - DCD CAN0_IRQHandler ;Controller Area Network 0 interrupt - DCD CAN1_IRQHandler ;Controller Area Network 1 interrupt - DCD Reserved80_IRQHandler ;Reserved interrupt - DCD Reserved81_IRQHandler ;Reserved interrupt - DCD USB1_HS_PHY_IRQHandler ;USBHS DCD or USBHS Phy interrupt - DCD USB1_HS_IRQHandler ;USB High Speed OTG Controller interrupt - DCD SEC_HYPERVISOR_CALL_IRQHandler ;AHB Secure Controller hypervisor call interrupt - DCD Reserved85_IRQHandler ;Reserved interrupt - DCD PLU_IRQHandler ;Programmable Logic Unit interrupt - DCD Freqme_IRQHandler ;Frequency Measurement interrupt - DCD SEC_VIO_IRQHandler ;Secure violation interrupt (Memory Block Checker interrupt or secure AHB matrix violation interrupt) - DCD ELS_IRQHandler ;ELS interrupt - DCD PKC_IRQHandler ;PKC interrupt - DCD PUF_IRQHandler ;Physical Unclonable Function interrupt - DCD PQ_IRQHandler ;Power Quad interrupt - DCD EDMA_1_CH0_IRQHandler ;eDMA_1_CH0 error or transfer complete - DCD EDMA_1_CH1_IRQHandler ;eDMA_1_CH1 error or transfer complete - DCD EDMA_1_CH2_IRQHandler ;eDMA_1_CH2 error or transfer complete - DCD EDMA_1_CH3_IRQHandler ;eDMA_1_CH3 error or transfer complete - DCD EDMA_1_CH4_IRQHandler ;eDMA_1_CH4 error or transfer complete - DCD EDMA_1_CH5_IRQHandler ;eDMA_1_CH5 error or transfer complete - DCD EDMA_1_CH6_IRQHandler ;eDMA_1_CH6 error or transfer complete - DCD EDMA_1_CH7_IRQHandler ;eDMA_1_CH7 error or transfer complete - DCD EDMA_1_CH8_IRQHandler ;eDMA_1_CH8 error or transfer complete - DCD EDMA_1_CH9_IRQHandler ;eDMA_1_CH9 error or transfer complete - DCD EDMA_1_CH10_IRQHandler ;eDMA_1_CH10 error or transfer complete - DCD EDMA_1_CH11_IRQHandler ;eDMA_1_CH11 error or transfer complete - DCD EDMA_1_CH12_IRQHandler ;eDMA_1_CH12 error or transfer complete - DCD EDMA_1_CH13_IRQHandler ;eDMA_1_CH13 error or transfer complete - DCD EDMA_1_CH14_IRQHandler ;eDMA_1_CH14 error or transfer complete - DCD EDMA_1_CH15_IRQHandler ;eDMA_1_CH15 error or transfer complete - DCD CDOG0_IRQHandler ;Code Watchdog Timer 0 interrupt - DCD CDOG1_IRQHandler ;Code Watchdog Timer 1 interrupt - DCD I3C0_IRQHandler ;Improved Inter Integrated Circuit interrupt 0 - DCD I3C1_IRQHandler ;Improved Inter Integrated Circuit interrupt 1 - DCD NPU_IRQHandler ;NPU interrupt - DCD GDET_IRQHandler ;Digital Glitch Detect 0 interrupt or Digital Glitch Detect 1 interrupt - DCD VBAT0_IRQHandler ;VBAT interrupt( VBAT interrupt or digital tamper interrupt) - DCD EWM0_IRQHandler ;External Watchdog Monitor interrupt - DCD TSI_END_OF_SCAN_IRQHandler ;TSI End of Scan interrupt - DCD TSI_OUT_OF_SCAN_IRQHandler ;TSI Out of Scan interrupt - DCD EMVSIM0_IRQHandler ;EMVSIM0 interrupt - DCD EMVSIM1_IRQHandler ;EMVSIM1 interrupt - DCD FLEXIO_IRQHandler ;Flexible Input/Output interrupt - DCD DAC0_IRQHandler ;Digital-to-Analog Converter 0 - General Purpose interrupt - DCD DAC1_IRQHandler ;Digital-to-Analog Converter 1 - General Purpose interrupt - DCD DAC2_IRQHandler ;14-bit Digital-to-Analog Converter interrupt - DCD HSCMP0_IRQHandler ;High-Speed comparator0 interrupt - DCD HSCMP1_IRQHandler ;High-Speed comparator1 interrupt - DCD HSCMP2_IRQHandler ;High-Speed comparator2 interrupt - DCD FLEXPWM0_RELOAD_ERROR_IRQHandler ;FlexPWM0_reload_error interrupt - DCD FLEXPWM0_FAULT_IRQHandler ;FlexPWM0_fault interrupt - DCD FLEXPWM0_SUBMODULE0_IRQHandler ;FlexPWM0 Submodule 0 capture/compare/reload interrupt - DCD FLEXPWM0_SUBMODULE1_IRQHandler ;FlexPWM0 Submodule 1 capture/compare/reload interrupt - DCD FLEXPWM0_SUBMODULE2_IRQHandler ;FlexPWM0 Submodule 2 capture/compare/reload interrupt - DCD FLEXPWM0_SUBMODULE3_IRQHandler ;FlexPWM0 Submodule 3 capture/compare/reload interrupt - DCD FLEXPWM1_RELOAD_ERROR_IRQHandler ;FlexPWM1_reload_error interrupt - DCD FLEXPWM1_FAULT_IRQHandler ;FlexPWM1_fault interrupt - DCD FLEXPWM1_SUBMODULE0_IRQHandler ;FlexPWM1 Submodule 0 capture/compare/reload interrupt - DCD FLEXPWM1_SUBMODULE1_IRQHandler ;FlexPWM1 Submodule 1 capture/compare/reload interrupt - DCD FLEXPWM1_SUBMODULE2_IRQHandler ;FlexPWM1 Submodule 2 capture/compare/reload interrupt - DCD FLEXPWM1_SUBMODULE3_IRQHandler ;FlexPWM1 Submodule 3 capture/compare/reload interrupt - DCD QDC0_COMPARE_IRQHandler ;QDC0_Compare interrupt - DCD QDC0_HOME_IRQHandler ;QDC0_Home interrupt - DCD QDC0_WDG_SAB_IRQHandler ;QDC0_WDG_IRQ/SAB interrupt - DCD QDC0_IDX_IRQHandler ;QDC0_IDX interrupt - DCD QDC1_COMPARE_IRQHandler ;QDC1_Compare interrupt - DCD QDC1_HOME_IRQHandler ;QDC1_Home interrupt - DCD QDC1_WDG_SAB_IRQHandler ;QDC1_WDG_IRQ/SAB interrupt - DCD QDC1_IDX_IRQHandler ;QDC1_IDX interrupt - DCD ITRC0_IRQHandler ;Intrusion and Tamper Response Controller interrupt - DCD BSP32_IRQHandler ;CoolFlux BSP32 interrupt - DCD ELS_ERR_IRQHandler ;ELS error interrupt - DCD PKC_ERR_IRQHandler ;PKC error interrupt - DCD ERM_SINGLE_BIT_ERROR_IRQHandler ;ERM Single Bit error interrupt - DCD ERM_MULTI_BIT_ERROR_IRQHandler ;ERM Multi Bit error interrupt - DCD FMU0_IRQHandler ;Flash Management Unit interrupt - DCD ETHERNET_IRQHandler ;Ethernet QoS interrupt - DCD ETHERNET_PMT_IRQHandler ;Ethernet QoS power management interrupt - DCD ETHERNET_MACLP_IRQHandler ;Ethernet QoS MAC interrupt - DCD SINC_FILTER_IRQHandler ;SINC Filter interrupt - DCD LPTMR0_IRQHandler ;Low Power Timer 0 interrupt - DCD LPTMR1_IRQHandler ;Low Power Timer 1 interrupt - DCD SCG_IRQHandler ;System Clock Generator interrupt - DCD SPC_IRQHandler ;System Power Controller interrupt - DCD WUU_IRQHandler ;Wake Up Unit interrupt - DCD PORT_EFT_IRQHandler ;PORT0~5 EFT interrupt - DCD ETB0_IRQHandler ;ETB counter expires interrupt - DCD Reserved166_IRQHandler ;Reserved interrupt - DCD Reserved167_IRQHandler ;Reserved interrupt - DCD WWDT0_IRQHandler ;Windowed Watchdog Timer 0 interrupt - DCD WWDT1_IRQHandler ;Windowed Watchdog Timer 1 interrupt - DCD CMC0_IRQHandler ;Core Mode Controller interrupt - DCD CTI0_IRQHandler ;Cross Trigger Interface interrupt -__Vectors_End - -__Vectors EQU __vector_table -__Vectors_Size EQU __Vectors_End - __Vectors - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Default interrupt handlers. -;; - THUMB - - PUBWEAK Reset_Handler - SECTION .text:CODE:REORDER:NOROOT(2) -Reset_Handler - CPSID I ; Mask interrupts - LDR R0, =0xE000ED08 - LDR R1, =__vector_table - STR R1, [R0] - LDR R2, [R1] - MSR MSP, R2 - LDR R0, =sfb(CSTACK) - MSR MSPLIM, R0 - CPSIE I ; Unmask interrupts - LDR R0, =SystemInit - BLX R0 - LDR R0, =__iar_program_start - BX R0 - - PUBWEAK NMI_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -NMI_Handler - B . - - PUBWEAK HardFault_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -HardFault_Handler - B . - - PUBWEAK MemManage_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -MemManage_Handler - B . - - PUBWEAK BusFault_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -BusFault_Handler - B . - - PUBWEAK UsageFault_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -UsageFault_Handler - B . - - PUBWEAK SecureFault_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -SecureFault_Handler - B . - - PUBWEAK SVC_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -SVC_Handler - B . - - PUBWEAK DebugMon_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -DebugMon_Handler - B . - - PUBWEAK PendSV_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -PendSV_Handler - B . - - PUBWEAK SysTick_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -SysTick_Handler - B . - - PUBWEAK OR_IRQHandler - PUBWEAK OR_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -OR_IRQHandler - LDR R0, =OR_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH0_IRQHandler - PUBWEAK EDMA_0_CH0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH0_IRQHandler - LDR R0, =EDMA_0_CH0_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH1_IRQHandler - PUBWEAK EDMA_0_CH1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH1_IRQHandler - LDR R0, =EDMA_0_CH1_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH2_IRQHandler - PUBWEAK EDMA_0_CH2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH2_IRQHandler - LDR R0, =EDMA_0_CH2_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH3_IRQHandler - PUBWEAK EDMA_0_CH3_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH3_IRQHandler - LDR R0, =EDMA_0_CH3_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH4_IRQHandler - PUBWEAK EDMA_0_CH4_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH4_IRQHandler - LDR R0, =EDMA_0_CH4_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH5_IRQHandler - PUBWEAK EDMA_0_CH5_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH5_IRQHandler - LDR R0, =EDMA_0_CH5_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH6_IRQHandler - PUBWEAK EDMA_0_CH6_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH6_IRQHandler - LDR R0, =EDMA_0_CH6_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH7_IRQHandler - PUBWEAK EDMA_0_CH7_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH7_IRQHandler - LDR R0, =EDMA_0_CH7_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH8_IRQHandler - PUBWEAK EDMA_0_CH8_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH8_IRQHandler - LDR R0, =EDMA_0_CH8_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH9_IRQHandler - PUBWEAK EDMA_0_CH9_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH9_IRQHandler - LDR R0, =EDMA_0_CH9_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH10_IRQHandler - PUBWEAK EDMA_0_CH10_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH10_IRQHandler - LDR R0, =EDMA_0_CH10_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH11_IRQHandler - PUBWEAK EDMA_0_CH11_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH11_IRQHandler - LDR R0, =EDMA_0_CH11_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH12_IRQHandler - PUBWEAK EDMA_0_CH12_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH12_IRQHandler - LDR R0, =EDMA_0_CH12_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH13_IRQHandler - PUBWEAK EDMA_0_CH13_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH13_IRQHandler - LDR R0, =EDMA_0_CH13_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH14_IRQHandler - PUBWEAK EDMA_0_CH14_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH14_IRQHandler - LDR R0, =EDMA_0_CH14_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH15_IRQHandler - PUBWEAK EDMA_0_CH15_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH15_IRQHandler - LDR R0, =EDMA_0_CH15_DriverIRQHandler - BX R0 - - PUBWEAK GPIO00_IRQHandler - PUBWEAK GPIO00_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO00_IRQHandler - LDR R0, =GPIO00_DriverIRQHandler - BX R0 - - PUBWEAK GPIO01_IRQHandler - PUBWEAK GPIO01_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO01_IRQHandler - LDR R0, =GPIO01_DriverIRQHandler - BX R0 - - PUBWEAK GPIO10_IRQHandler - PUBWEAK GPIO10_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO10_IRQHandler - LDR R0, =GPIO10_DriverIRQHandler - BX R0 - - PUBWEAK GPIO11_IRQHandler - PUBWEAK GPIO11_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO11_IRQHandler - LDR R0, =GPIO11_DriverIRQHandler - BX R0 - - PUBWEAK GPIO20_IRQHandler - PUBWEAK GPIO20_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO20_IRQHandler - LDR R0, =GPIO20_DriverIRQHandler - BX R0 - - PUBWEAK GPIO21_IRQHandler - PUBWEAK GPIO21_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO21_IRQHandler - LDR R0, =GPIO21_DriverIRQHandler - BX R0 - - PUBWEAK GPIO30_IRQHandler - PUBWEAK GPIO30_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO30_IRQHandler - LDR R0, =GPIO30_DriverIRQHandler - BX R0 - - PUBWEAK GPIO31_IRQHandler - PUBWEAK GPIO31_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO31_IRQHandler - LDR R0, =GPIO31_DriverIRQHandler - BX R0 - - PUBWEAK GPIO40_IRQHandler - PUBWEAK GPIO40_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO40_IRQHandler - LDR R0, =GPIO40_DriverIRQHandler - BX R0 - - PUBWEAK GPIO41_IRQHandler - PUBWEAK GPIO41_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO41_IRQHandler - LDR R0, =GPIO41_DriverIRQHandler - BX R0 - - PUBWEAK GPIO50_IRQHandler - PUBWEAK GPIO50_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO50_IRQHandler - LDR R0, =GPIO50_DriverIRQHandler - BX R0 - - PUBWEAK GPIO51_IRQHandler - PUBWEAK GPIO51_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO51_IRQHandler - LDR R0, =GPIO51_DriverIRQHandler - BX R0 - - PUBWEAK UTICK0_IRQHandler - PUBWEAK UTICK0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -UTICK0_IRQHandler - LDR R0, =UTICK0_DriverIRQHandler - BX R0 - - PUBWEAK MRT0_IRQHandler - PUBWEAK MRT0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -MRT0_IRQHandler - LDR R0, =MRT0_DriverIRQHandler - BX R0 - - PUBWEAK CTIMER0_IRQHandler - PUBWEAK CTIMER0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CTIMER0_IRQHandler - LDR R0, =CTIMER0_DriverIRQHandler - BX R0 - - PUBWEAK CTIMER1_IRQHandler - PUBWEAK CTIMER1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CTIMER1_IRQHandler - LDR R0, =CTIMER1_DriverIRQHandler - BX R0 - - PUBWEAK SCT0_IRQHandler - PUBWEAK SCT0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SCT0_IRQHandler - LDR R0, =SCT0_DriverIRQHandler - BX R0 - - PUBWEAK CTIMER2_IRQHandler - PUBWEAK CTIMER2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CTIMER2_IRQHandler - LDR R0, =CTIMER2_DriverIRQHandler - BX R0 - - PUBWEAK LP_FLEXCOMM0_IRQHandler - PUBWEAK LP_FLEXCOMM0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LP_FLEXCOMM0_IRQHandler - LDR R0, =LP_FLEXCOMM0_DriverIRQHandler - BX R0 - - PUBWEAK LP_FLEXCOMM1_IRQHandler - PUBWEAK LP_FLEXCOMM1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LP_FLEXCOMM1_IRQHandler - LDR R0, =LP_FLEXCOMM1_DriverIRQHandler - BX R0 - - PUBWEAK LP_FLEXCOMM2_IRQHandler - PUBWEAK LP_FLEXCOMM2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LP_FLEXCOMM2_IRQHandler - LDR R0, =LP_FLEXCOMM2_DriverIRQHandler - BX R0 - - PUBWEAK LP_FLEXCOMM3_IRQHandler - PUBWEAK LP_FLEXCOMM3_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LP_FLEXCOMM3_IRQHandler - LDR R0, =LP_FLEXCOMM3_DriverIRQHandler - BX R0 - - PUBWEAK LP_FLEXCOMM4_IRQHandler - PUBWEAK LP_FLEXCOMM4_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LP_FLEXCOMM4_IRQHandler - LDR R0, =LP_FLEXCOMM4_DriverIRQHandler - BX R0 - - PUBWEAK LP_FLEXCOMM5_IRQHandler - PUBWEAK LP_FLEXCOMM5_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LP_FLEXCOMM5_IRQHandler - LDR R0, =LP_FLEXCOMM5_DriverIRQHandler - BX R0 - - PUBWEAK LP_FLEXCOMM6_IRQHandler - PUBWEAK LP_FLEXCOMM6_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LP_FLEXCOMM6_IRQHandler - LDR R0, =LP_FLEXCOMM6_DriverIRQHandler - BX R0 - - PUBWEAK LP_FLEXCOMM7_IRQHandler - PUBWEAK LP_FLEXCOMM7_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LP_FLEXCOMM7_IRQHandler - LDR R0, =LP_FLEXCOMM7_DriverIRQHandler - BX R0 - - PUBWEAK LP_FLEXCOMM8_IRQHandler - PUBWEAK LP_FLEXCOMM8_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LP_FLEXCOMM8_IRQHandler - LDR R0, =LP_FLEXCOMM8_DriverIRQHandler - BX R0 - - PUBWEAK LP_FLEXCOMM9_IRQHandler - PUBWEAK LP_FLEXCOMM9_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LP_FLEXCOMM9_IRQHandler - LDR R0, =LP_FLEXCOMM9_DriverIRQHandler - BX R0 - - PUBWEAK ADC0_IRQHandler - PUBWEAK ADC0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ADC0_IRQHandler - LDR R0, =ADC0_DriverIRQHandler - BX R0 - - PUBWEAK ADC1_IRQHandler - PUBWEAK ADC1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ADC1_IRQHandler - LDR R0, =ADC1_DriverIRQHandler - BX R0 - - PUBWEAK PINT0_IRQHandler - PUBWEAK PINT0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -PINT0_IRQHandler - LDR R0, =PINT0_DriverIRQHandler - BX R0 - - PUBWEAK PDM_EVENT_IRQHandler - PUBWEAK PDM_EVENT_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -PDM_EVENT_IRQHandler - LDR R0, =PDM_EVENT_DriverIRQHandler - BX R0 - - PUBWEAK Reserved65_IRQHandler - PUBWEAK Reserved65_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved65_IRQHandler - LDR R0, =Reserved65_DriverIRQHandler - BX R0 - - PUBWEAK USB0_FS_IRQHandler - PUBWEAK USB0_FS_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -USB0_FS_IRQHandler - LDR R0, =USB0_FS_DriverIRQHandler - BX R0 - - PUBWEAK USB0_DCD_IRQHandler - PUBWEAK USB0_DCD_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -USB0_DCD_IRQHandler - LDR R0, =USB0_DCD_DriverIRQHandler - BX R0 - - PUBWEAK RTC_IRQHandler - PUBWEAK RTC_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -RTC_IRQHandler - LDR R0, =RTC_DriverIRQHandler - BX R0 - - PUBWEAK SMARTDMA_IRQHandler - PUBWEAK SMARTDMA_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SMARTDMA_IRQHandler - LDR R0, =SMARTDMA_DriverIRQHandler - BX R0 - - PUBWEAK MAILBOX_IRQHandler - PUBWEAK MAILBOX_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -MAILBOX_IRQHandler - LDR R0, =MAILBOX_DriverIRQHandler - BX R0 - - PUBWEAK CTIMER3_IRQHandler - PUBWEAK CTIMER3_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CTIMER3_IRQHandler - LDR R0, =CTIMER3_DriverIRQHandler - BX R0 - - PUBWEAK CTIMER4_IRQHandler - PUBWEAK CTIMER4_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CTIMER4_IRQHandler - LDR R0, =CTIMER4_DriverIRQHandler - BX R0 - - PUBWEAK OS_EVENT_IRQHandler - PUBWEAK OS_EVENT_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -OS_EVENT_IRQHandler - LDR R0, =OS_EVENT_DriverIRQHandler - BX R0 - - PUBWEAK FLEXSPI0_IRQHandler - PUBWEAK FLEXSPI0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXSPI0_IRQHandler - LDR R0, =FLEXSPI0_DriverIRQHandler - BX R0 - - PUBWEAK SAI0_IRQHandler - PUBWEAK SAI0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SAI0_IRQHandler - LDR R0, =SAI0_DriverIRQHandler - BX R0 - - PUBWEAK SAI1_IRQHandler - PUBWEAK SAI1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SAI1_IRQHandler - LDR R0, =SAI1_DriverIRQHandler - BX R0 - - PUBWEAK USDHC0_IRQHandler - PUBWEAK USDHC0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -USDHC0_IRQHandler - LDR R0, =USDHC0_DriverIRQHandler - BX R0 - - PUBWEAK CAN0_IRQHandler - PUBWEAK CAN0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CAN0_IRQHandler - LDR R0, =CAN0_DriverIRQHandler - BX R0 - - PUBWEAK CAN1_IRQHandler - PUBWEAK CAN1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CAN1_IRQHandler - LDR R0, =CAN1_DriverIRQHandler - BX R0 - - PUBWEAK Reserved80_IRQHandler - PUBWEAK Reserved80_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved80_IRQHandler - LDR R0, =Reserved80_DriverIRQHandler - BX R0 - - PUBWEAK Reserved81_IRQHandler - PUBWEAK Reserved81_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved81_IRQHandler - LDR R0, =Reserved81_DriverIRQHandler - BX R0 - - PUBWEAK USB1_HS_PHY_IRQHandler - PUBWEAK USB1_HS_PHY_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -USB1_HS_PHY_IRQHandler - LDR R0, =USB1_HS_PHY_DriverIRQHandler - BX R0 - - PUBWEAK USB1_HS_IRQHandler - PUBWEAK USB1_HS_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -USB1_HS_IRQHandler - LDR R0, =USB1_HS_DriverIRQHandler - BX R0 - - PUBWEAK SEC_HYPERVISOR_CALL_IRQHandler - PUBWEAK SEC_HYPERVISOR_CALL_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SEC_HYPERVISOR_CALL_IRQHandler - LDR R0, =SEC_HYPERVISOR_CALL_DriverIRQHandler - BX R0 - - PUBWEAK Reserved85_IRQHandler - PUBWEAK Reserved85_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved85_IRQHandler - LDR R0, =Reserved85_DriverIRQHandler - BX R0 - - PUBWEAK PLU_IRQHandler - PUBWEAK PLU_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -PLU_IRQHandler - LDR R0, =PLU_DriverIRQHandler - BX R0 - - PUBWEAK Freqme_IRQHandler - PUBWEAK Freqme_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Freqme_IRQHandler - LDR R0, =Freqme_DriverIRQHandler - BX R0 - - PUBWEAK SEC_VIO_IRQHandler - PUBWEAK SEC_VIO_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SEC_VIO_IRQHandler - LDR R0, =SEC_VIO_DriverIRQHandler - BX R0 - - PUBWEAK ELS_IRQHandler - PUBWEAK ELS_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ELS_IRQHandler - LDR R0, =ELS_DriverIRQHandler - BX R0 - - PUBWEAK PKC_IRQHandler - PUBWEAK PKC_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -PKC_IRQHandler - LDR R0, =PKC_DriverIRQHandler - BX R0 - - PUBWEAK PUF_IRQHandler - PUBWEAK PUF_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -PUF_IRQHandler - LDR R0, =PUF_DriverIRQHandler - BX R0 - - PUBWEAK PQ_IRQHandler - PUBWEAK PQ_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -PQ_IRQHandler - LDR R0, =PQ_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH0_IRQHandler - PUBWEAK EDMA_1_CH0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH0_IRQHandler - LDR R0, =EDMA_1_CH0_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH1_IRQHandler - PUBWEAK EDMA_1_CH1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH1_IRQHandler - LDR R0, =EDMA_1_CH1_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH2_IRQHandler - PUBWEAK EDMA_1_CH2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH2_IRQHandler - LDR R0, =EDMA_1_CH2_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH3_IRQHandler - PUBWEAK EDMA_1_CH3_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH3_IRQHandler - LDR R0, =EDMA_1_CH3_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH4_IRQHandler - PUBWEAK EDMA_1_CH4_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH4_IRQHandler - LDR R0, =EDMA_1_CH4_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH5_IRQHandler - PUBWEAK EDMA_1_CH5_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH5_IRQHandler - LDR R0, =EDMA_1_CH5_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH6_IRQHandler - PUBWEAK EDMA_1_CH6_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH6_IRQHandler - LDR R0, =EDMA_1_CH6_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH7_IRQHandler - PUBWEAK EDMA_1_CH7_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH7_IRQHandler - LDR R0, =EDMA_1_CH7_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH8_IRQHandler - PUBWEAK EDMA_1_CH8_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH8_IRQHandler - LDR R0, =EDMA_1_CH8_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH9_IRQHandler - PUBWEAK EDMA_1_CH9_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH9_IRQHandler - LDR R0, =EDMA_1_CH9_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH10_IRQHandler - PUBWEAK EDMA_1_CH10_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH10_IRQHandler - LDR R0, =EDMA_1_CH10_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH11_IRQHandler - PUBWEAK EDMA_1_CH11_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH11_IRQHandler - LDR R0, =EDMA_1_CH11_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH12_IRQHandler - PUBWEAK EDMA_1_CH12_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH12_IRQHandler - LDR R0, =EDMA_1_CH12_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH13_IRQHandler - PUBWEAK EDMA_1_CH13_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH13_IRQHandler - LDR R0, =EDMA_1_CH13_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH14_IRQHandler - PUBWEAK EDMA_1_CH14_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH14_IRQHandler - LDR R0, =EDMA_1_CH14_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH15_IRQHandler - PUBWEAK EDMA_1_CH15_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH15_IRQHandler - LDR R0, =EDMA_1_CH15_DriverIRQHandler - BX R0 - - PUBWEAK CDOG0_IRQHandler - PUBWEAK CDOG0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CDOG0_IRQHandler - LDR R0, =CDOG0_DriverIRQHandler - BX R0 - - PUBWEAK CDOG1_IRQHandler - PUBWEAK CDOG1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CDOG1_IRQHandler - LDR R0, =CDOG1_DriverIRQHandler - BX R0 - - PUBWEAK I3C0_IRQHandler - PUBWEAK I3C0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -I3C0_IRQHandler - LDR R0, =I3C0_DriverIRQHandler - BX R0 - - PUBWEAK I3C1_IRQHandler - PUBWEAK I3C1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -I3C1_IRQHandler - LDR R0, =I3C1_DriverIRQHandler - BX R0 - - PUBWEAK NPU_IRQHandler - PUBWEAK NPU_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -NPU_IRQHandler - LDR R0, =NPU_DriverIRQHandler - BX R0 - - PUBWEAK GDET_IRQHandler - PUBWEAK GDET_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GDET_IRQHandler - LDR R0, =GDET_DriverIRQHandler - BX R0 - - PUBWEAK VBAT0_IRQHandler - PUBWEAK VBAT0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -VBAT0_IRQHandler - LDR R0, =VBAT0_DriverIRQHandler - BX R0 - - PUBWEAK EWM0_IRQHandler - PUBWEAK EWM0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EWM0_IRQHandler - LDR R0, =EWM0_DriverIRQHandler - BX R0 - - PUBWEAK TSI_END_OF_SCAN_IRQHandler - PUBWEAK TSI_END_OF_SCAN_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -TSI_END_OF_SCAN_IRQHandler - LDR R0, =TSI_END_OF_SCAN_DriverIRQHandler - BX R0 - - PUBWEAK TSI_OUT_OF_SCAN_IRQHandler - PUBWEAK TSI_OUT_OF_SCAN_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -TSI_OUT_OF_SCAN_IRQHandler - LDR R0, =TSI_OUT_OF_SCAN_DriverIRQHandler - BX R0 - - PUBWEAK EMVSIM0_IRQHandler - PUBWEAK EMVSIM0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EMVSIM0_IRQHandler - LDR R0, =EMVSIM0_DriverIRQHandler - BX R0 - - PUBWEAK EMVSIM1_IRQHandler - PUBWEAK EMVSIM1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EMVSIM1_IRQHandler - LDR R0, =EMVSIM1_DriverIRQHandler - BX R0 - - PUBWEAK FLEXIO_IRQHandler - PUBWEAK FLEXIO_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXIO_IRQHandler - LDR R0, =FLEXIO_DriverIRQHandler - BX R0 - - PUBWEAK DAC0_IRQHandler - PUBWEAK DAC0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -DAC0_IRQHandler - LDR R0, =DAC0_DriverIRQHandler - BX R0 - - PUBWEAK DAC1_IRQHandler - PUBWEAK DAC1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -DAC1_IRQHandler - LDR R0, =DAC1_DriverIRQHandler - BX R0 - - PUBWEAK DAC2_IRQHandler - PUBWEAK DAC2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -DAC2_IRQHandler - LDR R0, =DAC2_DriverIRQHandler - BX R0 - - PUBWEAK HSCMP0_IRQHandler - PUBWEAK HSCMP0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -HSCMP0_IRQHandler - LDR R0, =HSCMP0_DriverIRQHandler - BX R0 - - PUBWEAK HSCMP1_IRQHandler - PUBWEAK HSCMP1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -HSCMP1_IRQHandler - LDR R0, =HSCMP1_DriverIRQHandler - BX R0 - - PUBWEAK HSCMP2_IRQHandler - PUBWEAK HSCMP2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -HSCMP2_IRQHandler - LDR R0, =HSCMP2_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM0_RELOAD_ERROR_IRQHandler - PUBWEAK FLEXPWM0_RELOAD_ERROR_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM0_RELOAD_ERROR_IRQHandler - LDR R0, =FLEXPWM0_RELOAD_ERROR_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM0_FAULT_IRQHandler - PUBWEAK FLEXPWM0_FAULT_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM0_FAULT_IRQHandler - LDR R0, =FLEXPWM0_FAULT_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM0_SUBMODULE0_IRQHandler - PUBWEAK FLEXPWM0_SUBMODULE0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM0_SUBMODULE0_IRQHandler - LDR R0, =FLEXPWM0_SUBMODULE0_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM0_SUBMODULE1_IRQHandler - PUBWEAK FLEXPWM0_SUBMODULE1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM0_SUBMODULE1_IRQHandler - LDR R0, =FLEXPWM0_SUBMODULE1_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM0_SUBMODULE2_IRQHandler - PUBWEAK FLEXPWM0_SUBMODULE2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM0_SUBMODULE2_IRQHandler - LDR R0, =FLEXPWM0_SUBMODULE2_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM0_SUBMODULE3_IRQHandler - PUBWEAK FLEXPWM0_SUBMODULE3_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM0_SUBMODULE3_IRQHandler - LDR R0, =FLEXPWM0_SUBMODULE3_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM1_RELOAD_ERROR_IRQHandler - PUBWEAK FLEXPWM1_RELOAD_ERROR_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM1_RELOAD_ERROR_IRQHandler - LDR R0, =FLEXPWM1_RELOAD_ERROR_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM1_FAULT_IRQHandler - PUBWEAK FLEXPWM1_FAULT_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM1_FAULT_IRQHandler - LDR R0, =FLEXPWM1_FAULT_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM1_SUBMODULE0_IRQHandler - PUBWEAK FLEXPWM1_SUBMODULE0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM1_SUBMODULE0_IRQHandler - LDR R0, =FLEXPWM1_SUBMODULE0_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM1_SUBMODULE1_IRQHandler - PUBWEAK FLEXPWM1_SUBMODULE1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM1_SUBMODULE1_IRQHandler - LDR R0, =FLEXPWM1_SUBMODULE1_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM1_SUBMODULE2_IRQHandler - PUBWEAK FLEXPWM1_SUBMODULE2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM1_SUBMODULE2_IRQHandler - LDR R0, =FLEXPWM1_SUBMODULE2_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM1_SUBMODULE3_IRQHandler - PUBWEAK FLEXPWM1_SUBMODULE3_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM1_SUBMODULE3_IRQHandler - LDR R0, =FLEXPWM1_SUBMODULE3_DriverIRQHandler - BX R0 - - PUBWEAK QDC0_COMPARE_IRQHandler - PUBWEAK QDC0_COMPARE_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC0_COMPARE_IRQHandler - LDR R0, =QDC0_COMPARE_DriverIRQHandler - BX R0 - - PUBWEAK QDC0_HOME_IRQHandler - PUBWEAK QDC0_HOME_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC0_HOME_IRQHandler - LDR R0, =QDC0_HOME_DriverIRQHandler - BX R0 - - PUBWEAK QDC0_WDG_SAB_IRQHandler - PUBWEAK QDC0_WDG_SAB_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC0_WDG_SAB_IRQHandler - LDR R0, =QDC0_WDG_SAB_DriverIRQHandler - BX R0 - - PUBWEAK QDC0_IDX_IRQHandler - PUBWEAK QDC0_IDX_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC0_IDX_IRQHandler - LDR R0, =QDC0_IDX_DriverIRQHandler - BX R0 - - PUBWEAK QDC1_COMPARE_IRQHandler - PUBWEAK QDC1_COMPARE_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC1_COMPARE_IRQHandler - LDR R0, =QDC1_COMPARE_DriverIRQHandler - BX R0 - - PUBWEAK QDC1_HOME_IRQHandler - PUBWEAK QDC1_HOME_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC1_HOME_IRQHandler - LDR R0, =QDC1_HOME_DriverIRQHandler - BX R0 - - PUBWEAK QDC1_WDG_SAB_IRQHandler - PUBWEAK QDC1_WDG_SAB_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC1_WDG_SAB_IRQHandler - LDR R0, =QDC1_WDG_SAB_DriverIRQHandler - BX R0 - - PUBWEAK QDC1_IDX_IRQHandler - PUBWEAK QDC1_IDX_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC1_IDX_IRQHandler - LDR R0, =QDC1_IDX_DriverIRQHandler - BX R0 - - PUBWEAK ITRC0_IRQHandler - PUBWEAK ITRC0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ITRC0_IRQHandler - LDR R0, =ITRC0_DriverIRQHandler - BX R0 - - PUBWEAK BSP32_IRQHandler - PUBWEAK BSP32_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -BSP32_IRQHandler - LDR R0, =BSP32_DriverIRQHandler - BX R0 - - PUBWEAK ELS_ERR_IRQHandler - PUBWEAK ELS_ERR_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ELS_ERR_IRQHandler - LDR R0, =ELS_ERR_DriverIRQHandler - BX R0 - - PUBWEAK PKC_ERR_IRQHandler - PUBWEAK PKC_ERR_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -PKC_ERR_IRQHandler - LDR R0, =PKC_ERR_DriverIRQHandler - BX R0 - - PUBWEAK ERM_SINGLE_BIT_ERROR_IRQHandler - PUBWEAK ERM_SINGLE_BIT_ERROR_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ERM_SINGLE_BIT_ERROR_IRQHandler - LDR R0, =ERM_SINGLE_BIT_ERROR_DriverIRQHandler - BX R0 - - PUBWEAK ERM_MULTI_BIT_ERROR_IRQHandler - PUBWEAK ERM_MULTI_BIT_ERROR_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ERM_MULTI_BIT_ERROR_IRQHandler - LDR R0, =ERM_MULTI_BIT_ERROR_DriverIRQHandler - BX R0 - - PUBWEAK FMU0_IRQHandler - PUBWEAK FMU0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FMU0_IRQHandler - LDR R0, =FMU0_DriverIRQHandler - BX R0 - - PUBWEAK ETHERNET_IRQHandler - PUBWEAK ETHERNET_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ETHERNET_IRQHandler - LDR R0, =ETHERNET_DriverIRQHandler - BX R0 - - PUBWEAK ETHERNET_PMT_IRQHandler - PUBWEAK ETHERNET_PMT_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ETHERNET_PMT_IRQHandler - LDR R0, =ETHERNET_PMT_DriverIRQHandler - BX R0 - - PUBWEAK ETHERNET_MACLP_IRQHandler - PUBWEAK ETHERNET_MACLP_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ETHERNET_MACLP_IRQHandler - LDR R0, =ETHERNET_MACLP_DriverIRQHandler - BX R0 - - PUBWEAK SINC_FILTER_IRQHandler - PUBWEAK SINC_FILTER_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SINC_FILTER_IRQHandler - LDR R0, =SINC_FILTER_DriverIRQHandler - BX R0 - - PUBWEAK LPTMR0_IRQHandler - PUBWEAK LPTMR0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LPTMR0_IRQHandler - LDR R0, =LPTMR0_DriverIRQHandler - BX R0 - - PUBWEAK LPTMR1_IRQHandler - PUBWEAK LPTMR1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LPTMR1_IRQHandler - LDR R0, =LPTMR1_DriverIRQHandler - BX R0 - - PUBWEAK SCG_IRQHandler - PUBWEAK SCG_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SCG_IRQHandler - LDR R0, =SCG_DriverIRQHandler - BX R0 - - PUBWEAK SPC_IRQHandler - PUBWEAK SPC_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SPC_IRQHandler - LDR R0, =SPC_DriverIRQHandler - BX R0 - - PUBWEAK WUU_IRQHandler - PUBWEAK WUU_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -WUU_IRQHandler - LDR R0, =WUU_DriverIRQHandler - BX R0 - - PUBWEAK PORT_EFT_IRQHandler - PUBWEAK PORT_EFT_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -PORT_EFT_IRQHandler - LDR R0, =PORT_EFT_DriverIRQHandler - BX R0 - - PUBWEAK ETB0_IRQHandler - PUBWEAK ETB0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ETB0_IRQHandler - LDR R0, =ETB0_DriverIRQHandler - BX R0 - - PUBWEAK Reserved166_IRQHandler - PUBWEAK Reserved166_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved166_IRQHandler - LDR R0, =Reserved166_DriverIRQHandler - BX R0 - - PUBWEAK Reserved167_IRQHandler - PUBWEAK Reserved167_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved167_IRQHandler - LDR R0, =Reserved167_DriverIRQHandler - BX R0 - - PUBWEAK WWDT0_IRQHandler - PUBWEAK WWDT0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -WWDT0_IRQHandler - LDR R0, =WWDT0_DriverIRQHandler - BX R0 - - PUBWEAK WWDT1_IRQHandler - PUBWEAK WWDT1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -WWDT1_IRQHandler - LDR R0, =WWDT1_DriverIRQHandler - BX R0 - - PUBWEAK CMC0_IRQHandler - PUBWEAK CMC0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CMC0_IRQHandler - LDR R0, =CMC0_DriverIRQHandler - BX R0 - - PUBWEAK CTI0_IRQHandler - PUBWEAK CTI0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CTI0_IRQHandler - LDR R0, =CTI0_DriverIRQHandler - BX R0 - -OR_DriverIRQHandler -EDMA_0_CH0_DriverIRQHandler -EDMA_0_CH1_DriverIRQHandler -EDMA_0_CH2_DriverIRQHandler -EDMA_0_CH3_DriverIRQHandler -EDMA_0_CH4_DriverIRQHandler -EDMA_0_CH5_DriverIRQHandler -EDMA_0_CH6_DriverIRQHandler -EDMA_0_CH7_DriverIRQHandler -EDMA_0_CH8_DriverIRQHandler -EDMA_0_CH9_DriverIRQHandler -EDMA_0_CH10_DriverIRQHandler -EDMA_0_CH11_DriverIRQHandler -EDMA_0_CH12_DriverIRQHandler -EDMA_0_CH13_DriverIRQHandler -EDMA_0_CH14_DriverIRQHandler -EDMA_0_CH15_DriverIRQHandler -GPIO00_DriverIRQHandler -GPIO01_DriverIRQHandler -GPIO10_DriverIRQHandler -GPIO11_DriverIRQHandler -GPIO20_DriverIRQHandler -GPIO21_DriverIRQHandler -GPIO30_DriverIRQHandler -GPIO31_DriverIRQHandler -GPIO40_DriverIRQHandler -GPIO41_DriverIRQHandler -GPIO50_DriverIRQHandler -GPIO51_DriverIRQHandler -UTICK0_DriverIRQHandler -MRT0_DriverIRQHandler -CTIMER0_DriverIRQHandler -CTIMER1_DriverIRQHandler -SCT0_DriverIRQHandler -CTIMER2_DriverIRQHandler -LP_FLEXCOMM0_DriverIRQHandler -LP_FLEXCOMM1_DriverIRQHandler -LP_FLEXCOMM2_DriverIRQHandler -LP_FLEXCOMM3_DriverIRQHandler -LP_FLEXCOMM4_DriverIRQHandler -LP_FLEXCOMM5_DriverIRQHandler -LP_FLEXCOMM6_DriverIRQHandler -LP_FLEXCOMM7_DriverIRQHandler -LP_FLEXCOMM8_DriverIRQHandler -LP_FLEXCOMM9_DriverIRQHandler -ADC0_DriverIRQHandler -ADC1_DriverIRQHandler -PINT0_DriverIRQHandler -PDM_EVENT_DriverIRQHandler -Reserved65_DriverIRQHandler -USB0_FS_DriverIRQHandler -USB0_DCD_DriverIRQHandler -RTC_DriverIRQHandler -SMARTDMA_DriverIRQHandler -MAILBOX_DriverIRQHandler -CTIMER3_DriverIRQHandler -CTIMER4_DriverIRQHandler -OS_EVENT_DriverIRQHandler -FLEXSPI0_DriverIRQHandler -SAI0_DriverIRQHandler -SAI1_DriverIRQHandler -USDHC0_DriverIRQHandler -CAN0_DriverIRQHandler -CAN1_DriverIRQHandler -Reserved80_DriverIRQHandler -Reserved81_DriverIRQHandler -USB1_HS_PHY_DriverIRQHandler -USB1_HS_DriverIRQHandler -SEC_HYPERVISOR_CALL_DriverIRQHandler -Reserved85_DriverIRQHandler -PLU_DriverIRQHandler -Freqme_DriverIRQHandler -SEC_VIO_DriverIRQHandler -ELS_DriverIRQHandler -PKC_DriverIRQHandler -PUF_DriverIRQHandler -PQ_DriverIRQHandler -EDMA_1_CH0_DriverIRQHandler -EDMA_1_CH1_DriverIRQHandler -EDMA_1_CH2_DriverIRQHandler -EDMA_1_CH3_DriverIRQHandler -EDMA_1_CH4_DriverIRQHandler -EDMA_1_CH5_DriverIRQHandler -EDMA_1_CH6_DriverIRQHandler -EDMA_1_CH7_DriverIRQHandler -EDMA_1_CH8_DriverIRQHandler -EDMA_1_CH9_DriverIRQHandler -EDMA_1_CH10_DriverIRQHandler -EDMA_1_CH11_DriverIRQHandler -EDMA_1_CH12_DriverIRQHandler -EDMA_1_CH13_DriverIRQHandler -EDMA_1_CH14_DriverIRQHandler -EDMA_1_CH15_DriverIRQHandler -CDOG0_DriverIRQHandler -CDOG1_DriverIRQHandler -I3C0_DriverIRQHandler -I3C1_DriverIRQHandler -NPU_DriverIRQHandler -GDET_DriverIRQHandler -VBAT0_DriverIRQHandler -EWM0_DriverIRQHandler -TSI_END_OF_SCAN_DriverIRQHandler -TSI_OUT_OF_SCAN_DriverIRQHandler -EMVSIM0_DriverIRQHandler -EMVSIM1_DriverIRQHandler -FLEXIO_DriverIRQHandler -DAC0_DriverIRQHandler -DAC1_DriverIRQHandler -DAC2_DriverIRQHandler -HSCMP0_DriverIRQHandler -HSCMP1_DriverIRQHandler -HSCMP2_DriverIRQHandler -FLEXPWM0_RELOAD_ERROR_DriverIRQHandler -FLEXPWM0_FAULT_DriverIRQHandler -FLEXPWM0_SUBMODULE0_DriverIRQHandler -FLEXPWM0_SUBMODULE1_DriverIRQHandler -FLEXPWM0_SUBMODULE2_DriverIRQHandler -FLEXPWM0_SUBMODULE3_DriverIRQHandler -FLEXPWM1_RELOAD_ERROR_DriverIRQHandler -FLEXPWM1_FAULT_DriverIRQHandler -FLEXPWM1_SUBMODULE0_DriverIRQHandler -FLEXPWM1_SUBMODULE1_DriverIRQHandler -FLEXPWM1_SUBMODULE2_DriverIRQHandler -FLEXPWM1_SUBMODULE3_DriverIRQHandler -QDC0_COMPARE_DriverIRQHandler -QDC0_HOME_DriverIRQHandler -QDC0_WDG_SAB_DriverIRQHandler -QDC0_IDX_DriverIRQHandler -QDC1_COMPARE_DriverIRQHandler -QDC1_HOME_DriverIRQHandler -QDC1_WDG_SAB_DriverIRQHandler -QDC1_IDX_DriverIRQHandler -ITRC0_DriverIRQHandler -BSP32_DriverIRQHandler -ELS_ERR_DriverIRQHandler -PKC_ERR_DriverIRQHandler -ERM_SINGLE_BIT_ERROR_DriverIRQHandler -ERM_MULTI_BIT_ERROR_DriverIRQHandler -FMU0_DriverIRQHandler -ETHERNET_DriverIRQHandler -ETHERNET_PMT_DriverIRQHandler -ETHERNET_MACLP_DriverIRQHandler -SINC_FILTER_DriverIRQHandler -LPTMR0_DriverIRQHandler -LPTMR1_DriverIRQHandler -SCG_DriverIRQHandler -SPC_DriverIRQHandler -WUU_DriverIRQHandler -PORT_EFT_DriverIRQHandler -ETB0_DriverIRQHandler -Reserved166_DriverIRQHandler -Reserved167_DriverIRQHandler -WWDT0_DriverIRQHandler -WWDT1_DriverIRQHandler -CMC0_DriverIRQHandler -CTI0_DriverIRQHandler -DefaultISR - B . - - END diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/iar/startup_MCXN947_cm33_core1.s b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/iar/startup_MCXN947_cm33_core1.s deleted file mode 100644 index 6418f2b2ae4..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/iar/startup_MCXN947_cm33_core1.s +++ /dev/null @@ -1,1549 +0,0 @@ -; ------------------------------------------------------------------------- -; @file: startup_MCXN947_cm33_core1.s -; @purpose: CMSIS Cortex-M33 Core Device Startup File -; MCXN947_cm33_core1 -; @version: 2.0 -; @date: 2023-2-1 -; @build: b240410 -; ------------------------------------------------------------------------- -; -; Copyright 1997-2016 Freescale Semiconductor, Inc. -; Copyright 2016-2024 NXP -; SPDX-License-Identifier: BSD-3-Clause -; -; The modules in this file are included in the libraries, and may be replaced -; by any user-defined modules that define the PUBLIC symbol _program_start or -; a user defined start symbol. -; To override the cstartup defined in the library, simply add your modified -; version to the workbench project. -; -; The vector table is normally located at address 0. -; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. -; The name "__vector_table" has special meaning for C-SPY: -; it is where the SP start value is found, and the NVIC vector -; table register (VTOR) is initialized to this address if != 0. -; -; Cortex-M version -; - - MODULE ?cstartup - - ;; Forward declaration of sections. - SECTION CSTACK:DATA:NOROOT(3) - - SECTION .intvec:CODE:NOROOT(2) - - EXTERN __iar_program_start - EXTERN SystemInit - PUBLIC __vector_table - PUBLIC __vector_table_0x1c - PUBLIC __Vectors - PUBLIC __Vectors_End - PUBLIC __Vectors_Size - - DATA - -__iar_init$$done: ; The vector table is not needed - ; until after copy initialization is done - -__vector_table - DCD sfe(CSTACK) - DCD Reset_Handler - - DCD NMI_Handler ;NMI Handler - DCD HardFault_Handler ;Hard Fault Handler - DCD MemManage_Handler ;MPU Fault Handler - DCD BusFault_Handler ;Bus Fault Handler - DCD UsageFault_Handler ;Usage Fault Handler -__vector_table_0x1c - DCD SecureFault_Handler ;Secure Fault Handler - DCD 0 ;Reserved - DCD 0 ;Reserved - DCD 0 ;Reserved - DCD SVC_Handler ;SVCall Handler - DCD DebugMon_Handler ;Debug Monitor Handler - DCD 0 ;Reserved - DCD PendSV_Handler ;PendSV Handler - DCD SysTick_Handler ;SysTick Handler - - ;External Interrupts - DCD OR_IRQHandler ;OR IRQ - DCD EDMA_0_CH0_IRQHandler ;eDMA_0_CH0 error or transfer complete - DCD EDMA_0_CH1_IRQHandler ;eDMA_0_CH1 error or transfer complete - DCD EDMA_0_CH2_IRQHandler ;eDMA_0_CH2 error or transfer complete - DCD EDMA_0_CH3_IRQHandler ;eDMA_0_CH3 error or transfer complete - DCD EDMA_0_CH4_IRQHandler ;eDMA_0_CH4 error or transfer complete - DCD EDMA_0_CH5_IRQHandler ;eDMA_0_CH5 error or transfer complete - DCD EDMA_0_CH6_IRQHandler ;eDMA_0_CH6 error or transfer complete - DCD EDMA_0_CH7_IRQHandler ;eDMA_0_CH7 error or transfer complete - DCD EDMA_0_CH8_IRQHandler ;eDMA_0_CH8 error or transfer complete - DCD EDMA_0_CH9_IRQHandler ;eDMA_0_CH9 error or transfer complete - DCD EDMA_0_CH10_IRQHandler ;eDMA_0_CH10 error or transfer complete - DCD EDMA_0_CH11_IRQHandler ;eDMA_0_CH11 error or transfer complete - DCD EDMA_0_CH12_IRQHandler ;eDMA_0_CH12 error or transfer complete - DCD EDMA_0_CH13_IRQHandler ;eDMA_0_CH13 error or transfer complete - DCD EDMA_0_CH14_IRQHandler ;eDMA_0_CH14 error or transfer complete - DCD EDMA_0_CH15_IRQHandler ;eDMA_0_CH15 error or transfer complete - DCD GPIO00_IRQHandler ;GPIO0 interrupt 0 - DCD GPIO01_IRQHandler ;GPIO0 interrupt 1 - DCD GPIO10_IRQHandler ;GPIO1 interrupt 0 - DCD GPIO11_IRQHandler ;GPIO1 interrupt 1 - DCD GPIO20_IRQHandler ;GPIO2 interrupt 0 - DCD GPIO21_IRQHandler ;GPIO2 interrupt 1 - DCD GPIO30_IRQHandler ;GPIO3 interrupt 0 - DCD GPIO31_IRQHandler ;GPIO3 interrupt 1 - DCD GPIO40_IRQHandler ;GPIO4 interrupt 0 - DCD GPIO41_IRQHandler ;GPIO4 interrupt 1 - DCD GPIO50_IRQHandler ;GPIO5 interrupt 0 - DCD GPIO51_IRQHandler ;GPIO5 interrupt 1 - DCD UTICK0_IRQHandler ;Micro-Tick Timer interrupt - DCD MRT0_IRQHandler ;Multi-Rate Timer interrupt - DCD CTIMER0_IRQHandler ;Standard counter/timer 0 interrupt - DCD CTIMER1_IRQHandler ;Standard counter/timer 1 interrupt - DCD SCT0_IRQHandler ;SCTimer/PWM interrupt - DCD CTIMER2_IRQHandler ;Standard counter/timer 2 interrupt - DCD LP_FLEXCOMM0_IRQHandler ;LP_FLEXCOMM0 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) - DCD LP_FLEXCOMM1_IRQHandler ;LP_FLEXCOMM1 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) - DCD LP_FLEXCOMM2_IRQHandler ;LP_FLEXCOMM2 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) - DCD LP_FLEXCOMM3_IRQHandler ;LP_FLEXCOMM3 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) - DCD LP_FLEXCOMM4_IRQHandler ;LP_FLEXCOMM4 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) - DCD LP_FLEXCOMM5_IRQHandler ;LP_FLEXCOMM5 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) - DCD LP_FLEXCOMM6_IRQHandler ;LP_FLEXCOMM6 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) - DCD LP_FLEXCOMM7_IRQHandler ;LP_FLEXCOMM7 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) - DCD LP_FLEXCOMM8_IRQHandler ;LP_FLEXCOMM8 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) - DCD LP_FLEXCOMM9_IRQHandler ;LP_FLEXCOMM9 (LPSPI interrupt or LPI2C interrupt or LPUART Receive/Transmit interrupt) - DCD ADC0_IRQHandler ;Analog-to-Digital Converter 0 - General Purpose interrupt - DCD ADC1_IRQHandler ;Analog-to-Digital Converter 1 - General Purpose interrupt - DCD PINT0_IRQHandler ;Pin Interrupt Pattern Match Interrupt - DCD PDM_EVENT_IRQHandler ;Microphone Interface interrupt - DCD Reserved65_IRQHandler ;Reserved interrupt - DCD USB0_FS_IRQHandler ;Universal Serial Bus - Full Speed interrupt - DCD USB0_DCD_IRQHandler ;Universal Serial Bus - Device Charge Detect interrupt - DCD RTC_IRQHandler ;RTC Subsystem interrupt (RTC interrupt or Wake timer interrupt) - DCD SMARTDMA_IRQHandler ;SmartDMA_IRQ - DCD MAILBOX_IRQHandler ;Inter-CPU Mailbox interrupt0 for CPU0 Inter-CPU Mailbox interrupt1 for CPU1 - DCD CTIMER3_IRQHandler ;Standard counter/timer 3 interrupt - DCD CTIMER4_IRQHandler ;Standard counter/timer 4 interrupt - DCD OS_EVENT_IRQHandler ;OS event timer interrupt - DCD FLEXSPI0_IRQHandler ;Flexible Serial Peripheral Interface interrupt - DCD SAI0_IRQHandler ;Serial Audio Interface 0 interrupt - DCD SAI1_IRQHandler ;Serial Audio Interface 1 interrupt - DCD USDHC0_IRQHandler ;Ultra Secured Digital Host Controller interrupt - DCD CAN0_IRQHandler ;Controller Area Network 0 interrupt - DCD CAN1_IRQHandler ;Controller Area Network 1 interrupt - DCD Reserved80_IRQHandler ;Reserved interrupt - DCD Reserved81_IRQHandler ;Reserved interrupt - DCD USB1_HS_PHY_IRQHandler ;USBHS DCD or USBHS Phy interrupt - DCD USB1_HS_IRQHandler ;USB High Speed OTG Controller interrupt - DCD SEC_HYPERVISOR_CALL_IRQHandler ;AHB Secure Controller hypervisor call interrupt - DCD Reserved85_IRQHandler ;Reserved interrupt - DCD PLU_IRQHandler ;Programmable Logic Unit interrupt - DCD Freqme_IRQHandler ;Frequency Measurement interrupt - DCD SEC_VIO_IRQHandler ;Secure violation interrupt (Memory Block Checker interrupt or secure AHB matrix violation interrupt) - DCD ELS_IRQHandler ;ELS interrupt - DCD PKC_IRQHandler ;PKC interrupt - DCD PUF_IRQHandler ;Physical Unclonable Function interrupt - DCD PQ_IRQHandler ;Power Quad interrupt - DCD EDMA_1_CH0_IRQHandler ;eDMA_1_CH0 error or transfer complete - DCD EDMA_1_CH1_IRQHandler ;eDMA_1_CH1 error or transfer complete - DCD EDMA_1_CH2_IRQHandler ;eDMA_1_CH2 error or transfer complete - DCD EDMA_1_CH3_IRQHandler ;eDMA_1_CH3 error or transfer complete - DCD EDMA_1_CH4_IRQHandler ;eDMA_1_CH4 error or transfer complete - DCD EDMA_1_CH5_IRQHandler ;eDMA_1_CH5 error or transfer complete - DCD EDMA_1_CH6_IRQHandler ;eDMA_1_CH6 error or transfer complete - DCD EDMA_1_CH7_IRQHandler ;eDMA_1_CH7 error or transfer complete - DCD EDMA_1_CH8_IRQHandler ;eDMA_1_CH8 error or transfer complete - DCD EDMA_1_CH9_IRQHandler ;eDMA_1_CH9 error or transfer complete - DCD EDMA_1_CH10_IRQHandler ;eDMA_1_CH10 error or transfer complete - DCD EDMA_1_CH11_IRQHandler ;eDMA_1_CH11 error or transfer complete - DCD EDMA_1_CH12_IRQHandler ;eDMA_1_CH12 error or transfer complete - DCD EDMA_1_CH13_IRQHandler ;eDMA_1_CH13 error or transfer complete - DCD EDMA_1_CH14_IRQHandler ;eDMA_1_CH14 error or transfer complete - DCD EDMA_1_CH15_IRQHandler ;eDMA_1_CH15 error or transfer complete - DCD CDOG0_IRQHandler ;Code Watchdog Timer 0 interrupt - DCD CDOG1_IRQHandler ;Code Watchdog Timer 1 interrupt - DCD I3C0_IRQHandler ;Improved Inter Integrated Circuit interrupt 0 - DCD I3C1_IRQHandler ;Improved Inter Integrated Circuit interrupt 1 - DCD NPU_IRQHandler ;NPU interrupt - DCD GDET_IRQHandler ;Digital Glitch Detect 0 interrupt or Digital Glitch Detect 1 interrupt - DCD VBAT0_IRQHandler ;VBAT interrupt( VBAT interrupt or digital tamper interrupt) - DCD EWM0_IRQHandler ;External Watchdog Monitor interrupt - DCD TSI_END_OF_SCAN_IRQHandler ;TSI End of Scan interrupt - DCD TSI_OUT_OF_SCAN_IRQHandler ;TSI Out of Scan interrupt - DCD EMVSIM0_IRQHandler ;EMVSIM0 interrupt - DCD EMVSIM1_IRQHandler ;EMVSIM1 interrupt - DCD FLEXIO_IRQHandler ;Flexible Input/Output interrupt - DCD DAC0_IRQHandler ;Digital-to-Analog Converter 0 - General Purpose interrupt - DCD DAC1_IRQHandler ;Digital-to-Analog Converter 1 - General Purpose interrupt - DCD DAC2_IRQHandler ;14-bit Digital-to-Analog Converter interrupt - DCD HSCMP0_IRQHandler ;High-Speed comparator0 interrupt - DCD HSCMP1_IRQHandler ;High-Speed comparator1 interrupt - DCD HSCMP2_IRQHandler ;High-Speed comparator2 interrupt - DCD FLEXPWM0_RELOAD_ERROR_IRQHandler ;FlexPWM0_reload_error interrupt - DCD FLEXPWM0_FAULT_IRQHandler ;FlexPWM0_fault interrupt - DCD FLEXPWM0_SUBMODULE0_IRQHandler ;FlexPWM0 Submodule 0 capture/compare/reload interrupt - DCD FLEXPWM0_SUBMODULE1_IRQHandler ;FlexPWM0 Submodule 1 capture/compare/reload interrupt - DCD FLEXPWM0_SUBMODULE2_IRQHandler ;FlexPWM0 Submodule 2 capture/compare/reload interrupt - DCD FLEXPWM0_SUBMODULE3_IRQHandler ;FlexPWM0 Submodule 3 capture/compare/reload interrupt - DCD FLEXPWM1_RELOAD_ERROR_IRQHandler ;FlexPWM1_reload_error interrupt - DCD FLEXPWM1_FAULT_IRQHandler ;FlexPWM1_fault interrupt - DCD FLEXPWM1_SUBMODULE0_IRQHandler ;FlexPWM1 Submodule 0 capture/compare/reload interrupt - DCD FLEXPWM1_SUBMODULE1_IRQHandler ;FlexPWM1 Submodule 1 capture/compare/reload interrupt - DCD FLEXPWM1_SUBMODULE2_IRQHandler ;FlexPWM1 Submodule 2 capture/compare/reload interrupt - DCD FLEXPWM1_SUBMODULE3_IRQHandler ;FlexPWM1 Submodule 3 capture/compare/reload interrupt - DCD QDC0_COMPARE_IRQHandler ;QDC0_Compare interrupt - DCD QDC0_HOME_IRQHandler ;QDC0_Home interrupt - DCD QDC0_WDG_SAB_IRQHandler ;QDC0_WDG_IRQ/SAB interrupt - DCD QDC0_IDX_IRQHandler ;QDC0_IDX interrupt - DCD QDC1_COMPARE_IRQHandler ;QDC1_Compare interrupt - DCD QDC1_HOME_IRQHandler ;QDC1_Home interrupt - DCD QDC1_WDG_SAB_IRQHandler ;QDC1_WDG_IRQ/SAB interrupt - DCD QDC1_IDX_IRQHandler ;QDC1_IDX interrupt - DCD ITRC0_IRQHandler ;Intrusion and Tamper Response Controller interrupt - DCD BSP32_IRQHandler ;CoolFlux BSP32 interrupt - DCD ELS_ERR_IRQHandler ;ELS error interrupt - DCD PKC_ERR_IRQHandler ;PKC error interrupt - DCD ERM_SINGLE_BIT_ERROR_IRQHandler ;ERM Single Bit error interrupt - DCD ERM_MULTI_BIT_ERROR_IRQHandler ;ERM Multi Bit error interrupt - DCD FMU0_IRQHandler ;Flash Management Unit interrupt - DCD ETHERNET_IRQHandler ;Ethernet QoS interrupt - DCD ETHERNET_PMT_IRQHandler ;Ethernet QoS power management interrupt - DCD ETHERNET_MACLP_IRQHandler ;Ethernet QoS MAC interrupt - DCD SINC_FILTER_IRQHandler ;SINC Filter interrupt - DCD LPTMR0_IRQHandler ;Low Power Timer 0 interrupt - DCD LPTMR1_IRQHandler ;Low Power Timer 1 interrupt - DCD SCG_IRQHandler ;System Clock Generator interrupt - DCD SPC_IRQHandler ;System Power Controller interrupt - DCD WUU_IRQHandler ;Wake Up Unit interrupt - DCD PORT_EFT_IRQHandler ;PORT0~5 EFT interrupt - DCD ETB0_IRQHandler ;ETB counter expires interrupt - DCD Reserved166_IRQHandler ;Reserved interrupt - DCD Reserved167_IRQHandler ;Reserved interrupt - DCD WWDT0_IRQHandler ;Windowed Watchdog Timer 0 interrupt - DCD WWDT1_IRQHandler ;Windowed Watchdog Timer 1 interrupt - DCD CMC0_IRQHandler ;Core Mode Controller interrupt - DCD CTI0_IRQHandler ;Cross Trigger Interface interrupt -__Vectors_End - -__Vectors EQU __vector_table -__Vectors_Size EQU __Vectors_End - __Vectors - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Default interrupt handlers. -;; - THUMB - - PUBWEAK Reset_Handler - SECTION .text:CODE:REORDER:NOROOT(2) -Reset_Handler - CPSID I ; Mask interrupts - LDR R0, =SystemInit - BLX R0 - CPSIE I ; Unmask interrupts - LDR R0, =__iar_program_start - BX R0 - - PUBWEAK NMI_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -NMI_Handler - B . - - PUBWEAK HardFault_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -HardFault_Handler - B . - - PUBWEAK MemManage_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -MemManage_Handler - B . - - PUBWEAK BusFault_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -BusFault_Handler - B . - - PUBWEAK UsageFault_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -UsageFault_Handler - B . - - PUBWEAK SecureFault_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -SecureFault_Handler - B . - - PUBWEAK SVC_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -SVC_Handler - B . - - PUBWEAK DebugMon_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -DebugMon_Handler - B . - - PUBWEAK PendSV_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -PendSV_Handler - B . - - PUBWEAK SysTick_Handler - SECTION .text:CODE:REORDER:NOROOT(1) -SysTick_Handler - B . - - PUBWEAK OR_IRQHandler - PUBWEAK OR_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -OR_IRQHandler - LDR R0, =OR_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH0_IRQHandler - PUBWEAK EDMA_0_CH0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH0_IRQHandler - LDR R0, =EDMA_0_CH0_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH1_IRQHandler - PUBWEAK EDMA_0_CH1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH1_IRQHandler - LDR R0, =EDMA_0_CH1_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH2_IRQHandler - PUBWEAK EDMA_0_CH2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH2_IRQHandler - LDR R0, =EDMA_0_CH2_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH3_IRQHandler - PUBWEAK EDMA_0_CH3_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH3_IRQHandler - LDR R0, =EDMA_0_CH3_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH4_IRQHandler - PUBWEAK EDMA_0_CH4_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH4_IRQHandler - LDR R0, =EDMA_0_CH4_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH5_IRQHandler - PUBWEAK EDMA_0_CH5_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH5_IRQHandler - LDR R0, =EDMA_0_CH5_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH6_IRQHandler - PUBWEAK EDMA_0_CH6_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH6_IRQHandler - LDR R0, =EDMA_0_CH6_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH7_IRQHandler - PUBWEAK EDMA_0_CH7_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH7_IRQHandler - LDR R0, =EDMA_0_CH7_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH8_IRQHandler - PUBWEAK EDMA_0_CH8_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH8_IRQHandler - LDR R0, =EDMA_0_CH8_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH9_IRQHandler - PUBWEAK EDMA_0_CH9_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH9_IRQHandler - LDR R0, =EDMA_0_CH9_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH10_IRQHandler - PUBWEAK EDMA_0_CH10_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH10_IRQHandler - LDR R0, =EDMA_0_CH10_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH11_IRQHandler - PUBWEAK EDMA_0_CH11_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH11_IRQHandler - LDR R0, =EDMA_0_CH11_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH12_IRQHandler - PUBWEAK EDMA_0_CH12_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH12_IRQHandler - LDR R0, =EDMA_0_CH12_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH13_IRQHandler - PUBWEAK EDMA_0_CH13_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH13_IRQHandler - LDR R0, =EDMA_0_CH13_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH14_IRQHandler - PUBWEAK EDMA_0_CH14_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH14_IRQHandler - LDR R0, =EDMA_0_CH14_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_0_CH15_IRQHandler - PUBWEAK EDMA_0_CH15_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_0_CH15_IRQHandler - LDR R0, =EDMA_0_CH15_DriverIRQHandler - BX R0 - - PUBWEAK GPIO00_IRQHandler - PUBWEAK GPIO00_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO00_IRQHandler - LDR R0, =GPIO00_DriverIRQHandler - BX R0 - - PUBWEAK GPIO01_IRQHandler - PUBWEAK GPIO01_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO01_IRQHandler - LDR R0, =GPIO01_DriverIRQHandler - BX R0 - - PUBWEAK GPIO10_IRQHandler - PUBWEAK GPIO10_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO10_IRQHandler - LDR R0, =GPIO10_DriverIRQHandler - BX R0 - - PUBWEAK GPIO11_IRQHandler - PUBWEAK GPIO11_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO11_IRQHandler - LDR R0, =GPIO11_DriverIRQHandler - BX R0 - - PUBWEAK GPIO20_IRQHandler - PUBWEAK GPIO20_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO20_IRQHandler - LDR R0, =GPIO20_DriverIRQHandler - BX R0 - - PUBWEAK GPIO21_IRQHandler - PUBWEAK GPIO21_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO21_IRQHandler - LDR R0, =GPIO21_DriverIRQHandler - BX R0 - - PUBWEAK GPIO30_IRQHandler - PUBWEAK GPIO30_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO30_IRQHandler - LDR R0, =GPIO30_DriverIRQHandler - BX R0 - - PUBWEAK GPIO31_IRQHandler - PUBWEAK GPIO31_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO31_IRQHandler - LDR R0, =GPIO31_DriverIRQHandler - BX R0 - - PUBWEAK GPIO40_IRQHandler - PUBWEAK GPIO40_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO40_IRQHandler - LDR R0, =GPIO40_DriverIRQHandler - BX R0 - - PUBWEAK GPIO41_IRQHandler - PUBWEAK GPIO41_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO41_IRQHandler - LDR R0, =GPIO41_DriverIRQHandler - BX R0 - - PUBWEAK GPIO50_IRQHandler - PUBWEAK GPIO50_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO50_IRQHandler - LDR R0, =GPIO50_DriverIRQHandler - BX R0 - - PUBWEAK GPIO51_IRQHandler - PUBWEAK GPIO51_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GPIO51_IRQHandler - LDR R0, =GPIO51_DriverIRQHandler - BX R0 - - PUBWEAK UTICK0_IRQHandler - PUBWEAK UTICK0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -UTICK0_IRQHandler - LDR R0, =UTICK0_DriverIRQHandler - BX R0 - - PUBWEAK MRT0_IRQHandler - PUBWEAK MRT0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -MRT0_IRQHandler - LDR R0, =MRT0_DriverIRQHandler - BX R0 - - PUBWEAK CTIMER0_IRQHandler - PUBWEAK CTIMER0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CTIMER0_IRQHandler - LDR R0, =CTIMER0_DriverIRQHandler - BX R0 - - PUBWEAK CTIMER1_IRQHandler - PUBWEAK CTIMER1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CTIMER1_IRQHandler - LDR R0, =CTIMER1_DriverIRQHandler - BX R0 - - PUBWEAK SCT0_IRQHandler - PUBWEAK SCT0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SCT0_IRQHandler - LDR R0, =SCT0_DriverIRQHandler - BX R0 - - PUBWEAK CTIMER2_IRQHandler - PUBWEAK CTIMER2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CTIMER2_IRQHandler - LDR R0, =CTIMER2_DriverIRQHandler - BX R0 - - PUBWEAK LP_FLEXCOMM0_IRQHandler - PUBWEAK LP_FLEXCOMM0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LP_FLEXCOMM0_IRQHandler - LDR R0, =LP_FLEXCOMM0_DriverIRQHandler - BX R0 - - PUBWEAK LP_FLEXCOMM1_IRQHandler - PUBWEAK LP_FLEXCOMM1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LP_FLEXCOMM1_IRQHandler - LDR R0, =LP_FLEXCOMM1_DriverIRQHandler - BX R0 - - PUBWEAK LP_FLEXCOMM2_IRQHandler - PUBWEAK LP_FLEXCOMM2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LP_FLEXCOMM2_IRQHandler - LDR R0, =LP_FLEXCOMM2_DriverIRQHandler - BX R0 - - PUBWEAK LP_FLEXCOMM3_IRQHandler - PUBWEAK LP_FLEXCOMM3_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LP_FLEXCOMM3_IRQHandler - LDR R0, =LP_FLEXCOMM3_DriverIRQHandler - BX R0 - - PUBWEAK LP_FLEXCOMM4_IRQHandler - PUBWEAK LP_FLEXCOMM4_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LP_FLEXCOMM4_IRQHandler - LDR R0, =LP_FLEXCOMM4_DriverIRQHandler - BX R0 - - PUBWEAK LP_FLEXCOMM5_IRQHandler - PUBWEAK LP_FLEXCOMM5_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LP_FLEXCOMM5_IRQHandler - LDR R0, =LP_FLEXCOMM5_DriverIRQHandler - BX R0 - - PUBWEAK LP_FLEXCOMM6_IRQHandler - PUBWEAK LP_FLEXCOMM6_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LP_FLEXCOMM6_IRQHandler - LDR R0, =LP_FLEXCOMM6_DriverIRQHandler - BX R0 - - PUBWEAK LP_FLEXCOMM7_IRQHandler - PUBWEAK LP_FLEXCOMM7_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LP_FLEXCOMM7_IRQHandler - LDR R0, =LP_FLEXCOMM7_DriverIRQHandler - BX R0 - - PUBWEAK LP_FLEXCOMM8_IRQHandler - PUBWEAK LP_FLEXCOMM8_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LP_FLEXCOMM8_IRQHandler - LDR R0, =LP_FLEXCOMM8_DriverIRQHandler - BX R0 - - PUBWEAK LP_FLEXCOMM9_IRQHandler - PUBWEAK LP_FLEXCOMM9_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LP_FLEXCOMM9_IRQHandler - LDR R0, =LP_FLEXCOMM9_DriverIRQHandler - BX R0 - - PUBWEAK ADC0_IRQHandler - PUBWEAK ADC0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ADC0_IRQHandler - LDR R0, =ADC0_DriverIRQHandler - BX R0 - - PUBWEAK ADC1_IRQHandler - PUBWEAK ADC1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ADC1_IRQHandler - LDR R0, =ADC1_DriverIRQHandler - BX R0 - - PUBWEAK PINT0_IRQHandler - PUBWEAK PINT0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -PINT0_IRQHandler - LDR R0, =PINT0_DriverIRQHandler - BX R0 - - PUBWEAK PDM_EVENT_IRQHandler - PUBWEAK PDM_EVENT_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -PDM_EVENT_IRQHandler - LDR R0, =PDM_EVENT_DriverIRQHandler - BX R0 - - PUBWEAK Reserved65_IRQHandler - PUBWEAK Reserved65_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved65_IRQHandler - LDR R0, =Reserved65_DriverIRQHandler - BX R0 - - PUBWEAK USB0_FS_IRQHandler - PUBWEAK USB0_FS_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -USB0_FS_IRQHandler - LDR R0, =USB0_FS_DriverIRQHandler - BX R0 - - PUBWEAK USB0_DCD_IRQHandler - PUBWEAK USB0_DCD_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -USB0_DCD_IRQHandler - LDR R0, =USB0_DCD_DriverIRQHandler - BX R0 - - PUBWEAK RTC_IRQHandler - PUBWEAK RTC_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -RTC_IRQHandler - LDR R0, =RTC_DriverIRQHandler - BX R0 - - PUBWEAK SMARTDMA_IRQHandler - PUBWEAK SMARTDMA_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SMARTDMA_IRQHandler - LDR R0, =SMARTDMA_DriverIRQHandler - BX R0 - - PUBWEAK MAILBOX_IRQHandler - PUBWEAK MAILBOX_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -MAILBOX_IRQHandler - LDR R0, =MAILBOX_DriverIRQHandler - BX R0 - - PUBWEAK CTIMER3_IRQHandler - PUBWEAK CTIMER3_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CTIMER3_IRQHandler - LDR R0, =CTIMER3_DriverIRQHandler - BX R0 - - PUBWEAK CTIMER4_IRQHandler - PUBWEAK CTIMER4_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CTIMER4_IRQHandler - LDR R0, =CTIMER4_DriverIRQHandler - BX R0 - - PUBWEAK OS_EVENT_IRQHandler - PUBWEAK OS_EVENT_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -OS_EVENT_IRQHandler - LDR R0, =OS_EVENT_DriverIRQHandler - BX R0 - - PUBWEAK FLEXSPI0_IRQHandler - PUBWEAK FLEXSPI0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXSPI0_IRQHandler - LDR R0, =FLEXSPI0_DriverIRQHandler - BX R0 - - PUBWEAK SAI0_IRQHandler - PUBWEAK SAI0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SAI0_IRQHandler - LDR R0, =SAI0_DriverIRQHandler - BX R0 - - PUBWEAK SAI1_IRQHandler - PUBWEAK SAI1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SAI1_IRQHandler - LDR R0, =SAI1_DriverIRQHandler - BX R0 - - PUBWEAK USDHC0_IRQHandler - PUBWEAK USDHC0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -USDHC0_IRQHandler - LDR R0, =USDHC0_DriverIRQHandler - BX R0 - - PUBWEAK CAN0_IRQHandler - PUBWEAK CAN0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CAN0_IRQHandler - LDR R0, =CAN0_DriverIRQHandler - BX R0 - - PUBWEAK CAN1_IRQHandler - PUBWEAK CAN1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CAN1_IRQHandler - LDR R0, =CAN1_DriverIRQHandler - BX R0 - - PUBWEAK Reserved80_IRQHandler - PUBWEAK Reserved80_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved80_IRQHandler - LDR R0, =Reserved80_DriverIRQHandler - BX R0 - - PUBWEAK Reserved81_IRQHandler - PUBWEAK Reserved81_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved81_IRQHandler - LDR R0, =Reserved81_DriverIRQHandler - BX R0 - - PUBWEAK USB1_HS_PHY_IRQHandler - PUBWEAK USB1_HS_PHY_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -USB1_HS_PHY_IRQHandler - LDR R0, =USB1_HS_PHY_DriverIRQHandler - BX R0 - - PUBWEAK USB1_HS_IRQHandler - PUBWEAK USB1_HS_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -USB1_HS_IRQHandler - LDR R0, =USB1_HS_DriverIRQHandler - BX R0 - - PUBWEAK SEC_HYPERVISOR_CALL_IRQHandler - PUBWEAK SEC_HYPERVISOR_CALL_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SEC_HYPERVISOR_CALL_IRQHandler - LDR R0, =SEC_HYPERVISOR_CALL_DriverIRQHandler - BX R0 - - PUBWEAK Reserved85_IRQHandler - PUBWEAK Reserved85_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved85_IRQHandler - LDR R0, =Reserved85_DriverIRQHandler - BX R0 - - PUBWEAK PLU_IRQHandler - PUBWEAK PLU_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -PLU_IRQHandler - LDR R0, =PLU_DriverIRQHandler - BX R0 - - PUBWEAK Freqme_IRQHandler - PUBWEAK Freqme_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Freqme_IRQHandler - LDR R0, =Freqme_DriverIRQHandler - BX R0 - - PUBWEAK SEC_VIO_IRQHandler - PUBWEAK SEC_VIO_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SEC_VIO_IRQHandler - LDR R0, =SEC_VIO_DriverIRQHandler - BX R0 - - PUBWEAK ELS_IRQHandler - PUBWEAK ELS_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ELS_IRQHandler - LDR R0, =ELS_DriverIRQHandler - BX R0 - - PUBWEAK PKC_IRQHandler - PUBWEAK PKC_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -PKC_IRQHandler - LDR R0, =PKC_DriverIRQHandler - BX R0 - - PUBWEAK PUF_IRQHandler - PUBWEAK PUF_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -PUF_IRQHandler - LDR R0, =PUF_DriverIRQHandler - BX R0 - - PUBWEAK PQ_IRQHandler - PUBWEAK PQ_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -PQ_IRQHandler - LDR R0, =PQ_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH0_IRQHandler - PUBWEAK EDMA_1_CH0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH0_IRQHandler - LDR R0, =EDMA_1_CH0_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH1_IRQHandler - PUBWEAK EDMA_1_CH1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH1_IRQHandler - LDR R0, =EDMA_1_CH1_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH2_IRQHandler - PUBWEAK EDMA_1_CH2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH2_IRQHandler - LDR R0, =EDMA_1_CH2_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH3_IRQHandler - PUBWEAK EDMA_1_CH3_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH3_IRQHandler - LDR R0, =EDMA_1_CH3_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH4_IRQHandler - PUBWEAK EDMA_1_CH4_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH4_IRQHandler - LDR R0, =EDMA_1_CH4_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH5_IRQHandler - PUBWEAK EDMA_1_CH5_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH5_IRQHandler - LDR R0, =EDMA_1_CH5_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH6_IRQHandler - PUBWEAK EDMA_1_CH6_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH6_IRQHandler - LDR R0, =EDMA_1_CH6_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH7_IRQHandler - PUBWEAK EDMA_1_CH7_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH7_IRQHandler - LDR R0, =EDMA_1_CH7_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH8_IRQHandler - PUBWEAK EDMA_1_CH8_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH8_IRQHandler - LDR R0, =EDMA_1_CH8_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH9_IRQHandler - PUBWEAK EDMA_1_CH9_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH9_IRQHandler - LDR R0, =EDMA_1_CH9_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH10_IRQHandler - PUBWEAK EDMA_1_CH10_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH10_IRQHandler - LDR R0, =EDMA_1_CH10_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH11_IRQHandler - PUBWEAK EDMA_1_CH11_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH11_IRQHandler - LDR R0, =EDMA_1_CH11_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH12_IRQHandler - PUBWEAK EDMA_1_CH12_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH12_IRQHandler - LDR R0, =EDMA_1_CH12_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH13_IRQHandler - PUBWEAK EDMA_1_CH13_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH13_IRQHandler - LDR R0, =EDMA_1_CH13_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH14_IRQHandler - PUBWEAK EDMA_1_CH14_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH14_IRQHandler - LDR R0, =EDMA_1_CH14_DriverIRQHandler - BX R0 - - PUBWEAK EDMA_1_CH15_IRQHandler - PUBWEAK EDMA_1_CH15_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EDMA_1_CH15_IRQHandler - LDR R0, =EDMA_1_CH15_DriverIRQHandler - BX R0 - - PUBWEAK CDOG0_IRQHandler - PUBWEAK CDOG0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CDOG0_IRQHandler - LDR R0, =CDOG0_DriverIRQHandler - BX R0 - - PUBWEAK CDOG1_IRQHandler - PUBWEAK CDOG1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CDOG1_IRQHandler - LDR R0, =CDOG1_DriverIRQHandler - BX R0 - - PUBWEAK I3C0_IRQHandler - PUBWEAK I3C0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -I3C0_IRQHandler - LDR R0, =I3C0_DriverIRQHandler - BX R0 - - PUBWEAK I3C1_IRQHandler - PUBWEAK I3C1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -I3C1_IRQHandler - LDR R0, =I3C1_DriverIRQHandler - BX R0 - - PUBWEAK NPU_IRQHandler - PUBWEAK NPU_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -NPU_IRQHandler - LDR R0, =NPU_DriverIRQHandler - BX R0 - - PUBWEAK GDET_IRQHandler - PUBWEAK GDET_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -GDET_IRQHandler - LDR R0, =GDET_DriverIRQHandler - BX R0 - - PUBWEAK VBAT0_IRQHandler - PUBWEAK VBAT0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -VBAT0_IRQHandler - LDR R0, =VBAT0_DriverIRQHandler - BX R0 - - PUBWEAK EWM0_IRQHandler - PUBWEAK EWM0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EWM0_IRQHandler - LDR R0, =EWM0_DriverIRQHandler - BX R0 - - PUBWEAK TSI_END_OF_SCAN_IRQHandler - PUBWEAK TSI_END_OF_SCAN_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -TSI_END_OF_SCAN_IRQHandler - LDR R0, =TSI_END_OF_SCAN_DriverIRQHandler - BX R0 - - PUBWEAK TSI_OUT_OF_SCAN_IRQHandler - PUBWEAK TSI_OUT_OF_SCAN_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -TSI_OUT_OF_SCAN_IRQHandler - LDR R0, =TSI_OUT_OF_SCAN_DriverIRQHandler - BX R0 - - PUBWEAK EMVSIM0_IRQHandler - PUBWEAK EMVSIM0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EMVSIM0_IRQHandler - LDR R0, =EMVSIM0_DriverIRQHandler - BX R0 - - PUBWEAK EMVSIM1_IRQHandler - PUBWEAK EMVSIM1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -EMVSIM1_IRQHandler - LDR R0, =EMVSIM1_DriverIRQHandler - BX R0 - - PUBWEAK FLEXIO_IRQHandler - PUBWEAK FLEXIO_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXIO_IRQHandler - LDR R0, =FLEXIO_DriverIRQHandler - BX R0 - - PUBWEAK DAC0_IRQHandler - PUBWEAK DAC0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -DAC0_IRQHandler - LDR R0, =DAC0_DriverIRQHandler - BX R0 - - PUBWEAK DAC1_IRQHandler - PUBWEAK DAC1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -DAC1_IRQHandler - LDR R0, =DAC1_DriverIRQHandler - BX R0 - - PUBWEAK DAC2_IRQHandler - PUBWEAK DAC2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -DAC2_IRQHandler - LDR R0, =DAC2_DriverIRQHandler - BX R0 - - PUBWEAK HSCMP0_IRQHandler - PUBWEAK HSCMP0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -HSCMP0_IRQHandler - LDR R0, =HSCMP0_DriverIRQHandler - BX R0 - - PUBWEAK HSCMP1_IRQHandler - PUBWEAK HSCMP1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -HSCMP1_IRQHandler - LDR R0, =HSCMP1_DriverIRQHandler - BX R0 - - PUBWEAK HSCMP2_IRQHandler - PUBWEAK HSCMP2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -HSCMP2_IRQHandler - LDR R0, =HSCMP2_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM0_RELOAD_ERROR_IRQHandler - PUBWEAK FLEXPWM0_RELOAD_ERROR_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM0_RELOAD_ERROR_IRQHandler - LDR R0, =FLEXPWM0_RELOAD_ERROR_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM0_FAULT_IRQHandler - PUBWEAK FLEXPWM0_FAULT_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM0_FAULT_IRQHandler - LDR R0, =FLEXPWM0_FAULT_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM0_SUBMODULE0_IRQHandler - PUBWEAK FLEXPWM0_SUBMODULE0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM0_SUBMODULE0_IRQHandler - LDR R0, =FLEXPWM0_SUBMODULE0_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM0_SUBMODULE1_IRQHandler - PUBWEAK FLEXPWM0_SUBMODULE1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM0_SUBMODULE1_IRQHandler - LDR R0, =FLEXPWM0_SUBMODULE1_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM0_SUBMODULE2_IRQHandler - PUBWEAK FLEXPWM0_SUBMODULE2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM0_SUBMODULE2_IRQHandler - LDR R0, =FLEXPWM0_SUBMODULE2_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM0_SUBMODULE3_IRQHandler - PUBWEAK FLEXPWM0_SUBMODULE3_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM0_SUBMODULE3_IRQHandler - LDR R0, =FLEXPWM0_SUBMODULE3_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM1_RELOAD_ERROR_IRQHandler - PUBWEAK FLEXPWM1_RELOAD_ERROR_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM1_RELOAD_ERROR_IRQHandler - LDR R0, =FLEXPWM1_RELOAD_ERROR_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM1_FAULT_IRQHandler - PUBWEAK FLEXPWM1_FAULT_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM1_FAULT_IRQHandler - LDR R0, =FLEXPWM1_FAULT_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM1_SUBMODULE0_IRQHandler - PUBWEAK FLEXPWM1_SUBMODULE0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM1_SUBMODULE0_IRQHandler - LDR R0, =FLEXPWM1_SUBMODULE0_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM1_SUBMODULE1_IRQHandler - PUBWEAK FLEXPWM1_SUBMODULE1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM1_SUBMODULE1_IRQHandler - LDR R0, =FLEXPWM1_SUBMODULE1_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM1_SUBMODULE2_IRQHandler - PUBWEAK FLEXPWM1_SUBMODULE2_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM1_SUBMODULE2_IRQHandler - LDR R0, =FLEXPWM1_SUBMODULE2_DriverIRQHandler - BX R0 - - PUBWEAK FLEXPWM1_SUBMODULE3_IRQHandler - PUBWEAK FLEXPWM1_SUBMODULE3_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FLEXPWM1_SUBMODULE3_IRQHandler - LDR R0, =FLEXPWM1_SUBMODULE3_DriverIRQHandler - BX R0 - - PUBWEAK QDC0_COMPARE_IRQHandler - PUBWEAK QDC0_COMPARE_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC0_COMPARE_IRQHandler - LDR R0, =QDC0_COMPARE_DriverIRQHandler - BX R0 - - PUBWEAK QDC0_HOME_IRQHandler - PUBWEAK QDC0_HOME_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC0_HOME_IRQHandler - LDR R0, =QDC0_HOME_DriverIRQHandler - BX R0 - - PUBWEAK QDC0_WDG_SAB_IRQHandler - PUBWEAK QDC0_WDG_SAB_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC0_WDG_SAB_IRQHandler - LDR R0, =QDC0_WDG_SAB_DriverIRQHandler - BX R0 - - PUBWEAK QDC0_IDX_IRQHandler - PUBWEAK QDC0_IDX_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC0_IDX_IRQHandler - LDR R0, =QDC0_IDX_DriverIRQHandler - BX R0 - - PUBWEAK QDC1_COMPARE_IRQHandler - PUBWEAK QDC1_COMPARE_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC1_COMPARE_IRQHandler - LDR R0, =QDC1_COMPARE_DriverIRQHandler - BX R0 - - PUBWEAK QDC1_HOME_IRQHandler - PUBWEAK QDC1_HOME_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC1_HOME_IRQHandler - LDR R0, =QDC1_HOME_DriverIRQHandler - BX R0 - - PUBWEAK QDC1_WDG_SAB_IRQHandler - PUBWEAK QDC1_WDG_SAB_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC1_WDG_SAB_IRQHandler - LDR R0, =QDC1_WDG_SAB_DriverIRQHandler - BX R0 - - PUBWEAK QDC1_IDX_IRQHandler - PUBWEAK QDC1_IDX_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -QDC1_IDX_IRQHandler - LDR R0, =QDC1_IDX_DriverIRQHandler - BX R0 - - PUBWEAK ITRC0_IRQHandler - PUBWEAK ITRC0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ITRC0_IRQHandler - LDR R0, =ITRC0_DriverIRQHandler - BX R0 - - PUBWEAK BSP32_IRQHandler - PUBWEAK BSP32_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -BSP32_IRQHandler - LDR R0, =BSP32_DriverIRQHandler - BX R0 - - PUBWEAK ELS_ERR_IRQHandler - PUBWEAK ELS_ERR_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ELS_ERR_IRQHandler - LDR R0, =ELS_ERR_DriverIRQHandler - BX R0 - - PUBWEAK PKC_ERR_IRQHandler - PUBWEAK PKC_ERR_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -PKC_ERR_IRQHandler - LDR R0, =PKC_ERR_DriverIRQHandler - BX R0 - - PUBWEAK ERM_SINGLE_BIT_ERROR_IRQHandler - PUBWEAK ERM_SINGLE_BIT_ERROR_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ERM_SINGLE_BIT_ERROR_IRQHandler - LDR R0, =ERM_SINGLE_BIT_ERROR_DriverIRQHandler - BX R0 - - PUBWEAK ERM_MULTI_BIT_ERROR_IRQHandler - PUBWEAK ERM_MULTI_BIT_ERROR_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ERM_MULTI_BIT_ERROR_IRQHandler - LDR R0, =ERM_MULTI_BIT_ERROR_DriverIRQHandler - BX R0 - - PUBWEAK FMU0_IRQHandler - PUBWEAK FMU0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -FMU0_IRQHandler - LDR R0, =FMU0_DriverIRQHandler - BX R0 - - PUBWEAK ETHERNET_IRQHandler - PUBWEAK ETHERNET_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ETHERNET_IRQHandler - LDR R0, =ETHERNET_DriverIRQHandler - BX R0 - - PUBWEAK ETHERNET_PMT_IRQHandler - PUBWEAK ETHERNET_PMT_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ETHERNET_PMT_IRQHandler - LDR R0, =ETHERNET_PMT_DriverIRQHandler - BX R0 - - PUBWEAK ETHERNET_MACLP_IRQHandler - PUBWEAK ETHERNET_MACLP_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ETHERNET_MACLP_IRQHandler - LDR R0, =ETHERNET_MACLP_DriverIRQHandler - BX R0 - - PUBWEAK SINC_FILTER_IRQHandler - PUBWEAK SINC_FILTER_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SINC_FILTER_IRQHandler - LDR R0, =SINC_FILTER_DriverIRQHandler - BX R0 - - PUBWEAK LPTMR0_IRQHandler - PUBWEAK LPTMR0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LPTMR0_IRQHandler - LDR R0, =LPTMR0_DriverIRQHandler - BX R0 - - PUBWEAK LPTMR1_IRQHandler - PUBWEAK LPTMR1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -LPTMR1_IRQHandler - LDR R0, =LPTMR1_DriverIRQHandler - BX R0 - - PUBWEAK SCG_IRQHandler - PUBWEAK SCG_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SCG_IRQHandler - LDR R0, =SCG_DriverIRQHandler - BX R0 - - PUBWEAK SPC_IRQHandler - PUBWEAK SPC_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -SPC_IRQHandler - LDR R0, =SPC_DriverIRQHandler - BX R0 - - PUBWEAK WUU_IRQHandler - PUBWEAK WUU_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -WUU_IRQHandler - LDR R0, =WUU_DriverIRQHandler - BX R0 - - PUBWEAK PORT_EFT_IRQHandler - PUBWEAK PORT_EFT_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -PORT_EFT_IRQHandler - LDR R0, =PORT_EFT_DriverIRQHandler - BX R0 - - PUBWEAK ETB0_IRQHandler - PUBWEAK ETB0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -ETB0_IRQHandler - LDR R0, =ETB0_DriverIRQHandler - BX R0 - - PUBWEAK Reserved166_IRQHandler - PUBWEAK Reserved166_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved166_IRQHandler - LDR R0, =Reserved166_DriverIRQHandler - BX R0 - - PUBWEAK Reserved167_IRQHandler - PUBWEAK Reserved167_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -Reserved167_IRQHandler - LDR R0, =Reserved167_DriverIRQHandler - BX R0 - - PUBWEAK WWDT0_IRQHandler - PUBWEAK WWDT0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -WWDT0_IRQHandler - LDR R0, =WWDT0_DriverIRQHandler - BX R0 - - PUBWEAK WWDT1_IRQHandler - PUBWEAK WWDT1_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -WWDT1_IRQHandler - LDR R0, =WWDT1_DriverIRQHandler - BX R0 - - PUBWEAK CMC0_IRQHandler - PUBWEAK CMC0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CMC0_IRQHandler - LDR R0, =CMC0_DriverIRQHandler - BX R0 - - PUBWEAK CTI0_IRQHandler - PUBWEAK CTI0_DriverIRQHandler - SECTION .text:CODE:REORDER:NOROOT(2) -CTI0_IRQHandler - LDR R0, =CTI0_DriverIRQHandler - BX R0 - -OR_DriverIRQHandler -EDMA_0_CH0_DriverIRQHandler -EDMA_0_CH1_DriverIRQHandler -EDMA_0_CH2_DriverIRQHandler -EDMA_0_CH3_DriverIRQHandler -EDMA_0_CH4_DriverIRQHandler -EDMA_0_CH5_DriverIRQHandler -EDMA_0_CH6_DriverIRQHandler -EDMA_0_CH7_DriverIRQHandler -EDMA_0_CH8_DriverIRQHandler -EDMA_0_CH9_DriverIRQHandler -EDMA_0_CH10_DriverIRQHandler -EDMA_0_CH11_DriverIRQHandler -EDMA_0_CH12_DriverIRQHandler -EDMA_0_CH13_DriverIRQHandler -EDMA_0_CH14_DriverIRQHandler -EDMA_0_CH15_DriverIRQHandler -GPIO00_DriverIRQHandler -GPIO01_DriverIRQHandler -GPIO10_DriverIRQHandler -GPIO11_DriverIRQHandler -GPIO20_DriverIRQHandler -GPIO21_DriverIRQHandler -GPIO30_DriverIRQHandler -GPIO31_DriverIRQHandler -GPIO40_DriverIRQHandler -GPIO41_DriverIRQHandler -GPIO50_DriverIRQHandler -GPIO51_DriverIRQHandler -UTICK0_DriverIRQHandler -MRT0_DriverIRQHandler -CTIMER0_DriverIRQHandler -CTIMER1_DriverIRQHandler -SCT0_DriverIRQHandler -CTIMER2_DriverIRQHandler -LP_FLEXCOMM0_DriverIRQHandler -LP_FLEXCOMM1_DriverIRQHandler -LP_FLEXCOMM2_DriverIRQHandler -LP_FLEXCOMM3_DriverIRQHandler -LP_FLEXCOMM4_DriverIRQHandler -LP_FLEXCOMM5_DriverIRQHandler -LP_FLEXCOMM6_DriverIRQHandler -LP_FLEXCOMM7_DriverIRQHandler -LP_FLEXCOMM8_DriverIRQHandler -LP_FLEXCOMM9_DriverIRQHandler -ADC0_DriverIRQHandler -ADC1_DriverIRQHandler -PINT0_DriverIRQHandler -PDM_EVENT_DriverIRQHandler -Reserved65_DriverIRQHandler -USB0_FS_DriverIRQHandler -USB0_DCD_DriverIRQHandler -RTC_DriverIRQHandler -SMARTDMA_DriverIRQHandler -MAILBOX_DriverIRQHandler -CTIMER3_DriverIRQHandler -CTIMER4_DriverIRQHandler -OS_EVENT_DriverIRQHandler -FLEXSPI0_DriverIRQHandler -SAI0_DriverIRQHandler -SAI1_DriverIRQHandler -USDHC0_DriverIRQHandler -CAN0_DriverIRQHandler -CAN1_DriverIRQHandler -Reserved80_DriverIRQHandler -Reserved81_DriverIRQHandler -USB1_HS_PHY_DriverIRQHandler -USB1_HS_DriverIRQHandler -SEC_HYPERVISOR_CALL_DriverIRQHandler -Reserved85_DriverIRQHandler -PLU_DriverIRQHandler -Freqme_DriverIRQHandler -SEC_VIO_DriverIRQHandler -ELS_DriverIRQHandler -PKC_DriverIRQHandler -PUF_DriverIRQHandler -PQ_DriverIRQHandler -EDMA_1_CH0_DriverIRQHandler -EDMA_1_CH1_DriverIRQHandler -EDMA_1_CH2_DriverIRQHandler -EDMA_1_CH3_DriverIRQHandler -EDMA_1_CH4_DriverIRQHandler -EDMA_1_CH5_DriverIRQHandler -EDMA_1_CH6_DriverIRQHandler -EDMA_1_CH7_DriverIRQHandler -EDMA_1_CH8_DriverIRQHandler -EDMA_1_CH9_DriverIRQHandler -EDMA_1_CH10_DriverIRQHandler -EDMA_1_CH11_DriverIRQHandler -EDMA_1_CH12_DriverIRQHandler -EDMA_1_CH13_DriverIRQHandler -EDMA_1_CH14_DriverIRQHandler -EDMA_1_CH15_DriverIRQHandler -CDOG0_DriverIRQHandler -CDOG1_DriverIRQHandler -I3C0_DriverIRQHandler -I3C1_DriverIRQHandler -NPU_DriverIRQHandler -GDET_DriverIRQHandler -VBAT0_DriverIRQHandler -EWM0_DriverIRQHandler -TSI_END_OF_SCAN_DriverIRQHandler -TSI_OUT_OF_SCAN_DriverIRQHandler -EMVSIM0_DriverIRQHandler -EMVSIM1_DriverIRQHandler -FLEXIO_DriverIRQHandler -DAC0_DriverIRQHandler -DAC1_DriverIRQHandler -DAC2_DriverIRQHandler -HSCMP0_DriverIRQHandler -HSCMP1_DriverIRQHandler -HSCMP2_DriverIRQHandler -FLEXPWM0_RELOAD_ERROR_DriverIRQHandler -FLEXPWM0_FAULT_DriverIRQHandler -FLEXPWM0_SUBMODULE0_DriverIRQHandler -FLEXPWM0_SUBMODULE1_DriverIRQHandler -FLEXPWM0_SUBMODULE2_DriverIRQHandler -FLEXPWM0_SUBMODULE3_DriverIRQHandler -FLEXPWM1_RELOAD_ERROR_DriverIRQHandler -FLEXPWM1_FAULT_DriverIRQHandler -FLEXPWM1_SUBMODULE0_DriverIRQHandler -FLEXPWM1_SUBMODULE1_DriverIRQHandler -FLEXPWM1_SUBMODULE2_DriverIRQHandler -FLEXPWM1_SUBMODULE3_DriverIRQHandler -QDC0_COMPARE_DriverIRQHandler -QDC0_HOME_DriverIRQHandler -QDC0_WDG_SAB_DriverIRQHandler -QDC0_IDX_DriverIRQHandler -QDC1_COMPARE_DriverIRQHandler -QDC1_HOME_DriverIRQHandler -QDC1_WDG_SAB_DriverIRQHandler -QDC1_IDX_DriverIRQHandler -ITRC0_DriverIRQHandler -BSP32_DriverIRQHandler -ELS_ERR_DriverIRQHandler -PKC_ERR_DriverIRQHandler -ERM_SINGLE_BIT_ERROR_DriverIRQHandler -ERM_MULTI_BIT_ERROR_DriverIRQHandler -FMU0_DriverIRQHandler -ETHERNET_DriverIRQHandler -ETHERNET_PMT_DriverIRQHandler -ETHERNET_MACLP_DriverIRQHandler -SINC_FILTER_DriverIRQHandler -LPTMR0_DriverIRQHandler -LPTMR1_DriverIRQHandler -SCG_DriverIRQHandler -SPC_DriverIRQHandler -WUU_DriverIRQHandler -PORT_EFT_DriverIRQHandler -ETB0_DriverIRQHandler -Reserved166_DriverIRQHandler -Reserved167_DriverIRQHandler -WWDT0_DriverIRQHandler -WWDT1_DriverIRQHandler -CMC0_DriverIRQHandler -CTI0_DriverIRQHandler -DefaultISR - B . - - END diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/system_MCXN947_cm33_core0.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/system_MCXN947_cm33_core0.c deleted file mode 100644 index 9a52dd27713..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/system_MCXN947_cm33_core0.c +++ /dev/null @@ -1,130 +0,0 @@ -/* -** ################################################################### -** Processors: MCXN947VDF_cm33_core0 -** MCXN947VNL_cm33_core0 -** -** Compilers: GNU C Compiler -** IAR ANSI C/C++ Compiler for ARM -** Keil ARM C/C++ Compiler -** MCUXpresso Compiler -** -** Reference manual: MCXNx4x Reference Manual -** Version: rev. 2.0, 2023-02-01 -** Build: b231219 -** -** 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 -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** Revisions: -** - rev. 1.0 (2022-10-01) -** Initial version -** - rev. 2.0 (2023-02-01) -** Initial version based on Rev. 2 Draft B -** -** ################################################################### -*/ - -/*! - * @file MCXN947_cm33_core0 - * @version 2.0 - * @date 2023-02-01 - * @brief Device specific configuration file for MCXN947_cm33_core0 - * (implementation file) - * - * 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. - */ - -#include -#include "fsl_device_registers.h" - - - - - - -/* ---------------------------------------------------------------------------- - -- Core clock - ---------------------------------------------------------------------------- */ - -uint32_t SystemCoreClock = DEFAULT_SYSTEM_CLOCK; - -/* ---------------------------------------------------------------------------- - -- SystemInit() - ---------------------------------------------------------------------------- */ - -__attribute__ ((weak)) 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 << 0*2) | (3UL << 1*2)); /* set CP0, CP1 Full Access in Secure mode (enable PowerQuad) */ -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) - SCB_NS->CPACR |= ((3UL << 0*2) | (3UL << 1*2)); /* set CP0, CP1 Full Access in Normal mode (enable PowerQuad) */ -#endif /* (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ - - SCB->NSACR |= ((3UL << 0) | (3UL << 10)); /* enable CP0, CP1, CP10, CP11 Non-secure Access */ - - SYSCON->ECC_ENABLE_CTRL = 0; /* disable RAM ECC to get max RAM size */ - - SYSCON->NVM_CTRL &= ~SYSCON_NVM_CTRL_DIS_MBECC_ERR_DATA_MASK; /* enables bus error on multi-bit ECC error for data */ - -#if defined(__MCUXPRESSO) - extern void(*const g_pfnVectors[]) (void); - SCB->VTOR = (uint32_t) &g_pfnVectors; -#else - extern void *__Vectors; - SCB->VTOR = (uint32_t) &__Vectors; -#endif - /* enable the flash cache LPCAC */ - SYSCON->LPCAC_CTRL &= ~SYSCON_LPCAC_CTRL_DIS_LPCAC_MASK; - - /* Disable aGDET trigger the CHIP_RESET */ - ITRC0->OUT_SEL[4][0] = (ITRC0->OUT_SEL[4][0] & ~ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN9_SELn_MASK) | (ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN9_SELn(0x2)); - ITRC0->OUT_SEL[4][1] = (ITRC0->OUT_SEL[4][1] & ~ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN9_SELn_MASK) | (ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN9_SELn(0x2)); - /* Disable aGDET interrupt and reset */ - SPC0->ACTIVE_CFG |= SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE_MASK; - SPC0->GLITCH_DETECT_SC &= ~SPC_GLITCH_DETECT_SC_LOCK_MASK; - SPC0->GLITCH_DETECT_SC = 0x3C; - SPC0->GLITCH_DETECT_SC |= SPC_GLITCH_DETECT_SC_LOCK_MASK; - - /* Disable dGDET trigger the CHIP_RESET */ - ITRC0->OUT_SEL[4][0] = (ITRC0->OUT_SEL[4][0] & ~ ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN0_SELn_MASK) | (ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN0_SELn(0x2)); - ITRC0->OUT_SEL[4][1] = (ITRC0->OUT_SEL[4][1] & ~ ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN0_SELn_MASK) | (ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN0_SELn(0x2)); - GDET0->GDET_ENABLE1 = 0; - GDET1->GDET_ENABLE1 = 0; - - SystemInitHook(); -} - -/* ---------------------------------------------------------------------------- - -- SystemCoreClockUpdate() - ---------------------------------------------------------------------------- */ - -void SystemCoreClockUpdate (void) { - - - -} - -/* ---------------------------------------------------------------------------- - -- SystemInitHook() - ---------------------------------------------------------------------------- */ - -__attribute__ ((weak)) void SystemInitHook (void) { - /* Void implementation of the weak function. */ -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/system_MCXN947_cm33_core0.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/system_MCXN947_cm33_core0.h deleted file mode 100644 index 6d0550f3da2..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/system_MCXN947_cm33_core0.h +++ /dev/null @@ -1,108 +0,0 @@ -/* -** ################################################################### -** Processors: MCXN947VDF_cm33_core0 -** MCXN947VNL_cm33_core0 -** -** Compilers: GNU C Compiler -** IAR ANSI C/C++ Compiler for ARM -** Keil ARM C/C++ Compiler -** MCUXpresso Compiler -** -** Reference manual: MCXNx4x Reference Manual -** Version: rev. 2.0, 2023-02-01 -** Build: b231219 -** -** 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 -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** Revisions: -** - rev. 1.0 (2022-10-01) -** Initial version -** - rev. 2.0 (2023-02-01) -** Initial version based on Rev. 2 Draft B -** -** ################################################################### -*/ - -/*! - * @file MCXN947_cm33_core0 - * @version 2.0 - * @date 2023-02-01 - * @brief Device specific configuration file for MCXN947_cm33_core0 (header file) - * - * 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. - */ - -#ifndef _SYSTEM_MCXN947_cm33_core0_H_ -#define _SYSTEM_MCXN947_cm33_core0_H_ /**< Symbol preventing repeated inclusion */ - -#ifdef __cplusplus -extern "C" { -#endif - -#include - - - #define DEFAULT_SYSTEM_CLOCK 48000000u /* Default System clock value */ -#define CLK_FRO_12MHZ 12000000u /* FRO 12 MHz (fro_12m) */ -#define CLK_FRO_144MHZ 144000000u /* FRO 144 MHz (fro_144m) */ - - - -/** - * @brief System clock frequency (core clock) - * - * The system clock frequency supplied to the SysTick timer and the processor - * core clock. This variable can be used by the user application to setup the - * SysTick timer or configure other parameters. It may also be used by debugger to - * query the frequency of the debug timer or configure the trace clock speed - * SystemCoreClock is initialized with a correct predefined value. - */ -extern uint32_t SystemCoreClock; - -/** - * @brief Setup the microcontroller system. - * - * Typically this function configures the oscillator (PLL) that is part of the - * microcontroller device. For systems with variable clock speed it also updates - * the variable SystemCoreClock. SystemInit is called from startup_device file. - */ -void SystemInit (void); - -/** - * @brief Updates the SystemCoreClock variable. - * - * It must be called whenever the core clock is changed during program - * execution. SystemCoreClockUpdate() evaluates the clock register settings and calculates - * the current core clock. - */ -void SystemCoreClockUpdate (void); - -/** - * @brief SystemInit function hook. - * - * This weak function allows to call specific initialization code during the - * SystemInit() execution.This can be used when an application specific code needs - * to be called as close to the reset entry as possible (for example the Multicore - * Manager MCMGR_EarlyInit() function call). - * NOTE: No global r/w variables can be used in this hook function because the - * initialization of these variables happens after this function. - */ -void SystemInitHook (void); - -#ifdef __cplusplus -} -#endif - -#endif /* _SYSTEM_MCXN947_cm33_core0_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/system_MCXN947_cm33_core1.c b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/system_MCXN947_cm33_core1.c deleted file mode 100644 index ff9f3ae73d1..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/system_MCXN947_cm33_core1.c +++ /dev/null @@ -1,124 +0,0 @@ -/* -** ################################################################### -** Processors: MCXN947VDF_cm33_core1 -** MCXN947VNL_cm33_core1 -** -** Compilers: GNU C Compiler -** IAR ANSI C/C++ Compiler for ARM -** Keil ARM C/C++ Compiler -** MCUXpresso Compiler -** -** Reference manual: MCXNx4x Reference Manual -** Version: rev. 2.0, 2023-02-01 -** Build: b231219 -** -** 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 -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** Revisions: -** - rev. 1.0 (2022-10-01) -** Initial version -** - rev. 2.0 (2023-02-01) -** Initial version based on Rev. 2 Draft B -** -** ################################################################### -*/ - -/*! - * @file MCXN947_cm33_core1 - * @version 2.0 - * @date 2023-02-01 - * @brief Device specific configuration file for MCXN947_cm33_core1 - * (implementation file) - * - * 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. - */ - -#include -#include "fsl_device_registers.h" - - - - - - -/* ---------------------------------------------------------------------------- - -- Core clock - ---------------------------------------------------------------------------- */ - -uint32_t SystemCoreClock = DEFAULT_SYSTEM_CLOCK; - -/* ---------------------------------------------------------------------------- - -- SystemInit() - ---------------------------------------------------------------------------- */ - -__attribute__ ((weak)) void SystemInit (void) { - - - SCB->CPACR |= ((3UL << 0*2) | (3UL << 1*2)); /* set CP0, CP1 Full Access in Secure mode (enable PowerQuad) */ -#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) - SCB_NS->CPACR |= ((3UL << 0*2) | (3UL << 1*2)); /* set CP0, CP1 Full Access in Normal mode (enable PowerQuad) */ -#endif /* (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ - - SCB->NSACR |= ((3UL << 0) | (3UL << 10)); /* enable CP0, CP1, CP10, CP11 Non-secure Access */ - - SYSCON->ECC_ENABLE_CTRL = 0; /* disable RAM ECC to get max RAM size */ - - SYSCON->NVM_CTRL &= ~SYSCON_NVM_CTRL_DIS_MBECC_ERR_DATA_MASK; /* enables bus error on multi-bit ECC error for data */ - -#if defined(__MCUXPRESSO) - extern void(*const g_pfnVectors[]) (void); - SCB->VTOR = (uint32_t) &g_pfnVectors; -#else - extern void *__Vectors; - SCB->VTOR = (uint32_t) &__Vectors; -#endif - /* enable the flash cache LPCAC */ - SYSCON->LPCAC_CTRL &= ~SYSCON_LPCAC_CTRL_DIS_LPCAC_MASK; - - /* Disable aGDET trigger the CHIP_RESET */ - ITRC0->OUT_SEL[4][0] = (ITRC0->OUT_SEL[4][0] & ~ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN9_SELn_MASK) | (ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN9_SELn(0x2)); - ITRC0->OUT_SEL[4][1] = (ITRC0->OUT_SEL[4][1] & ~ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN9_SELn_MASK) | (ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN9_SELn(0x2)); - /* Disable aGDET interrupt and reset */ - SPC0->ACTIVE_CFG |= SPC_ACTIVE_CFG_GLITCH_DETECT_DISABLE_MASK; - SPC0->GLITCH_DETECT_SC &= ~SPC_GLITCH_DETECT_SC_LOCK_MASK; - SPC0->GLITCH_DETECT_SC = 0x3C; - SPC0->GLITCH_DETECT_SC |= SPC_GLITCH_DETECT_SC_LOCK_MASK; - - /* Disable dGDET trigger the CHIP_RESET */ - ITRC0->OUT_SEL[4][0] = (ITRC0->OUT_SEL[4][0] & ~ ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN0_SELn_MASK) | (ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN0_SELn(0x2)); - ITRC0->OUT_SEL[4][1] = (ITRC0->OUT_SEL[4][1] & ~ ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN0_SELn_MASK) | (ITRC_OUTX_SEL_OUTX_SELY_OUT_SEL_IN0_SELn(0x2)); - GDET0->GDET_ENABLE1 = 0; - GDET1->GDET_ENABLE1 = 0; - - SystemInitHook(); -} - -/* ---------------------------------------------------------------------------- - -- SystemCoreClockUpdate() - ---------------------------------------------------------------------------- */ - -void SystemCoreClockUpdate (void) { - - - -} - -/* ---------------------------------------------------------------------------- - -- SystemInitHook() - ---------------------------------------------------------------------------- */ - -__attribute__ ((weak)) void SystemInitHook (void) { - /* Void implementation of the weak function. */ -} diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/system_MCXN947_cm33_core1.h b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/system_MCXN947_cm33_core1.h deleted file mode 100644 index 08f8fe9a2fb..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/MCXN947/system_MCXN947_cm33_core1.h +++ /dev/null @@ -1,108 +0,0 @@ -/* -** ################################################################### -** Processors: MCXN947VDF_cm33_core1 -** MCXN947VNL_cm33_core1 -** -** Compilers: GNU C Compiler -** IAR ANSI C/C++ Compiler for ARM -** Keil ARM C/C++ Compiler -** MCUXpresso Compiler -** -** Reference manual: MCXNx4x Reference Manual -** Version: rev. 2.0, 2023-02-01 -** Build: b231219 -** -** 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 -** SPDX-License-Identifier: BSD-3-Clause -** -** http: www.nxp.com -** mail: support@nxp.com -** -** Revisions: -** - rev. 1.0 (2022-10-01) -** Initial version -** - rev. 2.0 (2023-02-01) -** Initial version based on Rev. 2 Draft B -** -** ################################################################### -*/ - -/*! - * @file MCXN947_cm33_core1 - * @version 2.0 - * @date 2023-02-01 - * @brief Device specific configuration file for MCXN947_cm33_core1 (header file) - * - * 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. - */ - -#ifndef _SYSTEM_MCXN947_cm33_core1_H_ -#define _SYSTEM_MCXN947_cm33_core1_H_ /**< Symbol preventing repeated inclusion */ - -#ifdef __cplusplus -extern "C" { -#endif - -#include - - - #define DEFAULT_SYSTEM_CLOCK 48000000u /* Default System clock value */ -#define CLK_FRO_12MHZ 12000000u /* FRO 12 MHz (fro_12m) */ -#define CLK_FRO_144MHZ 144000000u /* FRO 144 MHz (fro_144m) */ - - - -/** - * @brief System clock frequency (core clock) - * - * The system clock frequency supplied to the SysTick timer and the processor - * core clock. This variable can be used by the user application to setup the - * SysTick timer or configure other parameters. It may also be used by debugger to - * query the frequency of the debug timer or configure the trace clock speed - * SystemCoreClock is initialized with a correct predefined value. - */ -extern uint32_t SystemCoreClock; - -/** - * @brief Setup the microcontroller system. - * - * Typically this function configures the oscillator (PLL) that is part of the - * microcontroller device. For systems with variable clock speed it also updates - * the variable SystemCoreClock. SystemInit is called from startup_device file. - */ -void SystemInit (void); - -/** - * @brief Updates the SystemCoreClock variable. - * - * It must be called whenever the core clock is changed during program - * execution. SystemCoreClockUpdate() evaluates the clock register settings and calculates - * the current core clock. - */ -void SystemCoreClockUpdate (void); - -/** - * @brief SystemInit function hook. - * - * This weak function allows to call specific initialization code during the - * SystemInit() execution.This can be used when an application specific code needs - * to be called as close to the reset entry as possible (for example the Multicore - * Manager MCMGR_EarlyInit() function call). - * NOTE: No global r/w variables can be used in this hook function because the - * initialization of these variables happens after this function. - */ -void SystemInitHook (void); - -#ifdef __cplusplus -} -#endif - -#endif /* _SYSTEM_MCXN947_cm33_core1_H_ */ diff --git a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/SConscript b/bsp/nxp/mcx/mcxn/Libraries/MCXN947/SConscript deleted file mode 100644 index 7be4cc8aca3..00000000000 --- a/bsp/nxp/mcx/mcxn/Libraries/MCXN947/SConscript +++ /dev/null @@ -1,118 +0,0 @@ -Import('rtconfig') -from building import * - -cwd = GetCurrentDir() -path = [cwd + '/../CMSIS/Core/Include', cwd + '/MCXN947', cwd + '/MCXN947/drivers'] -src = Split(''' - MCXN947/system_MCXN947_cm33_core0.c - ''') - -if rtconfig.PLATFORM in ['gcc']: - src += ['MCXN947/gcc/startup_MCXN947_cm33_core0.S'] -elif rtconfig.PLATFORM in ['armcc', 'armclang']: - src += ['MCXN947/arm/startup_MCXN947_cm33_core0.s'] -elif rtconfig.PLATFORM in ['iccarm']: - src += ['MCXN947/iar/startup_MCXN947_cm33_core0.s'] - -src += ['MCXN947/drivers/fsl_cache.c'] -src += ['MCXN947/drivers/fsl_cache_lpcac.c'] -src += ['MCXN947/drivers/fsl_cdog.c'] -src += ['MCXN947/drivers/fsl_clock.c'] -src += ['MCXN947/drivers/fsl_cmc.c'] -src += ['MCXN947/drivers/fsl_common.c'] -src += ['MCXN947/drivers/fsl_common_arm.c'] -src += ['MCXN947/drivers/fsl_crc.c'] -src += ['MCXN947/drivers/fsl_ctimer.c'] -src += ['MCXN947/drivers/fsl_dac.c'] -src += ['MCXN947/drivers/fsl_dac14.c'] -src += ['MCXN947/drivers/fsl_edma.c'] -src += ['MCXN947/drivers/fsl_edma_soc.c'] -src += ['MCXN947/drivers/fsl_eim.c'] -src += ['MCXN947/drivers/fsl_enet.c'] -src += ['MCXN947/drivers/fsl_erm.c'] -src += ['MCXN947/drivers/fsl_evtg.c'] -src += ['MCXN947/drivers/fsl_ewm.c'] -src += ['MCXN947/drivers/fsl_flexcan.c'] -src += ['MCXN947/drivers/fsl_flexcan_edma.c'] -src += ['MCXN947/drivers/fsl_flexio.c'] -src += ['MCXN947/drivers/fsl_flexio_i2c_master.c'] -src += ['MCXN947/drivers/fsl_flexio_mculcd.c'] -src += ['MCXN947/drivers/fsl_flexio_mculcd_edma.c'] -src += ['MCXN947/drivers/fsl_flexio_mculcd_smartdma.c'] -src += ['MCXN947/drivers/fsl_flexio_spi.c'] -src += ['MCXN947/drivers/fsl_flexio_spi_edma.c'] -src += ['MCXN947/drivers/fsl_flexio_uart.c'] -src += ['MCXN947/drivers/fsl_flexio_uart_edma.c'] -src += ['MCXN947/drivers/fsl_flexspi.c'] -src += ['MCXN947/drivers/fsl_flexspi_edma.c'] -src += ['MCXN947/drivers/fsl_freqme.c'] -src += ['MCXN947/drivers/fsl_gdet.c'] -src += ['MCXN947/drivers/fsl_gpio.c'] -src += ['MCXN947/drivers/fsl_i3c.c'] -src += ['MCXN947/drivers/fsl_i3c_edma.c'] -src += ['MCXN947/drivers/fsl_inputmux.c'] -src += ['MCXN947/drivers/fsl_intm.c'] -src += ['MCXN947/drivers/fsl_irtc.c'] -src += ['MCXN947/drivers/fsl_itrc.c'] -src += ['MCXN947/drivers/fsl_lpadc.c'] -src += ['MCXN947/drivers/fsl_lpcmp.c'] -src += ['MCXN947/drivers/fsl_lpflexcomm.c'] -src += ['MCXN947/drivers/fsl_lpi2c.c'] -src += ['MCXN947/drivers/fsl_lpi2c_edma.c'] -src += ['MCXN947/drivers/fsl_lpspi.c'] -src += ['MCXN947/drivers/fsl_lpspi_edma.c'] -src += ['MCXN947/drivers/fsl_lptmr.c'] -src += ['MCXN947/drivers/fsl_lpuart.c'] -src += ['MCXN947/drivers/fsl_lpuart_edma.c'] -src += ['MCXN947/drivers/fsl_mrt.c'] -src += ['MCXN947/drivers/fsl_opamp.c'] -src += ['MCXN947/drivers/fsl_ostimer.c'] -src += ['MCXN947/drivers/fsl_pdm.c'] -src += ['MCXN947/drivers/fsl_pdm_edma.c'] -src += ['MCXN947/drivers/fsl_pint.c'] -src += ['MCXN947/drivers/fsl_plu.c'] -src += ['MCXN947/drivers/fsl_power.c'] -src += ['MCXN947/drivers/fsl_powerquad_basic.c'] -src += ['MCXN947/drivers/fsl_powerquad_data.c'] -src += ['MCXN947/drivers/fsl_powerquad_filter.c'] -src += ['MCXN947/drivers/fsl_powerquad_math.c'] -src += ['MCXN947/drivers/fsl_powerquad_matrix.c'] -src += ['MCXN947/drivers/fsl_powerquad_transform.c'] -src += ['MCXN947/drivers/fsl_puf_v3.c'] -src += ['MCXN947/drivers/fsl_pwm.c'] -src += ['MCXN947/drivers/fsl_qdc.c'] -src += ['MCXN947/drivers/fsl_reset.c'] -src += ['MCXN947/drivers/fsl_sai.c'] -src += ['MCXN947/drivers/fsl_sai_edma.c'] -src += ['MCXN947/drivers/fsl_sctimer.c'] -src += ['MCXN947/drivers/fsl_sema42.c'] -src += ['MCXN947/drivers/fsl_sinc.c'] -src += ['MCXN947/drivers/fsl_smartcard_emvsim.c'] -src += ['MCXN947/drivers/fsl_smartcard_phy_emvsim.c'] -src += ['MCXN947/drivers/fsl_smartdma.c'] -src += ['MCXN947/drivers/fsl_smartdma_mcxn.c'] -src += ['MCXN947/drivers/fsl_smartdma_rt500.c'] -src += ['MCXN947/drivers/fsl_spc.c'] -src += ['MCXN947/drivers/fsl_syspm.c'] -src += ['MCXN947/drivers/fsl_tdet.c'] -src += ['MCXN947/drivers/fsl_trdc.c'] -src += ['MCXN947/drivers/fsl_tsi_v6.c'] -src += ['MCXN947/drivers/fsl_usdhc.c'] -src += ['MCXN947/drivers/fsl_utick.c'] -src += ['MCXN947/drivers/fsl_vbat.c'] -src += ['MCXN947/drivers/fsl_vref.c'] -src += ['MCXN947/drivers/fsl_wuu.c'] -src += ['MCXN947/drivers/fsl_wwdt.c'] -src += ['MCXN947/drivers/romapi/flash/src/fsl_flash.c'] -src += ['MCXN947/drivers/romapi/mem_interface/src/fsl_mem_interface.c'] -src += ['MCXN947/drivers/romapi/nboot/src/fsl_nboot.c'] -src += ['MCXN947/drivers/romapi/runbootloader/src/fsl_runbootloader.c'] - -path += [cwd + '/MCXN947/drivers/romapi/flash'] -path += [cwd + '/MCXN947/drivers/romapi/mem_interface'] -path += [cwd + '/MCXN947/drivers/romapi/nboot'] -path += [cwd + '/MCXN947/drivers/romapi/runbootloader'] - -group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path) - -Return('group') diff --git a/bsp/nxp/mcx/mcxn/frdm-mcxn236/.config b/bsp/nxp/mcx/mcxn/frdm-mcxn236/.config index 30b78c0966c..2824dfce4a8 100644 --- a/bsp/nxp/mcx/mcxn/frdm-mcxn236/.config +++ b/bsp/nxp/mcx/mcxn/frdm-mcxn236/.config @@ -1181,7 +1181,7 @@ CONFIG_ULOG_BACKEND_USING_CONSOLE=y # # Hardware Drivers Config # -CONFIG_SOC_MCXN947=y +CONFIG_SOC_MCXN236=y # # On-chip Peripheral Drivers diff --git a/bsp/nxp/mcx/mcxn/frdm-mcxn236/SConstruct b/bsp/nxp/mcx/mcxn/frdm-mcxn236/SConstruct index ed0bfe11ffd..00c4630c61b 100644 --- a/bsp/nxp/mcx/mcxn/frdm-mcxn236/SConstruct +++ b/bsp/nxp/mcx/mcxn/frdm-mcxn236/SConstruct @@ -15,6 +15,24 @@ except: print(RTT_ROOT) exit(-1) +def bsp_pkg_check(): + import subprocess + + check_paths = [ + os.path.join("packages", "nxp-mcx-cmsis-latest"), + os.path.join("packages", "nxp-mcx-series-latest"), + ] + + need_update = not all(os.path.exists(p) for p in check_paths) + + if need_update: + print("\n==============================================================") + print("Dependency packages missing, please running 'pkgs --update'...") + print("==============================================================") + exit(1) + +RegisterPreBuildingAction(bsp_pkg_check) + TARGET = 'rtthread.' + rtconfig.TARGET_EXT if rtconfig.PLATFORM == 'armcc': @@ -60,8 +78,6 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) objs.extend(SConscript(os.path.join(libraries_path_prefix, 'drivers', 'SConscript'))) -# include cmsis -objs.extend(SConscript(os.path.join(libraries_path_prefix, rtconfig.BSP_LIBRARY_TYPE, 'SConscript'))) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/nxp/mcx/mcxn/frdm-mcxn236/board/Kconfig b/bsp/nxp/mcx/mcxn/frdm-mcxn236/board/Kconfig index cd39268f143..7a99272d420 100644 --- a/bsp/nxp/mcx/mcxn/frdm-mcxn236/board/Kconfig +++ b/bsp/nxp/mcx/mcxn/frdm-mcxn236/board/Kconfig @@ -1,8 +1,8 @@ menu "Hardware Drivers Config" -config SOC_MCXN947 +config SOC_MCXN236 bool - select SOC_MCXN947_SERIES + select SOC_MCXN236_SERIES select RT_USING_COMPONENTS_INIT select RT_USING_USER_MAIN default y diff --git a/bsp/nxp/mcx/mcxn/frdm-mcxn236/rtconfig.h b/bsp/nxp/mcx/mcxn/frdm-mcxn236/rtconfig.h index 57428d72fb6..3ef0aca8e9c 100644 --- a/bsp/nxp/mcx/mcxn/frdm-mcxn236/rtconfig.h +++ b/bsp/nxp/mcx/mcxn/frdm-mcxn236/rtconfig.h @@ -348,7 +348,7 @@ /* Hardware Drivers Config */ -#define SOC_MCXN947 +#define SOC_MCXN236 /* On-chip Peripheral Drivers */ diff --git a/bsp/nxp/mcx/mcxn/frdm-mcxn947/README_EN.md b/bsp/nxp/mcx/mcxn/frdm-mcxn947/README_EN.md index 79c9e66137a..bed1fb2c02b 100644 --- a/bsp/nxp/mcx/mcxn/frdm-mcxn947/README_EN.md +++ b/bsp/nxp/mcx/mcxn/frdm-mcxn947/README_EN.md @@ -36,6 +36,14 @@ Currently, the FRDM-MCXN947 board-level support package provides MDK5 and suppor ### Compile the Download +**Please note!!!** + +Before performing the compilation process, please first open the ENV and execute the following command (this command is used to pull the necessary libraries; otherwise, the compilation will not be successful): + +```bash +pkgs --update +``` + Go to the `rt-thread\bsp\nxp\mcxn\frdm-mcxn947` folder and double click on the project.uvprojx file to open the MDK5 project. ![dir](figures/dir.png) diff --git a/bsp/nxp/mcx/mcxn/frdm-mcxn947/SConstruct b/bsp/nxp/mcx/mcxn/frdm-mcxn947/SConstruct index ed0bfe11ffd..6e65952c0eb 100644 --- a/bsp/nxp/mcx/mcxn/frdm-mcxn947/SConstruct +++ b/bsp/nxp/mcx/mcxn/frdm-mcxn947/SConstruct @@ -15,6 +15,24 @@ except: print(RTT_ROOT) exit(-1) +def bsp_pkg_check(): + import subprocess + + check_paths = [ + os.path.join("packages", "nxp-mcx-cmsis-latest"), + os.path.join("packages", "nxp-mcx-series-latest"), + ] + + need_update = not all(os.path.exists(p) for p in check_paths) + + if need_update: + print("\n==============================================================") + print("Dependency packages missing, please running 'pkgs --update'...") + print("==============================================================") + exit(1) + +RegisterPreBuildingAction(bsp_pkg_check) + TARGET = 'rtthread.' + rtconfig.TARGET_EXT if rtconfig.PLATFORM == 'armcc': @@ -60,8 +78,5 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) objs.extend(SConscript(os.path.join(libraries_path_prefix, 'drivers', 'SConscript'))) -# include cmsis -objs.extend(SConscript(os.path.join(libraries_path_prefix, rtconfig.BSP_LIBRARY_TYPE, 'SConscript'))) - # make a building DoBuilding(TARGET, objs) diff --git a/bsp/nxp/mcx/tools/sdk_dist.py b/bsp/nxp/mcx/tools/sdk_dist.py index 844fd61d9e8..ac693633324 100644 --- a/bsp/nxp/mcx/tools/sdk_dist.py +++ b/bsp/nxp/mcx/tools/sdk_dist.py @@ -13,10 +13,6 @@ def dist_do_building(BSP_ROOT, dist_dir): library_dir = os.path.join(dist_dir, 'Libraries') print("=> copy bsp drivers") bsp_copy_files(os.path.join(library_path, 'drivers'), os.path.join(library_dir, 'drivers')) - print("=> copy bsp CMSIS") - bsp_copy_files(os.path.join(library_path, 'CMSIS'), os.path.join(library_dir, 'CMSIS')) - print("=> copy bsp library") - bsp_copy_files(os.path.join(library_path, rtconfig.BSP_LIBRARY_TYPE), os.path.join(library_dir, rtconfig.BSP_LIBRARY_TYPE)) shutil.copyfile(os.path.join(library_path, 'Kconfig'), os.path.join(library_dir, 'Kconfig')) # if project Kconfig not exists, no more work to do!